[med-svn] [sra-sdk] 01/01: Add build log for 2.3.3-4~dfsg-1_amd64

Andreas Tille tille at debian.org
Wed Oct 23 11:14:16 UTC 2013


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch meta
in repository sra-sdk.

commit e166b95e5b04e006932a97e1fcfa3e82ee8eb871
Author: Andreas Tille <tille at debian.org>
Date:   Wed Oct 23 13:17:52 2013 +0200

    Add build log for 2.3.3-4~dfsg-1_amd64
---
 .gitignore                                         |    1 -
 Makefile                                           |  110 -
 README                                             |   44 -
 README-WINDOWS.txt                                 |  144 -
 README-build.txt                                   |  259 -
 README-config.txt                                  |   58 -
 build/BUILD.linux                                  |    1 -
 build/BUILD.mac                                    |    1 -
 build/BUILD.win                                    |    1 -
 build/COMP.linux                                   |    1 -
 build/COMP.mac                                     |    1 -
 build/COMP.win                                     |    1 -
 build/LNKG.linux                                   |    1 -
 build/LNKG.mac                                     |    1 -
 build/LNKG.win                                     |    1 -
 build/Makefile.clang                               |   80 -
 build/Makefile.env                                 |  343 -
 build/Makefile.gcc                                 |   81 -
 build/Makefile.icc                                 |   77 -
 build/Makefile.linux                               |   82 -
 build/Makefile.mac                                 |   77 -
 build/Makefile.rules                               |  104 -
 build/Makefile.shell                               |  150 -
 build/Makefile.targets                             |  114 -
 build/Makefile.vc++                                |   80 -
 build/Makefile.win                                 |   66 -
 build/abspath.sh                                   |   31 -
 build/cc.sh                                        |  129 -
 build/increment-release.sh                         |   44 -
 build/ld.linux.cmn.sh                              |  158 -
 build/ld.linux.dlib.sh                             |  308 -
 build/ld.linux.exe.sh                              |  322 -
 build/ld.linux.gcc.sh                              |   47 -
 build/ld.linux.icc.sh                              |   47 -
 build/ld.linux.ln.sh                               |   98 -
 build/ld.linux.slib.sh                             |  146 -
 build/ld.mac.cmn.sh                                |  159 -
 build/ld.mac.dlib.sh                               |  361 -
 build/ld.mac.exe.sh                                |  340 -
 build/ld.mac.gcc.sh                                |   53 -
 build/ld.mac.ln.sh                                 |  103 -
 build/ld.mac.slib.sh                               |  130 -
 build/ld.sh                                        |  558 -
 build/ld.unix.cmn.sh                               |  149 -
 build/ld.unix.slib.sh                              |  124 -
 build/ld.win.cmn.sh                                |  217 -
 build/ld.win.dlib.sh                               |  327 -
 build/ld.win.exe.sh                                |  321 -
 build/ld.win.slib.sh                               |  135 -
 build/ld.win.stub.sh                               |   60 -
 build/ld.win.vc++.sh                               |   65 -
 build/mac.arch.sh                                  |   87 -
 build/make-vers-inc.sh                             |   46 -
 build/sra-dflt-schema.sh                           |  163 -
 build/win-cc.sh                                    |  269 -
 configuration-assistant.perl                       | 1211 -
 debian/changelog                                   |   61 -
 debian/compat                                      |    1 -
 debian/control                                     |   73 -
 debian/copyright                                   |  211 -
 debian/docs                                        |    2 -
 debian/gbp.conf                                    |    9 -
 debian/patches/10_portability.patch                |   76 -
 debian/patches/build-with-system-libbz2-libz.patch |   36 -
 debian/patches/do_not_build_external_libs.patch    |   14 -
 debian/patches/hardening-format-security.patch     |   43 -
 debian/patches/hardening.patch                     |   39 -
 debian/patches/series                              |    5 -
 debian/rules                                       |   31 -
 debian/source/format                               |    1 -
 debian/sra-toolkit-libs-dev.install                |    1 -
 debian/sra-toolkit-libs0.install                   |    1 -
 debian/sra-toolkit-libs0.lintian-overrides         |    3 -
 debian/sra-toolkit-libs0.symbols                   | 6085 ----
 debian/sra-toolkit.install                         |    3 -
 debian/upstream                                    |   12 -
 debian/watch                                       |    3 -
 doc/help/html/abi-dump-help.html                   |   45 -
 doc/help/html/abi-load-help.html                   |   41 -
 doc/help/html/bam-load-help.html                   |   29 -
 doc/help/html/copycat-help.html                    |   64 -
 doc/help/html/crc32sum-help.html                   |   18 -
 doc/help/html/fastq-dump-help.html                 |   88 -
 doc/help/html/fastq-load-help.html                 |   41 -
 doc/help/html/illumina-dump-help.html              |   48 -
 doc/help/html/illumina-load-help.html              |   41 -
 doc/help/html/kar-help.html                        |   66 -
 doc/help/html/kdbmeta-help.html                    |   50 -
 doc/help/html/kqsh-help.html                       |   19 -
 doc/help/html/md5cp-help.html                      |   21 -
 doc/help/html/rcexplain-help.html                  |   27 -
 doc/help/html/sff-dump-help.html                   |   38 -
 doc/help/html/sra-dump-help.html                   |   38 -
 doc/help/html/sra-stat-help.html                   |   34 -
 doc/help/html/srapath-help.html                    |   47 -
 doc/help/html/srf-load-help.html                   |   41 -
 doc/help/html/txt2kdb-help.html                    |   48 -
 doc/help/html/vdb-dump-help.html                   |   45 -
 doc/help/txt/abi-dump-help.txt                     |   19 -
 doc/help/txt/abi-load-help.txt                     |   41 -
 doc/help/txt/bam-loader-help.txt                   |   18 -
 doc/help/txt/copycat-help.txt                      |   53 -
 doc/help/txt/crc32sum-help.txt                     |    6 -
 doc/help/txt/fastq-dump-help.txt                   |   57 -
 doc/help/txt/fastq-load-help.txt                   |   41 -
 doc/help/txt/illumina-dump-help.txt                |   29 -
 doc/help/txt/illumina-load-help.txt                |   41 -
 doc/help/txt/kar-help.txt                          |   48 -
 doc/help/txt/kdbmeta-help.txt                      |   30 -
 doc/help/txt/kqsh-help.txt                         |    7 -
 doc/help/txt/md5cp-help.txt                        |    8 -
 doc/help/txt/rcexplain-help.txt                    |    5 -
 doc/help/txt/sff-dump-help.txt                     |   19 -
 doc/help/txt/sra-dump-help.txt                     |   18 -
 doc/help/txt/sra-stat-help.txt                     |   19 -
 doc/help/txt/srapath-help.txt                      |   35 -
 doc/help/txt/srf-load-help.txt                     |   41 -
 doc/help/txt/txt2kdb-help.txt                      |   36 -
 doc/help/txt/vdb-dump-help.txt                     |   34 -
 interfaces/align/align-access.h                    |  322 -
 interfaces/align/align.vschema                     | 1487 -
 interfaces/align/alignsrc.h                        |   71 -
 interfaces/align/bam.h                             |  807 -
 interfaces/align/dna-reverse-cmpl.h                |   43 -
 interfaces/align/extern.h                          |   41 -
 interfaces/align/iterator.h                        |  610 -
 interfaces/align/manager.h                         |   69 -
 interfaces/align/qstat.vschema                     |   87 -
 interfaces/align/quality-quantizer.h               |   49 -
 interfaces/align/reader-refseq.h                   |   69 -
 interfaces/align/reference.h                       |  150 -
 interfaces/align/refseq-mgr.h                      |   86 -
 interfaces/align/refseq.vschema                    |  100 -
 interfaces/align/seq.vschema                       |  300 -
 interfaces/align/writer-alignment.h                |  177 -
 interfaces/align/writer-cmn.h                      |   46 -
 interfaces/align/writer-reference.h                |  150 -
 interfaces/align/writer-refseq.h                   |   89 -
 interfaces/align/writer-sequence.h                 |  149 -
 interfaces/cc/gcc/compiler.h                       |   39 -
 interfaces/cc/gcc/i386/arch-impl.h                 |  384 -
 interfaces/cc/gcc/i386/atomic.h                    |  162 -
 interfaces/cc/gcc/i386/atomic32.h                  |  369 -
 interfaces/cc/gcc/i386/bitstr.h                    |   39 -
 interfaces/cc/gcc/i386/byteswap.h                  |   89 -
 interfaces/cc/gcc/i386/strtol.h                    |   67 -
 interfaces/cc/gcc/noarch/bitstr.h                  |  413 -
 interfaces/cc/gcc/v128.h                           | 1088 -
 interfaces/cc/gcc/va_copy.h                        |   49 -
 interfaces/cc/gcc/x86_64/arch-impl.h               |  330 -
 interfaces/cc/gcc/x86_64/atomic.h                  |  176 -
 interfaces/cc/gcc/x86_64/atomic32.h                |  358 -
 interfaces/cc/gcc/x86_64/atomic64.h                |  358 -
 interfaces/cc/gcc/x86_64/bitstr.h                  |   39 -
 interfaces/cc/gcc/x86_64/byteswap.h                |   89 -
 interfaces/cc/gcc/x86_64/strtol.h                  |   69 -
 interfaces/cc/icc/compiler.h                       |   39 -
 interfaces/cc/vc++/compiler.h                      |   72 -
 interfaces/cc/vc++/i386/arch-impl.h                |   42 -
 interfaces/cc/vc++/i386/bitstr.h                   |   39 -
 interfaces/cc/vc++/noarch/arch-impl.h              |  286 -
 interfaces/cc/vc++/noarch/bitstr.h                 |  412 -
 interfaces/cc/vc++/stdbool.h                       |   46 -
 interfaces/cc/vc++/stdint.h                        |  119 -
 interfaces/cc/vc++/va_copy.h                       |   43 -
 interfaces/cc/vc++/x86_64/arch-impl.h              |   42 -
 interfaces/cc/vc++/x86_64/bitstr.h                 |   39 -
 interfaces/ext/bzlib.h                             |  282 -
 interfaces/ext/libxml/DOCBparser.h                 |   96 -
 interfaces/ext/libxml/HTMLparser.h                 |  303 -
 interfaces/ext/libxml/HTMLtree.h                   |  147 -
 interfaces/ext/libxml/SAX.h                        |  173 -
 interfaces/ext/libxml/SAX2.h                       |  176 -
 interfaces/ext/libxml/c14n.h                       |  115 -
 interfaces/ext/libxml/catalog.h                    |  182 -
 interfaces/ext/libxml/chvalid.h                    |  230 -
 interfaces/ext/libxml/debugXML.h                   |  217 -
 interfaces/ext/libxml/dict.h                       |   69 -
 interfaces/ext/libxml/encoding.h                   |  226 -
 interfaces/ext/libxml/entities.h                   |  150 -
 interfaces/ext/libxml/globals.h                    |  491 -
 interfaces/ext/libxml/hash.h                       |  233 -
 interfaces/ext/libxml/list.h                       |  137 -
 interfaces/ext/libxml/nanoftp.h                    |  143 -
 interfaces/ext/libxml/nanohttp.h                   |   81 -
 interfaces/ext/libxml/parser.h                     | 1226 -
 interfaces/ext/libxml/parserInternals.h            |  611 -
 interfaces/ext/libxml/pattern.h                    |  100 -
 interfaces/ext/libxml/relaxng.h                    |  213 -
 interfaces/ext/libxml/schemasInternals.h           |  958 -
 interfaces/ext/libxml/schematron.h                 |  142 -
 interfaces/ext/libxml/threads.h                    |   84 -
 interfaces/ext/libxml/tree.h                       | 1252 -
 interfaces/ext/libxml/uri.h                        |   94 -
 interfaces/ext/libxml/valid.h                      |  458 -
 interfaces/ext/libxml/xinclude.h                   |  125 -
 interfaces/ext/libxml/xlink.h                      |  189 -
 interfaces/ext/libxml/xmlIO.h                      |  360 -
 interfaces/ext/libxml/xmlautomata.h                |  146 -
 interfaces/ext/libxml/xmlerror.h                   |  944 -
 interfaces/ext/libxml/xmlexports.h                 |  157 -
 interfaces/ext/libxml/xmlmemory.h                  |  224 -
 interfaces/ext/libxml/xmlmodule.h                  |   57 -
 interfaces/ext/libxml/xmlreader.h                  |  424 -
 interfaces/ext/libxml/xmlregexp.h                  |  222 -
 interfaces/ext/libxml/xmlsave.h                    |   87 -
 interfaces/ext/libxml/xmlschemas.h                 |  218 -
 interfaces/ext/libxml/xmlschemastypes.h            |  151 -
 interfaces/ext/libxml/xmlstring.h                  |  140 -
 interfaces/ext/libxml/xmlunicode.h                 |  202 -
 interfaces/ext/libxml/xmlversion.h                 |  458 -
 interfaces/ext/libxml/xmlwriter.h                  |  485 -
 interfaces/ext/libxml/xpath.h                      |  546 -
 interfaces/ext/libxml/xpathInternals.h             |  630 -
 interfaces/ext/libxml/xpointer.h                   |  114 -
 interfaces/ext/magic.h                             |   89 -
 interfaces/ext/regex.h                             |  557 -
 interfaces/ext/zconf.h                             |  304 -
 interfaces/ext/zlib.h                              | 1613 -
 interfaces/insdc/insdc.h                           |  277 -
 interfaces/insdc/insdc.vschema                     |  202 -
 interfaces/insdc/seq.vschema                       |  210 -
 interfaces/insdc/sra.h                             |  110 -
 interfaces/insdc/sra.vschema                       |  484 -
 interfaces/kapp/args.h                             |  339 -
 interfaces/kapp/extern.h                           |   47 -
 interfaces/kapp/loader-file.h                      |  122 -
 interfaces/kapp/loader-meta.h                      |   51 -
 interfaces/kapp/log-xml.h                          |   76 -
 interfaces/kapp/main.h                             |  167 -
 interfaces/kapp/progressbar.h                      |   82 -
 interfaces/kapp/queue-file.h                       |  149 -
 interfaces/kdb/btree.h                             |  371 -
 interfaces/kdb/column.h                            |  302 -
 interfaces/kdb/consistency-check.h                 |  142 -
 interfaces/kdb/database.h                          |  270 -
 interfaces/kdb/extern.h                            |   41 -
 interfaces/kdb/index.h                             |  309 -
 interfaces/kdb/kdb-priv.h                          |  156 -
 interfaces/kdb/manager.h                           |  182 -
 interfaces/kdb/meta.h                              |  411 -
 interfaces/kdb/meta.hpp                            |  487 -
 interfaces/kdb/namelist.h                          |   81 -
 interfaces/kdb/table.h                             |  274 -
 interfaces/kfg/config.h                            |  407 -
 interfaces/kfg/extern.h                            |   41 -
 interfaces/kfg/kart.h                              |   87 -
 interfaces/kfg/keystore-priv.h                     |   92 -
 interfaces/kfg/keystore.h                          |  155 -
 interfaces/kfg/kfg-priv.h                          |   59 -
 interfaces/kfg/repository.h                        |  290 -
 interfaces/kfs/arc.h                               |  142 -
 interfaces/kfs/arrayfile.h                         |  180 -
 interfaces/kfs/buffile.h                           |   94 -
 interfaces/kfs/bzip.h                              |   77 -
 interfaces/kfs/cacheteefile.h                      |  147 -
 interfaces/kfs/countfile.h                         |   73 -
 interfaces/kfs/crc.h                               |  292 -
 interfaces/kfs/defs.h                              |  115 -
 interfaces/kfs/directory.h                         |  522 -
 interfaces/kfs/directory.hpp                       |  582 -
 interfaces/kfs/dyload.h                            |  223 -
 interfaces/kfs/extern.h                            |   41 -
 interfaces/kfs/ffext.h                             |   48 -
 interfaces/kfs/ffmagic.h                           |   49 -
 interfaces/kfs/file.h                              |  180 -
 interfaces/kfs/file.hpp                            |  147 -
 interfaces/kfs/fileformat.h                        |  140 -
 interfaces/kfs/gzip.h                              |   77 -
 interfaces/kfs/impl.h                              |  330 -
 interfaces/kfs/kfs-priv.h                          |   94 -
 interfaces/kfs/lockfile.h                          |  116 -
 interfaces/kfs/md5.h                               |  289 -
 interfaces/kfs/mmap.h                              |  134 -
 interfaces/kfs/nullfile.h                          |   62 -
 interfaces/kfs/pagefile.h                          |  191 -
 interfaces/kfs/pmem.h                              |  157 -
 interfaces/kfs/quickmount.h                        |   61 -
 interfaces/kfs/ramfile.h                           |   75 -
 interfaces/kfs/readheadfile.h                      |   86 -
 interfaces/kfs/sra.h                               |  191 -
 interfaces/kfs/subfile.h                           |   64 -
 interfaces/kfs/tar.h                               |   94 -
 interfaces/kfs/teefile.h                           |   66 -
 interfaces/kfs/toc.h                               |  148 -
 interfaces/klib/callconv.h                         |   53 -
 interfaces/klib/checksum.h                         |  152 -
 interfaces/klib/container.h                        |  455 -
 interfaces/klib/data-buffer.h                      |  206 -
 interfaces/klib/debug.h                            |  535 -
 interfaces/klib/defs.h                             |  183 -
 interfaces/klib/extern.h                           |   74 -
 interfaces/klib/impl.h                             |   96 -
 interfaces/klib/klib-priv.h                        |  106 -
 interfaces/klib/ksort-macro.h                      |  257 -
 interfaces/klib/log.h                              |  380 -
 interfaces/klib/logfmt.h                           |   62 -
 interfaces/klib/namelist.h                         |  165 -
 interfaces/klib/namelist.hpp                       |  130 -
 interfaces/klib/out.h                              |   86 -
 interfaces/klib/pack.h                             |  138 -
 interfaces/klib/pbstree.h                          |  287 -
 interfaces/klib/printf.h                           |  406 -
 interfaces/klib/ptrie.h                            |  296 -
 interfaces/klib/rc.h                               |  483 -
 interfaces/klib/refcount.h                         |  257 -
 interfaces/klib/report.h                           |   98 -
 interfaces/klib/sort.h                             |  123 -
 interfaces/klib/status.h                           |  133 -
 interfaces/klib/symbol.h                           |  146 -
 interfaces/klib/symtab.h                           |  225 -
 interfaces/klib/text.h                             |  498 -
 interfaces/klib/time.h                             |   90 -
 interfaces/klib/token.h                            |  254 -
 interfaces/klib/trie.h                             |  293 -
 interfaces/klib/vector.h                           |  428 -
 interfaces/klib/vlen-encode.h                      |  161 -
 interfaces/klib/writer.h                           |  170 -
 interfaces/kns/KCurlRequest.h                      |   65 -
 interfaces/kns/adapt.h                             |   89 -
 interfaces/kns/ascp.h                              |   87 -
 interfaces/kns/curl-file.h                         |   49 -
 interfaces/kns/endpoint.h                          |  117 -
 interfaces/kns/entrez-fetcher.h                    |   88 -
 interfaces/kns/extern.h                            |   41 -
 interfaces/kns/http.h                              |  278 -
 interfaces/kns/impl.h                              |  104 -
 interfaces/kns/manager.h                           |   85 -
 interfaces/kns/socket.h                            |   98 -
 interfaces/kns/stream.h                            |  126 -
 interfaces/kns/url-fetcher.h                       |   66 -
 interfaces/kproc/barrier.h                         |   75 -
 interfaces/kproc/barrier.hpp                       |   79 -
 interfaces/kproc/cond.h                            |  104 -
 interfaces/kproc/cond.hpp                          |  107 -
 interfaces/kproc/extern.h                          |   41 -
 interfaces/kproc/impl.h                            |  104 -
 interfaces/kproc/lock.h                            |  124 -
 interfaces/kproc/lock.hpp                          |  163 -
 interfaces/kproc/procmgr.h                         |  115 -
 interfaces/kproc/q-extern.h                        |   41 -
 interfaces/kproc/queue.h                           |  116 -
 interfaces/kproc/sem.h                             |  138 -
 interfaces/kproc/sem.hpp                           |  134 -
 interfaces/kproc/task.h                            |   83 -
 interfaces/kproc/thread.h                          |   91 -
 interfaces/kproc/thread.hpp                        |   98 -
 interfaces/kproc/timeout.h                         |   64 -
 interfaces/krypto/cipher-impl.h                    |    1 -
 interfaces/krypto/cipher-priv.h                    |    1 -
 interfaces/krypto/cipher-test.h                    |   49 -
 interfaces/krypto/cipher.h                         |  208 -
 interfaces/krypto/ciphermgr-priv.h                 |   38 -
 interfaces/krypto/ciphermgr.h                      |   98 -
 interfaces/krypto/encfile-priv.h                   |  250 -
 interfaces/krypto/encfile.h                        |  134 -
 interfaces/krypto/extern.h                         |   66 -
 interfaces/krypto/key.h                            |  103 -
 interfaces/krypto/manager-priv.h                   |   26 -
 interfaces/krypto/manager.h                        |   33 -
 interfaces/krypto/reencfile.h                      |   91 -
 interfaces/krypto/rng-impl.h                       |   86 -
 interfaces/krypto/rng.h                            |   68 -
 interfaces/krypto/testciphermgr.h                  |   58 -
 interfaces/krypto/wgaencrypt.h                     |  128 -
 interfaces/ktst/test_tools.hpp                     |   22 -
 interfaces/ktst/unit_test.hpp                      |  249 -
 interfaces/ktst/unit_test_suite.hpp                |  481 -
 interfaces/kxml/xml.h                              |  382 -
 interfaces/loader/alignment-writer.h               |  109 -
 interfaces/loader/common-reader-priv.h             |  300 -
 interfaces/loader/common-reader.h                  |  486 -
 interfaces/loader/common-writer.h                  |  192 -
 interfaces/loader/mmarray.h                        |   50 -
 interfaces/loader/reference-writer.h               |   78 -
 interfaces/loader/sequence-writer.h                |   91 -
 interfaces/ncbi/clip.vschema                       |  143 -
 interfaces/ncbi/extern.h                           |   41 -
 interfaces/ncbi/ncbi.vschema                       |  195 -
 interfaces/ncbi/seq.vschema                        |  889 -
 interfaces/ncbi/spotname.vschema                   |  377 -
 interfaces/ncbi/sra.vschema                        |  743 -
 interfaces/ncbi/stats.vschema                      |  119 -
 interfaces/ncbi/wgs-contig.h                       |  176 -
 interfaces/ncbi/wgs-contig.vschema                 |  660 -
 interfaces/os/linux/os-native.h                    |   43 -
 interfaces/os/mac/byteswap.h                       |   39 -
 interfaces/os/mac/endian.h                         |   39 -
 interfaces/os/mac/os-native.h                      |  114 -
 interfaces/os/unix/sysalloc.h                      |   40 -
 interfaces/os/unix/unix-native.h                   |   58 -
 interfaces/os/win/atomic.h                         |  143 -
 interfaces/os/win/atomic32.h                       |  193 -
 interfaces/os/win/atomic64.h                       |  193 -
 interfaces/os/win/byteswap.h                       |   44 -
 interfaces/os/win/endian.h                         |   42 -
 interfaces/os/win/os-native.h                      |  207 -
 interfaces/os/win/strtol.h                         |  149 -
 interfaces/os/win/sysalloc.h                       |   69 -
 interfaces/search/extern.h                         |   41 -
 interfaces/search/grep.h                           |  263 -
 interfaces/search/nucstrstr.h                      |  153 -
 interfaces/sra/454.vschema                         |  289 -
 interfaces/sra/abi.h                               |  167 -
 interfaces/sra/abi.vschema                         |  241 -
 interfaces/sra/extern.h                            |   41 -
 interfaces/sra/fastq.h                             |  191 -
 interfaces/sra/helicos.vschema                     |   85 -
 interfaces/sra/illumina.h                          |  170 -
 interfaces/sra/illumina.vschema                    |  403 -
 interfaces/sra/impl.h                              |  121 -
 interfaces/sra/ion-torrent.vschema                 |  117 -
 interfaces/sra/pacbio.h                            |   66 -
 interfaces/sra/path-extern.h                       |   41 -
 interfaces/sra/pevents.vschema                     |   91 -
 interfaces/sra/rd-extern.h                         |   41 -
 interfaces/sra/sch-extern.h                        |   41 -
 interfaces/sra/sff-file.h                          |  110 -
 interfaces/sra/sff.h                               |  147 -
 interfaces/sra/sradb-priv.h                        |  407 -
 interfaces/sra/sradb.h                             |  545 -
 interfaces/sra/sradb.hpp                           |  441 -
 interfaces/sra/srapath.h                           |  181 -
 interfaces/sra/srapath.hpp                         |  176 -
 interfaces/sra/sraschema.h                         |   72 -
 interfaces/sra/types.h                             |  350 -
 interfaces/sra/wsradb.h                            |  242 -
 interfaces/sra/wsradb.hpp                          |  591 -
 interfaces/vdb/blob.h                              |  147 -
 interfaces/vdb/built-in.vschema                    |  397 -
 interfaces/vdb/cursor.h                            |  441 -
 interfaces/vdb/cursor.hpp                          |  388 -
 interfaces/vdb/database.h                          |  334 -
 interfaces/vdb/dependencies.h                      |  231 -
 interfaces/vdb/extern.h                            |   47 -
 interfaces/vdb/manager.h                           |  188 -
 interfaces/vdb/manager.hpp                         |  371 -
 interfaces/vdb/report.h                            |   92 -
 interfaces/vdb/schema.h                            |  460 -
 interfaces/vdb/table.h                             |  401 -
 interfaces/vdb/table.hpp                           |  328 -
 interfaces/vdb/types.h                             |   39 -
 interfaces/vdb/types.hpp                           |  230 -
 interfaces/vdb/vdb-priv.h                          |  314 -
 interfaces/vdb/vdb.vschema                         |  820 -
 interfaces/vdb/xform.h                             |  824 -
 interfaces/vfs/extern.h                            |   47 -
 interfaces/vfs/manager-priv.h                      |  131 -
 interfaces/vfs/manager.h                           |  316 -
 interfaces/vfs/path-priv.h                         |  266 -
 interfaces/vfs/path.h                              |  242 -
 interfaces/vfs/resolver.h                          |  267 -
 libs/Makefile                                      |   74 -
 libs/align/Makefile                                |  173 -
 libs/align/al_iterator.c                           |  562 -
 libs/align/align-access.c                          |  788 -
 libs/align/align_mgr.c                             |  108 -
 libs/align/bam-priv.h                              |   48 -
 libs/align/bam.c                                   | 4237 ---
 libs/align/debug.h                                 |   77 -
 libs/align/dna-reverse-cmpl.c                      |   80 -
 libs/align/libalign-access.vers                    |    1 -
 libs/align/libalign-reader.vers                    |    1 -
 libs/align/libncbi-bam.vers                        |    1 -
 libs/align/pl_iterator.c                           |  686 -
 libs/align/quality-quantizer.c                     |  105 -
 libs/align/reader-cmn.c                            |  317 -
 libs/align/reader-cmn.h                            |   81 -
 libs/align/reader-refseq.c                         |  255 -
 libs/align/ref_iterator.c                          |  866 -
 libs/align/reference-cmn.c                         |   43 -
 libs/align/reference-cmn.h                         |   38 -
 libs/align/reference.c                             | 1943 --
 libs/align/refseq-mgr-priv.h                       |   35 -
 libs/align/refseq-mgr.c                            |  809 -
 libs/align/writer-alignment.c                      |  430 -
 libs/align/writer-cmn.c                            |  568 -
 libs/align/writer-priv.h                           |  151 -
 libs/align/writer-ref.c                            |  481 -
 libs/align/writer-ref.h                            |  106 -
 libs/align/writer-reference.c                      | 2592 --
 libs/align/writer-refseq.c                         |  178 -
 libs/align/writer-sequence.c                       |  636 -
 libs/ascp/Makefile                                 |   80 -
 libs/ascp/ascp-priv.h                              |   74 -
 libs/ascp/ascp.c                                   |  692 -
 libs/ascp/linux/ascp-path.c                        |   61 -
 libs/ascp/mac/ascp-path.c                          |   65 -
 libs/ascp/unix/connect.c                           |  555 -
 libs/ascp/win/ascp-path.c                          |   26 -
 libs/ascp/win/connect.c                            |  520 -
 libs/axf/Makefile                                  |  133 -
 libs/axf/align-local_ref_id.c                      |  130 -
 libs/axf/align-local_ref_start.c                   |  131 -
 libs/axf/align-ref-name.c                          |  158 -
 libs/axf/align-ref-pos.c                           |  246 -
 libs/axf/align-ref-seq-id.c                        |  157 -
 libs/axf/align-restore-read.c                      |  139 -
 libs/axf/cigar.c                                   | 1914 --
 libs/axf/generate-mismatch-qual.c                  |  148 -
 libs/axf/get-sam-flags.c                           |  206 -
 libs/axf/get_mate_align_ids.c                      |  271 -
 libs/axf/libaxf.vers                               |    1 -
 libs/axf/libwaxf.vers                              |    1 -
 libs/axf/make-cmp-read_desc.c                      |  156 -
 libs/axf/mismatch-restore-qual.c                   |  129 -
 libs/axf/not-my-row.c                              |   72 -
 libs/axf/project_read_from_sequence.c              |  228 -
 libs/axf/raw-restore-qual.c                        |   91 -
 libs/axf/raw-restore-read.c                        |  114 -
 libs/axf/ref-preserve_qual.c                       |  363 -
 libs/axf/ref-restore-read.c                        |  162 -
 libs/axf/ref-tbl-sub-select.c                      |  429 -
 libs/axf/ref-tbl.c                                 |   85 -
 libs/axf/ref-tbl.h                                 |   32 -
 libs/axf/refseq-stats.c                            |  148 -
 libs/axf/seq-construct-read.c                      |  125 -
 libs/axf/seq-restore-read.c                        |  216 -
 libs/axf/template-len.c                            |  127 -
 libs/ext/Makefile                                  |   55 -
 libs/ext/bzip2/Makefile                            |  143 -
 libs/ext/curl/Makefile                             |  103 -
 libs/ext/zlib/Makefile                             |  150 -
 libs/kapp/Makefile                                 |  115 -
 libs/kapp/args.c                                   | 2004 --
 libs/kapp/args_debug.h                             |   47 -
 libs/kapp/libkapp.vers                             |    1 -
 libs/kapp/libload.vers                             |    1 -
 libs/kapp/loader-file.c                            |  643 -
 libs/kapp/loader-meta.c                            |   98 -
 libs/kapp/log-xml.c                                |  416 -
 libs/kapp/main-priv.h                              |   71 -
 libs/kapp/main.c                                   |  431 -
 libs/kapp/progressbar.c                            |  199 -
 libs/kapp/queue-file.c                             |  925 -
 libs/kapp/tokenizer.c                              |  525 -
 libs/kapp/unix/sysmain.c                           |  232 -
 libs/kapp/win/sysmain.c                            |  271 -
 libs/kdb/Makefile                                  |  153 -
 libs/kdb/btree.c                                   | 3055 --
 libs/kdb/cc-priv.h                                 |   51 -
 libs/kdb/coldata-priv.h                            |  126 -
 libs/kdb/coldata.c                                 |  188 -
 libs/kdb/colfmt-priv.h                             |  339 -
 libs/kdb/colidx-priv.h                             |  117 -
 libs/kdb/colidx.c                                  |  184 -
 libs/kdb/colidx0-priv.h                            |   88 -
 libs/kdb/colidx0.c                                 |  368 -
 libs/kdb/colidx1-priv.h                            |  110 -
 libs/kdb/colidx1.c                                 |  423 -
 libs/kdb/colidx2-priv.h                            |   99 -
 libs/kdb/colidx2.c                                 |  279 -
 libs/kdb/column-cc.c                               |  224 -
 libs/kdb/column-priv.h                             |   94 -
 libs/kdb/column.c                                  |  876 -
 libs/kdb/database-cc.c                             |  338 -
 libs/kdb/database-cmn.c                            |  495 -
 libs/kdb/database-priv.h                           |  112 -
 libs/kdb/database.c                                |  706 -
 libs/kdb/dbcc-cmn.c                                |  141 -
 libs/kdb/dbmgr-cmn.c                               |  447 -
 libs/kdb/dbmgr-priv.h                              |  126 -
 libs/kdb/dbmgr.c                                   |  420 -
 libs/kdb/idstats-priv.h                            |   74 -
 libs/kdb/idstats.c                                 |  269 -
 libs/kdb/idxblk-priv.h                             |  136 -
 libs/kdb/idxblk.c                                  |  695 -
 libs/kdb/index-cmn.h                               |  286 -
 libs/kdb/index-priv.h                              |  134 -
 libs/kdb/index.c                                   | 1006 -
 libs/kdb/kdb-priv.h                                |  122 -
 libs/kdb/kdb.c                                     |  938 -
 libs/kdb/kdbfmt-priv.h                             |   76 -
 libs/kdb/libkdb.vers                               |    1 -
 libs/kdb/libkdb.vers.h                             |   27 -
 libs/kdb/libwkdb.vers                              |    1 -
 libs/kdb/libwkdb.vers.h                            |   27 -
 libs/kdb/meta.c                                    | 2141 --
 libs/kdb/ptrieval-v1.c                             |  265 -
 libs/kdb/ptrieval-v2.c                             |  396 -
 libs/kdb/table-cc.c                                |  378 -
 libs/kdb/table-priv.h                              |   81 -
 libs/kdb/table.c                                   |  706 -
 libs/kdb/trieidx-priv.h                            |   74 -
 libs/kdb/trieidx-v1.c                              |  222 -
 libs/kdb/trieidx-v2.c                              | 1021 -
 libs/kdb/trieval-v1.c                              |   49 -
 libs/kdb/trieval-v2.c                              |   49 -
 libs/kdb/u64idx-v3.c                               |  162 -
 libs/kdb/wcoldata-priv.h                           |  172 -
 libs/kdb/wcoldata.c                                |  342 -
 libs/kdb/wcolidx-priv.h                            |  161 -
 libs/kdb/wcolidx.c                                 |  634 -
 libs/kdb/wcolidx0-priv.h                           |  148 -
 libs/kdb/wcolidx0.c                                |  747 -
 libs/kdb/wcolidx1-priv.h                           |  147 -
 libs/kdb/wcolidx1.c                                |  857 -
 libs/kdb/wcolidx2-priv.h                           |  114 -
 libs/kdb/wcolidx2.c                                |  241 -
 libs/kdb/wcolumn-priv.h                            |  120 -
 libs/kdb/wcolumn.c                                 | 2437 --
 libs/kdb/wdatabase-priv.h                          |   95 -
 libs/kdb/wdatabase.c                               | 1503 -
 libs/kdb/wdbmgr.c                                  |  349 -
 libs/kdb/werror-priv.h                             |   59 -
 libs/kdb/widxblk-priv.h                            |  195 -
 libs/kdb/widxblk.c                                 |  546 -
 libs/kdb/windex-priv.h                             |  230 -
 libs/kdb/windex.c                                  | 1889 --
 libs/kdb/wkdb-priv.h                               |  160 -
 libs/kdb/wkdb.c                                    | 1417 -
 libs/kdb/wmeta.c                                   | 3526 ---
 libs/kdb/wtable-priv.h                             |  106 -
 libs/kdb/wtable.c                                  | 1590 -
 libs/kdb/wtrieidx-v1.c                             | 1100 -
 libs/kdb/wtrieidx-v2.c                             | 2560 --
 libs/kdb/wu64idx-v3.c                              |  416 -
 libs/kfg/Makefile                                  |  103 -
 libs/kfg/config-grammar.c                          | 1725 --
 libs/kfg/config-lex.c                              | 2511 --
 libs/kfg/config-tokens.h                           |   75 -
 libs/kfg/config.c                                  | 3425 ---
 libs/kfg/default.kfg                               |   45 -
 libs/kfg/kart.c                                    |  608 -
 libs/kfg/keystore.c                                |  836 -
 libs/kfg/kfg-parse.h                               |   81 -
 libs/kfg/libkfg.vers                               |    1 -
 libs/kfg/report-kfg.c                              |  505 -
 libs/kfg/repository.c                              | 1186 -
 libs/kfs/Makefile                                  |  156 -
 libs/kfs/arc.c                                     | 4019 ---
 libs/kfs/arrayfile.c                               |  423 -
 libs/kfs/buffile-read.c                            |  265 -
 libs/kfs/buffile-write.c                           |  368 -
 libs/kfs/buffile.c                                 |  573 -
 libs/kfs/bzip.c                                    |  838 -
 libs/kfs/cacheteefile.c                            | 1689 --
 libs/kfs/countfile.c                               |  652 -
 libs/kfs/crc32.c                                   | 1771 --
 libs/kfs/dir_test.c                                |   54 -
 libs/kfs/directory.c                               | 1538 -
 libs/kfs/ffext.c                                   |  805 -
 libs/kfs/ffkey.c                                   |  833 -
 libs/kfs/ffmagic.c                                 |  942 -
 libs/kfs/file.c                                    |  460 -
 libs/kfs/fileformat-priv.h                         |  124 -
 libs/kfs/fileformat.c                              |  290 -
 libs/kfs/gzip.c                                    |  583 -
 libs/kfs/impl.h                                    |  120 -
 libs/kfs/karc-priv.h                               |   43 -
 libs/kfs/kfs-priv.h                                |   47 -
 libs/kfs/libkdl.vers                               |    1 -
 libs/kfs/libkff.vers                               |    1 -
 libs/kfs/libkfs.vers                               |    1 -
 libs/kfs/lockfile.c                                |  350 -
 libs/kfs/md5.c                                     | 1901 --
 libs/kfs/mmap-priv.h                               |  107 -
 libs/kfs/mmap.c                                    |  754 -
 libs/kfs/nullfile.c                                |  273 -
 libs/kfs/pagefile.c                                | 1283 -
 libs/kfs/pmem.c                                    | 1047 -
 libs/kfs/quickmount.c                              |  967 -
 libs/kfs/ramfile.c                                 |  424 -
 libs/kfs/readheadfile.c                            |  294 -
 libs/kfs/report.c                                  |  169 -
 libs/kfs/sra.c                                     |  486 -
 libs/kfs/subfile.c                                 |  337 -
 libs/kfs/tar.c                                     | 2639 --
 libs/kfs/teefile.c                                 |  532 -
 libs/kfs/toc-priv.h                                |  841 -
 libs/kfs/toc.c                                     | 1738 --
 libs/kfs/tocdir.c                                  |  411 -
 libs/kfs/tocentry.c                                | 1748 --
 libs/kfs/tocfile.c                                 |  636 -
 libs/kfs/unix/sysdir-priv.h                        |   68 -
 libs/kfs/unix/sysdir.c                             | 2408 --
 libs/kfs/unix/sysdll.c                             | 1422 -
 libs/kfs/unix/sysfile-priv.h                       |   75 -
 libs/kfs/unix/sysfile.c                            | 1057 -
 libs/kfs/unix/syslockfile.c                        |  215 -
 libs/kfs/unix/sysmmap-priv.h                       |   68 -
 libs/kfs/unix/sysmmap.c                            |  143 -
 libs/kfs/win/lnk_tools.c                           |  518 -
 libs/kfs/win/sysdir-priv.h                         |   92 -
 libs/kfs/win/sysdir.c                              | 2954 --
 libs/kfs/win/sysdll.c                              | 1410 -
 libs/kfs/win/sysfile-priv.h                        |   68 -
 libs/kfs/win/sysfile.c                             | 1018 -
 libs/kfs/win/syslockfile.c                         |   67 -
 libs/kfs/win/sysmmap-priv.h                        |   71 -
 libs/kfs/win/sysmmap.c                             |  138 -
 libs/klib/Judy.h                                   |  629 -
 libs/klib/Makefile                                 |  140 -
 libs/klib/SHA-32bit.c                              |  307 -
 libs/klib/SHA-64bit.c                              |  270 -
 libs/klib/bsearch.c                                |   77 -
 libs/klib/bstpersist.c                             |  252 -
 libs/klib/container.c                              | 1646 -
 libs/klib/cp1252.c                                 |   65 -
 libs/klib/crc32.c                                  |   89 -
 libs/klib/data-buffer.c                            |  501 -
 libs/klib/debug.c                                  |  311 -
 libs/klib/iso8859-1.c                              |   42 -
 libs/klib/iso8859.c                                |  205 -
 libs/klib/judy-vector.c                            |  892 -
 libs/klib/judy/Judy1.h                             |  549 -
 libs/klib/judy/JudyByCount.c                       |  952 -
 libs/klib/judy/JudyByCountWithDefs.c               |    4 -
 libs/klib/judy/JudyCascade.c                       | 1940 --
 libs/klib/judy/JudyCount.c                         | 1193 -
 libs/klib/judy/JudyCreateBranch.c                  |  312 -
 libs/klib/judy/JudyDecascade.c                     | 1204 -
 libs/klib/judy/JudyDel.c                           | 2144 --
 libs/klib/judy/JudyFirst.c                         |  211 -
 libs/klib/judy/JudyFreeArray.c                     |  361 -
 libs/klib/judy/JudyGet.c                           | 1092 -
 libs/klib/judy/JudyHS.c                            |  770 -
 libs/klib/judy/JudyHS.h                            |   35 -
 libs/klib/judy/JudyIns.c                           | 1871 --
 libs/klib/judy/JudyInsArray.c                      | 1176 -
 libs/klib/judy/JudyInsertBranch.c                  |  133 -
 libs/klib/judy/JudyL.h                             |  503 -
 libs/klib/judy/JudyMalloc.c                        |   86 -
 libs/klib/judy/JudyMallocIF.c                      |  780 -
 libs/klib/judy/JudyMemActive.c                     |  257 -
 libs/klib/judy/JudyMemUsed.c                       |   59 -
 libs/klib/judy/JudyNext.c                          |    2 -
 libs/klib/judy/JudyNextEmpty.c                     |    2 -
 libs/klib/judy/JudyPrev.c                          |    2 -
 libs/klib/judy/JudyPrevEmpty.c                     |    2 -
 libs/klib/judy/JudyPrevNext.c                      | 1888 --
 libs/klib/judy/JudyPrevNextEmpty.c                 | 1388 -
 libs/klib/judy/JudyPrintJP.c                       |  399 -
 libs/klib/judy/JudyPrivate.h                       | 1610 -
 libs/klib/judy/JudyPrivate1L.h                     |  483 -
 libs/klib/judy/JudyPrivateBranch.h                 |  777 -
 libs/klib/judy/JudySL.c                            | 1125 -
 libs/klib/judy/JudyTablesGen.c                     |  294 -
 libs/klib/judy/Makefile                            |  190 -
 libs/klib/judy/j__udyGet.c                         |    2 -
 libs/klib/ksort.c                                  |   97 -
 libs/klib/libkascii.vers                           |    1 -
 libs/klib/libklib.vers                             |    1 -
 libs/klib/libktlog.vers                            |    1 -
 libs/klib/libkutf8.vers                            |    1 -
 libs/klib/log-priv.h                               |   96 -
 libs/klib/log.c                                    |  984 -
 libs/klib/maybeswap.h                              |   47 -
 libs/klib/md5.c                                    |  421 -
 libs/klib/namelist.c                               |  149 -
 libs/klib/out.c                                    |  126 -
 libs/klib/pack.c                                   |  517 -
 libs/klib/pbstree-impl.c                           |  813 -
 libs/klib/pbstree-native.c                         |   30 -
 libs/klib/pbstree-priv.h                           |  664 -
 libs/klib/pbstree-swapped.c                        |   30 -
 libs/klib/pbstree.c                                |  395 -
 libs/klib/printf.c                                 | 3540 ---
 libs/klib/ptpersist.c                              | 1099 -
 libs/klib/ptrie.c                                  | 1956 --
 libs/klib/qsort.c                                  |  311 -
 libs/klib/rc-idx-tbl.c                             |   39 -
 libs/klib/rc-tbl.c                                 |   36 -
 libs/klib/refcount.c                               |  508 -
 libs/klib/report.c                                 |  816 -
 libs/klib/status-rc-strings.c                      |   39 -
 libs/klib/status-rc.c                              |  156 -
 libs/klib/status.c                                 |  436 -
 libs/klib/symtab.c                                 |  736 -
 libs/klib/text.c                                   |  841 -
 libs/klib/token.c                                  | 1290 -
 libs/klib/trie-priv.h                              |  237 -
 libs/klib/trie.c                                   | 1486 -
 libs/klib/trieval.c                                |  168 -
 libs/klib/unix/syserrcode.c                        |   46 -
 libs/klib/unix/syslog.c                            |  209 -
 libs/klib/unix/systime.c                           |  108 -
 libs/klib/unix/syswriter.c                         |  159 -
 libs/klib/unpack.c                                 |  833 -
 libs/klib/utf8.c                                   |  836 -
 libs/klib/vector.c                                 |  626 -
 libs/klib/vector_namelist.c                        |  331 -
 libs/klib/vlen-encode.c                            |  773 -
 libs/klib/win/sysalloc.c                           |   68 -
 libs/klib/win/syserrcode.c                         |   85 -
 libs/klib/win/syslog.c                             |  120 -
 libs/klib/win/systime.c                            |  279 -
 libs/klib/win/syswriter.c                          |  179 -
 libs/klib/writer-priv.h                            |  169 -
 libs/klib/writer.c                                 |  634 -
 libs/kns/KCurlFile.c                               |  716 -
 libs/kns/KCurlRequest.c                            |  438 -
 libs/kns/Makefile                                  |  127 -
 libs/kns/curlhdr/curl.h                            | 1600 -
 libs/kns/curlhdr/curlver.h                         |   56 -
 libs/kns/curlhdr/easy.h                            |   81 -
 libs/kns/curlhdr/multi.h                           |  344 -
 libs/kns/curlhdr/types.h                           |    1 -
 libs/kns/endpoint.c                                |  109 -
 libs/kns/entrez-fetcher.c                          |  221 -
 libs/kns/http-priv.h                               |   97 -
 libs/kns/http-test.c                               |  368 -
 libs/kns/http.c                                    | 3002 --
 libs/kns/kns_manager.c                             |  311 -
 libs/kns/kns_mgr_priv.h                            |   67 -
 libs/kns/libkns.vers                               |    1 -
 libs/kns/libkurl.vers                              |    1 -
 libs/kns/stream-from-files.c                       |  168 -
 libs/kns/stream-from-streams.c                     |  150 -
 libs/kns/stream-priv.h                             |   36 -
 libs/kns/stream.c                                  |  336 -
 libs/kns/unix/sysendpoint.c                        |  169 -
 libs/kns/unix/sysmgr.c                             |   35 -
 libs/kns/unix/syssock.c                            |  552 -
 libs/kns/unix/sysstream.c                          |  251 -
 libs/kns/url-fetcher-curl.c                        |  255 -
 libs/kns/url-fetcher-impl.h                        |  109 -
 libs/kns/url-fetcher.c                             |  129 -
 libs/kns/win/sysendpoint.c                         |  185 -
 libs/kns/win/sysmgr.c                              |   57 -
 libs/kns/win/syssock.c                             |  663 -
 libs/kns/win/sysstream.c                           |  232 -
 libs/kproc/Makefile                                |  153 -
 libs/kproc/bsd/syslock-priv.h                      |   62 -
 libs/kproc/bsd/syslock.c                           |  641 -
 libs/kproc/libkproc.vers                           |    1 -
 libs/kproc/libkq.vers                              |    1 -
 libs/kproc/libksproc.vers                          |    1 -
 libs/kproc/linux/sysbarrier.c                      |  170 -
 libs/kproc/linux/syslock-priv.h                    |   62 -
 libs/kproc/linux/syslock.c                         |  502 -
 libs/kproc/procmgr.c                               |  412 -
 libs/kproc/queue.c                                 |  398 -
 libs/kproc/sem.c                                   |  435 -
 libs/kproc/stbarrier.c                             |  128 -
 libs/kproc/stcond.c                                |  152 -
 libs/kproc/stlock.c                                |  311 -
 libs/kproc/stsem.c                                 |  233 -
 libs/kproc/stthread.c                              |  149 -
 libs/kproc/sttimeout.c                             |   65 -
 libs/kproc/task.c                                  |  156 -
 libs/kproc/unix/syscond-priv.h                     |   78 -
 libs/kproc/unix/syscond.c                          |  320 -
 libs/kproc/unix/systhread.c                        |  272 -
 libs/kproc/unix/systimeout.c                       |   86 -
 libs/kproc/win/syscond-priv.h                      |   79 -
 libs/kproc/win/syscond.c                           |  500 -
 libs/kproc/win/syslock-priv.h                      |   56 -
 libs/kproc/win/syslock.c                           |  613 -
 libs/krypto/Makefile                               |  307 -
 libs/krypto/aes-byte.c                             |  236 -
 libs/krypto/aes-ncbi-priv.h                        |  227 -
 libs/krypto/aes-ncbi.c                             | 2644 --
 libs/krypto/aes-priv.h                             |   94 -
 libs/krypto/aes.c                                  |    1 -
 libs/krypto/aes_core.c                             | 1181 -
 libs/krypto/blockcipher-impl.h                     |  187 -
 libs/krypto/blockcipher-priv.h                     |   90 -
 libs/krypto/blockcipher.c                          |    3 -
 libs/krypto/cipher-byte.c                          |  522 -
 libs/krypto/cipher-impl.h                          |  174 -
 libs/krypto/cipher-no-vec.c                        |   41 -
 libs/krypto/cipher-priv.h                          |   79 -
 libs/krypto/cipher-vec.c                           |  808 -
 libs/krypto/cipher.c                               |  538 -
 libs/krypto/ciphermgr.c                            |  295 -
 libs/krypto/compile-test.c                         |   50 -
 libs/krypto/csprng.c                               |  163 -
 libs/krypto/encfile-priv.h                         |  163 -
 libs/krypto/encfile.c                              | 2122 --
 libs/krypto/encfilev2.c                            | 2589 --
 libs/krypto/key.c                                  |  126 -
 libs/krypto/libkrypto.vers                         |    1 -
 libs/krypto/libkryptotest.vers                     |    1 -
 libs/krypto/manager.c                              |   11 -
 libs/krypto/ncbi-priv.h                            |  122 -
 libs/krypto/no-null-ncbi.c                         |   59 -
 libs/krypto/null-ncbi-priv.h                       |   56 -
 libs/krypto/null-ncbi.c                            |  251 -
 libs/krypto/reencfile.c                            | 1255 -
 libs/krypto/rng-impl.h                             |   91 -
 libs/krypto/rng.c                                  |  120 -
 libs/krypto/testcipher.c                           |   76 -
 libs/krypto/wgaencrypt.c                           | 1254 -
 libs/ktst/Makefile                                 |   81 -
 libs/ktst/testcase.cpp                             |   95 -
 libs/ktst/testenv.cpp                              |  505 -
 libs/ktst/testrunner.cpp                           |   77 -
 libs/ktst/unix/runprocesstestcase.cpp              |  125 -
 libs/ktst/win/runprocesstestcase.cpp               |  152 -
 libs/kxml/Makefile                                 |  124 -
 libs/kxml/libkxfs.vers                             |    1 -
 libs/kxml/libkxml.vers                             |    1 -
 libs/kxml/xml.c                                    | 1705 --
 libs/kxml/xtoc-parsexml.c                          |  576 -
 libs/kxml/xtoc-priv.h                              |  124 -
 libs/kxml/xtoc.c                                   | 3466 ---
 libs/loader/Makefile                               |   87 -
 libs/loader/alignment-writer.c                     |  262 -
 libs/loader/common-reader.c                        |  614 -
 libs/loader/common-writer.c                        | 2051 --
 libs/loader/mmarray.c                              |  131 -
 libs/loader/reference-writer.c                     |  462 -
 libs/loader/sequence-writer.c                      |  361 -
 libs/ncbi-vdb/Makefile                             |  154 -
 libs/ncbi-vdb/libncbi-vdb.vers                     |    1 -
 libs/ncbi-vdb/libncbi-wvdb.vers                    |    1 -
 libs/search/Makefile                               |   97 -
 libs/search/agrep-dp.c                             |  873 -
 libs/search/agrep-myers.c                          |  452 -
 libs/search/agrep-myersunltd.c                     | 1039 -
 libs/search/agrep-wumanber.c                       |  415 -
 libs/search/debug.h                                |   43 -
 libs/search/fgrep-aho.c                            |  348 -
 libs/search/fgrep-boyermoore.c                     |  458 -
 libs/search/fgrep-dumb.c                           |  326 -
 libs/search/libksrch.vers                          |    1 -
 libs/search/libnucstrstr.vers                      |    1 -
 libs/search/nucstrstr-icc-i386-dbg.pic.s           |31488 --------------------
 libs/search/nucstrstr-icc-i386-prof.pic.s          | 7600 -----
 libs/search/nucstrstr-icc-i386-rel.pic.s           | 6711 -----
 libs/search/nucstrstr-icc-x86_64-dbg.pic.s         |25447 ----------------
 libs/search/nucstrstr-icc-x86_64-prof.pic.s        |13651 ---------
 libs/search/nucstrstr-icc-x86_64-rel.pic.s         | 9908 ------
 libs/search/nucstrstr.c                            | 5313 ----
 libs/search/search-priv.h                          |  137 -
 libs/search/search.c                               |  285 -
 libs/sra/Makefile                                  |  234 -
 libs/sra/built-in.vschema                          |  580 -
 libs/sra/libsra-schema.vers                        |    1 -
 libs/sra/libsradb.vers                             |    1 -
 libs/sra/libsradb.vers.h                           |   27 -
 libs/sra/libsrareader.vers                         |    1 -
 libs/sra/libsraschema.vers                         |    1 -
 libs/sra/libwsra-schema.vers                       |    1 -
 libs/sra/libwsradb.vers                            |    1 -
 libs/sra/libwsraschema.vers                        |    1 -
 libs/sra/reader-abi.c                              |  469 -
 libs/sra/reader-cmn.c                              |  379 -
 libs/sra/reader-cmn.h                              |  161 -
 libs/sra/reader-fastq.c                            |  614 -
 libs/sra/reader-illumina.c                         |  565 -
 libs/sra/reader-sff.c                              |  380 -
 libs/sra/sra-debug.h                               |   42 -
 libs/sra/sra-dflt-schema.c                         |  550 -
 libs/sra/sra-priv.h                                |  183 -
 libs/sra/sra-schema.c                              | 4083 ---
 libs/sra/sracache.c                                |  559 -
 libs/sra/sracol.c                                  |  235 -
 libs/sra/sramgr-cmn.c                              |  572 -
 libs/sra/sramgr.c                                  |  186 -
 libs/sra/sraschema-priv.h                          |   36 -
 libs/sra/sraschema-stub.c                          |   51 -
 libs/sra/sraschema.c                               |   74 -
 libs/sra/sratbl-cmn.c                              | 1397 -
 libs/sra/sratbl.c                                  |  118 -
 libs/sra/types.c                                   |  298 -
 libs/sra/wsramgr.c                                 |  165 -
 libs/sra/wsraschema-stub.c                         |   51 -
 libs/sra/wsratbl.c                                 |  649 -
 libs/sraxf/Makefile                                |  143 -
 libs/sraxf/bio-start.c                             |   95 -
 libs/sraxf/color-from-dna.c                        |  151 -
 libs/sraxf/denormalize.c                           |  231 -
 libs/sraxf/dna-from-color.c                        |  150 -
 libs/sraxf/dynamic-454-read-descriptor.c           |  303 -
 libs/sraxf/extract-coordinates.c                   |  353 -
 libs/sraxf/extract-name_coord.c                    |  242 -
 libs/sraxf/extract-name_fmt.c                      |  240 -
 libs/sraxf/extract-spot_name.c                     |  105 -
 libs/sraxf/fix_read_seg_impl.h                     |  169 -
 libs/sraxf/format-spot-name.c                      |  332 -
 libs/sraxf/fpcodec.c                               |  267 -
 libs/sraxf/index_lookup.c                          |  269 -
 libs/sraxf/libsraxf.vers                           |    1 -
 libs/sraxf/libwsraxf.vers                          |    1 -
 libs/sraxf/make-position.c                         |  133 -
 libs/sraxf/name-tokenizer.h                        |  121 -
 libs/sraxf/normalize.c                             |  240 -
 libs/sraxf/prefix-tree-to-name.c                   |  162 -
 libs/sraxf/process-position.c                      |  198 -
 libs/sraxf/qual4_codec.h                           |   43 -
 libs/sraxf/qual4_decode.c                          |  257 -
 libs/sraxf/qual4_encode.c                          |  232 -
 libs/sraxf/read-desc.c                             |  143 -
 libs/sraxf/read-seg-from-readn.c                   |  361 -
 libs/sraxf/rewrite-spot-name.c                     |  222 -
 libs/sraxf/rotate.c                                |  271 -
 libs/sraxf/spot-desc.c                             |  102 -
 libs/sraxf/stats.c                                 |  501 -
 libs/sraxf/stats_quality.c                         |  132 -
 libs/sraxf/swap.c                                  |  228 -
 libs/sraxf/tokenize-spot_name-454.c                |  122 -
 libs/sraxf/tokenize-spot_name-abi.c                |  145 -
 libs/sraxf/tokenize-spot_name-helicos.c            |  111 -
 libs/sraxf/tokenize-spot_name-illumina.c           |  150 -
 libs/sraxf/tokenize-spot_name-ion-torrent.c        |  135 -
 libs/sraxf/untyped-priv.h                          |   83 -
 libs/sraxf/untyped.c                               |  378 -
 libs/sraxf/v0-decompress-init.c                    | 2841 --
 libs/sraxf/v0-decompress-local.h                   |  368 -
 libs/sraxf/v0-decompress.c                         | 1096 -
 libs/sraxf/v0-decompress.h                         |  170 -
 libs/sraxf/v0-funcs.c                              |  337 -
 libs/sraxf/varloc.c                                |  105 -
 libs/vdb/Makefile                                  |  180 -
 libs/vdb/blob-headers.c                            |  726 -
 libs/vdb/blob-headers.h                            |  114 -
 libs/vdb/blob-priv.h                               |  200 -
 libs/vdb/blob.c                                    | 1573 -
 libs/vdb/blob.h                                    |   84 -
 libs/vdb/cast.c                                    |  583 -
 libs/vdb/column-cmn.c                              |  307 -
 libs/vdb/column-priv.h                             |  293 -
 libs/vdb/column.c                                  |   80 -
 libs/vdb/compare.c                                 |  242 -
 libs/vdb/cursor-cmn.c                              | 2437 --
 libs/vdb/cursor-priv.h                             |  310 -
 libs/vdb/cursor.c                                  |  200 -
 libs/vdb/database-cmn.c                            |  712 -
 libs/vdb/database-depend.c                         | 1802 --
 libs/vdb/database-load.c                           |  119 -
 libs/vdb/database-priv.h                           |  151 -
 libs/vdb/database.c                                |   29 -
 libs/vdb/dbmgr-cmn.c                               |  747 -
 libs/vdb/dbmgr-priv.h                              |  115 -
 libs/vdb/dbmgr.c                                   |  148 -
 libs/vdb/delta_average.c                           |  297 -
 libs/vdb/environment-read.c                        |  108 -
 libs/vdb/fixed-row-len.c                           |   67 -
 libs/vdb/index_insert.c                            |  132 -
 libs/vdb/index_lookup.c                            |  176 -
 libs/vdb/index_project.c                           |  175 -
 libs/vdb/libvdb.vers                               |    1 -
 libs/vdb/libvdb.vers.h                             |   27 -
 libs/vdb/libwvdb.vers                              |    1 -
 libs/vdb/libwvdb.vers.h                            |   27 -
 libs/vdb/linker-cmn.c                              |  651 -
 libs/vdb/linker-int.c                              |  665 -
 libs/vdb/linker-priv.h                             |  271 -
 libs/vdb/linker.c                                  |   45 -
 libs/vdb/merge.c                                   |  215 -
 libs/vdb/meta-append.c                             |  145 -
 libs/vdb/meta-attr-read.c                          |  448 -
 libs/vdb/meta-attr-write.c                         |  529 -
 libs/vdb/meta-read.c                               |  140 -
 libs/vdb/meta-value.c                              |  381 -
 libs/vdb/meta-write.c                              |  155 -
 libs/vdb/page-map.c                                | 1721 --
 libs/vdb/page-map.h                                |  383 -
 libs/vdb/parameter-read.c                          |  103 -
 libs/vdb/phys-cmn.c                                |  679 -
 libs/vdb/phys-load.c                               |  330 -
 libs/vdb/phys-priv.h                               |  188 -
 libs/vdb/phys.c                                    |   67 -
 libs/vdb/prod-cmn.c                                | 2311 --
 libs/vdb/prod-expr.c                               |  887 -
 libs/vdb/prod-expr.h                               |  199 -
 libs/vdb/prod-func.c                               |  894 -
 libs/vdb/prod-priv.h                               |  456 -
 libs/vdb/prod.c                                    |  136 -
 libs/vdb/range-validate.c                          |  195 -
 libs/vdb/redimension.c                             |  108 -
 libs/vdb/report-vdb.c                              |  856 -
 libs/vdb/row-id.c                                  |   64 -
 libs/vdb/row-len.c                                 |   65 -
 libs/vdb/schema-db.c                               |  746 -
 libs/vdb/schema-dump.c                             |  683 -
 libs/vdb/schema-dump.h                             |  208 -
 libs/vdb/schema-eval.c                             | 1390 -
 libs/vdb/schema-expr.c                             | 2169 --
 libs/vdb/schema-expr.h                             |  396 -
 libs/vdb/schema-func.c                             | 1520 -
 libs/vdb/schema-int.c                              |  376 -
 libs/vdb/schema-parse.c                            |  855 -
 libs/vdb/schema-parse.h                            |  607 -
 libs/vdb/schema-priv.h                             | 1308 -
 libs/vdb/schema-prod.c                             | 1004 -
 libs/vdb/schema-tbl.c                              | 2928 --
 libs/vdb/schema-tok.c                              |   74 -
 libs/vdb/schema-tok.h                              |   61 -
 libs/vdb/schema-type.c                             | 2582 --
 libs/vdb/schema.c                                  | 1767 --
 libs/vdb/split.c                                   |  398 -
 libs/vdb/table-cmn.c                               | 1247 -
 libs/vdb/table-load.c                              |  323 -
 libs/vdb/table-priv.h                              |  232 -
 libs/vdb/table.c                                   |  109 -
 libs/vdb/transpose.c                               |  720 -
 libs/vdb/wcolumn.c                                 | 1069 -
 libs/vdb/wcursor.c                                 | 1194 -
 libs/vdb/wdatabase.c                               |  661 -
 libs/vdb/wdbmgr.c                                  |  251 -
 libs/vdb/wlinker.c                                 |   96 -
 libs/vdb/wphys.c                                   |  909 -
 libs/vdb/wprod.c                                   |  439 -
 libs/vdb/wtable.c                                  |  987 -
 libs/vdb/xform-priv.h                              |   83 -
 libs/vfs/Makefile                                  |  101 -
 libs/vfs/keyring-priv.h                            |   46 -
 libs/vfs/keyring.c                                 |  133 -
 libs/vfs/keyring.h                                 |  110 -
 libs/vfs/libsrapath.vers                           |    1 -
 libs/vfs/libvfs.vers                               |    1 -
 libs/vfs/manager.c                                 | 2948 --
 libs/vfs/path-priv.h                               |  147 -
 libs/vfs/path.c                                    | 3349 ---
 libs/vfs/resolver-priv.h                           |  144 -
 libs/vfs/resolver.c                                | 3992 ---
 libs/vfs/srapath-stub.c                            |  372 -
 libs/vfs/srapath.c                                 | 1424 -
 libs/vfs/unix/syskeyring.c                         |  174 -
 libs/vfs/unix/syspath.c                            |  149 -
 libs/vfs/win/syskeyring.c                          |   56 -
 libs/vfs/win/syspath.c                             |  342 -
 libs/vxf/Makefile                                  |  162 -
 libs/vxf/add-row-id.c                              |   80 -
 libs/vxf/bit_or.c                                  |  135 -
 libs/vxf/bunzip.c                                  |  130 -
 libs/vxf/bzip.c                                    |  182 -
 libs/vxf/ceil.c                                    |   48 -
 libs/vxf/checksum.c                                |  566 -
 libs/vxf/clip.c                                    |  200 -
 libs/vxf/cut.c                                     |  227 -
 libs/vxf/delta.c                                   |  108 -
 libs/vxf/deriv.c                                   |  111 -
 libs/vxf/diff.c                                    |  356 -
 libs/vxf/echo.c                                    |  187 -
 libs/vxf/exists.c                                  |  212 -
 libs/vxf/extract_token.c                           |  105 -
 libs/vxf/floor.c                                   |   49 -
 libs/vxf/fsplit-join.impl.h                        |  136 -
 libs/vxf/funzip.c                                  |  172 -
 libs/vxf/fzip.c                                    |  168 -
 libs/vxf/integral.c                                |  115 -
 libs/vxf/integral_0.c                              |  115 -
 libs/vxf/irzip.c                                   |  564 -
 libs/vxf/irzip.impl.h                              |  482 -
 libs/vxf/iunzip.c                                  |  748 -
 libs/vxf/izip-common.h                             |  195 -
 libs/vxf/izip-decode.impl.h                        |  162 -
 libs/vxf/izip-encode.impl.h                        |  523 -
 libs/vxf/izip.c                                    |  865 -
 libs/vxf/libvxf.vers                               |    1 -
 libs/vxf/libwvxf.vers                              |    1 -
 libs/vxf/lower-case-tech-reads.c                   |  111 -
 libs/vxf/map.c                                     | 1019 -
 libs/vxf/math-funcs-impl.h                         |  361 -
 libs/vxf/max.c                                     |  175 -
 libs/vxf/min.c                                     |  175 -
 libs/vxf/outlier-decoder.c                         |  114 -
 libs/vxf/outlier-encoder.c                         |  142 -
 libs/vxf/pack.c                                    |   92 -
 libs/vxf/paste.c                                   |  357 -
 libs/vxf/rand_4na_2na.c                            |  200 -
 libs/vxf/rldecode.c                                |  155 -
 libs/vxf/rlencode.c                                |  262 -
 libs/vxf/round.c                                   |   49 -
 libs/vxf/simple-sub-select.c                       |  278 -
 libs/vxf/sprintf.c                                 | 1279 -
 libs/vxf/strtonum.c                                |  354 -
 libs/vxf/subtract-row-id.c                         |   83 -
 libs/vxf/sum.c                                     |  356 -
 libs/vxf/trim.c                                    |  229 -
 libs/vxf/trunc.c                                   |   49 -
 libs/vxf/undelta.c                                 |  108 -
 libs/vxf/unpack.c                                  |  115 -
 libs/vxf/unzip.c                                   |  234 -
 libs/vxf/vec-sum.c                                 |  239 -
 libs/vxf/wgs-tokenize-accession.c                  |  212 -
 libs/vxf/zip.c                                     |  214 -
 libs/wgsxf/Makefile                                |  124 -
 libs/wgsxf/build_read_type.c                       |  113 -
 libs/wgsxf/build_scaffold.c                        |  435 -
 libs/wgsxf/libwgsxf.vers                           |    1 -
 libs/wgsxf/libwwgsxf.vers                          |    1 -
 sra-sdk_2.3.3-4~dfsg-1_amd64.build                 | 2821 ++
 tools/Makefile                                     |   83 -
 tools/align-info/Makefile                          |   91 -
 tools/align-info/align-info.c                      |  536 -
 tools/align-info/align-info.vers                   |    1 -
 tools/bam-loader/Globals.h                         |   90 -
 tools/bam-loader/KFileHelper.c                     |  142 -
 tools/bam-loader/KFileHelper.h                     |   48 -
 tools/bam-loader/KVPFile.c                         |  355 -
 tools/bam-loader/KVPFile.h                         |  164 -
 tools/bam-loader/Makefile                          |  101 -
 tools/bam-loader/alignment-writer.c                |  176 -
 tools/bam-loader/alignment-writer.h                |   95 -
 tools/bam-loader/analysis.c                        |  157 -
 tools/bam-loader/analysis.h                        |   49 -
 tools/bam-loader/bam-load.vers                     |    1 -
 tools/bam-loader/bam-loader.c                      |  987 -
 tools/bam-loader/hashtable.c                       |  878 -
 tools/bam-loader/hashtable.h                       |   55 -
 tools/bam-loader/loader-imp.c                      | 2102 --
 tools/bam-loader/loader-imp.h                      |   29 -
 tools/bam-loader/reference-writer.c                |  449 -
 tools/bam-loader/reference-writer.h                |   69 -
 tools/bam-loader/sequence-writer.c                 |  345 -
 tools/bam-loader/sequence-writer.h                 |   84 -
 tools/cache-mgr/Makefile                           |  120 -
 tools/cache-mgr/cache-mgr.c                        | 1332 -
 tools/cache-mgr/cache-mgr.vers                     |    1 -
 tools/cg-load/Makefile                             |  106 -
 tools/cg-load/cg-load.c                            | 1120 -
 tools/cg-load/cg-load.vers                         |    1 -
 tools/cg-load/debug.h                              |   34 -
 tools/cg-load/defs.h                               |  136 -
 tools/cg-load/f1_3.c                               |   76 -
 tools/cg-load/f1_5.c                               |   76 -
 tools/cg-load/f2_0.c                               |   79 -
 tools/cg-load/f2_2.c                               |   95 -
 tools/cg-load/factory-cmn.h                        |   61 -
 tools/cg-load/factory-evidence-dnbs.c              |  351 -
 tools/cg-load/factory-evidence-dnbs.h              |   43 -
 tools/cg-load/factory-evidence-intervals.c         |  306 -
 tools/cg-load/factory-evidence-intervals.h         |   43 -
 tools/cg-load/factory-file.h                       |   43 -
 tools/cg-load/factory-mappings.c                   |  338 -
 tools/cg-load/factory-mappings.h                   |   43 -
 tools/cg-load/factory-reads.c                      |  261 -
 tools/cg-load/factory-reads.h                      |   43 -
 tools/cg-load/file-version-factory.c               |  157 -
 tools/cg-load/file.c                               |  403 -
 tools/cg-load/file.h                               |  330 -
 tools/cg-load/writer-algn.c                        |  775 -
 tools/cg-load/writer-algn.h                        |   62 -
 tools/cg-load/writer-evidence-dnbs.c               |  227 -
 tools/cg-load/writer-evidence-dnbs.h               |   88 -
 tools/cg-load/writer-evidence-intervals.c          |  255 -
 tools/cg-load/writer-evidence-intervals.h          |   68 -
 tools/cg-load/writer-seq.c                         |  135 -
 tools/cg-load/writer-seq.h                         |   58 -
 tools/fastq-loader/Makefile                        |  156 -
 tools/fastq-loader/fastq-grammar.c                 | 2129 --
 tools/fastq-loader/fastq-grammar.y                 |  294 -
 tools/fastq-loader/fastq-lex.c                     | 2419 --
 tools/fastq-loader/fastq-lex.l                     |  294 -
 tools/fastq-loader/fastq-loader.c                  |  543 -
 tools/fastq-loader/fastq-parse.h                   |  141 -
 tools/fastq-loader/fastq-reader.c                  |  706 -
 tools/fastq-loader/fastq-reader.h                  |   50 -
 tools/fastq-loader/fastq-tokens.h                  |   64 -
 tools/fastq-loader/latf-load.vers                  |    1 -
 tools/fastq-loader/loader-imp.c                    |  246 -
 tools/kar/Makefile                                 |  134 -
 tools/kar/kar.c                                    | 1517 -
 tools/kar/kar.vers                                 |    1 -
 tools/kar/sra-kar.c                                |  443 -
 tools/kar/sra-kar.vers                             |    1 -
 tools/nenctool/Makefile                            |  123 -
 tools/nenctool/nenctest.c                          |  502 -
 tools/nenctool/nenctest.vers                       |    1 -
 tools/nenctool/nenctool.c                          |  446 -
 tools/nenctool/nenctool.vers                       |    1 -
 tools/nencvalid/Makefile                           |  111 -
 tools/nencvalid/nencvalid.c                        |  607 -
 tools/nencvalid/nencvalid.vers                     |    1 -
 tools/prefetch/Makefile                            |  100 -
 tools/prefetch/prefetch.c                          | 1965 --
 tools/prefetch/prefetch.vers                       |    1 -
 tools/sam-dump/Makefile                            |  102 -
 tools/sam-dump/debug.h                             |   34 -
 tools/sam-dump/sam-dump.c                          | 4870 ---
 tools/sam-dump/sam-dump.vers                       |    1 -
 tools/sra-dbcc/Makefile                            |  113 -
 tools/sra-dbcc/sra-dbcc.c                          | 1577 -
 tools/sra-dbcc/sra-dbcc.vers                       |    1 -
 tools/sra-dump/Makefile                            |  162 -
 tools/sra-dump/abi-dump.vers                       |    1 -
 tools/sra-dump/abi.c                               |  912 -
 tools/sra-dump/core.c                              | 1690 --
 tools/sra-dump/core.h                              |   73 -
 tools/sra-dump/debug.h                             |   34 -
 tools/sra-dump/factory.c                           | 1065 -
 tools/sra-dump/factory.h                           |  194 -
 tools/sra-dump/fasta_dump.c                        |  752 -
 tools/sra-dump/fasta_dump.h                        |   36 -
 tools/sra-dump/fastq-dump.vers                     |    1 -
 tools/sra-dump/fastq.c                             | 3794 ---
 tools/sra-dump/illumina-dump.vers                  |    1 -
 tools/sra-dump/illumina.c                          |  504 -
 tools/sra-dump/sff-dump.vers                       |    1 -
 tools/sra-dump/sff.c                               |  207 -
 tools/sra-dump/sra-dump.c                          | 1029 -
 tools/sra-dump/sra-dump.vers                       |    1 -
 tools/sra-load/Makefile                            |  209 -
 tools/sra-load/abi-load.vers                       |    1 -
 tools/sra-load/absolid-fmt.c                       |  579 -
 tools/sra-load/common-xml.c                        |  862 -
 tools/sra-load/common-xml.h                        |  183 -
 tools/sra-load/debug.h                             |   34 -
 tools/sra-load/experiment-xml.c                    | 1255 -
 tools/sra-load/experiment-xml.h                    |   77 -
 tools/sra-load/fastq-fmt.c                         |  706 -
 tools/sra-load/fastq-load.vers                     |    1 -
 tools/sra-load/helicos-fmt.c                       |  279 -
 tools/sra-load/helicos-load.vers                   |    1 -
 tools/sra-load/illumina-fmt.c                      |  853 -
 tools/sra-load/illumina-load.vers                  |    1 -
 tools/sra-load/loader-file.c                       |  191 -
 tools/sra-load/loader-file.h                       |  113 -
 tools/sra-load/loader-fmt.c                        |  165 -
 tools/sra-load/loader-fmt.h                        |  171 -
 tools/sra-load/loader.c                            | 1135 -
 tools/sra-load/pstring.c                           |  208 -
 tools/sra-load/pstring.h                           |   58 -
 tools/sra-load/run-xml.c                           |  487 -
 tools/sra-load/run-xml.h                           |   90 -
 tools/sra-load/sff-fmt.c                           |  496 -
 tools/sra-load/sff-load.vers                       |    1 -
 tools/sra-load/sra-writer.c                        |  370 -
 tools/sra-load/sra-writer.h                        |   92 -
 tools/sra-load/srf-absolid.c                       |  493 -
 tools/sra-load/srf-fmt.c                           |  273 -
 tools/sra-load/srf-fmt.h                           |   46 -
 tools/sra-load/srf-illumina.c                      |  453 -
 tools/sra-load/srf-load.vers                       |    1 -
 tools/sra-load/srf.c                               |  229 -
 tools/sra-load/srf.h                               |  146 -
 tools/sra-load/writer-454.c                        |  262 -
 tools/sra-load/writer-454.h                        |   46 -
 tools/sra-load/writer-absolid.c                    |  499 -
 tools/sra-load/writer-absolid.h                    |   93 -
 tools/sra-load/writer-helicos.c                    |  135 -
 tools/sra-load/writer-helicos.h                    |   41 -
 tools/sra-load/writer-illumina.c                   |  711 -
 tools/sra-load/writer-illumina.h                   |   92 -
 tools/sra-load/writer-ion-torrent.c                |  262 -
 tools/sra-load/writer-ion-torrent.h                |   46 -
 tools/sra-load/ztr-absolid.c                       |  656 -
 tools/sra-load/ztr-absolid.h                       |  124 -
 tools/sra-load/ztr-huffman.c                       |  669 -
 tools/sra-load/ztr-huffman.h                       |   45 -
 tools/sra-load/ztr-illumina.c                      | 1367 -
 tools/sra-load/ztr-illumina.h                      |  136 -
 tools/sra-load/ztr.h                               |  182 -
 tools/sra-pileup/Makefile                          |  130 -
 tools/sra-pileup/cg_tools.c                        |  984 -
 tools/sra-pileup/cg_tools.h                        |  124 -
 tools/sra-pileup/cmdline_cmn.c                     | 1058 -
 tools/sra-pileup/cmdline_cmn.h                     |  134 -
 tools/sra-pileup/debug.h                           |   34 -
 tools/sra-pileup/inputfiles.c                      |  376 -
 tools/sra-pileup/inputfiles.h                      |   99 -
 tools/sra-pileup/matecache.c                       |  439 -
 tools/sra-pileup/matecache.h                       |  119 -
 tools/sra-pileup/out_redir.c                       |  120 -
 tools/sra-pileup/out_redir.h                       |   64 -
 tools/sra-pileup/read_fkt.c                        |  718 -
 tools/sra-pileup/read_fkt.h                        |   82 -
 tools/sra-pileup/reref.c                           |  501 -
 tools/sra-pileup/reref.h                           |   48 -
 tools/sra-pileup/sam-aligned.c                     | 2046 --
 tools/sra-pileup/sam-aligned.h                     |   45 -
 tools/sra-pileup/sam-dump-opts.c                   | 1502 -
 tools/sra-pileup/sam-dump-opts.h                   |  282 -
 tools/sra-pileup/sam-dump.c                        | 4896 ---
 tools/sra-pileup/sam-dump.vers                     |    1 -
 tools/sra-pileup/sam-dump3.c                       |  532 -
 tools/sra-pileup/sam-hdr.c                         |  425 -
 tools/sra-pileup/sam-hdr.h                         |   41 -
 tools/sra-pileup/sam-unaligned.c                   | 1482 -
 tools/sra-pileup/sam-unaligned.h                   |   43 -
 tools/sra-pileup/sra-pileup.c                      | 2611 --
 tools/sra-pileup/sra-pileup.vers                   |    1 -
 tools/sra-sort/Makefile                            |  130 -
 tools/sra-sort/Makefile.cc                         |   24 -
 tools/sra-sort/Makefile.clang                      |   27 -
 tools/sra-sort/Makefile.gcc                        |   27 -
 tools/sra-sort/Makefile.vc++                       |   24 -
 tools/sra-sort/buff-writer.c                       |  785 -
 tools/sra-sort/buff-writer.h                       |   64 -
 tools/sra-sort/caps.c                              |  125 -
 tools/sra-sort/caps.h                              |   70 -
 tools/sra-sort/capture-first-half-aligned.c        |  192 -
 tools/sra-sort/col-pair.c                          |  816 -
 tools/sra-sort/col-pair.h                          |  323 -
 tools/sra-sort/csra-pair.c                         |  216 -
 tools/sra-sort/csra-pair.h                         |   84 -
 tools/sra-sort/csra-tbl.c                          |  783 -
 tools/sra-sort/csra-tbl.h                          |   83 -
 tools/sra-sort/ctx.h                               |  109 -
 tools/sra-sort/db-pair.c                           |  883 -
 tools/sra-sort/db-pair.h                           |  208 -
 tools/sra-sort/dir-pair.c                          |  504 -
 tools/sra-sort/dir-pair.h                          |  124 -
 tools/sra-sort/dump-blob-boundaries.c              |  203 -
 tools/sra-sort/except.c                            |  231 -
 tools/sra-sort/except.h                            |  160 -
 tools/sra-sort/gcc-ped.sh                          |   39 -
 tools/sra-sort/glob-poslen.c                       |  349 -
 tools/sra-sort/glob-poslen.h                       |   95 -
 tools/sra-sort/id-mapper-col.c                     |  260 -
 tools/sra-sort/id-mapper-col.h                     |   55 -
 tools/sra-sort/idx-mapping.c                       |   92 -
 tools/sra-sort/idx-mapping.h                       |   59 -
 tools/sra-sort/map-file.c                          | 1192 -
 tools/sra-sort/map-file.h                          |  172 -
 tools/sra-sort/mapping-row-set.c                   |  496 -
 tools/sra-sort/mem.c                               |   68 -
 tools/sra-sort/mem.h                               |  128 -
 tools/sra-sort/membank-priv.h                      |   44 -
 tools/sra-sort/membank.c                           |  296 -
 tools/sra-sort/meta-pair.c                         |  458 -
 tools/sra-sort/meta-pair.h                         |  109 -
 tools/sra-sort/paged-membank.c                     |  244 -
 tools/sra-sort/paged-mmapbank.c                    |  399 -
 tools/sra-sort/poslen-col-pair.c                   |  559 -
 tools/sra-sort/poslen-col-pair.h                   |   63 -
 tools/sra-sort/ref-alignid-col.c                   |  705 -
 tools/sra-sort/ref-alignid-col.h                   |   53 -
 tools/sra-sort/row-set-priv.h                      |   44 -
 tools/sra-sort/row-set.c                           |  208 -
 tools/sra-sort/row-set.h                           |  215 -
 tools/sra-sort/run.c                               |  388 -
 tools/sra-sort/simple-row-set.c                    |  212 -
 tools/sra-sort/sort-defs.h                         |   82 -
 tools/sra-sort/sorting-row-set.c                   |  405 -
 tools/sra-sort/sra-sort.c                          |  754 -
 tools/sra-sort/sra-sort.h                          |  171 -
 tools/sra-sort/sra-sort.vers                       |    1 -
 tools/sra-sort/status.h                            |   48 -
 tools/sra-sort/tbl-pair.c                          | 1055 -
 tools/sra-sort/tbl-pair.h                          |  209 -
 tools/sra-sort/xcheck-ref-align.c                  |  404 -
 tools/sra-sort/xcheck.h                            |   49 -
 tools/sra-stat/Makefile                            |   92 -
 tools/sra-stat/sra-stat.c                          | 3188 --
 tools/sra-stat/sra-stat.vers                       |    1 -
 tools/srapath/Makefile                             |   96 -
 tools/srapath/srapath.c                            |  261 -
 tools/srapath/srapath.vers                         |    1 -
 tools/util/Makefile                                |  209 -
 tools/util/kdbmeta.c                               | 1269 -
 tools/util/kdbmeta.vers                            |    1 -
 tools/util/mac/syspass.c                           |   48 -
 tools/util/rcexplain.c                             |  134 -
 tools/util/rcexplain.vers                          |    1 -
 tools/util/rowwritetest.c                          |  435 -
 tools/util/rowwritetest.vers                       |    1 -
 tools/util/syspass-priv.h                          |   44 -
 tools/util/test-sra.c                              | 1595 -
 tools/util/test-sra.vers                           |    1 -
 tools/util/testld.c                                |  261 -
 tools/util/testld.vers                             |    1 -
 tools/util/txt2kdb.c                               |  584 -
 tools/util/txt2kdb.vers                            |    1 -
 tools/util/unix/syspass.c                          |   62 -
 tools/util/vdb-lock.c                              |  162 -
 tools/util/vdb-lock.vers                           |    1 -
 tools/util/vdb-passwd.c                            |  276 -
 tools/util/vdb-passwd.vers                         |    1 -
 tools/util/vdb-unlock.c                            |  164 -
 tools/util/vdb-unlock.vers                         |    1 -
 tools/util/win/syspass.c                           |   53 -
 tools/vdb-config/Makefile                          |  102 -
 tools/vdb-config/vdb-config.c                      | 1138 -
 tools/vdb-config/vdb-config.vers                   |    1 -
 tools/vdb-copy/Makefile                            |  116 -
 tools/vdb-copy/coldefs.c                           |  775 -
 tools/vdb-copy/coldefs.h                           |  250 -
 tools/vdb-copy/config_values.c                     |   54 -
 tools/vdb-copy/config_values.h                     |   49 -
 tools/vdb-copy/context.c                           |  466 -
 tools/vdb-copy/context.h                           |  182 -
 tools/vdb-copy/copy_meta.c                         |  518 -
 tools/vdb-copy/copy_meta.h                         |   46 -
 tools/vdb-copy/definitions.h                       |  108 -
 tools/vdb-copy/get_platform.c                      |  168 -
 tools/vdb-copy/get_platform.h                      |   46 -
 tools/vdb-copy/helper.c                            |  919 -
 tools/vdb-copy/helper.h                            |  225 -
 tools/vdb-copy/matcher_input.h                     |   55 -
 tools/vdb-copy/namelist_tools.c                    |  187 -
 tools/vdb-copy/namelist_tools.h                    |   52 -
 tools/vdb-copy/num-gen.c                           |  848 -
 tools/vdb-copy/num-gen.h                           |  225 -
 tools/vdb-copy/progressbar.c                       |  137 -
 tools/vdb-copy/progressbar.h                       |   70 -
 tools/vdb-copy/redactval.c                         |  230 -
 tools/vdb-copy/redactval.h                         |  120 -
 tools/vdb-copy/type_matcher.c                      |  850 -
 tools/vdb-copy/type_matcher.h                      |   71 -
 tools/vdb-copy/vdb-copy-includes.h                 |  121 -
 tools/vdb-copy/vdb-copy.c                          | 1488 -
 tools/vdb-copy/vdb-copy.kfg                        |   92 -
 tools/vdb-copy/vdb-copy.vers                       |    1 -
 tools/vdb-decrypt/Makefile                         |  130 -
 tools/vdb-decrypt/shared.c                         | 1270 -
 tools/vdb-decrypt/shared.h                         |   93 -
 tools/vdb-decrypt/vdb-decrypt.c                    |  283 -
 tools/vdb-decrypt/vdb-decrypt.vers                 |    1 -
 tools/vdb-decrypt/vdb-encrypt.c                    |  231 -
 tools/vdb-decrypt/vdb-encrypt.vers                 |    1 -
 tools/vdb-dump/Makefile                            |  108 -
 tools/vdb-dump/vdb-dump-coldefs.c                  |  637 -
 tools/vdb-dump/vdb-dump-coldefs.h                  |  102 -
 tools/vdb-dump/vdb-dump-context.c                  |  442 -
 tools/vdb-dump/vdb-dump-context.h                  |  168 -
 tools/vdb-dump/vdb-dump-filter.c                   |  116 -
 tools/vdb-dump/vdb-dump-filter.h                   |   82 -
 tools/vdb-dump/vdb-dump-formats.c                  |  343 -
 tools/vdb-dump/vdb-dump-formats.h                  |   51 -
 tools/vdb-dump/vdb-dump-helper.c                   |  376 -
 tools/vdb-dump/vdb-dump-helper.h                   |   84 -
 tools/vdb-dump/vdb-dump-num-gen.c                  |  448 -
 tools/vdb-dump/vdb-dump-num-gen.h                  |   78 -
 tools/vdb-dump/vdb-dump-row-context.h              |   71 -
 tools/vdb-dump/vdb-dump-str.c                      |  370 -
 tools/vdb-dump/vdb-dump-str.h                      |   95 -
 tools/vdb-dump/vdb-dump-tools.c                    |  527 -
 tools/vdb-dump/vdb-dump-tools.h                    |   60 -
 tools/vdb-dump/vdb-dump.c                          | 1527 -
 tools/vdb-dump/vdb-dump.vers                       |    1 -
 tools/vdb-validate/Makefile                        |  103 -
 tools/vdb-validate/vdb-validate.c                  | 2198 --
 tools/vdb-validate/vdb-validate.vers               |    1 -
 1519 files changed, 2821 insertions(+), 647285 deletions(-)

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 845ca06..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.pc
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 0b467d0..0000000
--- a/Makefile
+++ /dev/null
@@ -1,110 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-#-------------------------------------------------------------------------------
-# environment
-#
-TOP ?= $(CURDIR)
-include $(TOP)/build/Makefile.shell
-
-
-#-------------------------------------------------------------------------------
-# default
-#
-SUBDIRS = \
-	libs \
-	tools
-
-# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
-include $(TOP)/build/Makefile.targets
-
-default: $(SUBDIRS)
-
-test: $(SUBDIRS)
-
-$(SUBDIRS) test:
-	@ $(MAKE) -C $@
-
-.PHONY: default $(SUBDIRS) test
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(SUBDIRS_ALL):
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(SUBDIRS_STD):
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: clean_test
-
-clean_test:
-
-#-------------------------------------------------------------------------------
-# pass-through targets
-#
-COMPILERS = GCC VC++ CLANG
-ARCHITECTURES = i386 x86_64 sparc32 sparc64
-CONFIG = debug profile release static dynamic
-PUBLISH = scm pubtools
-REPORTS = bindir targdir osdir config compilers architecture architectures
-PASSTHRUS = \
-	out \
-	CC $(COMPILERS) \
-	$(ARCHITECTURES) \
-	$(CONFIG) $(PUBLISH)
-
-$(PASSTHRUS):
-	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
-	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env rebuild-dirlinks config
-
-$(REPORTS):
-	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
-
-.PHONY: $(PASSTHRUS) $(REPORTS)
-
-
-#-------------------------------------------------------------------------------
-# configuration help
-#
-help configure:
-	@ echo "Before initial build, run 'make OUTDIR=<dir> out' from"
-	@ echo "the project root to set the output directory of your builds."
-	@ echo
-	@ echo "To select a compiler, run 'make <comp>' where"
-	@ echo "comp = { "$(COMPILERS)" }."
-	@ echo
-	@ echo "For hosts that support cross-compilation ( only Macintosh today ),"
-	@ echo "you can run 'make <arch>' where arch = { "$(ARCHITECTURES)" }."
-	@ echo
-	@ echo "To set a build configuration, run 'make <config>' where"
-	@ echo "config = { "$(CONFIG)" }."
-	@ echo
-
-.PHONY: help configure
diff --git a/README b/README
deleted file mode 100644
index b9cb81e..0000000
--- a/README
+++ /dev/null
@@ -1,44 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-The NCBI SRA ( Sequence Read Archive )
-
-
-Contact: sra-tools at ncbi.nlm.nih.gov
-http://trace.ncbi.nlm.nih.gov/Traces/sra/std
-
-The SRA Toolkit and SDK from NCBI is a collection of tools and
-libraries for using data in the INSDC Sequence Read Archives.
-
-With this release, NCBI has implemented Automatic Remote Access by accession,
-making it possible to access data using NCBI servers without prior download.
-
-For additional information on using and building the toolkit,
-please visit our web site at:
-
-    "http://trace.ncbi.nlm.nih.gov/Traces/sra/std"
-
-
-SRA Toolkit Development Team
diff --git a/README-WINDOWS.txt b/README-WINDOWS.txt
deleted file mode 100644
index fc27bf0..0000000
--- a/README-WINDOWS.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
-
-
-Contact: sra-tools at ncbi.nlm.nih.gov
-
-
-NOTICE:
-
-  Effective as of release 2.1.8, NCBI is no longer supporting public sources for
-  Windows builds. The sources will still contain everything that we use to build
-  the binaries, but may not build in your environment.
-
-  The reason for this change has to do with dependencies upon third party
-  libraries, which are commonly installed on other platforms, but could be
-  described as "hit and miss" on Windows. When the libraries DO exist, it is
-  difficult to know if they have a correct or compatible calling convention.
-
-  We will continue to distribute pre-built binaries for Windows. You are welcome
-  to try your luck at compiling the sources yourself under Cygwin.
-
-
-ENVIRONMENT:
-
-  The Windows build uses the same makefiles as Linux and Mac, and has
-  been tested under Cygwin. You need to execute Cygwin AFTER sourcing
-  the Microsoft batch file from Visual Studio. We edit the
-  "cygwin.bat" file to first source "vsvars32.bat":
-
-      @echo off
-      call "%VS80COMNTOOLS%\vsvars32.bat"
-      C:
-      chdir C:\cygwin\bin
-      bash --login -i
-
-  By including vsvars32.bat before launching Cygwin, your bash shell
-  will have all of the Microsoft tools in its path, and the Microsoft
-  tools will know how to find includes and libraries.
-
-  There is a conflict between the Cygwin and Microsoft link tools. The
-  GNU version (that "avoids the bells and whistles of the more
-  commonly-used `ln' command" but otherwise duplicates it) is not used
-  or needed by the build, while the Microsoft version IS needed. To
-  address this issue, our linker scripts (build/ld.win.*.sh) reorder
-  the PATH directories in an attempt to ensure that the correct tool
-  is located. If this proves ineffective in your environment, try
-  renaming the GNU tool, e.g.:
-
-      $ mv /usr/bin/link.exe /usr/bin/gnu-link.exe
-
-
-CYGWIN:
-
-  While we are using Cygwin as a build environment, the binaries are
-  NOT Cygwin binaries and do not link against any of their
-  libraries. As a result, there is no dependency upon their runtime
-  being present, but neither is there any of their emulation.
-
-  In particular, paths behave very differently. Our SDK is based upon
-  POSIX path conventions. Our Windows tools accept relative and
-  absolute paths well, in DOS, Cygwin or MinGW POSIX-style form. But
-  since we do not use Cygwin libraries, our tools have no idea of how
-  to interpret "full" paths within the Cygwin Unix root, e.g.:
-
-      $ cygpath -w /home
-      C:\cygwin\home
-
-  They CAN, however, interpret fully drive-letter qualified Cygwin
-  paths:
-
-      $ fastq-dump /cygdrive/C/cygwin/home/myname/SRRxxxxxx.sra
-
-  Internally, this Cygwin path will be interpreted as
-
-      C:\cygwin\home\myname\SRRxxxxxx.sra
-
-
-WINDOWS PATHS IN GENERAL:
-
-  Windows is the only supported platform that does not present a
-  single-root unified file system, such as POSIX. In the POSIX model,
-  navigation from any one point in the file system to any other is a
-  matter of entering and exiting directories by name. Under Windows,
-  each drive has its own file system, and network paths form yet
-  another file system.
-
-  Like Cygwin and MinGW and probably countless other projects, we have
-  artificially bridged the drive letter file systems by introducing a
-  virtual root node whose immediate sub-directories are the
-  single-letter drive names that are currently mounted, e.g.:
-
-      C:, D: are real drives, while Z: is a mounted network drive
-      "/C" and "/D" and "/Z" are all subdirectories of "/"
-
-      navigation from C:\cygwin\home to D:\data
-      /C/cygwin/home/../../../D/data
-
-  We have NOT bridged drive letters and network paths at this
-  point. There is no way for us to get from C:\cygwin\home to
-  \\server\sradata for example.
-
-  Network paths are represented using POSIX-style slashes, but
-  otherwise look much like their Windows counterparts:
-
-      \\server\data
-      //server/data
-
-  Because network and drive paths cannot be connected, we recommend
-  that you execute your tools completely within one space. If you are
-  running your tools from local or network mounted drive letters, you
-  should access data from local or network mounted drives. If you are
-  using network paths during operation, you should run your binaries
-  from a network path.
-
-  Note that the Windows tool "cmd.exe" does not support cd'ing to a
-  network path for similar reasons.
-
-  Your tools will execute from "cmd.exe" or from bash under Cygwin
-  since they are general Windows command line utilities.
-
diff --git a/README-build.txt b/README-build.txt
deleted file mode 100644
index 300f138..0000000
--- a/README-build.txt
+++ /dev/null
@@ -1,259 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
-
-
-Contact: sra-tools at ncbi.nlm.nih.gov
-http://trace.ncbi.nlm.nih.gov/Traces/sra/std
-
-
-This version of the NCBI SRA SDK generates tools with their respective libraries
-for building new and accessing existing runs. It may be built with GCC.
-
-
-REQUIREMENTS:
-
-This software release was designed to run under Linux, MacOSX and Windows
-operating systems on Intel x86-compatible 32 and 64 bit architectures.
-
-  ar                # tested with version 2.22
-  bash              # certain scripts require bash
-  make              # GNU make version 3.81 or later
-  gcc, g++          # tested with 4.4.2, but should work with others
-  libxml2           # tested with version 2.7.6
-  libcurl           # tested with version 7.27
-
-WINDOWS BUILD:
-
-The Windows build uses the same make files as Linux and Mac, and has been tested
-under Cygwin. You need to execute Cygwin AFTER sourcing the Microsoft batch file
-from Visual Studio.
-
-
-CONTENTS:
-
-  Makefile          # drives configuration and sub-target builds
-  README
-  README-WINDOWS.txt
-  build             # holds special makefiles and configuration
-  interfaces        # contains module interfaces, schema, plus
-                      compiler and platform specific includes
-  libs              # sdk library code
-  tools             # toolkit code
-
-
-CONFIGURATION:
-
-There are three configurable parameters:
-  1) BUILD  = 'debug', 'release' etc.
-  2) COMP   = 'GCC' etc.
-  3) OUTDIR = <path-to-binaries-libs-objfiles>
-
-The target architecture is chosen to match your build host. At this
-time, only the Macintosh build will support cross-compilation. In the
-instructions below, x86_64 is the assumed architecture. If your host
-is i386 (32-bit), then you would substitute 32 for paths that contain
-64.
-
-Running "make help" will list more details of how your build may
-be configured:
-
-  Before initial build, run 'make OUTDIR=<dir> out' from
-  the project root to set the output directory of your builds.
-
-  To select a compiler, run 'make <comp>' where
-  comp = { GCC VC++ CLANG }.
-
-  For hosts that support cross-compilation ( only Macintosh today ),
-  you can run 'make <arch>' where arch = { i386 x86_64 sparc32 sparc64 }.
-
-  To set a build configuration, run 'make <config>' where
-  config = { debug profile release static dynamic }.
-
-Running "make config" will show the current configuration, e.g.:
-
-  current build is linux static rel x86_64 build using gcc tools
-  output target directory is '$PATH_TO_OUTPUT/linux/gcc/stat/x86_64/rel'
-
-where "$PATH_TO_OUTPUT" is local to your system, of course.
-
-
-BUILD INSTRUCTIONS:
-
-## create output directories and symlinks for first time
-
-  $ OUTDIR=<path-to-output>
-  $ make OUTDIR="$OUTDIR" out
-
-The path in OUTDIR MUST be a full path - relative paths may fail.
-
-## decide upon STATIC or DYNAMIC builds
-#  VDB.2 was designed to make use of dynamic libraries, but
-#  in many environments static builds are more convenient or may even be
-#  required, due to installation restrictions.
-#
-#  THE BUILD DOES NOT CURRENTLY SUPPORT PARALLEL DYNAMIC AND STATIC MODES
-#  if you switch between them, you should perform a "make clean" first.
-
-  $ make static
--OR_
-  $ make dynamic
-
-## if you are using a dynamic build, update LD_LIBRARY_PATH - probably want to put
-# in shell startup ( ensure that libz, libbz2 and libxml2 can be found in your path )
-
-  $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OUTDIR/lib64"
-
-## the build uses "TOP" as an internal variable
-#  if you have it defined in your shell environment, unset it before making
-
-## build the libraries and binaries
-
-  $ make GCC debug     # optionally set compiler and/or build
-  $ make               # builds libraries and binary executables
-
-The standard make will cause default libraries and tools to be built. Binary
-executables and both shared and static libraries can be found in their
-respective output directories.
-
-
-STATIC BUILD RESULTS:
-
-<OUTDIR>/bin64/         # (bin32 for 32-bit builds)
-  abi-dump              # dump to ABI-native format
-  abi-load              # load from ABI-native format
-  align-info            # retrieve information from SRA alignment object (cSRA)
-  bam-load              # load from BAM format into SRA (cSRA)
-  cg-load               # load from Complete Genomics native format
-  fastq-dump            # dump to FASTQ format
-  fastq-load            # load from FASTQ format
-  helicos-load          # load from Helicos native format
-  illumina-dump         # dump to Illumina-native format
-  illumina-load         # load from Illumina-native format
-  kar                   # single file archive utility
-  kdbmeta               # access db, table or column metadata
-  latf-load             # generic FASTQ loader
-  prefetch              # tool to download runs from NCBI by accession
-  rcexplain             # return code display utility
-  sam-dump              # dump to SAM format from cSRA
-  sff-dump              # dumps 454 runs in SFF format
-  sff-load              # load from SFF format
-  sra-kar               # sra-specific kar tool
-  sra-pileup            # produces SAM-style pileup information from SRA (cSRA)
-  sra-sort              # canonically orders SRA (cSRA) data for improved access
-  sra-stat              # gather run statistics and print to stdout
-  srapath               # returns the full location of an object by accession
-  srf-load              # load from SRF format
-  test-sra              # test user's environment for configuration and libraries
-  vdb-config            # display and/or modify user configuration
-  vdb-copy              # tool to copy tables
-  vdb-decrypt           # tool to decrypt files from dbGap
-  vdb-dump              # dump rows in a textual format
-  vdb-encrypt           # to to (re)encrypt files using dbGap encryption key
-  vdb-lock              # locks an object against modification
-  vdb-unlock            # unlocks an object
-
-<OUTDIR>/lib64/         # (lib32 for 32-bit builds)
-  libalign-access       # BAM format reading API
-  libalign-reader       # SRA (cSRA) alignment reading API
-  libbz2                # bzip2 library
-  libkdb                # physical layer reading library
-  libkfg                # configuration library
-  libkfs                # physical file system library
-  libklib               # support library
-  libkproc              # process synchronization library
-  libkq                 # cross-thread queue library
-  libkrypto             # cryptographic library
-  libsproc              # single-threaded stub library
-  libksrch              # search algorithm library
-  libkurl               # interface to libcurl
-  libkxfs               # XML to filesystem library
-  libkxml               # XML container support library
-  libload               # loader tool utility library
-  libsradb              # API for accessing sra
-  libsrareader          # reader library
-  libsraschema          # version of SRA schema for reading
-  libvdb                # virtual layer reading library
-  libvfs                # virtual file system library
-  libwkdb               # physical layer update library
-  libwsradb             # update API for SRA
-  libwsraschema         # version of SRA schema for update
-  libwvdb               # virtual layer update library
-  libz                  # gzip library
-
-<OUTDIR>/mod64/         # (mod32 for 32-bit builds)
-  -- empty --
-
-<OUTDIR>/wmod64/        # (wmod32 for 32-bit builds)
-  -- empty --
-
-
-
-DYNAMIC BUILD RESULTS:
-
-<OUTDIR>/bin64/         # (bin32 for 32-bit builds)
-  -- same as static --
-
-<OUTDIR>/lib64/         # (lib32 for 32-bit builds)
-  libalign-access       # BAM format reading API
-  libalign-reader       # SRA (cSRA) alignment reading API
-  libbz2                # static bzip2 library
-  libkdb                # physical layer reading library
-  libkfg                # configuration library
-  libkfs                # physical file system library
-  libklib               # support library
-  libkproc              # process synchronization library
-  libkq                 # cross-thread queue library
-  libkrypto             # cryptographic library
-  libsproc              # single-threaded stub library
-  libksrch              # search algorithm library
-  libkurl               # interface to libcurl
-  libkxfs               # XML to filesystem library
-  libkxml               # XML container support library
-  libload               # loader tool utility library
-  libsradb              # API for accessing sra
-  libsrareader          # reader library
-  libsraschema          # static version of SRA schema for reading
-  libvdb                # virtual layer reading library
-  libvfs                # virtual file system library
-  libwkdb               # physical layer update library
-  libwsradb             # update API for SRA
-  libwsraschema         # static version of SRA schema for update
-  libwvdb               # virtual layer update library
-  libz                  # static gzip library
-
-<OUTDIR>/mod64/         # (mod32 for 32-bit builds)
-  libaxf                # cSRA-specific VDB external functions
-  libsraxf              # SRA-specific VDB external functions
-  libvxf                # generic VDB external functions
-  libwgsxf              # WGS-specific VDB external functions
-
-<OUTDIR>/wmod64/        # (wmod32 for 32-bit builds)
-  libwaxf               # cSRA-specific VDB external functions for update
-  libwsraxf             # SRA-specific VDB external functions for update
-  libwvxf               # update VDB external functions
-  libwwgsxf             # WGS-specific VDB external functions for update
-
diff --git a/README-config.txt b/README-config.txt
deleted file mode 100644
index f64ffdb..0000000
--- a/README-config.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-The NCBI SRA ( Sequence Read Archive )
-
-
-Contact: sra-tools at ncbi.nlm.nih.gov
-http://trace.ncbi.nlm.nih.gov/Traces/sra/std
-
-About configuration-assistant:
-
-  configuration-assistant.perl will help you to configure the SRA tools to be able
-  to access the local reference repository and to download the correct references
-  for a given cSRA file.
-
-To run configuration-assistant on Linux or Mac:
-  - open a shell
-  - change directory to the folder where you extracted the toolkit (cd .../sratoolkit...),
-  - type 'perl configuration-assistant.perl' (without the quotation marks).
-
-
-To run configuration-assistant on Windows:
-
-  - open Command Prompt (Start->Run->cmd.exe),
-  - change directory to the folder where you extracted the toolkit (cd ...\sratoolkit.x.x.x-win64),
-  - type 'perl configuration-assistant.perl' (without the quotation marks).
-
-
-If the following message shows up:
-
-  "'perl' is not recognized as an internal or external command,
-    operable program or batch file."
-
-that means perl is not installed or not installed properly.
-
-Download Perl at ActiveState.com (http://www.activestate.com/activeperl/downloads)
diff --git a/build/BUILD.linux b/build/BUILD.linux
deleted file mode 100644
index 17640be..0000000
--- a/build/BUILD.linux
+++ /dev/null
@@ -1 +0,0 @@
-rel
diff --git a/build/BUILD.mac b/build/BUILD.mac
deleted file mode 100644
index 17640be..0000000
--- a/build/BUILD.mac
+++ /dev/null
@@ -1 +0,0 @@
-rel
diff --git a/build/BUILD.win b/build/BUILD.win
deleted file mode 100644
index 17640be..0000000
--- a/build/BUILD.win
+++ /dev/null
@@ -1 +0,0 @@
-rel
diff --git a/build/COMP.linux b/build/COMP.linux
deleted file mode 100644
index 90584dd..0000000
--- a/build/COMP.linux
+++ /dev/null
@@ -1 +0,0 @@
-gcc
diff --git a/build/COMP.mac b/build/COMP.mac
deleted file mode 100644
index 90584dd..0000000
--- a/build/COMP.mac
+++ /dev/null
@@ -1 +0,0 @@
-gcc
diff --git a/build/COMP.win b/build/COMP.win
deleted file mode 100644
index 86cc381..0000000
--- a/build/COMP.win
+++ /dev/null
@@ -1 +0,0 @@
-vc++
diff --git a/build/LNKG.linux b/build/LNKG.linux
deleted file mode 100644
index fa47d9e..0000000
--- a/build/LNKG.linux
+++ /dev/null
@@ -1 +0,0 @@
-stat
diff --git a/build/LNKG.mac b/build/LNKG.mac
deleted file mode 100644
index fa47d9e..0000000
--- a/build/LNKG.mac
+++ /dev/null
@@ -1 +0,0 @@
-stat
diff --git a/build/LNKG.win b/build/LNKG.win
deleted file mode 100644
index fa47d9e..0000000
--- a/build/LNKG.win
+++ /dev/null
@@ -1 +0,0 @@
-stat
diff --git a/build/Makefile.clang b/build/Makefile.clang
deleted file mode 100644
index 51d6c8a..0000000
--- a/build/Makefile.clang
+++ /dev/null
@@ -1,80 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# compilers
-CC = @ $(TOP)/build/cc.sh $(OS) 'clang -c' \
-	 $(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
-CP = @ $(TOP)/build/cc.sh $(OS) 'clang -xc++ -c' \
-	 $(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
-
-# C preprocessor
-PP = gcc -E $(CFLAGS)
-
-# linkers
-LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) gcc \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) g++ \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-# tool options
-WARN = -Wall -Wno-variadic-macros -Wno-long-long # -Wconversion
-ifeq (linux,$(OS))
-    NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
-endif
-
-ifeq (64,$(BITS))
-	CARCH = -m64
-else
-	CARCH = -m32
-endif
-
-ifeq (prof, $(BUILD))
-	PROF = -pg
-endif
-
-ifeq (dbg, $(BUILD))
-	DBG = -g
-	OPT = $(WARN)
-	NOPT = $(WARN)
-	# GCC seems unable to use c99 without ansi, which
-	# basically clobbers features back to c89. the options
-	# must be specified in the order shown.
-	PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
-else
-
-ifeq (x86_64, $(ARCH))
-	OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
-else
-	OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
-endif
-endif
-
-# clang is designed to be a GCC substitute
-COMP_DAD = gcc
diff --git a/build/Makefile.env b/build/Makefile.env
deleted file mode 100644
index 0fe1472..0000000
--- a/build/Makefile.env
+++ /dev/null
@@ -1,343 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# pick up dependencies from object directory
-ifdef SRCDIR
-	include $(wildcard *.d)
-endif
-
-# determine shell environment
-include $(TOP)/build/Makefile.shell
-
-# normally build shared and static external libs
-LIBEXT = $(LIBX) $(SHLX)
-
-# normally build static intermediate libs
-ILIBEXT = $(LIBX)
-
-# would normally only build dynamic library modules,
-# but some tools are expecting to be able to static link
-MODEXT = $(LIBX) $(SHLX)
-
-# determine BUILD
-ifeq (,$(BUILD))
-	BUILD = dbg
-endif
-
-# some rules are sensitive to the type of build
-BUILDTYPE = $(BUILD)
-
-# adjust settings for build
-ifeq (dbg,$(BUILD))
-	DEBUG := -D_DEBUGGING
-#	ILIBEXT = $(LIBX) $(SHLX)
-	MODEXT = $(LIBX) $(SHLX)
-endif
-ifeq (rel,$(BUILD))
-	DEBUG := -DNDEBUG
-endif
-ifeq (prof,$(BUILD))
-	DEBUG := -DNDEBUG -D_PROFILING
-endif
-
-# allow for an all-static build
-ifeq (stat,$(LNKG))
-	STATIC = --static
-	LINKAGE := -D_STATIC
-	LIBEXT = $(LIBX)
-	ILIBEXT = $(LIBX)
-	MODEXT = $(LIBX)
-	STAT_OR_DYN = static
-	STATICSYSLIBS := --static-system-libs
-
-else
-	STAT_OR_DYN = dynamic
-endif
-
-LOCAL_OR_REMOTE = local
-
-
-# drop all suffix rules
-.SUFFIXES:
-
-# load OS and COMP specific files
-include $(TOP)/build/Makefile.$(OS)
-include $(TOP)/build/Makefile.$(COMP)
-include $(TOP)/build/Makefile.rules
-
-# external schema modules
-EXT_SCHEMA_MODULES = axf sraxf wgsxf vxf
-READONLY_SCHEMA_LIBS = $(addprefix -d,$(EXT_SCHEMA_MODULES))
-UPDATE_SCHEMA_LIBS = $(addprefix -dw,$(EXT_SCHEMA_MODULES))
-ALWAYS_STATIC_SCHEMA_LIBS = $(addprefix -s,$(EXT_SCHEMA_MODULES))
-
-# full directory paths
-OLD_TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(TOOLSET)/$(ARCH)
-TARGDIR = $(OUTDIR)/$(OSFLAV)/$(TOOLSET)/$(LNKG)/$(ARCH)/$(BUILD)
-BINDIR = $(TARGDIR)/bin
-ifeq (win,$(OS))
-    # on Windows, place test executables next to .dlls
-    TEST_BINDIR = $(BINDIR)
-else
-    TEST_BINDIR = $(TARGDIR)/test-bin
-endif
-ILIBDIR = $(TARGDIR)/ilib
-LIBDIR = $(TARGDIR)/lib
-MODDIR = $(TARGDIR)/mod
-WMODDIR = $(TARGDIR)/wmod
-OBJDIR = $(TARGDIR)/obj/$(MODULE)
-
-# path to the ncbi sub-directory
-# this is where modules and installed schema files are kept
-ifeq (win,$(OS))
-    # under Windows, we are always relative to binary path
-	NCBIDIR = $(BINDIR)/ncbi
-else
-ifeq (--static,$(STATIC))
-    # in static builds, we are relative to binary path
-    # because the configuration library will be part of tool
-	NCBIDIR = $(BINDIR)/ncbi
-else
-    # in dynamic builds, we are relative to library path
-    # because the configuration library will live there
-	NCBIDIR = $(LIBDIR)/ncbi
-endif
-endif
-
-# make reissue command
-MAKE_CMD = $(MAKE) BUILD=$(BUILD) TOOLSET=$(TOOLSET) COMP=$(COMP) LNKG=$(LNKG) \
-    TOP=$(TOP) SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
-
-# directory and link creation
-SUBDIRS = bin test-bin ilib lib
-OUTDIRS = schema
-
-# clean rules
-stdclean:
-	@ -rm -rf $(OBJDIR)
-	@ rm -rf $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
-			$(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \
-			$(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \
-			$(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \
-			$(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS))) \
-			$(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(ALL_TOOLS) $(TEST_TOOLS)))
-
-# removing symbolic links that point to specific builds
-removelinks:
-	@ test ! -h $(OUTDIR)/schema && rm -rf $(OUTDIR)/schema || true
-	@ rm -f $(addprefix $(OUTDIR)/,$(addsuffix $(BITS),$(SUBDIRS)))
-	@ rm -f $(addprefix $(OUTDIR)/,$(OUTDIRS))
-
-# create all required output directories
-makedirs:
-	@ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)
-
-# build version include files
-vers-includes: makedirs
-	@ $(MAKE_CMD) -s $(TARGDIR)/$@
-
-ifeq (win,$(OS))
-
-# Windows doesn't really support symbolic links
-# we may add them back in when our toolkit is able to create them
-rebuild-dirlinks: makedirs
-	@ true
-else
-
-LNDIRS = $(addprefix ln_,$(SUBDIRS))
-$(LNDIRS):
-	@ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)
-
-ifdef NOREBUILD_LINKS
-rebuild-dirlinks:
-	@ true
-else
-rebuild-dirlinks: removelinks makedirs $(LNDIRS)
-	@ ln -s $(TOP)/interfaces $(OUTDIR)/schema
-endif
-
-endif
-
-.PHONY: stdclean removelinks makedirs vers-includes rebuild-dirlinks
-
-# configuration targets 
-out:
-	@ echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(BUILD_OS)
-	@ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
-
-CC:
-	@ echo cc > $(TOP)/build/COMP.$(OS)
-
-GCC:
-	@ echo gcc > $(TOP)/build/COMP.$(OS)
-
-ICC:
-	@ echo icc > $(TOP)/build/COMP.$(OS)
-
-VC++:
-	@ echo vc++ > $(TOP)/build/COMP.$(OS)
-
-CLANG:
-	@ echo clang > $(TOP)/build/COMP.$(OS)
-
-static:
-	@ echo stat > $(TOP)/build/LNKG.$(OS)
-
-dynamic:
-	@ echo dyn > $(TOP)/build/LNKG.$(OS)
-
-debug:
-	@ echo dbg > $(TOP)/build/BUILD.$(OS)
-
-profile: static
-	@ echo prof > $(TOP)/build/BUILD.$(OS)
-
-release:
-	@ echo rel > $(TOP)/build/BUILD.$(OS)
-
-pubtools: release static
-
-bindir:
-	@ echo "$(BINDIR)"
-
-targdir:
-	@ echo "$(TARGDIR)"
-
-osdir:
-	@ echo "$(OUTDIR)/$(OSFLAV)"
-
-compilers:
-	@ echo "$(COMPILERS)"
-
-architectures:
-	@ echo "$(ARCHITECTURES)"
-
-architecture:
-	@ echo "$(ARCH)"
-
-config:
-	@ echo "  current build is $(BUILD_OS) $(STAT_OR_DYN) $(BUILD) $(ARCH) build using $(TOOLSET) tools"
-	@ echo "  output target directory is '$(TARGDIR)'"
-	@ echo
-
-.PHONY: out CC GCC ICC debug profile release bindir report_config
-
-# includes based upon build
-ITF = $(TOP)/interfaces
-OSINC = $(TOP)/interfaces/os
-CCINC = $(TOP)/interfaces/cc
-XTINC = $(TOP)/interfaces/ext
-
-# OS specific source and include dirs
-SRCDIRS_OS = $(SRCDIR)/$(OS)
-INCDIRS_OS = $(OSINC)/$(OS)
-
-# most OS' have a parent type
-ifdef OS_DAD
-
-SRCDIRS_OS += $(SRCDIR)/$(OS_DAD)
-INCDIRS_OS += $(OSINC)/$(OS_DAD)
-
-# some OS' have a grandparent
-ifdef OS_GDAD
-SRCDIRS_OS += $(SRCDIR)/$(OS_GDAD)
-INCDIRS_OS += $(OSINC)/$(OS_GDAD)
-endif
-
-endif
-
-# compiler specific includes
-INCDIRS_COMP = \
-	$(CCINC)/$(COMP)/$(ARCH) \
-	$(CCINC)/$(COMP)
-
-# some compilers have a parent type
-ifdef COMP_DAD
-
-INCDIRS_COMP += \
-	$(CCINC)/$(COMP_DAD)/$(ARCH) \
-	$(CCINC)/$(COMP_DAD)
-
-endif
-
-VPATH = \
-	$(SRCDIR)/$(COMP)/$(ARCH) \
-	$(SRCDIR)/$(COMP) \
-	$(SRCDIRS_OS) \
-	$(SRCDIR)
-
-INCDIRS = \
-	$(addprefix -I,$(SRCDIRS_OS)) \
-	$(addprefix -I,$(SRCDIR) $(ITF)) \
-	$(addprefix -I,$(INCDIRS_COMP)) \
-	$(addprefix -I,$(INCDIRS_OS) $(XTINC)) \
-	-I.
-
-
-# defines that describe os & architecture
-DLLX ?= $(SHLX)
-ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
-
-# default tool parameters
-CFLAGS	= $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
-CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
-LDFLAGS = $(DBG) $(PROF) $(CARCH)
-
-#-------------------------------------------------------------------------------
-# runtests
-# 
-# MallocScribble=1 is for catching allocation problems on Mac
-#
-ifeq ($(RUNTESTS_OVERRIDE),)
-runtests: std $(TEST_TOOLS)
-	@ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);export MallocScribble=1;\
-	for i in $(TEST_TOOLS);\
-	do\
-		echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
-		echo Run $(TEST_BINDIR)/$$i;eval $(RUN_REMOTELY) $(TEST_BINDIR)/$$i;r=$$?; \
-		if [ "$$r" != "0" ] ; then exit $$r; fi; \
-	done
-
-.PHONY: runtests
-endif
-
-#-------------------------------------------------------------------------------
-# buildtests
-# 
-buildtests: std $(TEST_TOOLS) $(SLOW_TEST_TOOLS)
-
-#-------------------------------------------------------------------------------
-# slowtests
-# 
-slowtests: std $(SLOW_TEST_TOOLS)
-	@ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);\
-	for i in $(SLOW_TEST_TOOLS);\
-	do\
-		echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
-		echo Run $(TEST_BINDIR)/$$i;eval $(TEST_BINDIR)/$$i;r=$$?; \
-		if [ "$$r" != "0" ] ; then exit $$r; fi; \
-	done
-
-.PHONY: slowtests buildtests
diff --git a/build/Makefile.gcc b/build/Makefile.gcc
deleted file mode 100644
index 271dff3..0000000
--- a/build/Makefile.gcc
+++ /dev/null
@@ -1,81 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# compilers
-CC = @ $(TOP)/build/cc.sh $(OS) 'gcc -c' \
-	 $(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
-CP = @ $(TOP)/build/cc.sh $(OS) 'g++ -c' \
-	 $(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
-
-# C preprocessor
-PP = gcc -E $(CFLAGS)
-
-# linkers
-LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) gcc \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) g++ \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-# tool options
-WARN = -Wall -Wno-long-long 
-ifneq (sun,$(OS))
-    WARN += -Wno-variadic-macros
-endif
-
-ifeq (linux,$(OS))
-    NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
-endif
-
-ifeq (64,$(BITS))
-	CARCH = -m64
-else
-	CARCH = -m32
-endif
-
-ifeq (prof, $(BUILD))
-	PROF = -pg
-endif
-
-ifeq (dbg, $(BUILD))
-	DBG = -g
-	OPT = $(WARN)
-	NOPT = $(WARN)
-	# GCC seems unable to use c99 without ansi, which
-	# basically clobbers features back to c89. the options
-	# must be specified in the order shown.
-	PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
-else
-
-ifeq (x86_64, $(ARCH))
-	OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
-else
-	OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
-endif
-endif
diff --git a/build/Makefile.icc b/build/Makefile.icc
deleted file mode 100644
index 612a148..0000000
--- a/build/Makefile.icc
+++ /dev/null
@@ -1,77 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# compilers
-CC = @ $(TOP)/build/cc.sh $(OS) 'icc -c' \
-	$(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
-CP = @ $(TOP)/build/cc.sh $(OS) 'icpc -c' \
-	$(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
-
-# C preprocessor
-PP = icc -E $(CFLAGS)
-
-# linkers
-LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) icc \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) icpc \
-	--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
-	$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-# tool options
-WARN = -Wall
-
-ifeq (64,$(BITS))
-	CARCH = -m64
-else
-	CARCH = -m32
-endif
-
-ifeq (prof, $(BUILD))
-	PROF := -p
-endif
-
-ifeq (dbg, $(BUILD))
-	DBG = -g
-	OPT = $(WARN)
-	NOPT = $(WARN)
-else
-
-ifeq (x86_64, $(ARCH))
-	OPT := -O3 -unroll -xW
-else
-	OPT := -O3 -unroll -xW
-endif
-endif
-
-ifeq (prof, $(BUILD))
-	OPT += -vec_report5
-endif
-
-# ICC is designed to be a GCC substitute
-COMP_DAD = gcc
diff --git a/build/Makefile.linux b/build/Makefile.linux
deleted file mode 100644
index a5fcd45..0000000
--- a/build/Makefile.linux
+++ /dev/null
@@ -1,82 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# default compiler
-ifeq (,$(COMP))
-	COMP = gcc
-endif
-
-# handle attempts to set cross-compilation architecture
-# note that if your installation is set up for cross compilation,
-# you can try to enable it on your own.
-ifeq (i386,$(ARCH))
-i386:
-	@ true
-x86_64:
-	@ echo "Linux builds do not support cross-compilation to this architecture"
-endif
-
-ifeq (x86_64,$(ARCH))
-i386:
-	@ echo "Linux builds do not support cross-compilation to this architecture"
-x86_64:
-	@ true
-endif
-
-.PHONY: i386 x86_64
-
-
-# library prefix
-LPFX = lib
-
-# file extensions
-OBJX = o
-LOBX = pic.o
-LIBX = a
-SHLX = so
-
-# compilation defines
-DEFINES	:= -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64
-
-# linux is a Unix variant
-OS_DAD = unix
-
-# support for libxml
-## TBD - move to libs/kxml, but this will break static builds...
-ifdef NCBI
-  ifeq (dbg,$(BUILD))
-	LIBXML_LPATH = $(NCBI)/libxml/DebugMT/lib
-  else
-	LIBXML_LPATH = $(NCBI)/libxml/lib
-  endif
-	DFLT_LIBXML_INCLUDES = $(NCBI)/libxml/include/libxml2
-endif
-
-# flex+bison
-LEX  = @ true
-YACC = @ true
-
-# build matrix
-COMPILERS = GCC # ICC
diff --git a/build/Makefile.mac b/build/Makefile.mac
deleted file mode 100644
index 74e5160..0000000
--- a/build/Makefile.mac
+++ /dev/null
@@ -1,77 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# default compiler
-ifeq (,$(COMP))
-	COMP = gcc
-endif
-
-# architecture
-xARCH = $(shell test -f $(TOP)/build/ARCH.mac && cat $(TOP)/build/ARCH.mac)
-ifneq (,$(xARCH))
-
-  # the user has selected an architecture
-  ifeq (i386,$(xARCH))
-    ARCH = i386
-    BITS = 32
-  endif
-  ifeq (x86_64,$(xARCH))
-    ARCH = x86_64
-    BITS = 64
-  endif
-
-endif
-
-# allow the user to override architecture
-i386 x86_64:
-	@ echo $@ > $(TOP)/build/ARCH.mac
-
-.PHONY: i386 x86_64
-
-
-# library prefix
-LPFX = lib
-
-# file extensions
-OBJX = o
-LOBX = pic.o
-LIBX = a
-SHLX = dylib
-
-# compilation defines
-DEFINES	:= -DMAC -DBSD -DUNIX -D_REENTRANT -D_FILE_OFFSET_BITS=64
-
-# Darwin is a Unix variant
-OS_DAD = bsd
-OS_GDAD = unix
-
-LIBXML_LPATH = /usr/lib
-
-# flex+bison: on Mac, use source-controlled generated .c/.h files
-YACC = @ true
-LEX = @ true
-
-# build matrix
-COMPILERS = GCC CLANG
diff --git a/build/Makefile.rules b/build/Makefile.rules
deleted file mode 100644
index bb18f20..0000000
--- a/build/Makefile.rules
+++ /dev/null
@@ -1,104 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-## build rules
-
-# executable image
-%.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $<
-%.$(OBJX): %.cpp
-	$(CP) -o $@ $(OPT) $<
-%.$(OBJX): %.cxx
-	$(CP) -o $@ $(OPT) $<
-
-# non-optimized executable image
-%.nopt.$(OBJX): %.c
-	$(CC) -o $@ $(NOPT) $<
-%.nopt.$(OBJX): %.cpp
-	$(CP) -o $@ $(NOPT) $<
-%.nopt.$(OBJX): %.cxx
-	$(CP) -o $@ $(NOPT) $<
-
-# relocatable image
-%.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY $<
-%.$(LOBX): %.cpp
-	$(CP) -o $@ -fPIC $(OPT) -D_LIBRARY $<
-%.$(LOBX): %.cxx
-	$(CP) -o $@ -fPIC $(OPT) -D_LIBRARY $<
-
-# non-optimized relocatable image
-%.nopt.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(NOPT) -D_LIBRARY $<
-%.nopt.$(LOBX): %.cpp
-	$(CP) -o $@ -fPIC $(NOPT) -D_LIBRARY $<
-%.nopt.$(LOBX): %.cxx
-	$(CP) -o $@ -fPIC $(NOPT) -D_LIBRARY $<
-
-# non-optimized relocatable image with persisted image byte swapping
-%.swap.nopt.$(LOBX): %.c
-	$(CC) -o $@ -fPIC -DSWAP_PERSISTED $(NOPT) -D_LIBRARY $<
-%.swap.nopt.$(LOBX): %.cpp
-	$(CP) -o $@ -fPIC -DSWAP_PERSISTED $(NOPT) -D_LIBRARY $<
-%.swap.nopt.$(LOBX): %.cxx
-	$(CP) -o $@ -fPIC -DSWAP_PERSISTED $(NOPT) -D_LIBRARY $<
-
-# assembly
-%.$(OBJX) %.$(LOBX): %.s
-	$(CC) -o $@ $<
-
-# assembly language output
-%.s: %.c
-	$(CC) -S -o $@ $(OPT) $<
-%.s: %.cpp
-	$(CP) -S -o $@ $(OPT) $<
-%.s: %.cxx
-	$(CP) -S -o $@ $(OPT) $<
-
-%.nopt.s: %.c
-	$(CC) -S -o $@ $(NOPT) $<
-%.nopt.s: %.cpp
-	$(CP) -S -o $@ $(NOPT) $<
-%.nopt.s: %.cxx
-	$(CP) -S -o $@ $(NOPT) $<
-
-%.pic.s: %.c
-	$(CC) -S -o $@ -fPIC $(OPT) $<
-%.pic.s: %.cpp
-	$(CP) -S -o $@ -fPIC $(OPT) $<
-%.pic.s: %.cxx
-	$(CP) -S -o $@ -fPIC $(OPT) $<
-
-%.nopt.pic.s: %.c
-	$(CC) -S -o $@ -fPIC $(NOPT) $<
-%.nopt.pic.s: %.cpp
-	$(CP) -S -o $@ -fPIC $(NOPT) $<
-%.nopt.pic.s: %.cxx
-	$(CP) -S -o $@ -fPIC $(NOPT) $<
-
-
-# version include generation
-%.vers.h: %.vers
-	$(TOP)/build/make-vers-inc.sh $^ > $@
diff --git a/build/Makefile.shell b/build/Makefile.shell
deleted file mode 100644
index 0990c50..0000000
--- a/build/Makefile.shell
+++ /dev/null
@@ -1,150 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# determine OS
-UNAME = $(shell uname -s)
-
-ifeq (Darwin, $(UNAME))
-	HOST_OS = mac
-endif
-ifeq (Linux, $(UNAME))
-	HOST_OS = linux
-endif
-ifeq (SunOS, $(UNAME))
-	HOST_OS = sun
-	ARCHITECTURES = x86_64 i386
-endif
-ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))
-	HOST_OS = win
-endif
-ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
-	HOST_OS = win
-endif
-
-# assume build OS is the same as host OS
-OS = $(HOST_OS)
-BUILD_OS = $(OS)
-
-# determine ARCH
-ARCHITECTURES = default
-ifeq (mac,$(HOST_OS))
-	HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
-else
-	MARCH = $(shell uname -m)
-
-	ifeq (i386, $(MARCH))
-		HOST_ARCH = i386
-	endif
-	ifeq (i486, $(MARCH))
-		HOST_ARCH = i386
-	endif
-	ifeq (i586, $(MARCH))
-		HOST_ARCH = i386
-	endif
-	ifeq (i686, $(MARCH))
-		ifeq (WOW64x, $(findstring WOW64x,$(UNAME)x))
-			# 64-bit capable Cygwin. Analyze the version of cl to set the corect architecture
-			CL = $(shell cl.exe 2>&1 >/dev/null)
-			ifeq (for x64, $(findstring for x64, $(CL)))
-				HOST_ARCH = x86_64
-			else
-				HOST_ARCH = i386
-			endif			
-		else
-			HOST_ARCH = i386
-		endif	
-	endif
-	ifeq (x86_64, $(MARCH))
-		HOST_ARCH = x86_64
-	endif
-	ifeq (i86pc, $(MARCH))
-		HOST_ARCH = x86_64
-		ARCHITECTURES = x86_64 i386
-	endif
-	ifeq (sun4v,$(MARCH))
-		HOST_ARCH = sparc64
-		ARCHITECTURES = sparc64 sparc32
-	endif
-endif
-
-ARCH = $(HOST_ARCH)
-REMOTE_ARCH = $(ARCH)
-
-# pick up dependencies from object directory
-ifdef SRCDIR
-	include $(wildcard *.d)
-else
-
-# determine SRCDIR
-ifdef MODULE
-	SRCDIR=$(TOP)/$(MODULE)
-else
-	SRCDIR=$(TOP)
-endif
-
-# set COMP, LNKG and BUILD
-COMP = $(shell test -f $(TOP)/build/COMP && mv $(TOP)/build/COMP $(TOP)/build/COMP.$(OS); test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
-LNKG = $(shell test -f $(TOP)/build/STATIC && mv $(TOP)/build/STATIC $(TOP)/build/LNKG.$(OS) && echo stat > $(TOP)/build/LNKG.$(OS); test -f $(TOP)/build/LNKG.$(OS) && cat $(TOP)/build/LNKG.$(OS) || echo stat)
-BUILD = $(shell test -f $(TOP)/build/BUILD && mv $(TOP)/build/BUILD $(TOP)/build/BUILD.$(OS); test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
-TOOLSET := $(COMP)
-
-ifdef USE_GCC_IF_ICC
-ifeq (icc,$(COMP))
-COMP = gcc
-endif
-ifeq (clang,$(COMP))
-COMP = gcc
-endif
-endif
-
-endif
-
-# set OUTDIR
-ifndef OUTDIR
-	OUTDIR = $(shell test -f $(TOP)/build/OUTDIR && mv $(TOP)/build/OUTDIR $(TOP)/build/OUTDIR.$(BUILD_OS); test -f $(TOP)/build/OUTDIR.$(BUILD_OS) && cat $(TOP)/build/OUTDIR.$(BUILD_OS) || echo $(TOP))
-	ifeq (,$(OUTDIR))
-		OUTDIR = $(TOP)
-	endif
-endif
-ifeq (,$(ROUTDIR))
-	ROUTDIR = $(RHOME)
-endif
-
-# OS flavor is normally OS
-OSFLAV = $(OS)
-
-# determine BITS
-ifeq (x86_64, $(ARCH))
-	BITS = 64
-endif
-ifeq (sparc64, $(ARCH))
-	BITS = 64
-endif
-ifeq (i386, $(ARCH))
-	BITS = 32
-endif
-ifeq (sparc32, $(ARCH))
-	BITS = 32
-endif
diff --git a/build/Makefile.targets b/build/Makefile.targets
deleted file mode 100644
index fc83a63..0000000
--- a/build/Makefile.targets
+++ /dev/null
@@ -1,114 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# defines make targets commonly used in non-leaf directories:
-#   default
-#   all
-#   std
-#   clean
-#   buildtests
-#   runtests
-#   slowtests
-#
-# requires $(SUBDIRS) to be defined
-#
-# to control which subdirectories are affected by a specific target, define
-# SUBDIRS_CLEAN, SUBDIRS_RUNTESTS, etc., like this:
-#   SUBDIRS_CLEAN = $(addsuffix _clean, du4r1 dir2 dir3)
-#
-
-default: $(SUBDIRS) 
-
-#-------------------------------------------------------------------------------
-# all
-#
-SUBDIRS_ALL ?= $(addsuffix _all,$(SUBDIRS))
-
-all: $(SUBDIRS_ALL)
-
-$(SUBDIRS_ALL):
-	@ $(MAKE) -C $(subst _all,,$@) all
-
-.PHONY: all $(SUBDIRS_ALL)
-
-#-------------------------------------------------------------------------------
-# std
-#
-SUBDIRS_STD = $(addsuffix _std,$(SUBDIRS))
-
-std: $(SUBDIRS_STD)
-
-$(SUBDIRS_STD): 
-	@ $(MAKE) -C $(subst _std,,$@) std
-
-.PHONY: std $(SUBDIRS_STD)
-
-#-------------------------------------------------------------------------------
-# clean
-#
-SUBDIRS_CLEAN ?= $(addsuffix _clean,$(SUBDIRS))
-
-clean: $(SUBDIRS_CLEAN)
-
-$(SUBDIRS_CLEAN):
-	@ $(MAKE) -s -C $(subst _clean,,$@) clean
-
-.PHONY: clean $(SUBDIRS_CLEAN)
-
-#-------------------------------------------------------------------------------
-# runtests
-#
-SUBDIRS_RUNTESTS ?= $(addsuffix _runtests,$(SUBDIRS))
-
-runtests: std $(SUBDIRS_RUNTESTS)
-
-$(SUBDIRS_RUNTESTS):
-	@ $(MAKE) -s -C $(subst _runtests,,$@) runtests
-
-.PHONY: runtests $(SUBDIRS_RUNTESTS)
-
-#-------------------------------------------------------------------------------
-# buildtests
-#
-SUBDIRS_BUILDTESTS ?= $(addsuffix _buildtests, $(SUBDIRS))
-
-buildtests: std $(SUBDIRS_BUILDTESTS)
-
-$(SUBDIRS_BUILDTESTS):
-	@ $(MAKE) -C $(subst _buildtests,,$@) buildtests
-
-.PHONY: buildtests $(SUBDIRS_BUILDTESTS)
-
-#-------------------------------------------------------------------------------
-# slowtests
-#
-SUBDIRS_SLOWTESTS ?= $(addsuffix _slowtests, $(SUBDIRS))
-
-slowtests: $(SUBDIRS_SLOWTESTS)
-
-$(SUBDIRS_SLOWTESTS):
-	@ $(MAKE) -C $(subst _slowtests,,$@) slowtests
-
-.PHONY: slowtests $(SUBDIRS_SLOWTESTS)
-
diff --git a/build/Makefile.vc++ b/build/Makefile.vc++
deleted file mode 100644
index e2c3815..0000000
--- a/build/Makefile.vc++
+++ /dev/null
@@ -1,80 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# RFLAGS have to go before any other flags since they can affect their handling
-# compilers
-CC = @ $(TOP)/build/win-cc.sh $(BUILD_OS) "cl /c /D_WIN32_WINNT=0x0502" \
-	 $(CHECKSUM) --objx $(OBJX) $(RFLAGS) $(CFLAGS) -MD 
-	 
-CP = @ $(TOP)/build/win-cc.sh $(BUILD_OS) "cl /c" \
-	 $(CHECKSUM) --objx $(OBJX) $(RFLAGS) $(CPFLAGS) -MD -EHsc
-	 
-
-# C preprocessor
-PP = gcc -E $(CFLAGS)
-
-# linkers
-LD = @ $(TOP)/build/ld.sh $(BUILD_OS) $(ARCH) link \
-	--build $(BUILD) $(RFLAGS) $(LDFLAGS) $(STATIC) $(CHECKSUM) \
-	--objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-LP = @ $(TOP)/build/ld.sh $(BUILD_OS) $(ARCH) link \
-	--build $(BUILD) $(RFLAGS) $(LDFLAGS) $(STATIC) $(CHECKSUM) \
-	--objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-	-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
-
-# tool options
-CDECL = -Gd
-STDCALL = -Gz
-CALLCONV = $(CDECL)
-STRING_POOLING = -GF
-OPT := $(STRING_POOLING) $(CALLCONV) -nologo
-NOPT := -Od $(OPT)
-
-ifeq (64,$(BITS))
-	CARCH = #-m64
-else
-	CARCH = #-m32
-	WARN := #-Wall
-endif
-
-ifeq (prof, $(BUILD))
-#	PROF := -pg
-endif
-
-ifeq (dbg, $(BUILD))
-	DBG = -Od
-	OPT += -Zi $(WARN)
-	NOPT += -Zi $(WARN)
-else
-# -Ox caused us failures noticed in libs/vdb/cast.c
-#	OPT += -Ox -w
-# /Ox == /Ob2gity  g is deprecated so removed
-# Removing either the 2 or the t makes it seem to work
-# But there is a warning about not knowing what /Ob is
-# if the 2 is removed.  But not if the 2 is there.
-# Woo hoo Microsoft...
-	OPT += -Ob2iy  -w
-endif
diff --git a/build/Makefile.win b/build/Makefile.win
deleted file mode 100644
index 5644350..0000000
--- a/build/Makefile.win
+++ /dev/null
@@ -1,66 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# default compiler
-ifeq (,$(COMP))
-	COMP = vc++
-endif
-
-# handle attempts to set cross-compilation architecture
-ifeq (i386,$(ARCH))
-i386:
-	@ true
-x86_64:
-	@ echo "Windows builds do not support cross-compilation to this architecture"
-endif
-
-ifeq (x86_64,$(ARCH))
-i386:
-	@ echo "Windows builds do not support cross-compilation to this architecture"
-x86_64:
-	@ true
-endif
-
-.PHONY: i386 x86_64
-
-# library prefix
-LPFX = lib
-
-# file extensions
-OBJX = obj
-LOBX = pic.obj
-LIBX = a
-SHLX = lib
-DLLX = dll
-
-# compilation defines
-DEFINES	:= -DWINDOWS
-
-# flex+bison: on Windows, use source-controlled generated .c/.h files
-YACC = @ true
-LEX = @ true
-
-# build matrix
-COMPILERS = VC++
diff --git a/build/abspath.sh b/build/abspath.sh
deleted file mode 100755
index a5aa56b..0000000
--- a/build/abspath.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-if cd "$1"
-then
-    pwd
-else
-    echo "`pwd`/$1"
-fi
diff --git a/build/cc.sh b/build/cc.sh
deleted file mode 100755
index d57b450..0000000
--- a/build/cc.sh
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# prepare script name
-SELF_NAME="$(basename $0)"
-SCRIPT_BASE="${0%.sh}"
-
-# os
-OS="$1"
-shift
-
-# binary compiler
-CC="$1"
-shift
-
-# configuration
-unset TARG
-unset ARGS
-CHECKSUM=0
-OBJX=o
-
-while [ $# -ne 0 ]
-do
-
-    case "$1" in
-    --cflags)
-        ARGS="$ARGS $2"
-        shift
-        ;;
-
-    --checksum)
-        CHECKSUM=1
-        ;;
-
-    --objx)
-        OBJX="$2"
-        shift
-        ;;
-
-    -o*)
-        ARGS="$ARGS $1"
-        ARG="${1#-o}"
-        if [ "$ARG" = "" ]
-        then
-            ARGS="$ARGS $2"
-            ARG="$2"
-            shift
-        fi
-        TARG="$ARG"
-        ;;
-
-    *)
-        ARGS="$ARGS $1"
-        ;;
-        
-    esac
-
-    shift
-done
-
-# *** START SCM-code ***************************************
-if [ $CHECKSUM -eq 1 ]
-then
-    if [ "$TARG" = "" ]
-    then
-        echo "$SELF_NAME: no target specified"
-        exit 5
-    fi
-
-    if [ "$TARG" = "${TARG%.$OBJX}" ]
-    then
-        echo "$SELF_NAME: malformed target"
-        exit 6
-    fi
-
-    TARG="${TARG%.$OBJX}"
-fi
-# *** END SCM-code ***************************************
-
-CMD="$CC $ARGS"
-echo "$CMD"
-$CMD || exit $?
-
-# *** START SCM-code ***************************************
-if [ $CHECKSUM -eq 1 ] && [ "$OS" = "linux" ]
-then
-    CMD="strip $TARG.$OBJX -o $TARG.stripped.$OBJX"
-    echo "$CMD"
-    if $CMD
-    then
-        MD5RES=`md5sum -b $TARG.stripped.$OBJX`
-        STATUS=$?
-        rm -f "$TARG.stripped.$OBJX" || true
-        if [ $STATUS -eq 0 ]
-            then
-            MD5VALUE=${MD5RES:0:32}
-            echo "$TARG.$OBJX=$MD5VALUE" > "$TARG.$OBJX.md5"
-            else
-            exit $STATUS
-        fi
-    else
-        STATUS=$?
-        rm "$TARG.$OBJX"
-        exit $STATUS
-    fi
-fi
-# *** END SCM-code ***************************************
diff --git a/build/increment-release.sh b/build/increment-release.sh
deleted file mode 100755
index 153c0d6..0000000
--- a/build/increment-release.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# capture input
-VERSION=$1
-
-# split the version into separate integers
-SPLIT_VERS="$(echo $VERSION | tr '.' ' ')"
-
-inc-version ()
-{
-    local MAJ=$1
-    local MIN=$2
-    local REL=$(expr $3 + 1)
-
-    echo "$MAJ.$MIN.$REL"
-}
-
-# rewrite the version
-inc-version $SPLIT_VERS
-
diff --git a/build/ld.linux.cmn.sh b/build/ld.linux.cmn.sh
deleted file mode 100755
index 0751b72..0000000
--- a/build/ld.linux.cmn.sh
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-LD="$1"
-ARCH="$2"
-BUILD="$3"
-shift 3
-
-SRCDIR="$1"
-BINDIR="$2"
-OUTDIR="$3"
-TARG="$4"
-NAME="$5"
-DBGAP="$6"
-shift 6
-
-VERS="$1"
-VERSFILE="$2"
-DEPFILE="$3"
-shift 3
-
-MODE="$1"
-SCMFLAGS="$2"
-LDFLAGS="$3"
-shift 3
-
-LDIRS="$1"
-XDIRS="$2"
-shift 2
-
-OBJS="$1"
-LIBS="$2"
-
-# decode MODE
-STATIC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-DYLD=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-KPROC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-THREADS=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_M=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_XML=$(expr $MODE % 2)
-
-# decode SCMFLAGS
-CHECKSUM=$(expr $SCMFLAGS % 2)
-STATICSYSLIBS=$(expr $SCMFLAGS / 2)
-
-# return parameter for find-lib
-LIBPATH=''
-
-# initial command state
-CMD=''
-LD_STATIC_STATE=0
-LD_ALL_STATE=0
-
-# for breaking out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-# for locating libraries
-find-lib ()
-{
-    _lib="lib$1"
-    _dirs="$2"
-
-    LIBPATH=''
-
-    while [ "$_dirs" != "" ]
-    do
-        _dir="${_dirs%%:*}"
-
-        if [ "$_dir" != "" ]
-        then
-            if [ -e "$_dir/$_lib" ]
-            then
-                while [ -L "$_dir/$_lib" ]
-                do
-                    _lib=$(readlink -n "$_dir/$_lib")
-                done
-                LIBPATH="$_dir/$_lib"
-                break;
-            fi
-        fi
-
-        _dirs="${_dirs#$_dir}"
-        _dirs="${_dirs#:}"
-    done
-}
-
-# setting state
-load-static ()
-{
-    if [ $LD_STATIC_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_STATIC"
-        LD_STATIC_STATE=1
-    fi
-}
-
-load-dynamic ()
-{
-    if [ $LD_STATIC_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_DYNAMIC"
-        LD_STATIC_STATE=0
-    fi
-}
-
-load-all-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_ALL_SYMBOLS"
-        LD_ALL_STATE=1
-    fi
-}
-
-load-ref-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_REF_SYMBOLS"
-        LD_ALL_STATE=0
-    fi
-}
diff --git a/build/ld.linux.dlib.sh b/build/ld.linux.dlib.sh
deleted file mode 100755
index 4621a98..0000000
--- a/build/ld.linux.dlib.sh
+++ /dev/null
@@ -1,308 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : require shared
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-BUILD_DIR="$(dirname $0)"
-
-# parameters and common functions
-source "${0%dlib.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-g*)
-    source "${0%dlib.sh}gcc.sh"
-    ;;
-i*)
-    source "${0%dlib.sh}icc.sh"
-    ;;
- *)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# DLIB_CMD was started in tool-specific source
-CMD="$DLIB_CMD $LDFLAGS"
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# list of static libraries used to create dynamic lib
-SLIBS=''
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD -L$DIR"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    # update LD_LIBRARY_PATH
-    unset LD_LIBRARY_PATH
-    export LD_LIBRARY_PATH="$LDIRS:$XDIRS"
-
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -ldl|-ddl)
-
-            # always load libdl as shared library
-            load-ref-symbols
-            load-dynamic
-            CMD="$CMD -ldl"
-            ;;
-
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.so $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-                    SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                if [ $STATICSYSLIBS -eq 1 ]
-                then
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to static
-                        load-static
-                        load-all-symbols
-                        ;;
-
-                    *)
-                        # set load to dynamic
-                        load-ref-symbols
-                        load-dynamic
-                        ;;
-
-                    esac
-                else
-                    # set load to normal
-                    load-ref-symbols
-                    load-dynamic
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $LIBNAME.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-                SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                # load static
-                load-static
-                load-all-symbols
-                CMD="$CMD -l$LIBNAME"
-
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                if [ $STATIC -eq 1 ] || [ $STATICSYSLIBS -eq 1 ]
-                then
-                    # set load to static
-                    load-static
-                    load-all-symbols
-                else
-
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to dynamic
-                        load-ref-symbols
-                        load-dynamic
-                        ;;
-
-                    *)
-                        # set load to static
-                        load-static
-                        load-all-symbols
-                        ;;
-                    esac
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -d*)
-
-            # only dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.so $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to normal
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# put state back to normal
-load-ref-symbols
-load-dynamic
-
-# add in pthreads
-if [ $THREADS -ne 0 ]
-then
-    CMD="$CMD -lpthread"
-fi
-
-# add in xml
-if [ $HAVE_XML -ne 0 ]
-then
-    CMD="$CMD -lxml2"
-fi
-
-# add in math library
-if [ $HAVE_M -ne 0 ]
-then
-    CMD="$CMD -lm"
-fi
-
-# produce shared library
-echo "$CMD"
-$CMD || exit $?
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
-
-if [ $CHECKSUM -eq 1 ]
-then
-    SCM_DIR="${BUILD_DIR%/*}/scm"
-    LOGFILE="$SCM_DIR/scm.log"
-    MSG=">>>>> scm: calling the collect script from ld.linux.dlib.sh <<<<<<"
-    #echo "$MSG"
-    echo "$MSG" >> $LOGFILE
-
-    "$BUILD_DIR/scm-collect.sh" "$OBJS" "$SLIBS" | sort -u > "$TARG.md5"
-fi
\ No newline at end of file
diff --git a/build/ld.linux.exe.sh b/build/ld.linux.exe.sh
deleted file mode 100755
index afa1de6..0000000
--- a/build/ld.linux.exe.sh
+++ /dev/null
@@ -1,322 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : ignore - will be dynamically loaded
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : require static
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-BUILD_DIR="$(dirname $0)"
-
-# parameters and common functions
-source "${0%exe.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-g*)
-    source "${0%exe.sh}gcc.sh"
-    ;;
-i*)
-    source "${0%exe.sh}icc.sh"
-    ;;
-*)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# EXE_CMD was started in tool-specific source
-CMD="$EXE_CMD $LDFLAGS"
-
-# if building a static executable against dynamic libraries
-# the main application will substitute for name lookup
-if [ $STATIC -eq 1 ] && [ $DYLD -eq 1 ]
-then
-#    CMD="$CMD $LD_EXPORT_GLOBAL $LD_MULTIPLE_DEFS"
-    CMD="$CMD $LD_EXPORT_GLOBAL"
-fi
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# list of static libraries used to create executable
-SLIBS=''
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile $VERSFILE"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD -L$DIR"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    # update LD_LIBRARY_PATH
-    unset LD_LIBRARY_PATH
-    export LD_LIBRARY_PATH="$LDIRS:$XDIRS"
-
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -ldl|-ddl)
-
-            # always load libdl as shared library
-            load-ref-symbols
-            load-dynamic
-            CMD="$CMD -ldl"
-            ;;
-
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.so $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load dynamic
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-                    SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                    # load static
-                    load-static
-                    [ $STATIC -eq 1 ] && load-all-symbols
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                # do not need to load all symbols for external libs
-                [ $STATIC -eq 1 ] && load-ref-symbols
-
-                if [ $STATICSYSLIBS -eq 1 ]
-                then
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to static
-                        load-static
-                        ;;
-
-                    *)
-                        # set load to dynamic
-                        load-dynamic
-                        ;;
-
-                    esac
-                else
-                    # set load to normal
-                    load-dynamic
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $LIBNAME.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-                SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                # load static
-                load-static
-                [ $STATIC -eq 1 ] && load-all-symbols
-                CMD="$CMD -l$LIBNAME"
-
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                # do not need to load all symbols for external libs
-                [ $STATIC -eq 1 ] && load-ref-symbols
-
-                if [ $STATIC -eq 1 ] || [ $STATICSYSLIBS -eq 1 ]
-                then
-
-                    # set load to static
-                    load-static
-
-                else
-
-                    # special case for libs we have in "ext"
-                    # that are sometimes requested as static
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to dynamic
-                        load-dynamic
-                        ;;
-                    *)
-                        load-static
-                        ;;
-                    esac
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -d*)
-
-            FOUND=0
-            if [ $STATIC -eq 1 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-                    SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-
-                # not found within our directories
-                if [ $FOUND -eq 0 ]
-                then
-                    load-static
-                    load-all-symbols
-
-                    CMD="$CMD -l$LIBNAME"
-                fi
-            fi
-            ;;
-
-
-        esac
-
-    done
-fi
-
-# return to normal
-load-ref-symbols
-load-dynamic
-
-# add in pthreads
-if [ $THREADS -ne 0 ]
-then
-    CMD="$CMD -lpthread"
-fi
-
-# add in xml
-if [ $HAVE_XML -ne 0 ]
-then
-    CMD="$CMD -lxml2"
-fi
-
-# add in math library
-if [ $HAVE_M -ne 0 ]
-then
-    CMD="$CMD -lm"
-fi
-
-# produce shared library
-echo $CMD
-$CMD || exit $?
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
-
-if [ $CHECKSUM -eq 1 ]
-then
-    SCM_DIR="${BUILD_DIR%/*}/scm"
-    LOGFILE="$SCM_DIR/scm.log"
-    MSG=">>>>> scm: calling the collect script from ld.linux.exe.sh <<<<<<"
-    #echo "$MSG"
-    echo "$MSG" >> $LOGFILE
-
-    "$BUILD_DIR/scm-collect.sh" "$OBJS" "$SLIBS" | sort -u > "$TARG.md5"
-fi
diff --git a/build/ld.linux.gcc.sh b/build/ld.linux.gcc.sh
deleted file mode 100755
index af6aaba..0000000
--- a/build/ld.linux.gcc.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# define linker params
-LD_EXPORT_GLOBAL="-Wl,--export-dynamic"
-LD_MULTIPLE_DEFS="-Wl,-zmuldefs"
-LD_STATIC="-Wl,-Bstatic"
-LD_DYNAMIC="-Wl,-Bdynamic"
-LD_ALL_SYMBOLS="-Wl,-whole-archive"
-LD_REF_SYMBOLS="-Wl,-no-whole-archive"
-
-# build command
-DLIB_CMD="$LD -shared"
-EXE_CMD="$LD"
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    DLIB_CMD="$DLIB_CMD -o $TARG"
-    EXE_CMD="$EXE_CMD -o $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    DLIB_CMD="$DLIB_CMD -o $OUTDIR/$NAME$DBGAP.so.$VERS -Wl,-soname,$NAME.so.$MAJ"
-    EXE_CMD="$EXE_CMD -o $OUTDIR/$NAME$DBGAP.$VERS"
-fi
diff --git a/build/ld.linux.icc.sh b/build/ld.linux.icc.sh
deleted file mode 100755
index 0c1ae50..0000000
--- a/build/ld.linux.icc.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# define linker params
-LD_EXPORT_GLOBAL="-Wa,--export-dynamic"
-LD_MULTIPLE_DEFS="-Wa,-zmuldefs"
-LD_STATIC="-Bstatic"
-LD_DYNAMIC="-Bdynamic"
-LD_ALL_SYMBOLS="-Wa,-whole-archive"
-LD_REF_SYMBOLS="-Wa,-no-whole-archive"
-
-# build command
-DLIB_CMD="$LD -shared"
-EXE_CMD="$LD"
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    DLIB_CMD="$DLIB_CMD -o $TARG"
-    EXE_CMD="$EXE_CMD -o $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    DLIB_CMD="$DLIB_CMD -o $OUTDIR/$NAME$DBGAP.so.$VERS -Wl,-soname,$NAME.so.$MAJ"
-    EXE_CMD="$EXE_CMD -o $OUTDIR/$NAME$DBGAP.$VERS"
-fi
diff --git a/build/ld.linux.ln.sh b/build/ld.linux.ln.sh
deleted file mode 100755
index ee5bd9d..0000000
--- a/build/ld.linux.ln.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-TYPE="$1"
-OUTDIR="$2"
-TARG="$3"
-NAME="$4"
-DBGAP="$5"
-EXT="$6"
-VERS="$7"
-
-# find target
-TARG=$(basename "$TARG")
-
-# put extension back onto name
-NAME="$NAME$DBGAP"
-STATIC_NAME="$NAME-static"
-if [ "$EXT" != "" ]
-then
-    NAME="$NAME.$EXT"
-    STATIC_NAME="$STATIC_NAME.$EXT"
-fi
-
-# break out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-set-vers $(echo $VERS | tr '.' ' ')
-
-cd "$OUTDIR" || exit 5
-
-# create link
-create-link ()
-{
-    rm -f "$2"
-    local CMD="ln -s $1 $2"
-    echo $CMD
-    $CMD
-}
-
-# test for version in target name
-if [ "$TARG" != "$NAME.$MAJ.$MIN.$REL" ]
-then
-
-    # for simple name, create 2 links
-    if [ "$TARG" = "$NAME" ]
-    then
-        create-link "$NAME.$MAJ.$MIN.$REL" "$NAME.$MAJ"
-        create-link "$NAME.$MAJ" "$NAME"
-
-        # for static libraries, create special link
-        if [ "$TYPE" = "slib" ]
-        then
-            create-link "$NAME" "$STATIC_NAME"
-        fi
-
-    # for name with major version in it
-    elif [ "$TARG" = "$NAME.$MAJ" ]
-    then
-        create-link "$NAME.$MAJ.$MIN.$REL" "$NAME.$MAJ"
-
-
-    # for name with major & minor version in it
-    elif [ "$TARG" = "$NAME.$MAJ.$MIN" ]
-    then
-        create-link "$NAME.$MAJ.$MIN.$REL" "$NAME.$MAJ.$MIN"
-    fi
-fi
diff --git a/build/ld.linux.slib.sh b/build/ld.linux.slib.sh
deleted file mode 100755
index ab72ef8..0000000
--- a/build/ld.linux.slib.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal or static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-BUILD_DIR="$(dirname $0)"
-
-# parameters and common functions
-source "${0%slib.sh}cmn.sh"
-
-# initialize command
-CMD="ar -rc"
-
-# function to convert an archive into individual object files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path)"
-
-    # unpack archive into temporary directory
-    mkdir -p ld-tmp
-    if ! cd ld-tmp
-    then
-        echo "$SELF_NAME: failed to cd to ld-tmp"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # rename and add to source files list
-    local m=
-    for m in $mbrs
-    do
-        mv $m $LIBNAME-$m
-        CMD="$CMD ld-tmp/$LIBNAME-$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    CMD="$CMD $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    CMD="$CMD $OUTDIR/$NAME$DBGAP.a.$VERS"
-fi
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# list of static libraries used to create this lib
-SLIBS=''
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -s*)
-
-            # force static load
-            find-lib $LIBNAME.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-                SLIBS="$SLIBS $(dirname $LIBPATH)/lib$LIBNAME.a"
-
-                # convert to individual object files
-                convert-static "$LIBPATH" || exit $?
-
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# produce static library
-echo $CMD
-$CMD || exit $?
-
-# remove temporaries
-rm -rf ld-tmp
-
-# produce dependencies
-if [ "$DEPFILE" != "" ] && [ "$DEPS" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
-
-if [ $CHECKSUM -eq 1 ]
-then
-    SCM_DIR="${BUILD_DIR%/*}/scm"
-    LOGFILE="$SCM_DIR/scm.log"
-    MSG=">>>>> scm: calling the collect script from ld.linux.slib.sh <<<<<<"
-    #echo "$MSG"
-    echo "$MSG" >> $LOGFILE
-
-    "$BUILD_DIR/scm-collect.sh" "$OBJS" "$SLIBS" | sort -u > "$TARG.md5"
-fi
diff --git a/build/ld.mac.cmn.sh b/build/ld.mac.cmn.sh
deleted file mode 100755
index d3f20b1..0000000
--- a/build/ld.mac.cmn.sh
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-LD="$1"
-ARCH="$2"
-BUILD="$3"
-shift 3
-
-SRCDIR="$1"
-BINDIR="$2"
-OUTDIR="$3"
-TARG="$4"
-NAME="$5"
-DBGAP="$6"
-shift 6
-
-VERS="$1"
-VERSFILE="$2"
-DEPFILE="$3"
-shift 3
-
-MODE="$1"
-SCMFLAGS="$2"
-LDFLAGS="$3"
-shift 3
-
-LDIRS="$1"
-XDIRS="$2"
-shift 2
-
-OBJS="$1"
-LIBS="$2"
-
-# decode MODE
-STATIC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-DYLD=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-KPROC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-THREADS=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_M=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_XML=$(expr $MODE % 2)
-
-# decode SCMFLAGS
-CHECKSUM=$(expr $SCMFLAGS % 2)
-STATICSYSLIBS=$(expr $SCMFLAGS / 2)
-
-# return parameter for find-lib
-LIBPATH=''
-
-# initial command state
-CMD=''
-LD_STATIC_STATE=0
-LD_ALL_STATE=0
-
-# for breaking out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-# for locating libraries
-find-lib ()
-{
-    _lib="lib$1"
-    _dirs="$2"
-
-    LIBPATH=''
-
-    while [ "$_dirs" != "" ]
-    do
-        _dir="${_dirs%%:*}"
-
-        if [ "$_dir" != "" ]
-        then
-            if [ -e "$_dir/$_lib" ]
-            then
-                while [ -L "$_dir/$_lib" ]
-                do
-                    _lib=$(readlink -n "$_dir/$_lib")
-                done
-                LIBPATH="$_dir/$_lib"
-                break;
-            fi
-        fi
-
-        _dirs="${_dirs#$_dir}"
-        _dirs="${_dirs#:}"
-    done
-}
-
-# setting state
-load-static ()
-{
-    if [ $LD_STATIC_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_STATIC"
-        LD_STATIC_STATE=1
-    fi
-}
-
-load-dynamic ()
-{
-    if [ $LD_STATIC_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_DYNAMIC"
-        LD_STATIC_STATE=0
-    fi
-}
-
-load-all-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_ALL_SYMBOLS"
-        # the Mac linker doesn't support state
-        LD_ALL_STATE=0
-    fi
-}
-
-load-ref-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_REF_SYMBOLS"
-        LD_ALL_STATE=0
-    fi
-}
diff --git a/build/ld.mac.dlib.sh b/build/ld.mac.dlib.sh
deleted file mode 100755
index d194ff8..0000000
--- a/build/ld.mac.dlib.sh
+++ /dev/null
@@ -1,361 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : require shared
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%dlib.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-g*)
-    source "${0%dlib.sh}gcc.sh"
-    ;;
-i*)
-    source "${0%dlib.sh}icc.sh"
-    ;;
- *)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# DLIB_CMD was started in tool-specific source
-CMD="$DLIB_CMD $LDFLAGS"
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# function to convert an archive into individual object files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path | grep -v '__.SYMDEF SORTED')"
-
-    # unpack archive into temporary directory
-    mkdir -p ld-tmp
-    if ! cd ld-tmp
-    then
-        echo "$SELF_NAME: failed to cd to ld-tmp"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # rename and add to source files list
-    local m=
-    for m in $mbrs
-    do
-        mv $m $LIBNAME-$m
-        CMD="$CMD ld-tmp/$LIBNAME-$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD -L$DIR"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -ldl|-ddl)
-
-            # always load libdl as shared library
-            load-ref-symbols
-            load-dynamic
-            CMD="$CMD -ldl"
-            ;;
-
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.dylib $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME-static.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-#                    load-static
-#                    load-all-symbols
-#                    CMD="$CMD -l$LIBNAME-static"
-                    convert-static "$LIBPATH" || exit $?
-
-                fi
-            fi
-
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-#                    load-static
-#                    load-all-symbols
-#                    CMD="$CMD -l$LIBNAME"
-                    convert-static "$LIBPATH" || exit $?
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                if [ $STATICSYSLIBS -eq 1 ]
-                then
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to static
-                        load-static
-                        load-all-symbols
-                        ;;
-
-                    *)
-                        # set load to dynamic
-                        load-ref-symbols
-                        load-dynamic
-                        ;;
-
-                    esac
-                else
-                    # set load to normal
-                    load-ref-symbols
-                    load-dynamic
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $LIBNAME-static.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-
-                # load static
-#                load-static
-#                load-all-symbols
-#                CMD="$CMD -l$LIBNAME-static"
-                convert-static "$LIBPATH" || exit $?
-
-            fi
-
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-#                    load-static
-#                    load-all-symbols
-#                    CMD="$CMD -l$LIBNAME"
-                    convert-static "$LIBPATH" || exit $?
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                if [ $STATIC -eq 1 ] || [ $STATICSYSLIBS -eq 1 ]
-                then
-                    # set load to static
-                    load-static
-                    load-all-symbols
-                else
-
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to dynamic
-                        load-ref-symbols
-                        load-dynamic
-                        ;;
-
-                    *)
-                        # set load to static
-                        load-static
-                        load-all-symbols
-                        ;;
-                    esac
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -d*)
-
-            # only dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.dylib $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to normal
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# put state back to normal
-load-ref-symbols
-load-dynamic
-
-# add in pthreads
-if [ $THREADS -ne 0 ]
-then
-    CMD="$CMD -lpthread"
-fi
-
-# add in xml
-if [ $HAVE_XML -ne 0 ]
-then
-    CMD="$CMD -lxml2"
-fi
-
-# add in math library
-if [ $HAVE_M -ne 0 ]
-then
-    CMD="$CMD -lm"
-fi
-
-# produce shared library
-echo "$CMD"
-$CMD || exit $?
-
-# remove temporaries
-rm -rf ld-tmp
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
diff --git a/build/ld.mac.exe.sh b/build/ld.mac.exe.sh
deleted file mode 100755
index 1b70a5f..0000000
--- a/build/ld.mac.exe.sh
+++ /dev/null
@@ -1,340 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : ignore - will be dynamically loaded
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : require static
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%exe.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-g*)
-    source "${0%exe.sh}gcc.sh"
-    ;;
-i*)
-    source "${0%exe.sh}icc.sh"
-    ;;
-*)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# EXE_CMD was started in tool-specific source
-CMD="$EXE_CMD $LDFLAGS"
-
-# if building a static executable against dynamic libraries
-# the main application will substitute for name lookup
-if [ $STATIC -eq 1 ] && [ $DYLD -eq 1 ]
-then
-    CMD="$CMD $LD_EXPORT_GLOBAL $LD_MULTIPLE_DEFS"
-fi
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile $VERSFILE"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD -L$DIR"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -ldl|-ddl)
-
-            # always load libdl as shared library
-            load-ref-symbols
-            load-dynamic
-            CMD="$CMD -ldl"
-            ;;
-
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $LIBNAME.dylib $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load dynamic
-                    load-dynamic
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME-static.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-                    load-static
-                    [ $STATIC -eq 1 ] && load-all-symbols
-                    CMD="$CMD -l$LIBNAME-static"
-
-                fi
-            fi
-
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-                    load-static
-                    [ $STATIC -eq 1 ] && load-all-symbols
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                # do not need to load all symbols for external libs
-                [ $STATIC -eq 1 ] && load-ref-symbols
-
-                if [ $STATICSYSLIBS -eq 1 ]
-                then
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to static
-                        load-static
-                        ;;
-
-                    *)
-                        # set load to dynamic
-                        load-dynamic
-                        ;;
-
-                    esac
-                else
-                    # set load to normal
-                    load-dynamic
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $LIBNAME-static.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-
-                # load static
-                load-static
-                [ $STATIC -eq 1 ] && load-all-symbols
-                CMD="$CMD -l$LIBNAME-static"
-
-            fi
-
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-                    load-static
-                    [ $STATIC -eq 1 ] && load-all-symbols
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-
-                # do not need to load all symbols for external libs
-                [ $STATIC -eq 1 ] && load-ref-symbols
-
-                if [ $STATIC -eq 1 ] || [ $STATICSYSLIBS -eq 1 ]
-                then
-
-                    # set load to static
-                    load-static
-
-                else
-
-                    # special case for libs we have in "ext"
-                    # that are sometimes requested as static
-                    case "$LIBNAME" in
-                    z|bz2)
-                        # set load to dynamic
-                        load-dynamic
-                        ;;
-                    *)
-                        load-static
-                        ;;
-                    esac
-                fi
-
-                CMD="$CMD -l$LIBNAME"
-            fi
-            ;;
-
-        -d*)
-
-            FOUND=0
-            if [ $STATIC -eq 1 ]
-            then
-                find-lib $LIBNAME.a $LDIRS
-                if [ "$LIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $LIBPATH"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-
-                    CMD="$CMD -l$LIBNAME"
-
-                fi
-
-                # not found within our directories
-                if [ $FOUND -eq 0 ]
-                then
-                    load-static
-                    load-all-symbols
-
-                    CMD="$CMD -l$LIBNAME"
-                fi
-            fi
-            ;;
-
-
-        esac
-
-    done
-fi
-
-# return to normal
-load-ref-symbols
-load-dynamic
-
-# add in pthreads
-if [ $THREADS -ne 0 ]
-then
-    CMD="$CMD -lpthread"
-fi
-
-# add in xml
-if [ $HAVE_XML -ne 0 ]
-then
-    CMD="$CMD -lxml2"
-fi
-
-# add in math library
-if [ $HAVE_M -ne 0 ]
-then
-    CMD="$CMD -lm"
-fi
-
-# produce shared library
-echo $CMD
-$CMD || exit $?
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
-
diff --git a/build/ld.mac.gcc.sh b/build/ld.mac.gcc.sh
deleted file mode 100755
index c145942..0000000
--- a/build/ld.mac.gcc.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# define linker params
-LD_EXPORT_GLOBAL="-Wl,-all_load"
-LD_MULTIPLE_DEFS=""
-LD_STATIC=""
-LD_DYNAMIC=""
-LD_ALL_SYMBOLS=""
-LD_REF_SYMBOLS=""
-
-# the Mac is set up for cross-compilation
-LD="$LD -Wl,-arch,$ARCH"
-
-# build command
-DLIB_CMD="$LD -dynamiclib"
-EXE_CMD="$LD"
-
-# Mach install-name sans extension
-INSTNAME="@executable_path/../lib/$NAME$DBGAP"
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    DLIB_CMD="$DLIB_CMD -o $TARG -install_name $INSTNAME.dylib"
-    EXE_CMD="$EXE_CMD -o $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    DLIB_CMD="$DLIB_CMD -o $OUTDIR/$NAME$DBGAP.$VERS.dylib -install_name $INSTNAME.$VERS.dylib -compatibility_version $MAJ -current_version $VERS -flat_namespace -undefined suppress"
-    EXE_CMD="$EXE_CMD -o $OUTDIR/$NAME$DBGAP.$VERS"
-fi
diff --git a/build/ld.mac.ln.sh b/build/ld.mac.ln.sh
deleted file mode 100755
index 55216fd..0000000
--- a/build/ld.mac.ln.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-TYPE="$1"
-OUTDIR="$2"
-TARG="$3"
-NAME="$4"
-DBGAP="$5"
-EXT="$6"
-VERS="$7"
-
-# find target
-TARG=$(basename "$TARG")
-
-# put extension back onto name, unless it's "dylib"
-NAME="$NAME$DBGAP"
-STATIC_LIB_NAME="$NAME-static.a"
-[ "$EXT" != "" ] && [ "$EXT" != "dylib" ] && NAME="$NAME.$EXT"
-
-# break out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-set-vers $(echo $VERS | tr '.' ' ')
-
-cd "$OUTDIR" || exit 5
-
-# assemble versioned names
-NAME_MMR="$NAME.$MAJ.$MIN.$REL"
-NAME_MM="$NAME.$MAJ.$MIN"
-NAME_M="$NAME.$MAJ"
-
-# if extension was "dylib", NOW append to names
-if [ "$EXT" = "dylib" ]
-then
-    NAME_MMR="$NAME_MMR.$EXT"
-    NAME_MM="$NAME_MM.$EXT"
-    NAME_M="$NAME_M.$EXT"
-    NAME="$NAME.$EXT"
-fi
-
-# create link
-create-link ()
-{
-    rm -f "$2"
-    local CMD="ln -s $1 $2"
-    echo $CMD
-    $CMD
-}
-
-# test for version in target name
-if [ "$TARG" != "$NAME_MMR" ]
-then
-
-    # for simple name, create 2 links
-    if [ "$TARG" = "$NAME" ]
-    then
-        create-link "$NAME_MMR" "$NAME_M"
-        create-link "$NAME_M" "$NAME"
-        [ "$EXT" = "a" ] && create-link "$NAME" "$STATIC_LIB_NAME"
-
-    # for name with major version in it
-    elif [ "$TARG" = "$NAME_M" ]
-    then
-        create-link "$NAME_MMR" "$NAME_M"
-
-
-    # for name with major & minor version in it
-    elif [ "$TARG" = "$NAME_MM" ]
-    then
-        create-link "$NAME_MMR" "$NAME_MM"
-    fi
-fi
diff --git a/build/ld.mac.slib.sh b/build/ld.mac.slib.sh
deleted file mode 100755
index d865330..0000000
--- a/build/ld.mac.slib.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal or static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%slib.sh}cmn.sh"
-
-# initialize command
-CMD="ar -rc"
-
-# function to convert an archive into individual object files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path | grep -v '__.SYMDEF SORTED')"
-
-    # unpack archive into temporary directory
-    mkdir -p ld-tmp
-    if ! cd ld-tmp
-    then
-        echo "$SELF_NAME: failed to cd to ld-tmp"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # rename and add to source files list
-    local m=
-    for m in $mbrs
-    do
-        mv $m $LIBNAME-$m
-        CMD="$CMD ld-tmp/$LIBNAME-$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    CMD="$CMD $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    CMD="$CMD $OUTDIR/$NAME$DBGAP.a.$VERS"
-fi
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -s*)
-
-            # force static load
-            find-lib $LIBNAME.a $LDIRS
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-
-                # convert to individual object files
-                convert-static "$LIBPATH" || exit $?
-
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# produce static library
-echo $CMD
-$CMD || exit $?
-
-# remove temporaries
-rm -rf ld-tmp
-
-# produce dependencies
-if [ "$DEPFILE" != "" ] && [ "$DEPS" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
diff --git a/build/ld.sh b/build/ld.sh
deleted file mode 100755
index c391e32..0000000
--- a/build/ld.sh
+++ /dev/null
@@ -1,558 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# prepare script name
-SELF_NAME="$(basename $0)"
-BUILD_DIR="$(dirname $0)"
-TOP="$(dirname $BUILD_DIR)"
-SCRIPT_BASE="${0%.sh}"
-
-# os
-OS="$1"
-shift
-
-# architecture
-ARCH="$1"
-shift
-
-# binary loader tool
-LD="$1"
-shift
-
-# configuration
-unset SHLX
-unset DYLX
-unset LIBX
-unset OBJX
-unset LOBX
-
-# parameters
-TYPE=exe
-STATIC=0
-DYLD=0
-STATICSYSLIBS=0
-CHECKSUM=0
-KPROC=4
-THREADS=0
-HAVE_KSPROC=0
-NEED_KPROC=1
-HAVE_GZIP=0
-NEED_GZIP=1
-HAVE_BZIP=0
-NEED_BZIP=1
-HAVE_DL=0
-NEED_DL=1
-HAVE_M=0
-NEED_M=1
-HAVE_XML=0
-NEED_XML=0
-unset BUILD
-unset LDIRS
-unset XDIRS
-unset SRCDIR
-unset BINDIR
-unset VERSFILE
-unset VERSDIR
-unset TARG
-unset EXT
-unset OBJS
-unset LIBS
-unset DEPFILE
-
-# paths for translating local to remote
-unset RHOME
-unset LHOME
-unset RHOST
-unset LOUTDIR
-unset ROUTDIR
-unset PROXY_TOOL
-
-while [ $# -ne 0 ]
-do
-
-    case "$1" in
-    --build)
-        BUILD="$2"
-        shift
-        ;;
-
-    --ldflags)
-        LDFLAGS="$2"
-        shift
-        ;;
-
-    --static-system-libs)
-        STATICSYSLIBS=1
-        ;;
-
-    --checksum)
-        CHECKSUM=1
-        ;;
-
-    --shlx)
-        SHLX="$2"
-        shift
-        ;;
-
-    --dylx)
-        SHLX="$2"
-        shift
-        ;;
-
-    --libx)
-        LIBX="$2"
-        shift
-        ;;
-
-    --objx)
-        OBJX="$2"
-        shift
-        ;;
-
-    --srcdir)
-        SRCDIR="$2"
-        shift
-        ;;
-
-    --bindir)
-        BINDIR="$2"
-        shift
-        ;;
-        
-    --rhome)
-        RHOME="$2"
-        shift
-        ;;
-
-    --lhome)
-        LHOME="$2"
-        shift
-        ;;
-
-    --loutdir)
-        LOUTDIR="$2"
-        shift
-        ;;
-
-    --routdir)
-        ROUTDIR="$2"
-        shift
-        ;;
-
-    --rhost)
-        RHOST="$2"
-        shift
-        ;;
-
-    --rport)
-        RPORT="$2"
-        shift
-        ;;
-
-    --proxy_tool)
-        PROXY_TOOL="$2"
-        shift
-        ;;
-
-    -MD)
-        DEPFILE=1
-        ;;
-
-    -L*)
-        ARG="${1#-L}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        LDIRS="$LDIRS:$ARG"
-        ;;
-        
-    -X*)
-        ARG="${1#-X}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        XDIRS="$XDIRS:$ARG"
-        ;;
-
-    --dlib)
-        TYPE=dlib
-        ;;
-
-    --slib)
-        TYPE=slib
-        ;;
-
-    --stub)
-        TYPE=stub
-        ;;
-
-    --exe)
-        TYPE=exe
-        ;;
-
-    --static)
-        STATIC=1
-        ;;
-
-    --vers)
-        if [ -f "$2" ]
-        then
-            VERSFILE="$2"
-        elif [ -d "$2" ]
-        then
-            VERSDIR="$2"
-        else
-            echo "$SELF_NAME: expected version file or source directory"
-            exit 3
-        fi
-        shift
-        ;;
-
-    -o*)
-        ARG="${1#-o}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        TARG="$ARG"
-        ;;
-
-    -lz|-sz|-dz)
-        LIBS="$LIBS $1"
-        HAVE_GZIP=1
-        ;;
-    -[lds]bz2)
-        LIBS="$LIBS $1"
-        HAVE_BZIP=1
-        ;;
-    -[lds]dl)
-        LIBS="$LIBS $1"
-        HAVE_DL=1
-        ;;
-
-    -[lds]xml2)
-        HAVE_XML=32
-        ;;
-
-    -[lds]m)
-        HAVE_M=16
-        ;;
-
-    -lsradb|-ssradb|-dsradb|-lwsradb|-swsradb)
-        LIBS="$LIBS $1"
-        NEED_DL=1
-        DYLD=2
-        ;;
-
-    -lkrypto|-dkrypto)
-        LIBS="$LIBS $1"
-        NEED_KPROC=1
-        ;;
-    -skrypto)
-        LIBS="$LIBS $1"
-        NEED_KPROC=1
-        ;;
-
-    -[ld]kproc)
-        KPROC=4
-        LIBS="$LIBS $1"
-        ;;
-    -skproc)
-        KPROC=4
-        THREADS=8
-        LIBS="$LIBS $1"
-        ;;
-
-    -[lds]ncbi-vdb)
-        KPROC=4
-        HAVE_GZIP=1
-        HAVE_BZIP=1
-        NEED_M=1
-        NEED_XML=1
-        LIBS="$LIBS $1"
-        ;;
-    -[lds]ncbi-wvdb)
-        KPROC=4
-        HAVE_GZIP=1
-        HAVE_BZIP=1
-        NEED_M=16
-        NEED_XML=1
-        LIBS="$LIBS $1"
-        ;;
-
-    -[lds]ksproc)
-        HAVE_KSPROC=1
-        LIBS="$LIBS $1"
-        THREADS=0
-        ;;
-
-    -[lds]pthread)
-        THREADS=8
-        ;;
-
-    -[ls]kfs)
-        LIBS="$LIBS $1"
-        NEED_GZIP=1
-        NEED_BZIP=1
-        NEED_DL=1
-        ;;
-    -dkfs)
-        LIBS="$LIBS $1"
-        NEED_GZIP=1
-        NEED_BZIP=1
-        NEED_DL=1
-        DYLD=2
-        ;;
-
-    -[ls]vfs)
-        LIBS="$LIBS $1"
-        ;;
-    -dvfs)
-        LIBS="$LIBS $1"
-        DYLD=2
-        ;;
-
-    -[ls]kxml)
-        LIBS="$LIBS $1"
-        NEED_XML=1
-        ;;
-    -dkxml)
-        LIBS="$LIBS $1"
-        NEED_XML=1
-        DYLD=2
-        ;;
-
-    -[lds]ncbi-bam)
-        LIBS="$LIBS $1"
-        #NEED_GZIP=1
-        ;;
-
-    -[ls]*)
-        LIBS="$LIBS $1"
-        ;;
-
-    -d*)
-        LIBS="$LIBS $1"
-        DYLD=2
-        ;;
-
-    *.$OBJX)
-        OBJS="$OBJS $1"
-        ;;
-        
-    esac
-
-    shift
-done
-
-# correct for prefixes
-LDIRS="${LDIRS#:}"
-XDIRS="${XDIRS#:}"
-LIBS="${LIBS# }"
-OBJS="${OBJS# }"
-
-# split target
-OUTDIR=$(dirname "$TARG")
-NAME=$(basename "$TARG")
-
-# dependency file
-[ "$DEPFILE" != "" ] && DEPFILE="$NAME.$TYPE.d"
-
-# parse target
-if [ "$TYPE" = "dlib" ] && [ "$DYLX" != "" ]
-then
-    EXT="$DYLX"
-    NAME="${NAME%.$DYLX}"
-fi
-
-unset VERS
-
-V="${NAME#${NAME%\.[^.]*}\.}"
-if [[ $V == ${V//[^0-9]/} ]]
-then
-    ARG="${NAME%\.$V}"
-    VERS="$V"
-    NAME="${ARG#.}"
-
-	V="${NAME#${NAME%\.[^.]*}\.}"
-	if [[ $V == ${V//[^0-9]/} ]]
-    then
-	    ARG="${NAME%\.$V}"
-    	VERS="$V.$VERS"
-	    NAME="${ARG#.}"
-
-		V="${NAME#${NAME%\.[^.]*}\.}"
-		if [[ $V == ${V//[^0-9]/} ]]
-        then
-		    ARG="${NAME%\.$V}"
-	    	VERS="$V.$VERS"
-		    NAME="${ARG#.}"
-        fi
-    fi
-	#echo "ARG=$ARG,VERS=$VERS,NAME=$NAME"
-fi
-
-case "$TYPE" in
-dlib)
-    if [ "$SHLX" != "" ]
-    then
-        EXT="$SHLX"
-        NAME="${NAME%.$SHLX}"
-    fi
-    ;;
-slib)
-    EXT="$LIBX"
-    NAME="${NAME%.$LIBX}"
-esac
-
-unset DBGAP
-if [ "$NAME" != "${NAME%-dbgap}" ]
-then
-	DBGAP=-dbgap
-	NAME="${NAME%-dbgap}"
-fi
-
-# locate version file and version
-[ "$VERSDIR" != "" ] && VERSFILE="$VERSDIR/$NAME.vers"
-if [ "$VERSFILE" != "" ]
-then
-    if [ ! -f "$VERSFILE" ]
-    then
-        echo "$SELF_NAME: warning - creating version file '$VERSFILE'"
-        echo 1.0.0 > $VERSFILE
-    fi
-
-    if [ ! -r "$VERSFILE" ]
-    then
-        echo "$SELF_NAME: version file '$VERSFILE' is unreadable"
-        exit 5
-    fi
-
-    ARG=$(cat $VERSFILE)
-    if [ "$VERS" != "" ] && [ "$VERS" != "$ARG" ] && [ "$ARG" = "${ARG#$VERS.}" ]
-    then
-        echo "$SELF_NAME: version from file '$VERSFILE' ($ARG) does not match '$VERS'"
-        exit 5
-    fi
-    VERS="$ARG"
-fi
-
-# detect need for kproc
-if [ $KPROC -eq 0 ] && [ $NEED_KPROC -ne 0 ] && [ $HAVE_KSPROC -eq 0 ]
-then
-    KPROC=4
-    LIBS="$LIBS -lkproc"
-fi
-
-# turn on threads for kproc
-[ $KPROC -ne 0 ] && THREADS=8
-
-# supply missing libraries
-[ $HAVE_GZIP -eq 0 ] && [ $NEED_GZIP -ne 0 ] && LIBS="$LIBS -lz"
-[ $HAVE_BZIP -eq 0 ] && [ $NEED_BZIP -ne 0 ] && LIBS="$LIBS -lbz2"
-[ $HAVE_DL -eq 0 ] && [ $NEED_DL -ne 0 ] && LIBS="$LIBS -ldl"
-[ $HAVE_M -eq 0 ] && [ $NEED_M -ne 0 ] && HAVE_M=16
-[ $HAVE_XML -eq 0 ] && [ $NEED_XML -ne 0 ] && HAVE_XML=32
-
-# overwrite dependencies
-[ -f "$DEPFILE" ] && rm -f "$DEPFILE"
-
-# generate mode
-MODE=$(expr $HAVE_XML + $HAVE_M + $THREADS + $KPROC + $DYLD + $STATIC)
-#MODE=$(expr $THREADS + $KPROC + $DYLD + 1)
-
-# generate SCM flags
-SCMFLAGS=$(expr $STATICSYSLIBS + $STATICSYSLIBS + $CHECKSUM)
-if [ 0 -ne 0 ]
-then
-    echo "# $SELF_NAME"
-    echo "#   script-base    : $SCRIPT_BASE"
-    echo "#   OS             : $OS"
-    echo "#   type           : $TYPE"
-    echo "#   tool           : $LD"
-    echo "#   ARCH           : $ARCH"
-    echo "#   BUILD          : $BUILD"
-    echo "#   srcdir         : $SRCDIR"
-    echo "#   bindir         : $BINDIR"
-    echo "#   outdir         : $OUTDIR"
-    echo "#   target         : $TARG"
-    echo "#   name           : $NAME"
-    echo "#   dbgap          : $DBGAP"
-    echo "#   version        : $VERS"
-    echo "#   vers file      : $VERSFILE"
-    echo "#   dep file       : $DEPFILE"
-    echo "#   mode           : $MODE"
-    echo "#   DYLD           : $DYLD"
-    echo "#   SCMFLAGS       : $SCMFLAGS"
-    echo "#   LDFLAGS        : $LDFLAGS"
-    echo "#   LDIRS          : $LDIRS"
-    echo "#   XDIRS          : $XDIRS"
-    echo "#   objects        : $OBJS"
-    echo "#   libraries      : $LIBS"
-    echo "#   rhost          : $RHOST"
-    echo "#   rport          : $RPORT"
-    echo "#   rhome          : $RHOME"
-    echo "#   lhome          : $LHOME"
-    echo "#   proxy_tool     : $PROXY_TOOL"
-
-    echo "#   static sys libs: $STATICSYSLIBS"
-    echo "#   checksum       : $CHECKSUM"
-    echo "#   static         : $STATIC"
-    echo "#   kproc          : $KPROC"
-    echo "#   thread libs    : $THREADS"
-    echo "#   vers dir       : $VERSDIR"
-    echo "#   extension      : $EXT"
-fi
-
-# perform link
-"$SCRIPT_BASE.$OS.$TYPE.sh" "$LD" "$ARCH" "$BUILD" "$SRCDIR" "$BINDIR" "$OUTDIR" \
-    "$TARG" "$NAME" "$DBGAP" "$VERS" "$VERSFILE" "$DEPFILE" "$MODE" "$SCMFLAGS" \
-    "$LDFLAGS" "$LDIRS" "$XDIRS" "$OBJS" "$LIBS" "$PROXY_TOOL" "$RHOST" "$RPORT" "$RHOME" "$LHOME" "$(pwd)" "$ROUTDIR" "$LOUTDIR"  || exit $?
-
-# establish links
-if [ "$VERS" != "" ] && [ "$OS" != "win" ] && [ "$OS" != "rwin" ]
-then
-    $SCRIPT_BASE.$OS.ln.sh "$TYPE" "$OUTDIR" "$TARG" "$NAME" "$DBGAP" "$EXT" "$VERS"
-fi
-
-# SCM
-if [ $CHECKSUM -eq 1 ] && [ "$OS" = "linux" ]
-then
-    # calling the scm-version-script
-    # parameters are: module-name, current-md5-file, version-file
-    if [ $TYPE = "dlib" ] || [ $TYPE = "exe" ] || [ $STATIC -eq 1 ]
-    then
-        SCM_DIR="$TOP/scm"
-        LOGFILE="$SCM_DIR/scm.log"
-        SCMD="$BUILD_DIR/scm.sh $NAME $TARG.md5 $VERSFILE"
-        echo "$SCMD" >> $LOGFILE
-        $SCMD
-    fi
-fi
diff --git a/build/ld.unix.cmn.sh b/build/ld.unix.cmn.sh
deleted file mode 100755
index b787c82..0000000
--- a/build/ld.unix.cmn.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-LD="$1"
-shift
-
-SRCDIR="$1"
-OUTDIR="$2"
-TARG="$3"
-NAME="$4"
-DBGAP="$5"
-shift 5
-
-VERS="$1"
-VERSFILE="$2"
-DEPFILE="$3"
-shift 3
-
-MODE="$1"
-SCMFLAGS="$2"
-LDFLAGS="$3"
-shift 3
-
-LDIRS="$1"
-XDIRS="$2"
-shift 2
-
-OBJS="$1"
-LIBS="$2"
-
-# decode MODE
-STATIC=$(expr $MODE % 2)
-DYLD=$(expr $MODE / 2)
-
-# decode SCMFLAGS
-CHECKSUM=$(expr $SCMFLAGS % 2)
-STATICSYSLIBS=$(expr $SCMFLAGS / 2)
-
-# return parameter for find-lib
-LIBPATH=''
-
-# initial command state
-CMD=''
-LD_STATIC_STATE=0
-LD_ALL_STATE=0
-
-# for breaking out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-# for locating libraries
-find-lib ()
-{
-    _lib="lib$1"
-    _dirs="$2"
-
-    LIBPATH=''
-
-    while [ "$_dirs" != "" ]
-    do
-        _dir="${_dirs%%:*}"
-
-        if [ "$_dir" != "" ]
-        then
-            if [ -e "$_dir/$_lib" ]
-            then
-                while [ -L "$_dir/$_lib" ]
-                do
-                    _lib=$(stat -c '%N' "$_dir/$_lib" | tr "\`\'" "  ")
-                    _lib="${_lib#*->}"
-                    _lib="lib${_lib# *lib}"
-                    _lib="${_lib%% *}"
-                done
-                LIBPATH="$_dir/$_lib"
-                break;
-            fi
-        fi
-
-        _dirs="${_dirs#$_dir}"
-        _dirs="${_dirs#:}"
-    done
-}
-
-# setting state
-load-static ()
-{
-    if [ $LD_STATIC_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_STATIC"
-        LD_STATIC_STATE=1
-    fi
-}
-
-load-dynamic ()
-{
-    if [ $LD_STATIC_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_DYNAMIC"
-        LD_STATIC_STATE=0
-    fi
-}
-
-load-all-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_ALL_SYMBOLS"
-        LD_ALL_STATE=1
-    fi
-}
-
-load-ref-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_REF_SYMBOLS"
-        LD_ALL_STATE=0
-    fi
-}
diff --git a/build/ld.unix.slib.sh b/build/ld.unix.slib.sh
deleted file mode 100755
index 21d4b66..0000000
--- a/build/ld.unix.slib.sh
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal or static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-# initialize command
-CMD="ar -rc"
-
-# function to convert an archive into individual object files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path)"
-
-    # unpack archive into temporary directory
-    mkdir -p ld-tmp
-    if ! cd ld-tmp
-    then
-        echo "$SELF_NAME: failed to cd to ld-tmp"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # rename and add to source files list
-    local m=
-    for m in $mbrs
-    do
-        mv $m $LIBNAME-$m
-        CMD="$CMD ld-tmp/$LIBNAME-$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-# versioned output
-if [ "$VERS" = "" ]
-then
-    CMD="$CMD $TARG"
-else
-    set-vers $(echo $VERS | tr '.' ' ')
-    CMD="$CMD $OUTDIR/$NAME$DBGAP.a.$VERS"
-fi
-
-# tack on object files
-CMD="$CMD $OBJS"
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on libraries, finding as we go
-    for LIB in $LIBS
-    do
-
-        # strip off switch
-        LIBNAME="${LIB#-[lsd]}"
-
-        # look at linkage
-        case "$LIB" in
-        -l*|-s*)
-
-            # force static load
-            LIBPATH="$(find-lib $LIBNAME.a $LDIRS)"
-            if [ "$LIBPATH" != "" ]
-            then
-
-                # add it to dependencies
-                DEPS="$DEPS $LIBPATH"
-
-                # convert to individual object files
-                convert-static "$LIBPATH" || exit $?
-
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# produce static library
-echo $CMD
-$CMD || exit $?
-
-# remove temporaries
-rm -rf ld-tmp
-
-# produce dependencies
-if [ "$DEPFILE" != "" ] && [ "$DEPS" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
diff --git a/build/ld.win.cmn.sh b/build/ld.win.cmn.sh
deleted file mode 100755
index 33d0b0a..0000000
--- a/build/ld.win.cmn.sh
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-VERBOSE=
-if [ "$VERBOSE" != "" ] ; then echo "$0 $*"; fi
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters
-LD="$1"
-ARCH="$2"
-BUILD="$3"
-shift 3
-
-SRCDIR="$1"
-BINDIR="$2"
-OUTDIR="$3"
-TARG="$4"
-NAME="$5"
-DBGAP="$6"
-shift 6
-
-VERS="$1"
-VERSFILE="$2"
-DEPFILE="$3"
-shift 3
-
-MODE="$1"
-SCMFLAGS="$2"
-LDFLAGS="$3"
-shift 3
-
-LDIRS="$1"
-XDIRS="$2"
-shift 2
-
-OBJS="$1"
-LIBS="$2"
-shift 2
-
-PROXY_TOOL=$1
-RHOST=$2
-RPORT=$3
-RHOME=$4
-LHOME=$5
-WORKDIR=$6
-ROUTDIR=$7
-LOUTDIR=$8
-shift 8
-
-# decode MODE
-STATIC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-DYLD=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-KPROC=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-THREADS=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_M=$(expr $MODE % 2)
-MODE=$(expr $MODE / 2)
-HAVE_XML=$(expr $MODE % 2)
-
-##### TEMPORARY #####
-KPROC=0
-THREADS=0
-HAVE_M=0
-HAVE_XML=0
-#####################
-
-# decode SCMFLAGS
-CHECKSUM=$(expr $SCMFLAGS % 2)
-STATICSYSLIBS=$(expr $SCMFLAGS / 2)
-
-if [ "$VERBOSE" != "" ] 
-then
-echo "LD            =$LD"
-echo "ARCH          =$ARCH"
-echo "BUILD         =$BUILD"
-echo "SRCDIR        =$SRCDIR"        
-echo "BINDIR        =$BINDIR"        
-echo "OUTDIR        =$OUTDIR"        
-echo "TARG          =$TARG"          
-echo "NAME          =$NAME"          
-echo "DBGAP         =$DBGAP"         
-echo "VERS          =$VERS"          
-echo "VERSFILE      =$VERSFILE"      
-echo "DEPFILE       =$DEPFILE"       
-echo "MODE          =$MODE"          
-echo "SCMFLAGS      =$SCMFLAGS"      
-echo "LDFLAGS       =$LDFLAGS"       
-echo "LDIRS         =$LDIRS"         
-echo "XDIRS         =$XDIRS"         
-echo "OBJS          =$OBJS"          
-echo "LIBS          =$LIBS"   
-echo "PROXY_TOOL    =$PROXY_TOOL"   
-echo "RHOST         =$RHOST"   
-echo "RPORT         =$RPORT"   
-echo "RHOME         =$RHOME"   
-echo "LHOME         =$LHOME"   
-echo "WORKDIR       =$WORKDIR" 
-echo "ROUTDIR       =$ROUTDIR" 
-echo "LOUTDIR       =$LOUTDIR"       
-echo "STATIC        =$STATIC"        
-echo "MODE          =$MODE"          
-echo "DYLD          =$DYLD"          
-echo "MODE          =$MODE"          
-echo "KPROC         =$KPROC"         
-echo "MODE          =$MODE"          
-echo "THREADS       =$THREADS"       
-echo "MODE          =$MODE"          
-echo "HAVE_M        =$HAVE_M"        
-echo "HAVE_XML      =$HAVE_XML"        
-echo "CHECKSUM      =$CHECKSUM"      
-echo "STATICSYSLIBS =$STATICSYSLIBS" 
-fi
-
-# return parameter for find-lib
-xLIBPATH=''
-
-# initial command state
-CMD=''
-LD_STATIC_STATE=0
-LD_ALL_STATE=0
-
-# for breaking out version
-set-vers ()
-{
-    MAJ=$1
-    MIN=$2
-    REL=$3
-}
-
-# for locating libraries
-find-lib ()
-{
-    _lib="lib$1"
-    _dirs="$2"
-
-    xLIBPATH=''
-
-    while [ "$_dirs" != "" ]
-    do
-        _dir="${_dirs%%:*}"
-
-        if [ "$_dir" != "" ]
-        then
-            if [ -e "$_dir/$_lib" ]
-            then
-                xLIBPATH="$_dir/$_lib"
-                break;
-            fi
-        fi
-
-        _dirs="${_dirs#$_dir}"
-        _dirs="${_dirs#:}"
-    done
-}
-
-# setting state
-load-static ()
-{
-    if [ $LD_STATIC_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_STATIC"
-        LD_STATIC_STATE=1
-    fi
-}
-
-load-dynamic ()
-{
-    if [ $LD_STATIC_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_DYNAMIC"
-        LD_STATIC_STATE=0
-    fi
-}
-
-load-all-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 0 ]
-    then
-        CMD="$CMD $LD_ALL_SYMBOLS"
-        LD_ALL_STATE=1
-    fi
-}
-
-load-ref-symbols ()
-{
-    if [ $LD_ALL_STATE -eq 1 ]
-    then
-        CMD="$CMD $LD_REF_SYMBOLS"
-        LD_ALL_STATE=0
-    fi
-}
diff --git a/build/ld.win.dlib.sh b/build/ld.win.dlib.sh
deleted file mode 100755
index a006fcc..0000000
--- a/build/ld.win.dlib.sh
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : require shared
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%dlib.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-link)
-    source "${0%dlib.sh}vc++.sh"
-    ;;
- *)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# DLIB_CMD was started in tool-specific source
-CMD="$DLIB_CMD $LDFLAGS OLE32.lib Ws2_32.lib"
-
-# function to convert static libraries to individual COFF files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path)"
-
-    # create sub directory
-    rm -rf "$2" && mkdir "$2"
-    if ! cd "$2"
-    then
-        echo "$SELF_NAME: failed to cd to $2"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # add source files to link
-    local m=
-    for m in $mbrs
-    do
-        CMD="$CMD $2/$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-# tack on object files
-CMD="$CMD $(cygpath -w $OBJS)"
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile $DEF_FILE"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD /LIBPATH:$(cygpath -w $DIR)"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    HAVE_KERNEL32=0
-    HAVE_CLIB=0
-
-    if [ $THREADS -ne 0 ] || [ $KPROC -ne 0 ]
-    then
-        [ $STATIC -eq 0 ] && CMD="$CMD /MD"
-    fi
-    
-    # tack on libraries, finding as we go
-    for xLIB in $LIBS
-    do
-
-        # strip off switch
-        xLIBNAME="${xLIB#-[lsd]}"
-
-        # map xLIBNAME
-        case "$xLIBNAME" in
-        
-        # redirect libdl to link against Kernel32.lib in case of windows
-        dl)
-            if [ $HAVE_KERNEL32 -ne 1 ]
-            then
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD Kernel32.lib"
-                HAVE_KERNEL32=1
-            fi
-            continue
-            ;;
-
-        # redirect libm to link against libc.lib in case of windows
-        # omitting the lib defaults to linking against libc.lib
-        m)
-            if [ $HAVE_CLIB -ne 1 ]
-            then
-                load-ref-symbols
-                load-dynamic
-                HAVE_CLIB=1
-            fi
-            continue
-            ;;
-
-##### TEMPORARY #####
-# use ksproc for kproc
-    kproc)
-        xLIBNAME=ksproc
-        ;;
-#####################
-
-        esac
-
-        # look at linkage
-        case "$xLIB" in
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $xLIBNAME.lib $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD lib$xLIBNAME.lib"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $xLIBNAME.a $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $xLIBPATH"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-                    convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to normal
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD lib$xLIBNAME.lib"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $xLIBNAME.a $LDIRS
-            if [ "$xLIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $xLIBPATH"
-
-                # load static
-                load-static
-                load-all-symbols
-                convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to static
-                load-static
-                load-all-symbols
-                CMD="$CMD lib$xLIBNAME.lib"
-            fi
-            ;;
-
-        -d*)
-
-            # only dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $xLIBNAME.lib $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load normally
-                    load-ref-symbols
-                    load-dynamic
-                    CMD="$CMD lib$xLIBNAME.lib"
-
-                fi
-            fi
-
-            # try static if performing static build
-            # because we HAVE to link against something,
-            # and the dependency code is being statically
-            # linked into an executable...
-            if [ $FOUND -eq 0 ] && [ $STATIC -eq 1 ]
-            then
-                find-lib $xLIBNAME.a $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $xLIBPATH"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-                    convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to normal
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD lib$xLIBNAME.lib"
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# put state back to normal
-load-ref-symbols
-load-dynamic
-
-# produce shared library, stub library and exp file
-echo $CMD
-$CMD
-STATUS=$?
-if [[ ${STATUS} != 0 ]]
-then
-    rm -f "$TARG" "${TARG%lib}dll"
-    exit $STATUS
-fi
-
-# copy dll to binary directory, so they can be found by the executables
-cp "${TARG%lib}dll" "$BINDIR"
-STATUS=$?
-if [[ ${STATUS} != 0 ]]
-then
-    exit $STATUS
-fi
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
diff --git a/build/ld.win.exe.sh b/build/ld.win.exe.sh
deleted file mode 100755
index e91ce43..0000000
--- a/build/ld.win.exe.sh
+++ /dev/null
@@ -1,321 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : ignore - will be dynamically loaded
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : require static
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%exe.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-link)
-    source "${0%exe.sh}vc++.sh"
-    ;;
-*)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# EXE_CMD was started in tool-specific source
-CMD="$EXE_CMD $LDFLAGS OLE32.lib Ws2_32.lib"
-
-# if building a static executable against dynamic libraries
-# the main application will substitute for name lookup
-if [ $STATIC -eq 1 ] && [ $DYLD -eq 1 ]
-then
-    CMD="$CMD $LD_EXPORT_GLOBAL $LD_MULTIPLE_DEFS"
-fi
-
-# function to convert static libraries to individual COFF files
-convert-static ()
-{
-    if [ $STATIC -eq 0 ]
-    then
-        CMD="$CMD $2.a"
-    else
-        # list members
-        local path=`cd $(dirname $1);pwd`/$(basename $1) # make sure path is absolute
-        local mbrs="$(ar -t $path)"
-
-        # create sub directory
-        rm -rf "$2" && mkdir "$2"
-        if ! cd "$2"
-        then
-            echo "$SELF_NAME: failed to cd to $2"
-            exit 5
-        fi
-        ar -x "$path"
-
-        # add source files to link
-        local m=
-        for m in $mbrs
-        do
-            CMD="$CMD $2/$m"
-        done
-
-        # return to prior location
-        cd - > /dev/null
-    fi
-}
-
-# tack on object files
-CMD="$CMD $(cygpath -w $OBJS)"
-
-# initial dependency upon Makefile - no vers file on Windows
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on paths
-    DIRS="$LDIRS:$XDIRS"
-    while [ "$DIRS" != "" ]
-    do
-        DIR="${DIRS%%:*}"
-        [ "$DIR" != "" ] && CMD="$CMD /LIBPATH:$(cygpath -w $DIR)"
-        DIRS="${DIRS#$DIR}"
-        DIRS="${DIRS#:}"
-    done
-
-    HAVE_KERNEL32=0
-    HAVE_WS2=0
-    HAVE_CLIB=0
-
-    if [ $THREADS -ne 0 ] || [ $KPROC -ne 0 ]
-    then
-        if [ $STATIC -ne 0 ]
-        then
-            CMD="$CMD /MT"
-        else
-            CMD="$CMD /MD"
-        fi
-    fi
-
-    # tack on libraries, finding as we go
-    for xLIB in $LIBS
-    do
-
-        # strip off switch
-        xLIBNAME="${xLIB#-[lsd]}"
-
-        # map xLIBNAME
-        case "$xLIBNAME" in
-        dl)
-            if [ $HAVE_KERNEL32 -ne 1 ]
-            then
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD Kernel32.lib"
-                HAVE_KERNEL32=1
-            fi
-            continue
-            ;;
-
-        ws2)
-            if [ $HAVE_WS2 -ne 1 ]
-            then
-                load-ref-symbols
-                load-dynamic
-                CMD="$CMD ws2_32.lib"
-                HAVE_WS2=1
-            fi
-            continue
-            ;;
-
-        # redirect libm to link against libc.lib in case of windows
-        # omitting the lib defaults to linking against libc.lib
-        m)
-            if [ $HAVE_CLIB -ne 1 ]
-            then
-                load-ref-symbols
-                load-dynamic
-                HAVE_CLIB=1
-            fi
-            continue
-            ;;
-
-##### TEMPORARY #####
-# use ksproc for kproc
-    kproc)
-        xLIBNAME=ksproc
-        ;;
-#####################
-
-        esac
-
-        # look at linkage
-        case "$xLIB" in
-        -l*)
-
-            # normal or dynamic linkage
-            FOUND=0
-            if [ $STATIC -eq 0 ]
-            then
-                find-lib $xLIBNAME.lib $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # load dynamic
-                    load-dynamic
-                    CMD="$CMD lib$xLIBNAME.lib"
-
-                fi
-            fi
-
-            # try static only
-            if [ $FOUND -eq 0 ]
-            then
-                find-lib $xLIBNAME.a $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $xLIBPATH"
-
-                    # load static
-                    load-static
-                    [ $STATIC -eq 1 ] && load-all-symbols
-                    convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-                fi
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                [ $STATIC -eq 1 ] && load-ref-symbols
-                load-dynamic
-
-                CMD="$CMD lib$xLIBNAME.lib"
-            fi
-            ;;
-
-        -s*)
-
-            # force static load
-            FOUND=0
-            find-lib $xLIBNAME.a $LDIRS
-            if [ "$xLIBPATH" != "" ]
-            then
-
-                # found it
-                FOUND=1
-
-                # add it to dependencies
-                DEPS="$DEPS $xLIBPATH"
-
-                # load static
-                load-static
-                [ $STATIC -eq 1 ] && load-all-symbols
-                convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-            fi
-
-            # not found within our directories
-            if [ $FOUND -eq 0 ]
-            then
-                # set load to static
-                load-static
-                [ $STATIC -eq 1 ] && load-all-symbols
-                CMD="$CMD lib$xLIBNAME.lib"
-            fi
-            ;;
-
-        -d*)
-
-            FOUND=0
-            if [ $STATIC -eq 1 ]
-            then
-                find-lib $xLIBNAME.a $LDIRS
-                if [ "$xLIBPATH" != "" ]
-                then
-
-                    # found it
-                    FOUND=1
-
-                    # add it to dependencies
-                    DEPS="$DEPS $xLIBPATH"
-
-                    # load static
-                    load-static
-                    load-all-symbols
-                    convert-static "$xLIBPATH" "lib$xLIBNAME"
-
-                fi
-
-                # not found within our directories
-                if [ $FOUND -eq 0 ]
-                then
-                    load-static
-                    load-all-symbols
-
-                    CMD="$CMD lib$xLIBNAME"
-                fi
-            fi
-            ;;
-
-
-        esac
-
-    done
-fi
-
-# return to normal
-load-ref-symbols
-load-dynamic
-
-# produce shared library
-echo $CMD
-$CMD || exit $?
-
-# produce dependencies
-if [ "$DEPFILE" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
-
-# cleanup temporary files
-rm -f $TARG.lib $TARG.exp
diff --git a/build/ld.win.slib.sh b/build/ld.win.slib.sh
deleted file mode 100755
index 17bbc25..0000000
--- a/build/ld.win.slib.sh
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal or static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%slib.sh}cmn.sh"
-
-# initialize command
-if [ $STATIC -eq 0 ]
-then
-    CMD="lib /NOLOGO"
-else
-    CMD="ar -rc"
-fi
-
-# function to convert an archive into individual object files
-convert-static ()
-{
-    # list members
-    local path="$1"
-    local mbrs="$(ar -t $path)"
-
-    # unpack archive into temporary directory
-    mkdir -p ld-tmp
-    if ! cd ld-tmp
-    then
-        echo "$SELF_NAME: failed to cd to ld-tmp"
-        exit 5
-    fi
-    ar -x "$path"
-
-    # rename and add to source files list
-    local m=
-    for m in $mbrs
-    do
-        mv $m $NAME-$m
-        CMD="$CMD ld-tmp/$NAME-$m"
-    done
-
-    # return to prior location
-    cd - > /dev/null
-}
-
-if [ $STATIC -eq 0 ]
-then 
-    # no versioned output here, sorry
-    CMD="$CMD /OUT:$(cygpath -w $TARG)"
-
-    # tack on object files
-    CMD="$CMD $(cygpath -w $OBJS)"
-else
-    CMD="$CMD $TARG $OBJS"
-fi
-
-
-# initial dependency upon Makefile and vers file
-DEPS="$SRCDIR/Makefile"
-if [ "$LIBS" != "" ]
-then
-    # tack on libraries, finding as we go
-    for xLIB in $LIBS
-    do
-
-        # strip off switch
-        xLIBNAME="${xLIB#-[lsd]}"
-
-        # look at linkage
-        case "$xLIB" in
-        -s*)
-
-            # force static load
-            find-lib $xLIBNAME.a $LDIRS
-            if [ "$xLIBPATH" != "" ]
-            then
-
-                # add it to dependencies
-                DEPS="$DEPS $xLIBPATH"
-
-                # convert to individual object files
-                convert-static "$xLIBPATH" || exit $?
-
-            fi
-            ;;
-
-        esac
-
-    done
-fi
-
-# produce static library
-echo $CMD
-$CMD || exit $?
-
-# remove temporaries
-rm -rf ld-tmp
-
-# produce dependencies
-if [ "$DEPFILE" != "" ] && [ "$DEPS" != "" ]
-then
-    echo "$TARG: $DEPS" > "$DEPFILE"
-fi
diff --git a/build/ld.win.stub.sh b/build/ld.win.stub.sh
deleted file mode 100755
index 92e06af..0000000
--- a/build/ld.win.stub.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# ===========================================================================
-# input library types, and their handling
-#
-#  normal linkage
-#   -l : find shared or static
-#   -s : require static
-#   -d : require shared
-#
-#  static linkage
-#   -l : require static
-#   -s : require static
-#   -d : ignore
-# ===========================================================================
-
-
-# script name
-SELF_NAME="$(basename $0)"
-
-# parameters and common functions
-source "${0%stub.sh}cmn.sh"
-
-# discover tool chain
-case "$LD" in
-link)
-    source "${0%stub.sh}vc++.sh"
-    ;;
- *)
-    echo "$SELF_NAME: unrecognized ld tool - '$LD'"
-    exit 5
-esac
-
-# produce stub library and exp file
-echo $STUB_CMD
-$STUB_CMD
diff --git a/build/ld.win.vc++.sh b/build/ld.win.vc++.sh
deleted file mode 100755
index 09dd42d..0000000
--- a/build/ld.win.vc++.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# define linker params
-LD_EXPORT_GLOBAL=""
-LD_MULTIPLE_DEFS="/FORCE:MULTIPLE"
-LD_STATIC=""
-LD_DYNAMIC=""
-LD_ALL_SYMBOLS="/OPT:NOREF"
-LD_REF_SYMBOLS="/OPT:REF"
-
-# rewrite PATH variable
-unset CYGP
-while [ "$PATH" = "${PATH#/cygdrive}" ]
-do
-    DIR="${PATH%%:*}"
-    PATH="${PATH#$DIR}"
-    PATH="${PATH#:}"
-    CYGP="$CYGP:$DIR"
-done
-PATH="$PATH$CYGP"
-export PATH
-
-# the def file
-unset DEF_SWITCH
-DEF_FILE="$SRCDIR/$NAME-$BUILD.def"
-[ ! -f "$DEF_FILE" ] && DEF_FILE="$SRCDIR/$NAME.def"
-[ -f "$DEF_FILE" ] && DEF_SWITCH="/DEF:$(cygpath -w $DEF_FILE)" || unset DEF_FILE
-
-# the full path to target sans extension
-WINTARG="$(cygpath -w ${TARG%.lib})"
-
-# build command
-STUB_CMD="lib /NOLOGO /MACHINE:x86 $DEF_SWITCH /OUT:$WINTARG.lib"
-DLIB_CMD="$LD /NOLOGO /DLL $DEF_SWITCH /OUT:$WINTARG.dll /STACK:8000000 /HEAP:1000000000"
-EXE_CMD="$LD /NOLOGO /OUT:$WINTARG.exe /SUBSYSTEM:CONSOLE /ENTRY:wmainCRTStartup /STACK:8000000 /HEAP:100000000"
-
-# tack on PDB tracking
-if [ "$BUILD" = "dbg" ]
-then
-    DLIB_CMD="$DLIB_CMD /DEBUG /PDB:$WINTARG.pdb"
-    EXE_CMD="$EXE_CMD /DEBUG /PDB:$WINTARG.pdb"
-fi
diff --git a/build/mac.arch.sh b/build/mac.arch.sh
deleted file mode 100755
index 60ee5d4..0000000
--- a/build/mac.arch.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# PPC or Intel?
-ARCH="$(uname -m)"
-if [ "$ARCH" = "x86_64" ]
-then
-    echo $ARCH
-    exit 0
-fi
-
-# the Mac likes to keep its architecture hidden because for all practical
-# purposes, it is both 32 and 64 bit, and makes use of emulation as needed.
-
-# does the hardware support 64-bit mode, even in emulation?
-SYSCTL=/usr/sbin/sysctl
-[ -x /sbin/sysctl ] && SYSCTL=/sbin/sysctl
-CAP64=$($SYSCTL -n hw.cpu64bit_capable)
-
-# real 64-bit hardware has > 32 bits of address space
-PADDR_BITS=$(/usr/sbin/sysctl -n machdep.cpu.address_bits.physical)
-VADDR_BITS=$(/usr/sbin/sysctl -n machdep.cpu.address_bits.virtual)
-
-# to be 64-bit, it's probably sufficient to test the address space
-# but we have the emulation information as well.
-if [ $CAP64 -ne 0 ]
-then
-    if [ $PADDR_BITS -gt 32 ] && [ $VADDR_BITS -gt 32 ]
-    then
-        # call it 64-bit
-        if [ "$ARCH" = "i386" ] || [ "$ARCH" = "x86_64" ]
-        then
-            echo "x86_64"
-            exit 0
-        fi
-
-        if [ "$ARCH" = "Power Macintosh" ]
-        then
-            echo "ppc64"
-            exit 0
-        fi
-
-        # unrecognized
-        echo "unrecognized"
-        exit 5
-    fi
-fi
-
-# call it 32-bit
-if [ "$ARCH" = "i386" ]
-then
-    echo "i386"
-    exit 0
-fi
-
-if [ "$ARCH" = "Power Macintosh" ]
-then
-    echo "ppc32"
-    exit 0
-fi
-
-# unrecognized
-echo "unrecognized"
-exit 5
-
diff --git a/build/make-vers-inc.sh b/build/make-vers-inc.sh
deleted file mode 100755
index daff98c..0000000
--- a/build/make-vers-inc.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-# capture input
-if [ $# -eq 1 ]
-then
-    VERSION=$1
-    DEFINE=$(basename $VERSION)
-    DEFINE=$(echo $DEFINE | tr '[a-z].-' '[A-Z]__')
-elif [ $# -ne 2 ]
-then
-    echo "#error in makefile"
-    exit 1
-else
-    DEFINE=$1
-    VERSION=$2
-fi
-
-# split the version into separate integers
-SPLIT_VERS="$(cat $VERSION | tr '.' ' ')"
-
-# issue a single line define
-echo "#define $DEFINE $(printf 0x%02X%02X%04X $SPLIT_VERS)"
diff --git a/build/sra-dflt-schema.sh b/build/sra-dflt-schema.sh
deleted file mode 100755
index 78c89ad..0000000
--- a/build/sra-dflt-schema.sh
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# prepare script name
-SELF_NAME="$(basename $0)"
-SCRIPT_BASE="${0%.sh}"
-
-# os
-OS="$1"
-shift
-
-# binary compiler
-CC="$1"
-shift 
-
-# everything except windows is fine as-is
-if [[ "$OS" != "win" && "$OS" != "rwin" ]]
-then 
-    echo "$CC $*"
-    $CC $*
-    exit $?
-fi
-
-if [[ "$OS" == "rwin" ]]
-then # for rwin, $CC is a multi-word string; extract server location data from it:
-#                $(TOP)/build/run_remotely.sh $(PROXY_TOOL) $(RHOST) $(RPORT) $(RHOME) $(LHOME) $(TOP) $(ROUTDIR) $(LOUTDIR) $(SCHEMA_EXE)
-    PARMS=($CC)
-    RHOME=${PARMS[4]}
-    LHOME=${PARMS[5]}
-    ROUTDIR=${PARMS[7]}
-    LOUTDIR=${PARMS[8]}
-fi
-
-# state
-unset ARGS
-unset DEPENDENCIES
-unset DEPTARG
-unset TARG
-
-function convert_src_path
-{
-    if [[ "$OS" != "rwin" ]]
-    then
-        convert_path_result="$(cygpath -w $1)"
-    elif [ "$1" != "${1#$LHOME}" ] 
-    then
-        convert_path_result="$RHOME${1#$LHOME}"
-        convert_path_result="$(echo $convert_path_result | tr '/' '\\')"
-    else
-        convert_path_result="$1"
-    fi
-}
-function convert_out_path
-{
-    if [[ "$OS" != "rwin" ]]
-    then
-        convert_path_result="$(cygpath -w $1)"
-    elif [ "$1" != "${1#$LOUTDIR}" ] 
-    then
-        convert_path_result="$ROUTDIR${1#$LOUTDIR}"
-        convert_path_result="$(echo $convert_path_result | tr '/' '\\')"
-    else
-        convert_path_result="$1"
-    fi
-}
-
-
-# process parameters for windows
-while [ $# -ne 0 ]
-do
-
-    case "$1" in
-    -o*)
-        ARG="${1#-o}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        TARG="$ARG"
-        convert_out_path $ARG
-        ARGS="$ARGS -o${convert_path_result}"
-        ;;
-
-    -I*)
-        ARG="${1#-I}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        
-        convert_src_path $ARG
-        ARGS="$ARGS -I${convert_path_result}"
-        ;;
-
-    -T*)
-        ARG="${1#-T}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        DEPTARG="$ARG"
-        DEPENDENCIES=1
-        convert_out_path $ARG
-        ARGS="$ARGS -T${convert_path_result}"
-        ;;
-
-    -L*)
-        LHOME="${1#-L}"
-        ;;
-    -R*)
-        RHOME="${1#-R}"
-        ;;
-    
-    *)
-        convert_src_path $1
-        ARGS="$ARGS ${convert_path_result}"
-        ;;
-
-    esac
-
-    shift
-
-done
-
-echo "$CC $ARGS"
-$CC $ARGS
-STATUS=$?
-if [[ ${STATUS} != 0 ]]
-then
-    rm -f $TARG $DEPTARG
-    exit ${STATUS}
-fi
-
-if [ $DEPENDENCIES -eq 1 ]
-then
-    # fix this
-    rm -f $DEPTARG
-fi
diff --git a/build/win-cc.sh b/build/win-cc.sh
deleted file mode 100755
index 42f2d74..0000000
--- a/build/win-cc.sh
+++ /dev/null
@@ -1,269 +0,0 @@
-#!/bin/bash
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-VERBOSE=
-if [ "$VERBOSE" != "" ] ; then echo "$0 $*"; fi
-# prepare script name
-SELF_NAME="$(basename $0)"
-SCRIPT_BASE="${0%.sh}"
-
-# os
-OS="$1"
-shift
-
-# binary compiler
-CC="$1"
-shift
-
-# configuration
-unset TARG
-unset ARGS
-unset OBJX
-unset SRCFILE
-unset SOURCES
-unset DEPENDENCIES
-# paths for translating local to remote
-unset RHOME
-unset LHOME
-unset ROUTDIR
-unset RHOST
-unset RPORT
-unset PROXY_TOOL
-
-function convert_path
-{
-    if [ "$OS" != "rwin" ] ; then
-        convert_path_result="$(cygpath -w $1)"
-    elif [ "$1" != "." ] ; then
-        if [ "${1#$LHOME}" != "$1" ] ; then
-            convert_path_result="$RHOME${1#$LHOME}"
-        else
-            convert_path_result="$1"
-        fi
-        convert_path_result="${convert_path_result//\//\\}"
-    else
-        convert_path_result="."
-    fi
-}
-
-while [ $# -ne 0 ]
-do
-
-    case "$1" in
-    --cflags)
-        for ARG in $2
-        do
-            [ "$ARG" != "${ARG#-}" ] && ARG="/${ARG#-}"
-            ARGS="$ARGS $ARG"
-        done
-        shift
-        ;;
-
-    --checksum)
-        ;;
-
-    --objx)
-        OBJX="$2"
-        shift
-        ;;
-
-    --rhome)
-        RHOME="$2"
-        shift
-        ;;
-
-    --lhome)
-        LHOME="$2"
-        shift
-        ;;
-
-    --loutdir)
-        LOUTDIR="$2"
-        shift
-        ;;
-
-    --routdir)
-        ROUTDIR="$2"
-        shift
-        ;;
-
-    --rhost)
-        RHOST="$2"
-        shift
-        ;;
-
-    --rport)
-        RPORT="$2"
-        shift
-        ;;
-
-    --proxy_tool)
-        PROXY_TOOL="$2"
-        shift
-        ;;
-
-    -D*)
-        ARG="${1#-D}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        ARGS="$ARGS /D$ARG"
-        ;;
-
-    -I*)
-        ARG="${1#-I}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        convert_path $ARG
-        ARGS="$ARGS /I$convert_path_result"
-        ;;
-
-    -o*)
-        ARG="${1#-o}"
-        if [ "$ARG" = "" ]
-        then
-            ARG="$2"
-            shift
-        fi
-        ARGS="$ARGS /Fo$ARG"
-        TARG="${ARG%.$OBJX}"
-        ;;
-
-    -MD)
-        # the /showIncludes switch will generate
-        # includes to stderr, but they will need
-        # to be filtered out and rewritten to the *.d
-        ARGS="$ARGS /showIncludes"
-        DEPENDENCIES=1
-        ;;
-
-    -fPIC|-std=c99|-ansi|-pedantic)
-        ;;
-
-    -*)
-        ARG="/${1#-}"
-        ARGS="$ARGS $ARG"
-        ;;
-
-    *)
-        SRCFILE="$(basename $1)"
-        SOURCES="$SOURCES $1"
-        convert_path $1
-        ARGS="$ARGS $convert_path_result"
-        SRCDIR="$(dirname $1)" # assume the last source file is in the same dir as all the .vers files we need as dependencies
-        ;;
-        
-    esac
-
-    shift
-done
-
-unset STATUS
-
-CMD="$CC $ARGS"
-if [ "$VERBOSE" != "" ] ; then echo "CMD=$CMD"; fi
-
-# run command with redirection
-if [ "$OS" = "win" ]
-then
-    $CMD > $TARG.out 2> $TARG.err
-    STATUS=$?
-else
-    # determine current directory
-    CURDIR="$(pwd)"
-    ${TOP}/build/run_remotely.sh $PROXY_TOOL $RHOST $RPORT $RHOME $LHOME $CURDIR $ROUTDIR $LOUTDIR $CMD > $TARG.out 2> $TARG.err
-    STATUS=$?
-fi
-
-# check for dependencies
-if [ "$DEPENDENCIES" = "1" ]
-then
-    sed -e '/including file/!d' -e 's/.*including file: *\([^\r\n][^\r\n]*\)/\1/g' -e '/ /d' $TARG.out > $TARG.inc
-    echo -n "$TARG.$OBJX: $SOURCES" | sed -e 's/\r//g' > $TARG.d
-    if [ "$OS" = "win" ]
-    then 
-        for inc in $(cat $TARG.inc)
-        do
-            # vers.h files are now generated in the objdir
-            if [ "$inc" != "${inc%.vers.h}" ]
-            then
-                inc="${inc%.h}"
-            fi
-            echo -n " $(cygpath -u $inc)"  | sed -e 's/\r//g' >> $TARG.d
-        done
-    else # rwin
-        # sometimes home path comes back in lowercase
-        # make sure to compare lowercased prefixes
-        rhome_low=$(echo ${RHOME} | tr '[A-Z]' '[a-z]' | tr '\\' '/')
-        rhome_len=${#RHOME}
-        routdir_low=$(echo ${ROUTDIR} | tr '[A-Z]' '[a-z]' | tr '\\' '/')
-        routdir_len=${#ROUTDIR}
-
-        for inc in $(cat $TARG.inc)
-        do
-            inc_low=$(echo ${inc} | tr '[A-Z]' '[a-z]' | tr '\\' '/')
-            # vers.h files are now generated in the objdir
-            if [ "$inc" != "${inc%.vers.h}" ]
-            then
-                # convert the "...vers.h" in the object directory into "...vers" in the source directory
-                inc="${inc%.h}"
-                if [ "${inc_low#$rhome_low}" != "$inc_low" ]
-                then
-                    inc="${inc:$rhome_len}"
-                elif [ "${inc_low#$routdir_low}" != "$inc_low" ]
-                then
-                    inc="$SRCDIR/$inc"
-                fi
-                inc="${inc//\\//}"
-                inc="$(basename $inc)"
-                inc="$SRCDIR/$inc"
-            else
-                if [ "${inc_low#$rhome_low}" != "$inc_low" ]
-                then
-                    inc="$LHOME${inc:$rhome_len}"
-                elif [ "${inc_low#$routdir_low}" != "$inc_low" ]
-                then
-                    inc="$OUTDIR${inc:$routdir_len}"
-                fi
-            fi
-            echo -n " $inc" | tr '\\' '/' >> $TARG.d
-        done
-    fi
-    echo >> $TARG.d
-fi
-
-echo "$CMD"
-# repeat output files but without CR
-sed -e 's/\r//g' $TARG.err > /dev/stderr
-sed -e 's/\r//g' -e "/^$SRCFILE$/d" -e '/including file/d' $TARG.out
-
-# clean up files
-rm -f $TARG.out $TARG.err $TARG.inc
-
-exit $STATUS
diff --git a/configuration-assistant.perl b/configuration-assistant.perl
deleted file mode 100755
index 1ddd55b..0000000
--- a/configuration-assistant.perl
+++ /dev/null
@@ -1,1211 +0,0 @@
-#!/usr/bin/perl -w
-
-################################################################################
-# N.B. Run "perl configuration-assistant.perl" if you see a message like:
-# configuration-assistant.perl: /usr/bin/perl: bad interpreter: No such file or directory
-################################################################################
-my $VERSION = '2.3.3';
-################################################################################
-
-use strict;
-
-use Cwd "getcwd";
-use Fcntl ':mode';
-use File::Basename qw(basename dirname);
-use File::Path "mkpath";
-use File::Spec;
-use Getopt::Long "GetOptions";
-use IO::Handle;
-use Getopt::Long "GetOptions";
-
-sub println { print @_; print "\n"; }
-
-STDOUT->autoflush(1);
-
-my $R = 1;
-my $W = 2;
-my $X = 4;
-my $CREATED = 8;
-my $FOUND = 16;
-my $RWX = $FOUND + $R + $W + $X;
-
-println "==========================================";
-println "Welcome to the SRA Toolkit Configuration Script.";
-println "SRA toolkit documentation:";
-println "http://www.ncbi.nlm.nih.gov/Traces/sra/std";
-println "==========================================\n";
-
-my %options;
-Help(1) unless (GetOptions(\%options, 'fix', 'help', 'version', 'wordy'));
-Help(0) if ($options{help});
-Version() if ($options{version});
-
-$options{references} = 1 if ($#ARGV >= 0);
-
-println "cwd = '" . getcwd() . "'\n";
-
-my $DECRYPTION_PKG;
-{
-    my ($fastq_dump, $fastq_dir) = FindBin("fastq-dump", "optional");
-    my ($sam_dump, $sam_dir) = FindBin("sam-dump", "optional");
-    if (! $fastq_dump && ! $sam_dump) {
-        println "presuming to be run in decryption package";
-        $DECRYPTION_PKG = 1;
-    }
-}
-
-my ($VDB_CONFIG, $BIN_DIR) = FindBin("vdb-config");
-
-my %kfg;
-Kfg(\%kfg, 'read', 'Reading configuration');
-umask 0002;
-my $fixed = FixKfg(\%kfg);
-if ($fixed) {
-    undef %kfg;
-    Kfg(\%kfg, 'read', 'Checking configuration');
-}
-#DoKryptoCfg(\%kfg);
-
-################################################################################
-# FUNCTIONS #
-################################################################################
-
-sub Ask {
-    my ($prompt) = @_;
-
-    print "$prompt: ";
-
-    my $in = <STDIN>;
-    unless ($in) {
-        println;
-        return "";
-    }
-
-    chomp $in;
-    return $in;
-}
-
-sub AskYn { return AskYN($_[0], 'yes');}
-sub AskyN { return AskYN($_[0], 'no' );}
-
-sub AskYN {
-    my ($q, $yes) = @_;
-
-    $yes = '' if ($yes eq 'no');
-
-    print "$q ";
-
-    if ($yes) {
-        print "[Y/n] ";
-    } else {
-        print "[y/N] ";
-    }
-
-    my $in = <STDIN>;
-    chomp $in;
-    if ($in) {
-        return $in eq 'Y' || $in eq 'y'
-          || $in eq 'YES' || $in eq 'yes' || $in eq 'Yes';
-    } else {
-        return $yes;
-    }
-}
-
-sub AskRefseqChange {
-    my ($refseq) = @_;
-
-    die unless ($refseq);
-
-    my $force;
-
-    while (1) {
-        my $read = -r $refseq && -x $refseq;
-        println "Your repository directory is $refseq.";
-        my $dflt;
-        if ($read) {
-            println "It is read-only. You cannot add new sequences to it.";
-            $dflt = "1";
-        } else {
-            println "You cannot read it.";
-            $dflt = "2";
-        }
-        println "Make your choice:";
-        println "1) Use existing repository";
-        println "2) Use a different repository";
-        println "3) exit the script";
-        print "Your selection? [$dflt] ";
-
-        my $in = <STDIN>;
-        chomp $in;
-        $in = $dflt unless ($in);
-
-        if ($in eq "1") {
-            unless ($read) {
-                Fatal(
-"Ask the owner of $refseq to allow you access $refseq directory\n" .
-"Otherwise the dumpers will not be able to find reference files"
-                );
-            }
-            return ($refseq, 'READ^ONLY');
-        }
-
-        if ($in eq "2") {
-            last;
-        }
-
-        exit 0 if ($in eq "3");
-    }
-
-    my ($path, $perm) = MakeRefseqDir();
-
-    return ($path, '');
-}
-
-sub Home {
-    if ($ENV{HOME}) {
-        return $ENV{HOME};
-    } elsif ($ENV{USERPROFILE}) {
-        return $ENV{USERPROFILE};
-    } else {
-        return '';
-    }
-}
-
-sub MakeRefseqDir {
-    my $deflt;
-    if ($^O eq 'cygwin' and $ENV{USERPROFILE}) {
-        $deflt = $ENV{USERPROFILE};
-        $deflt =~ tr|\\|/|;
-        $deflt =~ s|^([a-zA-Z]):/|/$1/|;
-        if ($1) {
-            $deflt = "/cygdrive$deflt";
-        }
-    } else {
-        $deflt = Home();
-    }
-    unless ($deflt) {
-        $deflt = getcwd();
-    }
-    $deflt = "." unless($deflt);
-    $deflt = File::Spec->catdir($deflt, "ncbi", "refseq");
-
-    while (1) {
-        my $path;
-        print "Specify installation directory for reference objects";
-        if ($deflt) {
-            print " [$deflt]";
-        }
-        print ": ";
-
-        my $in = <STDIN>;
-        unless ($in) {
-            println;
-            $path = "";
-        }
-        chomp $in;
-        if ($in) {
-            $path = $in;
-        } elsif ($deflt) {
-            $path = $deflt;
-        }
-        exit 1 unless ($path);
-        my ($prm_org, $perm) = CheckDir($path, "create_missing");
-        my $prm = $prm_org;
-        my $created = $prm & $CREATED;
-        $prm &= $RWX;
-        if ($prm == $RWX || ($^O eq 'cygwin' and $created == $CREATED)) {
-            return ($path, $prm_org);
-        } elsif ($prm & $FOUND) {
-            println "'$path' does not seem to be writable.";
-            println "You will not be able to add new sequences to it.";
-            if (AskyN("Do you want to use it?")) {
-                return ($path, $prm_org);
-            }
-        }
-    }
-}
-
-sub Posixify {
-    ($_) = @_;
-
-    # convert to POSIX path
-    s|^/cygdrive/|/|;
-    tr|\\|/|;
-    s|^([a-zA-Z]):/|/$1/|;
-
-    return $_;
-}
-
-sub Version {
-      my $bin = basename($0);
-      print << "END";
-$bin version $VERSION
-END
-
-      exit 0;
-}
-
-sub Help {
-    my ($exit) = @_;
-    $exit = 0 unless ($exit);
-      my $bin = basename($0);
-      print << "END";
-$bin version $VERSION
-
-Utility to help configure the SRA tools to be able
-to access the local reference repository,
-determine which reference sequences a SRA file relies
-upon and to fetch them from NCBI.
-Fetched references are placed in the local reference repository.
-
-Usage: $bin [--fix] [--wordy] [SRA_FILE ...]
-
-Options
--f, --fix         re-download existing reference files;
-                  fix refseq repository permissions
--v, --version     print version and exit
--w, --wordy       increase "fetcher" verbosity
-END
-
-      exit $exit;
-}
-
-sub FixRefseqCfg {
-    my ($refseq_cfg, $question, $bye) = @_;
-
-    unless (AskYn($question)) {
-        print $bye;
-        exit 1;
-    }
-
-    ($refseq_cfg->{refseq_dir}, $refseq_cfg->{refseq_dir_prm})
-        = MakeRefseqDir();
-    UpdateRefseqCfgNode($refseq_cfg->{refseq_dir});
-}
-
-sub UpdateRefseqCfgNode {
-    ($_) = @_;
-    $_ = Posixify($_);
-    UpdateConfigNode('refseq/paths' , $_);
-}
-
-sub UpdateKryptoCfgNode {
-    ($_) = @_;
-    $_ = Posixify($_);
-    UpdateConfigNode('krypto/pwfile', $_);
-}
-    
-sub UpdateConfigNode {
-    my ($name, $val) = @_;
-
-    print "'$name' => '$val': ";
-    my $cmd = "$VDB_CONFIG -s \"$name=$val\"";
-#   println "\n$cmd";
-    `$cmd`;
-    if ($?) {
-        println "error: $!";
-    } else {
-        println "updated";
-    }
-}
-
-sub DoSchemaCfg {
-    my $error;
-
-    print "checking schema configuration... ";
-
-    my $tmp = `$VDB_CONFIG vdb/schema/paths 2>&1`;
-    if ($? == 0) {
-        chomp $tmp;
-
-        if ($tmp =~ m|<paths>(.+)</paths>|) {
-            my $paths = $1;
-            println $paths;
-            my @paths = split(/:/, $paths);
-
-            $error += !CheckSchemaFile('align/align.vschema', @paths);
-            $error += !CheckSchemaFile('ncbi/seq.vschema'   , @paths);
-            $error += !CheckSchemaFile('vdb/vdb.vschema'    , @paths);
-        } else {
-            $error = "unexpected: $tmp";
-            println $error;
-        }
-    } elsif ($tmp =~ /path not found/) {
-        $error = "not found";
-        println $error;
-    } else {
-        $error = "unknown vdb-config schema error";
-        println $error;
-    }
-
-    if ($error) {
-        println "--------------------------------------";
-        println "WARNING: SCHEMA FILES CANNOT BE FOUND.";
-        println "IT COULD CAUSE LOADERS TO FAIL.";
-        println "--------------------------------------";
-    }
-
-    return ! $error;
-}
-
-sub CheckSchemaFile {
-    my ($file, @dir) = @_;
-
-    my $cygdrive = '/cygdrive';
-    my $hasCygdrive = -e '/cygdrive';
-
-    print "checking $file... ";
-
-    foreach my $dir(@dir) {
-        my $path = "$dir/$file";
-        if (-e $path) {
-            println $path;
-            return 1;
-        }
-    }
-
-    println "not found";
-
-    return 0;
-}
-
-sub CleanEmptyFiles {
-    my ($refseq_dir) = @_;
-
-    print "checking $refseq_dir for invalid empty reference files... ";
-
-    my $i = 0;
-    opendir DIR, $refseq_dir or die "cannot opendir $refseq_dir";
-    while ($_ = readdir DIR) {
-        next if (/^\.{1,2}$/);
-
-        my $f = "$refseq_dir/$_";
-
-        my $empty;
-        if (-z $f) {
-            ++$empty;
-        } elsif (-d $f) {
-            # skip a directory
-        } elsif (-s $f < 999) {
-            open F, $f or die "cannot open $f";
-            my $data = '';
-            while (<F>) {
-                while(chomp) {};
-                $data .= $_;
-            }
-            ++$empty if ($data =~ m|<title>404 - Not Found</title>|);
-        }
-        if ($empty) {
-            unlink $f or die "cannot remove $f";
-            ++$i;
-        }
-    }
-    closedir DIR;
-
-    if ($i)
-    {   println "$i found"; }
-    else
-    {   println "none found"; }
-}
-
-sub FixRefseqDirPermissions {
-    my ($dir, $read_only) = @_;
-    print "checking refseq repository...";
-    my $mode = (stat($dir))[2] & 07777;
-
-    if ($read_only) {
-        println " read-only";
-        print "\tchecking directory permissions...";
-        unless (-r $dir && -x $dir) {
-            Fatal("\n$dir cannot be accessed. "
-                . "Either update its permissions\n"
-                . "or choose another directory for refseq repository.");
-        }
-        println " OK";
-        print "\tchecking file permissions...";
-        opendir REP, $dir or die "cannot opendir $dir";
-        my $ok = 1;
-        while (my $f = readdir REP) {
-            next if ($f =~ /^\.{1,2}$/);
-            unless (-r "$dir/$f") {
-                Warn("\n$dir/$f is not readable. "
-                    . "Either update its permissions\n"
-                    . "or choose another directory for refseq repository.");
-                $ok = 0;
-            }
-        }
-        closedir REP;
-        println " OK" if $ok;
-        println "\tchecking parent directories...";
-        my @dirs = File::Spec->splitdir($dir);
-        my $p = File::Spec->rootdir;
-        while (@dirs) {
-            $_ = shift @dirs;
-            $p = File::Spec->catdir($p, $_);
-            print "\t\t$p";
-            $ok = 1;
-            unless (-r $p && -x $p) {
-                Warn("\n$p cannot be accessed. "
-                    . "Either update its permissions\n"
-                    . "or choose another directory for refseq repository.");
-                $ok = 0;
-            }
-            println " OK" if $ok;
-        }
-    } else {
-        println " writable";
-        print "\tchecking directory permissions...";
-        my $ok = 1;
-        if (($mode & 0755) != 0755) {
-            $mode |= 0755;
-            if (chmod($mode, $dir) != 1) {
-                Warn("\n$dir is not acessible by some of the users\n"
-                    . "Dumping of some files could fail if run by anoother user"
-                  );
-                $ok = 0;
-            } else { println " fixed" }
-        } else { println " OK" }
-        $ok = "OK";
-        print "\tchecking file permissions...";
-        opendir REP, $dir or die "cannot opendir $dir";
-        while (my $next = readdir REP) {
-            next if ($next =~ /^\.{1,2}$/);
-            my $f = "$dir/$next";
-            my $mode = (stat($f))[2] & 07777;
-            if (($mode & 0644) != 0644) {
-                if ($ok) {
-                    $mode |= 0644;
-                    if (chmod($mode, $f) != 1) {
-                        Warn("\n$f cannot be acessed by some of the users\n"
-                                . "Dumping of some files could fail "
-                                . "if run by anoother user");
-                        $ok = "";
-                    } else { $ok = "fixed" }
-                }
-            }
-        }
-        closedir REP;
-        println " $ok" if ($ok);
-        $ok = 1;
-        println "\tchecking parent directories...";
-        my @dirs = File::Spec->splitdir($dir);
-        my $p = File::Spec->rootdir;
-        while (@dirs) {
-            $_ = shift @dirs;
-            $p = File::Spec->catdir($p, $_);
-            print "\t\t$p";
-            my $mode = (stat($p))[2] & 07777;
-            if (($mode & 0550) != 0550) {
-                if ($ok) {
-                    $mode |= 0550;
-                    if (chmod($mode, $p) != 1) {
-                        Warn("\n$p cannot be acessed by some of the users\n"
-                                . "Dumping of some files could fail "
-                                . "if run by anoother user");
-                        $ok = 0;
-                    } else { println " fixed" }
-                }
-            } else { println " OK" }
-        }
-    }
-}
-
-################################################################################
-
-sub CheckDir {
-    my ($dir, $create_missing) = @_;
-
-    $dir = File::Spec->canonpath($dir);
-    print "checking $dir... ";
-
-    my $prm = 0;
-    unless (-e $dir) {
-        println "not found";
-        return (0, 0) unless ($create_missing);
-
-        print "checking ${dir}'s parents... ";
-        $dir = File::Spec->canonpath($dir);
-        my @dirs = File::Spec->splitdir($dir);
-        my $test = File::Spec->rootdir();
-        if ($^O eq 'MSWin32') {
-            $test = "";
-        } else {
-            Fatal("bad root directory '$test'") unless (-e $test);
-        }
-        foreach (@dirs) {
-            my $prev = $test;
-            if ($test) {
-                $test = File::Spec->catdir($test, $_);
-            } else {
-                $test = File::Spec->catdir($_, File::Spec->rootdir());
-            }
-            if (! -e $test) {
-                $test = $prev;
-                last;
-            }
-        }
-
-        print "($test)... ";
-        my $cygwin_beauty;
-# cygwin does not detect -r for $ENV{USERPROFILE}
-        if (! -r $test || ! -x $test) {
-            if ($^O eq 'cygwin') {
-                ++$cygwin_beauty;
-            } else {
-                println "not readable";
-                return (0, 0);
-            }
-        }
-        if (! -x $test) {
-            if ($^O eq 'cygwin') {
-                ++$cygwin_beauty;
-            } else {
-                println "not writable";
-                return (0, 0);
-            }
-        }
-        if ($cygwin_beauty) {
-            println("fail to check");
-        } else {
-            println("ok");
-        }
-
-        print "creating $dir... ";
-        unless (mkpath($dir)) {
-            die "cannot mkdir $dir" unless ($cygwin_beauty);
-            println "failed. Is it writable?";
-            return (0, 0);
-        }
-        println("ok");
-        $prm += $CREATED;
-        print "checking $dir... ";
-    }
-
-    my $perm = (stat($dir))[2];
-    $prm += $FOUND;
-
-    {
-        my $cygwin_beauty;
-        my $failures;
-        if (-r $dir) {
-            $prm += $R;
-        }
-        if (-w $dir) {
-            $prm += $W;
-        }
-        if (-x $dir) {
-            $prm += $X;
-        }
-
-        if (! -r $dir || ! -x $dir) {
-            if ($^O eq 'cygwin') {
-                ++$cygwin_beauty;
-            } else {
-                println "not readable";
-                ++$failures;
-            }
-        }
-        if (! $failures and ! -w $dir) {
-            if ($^O eq 'cygwin') {
-                ++$cygwin_beauty;
-            } else {
-                println "not writable";
-                ++$failures;
-            }
-        }
-        if ($cygwin_beauty) {
-            println("fail to check");
-        } elsif (!$failures) {
-            println("ok");
-        }
-    }
-
-    return ($prm, $perm);
-}
-
-sub CheckCfg {
-    print "checking refseq configuration... ";
-
-    my %konfig;
-    RefseqFromConfig(\%konfig);
-
-    if ($konfig{refseqrepository} || $konfig{servers} || $konfig{volumes})
-    {
-        if ($konfig{refseqrepository}) {
-            println "refseq/repository found:";
-        } elsif ($konfig{servers}) {
-            println "refseq/servers found:";
-        } elsif ($konfig{volumes}) {
-            println "refseq/volumes found:";
-        }
-        println "Seems to be running in NCBI environment:";
-        println "      refseq configuration fix/update is disabled;";
-        println "      reference files download is disabled.";
-        ++$options{NCBI};
-        return;
-    }
-
-    if ($konfig{paths}) {
-        println "paths=$konfig{paths}";
-    } else {
-        println "not found";
-        return %konfig;
-    }
-
-    if ($konfig{paths} and index($konfig{paths}, ":") != -1) {
-        die "Unexpected configuration: paths=$konfig{paths}";
-    }
-
-    my $dir = "$konfig{paths}";
-
-    if ($^O eq 'MSWin32') { # Windows: translate POSIX to Windows path
-        $dir =~ tr|/|\\|;
-        $dir =~ s/^\\([a-zA-Z])\\/$1:\\/;
-    } elsif ($^O eq 'cygwin' and $dir =~ m|^/[a-zA-Z]/|) {
-        $dir = "/cygdrive$dir";
-    }
-
-    $konfig{refseq_dir} = $dir;
-    my ($prm, $perm) = CheckDir($dir);
-    $konfig{refseq_dir_prm} = $prm;
-    if ($prm == 0) { # not found
-        return %konfig;
-    } elsif ($prm != $RWX) {
-        if ($^O ne 'cygwin') {
-            ++$konfig{FIX_paths};
-#           Fatal("refseq repository is invalid or read-only");
-        } # else cygwin does not always can tell permissions correctly
-    }
-    return %konfig;
-}
-
-sub FindWget {
-    my $WGET;
-
-    print "checking for wget... ";
-    my $out = `wget -h 2>&1`;
-    if ($? == 0) {
-        println "yes";
-        if ($options{fix}) {
-            $WGET = "wget -O";
-        } else {
-            $WGET = "wget -c -O";
-        }
-        ++$options{all_references};
-    } else {
-        println "no";
-    }
-
-    unless ($WGET) {
-        print "checking for curl... ";
-        my $out = `curl -h 2>&1`;
-        if ($? == 0) {
-            println "yes";
-            $WGET = "curl -o";
-            ++$options{all_references} if ($options{fix});
-        } else {
-            println "no";
-        }
-    }
-
-    unless ($WGET) {
-        print "checking for ./wget... ";
-        my $cmd = dirname($0) ."/wget";
-        my $out = `$cmd -h 2>&1`;
-        if ($? == 0) {
-            println "yes";
-            if ($options{fix}) {
-                $WGET = "$cmd -O";
-            } else {
-                $WGET = "$cmd -c -O";
-            }
-            ++$options{all_references};
-        } else {
-            println "no";
-        }
-    }
-
-    unless ($WGET) {
-        print "checking for ./wget.exe... ";
-        my $cmd = dirname($0) ."/wget.exe";
-        my $out = `$cmd -h 2>&1`;
-        if ($? == 0) {
-            println "yes";
-            if ($options{fix}) {
-                $WGET = "$cmd -O";
-            } else {
-                $WGET = "$cmd -c -O";
-            }
-            ++$options{all_references};
-        } else {
-            println "no";
-        }
-    }
-
-    Fatal("none of wget, curl could be found") unless ($WGET);
-
-    return $WGET;
-}
-
-sub FindBin {
-    my ($name, $optional) = @_;
-
-    my $prompt = "checking for $name";
-    my $basedir = dirname($0);
-
-    # built from sources
-    print "$prompt (local build)... ";
-    if (-e File::Spec->catfile($basedir, "Makefile")) {
-        my $f = File::Spec->catfile($basedir, "build", "Makefile.env");
-        if (-e $f) {
-            my $dir = `make -s bindir -C $basedir 2>&1`;
-            if ($? == 0) {
-                chomp $dir;
-                my $try = File::Spec->catfile($dir, $name);
-                print "($try";
-                if (-e $try) {
-                    print ": found)... ";
-                    my $tmp = `$try -h 2>&1`;
-                    if ($? == 0) {
-                        println "yes";
-                        return ($try, $dir);
-                    } else {
-                        println "\nfailed to run '$try -h'";
-                    }
-                } else {
-                    println ": not found)";
-                }
-            }
-        }
-    } else {
-        println "no";
-    }
-
-    # try the script directory
-    {
-        my $try = File::Spec->catfile($basedir, $name);
-        print "$prompt ($try";
-        if (-e $try) {
-            print ": found)... ";
-            my $tmp = `$try -h 2>&1`;
-            if ($? == 0) {
-                println "yes";
-                return ($try, $basedir);
-            } else {
-                println "\nfailed to run '$try -h'";
-            }
-        } else {
-            println ": not found)";
-        }
-    }
-
-    # the script directory: windows
-    {
-        my $try = File::Spec->catfile($basedir, "$name.exe");
-        print "$prompt ($try";
-        if (-e $try) {
-            print ": found)... ";
-            my $tmp = `$try -h 2>&1`;
-            if ($? == 0) {
-                println "yes";
-                return ($try, $basedir);
-            } else {
-                println "\nfailed to run '$try -h'";
-            }
-        } else {
-            println ": not found)";
-        }
-    }
-
-    # check from PATH
-    {
-        my $try = "$name";
-        print "$prompt ($try)... ";
-        my $tmp = `$try -h 2>&1`;
-        if ($? == 0) {
-            println "yes";
-            return ($try, "");
-        } else {
-            println "no";
-        }
-    }
-
-    Fatal("$name could not be found") unless ($optional);
-    return (undef, undef);
-}
-
-sub DoKryptoCfg {
-    my ($kfg) = @_;
-
-    my $v = $kfg->{'krypto/pwfile'};
-    unless ($v) {
-        println "failed to read krypto configuration";
-        return;
-    }
-
-    my $dflt = $DECRYPTION_PKG ? 'y' : 'n';
-    print "Do you want to " . ((-e $v) ? "update" : "set") . " your dbGap encryption key? [" .
-        ($DECRYPTION_PKG ? "Y/n" : "y/N") . "] ";
-    my $answer = GetYNAnswer($dflt, 'y');
-    UpdateKryptoCfg() if ($answer eq 'y');
-}
-
-sub UpdateKryptoCfg {
-    my $VDB_PASSWD = (FindBin('vdb-passwd'))[0];
-
-    my $res = system("$VDB_PASSWD -q");
-    if ($res) {
-        println "password update failed";
-    } else {
-        println "password updated ok";
-    }
-}
-
-sub RefseqConfig {
-    my ($nm) = @_;
-
-    $_ = `$VDB_CONFIG refseq/$nm 2>&1`;
-
-    if ($?) {
-        if (/path not found while opening node/) {
-            $_ = '';
-        } else {
-            die $!;
-        }
-    } else {
-        m|<$nm>(.*)</$nm>|s;
-        die "Invalid 'refseq/$nm' configuration" unless ($1);
-        # TODO die if (refseq/paths = "") : fix it
-        $_ = $1;
-    }
-
-    return $_;
-}
-
-sub RefseqFromConfig {
-    my ($refseq) = @_;
-
-    $refseq->{paths} = RefseqConfig('paths');
-    $refseq->{refseqrepository} = RefseqConfig('repository');
-    $refseq->{servers} = RefseqConfig('servers');
-    $refseq->{volumes} = RefseqConfig('volumes');
-}
-
-sub GetKfgNode {
-    my ($nm, $specPrnt) = @_;
-
-    print "$nm: ";
-
-    @_ = split(/\//, $nm);
-    die "GetKfgNode($nm)" if ($#_ < 0);
-    my $leaf = $_[$#_];
-
-    $_ = `$VDB_CONFIG $nm 2>&1`;
-
-    if ($?) {
-        if (/path not found while opening node/) {
-            $_ = '';
-        } else {
-            println;
-            die $!;
-        }
-    } else {
-        m|<$leaf>(.*)</$leaf>|s;
-        unless ($1) {
-            println;
-            die "Invalid '$nm' configuration: '$_'" 
-        }
-        $_ = $1;
-    }
-
-    if ($_) {
-        if ($specPrnt) {
-            if ($specPrnt  eq 'file') {
-                print "'$_': ";
-                if (-e $_) {
-                    println "exists";
-                } else {
-                    println "does not exist";
-                }
-            } else {
-                println "found";
-            }
-        } else {
-            println "'$_'";
-        }
-    } else {
-        println "not found";
-    }
-
-    return $_;
-}
-
-sub Kfg {
-    my ($kfg, $kfgMode, $msg) = @_;
-    my $updated;
-    my $read;
-    if ($kfgMode eq 'fix') {
-        println "\n$msg";
-    } else {
-        println "\n$msg";
-        $read = 1;
-    }
-
-    if ($read) {
-        $kfg->{dflt_user_root} = File::Spec->catdir(Home(), 'ncbi', 'public');
-    }
-
-#   my $nm = 'krypto/pwfile';
-#   if ($read) {
-#       $kfg->{$nm} = GetKfgNode($nm, 'file');
-#       if ($kfg->{$nm} eq '1' || $kfg->{$nm} eq '/.ncbi/vdb-passwd') {
-#            # fix bugs introduced by previous script version
-#            $kfg->{$nm} = '';
-#       }
-#       println;
-#   } else {
-#       if (!$kfg->{$nm}) {
-#           my $path = Posixify(
-#               File::Spec->catdir(Home(), '.ncbi', 'vdb-passwd'));
-#           UpdateConfigNode($nm, $path);
-#           $updated = 1;
-#       }
-#   }
-
-    if ($read) {
-        my $nm = 'refseq/servers';
-        $kfg->{$nm} = GetKfgNode($nm, 'file');
-
-        $nm = 'refseq/volumes';
-        $kfg->{$nm} = GetKfgNode($nm);
-        if ($kfg->{'refseq/servers'} && !($kfg->{'refseq/servers'} =~ m|^/net|)
-            && !($kfg->{'refseq/servers'} =~ m|^/panfs/|))
-        {
-            $kfg->{dflt_user_root}
-                = File::Spec->catdir($kfg->{'refseq/servers'});
-        }
-
-        $nm = 'refseq/paths';
-        $kfg->{$nm} = GetKfgNode($nm, 'file');
-        if ($kfg->{$nm} && ($kfg->{$nm} =~ m|^(.+)/refseq$|)) {
-            $kfg->{dflt_user_root} = $1;
-        }
-
-        println;
-    }
-
-
-    if ($read) {
-        my $nm = 'repository';
-        $kfg->{$nm} = GetKfgNode($nm, 'dont print');
-    }
-
-    my $disableRemoteName = 'repository/remote/main/NCBI/disabled';
-    my %remote = (
-        'repository/remote/main/NCBI/root'
-                         => 'http://ftp-trace.ncbi.nlm.nih.gov/sra',
-        'repository/remote/main/NCBI/apps/sra/volumes/fuse1000'
-                         => 'sra-instant/reads/ByRun/sra',
-        'repository/remote/main/NCBI/apps/refseq/volumes/refseq' => 'refseq',
-        'repository/remote/main/NCBI/apps/wgs/volumes/fuseWGS'   => 'wgs',
-        $disableRemoteName                                       => '',
-        'repository/remote/protected/CGI/resolver-cgi'
-                         => 'http://www.ncbi.nlm.nih.gov/Traces/names/names.cgi'
-    );
-
-    my $userRootName = 'repository/user/main/public/root';
-    my $enableCacheName = 'repository/user/main/public/cache-enabled';
-    my %user = (
-        $userRootName => '',
-        'repository/user/main/public/apps/sra/volumes/sraFlat'   => 'sra',
-        'repository/user/main/public/apps/refseq/volumes/refseq' => 'refseq',
-        'repository/user/main/public/apps/wgs/volumes/wgsFlat'   => 'wgs',
-        $enableCacheName                                         => ''
-   );
-
-    if ($read && $kfg->{repository}) {
-        my $nm = 'repository/site';
-        $kfg->{$nm} = GetKfgNode($nm, 'dont print');
-
-        println;
-    }
-
-    if ($read && $kfg->{repository}) {
-        my $nm = 'repository/remote';
-        $kfg->{$nm} = GetKfgNode($nm, 'dont print');
-    }
-
-    foreach my $nm(keys %remote) {
-        if ($read) {
-            if ($kfg->{'repository/remote'}) {
-                $kfg->{$nm} = GetKfgNode($nm);
-                unless ($kfg->{$nm}) {
-                    if ($nm ne $disableRemoteName || ! $DECRYPTION_PKG) {
-                        $kfg->{fix_remote} = 1;
-                    }
-                }
-            }
-        } else {
-            my $v = $remote{$nm};
-            if (!$kfg->{$nm}) {
-                if (!$v) {
-                    unless ($nm eq $disableRemoteName) {
-                        println "$nm: unknown";
-                        next;
-                    }
-                    next if ($DECRYPTION_PKG);
-                    print "\nWould you like to enable Remote Internet"
-                        . " access to NCBI(recommented)? [Y/n] ";
-                    my $answer = GetYNAnswer('y', 'n');
-                    if ($answer eq 'y') {
-                        $v = 'no';
-                    } else {
-                        println "You will be able to work "
-                            . "just with SRR files found locally";
-                        $v = 'yes';
-                    }
-                }
-                UpdateConfigNode($nm, $v);
-                $updated = 1;
-            } elsif ($v && ($kfg->{$nm} ne $v)) {
-                UpdateConfigNode($nm, $v);
-                $updated = 1;
-            }
-        }
-    }
-
-    if ($read && $kfg->{repository}) {
-        my $nm = 'repository/user';
-        $kfg->{$nm} = GetKfgNode($nm, 'dont print');
-    }
-
-    foreach my $nm(keys %user) {
-        if ($read) {
-            if ($kfg->{'repository/user'}) {
-                my $mode;
-                $mode = 'file' if ($nm eq $userRootName);
-                $kfg->{$nm} = GetKfgNode($nm, $mode);
-                $kfg->{fix_user} = 1 unless ($kfg->{$nm});
-            }
-        } elsif (!$kfg->{$nm}) {
-            my $v = $user{$nm};
-            unless ($v) {
-                next if ($DECRYPTION_PKG);
-                if ($nm eq $userRootName) {
-                    my $dflt = '';
-                    if ($kfg->{dflt_user_root}) {
-                        $dflt = $kfg->{dflt_user_root};
-                    }
-                    println;
-                    print
-               "The SRA Toolkit has the ability to download and cache data.\n" .
-               "Please indicate where data should be stored.\n" .
-               "You should choose a volume with enough free space.\n" .
-               "Path to your Repository ";
-                    print "[ $dflt ]: " if ($dflt);
-                    my $in = <STDIN>;
-                    chomp $in;
-                    $in = $dflt unless ($in);
-                    if (-e $in) {
-                        unless (-d $in) {
-                            println "$in: bad path";
-                        }
-                    } else {
-                        println "Directory '$in' does not exist.";
-                        print "Would you like to create it? [Y/n] ";
-                        my $answer = GetYNAnswer('y', 'y');
-                        if ($answer eq 'y') {
-                            print "'$in': creating... ";
-                            if (mkpath($in)) {
-                                println "ok";
-                            } else {
-                                println "error";
-                            }
-                        }
-                    }
-                    $v = Posixify($in);
-                } elsif ($nm eq $enableCacheName) {
-                    print
-            "\nWould you like to enable caching of downloaded data? [Y/n] ";
-                    my $answer = GetYNAnswer('y', 'y');
-                    $v = $answer eq 'n' ? 'false' : 'true';
-                } else {
-                    println "$nm: unknown";
-                    next;
-                }
-            }
-            UpdateConfigNode($nm, $v);
-            $updated = 1;
-        }
-    }
-
-    println;
-
-    if ($read) {
-        if (!$kfg->{repository} || $kfg->{fix_remote} || $kfg->{fix_user}) {
-            println "Configuration is incorrect";
-        } else {
-            println "Configuration is correct";
-        }
-    }
-
-    return $updated;
-}
-
-sub FixKfg {
-    my ($kfg) = @_;
-
-    if (!$kfg->{repository} || $kfg->{fix_remote} || $kfg->{fix_user}) {
-        print "Your configuration is incomplete. " .
-            "Would you like to fix it? [Y/n] ";
-        my $answer = GetYNAnswer('y', 'n');
-        if ($answer eq 'y') {
-            return Kfg($kfg, 'fix', 'Fixing configuration');
-        } else {
-            println
-                "Warning: Some tools could fail without proper configuration.";
-        }
-    }
-
-    return 0;
-}
-
-sub GetYNAnswer {
-    my ($dflt, $no) = @_;
-    my $in = <STDIN>;
-    chomp $in;
-    if ($in) {
-        if ($in eq 'Y' || $in eq 'y' ||
-            $in eq 'YES' || $in eq 'yes' || $in eq 'Yes')
-        {
-            return 'y';
-        } elsif ($in eq 'N' || $in eq 'n'
-            || $in eq 'NO' || $in eq 'no' || $in eq 'No')
-        {
-            return 'n';
-        } else {
-            return $no;
-        }
-    } else {
-        return $dflt;
-    }
-}
-
-sub Fatal {
-    my ($msg) = @_;
-
-    print basename($0);
-    println ": Fatal: $msg";
-
-    exit 1;
-}
-
-sub Warn {
-    my ($msg) = @_;
-
-    print basename($0);
-    println ": WARNING: $msg";
-}
-
-# EOF #
-################################################################################
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 46673d0..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,61 +0,0 @@
-sra-sdk (2.3.3-4~dfsg-1) unstable; urgency=low
-
-  [ Andreas Tille ]
-  * New upstream version
-  * debian/upstream: Add citation information
-  * fix debian/watch
-  * debian/control:
-     - cme fix dpkg-control
-     - debhelper 9
-     - canonical Vcs fields
-  * debian/copyright: Exclude external libraries
-  * debian/rules:
-     - Add get-orig-source target to call enhances uscan
-     - remove override because upstream seems to do the correct thing now
-     - libsra-schema seems to be not built any more in this version so
-       drop the special handling of it
-     - Reactivate deletion of libs/krypto/*.pic.o.list files to get a
-       really clean source
-  * debian/doc: USAGE is not provided by upstream any more
-  * debian/patches/build-with-system-libbz2-libz.patch: Fix build problem
-    (thanks to Gert Wollny <gw.fossdev at gmail.com> for the patch)
-  * debian/sra-toolkit.install: There are neither mod?? nor wmod?? files
-    shipped in this version any more - so remove these from dh_install
-  * debian/patches/hardening.patch: Propagate Debian hardening options
-    into build system
-  * debian/patches/hardening-format-security.patch: Fix format strings in
-    snprintf() calls
-  * debian/watch: mangle version string
-  * debian/sra-toolkit-libs0.lintian-overrides: override
-    package-name-doesnt-match-sonames
-
-  [ Charles Plessy ]
-  32dd5cd Updated symbols file.
-
- -- Andreas Tille <tille at debian.org>  Wed, 23 Oct 2013 10:43:20 +0200
-
-sra-sdk (2.1.7a-1) unstable; urgency=low
-
-  [ Charles Plessy ]
-  61e22aa New upstream release (Closes: #627861).
-  1b09fd5 Normalised debian/copyright file with config-edit.
-  a93e7b5 Wildcard characters to match 64 or 32 according to the architecture.
-  3d66d80 New upstream source location in debian/watch.
-  74e5234 Mark the use of git-buildpackage by debian/gbp.conf.
-  0074d68 Simplified Homepage URL in debian/control.
-  5cd8039 Use a target that allows dynamic linking (debian/rules).
-  9815817 Do not install empty /usr/bin/ncbi directory (debian/rules).
-  fb42792 Updated debian/sra-toolkit-libs0.symbols.
-  866f773 Install config.kfg and vdb-copy.kfg in /etc/ncbi.
-
-  [ Andreas Tille ]
-  9e6e831 Suggest patches for build system to build on non i386&amd64
-    architectures as well as BSD and Hurd
-
- -- Charles Plessy <plessy at debian.org>  Tue, 10 Jan 2012 09:06:14 +0900
-
-sra-sdk (2.0.1-1) unstable; urgency=low
-
-  * Initial release (Closes: #610603).
-
- -- Charles Plessy <plessy at debian.org>  Tue, 24 May 2011 14:48:10 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index ec63514..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 29a649b..0000000
--- a/debian/control
+++ /dev/null
@@ -1,73 +0,0 @@
-Source: sra-sdk
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Charles Plessy <plessy at debian.org>,
-           Andreas Tille <tille at debian.org>
-Section: science
-Priority: optional
-Build-Depends: debhelper (>= 9),
-               libbz2-dev,
-               zlib1g-dev,
-               libxml2-dev
-Standards-Version: 3.9.4
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-med/sra-sdk.git
-Vcs-Git: git://anonscm.debian.org/debian-med/sra-sdk.git
-Homepage: http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
-
-Package: sra-toolkit
-Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Description: utilities for the NCBI Sequence Read Archive
- Tools for reading the SRA archive, generally by converting individual runs
- into some commonly used format such as fastq.
- .
- The textual dumpers "sra-dump" and "vdb-dump" are provided in this
- release as an aid in visual inspection. It is likely that their
- actual output formatting will be changed in the near future to a
- stricter, more formalized representation[s]. PLEASE DO NOT RELY UPON
- THE OUTPUT FORMAT SEEN IN THIS RELEASE.
- .
- The "help" information will be improved in near future releases, and
- the tool options will become standardized across the set. More documentation
- will also be provided documentation on the NCBI web site.
- .
- Tool options may change in the next release. Version 1 tool options
- will remain supported wherever possible in order to preserve
- operation of any existing scripts.
-
-Package: sra-toolkit-libs0
-Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Description: Libraries for the SRA Toolkit
- This package provides all libraries and modules for executing the
- NCBI SRA toolkit's programs.  This currently includes:
- .
-  libkdb                # physical layer reading library
-  libkfg                # configuration library
-  libkfs                # file system library
-  libklib               # support library
-  libkproc              # process synchronization library
-  libkq                 # cross-thread queue library
-  libksproc             # single-threaded emulation library
-  libksrch              # search algorithm library
-  libkxfs               # XML to filesystem library
-  libkxml               # XML container support library
-  libload               # loader tool utility library
-  libsra-schema         # weak-linked sra schema
-  libsradb              # API for accessing sra
-  libsrapath            # weak-link stubs for srapath
-  libsrareader          # reader library
-  libvdb                # virtual layer reading library
-  libwkdb               # physical layer update library
-  libwsradb             # update API for SRA
-  libwvdb               # virtual layer update library
-
-Package: sra-toolkit-libs-dev
-Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Description: Development files for the NCBI SRA Toolkit's libraries
- This package provides development support files for the
- NCBI SRA Toolkit's libraries.
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 8c2760d..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,211 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Source: http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
-Files-Excluded:
-    libs/ext
-    tools/*/#Makefile#
-
-Files: *
-Copyright: none claimed
-License: public-domain
-                           PUBLIC DOMAIN NOTICE
-              National Center for Biotechnology Information
- .
- This software/database is a "United States Government Work" under the
- terms of the United States Copyright Act.  It was written as part of
- the author's official duties as a United States Government employee and
- thus cannot be copyrighted.  This software/database is freely available
- to the public for use. The National Library of Medicine and the U.S.
- Government have not placed any restriction on its use or reproduction.
- .
- Although all reasonable efforts have been taken to ensure the accuracy
- and reliability of the software and data, the NLM and the U.S.
- Government do not and cannot warrant the performance or results that
- may be obtained by using this software or data. The NLM and the U.S.
- Government disclaim all warranties, express or implied, including
- warranties of performance, merchantability or fitness for any particular
- purpose.
- .
- Please cite the author in any work or product based on this material.
-
-Files: interfaces/ext/bzlib.h
-Copyright: © 1996-2010 Julian Seward <jseward at bzip.org>
-License: bzip2
- This program, "bzip2", the associated library "libbzip2", and all
- documentation, are copyright (C) 1996-2010 Julian R Seward.  All
- rights reserved.
- .
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- .
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
- .
-  2. The origin of this software must not be misrepresented; you must 
-     not claim that you wrote the original software.  If you use this 
-     software in a product, an acknowledgment in the product 
-     documentation would be appreciated but is not required.
- .
-  3. Altered source versions must be plainly marked as such, and must
-     not be misrepresented as being the original software.
- .
-  4. The name of the author may not be used to endorse or promote 
-     products derived from this software without specific prior written 
-     permission.
- .
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- .
- Julian Seward, jseward at bzip.org
- bzip2/libbzip2 version 1.0.6 of 6 September 2010
-Comment: This file is part of bzip2/libbzip2, a program and library for
- lossless, block-sorting data compression.
- .
-  bzip2/libbzip2 version 1.0.6 of 6 September 2010
-  Copyright (C) 1996-2010 Julian Seward <jseward at bzip.org>
- .
- Please read the WARNING, DISCLAIMER and PATENTS sections in the 
- README file.
- .
- This program is released under the terms of the license contained
- in the file LICENSE.
-
-Files: interfaces/ext/magic.h
-Copyright: © Christos Zoulas 2003.
-License: magic
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-  1. Redistributions of source code must retain the above copyright
-     notice immediately at the beginning of the file, without modification,
-     this list of conditions, and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
- .
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
-Files: interfaces/ext/zconf.h
-Copyright: © 1995-2010 Jean-loup Gailly.
-License: zlib
- This software is provided 'as-is', without any express or implied
- warranty.  In no event will the authors be held liable for any damages
- arising from the use of this software.
- .
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
- .
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
- .
-  Jean-loup Gailly        Mark Adler
-  jloup at gzip.org          madler at alumni.caltech.edu
- .
- .
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-Comment: zconf.h -- configuration of the zlib compression library
- Copyright (C) 1995-2010 Jean-loup Gailly.
- For conditions of distribution and use, see copyright notice in zlib.h
-
-Files: interfaces/ext/regex.h
-Copyright: © 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006 Free Software Foundation, Inc.
-License: LGPL-2.1+
-
-Files: libs/klib/bsearch.c
-Copyright: © 1991,92,97,2000,02 Free Software Foundation, Inc.
-License: LGPL-2.1+
-
-Files: libs/klib/qsort.c
-Copyright: © 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc.
-License: LGPL-2.1+
-
-Files: libs/klib/md5.c
-Copyright: © 1999 Aladdin Enterprises.
-License: Alladdin
- This software is provided 'as-is', without any express or implied
- warranty.  In no event will the authors be held liable for any damages
- arising from the use of this software.
- .
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
- .
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
- .
- L. Peter Deutsch
- ghost at aladdin.com
-Comment: Independent implementation of MD5 (RFC 1321).
- .
- This code implements the MD5 Algorithm defined in RFC 1321.
- It is derived directly from the text of the RFC and not from the
- reference implementation.
- .
- The original and principal author of md5.c is L. Peter Deutsch
- <ghost at aladdin.com>.  Other authors are noted in the change history
- that follows (in reverse chronological order):
- .
- 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
- 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
- 1999-05-03 lpd Original version.
-Disclaimer: This software is derived from original work by Peter Deutsch.
- It has been incorporated into a body of PUBLIC DOMAIN software
- distributed by the National Center for Biotechnology Information.
- .
- Although all reasonable efforts have been taken to ensure the accuracy
- and reliability of the software and data, the NLM and the U.S.
- Government do not and cannot warrant the performance or results that
- may be obtained by using this software or data. The NLM and the U.S.
- Government disclaim all warranties, express or implied, including
- warranties of performance, merchantability or fitness for any particular
- purpose.
-
-License: LGPL-2.1+
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- .
- The GNU C Library 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
- Lesser General Public License for more details.
- .
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-Comment: On Debian systems, the full text of the GNU Lesser General Public
- version 2.1 is accessible in the file ‘/usr/share/common-licenses/LGPL-2.1’.
-
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index d804f47..0000000
--- a/debian/docs
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-doc/help
diff --git a/debian/gbp.conf b/debian/gbp.conf
deleted file mode 100644
index 53edd22..0000000
--- a/debian/gbp.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-# This package is developed using git-buildpackage and pristine-tar.
-
-[DEFAULT]
-# use pristine-tar:
-pristine-tar = True
-
-[git-dch]
-# include 7 digits of the commit ID in the changelog entry:
-id-length = 7
diff --git a/debian/patches/10_portability.patch b/debian/patches/10_portability.patch
deleted file mode 100644
index e0ca446..0000000
--- a/debian/patches/10_portability.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-LastChanged: Tue, 10 Jan 2012 09:06:14 +0900
-Description: Drop redundant -m32/-m64 option to enable build
-             on all Debian architectures
-
---- a/build/Makefile.gcc
-+++ b/build/Makefile.gcc
-@@ -53,12 +53,6 @@ ifeq (linux,$(OS))
-     NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
- endif
- 
--ifeq (64,$(BITS))
--	CARCH = -m64
--else
--	CARCH = -m32
--endif
--
- ifeq (prof, $(BUILD))
- 	PROF = -pg
- endif
---- a/build/Makefile.shell
-+++ b/build/Makefile.shell
-@@ -26,6 +26,7 @@
- # determine OS
- UNAME = $(shell uname -s)
- 
-+HOST_OS = ''
- ifeq (Darwin, $(UNAME))
- 	HOST_OS = mac
- endif
-@@ -42,12 +43,17 @@ endif
- ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
- 	HOST_OS = win
- endif
-+# handle all other OSes (like BSD or Hurd) as if they were linux (see bug #627861)
-+ifeq ($(HOST_OS), '')
-+	HOST_OS = linux
-+endif
- 
- # assume build OS is the same as host OS
- OS = $(HOST_OS)
- BUILD_OS = $(OS)
- 
- # determine ARCH
-+HOST_ARCH=''
- ARCHITECTURES = default
- ifeq (mac,$(HOST_OS))
- 	HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
-@@ -88,6 +94,10 @@ else
- 		ARCHITECTURES = sparc64 sparc32
- 	endif
- endif
-+# Handle all other architectures equivalent as i386 (see bug #627861)
-+ifeq ($(ARCH),'')
-+	ARCH = i386
-+endif
- 
- ARCH = $(HOST_ARCH)
- REMOTE_ARCH = $(ARCH)
-@@ -136,15 +146,4 @@ endif
- OSFLAV = $(OS)
- 
- # determine BITS
--ifeq (x86_64, $(ARCH))
--	BITS = 64
--endif
--ifeq (sparc64, $(ARCH))
--	BITS = 64
--endif
--ifeq (i386, $(ARCH))
--	BITS = 32
--endif
--ifeq (sparc32, $(ARCH))
--	BITS = 32
--endif
-+BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
diff --git a/debian/patches/build-with-system-libbz2-libz.patch b/debian/patches/build-with-system-libbz2-libz.patch
deleted file mode 100644
index 0477ae7..0000000
--- a/debian/patches/build-with-system-libbz2-libz.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Author: Gert Wollny <gw.fossdev at gmail.com>
-LastChanged: Tue, 22 Oct 2013 00:15:19 +0200
-Description: Fix issue when trying to build against Debian packaged
-             libbz2
-
-diff --git a/libs/ncbi-vdb/Makefile b/libs/ncbi-vdb/Makefile
-index 7b08def..a9c1618 100644
---- a/libs/ncbi-vdb/Makefile
-+++ b/libs/ncbi-vdb/Makefile
-@@ -88,7 +88,6 @@ endif
- 
- VDB_LIB_CMN = \
- 	align-access \
--	bz2 \
- 	kfg \
- 	kfs \
- 	klib \
-@@ -98,8 +97,7 @@ VDB_LIB_CMN = \
- 	ksrch \
- 	$(LIBKXML) \
- 	kurl \
--	vfs \
--	z
-+	vfs
- 
- VDB_LIB_RD = \
- 	$(VDB_LIB_CMN) \
-@@ -116,7 +114,7 @@ VDB_OBJ = \
- 	$(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RD)))
- 
- VDB_LIB = \
--	$(addprefix -s,$(VDB_LIB_RD))
-+	$(addprefix -s,$(VDB_LIB_RD)) -lbz2 -lz
- 
- $(LIBDIR)/libncbi-vdb.$(SHLX): $(VDB_OBJ)
- 	$(LD) --dlib --vers $(SRCDIR) -o $@ $(VDB_LIB)
diff --git a/debian/patches/do_not_build_external_libs.patch b/debian/patches/do_not_build_external_libs.patch
deleted file mode 100644
index 752806a..0000000
--- a/debian/patches/do_not_build_external_libs.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Author: Charles Plessy <plessy at debian.org>
-Description: Do not use third party libs but use Debian packaged
-             libraries instead
-
---- a/libs/Makefile
-+++ b/libs/Makefile
-@@ -32,7 +32,6 @@ include $(TOP)/build/Makefile.shell
- # default
- #
- SUBDIRS = \
--	ext \
- 	klib \
- 	kproc \
- 	kfs \
diff --git a/debian/patches/hardening-format-security.patch b/debian/patches/hardening-format-security.patch
deleted file mode 100644
index 6457902..0000000
--- a/debian/patches/hardening-format-security.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-LastChanged: Wed, 23 Oct 2013 10:43:20 +0200
-Description: Fix format strings in snprintf() calls
-  When using hardening options, specifically -Werror=format-security
-  some errors of kind:
-     format not a string literal and no format arguments
-  appeared in some snprintf() calls.  This is fixed by providing
-  the expected format string
-
-
---- a/libs/kdb/database.c
-+++ b/libs/kdb/database.c
-@@ -216,7 +216,7 @@ rc_t KDBManagerVOpenDBReadInt ( const KD
-        is that of stdc library's printf, not vdb printf */
-     char dbpath [ 4096 ];
-     int z = ( args == NULL ) ?
--        snprintf ( dbpath, sizeof dbpath, path ):
-+        snprintf ( dbpath, sizeof dbpath, "%s", path ):
-         vsnprintf ( dbpath, sizeof dbpath, path, args );
-     if ( z < 0 || ( size_t ) z >= sizeof dbpath )
-         rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
---- a/libs/kdb/table.c
-+++ b/libs/kdb/table.c
-@@ -216,7 +216,7 @@ rc_t KDBManagerVOpenTableReadInt ( const
- 
-     char tblpath [ 4096 ];
-     int z = ( args == NULL ) ?
--        snprintf ( tblpath, sizeof tblpath, path ):
-+        snprintf ( tblpath, sizeof tblpath, "%s", path ):
-         vsnprintf ( tblpath, sizeof tblpath, path, args );
-     if ( z < 0 || ( size_t ) z >= sizeof tblpath )
-         rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
---- a/libs/kdb/index.c
-+++ b/libs/kdb/index.c
-@@ -492,7 +492,7 @@ LIB_EXPORT rc_t CC KTableVOpenIndexRead
-     {
-         int len;
-         if ( args == 0 )
--            len = snprintf ( path, sizeof path, name );
-+            len = snprintf ( path, sizeof path, "%s", name );
-         else
-             len = vsnprintf ( path, sizeof path, name, args );
-         if ( len < 0 || ( size_t ) len >= sizeof path )
diff --git a/debian/patches/hardening.patch b/debian/patches/hardening.patch
deleted file mode 100644
index 48e4fbf..0000000
--- a/debian/patches/hardening.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-LastUpdated: Wed, 23 Oct 2013 10:43:20 +0200
-Description: Propagate Debian hardening options into build system
-  This is most probably not the most elegant way, but when simply
-  setting CFLAGS in debian/rules they simply override the CFLAGS
-  setting inside the sequence of Makefiles which leads to a loss of
-  DEFINES and INCDIRS which are needed to build properly
-
---- a/build/Makefile.env
-+++ b/build/Makefile.env
-@@ -301,9 +301,9 @@ DLLX ?= $(SHLX)
- ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
- 
- # default tool parameters
--CFLAGS	= $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
-+CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS) $(DEB_CFLAGS)
- CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
--LDFLAGS = $(DBG) $(PROF) $(CARCH)
-+LDFLAGS = $(DBG) $(PROF) $(CARCH) $(DEB_LDFLAGS)
- 
- #-------------------------------------------------------------------------------
- # runtests
---- a/Makefile
-+++ b/Makefile
-@@ -81,11 +81,11 @@ PASSTHRUS = \
- 	$(CONFIG) $(PUBLISH)
- 
- $(PASSTHRUS):
--	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
--	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env rebuild-dirlinks config
-+	@ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
-+	@ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env rebuild-dirlinks config
- 
- $(REPORTS):
--	@ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
-+	@ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
- 
- .PHONY: $(PASSTHRUS) $(REPORTS)
- 
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 3cfd24c..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,5 +0,0 @@
-do_not_build_external_libs.patch
-10_portability.patch
-build-with-system-libbz2-libz.patch
-hardening.patch
-hardening-format-security.patch
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index d256959..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/make -f
-%:
-	dh $@
-
-OUTDIR=$(CURDIR)/debian/tmp
-
-override_dh_auto_clean:
-
-override_dh_clean:
-	dh_clean
-	find libs/krypto -name "*.pic.o.list" -delete
-	rm -f build/OUTDIR.linux
-
-override_dh_auto_configure:
-	export OUTDIR=$(OUTDIR) ; make OUTDIR=$(OUTDIR) out ; make release dynamic
-
-override_dh_auto_build:
-	export LD_LIBRARY_PATH="$$LD_LIBRARY_PATH:$(OUTDIR)/lib"; export OUTDIR=$(OUTDIR) ; make DEB_CFLAGS="$(CFLAGS)" DEB_LDFLAGS="$(LDFLAGS)"
-
-override_dh_auto_test:
-
-override_dh_prep:
-	dh_prep -X debian/tmp
-
-# Remark: The following uscan command requires devscripts > 2.12.4 which is not
-#         yet released at the time of this package release.  The code can be obtained
-#         via
-#   git clone git://tille@git.debian.org/git/users/tille/devscripts.git
-#         and then use scripts/uscan.pl
-get-orig-source:
-	uscan --verbose --force-download --repack-compression xz
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/sra-toolkit-libs-dev.install b/debian/sra-toolkit-libs-dev.install
deleted file mode 100644
index e7553b7..0000000
--- a/debian/sra-toolkit-libs-dev.install
+++ /dev/null
@@ -1 +0,0 @@
-lib??/*so usr/lib
diff --git a/debian/sra-toolkit-libs0.install b/debian/sra-toolkit-libs0.install
deleted file mode 100644
index 0b035c0..0000000
--- a/debian/sra-toolkit-libs0.install
+++ /dev/null
@@ -1 +0,0 @@
-lib??/*so.* usr/lib
diff --git a/debian/sra-toolkit-libs0.lintian-overrides b/debian/sra-toolkit-libs0.lintian-overrides
deleted file mode 100644
index ae7c81a..0000000
--- a/debian/sra-toolkit-libs0.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-# Temporarily needed as long as libsra-schema is weak-linked. 
-sra-toolkit-libs0: non-dev-pkg-with-shlib-symlink usr/lib/libsra-schema.so.1.0.4 usr/lib/libsra-schema.so
-sra-toolkit-libs0: package-name-doesnt-match-sonames libncbi-vdb2 libncbi-wvdb2
diff --git a/debian/sra-toolkit-libs0.symbols b/debian/sra-toolkit-libs0.symbols
deleted file mode 100644
index 0fde4c0..0000000
--- a/debian/sra-toolkit-libs0.symbols
+++ /dev/null
@@ -1,6085 +0,0 @@
-libncbi-vdb.so.2 sra-toolkit-libs0 #MINVER#
- AES_decrypt at Base 2.3.3-4~dfsg
- AES_encrypt at Base 2.3.3-4~dfsg
- AES_set_decrypt_key at Base 2.3.3-4~dfsg
- AES_set_encrypt_key at Base 2.3.3-4~dfsg
- ALIGN_align_restore_read at Base 2.3.3-4~dfsg
- ALIGN_cigar at Base 2.3.3-4~dfsg
- ALIGN_cigar_2 at Base 2.3.3-4~dfsg
- ALIGN_generate_has_mismatch at Base 2.3.3-4~dfsg
- ALIGN_generate_mismatch at Base 2.3.3-4~dfsg
- ALIGN_generate_mismatch_qual at Base 2.3.3-4~dfsg
- ALIGN_project_from_sequence at Base 2.3.3-4~dfsg
- ALIGN_raw_restore_read at Base 2.3.3-4~dfsg
- ALIGN_ref_restore_read at Base 2.3.3-4~dfsg
- ALIGN_ref_sub_select at Base 2.3.3-4~dfsg
- ALIGN_seq_restore_read at Base 2.3.3-4~dfsg
- AbsolidReaderBase at Base 2.3.3-4~dfsg
- AbsolidReaderCurrentSpot at Base 2.3.3-4~dfsg
- AbsolidReaderFirstSpot at Base 2.3.3-4~dfsg
- AbsolidReaderHeader at Base 2.3.3-4~dfsg
- AbsolidReaderMake at Base 2.3.3-4~dfsg
- AbsolidReaderNextSpot at Base 2.3.3-4~dfsg
- AbsolidReaderQuality at Base 2.3.3-4~dfsg
- AbsolidReaderSeekSpot at Base 2.3.3-4~dfsg
- AbsolidReaderSignalCY3 at Base 2.3.3-4~dfsg
- AbsolidReaderSignalCY5 at Base 2.3.3-4~dfsg
- AbsolidReaderSignalFTC at Base 2.3.3-4~dfsg
- AbsolidReaderSignalTXR at Base 2.3.3-4~dfsg
- AbsolidReaderSpotName at Base 2.3.3-4~dfsg
- AbsolidReaderWhack at Base 2.3.3-4~dfsg
- AbsolidReader_SpotInfo at Base 2.3.3-4~dfsg
- AbsolidReader_SpotReadInfo at Base 2.3.3-4~dfsg
- AgrepDPFindAll at Base 2.3.3-4~dfsg
- AgrepDPFindFirst at Base 2.3.3-4~dfsg
- AgrepDPFree at Base 2.3.3-4~dfsg
- AgrepDPMake at Base 2.3.3-4~dfsg
- AgrepFindAll at Base 2.3.3-4~dfsg
- AgrepFindBest at Base 2.3.3-4~dfsg
- AgrepFindFirst at Base 2.3.3-4~dfsg
- AgrepMake at Base 2.3.3-4~dfsg
- AgrepMyersFree at Base 2.3.3-4~dfsg
- AgrepMyersMake at Base 2.3.3-4~dfsg
- AgrepWhack at Base 2.3.3-4~dfsg
- AgrepWuFindAll at Base 2.3.3-4~dfsg
- AgrepWuFindFirst at Base 2.3.3-4~dfsg
- AgrepWuFree at Base 2.3.3-4~dfsg
- AgrepWuMake at Base 2.3.3-4~dfsg
- AliasDump at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorAddRef at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetBAMAlignment at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetCIGAR at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsFirstInPair at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsPaired at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsSecondInPair at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetMapQuality at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRecordID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRefSeqID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRefSeqPos at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSeqAccessionID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSeqID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSequence at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetStrandDirection at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorNext at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorRelease at Base 2.3.3-4~dfsg
- AlignAccessDBAddRef at Base 2.3.3-4~dfsg
- AlignAccessDBEnumerateAlignments at Base 2.3.3-4~dfsg
- AlignAccessDBEnumerateRefSequences at Base 2.3.3-4~dfsg
- AlignAccessDBExportBAMFile at Base 2.3.3-4~dfsg
- AlignAccessDBRelease at Base 2.3.3-4~dfsg
- AlignAccessDBWindowedAlignments at Base 2.3.3-4~dfsg
- AlignAccessMgrAddRef at Base 2.3.3-4~dfsg
- AlignAccessMgrMake at Base 2.3.3-4~dfsg
- AlignAccessMgrMakeBAMDB at Base 2.3.3-4~dfsg
- AlignAccessMgrMakeIndexBAMDB at Base 2.3.3-4~dfsg
- AlignAccessMgrRelease at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorAddRef at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorGetID at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorGetLength at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorNext at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorRelease at Base 2.3.3-4~dfsg
- AlignIteratorRecordDestroy at Base 2.3.3-4~dfsg
- AlignIteratorRecordPopulate at Base 2.3.3-4~dfsg
- AlignIteratorRecordSize at Base 2.3.3-4~dfsg
- AlignMgrAddRef at Base 2.3.3-4~dfsg
- AlignMgrMakeAlignmentIterator at Base 2.3.3-4~dfsg
- AlignMgrMakePlacementSetIterator at Base 2.3.3-4~dfsg
- AlignMgrMakeRead at Base 2.3.3-4~dfsg
- AlignMgrMakeReferenceIterator at Base 2.3.3-4~dfsg
- AlignMgrRelease at Base 2.3.3-4~dfsg
- AlignRefTableCursor at Base 2.3.3-4~dfsg
- AlignmentIteratorAddRef at Base 2.3.3-4~dfsg
- AlignmentIteratorBasesDeleted at Base 2.3.3-4~dfsg
- AlignmentIteratorBasesInserted at Base 2.3.3-4~dfsg
- AlignmentIteratorNext at Base 2.3.3-4~dfsg
- AlignmentIteratorPosition at Base 2.3.3-4~dfsg
- AlignmentIteratorRelease at Base 2.3.3-4~dfsg
- AlignmentIteratorState at Base 2.3.3-4~dfsg
- BAMAlignmentAddRef at Base 2.3.3-4~dfsg
- BAMAlignmentGetAlignmentDetail at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGAlignGroup at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGSeqQual at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSKey at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSSeqLen at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSSequence at Base 2.3.3-4~dfsg
- BAMAlignmentGetCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetCigarCount at Base 2.3.3-4~dfsg
- BAMAlignmentGetFlags at Base 2.3.3-4~dfsg
- BAMAlignmentGetInsertSize at Base 2.3.3-4~dfsg
- BAMAlignmentGetMapQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetMatePosition at Base 2.3.3-4~dfsg
- BAMAlignmentGetMateRefSeqId at Base 2.3.3-4~dfsg
- BAMAlignmentGetPosition2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetPosition at Base 2.3.3-4~dfsg
- BAMAlignmentGetQuality2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetRawCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadGroupName at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadLength at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName3 at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName at Base 2.3.3-4~dfsg
- BAMAlignmentGetRefSeqId at Base 2.3.3-4~dfsg
- BAMAlignmentGetSequence2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetSequence at Base 2.3.3-4~dfsg
- BAMAlignmentGetTI at Base 2.3.3-4~dfsg
- BAMAlignmentHasCGData at Base 2.3.3-4~dfsg
- BAMAlignmentHasColorSpace at Base 2.3.3-4~dfsg
- BAMAlignmentIsMapped at Base 2.3.3-4~dfsg
- BAMAlignmentOptDataForEach at Base 2.3.3-4~dfsg
- BAMAlignmentRelease at Base 2.3.3-4~dfsg
- BAMFileAddRef at Base 2.3.3-4~dfsg
- BAMFileGetHeaderText at Base 2.3.3-4~dfsg
- BAMFileGetPosition at Base 2.3.3-4~dfsg
- BAMFileGetProportionalPosition at Base 2.3.3-4~dfsg
- BAMFileGetReadGroup at Base 2.3.3-4~dfsg
- BAMFileGetReadGroupByName at Base 2.3.3-4~dfsg
- BAMFileGetReadGroupCount at Base 2.3.3-4~dfsg
- BAMFileGetRefSeq at Base 2.3.3-4~dfsg
- BAMFileGetRefSeqById at Base 2.3.3-4~dfsg
- BAMFileGetRefSeqCount at Base 2.3.3-4~dfsg
- BAMFileIndexHasRefSeqId at Base 2.3.3-4~dfsg
- BAMFileIsIndexed at Base 2.3.3-4~dfsg
- BAMFileMake at Base 2.3.3-4~dfsg
- BAMFileMakeWithDir at Base 2.3.3-4~dfsg
- BAMFileMakeWithHeader at Base 2.3.3-4~dfsg
- BAMFileMakeWithKFile at Base 2.3.3-4~dfsg
- BAMFileMakeWithVPath at Base 2.3.3-4~dfsg
- BAMFileOpenIndex at Base 2.3.3-4~dfsg
- BAMFileOpenIndexWithVPath at Base 2.3.3-4~dfsg
- BAMFileRead at Base 2.3.3-4~dfsg
- BAMFileRelease at Base 2.3.3-4~dfsg
- BAMFileRewind at Base 2.3.3-4~dfsg
- BAMFileSeek at Base 2.3.3-4~dfsg
- BAMFileSetPosition at Base 2.3.3-4~dfsg
- BAMFileVMakeWithDir at Base 2.3.3-4~dfsg
- BAMValidate at Base 2.3.3-4~dfsg
- BSTNodeFindNext at Base 2.3.3-4~dfsg
- BSTNodeFindPrev at Base 2.3.3-4~dfsg
- BSTNodeNext at Base 2.3.3-4~dfsg
- BSTNodeParent at Base 2.3.3-4~dfsg
- BSTNodePrev at Base 2.3.3-4~dfsg
- BSTreeDepth at Base 2.3.3-4~dfsg
- BSTreeDoUntil at Base 2.3.3-4~dfsg
- BSTreeFind at Base 2.3.3-4~dfsg
- BSTreeFirst at Base 2.3.3-4~dfsg
- BSTreeForEach at Base 2.3.3-4~dfsg
- BSTreeInsert at Base 2.3.3-4~dfsg
- BSTreeInsertUnique at Base 2.3.3-4~dfsg
- BSTreeLast at Base 2.3.3-4~dfsg
- BSTreeMbrWhack at Base 2.3.3-4~dfsg
- BSTreePersist at Base 2.3.3-4~dfsg
- BSTreeResort at Base 2.3.3-4~dfsg
- BSTreeUnlink at Base 2.3.3-4~dfsg
- BSTreeWhack at Base 2.3.3-4~dfsg
- BitNr2Mask at Base 2.3.3-4~dfsg
- BlobHeadersAddRef at Base 2.3.3-4~dfsg
- BlobHeadersCreate at Base 2.3.3-4~dfsg
- BlobHeadersCreateChild at Base 2.3.3-4~dfsg
- BlobHeadersCreateDummyHeader at Base 2.3.3-4~dfsg
- BlobHeadersCreateFromData at Base 2.3.3-4~dfsg
- BlobHeadersGetHdrWrite at Base 2.3.3-4~dfsg
- BlobHeadersGetHeader at Base 2.3.3-4~dfsg
- BlobHeadersGetMaxBufferSize at Base 2.3.3-4~dfsg
- BlobHeadersGetNextFrame at Base 2.3.3-4~dfsg
- BlobHeadersPop at Base 2.3.3-4~dfsg
- BlobHeadersRelease at Base 2.3.3-4~dfsg
- BlobHeadersSerialize at Base 2.3.3-4~dfsg
- CRC32 at Base 2.3.3-4~dfsg
- CRC32Init at Base 2.3.3-4~dfsg
- DLListAppendList at Base 2.3.3-4~dfsg
- DLListDoUntil at Base 2.3.3-4~dfsg
- DLListFindFirst at Base 2.3.3-4~dfsg
- DLListFindLast at Base 2.3.3-4~dfsg
- DLListForEach at Base 2.3.3-4~dfsg
- DLListInsertListAfter at Base 2.3.3-4~dfsg
- DLListInsertListBefore at Base 2.3.3-4~dfsg
- DLListInsertNodeAfter at Base 2.3.3-4~dfsg
- DLListInsertNodeBefore at Base 2.3.3-4~dfsg
- DLListPopHead at Base 2.3.3-4~dfsg
- DLListPopTail at Base 2.3.3-4~dfsg
- DLListPrependList at Base 2.3.3-4~dfsg
- DLListPushHead at Base 2.3.3-4~dfsg
- DLListPushTail at Base 2.3.3-4~dfsg
- DLListUnlink at Base 2.3.3-4~dfsg
- DLListWhack at Base 2.3.3-4~dfsg
- DNAReverseCompliment at Base 2.3.3-4~dfsg
- DirectoryCheckMD5 at Base 2.3.3-4~dfsg
- FQNDump at Base 2.3.3-4~dfsg
- FastqReaderBase at Base 2.3.3-4~dfsg
- FastqReaderBaseName at Base 2.3.3-4~dfsg
- FastqReaderCurrentSpot at Base 2.3.3-4~dfsg
- FastqReaderFirstSpot at Base 2.3.3-4~dfsg
- FastqReaderMake at Base 2.3.3-4~dfsg
- FastqReaderNextSpot at Base 2.3.3-4~dfsg
- FastqReaderQuality at Base 2.3.3-4~dfsg
- FastqReaderQualityName at Base 2.3.3-4~dfsg
- FastqReaderSeekSpot at Base 2.3.3-4~dfsg
- FastqReaderWhack at Base 2.3.3-4~dfsg
- FastqReader_GetCurrentSpotData at Base 2.3.3-4~dfsg
- FastqReader_GetCurrentSpotSplitData at Base 2.3.3-4~dfsg
- FastqReader_GetNextSpotData at Base 2.3.3-4~dfsg
- FastqReader_GetNextSpotSplitData at Base 2.3.3-4~dfsg
- FastqReader_SpotInfo at Base 2.3.3-4~dfsg
- FastqReader_SpotReadInfo at Base 2.3.3-4~dfsg
- FgrepAhoFindAll at Base 2.3.3-4~dfsg
- FgrepAhoFindFirst at Base 2.3.3-4~dfsg
- FgrepAhoFree at Base 2.3.3-4~dfsg
- FgrepAhoMake at Base 2.3.3-4~dfsg
- FgrepBoyerFindAll at Base 2.3.3-4~dfsg
- FgrepBoyerFindFirst at Base 2.3.3-4~dfsg
- FgrepBoyerSearchFree at Base 2.3.3-4~dfsg
- FgrepBoyerSearchMake at Base 2.3.3-4~dfsg
- FgrepDumbFindAll at Base 2.3.3-4~dfsg
- FgrepDumbFindFirst at Base 2.3.3-4~dfsg
- FgrepDumbSearchFree at Base 2.3.3-4~dfsg
- FgrepDumbSearchMake at Base 2.3.3-4~dfsg
- FgrepFindFirst at Base 2.3.3-4~dfsg
- FgrepFree at Base 2.3.3-4~dfsg
- FgrepMake at Base 2.3.3-4~dfsg
- G_out_handler at Base 2.3.3-4~dfsg
- GetCacheCompleteness at Base 2.3.3-4~dfsg
- GetCacheTruncatedSize at Base 2.3.3-4~dfsg
- GetRCContextIdxText at Base 2.3.3-4~dfsg
- GetRCContextText at Base 2.3.3-4~dfsg
- GetRCFilename at Base 2.3.3-4~dfsg
- GetRCFunction at Base 2.3.3-4~dfsg
- GetRCLineno at Base 2.3.3-4~dfsg
- GetRCModuleIdxText at Base 2.3.3-4~dfsg
- GetRCModuleText at Base 2.3.3-4~dfsg
- GetRCObjectIdxText at Base 2.3.3-4~dfsg
- GetRCObjectText at Base 2.3.3-4~dfsg
- GetRCStateIdxText at Base 2.3.3-4~dfsg
- GetRCStateText at Base 2.3.3-4~dfsg
- GetRCTargetIdxText at Base 2.3.3-4~dfsg
- GetRCTargetText at Base 2.3.3-4~dfsg
- GetUnreadRCInfo at Base 2.3.3-4~dfsg
- INSDC_SEQ_rand_4na_2na at Base 2.3.3-4~dfsg
- INSDC_SRA_format_spot_name at Base 2.3.3-4~dfsg
- INSDC_SRA_format_spot_name_no_coord at Base 2.3.3-4~dfsg
- IUPAC_decode at Base 2.3.3-4~dfsg
- IlluminaReaderBase at Base 2.3.3-4~dfsg
- IlluminaReaderCurrentSpot at Base 2.3.3-4~dfsg
- IlluminaReaderFirstSpot at Base 2.3.3-4~dfsg
- IlluminaReaderIntensity at Base 2.3.3-4~dfsg
- IlluminaReaderMake at Base 2.3.3-4~dfsg
- IlluminaReaderNextSpot at Base 2.3.3-4~dfsg
- IlluminaReaderNoise at Base 2.3.3-4~dfsg
- IlluminaReaderQSeq at Base 2.3.3-4~dfsg
- IlluminaReaderQuality1 at Base 2.3.3-4~dfsg
- IlluminaReaderQuality4 at Base 2.3.3-4~dfsg
- IlluminaReaderSeekSpot at Base 2.3.3-4~dfsg
- IlluminaReaderSignal at Base 2.3.3-4~dfsg
- IlluminaReaderWhack at Base 2.3.3-4~dfsg
- IlluminaReader_SpotInfo at Base 2.3.3-4~dfsg
- IlluminaReader_SpotReadInfo at Base 2.3.3-4~dfsg
- IsCacheFileComplete at Base 2.3.3-4~dfsg
- Judy1ByCount at Base 2.3.3-4~dfsg
- Judy1Count at Base 2.3.3-4~dfsg
- Judy1First at Base 2.3.3-4~dfsg
- Judy1FirstEmpty at Base 2.3.3-4~dfsg
- Judy1FreeArray at Base 2.3.3-4~dfsg
- Judy1Last at Base 2.3.3-4~dfsg
- Judy1LastEmpty at Base 2.3.3-4~dfsg
- Judy1MallocSizes at Base 2.3.3-4~dfsg
- Judy1MemActive at Base 2.3.3-4~dfsg
- Judy1MemUsed at Base 2.3.3-4~dfsg
- Judy1Next at Base 2.3.3-4~dfsg
- Judy1NextEmpty at Base 2.3.3-4~dfsg
- Judy1Prev at Base 2.3.3-4~dfsg
- Judy1PrevEmpty at Base 2.3.3-4~dfsg
- Judy1Set at Base 2.3.3-4~dfsg
- Judy1SetArray at Base 2.3.3-4~dfsg
- Judy1Test at Base 2.3.3-4~dfsg
- Judy1Unset at Base 2.3.3-4~dfsg
- JudyFree at Base 2.3.3-4~dfsg
- JudyFreeVirtual at Base 2.3.3-4~dfsg
- JudyHSDel at Base 2.3.3-4~dfsg
- JudyHSFreeArray at Base 2.3.3-4~dfsg
- JudyHSGet at Base 2.3.3-4~dfsg
- JudyHSIns at Base 2.3.3-4~dfsg
- JudyLByCount at Base 2.3.3-4~dfsg
- JudyLCount at Base 2.3.3-4~dfsg
- JudyLDel at Base 2.3.3-4~dfsg
- JudyLFirst at Base 2.3.3-4~dfsg
- JudyLFirstEmpty at Base 2.3.3-4~dfsg
- JudyLFreeArray at Base 2.3.3-4~dfsg
- JudyLGet at Base 2.3.3-4~dfsg
- JudyLIns at Base 2.3.3-4~dfsg
- JudyLInsArray at Base 2.3.3-4~dfsg
- JudyLLast at Base 2.3.3-4~dfsg
- JudyLLastEmpty at Base 2.3.3-4~dfsg
- JudyLMallocSizes at Base 2.3.3-4~dfsg
- JudyLMemActive at Base 2.3.3-4~dfsg
- JudyLMemUsed at Base 2.3.3-4~dfsg
- JudyLNext at Base 2.3.3-4~dfsg
- JudyLNextEmpty at Base 2.3.3-4~dfsg
- JudyLPrev at Base 2.3.3-4~dfsg
- JudyLPrevEmpty at Base 2.3.3-4~dfsg
- JudyMalloc at Base 2.3.3-4~dfsg
- JudyMallocVirtual at Base 2.3.3-4~dfsg
- JudySLDel at Base 2.3.3-4~dfsg
- JudySLFirst at Base 2.3.3-4~dfsg
- JudySLFreeArray at Base 2.3.3-4~dfsg
- JudySLGet at Base 2.3.3-4~dfsg
- JudySLIns at Base 2.3.3-4~dfsg
- JudySLLast at Base 2.3.3-4~dfsg
- JudySLNext at Base 2.3.3-4~dfsg
- JudySLPrev at Base 2.3.3-4~dfsg
- KAESBlockCipherByteMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecRegMake at Base 2.3.3-4~dfsg
- KArcDirGetTOC at Base 2.3.3-4~dfsg
- KArcDirPersistHeader at Base 2.3.3-4~dfsg
- KArcParseKDir at Base 2.3.3-4~dfsg
- KArcParseSRA at Base 2.3.3-4~dfsg
- KArcParseSRAUnbounded at Base 2.3.3-4~dfsg
- KArcParseSRAUnbounded_silent at Base 2.3.3-4~dfsg
- KArcParseSRA_silent at Base 2.3.3-4~dfsg
- KArcParseTAR at Base 2.3.3-4~dfsg
- KArcParseTAR_silent at Base 2.3.3-4~dfsg
- KArrayFileAddRef at Base 2.3.3-4~dfsg
- KArrayFileDestroy at Base 2.3.3-4~dfsg
- KArrayFileDimExtents at Base 2.3.3-4~dfsg
- KArrayFileDimensionality at Base 2.3.3-4~dfsg
- KArrayFileElementSize at Base 2.3.3-4~dfsg
- KArrayFileGetMeta at Base 2.3.3-4~dfsg
- KArrayFileInit at Base 2.3.3-4~dfsg
- KArrayFileRead at Base 2.3.3-4~dfsg
- KArrayFileRead_v at Base 2.3.3-4~dfsg
- KArrayFileRelease at Base 2.3.3-4~dfsg
- KArrayFileSetDimExtents at Base 2.3.3-4~dfsg
- KArrayFileSetDimensionality at Base 2.3.3-4~dfsg
- KArrayFileWrite at Base 2.3.3-4~dfsg
- KBTreeAddRef at Base 2.3.3-4~dfsg
- KBTreeDropBacking at Base 2.3.3-4~dfsg
- KBTreeEntry at Base 2.3.3-4~dfsg
- KBTreeFind at Base 2.3.3-4~dfsg
- KBTreeForEach at Base 2.3.3-4~dfsg
- KBTreeMakeRead at Base 2.3.3-4~dfsg
- KBTreeMakeUpdate at Base 2.3.3-4~dfsg
- KBTreeRelease at Base 2.3.3-4~dfsg
- KBTreeSize at Base 2.3.3-4~dfsg
- KBufFileMakeRead at Base 2.3.3-4~dfsg
- KBufFileMakeWrite at Base 2.3.3-4~dfsg
- KBufReadFileMakeRead at Base 2.3.3-4~dfsg
- KBufWriteFileMakeWrite at Base 2.3.3-4~dfsg
- KCRC32FileBeginTransaction at Base 2.3.3-4~dfsg
- KCRC32FileCommit at Base 2.3.3-4~dfsg
- KCRC32FileMakeAppend at Base 2.3.3-4~dfsg
- KCRC32FileMakeWrite at Base 2.3.3-4~dfsg
- KCRC32FileReset at Base 2.3.3-4~dfsg
- KCRC32FileRevert at Base 2.3.3-4~dfsg
- KCRC32FileToKFile at Base 2.3.3-4~dfsg
- KCRC32FileToKFileConst at Base 2.3.3-4~dfsg
- KCRC32SumFmtAddRef at Base 2.3.3-4~dfsg
- KCRC32SumFmtCount at Base 2.3.3-4~dfsg
- KCRC32SumFmtDelete at Base 2.3.3-4~dfsg
- KCRC32SumFmtFind at Base 2.3.3-4~dfsg
- KCRC32SumFmtFlush at Base 2.3.3-4~dfsg
- KCRC32SumFmtGet at Base 2.3.3-4~dfsg
- KCRC32SumFmtMakeRead at Base 2.3.3-4~dfsg
- KCRC32SumFmtMakeUpdate at Base 2.3.3-4~dfsg
- KCRC32SumFmtRelease at Base 2.3.3-4~dfsg
- KCRC32SumFmtRename at Base 2.3.3-4~dfsg
- KCRC32SumFmtUpdate at Base 2.3.3-4~dfsg
- KCipherAddRef at Base 2.3.3-4~dfsg
- KCipherBlockSize at Base 2.3.3-4~dfsg
- KCipherByteClassName at Base 2.3.3-4~dfsg
- KCipherByteMake at Base 2.3.3-4~dfsg
- KCipherDecrypt at Base 2.3.3-4~dfsg
- KCipherDecryptCBC at Base 2.3.3-4~dfsg
- KCipherDecryptCFB at Base 2.3.3-4~dfsg
- KCipherDecryptCTR at Base 2.3.3-4~dfsg
- KCipherDecryptECB at Base 2.3.3-4~dfsg
- KCipherDecryptOFB at Base 2.3.3-4~dfsg
- KCipherDecryptPCBC at Base 2.3.3-4~dfsg
- KCipherDestroy at Base 2.3.3-4~dfsg
- KCipherEncrypt at Base 2.3.3-4~dfsg
- KCipherEncryptCBC at Base 2.3.3-4~dfsg
- KCipherEncryptCFB at Base 2.3.3-4~dfsg
- KCipherEncryptCTR at Base 2.3.3-4~dfsg
- KCipherEncryptECB at Base 2.3.3-4~dfsg
- KCipherEncryptOFB at Base 2.3.3-4~dfsg
- KCipherEncryptPCBC at Base 2.3.3-4~dfsg
- KCipherInit at Base 2.3.3-4~dfsg
- KCipherMake at Base 2.3.3-4~dfsg
- KCipherMakeInt at Base 2.3.3-4~dfsg
- KCipherManagerAddRef at Base 2.3.3-4~dfsg
- KCipherManagerDestroy at Base 2.3.3-4~dfsg
- KCipherManagerMake at Base 2.3.3-4~dfsg
- KCipherManagerMakeCipher at Base 2.3.3-4~dfsg
- KCipherManagerRelease at Base 2.3.3-4~dfsg
- KCipherRelease at Base 2.3.3-4~dfsg
- KCipherSetDecryptCtrFunc at Base 2.3.3-4~dfsg
- KCipherSetDecryptIVec at Base 2.3.3-4~dfsg
- KCipherSetDecryptKey at Base 2.3.3-4~dfsg
- KCipherSetEncryptCtrFunc at Base 2.3.3-4~dfsg
- KCipherSetEncryptIVec at Base 2.3.3-4~dfsg
- KCipherSetEncryptKey at Base 2.3.3-4~dfsg
- KCipherSubType at Base 2.3.3-4~dfsg
- KCipherVecAesNiClassName at Base 2.3.3-4~dfsg
- KCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KCipherVecClassName at Base 2.3.3-4~dfsg
- KCipherVecMake at Base 2.3.3-4~dfsg
- KCipherVecRegClassName at Base 2.3.3-4~dfsg
- KCipherVecRegMake at Base 2.3.3-4~dfsg
- KColBlockLocAllocSize at Base 2.3.3-4~dfsg
- KColBlockLocEntryCount at Base 2.3.3-4~dfsg
- KColIdxBlockInit at Base 2.3.3-4~dfsg
- KColumnAddRef at Base 2.3.3-4~dfsg
- KColumnAttach at Base 2.3.3-4~dfsg
- KColumnBlobAddRef at Base 2.3.3-4~dfsg
- KColumnBlobIdRange at Base 2.3.3-4~dfsg
- KColumnBlobRead at Base 2.3.3-4~dfsg
- KColumnBlobRelease at Base 2.3.3-4~dfsg
- KColumnBlobValidate at Base 2.3.3-4~dfsg
- KColumnByteOrder at Base 2.3.3-4~dfsg
- KColumnConsistencyCheck at Base 2.3.3-4~dfsg
- KColumnDataOpenRead at Base 2.3.3-4~dfsg
- KColumnDataRead at Base 2.3.3-4~dfsg
- KColumnDataWhack at Base 2.3.3-4~dfsg
- KColumnIdRange at Base 2.3.3-4~dfsg
- KColumnIdx0IdRange at Base 2.3.3-4~dfsg
- KColumnIdx0LocateBlob at Base 2.3.3-4~dfsg
- KColumnIdx0OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx0OpenRead_v1 at Base 2.3.3-4~dfsg
- KColumnIdx0Whack at Base 2.3.3-4~dfsg
- KColumnIdx1IdRange at Base 2.3.3-4~dfsg
- KColumnIdx1LocateBlock at Base 2.3.3-4~dfsg
- KColumnIdx1OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx1Whack at Base 2.3.3-4~dfsg
- KColumnIdx2LocateBlob at Base 2.3.3-4~dfsg
- KColumnIdx2OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx2Whack at Base 2.3.3-4~dfsg
- KColumnIdxIdRange at Base 2.3.3-4~dfsg
- KColumnIdxLocateBlob at Base 2.3.3-4~dfsg
- KColumnIdxOpenRead at Base 2.3.3-4~dfsg
- KColumnIdxWhack at Base 2.3.3-4~dfsg
- KColumnLocked at Base 2.3.3-4~dfsg
- KColumnOpenBlobRead at Base 2.3.3-4~dfsg
- KColumnOpenDirectoryRead at Base 2.3.3-4~dfsg
- KColumnOpenManagerRead at Base 2.3.3-4~dfsg
- KColumnOpenMetadataRead at Base 2.3.3-4~dfsg
- KColumnOpenParentRead at Base 2.3.3-4~dfsg
- KColumnPageMapId at Base 2.3.3-4~dfsg
- KColumnPageMapOpen at Base 2.3.3-4~dfsg
- KColumnPageMapWhack at Base 2.3.3-4~dfsg
- KColumnRelease at Base 2.3.3-4~dfsg
- KColumnSever at Base 2.3.3-4~dfsg
- KColumnVersion at Base 2.3.3-4~dfsg
- KConditionAddRef at Base 2.3.3-4~dfsg
- KConditionBroadcast at Base 2.3.3-4~dfsg
- KConditionDestroy at Base 2.3.3-4~dfsg
- KConditionDropRef at Base 2.3.3-4~dfsg
- KConditionInit at Base 2.3.3-4~dfsg
- KConditionMake at Base 2.3.3-4~dfsg
- KConditionRelease at Base 2.3.3-4~dfsg
- KConditionSignal at Base 2.3.3-4~dfsg
- KConditionTimedWait at Base 2.3.3-4~dfsg
- KConditionWait at Base 2.3.3-4~dfsg
- KConfigAddRef at Base 2.3.3-4~dfsg
- KConfigAppendToLoadPath at Base 2.3.3-4~dfsg
- KConfigCommit at Base 2.3.3-4~dfsg
- KConfigDisableUserSettings at Base 2.3.3-4~dfsg
- KConfigGetLoadPath at Base 2.3.3-4~dfsg
- KConfigImportNgc at Base 2.3.3-4~dfsg
- KConfigListIncluded at Base 2.3.3-4~dfsg
- KConfigLoadFile at Base 2.3.3-4~dfsg
- KConfigMake at Base 2.3.3-4~dfsg
- KConfigMakeLocal at Base 2.3.3-4~dfsg
- KConfigMakeRepositoryMgrRead at Base 2.3.3-4~dfsg
- KConfigMakeRepositoryMgrUpdate at Base 2.3.3-4~dfsg
- KConfigNodeAddRef at Base 2.3.3-4~dfsg
- KConfigNodeAppend at Base 2.3.3-4~dfsg
- KConfigNodeDropAll at Base 2.3.3-4~dfsg
- KConfigNodeDropAttr at Base 2.3.3-4~dfsg
- KConfigNodeDropChild at Base 2.3.3-4~dfsg
- KConfigNodeGetMgr at Base 2.3.3-4~dfsg
- KConfigNodeListChildren at Base 2.3.3-4~dfsg
- KConfigNodeOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeReadAttr at Base 2.3.3-4~dfsg
- KConfigNodeReadBool at Base 2.3.3-4~dfsg
- KConfigNodeReadF64 at Base 2.3.3-4~dfsg
- KConfigNodeReadI64 at Base 2.3.3-4~dfsg
- KConfigNodeReadString at Base 2.3.3-4~dfsg
- KConfigNodeReadU64 at Base 2.3.3-4~dfsg
- KConfigNodeReadVPath at Base 2.3.3-4~dfsg
- KConfigNodeRelease at Base 2.3.3-4~dfsg
- KConfigNodeRenameAttr at Base 2.3.3-4~dfsg
- KConfigNodeRenameChild at Base 2.3.3-4~dfsg
- KConfigNodeVDropChild at Base 2.3.3-4~dfsg
- KConfigNodeVOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigNodeWrite at Base 2.3.3-4~dfsg
- KConfigNodeWriteAttr at Base 2.3.3-4~dfsg
- KConfigOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigPrint at Base 2.3.3-4~dfsg
- KConfigReadBool at Base 2.3.3-4~dfsg
- KConfigReadF64 at Base 2.3.3-4~dfsg
- KConfigReadI64 at Base 2.3.3-4~dfsg
- KConfigReadString at Base 2.3.3-4~dfsg
- KConfigReadU64 at Base 2.3.3-4~dfsg
- KConfigReadVPath at Base 2.3.3-4~dfsg
- KConfigRelease at Base 2.3.3-4~dfsg
- KConfigVOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KCurlFileMake at Base 2.3.3-4~dfsg
- KCurlRequestAddField at Base 2.3.3-4~dfsg
- KCurlRequestAddFields at Base 2.3.3-4~dfsg
- KCurlRequestAddRef at Base 2.3.3-4~dfsg
- KCurlRequestAddSField at Base 2.3.3-4~dfsg
- KCurlRequestAddSFields at Base 2.3.3-4~dfsg
- KCurlRequestPerform at Base 2.3.3-4~dfsg
- KCurlRequestRelease at Base 2.3.3-4~dfsg
- KDBGetObjModDate at Base 2.3.3-4~dfsg
- KDBHdrValidate at Base 2.3.3-4~dfsg
- KDBIsLocked at Base 2.3.3-4~dfsg
- KDBIsPathUri at Base 2.3.3-4~dfsg
- KDBMakeSubPath at Base 2.3.3-4~dfsg
- KDBManagerAddRef at Base 2.3.3-4~dfsg
- KDBManagerAttach at Base 2.3.3-4~dfsg
- KDBManagerCheckOpen at Base 2.3.3-4~dfsg
- KDBManagerExists at Base 2.3.3-4~dfsg
- KDBManagerGetTableModDate at Base 2.3.3-4~dfsg
- KDBManagerGetVFSManager at Base 2.3.3-4~dfsg
- KDBManagerMake at Base 2.3.3-4~dfsg
- KDBManagerMakeRead at Base 2.3.3-4~dfsg
- KDBManagerMakeReadWithVFSManager at Base 2.3.3-4~dfsg
- KDBManagerOpenColumnRead at Base 2.3.3-4~dfsg
- KDBManagerOpenDBRead at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectAdd at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectBusy at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectDelete at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectFind at Base 2.3.3-4~dfsg
- KDBManagerOpenTableRead at Base 2.3.3-4~dfsg
- KDBManagerPathType at Base 2.3.3-4~dfsg
- KDBManagerPathTypeVP at Base 2.3.3-4~dfsg
- KDBManagerRelease at Base 2.3.3-4~dfsg
- KDBManagerResolvePathRelativeDir at Base 2.3.3-4~dfsg
- KDBManagerResolveVPathInt at Base 2.3.3-4~dfsg
- KDBManagerRunPeriodicTasks at Base 2.3.3-4~dfsg
- KDBManagerSever at Base 2.3.3-4~dfsg
- KDBManagerVExists at Base 2.3.3-4~dfsg
- KDBManagerVGetTableModDate at Base 2.3.3-4~dfsg
- KDBManagerVOpenColumnRead at Base 2.3.3-4~dfsg
- KDBManagerVOpenDBRead at Base 2.3.3-4~dfsg
- KDBManagerVOpenTableRead at Base 2.3.3-4~dfsg
- KDBManagerVPathType at Base 2.3.3-4~dfsg
- KDBManagerVResolvePath at Base 2.3.3-4~dfsg
- KDBManagerVResolvePathRelativeDir at Base 2.3.3-4~dfsg
- KDBManagerVResolveVPath at Base 2.3.3-4~dfsg
- KDBManagerVWritable at Base 2.3.3-4~dfsg
- KDBManagerVersion at Base 2.3.3-4~dfsg
- KDBManagerWritable at Base 2.3.3-4~dfsg
- KDBOpenPathTypeRead at Base 2.3.3-4~dfsg
- KDBPathType at Base 2.3.3-4~dfsg
- KDBPathTypeDir at Base 2.3.3-4~dfsg
- KDBVGetPathModDate at Base 2.3.3-4~dfsg
- KDBVMakeSubPath at Base 2.3.3-4~dfsg
- KDBWritable at Base 2.3.3-4~dfsg
- KDataBufferCast at Base 2.3.3-4~dfsg
- KDataBufferCheckIntegrity at Base 2.3.3-4~dfsg
- KDataBufferMake at Base 2.3.3-4~dfsg
- KDataBufferMakeWritable at Base 2.3.3-4~dfsg
- KDataBufferMemorySize at Base 2.3.3-4~dfsg
- KDataBufferPrintf at Base 2.3.3-4~dfsg
- KDataBufferResize at Base 2.3.3-4~dfsg
- KDataBufferShrink at Base 2.3.3-4~dfsg
- KDataBufferSub at Base 2.3.3-4~dfsg
- KDataBufferVPrintf at Base 2.3.3-4~dfsg
- KDataBufferWhack at Base 2.3.3-4~dfsg
- KDataBufferWritable at Base 2.3.3-4~dfsg
- KDatabaseAddRef at Base 2.3.3-4~dfsg
- KDatabaseAttach at Base 2.3.3-4~dfsg
- KDatabaseConsistencyCheck at Base 2.3.3-4~dfsg
- KDatabaseExists at Base 2.3.3-4~dfsg
- KDatabaseGetPath at Base 2.3.3-4~dfsg
- KDatabaseIsAlias at Base 2.3.3-4~dfsg
- KDatabaseListDB at Base 2.3.3-4~dfsg
- KDatabaseListIdx at Base 2.3.3-4~dfsg
- KDatabaseListTbl at Base 2.3.3-4~dfsg
- KDatabaseLocked at Base 2.3.3-4~dfsg
- KDatabaseModDate at Base 2.3.3-4~dfsg
- KDatabaseOpenDBRead at Base 2.3.3-4~dfsg
- KDatabaseOpenDirectoryRead at Base 2.3.3-4~dfsg
- KDatabaseOpenIndexRead at Base 2.3.3-4~dfsg
- KDatabaseOpenManagerRead at Base 2.3.3-4~dfsg
- KDatabaseOpenMetadataRead at Base 2.3.3-4~dfsg
- KDatabaseOpenParentRead at Base 2.3.3-4~dfsg
- KDatabaseOpenTableRead at Base 2.3.3-4~dfsg
- KDatabaseRelease at Base 2.3.3-4~dfsg
- KDatabaseSever at Base 2.3.3-4~dfsg
- KDatabaseVExists at Base 2.3.3-4~dfsg
- KDatabaseVOpenDBRead at Base 2.3.3-4~dfsg
- KDatabaseVOpenIndexRead at Base 2.3.3-4~dfsg
- KDatabaseVOpenTableRead at Base 2.3.3-4~dfsg
- KDatabaseVWritable at Base 2.3.3-4~dfsg
- KDatabaseWritable at Base 2.3.3-4~dfsg
- KDirectoryAccess at Base 2.3.3-4~dfsg
- KDirectoryAddRef at Base 2.3.3-4~dfsg
- KDirectoryClearDir at Base 2.3.3-4~dfsg
- KDirectoryCopy at Base 2.3.3-4~dfsg
- KDirectoryCopyPath at Base 2.3.3-4~dfsg
- KDirectoryCopyPaths at Base 2.3.3-4~dfsg
- KDirectoryCreateAlias at Base 2.3.3-4~dfsg
- KDirectoryCreateDir at Base 2.3.3-4~dfsg
- KDirectoryCreateExclusiveAccessFile at Base 2.3.3-4~dfsg
- KDirectoryCreateFile at Base 2.3.3-4~dfsg
- KDirectoryCreateLockFile at Base 2.3.3-4~dfsg
- KDirectoryDate at Base 2.3.3-4~dfsg
- KDirectoryDestroyFile at Base 2.3.3-4~dfsg
- KDirectoryFileContiguous at Base 2.3.3-4~dfsg
- KDirectoryFileLocator at Base 2.3.3-4~dfsg
- KDirectoryFilePhysicalSize at Base 2.3.3-4~dfsg
- KDirectoryFileSize at Base 2.3.3-4~dfsg
- KDirectoryGetSysDir at Base 2.3.3-4~dfsg
- KDirectoryInit at Base 2.3.3-4~dfsg
- KDirectoryList at Base 2.3.3-4~dfsg
- KDirectoryMakeCacheTee at Base 2.3.3-4~dfsg
- KDirectoryNativeDir at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenDirUpdate at Base 2.3.3-4~dfsg
- KDirectoryOpenFileRead at Base 2.3.3-4~dfsg
- KDirectoryOpenFileWrite at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveReadUnbounded at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveReadUnbounded_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenTocFileRead at Base 2.3.3-4~dfsg
- KDirectoryOpenXTocDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenXTocDirReadDir at Base 2.3.3-4~dfsg
- KDirectoryPathType at Base 2.3.3-4~dfsg
- KDirectoryRelease at Base 2.3.3-4~dfsg
- KDirectoryRemove at Base 2.3.3-4~dfsg
- KDirectoryRename at Base 2.3.3-4~dfsg
- KDirectoryResolveAlias at Base 2.3.3-4~dfsg
- KDirectoryResolvePath at Base 2.3.3-4~dfsg
- KDirectorySetAccess at Base 2.3.3-4~dfsg
- KDirectorySetDate at Base 2.3.3-4~dfsg
- KDirectorySetFileSize at Base 2.3.3-4~dfsg
- KDirectoryToKArcDir at Base 2.3.3-4~dfsg
- KDirectoryVAccess at Base 2.3.3-4~dfsg
- KDirectoryVClearDir at Base 2.3.3-4~dfsg
- KDirectoryVCreateDir at Base 2.3.3-4~dfsg
- KDirectoryVCreateExclusiveAccessFile at Base 2.3.3-4~dfsg
- KDirectoryVCreateFile at Base 2.3.3-4~dfsg
- KDirectoryVCreateLockFile at Base 2.3.3-4~dfsg
- KDirectoryVDate at Base 2.3.3-4~dfsg
- KDirectoryVFileContiguous at Base 2.3.3-4~dfsg
- KDirectoryVFileLocator at Base 2.3.3-4~dfsg
- KDirectoryVFilePhysicalSize at Base 2.3.3-4~dfsg
- KDirectoryVFileSize at Base 2.3.3-4~dfsg
- KDirectoryVList at Base 2.3.3-4~dfsg
- KDirectoryVMakeCacheTee at Base 2.3.3-4~dfsg
- KDirectoryVOpenDirRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenDirUpdate at Base 2.3.3-4~dfsg
- KDirectoryVOpenFileRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenFileWrite at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveReadUnbounded at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveReadUnbounded_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryVOpenXTocDirRead at Base 2.3.3-4~dfsg
- KDirectoryVPathType at Base 2.3.3-4~dfsg
- KDirectoryVRemove at Base 2.3.3-4~dfsg
- KDirectoryVResolveAlias at Base 2.3.3-4~dfsg
- KDirectoryVResolvePath at Base 2.3.3-4~dfsg
- KDirectoryVSetAccess at Base 2.3.3-4~dfsg
- KDirectoryVSetDate at Base 2.3.3-4~dfsg
- KDirectoryVSetFileSize at Base 2.3.3-4~dfsg
- KDirectoryVVisit at Base 2.3.3-4~dfsg
- KDirectoryVVisitUpdate at Base 2.3.3-4~dfsg
- KDirectoryVisit at Base 2.3.3-4~dfsg
- KDirectoryVisitUpdate at Base 2.3.3-4~dfsg
- KDlsetAddAll at Base 2.3.3-4~dfsg
- KDlsetAddLib at Base 2.3.3-4~dfsg
- KDlsetAddRef at Base 2.3.3-4~dfsg
- KDlsetFirstSymbol at Base 2.3.3-4~dfsg
- KDlsetLastSymbol at Base 2.3.3-4~dfsg
- KDlsetList at Base 2.3.3-4~dfsg
- KDlsetRelease at Base 2.3.3-4~dfsg
- KDlsetSymbol at Base 2.3.3-4~dfsg
- KDualRefAdd at Base 2.3.3-4~dfsg
- KDualRefAddDep at Base 2.3.3-4~dfsg
- KDualRefDrop at Base 2.3.3-4~dfsg
- KDualRefDropDep at Base 2.3.3-4~dfsg
- KDualRefInit at Base 2.3.3-4~dfsg
- KDualRefWhack at Base 2.3.3-4~dfsg
- KDyldAddRef at Base 2.3.3-4~dfsg
- KDyldAddSearchPath at Base 2.3.3-4~dfsg
- KDyldHomeDirectory at Base 2.3.3-4~dfsg
- KDyldLoadLib at Base 2.3.3-4~dfsg
- KDyldMake at Base 2.3.3-4~dfsg
- KDyldMakeSet at Base 2.3.3-4~dfsg
- KDyldRelease at Base 2.3.3-4~dfsg
- KDyldVAddSearchPath at Base 2.3.3-4~dfsg
- KDyldVLoadLib at Base 2.3.3-4~dfsg
- KDylibAddRef at Base 2.3.3-4~dfsg
- KDylibFullPath at Base 2.3.3-4~dfsg
- KDylibRelease at Base 2.3.3-4~dfsg
- KDylibSymbol at Base 2.3.3-4~dfsg
- KEncFileFooterWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileHeaderWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeBlock_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeRead at Base 2.3.3-4~dfsg
- KEncFileMakeRead_v1 at Base 2.3.3-4~dfsg
- KEncFileMakeRead_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeUpdate at Base 2.3.3-4~dfsg
- KEncFileMakeUpdate_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeWrite at Base 2.3.3-4~dfsg
- KEncFileMakeWriteBlock at Base 2.3.3-4~dfsg
- KEncFileMakeWrite_v1 at Base 2.3.3-4~dfsg
- KEncFileMakeWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileV1MakeUpdate_v1 at Base 2.3.3-4~dfsg
- KEncFileV1Validate_v1 at Base 2.3.3-4~dfsg
- KEncFileV1WriteHeader_v1 at Base 2.3.3-4~dfsg
- KEncFileValidate at Base 2.3.3-4~dfsg
- KEncFileValidate_v2 at Base 2.3.3-4~dfsg
- KEncFileWriteHeader at Base 2.3.3-4~dfsg
- KEncFileWriteHeader_v2 at Base 2.3.3-4~dfsg
- KEncryptFileMakeRead at Base 2.3.3-4~dfsg
- KEncryptionKeyAddRef at Base 2.3.3-4~dfsg
- KEncryptionKeyMake at Base 2.3.3-4~dfsg
- KEncryptionKeyRelease at Base 2.3.3-4~dfsg
- KEntrezFetcherAddRef at Base 2.3.3-4~dfsg
- KEntrezFetcherMake at Base 2.3.3-4~dfsg
- KEntrezFetcherRead at Base 2.3.3-4~dfsg
- KEntrezFetcherRelease at Base 2.3.3-4~dfsg
- KEntrezFetcherSetup at Base 2.3.3-4~dfsg
- KEntrezFetcherSetupUri at Base 2.3.3-4~dfsg
- KFGScan_set_debug at Base 2.3.3-4~dfsg
- KFGScan_yylex at Base 2.3.3-4~dfsg
- KFGScan_yylex_destroy at Base 2.3.3-4~dfsg
- KFGScan_yylex_init at Base 2.3.3-4~dfsg
- KFG_error at Base 2.3.3-4~dfsg
- KFG_parse at Base 2.3.3-4~dfsg
- KFileAddRef at Base 2.3.3-4~dfsg
- KFileDestroy at Base 2.3.3-4~dfsg
- KFileGetSysFile at Base 2.3.3-4~dfsg
- KFileInit at Base 2.3.3-4~dfsg
- KFileIsEnc at Base 2.3.3-4~dfsg
- KFileIsEnc_v1 at Base 2.3.3-4~dfsg
- KFileIsEnc_v2 at Base 2.3.3-4~dfsg
- KFileIsSRA at Base 2.3.3-4~dfsg
- KFileIsSraEnc at Base 2.3.3-4~dfsg
- KFileIsWGAEnc at Base 2.3.3-4~dfsg
- KFileMakeBzip2ForRead at Base 2.3.3-4~dfsg
- KFileMakeBzip2ForWrite at Base 2.3.3-4~dfsg
- KFileMakeCRC32Read at Base 2.3.3-4~dfsg
- KFileMakeCounterRead at Base 2.3.3-4~dfsg
- KFileMakeCounterUpdate at Base 2.3.3-4~dfsg
- KFileMakeCounterWrite at Base 2.3.3-4~dfsg
- KFileMakeFDFileRead at Base 2.3.3-4~dfsg
- KFileMakeFDFileWrite at Base 2.3.3-4~dfsg
- KFileMakeGzipForRead at Base 2.3.3-4~dfsg
- KFileMakeGzipForWrite at Base 2.3.3-4~dfsg
- KFileMakeMD5Read at Base 2.3.3-4~dfsg
- KFileMakeNewCRC32Read at Base 2.3.3-4~dfsg
- KFileMakeNewMD5Read at Base 2.3.3-4~dfsg
- KFileMakeNullRead at Base 2.3.3-4~dfsg
- KFileMakeNullUpdate at Base 2.3.3-4~dfsg
- KFileMakeReadHead at Base 2.3.3-4~dfsg
- KFileMakeStdErr at Base 2.3.3-4~dfsg
- KFileMakeStdIn at Base 2.3.3-4~dfsg
- KFileMakeStdOut at Base 2.3.3-4~dfsg
- KFileMakeSubRead at Base 2.3.3-4~dfsg
- KFileMakeSubUpdate at Base 2.3.3-4~dfsg
- KFileMakeTeeRead at Base 2.3.3-4~dfsg
- KFileMakeTeeUpdate at Base 2.3.3-4~dfsg
- KFileMakeWGAEncRead at Base 2.3.3-4~dfsg
- KFileRandomAccess at Base 2.3.3-4~dfsg
- KFileRead at Base 2.3.3-4~dfsg
- KFileReadAll at Base 2.3.3-4~dfsg
- KFileRelease at Base 2.3.3-4~dfsg
- KFileSetSize at Base 2.3.3-4~dfsg
- KFileSize at Base 2.3.3-4~dfsg
- KFileType at Base 2.3.3-4~dfsg
- KFileWrite at Base 2.3.3-4~dfsg
- KFileWriteAll at Base 2.3.3-4~dfsg
- KHttpAddRef at Base 2.3.3-4~dfsg
- KHttpGetHeaderLine at Base 2.3.3-4~dfsg
- KHttpGetStatusLine at Base 2.3.3-4~dfsg
- KHttpHeaderWhack at Base 2.3.3-4~dfsg
- KHttpMakeRequest at Base 2.3.3-4~dfsg
- KHttpRelease at Base 2.3.3-4~dfsg
- KHttpRequestAddHeader at Base 2.3.3-4~dfsg
- KHttpRequestAddPostParam at Base 2.3.3-4~dfsg
- KHttpRequestAddRef at Base 2.3.3-4~dfsg
- KHttpRequestByteRange at Base 2.3.3-4~dfsg
- KHttpRequestConnection at Base 2.3.3-4~dfsg
- KHttpRequestGET at Base 2.3.3-4~dfsg
- KHttpRequestHEAD at Base 2.3.3-4~dfsg
- KHttpRequestPOST at Base 2.3.3-4~dfsg
- KHttpRequestRelease at Base 2.3.3-4~dfsg
- KHttpRequestVAddPostParam at Base 2.3.3-4~dfsg
- KHttpResultAddHeader at Base 2.3.3-4~dfsg
- KHttpResultAddRef at Base 2.3.3-4~dfsg
- KHttpResultGetHeader at Base 2.3.3-4~dfsg
- KHttpResultGetInputStream at Base 2.3.3-4~dfsg
- KHttpResultKeepAlive at Base 2.3.3-4~dfsg
- KHttpResultRange at Base 2.3.3-4~dfsg
- KHttpResultRelease at Base 2.3.3-4~dfsg
- KHttpResultSize at Base 2.3.3-4~dfsg
- KHttpResultStatus at Base 2.3.3-4~dfsg
- KHttpVMakeRequest at Base 2.3.3-4~dfsg
- KIdStatsInit at Base 2.3.3-4~dfsg
- KIdStatsInsert at Base 2.3.3-4~dfsg
- KIdStatsWhack at Base 2.3.3-4~dfsg
- KIndexAddRef at Base 2.3.3-4~dfsg
- KIndexConsistencyCheck at Base 2.3.3-4~dfsg
- KIndexFindAllText at Base 2.3.3-4~dfsg
- KIndexFindAllU64 at Base 2.3.3-4~dfsg
- KIndexFindText at Base 2.3.3-4~dfsg
- KIndexFindU64 at Base 2.3.3-4~dfsg
- KIndexLocked at Base 2.3.3-4~dfsg
- KIndexProjectAllText at Base 2.3.3-4~dfsg
- KIndexProjectText at Base 2.3.3-4~dfsg
- KIndexRelease at Base 2.3.3-4~dfsg
- KIndexSetMaxRowId at Base 2.3.3-4~dfsg
- KIndexType at Base 2.3.3-4~dfsg
- KIndexVersion at Base 2.3.3-4~dfsg
- KKeyInitHex at Base 2.3.3-4~dfsg
- KKeyInitRead at Base 2.3.3-4~dfsg
- KKeyInitUpdate at Base 2.3.3-4~dfsg
- KKeyRingAddRef at Base 2.3.3-4~dfsg
- KKeyRingIsServerRunning at Base 2.3.3-4~dfsg
- KKeyRingMakeRead at Base 2.3.3-4~dfsg
- KKeyRingMakeUpdate at Base 2.3.3-4~dfsg
- KKeyRingRelease at Base 2.3.3-4~dfsg
- KKeyStoreAddRef at Base 2.3.3-4~dfsg
- KKeyStoreGetBindingsFile at Base 2.3.3-4~dfsg
- KKeyStoreGetKey at Base 2.3.3-4~dfsg
- KKeyStoreGetObjectName at Base 2.3.3-4~dfsg
- KKeyStoreMake at Base 2.3.3-4~dfsg
- KKeyStoreRegisterObject at Base 2.3.3-4~dfsg
- KKeyStoreRelease at Base 2.3.3-4~dfsg
- KKeyStoreSetBindingsFile at Base 2.3.3-4~dfsg
- KKeyStoreSetConfig at Base 2.3.3-4~dfsg
- KKeyStoreSetTemporaryKeyFromFile at Base 2.3.3-4~dfsg
- KLockAcquire at Base 2.3.3-4~dfsg
- KLockAddRef at Base 2.3.3-4~dfsg
- KLockFileAddRef at Base 2.3.3-4~dfsg
- KLockFileRelease at Base 2.3.3-4~dfsg
- KLockMake at Base 2.3.3-4~dfsg
- KLockRelease at Base 2.3.3-4~dfsg
- KLockTimedAcquire at Base 2.3.3-4~dfsg
- KLockUnlock at Base 2.3.3-4~dfsg
- KLogDataGet at Base 2.3.3-4~dfsg
- KLogDefaultFormatter at Base 2.3.3-4~dfsg
- KLogFmtDataGet at Base 2.3.3-4~dfsg
- KLogFmtFlagsGet at Base 2.3.3-4~dfsg
- KLogFmtFlagsSet at Base 2.3.3-4~dfsg
- KLogFmtHandlerGet at Base 2.3.3-4~dfsg
- KLogFmtHandlerSet at Base 2.3.3-4~dfsg
- KLogFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KLogFmtWriterGet at Base 2.3.3-4~dfsg
- KLogGetParamStrings at Base 2.3.3-4~dfsg
- KLogHandlerGet at Base 2.3.3-4~dfsg
- KLogHandlerSet at Base 2.3.3-4~dfsg
- KLogHandlerSetStdErr at Base 2.3.3-4~dfsg
- KLogHandlerSetStdOut at Base 2.3.3-4~dfsg
- KLogInit at Base 2.3.3-4~dfsg
- KLogLastErrorCode at Base 2.3.3-4~dfsg
- KLogLastErrorCodeReset at Base 2.3.3-4~dfsg
- KLogLastErrorCodeSet at Base 2.3.3-4~dfsg
- KLogLevelAdjust at Base 2.3.3-4~dfsg
- KLogLevelExplain at Base 2.3.3-4~dfsg
- KLogLevelGet at Base 2.3.3-4~dfsg
- KLogLevelSet at Base 2.3.3-4~dfsg
- KLogLibDataGet at Base 2.3.3-4~dfsg
- KLogLibFmtDataGet at Base 2.3.3-4~dfsg
- KLogLibFmtFlagsGet at Base 2.3.3-4~dfsg
- KLogLibFmtFlagsSet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerGet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerSet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KLogLibFmtWriterGet at Base 2.3.3-4~dfsg
- KLogLibHandlerGet at Base 2.3.3-4~dfsg
- KLogLibHandlerSet at Base 2.3.3-4~dfsg
- KLogLibHandlerSetStdErr at Base 2.3.3-4~dfsg
- KLogLibHandlerSetStdOut at Base 2.3.3-4~dfsg
- KLogLibWriterGet at Base 2.3.3-4~dfsg
- KLogWriterGet at Base 2.3.3-4~dfsg
- KMD5FileBeginTransaction at Base 2.3.3-4~dfsg
- KMD5FileCommit at Base 2.3.3-4~dfsg
- KMD5FileMakeAppend at Base 2.3.3-4~dfsg
- KMD5FileMakeWrite at Base 2.3.3-4~dfsg
- KMD5FileReset at Base 2.3.3-4~dfsg
- KMD5FileRevert at Base 2.3.3-4~dfsg
- KMD5FileToKFile at Base 2.3.3-4~dfsg
- KMD5FileToKFileConst at Base 2.3.3-4~dfsg
- KMD5SumFmtAddRef at Base 2.3.3-4~dfsg
- KMD5SumFmtCount at Base 2.3.3-4~dfsg
- KMD5SumFmtDelete at Base 2.3.3-4~dfsg
- KMD5SumFmtFind at Base 2.3.3-4~dfsg
- KMD5SumFmtFlush at Base 2.3.3-4~dfsg
- KMD5SumFmtGet at Base 2.3.3-4~dfsg
- KMD5SumFmtMakeRead at Base 2.3.3-4~dfsg
- KMD5SumFmtMakeUpdate at Base 2.3.3-4~dfsg
- KMD5SumFmtRelease at Base 2.3.3-4~dfsg
- KMD5SumFmtRename at Base 2.3.3-4~dfsg
- KMD5SumFmtUpdate at Base 2.3.3-4~dfsg
- KMDataNodeAddRef at Base 2.3.3-4~dfsg
- KMDataNodeAddr at Base 2.3.3-4~dfsg
- KMDataNodeByteOrder at Base 2.3.3-4~dfsg
- KMDataNodeFillSchema at Base 2.3.3-4~dfsg
- KMDataNodeListAttr at Base 2.3.3-4~dfsg
- KMDataNodeListChildren at Base 2.3.3-4~dfsg
- KMDataNodeOpenNodeRead at Base 2.3.3-4~dfsg
- KMDataNodeRead at Base 2.3.3-4~dfsg
- KMDataNodeReadAsF64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttr at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsF64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU64 at Base 2.3.3-4~dfsg
- KMDataNodeReadB128 at Base 2.3.3-4~dfsg
- KMDataNodeReadB16 at Base 2.3.3-4~dfsg
- KMDataNodeReadB32 at Base 2.3.3-4~dfsg
- KMDataNodeReadB64 at Base 2.3.3-4~dfsg
- KMDataNodeReadB8 at Base 2.3.3-4~dfsg
- KMDataNodeReadCString at Base 2.3.3-4~dfsg
- KMDataNodeRelease at Base 2.3.3-4~dfsg
- KMDataNodeVOpenNodeRead at Base 2.3.3-4~dfsg
- KMMapAddRef at Base 2.3.3-4~dfsg
- KMMapAddrRead at Base 2.3.3-4~dfsg
- KMMapAddrUpdate at Base 2.3.3-4~dfsg
- KMMapMake at Base 2.3.3-4~dfsg
- KMMapMakeMaxRead at Base 2.3.3-4~dfsg
- KMMapMakeMaxUpdate at Base 2.3.3-4~dfsg
- KMMapMakeRead at Base 2.3.3-4~dfsg
- KMMapMakeRgnRead at Base 2.3.3-4~dfsg
- KMMapMakeRgnUpdate at Base 2.3.3-4~dfsg
- KMMapMakeUpdate at Base 2.3.3-4~dfsg
- KMMapPosition at Base 2.3.3-4~dfsg
- KMMapROSys at Base 2.3.3-4~dfsg
- KMMapRWSys at Base 2.3.3-4~dfsg
- KMMapRelease at Base 2.3.3-4~dfsg
- KMMapReposition at Base 2.3.3-4~dfsg
- KMMapSize at Base 2.3.3-4~dfsg
- KMMapUnmap at Base 2.3.3-4~dfsg
- KMemBankAddRef at Base 2.3.3-4~dfsg
- KMemBankAlloc at Base 2.3.3-4~dfsg
- KMemBankFree at Base 2.3.3-4~dfsg
- KMemBankMake at Base 2.3.3-4~dfsg
- KMemBankRead at Base 2.3.3-4~dfsg
- KMemBankRelease at Base 2.3.3-4~dfsg
- KMemBankSetSize at Base 2.3.3-4~dfsg
- KMemBankSize at Base 2.3.3-4~dfsg
- KMemBankWrite at Base 2.3.3-4~dfsg
- KMetadataAddRef at Base 2.3.3-4~dfsg
- KMetadataByteOrder at Base 2.3.3-4~dfsg
- KMetadataGetSequence at Base 2.3.3-4~dfsg
- KMetadataMaxRevision at Base 2.3.3-4~dfsg
- KMetadataOpenNodeRead at Base 2.3.3-4~dfsg
- KMetadataOpenRevision at Base 2.3.3-4~dfsg
- KMetadataRelease at Base 2.3.3-4~dfsg
- KMetadataRevision at Base 2.3.3-4~dfsg
- KMetadataVOpenNodeRead at Base 2.3.3-4~dfsg
- KMetadataVersion at Base 2.3.3-4~dfsg
- KNSListen at Base 2.3.3-4~dfsg
- KNSMakeConnection at Base 2.3.3-4~dfsg
- KNSMakeIPCConnection at Base 2.3.3-4~dfsg
- KNSMakeListener at Base 2.3.3-4~dfsg
- KNSManagerAddRef at Base 2.3.3-4~dfsg
- KNSManagerAvail at Base 2.3.3-4~dfsg
- KNSManagerCleanup at Base 2.3.3-4~dfsg
- KNSManagerCurlVersion at Base 2.3.3-4~dfsg
- KNSManagerInit at Base 2.3.3-4~dfsg
- KNSManagerInitDNSEndpoint at Base 2.3.3-4~dfsg
- KNSManagerInitIPCEndpoint at Base 2.3.3-4~dfsg
- KNSManagerInitIPv4Endpoint at Base 2.3.3-4~dfsg
- KNSManagerMake at Base 2.3.3-4~dfsg
- KNSManagerMakeCurlRequest at Base 2.3.3-4~dfsg
- KNSManagerMakeHttp at Base 2.3.3-4~dfsg
- KNSManagerMakeHttpFile at Base 2.3.3-4~dfsg
- KNSManagerMakeRequest at Base 2.3.3-4~dfsg
- KNSManagerRelease at Base 2.3.3-4~dfsg
- KNSManagerVMakeHttpFile at Base 2.3.3-4~dfsg
- KNamelistAddRef at Base 2.3.3-4~dfsg
- KNamelistCount at Base 2.3.3-4~dfsg
- KNamelistGet at Base 2.3.3-4~dfsg
- KNamelistInit at Base 2.3.3-4~dfsg
- KNamelistRelease at Base 2.3.3-4~dfsg
- KNullBlockCipherByteMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecRegMake at Base 2.3.3-4~dfsg
- KOutDataGet at Base 2.3.3-4~dfsg
- KOutHandlerGet at Base 2.3.3-4~dfsg
- KOutHandlerSet at Base 2.3.3-4~dfsg
- KOutHandlerSetStdErr at Base 2.3.3-4~dfsg
- KOutHandlerSetStdOut at Base 2.3.3-4~dfsg
- KOutInit at Base 2.3.3-4~dfsg
- KOutMsg at Base 2.3.3-4~dfsg
- KOutWriterGet at Base 2.3.3-4~dfsg
- KPTrieIndexCheckConsistency_v1 at Base 2.3.3-4~dfsg
- KPTrieIndexCheckConsistency_v2 at Base 2.3.3-4~dfsg
- KPTrieIndexID2Ord_v2 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v1 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v2 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v3_v4 at Base 2.3.3-4~dfsg
- KPTrieIndexWhack_v1 at Base 2.3.3-4~dfsg
- KPTrieIndexWhack_v2 at Base 2.3.3-4~dfsg
- KPageAccessRead at Base 2.3.3-4~dfsg
- KPageAccessUpdate at Base 2.3.3-4~dfsg
- KPageAddRef at Base 2.3.3-4~dfsg
- KPageConstSize at Base 2.3.3-4~dfsg
- KPageFileAddRef at Base 2.3.3-4~dfsg
- KPageFileAlloc at Base 2.3.3-4~dfsg
- KPageFileDropBacking at Base 2.3.3-4~dfsg
- KPageFileGet at Base 2.3.3-4~dfsg
- KPageFileMakeRead at Base 2.3.3-4~dfsg
- KPageFileMakeUpdate at Base 2.3.3-4~dfsg
- KPageFilePosGet at Base 2.3.3-4~dfsg
- KPageFileRelease at Base 2.3.3-4~dfsg
- KPageFileSetSize at Base 2.3.3-4~dfsg
- KPageFileSize at Base 2.3.3-4~dfsg
- KPageId at Base 2.3.3-4~dfsg
- KPageRelease at Base 2.3.3-4~dfsg
- KProcMgrAddCleanupTask at Base 2.3.3-4~dfsg
- KProcMgrAddRef at Base 2.3.3-4~dfsg
- KProcMgrInit at Base 2.3.3-4~dfsg
- KProcMgrMakeSingleton at Base 2.3.3-4~dfsg
- KProcMgrRelease at Base 2.3.3-4~dfsg
- KProcMgrRemoveCleanupTask at Base 2.3.3-4~dfsg
- KProcMgrWhack at Base 2.3.3-4~dfsg
- KQueueAddRef at Base 2.3.3-4~dfsg
- KQueueMake at Base 2.3.3-4~dfsg
- KQueuePop at Base 2.3.3-4~dfsg
- KQueuePush at Base 2.3.3-4~dfsg
- KQueueRelease at Base 2.3.3-4~dfsg
- KQueueSeal at Base 2.3.3-4~dfsg
- KQueueSealed at Base 2.3.3-4~dfsg
- KQuickMountDirMake at Base 2.3.3-4~dfsg
- KRWLockAcquireExcl at Base 2.3.3-4~dfsg
- KRWLockAcquireShared at Base 2.3.3-4~dfsg
- KRWLockAddRef at Base 2.3.3-4~dfsg
- KRWLockMake at Base 2.3.3-4~dfsg
- KRWLockRelease at Base 2.3.3-4~dfsg
- KRWLockTimedAcquireExcl at Base 2.3.3-4~dfsg
- KRWLockTimedAcquireShared at Base 2.3.3-4~dfsg
- KRWLockUnlock at Base 2.3.3-4~dfsg
- KRamFileMakeRead at Base 2.3.3-4~dfsg
- KRamFileMakeUpdate at Base 2.3.3-4~dfsg
- KRamFileMakeWrite at Base 2.3.3-4~dfsg
- KReencFileMakeRead at Base 2.3.3-4~dfsg
- KReencFileMakeWrite at Base 2.3.3-4~dfsg
- KRefcountAdd at Base 2.3.3-4~dfsg
- KRefcountAddDep at Base 2.3.3-4~dfsg
- KRefcountDrop at Base 2.3.3-4~dfsg
- KRefcountDropDep at Base 2.3.3-4~dfsg
- KRefcountInit at Base 2.3.3-4~dfsg
- KRefcountWhack at Base 2.3.3-4~dfsg
- KRepositoryAddRef at Base 2.3.3-4~dfsg
- KRepositoryCacheEnabled at Base 2.3.3-4~dfsg
- KRepositoryCategory at Base 2.3.3-4~dfsg
- KRepositoryDescription at Base 2.3.3-4~dfsg
- KRepositoryDisabled at Base 2.3.3-4~dfsg
- KRepositoryDisplayName at Base 2.3.3-4~dfsg
- KRepositoryDownloadTicket at Base 2.3.3-4~dfsg
- KRepositoryEncryptionKey at Base 2.3.3-4~dfsg
- KRepositoryEncryptionKeyFile at Base 2.3.3-4~dfsg
- KRepositoryMakeResolver at Base 2.3.3-4~dfsg
- KRepositoryMgrAddRef at Base 2.3.3-4~dfsg
- KRepositoryMgrCurrentProtectedRepository at Base 2.3.3-4~dfsg
- KRepositoryMgrGetProtectedRepository at Base 2.3.3-4~dfsg
- KRepositoryMgrRelease at Base 2.3.3-4~dfsg
- KRepositoryMgrRemoteRepositories at Base 2.3.3-4~dfsg
- KRepositoryMgrSiteRepositories at Base 2.3.3-4~dfsg
- KRepositoryMgrUserRepositories at Base 2.3.3-4~dfsg
- KRepositoryName at Base 2.3.3-4~dfsg
- KRepositoryRelease at Base 2.3.3-4~dfsg
- KRepositoryRoot at Base 2.3.3-4~dfsg
- KRepositorySetDisabled at Base 2.3.3-4~dfsg
- KRepositorySubCategory at Base 2.3.3-4~dfsg
- KRepositoryVectorWhack at Base 2.3.3-4~dfsg
- KSemaphoreAddRef at Base 2.3.3-4~dfsg
- KSemaphoreAlloc at Base 2.3.3-4~dfsg
- KSemaphoreCancel at Base 2.3.3-4~dfsg
- KSemaphoreCount at Base 2.3.3-4~dfsg
- KSemaphoreFree at Base 2.3.3-4~dfsg
- KSemaphoreMake at Base 2.3.3-4~dfsg
- KSemaphoreRelease at Base 2.3.3-4~dfsg
- KSemaphoreSignal at Base 2.3.3-4~dfsg
- KSemaphoreTimedAlloc at Base 2.3.3-4~dfsg
- KSemaphoreTimedWait at Base 2.3.3-4~dfsg
- KSemaphoreWait at Base 2.3.3-4~dfsg
- KSocketAddRef at Base 2.3.3-4~dfsg
- KSocketRelease at Base 2.3.3-4~dfsg
- KSocketWhack at Base 2.3.3-4~dfsg
- KStreamAddRef at Base 2.3.3-4~dfsg
- KStreamFromKFilePair at Base 2.3.3-4~dfsg
- KStreamFromKStreamPair at Base 2.3.3-4~dfsg
- KStreamInit at Base 2.3.3-4~dfsg
- KStreamMakeStdErr at Base 2.3.3-4~dfsg
- KStreamMakeStdIn at Base 2.3.3-4~dfsg
- KStreamMakeStdOut at Base 2.3.3-4~dfsg
- KStreamRead at Base 2.3.3-4~dfsg
- KStreamReadAll at Base 2.3.3-4~dfsg
- KStreamRelease at Base 2.3.3-4~dfsg
- KStreamWrite at Base 2.3.3-4~dfsg
- KStreamWriteAll at Base 2.3.3-4~dfsg
- KStsDataGet at Base 2.3.3-4~dfsg
- KStsFmtDataGet at Base 2.3.3-4~dfsg
- KStsFmtFlagsGet at Base 2.3.3-4~dfsg
- KStsFmtFlagsSet at Base 2.3.3-4~dfsg
- KStsFmtHandlerGet at Base 2.3.3-4~dfsg
- KStsFmtHandlerSet at Base 2.3.3-4~dfsg
- KStsFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KStsFmtWriterGet at Base 2.3.3-4~dfsg
- KStsHandlerGet at Base 2.3.3-4~dfsg
- KStsHandlerSet at Base 2.3.3-4~dfsg
- KStsHandlerSetStdErr at Base 2.3.3-4~dfsg
- KStsHandlerSetStdOut at Base 2.3.3-4~dfsg
- KStsInit at Base 2.3.3-4~dfsg
- KStsLevelAdjust at Base 2.3.3-4~dfsg
- KStsLevelGet at Base 2.3.3-4~dfsg
- KStsLevelSet at Base 2.3.3-4~dfsg
- KStsLibDataGet at Base 2.3.3-4~dfsg
- KStsLibFmtDataGet at Base 2.3.3-4~dfsg
- KStsLibFmtFlagsGet at Base 2.3.3-4~dfsg
- KStsLibFmtFlagsSet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerGet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerSet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KStsLibFmtWriterGet at Base 2.3.3-4~dfsg
- KStsLibHandlerGet at Base 2.3.3-4~dfsg
- KStsLibHandlerSet at Base 2.3.3-4~dfsg
- KStsLibHandlerSetStdErr at Base 2.3.3-4~dfsg
- KStsLibHandlerSetStdOut at Base 2.3.3-4~dfsg
- KStsLibMsg at Base 2.3.3-4~dfsg
- KStsLibWriterGet at Base 2.3.3-4~dfsg
- KStsMsg at Base 2.3.3-4~dfsg
- KStsWriterGet at Base 2.3.3-4~dfsg
- KSymAddrAddRef at Base 2.3.3-4~dfsg
- KSymAddrAsFunc at Base 2.3.3-4~dfsg
- KSymAddrAsObj at Base 2.3.3-4~dfsg
- KSymAddrRelease at Base 2.3.3-4~dfsg
- KSymTableCreateNamespace at Base 2.3.3-4~dfsg
- KSymTableCreateSymbol at Base 2.3.3-4~dfsg
- KSymTableDupSymbol at Base 2.3.3-4~dfsg
- KSymTableFind at Base 2.3.3-4~dfsg
- KSymTableFindGlobal at Base 2.3.3-4~dfsg
- KSymTableFindIntrinsic at Base 2.3.3-4~dfsg
- KSymTableFindNext at Base 2.3.3-4~dfsg
- KSymTableFindShallow at Base 2.3.3-4~dfsg
- KSymTableFindSymbol at Base 2.3.3-4~dfsg
- KSymTableInit at Base 2.3.3-4~dfsg
- KSymTablePopNamespace at Base 2.3.3-4~dfsg
- KSymTablePopScope at Base 2.3.3-4~dfsg
- KSymTablePushNamespace at Base 2.3.3-4~dfsg
- KSymTablePushScope at Base 2.3.3-4~dfsg
- KSymTableRemoveSymbol at Base 2.3.3-4~dfsg
- KSymbolCmp at Base 2.3.3-4~dfsg
- KSymbolCopy at Base 2.3.3-4~dfsg
- KSymbolCopyScope at Base 2.3.3-4~dfsg
- KSymbolDump at Base 2.3.3-4~dfsg
- KSymbolDumpAlias at Base 2.3.3-4~dfsg
- KSymbolInit at Base 2.3.3-4~dfsg
- KSymbolMake at Base 2.3.3-4~dfsg
- KSymbolSort at Base 2.3.3-4~dfsg
- KSymbolWhack at Base 2.3.3-4~dfsg
- KSysDirMakePath at Base 2.3.3-4~dfsg
- KSysDirRealPath at Base 2.3.3-4~dfsg
- KSysDirVRealPath at Base 2.3.3-4~dfsg
- KSysFileMake at Base 2.3.3-4~dfsg
- KTableAddRef at Base 2.3.3-4~dfsg
- KTableAttach at Base 2.3.3-4~dfsg
- KTableConsistencyCheck at Base 2.3.3-4~dfsg
- KTableExists at Base 2.3.3-4~dfsg
- KTableGetPath at Base 2.3.3-4~dfsg
- KTableIsAlias at Base 2.3.3-4~dfsg
- KTableListCol at Base 2.3.3-4~dfsg
- KTableListIdx at Base 2.3.3-4~dfsg
- KTableLocked at Base 2.3.3-4~dfsg
- KTableModDate at Base 2.3.3-4~dfsg
- KTableOpenColumnRead at Base 2.3.3-4~dfsg
- KTableOpenDirectoryRead at Base 2.3.3-4~dfsg
- KTableOpenIndexRead at Base 2.3.3-4~dfsg
- KTableOpenManagerRead at Base 2.3.3-4~dfsg
- KTableOpenMetadataRead at Base 2.3.3-4~dfsg
- KTableOpenParentRead at Base 2.3.3-4~dfsg
- KTableRelease at Base 2.3.3-4~dfsg
- KTableSever at Base 2.3.3-4~dfsg
- KTableVExists at Base 2.3.3-4~dfsg
- KTableVOpenColumnRead at Base 2.3.3-4~dfsg
- KTableVOpenIndexRead at Base 2.3.3-4~dfsg
- KTableVWritable at Base 2.3.3-4~dfsg
- KTableWritable at Base 2.3.3-4~dfsg
- KTaskAddRef at Base 2.3.3-4~dfsg
- KTaskDestroy at Base 2.3.3-4~dfsg
- KTaskExecute at Base 2.3.3-4~dfsg
- KTaskInit at Base 2.3.3-4~dfsg
- KTaskRelease at Base 2.3.3-4~dfsg
- KThreadAddRef at Base 2.3.3-4~dfsg
- KThreadCancel at Base 2.3.3-4~dfsg
- KThreadDetach at Base 2.3.3-4~dfsg
- KThreadMake at Base 2.3.3-4~dfsg
- KThreadRelease at Base 2.3.3-4~dfsg
- KThreadWait at Base 2.3.3-4~dfsg
- KTimeGlobal at Base 2.3.3-4~dfsg
- KTimeLocal at Base 2.3.3-4~dfsg
- KTimeStamp at Base 2.3.3-4~dfsg
- KTocAddRef at Base 2.3.3-4~dfsg
- KTocAlignmentGet at Base 2.3.3-4~dfsg
- KTocAlignmentSet at Base 2.3.3-4~dfsg
- KTocCreateChunkedFile at Base 2.3.3-4~dfsg
- KTocCreateDir at Base 2.3.3-4~dfsg
- KTocCreateFile at Base 2.3.3-4~dfsg
- KTocCreateHardLink at Base 2.3.3-4~dfsg
- KTocCreateSoftLink at Base 2.3.3-4~dfsg
- KTocCreateZombieFile at Base 2.3.3-4~dfsg
- KTocEntryCmp2 at Base 2.3.3-4~dfsg
- KTocEntryCmpVoid at Base 2.3.3-4~dfsg
- KTocEntryDelete at Base 2.3.3-4~dfsg
- KTocEntryGetAccess at Base 2.3.3-4~dfsg
- KTocEntryGetBSTree at Base 2.3.3-4~dfsg
- KTocEntryGetChunks at Base 2.3.3-4~dfsg
- KTocEntryGetFileLocator at Base 2.3.3-4~dfsg
- KTocEntryGetFileOffset at Base 2.3.3-4~dfsg
- KTocEntryGetFilePhysicalSize at Base 2.3.3-4~dfsg
- KTocEntryGetFileSize at Base 2.3.3-4~dfsg
- KTocEntryGetHardTarget at Base 2.3.3-4~dfsg
- KTocEntryGetName at Base 2.3.3-4~dfsg
- KTocEntryGetSoftTarget at Base 2.3.3-4~dfsg
- KTocEntryGetTime at Base 2.3.3-4~dfsg
- KTocEntryGetType at Base 2.3.3-4~dfsg
- KTocEntryNewChunked at Base 2.3.3-4~dfsg
- KTocEntryNewDirectory at Base 2.3.3-4~dfsg
- KTocEntryNewFile at Base 2.3.3-4~dfsg
- KTocEntryNewHard at Base 2.3.3-4~dfsg
- KTocEntryNewSoft at Base 2.3.3-4~dfsg
- KTocEntryNewZombieFile at Base 2.3.3-4~dfsg
- KTocEntryPersist at Base 2.3.3-4~dfsg
- KTocEntryPersistNodeDir at Base 2.3.3-4~dfsg
- KTocEntryPersistWriteFunc at Base 2.3.3-4~dfsg
- KTocEntryStackDel at Base 2.3.3-4~dfsg
- KTocEntryStackDepth at Base 2.3.3-4~dfsg
- KTocEntryStackNew at Base 2.3.3-4~dfsg
- KTocEntryStackPop at Base 2.3.3-4~dfsg
- KTocEntryStackPush at Base 2.3.3-4~dfsg
- KTocEntryTypeGetString at Base 2.3.3-4~dfsg
- KTocEntryWhack at Base 2.3.3-4~dfsg
- KTocFileMake at Base 2.3.3-4~dfsg
- KTocGetArchive at Base 2.3.3-4~dfsg
- KTocGetPath at Base 2.3.3-4~dfsg
- KTocGetRoot at Base 2.3.3-4~dfsg
- KTocInflatePBSTree at Base 2.3.3-4~dfsg
- KTocInit at Base 2.3.3-4~dfsg
- KTocPersist at Base 2.3.3-4~dfsg
- KTocRelease at Base 2.3.3-4~dfsg
- KTocResolvePathFromOffset at Base 2.3.3-4~dfsg
- KTocResolvePathTocEntry at Base 2.3.3-4~dfsg
- KTocVCreateChunkedFile at Base 2.3.3-4~dfsg
- KTocVCreateDir at Base 2.3.3-4~dfsg
- KTocVCreateFile at Base 2.3.3-4~dfsg
- KTocVCreateHardLink at Base 2.3.3-4~dfsg
- KTocVCreateSoftLink at Base 2.3.3-4~dfsg
- KTocVCreateZombieFile at Base 2.3.3-4~dfsg
- KTokenExpected at Base 2.3.3-4~dfsg
- KTokenFailure at Base 2.3.3-4~dfsg
- KTokenRCExplain at Base 2.3.3-4~dfsg
- KTokenSourceConsume at Base 2.3.3-4~dfsg
- KTokenSourceReturn at Base 2.3.3-4~dfsg
- KTokenToF64 at Base 2.3.3-4~dfsg
- KTokenToI32 at Base 2.3.3-4~dfsg
- KTokenToI64 at Base 2.3.3-4~dfsg
- KTokenToString at Base 2.3.3-4~dfsg
- KTokenToU32 at Base 2.3.3-4~dfsg
- KTokenToU64 at Base 2.3.3-4~dfsg
- KTokenToVersion at Base 2.3.3-4~dfsg
- KTokenToWideString at Base 2.3.3-4~dfsg
- KTokenizerNext at Base 2.3.3-4~dfsg
- KTrieIndexCheckConsistency_v1 at Base 2.3.3-4~dfsg
- KTrieIndexCheckConsistency_v2 at Base 2.3.3-4~dfsg
- KTrieIndexFind_v1 at Base 2.3.3-4~dfsg
- KTrieIndexFind_v2 at Base 2.3.3-4~dfsg
- KTrieIndexOpen_v1 at Base 2.3.3-4~dfsg
- KTrieIndexOpen_v2 at Base 2.3.3-4~dfsg
- KTrieIndexProject_v1 at Base 2.3.3-4~dfsg
- KTrieIndexProject_v2 at Base 2.3.3-4~dfsg
- KTrieIndexWhack_v1 at Base 2.3.3-4~dfsg
- KTrieIndexWhack_v2 at Base 2.3.3-4~dfsg
- KU64IndexFindAll_v3 at Base 2.3.3-4~dfsg
- KU64IndexFind_v3 at Base 2.3.3-4~dfsg
- KU64IndexOpen_v3 at Base 2.3.3-4~dfsg
- KU64IndexWhack_v3 at Base 2.3.3-4~dfsg
- KUrlFetcherAddRef at Base 2.3.3-4~dfsg
- KUrlFetcherCurlMake at Base 2.3.3-4~dfsg
- KUrlFetcherInit at Base 2.3.3-4~dfsg
- KUrlFetcherRead at Base 2.3.3-4~dfsg
- KUrlFetcherRelease at Base 2.3.3-4~dfsg
- KVectorAddRef at Base 2.3.3-4~dfsg
- KVectorGet at Base 2.3.3-4~dfsg
- KVectorGetBool at Base 2.3.3-4~dfsg
- KVectorGetF32 at Base 2.3.3-4~dfsg
- KVectorGetF64 at Base 2.3.3-4~dfsg
- KVectorGetI16 at Base 2.3.3-4~dfsg
- KVectorGetI32 at Base 2.3.3-4~dfsg
- KVectorGetI64 at Base 2.3.3-4~dfsg
- KVectorGetI8 at Base 2.3.3-4~dfsg
- KVectorGetPtr at Base 2.3.3-4~dfsg
- KVectorGetU16 at Base 2.3.3-4~dfsg
- KVectorGetU32 at Base 2.3.3-4~dfsg
- KVectorGetU64 at Base 2.3.3-4~dfsg
- KVectorGetU8 at Base 2.3.3-4~dfsg
- KVectorMake at Base 2.3.3-4~dfsg
- KVectorRelease at Base 2.3.3-4~dfsg
- KVectorSet at Base 2.3.3-4~dfsg
- KVectorSetBool at Base 2.3.3-4~dfsg
- KVectorSetF32 at Base 2.3.3-4~dfsg
- KVectorSetF64 at Base 2.3.3-4~dfsg
- KVectorSetI16 at Base 2.3.3-4~dfsg
- KVectorSetI32 at Base 2.3.3-4~dfsg
- KVectorSetI64 at Base 2.3.3-4~dfsg
- KVectorSetI8 at Base 2.3.3-4~dfsg
- KVectorSetPtr at Base 2.3.3-4~dfsg
- KVectorSetU16 at Base 2.3.3-4~dfsg
- KVectorSetU32 at Base 2.3.3-4~dfsg
- KVectorSetU64 at Base 2.3.3-4~dfsg
- KVectorSetU8 at Base 2.3.3-4~dfsg
- KVectorUnset at Base 2.3.3-4~dfsg
- KVectorVisit at Base 2.3.3-4~dfsg
- KVectorVisitBool at Base 2.3.3-4~dfsg
- KVectorVisitF64 at Base 2.3.3-4~dfsg
- KVectorVisitI64 at Base 2.3.3-4~dfsg
- KVectorVisitPtr at Base 2.3.3-4~dfsg
- KVectorVisitU64 at Base 2.3.3-4~dfsg
- KWrtFmt_error_code at Base 2.3.3-4~dfsg
- KWrtFmt_rc_t at Base 2.3.3-4~dfsg
- KWrtInit at Base 2.3.3-4~dfsg
- KWrtSysInit at Base 2.3.3-4~dfsg
- KWrt_DefaultWriter at Base 2.3.3-4~dfsg
- KWrt_DefaultWriterDataStdErr at Base 2.3.3-4~dfsg
- KWrt_DefaultWriterDataStdOut at Base 2.3.3-4~dfsg
- KXMLDocAddRef at Base 2.3.3-4~dfsg
- KXMLDocOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLDocRelease at Base 2.3.3-4~dfsg
- KXMLDocVOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLMgrAddRef at Base 2.3.3-4~dfsg
- KXMLMgrMakeDocRead at Base 2.3.3-4~dfsg
- KXMLMgrMakeDocReadFromMemory at Base 2.3.3-4~dfsg
- KXMLMgrMakeRead at Base 2.3.3-4~dfsg
- KXMLMgrRelease at Base 2.3.3-4~dfsg
- KXMLNodeCountChildNodes at Base 2.3.3-4~dfsg
- KXMLNodeElementName at Base 2.3.3-4~dfsg
- KXMLNodeGetFirstChildNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeGetName at Base 2.3.3-4~dfsg
- KXMLNodeGetNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeListAttr at Base 2.3.3-4~dfsg
- KXMLNodeListChild at Base 2.3.3-4~dfsg
- KXMLNodeOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeReadAsF64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttr at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsF64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrCStr at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrCString at Base 2.3.3-4~dfsg
- KXMLNodeReadCStr at Base 2.3.3-4~dfsg
- KXMLNodeReadCString at Base 2.3.3-4~dfsg
- KXMLNodeRelease at Base 2.3.3-4~dfsg
- KXMLNodeVGetFirstChildNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeVOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLNodesetAddRef at Base 2.3.3-4~dfsg
- KXMLNodesetCount at Base 2.3.3-4~dfsg
- KXMLNodesetGetNodeRead at Base 2.3.3-4~dfsg
- KXMLNodesetRelease at Base 2.3.3-4~dfsg
- KartAddRef at Base 2.3.3-4~dfsg
- KartItemAccession at Base 2.3.3-4~dfsg
- KartItemAddRef at Base 2.3.3-4~dfsg
- KartItemItemDesc at Base 2.3.3-4~dfsg
- KartItemItemId at Base 2.3.3-4~dfsg
- KartItemItemIdNumber at Base 2.3.3-4~dfsg
- KartItemName at Base 2.3.3-4~dfsg
- KartItemPrint at Base 2.3.3-4~dfsg
- KartItemProjId at Base 2.3.3-4~dfsg
- KartItemProjIdNumber at Base 2.3.3-4~dfsg
- KartItemRelease at Base 2.3.3-4~dfsg
- KartMake at Base 2.3.3-4~dfsg
- KartMakeNextItem at Base 2.3.3-4~dfsg
- KartPrint at Base 2.3.3-4~dfsg
- KartRelease at Base 2.3.3-4~dfsg
- LFactoryWhack at Base 2.3.3-4~dfsg
- LSpecialWhack at Base 2.3.3-4~dfsg
- LegacyVPathGetScheme_t at Base 2.3.3-4~dfsg
- LegacyVPathGetUri_t at Base 2.3.3-4~dfsg
- LegacyVPathMake at Base 2.3.3-4~dfsg
- LegacyVPathMakeDirectoryRelative at Base 2.3.3-4~dfsg
- LegacyVPathMakeFmt at Base 2.3.3-4~dfsg
- LegacyVPathMakeSysPath at Base 2.3.3-4~dfsg
- LegacyVPathMakeVFmt at Base 2.3.3-4~dfsg
- LogAppName at Base 2.3.3-4~dfsg
- LogAppVersion at Base 2.3.3-4~dfsg
- LogErr at Base 2.3.3-4~dfsg
- LogFlush at Base 2.3.3-4~dfsg
- LogInsertSpace at Base 2.3.3-4~dfsg
- LogLibErr at Base 2.3.3-4~dfsg
- LogLibMsg at Base 2.3.3-4~dfsg
- LogMsg at Base 2.3.3-4~dfsg
- LogPID at Base 2.3.3-4~dfsg
- LogSimpleTimestamp at Base 2.3.3-4~dfsg
- LogTimestamp at Base 2.3.3-4~dfsg
- MD5StateAppend at Base 2.3.3-4~dfsg
- MD5StateFinish at Base 2.3.3-4~dfsg
- MD5StateInit at Base 2.3.3-4~dfsg
- MyersFindAll at Base 2.3.3-4~dfsg
- MyersFindBest at Base 2.3.3-4~dfsg
- MyersFindFirst at Base 2.3.3-4~dfsg
- MyersUnlimitedFindAll at Base 2.3.3-4~dfsg
- MyersUnlimitedFindBest at Base 2.3.3-4~dfsg
- MyersUnlimitedFindFirst at Base 2.3.3-4~dfsg
- MyersUnlimitedFree at Base 2.3.3-4~dfsg
- MyersUnlimitedMake at Base 2.3.3-4~dfsg
- NCBI_SRA_ABI_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_ABI_untyped_1 at Base 2.3.3-4~dfsg
- NCBI_SRA_Helicos_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_0a at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_0b at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_1a at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_1b at Base 2.3.3-4~dfsg
- NCBI_SRA_IonTorrent_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA__454__dynamic_read_desc at Base 2.3.3-4~dfsg
- NCBI_SRA__454__process_position at Base 2.3.3-4~dfsg
- NCBI_SRA__454__tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_0 at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_1_2a at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_1_2b at Base 2.3.3-4~dfsg
- NCBI_SRA_accept_untyped at Base 2.3.3-4~dfsg
- NCBI_SRA_bio_start at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_CLIP at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_INTENSITY at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_NOISE at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_POSITION at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_QUALITY at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_READ at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_SIGNAL at Base 2.3.3-4~dfsg
- NCBI_SRA_denormalize at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_coordinates at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_name_coord at Base 2.3.3-4~dfsg
- NCBI_SRA_fix_read_seg at Base 2.3.3-4~dfsg
- NCBI_SRA_lookup at Base 2.3.3-4~dfsg
- NCBI_SRA_make_position at Base 2.3.3-4~dfsg
- NCBI_SRA_make_read_desc at Base 2.3.3-4~dfsg
- NCBI_SRA_make_spot_desc at Base 2.3.3-4~dfsg
- NCBI_SRA_normalize at Base 2.3.3-4~dfsg
- NCBI_SRA_qual4_decode at Base 2.3.3-4~dfsg
- NCBI_SRA_qual4_decompress_v1 at Base 2.3.3-4~dfsg
- NCBI_SRA_read_seg_from_readn at Base 2.3.3-4~dfsg
- NCBI_SRA_rewrite_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_rotate at Base 2.3.3-4~dfsg
- NCBI_SRA_swap at Base 2.3.3-4~dfsg
- NCBI_WGS_build_read_type at Base 2.3.3-4~dfsg
- NCBI_WGS_build_scaffold_qual at Base 2.3.3-4~dfsg
- NCBI_WGS_build_scaffold_read at Base 2.3.3-4~dfsg
- NCBI_WGS_tokenize_nuc_accession at Base 2.3.3-4~dfsg
- NCBI_WGS_tokenize_prot_accession at Base 2.3.3-4~dfsg
- NCBI_align_clip at Base 2.3.3-4~dfsg
- NCBI_align_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_compress_quality at Base 2.3.3-4~dfsg
- NCBI_align_decompress_quality at Base 2.3.3-4~dfsg
- NCBI_align_edit_distance at Base 2.3.3-4~dfsg
- NCBI_align_edit_distance_2 at Base 2.3.3-4~dfsg
- NCBI_align_generate_mismatch_qual_2 at Base 2.3.3-4~dfsg
- NCBI_align_generate_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_cigar at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_cigar_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_ref_offset at Base 2.3.3-4~dfsg
- NCBI_align_get_left_soft_clip at Base 2.3.3-4~dfsg
- NCBI_align_get_left_soft_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_mate_align_id at Base 2.3.3-4~dfsg
- NCBI_align_get_mismatch_read at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_delete at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_insert at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_len at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_mismatch at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_3 at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_4 at Base 2.3.3-4~dfsg
- NCBI_align_get_sam_flags at Base 2.3.3-4~dfsg
- NCBI_align_get_sam_flags_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_seq_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_local_ref_id at Base 2.3.3-4~dfsg
- NCBI_align_local_ref_start at Base 2.3.3-4~dfsg
- NCBI_align_make_cmp_read_desc at Base 2.3.3-4~dfsg
- NCBI_align_make_read_start at Base 2.3.3-4~dfsg
- NCBI_align_mismatch_restore_qual at Base 2.3.3-4~dfsg
- NCBI_align_not_my_row at Base 2.3.3-4~dfsg
- NCBI_align_raw_restore_qual at Base 2.3.3-4~dfsg
- NCBI_align_ref_name at Base 2.3.3-4~dfsg
- NCBI_align_ref_pos at Base 2.3.3-4~dfsg
- NCBI_align_ref_seq_id at Base 2.3.3-4~dfsg
- NCBI_align_ref_sub_select_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_seq_construct_read at Base 2.3.3-4~dfsg
- NCBI_align_template_len at Base 2.3.3-4~dfsg
- NCBI_color_from_dna at Base 2.3.3-4~dfsg
- NCBI_dna_from_color at Base 2.3.3-4~dfsg
- NCBI_fp_extend at Base 2.3.3-4~dfsg
- NCBI_lower_case_tech_reads at Base 2.3.3-4~dfsg
- NCBI_unpack at Base 2.3.3-4~dfsg
- NCBI_unzip at Base 2.3.3-4~dfsg
- NCBI_var_tokenize_var_id at Base 2.3.3-4~dfsg
- NucStrstrMake at Base 2.3.3-4~dfsg
- NucStrstrSearch at Base 2.3.3-4~dfsg
- NucStrstrWhack at Base 2.3.3-4~dfsg
- PBSTNodeFindNext at Base 2.3.3-4~dfsg
- PBSTNodeFindPrev at Base 2.3.3-4~dfsg
- PBSTNodeNext at Base 2.3.3-4~dfsg
- PBSTNodePrev at Base 2.3.3-4~dfsg
- PBSTreeCount at Base 2.3.3-4~dfsg
- PBSTreeDepth at Base 2.3.3-4~dfsg
- PBSTreeDoUntil at Base 2.3.3-4~dfsg
- PBSTreeFind at Base 2.3.3-4~dfsg
- PBSTreeForEach at Base 2.3.3-4~dfsg
- PBSTreeGetNode at Base 2.3.3-4~dfsg
- PBSTreeGetNodeData at Base 2.3.3-4~dfsg
- PBSTreeInit at Base 2.3.3-4~dfsg
- PBSTreeMake at Base 2.3.3-4~dfsg
- PBSTreeMakeNative at Base 2.3.3-4~dfsg
- PBSTreeMakeSwapped at Base 2.3.3-4~dfsg
- PBSTreeSize at Base 2.3.3-4~dfsg
- PBSTreeWhack at Base 2.3.3-4~dfsg
- PTNodeMakeKey at Base 2.3.3-4~dfsg
- PTTransDoUntil at Base 2.3.3-4~dfsg
- PTTransForEach at Base 2.3.3-4~dfsg
- PTTransWhack at Base 2.3.3-4~dfsg
- PTrieCount at Base 2.3.3-4~dfsg
- PTrieDoUntil at Base 2.3.3-4~dfsg
- PTrieFind at Base 2.3.3-4~dfsg
- PTrieForEach at Base 2.3.3-4~dfsg
- PTrieGetNode at Base 2.3.3-4~dfsg
- PTrieInitNode at Base 2.3.3-4~dfsg
- PTrieMake at Base 2.3.3-4~dfsg
- PTrieMakeNode at Base 2.3.3-4~dfsg
- PTrieMakeOrig at Base 2.3.3-4~dfsg
- PTrieSize at Base 2.3.3-4~dfsg
- PTrieWhack at Base 2.3.3-4~dfsg
- Pack at Base 2.3.3-4~dfsg
- PageMapAddRef at Base 2.3.3-4~dfsg
- PageMapAppend at Base 2.3.3-4~dfsg
- PageMapAppendRows at Base 2.3.3-4~dfsg
- PageMapCompare at Base 2.3.3-4~dfsg
- PageMapCompareStatic at Base 2.3.3-4~dfsg
- PageMapDeserialize at Base 2.3.3-4~dfsg
- PageMapExpand at Base 2.3.3-4~dfsg
- PageMapExpandFull at Base 2.3.3-4~dfsg
- PageMapFindRow at Base 2.3.3-4~dfsg
- PageMapFixedRowLength at Base 2.3.3-4~dfsg
- PageMapGetIdxRowInfo at Base 2.3.3-4~dfsg
- PageMapHasRows at Base 2.3.3-4~dfsg
- PageMapHasSimpleStructure at Base 2.3.3-4~dfsg
- PageMapLastLength at Base 2.3.3-4~dfsg
- PageMapNew at Base 2.3.3-4~dfsg
- PageMapNewFixedRowLength at Base 2.3.3-4~dfsg
- PageMapNewIterator at Base 2.3.3-4~dfsg
- PageMapNewSingle at Base 2.3.3-4~dfsg
- PageMapPreExpandFull at Base 2.3.3-4~dfsg
- PageMapProcessGetPagemap at Base 2.3.3-4~dfsg
- PageMapRelease at Base 2.3.3-4~dfsg
- PageMapRowLengthRange at Base 2.3.3-4~dfsg
- PageMapSerialize at Base 2.3.3-4~dfsg
- PageMapToRandomAccess at Base 2.3.3-4~dfsg
- ParseUrl at Base 2.3.3-4~dfsg
- PersistFilesIndex at Base 2.3.3-4~dfsg
- PlacementIteratorAddRef at Base 2.3.3-4~dfsg
- PlacementIteratorNextAvailPos at Base 2.3.3-4~dfsg
- PlacementIteratorNextIdAt at Base 2.3.3-4~dfsg
- PlacementIteratorNextRecordAt at Base 2.3.3-4~dfsg
- PlacementIteratorRefObj at Base 2.3.3-4~dfsg
- PlacementIteratorRefWindow at Base 2.3.3-4~dfsg
- PlacementIteratorRelease at Base 2.3.3-4~dfsg
- PlacementIterator_cols at Base 2.3.3-4~dfsg
- PlacementRecordCast at Base 2.3.3-4~dfsg
- PlacementRecordWhack at Base 2.3.3-4~dfsg
- PlacementRecord_get_ext_data_ptr at Base 2.3.3-4~dfsg
- PlacementSetIteratorAddPlacementIterator at Base 2.3.3-4~dfsg
- PlacementSetIteratorAddRef at Base 2.3.3-4~dfsg
- PlacementSetIteratorNextAvailPos at Base 2.3.3-4~dfsg
- PlacementSetIteratorNextIdAt at Base 2.3.3-4~dfsg
- PlacementSetIteratorNextRecordAt at Base 2.3.3-4~dfsg
- PlacementSetIteratorNextReference at Base 2.3.3-4~dfsg
- PlacementSetIteratorNextWindow at Base 2.3.3-4~dfsg
- PlacementSetIteratorRelease at Base 2.3.3-4~dfsg
- QualityQuantizerInitMatrix at Base 2.3.3-4~dfsg
- RCContextStrings at Base 2.3.3-4~dfsg
- RCExplain2 at Base 2.3.3-4~dfsg
- RCExplain at Base 2.3.3-4~dfsg
- RCModuleStrings at Base 2.3.3-4~dfsg
- RCObjectStrings at Base 2.3.3-4~dfsg
- RCStateStrings at Base 2.3.3-4~dfsg
- RCTargetStrings at Base 2.3.3-4~dfsg
- RefIterRecordDestroy at Base 2.3.3-4~dfsg
- RefIterRecordPopulate at Base 2.3.3-4~dfsg
- RefIterRecordSize at Base 2.3.3-4~dfsg
- RefSeqMgr_Exists at Base 2.3.3-4~dfsg
- RefSeqMgr_ForEachVolume at Base 2.3.3-4~dfsg
- RefSeqMgr_GetSeq at Base 2.3.3-4~dfsg
- RefSeqMgr_Make at Base 2.3.3-4~dfsg
- RefSeqMgr_Read at Base 2.3.3-4~dfsg
- RefSeqMgr_Release at Base 2.3.3-4~dfsg
- RefSeqMgr_SetCache at Base 2.3.3-4~dfsg
- RefSeq_Circular at Base 2.3.3-4~dfsg
- RefSeq_MD5 at Base 2.3.3-4~dfsg
- RefSeq_Read at Base 2.3.3-4~dfsg
- RefSeq_Release at Base 2.3.3-4~dfsg
- RefSeq_SeqLength at Base 2.3.3-4~dfsg
- ReferenceIteratorAddPlacementIterator at Base 2.3.3-4~dfsg
- ReferenceIteratorAddPlacements at Base 2.3.3-4~dfsg
- ReferenceIteratorAddRef at Base 2.3.3-4~dfsg
- ReferenceIteratorBasesDeleted at Base 2.3.3-4~dfsg
- ReferenceIteratorBasesInserted at Base 2.3.3-4~dfsg
- ReferenceIteratorGetPlacement at Base 2.3.3-4~dfsg
- ReferenceIteratorNextPlacement at Base 2.3.3-4~dfsg
- ReferenceIteratorNextPos at Base 2.3.3-4~dfsg
- ReferenceIteratorNextReference at Base 2.3.3-4~dfsg
- ReferenceIteratorNextSpotGroup at Base 2.3.3-4~dfsg
- ReferenceIteratorNextWindow at Base 2.3.3-4~dfsg
- ReferenceIteratorPosition at Base 2.3.3-4~dfsg
- ReferenceIteratorRelease at Base 2.3.3-4~dfsg
- ReferenceIteratorState at Base 2.3.3-4~dfsg
- ReferenceList_AddRef at Base 2.3.3-4~dfsg
- ReferenceList_Count at Base 2.3.3-4~dfsg
- ReferenceList_Find at Base 2.3.3-4~dfsg
- ReferenceList_Get at Base 2.3.3-4~dfsg
- ReferenceList_MakeCursor at Base 2.3.3-4~dfsg
- ReferenceList_MakeDatabase at Base 2.3.3-4~dfsg
- ReferenceList_MakePath at Base 2.3.3-4~dfsg
- ReferenceList_MakeTable at Base 2.3.3-4~dfsg
- ReferenceList_Release at Base 2.3.3-4~dfsg
- ReferenceList_cols at Base 2.3.3-4~dfsg
- ReferenceObj_AddRef at Base 2.3.3-4~dfsg
- ReferenceObj_Bin at Base 2.3.3-4~dfsg
- ReferenceObj_Circular at Base 2.3.3-4~dfsg
- ReferenceObj_External at Base 2.3.3-4~dfsg
- ReferenceObj_GetIdCount at Base 2.3.3-4~dfsg
- ReferenceObj_IdRange at Base 2.3.3-4~dfsg
- ReferenceObj_Idx at Base 2.3.3-4~dfsg
- ReferenceObj_MakePlacementIterator at Base 2.3.3-4~dfsg
- ReferenceObj_Name at Base 2.3.3-4~dfsg
- ReferenceObj_Read at Base 2.3.3-4~dfsg
- ReferenceObj_Release at Base 2.3.3-4~dfsg
- ReferenceObj_SeqId at Base 2.3.3-4~dfsg
- ReferenceObj_SeqLength at Base 2.3.3-4~dfsg
- ReferenceSeq_ReOffset at Base 2.3.3-4~dfsg
- ReportBuildDate at Base 2.3.3-4~dfsg
- ReportCWD at Base 2.3.3-4~dfsg
- ReportFinalize at Base 2.3.3-4~dfsg
- ReportInit at Base 2.3.3-4~dfsg
- ReportInitConfig at Base 2.3.3-4~dfsg
- ReportInitKFS at Base 2.3.3-4~dfsg
- ReportInitVDB at Base 2.3.3-4~dfsg
- ReportKfg at Base 2.3.3-4~dfsg
- ReportRecordZombieFile at Base 2.3.3-4~dfsg
- ReportRedirect at Base 2.3.3-4~dfsg
- ReportResetDatabase at Base 2.3.3-4~dfsg
- ReportResetObject at Base 2.3.3-4~dfsg
- ReportResetTable at Base 2.3.3-4~dfsg
- ReportSetVDBManager at Base 2.3.3-4~dfsg
- ReportSilence at Base 2.3.3-4~dfsg
- ResolveTablePath at Base 2.3.3-4~dfsg
- SColumnCmp at Base 2.3.3-4~dfsg
- SColumnDefDump at Base 2.3.3-4~dfsg
- SColumnDump at Base 2.3.3-4~dfsg
- SColumnSort at Base 2.3.3-4~dfsg
- SColumnWhack at Base 2.3.3-4~dfsg
- SConstExprResolveAsU32 at Base 2.3.3-4~dfsg
- SConstantClearMark at Base 2.3.3-4~dfsg
- SConstantDefDump at Base 2.3.3-4~dfsg
- SConstantDump at Base 2.3.3-4~dfsg
- SConstantMark at Base 2.3.3-4~dfsg
- SConstantWhack at Base 2.3.3-4~dfsg
- SDBMemberDefDump at Base 2.3.3-4~dfsg
- SDBMemberDump at Base 2.3.3-4~dfsg
- SDatabaseClearMark at Base 2.3.3-4~dfsg
- SDatabaseCmp at Base 2.3.3-4~dfsg
- SDatabaseDefDump at Base 2.3.3-4~dfsg
- SDatabaseDump at Base 2.3.3-4~dfsg
- SDatabaseFind at Base 2.3.3-4~dfsg
- SDatabaseMark at Base 2.3.3-4~dfsg
- SDatabaseNameMark at Base 2.3.3-4~dfsg
- SDatabaseSort at Base 2.3.3-4~dfsg
- SDatabaseWhack at Base 2.3.3-4~dfsg
- SDatatypeClearMark at Base 2.3.3-4~dfsg
- SDatatypeDefDump at Base 2.3.3-4~dfsg
- SDatatypeDump at Base 2.3.3-4~dfsg
- SDatatypeIntrinsicDim at Base 2.3.3-4~dfsg
- SDatatypeMark at Base 2.3.3-4~dfsg
- SDumperDecIndentLevel at Base 2.3.3-4~dfsg
- SDumperIncIndentLevel at Base 2.3.3-4~dfsg
- SDumperIndent at Base 2.3.3-4~dfsg
- SDumperInit at Base 2.3.3-4~dfsg
- SDumperPrint at Base 2.3.3-4~dfsg
- SDumperSep at Base 2.3.3-4~dfsg
- SDumperSepString at Base 2.3.3-4~dfsg
- SDumperVPrint at Base 2.3.3-4~dfsg
- SDumperVersion at Base 2.3.3-4~dfsg
- SDumperWhack at Base 2.3.3-4~dfsg
- SDumperWrite at Base 2.3.3-4~dfsg
- SExpressionBracketListDump at Base 2.3.3-4~dfsg
- SExpressionDump at Base 2.3.3-4~dfsg
- SExpressionListDump at Base 2.3.3-4~dfsg
- SExpressionMark at Base 2.3.3-4~dfsg
- SExpressionVDump at Base 2.3.3-4~dfsg
- SExpressionVWhack at Base 2.3.3-4~dfsg
- SExpressionWhack at Base 2.3.3-4~dfsg
- SFFReaderCurrentSpot at Base 2.3.3-4~dfsg
- SFFReaderFirstSpot at Base 2.3.3-4~dfsg
- SFFReaderHeader at Base 2.3.3-4~dfsg
- SFFReaderMake at Base 2.3.3-4~dfsg
- SFFReaderNextSpot at Base 2.3.3-4~dfsg
- SFFReaderReadData at Base 2.3.3-4~dfsg
- SFFReaderReadHeader at Base 2.3.3-4~dfsg
- SFFReaderSeekSpot at Base 2.3.3-4~dfsg
- SFFReaderWhack at Base 2.3.3-4~dfsg
- SFFReader_GetCurrentSpotData at Base 2.3.3-4~dfsg
- SFFReader_GetNextSpotData at Base 2.3.3-4~dfsg
- SFFReader_SpotInfo at Base 2.3.3-4~dfsg
- SFFReader_SpotReadInfo at Base 2.3.3-4~dfsg
- SFormParamlistDump at Base 2.3.3-4~dfsg
- SFormParmlistMark at Base 2.3.3-4~dfsg
- SFormParmlistWhack at Base 2.3.3-4~dfsg
- SFormatClearMark at Base 2.3.3-4~dfsg
- SFormatDefDump at Base 2.3.3-4~dfsg
- SFormatDump at Base 2.3.3-4~dfsg
- SFormatMark at Base 2.3.3-4~dfsg
- SFuncExprMark at Base 2.3.3-4~dfsg
- SFuncNameMark at Base 2.3.3-4~dfsg
- SFunctionBindFactParms at Base 2.3.3-4~dfsg
- SFunctionBindSchemaParms at Base 2.3.3-4~dfsg
- SFunctionBodyDump at Base 2.3.3-4~dfsg
- SFunctionClearMark at Base 2.3.3-4~dfsg
- SFunctionCmp at Base 2.3.3-4~dfsg
- SFunctionDeclDump at Base 2.3.3-4~dfsg
- SFunctionDeclDumpFactParms at Base 2.3.3-4~dfsg
- SFunctionDeclDumpSchemaParms at Base 2.3.3-4~dfsg
- SFunctionDestroy at Base 2.3.3-4~dfsg
- SFunctionDump at Base 2.3.3-4~dfsg
- SFunctionMark at Base 2.3.3-4~dfsg
- SFunctionRestFactParms at Base 2.3.3-4~dfsg
- SFunctionRestSchemaParms at Base 2.3.3-4~dfsg
- SFunctionSort at Base 2.3.3-4~dfsg
- SFunctionWhack at Base 2.3.3-4~dfsg
- SHA1StateAppend at Base 2.3.3-4~dfsg
- SHA1StateFinish at Base 2.3.3-4~dfsg
- SHA1StateInit at Base 2.3.3-4~dfsg
- SHA256StateAppend at Base 2.3.3-4~dfsg
- SHA256StateFinish at Base 2.3.3-4~dfsg
- SHA256StateInit at Base 2.3.3-4~dfsg
- SHA384StateAppend at Base 2.3.3-4~dfsg
- SHA384StateFinish at Base 2.3.3-4~dfsg
- SHA384StateInit at Base 2.3.3-4~dfsg
- SHA512StateAppend at Base 2.3.3-4~dfsg
- SHA512StateFinish at Base 2.3.3-4~dfsg
- SHA512StateInit at Base 2.3.3-4~dfsg
- SIndirectConstDefDump at Base 2.3.3-4~dfsg
- SIndirectConstDump at Base 2.3.3-4~dfsg
- SIndirectConstMark at Base 2.3.3-4~dfsg
- SIndirectConstWhack at Base 2.3.3-4~dfsg
- SIndirectTypeDump at Base 2.3.3-4~dfsg
- SIndirectTypeMark at Base 2.3.3-4~dfsg
- SIndirectTypeWhack at Base 2.3.3-4~dfsg
- SLListDoUntil at Base 2.3.3-4~dfsg
- SLListFindFirst at Base 2.3.3-4~dfsg
- SLListForEach at Base 2.3.3-4~dfsg
- SLListPopHead at Base 2.3.3-4~dfsg
- SLListPopTail at Base 2.3.3-4~dfsg
- SLListPushTail at Base 2.3.3-4~dfsg
- SLListUnlink at Base 2.3.3-4~dfsg
- SLListWhack at Base 2.3.3-4~dfsg
- SNameOverloadCopy at Base 2.3.3-4~dfsg
- SNameOverloadMake at Base 2.3.3-4~dfsg
- SNameOverloadVectorCopy at Base 2.3.3-4~dfsg
- SNameOverloadWhack at Base 2.3.3-4~dfsg
- SPhysEncExprMark at Base 2.3.3-4~dfsg
- SPhysMemberDefDump at Base 2.3.3-4~dfsg
- SPhysMemberDump at Base 2.3.3-4~dfsg
- SPhysMemberMark at Base 2.3.3-4~dfsg
- SPhysMemberWhack at Base 2.3.3-4~dfsg
- SPhysNameMark at Base 2.3.3-4~dfsg
- SPhysicalBindFactParms at Base 2.3.3-4~dfsg
- SPhysicalBindSchemaParms at Base 2.3.3-4~dfsg
- SPhysicalClearMark at Base 2.3.3-4~dfsg
- SPhysicalCmp at Base 2.3.3-4~dfsg
- SPhysicalDefDump at Base 2.3.3-4~dfsg
- SPhysicalDump at Base 2.3.3-4~dfsg
- SPhysicalMark at Base 2.3.3-4~dfsg
- SPhysicalRestFactParms at Base 2.3.3-4~dfsg
- SPhysicalRestSchemaParms at Base 2.3.3-4~dfsg
- SPhysicalSort at Base 2.3.3-4~dfsg
- SPhysicalWhack at Base 2.3.3-4~dfsg
- SProductionDefDump at Base 2.3.3-4~dfsg
- SProductionDump at Base 2.3.3-4~dfsg
- SProductionMark at Base 2.3.3-4~dfsg
- SProductionWhack at Base 2.3.3-4~dfsg
- SRACacheAddTable at Base 2.3.3-4~dfsg
- SRACacheElementDestroy at Base 2.3.3-4~dfsg
- SRACacheElementMake at Base 2.3.3-4~dfsg
- SRACacheFlush at Base 2.3.3-4~dfsg
- SRACacheGetHardThreshold at Base 2.3.3-4~dfsg
- SRACacheGetSoftThreshold at Base 2.3.3-4~dfsg
- SRACacheGetTable at Base 2.3.3-4~dfsg
- SRACacheGetUsage at Base 2.3.3-4~dfsg
- SRACacheIndexDestroy at Base 2.3.3-4~dfsg
- SRACacheIndexMake at Base 2.3.3-4~dfsg
- SRACacheInit at Base 2.3.3-4~dfsg
- SRACacheMetricsLessThan at Base 2.3.3-4~dfsg
- SRACacheSetHardThreshold at Base 2.3.3-4~dfsg
- SRACacheSetSoftThreshold at Base 2.3.3-4~dfsg
- SRACacheWhack at Base 2.3.3-4~dfsg
- SRAColumnAddRef at Base 2.3.3-4~dfsg
- SRAColumnDatatype at Base 2.3.3-4~dfsg
- SRAColumnGetRange at Base 2.3.3-4~dfsg
- SRAColumnRead at Base 2.3.3-4~dfsg
- SRAColumnRelease at Base 2.3.3-4~dfsg
- SRAColumnWhack at Base 2.3.3-4~dfsg
- SRAMgrAddRef at Base 2.3.3-4~dfsg
- SRAMgrAttach at Base 2.3.3-4~dfsg
- SRAMgrConfigReload at Base 2.3.3-4~dfsg
- SRAMgrConfigureCache at Base 2.3.3-4~dfsg
- SRAMgrFlush at Base 2.3.3-4~dfsg
- SRAMgrGetCacheUsage at Base 2.3.3-4~dfsg
- SRAMgrGetKDBManagerRead at Base 2.3.3-4~dfsg
- SRAMgrGetSchemaRead at Base 2.3.3-4~dfsg
- SRAMgrGetTableModDate at Base 2.3.3-4~dfsg
- SRAMgrGetVDBManagerRead at Base 2.3.3-4~dfsg
- SRAMgrMake at Base 2.3.3-4~dfsg
- SRAMgrMakeRead at Base 2.3.3-4~dfsg
- SRAMgrMakeReadWithDir at Base 2.3.3-4~dfsg
- SRAMgrMakeSRASchema at Base 2.3.3-4~dfsg
- SRAMgrOpenAltTableRead at Base 2.3.3-4~dfsg
- SRAMgrOpenDatatypesRead at Base 2.3.3-4~dfsg
- SRAMgrOpenTableRead at Base 2.3.3-4~dfsg
- SRAMgrRelease at Base 2.3.3-4~dfsg
- SRAMgrResolve at Base 2.3.3-4~dfsg
- SRAMgrRunBGTasks at Base 2.3.3-4~dfsg
- SRAMgrSever at Base 2.3.3-4~dfsg
- SRAMgrSingleFileArchiveExt at Base 2.3.3-4~dfsg
- SRAMgrUseSchemaRead at Base 2.3.3-4~dfsg
- SRAMgrVGetTableModDate at Base 2.3.3-4~dfsg
- SRAMgrVOpenTableRead at Base 2.3.3-4~dfsg
- SRAMgrVWritable at Base 2.3.3-4~dfsg
- SRAMgrVersion at Base 2.3.3-4~dfsg
- SRAMgrWritable at Base 2.3.3-4~dfsg
- SRANamelistAddRef at Base 2.3.3-4~dfsg
- SRANamelistCount at Base 2.3.3-4~dfsg
- SRANamelistGet at Base 2.3.3-4~dfsg
- SRANamelistRelease at Base 2.3.3-4~dfsg
- SRAReaderCurrentSpot at Base 2.3.3-4~dfsg
- SRAReaderFirstSpot at Base 2.3.3-4~dfsg
- SRAReaderInit at Base 2.3.3-4~dfsg
- SRAReaderMake at Base 2.3.3-4~dfsg
- SRAReaderNextSpot at Base 2.3.3-4~dfsg
- SRAReaderSeekSpot at Base 2.3.3-4~dfsg
- SRAReaderWhack at Base 2.3.3-4~dfsg
- SRAReader_FindColData at Base 2.3.3-4~dfsg
- SRAReader_GetCurrentSpotData at Base 2.3.3-4~dfsg
- SRAReader_GetNextSpotData at Base 2.3.3-4~dfsg
- SRAReader_SpotInfo at Base 2.3.3-4~dfsg
- SRAReader_SpotReadInfo at Base 2.3.3-4~dfsg
- SRASchemaMake at Base 2.3.3-4~dfsg
- SRATableAddRef at Base 2.3.3-4~dfsg
- SRATableAttach at Base 2.3.3-4~dfsg
- SRATableBaseCount at Base 2.3.3-4~dfsg
- SRATableColDatatype at Base 2.3.3-4~dfsg
- SRATableColDatatypes at Base 2.3.3-4~dfsg
- SRATableDestroy at Base 2.3.3-4~dfsg
- SRATableFillOut at Base 2.3.3-4~dfsg
- SRATableGetIdRange at Base 2.3.3-4~dfsg
- SRATableGetKTableRead at Base 2.3.3-4~dfsg
- SRATableGetSchema at Base 2.3.3-4~dfsg
- SRATableGetSpotId at Base 2.3.3-4~dfsg
- SRATableGetVTableRead at Base 2.3.3-4~dfsg
- SRATableListCol at Base 2.3.3-4~dfsg
- SRATableLocked at Base 2.3.3-4~dfsg
- SRATableMakeSingleFileArchive at Base 2.3.3-4~dfsg
- SRATableMaxMetaRevision at Base 2.3.3-4~dfsg
- SRATableMaxSpotId at Base 2.3.3-4~dfsg
- SRATableMetaRevision at Base 2.3.3-4~dfsg
- SRATableMinSpotId at Base 2.3.3-4~dfsg
- SRATableOpenColumnRead at Base 2.3.3-4~dfsg
- SRATableOpenMDataNodeRead at Base 2.3.3-4~dfsg
- SRATableRead at Base 2.3.3-4~dfsg
- SRATableRelease at Base 2.3.3-4~dfsg
- SRATableSever at Base 2.3.3-4~dfsg
- SRATableSpotCount at Base 2.3.3-4~dfsg
- SRATableUseMetaRevision at Base 2.3.3-4~dfsg
- SRATableVOpenMDataNodeRead at Base 2.3.3-4~dfsg
- SRATableWhack at Base 2.3.3-4~dfsg
- SSymExprMake at Base 2.3.3-4~dfsg
- SSymExprMark at Base 2.3.3-4~dfsg
- STableClearMark at Base 2.3.3-4~dfsg
- STableCloneExtend at Base 2.3.3-4~dfsg
- STableCmp at Base 2.3.3-4~dfsg
- STableDefDump at Base 2.3.3-4~dfsg
- STableDump at Base 2.3.3-4~dfsg
- STableFind at Base 2.3.3-4~dfsg
- STableFindOrdAncestor at Base 2.3.3-4~dfsg
- STableFindOverride at Base 2.3.3-4~dfsg
- STableImplicitColMember at Base 2.3.3-4~dfsg
- STableImplicitPhysMember at Base 2.3.3-4~dfsg
- STableMark at Base 2.3.3-4~dfsg
- STableNameMark at Base 2.3.3-4~dfsg
- STableSort at Base 2.3.3-4~dfsg
- STableWhack at Base 2.3.3-4~dfsg
- STblMemberDefDump at Base 2.3.3-4~dfsg
- STblMemberDump at Base 2.3.3-4~dfsg
- STypeExprMark at Base 2.3.3-4~dfsg
- STypeExprResolveAsFormatdecl at Base 2.3.3-4~dfsg
- STypeExprResolveAsTypedecl at Base 2.3.3-4~dfsg
- STypesetClearMark at Base 2.3.3-4~dfsg
- STypesetDefDump at Base 2.3.3-4~dfsg
- STypesetDump at Base 2.3.3-4~dfsg
- STypesetMark at Base 2.3.3-4~dfsg
- SchemaEnvInit at Base 2.3.3-4~dfsg
- SetRCFileFuncLine at Base 2.3.3-4~dfsg
- SraHeaderGetFileOffset at Base 2.3.3-4~dfsg
- SraHeaderMake at Base 2.3.3-4~dfsg
- SraHeaderSize at Base 2.3.3-4~dfsg
- StartKeyRing at Base 2.3.3-4~dfsg
- StringCaseCompare at Base 2.3.3-4~dfsg
- StringCaseEqual at Base 2.3.3-4~dfsg
- StringCompare at Base 2.3.3-4~dfsg
- StringConcat at Base 2.3.3-4~dfsg
- StringCopy at Base 2.3.3-4~dfsg
- StringCopyUTF16 at Base 2.3.3-4~dfsg
- StringCopyUTF32 at Base 2.3.3-4~dfsg
- StringDump at Base 2.3.3-4~dfsg
- StringHead at Base 2.3.3-4~dfsg
- StringMatch at Base 2.3.3-4~dfsg
- StringMatchExtend at Base 2.3.3-4~dfsg
- StringOrder at Base 2.3.3-4~dfsg
- StringOrderNoNullCheck at Base 2.3.3-4~dfsg
- StringPopHead at Base 2.3.3-4~dfsg
- StringSubstr at Base 2.3.3-4~dfsg
- StringWhack at Base 2.3.3-4~dfsg
- TNodeMake at Base 2.3.3-4~dfsg
- TNodeWhack at Base 2.3.3-4~dfsg
- TTransDoUntil at Base 2.3.3-4~dfsg
- TTransDoUntilBT at Base 2.3.3-4~dfsg
- TTransForEach at Base 2.3.3-4~dfsg
- TTransForEachBT at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Circular at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MD5 at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MakePath at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MakeTable at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Read at Base 2.3.3-4~dfsg
- TableReaderRefSeq_SeqId at Base 2.3.3-4~dfsg
- TableReaderRefSeq_SeqLength at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Whack at Base 2.3.3-4~dfsg
- TableReader_IdRange at Base 2.3.3-4~dfsg
- TableReader_Make at Base 2.3.3-4~dfsg
- TableReader_MakeCursor at Base 2.3.3-4~dfsg
- TableReader_OpenIndex at Base 2.3.3-4~dfsg
- TableReader_PageIdRange at Base 2.3.3-4~dfsg
- TableReader_ReadRow at Base 2.3.3-4~dfsg
- TableReader_Whack at Base 2.3.3-4~dfsg
- TimeoutInit at Base 2.3.3-4~dfsg
- TimeoutPrepare at Base 2.3.3-4~dfsg
- ToHex at Base 2.3.3-4~dfsg
- TrieDoUntil at Base 2.3.3-4~dfsg
- TrieExplore at Base 2.3.3-4~dfsg
- TrieFind at Base 2.3.3-4~dfsg
- TrieFindAll at Base 2.3.3-4~dfsg
- TrieForEach at Base 2.3.3-4~dfsg
- TrieInit at Base 2.3.3-4~dfsg
- TrieInsert at Base 2.3.3-4~dfsg
- TrieInsertUnique at Base 2.3.3-4~dfsg
- TrieMapChar at Base 2.3.3-4~dfsg
- TrieNextIdx at Base 2.3.3-4~dfsg
- TriePersist at Base 2.3.3-4~dfsg
- TrieUnlink at Base 2.3.3-4~dfsg
- TrieWhack at Base 2.3.3-4~dfsg
- TruncateCacheFile at Base 2.3.3-4~dfsg
- UIDatabaseGetErrorString at Base 2.3.3-4~dfsg
- UIDatabaseLOGError at Base 2.3.3-4~dfsg
- UIError at Base 2.3.3-4~dfsg
- UITableLOGError at Base 2.3.3-4~dfsg
- URLBlockInit at Base 2.3.3-4~dfsg
- Unpack at Base 2.3.3-4~dfsg
- VBlobAddRef at Base 2.3.3-4~dfsg
- VBlobAppend at Base 2.3.3-4~dfsg
- VBlobAppendRow at Base 2.3.3-4~dfsg
- VBlobBufferSplit at Base 2.3.3-4~dfsg
- VBlobCellData at Base 2.3.3-4~dfsg
- VBlobCreateFromData at Base 2.3.3-4~dfsg
- VBlobCreateFromSingleRow at Base 2.3.3-4~dfsg
- VBlobFixedRowLength at Base 2.3.3-4~dfsg
- VBlobHeaderAddRef at Base 2.3.3-4~dfsg
- VBlobHeaderArgPopHead at Base 2.3.3-4~dfsg
- VBlobHeaderArgPopTail at Base 2.3.3-4~dfsg
- VBlobHeaderArgPushHead at Base 2.3.3-4~dfsg
- VBlobHeaderArgPushTail at Base 2.3.3-4~dfsg
- VBlobHeaderCreateFork at Base 2.3.3-4~dfsg
- VBlobHeaderFlags at Base 2.3.3-4~dfsg
- VBlobHeaderFormat at Base 2.3.3-4~dfsg
- VBlobHeaderOpPopHead at Base 2.3.3-4~dfsg
- VBlobHeaderOpPopTail at Base 2.3.3-4~dfsg
- VBlobHeaderOpPushHead at Base 2.3.3-4~dfsg
- VBlobHeaderOpPushTail at Base 2.3.3-4~dfsg
- VBlobHeaderRelease at Base 2.3.3-4~dfsg
- VBlobHeaderReplace at Base 2.3.3-4~dfsg
- VBlobHeaderSetFlags at Base 2.3.3-4~dfsg
- VBlobHeaderSetFormat at Base 2.3.3-4~dfsg
- VBlobHeaderSetSourceSize at Base 2.3.3-4~dfsg
- VBlobHeaderSetVersion at Base 2.3.3-4~dfsg
- VBlobHeaderSourceSize at Base 2.3.3-4~dfsg
- VBlobHeaderVersion at Base 2.3.3-4~dfsg
- VBlobIdRange at Base 2.3.3-4~dfsg
- VBlobIsSingleRow at Base 2.3.3-4~dfsg
- VBlobMRUCacheDestroy at Base 2.3.3-4~dfsg
- VBlobMRUCacheFind at Base 2.3.3-4~dfsg
- VBlobMRUCacheMake at Base 2.3.3-4~dfsg
- VBlobMRUCacheSave at Base 2.3.3-4~dfsg
- VBlobNew at Base 2.3.3-4~dfsg
- VBlobNewAsArray at Base 2.3.3-4~dfsg
- VBlobPageMapOptimize at Base 2.3.3-4~dfsg
- VBlobRead at Base 2.3.3-4~dfsg
- VBlobReadBits at Base 2.3.3-4~dfsg
- VBlobRelease at Base 2.3.3-4~dfsg
- VBlobSerialize at Base 2.3.3-4~dfsg
- VBlobSubblob at Base 2.3.3-4~dfsg
- VColumnCmp at Base 2.3.3-4~dfsg
- VColumnDatatype at Base 2.3.3-4~dfsg
- VColumnDestroy at Base 2.3.3-4~dfsg
- VColumnIdRange at Base 2.3.3-4~dfsg
- VColumnIdRangeRead at Base 2.3.3-4~dfsg
- VColumnInit at Base 2.3.3-4~dfsg
- VColumnIsStatic at Base 2.3.3-4~dfsg
- VColumnMake at Base 2.3.3-4~dfsg
- VColumnPageIdRange at Base 2.3.3-4~dfsg
- VColumnProdDestroy at Base 2.3.3-4~dfsg
- VColumnProdMake at Base 2.3.3-4~dfsg
- VColumnProdRead at Base 2.3.3-4~dfsg
- VColumnRead at Base 2.3.3-4~dfsg
- VColumnReadBlob at Base 2.3.3-4~dfsg
- VColumnReadCachedBlob at Base 2.3.3-4~dfsg
- VColumnRefCmpString at Base 2.3.3-4~dfsg
- VColumnRefMake at Base 2.3.3-4~dfsg
- VColumnRefSort at Base 2.3.3-4~dfsg
- VColumnRefWhack at Base 2.3.3-4~dfsg
- VColumnSort at Base 2.3.3-4~dfsg
- VColumnWhack at Base 2.3.3-4~dfsg
- VCursorAddColumn at Base 2.3.3-4~dfsg
- VCursorAddRef at Base 2.3.3-4~dfsg
- VCursorCacheGet at Base 2.3.3-4~dfsg
- VCursorCacheSet at Base 2.3.3-4~dfsg
- VCursorCacheSwap at Base 2.3.3-4~dfsg
- VCursorCacheWhack at Base 2.3.3-4~dfsg
- VCursorCellData at Base 2.3.3-4~dfsg
- VCursorCellDataDirect at Base 2.3.3-4~dfsg
- VCursorCloseRow at Base 2.3.3-4~dfsg
- VCursorCloseRowRead at Base 2.3.3-4~dfsg
- VCursorDatatype at Base 2.3.3-4~dfsg
- VCursorDestroy at Base 2.3.3-4~dfsg
- VCursorGetBlob at Base 2.3.3-4~dfsg
- VCursorGetBlobDirect at Base 2.3.3-4~dfsg
- VCursorGetColumnIdx at Base 2.3.3-4~dfsg
- VCursorGetSchema at Base 2.3.3-4~dfsg
- VCursorGetUserData at Base 2.3.3-4~dfsg
- VCursorIdRange at Base 2.3.3-4~dfsg
- VCursorIsStaticColumn at Base 2.3.3-4~dfsg
- VCursorLaunchPagemapThread at Base 2.3.3-4~dfsg
- VCursorLinkedCursorGet at Base 2.3.3-4~dfsg
- VCursorLinkedCursorSet at Base 2.3.3-4~dfsg
- VCursorListReadableColumns at Base 2.3.3-4~dfsg
- VCursorMake at Base 2.3.3-4~dfsg
- VCursorMakeColumn at Base 2.3.3-4~dfsg
- VCursorOpen at Base 2.3.3-4~dfsg
- VCursorOpenParentRead at Base 2.3.3-4~dfsg
- VCursorOpenRead at Base 2.3.3-4~dfsg
- VCursorOpenRow at Base 2.3.3-4~dfsg
- VCursorOpenRowRead at Base 2.3.3-4~dfsg
- VCursorPageIdRange at Base 2.3.3-4~dfsg
- VCursorParamsGet at Base 2.3.3-4~dfsg
- VCursorParamsSet at Base 2.3.3-4~dfsg
- VCursorParamsUnset at Base 2.3.3-4~dfsg
- VCursorParamsVSet at Base 2.3.3-4~dfsg
- VCursorPermitPostOpenAdd at Base 2.3.3-4~dfsg
- VCursorPostOpenAdd at Base 2.3.3-4~dfsg
- VCursorPostOpenAddRead at Base 2.3.3-4~dfsg
- VCursorRead at Base 2.3.3-4~dfsg
- VCursorReadBits at Base 2.3.3-4~dfsg
- VCursorReadBitsDirect at Base 2.3.3-4~dfsg
- VCursorReadDirect at Base 2.3.3-4~dfsg
- VCursorRelease at Base 2.3.3-4~dfsg
- VCursorRowId at Base 2.3.3-4~dfsg
- VCursorSetRowId at Base 2.3.3-4~dfsg
- VCursorSetRowIdRead at Base 2.3.3-4~dfsg
- VCursorSetUserData at Base 2.3.3-4~dfsg
- VCursorSupplementSchema at Base 2.3.3-4~dfsg
- VCursorSuspendTriggers at Base 2.3.3-4~dfsg
- VCursorTerminatePagemapThread at Base 2.3.3-4~dfsg
- VCursorVAddColumn at Base 2.3.3-4~dfsg
- VCursorVGetColumnIdx at Base 2.3.3-4~dfsg
- VCursorWhack at Base 2.3.3-4~dfsg
- VDBDependenciesAddRef at Base 2.3.3-4~dfsg
- VDBDependenciesCircular at Base 2.3.3-4~dfsg
- VDBDependenciesCount at Base 2.3.3-4~dfsg
- VDBDependenciesLocal at Base 2.3.3-4~dfsg
- VDBDependenciesName at Base 2.3.3-4~dfsg
- VDBDependenciesPath at Base 2.3.3-4~dfsg
- VDBDependenciesPathCache at Base 2.3.3-4~dfsg
- VDBDependenciesPathRemote at Base 2.3.3-4~dfsg
- VDBDependenciesRelease at Base 2.3.3-4~dfsg
- VDBDependenciesSeqId at Base 2.3.3-4~dfsg
- VDBDependenciesType at Base 2.3.3-4~dfsg
- VDBManagerAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VDBManagerAddRef at Base 2.3.3-4~dfsg
- VDBManagerAddSchemaIncludePath at Base 2.3.3-4~dfsg
- VDBManagerAttach at Base 2.3.3-4~dfsg
- VDBManagerConfigPaths at Base 2.3.3-4~dfsg
- VDBManagerDisablePagemapThread at Base 2.3.3-4~dfsg
- VDBManagerGetObjVersion at Base 2.3.3-4~dfsg
- VDBManagerGetUserData at Base 2.3.3-4~dfsg
- VDBManagerListExternalSchemaModules at Base 2.3.3-4~dfsg
- VDBManagerMakeRead at Base 2.3.3-4~dfsg
- VDBManagerMakeReadWithVFSManager at Base 2.3.3-4~dfsg
- VDBManagerMakeSRASchema at Base 2.3.3-4~dfsg
- VDBManagerMakeSchema at Base 2.3.3-4~dfsg
- VDBManagerOpenDBRead at Base 2.3.3-4~dfsg
- VDBManagerOpenKDBManagerRead at Base 2.3.3-4~dfsg
- VDBManagerOpenTableRead at Base 2.3.3-4~dfsg
- VDBManagerPathType at Base 2.3.3-4~dfsg
- VDBManagerRelease at Base 2.3.3-4~dfsg
- VDBManagerRunPeriodicTasks at Base 2.3.3-4~dfsg
- VDBManagerSetUserData at Base 2.3.3-4~dfsg
- VDBManagerSever at Base 2.3.3-4~dfsg
- VDBManagerVAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VDBManagerVAddSchemaIncludePath at Base 2.3.3-4~dfsg
- VDBManagerVOpenDBRead at Base 2.3.3-4~dfsg
- VDBManagerVOpenTableRead at Base 2.3.3-4~dfsg
- VDBManagerVPathType at Base 2.3.3-4~dfsg
- VDBManagerVWritable at Base 2.3.3-4~dfsg
- VDBManagerVersion at Base 2.3.3-4~dfsg
- VDBManagerWritable at Base 2.3.3-4~dfsg
- VDatabaseAddRef at Base 2.3.3-4~dfsg
- VDatabaseAttach at Base 2.3.3-4~dfsg
- VDatabaseGetUserData at Base 2.3.3-4~dfsg
- VDatabaseIsAlias at Base 2.3.3-4~dfsg
- VDatabaseListDB at Base 2.3.3-4~dfsg
- VDatabaseListDependencies at Base 2.3.3-4~dfsg
- VDatabaseListDependenciesWithCaching at Base 2.3.3-4~dfsg
- VDatabaseListTbl at Base 2.3.3-4~dfsg
- VDatabaseLoadSchema at Base 2.3.3-4~dfsg
- VDatabaseLocked at Base 2.3.3-4~dfsg
- VDatabaseMake at Base 2.3.3-4~dfsg
- VDatabaseOpenDBRead at Base 2.3.3-4~dfsg
- VDatabaseOpenKDatabaseRead at Base 2.3.3-4~dfsg
- VDatabaseOpenManagerRead at Base 2.3.3-4~dfsg
- VDatabaseOpenMetadataRead at Base 2.3.3-4~dfsg
- VDatabaseOpenParentRead at Base 2.3.3-4~dfsg
- VDatabaseOpenSchema at Base 2.3.3-4~dfsg
- VDatabaseOpenTableRead at Base 2.3.3-4~dfsg
- VDatabaseRelease at Base 2.3.3-4~dfsg
- VDatabaseSetUserData at Base 2.3.3-4~dfsg
- VDatabaseSever at Base 2.3.3-4~dfsg
- VDatabaseTypespec at Base 2.3.3-4~dfsg
- VDatabaseVOpenDBRead at Base 2.3.3-4~dfsg
- VDatabaseVOpenTableRead at Base 2.3.3-4~dfsg
- VDatabaseVWritable at Base 2.3.3-4~dfsg
- VDatabaseWhack at Base 2.3.3-4~dfsg
- VDatabaseWritable at Base 2.3.3-4~dfsg
- VDatatypesAddRef at Base 2.3.3-4~dfsg
- VDatatypesMakeTypedecl at Base 2.3.3-4~dfsg
- VDatatypesRelease at Base 2.3.3-4~dfsg
- VDatatypesResolveTypedecl at Base 2.3.3-4~dfsg
- VDatatypesResolveTypeid at Base 2.3.3-4~dfsg
- VDatatypesResolveTypename at Base 2.3.3-4~dfsg
- VDatatypesSizeofTypedecl at Base 2.3.3-4~dfsg
- VDatatypesSizeofTypeid at Base 2.3.3-4~dfsg
- VDatatypesToAncestor at Base 2.3.3-4~dfsg
- VDatatypesToIntrinsic at Base 2.3.3-4~dfsg
- VDatatypesToSupertype at Base 2.3.3-4~dfsg
- VDatatypesVResolveTypedecl at Base 2.3.3-4~dfsg
- VFSManagerAddRef at Base 2.3.3-4~dfsg
- VFSManagerCreateFile at Base 2.3.3-4~dfsg
- VFSManagerGetBindingsFile at Base 2.3.3-4~dfsg
- VFSManagerGetCWD at Base 2.3.3-4~dfsg
- VFSManagerGetConfig at Base 2.3.3-4~dfsg
- VFSManagerGetKryptoPassword at Base 2.3.3-4~dfsg
- VFSManagerGetObject at Base 2.3.3-4~dfsg
- VFSManagerGetObjectId at Base 2.3.3-4~dfsg
- VFSManagerGetResolver at Base 2.3.3-4~dfsg
- VFSManagerMake at Base 2.3.3-4~dfsg
- VFSManagerMakeAccPath at Base 2.3.3-4~dfsg
- VFSManagerMakeFromKfg at Base 2.3.3-4~dfsg
- VFSManagerMakeOidPath at Base 2.3.3-4~dfsg
- VFSManagerMakePath at Base 2.3.3-4~dfsg
- VFSManagerMakeResolver at Base 2.3.3-4~dfsg
- VFSManagerMakeSysPath at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryRead at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryUpdate at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryUpdateDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenFileRead at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDirectoryRelativeDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenFileWrite at Base 2.3.3-4~dfsg
- VFSManagerOpenXTocDirRead at Base 2.3.3-4~dfsg
- VFSManagerRegisterObject at Base 2.3.3-4~dfsg
- VFSManagerRelease at Base 2.3.3-4~dfsg
- VFSManagerRemove at Base 2.3.3-4~dfsg
- VFSManagerResolvePath at Base 2.3.3-4~dfsg
- VFSManagerResolvePathRelative at Base 2.3.3-4~dfsg
- VFSManagerResolvePathRelativeDir at Base 2.3.3-4~dfsg
- VFSManagerResolveSpec at Base 2.3.3-4~dfsg
- VFSManagerSetBindingsFile at Base 2.3.3-4~dfsg
- VFSManagerUpdateKryptoPassword at Base 2.3.3-4~dfsg
- VFSManagerVMakeAccPath at Base 2.3.3-4~dfsg
- VFSManagerVMakePath at Base 2.3.3-4~dfsg
- VFSManagerWGAValidateHack at Base 2.3.3-4~dfsg
- VFSManagerWMakeSysPath at Base 2.3.3-4~dfsg
- VFormatdeclCommonAncestor at Base 2.3.3-4~dfsg
- VFormatdeclDump at Base 2.3.3-4~dfsg
- VFormatdeclToFormatdecl at Base 2.3.3-4~dfsg
- VFormatdeclToText at Base 2.3.3-4~dfsg
- VFunctionProdColumnIdRange at Base 2.3.3-4~dfsg
- VFunctionProdDestroy at Base 2.3.3-4~dfsg
- VFunctionProdMake at Base 2.3.3-4~dfsg
- VFunctionProdMakeBuiltInComp at Base 2.3.3-4~dfsg
- VFunctionProdRead at Base 2.3.3-4~dfsg
- VKKeyStoreGetObjectId at Base 2.3.3-4~dfsg
- VLinkerAddFactories at Base 2.3.3-4~dfsg
- VLinkerAttach at Base 2.3.3-4~dfsg
- VLinkerFindFactory at Base 2.3.3-4~dfsg
- VLinkerFindNamedFactory at Base 2.3.3-4~dfsg
- VLinkerFindUntyped at Base 2.3.3-4~dfsg
- VLinkerInitFactories at Base 2.3.3-4~dfsg
- VLinkerInitFactoriesRead at Base 2.3.3-4~dfsg
- VLinkerListExternalSchemaModules at Base 2.3.3-4~dfsg
- VLinkerMake at Base 2.3.3-4~dfsg
- VLinkerMakeIntrinsic at Base 2.3.3-4~dfsg
- VLinkerOpen at Base 2.3.3-4~dfsg
- VLinkerRelease at Base 2.3.3-4~dfsg
- VLinkerSever at Base 2.3.3-4~dfsg
- VLinkerVAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VNameListCount at Base 2.3.3-4~dfsg
- VNameListGet at Base 2.3.3-4~dfsg
- VNamelistAppend at Base 2.3.3-4~dfsg
- VNamelistAppendString at Base 2.3.3-4~dfsg
- VNamelistIndexOf at Base 2.3.3-4~dfsg
- VNamelistMake at Base 2.3.3-4~dfsg
- VNamelistRelease at Base 2.3.3-4~dfsg
- VNamelistRemove at Base 2.3.3-4~dfsg
- VNamelistReorder at Base 2.3.3-4~dfsg
- VNamelistToConstNamelist at Base 2.3.3-4~dfsg
- VNamelistToNamelist at Base 2.3.3-4~dfsg
- VPathAddRef at Base 2.3.3-4~dfsg
- VPathFromUri at Base 2.3.3-4~dfsg
- VPathGetAuth at Base 2.3.3-4~dfsg
- VPathGetFragment at Base 2.3.3-4~dfsg
- VPathGetHost at Base 2.3.3-4~dfsg
- VPathGetOid at Base 2.3.3-4~dfsg
- VPathGetParam at Base 2.3.3-4~dfsg
- VPathGetPath at Base 2.3.3-4~dfsg
- VPathGetPortName at Base 2.3.3-4~dfsg
- VPathGetPortNum at Base 2.3.3-4~dfsg
- VPathGetQuery at Base 2.3.3-4~dfsg
- VPathGetScheme at Base 2.3.3-4~dfsg
- VPathIsFSCompatible at Base 2.3.3-4~dfsg
- VPathMakeString at Base 2.3.3-4~dfsg
- VPathMakeUri at Base 2.3.3-4~dfsg
- VPathOption at Base 2.3.3-4~dfsg
- VPathReadAuth at Base 2.3.3-4~dfsg
- VPathReadFragment at Base 2.3.3-4~dfsg
- VPathReadHost at Base 2.3.3-4~dfsg
- VPathReadParam at Base 2.3.3-4~dfsg
- VPathReadPath at Base 2.3.3-4~dfsg
- VPathReadPortName at Base 2.3.3-4~dfsg
- VPathReadQuery at Base 2.3.3-4~dfsg
- VPathReadScheme at Base 2.3.3-4~dfsg
- VPathReadUri at Base 2.3.3-4~dfsg
- VPathRelease at Base 2.3.3-4~dfsg
- VPhysicalDestroy at Base 2.3.3-4~dfsg
- VPhysicalFinishKColumn at Base 2.3.3-4~dfsg
- VPhysicalFinishStatic at Base 2.3.3-4~dfsg
- VPhysicalIsStatic at Base 2.3.3-4~dfsg
- VPhysicalLoadMetadata at Base 2.3.3-4~dfsg
- VPhysicalMake at Base 2.3.3-4~dfsg
- VPhysicalOpenRead at Base 2.3.3-4~dfsg
- VPhysicalProdColumnIdRange at Base 2.3.3-4~dfsg
- VPhysicalProdDestroy at Base 2.3.3-4~dfsg
- VPhysicalProdFixedRowLength at Base 2.3.3-4~dfsg
- VPhysicalProdMake at Base 2.3.3-4~dfsg
- VPhysicalProdRead at Base 2.3.3-4~dfsg
- VPhysicalRead at Base 2.3.3-4~dfsg
- VPhysicalReadBlob at Base 2.3.3-4~dfsg
- VPhysicalWhack at Base 2.3.3-4~dfsg
- VProdResolveColumn at Base 2.3.3-4~dfsg
- VProdResolveColumnRead at Base 2.3.3-4~dfsg
- VProdResolveColumnRoot at Base 2.3.3-4~dfsg
- VProdResolveEncodingExpr at Base 2.3.3-4~dfsg
- VProdResolveExpr at Base 2.3.3-4~dfsg
- VProdResolveFuncExpr at Base 2.3.3-4~dfsg
- VProdResolveParamExpr at Base 2.3.3-4~dfsg
- VProdResolvePhysical at Base 2.3.3-4~dfsg
- VProdResolvePhysicalRead at Base 2.3.3-4~dfsg
- VProdResolveSPhysMember at Base 2.3.3-4~dfsg
- VProdResolveSProduction at Base 2.3.3-4~dfsg
- VProdResolveScriptExpr at Base 2.3.3-4~dfsg
- VProductionCmp at Base 2.3.3-4~dfsg
- VProductionColumnIdRange at Base 2.3.3-4~dfsg
- VProductionFixedRowLength at Base 2.3.3-4~dfsg
- VProductionIsStatic at Base 2.3.3-4~dfsg
- VProductionMake at Base 2.3.3-4~dfsg
- VProductionPageIdRange at Base 2.3.3-4~dfsg
- VProductionReadBlob at Base 2.3.3-4~dfsg
- VProductionRowLength at Base 2.3.3-4~dfsg
- VProductionSort at Base 2.3.3-4~dfsg
- VProductionWhack at Base 2.3.3-4~dfsg
- VResolverAddRef at Base 2.3.3-4~dfsg
- VResolverCache at Base 2.3.3-4~dfsg
- VResolverCacheEnable at Base 2.3.3-4~dfsg
- VResolverLocal at Base 2.3.3-4~dfsg
- VResolverLocalEnable at Base 2.3.3-4~dfsg
- VResolverProtocols at Base 2.3.3-4~dfsg
- VResolverQuery at Base 2.3.3-4~dfsg
- VResolverRelease at Base 2.3.3-4~dfsg
- VResolverRemote at Base 2.3.3-4~dfsg
- VResolverRemoteEnable at Base 2.3.3-4~dfsg
- VSchemaAddIncludePath at Base 2.3.3-4~dfsg
- VSchemaAddRef at Base 2.3.3-4~dfsg
- VSchemaAttach at Base 2.3.3-4~dfsg
- VSchemaCacheIntrinsicTypeId at Base 2.3.3-4~dfsg
- VSchemaClearMark at Base 2.3.3-4~dfsg
- VSchemaClearPhysMark at Base 2.3.3-4~dfsg
- VSchemaDebugPrint at Base 2.3.3-4~dfsg
- VSchemaDescribeTypedecl at Base 2.3.3-4~dfsg
- VSchemaDescribeTypedef at Base 2.3.3-4~dfsg
- VSchemaDump at Base 2.3.3-4~dfsg
- VSchemaFind at Base 2.3.3-4~dfsg
- VSchemaFindFmtid at Base 2.3.3-4~dfsg
- VSchemaFindITypeid at Base 2.3.3-4~dfsg
- VSchemaFindTypeid at Base 2.3.3-4~dfsg
- VSchemaFindTypesetid at Base 2.3.3-4~dfsg
- VSchemaImplicitPhysEncExpr at Base 2.3.3-4~dfsg
- VSchemaIncludeFiles at Base 2.3.3-4~dfsg
- VSchemaLastIntrinsicTypeId at Base 2.3.3-4~dfsg
- VSchemaListLegacyTables at Base 2.3.3-4~dfsg
- VSchemaMake at Base 2.3.3-4~dfsg
- VSchemaMakeIntrinsic at Base 2.3.3-4~dfsg
- VSchemaMakeRuntimeTable at Base 2.3.3-4~dfsg
- VSchemaParseFile at Base 2.3.3-4~dfsg
- VSchemaParseText at Base 2.3.3-4~dfsg
- VSchemaParseTextCallback at Base 2.3.3-4~dfsg
- VSchemaRelease at Base 2.3.3-4~dfsg
- VSchemaResolveFmtdecl at Base 2.3.3-4~dfsg
- VSchemaResolveTypedecl at Base 2.3.3-4~dfsg
- VSchemaResolveTypespec at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddAsciiColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddBooleanColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddFloatColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddIntegerColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddUnicodeColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableClose at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableCommit at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddAsciiColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddBooleanColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddFloatColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddIntegerColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddUnicodeColumn at Base 2.3.3-4~dfsg
- VSchemaSever at Base 2.3.3-4~dfsg
- VSchemaToText at Base 2.3.3-4~dfsg
- VSchemaTypeMark at Base 2.3.3-4~dfsg
- VSchemaVAddIncludePath at Base 2.3.3-4~dfsg
- VSchemaVParseFile at Base 2.3.3-4~dfsg
- VSchemaVResolveFmtdecl at Base 2.3.3-4~dfsg
- VSchemaVResolveTypedecl at Base 2.3.3-4~dfsg
- VSchemaVResolveTypespec at Base 2.3.3-4~dfsg
- VScriptProdDestroy at Base 2.3.3-4~dfsg
- VScriptProdMake at Base 2.3.3-4~dfsg
- VScriptProdRead at Base 2.3.3-4~dfsg
- VSimpleProdMake at Base 2.3.3-4~dfsg
- VSimpleProdRead at Base 2.3.3-4~dfsg
- VTableAddRef at Base 2.3.3-4~dfsg
- VTableAttach at Base 2.3.3-4~dfsg
- VTableColumnDatatypes at Base 2.3.3-4~dfsg
- VTableCreateCachedCursorRead at Base 2.3.3-4~dfsg
- VTableCreateCursorRead at Base 2.3.3-4~dfsg
- VTableCreateCursorReadInternal at Base 2.3.3-4~dfsg
- VTableExtendSchema at Base 2.3.3-4~dfsg
- VTableGetUserData at Base 2.3.3-4~dfsg
- VTableHasStaticColumn at Base 2.3.3-4~dfsg
- VTableListCol at Base 2.3.3-4~dfsg
- VTableListPhysColumns at Base 2.3.3-4~dfsg
- VTableListReadableColumns at Base 2.3.3-4~dfsg
- VTableListReadableDatatypes at Base 2.3.3-4~dfsg
- VTableListWritableColumns at Base 2.3.3-4~dfsg
- VTableListWritableDatatypes at Base 2.3.3-4~dfsg
- VTableLoadSchema at Base 2.3.3-4~dfsg
- VTableLocked at Base 2.3.3-4~dfsg
- VTableMake at Base 2.3.3-4~dfsg
- VTableOpenIndexRead at Base 2.3.3-4~dfsg
- VTableOpenKTableRead at Base 2.3.3-4~dfsg
- VTableOpenManagerRead at Base 2.3.3-4~dfsg
- VTableOpenMetadataRead at Base 2.3.3-4~dfsg
- VTableOpenParentRead at Base 2.3.3-4~dfsg
- VTableOpenSchema at Base 2.3.3-4~dfsg
- VTableRelease at Base 2.3.3-4~dfsg
- VTableSetUserData at Base 2.3.3-4~dfsg
- VTableSever at Base 2.3.3-4~dfsg
- VTableTypespec at Base 2.3.3-4~dfsg
- VTableVOpenIndexRead at Base 2.3.3-4~dfsg
- VTableVWritable at Base 2.3.3-4~dfsg
- VTableWhack at Base 2.3.3-4~dfsg
- VTableWritable at Base 2.3.3-4~dfsg
- VTypedeclCommonAncestor at Base 2.3.3-4~dfsg
- VTypedeclDump at Base 2.3.3-4~dfsg
- VTypedeclToSupertype at Base 2.3.3-4~dfsg
- VTypedeclToText at Base 2.3.3-4~dfsg
- VTypedeclToType at Base 2.3.3-4~dfsg
- VTypedeclToTypedecl at Base 2.3.3-4~dfsg
- VTypedescSizeof at Base 2.3.3-4~dfsg
- VectMbrWhack at Base 2.3.3-4~dfsg
- VectorAppend at Base 2.3.3-4~dfsg
- VectorCopy at Base 2.3.3-4~dfsg
- VectorDoUntil at Base 2.3.3-4~dfsg
- VectorFind at Base 2.3.3-4~dfsg
- VectorFirst at Base 2.3.3-4~dfsg
- VectorForEach at Base 2.3.3-4~dfsg
- VectorGet at Base 2.3.3-4~dfsg
- VectorInit at Base 2.3.3-4~dfsg
- VectorInsert at Base 2.3.3-4~dfsg
- VectorInsertUnique at Base 2.3.3-4~dfsg
- VectorLast at Base 2.3.3-4~dfsg
- VectorMerge at Base 2.3.3-4~dfsg
- VectorRemove at Base 2.3.3-4~dfsg
- VectorReorder at Base 2.3.3-4~dfsg
- VectorSet at Base 2.3.3-4~dfsg
- VectorSwap at Base 2.3.3-4~dfsg
- VectorWhack at Base 2.3.3-4~dfsg
- WGAEncValidate at Base 2.3.3-4~dfsg
- XTocEntryPathType at Base 2.3.3-4~dfsg
- XTocEntryResolvePath at Base 2.3.3-4~dfsg
- XTocListingMake at Base 2.3.3-4~dfsg
- XTocMakePath at Base 2.3.3-4~dfsg
- XTocParseXml at Base 2.3.3-4~dfsg
- XTocTreeAddArchive at Base 2.3.3-4~dfsg
- XTocTreeAddContainer at Base 2.3.3-4~dfsg
- XTocTreeAddDir at Base 2.3.3-4~dfsg
- XTocTreeAddFile at Base 2.3.3-4~dfsg
- XTocTreeAddSymlink at Base 2.3.3-4~dfsg
- alloc_chunk at Base 2.3.3-4~dfsg
- alloc_chunk_and_zero at Base 2.3.3-4~dfsg
- ascpParse at Base 2.3.3-4~dfsg
- ascp_locate at Base 2.3.3-4~dfsg
- ascp_path at Base 2.3.3-4~dfsg
- aspera_get at Base 2.3.3-4~dfsg
- check_rd_len at Base 2.3.3-4~dfsg
- chunk_add_in at Base 2.3.3-4~dfsg
- chunk_and_in at Base 2.3.3-4~dfsg
- chunk_isbit_set at Base 2.3.3-4~dfsg
- chunk_lshift_one at Base 2.3.3-4~dfsg
- chunk_lshift_one_inplace at Base 2.3.3-4~dfsg
- chunk_negate at Base 2.3.3-4~dfsg
- chunk_or_in at Base 2.3.3-4~dfsg
- chunk_set at Base 2.3.3-4~dfsg
- chunk_set_bit at Base 2.3.3-4~dfsg
- chunk_set_minusone at Base 2.3.3-4~dfsg
- chunk_xor_in at Base 2.3.3-4~dfsg
- chunk_zero at Base 2.3.3-4~dfsg
- chunksize at Base 2.3.3-4~dfsg
- cond_expr at Base 2.3.3-4~dfsg
- const_expr at Base 2.3.3-4~dfsg
- cp1252 at Base 2.3.3-4~dfsg
- create_fqn at Base 2.3.3-4~dfsg
- database_declaration at Base 2.3.3-4~dfsg
- debug_callback at Base 2.3.3-4~dfsg
- dim at Base 2.3.3-4~dfsg
- dp_end_callback at Base 2.3.3-4~dfsg
- dp_scan_for_left_match at Base 2.3.3-4~dfsg
- echo_row_0 at Base 2.3.3-4~dfsg
- edit_distance at Base 2.3.3-4~dfsg
- eval_const_expr at Base 2.3.3-4~dfsg
- eval_expr_syntax at Base 2.3.3-4~dfsg
- eval_numeric_expr at Base 2.3.3-4~dfsg
- eval_text_expr at Base 2.3.3-4~dfsg
- eval_uint64_expr at Base 2.3.3-4~dfsg
- eval_uint_expr at Base 2.3.3-4~dfsg
- ex_encode16 at Base 2.3.3-4~dfsg
- ex_encode32 at Base 2.3.3-4~dfsg
- ex_encode64 at Base 2.3.3-4~dfsg
- ex_encode8 at Base 2.3.3-4~dfsg
- exists_row_0 at Base 2.3.3-4~dfsg
- expect at Base 2.3.3-4~dfsg
- expression at Base 2.3.3-4~dfsg
- extfunc_declaration at Base 2.3.3-4~dfsg
- fact_signature at Base 2.3.3-4~dfsg
- fmtdecl at Base 2.3.3-4~dfsg
- fmtname at Base 2.3.3-4~dfsg
- fmtspec at Base 2.3.3-4~dfsg
- format_definition at Base 2.3.3-4~dfsg
- free_chunk at Base 2.3.3-4~dfsg
- free_chunk_parts at Base 2.3.3-4~dfsg
- function_declaration at Base 2.3.3-4~dfsg
- gRCContextIdx_str at Base 2.3.3-4~dfsg
- gRCContext_str at Base 2.3.3-4~dfsg
- gRCModuleIdx_str at Base 2.3.3-4~dfsg
- gRCModule_str at Base 2.3.3-4~dfsg
- gRCObjectIdx_str at Base 2.3.3-4~dfsg
- gRCObject_str at Base 2.3.3-4~dfsg
- gRCStateIdx_str at Base 2.3.3-4~dfsg
- gRCState_str at Base 2.3.3-4~dfsg
- gRCTargetIdx_str at Base 2.3.3-4~dfsg
- gRCTarget_str at Base 2.3.3-4~dfsg
- get_mode_string at Base 2.3.3-4~dfsg
- gv_local at Base 2.3.3-4~dfsg
- has_inside_approx_match at Base 2.3.3-4~dfsg
- has_inside_exact_match at Base 2.3.3-4~dfsg
- has_left_approx_match at Base 2.3.3-4~dfsg
- has_left_exact_match at Base 2.3.3-4~dfsg
- has_right_approx_match at Base 2.3.3-4~dfsg
- has_right_exact_match at Base 2.3.3-4~dfsg
- idx_text_lookup at Base 2.3.3-4~dfsg
- idx_text_project at Base 2.3.3-4~dfsg
- indirect_const_expr at Base 2.3.3-4~dfsg
- init_db_symtab at Base 2.3.3-4~dfsg
- init_symtab at Base 2.3.3-4~dfsg
- init_tbl_symtab at Base 2.3.3-4~dfsg
- iso8859_1 at Base 2.3.3-4~dfsg
- iso8859_cvt_string_copy at Base 2.3.3-4~dfsg
- iso8859_cvt_string_len at Base 2.3.3-4~dfsg
- iso8859_cvt_string_measure at Base 2.3.3-4~dfsg
- iso8859_string_len at Base 2.3.3-4~dfsg
- iso8859_string_measure at Base 2.3.3-4~dfsg
- iso8859_string_size at Base 2.3.3-4~dfsg
- iso8859_utf32 at Base 2.3.3-4~dfsg
- iunzip_func_v0 at Base 2.3.3-4~dfsg
- j__1_BranchBJPPopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf2PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf3PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf4PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf5PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf6PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf7PopToWords at Base 2.3.3-4~dfsg
- j__1_LeafWPopToWords at Base 2.3.3-4~dfsg
- j__L_BranchBJPPopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf1Offset at Base 2.3.3-4~dfsg
- j__L_Leaf1PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf2Offset at Base 2.3.3-4~dfsg
- j__L_Leaf2PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf3Offset at Base 2.3.3-4~dfsg
- j__L_Leaf3PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf4Offset at Base 2.3.3-4~dfsg
- j__L_Leaf4PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf5Offset at Base 2.3.3-4~dfsg
- j__L_Leaf5PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf6Offset at Base 2.3.3-4~dfsg
- j__L_Leaf6PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf7Offset at Base 2.3.3-4~dfsg
- j__L_Leaf7PopToWords at Base 2.3.3-4~dfsg
- j__L_LeafVPopToWords at Base 2.3.3-4~dfsg
- j__L_LeafWOffset at Base 2.3.3-4~dfsg
- j__L_LeafWPopToWords at Base 2.3.3-4~dfsg
- j__u1MaxWords at Base 2.3.3-4~dfsg
- j__uLMaxWords at Base 2.3.3-4~dfsg
- j__udy1AllocJ1PM at Base 2.3.3-4~dfsg
- j__udy1AllocJBB at Base 2.3.3-4~dfsg
- j__udy1AllocJBBJP at Base 2.3.3-4~dfsg
- j__udy1AllocJBL at Base 2.3.3-4~dfsg
- j__udy1AllocJBU at Base 2.3.3-4~dfsg
- j__udy1AllocJLB1 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL2 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL3 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL4 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL5 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL6 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL7 at Base 2.3.3-4~dfsg
- j__udy1AllocJLW at Base 2.3.3-4~dfsg
- j__udy1BranchBToBranchL at Base 2.3.3-4~dfsg
- j__udy1Cascade2 at Base 2.3.3-4~dfsg
- j__udy1Cascade3 at Base 2.3.3-4~dfsg
- j__udy1Cascade4 at Base 2.3.3-4~dfsg
- j__udy1Cascade5 at Base 2.3.3-4~dfsg
- j__udy1Cascade6 at Base 2.3.3-4~dfsg
- j__udy1Cascade7 at Base 2.3.3-4~dfsg
- j__udy1CascadeL at Base 2.3.3-4~dfsg
- j__udy1CreateBranchB at Base 2.3.3-4~dfsg
- j__udy1CreateBranchL at Base 2.3.3-4~dfsg
- j__udy1CreateBranchU at Base 2.3.3-4~dfsg
- j__udy1FreeJ1PM at Base 2.3.3-4~dfsg
- j__udy1FreeJBB at Base 2.3.3-4~dfsg
- j__udy1FreeJBBJP at Base 2.3.3-4~dfsg
- j__udy1FreeJBL at Base 2.3.3-4~dfsg
- j__udy1FreeJBU at Base 2.3.3-4~dfsg
- j__udy1FreeJLB1 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL2 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL3 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL4 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL5 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL6 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL7 at Base 2.3.3-4~dfsg
- j__udy1FreeJLW at Base 2.3.3-4~dfsg
- j__udy1FreeSM at Base 2.3.3-4~dfsg
- j__udy1InsertBranch at Base 2.3.3-4~dfsg
- j__udy1JPPop1 at Base 2.3.3-4~dfsg
- j__udy1Leaf1ToLeaf2 at Base 2.3.3-4~dfsg
- j__udy1Leaf2ToLeaf3 at Base 2.3.3-4~dfsg
- j__udy1Leaf3ToLeaf4 at Base 2.3.3-4~dfsg
- j__udy1Leaf4ToLeaf5 at Base 2.3.3-4~dfsg
- j__udy1Leaf5ToLeaf6 at Base 2.3.3-4~dfsg
- j__udy1Leaf6ToLeaf7 at Base 2.3.3-4~dfsg
- j__udy1Leaf7ToLeafW at Base 2.3.3-4~dfsg
- j__udy1Test at Base 2.3.3-4~dfsg
- j__udyLAllocJBB at Base 2.3.3-4~dfsg
- j__udyLAllocJBBJP at Base 2.3.3-4~dfsg
- j__udyLAllocJBL at Base 2.3.3-4~dfsg
- j__udyLAllocJBU at Base 2.3.3-4~dfsg
- j__udyLAllocJLB1 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL1 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL2 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL3 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL4 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL5 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL6 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL7 at Base 2.3.3-4~dfsg
- j__udyLAllocJLPM at Base 2.3.3-4~dfsg
- j__udyLAllocJLW at Base 2.3.3-4~dfsg
- j__udyLAllocJV at Base 2.3.3-4~dfsg
- j__udyLBranchBToBranchL at Base 2.3.3-4~dfsg
- j__udyLCascade1 at Base 2.3.3-4~dfsg
- j__udyLCascade2 at Base 2.3.3-4~dfsg
- j__udyLCascade3 at Base 2.3.3-4~dfsg
- j__udyLCascade4 at Base 2.3.3-4~dfsg
- j__udyLCascade5 at Base 2.3.3-4~dfsg
- j__udyLCascade6 at Base 2.3.3-4~dfsg
- j__udyLCascade7 at Base 2.3.3-4~dfsg
- j__udyLCascadeL at Base 2.3.3-4~dfsg
- j__udyLCreateBranchB at Base 2.3.3-4~dfsg
- j__udyLCreateBranchL at Base 2.3.3-4~dfsg
- j__udyLCreateBranchU at Base 2.3.3-4~dfsg
- j__udyLFreeJBB at Base 2.3.3-4~dfsg
- j__udyLFreeJBBJP at Base 2.3.3-4~dfsg
- j__udyLFreeJBL at Base 2.3.3-4~dfsg
- j__udyLFreeJBU at Base 2.3.3-4~dfsg
- j__udyLFreeJLB1 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL1 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL2 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL3 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL4 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL5 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL6 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL7 at Base 2.3.3-4~dfsg
- j__udyLFreeJLPM at Base 2.3.3-4~dfsg
- j__udyLFreeJLW at Base 2.3.3-4~dfsg
- j__udyLFreeJV at Base 2.3.3-4~dfsg
- j__udyLFreeSM at Base 2.3.3-4~dfsg
- j__udyLGet at Base 2.3.3-4~dfsg
- j__udyLInsertBranch at Base 2.3.3-4~dfsg
- j__udyLJPPop1 at Base 2.3.3-4~dfsg
- j__udyLLeaf1ToLeaf2 at Base 2.3.3-4~dfsg
- j__udyLLeaf2ToLeaf3 at Base 2.3.3-4~dfsg
- j__udyLLeaf3ToLeaf4 at Base 2.3.3-4~dfsg
- j__udyLLeaf4ToLeaf5 at Base 2.3.3-4~dfsg
- j__udyLLeaf5ToLeaf6 at Base 2.3.3-4~dfsg
- j__udyLLeaf6ToLeaf7 at Base 2.3.3-4~dfsg
- j__udyLLeaf7ToLeafW at Base 2.3.3-4~dfsg
- j__udyLLeafB1ToLeaf1 at Base 2.3.3-4~dfsg
- kbsearch at Base 2.3.3-4~dfsg
- kfprintf at Base 2.3.3-4~dfsg
- kprintf at Base 2.3.3-4~dfsg
- ksort at Base 2.3.3-4~dfsg
- ksort_int32_t at Base 2.3.3-4~dfsg
- ksort_int64_t at Base 2.3.3-4~dfsg
- ksort_uint32_t at Base 2.3.3-4~dfsg
- ksort_uint64_t at Base 2.3.3-4~dfsg
- lshift_chunk at Base 2.3.3-4~dfsg
- maj_min_rel at Base 2.3.3-4~dfsg
- make_column_namelist at Base 2.3.3-4~dfsg
- make_column_typelist at Base 2.3.3-4~dfsg
- meta_attr_read at Base 2.3.3-4~dfsg
- meta_read at Base 2.3.3-4~dfsg
- meta_value at Base 2.3.3-4~dfsg
- mkAscpCmd at Base 2.3.3-4~dfsg
- na4_match at Base 2.3.3-4~dfsg
- na4_set_bits at Base 2.3.3-4~dfsg
- next_fqn at Base 2.3.3-4~dfsg
- old_kfprintf at Base 2.3.3-4~dfsg
- old_string_printf at Base 2.3.3-4~dfsg
- old_string_vprintf at Base 2.3.3-4~dfsg
- old_vkfprintf at Base 2.3.3-4~dfsg
- pLogErr at Base 2.3.3-4~dfsg
- pLogLibErr at Base 2.3.3-4~dfsg
- pLogLibMsg at Base 2.3.3-4~dfsg
- pLogMsg at Base 2.3.3-4~dfsg
- parameter_read at Base 2.3.3-4~dfsg
- parse_Q at Base 2.3.3-4~dfsg
- parse_decimal at Base 2.3.3-4~dfsg
- phys_encoding_expr at Base 2.3.3-4~dfsg
- physical_declaration at Base 2.3.3-4~dfsg
- physical_name at Base 2.3.3-4~dfsg
- pop_db_scope at Base 2.3.3-4~dfsg
- pop_tbl_scope at Base 2.3.3-4~dfsg
- print_char_fixup at Base 2.3.3-4~dfsg
- print_chunk at Base 2.3.3-4~dfsg
- print_float_fixup at Base 2.3.3-4~dfsg
- print_int_fixup at Base 2.3.3-4~dfsg
- production_stmt at Base 2.3.3-4~dfsg
- push_db_scope at Base 2.3.3-4~dfsg
- push_out at Base 2.3.3-4~dfsg
- push_tbl_scope at Base 2.3.3-4~dfsg
- resolve_object at Base 2.3.3-4~dfsg
- run_ascp at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsF64 at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsU32 at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsU64 at Base 2.3.3-4~dfsg
- s_KXMLNode_readTextNode at Base 2.3.3-4~dfsg
- schema at Base 2.3.3-4~dfsg
- schema_signature at Base 2.3.3-4~dfsg
- script_body at Base 2.3.3-4~dfsg
- script_declaration at Base 2.3.3-4~dfsg
- silent_system at Base 2.3.3-4~dfsg
- sra_decompress_clp at Base 2.3.3-4~dfsg
- sra_decompress_init at Base 2.3.3-4~dfsg
- sra_decompress_int at Base 2.3.3-4~dfsg
- sra_decompress_nse at Base 2.3.3-4~dfsg
- sra_decompress_pos at Base 2.3.3-4~dfsg
- sra_decompress_prb_454 at Base 2.3.3-4~dfsg
- sra_decompress_prb_slx at Base 2.3.3-4~dfsg
- sra_decompress_sig_454 at Base 2.3.3-4~dfsg
- sra_decompress_sig_slx at Base 2.3.3-4~dfsg
- sra_schema_size at Base 2.3.3-4~dfsg
- sra_schema_text at Base 2.3.3-4~dfsg
- strcase_cmp at Base 2.3.3-4~dfsg
- strcase_match at Base 2.3.3-4~dfsg
- string_chr at Base 2.3.3-4~dfsg
- string_cmp at Base 2.3.3-4~dfsg
- string_copy at Base 2.3.3-4~dfsg
- string_copy_measure at Base 2.3.3-4~dfsg
- string_cvt_wchar_copy at Base 2.3.3-4~dfsg
- string_dup at Base 2.3.3-4~dfsg
- string_dup_measure at Base 2.3.3-4~dfsg
- string_hash at Base 2.3.3-4~dfsg
- string_idx at Base 2.3.3-4~dfsg
- string_len at Base 2.3.3-4~dfsg
- string_match at Base 2.3.3-4~dfsg
- string_measure at Base 2.3.3-4~dfsg
- string_printf at Base 2.3.3-4~dfsg
- string_rchr at Base 2.3.3-4~dfsg
- string_size at Base 2.3.3-4~dfsg
- string_vprintf at Base 2.3.3-4~dfsg
- structured_printf at Base 2.3.3-4~dfsg
- structured_sprintf at Base 2.3.3-4~dfsg
- table_declaration at Base 2.3.3-4~dfsg
- tolower_copy at Base 2.3.3-4~dfsg
- toupper_copy at Base 2.3.3-4~dfsg
- type_definition at Base 2.3.3-4~dfsg
- type_expr at Base 2.3.3-4~dfsg
- typedecl at Base 2.3.3-4~dfsg
- typename at Base 2.3.3-4~dfsg
- typeset at Base 2.3.3-4~dfsg
- typeset_definition at Base 2.3.3-4~dfsg
- typespec at Base 2.3.3-4~dfsg
- unpack_8_from_1_arr at Base 2.3.3-4~dfsg
- unpack_8_from_2_arr at Base 2.3.3-4~dfsg
- untyped_expr at Base 2.3.3-4~dfsg
- utf16_cvt_string_copy at Base 2.3.3-4~dfsg
- utf16_cvt_string_len at Base 2.3.3-4~dfsg
- utf16_cvt_string_measure at Base 2.3.3-4~dfsg
- utf16_string_len at Base 2.3.3-4~dfsg
- utf16_string_measure at Base 2.3.3-4~dfsg
- utf16_string_size at Base 2.3.3-4~dfsg
- utf32_cvt_string_copy at Base 2.3.3-4~dfsg
- utf32_cvt_string_len at Base 2.3.3-4~dfsg
- utf32_cvt_string_measure at Base 2.3.3-4~dfsg
- utf32_string_len at Base 2.3.3-4~dfsg
- utf32_string_measure at Base 2.3.3-4~dfsg
- utf32_string_size at Base 2.3.3-4~dfsg
- utf32_utf8 at Base 2.3.3-4~dfsg
- utf8_utf32 at Base 2.3.3-4~dfsg
- vLogErr at Base 2.3.3-4~dfsg
- vLogLibErr at Base 2.3.3-4~dfsg
- vLogLibMsg at Base 2.3.3-4~dfsg
- vLogMsg at Base 2.3.3-4~dfsg
- valfunc_declaration at Base 2.3.3-4~dfsg
- validate_header_offsets at Base 2.3.3-4~dfsg
- vardim_type_expr at Base 2.3.3-4~dfsg
- vdb_add_row_id at Base 2.3.3-4~dfsg
- vdb_bit_or at Base 2.3.3-4~dfsg
- vdb_bunzip at Base 2.3.3-4~dfsg
- vdb_cast at Base 2.3.3-4~dfsg
- vdb_ceil at Base 2.3.3-4~dfsg
- vdb_clip at Base 2.3.3-4~dfsg
- vdb_compare at Base 2.3.3-4~dfsg
- vdb_cut at Base 2.3.3-4~dfsg
- vdb_delta at Base 2.3.3-4~dfsg
- vdb_delta_average at Base 2.3.3-4~dfsg
- vdb_deriv at Base 2.3.3-4~dfsg
- vdb_detranspose at Base 2.3.3-4~dfsg
- vdb_diff at Base 2.3.3-4~dfsg
- vdb_echo at Base 2.3.3-4~dfsg
- vdb_exists at Base 2.3.3-4~dfsg
- vdb_extract_token at Base 2.3.3-4~dfsg
- vdb_fixed_row_len at Base 2.3.3-4~dfsg
- vdb_fixed_vec_sum at Base 2.3.3-4~dfsg
- vdb_floor at Base 2.3.3-4~dfsg
- vdb_funzip at Base 2.3.3-4~dfsg
- vdb_hello at Base 2.3.3-4~dfsg
- vdb_integral at Base 2.3.3-4~dfsg
- vdb_integral_0 at Base 2.3.3-4~dfsg
- vdb_iunzip at Base 2.3.3-4~dfsg
- vdb_izip at Base 2.3.3-4~dfsg
- vdb_map at Base 2.3.3-4~dfsg
- vdb_max at Base 2.3.3-4~dfsg
- vdb_merge at Base 2.3.3-4~dfsg
- vdb_min at Base 2.3.3-4~dfsg
- vdb_next_shallow_token at Base 2.3.3-4~dfsg
- vdb_next_token at Base 2.3.3-4~dfsg
- vdb_no_compare at Base 2.3.3-4~dfsg
- vdb_outlier_decode at Base 2.3.3-4~dfsg
- vdb_outlier_encode at Base 2.3.3-4~dfsg
- vdb_pack at Base 2.3.3-4~dfsg
- vdb_paste at Base 2.3.3-4~dfsg
- vdb_range_validate at Base 2.3.3-4~dfsg
- vdb_redimension at Base 2.3.3-4~dfsg
- vdb_rldecode at Base 2.3.3-4~dfsg
- vdb_round at Base 2.3.3-4~dfsg
- vdb_row_id at Base 2.3.3-4~dfsg
- vdb_row_len at Base 2.3.3-4~dfsg
- vdb_select at Base 2.3.3-4~dfsg
- vdb_simple_sub_select at Base 2.3.3-4~dfsg
- vdb_simple_sub_select_1 at Base 2.3.3-4~dfsg
- vdb_split at Base 2.3.3-4~dfsg
- vdb_sprintf at Base 2.3.3-4~dfsg
- vdb_strtonum at Base 2.3.3-4~dfsg
- vdb_subtract_row_id at Base 2.3.3-4~dfsg
- vdb_sum at Base 2.3.3-4~dfsg
- vdb_transpose at Base 2.3.3-4~dfsg
- vdb_trim at Base 2.3.3-4~dfsg
- vdb_trunc at Base 2.3.3-4~dfsg
- vdb_undelta at Base 2.3.3-4~dfsg
- vdb_undelta_average at Base 2.3.3-4~dfsg
- vdb_unpack at Base 2.3.3-4~dfsg
- vdb_unzip at Base 2.3.3-4~dfsg
- vdb_vec_sum at Base 2.3.3-4~dfsg
- vec_sum_make at Base 2.3.3-4~dfsg
- vkfprintf at Base 2.3.3-4~dfsg
- vkprintf at Base 2.3.3-4~dfsg
- vlen_decode1 at Base 2.3.3-4~dfsg
- vlen_decode at Base 2.3.3-4~dfsg
- vlen_decodeU1 at Base 2.3.3-4~dfsg
- vlen_decodeU at Base 2.3.3-4~dfsg
- vlen_encode1 at Base 2.3.3-4~dfsg
- vlen_encode at Base 2.3.3-4~dfsg
- vlen_encodeU1 at Base 2.3.3-4~dfsg
- vlen_encodeU at Base 2.3.3-4~dfsg
- wchar_cvt_string_copy at Base 2.3.3-4~dfsg
- wchar_cvt_string_len at Base 2.3.3-4~dfsg
- wchar_cvt_string_measure at Base 2.3.3-4~dfsg
- wchar_string_len at Base 2.3.3-4~dfsg
- wchar_string_measure at Base 2.3.3-4~dfsg
- wchar_string_size at Base 2.3.3-4~dfsg
- wrt_nvp_find at Base 2.3.3-4~dfsg
- wrt_nvp_find_value at Base 2.3.3-4~dfsg
- wrt_nvp_sort at Base 2.3.3-4~dfsg
- yy_create_buffer at Base 2.3.3-4~dfsg
- yy_delete_buffer at Base 2.3.3-4~dfsg
- yy_flush_buffer at Base 2.3.3-4~dfsg
- yy_scan_buffer at Base 2.3.3-4~dfsg
- yy_scan_bytes at Base 2.3.3-4~dfsg
- yy_scan_string at Base 2.3.3-4~dfsg
- yy_switch_to_buffer at Base 2.3.3-4~dfsg
- yyalloc at Base 2.3.3-4~dfsg
- yyfree at Base 2.3.3-4~dfsg
- yyget_column at Base 2.3.3-4~dfsg
- yyget_debug at Base 2.3.3-4~dfsg
- yyget_extra at Base 2.3.3-4~dfsg
- yyget_in at Base 2.3.3-4~dfsg
- yyget_leng at Base 2.3.3-4~dfsg
- yyget_lineno at Base 2.3.3-4~dfsg
- yyget_lval at Base 2.3.3-4~dfsg
- yyget_out at Base 2.3.3-4~dfsg
- yyget_text at Base 2.3.3-4~dfsg
- yylex at Base 2.3.3-4~dfsg
- yylex_destroy at Base 2.3.3-4~dfsg
- yylex_init at Base 2.3.3-4~dfsg
- yylex_init_extra at Base 2.3.3-4~dfsg
- yypop_buffer_state at Base 2.3.3-4~dfsg
- yypush_buffer_state at Base 2.3.3-4~dfsg
- yyrealloc at Base 2.3.3-4~dfsg
- yyrestart at Base 2.3.3-4~dfsg
- yyset_column at Base 2.3.3-4~dfsg
- yyset_debug at Base 2.3.3-4~dfsg
- yyset_extra at Base 2.3.3-4~dfsg
- yyset_in at Base 2.3.3-4~dfsg
- yyset_lineno at Base 2.3.3-4~dfsg
- yyset_lval at Base 2.3.3-4~dfsg
- yyset_out at Base 2.3.3-4~dfsg
-libncbi-wvdb.so.2 sra-toolkit-libs0 #MINVER#
- AES_decrypt at Base 2.3.3-4~dfsg
- AES_encrypt at Base 2.3.3-4~dfsg
- AES_set_decrypt_key at Base 2.3.3-4~dfsg
- AES_set_encrypt_key at Base 2.3.3-4~dfsg
- ALIGN_align_restore_read at Base 2.3.3-4~dfsg
- ALIGN_cigar at Base 2.3.3-4~dfsg
- ALIGN_cigar_2 at Base 2.3.3-4~dfsg
- ALIGN_generate_has_mismatch at Base 2.3.3-4~dfsg
- ALIGN_generate_mismatch at Base 2.3.3-4~dfsg
- ALIGN_generate_mismatch_qual at Base 2.3.3-4~dfsg
- ALIGN_project_from_sequence at Base 2.3.3-4~dfsg
- ALIGN_raw_restore_read at Base 2.3.3-4~dfsg
- ALIGN_ref_restore_read at Base 2.3.3-4~dfsg
- ALIGN_ref_sub_select at Base 2.3.3-4~dfsg
- ALIGN_seq_restore_read at Base 2.3.3-4~dfsg
- AgrepDPFindAll at Base 2.3.3-4~dfsg
- AgrepDPFindFirst at Base 2.3.3-4~dfsg
- AgrepDPFree at Base 2.3.3-4~dfsg
- AgrepDPMake at Base 2.3.3-4~dfsg
- AgrepFindAll at Base 2.3.3-4~dfsg
- AgrepFindBest at Base 2.3.3-4~dfsg
- AgrepFindFirst at Base 2.3.3-4~dfsg
- AgrepMake at Base 2.3.3-4~dfsg
- AgrepMyersFree at Base 2.3.3-4~dfsg
- AgrepMyersMake at Base 2.3.3-4~dfsg
- AgrepWhack at Base 2.3.3-4~dfsg
- AgrepWuFindAll at Base 2.3.3-4~dfsg
- AgrepWuFindFirst at Base 2.3.3-4~dfsg
- AgrepWuFree at Base 2.3.3-4~dfsg
- AgrepWuMake at Base 2.3.3-4~dfsg
- AliasDump at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorAddRef at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetBAMAlignment at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetCIGAR at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsFirstInPair at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsPaired at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetIsSecondInPair at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetMapQuality at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRecordID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRefSeqID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetRefSeqPos at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSeqAccessionID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSeqID at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetShortSequence at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorGetStrandDirection at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorNext at Base 2.3.3-4~dfsg
- AlignAccessAlignmentEnumeratorRelease at Base 2.3.3-4~dfsg
- AlignAccessDBAddRef at Base 2.3.3-4~dfsg
- AlignAccessDBEnumerateAlignments at Base 2.3.3-4~dfsg
- AlignAccessDBEnumerateRefSequences at Base 2.3.3-4~dfsg
- AlignAccessDBExportBAMFile at Base 2.3.3-4~dfsg
- AlignAccessDBRelease at Base 2.3.3-4~dfsg
- AlignAccessDBWindowedAlignments at Base 2.3.3-4~dfsg
- AlignAccessMgrAddRef at Base 2.3.3-4~dfsg
- AlignAccessMgrMake at Base 2.3.3-4~dfsg
- AlignAccessMgrMakeBAMDB at Base 2.3.3-4~dfsg
- AlignAccessMgrMakeIndexBAMDB at Base 2.3.3-4~dfsg
- AlignAccessMgrRelease at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorAddRef at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorGetID at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorGetLength at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorNext at Base 2.3.3-4~dfsg
- AlignAccessRefSeqEnumeratorRelease at Base 2.3.3-4~dfsg
- AlignRefTableCursor at Base 2.3.3-4~dfsg
- BAMAlignmentAddRef at Base 2.3.3-4~dfsg
- BAMAlignmentGetAlignmentDetail at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGAlignGroup at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetCGSeqQual at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSKey at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSSeqLen at Base 2.3.3-4~dfsg
- BAMAlignmentGetCSSequence at Base 2.3.3-4~dfsg
- BAMAlignmentGetCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetCigarCount at Base 2.3.3-4~dfsg
- BAMAlignmentGetFlags at Base 2.3.3-4~dfsg
- BAMAlignmentGetInsertSize at Base 2.3.3-4~dfsg
- BAMAlignmentGetMapQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetMatePosition at Base 2.3.3-4~dfsg
- BAMAlignmentGetMateRefSeqId at Base 2.3.3-4~dfsg
- BAMAlignmentGetPosition2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetPosition at Base 2.3.3-4~dfsg
- BAMAlignmentGetQuality2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetQuality at Base 2.3.3-4~dfsg
- BAMAlignmentGetRawCigar at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadGroupName at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadLength at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName3 at Base 2.3.3-4~dfsg
- BAMAlignmentGetReadName at Base 2.3.3-4~dfsg
- BAMAlignmentGetRefSeqId at Base 2.3.3-4~dfsg
- BAMAlignmentGetSequence2 at Base 2.3.3-4~dfsg
- BAMAlignmentGetSequence at Base 2.3.3-4~dfsg
- BAMAlignmentGetTI at Base 2.3.3-4~dfsg
- BAMAlignmentHasCGData at Base 2.3.3-4~dfsg
- BAMAlignmentHasColorSpace at Base 2.3.3-4~dfsg
- BAMAlignmentIsMapped at Base 2.3.3-4~dfsg
- BAMAlignmentOptDataForEach at Base 2.3.3-4~dfsg
- BAMAlignmentRelease at Base 2.3.3-4~dfsg
- BAMFileAddRef at Base 2.3.3-4~dfsg
- BAMFileGetHeaderText at Base 2.3.3-4~dfsg
- BAMFileGetPosition at Base 2.3.3-4~dfsg
- BAMFileGetProportionalPosition at Base 2.3.3-4~dfsg
- BAMFileGetReadGroup at Base 2.3.3-4~dfsg
- BAMFileGetReadGroupByName at Base 2.3.3-4~dfsg
- BAMFileGetReadGroupCount at Base 2.3.3-4~dfsg
- BAMFileGetRefSeq at Base 2.3.3-4~dfsg
- BAMFileGetRefSeqById at Base 2.3.3-4~dfsg
- BAMFileGetRefSeqCount at Base 2.3.3-4~dfsg
- BAMFileIndexHasRefSeqId at Base 2.3.3-4~dfsg
- BAMFileIsIndexed at Base 2.3.3-4~dfsg
- BAMFileMake at Base 2.3.3-4~dfsg
- BAMFileMakeWithDir at Base 2.3.3-4~dfsg
- BAMFileMakeWithHeader at Base 2.3.3-4~dfsg
- BAMFileMakeWithKFile at Base 2.3.3-4~dfsg
- BAMFileMakeWithVPath at Base 2.3.3-4~dfsg
- BAMFileOpenIndex at Base 2.3.3-4~dfsg
- BAMFileOpenIndexWithVPath at Base 2.3.3-4~dfsg
- BAMFileRead at Base 2.3.3-4~dfsg
- BAMFileRelease at Base 2.3.3-4~dfsg
- BAMFileRewind at Base 2.3.3-4~dfsg
- BAMFileSeek at Base 2.3.3-4~dfsg
- BAMFileSetPosition at Base 2.3.3-4~dfsg
- BAMFileVMakeWithDir at Base 2.3.3-4~dfsg
- BAMValidate at Base 2.3.3-4~dfsg
- BSTNodeFindNext at Base 2.3.3-4~dfsg
- BSTNodeFindPrev at Base 2.3.3-4~dfsg
- BSTNodeNext at Base 2.3.3-4~dfsg
- BSTNodeParent at Base 2.3.3-4~dfsg
- BSTNodePrev at Base 2.3.3-4~dfsg
- BSTreeDepth at Base 2.3.3-4~dfsg
- BSTreeDoUntil at Base 2.3.3-4~dfsg
- BSTreeFind at Base 2.3.3-4~dfsg
- BSTreeFirst at Base 2.3.3-4~dfsg
- BSTreeForEach at Base 2.3.3-4~dfsg
- BSTreeInsert at Base 2.3.3-4~dfsg
- BSTreeInsertUnique at Base 2.3.3-4~dfsg
- BSTreeLast at Base 2.3.3-4~dfsg
- BSTreeMbrWhack at Base 2.3.3-4~dfsg
- BSTreePersist at Base 2.3.3-4~dfsg
- BSTreeResort at Base 2.3.3-4~dfsg
- BSTreeUnlink at Base 2.3.3-4~dfsg
- BSTreeWhack at Base 2.3.3-4~dfsg
- BitNr2Mask at Base 2.3.3-4~dfsg
- BlobHeadersAddRef at Base 2.3.3-4~dfsg
- BlobHeadersCreate at Base 2.3.3-4~dfsg
- BlobHeadersCreateChild at Base 2.3.3-4~dfsg
- BlobHeadersCreateDummyHeader at Base 2.3.3-4~dfsg
- BlobHeadersCreateFromData at Base 2.3.3-4~dfsg
- BlobHeadersGetHdrWrite at Base 2.3.3-4~dfsg
- BlobHeadersGetHeader at Base 2.3.3-4~dfsg
- BlobHeadersGetMaxBufferSize at Base 2.3.3-4~dfsg
- BlobHeadersGetNextFrame at Base 2.3.3-4~dfsg
- BlobHeadersPop at Base 2.3.3-4~dfsg
- BlobHeadersRelease at Base 2.3.3-4~dfsg
- BlobHeadersSerialize at Base 2.3.3-4~dfsg
- CRC32 at Base 2.3.3-4~dfsg
- CRC32Init at Base 2.3.3-4~dfsg
- DLListAppendList at Base 2.3.3-4~dfsg
- DLListDoUntil at Base 2.3.3-4~dfsg
- DLListFindFirst at Base 2.3.3-4~dfsg
- DLListFindLast at Base 2.3.3-4~dfsg
- DLListForEach at Base 2.3.3-4~dfsg
- DLListInsertListAfter at Base 2.3.3-4~dfsg
- DLListInsertListBefore at Base 2.3.3-4~dfsg
- DLListInsertNodeAfter at Base 2.3.3-4~dfsg
- DLListInsertNodeBefore at Base 2.3.3-4~dfsg
- DLListPopHead at Base 2.3.3-4~dfsg
- DLListPopTail at Base 2.3.3-4~dfsg
- DLListPrependList at Base 2.3.3-4~dfsg
- DLListPushHead at Base 2.3.3-4~dfsg
- DLListPushTail at Base 2.3.3-4~dfsg
- DLListUnlink at Base 2.3.3-4~dfsg
- DLListWhack at Base 2.3.3-4~dfsg
- DNAReverseCompliment at Base 2.3.3-4~dfsg
- FQNDump at Base 2.3.3-4~dfsg
- FgrepAhoFindAll at Base 2.3.3-4~dfsg
- FgrepAhoFindFirst at Base 2.3.3-4~dfsg
- FgrepAhoFree at Base 2.3.3-4~dfsg
- FgrepAhoMake at Base 2.3.3-4~dfsg
- FgrepBoyerFindAll at Base 2.3.3-4~dfsg
- FgrepBoyerFindFirst at Base 2.3.3-4~dfsg
- FgrepBoyerSearchFree at Base 2.3.3-4~dfsg
- FgrepBoyerSearchMake at Base 2.3.3-4~dfsg
- FgrepDumbFindAll at Base 2.3.3-4~dfsg
- FgrepDumbFindFirst at Base 2.3.3-4~dfsg
- FgrepDumbSearchFree at Base 2.3.3-4~dfsg
- FgrepDumbSearchMake at Base 2.3.3-4~dfsg
- FgrepFindFirst at Base 2.3.3-4~dfsg
- FgrepFree at Base 2.3.3-4~dfsg
- FgrepMake at Base 2.3.3-4~dfsg
- G_out_handler at Base 2.3.3-4~dfsg
- GetCacheCompleteness at Base 2.3.3-4~dfsg
- GetCacheTruncatedSize at Base 2.3.3-4~dfsg
- GetRCContextIdxText at Base 2.3.3-4~dfsg
- GetRCContextText at Base 2.3.3-4~dfsg
- GetRCFilename at Base 2.3.3-4~dfsg
- GetRCFunction at Base 2.3.3-4~dfsg
- GetRCLineno at Base 2.3.3-4~dfsg
- GetRCModuleIdxText at Base 2.3.3-4~dfsg
- GetRCModuleText at Base 2.3.3-4~dfsg
- GetRCObjectIdxText at Base 2.3.3-4~dfsg
- GetRCObjectText at Base 2.3.3-4~dfsg
- GetRCStateIdxText at Base 2.3.3-4~dfsg
- GetRCStateText at Base 2.3.3-4~dfsg
- GetRCTargetIdxText at Base 2.3.3-4~dfsg
- GetRCTargetText at Base 2.3.3-4~dfsg
- GetUnreadRCInfo at Base 2.3.3-4~dfsg
- INSDC_SEQ_rand_4na_2na at Base 2.3.3-4~dfsg
- INSDC_SRA_format_spot_name at Base 2.3.3-4~dfsg
- INSDC_SRA_format_spot_name_no_coord at Base 2.3.3-4~dfsg
- IUPAC_decode at Base 2.3.3-4~dfsg
- IsCacheFileComplete at Base 2.3.3-4~dfsg
- Judy1ByCount at Base 2.3.3-4~dfsg
- Judy1Count at Base 2.3.3-4~dfsg
- Judy1First at Base 2.3.3-4~dfsg
- Judy1FirstEmpty at Base 2.3.3-4~dfsg
- Judy1FreeArray at Base 2.3.3-4~dfsg
- Judy1Last at Base 2.3.3-4~dfsg
- Judy1LastEmpty at Base 2.3.3-4~dfsg
- Judy1MallocSizes at Base 2.3.3-4~dfsg
- Judy1MemActive at Base 2.3.3-4~dfsg
- Judy1MemUsed at Base 2.3.3-4~dfsg
- Judy1Next at Base 2.3.3-4~dfsg
- Judy1NextEmpty at Base 2.3.3-4~dfsg
- Judy1Prev at Base 2.3.3-4~dfsg
- Judy1PrevEmpty at Base 2.3.3-4~dfsg
- Judy1Set at Base 2.3.3-4~dfsg
- Judy1SetArray at Base 2.3.3-4~dfsg
- Judy1Test at Base 2.3.3-4~dfsg
- Judy1Unset at Base 2.3.3-4~dfsg
- JudyFree at Base 2.3.3-4~dfsg
- JudyFreeVirtual at Base 2.3.3-4~dfsg
- JudyHSDel at Base 2.3.3-4~dfsg
- JudyHSFreeArray at Base 2.3.3-4~dfsg
- JudyHSGet at Base 2.3.3-4~dfsg
- JudyHSIns at Base 2.3.3-4~dfsg
- JudyLByCount at Base 2.3.3-4~dfsg
- JudyLCount at Base 2.3.3-4~dfsg
- JudyLDel at Base 2.3.3-4~dfsg
- JudyLFirst at Base 2.3.3-4~dfsg
- JudyLFirstEmpty at Base 2.3.3-4~dfsg
- JudyLFreeArray at Base 2.3.3-4~dfsg
- JudyLGet at Base 2.3.3-4~dfsg
- JudyLIns at Base 2.3.3-4~dfsg
- JudyLInsArray at Base 2.3.3-4~dfsg
- JudyLLast at Base 2.3.3-4~dfsg
- JudyLLastEmpty at Base 2.3.3-4~dfsg
- JudyLMallocSizes at Base 2.3.3-4~dfsg
- JudyLMemActive at Base 2.3.3-4~dfsg
- JudyLMemUsed at Base 2.3.3-4~dfsg
- JudyLNext at Base 2.3.3-4~dfsg
- JudyLNextEmpty at Base 2.3.3-4~dfsg
- JudyLPrev at Base 2.3.3-4~dfsg
- JudyLPrevEmpty at Base 2.3.3-4~dfsg
- JudyMalloc at Base 2.3.3-4~dfsg
- JudyMallocVirtual at Base 2.3.3-4~dfsg
- JudySLDel at Base 2.3.3-4~dfsg
- JudySLFirst at Base 2.3.3-4~dfsg
- JudySLFreeArray at Base 2.3.3-4~dfsg
- JudySLGet at Base 2.3.3-4~dfsg
- JudySLIns at Base 2.3.3-4~dfsg
- JudySLLast at Base 2.3.3-4~dfsg
- JudySLNext at Base 2.3.3-4~dfsg
- JudySLPrev at Base 2.3.3-4~dfsg
- KAESBlockCipherByteMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecMake at Base 2.3.3-4~dfsg
- KAESBlockCipherVecRegMake at Base 2.3.3-4~dfsg
- KArcDirGetTOC at Base 2.3.3-4~dfsg
- KArcDirPersistHeader at Base 2.3.3-4~dfsg
- KArcParseKDir at Base 2.3.3-4~dfsg
- KArcParseSRA at Base 2.3.3-4~dfsg
- KArcParseSRAUnbounded at Base 2.3.3-4~dfsg
- KArcParseSRAUnbounded_silent at Base 2.3.3-4~dfsg
- KArcParseSRA_silent at Base 2.3.3-4~dfsg
- KArcParseTAR at Base 2.3.3-4~dfsg
- KArcParseTAR_silent at Base 2.3.3-4~dfsg
- KArrayFileAddRef at Base 2.3.3-4~dfsg
- KArrayFileDestroy at Base 2.3.3-4~dfsg
- KArrayFileDimExtents at Base 2.3.3-4~dfsg
- KArrayFileDimensionality at Base 2.3.3-4~dfsg
- KArrayFileElementSize at Base 2.3.3-4~dfsg
- KArrayFileGetMeta at Base 2.3.3-4~dfsg
- KArrayFileInit at Base 2.3.3-4~dfsg
- KArrayFileRead at Base 2.3.3-4~dfsg
- KArrayFileRead_v at Base 2.3.3-4~dfsg
- KArrayFileRelease at Base 2.3.3-4~dfsg
- KArrayFileSetDimExtents at Base 2.3.3-4~dfsg
- KArrayFileSetDimensionality at Base 2.3.3-4~dfsg
- KArrayFileWrite at Base 2.3.3-4~dfsg
- KBTreeAddRef at Base 2.3.3-4~dfsg
- KBTreeDropBacking at Base 2.3.3-4~dfsg
- KBTreeEntry at Base 2.3.3-4~dfsg
- KBTreeFind at Base 2.3.3-4~dfsg
- KBTreeForEach at Base 2.3.3-4~dfsg
- KBTreeMakeRead at Base 2.3.3-4~dfsg
- KBTreeMakeUpdate at Base 2.3.3-4~dfsg
- KBTreeRelease at Base 2.3.3-4~dfsg
- KBTreeSize at Base 2.3.3-4~dfsg
- KBufFileMakeRead at Base 2.3.3-4~dfsg
- KBufFileMakeWrite at Base 2.3.3-4~dfsg
- KBufReadFileMakeRead at Base 2.3.3-4~dfsg
- KBufWriteFileMakeWrite at Base 2.3.3-4~dfsg
- KCRC32FileBeginTransaction at Base 2.3.3-4~dfsg
- KCRC32FileCommit at Base 2.3.3-4~dfsg
- KCRC32FileMakeAppend at Base 2.3.3-4~dfsg
- KCRC32FileMakeWrite at Base 2.3.3-4~dfsg
- KCRC32FileReset at Base 2.3.3-4~dfsg
- KCRC32FileRevert at Base 2.3.3-4~dfsg
- KCRC32FileToKFile at Base 2.3.3-4~dfsg
- KCRC32FileToKFileConst at Base 2.3.3-4~dfsg
- KCRC32SumFmtAddRef at Base 2.3.3-4~dfsg
- KCRC32SumFmtCount at Base 2.3.3-4~dfsg
- KCRC32SumFmtDelete at Base 2.3.3-4~dfsg
- KCRC32SumFmtFind at Base 2.3.3-4~dfsg
- KCRC32SumFmtFlush at Base 2.3.3-4~dfsg
- KCRC32SumFmtGet at Base 2.3.3-4~dfsg
- KCRC32SumFmtMakeRead at Base 2.3.3-4~dfsg
- KCRC32SumFmtMakeUpdate at Base 2.3.3-4~dfsg
- KCRC32SumFmtRelease at Base 2.3.3-4~dfsg
- KCRC32SumFmtRename at Base 2.3.3-4~dfsg
- KCRC32SumFmtUpdate at Base 2.3.3-4~dfsg
- KCipherAddRef at Base 2.3.3-4~dfsg
- KCipherBlockSize at Base 2.3.3-4~dfsg
- KCipherByteClassName at Base 2.3.3-4~dfsg
- KCipherByteMake at Base 2.3.3-4~dfsg
- KCipherDecrypt at Base 2.3.3-4~dfsg
- KCipherDecryptCBC at Base 2.3.3-4~dfsg
- KCipherDecryptCFB at Base 2.3.3-4~dfsg
- KCipherDecryptCTR at Base 2.3.3-4~dfsg
- KCipherDecryptECB at Base 2.3.3-4~dfsg
- KCipherDecryptOFB at Base 2.3.3-4~dfsg
- KCipherDecryptPCBC at Base 2.3.3-4~dfsg
- KCipherDestroy at Base 2.3.3-4~dfsg
- KCipherEncrypt at Base 2.3.3-4~dfsg
- KCipherEncryptCBC at Base 2.3.3-4~dfsg
- KCipherEncryptCFB at Base 2.3.3-4~dfsg
- KCipherEncryptCTR at Base 2.3.3-4~dfsg
- KCipherEncryptECB at Base 2.3.3-4~dfsg
- KCipherEncryptOFB at Base 2.3.3-4~dfsg
- KCipherEncryptPCBC at Base 2.3.3-4~dfsg
- KCipherInit at Base 2.3.3-4~dfsg
- KCipherMake at Base 2.3.3-4~dfsg
- KCipherMakeInt at Base 2.3.3-4~dfsg
- KCipherManagerAddRef at Base 2.3.3-4~dfsg
- KCipherManagerDestroy at Base 2.3.3-4~dfsg
- KCipherManagerMake at Base 2.3.3-4~dfsg
- KCipherManagerMakeCipher at Base 2.3.3-4~dfsg
- KCipherManagerRelease at Base 2.3.3-4~dfsg
- KCipherRelease at Base 2.3.3-4~dfsg
- KCipherSetDecryptCtrFunc at Base 2.3.3-4~dfsg
- KCipherSetDecryptIVec at Base 2.3.3-4~dfsg
- KCipherSetDecryptKey at Base 2.3.3-4~dfsg
- KCipherSetEncryptCtrFunc at Base 2.3.3-4~dfsg
- KCipherSetEncryptIVec at Base 2.3.3-4~dfsg
- KCipherSetEncryptKey at Base 2.3.3-4~dfsg
- KCipherSubType at Base 2.3.3-4~dfsg
- KCipherVecAesNiClassName at Base 2.3.3-4~dfsg
- KCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KCipherVecClassName at Base 2.3.3-4~dfsg
- KCipherVecMake at Base 2.3.3-4~dfsg
- KCipherVecRegClassName at Base 2.3.3-4~dfsg
- KCipherVecRegMake at Base 2.3.3-4~dfsg
- KColBlockLocAllocSize at Base 2.3.3-4~dfsg
- KColBlockLocEntryCount at Base 2.3.3-4~dfsg
- KColBlockLocInfoMerge at Base 2.3.3-4~dfsg
- KColIdxBlockInit at Base 2.3.3-4~dfsg
- KColWIdxBlockCompress at Base 2.3.3-4~dfsg
- KColWIdxBlockInit at Base 2.3.3-4~dfsg
- KColWIdxBlockPersistPtr at Base 2.3.3-4~dfsg
- KColWIdxBlockSetEntry at Base 2.3.3-4~dfsg
- KColWIdxBlockWhack at Base 2.3.3-4~dfsg
- KColumnAddRef at Base 2.3.3-4~dfsg
- KColumnAttach at Base 2.3.3-4~dfsg
- KColumnBlobAddRef at Base 2.3.3-4~dfsg
- KColumnBlobAppend at Base 2.3.3-4~dfsg
- KColumnBlobAssignRange at Base 2.3.3-4~dfsg
- KColumnBlobCommit at Base 2.3.3-4~dfsg
- KColumnBlobIdRange at Base 2.3.3-4~dfsg
- KColumnBlobRead at Base 2.3.3-4~dfsg
- KColumnBlobRelease at Base 2.3.3-4~dfsg
- KColumnBlobValidate at Base 2.3.3-4~dfsg
- KColumnByteOrder at Base 2.3.3-4~dfsg
- KColumnCommitFreq at Base 2.3.3-4~dfsg
- KColumnCreateBlob at Base 2.3.3-4~dfsg
- KColumnDataCommit at Base 2.3.3-4~dfsg
- KColumnDataCommitDone at Base 2.3.3-4~dfsg
- KColumnDataCreate at Base 2.3.3-4~dfsg
- KColumnDataFree at Base 2.3.3-4~dfsg
- KColumnDataOpenRead at Base 2.3.3-4~dfsg
- KColumnDataOpenUpdate at Base 2.3.3-4~dfsg
- KColumnDataRead at Base 2.3.3-4~dfsg
- KColumnDataWhack at Base 2.3.3-4~dfsg
- KColumnDataWrite at Base 2.3.3-4~dfsg
- KColumnFileCreate at Base 2.3.3-4~dfsg
- KColumnFileOpenUpdate at Base 2.3.3-4~dfsg
- KColumnIdRange at Base 2.3.3-4~dfsg
- KColumnIdx0Commit at Base 2.3.3-4~dfsg
- KColumnIdx0CommitDone at Base 2.3.3-4~dfsg
- KColumnIdx0Create at Base 2.3.3-4~dfsg
- KColumnIdx0Create_v1 at Base 2.3.3-4~dfsg
- KColumnIdx0DefineBlocks at Base 2.3.3-4~dfsg
- KColumnIdx0IdRange at Base 2.3.3-4~dfsg
- KColumnIdx0LocateBlob at Base 2.3.3-4~dfsg
- KColumnIdx0OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx0OpenRead_v1 at Base 2.3.3-4~dfsg
- KColumnIdx0Revert at Base 2.3.3-4~dfsg
- KColumnIdx0TranscribeBlocks at Base 2.3.3-4~dfsg
- KColumnIdx0Truncate at Base 2.3.3-4~dfsg
- KColumnIdx0Whack at Base 2.3.3-4~dfsg
- KColumnIdx1Commit at Base 2.3.3-4~dfsg
- KColumnIdx1CommitDone at Base 2.3.3-4~dfsg
- KColumnIdx1Create at Base 2.3.3-4~dfsg
- KColumnIdx1IdRange at Base 2.3.3-4~dfsg
- KColumnIdx1LocateBlock at Base 2.3.3-4~dfsg
- KColumnIdx1OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx1OpenUpdate at Base 2.3.3-4~dfsg
- KColumnIdx1Revert at Base 2.3.3-4~dfsg
- KColumnIdx1Whack at Base 2.3.3-4~dfsg
- KColumnIdx1WriteHeader at Base 2.3.3-4~dfsg
- KColumnIdx2Commit at Base 2.3.3-4~dfsg
- KColumnIdx2CommitDone at Base 2.3.3-4~dfsg
- KColumnIdx2Create at Base 2.3.3-4~dfsg
- KColumnIdx2LocateBlob at Base 2.3.3-4~dfsg
- KColumnIdx2OpenRead at Base 2.3.3-4~dfsg
- KColumnIdx2Whack at Base 2.3.3-4~dfsg
- KColumnIdx2Write at Base 2.3.3-4~dfsg
- KColumnIdxCommit at Base 2.3.3-4~dfsg
- KColumnIdxCommitDone at Base 2.3.3-4~dfsg
- KColumnIdxCreate at Base 2.3.3-4~dfsg
- KColumnIdxIdRange at Base 2.3.3-4~dfsg
- KColumnIdxLocateBlob at Base 2.3.3-4~dfsg
- KColumnIdxOpenRead at Base 2.3.3-4~dfsg
- KColumnIdxOpenUpdate at Base 2.3.3-4~dfsg
- KColumnIdxReindex at Base 2.3.3-4~dfsg
- KColumnIdxWhack at Base 2.3.3-4~dfsg
- KColumnLock at Base 2.3.3-4~dfsg
- KColumnLocked at Base 2.3.3-4~dfsg
- KColumnOpenBlobRead at Base 2.3.3-4~dfsg
- KColumnOpenBlobUpdate at Base 2.3.3-4~dfsg
- KColumnOpenDirectoryRead at Base 2.3.3-4~dfsg
- KColumnOpenDirectoryUpdate at Base 2.3.3-4~dfsg
- KColumnOpenManagerRead at Base 2.3.3-4~dfsg
- KColumnOpenManagerUpdate at Base 2.3.3-4~dfsg
- KColumnOpenMetadataRead at Base 2.3.3-4~dfsg
- KColumnOpenMetadataUpdate at Base 2.3.3-4~dfsg
- KColumnOpenParentRead at Base 2.3.3-4~dfsg
- KColumnOpenParentUpdate at Base 2.3.3-4~dfsg
- KColumnPageMapCreate at Base 2.3.3-4~dfsg
- KColumnPageMapId at Base 2.3.3-4~dfsg
- KColumnPageMapOpen at Base 2.3.3-4~dfsg
- KColumnPageMapWhack at Base 2.3.3-4~dfsg
- KColumnReindex at Base 2.3.3-4~dfsg
- KColumnRelease at Base 2.3.3-4~dfsg
- KColumnSetCommitFreq at Base 2.3.3-4~dfsg
- KColumnSever at Base 2.3.3-4~dfsg
- KColumnUnlock at Base 2.3.3-4~dfsg
- KColumnVLock at Base 2.3.3-4~dfsg
- KColumnVUnlock at Base 2.3.3-4~dfsg
- KColumnVWritable at Base 2.3.3-4~dfsg
- KColumnVersion at Base 2.3.3-4~dfsg
- KColumnWritable at Base 2.3.3-4~dfsg
- KConditionAddRef at Base 2.3.3-4~dfsg
- KConditionBroadcast at Base 2.3.3-4~dfsg
- KConditionDestroy at Base 2.3.3-4~dfsg
- KConditionDropRef at Base 2.3.3-4~dfsg
- KConditionInit at Base 2.3.3-4~dfsg
- KConditionMake at Base 2.3.3-4~dfsg
- KConditionRelease at Base 2.3.3-4~dfsg
- KConditionSignal at Base 2.3.3-4~dfsg
- KConditionTimedWait at Base 2.3.3-4~dfsg
- KConditionWait at Base 2.3.3-4~dfsg
- KConfigAddRef at Base 2.3.3-4~dfsg
- KConfigAppendToLoadPath at Base 2.3.3-4~dfsg
- KConfigCommit at Base 2.3.3-4~dfsg
- KConfigDisableUserSettings at Base 2.3.3-4~dfsg
- KConfigGetLoadPath at Base 2.3.3-4~dfsg
- KConfigImportNgc at Base 2.3.3-4~dfsg
- KConfigListIncluded at Base 2.3.3-4~dfsg
- KConfigLoadFile at Base 2.3.3-4~dfsg
- KConfigMake at Base 2.3.3-4~dfsg
- KConfigMakeLocal at Base 2.3.3-4~dfsg
- KConfigMakeRepositoryMgrRead at Base 2.3.3-4~dfsg
- KConfigMakeRepositoryMgrUpdate at Base 2.3.3-4~dfsg
- KConfigNodeAddRef at Base 2.3.3-4~dfsg
- KConfigNodeAppend at Base 2.3.3-4~dfsg
- KConfigNodeDropAll at Base 2.3.3-4~dfsg
- KConfigNodeDropAttr at Base 2.3.3-4~dfsg
- KConfigNodeDropChild at Base 2.3.3-4~dfsg
- KConfigNodeGetMgr at Base 2.3.3-4~dfsg
- KConfigNodeListChildren at Base 2.3.3-4~dfsg
- KConfigNodeOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeReadAttr at Base 2.3.3-4~dfsg
- KConfigNodeReadBool at Base 2.3.3-4~dfsg
- KConfigNodeReadF64 at Base 2.3.3-4~dfsg
- KConfigNodeReadI64 at Base 2.3.3-4~dfsg
- KConfigNodeReadString at Base 2.3.3-4~dfsg
- KConfigNodeReadU64 at Base 2.3.3-4~dfsg
- KConfigNodeReadVPath at Base 2.3.3-4~dfsg
- KConfigNodeRelease at Base 2.3.3-4~dfsg
- KConfigNodeRenameAttr at Base 2.3.3-4~dfsg
- KConfigNodeRenameChild at Base 2.3.3-4~dfsg
- KConfigNodeVDropChild at Base 2.3.3-4~dfsg
- KConfigNodeVOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigNodeVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigNodeWrite at Base 2.3.3-4~dfsg
- KConfigNodeWriteAttr at Base 2.3.3-4~dfsg
- KConfigOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigOpenNodeUpdate at Base 2.3.3-4~dfsg
- KConfigPrint at Base 2.3.3-4~dfsg
- KConfigReadBool at Base 2.3.3-4~dfsg
- KConfigReadF64 at Base 2.3.3-4~dfsg
- KConfigReadI64 at Base 2.3.3-4~dfsg
- KConfigReadString at Base 2.3.3-4~dfsg
- KConfigReadU64 at Base 2.3.3-4~dfsg
- KConfigReadVPath at Base 2.3.3-4~dfsg
- KConfigRelease at Base 2.3.3-4~dfsg
- KConfigVOpenNodeRead at Base 2.3.3-4~dfsg
- KConfigVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KCurlFileMake at Base 2.3.3-4~dfsg
- KCurlRequestAddField at Base 2.3.3-4~dfsg
- KCurlRequestAddFields at Base 2.3.3-4~dfsg
- KCurlRequestAddRef at Base 2.3.3-4~dfsg
- KCurlRequestAddSField at Base 2.3.3-4~dfsg
- KCurlRequestAddSFields at Base 2.3.3-4~dfsg
- KCurlRequestPerform at Base 2.3.3-4~dfsg
- KCurlRequestRelease at Base 2.3.3-4~dfsg
- KDBAlias at Base 2.3.3-4~dfsg
- KDBGetNamespaceString at Base 2.3.3-4~dfsg
- KDBGetObjModDate at Base 2.3.3-4~dfsg
- KDBHdrValidate at Base 2.3.3-4~dfsg
- KDBIsLocked at Base 2.3.3-4~dfsg
- KDBIsPathUri at Base 2.3.3-4~dfsg
- KDBLockDir at Base 2.3.3-4~dfsg
- KDBLockFile at Base 2.3.3-4~dfsg
- KDBMakeSubPath at Base 2.3.3-4~dfsg
- KDBManagerAddRef at Base 2.3.3-4~dfsg
- KDBManagerAttach at Base 2.3.3-4~dfsg
- KDBManagerCheckOpen at Base 2.3.3-4~dfsg
- KDBManagerCreateColumn at Base 2.3.3-4~dfsg
- KDBManagerCreateDB at Base 2.3.3-4~dfsg
- KDBManagerCreateTable at Base 2.3.3-4~dfsg
- KDBManagerDrop at Base 2.3.3-4~dfsg
- KDBManagerExists at Base 2.3.3-4~dfsg
- KDBManagerGetTableModDate at Base 2.3.3-4~dfsg
- KDBManagerGetVFSManager at Base 2.3.3-4~dfsg
- KDBManagerLock at Base 2.3.3-4~dfsg
- KDBManagerMake at Base 2.3.3-4~dfsg
- KDBManagerMakeUpdate at Base 2.3.3-4~dfsg
- KDBManagerOpenColumnRead at Base 2.3.3-4~dfsg
- KDBManagerOpenColumnUpdate at Base 2.3.3-4~dfsg
- KDBManagerOpenDBRead at Base 2.3.3-4~dfsg
- KDBManagerOpenDBUpdate at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectAdd at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectBusy at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectDelete at Base 2.3.3-4~dfsg
- KDBManagerOpenObjectFind at Base 2.3.3-4~dfsg
- KDBManagerOpenTableRead at Base 2.3.3-4~dfsg
- KDBManagerOpenTableUpdate at Base 2.3.3-4~dfsg
- KDBManagerPathType at Base 2.3.3-4~dfsg
- KDBManagerRelease at Base 2.3.3-4~dfsg
- KDBManagerRunPeriodicTasks at Base 2.3.3-4~dfsg
- KDBManagerSever at Base 2.3.3-4~dfsg
- KDBManagerUnlock at Base 2.3.3-4~dfsg
- KDBManagerVCreateColumn at Base 2.3.3-4~dfsg
- KDBManagerVCreateDB at Base 2.3.3-4~dfsg
- KDBManagerVCreateTable at Base 2.3.3-4~dfsg
- KDBManagerVDrop at Base 2.3.3-4~dfsg
- KDBManagerVExists at Base 2.3.3-4~dfsg
- KDBManagerVGetTableModDate at Base 2.3.3-4~dfsg
- KDBManagerVLock at Base 2.3.3-4~dfsg
- KDBManagerVOpenColumnRead at Base 2.3.3-4~dfsg
- KDBManagerVOpenColumnUpdate at Base 2.3.3-4~dfsg
- KDBManagerVOpenDBRead at Base 2.3.3-4~dfsg
- KDBManagerVOpenDBUpdate at Base 2.3.3-4~dfsg
- KDBManagerVOpenTableRead at Base 2.3.3-4~dfsg
- KDBManagerVOpenTableUpdate at Base 2.3.3-4~dfsg
- KDBManagerVPathType at Base 2.3.3-4~dfsg
- KDBManagerVUnlock at Base 2.3.3-4~dfsg
- KDBManagerVWritable at Base 2.3.3-4~dfsg
- KDBManagerVersion at Base 2.3.3-4~dfsg
- KDBManagerWritable at Base 2.3.3-4~dfsg
- KDBMgrVDrop at Base 2.3.3-4~dfsg
- KDBOpenPathTypeRead at Base 2.3.3-4~dfsg
- KDBPathType at Base 2.3.3-4~dfsg
- KDBPathTypeDir at Base 2.3.3-4~dfsg
- KDBRename at Base 2.3.3-4~dfsg
- KDBUnlockDir at Base 2.3.3-4~dfsg
- KDBUnlockFile at Base 2.3.3-4~dfsg
- KDBVDrop at Base 2.3.3-4~dfsg
- KDBVGetPathModDate at Base 2.3.3-4~dfsg
- KDBVMakeSubPath at Base 2.3.3-4~dfsg
- KDBWritable at Base 2.3.3-4~dfsg
- KDataBufferCast at Base 2.3.3-4~dfsg
- KDataBufferCheckIntegrity at Base 2.3.3-4~dfsg
- KDataBufferMake at Base 2.3.3-4~dfsg
- KDataBufferMakeWritable at Base 2.3.3-4~dfsg
- KDataBufferMemorySize at Base 2.3.3-4~dfsg
- KDataBufferPrintf at Base 2.3.3-4~dfsg
- KDataBufferResize at Base 2.3.3-4~dfsg
- KDataBufferShrink at Base 2.3.3-4~dfsg
- KDataBufferSub at Base 2.3.3-4~dfsg
- KDataBufferVPrintf at Base 2.3.3-4~dfsg
- KDataBufferWhack at Base 2.3.3-4~dfsg
- KDataBufferWritable at Base 2.3.3-4~dfsg
- KDatabaseAddRef at Base 2.3.3-4~dfsg
- KDatabaseAliasDB at Base 2.3.3-4~dfsg
- KDatabaseAliasIndex at Base 2.3.3-4~dfsg
- KDatabaseAliasTable at Base 2.3.3-4~dfsg
- KDatabaseAttach at Base 2.3.3-4~dfsg
- KDatabaseCreateDB at Base 2.3.3-4~dfsg
- KDatabaseCreateIndex at Base 2.3.3-4~dfsg
- KDatabaseCreateTable at Base 2.3.3-4~dfsg
- KDatabaseDropDB at Base 2.3.3-4~dfsg
- KDatabaseDropIndex at Base 2.3.3-4~dfsg
- KDatabaseDropTable at Base 2.3.3-4~dfsg
- KDatabaseExists at Base 2.3.3-4~dfsg
- KDatabaseGetPath at Base 2.3.3-4~dfsg
- KDatabaseIsAlias at Base 2.3.3-4~dfsg
- KDatabaseListDB at Base 2.3.3-4~dfsg
- KDatabaseListIdx at Base 2.3.3-4~dfsg
- KDatabaseListTbl at Base 2.3.3-4~dfsg
- KDatabaseLock at Base 2.3.3-4~dfsg
- KDatabaseLocked at Base 2.3.3-4~dfsg
- KDatabaseModDate at Base 2.3.3-4~dfsg
- KDatabaseOpenDBRead at Base 2.3.3-4~dfsg
- KDatabaseOpenDBUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenDirectoryRead at Base 2.3.3-4~dfsg
- KDatabaseOpenDirectoryUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenIndexRead at Base 2.3.3-4~dfsg
- KDatabaseOpenIndexUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenManagerRead at Base 2.3.3-4~dfsg
- KDatabaseOpenManagerUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenMetadataRead at Base 2.3.3-4~dfsg
- KDatabaseOpenMetadataUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenParentRead at Base 2.3.3-4~dfsg
- KDatabaseOpenParentUpdate at Base 2.3.3-4~dfsg
- KDatabaseOpenTableRead at Base 2.3.3-4~dfsg
- KDatabaseOpenTableUpdate at Base 2.3.3-4~dfsg
- KDatabaseRelease at Base 2.3.3-4~dfsg
- KDatabaseRenameDB at Base 2.3.3-4~dfsg
- KDatabaseRenameIndex at Base 2.3.3-4~dfsg
- KDatabaseRenameTable at Base 2.3.3-4~dfsg
- KDatabaseSever at Base 2.3.3-4~dfsg
- KDatabaseUnlock at Base 2.3.3-4~dfsg
- KDatabaseVCreateDB at Base 2.3.3-4~dfsg
- KDatabaseVCreateIndex at Base 2.3.3-4~dfsg
- KDatabaseVCreateTable at Base 2.3.3-4~dfsg
- KDatabaseVDropDB at Base 2.3.3-4~dfsg
- KDatabaseVDropIndex at Base 2.3.3-4~dfsg
- KDatabaseVDropTable at Base 2.3.3-4~dfsg
- KDatabaseVExists at Base 2.3.3-4~dfsg
- KDatabaseVLock at Base 2.3.3-4~dfsg
- KDatabaseVOpenDBRead at Base 2.3.3-4~dfsg
- KDatabaseVOpenDBUpdate at Base 2.3.3-4~dfsg
- KDatabaseVOpenIndexRead at Base 2.3.3-4~dfsg
- KDatabaseVOpenIndexUpdate at Base 2.3.3-4~dfsg
- KDatabaseVOpenTableRead at Base 2.3.3-4~dfsg
- KDatabaseVOpenTableUpdate at Base 2.3.3-4~dfsg
- KDatabaseVUnlock at Base 2.3.3-4~dfsg
- KDatabaseVWritable at Base 2.3.3-4~dfsg
- KDatabaseWritable at Base 2.3.3-4~dfsg
- KDirectoryAccess at Base 2.3.3-4~dfsg
- KDirectoryAddRef at Base 2.3.3-4~dfsg
- KDirectoryClearDir at Base 2.3.3-4~dfsg
- KDirectoryCopy at Base 2.3.3-4~dfsg
- KDirectoryCopyPath at Base 2.3.3-4~dfsg
- KDirectoryCopyPaths at Base 2.3.3-4~dfsg
- KDirectoryCreateAlias at Base 2.3.3-4~dfsg
- KDirectoryCreateDir at Base 2.3.3-4~dfsg
- KDirectoryCreateExclusiveAccessFile at Base 2.3.3-4~dfsg
- KDirectoryCreateFile at Base 2.3.3-4~dfsg
- KDirectoryCreateLockFile at Base 2.3.3-4~dfsg
- KDirectoryDate at Base 2.3.3-4~dfsg
- KDirectoryDestroyFile at Base 2.3.3-4~dfsg
- KDirectoryFileContiguous at Base 2.3.3-4~dfsg
- KDirectoryFileLocator at Base 2.3.3-4~dfsg
- KDirectoryFilePhysicalSize at Base 2.3.3-4~dfsg
- KDirectoryFileSize at Base 2.3.3-4~dfsg
- KDirectoryGetSysDir at Base 2.3.3-4~dfsg
- KDirectoryInit at Base 2.3.3-4~dfsg
- KDirectoryList at Base 2.3.3-4~dfsg
- KDirectoryMakeCacheTee at Base 2.3.3-4~dfsg
- KDirectoryNativeDir at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenArcDirRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenDirUpdate at Base 2.3.3-4~dfsg
- KDirectoryOpenFileRead at Base 2.3.3-4~dfsg
- KDirectoryOpenFileWrite at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveReadUnbounded at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveReadUnbounded_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenSraArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryOpenTarArchiveRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryOpenTocFileRead at Base 2.3.3-4~dfsg
- KDirectoryOpenXTocDirRead at Base 2.3.3-4~dfsg
- KDirectoryOpenXTocDirReadDir at Base 2.3.3-4~dfsg
- KDirectoryPathType at Base 2.3.3-4~dfsg
- KDirectoryRelease at Base 2.3.3-4~dfsg
- KDirectoryRemove at Base 2.3.3-4~dfsg
- KDirectoryRename at Base 2.3.3-4~dfsg
- KDirectoryResolveAlias at Base 2.3.3-4~dfsg
- KDirectoryResolvePath at Base 2.3.3-4~dfsg
- KDirectorySetAccess at Base 2.3.3-4~dfsg
- KDirectorySetDate at Base 2.3.3-4~dfsg
- KDirectorySetFileSize at Base 2.3.3-4~dfsg
- KDirectoryToKArcDir at Base 2.3.3-4~dfsg
- KDirectoryVAccess at Base 2.3.3-4~dfsg
- KDirectoryVClearDir at Base 2.3.3-4~dfsg
- KDirectoryVCreateDir at Base 2.3.3-4~dfsg
- KDirectoryVCreateExclusiveAccessFile at Base 2.3.3-4~dfsg
- KDirectoryVCreateFile at Base 2.3.3-4~dfsg
- KDirectoryVCreateLockFile at Base 2.3.3-4~dfsg
- KDirectoryVDate at Base 2.3.3-4~dfsg
- KDirectoryVFileContiguous at Base 2.3.3-4~dfsg
- KDirectoryVFileLocator at Base 2.3.3-4~dfsg
- KDirectoryVFilePhysicalSize at Base 2.3.3-4~dfsg
- KDirectoryVFileSize at Base 2.3.3-4~dfsg
- KDirectoryVList at Base 2.3.3-4~dfsg
- KDirectoryVMakeCacheTee at Base 2.3.3-4~dfsg
- KDirectoryVOpenDirRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenDirUpdate at Base 2.3.3-4~dfsg
- KDirectoryVOpenFileRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenFileWrite at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveReadUnbounded at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveReadUnbounded_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryVOpenSraArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead_silent at Base 2.3.3-4~dfsg
- KDirectoryVOpenTarArchiveRead_silent_preopened at Base 2.3.3-4~dfsg
- KDirectoryVOpenXTocDirRead at Base 2.3.3-4~dfsg
- KDirectoryVPathType at Base 2.3.3-4~dfsg
- KDirectoryVRemove at Base 2.3.3-4~dfsg
- KDirectoryVResolveAlias at Base 2.3.3-4~dfsg
- KDirectoryVResolvePath at Base 2.3.3-4~dfsg
- KDirectoryVSetAccess at Base 2.3.3-4~dfsg
- KDirectoryVSetDate at Base 2.3.3-4~dfsg
- KDirectoryVSetFileSize at Base 2.3.3-4~dfsg
- KDirectoryVVisit at Base 2.3.3-4~dfsg
- KDirectoryVVisitUpdate at Base 2.3.3-4~dfsg
- KDirectoryVisit at Base 2.3.3-4~dfsg
- KDirectoryVisitUpdate at Base 2.3.3-4~dfsg
- KDlsetAddAll at Base 2.3.3-4~dfsg
- KDlsetAddLib at Base 2.3.3-4~dfsg
- KDlsetAddRef at Base 2.3.3-4~dfsg
- KDlsetFirstSymbol at Base 2.3.3-4~dfsg
- KDlsetLastSymbol at Base 2.3.3-4~dfsg
- KDlsetList at Base 2.3.3-4~dfsg
- KDlsetRelease at Base 2.3.3-4~dfsg
- KDlsetSymbol at Base 2.3.3-4~dfsg
- KDualRefAdd at Base 2.3.3-4~dfsg
- KDualRefAddDep at Base 2.3.3-4~dfsg
- KDualRefDrop at Base 2.3.3-4~dfsg
- KDualRefDropDep at Base 2.3.3-4~dfsg
- KDualRefInit at Base 2.3.3-4~dfsg
- KDualRefWhack at Base 2.3.3-4~dfsg
- KDyldAddRef at Base 2.3.3-4~dfsg
- KDyldAddSearchPath at Base 2.3.3-4~dfsg
- KDyldHomeDirectory at Base 2.3.3-4~dfsg
- KDyldLoadLib at Base 2.3.3-4~dfsg
- KDyldMake at Base 2.3.3-4~dfsg
- KDyldMakeSet at Base 2.3.3-4~dfsg
- KDyldRelease at Base 2.3.3-4~dfsg
- KDyldVAddSearchPath at Base 2.3.3-4~dfsg
- KDyldVLoadLib at Base 2.3.3-4~dfsg
- KDylibAddRef at Base 2.3.3-4~dfsg
- KDylibFullPath at Base 2.3.3-4~dfsg
- KDylibRelease at Base 2.3.3-4~dfsg
- KDylibSymbol at Base 2.3.3-4~dfsg
- KEncFileFooterWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileHeaderWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeBlock_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeRead at Base 2.3.3-4~dfsg
- KEncFileMakeRead_v1 at Base 2.3.3-4~dfsg
- KEncFileMakeRead_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeUpdate at Base 2.3.3-4~dfsg
- KEncFileMakeUpdate_v2 at Base 2.3.3-4~dfsg
- KEncFileMakeWrite at Base 2.3.3-4~dfsg
- KEncFileMakeWriteBlock at Base 2.3.3-4~dfsg
- KEncFileMakeWrite_v1 at Base 2.3.3-4~dfsg
- KEncFileMakeWrite_v2 at Base 2.3.3-4~dfsg
- KEncFileV1MakeUpdate_v1 at Base 2.3.3-4~dfsg
- KEncFileV1Validate_v1 at Base 2.3.3-4~dfsg
- KEncFileV1WriteHeader_v1 at Base 2.3.3-4~dfsg
- KEncFileValidate at Base 2.3.3-4~dfsg
- KEncFileValidate_v2 at Base 2.3.3-4~dfsg
- KEncFileWriteHeader at Base 2.3.3-4~dfsg
- KEncFileWriteHeader_v2 at Base 2.3.3-4~dfsg
- KEncryptFileMakeRead at Base 2.3.3-4~dfsg
- KEncryptionKeyAddRef at Base 2.3.3-4~dfsg
- KEncryptionKeyMake at Base 2.3.3-4~dfsg
- KEncryptionKeyRelease at Base 2.3.3-4~dfsg
- KEntrezFetcherAddRef at Base 2.3.3-4~dfsg
- KEntrezFetcherMake at Base 2.3.3-4~dfsg
- KEntrezFetcherRead at Base 2.3.3-4~dfsg
- KEntrezFetcherRelease at Base 2.3.3-4~dfsg
- KEntrezFetcherSetup at Base 2.3.3-4~dfsg
- KEntrezFetcherSetupUri at Base 2.3.3-4~dfsg
- KFGScan_set_debug at Base 2.3.3-4~dfsg
- KFGScan_yylex at Base 2.3.3-4~dfsg
- KFGScan_yylex_destroy at Base 2.3.3-4~dfsg
- KFGScan_yylex_init at Base 2.3.3-4~dfsg
- KFG_error at Base 2.3.3-4~dfsg
- KFG_parse at Base 2.3.3-4~dfsg
- KFileAddRef at Base 2.3.3-4~dfsg
- KFileDestroy at Base 2.3.3-4~dfsg
- KFileGetSysFile at Base 2.3.3-4~dfsg
- KFileInit at Base 2.3.3-4~dfsg
- KFileIsEnc at Base 2.3.3-4~dfsg
- KFileIsEnc_v1 at Base 2.3.3-4~dfsg
- KFileIsEnc_v2 at Base 2.3.3-4~dfsg
- KFileIsSRA at Base 2.3.3-4~dfsg
- KFileIsSraEnc at Base 2.3.3-4~dfsg
- KFileIsWGAEnc at Base 2.3.3-4~dfsg
- KFileMakeBzip2ForRead at Base 2.3.3-4~dfsg
- KFileMakeBzip2ForWrite at Base 2.3.3-4~dfsg
- KFileMakeCRC32Read at Base 2.3.3-4~dfsg
- KFileMakeCounterRead at Base 2.3.3-4~dfsg
- KFileMakeCounterUpdate at Base 2.3.3-4~dfsg
- KFileMakeCounterWrite at Base 2.3.3-4~dfsg
- KFileMakeFDFileRead at Base 2.3.3-4~dfsg
- KFileMakeFDFileWrite at Base 2.3.3-4~dfsg
- KFileMakeGzipForRead at Base 2.3.3-4~dfsg
- KFileMakeGzipForWrite at Base 2.3.3-4~dfsg
- KFileMakeMD5Read at Base 2.3.3-4~dfsg
- KFileMakeNewCRC32Read at Base 2.3.3-4~dfsg
- KFileMakeNewMD5Read at Base 2.3.3-4~dfsg
- KFileMakeNullRead at Base 2.3.3-4~dfsg
- KFileMakeNullUpdate at Base 2.3.3-4~dfsg
- KFileMakeReadHead at Base 2.3.3-4~dfsg
- KFileMakeStdErr at Base 2.3.3-4~dfsg
- KFileMakeStdIn at Base 2.3.3-4~dfsg
- KFileMakeStdOut at Base 2.3.3-4~dfsg
- KFileMakeSubRead at Base 2.3.3-4~dfsg
- KFileMakeSubUpdate at Base 2.3.3-4~dfsg
- KFileMakeTeeRead at Base 2.3.3-4~dfsg
- KFileMakeTeeUpdate at Base 2.3.3-4~dfsg
- KFileMakeWGAEncRead at Base 2.3.3-4~dfsg
- KFileRandomAccess at Base 2.3.3-4~dfsg
- KFileRead at Base 2.3.3-4~dfsg
- KFileReadAll at Base 2.3.3-4~dfsg
- KFileRelease at Base 2.3.3-4~dfsg
- KFileSetSize at Base 2.3.3-4~dfsg
- KFileSize at Base 2.3.3-4~dfsg
- KFileType at Base 2.3.3-4~dfsg
- KFileWrite at Base 2.3.3-4~dfsg
- KFileWriteAll at Base 2.3.3-4~dfsg
- KHttpAddRef at Base 2.3.3-4~dfsg
- KHttpGetHeaderLine at Base 2.3.3-4~dfsg
- KHttpGetStatusLine at Base 2.3.3-4~dfsg
- KHttpHeaderWhack at Base 2.3.3-4~dfsg
- KHttpMakeRequest at Base 2.3.3-4~dfsg
- KHttpRelease at Base 2.3.3-4~dfsg
- KHttpRequestAddHeader at Base 2.3.3-4~dfsg
- KHttpRequestAddPostParam at Base 2.3.3-4~dfsg
- KHttpRequestAddRef at Base 2.3.3-4~dfsg
- KHttpRequestByteRange at Base 2.3.3-4~dfsg
- KHttpRequestConnection at Base 2.3.3-4~dfsg
- KHttpRequestGET at Base 2.3.3-4~dfsg
- KHttpRequestHEAD at Base 2.3.3-4~dfsg
- KHttpRequestPOST at Base 2.3.3-4~dfsg
- KHttpRequestRelease at Base 2.3.3-4~dfsg
- KHttpRequestVAddPostParam at Base 2.3.3-4~dfsg
- KHttpResultAddHeader at Base 2.3.3-4~dfsg
- KHttpResultAddRef at Base 2.3.3-4~dfsg
- KHttpResultGetHeader at Base 2.3.3-4~dfsg
- KHttpResultGetInputStream at Base 2.3.3-4~dfsg
- KHttpResultKeepAlive at Base 2.3.3-4~dfsg
- KHttpResultRange at Base 2.3.3-4~dfsg
- KHttpResultRelease at Base 2.3.3-4~dfsg
- KHttpResultSize at Base 2.3.3-4~dfsg
- KHttpResultStatus at Base 2.3.3-4~dfsg
- KHttpVMakeRequest at Base 2.3.3-4~dfsg
- KIndexAddRef at Base 2.3.3-4~dfsg
- KIndexCommit at Base 2.3.3-4~dfsg
- KIndexDeleteText at Base 2.3.3-4~dfsg
- KIndexDeleteU64 at Base 2.3.3-4~dfsg
- KIndexFindAllText at Base 2.3.3-4~dfsg
- KIndexFindAllU64 at Base 2.3.3-4~dfsg
- KIndexFindText at Base 2.3.3-4~dfsg
- KIndexFindU64 at Base 2.3.3-4~dfsg
- KIndexInsertText at Base 2.3.3-4~dfsg
- KIndexInsertU64 at Base 2.3.3-4~dfsg
- KIndexLocked at Base 2.3.3-4~dfsg
- KIndexMarkModified at Base 2.3.3-4~dfsg
- KIndexProjectAllText at Base 2.3.3-4~dfsg
- KIndexProjectText at Base 2.3.3-4~dfsg
- KIndexRelease at Base 2.3.3-4~dfsg
- KIndexSetMaxRowId at Base 2.3.3-4~dfsg
- KIndexType at Base 2.3.3-4~dfsg
- KIndexVersion at Base 2.3.3-4~dfsg
- KKeyInitHex at Base 2.3.3-4~dfsg
- KKeyInitRead at Base 2.3.3-4~dfsg
- KKeyInitUpdate at Base 2.3.3-4~dfsg
- KKeyRingAddRef at Base 2.3.3-4~dfsg
- KKeyRingIsServerRunning at Base 2.3.3-4~dfsg
- KKeyRingMakeRead at Base 2.3.3-4~dfsg
- KKeyRingMakeUpdate at Base 2.3.3-4~dfsg
- KKeyRingRelease at Base 2.3.3-4~dfsg
- KKeyStoreAddRef at Base 2.3.3-4~dfsg
- KKeyStoreGetBindingsFile at Base 2.3.3-4~dfsg
- KKeyStoreGetKey at Base 2.3.3-4~dfsg
- KKeyStoreGetObjectName at Base 2.3.3-4~dfsg
- KKeyStoreMake at Base 2.3.3-4~dfsg
- KKeyStoreRegisterObject at Base 2.3.3-4~dfsg
- KKeyStoreRelease at Base 2.3.3-4~dfsg
- KKeyStoreSetBindingsFile at Base 2.3.3-4~dfsg
- KKeyStoreSetConfig at Base 2.3.3-4~dfsg
- KKeyStoreSetTemporaryKeyFromFile at Base 2.3.3-4~dfsg
- KLockAcquire at Base 2.3.3-4~dfsg
- KLockAddRef at Base 2.3.3-4~dfsg
- KLockFileAddRef at Base 2.3.3-4~dfsg
- KLockFileRelease at Base 2.3.3-4~dfsg
- KLockMake at Base 2.3.3-4~dfsg
- KLockRelease at Base 2.3.3-4~dfsg
- KLockTimedAcquire at Base 2.3.3-4~dfsg
- KLockUnlock at Base 2.3.3-4~dfsg
- KLogDataGet at Base 2.3.3-4~dfsg
- KLogDefaultFormatter at Base 2.3.3-4~dfsg
- KLogFmtDataGet at Base 2.3.3-4~dfsg
- KLogFmtFlagsGet at Base 2.3.3-4~dfsg
- KLogFmtFlagsSet at Base 2.3.3-4~dfsg
- KLogFmtHandlerGet at Base 2.3.3-4~dfsg
- KLogFmtHandlerSet at Base 2.3.3-4~dfsg
- KLogFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KLogFmtWriterGet at Base 2.3.3-4~dfsg
- KLogGetParamStrings at Base 2.3.3-4~dfsg
- KLogHandlerGet at Base 2.3.3-4~dfsg
- KLogHandlerSet at Base 2.3.3-4~dfsg
- KLogHandlerSetStdErr at Base 2.3.3-4~dfsg
- KLogHandlerSetStdOut at Base 2.3.3-4~dfsg
- KLogInit at Base 2.3.3-4~dfsg
- KLogLastErrorCode at Base 2.3.3-4~dfsg
- KLogLastErrorCodeReset at Base 2.3.3-4~dfsg
- KLogLastErrorCodeSet at Base 2.3.3-4~dfsg
- KLogLevelAdjust at Base 2.3.3-4~dfsg
- KLogLevelExplain at Base 2.3.3-4~dfsg
- KLogLevelGet at Base 2.3.3-4~dfsg
- KLogLevelSet at Base 2.3.3-4~dfsg
- KLogLibDataGet at Base 2.3.3-4~dfsg
- KLogLibFmtDataGet at Base 2.3.3-4~dfsg
- KLogLibFmtFlagsGet at Base 2.3.3-4~dfsg
- KLogLibFmtFlagsSet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerGet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerSet at Base 2.3.3-4~dfsg
- KLogLibFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KLogLibFmtWriterGet at Base 2.3.3-4~dfsg
- KLogLibHandlerGet at Base 2.3.3-4~dfsg
- KLogLibHandlerSet at Base 2.3.3-4~dfsg
- KLogLibHandlerSetStdErr at Base 2.3.3-4~dfsg
- KLogLibHandlerSetStdOut at Base 2.3.3-4~dfsg
- KLogLibWriterGet at Base 2.3.3-4~dfsg
- KLogWriterGet at Base 2.3.3-4~dfsg
- KMD5FileBeginTransaction at Base 2.3.3-4~dfsg
- KMD5FileCommit at Base 2.3.3-4~dfsg
- KMD5FileMakeAppend at Base 2.3.3-4~dfsg
- KMD5FileMakeWrite at Base 2.3.3-4~dfsg
- KMD5FileReset at Base 2.3.3-4~dfsg
- KMD5FileRevert at Base 2.3.3-4~dfsg
- KMD5FileToKFile at Base 2.3.3-4~dfsg
- KMD5FileToKFileConst at Base 2.3.3-4~dfsg
- KMD5SumFmtAddRef at Base 2.3.3-4~dfsg
- KMD5SumFmtCount at Base 2.3.3-4~dfsg
- KMD5SumFmtDelete at Base 2.3.3-4~dfsg
- KMD5SumFmtFind at Base 2.3.3-4~dfsg
- KMD5SumFmtFlush at Base 2.3.3-4~dfsg
- KMD5SumFmtGet at Base 2.3.3-4~dfsg
- KMD5SumFmtMakeRead at Base 2.3.3-4~dfsg
- KMD5SumFmtMakeUpdate at Base 2.3.3-4~dfsg
- KMD5SumFmtRelease at Base 2.3.3-4~dfsg
- KMD5SumFmtRename at Base 2.3.3-4~dfsg
- KMD5SumFmtUpdate at Base 2.3.3-4~dfsg
- KMDataNodeAddRef at Base 2.3.3-4~dfsg
- KMDataNodeAddr at Base 2.3.3-4~dfsg
- KMDataNodeAppend at Base 2.3.3-4~dfsg
- KMDataNodeByteOrder at Base 2.3.3-4~dfsg
- KMDataNodeDropAll at Base 2.3.3-4~dfsg
- KMDataNodeDropAttr at Base 2.3.3-4~dfsg
- KMDataNodeDropChild at Base 2.3.3-4~dfsg
- KMDataNodeFillSchema at Base 2.3.3-4~dfsg
- KMDataNodeListAttr at Base 2.3.3-4~dfsg
- KMDataNodeListChildren at Base 2.3.3-4~dfsg
- KMDataNodeOpenNodeRead at Base 2.3.3-4~dfsg
- KMDataNodeOpenNodeUpdate at Base 2.3.3-4~dfsg
- KMDataNodeRead at Base 2.3.3-4~dfsg
- KMDataNodeReadAsF64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsI64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAsU64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttr at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsF64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsI64 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU16 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU32 at Base 2.3.3-4~dfsg
- KMDataNodeReadAttrAsU64 at Base 2.3.3-4~dfsg
- KMDataNodeReadB128 at Base 2.3.3-4~dfsg
- KMDataNodeReadB16 at Base 2.3.3-4~dfsg
- KMDataNodeReadB32 at Base 2.3.3-4~dfsg
- KMDataNodeReadB64 at Base 2.3.3-4~dfsg
- KMDataNodeReadB8 at Base 2.3.3-4~dfsg
- KMDataNodeReadCString at Base 2.3.3-4~dfsg
- KMDataNodeRelease at Base 2.3.3-4~dfsg
- KMDataNodeRenameAttr at Base 2.3.3-4~dfsg
- KMDataNodeRenameChild at Base 2.3.3-4~dfsg
- KMDataNodeVDropChild at Base 2.3.3-4~dfsg
- KMDataNodeVOpenNodeRead at Base 2.3.3-4~dfsg
- KMDataNodeVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KMDataNodeWrite at Base 2.3.3-4~dfsg
- KMDataNodeWriteAttr at Base 2.3.3-4~dfsg
- KMDataNodeWriteB128 at Base 2.3.3-4~dfsg
- KMDataNodeWriteB16 at Base 2.3.3-4~dfsg
- KMDataNodeWriteB32 at Base 2.3.3-4~dfsg
- KMDataNodeWriteB64 at Base 2.3.3-4~dfsg
- KMDataNodeWriteB8 at Base 2.3.3-4~dfsg
- KMDataNodeWriteCString at Base 2.3.3-4~dfsg
- KMMapAddRef at Base 2.3.3-4~dfsg
- KMMapAddrRead at Base 2.3.3-4~dfsg
- KMMapAddrUpdate at Base 2.3.3-4~dfsg
- KMMapMake at Base 2.3.3-4~dfsg
- KMMapMakeMaxRead at Base 2.3.3-4~dfsg
- KMMapMakeMaxUpdate at Base 2.3.3-4~dfsg
- KMMapMakeRead at Base 2.3.3-4~dfsg
- KMMapMakeRgnRead at Base 2.3.3-4~dfsg
- KMMapMakeRgnUpdate at Base 2.3.3-4~dfsg
- KMMapMakeUpdate at Base 2.3.3-4~dfsg
- KMMapPosition at Base 2.3.3-4~dfsg
- KMMapROSys at Base 2.3.3-4~dfsg
- KMMapRWSys at Base 2.3.3-4~dfsg
- KMMapRelease at Base 2.3.3-4~dfsg
- KMMapReposition at Base 2.3.3-4~dfsg
- KMMapSize at Base 2.3.3-4~dfsg
- KMMapUnmap at Base 2.3.3-4~dfsg
- KMemBankAddRef at Base 2.3.3-4~dfsg
- KMemBankAlloc at Base 2.3.3-4~dfsg
- KMemBankFree at Base 2.3.3-4~dfsg
- KMemBankMake at Base 2.3.3-4~dfsg
- KMemBankRead at Base 2.3.3-4~dfsg
- KMemBankRelease at Base 2.3.3-4~dfsg
- KMemBankSetSize at Base 2.3.3-4~dfsg
- KMemBankSize at Base 2.3.3-4~dfsg
- KMemBankWrite at Base 2.3.3-4~dfsg
- KMetadataAddRef at Base 2.3.3-4~dfsg
- KMetadataByteOrder at Base 2.3.3-4~dfsg
- KMetadataCommit at Base 2.3.3-4~dfsg
- KMetadataFreeze at Base 2.3.3-4~dfsg
- KMetadataGetSequence at Base 2.3.3-4~dfsg
- KMetadataMaxRevision at Base 2.3.3-4~dfsg
- KMetadataNextSequence at Base 2.3.3-4~dfsg
- KMetadataOpenNodeRead at Base 2.3.3-4~dfsg
- KMetadataOpenNodeUpdate at Base 2.3.3-4~dfsg
- KMetadataOpenRevision at Base 2.3.3-4~dfsg
- KMetadataRelease at Base 2.3.3-4~dfsg
- KMetadataRevision at Base 2.3.3-4~dfsg
- KMetadataSetSequence at Base 2.3.3-4~dfsg
- KMetadataVOpenNodeRead at Base 2.3.3-4~dfsg
- KMetadataVOpenNodeUpdate at Base 2.3.3-4~dfsg
- KMetadataVersion at Base 2.3.3-4~dfsg
- KNSListen at Base 2.3.3-4~dfsg
- KNSMakeConnection at Base 2.3.3-4~dfsg
- KNSMakeIPCConnection at Base 2.3.3-4~dfsg
- KNSMakeListener at Base 2.3.3-4~dfsg
- KNSManagerAddRef at Base 2.3.3-4~dfsg
- KNSManagerAvail at Base 2.3.3-4~dfsg
- KNSManagerCleanup at Base 2.3.3-4~dfsg
- KNSManagerCurlVersion at Base 2.3.3-4~dfsg
- KNSManagerInit at Base 2.3.3-4~dfsg
- KNSManagerInitDNSEndpoint at Base 2.3.3-4~dfsg
- KNSManagerInitIPCEndpoint at Base 2.3.3-4~dfsg
- KNSManagerInitIPv4Endpoint at Base 2.3.3-4~dfsg
- KNSManagerMake at Base 2.3.3-4~dfsg
- KNSManagerMakeCurlRequest at Base 2.3.3-4~dfsg
- KNSManagerMakeHttp at Base 2.3.3-4~dfsg
- KNSManagerMakeHttpFile at Base 2.3.3-4~dfsg
- KNSManagerMakeRequest at Base 2.3.3-4~dfsg
- KNSManagerRelease at Base 2.3.3-4~dfsg
- KNSManagerVMakeHttpFile at Base 2.3.3-4~dfsg
- KNamelistAddRef at Base 2.3.3-4~dfsg
- KNamelistCount at Base 2.3.3-4~dfsg
- KNamelistGet at Base 2.3.3-4~dfsg
- KNamelistInit at Base 2.3.3-4~dfsg
- KNamelistRelease at Base 2.3.3-4~dfsg
- KNullBlockCipherByteMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecAesNiMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecMake at Base 2.3.3-4~dfsg
- KNullBlockCipherVecRegMake at Base 2.3.3-4~dfsg
- KOutDataGet at Base 2.3.3-4~dfsg
- KOutHandlerGet at Base 2.3.3-4~dfsg
- KOutHandlerSet at Base 2.3.3-4~dfsg
- KOutHandlerSetStdErr at Base 2.3.3-4~dfsg
- KOutHandlerSetStdOut at Base 2.3.3-4~dfsg
- KOutInit at Base 2.3.3-4~dfsg
- KOutMsg at Base 2.3.3-4~dfsg
- KOutWriterGet at Base 2.3.3-4~dfsg
- KPTrieIndexID2Ord_v2 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v1 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v2 at Base 2.3.3-4~dfsg
- KPTrieIndexInit_v3_v4 at Base 2.3.3-4~dfsg
- KPTrieIndexWhack_v1 at Base 2.3.3-4~dfsg
- KPTrieIndexWhack_v2 at Base 2.3.3-4~dfsg
- KPageAccessRead at Base 2.3.3-4~dfsg
- KPageAccessUpdate at Base 2.3.3-4~dfsg
- KPageAddRef at Base 2.3.3-4~dfsg
- KPageConstSize at Base 2.3.3-4~dfsg
- KPageFileAddRef at Base 2.3.3-4~dfsg
- KPageFileAlloc at Base 2.3.3-4~dfsg
- KPageFileDropBacking at Base 2.3.3-4~dfsg
- KPageFileGet at Base 2.3.3-4~dfsg
- KPageFileMakeRead at Base 2.3.3-4~dfsg
- KPageFileMakeUpdate at Base 2.3.3-4~dfsg
- KPageFilePosGet at Base 2.3.3-4~dfsg
- KPageFileRelease at Base 2.3.3-4~dfsg
- KPageFileSetSize at Base 2.3.3-4~dfsg
- KPageFileSize at Base 2.3.3-4~dfsg
- KPageId at Base 2.3.3-4~dfsg
- KPageRelease at Base 2.3.3-4~dfsg
- KProcMgrAddCleanupTask at Base 2.3.3-4~dfsg
- KProcMgrAddRef at Base 2.3.3-4~dfsg
- KProcMgrInit at Base 2.3.3-4~dfsg
- KProcMgrMakeSingleton at Base 2.3.3-4~dfsg
- KProcMgrRelease at Base 2.3.3-4~dfsg
- KProcMgrRemoveCleanupTask at Base 2.3.3-4~dfsg
- KProcMgrWhack at Base 2.3.3-4~dfsg
- KQueueAddRef at Base 2.3.3-4~dfsg
- KQueueMake at Base 2.3.3-4~dfsg
- KQueuePop at Base 2.3.3-4~dfsg
- KQueuePush at Base 2.3.3-4~dfsg
- KQueueRelease at Base 2.3.3-4~dfsg
- KQueueSeal at Base 2.3.3-4~dfsg
- KQueueSealed at Base 2.3.3-4~dfsg
- KQuickMountDirMake at Base 2.3.3-4~dfsg
- KRWLockAcquireExcl at Base 2.3.3-4~dfsg
- KRWLockAcquireShared at Base 2.3.3-4~dfsg
- KRWLockAddRef at Base 2.3.3-4~dfsg
- KRWLockMake at Base 2.3.3-4~dfsg
- KRWLockRelease at Base 2.3.3-4~dfsg
- KRWLockTimedAcquireExcl at Base 2.3.3-4~dfsg
- KRWLockTimedAcquireShared at Base 2.3.3-4~dfsg
- KRWLockUnlock at Base 2.3.3-4~dfsg
- KRamFileMakeRead at Base 2.3.3-4~dfsg
- KRamFileMakeUpdate at Base 2.3.3-4~dfsg
- KRamFileMakeWrite at Base 2.3.3-4~dfsg
- KReencFileMakeRead at Base 2.3.3-4~dfsg
- KReencFileMakeWrite at Base 2.3.3-4~dfsg
- KRefcountAdd at Base 2.3.3-4~dfsg
- KRefcountAddDep at Base 2.3.3-4~dfsg
- KRefcountDrop at Base 2.3.3-4~dfsg
- KRefcountDropDep at Base 2.3.3-4~dfsg
- KRefcountInit at Base 2.3.3-4~dfsg
- KRefcountWhack at Base 2.3.3-4~dfsg
- KRepositoryAddRef at Base 2.3.3-4~dfsg
- KRepositoryCacheEnabled at Base 2.3.3-4~dfsg
- KRepositoryCategory at Base 2.3.3-4~dfsg
- KRepositoryDescription at Base 2.3.3-4~dfsg
- KRepositoryDisabled at Base 2.3.3-4~dfsg
- KRepositoryDisplayName at Base 2.3.3-4~dfsg
- KRepositoryDownloadTicket at Base 2.3.3-4~dfsg
- KRepositoryEncryptionKey at Base 2.3.3-4~dfsg
- KRepositoryEncryptionKeyFile at Base 2.3.3-4~dfsg
- KRepositoryMakeResolver at Base 2.3.3-4~dfsg
- KRepositoryMgrAddRef at Base 2.3.3-4~dfsg
- KRepositoryMgrCurrentProtectedRepository at Base 2.3.3-4~dfsg
- KRepositoryMgrGetProtectedRepository at Base 2.3.3-4~dfsg
- KRepositoryMgrRelease at Base 2.3.3-4~dfsg
- KRepositoryMgrRemoteRepositories at Base 2.3.3-4~dfsg
- KRepositoryMgrSiteRepositories at Base 2.3.3-4~dfsg
- KRepositoryMgrUserRepositories at Base 2.3.3-4~dfsg
- KRepositoryName at Base 2.3.3-4~dfsg
- KRepositoryRelease at Base 2.3.3-4~dfsg
- KRepositoryRoot at Base 2.3.3-4~dfsg
- KRepositorySetDisabled at Base 2.3.3-4~dfsg
- KRepositorySubCategory at Base 2.3.3-4~dfsg
- KRepositoryVectorWhack at Base 2.3.3-4~dfsg
- KSemaphoreAddRef at Base 2.3.3-4~dfsg
- KSemaphoreAlloc at Base 2.3.3-4~dfsg
- KSemaphoreCancel at Base 2.3.3-4~dfsg
- KSemaphoreCount at Base 2.3.3-4~dfsg
- KSemaphoreFree at Base 2.3.3-4~dfsg
- KSemaphoreMake at Base 2.3.3-4~dfsg
- KSemaphoreRelease at Base 2.3.3-4~dfsg
- KSemaphoreSignal at Base 2.3.3-4~dfsg
- KSemaphoreTimedAlloc at Base 2.3.3-4~dfsg
- KSemaphoreTimedWait at Base 2.3.3-4~dfsg
- KSemaphoreWait at Base 2.3.3-4~dfsg
- KSocketAddRef at Base 2.3.3-4~dfsg
- KSocketRelease at Base 2.3.3-4~dfsg
- KSocketWhack at Base 2.3.3-4~dfsg
- KStreamAddRef at Base 2.3.3-4~dfsg
- KStreamFromKFilePair at Base 2.3.3-4~dfsg
- KStreamFromKStreamPair at Base 2.3.3-4~dfsg
- KStreamInit at Base 2.3.3-4~dfsg
- KStreamMakeStdErr at Base 2.3.3-4~dfsg
- KStreamMakeStdIn at Base 2.3.3-4~dfsg
- KStreamMakeStdOut at Base 2.3.3-4~dfsg
- KStreamRead at Base 2.3.3-4~dfsg
- KStreamReadAll at Base 2.3.3-4~dfsg
- KStreamRelease at Base 2.3.3-4~dfsg
- KStreamWrite at Base 2.3.3-4~dfsg
- KStreamWriteAll at Base 2.3.3-4~dfsg
- KStsDataGet at Base 2.3.3-4~dfsg
- KStsFmtDataGet at Base 2.3.3-4~dfsg
- KStsFmtFlagsGet at Base 2.3.3-4~dfsg
- KStsFmtFlagsSet at Base 2.3.3-4~dfsg
- KStsFmtHandlerGet at Base 2.3.3-4~dfsg
- KStsFmtHandlerSet at Base 2.3.3-4~dfsg
- KStsFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KStsFmtWriterGet at Base 2.3.3-4~dfsg
- KStsHandlerGet at Base 2.3.3-4~dfsg
- KStsHandlerSet at Base 2.3.3-4~dfsg
- KStsHandlerSetStdErr at Base 2.3.3-4~dfsg
- KStsHandlerSetStdOut at Base 2.3.3-4~dfsg
- KStsInit at Base 2.3.3-4~dfsg
- KStsLevelAdjust at Base 2.3.3-4~dfsg
- KStsLevelGet at Base 2.3.3-4~dfsg
- KStsLevelSet at Base 2.3.3-4~dfsg
- KStsLibDataGet at Base 2.3.3-4~dfsg
- KStsLibFmtDataGet at Base 2.3.3-4~dfsg
- KStsLibFmtFlagsGet at Base 2.3.3-4~dfsg
- KStsLibFmtFlagsSet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerGet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerSet at Base 2.3.3-4~dfsg
- KStsLibFmtHandlerSetDefault at Base 2.3.3-4~dfsg
- KStsLibFmtWriterGet at Base 2.3.3-4~dfsg
- KStsLibHandlerGet at Base 2.3.3-4~dfsg
- KStsLibHandlerSet at Base 2.3.3-4~dfsg
- KStsLibHandlerSetStdErr at Base 2.3.3-4~dfsg
- KStsLibHandlerSetStdOut at Base 2.3.3-4~dfsg
- KStsLibMsg at Base 2.3.3-4~dfsg
- KStsLibWriterGet at Base 2.3.3-4~dfsg
- KStsMsg at Base 2.3.3-4~dfsg
- KStsWriterGet at Base 2.3.3-4~dfsg
- KSymAddrAddRef at Base 2.3.3-4~dfsg
- KSymAddrAsFunc at Base 2.3.3-4~dfsg
- KSymAddrAsObj at Base 2.3.3-4~dfsg
- KSymAddrRelease at Base 2.3.3-4~dfsg
- KSymTableCreateNamespace at Base 2.3.3-4~dfsg
- KSymTableCreateSymbol at Base 2.3.3-4~dfsg
- KSymTableDupSymbol at Base 2.3.3-4~dfsg
- KSymTableFind at Base 2.3.3-4~dfsg
- KSymTableFindGlobal at Base 2.3.3-4~dfsg
- KSymTableFindIntrinsic at Base 2.3.3-4~dfsg
- KSymTableFindNext at Base 2.3.3-4~dfsg
- KSymTableFindShallow at Base 2.3.3-4~dfsg
- KSymTableFindSymbol at Base 2.3.3-4~dfsg
- KSymTableInit at Base 2.3.3-4~dfsg
- KSymTablePopNamespace at Base 2.3.3-4~dfsg
- KSymTablePopScope at Base 2.3.3-4~dfsg
- KSymTablePushNamespace at Base 2.3.3-4~dfsg
- KSymTablePushScope at Base 2.3.3-4~dfsg
- KSymTableRemoveSymbol at Base 2.3.3-4~dfsg
- KSymbolCmp at Base 2.3.3-4~dfsg
- KSymbolCopy at Base 2.3.3-4~dfsg
- KSymbolCopyScope at Base 2.3.3-4~dfsg
- KSymbolDump at Base 2.3.3-4~dfsg
- KSymbolDumpAlias at Base 2.3.3-4~dfsg
- KSymbolInit at Base 2.3.3-4~dfsg
- KSymbolMake at Base 2.3.3-4~dfsg
- KSymbolSort at Base 2.3.3-4~dfsg
- KSymbolWhack at Base 2.3.3-4~dfsg
- KSysDirMakePath at Base 2.3.3-4~dfsg
- KSysDirRealPath at Base 2.3.3-4~dfsg
- KSysDirVRealPath at Base 2.3.3-4~dfsg
- KSysFileMake at Base 2.3.3-4~dfsg
- KTableAddRef at Base 2.3.3-4~dfsg
- KTableAliasColumn at Base 2.3.3-4~dfsg
- KTableAliasIndex at Base 2.3.3-4~dfsg
- KTableAttach at Base 2.3.3-4~dfsg
- KTableColumnNeedsReindex at Base 2.3.3-4~dfsg
- KTableCreateColumn at Base 2.3.3-4~dfsg
- KTableCreateIndex at Base 2.3.3-4~dfsg
- KTableDropColumn at Base 2.3.3-4~dfsg
- KTableDropIndex at Base 2.3.3-4~dfsg
- KTableExists at Base 2.3.3-4~dfsg
- KTableGetPath at Base 2.3.3-4~dfsg
- KTableIsAlias at Base 2.3.3-4~dfsg
- KTableListCol at Base 2.3.3-4~dfsg
- KTableListIdx at Base 2.3.3-4~dfsg
- KTableLock at Base 2.3.3-4~dfsg
- KTableLocked at Base 2.3.3-4~dfsg
- KTableModDate at Base 2.3.3-4~dfsg
- KTableOpenColumnRead at Base 2.3.3-4~dfsg
- KTableOpenColumnUpdate at Base 2.3.3-4~dfsg
- KTableOpenDirectoryRead at Base 2.3.3-4~dfsg
- KTableOpenDirectoryUpdate at Base 2.3.3-4~dfsg
- KTableOpenIndexRead at Base 2.3.3-4~dfsg
- KTableOpenIndexUpdate at Base 2.3.3-4~dfsg
- KTableOpenManagerRead at Base 2.3.3-4~dfsg
- KTableOpenManagerUpdate at Base 2.3.3-4~dfsg
- KTableOpenMetadataRead at Base 2.3.3-4~dfsg
- KTableOpenMetadataUpdate at Base 2.3.3-4~dfsg
- KTableOpenParentRead at Base 2.3.3-4~dfsg
- KTableOpenParentUpdate at Base 2.3.3-4~dfsg
- KTableReindex at Base 2.3.3-4~dfsg
- KTableRelease at Base 2.3.3-4~dfsg
- KTableRenameColumn at Base 2.3.3-4~dfsg
- KTableRenameIndex at Base 2.3.3-4~dfsg
- KTableSever at Base 2.3.3-4~dfsg
- KTableUnlock at Base 2.3.3-4~dfsg
- KTableVCreateColumn at Base 2.3.3-4~dfsg
- KTableVCreateIndex at Base 2.3.3-4~dfsg
- KTableVDropColumn at Base 2.3.3-4~dfsg
- KTableVDropIndex at Base 2.3.3-4~dfsg
- KTableVExists at Base 2.3.3-4~dfsg
- KTableVLock at Base 2.3.3-4~dfsg
- KTableVOpenColumnRead at Base 2.3.3-4~dfsg
- KTableVOpenColumnUpdate at Base 2.3.3-4~dfsg
- KTableVOpenIndexRead at Base 2.3.3-4~dfsg
- KTableVOpenIndexUpdate at Base 2.3.3-4~dfsg
- KTableVUnlock at Base 2.3.3-4~dfsg
- KTableVWritable at Base 2.3.3-4~dfsg
- KTableWritable at Base 2.3.3-4~dfsg
- KTaskAddRef at Base 2.3.3-4~dfsg
- KTaskDestroy at Base 2.3.3-4~dfsg
- KTaskExecute at Base 2.3.3-4~dfsg
- KTaskInit at Base 2.3.3-4~dfsg
- KTaskRelease at Base 2.3.3-4~dfsg
- KThreadAddRef at Base 2.3.3-4~dfsg
- KThreadCancel at Base 2.3.3-4~dfsg
- KThreadDetach at Base 2.3.3-4~dfsg
- KThreadMake at Base 2.3.3-4~dfsg
- KThreadRelease at Base 2.3.3-4~dfsg
- KThreadWait at Base 2.3.3-4~dfsg
- KTimeGlobal at Base 2.3.3-4~dfsg
- KTimeLocal at Base 2.3.3-4~dfsg
- KTimeStamp at Base 2.3.3-4~dfsg
- KTocAddRef at Base 2.3.3-4~dfsg
- KTocAlignmentGet at Base 2.3.3-4~dfsg
- KTocAlignmentSet at Base 2.3.3-4~dfsg
- KTocCreateChunkedFile at Base 2.3.3-4~dfsg
- KTocCreateDir at Base 2.3.3-4~dfsg
- KTocCreateFile at Base 2.3.3-4~dfsg
- KTocCreateHardLink at Base 2.3.3-4~dfsg
- KTocCreateSoftLink at Base 2.3.3-4~dfsg
- KTocCreateZombieFile at Base 2.3.3-4~dfsg
- KTocEntryCmp2 at Base 2.3.3-4~dfsg
- KTocEntryCmpVoid at Base 2.3.3-4~dfsg
- KTocEntryDelete at Base 2.3.3-4~dfsg
- KTocEntryGetAccess at Base 2.3.3-4~dfsg
- KTocEntryGetBSTree at Base 2.3.3-4~dfsg
- KTocEntryGetChunks at Base 2.3.3-4~dfsg
- KTocEntryGetFileLocator at Base 2.3.3-4~dfsg
- KTocEntryGetFileOffset at Base 2.3.3-4~dfsg
- KTocEntryGetFilePhysicalSize at Base 2.3.3-4~dfsg
- KTocEntryGetFileSize at Base 2.3.3-4~dfsg
- KTocEntryGetHardTarget at Base 2.3.3-4~dfsg
- KTocEntryGetName at Base 2.3.3-4~dfsg
- KTocEntryGetSoftTarget at Base 2.3.3-4~dfsg
- KTocEntryGetTime at Base 2.3.3-4~dfsg
- KTocEntryGetType at Base 2.3.3-4~dfsg
- KTocEntryNewChunked at Base 2.3.3-4~dfsg
- KTocEntryNewDirectory at Base 2.3.3-4~dfsg
- KTocEntryNewFile at Base 2.3.3-4~dfsg
- KTocEntryNewHard at Base 2.3.3-4~dfsg
- KTocEntryNewSoft at Base 2.3.3-4~dfsg
- KTocEntryNewZombieFile at Base 2.3.3-4~dfsg
- KTocEntryPersist at Base 2.3.3-4~dfsg
- KTocEntryPersistNodeDir at Base 2.3.3-4~dfsg
- KTocEntryPersistWriteFunc at Base 2.3.3-4~dfsg
- KTocEntryStackDel at Base 2.3.3-4~dfsg
- KTocEntryStackDepth at Base 2.3.3-4~dfsg
- KTocEntryStackNew at Base 2.3.3-4~dfsg
- KTocEntryStackPop at Base 2.3.3-4~dfsg
- KTocEntryStackPush at Base 2.3.3-4~dfsg
- KTocEntryTypeGetString at Base 2.3.3-4~dfsg
- KTocEntryWhack at Base 2.3.3-4~dfsg
- KTocFileMake at Base 2.3.3-4~dfsg
- KTocGetArchive at Base 2.3.3-4~dfsg
- KTocGetPath at Base 2.3.3-4~dfsg
- KTocGetRoot at Base 2.3.3-4~dfsg
- KTocInflatePBSTree at Base 2.3.3-4~dfsg
- KTocInit at Base 2.3.3-4~dfsg
- KTocPersist at Base 2.3.3-4~dfsg
- KTocRelease at Base 2.3.3-4~dfsg
- KTocResolvePathFromOffset at Base 2.3.3-4~dfsg
- KTocResolvePathTocEntry at Base 2.3.3-4~dfsg
- KTocVCreateChunkedFile at Base 2.3.3-4~dfsg
- KTocVCreateDir at Base 2.3.3-4~dfsg
- KTocVCreateFile at Base 2.3.3-4~dfsg
- KTocVCreateHardLink at Base 2.3.3-4~dfsg
- KTocVCreateSoftLink at Base 2.3.3-4~dfsg
- KTocVCreateZombieFile at Base 2.3.3-4~dfsg
- KTokenExpected at Base 2.3.3-4~dfsg
- KTokenFailure at Base 2.3.3-4~dfsg
- KTokenRCExplain at Base 2.3.3-4~dfsg
- KTokenSourceConsume at Base 2.3.3-4~dfsg
- KTokenSourceReturn at Base 2.3.3-4~dfsg
- KTokenToF64 at Base 2.3.3-4~dfsg
- KTokenToI32 at Base 2.3.3-4~dfsg
- KTokenToI64 at Base 2.3.3-4~dfsg
- KTokenToString at Base 2.3.3-4~dfsg
- KTokenToU32 at Base 2.3.3-4~dfsg
- KTokenToU64 at Base 2.3.3-4~dfsg
- KTokenToVersion at Base 2.3.3-4~dfsg
- KTokenToWideString at Base 2.3.3-4~dfsg
- KTokenizerNext at Base 2.3.3-4~dfsg
- KTrieIndexAttach_v2 at Base 2.3.3-4~dfsg
- KTrieIndexDelete_v1 at Base 2.3.3-4~dfsg
- KTrieIndexDelete_v2 at Base 2.3.3-4~dfsg
- KTrieIndexFind_v1 at Base 2.3.3-4~dfsg
- KTrieIndexFind_v2 at Base 2.3.3-4~dfsg
- KTrieIndexInsert_v1 at Base 2.3.3-4~dfsg
- KTrieIndexInsert_v2 at Base 2.3.3-4~dfsg
- KTrieIndexOpen_v1 at Base 2.3.3-4~dfsg
- KTrieIndexOpen_v2 at Base 2.3.3-4~dfsg
- KTrieIndexPersist_v1 at Base 2.3.3-4~dfsg
- KTrieIndexPersist_v2 at Base 2.3.3-4~dfsg
- KTrieIndexProject_v1 at Base 2.3.3-4~dfsg
- KTrieIndexProject_v2 at Base 2.3.3-4~dfsg
- KTrieIndexWhack_v1 at Base 2.3.3-4~dfsg
- KTrieIndexWhack_v2 at Base 2.3.3-4~dfsg
- KU64IndexDelete_v3 at Base 2.3.3-4~dfsg
- KU64IndexFindAll_v3 at Base 2.3.3-4~dfsg
- KU64IndexFind_v3 at Base 2.3.3-4~dfsg
- KU64IndexInsert_v3 at Base 2.3.3-4~dfsg
- KU64IndexOpen_v3 at Base 2.3.3-4~dfsg
- KU64IndexPersist_v3 at Base 2.3.3-4~dfsg
- KU64IndexWhack_v3 at Base 2.3.3-4~dfsg
- KUrlFetcherAddRef at Base 2.3.3-4~dfsg
- KUrlFetcherCurlMake at Base 2.3.3-4~dfsg
- KUrlFetcherInit at Base 2.3.3-4~dfsg
- KUrlFetcherRead at Base 2.3.3-4~dfsg
- KUrlFetcherRelease at Base 2.3.3-4~dfsg
- KVectorAddRef at Base 2.3.3-4~dfsg
- KVectorGet at Base 2.3.3-4~dfsg
- KVectorGetBool at Base 2.3.3-4~dfsg
- KVectorGetF32 at Base 2.3.3-4~dfsg
- KVectorGetF64 at Base 2.3.3-4~dfsg
- KVectorGetI16 at Base 2.3.3-4~dfsg
- KVectorGetI32 at Base 2.3.3-4~dfsg
- KVectorGetI64 at Base 2.3.3-4~dfsg
- KVectorGetI8 at Base 2.3.3-4~dfsg
- KVectorGetPtr at Base 2.3.3-4~dfsg
- KVectorGetU16 at Base 2.3.3-4~dfsg
- KVectorGetU32 at Base 2.3.3-4~dfsg
- KVectorGetU64 at Base 2.3.3-4~dfsg
- KVectorGetU8 at Base 2.3.3-4~dfsg
- KVectorMake at Base 2.3.3-4~dfsg
- KVectorRelease at Base 2.3.3-4~dfsg
- KVectorSet at Base 2.3.3-4~dfsg
- KVectorSetBool at Base 2.3.3-4~dfsg
- KVectorSetF32 at Base 2.3.3-4~dfsg
- KVectorSetF64 at Base 2.3.3-4~dfsg
- KVectorSetI16 at Base 2.3.3-4~dfsg
- KVectorSetI32 at Base 2.3.3-4~dfsg
- KVectorSetI64 at Base 2.3.3-4~dfsg
- KVectorSetI8 at Base 2.3.3-4~dfsg
- KVectorSetPtr at Base 2.3.3-4~dfsg
- KVectorSetU16 at Base 2.3.3-4~dfsg
- KVectorSetU32 at Base 2.3.3-4~dfsg
- KVectorSetU64 at Base 2.3.3-4~dfsg
- KVectorSetU8 at Base 2.3.3-4~dfsg
- KVectorUnset at Base 2.3.3-4~dfsg
- KVectorVisit at Base 2.3.3-4~dfsg
- KVectorVisitBool at Base 2.3.3-4~dfsg
- KVectorVisitF64 at Base 2.3.3-4~dfsg
- KVectorVisitI64 at Base 2.3.3-4~dfsg
- KVectorVisitPtr at Base 2.3.3-4~dfsg
- KVectorVisitU64 at Base 2.3.3-4~dfsg
- KWrtFmt_error_code at Base 2.3.3-4~dfsg
- KWrtFmt_rc_t at Base 2.3.3-4~dfsg
- KWrtInit at Base 2.3.3-4~dfsg
- KWrtSysInit at Base 2.3.3-4~dfsg
- KWrt_DefaultWriter at Base 2.3.3-4~dfsg
- KWrt_DefaultWriterDataStdErr at Base 2.3.3-4~dfsg
- KWrt_DefaultWriterDataStdOut at Base 2.3.3-4~dfsg
- KXMLDocAddRef at Base 2.3.3-4~dfsg
- KXMLDocOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLDocRelease at Base 2.3.3-4~dfsg
- KXMLDocVOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLMgrAddRef at Base 2.3.3-4~dfsg
- KXMLMgrMakeDocRead at Base 2.3.3-4~dfsg
- KXMLMgrMakeDocReadFromMemory at Base 2.3.3-4~dfsg
- KXMLMgrMakeRead at Base 2.3.3-4~dfsg
- KXMLMgrRelease at Base 2.3.3-4~dfsg
- KXMLNodeCountChildNodes at Base 2.3.3-4~dfsg
- KXMLNodeElementName at Base 2.3.3-4~dfsg
- KXMLNodeGetFirstChildNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeGetName at Base 2.3.3-4~dfsg
- KXMLNodeGetNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeListAttr at Base 2.3.3-4~dfsg
- KXMLNodeListChild at Base 2.3.3-4~dfsg
- KXMLNodeOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeReadAsF64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsI64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAsU64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttr at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsF64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsI64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU16 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU32 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrAsU64 at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrCStr at Base 2.3.3-4~dfsg
- KXMLNodeReadAttrCString at Base 2.3.3-4~dfsg
- KXMLNodeReadCStr at Base 2.3.3-4~dfsg
- KXMLNodeReadCString at Base 2.3.3-4~dfsg
- KXMLNodeRelease at Base 2.3.3-4~dfsg
- KXMLNodeVGetFirstChildNodeRead at Base 2.3.3-4~dfsg
- KXMLNodeVOpenNodesetRead at Base 2.3.3-4~dfsg
- KXMLNodesetAddRef at Base 2.3.3-4~dfsg
- KXMLNodesetCount at Base 2.3.3-4~dfsg
- KXMLNodesetGetNodeRead at Base 2.3.3-4~dfsg
- KXMLNodesetRelease at Base 2.3.3-4~dfsg
- KartAddRef at Base 2.3.3-4~dfsg
- KartItemAccession at Base 2.3.3-4~dfsg
- KartItemAddRef at Base 2.3.3-4~dfsg
- KartItemItemDesc at Base 2.3.3-4~dfsg
- KartItemItemId at Base 2.3.3-4~dfsg
- KartItemItemIdNumber at Base 2.3.3-4~dfsg
- KartItemName at Base 2.3.3-4~dfsg
- KartItemPrint at Base 2.3.3-4~dfsg
- KartItemProjId at Base 2.3.3-4~dfsg
- KartItemProjIdNumber at Base 2.3.3-4~dfsg
- KartItemRelease at Base 2.3.3-4~dfsg
- KartMake at Base 2.3.3-4~dfsg
- KartMakeNextItem at Base 2.3.3-4~dfsg
- KartPrint at Base 2.3.3-4~dfsg
- KartRelease at Base 2.3.3-4~dfsg
- LFactoryWhack at Base 2.3.3-4~dfsg
- LSpecialWhack at Base 2.3.3-4~dfsg
- LegacyVPathGetScheme_t at Base 2.3.3-4~dfsg
- LegacyVPathGetUri_t at Base 2.3.3-4~dfsg
- LegacyVPathMake at Base 2.3.3-4~dfsg
- LegacyVPathMakeDirectoryRelative at Base 2.3.3-4~dfsg
- LegacyVPathMakeFmt at Base 2.3.3-4~dfsg
- LegacyVPathMakeSysPath at Base 2.3.3-4~dfsg
- LegacyVPathMakeVFmt at Base 2.3.3-4~dfsg
- LogAppName at Base 2.3.3-4~dfsg
- LogAppVersion at Base 2.3.3-4~dfsg
- LogErr at Base 2.3.3-4~dfsg
- LogFlush at Base 2.3.3-4~dfsg
- LogInsertSpace at Base 2.3.3-4~dfsg
- LogLibErr at Base 2.3.3-4~dfsg
- LogLibMsg at Base 2.3.3-4~dfsg
- LogMsg at Base 2.3.3-4~dfsg
- LogPID at Base 2.3.3-4~dfsg
- LogSimpleTimestamp at Base 2.3.3-4~dfsg
- LogTimestamp at Base 2.3.3-4~dfsg
- MD5StateAppend at Base 2.3.3-4~dfsg
- MD5StateFinish at Base 2.3.3-4~dfsg
- MD5StateInit at Base 2.3.3-4~dfsg
- MyersFindAll at Base 2.3.3-4~dfsg
- MyersFindBest at Base 2.3.3-4~dfsg
- MyersFindFirst at Base 2.3.3-4~dfsg
- MyersUnlimitedFindAll at Base 2.3.3-4~dfsg
- MyersUnlimitedFindBest at Base 2.3.3-4~dfsg
- MyersUnlimitedFindFirst at Base 2.3.3-4~dfsg
- MyersUnlimitedFree at Base 2.3.3-4~dfsg
- MyersUnlimitedMake at Base 2.3.3-4~dfsg
- NCBI_SRA_ABI_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_ABI_untyped_1 at Base 2.3.3-4~dfsg
- NCBI_SRA_Helicos_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_0a at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_0b at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_1a at Base 2.3.3-4~dfsg
- NCBI_SRA_Illumina_untyped_1b at Base 2.3.3-4~dfsg
- NCBI_SRA_IonTorrent_tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA__454__dynamic_read_desc at Base 2.3.3-4~dfsg
- NCBI_SRA__454__process_position at Base 2.3.3-4~dfsg
- NCBI_SRA__454__tokenize_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_0 at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_1_2a at Base 2.3.3-4~dfsg
- NCBI_SRA__454__untyped_1_2b at Base 2.3.3-4~dfsg
- NCBI_SRA_accept_untyped at Base 2.3.3-4~dfsg
- NCBI_SRA_bio_start at Base 2.3.3-4~dfsg
- NCBI_SRA_cmp_stats_trigger at Base 2.3.3-4~dfsg
- NCBI_SRA_cmpf_stats_trigger at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_CLIP at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_INTENSITY at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_NOISE at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_POSITION at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_QUALITY at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_READ at Base 2.3.3-4~dfsg
- NCBI_SRA_decode_SIGNAL at Base 2.3.3-4~dfsg
- NCBI_SRA_denormalize at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_coordinates at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_name_coord at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_name_fmt at Base 2.3.3-4~dfsg
- NCBI_SRA_extract_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_fix_read_seg at Base 2.3.3-4~dfsg
- NCBI_SRA_lookup at Base 2.3.3-4~dfsg
- NCBI_SRA_make_position at Base 2.3.3-4~dfsg
- NCBI_SRA_make_read_desc at Base 2.3.3-4~dfsg
- NCBI_SRA_make_spot_desc at Base 2.3.3-4~dfsg
- NCBI_SRA_normalize at Base 2.3.3-4~dfsg
- NCBI_SRA_phred_stats_trigger at Base 2.3.3-4~dfsg
- NCBI_SRA_qual4_decode at Base 2.3.3-4~dfsg
- NCBI_SRA_qual4_decompress_v1 at Base 2.3.3-4~dfsg
- NCBI_SRA_qual4_encode at Base 2.3.3-4~dfsg
- NCBI_SRA_read_seg_from_readn at Base 2.3.3-4~dfsg
- NCBI_SRA_rewrite_spot_name at Base 2.3.3-4~dfsg
- NCBI_SRA_rotate at Base 2.3.3-4~dfsg
- NCBI_SRA_stats_trigger at Base 2.3.3-4~dfsg
- NCBI_SRA_swap at Base 2.3.3-4~dfsg
- NCBI_WGS_build_read_type at Base 2.3.3-4~dfsg
- NCBI_WGS_build_scaffold_qual at Base 2.3.3-4~dfsg
- NCBI_WGS_build_scaffold_read at Base 2.3.3-4~dfsg
- NCBI_WGS_tokenize_nuc_accession at Base 2.3.3-4~dfsg
- NCBI_WGS_tokenize_prot_accession at Base 2.3.3-4~dfsg
- NCBI_align_clip at Base 2.3.3-4~dfsg
- NCBI_align_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_compress_quality at Base 2.3.3-4~dfsg
- NCBI_align_decompress_quality at Base 2.3.3-4~dfsg
- NCBI_align_edit_distance at Base 2.3.3-4~dfsg
- NCBI_align_edit_distance_2 at Base 2.3.3-4~dfsg
- NCBI_align_generate_mismatch_qual_2 at Base 2.3.3-4~dfsg
- NCBI_align_generate_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_cigar at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_cigar_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_clipped_ref_offset at Base 2.3.3-4~dfsg
- NCBI_align_get_left_soft_clip at Base 2.3.3-4~dfsg
- NCBI_align_get_left_soft_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_mate_align_id at Base 2.3.3-4~dfsg
- NCBI_align_get_mismatch_read at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_delete at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_insert at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_len at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_mismatch at Base 2.3.3-4~dfsg
- NCBI_align_get_ref_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_3 at Base 2.3.3-4~dfsg
- NCBI_align_get_right_soft_clip_4 at Base 2.3.3-4~dfsg
- NCBI_align_get_sam_flags at Base 2.3.3-4~dfsg
- NCBI_align_get_sam_flags_2 at Base 2.3.3-4~dfsg
- NCBI_align_get_seq_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_local_ref_id at Base 2.3.3-4~dfsg
- NCBI_align_local_ref_start at Base 2.3.3-4~dfsg
- NCBI_align_make_cmp_read_desc at Base 2.3.3-4~dfsg
- NCBI_align_make_read_start at Base 2.3.3-4~dfsg
- NCBI_align_mismatch_restore_qual at Base 2.3.3-4~dfsg
- NCBI_align_not_my_row at Base 2.3.3-4~dfsg
- NCBI_align_raw_restore_qual at Base 2.3.3-4~dfsg
- NCBI_align_ref_name at Base 2.3.3-4~dfsg
- NCBI_align_ref_pos at Base 2.3.3-4~dfsg
- NCBI_align_ref_seq_id at Base 2.3.3-4~dfsg
- NCBI_align_ref_sub_select_preserve_qual at Base 2.3.3-4~dfsg
- NCBI_align_seq_construct_read at Base 2.3.3-4~dfsg
- NCBI_align_template_len at Base 2.3.3-4~dfsg
- NCBI_color_from_dna at Base 2.3.3-4~dfsg
- NCBI_dna_from_color at Base 2.3.3-4~dfsg
- NCBI_fp_extend at Base 2.3.3-4~dfsg
- NCBI_lower_case_tech_reads at Base 2.3.3-4~dfsg
- NCBI_refSeq_stats at Base 2.3.3-4~dfsg
- NCBI_unpack at Base 2.3.3-4~dfsg
- NCBI_unzip at Base 2.3.3-4~dfsg
- NCBI_var_tokenize_var_id at Base 2.3.3-4~dfsg
- NucStrstrMake at Base 2.3.3-4~dfsg
- NucStrstrSearch at Base 2.3.3-4~dfsg
- NucStrstrWhack at Base 2.3.3-4~dfsg
- PBSTNodeFindNext at Base 2.3.3-4~dfsg
- PBSTNodeFindPrev at Base 2.3.3-4~dfsg
- PBSTNodeNext at Base 2.3.3-4~dfsg
- PBSTNodePrev at Base 2.3.3-4~dfsg
- PBSTreeCount at Base 2.3.3-4~dfsg
- PBSTreeDepth at Base 2.3.3-4~dfsg
- PBSTreeDoUntil at Base 2.3.3-4~dfsg
- PBSTreeFind at Base 2.3.3-4~dfsg
- PBSTreeForEach at Base 2.3.3-4~dfsg
- PBSTreeGetNode at Base 2.3.3-4~dfsg
- PBSTreeGetNodeData at Base 2.3.3-4~dfsg
- PBSTreeInit at Base 2.3.3-4~dfsg
- PBSTreeMake at Base 2.3.3-4~dfsg
- PBSTreeMakeNative at Base 2.3.3-4~dfsg
- PBSTreeMakeSwapped at Base 2.3.3-4~dfsg
- PBSTreeSize at Base 2.3.3-4~dfsg
- PBSTreeWhack at Base 2.3.3-4~dfsg
- PTNodeMakeKey at Base 2.3.3-4~dfsg
- PTTransDoUntil at Base 2.3.3-4~dfsg
- PTTransForEach at Base 2.3.3-4~dfsg
- PTTransWhack at Base 2.3.3-4~dfsg
- PTrieCount at Base 2.3.3-4~dfsg
- PTrieDoUntil at Base 2.3.3-4~dfsg
- PTrieFind at Base 2.3.3-4~dfsg
- PTrieForEach at Base 2.3.3-4~dfsg
- PTrieGetNode at Base 2.3.3-4~dfsg
- PTrieInitNode at Base 2.3.3-4~dfsg
- PTrieMake at Base 2.3.3-4~dfsg
- PTrieMakeNode at Base 2.3.3-4~dfsg
- PTrieMakeOrig at Base 2.3.3-4~dfsg
- PTrieSize at Base 2.3.3-4~dfsg
- PTrieWhack at Base 2.3.3-4~dfsg
- Pack at Base 2.3.3-4~dfsg
- PageMapAddRef at Base 2.3.3-4~dfsg
- PageMapAppend at Base 2.3.3-4~dfsg
- PageMapAppendRows at Base 2.3.3-4~dfsg
- PageMapCompare at Base 2.3.3-4~dfsg
- PageMapCompareStatic at Base 2.3.3-4~dfsg
- PageMapDeserialize at Base 2.3.3-4~dfsg
- PageMapExpand at Base 2.3.3-4~dfsg
- PageMapExpandFull at Base 2.3.3-4~dfsg
- PageMapFindRow at Base 2.3.3-4~dfsg
- PageMapFixedRowLength at Base 2.3.3-4~dfsg
- PageMapGetIdxRowInfo at Base 2.3.3-4~dfsg
- PageMapHasRows at Base 2.3.3-4~dfsg
- PageMapHasSimpleStructure at Base 2.3.3-4~dfsg
- PageMapLastLength at Base 2.3.3-4~dfsg
- PageMapNew at Base 2.3.3-4~dfsg
- PageMapNewFixedRowLength at Base 2.3.3-4~dfsg
- PageMapNewIterator at Base 2.3.3-4~dfsg
- PageMapNewSingle at Base 2.3.3-4~dfsg
- PageMapPreExpandFull at Base 2.3.3-4~dfsg
- PageMapProcessGetPagemap at Base 2.3.3-4~dfsg
- PageMapRelease at Base 2.3.3-4~dfsg
- PageMapRowLengthRange at Base 2.3.3-4~dfsg
- PageMapSerialize at Base 2.3.3-4~dfsg
- PageMapToRandomAccess at Base 2.3.3-4~dfsg
- ParseUrl at Base 2.3.3-4~dfsg
- PersistFilesIndex at Base 2.3.3-4~dfsg
- RCContextStrings at Base 2.3.3-4~dfsg
- RCExplain2 at Base 2.3.3-4~dfsg
- RCExplain at Base 2.3.3-4~dfsg
- RCModuleStrings at Base 2.3.3-4~dfsg
- RCObjectStrings at Base 2.3.3-4~dfsg
- RCStateStrings at Base 2.3.3-4~dfsg
- RCTargetStrings at Base 2.3.3-4~dfsg
- RefSeqMgr_Exists at Base 2.3.3-4~dfsg
- RefSeqMgr_ForEachVolume at Base 2.3.3-4~dfsg
- RefSeqMgr_GetSeq at Base 2.3.3-4~dfsg
- RefSeqMgr_Make at Base 2.3.3-4~dfsg
- RefSeqMgr_Read at Base 2.3.3-4~dfsg
- RefSeqMgr_Release at Base 2.3.3-4~dfsg
- RefSeqMgr_SetCache at Base 2.3.3-4~dfsg
- RefSeq_Circular at Base 2.3.3-4~dfsg
- RefSeq_MD5 at Base 2.3.3-4~dfsg
- RefSeq_Read at Base 2.3.3-4~dfsg
- RefSeq_Release at Base 2.3.3-4~dfsg
- RefSeq_SeqLength at Base 2.3.3-4~dfsg
- ReferenceMgr_Compress at Base 2.3.3-4~dfsg
- ReferenceMgr_CompressHelper at Base 2.3.3-4~dfsg
- ReferenceMgr_DumpConfig at Base 2.3.3-4~dfsg
- ReferenceMgr_FastaFile at Base 2.3.3-4~dfsg
- ReferenceMgr_FastaPath at Base 2.3.3-4~dfsg
- ReferenceMgr_GetSeq at Base 2.3.3-4~dfsg
- ReferenceMgr_Make at Base 2.3.3-4~dfsg
- ReferenceMgr_Release at Base 2.3.3-4~dfsg
- ReferenceMgr_SetCache at Base 2.3.3-4~dfsg
- ReferenceMgr_Verify at Base 2.3.3-4~dfsg
- ReferenceSeq_AddCoverage at Base 2.3.3-4~dfsg
- ReferenceSeq_Compress at Base 2.3.3-4~dfsg
- ReferenceSeq_Dump at Base 2.3.3-4~dfsg
- ReferenceSeq_Get1stRow at Base 2.3.3-4~dfsg
- ReferenceSeq_ReOffset at Base 2.3.3-4~dfsg
- ReferenceSeq_Read at Base 2.3.3-4~dfsg
- ReferenceSeq_Release at Base 2.3.3-4~dfsg
- ReportBuildDate at Base 2.3.3-4~dfsg
- ReportCWD at Base 2.3.3-4~dfsg
- ReportFinalize at Base 2.3.3-4~dfsg
- ReportInit at Base 2.3.3-4~dfsg
- ReportInitConfig at Base 2.3.3-4~dfsg
- ReportInitKFS at Base 2.3.3-4~dfsg
- ReportInitVDB at Base 2.3.3-4~dfsg
- ReportKfg at Base 2.3.3-4~dfsg
- ReportRecordZombieFile at Base 2.3.3-4~dfsg
- ReportRedirect at Base 2.3.3-4~dfsg
- ReportResetDatabase at Base 2.3.3-4~dfsg
- ReportResetObject at Base 2.3.3-4~dfsg
- ReportResetTable at Base 2.3.3-4~dfsg
- ReportSetVDBManager at Base 2.3.3-4~dfsg
- ReportSilence at Base 2.3.3-4~dfsg
- ResolveTablePath at Base 2.3.3-4~dfsg
- SColumnCmp at Base 2.3.3-4~dfsg
- SColumnDefDump at Base 2.3.3-4~dfsg
- SColumnDump at Base 2.3.3-4~dfsg
- SColumnSort at Base 2.3.3-4~dfsg
- SColumnWhack at Base 2.3.3-4~dfsg
- SConstExprResolveAsU32 at Base 2.3.3-4~dfsg
- SConstantClearMark at Base 2.3.3-4~dfsg
- SConstantDefDump at Base 2.3.3-4~dfsg
- SConstantDump at Base 2.3.3-4~dfsg
- SConstantMark at Base 2.3.3-4~dfsg
- SConstantWhack at Base 2.3.3-4~dfsg
- SDBMemberDefDump at Base 2.3.3-4~dfsg
- SDBMemberDump at Base 2.3.3-4~dfsg
- SDatabaseClearMark at Base 2.3.3-4~dfsg
- SDatabaseCmp at Base 2.3.3-4~dfsg
- SDatabaseDefDump at Base 2.3.3-4~dfsg
- SDatabaseDump at Base 2.3.3-4~dfsg
- SDatabaseFind at Base 2.3.3-4~dfsg
- SDatabaseMark at Base 2.3.3-4~dfsg
- SDatabaseNameMark at Base 2.3.3-4~dfsg
- SDatabaseSort at Base 2.3.3-4~dfsg
- SDatabaseWhack at Base 2.3.3-4~dfsg
- SDatatypeClearMark at Base 2.3.3-4~dfsg
- SDatatypeDefDump at Base 2.3.3-4~dfsg
- SDatatypeDump at Base 2.3.3-4~dfsg
- SDatatypeIntrinsicDim at Base 2.3.3-4~dfsg
- SDatatypeMark at Base 2.3.3-4~dfsg
- SDumperDecIndentLevel at Base 2.3.3-4~dfsg
- SDumperIncIndentLevel at Base 2.3.3-4~dfsg
- SDumperIndent at Base 2.3.3-4~dfsg
- SDumperInit at Base 2.3.3-4~dfsg
- SDumperPrint at Base 2.3.3-4~dfsg
- SDumperSep at Base 2.3.3-4~dfsg
- SDumperSepString at Base 2.3.3-4~dfsg
- SDumperVPrint at Base 2.3.3-4~dfsg
- SDumperVersion at Base 2.3.3-4~dfsg
- SDumperWhack at Base 2.3.3-4~dfsg
- SDumperWrite at Base 2.3.3-4~dfsg
- SExpressionBracketListDump at Base 2.3.3-4~dfsg
- SExpressionDump at Base 2.3.3-4~dfsg
- SExpressionListDump at Base 2.3.3-4~dfsg
- SExpressionMark at Base 2.3.3-4~dfsg
- SExpressionVDump at Base 2.3.3-4~dfsg
- SExpressionVWhack at Base 2.3.3-4~dfsg
- SExpressionWhack at Base 2.3.3-4~dfsg
- SFormParamlistDump at Base 2.3.3-4~dfsg
- SFormParmlistMark at Base 2.3.3-4~dfsg
- SFormParmlistWhack at Base 2.3.3-4~dfsg
- SFormatClearMark at Base 2.3.3-4~dfsg
- SFormatDefDump at Base 2.3.3-4~dfsg
- SFormatDump at Base 2.3.3-4~dfsg
- SFormatMark at Base 2.3.3-4~dfsg
- SFuncExprMark at Base 2.3.3-4~dfsg
- SFuncNameMark at Base 2.3.3-4~dfsg
- SFunctionBindFactParms at Base 2.3.3-4~dfsg
- SFunctionBindSchemaParms at Base 2.3.3-4~dfsg
- SFunctionBodyDump at Base 2.3.3-4~dfsg
- SFunctionClearMark at Base 2.3.3-4~dfsg
- SFunctionCmp at Base 2.3.3-4~dfsg
- SFunctionDeclDump at Base 2.3.3-4~dfsg
- SFunctionDeclDumpFactParms at Base 2.3.3-4~dfsg
- SFunctionDeclDumpSchemaParms at Base 2.3.3-4~dfsg
- SFunctionDestroy at Base 2.3.3-4~dfsg
- SFunctionDump at Base 2.3.3-4~dfsg
- SFunctionMark at Base 2.3.3-4~dfsg
- SFunctionRestFactParms at Base 2.3.3-4~dfsg
- SFunctionRestSchemaParms at Base 2.3.3-4~dfsg
- SFunctionSort at Base 2.3.3-4~dfsg
- SFunctionWhack at Base 2.3.3-4~dfsg
- SHA1StateAppend at Base 2.3.3-4~dfsg
- SHA1StateFinish at Base 2.3.3-4~dfsg
- SHA1StateInit at Base 2.3.3-4~dfsg
- SHA256StateAppend at Base 2.3.3-4~dfsg
- SHA256StateFinish at Base 2.3.3-4~dfsg
- SHA256StateInit at Base 2.3.3-4~dfsg
- SHA384StateAppend at Base 2.3.3-4~dfsg
- SHA384StateFinish at Base 2.3.3-4~dfsg
- SHA384StateInit at Base 2.3.3-4~dfsg
- SHA512StateAppend at Base 2.3.3-4~dfsg
- SHA512StateFinish at Base 2.3.3-4~dfsg
- SHA512StateInit at Base 2.3.3-4~dfsg
- SIndirectConstDefDump at Base 2.3.3-4~dfsg
- SIndirectConstDump at Base 2.3.3-4~dfsg
- SIndirectConstMark at Base 2.3.3-4~dfsg
- SIndirectConstWhack at Base 2.3.3-4~dfsg
- SIndirectTypeDump at Base 2.3.3-4~dfsg
- SIndirectTypeMark at Base 2.3.3-4~dfsg
- SIndirectTypeWhack at Base 2.3.3-4~dfsg
- SLListDoUntil at Base 2.3.3-4~dfsg
- SLListFindFirst at Base 2.3.3-4~dfsg
- SLListForEach at Base 2.3.3-4~dfsg
- SLListPopHead at Base 2.3.3-4~dfsg
- SLListPopTail at Base 2.3.3-4~dfsg
- SLListPushTail at Base 2.3.3-4~dfsg
- SLListUnlink at Base 2.3.3-4~dfsg
- SLListWhack at Base 2.3.3-4~dfsg
- SNameOverloadCopy at Base 2.3.3-4~dfsg
- SNameOverloadMake at Base 2.3.3-4~dfsg
- SNameOverloadVectorCopy at Base 2.3.3-4~dfsg
- SNameOverloadWhack at Base 2.3.3-4~dfsg
- SPhysEncExprMark at Base 2.3.3-4~dfsg
- SPhysMemberDefDump at Base 2.3.3-4~dfsg
- SPhysMemberDump at Base 2.3.3-4~dfsg
- SPhysMemberMark at Base 2.3.3-4~dfsg
- SPhysMemberWhack at Base 2.3.3-4~dfsg
- SPhysNameMark at Base 2.3.3-4~dfsg
- SPhysicalBindFactParms at Base 2.3.3-4~dfsg
- SPhysicalBindSchemaParms at Base 2.3.3-4~dfsg
- SPhysicalClearMark at Base 2.3.3-4~dfsg
- SPhysicalCmp at Base 2.3.3-4~dfsg
- SPhysicalDefDump at Base 2.3.3-4~dfsg
- SPhysicalDump at Base 2.3.3-4~dfsg
- SPhysicalMark at Base 2.3.3-4~dfsg
- SPhysicalRestFactParms at Base 2.3.3-4~dfsg
- SPhysicalRestSchemaParms at Base 2.3.3-4~dfsg
- SPhysicalSort at Base 2.3.3-4~dfsg
- SPhysicalWhack at Base 2.3.3-4~dfsg
- SProductionDefDump at Base 2.3.3-4~dfsg
- SProductionDump at Base 2.3.3-4~dfsg
- SProductionMark at Base 2.3.3-4~dfsg
- SProductionWhack at Base 2.3.3-4~dfsg
- SRACacheAddTable at Base 2.3.3-4~dfsg
- SRACacheElementDestroy at Base 2.3.3-4~dfsg
- SRACacheElementMake at Base 2.3.3-4~dfsg
- SRACacheFlush at Base 2.3.3-4~dfsg
- SRACacheGetHardThreshold at Base 2.3.3-4~dfsg
- SRACacheGetSoftThreshold at Base 2.3.3-4~dfsg
- SRACacheGetTable at Base 2.3.3-4~dfsg
- SRACacheGetUsage at Base 2.3.3-4~dfsg
- SRACacheIndexDestroy at Base 2.3.3-4~dfsg
- SRACacheIndexMake at Base 2.3.3-4~dfsg
- SRACacheInit at Base 2.3.3-4~dfsg
- SRACacheMetricsLessThan at Base 2.3.3-4~dfsg
- SRACacheSetHardThreshold at Base 2.3.3-4~dfsg
- SRACacheSetSoftThreshold at Base 2.3.3-4~dfsg
- SRACacheWhack at Base 2.3.3-4~dfsg
- SRAColumnAddRef at Base 2.3.3-4~dfsg
- SRAColumnDatatype at Base 2.3.3-4~dfsg
- SRAColumnGetRange at Base 2.3.3-4~dfsg
- SRAColumnRead at Base 2.3.3-4~dfsg
- SRAColumnRelease at Base 2.3.3-4~dfsg
- SRAColumnWhack at Base 2.3.3-4~dfsg
- SRAMgrAddRef at Base 2.3.3-4~dfsg
- SRAMgrAttach at Base 2.3.3-4~dfsg
- SRAMgrConfigReload at Base 2.3.3-4~dfsg
- SRAMgrConfigureCache at Base 2.3.3-4~dfsg
- SRAMgrCreateTable at Base 2.3.3-4~dfsg
- SRAMgrDropTable at Base 2.3.3-4~dfsg
- SRAMgrFlush at Base 2.3.3-4~dfsg
- SRAMgrGetCacheUsage at Base 2.3.3-4~dfsg
- SRAMgrGetKDBManagerRead at Base 2.3.3-4~dfsg
- SRAMgrGetTableModDate at Base 2.3.3-4~dfsg
- SRAMgrGetVDBManagerRead at Base 2.3.3-4~dfsg
- SRAMgrLock at Base 2.3.3-4~dfsg
- SRAMgrMake at Base 2.3.3-4~dfsg
- SRAMgrMakeSRASchema at Base 2.3.3-4~dfsg
- SRAMgrMakeUpdate at Base 2.3.3-4~dfsg
- SRAMgrOpenAltTableRead at Base 2.3.3-4~dfsg
- SRAMgrOpenTableRead at Base 2.3.3-4~dfsg
- SRAMgrOpenTableUpdate at Base 2.3.3-4~dfsg
- SRAMgrRelease at Base 2.3.3-4~dfsg
- SRAMgrResolve at Base 2.3.3-4~dfsg
- SRAMgrRunBGTasks at Base 2.3.3-4~dfsg
- SRAMgrSetMD5Mode at Base 2.3.3-4~dfsg
- SRAMgrSever at Base 2.3.3-4~dfsg
- SRAMgrSingleFileArchiveExt at Base 2.3.3-4~dfsg
- SRAMgrUnlock at Base 2.3.3-4~dfsg
- SRAMgrVCreateTable at Base 2.3.3-4~dfsg
- SRAMgrVDropTable at Base 2.3.3-4~dfsg
- SRAMgrVGetTableModDate at Base 2.3.3-4~dfsg
- SRAMgrVLock at Base 2.3.3-4~dfsg
- SRAMgrVOpenTableRead at Base 2.3.3-4~dfsg
- SRAMgrVOpenTableUpdate at Base 2.3.3-4~dfsg
- SRAMgrVUnlock at Base 2.3.3-4~dfsg
- SRAMgrVWritable at Base 2.3.3-4~dfsg
- SRAMgrWritable at Base 2.3.3-4~dfsg
- SRANamelistAddRef at Base 2.3.3-4~dfsg
- SRANamelistCount at Base 2.3.3-4~dfsg
- SRANamelistGet at Base 2.3.3-4~dfsg
- SRANamelistRelease at Base 2.3.3-4~dfsg
- SRASchemaMake at Base 2.3.3-4~dfsg
- SRATableAddRef at Base 2.3.3-4~dfsg
- SRATableAttach at Base 2.3.3-4~dfsg
- SRATableBaseCount at Base 2.3.3-4~dfsg
- SRATableCloseSpot at Base 2.3.3-4~dfsg
- SRATableColDatatype at Base 2.3.3-4~dfsg
- SRATableColDatatypes at Base 2.3.3-4~dfsg
- SRATableCommit at Base 2.3.3-4~dfsg
- SRATableDestroy at Base 2.3.3-4~dfsg
- SRATableFillOut at Base 2.3.3-4~dfsg
- SRATableGetIdRange at Base 2.3.3-4~dfsg
- SRATableGetKTableRead at Base 2.3.3-4~dfsg
- SRATableGetSchema at Base 2.3.3-4~dfsg
- SRATableGetSpotId at Base 2.3.3-4~dfsg
- SRATableGetVTableRead at Base 2.3.3-4~dfsg
- SRATableListCol at Base 2.3.3-4~dfsg
- SRATableLocked at Base 2.3.3-4~dfsg
- SRATableMakeSingleFileArchive at Base 2.3.3-4~dfsg
- SRATableMaxMetaRevision at Base 2.3.3-4~dfsg
- SRATableMaxSpotId at Base 2.3.3-4~dfsg
- SRATableMetaFreeze at Base 2.3.3-4~dfsg
- SRATableMetaRevision at Base 2.3.3-4~dfsg
- SRATableMinSpotId at Base 2.3.3-4~dfsg
- SRATableNewSpot at Base 2.3.3-4~dfsg
- SRATableOpenColumnRead at Base 2.3.3-4~dfsg
- SRATableOpenColumnWrite at Base 2.3.3-4~dfsg
- SRATableOpenMDataNodeRead at Base 2.3.3-4~dfsg
- SRATableOpenMDataNodeUpdate at Base 2.3.3-4~dfsg
- SRATableOpenSpot at Base 2.3.3-4~dfsg
- SRATableRead at Base 2.3.3-4~dfsg
- SRATableRelease at Base 2.3.3-4~dfsg
- SRATableSetIdxColumnDefault at Base 2.3.3-4~dfsg
- SRATableSever at Base 2.3.3-4~dfsg
- SRATableSpotCount at Base 2.3.3-4~dfsg
- SRATableUseMetaRevision at Base 2.3.3-4~dfsg
- SRATableVOpenMDataNodeRead at Base 2.3.3-4~dfsg
- SRATableVOpenMDataNodeUpdate at Base 2.3.3-4~dfsg
- SRATableWhack at Base 2.3.3-4~dfsg
- SRATableWriteIdxColumn at Base 2.3.3-4~dfsg
- SSymExprMake at Base 2.3.3-4~dfsg
- SSymExprMark at Base 2.3.3-4~dfsg
- STableClearMark at Base 2.3.3-4~dfsg
- STableCloneExtend at Base 2.3.3-4~dfsg
- STableCmp at Base 2.3.3-4~dfsg
- STableDefDump at Base 2.3.3-4~dfsg
- STableDump at Base 2.3.3-4~dfsg
- STableFind at Base 2.3.3-4~dfsg
- STableFindOrdAncestor at Base 2.3.3-4~dfsg
- STableFindOverride at Base 2.3.3-4~dfsg
- STableImplicitColMember at Base 2.3.3-4~dfsg
- STableImplicitPhysMember at Base 2.3.3-4~dfsg
- STableMark at Base 2.3.3-4~dfsg
- STableNameMark at Base 2.3.3-4~dfsg
- STableSort at Base 2.3.3-4~dfsg
- STableWhack at Base 2.3.3-4~dfsg
- STblMemberDefDump at Base 2.3.3-4~dfsg
- STblMemberDump at Base 2.3.3-4~dfsg
- STypeExprMark at Base 2.3.3-4~dfsg
- STypeExprResolveAsFormatdecl at Base 2.3.3-4~dfsg
- STypeExprResolveAsTypedecl at Base 2.3.3-4~dfsg
- STypesetClearMark at Base 2.3.3-4~dfsg
- STypesetDefDump at Base 2.3.3-4~dfsg
- STypesetDump at Base 2.3.3-4~dfsg
- STypesetMark at Base 2.3.3-4~dfsg
- SchemaEnvInit at Base 2.3.3-4~dfsg
- SetRCFileFuncLine at Base 2.3.3-4~dfsg
- SraHeaderGetFileOffset at Base 2.3.3-4~dfsg
- SraHeaderMake at Base 2.3.3-4~dfsg
- SraHeaderSize at Base 2.3.3-4~dfsg
- StartKeyRing at Base 2.3.3-4~dfsg
- StringCaseCompare at Base 2.3.3-4~dfsg
- StringCaseEqual at Base 2.3.3-4~dfsg
- StringCompare at Base 2.3.3-4~dfsg
- StringConcat at Base 2.3.3-4~dfsg
- StringCopy at Base 2.3.3-4~dfsg
- StringCopyUTF16 at Base 2.3.3-4~dfsg
- StringCopyUTF32 at Base 2.3.3-4~dfsg
- StringDump at Base 2.3.3-4~dfsg
- StringHead at Base 2.3.3-4~dfsg
- StringMatch at Base 2.3.3-4~dfsg
- StringMatchExtend at Base 2.3.3-4~dfsg
- StringOrder at Base 2.3.3-4~dfsg
- StringOrderNoNullCheck at Base 2.3.3-4~dfsg
- StringPopHead at Base 2.3.3-4~dfsg
- StringSubstr at Base 2.3.3-4~dfsg
- StringWhack at Base 2.3.3-4~dfsg
- TNodeMake at Base 2.3.3-4~dfsg
- TNodeWhack at Base 2.3.3-4~dfsg
- TTransDoUntil at Base 2.3.3-4~dfsg
- TTransDoUntilBT at Base 2.3.3-4~dfsg
- TTransForEach at Base 2.3.3-4~dfsg
- TTransForEachBT at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Circular at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MD5 at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MakePath at Base 2.3.3-4~dfsg
- TableReaderRefSeq_MakeTable at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Read at Base 2.3.3-4~dfsg
- TableReaderRefSeq_SeqId at Base 2.3.3-4~dfsg
- TableReaderRefSeq_SeqLength at Base 2.3.3-4~dfsg
- TableReaderRefSeq_Whack at Base 2.3.3-4~dfsg
- TableReader_IdRange at Base 2.3.3-4~dfsg
- TableReader_Make at Base 2.3.3-4~dfsg
- TableReader_MakeCursor at Base 2.3.3-4~dfsg
- TableReader_OpenIndex at Base 2.3.3-4~dfsg
- TableReader_PageIdRange at Base 2.3.3-4~dfsg
- TableReader_ReadRow at Base 2.3.3-4~dfsg
- TableReader_Whack at Base 2.3.3-4~dfsg
- TableWriteSeq_WriteDefault at Base 2.3.3-4~dfsg
- TableWriterAlgn_GetNextRowId at Base 2.3.3-4~dfsg
- TableWriterAlgn_Make at Base 2.3.3-4~dfsg
- TableWriterAlgn_RefStart at Base 2.3.3-4~dfsg
- TableWriterAlgn_TmpKey at Base 2.3.3-4~dfsg
- TableWriterAlgn_TmpKeyStart at Base 2.3.3-4~dfsg
- TableWriterAlgn_Whack at Base 2.3.3-4~dfsg
- TableWriterAlgn_Write at Base 2.3.3-4~dfsg
- TableWriterAlgn_WriteDefault at Base 2.3.3-4~dfsg
- TableWriterAlgn_Write_SpotId at Base 2.3.3-4~dfsg
- TableWriterAlgn_Write_SpotInfo at Base 2.3.3-4~dfsg
- TableWriterRefCoverage_MakeCoverage at Base 2.3.3-4~dfsg
- TableWriterRefCoverage_MakeIds at Base 2.3.3-4~dfsg
- TableWriterRefCoverage_Whack at Base 2.3.3-4~dfsg
- TableWriterRefCoverage_WriteCoverage at Base 2.3.3-4~dfsg
- TableWriterRefCoverage_WriteIds at Base 2.3.3-4~dfsg
- TableWriterRefSeq_Make at Base 2.3.3-4~dfsg
- TableWriterRefSeq_Whack at Base 2.3.3-4~dfsg
- TableWriterRefSeq_Write at Base 2.3.3-4~dfsg
- TableWriterRefSeq_WriteDefault at Base 2.3.3-4~dfsg
- TableWriterRef_Make at Base 2.3.3-4~dfsg
- TableWriterRef_Whack at Base 2.3.3-4~dfsg
- TableWriterRef_Write at Base 2.3.3-4~dfsg
- TableWriterRef_WriteCoverage at Base 2.3.3-4~dfsg
- TableWriterRef_WriteDefaultCovarage at Base 2.3.3-4~dfsg
- TableWriterRef_WriteDefaultData at Base 2.3.3-4~dfsg
- TableWriterSeq_GetNextRowId at Base 2.3.3-4~dfsg
- TableWriterSeq_Make at Base 2.3.3-4~dfsg
- TableWriterSeq_TmpKey at Base 2.3.3-4~dfsg
- TableWriterSeq_TmpKeyStart at Base 2.3.3-4~dfsg
- TableWriterSeq_Whack at Base 2.3.3-4~dfsg
- TableWriterSeq_Write at Base 2.3.3-4~dfsg
- TableWriterSeq_WriteAlignmentData at Base 2.3.3-4~dfsg
- TableWriter_AddCursor at Base 2.3.3-4~dfsg
- TableWriter_CloseCursor at Base 2.3.3-4~dfsg
- TableWriter_CloseRow at Base 2.3.3-4~dfsg
- TableWriter_ColumnDefault at Base 2.3.3-4~dfsg
- TableWriter_ColumnWrite at Base 2.3.3-4~dfsg
- TableWriter_Flush at Base 2.3.3-4~dfsg
- TableWriter_GetNextRowId at Base 2.3.3-4~dfsg
- TableWriter_GetVTable at Base 2.3.3-4~dfsg
- TableWriter_Make at Base 2.3.3-4~dfsg
- TableWriter_MakeMgr at Base 2.3.3-4~dfsg
- TableWriter_MakeUpdate at Base 2.3.3-4~dfsg
- TableWriter_OpenRow at Base 2.3.3-4~dfsg
- TableWriter_OpenRowId at Base 2.3.3-4~dfsg
- TableWriter_Sign at Base 2.3.3-4~dfsg
- TableWriter_Whack at Base 2.3.3-4~dfsg
- TimeoutInit at Base 2.3.3-4~dfsg
- TimeoutPrepare at Base 2.3.3-4~dfsg
- ToHex at Base 2.3.3-4~dfsg
- TrieDoUntil at Base 2.3.3-4~dfsg
- TrieExplore at Base 2.3.3-4~dfsg
- TrieFind at Base 2.3.3-4~dfsg
- TrieFindAll at Base 2.3.3-4~dfsg
- TrieForEach at Base 2.3.3-4~dfsg
- TrieInit at Base 2.3.3-4~dfsg
- TrieInsert at Base 2.3.3-4~dfsg
- TrieInsertUnique at Base 2.3.3-4~dfsg
- TrieMapChar at Base 2.3.3-4~dfsg
- TrieNextIdx at Base 2.3.3-4~dfsg
- TriePersist at Base 2.3.3-4~dfsg
- TrieUnlink at Base 2.3.3-4~dfsg
- TrieWhack at Base 2.3.3-4~dfsg
- TruncateCacheFile at Base 2.3.3-4~dfsg
- UIDatabaseGetErrorString at Base 2.3.3-4~dfsg
- UIDatabaseLOGError at Base 2.3.3-4~dfsg
- UIError at Base 2.3.3-4~dfsg
- UITableLOGError at Base 2.3.3-4~dfsg
- URLBlockInit at Base 2.3.3-4~dfsg
- Unpack at Base 2.3.3-4~dfsg
- VBlobAddRef at Base 2.3.3-4~dfsg
- VBlobAppend at Base 2.3.3-4~dfsg
- VBlobAppendRow at Base 2.3.3-4~dfsg
- VBlobBufferSplit at Base 2.3.3-4~dfsg
- VBlobCellData at Base 2.3.3-4~dfsg
- VBlobCreateFromData at Base 2.3.3-4~dfsg
- VBlobCreateFromSingleRow at Base 2.3.3-4~dfsg
- VBlobFixedRowLength at Base 2.3.3-4~dfsg
- VBlobHeaderAddRef at Base 2.3.3-4~dfsg
- VBlobHeaderArgPopHead at Base 2.3.3-4~dfsg
- VBlobHeaderArgPopTail at Base 2.3.3-4~dfsg
- VBlobHeaderArgPushHead at Base 2.3.3-4~dfsg
- VBlobHeaderArgPushTail at Base 2.3.3-4~dfsg
- VBlobHeaderCreateFork at Base 2.3.3-4~dfsg
- VBlobHeaderFlags at Base 2.3.3-4~dfsg
- VBlobHeaderFormat at Base 2.3.3-4~dfsg
- VBlobHeaderOpPopHead at Base 2.3.3-4~dfsg
- VBlobHeaderOpPopTail at Base 2.3.3-4~dfsg
- VBlobHeaderOpPushHead at Base 2.3.3-4~dfsg
- VBlobHeaderOpPushTail at Base 2.3.3-4~dfsg
- VBlobHeaderRelease at Base 2.3.3-4~dfsg
- VBlobHeaderReplace at Base 2.3.3-4~dfsg
- VBlobHeaderSetFlags at Base 2.3.3-4~dfsg
- VBlobHeaderSetFormat at Base 2.3.3-4~dfsg
- VBlobHeaderSetSourceSize at Base 2.3.3-4~dfsg
- VBlobHeaderSetVersion at Base 2.3.3-4~dfsg
- VBlobHeaderSourceSize at Base 2.3.3-4~dfsg
- VBlobHeaderVersion at Base 2.3.3-4~dfsg
- VBlobIdRange at Base 2.3.3-4~dfsg
- VBlobIsSingleRow at Base 2.3.3-4~dfsg
- VBlobMRUCacheDestroy at Base 2.3.3-4~dfsg
- VBlobMRUCacheFind at Base 2.3.3-4~dfsg
- VBlobMRUCacheMake at Base 2.3.3-4~dfsg
- VBlobMRUCacheSave at Base 2.3.3-4~dfsg
- VBlobNew at Base 2.3.3-4~dfsg
- VBlobNewAsArray at Base 2.3.3-4~dfsg
- VBlobPageMapOptimize at Base 2.3.3-4~dfsg
- VBlobRead at Base 2.3.3-4~dfsg
- VBlobReadBits at Base 2.3.3-4~dfsg
- VBlobRelease at Base 2.3.3-4~dfsg
- VBlobSerialize at Base 2.3.3-4~dfsg
- VBlobSubblob at Base 2.3.3-4~dfsg
- VColumnCmp at Base 2.3.3-4~dfsg
- VColumnDatatype at Base 2.3.3-4~dfsg
- VColumnDestroy at Base 2.3.3-4~dfsg
- VColumnIdRange at Base 2.3.3-4~dfsg
- VColumnIdRangeRead at Base 2.3.3-4~dfsg
- VColumnInit at Base 2.3.3-4~dfsg
- VColumnIsStatic at Base 2.3.3-4~dfsg
- VColumnMake at Base 2.3.3-4~dfsg
- VColumnPageIdRange at Base 2.3.3-4~dfsg
- VColumnProdDestroy at Base 2.3.3-4~dfsg
- VColumnProdMake at Base 2.3.3-4~dfsg
- VColumnProdRead at Base 2.3.3-4~dfsg
- VColumnRead at Base 2.3.3-4~dfsg
- VColumnReadBlob at Base 2.3.3-4~dfsg
- VColumnReadCachedBlob at Base 2.3.3-4~dfsg
- VColumnRefCmpString at Base 2.3.3-4~dfsg
- VColumnRefMake at Base 2.3.3-4~dfsg
- VColumnRefSort at Base 2.3.3-4~dfsg
- VColumnRefWhack at Base 2.3.3-4~dfsg
- VColumnSort at Base 2.3.3-4~dfsg
- VColumnWhack at Base 2.3.3-4~dfsg
- VCursorAddColumn at Base 2.3.3-4~dfsg
- VCursorAddRef at Base 2.3.3-4~dfsg
- VCursorCacheGet at Base 2.3.3-4~dfsg
- VCursorCacheSet at Base 2.3.3-4~dfsg
- VCursorCacheSwap at Base 2.3.3-4~dfsg
- VCursorCacheWhack at Base 2.3.3-4~dfsg
- VCursorCellData at Base 2.3.3-4~dfsg
- VCursorCellDataDirect at Base 2.3.3-4~dfsg
- VCursorCloseRow at Base 2.3.3-4~dfsg
- VCursorCloseRowRead at Base 2.3.3-4~dfsg
- VCursorCommit at Base 2.3.3-4~dfsg
- VCursorCommitRow at Base 2.3.3-4~dfsg
- VCursorDatatype at Base 2.3.3-4~dfsg
- VCursorDefault at Base 2.3.3-4~dfsg
- VCursorDestroy at Base 2.3.3-4~dfsg
- VCursorFlushPage at Base 2.3.3-4~dfsg
- VCursorGetBlob at Base 2.3.3-4~dfsg
- VCursorGetBlobDirect at Base 2.3.3-4~dfsg
- VCursorGetColumnIdx at Base 2.3.3-4~dfsg
- VCursorGetSchema at Base 2.3.3-4~dfsg
- VCursorGetUserData at Base 2.3.3-4~dfsg
- VCursorIdRange at Base 2.3.3-4~dfsg
- VCursorIsStaticColumn at Base 2.3.3-4~dfsg
- VCursorLaunchPagemapThread at Base 2.3.3-4~dfsg
- VCursorLinkedCursorGet at Base 2.3.3-4~dfsg
- VCursorLinkedCursorSet at Base 2.3.3-4~dfsg
- VCursorListReadableColumns at Base 2.3.3-4~dfsg
- VCursorListSeededWritableColumns at Base 2.3.3-4~dfsg
- VCursorListWritableColumns at Base 2.3.3-4~dfsg
- VCursorMake at Base 2.3.3-4~dfsg
- VCursorMakeColumn at Base 2.3.3-4~dfsg
- VCursorOpen at Base 2.3.3-4~dfsg
- VCursorOpenParentRead at Base 2.3.3-4~dfsg
- VCursorOpenParentUpdate at Base 2.3.3-4~dfsg
- VCursorOpenRead at Base 2.3.3-4~dfsg
- VCursorOpenRow at Base 2.3.3-4~dfsg
- VCursorOpenRowRead at Base 2.3.3-4~dfsg
- VCursorPageIdRange at Base 2.3.3-4~dfsg
- VCursorParamsGet at Base 2.3.3-4~dfsg
- VCursorParamsSet at Base 2.3.3-4~dfsg
- VCursorParamsUnset at Base 2.3.3-4~dfsg
- VCursorParamsVSet at Base 2.3.3-4~dfsg
- VCursorPermitPostOpenAdd at Base 2.3.3-4~dfsg
- VCursorPostOpenAdd at Base 2.3.3-4~dfsg
- VCursorPostOpenAddRead at Base 2.3.3-4~dfsg
- VCursorRead at Base 2.3.3-4~dfsg
- VCursorReadBits at Base 2.3.3-4~dfsg
- VCursorReadBitsDirect at Base 2.3.3-4~dfsg
- VCursorReadDirect at Base 2.3.3-4~dfsg
- VCursorRelease at Base 2.3.3-4~dfsg
- VCursorRepeatRow at Base 2.3.3-4~dfsg
- VCursorRowId at Base 2.3.3-4~dfsg
- VCursorSetRowId at Base 2.3.3-4~dfsg
- VCursorSetRowIdRead at Base 2.3.3-4~dfsg
- VCursorSetUserData at Base 2.3.3-4~dfsg
- VCursorSupplementSchema at Base 2.3.3-4~dfsg
- VCursorSuspendTriggers at Base 2.3.3-4~dfsg
- VCursorTerminatePagemapThread at Base 2.3.3-4~dfsg
- VCursorVAddColumn at Base 2.3.3-4~dfsg
- VCursorVGetColumnIdx at Base 2.3.3-4~dfsg
- VCursorWhack at Base 2.3.3-4~dfsg
- VCursorWrite at Base 2.3.3-4~dfsg
- VDBDependenciesAddRef at Base 2.3.3-4~dfsg
- VDBDependenciesCircular at Base 2.3.3-4~dfsg
- VDBDependenciesCount at Base 2.3.3-4~dfsg
- VDBDependenciesLocal at Base 2.3.3-4~dfsg
- VDBDependenciesName at Base 2.3.3-4~dfsg
- VDBDependenciesPath at Base 2.3.3-4~dfsg
- VDBDependenciesPathCache at Base 2.3.3-4~dfsg
- VDBDependenciesPathRemote at Base 2.3.3-4~dfsg
- VDBDependenciesRelease at Base 2.3.3-4~dfsg
- VDBDependenciesSeqId at Base 2.3.3-4~dfsg
- VDBDependenciesType at Base 2.3.3-4~dfsg
- VDBManagerAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VDBManagerAddRef at Base 2.3.3-4~dfsg
- VDBManagerAddSchemaIncludePath at Base 2.3.3-4~dfsg
- VDBManagerAttach at Base 2.3.3-4~dfsg
- VDBManagerConfigPaths at Base 2.3.3-4~dfsg
- VDBManagerCreateDB at Base 2.3.3-4~dfsg
- VDBManagerCreateTable at Base 2.3.3-4~dfsg
- VDBManagerDisablePagemapThread at Base 2.3.3-4~dfsg
- VDBManagerDrop at Base 2.3.3-4~dfsg
- VDBManagerGetObjVersion at Base 2.3.3-4~dfsg
- VDBManagerGetUserData at Base 2.3.3-4~dfsg
- VDBManagerListExternalSchemaModules at Base 2.3.3-4~dfsg
- VDBManagerLock at Base 2.3.3-4~dfsg
- VDBManagerMakeSRASchema at Base 2.3.3-4~dfsg
- VDBManagerMakeSchema at Base 2.3.3-4~dfsg
- VDBManagerMakeUpdate at Base 2.3.3-4~dfsg
- VDBManagerOpenDBRead at Base 2.3.3-4~dfsg
- VDBManagerOpenDBUpdate at Base 2.3.3-4~dfsg
- VDBManagerOpenKDBManagerRead at Base 2.3.3-4~dfsg
- VDBManagerOpenKDBManagerUpdate at Base 2.3.3-4~dfsg
- VDBManagerOpenTableRead at Base 2.3.3-4~dfsg
- VDBManagerOpenTableUpdate at Base 2.3.3-4~dfsg
- VDBManagerPathType at Base 2.3.3-4~dfsg
- VDBManagerRelease at Base 2.3.3-4~dfsg
- VDBManagerRunPeriodicTasks at Base 2.3.3-4~dfsg
- VDBManagerSetUserData at Base 2.3.3-4~dfsg
- VDBManagerSever at Base 2.3.3-4~dfsg
- VDBManagerUnlock at Base 2.3.3-4~dfsg
- VDBManagerVAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VDBManagerVAddSchemaIncludePath at Base 2.3.3-4~dfsg
- VDBManagerVCreateDB at Base 2.3.3-4~dfsg
- VDBManagerVCreateTable at Base 2.3.3-4~dfsg
- VDBManagerVDrop at Base 2.3.3-4~dfsg
- VDBManagerVLock at Base 2.3.3-4~dfsg
- VDBManagerVOpenDBRead at Base 2.3.3-4~dfsg
- VDBManagerVOpenDBUpdate at Base 2.3.3-4~dfsg
- VDBManagerVOpenTableRead at Base 2.3.3-4~dfsg
- VDBManagerVOpenTableUpdate at Base 2.3.3-4~dfsg
- VDBManagerVPathType at Base 2.3.3-4~dfsg
- VDBManagerVUnlock at Base 2.3.3-4~dfsg
- VDBManagerVWritable at Base 2.3.3-4~dfsg
- VDBManagerVersion at Base 2.3.3-4~dfsg
- VDBManagerWritable at Base 2.3.3-4~dfsg
- VDatabaseAddRef at Base 2.3.3-4~dfsg
- VDatabaseAttach at Base 2.3.3-4~dfsg
- VDatabaseColumnCreateParams at Base 2.3.3-4~dfsg
- VDatabaseCreateDB at Base 2.3.3-4~dfsg
- VDatabaseCreateTable at Base 2.3.3-4~dfsg
- VDatabaseDropDB at Base 2.3.3-4~dfsg
- VDatabaseDropTable at Base 2.3.3-4~dfsg
- VDatabaseGetUserData at Base 2.3.3-4~dfsg
- VDatabaseIsAlias at Base 2.3.3-4~dfsg
- VDatabaseListDB at Base 2.3.3-4~dfsg
- VDatabaseListDependencies at Base 2.3.3-4~dfsg
- VDatabaseListDependenciesWithCaching at Base 2.3.3-4~dfsg
- VDatabaseListTbl at Base 2.3.3-4~dfsg
- VDatabaseLoadSchema at Base 2.3.3-4~dfsg
- VDatabaseLock at Base 2.3.3-4~dfsg
- VDatabaseLocked at Base 2.3.3-4~dfsg
- VDatabaseMake at Base 2.3.3-4~dfsg
- VDatabaseOpenDBRead at Base 2.3.3-4~dfsg
- VDatabaseOpenDBUpdate at Base 2.3.3-4~dfsg
- VDatabaseOpenKDatabaseRead at Base 2.3.3-4~dfsg
- VDatabaseOpenKDatabaseUpdate at Base 2.3.3-4~dfsg
- VDatabaseOpenManagerRead at Base 2.3.3-4~dfsg
- VDatabaseOpenManagerUpdate at Base 2.3.3-4~dfsg
- VDatabaseOpenMetadataRead at Base 2.3.3-4~dfsg
- VDatabaseOpenMetadataUpdate at Base 2.3.3-4~dfsg
- VDatabaseOpenParentRead at Base 2.3.3-4~dfsg
- VDatabaseOpenParentUpdate at Base 2.3.3-4~dfsg
- VDatabaseOpenSchema at Base 2.3.3-4~dfsg
- VDatabaseOpenTableRead at Base 2.3.3-4~dfsg
- VDatabaseOpenTableUpdate at Base 2.3.3-4~dfsg
- VDatabaseRelease at Base 2.3.3-4~dfsg
- VDatabaseSetUserData at Base 2.3.3-4~dfsg
- VDatabaseSever at Base 2.3.3-4~dfsg
- VDatabaseStoreSchema at Base 2.3.3-4~dfsg
- VDatabaseTypespec at Base 2.3.3-4~dfsg
- VDatabaseUnlock at Base 2.3.3-4~dfsg
- VDatabaseVCreateDB at Base 2.3.3-4~dfsg
- VDatabaseVCreateTable at Base 2.3.3-4~dfsg
- VDatabaseVDropDB at Base 2.3.3-4~dfsg
- VDatabaseVDropTable at Base 2.3.3-4~dfsg
- VDatabaseVLock at Base 2.3.3-4~dfsg
- VDatabaseVOpenDBRead at Base 2.3.3-4~dfsg
- VDatabaseVOpenDBUpdate at Base 2.3.3-4~dfsg
- VDatabaseVOpenTableRead at Base 2.3.3-4~dfsg
- VDatabaseVOpenTableUpdate at Base 2.3.3-4~dfsg
- VDatabaseVUnlock at Base 2.3.3-4~dfsg
- VDatabaseVWritable at Base 2.3.3-4~dfsg
- VDatabaseWhack at Base 2.3.3-4~dfsg
- VDatabaseWritable at Base 2.3.3-4~dfsg
- VDatatypesAddRef at Base 2.3.3-4~dfsg
- VDatatypesMakeTypedecl at Base 2.3.3-4~dfsg
- VDatatypesRelease at Base 2.3.3-4~dfsg
- VDatatypesResolveTypedecl at Base 2.3.3-4~dfsg
- VDatatypesResolveTypeid at Base 2.3.3-4~dfsg
- VDatatypesResolveTypename at Base 2.3.3-4~dfsg
- VDatatypesSizeofTypedecl at Base 2.3.3-4~dfsg
- VDatatypesSizeofTypeid at Base 2.3.3-4~dfsg
- VDatatypesToAncestor at Base 2.3.3-4~dfsg
- VDatatypesToIntrinsic at Base 2.3.3-4~dfsg
- VDatatypesToSupertype at Base 2.3.3-4~dfsg
- VDatatypesVResolveTypedecl at Base 2.3.3-4~dfsg
- VFSManagerAddRef at Base 2.3.3-4~dfsg
- VFSManagerCreateFile at Base 2.3.3-4~dfsg
- VFSManagerGetBindingsFile at Base 2.3.3-4~dfsg
- VFSManagerGetCWD at Base 2.3.3-4~dfsg
- VFSManagerGetConfig at Base 2.3.3-4~dfsg
- VFSManagerGetKryptoPassword at Base 2.3.3-4~dfsg
- VFSManagerGetObject at Base 2.3.3-4~dfsg
- VFSManagerGetObjectId at Base 2.3.3-4~dfsg
- VFSManagerGetResolver at Base 2.3.3-4~dfsg
- VFSManagerMake at Base 2.3.3-4~dfsg
- VFSManagerMakeAccPath at Base 2.3.3-4~dfsg
- VFSManagerMakeFromKfg at Base 2.3.3-4~dfsg
- VFSManagerMakeOidPath at Base 2.3.3-4~dfsg
- VFSManagerMakePath at Base 2.3.3-4~dfsg
- VFSManagerMakeResolver at Base 2.3.3-4~dfsg
- VFSManagerMakeSysPath at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryRead at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryUpdate at Base 2.3.3-4~dfsg
- VFSManagerOpenDirectoryUpdateDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenFileRead at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDirectoryRelative at Base 2.3.3-4~dfsg
- VFSManagerOpenFileReadDirectoryRelativeDecrypt at Base 2.3.3-4~dfsg
- VFSManagerOpenFileWrite at Base 2.3.3-4~dfsg
- VFSManagerOpenXTocDirRead at Base 2.3.3-4~dfsg
- VFSManagerRegisterObject at Base 2.3.3-4~dfsg
- VFSManagerRelease at Base 2.3.3-4~dfsg
- VFSManagerRemove at Base 2.3.3-4~dfsg
- VFSManagerResolvePath at Base 2.3.3-4~dfsg
- VFSManagerResolvePathRelative at Base 2.3.3-4~dfsg
- VFSManagerResolvePathRelativeDir at Base 2.3.3-4~dfsg
- VFSManagerResolveSpec at Base 2.3.3-4~dfsg
- VFSManagerSetBindingsFile at Base 2.3.3-4~dfsg
- VFSManagerUpdateKryptoPassword at Base 2.3.3-4~dfsg
- VFSManagerVMakeAccPath at Base 2.3.3-4~dfsg
- VFSManagerVMakePath at Base 2.3.3-4~dfsg
- VFSManagerWGAValidateHack at Base 2.3.3-4~dfsg
- VFSManagerWMakeSysPath at Base 2.3.3-4~dfsg
- VFormatdeclCommonAncestor at Base 2.3.3-4~dfsg
- VFormatdeclDump at Base 2.3.3-4~dfsg
- VFormatdeclToFormatdecl at Base 2.3.3-4~dfsg
- VFormatdeclToText at Base 2.3.3-4~dfsg
- VFunctionProdColumnIdRange at Base 2.3.3-4~dfsg
- VFunctionProdDestroy at Base 2.3.3-4~dfsg
- VFunctionProdMake at Base 2.3.3-4~dfsg
- VFunctionProdMakeBuiltInComp at Base 2.3.3-4~dfsg
- VFunctionProdRead at Base 2.3.3-4~dfsg
- VKKeyStoreGetObjectId at Base 2.3.3-4~dfsg
- VLinkerAddFactories at Base 2.3.3-4~dfsg
- VLinkerAttach at Base 2.3.3-4~dfsg
- VLinkerFindFactory at Base 2.3.3-4~dfsg
- VLinkerFindNamedFactory at Base 2.3.3-4~dfsg
- VLinkerFindUntyped at Base 2.3.3-4~dfsg
- VLinkerInitFactories at Base 2.3.3-4~dfsg
- VLinkerInitFactoriesRead at Base 2.3.3-4~dfsg
- VLinkerListExternalSchemaModules at Base 2.3.3-4~dfsg
- VLinkerMake at Base 2.3.3-4~dfsg
- VLinkerMakeIntrinsic at Base 2.3.3-4~dfsg
- VLinkerOpen at Base 2.3.3-4~dfsg
- VLinkerRelease at Base 2.3.3-4~dfsg
- VLinkerSever at Base 2.3.3-4~dfsg
- VLinkerVAddLoadLibraryPath at Base 2.3.3-4~dfsg
- VNameListCount at Base 2.3.3-4~dfsg
- VNameListGet at Base 2.3.3-4~dfsg
- VNamelistAppend at Base 2.3.3-4~dfsg
- VNamelistAppendString at Base 2.3.3-4~dfsg
- VNamelistIndexOf at Base 2.3.3-4~dfsg
- VNamelistMake at Base 2.3.3-4~dfsg
- VNamelistRelease at Base 2.3.3-4~dfsg
- VNamelistRemove at Base 2.3.3-4~dfsg
- VNamelistReorder at Base 2.3.3-4~dfsg
- VNamelistToConstNamelist at Base 2.3.3-4~dfsg
- VNamelistToNamelist at Base 2.3.3-4~dfsg
- VPathAddRef at Base 2.3.3-4~dfsg
- VPathFromUri at Base 2.3.3-4~dfsg
- VPathGetAuth at Base 2.3.3-4~dfsg
- VPathGetFragment at Base 2.3.3-4~dfsg
- VPathGetHost at Base 2.3.3-4~dfsg
- VPathGetOid at Base 2.3.3-4~dfsg
- VPathGetParam at Base 2.3.3-4~dfsg
- VPathGetPath at Base 2.3.3-4~dfsg
- VPathGetPortName at Base 2.3.3-4~dfsg
- VPathGetPortNum at Base 2.3.3-4~dfsg
- VPathGetQuery at Base 2.3.3-4~dfsg
- VPathGetScheme at Base 2.3.3-4~dfsg
- VPathIsFSCompatible at Base 2.3.3-4~dfsg
- VPathMakeString at Base 2.3.3-4~dfsg
- VPathMakeUri at Base 2.3.3-4~dfsg
- VPathOption at Base 2.3.3-4~dfsg
- VPathReadAuth at Base 2.3.3-4~dfsg
- VPathReadFragment at Base 2.3.3-4~dfsg
- VPathReadHost at Base 2.3.3-4~dfsg
- VPathReadParam at Base 2.3.3-4~dfsg
- VPathReadPath at Base 2.3.3-4~dfsg
- VPathReadPortName at Base 2.3.3-4~dfsg
- VPathReadQuery at Base 2.3.3-4~dfsg
- VPathReadScheme at Base 2.3.3-4~dfsg
- VPathReadUri at Base 2.3.3-4~dfsg
- VPathRelease at Base 2.3.3-4~dfsg
- VPhysicalDestroy at Base 2.3.3-4~dfsg
- VPhysicalFinishKColumn at Base 2.3.3-4~dfsg
- VPhysicalFinishStatic at Base 2.3.3-4~dfsg
- VPhysicalIsStatic at Base 2.3.3-4~dfsg
- VPhysicalLoadMetadata at Base 2.3.3-4~dfsg
- VPhysicalMake at Base 2.3.3-4~dfsg
- VPhysicalOpenRead at Base 2.3.3-4~dfsg
- VPhysicalOpenWrite at Base 2.3.3-4~dfsg
- VPhysicalProdColumnIdRange at Base 2.3.3-4~dfsg
- VPhysicalProdDestroy at Base 2.3.3-4~dfsg
- VPhysicalProdFixedRowLength at Base 2.3.3-4~dfsg
- VPhysicalProdMake at Base 2.3.3-4~dfsg
- VPhysicalProdRead at Base 2.3.3-4~dfsg
- VPhysicalRead at Base 2.3.3-4~dfsg
- VPhysicalReadBlob at Base 2.3.3-4~dfsg
- VPhysicalWhack at Base 2.3.3-4~dfsg
- VProdResolveColumn at Base 2.3.3-4~dfsg
- VProdResolveColumnRead at Base 2.3.3-4~dfsg
- VProdResolveColumnRoot at Base 2.3.3-4~dfsg
- VProdResolveEncodingExpr at Base 2.3.3-4~dfsg
- VProdResolveExpr at Base 2.3.3-4~dfsg
- VProdResolveFuncExpr at Base 2.3.3-4~dfsg
- VProdResolveParamExpr at Base 2.3.3-4~dfsg
- VProdResolvePhysical at Base 2.3.3-4~dfsg
- VProdResolvePhysicalRead at Base 2.3.3-4~dfsg
- VProdResolveSPhysMember at Base 2.3.3-4~dfsg
- VProdResolveSProduction at Base 2.3.3-4~dfsg
- VProdResolveScriptExpr at Base 2.3.3-4~dfsg
- VProductionCmp at Base 2.3.3-4~dfsg
- VProductionColumnIdRange at Base 2.3.3-4~dfsg
- VProductionFixedRowLength at Base 2.3.3-4~dfsg
- VProductionIsStatic at Base 2.3.3-4~dfsg
- VProductionMake at Base 2.3.3-4~dfsg
- VProductionPageIdRange at Base 2.3.3-4~dfsg
- VProductionReadBlob at Base 2.3.3-4~dfsg
- VProductionRowLength at Base 2.3.3-4~dfsg
- VProductionSort at Base 2.3.3-4~dfsg
- VProductionWhack at Base 2.3.3-4~dfsg
- VResolverAddRef at Base 2.3.3-4~dfsg
- VResolverCache at Base 2.3.3-4~dfsg
- VResolverCacheEnable at Base 2.3.3-4~dfsg
- VResolverLocal at Base 2.3.3-4~dfsg
- VResolverLocalEnable at Base 2.3.3-4~dfsg
- VResolverProtocols at Base 2.3.3-4~dfsg
- VResolverQuery at Base 2.3.3-4~dfsg
- VResolverRelease at Base 2.3.3-4~dfsg
- VResolverRemote at Base 2.3.3-4~dfsg
- VResolverRemoteEnable at Base 2.3.3-4~dfsg
- VSchemaAddIncludePath at Base 2.3.3-4~dfsg
- VSchemaAddRef at Base 2.3.3-4~dfsg
- VSchemaAttach at Base 2.3.3-4~dfsg
- VSchemaCacheIntrinsicTypeId at Base 2.3.3-4~dfsg
- VSchemaClearMark at Base 2.3.3-4~dfsg
- VSchemaClearPhysMark at Base 2.3.3-4~dfsg
- VSchemaDebugPrint at Base 2.3.3-4~dfsg
- VSchemaDescribeTypedecl at Base 2.3.3-4~dfsg
- VSchemaDescribeTypedef at Base 2.3.3-4~dfsg
- VSchemaDump at Base 2.3.3-4~dfsg
- VSchemaFind at Base 2.3.3-4~dfsg
- VSchemaFindFmtid at Base 2.3.3-4~dfsg
- VSchemaFindITypeid at Base 2.3.3-4~dfsg
- VSchemaFindTypeid at Base 2.3.3-4~dfsg
- VSchemaFindTypesetid at Base 2.3.3-4~dfsg
- VSchemaImplicitPhysEncExpr at Base 2.3.3-4~dfsg
- VSchemaIncludeFiles at Base 2.3.3-4~dfsg
- VSchemaLastIntrinsicTypeId at Base 2.3.3-4~dfsg
- VSchemaListLegacyTables at Base 2.3.3-4~dfsg
- VSchemaMake at Base 2.3.3-4~dfsg
- VSchemaMakeIntrinsic at Base 2.3.3-4~dfsg
- VSchemaMakeRuntimeTable at Base 2.3.3-4~dfsg
- VSchemaParseFile at Base 2.3.3-4~dfsg
- VSchemaParseText at Base 2.3.3-4~dfsg
- VSchemaParseTextCallback at Base 2.3.3-4~dfsg
- VSchemaRelease at Base 2.3.3-4~dfsg
- VSchemaResolveFmtdecl at Base 2.3.3-4~dfsg
- VSchemaResolveTypedecl at Base 2.3.3-4~dfsg
- VSchemaResolveTypespec at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddAsciiColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddBooleanColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddFloatColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddIntegerColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableAddUnicodeColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableClose at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableCommit at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddAsciiColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddBooleanColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddFloatColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddIntegerColumn at Base 2.3.3-4~dfsg
- VSchemaRuntimeTableVAddUnicodeColumn at Base 2.3.3-4~dfsg
- VSchemaSever at Base 2.3.3-4~dfsg
- VSchemaToText at Base 2.3.3-4~dfsg
- VSchemaTypeMark at Base 2.3.3-4~dfsg
- VSchemaVAddIncludePath at Base 2.3.3-4~dfsg
- VSchemaVParseFile at Base 2.3.3-4~dfsg
- VSchemaVResolveFmtdecl at Base 2.3.3-4~dfsg
- VSchemaVResolveTypedecl at Base 2.3.3-4~dfsg
- VSchemaVResolveTypespec at Base 2.3.3-4~dfsg
- VScriptProdDestroy at Base 2.3.3-4~dfsg
- VScriptProdMake at Base 2.3.3-4~dfsg
- VScriptProdRead at Base 2.3.3-4~dfsg
- VSimpleProdMake at Base 2.3.3-4~dfsg
- VSimpleProdRead at Base 2.3.3-4~dfsg
- VTableAddRef at Base 2.3.3-4~dfsg
- VTableAttach at Base 2.3.3-4~dfsg
- VTableColumnCreateParams at Base 2.3.3-4~dfsg
- VTableColumnDatatypes at Base 2.3.3-4~dfsg
- VTableCreateCachedCursorRead at Base 2.3.3-4~dfsg
- VTableCreateCursorRead at Base 2.3.3-4~dfsg
- VTableCreateCursorReadInternal at Base 2.3.3-4~dfsg
- VTableCreateCursorWrite at Base 2.3.3-4~dfsg
- VTableCreateCursorWriteInt at Base 2.3.3-4~dfsg
- VTableCreateIndex at Base 2.3.3-4~dfsg
- VTableDropColumn at Base 2.3.3-4~dfsg
- VTableExtendSchema at Base 2.3.3-4~dfsg
- VTableGetUserData at Base 2.3.3-4~dfsg
- VTableHasStaticColumn at Base 2.3.3-4~dfsg
- VTableListCol at Base 2.3.3-4~dfsg
- VTableListPhysColumns at Base 2.3.3-4~dfsg
- VTableListReadableColumns at Base 2.3.3-4~dfsg
- VTableListReadableDatatypes at Base 2.3.3-4~dfsg
- VTableListSeededWritableColumns at Base 2.3.3-4~dfsg
- VTableListWritableColumns at Base 2.3.3-4~dfsg
- VTableListWritableDatatypes at Base 2.3.3-4~dfsg
- VTableLoadSchema at Base 2.3.3-4~dfsg
- VTableLock at Base 2.3.3-4~dfsg
- VTableLocked at Base 2.3.3-4~dfsg
- VTableMake at Base 2.3.3-4~dfsg
- VTableOpenIndexRead at Base 2.3.3-4~dfsg
- VTableOpenIndexUpdate at Base 2.3.3-4~dfsg
- VTableOpenKTableRead at Base 2.3.3-4~dfsg
- VTableOpenKTableUpdate at Base 2.3.3-4~dfsg
- VTableOpenManagerRead at Base 2.3.3-4~dfsg
- VTableOpenManagerUpdate at Base 2.3.3-4~dfsg
- VTableOpenMetadataRead at Base 2.3.3-4~dfsg
- VTableOpenMetadataUpdate at Base 2.3.3-4~dfsg
- VTableOpenParentRead at Base 2.3.3-4~dfsg
- VTableOpenParentUpdate at Base 2.3.3-4~dfsg
- VTableOpenSchema at Base 2.3.3-4~dfsg
- VTableReindex at Base 2.3.3-4~dfsg
- VTableRelease at Base 2.3.3-4~dfsg
- VTableRenameColumn at Base 2.3.3-4~dfsg
- VTableSetUserData at Base 2.3.3-4~dfsg
- VTableSever at Base 2.3.3-4~dfsg
- VTableStoreSchema at Base 2.3.3-4~dfsg
- VTableTypespec at Base 2.3.3-4~dfsg
- VTableUnlock at Base 2.3.3-4~dfsg
- VTableVCreateIndex at Base 2.3.3-4~dfsg
- VTableVDropColumn at Base 2.3.3-4~dfsg
- VTableVLock at Base 2.3.3-4~dfsg
- VTableVOpenIndexRead at Base 2.3.3-4~dfsg
- VTableVOpenIndexUpdate at Base 2.3.3-4~dfsg
- VTableVUnlock at Base 2.3.3-4~dfsg
- VTableVWritable at Base 2.3.3-4~dfsg
- VTableWhack at Base 2.3.3-4~dfsg
- VTableWritable at Base 2.3.3-4~dfsg
- VTypedeclCommonAncestor at Base 2.3.3-4~dfsg
- VTypedeclDump at Base 2.3.3-4~dfsg
- VTypedeclToSupertype at Base 2.3.3-4~dfsg
- VTypedeclToText at Base 2.3.3-4~dfsg
- VTypedeclToType at Base 2.3.3-4~dfsg
- VTypedeclToTypedecl at Base 2.3.3-4~dfsg
- VTypedescSizeof at Base 2.3.3-4~dfsg
- VectMbrWhack at Base 2.3.3-4~dfsg
- VectorAppend at Base 2.3.3-4~dfsg
- VectorCopy at Base 2.3.3-4~dfsg
- VectorDoUntil at Base 2.3.3-4~dfsg
- VectorFind at Base 2.3.3-4~dfsg
- VectorFirst at Base 2.3.3-4~dfsg
- VectorForEach at Base 2.3.3-4~dfsg
- VectorGet at Base 2.3.3-4~dfsg
- VectorInit at Base 2.3.3-4~dfsg
- VectorInsert at Base 2.3.3-4~dfsg
- VectorInsertUnique at Base 2.3.3-4~dfsg
- VectorLast at Base 2.3.3-4~dfsg
- VectorMerge at Base 2.3.3-4~dfsg
- VectorRemove at Base 2.3.3-4~dfsg
- VectorReorder at Base 2.3.3-4~dfsg
- VectorSet at Base 2.3.3-4~dfsg
- VectorSwap at Base 2.3.3-4~dfsg
- VectorWhack at Base 2.3.3-4~dfsg
- WColumnBufferPage at Base 2.3.3-4~dfsg
- WColumnCloseRow at Base 2.3.3-4~dfsg
- WColumnCommitRow at Base 2.3.3-4~dfsg
- WColumnDropPage at Base 2.3.3-4~dfsg
- WColumnMake at Base 2.3.3-4~dfsg
- WColumnOpenRow at Base 2.3.3-4~dfsg
- WColumnReadBlob at Base 2.3.3-4~dfsg
- WColumnRepeatRow at Base 2.3.3-4~dfsg
- WColumnRowDefaults at Base 2.3.3-4~dfsg
- WColumnSetDefault at Base 2.3.3-4~dfsg
- WColumnWrite at Base 2.3.3-4~dfsg
- WGAEncValidate at Base 2.3.3-4~dfsg
- XTocEntryPathType at Base 2.3.3-4~dfsg
- XTocEntryResolvePath at Base 2.3.3-4~dfsg
- XTocListingMake at Base 2.3.3-4~dfsg
- XTocMakePath at Base 2.3.3-4~dfsg
- XTocParseXml at Base 2.3.3-4~dfsg
- XTocTreeAddArchive at Base 2.3.3-4~dfsg
- XTocTreeAddContainer at Base 2.3.3-4~dfsg
- XTocTreeAddDir at Base 2.3.3-4~dfsg
- XTocTreeAddFile at Base 2.3.3-4~dfsg
- XTocTreeAddSymlink at Base 2.3.3-4~dfsg
- alloc_chunk at Base 2.3.3-4~dfsg
- alloc_chunk_and_zero at Base 2.3.3-4~dfsg
- check_rd_len at Base 2.3.3-4~dfsg
- chunk_add_in at Base 2.3.3-4~dfsg
- chunk_and_in at Base 2.3.3-4~dfsg
- chunk_isbit_set at Base 2.3.3-4~dfsg
- chunk_lshift_one at Base 2.3.3-4~dfsg
- chunk_lshift_one_inplace at Base 2.3.3-4~dfsg
- chunk_negate at Base 2.3.3-4~dfsg
- chunk_or_in at Base 2.3.3-4~dfsg
- chunk_set at Base 2.3.3-4~dfsg
- chunk_set_bit at Base 2.3.3-4~dfsg
- chunk_set_minusone at Base 2.3.3-4~dfsg
- chunk_xor_in at Base 2.3.3-4~dfsg
- chunk_zero at Base 2.3.3-4~dfsg
- chunksize at Base 2.3.3-4~dfsg
- cond_expr at Base 2.3.3-4~dfsg
- const_expr at Base 2.3.3-4~dfsg
- cp1252 at Base 2.3.3-4~dfsg
- create_fqn at Base 2.3.3-4~dfsg
- database_declaration at Base 2.3.3-4~dfsg
- debug_callback at Base 2.3.3-4~dfsg
- dim at Base 2.3.3-4~dfsg
- dp_end_callback at Base 2.3.3-4~dfsg
- dp_scan_for_left_match at Base 2.3.3-4~dfsg
- echo_row_0 at Base 2.3.3-4~dfsg
- edit_distance at Base 2.3.3-4~dfsg
- eval_const_expr at Base 2.3.3-4~dfsg
- eval_expr_syntax at Base 2.3.3-4~dfsg
- eval_numeric_expr at Base 2.3.3-4~dfsg
- eval_text_expr at Base 2.3.3-4~dfsg
- eval_uint64_expr at Base 2.3.3-4~dfsg
- eval_uint_expr at Base 2.3.3-4~dfsg
- ex_encode16 at Base 2.3.3-4~dfsg
- ex_encode32 at Base 2.3.3-4~dfsg
- ex_encode64 at Base 2.3.3-4~dfsg
- ex_encode8 at Base 2.3.3-4~dfsg
- exists_row_0 at Base 2.3.3-4~dfsg
- expect at Base 2.3.3-4~dfsg
- expression at Base 2.3.3-4~dfsg
- extfunc_declaration at Base 2.3.3-4~dfsg
- fact_signature at Base 2.3.3-4~dfsg
- fmtdecl at Base 2.3.3-4~dfsg
- fmtname at Base 2.3.3-4~dfsg
- fmtspec at Base 2.3.3-4~dfsg
- format_definition at Base 2.3.3-4~dfsg
- free_chunk at Base 2.3.3-4~dfsg
- free_chunk_parts at Base 2.3.3-4~dfsg
- function_declaration at Base 2.3.3-4~dfsg
- gRCContextIdx_str at Base 2.3.3-4~dfsg
- gRCContext_str at Base 2.3.3-4~dfsg
- gRCModuleIdx_str at Base 2.3.3-4~dfsg
- gRCModule_str at Base 2.3.3-4~dfsg
- gRCObjectIdx_str at Base 2.3.3-4~dfsg
- gRCObject_str at Base 2.3.3-4~dfsg
- gRCStateIdx_str at Base 2.3.3-4~dfsg
- gRCState_str at Base 2.3.3-4~dfsg
- gRCTargetIdx_str at Base 2.3.3-4~dfsg
- gRCTarget_str at Base 2.3.3-4~dfsg
- get_mode_string at Base 2.3.3-4~dfsg
- gv_local at Base 2.3.3-4~dfsg
- has_inside_approx_match at Base 2.3.3-4~dfsg
- has_inside_exact_match at Base 2.3.3-4~dfsg
- has_left_approx_match at Base 2.3.3-4~dfsg
- has_left_exact_match at Base 2.3.3-4~dfsg
- has_right_approx_match at Base 2.3.3-4~dfsg
- has_right_exact_match at Base 2.3.3-4~dfsg
- idx_text_insert at Base 2.3.3-4~dfsg
- idx_text_lookup at Base 2.3.3-4~dfsg
- idx_text_project at Base 2.3.3-4~dfsg
- indirect_const_expr at Base 2.3.3-4~dfsg
- init_db_symtab at Base 2.3.3-4~dfsg
- init_symtab at Base 2.3.3-4~dfsg
- init_tbl_symtab at Base 2.3.3-4~dfsg
- iso8859_1 at Base 2.3.3-4~dfsg
- iso8859_cvt_string_copy at Base 2.3.3-4~dfsg
- iso8859_cvt_string_len at Base 2.3.3-4~dfsg
- iso8859_cvt_string_measure at Base 2.3.3-4~dfsg
- iso8859_string_len at Base 2.3.3-4~dfsg
- iso8859_string_measure at Base 2.3.3-4~dfsg
- iso8859_string_size at Base 2.3.3-4~dfsg
- iso8859_utf32 at Base 2.3.3-4~dfsg
- iunzip_func_v0 at Base 2.3.3-4~dfsg
- j__1_BranchBJPPopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf2PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf3PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf4PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf5PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf6PopToWords at Base 2.3.3-4~dfsg
- j__1_Leaf7PopToWords at Base 2.3.3-4~dfsg
- j__1_LeafWPopToWords at Base 2.3.3-4~dfsg
- j__L_BranchBJPPopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf1Offset at Base 2.3.3-4~dfsg
- j__L_Leaf1PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf2Offset at Base 2.3.3-4~dfsg
- j__L_Leaf2PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf3Offset at Base 2.3.3-4~dfsg
- j__L_Leaf3PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf4Offset at Base 2.3.3-4~dfsg
- j__L_Leaf4PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf5Offset at Base 2.3.3-4~dfsg
- j__L_Leaf5PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf6Offset at Base 2.3.3-4~dfsg
- j__L_Leaf6PopToWords at Base 2.3.3-4~dfsg
- j__L_Leaf7Offset at Base 2.3.3-4~dfsg
- j__L_Leaf7PopToWords at Base 2.3.3-4~dfsg
- j__L_LeafVPopToWords at Base 2.3.3-4~dfsg
- j__L_LeafWOffset at Base 2.3.3-4~dfsg
- j__L_LeafWPopToWords at Base 2.3.3-4~dfsg
- j__u1MaxWords at Base 2.3.3-4~dfsg
- j__uLMaxWords at Base 2.3.3-4~dfsg
- j__udy1AllocJ1PM at Base 2.3.3-4~dfsg
- j__udy1AllocJBB at Base 2.3.3-4~dfsg
- j__udy1AllocJBBJP at Base 2.3.3-4~dfsg
- j__udy1AllocJBL at Base 2.3.3-4~dfsg
- j__udy1AllocJBU at Base 2.3.3-4~dfsg
- j__udy1AllocJLB1 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL2 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL3 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL4 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL5 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL6 at Base 2.3.3-4~dfsg
- j__udy1AllocJLL7 at Base 2.3.3-4~dfsg
- j__udy1AllocJLW at Base 2.3.3-4~dfsg
- j__udy1BranchBToBranchL at Base 2.3.3-4~dfsg
- j__udy1Cascade2 at Base 2.3.3-4~dfsg
- j__udy1Cascade3 at Base 2.3.3-4~dfsg
- j__udy1Cascade4 at Base 2.3.3-4~dfsg
- j__udy1Cascade5 at Base 2.3.3-4~dfsg
- j__udy1Cascade6 at Base 2.3.3-4~dfsg
- j__udy1Cascade7 at Base 2.3.3-4~dfsg
- j__udy1CascadeL at Base 2.3.3-4~dfsg
- j__udy1CreateBranchB at Base 2.3.3-4~dfsg
- j__udy1CreateBranchL at Base 2.3.3-4~dfsg
- j__udy1CreateBranchU at Base 2.3.3-4~dfsg
- j__udy1FreeJ1PM at Base 2.3.3-4~dfsg
- j__udy1FreeJBB at Base 2.3.3-4~dfsg
- j__udy1FreeJBBJP at Base 2.3.3-4~dfsg
- j__udy1FreeJBL at Base 2.3.3-4~dfsg
- j__udy1FreeJBU at Base 2.3.3-4~dfsg
- j__udy1FreeJLB1 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL2 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL3 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL4 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL5 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL6 at Base 2.3.3-4~dfsg
- j__udy1FreeJLL7 at Base 2.3.3-4~dfsg
- j__udy1FreeJLW at Base 2.3.3-4~dfsg
- j__udy1FreeSM at Base 2.3.3-4~dfsg
- j__udy1InsertBranch at Base 2.3.3-4~dfsg
- j__udy1JPPop1 at Base 2.3.3-4~dfsg
- j__udy1Leaf1ToLeaf2 at Base 2.3.3-4~dfsg
- j__udy1Leaf2ToLeaf3 at Base 2.3.3-4~dfsg
- j__udy1Leaf3ToLeaf4 at Base 2.3.3-4~dfsg
- j__udy1Leaf4ToLeaf5 at Base 2.3.3-4~dfsg
- j__udy1Leaf5ToLeaf6 at Base 2.3.3-4~dfsg
- j__udy1Leaf6ToLeaf7 at Base 2.3.3-4~dfsg
- j__udy1Leaf7ToLeafW at Base 2.3.3-4~dfsg
- j__udy1Test at Base 2.3.3-4~dfsg
- j__udyLAllocJBB at Base 2.3.3-4~dfsg
- j__udyLAllocJBBJP at Base 2.3.3-4~dfsg
- j__udyLAllocJBL at Base 2.3.3-4~dfsg
- j__udyLAllocJBU at Base 2.3.3-4~dfsg
- j__udyLAllocJLB1 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL1 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL2 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL3 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL4 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL5 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL6 at Base 2.3.3-4~dfsg
- j__udyLAllocJLL7 at Base 2.3.3-4~dfsg
- j__udyLAllocJLPM at Base 2.3.3-4~dfsg
- j__udyLAllocJLW at Base 2.3.3-4~dfsg
- j__udyLAllocJV at Base 2.3.3-4~dfsg
- j__udyLBranchBToBranchL at Base 2.3.3-4~dfsg
- j__udyLCascade1 at Base 2.3.3-4~dfsg
- j__udyLCascade2 at Base 2.3.3-4~dfsg
- j__udyLCascade3 at Base 2.3.3-4~dfsg
- j__udyLCascade4 at Base 2.3.3-4~dfsg
- j__udyLCascade5 at Base 2.3.3-4~dfsg
- j__udyLCascade6 at Base 2.3.3-4~dfsg
- j__udyLCascade7 at Base 2.3.3-4~dfsg
- j__udyLCascadeL at Base 2.3.3-4~dfsg
- j__udyLCreateBranchB at Base 2.3.3-4~dfsg
- j__udyLCreateBranchL at Base 2.3.3-4~dfsg
- j__udyLCreateBranchU at Base 2.3.3-4~dfsg
- j__udyLFreeJBB at Base 2.3.3-4~dfsg
- j__udyLFreeJBBJP at Base 2.3.3-4~dfsg
- j__udyLFreeJBL at Base 2.3.3-4~dfsg
- j__udyLFreeJBU at Base 2.3.3-4~dfsg
- j__udyLFreeJLB1 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL1 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL2 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL3 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL4 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL5 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL6 at Base 2.3.3-4~dfsg
- j__udyLFreeJLL7 at Base 2.3.3-4~dfsg
- j__udyLFreeJLPM at Base 2.3.3-4~dfsg
- j__udyLFreeJLW at Base 2.3.3-4~dfsg
- j__udyLFreeJV at Base 2.3.3-4~dfsg
- j__udyLFreeSM at Base 2.3.3-4~dfsg
- j__udyLGet at Base 2.3.3-4~dfsg
- j__udyLInsertBranch at Base 2.3.3-4~dfsg
- j__udyLJPPop1 at Base 2.3.3-4~dfsg
- j__udyLLeaf1ToLeaf2 at Base 2.3.3-4~dfsg
- j__udyLLeaf2ToLeaf3 at Base 2.3.3-4~dfsg
- j__udyLLeaf3ToLeaf4 at Base 2.3.3-4~dfsg
- j__udyLLeaf4ToLeaf5 at Base 2.3.3-4~dfsg
- j__udyLLeaf5ToLeaf6 at Base 2.3.3-4~dfsg
- j__udyLLeaf6ToLeaf7 at Base 2.3.3-4~dfsg
- j__udyLLeaf7ToLeafW at Base 2.3.3-4~dfsg
- j__udyLLeafB1ToLeaf1 at Base 2.3.3-4~dfsg
- kbsearch at Base 2.3.3-4~dfsg
- kfprintf at Base 2.3.3-4~dfsg
- kprintf at Base 2.3.3-4~dfsg
- ksort at Base 2.3.3-4~dfsg
- ksort_int32_t at Base 2.3.3-4~dfsg
- ksort_int64_t at Base 2.3.3-4~dfsg
- ksort_uint32_t at Base 2.3.3-4~dfsg
- ksort_uint64_t at Base 2.3.3-4~dfsg
- lshift_chunk at Base 2.3.3-4~dfsg
- maj_min_rel at Base 2.3.3-4~dfsg
- make_column_namelist at Base 2.3.3-4~dfsg
- make_column_typelist at Base 2.3.3-4~dfsg
- meta_append at Base 2.3.3-4~dfsg
- meta_attr_read at Base 2.3.3-4~dfsg
- meta_attr_write at Base 2.3.3-4~dfsg
- meta_read at Base 2.3.3-4~dfsg
- meta_value at Base 2.3.3-4~dfsg
- meta_write at Base 2.3.3-4~dfsg
- na4_match at Base 2.3.3-4~dfsg
- na4_set_bits at Base 2.3.3-4~dfsg
- next_fqn at Base 2.3.3-4~dfsg
- old_kfprintf at Base 2.3.3-4~dfsg
- old_string_printf at Base 2.3.3-4~dfsg
- old_string_vprintf at Base 2.3.3-4~dfsg
- old_vkfprintf at Base 2.3.3-4~dfsg
- pLogErr at Base 2.3.3-4~dfsg
- pLogLibErr at Base 2.3.3-4~dfsg
- pLogLibMsg at Base 2.3.3-4~dfsg
- pLogMsg at Base 2.3.3-4~dfsg
- parameter_read at Base 2.3.3-4~dfsg
- parse_Q at Base 2.3.3-4~dfsg
- parse_decimal at Base 2.3.3-4~dfsg
- phys_encoding_expr at Base 2.3.3-4~dfsg
- physical_declaration at Base 2.3.3-4~dfsg
- physical_name at Base 2.3.3-4~dfsg
- pop_db_scope at Base 2.3.3-4~dfsg
- pop_tbl_scope at Base 2.3.3-4~dfsg
- print_char_fixup at Base 2.3.3-4~dfsg
- print_chunk at Base 2.3.3-4~dfsg
- print_float_fixup at Base 2.3.3-4~dfsg
- print_int_fixup at Base 2.3.3-4~dfsg
- production_stmt at Base 2.3.3-4~dfsg
- push_db_scope at Base 2.3.3-4~dfsg
- push_out at Base 2.3.3-4~dfsg
- push_tbl_scope at Base 2.3.3-4~dfsg
- resolve_object at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsF64 at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsU32 at Base 2.3.3-4~dfsg
- s_KXMLNodeReadNodeOrAttrAsU64 at Base 2.3.3-4~dfsg
- s_KXMLNode_readTextNode at Base 2.3.3-4~dfsg
- schema at Base 2.3.3-4~dfsg
- schema_signature at Base 2.3.3-4~dfsg
- script_body at Base 2.3.3-4~dfsg
- script_declaration at Base 2.3.3-4~dfsg
- sra_decompress_clp at Base 2.3.3-4~dfsg
- sra_decompress_init at Base 2.3.3-4~dfsg
- sra_decompress_int at Base 2.3.3-4~dfsg
- sra_decompress_nse at Base 2.3.3-4~dfsg
- sra_decompress_pos at Base 2.3.3-4~dfsg
- sra_decompress_prb_454 at Base 2.3.3-4~dfsg
- sra_decompress_prb_slx at Base 2.3.3-4~dfsg
- sra_decompress_sig_454 at Base 2.3.3-4~dfsg
- sra_decompress_sig_slx at Base 2.3.3-4~dfsg
- sra_schema_size at Base 2.3.3-4~dfsg
- sra_schema_text at Base 2.3.3-4~dfsg
- strcase_cmp at Base 2.3.3-4~dfsg
- strcase_match at Base 2.3.3-4~dfsg
- string_chr at Base 2.3.3-4~dfsg
- string_cmp at Base 2.3.3-4~dfsg
- string_copy at Base 2.3.3-4~dfsg
- string_copy_measure at Base 2.3.3-4~dfsg
- string_cvt_wchar_copy at Base 2.3.3-4~dfsg
- string_dup at Base 2.3.3-4~dfsg
- string_dup_measure at Base 2.3.3-4~dfsg
- string_hash at Base 2.3.3-4~dfsg
- string_idx at Base 2.3.3-4~dfsg
- string_len at Base 2.3.3-4~dfsg
- string_match at Base 2.3.3-4~dfsg
- string_measure at Base 2.3.3-4~dfsg
- string_printf at Base 2.3.3-4~dfsg
- string_rchr at Base 2.3.3-4~dfsg
- string_size at Base 2.3.3-4~dfsg
- string_vprintf at Base 2.3.3-4~dfsg
- structured_printf at Base 2.3.3-4~dfsg
- structured_sprintf at Base 2.3.3-4~dfsg
- table_declaration at Base 2.3.3-4~dfsg
- tolower_copy at Base 2.3.3-4~dfsg
- toupper_copy at Base 2.3.3-4~dfsg
- type_definition at Base 2.3.3-4~dfsg
- type_expr at Base 2.3.3-4~dfsg
- typedecl at Base 2.3.3-4~dfsg
- typename at Base 2.3.3-4~dfsg
- typeset at Base 2.3.3-4~dfsg
- typeset_definition at Base 2.3.3-4~dfsg
- typespec at Base 2.3.3-4~dfsg
- unpack_8_from_1_arr at Base 2.3.3-4~dfsg
- unpack_8_from_2_arr at Base 2.3.3-4~dfsg
- untyped_expr at Base 2.3.3-4~dfsg
- utf16_cvt_string_copy at Base 2.3.3-4~dfsg
- utf16_cvt_string_len at Base 2.3.3-4~dfsg
- utf16_cvt_string_measure at Base 2.3.3-4~dfsg
- utf16_string_len at Base 2.3.3-4~dfsg
- utf16_string_measure at Base 2.3.3-4~dfsg
- utf16_string_size at Base 2.3.3-4~dfsg
- utf32_cvt_string_copy at Base 2.3.3-4~dfsg
- utf32_cvt_string_len at Base 2.3.3-4~dfsg
- utf32_cvt_string_measure at Base 2.3.3-4~dfsg
- utf32_string_len at Base 2.3.3-4~dfsg
- utf32_string_measure at Base 2.3.3-4~dfsg
- utf32_string_size at Base 2.3.3-4~dfsg
- utf32_utf8 at Base 2.3.3-4~dfsg
- utf8_utf32 at Base 2.3.3-4~dfsg
- vLogErr at Base 2.3.3-4~dfsg
- vLogLibErr at Base 2.3.3-4~dfsg
- vLogLibMsg at Base 2.3.3-4~dfsg
- vLogMsg at Base 2.3.3-4~dfsg
- valfunc_declaration at Base 2.3.3-4~dfsg
- validate_header_offsets at Base 2.3.3-4~dfsg
- vardim_type_expr at Base 2.3.3-4~dfsg
- vdb_add_row_id at Base 2.3.3-4~dfsg
- vdb_bit_or at Base 2.3.3-4~dfsg
- vdb_bunzip at Base 2.3.3-4~dfsg
- vdb_bzip at Base 2.3.3-4~dfsg
- vdb_cast at Base 2.3.3-4~dfsg
- vdb_ceil at Base 2.3.3-4~dfsg
- vdb_checksum at Base 2.3.3-4~dfsg
- vdb_clip at Base 2.3.3-4~dfsg
- vdb_compare at Base 2.3.3-4~dfsg
- vdb_cut at Base 2.3.3-4~dfsg
- vdb_delta at Base 2.3.3-4~dfsg
- vdb_delta_average at Base 2.3.3-4~dfsg
- vdb_deriv at Base 2.3.3-4~dfsg
- vdb_detranspose at Base 2.3.3-4~dfsg
- vdb_diff at Base 2.3.3-4~dfsg
- vdb_echo at Base 2.3.3-4~dfsg
- vdb_exists at Base 2.3.3-4~dfsg
- vdb_extract_token at Base 2.3.3-4~dfsg
- vdb_fixed_row_len at Base 2.3.3-4~dfsg
- vdb_fixed_vec_sum at Base 2.3.3-4~dfsg
- vdb_floor at Base 2.3.3-4~dfsg
- vdb_funzip at Base 2.3.3-4~dfsg
- vdb_fzip at Base 2.3.3-4~dfsg
- vdb_hello at Base 2.3.3-4~dfsg
- vdb_integral at Base 2.3.3-4~dfsg
- vdb_integral_0 at Base 2.3.3-4~dfsg
- vdb_iunzip at Base 2.3.3-4~dfsg
- vdb_izip at Base 2.3.3-4~dfsg
- vdb_map at Base 2.3.3-4~dfsg
- vdb_max at Base 2.3.3-4~dfsg
- vdb_merge at Base 2.3.3-4~dfsg
- vdb_min at Base 2.3.3-4~dfsg
- vdb_next_shallow_token at Base 2.3.3-4~dfsg
- vdb_next_token at Base 2.3.3-4~dfsg
- vdb_no_compare at Base 2.3.3-4~dfsg
- vdb_outlier_decode at Base 2.3.3-4~dfsg
- vdb_outlier_encode at Base 2.3.3-4~dfsg
- vdb_pack at Base 2.3.3-4~dfsg
- vdb_paste at Base 2.3.3-4~dfsg
- vdb_range_validate at Base 2.3.3-4~dfsg
- vdb_redimension at Base 2.3.3-4~dfsg
- vdb_rldecode at Base 2.3.3-4~dfsg
- vdb_rlencode at Base 2.3.3-4~dfsg
- vdb_round at Base 2.3.3-4~dfsg
- vdb_row_id at Base 2.3.3-4~dfsg
- vdb_row_len at Base 2.3.3-4~dfsg
- vdb_select at Base 2.3.3-4~dfsg
- vdb_simple_sub_select at Base 2.3.3-4~dfsg
- vdb_simple_sub_select_1 at Base 2.3.3-4~dfsg
- vdb_split at Base 2.3.3-4~dfsg
- vdb_sprintf at Base 2.3.3-4~dfsg
- vdb_strtonum at Base 2.3.3-4~dfsg
- vdb_subtract_row_id at Base 2.3.3-4~dfsg
- vdb_sum at Base 2.3.3-4~dfsg
- vdb_transpose at Base 2.3.3-4~dfsg
- vdb_trim at Base 2.3.3-4~dfsg
- vdb_trunc at Base 2.3.3-4~dfsg
- vdb_undelta at Base 2.3.3-4~dfsg
- vdb_undelta_average at Base 2.3.3-4~dfsg
- vdb_unpack at Base 2.3.3-4~dfsg
- vdb_unzip at Base 2.3.3-4~dfsg
- vdb_vec_sum at Base 2.3.3-4~dfsg
- vdb_zip at Base 2.3.3-4~dfsg
- vec_sum_make at Base 2.3.3-4~dfsg
- vkfprintf at Base 2.3.3-4~dfsg
- vkprintf at Base 2.3.3-4~dfsg
- vlen_decode1 at Base 2.3.3-4~dfsg
- vlen_decode at Base 2.3.3-4~dfsg
- vlen_decodeU1 at Base 2.3.3-4~dfsg
- vlen_decodeU at Base 2.3.3-4~dfsg
- vlen_encode1 at Base 2.3.3-4~dfsg
- vlen_encode at Base 2.3.3-4~dfsg
- vlen_encodeU1 at Base 2.3.3-4~dfsg
- vlen_encodeU at Base 2.3.3-4~dfsg
- wchar_cvt_string_copy at Base 2.3.3-4~dfsg
- wchar_cvt_string_len at Base 2.3.3-4~dfsg
- wchar_cvt_string_measure at Base 2.3.3-4~dfsg
- wchar_string_len at Base 2.3.3-4~dfsg
- wchar_string_measure at Base 2.3.3-4~dfsg
- wchar_string_size at Base 2.3.3-4~dfsg
- wrt_nvp_find at Base 2.3.3-4~dfsg
- wrt_nvp_find_value at Base 2.3.3-4~dfsg
- wrt_nvp_sort at Base 2.3.3-4~dfsg
- yy_create_buffer at Base 2.3.3-4~dfsg
- yy_delete_buffer at Base 2.3.3-4~dfsg
- yy_flush_buffer at Base 2.3.3-4~dfsg
- yy_scan_buffer at Base 2.3.3-4~dfsg
- yy_scan_bytes at Base 2.3.3-4~dfsg
- yy_scan_string at Base 2.3.3-4~dfsg
- yy_switch_to_buffer at Base 2.3.3-4~dfsg
- yyalloc at Base 2.3.3-4~dfsg
- yyfree at Base 2.3.3-4~dfsg
- yyget_column at Base 2.3.3-4~dfsg
- yyget_debug at Base 2.3.3-4~dfsg
- yyget_extra at Base 2.3.3-4~dfsg
- yyget_in at Base 2.3.3-4~dfsg
- yyget_leng at Base 2.3.3-4~dfsg
- yyget_lineno at Base 2.3.3-4~dfsg
- yyget_lval at Base 2.3.3-4~dfsg
- yyget_out at Base 2.3.3-4~dfsg
- yyget_text at Base 2.3.3-4~dfsg
- yylex at Base 2.3.3-4~dfsg
- yylex_destroy at Base 2.3.3-4~dfsg
- yylex_init at Base 2.3.3-4~dfsg
- yylex_init_extra at Base 2.3.3-4~dfsg
- yypop_buffer_state at Base 2.3.3-4~dfsg
- yypush_buffer_state at Base 2.3.3-4~dfsg
- yyrealloc at Base 2.3.3-4~dfsg
- yyrestart at Base 2.3.3-4~dfsg
- yyset_column at Base 2.3.3-4~dfsg
- yyset_debug at Base 2.3.3-4~dfsg
- yyset_extra at Base 2.3.3-4~dfsg
- yyset_in at Base 2.3.3-4~dfsg
- yyset_lineno at Base 2.3.3-4~dfsg
- yyset_lval at Base 2.3.3-4~dfsg
- yyset_out at Base 2.3.3-4~dfsg
diff --git a/debian/sra-toolkit.install b/debian/sra-toolkit.install
deleted file mode 100644
index 790e7d8..0000000
--- a/debian/sra-toolkit.install
+++ /dev/null
@@ -1,3 +0,0 @@
-bin??/*	usr/bin
-schema/*/*.vschema usr/lib/ncbi/schema
-lib??/ncbi/*.kfg /etc/ncbi
diff --git a/debian/upstream b/debian/upstream
deleted file mode 100644
index 1201e30..0000000
--- a/debian/upstream
+++ /dev/null
@@ -1,12 +0,0 @@
-Reference:
-  Author: Rasko Leinonen and Ruth Akhtar and Ewan Birney and James Bonfield and Lawrence Bower and Matt Corbett and Ying Cheng and Fehmi Demiralp and Nadeem Faruque and Neil Goodgame and Richard Gibson and Gemma Hoad and Christopher Hunter and Mikyung Jang and Steven Leonard and Quan Lin and Rodrigo Lopez and Michael Maguire and Hamish McWilliam and Sheila Plaister and Rajesh Radhakrishnan and Siamak Sobhany and Guy Slater and Petra Ten Hoopen and Franck Valentin and Robert Vaughan and V [...]
-  Title: Improvements to services at the European Nucleotide Archive
-  Journal: Nucleic Acids Research
-  Year: 2010
-  Volume: 38
-  Number: Database issue
-  Pages: D39-45
-  DOI: 10.1093/nar/gkp998
-  PMID: 19906712
-  URL: http://nar.oxfordjournals.org/content/38/suppl_1/D39
-  eprint: http://nar.oxfordjournals.org/content/38/suppl_1/D39.full.pdf+html
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 1a15397..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-opts=dversionmangle=s/[~+]dfsg\d*// \
-  http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/.+?/sra_sdk-(.*)\.tar\.gz
diff --git a/doc/help/html/abi-dump-help.html b/doc/help/html/abi-dump-help.html
deleted file mode 100644
index a3a0df7..0000000
--- a/doc/help/html/abi-dump-help.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>abi-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  abi-dump [options] [ -A ] <accession>
-  abi-dump [options] <path>
-
-  -A|--accession <accession>       Replaces accession derived from <path> in filename(s) and deflines
-
-Options:
-
-  -O|--outdir <path>               Output directory, default is '.'
-  -N|--minSpotId <rowid>           Minimum spot id
-  -X|--maxSpotId <rowid>           Maximum spot id
-  -G|--spot-group                  Split into files by SPOT_GROUP (member name)
-  --spot-groups <[list]>           Filter by SPOT_GROUP (member): name[,...]
-  -R|--read-filter <[filter]>      Split into files by READ_FILTER value
-                                   optionally filter by a value: pass|reject|criteria|redacted
-  -T|--group-in-dirs               Split into subdirectories instead of files
-  -K|--keep-empty-files            Do not delete empty files
-  --table <table-name>             (New) Table name within SRA format, default is SEQUENCE
-
-  -h|--help                        Output a brief explantion for the program
-  -V|--version                     Display the version of the program then quit
-  -L|--log-level <level>           Logging level as number or enum string
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program
-                                   Use multiple times for more verbosity
-
-Format options:
-
-  -M|--minReadLen <len>            Minimum read length to output, default is 25
-  -W|--noclip                      Do not clip quality left and right for spot
-  -F|--origfmt                     Excludes SRR accession on defline
-  -B|--noDotReads                  Do not output reads consisting mostly of dots
-</pre>
-</body>
-</html>
diff --git a/doc/help/html/abi-load-help.html b/doc/help/html/abi-load-help.html
deleted file mode 100644
index a5bbdba..0000000
--- a/doc/help/html/abi-load-help.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>abi-load help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  abi-load [options] -r run.xml -e experiment.xml -o output-path
-
-  -r|--run-xml                     path to run.xml describing input files
-  -e|--experiment                  path to experiment.xml
-  -o|--output-path                 target location
-
-Options:
-  -i|--input-path                  input files location, default '.'
-  -u|--input-unpacked              input files are unpacked
-  -f|--force                       force target overwrite
-  -n|--spots-number                process only given number of spots from input
-  -b|--bad-spot-number             acceptable number of spot creation errors, default is 50
-  -p|--bad-spot-percentage         acceptable percentage of spots creation errors, default is 5
-  -x|--expected                    path to expected.xml
-  -z|--xml-log                     produce XML-formatted log file
-  -s|--intensities                 [on | off] load intensity data, default is off:
-                                     Illumina: signal, intensity, noise;
-                                     AB SOLiD: signal(s);
-                                     LS454: signal, position (for SFF files ON by default).
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/bam-load-help.html b/doc/help/html/bam-load-help.html
deleted file mode 100644
index 69bc6fa..0000000
--- a/doc/help/html/bam-load-help.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>bam-load help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-bam-load [Options] BAMFILE
-    Load a bam file.
-
-Options:
-  -o, --output=TABLEPATH    REQUIRED: path to a table where the table will be put
-  -V, --version             this will cause the program to emit the internal
-                            version number before any other action
-  -v, --verbose             extra information will be output during
-                            processing second occurrence on the command line
-                            means even more
-  -h, -?, --help            print this message
-  -l, --log-level=LEVEL     the next token will affect the logging level of
-                            the program  accepted tokens are the numbers
-                            0-15, fatal, sys, int, err, warn, info
-                          , debug1...debug10
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/copycat-help.html b/doc/help/html/copycat-help.html
deleted file mode 100644
index 5bb9ff9..0000000
--- a/doc/help/html/copycat-help.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>copycat help</title>
-</head>
-<body>
-
-<pre>
-copycat : 1.0.6
-
-Usage: 
-    copycat [ <options> ] src-file dst-file
-    copycat [ <options> ] src-file [src-file...] dst-dir
-    copycat [ <options> ] -o dst-dir src-file [src-file...]
-
-    options:
-      -x cache-dir         location to output cached files
-      -f                   force overwrite of existing files
-      -m magicfile         path to the magic file to use
-      -e extfile           path to the extensions file to use
-      -c classfile         path to the file class/type file
-
-    behavior is intended to mimic 'cp' to a large extent, in that
-    a single source file may be copied to a new name, or multiple
-    source files may be copied to a destination directory.
-
-    when the destination directory is specified using 'cp' semantics,
-    the directory must exist. if specified via '-o' switch, it will be
-    created if necessary.
-
-    the target file may also be a device. in the special case of
-    /dev/null, it may also act as a directory.
-
-    the '-x' option allows small files that are typed as eligible for
-    caching to be copied to the cache directory provided. the directory
-    will be created if necessary.
-    the intent is to capture top-level files, such that files are copied
-    into the flat cache directory without regard to where they were found
-    in the input hierarchy. in the case of name conflict, output files will
-    be renamed.
-
-    the class file, magic file and extension file allow new understandings
-    of files found while cataloging
-    the magic file is of the type used by the unix/linux 'file' command
-    the class file assigns file type to classes
-    the extension file assigns file extensions to file types
-
-    existing classes are 'Archive', 'Cached', 'Compressed', 'Read'
-    Archive and Compresses files are those that have contents that can
-    be examined - new types must be compiled in
-    Cached files are those affected by the -x option
-    Read files are not handled seperately by copy cat except in the catalog
-    new classes would like Read only be added to the catalog with the class
-
-    the format for the class file is lines such as the below
-        'GnuZip<tab>Compressed<lf>' with tabs and linefeeds
-
-    the format for the extension file is lines such as the below
-        'gz<tab>Compressed<lf>' with tabs and linefeeds
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/crc32sum-help.html b/doc/help/html/crc32sum-help.html
deleted file mode 100644
index d12b31f..0000000
--- a/doc/help/html/crc32sum-help.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>crc32 help</title>
-</head>
-<body>
-
-<pre>
-: usage: crc32sum [<option>] file [file...]
-
-    options:
-      -c          check CRC32 against given list
-      -b          open file in binary mode
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/fastq-dump-help.html b/doc/help/html/fastq-dump-help.html
deleted file mode 100644
index 673da36..0000000
--- a/doc/help/html/fastq-dump-help.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>fastq-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  fastq-dump [options] [ -A ] <accession>
-  fastq-dump [options] <path>
-
-INPUT
-  -A|--accession <accession>       Replaces accession derived from <path> in filename(s) and deflines
-  --table <table-name>             (New) Table name within SRA format, default is SEQUENCE
-
-PROCESSING
-
-Read Splitting                     Sequence data may be used as raw or split into individual reads
-  --split-spot                     Split spots into individual reads
-
-Full Spot Filters                  Applied to the full spot independently of --split-spot
-  -N|--minSpotId <rowid>           Minimum spot id
-  -X|--maxSpotId <rowid>           Maximum spot id
-  --spot-groups <[list]>           Filter by SPOT_GROUP (member): name[,...]
-  -W|--clip                        Apply left and right clips
-
-Common Filters                     Applied to spots when --split-spot is not set, otherwise - to individual reads
-  -M|--minReadLen <len>            Filter by sequence length >= <len>
-  -R|--read-filter <[filter]>      Split into files by READ_FILTER value
-                                   optionally filter by a value: pass|reject|criteria|redacted
-  -E|--qual-filter                 Filter used in early 1K Genomes data:
-                                   no sequences starting or ending with >= 10N
-
-Filters for individual reads       Applied only with --split-spot set
-  --skip-technical                 Dump only biological reads
-
-OUTPUT
-  -O|--outdir <path>               Output directory, default is '.'
-
-Multiple File Options              Setting this options will produce more than 1 file, which will be suffixed by splitting criteria.
-  --split-files                    Dump each read into a separate file.Files will received suffix corresponding to read number
-  --split-3                        Legacy 3-file splitting for mate-pairs:
-                                   First 2 biological reads satisfying dumping conditions
-                                   are placed in files *_1.fastq and *_2.fastq
-                                   If only 1 biological read is dumpable - it is placed in *.fastq
-                                   Biological reads 3 and above are ignored.
-  -G|--spot-group                  Split into files by SPOT_GROUP (member name)
-  -R|--read-filter <[filter]>      Split into files by READ_FILTER value
-                                   optionally filter by a value: pass|reject|criteria|redacted
-  -T|--group-in-dirs               Split into subdirectories instead of files
-  -K|--keep-empty-files            Do not delete empty files
-
-FORMATTING
-
-Sequence
-  -C|--dumpcs <[cskey]>            Formats sequence in color space (default for SOLiD),cskey may be specified for translation
-  -B|--dumpbase                    Formats sequence in base sequence (default for other than SOLiD).
-
-Quality
-  -Q|--offset <integer>            Offset to use for quality conversion, default is 33
-  --fasta                          Fasta only, no qualities
-
-Defline
-  -F|--origfmt                     Defline contains only original sequence name
-  -I|--readids                     Append read id after spot id as 'accession.spot.readid' on defline
-  --helicos                        Helicos style defline
-  --defline-seq <fmt>              Defline format specification for sequence.
-  --defline-qual <fmt>             Defline format specification for quailty.
-                                   <fmt> is string of characters and/or variables. Variables could be are one of:
-                                      $ac - accession, $si - spot id, $sn - spot name, $sg - spot group (barcode),
-                                      $sl - spot length in bases, $ri - read number, $rn - read name, $rl - read length in bases.
-                                   '[]' could be used for an optional output: if all vars in [] yield empty values whole group is not printed.
-                                   Empty value is empty string or 0 for numeric variables.
-                                   Ex: @$sn[_$rn]/$ri - '_$rn' is omitted if name is empty
-
-OTHER:
-  -h|--help                        Output a brief explantion for the program
-  -V|--version                     Display the version of the program then quit
-  -L|--log-level <level>           Logging level as number or enum string
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program
-                                   Use multiple times for more verbosity
-</pre>
-</body>
-</html>
diff --git a/doc/help/html/fastq-load-help.html b/doc/help/html/fastq-load-help.html
deleted file mode 100644
index 340022a..0000000
--- a/doc/help/html/fastq-load-help.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>fastq-load help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  fastq-load [options] -r run.xml -e experiment.xml -o output-path
-
-  -r|--run-xml                     path to run.xml describing input files
-  -e|--experiment                  path to experiment.xml
-  -o|--output-path                 target location
-
-Options:
-  -i|--input-path                  input files location, default '.'
-  -u|--input-unpacked              input files are unpacked
-  -f|--force                       force target overwrite
-  -n|--spots-number                process only given number of spots from input
-  -b|--bad-spot-number             acceptable number of spot creation errors, default is 50
-  -p|--bad-spot-percentage         acceptable percentage of spots creation errors, default is 5
-  -x|--expected                    path to expected.xml
-  -z|--xml-log                     produce XML-formatted log file
-  -s|--intensities                 [on | off] load intensity data, default is off:
-                                     Illumina: signal, intensity, noise;
-                                     AB SOLiD: signal(s);
-                                     LS454: signal, position (for SFF files ON by default).
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/illumina-dump-help.html b/doc/help/html/illumina-dump-help.html
deleted file mode 100644
index 6257a70..0000000
--- a/doc/help/html/illumina-dump-help.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>illumina-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  illumina-dump [options] [ -A ] <accession>
-  illumina-dump [options] <path>
-
-  -A|--accession <accession>       Replaces accession derived from <path> in filename(s) and deflines
-
-Options:
-
-  -O|--outdir <path>               Output directory, default is '.'
-  -N|--minSpotId <rowid>           Minimum spot id
-  -X|--maxSpotId <rowid>           Maximum spot id
-  -G|--spot-group                  Split into files by SPOT_GROUP (member name)
-  --spot-groups <[list]>           Filter by SPOT_GROUP (member): name[,...]
-  -R|--read-filter <[filter]>      Split into files by READ_FILTER value
-                                   optionally filter by a value: pass|reject|criteria|redacted
-  -T|--group-in-dirs               Split into subdirectories instead of files
-  -K|--keep-empty-files            Do not delete empty files
-  --table <table-name>             (New) Table name within SRA format, default is SEQUENCE
-
-  -h|--help                        Output a brief explantion for the program
-  -V|--version                     Display the version of the program then quit
-  -L|--log-level <level>           Logging level as number or enum string
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program
-                                   Use multiple times for more verbosity
-
-Format options:
-
-  -r|--read                        Output READ: "seq", default is on
-  -q|--qual1 <1|2>                 Output QUALITY, whole spot (1) or split by reads (2): "qcal", default is 1
-  -p|--qual4                       Output full QUALITY: "prb", default is off
-  -i|--intensity                   Output INTENSITY, if present: "int", default is off
-  -n|--noise                       Output NOISE, if present: "nse", default is off
-  -s|--signal                      Output SIGNAL, if present: "sig2", default is off
-  -x|--qseq <1|2>                  Output QSEQ format: whole spot (1) or split by reads: "qseq", default is off
-</pre>
-</body>
-</html>
diff --git a/doc/help/html/illumina-load-help.html b/doc/help/html/illumina-load-help.html
deleted file mode 100644
index b20fea4..0000000
--- a/doc/help/html/illumina-load-help.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>illumina-load help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  illumina-load [options] -r run.xml -e experiment.xml -o output-path
-
-  -r|--run-xml                     path to run.xml describing input files
-  -e|--experiment                  path to experiment.xml
-  -o|--output-path                 target location
-
-Options:
-  -i|--input-path                  input files location, default '.'
-  -u|--input-unpacked              input files are unpacked
-  -f|--force                       force target overwrite
-  -n|--spots-number                process only given number of spots from input
-  -b|--bad-spot-number             acceptable number of spot creation errors, default is 50
-  -p|--bad-spot-percentage         acceptable percentage of spots creation errors, default is 5
-  -x|--expected                    path to expected.xml
-  -z|--xml-log                     produce XML-formatted log file
-  -s|--intensities                 [on | off] load intensity data, default is off:
-                                     Illumina: signal, intensity, noise;
-                                     AB SOLiD: signal(s);
-                                     LS454: signal, position (for SFF files ON by default).
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/kar-help.html b/doc/help/html/kar-help.html
deleted file mode 100644
index 34bbc13..0000000
--- a/doc/help/html/kar-help.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>kar help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  kar [OPTIONS] -c|--create <Archive> -d|--directory <Directory> [Filter ...]
-  kar [OPTIONS] -x|--extract <Archive> -d|--directory <Directory>
-  kar [OPTIONS] -t|--test|--list <Archive>
-
-Summary:
-  Create, extract from, or test an archive.
-
-Archive Command:
-  All of these options require the next token on the command line to be
-  the name of the archive
-  -c|--create <archive>            Create a new archive.
-  -x|--extract <archive>           Extract the contents of an archive into a directory.
-  -t|--test <archive>              Check the structural validity of an archive
-                                   Optionally listing its contents
-
-Archive:
-  Path to a file that will/does hold the archive of other files
-
-Directory:
-    Required for create or extract command, ignored for test command
-
-Filters:
-  When present these act as include filters.
-  Any file name will be included in the extracted files, created archive
-  or test operation listing
-  Any directory will be included as well as its contents
-
-Options:
-  -d|--directory <Directory>       The next token on the command line is the
-                                   name of the directory to extract to or create
-                                   from
-  -f|--force                       (no parameter) this will cause the extract or
-                                   create to over-write existing files unless
-                                   they are write-protected.  without this
-                                   option the program will fail if the archive
-                                   already exists for a create or the target
-                                   directory exists for an extract
-  -a|--align <alignment>           Forces the alignment of files in create
-                                   mode putting the first byte of included
-                                   files at <alignment boundaries
-                                   alignment: 1|2|4|8
-                                   (default=4)
-  -l|--long-list                   more information will be given on each file
-                                   in test/list mode.
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/kdbmeta-help.html b/doc/help/html/kdbmeta-help.html
deleted file mode 100644
index e50e8cf..0000000
--- a/doc/help/html/kdbmeta-help.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>kdbmeta help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  kdbmeta [Options] <target> {<query> ...]
-
-Summary:
-  Display the contents of one or more metadata stores.
-  The target metadata are described by one or more
-  target specifications, giving the path to a database, a table
-  or a column. the command and query are executed on each target.
-
-  queries name one or more objects, and '*' acts as a wildcard.
-  query objects are nodes or attributes. nodes are named with a
-  hierarchical path, like a file-system path. attributes are given
-  as a node path followed by a '@' followed by the attribute name.
-
-target:
-  path-to-database                 access database metadata
-  path-to-table                    access table metadata
-  path-to-column                   access column metadata
-  accession                        sra global access id
-
-query:
-  *                                all nodes and attributes
-  NAME                             a named root node and children
-  PATH/NAME                        an internal node and children
-  <node>@ATTR                      a named attribute
-  <obj>=VALUE                      a simple value assignment where
-                                   value string is text, and binary
-                                   values use hex escape codes
-
-Options:
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/kqsh-help.html b/doc/help/html/kqsh-help.html
deleted file mode 100644
index 26ab050..0000000
--- a/doc/help/html/kqsh-help.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>kqsh help</title>
-</head>
-<body>
-
-<pre>
-Usage: kqsh [ options ] [ file... ]
-
-    options:
-      -h               give tool help
-      -u               enable update operations
-      -l <path>        path(s) for loading dynamic libraries
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/md5cp-help.html b/doc/help/html/md5cp-help.html
deleted file mode 100644
index 7ac4c8b..0000000
--- a/doc/help/html/md5cp-help.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>md5cp help</title>
-</head>
-<body>
-
-<pre>
-usage: md5cp [-p] [-f] [-r] [file|directory ...] directory
-
-    md5cp [-f] source_filename dest_filename
-    : Copies files and/or directories, creating an md5sum checksum (named file.md5) for all copied files.
-    
--f forces replacement of existing files.
--p forces replacement of existing modes on files and directories.
--r recurses over source directories (directories are ignored otherwise)
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/rcexplain-help.html b/doc/help/html/rcexplain-help.html
deleted file mode 100644
index 74afb55..0000000
--- a/doc/help/html/rcexplain-help.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>rcexplain help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  rcexplain [Options] rc [rc ...]
-
-Summary:
-  Prints out error string to stdout for one or more return codes.
-
-Options:
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/sff-dump-help.html b/doc/help/html/sff-dump-help.html
deleted file mode 100644
index f50c48d..0000000
--- a/doc/help/html/sff-dump-help.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>sff-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  sff-dump [options] [ -A ] <accession>
-  sff-dump [options] <path>
-
-  -A|--accession <accession>       Replaces accession derived from <path> in filename(s) and deflines
-
-Options:
-
-  -O|--outdir <path>               Output directory, default is '.'
-  -N|--minSpotId <rowid>           Minimum spot id
-  -X|--maxSpotId <rowid>           Maximum spot id
-  -G|--spot-group                  Split into files by SPOT_GROUP (member name)
-  --spot-groups <[list]>           Filter by SPOT_GROUP (member): name[,...]
-  -R|--read-filter <[filter]>      Split into files by READ_FILTER value
-                                   optionally filter by a value: pass|reject|criteria|redacted
-  -T|--group-in-dirs               Split into subdirectories instead of files
-  -K|--keep-empty-files            Do not delete empty files
-  --table <table-name>             (New) Table name within SRA format, default is SEQUENCE
-
-  -h|--help                        Output a brief explantion for the program
-  -V|--version                     Display the version of the program then quit
-  -L|--log-level <level>           Logging level as number or enum string
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program
-                                   Use multiple times for more verbosity
-</pre>
-</body>
-</html>
diff --git a/doc/help/html/sra-dump-help.html b/doc/help/html/sra-dump-help.html
deleted file mode 100644
index 8a71c82..0000000
--- a/doc/help/html/sra-dump-help.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>sra-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  sra-dump [ options ] table [ column-spec ... ]
-
-Summary:
-  Dump all data in table for specified or all columns
-
-table:
-  path to table or accession id within NCBI
-
-column-spec:
-  NAME                             simple column name
-  (typedecl)NAME                   specifically typed column name
-
-Options:
-  --start <ID>                     beginning spot id (default 1)
-  --stop <ID>                      ending spot id (default max)
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-</body>
-</html>
diff --git a/doc/help/html/sra-stat-help.html b/doc/help/html/sra-stat-help.html
deleted file mode 100644
index a1002c6..0000000
--- a/doc/help/html/sra-stat-help.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>sra-stat help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  sra-stat [options] table
-
-Summary:
-  Display table statistics
-
-Options:
-  -x|--xml                         output as XML (default is text)
-  -b|--start <row-id>              starting spot id ( default 1 )
-  -e|--stop <row-id>               ending spot id ( default max )
-  -m|--meta                        print load metadata
-  -q|--quick                       quick mode: get statistics from metadata
-                                   not to scan the table
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/srapath-help.html b/doc/help/html/srapath-help.html
deleted file mode 100644
index d8434e9..0000000
--- a/doc/help/html/srapath-help.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>srapath help</title>
-</head>
-<body>
-
-<pre>
-Usage:
- srapath 1.2.0
-
-Usage: srapath [ options ] accession ...
-
-    options:
-      --server <repserver-path>       path(s) to replication server(s)
-      --volume <volume-path>          relative path(s) to volume(s)
-
-    Tool to produce a list of full paths to SRA runs from list of
-    accessions.  Output paths are ordered according to accession list.
-    with no path alteration options, the accession search path will be
-    determined according to the local installation.
-    Replication server and volume paths may be compound, adhering to the
-    Unix path convention of ':' separators, e.g.
-
-        '/server1:/server2/subdir'
-
-    The idea behind separate replication servers and volumes is to
-    allow for a matrix of volumes that can hold a run, where the volumes
-    are expected to be replicated across all repservers.  It is possible that
-    this arrangement will be violated and still work, but behavior is less
-    clearly defined.
-
-    The order of search paths is important: rather than alphabetical,
-    specify paths in the preferred order of discovery, usually giving the most
-    recently updated volumes first.  If a run appears more than once in the matrix,
-    it will be found according to the first 'repserver/volume' combination that
-    produces a hit.
-
-    Finally, this tool produces a path that is 'likely' to be a run, in that
-    an entry exists in the file system at the location predicted.  It is possible
-    that this path will fail to produce success upon opening a run if the path does
-    not point to a valid object.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/srf-load-help.html b/doc/help/html/srf-load-help.html
deleted file mode 100644
index e0c988f..0000000
--- a/doc/help/html/srf-load-help.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>srf-load help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-	srf-load [options] -r run.xml -e experiment.xml -o output-path
-
-  -r|--run-xml                     path to run.xml describing input files
-  -e|--experiment                  path to experiment.xml
-  -o|--output-path                 target location
-
-Options:
-  -i|--input-path                  input files location, default '.'
-  -u|--input-unpacked              input files are unpacked
-  -f|--force                       force target overwrite
-  -n|--spots-number                process only given number of spots from input
-  -b|--bad-spot-number             acceptable number of spot creation errors, default is 50
-  -p|--bad-spot-percentage         acceptable percentage of spots creation errors, default is 5
-  -x|--expected                    path to expected.xml
-  -z|--xml-log                     produce XML-formatted log file
-  -s|--intensities                 [on | off] load intensity data, default is off:
-                                     Illumina: signal, intensity, noise;
-                                     AB SOLiD: signal(s);
-                                     LS454: signal, position (for SFF files ON by default).
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/txt2kdb-help.html b/doc/help/html/txt2kdb-help.html
deleted file mode 100644
index 47ce76b..0000000
--- a/doc/help/html/txt2kdb-help.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>txt2kdb help</title>
-</head>
-<body>
-
-<pre>
- txt2kdb [Options] FILE KCOLUMN
-    Create a KColumn physical column out of a text file.
-
-    FILE:
-        The text file should be ASCII or UTF-8 using LF, CR or CR-LF
-        line termination.  Each text line will be put into the
-        KColumn as a separate Row.  Each Row will be in its own
-        blob.
-    KCOLUMN:
-        The KColumn is either an existing KColumn or a path to one
-        that can be created.    Both paths should be relative to the current directory or full
-    from root "/"
-
-Options:
-  -b, --begin=START         include only lines starting from this line in the
-                            KColumn.  The first line is line 1 (not 0).
-  -e, --end=STOP            stop including lines after this line in the
-                            KColumn.  The first line is line 1 (not 0).
-  -f, --force               (no parameter) this will cause to over-write
-                            existing files.  Without
-                            this option the program will fail if the KColumn
-                            already exists and append mode is not selected
-  -a, --append              (no parameter) this will cause to append the text
-                            file to an existing KColumn.  If the file does not
-                            already exist it will be created.
-  -V, --version             this will cause the program to emit the internal
-                            version number before any other action
-  -v, --verbose             extra information will be output during
-                            processing second occurrence on the command line
-                            means even more
-  -h, -?, --help            print this message
-  -l, --log-level=LEVEL     the next token will affect the logging level of
-                            the program  accepted tokens are the numbers
-                            0-15, fatal, sys, int, err, warn, info
-                          , debug1...debug10
-</pre>
-
-</body>
-</html>
diff --git a/doc/help/html/vdb-dump-help.html b/doc/help/html/vdb-dump-help.html
deleted file mode 100644
index 8e107fb..0000000
--- a/doc/help/html/vdb-dump-help.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>vdb-dump help</title>
-</head>
-<body>
-
-<pre>
-Usage:
-  vdb-dump <path> [options]
-
-Options:
-  -I|--row_id_on                   print row id
-  -l|--line_feed <line_feed>       line-feed's inbetween rows
-  -N|--colname_off                 do not print column-names
-  -X|--in_hex                      print numbers in hex
-  -T|--table <table>               table-name
-  -R|--rows <rows>                 rows (default = all)
-  -C|--columns <columns>           columns (default = all)
-  -S|--schema <schema>             schema-name
-  -A|--schema_dump                 dumps the schema
-  -E|--table_enum                  enumerates tables
-  -O|--column_enum                 enumerates columns in extended form
-  -o|--column_enum_short           enumerates columns in short form 
-  -D|--dna_bases <dna_bases>       print dna-bases
-  -M|--max_length <max_length>     limits line length
-  -i|--indent_width <indent_width> indents the line
-  -f|--format <format>             dump format (csv,xml,json,piped,tab)
-  -r|--id_range                    prints id-range
-  -n|--without_sra                 without sra-type-translation
-  -a|--without_accession           without accession-test
-  -x|--exclude                     exclude these columns
-  -b|--boolean                     defines how boolean's are printed (1,T) 
-
-  -h|--help                        Output a brief explantion for the program.
-  -V|--version                     Display the version of the program then quit.
-  -L|--log-level <level>           Logging level as number or enum string.
-                                   One of (fatal|sys|int|err|warn|info) or (0-5)
-                                   Current/default is warn
-  -v|--verbose                     Increase the verbosity level of the program.
-                                   Use multiple times for more verbosity.
-</pre>
-</body>
-</html>
diff --git a/doc/help/txt/abi-dump-help.txt b/doc/help/txt/abi-dump-help.txt
deleted file mode 100644
index 4ef281b..0000000
--- a/doc/help/txt/abi-dump-help.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Usage:
-     abi-dump
-     -path <path-to-run>
-     [-outdir <outdir>] [-minSpotId <minSpotId>] [-maxSpotId <maxSpotId>] 
-     [-minReadLen <minReadLen>] [-noclip] [-origfmt] [-noDotReads]
-     <accession>
-
-Where:
-     -accession     Run accession - top level directory for SRA format either downloaded or locally generated
-     -path          Path to (but not including) accession
-     -outdir        Output directory (defaults to current directory)
-     -minSpotId     Minimum spot id to output
-     -maxSpotId     Maximum spot id to output
-     -minReadLen    Minimum read length to output (defaults is 25)
-     -noclip        Indicates don't apply clip quality right
-     -origfmt       Excludes SRR accession & length on defline
-     -noDotReads    No reads consisting only of dots are output
-     -noSignal      Do not write sginal files
-
diff --git a/doc/help/txt/abi-load-help.txt b/doc/help/txt/abi-load-help.txt
deleted file mode 100644
index 62b0e42..0000000
--- a/doc/help/txt/abi-load-help.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Usage:
-
-abi-load <help>
-abi-load [ <options> ] <input-spec> <spot-descriptor> <output-spec> [ <verbosity> ] 
-
-input-spec:
-  ( -r | --run-xml ) path           # path to run.xml describing input files
-
-spot-descriptor:
-  ( -e | --experiment ) path            # path to experiment.xml 
-                                        # with spot descriptor
-
-output-spec:
-  <output-mode> <run-name>           # produce output to run
-
-output-mode:
-  -c | --create                      # create only new run (fail if exists)
-  -o | --output                      # create new or replace existing run
-  -a | --append                      # create new or update existing run
-
-run-name:
-  path                                  # full or working-directory relative
-                                        # file-system path to run
-
-options:
-  ( -n | --spotnumber) spots_to_run    # tells the loader to stop processing after that many spots
-                                       # helpful in testing
-
-  ( -b | --bad-spot-number ) bad_spot_number  # number of spot creation errors to be tolerated
-                                              # default = 50
-
-  ( -p | --bad-spot-percentage ) bad_spot_percentage> # PERCENTAGE of the number of bad spots against
-                                                      # the number of good spots, default = 5
-
-help:
-  ( -h | --help )                       # print usage and option details
-
-verbosity:
-  ( -l | --log-level ) <level>  #logging level: fatal|sys|int|err|warn|info default=info
-debug:
-  ( -+ | --debug ) <module>  #module: APP|KFS|XML|VDB|SRA|REF|LEGREF default=APP
diff --git a/doc/help/txt/bam-loader-help.txt b/doc/help/txt/bam-loader-help.txt
deleted file mode 100644
index 69b13de..0000000
--- a/doc/help/txt/bam-loader-help.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Usage:
- bam-loader 0.0.1
-
-bam-loader [Options] BAMFILE
-    Load a bam file.
-
-Options:
-  -o, --output=TABLEPATH    REQUIRED: path to a table where the table will be put
-  -V, --version             this will cause the program to emit the internal
-                            version number before any other action
-  -v, --verbose             extra information will be output during
-                            processing second occurrence on the command line
-                            means even more
-  -h, -?, --help            print this message
-  -l, --log-level=LEVEL     the next token will affect the logging level of
-                            the program  accepted tokens are the numbers
-                            0-15, fatal, sys, int, err, warn, info
-                          , debug1...debug10
diff --git a/doc/help/txt/copycat-help.txt b/doc/help/txt/copycat-help.txt
deleted file mode 100644
index 964afda..0000000
--- a/doc/help/txt/copycat-help.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-
-copycat : 1.0.6
-
-Usage: 
-    copycat [ <options> ] src-file dst-file
-    copycat [ <options> ] src-file [src-file...] dst-dir
-    copycat [ <options> ] -o dst-dir src-file [src-file...]
-
-    options:
-      -x cache-dir         location to output cached files
-      -f                   force overwrite of existing files
-      -m magicfile         path to the magic file to use
-      -e extfile           path to the extensions file to use
-      -c classfile         path to the file class/type file
-
-    behavior is intended to mimic 'cp' to a large extent, in that
-    a single source file may be copied to a new name, or multiple
-    source files may be copied to a destination directory.
-
-    when the destination directory is specified using 'cp' semantics,
-    the directory must exist. if specified via '-o' switch, it will be
-    created if necessary.
-
-    the target file may also be a device. in the special case of
-    /dev/null, it may also act as a directory.
-
-    the '-x' option allows small files that are typed as eligible for
-    caching to be copied to the cache directory provided. the directory
-    will be created if necessary.
-    the intent is to capture top-level files, such that files are copied
-    into the flat cache directory without regard to where they were found
-    in the input hierarchy. in the case of name conflict, output files will
-    be renamed.
-
-    the class file, magic file and extension file allow new understandings
-    of files found while cataloging
-    the magic file is of the type used by the unix/linux 'file' command
-    the class file assigns file type to classes
-    the extension file assigns file extensions to file types
-
-    existing classes are 'Archive', 'Cached', 'Compressed', 'Read'
-    Archive and Compresses files are those that have contents that can
-    be examined - new types must be compiled in
-    Cached files are those affected by the -x option
-    Read files are not handled seperately by copy cat except in the catalog
-    new classes would like Read only be added to the catalog with the class
-
-    the format for the class file is lines such as the below
-        'GnuZip<tab>Compressed<lf>' with tabs and linefeeds
-
-    the format for the extension file is lines such as the below
-        'gz<tab>Compressed<lf>' with tabs and linefeeds
-
diff --git a/doc/help/txt/crc32sum-help.txt b/doc/help/txt/crc32sum-help.txt
deleted file mode 100644
index 879f9be..0000000
--- a/doc/help/txt/crc32sum-help.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-: usage: crc32sum [<option>] file [file...]
-
-    options:
-      -c          check CRC32 against given list
-      -b          open file in binary mode
-
diff --git a/doc/help/txt/fastq-dump-help.txt b/doc/help/txt/fastq-dump-help.txt
deleted file mode 100644
index 97ec5ec..0000000
--- a/doc/help/txt/fastq-dump-help.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-
-Usage:
-  fastq-dump [options] <path>
-
-Options:
-  -D, --table-path            Path to accession data.
-  -O, --outdir                Output directory. Default: '.'
-  -N, --minSpotId             Minimum spot id to output.
-  -X, --maxSpotId             Maximum spot id to output.
-  -G, --spot-group            Split into files by SPOT_GROUP (member).
-  -T, --group-in-dirs         Split into subdirectories instead of files.
-  -K, --keep-empty-files      Do not delete empty files.
-  -L, --log-level             Logging level: fatal|sys|int|err|warn|info.
-                                [default: info]
-  -+, --debug <level>         one of APP|KFS|XML|VDB|SRA|REF|LEGREF.
-                                [default: APP]
-  -H, --help                  Prints this message.
-
-Format options:
-  -M, --minReadLen            Minimum read length to output.
-                                [default: 25]
-  -W, --noclip                Do not clip quality right for spot.
-  -F, --origfmt               Excludes SRR accession & length on defline.
-  -C, --dumpcs [<cskey>]      Dump color space sequence.
-                                [enabled by default for ABI SOLID]
-                                [single letter color space key is optional]
-  -B, --dumpbase              Dump base sequence.
-                                [enabled by default for other than ABI SOLID]
-  -Q, --offset                Offset to use for quality conversion.
-                                [default: 33]
-  -I, --readids               Append read id after spot id as
-                                '<accession>.<spot>.<readid>' on defline.
-  -E, --no-qual-filter        Disable filtering by leading/trailng low quality.
-  -SF, --complete             Dump ALL reads in a single file.
-  -DB, --defline-seq          Sequence defline format specification;
-                              string of characters and/or variables.
-  -DQ, --defline-qual         quailty defline format specification.
-                                If -DB is provided but -DQ ommitted,
-                                -DB value is used.
-  -alt [n]                    alternative formatting version [1].
-
-Defline substitution variables:
-  '$ac'                       accession
-  '$si'                       spot id
-  '$sn'                       spot name
-  '$sg'                       spot group (member/barcode)
-  '$sl'                       spot length in bases
-  '$ri'                       read id
-  '$rn'                       read name
-  '$rl'                       read length in bases.
-
-  Substitution variables begin with a '$' character followed by a two
-  character symbol, e.g. 'ac'. '[]' could be used for an optional output:
-  if all variables in [] yield empty values whole group is not printed.
-    Empty value is empty string or 0 for numeric variables.
-    Ex: @$sn[_$rn]/$ri - '_$rn' is omitted if name is empty
-
diff --git a/doc/help/txt/fastq-load-help.txt b/doc/help/txt/fastq-load-help.txt
deleted file mode 100644
index 728b889..0000000
--- a/doc/help/txt/fastq-load-help.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Usage:
-
-fastq-load <help>
-fastq-load [ <options> ] <input-spec> <spot-descriptor> <output-spec> [ <verbosity> ] 
-
-input-spec:
-  ( -r | --run-xml ) path           # path to run.xml describing input files
-
-spot-descriptor:
-  ( -e | --experiment ) path            # path to experiment.xml 
-                                        # with spot descriptor
-
-output-spec:
-  <output-mode> <run-name>           # produce output to run
-
-output-mode:
-  -c | --create                      # create only new run (fail if exists)
-  -o | --output                      # create new or replace existing run
-  -a | --append                      # create new or update existing run
-
-run-name:
-  path                                  # full or working-directory relative
-                                        # file-system path to run
-
-options:
-  ( -n | --spotnumber) spots_to_run    # tells the loader to stop processing after that many spots
-                                       # helpful in testing
-
-  ( -b | --bad-spot-number ) bad_spot_number  # number of spot creation errors to be tolerated
-                                              # default = 50
-
-  ( -p | --bad-spot-percentage ) bad_spot_percentage> # PERCENTAGE of the number of bad spots against
-                                                      # the number of good spots, default = 5
-
-help:
-  ( -h | --help )                       # print usage and option details
-
-verbosity:
-  ( -l | --log-level ) <level>  #logging level: fatal|sys|int|err|warn|info default=info
-debug:
-  ( -+ | --debug ) <module>  #module: APP|KFS|XML|VDB|SRA|REF|LEGREF default=APP
diff --git a/doc/help/txt/illumina-dump-help.txt b/doc/help/txt/illumina-dump-help.txt
deleted file mode 100644
index 4dab085..0000000
--- a/doc/help/txt/illumina-dump-help.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-
-Usage:
-  illumina-dump [options] [ -A ] <accession>
-  illumina-dump [options] <path>
-
-	-A, --accession             Accession.
-
-Options:
-
-	-D, --table-path            Path to accession data.
-	-O, --outdir                Output directory. Default: '.'
-	-N, --minSpotId             Minimum spot id to output.
-	-X, --maxSpotId             Maximum spot id to output.
-	-G, --spot-group            Split into files by SPOT_GROUP (member).
-	-T, --group-in-dirs         Split into subdirectories instead of files.
-	-K, --keep-empty-files      Do not delete empty files.
-	-L, --log-level             Logging level: fatal|sys|int|err|warn|info. Default: info
-	-+, --debug                 debug: APP|KFS|XML|VDB|SRA|REF|LEGREF. Default: APP
-	-H, --help                  Prints this message.
-
-Format options:
-
-	-r, --read                  Output READ: "seq". Default: on
-	-q, --qual1                 Output QUALITY, into single (1) or multiple (2) files: "qcal". Default: 1
-	-p, --qual4                 Output full QUALITY: "prb". Default: off
-	-i, --intensity             Output INTENSITY, if present: "int". Default: off
-	-n, --noise                 Output NOISE, if present: "nse". Default: off
-	-s, --signal                Output SIGNAL, if present: "sig2". Default: off
-	-qseq                       Output QSEQ format: "qseq". Default: off
diff --git a/doc/help/txt/illumina-load-help.txt b/doc/help/txt/illumina-load-help.txt
deleted file mode 100644
index 35e8ac9..0000000
--- a/doc/help/txt/illumina-load-help.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Usage:
-
-illumina-load <help>
-illumina-load [ <options> ] <input-spec> <spot-descriptor> <output-spec> [ <verbosity> ] 
-
-input-spec:
-  ( -r | --run-xml ) path           # path to run.xml describing input files
-
-spot-descriptor:
-  ( -e | --experiment ) path            # path to experiment.xml 
-                                        # with spot descriptor
-
-output-spec:
-  <output-mode> <run-name>           # produce output to run
-
-output-mode:
-  -c | --create                      # create only new run (fail if exists)
-  -o | --output                      # create new or replace existing run
-  -a | --append                      # create new or update existing run
-
-run-name:
-  path                                  # full or working-directory relative
-                                        # file-system path to run
-
-options:
-  ( -n | --spotnumber) spots_to_run    # tells the loader to stop processing after that many spots
-                                       # helpful in testing
-
-  ( -b | --bad-spot-number ) bad_spot_number  # number of spot creation errors to be tolerated
-                                              # default = 50
-
-  ( -p | --bad-spot-percentage ) bad_spot_percentage> # PERCENTAGE of the number of bad spots against
-                                                      # the number of good spots, default = 5
-
-help:
-  ( -h | --help )                       # print usage and option details
-
-verbosity:
-  ( -l | --log-level ) <level>  #logging level: fatal|sys|int|err|warn|info default=info
-debug:
-  ( -+ | --debug ) <module>  #module: APP|KFS|XML|VDB|SRA|REF|LEGREF default=APP
diff --git a/doc/help/txt/kar-help.txt b/doc/help/txt/kar-help.txt
deleted file mode 100644
index 6b963a7..0000000
--- a/doc/help/txt/kar-help.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-kar : 1.0.1
-
-Usage: kar [options] [Archive Command] [Directory] [optional filters]
-
-    Create an NCBI archive from a directory
-      or
-    Test (list the contents) of an NCBI archive
-      or
-    Extract the contents of an NCBI archive into a directory
-
-Archive Command:
-    All of these options require the next token on the command line to be
-    the name of the archive
-  -c, --create=ARCHIVE      create a new archive
-  -t, --test=ARCHIVE        check the structural validity of an archive
-                            optionally listing its contents
-  -x, --extract=ARCHIVE     extract the contents of an archive into a
-                            directory
-Directory:
-    Required for create or extract command, ignored for test command
-  -d, --directory=DIRECTORY the next token on the command line is the name
-                            of the directory to extract to or create from
-Optional filters:
-    When present these act as include filters.
-    Any file name will be included in the extracted files, created archive
-    or test operation listing
-    Any directory will be included as well as its contents
-Options:
-  -f, --force               (no parameter) this will cause the extract or
-                            create to over-write existing files unless they
-                            are write-protected.  without this option the program
-                            will fail if the archive already exists for a create or
-                            the target directory exists for an extract
-  -a, --alignment=ALIGN     1,2,4,8 Forces the alignment of files in create
-                            mode putting the first byte of included files
-                            at ALIGN boundaries (default=4)
-  -V, --version             this will cause the program to emit the internal
-                            version number before any other action
-  -v, --verbose             extra information will be output during
-                            processinga second occurance on the command line
-                            means even more
-  -L, --long-list           more information will be given on each file in
-                            test/list mode
-  -h, -?, --help            print this message
-  -l, --log-level=LEVEL     the next token will affect the logging level of
-                            the program  accepted tokens are the numbers
-                            0-15, fatal, sys, int, err, warn, info
-                            and debug1...debug10
diff --git a/doc/help/txt/kdbmeta-help.txt b/doc/help/txt/kdbmeta-help.txt
deleted file mode 100644
index 781209c..0000000
--- a/doc/help/txt/kdbmeta-help.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Usage:kdbmeta <target> <query> [ <query> ... ]
-
-    cmd:
-      select                  display contents
-
-    target: one of
-      path-to-database        access database metadata
-      path-to-table           access table metadata
-      path-to-column          access column metadata
-      accession               sra global access id
-
-    query:
-      *                       all nodes and attributes
-      NAME                    a named root node and children
-      PATH/NAME               an internal node and children
-      <node>@ATTR             a named attribute
-      <obj>=VALUE             a simple value assignment where
-                              value string is text, and binary
-                              values use hex escape codes
-
-    tool to display or modify contents of one or more metadata
-    stores. the target metadata are described by one or more
-    target specifications, giving the path to a database, a table
-    or a column. the command and query are executed on each target.
-
-    queries name one or more objects, and '*' acts as a wildcard.
-    query objects are nodes or attributes. nodes are named with a
-    hierarchical path, like a file-system path. attributes are given
-    as a node path followed by a '@' followed by the attribute name.
-
diff --git a/doc/help/txt/kqsh-help.txt b/doc/help/txt/kqsh-help.txt
deleted file mode 100644
index 5042730..0000000
--- a/doc/help/txt/kqsh-help.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Usage: kqsh [ options ] [ file... ]
-
-    options:
-      -h               give tool help
-      -u               enable update operations
-      -l <path>        path(s) for loading dynamic libraries
-
diff --git a/doc/help/txt/md5cp-help.txt b/doc/help/txt/md5cp-help.txt
deleted file mode 100644
index 6139a39..0000000
--- a/doc/help/txt/md5cp-help.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-usage: md5cp [-p] [-f] [-r] [file|directory ...] directory
-
-    md5cp [-f] source_filename dest_filename
-    : Copies files and/or directories, creating an md5sum checksum (named file.md5) for all copied files.
-    
--f forces replacement of existing files.
--p forces replacement of existing modes on files and directories.
--r recurses over source directories (directories are ignored otherwise)
diff --git a/doc/help/txt/rcexplain-help.txt b/doc/help/txt/rcexplain-help.txt
deleted file mode 100644
index 39cb73e..0000000
--- a/doc/help/txt/rcexplain-help.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Usage: rcexplain rc [ rc... ]
-
-    prints out error string to stdout for one or more return codes
-
diff --git a/doc/help/txt/sff-dump-help.txt b/doc/help/txt/sff-dump-help.txt
deleted file mode 100644
index 19b4ed9..0000000
--- a/doc/help/txt/sff-dump-help.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Usage:
-  sff-dump [options] [ -A ] <accession>
-  sff-dump [options] <path>
-
-	-A, --accession             Accession.
-
-Options:
-
-	-D, --table-path            Path to accession data.
-	-O, --outdir                Output directory. Default: '.'
-	-N, --minSpotId             Minimum spot id to output.
-	-X, --maxSpotId             Maximum spot id to output.
-	-G, --spot-group            Split into files by SPOT_GROUP (member).
-	-T, --group-in-dirs         Split into subdirectories instead of files.
-	-K, --keep-empty-files      Do not delete empty files.
-	-L, --log-level             Logging level: fatal|sys|int|err|warn|info. Default: info
-	-+, --debug                 debug: APP|KFS|XML|VDB|SRA|REF|LEGREF. Default: APP
-	-H, --help                  Prints this message.
diff --git a/doc/help/txt/sra-dump-help.txt b/doc/help/txt/sra-dump-help.txt
deleted file mode 100644
index 8f7adce..0000000
--- a/doc/help/txt/sra-dump-help.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-Usage: sra-dump [ options ] table [ column-spec ... ]
-
-    dump all column data.
-    options:
-      -h                       give tool help
-     --help
-
-      --start ID               starting spot id ( default 1 )
-      --stop ID                ending spot id ( default max )
-
-      -l, --level              Log level: 0-5 or one of 
-
-
-    column-spec:
-      NAME                     simple column name
-      (typedecl)NAME           specifically typed column name
-
diff --git a/doc/help/txt/sra-stat-help.txt b/doc/help/txt/sra-stat-help.txt
deleted file mode 100644
index 13a9108..0000000
--- a/doc/help/txt/sra-stat-help.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Usage: sra-stat [ options ] table [ column-spec ... ]
-
-    display column statistics.
-    options:
-      -h                      give tool help
-     --help
-
-     --xml                    output in XML (default is ASCII)
-     --start ID               starting spot id ( default 1 )
-     --stop ID                ending spot id ( default max )
-
-      -l, --level             Log level: 0-5 or one of 
-                               fatal | sys | int | err | warn | info                               ( default warn )
-
-    column-spec:
-      NAME                     simple column name
-      (typedecl)NAME           specifically typed column name
-
diff --git a/doc/help/txt/srapath-help.txt b/doc/help/txt/srapath-help.txt
deleted file mode 100644
index 6587577..0000000
--- a/doc/help/txt/srapath-help.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Usage:
- srapath 1.2.0
-
-Usage: srapath [ options ] accession ...
-
-    options:
-      --server <repserver-path>       path(s) to replication server(s)
-      --volume <volume-path>          relative path(s) to volume(s)
-
-    Tool to produce a list of full paths to SRA runs from list of
-    accessions.  Output paths are ordered according to accession list.
-    with no path alteration options, the accession search path will be
-    determined according to the local installation.
-    Replication server and volume paths may be compound, adhering to the
-    Unix path convention of ':' separators, e.g.
-
-        '/server1:/server2/subdir'
-
-    The idea behind separate replication servers and volumes is to
-    allow for a matrix of volumes that can hold a run, where the volumes
-    are expected to be replicated across all repservers.  It is possible that
-    this arrangement will be violated and still work, but behavior is less
-    clearly defined.
-
-    The order of search paths is important: rather than alphabetical,
-    specify paths in the preferred order of discovery, usually giving the most
-    recently updated volumes first.  If a run appears more than once in the matrix,
-    it will be found according to the first 'repserver/volume' combination that
-    produces a hit.
-
-    Finally, this tool produces a path that is 'likely' to be a run, in that
-    an entry exists in the file system at the location predicted.  It is possible
-    that this path will fail to produce success upon opening a run if the path does
-    not point to a valid object.
-
diff --git a/doc/help/txt/srf-load-help.txt b/doc/help/txt/srf-load-help.txt
deleted file mode 100644
index 76503f6..0000000
--- a/doc/help/txt/srf-load-help.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Usage:
-
-srf-load <help>
-srf-load [ <options> ] <input-spec> <spot-descriptor> <output-spec> [ <verbosity> ] 
-
-input-spec:
-  ( -r | --run-xml ) path           # path to run.xml describing input files
-
-spot-descriptor:
-  ( -e | --experiment ) path            # path to experiment.xml 
-                                        # with spot descriptor
-
-output-spec:
-  <output-mode> <run-name>           # produce output to run
-
-output-mode:
-  -c | --create                      # create only new run (fail if exists)
-  -o | --output                      # create new or replace existing run
-  -a | --append                      # create new or update existing run
-
-run-name:
-  path                                  # full or working-directory relative
-                                        # file-system path to run
-
-options:
-  ( -n | --spotnumber) spots_to_run    # tells the loader to stop processing after that many spots
-                                       # helpful in testing
-
-  ( -b | --bad-spot-number ) bad_spot_number  # number of spot creation errors to be tolerated
-                                              # default = 50
-
-  ( -p | --bad-spot-percentage ) bad_spot_percentage> # PERCENTAGE of the number of bad spots against
-                                                      # the number of good spots, default = 5
-
-help:
-  ( -h | --help )                       # print usage and option details
-
-verbosity:
-  ( -l | --log-level ) <level>  #logging level: fatal|sys|int|err|warn|info default=info
-debug:
-  ( -+ | --debug ) <module>  #module: APP|KFS|XML|VDB|SRA|REF|LEGREF default=APP
diff --git a/doc/help/txt/txt2kdb-help.txt b/doc/help/txt/txt2kdb-help.txt
deleted file mode 100644
index 1db8875..0000000
--- a/doc/help/txt/txt2kdb-help.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-
- txt2kdb [Options] FILE KCOLUMN
-    Create a KColumn physical column out of a text file.
-
-    FILE:
-        The text file should be ASCII or UTF-8 using LF, CR or CR-LF
-        line termination.  Each text line will be put into the
-        KColumn as a separate Row.  Each Row will be in its own
-        blob.
-    KCOLUMN:
-        The KColumn is either an existing KColumn or a path to one
-        that can be created.    Both paths should be relative to the current directory or full
-    from root "/"
-
-Options:
-  -b, --begin=START         include only lines starting from this line in the
-                            KColumn.  The first line is line 1 (not 0).
-  -e, --end=STOP            stop including lines after this line in the
-                            KColumn.  The first line is line 1 (not 0).
-  -f, --force               (no parameter) this will cause to over-write
-                            existing files.  Without
-                            this option the program will fail if the KColumn
-                            already exists and append mode is not selected
-  -a, --append              (no parameter) this will cause to append the text
-                            file to an existing KColumn.  If the file does not
-                            already exist it will be created.
-  -V, --version             this will cause the program to emit the internal
-                            version number before any other action
-  -v, --verbose             extra information will be output during
-                            processing second occurrence on the command line
-                            means even more
-  -h, -?, --help            print this message
-  -l, --log-level=LEVEL     the next token will affect the logging level of
-                            the program  accepted tokens are the numbers
-                            0-15, fatal, sys, int, err, warn, info
-                          , debug1...debug10
diff --git a/doc/help/txt/vdb-dump-help.txt b/doc/help/txt/vdb-dump-help.txt
deleted file mode 100644
index 34195ff..0000000
--- a/doc/help/txt/vdb-dump-help.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-**************************************************************
-vdb-dump:
-**************************************************************
-usage:
-    vdb-dump database-path -Ttable -Rrows -Ccolumns [options]
-    table.......Tab1 or omit for first table in database
-    rows........1-100,200,205,300-305 or omit for all rows
-    columns.....COL1,COL2,COL3 or omit for all available columns
-
-example: vdb-dump mydb -TTab1 -R1-200 -CLINE,ID
-**************************************************************
-options:
---table -T        ... specify the table-name (mandatory)
---rows -R         ... specify the row-range (default all)
---columns -C      ... specify the columns (default all)
---schema -S       ... specify a schema to use (default none)
---help -h -?      ... show help
---row_id_on -I    ... print row id (default off)
---line_feed -l    ... line-feed's inbetween rows (default 1)
---colname_off -N  ... print column-names (default on)
---in_hex -X       ... prints valuex in hex (default decimal)
---schema_dump -A  ... dumps the schema instead of the data
---table_enum -E   ... list the found tables in the database
---version -V      ... show manager-version before dumping
---column_enum -O  ... list the columns of the specified table
---dna_bases -D    ... print DNA-bases (if column-type fits)
---max_length -M   ... limits the lenght of a line (default no limit)
---indent_width -i ... indents the line (default no indentation)
---filter -F       ... prints only lines which fit the filter-expr.
---format -f       ... uses default/csv/xml/json
---id_range -r     ... prints the id-range of the table
---without_sra -n  ... does not translate SRA-types
---no_accession -a ... do not check accession
-**************************************************************
diff --git a/interfaces/align/align-access.h b/interfaces/align/align-access.h
deleted file mode 100644
index 75f92ea..0000000
--- a/interfaces/align/align-access.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_align_align_access_
-#define _h_align_align_access_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VPath;
-
-
-/*--------------------------------------------------------------------------
- * constants
- */
-typedef uint8_t AlignmentStrandDirection;
-enum
-{
-    asd_Unknown, /* e.g. an error occured */
-    asd_Forward = 'F',
-    asd_Reverse = 'R'
-};
-
-
-/*--------------------------------------------------------------------------
- * AlignAccessMgr
- *  opaque handle to library
- */
-typedef struct AlignAccessMgr AlignAccessMgr;
-
-/* Make
- *  make a manager for read-only access
- */
-ALIGN_EXTERN rc_t CC AlignAccessMgrMake ( const AlignAccessMgr **mgr );
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignAccessMgrAddRef ( const AlignAccessMgr *self );
-ALIGN_EXTERN rc_t CC AlignAccessMgrRelease ( const AlignAccessMgr *self );
-
-
-
-/*--------------------------------------------------------------------------
- * AlignAccessDB
- *  opaque handle to database
- */
-typedef struct AlignAccessDB AlignAccessDB;
-
-/* Make
- *  make a read-only database handle from BAM file
- *  where the BAM file is treated as the entire database
- *
- *  "bam" [ IN ] - NUL terminated POSIX path in UTF-8 character set
- *  designating BAM file
- *
- *  "bam_index" [ IN ] - NUL terminated POSIX path in UTF-8 character
- *  set designating BAM index file
- *
- * NB - on Windows, these paths should be converted POSIX-style
- */
-ALIGN_EXTERN rc_t CC AlignAccessMgrMakeBAMDB ( const AlignAccessMgr *self,
-    const AlignAccessDB **db, struct VPath const *bam );
-ALIGN_EXTERN rc_t CC AlignAccessMgrMakeIndexBAMDB ( const AlignAccessMgr *self,
-    const AlignAccessDB **db, struct VPath const *bam, struct VPath const *bam_index );
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignAccessDBAddRef ( const AlignAccessDB *self );
-ALIGN_EXTERN rc_t CC AlignAccessDBRelease ( const AlignAccessDB *self );
-
-
-
-/*--------------------------------------------------------------------------
- * AlignAccessRefSeqEnumerator
- *  an enumerator onto available reference sequences
- */
-typedef struct AlignAccessRefSeqEnumerator AlignAccessRefSeqEnumerator;
-
-
-/* EnumerateRefSequences
- *  make an enumerator of reference sequences visible in database
- *
- *  "refseq_enum" [ OUT ] - return parameter for enumerator
- */
-ALIGN_EXTERN rc_t CC AlignAccessDBEnumerateRefSequences ( const AlignAccessDB *self,
-    AlignAccessRefSeqEnumerator **refseq_enum );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorAddRef ( const AlignAccessRefSeqEnumerator *self );
-ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorRelease ( const AlignAccessRefSeqEnumerator *self );
-
-/* advance the enumerator to the next element */
-ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorNext(const AlignAccessRefSeqEnumerator *cself);
-
-/* GetID
- *  get text id of reference sequence
- *
- *  "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
- *  NUL terminated ASCII id
- *
- *  "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
- */
-ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorGetID ( const AlignAccessRefSeqEnumerator *self,
-    char *id_buffer, size_t buffer_size, size_t *id_size );
-    
-/* GetLength
- *  get text id of reference sequence
- */
-ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorGetLength
-    ( const AlignAccessRefSeqEnumerator *self, uint64_t *length );
-
-
-/*--------------------------------------------------------------------------
- * AlignAccessAlignmentEnumerator
- *  an enumerator onto alignments
- */
-typedef struct AlignAccessAlignmentEnumerator AlignAccessAlignmentEnumerator;
-
-
-/* EnumerateAlignments
- *  make an enumerator of all alignments in database
- *
- *  "align_enum" [ OUT ] - return parameter for enumerator
- *
- * NB - this is a BAD interface, here only to support dumping a BAM file
- *  it may not be available under all circumstances
- */
-ALIGN_EXTERN rc_t CC AlignAccessDBEnumerateAlignments ( const AlignAccessDB *self,
-    AlignAccessAlignmentEnumerator **align_enum );
-
-
-/* WindowedAlignments
- *  make an enumerator of alignments within a window of a reference sequence
- *
- *  "align_enum" [ OUT ] - return parameter for enumerator
- *
- *  "refseq_id" [ IN ] - NUL terminated ASCII string giving reference sequence id
- *
- *  "pos" [ IN ] and "wsize" [ IN ] - starting position and size of window
- *  on reference sequence
- */
-ALIGN_EXTERN rc_t CC AlignAccessDBWindowedAlignments ( const AlignAccessDB *self,
-    AlignAccessAlignmentEnumerator **align_enum, const char *refseq_id,
-    uint64_t pos, uint64_t wsize );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorAddRef ( const AlignAccessAlignmentEnumerator *self );
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorRelease ( const AlignAccessAlignmentEnumerator *self );
-
-
-/* Next
- * advance the enumerator to the next element
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorNext ( const AlignAccessAlignmentEnumerator *self );
-
-
-/* GetRefSeqID
- *  return id of reference sequence
- *
- *  "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
- *  NUL terminated ASCII id
- *
- *  "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqID ( const AlignAccessAlignmentEnumerator *self,
-    char *id_buffer, size_t buffer_size, size_t *id_size );
-
-
-/* GetRefSeqPos
- *  return starting position of alignment on reference sequence
- *
- *  "start_pos" [ OUT ] - return parameter for starting position
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqPos ( const AlignAccessAlignmentEnumerator *self,
-    uint64_t *start_pos );
-
-    
-/* GetShortSeqID
- *  return accession id of aligned short sequence
- *
- *  "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
- *  NUL terminated ASCII id
- *
- *  "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqAccessionID
-    ( const AlignAccessAlignmentEnumerator *self, char *id_buffer, size_t buffer_size, size_t *id_size );
-
-    
-/* GetShortSeqID
- *  return id of aligned short sequence
- *
- *  "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
- *  NUL terminated ASCII id
- *
- *  "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqID
-    ( const AlignAccessAlignmentEnumerator *self, char *id_buffer, size_t buffer_size, size_t *id_size );
-
-
-/* GetMapQuality
- *  return sequence alignment mapping quality score
- *
- *  "score" [ OUT ] - return parameter for mapping quality score (phred-like)
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetMapQuality ( const AlignAccessAlignmentEnumerator *self,
-                                             uint8_t *score );
-    
-/* GetCIGAR
- *  return sequence alignment information
- *
- *  "start_pos" [ OUT, NULL OKAY ] - return parameter for starting position
- *
- *  "cigar_buffer" [ IN, NULL OKAY ] and "buffer_size" [ IN ] - return buffer for CIGAR NUL-terminated
- *  alignment description; null okay if cigar_size not null
- *  
- *  "cigar_size" [ OUT, NULL OKAY ] - optional return parameter for CIGAR string length; null ok
- *  if cigar_buffer not null
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetCIGAR ( const AlignAccessAlignmentEnumerator *self,
-    uint64_t *start_pos, char *cigar_buffer, size_t buffer_size, size_t *cigar_size );
-
-
-/* GetShortSequence
- *  return short sequence
- *
- *  "seq_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for short sequence
- *  
- *  "seq_size" [ OUT ] - return parameter for sequence length
- *
- * NB - BAM states that the sequence will be bases in FASTA.
- *  we will be extending this interface to provide type information
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSequence ( const AlignAccessAlignmentEnumerator *self,
-    char *seq_buffer, size_t buffer_size, size_t *seq_size );
-
-
-/* GetStrandDirection
- *  returns property
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetStrandDirection
-    ( const AlignAccessAlignmentEnumerator *self, AlignmentStrandDirection *result );
-
-    
-/* GetIsPaired
- *  returns paired property
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsPaired
-    ( const AlignAccessAlignmentEnumerator *self, bool *result );
-
-/* GetIsFirstInPair
- *  get property
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsFirstInPair
-    ( const AlignAccessAlignmentEnumerator *self, bool *result );
-
-/* GetIsSecondInPair
- *  get property
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsSecondInPair
-    ( const AlignAccessAlignmentEnumerator *self, bool *result );
-
-    
-/* GetRecordID
- *  get property
- *
- * A locally unique identifier for each record.  When enumerators from the same
- * AlignAccessDB object fetch the same record, they will return the same ID.
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRecordID
-    ( const AlignAccessAlignmentEnumerator *self, uint64_t *result );
-    
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_align_access_ */
diff --git a/interfaces/align/align.vschema b/interfaces/align/align.vschema
deleted file mode 100644
index d7c35c9..0000000
--- a/interfaces/align/align.vschema
+++ /dev/null
@@ -1,1487 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB Alignment types, functions and tables
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/seq.vschema';
-include 'ncbi/sra.vschema';
-include 'ncbi/stats.vschema';
-include 'align/seq.vschema';
-include 'align/qstat.vschema';
-
-
-/*--------------------------------------------------------------------------
- * data types
- */
-
-/* ploidy
- *  the number of sets of chromosomes in a cell
- */
-typedef U32 NCBI:align:ploidy;
-
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-
-/* cigar
- *  construct "cigar" alignment string or length arrays
- *
- * "ctype" [ CONST ] - select variant of format
- *   0 => both matches and mismatches represented as M
- *   1 => matches represented as '=' mismatches as 'X'
- *
- *  "has_mismatch" [ DATA ] - a boolean for each base in aligned sequence
- *   where a value of false means the base aligned to the reference
- *
- *  "has_ref_offset" [ DATA ] - a boolean for each base in the aligned sequence
- *   where a value of true means there is a corresponding offset to position on reference
- *
- *  "ref_offset" [ DATA ] - a packed sequence of signed offsets to aligned position
- *   one entry for every true in "has_ref_offset"
- *
- *  "read_len" [ DATA ] - v2: elem_count defines PLOIDY and values are an actual length of reads in spot
- */
-extern function 
-ascii NCBI:align:cigar #1 < U8 ctype > ( bool has_mismatch, bool has_ref_offset,
-    I32 ref_offset, * INSDC:coord:len ref_len ) = ALIGN:cigar;
-
-extern function < type T >
-T NCBI:align:cigar #2 < U8 ctype > ( bool has_mismatch, bool has_ref_offset,
-      I32 ref_offset, INSDC:coord:len read_len, * INSDC:coord:len ref_len ) = ALIGN:cigar_2;
-
-extern function U32 NCBI:align:edit_distance #1
-    ( bool has_mismatch, bool has_ref_offset, I32 ref_offset );
-    
-extern function U32 NCBI:align:edit_distance #2
-    ( bool has_mismatch, bool has_ref_offset, I32 ref_offset, INSDC:coord:len ref_len, *INSDC:coord:len read_len)
-  = NCBI:align:edit_distance_2;
-
-/* project_from_sequence
- *  projects column from SEQUENCE
- *
- *  "T" [ TYPE ]
- *
- *  "col" [ CONST ]
- *  "use_read_len" [ CONST ] whether subset by read_len or by read_id only
- *
- *  "seq_spot_id" [ DATA ]
- *
- *  "seq_read_id" [ DATA ]
- */
-extern function < type T >
-T NCBI:align:project_from_sequence #1 < ascii col> ( I64 seq_spot_id, INSDC:coord:one seq_read_id )
-    = ALIGN:project_from_sequence;
-
-
-/* align_restore_read
- *  restores read by applying alignment-based difference to ref_read
- *
- *  "ref_read" [ DATA ]
- *
- *  "has_mismatch" [ DATA ] and "mismatch" [ DATA ]
- *
- *  "has_ref_offset" [ DATA ] and "ref_offset" [ DATA ]
- */
-extern function
-INSDC:4na:bin NCBI:align:align_restore_read #1 ( INSDC:4na:bin ref_read, bool has_mismatch,
-        INSDC:4na:bin mismatch, bool has_ref_offset, I32 ref_offset * INSDC:coord:len read_len)
-    = ALIGN:align_restore_read;
-
-
-/* raw_restore_read
- *  restores read by applying alignment-based difference to align_read
- *
- *  "align_read" [ DATA ]
- *
- *  "ref_orientation" [ DATA ]
- */
-extern function
-INSDC:4na:bin NCBI:align:raw_restore_read #1 ( INSDC:4na:bin align_read, bool ref_orientation )
-    = ALIGN:raw_restore_read;
-
-
-/* raw_restore_qual
- *  restores quality by applying alignment-based difference to align_qual
- *
- *  "align_qual" [ DATA ]
- *
- *  "ref_orientation" [ DATA ]
- */
-extern function
-INSDC:quality:phred NCBI:align:raw_restore_qual #1 ( INSDC:quality:phred align_qual, bool ref_orientation );
-
-
-/* ref_sub_select
- *  projects reference from sequence
- *
- *  "id" [ DATA ]
- *
- *  "start" [ DATA ] and "len" [ DATA ]
- *
- *  "ref_ploidy" [ DATA, OPTIONAL ]
- */
-extern function
-INSDC:4na:bin NCBI:align:ref_sub_select #1 ( I64 id, INSDC:coord:zero start,
-        INSDC:coord:len len * U32 ref_ploidy)
-    = ALIGN:ref_sub_select;
-
-
-/* ref_restore_read
- *  restores read from central storage
- *
- *  "cmp_rd" [ DATA ]
- *
- *  "seq_id" [ DATA ]
- *
- *  "seq_start" [ DATA ] and "seq_len" [ DATA ]
- */
-extern function
-INSDC:4na:bin NCBI:align:ref_restore_read #1 ( INSDC:4na:bin cmp_rd, ascii seq_id,
-        INSDC:coord:one seq_start, INSDC:coord:len seq_len)
-    = ALIGN:ref_restore_read;
-
-
-/* seq_restore_read
- *  projects read from align_deflate table to SEQUENCE
- *
- *  "cmp_rd" [ DATA ]
- *
- *  "align_id" [ DATA ]
- *
- *  "read_len" [ DATA ]
- *
- *  "rd_type" [ DATA ]
- */
-extern function
-INSDC:4na:bin NCBI:align:seq_restore_read #1 ( INSDC:4na:bin cmp_rd, I64 align_id,
-        INSDC:coord:len read_len, INSDC:SRA:xread_type rd_type )
-    = ALIGN:seq_restore_read;
-
-
-/* generate_has_mismatch
- *  generates has mismatch by doing actual compare of reference and subject,
- *  *ref_offsets move comparisons reference-wise
- *
- *  "reference" [ DATA ]
- *
- *  "subject" [ DATA ]
- *
- *  "has_ref_offset" [ DATA ]
- *
- *  "ref_offset" [ DATA ]
- */
-extern function
-bool NCBI:align:generate_has_mismatch #1 ( INSDC:4na:bin reference,
-       INSDC:4na:bin subject, bool has_ref_offset, I32 ref_offset)
-    = ALIGN:generate_has_mismatch;
-
-
-/* generate_mismatch
- *
- *  "reference" [ DATA ]
- *
- *  "subject" [ DATA ]
- *
- *  "has_ref_offset" [ DATA ]
- *
- *  "ref_offset" [ DATA ]
- */
-extern function
-INSDC:4na:bin NCBI:align:generate_mismatch #1 ( INSDC:4na:bin reference,
-        INSDC:4na:bin subject, bool has_ref_offset, I32 ref_offset )
-        = ALIGN:generate_mismatch;
-
-
-/* ref_pos
- *  retrieves the alignment's positions on the reference
- *  one per PLOIDY
- *
- *  "ref_id" [ DATA ]
- *
- *  "ref_start" [ DATA ] - one per PLOIDY
- */
-extern function
-INSDC:coord:zero NCBI:align:ref_pos #1 ( I64 ref_id, INSDC:coord:zero ref_start );
-
-
-/* ref_name
- *  retrieve the name from the reference
- *
- *  "ref_id" [ DATA ]
- */
-extern function
-ascii NCBI:align:ref_name #1 ( I64 ref_id );
-
-
-/* ref_seq_id
- *  retrieve the seq_id from the reference
- *
- *  "ref_id" [ DATA ]
- */
-extern function
-ascii NCBI:align:ref_seq_id #1 ( I64 ref_id );
-
-
-/* local_ref_id
- *  convert global ref_start into ref_id
- */
-extern function
-I64 NCBI:align:local_ref_id #1 ( U64 global_ref_start );
-
-
-/* global_ref_id
- *  convert global ref_start into ref_id
- */
-extern function
-INSDC:coord:zero NCBI:align:local_ref_start #1 ( U64 global_ref_start );
-
-/* not_my_row
- *  removes current row_id from the list
- */
-extern function I64 NCBI:align:not_my_row #1 ( I64 list );
-
-/* template_len
- *  compute template length, i.e. the distance from the left-most to the
- *  right-most matching reference position
- */
-extern function I32 NCBI:align:template_len #1 (
-    INSDC:coord:zero pos, INSDC:coord:zero mate_pos,
-    INSDC:coord:len  reflen, INSDC:coord:len mate_reflen,
-    ascii ref_name, ascii mate_ref_name, INSDC:coord:one read_id);
-
-/* get_sam_flags
- *  compute the flags that would be in a SAM file
- *
- * version 1 works with full Alignment databases.
- * version 2 works with Alignment databases that have had SEQUENCE removed.
- */
-extern function U32 NCBI:align:get_sam_flags #1 (
-    INSDC:coord:len read_len, INSDC:coord:one read_id, I32 template_len,
-    bool strand, bool mate_strand, bool is_secondary, * INSDC:SRA:read_filter filter);
-
-extern function U32 NCBI:align:get_sam_flags #2 (
-    I64 mate_id, INSDC:coord:one read_id, I32 template_len,
-    bool strand, bool mate_strand, bool is_secondary, * INSDC:SRA:read_filter filter)
-  = NCBI:align:get_sam_flags_2;
-
-/* get_left_soft_clip
- *  compute the length of the soft clip on the left edge of the alignment
- */
-extern function INSDC:coord:len NCBI:align:get_left_soft_clip #1
-    ( bool has_ref_offset, I32 ref_offset );
-
-extern function INSDC:coord:len NCBI:align:get_left_soft_clip #2
-    ( bool has_ref_offset, I32 ref_offset, INSDC:coord:len read_len )
-   = NCBI:align:get_left_soft_clip_2;
-
-/* get_right_soft_clip
- *  compute the length of the soft clip on the right edge of the alignment
- */
-extern function INSDC:coord:len NCBI:align:get_right_soft_clip #1
-    ( bool has_mismatch, INSDC:coord:len left_clip * bool has_ref_offset );
-    
-extern function INSDC:coord:len NCBI:align:get_right_soft_clip #2
-    ( bool has_mismatch, INSDC:coord:len left_clip, bool has_ref_offset, I32 ref_offset )
-   = NCBI:align:get_right_soft_clip_2;
-
-extern function INSDC:coord:len NCBI:align:get_right_soft_clip #3
-    ( bool has_ref_offset, I32 ref_offset, INSDC:coord:len ref_len )
-   = NCBI:align:get_right_soft_clip_3;
-
-extern function INSDC:coord:len NCBI:align:get_right_soft_clip #4
-    ( bool has_ref_offset, I32 ref_offset, INSDC:coord:len read_len, INSDC:coord:len ref_len )
-   = NCBI:align:get_right_soft_clip_4;
-
-/* get_clipped_cigar
- *  compute the CIGAR string with the soft clipping removed
- */
-extern function ascii NCBI:align:get_clipped_cigar #1 ( ascii cigar );
-
-extern function < type T > 
-T NCBI:align:get_clipped_cigar #2 ( ascii cigar, INSDC:coord:len cigar_len ) = NCBI:align:get_clipped_cigar_2;
-
-/* get_clipped_ref_offset
- *  compute the reference offsets with the soft clipping removed
- */
-extern function I32 NCBI:align:get_clipped_ref_offset #1
-    ( bool has_ref_offset, I32 ref_offset );
-
-/* clip
- *  remove the soft clipped bases (or qualities, or has_mismatch, or cetera)
- *  works with things whose lengths are the same as SEQUENCE.READ
- */    
-extern function < type T > T NCBI:align:clip #1
-    ( T object, INSDC:coord:len left_clip, INSDC:coord:len right_clip);
-
-extern function < type T > T NCBI:align:clip #2
-    ( T object, INSDC:coord:len read_len, INSDC:coord:len left_clip, INSDC:coord:len right_clip)
-   = NCBI:align:clip_2;
-
-/* get_ref_len
- *  compute reference length from alignment information
- */
-extern function INSDC:coord:len NCBI:align:get_ref_len #1
-    ( bool has_ref_offset, I32 ref_offset, * INSDC:coord:len right_clip );
-
-/* get_mismatch_read
- *  generate the READ with matching bases replaced with '='
- */
-extern function ascii NCBI:align:get_mismatch_read #1
-    ( bool has_mismatch, INSDC:dna:text mismatch );
-
-/* get_ref_mismatch
- * shows mismatch positions in reference space
- */
-function bool NCBI:align:get_ref_mismatch #1
-    ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
-      INSDC:coord:len ref_len );
-
-/* get_ref_insert
- * shows positions of inserts in reference space
- * i.e. an insert occurs between each pair of true's
- */
-function bool NCBI:align:get_ref_insert #1
-    ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
-      INSDC:coord:len ref_len );
-
-/* get_ref_delete
- * shows positions of deleted bases in reference space
- */
-function bool NCBI:align:get_ref_delete #1
-    ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
-      INSDC:coord:len ref_len );
-
-extern function INSDC:quality:phred NCBI:align:compress_quality #1
-    ( INSDC:quality:phred quality, bool preserved );
-
-extern function INSDC:quality:phred NCBI:align:decompress_quality #1
-    < INSDC:quality:phred restored_qual_value >
-    ( INSDC:quality:phred cmp_quality, bool preserved );
-
-/* make_cmp_read_start
- *
- */
-extern function INSDC:coord:zero NCBI:align:make_read_start #1
-    (INSDC:coord:len read_len);
-
-/* make_cmp_read_desc
- *  determines whether an element of "operand" is aligned
- *  by looking at the corresponding element of "align_id"
- *
- *  zeros out unaligned elements of operand, unless "invert" is true,
- *  in which case it zeros out aligned elements.
- *
- *  "T" [ TYPE ] - type of operand
- *
- *  "invert" [ CONST ] - if true, invert the logic of which elements
- *  to zero out.
- *
- *  "operand" [ DATA ] - uncompressed data
- *
- *  "align_id" [ DATA ] - indication of alignment
- */
-extern function < type T >
-T NCBI:align:make_cmp_read_desc #1 <bool invert>(T operand, I64 align_id);
-
-/* seq_construct_read
- *  assembles read from aligned and unaligned parts
- */
-extern function < type T >
-T NCBI:align:seq_construct_read #1 (
-    T aligned, INSDC:coord:len aligned_read_len,
-    T unaligned, INSDC:coord:len unaligned_read_len );
-    
-extern function I64 NCBI:align:get_mate_align_id #1 ( I64 spot_id );
-
-/*--------------------------------------------------------------------------
- * tables
- */
-
-
-/* ref_block_cmn
- *  common implementation ancestor for reference block
- */
-table NCBI:align:tbl:ref_block_cmn #1.0.0
-{
-    readonly column ascii REF_TABLE
-        = < ascii > meta:read < "CONFIG/REF_TABLE" > ()
-        | < ascii > echo < 'REFERENCE' > ();
-
-    // REF_ID is rowid in Reference Table REF_TABLE
-    extern column I64 REF_ID
-        = out_ref_id;
-    
-    // this is a redefinition of REF_START
-    // REF_START is the offset within REFERENCE.READ
-    extern column INSDC:coord:zero REF_START
-        = out_ref_start;
-
-    // global REF_START
-    extern column U64 GLOBAL_REF_START
-        = out_global_ref_start;
-
-    // REF_LEN the length of a read projection on reference
-    INSDC:coord:len out_ref_len_internal
-        = NCBI:align:get_ref_len ( out_has_ref_offset, out_ref_offset );
-
-    INSDC:coord:len out_ref_len
-        = .REF_LEN
-        | NCBI:align:get_ref_len ( out_has_ref_offset, out_ref_offset, out_right_clip )
-        | out_ref_len_internal;
-        
-    physical column < INSDC:coord:len > izip_encoding .REF_LEN = REF_LEN;
-    extern column INSDC:coord:len REF_LEN = out_ref_len;
-
-    // REF_ORIENTATION - relative orientation of original raw read to the reference
-    // false -> same orientation, true -> opposite orientation
-    // alignment and reference are always in the same orientation 
-    extern column bool_encoding REF_ORIENTATION;
-
-    // REF_PLOIDY
-    extern column < U32 > izip_encoding REF_PLOIDY;
-
-    /* REF_POS
-     *  per PLOIDY
-     */
-    readonly column INSDC:coord:zero REF_POS
-        = NCBI:align:ref_pos ( out_ref_id, out_ref_start );
-
-    /* REF_NAME
-     *  the name of the reference
-     */
-    readonly column ascii REF_NAME
-        = NCBI:align:ref_name ( out_ref_id );
-
-    /* REF_SEQ_ID
-     */
-    readonly column ascii REF_SEQ_ID
-        = NCBI:align:ref_seq_id ( out_ref_id )
-        | < ascii > echo < '' > ();
-};
-
-
-/* global_ref_block
- *  reference block favoring global ref-start
- */
-table NCBI:align:tbl:global_ref_block #1.0.0
-    = NCBI:align:tbl:ref_block_cmn #1.0.0
-{
-    U64 out_global_ref_start = .GLOBAL_REF_START;
-    physical < U64 > izip_encoding .GLOBAL_REF_START = GLOBAL_REF_START;
-
-    I64 out_ref_id = NCBI:align:local_ref_id ( .GLOBAL_REF_START );
-    INSDC:coord:zero out_ref_start = NCBI:align:local_ref_start ( .GLOBAL_REF_START );
-};
-
-
-/* local_ref_block
- *  reference block favoring local ref-start
- */
-table NCBI:align:tbl:local_ref_block #1.0.0
-    = NCBI:align:tbl:ref_block_cmn #1.0.0
-{
-    I64 out_ref_id = .REF_ID;
-    physical < I64 > izip_encoding .REF_ID = REF_ID;
-
-    INSDC:coord:zero out_ref_start = .REF_START;
-    physical < INSDC:coord:zero > izip_encoding .REF_START = REF_START;
-};
-
-
-/* align_cmn
- *  common interface and implementation for alignment object
- */
-table NCBI:align:tbl:align_cmn #2
-    = NCBI:tbl:base_space_common #1.0.3
-    , NCBI:SRA:tbl:stats #1.2.0
-    , NCBI:align:tbl:ref_block_cmn #1.0.0
-{
-    bool is_secondary = out_is_secondary;
-// temporary key
-    extern column < U32 > izip_encoding TMP_KEY_ID;
-
-
-/* Raw Sequence Block */
-    // Points to sequence table, which may contain more information about the raw sequence.
-    // row id in SEQUENCE table; 0 if not linked
-    extern column < I64 > izip_encoding SEQ_SPOT_ID;
-
-    // read number in SEQUENCE table; { SEQ_SPOT_ID, SEQ_READ_ID } is the unique link to the sequence
-    extern column < INSDC:coord:one > izip_encoding SEQ_READ_ID;
-    
-
-/* Soft-Clipped data block */
-
-    readonly column INSDC:coord:len LEFT_SOFT_CLIP
-        = NCBI:align:get_left_soft_clip ( HAS_REF_OFFSET, REF_OFFSET, out_read_len );
-        
-    INSDC:coord:len out_right_clip
-        = NCBI:align:get_right_soft_clip #4 ( out_has_ref_offset, out_ref_offset, out_read_len, out_ref_len )
-        | NCBI:align:get_right_soft_clip #3 ( out_has_ref_offset, out_ref_offset, out_ref_len )
-        | NCBI:align:get_right_soft_clip #2 ( out_has_mismatch, LEFT_SOFT_CLIP, out_has_ref_offset, out_ref_offset );
-    readonly column INSDC:coord:len RIGHT_SOFT_CLIP = out_right_clip;
-        
-    readonly column ascii CLIPPED_CIGAR_LONG
-        = < ascii > NCBI:align:get_clipped_cigar ( CIGAR_LONG, CIGAR_LONG_LEN );
-
-    readonly column INSDC:coord:len CLIPPED_CIGAR_LONG_LEN
-        = < INSDC:coord:len > NCBI:align:get_clipped_cigar ( CIGAR_LONG, CIGAR_LONG_LEN );
-
-    readonly column ascii CLIPPED_CIGAR_SHORT
-        = < ascii > NCBI:align:get_clipped_cigar ( CIGAR_SHORT, CIGAR_SHORT_LEN );
-        
-    readonly column INSDC:coord:len CLIPPED_CIGAR_SHORT_LEN
-        = < INSDC:coord:len > NCBI:align:get_clipped_cigar ( CIGAR_SHORT, CIGAR_SHORT_LEN );
-
-    bool out_clipped_has_mismatch
-        = < bool > NCBI:align:clip (out_has_mismatch, out_read_len, LEFT_SOFT_CLIP, RIGHT_SOFT_CLIP);
-        
-    readonly column ascii CLIPPED_HAS_MISMATCH
-        = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_clipped_has_mismatch );
-
-    readonly column bool CLIPPED_HAS_MISMATCH = out_clipped_has_mismatch;
-
-    bool out_clipped_has_ref_offset
-        = < bool > NCBI:align:clip (HAS_REF_OFFSET, out_read_len, LEFT_SOFT_CLIP, RIGHT_SOFT_CLIP);
-
-    readonly column ascii CLIPPED_HAS_REF_OFFSET
-        = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_clipped_has_ref_offset );
-
-    readonly column bool CLIPPED_HAS_REF_OFFSET = out_clipped_has_ref_offset;
-
-    // TBD cannot be computed right unless HAS_MISMATCH and! READ_LEN is used
-    readonly column INSDC:dna:text CLIPPED_MISMATCH
-        = < INSDC:dna:text > NCBI:align:clip #1 ( out_mismatch_dna_text, LEFT_SOFT_CLIP, RIGHT_SOFT_CLIP);
-
-    readonly column I32 CLIPPED_REF_OFFSET
-        = NCBI:align:get_clipped_ref_offset ( HAS_REF_OFFSET, REF_OFFSET );
-        
-    readonly column INSDC:quality:phred CLIPPED_QUALITY
-        = < INSDC:quality:phred > NCBI:align:clip (out_qual_phred, out_read_len, LEFT_SOFT_CLIP, RIGHT_SOFT_CLIP);
-        
-    readonly column INSDC:dna:text CLIPPED_READ
-        = < INSDC:dna:text > NCBI:align:clip (READ, out_read_len, LEFT_SOFT_CLIP, RIGHT_SOFT_CLIP);
-
-/* Sequence Block */
-
-    extern column < NCBI:align:ploidy > izip_encoding PLOIDY;
-
-    // Number of reads per spot; corresponds to the number of alternative alignments
-    // all alternative alignments are computed against the same reference region
-    U32 out_nreads
-        = .PLOIDY
-        | < U32 > echo < 1 > ();
-
-    // READ_START and READ_LEN are position and length of the sequence
-    physical < INSDC:coord:zero > izip_encoding .READ_START = READ_START;
-    INSDC:coord:zero out_read_start
-        = .READ_START
-        | < INSDC:coord:zero > echo < 0 > ();
-
-    physical < INSDC:coord:len > izip_encoding .READ_LEN = READ_LEN;
-
-    INSDC:coord:len align_spot_len = ( INSDC:coord:len ) row_len ( out_has_ref_offset );
-    INSDC:coord:len out_read_len
-        = .READ_LEN 
-        | align_spot_len;
-
-    // associated qualities
-    extern column INSDC:quality:phred CMP_QUALITY
-        = .CMP_QUALITY
-        | out_cmp_quality;
-    physical column < INSDC:quality:phred > zip_encoding .CMP_QUALITY = CMP_QUALITY;
-        
-    INSDC:quality:phred out_raw_qual = < INSDC:quality:phred >
-        NCBI:align:project_from_sequence < '( INSDC:quality:phred ) QUALITY'> ( .SEQ_SPOT_ID, .SEQ_READ_ID );
-    INSDC:quality:phred out_qual_phred
-        = NCBI:align:raw_restore_qual ( out_raw_qual, .REF_ORIENTATION )
-        | < INSDC:quality:phred > echo < 30 > ( out_4na_bin );
-    readonly column INSDC:quality:text:phred_33 SAM_QUALITY = QUALITY ;
-
-    // project read group and name
-    ascii out_spot_group = < ascii > simple_sub_select < 'SEQUENCE','SPOT_GROUP'> (.SEQ_SPOT_ID);
-
-
-    INSDC:SRA:spotid_t tmp_seq_spot_id
-        = cast ( .SEQ_SPOT_ID )
-        ;
-    physical <ascii> zip_encoding .SEQ_NAME = SEQ_NAME;
-    extern column ascii SEQ_NAME
-        = .SEQ_NAME
-        | < ascii > simple_sub_select < 'SEQUENCE','NAME'> (.SEQ_SPOT_ID)
-        | sprintf < "%u" > ( tmp_seq_spot_id );
-
-    // compute sam flags
-    /* blows up parser: starts at schema-tbl.c:2138
-    readonly column U32 SAM_FLAGS = NCBI:align:get_sam_flags(MATE_ALIGN_ID,
-        .SEQ_READ_ID, out_template_len, REF_ORIENTATION,
-        out_mate_ref_orientation, is_secondary);
-    */
-    INSDC:coord:len projected_read_len
-        = < INSDC:coord:len > simple_sub_select < 'SEQUENCE', 'READ_LEN' > ( .SEQ_SPOT_ID );
-    
-    readonly column U32 SAM_FLAGS
-        = NCBI:align:get_sam_flags #1 (projected_read_len,
-            .SEQ_READ_ID, out_template_len, REF_ORIENTATION,
-            out_mate_ref_orientation, is_secondary, out_rd_filter)
-        | NCBI:align:get_sam_flags #2 (out_mate_align_id,
-            .SEQ_READ_ID, out_template_len, REF_ORIENTATION,
-            out_mate_ref_orientation, is_secondary, out_rd_filter);
-
-    ascii out_name_fmt = < ascii > echo < '$R' > ();
-
-    INSDC:coord:zero trim_start
-        = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len trim_len
-        = align_spot_len;
-
-    ascii out_label
-        = .LABEL
-        | < ascii > echo < "ploidy1" > ();
-    INSDC:coord:zero out_label_start
-        = .LABEL_START
-        | < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len out_label_len
-        = .LABEL_LEN
-        | < INSDC:coord:len > echo < 7 > ();
-
-    physical < INSDC:SRA:read_filter > zip_encoding .RD_FILTER = READ_FILTER;
-    INSDC:SRA:read_filter out_rd_filter
-        = .RD_FILTER
-        | < INSDC:SRA:read_filter > NCBI:align:project_from_sequence < 'READ_FILTER' > ( .SEQ_SPOT_ID, .SEQ_READ_ID ) 
-        | < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ( out_read_len );
-
-    INSDC:SRA:platform_id out_platform
-        = .PLATFORM
-        | < INSDC:SRA:platform_id > simple_sub_select < 'SEQUENCE','PLATFORM'> (.SEQ_SPOT_ID)
-        | < INSDC:SRA:platform_id > echo < SRA_PLATFORM_UNDEFINED > ();
-
-    U8 out_alignment_count = <U8> NCBI:align:project_from_sequence < 'ALIGNMENT_COUNT' > ( .SEQ_SPOT_ID, .SEQ_READ_ID );
-
-    /* out_read_type
-     *  set to SRA_READ_TYPE_FORWARD + SRA_READ_TYPE_BIOLOGICAL
-     *  which has a constant value of 3
-     */
-    INSDC:SRA:xread_type out_read_type
-        = < INSDC:SRA:xread_type > echo < 3 > ( out_read_len );
-
-    // stats inputs    
-    bool in_stats_bin = HAS_REF_OFFSET;
-    
-    INSDC:coord:len _alt_in_read_len
-        = READ_LEN
-        | ( INSDC:coord:len ) row_len #1 ( HAS_REF_OFFSET );
-
-    INSDC:SRA:xread_type _alt_in_read_type
-        = READ_TYPE
-        | < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > (_alt_in_read_len);
-        
-    readonly column ascii MISMATCH_READ
-        = NCBI:align:get_mismatch_read ( out_has_mismatch, out_mismatch_dna_text );
-        
-/* Alignment block */
-
-    // MAPQ - single value quality of the mapping; the scale is submitter specific
-    extern column < I32 > izip_encoding MAPQ;
-
-    extern column INSDC:coord:zero MATE_REF_POS = out_mate_ref_pos;
-    extern column INSDC:coord:len MATE_REF_LEN = out_mate_ref_len;
-    extern column I64 MATE_REF_ID = out_mate_ref_id;
-    extern column I32 TEMPLATE_LEN = out_template_len;
-    extern column bool MATE_REF_ORIENTATION = out_mate_ref_orientation;
-    readonly column ascii MATE_REF_NAME = NCBI:align:ref_name ( out_mate_ref_id );
-    readonly column ascii MATE_REF_SEQ_ID = NCBI:align:ref_seq_id( out_mate_ref_id );
-    readonly column U8 ALIGNMENT_COUNT  = out_alignment_count;
-
-
-/********************************
-* Columns representing CIGARs
-********************************/
-
-
-    // one value per base i.e. length is same as sum of READ_LEN
-    // partitioned by READ_START and READ_LEN into alternative alignments
-    // flags the shifts in reference position preceeding the base
-    // if sequence of a partitioned read starts with a ref_offset and one or more mismatches
-    // then it represents a left soft clip
-    // any run of mismatches at the end represents a right soft clip
-
-    readonly column ascii HAS_REF_OFFSET =  < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_has_ref_offset );
-    extern column bool_encoding HAS_REF_OFFSET;
-    bool out_has_ref_offset = .HAS_REF_OFFSET;
-    
-    // has number of elements equal to number of true elements in HAS_REF_OFFSET
-    extern column < I32 > izip_encoding REF_OFFSET;
-    I32 out_ref_offset = .REF_OFFSET;
-
-    // DISPLAY Columns
-
-    readonly column I64 ALIGN_ID = row_id ();
-
-    // get projection of the reference
-    readonly column INSDC:dna:text REF_READ
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( REF_READ );
-
-    readonly column INSDC:4na:bin REF_READ
-        = NCBI:align:ref_sub_select (out_ref_id, out_ref_start, out_ref_len, .REF_PLOIDY)
-        | NCBI:align:ref_sub_select (out_ref_id, out_ref_start, out_ref_len );
-        
-    INSDC:4na:bin ref_read_internal
-        = NCBI:align:ref_sub_select (out_ref_id, out_ref_start, out_ref_len_internal, .REF_PLOIDY)
-        | NCBI:align:ref_sub_select (out_ref_id, out_ref_start, out_ref_len_internal);
-
-    // text forms of reads
-    INSDC:dna:text out_dna_text
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_4na_bin );
-    readonly column INSDC:dna:text RAW_READ
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_raw_read );
-    readonly column INSDC:4na:bin RAW_READ
-        = out_raw_read;
-
-    // CIGARs
-    readonly column ascii CIGAR_LONG
-        = < ascii > NCBI:align:cigar #2 < 1 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len, out_ref_len)
-        | < ascii > NCBI:align:cigar #2 < 1 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len);
-    readonly column INSDC:coord:len CIGAR_LONG_LEN
-        = < INSDC:coord:len > NCBI:align:cigar #2 < 1 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len, out_ref_len)
-        | < INSDC:coord:len > NCBI:align:cigar #2 < 1 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len);
-    readonly column ascii CIGAR_SHORT
-        = < ascii > NCBI:align:cigar #2 < 0 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len, out_ref_len)
-        | < ascii > NCBI:align:cigar #2 < 0 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len);
-    readonly column INSDC:coord:len CIGAR_SHORT_LEN
-        = < INSDC:coord:len > NCBI:align:cigar #2 < 0 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len, out_ref_len)
-        | < INSDC:coord:len > NCBI:align:cigar #2 < 0 > (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_read_len);
-
-    readonly column U32 EDIT_DISTANCE
-        = NCBI:align:edit_distance #2 (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_ref_len, out_read_len)
-        | NCBI:align:edit_distance #2 (out_has_mismatch, out_has_ref_offset, out_ref_offset, out_ref_len)
-        | NCBI:align:edit_distance #1 (out_has_mismatch, out_has_ref_offset, out_ref_offset);
-
-    readonly column ascii HAS_MISMATCH = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_has_mismatch );
-    
-    // needed for backward compatibility
-    readonly column ascii SEQ_SPOT_GROUP = out_spot_group;
-
-
-/* These columns are purely informational. */    
-    bool out_ref_mismatch = NCBI:align:get_ref_mismatch ( out_has_mismatch, out_has_ref_offset, out_ref_offset, out_ref_len );
-    readonly column ascii REF_MISMATCH = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_ref_mismatch );
-    readonly column bool REF_MISMATCH = out_ref_mismatch;
-    
-    bool out_ref_insert = NCBI:align:get_ref_insert ( out_has_mismatch, out_has_ref_offset, out_ref_offset, out_ref_len );
-    readonly column ascii REF_INSERT = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_ref_insert );
-    readonly column bool REF_INSERT = out_ref_insert;
-    
-    bool out_ref_delete = NCBI:align:get_ref_delete ( out_has_mismatch, out_has_ref_offset, out_ref_offset, out_ref_len );
-    readonly column ascii REF_DELETE = < U8 , ascii > map < [ 0 , 1 ] , '01'  > ( out_ref_delete );
-    readonly column bool REF_DELETE = out_ref_delete;
-    
-};
-
-
-/* align_full
- *  aligns externally stored sequence against reference
- *  alignment transcript is calculated
- */
-table NCBI:align:tbl:align_full #1.0.0
-    = NCBI:align:tbl:align_cmn #2
-{
-    bool out_is_secondary = <bool> echo < true > ();
-    // restore reads to its raw form (orientation is restored)
-
-    INSDC:4na:bin out_raw_read
-        = < INSDC:4na:bin > simple_sub_select  < 'PRIMARY_ALIGNMENT', '( INSDC:4na:bin ) RAW_READ' > (.PRIMARY_ALIGNMENT_ID)
-        | < INSDC:4na:bin > NCBI:align:project_from_sequence < '( INSDC:4na:bin ) READ'> ( .SEQ_SPOT_ID, .SEQ_READ_ID );
-        
-    INSDC:4na:bin out_4na_bin 
-	    = NCBI:align:align_restore_read ( ref_read_internal, out_has_mismatch, tmp_out_mismatch_4na_bin, out_has_ref_offset, out_ref_offset, .READ_LEN )
-	    | NCBI:align:align_restore_read ( ref_read_internal, out_has_mismatch, tmp_out_mismatch_4na_bin, out_has_ref_offset, out_ref_offset )
-    	    | NCBI:align:raw_restore_read ( out_raw_read, .REF_ORIENTATION );
-	
-
-    // flags mismatches with the reference
-    // produced by actual comparison of REF_READ and READ
-    // TMP_HAS_MISMATCH is a hack to speed up retrieval during coverage recalculation
-    column bool_encoding TMP_HAS_MISMATCH;
-    bool out_has_mismatch
-        = .TMP_HAS_MISMATCH 
-	| NCBI:align:generate_has_mismatch ( REF_READ, READ, out_has_ref_offset, out_ref_offset );
-    readonly column bool HAS_MISMATCH = out_has_mismatch;
-
-    INSDC:4na:bin out_mismatch_4na_bin
-        = NCBI:align:generate_mismatch ( REF_READ, READ, out_has_ref_offset, out_ref_offset );
-
-    INSDC:4na:bin tmp_out_mismatch_4na_bin =  < INSDC:dna:text, INSDC:4na:bin > map < INSDC:4na:map:CHARSET, INSDC:4na:map:BINSET > ( .TMP_MISMATCH );
-
-    // temporary column for reference coverage calculation        
-    column < INSDC:dna:text> zip_encoding TMP_MISMATCH;
-
-    INSDC:dna:text out_mismatch_dna_text
-        = .TMP_MISMATCH
-        | < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_mismatch_4na_bin );
-    
-    readonly column INSDC:dna:text MISMATCH = out_mismatch_dna_text;
-    readonly column INSDC:4na:bin MISMATCH = out_mismatch_4na_bin;
-
-    physical column < INSDC:coord:zero > izip_encoding .MATE_REF_POS = MATE_REF_POS;
-    INSDC:coord:zero out_mate_ref_pos = .MATE_REF_POS
-                                      | < INSDC:coord:zero > simple_sub_select < '','REF_POS'> (MATE_ALIGN_ID);
-    
-    physical column < I64 > izip_encoding .MATE_REF_ID = MATE_REF_ID;
-    I64 out_mate_ref_id = .MATE_REF_ID
-                        | < I64 > simple_sub_select < '','REF_ID'> (MATE_ALIGN_ID);
-    
-    INSDC:coord:len out_mate_ref_len = < INSDC:coord:len > simple_sub_select < '','REF_LEN'> (MATE_ALIGN_ID);
-    physical column < I32 > izip_encoding .TEMPLATE_LEN = TEMPLATE_LEN;
-    I32 out_template_len = .TEMPLATE_LEN
-            | NCBI:align:template_len(REF_POS,out_mate_ref_pos,out_ref_len,out_mate_ref_len,REF_NAME,MATE_REF_NAME,SEQ_READ_ID);
-
-    physical column < bool > izip_encoding .MATE_REF_ORIENTATION = MATE_REF_ORIENTATION;
-    bool out_mate_ref_orientation = .MATE_REF_ORIENTATION
-                                  | < bool >  simple_sub_select < '','REF_ORIENTATION'> (MATE_ALIGN_ID);
-
-    I64 out_mate_align_id = .MATE_ALIGN_ID;
-    physical column <I64> izip_encoding .MATE_ALIGN_ID = MATE_ALIGN_ID;
-    extern column I64 MATE_ALIGN_ID = out_mate_align_id;
-
-    physical column < I64 > izip_encoding .PRIMARY_ALIGNMENT_ID = PRIMARY_ALIGNMENT_ID;
-
-    I32 read_idx = <I32> cast (.SEQ_READ_ID);
-    extern column I64 PRIMARY_ALIGNMENT_ID
-        = .PRIMARY_ALIGNMENT_ID
-        | <I64> simple_sub_select < 'SEQUENCE','PRIMARY_ALIGNMENT_ID' > (.SEQ_SPOT_ID,.SEQ_READ_ID);
-
-};
-
-
-/* compressed_by_reference
- *  aligns internally represented sequence against reference
- *  alignment transcript is stored
- *  original sequence is reconstructed
- */
-table NCBI:align:tbl:compressed_by_reference #1.1.0
-    = NCBI:align:tbl:align_cmn #2
-{
-    bool out_is_secondary = <bool> echo < false > ();
-
-    // one value per base i.e. length is same as sum of READ_LEN
-    // partitioned by READ_START and READ_LEN into alternative alignments
-    // flags mismatches with the reference
-    extern default column bool_encoding HAS_MISMATCH;
-    bool out_has_mismatch = .HAS_MISMATCH;
-
-    // has number of elements equal to number of true elements in HAS_MISMATCH
-    extern column INSDC:dna:text MISMATCH
-    {
-        read = out_mismatch_dna_text;
-        validate = < INSDC:dna:text > compare ( in_mismatch_dna_text, out_mismatch_dna_text );
-    }
-
-    INSDC:dna:text in_mismatch_dna_text
-        = < INSDC:dna:text, INSDC:dna:text > map < '.acmgrsvtwyhkdbn','NACMGRSVTWYHKDBN' > ( MISMATCH );
-
-    INSDC:4na:bin in_mismatch_4na_bin
-        = < INSDC:dna:text, INSDC:4na:bin > map < INSDC:4na:map:CHARSET, INSDC:4na:map:BINSET > ( in_mismatch_dna_text );
-
-    extern column < ascii > zip_encoding ALIGN_GROUP;
-
-    physical column < INSDC:4na:bin > zip_encoding .MISMATCH = in_mismatch_4na_bin;
-    
-    INSDC:4na:bin out_mismatch_4na_bin = .MISMATCH;
-    INSDC:dna:text out_mismatch_dna_text
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_mismatch_4na_bin );
-    
-    I64 out_mate_align_id
-        = .MATE_ALIGN_ID
-        | NCBI:align:get_mate_align_id (.SEQ_SPOT_ID);
-        
-    physical column <I64> izip_encoding .MATE_ALIGN_ID = MATE_ALIGN_ID;
-    extern column I64 MATE_ALIGN_ID = out_mate_align_id;
-
-    // restore reads from alignment columns and the reference
-    // optional .READ_LEN size defines PLOIDY
-    INSDC:4na:bin out_4na_bin
-	    = NCBI:align:align_restore_read ( ref_read_internal, out_has_mismatch, .MISMATCH, out_has_ref_offset, out_ref_offset, .READ_LEN )
-	    | NCBI:align:align_restore_read ( ref_read_internal, out_has_mismatch, .MISMATCH, out_has_ref_offset, out_ref_offset );
-
-    // restore reads to its raw form (orientation is restored)
-    INSDC:4na:bin out_raw_read = NCBI:align:raw_restore_read (out_4na_bin,.REF_ORIENTATION);
-
-    I64	primary_align_pair =  < I64 > simple_sub_select < 'SEQUENCE','PRIMARY_ALIGNMENT_ID'> (.SEQ_SPOT_ID);
-    I64 out_mate_ref_id = < I64 > simple_sub_select < '','REF_ID'> (MATE_ALIGN_ID);
-    bool  out_mate_ref_orientation = < bool >  simple_sub_select < '','REF_ORIENTATION'> (MATE_ALIGN_ID);
-    INSDC:coord:zero out_mate_ref_pos = < INSDC:coord:zero > simple_sub_select < '','REF_POS'> (MATE_ALIGN_ID);
-    INSDC:coord:len out_mate_ref_len = < INSDC:coord:len > simple_sub_select < '','REF_LEN'> (MATE_ALIGN_ID);
-    readonly column U32   MATE_EDIT_DISTANCE   = < U32 >   simple_sub_select < '','EDIT_DISTANCE'> (MATE_ALIGN_ID);
-    readonly column ascii MATE_CIGAR_LONG      = < ascii > simple_sub_select < '','CIGAR_LONG'> (MATE_ALIGN_ID);
-    readonly column ascii MATE_CIGAR_SHORT     = < ascii > simple_sub_select < '','CIGAR_SHORT'> (MATE_ALIGN_ID);
-    readonly column INSDC:coord:len MATE_CIGAR_LONG_LEN  = < INSDC:coord:len > simple_sub_select < '','CIGAR_LONG_LEN'> (MATE_ALIGN_ID);
-    readonly column INSDC:coord:len MATE_CIGAR_SHORT_LEN = < INSDC:coord:len > simple_sub_select < '','CIGAR_SHORT_LEN'> (MATE_ALIGN_ID);
-    
-    I32 out_template_len = NCBI:align:template_len (REF_POS,out_mate_ref_pos,out_ref_len,out_mate_ref_len,REF_NAME,MATE_REF_NAME,SEQ_READ_ID);    
-};
-
-
-/* align_sorted
- *  deflated alignment data sorted against reference
- */
-table NCBI:align:tbl:align_sorted #1.1.0
-    = NCBI:align:tbl:compressed_by_reference #1.1.0
-    , NCBI:align:tbl:global_ref_block #1.0.0
-{
-    // 128K
-    column default limit = 131072;
-};
-
-
-/* align_unsorted
- *  deflated alignment unsorted data
- */
-table NCBI:align:tbl:align_unsorted #1.1.0
-    = NCBI:align:tbl:compressed_by_reference #1.1.0
-    , NCBI:align:tbl:local_ref_block #1.0.0
-{
-    // 128K
-    column default limit = 131072;
-};
-
-
-/* align_mate_sorted
- */
-table NCBI:align:tbl:align_mate_sorted #1.0.1
-    = NCBI:align:tbl:align_full #1.0.0
-    , NCBI:align:tbl:global_ref_block #1.0.0
-{
-    // 128K
-    column default limit = 131072;
-};
-
-
-/* align_mate_unsorted
- */
-table NCBI:align:tbl:align_mate_unsorted #1.0.1
-    = NCBI:align:tbl:align_full #1.0.0
-    , NCBI:align:tbl:local_ref_block #1.0.0
-{
-    // 128K
-    column default limit = 131072;
-};
-
-/* align_allele
- *  alleles coverage extension
- */
-table NCBI:align:tbl:align_allele #1.1.0
-    = NCBI:align:tbl:align_unsorted #1.1.0
-{
-    extern column < I64 > izip_encoding EVIDENCE_ALIGNMENT_IDS;
-
-    /*
-    INSDC:quality:phred out_qual_phred
-        = < INSDC:quality:phred > echo < 30 > ( out_4na_bin );
-    */
-};
-
-/*--------------------------------------------------------------------------
- * seq
- *  alignment sequence table
- */
-physical
-I64 NCBI:align:sorted:alignment_id_encoding #1.0 
-{
-    decode
-    {
-        I64 outliers_removed = iunzip ( @ );
-        return < I64 > outlier_decode < 0 > ( outliers_removed );
-    }
-
-    encode
-    {
-        I64 outliers_removed = < I64 > outlier_encode < 0 > ( @ );
-        return izip ( outliers_removed );
-    }
-}
-
-
-table NCBI:align:tbl:seq #1.0.0 =
-    NCBI:tbl:base_space #2.0.3,
-    NCBI:tbl:phred_quality #2.0.4,
-    NCBI:align:tbl:cmp_base_space #1,
-    NCBI:SRA:tbl:spotdesc #1.0.2,
-    NCBI:SRA:tbl:stats #1.2.0
-{
-    // 128K
-    column default limit = 131072;
-
-    // gets primary record in alignment table (size of column is NREADS)
-    // if sorted - should used special encoding
-    extern column <I64> izip_encoding PRIMARY_ALIGNMENT_ID;
-
-    INSDC:coord:zero trim_start = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len trim_len = _spot_len;
-
-    // size is NREADS
-    extern column < U8 > zip_encoding ALIGNMENT_COUNT;
-
-    // auto-generate name from row-id
-    ascii out_name_fmt = < ascii > echo < '$R' > ();
-
-    // temparary column
-    extern column < U64 > izip_encoding TMP_KEY_ID;
-
-    // restored  READ
-    INSDC:4na:bin out_dcmp_4na_bin
-        = NCBI:align:seq_restore_read (out_cmp_4na_bin, .PRIMARY_ALIGNMENT_ID, .READ_LEN, .READ_TYPE);
-    
-    extern column < U64 > izip_encoding TI;
-};
-
-
-table NCBI:align:tbl:cs_seq #1.1
-{
-    /* writable columns */
-    extern column INSDC:color:text CMP_CSREAD
-        = out_cmp_color_text
-        ;
-
-    extern column < INSDC:dna:text > zip_encoding CS_KEY;
-
-    extern default column < INSDC:quality:phred > zip_encoding QUALITY;
-
-    extern column < I64 > izip_encoding PRIMARY_ALIGNMENT_ID;
-
-    extern column < U8 > zip_encoding ALIGNMENT_COUNT;
-
-    extern column < INSDC:SRA:platform_id > zip_encoding PLATFORM;
-
-    extern column < ascii > zip_encoding LABEL;
-    extern column < INSDC:coord:zero > izip_encoding LABEL_START;
-    extern column < INSDC:coord:len > izip_encoding LABEL_LEN;
-
-    extern column < INSDC:SRA:xread_type > zip_encoding READ_TYPE;
-    extern column < INSDC:coord:zero > izip_encoding READ_START;
-    extern column < INSDC:coord:len > izip_encoding READ_LEN;
-    extern column < INSDC:SRA:read_filter > zip_encoding READ_FILTER;
-
-    extern column < U64 > izip_encoding TMP_KEY_ID;
-
-    extern column < ascii > zip_encoding SPOT_GROUP;
-
-    extern column < U64 > izip_encoding TI;
-
-    /* writing rules */
-    INSDC:x2cs:bin in_cmp_x2cs_bin
-        = < INSDC:color:text, INSDC:x2cs:bin > map < INSDC:x2cs:map:CHARSET, INSDC:x2cs:map:BINSET > ( CMP_CSREAD )
-        ;
-    INSDC:2cs:bin in_cmp_2cs_bin
-        = < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( in_cmp_x2cs_bin )
-        ;
-    INSDC:x2cs:bin in_cmp_alt_x2cs_bin
-        = < INSDC:x2cs:bin, INSDC:x2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 0, 0, 0, 4 ] > ( in_cmp_x2cs_bin )
-        ;
-    physical column INSDC:2cs:packed .CMP_CSREAD
-        = ( INSDC:2cs:packed ) pack ( in_cmp_2cs_bin )
-        ;
-    physical column < INSDC:x2cs:bin > zip_encoding .CMP_ALTCSREAD
-        = < INSDC:x2cs:bin > trim < ALIGN_LEFT, 0 > ( in_cmp_alt_x2cs_bin )
-        ;
-
-    /* reading rules */
-    INSDC:2cs:packed phys_cmp_2cs_packed
-        = .CMP_CSREAD
-        ;
-    INSDC:x2cs:bin phys_cmp_alt_x2cs_bin
-        = .CMP_ALTCSREAD
-        ;
-    INSDC:2cs:packed phys_2cs_packed
-        = .CSREAD
-        ;
-    INSDC:x2cs:bin phys_alt_x2cs_bin
-        = .ALTCSREAD
-        ;
-    INSDC:2cs:bin out_cmp_2cs_bin
-        = ( INSDC:2cs:bin ) unpack ( phys_cmp_2cs_packed )
-        ;
-    INSDC:2cs:bin out_2cs_bin
-        = ( INSDC:2cs:bin ) unpack ( phys_2cs_packed )
-        ;
-    INSDC:x2cs:bin out_cmp_x2cs_bin
-        = ( INSDC:x2cs:bin ) < U8 > bit_or < ALIGN_RIGHT > ( out_cmp_2cs_bin, phys_cmp_alt_x2cs_bin )
-        | ( INSDC:x2cs:bin ) out_cmp_2cs_bin
-        ;
-    INSDC:x2cs:bin out_x2cs_bin
-        = ( INSDC:x2cs:bin ) < U8 > bit_or < ALIGN_RIGHT > ( out_2cs_bin, phys_alt_x2cs_bin )
-        | ( INSDC:x2cs:bin ) out_2cs_bin
-        ;
-     INSDC:color:text out_cmp_color_text
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_cmp_x2cs_bin )
-        ;
-     INSDC:color:text out_color_text
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_x2cs_bin )
-        ;
-
-    /* triggers from stats */
-    INSDC:quality:phred in_qual_phred
-        = QUALITY
-        ;
-    INSDC:coord:len in_read_len
-        = READ_LEN
-        ;
-    INSDC:SRA:xread_type in_read_type
-        = READ_TYPE
-        ;
-    ascii in_spot_group
-        = SPOT_GROUP
-        ;
-    trigger meta_stats
-        = NCBI:SRA:cmp_stats_trigger ( in_cmp_x2cs_bin, in_qual_phred, in_read_len, in_read_type, in_spot_group )
-        | NCBI:SRA:cmp_stats_trigger ( in_cmp_x2cs_bin, in_qual_phred, in_read_len, in_read_type )
-        ;
-    trigger qual_stats
-        = NCBI:SRA:phred_stats_trigger #1 ( in_qual_phred )
-        ;
-};
-
-table NCBI:align:view:cs_seq #1.1 = NCBI:align:tbl:cs_seq #1.1
-{
-    // various READ columns
-    default readonly column INSDC:dna:text READ
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_dcmp_4na_bin )
-        | < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_4na_bin )
-        ;
-    readonly column INSDC:4na:bin READ = out_dcmp_4na_bin | out_4na_bin;
-    readonly column INSDC:4na:packed READ = pack ( out_dcmp_4na_bin ) | pack ( out_4na_bin );
-    readonly column INSDC:x2na:bin READ = out_dcmp_x2na_bin | out_x2na_bin;
-    readonly column INSDC:2na:bin READ = out_dcmp_2na_bin | out_2na_bin;
-    INSDC:2na:bin out_dcmp_2na_bin
-        = < INSDC:x2na:bin, INSDC:2na:bin > map < INSDC:x2na:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_dcmp_x2na_bin )
-        ;
-    INSDC:2na:bin out_2na_bin
-        = < INSDC:x2na:bin, INSDC:2na:bin > map < INSDC:x2na:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_x2na_bin )
-        ;
-    readonly column INSDC:2na:packed READ = pack ( out_dcmp_2na_bin ) | pack ( out_2na_bin );
-
-    // decompression in base space
-    INSDC:coord:len cmp_read_len
-        = < INSDC:coord:len > NCBI:align:make_cmp_read_desc #1 < true > ( .READ_LEN, .PRIMARY_ALIGNMENT_ID )
-        ;
-    INSDC:coord:zero cmp_read_start
-        = NCBI:align:make_read_start #1 ( cmp_read_len )
-        ; 
-    INSDC:x2na:bin out_cmp_x2na_bin
-        = NCBI:dna_from_color #1 ( out_cmp_x2cs_bin, cmp_read_start, cmp_read_len, .CS_KEY, color_matrix )
-        ;
-    INSDC:x2na:bin out_x2na_bin
-        = NCBI:dna_from_color #1 ( out_x2cs_bin, .READ_START, .READ_LEN, .CS_KEY, color_matrix )
-        ;
-    INSDC:4na:bin out_cmp_4na_bin
-        = < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( out_cmp_x2na_bin )
-        ;
-    INSDC:4na:bin out_4na_bin
-        = < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( out_x2na_bin )
-        ;
-    INSDC:4na:bin out_dcmp_4na_bin
-        = NCBI:align:seq_restore_read ( out_cmp_4na_bin, .PRIMARY_ALIGNMENT_ID, .READ_LEN, .READ_TYPE )
-        ;
-
-
-    // various CSREAD columns
-    default readonly column INSDC:color:text CSREAD
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_dcmp_x2cs_bin )
-        | out_color_text;
-    readonly column INSDC:x2cs:bin CSREAD = out_dcmp_x2cs_bin | out_x2cs_bin;
-    readonly column INSDC:2cs:bin CSREAD = out_dcmp_2cs_bin | out_2cs_bin;
-    INSDC:2cs:bin out_dcmp_2cs_bin
-        = < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_dcmp_x2cs_bin )
-        ;
-    readonly column INSDC:2cs:packed CSREAD = pack ( out_dcmp_2cs_bin ) | out_2cs_bin;
-
-
-    // decompression in color space
-    INSDC:x2na:bin out_dcmp_x2na_bin
-        = < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( out_dcmp_4na_bin )
-        ;
-    INSDC:x2cs:bin out_dcmp_x2na_x2cs_bin
-        = NCBI:color_from_dna #1 ( out_dcmp_x2na_bin, .READ_START, .READ_LEN, .CS_KEY, color_matrix )
-        ;
-    INSDC:coord:len aligned_read_len
-        = < INSDC:coord:len > NCBI:align:make_cmp_read_desc #1 < false > ( .READ_LEN, .PRIMARY_ALIGNMENT_ID )
-        ; 
-    INSDC:x2cs:bin out_dcmp_x2cs_bin
-        = < INSDC:x2cs:bin > NCBI:align:seq_construct_read #1 ( out_dcmp_x2na_x2cs_bin, .READ_LEN, out_cmp_x2cs_bin, cmp_read_len )
-        ;
-
-    // CS_NATIVE - dynamic
-    U32 cmp_csread_row_len
-        = row_len #1 ( phys_cmp_2cs_packed )
-        ;
-    U32 cmp_csread_not_zero
-        = < U32 > clip < 0, 1 > ( cmp_csread_row_len )
-        ;
-    readonly column bool CS_NATIVE
-        = < U32, bool > map < [ 0, 1 ], [ false, true ] > ( cmp_cs_read_not_zero )
-        ;
-
-    // COLOR_MATRIX
-    readonly column U8 COLOR_MATRIX
-        = color_matrix
-        ;
-    U8 color_matrix
-        = < U8 > echo < INSDC:color:default_matrix > ()
-        ;
-
-    // various QUALITY types
-    readonly column INSDC:quality:text:phred_33 QUALITY
-        = out_qual_text_phred_33
-        | ( INSDC:quality:text:phred_33 ) < B8 > sum < 33 > ( .QUALITY );
-    readonly column INSDC:quality:text:phred_64 QUALITY
-        = out_qual_text_phred_64
-        | ( INSDC:quality:text:phred_64 ) < B8 > sum < 64 > ( .QUALITY );
-
-    // SPOT_LEN
-    INSDC:coord:len spot_len
-        = ( INSDC:coord:len ) row_len ( out_dcmp_4na_bin )
-        ;
-    readonly column INSDC:coord:len SPOT_LEN = spot_len;
-
-    // TRIM_START
-    readonly column INSDC:coord:zero TRIM_START
-        = < INSDC:coord:zero > echo < 0 > ()
-        ;
-    readonly column INSDC:coord:one TRIM_START
-        = < INSDC:coord:one > echo < 1 > ()
-        ;
-    // TRIM_LEN
-    readonly column INSDC:coord:len TRIM_LEN = spot_len;
-
-    // MIN_SPOT_ID
-    readonly column INSDC:SRA:spotid_t MIN_SPOT_ID
-        = < INSDC:SRA:spotid_t > meta:value < "STATS/TABLE/SPOT_MIN" > ()
-        ;
-    // MAX_SPOT_ID
-    readonly column INSDC:SRA:spotid_t MAX_SPOT_ID
-        = < INSDC:SRA:spotid_t > meta:value < "STATS/TABLE/SPOT_MAX" > ()
-        ;
-    // SPOT_COUNT
-    readonly column U64 SPOT_COUNT
-        = < U64 > meta:value < "STATS/TABLE/SPOT_COUNT" > ()
-        ;
-    // BASE_COUNT
-    U64 base_count
-        = < U64 > meta:value < "STATS/TABLE/BASE_COUNT" > ()
-        ;
-    readonly column U64 BASE_COUNT = base_count;
-    // BIO_BASE_COUNT
-    readonly column U64 BIO_BASE_COUNT
-        = < U64 > meta:value < "STATS/TABLE/BIO_BASE_COUNT" > ()
-        ;
-    // CMP_BASE_COUNT
-    readonly column U64 CMP_BASE_COUNT
-        = < U64 > meta:value < "STATS/TABLE/CMP_BASE_COUNT" > ()
-        | base_count
-        ;
-
-    // various PLATFORM
-    // TBD
-
-    // SPOT_ID
-    I64 rowid_64 = row_id ();
-    readonly column INSDC:SRA:spotid_t SPOT_ID
-        = cast ( rowid_64 )
-        ;
-        
-    readonly column ascii NAME
-        = sprintf < "%u" > ( SPOT_ID )
-        ;
-
-};
-
-
-/***********************************
-* Reference table - to store reference sequences
-* Sequences are divided in chunks. Two sequences never share a chunk.
-* SEQ_LEN     - real size of a chunk should never exceed MAX_SEQ_LEN when it is set
-* READ        - inherited from NCBI:tbl:base_space
-* CMP_READ,CMP_ALTREAD - are inherited from NCBI:align:tbl:cmp_base_space
-* SEQ_ID,SEQ_START,SEQ_LEN are inherited from  NCBI:align:tbl:seqloc
-* .skey contains NAME of the chunk - it corresponds to actual name used in BAM (chr1,chr2, etc....)
-* 
-* SEQ_START,SEQ_LEN,MAX_SEQ_LEN,SEQID and rowlen(READ) operate the following way
-* - SEQ_LEN < MAX_SEQ_LEN - should only happen on the last chunk of the sequence
-* - .READ is absent - there should be a retrieval from external services by SEQ_ID,SEQ_START,SEQ_LEN
-* - rowlen(.READ) = 0  && SEQ_START==0 (used as flag) -  the sequence is SEQ_LEN repetition of 'N'
-* - rowlen(.READ) = 0  && SEQ_START >= 1 - the sequence have to be fetched from external sources
-* - 0 < rowlen(.READ)< SEQ_LEN -- the sequence have to be filled with 'N's
-* 
-v***********************************/
-table NCBI:align:tbl:reference #2 =
-    NCBI:align:tbl:cmp_base_space #1,
-    NCBI:tbl:base_space #2.0.3,
-    NCBI:tbl:seqloc #1,
-    NCBI:SRA:tbl:stats #1.2.0
-{
-    INSDC:quality:phred out_qual_phred
-        = < INSDC:quality:phred > echo < 30 > ( out_dcmp_4na_bin );
-
-    //  MAX_SEQ_LEN - should be a constant == static column
-    extern column < U32 > izip_encoding MAX_SEQ_LEN;
-
-    // indicates if sequence has circular structure
-    // copied from refSeq
-    extern column bool_encoding CIRCULAR;
-
-    // make CS_KEY writable
-    INSDC:dna:text in_cs_key
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgtn', 'ACGTN' > ( CS_KEY );
-    physical column < INSDC:dna:text > zip_encoding .CS_KEY = in_cs_key;
-    
-    U32 in_spot_len = SEQ_LEN;
-    
-    INSDC:coord:len _alt_in_read_len
-        = READ_LEN
-        | SEQ_LEN;
-
-    INSDC:SRA:xread_type _alt_in_read_type
-        = READ_TYPE
-        | < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-
-    // extra columns needed for CS conversion
-    INSDC:coord:zero out_read_start = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len  out_read_len = .SEQ_LEN;
-
-    extern column utf8  NAME = out_spot_name_utf8;
-    physical utf8 .NAME = idx:text:insert  < 'i_name' > ( NAME );
-    
-    utf8 out_spot_name_utf8 = idx:text:project < 'i_name' > (.NAME );
-    
-    ascii out_spot_name = cast ( out_spot_name_utf8 );
-
-    INSDC:coord:zero trim_start = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len trim_len = base_space_spot_len;
-
-    ascii out_label
-        = < ascii > echo < "reference" > ();
-    INSDC:coord:zero out_label_start
-        = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len out_label_len
-        = < INSDC:coord:len > echo < 9 > ();
-
-    U32 out_nreads
-        = < U32 > echo < 1 > ();
-    INSDC:SRA:xread_type out_read_type
-        = < INSDC:SRA:xread_type > echo < 3 > ();
-    INSDC:SRA:read_filter out_rd_filter
-        = < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ();
-
-
-// Columns of computed coverages by alignment
-
-    // TBD: use percentiles instead of min/max?
-    // maximum value clipped at 255 of the coverage density
-    // for a chunk
-    extern column < U8 > izip_encoding CGRAPH_HIGH;
-
-    // minimum value clipped at 255 of the coverage density
-    // for a chunk
-    extern column < U8 > izip_encoding CGRAPH_LOW;
-
-    // count of the number of mismatches in the chunk
-    extern column < U32 > izip_encoding CGRAPH_MISMATCHES;
-    
-    // count of the number of inserts and deletes in the chunk
-    extern column < U32 > izip_encoding CGRAPH_INDELS;
-
-    // List of row ids from alignment tables
-    extern column < I64 > izip_encoding PRIMARY_ALIGNMENT_IDS;
-    extern column < I64 > izip_encoding SECONDARY_ALIGNMENT_IDS;
-    extern column < I64 > izip_encoding EVIDENCE_INTERVAL_IDS;
-
-    // both OVERLAP_REF_* columns are array of three elements, matching number of *_IDS columns above.
-    // points back to an offset where the alignments to this chunk start
-    extern column < INSDC:coord:zero > izip_encoding OVERLAP_REF_POS;
-    // indicates the length of the longest tail of the alignmnent to this chunk which start in previous chunks
-    // if value of an element in this col is zero corresponding value of OVERLAP_REF_POS is meaningless
-    extern column < INSDC:coord:len > izip_encoding OVERLAP_REF_LEN;
-
-    // Mechanism to seach for NAME 
-    readonly column vdb:row_id_range NAME_RANGE
-        = idx:text:lookup < 'i_name', 'QUERY_SEQ_NAME' > ();
-
-    // Fully instantiates READ
-    INSDC:4na:bin out_dcmp_4na_bin
-        = NCBI:align:ref_restore_read (out_cmp_4na_bin, .SEQ_ID, .SEQ_START, .SEQ_LEN);
-}
-
-// THE DATABASES
-database NCBI:align:db:alignment_sorted #1.2.1
-{
-    table NCBI:align:tbl:reference #2 REFERENCE;
-    table NCBI:align:tbl:align_sorted #1.1 PRIMARY_ALIGNMENT;
-    table NCBI:align:tbl:align_mate_sorted #1.0 SECONDARY_ALIGNMENT;
-    table NCBI:align:tbl:seq #1.0 SEQUENCE;
-    table NCBI:align:view:cs_seq #1.1 CS_SEQUENCE;
-    table NCBI:align:tbl:qstat #1.0 QUAL_STAT;
-};
-
-database NCBI:align:db:alignment_unsorted #1.2.1
-{
-    table NCBI:align:tbl:reference #2 REFERENCE;
-    table NCBI:align:tbl:align_unsorted #1.1 PRIMARY_ALIGNMENT;
-    table NCBI:align:tbl:align_mate_unsorted #1.0 SECONDARY_ALIGNMENT;
-    table NCBI:align:tbl:seq #1.0 SEQUENCE;
-    table NCBI:align:view:cs_seq #1.1 CS_SEQUENCE;
-    table NCBI:align:tbl:qstat #1.0 QUAL_STAT;
-};
-
-database NCBI:align:db:alignment_evidence #1.2.1
-{
-    table NCBI:align:tbl:reference #2 REFERENCE;
-    table NCBI:align:tbl:align_unsorted #1.1 PRIMARY_ALIGNMENT;
-    table NCBI:align:tbl:align_mate_unsorted #1.0 SECONDARY_ALIGNMENT;
-    table NCBI:align:tbl:align_allele #1.1 EVIDENCE_INTERVAL;
-    table NCBI:align:tbl:align_mate_unsorted #1.0 EVIDENCE_ALIGNMENT;
-    table NCBI:align:tbl:seq #1.0 SEQUENCE;
-    table NCBI:align:view:cs_seq #1.1 CS_SEQUENCE;
-    table NCBI:align:tbl:qstat #1.0 QUAL_STAT;
-};
-
-database NCBI:align:db:alignment_evidence_sorted #1.0.1
-{
-    table NCBI:align:tbl:reference #2 REFERENCE;
-    table NCBI:align:tbl:align_sorted #1.1 PRIMARY_ALIGNMENT;
-    table NCBI:align:tbl:align_mate_sorted #1.0 SECONDARY_ALIGNMENT;
-    table NCBI:align:tbl:align_allele #1.1 EVIDENCE_INTERVAL;
-    table NCBI:align:tbl:align_mate_unsorted #1.0 EVIDENCE_ALIGNMENT;
-    table NCBI:align:tbl:seq #1.0 SEQUENCE;
-    table NCBI:align:view:cs_seq #1.1 CS_SEQUENCE;
-    table NCBI:align:tbl:qstat #1.0 QUAL_STAT;
-};
diff --git a/interfaces/align/alignsrc.h b/interfaces/align/alignsrc.h
deleted file mode 100644
index c894419..0000000
--- a/interfaces/align/alignsrc.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_align_alignsrc_
-#define _h_align_alignsrc_
-
-#ifndef _h_align_extern_
- #include <align/extern.h>
-#endif
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * AlignSrc
- *  an alignment guy
- */
-typedef struct AlignSrc AlignSrc;
-
-
-/* Make
- *  create an alignment source object from BAM file
- *
- *  "as" [ OUT ] - return parameter for AlignSrc object
- *
- *  "bam" [ IN ] - NUL terminated path to BAM file
- *
- *  "bai" [ IN, NULL OKAY ] - optional NUL terminated path to BAM index file
- */
-ALIGN_EXTERN int CC AlignSrcMakeFromBAM ( const AlignSrc **as, const char *bam, const char *bai );
-
-
-/* Dispose
- *  release all resources associated with alignment source
- */
-ALIGN_EXTERN int CC AlignSrcDispose ( const AlignSrc *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_alignsrc_ */
diff --git a/interfaces/align/bam.h b/interfaces/align/bam.h
deleted file mode 100644
index 8be9a8d..0000000
--- a/interfaces/align/bam.h
+++ /dev/null
@@ -1,807 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_align_bam_
-#define _h_align_bam_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-struct KFile;
-struct VPath;
-struct AlignAccessDB;
-struct AlignAccessAlignmentEnumerator;
-
-
-/*--------------------------------------------------------------------------
- * BAMAlignment
- */
-typedef struct BAMAlignment BAMAlignment;
-
-    
-/* GetBAMAlignment
- *  get property
- *
- * Release with BAMAlignmentRelease.
- */
-ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetBAMAlignment
-    ( const struct AlignAccessAlignmentEnumerator *self, const BAMAlignment **result );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentAddRef ( const BAMAlignment *self );
-ALIGN_EXTERN rc_t CC BAMAlignmentRelease ( const BAMAlignment *self );
-
-
-/* GetReadLength
- *  get the sequence length
- *  i.e. the number of elements of both sequence and quality
- *
- *  "length" [ OUT ] - length in bases of query sequence and quality
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetReadLength ( const BAMAlignment *self, uint32_t *length );
-
-
-/* GetSequence
- *  get the sequence data [0..ReadLength)
- *  caller provides buffer of ReadLength bytes
- *
- *  "sequence" [ OUT ] - pointer to a buffer of at least ReadLength bytes
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetSequence ( const BAMAlignment *self, char *sequence );
-
-/* GetSequence2
- *  get the sequence data [0..ReadLength)
- *  caller provides buffer of ReadLength bytes
- *
- *  "sequence" [ OUT ] - pointer to a buffer of at least ReadLength bytes
- *
- *  "start" [ IN ] and "stop" [ IN ] - zero-based coordinates, half-closed interval
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetSequence2 ( const BAMAlignment *self, char *sequence, uint32_t start, uint32_t stop);
-
-    
-/* GetQuality
- *  get the raw quality data [0..ReadLength)
- *  values are unsigned with 0xFF == missing
- *
- *  "quality" [ OUT ] - return param for quality sequence
- *   held internally, validity is guaranteed for the life of the BAMAlignment
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetQuality ( const BAMAlignment *self, const uint8_t **quality );
-
-/* GetQuality2
- *  get the raw quality data [0..ReadLength) from OQ if possible else from QUAL
- *  values are unsigned with 0xFF == missing
- *
- *  "quality" [ OUT ] - return param for quality sequence
- *   held internally, validity is guaranteed for the life of the BAMAlignment
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetQuality2(const BAMAlignment *self, const uint8_t **quality, uint8_t *offset);
-
-/* GetRefSeqId
- *  get id of reference sequence
- *  pass result into BAMFileGetRefSeqById to get the Reference Sequence record
- *
- *  "refSeqId" [ OUT ] - zero-based id of reference sequence
- *   returns -1 if set as invalid within BAM ( rc may be zero )
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetRefSeqId ( const BAMAlignment *self, int32_t *refSeqId );
-
-/* GetMateRefSeqId
- *  get id of mate's reference sequence
- *  pass result into BAMFileGetRefSeqById to get the Reference Sequence record
- *
- *  "refSeqId" [ OUT ] - zero-based id of reference sequence
- *   returns -1 if invalid
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetMateRefSeqId ( const BAMAlignment *self, int32_t *refSeqId );
-
-
-/* GetPosition
- *  get the aligned position on the ref. seq.
- *
- *  "n" [ IN ] - zero-based position index for cases of multiple alignments
- *
- *  "pos" [ OUT ] - zero-based position on reference sequence
- *  returns -1 if invalid
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetPosition ( const BAMAlignment *self, int64_t *pos );
-    
-/* GetPosition2
- *  get the aligned start position on the ref. seq.
- *  get the aligned length on the ref. seq.
- *
- *  "n" [ IN ] - zero-based position index for cases of multiple alignments
- *
- *  "pos" [ OUT ] - zero-based position on reference sequence
- *  returns -1 if invalid
- *
- *  "length" [ OUT ] - length of alignment on reference sequence
- *  returns 0 if invalid
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetPosition2 ( const BAMAlignment *self, int64_t *pos, uint32_t *length );
-    
-
-/* GetMatePosition
- *  starting coordinate of mate's alignment on ref. seq.
- *
- *  "pos" [ OUT ] - zero-based position on reference sequence
- *  returns -1 if invalid
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetMatePosition ( const BAMAlignment *self, int64_t *pos );
-
-
-/* IsMapped
- *  is the alignment mapped to something
- */
-ALIGN_EXTERN bool CC BAMAlignmentIsMapped ( const BAMAlignment *self );
-
-
-/* GetReadGroupName
- *  get the name of the read group (i.e. accession)
- *  pass result into BAMFileGetReadGroupByName to get the Read Group record
- *
- *  "name" [ OUT ] - return param for NUL-terminated read group name
- *   held internally, validity is guaranteed for the life of the BAMAlignment
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetReadGroupName ( const BAMAlignment *self, const char **name );
-
-
-/* GetReadName
- *  get the read name (i.e. spot name)
- * GetReadName2
- *  get the read name and length in bytes
- *
- *  "name" [ OUT ] - return param for NUL-terminated read name
- *   held internally, validity is guaranteed for the life of the BAMAlignment
- *
- *  "length" [ OUT ] - return the number of bytes in "name"
- *   excluding terminating NUL.
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetReadName ( const BAMAlignment *self, const char **name );
-ALIGN_EXTERN rc_t CC BAMAlignmentGetReadName2 ( const BAMAlignment *self, const char **name, size_t *length );
-    
-    
-/* GetReadName3
- *  get the read name and length in bytes
- *  applies fixups to name
- *
- *  "name" [ OUT ] - return param for read name
- *   held internally, validity is guaranteed for the life of the BAMAlignment
- *
- *  "length" [ OUT ] - return the number of bytes in "name"
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetReadName3 ( const BAMAlignment *self, const char **name, size_t *length );
-
-/* HasColorSpace
- *  Does the alignment have colorspace info
- */
-ALIGN_EXTERN bool CC BAMAlignmentHasColorSpace ( const BAMAlignment *self );
-
-/* GetCSKey
- *  get the colorspace key
- *
- *  "cskey" [ OUT ] - return param 
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCSKey ( const BAMAlignment *self, char cskey[1] );
-
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCSSeqLen ( const BAMAlignment *self, uint32_t *seqLen );
-/* GetCSSequence
- *  get the colorspace sequence data [0..seqLen)
- *  caller provides buffer of seqLen bytes
- *
- *  "csseq" [ OUT ] - pointer to a buffer of at least seqLen bytes
- *  "seqLen" [ IN ] - length of sequence from BAMAlignmentGetCSSeqLen
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCSSequence ( const BAMAlignment *self, char *csseq, uint32_t seqLen );
-
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCSQuality(BAMAlignment const *cself, uint8_t const **quality, uint8_t *offset);
-
-
-/* GetFlags
- *  return the raw "flags" bitmap word
- *
- *  "flags" [ OUT ] - return parameter for bitmap word
- */
-enum BAMFlags
-{
-    BAMFlags_bit_WasPaired = 0,  /* was paired when sequenced */
-    BAMFlags_bit_IsMappedAsPair,
-    BAMFlags_bit_SelfIsUnmapped,
-    BAMFlags_bit_MateIsUnmapped,
-    BAMFlags_bit_SelfIsReverse,
-    BAMFlags_bit_MateIsReverse,
-    BAMFlags_bit_IsFirst,        /* and mate exists */
-    BAMFlags_bit_IsSecond,       /* and mate exists */
-    BAMFlags_bit_IsNotPrimary,   /* a read having split hits may have multiple primary alignments */
-    BAMFlags_bit_IsLowQuality,   /* fails platform/vendor quality checks */
-    BAMFlags_bit_IsDuplicate,    /* PCR or optical dup */
-    
-    BAMFlags_WasPaired      = (1 << BAMFlags_bit_WasPaired),
-    BAMFlags_IsMappedAsPair	= (1 << BAMFlags_bit_IsMappedAsPair),
-    BAMFlags_SelfIsUnmapped	= (1 << BAMFlags_bit_SelfIsUnmapped),
-    BAMFlags_MateIsUnmapped	= (1 << BAMFlags_bit_MateIsUnmapped),
-    BAMFlags_SelfIsReverse	= (1 << BAMFlags_bit_SelfIsReverse),
-    BAMFlags_MateIsReverse	= (1 << BAMFlags_bit_MateIsReverse),
-    BAMFlags_IsFirst        = (1 << BAMFlags_bit_IsFirst),
-    BAMFlags_IsSecond       = (1 << BAMFlags_bit_IsSecond),
-    BAMFlags_IsNotPrimary	= (1 << BAMFlags_bit_IsNotPrimary),
-    BAMFlags_IsLowQuality	= (1 << BAMFlags_bit_IsLowQuality),
-    BAMFlags_IsDuplicate	= (1 << BAMFlags_bit_IsDuplicate)
-};
-
-ALIGN_EXTERN rc_t CC BAMAlignmentGetFlags ( const BAMAlignment *self, uint16_t *flags );
-
-
-/* GetMapQuality
- *  return the quality score of mapping
- *
- *  "qual" [ OUT ] - return param for quality score
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetMapQuality ( const BAMAlignment *self, uint8_t *qual );
-
-
-/* GetAlignmentDetail
- *  get the alignment details
- *
- *  "rslt" [ OUT, NULL OKAY ] and "count" [ IN ] - array to hold detail records
- *
- *  "actual" [ OUT, NULL OKAY ] - number of elements written to "rslt"
- *   required if "rslt" is not NULL
- *
- *  "firstMatch" [ OUT, NULL OKAY ] - zero-based index into "rslt" of the first match to the refSeq
- *   or < 0 if invalid
- *
- *  "lastMatch" [ OUT, NULL OKAY ] - zero-based index into "rslt" of the last match to the refSeq
- *   or < 0 if invalid
- */
-typedef uint32_t BAMCigarType;
-enum BAMCigarTypes
-{
-    ct_Match    = 'M', /* 0 */
-    ct_Insert   = 'I', /* 1 */
-    ct_Delete   = 'D', /* 2 */
-    ct_Skip     = 'N', /* 3 */
-    ct_SoftClip = 'S', /* 4 */
-    ct_HardClip = 'H', /* 5 */
-    ct_Padded   = 'P', /* 6 */
-    ct_Equal    = '=', /* 7 */
-    ct_NotEqual = 'X', /* 8 */
-    ct_Overlap  = 'B' /* Complete Genomics extension */
-};
-
-typedef struct BAMAlignmentDetail BAMAlignmentDetail;
-struct BAMAlignmentDetail
-{
-    int64_t refSeq_pos; /* position on refSeq where this alignment region starts or -1 if NA */
-    int32_t read_pos;   /* position on read where this alignment region starts or -1 if NA */
-    uint32_t length;    /* length of alignment region */
-    BAMCigarType type;  /* type of alignment */
-};
-
-ALIGN_EXTERN rc_t CC BAMAlignmentGetAlignmentDetail ( const BAMAlignment *self,
-    BAMAlignmentDetail *rslt, uint32_t count, uint32_t *actual,
-    int32_t *firstMatch, int32_t *lastMatch );
-
-
-/* GetCigarCount
- *  the number of CIGAR elements
- *  a CIGAR element consists of the pair of matching op code and op length
- *
- *  "n" [ OUT ] - return param for cigar count
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCigarCount ( const BAMAlignment *self, uint32_t *n );
-
-
-ALIGN_EXTERN rc_t CC BAMAlignmentGetRawCigar(const BAMAlignment *cself, uint32_t const **rslt, uint32_t *length);
-
-/* GetCigar
- *  get CIGAR element n [0..GetCigarCount)
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetCigar ( const BAMAlignment *self,
-    uint32_t n, BAMCigarType *type, uint32_t *length );
-
-
-/* GetInsertSize
- *  distance in bases to start of mate's alignment on ref. seq.
- *
- *  "size" [ OUT ] - >0 for first in pair, <0 for second
- */
-ALIGN_EXTERN rc_t CC BAMAlignmentGetInsertSize ( const BAMAlignment *self, int64_t *size );
-
-
-/* OptDataForEach
- *  DANGER
- *  these optional fields are the weakest part of BAM.
- *
- *  It is probably best to not use this info.
- *  You can't count on them being there.
- *  Moreover, you might need to interpret the types correctly.
- */
-typedef uint32_t BAMOptDataValueType;
-enum BAMOptDataValueTypes
-{
-    dt_CSTRING = 'Z',
-    dt_INT8 = 'c',
-    dt_UINT8 = 'C',
-    dt_INT16 = 's',     
-    dt_UINT16 = 'S',    
-    dt_INT = 'i',
-    dt_UINT = 'I',
-    dt_FLOAT32 = 'f',
-    dt_FLOAT64 = 'd',
-    dt_ASCII = 'A',
-    dt_HEXSTRING = 'H',
-    dt_NUM_ARRAY = 'B'
-};
-
-#define OPT_TAG_X "X?" /* end user data */
-#define OPT_TAG_Y "Y?" /* end user data */
-#define OPT_TAG_Z "Z?" /* end user data */
-
-#define OPT_TAG_ReadGroup   "RG" /* Read Group; same as BAMAlignmentGetReadGroupName */
-#define OPT_TAG_Library     "LB" /* LIbrary; also BAMReadGroup */
-#define OPT_TAG_Unit        "PU" /* Platform specific Unit; also BAMReadGroup */
-#define OPT_TAG_Program     "PG" /* Alignment software name */
-#define OPT_TAG_AlignScore  "AS" /* Alignment Score (MapQuality?) */
-#define OPT_TAG_SecQual     "SQ" /* second called base:2 and quality:6; length == ReadLength? warning */
-#define OPT_TAG_MateMapQual "MQ" /* map Quality of mate */
-#define OPT_TAG_NumMismatch "NM" /* Number of Mismatches */
-#define OPT_TAG_Hits0       "H0" /* Number of perfect hits */
-#define OPT_TAG_Hits1       "H1" /* Number of off-by-one */
-#define OPT_TAG_Hits2       "H2" /* Number of off-by-two */
-#define OPT_TAG_CondQual    "UQ" /* conditional Quality of read */
-#define OPT_TAG_CondQPair   "PQ" /* conditional Quality of pair */
-#define OPT_TAG_ReadHits    "NH" /* Number of times this read (spot) aligns */
-#define OPT_TAG_ReadHits2   "IH" /* Number of times this read (spot) aligns that are in this file */
-#define OPT_TAG_HitIndex    "HI" /* n-th hit for this read in this file */
-#define OPT_TAG_Match2      "MD" /* another sort of matching string like CIGAR but different? */
-#define OPT_TAG_ColorKey    "CS" /* primer and first color */
-#define OPT_TAG_ColorQual   "CQ" /* quality of above */
-#define OPT_TAG_ColorMisses "CM" /* Number of color-space Mismatches */
-#define OPT_TAG_SeqOverlap  "GS" 
-#define OPT_TAG_QualOverlap "GQ" 
-#define OPT_TAG_OverlapDesc "GC"
-#define OPT_TAG_MateSeq     "R2" /* sequence of the mate */
-#define OPT_TAG_MateQual    "Q2" /* quality scores of the mate */
-#define OPT_TAG_OtherQual   "S2"
-#define OPT_TAG_NextHitRef  "CC" /* Reference name of the next hit */
-#define OPT_TAG_NextHitPos  "CP" /* coordinate of the next hit */
-#define OPT_TAG_SingleMapQ  "SM" /* quality of mapping as if not paired */
-#define OPT_TAG_AM          "AM"
-#define OPT_TAG_MAQFlag     "MQ"
-
-
-struct BAMOptData
-{
-    BAMOptDataValueType type;
-    uint32_t element_count;
-    union {
-        int8_t i8[8];
-        uint8_t u8[8];
-        int16_t i16[4];
-        uint16_t u16[4];
-        int32_t i32[2];
-        uint32_t u32[2];
-        int64_t i64[2];
-        uint64_t u64[2];
-        float f32[2];
-        double f64[1];
-        char asciiz[8];
-    } u;
-};
-
-typedef struct BAMOptData BAMOptData;
-
-typedef rc_t ( CC * BAMOptionalDataFunction )
-    ( void *ctx, const char tag[2], const BAMOptData *value );
-
-ALIGN_EXTERN rc_t CC BAMAlignmentOptDataForEach
-    ( const BAMAlignment *self, void *ctx, BAMOptionalDataFunction callback );
-
-    
-ALIGN_EXTERN bool CC BAMAlignmentHasCGData(BAMAlignment const *self);
-
-    
-ALIGN_EXTERN
-rc_t CC BAMAlignmentGetCGSeqQual(BAMAlignment const *self,
-                                 char sequence[/* 35 */],
-                                 uint8_t quality[/* 35 */]);
-
-ALIGN_EXTERN
-rc_t CC BAMAlignmentGetCGCigar(BAMAlignment const *self,
-                               uint32_t *cigar,
-                               uint32_t cig_max,
-                               uint32_t *cig_act);
-    
-ALIGN_EXTERN rc_t BAMAlignmentGetTI(BAMAlignment const *self, uint64_t *ti);
-
-ALIGN_EXTERN rc_t BAMAlignmentGetCGAlignGroup(BAMAlignment const *self,
-                                              char buffer[],
-                                              size_t max_size,
-                                              size_t *act_size);
-    
-    
-/*--------------------------------------------------------------------------
- * BAMFile
- */
-typedef struct BAMFile BAMFile;
-
-typedef struct BAMRefSeq BAMRefSeq;
-struct BAMRefSeq
-{
-    uint64_t length;
-    const char *name; /* not null unique */
-    const char *assemblyId;
-    const uint8_t *checksum;
-    const char *uri;
-    const char *species;
-    uint32_t id;
-    uint8_t checksum_array[16];
-};
-
-typedef struct BAMReadGroup BAMReadGroup;
-struct BAMReadGroup
-{
-    const char *name; /* not null unique, accession e.g. SRR001138 */
-    const char *sample; /* not null */
-    const char *library;
-    const char *description;
-    const char *unit; /* platform specific identifier, e.g. BI.080214_SL-XAJ_0001_FC2044KAAXX.7 */
-    const char *insertSize;
-    const char *center; /* e.g. BI */
-    const char *runDate;
-    const char *platform; /* e.g. ILLUMINA */
-    uint32_t id;
-};
-
-
-/* 64-bit structure stored as an integer
- * The high-order 48 bits store the position in the file at which a 
- * compressed block starts.  The low-order 16 bits store the position
- * in the decompressed block at which a record starts.  This is the
- * way that positions are represented in BAM indices.
- */
-typedef uint64_t BAMFilePosition;
-
-
-/* Make
- *  open the BAM file specified by path
- *
- *  "path" [ IN ] - NUL terminated string or format
- */
-ALIGN_EXTERN rc_t CC BAMFileMake ( const BAMFile **result, const char *path, ... );
-
-ALIGN_EXTERN rc_t CC BAMFileMakeWithHeader ( const BAMFile **result,
-                                            char const headerText[],
-                                            char const path[], ... );
-
-/* MakeWithDir
- *  open the BAM file specified by path and supplied directory
- *
- *  "dir" [ IN ] - directory object used to open file
- *
- *  "path" [ IN ] - NUL terminated string or format
- */
-ALIGN_EXTERN rc_t CC BAMFileMakeWithDir ( const BAMFile **result,
-    struct KDirectory const *dir, const char *path, ... );
-ALIGN_EXTERN rc_t CC BAMFileVMakeWithDir ( const BAMFile **result,
-    struct KDirectory const *dir, const char *path, va_list args );
-
-/* Make
- *  open the BAM file specified by file
- *
- *  "file" [ IN ] - an open KFile
- */
-ALIGN_EXTERN rc_t CC BAMFileMakeWithKFile(const BAMFile **result,
-    struct KFile const *file);
-
-/* Make
- *  open the BAM file specified by file
- *
- *  "file" [ IN ] - an open KFile
- */
-ALIGN_EXTERN rc_t CC BAMFileMakeWithVPath(const BAMFile **result,
-    struct VPath const *path);
-
-/* ExportBAMFile
- *  export the BAMFile object in use by the AlignAccessDB, if any
- *  must be released via BAMFileRelease
- */
-ALIGN_EXTERN rc_t CC AlignAccessDBExportBAMFile ( struct AlignAccessDB const *self,
-    const BAMFile **result );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC BAMFileAddRef ( const BAMFile *self );
-ALIGN_EXTERN rc_t CC BAMFileRelease ( const BAMFile *self );
-
-
-/* GetPosition
- *  get the position of the about-to-be read alignment
- *  this position can be stored
- *  this position can be passed into SetPosition to seek to the same alignment
- *
- *  "pos" [ OUT ] - return parameter for position
- */
-ALIGN_EXTERN rc_t CC BAMFileGetPosition ( const BAMFile *self, BAMFilePosition *pos );
-
-
-/* GetProportionalPosition
- *  get the aproximate proportional position in the input file
- *  this is intended to be useful for computing progress
- *
- * NB - does not return rc_t
- */
-ALIGN_EXTERN float CC BAMFileGetProportionalPosition ( const BAMFile *self );
-
-
-/* Read
- *  read an aligment
- *
- *  "result" [ OUT ] - return param for BAMAlignment object
- *   must be released with BAMAlignmentRelease
- *
- *  returns RC(..., ..., ..., rcRow, rcNotFound) at end
- */
-ALIGN_EXTERN rc_t CC BAMFileRead ( const BAMFile *self, const BAMAlignment **result );
-
-
-/* Rewind
- *  reset the position back to the first aligment in the file
- */
-ALIGN_EXTERN rc_t CC BAMFileRewind ( const BAMFile *self );
-
-
-/* SetPosition
- *  set the position to a particular alignment
- *  pass in the values from GetPosition
- */
-ALIGN_EXTERN rc_t CC BAMFileSetPosition ( const BAMFile *self, const BAMFilePosition *pos );
-
-
-/* GetRefSeqCount
- *  get the number of Reference Sequences refered to in the header
- *  this is not necessarily the number of Reference Sequences referenced
- *  by the alignments
- */
-ALIGN_EXTERN rc_t CC BAMFileGetRefSeqCount ( const BAMFile *self, uint32_t *count );
-
-
-/* GetRefSeq
- *  get the n'th Ref. Seq. where n is [0..RefSeqCount)
- *  the resulting pointer is static-like; it is freed when the BAMFile is.
- *  IOW, it is good for precisely at long as the BAMFile is.
- */
-ALIGN_EXTERN rc_t CC BAMFileGetRefSeq ( const BAMFile *self, uint32_t n, const BAMRefSeq **result );
-
-
-/* GetRefSeqById
- *  get a Ref. Seq. by its id
- *  the resulting pointer is static-like; it is freed when the BAMFile is.
- *  IOW, it is good for precisely at long as the BAMFile is.
- */
-ALIGN_EXTERN rc_t CC BAMFileGetRefSeqById ( const BAMFile *self, int32_t id, const BAMRefSeq **result );
-
-
-/* GetReadGroupCount
- *  get the number of Read Groups (accessions, etc.) refered to in the header
- *  this is not necessarily the number of Read Groups referenced
- *  by the alignments
- */
-ALIGN_EXTERN rc_t CC BAMFileGetReadGroupCount ( const BAMFile *self, uint32_t *count );
-
-/* GetReadGroup
- *  get the n'th Read Group where n is [0..ReadGroupCount)
- *  the resulting pointer is static-like; it is freed when the BAMFile is.
- *  IOW, it is good for precisely at long as the BAMFile is.
- */
-ALIGN_EXTERN rc_t CC BAMFileGetReadGroup ( const BAMFile *self, unsigned n, const BAMReadGroup **result );
-    
-/* GetHeaderText
- *  get the text of the BAM header file
- *  the resulting pointer is static-like; it is freed when the BAMFile is.
- *  IOW, it is good for precisely at long as the BAMFile is.
- */
-ALIGN_EXTERN rc_t CC BAMFileGetHeaderText(BAMFile const *cself, char const **header, size_t *header_len);
-    
-
-/* GetReadGroupByName
- *  get a Read Group by its name
- *  the resulting pointer is static-like; it is freed when the BAMFile is.
- *  IOW, it is good for precisely at long as the BAMFile is.
- */
-ALIGN_EXTERN rc_t CC BAMFileGetReadGroupByName ( const BAMFile *self,
-    const char *name, const BAMReadGroup **result );
-
-
-/* OpenIndex
- *  takes a simple path...
- */
-ALIGN_EXTERN rc_t CC BAMFileOpenIndex ( const BAMFile *self, const char *path );
-
-ALIGN_EXTERN rc_t CC BAMFileOpenIndexWithVPath ( const BAMFile *self, struct VPath const *path );
-
-/* IsIndexed
- *  returns true if true
- */
-ALIGN_EXTERN bool CC BAMFileIsIndexed ( const BAMFile *self );
-
-
-/* IndexHasRefSeqId
- */
-ALIGN_EXTERN bool CC BAMFileIndexHasRefSeqId ( const BAMFile *self, uint32_t refSeqId );
-
-/* Seek
- *  seeks a half-open zero-based interval on a particular reference
- *  rcSelf, rcIncomplete
- */
-ALIGN_EXTERN rc_t CC BAMFileSeek ( const BAMFile *self, uint32_t refSeqId, uint64_t alignStart, uint64_t alignEnd );
-
-typedef uint32_t BAMValidateOption;
-enum BAMValidateOptions {
-    /* this is the minimum level of BAM file validation; just walks the compressed block headers */
-    bvo_BlockHeaders        = 1,
-    
-    /* decompresses each block */
-    bvo_BlockCompression    = 2,
-    
-    /* within each block, walks the records without examining the contents */
-    bvo_BlockStructure      = 3,
-    
-    /* within each record, validate the structure vis-a-vis the record size */
-    bvo_RecordStructure     = 4,
-    
-    /* verify that the extra fields a parsable */
-    bvo_ExtraFields         = 8,
-    
-    /* confirm that no alignment starts before the alignment preceeding it */
-    bvo_Sorted              = 16,
-    
-    /* verify that flags are consistent with itself and the other fields in the record
-     * NB. can not verify secondary alignment flag 0x100
-     */
-    bvo_FlagsConsistency    = 32,
-    
-    /* verify CIGAR against sequence length */
-    bvo_CIGARConsistency    = 64,
-    
-    /* verify that bin number corresponds to position and alignment length */
-    bvo_BinConsistency      = 128,
-    
-    /* verify that mapQ is consistent with flags and refSeqID */
-    bvo_MapQuality          = 256,
-    
-    /* verify Quality values >= 33 */
-    bvo_QualityValues       = 512,
-    
-    /* verify that sequence length != 0 */
-    bvo_MissingSequence     = 1024,
-    
-    /* verify that Quality values != 255 */
-    bvo_MissingQuality      = 2048,
-    
-    /* compute flagstats */
-    bvo_FlagsStats          = 4096,
-    
-    /* verify that index is parsable
-     * NB. this can be done without a BAM file
-     */
-    bvo_IndexStructure      = 1 << 16,
-    
-    /* verify that the file offsets in the index are valid for the given BAM file
-     * NB. does not cause decompression of the BAM file but will cause referenced
-     * block headers to be validated
-     */
-    bvo_IndexOffsets1       = 2 << 16,
-    
-    /* in addition to verifying that the file offsets in the index are valid for
-     * the given BAM file, verify that the record offsets with the blocks are valid.
-     * NB. will cause referenced blocks to be decompressed and structurally validated.
-     */
-    bvo_IndexOffsets2       = 3 << 16,
-    
-    /* verify that index's reference number and bin number agree with the
-     * referenced record
-     */
-    bvo_IndexBins           = 4 << 16,
-    
-    bvo_IndexOptions        = 7 << 16
-};
-
-typedef struct BAMValidateStats BAMValidateStats;
-typedef struct BAMValidateStatsRow BAMValidateStatsRow;
-
-struct BAMValidateStatsRow {
-    uint64_t good;
-    uint64_t warning;
-    uint64_t error;
-};
-
-struct BAMValidateStats {
-    uint64_t bamFileSize;
-    uint64_t bamFilePosition;
-    uint64_t baiFileSize;
-    uint64_t baiFilePosition;
-    BAMValidateStatsRow blockHeaders;
-    BAMValidateStatsRow blockCompression;
-    BAMValidateStatsRow blockStructure;
-    BAMValidateStatsRow recordStructure;
-    BAMValidateStatsRow extraFields;
-    BAMValidateStatsRow inOrder;
-    BAMValidateStatsRow flags[16];
-    BAMValidateStatsRow CIGAR;
-    BAMValidateStatsRow bin;
-    BAMValidateStatsRow quality;
-    BAMValidateStatsRow hasSequence;
-    BAMValidateStatsRow hasQuality;
-    BAMValidateStatsRow indexFileOffset;
-    BAMValidateStatsRow indexBlockOffset;
-    BAMValidateStatsRow indexBin;
-    bool bamHeaderIsGood;
-    bool bamHeaderIsBad;
-    bool indexStructureIsGood;
-    bool indexStructureIsBad;
-};
-
-typedef rc_t (CC *BAMValidateCallback)(void *ctx, rc_t result, const BAMValidateStats *stats);
-
-/* Validate
- */
-ALIGN_EXTERN rc_t CC BAMValidate ( struct VPath const *bam,
-                                   struct VPath const *bai,
-                                   BAMValidateOption options,
-                                   BAMValidateCallback callback,
-                                   void *callbackContext
-                                  );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_bam_ */
diff --git a/interfaces/align/dna-reverse-cmpl.h b/interfaces/align/dna-reverse-cmpl.h
deleted file mode 100644
index 82c4783..0000000
--- a/interfaces/align/dna-reverse-cmpl.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_dna_reverse_cmpl_
-#define _h_align_dna_reverse_cmpl_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ALIGN_EXTERN rc_t CC DNAReverseCompliment(const INSDC_dna_text* seq, INSDC_dna_text* cmpl, uint32_t len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_dna_reverse_cmpl_ */
diff --git a/interfaces/align/extern.h b/interfaces/align/extern.h
deleted file mode 100644
index 94c711a..0000000
--- a/interfaces/align/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_align_extern_
-#define _h_align_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define ALIGN_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define ALIGN_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_align_extern_ */
diff --git a/interfaces/align/iterator.h b/interfaces/align/iterator.h
deleted file mode 100644
index e8a77e6..0000000
--- a/interfaces/align/iterator.h
+++ /dev/null
@@ -1,610 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_align_iterator_
-#define _h_align_iterator_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_insdc_insdc_
-#include <insdc/insdc.h>
-#endif
-
-#ifndef _h_vdb_database_
-#include <vdb/database.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VCursor;
-struct AlignMgr;
-struct ReferenceObj;
-
-
-/*--------------------------------------------------------------------------
- * AlignmentIterator
- *  walk across a single alignment in reference space
- */
-typedef struct AlignmentIterator AlignmentIterator;
-
-
-/* Make
- *  create an encapsulation of alignment
- *
- *  iter [ OUT ] - return parameter for new iterator
- *
- *  copy [ IN ] - when "true" the data will be copied.
- *  otherwise, pointers will be expected to refer to data
- *  with a lifetime >= that of the iterator being created.
- *
- *  "ref_pos" [ IN ] and "ref_len" [ IN ] - projection onto reference
- *
- *  "read" [ IN ] and "read_len" [ IN ] - full sequence of alignment
- *
- *  "has_mismatch" [ IN ] - describes comparison result of each base
- *  in "read" against the alignment.
- *
- *  "has_ref_offset" [ IN ] - describes positions of reference offsets
- *
- *  "ref_offset" [ IN ] and "ref_offset_len" [ IN ] - packed array of
- *  offsets of position against reference.
- */
-ALIGN_EXTERN rc_t CC AlignMgrMakeAlignmentIterator ( struct AlignMgr const *self,
-    AlignmentIterator **iter,
-    bool copy,
-    INSDC_coord_zero ref_pos,
-    INSDC_coord_len ref_len,
-    const INSDC_4na_bin *read,
-    INSDC_coord_len read_len,
-    const bool *has_mismatch,
-    const bool *has_ref_offset,
-    const int32_t *ref_offset,
-    uint32_t ref_offset_len,
-    INSDC_coord_zero ref_window_start,
-    INSDC_coord_len ref_window_len );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignmentIteratorAddRef ( const AlignmentIterator *self );
-ALIGN_EXTERN rc_t CC AlignmentIteratorRelease ( const AlignmentIterator *self );
-
-
-/* Next
- *  advance position by 1 in reference space
- *  must be called initially to advance to first element
- *
- *  returns RCState = rcDone when done
- */
-ALIGN_EXTERN rc_t CC AlignmentIteratorNext ( AlignmentIterator *self );
-
-
-/* State
- *  returns bitmap of state bits and event code at the current position
- *  will return invalid before initial Next message or after final
- *
- *  bits [ 0..7 ] :
- *    { 0..15 }             = 4na mismatch (NACMGRSVTWYHKDBN)
- *    64                    = match
- *    128                   = skip
- *  bit [ 8 ]               = have insert if ! 0
- *  bit [ 9 ]               = have delete if ! 0
- *  bit [ 10 ]              = first base if ! 0
- *  bit [ 11 ]              = last base if ! 0
- *  bit [ 31 ]              = iterator position is invalid if ! 0
- *                            NB - converts state word to negative
- */
-enum
-{
-    align_iter_match      = ( 1 <<  8 ),
-    align_iter_skip       = ( 1 <<  9 ),
-
-    align_iter_insert     = ( 1 << 10 ),
-    align_iter_delete     = ( 1 << 11 ),
-    align_iter_first      = ( 1 << 12 ),
-    align_iter_last       = ( 1 << 13 ),
-
-    align_iter_invalid    = ( 1 << 31 )
-};
-
-ALIGN_EXTERN int32_t CC AlignmentIteratorState ( const AlignmentIterator *self,
-                                                 INSDC_coord_zero *seq_pos );
-
-
-/* Position
- *  return current position of iterator relative to reference
- */
-ALIGN_EXTERN rc_t CC AlignmentIteratorPosition ( const AlignmentIterator *self,
-                                                 INSDC_coord_zero *pos );
-
-
-/* BasesInserted
- *  return the number of inserted bases and a pointer to their values
- *
- *  "bases" [ OUT, NULL OKAY ] - optional output parameter to inserted bases
- *
- *  returns count of bases inserted at current position
- */
-ALIGN_EXTERN uint32_t CC AlignmentIteratorBasesInserted
-    ( const AlignmentIterator *self, const INSDC_4na_bin **bases );
-
-
-/* BasesDeleted
- *  return the number of bases deleted at the current position
- *  also returns the location on the reference where the delete starts
- *
- *  "pos" [ OUT ] - return parameter for location on the reference
- *  where delete starts, and continues for the number of bases given by function return
- *
- *  returns count of bases deleted at current position
- */
-ALIGN_EXTERN uint32_t CC AlignmentIteratorBasesDeleted
-    ( const AlignmentIterator *self, INSDC_coord_zero *pos );
-
-
-/*--------------------------------------------------------------------------
- * PlacementRecord
- *  record describing a placement
- */
-typedef struct PlacementRecord PlacementRecord;
-struct PlacementRecord
-{
-    DLNode n;
-
-    /* row id of alignment record */
-    int64_t id;
-
-    /* object representing reference sequence */
-    struct ReferenceObj const *ref;
-
-    /* placement position and length on reference */
-    INSDC_coord_zero pos;
-    INSDC_coord_len len;
-
-    /* mapping quality of alignment */
-    int32_t mapq;
-
-    /* spotgroup is now in here too */
-    uint32_t spot_group_len;
-    char * spot_group;
-};
-
-
-/* Cast
- *  cast to an extended object
- *
- *  "ext" [ IN ] - selects the extended object level
- *  can be placementRecordExtension0 or placementRecordExtension1
- */
-
-enum { placementRecordExtension0, placementRecordExtension1 };
-
-ALIGN_EXTERN void* CC PlacementRecordCast ( const PlacementRecord *self, uint32_t ext );
-
-
-ALIGN_EXTERN void* CC PlacementRecord_get_ext_data_ptr ( const PlacementRecord *self, uint32_t ext );
-
-
-/* Whack
- *  destroys PlacementRecord and any associated extensions
- */
-ALIGN_EXTERN void CC PlacementRecordWhack ( const PlacementRecord *self );
-
-
-/* structure of function pointers for creating extensions
-   all function pointers are optional ( NULL OKAY ) */
-typedef struct PlacementRecordExtendFuncs PlacementRecordExtendFuncs;
-struct PlacementRecordExtendFuncs
-{
-    /* opaque pointer to data passed to each function */
-    void *data;
-
-    /* destructor */
-    void ( CC * destroy ) ( void *obj, void *data );
-
-    /* constructor */
-    rc_t ( CC * populate ) ( void *obj, const PlacementRecord *placement,
-        struct VCursor const *curs, INSDC_coord_zero ref_window_start,
-        INSDC_coord_len ref_window_len, void *data, void * placement_ctx );
-
-    /* variable allocation size calculation
-       when non-NULL, takes precedence over "fixed_size" */
-    bool ( CC * filter ) ( struct VCursor const *curs, int64_t row_id,
-        const PlacementRecord *placement, INSDC_coord_zero ref_window_start,
-        INSDC_coord_len ref_window_len, void *data, void * placement_ctx );
-
-    /* variable allocation size calculation
-       when non-NULL, takes precedence over "fixed_size" */
-    rc_t ( CC * alloc_size ) ( struct VCursor const *curs, int64_t row_id, size_t * size, void *data, void * placement_ctx );
-    
-    /* fixed allocation size
-       ignored if "alloc_size" is non-NULL,
-       must be non-zero otherwise */
-    size_t fixed_size;
-};
-
-
-/* external functions for extension of a placement record
-   to include ( construct ) an AlignmentIterator */
-ALIGN_EXTERN void CC AlignIteratorRecordDestroy ( void *obj, void *data );
-ALIGN_EXTERN rc_t CC AlignIteratorRecordPopulate ( void *obj,
-    const PlacementRecord *placement, struct VCursor const *curs,
-    INSDC_coord_zero ref_window_start, INSDC_coord_len ref_window_len, void *data );
-ALIGN_EXTERN rc_t CC AlignIteratorRecordSize ( struct VCursor const *curs, int64_t row_id, size_t * size, void *data );
-
-
-/*--------------------------------------------------------------------------
- * PlacementIterator
- *  walk across placements from an alignment db within a reference window
- */
-typedef struct PlacementIterator PlacementIterator;
-
-
-/* Make
- *  create a placement iterator
- *
- *  "iter" [ OUT ] - return parameter for iterator
- *
- *  "ref_obj" [ IN, NULL OKAY ] - optional parameter giving an object
- *  representing the reference sequence for this iterator. it will be
- *  inserted into each PlacementRecord (see above) and made available to
- *  outer code.
- *
- *  "ref_pos" [ IN ] and "ref_len" [ IN ] - window onto reference
- *
- *  "min_mapq" [ IN ] - minimum map quality value
- *
- *  "ref_cur" [ IN ] - read-only cursor on REFERENCE table
- *  will be modified as necessary to contain requisite columns
- *  will be opened by iterator.
- *
- *  "align_cur" [ IN ] - read-only cursor on PRIMARY_ALIGNMENT or SECONDARY_ALIGNMENT
- *  table ( see "secondary" ). will be modified as necessary to contain
- *  requisite columns. will be opened by iterator.
- *
- *  "ids" [ IN ] - an enum describing which column of alignment ids should
- *  be used when reading "ref"
- *
- *  "ext_0" [ IN, NULL OKAY ] and "ext_1" [ IN, NULL OKAY ] - optional pointers
- *  to blocks describing how to extend the basic placement record
- *
- *  rd_group [ IN, NULL OKAY ]
- *      != NULL, non empty string ... produce all alignments with this string as
- *                  spot-group ( no matter what the "real" spot-group of the
- *                  alignment is )
- *
- *      != NULL, empty string ... produce all alignments with the "real" spot-group
- *                  read from the column "SPOT_GROUP"
- *
- *      == NULL, ... produce all alignments with no spot-group assigned ( the user
- *                  does not wish the data to be read, the alignment to be bined )
- */
-
-typedef uint8_t align_id_src;
-enum { primary_align_ids, secondary_align_ids, evidence_align_ids };
-
-ALIGN_EXTERN rc_t CC AlignMgrMakePlacementIterator ( struct AlignMgr const *self,
-    PlacementIterator **iter, struct ReferenceObj const *ref_obj,
-    INSDC_coord_zero ref_pos, INSDC_coord_len ref_len, int32_t min_mapq,
-    struct VCursor const *ref_cur, struct VCursor const *align_cur, align_id_src ids,
-    const PlacementRecordExtendFuncs *ext_0, const PlacementRecordExtendFuncs *ext_1,
-    const char * spot_group );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorAddRef ( const PlacementIterator *self );
-ALIGN_EXTERN rc_t CC PlacementIteratorRelease ( const PlacementIterator *self );
-
-
-/* RefWindow
- *  returns the reference identification string and iteration window
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorRefWindow ( const PlacementIterator *self,
-    const char **idstr, INSDC_coord_zero *pos, INSDC_coord_len *len );
-
-
-/* RefObj
- *  returns the Ref-obj, that was used to create this placement-iterator
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorRefObj( const PlacementIterator * self,
-    struct ReferenceObj const ** refobj );
-
-
-/* NextAvailPos
- *  check the next available position having one or more placements
- *
- *  "pos" [ OUT ] - next position on reference having one or more placements
- *  may return negative position, indicating an alignment that wraps around
- *  a circular reference, and starts in negative space after linearization.
- *
- *  "len" [ OUT, NULL OKAY ] - optional return parameter for length of
- *  placement at that position
- *
- *  returns non-zero rc when no window is done
- *  (rcRange, rcDone)
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorNextAvailPos ( const PlacementIterator *self,
-    INSDC_coord_zero *pos, INSDC_coord_len *len );
-
-
-/* NextRecordAt
- *  retrieve a placement at the requested position
- *
- *  "pos" [ IN ] - required position of the placement
- *  obtained from "NextAvailPos"
- *
- *  "rec" [ OUT ] - returned record
- *  must be freed via PlacementRecordWhack
- *
- *  returns non-zero rc when no more placements are available
- *  (rcOffset, rcDone)
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorNextRecordAt ( PlacementIterator *self,
-    INSDC_coord_zero pos, const PlacementRecord **rec );
-
-
-/* NextIdAt
- *  retrieve a row id at the requested position
- *
- *  "pos" [ IN ] - required position of the placement
- *  obtained from "NextAvailPos"
- *
- *  "id" [ OUT ] - returned row-id, within domain of align cursor
- *
- *  "len" [ OUT, NULL OKAY ] - optional return parameter for length of
- *  placement on reference
- *
- *  returns non-zero rc when no more placements are available
- *  (rcOffset, rcDone)
- */
-ALIGN_EXTERN rc_t CC PlacementIteratorNextIdAt ( PlacementIterator *self,
-    INSDC_coord_zero pos, int64_t *row_id, INSDC_coord_len *len );
-
-
-/*--------------------------------------------------------------------------
- * PlacementSetIterator
- *  walk across placements from an alignment db within a reference window
- */
-typedef struct PlacementSetIterator PlacementSetIterator;
-
-
-/* Make
- *  create a placement set iterator
- *
- *  "iter" [ OUT ] - return parameter for iterator
- *
- *  "ref_pos" [ IN ] and "ref_len" [ IN ] - window onto reference
- */
-ALIGN_EXTERN rc_t CC AlignMgrMakePlacementSetIterator ( struct AlignMgr const *self,
-    PlacementSetIterator **iter );
-
-
-/* AddPlacementIterator
- *  adds a placement iterator
- *  used to provide ordered placements within window
- */
-ALIGN_EXTERN rc_t CC PlacementSetIteratorAddPlacementIterator
-    ( PlacementSetIterator *self, PlacementIterator *pi );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC PlacementSetIteratorAddRef ( const PlacementSetIterator *self );
-ALIGN_EXTERN rc_t CC PlacementSetIteratorRelease ( const PlacementSetIterator *self );
-
-
-ALIGN_EXTERN rc_t CC PlacementSetIteratorNextReference ( PlacementSetIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len, struct ReferenceObj const ** refobj );
-
-ALIGN_EXTERN rc_t CC PlacementSetIteratorNextWindow ( PlacementSetIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len );
-
-/* NextAvailPos
- *  check the next available position having one or more placements
- *
- *  "pos" [ OUT ] - next position on reference having one or more placements
- *  may return negative position, indicating an alignment that wraps around
- *  a circular reference, and starts in negative space after linearization.
- *
- *  "len" [ OUT, NULL OKAY ] - optional return parameter for length of
- *  placement at that position
- *
- *  returns non-zero rc when no more placements are available
- *  TBD - define a proper value
- */
-ALIGN_EXTERN rc_t CC PlacementSetIteratorNextAvailPos ( const PlacementSetIterator *self,
-    INSDC_coord_zero *pos, INSDC_coord_len *len );
-
-
-/* NextRecordAt
- *  retrieve a placement at the requested position
- *
- *  "pos" [ IN ] - required position of the placement
- *  obtained from "NextAvailPos"
- *
- *  "rec" [ OUT ] - returned record
- *  must be freed via PlacementRecordWhack
- */
-ALIGN_EXTERN rc_t CC PlacementSetIteratorNextRecordAt ( PlacementSetIterator *self,
-    INSDC_coord_zero pos, const PlacementRecord **rec );
-
-
-/* NextIdAt
- *  retrieve a row id at the requested position
- *
- *  "pos" [ IN ] - required position of the placement
- *  obtained from "NextAvailPos"
- *
- *  "id" [ OUT ] - returned row-id, within domain of align cursor
- *
- *  "len" [ OUT, NULL OKAY ] - optional return parameter for length of
- *  placement on reference
- */
-ALIGN_EXTERN rc_t CC PlacementSetIteratorNextIdAt ( PlacementSetIterator *self,
-    INSDC_coord_zero pos, int64_t *row_id, INSDC_coord_len *len );
-
-
-/*--------------------------------------------------------------------------
- * ReferenceIterator
- *  walk across placements from an alignment db within a reference window
- */
-typedef struct ReferenceIterator ReferenceIterator;
-
-
-/* Make
- *  create a reference iterator
- *
- *  "iter" [ OUT ] - return parameter for iterator
- *
- *  "ext_1" [ IN, NULL OKAY ] - optional pointer to a block describing how
- *  to extend the align-iterator record
- *
- *  "min_mapq" [ IN ] - minimum map quality value
- */
-ALIGN_EXTERN rc_t CC AlignMgrMakeReferenceIterator ( struct AlignMgr const *self,
-    ReferenceIterator **iter, const PlacementRecordExtendFuncs *ext_1, int32_t min_mapq );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorAddRef ( const ReferenceIterator *self );
-ALIGN_EXTERN rc_t CC ReferenceIteratorRelease ( const ReferenceIterator *self );
-
-
-/* AddPlacementIterator
- *  adds a placement iterator
- *  used to provide ordered placements within window
- */
-#if 0
-ALIGN_EXTERN rc_t CC ReferenceIteratorAddPlacementIterator
-    ( ReferenceIterator *self, PlacementIterator *pi );
-#endif
-
-/* AddPlacements
- *  adds a source for placements (file/table)
- *  used to provide ordered placements within window
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorAddPlacements ( ReferenceIterator *self,
-    struct ReferenceObj const *ref_obj, INSDC_coord_zero ref_pos, INSDC_coord_len ref_len,
-    struct VCursor const *ref, struct VCursor const *align, align_id_src ids,
-    const char * spot_group, void * placement_ctx );
-
-
-/* NextReference
- *  advance to the next reference
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorNextReference ( ReferenceIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len, struct ReferenceObj const ** refobj );
-
-/* NextWindow
- *  advance to the next window on the reference
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorNextWindow ( ReferenceIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len );
-
-/* NextSpotGroup
- *  advance to the next spot_group on the reference
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorNextSpotGroup ( ReferenceIterator *self,
-    const char ** name, size_t * len );
-
-
-/* NextPos
- *  advance to the next position on current reference
- *  resets internal iterator on placements at that position
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorNextPos ( ReferenceIterator *self, bool skip_empty );
-
-
-/* Position
- *  return current position on the reference
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorPosition ( const ReferenceIterator *self,
-    INSDC_coord_zero *pos, uint32_t * depth, INSDC_4na_bin * base );
-
-
-/* NextPlacement
- *  advance internal iterator to next placement in list
- *  returns a pointer to the next placement object at current position
- */
-ALIGN_EXTERN rc_t CC ReferenceIteratorNextPlacement ( ReferenceIterator *self,
-    const PlacementRecord **rec );
-
-
-/* State
- *  return state of current placement at current position
- */
-ALIGN_EXTERN int32_t CC ReferenceIteratorState ( const ReferenceIterator *self, INSDC_coord_zero *seq_pos );
-
-
-/* BasesInserted
- *  return the number of inserted bases and a pointer to their values
- *
- *  "bases" [ OUT, NULL OKAY ] - optional output parameter to inserted bases
- *
- *  returns count of bases inserted at current position
- */
-ALIGN_EXTERN uint32_t CC ReferenceIteratorBasesInserted ( const ReferenceIterator *self,
-    const INSDC_4na_bin **bases );
-
-
-/* BasesDeleted
- *  return the number of bases deleted at the current position
- *  also returns the location on the reference where the delete starts
- *
- *  "pos" [ OUT ] - return parameter for location on the reference
- *  where delete starts, and continues for the number of bases given by function return
- *
- *  "bases" [ OUT, NULL OKAY ] - optional output parameter to deleted bases
- *
- *  returns count of bases deleted at current position
- */
-ALIGN_EXTERN uint32_t CC ReferenceIteratorBasesDeleted ( const ReferenceIterator *self,
-    INSDC_coord_zero *pos, const INSDC_4na_bin **bases );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_iterator_ */
diff --git a/interfaces/align/manager.h b/interfaces/align/manager.h
deleted file mode 100644
index 4527f8a..0000000
--- a/interfaces/align/manager.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_align_manager_
-#define _h_align_manager_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * AlignMgr
- *  manages the alignment module
- */
-typedef struct AlignMgr AlignMgr;
-
-/* MakeRead
- *  make for read-only operations
- * MakeUpdate
- *  make for read/write operations
- */
-ALIGN_EXTERN rc_t CC AlignMgrMakeRead ( const AlignMgr **mgr );
-ALIGN_EXTERN rc_t CC AlignMgrMakeUpdate ( AlignMgr **mgr );
-
-
-/* AddRef
- * Release
- */
-ALIGN_EXTERN rc_t CC AlignMgrAddRef ( const AlignMgr *self );
-ALIGN_EXTERN rc_t CC AlignMgrRelease ( const AlignMgr *self );
-
-    
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_manager_ */
diff --git a/interfaces/align/qstat.vschema b/interfaces/align/qstat.vschema
deleted file mode 100644
index d97c20b..0000000
--- a/interfaces/align/qstat.vschema
+++ /dev/null
@@ -1,87 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB Quality Statistics Table
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/ncbi.vschema';
-
-table NCBI:align:tbl:qstat #1.0
-{
-    /* SPOT_GROUP
-     */
-    extern column < ascii > zip_encoding SPOT_GROUP;
-
-    /* CYCLE
-     *  machine cycle
-     */
-    extern column < U32 > izip_encoding CYCLE;
-
-    /* KMER
-     *  use dimer
-     */
-    extern column INSDC:dna:text KMER;
-
-    /* HPRUN
-     *  homopolymer run
-     *  number of bases of the same type preceding the current base
-     */
-    extern column < INSDC:coord:len > izip_encoding HPRUN;
-
-    /* GC_CONTENT
-     *  number of G's or C's in the 7 bases preceding the current base
-     */
-    extern column < U32 > izip_encoding GC_CONTENT;
-
-    /* ORIG_QUAL
-     *  original quality scores
-     */
-    extern column < INSDC:quality:phred > zip_encoding ORIG_QUAL;
-
-    /* MAX_QUAL
-     *  max. quality score in read
-     */
-    extern column < INSDC:quality:phred > zip_encoding MAX_QUAL;
-
-    /* NREAD
-     *  number of the read
-     */
-    extern column < U8 > zip_encoding NREAD;
-
-    /* TOTAL_COUNT
-     *  total count of observed events
-     */
-    extern column < U32 > izip_encoding TOTAL_COUNT;
-
-    /* MISMATCH_COUNT
-     *  count of observed mismatches
-     */
-    extern column < U32 > izip_encoding MISMATCH_COUNT;
-
-};
diff --git a/interfaces/align/quality-quantizer.h b/interfaces/align/quality-quantizer.h
deleted file mode 100644
index 223ffda..0000000
--- a/interfaces/align/quality-quantizer.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-
-#ifndef _h_align_quality_quantizer_
-#define _h_align_quality_quantizer_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* InitMatrix
- *  
- *
- */
-ALIGN_EXTERN bool CC QualityQuantizerInitMatrix(uint8_t result[256], char const initializer[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_quality_quantizer_ */
diff --git a/interfaces/align/reader-refseq.h b/interfaces/align/reader-refseq.h
deleted file mode 100644
index e7c4ac1..0000000
--- a/interfaces/align/reader-refseq.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_reader_refseq_
-#define _h_align_reader_refseq_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum ETableReaderRefSeq_Options {
-    errefseq_4NA = 0x01 /* read in INSDC:4na:bin, INSDC:dna:text is default */
-};
-
-typedef struct TableReaderRefSeq TableReaderRefSeq;
-
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_MakeTable(const TableReaderRefSeq** cself, const VDBManager* vmgr,
-                                                 const VTable* table, uint32_t options, size_t cache);
-
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_MakePath(const TableReaderRefSeq** cself, const VDBManager* vmgr,
-                                                const char* path, uint32_t options, size_t cache);
-
-ALIGN_EXTERN void CC TableReaderRefSeq_Whack(const TableReaderRefSeq* cself);
-
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_SeqId(const TableReaderRefSeq* cself, const char** id, uint32_t* id_sz);
-
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_SeqLength(const TableReaderRefSeq* cself, INSDC_coord_len* len);
-
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_Circular(const TableReaderRefSeq* cself, bool* circular);
-
-/* *md5 is NULL if not present */
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_MD5(const TableReaderRefSeq* cself, const uint8_t** md5);
-
-/* read a chunk of refseq into buffer from offset up to offset + len
-   if offset is beyond non-circular refseq size error is returned
- */
-ALIGN_EXTERN rc_t CC TableReaderRefSeq_Read(const TableReaderRefSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                            uint8_t* buffer, INSDC_coord_len* written);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_reader_refseq_ */
diff --git a/interfaces/align/reference.h b/interfaces/align/reference.h
deleted file mode 100644
index b02faf5..0000000
--- a/interfaces/align/reference.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_reader_reference_
-#define _h_align_reader_reference_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifndef _h_vdb_cursor_
-#include <vdb/cursor.h>
-#endif
-
-#ifndef _h_vdb_table_
-#include <vdb/table.h>
-#endif
-
-#ifndef _h_vdb_database_
-#include <vdb/database.h>
-#endif
-
-#ifndef _h_vdb_manager_
-#include <vdb/manager.h>
-#endif
-
-#ifndef _h_align_iterator_
-#include <align/iterator.h>
-#endif
-
-#ifndef _h_insdc_insdc_
-#include <insdc/insdc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct VCursor;
-struct PlacementIterator;
-
-enum ReferenceList_Options {
-    ereferencelist_4na = 0x01, /* READ in 4na, otherwise it is DNA */
-    /* next 3 options are used only if iterator is NOT created using existing cursor */
-    ereferencelist_usePrimaryIds = 0x02, /* read PRIMARY_ALIGNMENT_IDS too */
-    ereferencelist_useSecondaryIds = 0x04, /* read SECONDARY_ALIGNMENT_IDS too */
-    ereferencelist_useEvidenceIds = 0x08 /* use EVIDENCE_ALIGNMENT */
-};
-
-typedef struct ReferenceList ReferenceList;
-
-/** name is used to limit only to a single sequence - for quick lookups **/
-/** numbins is used to divide whole reference table in equi-row-bins and show only the bin where the name is falling to **/
-ALIGN_EXTERN rc_t CC ReferenceList_MakeCursor(const ReferenceList** cself, const VCursor* cursor, uint32_t options,
-                                              const char* name, const uint32_t numbins);
-
-ALIGN_EXTERN rc_t CC ReferenceList_MakeTable(const ReferenceList** cself, const VTable* table, uint32_t options,
-                                             size_t cache, const char* name, const uint32_t numbins);
-
-ALIGN_EXTERN rc_t CC ReferenceList_MakeDatabase(const ReferenceList** cself, const VDatabase* db, uint32_t options,
-                                                size_t cache, const char* name, const uint32_t numbins);
-
-ALIGN_EXTERN rc_t CC ReferenceList_MakePath(const ReferenceList** cself, const VDBManager* vmgr, const char* dbpath,
-                                            uint32_t options, size_t cache,const char *name, const uint32_t numbins);
-
-ALIGN_EXTERN rc_t CC ReferenceList_AddRef(const ReferenceList *cself);
-ALIGN_EXTERN void CC ReferenceList_Release(const ReferenceList* cself);
-
-/* number of items in the list */
-ALIGN_EXTERN rc_t CC ReferenceList_Count(const ReferenceList* cself, uint32_t* count);
-
-typedef struct ReferenceObj ReferenceObj;
-
-/* find object by SEQ_ID and if not found by NAME */
-ALIGN_EXTERN rc_t CC ReferenceList_Find(const ReferenceList* cself, const ReferenceObj** obj, const char* key, size_t key_sz);
-
-/* idx is 0-based */
-ALIGN_EXTERN rc_t CC ReferenceList_Get(const ReferenceList* cself, const ReferenceObj** obj, uint32_t idx);
-
-ALIGN_EXTERN rc_t ReferenceObj_AddRef(const ReferenceObj *cself);
-ALIGN_EXTERN void CC ReferenceObj_Release(const ReferenceObj* cself);
-
-/* internal idx for use in ReferenceList_Get above */
-ALIGN_EXTERN rc_t CC ReferenceObj_Idx(const ReferenceObj* cself, uint32_t* idx);
-/* Gets RowId range for the object */
-ALIGN_EXTERN rc_t CC ReferenceObj_IdRange(const ReferenceObj* cself, int64_t* start, int64_t* stop);
-/* Gets Current bin number if ReferenceList was binned*/
-ALIGN_EXTERN rc_t CC ReferenceObj_Bin(const ReferenceObj* cself, uint32_t* bin);
-
-ALIGN_EXTERN rc_t CC ReferenceObj_SeqId(const ReferenceObj* cself, const char** seqid);
-
-ALIGN_EXTERN rc_t CC ReferenceObj_Name(const ReferenceObj* cself, const char** name);
-
-ALIGN_EXTERN rc_t CC ReferenceObj_SeqLength(const ReferenceObj* cself, INSDC_coord_len* len);
-
-ALIGN_EXTERN rc_t CC ReferenceObj_Circular(const ReferenceObj* cself, bool* circular);
-
-/* check if actual refseq data is located in external table (external == true on return)
-   optionally obtain its path, returned path == NULL means actual refseq is missing
-   if path was requested and obtained caller must free(path)! */
-ALIGN_EXTERN rc_t CC ReferenceObj_External(const ReferenceObj* cself, bool* external, char** path);
-
-/* read a chunk of refseq into buffer from offset up to offset + len
-   if offset is beyond non-circular refseq size error is returned
- */
-ALIGN_EXTERN rc_t CC ReferenceObj_Read(const ReferenceObj* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                       uint8_t* buffer, INSDC_coord_len* written);
-
-ALIGN_EXTERN rc_t CC ReferenceObj_GetIdCount( const ReferenceObj* cself, int64_t row_id, uint32_t *count );
-
-/* return pointer to iterator for (PRIMARY|SECONDARY)_ALIGNMENT_IDS to a given range on reference,
-   both cursors could be NULL
-   ref_len will be truncated to seq length for non-circular references
-   for other parameters see AlignMgrMakePlacementIterator
- */
-ALIGN_EXTERN rc_t CC ReferenceObj_MakePlacementIterator ( const ReferenceObj* cself,
-    PlacementIterator **iter,
-    INSDC_coord_zero ref_window_start,
-    INSDC_coord_len ref_window_len, int32_t min_mapq,
-    struct VCursor const *ref_cur, struct VCursor const *align_cur, align_id_src ids,
-    const PlacementRecordExtendFuncs *ext_0, const PlacementRecordExtendFuncs *ext_1,
-    const char * rd_group, void * placement_ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_reader_reference_ */
diff --git a/interfaces/align/refseq-mgr.h b/interfaces/align/refseq-mgr.h
deleted file mode 100644
index 103789a..0000000
--- a/interfaces/align/refseq-mgr.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was readten as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_refseq_mgr_
-#define _h_align_refseq_mgr_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#include <vdb/manager.h>
-#include <vdb/table.h>
-#include <align/reader-refseq.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct RefSeqMgr RefSeqMgr;
-
-/* Manages refseq tables
-    reader_options [IN] - passed to TableReaderRefSeq
-    cache [IN] - db cache size per single!!! reference (vdb cursor cache)
-    keep_open_num [IN] - number of refseq kept open, 0 - no limit
- */
-ALIGN_EXTERN rc_t CC RefSeqMgr_Make(const RefSeqMgr** cself, const VDBManager* vmgr,
-                                    uint32_t reader_options, size_t cache, uint32_t keep_open_num);
-
-ALIGN_EXTERN rc_t CC RefSeqMgr_Release(const RefSeqMgr* cself);
-
-ALIGN_EXTERN rc_t CC RefSeqMgr_SetCache(RefSeqMgr const *const cself, size_t cache, uint32_t keep_open_num);
-
-/* return value if 0 means object was found, path is optional */
-ALIGN_EXTERN rc_t RefSeqMgr_Exists(const RefSeqMgr* cself, const char* accession, uint32_t accession_sz, char** path);
-
-/* Read from refseq ided by seq_id chunk of 'len' bases into provided 'buffer' (must be enough big for len);
-   on return written has number of bases written
- */
-ALIGN_EXTERN rc_t CC RefSeqMgr_Read(const RefSeqMgr* cself, const char* seq_id, uint32_t seq_id_sz,
-                                    INSDC_coord_zero offset, INSDC_coord_len len,
-                                    uint8_t* buffer, INSDC_coord_len* written);
-
-typedef struct RefSeq RefSeq;
-
-ALIGN_EXTERN rc_t CC RefSeqMgr_GetSeq(const RefSeqMgr* cmgr, const RefSeq** cself, const char* seq_id, uint32_t seq_id_sz);
-
-/* Same as RefSeqMgr_Read
- */
-ALIGN_EXTERN rc_t CC RefSeq_Read(const RefSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                 uint8_t* buffer, INSDC_coord_len* written);
-
-ALIGN_EXTERN rc_t CC RefSeq_Circular(const RefSeq* cself, bool* circular);
-
-ALIGN_EXTERN rc_t CC RefSeq_SeqLength(const RefSeq* cself, INSDC_coord_len* len);
-
-ALIGN_EXTERN rc_t CC RefSeq_MD5(const RefSeq* cself, const uint8_t** md5);
-
-ALIGN_EXTERN rc_t CC RefSeq_Release(const RefSeq* cself);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_refseq_mgr_ */
diff --git a/interfaces/align/refseq.vschema b/interfaces/align/refseq.vschema
deleted file mode 100644
index 7ea0dc8..0000000
--- a/interfaces/align/refseq.vschema
+++ /dev/null
@@ -1,100 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB Reference Sequence types, functions and tables
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/seq.vschema';
-include 'ncbi/sra.vschema';
-include 'ncbi/stats.vschema';
-
-
-extern function U8 NCBI:refseq:stats #1 ( INSDC:4na:bin seq )
-    = NCBI:refSeq:stats;
-
-table NCBI:refseq:tbl:reference #1.0.2 =
-    NCBI:tbl:base_space #2.0.2,
-    NCBI:tbl:phred_quality #2.0.3,
-    NCBI:tbl:seqloc #1.0,
-    NCBI:SRA:tbl:stats #1.1.2
-{
-    // 128K
-    column default limit = 131072;
-
-    extern column U32 MAX_SEQ_LEN;                  /* must be static */
-    extern column < ascii > izip_encoding DEF_LINE; /* remainder of defline after SEQ_ID */
-
-    // trigger upconverts to INSDC:dna:text to get MD5
-    trigger table_stats
-        = NCBI:refseq:stats(in_4na_bin);
-
-    readonly column U64 TOTAL_SEQ_LEN
-        = < U64 > meta:value < 'STATS/TOTAL_SEQ_LEN', true >();
-        
-    readonly column U8[16] MD5
-        = < U8[16] > meta:read < 'STATS/MD5', true >();
-        
-    // indicates if sequence has circular structure
-    // should be static
-    extern column bool_encoding CIRCULAR;
-    
-    /* columns:
-     *  READ
-     *  QUALITY (optional)
-     *  SEQ_ID
-     *  SEQ_START
-     *  SEQ_LEN
-     *  MAX_SEQ_LEN
-     *  TOTAL_SEQ_LEN
-     *  DEF_LINE
-     */
-
-    // make CS_KEY writable
-    INSDC:dna:text in_cs_key
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgtn', 'ACGTN' > ( CS_KEY );
-    physical column < INSDC:dna:text > zip_encoding .CS_KEY = in_cs_key;
-    // extra columns needed for CS conversion
-    INSDC:coord:zero out_read_start = < INSDC:coord:zero> echo < 0 > ();
-    INSDC:coord:len  out_read_len =  .SEQ_LEN;
-    
-    INSDC:coord:len _alt_in_read_len
-        = READ_LEN
-        | SEQ_LEN;
-
-    INSDC:SRA:xread_type _alt_in_read_type
-        = READ_TYPE
-        | < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-
-    INSDC:SRA:xread_type out_read_type
-        = .READ_TYPE
-        | < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-};
-
-// older spelling
-alias NCBI:refseq:tbl:reference NCBI:refSeq:tbl:reference;
diff --git a/interfaces/align/seq.vschema b/interfaces/align/seq.vschema
deleted file mode 100644
index 9b2f452..0000000
--- a/interfaces/align/seq.vschema
+++ /dev/null
@@ -1,300 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * Sequence schema
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/seq.vschema';
-
-
-/* cmp_base_space
- *  table representing compressed reads in base space,
- *  where the bases are only stored for unaligned reads
- */
-table NCBI:align:tbl:cmp_base_space #1
-    = INSDC:tbl:sequence #1.0.1
-    , NCBI:tbl:dcmp_base_space #1
-{
-    /* CMP_READ
-     *  read compressed against a reference sequence
-     */
-
-    // default is IUPAC character representation
-    extern default column INSDC:dna:text CMP_READ
-    {
-        read = out_cmp_dna_text;
-        validate = < INSDC:dna:text > compare ( in_cmp_dna_text, out_cmp_dna_text );
-    }
-
-    // 4na representation
-    extern column INSDC:4na:bin CMP_READ = out_cmp_4na_bin;
-    extern column INSDC:4na:packed CMP_READ = out_cmp_4na_packed;
-
-    // x2na representation - 2na with ambiguity
-    extern column INSDC:x2na:bin CMP_READ = out_cmp_x2na_bin;
-
-    // 2na representation - 2na with no ambiguity
-    extern column INSDC:2na:bin CMP_READ = out_cmp_2na_bin;
-    extern column INSDC:2na:packed CMP_READ = out_cmp_2na_packed;
-
-
-    /* input processing rules
-     */
-
-    // compressed input text
-    INSDC:dna:text in_cmp_dna_text
-        = < INSDC:dna:text, INSDC:dna:text > map < '.acmgrsvtwyhkdbn','NACMGRSVTWYHKDBN' > ( CMP_READ );
-
-    // compressed input 4na bin
-    INSDC:4na:bin in_cmp_4na_bin
-        = < INSDC:4na:bin > range_validate < 0, 15 > ( CMP_READ )
-        | ( INSDC:4na:bin ) unpack ( in_cmp_4na_packed )
-        | < INSDC:dna:text, INSDC:4na:bin > map < INSDC:4na:map:CHARSET, INSDC:4na:map:BINSET > ( in_cmp_dna_text )
-        | < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( in_cmp_x2na_bin );
-
-    // compressed input 4na packed
-    INSDC:4na:packed in_cmp_4na_packed = CMP_READ;
-
-    // compressed input x2na bin
-    INSDC:x2na:bin in_cmp_x2na_bin
-        = < INSDC:x2na:bin > range_validate < 0, 4 > ( CMP_READ )
-        | < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( in_cmp_4na_bin );
-
-    // compressed input 2na bin
-    INSDC:2na:bin in_cmp_2na_bin
-        = < INSDC:2na:bin > range_validate < 0, 3 > ( CMP_READ )
-        | ( INSDC:2na:bin ) unpack ( in_cmp_2na_packed )
-        | INSDC:SEQ:rand_4na_2na ( in_cmp_4na_bin );
-
-    // compressed input 2na packed
-    INSDC:2na:packed in_cmp_2na_packed = CMP_READ;
-
-    // input 4na alt-read ( ambiguities )
-    INSDC:4na:bin in_cmp_alt_4na_bin
-        = < INSDC:4na:bin, INSDC:4na:bin > map < INSDC:4na:map:BINSET, [ 15,0,0,3,0,5,6,7,0,9,10,11,12,13,14,15 ] > ( in_cmp_4na_bin );
-
-    // preparing a feed into stats column
-    U8 in_cmp_stats_bin = in_cmp_2na_bin;
-
-
-    /* physical columns
-     */
-
-    physical column INSDC:2na:packed .CMP_READ
-        = in_cmp_2na_packed
-        | ( INSDC:2na:packed ) pack ( in_cmp_2na_bin );
-
-    physical column < INSDC:4na:bin > zip_encoding .CMP_ALTREAD
-        = < INSDC:4na:bin > trim < 0, 0 > ( in_cmp_alt_4na_bin );
-
-
-    /* output processing rules
-     */
-
-    // output 2na packed
-    INSDC:2na:packed out_cmp_2na_packed = .CMP_READ;
-
-    // unambiguous unpacked 2na
-    INSDC:2na:bin out_cmp_2na_bin
-        = ( INSDC:2na:bin ) unpack ( out_cmp_2na_packed );
-
-    // output x2na bin
-    INSDC:x2na:bin out_cmp_x2na_bin
-        = < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( out_cmp_4na_bin );
-
-    // output 2na->4na bin
-    INSDC:4na:bin out_cmp_2na_4na_bin
-        = < INSDC:2na:bin, INSDC:4na:bin > map < INSDC:2na:map:BINSET, [ 1, 2, 4, 8 ] > ( out_cmp_2na_bin );
-
-    // output 4na bin
-    INSDC:4na:bin out_cmp_4na_bin
-        = < INSDC:4na:bin > bit_or < ALIGN_RIGHT > ( out_cmp_2na_4na_bin, .CMP_ALTREAD )
-        | out_cmp_2na_4na_bin;
-
-    // synthesized packed 4na
-    INSDC:4na:packed out_cmp_4na_packed
-        = ( INSDC:4na:packed ) pack ( out_cmp_4na_bin );
-
-    // output text
-    INSDC:dna:text out_cmp_dna_text
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_cmp_4na_bin );
-
-
-    /* decompressed sequences
-     *   source is out_dcmp_4na_bin - a virtual production
-     */
-
-    // synthesize x2na_bin, 2na_bin and 2na_packed
-    INSDC:x2na:bin out_dcmp_x2na_bin
-        = < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( out_dcmp_4na_bin );
-    INSDC:2na:bin out_dcmp_2na_bin
-        = < INSDC:x2na:bin, INSDC:2na:bin > map < [ 0,1,2,3,4 ], [ 0,1,2,3,0 ] > ( out_dcmp_x2na_bin );
-    INSDC:2na:packed out_dcmp_2na_packed
-        = ( INSDC:2na:packed ) pack ( out_dcmp_2na_bin );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  out_cs_key
-	 *  out_signal
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_color_matrix
-	 */
-
-	/* NCBI:tbl:dcmp_base_space inherited productions
-	 *  out_dcmp_4na_bin
-	 */
-}
-
-
-/* cmp_color_space
- *  table representing compressed reads in color space,
- *  where the colors are only stored for unaligned reads
- */
-table NCBI:align:tbl:cmp_color_space #1 =
-    INSDC:tbl:sequence #1.0.1, NCBI:tbl:dcmp_color_space #1
-{
-    /* CMP_CSREAD
-     *  read compressed against a reference sequence
-     */
-
-    // default is IUPAC character representation
-    extern default column INSDC:color:text CMP_CSREAD = out_cmp_color_text;
-
-    // x2cs representation - 2cs with ambiguity
-    extern column INSDC:x2cs:bin CMP_CSREAD = out_cmp_x2cs_bin;
-
-    // 2cs representation - 2cs with no ambiguity
-    extern column INSDC:2cs:bin CMP_CSREAD = out_cmp_2cs_bin;
-    extern column INSDC:2cs:packed CMP_CSREAD = out_cmp_2cs_packed;
-
-
-    /* input processing rules
-     */
-
-    // compressed input text
-    INSDC:color:text in_cmp_color_text = CMP_CSREAD;
-
-    // compressed input x2cs bin
-    INSDC:x2cs:bin in_cmp_x2cs_bin
-        = < INSDC:x2cs:bin > range_validate < 0, 4 > ( CMP_CSREAD )
-        | < INSDC:color:text, INSDC:x2cs:bin > map < INSDC:x2cs:map:CHARSET, INSDC:x2cs:map:BINSET > ( in_cmp_color_text );
-
-    // compressed input 2cs bin
-    INSDC:2cs:bin in_cmp_2cs_bin
-        = < INSDC:2cs:bin > range_validate < 0, 3 > ( CMP_CSREAD )
-        | ( INSDC:2cs:bin ) unpack ( in_cmp_2cs_packed )
-        | < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( in_cmp_x2cs_bin );
-
-    // compressed input 2cs packed
-    INSDC:2cs:packed in_cmp_2cs_packed = CMP_CSREAD;
-
-    // compressed input x2cs alt-read ( ambiguities )
-    INSDC:x2cs:bin in_cmp_alt_x2cs_bin
-        = < INSDC:x2cs:bin, INSDC:x2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 0, 0, 0, 4 ] > ( in_cmp_x2cs_bin );
-
-    // preparing a feed into stats column
-    U8 in_cmp_stats_bin = in_cmp_2cs_bin;
-
-
-    /* physical columns
-     */
-
-    physical column INSDC:2cs:packed .CMP_CSREAD
-        = in_cmp_2cs_packed
-        | ( INSDC:2cs:packed ) pack ( in_cmp_2cs_bin );
-
-    physical column < INSDC:x2cs:bin > zip_encoding .CMP_ALTCSREAD
-        = < INSDC:x2cs:bin > trim < 0, 0 > ( in_cmp_alt_x2cs_bin );
-
-
-    /* output processing rules
-     */
-
-    // compressed output 2cs packed
-    INSDC:2cs:packed out_cmp_2cs_packed = .CMP_CSREAD;
-
-    // unambiguous unpacked 2cs
-    INSDC:2cs:bin out_cmp_2cs_bin
-        = ( INSDC:2cs:bin ) unpack ( out_cmp_2cs_packed );
-
-    // unpacked 2cs with ambiguity
-    INSDC:x2cs:bin out_cmp_x2cs_bin
-        = ( INSDC:x2cs:bin ) < U8 > bit_or < ALIGN_RIGHT > ( out_cmp_2cs_bin, .CMP_ALTCSREAD )
-        | ( INSDC:x2cs:bin ) out_cmp_2cs_bin;
-
-    // output text
-    INSDC:color:text out_cmp_color_text
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_cmp_x2cs_bin );
-
-
-    /* decompressed sequences
-     *   sources are out_dcmp_x2cs_bin - virtual production
-     */
-
-    // synthesize 2cs_bin and 2cs_packed
-    INSDC:2cs:bin out_dcmp_2cs_bin
-        = < INSDC:x2cs:bin, INSDC:2cs:bin > map < [ 0,1,2,3,4 ], [ 0,1,2,3,0 ] > ( out_dcmp_x2cs_bin );
-    INSDC:2cs:packed out_dcmp_2cs_packed
-        = ( INSDC:2cs:packed ) pack ( out_dcmp_2cs_bin );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  out_cs_key
-	 *  out_signal
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:dcmp_color_space inherited productions
-	 *  out_dcmp_x2cs_bin
-	 */
-}
diff --git a/interfaces/align/writer-alignment.h b/interfaces/align/writer-alignment.h
deleted file mode 100644
index 5ce2ce6..0000000
--- a/interfaces/align/writer-alignment.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_writer_alignment_
-#define _h_align_writer_alignment_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#include <align/writer-cmn.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum ETableWriterAlgn_ColNames {
-    ewalgn_cn_TMP_KEY_ID,
-    ewalgn_cn_PLOIDY,
-    ewalgn_cn_SEQ_SPOT_ID,
-    ewalgn_cn_SEQ_READ_ID,
-    ewalgn_cn_READ_START,
-    ewalgn_cn_READ_LEN,
-    ewalgn_cn_REF_ID,
-    ewalgn_cn_REF_START,
-    ewalgn_cn_GLOBAL_REF_START,
-    ewalgn_cn_REF_LEN,
-    ewalgn_cn_REF_ORIENTATION,
-    ewalgn_cn_REF_PLOIDY,
-    ewalgn_cn_MATE_REF_ORIENTATION,
-    ewalgn_cn_MATE_REF_ID,
-    ewalgn_cn_MATE_REF_POS,
-    ewalgn_cn_MATE_ALIGN_ID,
-    ewalgn_cn_TEMPLATE_LEN,
-    ewalgn_cn_MAPQ,
-    ewalgn_cn_HAS_MISMATCH,
-    ewalgn_cn_HAS_REF_OFFSET,
-    ewalgn_cn_MISMATCH,
-    ewalgn_cn_REF_OFFSET,
-    ewalgn_cn_EVIDENCE_ALIGNMENT_IDS,
-    ewalgn_cn_ALIGN_GROUP,
-    ewalgn_cn_MISMATCH_QUALITY,
-    ewalgn_cn_MATE_GLOBAL_REF_START,
-    ewalgn_cn_MATE_REF_START,
-    ewalgn_cn_Last
-};
-
-typedef uint8_t ETableWriterAlgn_TableType;
-enum {
-    ewalgn_tabletype_PrimaryAlignment,
-    ewalgn_tabletype_SecondaryAlignment,
-    ewalgn_tabletype_EvidenceInterval,
-    ewalgn_tabletype_EvidenceAlignment
-};
-
-enum ETableWriterAlgn_ColOptions {
-    ewalgn_co_SEQ_SPOT_ID = 0x01,           /* SEQ_SPOT_ID will be written with the whole record */
-    ewalgn_co_TMP_KEY_ID = 0x02,            /* use TMP_KEY_ID column, by default not opened */
-    ewalgn_co_PLOIDY = 0x04,                /* ploidy is more than 1, columns PLOIDY, READ_START, READ_LEN needs data */
-    ewalgn_co_unsorted = 0x08,              /* use the unsorted table scheme */
-    ewalgn_co_MATE_ALIGN_ID_only = 0x10,    /* disable all other MATE_* columns */
-    ewalgn_co_MISMATCH_QUALITY = 0x20,      /* enable MISMATCH_QUALITY column */
-    ewalgn_co_MATE_POSITION = 0x40          /* enable mate position columns */
-};
-
-typedef struct TableWriterAlgnData_struct {
-
-    TableWriterData seq_spot_id;
-    TableWriterData seq_read_id;
-    TableWriterData tmp_key_id;
-
-    /* BEGIN filled out by ReferenceMgr_Compress */
-    uint32_t ploidy; /* incremented sequentially for each call, must be set to 0 for each new spot */
-    TableWriterData read_start; /* mandatory */
-    TableWriterData read_len; /* mandatory */
-    TableWriterData has_ref_offset; /* mandatory */
-    TableWriterData ref_offset; /* mandatory */
-    TableWriterData ref_id; /* used for unsorted*/
-    TableWriterData ref_start; /* used only for unsorted */
-    TableWriterData global_ref_start; /* used only for sorted */
-    TableWriterData has_mismatch;  /* mandatory only for primary */
-    TableWriterData mismatch; /* mandatory only for primary */
-    TableWriterData mismatch_qual;
-
-    INSDC_coord_len ref_len; /* projection on refseq is same for all alleles! */
-    /* tmp data, never saved to db */
-    /* recalculated offset in reference based on CIGAR and circularity in Compression */
-    INSDC_coord_zero effective_offset; 
-    int64_t ref_1st_row_id;
-    /* END filled out by ReferenceMgr_Compress */
-
-    TableWriterData ref_orientation;
-    TableWriterData ref_ploidy;
-    TableWriterData mapq;
-    TableWriterData align_group; /* set length to 0 if not used */
-
-    /* used only only in secondary */
-    TableWriterData mate_ref_orientation;
-    TableWriterData mate_ref_id;
-    TableWriterData mate_ref_pos;
-    TableWriterData mate_align_id;
-    TableWriterData template_len;
-
-    /* used only in for ewalgn_tabletype_EvidenceInterval table type */
-    TableWriterData alingment_ids;
-} TableWriterAlgnData;
-
-typedef struct TableWriterAlgn TableWriterAlgn;
-    
-typedef union ReferenceStart ReferenceStart;
-union ReferenceStart {
-    uint64_t global_ref_start;
-    struct {
-        int64_t ref_id;
-        INSDC_coord_one ref_start;
-    } local;
-};
-
-ALIGN_EXTERN rc_t CC TableWriterAlgn_Make(const TableWriterAlgn** cself, VDatabase* db,
-                                          ETableWriterAlgn_TableType type, uint32_t options);
-
-/* rows optional here */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_Whack(const TableWriterAlgn* cself, bool commit, uint64_t* rows);
-
-ALIGN_EXTERN rc_t CC TableWriterAlgn_WriteDefault(const TableWriterAlgn* cself,
-                                                  enum ETableWriterAlgn_ColNames col, const TableWriterData* data);
-
-ALIGN_EXTERN rc_t CC TableWriterAlgn_GetNextRowId(const TableWriterAlgn* cself, int64_t* rowid);
-
-/* rowid optional here */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_Write(const TableWriterAlgn* cself, const TableWriterAlgnData* data, int64_t* rowid);
-
-/* closes main cursor and creates lookup object on the successfully committed main cursor */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_TmpKeyStart(const TableWriterAlgn* cself);
-
-/* retrieve TMP_KEY value by rowid */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_TmpKey(const TableWriterAlgn* cself, int64_t rowid, uint64_t* key_id);
-
-/* retrieve reference start value by rowid */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_RefStart(const TableWriterAlgn* cself, int64_t rowid, ReferenceStart *const rslt);
-
-/* assign a SPOT_ID value to row */
-ALIGN_EXTERN rc_t CC TableWriterAlgn_Write_SpotId(const TableWriterAlgn* cself, int64_t rowid, int64_t spot_id);
-
-ALIGN_EXTERN rc_t CC TableWriterAlgn_Write_SpotInfo(const TableWriterAlgn* cself,
-                                                    int64_t rowid,
-                                                    int64_t spot_id,
-                                                    int64_t mate_id,
-                                                    ReferenceStart const *ref_start);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_writer_alignment_ */
diff --git a/interfaces/align/writer-cmn.h b/interfaces/align/writer-cmn.h
deleted file mode 100644
index 9e6086a..0000000
--- a/interfaces/align/writer-cmn.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_writer_cmn_
-#define _h_align_writer_cmn_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct TableWriterData_struct {
-    const void* buffer;
-    uint64_t elements;
-} TableWriterData;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_writer_cmn_ */
diff --git a/interfaces/align/writer-reference.h b/interfaces/align/writer-reference.h
deleted file mode 100644
index 2e9a190..0000000
--- a/interfaces/align/writer-reference.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_writer_reference_
-#define _h_align_writer_reference_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#include <insdc/insdc.h>
-#include <align/writer-cmn.h>
-#include <align/writer-alignment.h>
-#include <align/reader-refseq.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-enum EReference_Options {
-    ewrefmgr_co_allREADs = 0x01, /* always write READ */
-    ewrefmgr_co_Coverage = 0x02,  /* use coverage data, by default not used */
-    ewrefmgr_co_AcceptHardClip = 0x04 /* accept hard clipping in CIGAR */
-};
-
-typedef struct ReferenceMgr ReferenceMgr;
-
-/* Writes REFERENCE table with in given db
-    
-    vmgr [IN] - needed only if conf is not NULL
-    conf [IN] - optional path to tab separated file to resolve reference names
-                from source files to standard refseq accessions;
-                standard refseq dictionary location is obtained from kfg files.
-    path {IN] - optional path points to a directory with 'local' references
-                (not found in conf file), default is '.'
-    max_seq_len [IN] - 0 - use default
-    cache [IN] - db cache size per single!!! reference (vdb cursor cache)
-    num_open [IN] - number of refseq kept open, 0 - no limit
- */
-ALIGN_EXTERN rc_t CC ReferenceMgr_Make(const ReferenceMgr** cself, VDatabase* db, const VDBManager* vmgr,
-                                       const uint32_t options, const char* conf, const char* path, uint32_t max_seq_len,
-                                       size_t cache, uint32_t num_open);
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_Release(const ReferenceMgr *cself,
-                                          const bool commit,
-                                          uint64_t *const Rows,
-                                          const bool build_coverage,
-                                          rc_t (*const quitting)(void)
-                                          );
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_SetCache(ReferenceMgr const *const self, size_t cache, uint32_t num_open);
-
-typedef struct ReferenceSeq ReferenceSeq;
-
-/* id: chr12 or NC_000001.3 */
-ALIGN_EXTERN rc_t CC ReferenceMgr_GetSeq(const ReferenceMgr* const cself, const ReferenceSeq** const seq, const char* id);
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_Verify(const ReferenceMgr* cself, const char* id, INSDC_coord_len length, const uint8_t md5[16]);
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_FastaPath(const ReferenceMgr* cself, const char* fasta_path);
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_FastaFile(const ReferenceMgr* cself, struct KFile const* file);
-
-enum EReference_CompressionOptions {
-    ewrefmgr_cmp_Binary = 0x01, /* binary cigar on input (BAM format: 28+4 bits) */
-    ewrefmgr_cmp_Exact = 0x02 /* exact matching no cliping */
-};
-
-ALIGN_EXTERN rc_t CC ReferenceMgr_Compress(const ReferenceMgr* cself, uint32_t options,
-                                           const char* id, INSDC_coord_zero offset,
-                                           const char* seq, INSDC_coord_len seq_len,
-                                           const void* cigar, uint32_t cigar_len,
-                                           INSDC_coord_zero allele_offset, const char* allele, INSDC_coord_len allele_len,INSDC_coord_zero offset_in_allele,
-                                           const void* allele_cigar, uint32_t allele_cigar_len,
-                                           TableWriterAlgnData* data);
-
-/* After calling ReferenceMgr_Compress, ReferenceMgr_CompressHelper
- * can be used to compress other byte-sized arrays
- */
-ALIGN_EXTERN size_t CC ReferenceMgr_CompressHelper(uint8_t cmp_rslt[],
-                                                   TableWriterAlgnData const *const data,
-                                                   uint8_t const input[]);
-
-/* Read refseq chunk of 'len' bases into provided 'buffer' (must be enough big for len);
-   ref_len - on return has number of bases written to the buffer
- */
-ALIGN_EXTERN rc_t CC ReferenceSeq_Read(const ReferenceSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                       uint8_t* buffer, INSDC_coord_len* ref_len);
-
-ALIGN_EXTERN rc_t CC ReferenceSeq_Get1stRow(const ReferenceSeq* cself, int64_t* row_id);
-
-ALIGN_EXTERN rc_t CC ReferenceSeq_Compress(const ReferenceSeq* cself, uint32_t options,
-                                           INSDC_coord_zero offset,
-                                           const char* seq, INSDC_coord_len seq_len,
-                                           const void* cigar, uint32_t cigar_len,
-                                           INSDC_coord_zero allele_offset, const char* allele, INSDC_coord_len allele_len,INSDC_coord_zero offset_in_allele,
-                                           const void* allele_cigar, uint32_t allele_cigar_len,
-                                           TableWriterAlgnData* data);
-
-enum ReferenceSeqCoverageTableType {
-    ewrefcov_primary_table = 0,
-    ewrefcov_secondary_table,
-    ewrefcov_evidence_table
-};
-
-typedef struct ReferenceSeqCoverage_struct {
-    /* based only on primary and secondary */
-    uint8_t high;
-    uint8_t low;
-    uint32_t mismatches;
-    uint32_t indels;
-    /* in that order (use enum above): prim, 2nd, evidence */
-    INSDC_coord_zero overlap_ref_pos[3];
-    INSDC_coord_len overlap_ref_len[3];
-    TableWriterData ids[3];
-} ReferenceSeqCoverage;
-
-ALIGN_EXTERN rc_t CC ReferenceSeq_AddCoverage(const ReferenceSeq* cself, INSDC_coord_zero offset, const ReferenceSeqCoverage* data);
-
-ALIGN_EXTERN rc_t CC ReferenceSeq_Release(const ReferenceSeq* cself);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_writer_reference_ */
diff --git a/interfaces/align/writer-refseq.h b/interfaces/align/writer-refseq.h
deleted file mode 100644
index 3f3e44a..0000000
--- a/interfaces/align/writer-refseq.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_writer_refseq_
-#define _h_align_writer_refseq_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#include <vdb/manager.h>
-#include <align/writer-cmn.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* default sequence chunk length */
-#define TableWriterRefSeq_MAX_SEQ_LEN 5000
-
-/* use in TableWriterRefSeq_Write* methods */
-enum ETableWriterRefSeq_ColNames {
-    ewrefseq_cn_MAX_SEQ_LEN, /* static/default */
-    ewrefseq_cn_DEF_LINE, /* static/default */
-    ewrefseq_cn_CS_KEY, /* handled by writer */
-    ewrefseq_cn_READ,
-    ewrefseq_cn_QUALITY, /* optional */
-    ewrefseq_cn_SEQ_ID, /* static/default */
-    ewrefseq_cn_SEQ_START, /* calculated on fly by writer */
-    ewrefseq_cn_SEQ_LEN, /* calculated on fly by writer */
-    ewrefseq_cn_CIRCULAR, /* static/default */
-    ewrefseq_cn_Last = ewrefseq_cn_CIRCULAR
-};
-
-enum ETableWriterRefSeq_ColOptions {
-    ewrefseq_co_QUALITY = 0x01 /* use QUALITY column, by default not opened */
-};
-
-typedef struct TableWriterRefSeqData_struct {
-    TableWriterData read;
-    TableWriterData quality;
-} TableWriterRefSeqData;
-
-typedef struct TableWriterRefSeq TableWriterRefSeq;
-
-ALIGN_EXTERN rc_t CC TableWriterRefSeq_Make(const TableWriterRefSeq** cself, VDBManager* mgr, const char* schema_path,
-                                            const char* table_path, const uint32_t options);
-
-/* rows optional here, app signature is mandatory */
-ALIGN_EXTERN rc_t CC TableWriterRefSeq_Whack(const TableWriterRefSeq* cself, bool commit, uint64_t* rows,
-                                             const char loader_name[],
-                                             const ver_t loader_version,
-                                             const char loader_date[],
-                                             const char app_name[],
-                                             const ver_t app_version);
-
-ALIGN_EXTERN rc_t CC TableWriterRefSeq_WriteDefault(const TableWriterRefSeq* cself,
-                                                    enum ETableWriterRefSeq_ColNames col, const TableWriterData* data);
-
-/* rowid optional here */
-ALIGN_EXTERN rc_t CC TableWriterRefSeq_Write(const TableWriterRefSeq* cself, const TableWriterRefSeqData* data, int64_t* rowid);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_writer_refseq_ */
diff --git a/interfaces/align/writer-sequence.h b/interfaces/align/writer-sequence.h
deleted file mode 100644
index 2283654..0000000
--- a/interfaces/align/writer-sequence.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_writer_sequence_
-#define _h_align_writer_sequence_
-
-#ifndef _h_align_extern_
-#include <align/extern.h>
-#endif
-
-#include <align/writer-cmn.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum ETableWriterSeq_ColNames {
-    ewseq_cn_READ,
-    ewseq_cn_CSREAD,
-    ewseq_cn_CSKEY,
-    ewseq_cn_QUALITY,
-    ewseq_cn_PRIMARY_ALIGNMENT_ID,
-    ewseq_cn_ALIGNMENT_COUNT,
-    ewseq_cn_PLATFORM,
-    ewseq_cn_LABEL,
-    ewseq_cn_LABEL_START,
-    ewseq_cn_LABEL_LEN,
-    ewseq_cn_READ_TYPE,
-    ewseq_cn_READ_START,
-    ewseq_cn_READ_LEN,
-    ewseq_cn_TMP_KEY_ID,
-    ewseq_cn_SPOT_GROUP,
-    ewseq_cn_READ_FILTER,
-    ewseq_cn_TI,
-    ewseq_cn_Last = ewseq_cn_TI
-};
-
-enum ETableWriterSeq_ColOptions {
-    ewseq_co_SaveRead = 0x01,    /* write read even when there are alignments */
-    ewseq_co_FullQuality = 0x02, /* write full quality values, by default [1,10,20,30] */
-    ewseq_co_AlignData = 0x04,   /* PRIMARY_ALIGNMENT_ID, ALIGNMENT_COUNT will be written with the whole record */
-    ewseq_co_NoLabelData = 0x08, /* LABEL and related columns will not be written */
-    ewseq_co_ColorSpace = 0x10,  /* CMP_CSREAD will be written instead of CMP_READ */
-    ewseq_co_SpotGroup = 0x20,   /* SPOT_GROUP will be written */
-    ewseq_co_TI = 0x40,          /* TI will be written */
-    ewseq_co_SaveQual = 0x80     /* write quality even when there are alignments */
-};
-
-typedef struct TableWriterSeqData_struct {
-    TableWriterData sequence; /* writes sequence ONLY if alignment_count == 0 */
-    TableWriterData quality;
-    TableWriterData primary_alignment_id;
-    TableWriterData alignment_count;
-    TableWriterData label;
-    TableWriterData label_start;
-    TableWriterData label_len;
-    uint8_t nreads;
-    TableWriterData read_type;
-    TableWriterData read_start;
-    TableWriterData read_len;
-    uint64_t tmp_key_id;
-    TableWriterData spot_group;
-    TableWriterData cskey;
-    TableWriterData read_filter;
-    TableWriterData no_quantize_mask;
-    TableWriterData platform;
-    TableWriterData ti;
-} TableWriterSeqData;
-
-typedef struct TableWriterSeq TableWriterSeq;
-
-/*
- * quality_quantization:
- *  is a ',' seperated list of value pairs, with the pairs seperated by ':'.
- *  The first of the pair is the value to substitute.
- *  The second is the limit at which the substitution is no longer valid.
- *  The second value can be '-' to indication the remainder; this also terminates
- *  processing of the string.  If the second value is not '-', then the trailing
- *  ',' is required.
- *
- *  Example: 1:10,10:20,20:30,30:40,
- *  This will substitute 1 for quality values [0, 10), 10 for [10, 20),
- *  20 for [20, 30), 30 for [30, 40), and 0 for the rest
- *
- *  Example: 1:10,10:20,20:30,30:-
- *  This will substitute 1 for quality values [0, 10), 10 for [10, 20),
- *  20 for [20, 30), and 30 for the rest
- *
- *  Example: 1:30,30:-
- *  This will substitute 1 for quality values [0, 30), and 30 for the rest
- *
- *  Example: 10:30,20:-
- *  This will substitute 10 for quality values [0, 30), 20 for the rest
- */
-ALIGN_EXTERN rc_t CC TableWriterSeq_Make(const TableWriterSeq** cself, VDatabase* db,
-                                         const uint32_t options, char const quality_quantization[]);
-
-/* rows optional here */
-ALIGN_EXTERN rc_t CC TableWriterSeq_Whack(const TableWriterSeq* cself, bool commit, uint64_t* rows);
-
-ALIGN_EXTERN rc_t CC TableWriteSeq_WriteDefault(const TableWriterSeq* cself,
-                                                enum ETableWriterSeq_ColNames col, const TableWriterData* data);
-
-ALIGN_EXTERN rc_t CC TableWriterSeq_GetNextRowId(const TableWriterSeq* cself, int64_t* rowid);
-
-/* rowid optional here */
-ALIGN_EXTERN rc_t CC TableWriterSeq_Write(const TableWriterSeq* cself, const TableWriterSeqData* data, int64_t* rowid);
-
-
-/* if option ewseq_co_AlignData is not set (default) below methods are available */
-
-/* closes main cursor and creates lookup object on the successfully committed main cursor */
-ALIGN_EXTERN rc_t CC TableWriterSeq_TmpKeyStart(const TableWriterSeq* cself);
-
-/* retrieve TMP_KEY value by rowid */
-ALIGN_EXTERN rc_t CC TableWriterSeq_TmpKey(const TableWriterSeq* cself, int64_t rowid, uint64_t *key_id);
-
-/* passing rowid == 0 will cause the cursor to be flushed */
-ALIGN_EXTERN rc_t CC TableWriterSeq_WriteAlignmentData(const TableWriterSeq* cself, int64_t rowid,
-                                                       const TableWriterData* primary_alignment_id,
-                                                       const TableWriterData* alignment_count);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_align_writer_sequence_ */
diff --git a/interfaces/cc/gcc/compiler.h b/interfaces/cc/gcc/compiler.h
deleted file mode 100644
index d1bf565..0000000
--- a/interfaces/cc/gcc/compiler.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_compiler_
-#define _h_compiler_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_compiler_ */
-
diff --git a/interfaces/cc/gcc/i386/arch-impl.h b/interfaces/cc/gcc/i386/arch-impl.h
deleted file mode 100644
index 5163ddc..0000000
--- a/interfaces/cc/gcc/i386/arch-impl.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_arch_impl_
-#define _h_arch_impl_
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static __inline__
-int16_t uint16_lsbit ( uint16_t self )
-{
-    int16_t rtn;
-    __asm__ __volatile__
-    (
-        "bsf %%ax, %%ax;"
-        "jnz .+5;"
-        "xor %%eax, %%eax;"
-        "dec %%eax;"
-        : "=a" ( rtn )
-        : "a" ( self )
-    );
-    return rtn;
-}
-
-static __inline__
-int32_t uint32_lsbit ( uint32_t self )
-{
-    int32_t rtn;
-    __asm__ __volatile__
-    (
-        "bsf %%eax, %%eax;"
-        "jnz .+5;"
-        "xor %%eax, %%eax;"
-        "dec %%eax;"
-        : "=a" ( rtn )
-        : "a" ( self )
-    );
-    return rtn;
-}
-
-typedef struct int128_t int128_t;
-struct int128_t
-{
-    uint64_t lo;
-    int64_t hi;
-};
-
-static __inline__
-int64_t int128_hi ( const int128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline__
-uint64_t int128_lo ( const int128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline__
-void int128_sethi ( int128_t *self, int64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline__
-void int128_setlo ( int128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-typedef struct uint128_t uint128_t;
-struct uint128_t
-{
-    uint64_t lo;
-    uint64_t hi;
-};
-
-static __inline__
-uint64_t uint128_hi ( const uint128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline__
-uint64_t uint128_lo ( const uint128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline__
-void uint128_sethi ( uint128_t *self, uint64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline__
-void uint128_setlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-static __inline__
-void int128_add ( int128_t *self, const int128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 4(%%edx), %%ebx;"
-        "mov 8(%%edx), %%esi;"
-        "mov 12(%%edx), %%edi;"
-        "add %%eax, (%%ecx);"
-        "adc %%ebx, 4(%%ecx);"
-        "adc %%esi, 8(%%ecx);"
-        "adc %%edi, 12(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( self ), "d" ( i )
-        : "%eax", "%esi", "%edi"
-    );
-}
-
-static __inline__
-void int128_sub ( int128_t *self, const int128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 4(%%edx), %%ebx;"
-        "mov 8(%%edx), %%esi;"
-        "mov 12(%%edx), %%edi;"
-        "sub %%eax, (%%ecx);"
-        "sbb %%ebx, 4(%%ecx);"
-        "sbb %%esi, 8(%%ecx);"
-        "sbb %%edi, 12(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( self ), "d" ( i )
-        : "%eax", "%esi", "%edi"
-    );
-}
-
-static __inline__
-void int128_sar ( int128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov 4(%%edx), %%eax;"
-        "shrd %%cl, %%eax, (%%edx);"
-        "mov 8(%%edx), %%eax;"
-        "shrd %%cl, %%eax, 4(%%edx);"
-        "mov 12(%%edx), %%eax;"
-        "shrd %%cl, %%eax, 8(%%edx);"
-        "sar %%cl, %%eax;"
-        "mov %%eax, 12(%%edx);"
-        :
-        : "d" ( self ), "c" ( i )
-        :  "%eax"
-    );
-}
-
-static __inline__
-void int128_shl ( int128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov 8(%%edx), %%eax;"
-        "shld %%cl, %%eax, 12(%%edx);"
-        "mov 4(%%edx), %%eax;"
-        "shld %%cl, %%eax, 8(%%edx);"
-        "mov (%%edx), %%eax;"
-        "shld %%cl, %%eax, 4(%%edx);"
-        "shl %%cl, %%eax;"
-        "mov %%eax, (%%edx);"
-        :
-        : "d" ( self ), "c" ( i )
-        :  "%eax"
-    );
-}
-
-static __inline__
-void uint128_and ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 4(%%edx), %%ebx;"
-        "mov 8(%%edx), %%esi;"
-        "mov 12(%%edx), %%edi;"
-        "and %%eax, (%%ecx);"
-        "and %%ebx, 4(%%ecx);"
-        "and %%esi, 8(%%ecx);"
-        "and %%edi, 12(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( self ), "d" ( i )
-        : "%eax", "%esi", "%edi"
-    );
-}
-
-static __inline__
-void uint128_or ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 4(%%edx), %%ebx;"
-        "mov 8(%%edx), %%esi;"
-        "mov 12(%%edx), %%edi;"
-        "or %%eax, (%%ecx);"
-        "or %%ebx, 4(%%ecx);"
-        "or %%esi, 8(%%ecx);"
-        "or %%edi, 12(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( self ), "d" ( i )
-        : "%eax", "%esi", "%edi"
-    );
-}
-
-static __inline__
-void uint128_orlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo |= i;
-}
-
-static __inline__
-void uint128_xor ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 4(%%edx), %%ebx;"
-        "mov 8(%%edx), %%esi;"
-        "mov 12(%%edx), %%edi;"
-        "xor %%eax, (%%ecx);"
-        "xor %%ebx, 4(%%ecx);"
-        "xor %%esi, 8(%%ecx);"
-        "xor %%edi, 12(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( self ), "d" ( i )
-        : "%eax", "%esi", "%edi"
-    );
-}
-
-static __inline__
-void uint128_not ( uint128_t *self )
-{
-    __asm__ __volatile__
-    (
-        "notl (%%ecx);"
-        "notl 4(%%ecx);"
-        "notl 8(%%ecx);"
-        "notl 12(%%ecx);"
-        :
-        : "c" ( self )
-    );
-}
-
-static __inline__
-void uint128_shr ( uint128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov 4(%%edx), %%eax;"
-        "shrd %%cl, %%eax, (%%edx);"
-        "mov 8(%%edx), %%eax;"
-        "shrd %%cl, %%eax, 4(%%edx);"
-        "mov 12(%%edx), %%eax;"
-        "shrd %%cl, %%eax, 8(%%edx);"
-        "shr %%cl, %%eax;"
-        "mov %%eax, 12(%%edx);"
-        :
-        : "d" ( self ), "c" ( i )
-        :  "%eax"
-    );
-}
-
-static __inline__
-void uint128_shl ( uint128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov 8(%%edx), %%eax;"
-        "shld %%cl, %%eax, 12(%%edx);"
-        "mov 4(%%edx), %%eax;"
-        "shld %%cl, %%eax, 8(%%edx);"
-        "mov (%%edx), %%eax;"
-        "shld %%cl, %%eax, 4(%%edx);"
-        "shl %%cl, %%eax;"
-        "mov %%eax, (%%edx);"
-        :
-        : "d" ( self ), "c" ( i )
-        :  "%eax"
-    );
-}
-
-static __inline__
-void uint128_bswap ( uint128_t *self )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%ecx), %%eax;"
-        "mov 12(%%ecx), %%edx;"
-        "bswap %%eax;"
-        "bswap %%edx;"
-        "mov %%eax, 12(%%ecx);"
-        "mov %%edx, (%%ecx);"
-        "mov 4(%%ecx), %%eax;"
-        "mov 8(%%ecx), %%edx;"
-        "bswap %%eax;"
-        "bswap %%edx;"
-        "mov %%eax, 8(%%ecx);"
-        "mov %%edx, 4(%%ecx);"
-        :
-        : "c" ( self )
-        :  "%eax", "%edx"
-    );
-}
-
-static __inline__
-void uint128_bswap_copy ( uint128_t *to, const uint128_t *from )
-{
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%edx), %%eax;"
-        "mov 12(%%edx), %%ebx;"
-        "bswap %%eax;"
-        "bswap %%ebx;"
-        "mov %%eax, 12(%%ecx);"
-        "mov %%ebx, (%%ecx);"
-        "mov 4(%%edx), %%eax;"
-        "mov 8(%%edx), %%ebx;"
-        "bswap %%eax;"
-        "bswap %%ebx;"
-        "mov %%eax, 8(%%ecx);"
-        "mov %%ebx, 4(%%ecx);"
-        "pop %%ebx;"
-        :
-        : "c" ( to ), "d" ( from )
-        :  "%eax"
-    );
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_arch_impl_ */
diff --git a/interfaces/cc/gcc/i386/atomic.h b/interfaces/cc/gcc/i386/atomic.h
deleted file mode 100644
index f0abfc2..0000000
--- a/interfaces/cc/gcc/i386/atomic.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic_
-#define _h_atomic_
-
-#ifndef _h_atomic32_
-#include "atomic32.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef int atomic_int;
-typedef struct atomic32_t atomic_t;
-
-/* ( * v ) */
-#define atomic_read( v ) \
-    atomic32_read ( v )
-
-/* ( * v ) = i */
-#define atomic_set( v, i ) \
-    atomic32_set ( v, i )
-
-/* prior = ( * v ), ( * v ) += i, prior */
-#define atomic_read_and_add( v, i ) \
-    atomic32_read_and_add ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add( v, i ) \
-    atomic32_add ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add_and_read( v, i ) \
-    atomic32_add_and_read ( v, i )
-
-/* ( void ) ++ ( * v ) */
-#define atomic_inc( v ) \
-    atomic32_inc ( v )
-
-/* ( void ) -- ( * v ) */
-#define atomic_dec( v ) \
-    atomic32_dec ( v )
-
-/* -- ( * v ) == 0 */
-#define atomic_dec_and_test( v ) \
-    atomic32_dec_and_test ( v )
-
-/* ++ ( * v ) == 0
-   when atomic_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-#define atomic_inc_and_test( v ) \
-    atomic32_inc_and_test ( v )
-
-/* ( * v ) -- == 0
-   HERE's useful */
-#define atomic_test_and_inc( v ) \
-    atomic32_test_and_inc ( v )
-
-/* prior = ( * v ), ( * v ) = ( prior == t ? s : prior ), prior */
-#define atomic_test_and_set( v, s, t ) \
-    atomic32_test_and_set ( v, s, t )
-
-/* N.B. - THIS FUNCTION IS FOR 32 BIT PTRS ONLY */
-static __inline__ void *atomic_test_and_set_ptr ( void *volatile *v, void *s, void *t )
-{
-    void *rtn;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "cmpxchg %%edx,(%%ecx)"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( s ), "a" ( t )
-    );
-    return rtn;
-}
-
-/* val = ( * v ), ( ( * v ) = ( val < t ) ? val + i : val ), val */
-#define atomic_read_and_add_lt( v, i, t ) \
-    atomic32_read_and_add_lt ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val <= t ) ? val + i : val ), val */
-#define atomic_read_and_add_le( v, i, t ) \
-    atomic32_read_and_add_le ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val == t ) ? val + i : val ), val */
-#define atomic_read_and_add_eq( v, i, t ) \
-    atomic32_read_and_add_eq ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val != t ) ? val + i : val ), val */
-#define atomic_read_and_add_ne( v, i, t ) \
-    atomic32_read_and_add_ne ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val >= t ) ? val + i : val ), val */
-#define atomic_read_and_add_ge( v, i, t ) \
-    atomic32_read_and_add_ge ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val > t ) ? val + i : val ), val */
-#define atomic_read_and_add_gt( v, i, t ) \
-    atomic32_read_and_add_gt ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 1 ) ? val + i : val ), val */
-#define atomic_read_and_add_odd( v, i ) \
-    atomic32_read_and_add_odd ( v, i )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 0 ) ? val + i : val ), val */
-#define atomic_read_and_add_even( v, i ) \
-    atomic32_read_and_add_even ( v, i )
-
-/* DEPRECATED */
-
-/* val = ( * v ), ( * v ) = ( val < t ? val + i : val ), ( val < t ? 1 : 0 ) */
-#define atomic_add_if_lt( v, i, t ) \
-    atomic32_add_if_lt ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val <= t ? val + i : val ), ( val <= t ? 1 : 0 ) */
-#define atomic_add_if_le( v, i, t ) \
-    atomic32_add_if_le ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val == t ? val + i : val ), ( val == t ? 1 : 0 ) */
-#define atomic_add_if_eq( v, i, t ) \
-    atomic32_add_if_eq ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val >= t ? val + i : val ), ( val >= t ? 1 : 0 ) */
-#define atomic_add_if_ge( v, i, t ) \
-    atomic32_add_if_ge ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val > t ? val + i : val ), ( val > t ? 1 : 0 ) */
-#define atomic_add_if_gt( v, i, t ) \
-    atomic32_add_if_gt ( v, i, t )
-
-#undef LOCK
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic_ */
diff --git a/interfaces/cc/gcc/i386/atomic32.h b/interfaces/cc/gcc/i386/atomic32.h
deleted file mode 100644
index 55273b0..0000000
--- a/interfaces/cc/gcc/i386/atomic32.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic32_
-#define _h_atomic32_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct atomic32_t atomic32_t;
-struct atomic32_t
-{
-    volatile int counter;
-};
-
-/* int atomic32_read ( const atomic32_t *v ); */
-#define atomic32_read( v ) \
-    ( ( v ) -> counter )
-
-/* void atomic32_set ( atomic32_t *v, int i ); */
-#define atomic32_set( v, i ) \
-    ( ( void ) ( ( ( v ) -> counter ) = ( i ) ) )
-
-/* add to v -> counter and return the prior value */
-static __inline__ int atomic32_read_and_add ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "mov %%edx, %%ebx;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-8;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i )
-    );
-    return rtn;
-}
-
-/* if no read is needed, define the least expensive atomic add */
-#define atomic32_add( v, i ) \
-    atomic32_read_and_add ( v, i )
-
-/* add to v -> counter and return the result */
-static __inline__ int atomic32_add_and_read ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "mov %%edx, %%ebx;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-8;"
-        "mov %%ebx, %%eax;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i )
-    );
-    return rtn;
-}
-
-/* just don't try to find out what the result was */
-static __inline__ void atomic32_inc ( atomic32_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incl %0"
-        :"=m" (v->counter)
-        :"m" (v->counter)
-    );
-}
-
-static __inline__ void atomic32_dec ( atomic32_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decl %0"
-        :"=m" (v->counter)
-        :"m" (v->counter)
-    );
-}
-
-/* decrement by one and test result for 0 */
-static __inline__ int atomic32_dec_and_test ( atomic32_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decl %0;"
-        "sete %1"
-        :"=m" (v->counter), "=qm" (c)
-        :"m" (v->counter) : "memory"
-    );
-    return c;
-}
-
-/* when atomic32_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-static __inline__ int atomic32_inc_and_test ( atomic32_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incl %0;"
-        "sete %1"
-        :"=m" (v->counter), "=qm" (c)
-        :"m" (v->counter) : "memory"
-    );
-    return c;
-}
-
-/* HERE's useful */
-#define atomic32_test_and_inc( v ) \
-    ( atomic32_read_and_add ( v, 1 ) == 0 )
-
-static __inline__ int atomic32_test_and_set ( atomic32_t *v, int s, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "cmpxchg %%edx,(%%ecx)"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( s ), "a" ( t )
-    );
-    return rtn;
-}
-
-/* conditional modifications */
-static __inline__
-int atomic32_read_and_add_lt ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "jge .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_lt( v, i, t ) \
-    ( atomic32_read_and_add_lt ( v, i, t ) < ( t ) )
-
-static __inline__
-int atomic32_read_and_add_le ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "jg .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_le( v, i, t ) \
-    ( atomic32_read_and_add_le ( v, i, t ) <= ( t ) )
-
-static __inline__
-int atomic32_read_and_add_eq ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "jne .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_eq( v, i, t ) \
-    ( atomic32_read_and_add_eq ( v, i, t ) == ( t ) )
-
-static __inline__
-int atomic32_read_and_add_ne ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "je .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_ne( v, i, t ) \
-    ( atomic32_read_and_add_ne ( v, i, t ) != ( t ) )
-
-static __inline__
-int atomic32_read_and_add_ge ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "jl .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_ge( v, i, t ) \
-    ( atomic32_read_and_add_ge ( v, i, t ) >= ( t ) )
-
-static __inline__
-int atomic32_read_and_add_gt ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "cmp %%esi, %%eax;"
-        "mov %%edx, %%ebx;"
-        "jle .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-12;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i ), "S" ( t )
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_gt( v, i, t ) \
-    ( atomic32_read_and_add_gt ( v, i, t ) > ( t ) )
-
-static __inline__
-int atomic32_read_and_add_odd ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "bt $0, %%ax;"
-        "mov %%edx, %%ebx;"
-        "jnc .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-15;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i )
-    );
-    return rtn;
-}
-
-static __inline__
-int atomic32_read_and_add_even ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "push %%ebx;"
-        "mov (%%ecx), %%eax;"
-        "bt $0, %%ax;"
-        "mov %%edx, %%ebx;"
-        "jc .+10;"
-        "add %%eax, %%ebx;"
-        "lock;"
-        "cmpxchg %%ebx, (%%ecx);"
-        "jne .-15;"
-        "pop %%ebx"
-        : "=a" ( rtn ), "=c" ( v )
-        : "c" ( v ), "d" ( i )
-    );
-    return rtn;
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic32_ */
diff --git a/interfaces/cc/gcc/i386/bitstr.h b/interfaces/cc/gcc/i386/bitstr.h
deleted file mode 100644
index a2e07ef..0000000
--- a/interfaces/cc/gcc/i386/bitstr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_bitstr_
-#define _h_bitstr_
-
-/* use 32-bit accumulator, 16-bit word size */
-#define WRDSIZE 16
-#define WRDSHIFT 4
-#define WRD uint16_t
-#define ACC uint32_t
-#define BSWAP( x ) bswap_16 ( x )
-
-#include "../noarch/bitstr.h"
-
-#endif /* _h_bitstr_ */
diff --git a/interfaces/cc/gcc/i386/byteswap.h b/interfaces/cc/gcc/i386/byteswap.h
deleted file mode 100644
index 3cc5770..0000000
--- a/interfaces/cc/gcc/i386/byteswap.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_byteswap_
-#define _h_byteswap_
-
-#ifdef _BYTESWAP_H
-#warning "GNU byteswap.h being used"
-#else
-#define _BYTESWAP_H	1234
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* perform single instruction byte swap */
-static __inline__ uint16_t bswap_16 ( uint16_t i )
-{
-    register uint16_t rtn;
-    __asm__
-    (
-        "rorw $8, %w0"
-        : "=r" ( rtn )
-        : "0" ( i )
-        : "cc"
-    );
-    return rtn;
-}
-
-/* perform single instruction byte swap */
-static __inline__ uint32_t bswap_32 ( uint32_t i )
-{
-    register uint32_t rtn;
-    __asm__
-    (
-        "bswap %0"
-        : "=r" ( rtn )
-        : "0" ( i )
-        : "cc"
-    );
-    return rtn;
-}
-
-/* perform multi-instruction byte swap */
-static __inline__ uint64_t bswap_64 ( uint64_t i )
-{
-    union
-    {
-        uint64_t ll;
-        uint32_t l [ 2 ];
-    } in, rtn;
-    in . ll = i;
-    rtn . l [ 0 ] = bswap_32 ( in . l [ 1 ] );
-    rtn . l [ 1 ] = bswap_32 ( in . l [ 0 ] );
-    return rtn . ll;
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _BYTESWAP_H */
-#endif /* _h_byteswap_ */
diff --git a/interfaces/cc/gcc/i386/strtol.h b/interfaces/cc/gcc/i386/strtol.h
deleted file mode 100644
index 79f462f..0000000
--- a/interfaces/cc/gcc/i386/strtol.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_strtol_
-#define _h_strtol_
-
-#ifndef _h_os_native_
-#include <os-native.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * strtoi32
- * strtoi32
- *  based upon actual usage
- */
-#define strtoi32( str, endp, base ) \
-    strtol ( str, endp, base )
-
-#define strtou32( str, endp, base ) \
-    strtoul ( str, endp, base )
-
-
-/*--------------------------------------------------------------------------
- * strtoi64
- * strtoi64
- *  based upon actual usage
- */
-#define strtoi64( str, endp, base ) \
-    strtoll ( str, endp, base )
-
-#define strtou64( str, endp, base ) \
-    strtoull ( str, endp, base )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_strtol_ */
diff --git a/interfaces/cc/gcc/noarch/bitstr.h b/interfaces/cc/gcc/noarch/bitstr.h
deleted file mode 100644
index 2bb5bd0..0000000
--- a/interfaces/cc/gcc/noarch/bitstr.h
+++ /dev/null
@@ -1,413 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_noarch_bitstr_
-#define _h_noarch_bitstr_
-
-#ifndef _h_bitstr_
-#error "don't include <noarch/bitstr.h> directly - use <bitstr.h>"
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <byteswap.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* bitcpy
- *  copy a string of bits from source to dest
- *
- *  both source and dest may have non-byte aligned pointers
- *  the number of bits to copy need not be byte aligned
- *
- *  depending upon architecture and OS conventions, the word
- *  size may be adjusted to 1, 2, or 4 bytes, where the base
- *  pointers are always word aligned.
- *
- *  bits in memory are always treated as big-endian, meaning
- *  that on multi-byte fetches and stores, we perform byte-swapping
- *  if there are shifts or masks
- */
-static __inline__
-void bitcpy ( void *dbase, bitsz_t doff, const void *sbase, bitsz_t soff, bitsz_t sz )
-{
-    /* noop if sz == 0 */
-    if ( sz != 0 )
-    {
-        /* loop counter and destination word count */
-        size_t i, dcountz;
-
-        /* left & right masks and working register */
-        WRD lmask, rmask, reg;
-
-        /* produce word-aligned pointers */
-#if WRDSIZE == 8
-        /* 1-4. all at once */
-        WRD *dst = ( WRD* ) dbase + ( doff >> WRDSHIFT );
-        const WRD *src = ( const WRD* ) sbase + ( soff >> WRDSHIFT );
-#else
-        /* 1. capture word alignment adjustment */
-        size_t dadjust = ( size_t ) dbase & ( WRDSIZE / 8 - 1 );
-        size_t sadjust = ( size_t ) sbase & ( WRDSIZE / 8 - 1 );
-
-        /* 2. create word-aligned pointers */
-        WRD *dst = ( WRD* ) ( ( size_t ) dbase - dadjust );
-        const WRD *src = ( const WRD* ) ( ( size_t ) sbase - sadjust );
-
-        /* 3. incorporate alignment adjustment into offset bits */
-        doff += dadjust << 3;
-        soff += sadjust << 3;
-
-        /* 4. readjust pointers based upon offset */
-        dst += doff >> WRDSHIFT;
-        src += soff >> WRDSHIFT;
-#endif
-        /* 5. restate offsets */
-        doff &= ( WRDSIZE - 1 );
-        soff &= ( WRDSIZE - 1 );
-
-        /* calculate number of words - 1 in dst */
-        dcountz = ( doff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT;
-
-        /* calculate masks */
-        lmask = rmask = ~ 0;
-        lmask >>= doff;
-        rmask >>= ( doff + sz ) & ( WRDSIZE - 1 );
-        if ( ( WRD ) ( rmask + 1 ) == 0 )
-            rmask = 0;
-
-        /* prime register with masked dst [ 0 ] */
-        reg = BSWAP ( dst [ 0 ] ) & ~ lmask;
-
-        /* if source and destination are aligned */
-        if ( doff == soff )
-        {
-            /* merge src [ 0 ] into reg through mask */
-            reg |= BSWAP ( src [ 0 ] ) & lmask;
-
-#if WRDSIZE > 8
-            /* straight copies don't need byteswap                                                                                                                                                           
-               other than on first and last words                                                                                                                                                            
-               put first word back into little-endian                                                                                                                                                        
-               for remainder of loop */
-            if ( dcountz > 0 )
-            {
-                reg = BSWAP ( reg );
-#endif
-                /* aligned buffers have n:n word ratio */
-                for ( i = 0; i < dcountz; )
-                {
-                    dst [ i ] = reg;
-                    reg = src [ ++ i ];
-                }
-
-#if WRDSIZE > 8
-                /* revert to big-endian */
-                reg = BSWAP ( reg );
-            }
-#endif
-        }
-
-        /* shifting alignment  */
-        else
-        {
-            /* source count may differ from dest count */
-            size_t scountz = ( soff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT;
-
-            /* use double-word accumulator */
-            ACC acc = BSWAP ( src [ 0 ] );
-
-            /* shift amount */
-            int shift = ( int ) doff - ( int ) soff;
-            if ( shift > 0 )
-            {
-                /* take only valid bits in shifted initial src */
-                reg |= ( WRD ) ( acc >> shift ) & lmask;
-
-                /* because "shift" > 0, we know "dcountz" >= "scountz" */
-                for ( acc <<= WRDSIZE, i = 0; i < scountz; acc <<= WRDSIZE )
-                {
-                    dst [ i ] = BSWAP ( reg );
-                    ++ i;
-                    acc |= BSWAP ( src [ i ] );
-                    reg = ( WRD ) ( acc >> shift );
-                }
-
-                /* if "dcountz" > "scountz" */
-                if ( i < dcountz )
-                {
-                    dst [ i ] = BSWAP ( reg );
-                    reg = ( WRD ) ( acc >> shift );
-                }
-            }
-
-            else
-            {
-                /* need single word read-ahead and right-shift */
-                shift += WRDSIZE;
-
-                /* because "shift" was < 0, we know "dcountz" <= "scountz" */
-                for ( acc <<= WRDSIZE, i = 0; i < dcountz; acc <<= WRDSIZE )
-                {
-                    acc |= BSWAP ( src [ i + 1 ] );
-                    reg |= ( WRD ) ( acc >> shift ) & lmask;
-                    dst [ i ++ ] = BSWAP ( reg );
-                    lmask = ~ 0;
-                    reg = 0;
-                }
-
-                /* if "dcountz" < "scountz" */
-                if ( i < scountz )
-                    acc |= BSWAP ( src [ scountz ] );
-
-                reg |= ( WRD ) ( acc >> shift ) & lmask;
-            }
-        }
-
-        /* mask off unused bytes from src */
-        reg &= ~ rmask;
-
-        /* bring in saved bits from dst */
-        reg |= BSWAP ( dst [ dcountz ] ) & rmask;
-
-        /* write out last word */
-        dst [ dcountz ] = BSWAP ( reg );
-    }
-}
-
-/* bitcmp
- *  performs bitwise a - b, returning result as int
- *  result value has no meaning, only sign
- *  where < 0 means a < b, > 0 means a > b, and 0 means a == b
- *
- *  since the comparison produces a tri-state indicator of
- *  relative magnitude, the order of "a" and "b" is important.
- *  furthermore, the difference operator must be evaluated
- *  left to right, because the result indicates more than
- *  equality.
- *
- *  see bitcpy for general word alignment information
- */
-static __inline__
-int bitcmp ( const void *abase, bitsz_t aoff, const void *bbase, bitsz_t boff, bitsz_t sz )
-{
-    int diff = 0;
-
-    if ( sz != 0 )
-    {
-        /* loop counter and left word count */
-        size_t i, lcountz;
-
-        /* left & right masks and working registers */
-        WRD lmask, rmask, lreg, rreg;
-
-        /* produce word-aligned pointers */
-#if WRDSIZE == 8
-        /* 1-4. all at once */
-        const WRD *left = ( const WRD* ) abase + ( aoff >> WRDSHIFT );
-        const WRD *right = ( const WRD* ) bbase + ( boff >> WRDSHIFT );
-#else
-        /* 1. capture word alignment adjustment */
-        size_t aadjust = ( size_t ) abase & ( WRDSIZE / 8 - 1 );
-        size_t badjust = ( size_t ) bbase & ( WRDSIZE / 8 - 1 );
-
-        /* 2. create word-aligned pointers */
-        const WRD *left = ( const WRD* ) ( ( size_t ) abase - aadjust );
-        const WRD *right = ( const WRD* ) ( ( size_t ) bbase - badjust );
-
-        /* 3. incorporate alignment adjustment into offset bits */
-        aoff += aadjust << 3;
-        boff += badjust << 3;
-
-        /* 4. readjust pointers based upon offset */
-        left += aoff >> WRDSHIFT;
-        right += boff >> WRDSHIFT;
-#endif
-        /* 5. restate offsets */
-        aoff &= ( WRDSIZE - 1 );
-        boff &= ( WRDSIZE - 1 );
-
-        /* calculate number of words - 1 in left
-           since we know a-priori that "sz" > 0, we
-           know that the left and right counts must be
-           at least 1. our loops treat the last word
-           specially, so calculate a loop counter that
-           excludes the last word */
-        lcountz = ( aoff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT;
-
-        /* calculate masks */
-        lmask = rmask = ~ 0;
-        lmask >>= aoff;
-        rmask >>= ( aoff + sz ) & ( WRDSIZE - 1 );
-        if ( ( WRD ) ( rmask + 1 ) == 0 )
-            rmask = 0;
-
-        /* significant bits from left [ 0 ] */
-        lreg = BSWAP ( left [ 0 ] ) & lmask;
-
-        /* if source and destination are aligned */
-        if ( aoff == boff )
-        {
-            /* test against right bits through mask */
-            rreg = BSWAP ( right [ 0 ] ) & lmask;
-
-            /* produce a difference of all but the last
-               aligned word, where initial word has been
-               left-masked. the last word is tested below. */
-            for ( i = 1; i <= lcountz; ++ i )
-            {
-                diff = ( int ) lreg - ( int ) rreg;
-                if ( diff != 0 )
-                    return diff;
-
-                /* byte-swapping occurs on little-endian architectures */
-                lreg = BSWAP ( left [ i ] );
-                rreg = BSWAP ( right [ i ] );
-            }
-
-            /* fall out to end for masked comparison of last word */
-        }
-
-        /* shifting alignment */
-        else
-        {
-            /* right count may differ from left count
-               since alignments differ, the span of "sz"
-               bits may hit a different number of words in
-               the left array than in the right. */
-            size_t rcountz = ( boff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT;
-
-            /* use double-word accumulator
-               note that the extra bits get ignored */
-            ACC acc = BSWAP ( right [ 0 ] );
-
-            /* shift amount: positive if "b" needs to be right shifted.
-               NOTE - since the comparison must be successively performed
-               from left to right ( see above ), shifting is ALWAYS toward
-               right, making for special handling when "shift" < 0 ( see below ) */
-            int shift = ( int ) aoff - ( int ) boff;
-            if ( shift > 0 )
-            {
-                /* initial word from right operand, aligned with left */
-                rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                /* "shift" > 0 means "lcountz" >= "rcountz" */
-                for ( acc <<= WRDSIZE, i = 1; i <= rcountz; acc <<= WRDSIZE, ++ i )
-                {
-                    /* compare words at i-1 */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* accumulate next word from right operand */
-                    acc |= BSWAP ( right [ i ] );
-
-                    /* bring in next word from left operand */
-                    lreg = BSWAP ( left [ i ] );
-
-                    /* produce aligned word from right operand */
-                    rreg = ( WRD ) ( acc >> shift );
-                }
-
-                /* if there is one more word in left */
-                if ( lcountz > rcountz )
-                {
-                    /* compare penultimate */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* get last word in left */
-                    lreg = BSWAP ( left [ lcountz ] );
-
-                    /* last word from right is already in "acc" */
-                    rreg = ( WRD ) ( acc >> shift );
-                }
-
-                /* fall out to end for masked comparison of last word */
-            }
-
-            else
-            {
-                /* since all shifts must be toward right ( due to left to right
-                   comparison ), this alignment will require a pre-fetch from
-                   right operand into accumulator, and adjusting the negative
-                   shift amount to a positive right-shift. */
-                shift += WRDSIZE;
-
-                /* since "shift" was negative, we know "lcountz" <= "rcountz",
-                   so use "lcountz" as loop limit. pre-shift "acc" as loop init */
-                for ( acc <<= WRDSIZE, i = 1; i <= lcountz; acc <<= WRDSIZE, ++ i )
-                {
-                    /* accumulate next word from right operand */
-                    acc |= BSWAP ( right [ i ] );
-
-                    /* produce aligned word from right operand */
-                    rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                    /* now test against left */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* bring in next word from left operand */
-                    lreg = BSWAP ( left [ i ] );
-
-                    /* no more left mask */
-                    lmask = ~ 0;
-                }
-
-                /* if there is one more word in right */
-                if ( lcountz < rcountz )
-                    acc |= BSWAP ( right [ rcountz ] );
-
-                /* produce "rreg" from "acc" */
-                rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                /* fall out to end for masked comparison of last word */
-            }
-        }
-
-        /* mask off unused bytes from right */
-        lreg &= ~ rmask;
-        rreg &= ~ rmask;
-
-        /* perform final comparison */
-        diff = ( int ) lreg - ( int ) rreg;
-    }
-
-    return diff;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_noarch_bitstr_ */
diff --git a/interfaces/cc/gcc/v128.h b/interfaces/cc/gcc/v128.h
deleted file mode 100644
index e16e31b..0000000
--- a/interfaces/cc/gcc/v128.h
+++ /dev/null
@@ -1,1088 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_v128_
-#define _h_v128_
-
-#include <stdint.h>
-#include <x86intrin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef int8_t   v128_i8_t  __attribute__ ((vector_size (16),__may_alias__));
-typedef uint8_t  v128_u8_t  __attribute__ ((vector_size (16),__may_alias__));
-typedef int16_t  v128_i16_t __attribute__ ((vector_size (16),__may_alias__));
-typedef int32_t  v128_i32_t __attribute__ ((vector_size (16),__may_alias__));
-typedef int64_t  v128_i64_t __attribute__ ((vector_size (16),__may_alias__));
-typedef uint16_t v128_u16_t __attribute__ ((vector_size (16),__may_alias__));
-typedef uint32_t v128_u32_t __attribute__ ((vector_size (16),__may_alias__));
-typedef uint64_t v128_u64_t __attribute__ ((vector_size (16),__may_alias__));
-typedef float    v128_f_t   __attribute__ ((vector_size (16),__may_alias__));
-typedef double   v128_d_t   __attribute__ ((vector_size (16),__may_alias__));
-
-/* NOTE:
- * these types are to hide perceived flaws in the Intel/GCC code
- * don't use them outside of this file.  uint8_t, int8_t and int64_t all
- * fail to compile so the above types can't be used within this file in some 
- * places.
- */
-typedef char          v128_c_t   __attribute__ ((vector_size (16),__may_alias__));
-typedef long long int v128_lli_t __attribute__ ((vector_size (16),__may_alias__));
-
-
-#if USE_VEC_REG
-
-/* SSE
-  movss
-  movaps
-  movups
-  movlps
-  movhps
-  movlhps
-  movhlps
-*/
-
-#ifdef __MMX__
-/* MMX
-   v8qi __builtin_ia32_paddb (v8qi, v8qi)
-   v4hi __builtin_ia32_paddw (v4hi, v4hi)
-   v2si __builtin_ia32_paddd (v2si, v2si)
-   v8qi __builtin_ia32_psubb (v8qi, v8qi)
-   v4hi __builtin_ia32_psubw (v4hi, v4hi)
-   v2si __builtin_ia32_psubd (v2si, v2si)
-   v8qi __builtin_ia32_paddsb (v8qi, v8qi)
-   v4hi __builtin_ia32_paddsw (v4hi, v4hi)
-   v8qi __builtin_ia32_psubsb (v8qi, v8qi)
-   v4hi __builtin_ia32_psubsw (v4hi, v4hi)
-   v8qi __builtin_ia32_paddusb (v8qi, v8qi)
-   v4hi __builtin_ia32_paddusw (v4hi, v4hi)
-   v8qi __builtin_ia32_psubusb (v8qi, v8qi)
-   v4hi __builtin_ia32_psubusw (v4hi, v4hi)
-   v4hi __builtin_ia32_pmullw (v4hi, v4hi)
-   v4hi __builtin_ia32_pmulhw (v4hi, v4hi)
-   di __builtin_ia32_pand (di, di)
-   di __builtin_ia32_pandn (di,di)
-   di __builtin_ia32_por (di, di)
-   di __builtin_ia32_pxor (di, di)
-   v8qi __builtin_ia32_pcmpeqb (v8qi, v8qi)
-   v4hi __builtin_ia32_pcmpeqw (v4hi, v4hi)
-   v2si __builtin_ia32_pcmpeqd (v2si, v2si)
-   v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi)
-   v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi)
-   v2si __builtin_ia32_pcmpgtd (v2si, v2si)
-   v8qi __builtin_ia32_punpckhbw (v8qi, v8qi)
-   v4hi __builtin_ia32_punpckhwd (v4hi, v4hi)
-   v2si __builtin_ia32_punpckhdq (v2si, v2si)
-   v8qi __builtin_ia32_punpcklbw (v8qi, v8qi)
-   v4hi __builtin_ia32_punpcklwd (v4hi, v4hi)
-   v2si __builtin_ia32_punpckldq (v2si, v2si)
-   v8qi __builtin_ia32_packsswb (v4hi, v4hi)
-   v4hi __builtin_ia32_packssdw (v2si, v2si)
-   v8qi __builtin_ia32_packuswb (v4hi, v4hi)
-     
-   v4hi __builtin_ia32_psllw (v4hi, v4hi)
-   v2si __builtin_ia32_pslld (v2si, v2si)
-   v1di __builtin_ia32_psllq (v1di, v1di)
-   v4hi __builtin_ia32_psrlw (v4hi, v4hi)
-   v2si __builtin_ia32_psrld (v2si, v2si)
-   v1di __builtin_ia32_psrlq (v1di, v1di)
-   v4hi __builtin_ia32_psraw (v4hi, v4hi)
-   v2si __builtin_ia32_psrad (v2si, v2si)
-   v4hi __builtin_ia32_psllwi (v4hi, int)
-   v2si __builtin_ia32_pslldi (v2si, int)
-   v1di __builtin_ia32_psllqi (v1di, int)
-   v4hi __builtin_ia32_psrlwi (v4hi, int)
-   v2si __builtin_ia32_psrldi (v2si, int)
-   v1di __builtin_ia32_psrlqi (v1di, int)
-   v4hi __builtin_ia32_psrawi (v4hi, int)
-   v2si __builtin_ia32_psradi (v2si, int)
-*/
-#endif
-
-#ifdef __SSE__
-/* SSE
-   v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
-   v8qi __builtin_ia32_pavgb (v8qi, v8qi)
-   v4hi __builtin_ia32_pavgw (v4hi, v4hi)
-   v1di __builtin_ia32_psadbw (v8qi, v8qi)
-   v8qi __builtin_ia32_pmaxub (v8qi, v8qi)
-   v4hi __builtin_ia32_pmaxsw (v4hi, v4hi)
-   v8qi __builtin_ia32_pminub (v8qi, v8qi)
-   v4hi __builtin_ia32_pminsw (v4hi, v4hi)
-   int __builtin_ia32_pextrw (v4hi, int)
-   v4hi __builtin_ia32_pinsrw (v4hi, int, int)
-   int __builtin_ia32_pmovmskb (v8qi)
-   void __builtin_ia32_maskmovq (v8qi, v8qi, char *)
-   void __builtin_ia32_movntq (di *, di)
-   void __builtin_ia32_sfence (void)
-
-   int __builtin_ia32_comieq (v4sf, v4sf)
-   int __builtin_ia32_comineq (v4sf, v4sf)
-   int __builtin_ia32_comilt (v4sf, v4sf)
-   int __builtin_ia32_comile (v4sf, v4sf)
-   int __builtin_ia32_comigt (v4sf, v4sf)
-   int __builtin_ia32_comige (v4sf, v4sf)
-   int __builtin_ia32_ucomieq (v4sf, v4sf)
-   int __builtin_ia32_ucomineq (v4sf, v4sf)
-   int __builtin_ia32_ucomilt (v4sf, v4sf)
-   int __builtin_ia32_ucomile (v4sf, v4sf)
-   int __builtin_ia32_ucomigt (v4sf, v4sf)
-   int __builtin_ia32_ucomige (v4sf, v4sf)
-   v4sf __builtin_ia32_addps (v4sf, v4sf)
-   v4sf __builtin_ia32_subps (v4sf, v4sf)
-   v4sf __builtin_ia32_mulps (v4sf, v4sf)
-   v4sf __builtin_ia32_divps (v4sf, v4sf)
-   v4sf __builtin_ia32_addss (v4sf, v4sf)
-   v4sf __builtin_ia32_subss (v4sf, v4sf)
-   v4sf __builtin_ia32_mulss (v4sf, v4sf)
-   v4sf __builtin_ia32_divss (v4sf, v4sf)
-   v4si __builtin_ia32_cmpeqps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpltps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpleps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpgtps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpgeps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpunordps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpneqps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpnltps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpnleps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpngtps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpngeps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpordps (v4sf, v4sf)
-   v4si __builtin_ia32_cmpeqss (v4sf, v4sf)
-   v4si __builtin_ia32_cmpltss (v4sf, v4sf)
-   v4si __builtin_ia32_cmpless (v4sf, v4sf)
-   v4si __builtin_ia32_cmpunordss (v4sf, v4sf)
-   v4si __builtin_ia32_cmpneqss (v4sf, v4sf)
-   v4si __builtin_ia32_cmpnlts (v4sf, v4sf)
-   v4si __builtin_ia32_cmpnless (v4sf, v4sf)
-   v4si __builtin_ia32_cmpordss (v4sf, v4sf)
-   v4sf __builtin_ia32_maxps (v4sf, v4sf)
-   v4sf __builtin_ia32_maxss (v4sf, v4sf)
-   v4sf __builtin_ia32_minps (v4sf, v4sf)
-   v4sf __builtin_ia32_minss (v4sf, v4sf)
-   v4sf __builtin_ia32_andps (v4sf, v4sf)
-   v4sf __builtin_ia32_andnps (v4sf, v4sf)
-   v4sf __builtin_ia32_orps (v4sf, v4sf)
-   v4sf __builtin_ia32_xorps (v4sf, v4sf)
-   v4sf __builtin_ia32_movss (v4sf, v4sf)
-   v4sf __builtin_ia32_movhlps (v4sf, v4sf)
-   v4sf __builtin_ia32_movlhps (v4sf, v4sf)
-   v4sf __builtin_ia32_unpckhps (v4sf, v4sf)
-   v4sf __builtin_ia32_unpcklps (v4sf, v4sf)
-   v4sf __builtin_ia32_cvtpi2ps (v4sf, v2si)
-   v4sf __builtin_ia32_cvtsi2ss (v4sf, int)
-   v2si __builtin_ia32_cvtps2pi (v4sf)
-   int __builtin_ia32_cvtss2si (v4sf)
-   v2si __builtin_ia32_cvttps2pi (v4sf)
-   int __builtin_ia32_cvttss2si (v4sf)
-   v4sf __builtin_ia32_rcpps (v4sf)
-   v4sf __builtin_ia32_rsqrtps (v4sf)
-   v4sf __builtin_ia32_sqrtps (v4sf)
-   v4sf __builtin_ia32_rcpss (v4sf)
-   v4sf __builtin_ia32_rsqrtss (v4sf)
-   v4sf __builtin_ia32_sqrtss (v4sf)
-   v4sf __builtin_ia32_shufps (v4sf, v4sf, int)
-*/
-static __inline
-v128_u8_t op_SHUFPS ( v128_u8_t vin1, v128_u8_t vin2, const int mask )
-    __attribute__ ((always_inline));
-
-static __inline
-v128_u8_t op_SHUFPS (v128_u8_t vin1, v128_u8_t vin2, const int mask)
-{
-    return ( v128_u8_t ) __builtin_ia32_shufps ((v128_f_t)vin1, (v128_f_t)vin2, mask);
-}
-
- /*
-   void __builtin_ia32_movntps (float *, v4sf)
-   int __builtin_ia32_movmskps (v4sf)
-
-v4sf __builtin_ia32_loadaps (float *)
-Generates the movaps machine instruction as a load from memory. 
-void __builtin_ia32_storeaps (float *, v4sf)
-Generates the movaps machine instruction as a store to memory. 
-v4sf __builtin_ia32_loadups (float *)
-Generates the movups machine instruction as a load from memory. 
-void __builtin_ia32_storeups (float *, v4sf)
-Generates the movups machine instruction as a store to memory. 
-v4sf __builtin_ia32_loadsss (float *)
-Generates the movss machine instruction as a load from memory. 
-void __builtin_ia32_storess (float *, v4sf)
-Generates the movss machine instruction as a store to memory. 
-v4sf __builtin_ia32_loadhps (v4sf, const v2sf *)
-Generates the movhps machine instruction as a load from memory. 
-v4sf __builtin_ia32_loadlps (v4sf, const v2sf *)
-Generates the movlps machine instruction as a load from memory 
-void __builtin_ia32_storehps (v2sf *, v4sf)
-Generates the movhps machine instruction as a store to memory. 
-void __builtin_ia32_storelps (v2sf *, v4sf)
-Generates the movlps machine instruction as a store to memory.
-*/
-#endif
-
-#ifdef __SSE2__
-/* sse2
-     int __builtin_ia32_comisdeq (v2df, v2df)
-     int __builtin_ia32_comisdlt (v2df, v2df)
-     int __builtin_ia32_comisdle (v2df, v2df)
-     int __builtin_ia32_comisdgt (v2df, v2df)
-     int __builtin_ia32_comisdge (v2df, v2df)
-     int __builtin_ia32_comisdneq (v2df, v2df)
-     int __builtin_ia32_ucomisdeq (v2df, v2df)
-     int __builtin_ia32_ucomisdlt (v2df, v2df)
-     int __builtin_ia32_ucomisdle (v2df, v2df)
-     int __builtin_ia32_ucomisdgt (v2df, v2df)
-     int __builtin_ia32_ucomisdge (v2df, v2df)
-     int __builtin_ia32_ucomisdneq (v2df, v2df)
-     v2df __builtin_ia32_cmpeqpd (v2df, v2df)
-     v2df __builtin_ia32_cmpltpd (v2df, v2df)
-     v2df __builtin_ia32_cmplepd (v2df, v2df)
-     v2df __builtin_ia32_cmpgtpd (v2df, v2df)
-     v2df __builtin_ia32_cmpgepd (v2df, v2df)
-     v2df __builtin_ia32_cmpunordpd (v2df, v2df)
-     v2df __builtin_ia32_cmpneqpd (v2df, v2df)
-     v2df __builtin_ia32_cmpnltpd (v2df, v2df)
-     v2df __builtin_ia32_cmpnlepd (v2df, v2df)
-     v2df __builtin_ia32_cmpngtpd (v2df, v2df)
-     v2df __builtin_ia32_cmpngepd (v2df, v2df)
-     v2df __builtin_ia32_cmpordpd (v2df, v2df)
-     v2df __builtin_ia32_cmpeqsd (v2df, v2df)
-     v2df __builtin_ia32_cmpltsd (v2df, v2df)
-     v2df __builtin_ia32_cmplesd (v2df, v2df)
-     v2df __builtin_ia32_cmpunordsd (v2df, v2df)
-     v2df __builtin_ia32_cmpneqsd (v2df, v2df)
-     v2df __builtin_ia32_cmpnltsd (v2df, v2df)
-     v2df __builtin_ia32_cmpnlesd (v2df, v2df)
-     v2df __builtin_ia32_cmpordsd (v2df, v2df)
-     v2di __builtin_ia32_paddq (v2di, v2di)
-     v2di __builtin_ia32_psubq (v2di, v2di)
-     v2df __builtin_ia32_addpd (v2df, v2df)
-     v2df __builtin_ia32_subpd (v2df, v2df)
-     v2df __builtin_ia32_mulpd (v2df, v2df)
-     v2df __builtin_ia32_divpd (v2df, v2df)
-     v2df __builtin_ia32_addsd (v2df, v2df)
-     v2df __builtin_ia32_subsd (v2df, v2df)
-     v2df __builtin_ia32_mulsd (v2df, v2df)
-     v2df __builtin_ia32_divsd (v2df, v2df)
-     v2df __builtin_ia32_minpd (v2df, v2df)
-     v2df __builtin_ia32_maxpd (v2df, v2df)
-     v2df __builtin_ia32_minsd (v2df, v2df)
-     v2df __builtin_ia32_maxsd (v2df, v2df)
-     v2df __builtin_ia32_andpd (v2df, v2df)
-     v2df __builtin_ia32_andnpd (v2df, v2df)
-     v2df __builtin_ia32_orpd (v2df, v2df)
-     v2df __builtin_ia32_xorpd (v2df, v2df)
-     v2df __builtin_ia32_movsd (v2df, v2df)
-     v2df __builtin_ia32_unpckhpd (v2df, v2df)
-     v2df __builtin_ia32_unpcklpd (v2df, v2df)
-     v16qi __builtin_ia32_paddb128 (v16qi, v16qi)
-     v8hi __builtin_ia32_paddw128 (v8hi, v8hi)
-     v4si __builtin_ia32_paddd128 (v4si, v4si)
-     v2di __builtin_ia32_paddq128 (v2di, v2di)
-     v16qi __builtin_ia32_psubb128 (v16qi, v16qi)
-     v8hi __builtin_ia32_psubw128 (v8hi, v8hi)
-     v4si __builtin_ia32_psubd128 (v4si, v4si)
-     v2di __builtin_ia32_psubq128 (v2di, v2di)
-     v8hi __builtin_ia32_pmullw128 (v8hi, v8hi)
-     v8hi __builtin_ia32_pmulhw128 (v8hi, v8hi)
-     v2di __builtin_ia32_pand128 (v2di, v2di)
-     v2di __builtin_ia32_pandn128 (v2di, v2di)
-     v2di __builtin_ia32_por128 (v2di, v2di)
-     v2di __builtin_ia32_pxor128 (v2di, v2di)
-     v16qi __builtin_ia32_pavgb128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pavgw128 (v8hi, v8hi)
-     v16qi __builtin_ia32_pcmpeqb128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pcmpeqw128 (v8hi, v8hi)
-     v4si __builtin_ia32_pcmpeqd128 (v4si, v4si)
-     v16qi __builtin_ia32_pcmpgtb128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pcmpgtw128 (v8hi, v8hi)
-     v4si __builtin_ia32_pcmpgtd128 (v4si, v4si)
-     v16qi __builtin_ia32_pmaxub128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pmaxsw128 (v8hi, v8hi)
-     v16qi __builtin_ia32_pminub128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pminsw128 (v8hi, v8hi)
-     v16qi __builtin_ia32_punpckhbw128 (v16qi, v16qi)
-     v8hi __builtin_ia32_punpckhwd128 (v8hi, v8hi)
-     v4si __builtin_ia32_punpckhdq128 (v4si, v4si)
-     v2di __builtin_ia32_punpckhqdq128 (v2di, v2di)
-     v16qi __builtin_ia32_punpcklbw128 (v16qi, v16qi)
-     v8hi __builtin_ia32_punpcklwd128 (v8hi, v8hi)
-     v4si __builtin_ia32_punpckldq128 (v4si, v4si)
-     v2di __builtin_ia32_punpcklqdq128 (v2di, v2di)
-     v16qi __builtin_ia32_packsswb128 (v8hi, v8hi)
-     v8hi __builtin_ia32_packssdw128 (v4si, v4si)
-     v16qi __builtin_ia32_packuswb128 (v8hi, v8hi)
-     v8hi __builtin_ia32_pmulhuw128 (v8hi, v8hi)
-     void __builtin_ia32_maskmovdqu (v16qi, v16qi)
-     v2df __builtin_ia32_loadupd (double *)
-     void __builtin_ia32_storeupd (double *, v2df)
-     v2df __builtin_ia32_loadhpd (v2df, double const *)
-     v2df __builtin_ia32_loadlpd (v2df, double const *)
-     int __builtin_ia32_movmskpd (v2df)
-     int __builtin_ia32_pmovmskb128 (v16qi)
-     void __builtin_ia32_movnti (int *, int)
-     void __builtin_ia32_movntpd (double *, v2df)
-     void __builtin_ia32_movntdq (v2df *, v2df)
-     v4si __builtin_ia32_pshufd (v4si, int)
-     v8hi __builtin_ia32_pshuflw (v8hi, int)
-     v8hi __builtin_ia32_pshufhw (v8hi, int)
-     v2di __builtin_ia32_psadbw128 (v16qi, v16qi)
-     v2df __builtin_ia32_sqrtpd (v2df)
-     v2df __builtin_ia32_sqrtsd (v2df)
-     v2df __builtin_ia32_shufpd (v2df, v2df, int)
-*/
-static __inline
-v128_u8_t op_SHUFPD (v128_u8_t vin1, v128_u8_t vin2, const int mask)
-    __attribute__ ((always_inline));
-
-static __inline
-v128_u8_t op_SHUFPD (v128_u8_t vin1, v128_u8_t vin2, const int mask)
-{
-    return ( v128_u8_t ) __builtin_ia32_shufpd ((v128_d_t)vin1, (v128_d_t)vin2, mask);
-}
-
-/*
-     v2df __builtin_ia32_cvtdq2pd (v4si)
-     v4sf __builtin_ia32_cvtdq2ps (v4si)
-     v4si __builtin_ia32_cvtpd2dq (v2df)
-     v2si __builtin_ia32_cvtpd2pi (v2df)
-     v4sf __builtin_ia32_cvtpd2ps (v2df)
-     v4si __builtin_ia32_cvttpd2dq (v2df)
-     v2si __builtin_ia32_cvttpd2pi (v2df)
-     v2df __builtin_ia32_cvtpi2pd (v2si)
-     int __builtin_ia32_cvtsd2si (v2df)
-     int __builtin_ia32_cvttsd2si (v2df)
-     long long __builtin_ia32_cvtsd2si64 (v2df)
-     long long __builtin_ia32_cvttsd2si64 (v2df)
-     v4si __builtin_ia32_cvtps2dq (v4sf)
-     v2df __builtin_ia32_cvtps2pd (v4sf)
-     v4si __builtin_ia32_cvttps2dq (v4sf)
-     v2df __builtin_ia32_cvtsi2sd (v2df, int)
-     v2df __builtin_ia32_cvtsi642sd (v2df, long long)
-     v4sf __builtin_ia32_cvtsd2ss (v4sf, v2df)
-     v2df __builtin_ia32_cvtss2sd (v2df, v4sf)
-     void __builtin_ia32_clflush (const void *)
-     void __builtin_ia32_lfence (void)
-     void __builtin_ia32_mfence (void)
-     v16qi __builtin_ia32_loaddqu (const char *)
-     void __builtin_ia32_storedqu (char *, v16qi)
-     v1di __builtin_ia32_pmuludq (v2si, v2si)
-     v2di __builtin_ia32_pmuludq128 (v4si, v4si)
-     v8hi __builtin_ia32_psllw128 (v8hi, v8hi)
-     v4si __builtin_ia32_pslld128 (v4si, v4si)
-     v2di __builtin_ia32_psllq128 (v2di, v2di)
-     v8hi __builtin_ia32_psrlw128 (v8hi, v8hi)
-     v4si __builtin_ia32_psrld128 (v4si, v4si)
-     v2di __builtin_ia32_psrlq128 (v2di, v2di)
-     v8hi __builtin_ia32_psraw128 (v8hi, v8hi)
-     v4si __builtin_ia32_psrad128 (v4si, v4si)
-     v2di __builtin_ia32_pslldqi128 (v2di, int)
-     v8hi __builtin_ia32_psllwi128 (v8hi, int)
-     v4si __builtin_ia32_pslldi128 (v4si, int)
-*/
-
-static __inline
-v128_u8_t op_PSLLDI128 ( v128_u8_t vin, const int bit_count )
-    __attribute__ ((always_inline));
-
-static __inline
-v128_u8_t op_PSLLDI128 (v128_u8_t vin, const int bit_count)
-{
-    return (v128_u8_t)__builtin_ia32_pslldi128 ((v128_i32_t)vin, bit_count);
-}
-
-/*
-     v2di __builtin_ia32_psllqi128 (v2di, int)
-     v2di __builtin_ia32_psrldqi128 (v2di, int)
-     v8hi __builtin_ia32_psrlwi128 (v8hi, int)
-     v4si __builtin_ia32_psrldi128 (v4si, int)
-*/
-
-static __inline
-v128_u8_t op_PSRLDI128 ( v128_u8_t vin, const int bit_count )
-    __attribute__ ((always_inline));
-
-static __inline
-v128_u8_t op_PSRLDI128 (v128_u8_t vin, const int bit_count)
-{
-    return (v128_u8_t)__builtin_ia32_psrldi128 ((v128_i32_t)vin, bit_count);
-}
-
-/*
-     v2di __builtin_ia32_psrlqi128 (v2di, int)
-     v8hi __builtin_ia32_psrawi128 (v8hi, int)
-     v4si __builtin_ia32_psradi128 (v4si, int)
-     v4si __builtin_ia32_pmaddwd128 (v8hi, v8hi)
-     v2di __builtin_ia32_movq128 (v2di)
-*/
-static __inline__
-v128_u8_t op_PSHUFD128 ( v128_u8_t vin, const int mask )
-    __attribute__ ((always_inline));
-     
-static __inline__
-v128_u8_t op_PSHUFD128 (v128_u8_t vin, const int mask)
-{
-    return (v128_u8_t)__builtin_ia32_pshufd ((v128_i32_t)vin, mask);
-}
-#endif
-
-#ifdef __SSE3__
-/* sse3
-     v2df __builtin_ia32_addsubpd (v2df, v2df)
-     v4sf __builtin_ia32_addsubps (v4sf, v4sf)
-     v2df __builtin_ia32_haddpd (v2df, v2df)
-     v4sf __builtin_ia32_haddps (v4sf, v4sf)
-     v2df __builtin_ia32_hsubpd (v2df, v2df)
-     v4sf __builtin_ia32_hsubps (v4sf, v4sf)
-     v16qi __builtin_ia32_lddqu (char const *)
-     void __builtin_ia32_monitor (void *, unsigned int, unsigned int)
-     v2df __builtin_ia32_movddup (v2df)
-     v4sf __builtin_ia32_movshdup (v4sf)
-     v4sf __builtin_ia32_movsldup (v4sf)
-     void __builtin_ia32_mwait (unsigned int, unsigned int)
-
-v2df __builtin_ia32_loadddup (double const *)
-
-*/
-
-#endif
-
-#ifdef __SSSE3__
-
-/* ssse3
- *
- * The following built-in functions are available when -mssse3 is used. All of
- * them generate the machine instruction that is part of the name with MMX
- * registers.
- *
- * 
-     v2si __builtin_ia32_phaddd (v2si, v2si)
-     v4hi __builtin_ia32_phaddw (v4hi, v4hi)
-     v4hi __builtin_ia32_phaddsw (v4hi, v4hi)
-     v2si __builtin_ia32_phsubd (v2si, v2si)
-     v4hi __builtin_ia32_phsubw (v4hi, v4hi)
-     v4hi __builtin_ia32_phsubsw (v4hi, v4hi)
-     v4hi __builtin_ia32_pmaddubsw (v8qi, v8qi)
-     v4hi __builtin_ia32_pmulhrsw (v4hi, v4hi)
-     v8qi __builtin_ia32_pshufb (v8qi, v8qi)
-     v8qi __builtin_ia32_psignb (v8qi, v8qi)
-     v2si __builtin_ia32_psignd (v2si, v2si)
-     v4hi __builtin_ia32_psignw (v4hi, v4hi)
-     v1di __builtin_ia32_palignr (v1di, v1di, int)
-     v8qi __builtin_ia32_pabsb (v8qi)
-     v2si __builtin_ia32_pabsd (v2si)
-     v4hi __builtin_ia32_pabsw (v4hi)
-The following built-in functions are available when -mssse3 is used.
-All of them generate the machine instruction that is part of the name
-with SSE registers.
-
-     v4si __builtin_ia32_phaddd128 (v4si, v4si)
-     v8hi __builtin_ia32_phaddw128 (v8hi, v8hi)
-     v8hi __builtin_ia32_phaddsw128 (v8hi, v8hi)
-     v4si __builtin_ia32_phsubd128 (v4si, v4si)
-     v8hi __builtin_ia32_phsubw128 (v8hi, v8hi)
-     v8hi __builtin_ia32_phsubsw128 (v8hi, v8hi)
-     v8hi __builtin_ia32_pmaddubsw128 (v16qi, v16qi)
-     v8hi __builtin_ia32_pmulhrsw128 (v8hi, v8hi)
-+    v16qi __builtin_ia32_pshufb128 (v16qi, v16qi)
-     v16qi __builtin_ia32_psignb128 (v16qi, v16qi)
-     v4si __builtin_ia32_psignd128 (v4si, v4si)
-     v8hi __builtin_ia32_psignw128 (v8hi, v8hi)
-     v2di __builtin_ia32_palignr128 (v2di, v2di, int)
-     v16qi __builtin_ia32_pabsb128 (v16qi)
-     v4si __builtin_ia32_pabsd128 (v4si)
-     v8hi __builtin_ia32_pabsw128 (v8hi)
- */
-
-static __inline__
-v128_u8_t op_PSHUFB128 (register v128_u8_t vin, register const v128_u8_t vtab)
-    __attribute__ ((always_inline));
-
-static __inline__
-v128_u8_t op_PSHUFB128 (register v128_u8_t vin, register const v128_u8_t vtab)
-{
-    return (v128_u8_t)__builtin_ia32_pshufb128 ((v128_c_t)vin, (v128_c_t)vtab);
-}
-#endif
-
-#ifdef __SSE4_1__
-/* sse4.1
-The following built-in functions are available when -msse4.1 is used.
-All of them generate the machine instruction that is part of the name.
-
-     v2df __builtin_ia32_blendpd (v2df, v2df, const int)
-     v4sf __builtin_ia32_blendps (v4sf, v4sf, const int)
-     v2df __builtin_ia32_blendvpd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_blendvps (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_dppd (v2df, v2df, const int)
-     v4sf __builtin_ia32_dpps (v4sf, v4sf, const int)
-     v4sf __builtin_ia32_insertps128 (v4sf, v4sf, const int)
-     v2di __builtin_ia32_movntdqa (v2di *);
-     v16qi __builtin_ia32_mpsadbw128 (v16qi, v16qi, const int)
-     v8hi __builtin_ia32_packusdw128 (v4si, v4si)
-     v16qi __builtin_ia32_pblendvb128 (v16qi, v16qi, v16qi)
-     v8hi __builtin_ia32_pblendw128 (v8hi, v8hi, const int)
-     v2di __builtin_ia32_pcmpeqq (v2di, v2di)
-     v8hi __builtin_ia32_phminposuw128 (v8hi)
-     v16qi __builtin_ia32_pmaxsb128 (v16qi, v16qi)
-     v4si __builtin_ia32_pmaxsd128 (v4si, v4si)
-     v4si __builtin_ia32_pmaxud128 (v4si, v4si)
-     v8hi __builtin_ia32_pmaxuw128 (v8hi, v8hi)
-     v16qi __builtin_ia32_pminsb128 (v16qi, v16qi)
-     v4si __builtin_ia32_pminsd128 (v4si, v4si)
-     v4si __builtin_ia32_pminud128 (v4si, v4si)
-     v8hi __builtin_ia32_pminuw128 (v8hi, v8hi)
-     v4si __builtin_ia32_pmovsxbd128 (v16qi)
-     v2di __builtin_ia32_pmovsxbq128 (v16qi)
-     v8hi __builtin_ia32_pmovsxbw128 (v16qi)
-     v2di __builtin_ia32_pmovsxdq128 (v4si)
-     v4si __builtin_ia32_pmovsxwd128 (v8hi)
-     v2di __builtin_ia32_pmovsxwq128 (v8hi)
-     v4si __builtin_ia32_pmovzxbd128 (v16qi)
-     v2di __builtin_ia32_pmovzxbq128 (v16qi)
-     v8hi __builtin_ia32_pmovzxbw128 (v16qi)
-     v2di __builtin_ia32_pmovzxdq128 (v4si)
-     v4si __builtin_ia32_pmovzxwd128 (v8hi)
-     v2di __builtin_ia32_pmovzxwq128 (v8hi)
-     v2di __builtin_ia32_pmuldq128 (v4si, v4si)
-     v4si __builtin_ia32_pmulld128 (v4si, v4si)
-     int __builtin_ia32_ptestc128 (v2di, v2di)
-     int __builtin_ia32_ptestnzc128 (v2di, v2di)
-     int __builtin_ia32_ptestz128 (v2di, v2di)
-     v2df __builtin_ia32_roundpd (v2df, const int)
-     v4sf __builtin_ia32_roundps (v4sf, const int)
-     v2df __builtin_ia32_roundsd (v2df, v2df, const int)
-     v4sf __builtin_ia32_roundss (v4sf, v4sf, const int)
-The following built-in functions are available when -msse4.1 is used.
-
-v4sf __builtin_ia32_vec_set_v4sf (v4sf, float, const int)
-Generates the insertps machine instruction. 
-int __builtin_ia32_vec_ext_v16qi (v16qi, const int)
-Generates the pextrb machine instruction. 
-v16qi __builtin_ia32_vec_set_v16qi (v16qi, int, const int)
-Generates the pinsrb machine instruction. 
-v4si __builtin_ia32_vec_set_v4si (v4si, int, const int)
-Generates the pinsrd machine instruction. 
-*/
-static __inline__
-v128_u8_t op_PINSRUD (register v128_u8_t vin, uint32_t ii, const int off)
-    __attribute__ ((always_inline));
-static __inline__
-v128_u8_t op_PINSRUD (register v128_u8_t vin, uint32_t ii, const int off)
-{
-    return (v128_u8_t)__builtin_ia32_vec_set_v4si ((v128_i32_t)vin, ii, off);
-}
-/*
-v2di __builtin_ia32_vec_set_v2di (v2di, long long, const int)
-Generates the pinsrq machine instruction in 64bit mode.
-The following built-in functions are changed to generate new SSE4.1 instructions when -msse4.1 is used.
-
-float __builtin_ia32_vec_ext_v4sf (v4sf, const int)
-Generates the extractps machine instruction. 
-int __builtin_ia32_vec_ext_v4si (v4si, const int)
-Generates the pextrd machine instruction. 
-long long __builtin_ia32_vec_ext_v2di (v2di, const int)
-Generates the pextrq machine instruction in 64bit mode.
- */
-
-#endif
-
-#ifdef __SSE4_2__
-
-/* sse4.2
-The following built-in functions are available when -msse4.2 is used.
-All of them generate the machine instruction that is part of the name.
-
-     v16qi __builtin_ia32_pcmpestrm128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestri128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestria128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestric128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestrio128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestris128 (v16qi, int, v16qi, int, const int)
-     int __builtin_ia32_pcmpestriz128 (v16qi, int, v16qi, int, const int)
-     v16qi __builtin_ia32_pcmpistrm128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistri128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistria128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistric128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistrio128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistris128 (v16qi, v16qi, const int)
-     int __builtin_ia32_pcmpistriz128 (v16qi, v16qi, const int)
-     v2di __builtin_ia32_pcmpgtq (v2di, v2di)
-The following built-in functions are available when -msse4.2 is used.
-
-unsigned int __builtin_ia32_crc32qi (unsigned int, unsigned char)
-Generates the crc32b machine instruction. 
-unsigned int __builtin_ia32_crc32hi (unsigned int, unsigned short)
-Generates the crc32w machine instruction. 
-unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int)
-Generates the crc32l machine instruction. 
-unsigned long long __builtin_ia32_crc32di (unsigned long long, unsigned long long)
-Generates the crc32q machine instruction.
-The following built-in functions are changed to generate new SSE4.2 instructions when -msse4.2 is used.
-
-int __builtin_popcount (unsigned int)
-Generates the popcntl machine instruction. 
-int __builtin_popcountl (unsigned long)
-Generates the popcntl or popcntq machine instruction, depending on the size of unsigned long. 
-int __builtin_popcountll (unsigned long long)
-Generates the popcntq machine instruction.
-
-*/
-
-#endif
-
-/* avx
-The following built-in functions are available when -mavx is used.
-All of them generate the machine instruction that is part of the name.
-
-     v4df __builtin_ia32_addpd256 (v4df,v4df)
-     v8sf __builtin_ia32_addps256 (v8sf,v8sf)
-     v4df __builtin_ia32_addsubpd256 (v4df,v4df)
-     v8sf __builtin_ia32_addsubps256 (v8sf,v8sf)
-     v4df __builtin_ia32_andnpd256 (v4df,v4df)
-     v8sf __builtin_ia32_andnps256 (v8sf,v8sf)
-     v4df __builtin_ia32_andpd256 (v4df,v4df)
-     v8sf __builtin_ia32_andps256 (v8sf,v8sf)
-     v4df __builtin_ia32_blendpd256 (v4df,v4df,int)
-     v8sf __builtin_ia32_blendps256 (v8sf,v8sf,int)
-     v4df __builtin_ia32_blendvpd256 (v4df,v4df,v4df)
-     v8sf __builtin_ia32_blendvps256 (v8sf,v8sf,v8sf)
-     v2df __builtin_ia32_cmppd (v2df,v2df,int)
-     v4df __builtin_ia32_cmppd256 (v4df,v4df,int)
-     v4sf __builtin_ia32_cmpps (v4sf,v4sf,int)
-     v8sf __builtin_ia32_cmpps256 (v8sf,v8sf,int)
-     v2df __builtin_ia32_cmpsd (v2df,v2df,int)
-     v4sf __builtin_ia32_cmpss (v4sf,v4sf,int)
-     v4df __builtin_ia32_cvtdq2pd256 (v4si)
-     v8sf __builtin_ia32_cvtdq2ps256 (v8si)
-     v4si __builtin_ia32_cvtpd2dq256 (v4df)
-     v4sf __builtin_ia32_cvtpd2ps256 (v4df)
-     v8si __builtin_ia32_cvtps2dq256 (v8sf)
-     v4df __builtin_ia32_cvtps2pd256 (v4sf)
-     v4si __builtin_ia32_cvttpd2dq256 (v4df)
-     v8si __builtin_ia32_cvttps2dq256 (v8sf)
-     v4df __builtin_ia32_divpd256 (v4df,v4df)
-     v8sf __builtin_ia32_divps256 (v8sf,v8sf)
-     v8sf __builtin_ia32_dpps256 (v8sf,v8sf,int)
-     v4df __builtin_ia32_haddpd256 (v4df,v4df)
-     v8sf __builtin_ia32_haddps256 (v8sf,v8sf)
-     v4df __builtin_ia32_hsubpd256 (v4df,v4df)
-     v8sf __builtin_ia32_hsubps256 (v8sf,v8sf)
-     v32qi __builtin_ia32_lddqu256 (pcchar)
-     v32qi __builtin_ia32_loaddqu256 (pcchar)
-     v4df __builtin_ia32_loadupd256 (pcdouble)
-     v8sf __builtin_ia32_loadups256 (pcfloat)
-     v2df __builtin_ia32_maskloadpd (pcv2df,v2df)
-     v4df __builtin_ia32_maskloadpd256 (pcv4df,v4df)
-     v4sf __builtin_ia32_maskloadps (pcv4sf,v4sf)
-     v8sf __builtin_ia32_maskloadps256 (pcv8sf,v8sf)
-     void __builtin_ia32_maskstorepd (pv2df,v2df,v2df)
-     void __builtin_ia32_maskstorepd256 (pv4df,v4df,v4df)
-     void __builtin_ia32_maskstoreps (pv4sf,v4sf,v4sf)
-     void __builtin_ia32_maskstoreps256 (pv8sf,v8sf,v8sf)
-     v4df __builtin_ia32_maxpd256 (v4df,v4df)
-     v8sf __builtin_ia32_maxps256 (v8sf,v8sf)
-     v4df __builtin_ia32_minpd256 (v4df,v4df)
-     v8sf __builtin_ia32_minps256 (v8sf,v8sf)
-     v4df __builtin_ia32_movddup256 (v4df)
-     int __builtin_ia32_movmskpd256 (v4df)
-     int __builtin_ia32_movmskps256 (v8sf)
-     v8sf __builtin_ia32_movshdup256 (v8sf)
-     v8sf __builtin_ia32_movsldup256 (v8sf)
-     v4df __builtin_ia32_mulpd256 (v4df,v4df)
-     v8sf __builtin_ia32_mulps256 (v8sf,v8sf)
-     v4df __builtin_ia32_orpd256 (v4df,v4df)
-     v8sf __builtin_ia32_orps256 (v8sf,v8sf)
-     v2df __builtin_ia32_pd_pd256 (v4df)
-     v4df __builtin_ia32_pd256_pd (v2df)
-     v4sf __builtin_ia32_ps_ps256 (v8sf)
-     v8sf __builtin_ia32_ps256_ps (v4sf)
-     int __builtin_ia32_ptestc256 (v4di,v4di,ptest)
-     int __builtin_ia32_ptestnzc256 (v4di,v4di,ptest)
-     int __builtin_ia32_ptestz256 (v4di,v4di,ptest)
-     v8sf __builtin_ia32_rcpps256 (v8sf)
-     v4df __builtin_ia32_roundpd256 (v4df,int)
-     v8sf __builtin_ia32_roundps256 (v8sf,int)
-     v8sf __builtin_ia32_rsqrtps_nr256 (v8sf)
-     v8sf __builtin_ia32_rsqrtps256 (v8sf)
-     v4df __builtin_ia32_shufpd256 (v4df,v4df,int)
-     v8sf __builtin_ia32_shufps256 (v8sf,v8sf,int)
-     v4si __builtin_ia32_si_si256 (v8si)
-     v8si __builtin_ia32_si256_si (v4si)
-     v4df __builtin_ia32_sqrtpd256 (v4df)
-     v8sf __builtin_ia32_sqrtps_nr256 (v8sf)
-     v8sf __builtin_ia32_sqrtps256 (v8sf)
-     void __builtin_ia32_storedqu256 (pchar,v32qi)
-     void __builtin_ia32_storeupd256 (pdouble,v4df)
-     void __builtin_ia32_storeups256 (pfloat,v8sf)
-     v4df __builtin_ia32_subpd256 (v4df,v4df)
-     v8sf __builtin_ia32_subps256 (v8sf,v8sf)
-     v4df __builtin_ia32_unpckhpd256 (v4df,v4df)
-     v8sf __builtin_ia32_unpckhps256 (v8sf,v8sf)
-     v4df __builtin_ia32_unpcklpd256 (v4df,v4df)
-     v8sf __builtin_ia32_unpcklps256 (v8sf,v8sf)
-     v4df __builtin_ia32_vbroadcastf128_pd256 (pcv2df)
-     v8sf __builtin_ia32_vbroadcastf128_ps256 (pcv4sf)
-     v4df __builtin_ia32_vbroadcastsd256 (pcdouble)
-     v4sf __builtin_ia32_vbroadcastss (pcfloat)
-     v8sf __builtin_ia32_vbroadcastss256 (pcfloat)
-     v2df __builtin_ia32_vextractf128_pd256 (v4df,int)
-     v4sf __builtin_ia32_vextractf128_ps256 (v8sf,int)
-     v4si __builtin_ia32_vextractf128_si256 (v8si,int)
-     v4df __builtin_ia32_vinsertf128_pd256 (v4df,v2df,int)
-     v8sf __builtin_ia32_vinsertf128_ps256 (v8sf,v4sf,int)
-     v8si __builtin_ia32_vinsertf128_si256 (v8si,v4si,int)
-     v4df __builtin_ia32_vperm2f128_pd256 (v4df,v4df,int)
-     v8sf __builtin_ia32_vperm2f128_ps256 (v8sf,v8sf,int)
-     v8si __builtin_ia32_vperm2f128_si256 (v8si,v8si,int)
-     v2df __builtin_ia32_vpermil2pd (v2df,v2df,v2di,int)
-     v4df __builtin_ia32_vpermil2pd256 (v4df,v4df,v4di,int)
-     v4sf __builtin_ia32_vpermil2ps (v4sf,v4sf,v4si,int)
-     v8sf __builtin_ia32_vpermil2ps256 (v8sf,v8sf,v8si,int)
-     v2df __builtin_ia32_vpermilpd (v2df,int)
-     v4df __builtin_ia32_vpermilpd256 (v4df,int)
-     v4sf __builtin_ia32_vpermilps (v4sf,int)
-     v8sf __builtin_ia32_vpermilps256 (v8sf,int)
-     v2df __builtin_ia32_vpermilvarpd (v2df,v2di)
-     v4df __builtin_ia32_vpermilvarpd256 (v4df,v4di)
-     v4sf __builtin_ia32_vpermilvarps (v4sf,v4si)
-     v8sf __builtin_ia32_vpermilvarps256 (v8sf,v8si)
-     int __builtin_ia32_vtestcpd (v2df,v2df,ptest)
-     int __builtin_ia32_vtestcpd256 (v4df,v4df,ptest)
-     int __builtin_ia32_vtestcps (v4sf,v4sf,ptest)
-     int __builtin_ia32_vtestcps256 (v8sf,v8sf,ptest)
-     int __builtin_ia32_vtestnzcpd (v2df,v2df,ptest)
-     int __builtin_ia32_vtestnzcpd256 (v4df,v4df,ptest)
-     int __builtin_ia32_vtestnzcps (v4sf,v4sf,ptest)
-     int __builtin_ia32_vtestnzcps256 (v8sf,v8sf,ptest)
-     int __builtin_ia32_vtestzpd (v2df,v2df,ptest)
-     int __builtin_ia32_vtestzpd256 (v4df,v4df,ptest)
-     int __builtin_ia32_vtestzps (v4sf,v4sf,ptest)
-     int __builtin_ia32_vtestzps256 (v8sf,v8sf,ptest)
-     void __builtin_ia32_vzeroall (void)
-     void __builtin_ia32_vzeroupper (void)
-     v4df __builtin_ia32_xorpd256 (v4df,v4df)
-     v8sf __builtin_ia32_xorps256 (v8sf,v8sf)
-
-
-
-*/
-
-#ifdef __AES__
-/*
- * AES-NI instruction set
- * includes PCMUL
- */
-
-/* AES-NI aes
- */
-
-   
-/* v2di __builtin_ia32_aesenc128 (v2di, v2di) */
-static __inline__
-v128_u8_t op_AESENC (register v128_u8_t state, register const v128_u8_t round_key)
-{
-    return (v128_u8_t)__builtin_ia32_aesenc128 ((v128_lli_t)state,
-                                               (v128_lli_t)round_key);
-}
-
-
-/* v2di __builtin_ia32_aesenclast128 (v2di, v2di) */
-static __inline__
-v128_u8_t op_AESENCLAST (register v128_u8_t state,
-                        register const v128_u8_t round_key)
-{
-    return (v128_u8_t)__builtin_ia32_aesenclast128 ((v128_lli_t)state,
-                                                   (v128_lli_t)round_key);
-}
-
-
-/* v2di __builtin_ia32_aesdec128 (v2di, v2di) */
-static __inline__
-v128_u8_t op_AESDEC (register v128_u8_t state, register const v128_u8_t round_key)
-{
-    return (v128_u8_t)__builtin_ia32_aesdec128 ((v128_lli_t)state,
-                                               (v128_lli_t)round_key);
-}
-
-
-/* v2di __builtin_ia32_aesdeclast128 (v2di, v2di) */
-static __inline__
-v128_u8_t op_AESDECLAST (register v128_u8_t state,
-                        register const v128_u8_t round_key)
-{
-    return (v128_u8_t)__builtin_ia32_aesdeclast128 ((v128_lli_t)state,
-                                                   (v128_lli_t)round_key);
-}
-
-
-/* v2di __builtin_ia32_aeskeygenassist128 (v2di, const int) */
-static __inline__
-v128_u8_t op_AESKEYGENASSIST (register const v128_u8_t round_key,
-                             const int rcon ) __attribute__ ((always_inline));
-static __inline__
-v128_u8_t op_AESKEYGENASSIST (register const v128_u8_t round_key,
-                             const int rcon )
-{
-    return (v128_u8_t)__builtin_ia32_aeskeygenassist128 ((v128_lli_t)round_key,
-                                                         rcon);
-}
-
-
-/* v2di __builtin_ia32_aesimc128 (v2di) */
-static __inline__
-v128_u8_t op_AESIMC (register const v128_u8_t round_key)
-{
-    return (v128_u8_t)__builtin_ia32_aesimc128 ((v128_lli_t)round_key);
-}
-
-/* pclmul
-v2di __builtin_ia32_pclmulqdq128 (v2di, v2di, const int)
-*/
-#endif
-
-#ifdef __SSE5__
-/* sse5
-     v2df __builtin_ia32_comeqpd (v2df, v2df)
-     v2df __builtin_ia32_comeqps (v2df, v2df)
-     v4sf __builtin_ia32_comeqsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comeqss (v4sf, v4sf)
-     v2df __builtin_ia32_comfalsepd (v2df, v2df)
-     v2df __builtin_ia32_comfalseps (v2df, v2df)
-     v4sf __builtin_ia32_comfalsesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comfalsess (v4sf, v4sf)
-     v2df __builtin_ia32_comgepd (v2df, v2df)
-     v2df __builtin_ia32_comgeps (v2df, v2df)
-     v4sf __builtin_ia32_comgesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comgess (v4sf, v4sf)
-     v2df __builtin_ia32_comgtpd (v2df, v2df)
-     v2df __builtin_ia32_comgtps (v2df, v2df)
-     v4sf __builtin_ia32_comgtsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comgtss (v4sf, v4sf)
-     v2df __builtin_ia32_comlepd (v2df, v2df)
-     v2df __builtin_ia32_comleps (v2df, v2df)
-     v4sf __builtin_ia32_comlesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comless (v4sf, v4sf)
-     v2df __builtin_ia32_comltpd (v2df, v2df)
-     v2df __builtin_ia32_comltps (v2df, v2df)
-     v4sf __builtin_ia32_comltsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comltss (v4sf, v4sf)
-     v2df __builtin_ia32_comnepd (v2df, v2df)
-     v2df __builtin_ia32_comneps (v2df, v2df)
-     v4sf __builtin_ia32_comnesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comness (v4sf, v4sf)
-     v2df __builtin_ia32_comordpd (v2df, v2df)
-     v2df __builtin_ia32_comordps (v2df, v2df)
-     v4sf __builtin_ia32_comordsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comordss (v4sf, v4sf)
-     v2df __builtin_ia32_comtruepd (v2df, v2df)
-     v2df __builtin_ia32_comtrueps (v2df, v2df)
-     v4sf __builtin_ia32_comtruesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comtruess (v4sf, v4sf)
-     v2df __builtin_ia32_comueqpd (v2df, v2df)
-     v2df __builtin_ia32_comueqps (v2df, v2df)
-     v4sf __builtin_ia32_comueqsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comueqss (v4sf, v4sf)
-     v2df __builtin_ia32_comugepd (v2df, v2df)
-     v2df __builtin_ia32_comugeps (v2df, v2df)
-     v4sf __builtin_ia32_comugesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comugess (v4sf, v4sf)
-     v2df __builtin_ia32_comugtpd (v2df, v2df)
-     v2df __builtin_ia32_comugtps (v2df, v2df)
-     v4sf __builtin_ia32_comugtsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comugtss (v4sf, v4sf)
-     v2df __builtin_ia32_comulepd (v2df, v2df)
-     v2df __builtin_ia32_comuleps (v2df, v2df)
-     v4sf __builtin_ia32_comulesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comuless (v4sf, v4sf)
-     v2df __builtin_ia32_comultpd (v2df, v2df)
-     v2df __builtin_ia32_comultps (v2df, v2df)
-     v4sf __builtin_ia32_comultsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comultss (v4sf, v4sf)
-     v2df __builtin_ia32_comunepd (v2df, v2df)
-     v2df __builtin_ia32_comuneps (v2df, v2df)
-     v4sf __builtin_ia32_comunesd (v4sf, v4sf)
-     v4sf __builtin_ia32_comuness (v4sf, v4sf)
-     v2df __builtin_ia32_comunordpd (v2df, v2df)
-     v2df __builtin_ia32_comunordps (v2df, v2df)
-     v4sf __builtin_ia32_comunordsd (v4sf, v4sf)
-     v4sf __builtin_ia32_comunordss (v4sf, v4sf)
-     v2df __builtin_ia32_fmaddpd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fmaddps (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fmaddsd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fmaddss (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fmsubpd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fmsubps (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fmsubsd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fmsubss (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fnmaddpd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fnmaddps (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fnmaddsd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fnmaddss (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fnmsubpd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fnmsubps (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_fnmsubsd (v2df, v2df, v2df)
-     v4sf __builtin_ia32_fnmsubss (v4sf, v4sf, v4sf)
-     v2df __builtin_ia32_frczpd (v2df)
-     v4sf __builtin_ia32_frczps (v4sf)
-     v2df __builtin_ia32_frczsd (v2df, v2df)
-     v4sf __builtin_ia32_frczss (v4sf, v4sf)
-     v2di __builtin_ia32_pcmov (v2di, v2di, v2di)
-     v2di __builtin_ia32_pcmov_v2di (v2di, v2di, v2di)
-     v4si __builtin_ia32_pcmov_v4si (v4si, v4si, v4si)
-     v8hi __builtin_ia32_pcmov_v8hi (v8hi, v8hi, v8hi)
-     v16qi __builtin_ia32_pcmov_v16qi (v16qi, v16qi, v16qi)
-     v2df __builtin_ia32_pcmov_v2df (v2df, v2df, v2df)
-     v4sf __builtin_ia32_pcmov_v4sf (v4sf, v4sf, v4sf)
-     v16qi __builtin_ia32_pcomeqb (v16qi, v16qi)
-     v8hi __builtin_ia32_pcomeqw (v8hi, v8hi)
-     v4si __builtin_ia32_pcomeqd (v4si, v4si)
-     v2di __builtin_ia32_pcomeqq (v2di, v2di)
-     v16qi __builtin_ia32_pcomequb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomequd (v4si, v4si)
-     v2di __builtin_ia32_pcomequq (v2di, v2di)
-     v8hi __builtin_ia32_pcomequw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomeqw (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomfalseb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomfalsed (v4si, v4si)
-     v2di __builtin_ia32_pcomfalseq (v2di, v2di)
-     v16qi __builtin_ia32_pcomfalseub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomfalseud (v4si, v4si)
-     v2di __builtin_ia32_pcomfalseuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomfalseuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomfalsew (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomgeb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomged (v4si, v4si)
-     v2di __builtin_ia32_pcomgeq (v2di, v2di)
-     v16qi __builtin_ia32_pcomgeub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomgeud (v4si, v4si)
-     v2di __builtin_ia32_pcomgeuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomgeuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomgew (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomgtb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomgtd (v4si, v4si)
-     v2di __builtin_ia32_pcomgtq (v2di, v2di)
-     v16qi __builtin_ia32_pcomgtub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomgtud (v4si, v4si)
-     v2di __builtin_ia32_pcomgtuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomgtuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomgtw (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomleb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomled (v4si, v4si)
-     v2di __builtin_ia32_pcomleq (v2di, v2di)
-     v16qi __builtin_ia32_pcomleub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomleud (v4si, v4si)
-     v2di __builtin_ia32_pcomleuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomleuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomlew (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomltb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomltd (v4si, v4si)
-     v2di __builtin_ia32_pcomltq (v2di, v2di)
-     v16qi __builtin_ia32_pcomltub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomltud (v4si, v4si)
-     v2di __builtin_ia32_pcomltuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomltuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomltw (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomneb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomned (v4si, v4si)
-     v2di __builtin_ia32_pcomneq (v2di, v2di)
-     v16qi __builtin_ia32_pcomneub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomneud (v4si, v4si)
-     v2di __builtin_ia32_pcomneuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomneuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomnew (v8hi, v8hi)
-     v16qi __builtin_ia32_pcomtrueb (v16qi, v16qi)
-     v4si __builtin_ia32_pcomtrued (v4si, v4si)
-     v2di __builtin_ia32_pcomtrueq (v2di, v2di)
-     v16qi __builtin_ia32_pcomtrueub (v16qi, v16qi)
-     v4si __builtin_ia32_pcomtrueud (v4si, v4si)
-     v2di __builtin_ia32_pcomtrueuq (v2di, v2di)
-     v8hi __builtin_ia32_pcomtrueuw (v8hi, v8hi)
-     v8hi __builtin_ia32_pcomtruew (v8hi, v8hi)
-     v4df __builtin_ia32_permpd (v2df, v2df, v16qi)
-     v4sf __builtin_ia32_permps (v4sf, v4sf, v16qi)
-     v4si __builtin_ia32_phaddbd (v16qi)
-     v2di __builtin_ia32_phaddbq (v16qi)
-     v8hi __builtin_ia32_phaddbw (v16qi)
-     v2di __builtin_ia32_phadddq (v4si)
-     v4si __builtin_ia32_phaddubd (v16qi)
-     v2di __builtin_ia32_phaddubq (v16qi)
-     v8hi __builtin_ia32_phaddubw (v16qi)
-     v2di __builtin_ia32_phaddudq (v4si)
-     v4si __builtin_ia32_phadduwd (v8hi)
-     v2di __builtin_ia32_phadduwq (v8hi)
-     v4si __builtin_ia32_phaddwd (v8hi)
-     v2di __builtin_ia32_phaddwq (v8hi)
-     v8hi __builtin_ia32_phsubbw (v16qi)
-     v2di __builtin_ia32_phsubdq (v4si)
-     v4si __builtin_ia32_phsubwd (v8hi)
-     v4si __builtin_ia32_pmacsdd (v4si, v4si, v4si)
-     v2di __builtin_ia32_pmacsdqh (v4si, v4si, v2di)
-     v2di __builtin_ia32_pmacsdql (v4si, v4si, v2di)
-     v4si __builtin_ia32_pmacssdd (v4si, v4si, v4si)
-     v2di __builtin_ia32_pmacssdqh (v4si, v4si, v2di)
-     v2di __builtin_ia32_pmacssdql (v4si, v4si, v2di)
-     v4si __builtin_ia32_pmacsswd (v8hi, v8hi, v4si)
-     v8hi __builtin_ia32_pmacssww (v8hi, v8hi, v8hi)
-     v4si __builtin_ia32_pmacswd (v8hi, v8hi, v4si)
-     v8hi __builtin_ia32_pmacsww (v8hi, v8hi, v8hi)
-     v4si __builtin_ia32_pmadcsswd (v8hi, v8hi, v4si)
-     v4si __builtin_ia32_pmadcswd (v8hi, v8hi, v4si)
-     v16qi __builtin_ia32_pperm (v16qi, v16qi, v16qi)
-     v16qi __builtin_ia32_protb (v16qi, v16qi)
-     v4si __builtin_ia32_protd (v4si, v4si)
-     v2di __builtin_ia32_protq (v2di, v2di)
-     v8hi __builtin_ia32_protw (v8hi, v8hi)
-     v16qi __builtin_ia32_pshab (v16qi, v16qi)
-     v4si __builtin_ia32_pshad (v4si, v4si)
-     v2di __builtin_ia32_pshaq (v2di, v2di)
-     v8hi __builtin_ia32_pshaw (v8hi, v8hi)
-     v16qi __builtin_ia32_pshlb (v16qi, v16qi)
-     v4si __builtin_ia32_pshld (v4si, v4si)
-     v2di __builtin_ia32_pshlq (v2di, v2di)
-     v8hi __builtin_ia32_pshlw (v8hi, v8hi)
-The following builtin-in functions are available when -msse5 is used.
-The second argument must be an integer constant and generate the machine
-instruction that is part of the name with the `_imm' suffix removed.
-
-     v16qi __builtin_ia32_protb_imm (v16qi, int)
-     v4si __builtin_ia32_protd_imm (v4si, int)
-     v2di __builtin_ia32_protq_imm (v2di, int)
-     v8hi __builtin_ia32_protw_imm (v8hi, int)
-
-
-*/
-#endif
-
-#endif /* if USE_VECREG */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_v128_ */
diff --git a/interfaces/cc/gcc/va_copy.h b/interfaces/cc/gcc/va_copy.h
deleted file mode 100644
index 34fb64f..0000000
--- a/interfaces/cc/gcc/va_copy.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_va_copy_
-#define _h_va_copy_
-
-/* GCC may internally undef 'va_copy' upon include of stdarg.h
-   force it to be included before defining va_copy */
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* kludge - GCC stdarg has this line:
-   #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
-   fix build for c99 */
-#if ! defined va_copy && defined __va_copy
-#define va_copy __va_copy
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_va_copy_ */
diff --git a/interfaces/cc/gcc/x86_64/arch-impl.h b/interfaces/cc/gcc/x86_64/arch-impl.h
deleted file mode 100644
index 7008721..0000000
--- a/interfaces/cc/gcc/x86_64/arch-impl.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_arch_impl_
-#define _h_arch_impl_
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static __inline__
-int16_t uint16_lsbit ( uint16_t self )
-{
-    int16_t rtn;
-    __asm__ __volatile__
-    (
-        "bsf %%ax, %%ax;"
-        "jnz .+6;"
-        "xor %%eax, %%eax;"
-        "dec %%eax;"
-        : "=a" ( rtn )
-        : "a" ( self )
-    );
-    return rtn;
-}
-
-static __inline__
-int32_t uint32_lsbit ( uint32_t self )
-{
-    int32_t rtn;
-    __asm__ __volatile__
-    (
-        "bsf %%eax, %%eax;"
-        "jnz .+6;"
-        "xor %%eax, %%eax;"
-        "dec %%eax;"
-        : "=a" ( rtn )
-        : "a" ( self )
-    );
-    return rtn;
-}
-
-typedef struct int128_t int128_t;
-struct int128_t
-{
-    uint64_t lo;
-    int64_t hi;
-};
-
-static __inline__
-int64_t int128_hi ( const int128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline__
-uint64_t int128_lo ( const int128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline__
-void int128_sethi ( int128_t *self, int64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline__
-void int128_setlo ( int128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-typedef struct uint128_t uint128_t;
-struct uint128_t
-{
-    uint64_t lo;
-    uint64_t hi;
-};
-
-static __inline__
-uint64_t uint128_hi ( const uint128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline__
-uint64_t uint128_lo ( const uint128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline__
-void uint128_sethi ( uint128_t *self, uint64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline__
-void uint128_setlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-static __inline__
-void int128_add ( int128_t *self, const int128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "add %%rax, (%%rdi);"
-        "adc %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void int128_sub ( int128_t *self, const int128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "sub %%rax, (%%rdi);"
-        "sbb %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void int128_sar ( int128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov %%esi, %%ecx;"
-        "mov 8(%%rdi), %%rax;"
-        "shrd %%cl, %%rax, (%%rdi);"
-        "sar %%cl, %%rax;"
-        "mov %%rax, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        :  "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void int128_shl ( int128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov %%esi, %%ecx;"
-        "mov (%%rdi), %%rax;"
-        "shld %%cl, %%rax, 8(%%rdi);"
-        "shl %%cl, %%rax;"
-        "mov %%rax, (%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_and ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "and %%rax, (%%rdi);"
-        "and %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        :"%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_or ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "or %%rax, (%%rdi);"
-        "or %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        :"%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_orlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo |= i;
-}
-
-static __inline__
-void uint128_xor ( uint128_t *self, const uint128_t *i )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "xor %%rax, (%%rdi);"
-        "xor %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        :"%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_not ( uint128_t *self )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "mov 8(%%rdi), %%rcx;"
-        "not %%rax;"
-        "not %%rcx;"
-        "mov %%rax, (%%rdi);"
-        "mov %%rcx, 8(%%rdi);"
-        :
-        : "D" ( self )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_shr ( uint128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov %%esi, %%ecx;"
-        "mov 8(%%rdi), %%rax;"
-        "shrd %%cl, %%rax, (%%rdi);"
-        "shr %%cl, %%rax;"
-        "mov %%rax, 8(%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_shl ( uint128_t *self, uint32_t i )
-{
-    __asm__ __volatile__
-    (
-        "mov %%esi, %%ecx;"
-        "mov (%%rdi), %%rax;"
-        "shld %%cl, %%rax, 8(%%rdi);"
-        "shl %%cl, %%rax;"
-        "mov %%rax, (%%rdi);"
-        :
-        : "D" ( self ), "S" ( i )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_bswap ( uint128_t *self )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "mov 8(%%rdi), %%rcx;"
-        "bswap %%rax;"
-        "bswap %%rcx;"
-        "mov %%rax, 8(%%rdi);"
-        "mov %%rcx, (%%rdi);"
-        :
-        : "D" ( self )
-        : "%rax", "%rcx"
-    );
-}
-
-static __inline__
-void uint128_bswap_copy ( uint128_t *to, const uint128_t *from )
-{
-    __asm__ __volatile__
-    (
-        "mov (%%rsi), %%rax;"
-        "mov 8(%%rsi), %%rcx;"
-        "bswap %%rax;"
-        "bswap %%rcx;"
-        "mov %%rax, 8(%%rdi);"
-        "mov %%rcx, (%%rdi);"
-        :
-        : "D" ( to ), "S" ( from )
-        : "%rax", "%rcx"
-    );
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_arch_impl_ */
diff --git a/interfaces/cc/gcc/x86_64/atomic.h b/interfaces/cc/gcc/x86_64/atomic.h
deleted file mode 100644
index 83b81e4..0000000
--- a/interfaces/cc/gcc/x86_64/atomic.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic_
-#define _h_atomic_
-
-#ifndef _h_atomic32_
-#include "atomic32.h"
-#endif
-
-#ifndef _h_atomic64_
-#include "atomic64.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if DFLT_ATOMIC_BITS == 32
-#define ATOMIC_NAME( suffix ) \
-    atomic32_ ## suffix
-typedef int atomic_int;
-#else
-#define ATOMIC_NAME( suffix ) \
-    atomic64_ ## suffix
-typedef long int atomic_int;
-#endif
-
-typedef struct ATOMIC_NAME ( t ) atomic_t;
-
-/* ( * v ) */
-#define atomic_read( v ) \
-    ATOMIC_NAME ( read ) ( v )
-
-/* ( * v ) = i */
-#define atomic_set( v, i ) \
-    ATOMIC_NAME ( set ) ( v, i )
-
-/* prior = ( * v ), ( * v ) += i, prior */
-#define atomic_read_and_add( v, i ) \
-    ATOMIC_NAME ( read_and_add ) ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add( v, i ) \
-    ATOMIC_NAME ( add ) ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add_and_read( v, i ) \
-    ATOMIC_NAME ( add_and_read ) ( v, i )
-
-/* ( void ) ++ ( * v ) */
-#define atomic_inc( v ) \
-    ATOMIC_NAME ( inc ) ( v )
-
-/* ( void ) -- ( * v ) */
-#define atomic_dec( v ) \
-    ATOMIC_NAME ( dec ) ( v )
-
-/* -- ( * v ) == 0 */
-#define atomic_dec_and_test( v ) \
-    ATOMIC_NAME ( dec_and_test ) ( v )
-
-/* ++ ( * v ) == 0
-   when atomic_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-#define atomic_inc_and_test( v ) \
-    ATOMIC_NAME ( inc_and_test ) ( v )
-
-/* ( * v ) -- == 0
-   HERE's useful */
-#define atomic_test_and_inc( v ) \
-    ATOMIC_NAME ( test_and_inc ) ( v )
-
-/* prior = ( * v ), ( * v ) = ( prior == t ? s : prior ), prior */
-#define atomic_test_and_set( v, s, t ) \
-    ATOMIC_NAME ( test_and_set ) ( v, s, t )
-
-/* N.B. - THIS FUNCTION IS FOR 64 BIT PTRS ONLY */
-static __inline__ void *atomic_test_and_set_ptr ( void *volatile *v, void *s, void *t )
-{
-    void *rtn;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "cmpxchg %%rsi,(%%rdi)"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( s ), "a" ( t )
-    );
-    return rtn;
-}
-
-/* val = ( * v ), ( ( * v ) = ( val < t ) ? val + i : val ), val */
-#define atomic_read_and_add_lt( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_lt ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val <= t ) ? val + i : val ), val */
-#define atomic_read_and_add_le( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_le ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val == t ) ? val + i : val ), val */
-#define atomic_read_and_add_eq( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_eq ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val != t ) ? val + i : val ), val */
-#define atomic_read_and_add_ne( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_ne ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val >= t ) ? val + i : val ), val */
-#define atomic_read_and_add_ge( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_ge ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val > t ) ? val + i : val ), val */
-#define atomic_read_and_add_gt( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_gt ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 1 ) ? val + i : val ), val */
-#define atomic_read_and_add_odd( v, i ) \
-    ATOMIC_NAME ( read_and_add_odd ) ( v, i )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 0 ) ? val + i : val ), val */
-#define atomic_read_and_add_even( v, i ) \
-    ATOMIC_NAME ( read_and_add_even ) ( v, i )
-
-/* DEPRECATED */
-
-/* val = ( * v ), ( * v ) = ( val < t ? val + i : val ), ( val < t ? 1 : 0 ) */
-#define atomic_add_if_lt( v, i, t ) \
-    ATOMIC_NAME ( add_if_lt ) ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val <= t ? val + i : val ), ( val <= t ? 1 : 0 ) */
-#define atomic_add_if_le( v, i, t ) \
-    ATOMIC_NAME ( add_if_le ) ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val == t ? val + i : val ), ( val == t ? 1 : 0 ) */
-#define atomic_add_if_eq( v, i, t ) \
-    ATOMIC_NAME ( add_if_eq ) ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val >= t ? val + i : val ), ( val >= t ? 1 : 0 ) */
-#define atomic_add_if_ge( v, i, t ) \
-    ATOMIC_NAME ( add_if_ge ) ( v, i, t )
-
-/* val = ( * v ), ( * v ) = ( val > t ? val + i : val ), ( val > t ? 1 : 0 ) */
-#define atomic_add_if_gt( v, i, t ) \
-    ATOMIC_NAME ( add_if_gt ) ( v, i, t )
-
-#undef LOCK
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic_ */
diff --git a/interfaces/cc/gcc/x86_64/atomic32.h b/interfaces/cc/gcc/x86_64/atomic32.h
deleted file mode 100644
index f6b739f..0000000
--- a/interfaces/cc/gcc/x86_64/atomic32.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic32_
-#define _h_atomic32_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct atomic32_t atomic32_t;
-struct atomic32_t
-{
-    volatile int counter;
-};
-
-/* int atomic32_read ( const atomic32_t *v ); */
-#define atomic32_read( v ) \
-    ( ( v ) -> counter )
-
-/* void atomic32_set ( atomic32_t *v, int i ); */
-#define atomic32_set( v, i ) \
-    ( ( void ) ( ( ( v ) -> counter ) = ( i ) ) )
-
-/* add to v -> counter and return the prior value */
-static __inline__ int atomic32_read_and_add ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "mov %%esi, %%ecx;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-8"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-/* if no read is needed, define the least expensive atomic add */
-#define atomic32_add( v, i ) \
-    atomic32_read_and_add ( v, i )
-
-/* add to v -> counter and return the result */
-static __inline__ int atomic32_add_and_read ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "mov %%esi, %%ecx;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx,(%%rdi);"
-        "jne .-8;"
-        "mov %%ecx, %%eax"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-/* just don't try to find out what the result was */
-static __inline__ void atomic32_inc ( atomic32_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incl %0"
-        : "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-}
-
-static __inline__ void atomic32_dec ( atomic32_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decl %0"
-        : "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-}
-
-/* decrement by one and test result for 0 */
-static __inline__ int atomic32_dec_and_test ( atomic32_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decl %2;"
-        "sete %%al"
-        : "=a" ( c ), "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-    return c;
-}
-
-/* when atomic32_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-static __inline__ int atomic32_inc_and_test ( atomic32_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incl %2;"
-        "sete %%al"
-        : "=a" ( c ), "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-    return c;
-}
-
-/* HERE's useful */
-#define atomic32_test_and_inc( v ) \
-    ( atomic32_read_and_add ( v, 1 ) == 0 )
-
-static __inline__ int atomic32_test_and_set ( atomic32_t *v, int s, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "cmpxchg %%esi,(%%rdi)"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( s ), "a" ( t )
-    );
-    return rtn;
-}
-
-/* conditional modifications */
-static __inline__
-int atomic32_read_and_add_lt ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "jge .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_lt( v, i, t ) \
-    ( atomic32_read_and_add_lt ( v, i, t ) < ( t ) )
-
-static __inline__
-int atomic32_read_and_add_le ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "jg .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_le( v, i, t ) \
-    ( atomic32_read_and_add_le ( v, i, t ) <= ( t ) )
-
-static __inline__
-int atomic32_read_and_add_eq ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "jne .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_eq( v, i, t ) \
-    ( atomic32_read_and_add_eq ( v, i, t ) == ( t ) )
-
-static __inline__
-int atomic32_read_and_add_ne ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "je .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_ne( v, i, t ) \
-    ( atomic32_read_and_add_ne ( v, i, t ) != ( t ) )
-
-static __inline__
-int atomic32_read_and_add_ge ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "jl .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_ge( v, i, t ) \
-    ( atomic32_read_and_add_ge ( v, i, t ) >= ( t ) )
-
-static __inline__
-int atomic32_read_and_add_gt ( atomic32_t *v, int i, int t )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "cmp %%edx, %%eax;"
-        "mov %%esi, %%ecx;"
-        "jle .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-12"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#define atomic32_add_if_gt( v, i, t ) \
-    ( atomic32_read_and_add_gt ( v, i, t ) > ( t ) )
-
-static __inline__
-int atomic32_read_and_add_odd ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "bt $0, %%ax;"
-        "mov %%esi, %%ecx;"
-        "jnc .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-15"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-static __inline__
-int atomic32_read_and_add_even ( atomic32_t *v, int i )
-{
-    int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%eax;"
-        "bt $0, %%ax;"
-        "mov %%esi, %%ecx;"
-        "jc .+10;"
-        "add %%eax, %%ecx;"
-        "lock;"
-        "cmpxchg %%ecx, (%%rdi);"
-        "jne .-15"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%ecx"
-    );
-    return rtn;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic32_ */
diff --git a/interfaces/cc/gcc/x86_64/atomic64.h b/interfaces/cc/gcc/x86_64/atomic64.h
deleted file mode 100644
index bd7f7da..0000000
--- a/interfaces/cc/gcc/x86_64/atomic64.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic64_
-#define _h_atomic64_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct atomic64_t atomic64_t;
-struct atomic64_t
-{
-    volatile long int counter;
-};
-
-/* int atomic64_read ( const atomic64_t *v ); */
-#define atomic64_read( v ) \
-    ( ( v ) -> counter )
-
-/* void atomic64_set ( atomic64_t *v, long int i ); */
-#define atomic64_set( v, i ) \
-    ( ( void ) ( ( ( v ) -> counter ) = ( i ) ) )
-
-/* add to v -> counter and return the prior value */
-static __inline__ long int atomic64_read_and_add ( atomic64_t *v, long int i )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "mov %%rsi, %%rcx;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-11"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-/* if no read is needed, define the least expensive atomic add */
-#define atomic64_add( v, i ) \
-    atomic64_read_and_add ( v, i )
-
-/* add to v -> counter and return the result */
-static __inline__ long int atomic64_add_and_read ( atomic64_t *v, long int i )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "mov %%rsi, %%rcx;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-11;"
-        "mov %%rcx, %%rax"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-/* just don't try to find out what the result was */
-static __inline__ void atomic64_inc ( atomic64_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incq %0"
-        : "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-}
-
-static __inline__ void atomic64_dec ( atomic64_t *v )
-{
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decq %0"
-        : "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-}
-
-/* decrement by one and test result for 0 */
-static __inline__ int atomic64_dec_and_test ( atomic64_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "decq %2;"
-        "sete %%al"
-        : "=a" ( c ), "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-    return c;
-}
-
-/* when atomic64_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-static __inline__ int atomic64_inc_and_test ( atomic64_t *v )
-{
-    unsigned char c;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "incq %2;"
-        "sete %%al"
-        : "=a" ( c ), "=m" ( v -> counter )
-        : "m" ( v -> counter )
-    );
-    return c;
-}
-
-/* HERE's useful */
-#define atomic64_test_and_inc( v ) \
-    ( atomic64_read_and_add ( v, 1L ) == 0 )
-
-static __inline__ long int atomic64_test_and_set ( atomic64_t *v, long int s, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "lock;"
-        "cmpxchg %%rsi,(%%rdi)"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( s ), "a" ( t )
-    );
-    return rtn;
-}
-
-/* conditional modifications */
-static __inline__
-long int atomic64_read_and_add_lt ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "jge .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_lt( v, i, t ) \
-    ( atomic64_read_and_add_lt ( v, i, t ) < ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_le ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "jg .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_le( v, i, t ) \
-    ( atomic64_read_and_add_le ( v, i, t ) <= ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_eq ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "jne .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_eq( v, i, t ) \
-    ( atomic64_read_and_add_eq ( v, i, t ) == ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_ne ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "je .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_ne( v, i, t ) \
-    ( atomic64_read_and_add_ne ( v, i, t ) != ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_ge ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "jl .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_ge( v, i, t ) \
-    ( atomic64_read_and_add_ge ( v, i, t ) >= ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_gt ( atomic64_t *v, long int i, long int t )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "cmp %%rdx, %%rax;"
-        "mov %%rsi, %%rcx;"
-        "jle .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-16"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i ), "d" ( t )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#define atomic64_add_if_gt( v, i, t ) \
-    ( atomic64_read_and_add_gt ( v, i, t ) > ( t ) )
-
-static __inline__
-long int atomic64_read_and_add_odd ( atomic64_t *v, long int i )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "bt $0, %%ax;"
-        "mov %%rsi, %%rcx;"
-        "jnc .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-18"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-static __inline__
-long int atomic64_read_and_add_even ( atomic64_t *v, long int i )
-{
-    long int rtn;
-    __asm__ __volatile__
-    (
-        "mov (%%rdi), %%rax;"
-        "bt $0, %%ax;"
-        "mov %%rsi, %%rcx;"
-        "jc .+12;"
-        "add %%rax, %%rcx;"
-        "lock;"
-        "cmpxchg %%rcx, (%%rdi);"
-        "jne .-18"
-        : "=a" ( rtn )
-        : "D" ( v ), "S" ( i )
-        : "%rcx"
-    );
-    return rtn;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic64_ */
diff --git a/interfaces/cc/gcc/x86_64/bitstr.h b/interfaces/cc/gcc/x86_64/bitstr.h
deleted file mode 100644
index b52f525..0000000
--- a/interfaces/cc/gcc/x86_64/bitstr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_bitstr_
-#define _h_bitstr_
-
-/* use 64-bit accumulator, 32-bit word size */
-#define WRDSIZE 32
-#define WRDSHIFT 5
-#define WRD uint32_t
-#define ACC uint64_t
-#define BSWAP( x ) bswap_32 ( x )
-
-#include "../noarch/bitstr.h"
-
-#endif /* _h_bitstr_ */
diff --git a/interfaces/cc/gcc/x86_64/byteswap.h b/interfaces/cc/gcc/x86_64/byteswap.h
deleted file mode 100644
index 435a233..0000000
--- a/interfaces/cc/gcc/x86_64/byteswap.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_byteswap_
-#define _h_byteswap_
-
-#ifdef _BYTESWAP_H
-#warning "GNU byteswap.h being used"
-#else
-#define _BYTESWAP_H	1234
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* perform single instruction byte swap */
-static __inline__ uint16_t bswap_16 ( uint16_t i )
-{
-    register uint16_t rtn;
-    __asm__
-    (
-        "rorw $8, %w0"
-        : "=r" ( rtn )
-        : "0" ( i )
-        : "cc"
-    );
-    return rtn;
-}
-
-/* perform single instruction byte swap */
-static __inline__ uint32_t bswap_32 ( uint32_t i )
-{
-    register uint32_t rtn;
-    __asm__
-    (
-        "bswap %0"
-        : "=r" ( rtn )
-        : "0" ( i )
-        : "cc"
-    );
-    return rtn;
-}
-
-/* perform multi-instruction byte swap */
-static __inline__ uint64_t bswap_64 ( uint64_t i )
-{
-    register uint64_t rtn;
-    __asm__
-    (
-        "bswap %q0"
-        : "=r" ( rtn )
-        : "0" ( i )
-        : "cc"
-    );
-    return rtn;
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _BYTESWAP_H */
-#endif /* _h_byteswap_ */
diff --git a/interfaces/cc/gcc/x86_64/strtol.h b/interfaces/cc/gcc/x86_64/strtol.h
deleted file mode 100644
index ceda47d..0000000
--- a/interfaces/cc/gcc/x86_64/strtol.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_strtol_
-#define _h_strtol_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * strtoi32
- * strtou32
- *  based upon actual usage
- */
-#define strtoi32( str, endp, base ) \
-    ( int32_t ) strtol ( str, endp, base )
-
-#define strtou32( str, endp, base ) \
-    ( uint32_t ) strtoul ( str, endp, base )
-
-
-/*--------------------------------------------------------------------------
- * strtoi64
- * strtou64
- *  based upon actual usage
- */
-#define strtoi64( str, endp, base ) \
-    strtol ( str, endp, base )
-
-#define strtou64( str, endp, base ) \
-    strtoul ( str, endp, base )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_strtol_ */
diff --git a/interfaces/cc/icc/compiler.h b/interfaces/cc/icc/compiler.h
deleted file mode 100644
index d1bf565..0000000
--- a/interfaces/cc/icc/compiler.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_compiler_
-#define _h_compiler_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_compiler_ */
-
diff --git a/interfaces/cc/vc++/compiler.h b/interfaces/cc/vc++/compiler.h
deleted file mode 100644
index 75a5d3c..0000000
--- a/interfaces/cc/vc++/compiler.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_compiler_
-#define _h_compiler_
-
-#include <math.h>
-#include <float.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static __inline
-float roundf( float value_in )
-{
-    return ( value_in < 0 ) ? ceilf ( value_in - 0.5F ) : floorf ( value_in + 0.5F );
-}
-
-#define lroundf( x ) (long int)roundf( x )
-
-static __inline
-double round( double value_in )
-{
-    return ( value_in < 0 ) ? ceil ( value_in - 0.5 ) : floor ( value_in + 0.5 );
-}
-
-typedef double double_t;
-
-#define isnan( x ) _isnan ( x )
-
-static __inline
-float truncf( float value_in )
-{
-	return ( value_in < 0 ) ? ceilf( value_in ) : floorf( value_in );
-}
-
-static __inline
-double trunc( double value_in )
-{
-	return ( value_in < 0 ) ? ceil( value_in ) : floor( value_in );
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_compiler_ */
-
diff --git a/interfaces/cc/vc++/i386/arch-impl.h b/interfaces/cc/vc++/i386/arch-impl.h
deleted file mode 100644
index 2494460..0000000
--- a/interfaces/cc/vc++/i386/arch-impl.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_arch_impl_
-#define _h_arch_impl_
-
-#ifndef _h_noarch_arch_impl_
-#include "../noarch/arch-impl.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_arch_impl_ */
diff --git a/interfaces/cc/vc++/i386/bitstr.h b/interfaces/cc/vc++/i386/bitstr.h
deleted file mode 100644
index a2e07ef..0000000
--- a/interfaces/cc/vc++/i386/bitstr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_bitstr_
-#define _h_bitstr_
-
-/* use 32-bit accumulator, 16-bit word size */
-#define WRDSIZE 16
-#define WRDSHIFT 4
-#define WRD uint16_t
-#define ACC uint32_t
-#define BSWAP( x ) bswap_16 ( x )
-
-#include "../noarch/bitstr.h"
-
-#endif /* _h_bitstr_ */
diff --git a/interfaces/cc/vc++/noarch/arch-impl.h b/interfaces/cc/vc++/noarch/arch-impl.h
deleted file mode 100644
index 94feb4f..0000000
--- a/interfaces/cc/vc++/noarch/arch-impl.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_noarch_arch_impl_
-#define _h_noarch_arch_impl_
-
-#include <stdint.h>
-
-#ifndef _INC_STDLIB
-#include <stdlib.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* this table is very simple to calculate
-   but simpler yet to use for lookup */
-static const int8_t lsbit_map [] =
-{
-    -1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-     4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-
-static __inline
-int16_t uint16_lsbit ( uint16_t self )
-{
-    /* detect no bits are set */
-    if ( self == 0 )
-        return -1;
-
-    /* detect bits set in lower byte */
-    if ( ( uint8_t ) self != 0 )
-        return lsbit_map [ ( uint8_t ) self ];
-
-    /* return bit set in upper byte */
-    return lsbit_map [ self >> 8 ] + 8;
-}
-
-static __inline
-int32_t uint32_lsbit ( uint32_t self )
-{
-    /* detect no bits are set */
-    if ( self == 0 )
-        return -1;
-
-    /* detect bits set in lower word */
-    if ( ( uint16_t ) self != 0 )
-        return uint16_lsbit ( ( uint16_t ) self );
-
-    /* return bit set in upper word */
-    return uint16_lsbit ( self >> 16 ) + 16;
-}
-
-typedef struct int128_t int128_t;
-struct int128_t
-{
-    uint64_t lo;
-    int64_t hi;
-};
-
-static __inline
-int64_t int128_hi ( const int128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline
-uint64_t int128_lo ( const int128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline
-void int128_sethi ( int128_t *self, int64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline
-void int128_setlo ( int128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-typedef struct uint128_t uint128_t;
-struct uint128_t
-{
-    uint64_t lo;
-    uint64_t hi;
-};
-
-static __inline
-uint64_t uint128_hi ( const uint128_t *self )
-{
-    return self -> hi;
-}
-
-static __inline
-uint64_t uint128_lo ( const uint128_t *self )
-{
-    return self -> lo;
-}
-
-static __inline
-void uint128_sethi ( uint128_t *self, uint64_t i )
-{
-    self -> hi = i;
-}
-
-static __inline
-void uint128_setlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo = i;
-}
-
-static __inline
-void int128_add ( int128_t *self, const int128_t *i )
-{
-    uint64_t carry = ( ( const uint32_t* ) self ) [ 0 ] + ( ( const uint32_t* ) i ) [ 0 ];
-    self -> hi += i -> hi;
-    carry = ( ( const uint32_t* ) self ) [ 1 ] + ( ( const uint32_t* ) i ) [ 1 ] + ( carry >> 32 );
-    self -> lo += i -> lo;
-    self -> hi += carry >> 32;
-}
-
-static __inline
-void int128_sub ( int128_t *self, const int128_t *i )
-{
-    int carry = i -> lo > self -> lo;
-    self -> hi -= i -> hi;
-    self -> lo -= i -> lo;
-    self -> hi -= carry;
-}
-
-static __inline
-void int128_sar ( int128_t *self, uint32_t i )
-{
-    if ( i < 64 )
-    {
-        self -> lo = ( self -> hi << ( 64 - i ) ) |  ( self -> lo >> i );
-        self -> hi >>= i;
-    }
-    else
-    {
-        self -> lo = self -> hi >> ( i - 64 );
-        self -> hi >>= 63;
-    }
-}
-
-static __inline
-void int128_shl ( int128_t *self, uint32_t i )
-{
-    if ( i < 64 )
-    {
-        self -> hi = ( self -> hi << i ) | ( int64_t ) ( self -> lo >> ( 64 - i ) );
-        self -> lo <<= i;
-    }
-    else
-    {
-        self -> hi = ( int64_t ) ( self -> lo << ( i - 64 ) );
-        self -> lo = 0;
-    }
-}
-
-static __inline
-void uint128_and ( uint128_t *self, const uint128_t *i )
-{
-    self -> lo &= i -> lo;
-    self -> hi &= i -> hi;
-}
-
-static __inline
-void uint128_or ( uint128_t *self, const uint128_t *i )
-{
-    self -> lo |= i -> lo;
-    self -> hi |= i -> hi;
-}
-
-static __inline
-void uint128_orlo ( uint128_t *self, uint64_t i )
-{
-    self -> lo |= i;
-}
-
-static __inline
-void uint128_xor ( uint128_t *self, const uint128_t *i )
-{
-    self -> lo ^= i -> lo;
-    self -> hi ^= i -> hi;
-}
-
-static __inline
-void uint128_not ( uint128_t *self )
-{
-    self -> lo = ~ self -> lo;
-    self -> hi = ~ self -> hi;
-}
-
-static __inline
-void uint128_shr ( uint128_t *self, uint32_t i )
-{
-    if ( i < 64 )
-    {
-        self -> lo = ( self -> hi << ( 64 - i ) ) |  ( self -> lo >> i );
-        self -> hi >>= i;
-    }
-    else
-    {
-        self -> lo = self -> hi >> ( i - 64 );
-        self -> hi >>= 63;
-    }
-}
-
-static __inline
-void uint128_shl ( uint128_t *self, uint32_t i )
-{
-    if ( i < 64 )
-    {
-        self -> hi = ( self -> hi << i ) | ( self -> lo >> ( 64 - i ) );
-        self -> lo <<= i;
-    }
-    else
-    {
-        self -> hi = self -> lo << ( i - 64 );
-        self -> lo = 0;
-    }
-}
-
-static __inline
-void uint128_bswap ( uint128_t *self )
-{
-    uint64_t tmp = _byteswap_uint64 ( self -> lo );
-    self -> lo = _byteswap_uint64 ( self -> hi );
-    ( ( uint64_t* ) self ) [ 1 ] = tmp;
-}
-
-static __inline
-void uint128_bswap_copy ( uint128_t *to, const uint128_t *from )
-{
-    to -> lo = _byteswap_uint64 ( from -> hi );
-    to -> hi = _byteswap_uint64 ( from -> lo );
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_noarch_arch_impl_ */
diff --git a/interfaces/cc/vc++/noarch/bitstr.h b/interfaces/cc/vc++/noarch/bitstr.h
deleted file mode 100644
index 88a4c34..0000000
--- a/interfaces/cc/vc++/noarch/bitstr.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_noarch_bitstr_
-#define _h_noarch_bitstr_
-
-#ifndef _h_bitstr_
-#error "don't include <noarch/bitstr.h> directly - use <bitstr.h>"
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <byteswap.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* bitcpy                                                                                                                                                                                                    
- *  copy a string of bits from source to dest                                                                                                                                                                
- *                                                                                                                                                                                                           
- *  both source and dest may have non-byte aligned pointers                                                                                                                                                  
- *  the number of bits to copy need not be byte aligned                                                                                                                                                      
- *                                                                                                                                                                                                           
- *  depending upon architecture and OS conventions, the word                                                                                                                                                 
- *  size may be adjusted to 1, 2, or 4 bytes, where the base                                                                                                                                                 
- *  pointers are always word aligned.                                                                                                                                                                        
- *                                                                                                                                                                                                           
- *  bits in memory are always treated as big-endian, meaning                                                                                                                                                 
- *  that on multi-byte fetches and stores, we perform byte-swapping                                                                                                                                          
- *  if there are shifts or masks                                                                                                                                                                             
- */
-static __inline
-void bitcpy ( void *dbase, bitsz_t doff, const void *sbase, bitsz_t soff, bitsz_t sz )
-{
-    /* noop if sz == 0 */
-    if ( sz != 0 )
-    {
-        /* loop counter and destination word count */
-        size_t i, dcountz;
-
-        /* left & right masks and working register */
-        WRD lmask, rmask, reg;
-
-        /* produce word-aligned pointers */
-#if WRDSIZE == 8
-        /* 1-4. all at once */
-        WRD *dst = ( WRD* ) dbase + ( doff >> WRDSHIFT );
-        const WRD *src = ( const WRD* ) sbase + ( soff >> WRDSHIFT );
-#else
-        /* 1. capture word alignment adjustment */
-        size_t dadjust = ( size_t ) dbase & ( WRDSIZE / 8 - 1 );
-        size_t sadjust = ( size_t ) sbase & ( WRDSIZE / 8 - 1 );
-
-        /* 2. create word-aligned pointers */
-        WRD *dst = ( WRD* ) ( ( size_t ) dbase - dadjust );
-        const WRD *src = ( const WRD* ) ( ( size_t ) sbase - sadjust );
-
-        /* 3. incorporate alignment adjustment into offset bits */
-        doff += dadjust << 3;
-        soff += sadjust << 3;
-
-        /* 4. readjust pointers based upon offset */
-        dst += doff >> WRDSHIFT;
-        src += soff >> WRDSHIFT;
-#endif
-        /* 5. restate offsets */
-        doff &= ( WRDSIZE - 1 );
-        soff &= ( WRDSIZE - 1 );
-
-        /* calculate number of words - 1 in dst */
-        dcountz = ( size_t ) ( ( doff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT );
-
-        /* calculate masks */
-        lmask = rmask = ~ 0;
-        lmask >>= doff;
-        rmask >>= ( doff + sz ) & ( WRDSIZE - 1 );
-        if ( ( WRD ) ( rmask + 1 ) == 0 )
-            rmask = 0;
-
-        /* prime register with masked dst [ 0 ] */
-        reg = BSWAP ( dst [ 0 ] ) & ~ lmask;
-
-        /* if source and destination are aligned */
-        if ( doff == soff )
-        {
-            /* merge src [ 0 ] into reg through mask */
-            reg |= BSWAP ( src [ 0 ] ) & lmask;
-
-#if WRDSIZE > 8
-            /* straight copies don't need byteswap                                                                                                                                                           
-               other than on first and last words                                                                                                                                                            
-               put first word back into little-endian                                                                                                                                                        
-               for remainder of loop */
-            if ( dcountz > 0 )
-            {
-                reg = BSWAP ( reg );
-#endif
-                /* aligned buffers have n:n word ratio */
-                for ( i = 0; i < dcountz; )
-                {
-                    dst [ i ] = reg;
-                    reg = src [ ++ i ];
-                }
-
-#if WRDSIZE > 8
-                /* revert to big-endian */
-                reg = BSWAP ( reg );
-            }
-#endif
-        }
-
-        /* shifting alignment  */
-        else
-        {
-            /* source count may differ from dest count */
-            size_t scountz = ( size_t ) ( ( soff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT );
-
-            /* use double-word accumulator */
-            ACC acc = BSWAP ( src [ 0 ] );
-
-            /* shift amount */
-            int shift = ( int ) doff - ( int ) soff;
-            if ( shift > 0 )
-            {
-                /* take only valid bits in shifted initial src */
-                reg |= ( WRD ) ( acc >> shift ) & lmask;
-
-                /* because "shift" > 0, we know "dcountz" >= "scountz" */
-                for ( acc <<= WRDSIZE, i = 0; i < scountz; acc <<= WRDSIZE )
-                {
-                    dst [ i ] = BSWAP ( reg );
-                    acc |= BSWAP ( src [ ++ i ] );
-                    reg = ( WRD ) ( acc >> shift );
-                }
-
-                /* if "dcountz" > "scountz" */
-                if ( i < dcountz )
-                {
-                    dst [ i ] = BSWAP ( reg );
-                    reg = ( WRD ) ( acc >> shift );
-                }
-            }
-
-            else
-            {
-                /* need single word read-ahead and right-shift */
-                shift += WRDSIZE;
-
-                /* because "shift" was < 0, we know "dcountz" <= "scountz" */
-                for ( acc <<= WRDSIZE, i = 0; i < dcountz; acc <<= WRDSIZE )
-                {
-                    acc |= BSWAP ( src [ i + 1 ] );
-                    reg |= ( WRD ) ( acc >> shift ) & lmask;
-                    dst [ i ++ ] = BSWAP ( reg );
-                    lmask = ~ 0;
-                    reg = 0;
-                }
-
-                /* if "dcountz" < "scountz" */
-                if ( i < scountz )
-                    acc |= BSWAP ( src [ scountz ] );
-
-                reg |= ( WRD ) ( acc >> shift ) & lmask;
-            }
-        }
-
-        /* mask off unused bytes from src */
-        reg &= ~ rmask;
-
-        /* bring in saved bits from dst */
-        reg |= BSWAP ( dst [ dcountz ] ) & rmask;
-
-        /* write out last word */
-        dst [ dcountz ] = BSWAP ( reg );
-    }
-}
-
-/* bitcmp
- *  performs bitwise a - b, returning result as int
- *  result value has no meaning, only sign
- *  where < 0 means a < b, > 0 means a > b, and 0 means a == b
- *
- *  since the comparison produces a tri-state indicator of
- *  relative magnitude, the order of "a" and "b" is important.
- *  furthermore, the difference operator must be evaluated
- *  left to right, because the result indicates more than
- *  equality.
- *
- *  see bitcpy for general word alignment information
- */
-static __inline
-int bitcmp ( const void *abase, bitsz_t aoff, const void *bbase, bitsz_t boff, bitsz_t sz )
-{
-    int diff = 0;
-
-    if ( sz != 0 )
-    {
-        /* loop counter and left word count */
-        size_t i, lcountz;
-
-        /* left & right masks and working registers */
-        WRD lmask, rmask, lreg, rreg;
-
-        /* produce word-aligned pointers */
-#if WRDSIZE == 8
-        /* 1-4. all at once */
-        const WRD *left = ( const WRD* ) abase + ( aoff >> WRDSHIFT );
-        const WRD *right = ( const WRD* ) bbase + ( boff >> WRDSHIFT );
-#else
-        /* 1. capture word alignment adjustment */
-        size_t aadjust = ( size_t ) abase & ( WRDSIZE / 8 - 1 );
-        size_t badjust = ( size_t ) bbase & ( WRDSIZE / 8 - 1 );
-
-        /* 2. create word-aligned pointers */
-        const WRD *left = ( const WRD* ) ( ( size_t ) abase - aadjust );
-        const WRD *right = ( const WRD* ) ( ( size_t ) bbase - badjust );
-
-        /* 3. incorporate alignment adjustment into offset bits */
-        aoff += aadjust << 3;
-        boff += badjust << 3;
-
-        /* 4. readjust pointers based upon offset */
-        left += aoff >> WRDSHIFT;
-        right += boff >> WRDSHIFT;
-#endif
-        /* 5. restate offsets */
-        aoff &= ( WRDSIZE - 1 );
-        boff &= ( WRDSIZE - 1 );
-
-        /* calculate number of words - 1 in left
-           since we know a-priori that "sz" > 0, we
-           know that the left and right counts must be
-           at least 1. our loops treat the last word
-           specially, so calculate a loop counter that
-           excludes the last word */
-        lcountz = ( size_t ) ( ( aoff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT );
-
-        /* calculate masks */
-        lmask = rmask = ~ 0;
-        lmask >>= aoff;
-        rmask >>= ( aoff + sz ) & ( WRDSIZE - 1 );
-        if ( ( WRD ) ( rmask + 1 ) == 0 )
-            rmask = 0;
-
-        /* significant bits from left [ 0 ] */
-        lreg = BSWAP ( left [ 0 ] ) & lmask;
-
-        /* if source and destination are aligned */
-        if ( aoff == boff )
-        {
-            /* test against right bits through mask */
-            rreg = BSWAP ( right [ 0 ] ) & lmask;
-
-            /* produce a difference of all but the last
-               aligned word, where initial word has been
-               left-masked. the last word is tested below. */
-            for ( i = 1; i <= lcountz; ++ i )
-            {
-                diff = ( int ) lreg - ( int ) rreg;
-                if ( diff != 0 )
-                    return diff;
-
-                /* byte-swapping occurs on little-endian architectures */
-                lreg = BSWAP ( left [ i ] );
-                rreg = BSWAP ( right [ i ] );
-            }
-
-            /* fall out to end for masked comparison of last word */
-        }
-
-        /* shifting alignment */
-        else
-        {
-            /* right count may differ from left count
-               since alignments differ, the span of "sz"
-               bits may hit a different number of words in
-               the left array than in the right. */
-            size_t rcountz = ( size_t ) ( ( boff + sz + ( WRDSIZE - 1 ) - WRDSIZE ) >> WRDSHIFT );
-
-            /* use double-word accumulator
-               note that the extra bits get ignored */
-            ACC acc = BSWAP ( right [ 0 ] );
-
-            /* shift amount: positive if "b" needs to be right shifted.
-               NOTE - since the comparison must be successively performed
-               from left to right ( see above ), shifting is ALWAYS toward
-               right, making for special handling when "shift" < 0 ( see below ) */
-            int shift = ( int ) aoff - ( int ) boff;
-            if ( shift > 0 )
-            {
-                /* initial word from right operand, aligned with left */
-                rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                /* "shift" > 0 means "lcountz" >= "rcountz" */
-                for ( acc <<= WRDSIZE, i = 1; i <= rcountz; acc <<= WRDSIZE, ++ i )
-                {
-                    /* compare words at i-1 */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* accumulate next word from right operand */
-                    acc |= BSWAP ( right [ i ] );
-
-                    /* bring in next word from left operand */
-                    lreg = BSWAP ( left [ i ] );
-
-                    /* produce aligned word from right operand */
-                    rreg = ( WRD ) ( acc >> shift );
-                }
-
-                /* if there is one more word in left */
-                if ( lcountz > rcountz )
-                {
-                    /* compare penultimate */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* get last word in left */
-                    lreg = BSWAP ( left [ lcountz ] );
-
-                    /* last word from right is already in "acc" */
-                    rreg = ( WRD ) ( acc >> shift );
-                }
-
-                /* fall out to end for masked comparison of last word */
-            }
-
-            else
-            {
-                /* since all shifts must be toward right ( due to left to right
-                   comparison ), this alignment will require a pre-fetch from
-                   right operand into accumulator, and adjusting the negative
-                   shift amount to a positive right-shift. */
-                shift += WRDSIZE;
-
-                /* since "shift" was negative, we know "lcountz" <= "rcountz",
-                   so use "lcountz" as loop limit. pre-shift "acc" as loop init */
-                for ( acc <<= WRDSIZE, i = 1; i <= lcountz; acc <<= WRDSIZE, ++ i )
-                {
-                    /* accumulate next word from right operand */
-                    acc |= BSWAP ( right [ i ] );
-
-                    /* produce aligned word from right operand */
-                    rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                    /* now test against left */
-                    diff = ( int ) lreg - ( int ) rreg;
-                    if ( diff != 0 )
-                        return diff;
-
-                    /* bring in next word from left operand */
-                    lreg = BSWAP ( left [ i ] );
-
-                    /* no more left mask */
-                    lmask = ~ 0;
-                }
-
-                /* if there is one more word in right */
-                if ( lcountz < rcountz )
-                    acc |= BSWAP ( right [ rcountz ] );
-
-                /* produce "rreg" from "acc" */
-                rreg = ( WRD ) ( acc >> shift ) & lmask;
-
-                /* fall out to end for masked comparison of last word */
-            }
-        }
-
-        /* mask off unused bytes from right */
-        lreg &= ~ rmask;
-        rreg &= ~ rmask;
-
-        /* perform final comparison */
-        diff = ( int ) lreg - ( int ) rreg;
-    }
-
-    return diff;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_noarch_bitstr_ */
diff --git a/interfaces/cc/vc++/stdbool.h b/interfaces/cc/vc++/stdbool.h
deleted file mode 100644
index 4807cb4..0000000
--- a/interfaces/cc/vc++/stdbool.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _STDBOOL_H
-#define _STDBOOL_H
-
-/*--------------------------------------------------------------------------
- * bool
- */
-
-#ifndef __cplusplus
-typedef unsigned char bool;
-
-#undef true
-#define true 1
-
-#undef false
-#define false 0
-
-#endif
-
-
-#endif /* _STDBOOL_H */
diff --git a/interfaces/cc/vc++/stdint.h b/interfaces/cc/vc++/stdint.h
deleted file mode 100644
index 057374c..0000000
--- a/interfaces/cc/vc++/stdint.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _STDINT_H
-#define _STDINT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* perhaps not the best place for this, but it helps reduce the
-   number of artificial includes for compatibility */
-#ifndef __inline__
-#define __inline__ __inline
-#endif
-
-typedef __int8 int8_t;
-typedef __int16 int16_t;
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-
-#ifndef INT8_MAX
-#define INT8_MAX _I8_MAX
-#endif
-
-#ifndef INT8_MIN
-#define INT8_MIN _I8_MIN
-#endif
-
-#ifndef UINT8_MAX
-#define UINT8_MAX _UI8_MAX
-#endif
-
-#ifndef INT16_MAX
-#define INT16_MAX _I16_MAX
-#endif
-
-#ifndef INT16_MIN
-#define INT16_MIN _I16_MIN
-#endif
-
-#ifndef UINT16_MAX
-#define UINT16_MAX _UI16_MAX
-#endif
-
-#ifndef INT32_MAX
-#define INT32_MAX _I32_MAX
-#endif
-
-#ifndef INT32_MIN
-#define INT32_MIN _I32_MIN
-#endif
-
-#ifndef UINT32_MAX
-#define UINT32_MAX _UI32_MAX
-#endif
-
-#ifndef INT64_MAX
-#define INT64_MAX _I64_MAX
-#endif
-
-#ifndef INT64_MIN
-#define INT64_MIN _I64_MIN
-#endif
-
-#ifndef UINT64_MAX
-#define UINT64_MAX _UI64_MAX
-#endif
-
-#ifndef SIZE_T_MAX
-#define SIZE_T_MAX ((size_t)(-(1ULL)))
-#endif
-
-#if !defined(__cplusplus)  ||  defined(__STDC_CONSTANT_MACROS)
-#ifndef UINT64_C
-#define UINT64_C(x) (x ## ULL)
-#endif
-#ifndef INT64_C
-#define INT64_C(x) (x ## LL)
-#endif
-#endif
-
-#ifndef __func__
-#define __func__ __FUNCTION__
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/interfaces/cc/vc++/va_copy.h b/interfaces/cc/vc++/va_copy.h
deleted file mode 100644
index 76fc7c7..0000000
--- a/interfaces/cc/vc++/va_copy.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_va_copy_
-#define _h_va_copy_
-
-#include <STDARG.H>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define va_copy( dst, src ) \
-    ( dst ) = ( src )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_va_copy_ */
diff --git a/interfaces/cc/vc++/x86_64/arch-impl.h b/interfaces/cc/vc++/x86_64/arch-impl.h
deleted file mode 100644
index 2494460..0000000
--- a/interfaces/cc/vc++/x86_64/arch-impl.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_arch_impl_
-#define _h_arch_impl_
-
-#ifndef _h_noarch_arch_impl_
-#include "../noarch/arch-impl.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_arch_impl_ */
diff --git a/interfaces/cc/vc++/x86_64/bitstr.h b/interfaces/cc/vc++/x86_64/bitstr.h
deleted file mode 100644
index b52f525..0000000
--- a/interfaces/cc/vc++/x86_64/bitstr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_bitstr_
-#define _h_bitstr_
-
-/* use 64-bit accumulator, 32-bit word size */
-#define WRDSIZE 32
-#define WRDSHIFT 5
-#define WRD uint32_t
-#define ACC uint64_t
-#define BSWAP( x ) bswap_32 ( x )
-
-#include "../noarch/bitstr.h"
-
-#endif /* _h_bitstr_ */
diff --git a/interfaces/ext/bzlib.h b/interfaces/ext/bzlib.h
deleted file mode 100644
index 8277123..0000000
--- a/interfaces/ext/bzlib.h
+++ /dev/null
@@ -1,282 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Public header file for the library.                   ---*/
-/*---                                               bzlib.h ---*/
-/*-------------------------------------------------------------*/
-
-/* ------------------------------------------------------------------
-   This file is part of bzip2/libbzip2, a program and library for
-   lossless, block-sorting data compression.
-
-   bzip2/libbzip2 version 1.0.6 of 6 September 2010
-   Copyright (C) 1996-2010 Julian Seward <jseward at bzip.org>
-
-   Please read the WARNING, DISCLAIMER and PATENTS sections in the 
-   README file.
-
-   This program is released under the terms of the license contained
-   in the file LICENSE.
-   ------------------------------------------------------------------ */
-
-
-#ifndef _BZLIB_H
-#define _BZLIB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define BZ_RUN               0
-#define BZ_FLUSH             1
-#define BZ_FINISH            2
-
-#define BZ_OK                0
-#define BZ_RUN_OK            1
-#define BZ_FLUSH_OK          2
-#define BZ_FINISH_OK         3
-#define BZ_STREAM_END        4
-#define BZ_SEQUENCE_ERROR    (-1)
-#define BZ_PARAM_ERROR       (-2)
-#define BZ_MEM_ERROR         (-3)
-#define BZ_DATA_ERROR        (-4)
-#define BZ_DATA_ERROR_MAGIC  (-5)
-#define BZ_IO_ERROR          (-6)
-#define BZ_UNEXPECTED_EOF    (-7)
-#define BZ_OUTBUFF_FULL      (-8)
-#define BZ_CONFIG_ERROR      (-9)
-
-typedef 
-   struct {
-      char *next_in;
-      unsigned int avail_in;
-      unsigned int total_in_lo32;
-      unsigned int total_in_hi32;
-
-      char *next_out;
-      unsigned int avail_out;
-      unsigned int total_out_lo32;
-      unsigned int total_out_hi32;
-
-      void *state;
-
-      void *(*bzalloc)(void *,int,int);
-      void (*bzfree)(void *,void *);
-      void *opaque;
-   } 
-   bz_stream;
-
-
-#ifndef BZ_IMPORT
-#define BZ_EXPORT
-#endif
-
-#ifndef BZ_NO_STDIO
-/* Need a definitition for FILE */
-#include <stdio.h>
-#endif
-
-#ifdef _WIN32
-#   include <windows.h>
-#   ifdef small
-      /* windows.h define small to char */
-#      undef small
-#   endif
-#   ifdef BZ_EXPORT
-#   define BZ_API(func) WINAPI func
-#   define BZ_EXTERN extern
-#   else
-   /* import windows dll dynamically */
-#   define BZ_API(func) (WINAPI * func)
-#   define BZ_EXTERN
-#   endif
-#else
-#   define BZ_API(func) func
-#   define BZ_EXTERN extern
-#endif
-
-
-/*-- Core (low-level) library functions --*/
-
-BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( 
-      bz_stream* strm, 
-      int        blockSize100k, 
-      int        verbosity, 
-      int        workFactor 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzCompress) ( 
-      bz_stream* strm, 
-      int action 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( 
-      bz_stream* strm 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( 
-      bz_stream *strm, 
-      int       verbosity, 
-      int       small
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( 
-      bz_stream* strm 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( 
-      bz_stream *strm 
-   );
-
-
-
-/*-- High(er) level library functions --*/
-
-#ifndef BZ_NO_STDIO
-#define BZ_MAX_UNUSED 5000
-
-typedef void BZFILE;
-
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( 
-      int*  bzerror,   
-      FILE* f, 
-      int   verbosity, 
-      int   small,
-      void* unused,    
-      int   nUnused 
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( 
-      int*    bzerror, 
-      BZFILE* b 
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void**  unused,  
-      int*    nUnused 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzRead) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
-   );
-
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( 
-      int*  bzerror,      
-      FILE* f, 
-      int   blockSize100k, 
-      int   verbosity, 
-      int   workFactor 
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzWrite) ( 
-      int*    bzerror, 
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( 
-      int*          bzerror, 
-      BZFILE*       b, 
-      int           abandon, 
-      unsigned int* nbytes_in, 
-      unsigned int* nbytes_out 
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( 
-      int*          bzerror, 
-      BZFILE*       b, 
-      int           abandon, 
-      unsigned int* nbytes_in_lo32, 
-      unsigned int* nbytes_in_hi32, 
-      unsigned int* nbytes_out_lo32, 
-      unsigned int* nbytes_out_hi32
-   );
-#endif
-
-
-/*-- Utility functions --*/
-
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( 
-      char*         dest, 
-      unsigned int* destLen,
-      char*         source, 
-      unsigned int  sourceLen,
-      int           blockSize100k, 
-      int           verbosity, 
-      int           workFactor 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( 
-      char*         dest, 
-      unsigned int* destLen,
-      char*         source, 
-      unsigned int  sourceLen,
-      int           small, 
-      int           verbosity 
-   );
-
-
-/*--
-   Code contributed by Yoshioka Tsuneo (tsuneo at rr.iij4u.or.jp)
-   to support better zlib compatibility.
-   This code is not _officially_ part of libbzip2 (yet);
-   I haven't tested it, documented it, or considered the
-   threading-safeness of it.
-   If this code breaks, please contact both Yoshioka and me.
---*/
-
-BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
-      void
-   );
-
-#ifndef BZ_NO_STDIO
-BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
-      const char *path,
-      const char *mode
-   );
-
-BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
-      int        fd,
-      const char *mode
-   );
-         
-BZ_EXTERN int BZ_API(BZ2_bzread) (
-      BZFILE* b, 
-      void* buf, 
-      int len 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzwrite) (
-      BZFILE* b, 
-      void*   buf, 
-      int     len 
-   );
-
-BZ_EXTERN int BZ_API(BZ2_bzflush) (
-      BZFILE* b
-   );
-
-BZ_EXTERN void BZ_API(BZ2_bzclose) (
-      BZFILE* b
-   );
-
-BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
-      BZFILE *b, 
-      int    *errnum
-   );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/*-------------------------------------------------------------*/
-/*--- end                                           bzlib.h ---*/
-/*-------------------------------------------------------------*/
diff --git a/interfaces/ext/libxml/DOCBparser.h b/interfaces/ext/libxml/DOCBparser.h
deleted file mode 100644
index 461d4ee..0000000
--- a/interfaces/ext/libxml/DOCBparser.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Summary: old DocBook SGML parser
- * Description: interface for a DocBook SGML non-verifying parser
- * This code is DEPRECATED, and should not be used anymore.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __DOCB_PARSER_H__
-#define __DOCB_PARSER_H__
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_DOCB_ENABLED
-
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h>
-
-#ifndef IN_LIBXML
-#ifdef __GNUC__
-#warning "The DOCBparser module has been deprecated in libxml2-2.6.0"
-#endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Most of the back-end structures from XML and SGML are shared.
- */
-typedef xmlParserCtxt docbParserCtxt;
-typedef xmlParserCtxtPtr docbParserCtxtPtr;
-typedef xmlSAXHandler docbSAXHandler;
-typedef xmlSAXHandlerPtr docbSAXHandlerPtr;
-typedef xmlParserInput docbParserInput;
-typedef xmlParserInputPtr docbParserInputPtr;
-typedef xmlDocPtr docbDocPtr;
-
-/*
- * There is only few public functions.
- */
-XMLPUBFUN int XMLCALL
-		     docbEncodeEntities(unsigned char *out,
-                                        int *outlen,
-                                        const unsigned char *in,
-                                        int *inlen, int quoteChar);
-
-XMLPUBFUN docbDocPtr XMLCALL             
-		     docbSAXParseDoc   (xmlChar *cur,
-                                        const char *encoding,
-                                        docbSAXHandlerPtr sax,
-                                        void *userData);
-XMLPUBFUN docbDocPtr XMLCALL             
-		     docbParseDoc      (xmlChar *cur,
-                                        const char *encoding);
-XMLPUBFUN docbDocPtr XMLCALL             
-		     docbSAXParseFile  (const char *filename,
-                                        const char *encoding,
-                                        docbSAXHandlerPtr sax,
-                                        void *userData);
-XMLPUBFUN docbDocPtr XMLCALL             
-		     docbParseFile     (const char *filename,
-                                        const char *encoding);
-
-/**
- * Interfaces for the Push mode.
- */
-XMLPUBFUN void XMLCALL                  
-		     docbFreeParserCtxt      (docbParserCtxtPtr ctxt);
-XMLPUBFUN docbParserCtxtPtr XMLCALL     
-		     docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
-                                              void *user_data,
-                                              const char *chunk,
-                                              int size,
-                                              const char *filename,
-                                              xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL                   
-		     docbParseChunk          (docbParserCtxtPtr ctxt,
-                                              const char *chunk,
-                                              int size,
-                                              int terminate);
-XMLPUBFUN docbParserCtxtPtr XMLCALL       
-		     docbCreateFileParserCtxt(const char *filename,
-                                              const char *encoding);
-XMLPUBFUN int XMLCALL                   
-		     docbParseDocument       (docbParserCtxtPtr ctxt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_DOCB_ENABLED */
-
-#endif /* __DOCB_PARSER_H__ */
diff --git a/interfaces/ext/libxml/HTMLparser.h b/interfaces/ext/libxml/HTMLparser.h
deleted file mode 100644
index 05905e4..0000000
--- a/interfaces/ext/libxml/HTMLparser.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Summary: interface for an HTML 4.0 non-verifying parser
- * Description: this module implements an HTML 4.0 non-verifying parser
- *              with API compatible with the XML parser ones. It should
- *              be able to parse "real world" HTML, even if severely
- *              broken from a specification point of view.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __HTML_PARSER_H__
-#define __HTML_PARSER_H__
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-
-#ifdef LIBXML_HTML_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Most of the back-end structures from XML and HTML are shared.
- */
-typedef xmlParserCtxt htmlParserCtxt;
-typedef xmlParserCtxtPtr htmlParserCtxtPtr;
-typedef xmlParserNodeInfo htmlParserNodeInfo;
-typedef xmlSAXHandler htmlSAXHandler;
-typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
-typedef xmlParserInput htmlParserInput;
-typedef xmlParserInputPtr htmlParserInputPtr;
-typedef xmlDocPtr htmlDocPtr;
-typedef xmlNodePtr htmlNodePtr;
-
-/*
- * Internal description of an HTML element, representing HTML 4.01
- * and XHTML 1.0 (which share the same structure).
- */
-typedef struct _htmlElemDesc htmlElemDesc;
-typedef htmlElemDesc *htmlElemDescPtr;
-struct _htmlElemDesc {
-    const char *name;	/* The tag name */
-    char startTag;      /* Whether the start tag can be implied */
-    char endTag;        /* Whether the end tag can be implied */
-    char saveEndTag;    /* Whether the end tag should be saved */
-    char empty;         /* Is this an empty element ? */
-    char depr;          /* Is this a deprecated element ? */
-    char dtd;           /* 1: only in Loose DTD, 2: only Frameset one */
-    char isinline;      /* is this a block 0 or inline 1 element */
-    const char *desc;   /* the description */
-
-/* NRK Jan.2003
- * New fields encapsulating HTML structure
- *
- * Bugs:
- *	This is a very limited representation.  It fails to tell us when
- *	an element *requires* subelements (we only have whether they're
- *	allowed or not), and it doesn't tell us where CDATA and PCDATA
- *	are allowed.  Some element relationships are not fully represented:
- *	these are flagged with the word MODIFIER
- */
-    const char** subelts;		/* allowed sub-elements of this element */
-    const char* defaultsubelt;	/* subelement for suggested auto-repair
-					   if necessary or NULL */
-    const char** attrs_opt;		/* Optional Attributes */
-    const char** attrs_depr;		/* Additional deprecated attributes */
-    const char** attrs_req;		/* Required attributes */
-};
-
-/*
- * Internal description of an HTML entity.
- */
-typedef struct _htmlEntityDesc htmlEntityDesc;
-typedef htmlEntityDesc *htmlEntityDescPtr;
-struct _htmlEntityDesc {
-    unsigned int value;	/* the UNICODE value for the character */
-    const char *name;	/* The entity name */
-    const char *desc;   /* the description */
-};
-
-/*
- * There is only few public functions.
- */
-XMLPUBFUN const htmlElemDesc * XMLCALL 	
-			htmlTagLookup	(const xmlChar *tag);
-XMLPUBFUN const htmlEntityDesc * XMLCALL 	
-			htmlEntityLookup(const xmlChar *name);
-XMLPUBFUN const htmlEntityDesc * XMLCALL 	
-			htmlEntityValueLookup(unsigned int value);
-
-XMLPUBFUN int XMLCALL			
-			htmlIsAutoClosed(htmlDocPtr doc,
-					 htmlNodePtr elem);
-XMLPUBFUN int XMLCALL			
-			htmlAutoCloseTag(htmlDocPtr doc,
-					 const xmlChar *name,
-					 htmlNodePtr elem);
-XMLPUBFUN const htmlEntityDesc * XMLCALL	
-			htmlParseEntityRef(htmlParserCtxtPtr ctxt,
-					 const xmlChar **str);
-XMLPUBFUN int XMLCALL			
-			htmlParseCharRef(htmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			htmlParseElement(htmlParserCtxtPtr ctxt);
-
-XMLPUBFUN htmlParserCtxtPtr XMLCALL	
-			htmlNewParserCtxt(void);
-
-XMLPUBFUN htmlParserCtxtPtr XMLCALL	
-			htmlCreateMemoryParserCtxt(const char *buffer,
-						   int size);
-
-XMLPUBFUN int XMLCALL			
-			htmlParseDocument(htmlParserCtxtPtr ctxt);
-XMLPUBFUN htmlDocPtr XMLCALL		
-			htmlSAXParseDoc	(xmlChar *cur,
-					 const char *encoding,
-					 htmlSAXHandlerPtr sax,
-					 void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL		
-			htmlParseDoc	(xmlChar *cur,
-					 const char *encoding);
-XMLPUBFUN htmlDocPtr XMLCALL		
-			htmlSAXParseFile(const char *filename,
-					 const char *encoding,
-					 htmlSAXHandlerPtr sax,
-					 void *userData);
-XMLPUBFUN htmlDocPtr XMLCALL		
-			htmlParseFile	(const char *filename,
-					 const char *encoding);
-XMLPUBFUN int XMLCALL			
-			UTF8ToHtml	(unsigned char *out,
-					 int *outlen,
-					 const unsigned char *in,
-					 int *inlen);
-XMLPUBFUN int XMLCALL			
-			htmlEncodeEntities(unsigned char *out,
-					 int *outlen,
-					 const unsigned char *in,
-					 int *inlen, int quoteChar);
-XMLPUBFUN int XMLCALL			
-			htmlIsScriptAttribute(const xmlChar *name);
-XMLPUBFUN int XMLCALL			
-			htmlHandleOmittedElem(int val);
-
-#ifdef LIBXML_PUSH_ENABLED
-/**
- * Interfaces for the Push mode.
- */
-XMLPUBFUN htmlParserCtxtPtr XMLCALL	
-			htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
-						 void *user_data,
-						 const char *chunk,
-						 int size,
-						 const char *filename,
-						 xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL			
-			htmlParseChunk		(htmlParserCtxtPtr ctxt,
-						 const char *chunk,
-						 int size,
-						 int terminate);
-#endif /* LIBXML_PUSH_ENABLED */
-
-XMLPUBFUN void XMLCALL			
-			htmlFreeParserCtxt	(htmlParserCtxtPtr ctxt);
-
-/*
- * New set of simpler/more flexible APIs
- */
-/**
- * xmlParserOption:
- *
- * This is the set of XML parser options that can be passed down
- * to the xmlReadDoc() and similar calls.
- */
-typedef enum {
-    HTML_PARSE_RECOVER  = 1<<0, /* Relaxed parsing */
-    HTML_PARSE_NOERROR	= 1<<5,	/* suppress error reports */
-    HTML_PARSE_NOWARNING= 1<<6,	/* suppress warning reports */
-    HTML_PARSE_PEDANTIC	= 1<<7,	/* pedantic error reporting */
-    HTML_PARSE_NOBLANKS	= 1<<8,	/* remove blank nodes */
-    HTML_PARSE_NONET	= 1<<11,/* Forbid network access */
-    HTML_PARSE_COMPACT  = 1<<16 /* compact small text nodes */
-} htmlParserOption;
-
-XMLPUBFUN void XMLCALL
-		htmlCtxtReset		(htmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		htmlCtxtUseOptions	(htmlParserCtxtPtr ctxt,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlReadDoc		(const xmlChar *cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlReadFile		(const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlReadMemory		(const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlReadFd		(int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlReadIO		(xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlCtxtReadDoc		(xmlParserCtxtPtr ctxt,
-					 const xmlChar *cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlCtxtReadFile		(xmlParserCtxtPtr ctxt,
-					 const char *filename,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlCtxtReadMemory		(xmlParserCtxtPtr ctxt,
-					 const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlCtxtReadFd		(xmlParserCtxtPtr ctxt,
-					 int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlCtxtReadIO		(xmlParserCtxtPtr ctxt,
-					 xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-
-/* NRK/Jan2003: further knowledge of HTML structure
- */
-typedef enum {
-  HTML_NA = 0 ,		/* something we don't check at all */
-  HTML_INVALID = 0x1 ,
-  HTML_DEPRECATED = 0x2 ,
-  HTML_VALID = 0x4 ,
-  HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
-} htmlStatus ;
-
-/* Using htmlElemDesc rather than name here, to emphasise the fact
-   that otherwise there's a lookup overhead
-*/
-XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
-XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
-XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
-XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ;
-/**
- * htmlDefaultSubelement:
- * @elt: HTML element
- *
- * Returns the default subelement for this element
- */
-#define htmlDefaultSubelement(elt) elt->defaultsubelt
-/**
- * htmlElementAllowedHereDesc:
- * @parent: HTML parent element
- * @elt: HTML element
- *
- * Checks whether an HTML element description may be a
- * direct child of the specified element.
- *
- * Returns 1 if allowed; 0 otherwise.
- */
-#define htmlElementAllowedHereDesc(parent,elt) \
-	htmlElementAllowedHere((parent), (elt)->name)
-/**
- * htmlRequiredAttrs:
- * @elt: HTML element
- *
- * Returns the attributes required for the specified element.
- */
-#define htmlRequiredAttrs(elt) (elt)->attrs_req
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_HTML_ENABLED */
-#endif /* __HTML_PARSER_H__ */
diff --git a/interfaces/ext/libxml/HTMLtree.h b/interfaces/ext/libxml/HTMLtree.h
deleted file mode 100644
index 6ea8207..0000000
--- a/interfaces/ext/libxml/HTMLtree.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Summary: specific APIs to process HTML tree, especially serialization
- * Description: this module implements a few function needed to process
- *              tree in an HTML specific way.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __HTML_TREE_H__
-#define __HTML_TREE_H__
-
-#include <stdio.h>
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/HTMLparser.h>
-
-#ifdef LIBXML_HTML_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * HTML_TEXT_NODE:
- *
- * Macro. A text node in a HTML document is really implemented
- * the same way as a text node in an XML document.
- */
-#define HTML_TEXT_NODE		XML_TEXT_NODE
-/**
- * HTML_ENTITY_REF_NODE:
- *
- * Macro. An entity reference in a HTML document is really implemented
- * the same way as an entity reference in an XML document.
- */
-#define HTML_ENTITY_REF_NODE	XML_ENTITY_REF_NODE
-/**
- * HTML_COMMENT_NODE:
- *
- * Macro. A comment in a HTML document is really implemented
- * the same way as a comment in an XML document.
- */
-#define HTML_COMMENT_NODE	XML_COMMENT_NODE
-/**
- * HTML_PRESERVE_NODE:
- *
- * Macro. A preserved node in a HTML document is really implemented
- * the same way as a CDATA section in an XML document.
- */
-#define HTML_PRESERVE_NODE	XML_CDATA_SECTION_NODE
-/**
- * HTML_PI_NODE:
- *
- * Macro. A processing instruction in a HTML document is really implemented
- * the same way as a processing instruction in an XML document.
- */
-#define HTML_PI_NODE		XML_PI_NODE
-
-XMLPUBFUN htmlDocPtr XMLCALL
-		htmlNewDoc		(const xmlChar *URI,
-					 const xmlChar *ExternalID);
-XMLPUBFUN htmlDocPtr XMLCALL	
-		htmlNewDocNoDtD		(const xmlChar *URI,
-					 const xmlChar *ExternalID);
-XMLPUBFUN const xmlChar * XMLCALL	
-		htmlGetMetaEncoding	(htmlDocPtr doc);
-XMLPUBFUN int XMLCALL		
-		htmlSetMetaEncoding	(htmlDocPtr doc,
-					 const xmlChar *encoding);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL	    
-		htmlDocDumpMemory	(xmlDocPtr cur,
-					 xmlChar **mem,
-					 int *size);
-XMLPUBFUN void XMLCALL	    
-		htmlDocDumpMemoryFormat	(xmlDocPtr cur,
-					 xmlChar **mem,
-					 int *size,
-					 int format);
-XMLPUBFUN int XMLCALL		
-		htmlDocDump		(FILE *f,
-					 xmlDocPtr cur);
-XMLPUBFUN int XMLCALL		
-		htmlSaveFile		(const char *filename,
-					 xmlDocPtr cur);
-XMLPUBFUN int XMLCALL		
-		htmlNodeDump		(xmlBufferPtr buf,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur);
-XMLPUBFUN void XMLCALL		
-		htmlNodeDumpFile	(FILE *out,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur);
-XMLPUBFUN int XMLCALL		
-		htmlNodeDumpFileFormat	(FILE *out,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur,
-					 const char *encoding,
-					 int format);
-XMLPUBFUN int XMLCALL		
-		htmlSaveFileEnc		(const char *filename,
-					 xmlDocPtr cur,
-					 const char *encoding);
-XMLPUBFUN int XMLCALL		
-		htmlSaveFileFormat	(const char *filename,
-					 xmlDocPtr cur,
-					 const char *encoding,
-					 int format);
-
-XMLPUBFUN void XMLCALL		
-		htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur,
-					 const char *encoding,
-					 int format);
-XMLPUBFUN void XMLCALL		
-		htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
-					 xmlDocPtr cur,
-					 const char *encoding);
-XMLPUBFUN void XMLCALL		
-		htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
-					 xmlDocPtr cur,
-					 const char *encoding,
-					 int format);
-XMLPUBFUN void XMLCALL 
-		htmlNodeDumpOutput	(xmlOutputBufferPtr buf, 
-					 xmlDocPtr doc,
-					 xmlNodePtr cur, 
-					 const char *encoding);
-
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-XMLPUBFUN int XMLCALL		
-		htmlIsBooleanAttr	(const xmlChar *name);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_HTML_ENABLED */
-
-#endif /* __HTML_TREE_H__ */
-
diff --git a/interfaces/ext/libxml/SAX.h b/interfaces/ext/libxml/SAX.h
deleted file mode 100644
index 0ca161b..0000000
--- a/interfaces/ext/libxml/SAX.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Summary: Old SAX version 1 handler, deprecated
- * Description: DEPRECATED set of SAX version 1 interfaces used to
- *              build the DOM tree.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SAX_H__
-#define __XML_SAX_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-#include <libxml/xlink.h>
-
-#ifdef LIBXML_LEGACY_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-XMLPUBFUN const xmlChar * XMLCALL
-		getPublicId			(void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL	
-		getSystemId			(void *ctx);
-XMLPUBFUN void XMLCALL		
-		setDocumentLocator		(void *ctx,
-						 xmlSAXLocatorPtr loc);
-    
-XMLPUBFUN int XMLCALL		
-		getLineNumber			(void *ctx);
-XMLPUBFUN int XMLCALL		
-		getColumnNumber			(void *ctx);
-
-XMLPUBFUN int XMLCALL		
-		isStandalone			(void *ctx);
-XMLPUBFUN int XMLCALL		
-		hasInternalSubset		(void *ctx);
-XMLPUBFUN int XMLCALL		
-		hasExternalSubset		(void *ctx);
-
-XMLPUBFUN void XMLCALL		
-		internalSubset			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL		
-		externalSubset			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL	
-		getEntity			(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL	
-		getParameterEntity		(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL 
-		resolveEntity			(void *ctx,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-
-XMLPUBFUN void XMLCALL		
-		entityDecl			(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 xmlChar *content);
-XMLPUBFUN void XMLCALL		
-		attributeDecl			(void *ctx,
-						 const xmlChar *elem,
-						 const xmlChar *fullname,
-						 int type,
-						 int def,
-						 const xmlChar *defaultValue,
-						 xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL		
-		elementDecl			(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL		
-		notationDecl			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-XMLPUBFUN void XMLCALL		
-		unparsedEntityDecl		(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 const xmlChar *notationName);
-
-XMLPUBFUN void XMLCALL		
-		startDocument			(void *ctx);
-XMLPUBFUN void XMLCALL		
-		endDocument			(void *ctx);
-XMLPUBFUN void XMLCALL		
-		attribute			(void *ctx,
-						 const xmlChar *fullname,
-						 const xmlChar *value);
-XMLPUBFUN void XMLCALL		
-		startElement			(void *ctx,
-						 const xmlChar *fullname,
-						 const xmlChar **atts);
-XMLPUBFUN void XMLCALL		
-		endElement			(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN void XMLCALL		
-		reference			(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN void XMLCALL		
-		characters			(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XMLPUBFUN void XMLCALL		
-		ignorableWhitespace		(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XMLPUBFUN void XMLCALL		
-		processingInstruction		(void *ctx,
-						 const xmlChar *target,
-						 const xmlChar *data);
-XMLPUBFUN void XMLCALL		
-		globalNamespace			(void *ctx,
-						 const xmlChar *href,
-						 const xmlChar *prefix);
-XMLPUBFUN void XMLCALL		
-		setNamespace			(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN xmlNsPtr XMLCALL	
-		getNamespace			(void *ctx);
-XMLPUBFUN int XMLCALL		
-		checkNamespace			(void *ctx,
-						 xmlChar *nameSpace);
-XMLPUBFUN void XMLCALL		
-		namespaceDecl			(void *ctx,
-						 const xmlChar *href,
-						 const xmlChar *prefix);
-XMLPUBFUN void XMLCALL		
-		comment				(void *ctx,
-						 const xmlChar *value);
-XMLPUBFUN void XMLCALL		
-		cdataBlock			(void *ctx,
-						 const xmlChar *value,
-						 int len);
-
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL		
-		initxmlDefaultSAXHandler	(xmlSAXHandlerV1 *hdlr,
-						 int warning);
-#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL		
-		inithtmlDefaultSAXHandler	(xmlSAXHandlerV1 *hdlr);
-#endif
-#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL		
-		initdocbDefaultSAXHandler	(xmlSAXHandlerV1 *hdlr);
-#endif
-#endif /* LIBXML_SAX1_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_LEGACY_ENABLED */
-
-#endif /* __XML_SAX_H__ */
diff --git a/interfaces/ext/libxml/SAX2.h b/interfaces/ext/libxml/SAX2.h
deleted file mode 100644
index 8d2db02..0000000
--- a/interfaces/ext/libxml/SAX2.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Summary: SAX2 parser interface used to build the DOM tree
- * Description: those are the default SAX2 interfaces used by
- *              the library when building DOM tree.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SAX2_H__
-#define __XML_SAX2_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-#include <libxml/xlink.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-XMLPUBFUN const xmlChar * XMLCALL
-		xmlSAX2GetPublicId		(void *ctx);
-XMLPUBFUN const xmlChar * XMLCALL	
-		xmlSAX2GetSystemId		(void *ctx);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2SetDocumentLocator	(void *ctx,
-						 xmlSAXLocatorPtr loc);
-    
-XMLPUBFUN int XMLCALL		
-		xmlSAX2GetLineNumber		(void *ctx);
-XMLPUBFUN int XMLCALL		
-		xmlSAX2GetColumnNumber		(void *ctx);
-
-XMLPUBFUN int XMLCALL		
-		xmlSAX2IsStandalone		(void *ctx);
-XMLPUBFUN int XMLCALL		
-		xmlSAX2HasInternalSubset	(void *ctx);
-XMLPUBFUN int XMLCALL		
-		xmlSAX2HasExternalSubset	(void *ctx);
-
-XMLPUBFUN void XMLCALL		
-		xmlSAX2InternalSubset		(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2ExternalSubset		(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XMLPUBFUN xmlEntityPtr XMLCALL	
-		xmlSAX2GetEntity		(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL	
-		xmlSAX2GetParameterEntity	(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN xmlParserInputPtr XMLCALL 
-		xmlSAX2ResolveEntity		(void *ctx,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-
-XMLPUBFUN void XMLCALL		
-		xmlSAX2EntityDecl		(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 xmlChar *content);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2AttributeDecl		(void *ctx,
-						 const xmlChar *elem,
-						 const xmlChar *fullname,
-						 int type,
-						 int def,
-						 const xmlChar *defaultValue,
-						 xmlEnumerationPtr tree);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2ElementDecl		(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2NotationDecl		(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2UnparsedEntityDecl	(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 const xmlChar *notationName);
-
-XMLPUBFUN void XMLCALL		
-		xmlSAX2StartDocument		(void *ctx);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2EndDocument		(void *ctx);
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
-XMLPUBFUN void XMLCALL		
-		xmlSAX2StartElement		(void *ctx,
-						 const xmlChar *fullname,
-						 const xmlChar **atts);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2EndElement		(void *ctx,
-						 const xmlChar *name);
-#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
-XMLPUBFUN void XMLCALL
-		xmlSAX2StartElementNs		(void *ctx,
-						 const xmlChar *localname,
-						 const xmlChar *prefix,
-						 const xmlChar *URI,
-						 int nb_namespaces,
-						 const xmlChar **namespaces,
-						 int nb_attributes,
-						 int nb_defaulted,
-						 const xmlChar **attributes);
-XMLPUBFUN void XMLCALL
-		xmlSAX2EndElementNs		(void *ctx,
-						 const xmlChar *localname,
-						 const xmlChar *prefix,
-						 const xmlChar *URI);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2Reference		(void *ctx,
-						 const xmlChar *name);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2Characters		(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2IgnorableWhitespace	(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2ProcessingInstruction	(void *ctx,
-						 const xmlChar *target,
-						 const xmlChar *data);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2Comment			(void *ctx,
-						 const xmlChar *value);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2CDataBlock		(void *ctx,
-						 const xmlChar *value,
-						 int len);
-
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL
-		xmlSAXDefaultVersion		(int version);
-#endif /* LIBXML_SAX1_ENABLED */
-
-XMLPUBFUN int XMLCALL
-		xmlSAXVersion			(xmlSAXHandler *hdlr,
-						 int version);
-XMLPUBFUN void XMLCALL		
-		xmlSAX2InitDefaultSAXHandler    (xmlSAXHandler *hdlr,
-						 int warning);
-#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL		
-		htmlDefaultSAXHandlerInit	(void);
-#endif
-#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
-XMLPUBFUN void XMLCALL		
-		docbDefaultSAXHandlerInit	(void);
-#endif
-XMLPUBFUN void XMLCALL		
-		xmlDefaultSAXHandlerInit	(void);
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_SAX2_H__ */
diff --git a/interfaces/ext/libxml/c14n.h b/interfaces/ext/libxml/c14n.h
deleted file mode 100644
index a8aa737..0000000
--- a/interfaces/ext/libxml/c14n.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Summary: Provide Canonical XML and Exclusive XML Canonicalization
- * Description: the c14n modules provides a
- *
- * "Canonical XML" implementation
- * http://www.w3.org/TR/xml-c14n
- *
- * and an
- *
- * "Exclusive XML Canonicalization" implementation
- * http://www.w3.org/TR/xml-exc-c14n
-
- * Copy: See Copyright for the status of this software.
- *
- * Author: Aleksey Sanin <aleksey at aleksey.com>
- */
-#ifndef __XML_C14N_H__
-#define __XML_C14N_H__
-#ifdef LIBXML_C14N_ENABLED
-#ifdef LIBXML_OUTPUT_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-
-/*
- * XML Canonicazation
- * http://www.w3.org/TR/xml-c14n
- *
- * Exclusive XML Canonicazation
- * http://www.w3.org/TR/xml-exc-c14n
- *
- * Canonical form of an XML document could be created if and only if
- *  a) default attributes (if any) are added to all nodes
- *  b) all character and parsed entity references are resolved
- * In order to achive this in libxml2 the document MUST be loaded with
- * following global setings:
- *
- *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
- *    xmlSubstituteEntitiesDefault(1);
- *
- * or corresponding parser context setting:
- *    xmlParserCtxtPtr ctxt;
- *
- *    ...
- *    ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
- *    ctxt->replaceEntities = 1;
- *    ...
- */
-
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocSaveTo	(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlOutputBufferPtr buf);
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocDumpMemory	(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlChar **doc_txt_ptr);
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocSave		(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 const char* filename,
-					 int compression);
-
-
-/**
- * This is the core C14N function
- */
-/**
- * xmlC14NIsVisibleCallback:
- * @user_data: user data
- * @node: the curent node
- * @parent: the parent node
- *
- * Signature for a C14N callback on visible nodes
- *
- * Returns 1 if the node should be included
- */
-typedef int (*xmlC14NIsVisibleCallback)	(void* user_data,
-					 xmlNodePtr node,
-					 xmlNodePtr parent);
-
-XMLPUBFUN int XMLCALL
-		xmlC14NExecute		(xmlDocPtr doc,
-					 xmlC14NIsVisibleCallback is_visible_callback,
-					 void* user_data,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlOutputBufferPtr buf);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LIBXML_OUTPUT_ENABLED */
-#endif /* LIBXML_C14N_ENABLED */
-#endif /* __XML_C14N_H__ */
-
diff --git a/interfaces/ext/libxml/catalog.h b/interfaces/ext/libxml/catalog.h
deleted file mode 100644
index b444137..0000000
--- a/interfaces/ext/libxml/catalog.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/**
- * Summary: interfaces to the Catalog handling system
- * Description: the catalog module implements the support for
- * XML Catalogs and SGML catalogs
- *
- * SGML Open Technical Resolution TR9401:1997.
- * http://www.jclark.com/sp/catalog.htm
- *
- * XML Catalogs Working Draft 06 August 2001
- * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_CATALOG_H__
-#define __XML_CATALOG_H__
-
-#include <stdio.h>
-
-#include <libxml/xmlversion.h>
-#include <libxml/xmlstring.h>
-#include <libxml/tree.h>
-
-#ifdef LIBXML_CATALOG_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * XML_CATALOGS_NAMESPACE:
- *
- * The namespace for the XML Catalogs elements.
- */
-#define XML_CATALOGS_NAMESPACE					\
-    (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
-/**
- * XML_CATALOG_PI:
- *
- * The specific XML Catalog Processing Instuction name.
- */
-#define XML_CATALOG_PI						\
-    (const xmlChar *) "oasis-xml-catalog"
-
-/*
- * The API is voluntarily limited to general cataloging.
- */
-typedef enum {
-    XML_CATA_PREFER_NONE = 0,
-    XML_CATA_PREFER_PUBLIC = 1,
-    XML_CATA_PREFER_SYSTEM
-} xmlCatalogPrefer;
-
-typedef enum {
-    XML_CATA_ALLOW_NONE = 0,
-    XML_CATA_ALLOW_GLOBAL = 1,
-    XML_CATA_ALLOW_DOCUMENT = 2,
-    XML_CATA_ALLOW_ALL = 3
-} xmlCatalogAllow;
-
-typedef struct _xmlCatalog xmlCatalog;
-typedef xmlCatalog *xmlCatalogPtr;
-
-/*
- * Operations on a given catalog.
- */
-XMLPUBFUN xmlCatalogPtr XMLCALL
-		xmlNewCatalog		(int sgml);
-XMLPUBFUN xmlCatalogPtr XMLCALL	
-		xmlLoadACatalog		(const char *filename);
-XMLPUBFUN xmlCatalogPtr XMLCALL	
-		xmlLoadSGMLSuperCatalog	(const char *filename);
-XMLPUBFUN int XMLCALL		
-		xmlConvertSGMLCatalog	(xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL		
-		xmlACatalogAdd		(xmlCatalogPtr catal,
-					 const xmlChar *type,
-					 const xmlChar *orig,
-					 const xmlChar *replace);
-XMLPUBFUN int XMLCALL		
-		xmlACatalogRemove	(xmlCatalogPtr catal,
-					 const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlACatalogResolve	(xmlCatalogPtr catal,
-					 const xmlChar *pubID,
-	                                 const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlACatalogResolveSystem(xmlCatalogPtr catal,
-					 const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlACatalogResolvePublic(xmlCatalogPtr catal,
-					 const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlACatalogResolveURI	(xmlCatalogPtr catal,
-					 const xmlChar *URI);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlACatalogDump		(xmlCatalogPtr catal,
-					 FILE *out);
-#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL		
-		xmlFreeCatalog		(xmlCatalogPtr catal);
-XMLPUBFUN int XMLCALL		
-		xmlCatalogIsEmpty	(xmlCatalogPtr catal);
-
-/*
- * Global operations.
- */
-XMLPUBFUN void XMLCALL		
-		xmlInitializeCatalog	(void);
-XMLPUBFUN int XMLCALL		
-		xmlLoadCatalog		(const char *filename);
-XMLPUBFUN void XMLCALL		
-		xmlLoadCatalogs		(const char *paths);
-XMLPUBFUN void XMLCALL		
-		xmlCatalogCleanup	(void);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlCatalogDump		(FILE *out);
-#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogResolve	(const xmlChar *pubID,
-	                                 const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogResolveSystem	(const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogResolvePublic	(const xmlChar *pubID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogResolveURI	(const xmlChar *URI);
-XMLPUBFUN int XMLCALL		
-		xmlCatalogAdd		(const xmlChar *type,
-					 const xmlChar *orig,
-					 const xmlChar *replace);
-XMLPUBFUN int XMLCALL		
-		xmlCatalogRemove	(const xmlChar *value);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlParseCatalogFile	(const char *filename);
-XMLPUBFUN int XMLCALL		
-		xmlCatalogConvert	(void);
-
-/*
- * Strictly minimal interfaces for per-document catalogs used
- * by the parser.
- */
-XMLPUBFUN void XMLCALL		
-		xmlCatalogFreeLocal	(void *catalogs);
-XMLPUBFUN void * XMLCALL		
-		xmlCatalogAddLocal	(void *catalogs,
-					 const xmlChar *URL);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogLocalResolve	(void *catalogs,
-					 const xmlChar *pubID,
-	                                 const xmlChar *sysID);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlCatalogLocalResolveURI(void *catalogs,
-					 const xmlChar *URI);
-/*
- * Preference settings.
- */
-XMLPUBFUN int XMLCALL		
-		xmlCatalogSetDebug	(int level);
-XMLPUBFUN xmlCatalogPrefer XMLCALL 
-		xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
-XMLPUBFUN void XMLCALL		
-		xmlCatalogSetDefaults	(xmlCatalogAllow allow);
-XMLPUBFUN xmlCatalogAllow XMLCALL	
-		xmlCatalogGetDefaults	(void);
-
-
-/* DEPRECATED interfaces */
-XMLPUBFUN const xmlChar * XMLCALL	
-		xmlCatalogGetSystem	(const xmlChar *sysID);
-XMLPUBFUN const xmlChar * XMLCALL	
-		xmlCatalogGetPublic	(const xmlChar *pubID);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* LIBXML_CATALOG_ENABLED */
-#endif /* __XML_CATALOG_H__ */
diff --git a/interfaces/ext/libxml/chvalid.h b/interfaces/ext/libxml/chvalid.h
deleted file mode 100644
index fb43016..0000000
--- a/interfaces/ext/libxml/chvalid.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Summary: Unicode character range checking
- * Description: this module exports interfaces for the character
- *               range validation APIs
- *
- * This file is automatically generated from the cvs source
- * definition files using the genChRanges.py Python script
- *
- * Generation date: Mon Mar 27 11:09:48 2006
- * Sources: chvalid.def
- * Author: William Brack <wbrack at mmm.com.hk>
- */
-
-#ifndef __XML_CHVALID_H__
-#define __XML_CHVALID_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/xmlstring.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define our typedefs and structures
- *
- */
-typedef struct _xmlChSRange xmlChSRange;
-typedef xmlChSRange *xmlChSRangePtr;
-struct _xmlChSRange {
-    unsigned short	low;
-    unsigned short	high;
-};
-
-typedef struct _xmlChLRange xmlChLRange;
-typedef xmlChLRange *xmlChLRangePtr;
-struct _xmlChLRange {
-    unsigned int	low;
-    unsigned int	high;
-};
-
-typedef struct _xmlChRangeGroup xmlChRangeGroup;
-typedef xmlChRangeGroup *xmlChRangeGroupPtr;
-struct _xmlChRangeGroup {
-    int			nbShortRange;
-    int			nbLongRange;
-    const xmlChSRange	*shortRange;	/* points to an array of ranges */
-    const xmlChLRange	*longRange;
-};
-
-/**
- * Range checking routine
- */
-XMLPUBFUN int XMLCALL
-		xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
-
-
-/**
- * xmlIsBaseChar_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
-				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
-				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
-				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
-				  (0xf8 <= (c)))
-
-/**
- * xmlIsBaseCharQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
-				 xmlIsBaseChar_ch((c)) : \
-				 xmlCharInRange((c), &xmlIsBaseCharGroup))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
-
-/**
- * xmlIsBlank_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
-				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
-				 ((c) == 0xd))
-
-/**
- * xmlIsBlankQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsBlankQ(c)		(((c) < 0x100) ? \
-				 xmlIsBlank_ch((c)) : 0)
-
-
-/**
- * xmlIsChar_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
-				 ((c) == 0xd) || \
-				  (0x20 <= (c)))
-
-/**
- * xmlIsCharQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsCharQ(c)		(((c) < 0x100) ? \
-				 xmlIsChar_ch((c)) :\
-				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
-				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
-				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
-
-/**
- * xmlIsCombiningQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
-				 0 : \
-				 xmlCharInRange((c), &xmlIsCombiningGroup))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
-
-/**
- * xmlIsDigit_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
-
-/**
- * xmlIsDigitQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
-				 xmlIsDigit_ch((c)) : \
-				 xmlCharInRange((c), &xmlIsDigitGroup))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
-
-/**
- * xmlIsExtender_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsExtender_ch(c)	(((c) == 0xb7))
-
-/**
- * xmlIsExtenderQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
-				 xmlIsExtender_ch((c)) : \
-				 xmlCharInRange((c), &xmlIsExtenderGroup))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
-
-/**
- * xmlIsIdeographicQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
-				 0 :\
-				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
-				 ((c) == 0x3007) || \
-				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
-
-XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
-XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
-
-/**
- * xmlIsPubidChar_ch:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
-
-/**
- * xmlIsPubidCharQ:
- * @c: char to validate
- *
- * Automatically generated by genChRanges.py
- */
-#define xmlIsPubidCharQ(c)	(((c) < 0x100) ? \
-				 xmlIsPubidChar_ch((c)) : 0)
-
-XMLPUBFUN int XMLCALL
-		xmlIsBaseChar(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsBlank(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsChar(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsCombining(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsDigit(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsExtender(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsIdeographic(unsigned int ch);
-XMLPUBFUN int XMLCALL
-		xmlIsPubidChar(unsigned int ch);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_CHVALID_H__ */
diff --git a/interfaces/ext/libxml/debugXML.h b/interfaces/ext/libxml/debugXML.h
deleted file mode 100644
index 5a9d20b..0000000
--- a/interfaces/ext/libxml/debugXML.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Summary: Tree debugging APIs
- * Description: Interfaces to a set of routines used for debugging the tree
- *              produced by the XML parser.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __DEBUG_XML__
-#define __DEBUG_XML__
-#include <stdio.h>
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef LIBXML_DEBUG_ENABLED
-
-#include <libxml/xpath.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The standard Dump routines.
- */
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpString	(FILE *output,
-				 const xmlChar *str);
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpAttr	(FILE *output,
-				 xmlAttrPtr attr,
-				 int depth);
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpAttrList	(FILE *output,
-				 xmlAttrPtr attr,
-				 int depth);
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpOneNode	(FILE *output,
-				 xmlNodePtr node,
-				 int depth);
-XMLPUBFUN void XMLCALL
-	xmlDebugDumpNode	(FILE *output,
-				 xmlNodePtr node,
-				 int depth);
-XMLPUBFUN void XMLCALL
-	xmlDebugDumpNodeList	(FILE *output,
-				 xmlNodePtr node,
-				 int depth);
-XMLPUBFUN void XMLCALL
-	xmlDebugDumpDocumentHead(FILE *output,
-				 xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
-	xmlDebugDumpDocument	(FILE *output,
-				 xmlDocPtr doc);
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpDTD		(FILE *output,
-				 xmlDtdPtr dtd);
-XMLPUBFUN void XMLCALL	
-	xmlDebugDumpEntities	(FILE *output,
-				 xmlDocPtr doc);
-
-/****************************************************************
- *								*
- *	 		Checking routines			*
- *								*
- ****************************************************************/
-
-XMLPUBFUN int XMLCALL
-	xmlDebugCheckDocument	(FILE * output,
-				 xmlDocPtr doc);
-
-/****************************************************************
- *								*
- *	 		XML shell helpers			*
- *								*
- ****************************************************************/
-
-XMLPUBFUN void XMLCALL	
-	xmlLsOneNode		(FILE *output, xmlNodePtr node);
-XMLPUBFUN int XMLCALL	
-	xmlLsCountNode		(xmlNodePtr node);
-
-XMLPUBFUN const char * XMLCALL 
-	xmlBoolToText		(int boolval);
-
-/****************************************************************
- *								*
- *	 The XML shell related structures and functions		*
- *								*
- ****************************************************************/
-
-#ifdef LIBXML_XPATH_ENABLED
-/**
- * xmlShellReadlineFunc:
- * @prompt:  a string prompt
- *
- * This is a generic signature for the XML shell input function.
- *
- * Returns a string which will be freed by the Shell.
- */
-typedef char * (* xmlShellReadlineFunc)(char *prompt);
-
-/**
- * xmlShellCtxt:
- *
- * A debugging shell context.
- * TODO: add the defined function tables.
- */
-typedef struct _xmlShellCtxt xmlShellCtxt;
-typedef xmlShellCtxt *xmlShellCtxtPtr;
-struct _xmlShellCtxt {
-    char *filename;
-    xmlDocPtr doc;
-    xmlNodePtr node;
-    xmlXPathContextPtr pctxt;
-    int loaded;
-    FILE *output;
-    xmlShellReadlineFunc input;
-};
-
-/**
- * xmlShellCmd:
- * @ctxt:  a shell context
- * @arg:  a string argument
- * @node:  a first node
- * @node2:  a second node
- *
- * This is a generic signature for the XML shell functions.
- *
- * Returns an int, negative returns indicating errors.
- */
-typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
-                             char *arg,
-			     xmlNodePtr node,
-			     xmlNodePtr node2);
-
-XMLPUBFUN void XMLCALL	
-	xmlShellPrintXPathError	(int errorType,
-				 const char *arg);
-XMLPUBFUN void XMLCALL	
-	xmlShellPrintXPathResult(xmlXPathObjectPtr list);
-XMLPUBFUN int XMLCALL	
-	xmlShellList		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellBase		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellDir		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellLoad		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL	
-	xmlShellPrintNode	(xmlNodePtr node);
-XMLPUBFUN int XMLCALL	
-	xmlShellCat		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellWrite		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellSave		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int XMLCALL	
-	xmlShellValidate	(xmlShellCtxtPtr ctxt,
-				 char *dtd,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#endif /* LIBXML_VALID_ENABLED */
-XMLPUBFUN int XMLCALL	
-	xmlShellDu		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr tree,
-				 xmlNodePtr node2);
-XMLPUBFUN int XMLCALL	
-	xmlShellPwd		(xmlShellCtxtPtr ctxt,
-				 char *buffer,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-
-/*
- * The Shell interface.
- */
-XMLPUBFUN void XMLCALL	
-	xmlShell		(xmlDocPtr doc,
-				 char *filename,
-				 xmlShellReadlineFunc input,
-				 FILE *output);
-			 
-#endif /* LIBXML_XPATH_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_DEBUG_ENABLED */
-#endif /* __DEBUG_XML__ */
diff --git a/interfaces/ext/libxml/dict.h b/interfaces/ext/libxml/dict.h
deleted file mode 100644
index abb8339..0000000
--- a/interfaces/ext/libxml/dict.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Summary: string dictionnary
- * Description: dictionary of reusable strings, just used to avoid allocation
- *         and freeing operations.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_DICT_H__
-#define __XML_DICT_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The dictionnary.
- */
-typedef struct _xmlDict xmlDict;
-typedef xmlDict *xmlDictPtr;
-
-/*
- * Constructor and destructor.
- */
-XMLPUBFUN xmlDictPtr XMLCALL
-			xmlDictCreate	(void);
-XMLPUBFUN xmlDictPtr XMLCALL
-			xmlDictCreateSub(xmlDictPtr sub);
-XMLPUBFUN int XMLCALL
-			xmlDictReference(xmlDictPtr dict);
-XMLPUBFUN void XMLCALL			
-			xmlDictFree	(xmlDictPtr dict);
-
-/*
- * Lookup of entry in the dictionnary.
- */
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlDictLookup	(xmlDictPtr dict,
-		                         const xmlChar *name,
-		                         int len);
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlDictExists	(xmlDictPtr dict,
-		                         const xmlChar *name,
-		                         int len);
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlDictQLookup	(xmlDictPtr dict,
-		                         const xmlChar *prefix,
-		                         const xmlChar *name);
-XMLPUBFUN int XMLCALL
-			xmlDictOwns	(xmlDictPtr dict,
-					 const xmlChar *str);
-XMLPUBFUN int XMLCALL			
-			xmlDictSize	(xmlDictPtr dict);
-
-/*
- * Cleanup function
- */
-XMLPUBFUN void XMLCALL
-                        xmlDictCleanup  (void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* ! __XML_DICT_H__ */
diff --git a/interfaces/ext/libxml/encoding.h b/interfaces/ext/libxml/encoding.h
deleted file mode 100644
index c74b25f..0000000
--- a/interfaces/ext/libxml/encoding.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Summary: interface for the encoding conversion functions
- * Description: interface for the encoding conversion functions needed for
- *              XML basic encoding and iconv() support.
- *
- * Related specs are
- * rfc2044        (UTF-8 and UTF-16) F. Yergeau Alis Technologies
- * [ISO-10646]    UTF-8 and UTF-16 in Annexes
- * [ISO-8859-1]   ISO Latin-1 characters codes.
- * [UNICODE]      The Unicode Consortium, "The Unicode Standard --
- *                Worldwide Character Encoding -- Version 1.0", Addison-
- *                Wesley, Volume 1, 1991, Volume 2, 1992.  UTF-8 is
- *                described in Unicode Technical Report #4.
- * [US-ASCII]     Coded Character Set--7-bit American Standard Code for
- *                Information Interchange, ANSI X3.4-1986.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_CHAR_ENCODING_H__
-#define __XML_CHAR_ENCODING_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_ICONV_ENABLED
-#include <iconv.h>
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * xmlCharEncoding:
- *
- * Predefined values for some standard encodings.
- * Libxml does not do beforehand translation on UTF8 and ISOLatinX.
- * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
- *
- * Anything else would have to be translated to UTF8 before being
- * given to the parser itself. The BOM for UTF16 and the encoding
- * declaration are looked at and a converter is looked for at that
- * point. If not found the parser stops here as asked by the XML REC. A
- * converter can be registered by the user using xmlRegisterCharEncodingHandler
- * but the current form doesn't allow stateful transcoding (a serious
- * problem agreed !). If iconv has been found it will be used
- * automatically and allow stateful transcoding, the simplest is then
- * to be sure to enable iconv and to provide iconv libs for the encoding
- * support needed.
- *
- * Note that the generic "UTF-16" is not a predefined value.  Instead, only
- * the specific UTF-16LE and UTF-16BE are present.
- */
-typedef enum {
-    XML_CHAR_ENCODING_ERROR=   -1, /* No char encoding detected */
-    XML_CHAR_ENCODING_NONE=	0, /* No char encoding detected */
-    XML_CHAR_ENCODING_UTF8=	1, /* UTF-8 */
-    XML_CHAR_ENCODING_UTF16LE=	2, /* UTF-16 little endian */
-    XML_CHAR_ENCODING_UTF16BE=	3, /* UTF-16 big endian */
-    XML_CHAR_ENCODING_UCS4LE=	4, /* UCS-4 little endian */
-    XML_CHAR_ENCODING_UCS4BE=	5, /* UCS-4 big endian */
-    XML_CHAR_ENCODING_EBCDIC=	6, /* EBCDIC uh! */
-    XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
-    XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
-    XML_CHAR_ENCODING_UCS2=	9, /* UCS-2 */
-    XML_CHAR_ENCODING_8859_1=	10,/* ISO-8859-1 ISO Latin 1 */
-    XML_CHAR_ENCODING_8859_2=	11,/* ISO-8859-2 ISO Latin 2 */
-    XML_CHAR_ENCODING_8859_3=	12,/* ISO-8859-3 */
-    XML_CHAR_ENCODING_8859_4=	13,/* ISO-8859-4 */
-    XML_CHAR_ENCODING_8859_5=	14,/* ISO-8859-5 */
-    XML_CHAR_ENCODING_8859_6=	15,/* ISO-8859-6 */
-    XML_CHAR_ENCODING_8859_7=	16,/* ISO-8859-7 */
-    XML_CHAR_ENCODING_8859_8=	17,/* ISO-8859-8 */
-    XML_CHAR_ENCODING_8859_9=	18,/* ISO-8859-9 */
-    XML_CHAR_ENCODING_2022_JP=  19,/* ISO-2022-JP */
-    XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
-    XML_CHAR_ENCODING_EUC_JP=   21,/* EUC-JP */
-    XML_CHAR_ENCODING_ASCII=    22 /* pure ASCII */
-} xmlCharEncoding;
-
-/**
- * xmlCharEncodingInputFunc:
- * @out:  a pointer to an array of bytes to store the UTF-8 result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of chars in the original encoding
- * @inlen:  the length of @in
- *
- * Take a block of chars in the original encoding and try to convert
- * it to an UTF-8 block of chars out.
- *
- * Returns the number of bytes written, -1 if lack of space, or -2
- *     if the transcoding failed.
- * The value of @inlen after return is the number of octets consumed
- *     if the return value is positive, else unpredictiable.
- * The value of @outlen after return is the number of octets consumed.
- */
-typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
-                                         const unsigned char *in, int *inlen);
-
-
-/**
- * xmlCharEncodingOutputFunc:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * Take a block of UTF-8 chars in and try to convert it to another
- * encoding.
- * Note: a first call designed to produce heading info is called with
- * in = NULL. If stateful this should also initialize the encoder state.
- *
- * Returns the number of bytes written, -1 if lack of space, or -2
- *     if the transcoding failed.
- * The value of @inlen after return is the number of octets consumed
- *     if the return value is positive, else unpredictiable.
- * The value of @outlen after return is the number of octets produced.
- */
-typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
-                                          const unsigned char *in, int *inlen);
-
-
-/*
- * Block defining the handlers for non UTF-8 encodings.
- * If iconv is supported, there are two extra fields.
- */
-
-typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
-typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
-struct _xmlCharEncodingHandler {
-    char                       *name;
-    xmlCharEncodingInputFunc   input;
-    xmlCharEncodingOutputFunc  output;
-#ifdef LIBXML_ICONV_ENABLED
-    iconv_t                    iconv_in;
-    iconv_t                    iconv_out;
-#endif /* LIBXML_ICONV_ENABLED */
-};
-
-#ifdef __cplusplus
-}
-#endif
-#include <libxml/tree.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Interfaces for encoding handlers.
- */
-XMLPUBFUN void XMLCALL	
-	xmlInitCharEncodingHandlers	(void);
-XMLPUBFUN void XMLCALL	
-	xmlCleanupCharEncodingHandlers	(void);
-XMLPUBFUN void XMLCALL	
-	xmlRegisterCharEncodingHandler	(xmlCharEncodingHandlerPtr handler);
-XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
-	xmlGetCharEncodingHandler	(xmlCharEncoding enc);
-XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
-	xmlFindCharEncodingHandler	(const char *name);
-XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
-	xmlNewCharEncodingHandler	(const char *name, 
-                          		 xmlCharEncodingInputFunc input,
-                          		 xmlCharEncodingOutputFunc output);
-
-/*
- * Interfaces for encoding names and aliases.
- */
-XMLPUBFUN int XMLCALL	
-	xmlAddEncodingAlias		(const char *name,
-					 const char *alias);
-XMLPUBFUN int XMLCALL	
-	xmlDelEncodingAlias		(const char *alias);
-XMLPUBFUN const char * XMLCALL
-	xmlGetEncodingAlias		(const char *alias);
-XMLPUBFUN void XMLCALL	
-	xmlCleanupEncodingAliases	(void);
-XMLPUBFUN xmlCharEncoding XMLCALL
-	xmlParseCharEncoding		(const char *name);
-XMLPUBFUN const char * XMLCALL
-	xmlGetCharEncodingName		(xmlCharEncoding enc);
-
-/*
- * Interfaces directly used by the parsers.
- */
-XMLPUBFUN xmlCharEncoding XMLCALL
-	xmlDetectCharEncoding		(const unsigned char *in,
-					 int len);
-
-XMLPUBFUN int XMLCALL	
-	xmlCharEncOutFunc		(xmlCharEncodingHandler *handler,
-					 xmlBufferPtr out,
-					 xmlBufferPtr in);
-
-XMLPUBFUN int XMLCALL	
-	xmlCharEncInFunc		(xmlCharEncodingHandler *handler,
-					 xmlBufferPtr out,
-					 xmlBufferPtr in);
-XMLPUBFUN int XMLCALL
-	xmlCharEncFirstLine		(xmlCharEncodingHandler *handler,
-					 xmlBufferPtr out,
-					 xmlBufferPtr in);
-XMLPUBFUN int XMLCALL	
-	xmlCharEncCloseFunc		(xmlCharEncodingHandler *handler);
-
-/*
- * Export a few useful functions
- */
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL	
-	UTF8Toisolat1			(unsigned char *out,
-					 int *outlen,
-					 const unsigned char *in,
-					 int *inlen);
-#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL	
-	isolat1ToUTF8			(unsigned char *out,
-					 int *outlen,
-					 const unsigned char *in,
-					 int *inlen);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_CHAR_ENCODING_H__ */
diff --git a/interfaces/ext/libxml/entities.h b/interfaces/ext/libxml/entities.h
deleted file mode 100644
index cefb97f..0000000
--- a/interfaces/ext/libxml/entities.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Summary: interface for the XML entities handling
- * Description: this module provides some of the entity API needed
- *              for the parser and applications.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_ENTITIES_H__
-#define __XML_ENTITIES_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The different valid entity types.
- */
-typedef enum {
-    XML_INTERNAL_GENERAL_ENTITY = 1,
-    XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
-    XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
-    XML_INTERNAL_PARAMETER_ENTITY = 4,
-    XML_EXTERNAL_PARAMETER_ENTITY = 5,
-    XML_INTERNAL_PREDEFINED_ENTITY = 6
-} xmlEntityType;
-
-/*
- * An unit of storage for an entity, contains the string, the value
- * and the linkind data needed for the linking in the hash table.
- */
-
-struct _xmlEntity {
-    void           *_private;	        /* application data */
-    xmlElementType          type;       /* XML_ENTITY_DECL, must be second ! */
-    const xmlChar          *name;	/* Entity name */
-    struct _xmlNode    *children;	/* First child link */
-    struct _xmlNode        *last;	/* Last child link */
-    struct _xmlDtd       *parent;	/* -> DTD */
-    struct _xmlNode        *next;	/* next sibling link  */
-    struct _xmlNode        *prev;	/* previous sibling link  */
-    struct _xmlDoc          *doc;       /* the containing document */
-
-    xmlChar                *orig;	/* content without ref substitution */
-    xmlChar             *content;	/* content or ndata if unparsed */
-    int                   length;	/* the content length */
-    xmlEntityType          etype;	/* The entity type */
-    const xmlChar    *ExternalID;	/* External identifier for PUBLIC */
-    const xmlChar      *SystemID;	/* URI for a SYSTEM or PUBLIC Entity */
-
-    struct _xmlEntity     *nexte;	/* unused */
-    const xmlChar           *URI;	/* the full URI as computed */
-    int                    owner;	/* does the entity own the childrens */
-    int			 checked;	/* was the entity content checked */
-					/* this is also used to count entites
-					 * references done from that entity */
-};
-
-/*
- * All entities are stored in an hash table.
- * There is 2 separate hash tables for global and parameter entities.
- */
-
-typedef struct _xmlHashTable xmlEntitiesTable;
-typedef xmlEntitiesTable *xmlEntitiesTablePtr;
-
-/*
- * External functions:
- */
-
-#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN void XMLCALL
-		xmlInitializePredefinedEntities	(void);
-#endif /* LIBXML_LEGACY_ENABLED */
-
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlNewEntity		(xmlDocPtr doc,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID,
-						 const xmlChar *content);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlAddDocEntity		(xmlDocPtr doc,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID,
-						 const xmlChar *content);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlAddDtdEntity		(xmlDocPtr doc,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID,
-						 const xmlChar *content);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlGetPredefinedEntity	(const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlGetDocEntity		(xmlDocPtr doc,
-						 const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlGetDtdEntity		(xmlDocPtr doc,
-						 const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
-			xmlGetParameterEntity	(xmlDocPtr doc,
-						 const xmlChar *name);
-#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN const xmlChar * XMLCALL
-			xmlEncodeEntities	(xmlDocPtr doc,
-						 const xmlChar *input);
-#endif /* LIBXML_LEGACY_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
-			xmlEncodeEntitiesReentrant(xmlDocPtr doc,
-						 const xmlChar *input);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlEncodeSpecialChars	(xmlDocPtr doc,
-						 const xmlChar *input);
-XMLPUBFUN xmlEntitiesTablePtr XMLCALL
-			xmlCreateEntitiesTable	(void);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlEntitiesTablePtr XMLCALL
-			xmlCopyEntitiesTable	(xmlEntitiesTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
-			xmlFreeEntitiesTable	(xmlEntitiesTablePtr table);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
-			xmlDumpEntitiesTable	(xmlBufferPtr buf,
-						 xmlEntitiesTablePtr table);
-XMLPUBFUN void XMLCALL
-			xmlDumpEntityDecl	(xmlBufferPtr buf,
-						 xmlEntityPtr ent);
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN void XMLCALL
-			xmlCleanupPredefinedEntities(void);
-#endif /* LIBXML_LEGACY_ENABLED */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-# endif /* __XML_ENTITIES_H__ */
diff --git a/interfaces/ext/libxml/globals.h b/interfaces/ext/libxml/globals.h
deleted file mode 100644
index 57e25fa..0000000
--- a/interfaces/ext/libxml/globals.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Summary: interface for all global variables of the library
- * Description: all the global variables and thread handling for
- *              those variables is handled by this module.
- *
- * The bottom of this file is automatically generated by build_glob.py
- * based on the description file global.data
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Gary Pennington <Gary.Pennington at uk.sun.com>, Daniel Veillard
- */
-
-#ifndef __XML_GLOBALS_H
-#define __XML_GLOBALS_H
-
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-#include <libxml/xmlerror.h>
-#include <libxml/SAX.h>
-#include <libxml/SAX2.h>
-#include <libxml/xmlmemory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-XMLPUBFUN void XMLCALL xmlInitGlobals(void);
-XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
-
-/**
- * xmlParserInputBufferCreateFilenameFunc:
- * @URI: the URI to read from
- * @enc: the requested source encoding
- *
- * Signature for the function doing the lookup for a suitable input method
- * corresponding to an URI.
- *
- * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
- *         method was found.
- */
-typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
-
-/**
- * xmlOutputBufferCreateFilenameFunc:
- * @URI: the URI to write to
- * @enc: the requested target encoding
- *
- * Signature for the function doing the lookup for a suitable output method
- * corresponding to an URI.
- *
- * Returns the new xmlOutputBufferPtr in case of success or NULL if no
- *         method was found.
- */
-typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
-
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
-XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc
-XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
-
-/*
- * Externally global symbols which need to be protected for backwards
- * compatibility support.
- */
-
-#undef	docbDefaultSAXHandler
-#undef	htmlDefaultSAXHandler
-#undef	oldXMLWDcompatibility
-#undef	xmlBufferAllocScheme
-#undef	xmlDefaultBufferSize
-#undef	xmlDefaultSAXHandler
-#undef	xmlDefaultSAXLocator
-#undef	xmlDoValidityCheckingDefaultValue
-#undef	xmlFree
-#undef	xmlGenericError
-#undef	xmlStructuredError
-#undef	xmlGenericErrorContext
-#undef	xmlGetWarningsDefaultValue
-#undef	xmlIndentTreeOutput
-#undef  xmlTreeIndentString
-#undef	xmlKeepBlanksDefaultValue
-#undef	xmlLineNumbersDefaultValue
-#undef	xmlLoadExtDtdDefaultValue
-#undef	xmlMalloc
-#undef	xmlMallocAtomic
-#undef	xmlMemStrdup
-#undef	xmlParserDebugEntities
-#undef	xmlParserVersion
-#undef	xmlPedanticParserDefaultValue
-#undef	xmlRealloc
-#undef	xmlSaveNoEmptyTags
-#undef	xmlSubstituteEntitiesDefaultValue
-#undef  xmlRegisterNodeDefaultValue
-#undef  xmlDeregisterNodeDefaultValue
-#undef  xmlLastError
-#undef  xmlParserInputBufferCreateFilenameValue
-#undef  xmlOutputBufferCreateFilenameValue
-
-/**
- * xmlRegisterNodeFunc:
- * @node: the current node
- *
- * Signature for the registration callback of a created node
- */
-typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
-/**
- * xmlDeregisterNodeFunc:
- * @node: the current node
- *
- * Signature for the deregistration callback of a discarded node
- */
-typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
-
-typedef struct _xmlGlobalState xmlGlobalState;
-typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState
-{
-	const char *xmlParserVersion;
-
-	xmlSAXLocator xmlDefaultSAXLocator;
-	xmlSAXHandlerV1 xmlDefaultSAXHandler;
-	xmlSAXHandlerV1 docbDefaultSAXHandler;
-	xmlSAXHandlerV1 htmlDefaultSAXHandler;
-
-	xmlFreeFunc xmlFree;
-	xmlMallocFunc xmlMalloc;
-	xmlStrdupFunc xmlMemStrdup;
-	xmlReallocFunc xmlRealloc;
-
-	xmlGenericErrorFunc xmlGenericError;
-	xmlStructuredErrorFunc xmlStructuredError;
-	void *xmlGenericErrorContext;
-
-	int oldXMLWDcompatibility;
-
-	xmlBufferAllocationScheme xmlBufferAllocScheme;
-	int xmlDefaultBufferSize;
-
-	int xmlSubstituteEntitiesDefaultValue;
-	int xmlDoValidityCheckingDefaultValue;
-	int xmlGetWarningsDefaultValue;
-	int xmlKeepBlanksDefaultValue;
-	int xmlLineNumbersDefaultValue;
-	int xmlLoadExtDtdDefaultValue;
-	int xmlParserDebugEntities;
-	int xmlPedanticParserDefaultValue;
-
-	int xmlSaveNoEmptyTags;
-	int xmlIndentTreeOutput;
-	const char *xmlTreeIndentString;
-
-	xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
-	xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
-
-	xmlMallocFunc xmlMallocAtomic;
-	xmlError xmlLastError;
-
-	xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
-	xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
-};
-
-#ifdef __cplusplus
-}
-#endif
-#include <libxml/threads.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-XMLPUBFUN void XMLCALL	xmlInitializeGlobalState(xmlGlobalStatePtr gs);
-
-XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler);
-
-XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler);
-
-XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func);
-XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
-XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
-XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
-
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
-	xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
-	xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
-
-/** DOC_DISABLE */
-/*
- * In general the memory allocation entry points are not kept
- * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED
- *    - xmlMalloc
- *    - xmlMallocAtomic
- *    - xmlRealloc
- *    - xmlMemStrdup
- *    - xmlFree
- */
-
-#ifdef LIBXML_THREAD_ALLOC_ENABLED
-#ifdef LIBXML_THREAD_ENABLED
-XMLPUBFUN  xmlMallocFunc * XMLCALL __xmlMalloc(void);
-#define xmlMalloc \
-(*(__xmlMalloc()))
-#else
-XMLPUBVAR xmlMallocFunc xmlMalloc;
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-XMLPUBFUN  xmlMallocFunc * XMLCALL __xmlMallocAtomic(void);
-#define xmlMallocAtomic \
-(*(__xmlMallocAtomic()))
-#else
-XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-XMLPUBFUN  xmlReallocFunc * XMLCALL __xmlRealloc(void);
-#define xmlRealloc \
-(*(__xmlRealloc()))
-#else
-XMLPUBVAR xmlReallocFunc xmlRealloc;
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-XMLPUBFUN  xmlFreeFunc * XMLCALL __xmlFree(void);
-#define xmlFree \
-(*(__xmlFree()))
-#else
-XMLPUBVAR xmlFreeFunc xmlFree;
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-XMLPUBFUN  xmlStrdupFunc * XMLCALL __xmlMemStrdup(void);
-#define xmlMemStrdup \
-(*(__xmlMemStrdup()))
-#else
-XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
-#endif
-
-#else /* !LIBXML_THREAD_ALLOC_ENABLED */
-XMLPUBVAR xmlMallocFunc xmlMalloc;
-XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
-XMLPUBVAR xmlReallocFunc xmlRealloc;
-XMLPUBVAR xmlFreeFunc xmlFree;
-XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
-#endif /* LIBXML_THREAD_ALLOC_ENABLED */
-
-#ifdef LIBXML_DOCB_ENABLED
-XMLPUBFUN  xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define docbDefaultSAXHandler \
-(*(__docbDefaultSAXHandler()))
-#else
-XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler;
-#endif
-#endif
-
-#ifdef LIBXML_HTML_ENABLED
-XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define htmlDefaultSAXHandler \
-(*(__htmlDefaultSAXHandler()))
-#else
-XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
-#endif
-#endif
-
-XMLPUBFUN xmlError * XMLCALL __xmlLastError(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlLastError \
-(*(__xmlLastError()))
-#else
-XMLPUBVAR xmlError xmlLastError;
-#endif
-
-/*
- * Everything starting from the line below is
- * Automatically generated by build_glob.py.
- * Do not modify the previous line.
- */
-
-
-XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define oldXMLWDcompatibility \
-(*(__oldXMLWDcompatibility()))
-#else
-XMLPUBVAR int oldXMLWDcompatibility;
-#endif
-
-XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlBufferAllocScheme \
-(*(__xmlBufferAllocScheme()))
-#else
-XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
-#endif
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
-
-XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlDefaultBufferSize \
-(*(__xmlDefaultBufferSize()))
-#else
-XMLPUBVAR int xmlDefaultBufferSize;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
-
-XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlDefaultSAXHandler \
-(*(__xmlDefaultSAXHandler()))
-#else
-XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
-#endif
-
-XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlDefaultSAXLocator \
-(*(__xmlDefaultSAXLocator()))
-#else
-XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
-#endif
-
-XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlDoValidityCheckingDefaultValue \
-(*(__xmlDoValidityCheckingDefaultValue()))
-#else
-XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v);
-
-XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlGenericError \
-(*(__xmlGenericError()))
-#else
-XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
-#endif
-
-XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlStructuredError \
-(*(__xmlStructuredError()))
-#else
-XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
-#endif
-
-XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlGenericErrorContext \
-(*(__xmlGenericErrorContext()))
-#else
-XMLPUBVAR void * xmlGenericErrorContext;
-#endif
-
-XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlGetWarningsDefaultValue \
-(*(__xmlGetWarningsDefaultValue()))
-#else
-XMLPUBVAR int xmlGetWarningsDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v);
-
-XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlIndentTreeOutput \
-(*(__xmlIndentTreeOutput()))
-#else
-XMLPUBVAR int xmlIndentTreeOutput;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
-
-XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlTreeIndentString \
-(*(__xmlTreeIndentString()))
-#else
-XMLPUBVAR const char * xmlTreeIndentString;
-#endif
-XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v);
-
-XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlKeepBlanksDefaultValue \
-(*(__xmlKeepBlanksDefaultValue()))
-#else
-XMLPUBVAR int xmlKeepBlanksDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
-
-XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlLineNumbersDefaultValue \
-(*(__xmlLineNumbersDefaultValue()))
-#else
-XMLPUBVAR int xmlLineNumbersDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
-
-XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlLoadExtDtdDefaultValue \
-(*(__xmlLoadExtDtdDefaultValue()))
-#else
-XMLPUBVAR int xmlLoadExtDtdDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v);
-
-XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlParserDebugEntities \
-(*(__xmlParserDebugEntities()))
-#else
-XMLPUBVAR int xmlParserDebugEntities;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
-
-XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlParserVersion \
-(*(__xmlParserVersion()))
-#else
-XMLPUBVAR const char * xmlParserVersion;
-#endif
-
-XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlPedanticParserDefaultValue \
-(*(__xmlPedanticParserDefaultValue()))
-#else
-XMLPUBVAR int xmlPedanticParserDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
-
-XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlSaveNoEmptyTags \
-(*(__xmlSaveNoEmptyTags()))
-#else
-XMLPUBVAR int xmlSaveNoEmptyTags;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v);
-
-XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlSubstituteEntitiesDefaultValue \
-(*(__xmlSubstituteEntitiesDefaultValue()))
-#else
-XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
-#endif
-XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
-
-XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlRegisterNodeDefaultValue \
-(*(__xmlRegisterNodeDefaultValue()))
-#else
-XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
-#endif
-
-XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlDeregisterNodeDefaultValue \
-(*(__xmlDeregisterNodeDefaultValue()))
-#else
-XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
-#endif
-
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlParserInputBufferCreateFilenameValue \
-(*(__xmlParserInputBufferCreateFilenameValue()))
-#else
-XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
-#endif
-
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
-#ifdef LIBXML_THREAD_ENABLED
-#define xmlOutputBufferCreateFilenameValue \
-(*(__xmlOutputBufferCreateFilenameValue()))
-#else
-XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_GLOBALS_H */
diff --git a/interfaces/ext/libxml/hash.h b/interfaces/ext/libxml/hash.h
deleted file mode 100644
index 7fe4be7..0000000
--- a/interfaces/ext/libxml/hash.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Summary: Chained hash tables
- * Description: This module implements the hash table support used in 
- * 		various places in the library.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Bjorn Reese <bjorn.reese at systematic.dk>
- */
-
-#ifndef __XML_HASH_H__
-#define __XML_HASH_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The hash table.
- */
-typedef struct _xmlHashTable xmlHashTable;
-typedef xmlHashTable *xmlHashTablePtr;
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-#include <libxml/dict.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Recent version of gcc produce a warning when a function pointer is assigned
- * to an object pointer, or vice versa.  The following macro is a dirty hack
- * to allow suppression of the warning.  If your architecture has function
- * pointers which are a different size than a void pointer, there may be some
- * serious trouble within the library.
- */
-/**
- * XML_CAST_FPTR:
- * @fptr:  pointer to a function
- *
- * Macro to do a casting from an object pointer to a
- * function pointer without encountering a warning from
- * gcc
- *
- * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
- * This macro violated ISO C aliasing rules (gcc4 on s390 broke)
- * so it is disabled now
- */
-
-#define XML_CAST_FPTR(fptr) fptr
-
-
-/*
- * function types:
- */
-/**
- * xmlHashDeallocator:
- * @payload:  the data in the hash
- * @name:  the name associated
- *
- * Callback to free data from a hash.
- */
-typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
-/**
- * xmlHashCopier:
- * @payload:  the data in the hash
- * @name:  the name associated
- *
- * Callback to copy data from a hash.
- *
- * Returns a copy of the data or NULL in case of error.
- */
-typedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
-/**
- * xmlHashScanner:
- * @payload:  the data in the hash
- * @data:  extra scannner data
- * @name:  the name associated
- *
- * Callback when scanning data in a hash with the simple scanner.
- */
-typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
-/**
- * xmlHashScannerFull:
- * @payload:  the data in the hash
- * @data:  extra scannner data
- * @name:  the name associated
- * @name2:  the second name associated
- * @name3:  the third name associated
- *
- * Callback when scanning data in a hash with the full scanner.
- */
-typedef void (*xmlHashScannerFull)(void *payload, void *data,
-				   const xmlChar *name, const xmlChar *name2,
-				   const xmlChar *name3);
-
-/*
- * Constructor and destructor.
- */
-XMLPUBFUN xmlHashTablePtr XMLCALL
-			xmlHashCreate	(int size);
-XMLPUBFUN xmlHashTablePtr XMLCALL
-			xmlHashCreateDict(int size,
-					 xmlDictPtr dict);
-XMLPUBFUN void XMLCALL			
-			xmlHashFree	(xmlHashTablePtr table,
-					 xmlHashDeallocator f);
-
-/*
- * Add a new entry to the hash table.
- */
-XMLPUBFUN int XMLCALL			
-			xmlHashAddEntry	(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         void *userdata);
-XMLPUBFUN int XMLCALL			
-			xmlHashUpdateEntry(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         void *userdata,
-					 xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL		    
-			xmlHashAddEntry2(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         const xmlChar *name2,
-		                         void *userdata);
-XMLPUBFUN int XMLCALL			
-			xmlHashUpdateEntry2(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         const xmlChar *name2,
-		                         void *userdata,
-					 xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL			
-			xmlHashAddEntry3(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         const xmlChar *name2,
-		                         const xmlChar *name3,
-		                         void *userdata);
-XMLPUBFUN int XMLCALL			
-			xmlHashUpdateEntry3(xmlHashTablePtr table,
-		                         const xmlChar *name,
-		                         const xmlChar *name2,
-		                         const xmlChar *name3,
-		                         void *userdata,
-					 xmlHashDeallocator f);
-
-/*
- * Remove an entry from the hash table.
- */
-XMLPUBFUN int XMLCALL     
-			xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
-                           xmlHashDeallocator f);
-XMLPUBFUN int XMLCALL     
-			xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
-                            const xmlChar *name2, xmlHashDeallocator f);
-XMLPUBFUN int  XMLCALL    
-			xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
-                            const xmlChar *name2, const xmlChar *name3,
-                            xmlHashDeallocator f);
-
-/*
- * Retrieve the userdata.
- */
-XMLPUBFUN void * XMLCALL			
-			xmlHashLookup	(xmlHashTablePtr table,
-					 const xmlChar *name);
-XMLPUBFUN void * XMLCALL			
-			xmlHashLookup2	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *name2);
-XMLPUBFUN void * XMLCALL			
-			xmlHashLookup3	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *name2,
-					 const xmlChar *name3);
-XMLPUBFUN void * XMLCALL			
-			xmlHashQLookup	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *prefix);
-XMLPUBFUN void * XMLCALL			
-			xmlHashQLookup2	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *prefix,
-					 const xmlChar *name2,
-					 const xmlChar *prefix2);
-XMLPUBFUN void * XMLCALL			
-			xmlHashQLookup3	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *prefix,
-					 const xmlChar *name2,
-					 const xmlChar *prefix2,
-					 const xmlChar *name3,
-					 const xmlChar *prefix3);
-
-/*
- * Helpers.
- */
-XMLPUBFUN xmlHashTablePtr XMLCALL		
-			xmlHashCopy	(xmlHashTablePtr table,
-					 xmlHashCopier f);
-XMLPUBFUN int XMLCALL			
-			xmlHashSize	(xmlHashTablePtr table);
-XMLPUBFUN void XMLCALL			
-			xmlHashScan	(xmlHashTablePtr table,
-					 xmlHashScanner f,
-					 void *data);
-XMLPUBFUN void XMLCALL			
-			xmlHashScan3	(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *name2,
-					 const xmlChar *name3,
-					 xmlHashScanner f,
-					 void *data);
-XMLPUBFUN void XMLCALL			
-			xmlHashScanFull	(xmlHashTablePtr table,
-					 xmlHashScannerFull f,
-					 void *data);
-XMLPUBFUN void XMLCALL			
-			xmlHashScanFull3(xmlHashTablePtr table,
-					 const xmlChar *name,
-					 const xmlChar *name2,
-					 const xmlChar *name3,
-					 xmlHashScannerFull f,
-					 void *data);
-#ifdef __cplusplus
-}
-#endif
-#endif /* ! __XML_HASH_H__ */
diff --git a/interfaces/ext/libxml/list.h b/interfaces/ext/libxml/list.h
deleted file mode 100644
index 1d83482..0000000
--- a/interfaces/ext/libxml/list.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Summary: lists interfaces
- * Description: this module implement the list support used in 
- * various place in the library.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Gary Pennington <Gary.Pennington at uk.sun.com>
- */
-
-#ifndef __XML_LINK_INCLUDE__
-#define __XML_LINK_INCLUDE__
-
-#include <libxml/xmlversion.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _xmlLink xmlLink;
-typedef xmlLink *xmlLinkPtr;
-
-typedef struct _xmlList xmlList;
-typedef xmlList *xmlListPtr;
-
-/**
- * xmlListDeallocator:
- * @lk:  the data to deallocate
- *
- * Callback function used to free data from a list.
- */
-typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
-/**
- * xmlListDataCompare:
- * @data0: the first data
- * @data1: the second data
- *
- * Callback function used to compare 2 data.
- *
- * Returns 0 is equality, -1 or 1 otherwise depending on the ordering.
- */
-typedef int  (*xmlListDataCompare) (const void *data0, const void *data1);
-/**
- * xmlListWalker:
- * @data: the data found in the list
- * @user: extra user provided data to the walker
- *
- * Callback function used when walking a list with xmlListWalk().
- *
- * Returns 0 to stop walking the list, 1 otherwise.
- */
-typedef int (*xmlListWalker) (const void *data, const void *user);
-
-/* Creation/Deletion */
-XMLPUBFUN xmlListPtr XMLCALL
-		xmlListCreate		(xmlListDeallocator deallocator,
-	                                 xmlListDataCompare compare);
-XMLPUBFUN void XMLCALL		
-		xmlListDelete		(xmlListPtr l);
-
-/* Basic Operators */
-XMLPUBFUN void * XMLCALL		
-		xmlListSearch		(xmlListPtr l,
-					 void *data);
-XMLPUBFUN void * XMLCALL		
-		xmlListReverseSearch	(xmlListPtr l,
-					 void *data);
-XMLPUBFUN int XMLCALL		
-		xmlListInsert		(xmlListPtr l,
-					 void *data) ;
-XMLPUBFUN int XMLCALL		
-		xmlListAppend		(xmlListPtr l,
-					 void *data) ;
-XMLPUBFUN int XMLCALL		
-		xmlListRemoveFirst	(xmlListPtr l,
-					 void *data);
-XMLPUBFUN int XMLCALL		
-		xmlListRemoveLast	(xmlListPtr l,
-					 void *data);
-XMLPUBFUN int XMLCALL		
-		xmlListRemoveAll	(xmlListPtr l,
-					 void *data);
-XMLPUBFUN void XMLCALL		
-		xmlListClear		(xmlListPtr l);
-XMLPUBFUN int XMLCALL		
-		xmlListEmpty		(xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL	
-		xmlListFront		(xmlListPtr l);
-XMLPUBFUN xmlLinkPtr XMLCALL	
-		xmlListEnd		(xmlListPtr l);
-XMLPUBFUN int XMLCALL		
-		xmlListSize		(xmlListPtr l);
-
-XMLPUBFUN void XMLCALL		
-		xmlListPopFront		(xmlListPtr l);
-XMLPUBFUN void XMLCALL		
-		xmlListPopBack		(xmlListPtr l);
-XMLPUBFUN int XMLCALL		
-		xmlListPushFront	(xmlListPtr l,
-					 void *data);
-XMLPUBFUN int XMLCALL		
-		xmlListPushBack		(xmlListPtr l,
-					 void *data);
-
-/* Advanced Operators */
-XMLPUBFUN void XMLCALL		
-		xmlListReverse		(xmlListPtr l);
-XMLPUBFUN void XMLCALL		
-		xmlListSort		(xmlListPtr l);
-XMLPUBFUN void XMLCALL		
-		xmlListWalk		(xmlListPtr l,
-					 xmlListWalker walker,
-					 const void *user);
-XMLPUBFUN void XMLCALL		
-		xmlListReverseWalk	(xmlListPtr l,
-					 xmlListWalker walker,
-					 const void *user);
-XMLPUBFUN void XMLCALL		
-		xmlListMerge		(xmlListPtr l1,
-					 xmlListPtr l2);
-XMLPUBFUN xmlListPtr XMLCALL	
-		xmlListDup		(const xmlListPtr old);
-XMLPUBFUN int XMLCALL		
-		xmlListCopy		(xmlListPtr cur,
-					 const xmlListPtr old);
-/* Link operators */
-XMLPUBFUN void * XMLCALL          
-		xmlLinkGetData          (xmlLinkPtr lk);
-
-/* xmlListUnique() */
-/* xmlListSwap */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_LINK_INCLUDE__ */
diff --git a/interfaces/ext/libxml/nanoftp.h b/interfaces/ext/libxml/nanoftp.h
deleted file mode 100644
index e3c28a0..0000000
--- a/interfaces/ext/libxml/nanoftp.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Summary: minimal FTP implementation
- * Description: minimal FTP implementation allowing to fetch resources
- *              like external subset.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
- 
-#ifndef __NANO_FTP_H__
-#define __NANO_FTP_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_FTP_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * ftpListCallback: 
- * @userData:  user provided data for the callback
- * @filename:  the file name (including "->" when links are shown)
- * @attrib:  the attribute string
- * @owner:  the owner string
- * @group:  the group string
- * @size:  the file size
- * @links:  the link count
- * @year:  the year
- * @month:  the month
- * @day:  the day
- * @hour:  the hour
- * @minute:  the minute
- *
- * A callback for the xmlNanoFTPList command.
- * Note that only one of year and day:minute are specified.
- */
-typedef void (*ftpListCallback) (void *userData,
-	                         const char *filename, const char *attrib,
-	                         const char *owner, const char *group,
-				 unsigned long size, int links, int year,
-				 const char *month, int day, int hour,
-				 int minute);
-/**
- * ftpDataCallback: 
- * @userData: the user provided context
- * @data: the data received
- * @len: its size in bytes
- *
- * A callback for the xmlNanoFTPGet command.
- */
-typedef void (*ftpDataCallback) (void *userData,
-				 const char *data,
-				 int len);
-
-/*
- * Init
- */
-XMLPUBFUN void XMLCALL
-	xmlNanoFTPInit		(void);
-XMLPUBFUN void XMLCALL	
-	xmlNanoFTPCleanup	(void);
-
-/*
- * Creating/freeing contexts.
- */
-XMLPUBFUN void * XMLCALL	
-	xmlNanoFTPNewCtxt	(const char *URL);
-XMLPUBFUN void XMLCALL	
-	xmlNanoFTPFreeCtxt	(void * ctx);
-XMLPUBFUN void * XMLCALL 	
-	xmlNanoFTPConnectTo	(const char *server,
-				 int port);
-/*
- * Opening/closing session connections.
- */
-XMLPUBFUN void * XMLCALL 	
-	xmlNanoFTPOpen		(const char *URL);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPConnect	(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPClose		(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPQuit		(void *ctx);
-XMLPUBFUN void XMLCALL	
-	xmlNanoFTPScanProxy	(const char *URL);
-XMLPUBFUN void XMLCALL	
-	xmlNanoFTPProxy		(const char *host,
-				 int port,
-				 const char *user,
-				 const char *passwd,
-				 int type);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPUpdateURL	(void *ctx,
-				 const char *URL);
-
-/*
- * Rather internal commands.
- */
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPGetResponse	(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPCheckResponse	(void *ctx);
-
-/*
- * CD/DIR/GET handlers.
- */
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPCwd		(void *ctx,
-				 const char *directory);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPDele		(void *ctx,
-				 const char *file);
-
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPGetConnection	(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPCloseConnection(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPList		(void *ctx,
-				 ftpListCallback callback,
-				 void *userData,
-				 const char *filename);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPGetSocket	(void *ctx,
-				 const char *filename);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPGet		(void *ctx,
-				 ftpDataCallback callback,
-				 void *userData,
-				 const char *filename);
-XMLPUBFUN int XMLCALL	
-	xmlNanoFTPRead		(void *ctx,
-				 void *dest,
-				 int len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* LIBXML_FTP_ENABLED */
-#endif /* __NANO_FTP_H__ */
diff --git a/interfaces/ext/libxml/nanohttp.h b/interfaces/ext/libxml/nanohttp.h
deleted file mode 100644
index 1d8ac24..0000000
--- a/interfaces/ext/libxml/nanohttp.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Summary: minimal HTTP implementation
- * Description: minimal HTTP implementation allowing to fetch resources
- *              like external subset.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
- 
-#ifndef __NANO_HTTP_H__
-#define __NANO_HTTP_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_HTTP_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-XMLPUBFUN void XMLCALL
-	xmlNanoHTTPInit		(void);
-XMLPUBFUN void XMLCALL	
-	xmlNanoHTTPCleanup	(void);
-XMLPUBFUN void XMLCALL	
-	xmlNanoHTTPScanProxy	(const char *URL);
-XMLPUBFUN int XMLCALL	
-	xmlNanoHTTPFetch	(const char *URL,
-				 const char *filename,
-				 char **contentType);
-XMLPUBFUN void * XMLCALL	
-	xmlNanoHTTPMethod	(const char *URL,
-				 const char *method,
-				 const char *input,
-				 char **contentType,
-				 const char *headers,
-				 int   ilen);
-XMLPUBFUN void * XMLCALL	
-	xmlNanoHTTPMethodRedir	(const char *URL,
-				 const char *method,
-				 const char *input,
-				 char **contentType,
-				 char **redir,
-				 const char *headers,
-				 int   ilen);
-XMLPUBFUN void * XMLCALL	
-	xmlNanoHTTPOpen		(const char *URL,
-				 char **contentType);
-XMLPUBFUN void * XMLCALL	
-	xmlNanoHTTPOpenRedir	(const char *URL,
-				 char **contentType,
-				 char **redir);
-XMLPUBFUN int XMLCALL	
-	xmlNanoHTTPReturnCode	(void *ctx);
-XMLPUBFUN const char * XMLCALL 
-	xmlNanoHTTPAuthHeader	(void *ctx);
-XMLPUBFUN const char * XMLCALL
-	xmlNanoHTTPRedir	(void *ctx);
-XMLPUBFUN int XMLCALL
-	xmlNanoHTTPContentLength( void * ctx );
-XMLPUBFUN const char * XMLCALL
-	xmlNanoHTTPEncoding	(void *ctx);
-XMLPUBFUN const char * XMLCALL
-	xmlNanoHTTPMimeType	(void *ctx);
-XMLPUBFUN int XMLCALL	
-	xmlNanoHTTPRead		(void *ctx,
-				 void *dest,
-				 int len);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN int XMLCALL	
-	xmlNanoHTTPSave		(void *ctxt,
-				 const char *filename);
-#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN void XMLCALL	
-	xmlNanoHTTPClose	(void *ctx);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_HTTP_ENABLED */
-#endif /* __NANO_HTTP_H__ */
diff --git a/interfaces/ext/libxml/parser.h b/interfaces/ext/libxml/parser.h
deleted file mode 100644
index 567addb..0000000
--- a/interfaces/ext/libxml/parser.h
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*
- * Summary: the core parser module
- * Description: Interfaces, constants and types related to the XML parser
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_PARSER_H__
-#define __XML_PARSER_H__
-
-#include <stdarg.h>
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/dict.h>
-#include <libxml/hash.h>
-#include <libxml/valid.h>
-#include <libxml/entities.h>
-#include <libxml/xmlerror.h>
-#include <libxml/xmlstring.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * XML_DEFAULT_VERSION:
- *
- * The default version of XML used: 1.0
- */
-#define XML_DEFAULT_VERSION	"1.0"
-
-/**
- * xmlParserInput:
- *
- * An xmlParserInput is an input flow for the XML processor.
- * Each entity parsed is associated an xmlParserInput (except the
- * few predefined ones). This is the case both for internal entities
- * - in which case the flow is already completely in memory - or
- * external entities - in which case we use the buf structure for
- * progressive reading and I18N conversions to the internal UTF-8 format.
- */
-
-/**
- * xmlParserInputDeallocate:
- * @str:  the string to deallocate
- *
- * Callback for freeing some parser input allocations.
- */
-typedef void (* xmlParserInputDeallocate)(xmlChar *str);
-
-struct _xmlParserInput {
-    /* Input buffer */
-    xmlParserInputBufferPtr buf;      /* UTF-8 encoded buffer */
-
-    const char *filename;             /* The file analyzed, if any */
-    const char *directory;            /* the directory/base of the file */
-    const xmlChar *base;              /* Base of the array to parse */
-    const xmlChar *cur;               /* Current char being parsed */
-    const xmlChar *end;               /* end of the array to parse */
-    int length;                       /* length if known */
-    int line;                         /* Current line */
-    int col;                          /* Current column */
-    /*
-     * NOTE: consumed is only tested for equality in the parser code,
-     *       so even if there is an overflow this should not give troubles
-     *       for parsing very large instances.
-     */
-    unsigned long consumed;           /* How many xmlChars already consumed */
-    xmlParserInputDeallocate free;    /* function to deallocate the base */
-    const xmlChar *encoding;          /* the encoding string for entity */
-    const xmlChar *version;           /* the version string for entity */
-    int standalone;                   /* Was that entity marked standalone */
-    int id;                           /* an unique identifier for the entity */
-};
-
-/**
- * xmlParserNodeInfo:
- *
- * The parser can be asked to collect Node informations, i.e. at what
- * place in the file they were detected. 
- * NOTE: This is off by default and not very well tested.
- */
-typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
-typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
-
-struct _xmlParserNodeInfo {
-  const struct _xmlNode* node;
-  /* Position & line # that text that created the node begins & ends on */
-  unsigned long begin_pos;
-  unsigned long begin_line;
-  unsigned long end_pos;
-  unsigned long end_line;
-};
-
-typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
-typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
-struct _xmlParserNodeInfoSeq {
-  unsigned long maximum;
-  unsigned long length;
-  xmlParserNodeInfo* buffer;
-};
-
-/**
- * xmlParserInputState:
- *
- * The parser is now working also as a state based parser.
- * The recursive one use the state info for entities processing.
- */
-typedef enum {
-    XML_PARSER_EOF = -1,	/* nothing is to be parsed */
-    XML_PARSER_START = 0,	/* nothing has been parsed */
-    XML_PARSER_MISC,		/* Misc* before int subset */
-    XML_PARSER_PI,		/* Within a processing instruction */
-    XML_PARSER_DTD,		/* within some DTD content */
-    XML_PARSER_PROLOG,		/* Misc* after internal subset */
-    XML_PARSER_COMMENT,		/* within a comment */
-    XML_PARSER_START_TAG,	/* within a start tag */
-    XML_PARSER_CONTENT,		/* within the content */
-    XML_PARSER_CDATA_SECTION,	/* within a CDATA section */
-    XML_PARSER_END_TAG,		/* within a closing tag */
-    XML_PARSER_ENTITY_DECL,	/* within an entity declaration */
-    XML_PARSER_ENTITY_VALUE,	/* within an entity value in a decl */
-    XML_PARSER_ATTRIBUTE_VALUE,	/* within an attribute value */
-    XML_PARSER_SYSTEM_LITERAL,	/* within a SYSTEM value */
-    XML_PARSER_EPILOG, 		/* the Misc* after the last end tag */
-    XML_PARSER_IGNORE,		/* within an IGNORED section */
-    XML_PARSER_PUBLIC_LITERAL 	/* within a PUBLIC value */
-} xmlParserInputState;
-
-/**
- * XML_DETECT_IDS:
- *
- * Bit in the loadsubset context field to tell to do ID/REFs lookups.
- * Use it to initialize xmlLoadExtDtdDefaultValue.
- */
-#define XML_DETECT_IDS		2
-
-/**
- * XML_COMPLETE_ATTRS:
- *
- * Bit in the loadsubset context field to tell to do complete the
- * elements attributes lists with the ones defaulted from the DTDs.
- * Use it to initialize xmlLoadExtDtdDefaultValue.
- */
-#define XML_COMPLETE_ATTRS	4
-
-/**
- * XML_SKIP_IDS:
- *
- * Bit in the loadsubset context field to tell to not do ID/REFs registration.
- * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
- */
-#define XML_SKIP_IDS		8
-
-/**
- * xmlParserMode:
- *
- * A parser can operate in various modes
- */
-typedef enum {
-    XML_PARSE_UNKNOWN = 0,
-    XML_PARSE_DOM = 1,
-    XML_PARSE_SAX = 2,
-    XML_PARSE_PUSH_DOM = 3,
-    XML_PARSE_PUSH_SAX = 4,
-    XML_PARSE_READER = 5
-} xmlParserMode;
-
-/**
- * xmlParserCtxt:
- *
- * The parser context.
- * NOTE This doesn't completely define the parser state, the (current ?)
- *      design of the parser uses recursive function calls since this allow
- *      and easy mapping from the production rules of the specification
- *      to the actual code. The drawback is that the actual function call
- *      also reflect the parser state. However most of the parsing routines
- *      takes as the only argument the parser context pointer, so migrating
- *      to a state based parser for progressive parsing shouldn't be too hard.
- */
-struct _xmlParserCtxt {
-    struct _xmlSAXHandler *sax;       /* The SAX handler */
-    void            *userData;        /* For SAX interface only, used by DOM build */
-    xmlDocPtr           myDoc;        /* the document being built */
-    int            wellFormed;        /* is the document well formed */
-    int       replaceEntities;        /* shall we replace entities ? */
-    const xmlChar    *version;        /* the XML version string */
-    const xmlChar   *encoding;        /* the declared encoding, if any */
-    int            standalone;        /* standalone document */
-    int                  html;        /* an HTML(1)/Docbook(2) document */
-
-    /* Input stream stack */
-    xmlParserInputPtr  input;         /* Current input stream */
-    int                inputNr;       /* Number of current input streams */
-    int                inputMax;      /* Max number of input streams */
-    xmlParserInputPtr *inputTab;      /* stack of inputs */
-
-    /* Node analysis stack only used for DOM building */
-    xmlNodePtr         node;          /* Current parsed Node */
-    int                nodeNr;        /* Depth of the parsing stack */
-    int                nodeMax;       /* Max depth of the parsing stack */
-    xmlNodePtr        *nodeTab;       /* array of nodes */
-
-    int record_info;                  /* Whether node info should be kept */
-    xmlParserNodeInfoSeq node_seq;    /* info about each node parsed */
-
-    int errNo;                        /* error code */
-
-    int     hasExternalSubset;        /* reference and external subset */
-    int             hasPErefs;        /* the internal subset has PE refs */
-    int              external;        /* are we parsing an external entity */
-
-    int                 valid;        /* is the document valid */
-    int              validate;        /* shall we try to validate ? */
-    xmlValidCtxt        vctxt;        /* The validity context */
-
-    xmlParserInputState instate;      /* current type of input */
-    int                 token;        /* next char look-ahead */    
-
-    char           *directory;        /* the data directory */
-
-    /* Node name stack */
-    const xmlChar     *name;          /* Current parsed Node */
-    int                nameNr;        /* Depth of the parsing stack */
-    int                nameMax;       /* Max depth of the parsing stack */
-    const xmlChar *   *nameTab;       /* array of nodes */
-
-    long               nbChars;       /* number of xmlChar processed */
-    long            checkIndex;       /* used by progressive parsing lookup */
-    int             keepBlanks;       /* ugly but ... */
-    int             disableSAX;       /* SAX callbacks are disabled */
-    int               inSubset;       /* Parsing is in int 1/ext 2 subset */
-    const xmlChar *    intSubName;    /* name of subset */
-    xmlChar *          extSubURI;     /* URI of external subset */
-    xmlChar *          extSubSystem;  /* SYSTEM ID of external subset */
-
-    /* xml:space values */
-    int *              space;         /* Should the parser preserve spaces */
-    int                spaceNr;       /* Depth of the parsing stack */
-    int                spaceMax;      /* Max depth of the parsing stack */
-    int *              spaceTab;      /* array of space infos */
-
-    int                depth;         /* to prevent entity substitution loops */
-    xmlParserInputPtr  entity;        /* used to check entities boundaries */
-    int                charset;       /* encoding of the in-memory content
-				         actually an xmlCharEncoding */
-    int                nodelen;       /* Those two fields are there to */
-    int                nodemem;       /* Speed up large node parsing */
-    int                pedantic;      /* signal pedantic warnings */
-    void              *_private;      /* For user data, libxml won't touch it */
-
-    int                loadsubset;    /* should the external subset be loaded */
-    int                linenumbers;   /* set line number in element content */
-    void              *catalogs;      /* document's own catalog */
-    int                recovery;      /* run in recovery mode */
-    int                progressive;   /* is this a progressive parsing */
-    xmlDictPtr         dict;          /* dictionnary for the parser */
-    const xmlChar *   *atts;          /* array for the attributes callbacks */
-    int                maxatts;       /* the size of the array */
-    int                docdict;       /* use strings from dict to build tree */
-
-    /*
-     * pre-interned strings
-     */
-    const xmlChar *str_xml;
-    const xmlChar *str_xmlns;
-    const xmlChar *str_xml_ns;
-
-    /*
-     * Everything below is used only by the new SAX mode
-     */
-    int                sax2;          /* operating in the new SAX mode */
-    int                nsNr;          /* the number of inherited namespaces */
-    int                nsMax;         /* the size of the arrays */
-    const xmlChar *   *nsTab;         /* the array of prefix/namespace name */
-    int               *attallocs;     /* which attribute were allocated */
-    void *            *pushTab;       /* array of data for push */
-    xmlHashTablePtr    attsDefault;   /* defaulted attributes if any */
-    xmlHashTablePtr    attsSpecial;   /* non-CDATA attributes if any */
-    int                nsWellFormed;  /* is the document XML Nanespace okay */
-    int                options;       /* Extra options */
-
-    /*
-     * Those fields are needed only for treaming parsing so far
-     */
-    int               dictNames;    /* Use dictionary names for the tree */
-    int               freeElemsNr;  /* number of freed element nodes */
-    xmlNodePtr        freeElems;    /* List of freed element nodes */
-    int               freeAttrsNr;  /* number of freed attributes nodes */
-    xmlAttrPtr        freeAttrs;    /* List of freed attributes nodes */
-
-    /*
-     * the complete error informations for the last error.
-     */
-    xmlError          lastError;
-    xmlParserMode     parseMode;    /* the parser mode */
-    unsigned long    nbentities;    /* number of entities references */
-    unsigned long  sizeentities;    /* size of parsed entities */
-};
-
-/**
- * xmlSAXLocator:
- *
- * A SAX Locator.
- */
-struct _xmlSAXLocator {
-    const xmlChar *(*getPublicId)(void *ctx);
-    const xmlChar *(*getSystemId)(void *ctx);
-    int (*getLineNumber)(void *ctx);
-    int (*getColumnNumber)(void *ctx);
-};
-
-/**
- * xmlSAXHandler:
- *
- * A SAX handler is bunch of callbacks called by the parser when processing
- * of the input generate data or structure informations.
- */
-
-/**
- * resolveEntitySAXFunc:
- * @ctx:  the user data (XML parser context)
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * Callback:
- * The entity loader, to control the loading of external entities,
- * the application can either:
- *    - override this resolveEntity() callback in the SAX block
- *    - or better use the xmlSetExternalEntityLoader() function to
- *      set up it's own entity resolution routine
- *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
- */
-typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
-				const xmlChar *publicId,
-				const xmlChar *systemId);
-/**
- * internalSubsetSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  the root element name
- * @ExternalID:  the external ID
- * @SystemID:  the SYSTEM ID (e.g. filename or URL)
- *
- * Callback on internal subset declaration.
- */
-typedef void (*internalSubsetSAXFunc) (void *ctx,
-				const xmlChar *name,
-				const xmlChar *ExternalID,
-				const xmlChar *SystemID);
-/**
- * externalSubsetSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  the root element name
- * @ExternalID:  the external ID
- * @SystemID:  the SYSTEM ID (e.g. filename or URL)
- *
- * Callback on external subset declaration.
- */
-typedef void (*externalSubsetSAXFunc) (void *ctx,
-				const xmlChar *name,
-				const xmlChar *ExternalID,
-				const xmlChar *SystemID);
-/**
- * getEntitySAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name: The entity name
- *
- * Get an entity by name.
- *
- * Returns the xmlEntityPtr if found.
- */
-typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
-				const xmlChar *name);
-/**
- * getParameterEntitySAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name: The entity name
- *
- * Get a parameter entity by name.
- *
- * Returns the xmlEntityPtr if found.
- */
-typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
-				const xmlChar *name);
-/**
- * entityDeclSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  the entity name 
- * @type:  the entity type 
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @content: the entity value (without processing).
- *
- * An entity definition has been parsed.
- */
-typedef void (*entityDeclSAXFunc) (void *ctx,
-				const xmlChar *name,
-				int type,
-				const xmlChar *publicId,
-				const xmlChar *systemId,
-				xmlChar *content);
-/**
- * notationDeclSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name: The name of the notation
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * What to do when a notation declaration has been parsed.
- */
-typedef void (*notationDeclSAXFunc)(void *ctx,
-				const xmlChar *name,
-				const xmlChar *publicId,
-				const xmlChar *systemId);
-/**
- * attributeDeclSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @elem:  the name of the element
- * @fullname:  the attribute name 
- * @type:  the attribute type 
- * @def:  the type of default value
- * @defaultValue: the attribute default value
- * @tree:  the tree of enumerated value set
- *
- * An attribute definition has been parsed.
- */
-typedef void (*attributeDeclSAXFunc)(void *ctx,
-				const xmlChar *elem,
-				const xmlChar *fullname,
-				int type,
-				int def,
-				const xmlChar *defaultValue,
-				xmlEnumerationPtr tree);
-/**
- * elementDeclSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  the element name 
- * @type:  the element type 
- * @content: the element value tree
- *
- * An element definition has been parsed.
- */
-typedef void (*elementDeclSAXFunc)(void *ctx,
-				const xmlChar *name,
-				int type,
-				xmlElementContentPtr content);
-/**
- * unparsedEntityDeclSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name: The name of the entity
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @notationName: the name of the notation
- *
- * What to do when an unparsed entity declaration is parsed.
- */
-typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
-				const xmlChar *name,
-				const xmlChar *publicId,
-				const xmlChar *systemId,
-				const xmlChar *notationName);
-/**
- * setDocumentLocatorSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @loc: A SAX Locator
- *
- * Receive the document locator at startup, actually xmlDefaultSAXLocator.
- * Everything is available on the context, so this is useless in our case.
- */
-typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
-				xmlSAXLocatorPtr loc);
-/**
- * startDocumentSAXFunc:
- * @ctx:  the user data (XML parser context)
- *
- * Called when the document start being processed.
- */
-typedef void (*startDocumentSAXFunc) (void *ctx);
-/**
- * endDocumentSAXFunc:
- * @ctx:  the user data (XML parser context)
- *
- * Called when the document end has been detected.
- */
-typedef void (*endDocumentSAXFunc) (void *ctx);
-/**
- * startElementSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  The element name, including namespace prefix
- * @atts:  An array of name/value attributes pairs, NULL terminated
- *
- * Called when an opening tag has been processed.
- */
-typedef void (*startElementSAXFunc) (void *ctx,
-				const xmlChar *name,
-				const xmlChar **atts);
-/**
- * endElementSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  The element name
- *
- * Called when the end of an element has been detected.
- */
-typedef void (*endElementSAXFunc) (void *ctx,
-				const xmlChar *name);
-/**
- * attributeSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  The attribute name, including namespace prefix
- * @value:  The attribute value
- *
- * Handle an attribute that has been read by the parser.
- * The default handling is to convert the attribute into an
- * DOM subtree and past it in a new xmlAttr element added to
- * the element.
- */
-typedef void (*attributeSAXFunc) (void *ctx,
-				const xmlChar *name,
-				const xmlChar *value);
-/**
- * referenceSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @name:  The entity name
- *
- * Called when an entity reference is detected. 
- */
-typedef void (*referenceSAXFunc) (void *ctx,
-				const xmlChar *name);
-/**
- * charactersSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @ch:  a xmlChar string
- * @len: the number of xmlChar
- *
- * Receiving some chars from the parser.
- */
-typedef void (*charactersSAXFunc) (void *ctx,
-				const xmlChar *ch,
-				int len);
-/**
- * ignorableWhitespaceSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @ch:  a xmlChar string
- * @len: the number of xmlChar
- *
- * Receiving some ignorable whitespaces from the parser.
- * UNUSED: by default the DOM building will use characters.
- */
-typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
-				const xmlChar *ch,
-				int len);
-/**
- * processingInstructionSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @target:  the target name
- * @data: the PI data's
- *
- * A processing instruction has been parsed.
- */
-typedef void (*processingInstructionSAXFunc) (void *ctx,
-				const xmlChar *target,
-				const xmlChar *data);
-/**
- * commentSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @value:  the comment content
- *
- * A comment has been parsed.
- */
-typedef void (*commentSAXFunc) (void *ctx,
-				const xmlChar *value);
-/**
- * cdataBlockSAXFunc:
- * @ctx:  the user data (XML parser context)
- * @value:  The pcdata content
- * @len:  the block length
- *
- * Called when a pcdata block has been parsed.
- */
-typedef void (*cdataBlockSAXFunc) (
-	                        void *ctx,
-				const xmlChar *value,
-				int len);
-/**
- * warningSAXFunc:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- * 
- * Display and format a warning messages, callback.
- */
-typedef void (XMLCDECL *warningSAXFunc) (void *ctx,
-				const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-/**
- * errorSAXFunc:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- * 
- * Display and format an error messages, callback.
- */
-typedef void (XMLCDECL *errorSAXFunc) (void *ctx,
-				const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-/**
- * fatalErrorSAXFunc:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- * 
- * Display and format fatal error messages, callback.
- * Note: so far fatalError() SAX callbacks are not used, error()
- *       get all the callbacks for errors.
- */
-typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx,
-				const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-/**
- * isStandaloneSAXFunc:
- * @ctx:  the user data (XML parser context)
- *
- * Is this document tagged standalone?
- *
- * Returns 1 if true
- */
-typedef int (*isStandaloneSAXFunc) (void *ctx);
-/**
- * hasInternalSubsetSAXFunc:
- * @ctx:  the user data (XML parser context)
- *
- * Does this document has an internal subset.
- *
- * Returns 1 if true
- */
-typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
-
-/**
- * hasExternalSubsetSAXFunc:
- * @ctx:  the user data (XML parser context)
- *
- * Does this document has an external subset?
- *
- * Returns 1 if true
- */
-typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
-
-/************************************************************************
- *									*
- *			The SAX version 2 API extensions		*
- *									*
- ************************************************************************/
-/**
- * XML_SAX2_MAGIC:
- *
- * Special constant found in SAX2 blocks initialized fields
- */
-#define XML_SAX2_MAGIC 0xDEEDBEAF
-
-/**
- * startElementNsSAX2Func:
- * @ctx:  the user data (XML parser context)
- * @localname:  the local name of the element
- * @prefix:  the element namespace prefix if available
- * @URI:  the element namespace name if available
- * @nb_namespaces:  number of namespace definitions on that node
- * @namespaces:  pointer to the array of prefix/URI pairs namespace definitions
- * @nb_attributes:  the number of attributes on that node
- * @nb_defaulted:  the number of defaulted attributes. The defaulted
- *                  ones are at the end of the array
- * @attributes:  pointer to the array of (localname/prefix/URI/value/end)
- *               attribute values.
- *
- * SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
- * the new namespace declarations on the element.
- */
-
-typedef void (*startElementNsSAX2Func) (void *ctx,
-					const xmlChar *localname,
-					const xmlChar *prefix,
-					const xmlChar *URI,
-					int nb_namespaces,
-					const xmlChar **namespaces,
-					int nb_attributes,
-					int nb_defaulted,
-					const xmlChar **attributes);
- 
-/**
- * endElementNsSAX2Func:
- * @ctx:  the user data (XML parser context)
- * @localname:  the local name of the element
- * @prefix:  the element namespace prefix if available
- * @URI:  the element namespace name if available
- *
- * SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
- */
-
-typedef void (*endElementNsSAX2Func)   (void *ctx,
-					const xmlChar *localname,
-					const xmlChar *prefix,
-					const xmlChar *URI);
-
-
-struct _xmlSAXHandler {
-    internalSubsetSAXFunc internalSubset;
-    isStandaloneSAXFunc isStandalone;
-    hasInternalSubsetSAXFunc hasInternalSubset;
-    hasExternalSubsetSAXFunc hasExternalSubset;
-    resolveEntitySAXFunc resolveEntity;
-    getEntitySAXFunc getEntity;
-    entityDeclSAXFunc entityDecl;
-    notationDeclSAXFunc notationDecl;
-    attributeDeclSAXFunc attributeDecl;
-    elementDeclSAXFunc elementDecl;
-    unparsedEntityDeclSAXFunc unparsedEntityDecl;
-    setDocumentLocatorSAXFunc setDocumentLocator;
-    startDocumentSAXFunc startDocument;
-    endDocumentSAXFunc endDocument;
-    startElementSAXFunc startElement;
-    endElementSAXFunc endElement;
-    referenceSAXFunc reference;
-    charactersSAXFunc characters;
-    ignorableWhitespaceSAXFunc ignorableWhitespace;
-    processingInstructionSAXFunc processingInstruction;
-    commentSAXFunc comment;
-    warningSAXFunc warning;
-    errorSAXFunc error;
-    fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
-    getParameterEntitySAXFunc getParameterEntity;
-    cdataBlockSAXFunc cdataBlock;
-    externalSubsetSAXFunc externalSubset;
-    unsigned int initialized;
-    /* The following fields are extensions available only on version 2 */
-    void *_private;
-    startElementNsSAX2Func startElementNs;
-    endElementNsSAX2Func endElementNs;
-    xmlStructuredErrorFunc serror;
-};
-
-/*
- * SAX Version 1
- */
-typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
-typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
-struct _xmlSAXHandlerV1 {
-    internalSubsetSAXFunc internalSubset;
-    isStandaloneSAXFunc isStandalone;
-    hasInternalSubsetSAXFunc hasInternalSubset;
-    hasExternalSubsetSAXFunc hasExternalSubset;
-    resolveEntitySAXFunc resolveEntity;
-    getEntitySAXFunc getEntity;
-    entityDeclSAXFunc entityDecl;
-    notationDeclSAXFunc notationDecl;
-    attributeDeclSAXFunc attributeDecl;
-    elementDeclSAXFunc elementDecl;
-    unparsedEntityDeclSAXFunc unparsedEntityDecl;
-    setDocumentLocatorSAXFunc setDocumentLocator;
-    startDocumentSAXFunc startDocument;
-    endDocumentSAXFunc endDocument;
-    startElementSAXFunc startElement;
-    endElementSAXFunc endElement;
-    referenceSAXFunc reference;
-    charactersSAXFunc characters;
-    ignorableWhitespaceSAXFunc ignorableWhitespace;
-    processingInstructionSAXFunc processingInstruction;
-    commentSAXFunc comment;
-    warningSAXFunc warning;
-    errorSAXFunc error;
-    fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
-    getParameterEntitySAXFunc getParameterEntity;
-    cdataBlockSAXFunc cdataBlock;
-    externalSubsetSAXFunc externalSubset;
-    unsigned int initialized;
-};
-
-
-/**
- * xmlExternalEntityLoader:
- * @URL: The System ID of the resource requested
- * @ID: The Public ID of the resource requested
- * @context: the XML parser context 
- *
- * External entity loaders types.
- *
- * Returns the entity input parser.
- */
-typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
-					 const char *ID,
-					 xmlParserCtxtPtr context);
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <libxml/encoding.h>
-#include <libxml/xmlIO.h>
-#include <libxml/globals.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
- * Init/Cleanup
- */
-XMLPUBFUN void XMLCALL		
-		xmlInitParser		(void);
-XMLPUBFUN void XMLCALL		
-		xmlCleanupParser	(void);
-
-/*
- * Input functions
- */
-XMLPUBFUN int XMLCALL		
-		xmlParserInputRead	(xmlParserInputPtr in,
-					 int len);
-XMLPUBFUN int XMLCALL		
-		xmlParserInputGrow	(xmlParserInputPtr in,
-					 int len);
-
-/*
- * Basic parsing Interfaces
- */
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlParseDoc		(const xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlParseFile		(const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlParseMemory		(const char *buffer,
-					 int size);
-#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL		
-		xmlSubstituteEntitiesDefault(int val);
-XMLPUBFUN int XMLCALL		
-		xmlKeepBlanksDefault	(int val);
-XMLPUBFUN void XMLCALL		
-		xmlStopParser		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL		
-		xmlPedanticParserDefault(int val);
-XMLPUBFUN int XMLCALL		
-		xmlLineNumbersDefault	(int val);
-
-#ifdef LIBXML_SAX1_ENABLED
-/*
- * Recovery mode 
- */
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlRecoverDoc		(xmlChar *cur);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlRecoverMemory	(const char *buffer,
-					 int size);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlRecoverFile		(const char *filename);
-#endif /* LIBXML_SAX1_ENABLED */
-
-/*
- * Less common routines and SAX interfaces
- */
-XMLPUBFUN int XMLCALL		
-		xmlParseDocument	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL		
-		xmlParseExtParsedEnt	(xmlParserCtxtPtr ctxt);
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL		
-		xmlSAXUserParseFile	(xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 const char *filename);
-XMLPUBFUN int XMLCALL		
-		xmlSAXUserParseMemory	(xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 const char *buffer,
-					 int size);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseDoc		(xmlSAXHandlerPtr sax,
-					 const xmlChar *cur,
-					 int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseMemory	(xmlSAXHandlerPtr sax,
-					 const char *buffer,
-                                   	 int size,
-					 int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
-					 const char *buffer,
-                                   	 int size,
-					 int recovery,
-					 void *data);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseFile		(xmlSAXHandlerPtr sax,
-					 const char *filename,
-					 int recovery);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseFileWithData	(xmlSAXHandlerPtr sax,
-					 const char *filename,
-					 int recovery,
-					 void *data);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlSAXParseEntity	(xmlSAXHandlerPtr sax,
-					 const char *filename);
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlParseEntity		(const char *filename);
-#endif /* LIBXML_SAX1_ENABLED */
-
-#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlSAXParseDTD		(xmlSAXHandlerPtr sax,
-					 const xmlChar *ExternalID,
-					 const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlParseDTD		(const xmlChar *ExternalID,
-					 const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlIOParseDTD		(xmlSAXHandlerPtr sax,
-					 xmlParserInputBufferPtr input,
-					 xmlCharEncoding enc);
-#endif /* LIBXML_VALID_ENABLE */
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL	
-		xmlParseBalancedChunkMemory(xmlDocPtr doc,
-					 xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 int depth,
-					 const xmlChar *string,
-					 xmlNodePtr *lst);
-#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN xmlParserErrors XMLCALL
-		xmlParseInNodeContext	(xmlNodePtr node,
-					 const char *data,
-					 int datalen,
-					 int options,
-					 xmlNodePtr *lst);
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN int XMLCALL          
-		xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
-                     xmlSAXHandlerPtr sax,
-                     void *user_data,
-                     int depth,
-                     const xmlChar *string,
-                     xmlNodePtr *lst,
-                     int recover);
-XMLPUBFUN int XMLCALL		
-		xmlParseExternalEntity	(xmlDocPtr doc,
-					 xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 int depth,
-					 const xmlChar *URL,
-					 const xmlChar *ID,
-					 xmlNodePtr *lst);
-#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN int XMLCALL		
-		xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
-					 const xmlChar *URL,
-					 const xmlChar *ID,
-					 xmlNodePtr *lst);
-
-/*
- * Parser contexts handling.
- */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL	
-		xmlNewParserCtxt	(void);
-XMLPUBFUN int XMLCALL		
-		xmlInitParserCtxt	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL		
-		xmlClearParserCtxt	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL		
-		xmlFreeParserCtxt	(xmlParserCtxtPtr ctxt);
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlSetupParserForBuffer	(xmlParserCtxtPtr ctxt,
-					 const xmlChar* buffer,
-					 const char *filename);
-#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL 
-		xmlCreateDocParserCtxt	(const xmlChar *cur);
-
-#ifdef LIBXML_LEGACY_ENABLED
-/*
- * Reading/setting optional parsing features.
- */
-XMLPUBFUN int XMLCALL		
-		xmlGetFeaturesList	(int *len,
-					 const char **result);
-XMLPUBFUN int XMLCALL		
-		xmlGetFeature		(xmlParserCtxtPtr ctxt,
-					 const char *name,
-					 void *result);
-XMLPUBFUN int XMLCALL		
-		xmlSetFeature		(xmlParserCtxtPtr ctxt,
-					 const char *name,
-					 void *value);
-#endif /* LIBXML_LEGACY_ENABLED */
-
-#ifdef LIBXML_PUSH_ENABLED
-/*
- * Interfaces for the Push mode.
- */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL 
-		xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 const char *chunk,
-					 int size,
-					 const char *filename);
-XMLPUBFUN int XMLCALL		 
-		xmlParseChunk		(xmlParserCtxtPtr ctxt,
-					 const char *chunk,
-					 int size,
-					 int terminate);
-#endif /* LIBXML_PUSH_ENABLED */
-
-/*
- * Special I/O mode.
- */
-
-XMLPUBFUN xmlParserCtxtPtr XMLCALL 
-		xmlCreateIOParserCtxt	(xmlSAXHandlerPtr sax,
-					 void *user_data,
-					 xmlInputReadCallback   ioread,
-					 xmlInputCloseCallback  ioclose,
-					 void *ioctx,
-					 xmlCharEncoding enc);
-
-XMLPUBFUN xmlParserInputPtr XMLCALL 
-		xmlNewIOInputStream	(xmlParserCtxtPtr ctxt,
-					 xmlParserInputBufferPtr input,
-					 xmlCharEncoding enc);
-
-/*
- * Node infos.
- */
-XMLPUBFUN const xmlParserNodeInfo* XMLCALL
-		xmlParserFindNodeInfo	(const xmlParserCtxtPtr ctxt,
-				         const xmlNodePtr node);
-XMLPUBFUN void XMLCALL		
-		xmlInitNodeInfoSeq	(xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN void XMLCALL		
-		xmlClearNodeInfoSeq	(xmlParserNodeInfoSeqPtr seq);
-XMLPUBFUN unsigned long XMLCALL 
-		xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
-                                         const xmlNodePtr node);
-XMLPUBFUN void XMLCALL		
-		xmlParserAddNodeInfo	(xmlParserCtxtPtr ctxt,
-					 const xmlParserNodeInfoPtr info);
-
-/*
- * External entities handling actually implemented in xmlIO.
- */
-
-XMLPUBFUN void XMLCALL		
-		xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
-XMLPUBFUN xmlExternalEntityLoader XMLCALL
-		xmlGetExternalEntityLoader(void);
-XMLPUBFUN xmlParserInputPtr XMLCALL
-		xmlLoadExternalEntity	(const char *URL,
-					 const char *ID,
-					 xmlParserCtxtPtr ctxt);
-
-/*
- * Index lookup, actually implemented in the encoding module
- */
-XMLPUBFUN long XMLCALL
-		xmlByteConsumed		(xmlParserCtxtPtr ctxt);
-
-/*
- * New set of simpler/more flexible APIs
- */
-/**
- * xmlParserOption:
- *
- * This is the set of XML parser options that can be passed down
- * to the xmlReadDoc() and similar calls.
- */
-typedef enum {
-    XML_PARSE_RECOVER	= 1<<0,	/* recover on errors */
-    XML_PARSE_NOENT	= 1<<1,	/* substitute entities */
-    XML_PARSE_DTDLOAD	= 1<<2,	/* load the external subset */
-    XML_PARSE_DTDATTR	= 1<<3,	/* default DTD attributes */
-    XML_PARSE_DTDVALID	= 1<<4,	/* validate with the DTD */
-    XML_PARSE_NOERROR	= 1<<5,	/* suppress error reports */
-    XML_PARSE_NOWARNING	= 1<<6,	/* suppress warning reports */
-    XML_PARSE_PEDANTIC	= 1<<7,	/* pedantic error reporting */
-    XML_PARSE_NOBLANKS	= 1<<8,	/* remove blank nodes */
-    XML_PARSE_SAX1	= 1<<9,	/* use the SAX1 interface internally */
-    XML_PARSE_XINCLUDE	= 1<<10,/* Implement XInclude substitition  */
-    XML_PARSE_NONET	= 1<<11,/* Forbid network access */
-    XML_PARSE_NODICT	= 1<<12,/* Do not reuse the context dictionnary */
-    XML_PARSE_NSCLEAN	= 1<<13,/* remove redundant namespaces declarations */
-    XML_PARSE_NOCDATA	= 1<<14,/* merge CDATA as text nodes */
-    XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
-    XML_PARSE_COMPACT   = 1<<16,/* compact small text nodes; no modification of
-                                   the tree allowed afterwards (will possibly
-				   crash if you try to modify the tree) */
-    XML_PARSE_OLD10	= 1<<17,/* parse using XML-1.0 before update 5 */
-    XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
-    XML_PARSE_HUGE      = 1<<19, /* relax any hardcoded limit from the parser */
-    XML_PARSE_OLDSAX    = 1<<20 /* parse using SAX2 interface from before 2.7.0 */
-} xmlParserOption;
-
-XMLPUBFUN void XMLCALL
-		xmlCtxtReset		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		xmlCtxtResetPush	(xmlParserCtxtPtr ctxt,
-					 const char *chunk,
-					 int size,
-					 const char *filename,
-					 const char *encoding);
-XMLPUBFUN int XMLCALL
-		xmlCtxtUseOptions	(xmlParserCtxtPtr ctxt,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlReadDoc		(const xmlChar *cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlReadFile		(const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlReadMemory		(const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlReadFd		(int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlReadIO		(xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlCtxtReadDoc		(xmlParserCtxtPtr ctxt,
-					 const xmlChar *cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlCtxtReadFile		(xmlParserCtxtPtr ctxt,
-					 const char *filename,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlCtxtReadMemory		(xmlParserCtxtPtr ctxt,
-					 const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlCtxtReadFd		(xmlParserCtxtPtr ctxt,
-					 int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlDocPtr XMLCALL
-		xmlCtxtReadIO		(xmlParserCtxtPtr ctxt,
-					 xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-
-/*
- * Library wide options
- */
-/**
- * xmlFeature:
- *
- * Used to examine the existance of features that can be enabled
- * or disabled at compile-time.
- * They used to be called XML_FEATURE_xxx but this clashed with Expat
- */
-typedef enum {
-    XML_WITH_THREAD = 1,
-    XML_WITH_TREE = 2,
-    XML_WITH_OUTPUT = 3,
-    XML_WITH_PUSH = 4,
-    XML_WITH_READER = 5,
-    XML_WITH_PATTERN = 6,
-    XML_WITH_WRITER = 7,
-    XML_WITH_SAX1 = 8,
-    XML_WITH_FTP = 9,
-    XML_WITH_HTTP = 10,
-    XML_WITH_VALID = 11,
-    XML_WITH_HTML = 12,
-    XML_WITH_LEGACY = 13,
-    XML_WITH_C14N = 14,
-    XML_WITH_CATALOG = 15,
-    XML_WITH_XPATH = 16,
-    XML_WITH_XPTR = 17,
-    XML_WITH_XINCLUDE = 18,
-    XML_WITH_ICONV = 19,
-    XML_WITH_ISO8859X = 20,
-    XML_WITH_UNICODE = 21,
-    XML_WITH_REGEXP = 22,
-    XML_WITH_AUTOMATA = 23,
-    XML_WITH_EXPR = 24,
-    XML_WITH_SCHEMAS = 25,
-    XML_WITH_SCHEMATRON = 26,
-    XML_WITH_MODULES = 27,
-    XML_WITH_DEBUG = 28,
-    XML_WITH_DEBUG_MEM = 29,
-    XML_WITH_DEBUG_RUN = 30,
-    XML_WITH_ZLIB = 31,
-    XML_WITH_NONE = 99999 /* just to be sure of allocation size */
-} xmlFeature;
-
-XMLPUBFUN int XMLCALL
-		xmlHasFeature		(xmlFeature feature);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_PARSER_H__ */
-
diff --git a/interfaces/ext/libxml/parserInternals.h b/interfaces/ext/libxml/parserInternals.h
deleted file mode 100644
index a5e75b5..0000000
--- a/interfaces/ext/libxml/parserInternals.h
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- * Summary: internals routines exported by the parser.
- * Description: this module exports a number of internal parsing routines
- *              they are not really all intended for applications but
- *              can prove useful doing low level processing.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_PARSER_INTERNALS_H__
-#define __XML_PARSER_INTERNALS_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-#include <libxml/HTMLparser.h>
-#include <libxml/chvalid.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlParserMaxDepth:
- *
- * arbitrary depth limit for the XML documents that we allow to
- * process. This is not a limitation of the parser but a safety
- * boundary feature, use XML_PARSE_HUGE option to override it.
- */
-XMLPUBVAR unsigned int xmlParserMaxDepth;
-
-/**
- * XML_MAX_TEXT_LENGTH:
- *
- * Maximum size allowed for a single text node when building a tree.
- * This is not a limitation of the parser but a safety boundary feature,
- * use XML_PARSE_HUGE option to override it.
- */
-#define XML_MAX_TEXT_LENGTH 10000000
-
-/**
- * XML_MAX_NAMELEN:
- *
- * Identifiers can be longer, but this will be more costly
- * at runtime.
- */
-#define XML_MAX_NAMELEN 100
-
-/**
- * INPUT_CHUNK:
- *
- * The parser tries to always have that amount of input ready.
- * One of the point is providing context when reporting errors.
- */
-#define INPUT_CHUNK	250
-
-/************************************************************************
- *									*
- * UNICODE version of the macros.      					*
- *									*
- ************************************************************************/
-/**
- * IS_BYTE_CHAR:
- * @c:  an byte value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [2] Char ::= #x9 | #xA | #xD | [#x20...]
- * any byte character in the accepted range
- */
-#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
-
-/**
- * IS_CHAR:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
- *                  | [#x10000-#x10FFFF]
- * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
- */
-#define IS_CHAR(c)   xmlIsCharQ(c)
-
-/**
- * IS_CHAR_CH:
- * @c: an xmlChar (usually an unsigned char)
- *
- * Behaves like IS_CHAR on single-byte value
- */
-#define IS_CHAR_CH(c)  xmlIsChar_ch(c)
-
-/**
- * IS_BLANK:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [3] S ::= (#x20 | #x9 | #xD | #xA)+
- */
-#define IS_BLANK(c)  xmlIsBlankQ(c)
-
-/**
- * IS_BLANK_CH:
- * @c:  an xmlChar value (normally unsigned char)
- *
- * Behaviour same as IS_BLANK
- */
-#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
-
-/**
- * IS_BASECHAR:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [85] BaseChar ::= ... long list see REC ...
- */
-#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
-
-/**
- * IS_DIGIT:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [88] Digit ::= ... long list see REC ...
- */
-#define IS_DIGIT(c) xmlIsDigitQ(c)
-
-/**
- * IS_DIGIT_CH:
- * @c:  an xmlChar value (usually an unsigned char)
- *
- * Behaves like IS_DIGIT but with a single byte argument
- */
-#define IS_DIGIT_CH(c)  xmlIsDigit_ch(c)
-
-/**
- * IS_COMBINING:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- * [87] CombiningChar ::= ... long list see REC ...
- */
-#define IS_COMBINING(c) xmlIsCombiningQ(c)
-
-/**
- * IS_COMBINING_CH:
- * @c:  an xmlChar (usually an unsigned char)
- *
- * Always false (all combining chars > 0xff)
- */
-#define IS_COMBINING_CH(c) 0 
-
-/**
- * IS_EXTENDER:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- *
- * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
- *                   #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
- *                   [#x309D-#x309E] | [#x30FC-#x30FE]
- */
-#define IS_EXTENDER(c) xmlIsExtenderQ(c)
-
-/**
- * IS_EXTENDER_CH:
- * @c:  an xmlChar value (usually an unsigned char)
- *
- * Behaves like IS_EXTENDER but with a single-byte argument
- */
-#define IS_EXTENDER_CH(c)  xmlIsExtender_ch(c)
-
-/**
- * IS_IDEOGRAPHIC:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- *
- * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
- */
-#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
-
-/**
- * IS_LETTER:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- *
- * [84] Letter ::= BaseChar | Ideographic 
- */
-#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
-
-/**
- * IS_LETTER_CH:
- * @c:  an xmlChar value (normally unsigned char)
- *
- * Macro behaves like IS_LETTER, but only check base chars
- *
- */
-#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
-
-/**
- * IS_ASCII_LETTER:
- * @c: an xmlChar value
- *
- * Macro to check [a-zA-Z]
- *
- */
-#define IS_ASCII_LETTER(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
-				 ((0x61 <= (c)) && ((c) <= 0x7a)))
-
-/**
- * IS_ASCII_DIGIT:
- * @c: an xmlChar value
- *
- * Macro to check [0-9]
- *
- */
-#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
-
-/**
- * IS_PUBIDCHAR:
- * @c:  an UNICODE value (int)
- *
- * Macro to check the following production in the XML spec:
- *
- *
- * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- */
-#define IS_PUBIDCHAR(c)	xmlIsPubidCharQ(c)
-
-/**
- * IS_PUBIDCHAR_CH:
- * @c:  an xmlChar value (normally unsigned char)
- *
- * Same as IS_PUBIDCHAR but for single-byte value
- */
-#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
-
-/**
- * SKIP_EOL:
- * @p:  and UTF8 string pointer
- *
- * Skips the end of line chars.
- */
-#define SKIP_EOL(p) 							\
-    if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; }			\
-    if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
-
-/**
- * MOVETO_ENDTAG:
- * @p:  and UTF8 string pointer
- *
- * Skips to the next '>' char.
- */
-#define MOVETO_ENDTAG(p)						\
-    while ((*p) && (*(p) != '>')) (p)++
-
-/**
- * MOVETO_STARTTAG:
- * @p:  and UTF8 string pointer
- *
- * Skips to the next '<' char.
- */
-#define MOVETO_STARTTAG(p)						\
-    while ((*p) && (*(p) != '<')) (p)++
-
-/**
- * Global variables used for predefined strings.
- */
-XMLPUBVAR const xmlChar xmlStringText[];
-XMLPUBVAR const xmlChar xmlStringTextNoenc[];
-XMLPUBVAR const xmlChar xmlStringComment[];
-
-/*
- * Function to finish the work of the macros where needed.
- */
-XMLPUBFUN int XMLCALL                   xmlIsLetter     (int c);
-
-/**
- * Parser context.
- */
-XMLPUBFUN xmlParserCtxtPtr XMLCALL	
-			xmlCreateFileParserCtxt	(const char *filename);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL	
-			xmlCreateURLParserCtxt	(const char *filename,
-						 int options);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL	
-			xmlCreateMemoryParserCtxt(const char *buffer,
-						 int size);
-XMLPUBFUN xmlParserCtxtPtr XMLCALL	
-			xmlCreateEntityParserCtxt(const xmlChar *URL,
-						 const xmlChar *ID,
-						 const xmlChar *base);
-XMLPUBFUN int XMLCALL			
-			xmlSwitchEncoding	(xmlParserCtxtPtr ctxt,
-						 xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL			
-			xmlSwitchToEncoding	(xmlParserCtxtPtr ctxt,
-					 xmlCharEncodingHandlerPtr handler);
-XMLPUBFUN int XMLCALL			
-			xmlSwitchInputEncoding	(xmlParserCtxtPtr ctxt,
-						 xmlParserInputPtr input,
-					 xmlCharEncodingHandlerPtr handler);
-
-#ifdef IN_LIBXML
-/* internal error reporting */
-XMLPUBFUN void XMLCALL
-			__xmlErrEncoding	(xmlParserCtxtPtr ctxt,
-						 xmlParserErrors xmlerr,
-						 const char *msg,
-						 const xmlChar * str1,
-						 const xmlChar * str2);
-#endif
-
-/**
- * Input Streams.
- */
-XMLPUBFUN xmlParserInputPtr XMLCALL	
-			xmlNewStringInputStream	(xmlParserCtxtPtr ctxt,
-						 const xmlChar *buffer);
-XMLPUBFUN xmlParserInputPtr XMLCALL	
-			xmlNewEntityInputStream	(xmlParserCtxtPtr ctxt,
-						 xmlEntityPtr entity);
-XMLPUBFUN int XMLCALL			
-			xmlPushInput		(xmlParserCtxtPtr ctxt,
-						 xmlParserInputPtr input);
-XMLPUBFUN xmlChar XMLCALL			
-			xmlPopInput		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlFreeInputStream	(xmlParserInputPtr input);
-XMLPUBFUN xmlParserInputPtr XMLCALL	
-			xmlNewInputFromFile	(xmlParserCtxtPtr ctxt,
-						 const char *filename);
-XMLPUBFUN xmlParserInputPtr XMLCALL	
-			xmlNewInputStream	(xmlParserCtxtPtr ctxt);
-
-/**
- * Namespaces.
- */
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlSplitQName		(xmlParserCtxtPtr ctxt,
-						 const xmlChar *name,
-						 xmlChar **prefix);
-
-/**
- * Generic production rules.
- */
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlParseName		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseNmtoken		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseEntityValue	(xmlParserCtxtPtr ctxt,
-						 xmlChar **orig);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseAttValue	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseSystemLiteral	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParsePubidLiteral	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseCharData	(xmlParserCtxtPtr ctxt,
-						 int cdata);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseExternalID	(xmlParserCtxtPtr ctxt,
-						 xmlChar **publicID,
-						 int strict);
-XMLPUBFUN void XMLCALL			
-			xmlParseComment		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlParsePITarget	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParsePI		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseNotationDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseEntityDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
-			xmlParseDefaultDecl	(xmlParserCtxtPtr ctxt,
-						 xmlChar **value);
-XMLPUBFUN xmlEnumerationPtr XMLCALL	
-			xmlParseNotationType	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEnumerationPtr XMLCALL	
-			xmlParseEnumerationType	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
-			xmlParseEnumeratedType	(xmlParserCtxtPtr ctxt,
-						 xmlEnumerationPtr *tree);
-XMLPUBFUN int XMLCALL			
-			xmlParseAttributeType	(xmlParserCtxtPtr ctxt,
-						 xmlEnumerationPtr *tree);
-XMLPUBFUN void XMLCALL			
-			xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlElementContentPtr XMLCALL	
-			xmlParseElementMixedContentDecl
-						(xmlParserCtxtPtr ctxt,
-						 int inputchk);
-XMLPUBFUN xmlElementContentPtr XMLCALL	
-			xmlParseElementChildrenContentDecl
-						(xmlParserCtxtPtr ctxt,
-						 int inputchk);
-XMLPUBFUN int XMLCALL			
-			xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
-						 const xmlChar *name,
-						 xmlElementContentPtr *result);
-XMLPUBFUN int XMLCALL			
-			xmlParseElementDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseMarkupDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
-			xmlParseCharRef		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlEntityPtr XMLCALL		
-			xmlParseEntityRef	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseReference	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParsePEReference	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseDocTypeDecl	(xmlParserCtxtPtr ctxt);
-#ifdef LIBXML_SAX1_ENABLED
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlParseAttribute	(xmlParserCtxtPtr ctxt,
-						 xmlChar **value);
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlParseStartTag	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseEndTag		(xmlParserCtxtPtr ctxt);
-#endif /* LIBXML_SAX1_ENABLED */
-XMLPUBFUN void XMLCALL			
-			xmlParseCDSect		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseContent		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseElement		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseVersionNum	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseVersionInfo	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseEncName		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL		
-			xmlParseEncodingDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
-			xmlParseSDDecl		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseXMLDecl		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseTextDecl	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseMisc		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			
-			xmlParseExternalSubset	(xmlParserCtxtPtr ctxt,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID); 
-/**
- * XML_SUBSTITUTE_NONE:
- *
- * If no entities need to be substituted.
- */
-#define XML_SUBSTITUTE_NONE	0
-/**
- * XML_SUBSTITUTE_REF:
- *
- * Whether general entities need to be substituted.
- */
-#define XML_SUBSTITUTE_REF	1
-/**
- * XML_SUBSTITUTE_PEREF:
- *
- * Whether parameter entities need to be substituted.
- */
-#define XML_SUBSTITUTE_PEREF	2
-/**
- * XML_SUBSTITUTE_BOTH:
- *
- * Both general and parameter entities need to be substituted.
- */
-#define XML_SUBSTITUTE_BOTH 	3
-
-XMLPUBFUN xmlChar * XMLCALL
-		xmlStringDecodeEntities		(xmlParserCtxtPtr ctxt,
-						 const xmlChar *str,
-						 int what,
-						 xmlChar end,
-						 xmlChar  end2,
-						 xmlChar end3);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlStringLenDecodeEntities	(xmlParserCtxtPtr ctxt,
-						 const xmlChar *str,
-						 int len,
-						 int what,
-						 xmlChar end,
-						 xmlChar  end2,
-						 xmlChar end3);
-
-/*
- * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
- */
-XMLPUBFUN int XMLCALL			nodePush		(xmlParserCtxtPtr ctxt,
-						 xmlNodePtr value);
-XMLPUBFUN xmlNodePtr XMLCALL		nodePop			(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			inputPush		(xmlParserCtxtPtr ctxt,
-						 xmlParserInputPtr value);
-XMLPUBFUN xmlParserInputPtr XMLCALL	inputPop		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN const xmlChar * XMLCALL	namePop			(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			namePush		(xmlParserCtxtPtr ctxt,
-						 const xmlChar *value);
-
-/*
- * other commodities shared between parser.c and parserInternals.
- */
-XMLPUBFUN int XMLCALL			xmlSkipBlankChars	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			xmlStringCurrentChar	(xmlParserCtxtPtr ctxt,
-						 const xmlChar *cur,
-						 int *len);
-XMLPUBFUN void XMLCALL			xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			xmlCheckLanguageID	(const xmlChar *lang);
-
-/*
- * Really core function shared with HTML parser.
- */
-XMLPUBFUN int XMLCALL			xmlCurrentChar		(xmlParserCtxtPtr ctxt,
-						 int *len);
-XMLPUBFUN int XMLCALL		xmlCopyCharMultiByte	(xmlChar *out,
-						 int val);
-XMLPUBFUN int XMLCALL			xmlCopyChar		(int len,
-						 xmlChar *out,
-						 int val);
-XMLPUBFUN void XMLCALL			xmlNextChar		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL			xmlParserInputShrink	(xmlParserInputPtr in);
-
-#ifdef LIBXML_HTML_ENABLED
-/*
- * Actually comes from the HTML parser but launched from the init stuff.
- */
-XMLPUBFUN void XMLCALL			htmlInitAutoClose	(void);
-XMLPUBFUN htmlParserCtxtPtr XMLCALL	htmlCreateFileParserCtxt(const char *filename,
-	                                         const char *encoding);
-#endif
-
-/*
- * Specific function to keep track of entities references
- * and used by the XSLT debugger.
- */
-#ifdef LIBXML_LEGACY_ENABLED
-/**
- * xmlEntityReferenceFunc:
- * @ent: the entity
- * @firstNode:  the fist node in the chunk
- * @lastNode:  the last nod in the chunk
- *
- * Callback function used when one needs to be able to track back the
- * provenance of a chunk of nodes inherited from an entity replacement.
- */
-typedef	void	(*xmlEntityReferenceFunc)	(xmlEntityPtr ent,
-						 xmlNodePtr firstNode,
-						 xmlNodePtr lastNode);
-  
-XMLPUBFUN void XMLCALL		xmlSetEntityReferenceFunc	(xmlEntityReferenceFunc func);
-
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlParseQuotedString	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
-                        xmlParseNamespace       (xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlNamespaceParseNSDef	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlScanName		(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlNamespaceParseNCName	(xmlParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL	xmlParserHandleReference(xmlParserCtxtPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL		
-			xmlNamespaceParseQName	(xmlParserCtxtPtr ctxt,
-						 xmlChar **prefix);
-/**
- * Entities
- */
-XMLPUBFUN xmlChar * XMLCALL
-		xmlDecodeEntities		(xmlParserCtxtPtr ctxt,
-						 int len,
-						 int what,
-						 xmlChar end,
-						 xmlChar  end2,
-						 xmlChar end3);
-XMLPUBFUN void XMLCALL			
-			xmlHandleEntity		(xmlParserCtxtPtr ctxt,
-						 xmlEntityPtr entity);
-
-#endif /* LIBXML_LEGACY_ENABLED */
-
-#ifdef IN_LIBXML
-/*
- * internal only
- */
-XMLPUBFUN void XMLCALL
-	xmlErrMemory		(xmlParserCtxtPtr ctxt,
-				 const char *extra);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_PARSER_INTERNALS_H__ */
diff --git a/interfaces/ext/libxml/pattern.h b/interfaces/ext/libxml/pattern.h
deleted file mode 100644
index 97d2cd2..0000000
--- a/interfaces/ext/libxml/pattern.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Summary: pattern expression handling
- * Description: allows to compile and test pattern expressions for nodes
- *              either in a tree or based on a parser state.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_PATTERN_H__
-#define __XML_PATTERN_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/dict.h>
-
-#ifdef LIBXML_PATTERN_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlPattern:
- *
- * A compiled (XPath based) pattern to select nodes
- */
-typedef struct _xmlPattern xmlPattern;
-typedef xmlPattern *xmlPatternPtr;
-
-/**
- * xmlPatternFlags:
- *
- * This is the set of options affecting the behaviour of pattern
- * matching with this module
- *
- */
-typedef enum {
-    XML_PATTERN_DEFAULT		= 0,	/* simple pattern match */
-    XML_PATTERN_XPATH		= 1<<0,	/* standard XPath pattern */
-    XML_PATTERN_XSSEL		= 1<<1,	/* XPath subset for schema selector */
-    XML_PATTERN_XSFIELD		= 1<<2	/* XPath subset for schema field */
-} xmlPatternFlags;
-
-XMLPUBFUN void XMLCALL
-			xmlFreePattern		(xmlPatternPtr comp);
-
-XMLPUBFUN void XMLCALL
-			xmlFreePatternList	(xmlPatternPtr comp);
-
-XMLPUBFUN xmlPatternPtr XMLCALL
-			xmlPatterncompile	(const xmlChar *pattern,
-						 xmlDict *dict,
-						 int flags,
-						 const xmlChar **namespaces);
-XMLPUBFUN int XMLCALL
-			xmlPatternMatch		(xmlPatternPtr comp,
-						 xmlNodePtr node);
-
-/* streaming interfaces */
-typedef struct _xmlStreamCtxt xmlStreamCtxt;
-typedef xmlStreamCtxt *xmlStreamCtxtPtr;
-
-XMLPUBFUN int XMLCALL
-			xmlPatternStreamable	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternMaxDepth	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternMinDepth	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternFromRoot	(xmlPatternPtr comp);
-XMLPUBFUN xmlStreamCtxtPtr XMLCALL
-			xmlPatternGetStreamCtxt	(xmlPatternPtr comp);
-XMLPUBFUN void XMLCALL
-			xmlFreeStreamCtxt	(xmlStreamCtxtPtr stream);
-XMLPUBFUN int XMLCALL
-			xmlStreamPushNode	(xmlStreamCtxtPtr stream,
-						 const xmlChar *name,
-						 const xmlChar *ns,
-						 int nodeType);
-XMLPUBFUN int XMLCALL
-			xmlStreamPush		(xmlStreamCtxtPtr stream,
-						 const xmlChar *name,
-						 const xmlChar *ns);
-XMLPUBFUN int XMLCALL
-			xmlStreamPushAttr	(xmlStreamCtxtPtr stream,
-						 const xmlChar *name,
-						 const xmlChar *ns);
-XMLPUBFUN int XMLCALL
-			xmlStreamPop		(xmlStreamCtxtPtr stream);
-XMLPUBFUN int XMLCALL
-			xmlStreamWantsAnyNode	(xmlStreamCtxtPtr stream);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_PATTERN_ENABLED */
-
-#endif /* __XML_PATTERN_H__ */
diff --git a/interfaces/ext/libxml/relaxng.h b/interfaces/ext/libxml/relaxng.h
deleted file mode 100644
index d3e39e0..0000000
--- a/interfaces/ext/libxml/relaxng.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Summary: implementation of the Relax-NG validation
- * Description: implementation of the Relax-NG validation
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_RELAX_NG__
-#define __XML_RELAX_NG__
-
-#include <libxml/xmlversion.h>
-#include <libxml/hash.h>
-#include <libxml/xmlstring.h>
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _xmlRelaxNG xmlRelaxNG;
-typedef xmlRelaxNG *xmlRelaxNGPtr;
-
-
-/**
- * xmlRelaxNGValidityErrorFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of an error callback from a Relax-NG validation
- */
-typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-
-/**
- * xmlRelaxNGValidityWarningFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of a warning callback from a Relax-NG validation
- */
-typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-
-/**
- * A schemas validation context
- */
-typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
-typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
-
-typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
-typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
-
-/*
- * xmlRelaxNGValidErr:
- *
- * List of possible Relax NG validation errors
- */
-typedef enum {
-    XML_RELAXNG_OK = 0,
-    XML_RELAXNG_ERR_MEMORY,
-    XML_RELAXNG_ERR_TYPE,
-    XML_RELAXNG_ERR_TYPEVAL,
-    XML_RELAXNG_ERR_DUPID,
-    XML_RELAXNG_ERR_TYPECMP,
-    XML_RELAXNG_ERR_NOSTATE,
-    XML_RELAXNG_ERR_NODEFINE,
-    XML_RELAXNG_ERR_LISTEXTRA,
-    XML_RELAXNG_ERR_LISTEMPTY,
-    XML_RELAXNG_ERR_INTERNODATA,
-    XML_RELAXNG_ERR_INTERSEQ,
-    XML_RELAXNG_ERR_INTEREXTRA,
-    XML_RELAXNG_ERR_ELEMNAME,
-    XML_RELAXNG_ERR_ATTRNAME,
-    XML_RELAXNG_ERR_ELEMNONS,
-    XML_RELAXNG_ERR_ATTRNONS,
-    XML_RELAXNG_ERR_ELEMWRONGNS,
-    XML_RELAXNG_ERR_ATTRWRONGNS,
-    XML_RELAXNG_ERR_ELEMEXTRANS,
-    XML_RELAXNG_ERR_ATTREXTRANS,
-    XML_RELAXNG_ERR_ELEMNOTEMPTY,
-    XML_RELAXNG_ERR_NOELEM,
-    XML_RELAXNG_ERR_NOTELEM,
-    XML_RELAXNG_ERR_ATTRVALID,
-    XML_RELAXNG_ERR_CONTENTVALID,
-    XML_RELAXNG_ERR_EXTRACONTENT,
-    XML_RELAXNG_ERR_INVALIDATTR,
-    XML_RELAXNG_ERR_DATAELEM,
-    XML_RELAXNG_ERR_VALELEM,
-    XML_RELAXNG_ERR_LISTELEM,
-    XML_RELAXNG_ERR_DATATYPE,
-    XML_RELAXNG_ERR_VALUE,
-    XML_RELAXNG_ERR_LIST,
-    XML_RELAXNG_ERR_NOGRAMMAR,
-    XML_RELAXNG_ERR_EXTRADATA,
-    XML_RELAXNG_ERR_LACKDATA,
-    XML_RELAXNG_ERR_INTERNAL,
-    XML_RELAXNG_ERR_ELEMWRONG,
-    XML_RELAXNG_ERR_TEXTWRONG
-} xmlRelaxNGValidErr;
-
-/*
- * xmlRelaxNGParserFlags:
- *
- * List of possible Relax NG Parser flags
- */
-typedef enum {
-    XML_RELAXNGP_NONE = 0,
-    XML_RELAXNGP_FREE_DOC = 1,
-    XML_RELAXNGP_CRNG = 2
-} xmlRelaxNGParserFlag;
-
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGInitTypes		(void);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGCleanupTypes	(void);
-
-/*
- * Interfaces for parsing.
- */
-XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
-		    xmlRelaxNGNewParserCtxt	(const char *URL);
-XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
-		    xmlRelaxNGNewMemParserCtxt	(const char *buffer,
-						 int size);
-XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
-		    xmlRelaxNGNewDocParserCtxt	(xmlDocPtr doc);
-
-XMLPUBFUN int XMLCALL
-		    xmlRelaxParserSetFlag	(xmlRelaxNGParserCtxtPtr ctxt,
-						 int flag);
-
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGFreeParserCtxt	(xmlRelaxNGParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
-					 xmlRelaxNGValidityErrorFunc err,
-					 xmlRelaxNGValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
-					 xmlRelaxNGValidityErrorFunc *err,
-					 xmlRelaxNGValidityWarningFunc *warn,
-					 void **ctx);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGSetParserStructuredErrors(
-					 xmlRelaxNGParserCtxtPtr ctxt,
-					 xmlStructuredErrorFunc serror,
-					 void *ctx);
-XMLPUBFUN xmlRelaxNGPtr XMLCALL
-		    xmlRelaxNGParse		(xmlRelaxNGParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGFree		(xmlRelaxNGPtr schema);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGDump		(FILE *output,
-					 xmlRelaxNGPtr schema);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGDumpTree	(FILE * output,
-					 xmlRelaxNGPtr schema);
-#endif /* LIBXML_OUTPUT_ENABLED */
-/*
- * Interfaces for validating
- */
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
-					 xmlRelaxNGValidityErrorFunc err,
-					 xmlRelaxNGValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
-					 xmlRelaxNGValidityErrorFunc *err,
-					 xmlRelaxNGValidityWarningFunc *warn,
-					 void **ctx);
-XMLPUBFUN void XMLCALL
-			xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
-					  xmlStructuredErrorFunc serror, void *ctx);
-XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
-		    xmlRelaxNGNewValidCtxt	(xmlRelaxNGPtr schema);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGFreeValidCtxt	(xmlRelaxNGValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGValidateDoc	(xmlRelaxNGValidCtxtPtr ctxt,
-						 xmlDocPtr doc);
-/*
- * Interfaces for progressive validation when possible
- */
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGValidatePushElement	(xmlRelaxNGValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGValidatePushCData	(xmlRelaxNGValidCtxtPtr ctxt,
-					 const xmlChar *data,
-					 int len);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGValidatePopElement	(xmlRelaxNGValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
-		    xmlRelaxNGValidateFullElement	(xmlRelaxNGValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_SCHEMAS_ENABLED */
-
-#endif /* __XML_RELAX_NG__ */
diff --git a/interfaces/ext/libxml/schemasInternals.h b/interfaces/ext/libxml/schemasInternals.h
deleted file mode 100644
index b68a6e1..0000000
--- a/interfaces/ext/libxml/schemasInternals.h
+++ /dev/null
@@ -1,958 +0,0 @@
-/*
- * Summary: internal interfaces for XML Schemas
- * Description: internal interfaces for the XML Schemas handling
- *              and schema validity checking
- *		The Schemas development is a Work In Progress.
- *              Some of those interfaces are not garanteed to be API or ABI stable !
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SCHEMA_INTERNALS_H__
-#define __XML_SCHEMA_INTERNALS_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-
-#include <libxml/xmlregexp.h>
-#include <libxml/hash.h>
-#include <libxml/dict.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    XML_SCHEMAS_UNKNOWN = 0,
-    XML_SCHEMAS_STRING,
-    XML_SCHEMAS_NORMSTRING,
-    XML_SCHEMAS_DECIMAL,
-    XML_SCHEMAS_TIME,
-    XML_SCHEMAS_GDAY,
-    XML_SCHEMAS_GMONTH,
-    XML_SCHEMAS_GMONTHDAY,
-    XML_SCHEMAS_GYEAR,
-    XML_SCHEMAS_GYEARMONTH,
-    XML_SCHEMAS_DATE,
-    XML_SCHEMAS_DATETIME,
-    XML_SCHEMAS_DURATION,
-    XML_SCHEMAS_FLOAT,
-    XML_SCHEMAS_DOUBLE,
-    XML_SCHEMAS_BOOLEAN,
-    XML_SCHEMAS_TOKEN,
-    XML_SCHEMAS_LANGUAGE,
-    XML_SCHEMAS_NMTOKEN,
-    XML_SCHEMAS_NMTOKENS,
-    XML_SCHEMAS_NAME,
-    XML_SCHEMAS_QNAME,
-    XML_SCHEMAS_NCNAME,
-    XML_SCHEMAS_ID,
-    XML_SCHEMAS_IDREF,
-    XML_SCHEMAS_IDREFS,
-    XML_SCHEMAS_ENTITY,
-    XML_SCHEMAS_ENTITIES,
-    XML_SCHEMAS_NOTATION,
-    XML_SCHEMAS_ANYURI,
-    XML_SCHEMAS_INTEGER,
-    XML_SCHEMAS_NPINTEGER,
-    XML_SCHEMAS_NINTEGER,
-    XML_SCHEMAS_NNINTEGER,
-    XML_SCHEMAS_PINTEGER,
-    XML_SCHEMAS_INT,
-    XML_SCHEMAS_UINT,
-    XML_SCHEMAS_LONG,
-    XML_SCHEMAS_ULONG,
-    XML_SCHEMAS_SHORT,
-    XML_SCHEMAS_USHORT,
-    XML_SCHEMAS_BYTE,
-    XML_SCHEMAS_UBYTE,
-    XML_SCHEMAS_HEXBINARY,
-    XML_SCHEMAS_BASE64BINARY,
-    XML_SCHEMAS_ANYTYPE,
-    XML_SCHEMAS_ANYSIMPLETYPE
-} xmlSchemaValType;
-
-/*
- * XML Schemas defines multiple type of types.
- */
-typedef enum {
-    XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
-    XML_SCHEMA_TYPE_ANY,
-    XML_SCHEMA_TYPE_FACET,
-    XML_SCHEMA_TYPE_SIMPLE,
-    XML_SCHEMA_TYPE_COMPLEX,
-    XML_SCHEMA_TYPE_SEQUENCE = 6,
-    XML_SCHEMA_TYPE_CHOICE,
-    XML_SCHEMA_TYPE_ALL,
-    XML_SCHEMA_TYPE_SIMPLE_CONTENT,
-    XML_SCHEMA_TYPE_COMPLEX_CONTENT,
-    XML_SCHEMA_TYPE_UR,
-    XML_SCHEMA_TYPE_RESTRICTION,
-    XML_SCHEMA_TYPE_EXTENSION,
-    XML_SCHEMA_TYPE_ELEMENT,
-    XML_SCHEMA_TYPE_ATTRIBUTE,
-    XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
-    XML_SCHEMA_TYPE_GROUP,
-    XML_SCHEMA_TYPE_NOTATION,
-    XML_SCHEMA_TYPE_LIST,
-    XML_SCHEMA_TYPE_UNION,
-    XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
-    XML_SCHEMA_TYPE_IDC_UNIQUE,
-    XML_SCHEMA_TYPE_IDC_KEY,
-    XML_SCHEMA_TYPE_IDC_KEYREF,
-    XML_SCHEMA_TYPE_PARTICLE = 25, 
-    XML_SCHEMA_TYPE_ATTRIBUTE_USE, 
-    XML_SCHEMA_FACET_MININCLUSIVE = 1000,
-    XML_SCHEMA_FACET_MINEXCLUSIVE,
-    XML_SCHEMA_FACET_MAXINCLUSIVE,
-    XML_SCHEMA_FACET_MAXEXCLUSIVE,
-    XML_SCHEMA_FACET_TOTALDIGITS,
-    XML_SCHEMA_FACET_FRACTIONDIGITS,
-    XML_SCHEMA_FACET_PATTERN,
-    XML_SCHEMA_FACET_ENUMERATION,
-    XML_SCHEMA_FACET_WHITESPACE,
-    XML_SCHEMA_FACET_LENGTH,
-    XML_SCHEMA_FACET_MAXLENGTH,
-    XML_SCHEMA_FACET_MINLENGTH,
-    XML_SCHEMA_EXTRA_QNAMEREF = 2000,
-    XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
-} xmlSchemaTypeType;
-
-typedef enum {
-    XML_SCHEMA_CONTENT_UNKNOWN = 0,
-    XML_SCHEMA_CONTENT_EMPTY = 1,
-    XML_SCHEMA_CONTENT_ELEMENTS,
-    XML_SCHEMA_CONTENT_MIXED,
-    XML_SCHEMA_CONTENT_SIMPLE,
-    XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */
-    XML_SCHEMA_CONTENT_BASIC,
-    XML_SCHEMA_CONTENT_ANY
-} xmlSchemaContentType;
-
-typedef struct _xmlSchemaVal xmlSchemaVal;
-typedef xmlSchemaVal *xmlSchemaValPtr;
-
-typedef struct _xmlSchemaType xmlSchemaType;
-typedef xmlSchemaType *xmlSchemaTypePtr;
-
-typedef struct _xmlSchemaFacet xmlSchemaFacet;
-typedef xmlSchemaFacet *xmlSchemaFacetPtr;
-
-/**
- * Annotation
- */
-typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
-typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
-struct _xmlSchemaAnnot {
-    struct _xmlSchemaAnnot *next;
-    xmlNodePtr content;         /* the annotation */
-};
-
-/**
- * XML_SCHEMAS_ANYATTR_SKIP:
- *
- * Skip unknown attribute from validation
- * Obsolete, not used anymore.
- */
-#define XML_SCHEMAS_ANYATTR_SKIP        1
-/**
- * XML_SCHEMAS_ANYATTR_LAX:
- *
- * Ignore validation non definition on attributes
- * Obsolete, not used anymore.
- */
-#define XML_SCHEMAS_ANYATTR_LAX                2
-/**
- * XML_SCHEMAS_ANYATTR_STRICT:
- *
- * Apply strict validation rules on attributes
- * Obsolete, not used anymore.
- */
-#define XML_SCHEMAS_ANYATTR_STRICT        3
-/**
- * XML_SCHEMAS_ANY_SKIP:
- *
- * Skip unknown attribute from validation
- */
-#define XML_SCHEMAS_ANY_SKIP        1
-/**
- * XML_SCHEMAS_ANY_LAX:
- *
- * Used by wildcards.
- * Validate if type found, don't worry if not found
- */
-#define XML_SCHEMAS_ANY_LAX                2
-/**
- * XML_SCHEMAS_ANY_STRICT:
- *
- * Used by wildcards.
- * Apply strict validation rules
- */
-#define XML_SCHEMAS_ANY_STRICT        3
-/**
- * XML_SCHEMAS_ATTR_USE_PROHIBITED:
- *
- * Used by wildcards.
- * The attribute is prohibited.
- */
-#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
-/**
- * XML_SCHEMAS_ATTR_USE_REQUIRED:
- *
- * The attribute is required.
- */
-#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
-/**
- * XML_SCHEMAS_ATTR_USE_OPTIONAL:
- *
- * The attribute is optional.
- */
-#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
-/**
- * XML_SCHEMAS_ATTR_GLOBAL:
- *
- * allow elements in no namespace
- */
-#define XML_SCHEMAS_ATTR_GLOBAL        1 << 0
-/**
- * XML_SCHEMAS_ATTR_NSDEFAULT:
- *
- * allow elements in no namespace
- */
-#define XML_SCHEMAS_ATTR_NSDEFAULT        1 << 7
-/**
- * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
- *
- * this is set when the "type" and "ref" references
- * have been resolved.
- */
-#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED        1 << 8
-/**
- * XML_SCHEMAS_ATTR_FIXED:
- *
- * the attribute has a fixed value
- */
-#define XML_SCHEMAS_ATTR_FIXED        1 << 9
-
-/**
- * xmlSchemaAttribute:
- * An attribute definition.
- */
-
-typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
-typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
-struct _xmlSchemaAttribute {
-    xmlSchemaTypeType type;
-    struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */
-    const xmlChar *name; /* the name of the declaration */
-    const xmlChar *id; /* Deprecated; not used */
-    const xmlChar *ref; /* Deprecated; not used */
-    const xmlChar *refNs; /* Deprecated; not used */
-    const xmlChar *typeName; /* the local name of the type definition */
-    const xmlChar *typeNs; /* the ns URI of the type definition */
-    xmlSchemaAnnotPtr annot;
-
-    xmlSchemaTypePtr base; /* Deprecated; not used */
-    int occurs; /* Deprecated; not used */
-    const xmlChar *defValue; /* The initial value of the value constraint */
-    xmlSchemaTypePtr subtypes; /* the type definition */
-    xmlNodePtr node;
-    const xmlChar *targetNamespace;
-    int flags;
-    const xmlChar *refPrefix; /* Deprecated; not used */
-    xmlSchemaValPtr defVal; /* The compiled value constraint */
-    xmlSchemaAttributePtr refDecl; /* Deprecated; not used */
-};
-
-/**
- * xmlSchemaAttributeLink:
- * Used to build a list of attribute uses on complexType definitions.
- * WARNING: Deprecated; not used.
- */
-typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
-typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
-struct _xmlSchemaAttributeLink {
-    struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
-    struct _xmlSchemaAttribute *attr;/* the linked attribute */
-};
-
-/**
- * XML_SCHEMAS_WILDCARD_COMPLETE:
- *
- * If the wildcard is complete.
- */
-#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
-
-/**
- * xmlSchemaCharValueLink:
- * Used to build a list of namespaces on wildcards.
- */
-typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
-typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
-struct _xmlSchemaWildcardNs {
-    struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
-    const xmlChar *value;/* the value */
-};
-
-/**
- * xmlSchemaWildcard.
- * A wildcard.
- */
-typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
-typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
-struct _xmlSchemaWildcard {
-    xmlSchemaTypeType type;        /* The kind of type */
-    const xmlChar *id; /* Deprecated; not used */
-    xmlSchemaAnnotPtr annot;
-    xmlNodePtr node;
-    int minOccurs; /* Deprecated; not used */
-    int maxOccurs; /* Deprecated; not used */
-    int processContents;
-    int any; /* Indicates if the ns constraint is of ##any */
-    xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
-    xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
-    int flags;
-};
-
-/**
- * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
- *
- * The attribute wildcard has been already builded.
- */
-#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
-/**
- * XML_SCHEMAS_ATTRGROUP_GLOBAL:
- *
- * The attribute wildcard has been already builded.
- */
-#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
-/**
- * XML_SCHEMAS_ATTRGROUP_MARKED:
- *
- * Marks the attr group as marked; used for circular checks.
- */
-#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
-
-/**
- * XML_SCHEMAS_ATTRGROUP_REDEFINED:
- *
- * The attr group was redefined.
- */
-#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
-/**
- * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
- *
- * Whether this attr. group contains attr. group references.
- */
-#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
-
-/**
- * An attribute group definition.
- *
- * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
- * must be kept similar
- */
-typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
-typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
-struct _xmlSchemaAttributeGroup {
-    xmlSchemaTypeType type;        /* The kind of type */
-    struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
-    const xmlChar *name;
-    const xmlChar *id;
-    const xmlChar *ref; /* Deprecated; not used */
-    const xmlChar *refNs; /* Deprecated; not used */
-    xmlSchemaAnnotPtr annot;
-
-    xmlSchemaAttributePtr attributes; /* Deprecated; not used */
-    xmlNodePtr node;
-    int flags;
-    xmlSchemaWildcardPtr attributeWildcard;
-    const xmlChar *refPrefix; /* Deprecated; not used */
-    xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */
-    const xmlChar *targetNamespace;
-    void *attrUses;
-};
-
-/**
- * xmlSchemaTypeLink:
- * Used to build a list of types (e.g. member types of
- * simpleType with variety "union").
- */
-typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
-typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
-struct _xmlSchemaTypeLink {
-    struct _xmlSchemaTypeLink *next;/* the next type link ... */
-    xmlSchemaTypePtr type;/* the linked type */
-};
-
-/**
- * xmlSchemaFacetLink:
- * Used to build a list of facets.
- */
-typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
-typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
-struct _xmlSchemaFacetLink {
-    struct _xmlSchemaFacetLink *next;/* the next facet link ... */
-    xmlSchemaFacetPtr facet;/* the linked facet */
-};
-
-/**
- * XML_SCHEMAS_TYPE_MIXED:
- *
- * the element content type is mixed
- */
-#define XML_SCHEMAS_TYPE_MIXED                1 << 0
-/**
- * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
- *
- * the simple or complex type has a derivation method of "extension".
- */
-#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                1 << 1
-/**
- * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
- *
- * the simple or complex type has a derivation method of "restriction".
- */
-#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                1 << 2
-/**
- * XML_SCHEMAS_TYPE_GLOBAL:
- *
- * the type is global
- */
-#define XML_SCHEMAS_TYPE_GLOBAL                1 << 3
-/**
- * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
- *
- * the complexType owns an attribute wildcard, i.e.
- * it can be freed by the complexType
- */
-#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD    1 << 4 /* Obsolete. */
-/**
- * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
- *
- * the simpleType has a variety of "absent".
- * TODO: Actually not necessary :-/, since if
- * none of the variety flags occur then it's
- * automatically absent.
- */
-#define XML_SCHEMAS_TYPE_VARIETY_ABSENT    1 << 5
-/**
- * XML_SCHEMAS_TYPE_VARIETY_LIST:
- *
- * the simpleType has a variety of "list".
- */
-#define XML_SCHEMAS_TYPE_VARIETY_LIST    1 << 6
-/**
- * XML_SCHEMAS_TYPE_VARIETY_UNION:
- *
- * the simpleType has a variety of "union".
- */
-#define XML_SCHEMAS_TYPE_VARIETY_UNION    1 << 7
-/**
- * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
- *
- * the simpleType has a variety of "union".
- */
-#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC    1 << 8
-/**
- * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
- *
- * the complexType has a final of "extension".
- */
-#define XML_SCHEMAS_TYPE_FINAL_EXTENSION    1 << 9
-/**
- * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
- *
- * the simpleType/complexType has a final of "restriction".
- */
-#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION    1 << 10
-/**
- * XML_SCHEMAS_TYPE_FINAL_LIST:
- *
- * the simpleType has a final of "list".
- */
-#define XML_SCHEMAS_TYPE_FINAL_LIST    1 << 11
-/**
- * XML_SCHEMAS_TYPE_FINAL_UNION:
- *
- * the simpleType has a final of "union".
- */
-#define XML_SCHEMAS_TYPE_FINAL_UNION    1 << 12
-/**
- * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
- *
- * the simpleType has a final of "default".
- */
-#define XML_SCHEMAS_TYPE_FINAL_DEFAULT    1 << 13
-/**
- * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
- *
- * Marks the item as a builtin primitive.
- */
-#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    1 << 14
-/**
- * XML_SCHEMAS_TYPE_MARKED:
- *
- * Marks the item as marked; used for circular checks.
- */
-#define XML_SCHEMAS_TYPE_MARKED        1 << 16
-/**
- * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
- *
- * the complexType did not specify 'block' so use the default of the
- * <schema> item.
- */
-#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT    1 << 17
-/**
- * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
- *
- * the complexType has a 'block' of "extension".
- */
-#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION    1 << 18
-/**
- * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
- *
- * the complexType has a 'block' of "restriction".
- */
-#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    1 << 19
-/**
- * XML_SCHEMAS_TYPE_ABSTRACT:
- *
- * the simple/complexType is abstract.
- */
-#define XML_SCHEMAS_TYPE_ABSTRACT    1 << 20
-/**
- * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
- *
- * indicates if the facets need a computed value
- */
-#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE    1 << 21
-/**
- * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
- *
- * indicates that the type was typefixed
- */
-#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    1 << 22
-/**
- * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
- *
- * indicates that the type is invalid
- */
-#define XML_SCHEMAS_TYPE_INTERNAL_INVALID    1 << 23
-/**
- * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
- *
- * a whitespace-facet value of "preserve"
- */
-#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    1 << 24
-/**
- * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
- *
- * a whitespace-facet value of "replace"
- */
-#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    1 << 25
-/**
- * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
- *
- * a whitespace-facet value of "collapse"
- */
-#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    1 << 26
-/**
- * XML_SCHEMAS_TYPE_HAS_FACETS:
- *
- * has facets
- */
-#define XML_SCHEMAS_TYPE_HAS_FACETS    1 << 27
-/**
- * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
- *
- * indicates if the facets (pattern) need a normalized value
- */
-#define XML_SCHEMAS_TYPE_NORMVALUENEEDED    1 << 28
-
-/**
- * XML_SCHEMAS_TYPE_FIXUP_1:
- *
- * First stage of fixup was done.
- */
-#define XML_SCHEMAS_TYPE_FIXUP_1    1 << 29
-
-/**
- * XML_SCHEMAS_TYPE_REDEFINED:
- *
- * The type was redefined.
- */
-#define XML_SCHEMAS_TYPE_REDEFINED    1 << 30
-/**
- * XML_SCHEMAS_TYPE_REDEFINING:
- *
- * The type redefines an other type.
- */
-/* #define XML_SCHEMAS_TYPE_REDEFINING    1 << 31 */
-
-/**
- * _xmlSchemaType:
- *
- * Schemas type definition.
- */
-struct _xmlSchemaType {
-    xmlSchemaTypeType type; /* The kind of type */
-    struct _xmlSchemaType *next; /* the next type if in a sequence ... */
-    const xmlChar *name;
-    const xmlChar *id ; /* Deprecated; not used */
-    const xmlChar *ref; /* Deprecated; not used */
-    const xmlChar *refNs; /* Deprecated; not used */
-    xmlSchemaAnnotPtr annot;
-    xmlSchemaTypePtr subtypes;
-    xmlSchemaAttributePtr attributes; /* Deprecated; not used */
-    xmlNodePtr node;
-    int minOccurs; /* Deprecated; not used */
-    int maxOccurs; /* Deprecated; not used */
-
-    int flags;
-    xmlSchemaContentType contentType;
-    const xmlChar *base; /* Base type's local name */
-    const xmlChar *baseNs; /* Base type's target namespace */
-    xmlSchemaTypePtr baseType; /* The base type component */
-    xmlSchemaFacetPtr facets; /* Local facets */
-    struct _xmlSchemaType *redef; /* Deprecated; not used */
-    int recurse; /* Obsolete */
-    xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */
-    xmlSchemaWildcardPtr attributeWildcard;
-    int builtInType; /* Type of built-in types. */
-    xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */
-    xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */
-    const xmlChar *refPrefix; /* Deprecated; not used */
-    xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.
-                                        Could we use @subtypes for this? */
-    xmlRegexpPtr contModel; /* Holds the automaton of the content model */
-    const xmlChar *targetNamespace;
-    void *attrUses;
-};
-
-/*
- * xmlSchemaElement:
- * An element definition.
- *
- * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
- * structures must be kept similar
- */
-/**
- * XML_SCHEMAS_ELEM_NILLABLE:
- *
- * the element is nillable
- */
-#define XML_SCHEMAS_ELEM_NILLABLE        1 << 0
-/**
- * XML_SCHEMAS_ELEM_GLOBAL:
- *
- * the element is global
- */
-#define XML_SCHEMAS_ELEM_GLOBAL                1 << 1
-/**
- * XML_SCHEMAS_ELEM_DEFAULT:
- *
- * the element has a default value
- */
-#define XML_SCHEMAS_ELEM_DEFAULT        1 << 2
-/**
- * XML_SCHEMAS_ELEM_FIXED:
- *
- * the element has a fixed value
- */
-#define XML_SCHEMAS_ELEM_FIXED                1 << 3
-/**
- * XML_SCHEMAS_ELEM_ABSTRACT:
- *
- * the element is abstract
- */
-#define XML_SCHEMAS_ELEM_ABSTRACT        1 << 4
-/**
- * XML_SCHEMAS_ELEM_TOPLEVEL:
- *
- * the element is top level
- * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
- */
-#define XML_SCHEMAS_ELEM_TOPLEVEL        1 << 5
-/**
- * XML_SCHEMAS_ELEM_REF:
- *
- * the element is a reference to a type
- */
-#define XML_SCHEMAS_ELEM_REF                1 << 6
-/**
- * XML_SCHEMAS_ELEM_NSDEFAULT:
- *
- * allow elements in no namespace
- * Obsolete, not used anymore.
- */
-#define XML_SCHEMAS_ELEM_NSDEFAULT        1 << 7
-/**
- * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
- *
- * this is set when "type", "ref", "substitutionGroup"
- * references have been resolved.
- */
-#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        1 << 8
- /**
- * XML_SCHEMAS_ELEM_CIRCULAR:
- *
- * a helper flag for the search of circular references.
- */
-#define XML_SCHEMAS_ELEM_CIRCULAR        1 << 9
-/**
- * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
- *
- * the "block" attribute is absent
- */
-#define XML_SCHEMAS_ELEM_BLOCK_ABSENT        1 << 10
-/**
- * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
- *
- * disallowed substitutions are absent
- */
-#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION        1 << 11
-/**
- * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
- *
- * disallowed substitutions: "restriction"
- */
-#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        1 << 12
-/**
- * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
- *
- * disallowed substitutions: "substituion"
- */
-#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        1 << 13
-/**
- * XML_SCHEMAS_ELEM_FINAL_ABSENT:
- *
- * substitution group exclusions are absent
- */
-#define XML_SCHEMAS_ELEM_FINAL_ABSENT        1 << 14
-/**
- * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
- *
- * substitution group exclusions: "extension"
- */
-#define XML_SCHEMAS_ELEM_FINAL_EXTENSION        1 << 15
-/**
- * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
- *
- * substitution group exclusions: "restriction"
- */
-#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION        1 << 16
-/**
- * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
- *
- * the declaration is a substitution group head
- */
-#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        1 << 17
-/**
- * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
- *
- * this is set when the elem decl has been checked against
- * all constraints
- */
-#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED        1 << 18
-
-typedef struct _xmlSchemaElement xmlSchemaElement;
-typedef xmlSchemaElement *xmlSchemaElementPtr;
-struct _xmlSchemaElement {
-    xmlSchemaTypeType type; /* The kind of type */
-    struct _xmlSchemaType *next; /* Not used? */
-    const xmlChar *name;
-    const xmlChar *id; /* Deprecated; not used */
-    const xmlChar *ref; /* Deprecated; not used */
-    const xmlChar *refNs; /* Deprecated; not used */
-    xmlSchemaAnnotPtr annot;
-    xmlSchemaTypePtr subtypes; /* the type definition */
-    xmlSchemaAttributePtr attributes;
-    xmlNodePtr node;
-    int minOccurs; /* Deprecated; not used */
-    int maxOccurs; /* Deprecated; not used */
-
-    int flags;
-    const xmlChar *targetNamespace;
-    const xmlChar *namedType;
-    const xmlChar *namedTypeNs;
-    const xmlChar *substGroup;
-    const xmlChar *substGroupNs;
-    const xmlChar *scope;
-    const xmlChar *value; /* The original value of the value constraint. */
-    struct _xmlSchemaElement *refDecl; /* This will now be used for the
-                                          substitution group affiliation */
-    xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */
-    xmlSchemaContentType contentType;
-    const xmlChar *refPrefix; /* Deprecated; not used */
-    xmlSchemaValPtr defVal; /* The compiled value contraint. */
-    void *idcs; /* The identity-constraint defs */
-};
-
-/*
- * XML_SCHEMAS_FACET_UNKNOWN:
- *
- * unknown facet handling
- */
-#define XML_SCHEMAS_FACET_UNKNOWN        0
-/*
- * XML_SCHEMAS_FACET_PRESERVE:
- *
- * preserve the type of the facet
- */
-#define XML_SCHEMAS_FACET_PRESERVE        1
-/*
- * XML_SCHEMAS_FACET_REPLACE:
- *
- * replace the type of the facet
- */
-#define XML_SCHEMAS_FACET_REPLACE        2
-/*
- * XML_SCHEMAS_FACET_COLLAPSE:
- *
- * collapse the types of the facet
- */
-#define XML_SCHEMAS_FACET_COLLAPSE        3
-/**
- * A facet definition.
- */
-struct _xmlSchemaFacet {
-    xmlSchemaTypeType type;        /* The kind of type */
-    struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
-    const xmlChar *value; /* The original value */
-    const xmlChar *id; /* Obsolete */
-    xmlSchemaAnnotPtr annot;
-    xmlNodePtr node;
-    int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */
-    int whitespace;
-    xmlSchemaValPtr val; /* The compiled value */
-    xmlRegexpPtr    regexp; /* The regex for patterns */
-};
-
-/**
- * A notation definition.
- */
-typedef struct _xmlSchemaNotation xmlSchemaNotation;
-typedef xmlSchemaNotation *xmlSchemaNotationPtr;
-struct _xmlSchemaNotation {
-    xmlSchemaTypeType type; /* The kind of type */
-    const xmlChar *name;
-    xmlSchemaAnnotPtr annot;
-    const xmlChar *identifier;
-    const xmlChar *targetNamespace;
-};
-
-/*
-* TODO: Actually all those flags used for the schema should sit
-* on the schema parser context, since they are used only
-* during parsing an XML schema document, and not available
-* on the component level as per spec.
-*/
-/**
- * XML_SCHEMAS_QUALIF_ELEM:
- *
- * Reflects elementFormDefault == qualified in
- * an XML schema document.
- */
-#define XML_SCHEMAS_QUALIF_ELEM                1 << 0
-/**
- * XML_SCHEMAS_QUALIF_ATTR:
- *
- * Reflects attributeFormDefault == qualified in
- * an XML schema document.
- */
-#define XML_SCHEMAS_QUALIF_ATTR            1 << 1
-/**
- * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
- *
- * the schema has "extension" in the set of finalDefault.
- */
-#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        1 << 2
-/**
- * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
- *
- * the schema has "restriction" in the set of finalDefault.
- */
-#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            1 << 3
-/**
- * XML_SCHEMAS_FINAL_DEFAULT_LIST:
- *
- * the cshema has "list" in the set of finalDefault.
- */
-#define XML_SCHEMAS_FINAL_DEFAULT_LIST            1 << 4
-/**
- * XML_SCHEMAS_FINAL_DEFAULT_UNION:
- *
- * the schema has "union" in the set of finalDefault.
- */
-#define XML_SCHEMAS_FINAL_DEFAULT_UNION            1 << 5
-/**
- * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
- *
- * the schema has "extension" in the set of blockDefault.
- */
-#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            1 << 6
-/**
- * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
- *
- * the schema has "restriction" in the set of blockDefault.
- */
-#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            1 << 7
-/**
- * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
- *
- * the schema has "substitution" in the set of blockDefault.
- */
-#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            1 << 8
-/**
- * XML_SCHEMAS_INCLUDING_CONVERT_NS:
- *
- * the schema is currently including an other schema with
- * no target namespace.
- */
-#define XML_SCHEMAS_INCLUDING_CONVERT_NS            1 << 9
-/**
- * _xmlSchema:
- *
- * A Schemas definition
- */
-struct _xmlSchema {
-    const xmlChar *name; /* schema name */
-    const xmlChar *targetNamespace; /* the target namespace */
-    const xmlChar *version;
-    const xmlChar *id; /* Obsolete */
-    xmlDocPtr doc;
-    xmlSchemaAnnotPtr annot;
-    int flags;
-
-    xmlHashTablePtr typeDecl;
-    xmlHashTablePtr attrDecl;
-    xmlHashTablePtr attrgrpDecl;
-    xmlHashTablePtr elemDecl;
-    xmlHashTablePtr notaDecl;
-
-    xmlHashTablePtr schemasImports;
-
-    void *_private;        /* unused by the library for users or bindings */
-    xmlHashTablePtr groupDecl;
-    xmlDictPtr      dict;
-    void *includes;     /* the includes, this is opaque for now */
-    int preserve;        /* whether to free the document */
-    int counter; /* used to give ononymous components unique names */
-    xmlHashTablePtr idcDef; /* All identity-constraint defs. */
-    void *volatiles; /* Obsolete */
-};
-
-XMLPUBFUN void XMLCALL         xmlSchemaFreeType        (xmlSchemaTypePtr type);
-XMLPUBFUN void XMLCALL         xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_SCHEMAS_ENABLED */
-#endif /* __XML_SCHEMA_INTERNALS_H__ */
diff --git a/interfaces/ext/libxml/schematron.h b/interfaces/ext/libxml/schematron.h
deleted file mode 100644
index f442826..0000000
--- a/interfaces/ext/libxml/schematron.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Summary: XML Schemastron implementation
- * Description: interface to the XML Schematron validity checking.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SCHEMATRON_H__
-#define __XML_SCHEMATRON_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_SCHEMATRON_ENABLED
-
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    XML_SCHEMATRON_OUT_QUIET = 1 << 0,	/* quiet no report */
-    XML_SCHEMATRON_OUT_TEXT = 1 << 1,	/* build a textual report */
-    XML_SCHEMATRON_OUT_XML = 1 << 2,	/* output SVRL */
-    XML_SCHEMATRON_OUT_ERROR = 1 << 3,  /* output via xmlStructuredErrorFunc */
-    XML_SCHEMATRON_OUT_FILE = 1 << 8,	/* output to a file descriptor */
-    XML_SCHEMATRON_OUT_BUFFER = 1 << 9,	/* output to a buffer */
-    XML_SCHEMATRON_OUT_IO = 1 << 10	/* output to I/O mechanism */
-} xmlSchematronValidOptions;
-
-/**
- * The schemas related types are kept internal
- */
-typedef struct _xmlSchematron xmlSchematron;
-typedef xmlSchematron *xmlSchematronPtr;
-
-/**
- * xmlSchematronValidityErrorFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of an error callback from a Schematron validation
- */
-typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
-
-/**
- * xmlSchematronValidityWarningFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of a warning callback from a Schematron validation
- */
-typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
-
-/**
- * A schemas validation context
- */
-typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
-typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
-
-typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
-typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
-
-/*
- * Interfaces for parsing.
- */
-XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL 
-	    xmlSchematronNewParserCtxt	(const char *URL);
-XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL 
-	    xmlSchematronNewMemParserCtxt(const char *buffer,
-					 int size);
-XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
-	    xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL		
-	    xmlSchematronFreeParserCtxt	(xmlSchematronParserCtxtPtr ctxt);
-/*****
-XMLPUBFUN void XMLCALL		
-	    xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
-					 xmlSchematronValidityErrorFunc err,
-					 xmlSchematronValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-		xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
-					xmlSchematronValidityErrorFunc * err,
-					xmlSchematronValidityWarningFunc * warn,
-					void **ctx);
-XMLPUBFUN int XMLCALL
-		xmlSchematronIsValid	(xmlSchematronValidCtxtPtr ctxt);
- *****/
-XMLPUBFUN xmlSchematronPtr XMLCALL	
-	    xmlSchematronParse		(xmlSchematronParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL		
-	    xmlSchematronFree		(xmlSchematronPtr schema);
-/*
- * Interfaces for validating
- */
-XMLPUBFUN void XMLCALL
-	    xmlSchematronSetValidStructuredErrors(
-	                                  xmlSchematronValidCtxtPtr ctxt,
-					  xmlStructuredErrorFunc serror,
-					  void *ctx);
-/******
-XMLPUBFUN void XMLCALL		
-	    xmlSchematronSetValidErrors	(xmlSchematronValidCtxtPtr ctxt,
-					 xmlSchematronValidityErrorFunc err,
-					 xmlSchematronValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-	    xmlSchematronGetValidErrors	(xmlSchematronValidCtxtPtr ctxt,
-					 xmlSchematronValidityErrorFunc *err,
-					 xmlSchematronValidityWarningFunc *warn,
-					 void **ctx);
-XMLPUBFUN int XMLCALL
-	    xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
-					 int options);
-XMLPUBFUN int XMLCALL
-	    xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-            xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
-			                 xmlNodePtr elem);
- *******/
-
-XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL	
-	    xmlSchematronNewValidCtxt	(xmlSchematronPtr schema,
-	    				 int options);
-XMLPUBFUN void XMLCALL			
-	    xmlSchematronFreeValidCtxt	(xmlSchematronValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL			
-	    xmlSchematronValidateDoc	(xmlSchematronValidCtxtPtr ctxt,
-					 xmlDocPtr instance);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_SCHEMATRON_ENABLED */
-#endif /* __XML_SCHEMATRON_H__ */
diff --git a/interfaces/ext/libxml/threads.h b/interfaces/ext/libxml/threads.h
deleted file mode 100644
index d31f16a..0000000
--- a/interfaces/ext/libxml/threads.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Summary: interfaces for thread handling
- * Description: set of generic threading related routines
- *              should work with pthreads, Windows native or TLS threads
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_THREADS_H__
-#define __XML_THREADS_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * xmlMutex are a simple mutual exception locks.
- */
-typedef struct _xmlMutex xmlMutex;
-typedef xmlMutex *xmlMutexPtr;
-
-/*
- * xmlRMutex are reentrant mutual exception locks.
- */
-typedef struct _xmlRMutex xmlRMutex;
-typedef xmlRMutex *xmlRMutexPtr;
-
-#ifdef __cplusplus
-}
-#endif
-#include <libxml/globals.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-XMLPUBFUN xmlMutexPtr XMLCALL
-			xmlNewMutex	(void);
-XMLPUBFUN void XMLCALL
-			xmlMutexLock	(xmlMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlMutexUnlock	(xmlMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlFreeMutex	(xmlMutexPtr tok);
-
-XMLPUBFUN xmlRMutexPtr XMLCALL
-			xmlNewRMutex	(void);
-XMLPUBFUN void XMLCALL
-			xmlRMutexLock	(xmlRMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlRMutexUnlock	(xmlRMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlFreeRMutex	(xmlRMutexPtr tok);
-
-/*
- * Library wide APIs.
- */
-XMLPUBFUN void XMLCALL
-			xmlInitThreads	(void);
-XMLPUBFUN void XMLCALL
-			xmlLockLibrary	(void);
-XMLPUBFUN void XMLCALL
-			xmlUnlockLibrary(void);
-XMLPUBFUN int XMLCALL
-			xmlGetThreadId	(void);
-XMLPUBFUN int XMLCALL
-			xmlIsMainThread	(void);
-XMLPUBFUN void XMLCALL
-			xmlCleanupThreads(void);
-XMLPUBFUN xmlGlobalStatePtr XMLCALL
-			xmlGetGlobalState(void);
-
-#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
-int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __XML_THREADS_H__ */
diff --git a/interfaces/ext/libxml/tree.h b/interfaces/ext/libxml/tree.h
deleted file mode 100644
index b733589..0000000
--- a/interfaces/ext/libxml/tree.h
+++ /dev/null
@@ -1,1252 +0,0 @@
-/*
- * Summary: interfaces for tree manipulation
- * Description: this module describes the structures found in an tree resulting
- *              from an XML or HTML parsing, as well as the API provided for
- *              various processing on that tree
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_TREE_H__
-#define __XML_TREE_H__
-
-#include <stdio.h>
-#include <libxml/xmlversion.h>
-#include <libxml/xmlstring.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Some of the basic types pointer to structures:
- */
-/* xmlIO.h */
-typedef struct _xmlParserInputBuffer xmlParserInputBuffer;
-typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
-
-typedef struct _xmlOutputBuffer xmlOutputBuffer;
-typedef xmlOutputBuffer *xmlOutputBufferPtr;
-
-/* parser.h */
-typedef struct _xmlParserInput xmlParserInput;
-typedef xmlParserInput *xmlParserInputPtr;
-
-typedef struct _xmlParserCtxt xmlParserCtxt;
-typedef xmlParserCtxt *xmlParserCtxtPtr;
-
-typedef struct _xmlSAXLocator xmlSAXLocator;
-typedef xmlSAXLocator *xmlSAXLocatorPtr;
-
-typedef struct _xmlSAXHandler xmlSAXHandler;
-typedef xmlSAXHandler *xmlSAXHandlerPtr;
-
-/* entities.h */
-typedef struct _xmlEntity xmlEntity;
-typedef xmlEntity *xmlEntityPtr;
-
-/**
- * BASE_BUFFER_SIZE:
- *
- * default buffer size 4000.
- */
-#define BASE_BUFFER_SIZE 4096
-
-/**
- * LIBXML_NAMESPACE_DICT:
- *
- * Defines experimental behaviour:
- * 1) xmlNs gets an additional field @context (a xmlDoc)
- * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc.
- */
-/* #define LIBXML_NAMESPACE_DICT */
-
-/**
- * xmlBufferAllocationScheme:
- *
- * A buffer allocation scheme can be defined to either match exactly the
- * need or double it's allocated size each time it is found too small.
- */
-
-typedef enum {
-    XML_BUFFER_ALLOC_DOUBLEIT,	/* double each time one need to grow */
-    XML_BUFFER_ALLOC_EXACT,	/* grow only to the minimal size */
-    XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */
-    XML_BUFFER_ALLOC_IO		/* special allocation scheme used for I/O */
-} xmlBufferAllocationScheme;
-
-/**
- * xmlBuffer:
- *
- * A buffer structure.
- */
-typedef struct _xmlBuffer xmlBuffer;
-typedef xmlBuffer *xmlBufferPtr;
-struct _xmlBuffer {
-    xmlChar *content;		/* The buffer content UTF8 */
-    unsigned int use;		/* The buffer size used */
-    unsigned int size;		/* The buffer size */
-    xmlBufferAllocationScheme alloc; /* The realloc method */
-    xmlChar *contentIO;		/* in IO mode we may have a different base */
-};
-
-/**
- * XML_XML_NAMESPACE:
- *
- * This is the namespace for the special xml: prefix predefined in the
- * XML Namespace specification.
- */
-#define XML_XML_NAMESPACE \
-    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
-
-/**
- * XML_XML_ID:
- *
- * This is the name for the special xml:id attribute
- */
-#define XML_XML_ID (const xmlChar *) "xml:id"
-
-/*
- * The different element types carried by an XML tree.
- *
- * NOTE: This is synchronized with DOM Level1 values
- *       See http://www.w3.org/TR/REC-DOM-Level-1/
- *
- * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
- * be deprecated to use an XML_DTD_NODE.
- */
-typedef enum {
-    XML_ELEMENT_NODE=		1,
-    XML_ATTRIBUTE_NODE=		2,
-    XML_TEXT_NODE=		3,
-    XML_CDATA_SECTION_NODE=	4,
-    XML_ENTITY_REF_NODE=	5,
-    XML_ENTITY_NODE=		6,
-    XML_PI_NODE=		7,
-    XML_COMMENT_NODE=		8,
-    XML_DOCUMENT_NODE=		9,
-    XML_DOCUMENT_TYPE_NODE=	10,
-    XML_DOCUMENT_FRAG_NODE=	11,
-    XML_NOTATION_NODE=		12,
-    XML_HTML_DOCUMENT_NODE=	13,
-    XML_DTD_NODE=		14,
-    XML_ELEMENT_DECL=		15,
-    XML_ATTRIBUTE_DECL=		16,
-    XML_ENTITY_DECL=		17,
-    XML_NAMESPACE_DECL=		18,
-    XML_XINCLUDE_START=		19,
-    XML_XINCLUDE_END=		20
-#ifdef LIBXML_DOCB_ENABLED
-   ,XML_DOCB_DOCUMENT_NODE=	21
-#endif
-} xmlElementType;
-
-
-/**
- * xmlNotation:
- *
- * A DTD Notation definition.
- */
-
-typedef struct _xmlNotation xmlNotation;
-typedef xmlNotation *xmlNotationPtr;
-struct _xmlNotation {
-    const xmlChar               *name;	        /* Notation name */
-    const xmlChar               *PublicID;	/* Public identifier, if any */
-    const xmlChar               *SystemID;	/* System identifier, if any */
-};
-
-/**
- * xmlAttributeType:
- *
- * A DTD Attribute type definition.
- */
-
-typedef enum {
-    XML_ATTRIBUTE_CDATA = 1,
-    XML_ATTRIBUTE_ID,
-    XML_ATTRIBUTE_IDREF	,
-    XML_ATTRIBUTE_IDREFS,
-    XML_ATTRIBUTE_ENTITY,
-    XML_ATTRIBUTE_ENTITIES,
-    XML_ATTRIBUTE_NMTOKEN,
-    XML_ATTRIBUTE_NMTOKENS,
-    XML_ATTRIBUTE_ENUMERATION,
-    XML_ATTRIBUTE_NOTATION
-} xmlAttributeType;
-
-/**
- * xmlAttributeDefault:
- *
- * A DTD Attribute default definition.
- */
-
-typedef enum {
-    XML_ATTRIBUTE_NONE = 1,
-    XML_ATTRIBUTE_REQUIRED,
-    XML_ATTRIBUTE_IMPLIED,
-    XML_ATTRIBUTE_FIXED
-} xmlAttributeDefault;
-
-/**
- * xmlEnumeration:
- *
- * List structure used when there is an enumeration in DTDs.
- */
-
-typedef struct _xmlEnumeration xmlEnumeration;
-typedef xmlEnumeration *xmlEnumerationPtr;
-struct _xmlEnumeration {
-    struct _xmlEnumeration    *next;	/* next one */
-    const xmlChar            *name;	/* Enumeration name */
-};
-
-/**
- * xmlAttribute:
- *
- * An Attribute declaration in a DTD.
- */
-
-typedef struct _xmlAttribute xmlAttribute;
-typedef xmlAttribute *xmlAttributePtr;
-struct _xmlAttribute {
-    void           *_private;	        /* application data */
-    xmlElementType          type;       /* XML_ATTRIBUTE_DECL, must be second ! */
-    const xmlChar          *name;	/* Attribute name */
-    struct _xmlNode    *children;	/* NULL */
-    struct _xmlNode        *last;	/* NULL */
-    struct _xmlDtd       *parent;	/* -> DTD */
-    struct _xmlNode        *next;	/* next sibling link  */
-    struct _xmlNode        *prev;	/* previous sibling link  */
-    struct _xmlDoc          *doc;       /* the containing document */
-
-    struct _xmlAttribute  *nexth;	/* next in hash table */
-    xmlAttributeType       atype;	/* The attribute type */
-    xmlAttributeDefault      def;	/* the default */
-    const xmlChar  *defaultValue;	/* or the default value */
-    xmlEnumerationPtr       tree;       /* or the enumeration tree if any */
-    const xmlChar        *prefix;	/* the namespace prefix if any */
-    const xmlChar          *elem;	/* Element holding the attribute */
-};
-
-/**
- * xmlElementContentType:
- *
- * Possible definitions of element content types.
- */
-typedef enum {
-    XML_ELEMENT_CONTENT_PCDATA = 1,
-    XML_ELEMENT_CONTENT_ELEMENT,
-    XML_ELEMENT_CONTENT_SEQ,
-    XML_ELEMENT_CONTENT_OR
-} xmlElementContentType;
-
-/**
- * xmlElementContentOccur:
- *
- * Possible definitions of element content occurrences.
- */
-typedef enum {
-    XML_ELEMENT_CONTENT_ONCE = 1,
-    XML_ELEMENT_CONTENT_OPT,
-    XML_ELEMENT_CONTENT_MULT,
-    XML_ELEMENT_CONTENT_PLUS
-} xmlElementContentOccur;
-
-/**
- * xmlElementContent:
- *
- * An XML Element content as stored after parsing an element definition
- * in a DTD.
- */
-
-typedef struct _xmlElementContent xmlElementContent;
-typedef xmlElementContent *xmlElementContentPtr;
-struct _xmlElementContent {
-    xmlElementContentType     type;	/* PCDATA, ELEMENT, SEQ or OR */
-    xmlElementContentOccur    ocur;	/* ONCE, OPT, MULT or PLUS */
-    const xmlChar             *name;	/* Element name */
-    struct _xmlElementContent *c1;	/* first child */
-    struct _xmlElementContent *c2;	/* second child */
-    struct _xmlElementContent *parent;	/* parent */
-    const xmlChar             *prefix;	/* Namespace prefix */
-};
-
-/**
- * xmlElementTypeVal:
- *
- * The different possibilities for an element content type.
- */
-
-typedef enum {
-    XML_ELEMENT_TYPE_UNDEFINED = 0,
-    XML_ELEMENT_TYPE_EMPTY = 1,
-    XML_ELEMENT_TYPE_ANY,
-    XML_ELEMENT_TYPE_MIXED,
-    XML_ELEMENT_TYPE_ELEMENT
-} xmlElementTypeVal;
-
-#ifdef __cplusplus
-}
-#endif
-#include <libxml/xmlregexp.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlElement:
- *
- * An XML Element declaration from a DTD.
- */
-
-typedef struct _xmlElement xmlElement;
-typedef xmlElement *xmlElementPtr;
-struct _xmlElement {
-    void           *_private;	        /* application data */
-    xmlElementType          type;       /* XML_ELEMENT_DECL, must be second ! */
-    const xmlChar          *name;	/* Element name */
-    struct _xmlNode    *children;	/* NULL */
-    struct _xmlNode        *last;	/* NULL */
-    struct _xmlDtd       *parent;	/* -> DTD */
-    struct _xmlNode        *next;	/* next sibling link  */
-    struct _xmlNode        *prev;	/* previous sibling link  */
-    struct _xmlDoc          *doc;       /* the containing document */
-
-    xmlElementTypeVal      etype;	/* The type */
-    xmlElementContentPtr content;	/* the allowed element content */
-    xmlAttributePtr   attributes;	/* List of the declared attributes */
-    const xmlChar        *prefix;	/* the namespace prefix if any */
-#ifdef LIBXML_REGEXP_ENABLED
-    xmlRegexpPtr       contModel;	/* the validating regexp */
-#else
-    void	      *contModel;
-#endif
-};
-
-
-/**
- * XML_LOCAL_NAMESPACE:
- *
- * A namespace declaration node.
- */
-#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
-typedef xmlElementType xmlNsType;
-
-/**
- * xmlNs:
- *
- * An XML namespace.
- * Note that prefix == NULL is valid, it defines the default namespace
- * within the subtree (until overridden).
- *
- * xmlNsType is unified with xmlElementType.
- */
-
-typedef struct _xmlNs xmlNs;
-typedef xmlNs *xmlNsPtr;
-struct _xmlNs {
-    struct _xmlNs  *next;	/* next Ns link for this node  */
-    xmlNsType      type;	/* global or local */
-    const xmlChar *href;	/* URL for the namespace */
-    const xmlChar *prefix;	/* prefix for the namespace */
-    void           *_private;   /* application data */
-    struct _xmlDoc *context;		/* normally an xmlDoc */
-};
-
-/**
- * xmlDtd:
- *
- * An XML DTD, as defined by <!DOCTYPE ... There is actually one for
- * the internal subset and for the external subset.
- */
-typedef struct _xmlDtd xmlDtd;
-typedef xmlDtd *xmlDtdPtr;
-struct _xmlDtd {
-    void           *_private;	/* application data */
-    xmlElementType  type;       /* XML_DTD_NODE, must be second ! */
-    const xmlChar *name;	/* Name of the DTD */
-    struct _xmlNode *children;	/* the value of the property link */
-    struct _xmlNode *last;	/* last child link */
-    struct _xmlDoc  *parent;	/* child->parent link */
-    struct _xmlNode *next;	/* next sibling link  */
-    struct _xmlNode *prev;	/* previous sibling link  */
-    struct _xmlDoc  *doc;	/* the containing document */
-
-    /* End of common part */
-    void          *notations;   /* Hash table for notations if any */
-    void          *elements;    /* Hash table for elements if any */
-    void          *attributes;  /* Hash table for attributes if any */
-    void          *entities;    /* Hash table for entities if any */
-    const xmlChar *ExternalID;	/* External identifier for PUBLIC DTD */
-    const xmlChar *SystemID;	/* URI for a SYSTEM or PUBLIC DTD */
-    void          *pentities;   /* Hash table for param entities if any */
-};
-
-/**
- * xmlAttr:
- *
- * An attribute on an XML node.
- */
-typedef struct _xmlAttr xmlAttr;
-typedef xmlAttr *xmlAttrPtr;
-struct _xmlAttr {
-    void           *_private;	/* application data */
-    xmlElementType   type;      /* XML_ATTRIBUTE_NODE, must be second ! */
-    const xmlChar   *name;      /* the name of the property */
-    struct _xmlNode *children;	/* the value of the property */
-    struct _xmlNode *last;	/* NULL */
-    struct _xmlNode *parent;	/* child->parent link */
-    struct _xmlAttr *next;	/* next sibling link  */
-    struct _xmlAttr *prev;	/* previous sibling link  */
-    struct _xmlDoc  *doc;	/* the containing document */
-    xmlNs           *ns;        /* pointer to the associated namespace */
-    xmlAttributeType atype;     /* the attribute type if validating */
-    void            *psvi;	/* for type/PSVI informations */
-};
-
-/**
- * xmlID:
- *
- * An XML ID instance.
- */
-
-typedef struct _xmlID xmlID;
-typedef xmlID *xmlIDPtr;
-struct _xmlID {
-    struct _xmlID    *next;	/* next ID */
-    const xmlChar    *value;	/* The ID name */
-    xmlAttrPtr        attr;	/* The attribute holding it */
-    const xmlChar    *name;	/* The attribute if attr is not available */
-    int               lineno;	/* The line number if attr is not available */
-    struct _xmlDoc   *doc;	/* The document holding the ID */
-};
-
-/**
- * xmlRef:
- *
- * An XML IDREF instance.
- */
-
-typedef struct _xmlRef xmlRef;
-typedef xmlRef *xmlRefPtr;
-struct _xmlRef {
-    struct _xmlRef    *next;	/* next Ref */
-    const xmlChar     *value;	/* The Ref name */
-    xmlAttrPtr        attr;	/* The attribute holding it */
-    const xmlChar    *name;	/* The attribute if attr is not available */
-    int               lineno;	/* The line number if attr is not available */
-};
-
-/**
- * xmlNode:
- *
- * A node in an XML tree.
- */
-typedef struct _xmlNode xmlNode;
-typedef xmlNode *xmlNodePtr;
-struct _xmlNode {
-    void           *_private;	/* application data */
-    xmlElementType   type;	/* type number, must be second ! */
-    const xmlChar   *name;      /* the name of the node, or the entity */
-    struct _xmlNode *children;	/* parent->childs link */
-    struct _xmlNode *last;	/* last child link */
-    struct _xmlNode *parent;	/* child->parent link */
-    struct _xmlNode *next;	/* next sibling link  */
-    struct _xmlNode *prev;	/* previous sibling link  */
-    struct _xmlDoc  *doc;	/* the containing document */
-
-    /* End of common part */
-    xmlNs           *ns;        /* pointer to the associated namespace */
-    xmlChar         *content;   /* the content */
-    struct _xmlAttr *properties;/* properties list */
-    xmlNs           *nsDef;     /* namespace definitions on this node */
-    void            *psvi;	/* for type/PSVI informations */
-    unsigned short   line;	/* line number */
-    unsigned short   extra;	/* extra data for XPath/XSLT */
-};
-
-/**
- * XML_GET_CONTENT:
- *
- * Macro to extract the content pointer of a node.
- */
-#define XML_GET_CONTENT(n)					\
-    ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content)
-
-/**
- * XML_GET_LINE:
- *
- * Macro to extract the line number of an element node. 
- */
-#define XML_GET_LINE(n)						\
-    (xmlGetLineNo(n))
-
-/**
- * xmlDocProperty
- *
- * Set of properties of the document as found by the parser
- * Some of them are linked to similary named xmlParserOption
- */
-typedef enum {
-    XML_DOC_WELLFORMED		= 1<<0, /* document is XML well formed */
-    XML_DOC_NSVALID		= 1<<1, /* document is Namespace valid */
-    XML_DOC_OLD10		= 1<<2, /* parsed with old XML-1.0 parser */
-    XML_DOC_DTDVALID		= 1<<3, /* DTD validation was successful */
-    XML_DOC_XINCLUDE		= 1<<4, /* XInclude substitution was done */
-    XML_DOC_USERBUILT		= 1<<5, /* Document was built using the API
-                                           and not by parsing an instance */
-    XML_DOC_INTERNAL		= 1<<6, /* built for internal processing */
-    XML_DOC_HTML		= 1<<7  /* parsed or built HTML document */
-} xmlDocProperties;
-
-/**
- * xmlDoc:
- *
- * An XML document.
- */
-typedef struct _xmlDoc xmlDoc;
-typedef xmlDoc *xmlDocPtr;
-struct _xmlDoc {
-    void           *_private;	/* application data */
-    xmlElementType  type;       /* XML_DOCUMENT_NODE, must be second ! */
-    char           *name;	/* name/filename/URI of the document */
-    struct _xmlNode *children;	/* the document tree */
-    struct _xmlNode *last;	/* last child link */
-    struct _xmlNode *parent;	/* child->parent link */
-    struct _xmlNode *next;	/* next sibling link  */
-    struct _xmlNode *prev;	/* previous sibling link  */
-    struct _xmlDoc  *doc;	/* autoreference to itself */
-
-    /* End of common part */
-    int             compression;/* level of zlib compression */
-    int             standalone; /* standalone document (no external refs) 
-				     1 if standalone="yes"
-				     0 if standalone="no"
-				    -1 if there is no XML declaration
-				    -2 if there is an XML declaration, but no
-					standalone attribute was specified */
-    struct _xmlDtd  *intSubset;	/* the document internal subset */
-    struct _xmlDtd  *extSubset;	/* the document external subset */
-    struct _xmlNs   *oldNs;	/* Global namespace, the old way */
-    const xmlChar  *version;	/* the XML version string */
-    const xmlChar  *encoding;   /* external initial encoding, if any */
-    void           *ids;        /* Hash table for ID attributes if any */
-    void           *refs;       /* Hash table for IDREFs attributes if any */
-    const xmlChar  *URL;	/* The URI for that document */
-    int             charset;    /* encoding of the in-memory content
-				   actually an xmlCharEncoding */
-    struct _xmlDict *dict;      /* dict used to allocate names or NULL */
-    void           *psvi;	/* for type/PSVI informations */
-    int             parseFlags;	/* set of xmlParserOption used to parse the
-				   document */
-    int             properties;	/* set of xmlDocProperties for this document
-				   set at the end of parsing */
-};
-
-
-typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
-typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
-
-/**
- * xmlDOMWrapAcquireNsFunction:
- * @ctxt:  a DOM wrapper context
- * @node:  the context node (element or attribute) 
- * @nsName:  the requested namespace name
- * @nsPrefix:  the requested namespace prefix 
- *
- * A function called to acquire namespaces (xmlNs) from the wrapper.
- *
- * Returns an xmlNsPtr or NULL in case of an error.
- */
-typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
-						 xmlNodePtr node,
-						 const xmlChar *nsName,
-						 const xmlChar *nsPrefix);
-
-/**
- * xmlDOMWrapCtxt:
- *
- * Context for DOM wrapper-operations.
- */
-struct _xmlDOMWrapCtxt {
-    void * _private;
-    /*
-    * The type of this context, just in case we need specialized
-    * contexts in the future.
-    */
-    int type;
-    /*
-    * Internal namespace map used for various operations.
-    */
-    void * namespaceMap;
-    /*
-    * Use this one to acquire an xmlNsPtr intended for node->ns.
-    * (Note that this is not intended for elem->nsDef).
-    */
-    xmlDOMWrapAcquireNsFunction getNsForNodeFunc;
-};
-
-/**
- * xmlChildrenNode:
- *
- * Macro for compatibility naming layer with libxml1. Maps
- * to "children."
- */
-#ifndef xmlChildrenNode
-#define xmlChildrenNode children
-#endif
-
-/**
- * xmlRootNode:
- *
- * Macro for compatibility naming layer with libxml1. Maps 
- * to "children".
- */
-#ifndef xmlRootNode
-#define xmlRootNode children
-#endif
-
-/*
- * Variables.
- */
-
-/*
- * Some helper functions
- */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
-XMLPUBFUN int XMLCALL
-		xmlValidateNCName	(const xmlChar *value,
-					 int space);
-#endif
-
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL		
-		xmlValidateQName	(const xmlChar *value,
-					 int space);
-XMLPUBFUN int XMLCALL		
-		xmlValidateName		(const xmlChar *value,
-					 int space);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNMToken	(const xmlChar *value,
-					 int space);
-#endif
-
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlBuildQName		(const xmlChar *ncname,
-					 const xmlChar *prefix,
-					 xmlChar *memory,
-					 int len);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlSplitQName2		(const xmlChar *name,
-					 xmlChar **prefix);
-XMLPUBFUN const xmlChar * XMLCALL	
-		xmlSplitQName3		(const xmlChar *name,
-					 int *len);
-
-/*
- * Handling Buffers.
- */
-
-XMLPUBFUN void XMLCALL		
-		xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL	 
-		xmlGetBufferAllocationScheme(void);
-
-XMLPUBFUN xmlBufferPtr XMLCALL	
-		xmlBufferCreate		(void);
-XMLPUBFUN xmlBufferPtr XMLCALL	
-		xmlBufferCreateSize	(size_t size);
-XMLPUBFUN xmlBufferPtr XMLCALL	
-		xmlBufferCreateStatic	(void *mem,
-					 size_t size);
-XMLPUBFUN int XMLCALL		
-		xmlBufferResize		(xmlBufferPtr buf,
-					 unsigned int size);
-XMLPUBFUN void XMLCALL		
-		xmlBufferFree		(xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL		
-		xmlBufferDump		(FILE *file,
-					 xmlBufferPtr buf);
-XMLPUBFUN int XMLCALL		
-		xmlBufferAdd		(xmlBufferPtr buf,
-					 const xmlChar *str,
-					 int len);
-XMLPUBFUN int XMLCALL		
-		xmlBufferAddHead	(xmlBufferPtr buf,
-					 const xmlChar *str,
-					 int len);
-XMLPUBFUN int XMLCALL		
-		xmlBufferCat		(xmlBufferPtr buf,
-					 const xmlChar *str);
-XMLPUBFUN int XMLCALL	
-		xmlBufferCCat		(xmlBufferPtr buf,
-					 const char *str);
-XMLPUBFUN int XMLCALL		
-		xmlBufferShrink		(xmlBufferPtr buf,
-					 unsigned int len);
-XMLPUBFUN int XMLCALL		
-		xmlBufferGrow		(xmlBufferPtr buf,
-					 unsigned int len);
-XMLPUBFUN void XMLCALL		
-		xmlBufferEmpty		(xmlBufferPtr buf);
-XMLPUBFUN const xmlChar* XMLCALL	
-		xmlBufferContent	(const xmlBufferPtr buf);
-XMLPUBFUN void XMLCALL		
-		xmlBufferSetAllocationScheme(xmlBufferPtr buf,
-					 xmlBufferAllocationScheme scheme);
-XMLPUBFUN int XMLCALL		
-		xmlBufferLength		(const xmlBufferPtr buf);
-
-/*
- * Creating/freeing new structures.
- */
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlCreateIntSubset	(xmlDocPtr doc,
-					 const xmlChar *name,
-					 const xmlChar *ExternalID,
-					 const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlNewDtd		(xmlDocPtr doc,
-					 const xmlChar *name,
-					 const xmlChar *ExternalID,
-					 const xmlChar *SystemID);
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlGetIntSubset		(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL		
-		xmlFreeDtd		(xmlDtdPtr cur);
-#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlNewGlobalNs		(xmlDocPtr doc,
-					 const xmlChar *href,
-					 const xmlChar *prefix);
-#endif /* LIBXML_LEGACY_ENABLED */
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlNewNs		(xmlNodePtr node,
-					 const xmlChar *href,
-					 const xmlChar *prefix);
-XMLPUBFUN void XMLCALL		
-		xmlFreeNs		(xmlNsPtr cur);
-XMLPUBFUN void XMLCALL		
-		xmlFreeNsList		(xmlNsPtr cur);
-XMLPUBFUN xmlDocPtr XMLCALL 	
-		xmlNewDoc		(const xmlChar *version);
-XMLPUBFUN void XMLCALL		
-		xmlFreeDoc		(xmlDocPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlNewDocProp		(xmlDocPtr doc,
-					 const xmlChar *name,
-					 const xmlChar *value);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlNewProp		(xmlNodePtr node,
-					 const xmlChar *name,
-					 const xmlChar *value);
-#endif
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlNewNsProp		(xmlNodePtr node,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlNewNsPropEatName	(xmlNodePtr node,
-					 xmlNsPtr ns,
-					 xmlChar *name,
-					 const xmlChar *value);
-XMLPUBFUN void XMLCALL		
-		xmlFreePropList		(xmlAttrPtr cur);
-XMLPUBFUN void XMLCALL		
-		xmlFreeProp		(xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlCopyProp		(xmlNodePtr target,
-					 xmlAttrPtr cur);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlCopyPropList		(xmlNodePtr target,
-					 xmlAttrPtr cur);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlDtdPtr XMLCALL	
-		xmlCopyDtd		(xmlDtdPtr dtd);
-#endif /* LIBXML_TREE_ENABLED */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlDocPtr XMLCALL	
-		xmlCopyDoc		(xmlDocPtr doc,
-					 int recursive);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
-/*
- * Creating new nodes.
- */
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocNode		(xmlDocPtr doc,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocNodeEatName	(xmlDocPtr doc,
-					 xmlNsPtr ns,
-					 xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewNode		(xmlNsPtr ns,
-					 const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewNodeEatName	(xmlNsPtr ns,
-					 xmlChar *name);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewChild		(xmlNodePtr parent,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *content);
-#endif
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocText		(xmlDocPtr doc,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewText		(const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocPI		(xmlDocPtr doc,
-					 const xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewPI		(const xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocTextLen	(xmlDocPtr doc,
-					 const xmlChar *content,
-					 int len);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewTextLen		(const xmlChar *content,
-					 int len);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocComment	(xmlDocPtr doc,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewComment		(const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewCDataBlock	(xmlDocPtr doc,
-					 const xmlChar *content,
-					 int len);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewCharRef		(xmlDocPtr doc,
-					 const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewReference		(xmlDocPtr doc,
-					 const xmlChar *name);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlCopyNode		(const xmlNodePtr node,
-					 int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlDocCopyNode		(const xmlNodePtr node,
-					 xmlDocPtr doc,
-					 int recursive);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlDocCopyNodeList	(xmlDocPtr doc,
-					 const xmlNodePtr node);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlCopyNodeList		(const xmlNodePtr node);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewTextChild		(xmlNodePtr parent,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocRawNode	(xmlDocPtr doc,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *content);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlNewDocFragment	(xmlDocPtr doc);
-#endif /* LIBXML_TREE_ENABLED */
-
-/*
- * Navigating.
- */
-XMLPUBFUN long XMLCALL		
-		xmlGetLineNo		(xmlNodePtr node);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlGetNodePath		(xmlNodePtr node);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlDocGetRootElement	(xmlDocPtr doc);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlGetLastChild		(xmlNodePtr parent);
-XMLPUBFUN int XMLCALL		
-		xmlNodeIsText		(xmlNodePtr node);
-XMLPUBFUN int XMLCALL		
-		xmlIsBlankNode		(xmlNodePtr node);
-
-/*
- * Changing the structure.
- */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlDocSetRootElement	(xmlDocPtr doc,
-					 xmlNodePtr root);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetName		(xmlNodePtr cur,
-					 const xmlChar *name);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlAddChild		(xmlNodePtr parent,
-					 xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlAddChildList		(xmlNodePtr parent,
-					 xmlNodePtr cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlReplaceNode		(xmlNodePtr old,
-					 xmlNodePtr cur);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlAddPrevSibling	(xmlNodePtr cur,
-					 xmlNodePtr elem);
-#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlAddSibling		(xmlNodePtr cur,
-					 xmlNodePtr elem);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlAddNextSibling	(xmlNodePtr cur,
-					 xmlNodePtr elem);
-XMLPUBFUN void XMLCALL		
-		xmlUnlinkNode		(xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlTextMerge		(xmlNodePtr first,
-					 xmlNodePtr second);
-XMLPUBFUN int XMLCALL		
-		xmlTextConcat		(xmlNodePtr node,
-					 const xmlChar *content,
-					 int len);
-XMLPUBFUN void XMLCALL		
-		xmlFreeNodeList		(xmlNodePtr cur);
-XMLPUBFUN void XMLCALL		
-		xmlFreeNode		(xmlNodePtr cur);
-XMLPUBFUN void XMLCALL		
-		xmlSetTreeDoc		(xmlNodePtr tree,
-					 xmlDocPtr doc);
-XMLPUBFUN void XMLCALL		
-		xmlSetListDoc		(xmlNodePtr list,
-					 xmlDocPtr doc);
-/*
- * Namespaces.
- */
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlSearchNs		(xmlDocPtr doc,
-					 xmlNodePtr node,
-					 const xmlChar *nameSpace);
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlSearchNsByHref	(xmlDocPtr doc,
-					 xmlNodePtr node,
-					 const xmlChar *href);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN xmlNsPtr * XMLCALL	
-		xmlGetNsList		(xmlDocPtr doc,
-					 xmlNodePtr node);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
-
-XMLPUBFUN void XMLCALL		
-		xmlSetNs		(xmlNodePtr node,
-					 xmlNsPtr ns);
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlCopyNamespace	(xmlNsPtr cur);
-XMLPUBFUN xmlNsPtr XMLCALL	
-		xmlCopyNamespaceList	(xmlNsPtr cur);
-
-/*
- * Changing the content.
- */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlSetProp		(xmlNodePtr node,
-					 const xmlChar *name,
-					 const xmlChar *value);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlSetNsProp		(xmlNodePtr node,
-					 xmlNsPtr ns,
-					 const xmlChar *name,
-					 const xmlChar *value);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlGetNoNsProp		(xmlNodePtr node,
-					 const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlGetProp		(xmlNodePtr node,
-					 const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlHasProp		(xmlNodePtr node,
-					 const xmlChar *name);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlHasNsProp		(xmlNodePtr node,
-					 const xmlChar *name,
-					 const xmlChar *nameSpace);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlGetNsProp		(xmlNodePtr node,
-					 const xmlChar *name,
-					 const xmlChar *nameSpace);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlStringGetNodeList	(xmlDocPtr doc,
-					 const xmlChar *value);
-XMLPUBFUN xmlNodePtr XMLCALL	
-		xmlStringLenGetNodeList	(xmlDocPtr doc,
-					 const xmlChar *value,
-					 int len);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlNodeListGetString	(xmlDocPtr doc,
-					 xmlNodePtr list,
-					 int inLine);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlNodeListGetRawString	(xmlDocPtr doc,
-					 xmlNodePtr list,
-					 int inLine);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetContent	(xmlNodePtr cur,
-					 const xmlChar *content);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetContentLen	(xmlNodePtr cur,
-					 const xmlChar *content,
-					 int len);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL		
-		xmlNodeAddContent	(xmlNodePtr cur,
-					 const xmlChar *content);
-XMLPUBFUN void XMLCALL		
-		xmlNodeAddContentLen	(xmlNodePtr cur,
-					 const xmlChar *content,
-					 int len);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlNodeGetContent	(xmlNodePtr cur);
-XMLPUBFUN int XMLCALL
-		xmlNodeBufGetContent	(xmlBufferPtr buffer,
-					 xmlNodePtr cur);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlNodeGetLang		(xmlNodePtr cur);
-XMLPUBFUN int XMLCALL		
-		xmlNodeGetSpacePreserve	(xmlNodePtr cur);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetLang		(xmlNodePtr cur,
-					 const xmlChar *lang);
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetSpacePreserve (xmlNodePtr cur,
-					 int val);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlNodeGetBase		(xmlDocPtr doc,
-					 xmlNodePtr cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
-XMLPUBFUN void XMLCALL		
-		xmlNodeSetBase		(xmlNodePtr cur,
-					 const xmlChar *uri);
-#endif
-
-/*
- * Removing content.
- */
-XMLPUBFUN int XMLCALL		
-		xmlRemoveProp		(xmlAttrPtr cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL		
-		xmlUnsetNsProp		(xmlNodePtr node,
-					 xmlNsPtr ns,
-					 const xmlChar *name);
-XMLPUBFUN int XMLCALL		
-		xmlUnsetProp		(xmlNodePtr node,
-					 const xmlChar *name);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
-
-/*
- * Internal, don't use.
- */
-XMLPUBFUN void XMLCALL		
-		xmlBufferWriteCHAR	(xmlBufferPtr buf,
-					 const xmlChar *string);
-XMLPUBFUN void XMLCALL		
-		xmlBufferWriteChar	(xmlBufferPtr buf,
-					 const char *string);
-XMLPUBFUN void XMLCALL		
-		xmlBufferWriteQuotedString(xmlBufferPtr buf,
-					 const xmlChar *string);
-
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
-					 xmlDocPtr doc,
-					 xmlAttrPtr attr,
-					 const xmlChar *string);
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-#ifdef LIBXML_TREE_ENABLED
-/*
- * Namespace handling.
- */
-XMLPUBFUN int XMLCALL		
-		xmlReconciliateNs	(xmlDocPtr doc,
-					 xmlNodePtr tree);
-#endif
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/*
- * Saving.
- */
-XMLPUBFUN void XMLCALL		
-		xmlDocDumpFormatMemory	(xmlDocPtr cur,
-					 xmlChar **mem,
-					 int *size,
-					 int format);
-XMLPUBFUN void XMLCALL		
-		xmlDocDumpMemory	(xmlDocPtr cur,
-					 xmlChar **mem,
-					 int *size);
-XMLPUBFUN void XMLCALL		
-		xmlDocDumpMemoryEnc	(xmlDocPtr out_doc,
-					 xmlChar **doc_txt_ptr,
-					 int * doc_txt_len,
-					 const char *txt_encoding);
-XMLPUBFUN void XMLCALL		
-		xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
-					 xmlChar **doc_txt_ptr,
-					 int * doc_txt_len,
-					 const char *txt_encoding,
-					 int format);
-XMLPUBFUN int XMLCALL		
-		xmlDocFormatDump	(FILE *f,
-					 xmlDocPtr cur,
-					 int format);
-XMLPUBFUN int XMLCALL	
-		xmlDocDump		(FILE *f,
-					 xmlDocPtr cur);
-XMLPUBFUN void XMLCALL		
-		xmlElemDump		(FILE *f,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur);
-XMLPUBFUN int XMLCALL		
-		xmlSaveFile		(const char *filename,
-					 xmlDocPtr cur);
-XMLPUBFUN int XMLCALL		
-		xmlSaveFormatFile	(const char *filename,
-					 xmlDocPtr cur,
-					 int format);
-XMLPUBFUN int XMLCALL		
-		xmlNodeDump		(xmlBufferPtr buf,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur,
-					 int level,
-					 int format);
-
-XMLPUBFUN int XMLCALL		
-		xmlSaveFileTo		(xmlOutputBufferPtr buf,
-					 xmlDocPtr cur,
-					 const char *encoding);
-XMLPUBFUN int XMLCALL             
-		xmlSaveFormatFileTo     (xmlOutputBufferPtr buf,
-					 xmlDocPtr cur,
-				         const char *encoding,
-				         int format);
-XMLPUBFUN void XMLCALL		
-		xmlNodeDumpOutput	(xmlOutputBufferPtr buf,
-					 xmlDocPtr doc,
-					 xmlNodePtr cur,
-					 int level,
-					 int format,
-					 const char *encoding);
-
-XMLPUBFUN int XMLCALL		
-		xmlSaveFormatFileEnc    (const char *filename,
-					 xmlDocPtr cur,
-					 const char *encoding,
-					 int format);
-
-XMLPUBFUN int XMLCALL		
-		xmlSaveFileEnc		(const char *filename,
-					 xmlDocPtr cur,
-					 const char *encoding);
-
-#endif /* LIBXML_OUTPUT_ENABLED */
-/*
- * XHTML
- */
-XMLPUBFUN int XMLCALL		
-		xmlIsXHTML		(const xmlChar *systemID,
-					 const xmlChar *publicID);
-
-/*
- * Compression.
- */
-XMLPUBFUN int XMLCALL		
-		xmlGetDocCompressMode	(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL		
-		xmlSetDocCompressMode	(xmlDocPtr doc,
-					 int mode);
-XMLPUBFUN int XMLCALL		
-		xmlGetCompressMode	(void);
-XMLPUBFUN void XMLCALL		
-		xmlSetCompressMode	(int mode);
-
-/*
-* DOM-wrapper helper functions.
-*/
-XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL
-		xmlDOMWrapNewCtxt	(void);
-XMLPUBFUN void XMLCALL
-		xmlDOMWrapFreeCtxt	(xmlDOMWrapCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-	    xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
-					 xmlNodePtr elem,
-					 int options);
-XMLPUBFUN int XMLCALL
-	    xmlDOMWrapAdoptNode		(xmlDOMWrapCtxtPtr ctxt,
-					 xmlDocPtr sourceDoc,
-					 xmlNodePtr node,
-					 xmlDocPtr destDoc,		    
-					 xmlNodePtr destParent,
-					 int options);
-XMLPUBFUN int XMLCALL
-	    xmlDOMWrapRemoveNode	(xmlDOMWrapCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr node,
-					 int options);
-XMLPUBFUN int XMLCALL
-	    xmlDOMWrapCloneNode		(xmlDOMWrapCtxtPtr ctxt,
-					 xmlDocPtr sourceDoc,
-					 xmlNodePtr node,
-					 xmlNodePtr *clonedNode,
-					 xmlDocPtr destDoc,
-					 xmlNodePtr destParent,
-					 int deep,
-					 int options);
-
-#ifdef LIBXML_TREE_ENABLED
-/*
- * 5 interfaces from DOM ElementTraversal, but different in entities
- * traversal.
- */
-XMLPUBFUN unsigned long XMLCALL
-            xmlChildElementCount        (xmlNodePtr parent);
-XMLPUBFUN xmlNodePtr XMLCALL
-            xmlNextElementSibling       (xmlNodePtr node);
-XMLPUBFUN xmlNodePtr XMLCALL
-            xmlFirstElementChild        (xmlNodePtr parent);
-XMLPUBFUN xmlNodePtr XMLCALL
-            xmlLastElementChild         (xmlNodePtr parent);
-XMLPUBFUN xmlNodePtr XMLCALL
-            xmlPreviousElementSibling   (xmlNodePtr node);
-#endif
-#ifdef __cplusplus
-}
-#endif
-#ifndef __XML_PARSER_H__
-#include <libxml/xmlmemory.h>
-#endif
-
-#endif /* __XML_TREE_H__ */
-
diff --git a/interfaces/ext/libxml/uri.h b/interfaces/ext/libxml/uri.h
deleted file mode 100644
index db48262..0000000
--- a/interfaces/ext/libxml/uri.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Summary: library of generic URI related routines
- * Description: library of generic URI related routines
- *              Implements RFC 2396
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_URI_H__
-#define __XML_URI_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlURI:
- *
- * A parsed URI reference. This is a struct containing the various fields
- * as described in RFC 2396 but separated for further processing.
- *
- * Note: query is a deprecated field which is incorrectly unescaped.
- * query_raw takes precedence over query if the former is set.
- * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
- */
-typedef struct _xmlURI xmlURI;
-typedef xmlURI *xmlURIPtr;
-struct _xmlURI {
-    char *scheme;	/* the URI scheme */
-    char *opaque;	/* opaque part */
-    char *authority;	/* the authority part */
-    char *server;	/* the server part */
-    char *user;		/* the user part */
-    int port;		/* the port number */
-    char *path;		/* the path string */
-    char *query;	/* the query string (deprecated - use with caution) */
-    char *fragment;	/* the fragment identifier */
-    int  cleanup;	/* parsing potentially unclean URI */
-    char *query_raw;	/* the query string (as it appears in the URI) */
-};
-
-/*
- * This function is in tree.h:
- * xmlChar *	xmlNodeGetBase	(xmlDocPtr doc,
- *                               xmlNodePtr cur);
- */
-XMLPUBFUN xmlURIPtr XMLCALL
-		xmlCreateURI		(void);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlBuildURI		(const xmlChar *URI,
-					 const xmlChar *base);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlBuildRelativeURI	(const xmlChar *URI,
-					 const xmlChar *base);
-XMLPUBFUN xmlURIPtr XMLCALL
-		xmlParseURI		(const char *str);
-XMLPUBFUN xmlURIPtr XMLCALL
-		xmlParseURIRaw		(const char *str,
-					 int raw);
-XMLPUBFUN int XMLCALL
-		xmlParseURIReference	(xmlURIPtr uri,
-					 const char *str);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlSaveUri		(xmlURIPtr uri);
-XMLPUBFUN void XMLCALL
-		xmlPrintURI		(FILE *stream,
-					 xmlURIPtr uri);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlURIEscapeStr         (const xmlChar *str,
-					 const xmlChar *list);
-XMLPUBFUN char * XMLCALL
-		xmlURIUnescapeString	(const char *str,
-					 int len,
-					 char *target);
-XMLPUBFUN int XMLCALL
-		xmlNormalizeURIPath	(char *path);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlURIEscape		(const xmlChar *str);
-XMLPUBFUN void XMLCALL
-		xmlFreeURI		(xmlURIPtr uri);
-XMLPUBFUN xmlChar* XMLCALL
-		xmlCanonicPath		(const xmlChar *path);
-XMLPUBFUN xmlChar* XMLCALL
-		xmlPathToURI		(const xmlChar *path);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_URI_H__ */
diff --git a/interfaces/ext/libxml/valid.h b/interfaces/ext/libxml/valid.h
deleted file mode 100644
index f1892b0..0000000
--- a/interfaces/ext/libxml/valid.h
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Summary: The DTD validation
- * Description: API for the DTD handling and the validity checking
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_VALID_H__
-#define __XML_VALID_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/xmlerror.h>
-#include <libxml/tree.h>
-#include <libxml/list.h>
-#include <libxml/xmlautomata.h>
-#include <libxml/xmlregexp.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Validation state added for non-determinist content model.
- */
-typedef struct _xmlValidState xmlValidState;
-typedef xmlValidState *xmlValidStatePtr;
-
-/**
- * xmlValidityErrorFunc:
- * @ctx:  usually an xmlValidCtxtPtr to a validity error context,
- *        but comes from ctxt->userData (which normally contains such
- *        a pointer); ctxt->userData can be changed by the user.
- * @msg:  the string to format *printf like vararg
- * @...:  remaining arguments to the format
- *
- * Callback called when a validity error is found. This is a message
- * oriented function similar to an *printf function.
- */
-typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx,
-			     const char *msg,
-			     ...) ATTRIBUTE_PRINTF(2,3);
-
-/**
- * xmlValidityWarningFunc:
- * @ctx:  usually an xmlValidCtxtPtr to a validity error context,
- *        but comes from ctxt->userData (which normally contains such
- *        a pointer); ctxt->userData can be changed by the user.
- * @msg:  the string to format *printf like vararg
- * @...:  remaining arguments to the format
- *
- * Callback called when a validity warning is found. This is a message
- * oriented function similar to an *printf function.
- */
-typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
-			       const char *msg,
-			       ...) ATTRIBUTE_PRINTF(2,3);
-
-#ifdef IN_LIBXML
-/**
- * XML_CTXT_FINISH_DTD_0:
- *
- * Special value for finishDtd field when embedded in an xmlParserCtxt
- */
-#define XML_CTXT_FINISH_DTD_0 0xabcd1234
-/**
- * XML_CTXT_FINISH_DTD_1:
- *
- * Special value for finishDtd field when embedded in an xmlParserCtxt
- */
-#define XML_CTXT_FINISH_DTD_1 0xabcd1235
-#endif
-
-/*
- * xmlValidCtxt:
- * An xmlValidCtxt is used for error reporting when validating.
- */
-typedef struct _xmlValidCtxt xmlValidCtxt;
-typedef xmlValidCtxt *xmlValidCtxtPtr;
-struct _xmlValidCtxt {
-    void *userData;			/* user specific data block */
-    xmlValidityErrorFunc error;		/* the callback in case of errors */
-    xmlValidityWarningFunc warning;	/* the callback in case of warning */
-
-    /* Node analysis stack used when validating within entities */
-    xmlNodePtr         node;          /* Current parsed Node */
-    int                nodeNr;        /* Depth of the parsing stack */
-    int                nodeMax;       /* Max depth of the parsing stack */
-    xmlNodePtr        *nodeTab;       /* array of nodes */
-
-    unsigned int     finishDtd;       /* finished validating the Dtd ? */
-    xmlDocPtr              doc;       /* the document */
-    int                  valid;       /* temporary validity check result */
-
-    /* state state used for non-determinist content validation */
-    xmlValidState     *vstate;        /* current state */
-    int                vstateNr;      /* Depth of the validation stack */
-    int                vstateMax;     /* Max depth of the validation stack */
-    xmlValidState     *vstateTab;     /* array of validation states */
-
-#ifdef LIBXML_REGEXP_ENABLED
-    xmlAutomataPtr            am;     /* the automata */
-    xmlAutomataStatePtr    state;     /* used to build the automata */
-#else
-    void                     *am;
-    void                  *state;
-#endif
-};
-
-/*
- * ALL notation declarations are stored in a table.
- * There is one table per DTD.
- */
-
-typedef struct _xmlHashTable xmlNotationTable;
-typedef xmlNotationTable *xmlNotationTablePtr;
-
-/*
- * ALL element declarations are stored in a table.
- * There is one table per DTD.
- */
-
-typedef struct _xmlHashTable xmlElementTable;
-typedef xmlElementTable *xmlElementTablePtr;
-
-/*
- * ALL attribute declarations are stored in a table.
- * There is one table per DTD.
- */
-
-typedef struct _xmlHashTable xmlAttributeTable;
-typedef xmlAttributeTable *xmlAttributeTablePtr;
-
-/*
- * ALL IDs attributes are stored in a table.
- * There is one table per document.
- */
-
-typedef struct _xmlHashTable xmlIDTable;
-typedef xmlIDTable *xmlIDTablePtr;
-
-/*
- * ALL Refs attributes are stored in a table.
- * There is one table per document.
- */
-
-typedef struct _xmlHashTable xmlRefTable;
-typedef xmlRefTable *xmlRefTablePtr;
-
-/* Notation */
-XMLPUBFUN xmlNotationPtr XMLCALL	    
-		xmlAddNotationDecl	(xmlValidCtxtPtr ctxt,
-					 xmlDtdPtr dtd,
-					 const xmlChar *name,
-					 const xmlChar *PublicID,
-					 const xmlChar *SystemID);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlNotationTablePtr XMLCALL 
-		xmlCopyNotationTable	(xmlNotationTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL		    
-		xmlFreeNotationTable	(xmlNotationTablePtr table);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		    
-		xmlDumpNotationDecl	(xmlBufferPtr buf,
-					 xmlNotationPtr nota);
-XMLPUBFUN void XMLCALL		    
-		xmlDumpNotationTable	(xmlBufferPtr buf,
-					 xmlNotationTablePtr table);
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/* Element Content */
-/* the non Doc version are being deprecated */
-XMLPUBFUN xmlElementContentPtr XMLCALL 
-		xmlNewElementContent	(const xmlChar *name,
-					 xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL 
-		xmlCopyElementContent	(xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL		     
-		xmlFreeElementContent	(xmlElementContentPtr cur);
-/* the new versions with doc argument */
-XMLPUBFUN xmlElementContentPtr XMLCALL 
-		xmlNewDocElementContent	(xmlDocPtr doc,
-					 const xmlChar *name,
-					 xmlElementContentType type);
-XMLPUBFUN xmlElementContentPtr XMLCALL 
-		xmlCopyDocElementContent(xmlDocPtr doc,
-					 xmlElementContentPtr content);
-XMLPUBFUN void XMLCALL		     
-		xmlFreeDocElementContent(xmlDocPtr doc,
-					 xmlElementContentPtr cur);
-XMLPUBFUN void XMLCALL		     
-		xmlSnprintfElementContent(char *buf,
-					 int size,
-	                                 xmlElementContentPtr content,
-					 int englob);
-#ifdef LIBXML_OUTPUT_ENABLED
-/* DEPRECATED */
-XMLPUBFUN void XMLCALL		     
-		xmlSprintfElementContent(char *buf,
-	                                 xmlElementContentPtr content,
-					 int englob);
-#endif /* LIBXML_OUTPUT_ENABLED */
-/* DEPRECATED */
-
-/* Element */
-XMLPUBFUN xmlElementPtr XMLCALL	   
-		xmlAddElementDecl	(xmlValidCtxtPtr ctxt,
-					 xmlDtdPtr dtd,
-					 const xmlChar *name,
-					 xmlElementTypeVal type,
-					 xmlElementContentPtr content);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlElementTablePtr XMLCALL 
-		xmlCopyElementTable	(xmlElementTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL		   
-		xmlFreeElementTable	(xmlElementTablePtr table);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		   
-		xmlDumpElementTable	(xmlBufferPtr buf,
-					 xmlElementTablePtr table);
-XMLPUBFUN void XMLCALL		   
-		xmlDumpElementDecl	(xmlBufferPtr buf,
-					 xmlElementPtr elem);
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/* Enumeration */
-XMLPUBFUN xmlEnumerationPtr XMLCALL 
-		xmlCreateEnumeration	(const xmlChar *name);
-XMLPUBFUN void XMLCALL		   
-		xmlFreeEnumeration	(xmlEnumerationPtr cur);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlEnumerationPtr XMLCALL  
-		xmlCopyEnumeration	(xmlEnumerationPtr cur);
-#endif /* LIBXML_TREE_ENABLED */
-
-/* Attribute */
-XMLPUBFUN xmlAttributePtr XMLCALL	    
-		xmlAddAttributeDecl	(xmlValidCtxtPtr ctxt,
-					 xmlDtdPtr dtd,
-					 const xmlChar *elem,
-					 const xmlChar *name,
-					 const xmlChar *ns,
-					 xmlAttributeType type,
-					 xmlAttributeDefault def,
-					 const xmlChar *defaultValue,
-					 xmlEnumerationPtr tree);
-#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlAttributeTablePtr XMLCALL 
-		xmlCopyAttributeTable  (xmlAttributeTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL		     
-		xmlFreeAttributeTable  (xmlAttributeTablePtr table);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL		     
-		xmlDumpAttributeTable  (xmlBufferPtr buf,
-					xmlAttributeTablePtr table);
-XMLPUBFUN void XMLCALL		     
-		xmlDumpAttributeDecl   (xmlBufferPtr buf,
-					xmlAttributePtr attr);
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/* IDs */
-XMLPUBFUN xmlIDPtr XMLCALL	
-		xmlAddID	       (xmlValidCtxtPtr ctxt,
-					xmlDocPtr doc,
-					const xmlChar *value,
-					xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL		
-		xmlFreeIDTable	       (xmlIDTablePtr table);
-XMLPUBFUN xmlAttrPtr XMLCALL	
-		xmlGetID	       (xmlDocPtr doc,
-					const xmlChar *ID);
-XMLPUBFUN int XMLCALL		
-		xmlIsID		       (xmlDocPtr doc,
-					xmlNodePtr elem,
-					xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL		
-		xmlRemoveID	       (xmlDocPtr doc, 
-					xmlAttrPtr attr);
-
-/* IDREFs */
-XMLPUBFUN xmlRefPtr XMLCALL	
-		xmlAddRef	       (xmlValidCtxtPtr ctxt,
-					xmlDocPtr doc,
-					const xmlChar *value,
-					xmlAttrPtr attr);
-XMLPUBFUN void XMLCALL		
-		xmlFreeRefTable	       (xmlRefTablePtr table);
-XMLPUBFUN int XMLCALL		
-		xmlIsRef	       (xmlDocPtr doc,
-					xmlNodePtr elem,
-					xmlAttrPtr attr);
-XMLPUBFUN int XMLCALL		
-		xmlRemoveRef	       (xmlDocPtr doc, 
-					xmlAttrPtr attr);
-XMLPUBFUN xmlListPtr XMLCALL	
-		xmlGetRefs	       (xmlDocPtr doc,
-					const xmlChar *ID);
-
-/**
- * The public function calls related to validity checking.
- */
-#ifdef LIBXML_VALID_ENABLED
-/* Allocate/Release Validation Contexts */
-XMLPUBFUN xmlValidCtxtPtr XMLCALL	    
-		xmlNewValidCtxt(void);
-XMLPUBFUN void XMLCALL		    
-		xmlFreeValidCtxt(xmlValidCtxtPtr);
-
-XMLPUBFUN int XMLCALL		
-		xmlValidateRoot		(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc);
-XMLPUBFUN int XMLCALL		
-		xmlValidateElementDecl	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-		                         xmlElementPtr elem);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlValidNormalizeAttributeValue(xmlDocPtr doc,
-					 xmlNodePtr elem,
-					 const xmlChar *name,
-					 const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL	
-		xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem,
-					 const xmlChar *name,
-					 const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-		                         xmlAttributePtr attr);
-XMLPUBFUN int XMLCALL		
-		xmlValidateAttributeValue(xmlAttributeType type,
-					 const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNotationDecl	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-		                         xmlNotationPtr nota);
-XMLPUBFUN int XMLCALL		
-		xmlValidateDtd		(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlDtdPtr dtd);
-XMLPUBFUN int XMLCALL		
-		xmlValidateDtdFinal	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc);
-XMLPUBFUN int XMLCALL		
-		xmlValidateDocument	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc);
-XMLPUBFUN int XMLCALL		
-		xmlValidateElement	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem);
-XMLPUBFUN int XMLCALL		
-		xmlValidateOneElement	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-		                         xmlNodePtr elem);
-XMLPUBFUN int XMLCALL	
-		xmlValidateOneAttribute	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr	elem,
-					 xmlAttrPtr attr,
-					 const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateOneNamespace	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem,
-					 const xmlChar *prefix,
-					 xmlNsPtr ns,
-					 const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc);
-#endif /* LIBXML_VALID_ENABLED */
-
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN int XMLCALL		
-		xmlValidateNotationUse	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 const xmlChar *notationName);
-#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
-
-XMLPUBFUN int XMLCALL		
-		xmlIsMixedElement	(xmlDocPtr doc,
-					 const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL	
-		xmlGetDtdAttrDesc	(xmlDtdPtr dtd,
-					 const xmlChar *elem,
-					 const xmlChar *name);
-XMLPUBFUN xmlAttributePtr XMLCALL	
-		xmlGetDtdQAttrDesc	(xmlDtdPtr dtd,
-					 const xmlChar *elem,
-					 const xmlChar *name,
-					 const xmlChar *prefix);
-XMLPUBFUN xmlNotationPtr XMLCALL	
-		xmlGetDtdNotationDesc	(xmlDtdPtr dtd,
-					 const xmlChar *name);
-XMLPUBFUN xmlElementPtr XMLCALL	
-		xmlGetDtdQElementDesc	(xmlDtdPtr dtd,
-					 const xmlChar *name,
-					 const xmlChar *prefix);
-XMLPUBFUN xmlElementPtr XMLCALL	
-		xmlGetDtdElementDesc	(xmlDtdPtr dtd,
-					 const xmlChar *name);
-
-#ifdef LIBXML_VALID_ENABLED
-
-XMLPUBFUN int XMLCALL		
-		xmlValidGetPotentialChildren(xmlElementContent *ctree,
-					 const xmlChar **names,
-					 int *len,
-					 int max);
-
-XMLPUBFUN int XMLCALL		
-		xmlValidGetValidElements(xmlNode *prev,
-					 xmlNode *next,
-					 const xmlChar **names,
-					 int max);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNameValue	(const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNamesValue	(const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNmtokenValue	(const xmlChar *value);
-XMLPUBFUN int XMLCALL		
-		xmlValidateNmtokensValue(const xmlChar *value);
-
-#ifdef LIBXML_REGEXP_ENABLED
-/*
- * Validation based on the regexp support
- */
-XMLPUBFUN int XMLCALL		
-		xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
-					 xmlElementPtr elem);
-
-XMLPUBFUN int XMLCALL		
-		xmlValidatePushElement	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem,
-					 const xmlChar *qname);
-XMLPUBFUN int XMLCALL		
-		xmlValidatePushCData	(xmlValidCtxtPtr ctxt,
-					 const xmlChar *data,
-					 int len);
-XMLPUBFUN int XMLCALL		
-		xmlValidatePopElement	(xmlValidCtxtPtr ctxt,
-					 xmlDocPtr doc,
-					 xmlNodePtr elem,
-					 const xmlChar *qname);
-#endif /* LIBXML_REGEXP_ENABLED */
-#endif /* LIBXML_VALID_ENABLED */
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_VALID_H__ */
diff --git a/interfaces/ext/libxml/xinclude.h b/interfaces/ext/libxml/xinclude.h
deleted file mode 100644
index ba9c9b5..0000000
--- a/interfaces/ext/libxml/xinclude.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Summary: implementation of XInclude
- * Description: API to handle XInclude processing,
- * implements the
- * World Wide Web Consortium Last Call Working Draft 10 November 2003
- * http://www.w3.org/TR/2003/WD-xinclude-20031110
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XINCLUDE_H__
-#define __XML_XINCLUDE_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef LIBXML_XINCLUDE_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * XINCLUDE_NS:
- *
- * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude
- */
-#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
-/**
- * XINCLUDE_OLD_NS:
- *
- * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude
- */
-#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
-/**
- * XINCLUDE_NODE:
- *
- * Macro defining "include"
- */
-#define XINCLUDE_NODE (const xmlChar *) "include"
-/**
- * XINCLUDE_FALLBACK:
- *
- * Macro defining "fallback"
- */
-#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
-/**
- * XINCLUDE_HREF:
- *
- * Macro defining "href"
- */
-#define XINCLUDE_HREF (const xmlChar *) "href"
-/**
- * XINCLUDE_PARSE:
- *
- * Macro defining "parse"
- */
-#define XINCLUDE_PARSE (const xmlChar *) "parse"
-/**
- * XINCLUDE_PARSE_XML:
- *
- * Macro defining "xml"
- */
-#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
-/**
- * XINCLUDE_PARSE_TEXT:
- *
- * Macro defining "text"
- */
-#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
-/**
- * XINCLUDE_PARSE_ENCODING:
- *
- * Macro defining "encoding"
- */
-#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
-/**
- * XINCLUDE_PARSE_XPOINTER:
- *
- * Macro defining "xpointer"
- */
-#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
-
-typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt;
-typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
-
-/*
- * standalone processing
- */
-XMLPUBFUN int XMLCALL	
-		xmlXIncludeProcess	(xmlDocPtr doc);
-XMLPUBFUN int XMLCALL	
-		xmlXIncludeProcessFlags	(xmlDocPtr doc,
-					 int flags);
-XMLPUBFUN int XMLCALL	
-		xmlXIncludeProcessFlagsData(xmlDocPtr doc,
-					 int flags,
-					 void *data);
-XMLPUBFUN int XMLCALL	
-		xmlXIncludeProcessTree	(xmlNodePtr tree);
-XMLPUBFUN int XMLCALL	
-		xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
-					 int flags);
-/*
- * contextual processing
- */
-XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL
-		xmlXIncludeNewContext	(xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
-		xmlXIncludeSetFlags	(xmlXIncludeCtxtPtr ctxt,
-					 int flags);
-XMLPUBFUN void XMLCALL
-		xmlXIncludeFreeContext	(xmlXIncludeCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		xmlXIncludeProcessNode	(xmlXIncludeCtxtPtr ctxt,
-					 xmlNodePtr tree);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_XINCLUDE_ENABLED */
-
-#endif /* __XML_XINCLUDE_H__ */
diff --git a/interfaces/ext/libxml/xlink.h b/interfaces/ext/libxml/xlink.h
deleted file mode 100644
index 083c7ed..0000000
--- a/interfaces/ext/libxml/xlink.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Summary: unfinished XLink detection module
- * Description: unfinished XLink detection module
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XLINK_H__
-#define __XML_XLINK_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef LIBXML_XPTR_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Various defines for the various Link properties.
- *
- * NOTE: the link detection layer will try to resolve QName expansion
- *       of namespaces. If "foo" is the prefix for "http://foo.com/"
- *       then the link detection layer will expand role="foo:myrole"
- *       to "http://foo.com/:myrole".
- * NOTE: the link detection layer will expand URI-Refences found on
- *       href attributes by using the base mechanism if found.
- */
-typedef xmlChar *xlinkHRef;
-typedef xmlChar *xlinkRole;
-typedef xmlChar *xlinkTitle;
-
-typedef enum {
-    XLINK_TYPE_NONE = 0,
-    XLINK_TYPE_SIMPLE,
-    XLINK_TYPE_EXTENDED,
-    XLINK_TYPE_EXTENDED_SET
-} xlinkType;
-
-typedef enum {
-    XLINK_SHOW_NONE = 0,
-    XLINK_SHOW_NEW,
-    XLINK_SHOW_EMBED,
-    XLINK_SHOW_REPLACE
-} xlinkShow;
-
-typedef enum {
-    XLINK_ACTUATE_NONE = 0,
-    XLINK_ACTUATE_AUTO,
-    XLINK_ACTUATE_ONREQUEST
-} xlinkActuate;
-
-/**
- * xlinkNodeDetectFunc:
- * @ctx:  user data pointer
- * @node:  the node to check
- * 
- * This is the prototype for the link detection routine.
- * It calls the default link detection callbacks upon link detection.
- */
-typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
-
-/*
- * The link detection module interact with the upper layers using
- * a set of callback registered at parsing time.
- */
-
-/**
- * xlinkSimpleLinkFunk:
- * @ctx:  user data pointer
- * @node:  the node carrying the link
- * @href:  the target of the link
- * @role:  the role string
- * @title:  the link title
- *
- * This is the prototype for a simple link detection callback.
- */
-typedef void
-(*xlinkSimpleLinkFunk)	(void *ctx,
-			 xmlNodePtr node,
-			 const xlinkHRef href,
-			 const xlinkRole role,
-			 const xlinkTitle title);
-
-/**
- * xlinkExtendedLinkFunk:
- * @ctx:  user data pointer
- * @node:  the node carrying the link
- * @nbLocators: the number of locators detected on the link
- * @hrefs:  pointer to the array of locator hrefs
- * @roles:  pointer to the array of locator roles
- * @nbArcs: the number of arcs detected on the link
- * @from:  pointer to the array of source roles found on the arcs
- * @to:  pointer to the array of target roles found on the arcs
- * @show:  array of values for the show attributes found on the arcs
- * @actuate:  array of values for the actuate attributes found on the arcs
- * @nbTitles: the number of titles detected on the link
- * @title:  array of titles detected on the link
- * @langs:  array of xml:lang values for the titles
- *
- * This is the prototype for a extended link detection callback.
- */
-typedef void
-(*xlinkExtendedLinkFunk)(void *ctx,
-			 xmlNodePtr node,
-			 int nbLocators,
-			 const xlinkHRef *hrefs,
-			 const xlinkRole *roles,
-			 int nbArcs,
-			 const xlinkRole *from,
-			 const xlinkRole *to,
-			 xlinkShow *show,
-			 xlinkActuate *actuate,
-			 int nbTitles,
-			 const xlinkTitle *titles,
-			 const xmlChar **langs);
-
-/**
- * xlinkExtendedLinkSetFunk:
- * @ctx:  user data pointer
- * @node:  the node carrying the link
- * @nbLocators: the number of locators detected on the link
- * @hrefs:  pointer to the array of locator hrefs
- * @roles:  pointer to the array of locator roles
- * @nbTitles: the number of titles detected on the link
- * @title:  array of titles detected on the link
- * @langs:  array of xml:lang values for the titles
- *
- * This is the prototype for a extended link set detection callback.
- */
-typedef void
-(*xlinkExtendedLinkSetFunk)	(void *ctx,
-				 xmlNodePtr node,
-				 int nbLocators,
-				 const xlinkHRef *hrefs,
-				 const xlinkRole *roles,
-				 int nbTitles,
-				 const xlinkTitle *titles,
-				 const xmlChar **langs);
-
-/**
- * This is the structure containing a set of Links detection callbacks.
- *
- * There is no default xlink callbacks, if one want to get link
- * recognition activated, those call backs must be provided before parsing.
- */
-typedef struct _xlinkHandler xlinkHandler;
-typedef xlinkHandler *xlinkHandlerPtr;
-struct _xlinkHandler {
-    xlinkSimpleLinkFunk simple;
-    xlinkExtendedLinkFunk extended;
-    xlinkExtendedLinkSetFunk set;
-};
-
-/*
- * The default detection routine, can be overridden, they call the default
- * detection callbacks. 
- */
-
-XMLPUBFUN xlinkNodeDetectFunc XMLCALL	
-		xlinkGetDefaultDetect	(void);
-XMLPUBFUN void XMLCALL			
-		xlinkSetDefaultDetect	(xlinkNodeDetectFunc func);
-
-/*
- * Routines to set/get the default handlers.
- */
-XMLPUBFUN xlinkHandlerPtr XMLCALL	
-		xlinkGetDefaultHandler	(void);
-XMLPUBFUN void XMLCALL		
-		xlinkSetDefaultHandler	(xlinkHandlerPtr handler);
-
-/*
- * Link detection module itself.
- */
-XMLPUBFUN xlinkType XMLCALL	 
-		xlinkIsLink		(xmlDocPtr doc,
-					 xmlNodePtr node);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_XPTR_ENABLED */
-
-#endif /* __XML_XLINK_H__ */
diff --git a/interfaces/ext/libxml/xmlIO.h b/interfaces/ext/libxml/xmlIO.h
deleted file mode 100644
index eea9ed6..0000000
--- a/interfaces/ext/libxml/xmlIO.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Summary: interface for the I/O interfaces used by the parser
- * Description: interface for the I/O interfaces used by the parser
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_IO_H__
-#define __XML_IO_H__
-
-#include <stdio.h>
-#include <libxml/xmlversion.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Those are the functions and datatypes for the parser input
- * I/O structures.
- */
-
-/**
- * xmlInputMatchCallback:
- * @filename: the filename or URI
- *
- * Callback used in the I/O Input API to detect if the current handler 
- * can provide input fonctionnalities for this resource.
- *
- * Returns 1 if yes and 0 if another Input module should be used
- */
-typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename);
-/**
- * xmlInputOpenCallback:
- * @filename: the filename or URI
- *
- * Callback used in the I/O Input API to open the resource
- *
- * Returns an Input context or NULL in case or error
- */
-typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename);
-/**
- * xmlInputReadCallback:
- * @context:  an Input context
- * @buffer:  the buffer to store data read
- * @len:  the length of the buffer in bytes
- *
- * Callback used in the I/O Input API to read the resource
- *
- * Returns the number of bytes read or -1 in case of error
- */
-typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len);
-/**
- * xmlInputCloseCallback:
- * @context:  an Input context
- *
- * Callback used in the I/O Input API to close the resource
- *
- * Returns 0 or -1 in case of error
- */
-typedef int (XMLCALL *xmlInputCloseCallback) (void * context);
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/*
- * Those are the functions and datatypes for the library output
- * I/O structures.
- */
-
-/**
- * xmlOutputMatchCallback:
- * @filename: the filename or URI
- *
- * Callback used in the I/O Output API to detect if the current handler 
- * can provide output fonctionnalities for this resource.
- *
- * Returns 1 if yes and 0 if another Output module should be used
- */
-typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename);
-/**
- * xmlOutputOpenCallback:
- * @filename: the filename or URI
- *
- * Callback used in the I/O Output API to open the resource
- *
- * Returns an Output context or NULL in case or error
- */
-typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
-/**
- * xmlOutputWriteCallback:
- * @context:  an Output context
- * @buffer:  the buffer of data to write
- * @len:  the length of the buffer in bytes
- *
- * Callback used in the I/O Output API to write to the resource
- *
- * Returns the number of bytes written or -1 in case of error
- */
-typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
-                                       int len);
-/**
- * xmlOutputCloseCallback:
- * @context:  an Output context
- *
- * Callback used in the I/O Output API to close the resource
- *
- * Returns 0 or -1 in case of error
- */
-typedef int (XMLCALL *xmlOutputCloseCallback) (void * context);
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <libxml/globals.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/encoding.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-struct _xmlParserInputBuffer {
-    void*                  context;
-    xmlInputReadCallback   readcallback;
-    xmlInputCloseCallback  closecallback;
-    
-    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-    
-    xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 */
-    xmlBufferPtr raw;       /* if encoder != NULL buffer for raw input */
-    int	compressed;	    /* -1=unknown, 0=not compressed, 1=compressed */
-    int error;
-    unsigned long rawconsumed;/* amount consumed from raw */
-};
-
-
-#ifdef LIBXML_OUTPUT_ENABLED
-struct _xmlOutputBuffer {
-    void*                   context;
-    xmlOutputWriteCallback  writecallback;
-    xmlOutputCloseCallback  closecallback;
-    
-    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
-    
-    xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 or ISOLatin */
-    xmlBufferPtr conv;      /* if encoder != NULL buffer for output */
-    int written;            /* total number of byte written */
-    int error;
-};
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/*
- * Interfaces for input
- */
-XMLPUBFUN void XMLCALL	
-	xmlCleanupInputCallbacks		(void);
-
-XMLPUBFUN int XMLCALL
-	xmlPopInputCallbacks			(void);
-
-XMLPUBFUN void XMLCALL	
-	xmlRegisterDefaultInputCallbacks	(void);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlAllocParserInputBuffer		(xmlCharEncoding enc);
-
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateFilename	(const char *URI,
-                                                 xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateFile		(FILE *file,
-                                                 xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateFd		(int fd,
-	                                         xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateMem		(const char *mem, int size,
-	                                         xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateStatic	(const char *mem, int size,
-	                                         xmlCharEncoding enc);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-	xmlParserInputBufferCreateIO		(xmlInputReadCallback   ioread,
-						 xmlInputCloseCallback  ioclose,
-						 void *ioctx,
-	                                         xmlCharEncoding enc);
-XMLPUBFUN int XMLCALL	
-	xmlParserInputBufferRead		(xmlParserInputBufferPtr in,
-						 int len);
-XMLPUBFUN int XMLCALL	
-	xmlParserInputBufferGrow		(xmlParserInputBufferPtr in,
-						 int len);
-XMLPUBFUN int XMLCALL	
-	xmlParserInputBufferPush		(xmlParserInputBufferPtr in,
-						 int len,
-						 const char *buf);
-XMLPUBFUN void XMLCALL	
-	xmlFreeParserInputBuffer		(xmlParserInputBufferPtr in);
-XMLPUBFUN char * XMLCALL	
-	xmlParserGetDirectory			(const char *filename);
-
-XMLPUBFUN int XMLCALL     
-	xmlRegisterInputCallbacks		(xmlInputMatchCallback matchFunc,
-						 xmlInputOpenCallback openFunc,
-						 xmlInputReadCallback readFunc,
-						 xmlInputCloseCallback closeFunc);
-
-xmlParserInputBufferPtr
-	__xmlParserInputBufferCreateFilename(const char *URI,
-										xmlCharEncoding enc);
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/*
- * Interfaces for output
- */
-XMLPUBFUN void XMLCALL	
-	xmlCleanupOutputCallbacks		(void);
-XMLPUBFUN void XMLCALL	
-	xmlRegisterDefaultOutputCallbacks(void);
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlAllocOutputBuffer		(xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlOutputBufferCreateFilename	(const char *URI,
-					 xmlCharEncodingHandlerPtr encoder,
-					 int compression);
-
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlOutputBufferCreateFile	(FILE *file,
-					 xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlOutputBufferCreateBuffer	(xmlBufferPtr buffer,
-					 xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlOutputBufferCreateFd		(int fd,
-					 xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN xmlOutputBufferPtr XMLCALL
-	xmlOutputBufferCreateIO		(xmlOutputWriteCallback   iowrite,
-					 xmlOutputCloseCallback  ioclose,
-					 void *ioctx,
-					 xmlCharEncodingHandlerPtr encoder);
-
-XMLPUBFUN int XMLCALL	
-	xmlOutputBufferWrite		(xmlOutputBufferPtr out,
-					 int len,
-					 const char *buf);
-XMLPUBFUN int XMLCALL	
-	xmlOutputBufferWriteString	(xmlOutputBufferPtr out,
-					 const char *str);
-XMLPUBFUN int XMLCALL	
-	xmlOutputBufferWriteEscape	(xmlOutputBufferPtr out,
-					 const xmlChar *str,
-					 xmlCharEncodingOutputFunc escaping);
-
-XMLPUBFUN int XMLCALL	
-	xmlOutputBufferFlush		(xmlOutputBufferPtr out);
-XMLPUBFUN int XMLCALL	
-	xmlOutputBufferClose		(xmlOutputBufferPtr out);
-
-XMLPUBFUN int XMLCALL     
-	xmlRegisterOutputCallbacks	(xmlOutputMatchCallback matchFunc,
-					 xmlOutputOpenCallback openFunc,
-					 xmlOutputWriteCallback writeFunc,
-					 xmlOutputCloseCallback closeFunc);
-
-xmlOutputBufferPtr
-	__xmlOutputBufferCreateFilename(const char *URI,
-                              xmlCharEncodingHandlerPtr encoder,
-                              int compression);
-
-#ifdef LIBXML_HTTP_ENABLED
-/*  This function only exists if HTTP support built into the library  */
-XMLPUBFUN void XMLCALL	
-	xmlRegisterHTTPPostCallbacks	(void );
-#endif /* LIBXML_HTTP_ENABLED */
-	
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-XMLPUBFUN xmlParserInputPtr XMLCALL
-	xmlCheckHTTPInput		(xmlParserCtxtPtr ctxt,
-					 xmlParserInputPtr ret);
-
-/*
- * A predefined entity loader disabling network accesses
- */
-XMLPUBFUN xmlParserInputPtr XMLCALL 
-	xmlNoNetExternalEntityLoader	(const char *URL,
-					 const char *ID,
-					 xmlParserCtxtPtr ctxt);
-
-/* 
- * xmlNormalizeWindowsPath is obsolete, don't use it. 
- * Check xmlCanonicPath in uri.h for a better alternative.
- */
-XMLPUBFUN xmlChar * XMLCALL 
-	xmlNormalizeWindowsPath		(const xmlChar *path);
-
-XMLPUBFUN int XMLCALL	
-	xmlCheckFilename		(const char *path);
-/**
- * Default 'file://' protocol callbacks 
- */
-XMLPUBFUN int XMLCALL	
-	xmlFileMatch 			(const char *filename);
-XMLPUBFUN void * XMLCALL	
-	xmlFileOpen 			(const char *filename);
-XMLPUBFUN int XMLCALL	
-	xmlFileRead 			(void * context, 
-					 char * buffer, 
-					 int len);
-XMLPUBFUN int XMLCALL	
-	xmlFileClose 			(void * context);
-
-/**
- * Default 'http://' protocol callbacks 
- */
-#ifdef LIBXML_HTTP_ENABLED
-XMLPUBFUN int XMLCALL	
-	xmlIOHTTPMatch 			(const char *filename);
-XMLPUBFUN void * XMLCALL	
-	xmlIOHTTPOpen 			(const char *filename);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void * XMLCALL	
-	xmlIOHTTPOpenW			(const char * post_uri,
-					 int   compression );
-#endif /* LIBXML_OUTPUT_ENABLED */
-XMLPUBFUN int XMLCALL 	
-	xmlIOHTTPRead			(void * context, 
-					 char * buffer, 
-					 int len);
-XMLPUBFUN int XMLCALL	
-	xmlIOHTTPClose 			(void * context);
-#endif /* LIBXML_HTTP_ENABLED */
-
-/**
- * Default 'ftp://' protocol callbacks 
- */
-#ifdef LIBXML_FTP_ENABLED 
-XMLPUBFUN int XMLCALL	
-	xmlIOFTPMatch 			(const char *filename);
-XMLPUBFUN void * XMLCALL	
-	xmlIOFTPOpen 			(const char *filename);
-XMLPUBFUN int XMLCALL 	
-	xmlIOFTPRead			(void * context, 
-					 char * buffer, 
-					 int len);
-XMLPUBFUN int XMLCALL 	
-	xmlIOFTPClose 			(void * context);
-#endif /* LIBXML_FTP_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_IO_H__ */
diff --git a/interfaces/ext/libxml/xmlautomata.h b/interfaces/ext/libxml/xmlautomata.h
deleted file mode 100644
index f98b55e..0000000
--- a/interfaces/ext/libxml/xmlautomata.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Summary: API to build regexp automata
- * Description: the API to build regexp automata
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_AUTOMATA_H__
-#define __XML_AUTOMATA_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-
-#ifdef LIBXML_REGEXP_ENABLED
-#ifdef LIBXML_AUTOMATA_ENABLED
-#include <libxml/xmlregexp.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlAutomataPtr:
- *
- * A libxml automata description, It can be compiled into a regexp
- */
-typedef struct _xmlAutomata xmlAutomata;
-typedef xmlAutomata *xmlAutomataPtr;
-
-/**
- * xmlAutomataStatePtr:
- *
- * A state int the automata description,
- */
-typedef struct _xmlAutomataState xmlAutomataState;
-typedef xmlAutomataState *xmlAutomataStatePtr;
-
-/*
- * Building API
- */
-XMLPUBFUN xmlAutomataPtr XMLCALL		
-		    xmlNewAutomata		(void);
-XMLPUBFUN void XMLCALL			
-		    xmlFreeAutomata		(xmlAutomataPtr am);
-
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataGetInitState	(xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL			
-		    xmlAutomataSetFinalState	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr state);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewState		(xmlAutomataPtr am);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewTransition	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewTransition2	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 const xmlChar *token2,
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
-                    xmlAutomataNewNegTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 const xmlChar *token2,
-						 void *data);
-
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewCountTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 int min,
-						 int max,
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewCountTrans2	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 const xmlChar *token2,
-						 int min,
-						 int max,
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewOnceTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 const xmlChar *token,
-						 int min,
-						 int max,
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL
-		    xmlAutomataNewOnceTrans2	(xmlAutomataPtr am, 
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to, 
-						 const xmlChar *token,
-						 const xmlChar *token2,
-						 int min, 
-						 int max, 
-						 void *data);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewAllTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 int lax);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewEpsilon	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewCountedTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 int counter);
-XMLPUBFUN xmlAutomataStatePtr XMLCALL	
-		    xmlAutomataNewCounterTrans	(xmlAutomataPtr am,
-						 xmlAutomataStatePtr from,
-						 xmlAutomataStatePtr to,
-						 int counter);
-XMLPUBFUN int XMLCALL			
-		    xmlAutomataNewCounter	(xmlAutomataPtr am,
-						 int min,
-						 int max);
-
-XMLPUBFUN xmlRegexpPtr XMLCALL		
-		    xmlAutomataCompile		(xmlAutomataPtr am);
-XMLPUBFUN int XMLCALL	    		
-		    xmlAutomataIsDeterminist	(xmlAutomataPtr am);
-
-#ifdef __cplusplus
-}
-#endif 
-
-#endif /* LIBXML_AUTOMATA_ENABLED */
-#endif /* LIBXML_REGEXP_ENABLED */
-
-#endif /* __XML_AUTOMATA_H__ */
diff --git a/interfaces/ext/libxml/xmlerror.h b/interfaces/ext/libxml/xmlerror.h
deleted file mode 100644
index 7cce9c3..0000000
--- a/interfaces/ext/libxml/xmlerror.h
+++ /dev/null
@@ -1,944 +0,0 @@
-/*
- * Summary: error handling
- * Description: the API used to report errors
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#include <libxml/parser.h>
-
-#ifndef __XML_ERROR_H__
-#define __XML_ERROR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlErrorLevel:
- *
- * Indicates the level of an error
- */
-typedef enum {
-    XML_ERR_NONE = 0,
-    XML_ERR_WARNING = 1,	/* A simple warning */
-    XML_ERR_ERROR = 2,		/* A recoverable error */
-    XML_ERR_FATAL = 3		/* A fatal error */
-} xmlErrorLevel;
-
-/**
- * xmlErrorDomain:
- *
- * Indicates where an error may have come from
- */
-typedef enum {
-    XML_FROM_NONE = 0,
-    XML_FROM_PARSER,	/* The XML parser */
-    XML_FROM_TREE,	/* The tree module */
-    XML_FROM_NAMESPACE,	/* The XML Namespace module */
-    XML_FROM_DTD,	/* The XML DTD validation with parser context*/
-    XML_FROM_HTML,	/* The HTML parser */
-    XML_FROM_MEMORY,	/* The memory allocator */
-    XML_FROM_OUTPUT,	/* The serialization code */
-    XML_FROM_IO,	/* The Input/Output stack */
-    XML_FROM_FTP,	/* The FTP module */
-    XML_FROM_HTTP,	/* The HTTP module */
-    XML_FROM_XINCLUDE,	/* The XInclude processing */
-    XML_FROM_XPATH,	/* The XPath module */
-    XML_FROM_XPOINTER,	/* The XPointer module */
-    XML_FROM_REGEXP,	/* The regular expressions module */
-    XML_FROM_DATATYPE,	/* The W3C XML Schemas Datatype module */
-    XML_FROM_SCHEMASP,	/* The W3C XML Schemas parser module */
-    XML_FROM_SCHEMASV,	/* The W3C XML Schemas validation module */
-    XML_FROM_RELAXNGP,	/* The Relax-NG parser module */
-    XML_FROM_RELAXNGV,	/* The Relax-NG validator module */
-    XML_FROM_CATALOG,	/* The Catalog module */
-    XML_FROM_C14N,	/* The Canonicalization module */
-    XML_FROM_XSLT,	/* The XSLT engine from libxslt */
-    XML_FROM_VALID,	/* The XML DTD validation with valid context */
-    XML_FROM_CHECK,	/* The error checking module */
-    XML_FROM_WRITER,	/* The xmlwriter module */
-    XML_FROM_MODULE,	/* The dynamically loaded module module*/
-    XML_FROM_I18N,	/* The module handling character conversion */
-    XML_FROM_SCHEMATRONV	/* The Schematron validator module */
-} xmlErrorDomain;
-
-/**
- * xmlError:
- *
- * An XML Error instance.
- */
-
-typedef struct _xmlError xmlError;
-typedef xmlError *xmlErrorPtr;
-struct _xmlError {
-    int		domain;	/* What part of the library raised this error */
-    int		code;	/* The error code, e.g. an xmlParserError */
-    char       *message;/* human-readable informative error message */
-    xmlErrorLevel level;/* how consequent is the error */
-    char       *file;	/* the filename */
-    int		line;	/* the line number if available */
-    char       *str1;	/* extra string information */
-    char       *str2;	/* extra string information */
-    char       *str3;	/* extra string information */
-    int		int1;	/* extra number information */
-    int		int2;	/* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */
-    void       *ctxt;   /* the parser context if available */
-    void       *node;   /* the node in the tree */
-};
-
-/**
- * xmlParserError:
- *
- * This is an error that the XML (or HTML) parser can generate
- */
-typedef enum {
-    XML_ERR_OK = 0,
-    XML_ERR_INTERNAL_ERROR, /* 1 */
-    XML_ERR_NO_MEMORY, /* 2 */
-    XML_ERR_DOCUMENT_START, /* 3 */
-    XML_ERR_DOCUMENT_EMPTY, /* 4 */
-    XML_ERR_DOCUMENT_END, /* 5 */
-    XML_ERR_INVALID_HEX_CHARREF, /* 6 */
-    XML_ERR_INVALID_DEC_CHARREF, /* 7 */
-    XML_ERR_INVALID_CHARREF, /* 8 */
-    XML_ERR_INVALID_CHAR, /* 9 */
-    XML_ERR_CHARREF_AT_EOF, /* 10 */
-    XML_ERR_CHARREF_IN_PROLOG, /* 11 */
-    XML_ERR_CHARREF_IN_EPILOG, /* 12 */
-    XML_ERR_CHARREF_IN_DTD, /* 13 */
-    XML_ERR_ENTITYREF_AT_EOF, /* 14 */
-    XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */
-    XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */
-    XML_ERR_ENTITYREF_IN_DTD, /* 17 */
-    XML_ERR_PEREF_AT_EOF, /* 18 */
-    XML_ERR_PEREF_IN_PROLOG, /* 19 */
-    XML_ERR_PEREF_IN_EPILOG, /* 20 */
-    XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */
-    XML_ERR_ENTITYREF_NO_NAME, /* 22 */
-    XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */
-    XML_ERR_PEREF_NO_NAME, /* 24 */
-    XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */
-    XML_ERR_UNDECLARED_ENTITY, /* 26 */
-    XML_WAR_UNDECLARED_ENTITY, /* 27 */
-    XML_ERR_UNPARSED_ENTITY, /* 28 */
-    XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */
-    XML_ERR_ENTITY_IS_PARAMETER, /* 30 */
-    XML_ERR_UNKNOWN_ENCODING, /* 31 */
-    XML_ERR_UNSUPPORTED_ENCODING, /* 32 */
-    XML_ERR_STRING_NOT_STARTED, /* 33 */
-    XML_ERR_STRING_NOT_CLOSED, /* 34 */
-    XML_ERR_NS_DECL_ERROR, /* 35 */
-    XML_ERR_ENTITY_NOT_STARTED, /* 36 */
-    XML_ERR_ENTITY_NOT_FINISHED, /* 37 */
-    XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
-    XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */
-    XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */
-    XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */
-    XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */
-    XML_ERR_LITERAL_NOT_STARTED, /* 43 */
-    XML_ERR_LITERAL_NOT_FINISHED, /* 44 */
-    XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
-    XML_ERR_PI_NOT_STARTED, /* 46 */
-    XML_ERR_PI_NOT_FINISHED, /* 47 */
-    XML_ERR_NOTATION_NOT_STARTED, /* 48 */
-    XML_ERR_NOTATION_NOT_FINISHED, /* 49 */
-    XML_ERR_ATTLIST_NOT_STARTED, /* 50 */
-    XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */
-    XML_ERR_MIXED_NOT_STARTED, /* 52 */
-    XML_ERR_MIXED_NOT_FINISHED, /* 53 */
-    XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */
-    XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */
-    XML_ERR_XMLDECL_NOT_STARTED, /* 56 */
-    XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */
-    XML_ERR_CONDSEC_NOT_STARTED, /* 58 */
-    XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */
-    XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */
-    XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */
-    XML_ERR_MISPLACED_CDATA_END, /* 62 */
-    XML_ERR_CDATA_NOT_FINISHED, /* 63 */
-    XML_ERR_RESERVED_XML_NAME, /* 64 */
-    XML_ERR_SPACE_REQUIRED, /* 65 */
-    XML_ERR_SEPARATOR_REQUIRED, /* 66 */
-    XML_ERR_NMTOKEN_REQUIRED, /* 67 */
-    XML_ERR_NAME_REQUIRED, /* 68 */
-    XML_ERR_PCDATA_REQUIRED, /* 69 */
-    XML_ERR_URI_REQUIRED, /* 70 */
-    XML_ERR_PUBID_REQUIRED, /* 71 */
-    XML_ERR_LT_REQUIRED, /* 72 */
-    XML_ERR_GT_REQUIRED, /* 73 */
-    XML_ERR_LTSLASH_REQUIRED, /* 74 */
-    XML_ERR_EQUAL_REQUIRED, /* 75 */
-    XML_ERR_TAG_NAME_MISMATCH, /* 76 */
-    XML_ERR_TAG_NOT_FINISHED, /* 77 */
-    XML_ERR_STANDALONE_VALUE, /* 78 */
-    XML_ERR_ENCODING_NAME, /* 79 */
-    XML_ERR_HYPHEN_IN_COMMENT, /* 80 */
-    XML_ERR_INVALID_ENCODING, /* 81 */
-    XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */
-    XML_ERR_CONDSEC_INVALID, /* 83 */
-    XML_ERR_VALUE_REQUIRED, /* 84 */
-    XML_ERR_NOT_WELL_BALANCED, /* 85 */
-    XML_ERR_EXTRA_CONTENT, /* 86 */
-    XML_ERR_ENTITY_CHAR_ERROR, /* 87 */
-    XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
-    XML_ERR_ENTITY_LOOP, /* 89 */
-    XML_ERR_ENTITY_BOUNDARY, /* 90 */
-    XML_ERR_INVALID_URI, /* 91 */
-    XML_ERR_URI_FRAGMENT, /* 92 */
-    XML_WAR_CATALOG_PI, /* 93 */
-    XML_ERR_NO_DTD, /* 94 */
-    XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */
-    XML_ERR_VERSION_MISSING, /* 96 */
-    XML_WAR_UNKNOWN_VERSION, /* 97 */
-    XML_WAR_LANG_VALUE, /* 98 */
-    XML_WAR_NS_URI, /* 99 */
-    XML_WAR_NS_URI_RELATIVE, /* 100 */
-    XML_ERR_MISSING_ENCODING, /* 101 */
-    XML_WAR_SPACE_VALUE, /* 102 */
-    XML_ERR_NOT_STANDALONE, /* 103 */
-    XML_ERR_ENTITY_PROCESSING, /* 104 */
-    XML_ERR_NOTATION_PROCESSING, /* 105 */
-    XML_WAR_NS_COLUMN, /* 106 */
-    XML_WAR_ENTITY_REDEFINED, /* 107 */
-    XML_ERR_UNKNOWN_VERSION, /* 108 */
-    XML_ERR_VERSION_MISMATCH, /* 109 */
-    XML_NS_ERR_XML_NAMESPACE = 200,
-    XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
-    XML_NS_ERR_QNAME, /* 202 */
-    XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */
-    XML_NS_ERR_EMPTY, /* 204 */
-    XML_NS_ERR_COLON, /* 205 */
-    XML_DTD_ATTRIBUTE_DEFAULT = 500,
-    XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */
-    XML_DTD_ATTRIBUTE_VALUE, /* 502 */
-    XML_DTD_CONTENT_ERROR, /* 503 */
-    XML_DTD_CONTENT_MODEL, /* 504 */
-    XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */
-    XML_DTD_DIFFERENT_PREFIX, /* 506 */
-    XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */
-    XML_DTD_ELEM_NAMESPACE, /* 508 */
-    XML_DTD_ELEM_REDEFINED, /* 509 */
-    XML_DTD_EMPTY_NOTATION, /* 510 */
-    XML_DTD_ENTITY_TYPE, /* 511 */
-    XML_DTD_ID_FIXED, /* 512 */
-    XML_DTD_ID_REDEFINED, /* 513 */
-    XML_DTD_ID_SUBSET, /* 514 */
-    XML_DTD_INVALID_CHILD, /* 515 */
-    XML_DTD_INVALID_DEFAULT, /* 516 */
-    XML_DTD_LOAD_ERROR, /* 517 */
-    XML_DTD_MISSING_ATTRIBUTE, /* 518 */
-    XML_DTD_MIXED_CORRUPT, /* 519 */
-    XML_DTD_MULTIPLE_ID, /* 520 */
-    XML_DTD_NO_DOC, /* 521 */
-    XML_DTD_NO_DTD, /* 522 */
-    XML_DTD_NO_ELEM_NAME, /* 523 */
-    XML_DTD_NO_PREFIX, /* 524 */
-    XML_DTD_NO_ROOT, /* 525 */
-    XML_DTD_NOTATION_REDEFINED, /* 526 */
-    XML_DTD_NOTATION_VALUE, /* 527 */
-    XML_DTD_NOT_EMPTY, /* 528 */
-    XML_DTD_NOT_PCDATA, /* 529 */
-    XML_DTD_NOT_STANDALONE, /* 530 */
-    XML_DTD_ROOT_NAME, /* 531 */
-    XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */
-    XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */
-    XML_DTD_UNKNOWN_ELEM, /* 534 */
-    XML_DTD_UNKNOWN_ENTITY, /* 535 */
-    XML_DTD_UNKNOWN_ID, /* 536 */
-    XML_DTD_UNKNOWN_NOTATION, /* 537 */
-    XML_DTD_STANDALONE_DEFAULTED, /* 538 */
-    XML_DTD_XMLID_VALUE, /* 539 */
-    XML_DTD_XMLID_TYPE, /* 540 */
-    XML_DTD_DUP_TOKEN, /* 541 */
-    XML_HTML_STRUCURE_ERROR = 800,
-    XML_HTML_UNKNOWN_TAG, /* 801 */
-    XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
-    XML_RNGP_ATTR_CONFLICT, /* 1001 */
-    XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */
-    XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */
-    XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */
-    XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */
-    XML_RNGP_CHOICE_CONTENT, /* 1006 */
-    XML_RNGP_CHOICE_EMPTY, /* 1007 */
-    XML_RNGP_CREATE_FAILURE, /* 1008 */
-    XML_RNGP_DATA_CONTENT, /* 1009 */
-    XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */
-    XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */
-    XML_RNGP_DEFINE_EMPTY, /* 1012 */
-    XML_RNGP_DEFINE_MISSING, /* 1013 */
-    XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */
-    XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */
-    XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */
-    XML_RNGP_ELEMENT_EMPTY, /* 1017 */
-    XML_RNGP_ELEMENT_CONTENT, /* 1018 */
-    XML_RNGP_ELEMENT_NAME, /* 1019 */
-    XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */
-    XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */
-    XML_RNGP_EMPTY, /* 1022 */
-    XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */
-    XML_RNGP_EMPTY_CONTENT, /* 1024 */
-    XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */
-    XML_RNGP_ERROR_TYPE_LIB, /* 1026 */
-    XML_RNGP_EXCEPT_EMPTY, /* 1027 */
-    XML_RNGP_EXCEPT_MISSING, /* 1028 */
-    XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */
-    XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */
-    XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */
-    XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */
-    XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */
-    XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */
-    XML_RNGP_FOREIGN_ELEMENT, /* 1035 */
-    XML_RNGP_GRAMMAR_CONTENT, /* 1036 */
-    XML_RNGP_GRAMMAR_EMPTY, /* 1037 */
-    XML_RNGP_GRAMMAR_MISSING, /* 1038 */
-    XML_RNGP_GRAMMAR_NO_START, /* 1039 */
-    XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */
-    XML_RNGP_HREF_ERROR, /* 1041 */
-    XML_RNGP_INCLUDE_EMPTY, /* 1042 */
-    XML_RNGP_INCLUDE_FAILURE, /* 1043 */
-    XML_RNGP_INCLUDE_RECURSE, /* 1044 */
-    XML_RNGP_INTERLEAVE_ADD, /* 1045 */
-    XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */
-    XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */
-    XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */
-    XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */
-    XML_RNGP_INVALID_URI, /* 1050 */
-    XML_RNGP_INVALID_VALUE, /* 1051 */
-    XML_RNGP_MISSING_HREF, /* 1052 */
-    XML_RNGP_NAME_MISSING, /* 1053 */
-    XML_RNGP_NEED_COMBINE, /* 1054 */
-    XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */
-    XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */
-    XML_RNGP_NSNAME_NO_NS, /* 1057 */
-    XML_RNGP_PARAM_FORBIDDEN, /* 1058 */
-    XML_RNGP_PARAM_NAME_MISSING, /* 1059 */
-    XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */
-    XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */
-    XML_RNGP_PARENTREF_NO_NAME, /* 1062 */
-    XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */
-    XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */
-    XML_RNGP_PARSE_ERROR, /* 1065 */
-    XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */
-    XML_RNGP_PAT_ATTR_ATTR, /* 1067 */
-    XML_RNGP_PAT_ATTR_ELEM, /* 1068 */
-    XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */
-    XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */
-    XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */
-    XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */
-    XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */
-    XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */
-    XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */
-    XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */
-    XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */
-    XML_RNGP_PAT_LIST_ATTR, /* 1078 */
-    XML_RNGP_PAT_LIST_ELEM, /* 1079 */
-    XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */
-    XML_RNGP_PAT_LIST_LIST, /* 1081 */
-    XML_RNGP_PAT_LIST_REF, /* 1082 */
-    XML_RNGP_PAT_LIST_TEXT, /* 1083 */
-    XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */
-    XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */
-    XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */
-    XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */
-    XML_RNGP_PAT_START_ATTR, /* 1088 */
-    XML_RNGP_PAT_START_DATA, /* 1089 */
-    XML_RNGP_PAT_START_EMPTY, /* 1090 */
-    XML_RNGP_PAT_START_GROUP, /* 1091 */
-    XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */
-    XML_RNGP_PAT_START_LIST, /* 1093 */
-    XML_RNGP_PAT_START_ONEMORE, /* 1094 */
-    XML_RNGP_PAT_START_TEXT, /* 1095 */
-    XML_RNGP_PAT_START_VALUE, /* 1096 */
-    XML_RNGP_PREFIX_UNDEFINED, /* 1097 */
-    XML_RNGP_REF_CREATE_FAILED, /* 1098 */
-    XML_RNGP_REF_CYCLE, /* 1099 */
-    XML_RNGP_REF_NAME_INVALID, /* 1100 */
-    XML_RNGP_REF_NO_DEF, /* 1101 */
-    XML_RNGP_REF_NO_NAME, /* 1102 */
-    XML_RNGP_REF_NOT_EMPTY, /* 1103 */
-    XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */
-    XML_RNGP_START_CONTENT, /* 1105 */
-    XML_RNGP_START_EMPTY, /* 1106 */
-    XML_RNGP_START_MISSING, /* 1107 */
-    XML_RNGP_TEXT_EXPECTED, /* 1108 */
-    XML_RNGP_TEXT_HAS_CHILD, /* 1109 */
-    XML_RNGP_TYPE_MISSING, /* 1110 */
-    XML_RNGP_TYPE_NOT_FOUND, /* 1111 */
-    XML_RNGP_TYPE_VALUE, /* 1112 */
-    XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */
-    XML_RNGP_UNKNOWN_COMBINE, /* 1114 */
-    XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */
-    XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */
-    XML_RNGP_URI_FRAGMENT, /* 1117 */
-    XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */
-    XML_RNGP_VALUE_EMPTY, /* 1119 */
-    XML_RNGP_VALUE_NO_CONTENT, /* 1120 */
-    XML_RNGP_XMLNS_NAME, /* 1121 */
-    XML_RNGP_XML_NS, /* 1122 */
-    XML_XPATH_EXPRESSION_OK = 1200,
-    XML_XPATH_NUMBER_ERROR, /* 1201 */
-    XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */
-    XML_XPATH_START_LITERAL_ERROR, /* 1203 */
-    XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */
-    XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */
-    XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */
-    XML_XPATH_EXPR_ERROR, /* 1207 */
-    XML_XPATH_UNCLOSED_ERROR, /* 1208 */
-    XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */
-    XML_XPATH_INVALID_OPERAND, /* 1210 */
-    XML_XPATH_INVALID_TYPE, /* 1211 */
-    XML_XPATH_INVALID_ARITY, /* 1212 */
-    XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */
-    XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */
-    XML_XPATH_MEMORY_ERROR, /* 1215 */
-    XML_XPTR_SYNTAX_ERROR, /* 1216 */
-    XML_XPTR_RESOURCE_ERROR, /* 1217 */
-    XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */
-    XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */
-    XML_XPATH_ENCODING_ERROR, /* 1220 */
-    XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */
-    XML_TREE_INVALID_HEX = 1300,
-    XML_TREE_INVALID_DEC, /* 1301 */
-    XML_TREE_UNTERMINATED_ENTITY, /* 1302 */
-    XML_TREE_NOT_UTF8, /* 1303 */
-    XML_SAVE_NOT_UTF8 = 1400,
-    XML_SAVE_CHAR_INVALID, /* 1401 */
-    XML_SAVE_NO_DOCTYPE, /* 1402 */
-    XML_SAVE_UNKNOWN_ENCODING, /* 1403 */
-    XML_REGEXP_COMPILE_ERROR = 1450,
-    XML_IO_UNKNOWN = 1500,
-    XML_IO_EACCES, /* 1501 */
-    XML_IO_EAGAIN, /* 1502 */
-    XML_IO_EBADF, /* 1503 */
-    XML_IO_EBADMSG, /* 1504 */
-    XML_IO_EBUSY, /* 1505 */
-    XML_IO_ECANCELED, /* 1506 */
-    XML_IO_ECHILD, /* 1507 */
-    XML_IO_EDEADLK, /* 1508 */
-    XML_IO_EDOM, /* 1509 */
-    XML_IO_EEXIST, /* 1510 */
-    XML_IO_EFAULT, /* 1511 */
-    XML_IO_EFBIG, /* 1512 */
-    XML_IO_EINPROGRESS, /* 1513 */
-    XML_IO_EINTR, /* 1514 */
-    XML_IO_EINVAL, /* 1515 */
-    XML_IO_EIO, /* 1516 */
-    XML_IO_EISDIR, /* 1517 */
-    XML_IO_EMFILE, /* 1518 */
-    XML_IO_EMLINK, /* 1519 */
-    XML_IO_EMSGSIZE, /* 1520 */
-    XML_IO_ENAMETOOLONG, /* 1521 */
-    XML_IO_ENFILE, /* 1522 */
-    XML_IO_ENODEV, /* 1523 */
-    XML_IO_ENOENT, /* 1524 */
-    XML_IO_ENOEXEC, /* 1525 */
-    XML_IO_ENOLCK, /* 1526 */
-    XML_IO_ENOMEM, /* 1527 */
-    XML_IO_ENOSPC, /* 1528 */
-    XML_IO_ENOSYS, /* 1529 */
-    XML_IO_ENOTDIR, /* 1530 */
-    XML_IO_ENOTEMPTY, /* 1531 */
-    XML_IO_ENOTSUP, /* 1532 */
-    XML_IO_ENOTTY, /* 1533 */
-    XML_IO_ENXIO, /* 1534 */
-    XML_IO_EPERM, /* 1535 */
-    XML_IO_EPIPE, /* 1536 */
-    XML_IO_ERANGE, /* 1537 */
-    XML_IO_EROFS, /* 1538 */
-    XML_IO_ESPIPE, /* 1539 */
-    XML_IO_ESRCH, /* 1540 */
-    XML_IO_ETIMEDOUT, /* 1541 */
-    XML_IO_EXDEV, /* 1542 */
-    XML_IO_NETWORK_ATTEMPT, /* 1543 */
-    XML_IO_ENCODER, /* 1544 */
-    XML_IO_FLUSH, /* 1545 */
-    XML_IO_WRITE, /* 1546 */
-    XML_IO_NO_INPUT, /* 1547 */
-    XML_IO_BUFFER_FULL, /* 1548 */
-    XML_IO_LOAD_ERROR, /* 1549 */
-    XML_IO_ENOTSOCK, /* 1550 */
-    XML_IO_EISCONN, /* 1551 */
-    XML_IO_ECONNREFUSED, /* 1552 */
-    XML_IO_ENETUNREACH, /* 1553 */
-    XML_IO_EADDRINUSE, /* 1554 */
-    XML_IO_EALREADY, /* 1555 */
-    XML_IO_EAFNOSUPPORT, /* 1556 */
-    XML_XINCLUDE_RECURSION=1600,
-    XML_XINCLUDE_PARSE_VALUE, /* 1601 */
-    XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
-    XML_XINCLUDE_NO_HREF, /* 1603 */
-    XML_XINCLUDE_NO_FALLBACK, /* 1604 */
-    XML_XINCLUDE_HREF_URI, /* 1605 */
-    XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */
-    XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */
-    XML_XINCLUDE_INVALID_CHAR, /* 1608 */
-    XML_XINCLUDE_BUILD_FAILED, /* 1609 */
-    XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */
-    XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */
-    XML_XINCLUDE_XPTR_FAILED, /* 1612 */
-    XML_XINCLUDE_XPTR_RESULT, /* 1613 */
-    XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */
-    XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */
-    XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */
-    XML_XINCLUDE_DEPRECATED_NS, /* 1617 */
-    XML_XINCLUDE_FRAGMENT_ID, /* 1618 */
-    XML_CATALOG_MISSING_ATTR = 1650,
-    XML_CATALOG_ENTRY_BROKEN, /* 1651 */
-    XML_CATALOG_PREFER_VALUE, /* 1652 */
-    XML_CATALOG_NOT_CATALOG, /* 1653 */
-    XML_CATALOG_RECURSION, /* 1654 */
-    XML_SCHEMAP_PREFIX_UNDEFINED = 1700,
-    XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */
-    XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */
-    XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */
-    XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */
-    XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */
-    XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */
-    XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */
-    XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */
-    XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */
-    XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */
-    XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */
-    XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */
-    XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */
-    XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */
-    XML_SCHEMAP_INVALID_ENUM, /* 1715 */
-    XML_SCHEMAP_INVALID_FACET, /* 1716 */
-    XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */
-    XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */
-    XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */
-    XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */
-    XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */
-    XML_SCHEMAP_NOATTR_NOREF, /* 1722 */
-    XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */
-    XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */
-    XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */
-    XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */
-    XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */
-    XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */
-    XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */
-    XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */
-    XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */
-    XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */
-    XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */
-    XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */
-    XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */
-    XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */
-    XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */
-    XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */
-    XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */
-    XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */
-    XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */
-    XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */
-    XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */
-    XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */
-    XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */
-    XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */
-    XML_SCHEMAP_UNKNOWN_REF, /* 1747 */
-    XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */
-    XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */
-    XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */
-    XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */
-    XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */
-    XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */
-    XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */
-    XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */
-    XML_SCHEMAP_REGEXP_INVALID, /* 1756 */
-    XML_SCHEMAP_FAILED_LOAD, /* 1757 */
-    XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */
-    XML_SCHEMAP_NOROOT, /* 1759 */
-    XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */
-    XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */
-    XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */
-    XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */
-    XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */
-    XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */
-    XML_SCHEMAP_FAILED_PARSE, /* 1766 */
-    XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */
-    XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */
-    XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */
-    XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */
-    XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */
-    XML_SCHEMAP_NOT_SCHEMA, /* 1772 */
-    XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */
-    XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */
-    XML_SCHEMAP_RECURSIVE, /* 1775 */
-    XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */
-    XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */
-    XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */
-    XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */
-    XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */
-    XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */
-    XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */
-    XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */
-    XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */
-    XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */
-    XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */
-    XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */
-    XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */
-    XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */
-    XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */
-    XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */
-    XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */
-    XML_SCHEMAV_NOROOT = 1801,
-    XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */
-    XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */
-    XML_SCHEMAV_MISSING, /* 1804 */
-    XML_SCHEMAV_WRONGELEM, /* 1805 */
-    XML_SCHEMAV_NOTYPE, /* 1806 */
-    XML_SCHEMAV_NOROLLBACK, /* 1807 */
-    XML_SCHEMAV_ISABSTRACT, /* 1808 */
-    XML_SCHEMAV_NOTEMPTY, /* 1809 */
-    XML_SCHEMAV_ELEMCONT, /* 1810 */
-    XML_SCHEMAV_HAVEDEFAULT, /* 1811 */
-    XML_SCHEMAV_NOTNILLABLE, /* 1812 */
-    XML_SCHEMAV_EXTRACONTENT, /* 1813 */
-    XML_SCHEMAV_INVALIDATTR, /* 1814 */
-    XML_SCHEMAV_INVALIDELEM, /* 1815 */
-    XML_SCHEMAV_NOTDETERMINIST, /* 1816 */
-    XML_SCHEMAV_CONSTRUCT, /* 1817 */
-    XML_SCHEMAV_INTERNAL, /* 1818 */
-    XML_SCHEMAV_NOTSIMPLE, /* 1819 */
-    XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */
-    XML_SCHEMAV_ATTRINVALID, /* 1821 */
-    XML_SCHEMAV_VALUE, /* 1822 */
-    XML_SCHEMAV_FACET, /* 1823 */
-    XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */
-    XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */
-    XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */
-    XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */
-    XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */
-    XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */
-    XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */
-    XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */
-    XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */
-    XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */
-    XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */
-    XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */
-    XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */
-    XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */
-    XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */
-    XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */
-    XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */
-    XML_SCHEMAV_CVC_ELT_1, /* 1845 */
-    XML_SCHEMAV_CVC_ELT_2, /* 1846 */
-    XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */
-    XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */
-    XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */
-    XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */
-    XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */
-    XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */
-    XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */
-    XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */
-    XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */
-    XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */
-    XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */
-    XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */
-    XML_SCHEMAV_CVC_ELT_6, /* 1859 */
-    XML_SCHEMAV_CVC_ELT_7, /* 1860 */
-    XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */
-    XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */
-    XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */
-    XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */
-    XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */
-    XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */
-    XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */
-    XML_SCHEMAV_CVC_AU, /* 1874 */
-    XML_SCHEMAV_CVC_TYPE_1, /* 1875 */
-    XML_SCHEMAV_CVC_TYPE_2, /* 1876 */
-    XML_SCHEMAV_CVC_IDC, /* 1877 */
-    XML_SCHEMAV_CVC_WILDCARD, /* 1878 */
-    XML_SCHEMAV_MISC, /* 1879 */
-    XML_XPTR_UNKNOWN_SCHEME = 1900,
-    XML_XPTR_CHILDSEQ_START, /* 1901 */
-    XML_XPTR_EVAL_FAILED, /* 1902 */
-    XML_XPTR_EXTRA_OBJECTS, /* 1903 */
-    XML_C14N_CREATE_CTXT = 1950,
-    XML_C14N_REQUIRES_UTF8, /* 1951 */
-    XML_C14N_CREATE_STACK, /* 1952 */
-    XML_C14N_INVALID_NODE, /* 1953 */
-    XML_C14N_UNKNOW_NODE, /* 1954 */
-    XML_C14N_RELATIVE_NAMESPACE, /* 1955 */
-    XML_FTP_PASV_ANSWER = 2000,
-    XML_FTP_EPSV_ANSWER, /* 2001 */
-    XML_FTP_ACCNT, /* 2002 */
-    XML_FTP_URL_SYNTAX, /* 2003 */
-    XML_HTTP_URL_SYNTAX = 2020,
-    XML_HTTP_USE_IP, /* 2021 */
-    XML_HTTP_UNKNOWN_HOST, /* 2022 */
-    XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000,
-    XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */
-    XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */
-    XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */
-    XML_SCHEMAP_SRC_RESOLVE, /* 3004 */
-    XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */
-    XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */
-    XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */
-    XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */
-    XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */
-    XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */
-    XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */
-    XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */
-    XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */
-    XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */
-    XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */
-    XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */
-    XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */
-    XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */
-    XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */
-    XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */
-    XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */
-    XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */
-    XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */
-    XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */
-    XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */
-    XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */
-    XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */
-    XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */
-    XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */
-    XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */
-    XML_SCHEMAP_SRC_INCLUDE, /* 3050 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */
-    XML_SCHEMAP_NO_XMLNS, /* 3056 */
-    XML_SCHEMAP_NO_XSI, /* 3057 */
-    XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */
-    XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */
-    XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */
-    XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */
-    XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */
-    XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */
-    XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */
-    XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */
-    XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */
-    XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */
-    XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */
-    XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */
-    XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */
-    XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */
-    XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */
-    XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */
-    XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */
-    XML_SCHEMAP_SRC_CT_1, /* 3076 */
-    XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */
-    XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */
-    XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */
-    XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */
-    XML_SCHEMAP_SRC_REDEFINE, /* 3081 */
-    XML_SCHEMAP_SRC_IMPORT, /* 3082 */
-    XML_SCHEMAP_WARN_SKIP_SCHEMA, /* 3083 */
-    XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */
-    XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */
-    XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */
-    XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */
-    XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */
-    XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */
-    XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */
-    XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */
-    XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */
-    XML_SCHEMATRONV_REPORT,
-    XML_MODULE_OPEN = 4900, /* 4900 */
-    XML_MODULE_CLOSE, /* 4901 */
-    XML_CHECK_FOUND_ELEMENT = 5000,
-    XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */
-    XML_CHECK_FOUND_TEXT, /* 5002 */
-    XML_CHECK_FOUND_CDATA, /* 5003 */
-    XML_CHECK_FOUND_ENTITYREF, /* 5004 */
-    XML_CHECK_FOUND_ENTITY, /* 5005 */
-    XML_CHECK_FOUND_PI, /* 5006 */
-    XML_CHECK_FOUND_COMMENT, /* 5007 */
-    XML_CHECK_FOUND_DOCTYPE, /* 5008 */
-    XML_CHECK_FOUND_FRAGMENT, /* 5009 */
-    XML_CHECK_FOUND_NOTATION, /* 5010 */
-    XML_CHECK_UNKNOWN_NODE, /* 5011 */
-    XML_CHECK_ENTITY_TYPE, /* 5012 */
-    XML_CHECK_NO_PARENT, /* 5013 */
-    XML_CHECK_NO_DOC, /* 5014 */
-    XML_CHECK_NO_NAME, /* 5015 */
-    XML_CHECK_NO_ELEM, /* 5016 */
-    XML_CHECK_WRONG_DOC, /* 5017 */
-    XML_CHECK_NO_PREV, /* 5018 */
-    XML_CHECK_WRONG_PREV, /* 5019 */
-    XML_CHECK_NO_NEXT, /* 5020 */
-    XML_CHECK_WRONG_NEXT, /* 5021 */
-    XML_CHECK_NOT_DTD, /* 5022 */
-    XML_CHECK_NOT_ATTR, /* 5023 */
-    XML_CHECK_NOT_ATTR_DECL, /* 5024 */
-    XML_CHECK_NOT_ELEM_DECL, /* 5025 */
-    XML_CHECK_NOT_ENTITY_DECL, /* 5026 */
-    XML_CHECK_NOT_NS_DECL, /* 5027 */
-    XML_CHECK_NO_HREF, /* 5028 */
-    XML_CHECK_WRONG_PARENT,/* 5029 */
-    XML_CHECK_NS_SCOPE, /* 5030 */
-    XML_CHECK_NS_ANCESTOR, /* 5031 */
-    XML_CHECK_NOT_UTF8, /* 5032 */
-    XML_CHECK_NO_DICT, /* 5033 */
-    XML_CHECK_NOT_NCNAME, /* 5034 */
-    XML_CHECK_OUTSIDE_DICT, /* 5035 */
-    XML_CHECK_WRONG_NAME, /* 5036 */
-    XML_CHECK_NAME_NOT_NULL, /* 5037 */
-    XML_I18N_NO_NAME = 6000,
-    XML_I18N_NO_HANDLER, /* 6001 */
-    XML_I18N_EXCESS_HANDLER, /* 6002 */
-    XML_I18N_CONV_FAILED, /* 6003 */
-    XML_I18N_NO_OUTPUT /* 6004 */
-#if 0
-    XML_CHECK_, /* 5033 */
-    XML_CHECK_X /* 503 */
-#endif
-} xmlParserErrors;
-
-/**
- * xmlGenericErrorFunc:
- * @ctx:  a parsing context
- * @msg:  the message
- * @...:  the extra arguments of the varags to format the message
- *
- * Signature of the function to use when there is an error and
- * no parsing or validity context available .
- */
-typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(2,3);
-/**
- * xmlStructuredErrorFunc:
- * @userData:  user provided data for the error callback
- * @error:  the error being raised.
- *
- * Signature of the function to use when there is an error and
- * the module handles the new error reporting mechanism.
- */
-typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
-
-/*
- * Use the following function to reset the two global variables
- * xmlGenericError and xmlGenericErrorContext.
- */
-XMLPUBFUN void XMLCALL
-    xmlSetGenericErrorFunc	(void *ctx,
-				 xmlGenericErrorFunc handler);
-XMLPUBFUN void XMLCALL
-    initGenericErrorDefaultFunc	(xmlGenericErrorFunc *handler);
-
-XMLPUBFUN void XMLCALL
-    xmlSetStructuredErrorFunc	(void *ctx,
-				 xmlStructuredErrorFunc handler);
-/*
- * Default message routines used by SAX and Valid context for error
- * and warning reporting.
- */
-XMLPUBFUN void XMLCDECL
-    xmlParserError		(void *ctx,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(2,3);
-XMLPUBFUN void XMLCDECL
-    xmlParserWarning		(void *ctx,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(2,3);
-XMLPUBFUN void XMLCDECL
-    xmlParserValidityError	(void *ctx,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(2,3);
-XMLPUBFUN void XMLCDECL
-    xmlParserValidityWarning	(void *ctx,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(2,3);
-XMLPUBFUN void XMLCALL
-    xmlParserPrintFileInfo	(xmlParserInputPtr input);
-XMLPUBFUN void XMLCALL
-    xmlParserPrintFileContext	(xmlParserInputPtr input);
-
-/*
- * Extended error information routines
- */
-XMLPUBFUN xmlErrorPtr XMLCALL
-    xmlGetLastError		(void);
-XMLPUBFUN void XMLCALL
-    xmlResetLastError		(void);
-XMLPUBFUN xmlErrorPtr XMLCALL
-    xmlCtxtGetLastError		(void *ctx);
-XMLPUBFUN void XMLCALL
-    xmlCtxtResetLastError	(void *ctx);
-XMLPUBFUN void XMLCALL
-    xmlResetError		(xmlErrorPtr err);
-XMLPUBFUN int XMLCALL
-    xmlCopyError		(xmlErrorPtr from,
-				 xmlErrorPtr to);
-
-#ifdef IN_LIBXML
-/*
- * Internal callback reporting routine
- */
-XMLPUBFUN void XMLCALL
-    __xmlRaiseError		(xmlStructuredErrorFunc schannel,
-				 xmlGenericErrorFunc channel,
-				 void *data,
-                                 void *ctx,
-				 void *node,
-				 int domain,
-				 int code,
-				 xmlErrorLevel level,
-				 const char *file,
-				 int line,
-				 const char *str1,
-				 const char *str2,
-				 const char *str3,
-				 int int1,
-				 int col,
-				 const char *msg,
-				 ...) ATTRIBUTE_PRINTF(16,17);
-XMLPUBFUN void XMLCALL
-    __xmlSimpleError		(int domain,
-				 int code,
-				 xmlNodePtr node,
-				 const char *msg,
-				 const char *extra);
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_ERROR_H__ */
diff --git a/interfaces/ext/libxml/xmlexports.h b/interfaces/ext/libxml/xmlexports.h
deleted file mode 100644
index 29a6f54..0000000
--- a/interfaces/ext/libxml/xmlexports.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Summary: macros for marking symbols as exportable/importable.
- * Description: macros for marking symbols as exportable/importable.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Igor Zlatovic <igor at zlatkovic.com>
- */
-
-#ifndef __XML_EXPORTS_H__
-#define __XML_EXPORTS_H__
-
-/**
- * XMLPUBFUN, XMLPUBVAR, XMLCALL
- *
- * Macros which declare an exportable function, an exportable variable and
- * the calling convention used for functions.
- *
- * Please use an extra block for every platform/compiler combination when
- * modifying this, rather than overlong #ifdef lines. This helps
- * readability as well as the fact that different compilers on the same
- * platform might need different definitions.
- */
-
-/**
- * XMLPUBFUN:
- *
- * Macros which declare an exportable function
- */
-#define XMLPUBFUN
-/**
- * XMLPUBVAR:
- *
- * Macros which declare an exportable variable
- */
-#define XMLPUBVAR extern
-/**
- * XMLCALL:
- *
- * Macros which declare the called convention for exported functions
- */
-#define XMLCALL
-/**
- * XMLCDECL:
- *
- * Macro which declares the calling convention for exported functions that 
- * use '...'.
- */
-#define XMLCDECL
-
-/** DOC_DISABLE */
-
-/* Windows platform with MS compiler */
-#if defined(_WIN32) && defined(_MSC_VER)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport)
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #if defined(LIBXML_FASTCALL)
-    #define XMLCALL __fastcall
-  #else
-    #define XMLCALL __cdecl
-  #endif
-  #define XMLCDECL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Windows platform with Borland compiler */
-#if defined(_WIN32) && defined(__BORLANDC__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport) extern
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Windows platform with GNU compiler (Mingw) */
-#if defined(_WIN32) && defined(__MINGW32__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport)
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Cygwin platform, GNU compiler */
-#if defined(_WIN32) && defined(__CYGWIN__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport)
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-#endif
-
-/* Compatibility */
-#if !defined(LIBXML_DLL_IMPORT)
-#define LIBXML_DLL_IMPORT XMLPUBVAR
-#endif
-
-#endif /* __XML_EXPORTS_H__ */
-
-
diff --git a/interfaces/ext/libxml/xmlmemory.h b/interfaces/ext/libxml/xmlmemory.h
deleted file mode 100644
index 8f3b109..0000000
--- a/interfaces/ext/libxml/xmlmemory.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Summary: interface for the memory allocator
- * Description: provides interfaces for the memory allocator,
- *              including debugging capabilities.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __DEBUG_MEMORY_ALLOC__
-#define __DEBUG_MEMORY_ALLOC__
-
-#include <stdio.h>
-#include <libxml/xmlversion.h>
-
-/**
- * DEBUG_MEMORY:
- *
- * DEBUG_MEMORY replaces the allocator with a collect and debug
- * shell to the libc allocator.
- * DEBUG_MEMORY should only be activated when debugging
- * libxml i.e. if libxml has been configured with --with-debug-mem too.
- */
-/* #define DEBUG_MEMORY_FREED */
-/* #define DEBUG_MEMORY_LOCATION */
-
-#ifdef DEBUG
-#ifndef DEBUG_MEMORY
-#define DEBUG_MEMORY
-#endif
-#endif
-
-/**
- * DEBUG_MEMORY_LOCATION:
- *
- * DEBUG_MEMORY_LOCATION should be activated only when debugging
- * libxml i.e. if libxml has been configured with --with-debug-mem too.
- */
-#ifdef DEBUG_MEMORY_LOCATION
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The XML memory wrapper support 4 basic overloadable functions.
- */
-/**
- * xmlFreeFunc:
- * @mem: an already allocated block of memory
- *
- * Signature for a free() implementation.
- */
-typedef void (XMLCALL *xmlFreeFunc)(void *mem);
-/**
- * xmlMallocFunc:
- * @size:  the size requested in bytes
- *
- * Signature for a malloc() implementation.
- *
- * Returns a pointer to the newly allocated block or NULL in case of error.
- */
-typedef void *(ATTRIBUTE_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size);
-
-/**
- * xmlReallocFunc:
- * @mem: an already allocated block of memory
- * @size:  the new size requested in bytes
- *
- * Signature for a realloc() implementation.
- *
- * Returns a pointer to the newly reallocated block or NULL in case of error.
- */
-typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size);
-
-/**
- * xmlStrdupFunc:
- * @str: a zero terminated string
- *
- * Signature for an strdup() implementation.
- *
- * Returns the copy of the string or NULL in case of error.
- */
-typedef char *(XMLCALL *xmlStrdupFunc)(const char *str);
-
-/*
- * The 4 interfaces used for all memory handling within libxml.
-LIBXML_DLL_IMPORT extern xmlFreeFunc xmlFree;
-LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMalloc;
-LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMallocAtomic;
-LIBXML_DLL_IMPORT extern xmlReallocFunc xmlRealloc;
-LIBXML_DLL_IMPORT extern xmlStrdupFunc xmlMemStrdup;
- */
-
-/*
- * The way to overload the existing functions.
- * The xmlGc function have an extra entry for atomic block
- * allocations useful for garbage collected memory allocators
- */
-XMLPUBFUN int XMLCALL
-	xmlMemSetup	(xmlFreeFunc freeFunc,
-			 xmlMallocFunc mallocFunc,
-			 xmlReallocFunc reallocFunc,
-			 xmlStrdupFunc strdupFunc);
-XMLPUBFUN int XMLCALL
-	xmlMemGet	(xmlFreeFunc *freeFunc,
-			 xmlMallocFunc *mallocFunc,
-			 xmlReallocFunc *reallocFunc,
-			 xmlStrdupFunc *strdupFunc);
-XMLPUBFUN int XMLCALL
-	xmlGcMemSetup	(xmlFreeFunc freeFunc,
-			 xmlMallocFunc mallocFunc,
-			 xmlMallocFunc mallocAtomicFunc,
-			 xmlReallocFunc reallocFunc,
-			 xmlStrdupFunc strdupFunc);
-XMLPUBFUN int XMLCALL
-	xmlGcMemGet	(xmlFreeFunc *freeFunc,
-			 xmlMallocFunc *mallocFunc,
-			 xmlMallocFunc *mallocAtomicFunc,
-			 xmlReallocFunc *reallocFunc,
-			 xmlStrdupFunc *strdupFunc);
-
-/*
- * Initialization of the memory layer.
- */
-XMLPUBFUN int XMLCALL
-	xmlInitMemory	(void);
-
-/*
- * Cleanup of the memory layer.
- */
-XMLPUBFUN void XMLCALL
-                xmlCleanupMemory        (void);
-/*
- * These are specific to the XML debug memory wrapper.
- */
-XMLPUBFUN int XMLCALL
-	xmlMemUsed	(void);
-XMLPUBFUN int XMLCALL
-	xmlMemBlocks	(void);
-XMLPUBFUN void XMLCALL
-	xmlMemDisplay	(FILE *fp);
-XMLPUBFUN void XMLCALL
-	xmlMemDisplayLast(FILE *fp, long nbBytes);
-XMLPUBFUN void XMLCALL
-	xmlMemShow	(FILE *fp, int nr);
-XMLPUBFUN void XMLCALL
-	xmlMemoryDump	(void);
-XMLPUBFUN void * XMLCALL
-	xmlMemMalloc	(size_t size) ATTRIBUTE_ALLOC_SIZE(1);
-XMLPUBFUN void * XMLCALL
-	xmlMemRealloc	(void *ptr,size_t size);
-XMLPUBFUN void XMLCALL
-	xmlMemFree	(void *ptr);
-XMLPUBFUN char * XMLCALL
-	xmlMemoryStrdup	(const char *str);
-XMLPUBFUN void * XMLCALL
-	xmlMallocLoc	(size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1);
-XMLPUBFUN void * XMLCALL
-	xmlReallocLoc	(void *ptr, size_t size, const char *file, int line);
-XMLPUBFUN void * XMLCALL
-	xmlMallocAtomicLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1);
-XMLPUBFUN char * XMLCALL
-	xmlMemStrdupLoc	(const char *str, const char *file, int line);
-
-
-#ifdef DEBUG_MEMORY_LOCATION
-/**
- * xmlMalloc:
- * @size:  number of bytes to allocate
- *
- * Wrapper for the malloc() function used in the XML library.
- *
- * Returns the pointer to the allocated area or NULL in case of error.
- */
-#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__)
-/**
- * xmlMallocAtomic:
- * @size:  number of bytes to allocate
- *
- * Wrapper for the malloc() function used in the XML library for allocation
- * of block not containing pointers to other areas.
- *
- * Returns the pointer to the allocated area or NULL in case of error.
- */
-#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__)
-/**
- * xmlRealloc:
- * @ptr:  pointer to the existing allocated area
- * @size:  number of bytes to allocate
- *
- * Wrapper for the realloc() function used in the XML library.
- *
- * Returns the pointer to the allocated area or NULL in case of error.
- */
-#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__)
-/**
- * xmlMemStrdup:
- * @str:  pointer to the existing string
- *
- * Wrapper for the strdup() function, xmlStrdup() is usually preferred.
- *
- * Returns the pointer to the allocated area or NULL in case of error.
- */
-#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__)
-
-#endif /* DEBUG_MEMORY_LOCATION */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#ifndef __XML_GLOBALS_H
-#ifndef __XML_THREADS_H__
-#include <libxml/threads.h>
-#include <libxml/globals.h>
-#endif
-#endif
-
-#endif  /* __DEBUG_MEMORY_ALLOC__ */
-
diff --git a/interfaces/ext/libxml/xmlmodule.h b/interfaces/ext/libxml/xmlmodule.h
deleted file mode 100644
index 8f4a560..0000000
--- a/interfaces/ext/libxml/xmlmodule.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Summary: dynamic module loading
- * Description: basic API for dynamic module loading, used by
- *              libexslt added in 2.6.17
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Joel W. Reed
- */
-
-#ifndef __XML_MODULE_H__
-#define __XML_MODULE_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_MODULES_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlModulePtr:
- *
- * A handle to a dynamically loaded module
- */
-typedef struct _xmlModule xmlModule;
-typedef xmlModule *xmlModulePtr;
-
-/**
- * xmlModuleOption:
- *
- * enumeration of options that can be passed down to xmlModuleOpen()
- */
-typedef enum {
-    XML_MODULE_LAZY = 1,	/* lazy binding */
-    XML_MODULE_LOCAL= 2		/* local binding */
-} xmlModuleOption;
-
-XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen	(const char *filename,
-						 int options);
-
-XMLPUBFUN int XMLCALL xmlModuleSymbol		(xmlModulePtr module,
-						 const char* name,
-						 void **result);
-
-XMLPUBFUN int XMLCALL xmlModuleClose		(xmlModulePtr module);
-
-XMLPUBFUN int XMLCALL xmlModuleFree		(xmlModulePtr module);
-
-#ifdef __cplusplus
-}
-#endif 
-
-#endif /* LIBXML_MODULES_ENABLED */
-
-#endif /*__XML_MODULE_H__ */
diff --git a/interfaces/ext/libxml/xmlreader.h b/interfaces/ext/libxml/xmlreader.h
deleted file mode 100644
index 6964482..0000000
--- a/interfaces/ext/libxml/xmlreader.h
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Summary: the XMLReader implementation
- * Description: API of the XML streaming API based on C# interfaces.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XMLREADER_H__
-#define __XML_XMLREADER_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/xmlIO.h>
-#ifdef LIBXML_SCHEMAS_ENABLED
-#include <libxml/relaxng.h>
-#include <libxml/xmlschemas.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlParserSeverities:
- *
- * How severe an error callback is when the per-reader error callback API
- * is used.
- */
-typedef enum {
-    XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
-    XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
-    XML_PARSER_SEVERITY_WARNING = 3,
-    XML_PARSER_SEVERITY_ERROR = 4
-} xmlParserSeverities;
-
-#ifdef LIBXML_READER_ENABLED
-
-/**
- * xmlTextReaderMode:
- *
- * Internal state values for the reader.
- */
-typedef enum {
-    XML_TEXTREADER_MODE_INITIAL = 0,
-    XML_TEXTREADER_MODE_INTERACTIVE = 1,
-    XML_TEXTREADER_MODE_ERROR = 2,
-    XML_TEXTREADER_MODE_EOF =3,
-    XML_TEXTREADER_MODE_CLOSED = 4,
-    XML_TEXTREADER_MODE_READING = 5
-} xmlTextReaderMode;
-
-/**
- * xmlParserProperties:
- *
- * Some common options to use with xmlTextReaderSetParserProp, but it
- * is better to use xmlParserOption and the xmlReaderNewxxx and
- * xmlReaderForxxx APIs now.
- */
-typedef enum {
-    XML_PARSER_LOADDTD = 1,
-    XML_PARSER_DEFAULTATTRS = 2,
-    XML_PARSER_VALIDATE = 3,
-    XML_PARSER_SUBST_ENTITIES = 4
-} xmlParserProperties;
-
-/**
- * xmlReaderTypes:
- *
- * Predefined constants for the different types of nodes.
- */
-typedef enum {
-    XML_READER_TYPE_NONE = 0,
-    XML_READER_TYPE_ELEMENT = 1,
-    XML_READER_TYPE_ATTRIBUTE = 2,
-    XML_READER_TYPE_TEXT = 3,
-    XML_READER_TYPE_CDATA = 4,
-    XML_READER_TYPE_ENTITY_REFERENCE = 5,
-    XML_READER_TYPE_ENTITY = 6,
-    XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
-    XML_READER_TYPE_COMMENT = 8,
-    XML_READER_TYPE_DOCUMENT = 9,
-    XML_READER_TYPE_DOCUMENT_TYPE = 10,
-    XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
-    XML_READER_TYPE_NOTATION = 12,
-    XML_READER_TYPE_WHITESPACE = 13,
-    XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
-    XML_READER_TYPE_END_ELEMENT = 15,
-    XML_READER_TYPE_END_ENTITY = 16,
-    XML_READER_TYPE_XML_DECLARATION = 17
-} xmlReaderTypes;
-
-/**
- * xmlTextReader:
- *
- * Structure for an xmlReader context.
- */
-typedef struct _xmlTextReader xmlTextReader;
-
-/**
- * xmlTextReaderPtr:
- *
- * Pointer to an xmlReader context.
- */
-typedef xmlTextReader *xmlTextReaderPtr;
-
-/*
- * Constructors & Destructor
- */
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-			xmlNewTextReader	(xmlParserInputBufferPtr input,
-	                                         const char *URI);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-			xmlNewTextReaderFilename(const char *URI);
-
-XMLPUBFUN void XMLCALL
-			xmlFreeTextReader	(xmlTextReaderPtr reader);
-
-XMLPUBFUN int XMLCALL
-            xmlTextReaderSetup(xmlTextReaderPtr reader,
-                   xmlParserInputBufferPtr input, const char *URL,
-                   const char *encoding, int options);
-
-/*
- * Iterators
- */
-XMLPUBFUN int XMLCALL
-			xmlTextReaderRead	(xmlTextReaderPtr reader);
-
-#ifdef LIBXML_WRITER_ENABLED
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderReadInnerXml	(xmlTextReaderPtr reader);
-
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderReadOuterXml	(xmlTextReaderPtr reader);
-#endif
-
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderReadString		(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderReadAttributeValue	(xmlTextReaderPtr reader);
-
-/*
- * Attributes of the node
- */
-XMLPUBFUN int XMLCALL
-			xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderDepth	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderHasValue(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderIsDefault	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderNodeType	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderQuoteChar	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-			xmlTextReaderReadState	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-                        xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
-
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstBaseUri	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstLocalName	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstName	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstPrefix	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstXmlLang	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstString	(xmlTextReaderPtr reader,
-						 const xmlChar *str);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstValue	(xmlTextReaderPtr reader);
-
-/*
- * use the Const version of the routine for
- * better performance and simpler code
- */
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderBaseUri	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderLocalName	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderName	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderPrefix	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderXmlLang	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-			xmlTextReaderValue	(xmlTextReaderPtr reader);
-
-/*
- * Methods of the XmlTextReader
- */
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderClose		(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-		    xmlTextReaderGetAttributeNo	(xmlTextReaderPtr reader,
-						 int no);
-XMLPUBFUN xmlChar * XMLCALL
-		    xmlTextReaderGetAttribute	(xmlTextReaderPtr reader,
-						 const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL
-		    xmlTextReaderGetAttributeNs	(xmlTextReaderPtr reader,
-						 const xmlChar *localName,
-						 const xmlChar *namespaceURI);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
-		    xmlTextReaderGetRemainder	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
-		    xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
-						 const xmlChar *prefix);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
-						 int no);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
-						 const xmlChar *name);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
-						 const xmlChar *localName,
-						 const xmlChar *namespaceURI);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderMoveToElement	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderNormalization	(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstEncoding  (xmlTextReaderPtr reader);
-
-/*
- * Extensions
- */
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderSetParserProp	(xmlTextReaderPtr reader,
-						 int prop,
-						 int value);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderGetParserProp	(xmlTextReaderPtr reader,
-						 int prop);
-XMLPUBFUN xmlNodePtr XMLCALL
-		    xmlTextReaderCurrentNode	(xmlTextReaderPtr reader);
-
-XMLPUBFUN int XMLCALL
-            xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
-
-XMLPUBFUN int XMLCALL
-            xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
-
-XMLPUBFUN xmlNodePtr XMLCALL
-		    xmlTextReaderPreserve	(xmlTextReaderPtr reader);
-#ifdef LIBXML_PATTERN_ENABLED
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
-						 const xmlChar *pattern,
-						 const xmlChar **namespaces);
-#endif /* LIBXML_PATTERN_ENABLED */
-XMLPUBFUN xmlDocPtr XMLCALL
-		    xmlTextReaderCurrentDoc	(xmlTextReaderPtr reader);
-XMLPUBFUN xmlNodePtr XMLCALL
-		    xmlTextReaderExpand		(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderNext		(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderNextSibling	(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderIsValid	(xmlTextReaderPtr reader);
-#ifdef LIBXML_SCHEMAS_ENABLED
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
-						 const char *rng);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
-						 xmlRelaxNGPtr schema);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader,
-						 const char *xsd);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
-						 xmlSchemaValidCtxtPtr ctxt,
-						 int options);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderSetSchema	(xmlTextReaderPtr reader,
-						 xmlSchemaPtr schema);
-#endif
-XMLPUBFUN const xmlChar * XMLCALL
-		    xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderStandalone     (xmlTextReaderPtr reader);
-
-
-/*
- * Index lookup
- */
-XMLPUBFUN long XMLCALL
-		xmlTextReaderByteConsumed	(xmlTextReaderPtr reader);
-
-/*
- * New more complete APIs for simpler creation and reuse of readers
- */
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderWalker		(xmlDocPtr doc);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderForDoc		(const xmlChar * cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderForFile	(const char *filename,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderForMemory	(const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderForFd		(int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
-		xmlReaderForIO		(xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-
-XMLPUBFUN int XMLCALL
-		xmlReaderNewWalker	(xmlTextReaderPtr reader,
-					 xmlDocPtr doc);
-XMLPUBFUN int XMLCALL
-		xmlReaderNewDoc		(xmlTextReaderPtr reader,
-					 const xmlChar * cur,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN int XMLCALL
-		xmlReaderNewFile	(xmlTextReaderPtr reader,
-					 const char *filename,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN int XMLCALL
-		xmlReaderNewMemory	(xmlTextReaderPtr reader,
-					 const char *buffer,
-					 int size,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN int XMLCALL
-		xmlReaderNewFd		(xmlTextReaderPtr reader,
-					 int fd,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN int XMLCALL
-		xmlReaderNewIO		(xmlTextReaderPtr reader,
-					 xmlInputReadCallback ioread,
-					 xmlInputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *URL,
-					 const char *encoding,
-					 int options);
-/*
- * Error handling extensions
- */
-typedef void *  xmlTextReaderLocatorPtr;
-
-/**
- * xmlTextReaderErrorFunc:
- * @arg: the user argument
- * @msg: the message
- * @severity: the severity of the error
- * @locator: a locator indicating where the error occured
- *
- * Signature of an error callback from a reader parser
- */
-typedef void   (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
-						 const char *msg,
-						 xmlParserSeverities severity,
-						 xmlTextReaderLocatorPtr locator);
-XMLPUBFUN int XMLCALL
-		    xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
-/*int             xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
-XMLPUBFUN xmlChar * XMLCALL
-		    xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
-XMLPUBFUN void XMLCALL
-		    xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
-						 xmlTextReaderErrorFunc f,
-						 void *arg);
-XMLPUBFUN void XMLCALL
-		    xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
-							   xmlStructuredErrorFunc f,
-							   void *arg);
-XMLPUBFUN void XMLCALL
-		    xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
-						 xmlTextReaderErrorFunc *f,
-						 void **arg);
-
-#endif /* LIBXML_READER_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_XMLREADER_H__ */
-
diff --git a/interfaces/ext/libxml/xmlregexp.h b/interfaces/ext/libxml/xmlregexp.h
deleted file mode 100644
index 7009645..0000000
--- a/interfaces/ext/libxml/xmlregexp.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Summary: regular expressions handling
- * Description: basic API for libxml regular expressions handling used
- *              for XML Schemas and validation.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_REGEXP_H__
-#define __XML_REGEXP_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_REGEXP_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlRegexpPtr:
- *
- * A libxml regular expression, they can actually be far more complex
- * thank the POSIX regex expressions.
- */
-typedef struct _xmlRegexp xmlRegexp;
-typedef xmlRegexp *xmlRegexpPtr;
-
-/**
- * xmlRegExecCtxtPtr:
- *
- * A libxml progressive regular expression evaluation context
- */
-typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
-typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
-
-#ifdef __cplusplus
-}
-#endif
-#include <libxml/tree.h>
-#include <libxml/dict.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The POSIX like API
- */
-XMLPUBFUN xmlRegexpPtr XMLCALL
-		    xmlRegexpCompile	(const xmlChar *regexp);
-XMLPUBFUN void XMLCALL			 xmlRegFreeRegexp(xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL
-		    xmlRegexpExec	(xmlRegexpPtr comp,
-					 const xmlChar *value);
-XMLPUBFUN void XMLCALL
-		    xmlRegexpPrint	(FILE *output,
-					 xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL
-		    xmlRegexpIsDeterminist(xmlRegexpPtr comp);
-
-/**
- * xmlRegExecCallbacks:
- * @exec: the regular expression context
- * @token: the current token string
- * @transdata: transition data
- * @inputdata: input data
- *
- * Callback function when doing a transition in the automata
- */
-typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
-	                             const xmlChar *token,
-				     void *transdata,
-				     void *inputdata);
-
-/*
- * The progressive API
- */
-XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
-		    xmlRegNewExecCtxt	(xmlRegexpPtr comp,
-					 xmlRegExecCallbacks callback,
-					 void *data);
-XMLPUBFUN void XMLCALL
-		    xmlRegFreeExecCtxt	(xmlRegExecCtxtPtr exec);
-XMLPUBFUN int XMLCALL
-		    xmlRegExecPushString(xmlRegExecCtxtPtr exec,
-					 const xmlChar *value,
-					 void *data);
-XMLPUBFUN int XMLCALL
-		    xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
-					 const xmlChar *value,
-					 const xmlChar *value2,
-					 void *data);
-
-XMLPUBFUN int XMLCALL
-		    xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
-					 int *nbval,
-					 int *nbneg,
-					 xmlChar **values,
-					 int *terminal);
-XMLPUBFUN int XMLCALL
-		    xmlRegExecErrInfo	(xmlRegExecCtxtPtr exec,
-					 const xmlChar **string,
-					 int *nbval,
-					 int *nbneg,
-					 xmlChar **values,
-					 int *terminal);
-#ifdef LIBXML_EXPR_ENABLED
-/*
- * Formal regular expression handling
- * Its goal is to do some formal work on content models
- */
-
-/* expressions are used within a context */
-typedef struct _xmlExpCtxt xmlExpCtxt;
-typedef xmlExpCtxt *xmlExpCtxtPtr;
-
-XMLPUBFUN void XMLCALL
-			xmlExpFreeCtxt	(xmlExpCtxtPtr ctxt);
-XMLPUBFUN xmlExpCtxtPtr XMLCALL
-			xmlExpNewCtxt	(int maxNodes,
-					 xmlDictPtr dict);
-
-XMLPUBFUN int XMLCALL
-			xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-			xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
-
-/* Expressions are trees but the tree is opaque */
-typedef struct _xmlExpNode xmlExpNode;
-typedef xmlExpNode *xmlExpNodePtr;
-
-typedef enum {
-    XML_EXP_EMPTY = 0,
-    XML_EXP_FORBID = 1,
-    XML_EXP_ATOM = 2,
-    XML_EXP_SEQ = 3,
-    XML_EXP_OR = 4,
-    XML_EXP_COUNT = 5
-} xmlExpNodeType;
-
-/*
- * 2 core expressions shared by all for the empty language set
- * and for the set with just the empty token
- */
-XMLPUBVAR xmlExpNodePtr forbiddenExp;
-XMLPUBVAR xmlExpNodePtr emptyExp;
-
-/*
- * Expressions are reference counted internally
- */
-XMLPUBFUN void XMLCALL
-			xmlExpFree	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr);
-XMLPUBFUN void XMLCALL
-			xmlExpRef	(xmlExpNodePtr expr);
-
-/*
- * constructors can be either manual or from a string
- */
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpParse	(xmlExpCtxtPtr ctxt,
-					 const char *expr);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpNewAtom	(xmlExpCtxtPtr ctxt,
-					 const xmlChar *name,
-					 int len);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpNewOr	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr left,
-					 xmlExpNodePtr right);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpNewSeq	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr left,
-					 xmlExpNodePtr right);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpNewRange	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr subset,
-					 int min,
-					 int max);
-/*
- * The really interesting APIs
- */
-XMLPUBFUN int XMLCALL
-			xmlExpIsNillable(xmlExpNodePtr expr);
-XMLPUBFUN int XMLCALL
-			xmlExpMaxToken	(xmlExpNodePtr expr);
-XMLPUBFUN int XMLCALL
-			xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar**langList,
-					 int len);
-XMLPUBFUN int XMLCALL
-			xmlExpGetStart	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar**tokList,
-					 int len);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpStringDerive(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar *str,
-					 int len);
-XMLPUBFUN xmlExpNodePtr XMLCALL
-			xmlExpExpDerive	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 xmlExpNodePtr sub);
-XMLPUBFUN int XMLCALL
-			xmlExpSubsume	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 xmlExpNodePtr sub);
-XMLPUBFUN void XMLCALL
-			xmlExpDump	(xmlBufferPtr buf,
-					 xmlExpNodePtr expr);
-#endif /* LIBXML_EXPR_ENABLED */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_REGEXP_ENABLED */
-
-#endif /*__XML_REGEXP_H__ */
diff --git a/interfaces/ext/libxml/xmlsave.h b/interfaces/ext/libxml/xmlsave.h
deleted file mode 100644
index 4201b4d..0000000
--- a/interfaces/ext/libxml/xmlsave.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Summary: the XML document serializer
- * Description: API to save document or subtree of document
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XMLSAVE_H__
-#define __XML_XMLSAVE_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/encoding.h>
-#include <libxml/xmlIO.h>
-
-#ifdef LIBXML_OUTPUT_ENABLED
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlSaveOption:
- *
- * This is the set of XML save options that can be passed down
- * to the xmlSaveToFd() and similar calls.
- */
-typedef enum {
-    XML_SAVE_FORMAT     = 1<<0,	/* format save output */
-    XML_SAVE_NO_DECL    = 1<<1,	/* drop the xml declaration */
-    XML_SAVE_NO_EMPTY	= 1<<2, /* no empty tags */
-    XML_SAVE_NO_XHTML	= 1<<3, /* disable XHTML1 specific rules */
-    XML_SAVE_XHTML	= 1<<4, /* force XHTML1 specific rules */
-    XML_SAVE_AS_XML     = 1<<5, /* force XML serialization on HTML doc */
-    XML_SAVE_AS_HTML    = 1<<6  /* force HTML serialization on XML doc */
-} xmlSaveOption;
-
-
-typedef struct _xmlSaveCtxt xmlSaveCtxt;
-typedef xmlSaveCtxt *xmlSaveCtxtPtr;
-
-XMLPUBFUN xmlSaveCtxtPtr XMLCALL
-		xmlSaveToFd		(int fd,
-					 const char *encoding,
-					 int options);
-XMLPUBFUN xmlSaveCtxtPtr XMLCALL
-		xmlSaveToFilename	(const char *filename,
-					 const char *encoding,
-					 int options);
-
-XMLPUBFUN xmlSaveCtxtPtr XMLCALL
-		xmlSaveToBuffer		(xmlBufferPtr buffer,
-					 const char *encoding,
-					 int options);
-
-XMLPUBFUN xmlSaveCtxtPtr XMLCALL
-		xmlSaveToIO		(xmlOutputWriteCallback iowrite,
-					 xmlOutputCloseCallback ioclose,
-					 void *ioctx,
-					 const char *encoding,
-					 int options);
-
-XMLPUBFUN long XMLCALL
-		xmlSaveDoc		(xmlSaveCtxtPtr ctxt,
-					 xmlDocPtr doc);
-XMLPUBFUN long XMLCALL
-		xmlSaveTree		(xmlSaveCtxtPtr ctxt,
-					 xmlNodePtr node);
-
-XMLPUBFUN int XMLCALL
-		xmlSaveFlush		(xmlSaveCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		xmlSaveClose		(xmlSaveCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-		xmlSaveSetEscape	(xmlSaveCtxtPtr ctxt,
-					 xmlCharEncodingOutputFunc escape);
-XMLPUBFUN int XMLCALL
-		xmlSaveSetAttrEscape	(xmlSaveCtxtPtr ctxt,
-					 xmlCharEncodingOutputFunc escape);
-#ifdef __cplusplus
-}
-#endif
-#endif /* LIBXML_OUTPUT_ENABLED */
-#endif /* __XML_XMLSAVE_H__ */
-
-
diff --git a/interfaces/ext/libxml/xmlschemas.h b/interfaces/ext/libxml/xmlschemas.h
deleted file mode 100644
index ebef3a7..0000000
--- a/interfaces/ext/libxml/xmlschemas.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Summary: incomplete XML Schemas structure implementation
- * Description: interface to the XML Schemas handling and schema validity
- *              checking, it is incomplete right now.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SCHEMA_H__
-#define __XML_SCHEMA_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * This error codes are obsolete; not used any more.
- */
-typedef enum {
-    XML_SCHEMAS_ERR_OK		= 0,
-    XML_SCHEMAS_ERR_NOROOT	= 1,
-    XML_SCHEMAS_ERR_UNDECLAREDELEM,
-    XML_SCHEMAS_ERR_NOTTOPLEVEL,
-    XML_SCHEMAS_ERR_MISSING,
-    XML_SCHEMAS_ERR_WRONGELEM,
-    XML_SCHEMAS_ERR_NOTYPE,
-    XML_SCHEMAS_ERR_NOROLLBACK,
-    XML_SCHEMAS_ERR_ISABSTRACT,
-    XML_SCHEMAS_ERR_NOTEMPTY,
-    XML_SCHEMAS_ERR_ELEMCONT,
-    XML_SCHEMAS_ERR_HAVEDEFAULT,
-    XML_SCHEMAS_ERR_NOTNILLABLE,
-    XML_SCHEMAS_ERR_EXTRACONTENT,
-    XML_SCHEMAS_ERR_INVALIDATTR,
-    XML_SCHEMAS_ERR_INVALIDELEM,
-    XML_SCHEMAS_ERR_NOTDETERMINIST,
-    XML_SCHEMAS_ERR_CONSTRUCT,
-    XML_SCHEMAS_ERR_INTERNAL,
-    XML_SCHEMAS_ERR_NOTSIMPLE,
-    XML_SCHEMAS_ERR_ATTRUNKNOWN,
-    XML_SCHEMAS_ERR_ATTRINVALID,
-    XML_SCHEMAS_ERR_VALUE,
-    XML_SCHEMAS_ERR_FACET,
-    XML_SCHEMAS_ERR_,
-    XML_SCHEMAS_ERR_XXX
-} xmlSchemaValidError;
-
-/*
-* ATTENTION: Change xmlSchemaSetValidOptions's check
-* for invalid values, if adding to the validation
-* options below.
-*/
-/**
- * xmlSchemaValidOption:
- *
- * This is the set of XML Schema validation options.
- */
-typedef enum {
-    XML_SCHEMA_VAL_VC_I_CREATE			= 1<<0
-	/* Default/fixed: create an attribute node
-	* or an element's text node on the instance.
-	*/
-} xmlSchemaValidOption;
-
-/*
-    XML_SCHEMA_VAL_XSI_ASSEMBLE			= 1<<1,
-	* assemble schemata using
-	* xsi:schemaLocation and
-	* xsi:noNamespaceSchemaLocation
-*/
-
-/**
- * The schemas related types are kept internal
- */
-typedef struct _xmlSchema xmlSchema;
-typedef xmlSchema *xmlSchemaPtr;
-
-/**
- * xmlSchemaValidityErrorFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of an error callback from an XSD validation
- */
-typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-
-/**
- * xmlSchemaValidityWarningFunc:
- * @ctx: the validation context
- * @msg: the message
- * @...: extra arguments
- *
- * Signature of a warning callback from an XSD validation
- */
-typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3);
-
-/**
- * A schemas validation context
- */
-typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
-typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
-
-typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
-typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
-
-/*
- * Interfaces for parsing.
- */
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
-	    xmlSchemaNewParserCtxt	(const char *URL);
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
-	    xmlSchemaNewMemParserCtxt	(const char *buffer,
-					 int size);
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
-	    xmlSchemaNewDocParserCtxt	(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaFreeParserCtxt	(xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt,
-					 xmlSchemaValidityErrorFunc err,
-					 xmlSchemaValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
-					 xmlStructuredErrorFunc serror,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-		xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
-					xmlSchemaValidityErrorFunc * err,
-					xmlSchemaValidityWarningFunc * warn,
-					void **ctx);
-XMLPUBFUN int XMLCALL
-		xmlSchemaIsValid	(xmlSchemaValidCtxtPtr ctxt);
-
-XMLPUBFUN xmlSchemaPtr XMLCALL
-	    xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaFree		(xmlSchemaPtr schema);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
-	    xmlSchemaDump		(FILE *output,
-					 xmlSchemaPtr schema);
-#endif /* LIBXML_OUTPUT_ENABLED */
-/*
- * Interfaces for validating
- */
-XMLPUBFUN void XMLCALL
-	    xmlSchemaSetValidErrors	(xmlSchemaValidCtxtPtr ctxt,
-					 xmlSchemaValidityErrorFunc err,
-					 xmlSchemaValidityWarningFunc warn,
-					 void *ctx);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
-					 xmlStructuredErrorFunc serror,
-					 void *ctx);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaGetValidErrors	(xmlSchemaValidCtxtPtr ctxt,
-					 xmlSchemaValidityErrorFunc *err,
-					 xmlSchemaValidityWarningFunc *warn,
-					 void **ctx);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt,
-					 int options);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
-
-XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
-	    xmlSchemaNewValidCtxt	(xmlSchemaPtr schema);
-XMLPUBFUN void XMLCALL
-	    xmlSchemaFreeValidCtxt	(xmlSchemaValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaValidateDoc	(xmlSchemaValidCtxtPtr ctxt,
-					 xmlDocPtr instance);
-XMLPUBFUN int XMLCALL
-            xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
-			                 xmlNodePtr elem);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaValidateStream	(xmlSchemaValidCtxtPtr ctxt,
-					 xmlParserInputBufferPtr input,
-					 xmlCharEncoding enc,
-					 xmlSAXHandlerPtr sax,
-					 void *user_data);
-XMLPUBFUN int XMLCALL
-	    xmlSchemaValidateFile	(xmlSchemaValidCtxtPtr ctxt,
-					 const char * filename,
-					 int options);
-
-XMLPUBFUN xmlParserCtxtPtr XMLCALL
-	    xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
-
-/*
- * Interface to insert Schemas SAX validation in a SAX stream
- */
-typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
-typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
-
-XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
-            xmlSchemaSAXPlug		(xmlSchemaValidCtxtPtr ctxt,
-					 xmlSAXHandlerPtr *sax,
-					 void **user_data);
-XMLPUBFUN int XMLCALL
-            xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_SCHEMAS_ENABLED */
-#endif /* __XML_SCHEMA_H__ */
diff --git a/interfaces/ext/libxml/xmlschemastypes.h b/interfaces/ext/libxml/xmlschemastypes.h
deleted file mode 100644
index 9a3a7a1..0000000
--- a/interfaces/ext/libxml/xmlschemastypes.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Summary: implementation of XML Schema Datatypes
- * Description: module providing the XML Schema Datatypes implementation
- *              both definition and validity checking
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-
-#ifndef __XML_SCHEMA_TYPES_H__
-#define __XML_SCHEMA_TYPES_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-
-#include <libxml/schemasInternals.h>
-#include <libxml/xmlschemas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    XML_SCHEMA_WHITESPACE_UNKNOWN = 0,
-    XML_SCHEMA_WHITESPACE_PRESERVE = 1,
-    XML_SCHEMA_WHITESPACE_REPLACE = 2,
-    XML_SCHEMA_WHITESPACE_COLLAPSE = 3
-} xmlSchemaWhitespaceValueType;
-
-XMLPUBFUN void XMLCALL		
-    		xmlSchemaInitTypes		(void);
-XMLPUBFUN void XMLCALL		
-		xmlSchemaCleanupTypes		(void);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL 
-		xmlSchemaGetPredefinedType	(const xmlChar *name,
-						 const xmlChar *ns);
-XMLPUBFUN int XMLCALL		
-		xmlSchemaValidatePredefinedType	(xmlSchemaTypePtr type,
-						 const xmlChar *value,
-						 xmlSchemaValPtr *val);
-XMLPUBFUN int XMLCALL		
-		xmlSchemaValPredefTypeNode	(xmlSchemaTypePtr type,
-						 const xmlChar *value,
-						 xmlSchemaValPtr *val,
-						 xmlNodePtr node);
-XMLPUBFUN int XMLCALL		
-		xmlSchemaValidateFacet		(xmlSchemaTypePtr base,
-						 xmlSchemaFacetPtr facet,
-						 const xmlChar *value,
-						 xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValidateFacetWhtsp	(xmlSchemaFacetPtr facet,
-						 xmlSchemaWhitespaceValueType fws,
-						 xmlSchemaValType valType,						 
-						 const xmlChar *value,
-						 xmlSchemaValPtr val,
-						 xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN void XMLCALL		
-		xmlSchemaFreeValue		(xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaFacetPtr XMLCALL 
-		xmlSchemaNewFacet		(void);
-XMLPUBFUN int XMLCALL		
-		xmlSchemaCheckFacet		(xmlSchemaFacetPtr facet,
-						 xmlSchemaTypePtr typeDecl,
-						 xmlSchemaParserCtxtPtr ctxt,
-						 const xmlChar *name);
-XMLPUBFUN void XMLCALL		
-		xmlSchemaFreeFacet		(xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL		
-		xmlSchemaCompareValues		(xmlSchemaValPtr x,
-						 xmlSchemaValPtr y);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL		
-    xmlSchemaGetBuiltInListSimpleTypeItemType	(xmlSchemaTypePtr type);
-XMLPUBFUN int XMLCALL
-    xmlSchemaValidateListSimpleTypeFacet	(xmlSchemaFacetPtr facet,
-						 const xmlChar *value,
-						 unsigned long actualLen,
-						 unsigned long *expectedLen);
-XMLPUBFUN xmlSchemaTypePtr XMLCALL
-		xmlSchemaGetBuiltInType		(xmlSchemaValType type);
-XMLPUBFUN int XMLCALL
-		xmlSchemaIsBuiltInTypeFacet	(xmlSchemaTypePtr type, 
-						 int facetType);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlSchemaCollapseString		(const xmlChar *value);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlSchemaWhiteSpaceReplace	(const xmlChar *value);
-XMLPUBFUN unsigned long  XMLCALL
-		xmlSchemaGetFacetValueAsULong	(xmlSchemaFacetPtr facet);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValidateLengthFacet	(xmlSchemaTypePtr type, 
-						 xmlSchemaFacetPtr facet,
-						 const xmlChar *value,
-						 xmlSchemaValPtr val,
-						 unsigned long *length);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
-						  xmlSchemaValType valType,
-						  const xmlChar *value,
-						  xmlSchemaValPtr val,						  
-						  unsigned long *length,
-						  xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, 
-						 const xmlChar *value,
-						 xmlSchemaValPtr *val, 
-						 xmlNodePtr node);
-XMLPUBFUN int XMLCALL
-		xmlSchemaGetCanonValue		(xmlSchemaValPtr val,
-						 const xmlChar **retValue);
-XMLPUBFUN int XMLCALL
-		xmlSchemaGetCanonValueWhtsp	(xmlSchemaValPtr val,						 
-						 const xmlChar **retValue,
-						 xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValueAppend		(xmlSchemaValPtr prev,
-						 xmlSchemaValPtr cur);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaValueGetNext		(xmlSchemaValPtr cur);
-XMLPUBFUN const xmlChar * XMLCALL
-		xmlSchemaValueGetAsString	(xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValueGetAsBoolean	(xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewStringValue		(xmlSchemaValType type,
-						 const xmlChar *value);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewNOTATIONValue	(const xmlChar *name,
-						 const xmlChar *ns);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewQNameValue		(const xmlChar *namespaceName,
-						 const xmlChar *localName);
-XMLPUBFUN int XMLCALL
-		xmlSchemaCompareValuesWhtsp	(xmlSchemaValPtr x,
-						 xmlSchemaWhitespaceValueType xws,
-						 xmlSchemaValPtr y,
-						 xmlSchemaWhitespaceValueType yws);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaCopyValue		(xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaValType XMLCALL
-		xmlSchemaGetValType		(xmlSchemaValPtr val);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_SCHEMAS_ENABLED */
-#endif /* __XML_SCHEMA_TYPES_H__ */
diff --git a/interfaces/ext/libxml/xmlstring.h b/interfaces/ext/libxml/xmlstring.h
deleted file mode 100644
index 1dfc5ea..0000000
--- a/interfaces/ext/libxml/xmlstring.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Summary: set of routines to process strings
- * Description: type and interfaces needed for the internal string handling
- *              of the library, especially UTF8 processing.
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_STRING_H__
-#define __XML_STRING_H__
-
-#include <stdarg.h>
-#include <libxml/xmlversion.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * xmlChar:
- *
- * This is a basic byte in an UTF-8 encoded string.
- * It's unsigned allowing to pinpoint case where char * are assigned
- * to xmlChar * (possibly making serialization back impossible).
- */
-typedef unsigned char xmlChar;
-
-/**
- * BAD_CAST:
- *
- * Macro to cast a string to an xmlChar * when one know its safe.
- */
-#define BAD_CAST (xmlChar *)
-
-/*
- * xmlChar handling
- */
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrdup                (const xmlChar *cur);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrndup               (const xmlChar *cur,
-                                         int len);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlCharStrndup           (const char *cur,
-                                         int len);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlCharStrdup            (const char *cur);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrsub                (const xmlChar *str,
-                                         int start,
-                                         int len);
-XMLPUBFUN const xmlChar * XMLCALL
-                xmlStrchr                (const xmlChar *str,
-                                         xmlChar val);
-XMLPUBFUN const xmlChar * XMLCALL
-                xmlStrstr                (const xmlChar *str,
-                                         const xmlChar *val);
-XMLPUBFUN const xmlChar * XMLCALL
-                xmlStrcasestr            (const xmlChar *str,
-                                         xmlChar *val);
-XMLPUBFUN int XMLCALL
-                xmlStrcmp                (const xmlChar *str1,
-                                         const xmlChar *str2);
-XMLPUBFUN int XMLCALL
-                xmlStrncmp               (const xmlChar *str1,
-                                         const xmlChar *str2,
-                                         int len);
-XMLPUBFUN int XMLCALL
-                xmlStrcasecmp            (const xmlChar *str1,
-                                         const xmlChar *str2);
-XMLPUBFUN int XMLCALL
-                xmlStrncasecmp           (const xmlChar *str1,
-                                         const xmlChar *str2,
-                                         int len);
-XMLPUBFUN int XMLCALL
-                xmlStrEqual              (const xmlChar *str1,
-                                         const xmlChar *str2);
-XMLPUBFUN int XMLCALL
-                xmlStrQEqual             (const xmlChar *pref,
-                                         const xmlChar *name,
-                                         const xmlChar *str);
-XMLPUBFUN int XMLCALL
-                xmlStrlen                (const xmlChar *str);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrcat                (xmlChar *cur,
-                                         const xmlChar *add);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrncat               (xmlChar *cur,
-                                         const xmlChar *add,
-                                         int len);
-XMLPUBFUN xmlChar * XMLCALL
-                xmlStrncatNew            (const xmlChar *str1,
-                                         const xmlChar *str2,
-                                         int len);
-XMLPUBFUN int XMLCALL
-                xmlStrPrintf             (xmlChar *buf,
-                                         int len,
-                                         const xmlChar *msg,
-                                         ...);
-XMLPUBFUN int XMLCALL
-                xmlStrVPrintf                (xmlChar *buf,
-                                         int len,
-                                         const xmlChar *msg,
-                                         va_list ap);
-
-XMLPUBFUN int XMLCALL
-        xmlGetUTF8Char                   (const unsigned char *utf,
-                                         int *len);
-XMLPUBFUN int XMLCALL
-        xmlCheckUTF8                     (const unsigned char *utf);
-XMLPUBFUN int XMLCALL
-        xmlUTF8Strsize                   (const xmlChar *utf,
-                                         int len);
-XMLPUBFUN xmlChar * XMLCALL 
-        xmlUTF8Strndup                   (const xmlChar *utf,
-                                         int len);
-XMLPUBFUN const xmlChar * XMLCALL 
-        xmlUTF8Strpos                    (const xmlChar *utf,
-                                         int pos);
-XMLPUBFUN int XMLCALL
-        xmlUTF8Strloc                    (const xmlChar *utf,
-                                         const xmlChar *utfchar);
-XMLPUBFUN xmlChar * XMLCALL 
-        xmlUTF8Strsub                    (const xmlChar *utf,
-                                         int start,
-                                         int len);
-XMLPUBFUN int XMLCALL
-        xmlUTF8Strlen                    (const xmlChar *utf);
-XMLPUBFUN int XMLCALL
-        xmlUTF8Size                      (const xmlChar *utf);
-XMLPUBFUN int XMLCALL
-        xmlUTF8Charcmp                   (const xmlChar *utf1,
-                                         const xmlChar *utf2);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __XML_STRING_H__ */
diff --git a/interfaces/ext/libxml/xmlunicode.h b/interfaces/ext/libxml/xmlunicode.h
deleted file mode 100644
index 01ac8b6..0000000
--- a/interfaces/ext/libxml/xmlunicode.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Summary: Unicode character APIs
- * Description: API for the Unicode character APIs
- *
- * This file is automatically generated from the
- * UCS description files of the Unicode Character Database
- * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html
- * using the genUnicode.py Python script.
- *
- * Generation date: Mon Mar 27 11:09:52 2006
- * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_UNICODE_H__
-#define __XML_UNICODE_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_UNICODE_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsArabic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsArmenian	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsArrows	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBengali	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBlockElements	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBopomofo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsBuhid	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCherokee	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsControlPictures	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCyrillic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsDeseret	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsDevanagari	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsDingbats	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsEthiopic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGeorgian	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGothic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGreek	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGujarati	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHanunoo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHebrew	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsHiragana	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKanbun	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKannada	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKatakana	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKhmer	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLao	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLimbu	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMalayalam	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMongolian	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsMyanmar	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsNumberForms	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsOgham	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsOldItalic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsOriya	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsOsmanya	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsRunic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsShavian	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSinhala	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSpecials	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsSyriac	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTagalog	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTags	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTaiLe	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTamil	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTelugu	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsThaana	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsThai	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsTibetan	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsUgaritic	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols	(int code);
-
-XMLPUBFUN int XMLCALL xmlUCSIsBlock	(int code, const char *block);
-
-XMLPUBFUN int XMLCALL xmlUCSIsCatC	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatCc	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatCf	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatCo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatCs	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatL	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatLl	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatLm	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatLo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatLt	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatLu	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatM	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatMc	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatMe	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatMn	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatN	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatNd	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatNl	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatNo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatP	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPc	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPd	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPe	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPf	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPi	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatPs	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatS	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatSc	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatSk	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatSm	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatSo	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatZ	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatZl	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatZp	(int code);
-XMLPUBFUN int XMLCALL xmlUCSIsCatZs	(int code);
-
-XMLPUBFUN int XMLCALL xmlUCSIsCat	(int code, const char *cat);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_UNICODE_ENABLED */
-
-#endif /* __XML_UNICODE_H__ */
diff --git a/interfaces/ext/libxml/xmlversion.h b/interfaces/ext/libxml/xmlversion.h
deleted file mode 100644
index 0660956..0000000
--- a/interfaces/ext/libxml/xmlversion.h
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Summary: compile-time version informations
- * Description: compile-time version informations for the XML library
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_VERSION_H__
-#define __XML_VERSION_H__
-
-#include <libxml/xmlexports.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * use those to be sure nothing nasty will happen if
- * your library and includes mismatch
- */
-#ifndef LIBXML2_COMPILING_MSCCDEF
-XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
-#endif /* LIBXML2_COMPILING_MSCCDEF */
-
-/**
- * LIBXML_DOTTED_VERSION:
- *
- * the version string like "1.2.3"
- */
-#define LIBXML_DOTTED_VERSION "2.7.3"
-
-/**
- * LIBXML_VERSION:
- *
- * the version number: 1.2.3 value is 10203
- */
-#define LIBXML_VERSION 20703
-
-/**
- * LIBXML_VERSION_STRING:
- *
- * the version number string, 1.2.3 value is "10203"
- */
-#define LIBXML_VERSION_STRING "20703"
-
-/**
- * LIBXML_VERSION_EXTRA:
- *
- * extra version information, used to show a CVS compilation
- */
-#define LIBXML_VERSION_EXTRA ""
-
-/**
- * LIBXML_TEST_VERSION:
- *
- * Macro to check that the libxml version in use is compatible with
- * the version the software has been compiled against
- */
-#define LIBXML_TEST_VERSION xmlCheckVersion(20703);
-
-#ifndef VMS
-#if 0
-/**
- * WITH_TRIO:
- *
- * defined if the trio support need to be configured in
- */
-#define WITH_TRIO
-#else
-/**
- * WITHOUT_TRIO:
- *
- * defined if the trio support should not be configured in
- */
-#define WITHOUT_TRIO
-#endif
-#else /* VMS */
-/**
- * WITH_TRIO:
- *
- * defined if the trio support need to be configured in
- */
-#define WITH_TRIO 1
-#endif /* VMS */
-
-/**
- * LIBXML_THREAD_ENABLED:
- *
- * Whether the thread support is configured in
- */
-#if 1
-#if defined(_REENTRANT) || defined(__MT__) || \
-    (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
-#define LIBXML_THREAD_ENABLED
-#endif
-#endif
-
-/**
- * LIBXML_TREE_ENABLED:
- *
- * Whether the DOM like tree manipulation API support is configured in
- */
-#if 1
-#define LIBXML_TREE_ENABLED
-#endif
-
-/**
- * LIBXML_OUTPUT_ENABLED:
- *
- * Whether the serialization/saving support is configured in
- */
-#if 1
-#define LIBXML_OUTPUT_ENABLED
-#endif
-
-/**
- * LIBXML_PUSH_ENABLED:
- *
- * Whether the push parsing interfaces are configured in
- */
-#if 1
-#define LIBXML_PUSH_ENABLED
-#endif
-
-/**
- * LIBXML_READER_ENABLED:
- *
- * Whether the xmlReader parsing interface is configured in
- */
-#if 1
-#define LIBXML_READER_ENABLED
-#endif
-
-/**
- * LIBXML_PATTERN_ENABLED:
- *
- * Whether the xmlPattern node selection interface is configured in
- */
-#if 1
-#define LIBXML_PATTERN_ENABLED
-#endif
-
-/**
- * LIBXML_WRITER_ENABLED:
- *
- * Whether the xmlWriter saving interface is configured in
- */
-#if 1
-#define LIBXML_WRITER_ENABLED
-#endif
-
-/**
- * LIBXML_SAX1_ENABLED:
- *
- * Whether the older SAX1 interface is configured in
- */
-#if 1
-#define LIBXML_SAX1_ENABLED
-#endif
-
-/**
- * LIBXML_FTP_ENABLED:
- *
- * Whether the FTP support is configured in
- */
-#if 1
-#define LIBXML_FTP_ENABLED
-#endif
-
-/**
- * LIBXML_HTTP_ENABLED:
- *
- * Whether the HTTP support is configured in
- */
-#if 1
-#define LIBXML_HTTP_ENABLED
-#endif
-
-/**
- * LIBXML_VALID_ENABLED:
- *
- * Whether the DTD validation support is configured in
- */
-#if 1
-#define LIBXML_VALID_ENABLED
-#endif
-
-/**
- * LIBXML_HTML_ENABLED:
- *
- * Whether the HTML support is configured in
- */
-#if 1
-#define LIBXML_HTML_ENABLED
-#endif
-
-/**
- * LIBXML_LEGACY_ENABLED:
- *
- * Whether the deprecated APIs are compiled in for compatibility
- */
-#if 1
-#define LIBXML_LEGACY_ENABLED
-#endif
-
-/**
- * LIBXML_C14N_ENABLED:
- *
- * Whether the Canonicalization support is configured in
- */
-#if 1
-#define LIBXML_C14N_ENABLED
-#endif
-
-/**
- * LIBXML_CATALOG_ENABLED:
- *
- * Whether the Catalog support is configured in
- */
-#if 1
-#define LIBXML_CATALOG_ENABLED
-#endif
-
-/**
- * LIBXML_DOCB_ENABLED:
- *
- * Whether the SGML Docbook support is configured in
- */
-#if 1
-#define LIBXML_DOCB_ENABLED
-#endif
-
-/**
- * LIBXML_XPATH_ENABLED:
- *
- * Whether XPath is configured in
- */
-#if 1
-#define LIBXML_XPATH_ENABLED
-#endif
-
-/**
- * LIBXML_XPTR_ENABLED:
- *
- * Whether XPointer is configured in
- */
-#if 1
-#define LIBXML_XPTR_ENABLED
-#endif
-
-/**
- * LIBXML_XINCLUDE_ENABLED:
- *
- * Whether XInclude is configured in
- */
-#if 1
-#define LIBXML_XINCLUDE_ENABLED
-#endif
-
-/**
- * LIBXML_ICONV_ENABLED:
- *
- * Whether iconv support is available
- */
-#if 1
-#define LIBXML_ICONV_ENABLED
-#endif
-
-/**
- * LIBXML_ISO8859X_ENABLED:
- *
- * Whether ISO-8859-* support is made available in case iconv is not
- */
-#if 1
-#define LIBXML_ISO8859X_ENABLED
-#endif
-
-/**
- * LIBXML_DEBUG_ENABLED:
- *
- * Whether Debugging module is configured in
- */
-#if 0
-#define LIBXML_DEBUG_ENABLED
-#endif
-
-/**
- * DEBUG_MEMORY_LOCATION:
- *
- * Whether the memory debugging is configured in
- */
-#if 0
-#define DEBUG_MEMORY_LOCATION
-#endif
-
-/**
- * LIBXML_DEBUG_RUNTIME:
- *
- * Whether the runtime debugging is configured in
- */
-#if 0
-#define LIBXML_DEBUG_RUNTIME
-#endif
-
-/**
- * LIBXML_UNICODE_ENABLED:
- *
- * Whether the Unicode related interfaces are compiled in
- */
-#if 1
-#define LIBXML_UNICODE_ENABLED
-#endif
-
-/**
- * LIBXML_REGEXP_ENABLED:
- *
- * Whether the regular expressions interfaces are compiled in
- */
-#if 1
-#define LIBXML_REGEXP_ENABLED
-#endif
-
-/**
- * LIBXML_AUTOMATA_ENABLED:
- *
- * Whether the automata interfaces are compiled in
- */
-#if 1
-#define LIBXML_AUTOMATA_ENABLED
-#endif
-
-/**
- * LIBXML_EXPR_ENABLED:
- *
- * Whether the formal expressions interfaces are compiled in
- */
-#if 1
-#define LIBXML_EXPR_ENABLED
-#endif
-
-/**
- * LIBXML_SCHEMAS_ENABLED:
- *
- * Whether the Schemas validation interfaces are compiled in
- */
-#if 1
-#define LIBXML_SCHEMAS_ENABLED
-#endif
-
-/**
- * LIBXML_SCHEMATRON_ENABLED:
- *
- * Whether the Schematron validation interfaces are compiled in
- */
-#if 1
-#define LIBXML_SCHEMATRON_ENABLED
-#endif
-
-/**
- * LIBXML_MODULES_ENABLED:
- *
- * Whether the module interfaces are compiled in
- */
-#if 1
-#define LIBXML_MODULES_ENABLED
-/**
- * LIBXML_MODULE_EXTENSION:
- *
- * the string suffix used by dynamic modules (usually shared libraries)
- */
-#define LIBXML_MODULE_EXTENSION ".so" 
-#endif
-
-/**
- * LIBXML_ZLIB_ENABLED:
- *
- * Whether the Zlib support is compiled in
- */
-#if 0
-#define LIBXML_ZLIB_ENABLED
-#endif
-
-#ifdef __GNUC__
-#ifdef HAVE_ANSIDECL_H
-#include <ansidecl.h>
-#endif
-
-/**
- * ATTRIBUTE_UNUSED:
- *
- * Macro used to signal to GCC unused function parameters
- */
-
-#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
-
-/**
- * ATTRIBUTE_ALLOC_SIZE:
- *
- * Macro used to indicate to GCC this is an allocator function
- */
-
-#ifndef ATTRIBUTE_ALLOC_SIZE
-# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
-#  define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
-# else
-#  define ATTRIBUTE_ALLOC_SIZE(x)
-# endif
-#else
-# define ATTRIBUTE_ALLOC_SIZE(x)
-#endif
-
-/**
- * ATTRIBUTE_PRINTF:
- *
- * Macro used to indicate to GCC the parameter are printf like
- */
-
-#ifndef ATTRIBUTE_PRINTF
-# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
-#  define ATTRIBUTE_PRINTF(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
-# else
-#  define ATTRIBUTE_PRINTF(fmt,args)
-# endif
-#else
-# define ATTRIBUTE_PRINTF(fmt,args)
-#endif
-
-#else /* ! __GNUC__ */
-/**
- * ATTRIBUTE_UNUSED:
- *
- * Macro used to signal to GCC unused function parameters
- */
-#define ATTRIBUTE_UNUSED
-/**
- * ATTRIBUTE_ALLOC_SIZE:
- *
- * Macro used to indicate to GCC this is an allocator function
- */
-#define ATTRIBUTE_ALLOC_SIZE(x)
-/**
- * ATTRIBUTE_PRINTF:
- *
- * Macro used to indicate to GCC the parameter are printf like
- */
-#define ATTRIBUTE_PRINTF(fmt,args)
-#endif /* __GNUC__ */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif
-
-
diff --git a/interfaces/ext/libxml/xmlwriter.h b/interfaces/ext/libxml/xmlwriter.h
deleted file mode 100644
index df4509d..0000000
--- a/interfaces/ext/libxml/xmlwriter.h
+++ /dev/null
@@ -1,485 +0,0 @@
-
-/*
- * Summary: text writing API for XML
- * Description: text writing API for XML
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Alfred Mickautsch <alfred at mickautsch.de>
- */
-
-#ifndef __XML_XMLWRITER_H__
-#define __XML_XMLWRITER_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_WRITER_ENABLED
-
-#include <stdarg.h>
-#include <libxml/xmlIO.h>
-#include <libxml/list.h>
-#include <libxml/xmlstring.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    typedef struct _xmlTextWriter xmlTextWriter;
-    typedef xmlTextWriter *xmlTextWriterPtr;
-
-/*
- * Constructors & Destructor
- */
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriter(xmlOutputBufferPtr out);
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriterFilename(const char *uri, int compression);
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
-    XMLPUBFUN xmlTextWriterPtr XMLCALL
-        xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
-                             int compression);
-    XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
-
-/*
- * Functions
- */
-
-
-/*
- * Document
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartDocument(xmlTextWriterPtr writer,
-                                   const char *version,
-                                   const char *encoding,
-                                   const char *standalone);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
-                                                   writer);
-
-/*
- * Comments
- */
-    XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
-                                                    writer);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
-                                        const char *format, ...)
-					ATTRIBUTE_PRINTF(2,3);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
-                                         const char *format,
-                                         va_list argptr)
-					 ATTRIBUTE_PRINTF(2,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
-                                                    writer,
-                                                    const xmlChar *
-                                                    content);
-
-/*
- * Elements
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartElement(xmlTextWriterPtr writer,
-                                  const xmlChar * name);
-    XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
-                                                      writer,
-                                                      const xmlChar *
-                                                      prefix,
-                                                      const xmlChar * name,
-                                                      const xmlChar *
-                                                      namespaceURI);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
-    XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
-                                                      writer);
-
-/*
- * Elements conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
-                                        const xmlChar * name,
-                                        const char *format, ...)
-					ATTRIBUTE_PRINTF(3,4);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
-                                         const xmlChar * name,
-                                         const char *format,
-                                         va_list argptr)
-					 ATTRIBUTE_PRINTF(3,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
-                                                    writer,
-                                                    const xmlChar * name,
-                                                    const xmlChar *
-                                                    content);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
-                                          const xmlChar * prefix,
-                                          const xmlChar * name,
-                                          const xmlChar * namespaceURI,
-                                          const char *format, ...)
-					  ATTRIBUTE_PRINTF(5,6);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
-                                           const xmlChar * prefix,
-                                           const xmlChar * name,
-                                           const xmlChar * namespaceURI,
-                                           const char *format,
-                                           va_list argptr)
-					   ATTRIBUTE_PRINTF(5,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
-                                                      writer,
-                                                      const xmlChar *
-                                                      prefix,
-                                                      const xmlChar * name,
-                                                      const xmlChar *
-                                                      namespaceURI,
-                                                      const xmlChar *
-                                                      content);
-
-/*
- * Text
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
-                                    const char *format, ...)
-				    ATTRIBUTE_PRINTF(2,3);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
-                                     const char *format, va_list argptr)
-				     ATTRIBUTE_PRINTF(2,0);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
-                                 const xmlChar * content, int len);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
-                              const xmlChar * content);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
-                                                         writer,
-                                                         const char
-                                                         *format, ...)
-							 ATTRIBUTE_PRINTF(2,3);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
-                                                          writer,
-                                                          const char
-                                                          *format,
-                                                          va_list argptr)
-							  ATTRIBUTE_PRINTF(2,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
-                                                   const xmlChar *
-                                                   content);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
-                                                   const char *data,
-                                                   int start, int len);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
-                                                   const char *data,
-                                                   int start, int len);
-
-/*
- * Attributes
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
-                                    const xmlChar * name);
-    XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
-                                                        writer,
-                                                        const xmlChar *
-                                                        prefix,
-                                                        const xmlChar *
-                                                        name,
-                                                        const xmlChar *
-                                                        namespaceURI);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
-                                                    writer);
-
-/*
- * Attributes conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
-                                          const xmlChar * name,
-                                          const char *format, ...)
-					  ATTRIBUTE_PRINTF(3,4);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
-                                           const xmlChar * name,
-                                           const char *format,
-                                           va_list argptr)
-					   ATTRIBUTE_PRINTF(3,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
-                                                      writer,
-                                                      const xmlChar * name,
-                                                      const xmlChar *
-                                                      content);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
-                                            const xmlChar * prefix,
-                                            const xmlChar * name,
-                                            const xmlChar * namespaceURI,
-                                            const char *format, ...)
-					    ATTRIBUTE_PRINTF(5,6);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
-                                             const xmlChar * prefix,
-                                             const xmlChar * name,
-                                             const xmlChar * namespaceURI,
-                                             const char *format,
-                                             va_list argptr)
-					     ATTRIBUTE_PRINTF(5,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
-                                                        writer,
-                                                        const xmlChar *
-                                                        prefix,
-                                                        const xmlChar *
-                                                        name,
-                                                        const xmlChar *
-                                                        namespaceURI,
-                                                        const xmlChar *
-                                                        content);
-
-/*
- * PI's
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartPI(xmlTextWriterPtr writer,
-                             const xmlChar * target);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
-
-/*
- * PI conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
-                                   const xmlChar * target,
-                                   const char *format, ...)
-				   ATTRIBUTE_PRINTF(3,4);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
-                                    const xmlChar * target,
-                                    const char *format, va_list argptr)
-				    ATTRIBUTE_PRINTF(3,0);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWritePI(xmlTextWriterPtr writer,
-                             const xmlChar * target,
-                             const xmlChar * content);
-
-/**
- * xmlTextWriterWriteProcessingInstruction:
- *
- * This macro maps to xmlTextWriterWritePI
- */
-#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI
-
-/*
- * CDATA
- */
-    XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
-
-/*
- * CDATA conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
-                                      const char *format, ...)
-				      ATTRIBUTE_PRINTF(2,3);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
-                                       const char *format, va_list argptr)
-				       ATTRIBUTE_PRINTF(2,0);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
-                                const xmlChar * content);
-
-/*
- * DTD
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartDTD(xmlTextWriterPtr writer,
-                              const xmlChar * name,
-                              const xmlChar * pubid,
-                              const xmlChar * sysid);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
-
-/*
- * DTD conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
-                                    const xmlChar * name,
-                                    const xmlChar * pubid,
-                                    const xmlChar * sysid,
-                                    const char *format, ...)
-				    ATTRIBUTE_PRINTF(5,6);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
-                                     const xmlChar * name,
-                                     const xmlChar * pubid,
-                                     const xmlChar * sysid,
-                                     const char *format, va_list argptr)
-				     ATTRIBUTE_PRINTF(5,0);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
-                              const xmlChar * name,
-                              const xmlChar * pubid,
-                              const xmlChar * sysid,
-                              const xmlChar * subset);
-
-/**
- * xmlTextWriterWriteDocType:
- *
- * this macro maps to xmlTextWriterWriteDTD
- */
-#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD
-
-/*
- * DTD element definition
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
-                                     const xmlChar * name);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
-                                                     writer);
-
-/*
- * DTD element definition conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
-                                           const xmlChar * name,
-                                           const char *format, ...)
-					   ATTRIBUTE_PRINTF(3,4);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
-                                            const xmlChar * name,
-                                            const char *format,
-                                            va_list argptr)
-					    ATTRIBUTE_PRINTF(3,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
-                                                       writer,
-                                                       const xmlChar *
-                                                       name,
-                                                       const xmlChar *
-                                                       content);
-
-/*
- * DTD attribute list definition
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
-                                     const xmlChar * name);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
-                                                     writer);
-
-/*
- * DTD attribute list definition conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
-                                           const xmlChar * name,
-                                           const char *format, ...)
-					   ATTRIBUTE_PRINTF(3,4);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
-                                            const xmlChar * name,
-                                            const char *format,
-                                            va_list argptr)
-					    ATTRIBUTE_PRINTF(3,0);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
-                                                       writer,
-                                                       const xmlChar *
-                                                       name,
-                                                       const xmlChar *
-                                                       content);
-
-/*
- * DTD entity definition
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
-                                    int pe, const xmlChar * name);
-    XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
-                                                    writer);
-
-/*
- * DTD entity definition conveniency functions
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
-                                                  int pe,
-                                                  const xmlChar * name,
-                                                  const char *format, ...)
-						  ATTRIBUTE_PRINTF(4,5);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
-                                                   int pe,
-                                                   const xmlChar * name,
-                                                   const char *format,
-                                                   va_list argptr)
-						   ATTRIBUTE_PRINTF(4,0);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
-                                            int pe,
-                                            const xmlChar * name,
-                                            const xmlChar * content);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
-                                            int pe,
-                                            const xmlChar * name,
-                                            const xmlChar * pubid,
-                                            const xmlChar * sysid,
-                                            const xmlChar * ndataid);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
-                                                    writer,
-                                                    const xmlChar * pubid,
-                                                    const xmlChar * sysid,
-                                                    const xmlChar *
-                                                    ndataid);
-    XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
-                                                      writer, int pe,
-                                                      const xmlChar * name,
-                                                      const xmlChar *
-                                                      pubid,
-                                                      const xmlChar *
-                                                      sysid,
-                                                      const xmlChar *
-                                                      ndataid,
-                                                      const xmlChar *
-                                                      content);
-
-/*
- * DTD notation definition
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
-                                      const xmlChar * name,
-                                      const xmlChar * pubid,
-                                      const xmlChar * sysid);
-
-/*
- * Indentation
- */
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
-    XMLPUBFUN int XMLCALL
-        xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
-                                     const xmlChar * str);
-
-/*
- * misc
- */
-    XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_WRITER_ENABLED */
-
-#endif                          /* __XML_XMLWRITER_H__ */
diff --git a/interfaces/ext/libxml/xpath.h b/interfaces/ext/libxml/xpath.h
deleted file mode 100644
index 1a9e30e..0000000
--- a/interfaces/ext/libxml/xpath.h
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Summary: XML Path Language implementation
- * Description: API for the XML Path Language implementation
- *
- * XML Path Language implementation
- * XPath is a language for addressing parts of an XML document,
- * designed to be used by both XSLT and XPointer
- *     http://www.w3.org/TR/xpath
- *
- * Implements
- * W3C Recommendation 16 November 1999
- *     http://www.w3.org/TR/1999/REC-xpath-19991116
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XPATH_H__
-#define __XML_XPATH_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_XPATH_ENABLED
-
-#include <libxml/xmlerror.h>
-#include <libxml/tree.h>
-#include <libxml/hash.h>
-#endif /* LIBXML_XPATH_ENABLED */
-
-#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-#ifdef __cplusplus
-extern "C" {
-#endif
-#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
-	
-#ifdef LIBXML_XPATH_ENABLED
-
-typedef struct _xmlXPathContext xmlXPathContext;
-typedef xmlXPathContext *xmlXPathContextPtr;
-typedef struct _xmlXPathParserContext xmlXPathParserContext;
-typedef xmlXPathParserContext *xmlXPathParserContextPtr;
-
-/**
- * The set of XPath error codes.
- */
-
-typedef enum {
-    XPATH_EXPRESSION_OK = 0,
-    XPATH_NUMBER_ERROR,
-    XPATH_UNFINISHED_LITERAL_ERROR,
-    XPATH_START_LITERAL_ERROR,
-    XPATH_VARIABLE_REF_ERROR,
-    XPATH_UNDEF_VARIABLE_ERROR,
-    XPATH_INVALID_PREDICATE_ERROR,
-    XPATH_EXPR_ERROR,
-    XPATH_UNCLOSED_ERROR,
-    XPATH_UNKNOWN_FUNC_ERROR,
-    XPATH_INVALID_OPERAND,
-    XPATH_INVALID_TYPE,
-    XPATH_INVALID_ARITY,
-    XPATH_INVALID_CTXT_SIZE,
-    XPATH_INVALID_CTXT_POSITION,
-    XPATH_MEMORY_ERROR,
-    XPTR_SYNTAX_ERROR,
-    XPTR_RESOURCE_ERROR,
-    XPTR_SUB_RESOURCE_ERROR,
-    XPATH_UNDEF_PREFIX_ERROR,
-    XPATH_ENCODING_ERROR,
-    XPATH_INVALID_CHAR_ERROR,
-    XPATH_INVALID_CTXT
-} xmlXPathError;
-
-/*
- * A node-set (an unordered collection of nodes without duplicates).
- */
-typedef struct _xmlNodeSet xmlNodeSet;
-typedef xmlNodeSet *xmlNodeSetPtr;
-struct _xmlNodeSet {
-    int nodeNr;			/* number of nodes in the set */
-    int nodeMax;		/* size of the array as allocated */
-    xmlNodePtr *nodeTab;	/* array of nodes in no particular order */
-    /* @@ with_ns to check wether namespace nodes should be looked at @@ */
-};
-
-/*
- * An expression is evaluated to yield an object, which
- * has one of the following four basic types:
- *   - node-set
- *   - boolean
- *   - number
- *   - string
- *
- * @@ XPointer will add more types !
- */
-
-typedef enum {
-    XPATH_UNDEFINED = 0,
-    XPATH_NODESET = 1,
-    XPATH_BOOLEAN = 2,
-    XPATH_NUMBER = 3,
-    XPATH_STRING = 4,
-    XPATH_POINT = 5,
-    XPATH_RANGE = 6,
-    XPATH_LOCATIONSET = 7,
-    XPATH_USERS = 8,
-    XPATH_XSLT_TREE = 9  /* An XSLT value tree, non modifiable */
-} xmlXPathObjectType;
-
-typedef struct _xmlXPathObject xmlXPathObject;
-typedef xmlXPathObject *xmlXPathObjectPtr;
-struct _xmlXPathObject {
-    xmlXPathObjectType type;
-    xmlNodeSetPtr nodesetval;
-    int boolval;
-    double floatval;
-    xmlChar *stringval;
-    void *user;
-    int index;
-    void *user2;
-    int index2;
-};
-
-/**
- * xmlXPathConvertFunc:
- * @obj:  an XPath object
- * @type:  the number of the target type
- *
- * A conversion function is associated to a type and used to cast
- * the new type to primitive values.
- *
- * Returns -1 in case of error, 0 otherwise
- */
-typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type);
-
-/*
- * Extra type: a name and a conversion function.
- */
-
-typedef struct _xmlXPathType xmlXPathType;
-typedef xmlXPathType *xmlXPathTypePtr;
-struct _xmlXPathType {
-    const xmlChar         *name;		/* the type name */
-    xmlXPathConvertFunc func;		/* the conversion function */
-};
-
-/*
- * Extra variable: a name and a value.
- */
-
-typedef struct _xmlXPathVariable xmlXPathVariable;
-typedef xmlXPathVariable *xmlXPathVariablePtr;
-struct _xmlXPathVariable {
-    const xmlChar       *name;		/* the variable name */
-    xmlXPathObjectPtr value;		/* the value */
-};
-
-/**
- * xmlXPathEvalFunc:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments passed to the function
- *
- * An XPath evaluation function, the parameters are on the XPath context stack.
- */
-
-typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
-	                         int nargs);
-
-/*
- * Extra function: a name and a evaluation function.
- */
-
-typedef struct _xmlXPathFunct xmlXPathFunct;
-typedef xmlXPathFunct *xmlXPathFuncPtr;
-struct _xmlXPathFunct {
-    const xmlChar      *name;		/* the function name */
-    xmlXPathEvalFunc func;		/* the evaluation function */
-};
-
-/**
- * xmlXPathAxisFunc:
- * @ctxt:  the XPath interpreter context
- * @cur:  the previous node being explored on that axis
- *
- * An axis traversal function. To traverse an axis, the engine calls
- * the first time with cur == NULL and repeat until the function returns
- * NULL indicating the end of the axis traversal.
- *
- * Returns the next node in that axis or NULL if at the end of the axis.
- */
-
-typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
-				 xmlXPathObjectPtr cur);
-
-/*
- * Extra axis: a name and an axis function.
- */
-
-typedef struct _xmlXPathAxis xmlXPathAxis;
-typedef xmlXPathAxis *xmlXPathAxisPtr;
-struct _xmlXPathAxis {
-    const xmlChar      *name;		/* the axis name */
-    xmlXPathAxisFunc func;		/* the search function */
-};
-
-/**
- * xmlXPathFunction:
- * @ctxt:  the XPath interprestation context
- * @nargs:  the number of arguments
- *
- * An XPath function.
- * The arguments (if any) are popped out from the context stack
- * and the result is pushed on the stack.
- */
-
-typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
-
-/*
- * Function and Variable Lookup.
- */
-
-/**
- * xmlXPathVariableLookupFunc:
- * @ctxt:  an XPath context
- * @name:  name of the variable
- * @ns_uri:  the namespace name hosting this variable
- *
- * Prototype for callbacks used to plug variable lookup in the XPath
- * engine.
- *
- * Returns the XPath object value or NULL if not found.
- */
-typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
-                                         const xmlChar *name,
-                                         const xmlChar *ns_uri);
-
-/**
- * xmlXPathFuncLookupFunc:
- * @ctxt:  an XPath context
- * @name:  name of the function
- * @ns_uri:  the namespace name hosting this function
- *
- * Prototype for callbacks used to plug function lookup in the XPath
- * engine.
- *
- * Returns the XPath function or NULL if not found.
- */
-typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
-					 const xmlChar *name,
-					 const xmlChar *ns_uri);
-
-/**
- * xmlXPathFlags:
- * Flags for XPath engine compilation and runtime
- */
-/**
- * XML_XPATH_CHECKNS:
- *
- * check namespaces at compilation
- */
-#define XML_XPATH_CHECKNS (1<<0)
-/**
- * XML_XPATH_NOVAR:
- *
- * forbid variables in expression
- */
-#define XML_XPATH_NOVAR	  (1<<1)
-
-/**
- * xmlXPathContext:
- *
- * Expression evaluation occurs with respect to a context.
- * he context consists of:
- *    - a node (the context node) 
- *    - a node list (the context node list) 
- *    - a set of variable bindings 
- *    - a function library 
- *    - the set of namespace declarations in scope for the expression 
- * Following the switch to hash tables, this need to be trimmed up at
- * the next binary incompatible release.
- * The node may be modified when the context is passed to libxml2
- * for an XPath evaluation so you may need to initialize it again
- * before the next call.
- */
-
-struct _xmlXPathContext {
-    xmlDocPtr doc;			/* The current document */
-    xmlNodePtr node;			/* The current node */
-
-    int nb_variables_unused;		/* unused (hash table) */
-    int max_variables_unused;		/* unused (hash table) */
-    xmlHashTablePtr varHash;		/* Hash table of defined variables */
-
-    int nb_types;			/* number of defined types */
-    int max_types;			/* max number of types */
-    xmlXPathTypePtr types;		/* Array of defined types */
-
-    int nb_funcs_unused;		/* unused (hash table) */
-    int max_funcs_unused;		/* unused (hash table) */
-    xmlHashTablePtr funcHash;		/* Hash table of defined funcs */
-
-    int nb_axis;			/* number of defined axis */
-    int max_axis;			/* max number of axis */
-    xmlXPathAxisPtr axis;		/* Array of defined axis */
-
-    /* the namespace nodes of the context node */
-    xmlNsPtr *namespaces;		/* Array of namespaces */
-    int nsNr;				/* number of namespace in scope */
-    void *user;				/* function to free */
-
-    /* extra variables */
-    int contextSize;			/* the context size */
-    int proximityPosition;		/* the proximity position */
-
-    /* extra stuff for XPointer */
-    int xptr;				/* is this an XPointer context? */
-    xmlNodePtr here;			/* for here() */
-    xmlNodePtr origin;			/* for origin() */
-
-    /* the set of namespace declarations in scope for the expression */
-    xmlHashTablePtr nsHash;		/* The namespaces hash table */
-    xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */
-    void *varLookupData;		/* variable lookup data */
-
-    /* Possibility to link in an extra item */
-    void *extra;                        /* needed for XSLT */
-
-    /* The function name and URI when calling a function */
-    const xmlChar *function;
-    const xmlChar *functionURI;
-
-    /* function lookup function and data */
-    xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */
-    void *funcLookupData;		/* function lookup data */
-
-    /* temporary namespace lists kept for walking the namespace axis */
-    xmlNsPtr *tmpNsList;		/* Array of namespaces */
-    int tmpNsNr;			/* number of namespaces in scope */
-
-    /* error reporting mechanism */
-    void *userData;                     /* user specific data block */
-    xmlStructuredErrorFunc error;       /* the callback in case of errors */
-    xmlError lastError;			/* the last error */
-    xmlNodePtr debugNode;		/* the source node XSLT */
-
-    /* dictionary */
-    xmlDictPtr dict;			/* dictionary if any */
-
-    int flags;				/* flags to control compilation */
-
-    /* Cache for reusal of XPath objects */
-    void *cache;
-};
-
-/*
- * The structure of a compiled expression form is not public.
- */
-
-typedef struct _xmlXPathCompExpr xmlXPathCompExpr;
-typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
-
-/**
- * xmlXPathParserContext:
- *
- * An XPath parser context. It contains pure parsing informations,
- * an xmlXPathContext, and the stack of objects.
- */
-struct _xmlXPathParserContext {
-    const xmlChar *cur;			/* the current char being parsed */
-    const xmlChar *base;			/* the full expression */
-
-    int error;				/* error code */
-
-    xmlXPathContextPtr  context;	/* the evaluation context */
-    xmlXPathObjectPtr     value;	/* the current value */
-    int                 valueNr;	/* number of values stacked */
-    int                valueMax;	/* max number of values stacked */
-    xmlXPathObjectPtr *valueTab;	/* stack of values */
-
-    xmlXPathCompExprPtr comp;		/* the precompiled expression */
-    int xptr;				/* it this an XPointer expression */
-    xmlNodePtr         ancestor;	/* used for walking preceding axis */
-};
-
-/************************************************************************
- *									*
- *			Public API					*
- *									*
- ************************************************************************/
-
-/**
- * Objects and Nodesets handling
- */
-
-XMLPUBVAR double xmlXPathNAN;
-XMLPUBVAR double xmlXPathPINF;
-XMLPUBVAR double xmlXPathNINF;
-
-/* These macros may later turn into functions */
-/**
- * xmlXPathNodeSetGetLength:
- * @ns:  a node-set
- *
- * Implement a functionality similar to the DOM NodeList.length.
- *
- * Returns the number of nodes in the node-set.
- */
-#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
-/**
- * xmlXPathNodeSetItem:
- * @ns:  a node-set
- * @index:  index of a node in the set
- *
- * Implements a functionality similar to the DOM NodeList.item().
- *
- * Returns the xmlNodePtr at the given @index in @ns or NULL if
- *         @index is out of range (0 to length-1)
- */
-#define xmlXPathNodeSetItem(ns, index)				\
-		((((ns) != NULL) && 				\
-		  ((index) >= 0) && ((index) < (ns)->nodeNr)) ?	\
-		 (ns)->nodeTab[(index)]				\
-		 : NULL)
-/**
- * xmlXPathNodeSetIsEmpty:
- * @ns: a node-set
- *
- * Checks whether @ns is empty or not.
- *
- * Returns %TRUE if @ns is an empty node-set.
- */
-#define xmlXPathNodeSetIsEmpty(ns)                                      \
-    (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))
-
-
-XMLPUBFUN void XMLCALL		   
-		    xmlXPathFreeObject		(xmlXPathObjectPtr obj);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	   
-		    xmlXPathNodeSetCreate	(xmlNodePtr val);
-XMLPUBFUN void XMLCALL		   
-		    xmlXPathFreeNodeSetList	(xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL		   
-		    xmlXPathFreeNodeSet		(xmlNodeSetPtr obj);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathObjectCopy		(xmlXPathObjectPtr val);
-XMLPUBFUN int XMLCALL		   
-		    xmlXPathCmpNodes		(xmlNodePtr node1,
-						 xmlNodePtr node2);
-/**
- * Conversion functions to basic types.
- */
-XMLPUBFUN int XMLCALL		   
-		    xmlXPathCastNumberToBoolean	(double val);
-XMLPUBFUN int XMLCALL		   
-		    xmlXPathCastStringToBoolean	(const xmlChar * val);
-XMLPUBFUN int XMLCALL		   
-		    xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
-XMLPUBFUN int XMLCALL		   
-		    xmlXPathCastToBoolean	(xmlXPathObjectPtr val);
-
-XMLPUBFUN double XMLCALL		   
-		    xmlXPathCastBooleanToNumber	(int val);
-XMLPUBFUN double XMLCALL		   
-		    xmlXPathCastStringToNumber	(const xmlChar * val);
-XMLPUBFUN double XMLCALL		   
-		    xmlXPathCastNodeToNumber	(xmlNodePtr node);
-XMLPUBFUN double XMLCALL		   
-		    xmlXPathCastNodeSetToNumber	(xmlNodeSetPtr ns);
-XMLPUBFUN double XMLCALL		   
-		    xmlXPathCastToNumber	(xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlChar * XMLCALL	   
-		    xmlXPathCastBooleanToString	(int val);
-XMLPUBFUN xmlChar * XMLCALL	   
-		    xmlXPathCastNumberToString	(double val);
-XMLPUBFUN xmlChar * XMLCALL	   
-		    xmlXPathCastNodeToString	(xmlNodePtr node);
-XMLPUBFUN xmlChar * XMLCALL	   
-		    xmlXPathCastNodeSetToString	(xmlNodeSetPtr ns);
-XMLPUBFUN xmlChar * XMLCALL	   
-		    xmlXPathCastToString	(xmlXPathObjectPtr val);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathConvertBoolean	(xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathConvertNumber	(xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathConvertString	(xmlXPathObjectPtr val);
-
-/**
- * Context handling.
- */
-XMLPUBFUN xmlXPathContextPtr XMLCALL 
-		    xmlXPathNewContext		(xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
-		    xmlXPathFreeContext		(xmlXPathContextPtr ctxt);
-XMLPUBFUN int XMLCALL
-		    xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
-				            int active,
-					    int value,
-					    int options);
-/**
- * Evaluation functions.
- */
-XMLPUBFUN long XMLCALL               
-		    xmlXPathOrderDocElems	(xmlDocPtr doc);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathEval		(const xmlChar *str,
-						 xmlXPathContextPtr ctx);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		    xmlXPathEvalExpression	(const xmlChar *str,
-						 xmlXPathContextPtr ctxt);
-XMLPUBFUN int XMLCALL                
-		    xmlXPathEvalPredicate	(xmlXPathContextPtr ctxt,
-						 xmlXPathObjectPtr res);
-/**
- * Separate compilation/evaluation entry points.
- */
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL 
-		    xmlXPathCompile		(const xmlChar *str);
-XMLPUBFUN xmlXPathCompExprPtr XMLCALL 
-		    xmlXPathCtxtCompile		(xmlXPathContextPtr ctxt,
-		    				 const xmlChar *str);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL   
-		    xmlXPathCompiledEval	(xmlXPathCompExprPtr comp,
-						 xmlXPathContextPtr ctx);
-XMLPUBFUN int XMLCALL   
-		    xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
-						 xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL                
-		    xmlXPathFreeCompExpr	(xmlXPathCompExprPtr comp);
-#endif /* LIBXML_XPATH_ENABLED */
-#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
-XMLPUBFUN void XMLCALL		   
-		    xmlXPathInit		(void);
-XMLPUBFUN int XMLCALL
-		xmlXPathIsNaN	(double val);
-XMLPUBFUN int XMLCALL
-		xmlXPathIsInf	(double val);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/
-#endif /* ! __XML_XPATH_H__ */
diff --git a/interfaces/ext/libxml/xpathInternals.h b/interfaces/ext/libxml/xpathInternals.h
deleted file mode 100644
index dcd5243..0000000
--- a/interfaces/ext/libxml/xpathInternals.h
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * Summary: internal interfaces for XML Path Language implementation
- * Description: internal interfaces for XML Path Language implementation
- *              used to build new modules on top of XPath like XPointer and
- *              XSLT
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XPATH_INTERNALS_H__
-#define __XML_XPATH_INTERNALS_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/xpath.h>
-
-#ifdef LIBXML_XPATH_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/************************************************************************
- *									*
- *			Helpers						*
- *									*
- ************************************************************************/
-
-/*
- * Many of these macros may later turn into functions. They
- * shouldn't be used in #ifdef's preprocessor instructions.
- */
-/**
- * xmlXPathSetError:
- * @ctxt:  an XPath parser context
- * @err:  an xmlXPathError code
- *
- * Raises an error.
- */
-#define xmlXPathSetError(ctxt, err)					\
-    { xmlXPatherror((ctxt), __FILE__, __LINE__, (err));			\
-      if ((ctxt) != NULL) (ctxt)->error = (err); }
-
-/**
- * xmlXPathSetArityError:
- * @ctxt:  an XPath parser context
- *
- * Raises an XPATH_INVALID_ARITY error.
- */
-#define xmlXPathSetArityError(ctxt)					\
-    xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
-
-/**
- * xmlXPathSetTypeError:
- * @ctxt:  an XPath parser context
- *
- * Raises an XPATH_INVALID_TYPE error.
- */
-#define xmlXPathSetTypeError(ctxt)					\
-    xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
-
-/**
- * xmlXPathGetError:
- * @ctxt:  an XPath parser context
- *
- * Get the error code of an XPath context.
- *
- * Returns the context error.
- */
-#define xmlXPathGetError(ctxt)	  ((ctxt)->error)
-
-/**
- * xmlXPathCheckError:
- * @ctxt:  an XPath parser context
- *
- * Check if an XPath error was raised.
- *
- * Returns true if an error has been raised, false otherwise.
- */
-#define xmlXPathCheckError(ctxt)  ((ctxt)->error != XPATH_EXPRESSION_OK)
-
-/**
- * xmlXPathGetDocument:
- * @ctxt:  an XPath parser context
- *
- * Get the document of an XPath context.
- *
- * Returns the context document.
- */
-#define xmlXPathGetDocument(ctxt)	((ctxt)->context->doc)
-
-/**
- * xmlXPathGetContextNode:
- * @ctxt: an XPath parser context
- *
- * Get the context node of an XPath context.
- *
- * Returns the context node.
- */
-#define xmlXPathGetContextNode(ctxt)	((ctxt)->context->node)
-
-XMLPUBFUN int XMLCALL		
-		xmlXPathPopBoolean	(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN double XMLCALL		
-    		xmlXPathPopNumber	(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL	
-    		xmlXPathPopString	(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-    		xmlXPathPopNodeSet	(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void * XMLCALL		
-    		xmlXPathPopExternal	(xmlXPathParserContextPtr ctxt);
-
-/**
- * xmlXPathReturnBoolean:
- * @ctxt:  an XPath parser context
- * @val:  a boolean
- *
- * Pushes the boolean @val on the context stack.
- */
-#define xmlXPathReturnBoolean(ctxt, val)				\
-    valuePush((ctxt), xmlXPathNewBoolean(val))
-
-/**
- * xmlXPathReturnTrue:
- * @ctxt:  an XPath parser context
- *
- * Pushes true on the context stack.
- */
-#define xmlXPathReturnTrue(ctxt)   xmlXPathReturnBoolean((ctxt), 1)
-
-/**
- * xmlXPathReturnFalse:
- * @ctxt:  an XPath parser context
- *
- * Pushes false on the context stack.
- */
-#define xmlXPathReturnFalse(ctxt)  xmlXPathReturnBoolean((ctxt), 0)
-
-/**
- * xmlXPathReturnNumber:
- * @ctxt:  an XPath parser context
- * @val:  a double
- *
- * Pushes the double @val on the context stack.
- */
-#define xmlXPathReturnNumber(ctxt, val)					\
-    valuePush((ctxt), xmlXPathNewFloat(val))
-
-/**
- * xmlXPathReturnString:
- * @ctxt:  an XPath parser context
- * @str:  a string
- *
- * Pushes the string @str on the context stack.
- */
-#define xmlXPathReturnString(ctxt, str)					\
-    valuePush((ctxt), xmlXPathWrapString(str))
-
-/**
- * xmlXPathReturnEmptyString:
- * @ctxt:  an XPath parser context
- *
- * Pushes an empty string on the stack.
- */
-#define xmlXPathReturnEmptyString(ctxt)					\
-    valuePush((ctxt), xmlXPathNewCString(""))
-
-/**
- * xmlXPathReturnNodeSet:
- * @ctxt:  an XPath parser context
- * @ns:  a node-set
- *
- * Pushes the node-set @ns on the context stack.
- */
-#define xmlXPathReturnNodeSet(ctxt, ns)					\
-    valuePush((ctxt), xmlXPathWrapNodeSet(ns))
-
-/**
- * xmlXPathReturnEmptyNodeSet:
- * @ctxt:  an XPath parser context
- *
- * Pushes an empty node-set on the context stack.
- */
-#define xmlXPathReturnEmptyNodeSet(ctxt)				\
-    valuePush((ctxt), xmlXPathNewNodeSet(NULL))
-
-/**
- * xmlXPathReturnExternal:
- * @ctxt:  an XPath parser context
- * @val:  user data
- *
- * Pushes user data on the context stack.
- */
-#define xmlXPathReturnExternal(ctxt, val)				\
-    valuePush((ctxt), xmlXPathWrapExternal(val))
-
-/**
- * xmlXPathStackIsNodeSet:
- * @ctxt: an XPath parser context
- *
- * Check if the current value on the XPath stack is a node set or
- * an XSLT value tree.
- *
- * Returns true if the current object on the stack is a node-set.
- */
-#define xmlXPathStackIsNodeSet(ctxt)					\
-    (((ctxt)->value != NULL)						\
-     && (((ctxt)->value->type == XPATH_NODESET)				\
-         || ((ctxt)->value->type == XPATH_XSLT_TREE)))
-
-/**
- * xmlXPathStackIsExternal:
- * @ctxt: an XPath parser context
- *
- * Checks if the current value on the XPath stack is an external
- * object.
- *
- * Returns true if the current object on the stack is an external
- * object.
- */
-#define xmlXPathStackIsExternal(ctxt)					\
-	((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
-
-/**
- * xmlXPathEmptyNodeSet:
- * @ns:  a node-set
- *
- * Empties a node-set.
- */
-#define xmlXPathEmptyNodeSet(ns)					\
-    { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; }
-
-/**
- * CHECK_ERROR:
- *
- * Macro to return from the function if an XPath error was detected.
- */
-#define CHECK_ERROR							\
-    if (ctxt->error != XPATH_EXPRESSION_OK) return
-
-/**
- * CHECK_ERROR0:
- *
- * Macro to return 0 from the function if an XPath error was detected.
- */
-#define CHECK_ERROR0							\
-    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
-
-/**
- * XP_ERROR:
- * @X:  the error code
- *
- * Macro to raise an XPath error and return.
- */
-#define XP_ERROR(X)							\
-    { xmlXPathErr(ctxt, X); return; }
-
-/**
- * XP_ERROR0:
- * @X:  the error code
- *
- * Macro to raise an XPath error and return 0.
- */
-#define XP_ERROR0(X)							\
-    { xmlXPathErr(ctxt, X); return(0); }
-
-/**
- * CHECK_TYPE:
- * @typeval:  the XPath type
- *
- * Macro to check that the value on top of the XPath stack is of a given
- * type.
- */
-#define CHECK_TYPE(typeval)						\
-    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
-        XP_ERROR(XPATH_INVALID_TYPE)
-
-/**
- * CHECK_TYPE0:
- * @typeval:  the XPath type
- *
- * Macro to check that the value on top of the XPath stack is of a given
- * type. Return(0) in case of failure
- */
-#define CHECK_TYPE0(typeval)						\
-    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
-        XP_ERROR0(XPATH_INVALID_TYPE)
-
-/**
- * CHECK_ARITY:
- * @x:  the number of expected args
- *
- * Macro to check that the number of args passed to an XPath function matches.
- */
-#define CHECK_ARITY(x)							\
-    if (ctxt == NULL) return;						\
-    if (nargs != (x))							\
-        XP_ERROR(XPATH_INVALID_ARITY);
-
-/**
- * CAST_TO_STRING:
- *
- * Macro to try to cast the value on the top of the XPath stack to a string.
- */
-#define CAST_TO_STRING							\
-    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
-        xmlXPathStringFunction(ctxt, 1);
-
-/**
- * CAST_TO_NUMBER:
- *
- * Macro to try to cast the value on the top of the XPath stack to a number.
- */
-#define CAST_TO_NUMBER							\
-    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
-        xmlXPathNumberFunction(ctxt, 1);
-
-/**
- * CAST_TO_BOOLEAN:
- *
- * Macro to try to cast the value on the top of the XPath stack to a boolean.
- */
-#define CAST_TO_BOOLEAN							\
-    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
-        xmlXPathBooleanFunction(ctxt, 1);
-
-/*
- * Variable Lookup forwarding.
- */
-
-XMLPUBFUN void XMLCALL	
-	xmlXPathRegisterVariableLookup	(xmlXPathContextPtr ctxt,
-					 xmlXPathVariableLookupFunc f,
-					 void *data);
-
-/*
- * Function Lookup forwarding.
- */
-
-XMLPUBFUN void XMLCALL	
-	    xmlXPathRegisterFuncLookup	(xmlXPathContextPtr ctxt,
-					 xmlXPathFuncLookupFunc f,
-					 void *funcCtxt);
-
-/*
- * Error reporting.
- */
-XMLPUBFUN void XMLCALL		
-		xmlXPatherror	(xmlXPathParserContextPtr ctxt,
-				 const char *file,
-				 int line,
-				 int no);
-
-XMLPUBFUN void XMLCALL
-		xmlXPathErr	(xmlXPathParserContextPtr ctxt,
-				 int error);
-
-#ifdef LIBXML_DEBUG_ENABLED
-XMLPUBFUN void XMLCALL		
-		xmlXPathDebugDumpObject	(FILE *output,
-					 xmlXPathObjectPtr cur,
-					 int depth);
-XMLPUBFUN void XMLCALL		
-	    xmlXPathDebugDumpCompExpr(FILE *output,
-					 xmlXPathCompExprPtr comp,
-					 int depth);
-#endif
-/**
- * NodeSet handling.
- */
-XMLPUBFUN int XMLCALL		
-		xmlXPathNodeSetContains		(xmlNodeSetPtr cur,
-						 xmlNodePtr val);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathDifference		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathIntersection		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathDistinctSorted		(xmlNodeSetPtr nodes);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathDistinct		(xmlNodeSetPtr nodes);
-
-XMLPUBFUN int XMLCALL		
-		xmlXPathHasSameNodes		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathNodeLeadingSorted	(xmlNodeSetPtr nodes,
-						 xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathLeadingSorted		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathNodeLeading		(xmlNodeSetPtr nodes,
-						 xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathLeading			(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathNodeTrailingSorted	(xmlNodeSetPtr nodes,
-						 xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathTrailingSorted		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathNodeTrailing		(xmlNodeSetPtr nodes,
-						 xmlNodePtr node);
-XMLPUBFUN xmlNodeSetPtr XMLCALL	
-		xmlXPathTrailing		(xmlNodeSetPtr nodes1,
-						 xmlNodeSetPtr nodes2);
-
-
-/**
- * Extending a context.
- */
-
-XMLPUBFUN int XMLCALL		   
-		xmlXPathRegisterNs		(xmlXPathContextPtr ctxt,
-						 const xmlChar *prefix,
-						 const xmlChar *ns_uri);
-XMLPUBFUN const xmlChar * XMLCALL	   
-		xmlXPathNsLookup		(xmlXPathContextPtr ctxt,
-						 const xmlChar *prefix);
-XMLPUBFUN void XMLCALL		   
-		xmlXPathRegisteredNsCleanup	(xmlXPathContextPtr ctxt);
-
-XMLPUBFUN int XMLCALL		   
-		xmlXPathRegisterFunc		(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 xmlXPathFunction f);
-XMLPUBFUN int XMLCALL		   
-		xmlXPathRegisterFuncNS		(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 const xmlChar *ns_uri,
-						 xmlXPathFunction f);
-XMLPUBFUN int XMLCALL		   
-		xmlXPathRegisterVariable	(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 xmlXPathObjectPtr value);
-XMLPUBFUN int XMLCALL		   
-		xmlXPathRegisterVariableNS	(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 const xmlChar *ns_uri,
-						 xmlXPathObjectPtr value);
-XMLPUBFUN xmlXPathFunction XMLCALL   
-		xmlXPathFunctionLookup		(xmlXPathContextPtr ctxt,
-						 const xmlChar *name);
-XMLPUBFUN xmlXPathFunction XMLCALL   
-		xmlXPathFunctionLookupNS	(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL		   
-		xmlXPathRegisteredFuncsCleanup	(xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		xmlXPathVariableLookup		(xmlXPathContextPtr ctxt,
-						 const xmlChar *name);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL  
-		xmlXPathVariableLookupNS	(xmlXPathContextPtr ctxt,
-						 const xmlChar *name,
-						 const xmlChar *ns_uri);
-XMLPUBFUN void XMLCALL		   
-		xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
-
-/**
- * Utilities to extend XPath.
- */
-XMLPUBFUN xmlXPathParserContextPtr XMLCALL
-		  xmlXPathNewParserContext	(const xmlChar *str,
-			  			 xmlXPathContextPtr ctxt);
-XMLPUBFUN void XMLCALL		  
-		xmlXPathFreeParserContext	(xmlXPathParserContextPtr ctxt);
-
-/* TODO: remap to xmlXPathValuePop and Push. */
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		valuePop			(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN int XMLCALL		  
-		valuePush			(xmlXPathParserContextPtr ctxt,
-					 	 xmlXPathObjectPtr value);
-
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewString		(const xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewCString		(const char *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathWrapString		(xmlChar *val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathWrapCString		(char * val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewFloat		(double val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewBoolean		(int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewNodeSet		(xmlNodePtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewValueTree		(xmlNodePtr val);
-XMLPUBFUN void XMLCALL		  
-		xmlXPathNodeSetAdd		(xmlNodeSetPtr cur,
-						 xmlNodePtr val);
-XMLPUBFUN void XMLCALL              
-		xmlXPathNodeSetAddUnique	(xmlNodeSetPtr cur,
-						 xmlNodePtr val);
-XMLPUBFUN void XMLCALL		  
-		xmlXPathNodeSetAddNs		(xmlNodeSetPtr cur, 
-						 xmlNodePtr node, 
-						 xmlNsPtr ns);
-XMLPUBFUN void XMLCALL              
-		xmlXPathNodeSetSort		(xmlNodeSetPtr set);
-
-XMLPUBFUN void XMLCALL		  
-		xmlXPathRoot			(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL		  
-		xmlXPathEvalExpr		(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL	  
-		xmlXPathParseName		(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN xmlChar * XMLCALL	  
-		xmlXPathParseNCName		(xmlXPathParserContextPtr ctxt);
-
-/*
- * Existing functions.
- */
-XMLPUBFUN double XMLCALL 
-		xmlXPathStringEvalNumber	(const xmlChar *str);
-XMLPUBFUN int XMLCALL 
-		xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, 
-						 xmlXPathObjectPtr res);
-XMLPUBFUN void XMLCALL 
-		xmlXPathRegisterAllFunctions	(xmlXPathContextPtr ctxt);
-XMLPUBFUN xmlNodeSetPtr XMLCALL 
-		xmlXPathNodeSetMerge		(xmlNodeSetPtr val1, 
-						 xmlNodeSetPtr val2);
-XMLPUBFUN void XMLCALL 
-		xmlXPathNodeSetDel		(xmlNodeSetPtr cur, 
-						 xmlNodePtr val);
-XMLPUBFUN void XMLCALL 
-		xmlXPathNodeSetRemove		(xmlNodeSetPtr cur, 
-						 int val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathNewNodeSetList		(xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathWrapNodeSet		(xmlNodeSetPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL 
-		xmlXPathWrapExternal		(void *val);
-
-XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
-XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
-XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt);
-
-XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
-
-/*
- * Some of the axis navigation routines.
- */
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
-			xmlNodePtr cur);
-/*
- * The official core of XPath functions.
- */
-XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
-XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
-
-/**
- * Really internal functions
- */
-XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns);
- 
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_XPATH_ENABLED */
-#endif /* ! __XML_XPATH_INTERNALS_H__ */
diff --git a/interfaces/ext/libxml/xpointer.h b/interfaces/ext/libxml/xpointer.h
deleted file mode 100644
index dde1dfb..0000000
--- a/interfaces/ext/libxml/xpointer.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Summary: API to handle XML Pointers
- * Description: API to handle XML Pointers
- * Base implementation was made accordingly to
- * W3C Candidate Recommendation 7 June 2000
- * http://www.w3.org/TR/2000/CR-xptr-20000607
- *
- * Added support for the element() scheme described in:
- * W3C Proposed Recommendation 13 November 2002
- * http://www.w3.org/TR/2002/PR-xptr-element-20021113/  
- *
- * Copy: See Copyright for the status of this software.
- *
- * Author: Daniel Veillard
- */
-
-#ifndef __XML_XPTR_H__
-#define __XML_XPTR_H__
-
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_XPTR_ENABLED
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * A Location Set
- */
-typedef struct _xmlLocationSet xmlLocationSet;
-typedef xmlLocationSet *xmlLocationSetPtr;
-struct _xmlLocationSet {
-    int locNr;		      /* number of locations in the set */
-    int locMax;		      /* size of the array as allocated */
-    xmlXPathObjectPtr *locTab;/* array of locations */
-};
-
-/*
- * Handling of location sets.
- */
-
-XMLPUBFUN xmlLocationSetPtr XMLCALL			
-		    xmlXPtrLocationSetCreate	(xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL			
-		    xmlXPtrFreeLocationSet	(xmlLocationSetPtr obj);
-XMLPUBFUN xmlLocationSetPtr XMLCALL	
-		    xmlXPtrLocationSetMerge	(xmlLocationSetPtr val1,
-						 xmlLocationSetPtr val2);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewRange		(xmlNodePtr start,
-						 int startindex,
-						 xmlNodePtr end,
-						 int endindex);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewRangePoints	(xmlXPathObjectPtr start,
-						 xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewRangeNodePoint	(xmlNodePtr start,
-						 xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewRangePointNode	(xmlXPathObjectPtr start,
-						 xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL			
-		    xmlXPtrNewRangeNodes	(xmlNodePtr start,
-						 xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewLocationSetNodes	(xmlNodePtr start,
-						 xmlNodePtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewRangeNodeObject	(xmlNodePtr start,
-						 xmlXPathObjectPtr end);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrNewCollapsedRange	(xmlNodePtr start);
-XMLPUBFUN void XMLCALL			
-		    xmlXPtrLocationSetAdd	(xmlLocationSetPtr cur,
-						 xmlXPathObjectPtr val);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrWrapLocationSet	(xmlLocationSetPtr val);
-XMLPUBFUN void XMLCALL			
-		    xmlXPtrLocationSetDel	(xmlLocationSetPtr cur,
-						 xmlXPathObjectPtr val);
-XMLPUBFUN void XMLCALL			
-		    xmlXPtrLocationSetRemove	(xmlLocationSetPtr cur,
-						 int val);
-
-/*
- * Functions.
- */
-XMLPUBFUN xmlXPathContextPtr XMLCALL	
-		    xmlXPtrNewContext		(xmlDocPtr doc,
-						 xmlNodePtr here,
-						 xmlNodePtr origin);
-XMLPUBFUN xmlXPathObjectPtr XMLCALL	
-		    xmlXPtrEval			(const xmlChar *str,
-						 xmlXPathContextPtr ctx);
-XMLPUBFUN void XMLCALL					    
-		    xmlXPtrRangeToFunction	(xmlXPathParserContextPtr ctxt,
-       						 int nargs);
-XMLPUBFUN xmlNodePtr XMLCALL		
-		    xmlXPtrBuildNodeList	(xmlXPathObjectPtr obj);
-XMLPUBFUN void XMLCALL		
-		    xmlXPtrEvalRangePredicate	(xmlXPathParserContextPtr ctxt);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_XPTR_ENABLED */
-#endif /* __XML_XPTR_H__ */
diff --git a/interfaces/ext/magic.h b/interfaces/ext/magic.h
deleted file mode 100644
index 765ff2b..0000000
--- a/interfaces/ext/magic.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) Christos Zoulas 2003.
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice immediately at the beginning of the file, without modification,
- *    this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#ifndef _MAGIC_H
-#define _MAGIC_H
-
-#include <sys/types.h>
-
-#define	MAGIC_NONE		0x000000 /* No flags */
-#define	MAGIC_DEBUG		0x000001 /* Turn on debugging */
-#define	MAGIC_SYMLINK		0x000002 /* Follow symlinks */
-#define	MAGIC_COMPRESS		0x000004 /* Check inside compressed files */
-#define	MAGIC_DEVICES		0x000008 /* Look at the contents of devices */
-#define	MAGIC_MIME_TYPE		0x000010 /* Return the MIME type */
-#define	MAGIC_CONTINUE		0x000020 /* Return all matches */
-#define	MAGIC_CHECK		0x000040 /* Print warnings to stderr */
-#define	MAGIC_PRESERVE_ATIME	0x000080 /* Restore access time on exit */
-#define	MAGIC_RAW		0x000100 /* Don't translate unprintable chars */
-#define	MAGIC_ERROR		0x000200 /* Handle ENOENT etc as real errors */
-#define	MAGIC_MIME_ENCODING	0x000400 /* Return the MIME encoding */
-#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
-#define	MAGIC_APPLE		0x000800 /* Return the Apple creator and type */
-#define	MAGIC_NO_CHECK_COMPRESS	0x001000 /* Don't check for compressed files */
-#define	MAGIC_NO_CHECK_TAR	0x002000 /* Don't check for tar files */
-#define	MAGIC_NO_CHECK_SOFT	0x004000 /* Don't check magic entries */
-#define	MAGIC_NO_CHECK_APPTYPE	0x008000 /* Don't check application type */
-#define	MAGIC_NO_CHECK_ELF	0x010000 /* Don't check for elf details */
-#define	MAGIC_NO_CHECK_TEXT	0x020000 /* Don't check for text files */
-#define	MAGIC_NO_CHECK_CDF	0x040000 /* Don't check for cdf files */
-#define	MAGIC_NO_CHECK_TOKENS	0x100000 /* Don't check tokens */
-#define MAGIC_NO_CHECK_ENCODING 0x200000 /* Don't check text encodings */
-
-/* Defined for backwards compatibility (renamed) */
-#define	MAGIC_NO_CHECK_ASCII	MAGIC_NO_CHECK_TEXT
-
-/* Defined for backwards compatibility; do nothing */
-#define	MAGIC_NO_CHECK_FORTRAN	0x000000 /* Don't check ascii/fortran */
-#define	MAGIC_NO_CHECK_TROFF	0x000000 /* Don't check ascii/troff */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct magic_set *magic_t;
-magic_t magic_open(int);
-void magic_close(magic_t);
-
-const char *magic_getpath(const char *, int);
-const char *magic_file(magic_t, const char *);
-const char *magic_descriptor(magic_t, int);
-const char *magic_buffer(magic_t, const void *, size_t);
-
-const char *magic_error(magic_t);
-int magic_setflags(magic_t, int);
-
-int magic_load(magic_t, const char *);
-int magic_compile(magic_t, const char *);
-int magic_check(magic_t, const char *);
-int magic_errno(magic_t);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _MAGIC_H */
diff --git a/interfaces/ext/regex.h b/interfaces/ext/regex.h
deleted file mode 100644
index b39c3f9..0000000
--- a/interfaces/ext/regex.h
+++ /dev/null
@@ -1,557 +0,0 @@
-/* Definitions for data structures and routines for the regular
-   expression library.
-   Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006
-   Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _REGEX_H
-#define _REGEX_H 1
-
-#include <sys/types.h>
-
-/* Allow the use in C++ code.  */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The following two types have to be signed and unsigned integer type
-   wide enough to hold a value of a pointer.  For most ANSI compilers
-   ptrdiff_t and size_t should be likely OK.  Still size of these two
-   types is 2 for Microsoft C.  Ugh... */
-typedef long int s_reg_t;
-typedef unsigned long int active_reg_t;
-
-/* The following bits are used to determine the regexp syntax we
-   recognize.  The set/not-set meanings are chosen so that Emacs syntax
-   remains the value 0.  The bits are given in alphabetical order, and
-   the definitions shifted by one from the previous bit; thus, when we
-   add or remove a bit, only one other definition need change.  */
-typedef unsigned long int reg_syntax_t;
-
-/* If this bit is not set, then \ inside a bracket expression is literal.
-   If set, then such a \ quotes the following character.  */
-#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
-
-/* If this bit is not set, then + and ? are operators, and \+ and \? are
-     literals.
-   If set, then \+ and \? are operators and + and ? are literals.  */
-#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
-
-/* If this bit is set, then character classes are supported.  They are:
-     [:alpha:], [:upper:], [:lower:],  [:digit:], [:alnum:], [:xdigit:],
-     [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
-   If not set, then character classes are not supported.  */
-#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
-
-/* If this bit is set, then ^ and $ are always anchors (outside bracket
-     expressions, of course).
-   If this bit is not set, then it depends:
-        ^  is an anchor if it is at the beginning of a regular
-           expression or after an open-group or an alternation operator;
-        $  is an anchor if it is at the end of a regular expression, or
-           before a close-group or an alternation operator.
-
-   This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
-   POSIX draft 11.2 says that * etc. in leading positions is undefined.
-   We already implemented a previous draft which made those constructs
-   invalid, though, so we haven't changed the code back.  */
-#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
-
-/* If this bit is set, then special characters are always special
-     regardless of where they are in the pattern.
-   If this bit is not set, then special characters are special only in
-     some contexts; otherwise they are ordinary.  Specifically,
-     * + ? and intervals are only special when not after the beginning,
-     open-group, or alternation operator.  */
-#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
-
-/* If this bit is set, then *, +, ?, and { cannot be first in an re or
-     immediately after an alternation or begin-group operator.  */
-#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
-
-/* If this bit is set, then . matches newline.
-   If not set, then it doesn't.  */
-#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
-
-/* If this bit is set, then . doesn't match NUL.
-   If not set, then it does.  */
-#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
-
-/* If this bit is set, nonmatching lists [^...] do not match newline.
-   If not set, they do.  */
-#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
-
-/* If this bit is set, either \{...\} or {...} defines an
-     interval, depending on RE_NO_BK_BRACES.
-   If not set, \{, \}, {, and } are literals.  */
-#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
-
-/* If this bit is set, +, ? and | aren't recognized as operators.
-   If not set, they are.  */
-#define RE_LIMITED_OPS (RE_INTERVALS << 1)
-
-/* If this bit is set, newline is an alternation operator.
-   If not set, newline is literal.  */
-#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
-
-/* If this bit is set, then `{...}' defines an interval, and \{ and \}
-     are literals.
-  If not set, then `\{...\}' defines an interval.  */
-#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
-
-/* If this bit is set, (...) defines a group, and \( and \) are literals.
-   If not set, \(...\) defines a group, and ( and ) are literals.  */
-#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
-
-/* If this bit is set, then \<digit> matches <digit>.
-   If not set, then \<digit> is a back-reference.  */
-#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-
-/* If this bit is set, then | is an alternation operator, and \| is literal.
-   If not set, then \| is an alternation operator, and | is literal.  */
-#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
-
-/* If this bit is set, then an ending range point collating higher
-     than the starting range point, as in [z-a], is invalid.
-   If not set, then when ending range point collates higher than the
-     starting range point, the range is ignored.  */
-#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
-
-/* If this bit is set, then an unmatched ) is ordinary.
-   If not set, then an unmatched ) is invalid.  */
-#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
-
-/* If this bit is set, succeed as soon as we match the whole pattern,
-   without further backtracking.  */
-#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
-
-/* If this bit is set, do not process the GNU regex operators.
-   If not set, then the GNU regex operators are recognized. */
-#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
-
-/* If this bit is set, turn on internal regex debugging.
-   If not set, and debugging was on, turn it off.
-   This only works if regex.c is compiled -DDEBUG.
-   We define this bit always, so that all that's needed to turn on
-   debugging is to recompile regex.c; the calling code can always have
-   this bit set, and it won't affect anything in the normal case. */
-#define RE_DEBUG (RE_NO_GNU_OPS << 1)
-
-/* If this bit is set, a syntactically invalid interval is treated as
-   a string of ordinary characters.  For example, the ERE 'a{1' is
-   treated as 'a\{1'.  */
-#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
-
-/* If this bit is set, then ignore case when matching.
-   If not set, then case is significant.  */
-#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
-
-/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
-   for ^, because it is difficult to scan the regex backwards to find
-   whether ^ should be special.  */
-#define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
-
-/* If this bit is set, then \{ cannot be first in an bre or
-   immediately after an alternation or begin-group operator.  */
-#define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
-
-/* If this bit is set, then no_sub will be set to 1 during
-   re_compile_pattern.  */
-#define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
-
-/* This global variable defines the particular regexp syntax to use (for
-   some interfaces).  When a regexp is compiled, the syntax used is
-   stored in the pattern buffer, so changing this does not affect
-   already-compiled regexps.  */
-extern reg_syntax_t re_syntax_options;
-
-/* Define combinations of the above bits for the standard possibilities.
-   (The [[[ comments delimit what gets put into the Texinfo file, so
-   don't delete them!)  */
-/* [[[begin syntaxes]]] */
-#define RE_SYNTAX_EMACS 0
-
-#define RE_SYNTAX_AWK							\
-  (RE_BACKSLASH_ESCAPE_IN_LISTS   | RE_DOT_NOT_NULL			\
-   | RE_NO_BK_PARENS              | RE_NO_BK_REFS			\
-   | RE_NO_BK_VBAR                | RE_NO_EMPTY_RANGES			\
-   | RE_DOT_NEWLINE		  | RE_CONTEXT_INDEP_ANCHORS		\
-   | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GNU_AWK						\
-  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG)	\
-   & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS		\
-       | RE_CONTEXT_INVALID_OPS ))
-
-#define RE_SYNTAX_POSIX_AWK						\
-  (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS		\
-   | RE_INTERVALS	    | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GREP							\
-  (RE_BK_PLUS_QM              | RE_CHAR_CLASSES				\
-   | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS				\
-   | RE_NEWLINE_ALT)
-
-#define RE_SYNTAX_EGREP							\
-  (RE_CHAR_CLASSES        | RE_CONTEXT_INDEP_ANCHORS			\
-   | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE			\
-   | RE_NEWLINE_ALT       | RE_NO_BK_PARENS				\
-   | RE_NO_BK_VBAR)
-
-#define RE_SYNTAX_POSIX_EGREP						\
-  (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES			\
-   | RE_INVALID_INTERVAL_ORD)
-
-/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff.  */
-#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
-
-#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
-
-/* Syntax bits common to both basic and extended POSIX regex syntax.  */
-#define _RE_SYNTAX_POSIX_COMMON						\
-  (RE_CHAR_CLASSES | RE_DOT_NEWLINE      | RE_DOT_NOT_NULL		\
-   | RE_INTERVALS  | RE_NO_EMPTY_RANGES)
-
-#define RE_SYNTAX_POSIX_BASIC						\
-  (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
-
-/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
-   RE_LIMITED_OPS, i.e., \? \+ \| are not recognized.  Actually, this
-   isn't minimal, since other operators, such as \`, aren't disabled.  */
-#define RE_SYNTAX_POSIX_MINIMAL_BASIC					\
-  (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
-
-#define RE_SYNTAX_POSIX_EXTENDED					\
-  (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS			\
-   | RE_CONTEXT_INDEP_OPS   | RE_NO_BK_BRACES				\
-   | RE_NO_BK_PARENS        | RE_NO_BK_VBAR				\
-   | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
-
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
-   removed and RE_NO_BK_REFS is added.  */
-#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED				\
-  (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS			\
-   | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES				\
-   | RE_NO_BK_PARENS        | RE_NO_BK_REFS				\
-   | RE_NO_BK_VBAR	    | RE_UNMATCHED_RIGHT_PAREN_ORD)
-/* [[[end syntaxes]]] */
-
-/* Maximum number of duplicates an interval can allow.  Some systems
-   (erroneously) define this in other header files, but we want our
-   value, so remove any previous define.  */
-#ifdef RE_DUP_MAX
-# undef RE_DUP_MAX
-#endif
-/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows.  */
-#define RE_DUP_MAX (0x7fff)
-
-
-/* POSIX `cflags' bits (i.e., information for `regcomp').  */
-
-/* If this bit is set, then use extended regular expression syntax.
-   If not set, then use basic regular expression syntax.  */
-#define REG_EXTENDED 1
-
-/* If this bit is set, then ignore case when matching.
-   If not set, then case is significant.  */
-#define REG_ICASE (REG_EXTENDED << 1)
-
-/* If this bit is set, then anchors do not match at newline
-     characters in the string.
-   If not set, then anchors do match at newlines.  */
-#define REG_NEWLINE (REG_ICASE << 1)
-
-/* If this bit is set, then report only success or fail in regexec.
-   If not set, then returns differ between not matching and errors.  */
-#define REG_NOSUB (REG_NEWLINE << 1)
-
-
-/* POSIX `eflags' bits (i.e., information for regexec).  */
-
-/* If this bit is set, then the beginning-of-line operator doesn't match
-     the beginning of the string (presumably because it's not the
-     beginning of a line).
-   If not set, then the beginning-of-line operator does match the
-     beginning of the string.  */
-#define REG_NOTBOL 1
-
-/* Like REG_NOTBOL, except for the end-of-line.  */
-#define REG_NOTEOL (1 << 1)
-
-/* Use PMATCH[0] to delimit the start and end of the search in the
-   buffer.  */
-#define REG_STARTEND (1 << 2)
-
-
-/* If any error codes are removed, changed, or added, update the
-   `re_error_msg' table in regex.c.  */
-typedef enum
-{
-#ifdef _XOPEN_SOURCE
-  REG_ENOSYS = -1,	/* This will never happen for this implementation.  */
-#endif
-
-  REG_NOERROR = 0,	/* Success.  */
-  REG_NOMATCH,		/* Didn't find a match (for regexec).  */
-
-  /* POSIX regcomp return error codes.  (In the order listed in the
-     standard.)  */
-  REG_BADPAT,		/* Invalid pattern.  */
-  REG_ECOLLATE,		/* Inalid collating element.  */
-  REG_ECTYPE,		/* Invalid character class name.  */
-  REG_EESCAPE,		/* Trailing backslash.  */
-  REG_ESUBREG,		/* Invalid back reference.  */
-  REG_EBRACK,		/* Unmatched left bracket.  */
-  REG_EPAREN,		/* Parenthesis imbalance.  */
-  REG_EBRACE,		/* Unmatched \{.  */
-  REG_BADBR,		/* Invalid contents of \{\}.  */
-  REG_ERANGE,		/* Invalid range end.  */
-  REG_ESPACE,		/* Ran out of memory.  */
-  REG_BADRPT,		/* No preceding re for repetition op.  */
-
-  /* Error codes we've added.  */
-  REG_EEND,		/* Premature end.  */
-  REG_ESIZE,		/* Compiled pattern bigger than 2^16 bytes.  */
-  REG_ERPAREN		/* Unmatched ) or \); not returned from regcomp.  */
-} reg_errcode_t;
-
-/* This data structure represents a compiled pattern.  Before calling
-   the pattern compiler, the fields `buffer', `allocated', `fastmap',
-   `translate', and `no_sub' can be set.  After the pattern has been
-   compiled, the `re_nsub' field is available.  All other fields are
-   private to the regex routines.  */
-
-#ifndef RE_TRANSLATE_TYPE
-# define RE_TRANSLATE_TYPE unsigned char *
-#endif
-
-struct re_pattern_buffer
-{
-  /* Space that holds the compiled pattern.  It is declared as
-     `unsigned char *' because its elements are sometimes used as
-     array indexes.  */
-  unsigned char *buffer;
-
-  /* Number of bytes to which `buffer' points.  */
-  unsigned long int allocated;
-
-  /* Number of bytes actually used in `buffer'.  */
-  unsigned long int used;
-
-  /* Syntax setting with which the pattern was compiled.  */
-  reg_syntax_t syntax;
-
-  /* Pointer to a fastmap, if any, otherwise zero.  re_search uses the
-     fastmap, if there is one, to skip over impossible starting points
-     for matches.  */
-  char *fastmap;
-
-  /* Either a translate table to apply to all characters before
-     comparing them, or zero for no translation.  The translation is
-     applied to a pattern when it is compiled and to a string when it
-     is matched.  */
-  RE_TRANSLATE_TYPE translate;
-
-  /* Number of subexpressions found by the compiler.  */
-  size_t re_nsub;
-
-  /* Zero if this pattern cannot match the empty string, one else.
-     Well, in truth it's used only in `re_search_2', to see whether or
-     not we should use the fastmap, so we don't set this absolutely
-     perfectly; see `re_compile_fastmap' (the `duplicate' case).  */
-  unsigned can_be_null : 1;
-
-  /* If REGS_UNALLOCATED, allocate space in the `regs' structure
-     for `max (RE_NREGS, re_nsub + 1)' groups.
-     If REGS_REALLOCATE, reallocate space if necessary.
-     If REGS_FIXED, use what's there.  */
-#define REGS_UNALLOCATED 0
-#define REGS_REALLOCATE 1
-#define REGS_FIXED 2
-  unsigned regs_allocated : 2;
-
-  /* Set to zero when `regex_compile' compiles a pattern; set to one
-     by `re_compile_fastmap' if it updates the fastmap.  */
-  unsigned fastmap_accurate : 1;
-
-  /* If set, `re_match_2' does not return information about
-     subexpressions.  */
-  unsigned no_sub : 1;
-
-  /* If set, a beginning-of-line anchor doesn't match at the beginning
-     of the string.  */
-  unsigned not_bol : 1;
-
-  /* Similarly for an end-of-line anchor.  */
-  unsigned not_eol : 1;
-
-  /* If true, an anchor at a newline matches.  */
-  unsigned newline_anchor : 1;
-};
-
-typedef struct re_pattern_buffer regex_t;
-
-/* Type for byte offsets within the string.  POSIX mandates this.  */
-typedef int regoff_t;
-
-
-/* This is the structure we store register match data in.  See
-   regex.texinfo for a full description of what registers match.  */
-struct re_registers
-{
-  unsigned num_regs;
-  regoff_t *start;
-  regoff_t *end;
-};
-
-
-/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
-   `re_match_2' returns information about at least this many registers
-   the first time a `regs' structure is passed.  */
-#ifndef RE_NREGS
-# define RE_NREGS 30
-#endif
-
-
-/* POSIX specification for registers.  Aside from the different names than
-   `re_registers', POSIX uses an array of structures, instead of a
-   structure of arrays.  */
-typedef struct
-{
-  regoff_t rm_so;  /* Byte offset from string's start to substring's start.  */
-  regoff_t rm_eo;  /* Byte offset from string's start to substring's end.  */
-} regmatch_t;
-
-
-/* Declarations for routines.  */
-
-/* Sets the current default syntax to SYNTAX, and return the old syntax.
-   You can also simply assign to the `re_syntax_options' variable.  */
-extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
-
-/* Compile the regular expression PATTERN, with length LENGTH
-   and syntax given by the global `re_syntax_options', into the buffer
-   BUFFER.  Return NULL if successful, and an error string if not.  */
-extern const char *re_compile_pattern (const char *__pattern, size_t __length,
-				       struct re_pattern_buffer *__buffer);
-
-
-/* Compile a fastmap for the compiled pattern in BUFFER; used to
-   accelerate searches.  Return 0 if successful and -2 if was an
-   internal error.  */
-extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
-
-
-/* Search in the string STRING (with length LENGTH) for the pattern
-   compiled into BUFFER.  Start searching at position START, for RANGE
-   characters.  Return the starting position of the match, -1 for no
-   match, or -2 for an internal error.  Also return register
-   information in REGS (if REGS and BUFFER->no_sub are nonzero).  */
-extern int re_search (struct re_pattern_buffer *__buffer, const char *__string,
-		      int __length, int __start, int __range,
-		      struct re_registers *__regs);
-
-
-/* Like `re_search', but search in the concatenation of STRING1 and
-   STRING2.  Also, stop searching at index START + STOP.  */
-extern int re_search_2 (struct re_pattern_buffer *__buffer,
-			const char *__string1, int __length1,
-			const char *__string2, int __length2, int __start,
-			int __range, struct re_registers *__regs, int __stop);
-
-
-/* Like `re_search', but return how many characters in STRING the regexp
-   in BUFFER matched, starting at position START.  */
-extern int re_match (struct re_pattern_buffer *__buffer, const char *__string,
-		     int __length, int __start, struct re_registers *__regs);
-
-
-/* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
-extern int re_match_2 (struct re_pattern_buffer *__buffer,
-		       const char *__string1, int __length1,
-		       const char *__string2, int __length2, int __start,
-		       struct re_registers *__regs, int __stop);
-
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
-   ENDS.  Subsequent matches using BUFFER and REGS will use this memory
-   for recording register information.  STARTS and ENDS must be
-   allocated with malloc, and must each be at least `NUM_REGS * sizeof
-   (regoff_t)' bytes long.
-
-   If NUM_REGS == 0, then subsequent matches should allocate their own
-   register data.
-
-   Unless this function is called, the first search or match using
-   PATTERN_BUFFER will allocate its own register data, without
-   freeing the old data.  */
-extern void re_set_registers (struct re_pattern_buffer *__buffer,
-			      struct re_registers *__regs,
-			      unsigned int __num_regs,
-			      regoff_t *__starts, regoff_t *__ends);
-
-#if defined _REGEX_RE_COMP || defined _LIBC
-# ifndef _CRAY
-/* 4.2 bsd compatibility.  */
-extern char *re_comp (const char *);
-extern int re_exec (const char *);
-# endif
-#endif
-
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
-   "restrict", and "configure" may have defined "restrict".  */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-#  if defined restrict || 199901L <= __STDC_VERSION__
-#   define __restrict restrict
-#  else
-#   define __restrict
-#  endif
-# endif
-#endif
-/* gcc 3.1 and up support the [restrict] syntax.  */
-#ifndef __restrict_arr
-# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) \
-     && !defined __GNUG__
-#  define __restrict_arr __restrict
-# else
-#  define __restrict_arr
-# endif
-#endif
-
-/* POSIX compatibility.  */
-extern int regcomp (regex_t *__restrict __preg,
-		    const char *__restrict __pattern,
-		    int __cflags);
-
-extern int regexec (const regex_t *__restrict __preg,
-		    const char *__restrict __string, size_t __nmatch,
-		    regmatch_t __pmatch[__restrict_arr],
-		    int __eflags);
-
-extern size_t regerror (int __errcode, const regex_t *__restrict __preg,
-			char *__restrict __errbuf, size_t __errbuf_size);
-
-extern void regfree (regex_t *__preg);
-
-
-#ifdef __cplusplus
-}
-#endif	/* C++ */
-
-#endif /* regex.h */
diff --git a/interfaces/ext/zconf.h b/interfaces/ext/zconf.h
deleted file mode 100644
index e81703c..0000000
--- a/interfaces/ext/zconf.h
+++ /dev/null
@@ -1,304 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-#  define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-#  define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-#  ifndef WIN32
-#    define WIN32
-#  endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-#    ifndef SYS16BIT
-#      define SYS16BIT
-#    endif
-#  endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-#  define MAXSEG_64K
-#endif
-#ifdef MSDOS
-#  define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-#  ifndef STDC
-#    define STDC
-#  endif
-#  if __STDC_VERSION__ >= 199901L
-#    ifndef STDC99
-#      define STDC99
-#    endif
-#  endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-#  define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
-#  define STDC
-#endif
-
-#ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-#    define const       /* note: need a more gentle solution here */
-#  endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-#  define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-#  ifdef MAXSEG_64K
-#    define MAX_MEM_LEVEL 8
-#  else
-#    define MAX_MEM_LEVEL 9
-#  endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-#  define MAX_WBITS   15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
-            (1 << (windowBits+2)) +  (1 << (memLevel+9))
- that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
-     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
-   The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-                        /* Type declarations */
-
-#ifndef OF /* function prototypes */
-#  ifdef STDC
-#    define OF(args)  args
-#  else
-#    define OF(args)  ()
-#  endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-#  if defined(M_I86SM) || defined(M_I86MM)
-     /* MSC small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef _MSC_VER
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#  if (defined(__SMALL__) || defined(__MEDIUM__))
-     /* Turbo C small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef __BORLANDC__
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
-   /* If building or using zlib as a DLL, define ZLIB_DLL.
-    * This is not mandatory, but it offers a little performance increase.
-    */
-#  ifdef ZLIB_DLL
-#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-#      ifdef ZLIB_INTERNAL
-#        define ZEXTERN extern __declspec(dllexport)
-#      else
-#        define ZEXTERN extern __declspec(dllimport)
-#      endif
-#    endif
-#  endif  /* ZLIB_DLL */
-   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
-    * define ZLIB_WINAPI.
-    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
-    */
-#  ifdef ZLIB_WINAPI
-#    ifdef FAR
-#      undef FAR
-#    endif
-#    include <windows.h>
-     /* No need for _export, use ZLIB.DEF instead. */
-     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-#    define ZEXPORT WINAPI
-#    ifdef WIN32
-#      define ZEXPORTVA WINAPIV
-#    else
-#      define ZEXPORTVA FAR CDECL
-#    endif
-#  endif
-#endif
-
-#if defined (__BEOS__)
-#  ifdef ZLIB_DLL
-#    ifdef ZLIB_INTERNAL
-#      define ZEXPORT   __declspec(dllexport)
-#      define ZEXPORTVA __declspec(dllexport)
-#    else
-#      define ZEXPORT   __declspec(dllimport)
-#      define ZEXPORTVA __declspec(dllimport)
-#    endif
-#  endif
-#endif
-
-#ifndef ZEXTERN
-#  define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-#  define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-#  define ZEXPORTVA
-#endif
-
-#ifndef FAR
-#  define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char  Byte;  /* 8 bits */
-#endif
-typedef unsigned int   uInt;  /* 16 bits or more */
-typedef unsigned long  uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
-   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-#  define Bytef Byte FAR
-#else
-   typedef Byte  FAR Bytef;
-#endif
-typedef char  FAR charf;
-typedef int   FAR intf;
-typedef uInt  FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
-   typedef void const *voidpc;
-   typedef void FAR   *voidpf;
-   typedef void       *voidp;
-#else
-   typedef Byte const *voidpc;
-   typedef Byte FAR   *voidpf;
-   typedef Byte       *voidp;
-#endif
-
-#if UNIX
-#  define Z_HAVE_UNISTD_H
-#endif
-
-#ifdef STDC
-#  include <sys/types.h>    /* for off_t */
-#endif
-
-/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
- * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
- * though the former does not conform to the LFS document), but considering
- * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
- * equivalently requesting no 64-bit operations
- */
-#if -_LARGEFILE64_SOURCE - -1 == 1
-#  undef _LARGEFILE64_SOURCE
-#endif
-
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-#  include <unistd.h>       /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>     /* for off_t */
-#  endif
-#  ifndef z_off_t
-#    define z_off_t off_t
-#  endif
-#endif
-
-#ifndef SEEK_SET
-#  define SEEK_SET        0       /* Seek from beginning of file.  */
-#  define SEEK_CUR        1       /* Seek from current position.  */
-#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
-#endif
-
-#ifndef z_off_t
-#  define z_off_t long
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
-#  define z_off64_t off64_t
-#else
-#  define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-  #pragma map(deflateInit_,"DEIN")
-  #pragma map(deflateInit2_,"DEIN2")
-  #pragma map(deflateEnd,"DEEND")
-  #pragma map(deflateBound,"DEBND")
-  #pragma map(inflateInit_,"ININ")
-  #pragma map(inflateInit2_,"ININ2")
-  #pragma map(inflateEnd,"INEND")
-  #pragma map(inflateSync,"INSY")
-  #pragma map(inflateSetDictionary,"INSEDI")
-  #pragma map(compressBound,"CMBND")
-  #pragma map(inflate_table,"INTABL")
-  #pragma map(inflate_fast,"INFA")
-  #pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/interfaces/ext/zlib.h b/interfaces/ext/zlib.h
deleted file mode 100644
index bfbba83..0000000
--- a/interfaces/ext/zlib.h
+++ /dev/null
@@ -1,1613 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.5, April 19th, 2010
-
-  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup at gzip.org          madler at alumni.caltech.edu
-
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
-  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.5"
-#define ZLIB_VERNUM 0x1250
-#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 5
-#define ZLIB_VER_SUBREVISION 0
-
-/*
-    The 'zlib' compression library provides in-memory compression and
-  decompression functions, including integrity checks of the uncompressed data.
-  This version of the library supports only one compression method (deflation)
-  but other algorithms will be added later and will have the same stream
-  interface.
-
-    Compression can be done in a single step if the buffers are large enough,
-  or can be done by repeated calls of the compression function.  In the latter
-  case, the application must provide more input and/or consume the output
-  (providing more output space) before each call.
-
-    The compressed data format used by default by the in-memory functions is
-  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
-  around a deflate stream, which is itself documented in RFC 1951.
-
-    The library also supports reading and writing files in gzip (.gz) format
-  with an interface similar to that of stdio using the functions that start
-  with "gz".  The gzip format is different from the zlib format.  gzip is a
-  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
-    This library can optionally read and write gzip streams in memory as well.
-
-    The zlib format was designed to be compact and fast for use in memory
-  and on communications channels.  The gzip format was designed for single-
-  file compression on file systems, has a larger header than zlib to maintain
-  directory information, and uses a different, slower check method than zlib.
-
-    The library does not install any signal handler.  The decoder checks
-  the consistency of the compressed data, so the library should never crash
-  even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
-    Bytef    *next_in;  /* next input byte */
-    uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total nb of input bytes read so far */
-
-    Bytef    *next_out; /* next output byte should be put there */
-    uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total nb of bytes output so far */
-
-    char     *msg;      /* last error message, NULL if no error */
-    struct internal_state FAR *state; /* not visible by applications */
-
-    alloc_func zalloc;  /* used to allocate the internal state */
-    free_func  zfree;   /* used to free the internal state */
-    voidpf     opaque;  /* private data object passed to zalloc and zfree */
-
-    int     data_type;  /* best guess about the data type: binary or text */
-    uLong   adler;      /* adler32 value of the uncompressed data */
-    uLong   reserved;   /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
-     gzip header information passed to and from zlib routines.  See RFC 1952
-  for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
-    int     text;       /* true if compressed data believed to be text */
-    uLong   time;       /* modification time */
-    int     xflags;     /* extra flags (not used when writing a gzip file) */
-    int     os;         /* operating system */
-    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
-    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
-    uInt    extra_max;  /* space at extra (only when reading header) */
-    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
-    uInt    name_max;   /* space at name (only when reading header) */
-    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
-    uInt    comm_max;   /* space at comment (only when reading header) */
-    int     hcrc;       /* true if there was or will be a header crc */
-    int     done;       /* true when done reading gzip header (not used
-                           when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
-     The application must update next_in and avail_in when avail_in has dropped
-   to zero.  It must update next_out and avail_out when avail_out has dropped
-   to zero.  The application must initialize zalloc, zfree and opaque before
-   calling the init function.  All other fields are set by the compression
-   library and must not be updated by the application.
-
-     The opaque value provided by the application will be passed as the first
-   parameter for calls of zalloc and zfree.  This can be useful for custom
-   memory management.  The compression library attaches no meaning to the
-   opaque value.
-
-     zalloc must return Z_NULL if there is not enough memory for the object.
-   If zlib is used in a multi-threaded application, zalloc and zfree must be
-   thread safe.
-
-     On 16-bit systems, the functions zalloc and zfree must be able to allocate
-   exactly 65536 bytes, but will not be required to allocate more than this if
-   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
-   returned by zalloc for objects of exactly 65536 bytes *must* have their
-   offset normalized to zero.  The default allocation function provided by this
-   library ensures this (see zutil.c).  To reduce memory requirements and avoid
-   any allocation of 64K objects, at the expense of compression ratio, compile
-   the library with -DMAX_WBITS=14 (see zconf.h).
-
-     The fields total_in and total_out can be used for statistics or progress
-   reports.  After compression, total_in holds the total size of the
-   uncompressed data and may be saved for use in the decompressor (particularly
-   if the decompressor wants to decompress everything in a single step).
-*/
-
-                        /* constants */
-
-#define Z_NO_FLUSH      0
-#define Z_PARTIAL_FLUSH 1
-#define Z_SYNC_FLUSH    2
-#define Z_FULL_FLUSH    3
-#define Z_FINISH        4
-#define Z_BLOCK         5
-#define Z_TREES         6
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK            0
-#define Z_STREAM_END    1
-#define Z_NEED_DICT     2
-#define Z_ERRNO        (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR   (-3)
-#define Z_MEM_ERROR    (-4)
-#define Z_BUF_ERROR    (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION         0
-#define Z_BEST_SPEED             1
-#define Z_BEST_COMPRESSION       9
-#define Z_DEFAULT_COMPRESSION  (-1)
-/* compression levels */
-
-#define Z_FILTERED            1
-#define Z_HUFFMAN_ONLY        2
-#define Z_RLE                 3
-#define Z_FIXED               4
-#define Z_DEFAULT_STRATEGY    0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY   0
-#define Z_TEXT     1
-#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN  2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED   8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-
-                        /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
-   If the first character differs, the library code actually used is not
-   compatible with the zlib.h header file used by the application.  This check
-   is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
-     Initializes the internal stream state for compression.  The fields
-   zalloc, zfree and opaque must be initialized before by the caller.  If
-   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
-   allocation functions.
-
-     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
-   1 gives best speed, 9 gives best compression, 0 gives no compression at all
-   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
-   requests a default compromise between speed and compression (currently
-   equivalent to level 6).
-
-     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if level is not a valid compression level, or
-   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
-   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
-   if there is no error message.  deflateInit does not perform any compression:
-   this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
-    deflate compresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full.  It may introduce
-  some output latency (reading input without producing any output) except when
-  forced to flush.
-
-    The detailed semantics are as follows.  deflate performs one or both of the
-  following actions:
-
-  - Compress more input starting at next_in and update next_in and avail_in
-    accordingly.  If not all input can be processed (because there is not
-    enough room in the output buffer), next_in and avail_in are updated and
-    processing will resume at this point for the next call of deflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  This action is forced if the parameter flush is non zero.
-    Forcing flush frequently degrades the compression ratio, so this parameter
-    should be set only when necessary (in interactive applications).  Some
-    output may be provided even if flush is not set.
-
-    Before the call of deflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming more
-  output, and updating avail_in or avail_out accordingly; avail_out should
-  never be zero before the call.  The application can consume the compressed
-  output when it wants, for example when the output buffer is full (avail_out
-  == 0), or after each call of deflate().  If deflate returns Z_OK and with
-  zero avail_out, it must be called again after making room in the output
-  buffer because there might be more output pending.
-
-    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
-  decide how much data to accumulate before producing output, in order to
-  maximize compression.
-
-    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
-  flushed to the output buffer and the output is aligned on a byte boundary, so
-  that the decompressor can get all input data available so far.  (In
-  particular avail_in is zero after the call if enough output space has been
-  provided before the call.) Flushing may degrade compression for some
-  compression algorithms and so it should be used only when necessary.  This
-  completes the current deflate block and follows it with an empty stored block
-  that is three bits plus filler bits to the next byte, followed by four bytes
-  (00 00 ff ff).
-
-    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
-  output buffer, but the output is not aligned to a byte boundary.  All of the
-  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
-  This completes the current deflate block and follows it with an empty fixed
-  codes block that is 10 bits long.  This assures that enough bytes are output
-  in order for the decompressor to finish the block before the empty fixed code
-  block.
-
-    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
-  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
-  seven bits of the current block are held to be written as the next byte after
-  the next deflate block is completed.  In this case, the decompressor may not
-  be provided enough bits at this point in order to complete decompression of
-  the data provided so far to the compressor.  It may need to wait for the next
-  block to be emitted.  This is for advanced applications that need to control
-  the emission of deflate blocks.
-
-    If flush is set to Z_FULL_FLUSH, all output is flushed as with
-  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
-  restart from this point if previous compressed data has been damaged or if
-  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
-  compression.
-
-    If deflate returns with avail_out == 0, this function must be called again
-  with the same value of the flush parameter and more output space (updated
-  avail_out), until the flush is complete (deflate returns with non-zero
-  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
-  avail_out is greater than six to avoid repeated flush markers due to
-  avail_out == 0 on return.
-
-    If the parameter flush is set to Z_FINISH, pending input is processed,
-  pending output is flushed and deflate returns with Z_STREAM_END if there was
-  enough output space; if deflate returns with Z_OK, this function must be
-  called again with Z_FINISH and more output space (updated avail_out) but no
-  more input data, until it returns with Z_STREAM_END or an error.  After
-  deflate has returned Z_STREAM_END, the only possible operations on the stream
-  are deflateReset or deflateEnd.
-
-    Z_FINISH can be used immediately after deflateInit if all the compression
-  is to be done in a single step.  In this case, avail_out must be at least the
-  value returned by deflateBound (see below).  If deflate does not return
-  Z_STREAM_END, then it must be called again as described above.
-
-    deflate() sets strm->adler to the adler32 checksum of all input read
-  so far (that is, total_in bytes).
-
-    deflate() may update strm->data_type if it can make a good guess about
-  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
-  binary.  This field is only for information purposes and does not affect the
-  compression algorithm in any manner.
-
-    deflate() returns Z_OK if some progress has been made (more input
-  processed or more output produced), Z_STREAM_END if all input has been
-  consumed and all output has been produced (only when flush is set to
-  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
-  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
-  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
-  fatal, and deflate() can be called again with more input and more output
-  space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any pending
-   output.
-
-     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
-   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
-   prematurely (some input or output was discarded).  In the error case, msg
-   may be set but then points to a static string (which must not be
-   deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
-     Initializes the internal stream state for decompression.  The fields
-   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
-   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
-   exact value depends on the compression method), inflateInit determines the
-   compression method from the zlib header and allocates all data structures
-   accordingly; otherwise the allocation will be deferred to the first call of
-   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
-   use default allocation functions.
-
-     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
-   invalid, such as a null pointer to the structure.  msg is set to null if
-   there is no error message.  inflateInit does not perform any decompression
-   apart from possibly reading the zlib header if present: actual decompression
-   will be done by inflate().  (So next_in and avail_in may be modified, but
-   next_out and avail_out are unused and unchanged.) The current implementation
-   of inflateInit() does not process any header information -- that is deferred
-   until inflate() is called.
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
-    inflate decompresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full.  It may introduce
-  some output latency (reading input without producing any output) except when
-  forced to flush.
-
-  The detailed semantics are as follows.  inflate performs one or both of the
-  following actions:
-
-  - Decompress more input starting at next_in and update next_in and avail_in
-    accordingly.  If not all input can be processed (because there is not
-    enough room in the output buffer), next_in is updated and processing will
-    resume at this point for the next call of inflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  inflate() provides as much output as possible, until there is
-    no more input data or no more space in the output buffer (see below about
-    the flush parameter).
-
-    Before the call of inflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming more
-  output, and updating the next_* and avail_* values accordingly.  The
-  application can consume the uncompressed output when it wants, for example
-  when the output buffer is full (avail_out == 0), or after each call of
-  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
-  called again after making room in the output buffer because there might be
-  more output pending.
-
-    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
-  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
-  output as possible to the output buffer.  Z_BLOCK requests that inflate()
-  stop if and when it gets to the next deflate block boundary.  When decoding
-  the zlib or gzip format, this will cause inflate() to return immediately
-  after the header and before the first block.  When doing a raw inflate,
-  inflate() will go ahead and process the first block, and will return when it
-  gets to the end of that block, or when it runs out of data.
-
-    The Z_BLOCK option assists in appending to or combining deflate streams.
-  Also to assist in this, on return inflate() will set strm->data_type to the
-  number of unused bits in the last byte taken from strm->next_in, plus 64 if
-  inflate() is currently decoding the last block in the deflate stream, plus
-  128 if inflate() returned immediately after decoding an end-of-block code or
-  decoding the complete header up to just before the first byte of the deflate
-  stream.  The end-of-block will not be indicated until all of the uncompressed
-  data from that block has been written to strm->next_out.  The number of
-  unused bits may in general be greater than seven, except when bit 7 of
-  data_type is set, in which case the number of unused bits will be less than
-  eight.  data_type is set as noted here every time inflate() returns for all
-  flush options, and so can be used to determine the amount of currently
-  consumed input in bits.
-
-    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
-  end of each deflate block header is reached, before any actual data in that
-  block is decoded.  This allows the caller to determine the length of the
-  deflate block header for later use in random access within a deflate block.
-  256 is added to the value of strm->data_type when inflate() returns
-  immediately after reaching the end of the deflate block header.
-
-    inflate() should normally be called until it returns Z_STREAM_END or an
-  error.  However if all decompression is to be performed in a single step (a
-  single call of inflate), the parameter flush should be set to Z_FINISH.  In
-  this case all pending input is processed and all pending output is flushed;
-  avail_out must be large enough to hold all the uncompressed data.  (The size
-  of the uncompressed data may have been saved by the compressor for this
-  purpose.) The next operation on this stream must be inflateEnd to deallocate
-  the decompression state.  The use of Z_FINISH is never required, but can be
-  used to inform inflate that a faster approach may be used for the single
-  inflate() call.
-
-     In this implementation, inflate() always flushes as much output as
-  possible to the output buffer, and always uses the faster approach on the
-  first call.  So the only effect of the flush parameter in this implementation
-  is on the return value of inflate(), as noted below, or when it returns early
-  because Z_BLOCK or Z_TREES is used.
-
-     If a preset dictionary is needed after this call (see inflateSetDictionary
-  below), inflate sets strm->adler to the adler32 checksum of the dictionary
-  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
-  strm->adler to the adler32 checksum of all output produced so far (that is,
-  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
-  below.  At the end of the stream, inflate() checks that its computed adler32
-  checksum is equal to that saved by the compressor and returns Z_STREAM_END
-  only if the checksum is correct.
-
-    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
-  deflate data.  The header type is detected automatically, if requested when
-  initializing with inflateInit2().  Any information contained in the gzip
-  header is not retained, so applications that need that information should
-  instead use raw inflate, see inflateInit2() below, or inflateBack() and
-  perform their own processing of the gzip header and trailer.
-
-    inflate() returns Z_OK if some progress has been made (more input processed
-  or more output produced), Z_STREAM_END if the end of the compressed data has
-  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
-  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
-  corrupted (input stream not conforming to the zlib format or incorrect check
-  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
-  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
-  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
-  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
-  inflate() can be called again with more input and more output space to
-  continue decompressing.  If Z_DATA_ERROR is returned, the application may
-  then call inflateSync() to look for a good compression block if a partial
-  recovery of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any pending
-   output.
-
-     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
-   was inconsistent.  In the error case, msg may be set but then points to a
-   static string (which must not be deallocated).
-*/
-
-
-                        /* Advanced functions */
-
-/*
-    The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
-                                     int  level,
-                                     int  method,
-                                     int  windowBits,
-                                     int  memLevel,
-                                     int  strategy));
-
-     This is another version of deflateInit with more compression options.  The
-   fields next_in, zalloc, zfree and opaque must be initialized before by the
-   caller.
-
-     The method parameter is the compression method.  It must be Z_DEFLATED in
-   this version of the library.
-
-     The windowBits parameter is the base two logarithm of the window size
-   (the size of the history buffer).  It should be in the range 8..15 for this
-   version of the library.  Larger values of this parameter result in better
-   compression at the expense of memory usage.  The default value is 15 if
-   deflateInit is used instead.
-
-     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
-   determines the window size.  deflate() will then generate raw deflate data
-   with no zlib header or trailer, and will not compute an adler32 check value.
-
-     windowBits can also be greater than 15 for optional gzip encoding.  Add
-   16 to windowBits to write a simple gzip header and trailer around the
-   compressed data instead of a zlib wrapper.  The gzip header will have no
-   file name, no extra data, no comment, no modification time (set to zero), no
-   header crc, and the operating system will be set to 255 (unknown).  If a
-   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
-     The memLevel parameter specifies how much memory should be allocated
-   for the internal compression state.  memLevel=1 uses minimum memory but is
-   slow and reduces compression ratio; memLevel=9 uses maximum memory for
-   optimal speed.  The default value is 8.  See zconf.h for total memory usage
-   as a function of windowBits and memLevel.
-
-     The strategy parameter is used to tune the compression algorithm.  Use the
-   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
-   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
-   string match), or Z_RLE to limit match distances to one (run-length
-   encoding).  Filtered data consists mostly of small values with a somewhat
-   random distribution.  In this case, the compression algorithm is tuned to
-   compress them better.  The effect of Z_FILTERED is to force more Huffman
-   coding and less string matching; it is somewhat intermediate between
-   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
-   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
-   strategy parameter only affects the compression ratio but not the
-   correctness of the compressed output even if it is not set appropriately.
-   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
-   decoder for special applications.
-
-     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
-   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
-   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
-   set to null if there is no error message.  deflateInit2 does not perform any
-   compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output.  This function must be called
-   immediately after deflateInit, deflateInit2 or deflateReset, before any call
-   of deflate.  The compressor and decompressor must use exactly the same
-   dictionary (see inflateSetDictionary).
-
-     The dictionary should consist of strings (byte sequences) that are likely
-   to be encountered later in the data to be compressed, with the most commonly
-   used strings preferably put towards the end of the dictionary.  Using a
-   dictionary is most useful when the data to be compressed is short and can be
-   predicted with good accuracy; the data can then be compressed better than
-   with the default empty dictionary.
-
-     Depending on the size of the compression data structures selected by
-   deflateInit or deflateInit2, a part of the dictionary may in effect be
-   discarded, for example if the dictionary is larger than the window size
-   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
-   useful should be put at the end of the dictionary, not at the front.  In
-   addition, the current implementation of deflate will use at most the window
-   size minus 262 bytes of the provided dictionary.
-
-     Upon return of this function, strm->adler is set to the adler32 value
-   of the dictionary; the decompressor may later use this value to determine
-   which dictionary has been used by the compressor.  (The adler32 value
-   applies to the whole dictionary even if only a subset of the dictionary is
-   actually used by the compressor.) If a raw deflate was requested, then the
-   adler32 value is not computed and strm->adler is not set.
-
-     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
-   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
-   inconsistent (for example if deflate has already been called for this stream
-   or if the compression method is bsort).  deflateSetDictionary does not
-   perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when several compression strategies will be
-   tried, for example when there are several ways of pre-processing the input
-   data with a filter.  The streams that will be discarded should then be freed
-   by calling deflateEnd.  Note that deflateCopy duplicates the internal
-   compression state which can be quite large, so this strategy is slow and can
-   consume lots of memory.
-
-     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to deflateEnd followed by deflateInit,
-   but does not free and reallocate all the internal compression state.  The
-   stream will keep the same compression level and any other attributes that
-   may have been set by deflateInit2.
-
-     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
-                                      int level,
-                                      int strategy));
-/*
-     Dynamically update the compression level and compression strategy.  The
-   interpretation of level and strategy is as in deflateInit2.  This can be
-   used to switch between compression and straight copy of the input data, or
-   to switch to a different kind of input data requiring a different strategy.
-   If the compression level is changed, the input available so far is
-   compressed with the old level (and may be flushed); the new level will take
-   effect only at the next call of deflate().
-
-     Before the call of deflateParams, the stream state must be set as for
-   a call of deflate(), since the currently available input may have to be
-   compressed and flushed.  In particular, strm->avail_out must be non-zero.
-
-     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
-   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
-   strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
-                                    int good_length,
-                                    int max_lazy,
-                                    int nice_length,
-                                    int max_chain));
-/*
-     Fine tune deflate's internal compression parameters.  This should only be
-   used by someone who understands the algorithm used by zlib's deflate for
-   searching for the best matching string, and even then only by the most
-   fanatic optimizer trying to squeeze out the last compressed bit for their
-   specific input data.  Read the deflate.c source code for the meaning of the
-   max_lazy, good_length, nice_length, and max_chain parameters.
-
-     deflateTune() can be called after deflateInit() or deflateInit2(), and
-   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
-                                       uLong sourceLen));
-/*
-     deflateBound() returns an upper bound on the compressed size after
-   deflation of sourceLen bytes.  It must be called after deflateInit() or
-   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
-   to allocate an output buffer for deflation in a single pass, and so would be
-   called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     deflatePrime() inserts bits in the deflate output stream.  The intent
-   is that this function is used to start off the deflate output with the bits
-   leftover from a previous deflate stream when appending to it.  As such, this
-   function can only be used for raw deflate, and must be used before the first
-   deflate() call after a deflateInit2() or deflateReset().  bits must be less
-   than or equal to 16, and that many of the least significant bits of value
-   will be inserted in the output.
-
-     deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-     deflateSetHeader() provides gzip header information for when a gzip
-   stream is requested by deflateInit2().  deflateSetHeader() may be called
-   after deflateInit2() or deflateReset() and before the first call of
-   deflate().  The text, time, os, extra field, name, and comment information
-   in the provided gz_header structure are written to the gzip header (xflag is
-   ignored -- the extra flags are set according to the compression level).  The
-   caller must assure that, if not Z_NULL, name and comment are terminated with
-   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
-   available there.  If hcrc is true, a gzip header crc is included.  Note that
-   the current versions of the command-line version of gzip (up through version
-   1.3.x) do not support header crc's, and will report that it is a "multi-part
-   gzip file" and give up.
-
-     If deflateSetHeader is not used, the default gzip header has text false,
-   the time set to zero, and os set to 255, with no extra, name, or comment
-   fields.  The gzip header is returned to the default state by deflateReset().
-
-     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
-                                     int  windowBits));
-
-     This is another version of inflateInit with an extra parameter.  The
-   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
-   before by the caller.
-
-     The windowBits parameter is the base two logarithm of the maximum window
-   size (the size of the history buffer).  It should be in the range 8..15 for
-   this version of the library.  The default value is 15 if inflateInit is used
-   instead.  windowBits must be greater than or equal to the windowBits value
-   provided to deflateInit2() while compressing, or it must be equal to 15 if
-   deflateInit2() was not used.  If a compressed stream with a larger window
-   size is given as input, inflate() will return with the error code
-   Z_DATA_ERROR instead of trying to allocate a larger window.
-
-     windowBits can also be zero to request that inflate use the window size in
-   the zlib header of the compressed stream.
-
-     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
-   determines the window size.  inflate() will then process raw deflate data,
-   not looking for a zlib or gzip header, not generating a check value, and not
-   looking for any check values for comparison at the end of the stream.  This
-   is for use with other formats that use the deflate compressed data format
-   such as zip.  Those formats provide their own check values.  If a custom
-   format is developed using the raw deflate format for compressed data, it is
-   recommended that a check value such as an adler32 or a crc32 be applied to
-   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
-   most applications, the zlib format should be used as is.  Note that comments
-   above on the use in deflateInit2() applies to the magnitude of windowBits.
-
-     windowBits can also be greater than 15 for optional gzip decoding.  Add
-   32 to windowBits to enable zlib and gzip decoding with automatic header
-   detection, or add 16 to decode only the gzip format (the zlib format will
-   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
-   crc32 instead of an adler32.
-
-     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
-   invalid, such as a null pointer to the structure.  msg is set to null if
-   there is no error message.  inflateInit2 does not perform any decompression
-   apart from possibly reading the zlib header if present: actual decompression
-   will be done by inflate().  (So next_in and avail_in may be modified, but
-   next_out and avail_out are unused and unchanged.) The current implementation
-   of inflateInit2() does not process any header information -- that is
-   deferred until inflate() is called.
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the decompression dictionary from the given uncompressed byte
-   sequence.  This function must be called immediately after a call of inflate,
-   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
-   can be determined from the adler32 value returned by that call of inflate.
-   The compressor and decompressor must use exactly the same dictionary (see
-   deflateSetDictionary).  For raw inflate, this function can be called
-   immediately after inflateInit2() or inflateReset() and before any call of
-   inflate() to set the dictionary.  The application must insure that the
-   dictionary that was used for compression is provided.
-
-     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
-   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
-   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
-   expected one (incorrect adler32 value).  inflateSetDictionary does not
-   perform any decompression: this will be done by subsequent calls of
-   inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
-     Skips invalid compressed data until a full flush point (see above the
-   description of deflate with Z_FULL_FLUSH) can be found, or until all
-   available input is skipped.  No output is provided.
-
-     inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
-   if no more input was provided, Z_DATA_ERROR if no flush point has been
-   found, or Z_STREAM_ERROR if the stream structure was inconsistent.  In the
-   success case, the application may save the current current value of total_in
-   which indicates where valid compressed data was found.  In the error case,
-   the application may repeatedly call inflateSync, providing more input each
-   time, until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when randomly accessing a large stream.  The
-   first pass through the stream can periodically record the inflate state,
-   allowing restarting inflate at those points when randomly accessing the
-   stream.
-
-     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to inflateEnd followed by inflateInit,
-   but does not free and reallocate all the internal decompression state.  The
-   stream will keep attributes that may have been set by inflateInit2.
-
-     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
-                                      int windowBits));
-/*
-     This function is the same as inflateReset, but it also permits changing
-   the wrap and window size requests.  The windowBits parameter is interpreted
-   the same as it is for inflateInit2.
-
-     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
-   the windowBits parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     This function inserts bits in the inflate input stream.  The intent is
-   that this function is used to start inflating at a bit position in the
-   middle of a byte.  The provided bits will be used before any bytes are used
-   from next_in.  This function should only be used with raw inflate, and
-   should be used before the first inflate() call after inflateInit2() or
-   inflateReset().  bits must be less than or equal to 16, and that many of the
-   least significant bits of value will be inserted in the input.
-
-     If bits is negative, then the input stream bit buffer is emptied.  Then
-   inflatePrime() can be called again to put bits in the buffer.  This is used
-   to clear out bits leftover after feeding inflate a block description prior
-   to feeding inflate codes.
-
-     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
-/*
-     This function returns two values, one in the lower 16 bits of the return
-   value, and the other in the remaining upper bits, obtained by shifting the
-   return value down 16 bits.  If the upper value is -1 and the lower value is
-   zero, then inflate() is currently decoding information outside of a block.
-   If the upper value is -1 and the lower value is non-zero, then inflate is in
-   the middle of a stored block, with the lower value equaling the number of
-   bytes from the input remaining to copy.  If the upper value is not -1, then
-   it is the number of bits back from the current bit position in the input of
-   the code (literal or length/distance pair) currently being processed.  In
-   that case the lower value is the number of bytes already emitted for that
-   code.
-
-     A code is being processed if inflate is waiting for more input to complete
-   decoding of the code, or if it has completed decoding but is waiting for
-   more output space to write the literal or match data.
-
-     inflateMark() is used to mark locations in the input data for random
-   access, which may be at bit positions, and to note those cases where the
-   output of a code may span boundaries of random access blocks.  The current
-   location in the input stream can be determined from avail_in and data_type
-   as noted in the description for the Z_BLOCK flush parameter for inflate.
-
-     inflateMark returns the value noted above or -1 << 16 if the provided
-   source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-     inflateGetHeader() requests that gzip header information be stored in the
-   provided gz_header structure.  inflateGetHeader() may be called after
-   inflateInit2() or inflateReset(), and before the first call of inflate().
-   As inflate() processes the gzip stream, head->done is zero until the header
-   is completed, at which time head->done is set to one.  If a zlib stream is
-   being decoded, then head->done is set to -1 to indicate that there will be
-   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
-   used to force inflate() to return immediately after header processing is
-   complete and before any actual data is decompressed.
-
-     The text, time, xflags, and os fields are filled in with the gzip header
-   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
-   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
-   contains the maximum number of bytes to write to extra.  Once done is true,
-   extra_len contains the actual extra field length, and extra contains the
-   extra field, or that field truncated if extra_max is less than extra_len.
-   If name is not Z_NULL, then up to name_max characters are written there,
-   terminated with a zero unless the length is greater than name_max.  If
-   comment is not Z_NULL, then up to comm_max characters are written there,
-   terminated with a zero unless the length is greater than comm_max.  When any
-   of extra, name, or comment are not Z_NULL and the respective field is not
-   present in the header, then that field is set to Z_NULL to signal its
-   absence.  This allows the use of deflateSetHeader() with the returned
-   structure to duplicate the header.  However if those fields are set to
-   allocated memory, then the application will need to save those pointers
-   elsewhere so that they can be eventually freed.
-
-     If inflateGetHeader is not used, then the header information is simply
-   discarded.  The header is always checked for validity, including the header
-   CRC if present.  inflateReset() will reset the process to discard the header
-   information.  The application would need to call inflateGetHeader() again to
-   retrieve the header from the next gzip stream.
-
-     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
-                                        unsigned char FAR *window));
-
-     Initialize the internal stream state for decompression using inflateBack()
-   calls.  The fields zalloc, zfree and opaque in strm must be initialized
-   before the call.  If zalloc and zfree are Z_NULL, then the default library-
-   derived memory allocation routines are used.  windowBits is the base two
-   logarithm of the window size, in the range 8..15.  window is a caller
-   supplied buffer of that size.  Except for special applications where it is
-   assured that deflate was used with small window sizes, windowBits must be 15
-   and a 32K byte window must be supplied to be able to decompress general
-   deflate streams.
-
-     See inflateBack() for the usage of these routines.
-
-     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
-   the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
-   allocated, or Z_VERSION_ERROR if the version of the library does not match
-   the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
-                                    in_func in, void FAR *in_desc,
-                                    out_func out, void FAR *out_desc));
-/*
-     inflateBack() does a raw inflate with a single call using a call-back
-   interface for input and output.  This is more efficient than inflate() for
-   file i/o applications in that it avoids copying between the output and the
-   sliding window by simply making the window itself the output buffer.  This
-   function trusts the application to not change the output buffer passed by
-   the output function, at least until inflateBack() returns.
-
-     inflateBackInit() must be called first to allocate the internal state
-   and to initialize the state with the user-provided window buffer.
-   inflateBack() may then be used multiple times to inflate a complete, raw
-   deflate stream with each call.  inflateBackEnd() is then called to free the
-   allocated state.
-
-     A raw deflate stream is one with no zlib or gzip header or trailer.
-   This routine would normally be used in a utility that reads zip or gzip
-   files and writes out uncompressed files.  The utility would decode the
-   header and process the trailer on its own, hence this routine expects only
-   the raw deflate stream to decompress.  This is different from the normal
-   behavior of inflate(), which expects either a zlib or gzip header and
-   trailer around the deflate stream.
-
-     inflateBack() uses two subroutines supplied by the caller that are then
-   called by inflateBack() for input and output.  inflateBack() calls those
-   routines until it reads a complete deflate stream and writes out all of the
-   uncompressed data, or until it encounters an error.  The function's
-   parameters and return types are defined above in the in_func and out_func
-   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
-   number of bytes of provided input, and a pointer to that input in buf.  If
-   there is no input available, in() must return zero--buf is ignored in that
-   case--and inflateBack() will return a buffer error.  inflateBack() will call
-   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
-   should return zero on success, or non-zero on failure.  If out() returns
-   non-zero, inflateBack() will return with an error.  Neither in() nor out()
-   are permitted to change the contents of the window provided to
-   inflateBackInit(), which is also the buffer that out() uses to write from.
-   The length written by out() will be at most the window size.  Any non-zero
-   amount of input may be provided by in().
-
-     For convenience, inflateBack() can be provided input on the first call by
-   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
-   in() will be called.  Therefore strm->next_in must be initialized before
-   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
-   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
-   must also be initialized, and then if strm->avail_in is not zero, input will
-   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
-
-     The in_desc and out_desc parameters of inflateBack() is passed as the
-   first parameter of in() and out() respectively when they are called.  These
-   descriptors can be optionally used to pass any information that the caller-
-   supplied in() and out() functions need to do their job.
-
-     On return, inflateBack() will set strm->next_in and strm->avail_in to
-   pass back any unused input that was provided by the last in() call.  The
-   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
-   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
-   in the deflate stream (in which case strm->msg is set to indicate the nature
-   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
-   In the case of Z_BUF_ERROR, an input or output error can be distinguished
-   using strm->next_in which will be Z_NULL only if in() returned an error.  If
-   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
-   non-zero.  (in() will always be called before out(), so strm->next_in is
-   assured to be defined if out() returns non-zero.) Note that inflateBack()
-   cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
-     All memory allocated by inflateBackInit() is freed.
-
-     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
-   state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
-    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
-     1.0: size of uInt
-     3.2: size of uLong
-     5.4: size of voidpf (pointer)
-     7.6: size of z_off_t
-
-    Compiler, assembler, and debug options:
-     8: DEBUG
-     9: ASMV or ASMINF -- use ASM code
-     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
-     11: 0 (reserved)
-
-    One-time table building (smaller code, but not thread-safe if true):
-     12: BUILDFIXED -- build static block decoding tables when needed
-     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
-     14,15: 0 (reserved)
-
-    Library content (indicates missing functionality):
-     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
-                          deflate code when not needed)
-     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
-                    and decode gzip streams (to avoid linking crc code)
-     18-19: 0 (reserved)
-
-    Operation variations (changes in library functionality):
-     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
-     21: FASTEST -- deflate algorithm with only one, lowest compression level
-     22,23: 0 (reserved)
-
-    The sprintf variant used by gzprintf (zero is best):
-     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
-     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
-     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
-    Remainder:
-     27-31: 0 (reserved)
- */
-
-
-                        /* utility functions */
-
-/*
-     The following utility functions are implemented on top of the basic
-   stream-oriented functions.  To simplify the interface, some default options
-   are assumed (compression level and memory usage, standard memory allocation
-   functions).  The source code of these utility functions can be modified if
-   you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
-                                 const Bytef *source, uLong sourceLen));
-/*
-     Compresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer.  Upon entry, destLen is the total size
-   of the destination buffer, which must be at least the value returned by
-   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
-   compressed buffer.
-
-     compress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
-                                  const Bytef *source, uLong sourceLen,
-                                  int level));
-/*
-     Compresses the source buffer into the destination buffer.  The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer.  Upon entry, destLen is the total size of the
-   destination buffer, which must be at least the value returned by
-   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
-   compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
-     compressBound() returns an upper bound on the compressed size after
-   compress() or compress2() on sourceLen bytes.  It would be used before a
-   compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
-                                   const Bytef *source, uLong sourceLen));
-/*
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer.  Upon entry, destLen is the total size
-   of the destination buffer, which must be large enough to hold the entire
-   uncompressed data.  (The size of the uncompressed data must have been saved
-   previously by the compressor and transmitted to the decompressor by some
-   mechanism outside the scope of this compression library.) Upon exit, destLen
-   is the actual size of the uncompressed buffer.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
-                        /* gzip file access functions */
-
-/*
-     This library supports reading and writing files in gzip (.gz) format with
-   an interface similar to that of stdio, using the functions that start with
-   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
-   wrapper, documented in RFC 1952, wrapped around a deflate stream.
-*/
-
-typedef voidp gzFile;       /* opaque gzip file descriptor */
-
-/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-
-     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
-   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
-   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
-   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
-   for fixed code compression as in "wb9F".  (See the description of
-   deflateInit2 for more information about the strategy parameter.) Also "a"
-   can be used instead of "w" to request that the gzip stream that will be
-   written be appended to the file.  "+" will result in an error, since reading
-   and writing to the same gzip file is not supported.
-
-     gzopen can be used to read a file which is not in gzip format; in this
-   case gzread will directly read from the file without decompression.
-
-     gzopen returns NULL if the file could not be opened, if there was
-   insufficient memory to allocate the gzFile state, or if an invalid mode was
-   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
-   errno can be checked to determine if the reason gzopen failed was that the
-   file could not be opened.
-*/
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
-     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
-   are obtained from calls like open, dup, creat, pipe or fileno (if the file
-   has been previously opened with fopen).  The mode parameter is as in gzopen.
-
-     The next call of gzclose on the returned gzFile will also close the file
-   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
-   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
-   mode);.  The duplicated descriptor should be saved to avoid a leak, since
-   gzdopen does not close fd if it fails.
-
-     gzdopen returns NULL if there was insufficient memory to allocate the
-   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
-   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
-   used until the next gz* read, write, seek, or close operation, so gzdopen
-   will not detect if fd is invalid (unless fd is -1).
-*/
-
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
-/*
-     Set the internal buffer size used by this library's functions.  The
-   default buffer size is 8192 bytes.  This function must be called after
-   gzopen() or gzdopen(), and before any other calls that read or write the
-   file.  The buffer memory allocation is always deferred to the first read or
-   write.  Two buffers are allocated, either both of the specified size when
-   writing, or one of the specified size and the other twice that size when
-   reading.  A larger buffer size of, for example, 64K or 128K bytes will
-   noticeably increase the speed of decompression (reading).
-
-     The new buffer size also affects the maximum length for gzprintf().
-
-     gzbuffer() returns 0 on success, or -1 on failure, such as being called
-   too late.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
-     Dynamically update the compression level or strategy.  See the description
-   of deflateInit2 for the meaning of these parameters.
-
-     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
-   opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
-     Reads the given number of uncompressed bytes from the compressed file.  If
-   the input file was not in gzip format, gzread copies the given number of
-   bytes into the buffer.
-
-     After reaching the end of a gzip stream in the input, gzread will continue
-   to read, looking for another gzip stream, or failing that, reading the rest
-   of the input file directly without decompression.  The entire input file
-   will be read if gzread is called until it returns less than the requested
-   len.
-
-     gzread returns the number of uncompressed bytes actually read, less than
-   len for end of file, or -1 for error.
-*/
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
-                                voidpc buf, unsigned len));
-/*
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of uncompressed bytes written or 0 in case of
-   error.
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
-     Converts, formats, and writes the arguments to the compressed file under
-   control of the format string, as in fprintf.  gzprintf returns the number of
-   uncompressed bytes actually written, or 0 in case of error.  The number of
-   uncompressed bytes written is limited to 8191, or one less than the buffer
-   size given to gzbuffer().  The caller should assure that this limit is not
-   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
-   nothing written.  In this case, there may also be a buffer overflow with
-   unpredictable consequences, which is possible only if zlib was compiled with
-   the insecure functions sprintf() or vsprintf() because the secure snprintf()
-   or vsnprintf() functions were not available.  This can be determined using
-   zlibCompileFlags().
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
-     Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-
-     gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
-     Reads bytes from the compressed file until len-1 characters are read, or a
-   newline character is read and transferred to buf, or an end-of-file
-   condition is encountered.  If any characters are read or if len == 1, the
-   string is terminated with a null character.  If no characters are read due
-   to an end-of-file or len < 1, then the buffer is left untouched.
-
-     gzgets returns buf which is a null-terminated string, or it returns NULL
-   for end-of-file or in case of error.  If there was an error, the contents at
-   buf are indeterminate.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
-     Writes c, converted to an unsigned char, into the compressed file.  gzputc
-   returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
-     Reads one byte from the compressed file.  gzgetc returns this byte or -1
-   in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
-     Push one character back onto the stream to be read as the first character
-   on the next read.  At least one character of push-back is allowed.
-   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
-   fail if c is -1, and may fail if a character has been pushed but not read
-   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
-   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
-   The pushed character will be discarded if the stream is repositioned with
-   gzseek() or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
-     Flushes all pending output into the compressed file.  The parameter flush
-   is as in the deflate() function.  The return value is the zlib error number
-   (see function gzerror below).  gzflush is only permitted when writing.
-
-     If the flush parameter is Z_FINISH, the remaining data is written and the
-   gzip stream is completed in the output.  If gzwrite() is called again, a new
-   gzip stream will be started in the output.  gzread() is able to read such
-   concatented gzip streams.
-
-     gzflush should be called only when strictly necessary because it will
-   degrade compression if called too often.
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
-                                   z_off_t offset, int whence));
-
-     Sets the starting position for the next gzread or gzwrite on the given
-   compressed file.  The offset represents a number of bytes in the
-   uncompressed data stream.  The whence parameter is defined as in lseek(2);
-   the value SEEK_END is not supported.
-
-     If the file is opened for reading, this function is emulated but can be
-   extremely slow.  If the file is opened for writing, only forward seeks are
-   supported; gzseek then compresses a sequence of zeroes up to the new
-   starting position.
-
-     gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error, in
-   particular if the file is opened for writing and the new starting position
-   would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
-/*
-     Rewinds the given file. This function is supported only for reading.
-
-     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
-
-     Returns the starting position for the next gzread or gzwrite on the given
-   compressed file.  This position represents a number of bytes in the
-   uncompressed data stream, and is zero when starting, even if appending or
-   reading a gzip stream from the middle of a file using gzdopen().
-
-     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
-
-     Returns the current offset in the file being read or written.  This offset
-   includes the count of bytes that precede the gzip stream, for example when
-   appending or when using gzdopen() for reading.  When reading, the offset
-   does not include as yet unused buffered input.  This information can be used
-   for a progress indicator.  On error, gzoffset() returns -1.
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
-     Returns true (1) if the end-of-file indicator has been set while reading,
-   false (0) otherwise.  Note that the end-of-file indicator is set only if the
-   read tried to go past the end of the input, but came up short.  Therefore,
-   just like feof(), gzeof() may return false even if there is no more data to
-   read, in the event that the last read request was for the exact number of
-   bytes remaining in the input file.  This will happen if the input file size
-   is an exact multiple of the buffer size.
-
-     If gzeof() returns true, then the read functions will return no more data,
-   unless the end-of-file indicator is reset by gzclearerr() and the input file
-   has grown since the previous end of file was detected.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
-     Returns true (1) if file is being copied directly while reading, or false
-   (0) if file is a gzip stream being decompressed.  This state can change from
-   false to true while reading the input file if the end of a gzip stream is
-   reached, but is followed by data that is not another gzip stream.
-
-     If the input file is empty, gzdirect() will return true, since the input
-   does not contain a gzip stream.
-
-     If gzdirect() is used immediately after gzopen() or gzdopen() it will
-   cause buffers to be allocated to allow reading the file to determine if it
-   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
-   gzdirect().
-*/
-
-ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
-/*
-     Flushes all pending output if necessary, closes the compressed file and
-   deallocates the (de)compression state.  Note that once file is closed, you
-   cannot call gzerror with file, since its structures have been deallocated.
-   gzclose must not be called more than once on the same file, just as free
-   must not be called more than once on the same allocation.
-
-     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
-   file operation error, or Z_OK on success.
-*/
-
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
-/*
-     Same as gzclose(), but gzclose_r() is only for use when reading, and
-   gzclose_w() is only for use when writing or appending.  The advantage to
-   using these instead of gzclose() is that they avoid linking in zlib
-   compression or decompression code that is not used when only reading or only
-   writing respectively.  If gzclose() is used, then both compression and
-   decompression code will be included the application when linking to a static
-   zlib library.
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
-     Returns the error message for the last error which occurred on the given
-   compressed file.  errnum is set to zlib error number.  If an error occurred
-   in the file system and not in the compression library, errnum is set to
-   Z_ERRNO and the application may consult errno to get the exact error code.
-
-     The application must not modify the returned string.  Future calls to
-   this function may invalidate the previously returned string.  If file is
-   closed, then the string previously returned by gzerror will no longer be
-   available.
-
-     gzerror() should be used to distinguish errors from end-of-file for those
-   functions above that do not distinguish those cases in their return values.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
-     Clears the error and end-of-file flags for file.  This is analogous to the
-   clearerr() function in stdio.  This is useful for continuing to read a gzip
-   file that is being written concurrently.
-*/
-
-
-                        /* checksum functions */
-
-/*
-     These functions are not related to compression but are exported
-   anyway because they might be useful in applications using the compression
-   library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
-   return the updated checksum.  If buf is Z_NULL, this function returns the
-   required initial value for the checksum.
-
-     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
-   much faster.
-
-   Usage example:
-
-     uLong adler = adler32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       adler = adler32(adler, buffer, length);
-     }
-     if (adler != original_adler) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
-                                          z_off_t len2));
-
-     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
-   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
-   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
-   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
-/*
-     Update a running CRC-32 with the bytes buf[0..len-1] and return the
-   updated CRC-32.  If buf is Z_NULL, this function returns the required
-   initial value for the for the crc.  Pre- and post-conditioning (one's
-   complement) is performed within this function so it shouldn't be done by the
-   application.
-
-   Usage example:
-
-     uLong crc = crc32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       crc = crc32(crc, buffer, length);
-     }
-     if (crc != original_crc) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
-     Combine two CRC-32 check values into one.  For two sequences of bytes,
-   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
-   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
-   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
-   len2.
-*/
-
-
-                        /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
-                                      int windowBits, int memLevel,
-                                      int strategy, const char *version,
-                                      int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
-                                      const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
-                                         unsigned char FAR *window,
-                                         const char *version,
-                                         int stream_size));
-#define deflateInit(strm, level) \
-        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
-        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
-        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
-                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
-        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
-        inflateBackInit_((strm), (windowBits), (window), \
-                                            ZLIB_VERSION, sizeof(z_stream))
-
-/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
- * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
- * both are true, the application gets the *64 functions, and the regular
- * functions are changed to 64 bits) -- in case these are set on systems
- * without large file support, _LFS64_LARGEFILE must also be true
- */
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
-   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
-   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
-   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
-   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
-   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
-   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
-#endif
-
-#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
-#  define gzopen gzopen64
-#  define gzseek gzseek64
-#  define gztell gztell64
-#  define gzoffset gzoffset64
-#  define adler32_combine adler32_combine64
-#  define crc32_combine crc32_combine64
-#  ifdef _LARGEFILE64_SOURCE
-     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
-     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
-     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
-     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
-     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
-     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-#  endif
-#else
-   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
-   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
-   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
-   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
-   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
-   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-#endif
-
-/* hack for buggy compilers */
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
-    struct internal_state {int dummy;};
-#endif
-
-/* undocumented functions */
-ZEXTERN const char   * ZEXPORT zError           OF((int));
-ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
-ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/interfaces/insdc/insdc.h b/interfaces/insdc/insdc.h
deleted file mode 100644
index 33e6e94..0000000
--- a/interfaces/insdc/insdc.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_insdc_insdc_
-#define _h_insdc_insdc_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*==========================================================================
- * INSDC types, constants
- */
-
-
-/*--------------------------------------------------------------------------
- * dna
- *  represented in IUPAC characters
- */
-typedef char INSDC_dna_text;
-
-
-/*--------------------------------------------------------------------------
- * 4na
- *  nucleotide data with all possible ambiguity
- *  does not represent all possible EVENTS
- *
- *  text encodings use the IUPAC character set
- *  legal values: [ACMGRSVTWYHKDBNacmgrsvtwyhkdbn.]
- *  canonical values: [ACMGRSVTWYHKDBN]
- *
- *  binary values are 0..15 = { NACMGRSVTWYHKDBN }
- *
- *  4na values use bits for each letter:
- *
- *       A | C | G | T
- *    =================
- *    N    |   |   |
- *    A  * |   |   |
- *    C    | * |   |
- *    M  * | * |   |
- *    G    |   | * |
- *    R  * |   | * |
- *    S    | * | * |
- *    V  * | * | * |
- *    T    |   |   | *
- *    W  * |   |   | *
- *    Y    | * |   | *
- *    H  * | * |   | *
- *    K    |   | * | *
- *    D  * |   | * | *
- *    B    | * | * | *
- *    N  * | * | * | *
- *
- *  packed bytes have first base in upper nibble,
- *  and the following base in lower nibble.
- *
- *    bit:  76543210 76543210 76543210
- *    ================================
- *    base: 00001111 22223333 44445555 etc.
- *
- *  element offsets follow this pattern
- */
-typedef uint8_t INSDC_4na_bin;
-typedef uint8_t INSDC_4na_packed;
-
-#define INSDC_4na_map_BINSET \
-    { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }
-#define INSDC_4na_map_CHARSET \
-    ".ACMGRSVTWYHKDBN"
-#define INSDC_4na_accept_CHARSET \
-    ".ACMGRSVTWYHKDBNacmgrsvtwyhkdbn"
-
-
-/*--------------------------------------------------------------------------
- * 2na
- *  nucleotide data { ATGC }
- * x2na
- *  nucleotide data with single ambiguity value
- *
- *  text encodings use the IUPAC character set
- *  legal values: [ACGTNacgtn.]
- *  canonical values: [ACGTN]
- *
- *  binary values are 0..4 = { ACGTN }
- *
- *  packed values exclude N:
- *    A = 0
- *    C = 1
- *    G = 2
- *    T = 3
- *
- *  packed bytes have first base in uppermost 2 bits,
- *  and the following bases in similar fashion:
- *
- *    bit:  76543210 76543210
- *    =======================
- *    base: 00112233 44556677 etc.
- *
- *  element offsets follow this pattern
- */
-typedef uint8_t INSDC_2na_bin;
-typedef uint8_t INSDC_x2na_bin;
-typedef uint8_t INSDC_2na_packed;
-
-#define INSDC_2na_map_BINSET \
-    { 0,1,2,3 }
-#define INSDC_2na_map_CHARSET \
-    "ACGT"
-#define INSDC_2na_accept_CHARSET \
-    "ACGTacgt"
-#define INSDC_x2na_map_BINSET \
-    { 0,1,2,3,4 }
-#define INSDC_x2na_map_CHARSET \
-    "ACGTN"
-#define INSDC_x2na_accept_CHARSET \
-    "ACGTNacgtn."
-
-
-/*--------------------------------------------------------------------------
- * color
- *  color-space data
- * 2cs
- *  color-space data 0,1,2,3
- * x2cs
- *  color-space data extended with single ambiguity value (.)
- *
- *  text encodings use the ASCII numeric character set
- *  values: [0123.]
- *
- *  x2cs values are 0..4 = { 0123. }
- *
- *  2cs values exclude '.':
- *    '0' = 0
- *    '1' = 1
- *    '2' = 2
- *    '3' = 3
- */
-typedef char INSDC_color_text;
-typedef uint8_t INSDC_2cs_bin;
-typedef uint8_t INSDC_x2cs_bin;
-typedef uint8_t INSDC_2cs_packed;
-
-#define INSDC_2cs_map_BINSET \
-    { 0,1,2,3 }
-#define INSDC_2cs_map_CHARSET \
-    "0123"
-#define INSDC_2cs_accept_CHARSET \
-    "0123"
-#define INSDC_x2cs_map_BINSET \
-    { 0,1,2,3,4 }
-#define INSDC_x2cs_map_CHARSET \
-    "0123."
-#define INSDC_x2cs_accept_CHARSET \
-    "0123."
-#define INSDC_color_default_matrix \
-{                                  \
-    0, 1, 2, 3, 4,                 \
-    1, 0, 3, 2, 4,                 \
-    2, 3, 0, 1, 4,                 \
-    3, 2, 1, 0, 4,                 \
-    4, 4, 4, 4, 4                  \
-}
-
-
-/*--------------------------------------------------------------------------
- * protein
- *  represented in IUPAC characters
- */
-typedef char INSDC_protein_text;
-
-
-/*--------------------------------------------------------------------------
- * aa
- *  protein data
- *  text encodings use the IUPAC character set
- */
-typedef	uint8_t INSDC_aa_bin;
-
-#define INSDC_aa_map_BINSET \
-    { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 }
-#define INSDC_aa_map_CHARSET \
-    "ABCDEFGHIKLMNPQRSTVWXYZU*"
-#define INSDC_aa_accept_CHARSET \
-    "ABCDEFGHIKLMNPQRSTVWXYZU*abcdefghiklmnpqrstvwxyzu"
-
-
-/*--------------------------------------------------------------------------
- * quality
- *  quality scoring values
- *
- *  phred legal values_ 0..63
- */
-typedef uint8_t INSDC_quality_phred;
-typedef int8_t INSDC_quality_log_odds;
-
-
-/*--------------------------------------------------------------------------
- * coordinate
- *  zero and one based coordinates
- *  lengths are expressed as unsigned quantities
- */
-typedef int32_t INSDC_coord_val;
-typedef uint32_t INSDC_coord_len;
-typedef INSDC_coord_val INSDC_coord_zero;
-typedef INSDC_coord_val INSDC_coord_one;
-typedef INSDC_coord_zero INSDC_position_zero;
-typedef INSDC_coord_one INSDC_position_one;
-
-
-/*--------------------------------------------------------------------------
- * read description
- *  type and filter constants
- */
-
-
-/* read type
- *  describes the type of read within a spot
- *  the extended version also describes its orientation
- */
-typedef uint8_t INSDC_read_type;
-enum
-{
-    /* read_type */
-    READ_TYPE_TECHNICAL  = 0,
-    READ_TYPE_BIOLOGICAL = 1,
-
-    /* orientation - applied as bits, e.g.:
-       type = READ_TYPE_BIOLOGICAL | READ_TYPE_REVERSE */
-    READ_TYPE_FORWARD = 2,
-    READ_TYPE_REVERSE = 4
-};
-
-/* read filter
- */
-typedef uint8_t INSDC_read_filter;
-enum
-{
-    READ_FILTER_PASS = 0,
-    READ_FILTER_REJECT = 1,
-    READ_FILTER_CRITERIA = 2,
-    READ_FILTER_REDACTED = 3
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_insdc_insdc_ */
diff --git a/interfaces/insdc/insdc.vschema b/interfaces/insdc/insdc.vschema
deleted file mode 100644
index e344869..0000000
--- a/interfaces/insdc/insdc.vschema
+++ /dev/null
@@ -1,202 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * INSDC types, constants
- */
-version 1;
-
-
-/*--------------------------------------------------------------------------
- * dna
- *  represented in IUPAC characters
- */
-typedef ascii INSDC:dna:text;
-
-
-/*--------------------------------------------------------------------------
- * 4na
- *  nucleotide data with all possible ambiguity
- *  does not represent all possible EVENTS
- *
- *  text encodings use the IUPAC character set
- *  legal values: [ACMGRSVTWYHKDBNacmgrsvtwyhkdbn.]
- *  canonical values: [ACMGRSVTWYHKDBN]
- *
- *  binary values are 0..15 = { NACMGRSVTWYHKDBN }
- *
- *  4na values use bits for each letter:
- *
- *       A | C | G | T
- *    =================
- *    N    |   |   |
- *    A  * |   |   |
- *    C    | * |   |
- *    M  * | * |   |
- *    G    |   | * |
- *    R  * |   | * |
- *    S    | * | * |
- *    V  * | * | * |
- *    T    |   |   | *
- *    W  * |   |   | *
- *    Y    | * |   | *
- *    H  * | * |   | *
- *    K    |   | * | *
- *    D  * |   | * | *
- *    B    | * | * | *
- *    N  * | * | * | *
- */
-typedef	U8 INSDC:4na:bin;
-typedef	B1 INSDC:4na:packed [ 4 ];
-
-const INSDC:4na:bin INSDC:4na:map:BINSET
-    = [ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ];
-const INSDC:dna:text INSDC:4na:map:CHARSET
-    = ".ACMGRSVTWYHKDBN";
-const INSDC:dna:text INSDC:4na:accept:CHARSET
-    = ".ACMGRSVTWYHKDBNacmgrsvtwyhkdbn";
-
-
-/*--------------------------------------------------------------------------
- * 2na  - nucleotide data A,T,G,C
- * x2na - nucleotide data extended with single ambiguity value (N)
- *
- *  text encodings use the IUPAC character set
- *  legal values: [ACGTNacgtn.]
- *  canonical values: [ACGTN]
- *
- *  x2na values are 0..4 = { ACGTN }
- *
- *  2na values exclude N:
- *    A = 0
- *    C = 1
- *    G = 2
- *    T = 3
- */
-typedef U8 INSDC:2na:bin;
-typedef U8 INSDC:x2na:bin;
-typedef B1 INSDC:2na:packed [ 2 ];
-
-const INSDC:2na:bin  INSDC:2na:map:BINSET      = [ 0,1,2,3 ];
-const INSDC:dna:text INSDC:2na:map:CHARSET     = "ACGT";
-const INSDC:dna:text INSDC:2na:accept:CHARSET  = "ACGTacgt";
-const INSDC:x2na:bin INSDC:x2na:map:BINSET     = [ 0,1,2,3,4 ];
-const INSDC:dna:text INSDC:x2na:map:CHARSET    = "ACGTN";
-const INSDC:dna:text INSDC:x2na:accept:CHARSET = "ACGTNacgtn.";
-
-
-/*--------------------------------------------------------------------------
- * color - color-space text
- * 2cs   - color-space data 0,1,2,3
- * x2cs  - color-space data extended with single ambiguity value (.)
- *
- *  text encodings use the ASCII numeric character set
- *  values: [0123.]
- *
- *  x2cs values are 0..4 = { 0123. }
- *
- *  2cs values exclude '.':
- *    '0' = 0
- *    '1' = 1
- *    '2' = 2
- *    '3' = 3
- */
-typedef ascii INSDC:color:text;
-typedef U8 INSDC:2cs:bin;
-typedef U8 INSDC:x2cs:bin;
-typedef B1 INSDC:2cs:packed [ 2 ];
-
-const INSDC:2cs:bin  INSDC:2cs:map:BINSET        = [ 0,1,2,3 ];
-const INSDC:color:text INSDC:2cs:map:CHARSET     = "0123";
-const INSDC:color:text INSDC:2cs:accept:CHARSET  = "0123";
-const INSDC:x2cs:bin INSDC:x2cs:map:BINSET       = [ 0,1,2,3,4 ];
-const INSDC:color:text INSDC:x2cs:map:CHARSET    = "0123.";
-const INSDC:color:text INSDC:x2cs:accept:CHARSET = "0123.";
-
-const U8 INSDC:color:default_matrix =
-[
-    0, 1, 2, 3, 4,
-    1, 0, 3, 2, 4,
-    2, 3, 0, 1, 4,
-    3, 2, 1, 0, 4,
-    4, 4, 4, 4, 4
-];
-
-
-/*--------------------------------------------------------------------------
- * protein
- *  represented in IUPAC characters
- */
-typedef ascii INSDC:protein:text;
-
-
-/*--------------------------------------------------------------------------
- * aa
- *  protein data
- *  text encodings use the IUPAC character set
- */
-typedef	U8 INSDC:aa:bin;
-
-const INSDC:aa:bin INSDC:aa:map:BINSET
-    = [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 ];
-const INSDC:protein:text INSDC:aa:map:CHARSET
-    = "ABCDEFGHIKLMNPQRSTVWXYZU*";
-const INSDC:protein:text INSDC:aa:accept:CHARSET
-    = "ABCDEFGHIKLMNPQRSTVWXYZU*abcdefghiklmnpqrstvwxyzu";
-
-
-/*--------------------------------------------------------------------------
- * quality
- *  quality scoring values
- *
- *  phred legal values: 0..63
- */
-typedef U8 INSDC:quality:phred;
-typedef I8 INSDC:quality:log_odds;
-
-// text-encoding of quality scores
-// offsets are 33 = '!' and 64 = '@'
-typedef ascii INSDC:quality:text:phred_33;
-typedef ascii INSDC:quality:text:phred_64;
-typedef ascii INSDC:quality:text:log_odds_64;
-
-
-/*--------------------------------------------------------------------------
- * coordinate
- *  zero and one based coordinates
- */
-
-// 32 bit coordinates
-typedef I32 INSDC:coord:val;
-typedef U32 INSDC:coord:len;
-
-// zero or one based coordinate system
-typedef INSDC:coord:val INSDC:coord:zero;
-typedef INSDC:coord:val INSDC:coord:one;
-
-// POSITION types for relating bases to their location in signal
-typedef INSDC:coord:zero INSDC:position:zero;
-typedef INSDC:coord:one INSDC:position:one;
diff --git a/interfaces/insdc/seq.vschema b/interfaces/insdc/seq.vschema
deleted file mode 100644
index 8fb1b32..0000000
--- a/interfaces/insdc/seq.vschema
+++ /dev/null
@@ -1,210 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * Sequence schema
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'insdc/insdc.vschema';
-
-
-/*--------------------------------------------------------------------------
- * rand_4na_2na
- *  converts 4na to 2na
- *
- *  substitutes a random base for ambiguities
- *  from the bases allowed in the 4na.
- *
- *       A | C | G | T
- *    =================
- *    N    |   |   |     # any base may be substituted
- *    A  * |   |   |     # always A
- *    C    | * |   |     # always C
- *    M  * | * |   |     # A or C
- *    G    |   | * |     # always G
- *    R  * |   | * |     # A or G
- *    S    | * | * |     # C or G
- *    V  * | * | * |     # A, C or G
- *    T    |   |   | *   # always T
- *    W  * |   |   | *   # A or T
- *    Y    | * |   | *   # C or T
- *    H  * | * |   | *   # A, C or T
- *    K    |   | * | *   # G or T
- *    D  * |   | * | *   # A, G or T
- *    B    | * | * | *   # C, G or T
- *    N  * | * | * | *   # any base may be substituted
- */
-extern function
-    INSDC:2na:bin INSDC:SEQ:rand_4na_2na #1 ( INSDC:4na:bin rd_bin );
-
-
-/*--------------------------------------------------------------------------
- * sequence
- *  basic sequence table
- *
- * history:
- *  1.0.1 - introduced text-mode QUALITY columns
- */
-table INSDC:tbl:sequence #1.0.1
-{
-    /* READ
-     *  native or converted DNA sequence
-     */
-
-    // default is IUPAC character representation
-    extern default column INSDC:dna:text READ
-    {
-        read = out_dna_text;
-        validate = < INSDC:dna:text > compare ( in_dna_text, out_dna_text );
-    }
-
-    // 4na representation - unpacked and packed
-    extern column INSDC:4na:bin READ = out_4na_bin;
-    extern column INSDC:4na:packed READ = out_4na_packed;
-
-    // x2na representation - 2na with ambiguity
-    extern column INSDC:x2na:bin READ = out_x2na_bin;
-
-    // 2na representation - 2na with no ambiguity - unpacked and packed
-    extern column INSDC:2na:bin READ = out_2na_bin;
-    extern column INSDC:2na:packed READ = out_2na_packed;
-
-
-
-    /* CSREAD
-     *  native or converted color-space sequence
-     */
-
-    // default is ASCII character representation
-    extern default column INSDC:color:text CSREAD
-    {
-        read = out_color_text;
-        validate = < INSDC:color:text > compare ( in_color_text, out_color_text );
-    }
-
-    // x2cs representation - 2cs with ambiguity
-    extern column INSDC:x2cs:bin CSREAD = out_x2cs_bin;
-
-    // 2cs representation - 2cs with no ambiguity - unpacked and packed
-    extern column INSDC:2cs:bin CSREAD = out_2cs_bin;
-    extern column INSDC:2cs:packed CSREAD = out_2cs_packed;
-
-    /* CS_NATIVE
-     *  is color-space the native sequence space
-     */
-    readonly column bool CS_NATIVE = cs_native;
-
-    /* CS_KEY
-     *  leading call given in base-space
-     */
-    extern column INSDC:dna:text CS_KEY
-    {
-        read = out_cs_key;
-        validate = < INSDC:dna:text > compare ( in_cs_key, out_cs_key );
-    }
-
-    /* COLOR_MATRIX
-     *  matrix used for color-space conversions
-     */
-    extern column U8 COLOR_MATRIX = out_color_matrix;
-
-
-    /* QUALITY
-     *  base or color call qualities
-     */
-
-    // PHRED is default
-    extern default column INSDC:quality:phred QUALITY = out_qual_phred;
-
-    // textual encodings
-    extern column INSDC:quality:text:phred_33 QUALITY
-        = out_qual_text_phred_33
-        | ( INSDC:quality:text:phred_33 ) < B8 > sum < 33 > ( out_qual_phred );
-    extern column INSDC:quality:text:phred_64 QUALITY
-        = out_qual_text_phred_64
-        | ( INSDC:quality:text:phred_64 ) < B8 > sum < 64 > ( out_qual_phred );
-
-
-    /* SIGNAL
-     *  signal and intensity information is unspecified
-     */
-    INSDC:coord:len signal_len
-        = ( INSDC:coord:len ) row_len ( out_signal )
-        | < INSDC:coord:len > echo < 0 > ();
-    
-
-	/* VIRTUAL PRODUCTIONS
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * protein
- *  basic protein sequence table
- */
-table INSDC:tbl:protein #1
-{
-    /* PROTEIN
-     *  native or converted protein sequence
-     */
-
-    // default is IUPAC character representation
-    extern default column INSDC:protein:text PROTEIN
-    {
-        read = out_protein_text;
-        validate = < INSDC:protein:text > compare ( in_protein_text, out_protein_text );
-    }
-
-    // aa representation
-    extern column INSDC:aa:bin PROTEIN = out_aa_bin;
-
-
-	/* INSDC:tbl:protein productions
-	 *  out_aa_bin
-	 *  in_protein_text
-	 *  out_protein_text
-	 */
-};
diff --git a/interfaces/insdc/sra.h b/interfaces/insdc/sra.h
deleted file mode 100644
index 85a94f7..0000000
--- a/interfaces/insdc/sra.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_insdc_sra_
-#define _h_insdc_sra_
-
-#ifndef _h_insdc_insdc_
-#include <insdc/insdc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*==========================================================================
- * INSDC SRA types, constants
- */
-
-
-/* spotid_t
- *  unique id given to every spot
- */
-typedef uint32_t INSDC_SRA_spotid_t;
-
-
-/* spot_ids_found
- *  returns a tuple of spot ids
- */
-typedef uint64_t INSDC_SRA_spot_ids_found [ 4 ];
-
-
-/* read filter
- */
-#define sra_read_filter_t "INSDC:SRA:read_filter"
-typedef INSDC_read_filter INSDC_SRA_read_filter;
-enum
-{
-    SRA_READ_FILTER_PASS = READ_FILTER_PASS,
-    SRA_READ_FILTER_REJECT = READ_FILTER_REJECT,
-    SRA_READ_FILTER_CRITERIA = READ_FILTER_CRITERIA,
-    SRA_READ_FILTER_REDACTED = READ_FILTER_REDACTED
-};
-
-
-/* read type
- *  describes the type of read within a spot
- *  the extended version also describes its orientation
- */
-#define sra_read_type_t "INSDC:SRA:xread_type"
-typedef INSDC_read_type INSDC_SRA_xread_type;
-typedef INSDC_SRA_xread_type INSDC_SRA_read_type;
-enum
-{
-    /* read_type and xread_type */
-    SRA_READ_TYPE_TECHNICAL  = READ_TYPE_TECHNICAL,
-    SRA_READ_TYPE_BIOLOGICAL = READ_TYPE_BIOLOGICAL,
-
-    /* xread_type only - applied as bits, e.g.:
-       type = SRA_READ_TYPE_BIOLOGICAL | SRA_READ_TYPE_REVERSE */
-    SRA_READ_TYPE_FORWARD = READ_TYPE_FORWARD,
-    SRA_READ_TYPE_REVERSE = READ_TYPE_REVERSE
-};
-
-
-/* platform id
- */
-#define sra_platform_id_t "INSDC:SRA:platform_id"
-typedef uint8_t INSDC_SRA_platform_id;
-enum
-{
-    SRA_PLATFORM_UNDEFINED         = 0,
-    SRA_PLATFORM_454               = 1,
-    SRA_PLATFORM_ILLUMINA          = 2,
-    SRA_PLATFORM_ABSOLID           = 3,
-    SRA_PLATFORM_COMPLETE_GENOMICS = 4,
-    SRA_PLATFORM_HELICOS           = 5,
-    SRA_PLATFORM_PACBIO_SMRT       = 6,
-    SRA_PLATFORM_ION_TORRENT       = 7,
-    SRA_PLATFORM_SANGER            = 8
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_insdc_sra_ */
diff --git a/interfaces/insdc/sra.vschema b/interfaces/insdc/sra.vschema
deleted file mode 100644
index e5dc2f6..0000000
--- a/interfaces/insdc/sra.vschema
+++ /dev/null
@@ -1,484 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * INSDC Sequence Read Archive schema
- */
-version 1;
-
-include 'insdc/seq.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-/* spotid_t
- *  unique id given to every spot
- */
-typedef U32 INSDC:SRA:spotid_t;
-
-
-/* spot_ids_found
- */
-typedef U64 INSDC:SRA:spot_ids_found [ 4 ];
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-
-/* format_spot_name
- *  given a name format string, X, and Y
- *  produce a reconstructed spot name string
- *
- *  "name_fmt" [ DATA ] - name format string ( see format explanation below )
- *
- *  "X" [ DATA ] - X coordinate for spot
- *
- *  "Y" [ DATA ] - Y coordinate for spot
- *
- *  "spot_name" [ DATA, OPTIONAL ] - potential source of unformatted names
- *
- * SYNOPSIS:
- *  "name_fmt" may have any ASCII characters
- *  the special character '$' is an escape symbol
- *  when followed by a recognized format character,
- *  both the '$' and its format character will be
- *  replaced with a numeral generated from X and/or Y.
- *
- *  when "spot_name" is present and the "name_fmt" row is empty,
- *  output is taken verbatim from "spot_name"
- */
-function
-ascii INSDC:SRA:format_spot_name #1 ( ascii name_fmt , I32 X , I32 Y * ascii spot_name );
-
-function
-ascii INSDC:SRA:format_spot_name_no_coord #1 ( ascii name_fmt  * ascii spot_name );
-
-
-/*--------------------------------------------------------------------------
- * spotcoord
- *  spot coordinate table
- *  gives X and Y and potentially other common coordinates
- */
-table INSDC:SRA:tbl:spotcoord #1
-{
-    /* X, Y
-     *  32 ( or 16 ) bit coordinates within plate region
-     *  the coordinate system ( zero or one-based ) is unspecified
-     */
-    extern default column INSDC:coord:val X = out_x_coord;
-    extern default column INSDC:coord:val Y = out_y_coord;
-
-    // backward compatibility for 16-bit unsigned coordinates
-    extern readonly column U16 X = cast ( x_clip_U16 );
-    extern readonly column U16 Y = cast ( y_clip_U16 );
-
-    // clip signed 32-bit coordinates to unsigned 16-bit
-    INSDC:coord:val x_clip_U16
-        = < INSDC:coord:val > clip < 0, 0xFFFF > ( out_x_coord );
-    INSDC:coord:val y_clip_U16
-        = < INSDC:coord:val > clip < 0, 0xFFFF > ( out_y_coord );
-
-
-	/* INSDC:SRA:tbl:spotcoord virtual productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * spotname
- *  spot name table
- *  the name column is normally indexed
- *
- * history:
- *  1.0.1 - split X and Y into spotcoord table
- */
-table INSDC:SRA:tbl:spotname #1.0.1 = INSDC:SRA:tbl:spotcoord #1
-{
-    /* NAME
-     *  external name for spot
-     */
-    extern column ascii NAME = _out_name;
-
-
-    /* SPOT_IDS_FOUND
-     *  lookup by NAME column
-     */
-    readonly column INSDC:SRA:spot_ids_found SPOT_IDS_FOUND
-        =  spot_ids_found;
-
-
-    /* default rules */
-
-    // assemble NAME column output in order of preference
-    ascii _out_name
-        = INSDC:SRA:format_spot_name ( out_name_fmt, out_x_coord, out_y_coord, out_spot_name )
-        | INSDC:SRA:format_spot_name ( out_name_fmt, out_x_coord, out_y_coord )
-        | INSDC:SRA:format_spot_name_no_coord (out_name_fmt)
-        | out_spot_name;
-
-
-	/* INSDC:SRA:tbl:spotcoord inherited virtual productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 */
-
-	/* INSDC:SRA:tbl:spotname virtual productions
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * spotdesc
- *  spot descriptor table
- *
- * history:
- *  1.0.1 - base explicitly upon sequence #1.0.1
- *  1.0.2 - added alternate taps for in_read_type and in_read_len
- */
-
-// read filter bits
-typedef U8 INSDC:SRA:read_filter;
-const INSDC:SRA:read_filter SRA_READ_FILTER_PASS = 0;
-const INSDC:SRA:read_filter SRA_READ_FILTER_REJECT = 1;
-const INSDC:SRA:read_filter SRA_READ_FILTER_CRITERIA = 2;
-const INSDC:SRA:read_filter SRA_READ_FILTER_REDACTED = 3;
-
-// read type bits
-typedef U8 INSDC:SRA:xread_type;
-const INSDC:SRA:xread_type SRA_READ_TYPE_TECHNICAL  = 0;
-const INSDC:SRA:xread_type SRA_READ_TYPE_BIOLOGICAL = 1;
-const INSDC:SRA:xread_type SRA_READ_TYPE_FORWARD    = 2;
-const INSDC:SRA:xread_type SRA_READ_TYPE_REVERSE    = 4;
-
-// original read-types included only technical and biological
-typedef INSDC:SRA:xread_type INSDC:SRA:read_type;
-
-table INSDC:SRA:tbl:spotdesc #1.0.2 = INSDC:tbl:sequence #1.0.1
-{
-    /* NREADS
-     *  describes the number of reads within spot
-     */
-    extern column U8 NREADS = out_nreads;
-
-
-    /* SPOT_LEN
-     *  length of sequence
-     * FIXED_SPOT_LEN
-     *  non-zero if sequence length is fixed throughout table
-     */
-    readonly column INSDC:coord:len SPOT_LEN = spot_len;
-    readonly column INSDC:coord:len FIXED_SPOT_LEN = fixed_spot_len;
-
-
-    /* TRIM_START
-     * TRIM_LEN
-     *  define the spot segment after applying trimming
-     *  trimming may be based upon technical segments and read quality
-     */
-    readonly column INSDC:coord:zero TRIM_START
-        = trim_start
-        | < INSDC:coord:zero> echo < 0 > ();
-    readonly column INSDC:coord:one TRIM_START
-        = ( INSDC:coord:one ) < I32 > sum < 1 > ( trim_start )
-        | < INSDC:coord:one> echo < 1 > ();
-    readonly column INSDC:coord:len TRIM_LEN
-        = trim_len
-        | spot_len;
-
-
-    /* LABEL
-     * LABEL_START, LABEL_LEN
-     *  column pair for writing read labels
-     *  the label text for all reads is concatenated to form the LABEL row
-     *  starting coordinates and lengths delineate labels by read
-     *
-     * NB - row length for LABEL_START/LEN === NREADS,
-     *      row length for LABEL === SUM ( LABEL_LEN [ n ] ) for NREADS
-     */
-    extern column ascii LABEL = out_label;
-    extern column INSDC:coord:zero LABEL_START = out_label_start;
-    extern column INSDC:coord:len LABEL_LEN = out_label_len;
-
-    // 16-bit versions
-    readonly column U16 LABEL_START = cast ( out_label_start );
-    readonly column U16 LABEL_LEN = cast ( out_label_len );
-
-
-    /* READ_TYPE
-     *  binary values giving type of a read
-     *
-     * NB - row length === NREADS
-     */
-    extern default column INSDC:SRA:xread_type READ_TYPE = out_read_type;
-
-    INSDC:SRA:xread_type in_read_type
-        = READ_TYPE
-        | _alt_in_read_type;
-
-    readonly column INSDC:SRA:read_type READ_TYPE
-        = out_read_type
-        | < INSDC:SRA:xread_type, INSDC:SRA:read_type > map < [ 0,1,2,3,4,5,6,7 ], [ 0,1,0,1,0,1,0,1 ] > ( out_read_type );
-
-
-    /* READ_START
-     * READ_LEN
-     *  define starting coordinates and length of read segments
-     *
-     * NB - row length === NREADS
-     */
-    extern default column INSDC:coord:zero READ_START
-        = out_read_start;
-    extern column INSDC:coord:one READ_START
-        = ( INSDC:coord:one ) < I32 > sum < 1 > ( out_read_start );
-    extern column INSDC:coord:len READ_LEN = out_read_len;
-
-    // 16-bit versions
-    readonly column U16 READ_START = cast ( out_read_start );
-    readonly column U16 READ_LEN = cast ( out_read_len );
-
-    INSDC:coord:len in_read_len
-        = READ_LEN
-        | _alt_in_read_len;
-
-
-    /* READ_FILTER
-     *  bits indicate usability of sequence
-     *  always available
-     */
-    extern column INSDC:SRA:read_filter READ_FILTER
-        = out_rd_filter
-        | < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ( out_read_start );
-
-    // RD_FILTER - only available if physical column is present
-    extern readonly column INSDC:SRA:read_filter RD_FILTER = out_rd_filter;
-
-
-    /* spot_len is used internally */
-    INSDC:coord:len spot_len
-        = base_space_spot_len
-        | color_space_spot_len
-        | align_spot_len;
-    INSDC:coord:len fixed_spot_len
-        = static_fixed_spot_len
-        | base_space_fixed_spot_len
-        | color_space_fixed_spot_len;
-
-
-	/* INSDC:tbl:sequence inherited virtual productions
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-};
-
-/*--------------------------------------------------------------------------
- * stats
- *  run and spot-group statistics
- *
- * history:
- *  1.1.0 - added CMP_BASE_COUNT
- */
-table INSDC:SRA:tbl:stats #1.1
-{
-    readonly column INSDC:SRA:spotid_t MIN_SPOT_ID
-        = min_spot_id
-        | < INSDC:SRA:spotid_t > echo < 1 > ();
-    readonly column INSDC:SRA:spotid_t MAX_SPOT_ID
-        = max_spot_id
-        | cast ( spot_count );
-    readonly column U64
-        SPOT_COUNT = spot_count;
-    readonly column U64
-        BASE_COUNT = base_count;
-    readonly column U64
-        BIO_BASE_COUNT = bio_base_count;
-    readonly column U64 CMP_BASE_COUNT
-        = cmp_base_count
-        | base_count;
-
-    U8 stats_dummy = in_stats_bin;
-
-	/* INSDC:SRA:tbl:stats productions
-	 *  base_count
-	 *  spot_count
-	 *  max_spot_id
-	 *  min_spot_id
-     *  in_stats_bin
-	 *  bio_base_count
-	 *  cmp_base_count
-	 */
-};
-
-/*--------------------------------------------------------------------------
- * sra
- *  the INSDC SRA table
- *
- * history:
- *  1.0.1 - base explicitly upon spotname #1.0.1
- *  1.0.2 - base explicitly upon sequence #1.0.1, spotdesc #1.0.1
- *  1.0.3 - base upon spotdesc #1.0.2
- */
-
-// platform constants from <insdc/sra.h>
-typedef U8 INSDC:SRA:platform_id;
-const INSDC:SRA:platform_id SRA_PLATFORM_UNDEFINED         = 0;
-const INSDC:SRA:platform_id SRA_PLATFORM_454               = 1;
-const INSDC:SRA:platform_id SRA_PLATFORM_ILLUMINA          = 2;
-const INSDC:SRA:platform_id SRA_PLATFORM_ABSOLID           = 3;
-const INSDC:SRA:platform_id SRA_PLATFORM_COMPLETE_GENOMICS = 4;
-const INSDC:SRA:platform_id SRA_PLATFORM_HELICOS           = 5;
-const INSDC:SRA:platform_id SRA_PLATFORM_PACBIO_SMRT       = 6;
-const INSDC:SRA:platform_id SRA_PLATFORM_ION_TORRENT       = 7;
-const INSDC:SRA:platform_id SRA_PLATFORM_SANGER            = 8;
-
-table INSDC:SRA:tbl:sra #1.0.3 =
-    INSDC:tbl:sequence #1.0.1, INSDC:SRA:tbl:spotname #1.0.1,
-    INSDC:SRA:tbl:spotdesc #1.0.2, INSDC:SRA:tbl:stats #1.1.0
-{
-    /* PLATFORM
-     *  platform description
-     *  one version returns a constant defined above
-     *  while the other returns a textual representation
-     */
-    extern column INSDC:SRA:platform_id PLATFORM
-        = .PLATFORM
-        | out_platform;
-    readonly column  ascii PLATFORM
-        = platform_name;
-
-    physical column
-        < INSDC:SRA:platform_id > zip_encoding .PLATFORM = PLATFORM;
-
-
-    /* SPOT_ID
-     *  reports spot id of current row
-     */
-    extern column INSDC:SRA:spotid_t SPOT_ID
-        = < INSDC:SRA:spotid_t > add_row_id ( .SPOT_ID )
-        | cast ( rowid_64 );
-    I64 rowid_64 = row_id ();
-
-    physical column < INSDC:SRA:spotid_t > izip_encoding .SPOT_ID
-        = < INSDC:SRA:spotid_t > sub_row_id ( SPOT_ID );
-
-
-    /* SPOT_GROUP
-     *  a name denoting group membership, ''
-     *  used for "barcode" support
-     */
-    extern column ascii SPOT_GROUP
-        = out_spot_group
-        | .SPOT_GROUP
-        | < ascii > echo < '' > ();
-
-    ascii in_spot_group = SPOT_GROUP;
-
-    physical column
-        < ascii > zip_encoding <  Z_DEFAULT_STRATEGY, Z_BEST_SPEED > .SPOT_GROUP = in_spot_group;
-
-
-	/* INSDC:tbl:sequence inherited virtual productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotcoord inherited virtual productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 */
-
-	/* INSDC:SRA:tbl:spotname inherited virtual productions
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  base_count
-	 *  spot_count
-	 *  max_spot_id
-	 *  min_spot_id
-     *  in_stats_bin
-	 *  bio_base_count
-	 */
-
-	/* INSDC:SRA:tbl:sra productions
-	 *  out_platform
-	 *  platform_name
-	 */
-};
diff --git a/interfaces/kapp/args.h b/interfaces/kapp/args.h
deleted file mode 100644
index e19a394..0000000
--- a/interfaces/kapp/args.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kapp_args_
-#define _h_kapp_args_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* this define is while adding the --option-file to standard options
- * and it might not be right yet */
-#define USE_OPTFILE    1
-
-/*
- * Terminology for this module:
- *
- * On the command line all things typed in are arguments
- * Those arguments that are string preceded by "-" or "--" are options
- * The -- preceded version of an Option is that Option's name.  A name
- * can have one or more aliases that are a single character.
- * The arguments that are not are parameters.
- *
- * This module treats all "strings" as if they were made of UTF-8 characters
- * that can be one or more bytes long.  An alias is a single Unicode character
- * in UTF-8 format.  7-bit ASCII is a true subset of UTF-8.  8-but ASCII might
- * not work.
- */
-
-
-/* ==========
- * Structure to define a command line option
- *
- * these are fed in one by one or through arrays to build up the
- * tables used to parse the caommand line argc/argv
- */
-typedef struct OptDef
-{
-    const char *  name;           	/* UTF8/ASCII NUL terminated long name */
-    const char *  aliases;        	/* UTF8/ASCII NUL terminated set of single utf8/ASCII character names: may be NULL or "" */
-    void (CC *    help_gen) (const char **);	/* function to generate help string */
-    const char ** help;                	/* help-gen can treat these as non-const */
-    uint16_t      max_count;      	/* maximum allowed; 0 is unlimited */
-#define OPT_UNLIM 0
-    bool          needs_value;    	/* does this require an argument value? */
-    bool          required;             /* is this a required parameter?  Not supported yet. */
-} OptDef;
-
-extern OptDef StandardOptions [];
-
-#define OPTION_DEBUG     "debug"
-#define OPTION_LOG_LEVEL "log-level"
-#define OPTION_HELP      "help"
-#define OPTION_VERSION   "version"
-#define OPTION_VERBOSE   "verbose"
-#define OPTION_QUIET     "quiet"
-#if USE_OPTFILE
-#define OPTION_OPTFILE   "option-file"
-#endif
-#define OPTION_NO_USER_SETTINGS "no-user-settings"
-#define ALIAS_DEBUG     "+"
-#define ALIAS_LOG_LEVEL "L"
-#define ALIAS_HELP      "h?"
-#define ALIAS_HELP1     "h"
-#define ALIAS_VERSION   "V"
-#define ALIAS_VERBOSE   "v"
-#define ALIAS_QUIET     "q"
-#if USE_OPTFILE
-#define ALIAS_OPTFILE   ""
-#endif
-
-#define OPTION_REPORT   "ncbi_error_report"
-#define ALIAS_REPORT    ""
-
-/*--------------------------------------------------------------------------
- * Args
- *  opaque class to build up option lists and parse the command line argc/argv
- *  not reference counted
- */
-typedef struct Args Args;
-
-
-/* Make
- *  create the empty object
- */
-rc_t CC ArgsMake ( Args ** pself );
-
-
-/* Whack
- *  undo all object and owned object construction
- */
-rc_t CC ArgsWhack ( Args * self );
-
-#ifndef ArgsRelease
-#define ArgsRelease(self) ArgsWhack(self)
-#endif
-
-/* AddOptionArray
- *  helper function to call the ArgsAddOption() multiple times
- */
-rc_t CC ArgsAddOptionArray ( Args * self, const OptDef * option, uint32_t count
-#if ADD_SOMETIME_LATER
-    , rc_t ( CC * header_fmt )( Args * args, const char * header ), const char * header
-#endif
-    );
-
-
-/* AddStandardOptions
- *  helper macro to add the arracy of internally defined
- *  "standard" options that we want all programs to support
- */
-rc_t CC ArgsAddStandardOptions ( Args * self );
-
-
-/* Parse
- *  parse the argc/argv as presented to KMain using the Args structure as built up
- */
-rc_t CC ArgsParse ( Args * self, int argc, char *argv[] );
-
-
-/* tokenizes a file into an user supplied argv array ( not the one from main() ! )
- * the result can be passed into ArgsParse(), enables commandline-options from a file
- *  caller has to free the created array via Args_free_token_argv()
- */
-rc_t CC Args_tokenize_file_into_argv( const char * filename, int * argc, char *** argv );
-
-rc_t CC Args_tokenize_file_and_progname_into_argv( const char * filename, const char * progname,
-                                                   int * argc, char *** argv );
-
-/* free's the array that was created by calling Args_tokenize_file_into_argv()
- */
-void CC Args_free_token_argv( int argc, char * argv[] );
-
-
-/* looks in args for file_option(s), if found loades the files, parses them
-   if this results in more files to be parsed ( kind of includes ),
-   the parsing continues recursivly
- */
-rc_t CC Args_parse_inf_file( Args * args, const char * file_option );
-
-
-/* looks in the unparsed original argv for the value of an option
-   >>> this is a hack to enable special treatment for tools that do not use
-       the standard args-parsing <<<
- */
-rc_t CC Args_find_option_in_argv( int argc, char * argv[],
-                                  const char * option_name,
-                                  char * option, size_t option_len );
-
-/* OptionCount
- *  how many times did this Option occur?
- */
-rc_t CC ArgsOptionCount ( const Args * self, const char * option_name, uint32_t * count );
-
-
-/* OptionValue
- *  what was the Nth value seen for this option?
- *  use OptionCount to know how many were seen.
- */
-rc_t CC ArgsOptionValue ( const Args * self, const char * option_name,
-    uint32_t iteration, const char ** value );
-
-/*
- * ParamCount
- *  How many Parameters were seen?
- */
-rc_t CC ArgsParamCount (const Args * self, uint32_t * count);
-
-/*
- * ParamValue
- *  What was the Nth parameter seen?  Use ParamCount to know how many
- *  were seen.
- */
-rc_t CC ArgsParamValue (const Args * self, uint32_t iteration, const char ** value_string);
-
-
-/*
- * ArgvCount
- *  This is the original main() argument count (argc or ac)
- */
-rc_t CC ArgsArgvCount (const Args * self, uint32_t * count);
-rc_t CC ArgsArgc (const Args * self, uint32_t * count);
-#define ArgsArgc ArgsArgvCount
-
-
-/*
- * ArgvValue
- *  What was the Nth parameter seen?  Use ArgvCount to know how many
- *  were seen.
- *
- * The 0th value will as with the original argc.argv c system be the program name
- * as given to us by the O/S and c start up code.
- */
-rc_t CC ArgsArgvValue (const Args * self, uint32_t iteration, const char ** value_string);
-
-
-
-/* Utility functions to do common combinations and activities */
-
-/*
- * MakeStandardOptions
- *  Calls both Make() and AddStandardOptions()
- *
- * This is probably the first thing to do in KMain(), then add other Options
- * via OptDef arracys and structures.  Then call parse.
- */
-rc_t CC ArgsMakeStandardOptions (Args** pself);
-
-rc_t CC ArgsHandleHelp (Args * self);
-rc_t CC ArgsHandleVersion (Args * self);
-rc_t CC ArgsHandleOptfile (Args * self);
-
-/*
- * ArgsHandleLogLevel
- *  calls OptionCount and OptionValue to get parameters for the log-level
- *  option then uses that/those values to set the Log level for the log module
- */
-rc_t CC ArgsHandleLogLevel (const Args * self);
-
-
-rc_t CC ArgsHandleStatusLevel (const Args * self);
-rc_t CC ArgsHandleDebug (const Args * self);
-rc_t CC ArgsHandleStandardOptions (Args * self);
-
-rc_t CC ArgsMakeAndHandle (Args ** pself, int argc, char ** argv, uint32_t table_count, ...);
-
-rc_t CC ArgsMakeAndHandleStandardOptions (Args ** pself, int argc, char ** argv,
-                                       OptDef * options, uint32_t opt_count);
-
-rc_t CC ArgsOptionSingleString (const Args * self, const char * option, const char ** value);
-
-/* either fullpath or progname can be NULL, args can not */
-rc_t CC ArgsProgram (const Args * args, const char ** fullpath, const char ** progname);
-
-
-/* after arguments are parsed; check to see if any required arguments are missing */
-rc_t CC ArgsCheckRequired (Args * args);
-
-
-/*
- * Help Interface:
- * This interface is an extention os the Args Interface that is used for
- * generating usage outputs for a command line program,  This interface is provided
- * to standardize the look of these usage messages.
- */
-
-/*
- * This function is defined per program and is the meat of the output
- * the the short-form usage and the first part of the long-form usage
- *
- * It should look something like this:
- *
- *
- *    rc_t UsageSummary (const char * progname)
- *    {
- *        return KOutMsg ("\n"
- *                        "Usage:\n"
- *                        "  %s [Options] [Parameters]\n"
- *                        "\n"
- *                        "Summary:\n"
- *                        "  Does something incredibly useful or we wouldn't have written it.\n"
- *                        "  I mean very very useful like pre-slicomg bread.\n",
- *                        "\n", progname);
- *    }
- *
- * More than one example line can be present if desired.
- */
-rc_t CC UsageSummary (const char * prog_name);
-
-/*
- * A program should define this which will be used only of the actual
- * program name as called is somehow irretrievable
- */
-extern const char UsageDefaultName[];
-
-
-/*
- * Version
- *   Generate the output for the -V or --version options.
- *   const char * fullpath:  The full argv[0] name for the program
- *   ver_t version:          the version for this program
- */
-void CC HelpVersion (const char * fullpath, ver_t version);
-
-void CC HelpOptionLine(const char * alias, const char * option, const char * param, const char ** msgs);
-
-void CC HelpParamLine (const char * param, const char * const * msgs);
-
-/*
- * OptionsStandard
- *   output the option lines for the standard options
- */
-void CC HelpOptionsStandard (void);
-
-
-/*
- * This Macro creates a default short form usage output typically
- * used when no options/parameters are given for a program
- *
- * It requires 'void summary (const char * program_name)' that is also
- * used in 'rc_t Usage (const Args* args)' that is the usage function
- * called when -? -h or --help is given as an option on the command line
- */
-
-rc_t CC MiniUsage ( const Args * args );
-rc_t CC Usage ( const Args * args );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_args_ */
diff --git a/interfaces/kapp/extern.h b/interfaces/kapp/extern.h
deleted file mode 100644
index 726e555..0000000
--- a/interfaces/kapp/extern.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kapp_extern_
-#define _h_kapp_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-
-#define KAPP_EXTERN LIB_EXPORT
-#define KAPP_EXTERN_DATA extern LIB_EXPORT
-#define EXPORT_LATCH 1
-
-#else
-
-#define KAPP_EXTERN LIB_IMPORT
-#define KAPP_EXTERN_DATA LIB_IMPORT
-
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kapp_extern_ */
diff --git a/interfaces/kapp/loader-file.h b/interfaces/kapp/loader-file.h
deleted file mode 100644
index e4c0de8..0000000
--- a/interfaces/kapp/loader-file.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kapp_loader_file_
-#define _h_kapp_loader_file_
-
-#ifndef _h_kapp_extern_
-#include <kapp/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#include <klib/log.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-
-/*--------------------------------------------------------------------------
-* SRA reader buffered input file
-*/
-typedef struct KLoaderFile KLoaderFile;
-
-/*
-    md5_digest - not null forces MD5 verification for the file content
-    read_ahead - force reading of the file in a diff thread, ahead of time,
-                 usefull on compressed file, speeds up MD5 verify too
-*/
-KAPP_EXTERN rc_t CC KLoaderFile_Make(const KLoaderFile **file, struct KDirectory const* dir, const char* filename,
-                                     const uint8_t* md5_digest, bool read_ahead);
-
-KAPP_EXTERN rc_t CC KLoaderFile_Release(const KLoaderFile* cself, bool exclude_from_progress);
-
-/* temporary close the file to avoid too many open files, but stay on position */
-KAPP_EXTERN rc_t CC KLoaderFile_Close(const KLoaderFile* cself);
-
-/* restart reading from beginning of the file */
-KAPP_EXTERN rc_t CC KLoaderFile_Reset(const KLoaderFile* cself);
-
-KAPP_EXTERN rc_t CC KLoaderFile_SetReadAhead(const KLoaderFile* cself, bool read_ahead);
-
-/* print error msg file file info and return original!! rc
-   if msg is NULL fmt is not used so call with NULL, NULL if no msg needs to be printed */
-KAPP_EXTERN rc_t CC KLoaderFile_LOG(const KLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...);
-KAPP_EXTERN rc_t CC KLoaderFile_VLOG(const KLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, va_list args);
-
-/* returns true if eof is reached and buffer is empty */
-KAPP_EXTERN rc_t CC KLoaderFile_IsEof(const KLoaderFile* cself, bool* eof);
-
-/* returns current buffer position in file */
-KAPP_EXTERN rc_t CC KLoaderFile_Offset(const KLoaderFile* cself, uint64_t* offset);
-
-/* returns current line number in file */
-KAPP_EXTERN rc_t CC KLoaderFile_Line(const KLoaderFile* cself, uint64_t* line);
-
-/* file name */
-KAPP_EXTERN rc_t CC KLoaderFile_Name(const KLoaderFile *self, const char **name);
-
-/* real file name */
-KAPP_EXTERN rc_t CC KLoaderFile_FullName(const KLoaderFile *self, const char **name);
-
-/* file name completly resolved */
-KAPP_EXTERN rc_t CC KLoaderFile_ResolveName(const KLoaderFile *self, char *resolved, size_t rsize);
-
-/* Readline
- *  makes next line from a file available in buffer.
- *  eligable EOL symbols are: \n (unix), \r (older mac), \r\n (win)
- *  EOL symbol(s) never included in buffer length.
- *  if there is no EOL at EOF - not an error.
- *  fails if internal buffer is insufficient.
- *  buffer is NULL on EOF
- *  rc state of (rcString rcTooLong) means line was too long
- *              you may copy line and readline again for the tail of the line
- *
- *  "buffer" [ OUT ] and "length" [ OUT ] - returned line and it's length
- */
-KAPP_EXTERN rc_t CC KLoaderFile_Readline(const KLoaderFile* self, const void** buffer, size_t* length);
-
-/* Read
-*  reads "size" bytes from file and makes them available through "buffer"
-*  if "advance" is > 0 than before reading skips "advance" bytes in file
-*  if "size" == 0 then nothing is read and available "length" bytes is returned in "buffer"
-*
-*  "buffer" [ OUT ] - pointer to read bytes, "buffer" NULL means EOF
-*  "length" [ OUT ] - number of read bytes, normally == size,
-                      if less than requested size, rc is [rcBuffer,rcInsufficient], advance and read more!
-*/
-KAPP_EXTERN rc_t CC KLoaderFile_Read(const KLoaderFile* self, size_t advance, size_t size, const void** buffer, size_t* length);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_loader_file_ */
diff --git a/interfaces/kapp/loader-meta.h b/interfaces/kapp/loader-meta.h
deleted file mode 100644
index 28a711a..0000000
--- a/interfaces/kapp/loader-meta.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kapp_loader_meta_
-#define _h_kapp_loader_meta_
-
-#ifndef _h_kapp_extern_
-#include <kapp/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KMDataNode;
-
-KAPP_EXTERN rc_t CC KLoaderMeta_Write(struct KMDataNode* root,
-                                      const char* argv0, const char* argv0_date,
-                                      const char* app_name, ver_t app_version);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_loader_meta_*/
diff --git a/interfaces/kapp/log-xml.h b/interfaces/kapp/log-xml.h
deleted file mode 100644
index 9517fb8..0000000
--- a/interfaces/kapp/log-xml.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kapp_log_xml_h_
-#define _h_kapp_log_xml_h_
-
-#ifndef _kapp_extern_
-#include <kapp/extern.h>
-#endif
-
-#ifndef _kapp_args_
-#include <kapp/args.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-
-KAPP_EXTERN_DATA const OptDef XMLLogger_Args [];
-KAPP_EXTERN_DATA const size_t XMLLogger_ArgsQty;
-
-typedef struct XMLLogger XMLLogger;
-
-/*
-  Creates XML logging based on dir and command line
- */
-KAPP_EXTERN rc_t CC XMLLogger_Make(const XMLLogger** cself,
-    struct KDirectory* dir, const Args *args);
-
-/*
-  Creates XML logging based on dir, logpath pair or fd directly
-
-  dir     [IN,NULL] - directory object used to create and open logpath file
-  logpath [IN,NULL] - file name of the log file to _truncate_ and log into
-  fd  [IN,NEGATIVE] - direct file descriptor, if < 0 than not set
-
-  if both logpath == NULL and fd < 0 than no XML log is produced normal log gets full inforamtion
- */
-KAPP_EXTERN rc_t CC XMLLogger_Make2(const XMLLogger** cself,
-    struct KDirectory* dir, const char* logpath, const int fd);
-
-KAPP_EXTERN void CC XMLLogger_Usage(void);
-
-KAPP_EXTERN void CC XMLLogger_Release(const XMLLogger* cself);
-
-KAPP_EXTERN rc_t CC XMLLogger_Encode(const char* src, char *dst, size_t dst_sz, size_t *num_writ);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_log_xml_h_ */
diff --git a/interfaces/kapp/main.h b/interfaces/kapp/main.h
deleted file mode 100644
index 5190f15..0000000
--- a/interfaces/kapp/main.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kapp_main_
-#define _h_kapp_main_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kapp_args_
-#include <kapp/args.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMain
- *  invoked by platform specific "main" entrypoint
- */
-
-/* Quitting
- *  is the program supposed to exit
- */
-rc_t CC Quitting ( void );
-
-/* SignalQuit
- *  tell the program to quit
- */
-rc_t CC SignalQuit ( void );
-
-/* Hangup
- *  has the program received a SIGHUP
- */
-rc_t CC Hangup ( void );
-
-/* SignalHup
- *  send the program a SIGHUP
- */
-rc_t CC SignalHup ( void );
-
-/* SignalNoHup
- *  tell the program to stay alive even after SIGHUP
- */
-rc_t CC SignalNoHup ( void );
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void );
-    
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] );
-
-
-/* Usage - EXTERN
- *  This function is called when the command line argument
- *  handling sees -? -h or --help
- */
-rc_t CC Usage ( struct Args const * args );
-
-
-/* Version - EXTERN
- *  Obsolete: formerly called when the command line option handler
- *  saw -V or --version
- */
-rc_t CC Version ( struct Args const * args );
-
-
-/* AsciiToXXX
- *  replacement for atoi
- *  converts NUL terminated string in "arg" to integer
- *  invokes error handler if there is a format error in string
- *
- *  "arg" [ IN ] - NUL terminated textual representation of integer
- *  obeys standard conversion rules:
- *    starts with "0x" or "0X" - interpret as hex
- *    starts with '0' - interpret as octal
- *    otherwise - interpret as decimal
- *
- *  "handler_error" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ] -
- *  optional callback function to handle case where "arg" could not
- *  be processed in its entirety. default behavior is to log error
- *  using "logerr" and invoke "exit".
- */
-int32_t CC AsciiToI32 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data );
-uint32_t CC AsciiToU32 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data );
-int64_t CC AsciiToI64 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data );
-uint64_t CC AsciiToU64 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data );
-
-
-/* NextLogLevel
- * NextLogLevelh
- *  these match NextArg and NextArgh but take the parameter and use it
- *  to set the Log Level.
- *
- * legal values for the parameter are:
- * 1. a sequence of + or - characters that each bump the current log level
- *    up or down one.
- * 2. an integer with a decimal value from 0 to 13 (octal and hex with the 
- *    same range are accepted.
- * 3. fatal, err, warn, info, debug1, debug3, debug3, debug4, debug5, debug6
- *    debug7, debug8, debug9, debug10
- */
-void CC NextLogLevel ( const char **argp, int *ip, int argc, char *argv [],
-    const char* ( CC * handle_null ) ( void *data ), void *data );
-void CC NextLogLevelh ( int *ip, int argc, char *argv [],
-    const char* ( CC * handle_null ) ( void *data ), void *data );
-
-#define LogLevelSet( S ) \
-    NextLogLevelCommon ( S )
-
-rc_t CC NextLogLevelCommon ( const char * level_parameter );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_main_ */
diff --git a/interfaces/kapp/progressbar.h b/interfaces/kapp/progressbar.h
deleted file mode 100644
index 07d1555..0000000
--- a/interfaces/kapp/progressbar.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kapp_progressbar_
-#define _h_kapp_progressbar_
-
-#ifndef _h_kapp_extern_
-#include <kapp/extern.h>
-#endif
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-struct KDirectory;
-
-typedef struct KLoadProgressbar KLoadProgressbar;
-
-/**
-   Create new object in job
- */
-KAPP_EXTERN rc_t CC KLoadProgressbar_Make(const KLoadProgressbar** cself, uint64_t size);
-/**
-   if dir is NULL current directory assumed
- */
-KAPP_EXTERN rc_t CC KLoadProgressbar_File(const KLoadProgressbar** cself, const char* filename, struct KDirectory const* dir);
-KAPP_EXTERN rc_t CC KLoadProgressbar_KFile(const KLoadProgressbar** cself, struct KFile const* file);
-
-/**
-  Release job object
-  if exclude than job stats excluded from reports
-  */
-KAPP_EXTERN void CC KLoadProgressbar_Release(const KLoadProgressbar* cself, bool exclude);
-
-/**
-    Add a chunk of smth (bytes, rows, etc) to the job
- */
-KAPP_EXTERN rc_t CC KLoadProgressbar_Append(const KLoadProgressbar* cself, uint64_t chunk);
-
-
-/* Set severity level name
-   severity [IN] - default 'status'
- */
-KAPP_EXTERN rc_t CC KLoadProgressbar_Severity(const char* severity);
-
-/* mark a chunk of bytes as processed
-   report on full percent processed or if forced
- */
-KAPP_EXTERN rc_t CC KLoadProgressbar_Process(const KLoadProgressbar* cself, uint64_t chunk, bool force_report);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_progressbar_ */
diff --git a/interfaces/kapp/queue-file.h b/interfaces/kapp/queue-file.h
deleted file mode 100644
index 79fa890..0000000
--- a/interfaces/kapp/queue-file.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kapp_queue_file_
-#define _h_kapp_queue_file_
-
-#ifndef _h_kapp_extern_
-#include <kapp/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KQueueFile
- *  an extension to KFile that runs on a background thread
- */
-struct KFile;
-
-
-/* MakeRead
- *  make a queue file for reading-ahead on background thread
- *
- *  when the file is created, a background thread is started
- *  that begins reading from "src" at position "pos", into
- *  buffers of size "buffer_size". each buffer is pushed into
- *  a cross-thread queue where it is consumed by the reading
- *  thread.
- *
- *  the background thread is throttled by queue capacity - determined
- *  by "queue_bytes" and "block_size", such that if the queue is full,
- *  the thread will sleep. the consumer thread is also throttled by the
- *  queue in that it will sleep if the queue is empty with pending data.
- *
- *  the background thread will exit upon reaching end of file,
- *  upon a permanent error, or if the queue is sealed by the consumer
- *  thread.
- *
- *  when the file is collected in response to a release message,
- *  the queue will be sealed against further inserts, pending buffers
- *  will be discarded, the background thread will be joined, and
- *  the source file will be released.
- *
- *  the intended usage is serial reading of the file. reads
- *  may only progress forward, i.e. backing up is not permitted.
- *
- *  "qf" [ OUT ] - return parameter for queue file
- *
- *  "pos" [ IN ] - starting position for reads from "src".
- *  NB - "src" must support being addressed at this position.
- *
- *  "src" [ IN ] - source file for read-ahead on background thread.
- *  must have read permissions.
- *
- *  "queue_bytes" [ IN ] - the read-ahead limit of the background
- *  thread, in bytes. this is the amount of data that will be queued
- *  for the consumer thread before the bg thread sleeps.
- *
- *  "block_size" [ IN, DEFAULT ZERO ] - optional parameter giving
- *  desired block size when reading from "src". this may be used
- *  to tune reading for source data, e.g. 64K blocks for gzip.
- *
- *  "timeout_ms" [ IN, DEFAULT ZERO ] - optional parameter specifying the period of time (in ms)
- *  at which the background thread will check whether it is to quit (e.g. the foregrount thread has sealed the buffer),
- *  when the queue cannot be written into.  If 0 specified, the timeout is set to 150 ms.
- */
-KAPP_EXTERN rc_t CC KQueueFileMakeRead ( struct KFile const **qf, uint64_t pos,
-    struct KFile const *src, size_t queue_bytes, size_t block_size, uint32_t timeout_ms );
-
-
-/* MakeWrite
- *  make a queue file for writing-behind on background thread
- *
- *  when the file is created, a background thread is started that
- *  waits for buffers to appear in the cross-thread queue. as the producer
- *  thread writes, data are accumulated into buffers which are pushed
- *  into the queue as they fill, and written in turn on the bg thread.
- *
- *  the producer thread is throttled by queue capacity - determined by
- *  "queue_bytes" and "block_size", such that if the queue is full,
- *  the thread will sleep. the background thread is also throttled by
- *  the queue in that it will sleep if the queue is empty with pending
- *  data.
- *
- *  the background thread will exit upon a permanent error, or if the
- *  queue is sealed by the producer thread.
- *
- *  when the file is collected in response to a release message,
- *  the queue will be sealed against further inserts, pending buffers
- *  will be written, the background thread will be joined, and
- *  the source file will be released.
- *
- *  the intended usage is serial writing of the file. random writes
- *  will be accepted, but may reduce the queue efficiency.
- *
- *  "qf" [ OUT ] - return parameter for queue file
- *
- *  "dst" [ IN ] - destination file for write-behind on background thread.
- *  must have write permissions.
- *
- *  "queue_bytes" [ IN ] - the write-behind limit of the producer
- *  thread, in bytes. this is the amount of data that will be queued
- *  for the background thread before the producer thread sleeps.
- *
- *  "block_size" [ IN, DEFAULT ZERO ] - optional parameter giving
- *  desired block size when writing to "dst". this may be used
- *  to tune writing for source data, e.g. 64K blocks for gzip.
- *
- *  "timeout_ms" [ IN, DEFAULT ZERO ] - optional parameter specifying the period of time (in ms)
- *  at which the background thread will check whether it is to quit (e.g. the foregrount thread has sealed the buffer),
- *  when the queue cannot be read from.  If 0 specified, the timeout is set to 150 ms.
- */
-KAPP_EXTERN rc_t CC KQueueFileMakeWrite ( struct KFile **qf,
-    struct KFile *dst, size_t queue_bytes, size_t block_size, uint32_t timeout_ms );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kapp_queue_file_ */
diff --git a/interfaces/kdb/btree.h b/interfaces/kdb/btree.h
deleted file mode 100644
index 0f6e85d..0000000
--- a/interfaces/kdb/btree.h
+++ /dev/null
@@ -1,371 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_btree_
-#define _h_kdb_btree_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * defines
- */
-
-/* KEY2ID
- *  the original behavior of btree was to perform key=>value mapping
- *  by converting to a key=>id mapping, no values are stored in the b-tree
- *  page file, allowing for an external storage
- */
-#ifndef BTREE_KEY2ID
-#define BTREE_KEY2ID 1
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDataBuffer;
-
-
-/*--------------------------------------------------------------------------
- * KBTreeCompareFunc
- */
-typedef int ( CC * KBTreeCompareFunc )
-    ( const void *a, size_t asize, const void *b, size_t bsize );
-
-
-#if ! BTREE_KEY2ID
-/*--------------------------------------------------------------------------
- * KBTreeValue
- *  gives access to a value within a data page
- */
-typedef struct KBTreeValue KBTreeValue;
-struct KBTreeValue
-{
-    uint64_t data [ 3 ];
-};
-
-/* Whack
- *  destroys object for further use
- *  may write modifications to disk ( see "write_through" below )
- */
-KDB_EXTERN rc_t CC KBTreeValueWhack ( KBTreeValue *self );
-
-
-/* AccessRead
- * AccessUpdate
- *  gain access to value address
- *  update access marks data page as modified
- *
- *  "mem" [ OUT ] - pointer to value
- *
- *  "bytes" [ OUT, NULL OKAY ] - size of value memory
- */
-KDB_EXTERN rc_t CC KBTreeValueAccessRead ( const KBTreeValue *self,
-    const void **mem, size_t *bytes );
-KDB_EXTERN rc_t CC KBTreeValueAccessUpdate ( KBTreeValue *self,
-    void **mem, size_t *bytes );
-
-#endif /* BTREE_KEY2ID */
-
-/*--------------------------------------------------------------------------
- * KBTree
- *  this implementation is an extremely simplified structure
- *  meant to provide the ability to create an index for temporary use
- */
-typedef struct KBTree KBTree;
-
-
-/* KBTreeKeyType
- *  describes the type of key to be used
- */
-typedef uint8_t KBTreeKeyType;
-enum
-{
-    kbtOpaqueKey,               /* key is a ( void*, size_t ) pair  */
-#if 0
-    kbtNulTermCharKey,          /* key is a NUL-terminated char []  */
-    kbtStringKey,               /* key is a String*                 */
-    kbtInt8Key,                 /* key is an int8_t                 */
-    kbtInt16Key,                /* key is an int16_t                */
-    kbtInt32Key,                /* key is an int32_t                */
-    kbtInt64Key,                /* key is an int64_t                */
-    kbtUint8Key,                /* key is a uint8_t                 */
-    kbtUint16Key,               /* key is a uint16_t                */
-    kbtUint32Key,               /* key is a uint32_t                */
-    kbtUint64Key,               /* key is a uint64_t                */
-    kbtFloatKey,                /* key is a float                   */
-    kbtDoubleKey,               /* key is a double                  */
-#endif
-    kbtPacked2naKey,            /* key is in packed 2na             */
-    kbtLastDefined
-};
-
-
-/* MakeRead
- * MakeUpdate
- *  make a b-tree object backed by supplied KFile
- *
- *  "backing" [ IN ] - open file with appropriate permissions:
- *   read is required in all cases, and write is required for update.
- *   NB - a reference will be attached to this file.
- *
- *  "climit" [ IN ] - cache limit in bytes. the internal cache will
- *   retain UP TO ( but not exceeding ) the limit specified. a value
- *   of 0 ( zero ) will disable caching.
- *
- *  "write_through" [ IN ] - if true, causes flushing of modified page
- *   after its value is released
- *
- *  "type" [ IN ] - describes the key type ( see above )
- *
- *  "key_chunk_size" [ IN ] - the "chunking" ( alignment ) factor for
- *   storing keys, rounded up to the nearest power of 2.
- *
- *  "value_chunk_size" [ IN ] - chunking factor for values
- *   ( see "key_chunk_size" )
- *
- *  "min_key_size" [ IN ] and "max_key_size" [ IN ] - specifies the allowed
- *   opaque key sizes. min == max implies fixed size. ignored for well
- *   known fixed size key types.
- *
- *  "id_size" [ IN ] - size of id in bytes, from 1 to 8.
- *
- *  "min_value_size" [ IN ] and "max_value_size" [ IN ] - specifies the allowed
- *   value sizes. min == max implies fixed size.
- *
- *  "cmp" [ IN, NULL OKAY ] - optional comparison callback function for opaque keys.
- *   specific key types will use internal comparison functions. for opaque keys, a
- *   NULL function pointer will cause ordering by size and binary comparison.
- */
-KDB_EXTERN rc_t CC KBTreeMakeRead ( const KBTree **bt,
-    struct KFile const *backing, size_t climit, KBTreeCompareFunc cmp );
-#if BTREE_KEY2ID
-KDB_EXTERN rc_t CC KBTreeMakeUpdate ( KBTree **bt, struct KFile *backing,
-    size_t climit, bool write_through, KBTreeKeyType type,
-    size_t min_key_size, size_t max_key_size, size_t id_size,
-    KBTreeCompareFunc cmp );
-#else
-KDB_EXTERN rc_t CC KBTreeMakeUpdate ( KBTree **bt, struct KFile *backing,
-    size_t climit, bool write_through, KBTreeKeyType type,
-    size_t key_chunk_size, size_t value_chunk_size,
-    size_t min_key_size, size_t max_key_size,
-    size_t min_value_size, size_t max_value_size,
-    KBTreeCompareFunc cmp );
-#endif
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KDB_EXTERN rc_t CC KBTreeAddRef ( const KBTree *self );
-KDB_EXTERN rc_t CC KBTreeRelease ( const KBTree *self );
-
-
-/* DropBacking
- *  used immediately prior to releasing
- *  prevents modified pages from being flushed to disk
- *  renders object nearly useless
- */
-KDB_EXTERN rc_t CC KBTreeDropBacking ( KBTree *self );
-
-
-/* Size
- *  returns size in bytes of file and cache
- *
- *  "lsize" [ OUT, NULL OKAY ] - return parameter for logical size
- *
- *  "fsize" [ OUT, NULL OKAY ] - return parameter for file size
- *
- *  "csize" [ OUT, NULL OKAY ] - return parameter for cache size
- */
-KDB_EXTERN rc_t CC KBTreeSize ( const KBTree *self,
-    uint64_t *lsize, uint64_t *fsize, size_t *csize );
-
-
-/* Find
- *  searches for a match
- *
- *  "val" [ OUT ] - return parameter for value found
- *   accessed via KBTreeValueAccess* described above
- *   must be balanced with a call to KBTreeValueWhack.
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- */
-#if BTREE_KEY2ID
-KDB_EXTERN rc_t CC KBTreeFind ( const KBTree *self, uint64_t *id,
-    const void *key, size_t key_size );
-#else
-KDB_EXTERN rc_t CC KBTreeFind ( const KBTree *self, KBTreeValue *val,
-    const void *key, size_t key_size );
-#endif
-
-
-/* FindOne
- *  searches for a match
- *  where "match" is defined as an exact match
- *  of the shorter ( key, entry ) against the
- *  corresponding prefix of the longer.
- *
- *  "id" [ OUT ] - return id of matching entry if found
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- *
- *  "match_type" [ IN ] - choose search algorithm
- *
- *  "remainder" [ OUT ] - returns the number of bytes
- *  left unmatched by comparison between the key and entry.
- *  values:
- *    = 0    - exact match
- *    < 0    - key is shorter than entry
- *    > 0    - key is longer than entry
- */
-#if BTREE_KEY2ID && 1
-typedef uint32_t KBTreeMatchType;
-enum
-{
-    kbtMatchFirst = 1,       /* choose first matching entry       */
-    kbtMatchRandom           /* choose a matching entry at random */
-};
-
-typedef struct KBTreeMatchResult KBTreeMatchResult;
-struct KBTreeMatchResult
-{
-    uint64_t id;
-    int64_t remainder;
-};
-
-KDB_EXTERN rc_t CC KBTreeFindOne ( const KBTree *self,
-    KBTreeMatchResult *found, KBTreeMatchType match_type,
-    const void *key, size_t key_size );
-#endif
-
-
-/* FindAll
- *  searches for all matches
- *  where "match" is defined as an exact match
- *  of the shorter ( key, entry ) against the
- *  corresponding prefix of the longer.
- *
- *  "ids" [ IN/OUT ] - array of uint64_t gets dynamically
- *  resized based upon the number of matches
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- *
- *  "remainder" [ OUT ] - returns the number of bytes
- *  left unmatched by comparison between the key and entry.
- *  values:
- *    = 0    - exact match
- *    < 0    - key is shorter than entry
- *    > 0    - key is longer than entry
- */
-#if BTREE_KEY2ID && 1
-KDB_EXTERN rc_t CC KBTreeFindAll ( const KBTree *self,
-    struct KDataBuffer *found_set,
-    const void *key, size_t key_size );
-#endif
-
-
-/* FindCustom
- *  searches for a match using a custom function
- *
- *  "val" [ OUT ] - return parameter for value found
- *   accessed via KBTreeValueAccess* described above
- *   must be balanced with a call to KBTreeValueWhack.
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- */
-#if BTREE_KEY2ID && 0
-KDB_EXTERN rc_t CC KBTreeFindCustom ( const KBTree *self, uint64_t *id,
-    const void *key, size_t key_size, KBTreeCompareFunc custom_cmp );
-#endif
-
-
-/* Entry
- *  searches for a match or creates a new entry
- *
- *  "val" [ OUT ] - return parameter for value found
- *   accessed via KBTreeValueAccess* described above
- *   must be balanced with a call to KBTreeValueWhack.
- *
- *  "was_inserted" [ OUT ] - if true, the returned value was the result of an
- *   insertion and can be guaranteed to be all 0 bits. otherwise, the returned
- *   value will be whatever was there previously.
- *
- *  "alloc_size" [ IN ] - the number of value bytes to allocate upon insertion,
- *   i.e. if the key was not found. this value must agree with the limits
- *   specified in Make ( see above ).
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- */
-#if BTREE_KEY2ID
-KDB_EXTERN rc_t CC KBTreeEntry ( KBTree *self, uint64_t *id,
-    bool *was_inserted, const void *key, size_t key_size );
-#else
-KDB_EXTERN rc_t CC KBTreeEntry ( KBTree *self, KBTreeValue *val,
-    bool *was_inserted, size_t alloc_size,
-    const void *key, size_t key_size );
-#endif
-
-
-/* ForEach
- *  executes a function on each tree element
- *
- *  "reverse" [ IN ] - if true, iterate in reverse order
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - callback function
- */
-#if BTREE_KEY2ID
-KDB_EXTERN rc_t CC KBTreeForEach ( const KBTree *self, bool reverse,
-    void ( CC * f ) ( const void *key, size_t key_size, uint64_t id, void *data ), void *data );
-#else
-KDB_EXTERN rc_t CC KBTreeForEach ( const KBTree *self, bool reverse,
-    void ( CC * f ) ( const void *key, size_t key_size, KBTreeValue *val, void *data ), void *data );
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_btree_ */
diff --git a/interfaces/kdb/column.h b/interfaces/kdb/column.h
deleted file mode 100644
index 7ffbc3b..0000000
--- a/interfaces/kdb/column.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_column_
-#define _h_kdb_column_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct KDBManager;
-
-
-/*--------------------------------------------------------------------------
- * KChecksum
- *  describes blob checksum
- */
-typedef uint8_t KChecksum;
-enum
-{
-    kcsNone,
-    kcsCRC32,
-    kcsMD5
-};
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- *  a collection of blobs indexed by oid
- */
-typedef struct KColumn KColumn;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KColumnAddRef ( const KColumn *self );
-KDB_EXTERN rc_t CC KColumnRelease ( const KColumn *self );
-
-
-/* CreateColumn
- * VCreateColumn
- *  create a new or open an existing column
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - the type of checksum information to
- *  apply when writing blobs
- *
- *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
- *  the default value is indicated by 0 ( zero ).
- *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-KDB_EXTERN rc_t CC KDBManagerCreateColumn ( struct KDBManager *self,
-    KColumn **col, KCreateMode cmode, KChecksum checksum,
-    size_t pgsize, const char *path, ... );
-KDB_EXTERN rc_t CC KTableCreateColumn ( struct KTable *self,
-    KColumn **col, KCreateMode cmode, KChecksum checksum,
-    size_t pgsize, const char *path, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVCreateColumn ( struct KDBManager *self,
-    KColumn **col, KCreateMode cmode, KChecksum checksum,
-    size_t pgsize, const char *path, va_list args );
-KDB_EXTERN rc_t CC KTableVCreateColumn ( struct KTable *self,
-    KColumn **col, KCreateMode cmode, KChecksum checksum,
-    size_t pgsize, const char *path, va_list args );
-
-
-/* OpenColumnRead
- * VOpenColumnRead
- *  open a column for read
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-KDB_EXTERN rc_t CC KDBManagerOpenColumnRead ( struct KDBManager const *self,
-    const KColumn **col, const char *path, ... );
-KDB_EXTERN rc_t CC KTableOpenColumnRead ( struct KTable const *self,
-    const KColumn **col, const char *path, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenColumnRead ( struct KDBManager const *self,
-    const KColumn **col, const char *path, va_list args );
-KDB_EXTERN rc_t CC KTableVOpenColumnRead ( struct KTable const *self,
-    const KColumn **col, const char *path, va_list args );
-
-
-/* OpenColumnUpdate
- * VOpenColumnUpdate
- *  open a column for read/write
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-KDB_EXTERN rc_t CC KDBManagerOpenColumnUpdate ( struct KDBManager *self,
-    KColumn **col, const char *path, ... );
-KDB_EXTERN rc_t CC KTableOpenColumnUpdate ( struct KTable *self,
-    KColumn **col, const char *path, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenColumnUpdate ( struct KDBManager *self,
-    KColumn **col, const char *path, va_list args );
-KDB_EXTERN rc_t CC KTableVOpenColumnUpdate ( struct KTable *self,
-    KColumn **col, const char *path, va_list args );
-
-
-/* Locked
- *  returns true if locked
- */
-KDB_EXTERN bool CC KColumnLocked ( const KColumn *self );
-
-
-/* Version
- *  returns the format version
- */
-KDB_EXTERN rc_t CC KColumnVersion ( const KColumn *self, uint32_t *version );
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-KDB_EXTERN rc_t CC KColumnByteOrder ( const KColumn *self, bool *reversed );
-
-
-/* IdRange
- *  returns id range for column
- *
- *  "first" [ OUT ] - first id in column
- *
- *  "count" [ OUT ] - number of ids represented by this column
- */
-KDB_EXTERN rc_t CC KColumnIdRange ( const KColumn *self, int64_t *first, uint64_t *count );
-
-
-/* Reindex
- *  optimize indices
- */
-KDB_EXTERN rc_t CC KColumnReindex ( KColumn *self );
-
-
-/* CommitFreq
- * SetCommitFreq
- *  manage frequency of commits
- */
-KDB_EXTERN rc_t CC KColumnCommitFreq ( KColumn *self, uint32_t *freq );
-KDB_EXTERN rc_t CC KColumnSetCommitFreq ( KColumn *self, uint32_t freq );
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KColumnOpenManagerRead ( const KColumn *self, struct KDBManager const **mgr );
-KDB_EXTERN rc_t CC KColumnOpenManagerUpdate ( KColumn *self, struct KDBManager **mgr );
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KColumnOpenParentRead ( const KColumn *self, struct KTable const **tbl );
-KDB_EXTERN rc_t CC KColumnOpenParentUpdate ( KColumn *self, struct KTable **tbl );
-
-
-/*--------------------------------------------------------------------------
- * KColumnBlob
- *  one or more rows of column data
- */
-typedef struct KColumnBlob KColumnBlob;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KColumnBlobAddRef ( const KColumnBlob *self );
-KDB_EXTERN rc_t CC KColumnBlobRelease ( const KColumnBlob *self );
-
-
-/* CreateBlob
- *  creates a new, unassigned blob
- */
-KDB_EXTERN rc_t CC KColumnCreateBlob ( KColumn *self, KColumnBlob **blob );
-
-
-/* OpenBlobRead
- * OpenBlobUpdate
- *  opens an existing blob containing row data for id
- */
-KDB_EXTERN rc_t CC KColumnOpenBlobRead ( const KColumn *self, const KColumnBlob **blob, int64_t id );
-KDB_EXTERN rc_t CC KColumnOpenBlobUpdate ( KColumn *self, KColumnBlob **blob, int64_t id );
-
-
-/* Read
- *  read data from blob
- *
- *  "offset" [ IN ] - starting offset into blob
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read. specifically,
- *  "offset" + "num_read" + "remaining" == sizeof blob
- */
-KDB_EXTERN rc_t CC KColumnBlobRead ( const KColumnBlob *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining );
-
-
-/* Append
- *  append data to open blob
- *
- *  "buffer" [ IN ] and "size" [ IN ] - blob data
- */
-KDB_EXTERN rc_t CC KColumnBlobAppend ( KColumnBlob *self, const void *buffer, size_t size );
-
-
-/* Validate
- *  runs checksum validation on unmodified blob
- */
-KDB_EXTERN rc_t CC KColumnBlobValidate ( const KColumnBlob *self );
-
-
-/* IdRange
- * AssignRange
- *  access id range for blob
- *
- *  "first" [ OUT ] and  "count" [ OUT ] - return parameters for IdRange
-
- *  "first" [ IN ] and "count" [ IN ] - range parameters for assign
- */
-KDB_EXTERN rc_t CC KColumnBlobIdRange ( const KColumnBlob *self, int64_t *first, uint32_t *count );
-KDB_EXTERN rc_t CC KColumnBlobAssignRange ( KColumnBlob *self, int64_t first, uint32_t count );
-
-
-/* Commit
- *  commit changes to blob
- *  close to further updates
- */
-KDB_EXTERN rc_t CC KColumnBlobCommit ( KColumnBlob *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_column_ */
diff --git a/interfaces/kdb/consistency-check.h b/interfaces/kdb/consistency-check.h
deleted file mode 100644
index 18444e4..0000000
--- a/interfaces/kdb/consistency-check.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#ifndef _h_kdb_consistency_check_
-#define _h_kdb_consistency_check_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_insdc_sra_
-#include <insdc/sra.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-    
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDatabase;
-struct KTable;
-struct KColumn;
-
-
-/*--------------------------------------------------------------------------
- * CCReportTypes
- */
-enum
-{
-    ccrpt_Done,
-    ccrpt_MD5,
-    ccrpt_Blob,
-    ccrpt_Index,
-    ccrpt_Visit
-};
-
-
-/*--------------------------------------------------------------------------
- * CCReportInfoBlock
- */
-typedef struct CCReportInfoBlock CCReportInfoBlock;
-struct CCReportInfoBlock
-{
-    const char *objName;
-    uint32_t objId;
-    uint32_t objType;
-    uint32_t type;
-
-    union
-    {
-        struct /* ccrb_done_s */
-        {
-            const char *mesg;
-            rc_t rc;
-        } done;
-
-        struct ccrb_md5_s
-        {
-            const char *file;
-            rc_t rc;
-        } MD5;
-
-        struct ccrb_blob_s
-        {
-            uint64_t start;
-            uint64_t count;
-
-        } blob;
-
-        struct ccrb_index_s
-        {
-            int64_t start_id;
-            uint64_t id_range;
-            uint64_t num_keys;
-            uint64_t num_rows;
-            uint64_t num_holes;
-
-        } index;
-        
-        struct ccrb_visit_s {
-            unsigned depth;
-        } visit;
-    } info;
-};
-
-typedef rc_t ( CC *CCReportFunc ) ( const CCReportInfoBlock *info, void *data );
-
-/* a flag for level parameter */
-#define CC_INDEX_ONLY 0x80000000
-
-/*--------------------------------------------------------------------------
- * KDatabase
- */
-KDB_EXTERN rc_t CC KDatabaseConsistencyCheck ( struct KDatabase const *self,
-    uint32_t depth, uint32_t level, CCReportFunc report, void *data );
-
-
-/*--------------------------------------------------------------------------
- * KTable
- */
-KDB_EXTERN rc_t CC KTableConsistencyCheck ( struct KTable const *self,
-    uint32_t depth, uint32_t level, CCReportFunc report, void *data,
-    INSDC_SRA_platform_id platform);
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- */
-KDB_EXTERN rc_t CC KColumnConsistencyCheck ( struct KColumn const *self,
-    uint32_t level, CCReportInfoBlock *info, CCReportFunc report, void *data );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_consistency_check_ */
diff --git a/interfaces/kdb/database.h b/interfaces/kdb/database.h
deleted file mode 100644
index af65ebb..0000000
--- a/interfaces/kdb/database.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_database_
-#define _h_kdb_database_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDBManager;
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  opaque connection to a database within file system
- */
-typedef struct KDatabase KDatabase;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KDatabaseAddRef ( const KDatabase *self );
-KDB_EXTERN rc_t CC KDatabaseRelease ( const KDatabase *self );
-
-
-/* CreateDB
- * VCreateDB
- *  create a new or open an existing database
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-KDB_EXTERN rc_t CC KDBManagerCreateDB ( struct KDBManager *self,
-    KDatabase **db, KCreateMode cmode, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseCreateDB ( KDatabase *self,
-    KDatabase **db, KCreateMode cmode, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVCreateDB ( struct KDBManager *self,
-    KDatabase **db, KCreateMode cmode, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVCreateDB ( KDatabase *self,
-    KDatabase **db, KCreateMode cmode, const char *name, va_list args );
-
-
-/* OpenDBRead
- * VOpenDBRead
- *  open a database for read
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-KDB_EXTERN rc_t CC KDBManagerOpenDBRead ( struct KDBManager const *self,
-    const KDatabase **db, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseOpenDBRead ( const KDatabase *self,
-    const KDatabase **db, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenDBRead ( struct KDBManager const *self,
-    const KDatabase **db, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVOpenDBRead ( const KDatabase *self,
-    const KDatabase **db, const char *name, va_list args );
-
-
-/* OpenDBUpdate
- * VOpenDBUpdate
- *  open a database for read/write
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-KDB_EXTERN rc_t CC KDBManagerOpenDBUpdate ( struct KDBManager *self,
-    KDatabase **db, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseOpenDBUpdate ( KDatabase *self,
-    KDatabase **db, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenDBUpdate ( struct KDBManager *self,
-    KDatabase **db, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVOpenDBUpdate ( KDatabase *self,
-    KDatabase **db, const char *name, va_list args );
-
-
-/* Locked
- *  returns true if locked
- */
-KDB_EXTERN bool CC KDatabaseLocked ( const KDatabase *self );
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-KDB_EXTERN bool CC KDatabaseExists ( const KDatabase *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN bool CC KDatabaseVExists ( const KDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-KDB_EXTERN bool CC KDatabaseIsAlias ( const KDatabase *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name );
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDatabaseWritable ( const KDatabase *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KDatabaseVWritable ( const KDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDatabaseLock ( KDatabase *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KDatabaseVLock ( KDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDatabaseUnlock ( KDatabase *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KDatabaseVUnlock ( KDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving name of contained object
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new name
- */
-KDB_EXTERN rc_t CC KDatabaseRenameDB ( KDatabase *self, bool force, const char *from, const char *to );
-KDB_EXTERN rc_t CC KDatabaseRenameTable ( KDatabase *self, bool force, const char *from, const char *to );
-KDB_EXTERN rc_t CC KDatabaseRenameIndex ( KDatabase *self, bool force, const char *from, const char *to );
-
-
-/* Alias
- *  create an alias to an existing contained object
- *
- *  "obj" [ IN ] - NUL terminated string in UTF-8
- *  giving name of contained object
- *
- *  "alias" [ IN ] - NUL terminated string in UTF-8
- *  giving aliased name
- */
-KDB_EXTERN rc_t CC KDatabaseAliasDB ( KDatabase *self, const char *obj, const char *alias );
-KDB_EXTERN rc_t CC KDatabaseAliasTable ( KDatabase *self, const char *obj, const char *alias );
-KDB_EXTERN rc_t CC KDatabaseAliasIndex ( KDatabase *self, const char *obj, const char *alias );
-
-
-/* Drop
- *  drop a contained object
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving name of db
- */
-KDB_EXTERN rc_t CC KDatabaseDropDB ( KDatabase *self, const char *name, ... );
-KDB_EXTERN rc_t CC KDatabaseDropTable ( KDatabase *self, const char *name, ... );
-KDB_EXTERN rc_t CC KDatabaseDropIndex ( KDatabase *self, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDatabaseVDropDB ( KDatabase *self, const char *name, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVDropTable ( KDatabase *self, const char *name, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVDropIndex ( KDatabase *self, const char *name, va_list args );
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KDatabaseOpenManagerRead ( const KDatabase *self, struct KDBManager const **mgr );
-KDB_EXTERN rc_t CC KDatabaseOpenManagerUpdate ( KDatabase *self, struct KDBManager **mgr );
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par );
-KDB_EXTERN rc_t CC KDatabaseOpenParentUpdate ( KDatabase *self, KDatabase **par );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_database_ */
diff --git a/interfaces/kdb/extern.h b/interfaces/kdb/extern.h
deleted file mode 100644
index 2f8e0d0..0000000
--- a/interfaces/kdb/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_extern_
-#define _h_kdb_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define KDB_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KDB_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kdb_extern_ */
diff --git a/interfaces/kdb/index.h b/interfaces/kdb/index.h
deleted file mode 100644
index 3a36bc3..0000000
--- a/interfaces/kdb/index.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_index_
-#define _h_kdb_index_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct PBSTNode;
-struct KDatabase;
-
-
-/*--------------------------------------------------------------------------
- * KIdxType
- *  the type of index being dealt with
- */
-typedef uint8_t KIdxType;
-enum
-{
-    /* version 1 */
-
-    kitText,          /* text string => id */
-    kitU64,           /* uint64 (like file offset) to row id */
-
-    kitProj = 128     /* reverse index flag, row id => key */
-};
-
-
-/*--------------------------------------------------------------------------
- * KIndex
- *  an object capable of mapping an object to integer oid
- */
-typedef struct KIndex KIndex;
-
-
-/* Addref
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KIndexAddRef ( const KIndex *self );
-KDB_EXTERN rc_t CC KIndexRelease ( const KIndex *self );
-
-
-/* CreateIndex
- * VCreateIndex
- *  create a new or open an existing index
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "type" [ IN ] - type of index to create
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-KDB_EXTERN rc_t CC KDatabaseCreateIndex ( struct KDatabase *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... );
-KDB_EXTERN rc_t CC KTableCreateIndex ( struct KTable *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDatabaseVCreateIndex ( struct KDatabase *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args );
-KDB_EXTERN rc_t CC KTableVCreateIndex ( struct KTable *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args );
-
-
-/* OpenIndexRead
- * VOpenIndexRead
- *  open an index for read
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-KDB_EXTERN rc_t CC KDatabaseOpenIndexRead ( struct KDatabase const *self,
-    const KIndex **idx, const char *name, ... );
-KDB_EXTERN rc_t CC KTableOpenIndexRead ( struct KTable const *self,
-    const KIndex **idx, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDatabaseVOpenIndexRead ( struct KDatabase const *self,
-    const KIndex **idx, const char *name, va_list args );
-KDB_EXTERN rc_t CC KTableVOpenIndexRead ( struct KTable const *self,
-    const KIndex **idx, const char *name, va_list args );
-
-
-/* OpenIndexUpdate
- * VOpenIndexUpdate
- *  open an index for read/write
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-
-KDB_EXTERN rc_t CC KDatabaseOpenIndexUpdate ( struct KDatabase *self,
-    KIndex **idx, const char *name, ... );
-KDB_EXTERN rc_t CC KTableOpenIndexUpdate ( struct KTable *self,
-    KIndex **idx, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDatabaseVOpenIndexUpdate ( struct KDatabase *self,
-    KIndex **idx, const char *name, va_list args );
-KDB_EXTERN rc_t CC KTableVOpenIndexUpdate ( struct KTable *self,
-    KIndex **idx, const char *name, va_list args );
-
-
-/* Locked
- *  returns true if locked
- */
-KDB_EXTERN bool CC KIndexLocked ( const KIndex *self );
-
-
-/* Version
- *  returns the format version
- */
-KDB_EXTERN rc_t CC KIndexVersion ( const KIndex *self, uint32_t *version );
-
-
-/* Type
- *  returns the type of index
- */
-KDB_EXTERN rc_t CC KIndexType ( const KIndex *self, KIdxType *type );
-
-
-/* Commit
- *  ensure any changes are committed to disk
- */
-KDB_EXTERN rc_t CC KIndexCommit ( KIndex *self );
-
-
-/* CheckConsistency
- *  run a consistency check on the open index
- *
- *  "level" [ IN ] - a measure of rigor of the exercise:
- *    0 is the lightest
- *    1 will test all id mappings
- *    2 will perform key->id retrievals
- *    3 will perform id->key retrievals if a projection index exists
- *
- *  "start_id" [ OUT, NULL OKAY ] - returns the first id in index
- *
- *  "id_range" [ OUT, NULL OKAY ] - returns the range of ids from first to last
- *
- *  "num_keys" [ OUT, NULL OKAY ] - returns the number of key entries
- *
- *  "num_rows" [ OUT, NULL OKAY ] - returns the number of key->id mappings
- *
- *  "num_holes" [ OUT, NULL OKAY ] - returns the number of holes in the mapped id range
- */
-KDB_EXTERN rc_t CC KIndexConsistencyCheck ( const KIndex *self, uint32_t level,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes );
-
-
-/* Insert
- *  creates a mapping from key to id
- *  and potentially from id to key if supported
- *
- *  "unique" [ IN ] - if true, key must be unique
- *
- *  "key" [ IN ] - NUL terminated string for text
- *
- *  "id" [ IN ] - id
- */
-KDB_EXTERN rc_t CC KIndexInsertText ( KIndex *self, bool unique,
-    const char *key, int64_t id );
-
-/* Delete
- *  deletes all mappings from key
- */
-KDB_EXTERN rc_t CC KIndexDeleteText ( KIndex *self, const char *key );
-
-/* Find
- *  finds a single mapping from key
- *
- *  "key" [ IN ] - NUL terminated string to be found
- *
- *  "start_id" [ OUT ] - starting id of found range
- *
- *  "id_count [ OUT, NULL OKAY ] - the number of contiguous
- *  row ids in found range
- *
- *  "custom_cmp" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ]
- *  optional comparison function for search
- */
-KDB_EXTERN rc_t CC KIndexFindText ( const KIndex *self,
-    const char *key, int64_t *start_id, uint64_t *id_count,
-    int ( CC * custom_cmp ) ( const void *item,
-        struct PBSTNode const *n, void *data ),
-    void *data );
-
-/* FindAll
- *  finds all mappings from key
- */
-KDB_EXTERN rc_t CC KIndexFindAllText ( const KIndex *self, const char *key,
-    rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, void *data ),
-    void *data );
-
-/* Project
- *  finds key(s) mapping to value/id if supported
- *
- *  "id" [ IN ] - row id to be located
- *
- *  "start_id [ OUT, NULL OKAY ] - the first id of found range
- *
- *  "id_count [ OUT, NULL OKAY ] - the number of contiguous
- *  row ids in found range
- *
- *  "key" [ OUT ] and "kmax" [ IN ] - return buffer
- *  for NUL terminated index text
- *
- *  "actsize" [ OUT, NULL OKAY ] - returns key size in bytes,
- *   excluding NUL termination
- *
- *  returns rcBuffer, rcInsufficient
- *  if kmax <= strlen ( key )
- */
-KDB_EXTERN rc_t CC KIndexProjectText ( const KIndex *self,
-    int64_t id, int64_t *start_id, uint64_t *id_count,
-    char *key, size_t kmax, size_t *actsize );
-
-
-/* ProjectAll
- *  finds key(s) mapping to value/id if supported
- */
-KDB_EXTERN rc_t CC KIndexProjectAllText ( const KIndex *self, int64_t id,
-    rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, const char *key, void *data ),
-    void *data );
-
-
-/* InsertU64
- *  creates a mapping from an (file) offset range to an id range
- *
- *  "unique" [ IN ] - if true, key ranges cannot overlap
- *
- *  "key" [ IN ] - offset (in file)
- *
- *  "key_size" [ IN ] - size of chunk (in file)
- *
- *  "start_id" [ IN ] - starting id 
- *
- *  "id_count" [ IN ] - number of ids in chunk
- */
-KDB_EXTERN rc_t CC KIndexInsertU64 ( KIndex *self, bool unique,
-    uint64_t key, uint64_t key_size, int64_t start_id, uint64_t id_count );
-
-/* DeleteU64
- *  deletes all mappings from key
- */
-KDB_EXTERN rc_t CC KIndexDeleteU64 ( KIndex *self, uint64_t key );
-
-/* FindU64
- *  finds a FIRST chunk by offset with in file
- */
-KDB_EXTERN rc_t CC KIndexFindU64 ( const KIndex *self, uint64_t offset,
-    uint64_t *key, uint64_t *key_size, int64_t *start_id, uint64_t *id_count );
-
-/* FindAllU64
- *  Iterate through all chunks with an offset and call f() for each range
- */
-KDB_EXTERN rc_t CC KIndexFindAllU64 ( const KIndex *self, uint64_t offset,
-    rc_t ( CC * f ) ( uint64_t key, uint64_t key_size,
-        int64_t start_id, uint64_t id_count, void *data ),
-    void *data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_index_ */
diff --git a/interfaces/kdb/kdb-priv.h b/interfaces/kdb/kdb-priv.h
deleted file mode 100644
index 3f81b34..0000000
--- a/interfaces/kdb/kdb-priv.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_kdb_priv_
-#define _h_kdb_kdb_priv_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h> /* va_list */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDBManager;
-struct KDatabase;
-struct KTable;
-struct KIndex;
-struct KColumn;
-struct KMetadata;
-struct KDirectory;
-struct VFSManager;
-
-
-/*--------------------------------------------------------------------------
- * KDBManager
- */
-
-/* ModDate
- *  return a modification timestamp for table
- */
-KDB_EXTERN rc_t CC KDBManagerGetTableModDate ( struct KDBManager const *self,
-    KTime_t *mtime, const char *path, ... );
-KDB_EXTERN rc_t CC KDBManagerVGetTableModDate ( struct KDBManager const *self,
-    KTime_t *mtime, const char *path, va_list args );
-
-
-/* Make using custom VFSManager */
-KDB_EXTERN rc_t CC KDBManagerMakeReadWithVFSManager (
-    const struct KDBManager **mgrp, const struct KDirectory *wd,
-    struct VFSManager *vmanager );
-
-KDB_EXTERN rc_t CC KDBManagerGetVFSManager ( const struct KDBManager *self,
-    const struct VFSManager **vmanager );
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- */
-
-/* OpenDirectory
- *  access the directory in use
- */
-KDB_EXTERN rc_t CC KDatabaseOpenDirectoryRead ( struct KDatabase const *self, struct KDirectory const **dir );
-KDB_EXTERN rc_t CC KDatabaseOpenDirectoryUpdate ( struct KDatabase *self, struct KDirectory **dir );
-
-/* GetPath
- *  return the absolute path to DB
- */
-KDB_EXTERN rc_t CC KDatabaseGetPath ( struct KDatabase const *self,
-    const char **path );
-
-
-/*--------------------------------------------------------------------------
- * KTable
- */
-
-/* OpenDirectory
- *  access the directory in use
- */
-KDB_EXTERN rc_t CC KTableOpenDirectoryRead ( struct KTable const *self, struct KDirectory const **dir );
-KDB_EXTERN rc_t CC KTableOpenDirectoryUpdate ( struct KTable *self, struct KDirectory **dir );
-
-#define KTableGetDirectoryRead KTableOpenDirectoryRead
-#define KTableGetDirectoryUpdate KTableOpenDirectoryUpdate
-
-/* GetPath
- *  return the absolute path to table
- */
-KDB_EXTERN rc_t CC KTableGetPath ( struct KTable const *self,
-    const char **path );
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- */
-
-/* OpenDirectory
- *  duplicate reference to the directory in use
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KColumnOpenDirectoryRead ( struct KColumn const *self, struct KDirectory const **dir );
-KDB_EXTERN rc_t CC KColumnOpenDirectoryUpdate ( struct KColumn *self, struct KDirectory **dir );
-
-#define KColumnGetDirectoryRead KColumnOpenDirectoryRead
-#define KColumnGetDirectoryUpdate KColumnOpenDirectoryUpdate
-
-
-
-/*--------------------------------------------------------------------------
- * KIndex
- */
-
-/* MarkModified
- *  make the index think it has been modified, such that it may be committed
- *  useful when forcing conversion from an older version
- */
-KDB_EXTERN rc_t CC KIndexMarkModified ( struct KIndex *self );
-
-
-/* SetMaxId
- *  certain legacy versions of skey were built to know only the starting id
- *  of the NAME_FMT column, but were never given a maximum id. allow them
- *  to be corrected here.
- */
-KDB_EXTERN void CC KIndexSetMaxRowId ( struct KIndex const *self, int64_t max_row_id );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_kdb_priv_ */
diff --git a/interfaces/kdb/manager.h b/interfaces/kdb/manager.h
deleted file mode 100644
index 48576a3..0000000
--- a/interfaces/kdb/manager.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_manager_
-#define _h_kdb_manager_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-/* #ifndef _h_kfs_directory_ */
-/* #include <kfs/directory.h> */
-/* #endif */
-#include <kfs/defs.h> /* kpt types */
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct VPath;
-struct KDirectory;
-
-/*--------------------------------------------------------------------------
- * KDBPathType
- *  extends KPathType from <kfs/defs.h>
- */
-enum
-{
-    /* must be handled carefully and can not go back to KDirectory 
-     * as this value has a different meaning in KDirectory */
-    kptAny = 0,
-    kptDatabase = kptLastDefined,
-    kptTable,
-    kptIndex,
-    kptColumn,
-
-    /* these values may not be used in KDBManagerExists below */
-    kptMetadata,
-    kptPrereleaseTbl
-};
-
-
-/*--------------------------------------------------------------------------
- * KDBManager
- *  opaque handle to library
- */
-typedef struct KDBManager KDBManager;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KDBManagerAddRef ( const KDBManager *self );
-KDB_EXTERN rc_t CC KDBManagerRelease ( const KDBManager *self );
-
-
-/* MakeRead
- * MakeUpdate
- *  create library handle for specific use
- *  NB - only one of the functions will be implemented
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- */
-KDB_EXTERN rc_t CC KDBManagerMakeRead ( const KDBManager **mgr, const struct KDirectory *wd );
-KDB_EXTERN rc_t CC KDBManagerMakeUpdate ( KDBManager **mgr, struct KDirectory *wd );
-
-
-/* Version
- *  returns the library version
- */
-KDB_EXTERN rc_t CC KDBManagerVersion ( const KDBManager *self, uint32_t *version );
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *
- *  "path" [ IN ] - NUL terminated path
- *
- * DEPRECATED:
- * Should use KDBManagerPathType for reduced network thrashing.
- */
-KDB_EXTERN bool CC KDBManagerExists ( const KDBManager *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN bool CC KDBManagerVExists ( const KDBManager *self, uint32_t type,
-    const char *name, va_list args );
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDBManagerWritable ( const KDBManager *self,
-    const char *path, ... );
-KDB_EXTERN rc_t CC KDBManagerVWritable ( const KDBManager *self,
-    const char *path, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDBManagerLock ( KDBManager *self, const char *path, ... );
-KDB_EXTERN rc_t CC KDBManagerVLock ( KDBManager *self, const char *path, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KDBManagerUnlock ( KDBManager *self, const char *path, ... );
-KDB_EXTERN rc_t CC KDBManagerVUnlock ( KDBManager *self, const char *path, va_list args );
-
-
-/* Drop
- *  drop an object based on its path
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to the kdb object
- */
-KDB_EXTERN rc_t CC KDBManagerDrop ( KDBManager *self, uint32_t obj_type, const char *path, ... );
-KDB_EXTERN rc_t CC KDBManagerVDrop ( KDBManager *self, uint32_t obj_type, const char *path, va_list args );
-
-
-/* RunPeriodicTasks
- *  executes periodic tasks, such as cache flushing
- */
-KDB_EXTERN rc_t CC KDBManagerRunPeriodicTasks ( const KDBManager *self );
-
-
-/* PathType
- *  check the path type of an object/directory path.
- *  this is an extension of the KDirectoryPathType and will return
- *  the KDirectory values if a path type is not specifically a
- *  kdb object
- */
-KDB_EXTERN int CC KDBManagerPathTypeVP ( const KDBManager * self, const struct VPath * path );
-KDB_EXTERN int CC KDBManagerPathType   ( const KDBManager * self, const char *path, ... );
-KDB_EXTERN int CC KDBManagerVPathType  ( const KDBManager * self, const char *path, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_manager_ */
diff --git a/interfaces/kdb/meta.h b/interfaces/kdb/meta.h
deleted file mode 100644
index cee3ed7..0000000
--- a/interfaces/kdb/meta.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_meta_
-#define _h_kdb_meta_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct KColumn;
-struct KDatabase;
-
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-typedef struct KMetadata KMetadata;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KMetadataAddRef ( const KMetadata *self );
-KDB_EXTERN rc_t CC KMetadataRelease ( const KMetadata *self );
-
-
-/* OpenMetadataRead
- *  opens metadata for read
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-KDB_EXTERN rc_t CC KDatabaseOpenMetadataRead ( struct KDatabase const *self,
-    const KMetadata **meta );
-KDB_EXTERN rc_t CC KTableOpenMetadataRead ( struct KTable const *self,
-    const KMetadata **meta );
-KDB_EXTERN rc_t CC KColumnOpenMetadataRead ( struct KColumn const *self,
-    const KMetadata **meta );
-
-/* OpenMetadataUpdate
- *  open metadata for read/write
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-KDB_EXTERN rc_t CC KDatabaseOpenMetadataUpdate ( struct KDatabase *self,
-    KMetadata **meta );
-KDB_EXTERN rc_t CC KTableOpenMetadataUpdate ( struct KTable *self,
-    KMetadata **meta );
-KDB_EXTERN rc_t CC KColumnOpenMetadataUpdate ( struct KColumn *self,
-    KMetadata **meta );
-
-
-/* Version
- *  returns the metadata format version
- */
-KDB_EXTERN rc_t CC KMetadataVersion ( const KMetadata *self, uint32_t *version );
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-KDB_EXTERN rc_t CC KMetadataByteOrder ( const KMetadata *self, bool *reversed );
-
-
-/* Revision
- *  returns current revision number
- *  where 0 ( zero ) means tip
- */
-KDB_EXTERN rc_t CC KMetadataRevision ( const KMetadata *self, uint32_t *revision );
-
-
-/* MaxRevision
- *  returns the maximum revision available
- */
-KDB_EXTERN rc_t CC KMetadataMaxRevision ( const KMetadata *self, uint32_t *revision );
-
-
-/* Commit
- *  ensure any changes are committed to disk
- */
-KDB_EXTERN rc_t CC KMetadataCommit ( KMetadata *self );
-
-
-/* Freeze
- *  freezes current metadata revision
- *  further modification will begin on a copy
- */
-KDB_EXTERN rc_t CC KMetadataFreeze ( KMetadata *self );
-
-
-/* OpenRevision
- *  opens a read-only indexed revision of metadata
- */
-KDB_EXTERN rc_t CC KMetadataOpenRevision ( const KMetadata *self,
-    const KMetadata **meta, uint32_t revision );
-
-
-/* GetSequence
- * SetSequence
- * NextSequence
- *  access a named sequence
- *
- *  "seq" [ IN ] - NUL terminated sequence name
- *
- *  "val" [ OUT ] - return parameter for sequence value
- *  "val" [ IN ] - new sequence value
- */
-KDB_EXTERN rc_t CC KMetadataGetSequence ( const KMetadata *self,
-    const char *seq, int64_t *val );
-KDB_EXTERN rc_t CC KMetadataSetSequence ( KMetadata *self,
-    const char *seq, int64_t val );
-KDB_EXTERN rc_t CC KMetadataNextSequence ( KMetadata *self,
-    const char *seq, int64_t *val );
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- *  a node with an optional value,
- *  optional attributes, and optional children
- *
- *  nodes are identified by path, relative to a starting node,
- *  where "/" serves as a path separator.
- */
-typedef struct KMDataNode KMDataNode;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KMDataNodeAddRef ( const KMDataNode *self );
-KDB_EXTERN rc_t CC KMDataNodeRelease ( const KMDataNode *self );
-
-
-/* OpenNodeRead
- * VOpenNodeRead
- *  opens a metadata node
- *
- *  "node" [ OUT ] - return parameter for indicated metadata node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within metadata hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-KDB_EXTERN rc_t CC KMetadataOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, ... );
-KDB_EXTERN rc_t CC KMDataNodeOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, ... );
-
-KDB_EXTERN rc_t CC KMetadataVOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, va_list args );
-KDB_EXTERN rc_t CC KMDataNodeVOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, va_list args );
-
-
-/* OpenNodeUpdate
- * VOpenNodeUpdate
- *  opens a metadata node
- *
- *  "node" [ OUT ] - return parameter for indicated metadata node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within metadata hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-KDB_EXTERN rc_t CC KMetadataOpenNodeUpdate ( KMetadata *self,
-    KMDataNode **node, const char *path, ... );
-KDB_EXTERN rc_t CC KMDataNodeOpenNodeUpdate ( KMDataNode *self,
-    KMDataNode **node, const char *path, ... );
-
-KDB_EXTERN rc_t CC KMetadataVOpenNodeUpdate ( KMetadata *self,
-    KMDataNode **node, const char *path, va_list args );
-KDB_EXTERN rc_t CC KMDataNodeVOpenNodeUpdate ( KMDataNode *self,
-    KMDataNode **node, const char *path, va_list args );
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-KDB_EXTERN rc_t CC KMDataNodeByteOrder ( const KMDataNode *self, bool *reversed );
-
-
-/* Read
- *  read a node value
- *
- *  "offset" [ IN ] - initial offset into metadata
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read.
- *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
- */
-KDB_EXTERN rc_t CC KMDataNodeRead ( const KMDataNode *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining );
-
-
-/* Write
- *  write a node value or attribute
- *  overwrites anything already there
- *
- *  "buffer" [ IN ] and "size" [ IN ] - new value data
- */
-KDB_EXTERN rc_t CC KMDataNodeWrite ( KMDataNode *self, const void *buffer, size_t size );
-
-
-/* Append
- *  append data to value
- *
- *  "buffer" [ IN ] and "size" [ IN ] - value data to be appended
- */
-KDB_EXTERN rc_t CC KMDataNodeAppend ( KMDataNode *self, const void *buffer, size_t size );
-
-
-/* Read ( formatted )
- *  reads as integer or float value in native byte order
- *
- *  "bXX" [ OUT ] - return parameter for numeric value
- */
-KDB_EXTERN rc_t CC KMDataNodeReadB8 ( const KMDataNode *self, void *b8 );
-KDB_EXTERN rc_t CC KMDataNodeReadB16 ( const KMDataNode *self, void *b16 );
-KDB_EXTERN rc_t CC KMDataNodeReadB32 ( const KMDataNode *self, void *b32 );
-KDB_EXTERN rc_t CC KMDataNodeReadB64 ( const KMDataNode *self, void *b64 );
-KDB_EXTERN rc_t CC KMDataNodeReadB128 ( const KMDataNode *self, void *b128 );
-
-
-/* ReadAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-KDB_EXTERN rc_t CC KMDataNodeReadAsI16 ( const KMDataNode *self, int16_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAsU16 ( const KMDataNode *self, uint16_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAsI32 ( const KMDataNode *self, int32_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAsU32 ( const KMDataNode *self, uint32_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAsI64 ( const KMDataNode *self, int64_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAsU64 ( const KMDataNode *self, uint64_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAsF64 ( const KMDataNode *self, double *f );
-
-
-/* Read ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-KDB_EXTERN rc_t CC KMDataNodeReadCString ( const KMDataNode *self,
-    char *buffer, size_t bsize, size_t *size );
-
-
-/* Write ( formatted )
- *  writes integer or float value in metadata byte order
- *
- *  "bXX" [ IN ] - numeric value
- */
-KDB_EXTERN rc_t CC KMDataNodeWriteB8 ( KMDataNode *self, const void *b8 );
-KDB_EXTERN rc_t CC KMDataNodeWriteB16 ( KMDataNode *self, const void *b16 );
-KDB_EXTERN rc_t CC KMDataNodeWriteB32 ( KMDataNode *self, const void *b32 );
-KDB_EXTERN rc_t CC KMDataNodeWriteB64 ( KMDataNode *self, const void *b64 );
-KDB_EXTERN rc_t CC KMDataNodeWriteB128 ( KMDataNode *self, const void *b128 );
-
-
-/* Write ( formatted )
- *  writes string
- *
- *  "str" [ IN ] - NUL terminated string.
- */
-KDB_EXTERN rc_t CC KMDataNodeWriteCString ( KMDataNode *self, const char *str );
-
-
-/* ReadAttr
- *  reads as NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-KDB_EXTERN rc_t CC KMDataNodeReadAttr ( const KMDataNode *self, const char *name,
-    char *buffer, size_t bsize, size_t *size );
-
-
-/* WriteAttr
- *  writes NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "value" [ IN ] - NUL terminated attribute value
- */
-KDB_EXTERN rc_t CC KMDataNodeWriteAttr ( KMDataNode *self,
-    const char *name, const char *value );
-
-
-/* ReadAttrAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsI16 ( const KMDataNode *self, const char *attr, int16_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsU16 ( const KMDataNode *self, const char *attr, uint16_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsI32 ( const KMDataNode *self, const char *attr, int32_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsU32 ( const KMDataNode *self, const char *attr, uint32_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsI64 ( const KMDataNode *self, const char *attr, int64_t *i );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsU64 ( const KMDataNode *self, const char *attr, uint64_t *u );
-KDB_EXTERN rc_t CC KMDataNodeReadAttrAsF64 ( const KMDataNode *self, const char *attr, double *f );
-
-
-/* Drop
- * VDrop
- *  drop some or all node content
- */
-KDB_EXTERN rc_t CC KMDataNodeDropAll ( KMDataNode *self );
-KDB_EXTERN rc_t CC KMDataNodeDropAttr ( KMDataNode *self, const char *attr );
-KDB_EXTERN rc_t CC KMDataNodeDropChild ( KMDataNode *self, const char *path, ... );
-KDB_EXTERN rc_t CC KMDataNodeVDropChild ( KMDataNode *self, const char *path, va_list args );
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving simple name of existing attr
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new simple attr name
- */
-KDB_EXTERN rc_t CC KMDataNodeRenameAttr ( KMDataNode *self, const char *from, const char *to );
-KDB_EXTERN rc_t CC KMDataNodeRenameChild ( KMDataNode *self, const char *from, const char *to );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_meta_ */
diff --git a/interfaces/kdb/meta.hpp b/interfaces/kdb/meta.hpp
deleted file mode 100644
index ca2d9a9..0000000
--- a/interfaces/kdb/meta.hpp
+++ /dev/null
@@ -1,487 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kdb_meta_
-#define _hpp_kdb_meta_
-
-#ifndef _h_kdb_meta_
-#include <kdb/meta.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-struct KMetadata
-{
-    /* AddRef
-     * Release
-     *  all objects are reference counted
-     *  NULL references are ignored
-     */
-    inline rc_t AddRef () const throw()
-    { return KMetadataAddRef ( this ); }
-
-    inline rc_t Release () const  throw()
-    { return KMetadataRelease ( this ); }
-
-
-    /* OpenNodeRead
-     *  opens a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for indicated metadata node
-     *
-     *  "path" [ IN, NULL OKAY ] - optional path for specifying named
-     *  node within metadata hierarchy. paths will be interpreted as
-     *  if they were file system paths, using '/' as separator. the
-     *  special values NULL and "" are interpreted as "."
-     */
-    inline rc_t OpenNodeRead ( const KMDataNode **node, 
-        const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KMetadataVOpenNodeRead ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenNodeRead ( const KMDataNode **node, 
-        const char *path, va_list args ) const throw()
-    { return KMetadataVOpenNodeRead ( this, node, path, args ); }
-
-
-    /* OpenNodeUpdate
-     *  opens a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for indicated metadata node
-     *
-     *  "path" [ IN, NULL OKAY ] - optional path for specifying named
-     *  node within metadata hierarchy. paths will be interpreted as
-     *  if they were file system paths, using '/' as separator. the
-     *  special values NULL and "" are interpreted as "."
-     */
-    inline rc_t OpenNodeUpdate ( KMDataNode **node, 
-        const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KMetadataVOpenNodeUpdate ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenNodeUpdate ( KMDataNode **node, 
-        const char *path, va_list args ) throw()
-    { return KMetadataVOpenNodeUpdate ( this, node, path, args ); }
-
-
-    /* Version
-     *  returns the metadata format version
-     */
-    inline rc_t Version ( uint32_t *version ) const  throw()
-    { return KMetadataVersion ( this, version ); }
-
-
-    /* ByteOrder
-     *  indicates whether original byte order is reversed
-     *  under current architecture.
-     *
-     *  the byte order of the column is established by
-     *  the host architecture when created.
-     *
-     *  "reversed" [ OUT ] - if true, the original byte
-     *  order is reversed with regard to host native byte order.
-     */
-    inline rc_t ByteOrder ( bool *reversed ) const throw()
-    { return KMetadataByteOrder ( this, reversed ); }
-
-
-    /* Revision
-     *  returns current revision number
-     *  where 0 ( zero ) means tip
-     */
-    inline rc_t Revision ( uint32_t *revision ) const throw()
-    { return KMetadataRevision ( this, revision ); }
-
-
-    /* MaxRevision
-     *  returns the maximum revision available
-     */
-    inline rc_t MaxRevision ( uint32_t *revision ) const throw()
-    { return KMetadataMaxRevision ( this, revision ); }
-
-
-    /* Commit
-     *  ensure any changes are committed to disk
-     */
-    inline rc_t Commit () throw()
-    { return KMetadataCommit ( this ); }
-
-
-    /* Freeze
-     *  freezes current metadata revision
-     *  further modification will begin on a copy
-     */
-    inline rc_t Freeze () throw()
-    { return KMetadataFreeze ( this ); }
-
-
-    /* OpenRevision
-     *  opens a read-only indexed revision of metadata
-     */
-    inline rc_t OpenRevision ( const KMetadata **meta, uint32_t revision ) const throw()
-    { return KMetadataOpenRevision ( this, meta, revision ); }
-
-
-    /* GetSequence
-     * SetSequence
-     * NextSequence
-     *  access a named sequence
-     *
-     *  "seq" [ IN ] - NUL terminated sequence name
-     *
-     *  "val" [ OUT ] - return parameter for sequence value
-     *  "val" [ IN ] - new sequence value
-     */
-    inline rc_t GetSequence ( const char *seq, int64_t *val ) const throw()
-    { return KMetadataGetSequence ( this, seq, val ); }
-
-    inline rc_t SetSequence ( const char *seq, int64_t val ) throw()
-    { return KMetadataSetSequence ( this, seq, val ); }
-
-    inline rc_t NextSequence ( const char *seq, int64_t *val ) throw()
-    { return KMetadataNextSequence ( this, seq, val ); }
-
-private:
-    KMetadata ();
-    ~ KMetadata ();
-    KMetadata ( const KMetadata& );
-    KMetadata &operator = ( const KMetadata& );
-
-};
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- *  a node with an optional value,
- *  optional attributes, and optional children
- *
- *  nodes are identified by path, relative to a starting node,
- *  where "/" serves as a path separator.
- */
-struct KMDataNode
-{
-    /* AddRef
-     * Release
-     *  ignores NULL references
-     */
-    inline rc_t AddRef () const  throw()
-    { return KMDataNodeAddRef ( this ); }
-
-    inline rc_t Release () const  throw()
-    { return KMDataNodeRelease ( this ); }
-
-
-    /* OpenNodeRead
-     * VOpenNodeRead
-     *  opens a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for indicated metadata node
-     *
-     *  "path" [ IN, NULL OKAY ] - optional path for specifying named
-     *  node within metadata hierarchy. paths will be interpreted as
-     *  if they were file system paths, using '/' as separator. the
-     *  special values NULL and "" are interpreted as "."
-     */
-    inline rc_t OpenNodeRead ( const KMDataNode **node,
-        const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KMDataNodeVOpenNodeRead ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenNodeRead ( const KMDataNode **node,
-        const char *path, va_list args ) const throw()
-    { return KMDataNodeVOpenNodeRead ( this, node, path, args ); }
-
-
-    /* OpenNodeUpdate
-     * VOpenNodeUpdate
-     *  opens a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for indicated metadata node
-     *
-     *  "path" [ IN, NULL OKAY ] - optional path for specifying named
-     *  node within metadata hierarchy. paths will be interpreted as
-     *  if they were file system paths, using '/' as separator. the
-     *  special values NULL and "" are interpreted as "."
-     */
-    inline rc_t OpenNodeUpdate ( KMDataNode **node,
-        const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KMDataNodeVOpenNodeUpdate ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenNodeUpdate ( KMDataNode **node,
-        const char *path, va_list args ) throw()
-    { return KMDataNodeVOpenNodeUpdate ( this, node, path, args ); }
-
-
-    /* ByteOrder
-     *  indicates whether original byte order is reversed
-     *  under current architecture.
-     *
-     *  the byte order of the column is established by
-     *  the host architecture when created.
-     *
-     *  "reversed" [ OUT ] - if true, the original byte
-     *  order is reversed with regard to host native byte order.
-     */
-     inline rc_t ByteOrder ( bool *reversed ) const throw()
-     { return KMDataNodeByteOrder ( this, reversed ); }
-
-
-    /* Write
-     *  write a node value or attribute
-     *  overwrites anything already there
-     *
-     *  "buffer" [ IN ] and "size" [ IN ] - new value data
-     */
-     inline rc_t Write ( const void *buffer, size_t size ) throw()
-     { return KMDataNodeWrite ( this, buffer, size ); }
-
-
-     /* Append
-      *  append data to value
-      *
-      *  "buffer" [ IN ] and "size" [ IN ] - value data to be appended
-      */
-     inline rc_t Append ( const void *buffer, size_t size ) throw()
-     { return KMDataNodeAppend ( this, buffer, size ); }
-
-
-    /* Read ( formatted )
-     *  reads as integer or float value in native byte order
-     *
-     *  "bXX" [ OUT ] - return parameter for numeric value
-     */
-     inline rc_t ReadB8 ( void *b8 ) const throw()
-     { return KMDataNodeReadB8 ( this, b8 ); }
-     inline rc_t ReadB16 ( void *b16 ) const throw()
-     { return KMDataNodeReadB16 ( this, b16 ); }
-     inline rc_t ReadB32 ( void *b32 ) const throw()
-     { return KMDataNodeReadB32 ( this, b32 ); }
-     inline rc_t ReadB64 ( void *b64 ) const throw()
-     { return KMDataNodeReadB64 ( this, b64 ); }
-     inline rc_t ReadB128 ( void *b128 ) const throw()
-     { return KMDataNodeReadB128 ( this, b128 ); }
-
-
-    /* Read
-     *  read a node value
-     *
-     *  "offset" [ IN ] - initial offset into metadata
-     *
-     *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
-     *
-     *  "num_read" [ OUT ] - number of bytes actually read
-     *
-     *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
-     *  the number of bytes remaining to be read.
-     *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
-     */
-     inline rc_t Read ( size_t offset, void *buffer, size_t bsize,
-        size_t *num_read, size_t *remaining ) const throw()
-     { return KMDataNodeRead ( this, offset, buffer, bsize, num_read, remaining ); }
-
-
-    /* Read ( formatted )
-     *  reads as integer or float value in native byte order
-     *  casts smaller-sized values to desired size, e.g.
-     *    uint32_t to uint64_t
-     *
-     *  "i" [ OUT ] - return parameter for signed integer
-     *  "u" [ OUT ] - return parameter for unsigned integer
-     *  "f" [ OUT ] - return parameter for double float
-     */
-     inline rc_t Read ( int16_t *value ) const  throw()
-    { return KMDataNodeReadAsI16 ( this, value ); }
-     inline rc_t Read ( uint16_t *value ) const  throw()
-    { return KMDataNodeReadAsU16 ( this, value ); }
-
-     inline rc_t Read ( int32_t *value ) const  throw()
-    { return KMDataNodeReadAsI32 ( this, value ); }
-     inline rc_t Read ( uint32_t *value ) const  throw()
-    { return KMDataNodeReadAsU32 ( this, value ); }
-
-    inline rc_t Read ( int64_t *value ) const  throw()
-    { return KMDataNodeReadAsI64 ( this, value ); }
-    inline rc_t Read ( uint64_t *value ) const  throw()
-    { return KMDataNodeReadAsU64 ( this, value ); }
-
-    inline rc_t Read ( double *value ) const  throw()
-    { return KMDataNodeReadAsF64 ( this, value ); }
-
-
-    /* Read ( formatted )
-     *  reads as C-string
-     *
-     *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
-     *  NUL terminated string.
-     *
-     *  "size" [ OUT ] - return parameter giving size of string
-     *  not including NUL byte. the size is set both upon success
-     *  and insufficient buffer space error.
-     */
-    inline rc_t Read ( char *buffer, size_t bsize, size_t *size ) const  throw()
-    { return KMDataNodeReadCString ( this, buffer, bsize, size ); }
-
-
-    /* Write ( formatted )
-     *  writes integer or float value in metadata byte order
-     *
-     *  "bXX" [ IN ] - numeric value
-     */
-     inline rc_t WriteB8 ( const void *b8 ) throw()
-     { return KMDataNodeWriteB8 ( this, b8 ); }
-     inline rc_t WriteB16 ( const void *b16 ) throw()
-     { return KMDataNodeWriteB16 ( this, b16 ); }
-     inline rc_t WriteB32 ( const void *b32 ) throw()
-     { return KMDataNodeWriteB32 ( this, b32 ); }
-     inline rc_t WriteB64 ( const void *b64 ) throw()
-     { return KMDataNodeWriteB64 ( this, b64 ); }
-     inline rc_t WriteB128 ( const void *b128 ) throw()
-     { return KMDataNodeWriteB128 ( this, b128 ); }
-
-
-    /* Write ( formatted )
-     *  writes string
-     *
-     *  "str" [ IN ] - NUL terminated string.
-     */
-     inline rc_t WriteCString ( const char *str ) throw()
-     { return KMDataNodeWriteCString ( this, str ); }
-
-
-    /* ReadAttr
-     *  reads as NUL-terminated string
-     *
-     *  "name" [ IN ] - NUL terminated attribute name
-     *
-     *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
-     *
-     *  "size" [ OUT ] - return parameter giving size of string
-     *  not including NUL byte. the size is set both upon success
-     *  and insufficient buffer space error.
-     */
-     inline rc_t ReadAttr ( const char *name, char *buffer, 
-        size_t bsize, size_t *size ) const throw()
-     { return KMDataNodeReadAttr ( this, name, buffer, bsize, size ); }
-
-
-    /* WriteAttr
-     *  writes NUL-terminated string
-     *
-     *  "name" [ IN ] - NUL terminated attribute name
-     *
-     *  "value" [ IN ] - NUL terminated attribute value
-     */
-    inline rc_t WriteAttr ( const char *name, const char *value )  throw()
-    { return KMDataNodeWriteAttr ( this, name, value ); }
-
-
-    /* ReadAttrAs ( formatted )
-     *  reads as integer or float value in native byte order
-     *  casts smaller-sized values to desired size, e.g.
-     *    uint32_t to uint64_t
-     *
-     *  "i" [ OUT ] - return parameter for signed integer
-     *  "u" [ OUT ] - return parameter for unsigned integer
-     *  "f" [ OUT ] - return parameter for double float
-     */
-     inline rc_t ReadAttrAsI16 ( const char *attr, int16_t *i ) const throw()
-     { return KMDataNodeReadAttrAsI16 ( this, attr, i ); }
-     inline rc_t ReadAttrAsU16 ( const char *attr, uint16_t *i ) const throw()
-     { return KMDataNodeReadAttrAsU16 ( this, attr, i ); }
-     inline rc_t ReadAttrAsI32 ( const char *attr, int32_t *i ) const throw()
-     { return KMDataNodeReadAttrAsI32 ( this, attr, i ); }
-     inline rc_t ReadAttrAsU32 ( const char *attr, uint32_t *i ) const throw()
-     { return KMDataNodeReadAttrAsU32 ( this, attr, i ); }
-     inline rc_t ReadAttrAsI64 ( const char *attr, int64_t *i ) const throw()
-     { return KMDataNodeReadAttrAsI64 ( this, attr, i ); }
-     inline rc_t ReadAttrAsU64 ( const char *attr, uint64_t *i ) const throw()
-     { return KMDataNodeReadAttrAsU64 ( this, attr, i ); }
-     inline rc_t ReadAttrAsF64 ( const char *attr, double *f ) const throw()
-     { return KMDataNodeReadAttrAsF64 ( this, attr, f ); }
-
-
-     /* Drop
-     *  drop some or all node content
-     */
-     inline rc_t DropAll () throw()
-     { return KMDataNodeDropAll ( this ); }
-     inline rc_t DropAttr ( const char *attr ) throw()
-     { return KMDataNodeDropAttr ( this, attr ); }
-     inline rc_t DropChild ( const char *path, ... ) throw()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KMDataNodeVDropChild ( this, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t DropChild ( const char *path, va_list args ) throw()
-     { return KMDataNodeVDropChild ( this, path, args ); }
-
-
-    /* Rename
-     *  renames a contained object
-     *
-     *  "from" [ IN ] - NUL terminated string in UTF-8
-     *  giving simple name of existing attr
-     *
-     *  "to" [ IN ] - NUL terminated string in UTF-8
-     *  giving new simple attr name
-     */
-    inline rc_t RenameAttr ( const char *from, const char *to ) throw()
-    { return KMDataNodeRenameAttr ( this, from, to ); }
-    inline rc_t RenameChild ( const char *from, const char *to ) throw()
-    { return KMDataNodeRenameChild ( this, from, to ); }
-
-private:
-    KMDataNode ();
-    ~ KMDataNode ();
-    KMDataNode ( const KMDataNode& );
-    KMDataNode &operator = ( const KMDataNode& );
-};
-
-
-#endif // _hpp_kdb_meta_
diff --git a/interfaces/kdb/namelist.h b/interfaces/kdb/namelist.h
deleted file mode 100644
index 68233f4..0000000
--- a/interfaces/kdb/namelist.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_namelist_
-#define _h_kdb_namelist_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct KDatabase;
-struct KMDataNode;
-struct KNamelist;
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-
-/* List
- *  create database listings
- */
-KDB_EXTERN rc_t CC KDatabaseListDB ( struct KDatabase const *self, struct KNamelist **names );
-KDB_EXTERN rc_t CC KDatabaseListTbl ( struct KDatabase const *self, struct KNamelist **names );
-KDB_EXTERN rc_t CC KDatabaseListIdx ( struct KDatabase const *self, struct KNamelist **names );
-
-/* List
- *  create table listings
- */
-KDB_EXTERN rc_t CC KTableListCol ( struct KTable const *self, struct KNamelist **names );
-KDB_EXTERN rc_t CC KTableListIdx ( struct KTable const *self, struct KNamelist **names );
-
-/* List
- *  create metadata node listings
- */
-KDB_EXTERN rc_t CC KMDataNodeListAttr ( struct KMDataNode const *self, struct KNamelist **names );
-KDB_EXTERN rc_t CC KMDataNodeListChildren ( struct KMDataNode const *self, struct KNamelist **names );
-#define KMDataNodeListChild KMDataNodeListChildren
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_namelist_ */
diff --git a/interfaces/kdb/table.h b/interfaces/kdb/table.h
deleted file mode 100644
index 2d1a819..0000000
--- a/interfaces/kdb/table.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_table_
-#define _h_kdb_table_
-
-#ifndef _h_kdb_extern_
-#include <kdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDatabase;
-struct KDBManager;
-
-
-/*--------------------------------------------------------------------------
- * KTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-typedef struct KTable KTable;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KDB_EXTERN rc_t CC KTableAddRef ( const KTable *self );
-KDB_EXTERN rc_t CC KTableRelease ( const KTable *self );
-
-
-/* CreateTable
- * VCreateTable
- *  create a new or open an existing table
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-KDB_EXTERN rc_t CC KDBManagerCreateTable ( struct KDBManager *self,
-    KTable **tbl, KCreateMode cmode, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseCreateTable ( struct KDatabase *self,
-    KTable **tbl, KCreateMode cmode, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVCreateTable ( struct KDBManager *self,
-    KTable **tbl, KCreateMode cmode, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVCreateTable ( struct KDatabase *self,
-    KTable **tbl, KCreateMode cmode, const char *name, va_list args );
-
-
-/* OpenTableRead
- * VOpenTableRead
- *  open a table for read
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-KDB_EXTERN rc_t CC KDBManagerOpenTableRead ( struct KDBManager const *self,
-    const KTable **tbl, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseOpenTableRead ( struct KDatabase const *self,
-    const KTable **tbl, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenTableRead ( struct KDBManager const *self,
-    const KTable **tbl, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVOpenTableRead ( struct KDatabase const *self,
-    const KTable **tbl, const char *name, va_list args );
-
-
-/* OpenTableUpdate
- * VOpenTableUpdate
- *  open a table for read/write
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving name of table
- */
-KDB_EXTERN rc_t CC KDBManagerOpenTableUpdate ( struct KDBManager *self,
-    KTable **tbl, const char *path, ... );
-KDB_EXTERN rc_t CC KDatabaseOpenTableUpdate ( struct KDatabase *self,
-    KTable **tbl, const char *name, ... );
-
-KDB_EXTERN rc_t CC KDBManagerVOpenTableUpdate ( struct KDBManager *self,
-    KTable **tbl, const char *path, va_list args );
-KDB_EXTERN rc_t CC KDatabaseVOpenTableUpdate ( struct KDatabase *self,
-    KTable **tbl, const char *name, va_list args );
-
-
-/* Locked
- *  returns true if table is locked
- */
-KDB_EXTERN bool CC KTableLocked ( const KTable *self );
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN bool CC KTableExists ( const KTable *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN bool CC KTableVExists ( const KTable *self, uint32_t type,
-    const char *name, va_list args );
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-KDB_EXTERN bool CC KTableIsAlias ( const KTable *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name );
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KTableWritable ( const KTable *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KTableVWritable ( const KTable *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KTableLock ( KTable *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KTableVLock ( KTable *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-KDB_EXTERN rc_t CC KTableUnlock ( KTable *self, uint32_t type,
-    const char *name, ... );
-KDB_EXTERN rc_t CC KTableVUnlock ( KTable *self, uint32_t type,
-    const char *name, va_list args );
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving name of contained object
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new name
- */
-KDB_EXTERN rc_t CC KTableRenameColumn ( KTable *self, bool force,
-    const char *from, const char *to );
-KDB_EXTERN rc_t CC KTableRenameIndex ( KTable *self, bool force,
-    const char *from, const char *to );
-
-
-/* Alias
- *  create an alias to an existing contained object
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8
- *  giving name of contained object
- *
- *  "alias" [ IN ] - NUL terminated string in UTF-8
- *  giving aliased name
- */
-KDB_EXTERN rc_t CC KTableAliasColumn ( KTable *self, const char *path, const char *alias );
-KDB_EXTERN rc_t CC KTableAliasIndex ( KTable *self, const char *name, const char *alias );
-
-
-/* Drop
- *  drop a contained object
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
- */
-KDB_EXTERN rc_t CC KTableDropColumn ( KTable *self, const char *name, ... );
-KDB_EXTERN rc_t CC KTableDropIndex ( KTable *self, const char *name, ... );
-
-KDB_EXTERN rc_t CC KTableVDropColumn ( KTable *self, const char *name, va_list args );
-KDB_EXTERN rc_t CC KTableVDropIndex ( KTable *self, const char *name, va_list args );
-
-
-/* Reindex
- *  optimize column indices
- */
-KDB_EXTERN rc_t CC KTableReindex ( KTable *self );
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KTableOpenManagerRead ( const KTable *self, struct KDBManager const **mgr );
-KDB_EXTERN rc_t CC KTableOpenManagerUpdate ( KTable *self, struct KDBManager **mgr );
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-KDB_EXTERN rc_t CC KTableOpenParentRead ( const KTable *self, struct KDatabase const **db );
-KDB_EXTERN rc_t CC KTableOpenParentUpdate ( KTable *self, struct KDatabase **db );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_kdb_table_ */
diff --git a/interfaces/kfg/config.h b/interfaces/kfg/config.h
deleted file mode 100644
index 5e429c4..0000000
--- a/interfaces/kfg/config.h
+++ /dev/null
@@ -1,407 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_config_
-#define _h_kfg_config_
-
-#ifndef _h_kfg_extern_
-#include <kfg/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This flag has important ramifications to all programs.
- * If set then all programs that use KMain()/KMane() 
- * become dependant on the kfg and kfs libraries.
- *
- * This will also modify the behavior of program tear down.
- * if unset the memory used by the singleton config manager
- * will not be freed.
- */
-#define KFG_COMMON_CREATION 0
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-struct KNamelist;
-struct VPath;
-struct String;
-
-/*--------------------------------------------------------------------------
- * KConfig
- *  configuration paramter manager
- */
-typedef struct KConfig KConfig;
-
-
-/* Make
- *  create a process-global configuration manager
- *
- *  "cfg" [ OUT ] - return parameter for mgr
- *
- *  "optional_search_base" [ IN, NULL OKAY ]
- */
-KFG_EXTERN rc_t CC KConfigMake ( KConfig **cfg,
-    struct KDirectory const * optional_search_base );
-
-/* AddRef
- * Release
- */
-KFG_EXTERN rc_t CC KConfigAddRef ( const KConfig *self );
-KFG_EXTERN rc_t CC KConfigRelease ( const KConfig *self );
-
-
-/* LoadFile
- * loads a configuration file
- */
-KFG_EXTERN rc_t CC KConfigLoadFile ( KConfig * self,
-    const char * path, struct KFile const * file );
-
-
-/* Commit
- *  commits changes to user's private configuration file
- */
-KFG_EXTERN rc_t CC KConfigCommit ( KConfig *self );
-
-/* ReadBool
- *  read a boolean node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (true if "TRUE", false if "FALSE"; rc != 0 if neither)
- *
- */
-KFG_EXTERN rc_t CC KConfigReadBool ( const KConfig* self, const char* path, bool* result );
-    
-/* ReadI64
- *  read an integer node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigReadI64 ( const KConfig* self, const char* path, int64_t* result );
-
-/* ReadU64
- *  read an unsigned node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigReadU64 ( const KConfig* self, const char* path, uint64_t* result );
-
-/* ReadF64
- *  read an F64 node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigReadF64( const KConfig* self, const char* path, double* result );
-
-#if 0
-/*** NB - temporarily lives in vfs due to library interdependencies ***/
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigReadVPath ( const KConfig* self, const char* path, struct VPath** result );
-#endif
-
-/* ReadString
- *  read a String node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT, NUL-TERMINATED ] - return value; caller responsible for deallocation
- *
- */
-KFG_EXTERN rc_t CC KConfigReadString ( const KConfig* self, const char* path, struct String** result );
-
-
-/* Print
- *  print configuration to output handler (using OUTMSG)
- */
-KFG_EXTERN rc_t CC KConfigPrint ( const KConfig * self, int indent );
-
-
-/* ImportNgc
- *  import ngc file into current configuration
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the ngc file
- * pathToProtectedRepository [ IN, NULL OKAY ] - optional - the
- *  special value NULL is interpreted as ${HOME}/ncbi/dbGaP-$(Project #)
- * newRepoParentPath [ OUT, NULL OKAY ] - optional - 
- *  path to the new protected repository: should not be released!
- */
-KFG_EXTERN rc_t CC KConfigImportNgc(KConfig *self,
-    const char *ngcPath, const char *pathToProtectedRepository,
-    const char **newRepoParentPath);
-
-/* DisableUserSettings
- *  for testing purposes
- */
-KFG_EXTERN void CC KConfigDisableUserSettings ( void );
-
-
-/*--------------------------------------------------------------------------
- * KConfigNode
- *  node within configuration tree
- */
-typedef struct KConfigNode KConfigNode;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-KFG_EXTERN rc_t CC KConfigNodeAddRef ( const KConfigNode *self );
-KFG_EXTERN rc_t CC KConfigNodeRelease ( const KConfigNode *self );
-
-
-KFG_EXTERN rc_t CC KConfigNodeGetMgr( const KConfigNode * self, KConfig ** mgr );
-
-/* OpenNodeRead
- * VOpenNodeRead
- *  opens a configuration node
- *
- *  "node" [ OUT ] - return parameter for indicated configuration node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within configuration hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-KFG_EXTERN rc_t CC KConfigOpenNodeRead ( const KConfig *self,
-    const KConfigNode **node, const char *path, ... );
-KFG_EXTERN rc_t CC KConfigNodeOpenNodeRead ( const KConfigNode *self,
-    const KConfigNode **node, const char *path, ... );
-
-KFG_EXTERN rc_t CC KConfigVOpenNodeRead ( const KConfig *self,
-    const KConfigNode **node, const char *path, va_list args );
-KFG_EXTERN rc_t CC KConfigNodeVOpenNodeRead ( const KConfigNode *self,
-    const KConfigNode **node, const char *path, va_list args );
-
-
-/* OpenNodeUpdate
- * VOpenNodeUpdate
- *  opens a configuration node
- *
- *  "node" [ OUT ] - return parameter for indicated configuration node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within configuration hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-KFG_EXTERN rc_t CC KConfigOpenNodeUpdate ( KConfig *self,
-    KConfigNode **node, const char *path, ... );
-KFG_EXTERN rc_t CC KConfigNodeOpenNodeUpdate ( KConfigNode *self,
-    KConfigNode **node, const char *path, ... );
-
-KFG_EXTERN rc_t CC KConfigVOpenNodeUpdate ( KConfig *self,
-    KConfigNode **node, const char *path, va_list args );
-KFG_EXTERN rc_t CC KConfigNodeVOpenNodeUpdate ( KConfigNode *self,
-    KConfigNode **node, const char *path, va_list args );
-
-
-/* Read
- *  read a node value
- *
- *  "offset" [ IN ] - initial offset into configuration
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read.
- *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
- */
-KFG_EXTERN rc_t CC KConfigNodeRead ( const KConfigNode *self,
-    size_t offset, char *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining );
-
-/* ReadBool
- *  read a boolean node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (true if "TRUE", false if "FALSE"; rc != 0 if neither)
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadBool ( const KConfigNode *self, bool* result );
-    
-/* ReadI64
- *  read an integer node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadI64 ( const KConfigNode *self, int64_t* result );
-
-/* ReadU64
- *  read an unsigned node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadU64 ( const KConfigNode *self, uint64_t* result );
-
-/* ReadF64
- *  read an F64 node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadF64 ( const KConfigNode *self, double* result );
-
-#if 0
-/*** NB - temporarily lives in vfs due to library interdependencies ***/
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadVPath ( const KConfigNode *self, struct VPath** result );
-#endif
-
-/* ReadString
- *  read a String node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value; caller responsible for deallocation
- *
- */
-KFG_EXTERN rc_t CC KConfigNodeReadString ( const KConfigNode *self, struct String** result );
-
-/* ListChildren - nee ListChild
- *  list all named children
- */
-#define KConfigNodeListChild KConfigNodeListChildren
-KFG_EXTERN rc_t CC KConfigNodeListChildren ( const KConfigNode *self,
-    struct KNamelist **names );
-
-
-/* Write
- *  write a node value or attribute
- *  overwrites anything already there
- *
- *  "buffer" [ IN ] and "size" [ IN ] - new value data
- */
-KFG_EXTERN rc_t CC KConfigNodeWrite ( KConfigNode *self, const char *buffer, size_t size );
-
-
-/* Append
- *  append data to value
- *
- *  "buffer" [ IN ] and "size" [ IN ] - value data to be appended
- */
-KFG_EXTERN rc_t CC KConfigNodeAppend ( KConfigNode *self, const char *buffer, size_t size );
-
-
-/* ReadAttr
- *  reads as NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-KFG_EXTERN rc_t CC KConfigNodeReadAttr ( const KConfigNode *self, const char *name,
-    char *buffer, size_t bsize, size_t *size );
-
-
-/* WriteAttr
- *  writes NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "value" [ IN ] - NUL terminated attribute value
- */
-KFG_EXTERN rc_t CC KConfigNodeWriteAttr ( KConfigNode *self,
-    const char *name, const char *value );
-
-
-/* Drop
- * VDrop
- *  drop some or all node content
- */
-KFG_EXTERN rc_t CC KConfigNodeDropAll ( KConfigNode *self );
-KFG_EXTERN rc_t CC KConfigNodeDropAttr ( KConfigNode *self, const char *attr );
-KFG_EXTERN rc_t CC KConfigNodeDropChild ( KConfigNode *self, const char *path, ... );
-KFG_EXTERN rc_t CC KConfigNodeVDropChild ( KConfigNode *self, const char *path, va_list args );
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving simple name of existing attr
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new simple attr name
- */
-KFG_EXTERN rc_t CC KConfigNodeRenameAttr ( KConfigNode *self, const char *from, const char *to );
-KFG_EXTERN rc_t CC KConfigNodeRenameChild ( KConfigNode *self, const char *from, const char *to );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_config_ */
diff --git a/interfaces/kfg/extern.h b/interfaces/kfg/extern.h
deleted file mode 100644
index 47e2f43..0000000
--- a/interfaces/kfg/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_extern_
-#define _h_kfg_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define KFG_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KFG_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kfg_extern_ */
diff --git a/interfaces/kfg/kart.h b/interfaces/kfg/kart.h
deleted file mode 100644
index b670f6b..0000000
--- a/interfaces/kfg/kart.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_kart_
-#define _h_kfg_kart_
-
-#ifndef _h_kfg_extern_
-#include <kfg/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-
-/* AA-833 */
-
-typedef struct KartItem KartItem;
-
-KFG_EXTERN rc_t CC KartItemAddRef(const KartItem *self);
-KFG_EXTERN rc_t CC KartItemRelease(const KartItem *self);
-
-/** Do not release the returned String !
- *  N.B. returned String is not required to be NULL-terminated !
-KFG_EXTERN rc_t CC KartItemTypeId(const KartItem *self, const String **elem);
- */
-KFG_EXTERN rc_t CC KartItemProjId(const KartItem *self, const String **elem);
-KFG_EXTERN rc_t CC KartItemProjIdNumber(const KartItem *self, uint64_t *id);
-KFG_EXTERN rc_t CC KartItemItemId(const KartItem *self, const String **elem);
-KFG_EXTERN rc_t CC KartItemItemIdNumber(const KartItem *self, uint64_t *id);
-KFG_EXTERN rc_t CC KartItemAccession(const KartItem *self, const String **elem);
-KFG_EXTERN rc_t CC KartItemName(const KartItem *self, const String **elem);
-KFG_EXTERN rc_t CC KartItemItemDesc(const KartItem *self, const String **elem);
-
-typedef struct Kart Kart;
-
-KFG_EXTERN rc_t CC KartAddRef(const Kart *self);
-KFG_EXTERN rc_t CC KartRelease(const Kart *self);
-
-KFG_EXTERN rc_t CC KartMake(const struct KDirectory *dir, const char *path,
-    Kart **kart, bool *isKart);
-#ifdef _DEBUGGING
-KFG_EXTERN rc_t CC KartMakeText(const struct KDirectory *dir, const char *path,
-    Kart **kart, bool *isKart);
-#endif
-
-KFG_EXTERN rc_t CC KartPrint(const Kart *self);
-
-KFG_EXTERN rc_t CC KartMakeNextItem(Kart *self, const KartItem **item);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_kart_ */
diff --git a/interfaces/kfg/keystore-priv.h b/interfaces/kfg/keystore-priv.h
deleted file mode 100644
index f86ac3d..0000000
--- a/interfaces/kfg/keystore-priv.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_keystore_priv_
-#define _h_kfg_keystore_priv_
-
-#ifndef _h_kfg_keystore_
-#include <kfg/keystore.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- KEncryptionKey
- */
- struct KEncryptionKey
- {
-    KRefcount   refcount;
-    String      value; /* 0-terminator is not included */
- };
-
-KFG_EXTERN rc_t CC KEncryptionKeyMake(const char* value, KEncryptionKey** key);
- 
-/*--------------------------------------------------------------------------
- KKeyStore 
- */
-#ifndef KKEYSTORE_IMPL
-    #define KKEYSTORE_IMPL struct KKeyStore
-#endif
-
-typedef struct KKeyStore_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( *destroy   )                 ( KKEYSTORE_IMPL* self );
-    rc_t ( *getKey )                    ( const KKEYSTORE_IMPL* self, const char* obj_key, KEncryptionKey** enc_key);
-    /* end minor version == 0 */
-
-} KKeyStore_vt_v1;
-
-typedef union KKeyStore_vt {
-    KKeyStore_vt_v1* v1;
-} KKeyStore_vt;
-
-/* KKeyStoreSetConfig
- * Specify the Config object used by the KeyStore object. If the object is not specified, one will be created 
- * when required using KConfigMake
- *
- * kfg [ IN, NULL OK ] if NULL, forget the current kfg object
- */
-KFG_EXTERN rc_t CC KKeyStoreSetConfig(struct KKeyStore* self, const struct KConfig* kfg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_keystore_priv_ */
diff --git a/interfaces/kfg/keystore.h b/interfaces/kfg/keystore.h
deleted file mode 100644
index 56d1536..0000000
--- a/interfaces/kfg/keystore.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_keystore_
-#define _h_kfg_keystore_
-
-#ifndef _h_kfg_extern_
-#include <kfg/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ENV_KRYPTO_PWFILE       "VDB_PWFILE"
-
-struct KFile;
-struct KConfig;
-struct String;
-
-/*--------------------------------------------------------------------------
- * KEncryptionKey
- *  Encryption key, reference-counted and kept in non-swappable memory
- */
-typedef struct KEncryptionKey KEncryptionKey;
-
-KFG_EXTERN rc_t CC KEncryptionKeyAddRef ( struct KEncryptionKey *self );
-KFG_EXTERN rc_t CC KEncryptionKeyRelease ( struct KEncryptionKey *self );
-
-
-/*--------------------------------------------------------------------------
- * KKeyStore
- *  Encryption key storage interface
- */
-typedef struct KKeyStore KKeyStore;
-
- /* all strings are NUL-terminated */
- 
-/* AddRef
- */
-KFG_EXTERN rc_t CC KKeyStoreAddRef ( const KKeyStore *self );
-/* Release
- */
-KFG_EXTERN rc_t CC KKeyStoreRelease ( const KKeyStore *self );
-
-/* 
- * KKeyStoreSetTemporaryKeyFromFile
- *
- *  set a temporarily encryption key 
- *  the key will only be maintained for this instance of KKeyStore (use for externally supplied keys).
- * 
- *  enc_file[ IN, NULL OK ] - open KFile containing the key (characters after the first \n are ignored)
- *  if NULL is specified, forget the previously set temporary key
- */
-KFG_EXTERN rc_t CC KKeyStoreSetTemporaryKeyFromFile(KKeyStore* self, const struct KFile* enc_file);
-
-/* KKeyStoreGetKey
- *  returns the encryption key associated with the specified object
- * 
- *  obj_key [ IN, NULL OK ] - NUL-terminated key of the object in question. The key can be an accession name, or a file system path.
- *      If NULL, will return the current protected repository's key, or, if not within a protected repository, the global key if available
- *      from environment or configuration 
- *  enc_key [ OUT ] 
- */
-KFG_EXTERN rc_t CC KKeyStoreGetKey(const KKeyStore* self, const char* obj_key, KEncryptionKey** enc_key);
-
-/*
- * Registering bindings between numeric object Ids and object names
- */                                        
- 
-/* KKeyStoreSetBindingsFile
- *  Specifies location of a bindings file used by this instance of KeyStore. 
- *  If never set or set to NULL, uses default location ($NCBI_HOME/objid.mapping)
- * 
- * self [ IN ] - KKeyStore object
- * path [ IN, NUL-TERMINATED, NULL OK ] - pathname to the bindings file. If NULL, reset to default location ($NCBI_HOME/objid.mapping)
- */
-KFG_EXTERN rc_t CC KKeyStoreSetBindingsFile(struct KKeyStore* self, const char* path);
-
-/* KKeyStoreGetBindingsFile
- *  Returns location of a bindings file used by this instance of KeyStore. 
- * 
- * self [ IN ] - KKeyStore object
- * returns pathname to the bindings file. If NULL, default location will be used when needed
- */
-KFG_EXTERN const char* KKeyStoreGetBindingsFile(const struct KKeyStore* self);
- 
-/* KKeyStoreRegisterObject
- *  registers a binding between an object Id and an object name 
- * 
- * self [ IN ] - KKeyStore object
- * oid [ IN ] - object id
- * obj [ IN ] - object's name (any characters except '\r' and '\n' )
- */
-KFG_EXTERN rc_t CC KKeyStoreRegisterObject(struct KKeyStore* self, uint32_t oid, const struct String* name);
-
-/* KKeyStoreGetObjectId
- *  look up an object id by an object name 
- * 
- * self [ IN ] - KKeyStore object
- * obj [ IN ] - object's name 
- * oid [ OUT ] - object id
- */
-KFG_EXTERN rc_t CC VKKeyStoreGetObjectId(const struct KKeyStore* self, const struct String* name, uint32_t* oid);
-
-/* KKeyStoreGetObjectName
- *  look up an object name by an object id
- * 
- * self [ IN ] - KKeyStore object
- * obj [ IN ] - object's name 
- * oid [ OUT ] - object id
- */
-KFG_EXTERN rc_t CC KKeyStoreGetObjectName(const struct KKeyStore* self, uint32_t oid, const struct String** name);
-
-
-/* KKeyStoreMake
- * Creates a non-keyring implementation, which uses a combination of location-based and global encryption keys.
- * 
- * self [ OUT ]
- * kfg [ IN, NULL OK ] - optional config object to use
- */
-KFG_EXTERN rc_t CC KKeyStoreMake(KKeyStore** self, struct KConfig* kfg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_keystore_ */
diff --git a/interfaces/kfg/kfg-priv.h b/interfaces/kfg/kfg-priv.h
deleted file mode 100644
index 59a4dcd..0000000
--- a/interfaces/kfg/kfg-priv.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_priv_
-#define _h_kfg_priv_
-
-#ifndef _h_kfg_config_
-#include <kfg/config.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ListIncluded
- *  list all included files
- */
-KFG_EXTERN rc_t CC KConfigListIncluded ( const KConfig *self,
-    struct KNamelist **names );
-
-/* GetLoadPath
- *  return colon-separated search path to load KConfig
- * NB. path should not be released
- */
-KFG_EXTERN rc_t CC KConfigGetLoadPath ( const KConfig *self,
-    const char **path );
-
-/* call KConfigMake not initializing the static global KConfig pointer */
-KFG_EXTERN rc_t CC KConfigMakeLocal ( KConfig **cfg,
-                                     const struct KDirectory * cfgdir );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_priv_ */
diff --git a/interfaces/kfg/repository.h b/interfaces/kfg/repository.h
deleted file mode 100644
index 2bb998b..0000000
--- a/interfaces/kfg/repository.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfg_repository_
-#define _h_kfg_repository_
-
-#ifndef _h_kfg_extern_
-#include <kfg/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KConfig;
-
-/*--------------------------------------------------------------------------
- * KRepository
- *  presents structured access to a storage repository
- *  as modeled in KConfig.
- *
- *  all objects are obtained via KRepositoryMgr ( see below )
- */
-typedef struct KRepository KRepository;
-
-
-/* AddRef
- * Release
- */
-KFG_EXTERN rc_t CC KRepositoryAddRef ( const KRepository *self );
-KFG_EXTERN rc_t CC KRepositoryRelease ( const KRepository *self );
-
-
-/* Category
- * SubCategory
- *  tells what the repository category or sub-category are
- *  or returns "bad" if the repository object is not usable.
- */
-typedef uint32_t KRepCategory;
-enum
-{
-    krepBadCategory,
-    krepUserCategory,
-    krepSiteCategory,
-    krepRemoteCategory
-};
-
-typedef uint32_t KRepSubCategory;
-enum
-{
-    krepBadSubCategory,
-    krepMainSubCategory,
-    krepAuxSubCategory,
-    krepProtectedSubCategory
-};
-
-KFG_EXTERN KRepCategory CC KRepositoryCategory ( const KRepository *self );
-KFG_EXTERN KRepSubCategory CC KRepositorySubCategory ( const KRepository *self );
-
-
-/* Name
- *  get the repository name
- *  attempts to copy NUL-terminated name into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - name output parameter
- *
- *  "name_size" [ OUT, NULL OKAY ] - returns the name size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryName ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *name_size );
-
-
-/* DisplayName
- *  get the repository display name,
- *  if different from its actual name
- *
- *  attempts to copy NUL-terminated name into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - name output parameter
- *
- *  "name_size" [ OUT, NULL OKAY ] - returns the name size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryDisplayName ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *name_size );
-
-
-/* Root
- *  read the root path as a POSIX path or URL
- *
- *  attempts to copy NUL-terminated path into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - path output parameter
- *
- *  "root_size" [ OUT, NULL OKAY ] - returns the path size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryRoot ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *root_size );
-
-
-/* Disabled
- *  discover whether the repository is enabled
- */
-KFG_EXTERN bool CC KRepositoryDisabled ( const KRepository *self );
-
-
-/* Set Disabled
- *  changes the status of a repository, writes status into kfg-file on disk
- *  disabled = true  ... disables the repository
- *  disabled = false ... enables the repository
- */
-KFG_EXTERN rc_t CC KRepositorySetDisabled ( const KRepository *self, bool disabled );
-
-
-/* CacheEnabled
- *  discover whether the repository supports caching
- */
-KFG_EXTERN bool CC KRepositoryCacheEnabled ( const KRepository *self );
-
-
-/* DownloadTicket
- *  return any associated download ticket
- *
- *  attempts to copy NUL-terminated ticket into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - ticket output parameter
- *
- *  "ticket_size" [ OUT, NULL OKAY ] - returns the ticket size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryDownloadTicket ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *ticket_size );
-
-
-/* EncryptionKey
- *  return any associated encryption key
- *
- *  attempts to copy NUL-terminated key into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - encryption key output parameter
- *
- *  "key_size" [ OUT, NULL OKAY ] - returns the key size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryEncryptionKey ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *key_size );
-
-
-/* EncryptionKeyFile
- *  return path to any associated encryption key file
- *
- *  attempts to copy NUL-terminated path into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - key file path output parameter
- *
- *  "path_size" [ OUT, NULL OKAY ] - returns the path size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryEncryptionKeyFile ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *path_size );
-
-
-/* Description
- *  return any associated descriptive text
- *
- *  attempts to copy NUL-terminated description into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - description text output parameter
- *
- *  "desc_size" [ OUT, NULL OKAY ] - returns the text size in
- *  bytes, excluding any NUL termination.
- */
-KFG_EXTERN rc_t CC KRepositoryDescription ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *desc_size );
-
-/* Description
- *  register an encrypted object in association with the repository's encryption key
- */
-KFG_EXTERN rc_t CC KRepositoryRegisterObject ( const KRepository *self, const char* object_id );
-
-
-/*--------------------------------------------------------------------------
- * KRepositoryVector
- *  uses Vector API
- *  holds zero or more KRepository objects
- */
-typedef struct Vector KRepositoryVector;
-
-
-/* Whack
- *  destroy your vector
- */
-KFG_EXTERN rc_t CC KRepositoryVectorWhack ( KRepositoryVector *self );
-
-
-/*--------------------------------------------------------------------------
- * KRepositoryMgr
- *  manages structured access to repositories
- */
-typedef struct KRepositoryMgr KRepositoryMgr;
-
-
-/* Make
- *  create a repository manager
- *  uses values from "self"
- *
- *  mgr [ OUT ] 
- */
-KFG_EXTERN rc_t CC KConfigMakeRepositoryMgrRead ( struct KConfig const *self, const KRepositoryMgr **mgr );
-KFG_EXTERN rc_t CC KConfigMakeRepositoryMgrUpdate ( struct KConfig *self, KRepositoryMgr **mgr );
-
-
-/* AddRef
- * Release
- */
-KFG_EXTERN rc_t CC KRepositoryMgrAddRef ( const KRepositoryMgr *self );
-KFG_EXTERN rc_t CC KRepositoryMgrRelease ( const KRepositoryMgr *self );
-
-
-/* UserRepositories
- *  retrieve all user repositories in a Vector
- */
-KFG_EXTERN rc_t CC KRepositoryMgrUserRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *user_repositories );
-
-
-/* SiteRepositories
- *  retrieve all site repositories in a Vector
- */
-KFG_EXTERN rc_t CC KRepositoryMgrSiteRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *site_repositories );
-
-
-/* RemoteRepositories
- *  retrieve all remote repositories in a Vector
- */
-KFG_EXTERN rc_t CC KRepositoryMgrRemoteRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *remote_repositories );
-
-/* CurrentProtectedRepository
- *  returns the currently active user protected repository
- */
-KFG_EXTERN rc_t CC KRepositoryMgrCurrentProtectedRepository ( const KRepositoryMgr *self,
-    const KRepository **p_protected );
-
-/* GetProtectedRepository
- *  retrieves a (read-only) user protected repository by its associated project-id
- */
-KFG_EXTERN rc_t CC KRepositoryMgrGetProtectedRepository ( const KRepositoryMgr *self, 
-    uint32_t projectId, 
-    const KRepository **p_protected );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_repository_ */
diff --git a/interfaces/kfs/arc.h b/interfaces/kfs/arc.h
deleted file mode 100644
index 8eca2fe..0000000
--- a/interfaces/kfs/arc.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_arc_
-#define _h_kfs_arc_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <kfs/toc.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-struct KFile;
-struct KToc;
-struct vector;
-
-/* validate_header_offsets
- *	This function is a special friend function to the archive package used
- *	to validate that the compiler used to build the package matches 
- *	used structure offsets "correctly" to enable the parsing of TAR files.
- * NOTE:
- *	This function should not be used except by ktartest (klib/tools/ktartest.c).
- *	It is built only in a special logging version of the libraries.
- */
-KFS_EXTERN bool CC validate_header_offsets(void);
-
-typedef struct KArcDir KArcDir;
-typedef struct KArcFile KArcFile;
-
-typedef uint32_t KArcFSType;
-enum eKArcFSType
-{
-    tocUnknown,
-    tocKFile,
-    tocKDirectory,
-    tocKVirtual
-};
-
-
-/* OpenArcDirRead
- *
- * This should probably move into the toc-priv with a specific call to open each archive type
- * with the parse private and not needing the dad-gummed CC and KFS_EXTERN
- *  Open an archive file as a KDirectory derived type: made to match 
- *  KDirectoryOpenDirRead() where parse could be the first element of arg
- *
- * [IN]  dir    A KDirectory (of any derived type) to reach the archive file
- * [OUT] pdir   The KDirectory (of type KArcDir) that will be created
- * [IN]  chroot if non-zero, the new directory becomes chroot'd and interprets paths
- *      stating with '/'
- * [IN]  path   The path to the archive - this will become the directory path
- * [IN]  parse  A pointer to the function needed to build a TOC by parsing the file
- *
- * parameters to parse
- * REQUIRED:    KToc *
- * REQUIRED:    void *  KFile* | KDirectory* | ???
- * OPTIONAL:    bool (*)(const char*)           Filter: include or skip this path
- * OPTIONAL:    rc_t (*)(???)               Sort: reorder name list
- */
-KFS_EXTERN rc_t CC KDirectoryOpenArcDirRead(const struct KDirectory * self, 
-    const struct KDirectory ** pdir, bool chroot, const char * path, KArcFSType baseType,
-    rc_t ( CC * parse )(struct KToc *,const void *,
-        bool( CC * )(const struct KDirectory*, const char *, void*), void*),
-        bool (CC* filter )(const KDirectory*, const char *, void *), void * filterparam);
-
-KFS_EXTERN rc_t CC KDirectoryOpenArcDirRead_silent(const struct KDirectory * self, 
-    const struct KDirectory ** pdir, bool chroot, const char * path, KArcFSType baseType,
-    rc_t ( CC * parse )(struct KToc *,const void *,
-        bool( CC * )(const struct KDirectory*, const char *, void*), void*),
-        bool (CC* filter )(const KDirectory*, const char *, void *), void * filterparam);
-
-KFS_EXTERN rc_t CC KDirectoryOpenArcDirRead_silent_preopened(const struct KDirectory * self, 
-    const struct KDirectory ** pdir, bool chroot, const char * path, KArcFSType baseType,
-    void * f,
-    rc_t ( CC * parse )(struct KToc *,const void *,
-        bool( CC * )(const struct KDirectory*, const char *, void*), void*),
-        bool (CC* filter )(const KDirectory*, const char *, void *), void * filterparam);
-
-
-
-
-
-#if 0
-/* ----------------------------------------------------------------------
- * KDirectoryToKArcDir
- *
- * [IN]  const KDirectory * 	self	Object oriented C
- * [OUT] const KArcDir * 	cast	Object oriented C
- *
- *
- * Get a reference to a KArcDir from a KDirectory as a cast.  It is a new reference.
- */
-
-KFS_EXTERN rc_t CC KDirectoryToKArcDir (const KDirectory * self, const KArcDir ** cast);
-
-KFS_EXTERN rc_t CC KArcDirList ( const KArcDir *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KArcDir *dir, const char *name, void *data ),
-    void *data, const char *path, ... );
-KFS_EXTERN rc_t CC KArcDirVList ( const KArcDir *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KArcDir *dir, const char *name, void *data ),
-    void *data, const char *path, va_list args );
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_arc_ */
diff --git a/interfaces/kfs/arrayfile.h b/interfaces/kfs/arrayfile.h
deleted file mode 100644
index 079c92c..0000000
--- a/interfaces/kfs/arrayfile.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_arrayfile_
-#define _h_kfs_arrayfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KArrayFile
- *  an array-file is created from a KFile
- */
-typedef struct KArrayFile KArrayFile;
-
-
-/* Make
- *  make an array file from a KFile
- */
-/*
-KFS_EXTERN rc_t CC KArrayFileMakeRead ( const KArrayFile **af, struct KFile const *file );
-KFS_EXTERN rc_t CC KArrayFileMakeUpdate ( KArrayFile **af, struct KFile *file );
-*/
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KArrayFileAddRef ( const KArrayFile *self );
-KFS_EXTERN rc_t CC KArrayFileRelease ( const KArrayFile *self );
-
-
-/* Dimensionality
- *  returns the number of dimensions in the ArrayFile
- *
- *  "dim" [ OUT ] - return parameter for number of dimensions
- */
-KFS_EXTERN rc_t CC KArrayFileDimensionality ( const KArrayFile *self, uint8_t *dim );
-
-
-/* SetDimensionality
- *  sets the number of dimensions in the ArrayFile
- *
- *  "dim" [ IN ] - new number of dimensions; must be > 0
- */
-KFS_EXTERN rc_t CC KArrayFileSetDimensionality ( KArrayFile *self, uint8_t dim );
-
-
-/* DimExtents
- *  returns the extent of every dimension
- *
- *  "dim" [ IN ] - the dimensionality of "extents"
- *
- *  "extents" [ OUT ] - returns the extent for every dimension
- */
-KFS_EXTERN rc_t CC KArrayFileDimExtents ( const KArrayFile *self, uint8_t dim, uint64_t *extents );
-
-
-/* SetDimExtents
- *  sets the new extents for every dimension
- *
- *  "dim" [ IN ] - the dimensionality of "extents"
- *
- *  "extents" [ IN ] - new extents for every dimension
- */
-KFS_EXTERN rc_t CC KArrayFileSetDimExtents ( KArrayFile *self, uint8_t dim, uint64_t *extents );
-
-
-/* ElementSize
- *  returns the element size in bits
- *
- *  "elem_bits" [ OUT ] - size of each element in bits
- */
-KFS_EXTERN rc_t CC KArrayFileElementSize ( const KArrayFile *self, uint64_t *elem_bits );
-
-
-/* Read
- *  read from n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional starting position in elements
- *
- *  "buffer" [ OUT ] and "elem_count" [ IN ] - return buffer for read
- *  where "elem_count" is n-dimensional in elements
- *
- *  "num_read" [ OUT ] - n-dimensional return parameter giving back
- *      the number of read elements in every dimension
- */
-KFS_EXTERN rc_t CC KArrayFileRead ( const KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, void *buffer, const uint64_t *elem_count,
-    uint64_t *num_read );
-
-
-/* Read_v
- *  read one element of variable length from n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional starting position in elements
- *
- *  "buffer" [ OUT ] and "elem_count" [ IN ] - return buffer for read
- *  where "elem_count" is length of buffer in elements
- *
- *  "num_read" [ OUT ] - return parameter giving back
- *      the number of read elements in every dimension
- */
-KFS_EXTERN rc_t CC KArrayFileRead_v ( const KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, void *buffer, const uint64_t elem_count,
-    uint64_t *num_read );
-
-
-/* Write
- *  write into n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional offset where to write to
- *                   in elements
- *
- *  "buffer" [ IN ] and "elem_count" [ IN ] - data to be written
- *  where "elem_count" is n-dimensional in elements
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of elements actually written per dimension
- */
-KFS_EXTERN rc_t CC KArrayFileWrite ( KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, const void *buffer, const uint64_t *elem_count,
-    uint64_t *num_writ );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_arrayfile_ */
diff --git a/interfaces/kfs/buffile.h b/interfaces/kfs/buffile.h
deleted file mode 100644
index f32837b..0000000
--- a/interfaces/kfs/buffile.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_buffile_
-#define _h_kfs_buffile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KFile
- */
-
-/* MakeBufferedRead
- *  make a read-only file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "bsize" [ IN ] - buffer size
- */
-KFS_EXTERN rc_t CC KBufFileMakeRead ( struct KFile const ** buf,
-    struct KFile const * original, size_t bsize );
-
-
-/* MakeBufferedWrite
- *  make a writable file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "update" [ IN ] - if true, make a read/write buffer
- *
- *  "bsize" [ IN ] - buffer size
- */
-KFS_EXTERN rc_t CC KBufFileMakeWrite ( struct KFile ** buf,
-    struct KFile * original, bool update, size_t bsize );
-
-
-
-
-KFS_EXTERN rc_t CC KBufReadFileMakeRead ( const struct KFile ** bp,
-     const struct KFile * original, size_t bsize );
-
-KFS_EXTERN rc_t CC KBufWriteFileMakeWrite ( struct KFile ** bp,
-     struct KFile * original, size_t bsize );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_buffile_ */
diff --git a/interfaces/kfs/bzip.h b/interfaces/kfs/bzip.h
deleted file mode 100644
index f91db85..0000000
--- a/interfaces/kfs/bzip.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_bzip_
-#define _h_kfs_bzip_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-/* MakeBzip2ForRead
- *  creates an adapter to bunzip2 a source file
- *
- *  "bz" [ OUT ] - return parameter for decompressed file
- *
- *  "src" [ IN ] - compressed source file with read permission
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeBzip2ForRead ( struct KFile const **bz, struct KFile const *src );
-
-
-/* MakeBzip2ForWrite
- *  creates an adapter to gzip a source file
- *
- *  "bz" [ OUT ] - return parameter for compressed file
- *
- *  "src" [ IN ] - uncompressed source file with write permission
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeBzip2ForWrite ( struct KFile **bz, struct KFile *src );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_bzip_ */
diff --git a/interfaces/kfs/cacheteefile.h b/interfaces/kfs/cacheteefile.h
deleted file mode 100644
index aad2b9c..0000000
--- a/interfaces/kfs/cacheteefile.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_cacheteefile_
-#define _h_kfs_cacheteefile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- */
-
-/* MakeCacheTee
- *  takes a KFile as source
- *
- *  "tee" [ OUT ] - return parameter for tee file
- *
- *  "remote" [ IN ] - the source file, generally costly to read which is
- *  the motivation behind caching its output
- *
- *  "logger" [ IN, NULL OKAY ] - optional debugging output for observing
- *  access patterns of "remote"
- *
- *  "blocksize" [ IN ] - the cache-file page size
- *                       ( if 0 ... default-value will be 32k )
- *
- *  "cluster" [ IN ] - a blocking factor for accessing "remote"
- *  reads are in blocks of size "blocksize" * "cluster"
- *  ( 1...4 makes most sense )
- *
- *  "report" [ IN ] - when true, provides more verbose debugging output
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting full cache file, i.e. the name of the file
- *  as it would appear after promoting from partial to full status.
- *
- * the function creates a new ( cached ) KFile in **tee
- *
- * the caller can access this file to read and query the filesize, these are the only
- * supported messages to this object
- *
- * when the caller requests data that is not already cached in the local file,
- * the cached file will read from the remote-file, write into the local-file and then
- * return the requested data in the read-buffer
- *
- * when the caller requests data that is already cached, the data will be read from
- * the local file only, no remote request will be made
- *
- * when the caller requests data this is partially cached, the file will return the
- * part that comes first either from the remote or from the local file
- * in this case the file will return less data than requested
- *
- * when the caller opens an existing local file that contains a full copy of the
- * remote file, the local KFile will be returned in self
- *
- * this function will check if the remote-file and the local file ( if it already exists )
- * do have the same size and blocksize
- *
- */
-KFS_EXTERN rc_t CC KDirectoryMakeCacheTee ( struct KDirectory *self,
-    struct KFile const **tee, struct KFile const *remote, struct KFile *logger,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVMakeCacheTee ( struct KDirectory *self,
-    struct KFile const **tee, struct KFile const *remote, struct KFile *logger,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path, va_list args );
-
-/* -----
- * checks if a given file ( has to be a local file )
- *
- * a ... is a backing cache-file for the CacheTee-file
- * b ... all blocks have been filled with the remote content
- *
- * it returns the result of the check in *is_complete
- */
-KFS_EXTERN rc_t CC IsCacheFileComplete( const struct KFile * self, bool * is_complete, bool silent);
-
-
-/* -----
- * truncates a cache-file for a CacheTee-filec by removing the bitmap/content-lenght/block-size
- *
- * it returns the result of the check in *is_complete
- */
-KFS_EXTERN rc_t CC TruncateCacheFile( struct KFile * self );
-
-
-/* -----
- * examens the file, and reports what percentage of blocks are in the cache...
- *
- */
-KFS_EXTERN rc_t CC GetCacheCompleteness( const struct KFile * self, float * percent );
-
-
-/* -----
- * examens the file, and reports the size of the original file ( without the cachefile-footer )
- *
- */
-KFS_EXTERN rc_t CC GetCacheTruncatedSize( const struct KFile * self, uint64_t * truncated_size, bool silent );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_teefile_ */
diff --git a/interfaces/kfs/countfile.h b/interfaces/kfs/countfile.h
deleted file mode 100644
index 4b1c720..0000000
--- a/interfaces/kfs/countfile.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_counterfile_
-#define _h_kfs_counterfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-typedef struct KCounterFile KCounterFile;
-
-/* -----
- * Copy can be a serialized type KFile for a KCounterFile opened for Read but
- * not when opened for write.
- *
- * Specifically this means copy can be a KMD5File for read but not for write
- * other KFile subtypes might have the same restriction.
- *
- * A seekless update KCounterfile can be created but does not now exist.
- *
- * bytecounter points to where to write a total byte count for the file.
- *
- * linecounter points to where to write a count of the lines of a file.
- *     if NULL this functionality is disabled.
- *
- * force_reads causes a read to the end of file on close rather than relying on pass along KFileSize
- */
-KFS_EXTERN rc_t CC KFileMakeCounterRead (const struct KFile ** self, const KFile * original,
-                                         uint64_t * bytecounter, uint64_t * linecounter, bool force_reads);
-KFS_EXTERN rc_t CC KFileMakeCounterWrite (struct KFile ** self, struct KFile * original,
-                                          uint64_t * bytecounter, uint64_t * linecounter, bool force_reads);
-KFS_EXTERN rc_t CC KFileMakeCounterUpdate (struct KFile ** self, struct KFile * original,
-                                           uint64_t * bytecounter, uint64_t * linecounter, bool force_reads);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_counterfile_ */
diff --git a/interfaces/kfs/crc.h b/interfaces/kfs/crc.h
deleted file mode 100644
index c3e56dd..0000000
--- a/interfaces/kfs/crc.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_crc_
-#define _h_kfs_crc_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KCRC32SumFmt
- *  a formatter for reading or writing an crc32sum-style checksum file
- */
-typedef struct KCRC32SumFmt KCRC32SumFmt;
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtAddRef ( const KCRC32SumFmt *self );
-KFS_EXTERN rc_t CC KCRC32SumFmtRelease ( const KCRC32SumFmt *self );
-
-
-/* Make
- *  creates a formatted accessor to textual checksum file
- *  takes over ownership of "in"/"out" file reference
- *
- *  "in" [ IN ] - readable checksum input file
- *  -OR-
- *  "out" [ IN ] - writable checksum file. if readable as well,
- *  its contents will be preserved.
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtMakeRead ( const KCRC32SumFmt **f, struct KFile const *in );
-KFS_EXTERN rc_t CC KCRC32SumFmtMakeUpdate ( KCRC32SumFmt **f, struct KFile *out );
-
-
-/* Count
- *  return the number of checksums in file
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtCount ( const KCRC32SumFmt *self, uint32_t *count );
-
-
-/* Get
- *  retrieve an indexed checksum line
- *
- *  "idx" [ IN ] - zero-based index of checksum to access
- *
- *  "path" [ OUT ] and "size" [ IN ] - return buffer for file path
- *
- *  "crc32" [ OUT ] - return parameter for the checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtGet ( const KCRC32SumFmt *self, uint32_t idx,
-    char *path, size_t size, uint32_t *crc32, bool *bin );
-
-
-/* Find
- *  retrieve checksum line by path
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "crc32" [ OUT ] - return parameter for the checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtFind ( const KCRC32SumFmt *self,
-    const char *path, uint32_t *crc32, bool *bin );
-
-
-/* Delete
- *  remove an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  returns rcNotFound if not present
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtDelete ( KCRC32SumFmt *self, const char *path );
-
-
-/* Update
- *  add a checksum line to file or update an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "crc32" [ IN ] - calculated checksum
- *
- *  "bin" [ IN ] - true if checksum was calculated on all bytes
- *  in file, false if fopen mode used to read file was text.
- *
- * NB - the crc32sum tool was designed to behave like md5sum.
- *  the md5sum tool operates with the assumption that files
- *  are opened using "fopen". it records the mode used by prepending
- *  '*' to indicate binary and ' ' to indicate text mode within the
- *  checksum line.
- *
- *  unfortunately, this creates a situation where text-mode files
- *  checksummed on DOS cannot be properly checked on any other
- *  platform without the aid of some filter to drop out '\r' from
- *  a '\r\n' sequence.
- *
- *  fortunately, most users are unaware of the binary/text mode
- *  switches available with md5sum and use the default mode, which
- *  is binary on DOS and text on Unix, which happens to be equivalent
- *  to binary ( making one wonder why binary is not instead the
- *  universal default ).
- *
- *  the end result is that we need to indicate whether CR stripping
- *  was performed while at the same time behaving like md5sum.
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtUpdate ( KCRC32SumFmt *self, const char *path,
-    uint32_t crc32, bool bin );
-
-/* Rename
- * Rename the checksum line to reflect a file name change but no content change.
- *
- *  "newpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's new name
- *
- *  "oldpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's old name
- *
- * Parameter order matches KDirectoryRename()
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtRename ( KCRC32SumFmt *self, const char *oldpath, const char *newpath );
-
-
-/* Flush
- *  write data to disk, but stay open
- */
-KFS_EXTERN rc_t CC KCRC32SumFmtFlush ( KCRC32SumFmt *self );
-
-
-/*--------------------------------------------------------------------------
- * CRC32 KFile extensions
- */
-
-/* MakeCRC32Read
- *  creates an adapter to check CRC32 checksum for a source file
- *
- *  "f" [ OUT ] - return parameter for file with crc check
- *
- *  "src" [ IN ] - source file with read permission
- *
- *  "crc32" [ IN ] - checksum to match
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeCRC32Read ( struct KFile const **f,
-    struct KFile const *src, uint32_t crc32 );
-
-
-
-
-/*--------------------------------------------------------------------------
- * KCRC32File
- *  subclass of KFile
- */
-typedef struct KCRC32File KCRC32File;
-
-
-/* MakeWrite
- * MakeAppend
- *  creates an adapter to calculate CRC checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with crc check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "fmt" [ IN ] - checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "fmt".
- *
- *  "path" [ IN ] - checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KCRC32FileMakeWrite ( KCRC32File **f,
-    struct KFile *out, KCRC32SumFmt *fmt, const char *path );
-KFS_EXTERN rc_t CC KCRC32FileMakeAppend ( KCRC32File **f,
-    struct KFile *out, KCRC32SumFmt *fmt, const char *path );
-
-/* MakeReadNew
- *  creates an adapter to calculate CRC checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with crc check
- *
- *  "in" [ IN ] - input file 
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "fmt" [ IN ] - checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "fmt".
- *
- *  "path" [ IN ] - checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeNewCRC32Read ( const struct KFile **fp,
-    const struct KFile *in, KCRC32SumFmt *fmt, const char *path );
-
-
-/* ToKFile
- *  a CRC32 file is a subclass of KFile
- *  this is an explicit cast operator
- */
-KFS_EXTERN struct KFile* CC KCRC32FileToKFile ( KCRC32File *self );
-KFS_EXTERN struct KFile const* CC KCRC32FileToKFileConst ( const KCRC32File *self );
-
-/* BeginTransaction
- *  preserve current CRC state and file marker
- *  in preparation for rollback
- */
-KFS_EXTERN rc_t CC KCRC32FileBeginTransaction ( KCRC32File *self );
-
-
-/* Commit
- *  accept current CRC state as correct
- */
-KFS_EXTERN rc_t CC KCRC32FileCommit ( KCRC32File *self );
-
-
-/* Revert
- *  reset state to previous transaction boundary conditions
- */
-KFS_EXTERN rc_t CC KCRC32FileRevert ( KCRC32File *self );
-
-/* Reset
- *  reset state to that of an empty file
- *  aborts any open transaction
- */
-KFS_EXTERN rc_t CC KCRC32FileReset ( KCRC32File *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_crc_ */
diff --git a/interfaces/kfs/defs.h b/interfaces/kfs/defs.h
deleted file mode 100644
index 3e76d9c..0000000
--- a/interfaces/kfs/defs.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_defs_
-#define _h_kfs_defs_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KPathType
- */
-typedef uint32_t KPathType;
-enum
-{
-    /* add in below zero so as not to change behavior of existing */
-    /* added for KDB that extended this enumeration */ 
-    /* if added it will clash with the kptAlias bit */
-    /* without care be taken */
-    kptFirstDefined = 0,
-
-    /* some paths are bad or non-existent */
-    kptNotFound = kptFirstDefined,
-    kptBadPath,
-
-    /* existing paths describe a directory entry */
-    kptFile,
-    kptDir,
-    kptCharDev,
-    kptBlockDev,
-    kptFIFO,
-
-    /* special types that aren't quite right or normal */
-
-    /* A zombie file is a file in the directory that can not be opened
-     * or read because it is for some reason not really present
-     * zombie as in not live and not dead */
-    kptZombieFile,
-
-    /* special cases for visiting a HDF5-file: */
-
-    /* a dataset is a container for data like a file, but typed */
-    kptDataset,
-    /* a datatype is a object inside a HDF5-group (directory) */
-    kptDatatype,
-
-    /* the type enum may be extended by virtual directories */
-    kptLastDefined,
-
-    /* aliases to the above types have the alias bit set */
-    kptAlias = 128
-};
-
-
-/*--------------------------------------------------------------------------
- * KCreateMode
- *  when creating a file or directory, the normal intent is to open it,
- *  creating it first if necessary, and then go on. alternatively, the
- *  intention may be to always return a newly initialized object, while
- *  the last may be to only proceed if actually created, i.e. if the
- *  object does not already exist in some form.
- */
-enum
-{
-    /* mode values 0..7 */
-    kcmOpen,
-    kcmInit,
-    kcmCreate,
-    kcmValueMask = 7,
-
-    /* modifier bits 3..7 */
-    kcmMD5     = ( 1 << 6 ),
-    kcmParents = ( 1 << 7 ),
-    kcmBitMask = ( 1 << 8 ) - kcmValueMask - 1
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_defs_ */
diff --git a/interfaces/kfs/directory.h b/interfaces/kfs/directory.h
deleted file mode 100644
index 7d7f237..0000000
--- a/interfaces/kfs/directory.h
+++ /dev/null
@@ -1,522 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_directory_
-#define _h_kfs_directory_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KNamelist;
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  a container node within file system
- */
-typedef struct KDirectory KDirectory;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KDirectoryAddRef ( const KDirectory *self );
-KFS_EXTERN rc_t CC KDirectoryRelease ( const KDirectory *self );
-
-/* List
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "f" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ] - optional
- *  filter function to execute on each path. receives a base directory
- *  and relative path for each entry. if "f" returns true, the name will
- *  be added to the list.
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL or empty, interpreted to mean "."
- *
- *  function makes a flat list, does not step into sub-dirs!
- *
- */
-KFS_EXTERN rc_t CC KDirectoryList ( const KDirectory *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-    void *data, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVList ( const KDirectory *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-    void *data, const char *path, va_list args );
-
-/* Visit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if true, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry. if "f" returns true, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN, NULL OKAY ] - optional NUL terminated string
- *   in directory-native character set. if NULL or empty, interpreted to mean "."
- *
- * VisitFull hits all files types that including those are normally hidden
- */
-KFS_EXTERN rc_t CC KDirectoryVisit ( const KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVVisit ( const KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, va_list args );
-
-/* VisitUpdate
- *  like Visit except that the directory passed back to "f"
- *  is available for update operations
- */
-KFS_EXTERN rc_t CC KDirectoryVisitUpdate ( KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVVisitUpdate ( KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, va_list args );
-
-/* PathType
- *  returns a KPathType ( defined in kfs/defs.h )
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-KFS_EXTERN uint32_t CC KDirectoryPathType ( const KDirectory *self,
-    const char *path, ... );
-KFS_EXTERN uint32_t CC KDirectoryVPathType ( const KDirectory *self,
-    const char *path, va_list args );
-
-/* ResolvePath
- *  resolves path to an absolute or directory-relative path
- *
- *  "absolute" [ IN ] - if true, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *  the resolved path will be directory relative
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target path. NB - need not exist.
- */
-KFS_EXTERN rc_t CC KDirectoryResolvePath ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVResolvePath ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, va_list args );
-
-/* ResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "absolute" [ IN ] - if true, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *  the resolved path will be directory relative
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- */
-KFS_EXTERN rc_t CC KDirectoryResolveAlias ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *alias, ... );
-KFS_EXTERN rc_t CC KDirectoryVResolveAlias ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *alias, va_list args );
-
-/* Rename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "force" [ IN ] - not false means try to do more if it fails internally
- */
-KFS_EXTERN rc_t CC KDirectoryRename ( KDirectory *self, bool force, const char *from, const char *to );
-
-/* Remove
- *  remove an accessible object from its directory
- *
- *  "force" [ IN ] - if true and target is a directory,
- *  remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-KFS_EXTERN rc_t CC KDirectoryRemove ( KDirectory *self, bool force,
-    const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVRemove ( KDirectory *self, bool force,
-    const char *path, va_list args );
-
-/* ClearDir
- *  remove all directory contents
- *
- *  "force" [ IN ] - if true and directory entry is a
- *  sub-directory, remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-KFS_EXTERN rc_t CC KDirectoryClearDir ( KDirectory *self, bool force,
-    const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVClearDir ( KDirectory *self, bool force,
-    const char *path, va_list args );
-
-/* Access
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-KFS_EXTERN rc_t CC KDirectoryAccess ( const KDirectory *self,
-    uint32_t *access, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVAccess ( const KDirectory *self,
-    uint32_t *access, const char *path, va_list args );
-
-/* SetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-KFS_EXTERN rc_t CC KDirectorySetAccess ( KDirectory *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVSetAccess ( KDirectory *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, va_list args );
-
-/* Date
- *  get date/time to object
- *
- *  "date" [ OUT ] - return parameter
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-KFS_EXTERN rc_t CC KDirectoryDate ( const KDirectory *self,
-    KTime_t *date, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVDate ( const KDirectory *self,
-    KTime_t *date, const char *path, va_list args );
-
-/* SetDate
- *  set date to object
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- *
- *  "date" [ IN ] - new time and date for the object
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-KFS_EXTERN rc_t CC KDirectorySetDate ( KDirectory *self, bool recurse,
-    KTime_t date, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVSetDate ( KDirectory *self, bool recurse,
-    KTime_t date, const char *path, va_list args );
-
-/* CreateAlias
- *  creates a path alias according to create mode
- *  such that "alias" => "targ"
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode ( see explanation in kfs/defs.h ).
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object, i.e. the object which
- *  is designated by symlink "alias". THE PATH IS GIVEN RELATIVE
- *  TO DIRECTORY ( "self" ), NOT SYMLINK ( "alias" )!
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias, i.e. the symlink that
- *  designates a target "targ".
- */
-KFS_EXTERN rc_t CC KDirectoryCreateAlias ( KDirectory *self,
-    uint32_t access, KCreateMode mode,
-    const char *targ, const char *alias );
-
-/* OpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryOpenFileRead ( const KDirectory *self,
-    struct KFile const **f, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenFileRead ( const KDirectory *self,
-    struct KFile const **f, const char *path, va_list args );
-
-/* OpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryOpenFileWrite ( KDirectory *self,
-    struct KFile **f, bool update, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenFileWrite ( KDirectory *self,
-    struct KFile **f, bool update, const char *path, va_list args );
-
-/* CreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation in kfs/defs.h ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryCreateFile ( KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVCreateFile ( KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, va_list args );
-
-/* FileSize
- *  returns size in bytes of target file
- *
- *  "size" [ OUT ] - return parameter for file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryFileSize ( const KDirectory *self,
-    uint64_t *size, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVFileSize ( const KDirectory *self,
-    uint64_t *size, const char *path, va_list args );
-
-/* FilePhysicalSize
- *  returns physical allocated size in bytes of target file.  It might
- * or might not differ from FileSize
- *
- *  "size" [ OUT ] - return parameter for file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryFilePhysicalSize ( const KDirectory *self,
-    uint64_t *size, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVFilePhysicalSize ( const KDirectory *self,
-    uint64_t *size, const char *path, va_list args );
-
-/* SetFileSize
- *  sets size in bytes of target file
- *
- *  "size" [ IN ] - new file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectorySetFileSize ( KDirectory *self,
-    uint64_t size, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVSetFileSize ( KDirectory *self,
-    uint64_t size, const char *path, va_list args );
-
-/* FileLocator
- *  returns a 64-bit key pretinent only to the particular file
- *  system device holding tha file.
- *
- *  It can be used as a form of sort key except that it is not 
- *  guaranteed to be unique.
- *
- *  "locator" [ OUT ] - return parameter for file locator
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryFileLocator ( const KDirectory *self,
-    uint64_t *locator, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVFileLocator ( const KDirectory *self,
-    uint64_t *locator, const char *path, va_list args );
-
-/* FileContiguous
- *  returns true if the file is "contiguous".  Chunked or sparse files are not
- *  contiguous while most data files are.  Virtual generated files would likely
- *  not be contiguous.  
- *
- *  "contiguous" [ OUT ] - return parameter for file contiguous
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryFileContiguous ( const KDirectory *self,
-    bool *contiguous, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVFileContiguous ( const KDirectory *self,
-    bool *contiguous, const char *path, va_list args );
-
-/* OpenDirRead
- * OpenDirUpdate
- *  opens a sub-directory
- *
- *  "chroot" [ IN ] - if true, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-KFS_EXTERN rc_t CC KDirectoryOpenDirRead ( const KDirectory *self,
-    const KDirectory **sub, bool chroot, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenDirRead ( const KDirectory *self,
-    const KDirectory **sub, bool chroot, const char *path, va_list args );
-
-KFS_EXTERN rc_t CC KDirectoryOpenDirUpdate ( KDirectory *self,
-    KDirectory **sub, bool chroot, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenDirUpdate ( KDirectory *self,
-    KDirectory **sub, bool chroot, const char *path, va_list args );
-
-/* CreateDir
- *  create a sub-directory
- *
- *  "access" [ IN ] - standard Unix directory mode, e.g.0775
- *
- *  "mode" [ IN ] - a creation mode ( see explanation in defs.h ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-KFS_EXTERN rc_t CC KDirectoryCreateDir ( KDirectory *self,
-    uint32_t access, KCreateMode mode, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVCreateDir ( KDirectory *self,
-    uint32_t access, KCreateMode mode, const char *path, va_list args );
-
-
-/* CopyPath
- *  copies a file
- *
- *  "src_path" [ IN ] - path to source-file
- *
- *  "dst_path" [ IN ] - file to create
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-KFS_EXTERN rc_t CC KDirectoryCopyPath ( const KDirectory *src_dir,
-    KDirectory *dst_dir, const char *src_path, const char *dst_path );
-
-
-/* CopyPaths
- *  copies files, optional recursive in sub-dirs...
- *
- *  "recursive" [ IN ] - handle subdir's recursivly
- *
- *  "src" [ IN ] - what directory to copy
- *
- *  "dst" [ IN ] - into what directory to copy
- *      ( will be created if it does not already exist )
- *
- */
-KFS_EXTERN rc_t CC KDirectoryCopyPaths ( const KDirectory * src_dir,
-    KDirectory *dst_dir, bool recursive, const char *src, const char *dst );
-
-
-/* Copy
- *  detects if src is a file or a directory
- *
- *  "recursive" [ IN ] - handle subdir's recursivly 
- *            ( if srs is a directory )
- *
- *  "src" [ IN ] - what file/directory to copy
- *
- *  "dst" [ IN ] - into what file/directory to copy
- *      ( will be created if it does not already exist )
- *
- */
-KFS_EXTERN rc_t CC KDirectoryCopy ( const KDirectory *src_dir,
-    KDirectory *dst_dir, bool recursive, const char *src, const char *dst );
-
-
-/* NativeDir
- *  returns a native file-system directory node reference
- *  the directory root will be "/" and set to the native
- *  idea of current working directory
- *
- *  NB - the returned reference will be non-const, allowing
- *  modification operations to be attempted. these operations
- *  may still fail if the underlying FS disallows them.
- *
- *  "dir" [ OUT ] - return parameter for native directory
- */
-KFS_EXTERN rc_t CC KDirectoryNativeDir ( KDirectory **dir );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_directory_ */
diff --git a/interfaces/kfs/directory.hpp b/interfaces/kfs/directory.hpp
deleted file mode 100644
index 3b99a97..0000000
--- a/interfaces/kfs/directory.hpp
+++ /dev/null
@@ -1,582 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kfs_directory_
-#define _hpp_kfs_directory_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  a container node within file system
- */
-struct KDirectory {
-    /* AddRef
-     * Release
-     *  ignores NULL references
-     */
-    inline rc_t AddRef ( void ) const throw ()
-    { return KDirectoryAddRef ( this ); }
-    inline rc_t Release ( void ) const throw ()
-    { return KDirectoryRelease ( this ); }
-
-
-    /* List
-     *  create a directory listing
-     *
-     *  "list" [ OUT ] - return parameter for list object
-     *
-     *  "f" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ] - optional
-     *  filter function to execute on each path. receives a base directory
-     *  and relative path for each entry. if "f" returns true, the name will
-     *  be added to the list.
-     *
-     *  "path" [ IN, NULL OKAY ] - optional parameter for target
-     *  directory. if NULL, interpreted to mean "."
-     */
-    inline rc_t List ( struct KNamelist **list,
-        bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-        void *data,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVList ( this, list, f, data, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t List ( struct KNamelist **list,
-        bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-        void *data,
-        const char *path, va_list args ) const throw ()
-    { return KDirectoryVList ( this, list, f, data, path, args ); }
-
-
-    /* Visit
-     *  visit each path under designated directory
-     *
-     *  "recurse" [ IN ] - if true, recursively visit sub-directories
-     *
-     *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
-     *  on each path. receives a base directory and relative path
-     *  for each entry. if "f" returns true, the iteration will
-     *  terminate and that value will be returned. NB - "dir" will not
-     *  be the same as "self".
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native character set
-     */
-    inline rc_t Visit ( bool recurse,
-        rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-        void *data,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVVisit ( this, recurse, f, data, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Visit ( bool recurse,
-        rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-        void *data,
-        const char *path, va_list args ) const throw ()
-    { return KDirectoryVVisit ( this, recurse, f, data, path, args ); }
-
-
-    /* VisitUpdate
-     *  like Visit except that the directory passed back to "f"
-     *  is available for update operations
-     */
-    inline rc_t VisitUpdate ( bool recurse,
-        rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-        void *data,
-        const char *path, ... ) throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVVisitUpdate ( this, recurse, f, data, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t VisitUpdate ( bool recurse,
-        rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-        void *data,
-        const char *path, va_list args ) throw ()
-    { return KDirectoryVVisitUpdate ( this, recurse, f, data, path, args ); }
-
-
-    /* PathType
-     *  returns a KPathType
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native character set
-     */
-    inline uint32_t PathType ( const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        uint32_t r = KDirectoryVPathType ( this, path, args );
-        va_end ( args );
-        return r;
-    }
-    inline uint32_t PathType ( const char *path, va_list args ) const throw ()
-    { return KDirectoryVPathType ( this, path, args ); }
-
-
-    /* ResolvePath
-     *  resolves path to an absolute or directory-relative path
-     *
-     *  "absolute" [ IN ] - if true, always give a path starting
-     *  with '/'. NB - if the directory is chroot'd, the absolute path
-     *  will still be relative to directory root.
-     *
-     *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
-     *  NUL terminated result path in directory-native character set
-     *  the resolved path will be directory relative
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target path. NB - need not exist.
-    */
-    inline rc_t ResolvePath ( bool absolute, char *resolved, size_t rsize,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVResolvePath ( this, absolute, resolved, rsize, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t ResolvePath ( bool absolute, char *resolved, size_t rsize,
-        const char *path, va_list args ) const throw ()
-    { return KDirectoryVResolvePath ( this, absolute, resolved, rsize, path, args ); }
-
-
-    /* ResolveAlias
-     *  resolves an alias path to its immediate target
-     *  NB - the resolved path may be yet another alias
-     *
-     *  "absolute" [ IN ] - if true, always give a path starting
-     *  with '/'. NB - if the directory is chroot'd, the absolute path
-     *  will still be relative to directory root.
-     *
-     *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
-     *  NUL terminated result path in directory-native character set
-     *  the resolved path will be directory relative
-     *
-     *  "alias" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting an object presumed to be an alias.
-     */
-     inline rc_t ResolveAlias ( bool absolute, char *resolved, size_t rsize, 
-        const char *alias, ... ) const throw ()
-     {
-        va_list args;
-        va_start ( args, alias );
-        rc_t rc = KDirectoryVResolveAlias ( this, absolute, resolved, rsize, alias, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t ResolveAlias ( bool absolute, char *resolved, size_t rsize, 
-        const char *alias, va_list args ) const throw ()
-     { return KDirectoryVResolveAlias ( this, absolute, resolved, rsize, alias, args ); }
-
-
-     /* Rename
-     *  rename an object accessible from directory, replacing
-     *  any existing target object of the same type
-     *
-     *  "from" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting existing object
-     *
-     *  "to" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting existing object
-     *
-     *  "force" [ IN ] - not false means try to do more if it fails internally
-     */
-     inline rc_t Rename ( bool force, const char *from, const char *to ) throw ()
-     {  return KDirectoryRename ( this, force, from, to );  }
-
-
-     /* Remove
-     *  remove an accessible object from its directory
-     *
-     *  "force" [ IN ] - if true and target is a directory,
-     *  remove recursively
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     */
-     inline rc_t Remove ( bool force, const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVRemove ( this, force, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t Remove ( bool force, const char *path, va_list args ) throw ()
-     { return KDirectoryVRemove ( this, force, path, args ); }
-
-
-     /* ClearDir
-     *  remove all directory contents
-     *
-     *  "force" [ IN ] - if true and directory entry is a
-     *  sub-directory, remove recursively
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target directory
-     */
-     inline rc_t ClearDir ( bool force, const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVClearDir ( this, force, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t ClearDir ( bool force, const char *path,
-        va_list args ) throw ()
-     { return KDirectoryVClearDir ( this, force, path, args ); }
-
-
-     /* Access
-     *  get access to object
-     *
-     *  "access" [ OUT ] - return parameter for Unix access mode
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     */
-     inline rc_t Access ( uint32_t *access,
-        const char *path, ... ) const throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVAccess ( this, access, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t Access ( uint32_t *access, const char *path, 
-        va_list args ) const throw ()
-     { return KDirectoryVAccess ( this, access, path, args ); }
-
-
-     /* SetAccess
-     *  set access to object a la Unix "chmod"
-     *
-     *  "recurse" [ IN ] - if non zero and "path" is a directory,
-     *  apply changes recursively.
-     *
-     *  "access" [ IN ] and "mask" [ IN ] - definition of change
-     *  where "access" contains new bit values and "mask defines
-     *  which bits should be changed.
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     */
-     inline rc_t SetAccess ( bool recurse, uint32_t access, uint32_t mask,
-        const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVSetAccess ( this, recurse, access, mask, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t SetAccess ( bool recurse, uint32_t access, uint32_t mask,
-        const char *path, va_list args ) throw ()
-     { return KDirectoryVSetAccess ( this, recurse, access, mask, path, args ); }
-
-
-     /* Date
-     *  get date/time to object
-     *
-     *  "date" [ OUT ] - return parameter
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     */
-     inline rc_t Date ( KTime_t *date, const char *path, ... ) const throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVDate ( this, date, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t Date ( KTime_t *date, const char *path,
-        va_list args ) const throw ()
-     { return KDirectoryVDate ( this, date, path, args ); }
-
-
-     /* SetDate
-     *  set date to object
-     *
-     *  "recurse" [ IN ] - if non zero and "path" is a directory,
-     *  apply changes recursively.
-     *
-     *  "date" [ IN ] - new time and date for the object
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     */
-     inline rc_t SetDate ( bool recurse, KTime_t date,
-        const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVSetDate ( this, recurse, date, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t SetDate ( bool recurse, KTime_t date, const char *path,
-        va_list args ) throw ()
-     { return KDirectoryVSetDate ( this, recurse, date, path, args ); }
-
-
-     /* CreateAlias
-     *  creates a path alias according to create mode
-     *
-     *  "access" [ IN ] - standard Unix directory access mode
-     *  used when "mode" has kcmParents set and alias path does
-     *  not exist.
-     *
-     *  "mode" [ IN ] - a creation mode ( see explanation above ).
-     *
-     *  "targ" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target object
-     *
-     *  "alias" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target alias
-     */
-     inline rc_t CreateAlias ( uint32_t access, KCreateMode mode,
-        const char *targ, const char *alias ) throw ()
-     { return KDirectoryCreateAlias ( this, access, mode, targ, alias ); }
-
-
-    /* OpenFileRead
-     *  opens an existing file with read-only access
-     *
-     *  "f" [ OUT ] - return parameter for newly opened file
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target file
-     */
-    inline rc_t OpenFileRead ( struct KFile const **f,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVOpenFileRead ( this, f, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenFileRead ( struct KFile const **f, const char *path,
-        va_list args ) const throw ()
-    { return KDirectoryVOpenFileRead ( this, f, path, args ); }
-
-
-    /* OpenFileWrite
-     *  opens an existing file with write access
-     *
-     *  "f" [ OUT ] - return parameter for newly opened file
-     *
-     *  "update" [ IN ] - if true, open in read/write mode
-     *  otherwise, open in write-only mode
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target file
-     */
-    inline rc_t OpenFileWrite ( struct KFile **f, bool update,
-        const char *path, ... ) throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVOpenFileWrite ( this, f, update, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenFileWrite ( struct KFile **f, bool update,
-        const char *path, va_list args ) throw ()
-    { return KDirectoryVOpenFileWrite ( this, f, update, path, args ); }
-
-
-    /* CreateFile
-     *  opens a file with write access
-     *
-     *  "f" [ OUT ] - return parameter for newly opened file
-     *
-     *  "update" [ IN ] - if true, open in read/write mode
-     *  otherwise, open in write-only mode
-     *
-     *  "access" [ IN ] - standard Unix access mode, e.g. 0664
-     *
-     *  "mode" [ IN ] - a creation mode ( see explanation above ).
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target file
-     */
-     inline rc_t CreateFile ( struct KFile **f, bool update, uint32_t access,
-        KCreateMode mode, const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVCreateFile ( this, f, update, access, mode, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t CreateFile ( struct KFile **f, bool update, uint32_t access,
-        KCreateMode mode, const char *path, va_list args ) throw ()
-     { return KDirectoryVCreateFile ( this, f, update, access, mode, path, args ); }
-
-
-     /* FileSize
-     *  returns size in bytes of target file
-     *
-     *  "size" [ OUT ] - return parameter for file size
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target file
-     */
-     inline rc_t FileSize ( uint64_t *size, 
-        const char *path, ... ) const throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVFileSize ( this, size, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t FileSize ( uint64_t *size, const char *path,
-        va_list args ) const throw ()
-     { return KDirectoryVFileSize ( this, size, path, args ); }
-
-
-     /* SetFileSize
-     *  sets size in bytes of target file
-     *
-     *  "size" [ IN ] - new file size
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target file
-     */
-     inline rc_t SetFileSize ( uint64_t size, const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVSetFileSize ( this, size, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t SetFileSize ( uint64_t size, const char *path,
-        va_list args ) throw ()
-     { return KDirectoryVSetFileSize ( this, size, path, args ); }
-
-
-     /* OpenDirRead
-     * OpenDirUpdate
-     *  opens a sub-directory
-     *
-     *  "chroot" [ IN ] - if true, the new directory becomes
-     *  chroot'd and will interpret paths beginning with '/'
-     *  relative to itself.
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target directory
-     */
-     inline rc_t OpenDirRead ( const KDirectory **sub, bool chroot,
-        const char *path, ... ) const throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVOpenDirRead ( this, sub, chroot, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t OpenDirRead ( const KDirectory **sub, bool chroot,
-        const char *path, va_list args ) const throw ()
-     { return KDirectoryVOpenDirRead ( this, sub, chroot, path, args ); }
-
-     inline rc_t OpenDirUpdate ( KDirectory **sub, bool chroot,
-        const char *path, ... )
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVOpenDirUpdate ( this, sub, chroot, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t OpenDirUpdate ( KDirectory **sub, bool chroot,
-        const char *path, va_list args ) throw ()
-     { return KDirectoryVOpenDirUpdate ( this, sub, chroot, path, args ); }
-
-     /* CreateDir
-     *  create a sub-directory
-     *
-     *  "access" [ IN ] - standard Unix directory mode, e.g.0775
-     *
-     *  "mode" [ IN ] - a creation mode ( see explanation above ).
-     *
-     *  "path" [ IN ] - NUL terminated string in directory-native
-     *  character set denoting target directory
-     */
-     inline rc_t CreateDir ( uint32_t access, KCreateMode mode,
-        const char *path, ... ) throw ()
-     {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = KDirectoryVCreateDir ( this, access, mode, path, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t CreateDir ( uint32_t access, KCreateMode mode,
-        const char *path, va_list args ) throw ()
-     { return  KDirectoryVCreateDir ( this, access, mode, path, args ); }
-
-
-    /* NativeDir
-     *  returns a native file-system directory node reference
-     *  the directory root will be "/" and set to the native
-     *  idea of current working directory
-     *
-     *  NB - the returned reference will be non-const, allowing
-     *  modification operations to be attempted. these operations
-     *  may still fail if the underlying FS disallows them.
-     *
-     *  "dir" [ OUT ] - return parameter for native directory
-     */
-    inline static rc_t NativeDir ( KDirectory **dir ) throw ()
-    { return KDirectoryNativeDir ( dir ); }
-
-private:
-    KDirectory ();
-    ~ KDirectory ();
-    KDirectory ( const KDirectory& );
-    KDirectory &operator = ( const KDirectory& );
-};
-
-#endif /* _hpp_kfs_directory_ */
diff --git a/interfaces/kfs/dyload.h b/interfaces/kfs/dyload.h
deleted file mode 100644
index e06958a..0000000
--- a/interfaces/kfs/dyload.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_dyload_
-#define _h_kfs_dyload_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KDyld
- *  dynamic library loader
- *
- *  maintains cache of libraries it has opened while they remain open
- *  such that subsequent requests for an open library will return a
- *  new reference to the existing library.
- */
-typedef struct KDyld KDyld;
-
-
-/* Make
- *  create a dynamic loader object
- *
- *  "dl" [ OUT ] - return parameter for loader
- */
-KFS_EXTERN rc_t CC KDyldMake ( KDyld **dl );
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KDyldAddRef ( const KDyld *self );
-KFS_EXTERN rc_t CC KDyldRelease ( const KDyld *self );
-
-
-/* AddSearchPath
- *  add a search path to loader for locating library files
- */
-KFS_EXTERN rc_t CC KDyldAddSearchPath ( KDyld *self, const char *path, ... );
-KFS_EXTERN rc_t CC KDyldVAddSearchPath ( KDyld *self, const char *path, va_list args );
-
-
-/* HomeDirectory
- *  returns a KDirectory where the binary for a given function is located
- *
- *  "dir" [ OUT ] - return parameter for home directory ( read-only ), if found
- *
- *  "func" [ IN ] - function pointer within binary to be located
- */
-KFS_EXTERN rc_t CC KDyldHomeDirectory ( const KDyld *self,
-    struct KDirectory const **dir, fptr_t func );
-
-
-/*--------------------------------------------------------------------------
- * KDylib
- *  dynamic library
- */
-typedef struct KDylib KDylib;
-
-
-/* LoadLib
- *  load a dynamic library
- *
- *  "lib" [ OUT ] - return parameter for loaded library
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target library
- */
-KFS_EXTERN rc_t CC KDyldLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, ... );
-KFS_EXTERN rc_t CC KDyldVLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, va_list args );
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KDylibAddRef ( const KDylib *self );
-KFS_EXTERN rc_t CC KDylibRelease ( const KDylib *self );
-
-
-/* FullPath
- *  return full path to library
- */
-KFS_EXTERN rc_t CC KDylibFullPath ( const KDylib *self, char *path, size_t psize );
-
-
-/*--------------------------------------------------------------------------
- * KDlset
- *  set of dynamic libraries
- *  contained libraries remain resident until set is released
- */
-typedef struct KDlset KDlset;
-
-
-/* MakeSet
- *  load a dynamic library
- *
- *  "set" [ OUT ] - return parameter for lib set
- */
-KFS_EXTERN rc_t CC KDyldMakeSet ( const KDyld *self, KDlset **set );
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KDlsetAddRef ( const KDlset *self );
-KFS_EXTERN rc_t CC KDlsetRelease ( const KDlset *self );
-
-
-/* AddLib
- *  adds a dynamic library to set
- *  returns "rcExists" error if already present
- *
- *  "lib" [ IN ] - library returned from KDyldLoadLib
- */
-KFS_EXTERN rc_t CC KDlsetAddLib ( KDlset *self, KDylib *lib );
-
-
-/* AddAll
- *  adds all dynamic libraries found in dl search path
- */
-KFS_EXTERN rc_t CC KDlsetAddAll ( KDlset *self );
-
-
-/*--------------------------------------------------------------------------
- * KSymAddr
- *  symbol address within a dynamic library
- */
-typedef struct KSymAddr KSymAddr;
-
-
-/* Symbol
- *  find a symbol within dynamic library
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- */
-KFS_EXTERN rc_t CC KDylibSymbol ( const KDylib *self, KSymAddr **sym, const char *name );
-KFS_EXTERN rc_t CC KDlsetSymbol ( const KDlset *self, KSymAddr **sym, const char *name );
-
-
-/* FirstSymbol
- * LastSymbol
- *  find a symbol within dynamic library set matching criteria
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- *
- *  "test" [ IN ] and "data" [ IN, OPAQUE ] - callback filter function
- *  return true if symbol matches criteria
- */
-KFS_EXTERN rc_t CC KDlsetFirstSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data );
-KFS_EXTERN rc_t CC KDlsetLastSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data );
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KSymAddrAddRef ( const KSymAddr *self );
-KFS_EXTERN rc_t CC KSymAddrRelease ( const KSymAddr *self );
-
-
-/* AsObj
- * AsFunc
- *  retrieve symbol address as pointer to object
- */
-KFS_EXTERN void *CC KSymAddrAsObj ( const KSymAddr *self );
-KFS_EXTERN void CC KSymAddrAsFunc ( const KSymAddr *self, fptr_t *fp );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_dyload_ */
diff --git a/interfaces/kfs/extern.h b/interfaces/kfs/extern.h
deleted file mode 100644
index 0ea1d3c..0000000
--- a/interfaces/kfs/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_extern_
-#define _h_kfs_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define KFS_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KFS_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kfs_extern_ */
diff --git a/interfaces/kfs/ffext.h b/interfaces/kfs/ffext.h
deleted file mode 100644
index ab4f16a..0000000
--- a/interfaces/kfs/ffext.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_fileformat_ext_
-#define _h_kfs_fileformat_ext_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFileFormat;
-
-KFS_EXTERN rc_t CC KExtFileFormatMake (struct KFileFormat ** pft,
-                                       const char* ext, size_t extlen,
-                                       const char * typeAndClass, size_t tclen);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_fileformat_ext_ */
diff --git a/interfaces/kfs/ffmagic.h b/interfaces/kfs/ffmagic.h
deleted file mode 100644
index 4049a49..0000000
--- a/interfaces/kfs/ffmagic.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_fileformat_magic_
-#define _h_kfs_fileformat_magic_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFileFormat;
-
-KFS_EXTERN rc_t CC KMagicFileFormatMake (struct KFileFormat ** pft, const char * magic_path,
-			const char* magic, size_t magiclen,
-			const char * typeAndClass, size_t tclen);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_fileformat_magic_ */
diff --git a/interfaces/kfs/file.h b/interfaces/kfs/file.h
deleted file mode 100644
index 47fe143..0000000
--- a/interfaces/kfs/file.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_file_
-#define _h_kfs_file_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KFileDesc
- *  describes basic file types
- */
-enum KFileDesc
-{
-    kfdNull,
-    kfdInvalid,
-    kfdFile,
-    kfdCharDev,
-    kfdBlockDev,
-    kfdFIFO,
-    kfdSocket,
-
-    /* the type enum may be extended */
-    kfdLastDefined
-};
-
-
-/*--------------------------------------------------------------------------
- * KFile
- *  a file is normally created with a KDirectory
- *  optionally, the 3 standard i/o files may be created directly
- */
-typedef struct KFile KFile;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KFileAddRef ( const KFile *self );
-KFS_EXTERN rc_t CC KFileRelease ( const KFile *self );
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *
- *  certain file types will refuse random access
- *  these include FIFO and socket based files, but also
- *  wrappers that require serial access ( e.g. compression )
- *
- *  returns 0 if random access, error code otherwise
- */
-KFS_EXTERN rc_t CC KFileRandomAccess ( const KFile *self );
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-KFS_EXTERN uint32_t CC KFileType ( const KFile *self );
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-KFS_EXTERN rc_t CC KFileSize ( const KFile *self, uint64_t *size );
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-KFS_EXTERN rc_t CC KFileSetSize ( KFile *self, uint64_t size );
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of file.
- */
-KFS_EXTERN rc_t CC KFileRead ( const KFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read );
-
-/* ReadAll
- *  read from file until "bsize" bytes have been retrieved
- *  or until end-of-input
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of file.
- */
-KFS_EXTERN rc_t CC KFileReadAll ( const KFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read );
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-KFS_EXTERN rc_t CC KFileWrite ( KFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ );
-
-/* WriteAll
- *  write to file until "size" bytes have been transferred
- *  or until no further progress can be made
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-KFS_EXTERN rc_t CC KFileWriteAll ( KFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ );
-
-/* MakeStdIn
- *  creates a read-only file on stdin
- */
-KFS_EXTERN rc_t CC KFileMakeStdIn ( const KFile **std_in );
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only file on stdout or stderr
- */
-KFS_EXTERN rc_t CC KFileMakeStdOut ( KFile **std_out );
-KFS_EXTERN rc_t CC KFileMakeStdErr ( KFile **std_err );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_file_ */
diff --git a/interfaces/kfs/file.hpp b/interfaces/kfs/file.hpp
deleted file mode 100644
index 866a960..0000000
--- a/interfaces/kfs/file.hpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kfs_file_
-#define _hpp_kfs_file_
-
-#ifndef _h_kfs_file_
-#include <kfs/file.h>
-#endif
-
-//#include <kfs/md5.h> // KFileMakeMd5ForReadFromString
-
-/*--------------------------------------------------------------------------
- * KFile
- *  a file
- */
-struct KFile
-{
-    /* AddRef
-     * Release
-     *  ignores NULL references
-     */
-    inline rc_t AddRef () const throw ()
-    { return KFileAddRef ( this ); }
-
-    inline rc_t Release () const throw ()
-    { return KFileRelease ( this ); }
-
-    /* RandomAccess
-     *  ALMOST by definition, the file is random access
-     *
-     *  certain file types will refuse random access
-     *  these include FIFO and socket based files, but also
-     *  wrappers that require serial access ( e.g. compression )
-     *
-     *  returns 0 if random access, error code otherwise
-    */
-    inline rc_t RandomAccess () const throw()
-    { return KFileRandomAccess ( this ); }
-
-
-    /* Type
-     *  returns a KFileDesc
-     *  not intended to be a content type,
-     *  but rather an implementation class
-     */
-    inline uint32_t FileType() const throw()
-    { return KFileType ( this ); }
-
-
-    /* Size
-     *  returns size in bytes of file
-     *
-     *  "size" [ OUT ] - return parameter for file size
-     */
-    inline rc_t Size ( uint64_t *size ) const throw ()
-    { return KFileSize ( this, size ); }
-
-    /* SetSize
-     *  sets size in bytes of file
-     *
-     *  "size" [ IN ] - new file size
-     */
-    inline rc_t SetSize ( uint64_t size ) throw ()
-    { return KFileSetSize ( this, size ); }
-
-    /* Read
-     *  read file from known position
-     *
-     *  "pos" [ IN ] - starting position within file
-     *
-     *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
-     *
-     *  "num_read" [ OUT ] - return parameter giving number of bytes
-     *  actually read. when returned value is zero and return code is
-     *  also zero, interpreted as end of file.
-     */
-    inline rc_t Read ( uint64_t pos,
-        void *buffer, size_t bsize, size_t *num_read ) const throw ()
-    { return KFileRead ( this, pos, buffer, bsize, num_read ); }
-
-    /* Write
-     *  write file at known position
-     *
-     *  "pos" [ IN ] - starting position within file
-     *
-     *  "buffer" [ IN ] and "size" [ IN ] - data to be written
-     *
-     *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
-     *  giving number of bytes actually written
-     */
-    inline rc_t Write ( uint64_t pos,
-        const void *buffer, size_t size, size_t *num_writ ) throw ()
-    { return KFileWrite ( this, pos, buffer, size, num_writ ); }
-
-    /* MakeStdIn
-     *  creates a read-only file on stdin
-     */
-    static inline rc_t MakeStdIn ( const KFile **std_in ) throw ()
-    { return KFileMakeStdIn ( std_in ); }
-
-    /* MakeStdOut
-     * MakeStdErr
-     *  creates a write-only file on stdout or stderr
-     */
-    static inline rc_t MakeStdOut ( KFile **std_out ) throw ()
-    { return KFileMakeStdOut ( std_out ); }
-    static inline rc_t MakeStdErr ( KFile **std_err ) throw ()
-    { return KFileMakeStdErr ( std_err ); }
-     
-
-    /*/ MD5
-    static inline rc_t MakeMd5ForRead ( const KFile **f,
-        const KFile *src, const char digest[MD5_DIGEST_SIZE] )
-    { return KFileMakeMd5ForReadFromString ( f, src, digest ); }*/
-
-private:
-    KFile ();
-    ~ KFile ();
-    KFile ( const KFile& );
-    KFile &operator = ( const KFile& );
-};
-
-#endif // _hpp_kfs_file_
diff --git a/interfaces/kfs/fileformat.h b/interfaces/kfs/fileformat.h
deleted file mode 100644
index b68c635..0000000
--- a/interfaces/kfs/fileformat.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_fileformat_
-#define _h_kfs_fileformat_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-
-/*
- * Multiple descriptions can be attached to a single key.
- * At most one key can be attached to a single description.
- *
- * Multiple types can be attached to a single class.
- * At most one class can be attached to a single type.
- */
-
-
-/*--------------------------------------------------------------------------
- * KFileFormatType
- *  describes basic file content types.  The type can be used to choose what
- *  parser is used to extract information for a loader, archive as filesystem,
- *  or decompress for further parsing.
- */
-typedef
-int32_t KFileFormatType;
-enum KFileFormatType_e
-{
-    kfftError = -2,		/* A file that can not be read for typing */
-    kfftNotFound = -1,		/* not found in a search */
-    kfftUnknown = 0		/* not yet or file format not understood. */
-    /* other types are registered during construction **?** */
-};
-
-/* -------------------------------------------------------------------------
- * KFileFormatClass
- *   Describes which class of operations can be performed in a given file.
- *     Unknown: nothing in particular
- *     Compressed: decompressed to reveal different expanded file contents
- *     Archive: treated as a file system to reach contained files
- *     Run: loaded into the SRA DB
- */
-typedef
-int32_t KFileFormatClass;
-enum KFileFormatClass_e
-{
-    kffcError = -2,		/* A file that can not be read for typing */
-    kffcNotFound = -1,		/* not found in a search */
-    kffcUnknown = 0		/* not yet or file format not understood. */
-};
-
-/*--------------------------------------------------------------------------
- * KFileFormat
- */
-typedef struct KFileFormat KFileFormat;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KFileFormatAddRef (const KFileFormat *self);
-KFS_EXTERN rc_t CC KFileFormatRelease (const KFileFormat *self);
-
-/* Type
- *  intended to be a content type,
- *  if type, class or desc is NULL those types are not returned
- */
-KFS_EXTERN rc_t CC KFileFormatGetTypeBuff (const KFileFormat *self, const void * buff, size_t buff_len,
-			KFileFormatType * type, KFileFormatClass * class,
-			char * description, size_t descriptionmax,
-			size_t * length);
-
-#define KFileFormatGetTypeBuffType(self,buff,buff_len,type) \
-    KFileFormatGetTypeBuff(self,buff,buff_len,type,NULL,NULL,0,NULL)
-
-#define KFileFormatGetTypeBuffClass(self,buff,buff_len,class) \
-    KFileFormatGetTypeBuff(self,buff,buff_len,NULL,class,NULL,0,NULL)
-
-/* useful for logging perhaps */
-#define KFileFormatGetTypeBuffDescr(self,buff,buff_len,descr,descr_max,descr_len)	\
-    KFileFormatGetTypeBuff(self,buff,buff_len,NULL,NULL,descr,descr_max,descr_len)
-
-KFS_EXTERN rc_t CC KFileFormatGetTypePath(const KFileFormat *self, const struct KDirectory * dir,
-                                          const char * path, KFileFormatType * type,
-                                          KFileFormatClass * class, char * description,
-                                          size_t descriptionmax, size_t * length);
-#define KFileFormatGetTypePathType(self,dir,path,type)			\
-    KFileFormatGetTypePath(self,dir,path,type,NULL,NULL,0,NULL)
-
-#define KFileFormatGetTypePathClass(self,dir,path,class)			\
-    KFileFormatGetTypePath(self,dir,path,NULL,class,NULL,0,NULL)
-
-/* useful for logging perhaps */
-#define KFileFormatGetTypePathDescr(self,dir,path,descr,descr_max,descr_len) \
-    KFileFormatGetTypePath(self,dir,path,NULL,NULL,descr,descr_max,descr_len)
-
-
-KFS_EXTERN rc_t CC KFileFormatGetClassDescr (const KFileFormat *self, KFileFormatClass c,
-			char * description, size_t descriptionmax);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_fileformat_ */
diff --git a/interfaces/kfs/gzip.h b/interfaces/kfs/gzip.h
deleted file mode 100644
index c5639fc..0000000
--- a/interfaces/kfs/gzip.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_gzip_
-#define _h_kfs_gzip_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-/* MakeGzipForRead
- *  creates an adapter to gunzip a source file
- *
- *  "gz" [ OUT ] - return parameter for decompressed file
- *
- *  "src" [ IN ] - compressed source file with read permission
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeGzipForRead ( struct KFile const **gz, struct KFile const *src );
-
-
-/* MakeGzipForWrite
- *  creates an adapter to gzip a source file
- *
- *  "gz" [ OUT ] - return parameter for compressed file
- *
- *  "src" [ IN ] - uncompressed source file with write permission
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeGzipForWrite ( struct KFile **gz, struct KFile *file );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_gzip_ */
diff --git a/interfaces/kfs/impl.h b/interfaces/kfs/impl.h
deleted file mode 100644
index 94f3636..0000000
--- a/interfaces/kfs/impl.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_impl_
-#define _h_kfs_impl_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_kfs_file_
-#include <kfs/file.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_kfs_arrayfile_
-#include <kfs/arrayfile.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KBufFile;
-struct KSysDir;
-struct KSysFile;
-typedef union KFile_vt KFile_vt;
-typedef union KDirectory_vt KDirectory_vt;
-
-
-/*--------------------------------------------------------------------------
- * KFile
- *  a virtual file
- */
-struct KFile
-{
-    const KFile_vt *vt;
-    const KDirectory *dir;
-    KRefcount refcount;
-    uint8_t read_enabled;
-    uint8_t write_enabled;
-    uint8_t align [ 2 ];
-};
-
-#ifndef KFILE_IMPL
-#define KFILE_IMPL struct KFile
-#endif
-
-typedef struct KFile_vt_v1 KFile_vt_v1;
-struct KFile_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KFILE_IMPL *self );
-    struct KSysFile* ( CC * get_sysfile ) ( const KFILE_IMPL *self, uint64_t *offset );
-    rc_t ( CC * random_access ) ( const KFILE_IMPL *self );
-    rc_t ( CC * get_size ) ( const KFILE_IMPL *self, uint64_t *size );
-    rc_t ( CC * set_size ) ( KFILE_IMPL *self, uint64_t size );
-    /* num_read and num_writ are guaranteed non-NULL */
-    rc_t ( CC * read ) ( const KFILE_IMPL *self, uint64_t pos,
-        void *buffer, size_t bsize, size_t *num_read );
-    rc_t ( CC * write ) ( KFILE_IMPL *self, uint64_t pos,
-        const void *buffer, size_t size, size_t *num_writ );
-    /* end minor version == 0 */
-
-    /* start minor version == 1 */
-    uint32_t ( CC * get_type ) ( const KFILE_IMPL * self );
-    /* end minor version == 1 */
-
-    /* ANY NEW ENTRIES MUST BE REFLECTED IN libs/kfs/file.c
-       BY BOTH THE CORRESPONDING MESSAGE DISPATCH FUNCTION(s) AND
-       VTABLE VALIDITY CHECKS IN KFileInit */
-};
-
-union KFile_vt
-{
-    KFile_vt_v1 v1;
-};
-
-/* Init
- *  initialize a newly allocated file object
- */
-KFS_EXTERN rc_t CC KFileInit ( KFile *self, const KFile_vt *vt,
-    const char *classname, const char *fname,
-    bool read_enabled, bool write_enabled );
-
-/* Destroy
- *  destroy file
- */
-KFS_EXTERN rc_t CC KFileDestroy ( KFile *self );
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-KFS_EXTERN struct KSysFile* CC KFileGetSysFile ( const KFile *self, uint64_t *offset );
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  a virtual directory
- */
-struct KDirectory
-{
-    const KDirectory_vt *vt;
-    KRefcount refcount;
-    uint8_t read_only;
-    uint8_t align [ 3 ];
-};
-
-#ifndef KDIR_IMPL
-#define KDIR_IMPL KDirectory
-#endif
-
-typedef struct KDirectory_vt_v1 KDirectory_vt_v1;
-struct KDirectory_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KDIR_IMPL *self );
-    rc_t ( CC * list_dir ) ( const KDIR_IMPL *self, struct KNamelist **list,
-         bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-         void *data, const char *path, va_list args );
-    rc_t ( CC * visit ) ( const KDIR_IMPL *self, bool recurse,
-        rc_t ( CC * f ) ( const KDirectory*, uint32_t, const char*, void* ),
-        void *data, const char *path, va_list args );
-    rc_t ( CC * visit_update ) ( KDIR_IMPL *self, bool recurse,
-        rc_t ( CC * f ) ( KDirectory*, uint32_t, const char*, void* ),
-        void *data, const char *path, va_list args );
-    uint32_t ( CC * path_type ) ( const KDIR_IMPL *self, const char *path, va_list args );
-    rc_t ( CC * resolve_path ) ( const KDIR_IMPL *self, bool absolute,
-        char *resolved, size_t rsize, const char *path, va_list args );
-    rc_t ( CC * resolve_alias ) ( const KDIR_IMPL *self, bool absolute,
-        char *resolved, size_t rsize, const char *alias, va_list args );
-    rc_t ( CC * rename ) ( KDIR_IMPL *self, bool force, const char *from, const char *to );
-    rc_t ( CC * remove ) ( KDIR_IMPL *self, bool force, const char *path, va_list args );
-    rc_t ( CC * clear_dir ) ( KDIR_IMPL *self, bool force, const char *path, va_list args );
-    rc_t ( CC * access ) ( const KDIR_IMPL *self,
-        uint32_t *access, const char *path, va_list args );
-    rc_t ( CC * set_access ) ( KDIR_IMPL *self, bool recurse,
-        uint32_t access, uint32_t mask, const char *path, va_list args );
-    rc_t ( CC * create_alias ) ( KDIR_IMPL *self, uint32_t access,
-        KCreateMode mode, const char *targ, const char *alias );
-    rc_t ( CC * open_file_read ) ( const KDIR_IMPL *self,
-        const KFile **f, const char *path, va_list args );
-    rc_t ( CC * open_file_write ) ( KDIR_IMPL *self,
-        KFile **f, bool update, const char *path, va_list args );
-    rc_t ( CC * create_file ) ( KDIR_IMPL *self, KFile **f, bool update,
-        uint32_t access, KCreateMode mode, const char *path, va_list args );
-    rc_t ( CC * file_size ) ( const KDIR_IMPL *self,
-        uint64_t *size, const char *path, va_list args );
-    rc_t ( CC * set_size ) ( KDIR_IMPL *self,
-        uint64_t size, const char *path, va_list args );
-    rc_t ( CC * open_dir_read ) ( const KDIR_IMPL *self,
-        const KDirectory **sub, bool chroot, const char *path, va_list args );
-    rc_t ( CC * open_dir_update ) ( KDIR_IMPL *self,
-        KDirectory **sub, bool chroot, const char *path, va_list args );
-    rc_t ( CC * create_dir ) ( KDIR_IMPL *self, uint32_t access,
-        KCreateMode mode, const char *path, va_list args );
-
-    /* optional destructor method - leave NULL if not needed */
-    rc_t ( CC * destroy_file ) ( KDIR_IMPL *self, KFile *f );
-    /* end minor version == 0 */
-
-    /* start minor version == 1 */
-    rc_t ( CC * date ) ( const KDIR_IMPL *self,
-        KTime_t * date, const char *path, va_list args );
-    rc_t ( CC * setdate ) ( KDIR_IMPL * self, bool recurse,
-        KTime_t date, const char *path, va_list args );
-    struct KSysDir* ( CC * get_sysdir ) ( const KDIR_IMPL *self );
-    /* end minor version == 1 */
-
-    /* start minor version == 2 */
-    rc_t ( CC * file_locator ) ( const KDIR_IMPL *self,
-        uint64_t *locator, const char *path, va_list args );
-    /* end minor version == 2 */
-
-    /* start minor version == 3 */
-    rc_t ( CC * file_phys_size ) ( const KDIR_IMPL *self,
-        uint64_t *phys_size, const char *path, va_list args );
-    rc_t ( CC * file_contiguous ) ( const KDIR_IMPL *self,
-        bool *contiguous, const char *path, va_list args );
-    /* end minor version == 3 */
-
-    /* ANY NEW ENTRIES MUST BE REFLECTED IN libs/kfs/directory.c
-       BY BOTH THE CORRESPONDING MESSAGE DISPATCH FUNCTION(s) AND
-       VTABLE VALIDITY CHECKS IN KDirectoryInit */
-};
-
-union KDirectory_vt
-{
-    KDirectory_vt_v1 v1;
-};
-
-/* Init
- *  initialize a newly allocated directory object
- */
-KFS_EXTERN rc_t CC KDirectoryInit ( KDirectory *self, const KDirectory_vt *vt, 
-    const char * class_name, const char * path, bool update );
-
-/* DestroyFile
- *  does whatever is necessary with an unreferenced file
- */
-KFS_EXTERN rc_t CC KDirectoryDestroyFile ( const KDirectory *self, KFile *f );
-
-/* GetSysDir
- *  returns an underlying system file object
- */
-KFS_EXTERN struct KSysDir* CC KDirectoryGetSysDir ( const KDirectory *self );
-
-
-/* RealPath
- *  exposes functionality of system directory
- */
-KFS_EXTERN rc_t CC KSysDirRealPath ( struct KSysDir const *self,
-    char *real, size_t bsize, const char *path, ... );
-KFS_EXTERN rc_t CC KSysDirVRealPath ( struct KSysDir const *self,
-    char *real, size_t bsize, const char *path, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * KArrayFile
- *  an array-file is created from a KFile
- */
-typedef union  KArrayFile_vt KArrayFile_vt;
-struct KArrayFile
-{
-    const KArrayFile_vt *vt;
-    KRefcount refcount;
-    uint8_t read_enabled;
-    uint8_t write_enabled;
-    uint8_t align [ 2 ];
-};
-
-#ifndef KARRAYFILE_IMPL
-#define KARRAYFILE_IMPL KArrayFile
-#endif
-
-typedef struct KArrayFile_vt_v1 KArrayFile_vt_v1;
-struct KArrayFile_vt_v1
-{
-    /* version number */
-    uint32_t maj, min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KARRAYFILE_IMPL *self );
-    rc_t ( CC * dimensionality ) ( const KARRAYFILE_IMPL *self, uint8_t *dim );
-    rc_t ( CC * set_dimensionality ) ( KARRAYFILE_IMPL *self, uint8_t dim );
-    rc_t ( CC * dim_extents ) ( const KARRAYFILE_IMPL *self, uint8_t dim, uint64_t *extents );
-    rc_t ( CC * set_dim_extents ) ( KARRAYFILE_IMPL *self, uint8_t dim, uint64_t *extents );
-    rc_t ( CC * element_size ) ( const KARRAYFILE_IMPL *self, uint64_t *elem_bits );
-    rc_t ( CC * read ) ( const KARRAYFILE_IMPL *self, uint8_t dim,
-        const uint64_t *pos, void *buffer, const uint64_t *elem_count,
-        uint64_t *num_read );
-    rc_t ( CC * write ) ( KARRAYFILE_IMPL *self, uint8_t dim,
-        const uint64_t *pos, const void *buffer, const uint64_t *elem_count,
-        uint64_t *num_writ );
-    rc_t ( CC * get_meta ) ( const KARRAYFILE_IMPL *self, const char *key, 
-                             const KNamelist **list );
-
-    rc_t ( CC * read_v ) ( const KARRAYFILE_IMPL *self, uint8_t dim,
-        const uint64_t * pos, char * buffer, const uint64_t buffer_size,
-        uint64_t * num_read );
-
-    /* end minor version == 0 */
-};
-
-union KArrayFile_vt
-{
-    KArrayFile_vt_v1 v1;
-};
-
-/* Init
- *  initialize a newly allocated array-file object
- */
-KFS_EXTERN rc_t CC KArrayFileInit ( KArrayFile *self, const KArrayFile_vt *vt, 
-    bool read_enabled, bool write_enabled );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_impl_ */
diff --git a/interfaces/kfs/kfs-priv.h b/interfaces/kfs/kfs-priv.h
deleted file mode 100644
index 9a8bb4c..0000000
--- a/interfaces/kfs/kfs-priv.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_priv_
-#define _h_kfs_priv_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * struct/class forwards
- */
-struct KDirectory;
-struct KFile;
-struct KPath;
-struct KDlset;
-struct KArrayFile;
-struct KNamelist;
-
-/* MakeFDFile
- *  creates a file from a file-descriptor
- *  not supported under Windows
- */
-KFS_EXTERN rc_t CC KFileMakeFDFileRead ( struct KFile const **f, int fd );
-KFS_EXTERN rc_t CC KFileMakeFDFileWrite ( struct KFile **f, bool update, int fd );
-
-/* GetMeta
- *  extracts metadata into a string-vector
- *
- *  "key"   [ IN ]  - the key which part of the metadata to retrieve
- *
- *  "list"  [ OUT ] - the metadata will be filled into this list
- *
- */
-KFS_EXTERN rc_t CC KArrayFileGetMeta ( struct KArrayFile const *self, const char *key,
-    const struct KNamelist **list );
-
-/* List
- *  list the paths to the libraries in the set
- */
-KFS_EXTERN rc_t CC KDlsetList ( struct KDlset const *self, struct KNamelist **list );
-
-
-#if WINDOWS
-/* PosixStringToSystemString
- * converts posix path string to system path
- *  "buffer" [ OUT ] - NUL terminated system path string
- *  "bsize" [ IN ] - buffer length
- *  "path" [ IN ] - NUL terminated posix path string
- */
-KFS_EXTERN rc_t KDirectoryPosixStringToSystemString (
-    const struct KDirectory *self,
-    char *buffer, size_t bsize, const char *path, ... );
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_priv_ */
diff --git a/interfaces/kfs/lockfile.h b/interfaces/kfs/lockfile.h
deleted file mode 100644
index ef83254..0000000
--- a/interfaces/kfs/lockfile.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_lockfile_
-#define _h_kfs_lockfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KLockFile
- *  a mutual exclusion lock on a file
- *  the lock is acquired upon creation
- *  and released upon destruction
- *
- * NB - only guaranteed to work when used from a single host
- */
-typedef struct KLockFile KLockFile;
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KLockFileAddRef ( const KLockFile *self );
-KFS_EXTERN rc_t CC KLockFileRelease ( const KLockFile *self );
-
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  interface extensions
- */
-
-
-/* CreateLockFile
- *  attempts to create a KLockFile
- *
- *  "lock" [ OUT ] - return parameter for newly created lock file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting lock file
- */
-KFS_EXTERN rc_t CC KDirectoryCreateLockFile ( struct KDirectory *self,
-    KLockFile **lock, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVCreateLockFile ( struct KDirectory *self,
-    KLockFile **lock, const char *path, va_list args );
-
-
-/* CreateExclusiveAccessFile
- *  opens a file with exclusive write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-KFS_EXTERN rc_t CC KDirectoryCreateExclusiveAccessFile ( struct KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVCreateExclusiveAccessFile ( struct KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_lockfile_ */
diff --git a/interfaces/kfs/md5.h b/interfaces/kfs/md5.h
deleted file mode 100644
index 798f827..0000000
--- a/interfaces/kfs/md5.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_md5_
-#define _h_kfs_md5_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KMD5SumFmt
- *  a formatter for reading or writing an md5sum-style checksum file
- */
-typedef struct KMD5SumFmt KMD5SumFmt;
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KMD5SumFmtAddRef ( const KMD5SumFmt *self );
-KFS_EXTERN rc_t CC KMD5SumFmtRelease ( const KMD5SumFmt *self );
-
-
-/* Make
- *  creates a formatted accessor to textual checksum file
- *  takes over ownership of "in"/"out" file reference
- *
- *  "in" [ IN ] - readable checksum input file
- *  -OR-
- *  "out" [ IN ] - writable checksum file. if readable as well,
- *  its contents will be preserved.
- */
-KFS_EXTERN rc_t CC KMD5SumFmtMakeRead ( const KMD5SumFmt **f, struct KFile const *in );
-KFS_EXTERN rc_t CC KMD5SumFmtMakeUpdate ( KMD5SumFmt **f, struct KFile *out );
-
-
-/* Count
- *  return the number of checksums in file
- */
-KFS_EXTERN rc_t CC KMD5SumFmtCount ( const KMD5SumFmt *self, uint32_t *count );
-
-
-/* Get
- *  retrieve an indexed checksum line
- *
- *  "idx" [ IN ] - zero-based index of checksum to access
- *
- *  "path" [ OUT ] and "size" [ IN ] - return buffer for file path
- *
- *  "digest" [ OUT ] - return parameter for the MD5 checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-KFS_EXTERN rc_t CC KMD5SumFmtGet ( const KMD5SumFmt *self, uint32_t idx,
-    char *path, size_t size, uint8_t digest [ 16 ], bool *bin );
-
-
-/* Find
- *  retrieve checksum line by path
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "digest" [ OUT ] - return parameter for the MD5 checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-KFS_EXTERN rc_t CC KMD5SumFmtFind ( const KMD5SumFmt *self,
-    const char *path, uint8_t digest [ 16 ], bool *bin );
-
-
-/* Delete
- *  remove an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  returns rcNotFound if not present
- */
-KFS_EXTERN rc_t CC KMD5SumFmtDelete ( KMD5SumFmt *self, const char *path );
-
-
-/* Update
- *  add a checksum line to file or update an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "digest" [ IN ] - calculated MD5 checksum
- *
- *  "bin" [ IN ] - true if checksum was calculated on all bytes
- *  in file, false if fopen mode used to read file was text.
- *
- * NB - the md5sum tool operates with the assumption that files
- *  are opened using "fopen". it records the mode used by prepending
- *  '*' to indicate binary and ' ' to indicate text mode within the
- *  checksum line.
- *
- *  unfortunately, this creates a situation where text-mode files
- *  checksummed on DOS cannot be properly checked on any other
- *  platform without the aid of some filter to drop out '\r' from
- *  a '\r\n' sequence.
- *
- *  fortunately, most users are unaware of the binary/text mode
- *  switches available with md5sum and use the default mode, which
- *  is binary on DOS and text on Unix, which happens to be equivalent
- *  to binary ( making one wonder why binary is not instead the
- *  universal default ).
- *
- *  the end result is that we need to indicate whether CR stripping
- *  was performed while at the same time behaving like md5sum.
- */
-KFS_EXTERN rc_t CC KMD5SumFmtUpdate ( KMD5SumFmt *self, const char *path,
-    const uint8_t digest [ 16 ], bool bin );
-
-/* Rename
- * Rename the checksum line to reflect a file name change but no content change.
- *
- *  "newpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's new name
- *
- *  "oldpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's old name
- *
- * Parameter order matches KDirectoryRename()
- */
-KFS_EXTERN rc_t CC KMD5SumFmtRename ( KMD5SumFmt *self, const char *oldpath, const char *newpath );
-
-
-/* Flush
- *  write data to disk, but stay open
- */
-KFS_EXTERN rc_t CC KMD5SumFmtFlush ( KMD5SumFmt *self );
-
-
-/*--------------------------------------------------------------------------
- * MD5 KFile extensions
- */
-
-/* MakeMD5Read
- *  creates an adapter to check MD5 checksum for a source file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "src" [ IN ] - source file with read permission
- *
- *  "digest" [ IN ] - MD5 checksum to match
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeMD5Read ( struct KFile const **f,
-    struct KFile const *src, const uint8_t digest [ 16 ] );
-
-    
-/*--------------------------------------------------------------------------
- * KMD5File
- *  subclass of KFile
- */
-typedef struct KMD5File KMD5File;
-
-
-/* MakeWrite
- * MakeAppend
- *  creates an adapter to create MD5 checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "md5" [ IN ] - md5 checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "md5".
- *
- *  "path" [ IN ] - md5 checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KMD5FileMakeWrite ( KMD5File **f,
-    struct KFile *out, KMD5SumFmt *md5, const char *path );
-KFS_EXTERN rc_t CC KMD5FileMakeAppend ( KMD5File **f,
-    struct KFile *out, KMD5SumFmt *md5, const char *path );
-
-/* MakeReadNew
- *  creates an adapter to create MD5 checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "in" [ IN ] - input file 
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "md5" [ IN ] - md5 checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "md5".
- *
- *  "path" [ IN ] - md5 checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-KFS_EXTERN rc_t CC KFileMakeNewMD5Read ( const struct KFile **fp,
-    const struct KFile *in, KMD5SumFmt *md5, const char *path );
-
-
-/* ToKFile
- *  an MD5 file is a subclass of KFile
- *  this is an explicit cast operator
- */
-KFS_EXTERN struct KFile* CC KMD5FileToKFile ( KMD5File *self );
-KFS_EXTERN struct KFile const* CC KMD5FileToKFileConst ( const KMD5File *self );
-
-/* BeginTransaction
- *  preserve current MD5 state and file marker
- *  in preparation for rollback
- */
-KFS_EXTERN rc_t CC KMD5FileBeginTransaction ( KMD5File *self );
-
-
-/* Commit
- *  accept current MD5 state as correct
- */
-KFS_EXTERN rc_t CC KMD5FileCommit ( KMD5File *self );
-
-
-/* Revert
- *  reset state to previous transaction boundary conditions
- */
-KFS_EXTERN rc_t CC KMD5FileRevert ( KMD5File *self );
-
-/* Reset
- *  reset state to that of an empty file
- *  aborts any open transaction
- */
-KFS_EXTERN rc_t CC KMD5FileReset ( KMD5File *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_md5_ */
diff --git a/interfaces/kfs/mmap.h b/interfaces/kfs/mmap.h
deleted file mode 100644
index ca442d8..0000000
--- a/interfaces/kfs/mmap.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_mmap_
-#define _h_kfs_mmap_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-typedef struct KMMap KMMap;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KMMapAddRef ( const KMMap *self );
-KFS_EXTERN rc_t CC KMMapRelease ( const KMMap *self );
-
-/* Size
- *  returns size of memory region
- *
- *  "size" [ OUT ] - return parameter for region size
- */
-KFS_EXTERN rc_t CC KMMapSize ( const KMMap *self, size_t *size );
-
-/* Position
- *  returns region starting offset into mapped file
- *
- *  "pos" [ OUT ] - return parameter for file offset
- */
-KFS_EXTERN rc_t CC KMMapPosition ( const KMMap *self, uint64_t *pos );
-
-/* Reposition
- *  shift region to a new position
- *  may change region size
- *
- *  "pos" [ IN ] - new starting position for region
- *
- *  "size" [ OUT, NULL OKAY ] - optional return parameter
- *  for resultant region size
- */
-KFS_EXTERN rc_t CC KMMapReposition ( const KMMap *self, uint64_t pos, size_t *size );
-
-/* Addr
- *  returns starting address of memory region
- *
- *  "addr" [ OUT ] - return parameter for memory address
- */
-KFS_EXTERN rc_t CC KMMapAddrRead ( const KMMap *self, const void **addr );
-KFS_EXTERN rc_t CC KMMapAddrUpdate ( KMMap *self, void **addr );
-
-/* Make
- *  maps entire file
- *
- *  "f" [ IN ] - file to map.
- *  a new reference will be added
- */
-KFS_EXTERN rc_t CC KMMapMakeRead ( const KMMap **mm, struct KFile const *f );
-KFS_EXTERN rc_t CC KMMapMakeUpdate ( KMMap **mm, struct KFile *f );
-
-/* MakeMax
- *  maps as much of a file as possible
- *
- *  "f" [ IN ] - file to map.
- *  a new reference will be added
- */
-KFS_EXTERN rc_t CC KMMapMakeMaxRead ( const KMMap **mm, struct KFile const *f );
-KFS_EXTERN rc_t CC KMMapMakeMaxUpdate ( KMMap **mm, struct KFile *f );
-
-/* MakeRgn
- *  maps a portion of a file
- *
- *  "f" [ IN ] - file to map
- *  a new reference will be added
- *
- *  "pos" [ IN ] - starting offset into file
- *
- *  "size" [ IN, DEFAULT ZERO ] - size of resulting region. if 0,
- *  the size will be interpreted as meaning size of "f" - "pos".
- */
-KFS_EXTERN rc_t CC KMMapMakeRgnRead ( const KMMap **mm,
-    struct KFile const *f, uint64_t pos, size_t size );
-KFS_EXTERN rc_t CC KMMapMakeRgnUpdate ( KMMap **mm,
-    struct KFile *f, uint64_t pos, size_t size );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_mmap_ */
diff --git a/interfaces/kfs/nullfile.h b/interfaces/kfs/nullfile.h
deleted file mode 100644
index 35bf866..0000000
--- a/interfaces/kfs/nullfile.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_nullfile_
-#define _h_kfs_nullfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-typedef struct KNullFile KNullFile;
-
-/* -----
- * Copy can be a serialized type KFile for a KNullFile opened for Read but
- * not when opened for write.
- *
- * Specifically this means copy can be a KMD5File for read but not for write
- * other KFile nulltypes might have the same restriction.
- *
- * A seekless update KNullfile can be created but does not now exist.
- */
-KFS_EXTERN rc_t CC KFileMakeNullRead (const struct KFile ** self);
-KFS_EXTERN rc_t CC KFileMakeNullUpdate (struct KFile ** self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_nullfile_ */
diff --git a/interfaces/kfs/pagefile.h b/interfaces/kfs/pagefile.h
deleted file mode 100644
index 3183576..0000000
--- a/interfaces/kfs/pagefile.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_pagefile_
-#define _h_kfs_pagefile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KPage
- *  a reference counted page
- */
-typedef struct KPage KPage;
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KPageAddRef ( const KPage *self );
-KFS_EXTERN rc_t CC KPageRelease ( const KPage *self );
-
-
-/* Id
- *  returns page id
- *
- *  "page_id" [ OUT ] - return parameter for page id
- */
-KFS_EXTERN rc_t CC KPageId ( const KPage *self, uint32_t *page_id );
-
-
-/* ConstSize
- *  returns constant page size
- */
-KFS_EXTERN size_t CC KPageConstSize ( void );
-
-
-/* AccessRead
- * AccessUpdate
- *  gain access to page memory
- *  update access marks page as modified
- *
- *  "mem" [ OUT ] - pointer to page
- *
- *  "bytes" [ OUT, NULL OKAY ] - page size in bytes
- */
-KFS_EXTERN rc_t CC KPageAccessRead ( const KPage *self, const void **mem, size_t *bytes );
-KFS_EXTERN rc_t CC KPageAccessUpdate ( KPage *self, void **mem, size_t *bytes );
-
-
-/*--------------------------------------------------------------------------
- * KPageFile
- *  presents some level of page management on top of a random-access KFile
- */
-typedef struct KPageFile KPageFile;
-
-
-/* Make
- *  creates a page file
- *
- *  "pf" [ OUT ] - return parameter for page file
- *
- *  "backing" [ IN ] - backing file
- *   NB - attaches a new reference to file
- *        does not take ownership
- *
- *  "climit" [ IN ] - cache size limit
- *
- *  "write_through" [ IN ] - if true, causes page flushing
- *  on each KPageRelease message if modified.
- */
-KFS_EXTERN rc_t CC KPageFileMakeRead ( const KPageFile **pf,
-    struct KFile const *backing, size_t climit );
-KFS_EXTERN rc_t CC KPageFileMakeUpdate ( KPageFile **pf,
-    struct KFile *backing, size_t climit, bool write_through );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KFS_EXTERN rc_t CC KPageFileAddRef ( const KPageFile *self );
-KFS_EXTERN rc_t CC KPageFileRelease ( const KPageFile *self );
-
-
-/* Size
- *  returns size in bytes of file and cache
- *
- *  "lsize" [ OUT, NULL OKAY ] - return parameter for logical size
- *
- *  "fsize" [ OUT, NULL OKAY ] - return parameter for file size
- *
- *  "csize" [ OUT, NULL OKAY ] - return parameter for cache size
- */
-KFS_EXTERN rc_t CC KPageFileSize ( const KPageFile *self,
-    uint64_t *lsize, uint64_t *fsize, size_t *csize );
-
-
-/* SetSize
- *  extends or truncates underlying file
- *  may affect cache contents
- *
- *  "size" [ IN ] - logical size
- */
-KFS_EXTERN rc_t CC KPageFileSetSize ( KPageFile *self, uint64_t size );
-
-
-/* Alloc
- *  allocates a new page
- *  the page will be zeroed and initially unmodified
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "page_id" [ OUT, NULL OKAY ] - optional return parameter for page id
- */
-KFS_EXTERN rc_t CC KPageFileAlloc ( KPageFile *self, KPage **page, uint32_t *page_id );
-
-
-/* Get
- *  returns an existing page
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "page_id" [ IN ] - id of page to retrieve
- */
-KFS_EXTERN rc_t CC KPageFileGet ( KPageFile *self, KPage **page, uint32_t page_id );
-
-
-/* PosGet
- *  returns a page corresponding to position
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "offset" [ IN ] - offset to a byte within file
- */
-KFS_EXTERN rc_t CC KPageFilePosGet ( KPageFile *self, KPage **page, uint64_t offset );
-
-
-/* DropBacking
- *  used immediately prior to releasing
- *  prevents modified pages from being flushed to disk
- *  renders object nearly useless
- */
-KFS_EXTERN rc_t CC KPageFileDropBacking ( KPageFile *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_pagefile_ */
diff --git a/interfaces/kfs/pmem.h b/interfaces/kfs/pmem.h
deleted file mode 100644
index 4f0ece4..0000000
--- a/interfaces/kfs/pmem.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_pmem_
-#define _h_kfs_pmem_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KPageFile;
-
-
-/*--------------------------------------------------------------------------
- * KMemBank
- *  manages simple blocks of memory
- *  optionally backed by a persistent page file
- */
-typedef struct KMemBank KMemBank;
-
-
-/* Make
- *  make a memory bank with a fixed block size
- *  the total amount of memory may be limited
- *  the memory may be drawn from an externally supplied page file
- *
- *  "block_size" [ IN ] - must be an even multiple of 2, minimum 64
- *
- *  "limit" [ IN, DFLT ZERO ] - the maximum number of bytes
- *  to be allocated zero for unlimited
- *
- *  "backing" [ IN, NULL OKAY ] - a page source for allocator.
- *  a new reference will be added if not null.
- */
-KFS_EXTERN rc_t CC KMemBankMake ( KMemBank **bank,
-    size_t block_size, uint64_t limit, struct KPageFile *backing );
-
-
-/* AddRef
- * Release
- */
-KFS_EXTERN rc_t CC KMemBankAddRef ( const KMemBank *self );
-KFS_EXTERN rc_t CC KMemBankRelease ( const KMemBank *self );
-
-
-/* Alloc
- *  allocate memory
- *
- *  "id" [ OUT ] - return parameter for memory allocation id
- *
- *  "bytes" [ IN ] - the number of bytes to allocate
- *
- *  "clear" [ IN ] - if true, initialize the memory to zero
- */
-KFS_EXTERN rc_t CC KMemBankAlloc ( KMemBank *self,
-    uint64_t *id, uint64_t bytes, bool clear );
-
-
-/* Free
- *  free memory
- *
- *  "id" [ IN, ZERO OKAY ] - id of the allocation to be freed
- */
-KFS_EXTERN rc_t CC KMemBankFree ( KMemBank *self, uint64_t id );
-
-
-/* Size
- *  returns the allocated capacity of the memory object
- *
- *  "id" [ IN ] - id of the allocation
- *
- *  "size" [ OUT ] - return parameter
- */
-KFS_EXTERN rc_t CC KMemBankSize ( const KMemBank *self, uint64_t id, uint64_t *size );
-
-
-/* SetSize
- *  performs a reallocation of memory object
- *
- *  "id" [ IN ] - id of the allocation being resized
- *
- *  "size" [ IN ] - new capacity
- */
-KFS_EXTERN rc_t CC KMemBankSetSize ( KMemBank *self, uint64_t id, uint64_t size );
-
-
-/* Read
- *  linearly access memory
- *
- *  "id" [ IN ] - id of the allocation being read
- *
- *  "pos" [ IN ] - starting offset into allocation
- *
- *  "buffer" [ IN ] and "bsize" [ IN ] - buffer for returned data
- *
- *  "num_read" [ OUT ] - return parameter for the number of bytes read
- */
-KFS_EXTERN rc_t CC KMemBankRead ( const KMemBank *self, uint64_t id,
-   uint64_t pos, void *buffer, size_t bsize, size_t *num_read );
-
-
-/* Write
- *  linearly update memory
- *  will resize as required
- *
- *  "id" [ IN ] - id of the allocation being writ
- *
- *  "pos" [ IN ] - starting offset into allocation
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to write
- *
- *  "num_writ" [ OUT ] - return parameter for the number of bytes written
- */
-KFS_EXTERN rc_t CC KMemBankWrite ( KMemBank *self, uint64_t id,
-    uint64_t pos, const void *buffer, size_t size, size_t *num_writ );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_pmem_ */
diff --git a/interfaces/kfs/quickmount.h b/interfaces/kfs/quickmount.h
deleted file mode 100644
index 6ecbaef..0000000
--- a/interfaces/kfs/quickmount.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_quick_mount_
-#define _h_kfs_quick_mount_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-struct KFile;
-
-typedef struct KQuickMountDir KQuickMountDir;
-
-/* OpenQuickMountDirRead
- *
- */
-KFS_EXTERN rc_t KQuickMountDirMake (const struct KDirectory * self, 
-                                    const struct KDirectory ** pnewdir,
-                                    const struct KFile * file,
-                                    const char * path, size_t path_size,
-                                    const char * mount, size_t mount_size);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_quick_mount_ */
diff --git a/interfaces/kfs/ramfile.h b/interfaces/kfs/ramfile.h
deleted file mode 100644
index 65957b1..0000000
--- a/interfaces/kfs/ramfile.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_ramfile_
-#define _h_kfs_ramfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-typedef struct KRamFile KRamFile;
-
-/* -----
- * fakes file reads and writes into a buffer
- *
- * writes never fail. Acts like a sliding window from previous writes of possible
- * reads only succeed of they are from what was contained in the last write
- *
- * zero fills are put in where possible. If you write a buffer, slide the window with 
- * a write that doesn't fill the buffer, the rest will be zero not what was previously written
- *
- * The Read only form doesn;t allow writes but will reflect what was put in
- * the buffer outside of the KFile
- *
- * The write only will accept writes but can only be accessed outside of the KFile.
- *
- * The update form tries its best to give what was asked for [see above]
- */
-KFS_EXTERN rc_t CC KRamFileMakeRead (const struct KFile ** self,
-                                     char * buffer, size_t buffer_size);
-
-KFS_EXTERN rc_t CC KRamFileMakeWrite (struct KFile ** self,
-                                      char * buffer, size_t buffer_size);
-
-KFS_EXTERN rc_t CC KRamFileMakeUpdate (struct KFile ** self,
-                                       char * buffer, size_t buffer_size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_ramfile_ */
diff --git a/interfaces/kfs/readheadfile.h b/interfaces/kfs/readheadfile.h
deleted file mode 100644
index 1cd47a1..0000000
--- a/interfaces/kfs/readheadfile.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_readheadfile_
-#define _h_kfs_readheadfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards allowing opaque class typing
- */
-struct KFile;
-
-
-/* MakeReadHead
- *  make a read-only file where we buffer only the first part of the file
- *  this is pretty much only needed to type a file when we don't know
- *  or want to see if we can acess randomly.  This is a fairly smart type
- *  that will take ownership of the pointer to the 'original' KFile
- *  reference.  If it finds that the 'original' KFile is seekable (has
- *  random access) it will merely return a reference to that const KFile *
- *  rather than creating a new KFile that will in most cases pass through 
- *  all method calls to the original.
- *
- *  This type was created primarily to allow the reading of the first part
- *  of a file for type recognition with out forcing numerous cases of
- *  duplicated code to check for random access on an existing KFile reference
- *  and handling of the pre-read in the application.
- *
- *  This class is intended for files that once typed will be read straight
- *  through.  If more random access to the file is needed the KBufFile is 
- *  indicated rather than this one.  If a straight through access is needed
- *  this is a far lighter weight solution than KBufFile.
- *
- *  A references is added to the original even if it becomes used as the new
- *  file because it allows random access.
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "bsize" [ IN ] - buffer size
- */
-KFS_EXTERN 
-rc_t CC KFileMakeReadHead (const struct KFile ** pself,
-                           const struct KFile * original,
-                           size_t buffer_size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_readheadfile_ */
diff --git a/interfaces/kfs/sra.h b/interfaces/kfs/sra.h
deleted file mode 100644
index 7424e75..0000000
--- a/interfaces/kfs/sra.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_sra_
-#define _h_kfs_sra_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#include <klib/defs.h>
-
-#include <stdarg.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file provides documentation and symbols for the single file archive
- * format originally created for the SRA project.
- */
-
-/*
- * filler bytes before data files can be inserted to make the start line
- * up on specified boundaries.  By using a single bit approach for the values
- * we get the bit-wise not of the mask that must be met for the start of the file.
- * Or one more than the maximum number of inserted bytes.  This is only used on
- * creation of the file and has no bearing at all on the parsing afterwards.
- * In it's only use so far any bit in a 32 bit bit number could be used not
- * just these enumerated values.  
- */
-typedef uint32_t KSRAFileAlignment;
-enum eKSRAFileAlignment
-{
-    /* align on byte count unit boundaries
-     * set this to the number of bytes in the alignment unit
-     */
-    sraAlignInvalid = 0,
-    sraAlign1Byte = 1,
-    sraAlign2Byte = 2,
-    sraAlign4Byte = 4,
-    sraAlign8Byte = 8,
-    sraAlign16Byte = 16,
-    sraAlign32Byte = 32,
-    sraAlign64Byte = 64
-};
-
-/* ======================================================================
- *
- * SRA File Format
- */
-typedef uint32_t SraEndian_t;
-/* enum fails to handle these due to integer overflow */
-#define eSraByteOrderTag     0x05031988
-#define eSraByteOrderReverse 0x88190305
-
-
-
-
-typedef struct KSraHeader KSraHeader;
-struct KSraHeader
-{
-    /* the first two fields are byte endian agnostic - they are low to high as shown */
-    uint8_t	ncbi[4];                /* 'N', 'C', 'B', 'I' */
-    uint8_t	sra[4];                 /* '.', 'S', 'R', 'A' */
-    /* this field lets you determine the byte order of the file */
-    SraEndian_t	byte_order;
-    /* not a ver_t - this is a 4 byte integer with no subfields */
-    uint32_t	version;
-    union 
-    {
-        struct
-        {
-            /* the only header field in the first version is the data offset */
-            uint64_t	file_offset;
-        } v1;
-    } u;
-};
-
-/* ======================================================================
- * Header format structures
- *
- */
-
-
-
-#define FS_SRA_CUR_VERSION 1
-KFS_EXTERN size_t CC SraHeaderSize ( const KSraHeader * self );
-
-KFS_EXTERN uint64_t CC SraHeaderGetFileOffset (const KSraHeader * self);
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-struct KToc;
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  SRA-specific extensions
- */
-
-/* KArcParseSRA
- *	A parse function for sra files suitable for KDirectoryOpenArcDirRead
- *
- * [INOUT] KArcTOC*	self	The TOC (table of contents) to fill in with the parse
- * [IN]    const KFile*	kfile	The opened (as KFile) archive to parse.
- */
-KFS_EXTERN rc_t CC KArcParseSRA ( struct KToc * self,
-                                  const void * kvoid,
-                                  bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                  void *ignored_data);
-KFS_EXTERN rc_t CC KArcParseSRAUnbounded ( struct KToc * self,
-                                           const void * kvoid,
-                                           bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                           void *ignored_data);
-
-KFS_EXTERN rc_t CC KArcParseKDir( struct KToc * self,
-                                  const void * kdir,
-                                  bool(CC*f)(const struct KDirectory*,const char *, void*),
-                                  void *filterparam);
-
-
-/* KDirectoryOpenSraArchive
- *  opens a named SRA archive
- *
- *  "sra_dir" [ OUT ] - return parameter for archive
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting sraget archive
- */
-KFS_EXTERN rc_t CC KDirectoryOpenSraArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenSraArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args );
-KFS_EXTERN rc_t CC KDirectoryOpenSraArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenSraArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args );
-KFS_EXTERN rc_t CC KDirectoryOpenSraArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenSraArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, va_list args );
-KFS_EXTERN rc_t CC KDirectoryOpenSraArchiveReadUnbounded_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenSraArchiveReadUnbounded_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, va_list args );
-/* copycat needs an unbounded version - that is filesize is not necessarily known
- * this is unsafe for most other uses */
-KFS_EXTERN rc_t CC KDirectoryOpenSraArchiveReadUnbounded ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... );
-KFS_EXTERN rc_t CC KDirectoryVOpenSraArchiveReadUnbounded ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args );
-
-KFS_EXTERN rc_t CC KFileIsSRA (const char * b, size_t z);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_sra_ */
diff --git a/interfaces/kfs/subfile.h b/interfaces/kfs/subfile.h
deleted file mode 100644
index bad2c5b..0000000
--- a/interfaces/kfs/subfile.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_subfile_
-#define _h_kfs_subfile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-typedef struct KSubFile KSubFile;
-
-/* -----
- * Copy can be a serialized type KFile for a KSubFile opened for Read but
- * not when opened for write.
- *
- * Specifically this means copy can be a KMD5File for read but not for write
- * other KFile subtypes might have the same restriction.
- *
- * A seekless update KSubfile can be created but does not now exist.
- */
-KFS_EXTERN rc_t CC KFileMakeSubRead (const struct KFile ** self, const struct KFile * original,
-			uint64_t start_position, uint64_t size);
-KFS_EXTERN rc_t CC KFileMakeSubUpdate (struct KFile ** self, struct KFile * original,
-			uint64_t start_position, uint64_t size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_subfile_ */
diff --git a/interfaces/kfs/tar.h b/interfaces/kfs/tar.h
deleted file mode 100644
index 96d8c63..0000000
--- a/interfaces/kfs/tar.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_tar_
-#define _h_kfs_tar_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-struct KToc;
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  TAR-specific extensions
- */
-
-/* ParseTAR
- *  A parse function for tar files suitable for KDirectoryOpenArcDirRead
- *
- * [INOUT] KToc*    self    The TOC (table of contents) to fill in with the parse
- * [IN]    const KFile* kfile   The opened (as KFile) archive to parse.
- */
-KFS_EXTERN rc_t CC KArcParseTAR( struct KToc * self, 
-                                 const void * kfile,
-                                 bool(CC*f)(const struct KDirectory*,const char *, void*),
-                                 void *filterparam);
-
-/* KDirectoryOpenTarArchive
- *  opens a named TAR archive
- *
- *  "tar_dir" [ OUT ] - return parameter for archive
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target archive
- */
-KFS_EXTERN int CC KDirectoryOpenTarArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, ... );
-KFS_EXTERN int CC KDirectoryVOpenTarArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, va_list args );
-
-KFS_EXTERN int CC KDirectoryOpenTarArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, ... );
-KFS_EXTERN int CC KDirectoryVOpenTarArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, va_list args );
-
-KFS_EXTERN int CC KDirectoryOpenTarArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const struct KFile * f, const char *path, ... );
-KFS_EXTERN int CC KDirectoryVOpenTarArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const struct KFile * f, const char *path, va_list args );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_tar_ */
diff --git a/interfaces/kfs/teefile.h b/interfaces/kfs/teefile.h
deleted file mode 100644
index 698e91c..0000000
--- a/interfaces/kfs/teefile.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_teefile_
-#define _h_kfs_teefile_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-
-typedef struct KTeeFile KTeeFile;
-
-/* -----
- * Copy can be a serialized type KFile for a KTeeFile opened for Read but
- * not when opened for write.
- *
- * Specifically this means copy can be a KMD5File for read but not for write
- * other KFile subtypes might have the same restriction.
- *
- * A seekless update KTeefile can be created but does not now exist.
- */
-KFS_EXTERN rc_t CC KFileMakeTeeRead (const struct KFile ** self, 
-                                     const struct KFile * original,
-                                     struct KFile * copy);
-KFS_EXTERN rc_t CC KFileMakeTeeUpdate (struct KFile ** self,
-                                       struct KFile * original,
-                                       struct KFile * copy);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_teefile_ */
diff --git a/interfaces/kfs/toc.h b/interfaces/kfs/toc.h
deleted file mode 100644
index e0de152..0000000
--- a/interfaces/kfs/toc.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_toc_
-#define _h_kfs_toc_
-
-#ifndef _h_kfs_extern_
-#include <kfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_klib_pbstree_
-#include <klib/pbstree.h>
-#endif
-
-#ifndef _h_kfs_sra_
-#include <kfs/sra.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*==========================================================================
- * The TOC (Table of Contents) is the basis of non-O/S level file systems
- * directory structures.
- *
- * The TOC is based on a set of entries.  An entry can represent a file
- * (collection of bytes), a directory (a list of entries, or a link (an
- * entry that refers to another entry).
- *
- * Files are represented either as a contiguous array of bytes or a
- * sequence of smaller chunks of contiguous bytes.  Other than the initial
- * creation of the chunked version, most operations on the chunked file
- * will be able to treat it as a contiguous sequence with any gaps between
- * contiguous chunks being treated as if they were all zero bytes.  So
- * for the most part the two types of file are the same to the outside
- * world.
- *
- * A directory is viewed as a sorted list of named references to files.
- * In the first versions the form is of a binary search tree per directory
- * but for the most part that detail is irrelevant.  In the tree a directory
- * is an entry that contains its own tree.  A path is a sequence of named
- * entries in order - the representation of a path is the Unix/Posix style
- * path.
- *
- * A link is either a hard or soft link 9using Unix/Posix terminology. A
- * soft link is a named item that contains a path that names another item.
- * A hard link will as much as possible refer directly to the same file,
- * directory or another link as another item.
- *
- * Each entry is represented by a TocEntry.
- *
- * A path as mentioned above is a list of facets (names of directories) up to
- * a final leaf item that can be any of the item types.
- *
- * Position is the logical offset within a file or a particualr byte,  The
- * first byte is at position 0.
- */
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTree;
-struct Vector;
-struct String;
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KTocChunk
- *  Describes a chunk of valid data within a file.  The concept is that a file
- *  can be made up of discrete chunks that might not be consecutive on the 
- *  storage system.  There might also be gaps between the chunks - gaps that 
- *  read as all zeroes.  These could be tarred up versions of sparse files
- *  where the only things stored on disk are small regions of non-zero data. 
- *  Or it could be some archival format where data is broken into some form of
- *  packets.
- *
- *  64 bit values are used for file sizes up to 18,446,744,073,709,551,617 bytes
- *  up to exabytes.  The human genome is in the gigabyte range so 32 bit values
- *  are too close to the limits so the larger range was used.
- *
- *  This struct is very clear and public so chunks can be built up or used  freely
- *  by non-file-system specific code.
- */
-typedef struct KTocChunk KTocChunk;
-struct KTocChunk
-{
-    /* position of chunk within logical file */
-    uint64_t logical_position;
-
-    /* position of chunk within source container file */
-    uint64_t source_position;
-
-    /* chunk size */
-    uint64_t size;
-};
-
-
-
-KFS_EXTERN rc_t CC KDirectoryOpenTocFileRead( const KDirectory * self,
-                                              struct KFile const ** pfile,
-                                              KSRAFileAlignment align,
-                                              bool (CC * filter) (const KDirectory*,const char*,void*),
-                                              void * filter_param,
-                                              rc_t (CC * usort)(const KDirectory*, struct Vector*) );
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_toc_ */
diff --git a/interfaces/klib/callconv.h b/interfaces/klib/callconv.h
deleted file mode 100644
index 043f211..0000000
--- a/interfaces/klib/callconv.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_callconv_
-#define _h_klib_callconv_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * CC
- *  calling convention
- *  should be declared within compiler/os-specific files
- *  but to make external client builds work, do so here...
- */
-#ifndef CC
- #if defined _MSC_VER
-  #define CC __cdecl
- #else
-  #define CC
- #endif
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_callconv_ */
diff --git a/interfaces/klib/checksum.h b/interfaces/klib/checksum.h
deleted file mode 100644
index 5c38ee8..0000000
--- a/interfaces/klib/checksum.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_checksum_
-#define _h_klib_checksum_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * CRC32
- */
-
-/* CRC32Init
- *  initializes table
- *  IDEMPOTENT
- */
-KLIB_EXTERN void CC CRC32Init ( void );
-
-/* CRC32
- *  runs checksum on arbitrary data, returning result
- *  initial checksum to be passed in is 0
- *  subsequent checksums should be return from prior invocation
- */
-KLIB_EXTERN uint32_t CC CRC32 ( uint32_t checksum, const void *data, size_t size );
-
-
-/*--------------------------------------------------------------------------
- * MD5
- *  taken from Peter Deutsch's sources due to simplicity
- */
-typedef struct MD5State MD5State;
-struct MD5State
-{
-    uint32_t count [ 2 ];
-    uint32_t abcd [ 4 ];
-    uint8_t buf [ 64 ];
-};
-
-/* Init
- *  initialize the algorithm and state block
- */
-KLIB_EXTERN void CC MD5StateInit ( MD5State *md5 );
-
-/* Append
- *  run MD5 on data block
- *  accumulate results into "md5"
- *  processes data in chunks
- */
-KLIB_EXTERN void CC MD5StateAppend ( MD5State *md5, const void *data, size_t size );
-
-/* Finish
- *  processes any remaining data in "md5"
- *  returns 16 bytes of digest
- */
-KLIB_EXTERN void CC MD5StateFinish ( MD5State *md5, uint8_t digest [ 16 ] );
-
-
-/*--------------------------------------------------------------------------
- * SHA
- */
-typedef struct SHA32bitState SHA1State, SHA256State;
-struct SHA32bitState
-{
-    uint64_t len;
-    uint32_t H [ 8 ];
-    uint32_t cur;
-    uint8_t  W [ 64 ];
-};
-
-typedef struct SHA64bitState SHA384State, SHA512State;
-struct SHA64bitState
-{
-    uint64_t len;
-    uint64_t H [ 8 ];
-    unsigned long cur;
-    uint8_t W [ 128 ];
-};
-
-
-/* Init
- *  initialize the algorithm and state block
- */
-KLIB_EXTERN void CC SHA1StateInit ( SHA1State *state );
-KLIB_EXTERN void CC SHA256StateInit ( SHA256State *state );
-KLIB_EXTERN void CC SHA384StateInit ( SHA384State *state );
-KLIB_EXTERN void CC SHA512StateInit ( SHA512State *state );
-
-
-/* Append
- *  run SHA-x on data block
- *  accumulate results into "state"
- *  processes data in chunks
- */
-KLIB_EXTERN void CC SHA1StateAppend ( SHA1State *state, const void *data, size_t size );
-KLIB_EXTERN void CC SHA256StateAppend ( SHA256State *state, const void *data, size_t size );
-KLIB_EXTERN void CC SHA384StateAppend ( SHA384State *state, const void *data, size_t size );
-KLIB_EXTERN void CC SHA512StateAppend ( SHA512State *state, const void *data, size_t size );
-
-
-/* Finish
- *  processes any remaining data in "state"
- *  returns N bytes of digest
- *  N = 20 for SHA-1
- *  N = 32 for SHA-256
- *  N = 48 for SHA-384
- *  N = 64 for SHA-512
- */
-KLIB_EXTERN void CC SHA1StateFinish ( SHA1State *state, uint8_t digest [ 20 ] );
-KLIB_EXTERN void CC SHA256StateFinish ( SHA256State *state, uint8_t digest [ 32 ] );
-KLIB_EXTERN void CC SHA384StateFinish ( SHA384State *state, uint8_t digest [ 48 ] );
-KLIB_EXTERN void CC SHA512StateFinish ( SHA512State *state, uint8_t digest [ 64 ] );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_checksum_ */
diff --git a/interfaces/klib/container.h b/interfaces/klib/container.h
deleted file mode 100644
index dab027c..0000000
--- a/interfaces/klib/container.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_container_
-#define _h_klib_container_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SLNode
- *  singly linked node
- */
-typedef struct SLNode SLNode;
-struct SLNode
-{
-    SLNode *next;
-};
-
-/* SLNodeNext
- *  returns next node
- */
-#define SLNodeNext( n ) \
-    ( n ) -> next
-
-#if 0
-/* SLNodeFindNext
- *  find next element satisfying criteria
- */
-KLIB_EXTERN SLNode* CC SLNodeFindNext ( const SLNode *n, bool ( CC * f ) ( const SLNode *n ) );
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SLList
- *  singly linked list
- */
-typedef struct SLList SLList;
-struct SLList
-{
-    SLNode *head;
-    SLNode *tail;
-};
-
-
-/* SLListInit
- *  initialize a singly linked list
- */
-#define SLListInit( sl ) \
-    ( void ) ( ( sl ) -> head = ( sl ) -> tail = NULL )
-
-/* SLListHead
- *  returns list head
- */
-#define SLListHead( sl ) \
-    ( sl ) -> head
-
-/* SLListTail
- *  returns list tail
- */
-#define SLListTail( sl ) \
-    ( sl ) -> tail
-
-/* SLListPushHead
- *  push a single node onto head of list
- */
-#define SLListPushHead( sl, n ) \
-    ( void ) ( ( ( sl ) -> tail == NULL ? \
-        ( void ) ( ( sl ) -> tail = ( n ) ) : ( void ) 0 ), \
-        ( n ) -> next = ( sl ) -> head, ( sl ) -> head = ( n ) )
-
-/* SLListPushTail
- *  push a single node onto tail of list
- */
-KLIB_EXTERN void CC SLListPushTail ( SLList *sl, SLNode *n );
-
-/* SLListPopHead
- *  pop a single node from head of list
- */
-KLIB_EXTERN SLNode* CC SLListPopHead ( SLList *sl );
-
-/* SLListPopTail
- *  pop a single node from tail of list
- */
-KLIB_EXTERN SLNode* CC SLListPopTail ( SLList *sl );
-
-/* SLListUnlink
- *  removes a designated node from list
- */
-KLIB_EXTERN void CC SLListUnlink ( SLList *sl, SLNode *n );
-
-/* SLListForEach
- *  executes a function on each list element
- */
-KLIB_EXTERN void CC SLListForEach ( const SLList *sl,
-    void ( CC * f ) ( SLNode *n, void *data ), void *data );
-
-/* SLListDoUntil
- *  executes a function on each element
- *  until the function returns true
- */
-KLIB_EXTERN bool CC SLListDoUntil ( const SLList *sl,
-    bool ( CC * f ) ( SLNode *n, void *data ), void *data );
-
-/* SLListFindFirst
- *  find first element satisfying criteria
- */
-KLIB_EXTERN SLNode* CC SLListFindFirst ( const SLList *sl, bool ( CC * f ) ( const SLNode *n ) );
-
-/* SLListWhack
- *  pops elements from list and
- *  executes a user provided destructor
- */
-KLIB_EXTERN void CC SLListWhack ( SLList *sl, void ( CC * whack ) ( SLNode *n, void *data ), void *data );
-
-
-/*--------------------------------------------------------------------------
- * DLNode
- *  doubly linked node
- */
-typedef struct DLNode DLNode;
-struct DLNode
-{
-    DLNode *next;
-    DLNode *prev;
-};
-
-/* DLNodeNext
- *  returns next node
- */
-#define DLNodeNext( n ) \
-    ( n ) -> next
-
-/* DLNodePrev
- *  returns prev node
- */
-#define DLNodePrev( n ) \
-    ( n ) -> prev
-
-#if 0
-/* DLNodeFindNext
- *  find next element satisfying criteria
- */
-KLIB_EXTERN DLNode* CC DLNodeFindNext ( const DLNode *n, bool ( CC * f ) ( const DLNode *n ) );
-
-/* DLNodeFindPrev
- *  find previous element satisfying criteria
- */
-KLIB_EXTERN DLNode* CC DLNodeFindPrev ( const DLNode *n, bool ( CC * f ) ( const DLNode *n ) );
-#endif
-
-/*--------------------------------------------------------------------------
- * DLList
- *  doubly linked list
- */
-typedef struct DLList DLList;
-struct DLList
-{
-    DLNode *head;
-    DLNode *tail;
-};
-
-/* DLListInit
- *  initialize a doubly linked list
- */
-#define DLListInit( dl ) \
-    ( void ) ( ( dl ) -> head = ( dl ) -> tail = NULL )
-
-/* DLListHead
- *  returns list head
- */
-#define DLListHead( dl ) \
-    ( dl ) -> head
-
-/* DLListTail
- *  returns list tail
- */
-#define DLListTail( dl ) \
-    ( dl ) -> tail
-
-/* DLListPushHead
- *  push a single node onto the head of list
- */
-KLIB_EXTERN void CC DLListPushHead ( DLList *dl, DLNode *n );
-
-/* DLListPushTail
- *  push a single node onto the tail of list
- */
-KLIB_EXTERN void CC DLListPushTail ( DLList *dl, DLNode *n );
-
-/* DLListPopHead
- *  pop a single node from head of list
- */
-KLIB_EXTERN DLNode* CC DLListPopHead ( DLList *dl );
-
-/* DLListPopTail
- *  pop a single node from tail of list
- */
-KLIB_EXTERN DLNode* CC DLListPopTail ( DLList *dl );
-
-/* DLListPrependList
- *  pushes list contents onto the head of target
- */
-KLIB_EXTERN void CC DLListPrependList ( DLList *dl, DLList *l );
-
-/* DLListAppendList
- *  pushes list contents onto the tail of target
- */
-KLIB_EXTERN void CC DLListAppendList ( DLList *dl, DLList *l );
-
-/* DLListInsertNodeBefore
- *  inserts node "n" before "which" within list
- */
-KLIB_EXTERN void CC DLListInsertNodeBefore ( DLList *dl, DLNode *which, DLNode *n );
-
-/* DLListInsertNodeAfter
- *  inserts node "n" after "which" within list
- */
-KLIB_EXTERN void CC DLListInsertNodeAfter ( DLList *dl, DLNode *which, DLNode *n );
-
-/* DLListInsertListBefore
- *  inserts list "l" before "which" within list "dl"
- */
-KLIB_EXTERN void CC DLListInsertListBefore ( DLList *dl, DLNode *which, DLList *l );
-
-/* DLListInsertListAfter
- *  inserts list "l" after "which" within list "dl"
- */
-KLIB_EXTERN void CC DLListInsertListAfter ( DLList *dl, DLNode *which, DLList *l );
-
-/* DLListUnlink
- *  removes a designated node from list
- */
-KLIB_EXTERN void CC DLListUnlink ( DLList *dl, DLNode *n );
-
-/* DLListForEach
- *  executes a function on each list element
- */
-KLIB_EXTERN void CC DLListForEach ( const DLList *dl, bool reverse,
-    void ( CC * f ) ( DLNode *n, void *data ), void *data );
-
-/* DLListDoUntil
- *  executes a function on each element
- *  until the function returns true
- */
-KLIB_EXTERN bool CC DLListDoUntil ( const DLList *dl, bool reverse,
-    bool ( CC * f ) ( DLNode *n, void *data ), void *data );
-
-/* DLListFindFirst
- *  find first element satisfying criteria
- */
-KLIB_EXTERN DLNode* CC DLListFindFirst ( const DLList *dl, bool ( CC * f ) ( const DLNode *n ) );
-
-/* DLListFindLast
- *  find last element satisfying criteria
- */
-KLIB_EXTERN DLNode* CC DLListFindLast ( const DLList *dl, bool ( CC * f ) ( const DLNode *n ) );
-
-/* DLListWhack
- *  pops elements from list and
- *  executes a user provided destructor
- */
-KLIB_EXTERN void CC DLListWhack ( DLList *dl, void ( CC * whack ) ( DLNode *n, void *data ), void *data );
-
-
-/*--------------------------------------------------------------------------
- * BSTNode
- *  binary search tree node
- */
-typedef struct BSTNode BSTNode;
-struct BSTNode
-{
-    BSTNode *par;
-    BSTNode *child [ 2 ];
-};
-
-/* BSTNodeNext
- *  returns next node
- */
-KLIB_EXTERN BSTNode* CC BSTNodeNext ( const BSTNode *n );
-
-/* BSTNodePrev
- *  returns prev node
- */
-KLIB_EXTERN BSTNode* CC BSTNodePrev ( const BSTNode *n );
-
-/* BSTNodeParent
- *  returns a parent node if there, NULL otherwise
- */
-KLIB_EXTERN BSTNode* CC BSTNodeParent ( const BSTNode *n );
-
-/* BSTNodeFindNext
- *  find next element satisfying criteria
- */
-KLIB_EXTERN BSTNode* CC BSTNodeFindNext ( const BSTNode *n, bool ( CC * f ) ( const BSTNode *n ) );
-
-/* BSTNodeFindPrev
- *  find previous element satisfying criteria
- */
-KLIB_EXTERN BSTNode* CC BSTNodeFindPrev ( const BSTNode *n, bool ( CC * f ) ( const BSTNode *n ) );
-
-
-/*--------------------------------------------------------------------------
- * BSTree
- *  binary search tree
- */
-typedef struct BSTree BSTree;
-struct BSTree
-{
-    BSTNode *root;
-};
-
-/* BSTreeInit
- *  initialize tree
- */
-#define BSTreeInit( bt ) \
-    ( void ) ( ( bt ) -> root = NULL )
-
-/* BSTreeDepth
- *  returns number of layers in tree
- *
- *  if "exact" is true, then the maximum
- *  depth is returned. otherwise, the depth of
- *  an arbitrary leaf node is returned
- */
-KLIB_EXTERN uint32_t CC BSTreeDepth ( const BSTree *bt, bool exact );
-
-/* BSTreeFirst
- *  returns first node
- */
-KLIB_EXTERN BSTNode* CC BSTreeFirst ( const BSTree *bt );
-
-/* BSTreeLast
- *  returns last node
- */
-KLIB_EXTERN BSTNode* CC BSTreeLast ( const BSTree *bt );
-
-/* BSTreeFind
- *  find an object within tree
- *  "cmp" function returns equivalent of "item" - "n"
- */
-KLIB_EXTERN BSTNode* CC BSTreeFind ( const BSTree *bt, const void *item,
-    int ( CC * cmp ) ( const void *item, const BSTNode *n ) );
-
-/* BSTreeInsert
- *  insert an object within tree, even if duplicate
- *  "sort" function returns equivalent of "item" - "n"
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- *
- *  returns 0 if insert succeeded or an OS error code otherwise.
- */
-KLIB_EXTERN rc_t CC BSTreeInsert ( BSTree *bt, BSTNode *item,
-    int ( CC * sort ) ( const BSTNode *item, const BSTNode *n ) );
-
-/* BSTreeInsertUnique
- *  insert an object within tree, but only if unique.
- *  "sort" function returns equivalent of "item" - "n"
- *
- *  returns 0 if insertion succeeded. or an OS error code otherwise.
- *  if error code is EEXIST, the existing object is returned in "exist".
- */
-KLIB_EXTERN rc_t CC BSTreeInsertUnique ( BSTree *bt, BSTNode *item, BSTNode **exist,
-    int ( CC * sort ) ( const BSTNode *item, const BSTNode *n ) );
-
-/* BSTreeResort
- *  an optimized removal and re-insertion of
- *  all contained elements using another function
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- */
-KLIB_EXTERN void CC BSTreeResort ( BSTree *bt,
-    int ( CC * resort ) ( const BSTNode *item, const BSTNode *n ) );
-
-/* BSTreeUnlink
- *  removes a node from tree
- *
- *  returns true if node was removed from tree
- *  false if it could not be removed, e.g. was not in tree
- */
-KLIB_EXTERN bool CC BSTreeUnlink ( BSTree *bt, BSTNode *n );
-
-/* BSTreeForEach
- *  executes a function on each tree element
- */
-KLIB_EXTERN void CC BSTreeForEach ( const BSTree *bt, bool reverse,
-    void ( CC * f ) ( BSTNode *n, void *data ), void *data );
-
-/* BSTreeDoUntil
- *  executes a function on each element
- *  until the function returns true
- *
- *  return values:
- *    false unless the function returns true
- */
-KLIB_EXTERN bool CC BSTreeDoUntil ( const BSTree *bt, bool reverse,
-    bool ( CC * f ) ( BSTNode *n, void *data ), void *data );
-
-/* BSTreeWhack
- *  removes nodes from tree and
- *  executes a user provided destructor
- */
-KLIB_EXTERN void CC BSTreeWhack ( BSTree *bt, void ( CC * whack ) ( BSTNode *n, void *data ), void *data );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_container_ */
diff --git a/interfaces/klib/data-buffer.h b/interfaces/klib/data-buffer.h
deleted file mode 100644
index dbb0bca..0000000
--- a/interfaces/klib/data-buffer.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_klib_data_buffer
-#define _h_klib_data_buffer
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KDataBuffer
- *  simple, open structure to reference an opaque data buffer
- *
- *  "base" - pointer to first byte of buffer
- *
- *  "elem_bits" - size of buffer element datatype in bits
- *
- *  "elem_count" - size of buffer in elements
- *
- *  "bit_offset" [ DEFAULT ZERO ] - offset from "base"
- *  to first bit of buffer, always 0 when "elem_bits" % 8 == 0
- *  bits are left-packed, i.e.:
- *
- *    bit_offset | starting bit
- *   ============+=============
- *            0  |  7
- *            1  |  6
- *            2  |  5
- *              ...
- *            6  |  1
- *            7  |  0
- */
-typedef struct KDataBuffer KDataBuffer;
-struct KDataBuffer
-{
-    const void *ignore;
-    void *base;
-    uint64_t elem_bits;
-    uint64_t elem_count;
-    uint8_t bit_offset;
-};
-
-
-/* Bits
- *  return buffer size in bits
- */
-#define KDataBufferBits( self ) \
-    ((((bitsz_t)((const KDataBuffer *)(self))->elem_bits) * ((const KDataBuffer *)(self))->elem_count))
-
-/* Bytes
- *  returns buffer size in bytes
- */
-#define KDataBufferBytes( self ) \
-   ((size_t)((KDataBufferBits(self) + 7) >> 3))
-
-
-/* Make
- *  create a new empty buffer
- *
- *  "buffer" [ OUT ] - pointer to structure to initialize
- *
- *  "elem_bits" [ IN ] - the number of bits in each element
- *
- *  "elem_capacity" [ IN ] - the minimum number of elements to be allocated
- */
-KLIB_EXTERN rc_t CC KDataBufferMake ( KDataBuffer *buffer,
-    uint64_t elem_bits, uint64_t elem_capacity );
-
-
-/* MakeBytes
- * MakeBits
- *  create a new empty buffer with default element size
- */
-#define KDataBufferMakeBytes( buffer, bytes ) \
-    KDataBufferMake ( buffer, 8, bytes )
-#define KDataBufferMakeBits( buffer, bits ) \
-    KDataBufferMake ( buffer, 1, bits )
-
-/* Sub
- *  create a sub-range reference to an existing buffer
- *
- *  "sub" [ OUT ] - pointer to subrange structure
- *
- *  "start" [ IN ] - element offset of subrange from start of "self".
- *  if given start >= self->elem_count, the resultant subrange
- *  will have an element count of 0.
- *
- *  "count" [ IN, DEFAULT UINT64_MAX ] - number of elements of subrange.
- *  when given count exceeds buffer size, the actual count is calculated to be
- *  all remaining count in "self" from "start". otherwise, the
- *  requested count will be limited to the actual count available
- *  in "self".
- */
-KLIB_EXTERN rc_t CC KDataBufferSub ( const KDataBuffer *self,
-    KDataBuffer *sub, uint64_t start, uint64_t count );
-
-
-/* MakeWritable
- *  make a writable copy of the buffer, copying contents if needed.
- *
- *  "writable" [ OUT ] - pointer to the structure to initialize
- *
- * The usage pattern is:
- *   KDataBuffer buffer;
- * ...
- * initialize buffer
- * do stuff which might make it shared
- *   (like pass it to a function that might retain it)
- * ...
- *   KDataBuffer writable;
- *   rc_t rc = KDataBufferMakeWritable(&buffer, &writable);
- *
- *   if (rc == 0) {
- *       / * until you whack the old one KDataBufferWritable(&writable) might be false! * /
- *       KDataBufferWhack(&buffer);
- *       buffer = writable;
- * ...
- * do whatever you want with buffer because it is now writable (not shared)
- * ...
- *   }
- *   KDataBufferWhack(&buffer);
- */
-KLIB_EXTERN rc_t CC KDataBufferMakeWritable ( const KDataBuffer *self, KDataBuffer *writable );
-
-
-/* Whack
- *  release memory associated with a buffer.
- */
-KLIB_EXTERN rc_t CC KDataBufferWhack ( KDataBuffer *self );
-
-
-/* Resize
- *  make a buffer bigger or smaller.
- *  can fail if not enough memory.
- *  can fail if not writable.
- *
- *  "new_count" [ IN ] - new number of elements
- */
-KLIB_EXTERN rc_t CC KDataBufferResize ( KDataBuffer *self, uint64_t new_count );
-
-
-/* Cast
- *  create a new data-buffer with a different element size
- *  won't increase the total number of bits
- *
- *  "cast" [ OUT ] - newly typed buffer
- *
- *  "new_elem_bits" [ IN ] - new element size in bits
- *
- *  "can_shrink" [ IN ] - when true allow
- *  KDataBufferBits ( cast ) < KDataBufferBits ( self )
- */
-KLIB_EXTERN rc_t CC KDataBufferCast ( const KDataBuffer *self,
-    KDataBuffer *cast, uint64_t new_elem_bits, bool can_shrink );
-
-
-/* Writable
- *  returns true if buffer is valid and writable
- */
-KLIB_EXTERN bool CC KDataBufferWritable ( const KDataBuffer *self );
-
-
-/* CheckIntegrity
- *  performs some level of integrity checking on buffer structure
- */
-KLIB_EXTERN rc_t CC KDataBufferCheckIntegrity ( const KDataBuffer *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_data_buffer_ */
diff --git a/interfaces/klib/debug.h b/interfaces/klib/debug.h
deleted file mode 100644
index 3b321ef..0000000
--- a/interfaces/klib/debug.h
+++ /dev/null
@@ -1,535 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-#ifndef _h_klib_debug_
-#define _h_klib_debug_
-
-#if _DEBUGGING
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_status_
-#include <klib/status.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ----------
- * KDbgModule and KDbgCondition
- *
- * KDbg messages are filtered by a pair of values: a module and a condition.
- *
- * A KDbgFlag is a single bit representing an enumerated condition ID
- *
- * In this context the module is merely a set and not specifically tied to any
- * other use of the term module.
- */
-
-
-
-/*
- * To add a new module, just add it to the list in MODULE_NAMES but as a 
- * parameter to the macro "_module"
- *
- * Then add the conditions for that module.  There must be at least one.
- * Put them in the macro "_condition"
- *
- * NOTE:
- * There must be at least one condition for a module.
- *
- * NOTE:
- * Do not seperate the items in eith MODULES or xxx_CONDITIONS by anything 
- * other than white space.
- *
- * NOTE:
- * The exact text must used in the _module(MOD) and the MOD_CONDITIONS()
- * so if you want all lower, all upper ot mixed case it must be the same.
- * this exact case will apply to the command line argument as well.
- *
- * NOTE:
- * The MOD and CONDITIONS must be legal C Identifiers. The exception is a
- * condition may start with a numeric or even be all numeric.  Punctuation other
- * than '_' is not allowed.
- *
- * NOTE:
- * No not use condition "ANY" or "NONE" as they are special flag names.
- *
- * The rest of the file will take care of adding the new strings, enumerations
- * and structures for the new modules and/or new conditions.
- *
- * The expected command line will be "-D mod" to add "any" for the module or
- * "-D mod-cond" to add only that condition with in the module.
- * "-D" and "--debug" are expected to be equivalent"
- *
- * The expected usage in a C source file is to use the flag value.
- * For an added module (MMM) and condition (CCC) the symbols used would be
- * "dbg_MMM" and "dbg_MMM_CCC" that will get an index
- * to a flag value and the flag to test for a condition.
- *
- * Any number of individual "-D conditions" are accepted.
- */
-
-#define MODULE_NAMES() \
-    _module(APP)  _module(BLAST) _module(KDB) _module(REF)   _module(LEGREF) \
-    _module(KFS)  _module(XML)   _module(VDB) _module(SRA)    \
-    _module(XARC) _module(ALIGN) _module(KFG) _module(KRYPTO) \
-    _module(SEARCH) _module(LOADLIB) _module(VFS) _module(AES) _module(ARGS)
-
-#define APP_CONDITIONS() \
-    _condition(APP,0)  _condition(APP,1)  _condition(APP,2)  _condition(APP,3)  \
-    _condition(APP,4)  _condition(APP,5)  _condition(APP,6)  _condition(APP,7)  \
-    _condition(APP,8)  _condition(APP,9)  _condition(APP,10) _condition(APP,11) \
-    _condition(APP,12) _condition(APP,13) _condition(APP,14) _condition(APP,15) \
-    _condition(APP,16) _condition(APP,17) _condition(APP,18) _condition(APP,19) \
-    _condition(APP,20) _condition(APP,21) _condition(APP,22) _condition(APP,23) \
-    _condition(APP,24) _condition(APP,25) _condition(APP,26) _condition(APP,27) \
-    _condition(APP,28) _condition(APP,29) _condition(APP,30) _condition(APP,31) \
-    _condition(APP,32) _condition(APP,33) _condition(APP,34) _condition(APP,35) \
-    _condition(APP,36) _condition(APP,37) _condition(APP,38) _condition(APP,39) \
-    _condition(APP,40) _condition(APP,41) _condition(APP,42) _condition(APP,43) \
-    _condition(APP,44) _condition(APP,45) _condition(APP,46) _condition(APP,47) \
-    _condition(APP,48) _condition(APP,49) _condition(APP,50) _condition(APP,51) \
-    _condition(APP,52) _condition(APP,53) _condition(APP,54) _condition(APP,55) \
-    _condition(APP,56) _condition(APP,57) _condition(APP,58) _condition(APP,59) \
-    _condition(APP,60) _condition(APP,61) _condition(APP,62) _condition(APP,63) 
-
-#define BLAST_CONDITIONS() \
-    _condition(BLAST,BLAST)
-
-#define KDB_CONDITIONS() \
-    _condition(KDB,KDB)
-
-/* place holder should be replaced by the first object that gets the debug stuff tested for krefcount_t */
-#define REF_CONDITIONS() \
-    _condition(REF,PLACEHOLDER)
-
-#define LEGREF_CONDITIONS() \
-    _condition(LEGREF,MD5) _condition(LEGREF,CRC)
-
-#define KFS_CONDITIONS() \
-    _condition(KFS,MD5)      _condition(KFS,DLL) _condition(KFS,KFFENTRY) _condition(KFS,KFF)  \
-    _condition(KFS,ARCENTRY) _condition(KFS,ARC) _condition(KFS,TOCENTRY) _condition(KFS,TOC)  \
-    _condition(KFS,TARENTRY) _condition(KFS,TAR) _condition(KFS,SRASORT)  _condition(KFS,GZIP) \
-    _condition(KFS,DIR)  _condition(KFS,COUNTER) _condition(KFS,BZIP)     _condition(KFS,SYS)
-
-#define VFS_CONDITIONS() \
-    _condition(VFS,MGR)     _condition(VFS,PATH)
-
-#define XML_CONDITIONS() \
-    _condition(XML,XML)
-
-#define VDB_CONDITIONS() \
-    _condition(VDB,RESOLVE) \
-    _condition(VDB,COMPARE) \
-    _condition(VDB,FUNCTION) \
-    _condition(VDB,VDB) \
-    _condition(VDB,PARSE) \
-    _condition(VDB,MTCURSOR)
-
-#define SRA_CONDITIONS() \
-    _condition(SRA,INFO) _condition(SRA,SORT) 
-
-#define XARC_CONDITIONS() \
-    _condition(XARC,ENTRY) \
-    _condition(XARC,ARC)
-
-#define ALIGN_CONDITIONS() \
-    _condition(ALIGN,WRITER) _condition(ALIGN,COMPRESS) _condition(ALIGN,COVERAGE) \
-    _condition(ALIGN,BAM) _condition(ALIGN,BGZF) _condition(ALIGN,CFG)
-
-#define KFG_CONDITIONS() \
-    _condition(KFG,LOAD) _condition(KFG,NODE)
-
-#define KRYPTO_CONDITIONS() \
-    _condition(KRYPTO,STS) \
-    _condition(KRYPTO,CFG) \
-    _condition(KRYPTO,ENCRYPT) \
-    _condition(KRYPTO,DECRYPT)
-
-#define AES_CONDITIONS() \
-    _condition(AES,KEYEXP) _condition(AES,CIPHER) \
-    _condition(AES,INVKEYEXP) _condition(AES,INVCIPHER) \
-    _condition(AES,OBJECT)
-
-#define SEARCH_CONDITIONS() \
-    _condition(SEARCH,MYERS)
-
-#define LOADLIB_CONDITIONS() \
-    _condition(LOADLIB,PBAR) _condition(LOADLIB,FILE) _condition(LOADLIB,XLOG)
-
-#define ARGS_CONDITIONS() \
-    _condition(ARGS,WRITER)
-
-/*
- * Nothing below here needs to be changed when just adding new modules
- * and/or conditions
- */
-
-/* macros to do preprocessor token pasting and stringification */
-#define DBG_PASTE_2(a,b)        a##b
-#define DBG_PASTE_3(a,b,c)      a##b##c
-#define DBG_PASTE_4(a,b,c,d)    a##b##c##d
-#define DBG_PASTE_5(a,b,c,d,e)  a##b##c##d##e
-#define DBG_STRING(a)           #a
-
-/*
- * Build the module enumerations/flags.
- */
-#define _module(mod)   DBG_PASTE_2(DBG_,mod),
-
-typedef int32_t KDbgMod;
-enum
-{
-    DBG_MOD_NOT_FOUND = -1,
-    MODULE_NAMES()
-    DBG_MOD_COUNT
-};
-
-#undef _module
-
-
-/* 
- * the dbg_id and dbg_flag types are for ease of generically
- * typing flags with more specific types defined below.  These are more fully
- * filled out to help debuggers more than any real need for the code to work
- *
- * We'll just assume a limit of 32 bits for an enumeration.
- */
-
-/* dbg_id is approprite as a array index */
-    typedef uint32_t KDbgCond;
-enum
-{
-    DBG_COND_MIN = 0,
-    DBG_COND_0 = DBG_COND_MIN,      DBG_COND_1,     DBG_COND_2,
-    DBG_COND_3,     DBG_COND_4,     DBG_COND_5,     DBG_COND_6,
-    DBG_COND_7,     DBG_COND_8,     DBG_COND_9,     DBG_COND_10,
-    DBG_COND_11,    DBG_COND_12,    DBG_COND_13,    DBG_COND_14,
-    DBG_COND_15,    DBG_COND_16,    DBG_COND_17,    DBG_COND_18,
-    DBG_COND_19,    DBG_COND_20,    DBG_COND_21,    DBG_COND_22,
-    DBG_COND_23,    DBG_COND_24,    DBG_COND_25,    DBG_COND_26,
-    DBG_COND_27,    DBG_COND_28,    DBG_COND_29,    DBG_COND_30,
-    DBG_COND_31,    DBG_COND_32,    DBG_COND_33,    DBG_COND_34,
-    DBG_COND_35,    DBG_COND_36,    DBG_COND_37,    DBG_COND_38,
-    DBG_COND_39,    DBG_COND_40,    DBG_COND_41,    DBG_COND_42,
-    DBG_COND_43,    DBG_COND_44,    DBG_COND_45,    DBG_COND_46,
-    DBG_COND_47,    DBG_COND_48,    DBG_COND_49,    DBG_COND_50,
-    DBG_COND_51,    DBG_COND_52,    DBG_COND_53,    DBG_COND_54,
-    DBG_COND_55,    DBG_COND_56,    DBG_COND_57,    DBG_COND_58,
-    DBG_COND_59,    DBG_COND_60,    DBG_COND_61,    DBG_COND_62,
-    DBG_COND_63,    DBG_COND_MAX = DBG_COND_63
-};
-
-typedef uint64_t KDbgFlag;
-typedef uint64_t KDbgMask;
-
-
-/* to make a KDbgFlag out of a KDbgCond, shift 1 one by the condition id */
-/* to make as mask out of flags just OR them together */
-
-KLIB_EXTERN KDbgFlag CC KDbgCondToFlag ( KDbgCond cond );
-
-#if LOG_INLINING
-#define DBG_FLAG(debug_cond) (((KDbgFlag)1)<<debug_cond)
-#else
-#define DBG_FLAG(debug_cond) KDbgCondToFlag(debug_cond)
-#endif
-
-
-/* dbg_flag is a type that can be used to and against the enabled fkags/masks */
-typedef uint64_t dbg_flag;
-
-#define DBG_FLAG_NONE 0
-#define DBG_FLAG_0  (((dbg_flag)1)<<DBG_COND_0)
-#define DBG_FLAG_1  (((dbg_flag)1)<<DBG_COND_1)
-#define DBG_FLAG_2  (((dbg_flag)1)<<DBG_COND_2)
-#define DBG_FLAG_3  (((dbg_flag)1)<<DBG_COND_3)
-#define DBG_FLAG_4  (((dbg_flag)1)<<DBG_COND_4)
-#define DBG_FLAG_5  (((dbg_flag)1)<<DBG_COND_5)
-#define DBG_FLAG_6  (((dbg_flag)1)<<DBG_COND_6)
-#define DBG_FLAG_7  (((dbg_flag)1)<<DBG_COND_7)
-#define DBG_FLAG_8  (((dbg_flag)1)<<DBG_COND_8)
-#define DBG_FLAG_9  (((dbg_flag)1)<<DBG_COND_9)
-#define DBG_FLAG_10 (((dbg_flag)1)<<DBG_COND_10)
-#define DBG_FLAG_11 (((dbg_flag)1)<<DBG_COND_11)
-#define DBG_FLAG_12 (((dbg_flag)1)<<DBG_COND_12)
-#define DBG_FLAG_13 (((dbg_flag)1)<<DBG_COND_13)
-#define DBG_FLAG_14 (((dbg_flag)1)<<DBG_COND_14)
-#define DBG_FLAG_15 (((dbg_flag)1)<<DBG_COND_15)
-#define DBG_FLAG_16 (((dbg_flag)1)<<DBG_COND_16)
-#define DBG_FLAG_17 (((dbg_flag)1)<<DBG_COND_17)
-#define DBG_FLAG_18 (((dbg_flag)1)<<DBG_COND_18)
-#define DBG_FLAG_19 (((dbg_flag)1)<<DBG_COND_19)
-#define DBG_FLAG_20 (((dbg_flag)1)<<DBG_COND_20)
-#define DBG_FLAG_21 (((dbg_flag)1)<<DBG_COND_21)
-#define DBG_FLAG_22 (((dbg_flag)1)<<DBG_COND_22)
-#define DBG_FLAG_23 (((dbg_flag)1)<<DBG_COND_23)
-#define DBG_FLAG_24 (((dbg_flag)1)<<DBG_COND_24)
-#define DBG_FLAG_25 (((dbg_flag)1)<<DBG_COND_25)
-#define DBG_FLAG_26 (((dbg_flag)1)<<DBG_COND_26)
-#define DBG_FLAG_27 (((dbg_flag)1)<<DBG_COND_27)
-#define DBG_FLAG_28 (((dbg_flag)1)<<DBG_COND_28)
-#define DBG_FLAG_29 (((dbg_flag)1)<<DBG_COND_29)
-#define DBG_FLAG_30 (((dbg_flag)1)<<DBG_COND_30)
-#define DBG_FLAG_31 (((dbg_flag)1)<<DBG_COND_31)
-#define DBG_FLAG_32 (((dbg_flag)1)<<DBG_COND_32)
-#define DBG_FLAG_33 (((dbg_flag)1)<<DBG_COND_33)
-#define DBG_FLAG_34 (((dbg_flag)1)<<DBG_COND_34)
-#define DBG_FLAG_35 (((dbg_flag)1)<<DBG_COND_35)
-#define DBG_FLAG_36 (((dbg_flag)1)<<DBG_COND_36)
-#define DBG_FLAG_37 (((dbg_flag)1)<<DBG_COND_37)
-#define DBG_FLAG_38 (((dbg_flag)1)<<DBG_COND_38)
-#define DBG_FLAG_39 (((dbg_flag)1)<<DBG_COND_39)
-#define DBG_FLAG_40 (((dbg_flag)1)<<DBG_COND_40)
-#define DBG_FLAG_41 (((dbg_flag)1)<<DBG_COND_41)
-#define DBG_FLAG_42 (((dbg_flag)1)<<DBG_COND_42)
-#define DBG_FLAG_43 (((dbg_flag)1)<<DBG_COND_43)
-#define DBG_FLAG_44 (((dbg_flag)1)<<DBG_COND_44)
-#define DBG_FLAG_45 (((dbg_flag)1)<<DBG_COND_45)
-#define DBG_FLAG_46 (((dbg_flag)1)<<DBG_COND_46)
-#define DBG_FLAG_47 (((dbg_flag)1)<<DBG_COND_47)
-#define DBG_FLAG_48 (((dbg_flag)1)<<DBG_COND_48)
-#define DBG_FLAG_49 (((dbg_flag)1)<<DBG_COND_49)
-#define DBG_FLAG_50 (((dbg_flag)1)<<DBG_COND_50)
-#define DBG_FLAG_51 (((dbg_flag)1)<<DBG_COND_51)
-#define DBG_FLAG_52 (((dbg_flag)1)<<DBG_COND_52)
-#define DBG_FLAG_53 (((dbg_flag)1)<<DBG_COND_53)
-#define DBG_FLAG_54 (((dbg_flag)1)<<DBG_COND_54)
-#define DBG_FLAG_55 (((dbg_flag)1)<<DBG_COND_55)
-#define DBG_FLAG_56 (((dbg_flag)1)<<DBG_COND_56)
-#define DBG_FLAG_57 (((dbg_flag)1)<<DBG_COND_57)
-#define DBG_FLAG_58 (((dbg_flag)1)<<DBG_COND_58)
-#define DBG_FLAG_59 (((dbg_flag)1)<<DBG_COND_59)
-#define DBG_FLAG_60 (((dbg_flag)1)<<DBG_COND_60)
-#define DBG_FLAG_61 (((dbg_flag)1)<<DBG_COND_61)
-#define DBG_FLAG_62 (((dbg_flag)1)<<DBG_COND_62)
-#define DBG_FLAG_63 (((dbg_flag)1)<<DBG_COND_63)
-#define DBG_FLAG_ANY (~(dbg_flag)0)
-
-/*
- * Build the list of enums for the various modules.
- * These are descendant types of KDbgCond and KDbgFlag
- *
- * The use of ',' or ';' at the end of macros is precise to suit the use
- * in the initializers and enum definitions.
- *
- * These usually means no ',' or ';' at the end of instantiations.
- */
-#define _module(mod)                            \
-    typedef int32_t DBG_PASTE_2(DBG_COND_,mod); \
-    enum                                        \
-        {                                       \
-        DBG_PASTE_2(mod,_CONDITIONS())          \
-        DBG_PASTE_3(DBG_,mod,_COUNT)            \
-    };
-#define _condition(mod,flag) DBG_PASTE_4(DBG_,mod,_,flag),
-
-MODULE_NAMES()
-
-#undef _condition
-#undef _module
-
-typedef struct dbg_s_flag dbg_s_flag;
-struct dbg_s_flag
-{
-    const char * name;
-    KDbgFlag flag;
-};
-
-typedef struct dbg_s_mod dbg_s_mod;
-struct dbg_s_mod
-{
-    const char *       name;  /* matches item in MODULE_NAMES() */
-    const dbg_s_flag *  conds; /* array of structures for setting flags */
-    KDbgMask           flags; /* which flags are active */
-};
-
-extern dbg_s_mod dbg_flag_mod     [DBG_MOD_COUNT+1];
-
-
-#define _module(mod) \
-    extern KDbgMask DBG_PASTE_3(DBG_,mod,_ANY);
-
-MODULE_NAMES()
-
-#undef _module
-
-
-/*
- * strings will be defined only in the single C file that should
- * define the symbol below before including this file.
- *
- * This could have been done in the C file but was done here to
- * keep the spirit of the work done all in one place.
- */
-
-#ifdef _KLIB_DEBUG_C_
-
-#define _module(mod) \
-    KDbgFlag DBG_PASTE_3(DBG_,mod,_ANY) = ( DBG_PASTE_2(mod,_CONDITIONS()) 0);
-#define _condition(mod,flag) \
-    (((KDbgFlag)1)<<DBG_PASTE_4(DBG_,mod,_,flag)) |
-
-MODULE_NAMES()
-
-#undef _module
-#undef _condition
-
-#define _module(mod)                            \
-    dbg_s_flag DBG_PASTE_2(dbg_s_flag_,mod) [] = \
-    {                                            \
-        DBG_PASTE_2(mod,_CONDITIONS())           \
-        { NULL, DBG_FLAG_NONE }                      \
-    };
-
-#define _condition(mod,flag)                                           \
-    { DBG_STRING(flag), ((KDbgFlag)1)<<DBG_PASTE_4(DBG_,mod,_,flag) },
-
-MODULE_NAMES()
-
-#undef _module
-#undef _condition
-
-#define _module(mod)                           \
-    {                                           \
-        DBG_STRING(mod),                         \
-        DBG_PASTE_2(dbg_s_flag_,mod),        \
-        0                                       \
-    },
-
-dbg_s_mod dbg_flag_mod [] = 
-{
-    MODULE_NAMES()
-    { NULL, NULL }
-};
-#undef _module
-
-#define _module(mod) 
-
-#endif /* if _KLIB_TEST_C_ */
-
-
-/*
- * For module 'mod' turn on or off the specific flags in
- * mask flags
- *
- * bits in mask are effected.
- * return previous 
- */
-KLIB_EXTERN KDbgMask CC KDbgSetModConds ( KDbgMod mod, KDbgMask mask, KDbgMask flags );
-KLIB_EXTERN bool CC KDbgTestModConds ( KDbgMod mod, KDbgMask flags );
-
-
-/*
- * Init()
- * Initialize the debug messages module to a known state
- */
-KLIB_EXTERN rc_t CC KDbgInit (void);
-
-/* 
- * param is coming in as utf-8/ASCII with NUL terminator or we fail
- * we also assume no more than 127 significant characters
- *
- * These strings can be utf-8 or ASCII even if we are using 
- * clib strXXX functions.
- */
-KLIB_EXTERN rc_t CC KDbgSetString (const char * string);
-
-/* KDbgMask KDbgFlagsGet  (KDbgMod mod); */
-/* bool     KDbgTestCond  (KDbgMask mask); */
-
-
-/*
- * Get the KDbgMod associated with a name.
- */
-KLIB_EXTERN rc_t CC KDbgGetModId (KDbgMod * mod, 
-                   const char * mod_name, size_t mod_size);
-
-/*
- * Get the KDbgCond associated with a name.
- */
-KLIB_EXTERN rc_t CC KDbgGetCndFlag (KDbgMod mod, KDbgFlag * flag,
-                      const char * cnd_name, size_t cnd_size);
-
-KLIB_EXTERN KDbgMask CC KDbgGetModFlags ( KDbgMod mod );
-
-KLIB_EXTERN rc_t CC KDbgMsg (const char * fmt, ...);
-
-#define DBGMSG(mod,flags,msg) \
-    (void)(((KDbgWriterGet() != NULL) && (KDbgTestModConds (mod, flags)))  \
-           ? KDbgMsg msg : 0)
-
-/* -----
- * Handlers for application and library writers.
- */
-KLIB_EXTERN KWrtHandler* CC KDbgHandlerGet ( void );
-KLIB_EXTERN KWrtWriter CC KDbgWriterGet ( void );
-KLIB_EXTERN void* CC KDbgWriterDataGet ( void );
-
-/* Handler
- *  sets output handler for standard output
- *
- *  "logger" [ IN ] and "self" [ IN, OPAQUE ] - callback function
- *  to handle log output
- */
-KLIB_EXTERN rc_t CC KDbgHandlerSet ( KWrtWriter writer, void * data );
-
-KLIB_EXTERN rc_t CC KDbgHandlerSetStdOut();
-KLIB_EXTERN rc_t CC KDbgHandlerSetStdErr();
-
-#ifdef __cplusplus
-}
-#endif
-
-#else /* #if _DEBUGGING */
-
-#define DBGMSG(mod,flags,msg) ((void)0)
-
-#define KDbgInit() ((rc_t)0)
-
-#define KDbgHandlerSetStdOut() ((rc_t)0)
-#define KDbgHandlerSetStdErr() ((rc_t)0)
-
-#define KDbgSetString(s) ((rc_t)0)
-
-#define KDbgHandlerSet(a,b) ((rc_t)0)
-
-#define KDbgHandlerGet() ((void*)NULL)
-#define KDbgWriterGet() ((void*)NULL)
-#define KDbgWriterDataGet() ((void*)NULL)
-
-#endif /* #if _DEBUGGING */
-
-#endif /*  _h_klib_debug_ */
diff --git a/interfaces/klib/defs.h b/interfaces/klib/defs.h
deleted file mode 100644
index 1872442..0000000
--- a/interfaces/klib/defs.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_defs_
-#define _h_klib_defs_
-
-#ifndef _h_klib_callconv_
-#include <klib/callconv.h>
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#else
-#include <stdbool.h>
-#endif
-
-/*--------------------------------------------------------------------------
- * rc_t
- *  upon success, all functions will return code 0
- *  other codes indicate failure or additional status information
- */
-typedef uint32_t rc_t;
-
-
-/*--------------------------------------------------------------------------
- * bitsz_t
- *  where size_t always denotes a quantity of bytes,
- *  bitsz_t denotes a quantity of bits.
- */
-typedef uint64_t bitsz_t;
-
-
-/*--------------------------------------------------------------------------
- * fptr_t
- *  "generic" function pointer type
- *  has very little real use other than to calm down compilers
- */
-typedef int ( CC * fptr_t ) ( void );
-
-
-/*--------------------------------------------------------------------------
- * remove_t
- *  usually when message signatures change, the compiler can
- *  and will pick up the changes and trigger an error. sometimes
- *  it will just issue a warning, and other times will not pick
- *  up on the significance of a change.
- *
- *  to ensure that a change of signature gets caught everywhere
- *  by the compiler, we can introduce an extra parameter that
- *  causes us to visit all dependent code.
- */
-typedef struct remove_t remove_t;
-
-
-/*--------------------------------------------------------------------------
- * KTime_t
- *  64 bit time_t
- *  operations are declared in <klib/time.h>
- */
-typedef int64_t KTime_t;
-
-
-/*--------------------------------------------------------------------------
- * ver_t
- *  32 bit 4 part type
- */
-typedef uint32_t ver_t;
-
-/* GetMajor
- *  return major component
- */
-#define VersionGetMajor( self ) \
-    ( ( self ) >> 24 )
-
-/* GetMinor
- *  return minor component
- */
-#define VersionGetMinor( self ) \
-    ( ( ( self ) >> 16 ) & 0xFF )
-
-/* GetRelease
- *  return release component
- */
-#define VersionGetRelease( self ) \
-    ( ( self ) & 0xFFFF )
-
-
-/*--------------------------------------------------------------------------
- * KCreateMode
- *  values are defined in <kfs/defs.h>
- */
-typedef uint32_t KCreateMode;
-
-
-/*--------------------------------------------------------------------------
- * stringize
- *  it is useful to be able to convert PP defines on the command line
- */
-#define stringize( tok ) tok_to_string ( tok )
-#define tok_to_string( tok ) # tok
-
-
-/*--------------------------------------------------------------------------
- * __mod__, __file__ and __fext__
- *  these guys are slightly different from __FILE__
- *  and they complement __func__
- */
-#if ! defined __mod__ && defined __mod_name__
-#define __mod__ stringize ( __mod_name__ )
-#endif
-
-#if ! defined __file__ && defined __file_name__
-#define __file__ stringize ( __file_name__ )
-#endif
-
-#if ! defined __fext__ && defined __file_ext__
-#define __fext__ stringize ( __file_ext__ )
-#endif
-
-
-#if 1
-
-/*--------------------------------------------------------------------------
- * LPFX
- * SHLX
- * MODX
- *  take their input from make
- */
-#ifndef LIBPREFIX
- #define LPFX ""
-#else
- #define LPFXSTR2( str ) # str
- #define LPFXSTR( str ) LPFXSTR2 ( str )
- #define LPFX LPFXSTR ( LIBPREFIX )
-#endif
-#ifndef SHLIBEXT
- #define SHLX ""
-#else
- #define SHLXSTR2( str ) "." # str
- #define SHLXSTR( str ) SHLXSTR2 ( str )
- #define SHLX SHLXSTR ( SHLIBEXT )
-#endif
-#ifndef MODEXT
- #define MODX SHLX
-#else
- #define MODXSTR2( str ) "." # str
- #define MODXSTR( str ) MODXSTR2 ( str )
- #define MODX MODXSTR ( MODIBEXT )
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_defs_ */
diff --git a/interfaces/klib/extern.h b/interfaces/klib/extern.h
deleted file mode 100644
index 92727f0..0000000
--- a/interfaces/klib/extern.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_extern_
-#define _h_klib_extern_
-
-#ifndef _h_klib_callconv_
-#include <klib/callconv.h>
-#endif
-
-#if ! defined EXPORT_LATCH && _LIBRARY
-
-#define KLIB_EXTERN LIB_EXPORT
-#define KLIB_EXTERN_DATA extern LIB_EXPORT
-#define EXPORT_LATCH 1
-
-#else
-
-#define KLIB_EXTERN LIB_IMPORT
-#ifdef __cplusplus
-#define KLIB_EXTERN_DATA extern /* LIB_IMPORT_DATA */
-#else
-#define KLIB_EXTERN_DATA LIB_IMPORT_DATA
-#endif
-
-#endif
-
-#if defined _MSC_VER && ! _STATIC
-
-/* __declspec ( dllimport ) will cause creation of
-   function pointers rather than thunks, which makes
-   the code that imports unable to link statically
-   against a library. we leave this symbol defined as
-   "extern" to use thunks instead. as a result, all
-   function addresses resolve to the thunk and not
-   the actual function. */
-#define LIB_IMPORT extern
-#define LIB_IMPORT_DATA extern __declspec ( dllimport )
-#define LIB_EXPORT __declspec ( dllexport )
-#define LIB_EXPORT_DATA __declspec ( dllexport )
-
-#else
-
-#define LIB_IMPORT extern
-#define LIB_IMPORT_DATA extern
-#define LIB_EXPORT
-#define LIB_EXPORT_DATA
-
-#endif
-
-#endif /* _h_klib_extern_ */
diff --git a/interfaces/klib/impl.h b/interfaces/klib/impl.h
deleted file mode 100644
index 35959ea..0000000
--- a/interfaces/klib/impl.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_impl_
-#define _h_klib_impl_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-#ifndef _h_atomic_
-#include <atomic.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef union KNamelist_vt KNamelist_vt;
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- *  a virtual directory listing
- */
-struct KNamelist
-{
-    const KNamelist_vt *vt;
-    atomic_t refcount;
-};
-
-#ifndef KNAMELIST_IMPL
-#define KNAMELIST_IMPL KNamelist
-#endif
-
-typedef struct KNamelist_vt_v1 KNamelist_vt_v1;
-struct KNamelist_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KNAMELIST_IMPL *self );
-    rc_t ( CC * count ) ( const KNAMELIST_IMPL *self, uint32_t *count );
-    rc_t ( CC * get ) ( const KNAMELIST_IMPL *self, uint32_t idx, const char **name );
-    /* end minor version == 0 */
-};
-
-union KNamelist_vt
-{
-    KNamelist_vt_v1 v1;
-};
-
-/* Init
- */
-KLIB_EXTERN rc_t CC KNamelistInit ( KNamelist *self, const KNamelist_vt *vt );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_impl_ */
diff --git a/interfaces/klib/klib-priv.h b/interfaces/klib/klib-priv.h
deleted file mode 100644
index f3a0f6f..0000000
--- a/interfaces/klib/klib-priv.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_priv_
-#define _h_klib_priv_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_writer_
-#include <klib/writer.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- */
-
-
-/* reporting structure
- */
-typedef struct ReportFuncs ReportFuncs;
-struct ReportFuncs
-{
-    void ( CC * report ) ( uint32_t indent, const char* name, uint32_t count, ... );
-    void ( CC * reportData ) ( uint32_t indent, const char* name, const char* data, uint32_t count, ... );
-    rc_t ( CC * reportData1 ) ( const char* data );
-    void ( CC * reportOpen ) ( uint32_t indent, const char* name, uint32_t count, ... );
-    void ( CC * reportOpen1 ) ( uint32_t indent, const char* name );
-    void ( CC * reportClose ) ( uint32_t indent, const char* name );
-    void ( CC * reportClose1 ) ( const char* name );
-    void ( CC * reportError ) ( uint32_t indent, rc_t rc, const char* function );
-    void ( CC * reportErrorStr ) ( uint32_t indent, rc_t rc, const char* function,
-        const char* name, const char* val );
-    void ( CC * reportErrorStrImpl ) ( uint32_t indent, rc_t rc, const char* function,
-        const char* name, const char* val, bool eol );
-    void ( CC * reportErrorStrInt ) ( uint32_t indent, rc_t rc, const char* function,
-        const char* names, const char* vals, const char* namei, uint32_t vali );
-    void ( CC * reportError3Str ) ( uint32_t indent, rc_t rc, const char* function,
-        const char* name, const char* v1, const char* v2, const char* v3, bool eol );
-};
-
-
-/* InitKFS
- */
-KLIB_EXTERN void CC ReportInitKFS (
-    rc_t ( CC * report_cwd ) ( const ReportFuncs *f, uint32_t indent ),
-    rc_t ( CC * report_redirect ) ( KWrtHandler* handler,
-        const char* filename, bool* to_file, bool finalize ) );
-
-/* InitConfig
- *  returns appname if available
- */
-KLIB_EXTERN const char* CC ReportInitConfig ( rc_t ( CC * report ) ( const ReportFuncs *f, uint32_t indent ) );
-
-
-/* InitVDB
- */
-KLIB_EXTERN rc_t CC ReportInitVDB(
-    rc_t (CC *report_obj)(const ReportFuncs *f,
-        uint32_t indent, const char *path, bool *wasDbOrTableSet),
-    rc_t (CC *report_software)(const ReportFuncs *f,
-        uint32_t indent, const char *argv_0, const char *date, ver_t tool_ver),
-    rc_t (CC *whack)(void));
-
-
-/* RecordZombieFile
- */
-KLIB_EXTERN void CC ReportRecordZombieFile ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_priv_ */
diff --git a/interfaces/klib/ksort-macro.h b/interfaces/klib/ksort-macro.h
deleted file mode 100644
index e86d57b..0000000
--- a/interfaces/klib/ksort-macro.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_klib_ksort_macro_
-#define _h_klib_ksort_macro_
-
-#include <limits.h>
-#include <stdlib.h>
-
-
-/* Copyright (C) 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Written by Douglas C. Schmidt (schmidt at ics.uci.edu).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* If you consider tuning this algorithm, you should consult first:
-   Engineering a sort function; Jon Bentley and M. Douglas McIlroy;
-   Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993.  */
-
-/* Discontinue quicksort algorithm when partition gets below this size.
-   This particular magic number was chosen to work best on a Sun 4/260. */
-#ifndef KSORT_MAX_THRESH
-#define KSORT_MAX_THRESH 4
-#endif
-
-/* Stack node declarations used to store unfulfilled partition obligations. */
-#ifndef ksort_stack_node_declared
-#define ksort_stack_node_declared 1
-typedef struct ksort_stack_node ksort_stack_node;
-struct ksort_stack_node
-{
-    char *lo;
-    char *hi;
-};
-#endif
-
-/* The next 4 #defines implement a very fast in-line stack abstraction. */
-/* The stack needs log (total_elements) entries (we could even subtract
-   log(MAX_THRESH)).  Since total_elements has type size_t, we get as
-   upper bound for log (total_elements):
-   bits per byte (CHAR_BIT) * sizeof(size_t).  */
-
-#ifndef KSORT_STACK_SIZE
-#define KSORT_STACK_SIZE	(CHAR_BIT * sizeof(size_t))
-#endif
-
-#ifndef KSORT_PUSH
-#define KSORT_PUSH(low, high)	((void) ((top->lo = (low)), (top->hi = (high)), ++top))
-#endif
-
-#ifndef KSORT_POP
-#define	KSORT_POP(low, high)	((void) (--top, (low = top->lo), (high = top->hi)))
-#endif
-
-#ifndef KSORT_STACK_EMPTY
-#define	KSORT_STACK_EMPTY	( stack >= top )
-#endif
-
-#ifndef KSORT_SWAP
-#define KSORT_SWAP( a, b, off, size )           \
-    do                                          \
-    {                                           \
-        register size_t i, end = off + size;    \
-        register char *__a = (a), *__b = (b);   \
-        for ( i = off; i < end; ++ i )          \
-        {                                       \
-            char __tmp = __a [ i ];             \
-            __a [ i ] = __b [ i ];              \
-            __b [ i ] = __tmp;                  \
-        }                                       \
-    } while (0)
-#endif
-
-#define KSORT_TSWAP( T, a, b )                  \
-    do                                          \
-    {                                           \
-        T tmp = * ( const T* ) ( a );           \
-        * ( T* ) ( a ) = * ( const T* ) ( b );  \
-        * ( T* ) ( b ) = tmp;                   \
-    }                                           \
-    while ( 0 )
-
-
-/* Order size using quicksort.  This implementation incorporates
-   four optimizations discussed in Sedgewick:
-
-   1. Non-recursive, using an explicit stack of pointer that store the
-   next array partition to sort.  To save time, this maximum amount
-   of space required to store an array of SIZE_MAX is allocated on the
-   stack.  Assuming a 32-bit (64 bit) integer for size_t, this needs
-   only 32 * sizeof(stack_node) == 256 bytes (for 64 bit: 1024 bytes).
-   Pretty cheap, actually.
-
-   2. Chose the pivot element using a median-of-three decision tree.
-   This reduces the probability of selecting a bad pivot value and
-   eliminates certain extraneous comparisons.
-
-   3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving
-   insertion sort to order the MAX_THRESH items within each partition.
-   This is a big win, since insertion sort is faster for small, mostly
-   sorted array segments.
-
-   4. The larger of the two sub-partitions is always pushed onto the
-   stack first, with the algorithm then concentrating on the
-   smaller partition.  This *guarantees* no more than log (total_elems)
-   stack size is needed (actually O(1) in this case)!  */
-
-#define KSORT( PBASE, TOTAL_ELEMS, ELEM_SIZE, SWAP_OFFSET, SWAP_SIZE )            \
-    register char *base_ptr = ( char* ) ( PBASE );                                \
-    const size_t max_thresh = KSORT_MAX_THRESH * ( ELEM_SIZE );                   \
-    if ( ( TOTAL_ELEMS ) < 2)                                                     \
-        return;                                                                   \
-    if ( ( TOTAL_ELEMS ) > KSORT_MAX_THRESH)                                      \
-    {                                                                             \
-        char *lo = base_ptr;                                                      \
-        char *hi = & lo [ ( ELEM_SIZE ) * ( ( TOTAL_ELEMS ) - 1 ) ];              \
-        ksort_stack_node stack [ KSORT_STACK_SIZE ];                              \
-        ksort_stack_node *top = stack;                                            \
-        KSORT_PUSH (NULL, NULL);                                                  \
-        while ( ! KSORT_STACK_EMPTY )                                             \
-        {                                                                         \
-            char *left_ptr;                                                       \
-            char *right_ptr;                                                      \
-            char *mid = lo + ( ELEM_SIZE ) * ( ( hi - lo ) / ( ELEM_SIZE ) >> 1 );\
-            if ( CMP ( ( void* ) mid, ( void* ) lo ) < 0 )                        \
-                SWAP ( mid, lo, ( SWAP_OFFSET ), ( SWAP_SIZE ) );                 \
-            if ( CMP ( ( void* ) hi, ( void* ) mid) < 0 )                         \
-                SWAP ( mid, hi, ( SWAP_OFFSET ), ( SWAP_SIZE ) );                 \
-            else                                                                  \
-                goto jump_over;                                                   \
-            if ( CMP ( ( void* ) mid, ( void* ) lo ) < 0 )                        \
-                SWAP ( mid, lo, ( SWAP_OFFSET ), ( SWAP_SIZE ) );                 \
-        jump_over:                                                                \
-            left_ptr  = lo + ( ELEM_SIZE );                                       \
-            right_ptr = hi - ( ELEM_SIZE );                                       \
-            do                                                                    \
-            {                                                                     \
-                while ( CMP ( ( void* ) left_ptr, ( void* ) mid ) < 0 )           \
-                    left_ptr += ( ELEM_SIZE );                                    \
-                while ( CMP ( ( void* ) mid, ( void* ) right_ptr ) < 0 )          \
-                    right_ptr -= ( ELEM_SIZE );                                   \
-                if ( left_ptr < right_ptr )                                       \
-                {                                                                 \
-                    SWAP ( left_ptr, right_ptr, ( SWAP_OFFSET ), ( SWAP_SIZE ) ); \
-                    if ( mid == left_ptr )                                        \
-                        mid = right_ptr;                                          \
-                    else if ( mid == right_ptr )                                  \
-                        mid = left_ptr;                                           \
-                    left_ptr += ( ELEM_SIZE );                                    \
-                    right_ptr -= ( ELEM_SIZE );                                   \
-                }                                                                 \
-                else if ( left_ptr == right_ptr )                                 \
-                {                                                                 \
-                    left_ptr += ( ELEM_SIZE );                                    \
-                    right_ptr -= ( ELEM_SIZE );                                   \
-                    break;                                                        \
-                }                                                                 \
-            }                                                                     \
-            while ( left_ptr <= right_ptr );                                      \
-            if ((size_t) (right_ptr - lo) <= max_thresh)                          \
-            {                                                                     \
-                if ((size_t) (hi - left_ptr) <= max_thresh)                       \
-                    KSORT_POP (lo, hi);                                           \
-                else                                                              \
-                    lo = left_ptr;                                                \
-            }                                                                     \
-            else if ((size_t) (hi - left_ptr) <= max_thresh)                      \
-                hi = right_ptr;                                                   \
-            else if ((right_ptr - lo) > (hi - left_ptr))                          \
-            {                                                                     \
-                KSORT_PUSH (lo, right_ptr);                                       \
-                lo = left_ptr;                                                    \
-            }                                                                     \
-            else                                                                  \
-            {                                                                     \
-                KSORT_PUSH (left_ptr, hi);                                        \
-                hi = right_ptr;                                                   \
-            }                                                                     \
-        }                                                                         \
-    }                                                                             \
-    {                                                                             \
-        register char *run_ptr;                                                   \
-        char *const end_ptr = & base_ptr [(ELEM_SIZE)*((TOTAL_ELEMS)-1)];         \
-        char *tmp_ptr = base_ptr;                                                 \
-        char *thresh = base_ptr + max_thresh;                                     \
-        if ( thresh > end_ptr )                                                   \
-            thresh = end_ptr;                                                     \
-        for (run_ptr = tmp_ptr+(ELEM_SIZE);run_ptr<=thresh;run_ptr+=(ELEM_SIZE))  \
-            if ( CMP ( ( void* ) run_ptr, ( void* ) tmp_ptr ) < 0 )               \
-                tmp_ptr = run_ptr;                                                \
-        if (tmp_ptr != base_ptr)                                                  \
-            SWAP ( tmp_ptr, base_ptr, ( SWAP_OFFSET ), ( SWAP_SIZE ) );           \
-        tmp_ptr = base_ptr + ( ELEM_SIZE );                                       \
-        for ( run_ptr = base_ptr + ( 2 * ( ELEM_SIZE ) );                         \
-              run_ptr <= end_ptr; tmp_ptr = run_ptr, run_ptr += ( ELEM_SIZE ) )   \
-        {                                                                         \
-            for ( ; tmp_ptr >= base_ptr; tmp_ptr -= ( ELEM_SIZE ) )               \
-            {                                                                     \
-                if ( CMP ( run_ptr, tmp_ptr ) >= 0 )                              \
-                    break;                                                        \
-            }                                                                     \
-            tmp_ptr += ( ELEM_SIZE );                                             \
-            if ( tmp_ptr != run_ptr )                                             \
-            {                                                                     \
-                char *trav;                                                       \
-                trav = run_ptr + ( ELEM_SIZE );                                   \
-                while ( --trav >= run_ptr )                                       \
-                {                                                                 \
-                    char c = *trav;                                               \
-                    char *hi, *lo;                                                \
-                    for (hi=lo=trav; (lo-=(ELEM_SIZE)) >= tmp_ptr; hi=lo)         \
-                        *hi = *lo;                                                \
-                    *hi = c;                                                      \
-                }                                                                 \
-            }                                                                     \
-        }                                                                         \
-    }                                                                             \
-    ( void ) 0
-
-#endif /* _h_klib_ksort_macro_ */
diff --git a/interfaces/klib/log.h b/interfaces/klib/log.h
deleted file mode 100644
index b16ec6c..0000000
--- a/interfaces/klib/log.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_log_
-#define _h_klib_log_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_logfmt_
-#include <klib/logfmt.h>
-#endif
-
-#ifndef _h_klib_writer_
-#include <klib/writer.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KLogLevel
- *  indicates the severity of message: emission of messages depends upon
- *  the setting of a global value that allows messages assigned higher priority
- * (lower numeric value) while filtering lower priority messages.
- *
- *  "fatal" - reported when about to abort
- *  "sys"   - an error occurred when interacting with OS
- *  "int"   - an internal logic error occurred
- *  "err"   - a user-level error occurred
- *  "warn"  - an unusual or undesired condition was detected
- *  "info"  - an event, state or condition is being reported
- *  "debug" - verbose output for use in debugging
- */
-typedef uint32_t KLogLevel;
-enum
-{
-    klogLevelMin = 0,
-    klogFatal = klogLevelMin,
-    klogSys,
-    klogInt,
-    klogErr,
-    klogWarn,
-    klogInfo,
-    klogLevelMax = klogInfo
-};
-
-/* Get
- *  retrieve current process-global log level
- */
-KLIB_EXTERN KLogLevel CC KLogLevelGet (void);
-
-/* Set
- *  set process-global log level
- */
-KLIB_EXTERN rc_t CC KLogLevelSet ( KLogLevel lvl );
-
-
-/* KLogLevelAdjust
- *  adjust process-global log level by an offset from current
- */
-KLIB_EXTERN void CC KLogLevelAdjust ( int32_t adjust );
-
-
-/* KLogLevelExplain
- *  inserts level description
- *
- * buffer may not be NULL, num_writ may be NULL
- */
-KLIB_EXTERN rc_t CC KLogLevelExplain ( KLogLevel lvl, char* buffer, size_t bsize, size_t* num_writ );
-
-KLIB_EXTERN const char ** CC KLogGetParamStrings ( void );
-
-/* LastErrorCode
- * LastErrorCodeReset
- *  return or clear the last reported rc_t with log level klogErr or above
- */
-KLIB_EXTERN rc_t CC KLogLastErrorCode ( void );
-KLIB_EXTERN void CC KLogLastErrorCodeReset ( void );
-
-/* LastErrorCodeSet
- *  set the last reported rc_t with log level klogErr or above
- */
-KLIB_EXTERN void CC KLogLastErrorCodeSet ( KLogLevel lvl, rc_t rc );
-
-/* -----
- * Handlers for application and library writers.
- */
-KLIB_EXTERN KWrtHandler* CC KLogHandlerGet (void);
-KLIB_EXTERN KWrtHandler* CC KLogLibHandlerGet (void);
-
-KLIB_EXTERN KWrtWriter CC KLogWriterGet (void);
-KLIB_EXTERN KWrtWriter CC KLogLibWriterGet (void);
-KLIB_EXTERN void* CC KLogDataGet (void);
-KLIB_EXTERN void* CC KLogLibDataGet (void);
-
-
-/* Handler
- *  sets output handler for standard output
- *
- *  "logger" [ IN ] and "self" [ IN, OPAQUE ] - callback function
- *  to handle log output
- */
-KLIB_EXTERN rc_t CC KLogHandlerSet    (KWrtWriter writer, void * data);
-KLIB_EXTERN rc_t CC KLogLibHandlerSet (KWrtWriter writer, void * data);
-
-KLIB_EXTERN rc_t CC KLogHandlerSetStdOut    (void);
-KLIB_EXTERN rc_t CC KLogLibHandlerSetStdOut (void);
-KLIB_EXTERN rc_t CC KLogHandlerSetStdErr    (void);
-KLIB_EXTERN rc_t CC KLogLibHandlerSetStdErr (void);
-
-/* formatting */
-
-typedef uint32_t KLogFmtFlags;
-enum
-{
-    klogFmtTimestamp = 0x00000001,
-    klogFmtSeverity = 0x00000002,
-    klogFmtPid = 0x00000004,
-    klogFmtAppName = 0x00000008,
-    klogFmtAppVersion = 0x00000010,
-    klogFmtMessage = 0x00000020, /* actual message  */
-    klogFmtReason = 0x00000040, /* full RC message */
-    klogFmtReasonShort = 0x00000080, /* object and state only */
-    klogFmtRC = 0x00000100, /* rc enum textual values */
-    klogFmtModule = 0x00000200, /* rc enum name for module */
-    klogFmtTarget = 0x00000400, /* rc enum name for target */
-    klogFmtContext = 0x00000800, /* rc enum name for context */
-    klogFmtObject = 0x00001000, /* rc enum name for object */
-    klogFmtState = 0x00002000, /* rc enum name for state */
-    klogFmtModuleText = 0x00004000, /* rc enum text for module */
-    klogFmtTargetText = 0x00008000, /* rc enum text for target */
-    klogFmtContextText = 0x00010000, /* rc enum text for context */
-    klogFmtObjectText = 0x00020000, /* rc enum text for object */
-    klogFmtStateText = 0x00040000, /* rc enum text for state */
-    klogFmtLocalTimestamp = 0x00080000 /* print time stamp in local time, if both bits set local takes over */
-};
-
-KLIB_EXTERN KFmtHandler* CC KLogFmtHandlerGet (void);
-KLIB_EXTERN KFmtHandler* CC KLogLibFmtHandlerGet (void);
-
-KLIB_EXTERN KLogFmtFlags CC KLogFmtFlagsGet ( void );
-KLIB_EXTERN KLogFmtFlags CC KLogLibFmtFlagsGet ( void );
-
-KLIB_EXTERN KFmtWriter CC KLogFmtWriterGet (void);
-KLIB_EXTERN KFmtWriter CC KLogLibFmtWriterGet (void);
-KLIB_EXTERN void* CC KLogFmtDataGet (void);
-KLIB_EXTERN void* CC KLogLibFmtDataGet (void);
-
-KLIB_EXTERN rc_t CC KLogFmtFlagsSet    (KLogFmtFlags flags);
-KLIB_EXTERN rc_t CC KLogLibFmtFlagsSet (KLogFmtFlags flags);
-
-KLIB_EXTERN rc_t CC KLogFmtHandlerSet    (KFmtWriter formatter, KLogFmtFlags flags, void* data);
-KLIB_EXTERN rc_t CC KLogLibFmtHandlerSet (KFmtWriter formatter, KLogFmtFlags flags, void* data);
-
-KLIB_EXTERN rc_t CC KLogFmtHandlerSetDefault(void);
-KLIB_EXTERN rc_t CC KLogLibFmtHandlerSetDefault(void);
-
-/*--------------------------------------------------------------------------
- * Log
- *  global logging
- *
- *  this logging API - like most others - attempts to remain isolated
- *  from any actual logging implementation, such that output may be
- *  routed in several ways.
- *
- *  the default handler
- *
- *  the path from unstructured text to formatted XML is difficult in that
- *  it requires parsing, and is therefore error prone.
- *
- *  the path from structured reports to XML as well as less or unstructured
- *  text is simple to implement, but generally more of a burden to use.
- *
- *  the challenge is therefore to present an API that makes structured
- *  logging less painful than it might be.
- */
-
-
-/* Init
- *  initialize the logging module with executable identity and version,
- *  plus logging level. actual behavior is determined by the logging
- *  implementation.
- *
- */
-KLIB_EXTERN rc_t CC KLogInit (void );
-
-/* LogMsg
- *  makes an entry to the log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "msg" [ IN ] - NUL terminated string
- */
-KLIB_EXTERN rc_t CC LogMsg ( KLogLevel lvl, const char *msg );
-KLIB_EXTERN rc_t CC LogLibMsg ( KLogLevel lvl, const char *msg );
-
-/* pLogMsg
- *  makes a parameterized entry to the log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "msg" [ IN ] - NUL terminated string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-KLIB_EXTERN rc_t CC pLogMsg ( KLogLevel lvl, const char *msg, const char *fmt, ... );
-KLIB_EXTERN rc_t CC vLogMsg ( KLogLevel lvl, const char *msg, const char *fmt, va_list args );
-KLIB_EXTERN rc_t CC pLogLibMsg ( KLogLevel lvl, const char *msg, const char *fmt, ... );
-KLIB_EXTERN rc_t CC vLogLibMsg ( KLogLevel lvl, const char *msg, const char *fmt, va_list args );
-
-
-/* LogErr
- *  reports an error to log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "rc" [ IN ] - return code to be decoded
- *
- *  "msg" [ IN, NULL OKAY ] - optional NUL terminated message string
- */
-KLIB_EXTERN rc_t CC LogErr ( KLogLevel lvl, rc_t rc, const char *msg );
-KLIB_EXTERN rc_t CC LogLibErr ( KLogLevel lvl, rc_t rc, const char *msg );
-
-
-/* pLogErr
- *  reports an error to log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "rc" [ IN ] - return code to be decoded
- *
- *  "msg" [ IN ] - NUL terminated message string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-KLIB_EXTERN rc_t CC pLogErr ( KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ... );
-KLIB_EXTERN rc_t CC vLogErr ( KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, va_list args );
-KLIB_EXTERN rc_t CC pLogLibErr ( KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ... );
-KLIB_EXTERN rc_t CC vLogLibErr ( KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, va_list args );
-
-/* conditional wrapper */
-#ifdef _LIBRARY
-
-/*
- * Usage:
- *  LOGMSG (logWarn, (logWarn, "Something happened"));
- *
- * But we can't HAVE a pony...
- */
-#define LOGMSG(lvl,msg)         \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? LogLibMsg (lvl, msg) : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   PLOGMSG (logWarn, (logWarn, "message with $(PARAM)", "PARAM=%s", "parameter"));
- */
-#define PLOGMSG(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? pLogLibMsg msg : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   VLOGMSG (logWarn, (logWarn, "message with $(PARAM)", "PARAM=%s", args));
- */
-#define VLOGMSG(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? vLogLibMsg msg : (rc_t)0)
-
-/*
- * Usage:
- *  LOGMSG (logWarn, rc, "Something wicked this way comes");
- */
-#define LOGERR(lvl,rc,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? LogLibErr (lvl,rc,msg) : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   PLOGERR (logWarn, (logWarn, rc, "message with $(PARAM)", "PARAM=%s", "parameter"));
- */
-#define PLOGERR(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? pLogLibErr msg : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   VLOGERR (logWarn, (logWarn, rc, "message with $(PARAM)", "PARAM=%s", args));
- */
-#define VLOGERR(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? vLogLibErr msg : (rc_t)0)
-
-#else
-
-/*
- * Usage:
- *  LOGMSG (logWarn, "Something happened");
- */
-#define LOGMSG(lvl,msg)         \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? LogMsg (lvl,msg) : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   PLOGMSG (logWarn, (logWarn, "message with $(PARAM)", "PARAM=%s", "parameter"));
- */
-#define PLOGMSG(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? pLogMsg msg : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   VLOGMSG (logWarn, (logWarn, "message with $(PARAM)", "PARAM=%s", args));
- */
-#define VLOGMSG(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? vLogMsg msg : (rc_t)0)
-
-/*
- * Usage:
- *  LOGMSG (logWarn, rc, "Something wicked this way comes");
- */
-#define LOGERR(lvl,rc,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? LogErr (lvl,rc,msg) : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   PLOGERR (logWarn, (logWarn, rc, "message with $(PARAM)", "PARAM=%s", "parameter"));
- */
-#define PLOGERR(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? pLogErr msg : (rc_t)0)
-
-/*
- * fmt is  two fmt strings plus parameters 
- * usage resembles
- *   VLOGERR (logWarn, (logWarn, rc, "message with $(PARAM)", "PARAM=%s", args));
- */
-#define VLOGERR(lvl,msg)        \
-    ((((unsigned)lvl) <= KLogLevelGet()) ? vLogErr msg : (rc_t)0)
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_log_ */
diff --git a/interfaces/klib/logfmt.h b/interfaces/klib/logfmt.h
deleted file mode 100644
index 619a3ec..0000000
--- a/interfaces/klib/logfmt.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_logfmt_
-#define _h_klib_logfmt_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define PLOG_NAME(name)   #name
-#define	PLOG_C(name)	  PLOG_NAME(name) "=%c"
-#define	PLOG_S(name)	  PLOG_NAME(name) "=%s"
-#define	PLOG_I8(name)	  PLOG_NAME(name) "=%hhd"
-#define	PLOG_U8(name)	  PLOG_NAME(name) "=%hhu"
-#define	PLOG_X8(name)	  PLOG_NAME(name) "=0x%2.2hhX"
-#define	PLOG_I16(name)	  PLOG_NAME(name) "=%hd"
-#define	PLOG_U16(name)	  PLOG_NAME(name) "=%hu"
-#define	PLOG_X16(name)	  PLOG_NAME(name) "=0x%4.4hX"
-#define	PLOG_I32(name)	  PLOG_NAME(name) "=%d"
-#define	PLOG_U32(name)	  PLOG_NAME(name) "=%u"
-#define	PLOG_X32(name)	  PLOG_NAME(name) "=0x%8.8X"
-#define	PLOG_I64(name)	  PLOG_NAME(name) "=%ld"
-#define	PLOG_U64(name)	  PLOG_NAME(name) "=%lu"
-#define	PLOG_X64(name)	  PLOG_NAME(name) "=0x%16.16lX"
-#define	PLOG_PDIFF(name)  PLOG_NAME(name) "=%zd"
-#define	PLOG_SIZE(name)	  PLOG_NAME(name) "=0x%zu"
-#define PLOG_P(name)      PLOG_NAME(name) "=%p"
-/* use the above to fill in the below */
-#define PLOG_2(a,b)		    a "," b
-#define PLOG_3(a,b,c)		a "," b "," c
-#define PLOG_4(a,b,c,d)		a "," b "," c "," d
-#define PLOG_5(a,b,c,d,e)	a "," b "," c "," d "," e
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_logfmt_ */
diff --git a/interfaces/klib/namelist.h b/interfaces/klib/namelist.h
deleted file mode 100644
index 319bb26..0000000
--- a/interfaces/klib/namelist.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_namelist_
-#define _h_klib_namelist_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- *  a generic list of NUL-terminated name strings
- */
-typedef struct KNamelist KNamelist;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KLIB_EXTERN rc_t CC KNamelistAddRef ( const KNamelist *self );
-KLIB_EXTERN rc_t CC KNamelistRelease ( const KNamelist *self );
-
-/* Count
- *  returns the number of entries
- *
- *  "count" [ OUT ] - return parameter for entry count
- */
-KLIB_EXTERN rc_t CC KNamelistCount ( const KNamelist *self, uint32_t *count );
-
-/* Get
- *  get an indexed name
- *
- *  "idx" [ IN ] - a zero-based name index
- *
- *  "name" [ OUT ] - return parameter for NUL terminated name
- */
-KLIB_EXTERN rc_t CC KNamelistGet ( const KNamelist *self,
-    uint32_t idx, const char **name );
-
-
-/*--------------------------------------------------------------------------
- * VNamelist
- *  generic Vector namelist implementation
- */
-typedef struct VNamelist VNamelist;
-
-/* Make
- *  make an empty namelist
- *
- *  "names" [ OUT ] - return parameter for namelist object
- *
- *  "alloc_blocksize" [ IN ] - selects the number of names in
- *  a vector block; used for allocating and extending
- */
-KLIB_EXTERN rc_t CC VNamelistMake ( VNamelist **names, const uint32_t alloc_blocksize );
-
-/* Release
- *  ignores NULL references
- */
-KLIB_EXTERN rc_t CC VNamelistRelease ( const VNamelist *self );
-
-/* ToNamelist
- *  cast operator
- *
- *  "cast" [ OUT ] - return parameter for new KNamelist reference
- *  must be released by KNamelistRelease
- */
-KLIB_EXTERN rc_t CC VNamelistToNamelist ( VNamelist *self, KNamelist **cast );
-KLIB_EXTERN rc_t CC VNamelistToConstNamelist ( const VNamelist *self, const KNamelist **cast );
-
-
-/* Append
- *  appends a copy of string to the VNamelist
- *
- *  "src" [ IN ] - NUL terminated name string / String-struct ... to be copied
- *  and appended.
- */
-KLIB_EXTERN rc_t CC VNamelistAppend ( VNamelist *self, const char* src );
-KLIB_EXTERN rc_t CC VNamelistAppendString ( VNamelist *self, const String * src );
-
-/* Remove
- *  removes a string from the namelist
- *
- *  "s" [ IN ] - NUL terminated name string to be removed
- */
-KLIB_EXTERN rc_t CC VNamelistRemove( VNamelist *self, const char* s );
-
-/* IndexOf
- *  searches linear in the namelist for the string
- *
- *  "s" [ IN ] - NUL terminated name string to be searched for
- *
- *  "found" [ OUT ] - index of the string if found
- *  unchanged if not found
- */
-KLIB_EXTERN rc_t CC VNamelistIndexOf( VNamelist *self, const char* s, uint32_t *found );
-
-/* Count
- *  returns the number of entries
- *
- *  "count" [ OUT ] - return parameter for entry count
- */
-KLIB_EXTERN rc_t CC VNameListCount ( const VNamelist *self, uint32_t *count );
-
-/* Get
- *  get an indexed name
- *
- *  "idx" [ IN ] - a zero-based name index
- *
- *  "name" [ OUT ] - return parameter for NUL terminated name
- */
-KLIB_EXTERN rc_t CC VNameListGet ( const VNamelist *self, uint32_t idx, const char **name );
-
-
-/* Reorder
- *  sort the names according to case sensitivity
- *  and UNICODE character code ordering
- *
- *  "case_insensitive" [ IN ] - when true, perform "tolower" on
- *   each character before compare
- */
-KLIB_EXTERN void CC VNamelistReorder ( VNamelist *self, bool case_insensitive );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_namelist_ */
diff --git a/interfaces/klib/namelist.hpp b/interfaces/klib/namelist.hpp
deleted file mode 100644
index 58c7d6a..0000000
--- a/interfaces/klib/namelist.hpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_klib_namelist_
-#define _hpp_klib_namelist_
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- *  a generic list of NUL-terminated name strings
- */
-struct KNamelist
-{
-    /* AddRef
-     * Release
-     *  ignores NULL references
-     */
-    inline int AddRef () const throw()
-    { return KNamelistAddRef ( this ); }
-    inline int Release () const throw()
-    { return KNamelistRelease ( this ); }
-
-    /* Count
-     *  returns the number of entries
-     *
-     *  "count" [ OUT ] - return parameter for entry count
-     */
-    rc_t Count ( uint32_t *count ) const throw()
-    { return KNamelistCount ( this, count ); }
-
-    /* Get
-     *  get an indexed name
-     *
-     *  "idx" [ IN ] - a zero-based name index
-     *
-     *  "name" [ OUT ] - return parameter for NUL terminated name
-     */
-    rc_t Get ( uint32_t idx, const char **name ) const throw()
-    { return KNamelistGet ( this, idx, name ); }
-
-private:
-    KNamelist ();
-    ~ KNamelist ();
-    KNamelist ( const KNamelist& );
-    KNamelist &operator = ( const KNamelist& );
-};
-
-
-/*--------------------------------------------------------------------------
- * VNamelist
- *  a vector-based list of NUL-terminated name strings
- */
-struct VNamelist
-{
-
-    inline static rc_t Make ( VNamelist **namelist, const uint32_t alloc_blocksize ) throw ()
-    { return VNamelistMake ( namelist, alloc_blocksize ); }
-
-    /* AddRef
-     * Release
-     *  ignores NULL references
-     */
-    inline int AddRef () const throw()
-    { return KNamelistAddRef ( ( const KNamelist * )this ); }
-    inline int Release () const throw()
-    { return VNamelistRelease ( this ); }
-
-    /* Count
-     *  returns the number of entries
-     *
-     *  "count" [ OUT ] - return parameter for entry count
-     */
-    rc_t Count ( uint32_t *count ) const throw()
-    { return KNamelistCount ( ( const KNamelist * )this, count ); }
-
-    /* Get
-     *  get an indexed name
-     *
-     *  "idx" [ IN ] - a zero-based name index
-     *
-     *  "name" [ OUT ] - return parameter for NUL terminated name
-     */
-    rc_t Get ( uint32_t idx, const char **name ) const throw()
-    { return KNamelistGet ( ( const KNamelist * )this, idx, name ); }
-    
-    /* Append
-     *  append a string...
-     *
-     *  "src" [ IN ] - the string to append
-     */
-    rc_t Append ( const char *src ) throw()
-    { return VNamelistAppend ( this, src ); }
-
-
-private:
-    VNamelist ();
-    ~ VNamelist ();
-    VNamelist ( const VNamelist& );
-    VNamelist &operator = ( const VNamelist& );
-};
-
- 
-#endif // _hpp_klib_namelist_
diff --git a/interfaces/klib/out.h b/interfaces/klib/out.h
deleted file mode 100644
index 02aa06f..0000000
--- a/interfaces/klib/out.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_out_
-#define _h_klib_out_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_writer_
-#include <klib/writer.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* -----
- * Handlers for application and library writers.
- */
-
-KLIB_EXTERN KWrtHandler* CC KOutHandlerGet (void);
-
-/* Handler
- *  sets output handler for standard output
- *
- *  "logger" [ IN ] and "self" [ IN, OPAQUE ] - callback function
- *  to handle log output
- */
-KLIB_EXTERN rc_t CC KOutHandlerSet          (KWrtWriter writer, void * data);
-KLIB_EXTERN rc_t CC KOutHandlerSetStdOut    (void);
-KLIB_EXTERN rc_t CC KOutHandlerSetStdErr    (void);
-
-KLIB_EXTERN KWrtWriter CC KOutWriterGet (void);
-KLIB_EXTERN void * CC KOutDataGet (void);
-
-KLIB_EXTERN rc_t CC KOutInit (void);
-
-KLIB_EXTERN rc_t CC KOutMsg (const char * fmt, ...);
-
-#define KOutStr(str) KOutMsg("%s",str)
-
-/*
- * A usage could look like
- *
- * OUTMSG (kout_2, "Current Out Level is %d\n", OutLevelGet());
- *
- */
-#define OUTMSG(msg) \
-    ((KOutWriterGet() != NULL) ? KOutMsg msg : 0)
-
-#define OUTSTR(msg) \
-    ((KOutWriterGet() != NULL) ? KOutStr (msg) : 0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_out_ */
diff --git a/interfaces/klib/pack.h b/interfaces/klib/pack.h
deleted file mode 100644
index fc28ef7..0000000
--- a/interfaces/klib/pack.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_pack_
-#define _h_klib_pack_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * bit-packing operations
- *  packed bits have leading zeros eliminated
- *  unpacked bits have no more information, but may occupy more storage
- *
- *  packed bits are stored in big-endian byte order and big-bit-endian
- *  bit order. unpacked bits are in architecture native order.
- *
- *  little-endian architectures place the least significant information
- *  in the left-most addresses. Intel architecture still has bit ordering
- *  with LSB to the right. the only way to view byte and bit order as
- *  coherent in this architecture is in 2 dimensions, such that bit ordering
- *  within a byte is along one dimension and the bytes are another.
- *
- *  viewing a stream of bits is by definition uni-dimensional, and thus
- *  this code treats bit streams in big-bit-endian order, with the most
- *  significant bit of the most significant byte to the left, and each
- *  bit to the right has decreasing significance.
- *
- *  packed bits are left-aligned, such that an 8=>2 packing of the bytes
- *  [ 1, 2, 3 ] will yield a single byte of 0b01101100 ( 0x6C ).
- *
- *  a pack or unpack operation with identical bit sizes ( e.g. 16=>16 )
- *  will act like a memcpy on big-endian architectures and a byte-swap
- *  on little-endian architectures.
- */
-
-
-/* Pack
- *  accepts a series of unpacked source bits
- *  produces a series of packed destination bits by eliminating MSB
- *
- *  "unpacked" [ IN ] - original element size in bits
- *  must be in 2^^[3..6], i.e. { 8, 16, 32, 64 }
- *
- *  "packed" [ IN ] - packed element size in bits
- *  must be <= "unpacked"
- *
- *  "src" [ IN ] and "ssize" [ IN ] - source buffer
- *  with size given in bytes
- *
- *  "consumed" [ OUT, NULL OKAY ] - number of source bytes
- *  consumed. if NULL, then all source bytes MUST be consumed
- *  or an error will be generated.
- *
- *  "dst" [ OUT ] and "dst_off" [ IN ] - destination
- *  buffer bit address
- *
- *  "dsize" [ IN ] - size of "dst" in bits, not including "dst_off"
- *
- *  "psize" [ OUT ] - resultant packed size in bits
- *
- * NB - the implementation may allow packing in place
- */
-KLIB_EXTERN rc_t CC Pack ( uint32_t unpacked, uint32_t packed,
-    const void *src, size_t ssize, size_t *consumed,
-    void *dst, bitsz_t dst_off, bitsz_t dsize, bitsz_t *psize );
-
-
-/* Unpack
- *  accepts a series of packed source bits
- *  produces a series of unpacked destination bits by left-padding zeros
- *
- *  "packed" [ IN ] - packed element size in bits
- *
- *  "unpacked [ IN ] - original element size in bits
- *  must be >= "packed" and
- *  must be in 2^^[3..6], i.e. { 8, 16, 32, 64 }
- *
- *  "src" [ IN ] and "src_off" [ IN ] - source buffer
- *  bit address
- *
- *  "ssize" [ IN ] - number of bits in "src", not including "src_off"
- *
- *  "consumed" [ OUT, NULL OKAY ] - number of source bits
- *  consumed. if NULL, then all source bits MUST be consumed
- *  or an error will be generated.
- *
- *  "dst" [ OUT ] and "dsize" [ IN ] - destination buffer
- *  where size is given in bytes
- *
- *  "usize" [ OUT ] - resultant unpacked size in bytes
- *
- * NB - "src" and "dst" may have same address since
- *  the implementation unpacks from right to left, smaller to larger
- */
-KLIB_EXTERN rc_t CC Unpack ( uint32_t packed, uint32_t unpacked,
-    const void *src, bitsz_t src_off, bitsz_t ssize, bitsz_t *consumed,
-    void *dst, size_t dsize, size_t *usize );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_pack_ */
diff --git a/interfaces/klib/pbstree.h b/interfaces/klib/pbstree.h
deleted file mode 100644
index 3d69bbb..0000000
--- a/interfaces/klib/pbstree.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_pbstree_
-#define _h_klib_pbstree_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTree;
-
-
-/*--------------------------------------------------------------------------
- * PBSTNode
- *  identifies a node within persisted binary search tree
- *
- *  a BSTree will contain BSTNodes, which themselves are intrusive but
- *  irrelevant internal tree links plus an externally defined data
- *  structure, having both key and value, and supporting multiple
- *  keys per node. the internal links permit navigation from node
- *  to node that is not possible with the PBSTNode.
- *
- *  a PBSTree does not contain structured nodes, but stores linkage
- *  and ordering information separately from the externally defined
- *  data, and rather than using pointers, assigns integer ids to the
- *  nodes themselves. navigation by pointers would require allocations,
- *  which are unnecessary and expensive when traversing a read-only
- *  persisted image. navigation is therefore intrusive on an externally
- *  allocated node structure.
- */
-typedef struct PBSTNode PBSTNode;
-struct PBSTNode
-{
-    struct
-    {
-        const void *addr;
-        size_t size;
-
-    } data;
-
-    const void *internal;
-    uint32_t id;
-};
-
-/* PBSTNodeNext
- *  updates the structure
- *  returns next 1-based node id or 0 for NULL
- */
-KLIB_EXTERN uint32_t CC PBSTNodeNext ( PBSTNode *self );
-
-/* PBSTNodePrev
- *  updates the structure
- *  returns prev 1-based node id or 0 for NULL
- */
-KLIB_EXTERN uint32_t CC PBSTNodePrev ( PBSTNode *self );
-
-/* PBSTNodeFindNext
- *  find next element satisfying criteria
- *  fills out "n" if found
- *  returns 1-based node id or 0 for NULL
- */
-KLIB_EXTERN uint32_t CC PBSTNodeFindNext ( PBSTNode *self,
-     bool ( CC * f ) ( const PBSTNode *n ) );
-
-/* PBSTNodeFindPrev
- *  find previous element satisfying criteria
- *  fills out "n" if found
- *  returns 1-based node id or 0 for NULL
- */
-KLIB_EXTERN uint32_t CC PBSTNodeFindPrev ( PBSTNode *self,
-    bool ( CC * f ) ( const PBSTNode *n ) );
-
-
-/*--------------------------------------------------------------------------
- * PBSTree
- *  a flattened binary search tree
- *
- *  mimics read-only behavior of a BSTree
- */
-typedef struct PBSTree PBSTree;
-
-/* PBSTreeMake
- *  make a PBSTree structure
- *
- *  "mem" [ IN ] - constant memory image of persisted tree
- *  with a lifetime exceeding that of the PBSTree itself
- *
- *  "byteswap" [ IN ] - if true, the persisted image needs
- *  to be read with byteswapping
- */
-KLIB_EXTERN rc_t CC PBSTreeMake ( PBSTree **pt, const void *addr, size_t size, bool byteswap );
-
-/* PBSTreeCount
- *  returns number of elements in tree
- *  not included within the BSTree interface itself, but
- *  was included here due to the fact that it is constant
- *
- *  return value:
- *    integer value >= 0
- */
-KLIB_EXTERN uint32_t CC PBSTreeCount ( const PBSTree *self );
-
-/* PBSTreeDepth
- *  returns number of layers in tree
- *
- *  return value:
- *    integer value >= 0
- */
-KLIB_EXTERN uint32_t CC PBSTreeDepth ( const PBSTree *self );
-
-/* PBSTreeSize
- *  returns the size in bytes
- *  of the PBSTree image
- */
-KLIB_EXTERN size_t CC PBSTreeSize ( const PBSTree *self );
-
-/* PBSTreeGetNode
- *  gets a PBSTNode from an id
- *
- *  "node" [ OUT ] - return parameter for node
- *
- *  "id" [ IN ] - a 1-based integer node id
- *
- *  return values:
- *    EINVAL => an invalid parameter was passed
- *    ENOENT => id out of range
- */
-KLIB_EXTERN rc_t CC PBSTreeGetNode ( const PBSTree *self, PBSTNode *node, uint32_t id );
-
-/* PBSTreeFind
- *  find an object within tree
- *
- *  "rtn" [ OUT ] - return parameter for node if found. its value
- *  is undefined unless the function returns success.
- *
- *  "item" [ IN ] - item to be matched against a node. will be
- *  supplied as the first parameter to the comparison function.
- *
- *  "cmp" [ IN ] - function that evaluates "item" against each internal
- *  node for relative position, returning 0 for match, negative when
- *  "item" is to left of node, and positive otherwise.
- *
- *  return value:
- *    0    => not found
- *    1..n => internal id of node, also recorded within "rtn"
- */
-KLIB_EXTERN uint32_t CC PBSTreeFind ( const PBSTree *self, PBSTNode *rtn,
-    const void *item, int ( CC * cmp ) ( const void *item, const PBSTNode *n , void * data), void * data );
-
-/* PBSTreeForEach
- *  executes a function on each tree element
- *
- *  "reverse" [ IN ] - if true, traverse from last to first element,
- *  if false, traverse in the normal forward direction.
- *
- *  "f" [ IN ] and "data" [ IN ] - callback function for evaluating each
- *  node within the tree. the passed out node structure is itself fully
- *  modifiable.
- */
-KLIB_EXTERN void CC PBSTreeForEach ( const PBSTree *self, bool reverse,
-    void ( CC * f ) ( PBSTNode *n, void *data ), void *data );
-
-/* PBSTreeDoUntil
- *  executes a function on each element
- *  until the function returns true
- *
- *  "reverse" [ IN ] - if true, traverse from last to first element,
- *  if false, traverse in the normal forward direction.
- *
- *  "f" [ IN ] and "data" [ IN ] - callback function for evaluating each
- *  node within the tree. the passed out node structure is itself fully
- *  modifiable. the function returns "true" to halt iteration.
- *
- *  return values:
- *    the last value returned by "f" or false if never invoked
- */
-KLIB_EXTERN bool CC PBSTreeDoUntil ( const PBSTree *self, bool reverse,
-    bool ( CC * f ) ( PBSTNode *n, void *data ), void *data );
-
-/* PBSTreeWhack
- *  whacks PBSTree object
- *  the constant memory image used to create the PBSTree may now be released
- */
-KLIB_EXTERN void CC PBSTreeWhack ( PBSTree *self );
-
-
-
-/*--------------------------------------------------------------------------
- * persistence functions
- */
-
-/* PTWriteFunc
- *  a generic streaming function
- */
-typedef rc_t ( CC * PTWriteFunc )
-    ( void *param, const void *buffer, size_t bytes, size_t *num_writ );
-
-/* PTAuxFunc
- *  a function to measure or write auxiliary node data
- *  where "node" is a BSTNode or TTNode.
- *
- *  when "write" is NULL, the number of bytes that would
- *  be written is returned in "num_writ".
- */
-typedef rc_t ( CC * PTAuxFunc )
-    ( void *param, const void *node, size_t *num_writ,
-      PTWriteFunc write, void *write_param );
-
-
-/*--------------------------------------------------------------------------
- * BSTree
- */
-
-/* BSTreePersist
- *  write a binary search tree to some storage location
- *
- *  the tree is persisted by making between one and three passes
- *  over its nodes, see description of "write" parameter.
- *
- *  the first pass examines internal tree structure and invokes
- *  a user-supplied function to determine overall size.
- *
- *  the second pass persists the internal structure in a packed
- *  format, using the user-supplied generic "write" function.
- *
- *  the third pass invokes another user-supplied function to write
- *  auxiliary node data to output.
- *
- *  "num_writ" [ OUT, NULL OKAY ] -  returns parameter for the number
- *  of bytes written as a result of persisting the tree. this will
- *  be the actual bytes written regardless of return status.
- *
- *  "write" [ IN, NULL OKAY ]  and "write_param" [ IN ] -  a generic
- *  output streaming function used for all operations. if NULL, then
- *  the function will exit after its first pass with the number of
- *  bytes required in "num_writ".
- *
- *  "aux" [ IN ] and "aux_param" [ IN ] - a specialized function for
- *  streaming auxiliary node data to output using the supplied "write"
- *  function. it is invoked during the first pass with a NULL write
- *  function for gathering size data, and during the third pass with
- *  a non-NULL write function.
- */
-KLIB_EXTERN rc_t CC BSTreePersist ( struct BSTree const *self, size_t *num_writ,
-    PTWriteFunc write, void *write_param, PTAuxFunc aux, void *aux_param );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_pbstree_ */
diff --git a/interfaces/klib/printf.h b/interfaces/klib/printf.h
deleted file mode 100644
index e56ed15..0000000
--- a/interfaces/klib/printf.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_printf_
-#define _h_klib_printf_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-struct KSymbol;
-struct KDataBuffer;
-struct KWrtHandler;
-
-
-/*--------------------------------------------------------------------------
- * FORMAT
- *  a description of the string_printf formatting
- */
-
-#define SUPPORT_PERCENT_N 1
-
-
-/*
-  The standard C library formatting approach was taken as a basis.
-
-  This interface differs in some ways, in that it presents a sub-set of
-  the std. C format convention, and then extends it for klib.
-
-  The general substitution parameter format is:
-
-    '%' [ <flags> ] [ <field-width> ] [ '.' <precision> ] [ ':' <index> ] \
-        [ <storage-class-width> ] <storage-class>
-
-  where:
-
-    flags
-        = ' '           : prepend space to a numeral if it does not have a sign
-        | '+'           : always produce a sign on numeric conversion
-        | '-'           : left-align parameter within field
-        | '0'           : left-pad with zeros rather than spaces
-        | '#'           : use "alternate" representation
-        | ','           : produce comma-separated triples
-        | '\''          :  "      "
-        ;
-
-    field-width *(1)
-        = DECIMAL       : an unsigned base-10 numeral
-        | '*'           : take field width from args as type 'uint32_t'
-        ;
-
-    precision *(1)(2)(3)
-        = DECIMAL       : an unsigned base-10 numeral
-        | '*'           : take precision from args as type 'uint32_t'
-        |               : an empty precision means 0
-        ;
-
-    index
-        = idx           : a single, zero-based vector element
-        | idx '-' idx   : a fully-closed, zero-based interval
-        | idx '/' len   : a start index plus length
-        ;
-
-    idx
-        = DECIMAL       : an unsigned base-10 numeral
-        | '*'           : take index from args as type 'uint32_t'
-        | '$'           : last vector element
-        |               : an empty index means 0 or $
-        ;
-
-    len
-        = DECIMAL       : a base-10 numeral
-        | '*'           : take length from args as type 'uint32_t'
-        | '$'           : length-of ( vector )
-        |               : an empty length means $
-        ;
-
-    storage-class-width
-        = 't'           : tiny integer ( i.e. byte )
-        | 'h'           : half the normal size
-        | 'l'           : twice the normal size
-        | 'z'           : sizeof size_t
-        | time-modifier
-        ;
-
-    time-modifier
-        = 'h'           : date only
-        | 'l'           : date and time
-        | 'z'           : date, time and zone
-        ;
-
-    scalar storage-class
-        = 'd' | 'i'     : decimal signed integer
-        | 'u'           : decimal unsigned integer
-        | 'x'           : lower-case hex integer
-        | 'X'           : upper-case hex integer
-        | 'o'           : octal integer
-        | 'b'           : binary integer
-        | 'p'           : hex void*
-        | 'f'           : double
-        | 'e'           : scientific notation double
-        | 'g'           : general double
-        | 'c'           : UTF-32 character
-        | 'N'           : const KSymbol* [ <klib/symbol.h> ]
-        | 'V' *(2)      : tri-part version [ ver_t ]
-        | 'R'           : return code [ rc_t ]
-        | 'T'           : const KTime*  [ <klib/time.h> ]
-        | '!'           ; operating specific error code ( i.e. errno or GetLastError() )
-        | 'n' *(5)      ; output of number of characters printed so far to uint32_t*
-        ;
-
-    single-index vector storage-class *(6)(7)
-        = 'd' | 'i'     : as above
-        | 'u' | 'x'     : index range is ignored
-        | 'X' | 'o'     : start index is used
-        | 'b' | 'p'     : to select element
-        | 'f' | 'e' | 'g'
-        | 'N'           : const KSymbol* [ <klib/symbol.h> ]
-        | 'V' *(2)      : tri-part version [ ver_t ]
-        | 'R'           : return code [ rc_t ]
-        | 'T'           : const KTime*  [ <klib/time.h> ]
-        ;
-
-    index-range vector storage-class *(8)
-        = 'c' *(9)      : unbounded character vector
-        | 's' | 'S'     : bounded character vector
-        ;
-
-  Notes:
-     1. field-width and precision measure characters, not bytes
-     2. for version numbers, precision gives the number of fields,
-        where 1 = major, 2 = major.minor and 3 = major.minor.release.
-     3. in the absence of precision, versions are written with the
-        minimum number of fields required.
-     4. the storage-class-width is interpreted differently for storage-class
-        'T' ( const KTime* )
-     5. %n may not be supported for security purposes
-     6. when an index is specified, the argument is taken as an
-        unbounded vector. if an index range is given, only the
-        starting index is used, and only a single element is selected.
-     7. the vector reference class is determined by both the format
-        and the size modifier.
-     8. an index for character classes may specify a string as the
-        selection. when missing, the default start index is 0 while
-        the default end index is $.
-     9. a character vector is NOT assumed to be NUL-terminated,
-        and in this case the default end index is the start index.
-
- */
-
-
-/* string_printf
- *  provides a facility similar to snprintf
- *  formatting is similar but differs somewhat [ see FORMAT at bottom ]
- *
- *  "dst" [ OUT ] and "bsize" [ IN ] - output buffer for string
- *  will be NUL-terminated if possible
- *
- *  "num_writ" [ OUT, NULL OKAY ] - returns the number of non-NUL bytes
- *  written to "dst" or the required "bsize" to complete successfully,
- *  not including the NUL termination.
- *
- *  "fmt" [ IN ] and "args" [ IN, OPTIONAL ] - data to write
- *
- *  returns 0 if all bytes were successfully written and a NUL-byte was
- *  written into the buffer.
- *
- *  returns rcBuffer, rcInsufficient if the buffer was too small. in this
- *  case, it is possible that the only missing byte would be the NUL
- *  termination, and the output string may still be usable since "num_writ"
- *  indicates the actual number of text bytes.
- */
-KLIB_EXTERN rc_t CC string_printf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, ... );
-KLIB_EXTERN rc_t CC string_vprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, va_list args );
-
-
-/* KDataBufferPrintf
- *  provides a facility similar to string_printf
- *  except that it appends into a KDataBuffer
- *
- *  "buf" [ IN ] - previously initialized buffer
- *  MUST be initialized, or results are unpredictable
- *  ( except for the prediction that all will fail )
- */
-KLIB_EXTERN rc_t CC KDataBufferPrintf ( struct KDataBuffer * buf,
-    const char * fmt, ... );
-KLIB_EXTERN rc_t CC KDataBufferVPrintf ( struct KDataBuffer * buf,
-    const char * fmt, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * structured_printf
- *  the engine behind string_printf
- */
-
-/* formatting
- */
-enum
-{
-    spfNone,                                    /* 'n', sptTerm                       */
-    spfText,                                    /* 'csS', literal                     */
-    spfSignedInt,                               /* 'di'                               */
-    spfUnsigned,                                /* 'bouxX'                            */
-    spfStdFloat,                                /* 'f'                                */
-    spfGenFloat,                                /* 'g'                                */
-    spfSciFloat,                                /* 'e'                                */
-    spfVersion,                                 /* 'V'                                */
-    spfSymbol,                                  /* 'N'                                */
-    spfTime,                                    /* [ 'hlz' + ] 'T'                    */
-    spfRC,                                      /* 'R'                                */
-    spfOSErr                                    /* '!'                                */
-};
-
-/* types
- */
-enum
-{
-    sptTerm,                                    /* terminates format                  */
-    sptLiteral,                                 /* char literal        - arg in fmt   */
-    sptSignedInt,                               /* signed scalar int   - arg is d     */
-    sptSignedInt8Vect,                          /* signed vector int   - arg is d8    */
-    sptSignedInt16Vect,                         /* signed vector int   - arg is d16   */
-    sptSignedInt32Vect,                         /* signed vector int   - arg is d32   */
-    sptSignedInt64Vect,                         /* signed vector int   - arg is d64   */
-    sptUnsignedInt,                             /* unsigned scalar int - arg is u     */
-    sptUnsignedInt8Vect,                        /* unsigned vector int - arg is u8    */
-    sptUnsignedInt16Vect,                       /* unsigned vector int - arg is u16   */
-    sptUnsignedInt32Vect,                       /* unsigned vector int - arg is u32   */
-    sptUnsignedInt64Vect,                       /* unsigned vector int - arg is u64   */
-    sptFloat,                                   /* scalar float        - arg is f     */
-    sptFloat32Vect,                             /* vector float        - arg is f32   */
-    sptFloat64Vect,                             /* vector float        - arg is f64   */
-    sptFloatLongVect,                           /* vector float        - arg is flong */
-    sptChar,                                    /* scalar character    - arg is c     */
-    sptNulTermString,                           /* vector character    - arg is s     */
-    sptString,                                  /* vector character    - arg is S     */
-    sptUCS2String,                              /* vector character    - arg is S     */
-    sptUTF32String,                             /* vector character    - arg is S     */
-    sptPointer,                                 /* object reference    - arg is p     */
-    sptRowId,                                   /* current row id      - arg is d     */
-    sptRowLen                                   /* current row length  - arg is u     */
-#if SUPPORT_PERCENT_N
-    , sptBytesPrinted                           /* output parameter    - arg is n     */
-#endif
-};
-
-
-/* format
- *  structured and constant format information
- *  takes the place of format string
- *  flags indicate whether fields are active
- *  and in some cases whether the value is external, in the next arg
- */
-typedef struct PrintFmt PrintFmt;
-struct PrintFmt
-{
-    union
-    {
-        struct
-        {
-            uint64_t min_field_width;           /* minimum field width in characters  */
-            uint64_t precision;                 /* precision in characters            */
-            uint64_t start_idx;                 /* zero-based starting vector index   */
-            uint64_t select_len;                /* length of selection or 0 for inf   */
-        } f;
-        struct
-        {
-            const char *text;                   /* string literal text pointer        */
-            size_t size;                        /* string literal text size           */
-        } l;
-    } u;
-    unsigned int upper_case_num       : 1;      /* upper-case numerals                */
-    unsigned int reverse_alnum        : 1;      /* reverse ordering of alpha-numeric  */
-    unsigned int thousands_separate   : 1;      /* separate numerals by thousands     */
-    unsigned int ext_field_width      : 1;      /* field width is external argument   */
-    unsigned int ext_precision        : 1;      /* precision is external argument     */
-    unsigned int inf_start_index      : 1;      /* start index is last in vector      */
-    unsigned int ext_start_index      : 1;      /* start index is external argument   */
-    unsigned int inf_stop_index       : 1;      /* stop index is last in vector       */
-    unsigned int ext_stop_index       : 1;      /* stop index is an external argument */
-    unsigned int ext_select_len       : 1;      /* selection length is external       */
-    unsigned int add_prefix           : 1;      /* '#' flag on 'boxX'                 */
-    unsigned int force_decimal_point  : 1;      /* '#' flag on 'efg'                  */
-    unsigned int leave_trailing_zeros : 1;      /* '#' flag on 'g'                    */
-    unsigned int print_time           : 1;
-    unsigned int print_date           : 1;
-    unsigned int print_weekday        : 1;
-    unsigned int print_timezone       : 1;
-    unsigned int hour_24              : 1;
-    unsigned int min_vers_components  : 1;
-    unsigned int explain_rc           : 1;
-    unsigned int type_cast            : 1;      /* if true, convert type for fmt      */
-    unsigned int pointer_arg          : 1;      /* argument is a pointer              */
-    uint32_t radix;                             /* 0 default, 2, 8, 10, 16, .. 36     */
-    uint8_t fmt;                                /* spf... from above                  */
-    uint8_t type;                               /* spt... from above                  */
-    char sign;                                  /* 0, ' ' or '+'                      */
-    char left_fill;                             /* 0 for left-align, ' ' or '0'       */
-};
-
-
-/* argument
- *  union of argument values
- *  passed as an array, much like va_arg
- */
-typedef union PrintArg PrintArg;
-union PrintArg
-{
-    int64_t d;                                  /* signed integer scalar              */
-    const int8_t *d8;                           /* signed integer vectors             */
-    const int16_t *d16;
-    const int32_t *d32;
-    const int64_t *d64;
-
-    uint64_t u;                                 /* unsigned integer scalar            */
-    const uint8_t *u8;                          /* unsigned integer vectors           */
-    const uint16_t *u16;
-    const uint32_t *u32;
-    const uint64_t *u64;
-
-    double f;                                   /* floating point scalar              */
-    const float *f32;                           /* floating point vectors             */
-    const double *f64;
-    const long double *flong;
-
-    uint32_t c;                                 /* character scalar                   */
-    const char *s;                              /* NUL-terminated char vector         */
-    struct String const *S;                     /* character vector                   */
-
-    const void *p;                              /* object reference                   */
-
-#if SUPPORT_PERCENT_N
-    uint32_t *n;                                /* output parameter                   */
-#endif
-};
-
-
-/* structured_printf
- *  uses constant format descriptors and argument block
- *  prints to "out" handler
- */
-KLIB_EXTERN rc_t CC structured_printf ( struct KWrtHandler const *out,
-    size_t *num_writ, const PrintFmt *fmt, const PrintArg *args );
-
-
-/* structured_sprintf
- *  uses constant format descriptors and argument block
- *  prints to UTF-8 character buffer "dst"
- */
-KLIB_EXTERN rc_t CC structured_sprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const PrintFmt *fmt, const PrintArg *args );
-
-
-/* TEMPORARY */
-KLIB_EXTERN rc_t CC new_string_printf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, ... );
-KLIB_EXTERN rc_t CC new_string_vprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_printf_ */
diff --git a/interfaces/klib/ptrie.h b/interfaces/klib/ptrie.h
deleted file mode 100644
index d19e29f..0000000
--- a/interfaces/klib/ptrie.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_ptrie_
-#define _h_klib_ptrie_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_pbstree_
-#include <klib/pbstree.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct Trie;
-struct String;
-
-
-/*--------------------------------------------------------------------------
- * PTNode
- *  a node within text tree
- *
- *  a Trie will contain TNodes, which themselves are intrusive but
- *  irrelevant internal tree links plus a key string plus an externally
- *  defined data structure, representing a value, and supporting multiple
- *  nodes per key. the internal links permit navigation from node
- *  to node that is not possible with the PTNode. furthermore, they
- *  provide direct access to the key string that is not normally stored
- *  verbatim within a persisted image.
- *
- *  a PTrie does not contain structured nodes, but stores linkage
- *  and ordering information separately from the externally defined
- *  data, and rather than using pointers, assigns integer ids to the
- *  nodes themselves. navigation by pointers would require allocations,
- *  which are unnecessary and expensive when traversing a read-only
- *  persisted image. navigation is therefore intrusive on an externally
- *  allocated node structure.
- */
-typedef struct PTNode PTNode;
-struct PTNode
-{
-    /* minimally value data
-       may also contain key string information,
-       either by reference or literal text */
-    struct
-    {
-        const void *addr;
-        size_t size;
-
-    } data;
-
-    /* used internally */
-    const void *internal;
-    uint32_t id;
-};
-
-/* MakeKey
- *  tries to make a key string from node
- *  will fail if key text was not embedded into image when created
- *
- *  "key" [ OUT ] - return parameter for a key string allocation
- *  that must be whacked with StringWhack when no longer needed.
- */
-KLIB_EXTERN rc_t CC PTNodeMakeKey ( const PTNode *self, struct String const **key );
-
-
-/*--------------------------------------------------------------------------
- * PTrie
- *  a persisted tree of text nodes
- *
- *  this is a collection of { key, value } pairs, where a many-value
- *  to one key paradigm is naturally supported, as in the b-tree.
- *
- *  the desired retrieval operations are:
- *   a) key -> id : value
- *   b) key -> { id : value, ... }
- *   c) RE -> id : value
- *   d) RE -> { id : value, ... }
- *   e) iteration across { id : value, ... }
- *   f) id : value -> key
- *
- *  the reverse retrieval operation is:
- *   a) id -> value
- *
- *  indexing of the id is performed externally, and should not be interpreted
- *  as a serial, integer value. it may be a byte offset or a combination of
- *  two integer values, as well as anything else.
- */
-typedef struct PTrie PTrie;
-
-/* Make
- *  make a persisted tree structure
- * MakeOrig - DEPRECATED
- *  includes code to handle original composite node encoding
- *
- *  "addr" [ IN ] and "size" [ IN ] - constant memory image of
- *  persisted text tree with a lifetime exceeding that of the
- *  PTrie itself
- *
- *  "byteswap" [ IN ] - true if persisted image must be byteswapped
- */
-KLIB_EXTERN rc_t CC PTrieMake ( PTrie **tt,
-    const void *addr, size_t size, bool byteswap );
-KLIB_EXTERN rc_t CC PTrieMakeOrig ( PTrie **tt,
-    const void *addr, size_t size, bool byteswap );
-
-/* Count
- *  returns number of { id : value } pairs in text tree
- *  not included within the Trie interface itself, but
- *  was included here due to the fact that it is constant
- *
- *  return value:
- *    integer value >= 0
- */
-KLIB_EXTERN uint32_t CC PTrieCount ( const PTrie *self );
-
-/* Size
- *  returns the size in bytes
- *  of the PTrie image
- */
-KLIB_EXTERN size_t CC PTrieSize ( const PTrie *self );
-
-/* GetNode
- *  gets a PTNode from an id
- *
- *  "node" [ OUT ] - return parameter for node
- *
- *  "id" [ IN ] - a 1-based integer node id
- *
- *  return values:
- *    EINVAL => an invalid parameter was passed
- *    ENOENT => id out of range
- */
-KLIB_EXTERN rc_t CC PTrieGetNode ( const PTrie *self, PTNode *node, uint32_t id );
-
-/* Find
- * PTrieFindRE
- *  find a single { id, value } pair  within tree
- *
- *  "key" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  "rtn" [ OUT ] - return parameter for node if found.
- *  its value is undefined unless the function returns success.
- *
- *  "custom_cmp" [ IN, NULL OKAY ] and "data" [ OPAQUE ] - optional
- *  comparison function
- *
- *  return value:
- *    0    => not found
- *    1..n => id of found pair
- */
-KLIB_EXTERN uint32_t CC PTrieFind ( const PTrie *self, struct String const *key, PTNode *rtn,
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n ,void *data), void * data );
-
-#if 0
-KLIB_EXTERN uint32_t CC PTrieFindRE ( const PTrie *self, struct String const *re, PTNode *rtn );
-#endif
-
-/* FindAll
- * PTrieFindAllRE
- *  find multiple objects within tree
- *
- *  "key" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  "buffer" [ OUT ] and "capacity" [ IN ] - a user-supplied
- *  array of PTNode with a capacity of "capacity" elements.
- *  if successful, the entire found set will be returned unordered within.
- *
- *  "num_found" [ OUT ] - indicates the size of the found set,
- *  regardless of return value, such that if the supplied
- *  buffer were to be too small, the required size is returned.
- *
- *  "custom_cmp" [ IN, NULL OKAY ] and "data" [ OPAQUE ] - optional
- *  comparison function
- *
- *  returns status codes:
- *    EINVAL  => an invalid parameter
- *    ENOENT  => the found set was empty
- *    ENOBUFS => the found set was too large
- */
-#if 0
-KLIB_EXTERN rc_t CC PTrieFindAll ( const PTrie *self, struct String const *key,
-    PTNode buffer [], uint32_t capacity, uint32_t *num_found,
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data );
-KLIB_EXTERN rc_t CC PTrieFindAllRE ( const PTrie *self, struct String const *re,
-    PTNode buffer [], uint32_t capacity, uint32_t *num_found );
-#endif
-
-/* ForEach
- *  executes a function on each tree element
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TNode in the tree
- */
-KLIB_EXTERN void CC PTrieForEach ( const PTrie *self,
-    void ( CC * f ) ( PTNode *n, void *data ), void *data );
-
-/* DoUntil
- *  executes a function on each tree element
- *  until the function returns true
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TNode in the tree. the function returns "true"
- *  to halt iteration.
- *
- *  return values:
- *    the last value returned by "f" or false if never invoked
- */
-KLIB_EXTERN bool CC PTrieDoUntil ( const PTrie *self,
-    bool ( CC * f ) ( PTNode *n, void *data ), void *data );
-
-/* Whack
- *  tears down internal structure
- */
-KLIB_EXTERN void CC PTrieWhack ( PTrie *self );
-
-
-/*--------------------------------------------------------------------------
- * Trie
- */
-
-/* Persist
- *  much like BSTreePersist but operates on a Trie
- *
- *  "num_writ" [ OUT, NULL OKAY ] -  returns parameter for the number
- *  of bytes written as a result of persisting the b-tree. this will
- *  be the actual bytes written regardless of return status.
- *
- *  "ext_keys" [ IN ] - if true, does not store key data internally.
- *  key text gets encoded into the tree structure in all cases. when
- *  stored internally, any key text not represented by the tree will
- *  be explicitly written by this function. otherwise, the caller will
- *  be expected to store the text as desired. while internal storage
- *  will probably be more efficient, it will cause this function to
- *  fail if the Trie was built with ambiguous key transitions, i.e.
- *  if initialized with "cs_expand" false and keys were added having
- *  characters not included within the "accept" character set. this
- *  is because the tree channels all unrecognized characters through
- *  a single code, making their recovery impossible without being
- *  stored externally.
- *
- *  "write" [ IN, NULL OKAY ] and "write_param" [ IN ] -  a generic
- *  output streaming function used for all operations. if NULL, then
- *  the function will exit after its first pass with the number of
- *  bytes required in "num_writ".
- *
- *  "aux" [ IN ] and "aux_param" [ IN ] - a specialized function for
- *  streaming auxiliary node data to output using the supplied "write"
- *  function. it is invoked during the first pass with a NULL write
- *  function for gathering size data, and during the third pass with
- *  a non-NULL write function.
- */
-KLIB_EXTERN rc_t CC TriePersist ( struct Trie const *self, size_t *num_writ, bool ext_keys,
-    PTWriteFunc write, void *write_param, PTAuxFunc aux, void *aux_param );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_ptrie_ */
diff --git a/interfaces/klib/rc.h b/interfaces/klib/rc.h
deleted file mode 100644
index e7ad1a4..0000000
--- a/interfaces/klib/rc.h
+++ /dev/null
@@ -1,483 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_rc_
-#define _h_klib_rc_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#if _DEBUGGING
-
-#ifndef _h_compiler_
-#include <compiler.h>
-#endif
-
-#include <assert.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * under normal usage, the declarations below will create simple enums.
- * however, they may be redefined to create textual lookup tables.
- */
-#ifndef RC_ENUM
-
-#define RC_ENUM( type ) enum type
-
-#undef RC_ENTRY
-#define RC_ENTRY( id, txt ) id,
-
-#undef RC_VLAST
-#define RC_VLAST( id ) id,
-
-#undef RC_LAST
-#define RC_LAST( id ) id
-
-#define RC_EMIT 1
-
-#endif
-
-/*--------------------------------------------------------------------------
- * RC
- *  upon success, all functions will return code 0
- *  other codes indicate failure or additional status information
- */
-
-#if _DEBUGGING && ! defined RECORD_RC_FILE_LINE
-#define RECORD_RC_FILE_LINE 1
-#elif ! defined RECORD_RC_FILE_LINE
-#define RECORD_RC_FILE_LINE 0
-#endif
-
-
-/* RCModule
- *  what code module generated the error
- */
-RC_ENUM ( RCModule )
-{
-    RC_ENTRY ( rcExe, NULL )
-    RC_ENTRY ( rcRuntime, "runtime" )
-    RC_ENTRY ( rcText, "text" )
-    RC_ENTRY ( rcCont, "container" )
-    RC_ENTRY ( rcCS, "checksum" )
-    RC_ENTRY ( rcFF, "file format detection" )
-    RC_ENTRY ( rcFS, "file system" )
-    RC_ENTRY ( rcPS, "process system" )
-    RC_ENTRY ( rcXF, "transform" )
-    RC_ENTRY ( rcDB, "database" )
-    RC_ENTRY ( rcVDB, "virtual database" )
-    RC_ENTRY ( rcApp, "application support" )
-    RC_ENTRY ( rcXML, "xml support" )
-    RC_ENTRY ( rcSRA, "short read archive" )
-    RC_VLAST ( rcLastModule_v1_0 )
-    RC_ENTRY ( rcKFG = rcLastModule_v1_0, "configuration" )
-    RC_ENTRY ( rcAlign, "alignment" )
-    RC_ENTRY ( rcKrypto, "cryptographic" )
-    RC_ENTRY ( rcRDBMS, "RDBMS" )
-    RC_ENTRY ( rcNS, "network system" )
-    RC_ENTRY ( rcVFS, "virtual file system" )
-    RC_LAST ( rcLastModule_v1_1 )
-};
-
-/* RCTarget
- *  describes the target object of the message
- */
-RC_ENUM ( RCTarget )
-{
-    RC_ENTRY ( rcNoTarg, NULL )
-    RC_ENTRY ( rcArc, "archive file" )
-    RC_ENTRY ( rcToc, "file system table of contents" )
-    RC_ENTRY ( rcTocEntry, "file table of contents entry" )
-    RC_ENTRY ( rcArgv, "argument list" )
-    RC_ENTRY ( rcAttr, "attribute" )
-    RC_ENTRY ( rcBarrier, "barrier" )
-    RC_ENTRY ( rcBlob, "binary large object" )
-    RC_ENTRY ( rcBuffer, "buffer" )
-    RC_ENTRY ( rcChar, "character" )
-    RC_ENTRY ( rcColumn, "column" )
-    RC_ENTRY ( rcCondition, "condition" )
-    RC_ENTRY ( rcCursor, "cursor" )
-    RC_ENTRY ( rcDatabase, "database" )
-    RC_ENTRY ( rcDirectory, "directory" )
-    RC_ENTRY ( rcDoc, "document" )
-    RC_ENTRY ( rcXmlDoc, "XML document" )
-    RC_ENTRY ( rcFile, "file" )
-    RC_ENTRY ( rcFileDesc, "file descriptor" )
-    RC_ENTRY ( rcFileFormat, "file format" )
-    RC_ENTRY ( rcFunction, "function" )
-    RC_ENTRY ( rcFormatter, "formatter" )
-    RC_ENTRY ( rcFunctParam, "function parameter" )
-    RC_ENTRY ( rcHeader, "header" )
-    RC_ENTRY ( rcIndex, "index" )
-    RC_ENTRY ( rcIterator, "iterator" )
-    RC_ENTRY ( rcLock, "lock" )
-    RC_ENTRY ( rcLog, "log" )
-    RC_ENTRY ( rcMD5SumFmt, "MD5 sum file" )
-    RC_ENTRY ( rcMemMap, "memory map" )
-    RC_ENTRY ( rcMetadata, "metadata" )
-    RC_ENTRY ( rcMgr, "manager" )
-    RC_ENTRY ( rcNamelist, "name list" )
-    RC_ENTRY ( rcNode, "node" )
-    RC_ENTRY ( rcNumeral, "numeral" )
-    RC_ENTRY ( rcPagemap, "page map" )
-    RC_ENTRY ( rcPath, "path" )
-    RC_ENTRY ( rcProcess, "process" ) 
-    RC_ENTRY ( rcQueue, "queue" )
-    RC_ENTRY ( rcRWLock, "read/write lock" )
-    RC_ENTRY ( rcSchema, "schema" )
-    RC_ENTRY ( rcSemaphore, "semaphore" )
-    RC_ENTRY ( rcStorage, "storage" )
-    RC_ENTRY ( rcString, "string" )
-    RC_ENTRY ( rcTable, "table" )
-    RC_ENTRY ( rcThread, "thread" )
-    RC_ENTRY ( rcTimeout, "timeout" )
-    RC_ENTRY ( rcToken, "token" )
-    RC_ENTRY ( rcTree, "tree" )
-    RC_ENTRY ( rcTrie, "trie" )
-    RC_ENTRY ( rcType, "type" )
-    RC_ENTRY ( rcVector, "vector" )
-    RC_ENTRY ( rcDylib, "dynamic library" )
-    RC_ENTRY ( rcExpression, "expression" )
-    RC_VLAST ( rcLastTarget_v1_0 )
-    RC_ENTRY ( rcProduction = rcLastTarget_v1_0, "schema production" )
-    RC_ENTRY ( rcEncryptionKey, "encryption key" )
-    RC_ENTRY ( rcRng, "random number generator" )
-    RC_ENTRY ( rcCmd, "command" )
-    RC_ENTRY ( rcData, "data" )
-    RC_ENTRY ( rcQuery, "query" )
-    RC_ENTRY ( rcUri, "uri" )
-    RC_LAST ( rcLastTarget_v1_1 )
-};
-
-/* RCContext
- *  context under which error occurred
- */
-RC_ENUM ( RCContext )
-{
-    RC_ENTRY ( rcAllocating, "allocating" )
-    RC_ENTRY ( rcCasting, "type-casting" )
-    RC_ENTRY ( rcConstructing, "constructing" )
-    RC_ENTRY ( rcDestroying, "destroying" )
-    RC_ENTRY ( rcReleasing, "releasing" )
-    RC_ENTRY ( rcAccessing, "accessing" )
-    RC_ENTRY ( rcListing, "listing" )
-    RC_ENTRY ( rcVisiting, "visiting" )
-    RC_ENTRY ( rcResolving, "resolving" )
-    RC_ENTRY ( rcLocking, "locking" )
-    RC_ENTRY ( rcUnlocking, "unlocking" )
-    RC_ENTRY ( rcRenaming, "renaming" )
-    RC_ENTRY ( rcAliasing, "aliasing" )
-    RC_ENTRY ( rcSelecting, "selecting" )
-    RC_ENTRY ( rcProjecting, "projecting" )
-    RC_ENTRY ( rcInserting, "inserting" )
-    RC_ENTRY ( rcRemoving, "removing" )
-    RC_ENTRY ( rcClearing, "clearing" )
-    RC_ENTRY ( rcUpdating, "updating" )
-    RC_ENTRY ( rcCreating, "creating" )
-    RC_ENTRY ( rcOpening, "opening" )
-    RC_ENTRY ( rcClosing, "closing" )
-    RC_ENTRY ( rcResizing, "resizing" )
-    RC_ENTRY ( rcReading, "reading" )
-    RC_ENTRY ( rcWriting, "writing" )
-    RC_ENTRY ( rcCommitting, "committing" )
-    RC_ENTRY ( rcReverting, "reverting" )
-    RC_ENTRY ( rcResetting, "resetting" )
-    RC_ENTRY ( rcPersisting, "persisting" )
-    RC_ENTRY ( rcFreezing, "freezing" )
-    RC_ENTRY ( rcCopying, "copying" )
-    RC_ENTRY ( rcConcatenating, "concatenating" )
-    RC_ENTRY ( rcFormatting, "formatting" )
-    RC_ENTRY ( rcPositioning, "positioning" )
-    RC_ENTRY ( rcPacking, "packing" )
-    RC_ENTRY ( rcUnpacking, "unpacking" )
-    RC_ENTRY ( rcEncoding, "encoding" )
-    RC_ENTRY ( rcDecoding,"decoding" )
-    RC_ENTRY ( rcValidating, "validating" )
-    RC_ENTRY ( rcExecuting, "executing" )
-    RC_ENTRY ( rcHuffmanCoding, "Huffman coding" )
-    RC_ENTRY ( rcReindexing, "re-indexing" )
-    RC_ENTRY ( rcRegistering, "registering" )
-    RC_ENTRY ( rcTokenizing, "tokenizing" )
-    RC_ENTRY ( rcParsing, "parsing" )
-    RC_ENTRY ( rcConverting, "converting" )
-    RC_ENTRY ( rcSignaling, "signaling" )
-    RC_ENTRY ( rcWaiting, "waiting" )
-    RC_ENTRY ( rcAttaching, "attaching" )
-    RC_ENTRY ( rcDetaching, "detaching" )
-    RC_ENTRY ( rcLogging, "logging" )
-    RC_ENTRY ( rcFPCoding, "floating point coding" )
-    RC_ENTRY ( rcMultiplexing, "(de)multiplexing" )
-    RC_ENTRY ( rcClassifying, "classifying" )
-    RC_ENTRY ( rcSearching, "searching" )
-    RC_ENTRY ( rcLoading, "loading" )
-    RC_ENTRY ( rcEvaluating, "evaluating" )
-    RC_ENTRY ( rcInflating, "inflating" )
-    RC_VLAST ( rcLastContext_v1_0 )
-    RC_ENTRY ( rcFlushing = rcLastContext_v1_0, "flushing" )
-    RC_ENTRY ( rcAppending, "appending" )
-    RC_ENTRY ( rcEncrypting, "encrypting" )
-    RC_ENTRY ( rcDecrypting, "decrypting" )
-    RC_ENTRY ( rcComparing, "comparing" )
-    RC_ENTRY ( rcInitializing, "initializing" )
-    RC_ENTRY ( rcRetrieving, "retrieving" )
-    RC_ENTRY ( rcSending, "sending" )
-    RC_ENTRY ( rcProcessing, "processing" )
-    RC_ENTRY ( rcIdentifying, "type identifying" )
-    RC_LAST ( rcLastContext_v1_1 )
-};
-
-/* RCObject
- *  type of object described by state
- */
-RC_ENUM ( RCObject )
-{
-    RC_ENTRY ( rcNoObj, NULL )
-    RC_ENTRY ( rcLink = ( int ) rcLastTarget_v1_1, "symbolic link" )
-    RC_ENTRY ( rcSelf, "self" )
-    RC_ENTRY ( rcParam, "param" )
-    RC_ENTRY ( rcOffset, "offset" )
-    RC_ENTRY ( rcMemory, "memory" )
-    RC_ENTRY ( rcName, "name" )
-    RC_ENTRY ( rcFormat, "format" )
-    RC_ENTRY ( rcTransfer, "transfer" )
-    RC_ENTRY ( rcInterface, "interface" )
-    RC_ENTRY ( rcId, "id" )
-    RC_ENTRY ( rcRange, "range" )
-    RC_ENTRY ( rcConstraint, "constraint" )
-    RC_ENTRY ( rcByteOrder, "byte order" )
-    RC_ENTRY ( rcMessage, "message" )
-    RC_ENTRY ( rcTag, "tag" )
-    RC_ENTRY ( rcResources, "system resources" )
-    RC_ENTRY ( rcDirEntry, "directory-toc entry" )
-    RC_ENTRY ( rcArcHardLink, "archive hard link" )
-    RC_ENTRY ( rcRow, "row" )
-    RC_ENTRY ( rcLibrary, "loadable library" )
-    RC_VLAST ( rcLastObject_v1_0 )
-    RC_ENTRY ( rcItem = rcLastObject_v1_0, "item" )
-    RC_ENTRY ( rcMode, "mode" )
-    RC_ENTRY ( rcEncryption, "encryption" )
-    RC_ENTRY ( rcCrc, "crc" )
-    RC_ENTRY ( rcChecksum, "checksum" )
-    RC_ENTRY ( rcSeed, "seed" )
-    RC_ENTRY ( rcConnection, "connection" )
-    RC_ENTRY ( rcError, "error" )
-    RC_ENTRY ( rcEnvironment, "environment" )
-    RC_ENTRY ( rcSignalSet, "signal set" )
-    RC_ENTRY ( rcSize, "size" )
-    RC_ENTRY ( rcRefcount, "reference count" )
-    RC_LAST ( rcLastObject_v1_1 )
-};
-
-/* RCState
- *  state of object described
- */
-RC_ENUM ( RCState )
-{
-    RC_ENTRY ( rcNoErr, "no error" )
-    RC_ENTRY ( rcDone, "done" )
-    RC_ENTRY ( rcUnknown, "unknown" )
-    RC_ENTRY ( rcUnsupported, "unsupported" )
-    RC_ENTRY ( rcUnexpected, "unexpected" )
-    RC_ENTRY ( rcUnrecognized, "unrecognized" )
-    RC_ENTRY ( rcAmbiguous, "ambiguous" )
-    RC_ENTRY ( rcNull, "NULL" )
-    RC_ENTRY ( rcBadVersion, "bad version" )
-    RC_ENTRY ( rcDestroyed, "destroyed" )
-    RC_ENTRY ( rcInvalid, "invalid" )
-    RC_ENTRY ( rcCorrupt, "corrupt" )
-    RC_ENTRY ( rcIncorrect, "incorrect" )
-    RC_ENTRY ( rcInconsistent, "inconsistent" )
-    RC_ENTRY ( rcBusy, "busy" )
-    RC_ENTRY ( rcIncomplete, "incomplete" )
-    RC_ENTRY ( rcInterrupted, "interrupted" )
-    RC_ENTRY ( rcCanceled, "canceled" )
-    RC_ENTRY ( rcEmpty, "empty" )
-    RC_ENTRY ( rcExhausted, "exhausted" )
-    RC_ENTRY ( rcInsufficient, "insufficient" )
-    RC_ENTRY ( rcExcessive, "excessive" )
-    RC_ENTRY ( rcViolated, "violated" )
-    RC_ENTRY ( rcExists, "exists" )
-    RC_ENTRY ( rcNotFound, "not found" )
-    RC_ENTRY ( rcLocked, "locked" )
-    RC_ENTRY ( rcUnlocked, "unlocked" )
-    RC_ENTRY ( rcDetached, "detached" )
-    RC_ENTRY ( rcDeadlock, "deadlock" )
-    RC_ENTRY ( rcUnauthorized, "unauthorized" )
-    RC_ENTRY ( rcReadonly, "read-only" )
-    RC_ENTRY ( rcWriteonly, "write-only" )
-    RC_ENTRY ( rcNoPerm, "no permission" )
-    RC_ENTRY ( rcInPlaceNotAllowed, "update in-place prohibited" )
-    RC_ENTRY ( rcTooShort, "too short" )
-    RC_ENTRY ( rcTooLong, "too long" )
-    RC_ENTRY ( rcTooBig, "too big" )
-    RC_ENTRY ( rcDuplicate, "duplicate" )
-    RC_ENTRY ( rcOutOfKDirectory, "path out of this KDirectory FS" )
-    RC_ENTRY ( rcIgnored, "ignored" )	
-    RC_ENTRY ( rcOutofrange, "out of range" )
-    RC_VLAST ( rcLastState_v1_0 )
-    RC_ENTRY ( rcOpen = rcLastState_v1_0, "open" )
-    RC_ENTRY ( rcOutoforder, "out of order" )
-    RC_ENTRY ( rcNotOpen, "not open" )
-    RC_ENTRY ( rcUndefined, "undefined" )
-    RC_ENTRY ( rcUnequal, "unequal" )
-    RC_ENTRY ( rcFailed, "failed" )
-    RC_ENTRY ( rcNotAvailable, "not available" )
-    RC_ENTRY ( rcWrongType, "wrong type" )
-    RC_LAST ( rcLastState_v1_1 )
-};
-
-#if RC_EMIT
-
-KLIB_EXTERN const char * CC GetRCFilename ( void );
-KLIB_EXTERN const char * CC GetRCFunction ( void );
-KLIB_EXTERN uint32_t CC GetRCLineno ( void );
-KLIB_EXTERN rc_t CC SetRCFileFuncLine ( rc_t rc, const char *filename, const char *funcname, uint32_t lineno );
-KLIB_EXTERN bool CC GetUnreadRCInfo ( rc_t *rc, const char **filename, const char **funcname, uint32_t *lineno );
-
-#if RECORD_RC_FILE_LINE
-
-    #if defined(__SUNPRO_CC)  &&  __SUNPRO_CC <= 0x590  &&  defined(__cplusplus)
-    
-        #define SET_RC_FILE_FUNC_LINE( rc ) \
-            SetRCFileFuncLine ( ( rc ), __FILE__, "(unknown)", __LINE__ )
-    
-    #else
-    
-        #define SET_RC_FILE_FUNC_LINE( rc ) \
-            SetRCFileFuncLine ( ( rc ), __FILE__, __func__, __LINE__ )
-    
-    #endif
-
-#else
-
-    #define SET_RC_FILE_FUNC_LINE( rc ) \
-        ( rc_t ) ( rc )
-
-#endif
-
-#ifdef assert
-#define ASSERT_MOD_TARG_CTX() \
-    assert ( ( int ) rcLastModule_v1_1  < ( 1 << 5 ) ), \
-    assert ( ( int ) rcLastTarget_v1_1  < ( 1 << 6 ) ), \
-    assert ( ( int ) rcLastContext_v1_1  < ( 1 << 7 ) )
-
-#define ASSERT_OBJ_STATE() \
-    assert ( ( int ) rcLastObject_v1_1  < ( 1 << 8 ) ), \
-    assert ( ( int ) rcLastState_v1_1  < ( 1 << 6 ) )
-#else
-#define ASSERT_MOD_TARG_CTX() ( void ) 0
-
-#define ASSERT_OBJ_STATE() ( void ) 0
-#endif
-
-/* CTX
- *  form a context from parts
- */
-#define CTX( mod, targ, ctx )                       \
-    ( rc_t ) ( ASSERT_MOD_TARG_CTX (), (            \
-        ( ( rc_t ) ( mod )  << 27 ) | /* 5 bits */  \
-        ( ( rc_t ) ( targ ) << 21 ) | /* 6 bits */  \
-        ( ( rc_t ) ( ctx )  << 14 ) ) /* 7 bits */  \
-    )
-
-/* RC
- *  form a complete return code from parts
- */
-#define SILENT_RC( mod, targ, ctx, obj, state )              \
-    ( rc_t ) ( ASSERT_OBJ_STATE (),                          \
-        CTX ( mod, targ, ctx )    | /* 18 bits */            \
-        ( ( rc_t ) ( obj ) << 6 ) | /*  8 bits */            \
-        ( ( rc_t ) ( state ) ) )    /*  6 bits */
-
-#define RC( mod, targ, ctx, obj, state )                     \
-    ( rc_t ) ( ASSERT_OBJ_STATE (),                          \
-    SET_RC_FILE_FUNC_LINE (                                  \
-        CTX ( mod, targ, ctx )    | /* 18 bits */            \
-        ( ( rc_t ) ( obj ) << 6 ) | /*  8 bits */            \
-        ( ( rc_t ) ( state ) ) ) )  /*  6 bits */
-
-/* ResetRCContext
- *  rewrite rc to reflect different context
- *  typically used to pass out return codes
- */
-#define ResetRCContext( rc, mod, targ, ctx ) \
-    ( ( ( rc ) & 0x3FFF ) | CTX ( mod, targ, ctx ) )
-
-/* ResetRCState
- *  rewrite rc to reflect different state
- *  typically used to pass out return codes
- */
-#define ResetRCState( rc, obj, state ) \
-    ( ( ( rc ) & 0xFFFFFFC0 ) | ( rc_t ) ( state ) )
-
-#endif /* __cplusplus */
-
-/* GetRCModule
- *  extract the module portion
- */
-#define GetRCModule( rc ) \
-    ( enum RCModule ) ( ( ( rc ) >> 27 ) & 0x1F )
-
-/* GetRCTarget
- *  extract the target portion
- */
-#define GetRCTarget( rc ) \
-    ( enum RCTarget ) ( ( ( rc ) >> 21 ) & 0x3F )
-
-/* GetRCContext
- *  extract the context portion
- */
-#define GetRCContext( rc ) \
-    ( enum RCContext ) ( ( ( rc ) >> 14 ) & 0x7F )
-
-/* GetRCObject
- *  extract the target object portion
- */
-#define GetRCObject( rc ) \
-    ( enum RCObject ) ( ( ( rc ) >> 6 ) & 0xFF )
-
-/* GetRCState
- *  extract the state portion
- */
-#define GetRCState( rc ) \
-    ( enum RCState ) ( ( rc ) & 0x3F )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_rc_ */
diff --git a/interfaces/klib/refcount.h b/interfaces/klib/refcount.h
deleted file mode 100644
index bc7cfd5..0000000
--- a/interfaces/klib/refcount.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_refcount_
-#define _h_klib_refcount_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_atomic32_
-#include <atomic32.h>
-#endif
-
-/* normally turned off */
-#ifndef TRACK_REFERENCES
-#define TRACK_REFERENCES 1
-#endif
-
-/* normally turned on */
-#ifndef INLINE_REFCOUNT
-#define INLINE_REFCOUNT 0
-#endif
-
-/* include logging interface */
-#if TRACK_REFERENCES
-
-#include <klib/debug.h>
-
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KRefcount
- *  signed 32-bit reference counter
- * KDualRef
- *  dual signed/unsigned 16-bit reference counter
- */
-typedef atomic32_t KRefcount;
-typedef atomic32_t KDualRef;
-
-
-/* Actions
- *  enum of action indicators
- */
-enum KRefcountActions
-{
-    krefOkay,      /* no action needs to be taken           */
-    krefWhack,     /* total refcount zero crossing detected */
-    krefZero,      /* owned or dep reference zero crossing  */
-    krefLimit,     /* modification exceeds limits           */
-    krefNegative   /* negative prior or resulting count     */
-};
-
-
-/* Init
- *  initialize a refcount object
- *
- *  "refcount" [ IN/OUT ] - pointer to object being initialized
- *
- *  "value" [ IN ] - initial refcount value
- *    -OR-
- *  "owned" [ IN ] and "dep" [ IN ] - owned and dependent counts
- *  function will return krefLimit if counts exceed limits
- *
- *  "clsname" [ IN ] - NUL-terminated string stating classname
- *  of object instance being initialized.
- *
- *  "op" [ IN ] - NUL-terminated string stating construction operation
- *
- *  "name" [ IN ] - NUL-terminated name of instance
- */
-KLIB_EXTERN void CC KRefcountInit ( KRefcount *refcount, int value,
-    const char *clsname, const char *op, const char *name );
-KLIB_EXTERN int CC KDualRefInit ( KDualRef *refcount, int owned, int dep,
-    const char *clsname, const char *op, const char *name );
-
-
-/* Whack
- *  tear down whatever was built up in object
- */
-KLIB_EXTERN void CC KRefcountWhack ( KRefcount *self, const char *clsname );
-KLIB_EXTERN void CC KDualRefWhack ( KDualRef *self, const char *clsname );
-
-
-/* Add
- *  add an owned reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation always returns krefOkay.
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully added
- *    krefZero     : reference was added, but prior value was zero
- *    krefLimit    : reference was NOT added, too many references
- *    krefNegative : reference was NOT added, prior value was negative
- */
-KLIB_EXTERN int CC KRefcountAdd ( const KRefcount *self, const char *clsname );
-KLIB_EXTERN int CC KDualRefAdd ( const KDualRef *self, const char *clsname );
-
-
-/* Drop
- *  drop an owned reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation returns:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *    krefZero     : reference was dropped, and no further owned refernces exist
- *    krefNegative : reference was NOT dropped, as resultant count would be negative
- */
-KLIB_EXTERN int CC KRefcountDrop ( const KRefcount *self, const char *clsname );
-KLIB_EXTERN int CC KDualRefDrop ( const KDualRef *self, const char *clsname );
-
-
-/* AddDep
- *  adds a dependency reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation always returns krefOkay.
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully added
- *    krefZero     : reference was added, but prior value was zero
- *    krefLimit    : reference was NOT added, too many references
- *    krefNegative : reference was NOT added, prior value was negative
- */
-KLIB_EXTERN int CC KRefcountAddDep ( const KRefcount *self, const char *clsname );
-KLIB_EXTERN int CC KDualRefAddDep ( const KDualRef *self, const char *clsname );
-
-
-/* DropDep
- *  drop a dependency reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation returns:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *    krefZero     : reference was dropped, and no further dependent refernces exist
- *    krefNegative : reference was NOT dropped, as resultant count would be negative
- */
-KLIB_EXTERN int CC KRefcountDropDep ( const KRefcount *self, const char *clsname );
-KLIB_EXTERN int CC KDualRefDropDep ( const KDualRef *self, const char *clsname );
-
-
-
-/*--------------------------------------------------------------------------
- * KRefcount inline implementation
- */
-
-#if INLINE_REFCOUNT
-
-#define KRefcountInit( refcount, value, clsname, op, name ) \
-    ( REFNEW_COMMA ( clsname, op, name, refcount, value ) \
-      atomic32_set ( refcount, value ) )
-#define KRefcountWhack( self, clsname ) \
-    REFMSG ( clsname, "whack", self )
-#define KRefcountAdd( self, clsname ) \
-    ( REFMSG_COMMA ( clsname, "addref", self ) \
-      ( atomic32_read ( self ) < 0 ) ? krefNegative : \
-      ( atomic32_inc ( ( KRefcount* ) ( self ) ), krefOkay ) )
-#define KRefcountDrop( self, clsname ) \
-    ( REFMSG_COMMA ( clsname, "release", self ) \
-      ( atomic32_read ( self ) <= 0 ) ? krefNegative : \
-      ( atomic32_dec_and_test ( ( KRefcount* ) ( self ) ) ? krefWhack : krefOkay ) )
-#define KRefcountAddDep( self, clsname ) \
-    ( REFMSG_COMMA ( clsname, "attach", self ) \
-      ( atomic32_read ( self ) < 0 ) ? krefNegative : \
-      ( atomic32_inc ( ( KRefcount* ) ( self ) ), krefOkay ) )
-#define KRefcountDropDep( self, clsname ) \
-    ( REFMSG_COMMA ( clsname, "sever", self ) \
-      ( atomic32_read ( self ) <= 0 ) ? krefNegative : \
-      ( atomic32_dec_and_test ( ( KRefcount* ) ( self ) ) ? krefWhack : krefOkay ) )
-
-#endif
-
-
-#if TRACK_REFERENCES
-
-#ifndef REFMOD
-#define REFMOD DBG_REF
-#endif
-
-#ifndef REFCOND
-#define REFCOND DBG_REF_ANY
-#endif
-
-#define REFNEW( clsname, op, name, instance, refcount )                 \
-    DBGMSG ( REFMOD, REFCOND, ( "created %s, operation %s, name '%s', " \
-                                "instance 0x%zX: initial refcount %d\n",  \
-                                clsname, op, name, instance, refcount ))
-#define CNTMSG( clsname, op, instance, refcount )                       \
-    DBGMSG ( REFMOD, REFCOND, ( "about to %s instance 0x%zX: prior refcount = %d for %s\n", \
-                                op, instance, refcount, clsname ))
-#define REFMSG( clsname, op, instance ) \
-    CNTMSG ( clsname, op, instance, atomic32_read ( instance ) )
-#define REFNEW_COMMA( clsname, op, name, instance, refcount ) \
-    REFNEW ( clsname, op, name, instance, refcount ),
-#define REFMSG_COMMA( clsname, op, instance ) \
-    REFMSG ( clsname, op, instance ),
-#else
-
-#define REFNEW( clsname, op, name, instance, refcount ) \
-    ( void ) 0
-#define CNTMSG( clsname, op, instance, refcount ) \
-    ( void ) 0
-#define REFMSG( clsname, op, instance ) \
-    ( void ) 0
-#define REFNEW_COMMA( clsname, op, name, instance, refcount )
-#define REFMSG_COMMA( clsname, op, instance )
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_refcount_ */
diff --git a/interfaces/klib/report.h b/interfaces/klib/report.h
deleted file mode 100644
index 2c60e2f..0000000
--- a/interfaces/klib/report.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_report_
-#define _h_klib_report_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-
-/* Init
- *  initialize with common information
- *
- *  "argc" [ IN ] and "argv" [ IN ] - intact command line
- *
- *  "tool_version" [ IN ] - version of tool
- */
-KLIB_EXTERN void CC ReportInit ( int argc, char *argv [],
-    ver_t tool_version );
-
-
-/* BuildDate
- *  set the build date of the tool
- *
- *  "date" [ IN ] - pre-processor __DATE__
- */
-KLIB_EXTERN void CC ReportBuildDate ( const char *date );
-
-
-/* Silence
- *  tell report to be silent at exit
- *  useful especially in response to ^C
- */
-KLIB_EXTERN void CC ReportSilence ( void );
-
-
-/* Finalize
- *  perform cleanup
- *  optionally report error condition
- *
- *  "rc" [ IN ] - report environment information if not zero
- */
-KLIB_EXTERN rc_t CC ReportFinalize ( rc_t rc );
-
-
-/* ResetObject
- *  Resets the name of the current object beeing processes(path or accession),
- *  usually from command line.
- *  Should be called each time
- *  when starting next command line argument processing.
- */
-KLIB_EXTERN rc_t CC ReportResetObject ( const char *path );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_report_ */
diff --git a/interfaces/klib/sort.h b/interfaces/klib/sort.h
deleted file mode 100644
index 4adf75a..0000000
--- a/interfaces/klib/sort.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_sort_
-#define _h_klib_sort_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_ksort_macro_
-#include <klib/ksort-macro.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * ksort
- *  qsort with a function data pointer
- */
-KLIB_EXTERN void CC ksort ( void *pbase, size_t total_elems, size_t size,
-    int ( CC * cmp ) ( const void*, const void*, void *data ), void *data );
-
-
-/* various custom ksort operations
- *  structures will generally want their own functions
- *  these fundamental types can be standardized
- */
-KLIB_EXTERN void CC ksort_int32_t ( int32_t *pbase, size_t total_elems );
-KLIB_EXTERN void CC ksort_uint32_t ( uint32_t *pbase, size_t total_elems );
-KLIB_EXTERN void CC ksort_int64_t ( int64_t *pbase, size_t total_elems );
-KLIB_EXTERN void CC ksort_uint64_t ( uint64_t *pbase, size_t total_elems );
-
-
-/* KSORT
- *  macro ( see <klib/ksort-macro.h> )
- *  allows creation of a custom qsort with inlined compare and swap
- *  MUCH faster than normal qsort or ksort.
- *
- *  basically you need to define a macro CMP() and another SWAP(),
- *  and the KSORT macro will fill in the rest.
- *
- *  CMP() needs to evaluate to a signed 32-bit integer.
- *  THIS WILL CHANGE TO BECOME LESS_THAN( a, b ).
- *
- *  SWAP() will generally be a custom operation, but can be
- *  defined in terms of a default operation similar to qsort.
- *
- *  an example usage follows:
- */
-#if 0
-static
-void ksort_int64_t ( int64_t *base, size_t count )
-{
-    /* swap is performed on full element, not byte-for-byte */
-#define SWAP( a, b, off, size )                             \
-    do                                                      \
-    {                                                       \
-        int64_t tmp = * ( const int64_t* ) ( a );           \
-        * ( int64_t* ) ( a ) = * ( const int64_t* ) ( b );  \
-        * ( int64_t* ) ( b ) = tmp;                         \
-    }                                                       \
-    while ( 0 )
-
-    /* 64-bit comparison producing a signed 32-bit result */
-#define CMP( a, b )                                                     \
-    ( ( * ( const int64_t* ) ( a ) < * ( const int64_t* ) ( b ) ) ? -1 : \
-      ( * ( const int64_t* ) ( a ) > * ( const int64_t* ) ( b ) ) )
-}
-
-    /* let the macro fill out the remainder */
-    KSORT ( base, count, sizeof * base, 0, sizeof * base );
-
-    /* free up macros for future use */
-#undef SWAP
-#undef CMP
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * kbsearch
- *  bsearch with a function data pointer
- */
-KLIB_EXTERN void* CC kbsearch ( const void *key, const void *base, size_t nmemb, size_t size,
-    int ( CC * cmp ) ( const void*, const void*, void *data ), void *data );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_sort_ */
diff --git a/interfaces/klib/status.h b/interfaces/klib/status.h
deleted file mode 100644
index 718c38f..0000000
--- a/interfaces/klib/status.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_status_
-#define _h_klib_status_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_writer_
-#include <klib/writer.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef uint32_t KStsLevel;
-
-KLIB_EXTERN KStsLevel CC KStsLevelGet( void );
-KLIB_EXTERN void CC KStsLevelSet( KStsLevel level );
-KLIB_EXTERN void CC KStsLevelAdjust( int32_t adjust );
-
-/* -----
- * Handlers for application and library writers.
- */
-KLIB_EXTERN KWrtHandler* CC KStsHandlerGet (void);
-KLIB_EXTERN KWrtHandler* CC KStsLibHandlerGet (void);
-
-KLIB_EXTERN KWrtWriter CC KStsWriterGet (void);
-KLIB_EXTERN KWrtWriter CC KStsLibWriterGet (void);
-
-KLIB_EXTERN void* CC KStsDataGet (void);
-KLIB_EXTERN void* CC KStsLibDataGet (void);
-
-/*
- * Init()
- * Initialize the debug messages module to a known state
- */
-KLIB_EXTERN rc_t CC KStsInit (void);
-
-KLIB_EXTERN rc_t CC KStsMsg (const char * fmt, ...);
-KLIB_EXTERN rc_t CC KStsLibMsg (const char * fmt, ...);
-
-/* Set
- */
-KLIB_EXTERN rc_t CC KStsHandlerSet    (KWrtWriter writer, void * data);
-KLIB_EXTERN rc_t CC KStsLibHandlerSet (KWrtWriter writer, void * data);
-
-KLIB_EXTERN rc_t CC KStsHandlerSetStdOut    ( void );
-KLIB_EXTERN rc_t CC KStsLibHandlerSetStdOut ( void );
-KLIB_EXTERN rc_t CC KStsHandlerSetStdErr    ( void );
-KLIB_EXTERN rc_t CC KStsLibHandlerSetStdErr ( void );
-
-/* formatting */
-typedef uint32_t KStsFmtFlags;
-enum KStsFmtFlagsEnum
-{
-    kstsFmtTimestamp = 0x00000001,
-    kstsFmtPid = 0x00000002,
-    kstsFmtAppName = 0x00000004,
-    kstsFmtAppVersion = 0x00000008,
-    kstsFmtMessage = 0x00000010, /* actual message */
-    kstsFmtLocalTimestamp = 0x00000020 /* print time stamp in local time, if both bits set local takes over */
-};
-
-KLIB_EXTERN KFmtHandler* CC KStsFmtHandlerGet (void);
-KLIB_EXTERN KFmtHandler* CC KStsLibFmtHandlerGet (void);
-
-KLIB_EXTERN KStsFmtFlags CC KStsFmtFlagsGet ( void );
-KLIB_EXTERN KStsFmtFlags CC KStsLibFmtFlagsGet ( void );
-
-KLIB_EXTERN KFmtWriter CC KStsFmtWriterGet (void);
-KLIB_EXTERN KFmtWriter CC KStsLibFmtWriterGet (void);
-KLIB_EXTERN void* CC KStsFmtDataGet (void);
-KLIB_EXTERN void* CC KStsLibFmtDataGet (void);
-
-KLIB_EXTERN rc_t CC KStsFmtFlagsSet    (KStsFmtFlags flags);
-KLIB_EXTERN rc_t CC KStsLibFmtFlagsSet (KStsFmtFlags flags);
-
-KLIB_EXTERN rc_t CC KStsFmtHandlerSet    (KFmtWriter formatter, KStsFmtFlags flags, void * data);
-KLIB_EXTERN rc_t CC KStsLibFmtHandlerSet (KFmtWriter formatter, KStsFmtFlags flags, void * data);
-
-KLIB_EXTERN rc_t CC KStsFmtHandlerSetDefault(void);
-KLIB_EXTERN rc_t CC KStsLibFmtHandlerSetDefault(void);
-
-/*
- * A usage could look like
- *
- *  STSMSG(4, ("Current Status Level is %d\n", KStsLevelGet()));
- *
- */
-#ifdef _LIBRARY
-
-#define STSMSG(lvl,msg) \
-    (void)((((unsigned)lvl) <= KStsLevelGet()) ? KStsLibMsg msg : 0)
-
-#else
-
-#define STSMSG(lvl,msg) \
-    (void)((((unsigned)lvl) <= KStsLevelGet()) ? KStsMsg msg : 0)
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_status_ */
diff --git a/interfaces/klib/symbol.h b/interfaces/klib/symbol.h
deleted file mode 100644
index d164f99..0000000
--- a/interfaces/klib/symbol.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_symbol_
-#define _h_klib_symbol_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KSymbol
- *  a name to object mapping
- */
-typedef struct KSymbol KSymbol;
-struct KSymbol
-{
-    /* currently kept in a BSTree
-       this could change, though */
-    BSTNode n;
-
-    union
-    {
-        /* external object
-           neither known, nor owned,
-           i.e. just a borrowed reference */
-        const void *obj;
-
-        /* if object is a namespace, its scope */
-        BSTree scope;
-
-        /* unresolved forward decl id */
-        struct { uint32_t ctx, id; } fwd;
-
-    } u;
-
-    /* enclosing namespace
-       for name traceback */
-    KSymbol *dad;
-
-    /* symbol name */
-    String name;
-
-    /* symbol type */
-    uint32_t type;
-};
-
-
-/* Make
- *  create a symbol
- *
- *  "sym" [ OUT ] - return parameter for symbol
- *
- *  "name" [ IN ] - symbol name
- *
- *  "type" [ IN ] - symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - optional object mapping
- *
- * This make will allocate storage for the KSymbol and
- * it's name.
- */
-KLIB_EXTERN rc_t CC KSymbolMake ( KSymbol **sym,
-    const String *name, uint32_t type, const void *obj );
-
-
-/* Init
- *  initialize a symbol without allocating space
- *
- *  "self" [ IN ] - where to initialize
- *
- *  "name" [ IN ] - symbol name
- *
- *  "type" [ IN ] - symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - optional object mapping
- *
- */
-KLIB_EXTERN rc_t CC KSymbolInit ( KSymbol * self, 
-    const String * name, uint32_t type, const void * obj);
-
-
-
-/* Whack
- *  from BSTree
- */
-KLIB_EXTERN void CC KSymbolWhack ( BSTNode *n, void *ignore );
-
-/* there is currently no need for a real Destroy function 
- * but a macro to do nothing is included for orthogonality.
- */
-#define KSymbolDestroy(s,i) ((void)0)
-
-/* Cmp
- *  compare String* against KSymbol*
- */
-KLIB_EXTERN int CC KSymbolCmp ( const void *item, const BSTNode *n );
-
-
-/* Sort
- *  compare KSymbol* against KSymbol*
- */
-KLIB_EXTERN int CC KSymbolSort ( const BSTNode *item, const BSTNode *n );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_symbol_ */
diff --git a/interfaces/klib/symtab.h b/interfaces/klib/symtab.h
deleted file mode 100644
index fd2d406..0000000
--- a/interfaces/klib/symtab.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_symtab_
-#define _h_klib_symtab_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTree;
-struct String;
-struct KSymbol;
-
-
-/*--------------------------------------------------------------------------
- * KSymTable
- *  scoped stack of BSTrees
- */
-typedef struct KSymTable KSymTable;
-struct KSymTable
-{
-    /* head of open namespace stack */
-    struct KSymbol *ns;
-
-    /* scope stack */
-    Vector stack;
-
-    /* intrinsic scope count */
-    uint32_t intrinsic;
-};
-
-
-/* Init
- *  create an empty symbol table
- *
- *  "intrinsic" [ IN, NULL OKAY ] - initial protected scope
- *  if not NULL, will be used as initial non-modifiable scope
- */
-KLIB_EXTERN rc_t CC KSymTableInit ( KSymTable *self, struct BSTree const *intrinsic );
-
-
-/* Whack
- *  must be called to clean up stack
- */
-#if NOT_MACRO
-KLIB_EXTERN void CC KSymTableWhack ( KSymTable *self );
-#endif
-#define KSymTableWhack( self ) \
-    VectorWhack ( & ( self ) -> stack, NULL, NULL )
-
-
-/* PushScope
- *  pushes a tree onto stack
- *
- *  "scope" [ IN ] - current top scope
- */
-KLIB_EXTERN rc_t CC KSymTablePushScope ( const KSymTable *self, struct BSTree *scope );
-
-
-/* PopScope
- *  removes a tree from stack
- *  noop if count <= self->intrinsic,
- *  because stack bottom will be intrinsic scope
- */
-KLIB_EXTERN void CC KSymTablePopScope ( const KSymTable *self );
-
-
-/* PushNamespace
- *  pushes a namespace scope onto stack
- */
-KLIB_EXTERN rc_t CC KSymTablePushNamespace ( const KSymTable *self, struct KSymbol *ns );
-
-
-/* PopNamespace
- */
-KLIB_EXTERN void CC KSymTablePopNamespace ( const KSymTable *self );
-
-
-/* CreateNamespace
- *  given a name, make it into a namespace,
- *
- *  "name" [ IN ] - name of namespace. if being created within
- *  another namespace, it will be linked to the parent.
- */
-KLIB_EXTERN rc_t CC KSymTableCreateNamespace ( KSymTable *self,
-    struct KSymbol **ns, struct String const *name );
-
-
-/* CreateSymbol
- *  given a name, create an object reference
- *
- *  "sym" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly created symbol, which is entered into the top scope
- *  and only returned for convenience.
- *
- *  "name" [ IN ] - symbol name. if being created within a
- *  namespace, the symbol will be linked to the parent.
- *
- *  "id" [ IN ] - if the symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - if the object has been created
- *  at the point of symbol definition, it may be provided.
- */
-KLIB_EXTERN rc_t CC KSymTableCreateSymbol ( KSymTable *self, struct KSymbol **sym,
-    struct String const *name, uint32_t id, const void *obj );
-#define KSymTableCreateConstSymbol( self, sym, name, id, obj ) \
-    KSymTableCreateSymbol ( self, ( struct KSymbol** ) ( sym ), name, id, obj )
-
-
-/* DupSymbol
- *  given a symbol, create a duplicate
- *
- *  "dup" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly created symbol, which is entered into the top scope
- *  and only returned for convenience.
- *
- *  "sym" [ IN ] - symbol to copy.
- *
- *  "id" [ IN ] - if the symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - if the object has been created
- *  at the point of symbol definition, it may be provided.
- */
-KLIB_EXTERN rc_t CC KSymTableDupSymbol ( KSymTable *self, struct KSymbol **dup,
-    struct KSymbol const *sym, uint32_t id, const void *obj );
-
-
-/* RemoveSymbol
- *  removes symbol from table
- *
- *  "sym" [ IN ] - symbol to be removed
- */
-KLIB_EXTERN rc_t CC KSymTableRemoveSymbol ( KSymTable *self, struct KSymbol const *sym );
-
-
-/* Find
- *  finds a symbol within the scope stack
- */
-KLIB_EXTERN struct KSymbol* CC KSymTableFind ( const KSymTable *self,
-    struct String const *name );
-KLIB_EXTERN struct KSymbol* CC KSymTableFindSymbol ( const KSymTable *self,
-    struct KSymbol const *sym );
-
-
-/* FindIntrinsic
- *  find an intrinsic symbol
- *  looks in stack scopes <= self->intrinsic
- */
-KLIB_EXTERN struct KSymbol* CC KSymTableFindIntrinsic ( const KSymTable *self,
-    struct String const *name );
-
-
-/* FindGlobal
- *  find a symbol at global scope
- */
-KLIB_EXTERN struct KSymbol* CC KSymTableFindGlobal ( const KSymTable *self,
-    struct String const *name );
-
-
-/* FindShallow
- *  find a symbol in top scope
- */
-KLIB_EXTERN struct KSymbol* CC KSymTableFindShallow ( const KSymTable *self,
-    struct String const *name );
-
-
-/* FindNext
- *  given a symbol that was found in nearest scope
- *  find next symbol of the same simple name in
- *  farther scopes
- *
- *  "sym" [ IN ] - previously found symbol
- *
- *  "scope" [ IN/OUT, NULL OKAY ] - if NULL or value is 0,
- *  the scope id for "sym" is dynamically located. otherwise,
- *  the value on input is used for continuing a search. on
- *  output and if not NULL, the value is set to the scope id
- *  where the returned symbol was found, or 0 if not found.
- */
-KLIB_EXTERN struct KSymbol* CC KSymTableFindNext ( const KSymTable *self,
-    struct KSymbol const *sym, uint32_t *scope );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_symtab_ */
diff --git a/interfaces/klib/text.h b/interfaces/klib/text.h
deleted file mode 100644
index 6972764..0000000
--- a/interfaces/klib/text.h
+++ /dev/null
@@ -1,498 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_text_
-#define _h_klib_text_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * String
- *  pseudo-intrinsic string
- */
-typedef struct String String;
-struct String
-{
-    const char *addr;
-    size_t size;
-    uint32_t len;
-};
-
-/* StringInit
- *  initializes a String object
- */
-#define StringInit( s, val, sz, length ) \
-    ( void ) \
-        ( ( s ) -> addr = ( val ), \
-          ( s ) -> size = ( sz ), \
-          ( s ) -> len = ( length ) )
-
-#define StringInitCString( s, cstr ) \
-    ( void ) \
-        ( ( s ) -> len = string_measure \
-          ( ( s ) -> addr = ( cstr ), & ( s ) -> size ) )
-
-/* CONST_STRING
- *  initialize a string from a manifest constant
- */
-#define CONST_STRING( s, val ) \
-    StringInit ( s, val, sizeof val - 1, sizeof val - 1 )
-
-/* StringSize
- *  size of string in bytes
- */
-#define StringSize( s ) \
-    ( s ) -> size
-
-/* StringLength
- *  length of string in characters
- */
-#define StringLength( s ) \
-    ( s ) -> len
-
-/* StringCopy
- *  allocates a copy of a string
- */
-KLIB_EXTERN rc_t CC StringCopy ( const String **cpy, const String *str );
-
-/* StringConcat
- *  concatenate one string onto another
- */
-KLIB_EXTERN rc_t CC StringConcat ( const String **cat,
-    const String *a, const String *b );
-
-/* StringSubstr
- *  creates a substring of an existing one
- *  note that the substring is always a non-allocated copy
- *  and is dependent upon the lifetime of its source
- *
- *  returns "sub" if "idx" was valid
- *  or NULL otherwise
- *
- *  "len" may be 0 to indicate infinite length
- *  or may extend beyond end of source string.
- */
-KLIB_EXTERN String* CC StringSubstr ( const String *str,
-    String *sub, uint32_t idx, uint32_t len );
-
-/* StringHead
- *  access the first character
- *
- *  this is an efficient enough function to be included.
- *  the generic functions of accessing characters by index
- *  are apt to be extremely inefficient with UTF-8, and
- *  as such are not included.
- *
- *  returns EINVAL if the character is bad,
- *  or ENODATA if the string is empty
- */
-KLIB_EXTERN rc_t CC StringHead ( const String *str, uint32_t *ch );
-
-/* StringPopHead
- *  remove and return the first character
- *
- *  returns EINVAL if the character is bad,
- *  or ENODATA if the string is empty
- */
-KLIB_EXTERN rc_t CC StringPopHead ( String *str, uint32_t *ch );
-
-/* StringEqual
- *  compare strings for equality
- *  not lexical for all characters
- */
-#define StringEqual( a, b ) \
-    ( ( a ) -> len == ( b ) -> len && \
-    memcmp ( ( a ) -> addr, ( b ) -> addr, ( a ) -> len ) == 0 )
-
-/* StringCompare
- *  compare strings for relative ordering
- *  not strictly lexical - generally orders by character code
- */
-KLIB_EXTERN int CC StringCompare ( const String *a, const String *b );
-
-/* StringCaseEqual
- *  compare strings for case-insensitive equality
- */
-KLIB_EXTERN bool CC StringCaseEqual ( const String *a, const String *b );
-
-/* StringCaseCompare
- *  compare strings for relative case-insensitive ordering
- */
-KLIB_EXTERN int CC StringCaseCompare ( const String *a, const String *b );
-
-/* StringOrder
- * StringOrderNoNullCheck
- *  compares strings as quickly as possible for
- *  deterministic ordering: first by length, then
- *  by binary ( byte-wise ) content.
- *
- *  performs more quickly than StringCompare for cases
- *  where only deterministic ordering is needed ( e.g. symbol table ).
- *
- *  the "NoNullCheck" version will crash if either a or b are NULL
- *  but avoids the overhead of checking when both are known to be good
- */
-KLIB_EXTERN int CC StringOrder ( const String *a, const String *b );
-KLIB_EXTERN int CC StringOrderNoNullCheck ( const String *a, const String *b );
-
-/* StringMatch
- *  creates a substring of "a" in "match"
- *  for all of the sequential matching characters between "a" and "b"
- *  starting from character [ 0 ].
- *
- *  returns the number of characters that match.
- */
-KLIB_EXTERN uint32_t CC StringMatch ( String *match,
-    const String *a, const String *b );
-
-/* StringMatchExtend
- *  extends a substring of "a" in "match"
- *  for all of the sequential matching characters between "a" and "b"
- *  starting from character [ match -> len ].
- *
- *  returns the number of matching characters that were extended.
- */
-KLIB_EXTERN uint32_t CC StringMatchExtend ( String *match,
-    const String *a, const String *b );
-
-/* StringHash
- *  hash value for string
- */
-#define StringHash( s ) \
-    string_hash ( ( s ) -> addr, ( s ) -> size )
-
-/* StringCopyUTF...
- *  creates a String from UTF16 or UTF32 UNICODE input
- *  wchar_t is one or the other, depending upon OS and compiler.
- */
-KLIB_EXTERN rc_t CC StringCopyUTF16 ( const String **cpy,
-    const uint16_t *text, size_t bytes );
-KLIB_EXTERN rc_t CC StringCopyUTF32 ( const String **cpy,
-    const uint32_t *text, size_t bytes );
-
-/* StringCopyWChar_t
- *  wchar_t is alternately defined as 16 or 32 bits
- */
-#define StringCopyWChar_t( cpy, text, bytes ) \
-    ( ( sizeof ( wchar_t ) == sizeof ( uint16_t ) ) ? \
-      StringCopyUTF16 ( cpy, ( const uint16_t* ) ( text ), bytes ) : \
-      StringCopyUTF32 ( cpy, ( const uint32_t* ) ( text ), bytes ) )
-
-/* StringWhack
- *  deallocates a string
- *  ignores strings not allocated by this library
- */
-KLIB_EXTERN void CC StringWhack ( const String* self );
-
-
-/*--------------------------------------------------------------------------
- * raw text strings
- *  the internal representation of text strings is implementation
- *  dependent. it is assumed to be ASCII-7 or UTF-8, although
- *  this is determined by the implementation library of these functions.
- *
- * NB - ASCII implementations are no longer being provided
- *  all text handling is UTF-8 unless explictly stated otherwise
- */
-
-/* string_size
- *  length of string in bytes
- */
-KLIB_EXTERN size_t CC string_size ( const char *str );
-
-/* string_len
- *  length of string in characters, when the size is known
- */
-KLIB_EXTERN uint32_t CC string_len ( const char *str, size_t size );
-
-/* string_measure
- *  measures length of string in both characters and bytes
- */
-KLIB_EXTERN uint32_t CC string_measure ( const char *str, size_t *size );
-
-/* string_copy
- *  copies whole character text into a buffer
- *  terminates with NUL byte if possible
- *  returns the number of bytes copied
- */
-KLIB_EXTERN size_t CC string_copy ( char *dst, size_t dst_size,
-    const char *src, size_t src_size );
-
-/* string_copy_measure
- *  copies whole character text into a buffer
- *  terminates with NUL byte if possible
- *  returns the number of bytes copied
- */
-KLIB_EXTERN size_t CC string_copy_measure ( char *dst, size_t dst_size, const char *src );
-
-/* string_dup
- *  replaces the broken C library strndup
- *  creates a NUL-terminated malloc'd string
- */
-KLIB_EXTERN char* CC string_dup ( const char *str, size_t size );
-
-/* string_dup_measure
- *  replaces the broken C library strdup
- *  creates a NUL-terminated malloc'd string
- *  returns size of string unless "size" is NULL
- */
-KLIB_EXTERN char* CC string_dup_measure ( const char *str, size_t *size );
-
-/* string_printf
- *  NOW IN <klib/printf.h>
- */
-
-/* tolower_copy
- *  copies whole character text in lower-case
- *  terminates with NUL byte if possible
- *  returns the number of bytes copied
- */
-KLIB_EXTERN size_t CC tolower_copy ( char *dst, size_t dst_size,
-    const char *src, size_t src_size );
-
-/* toupper_copy
- *  copies whole character text in upper-case
- *  terminates with NUL byte if possible
- *  returns the number of bytes copied
- */
-KLIB_EXTERN size_t CC toupper_copy ( char *dst, size_t dst_size,
-    const char *src, size_t src_size );
-
-/* string_cmp
- *  performs a safe strncmp
- *
- *  "max_chars" limits the extent of the comparison
- *  to not exceed supplied value, i.e. the number of
- *  characters actually compared will be the minimum
- *  of asize, bsize and max_chars.
- *
- *  if either string size ( or both ) < max_chars and
- *  all compared characters match, then the result will
- *  be a comparison of asize against bsize.
- */
-KLIB_EXTERN int CC string_cmp ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars );
-
-/* strcase_cmp
- *  like string_cmp except case insensitive
- */
-KLIB_EXTERN int CC strcase_cmp ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars );
-
-/* string_match
- *  returns the number of matching characters
- *
- *  "max_chars" limits the extent of the comparison
- *  to not exceed supplied value, i.e. the number of
- *  characters actually compared will be the minimum
- *  of asize, bsize and max_chars.
- *
- *  "msize" will be set to the size of the matched string
- *  if not NULL
- */
-KLIB_EXTERN uint32_t CC string_match ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars, size_t *msize );
-
-/* strcase_match
- *  like string_match except case insensitive
- */
-KLIB_EXTERN uint32_t CC strcase_match ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars, size_t *msize );
-
-/* string_chr
- *  performs a safe strchr
- *  "ch" is in UTF32
- */
-KLIB_EXTERN char* CC string_chr ( const char *str, size_t size, uint32_t ch );
-
-/* string_rchr
- *  performs a safe strrchr
- */
-KLIB_EXTERN char* CC string_rchr ( const char *str, size_t size, uint32_t ch );
-
-/* string_brk
- *  performs a safe strpbrk
- */
-#if 0
-KLIB_EXTERN char* CC string_brk ( const char *str, size_t size,
-    const char *accept, size_t asize );
-#endif
-
-/* string_rbrk
- */
-#if 0
-KLIB_EXTERN char* CC string_rbrk ( const char *str, size_t size,
-    const char *accept, size_t asize );
-#endif
-
-/* string_hash
- *  hashes a string
- */
-KLIB_EXTERN uint32_t CC string_hash ( const char *str, size_t size );
-
-/* string_idx
- *  seek an indexed character
- *
- *  the efficiency is based upon chosen internal
- *  string representation, which, when using single byte chars,
- *  is simple and efficient.
- *
- *  on the other hand, UTF-8 has a variable character width,
- *  requiring scanning of the entire string until the indexed
- *  character is found.
- */
-KLIB_EXTERN char* CC string_idx ( const char *str, size_t size, uint32_t idx );
-
-
-/*--------------------------------------------------------------------------
- * conversion between UTF-32 and UTF-8 UNICODE
- */
-
-/* utf8_utf32
- *  converts UTF-8 text to a single UTF-32 character
- *  returns the number of UTF8 bytes consumed, such that:
- *    return > 0 means success
- *    return == 0 means insufficient input
- *    return < 0 means bad input
- */
-KLIB_EXTERN int CC utf8_utf32 ( uint32_t *ch, const char *begin, const char *end );
-
-/* utf32_utf8
- *  converts a single UTF-32 character to UTF-8 text
- *  returns the number of UTF8 bytes generated, such that:
- *    return > 0 means success
- *    return == 0 means insufficient output
- *    return < 0 means bad character
- */
-KLIB_EXTERN int CC utf32_utf8 ( char *begin, char *end, uint32_t ch );
-
-
-/*--------------------------------------------------------------------------
- * support for 16 and 32-bit UTF formats
- */
-
-/* utf16_string_size/len/measure
- *  measures UTF-16 strings
- */
-KLIB_EXTERN size_t CC utf16_string_size ( const uint16_t *str );
-KLIB_EXTERN uint32_t CC utf16_string_len ( const uint16_t *str, size_t size );
-KLIB_EXTERN uint32_t CC utf16_string_measure ( const uint16_t *str, size_t *size );
-
-/* utf32_string_size/len/measure
- */
-KLIB_EXTERN size_t CC utf32_string_size ( const uint32_t *str );
-KLIB_EXTERN uint32_t CC utf32_string_len ( const uint32_t *str, size_t size );
-KLIB_EXTERN uint32_t CC utf32_string_measure ( const uint32_t *str, size_t *size );
-
-/* wchar_string_size/len/measure
- *  measures wchar_t strings
- */
-KLIB_EXTERN size_t CC wchar_string_size ( const wchar_t *str );
-KLIB_EXTERN uint32_t CC wchar_string_len ( const wchar_t *str, size_t size );
-KLIB_EXTERN uint32_t CC wchar_string_measure ( const wchar_t *str, size_t *size );
-
-/* conversion from UTF-16 to internal standard */
-KLIB_EXTERN uint32_t CC utf16_cvt_string_len ( const uint16_t *src,
-    size_t src_size, size_t *dst_size );
-KLIB_EXTERN uint32_t CC utf16_cvt_string_measure ( const uint16_t *src,
-    size_t *src_size, size_t *dst_size );
-KLIB_EXTERN size_t CC utf16_cvt_string_copy ( char *dst, size_t dst_size,
-    const uint16_t *src, size_t src_size );
-
-/* conversion from UTF-32 to internal standard */
-KLIB_EXTERN uint32_t CC utf32_cvt_string_len ( const uint32_t *src,
-    size_t src_size, size_t *dst_size );
-KLIB_EXTERN uint32_t CC utf32_cvt_string_measure ( const uint32_t *src,
-    size_t *src_size, size_t *dst_size );
-KLIB_EXTERN size_t CC utf32_cvt_string_copy ( char *dst, size_t dst_size,
-    const uint32_t *src, size_t src_size );
-
-/* conversion from wchar_t to internal standard */
-KLIB_EXTERN uint32_t CC wchar_cvt_string_len ( const wchar_t *src,
-    size_t src_size, size_t *dst_size );
-KLIB_EXTERN uint32_t CC wchar_cvt_string_measure ( const wchar_t *src,
-    size_t *src_size, size_t *dst_size );
-KLIB_EXTERN size_t CC wchar_cvt_string_copy ( char *dst, size_t dst_size,
-    const wchar_t *src, size_t src_size );
-
-/* conversion to wchar_t from internal standard */
-KLIB_EXTERN size_t CC string_cvt_wchar_copy ( wchar_t *dst, size_t dst_size,
-    const char *src, size_t src_size );
-
-/*--------------------------------------------------------------------------
- * support for ISO-8859-x 8-bit character sets
- */
-
-/* iso8859_utf32
- *  converts 8-bit text to a single UTF-32 character
- *  returns the number of 8-bit bytes consumed, such that:
- *    return > 0 means success
- *    return == 0 means insufficient input
- *    return < 0 means bad input
- */
-KLIB_EXTERN int CC iso8859_utf32 ( const uint32_t map [ 128 ],
-    uint32_t *ch, const char *begin, const char *end );
-
-/* iso8859_string_size/len/measure
- *  measures UTF-16 strings
- */
-KLIB_EXTERN size_t CC iso8859_string_size ( const uint32_t map [ 128 ],
-    const char *str );
-KLIB_EXTERN uint32_t CC iso8859_string_len ( const uint32_t map [ 128 ],
-    const char *str, size_t size );
-KLIB_EXTERN uint32_t CC iso8859_string_measure ( const uint32_t map [ 128 ],
-    const char *str, size_t *size );
-
-/* conversion from ISO-8859-x to internal standard */
-KLIB_EXTERN uint32_t CC iso8859_cvt_string_len ( const uint32_t map [ 128 ],
-    const char *src, size_t src_size, size_t *dst_size );
-KLIB_EXTERN uint32_t CC iso8859_cvt_string_measure ( const uint32_t map [ 128 ],
-    const char *src, size_t *src_size, size_t *dst_size );
-KLIB_EXTERN size_t CC iso8859_cvt_string_copy ( const uint32_t map [ 128 ],
-    char *dst, size_t dst_size, const char *src, size_t src_size );
-
-/* some externally defined character maps */
-KLIB_EXTERN_DATA const uint32_t iso8859_1 [ 128 ];
-KLIB_EXTERN_DATA const uint32_t cp1252 [ 128 ];
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_text_ */
diff --git a/interfaces/klib/time.h b/interfaces/klib/time.h
deleted file mode 100644
index 19c5959..0000000
--- a/interfaces/klib/time.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_time_
-#define _h_klib_time_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KTime_t
- *  64 bit time_t
- */
-
-
-/* Stamp
- *  current timestamp
- */
-KLIB_EXTERN KTime_t CC KTimeStamp ( void );
-
-
-/*--------------------------------------------------------------------------
- * KTime
- *  simple time structure
- */
-typedef struct KTime KTime;
-struct KTime
-{
-    uint32_t year;        /* full year                                */
-    uint16_t month;       /* 0 .. 11                                  */
-    uint16_t day;         /* 0 .. 30                                  */
-    uint16_t weekday;     /* 0 .. 6 : 0 is Sunday                     */
-    int16_t tzoff;        /* -719 .. +719 minutes from Prime Meridian */
-    uint8_t hour;         /* 0 .. 23                                  */
-    uint8_t minute;       /* 0 .. 59                                  */
-    uint8_t second;       /* 0 .. 60 :  60 used for leap seconds      */
-    bool dst;             /* true if Daylight Savings Time in effect  */
-};
-
-
-/* Local
- *  populate "kt" from "ts" in local time zone
- */
-KLIB_EXTERN const KTime* CC KTimeLocal ( KTime *kt, KTime_t ts );
-
-
-/* Global
- *  populate "kt" from "ts" in GMT
- */
-KLIB_EXTERN const KTime* CC KTimeGlobal ( KTime *kt, KTime_t ts );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_klib_time_ */
diff --git a/interfaces/klib/token.h b/interfaces/klib/token.h
deleted file mode 100644
index 80bf714..0000000
--- a/interfaces/klib/token.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_token_
-#define _h_klib_token_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSymbol;
-
-
-/*--------------------------------------------------------------------------
- * KTokenText
- *  named text
- *
- *  it's likely that the name will need to become a refcounted object...
- */
-typedef struct KTokenText KTokenText;
-struct KTokenText
-{
-    String str;
-    String path;
-
-    rc_t ( CC * read ) ( void *self, KTokenText *tt, size_t save );
-    void *data;
-};
-
-
-/* Init
- *  initialize structure
- */
-#define KTokenTextInit( tt, text, fpath ) \
-    ( void ) ( ( tt ) -> str = * ( text ), \
-               ( tt ) -> path = * ( fpath ), \
-               ( tt ) -> read = NULL, \
-               ( tt ) -> data = NULL )
-#ifndef KTokenTextInit
-KLIB_EXTERN void CC KTokenTextInit ( KTokenText *tt, const String *text, const String *path );
-#endif
-
-#define KTokenTextInitCString( tt, text, fpath ) \
-    ( void ) ( StringInitCString ( & ( tt ) -> str, text ), \
-               StringInitCString ( & ( tt ) -> path, fpath ), \
-               ( tt ) -> read = NULL, \
-               ( tt ) -> data = NULL )
-#ifndef KTokenTextInitCString
-KLIB_EXTERN void CC KTokenTextInitCString ( KTokenText *tt, const char *text, const char *path );
-#endif
-
-/*--------------------------------------------------------------------------
- * KTokenID
- *  pre-defined ids for text tokens
- *  not every tokenizer will return all tokens
- */
-enum KTokenID
-{
-    eEndOfInput, eUnrecognized, eUntermComment,
-
-    /* space separators */
-    eWhiteSpace, eEndOfLine,
-
-    /* numeric */
-    eDecimal, eHex, eOctal, eFloat, eExpFloat, eMajMinRel,
-
-    /* string */
-    eUntermString, eString, eUntermEscapedString, eEscapedString,
-
-    /* names */
-    eIdent, eName,
-
-    /* punctuation */
-    ePeriod, eComma, eColon, eSemiColon, eQuestion, eTilde, eExclam,
-    eAtSign, eHash, eDollar, ePercent, eCaret, eAmpersand, eAsterisk,
-    ePlus, eMinus, eAssign, eFwdSlash, eBackSlash, ePipe,
-
-    /* paired punctuation */
-    eLeftParen, eRightParen,
-    eLeftCurly, eRightCurly,
-    eLeftAngle, eRightAngle,
-    eLeftSquare, eRightSquare,
-
-    /* compound tokens */
-    eDblPeriod, eDblColon, eEllipsis, eLogAnd, eLogOr,
-    eEqual, eNotEqual, eColonAssign, ePlusAssign, eOverArrow,
-
-    eDblLeftAngle, eDblRightAngle,
-    eDblLeftSquare, eDblRightSquare,
-
-    /* first free id */
-    eNumTokenIDs,
-
-    /* namespace type - needed by KSymTable */
-    eNamespace = eNumTokenIDs,
-    eNumSymtabIDs
-};
-
-
-/*--------------------------------------------------------------------------
- * KToken
- *  a string with an id and source information
- */
-typedef struct KToken KToken;
-struct KToken
-{
-    const KTokenText *txt;
-    struct KSymbol *sym;
-    String str;
-    uint32_t id;
-    uint32_t lineno;
-};
-
-
-/* conversion operators
- *  since the constants have a type id, the entire token is used
- */
-KLIB_EXTERN rc_t CC KTokenToI32 ( const KToken *self, int32_t *i );
-KLIB_EXTERN rc_t CC KTokenToU32 ( const KToken *self, uint32_t *i );
-KLIB_EXTERN rc_t CC KTokenToI64 ( const KToken *self, int64_t *i );
-KLIB_EXTERN rc_t CC KTokenToU64 ( const KToken *self, uint64_t *i );
-KLIB_EXTERN rc_t CC KTokenToF64 ( const KToken *self, double *d );
-KLIB_EXTERN rc_t CC KTokenToVersion ( const KToken *self, uint32_t *v );
-KLIB_EXTERN rc_t CC KTokenToString ( const KToken *self, char *buffer, size_t bsize, size_t *size );
-KLIB_EXTERN rc_t CC KTokenToWideString ( const KToken *self, uint32_t *buffer, uint32_t blen, uint32_t *len );
-
-
-/*--------------------------------------------------------------------------
- * KTokenSource
- *  a modifiable source of tokens
- */
-typedef struct KTokenSource KTokenSource;
-struct KTokenSource
-{
-    const KTokenText *txt;
-    String str;
-    uint32_t lineno;
-};
-
-/* Init
- */
-#define KTokenSourceInit( self, tt ) \
-    ( void ) ( ( self ) -> str = ( tt ) -> str, \
-               ( self ) -> txt = ( tt ), \
-               ( self ) -> lineno = 1 )
-#ifndef KTokenSourceInit
-KLIB_EXTERN void CC KTokenSourceInit ( KTokenSource *self, const KTokenText *txt );
-#endif
-
-/* Return
- *  returns token to source
- */
-KLIB_EXTERN void CC KTokenSourceReturn ( KTokenSource *self, const KToken *t );
-
-
-/* Consume
- *  consumes all remaining data
- */
-KLIB_EXTERN void CC KTokenSourceConsume ( KTokenSource *self );
-
-
-/* Avail
- *  the number of characters available
- */
-#define KTokenSourceAvail( self ) \
-    ( ( ( const KTokenSource* ) ( self ) ) -> str . len )
-#ifndef KTokenSourceAvail
-KLIB_EXTERN uint32_t CC KTokenSourceAvail ( const KTokenSource *self );
-#endif
-
-/*--------------------------------------------------------------------------
- * KTokenizer
- *  an encapsulation of the tokenizer code
- */
-typedef struct KTokenizer KTokenizer;
-
-
-/* Next
- *  scan for next token
- *
- *  "src" [ IN ] - source of token text
- *
- *  "t" [ OUT ] - scanned token
- *
- *  returns a pointer to "t" for convenience
- */
-KLIB_EXTERN KToken* CC KTokenizerNext ( const KTokenizer *self, KTokenSource *src, KToken *t );
-
-
-/* kDefaultTokenizer
- *  a constant KTokenizer* to obtain default behavior
- */
-#define kDefaultTokenizer ( ( const KTokenizer* ) 0 )
-
-
-/* kLineTokenizer
- *  behaves like default tokenizer
- *  except that eEndOfLine tokens are returned
- */
-#define kLineTokenizer ( ( const KTokenizer* ) 1 )
-
-
-/* kPOSIXPathTokenizer
- *  tokenizes a POSIX path string
- */
-#define kPOSIXPathTokenizer ( ( const KTokenizer* ) 2 )
-
-/* kKfgTokenizer
- * tokenizes a KFG config file 
- * with its name value pairs and comments
- */
-#define kKfgTokenizer  ( ( const KTokenizer* ) 3 )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_token_ */
diff --git a/interfaces/klib/trie.h b/interfaces/klib/trie.h
deleted file mode 100644
index 0532c6a..0000000
--- a/interfaces/klib/trie.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_trie_
-#define _h_klib_trie_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * TNode
- *  a node within trie
- */
-typedef struct TNode TNode;
-struct TNode
-{
-    BSTNode n;
-    String key;
-};
-
-/* TNodeMake
- *  creates a TNode of variable size
- *
- *  "n" will contain the returned node
- *
- *  "size" must be at least the size of a TNode
- */
-KLIB_EXTERN rc_t CC TNodeMake ( TNode **n, size_t size );
-
-/* TNodeWhack
- *  performs final whacking of node
- */
-KLIB_EXTERN void CC TNodeWhack ( TNode *self );
-
-
-/*--------------------------------------------------------------------------
- * Trie
- *  a tree of text nodes
- *
- *  this is a collection of { key, value } pairs, where a many-value
- *  to one key paradigm is naturally supported, as in the b-tree.
- *
- *  the desired insertion operations are:
- *   a) key -> value
- *   b) key -> { value, ... }
- *
- *  the desired retrieval operations are:
- *   a) key -> value
- *   b) key -> { value, ... }
- *   c) RE -> key : value
- *   d) RE -> { key : value, ... }
- *   e) iteration across { key : value, ... }
- *
- *  the reverse retrieval operation is externally managed by virtue of
- *  externalization of the TNode, which bundles together key and value.
- *  any external mechanism allowing access to the TNode will perform a
- *  reverse lookup.
- */
-typedef struct Trie Trie;
-struct Trie
-{
-    /* root node in the tree */
-    struct TTrans *root;
-
-    /* forward and reverse UTF-32 character maps */
-    const uint16_t *map;
-    const uint32_t *rmap;
-
-    /* range of acceptable UTF-32 input characters */
-    uint32_t first_char;
-    uint32_t last_char;
-
-    /* width of transition array */
-    uint16_t width;
-
-    /* limit to the number of values */
-    uint16_t limit;
-
-    /* automatically expand character set */
-    uint8_t cs_expand;
-
-#if _DEBUGGING
-    /* post-validate tree after every insert */
-    uint8_t validate;
-
-    uint8_t align1 [ 2 ];
-#else
-    uint8_t align1 [ 3 ];
-#endif
-};
-
-/* TrieInit
- *  initialize a text-tree structure
- *
- *  "accept" [ IN ] -  a character-set string where each character
- *  represents itself. the only exception is the '-' character,
- *  which - when sandwiched between two other characters - is
- *  interpreted en tot as a range expression. an example would be
- *  "-0-9" is identical to "-0123456789"
- *
- *  "limit" [ IN ] - sets the number of values to be accumulated in
- *  any container. if this limit would be exceeded by any insertion,
- *  the node is expanded and its values are re-distributed among
- *  its children.
- *
- *  "cs_expand" [ IN ] - if true, then any valid characters observed
- *  during insertions are automatically added to the accept character
- *  set. doing so will ensure that there are no ambiguous transitions.
- *
- *  returns status codes:
- *    EINVAL => an invalid parameter
- *    ENOMEM => failed to allocate internal structures
- */
-KLIB_EXTERN rc_t CC TrieInit ( Trie *tt, const char *accept,
-    uint32_t limit, bool cs_expand );
-
-/* TrieInsert
- *  inserts an item into tree
- *
- *  "item" [ IN ] -  a TNode forming the { key, value } pair.
- *
- *  returns status codes:
- *    EINVAL => an invalid parameter
- *    ENOMEM => failed to allocate internal structures
- */
-KLIB_EXTERN rc_t CC TrieInsert ( Trie *self, TNode *item );
-
-/* TrieInsertUnique
- *  behaves like TrieInsert if the key does not already have an
- *  associated value. fails otherwise, returning the existing node.
- *
- *  "item" [ IN ] - { key, value } pair
- *
- *  "exist" [ OUT, NULL OKAY ] - return parameter for existing node
- *  if insert failed due to unique constraint. NULL otherwise.
- *
- *  returns status codes:
- *    EINVAL => an invalid parameter
- *    EEXIST => the key is already bound to a value
- *    ENOMEM => failed to allocate internal structures
- */
-KLIB_EXTERN rc_t CC TrieInsertUnique ( Trie *self, TNode *item, TNode **exist );
-
-/* TrieUnlink
- *  remove an object from the tree
- *
- *  "item" [ IN ] - an actual TNode presumed to be held within tree.
- *
- *  return value:
- *    true  => node belonged to tree and was removed
- *    false => node does not belong to tree
- */
-KLIB_EXTERN bool CC TrieUnlink ( Trie *self, TNode *item );
-
-/* TrieValidate
- *  run validation check on tree structure
- *
- *  return status codes:
- *    ?
- *
- * TEMPORARY
- */
-#if 0
-KLIB_EXTERN int CC TrieValidate ( const Trie *self );
-#endif
-
-/* TrieFind
- * TrieFindRE
- *  find a single object within tree
- *
- *  "key" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  return value:
- *    NULL    => no match
- *    TNode* => arbitrarily chosen matching node
- */
-KLIB_EXTERN TNode* CC TrieFind ( const Trie *self, const String *key );
-#if 0
-KLIB_EXTERN TNode* CC TrieFindRE ( const Trie *self, const String *re );
-#endif
-
-/* TrieFindAll
- * TrieFindAllRE
- *  find multiple objects within tree
- *
- *  "key" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  "buffer" [ OUT ] and "capacity" [ IN ] - a user-supplied
- *  array of TNode* with a capacity of "capacity" elements.
- *  if successful, the entire found set will be returned unordered within.
- *
- *  "num_found" [ OUT ] - indicates the size of the found set,
- *  regardless of return value, such that if the supplied
- *  buffer were to be too small, the required size is returned.
- *
- *  returns status codes:
- *    EINVAL  => an invalid parameter
- *    ENOENT  => the found set was empty
- *    ENOBUFS => the found set was too large
- */
-KLIB_EXTERN rc_t CC TrieFindAll ( const Trie *self, const String *key,
-    TNode *buffer [], uint32_t capacity, uint32_t *num_found );
-#if 0
-KLIB_EXTERN rc_t CC TrieFindAllRE ( const Trie *self, const String *re,
-    TNode *buffer [], uint32_t capacity, uint32_t *num_found );
-#endif
-
-/* TrieForEach
- *  executes a function on each tree element
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TNode in the tree
- */
-KLIB_EXTERN void CC TrieForEach ( const Trie *self,
-    void ( CC * f ) ( TNode *n, void *data ), void *data );
-
-/* TrieDoUntil
- *  executes a function on each tree element
- *  until the function returns true
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TNode in the tree. the function returns "true"
- *  to halt iteration.
- *
- *  return values:
- *    the last value returned by "f" or false if never invoked
- */
-KLIB_EXTERN bool CC TrieDoUntil ( const Trie *self,
-    bool ( CC * f ) ( TNode *n, void *data ), void *data );
-
-/* TrieExplore
- *  executes a function on each element in the path of the key
- *  from furthest node to closest node
- *  until the function returns true or end of chain
- */
-KLIB_EXTERN bool CC TrieExplore ( const Trie *self, const String *key,
-    bool ( CC * f ) ( TNode *n, void *data ), void *data );
-
-/* TrieWhack
- *  tears down internal structure
- *
- *  "whack" [ IN, NULL OKAY ] and "data" [ IN ] - optional function
- *  to be invoked on TNode objects contained within. if NULL, the
- *  nodes will be whacked via "TNodeWhack"
- */
-KLIB_EXTERN void CC TrieWhack ( Trie *self,
-    void ( CC * whack ) ( TNode *n, void *data ), void *data );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_trie_ */
diff --git a/interfaces/klib/vector.h b/interfaces/klib/vector.h
deleted file mode 100644
index be72b90..0000000
--- a/interfaces/klib/vector.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_vector_
-#define _h_klib_vector_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KVector
- *  encapsulated vector interface
- *
- *  a vector obeys a particular set of messages
- *  it may be implemented as an array, but not necessarily.
- *
- *  the principal property of a vector is that it acts as a map
- *  between an integer key and a value of some type. in this case,
- *  we only accept unsigned integers as keys.
- */
-typedef struct KVector KVector;
-
-
-/* Make
- *  create an empty vector
- */
-KLIB_EXTERN rc_t CC KVectorMake ( KVector **v );
-
-
-/* AddRef
- * Release
- */
-KLIB_EXTERN rc_t CC KVectorAddRef ( const KVector *self );
-KLIB_EXTERN rc_t CC KVectorRelease ( const KVector *self );
-
-
-/* Get
- *  get an untyped value
- *  returns rc_t state of rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- *
- *  "value_buffer" [ OUT ] and "bsize" [ IN ] - return buffer for value
- *
- *  "bytes" [ OUT ] - return parameter for bytes in value
- *
- * NB - if rc_t state is rcInsufficient, "bytes" will contain
- *  the number of bytes required to access the indexed value
- */
-KLIB_EXTERN rc_t CC KVectorGet ( const KVector *self, uint64_t key,
-    void *value_buffer, size_t bsize, size_t *bytes );
-
-/* Get
- *  get typed values
- *  returns rc_t state of rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- *
- *  "value" [ OUT ] - return parameter for value
- */
-KLIB_EXTERN rc_t CC KVectorGetBool ( const KVector *self, uint64_t key, bool *value );
-
-KLIB_EXTERN rc_t CC KVectorGetI8 ( const KVector *self, uint64_t key, int8_t *value );
-KLIB_EXTERN rc_t CC KVectorGetI16 ( const KVector *self, uint64_t key, int16_t *value );
-KLIB_EXTERN rc_t CC KVectorGetI32 ( const KVector *self, uint64_t key, int32_t *value );
-KLIB_EXTERN rc_t CC KVectorGetI64 ( const KVector *self, uint64_t key, int64_t *value );
-
-KLIB_EXTERN rc_t CC KVectorGetU8 ( const KVector *self, uint64_t key, uint8_t *value );
-KLIB_EXTERN rc_t CC KVectorGetU16 ( const KVector *self, uint64_t key, uint16_t *value );
-KLIB_EXTERN rc_t CC KVectorGetU32 ( const KVector *self, uint64_t key, uint32_t *value );
-KLIB_EXTERN rc_t CC KVectorGetU64 ( const KVector *self, uint64_t key, uint64_t *value );
-
-KLIB_EXTERN rc_t CC KVectorGetF32 ( const KVector *self, uint64_t key, float *value );
-KLIB_EXTERN rc_t CC KVectorGetF64 ( const KVector *self, uint64_t key, double *value );
-
-KLIB_EXTERN rc_t CC KVectorGetPtr ( const KVector *self, uint64_t key, void **value );
-
-
-/* Set
- *  set an untyped value
- *
- *  "key" [ IN ] - vector index
- *
- *  "value" [ IN ] and "bytes" [ IN ] - value buffer
- */
-KLIB_EXTERN rc_t CC KVectorSet ( KVector *self, uint64_t key,
-    const void *value, size_t bytes );
-
-/* Set
- *  set typed values
- *
- *  "key" [ IN ] - vector index
- *
- *  "data" [ IN ] - value
- */
-KLIB_EXTERN rc_t CC KVectorSetBool ( KVector *self, uint64_t key, bool value );
-
-KLIB_EXTERN rc_t CC KVectorSetI8 ( KVector *self, uint64_t key, int8_t value );
-KLIB_EXTERN rc_t CC KVectorSetI16 ( KVector *self, uint64_t key, int16_t value );
-KLIB_EXTERN rc_t CC KVectorSetI32 ( KVector *self, uint64_t key, int32_t value );
-KLIB_EXTERN rc_t CC KVectorSetI64 ( KVector *self, uint64_t key, int64_t value );
-
-KLIB_EXTERN rc_t CC KVectorSetU8 ( KVector *self, uint64_t key, uint8_t value );
-KLIB_EXTERN rc_t CC KVectorSetU16 ( KVector *self, uint64_t key, uint16_t value );
-KLIB_EXTERN rc_t CC KVectorSetU32 ( KVector *self, uint64_t key, uint32_t value );
-KLIB_EXTERN rc_t CC KVectorSetU64 ( KVector *self, uint64_t key, uint64_t value );
-
-KLIB_EXTERN rc_t CC KVectorSetF32 ( KVector *self, uint64_t key, float value );
-KLIB_EXTERN rc_t CC KVectorSetF64 ( KVector *self, uint64_t key, double value );
-
-KLIB_EXTERN rc_t CC KVectorSetPtr ( KVector *self, uint64_t key, const void *value );
-
-
-/* Unset
- *  unset an entry
- *  returns rc_t state rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- */
-KLIB_EXTERN rc_t CC KVectorUnset ( KVector *self, uint64_t key );
-
-
-/* Visit
- *  executes a function on each key/value pair
- *  returns early if "f" returns non-zero rc_t
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "user_data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element or until the function
- *  returns true.
- */
-KLIB_EXTERN rc_t CC KVectorVisit ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, const void *value, size_t bytes, void *user_data ),
-    void *user_data );
-
-/* Visit
- *  visit typed values
- *  returns early if "f" returns non-zero rc_t
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "user_data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element or until the function
- *  returns true.
- */
-KLIB_EXTERN rc_t CC KVectorVisitBool ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, bool value, void *user_data ),
-    void *user_data );
-KLIB_EXTERN rc_t CC KVectorVisitI64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, int64_t value, void *user_data ),
-    void *user_data );
-KLIB_EXTERN rc_t CC KVectorVisitU64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, uint64_t value, void *user_data ),
-    void *user_data );
-KLIB_EXTERN rc_t CC KVectorVisitF64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, double value, void *user_data ),
-    void *user_data );
-KLIB_EXTERN rc_t CC KVectorVisitPtr ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, const void *value, void *user_data ),
-    void *user_data );
-
-
-
-/*--------------------------------------------------------------------------
- * Vector
- *  simple vector of void*
- */
-typedef struct Vector Vector;
-struct Vector
-{
-    void **v;
-    uint32_t start;
-    uint32_t len;
-    uint32_t mask;
-};
-
-/* Init
- *  initialize vector
- *
- *  "start" [ IN ] - initial index to vector, normally 0
- *
- *  "block" [ IN ] - selects the number of elements in
- *  a vector block; used for allocating and extending
- */
-KLIB_EXTERN void CC VectorInit ( Vector *self, uint32_t start, uint32_t block );
-
-
-/* Copy
- *  initialize a new vector from an existing one
- *  performs a shallow copy
- */
-KLIB_EXTERN rc_t CC VectorCopy ( const Vector *self, Vector *copy );
-
-
-/* Start
- *  returns the starting index
- */
-#define VectorStart( self ) \
-    ( * ( const uint32_t* ) & ( ( self ) -> start ) )
-
-
-/* Length
- *  return the vector length
- */
-#define VectorLength( self ) \
-    ( * ( const uint32_t* ) & ( ( self ) -> len ) )
-
-
-/* Block
- *  return the vector expansion block size
- */
-#define VectorBlock( self ) \
-    ( * ( const uint32_t* ) & ( ( self ) -> mask ) + 1 )
-
-
-/* Get
- *  retrieve an indexed element
- */
-KLIB_EXTERN void* CC VectorGet ( const Vector *self, uint32_t idx );
-
-
-/* Set
- *  sets an indexed element
- *  extends vector as required
- *
- *  "idx" [ IN ] - item index
- *
- *  "item" [ IN, OPAQUE ] - item to be appended to vector
- *
- *  returns rcExists if element is not NULL
- */
-KLIB_EXTERN rc_t CC VectorSet ( Vector *self, uint32_t idx, const void *item );
-
-
-/* Swap
- *  swaps value of an indexed element
- *  behaves like Set except that it allows overwrite
- *
- *  "idx" [ IN ] - item index
- *
- *  "item" [ IN, OPAQUE ] - new element value
- *
- *  "prior" [ OUT ] - prior element value
- */
-KLIB_EXTERN rc_t CC VectorSwap ( Vector *self, uint32_t idx,
-    const void *item, void **prior );
-
-
-/* Append
- *  appends item to end of vector
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "item" [ IN, OPAQUE ] - item to be appended to vector
- */
-KLIB_EXTERN rc_t CC VectorAppend ( Vector *self, uint32_t *idx, const void *item );
-
-
-/* First
- * Last
- *  get item at either end of vector
- */
-KLIB_EXTERN void* CC VectorFirst ( const Vector *self );
-KLIB_EXTERN void* CC VectorLast ( const Vector *self );
-
-
-/* Find
- *  find an object within ordered vector
- *
- *  "key" [ IN ] - find criteria
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "cmp" [ IN ] - comparison function that returns
- *  equivalent of "key" - "n"
- */
-KLIB_EXTERN void* CC VectorFind ( const Vector *self, const void *key, uint32_t *idx,
-    int ( CC * cmp ) ( const void *key, const void *n ) );
-
-
-/* Insert
- *  insert an object to vector, even if duplicate
- *
- *  "item" [ IN ] - object to insert
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- */
-KLIB_EXTERN rc_t CC VectorInsert ( Vector *self, const void *item, uint32_t *idx,
-    int ( CC * sort ) ( const void *item, const void *n ) );
-
-
-/* InsertUnique
- *  insert an object to vector, but only if unique.
- *
- *  "item" [ IN ] - object to insert
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for
- *  item index. when return code state is rcExists, this value
- *  will be that of the existing item.
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- */
-KLIB_EXTERN rc_t CC VectorInsertUnique ( Vector *self, const void *item, uint32_t *idx,
-    int ( CC * sort ) ( const void *item, const void *n ) );
-
-
-/* Merge
- *  merge a sorted vector into an existing, sorted vector
- *
- *  "unique" [ IN ] - eliminate duplicates if true
- *
- *  "v" [ IN ] - sorted vector of elements to merge
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- */
-KLIB_EXTERN rc_t CC VectorMerge ( Vector *self, bool unique, const Vector *v,
-    int ( CC * sort ) ( const void *item, const void *n ) );
-
-
-/* Remove
- *  retrieves value at given index
- *  shifts all elements to right of index toward start,
- *  preserving order and decrements length by 1
- *  return removed item
- *
- *  "idx" [ IN ] - item index
- *
- *  "removed" [ OUT ] - removed element value
- */
-KLIB_EXTERN rc_t CC VectorRemove ( Vector *self, uint32_t idx, void **removed );
-
-
-/* Reorder
- *  execute ksort on vector with provided function
- */
-KLIB_EXTERN void CC VectorReorder ( Vector *self,
-    int ( CC * cmp ) ( const void**, const void**, void *data ), void *data );
-
-
-/* ForEach
- *  executes a function on each vector element
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element
- */
-KLIB_EXTERN void CC VectorForEach ( const Vector *self, bool reverse,
-    void ( CC * f ) ( void *item, void *data ), void *data );
-
-
-/* DoUntil
- *  executes a function on each element
- *  until the function returns true
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element or until the function
- *  returns true.
- *
- *  return values:
- *    false unless "f" returns true
- */
-KLIB_EXTERN bool CC VectorDoUntil ( const Vector *self, bool reverse,
-    bool ( CC * f ) ( void *item, void *data ), void *data );
-
-
-/* Whack
- *  removes entries from vector and
- *  executes a user provided destructor
- */
-KLIB_EXTERN void CC VectorWhack ( Vector *self,
-    void ( CC * whack ) ( void *item, void *data ), void *data );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_vector_ */
diff --git a/interfaces/klib/vlen-encode.h b/interfaces/klib/vlen-encode.h
deleted file mode 100644
index c6527dc..0000000
--- a/interfaces/klib/vlen-encode.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_klib_vlen_encode_
-#define _h_klib_vlen_encode_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*****************************************************************************
- * This encoding is very similar to X.690's BER and/or Perl's pack('w').
- * It differs in that it handles signed values.
- * It uses bit 6 (of 7..0) of the first byte to store the sign.
- * The layout of bits from 7 to 0, from MSB to LSB is
- *  CSXXXXXX(CXXXXXXX)*
- * where:
- *  C is the continuation flag
- *  S is the sign flag, and
- *  X are the digits of the absolute value of the encoded number.
- * Thus a number x: |x| <
- *  0x40 is encoded in 1 byte,
- *  0x2000 in 2,
- *  0x80000000000000 (i.e. a 55 bit number) in 8, etc.
- * The worst case requires 10 bytes to encode.
- */
-
-/*****************************************************************************
- * encode 1 value into buffer
- *
- * Parameters:
- *  dst, dsize: buffer to write into of length dsize, can be null, 0
- *  act_size: (optional) number of bytes needed to encode
- *  x: the value to encode
- */
-KLIB_EXTERN rc_t CC vlen_encode1 ( void *dst, uint64_t dsize, uint64_t *act_size, int64_t x );
-
-/*****************************************************************************
- * encode array into buffer
- *
- * Parameters:
- *  dst, dsize: buffer to write into of length dsize, can be null, 0
- *  act_size: (optional) number of bytes needed to encode
- *  x, xcount: the array of xcount elements to encode
- */
-KLIB_EXTERN rc_t CC vlen_encode ( void *dst, uint64_t dsize, uint64_t *act_size, 
-        const int64_t x[], uint32_t xcount );
-
-/*****************************************************************************
- * decode 1 value from buffer
- *
- * Parameters:
- *  y: result
- *  src, ssize: buffer to read from of length ssize
- *  consumed: (optional) number of bytes used from src
- */
-KLIB_EXTERN rc_t CC vlen_decode1 ( int64_t *y, const void *src,
-        uint64_t ssize, uint64_t *consumed );
-
-/*****************************************************************************
- * decode array from buffer
- *
- * Parameters:
- *  y, count: result array of ycount elements
- *  src, ssize: buffer to read from of length ssize
- *  consumed: (optional) number of bytes used from src
- */
-KLIB_EXTERN rc_t CC vlen_decode ( int64_t *y, uint64_t ycount, const void *src,
-        uint64_t ssize, uint64_t *consumed );
-
-
-/*****************************************************************************
- * This encoding is very similar to X.690's BER and/or Perl's pack('w').
- * The layout of bits from 7 to 0, from MSB to LSB is
- *  CXXXXXXX(CXXXXXXX)*
- * where:
- *  C is the continuation flag
- *  X are the digits of the encoded number.
- * The worst case requires 10 bytes to encode.
- */
-
-/*****************************************************************************
- * encode 1 value into buffer
- *
- * Parameters:
- *  dst, dsize: buffer to write into of length dsize, can be null, 0
- *  act_size: (optional) number of bytes needed to encode
- *  x: the value to encode
- */
-KLIB_EXTERN rc_t CC vlen_encodeU1 ( void *dst, uint64_t dsize,
-        uint64_t *act_size, uint64_t x );
-
-/*****************************************************************************
- * encode array into buffer
- *
- * Parameters:
- *  dst, dsize: buffer to write into of length dsize, can be null, 0
- *  act_size: (optional) number of bytes needed to encode
- *  x, xcount: the array of xcount elements to encode
- */
-KLIB_EXTERN rc_t CC vlen_encodeU ( void *dst, uint64_t dsize, uint64_t *act_size,
-        const uint64_t x[], uint32_t xcount );
-
-/*****************************************************************************
- * decode 1 value from buffer
- *
- * Parameters:
- *  y: result
- *  src, ssize: buffer to read from of length ssize
- *  consumed: (optional) number of bytes used from src
- */
-KLIB_EXTERN rc_t CC vlen_decodeU1 ( uint64_t *y, const void *src, 
-        uint64_t ssize, uint64_t *consumed );
-
-/*****************************************************************************
- * decode array from buffer
- *
- * Parameters:
- *  y, count: result array of ycount elements
- *  src, ssize: buffer to read from of length ssize
- *  consumed: (optional) number of bytes used from src
- */
-KLIB_EXTERN rc_t CC vlen_decodeU ( uint64_t *y, uint64_t ycount, const void *src, 
-        uint64_t ssize, uint64_t *consumed );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_vlen_encode_ */
diff --git a/interfaces/klib/writer.h b/interfaces/klib/writer.h
deleted file mode 100644
index 4c8c175..0000000
--- a/interfaces/klib/writer.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_klib_writer_
-#define _h_klib_writer_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_logfmt_
-#include <klib/logfmt.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* ----------
- * The writer module (which contains the log, status, out, and debug sub-modules)
- * is an ecapsulation and virtualization of standard output.
- *
- *  this logging API - like most others - attempts to remain isolated
- *  from any actual logging implementation, such that output may be
- *  routed in several ways.
- *
- *  the default handler
- *
- *  the path from unstructured text to formatted XML is difficult in that
- *  it requires parsing, and is therefore error prone.
- *
- *  the path from structured reports to XML as well as less or unstructured
- *  text is simple to implement, but generally more of a burden to use.
- *
- *  the challenge is therefore to present an API that makes structured
- *  logging less painful than it might be.
- *
- *
- * There are two parts with an unfortunate legacy quirky combination.
- *  There is a formater that will be shared by all sub-modules.
- *  There is the actual stream writer.
- *
- * Each submodule will have one or more calls that call the formatter and writer functions.
- */
-KLIB_EXTERN rc_t CC KWrtInit ( const char * appname, uint32_t vers );
-
-/* -----
- * The writer module core file/stream output function:
- *
- * The function's prototype matches as much as possible the KFS file writer prototype.
- *
- * If the self structure contained a KFile * and a position it could use the KFS file write
- */
-
-typedef rc_t ( CC * KWrtWriter ) ( void * self, const char * buffer, size_t bufsize, size_t * num_writ );
-
-/* ----
- * a Writer handler combines the function and its self object
- */
-typedef struct KWrtHandler
-{
-    KWrtWriter writer;
-    void *     data;    /* the actual type depends upon the writer function */
-} KWrtHandler;
-
-
-/*--------------------------------------------------------------------------
- * nvp - name/value pair
- */
-typedef struct wrt_nvp_t_struct {
-    const char *name;
-    const char *value;
-} wrt_nvp_t;
-
-KLIB_EXTERN void CC wrt_nvp_sort(size_t argc, wrt_nvp_t argv[]);
-KLIB_EXTERN const wrt_nvp_t* CC wrt_nvp_find( size_t argc, const wrt_nvp_t argv[], const char* key );
-KLIB_EXTERN const char* CC wrt_nvp_find_value( size_t argc, const wrt_nvp_t argv[], const char* key );
-
-/* -----
- * The formatter module core file/stream output function:
- *
- */
-
-typedef rc_t ( CC * KFmtWriter ) ( void* self, KWrtHandler* writer,
-                                   size_t argc, const wrt_nvp_t args[],
-                                   size_t envc, const wrt_nvp_t envs[]);
-/* ----
- * a formatter handler combines the function and custom data
- */
-typedef struct KFmtHandler KFmtHandler;
-struct KFmtHandler
-{
-    KFmtWriter formatter;
-    void* data;    /* the actual type depends upon the writer function */
-};
-
-
-/* kprintf
- *  performs a printf to our output writer
- */
-KLIB_EXTERN rc_t CC kprintf ( size_t *num_writ, const char * fmt, ... );
-KLIB_EXTERN rc_t CC vkprintf ( size_t *num_writ, const char * fmt, va_list args );
-
-
-/* kfprintf
- *  performs a printf to a KWrtHandler
- */
-KLIB_EXTERN rc_t CC kfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char * fmt, ... );
-KLIB_EXTERN rc_t CC vkfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char * fmt, va_list args );
-
-
-/* RCExplain
- *  explains rc code in "English'ish" language
- */
-KLIB_EXTERN rc_t CC RCExplain ( rc_t rc, char *buffer, size_t bsize, size_t *num_writ );
-
-KLIB_EXTERN rc_t CC LogInsertSpace(const char *spacer, char *buffer, size_t bsize, size_t *num_writ);
-
-/* generates a timestamp-string in GMT-time */
-KLIB_EXTERN rc_t CC LogTimestamp ( char *buffer, size_t bsize, size_t *num_writ );
-
-/* generates a timestamp-string in local time */
-KLIB_EXTERN rc_t CC LogSimpleTimestamp ( char *buffer, size_t bsize, size_t *num_writ );
-
-KLIB_EXTERN rc_t CC LogPID ( char *buffer, size_t bsize, size_t *num_writ );
-KLIB_EXTERN rc_t CC LogAppName ( char *buffer, size_t bsize, size_t *num_writ );
-KLIB_EXTERN rc_t CC LogAppVersion ( char *buffer, size_t bsize, size_t *num_writ );
-
-/* FlushLine
- *  flushes a buffer through output handler
- */
-KLIB_EXTERN rc_t CC LogFlush ( const KWrtHandler * handler, const char *buffer, const size_t bsize );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_klib_writer_ */
diff --git a/interfaces/kns/KCurlRequest.h b/interfaces/kns/KCurlRequest.h
deleted file mode 100644
index 3956da3..0000000
--- a/interfaces/kns/KCurlRequest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kns_request_
-#define _h_kns_request_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-struct String;
-struct KNSManager;
-struct KDataBuffer;
-
-struct KCurlRequest;
-
-KNS_EXTERN rc_t CC KNSManagerMakeCurlRequest( struct KNSManager const *kns_mgr, struct KCurlRequest **self, const char * url, bool verbose );
-
-KNS_EXTERN rc_t CC KCurlRequestAddRef ( const struct KCurlRequest *self );
-
-KNS_EXTERN rc_t CC KCurlRequestRelease( const struct KCurlRequest *self );
-
-KNS_EXTERN rc_t CC KCurlRequestAddFields( struct KCurlRequest *self, const char * fields );
-
-KNS_EXTERN rc_t CC KCurlRequestAddSFields( struct KCurlRequest *self, struct String const * fields );
-
-KNS_EXTERN rc_t CC KCurlRequestAddField( struct KCurlRequest *self, const char * name, const char * value );
-
-KNS_EXTERN rc_t CC KCurlRequestAddSField( struct KCurlRequest *self, struct String const * name, struct String const * value );
-
-KNS_EXTERN rc_t CC KCurlRequestPerform( struct KCurlRequest *self, struct KDataBuffer * buffer );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/interfaces/kns/adapt.h b/interfaces/kns/adapt.h
deleted file mode 100644
index dd6d2c3..0000000
--- a/interfaces/kns/adapt.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_adapt_
-#define _h_kns_adapt_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KStream;
-
-
-/*--------------------------------------------------------------------------
- * KStream
- *  adapters between KFile and KStream
- */
-
-/* FromKFilePair
- *  create a KStream from a pair of KFiles
- *  maintains a "pos" marker for input and output files
- *
- *  "strm" [ OUT ] - resultant KStream
- *
- *  "read" [ IN, NULL OKAY ] - file to use for stream reading
- *
- *  "write" [ IN, NULL OKAY ] - file to use for stream writing
- *
- * NB - EITHER "read" or "write" may be NULL, but not both.
- */
-KNS_EXTERN rc_t CC KStreamFromKFilePair ( struct KStream **strm,
-    struct KFile const *read, struct KFile *write );
-
-/* FromKStreamPair
- *  create a KStream from a pair of KStreams
- *
- *  "strm" [ OUT ] - resultant KStream
- *
- *  "read" [ IN, NULL OKAY ] - stream to use for input
- *
- *  "write" [ IN, NULL OKAY ] - stream to use for output
- *
- * NB - EITHER "read" or "write" may be NULL, but not both.
- */
-KNS_EXTERN rc_t CC KStreamFromKStreamPair ( struct KStream **strm,
-    struct KStream const *read, struct KStream *write );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_adapt_ */
diff --git a/interfaces/kns/ascp.h b/interfaces/kns/ascp.h
deleted file mode 100644
index b35111c..0000000
--- a/interfaces/kns/ascp.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_ascp_
-#define _h_kns_ascp_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum {
-    eAscpStateRunning,
-    eAscpStateExitSuccess,
-    eAscpStateExitWriteFailure,
-    eAscpStateExitFailure
-};
-
-typedef rc_t TQuitting(void);
-typedef bool TProgress(uint64_t id,
-    uint64_t state, uint64_t size, uint64_t percentage);
-
-typedef struct {
-    const char *host;
-    const char *user;
-    const char *target_rate;
-       /* -l MAX-RATE Set the target transfer rate in Kbps */
-
-    bool cache_key; /* Add the server's host key to PuTTY's cache */
-
-/* progress logging */
-    const char *name;
-    uint64_t src_size;
-
-    bool status; /* whether to call STSMSG */
-
-    uint64_t heartbeat;       /* in milliseconds */
-
-    uint64_t id; /* to pass to the callback */
-    TProgress *callback;
-
-    TQuitting *quitting;
-} AscpOptions;
-
-/** ascp_bin and private_file should be freed by the caller */
-KNS_EXTERN rc_t CC ascp_locate(const char **ascp_bin, const char **private_file,
-    bool use_config, bool status);
-
-/** Get a file by running aspera ascp binary */
-KNS_EXTERN rc_t CC aspera_get(const char *ascp_bin, const char *private_file,
-    const char *src, const char *dest, AscpOptions *opt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/interfaces/kns/curl-file.h b/interfaces/kns/curl-file.h
deleted file mode 100644
index 77aabe4..0000000
--- a/interfaces/kns/curl-file.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_curl_file_
-#define _h_curl_file_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KCurlFile
- *  a remote file, fetched (in parts) via http using libcurl
- */
-KNS_EXTERN rc_t CC KCurlFileMake ( struct KFile const **self, const char * url, bool verbose );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/interfaces/kns/endpoint.h b/interfaces/kns/endpoint.h
deleted file mode 100644
index 7c9df11..0000000
--- a/interfaces/kns/endpoint.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kns_endpoint_
-#define _h_kns_endpoint_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-struct KNSManager;
-
-
-/*--------------------------------------------------------------------------
- * KEndPoint
- *  describe a socket endpoint
- */
- 
-enum {
-    epIPV4,
-    epIPC
-};
-typedef uint32_t KEndPointType;
-
-#define IPC_NAME_MAX 256
-
-typedef struct KEndPoint KEndPoint;
-struct KEndPoint
-{
-	union 
-	{
-		struct
-		{
-			uint32_t addr;
-			uint16_t port;
-		} ipv4;
-		char ipc_name[IPC_NAME_MAX];
-	} u;
-    KEndPointType type;
-};
-
-
-/* InitIPv4Endpoint
- *  initialize the endpoint with an IPv4 address and port
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "ipv4" [ IN, DEFAULT 0 ] - binary IPv4 address in native integer byte order
- *   i.e. 0x7F000001 represents 127.0.0.1. if the special address 0 is given, it
- *   represents any host-local interface address.
- *
- *  "port" [ IN, DEFAULT 0 ] - binary port number in native integer byte order.
- *   if the special port number 0 is given, it represents any available port.
- */
-KNS_EXTERN rc_t CC KNSManagerInitIPv4Endpoint ( struct KNSManager const *self,
-    KEndPoint *ep, uint32_t ipv4, uint16_t port );
-
-
-/* InitDNSEndpoint
- *  initialize the endpoint with a DNS name and a port number
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "dns" [ IN ] - textual DNS address.
- *
- *  "port" [ IN, DEFAULT 0 ] - binary port number in native integer byte order.
- *   if the special port number 0 is given, it represents any available port.
- */
-KNS_EXTERN rc_t CC KNSManagerInitDNSEndpoint ( struct KNSManager const *self,
-    KEndPoint *ep, struct String const *dns, uint16_t port );
-
-/* InitIPCEndpoint
- *  initialize the endpoint for interprocess communication
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "name" [ IN ] - IPC channel name (a POSIX path to a Unix socket, or a name of a Windows pipe)
- */
-KNS_EXTERN rc_t CC KNSManagerInitIPCEndpoint ( struct KNSManager const *self,
-    KEndPoint *ep, struct String const * name );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_endpoint_ */
diff --git a/interfaces/kns/entrez-fetcher.h b/interfaces/kns/entrez-fetcher.h
deleted file mode 100644
index 7d79cd7..0000000
--- a/interfaces/kns/entrez-fetcher.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_entrez_fetcher_
-#define _h_entrez_fetcher_
-
-#ifndef _h_url_fetcher_
-#include <kns/url-fetcher.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KEntrezFetcher
- *  everything to fetch DNA-text from entrez - server
- */
-typedef struct KEntrezFetcher KEntrezFetcher;
-
-
-/* Make
- *  create a fetcher object
- */
-rc_t KEntrezFetcherMake ( KEntrezFetcher **fetcher, KUrlFetcher * url_fetcher );
-
-/* Setup
- *  prepares a fetch and indicates to caller the buffer size
- *
- *  "server" [ IN ] - NUL terminated URI, e.g.
- *     "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"
- *
- *  "seq_id" [ IN ] - NUL terminated sequence identifier, e.g. "NC_000001"
- *  max_seq_len : 1024
- *  row_id      : 11
- *  row_count   : 1
- */
-rc_t KEntrezFetcherSetup ( KEntrezFetcher *self,
-    const char * server, const char * seq_id, 
-    const size_t max_seq_len, const uint64_t row_id, const size_t row_count,
-    size_t * buffsize );
-
-
-/* Setup
- *  prepares a fetch by giving it a usable url
- */
-rc_t KEntrezFetcherSetupUri ( KEntrezFetcher *self, const char * uri );
-
-
-/* AddRef
- * Release
- */
-rc_t KEntrezFetcherAddRef ( const KEntrezFetcher *self );
-rc_t KEntrezFetcherRelease ( const KEntrezFetcher *self );
-
-/* Read
- *  reads data from prepared URI
- */
-rc_t KEntrezFetcherRead ( KEntrezFetcher *self,
-                       void *dst, size_t dst_size, size_t *num_read );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_entrez_fetcher_ */
diff --git a/interfaces/kns/extern.h b/interfaces/kns/extern.h
deleted file mode 100644
index afd5c00..0000000
--- a/interfaces/kns/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_extern_
-#define _h_kns_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define KNS_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KNS_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kns_extern_ */
diff --git a/interfaces/kns/http.h b/interfaces/kns/http.h
deleted file mode 100644
index f006a09..0000000
--- a/interfaces/kns/http.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_http_
-#define _h_kns_http_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct String;
-struct KStream;
-struct KNSManager;
-
-
-/*--------------------------------------------------------------------------
- * KHttp
- *  hyper text transfer protocol
- */
-typedef struct KHttp KHttp;
-
-
-/* MakeHttp
- *  create an HTTP protocol
- *
- *  "http" [ OUT ] - return parameter for HTTP object
- *
- *  "conn" [ IN, NULL OKAY ] - previously opened stream for communications.
- *
- *  "vers" [ IN ] - http version
- *   the only legal types are 1.0 ( 0x01000000 ) and 1.1 ( 0x01010000 )
- *
- *  "host" [ IN ] - parameter to give the host dns name for the connection
- *
- *  "port" [ IN, DEFAULT ZERO ] - if zero, defaults to standard for scheme
- *   if non-zero, is taken as explicit port specification
- */
-KNS_EXTERN rc_t CC KNSManagerMakeHttp ( struct KNSManager const *self,
-    KHttp **http, struct KStream *conn, ver_t vers,
-    struct String const *host, uint32_t port );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KHttpAddRef ( const KHttp *self );
-KNS_EXTERN rc_t CC KHttpRelease ( const KHttp *self );
-
-
-
-/*--------------------------------------------------------------------------
- * KHttpFile
- *  a KFile over HTTP
- */
-
-/* Make
- */
-KNS_EXTERN rc_t CC KNSManagerMakeHttpFile ( struct KNSManager const *self,
-    struct KFile const **file, struct KStream *conn, ver_t vers, const char *url, ... );
-KNS_EXTERN rc_t CC KNSManagerVMakeHttpFile ( struct KNSManager const *self,
-    struct KFile const **file, struct KStream *conn, ver_t vers, const char *url, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * KHttpRequest
- *  hyper text transfer protocol
- */
-typedef struct KHttpRequest KHttpRequest;
-
-
-/* MakeRequest
- *  create a request that can be used to contact HTTP server
- *
- *  "req" [ OUT ] - return parameter for HTTP request object
- *
- *  "vers" [ IN ] - http version
- *
- *  "conn" [ IN, NULL OKAY ] - previously opened stream for communications.
- *
- *  "url" [ IN ] - full resource identifier. if "conn" is NULL,
- *   the url is parsed for remote endpoint and is opened by mgr.
- */
-KNS_EXTERN rc_t CC KHttpMakeRequest ( const KHttp *self,
-    KHttpRequest **req, const char *url, ... );
-
-KNS_EXTERN rc_t CC KNSManagerMakeRequest ( struct KNSManager const *self,
-    KHttpRequest **req, ver_t version, struct KStream *conn, const char *url, ... );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KHttpRequestAddRef ( const KHttpRequest *self );
-KNS_EXTERN rc_t CC KHttpRequestRelease ( const KHttpRequest *self );
-
-
-/* Connection
- *  sets connection management headers
- *
- *  "close" [ IN ] - if "true", inform the server to close the connection
- *   after its response ( default for version 1.0 ). when "false" ( default
- *   for version 1.1 ), ask the server to keep the connection open.
- *
- * NB - the server is not required to honor the request
- */
-KNS_EXTERN rc_t CC KHttpRequestConnection ( KHttpRequest *self, bool close );
-
-
-/* ByteRange
- *  set requested byte range of response
- *
- *  "pos" [ IN ] - beginning offset within remote entity
- *
- *  "bytes" [ IN ] - the number of bytes being requested
- */
-KNS_EXTERN rc_t CC KHttpRequestByteRange ( KHttpRequest *self, uint64_t pos, size_t bytes );
-
-
-/* AddHeader
- *  allow addition of an arbitrary HTTP header to message
- */
-KNS_EXTERN rc_t CC KHttpRequestAddHeader ( KHttpRequest *self,
-    const char *name, const char *val, ... );
-
-
-/* AddPostParam
- *  adds a parameter for POST
- */
-KNS_EXTERN rc_t CC KHttpRequestAddPostParam ( KHttpRequest *self, const char *fmt, ... );
-KNS_EXTERN rc_t CC KHttpRequestVAddPostParam ( KHttpRequest *self, const char *fmt, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * KHttpResult
- *  hyper text transfer protocol
- */
-typedef struct KHttpResult KHttpResult;
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KHttpResultAddRef ( const KHttpResult *self );
-KNS_EXTERN rc_t CC KHttpResultRelease ( const KHttpResult *self );
-
-
-/* HEAD
- *  send HEAD message
- */
-KNS_EXTERN rc_t CC KHttpRequestHEAD ( KHttpRequest *self, KHttpResult **rslt ); 
-
-/* GET
- *  send GET message
- *  all query AND post parameters are combined in URL
- */
-KNS_EXTERN rc_t CC KHttpRequestGET ( KHttpRequest *self, KHttpResult **rslt ); 
-
-    /* POST
- *  send POST message
- *  query parameters are sent in URL
- *  post parameters are sent in body
- */
-KNS_EXTERN rc_t CC KHttpRequestPOST ( KHttpRequest *self, KHttpResult **rslt ); 
-
-
-/* Status
- *  access the response status code
- *  and optionally the message
- *
- *  "code" [ OUT ] - return parameter for status code
- *
- *  "msg_buff" [ IN, NULL OKAY ] and "buff_size" [ IN, ZERO OKAY ] -
- *   buffer for capturing returned message
- *
- *  "msg_size" [ OUT, NULL OKAY ] - size of returned message in bytes
- */
-KNS_EXTERN rc_t CC KHttpResultStatus ( const KHttpResult *self, uint32_t *code,
-    char *msg_buff, size_t buff_size, size_t *msg_size );
-
-
-/* KeepAlive
- *  retrieves keep-alive property of response
- *  requires HTTP/1.1
- */
-KNS_EXTERN bool CC KHttpResultKeepAlive ( const KHttpResult *self );
-
-
-/* Range
- *  retrieves position and partial size for partial requests
- *
- *  "pos" [ OUT ] - offset to beginning portion of response
- *
- *  "bytes" [ OUT ] - size of range
- */
-KNS_EXTERN rc_t CC KHttpResultRange ( const KHttpResult *self, uint64_t *pos, size_t *bytes );
-
-
-/* Size
- *  retrieves overall size of entity, if known
- *
- *  "response_size" [ OUT ] - size in bytes of response
- *   this is the number of bytes that may be expected from the input stream
- */
-KNS_EXTERN bool CC KHttpResultSize ( const KHttpResult *self, uint64_t *size );
-
-
-/* AddHeader
- *  allow addition of an arbitrary HTTP header to RESPONSE
- *  this can be used to repair or normalize odd server behavior
- */
-KNS_EXTERN rc_t CC KHttpResultAddHeader ( KHttpResult *self,
-    const char *name, const char *val, ... );
-
-
-/* GetHeader
- *  retrieve named header if present
- *  this cand potentially return a comma separated value list
- */
-KNS_EXTERN rc_t CC KHttpResultGetHeader ( const KHttpResult *self, const char *name,
-    char *buffer, size_t bsize, size_t *num_read );
-
-
-/* GetInputStream
- *  access the body of response as a stream
- *  only reads are supported
- *
- *  "s" [ OUT ] - return parameter for input stream reference
- *   must be released via KStreamRelease
- */
-KNS_EXTERN rc_t CC KHttpResultGetInputStream ( KHttpResult *self,
-    struct KStream  ** s );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_http_ */
diff --git a/interfaces/kns/impl.h b/interfaces/kns/impl.h
deleted file mode 100644
index eec1bd8..0000000
--- a/interfaces/kns/impl.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_impl_
-#define _h_kns_impl_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_kns_stream_
-#include <kns/stream.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef union KStream_vt KStream_vt;
-
-
-/*--------------------------------------------------------------------------
- * KStream
- *  a virtual stream
- */
-struct KStream
-{
-    const KStream_vt *vt;
-    KRefcount refcount;
-    uint8_t read_enabled;
-    uint8_t write_enabled;
-    uint8_t align [ 2 ];
-};
-
-#ifndef KSTREAM_IMPL
-#define KSTREAM_IMPL struct KStream
-#endif
-
-typedef struct KStream_vt_v1 KStream_vt_v1;
-struct KStream_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KSTREAM_IMPL *self );
-    rc_t ( CC * read ) ( const KSTREAM_IMPL *self,
-        void *buffer, size_t bsize, size_t *num_read );
-    rc_t ( CC * write ) ( KSTREAM_IMPL *self,
-        const void *buffer, size_t size, size_t *num_writ );
-    /* end minor version == 0 */
-};
-
-union KStream_vt
-{
-    KStream_vt_v1 v1;
-};
-
-
-/* Init
- *  initialize a newly allocated stream object
- */
-KNS_EXTERN rc_t CC KStreamInit ( KStream *self, const KStream_vt *vt,
-    const char *classname, const char *strname,
-    bool read_enabled, bool write_enabled );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_impl_ */
diff --git a/interfaces/kns/manager.h b/interfaces/kns/manager.h
deleted file mode 100644
index 1c78d49..0000000
--- a/interfaces/kns/manager.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kns_manager_
-#define _h_kns_manager_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-
-/*--------------------------------------------------------------------------
- * KNSManager
- *  manages the network system
- */
-typedef struct KNSManager KNSManager;
-
-
-/* Make
- *  create a manager instance
- */
-KNS_EXTERN rc_t CC KNSManagerMake ( KNSManager **mgr );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KNSManagerAddRef ( const KNSManager *self );
-KNS_EXTERN rc_t CC KNSManagerRelease ( const KNSManager *self );
-
-
-/* Avail - DEPRECATED
- *  indicate to caller whether networking services are available
- *  mainly here to support libcurl
- */
-KNS_EXTERN rc_t CC KNSManagerAvail ( const KNSManager *self );
-
-/* CurlVersion - DEPRECATED
- *  indicate which version of curl is available
- *  return this as a string, because this is how libcurl does it
- */
-KNS_EXTERN rc_t CC KNSManagerCurlVersion ( const KNSManager *self, const char ** version_string );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_manager_ */
diff --git a/interfaces/kns/socket.h b/interfaces/kns/socket.h
deleted file mode 100644
index 16d2e5c..0000000
--- a/interfaces/kns/socket.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kns_socket_
-#define _h_kns_socket_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KStream;
-struct KEndPoint;
-struct KNSManager;
-
-/*--------------------------------------------------------------------------
- * KSocket
- */
-struct KSocket;
-
-/* KSocketAddRef
- * 
- */
-KNS_EXTERN rc_t CC KSocketAddRef( struct KSocket *self );
-/* KSocketRelease
- * 
- */
-KNS_EXTERN rc_t CC KSocketRelease( struct KSocket *self );
-
-/* MakeConnection
- *  create a connection-oriented stream connected to an Internet server
- * conn [ OUT ] - a stream for communication with the server
- * from [ IN ] - client endpoint
- * to [ IN ] - server endpoint 
- *
- * both endpoints have to be of type epIP; creates a TCP connection
- */
-KNS_EXTERN rc_t CC KNSMakeConnection ( struct KStream **conn, struct KEndPoint const *from, struct KEndPoint const *to );
-
-/* MakeIPCConnection
- *  create a connection-oriented stream connected to an IPC server
- * conn [ OUT ] - a stream for communication with the server
- * to [ IN ] - server endpoint (must be of type epIPC)
- * max_retries [ IN ] - number of retries to be made if connection is refused. Will sleep for 1 second between retries
- */
-KNS_EXTERN rc_t CC KNSMakeIPCConnection ( struct KStream **conn, struct KEndPoint const *to, uint8_t max_retries );
-
-/* Create a listener socket for accepting incoming IPC connections
- * ep [ IN ] - a endpoint of type epIPC
- * listener [ IN ] - a listener socket, to be called KNSListen() on
- */
-KNS_EXTERN rc_t CC KNSMakeListener( struct KSocket** listener, struct KEndPoint const * ep );
-
-/* Wait for an incoming connection
- * listener [ IN ] - a listener socket
- * conn [ OUT ] - a stream for communication with the client 
- */
-KNS_EXTERN rc_t CC KNSListen ( struct KSocket *listener, struct KStream **conn );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_socket_ */
diff --git a/interfaces/kns/stream.h b/interfaces/kns/stream.h
deleted file mode 100644
index a7c1bf7..0000000
--- a/interfaces/kns/stream.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kns_stream_
-#define _h_kns_stream_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KStream
- *  the stream is defined to have no concept of size,
- *  and to not support any form of random access
- */
-typedef struct KStream KStream;
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KStreamAddRef ( const KStream *self );
-KNS_EXTERN rc_t CC KStreamRelease ( const KStream *self );
-
-
-/* Read
- *  read data from stream
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of stream.
- */
-KNS_EXTERN rc_t CC KStreamRead ( const KStream *self,
-    void *buffer, size_t bsize, size_t *num_read );
-
-/* ReadAll
- *  read from stream until "bsize" bytes have been retrieved
- *  or until end-of-input
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of stream.
- */
-KNS_EXTERN rc_t CC KStreamReadAll ( const KStream *self,
-    void *buffer, size_t bsize, size_t *num_read );
-
-
-/* Write
- *  send data to stream
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-KNS_EXTERN rc_t CC KStreamWrite ( KStream *self,
-    const void *buffer, size_t size, size_t *num_writ );
-
-/* WriteAll
- *  write to stream until "size" bytes have been transferred
- *  or until no further progress can be made
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-KNS_EXTERN rc_t CC KStreamWriteAll ( KStream *self,
-    const void *buffer, size_t size, size_t *num_writ );
-
-
-/* MakeStdIn
- *  creates a read-only stream on stdin
- */
-KNS_EXTERN rc_t CC KStreamMakeStdIn ( const KStream **std_in );
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only stream on stdout or stderr
- */
-KNS_EXTERN rc_t CC KStreamMakeStdOut ( KStream **std_out );
-KNS_EXTERN rc_t CC KStreamMakeStdErr ( KStream **std_err );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kns_stream_ */
diff --git a/interfaces/kns/url-fetcher.h b/interfaces/kns/url-fetcher.h
deleted file mode 100644
index 36ac6a7..0000000
--- a/interfaces/kns/url-fetcher.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_url_fetcher_
-#define _h_url_fetcher_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KUrlFetcher
- *  a generic way of fetching data from a url
- */
-typedef struct KUrlFetcher KUrlFetcher;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KNS_EXTERN rc_t CC KUrlFetcherAddRef ( const KUrlFetcher *self );
-KNS_EXTERN rc_t CC KUrlFetcherRelease ( const KUrlFetcher *self );
-
-KNS_EXTERN rc_t CC KUrlFetcherRead( KUrlFetcher *self, const char *uri,
-                      void *dst, size_t to_read, size_t *num_read );
-
-/* this typedef has to stay here for the virtual interface to work...*/
-typedef struct KUrlFetcherCurl KUrlFetcherCurl;
-
-KNS_EXTERN rc_t CC KUrlFetcherCurlMake( KUrlFetcher **fetcher, const bool verbose );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/interfaces/kproc/barrier.h b/interfaces/kproc/barrier.h
deleted file mode 100644
index 46655d7..0000000
--- a/interfaces/kproc/barrier.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_barrier_
-#define _h_kproc_barrier_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KBarrier
- *  a thread synchronization device
- *  detains all callers until the required number has been reached
- */
-typedef struct KBarrier KBarrier;
-
-
-/* Make
- *  create a barrier
- *
- *  "count" [ IN ] - the number of threads to block
- */
-KPROC_EXTERN rc_t CC KBarrierMake ( KBarrier **b, uint32_t count );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KBarrierAddRef ( const KBarrier *self );
-KPROC_EXTERN rc_t CC KBarrierRelease ( const KBarrier *self );
-
-
-/* Wait
- *  block until the required number of callers has been reached
- */
-KPROC_EXTERN rc_t CC KBarrierWait ( KBarrier *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_barrier_ */
diff --git a/interfaces/kproc/barrier.hpp b/interfaces/kproc/barrier.hpp
deleted file mode 100644
index 38fde17..0000000
--- a/interfaces/kproc/barrier.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kproc_barrier_
-#define _hpp_kproc_barrier_
-
-#ifndef _h_kproc_barrier_
-#include <kproc/barrier.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KBarrier
- *  a thread synchronization device
- *  detains all callers until the required number has been reached
- */
-struct KBarrier
-{
-    /* Make
-     *  create a barrier
-     *
-     *  "count" [ IN ] - the number of threads to block
-     */
-    static inline rc_t Make ( KBarrier **b, uint32_t count )
-        throw ()
-    { return KBarrierMake ( b, count ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KBarrierAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KBarrierRelease ( this ); }
-
-
-    /* Wait
-     *  block until the required number of callers has been reached
-     */
-    inline rc_t Wait ()
-        throw ()
-    { return KBarrierWait ( this ); }
-
-private:
-    KBarrier ();
-    ~ KBarrier ();
-    KBarrier ( const KBarrier& );
-    KBarrier &operator = ( const KBarrier& );
-};
-
-
-#endif // _hpp_kproc_barrier_
diff --git a/interfaces/kproc/cond.h b/interfaces/kproc/cond.h
deleted file mode 100644
index 516a47e..0000000
--- a/interfaces/kproc/cond.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_cond_
-#define _h_kproc_cond_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KLock;
-struct timeout_t;
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-typedef struct KCondition KCondition;
-
-
-/* Make
- *  create a condition
- */
-KPROC_EXTERN rc_t CC KConditionMake ( KCondition **cond );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KConditionAddRef ( const KCondition *self );
-KPROC_EXTERN rc_t CC KConditionRelease ( const KCondition *self );
-
-
-/* Wait
- *  block on external lock until signaled
- */
-KPROC_EXTERN rc_t CC KConditionWait ( KCondition *self, struct KLock *lock );
-KPROC_EXTERN rc_t CC KConditionTimedWait ( KCondition *self, struct KLock *lock, struct timeout_t *tm );
-
-
-/* Signal
- *  signal waiting threads
- *  awaken at most a single thread
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KConditionSignal ( KCondition *self );
-
-
-/* Broadcast
- *  signal waiting threads
- *  awaken all waiting thread
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KConditionBroadcast ( KCondition *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_cond_ */
diff --git a/interfaces/kproc/cond.hpp b/interfaces/kproc/cond.hpp
deleted file mode 100644
index c1ff6b8..0000000
--- a/interfaces/kproc/cond.hpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kproc_cond_
-#define _hpp_kproc_cond_
-
-#ifndef _h_kproc_cond_
-#include <kproc/cond.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-struct KCondition
-{
-    /* Make
-     *  create a condition
-     */
-    static inline rc_t Make ( KCondition **cond )
-        throw ()
-    { return KConditionMake ( cond ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KConditionAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KConditionRelease ( this ); }
-
-
-    /* Wait
-     *  block on external lock until signaled
-     */
-    inline rc_t Wait ( struct KLock *lock )
-        throw ()
-    { return KConditionWait ( this, lock ); }
-
-    inline rc_t Wait ( struct KLock *lock, struct timeout_t *tm )
-        throw ()
-    { return KConditionTimedWait ( this, lock, tm ); }
-
-    inline rc_t TimedWait ( struct KLock *lock, struct timeout_t *tm )
-        throw ()
-    { return KConditionTimedWait ( this, lock, tm ); }
-
-
-    /* Signal
-     *  signal waiting threads
-     *  awaken at most a single thread
-     */
-    inline rc_t Signal ()
-        throw ()
-    { return KConditionSignal ( this ); }
-
-
-    /* Broadcast
-     *  signal waiting threads
-     *  awaken all waiting thread
-     */
-    inline rc_t Broadcast ()
-        throw ()
-    { return KConditionBroadcast ( this ); }
-
-private:
-    KCondition ();
-    ~ KCondition ();
-    KCondition ( const KCondition& );
-    KCondition &operator = ( const KCondition& );
-};
-
-#endif // _hpp_kproc_cond_
diff --git a/interfaces/kproc/extern.h b/interfaces/kproc/extern.h
deleted file mode 100644
index 874d6f2..0000000
--- a/interfaces/kproc/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_extern_
-#define _h_kproc_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define KPROC_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KPROC_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kproc_extern_ */
diff --git a/interfaces/kproc/impl.h b/interfaces/kproc/impl.h
deleted file mode 100644
index 4d99b04..0000000
--- a/interfaces/kproc/impl.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_impl_
-#define _h_kproc_impl_
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifndef _h_kproc_task_
-#include <kproc/task.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef union KTask_vt KTask_vt;
-
-
-/*--------------------------------------------------------------------------
- * KTask
- *  a deferred task abstraction
- *  specific task objects are constructed with required parameters
- *  and implement the Execute method to perform their operation
- */
-struct KTask
-{
-    const KTask_vt *vt;
-    KRefcount refcount;
-    uint8_t align [ 4 ];
-};
-
-#ifndef KTASK_IMPL
-#define KTASK_IMPL struct KTask
-#endif
-
-typedef struct KTask_vt_v1 KTask_vt_v1;
-struct KTask_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KTASK_IMPL *self );
-    rc_t ( CC * execute ) ( KTASK_IMPL * self );
-    /* end minor version == 0 */
-};
-
-union KTask_vt
-{
-    KTask_vt_v1 v1;
-};
-
-/* Init
- *  initialize a newly allocated task object
- */
-KPROC_EXTERN rc_t CC KTaskInit ( KTask *self, const KTask_vt *vt, const char *clsname, const char *name );
-
-
-/* Destroy
- *  destroy task
- */
-KPROC_EXTERN rc_t CC KTaskDestroy ( KTask *self, const char *clsname );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_impl_ */
diff --git a/interfaces/kproc/lock.h b/interfaces/kproc/lock.h
deleted file mode 100644
index c186f63..0000000
--- a/interfaces/kproc/lock.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_lock_
-#define _h_kproc_lock_
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct timeout_t;
-
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-typedef struct KLock KLock;
-
-
-/* Make
- *  make a simple mutex
- */
-KPROC_EXTERN rc_t CC KLockMake ( KLock **lock );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KLockAddRef ( const KLock *self );
-KPROC_EXTERN rc_t CC KLockRelease ( const KLock *self );
-
-
-/* Acquire
- *  acquires lock
- */
-KPROC_EXTERN rc_t CC KLockAcquire ( KLock *self );
-KPROC_EXTERN rc_t CC KLockTimedAcquire ( KLock *self, struct timeout_t *tm );
-
-/* Unlock
- *  releases lock
- */
-KPROC_EXTERN rc_t CC KLockUnlock ( KLock *self );
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a POSIX-style read/write lock
- */
-typedef struct KRWLock KRWLock;
-
-
-/* Make
- *  make a simple read/write lock
- */
-KPROC_EXTERN rc_t CC KRWLockMake ( KRWLock **lock );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KRWLockAddRef ( const KRWLock *self );
-KPROC_EXTERN rc_t CC KRWLockRelease ( const KRWLock *self );
-
-
-/* AcquireShared
- *  acquires read ( shared ) lock
- */
-KPROC_EXTERN rc_t CC KRWLockAcquireShared ( KRWLock *self );
-KPROC_EXTERN rc_t CC KRWLockTimedAcquireShared ( KRWLock *self, struct timeout_t *tm );
-
-
-/* AcquireExcl
- *  acquires write ( exclusive ) lock
- */
-KPROC_EXTERN rc_t CC KRWLockAcquireExcl ( KRWLock *self );
-KPROC_EXTERN rc_t CC KRWLockTimedAcquireExcl ( KRWLock *self, struct timeout_t *tm );
-
-
-/* Unlock
- *  releases lock
- */
-KPROC_EXTERN rc_t CC KRWLockUnlock ( KRWLock *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_lock_ */
diff --git a/interfaces/kproc/lock.hpp b/interfaces/kproc/lock.hpp
deleted file mode 100644
index 9e4c1bc..0000000
--- a/interfaces/kproc/lock.hpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_lock_
-#define _h_kproc_lock_
-
-#ifndef _h_kproc_lock_
-#include <kproc/lock.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-struct KLock
-{
-    /* Make
-     *  make a simple mutex
-     */
-    static inline rc_t Make ( KLock **lock )
-        throw ()
-    { return KLockMake ( lock ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KLockAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KLockRelease ( this ); }
-
-
-    /* Acquire
-     *  acquires lock
-     */
-    inline rc_t Acquire ()
-        throw ()
-    { return KLockAcquire ( this ); }
-
-    inline rc_t Acquire ( struct timeout_t *tm )
-        throw ()
-    { return KLockTimedAcquire ( tthis, tm ); }
-
-    inline rc_t TimedAcquire ( struct timeout_t *tm )
-        throw ()
-    { return KLockTimedAcquire ( tthis, tm ); }
-
-    /* Unlock
-     *  releases lock
-     */
-    inline rc_t Unlock ()
-        throw ()
-    { return KLockUnlock ( this ): }
-
-private:
-    KLock ();
-    ~ KLock ();
-    KLock ( const KLock& );
-    KLock &operator = ( const KLock& );
-};
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a POSIX-style read/write lock
- */
-struct KRWLock
-{
-    /* Make
-     *  make a simple read/write lock
-     */
-    static inline rc_t Make ( KRWLock **lock )
-        throw ()
-    { return KRWLockMake ( lock ): }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KRWLockAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KRWLockRelease ( this ); }
-
-
-    /* AcquireShared
-     *  acquires read ( shared ) lock
-     */
-    inline rc_t AcquireShared ()
-        throw ()
-    { return KRWLockAcquireShared ( this ); }
-
-    inline rc_t AcquireShared ( struct timeout_t *tm )
-        throw ()
-    { return KRWLockTimedAcquireShared ( this, tm ); }
-
-    inline rc_t TimedAcquireShared ( struct timeout_t *tm )
-        throw ()
-    { return KRWLockTimedAcquireShared ( this, tm ); }
-
-
-    /* AcquireExcl
-     *  acquires write ( exclusive ) lock
-     */
-    inline rc_t AcquireExcl ()
-        throw ()
-    { return KRWLockAcquireExcl ( this ); }
-
-    inline rc_t AcquireExcl ( struct timeout_t *tm )
-        throw ()
-    { return KRWLockTimedAcquireExcl ( this, tm ); }
-
-    inline rc_t TimedAcquireExcl ( struct timeout_t *tm )
-        throw ()
-    { return KRWLockTimedAcquireExcl ( this, tm ); }
-
-
-    /* Unlock
-     *  releases lock
-     */
-    inline rc_t Unlock ()
-        throw ()
-    { return KRWLockUnlock ( this ); }
-
-private:
-    KRWLock ();
-    ~ KRWLock ();
-    KRWLock ( const KRWLock& );
-    KRWLock &operator = ( const KRWLock& );
-};
-
-#endif // _hpp_kproc_lock_
diff --git a/interfaces/kproc/procmgr.h b/interfaces/kproc/procmgr.h
deleted file mode 100644
index d0b0a44..0000000
--- a/interfaces/kproc/procmgr.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_procmgr_
-#define _h_kproc_procmgr_
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTask;
-struct KTaskTicket;
-
-
-/*--------------------------------------------------------------------------
- * KProcMgr
- */
-typedef struct KProcMgr KProcMgr;
-
-
-/* Init
- *  initialize the proc mgr
- *  creates the singleton object
- */
-KPROC_EXTERN rc_t CC KProcMgrInit ( void );
-
-/* Whack
- *  tear down proc mgr
- *  runs any outstanding cleanup tasks
- *  deletes the singleton object
- *  intended to be called from an "atexit()" or similar task
- */
-KPROC_EXTERN rc_t CC KProcMgrWhack ( void );
-
-
-/* MakeSingleton
- *  access singleton process manager
- *  returns a new reference
- *  or an error code if not initialized
- *  VDB-2 ONLY
- */
-KPROC_EXTERN rc_t CC KProcMgrMakeSingleton ( KProcMgr ** mgr );
-
-
-/* AddRef
- * Release
- *  here to support refcounting API
- *  not generally useful in that the proc mgr
- *  will stay around until process exit
- */
-KPROC_EXTERN rc_t CC KProcMgrAddRef ( const KProcMgr *self );
-KPROC_EXTERN rc_t CC KProcMgrRelease ( const KProcMgr *self );
-
-
-/* AddCleanupTask
- *  add a task to be performed at process exit time
- *
- *  "ticket" [ OUT ] - an id that can be used later to remove task
- *
- *  "task" [ IN ] - task object that will be executed at process
- *   exit, unless previously removed ( see RemoveCleanupTask ).
- *   NB - a new reference to "task" will be created
- */
-KPROC_EXTERN rc_t CC KProcMgrAddCleanupTask ( KProcMgr *self,
-    struct KTaskTicket *ticket, struct KTask *task );
-
-
-/* RemoveCleanupTask
- *  remove a task from exit queue
- *  releases reference to task object
- *  returns an rcNotFound code if task no longer exists
- */
-KPROC_EXTERN rc_t CC KProcMgrRemoveCleanupTask ( KProcMgr *self,
-    struct KTaskTicket const *ticket );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_procmgr_ */
diff --git a/interfaces/kproc/q-extern.h b/interfaces/kproc/q-extern.h
deleted file mode 100644
index 96f01d4..0000000
--- a/interfaces/kproc/q-extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_q_extern_
-#define _h_kproc_q_extern_
-
-#if ! defined EXPORT_LATCH && _LIBRARY
-#define KQ_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define KQ_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_kproc_q_extern_ */
diff --git a/interfaces/kproc/queue.h b/interfaces/kproc/queue.h
deleted file mode 100644
index e1d5bca..0000000
--- a/interfaces/kproc/queue.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_queue_
-#define _h_kproc_queue_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <kproc/q-extern.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct timeout_t;
-
-
-/*--------------------------------------------------------------------------
- * KQueue
- *  a simple thread-safe queue structure supporting push/pop operation
- *  makes use of semaphore objects for synchronization
- */
-typedef struct KQueue KQueue;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KQ_EXTERN rc_t CC KQueueAddRef ( const KQueue *self );
-KQ_EXTERN rc_t CC KQueueRelease ( const KQueue *self );
-
-/* Make
- * create an empty queue object
- *
- *  "capacity" [ IN ] - minimum queue length
- *  always expands to a power of 2, i.e. providing
- *  a length of 10 will result in a length of 16.
- */
-KQ_EXTERN rc_t CC KQueueMake ( KQueue **q, uint32_t capacity );
-
-/* Push
- *  add an object to the queue
- *
- *  "item" [ IN, OPAQUE ] - pointer to item being queued
- *
- *  "tm" [ IN, NULL OKAY ] - pointer to system specific timeout
- *  structure. if the queue is full, wait for indicated period
- *  of time for space to become available, or return status
- *  code indicating a timeout. when NULL and queue is full,
- *  Push will time out immediately and return status code.
- */
-KQ_EXTERN rc_t CC KQueuePush ( KQueue *self, const void *item, struct timeout_t *tm );
-
-/* Pop
- *  pop an object from queue
- *
- *  "item" [ OUT, OPAQUE* ] - return parameter for popped item
- *
- *  "tm" [ IN, NULL OKAY ] - pointer to system specific timeout
- *  structure. if the queue is empty, wait for indicated period
- *  of time for an object to become available, or return status
- *  code indicating a timeout. when NULL and queue is empty,
- *  Pop will time out immediately and return status code.
- */
-KQ_EXTERN rc_t CC KQueuePop ( KQueue *self, void **item, struct timeout_t *tm );
-
-/* Sealed
- *  ask if the queue has been closed off
- *  meaning there will be no further push operations
- *
- *  NB - if "self" is NULL, the return value is "true"
- *  since a NULL queue cannot accept items via push
- */
-KQ_EXTERN bool CC KQueueSealed ( const KQueue *self );
-
-/* Seal
- *  indicate that the queue has been closed off
- *  meaning there will be no further push operations
- */
-KQ_EXTERN rc_t CC KQueueSeal ( KQueue *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_queue_ */
diff --git a/interfaces/kproc/sem.h b/interfaces/kproc/sem.h
deleted file mode 100644
index 32ee405..0000000
--- a/interfaces/kproc/sem.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_sem_
-#define _h_kproc_sem_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KLock;
-struct timeout_t;
-
-
-/*--------------------------------------------------------------------------
- * KSemaphore
- *  a metering device
- */
-typedef struct KSemaphore KSemaphore;
-
-
-/* Make
- *
- *  "count" [ IN ] - initial count value
- */
-KPROC_EXTERN rc_t CC KSemaphoreMake ( KSemaphore **sem, uint64_t count );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KSemaphoreAddRef ( const KSemaphore *self );
-KPROC_EXTERN rc_t CC KSemaphoreRelease ( const KSemaphore *self );
-
-
-/* Wait
- *  block until a count becomes available
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "tm" [ IN, NULL OKAY ] - optional timeout where
- *  NULL means timeout value of 0
- */
-KPROC_EXTERN rc_t CC KSemaphoreWait ( KSemaphore *self, struct KLock *lock );
-KPROC_EXTERN rc_t CC KSemaphoreTimedWait ( KSemaphore *self,
-    struct KLock *lock, struct timeout_t *tm );
-
-
-/* Cancel
- *  signal that the count will never increase
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KSemaphoreCancel ( KSemaphore *self );
-
-
-/* Signal
- *  signal that a count has become available
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KSemaphoreSignal ( KSemaphore *self );
-
-
-/* Alloc
- *  allocate a count
- *  used for resource metering
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "count" [ IN ] - the resource count
- *
- *  "tm" [ IN, NULL OKAY ] - optional timeout where
- *  NULL means timeout value of 0
- */
-KPROC_EXTERN rc_t CC KSemaphoreAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count );
-KPROC_EXTERN rc_t CC KSemaphoreTimedAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count, struct timeout_t *tm );
-
-
-/* Free
- *  signal that resources have become available
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KSemaphoreFree ( KSemaphore *self, uint64_t count );
-
-
-/* Count
- *  request the current resource usage
- *
- *  "count" [ OUT ] - return parameter for current count
- *
- * NB - external lock used for synchronization must be locked by current thread
- */
-KPROC_EXTERN rc_t CC KSemaphoreCount ( const KSemaphore *self, uint64_t *count );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_sem_ */
diff --git a/interfaces/kproc/sem.hpp b/interfaces/kproc/sem.hpp
deleted file mode 100644
index 05b3178..0000000
--- a/interfaces/kproc/sem.hpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kproc_sem_
-#define _hpp_kproc_sem_
-
-#ifndef _h_kproc_sem_
-#include <kproc/sem.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KSemaphore
- *  a metering device
- */
-struct KSemaphore
-{
-    /* Make
-     *
-     *  "count" [ IN ] - initial count value
-     */
-    static inline rc_t Make ( KSemaphore **sem, uint64_t count )
-        throw ()
-    { return KSemaphoreMake ( sem, count ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KSemaphoreAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KSemaphoreRelease ( this ); }
-
-
-    /* Wait
-     *  block until a count becomes available
-     *
-     *  "lock" [ IN ] - externally acquired lock
-     */
-    inline rc_t Wait ( struct KLock *lock )
-        throw ()
-    { return KSemaphoreWait ( this, lock ); }
-
-    inline rc_t Wait ( struct KLock *lock, struct timeout_t *tm )
-        throw ()
-    { return KSemaphoreTimedWait ( this, lock, tm ); }
-
-    inline rc_t TimedWait ( struct KLock *lock, struct timeout_t *tm )
-        throw ()
-    { return KSemaphoreTimedWait ( this, lock, tm ); }
-
-
-    /* Signal
-     *  signal that a count has become available
-     */
-    inline rc_t Signal ()
-        throw ()
-    { return KSemaphoreSignal ( this ); }
-
-
-    /* Alloc
-     *  allocate a count
-     *  used for resource metering
-     *
-     *  "lock" [ IN ] - externally acquired lock
-     *
-     *  "count" [ IN ] - the resource count
-     */
-    inline rc_t Alloc ( struct KLock *lock, uint64_t count )
-        throw ()
-    { return KSemaphoreAlloc ( this, lock, count ); }
-
-    inline rc_t Alloc ( struct KLock *lock, uint64_t count, struct timeout_t *tm )
-        throw ()
-    { return KSemaphoreTimedAlloc ( this, lock, count, tm ); }
-
-    inline rc_t TimedAlloc ( struct KLock *lock, uint64_t count, struct timeout_t *tm )
-        throw ()
-    { return KSemaphoreTimedAlloc ( this, lock, count, tm ); }
-
-
-    /* Free
-     *  signal that resources have become available
-     */
-    inline rc_t Free ( uint64_t count )
-        throw ()
-    { return KSemaphoreFree ( this, count ); }
-
-
-    /* Count
-     *  request the current resource usage
-     *  valid only within lock
-     *
-     *  "count" [ OUT ] - return parameter for current count
-     */
-    inline rc_t Count ( uint64_t *count ) const
-        throw ()
-    { return KSemaphoreCount ( this, count ); }
-
-private:
-    KSemaphore ();
-    ~ KSemaphore ();
-    KSemaphore ( const KSemaphore& );
-    KSemaphore &operator = ( const KSemaphore& );
-};
-
-#endif // _hpp_kproc_sem_
diff --git a/interfaces/kproc/task.h b/interfaces/kproc/task.h
deleted file mode 100644
index 5e49547..0000000
--- a/interfaces/kproc/task.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_task_
-#define _h_kproc_task_
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-
-/*--------------------------------------------------------------------------
- * KTask
- *  a deferred task abstraction
- *  specific task objects are constructed with required parameters
- *  and implement the Execute method to perform their operation
- */
-typedef struct KTask KTask;
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KTaskAddRef ( const KTask *self );
-KPROC_EXTERN rc_t CC KTaskRelease ( const KTask *self );
-KPROC_EXTERN rc_t CC KTaskDestroy ( KTask *self, const char *clsname );
-
-/* Execute
- *  perform deferred operation
- */
-KPROC_EXTERN rc_t CC KTaskExecute ( KTask *self );
-
-/*--------------------------------------------------------------------------
- * KTaskTicket
- *  an opaque object holding task identification
- */
-typedef struct KTaskTicket KTaskTicket;
-struct KTaskTicket
-{
-    uint64_t info [ 2 ];
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_task_ */
diff --git a/interfaces/kproc/thread.h b/interfaces/kproc/thread.h
deleted file mode 100644
index e6ab600..0000000
--- a/interfaces/kproc/thread.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_thread_
-#define _h_kproc_thread_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KThread
- *  a CPU execution thread
- */
-typedef struct KThread KThread;
-
-/* Make
- *  create and run a thread
- *
- *  "run_thread" [ IN ] - thread entrypoint
- *
- *  "data" [ IN, OPAQUE ] - user-supplied thread data
- */
-KPROC_EXTERN rc_t CC KThreadMake ( KThread **t,
-    rc_t ( CC * run_thread ) ( const KThread *self, void *data ), void *data );
-
-
-/* AddRef
- * Release
- */
-KPROC_EXTERN rc_t CC KThreadAddRef ( const KThread *self );
-KPROC_EXTERN rc_t CC KThreadRelease ( const KThread *self );
-
-
-/* Cancel
- *  signal the thread to finish
- */
-KPROC_EXTERN rc_t CC KThreadCancel ( KThread *self );
-
-
-/* Wait
- *  waits for a thread to exit
- *
- *  "status" [ OUT, NULL OKAY ] - return parameter for thread's exit code
- */
-KPROC_EXTERN rc_t CC KThreadWait ( KThread *self, rc_t *status );
-
-
-/* Detach
- *  allow thread to run independently of group
- */
-KPROC_EXTERN rc_t CC KThreadDetach ( KThread *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_thread_ */
diff --git a/interfaces/kproc/thread.hpp b/interfaces/kproc/thread.hpp
deleted file mode 100644
index 53b9510..0000000
--- a/interfaces/kproc/thread.hpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_kproc_thread_
-#define _hpp_kproc_thread_
-
-#ifndef _h_kproc_thread_
-#include <kproc/thread.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KThread
- *  a CPU execution thread
- */
-struct KThread
-{
-    /* Make
-     *  create and run a thread
-     *
-     *  "run_thread" [ IN ] - thread entrypoint
-     *
-     *  "data" [ IN, OPAQUE ] - user-supplied thread data
-     */
-    static inline rc_t Make ( KThread **t,
-             rc_t ( CC * run_thread ) ( const KThread *, void * ), void * data )
-        throw ()
-    { return KThreadMake ( t, run_thread, data ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const
-        throw ()
-    { return KThreadAddRef ( this ); }
-
-    inline rc_t Release () const
-        throw ()
-    { return KThreadRelease ( this ); }
-
-
-    /* Cancel
-     *  signal the thread to finish
-     */
-    inline rc_t Cancel ()
-        throw ()
-    { return KThreadCancel ( this ); }
-
-
-    /* Wait
-     *  waits for a thread to exit
-     *
-     *  "status" [ OUT ] - return parameter for thread's exit code
-     */
-    inline rc_t Wait ( rc_t *status )
-        throw ()
-    { return KThreadWait ( this, status ); }
-
-
-    /* Detach
-     *  allow thread to run independently of group
-     */
-    inline rc_t Detach ()
-        throw ()
-    { return KThreadDetach ( this ); }
-
-private:
-    KThread ();
-    ~ KThread ();
-    KThread ( const KThread& );
-    KThread &operator = ( const KThread& );
-};
-
-#endif // _hpp_kproc_thread_
diff --git a/interfaces/kproc/timeout.h b/interfaces/kproc/timeout.h
deleted file mode 100644
index 017f1a3..0000000
--- a/interfaces/kproc/timeout.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kproc_timeout_
-#define _h_kproc_timeout_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kproc_extern_
-#include <kproc/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * system specific timeout object
- */
-typedef struct timeout_t timeout_t;
-
-
-/* Init
- *  initialize a timeout in milliseconds
- */
-KPROC_EXTERN rc_t CC TimeoutInit ( timeout_t *tm, uint32_t msec );
-
-
-/* Prepare
- *  ensures that a timeout is prepared with an absolute value
-*/
-KPROC_EXTERN rc_t CC TimeoutPrepare ( timeout_t *tm );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kproc_timeout_ */
diff --git a/interfaces/krypto/cipher-impl.h b/interfaces/krypto/cipher-impl.h
deleted file mode 100644
index 02214d4..0000000
--- a/interfaces/krypto/cipher-impl.h
+++ /dev/null
@@ -1 +0,0 @@
-#error "OBSOLETE do not use"
diff --git a/interfaces/krypto/cipher-priv.h b/interfaces/krypto/cipher-priv.h
deleted file mode 100644
index 328ba6d..0000000
--- a/interfaces/krypto/cipher-priv.h
+++ /dev/null
@@ -1 +0,0 @@
-#error "Obsolete do not use"
diff --git a/interfaces/krypto/cipher-test.h b/interfaces/krypto/cipher-test.h
deleted file mode 100644
index f123525..0000000
--- a/interfaces/krypto/cipher-test.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_cipher_test_
-#define _h_krypto_cipher_test_
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-#include <krypto/ciphermgr.h>
-
-KRYPTO_EXTERN rc_t KCipherTestVecAesNiMake (struct KCipher ** new_cipher,
-                                            kcipher_type type);
-KRYPTO_EXTERN rc_t KCipherTestVecRegMake   (struct KCipher ** new_cipher,
-                                            kcipher_type type);
-KRYPTO_EXTERN rc_t KCipherTestVecMake      (struct KCipher ** new_cipher,
-                                            kcipher_type type);
-KRYPTO_EXTERN rc_t KCipherTestByteMake     (struct KCipher ** new_cipher,
-                                            kcipher_type type);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_cipher_test_ */
diff --git a/interfaces/krypto/cipher.h b/interfaces/krypto/cipher.h
deleted file mode 100644
index 2f22733..0000000
--- a/interfaces/krypto/cipher.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_cipher_
-#define _h_krypto_cipher_
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-typedef struct KCipher KCipher;
-
-KRYPTO_EXTERN 
-rc_t CC KCipherAddref (const KCipher * self);
-
-KRYPTO_EXTERN rc_t CC KCipherRelease (const KCipher * self);
-
-KRYPTO_EXTERN rc_t CC KCipherBlockSize (const KCipher * self, size_t * bytes);
-
-KRYPTO_EXTERN rc_t CC KCipherSetEncryptKey (KCipher * self,
-                                            const void * user_key,
-                                            size_t user_key_size);
-
-KRYPTO_EXTERN rc_t CC KCipherSetDecryptKey (KCipher * self,
-                                            const void * user_key,
-                                            size_t user_key_size);
-
-/*
- * Set the ivec (Initialization vector or feedback) for the cipher
- * this is done automatically for the longer runs defined below.
- *
- * the size of ivec  must match KCipherBlockSize
- *
- * the ivec is copied into the cipher not used in place
- */
-KRYPTO_EXTERN
- rc_t CC KCipherSetEncryptIVec (KCipher * self, const void * ivec);
-
-KRYPTO_EXTERN
- rc_t CC KCipherSetDecryptIVec (KCipher * self, const void * ivec);
-
-
-typedef void (*cipher_ctr_func)(void * ivec);
-
-KRYPTO_EXTERN rc_t CC KCipherSetEncryptCtrFunc (KCipher * self, cipher_ctr_func func);
-
-KRYPTO_EXTERN rc_t CC KCipherSetDecryptCtrFunc (KCipher * self, cipher_ctr_func func);
-
-/*
- * 'in' can equal 'out'
- */
-KRYPTO_EXTERN rc_t CC KCipherEncrypt (KCipher * self, const void * in, void * out);
-
-KRYPTO_EXTERN rc_t CC KCipherDecrypt (KCipher * self, const void * in, void * out);
-
-
-/* ====================
- * longer runs of multiple blocks.
- *
- * The algorithms are well defined and standard in most cases.
- *
- * PT: plain text block
- * CT: cipher text block
- * EK: encryption key
- * DK: decryption key (might be sthe same as EK)
- * ENC: encrypt cipher function on a block using a key
- * DEC: decrypt cipher function on a block using a key
- * IV: initialization vector - used as feedback for chaining
- * N:  number used once (nonce)
- * FB: feedback is the next IV in a chained/feedback mode
- */
-
-/* -----
- * NOTE:
- * 'in' can be the same as 'out' but other overlaps are dangers as a block at a
- * time is written. The code does not look for overlaps at this point.
- */
-
-/* ----------
- * Electronic Code Book - simple cipher with no chaining feedback  just iterate
- * simple encrypt/decrypt with the plain, text, cipher text and key/
- *
- * CT = ENC (PT,EK)
- * PT = DEC (CT,DK)
- */
-
-/* -----
- * NOTE: currently an implmentation detail limits us to 8192 bit cipher block
- * size.  Changing MAX_BLOCK_SIZE in cipher.c can up that limit without 
- * causing any other compatibility issues. 
- *
- * Two local byte arrays are defined on the stack of 1024 bytes or 8192 bits.
- */
-KRYPTO_EXTERN rc_t CC KCipherEncryptECB (KCipher * self, const void * in, void * out,
-                                         uint32_t block_count);
-
-KRYPTO_EXTERN rc_t CC KCipherDecryptECB (KCipher * self, const void * in, void * out,
-                                         uint32_t block_count);
-
-/* ----------
- * Cipher-Block Chaining
- * CT = (FB = ENC (PT^IV, EK))
- * PT = DEC ((FB = CT), DK)
- *
- */
-KRYPTO_EXTERN rc_t CC KCipherEncryptCBC (KCipher * self, const void * in, void * out,
-                                         uint32_t block_count);
-
-KRYPTO_EXTERN rc_t CC KCipherDecryptCBC (KCipher * self, const void * in, void * out,
-                                         uint32_t block_count);
-
-/* ----------
- * Propagating cipher-block chaining
- * FB = PT ^ (CT = ENC ((PT^IV), EK))
- * FB = CT ^ (PT = DEC (CT,DK) ^ IV)
- */
-
-/* not yet implemented */
-
-/* ----------
- * Cipher Feedback
- * CT = (FB = PT) ^ ENC (IV, EK))
- * PT = (FB = CT) ^ ENC (IV, DK)
- *
- * NOTE the use of the encrypt function for decryption
- *
- * Not implemented as the openssl does something different
- */
-KRYPTO_EXTERN
-rc_t CC KCipherEncryptCFB (KCipher * self, const void * in, void * out,
-                           uint32_t block_count);
-
-KRYPTO_EXTERN
-rc_t CC KCipherDecryptCFB (KCipher * self, const void * in, void * out,
-                           uint32_t block_count);
-
-KRYPTO_EXTERN
-rc_t CC KCipherEncryptPCFB (KCipher * self, const void * in, void * out,
-                            uint32_t block_count);
-
-KRYPTO_EXTERN
-rc_t CC KCipherDecryptPCFB (KCipher * self, const void * in, void * out,
-                            uint32_t block_count);
-
-/* ----------
- * Output Feedback
- * CT = PT ^ (FB = ENC (IV, EK))
- * PT = CT ^ (FB = ENC (IV, DK))
- *
- * NOTE the use of the encrypt function for decryption
- *
- * Not implemented as the openssl does something different
- */
-KRYPTO_EXTERN
-rc_t CC KCipherEncryptOFB (KCipher * self, const void * in, void * out,
-                           uint32_t block_count);
-
-KRYPTO_EXTERN
-rc_t CC KCipherDecryptOFB (KCipher * self, const void * in, void * out,
-                           uint32_t block_count);
-
-/* ----------
- * Counter
- * IV is a nonce and not re-used as FB
- * CT = PT ^ ENC (N, EK)
- * PT = CT ^ ENC (N, DK)
- *
- * NOTE the use of the encrypt function for decryption
- *
- * nonce is a function that given an iv generates the next iv
- *
- */
-KRYPTO_EXTERN
-rc_t CC KCipherEncryptCTR (KCipher * self, const void * in,
-                           void * out, uint32_t block_count);
-KRYPTO_EXTERN
-rc_t CC KCipherDecryptCTR (KCipher * self, const void * in,
-                           void * out, uint32_t block_count);
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_cipher_ */
diff --git a/interfaces/krypto/ciphermgr-priv.h b/interfaces/krypto/ciphermgr-priv.h
deleted file mode 100644
index 943e067..0000000
--- a/interfaces/krypto/ciphermgr-priv.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-
-
-#endif /* #ifndef _h_krypto_manager_priv_ */
diff --git a/interfaces/krypto/ciphermgr.h b/interfaces/krypto/ciphermgr.h
deleted file mode 100644
index 2534400..0000000
--- a/interfaces/krypto/ciphermgr.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_krypto_manager_
-#define _h_krypto_manager_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* enabled/disable a set of in-house clean;y written aes ciphers. some optimize
- * for certain c processors */
-
-#define USE_NCBI_AES 1
-
-
-/*--------------------------------------------------------------------------
- * KCipherManager
- */
-struct KCipher;
-
-typedef struct KCipherManager KCipherManager;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KRYPTO_EXTERN
-rc_t CC KCipherManagerAddRef (const KCipherManager *self);
-
-KRYPTO_EXTERN
-rc_t CC KCipherManagerRelease (const KCipherManager *self);
-
-
-/* MakeCipher
- */
-typedef uint32_t kcipher_type;
-enum
-{
-    kcipher_null, /* no encryption = just a copy */
-    kcipher_AES,
-    kcipher_count
-};
-
-
-KRYPTO_EXTERN
-rc_t CC KCipherManagerMakeCipher (const KCipherManager * self,
-                                  struct KCipher ** cipher,
-                                  kcipher_type type);
-
-/* Make
- */
-KRYPTO_EXTERN
-rc_t CC KCipherManagerMake (KCipherManager ** pmanager);
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_manager_ */
diff --git a/interfaces/krypto/encfile-priv.h b/interfaces/krypto/encfile-priv.h
deleted file mode 100644
index 79d2fd1..0000000
--- a/interfaces/krypto/encfile-priv.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_encfile_priv_
-#define _h_krypto_encfile_priv_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <krypto/encfile.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define DEBUG_STS(msg)     DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_STS),msg)
-#define DEBUG_CFG(msg)     DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_CFG_,msg)
-#define DEBUG_ENCRYPT(msg) DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_ENCRYPT),msg)
-#define DEBUG_DECRYPT(msg) DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_DECRYPT),msg)
-
-/* -----
- * Encrypted file structure:
- *   - File Header
- *   - zero or more data blocks
- *   - file footer
- *
- * File Header:
- *   - file signature "NCBInenc"
- *   - byte order flag 
- *   - version
- *
- * Data Block:
- *   - rkey - randomly generated 32 byte key for this block (encrypted using user key)
- *   - encrypted block of 32768 bytes size above says how many are really used (encrypted using rkey and salt above)
- *   - block-offset + (valid bytes in block % 32768)
- *   - crc-32 (includes phantom block start offset as initial seed)
- *
- * File Footer:
- *   - footer signature "foot"
- *   - checksum of crcs
- */
-
-
-/* ----------------------------------------------------------------------
- * Header - the file header
- * all constant values for the first version
- */
-typedef char KEncFileSig [8];
-typedef uint32_t Endian_t;
-typedef uint32_t KEncFileVersion;
-
-
-typedef struct KEncFileHeader KEncFileHeader;
-struct KEncFileHeader
-{
-    KEncFileSig     file_sig;   /* "NCBInenc" or "NCBIkenc" */
-    Endian_t        byte_order; /* do we byte swap on read? */
-    KEncFileVersion version;    /* simple incrementation starting at 1 */
-};
-
-
-/* ----------------------------------------------------------------------
- * KEncFileBlock
- *    The body of the file is blocks containing a portion of the decrypted
- *    file.  These are an ordered sequence with the last block being the
- *    same size as the rest but with only some of the data portion being
- *    a part of the file.
- *
- *    An crypted file is longer than an unencrypted file by 
- *       a constant: the lengths of the header and the footer
- *       proportinally by the length of the block key and crc
- */
-
-/* -----
- * Key  the header for an encrypted block
- *
- * when initialized the first 38 bytes should be set to random data.
- * valid is a count of how many bytes in the block are valid data
- * offset is the offset of this block with in the decrypted file
- */
-typedef uint8_t KEncFileKey [32];
-
-
-/* -----
- * We sized the data portion of a block to match the KPageFile
- * structure allowing a KBufFile in front of a KEncFile to
- * operate in a fairly efficient manner
- */
-#define ENC_DATA_BLOCK_SIZE     (32*1024)
-typedef uint8_t KEncFileData [ENC_DATA_BLOCK_SIZE];
-
-typedef uint16_t KEncFileOffValid;
-
-typedef uint64_t KEncFileBlockId;
-typedef uint16_t KEncFileBlockValid;
-
-/* -----
- * we use the same 32 bit CRC as the rest of the project
- */
-typedef uint32_t KEncFileCRC;
-
-
-/*
- * NOTE:
- * The size of data + u + id + crc + crc_copy must remain divisible
- * by the size of key
- */
-typedef struct KEncFileBlock KEncFileBlock;
-struct KEncFileBlock
-{
-    KEncFileKey         key;  /* encrypted with the user key */
-    KEncFileData        data; /* encrypted with block key */
-    union
-    {
-        KEncFileBlockValid  valid; /* obscured and encrypted */
-        uint8_t bytes [16];        /* mostly fill */
-    } u;
-    KEncFileBlockId     id;        /* plain text */
-    KEncFileCRC         crc;       /* plain text */
-    KEncFileCRC         crc_copy;  /* plain text */
-};
-
-
-/* ----------------------------------------------------------------------
- * Foot - the ending of an encrypted file: 
- *   these are in plan text for non-decryption validation of the whole file
- *
- * In Version 1 the crc_checksum is required.
- * In Version 2 the crc_checksum is optional - if 0 it is not computed.
- */
-typedef uint64_t KEncFileFooter_t;
-typedef struct KEncFileFooter KEncFileFooter;
-struct KEncFileFooter
-{
-    KEncFileFooter_t block_count;  /* how many blocks do we have? */
-    KEncFileFooter_t crc_checksum; /* sum of crcs of all blocks */
-};
-
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeRead_v1 (const struct KFile ** pself,
-                                           const struct KFile * encrypted_input,
-                                           const struct KKey * key);
-
-KRYPTO_EXTERN rc_t CC KEncFileMakeRead_v2 (const struct KFile ** pself,
-                                           const struct KFile * encrypted_input,
-                                           const struct KKey * key);
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through from the
- * first byte to the last.
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeWrite_v1 (struct KFile ** pself,
-                                            struct KFile * encrypted_output,
-                                            const struct KKey * key);
-
-KRYPTO_EXTERN rc_t CC KEncFileMakeWrite_v2 (struct KFile ** pself,
-                                            struct KFile * encrypted_output,
-                                            const struct KKey * key);
-
-
-/* ----------
- * Update mode is read/write mode where seeking within the file is allowed.
- *
- * NOTE this is in the private interface because it is not actually working
- * yet.
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeUpdate_v1 (struct KFile ** pself, 
-                                             struct KFile * encrypted,
-                                             const struct KKey * key);
-
-KRYPTO_EXTERN rc_t CC KEncFileMakeUpdate_v2 (struct KFile ** pself, 
-                                             struct KFile * encrypted,
-                                             const struct KKey * key);
-
-
-/* ----------
- * Validate mode can not be read or written.
- * Upon open the whole file is read from begining to end and all CRC
- * and other integrity checks are performed immedaitely
- */
-KRYPTO_EXTERN rc_t CC KEncFileValidate_v1 (const struct KFile * encrypted);
-
-KRYPTO_EXTERN rc_t CC KEncFileValidate_v2 (const struct KFile * encrypted);
-
-
-/* ----------
- * Identify whether a file is a KEncFile type encrypted file by the header.
- * read the header into a buffer and pass it into this function.  
- * The buffer_size needs to be at least 8 but more bytes lead to a better
- * check up to the size of the header of a KEncFile type encrypted file.
- * As the header may change in the future (in a backwards compatible way)
- * that size might change from the current 16.
- *
- * Possible returns:
- * 0:
- *      the file is an identified KEncFile type file.  False positives are
- *      possible if a file happens to match at 8 or more bytes
- *
- * RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType)
- *      the file is definitely not a KEncFIle type encrypted file.
- *     
- * RC (rcFS, rcFile, rcIdentifying, rcParam, rcNull)
- *      bad parameters in the call
- *
- * RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient)
- *      not a large enough buffer to make an identification
- */
-KRYPTO_EXTERN rc_t CC KFileIsEnc_v1 (const char * buffer, size_t buffer_size);
-
-KRYPTO_EXTERN rc_t CC KFileIsEnc_v2 (const char * buffer, size_t buffer_size);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_krypto_encfile_priv_ */
diff --git a/interfaces/krypto/encfile.h b/interfaces/krypto/encfile.h
deleted file mode 100644
index df8efe1..0000000
--- a/interfaces/krypto/encfile.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*
- * This needs to be changed to true in about the middle of summer 2013
- *
- * When re-enabling this feature also fix test/kreypto/Makefile
- */
-#define SENC_IS_NENC_FOR_WRITER 0
-
-
-#ifndef _h_krypto_encfile_
-#define _h_krypto_encfile_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-struct KKey;
-
-typedef struct KEncFile KEncFile;
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- *
- * One difference between update and read mode is the handling of
- * "missing blocks". Open for update will read a missing block as all
- * zero while 
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeRead (const struct KFile ** pself,
-                                        const struct KFile * encrypted_input,
-                                        const struct KKey * key);
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through from the
- * first byte to the last.
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeWrite (struct KFile ** pself,
-                                         struct KFile * encrypted_output,
-                                         const struct KKey * key);
-
-
-/* ----------
- * Update mode is read/write mode where seeking within the file is allowed.
- * 
- * One difference between update and read mode is the handling of
- * "missing blocks". Open for update will read a missing block as all
- * zero while 
- */
-KRYPTO_EXTERN rc_t CC KEncFileMakeUpdate (struct KFile ** pself, 
-                                          struct KFile * encrypted,
-                                          const struct KKey * key);
-
-
-/* ----------
- * Validate mode can not be read or written.
- * Upon open the whole file is read from begining to end and all CRC
- * and other integrity checks are performed immedaitely
- */
-KRYPTO_EXTERN rc_t CC KEncFileValidate (const struct KFile * encrypted);
-
-
-/* ----------
- * Identify whether a file is a KEncFile type encrypted file by the header.
- * read the header into a buffer and pass it into this function.  
- * The buffer_size needs to be at least 8 but more bytes lead to a better
- * check up to the size of the header of a KEncFile type encrypted file.
- * As the header may change in the future (in a backwards compatible way)
- * that size might change from the current 16.
- *
- * Possible returns:
- * 0:
- *      the file is an identified KEncFile type file.  False positives are
- *      possible if a file happens to match at 8 or more bytes
- *
- * RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType)
- *      the file is definitely not a KEncFIle type encrypted file.
- *     
- * RC (rcFS, rcFile, rcIdentifying, rcParam, rcNull)
- *      bad parameters in the call
- *
- * RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient)
- *      not a large enough buffer to make an identification
- */
-
-/* requires NCBInenc or NCBIsenc or signature but if available
- * checks the byte order and version fields
- */
-KRYPTO_EXTERN rc_t CC KFileIsEnc (const char * buffer, size_t buffer_size);
-
-/* same as above but requires NCBIsenc signature only */
-KRYPTO_EXTERN rc_t CC KFileIsSraEnc (const char * buffer, size_t buffer_size);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_krypto_encfile_ */
diff --git a/interfaces/krypto/extern.h b/interfaces/krypto/extern.h
deleted file mode 100644
index 4663585..0000000
--- a/interfaces/krypto/extern.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_extern_
-#define _h_krypto_extern_
-
-#ifndef _h_klib_callconv_
-#include <klib/callconv.h>
-#endif
-
-#if ! defined EXPORT_LATCH && _LIBRARY
-
-#define KRYPTO_EXTERN LIB_EXPORT
-#define KRYPTO_EXTERN_DATA extern LIB_EXPORT
-#define EXPORT_LATCH 1
-
-#else
-
-#define KRYPTO_EXTERN LIB_IMPORT
-#define KRYPTO_EXTERN_DATA LIB_IMPORT
-
-#endif
-
-#if defined _MSC_VER && ! _STATIC
-
-/* __declspec ( dllimport ) will cause creation of
-   function pointers rather than thunks, which makes
-   the code that imports unable to link statically
-   against a library. we leave this symbol defined as
-   "extern" to use thunks instead. as a result, all
-   function addresses resolve to the thunk and not
-   the actual function. */
-#define LIB_IMPORT extern
-#define LIB_EXPORT __declspec ( dllexport )
-
-#else
-
-#define LIB_IMPORT extern
-#define LIB_EXPORT
-
-#endif
-
-#endif /* _h_krypto_extern_ */
diff --git a/interfaces/krypto/key.h b/interfaces/krypto/key.h
deleted file mode 100644
index f170d7d..0000000
--- a/interfaces/krypto/key.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_key_
-#define _h_kfs_key_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct KKey KKey;
-
-
-typedef uint32_t KKeyType;
-enum eKKeyType
-{
-    kkeyNone,
-    kkeyAES128,
-    kkeyAES192,
-    kkeyAES256,
-    kkeyTypeCount
-};
-
-#define KKeyTypeDefault (kkeyAES128)
-
-struct KKey
-{
-    KKeyType type;
-    uint8_t  text [32]; /* might be more, might be less */
-};
-
-enum eKKeySize
-{
-    kkeyMinimumSize = 6
-};
-
-KRYPTO_EXTERN_DATA KKey KKeyEncrypt;
-KRYPTO_EXTERN_DATA KKey KKeyDecrypt;
-
-/* WGA ncryption passwords are only significant to 32 characters */
-#define WGA_MAX_PASSWORD (32)
-KRYPTO_EXTERN_DATA char WGAEncryptPassword[WGA_MAX_PASSWORD];
-KRYPTO_EXTERN_DATA char WGADecryptPassword[WGA_MAX_PASSWORD];
-
-typedef char KryptoKeyMapNCBI [32*2];
-typedef char KryptoKeyMapWGA  [2 + 32*2];
-typedef char KryptoKeyMap [(2*sizeof(KryptoKeyMapNCBI))+(2*sizeof(KryptoKeyMapWGA))+1];
-enum
-{
-    KryptoKeyMapEncrypt = 0,
-    KryptoKeyMapDecrypt = sizeof(KryptoKeyMapNCBI),
-    KryptoKeyMapWGAEncrypt = KryptoKeyMapDecrypt + sizeof(KryptoKeyMapNCBI),
-    KryptoKeyMapWGADecrypt = KryptoKeyMapWGAEncrypt + sizeof(KryptoKeyMapWGA),
-    KryptoKeyMapNul = KryptoKeyMapWGADecrypt + sizeof(KryptoKeyMapWGA)
-};
-
-KRYPTO_EXTERN  rc_t CC KKeyInitRead (KKey * self, KKeyType key_type, 
-                                     const void * password, size_t password_size);
-
-KRYPTO_EXTERN rc_t CC KKeyInitUpdate (KKey * key, KKeyType key_type, 
-                                      const void * password, size_t password_size);
-
-
-#define FAIL_SHORT_PASSWORD (false)
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_key_ */
diff --git a/interfaces/krypto/manager-priv.h b/interfaces/krypto/manager-priv.h
deleted file mode 100644
index f2f3346..0000000
--- a/interfaces/krypto/manager-priv.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#error "OBSOLETE do not use"
diff --git a/interfaces/krypto/manager.h b/interfaces/krypto/manager.h
deleted file mode 100644
index 0581659..0000000
--- a/interfaces/krypto/manager.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_manager_
-#define _h_krypto_manager_
-
-
-DO NOT USE
-
-#endif /* _h_krypto_manager_ */
diff --git a/interfaces/krypto/reencfile.h b/interfaces/krypto/reencfile.h
deleted file mode 100644
index 02d4894..0000000
--- a/interfaces/krypto/reencfile.h
+++ /dev/null
@@ -1,91 +0,0 @@
-
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_reencfile_
-#define _h_krypto_reencfile_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Currently only the read version is implmented
- */
-#define REENCFILE_WRITE_SUPPORTED 0
-/*
- * Currently the input encrypted KFile must respond to KFileSize
- * with the size of the encrypted file. 
- */
-#define REENCFILE_STREAM_SUPPORTED 0
-
-
-struct KFile;
-struct KKey;
-
-typedef struct KReencFile KReencFile;
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-KRYPTO_EXTERN rc_t CC KReencFileMakeRead (const struct KFile ** pself, 
-                                          const struct KFile * encrypted,
-                                          const struct KKey * deckey,
-                                          const struct KKey * enckey);
-
-KRYPTO_EXTERN rc_t CC KEncryptFileMakeRead (const struct KFile ** pself, 
-                                            const struct KFile * encrypted,
-                                            const struct KKey * enckey);
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through form the
- * first byte to the last.
- */
-#if REENCFILE_WRITE_SUPPORTED
-KRYPTO_EXTERN rc_t CC KReencFileMakeWrite (struct KFile ** pself, 
-                                           struct KFile * encrypted,
-                                           const struct KKey * deckey,
-                                           const struct KKey * enckey);
-#endif
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_krypto_reencfile_ */
diff --git a/interfaces/krypto/rng-impl.h b/interfaces/krypto/rng-impl.h
deleted file mode 100644
index 96d03fe..0000000
--- a/interfaces/krypto/rng-impl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kryptoimpl_
-#define _h_kryptoimpl_
-
-#include <krypto/extern.h>
-#include <krypto/rng.h>
-#include <klib/refcount.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-typedef union KRng_vt KRng_vt;
-
-struct KRng
-{
-    const union KRng_vt *vt;
-    KRefcount refcount;
-};
-
-#ifndef KRNG_IMPL
-#define KRNG_IMPL KRng
-#endif
-
-typedef struct KRng_vt_v1 KRng_vt_v1;
-struct KRng_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t (CC * destroy) (KRNG_IMPL * self);
-    rc_t (CC * seed)    (KRNG_IMPL * self);
-    rc_t (CC * reseed)  (KRNG_IMPL * self, const void * buff, size_t buff_size);
-    rc_t (CC * read)    (const KRNG_IMPL *self, void * buff, uint32_t buff_len,
-                         uint32_t * num_read);
-    /* end minor version == 0 */
-    /* start minor version == 1 */
-    /* end minor version == 1 */
-    /* end version == 1.x */
-};
-
-union KRng_vt
-{
-    KRng_vt_v1 v1;
-};
-
-KRYPTO_EXTERN rc_t CC KRngInit (KRng * self, union KRng_vt * vt, const char * type);
-KRYPTO_EXTERN rc_t CC KRngSysEntropy (KRng * self, uint8_t * buffer, size_t size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kryptoimpl_ */
diff --git a/interfaces/krypto/rng.h b/interfaces/krypto/rng.h
deleted file mode 100644
index 32b0d47..0000000
--- a/interfaces/krypto/rng.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_rng_
-#define _h_krypto_rng_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct KRng KRng;
-
-/* attach a new 'ownership' reference */
-KRYPTO_EXTERN rc_t CC KRngAddRef (const KRng * self);
-
-/* release an 'ownership' reference */
-KRYPTO_EXTERN rc_t CC KRngRelease (const KRng * self);
-
-/* call to the system entropy function and [re-]seed the rng */
-KRYPTO_EXTERN rc_t CC KRngSeed (KRng * self);
-
-/* fill a buffer of a given size with random values: type sepcific as to the meaning or size of elements
- * return the number of elements actually written to the buffer */
-KRYPTO_EXTERN rc_t CC KRngRead (const KRng * self, void * buffer, uint32_t bsize, uint32_t * num_read);
-
-
-/*
- * Cryptographically secure pseudo-random number generator
- * elements are 8 bits long
- */
-KRYPTO_EXTERN rc_t CC KCSPRngMake (KRng ** pself);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_krypto_rng_ */
diff --git a/interfaces/krypto/testciphermgr.h b/interfaces/krypto/testciphermgr.h
deleted file mode 100644
index ffaa35a..0000000
--- a/interfaces/krypto/testciphermgr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_krypto_manager_test_
-#define _h_krypto_manager_test_
-
-#include <krypto/ciphermgr.h>
-
-/* MakeCipher
- */
-typedef int32_t kcipher_subtype;
-enum
-{
-    ksubcipher_none = -1,
-    ksubcipher_byte,
-    ksubcipher_vec,
-    ksubcipher_vecreg,
-    ksubcipher_accelerated, /* for example AES-NI */ 
-    ksubcipher_count
-};
-
-extern kcipher_subtype KCipherSubType;
-
-
-KRYPTO_EXTERN
-rc_t CC KCipherManagerTestMakeCipher (const KCipherManager * self,
-                                      struct KCipher ** cipher,
-                                      kcipher_type type,
-                                      kcipher_subtype subtype);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_manager_ */
diff --git a/interfaces/krypto/wgaencrypt.h b/interfaces/krypto/wgaencrypt.h
deleted file mode 100644
index b8cfeeb..0000000
--- a/interfaces/krypto/wgaencrypt.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_wgaencryptfile_
-#define _h_krypto_wgaencryptfile_
-
-#ifndef _h_krypto_extern_
-#include <krypto/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-
-
-/*--------------------------------------------------------------------------
- * KFile
- *  wga extensions
- */
-
-/* MakeWGAEncRead
- *
- * Parameters:
- *   pself is a KFile that will represent the unencrypted side of operations.
- *
- *   encrypted is a KFile that will represent the encrypted side of operations.
- *
- *   key is an arbitrary array of characters
- *
- *   key_size is how many bytes to use from key.  Maximum used is 256.
- *
- *   encoding is one of the three values defined by FER_ENCODING above.  Any
- *   other values will cause a failure.
- *
- * KFileMakeWGAEncRead
- *   A file opened for read can only read and decrypt an encrypted file.  Seeks
- *   within the file are allowed if the KFile for the encrypted file allows
- *    seeks.
- * 
- * KFileMakeWGAEncUpdate
- *   A file opened for update must be able to read and write from the encrypted
- *   file.  Seeks within the file are allowed if the KFile for the encrypted 
- *   file allows seeks.
- *
- * KFileMakeWGAEncRead
- *   A Write opened file can only be written.  Seeks backwards are not allowed.
- *   Seeks forward will cause NUL data bytes to be inserted before encryption.
- *   An attempt will be made to truncate the encrypted file but failure of that
- *   operation will not fail this call.  Writes will begin at position 0.  If
- *   the file already existed and could not be truncated a corrupt file will
- *   result if the whole of the old contents are not over-written.
- *
- *
- * NOTE: cipher must be of type kcipherAES
- *
- */
-KRYPTO_EXTERN rc_t CC KFileMakeWGAEncRead (const struct KFile ** pself, 
-                                           const struct KFile * encrypted,
-                                           const char * key,
-                                           size_t key_size);
-
-
-/* IsWGAEnc
- *  identify whether a file is a KFileWGAEnc type encrypted file by the header.
- *  read the header into a buffer and pass it into this function.  
- *  The buffer_size needs to be at least 8 but more bytes lead to a better
- *  check up to the size of the header of a KFileWGAEnc type encrypted file.
- *  This file type is deprecated and is not versioned.  Hopefully we won't
- *  have to deal with changes to the format.
- *
- * Possible returns:
- *  0:
- *      the file is an identified KFileWGAEnc type file.  False positives are
- *      possible if a file happens to match at 8 or more bytes
- *
- *  RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType)
- *      the file is definitely not a KFileWGAEnc type encrypted file.
- *     
- *  RC (rcFS, rcFile, rcIdentifying, rcParam, rcNull)
- *      bad parameters in the call
- *
- *  RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient)
- *      not a large enough buffer to make an identification
- */
-KRYPTO_EXTERN rc_t CC KFileIsWGAEnc (const void * buffer, size_t buffer_size);
-
-KRYPTO_EXTERN rc_t CC WGAEncValidate (const struct KFile * file, 
-                                      const char * password,
-                                      size_t password_size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_wgaencryptfile_ */
diff --git a/interfaces/ktst/test_tools.hpp b/interfaces/ktst/test_tools.hpp
deleted file mode 100644
index b6644da..0000000
--- a/interfaces/ktst/test_tools.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _h_ktst_test_tools_
-#define _h_ktst_test_tools_
-
-////////////////////////////////////////////////////////////////////////////////
-// these macros are available outside of test cases' code
-
-#define LOG(log_level, msg) \
-if (log_level >= ncbi::NK::TestEnv::verbosity) std::cerr << msg
-
-#define TEST_MESSAGE(M) \
-{ ncbi_NK_saveLocation(__FILE__,__LINE__); \
-    LOG(ncbi::NK::LogLevel::e_message, M << std::endl); }
-
-#define TEST_CHECKPOINT(M) TEST_MESSAGE(M)
-
-// report failure from a fixture
-#define FAIL( msg_ )     \
-      _REPORT_CRITICAL_ERROR_( (msg_), __FILE__, __LINE__, true )
-
-#define GET_TEST_SUITE ncbi::NK::GetTestSuite
-
-#endif// _h_ktst_test_tools_
diff --git a/interfaces/ktst/unit_test.hpp b/interfaces/ktst/unit_test.hpp
deleted file mode 100644
index 1cdbd50..0000000
--- a/interfaces/ktst/unit_test.hpp
+++ /dev/null
@@ -1,249 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_ktst_unit_test_
-#define _h_ktst_unit_test_
-
-#include <ktst/unit_test_suite.hpp>
-
-////////////////////////////////////////////////////////////////////////////////
-namespace ncbi { namespace NK {
-
-// a utility template used to pass test character string case names to FixtureTestCase
-template<class T>
-struct TestCaseTraits
-{
-    static const char* name;
-};
-
-// create an executable test case class with the given fixture.
-template <class TCaseTraits, class TFixture>
-class FixtureTestCase : public ncbi::NK::TestCase, public TFixture { 
-public:
-    typedef TCaseTraits Traits;
-
-    // Represents the global test fixture. Cast to the correct data type in the test code
-    typedef void AUTO_TEST_CASE_FIXTURE;
-
-public: 
-    FixtureTestCase(void* globalFixture) 
-    : TestCase(TCaseTraits::name), _globalFixture (static_cast<AUTO_TEST_CASE_FIXTURE*>(globalFixture)) 
-    {
-    }
-
-protected: 
-    AUTO_TEST_CASE_FIXTURE* GET_GLOBAL_FIXTURE(void) const { return _globalFixture; } 
-    AUTO_TEST_CASE_FIXTURE* _globalFixture; 
-
-    const TFixture* GET_FIXTURE(void) const { return this; } 
-    TFixture* GET_FIXTURE(void) { return this; } 
-}; 
-
-// Create an invoker object for a test case with a given fixture.
-// The invoker object is static and registers itself with the global test suite during initialization.
-// When executed, the invoker will instantiate a fixture and a test case object and execute object's test method 
-// on the current thread.
-template <class TCase, class TFixture>
-class TestCaseInvoker : ncbi::NK::TestInvoker { 
-public: 
-    TestCaseInvoker() : TestInvoker(TCase::Traits::name) 
-    { 
-        ncbi::NK::GetTestSuite()->Add(this); 
-    } 
-private: 
-    virtual void Run(void* globalFixture) 
-    { 
-        try
-        { // in case constructor throws
-            TCase t(globalFixture); 
-            try { 
-                t.test_method(); 
-                SetErrorCounter(t.GetErrorCounter()); 
-            } catch (...) { 
-                SetErrorCounter(t.GetErrorCounter()); 
-                if (GetErrorCounter() == 0)
-                {
-                    SetErrorCounter(1);
-                }
-                throw; 
-            } 
-        }
-        catch (const execution_aborted&)
-        {
-            SetErrorCounter(1);
-            throw; 
-        } 
-        catch (const std::exception& ex)
-        {
-            if (!ncbi::NK::TestEnv::lastLocation.empty())
-            {
-                LOG(ncbi::NK::LogLevel::e_fatal_error, ncbi::NK::TestEnv::lastLocation << ": last checkpoint before exception \"" << ex.what() << "\"\n");
-            }        
-            SetErrorCounter(1);
-            throw; 
-        } 
-        catch (...) // a non-framework exception escaped
-        { 
-            if (!ncbi::NK::TestEnv::lastLocation.empty())
-            {
-                LOG(ncbi::NK::LogLevel::e_fatal_error, ncbi::NK::TestEnv::lastLocation << ": last checkpoint before an unknown exception\n");
-            }        
-            SetErrorCounter(1);
-            throw; 
-        } 
-    } 
-    static TestCaseInvoker instance;
-}; 
-
-// Create an out-of-thread invoker object for a test case with a given fixture.
-// The invoker object is static and registers itself with the global test suite during initialization.
-// When executed, the invoker will instantiate a fixture and a test case object and execute object's test method 
-// as a child process (Unix) or on a separate thread(Windows).
-template <class TCase, class TFixture, int rc, int timeout>
-class ProcessTestCaseInvoker : ncbi::NK::TestInvoker { 
-public: 
-    ProcessTestCaseInvoker() : TestInvoker(TCase::Traits::name) 
-    { 
-        ncbi::NK::GetTestSuite()->Add(this); 
-    } 
-private: 
-    virtual void Run(void* globalFixture) 
-    { 
-        try
-        {
-            TCase t(globalFixture); 
-            if (ncbi::NK::TestEnv::RunProcessTestCase(t, (void(ncbi::NK::TestCase::*)())&TCase::test_method, timeout) != rc)
-            {
-                throw ncbi::NK::execution_aborted(); 
-            }
-            SetErrorCounter(t.GetErrorCounter());
-        }
-        catch (...)
-        { 
-            if (GetErrorCounter() == 0)
-            {
-                SetErrorCounter(1);
-            }
-            throw; 
-        } 
-    }
-}; 
-
-}} // namespace
-
-// macros to be used to instantiate test cases
-
-// user code should not not use this directly. 
-#define DEFINE_TEST_CASE(testcase, F, rc, timeout) \
-    struct testcase { \
-        class dummy{}; \
-        typedef ncbi::NK::FixtureTestCase< ::ncbi::NK::TestCaseTraits<dummy>, F> Case;\
-        struct Instance : public Case { \
-            Instance(void* g) : Case(g){}\
-            void test_method(); } ; \
-        class Invoker : public ::ncbi::NK::TestCaseInvoker<Instance, F> {}; \
-        class ProcessInvoker : public ::ncbi::NK::ProcessTestCaseInvoker<Instance, F, rc, timeout> {}; \
-    };\
-    template<> const char* ::ncbi::NK::TestCaseTraits<testcase::dummy>::name=#testcase; 
-
-// define an in-thread test case with a fixture
-#define FIXTURE_TEST_CASE(testcase, F) \
-    DEFINE_TEST_CASE(testcase, F, 0, 0) \
-    static testcase::Invoker testcase##Invoker;\
-    void testcase::Instance::test_method()
-
-// define an in-thread test case without a fixture
-#define TEST_CASE(test_name) FIXTURE_TEST_CASE(test_name, ncbi::NK::Empty)
-
-// define an out-of-thread test case with a fixture, expected exit code, and a timeout (in seconds)
-#define PROCESS_FIXTURE_TEST_CASE(testcase, F, rc, timeout) \
-    DEFINE_TEST_CASE(testcase, F, rc, timeout) \
-    static testcase::ProcessInvoker testcase##Invoker;\
-    void testcase::Instance::test_method()
-
-// define an out-of-thread test case with an expected exit code and a timeout (in seconds), no fixture
-#define PROCESS_TEST_CASE(test_name, rc, timeout) PROCESS_FIXTURE_TEST_CASE(test_name, ncbi::NK::Empty, rc, timeout)
-
-// fix param type
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-#define DECLARE_EXTERN_C_ENTRYPOINTS                             \
-    extern "C"                                                   \
-    {                                                            \
-        rc_t CC UsageSummary ( const char *progname )            \
-        { return ncbi::NK::TestEnv::UsageSummary ( progname ); } \
-                                                                 \
-        rc_t CC Usage ( const Args *args )                       \
-        { return ncbi::NK::TestEnv::Usage ( args ); }            \
-    }
-#else
-#define DECLARE_EXTERN_C_ENTRYPOINTS
-#endif
-
-// define a suite of test cases with a global fixture 
-// Note: Typed access to global fixture from the test cases' code is not currently implemented
-#define FIXTURE_TEST_SUITE( suite_name, F ) \
-DECLARE_EXTERN_C_ENTRYPOINTS \
-typedef F AUTO_TEST_CASE_FIXTURE; \
-int suite_name(int argc, char* argv[]) { \
-    ncbi::NK::TestEnv args(argc, argv); \
-    if (args.catch_system_errors) { \
-        args.set_handlers(); \
-    } \
-    ncbi::NK::counter_t ec = ncbi::NK::Main<AUTO_TEST_CASE_FIXTURE>(argc, argv, #suite_name); \
-    return ec == 0 ? 0 : -ec; /* positive rc represents the signal that killed the process */ \
-} 
-
-// define a suite of test cases with a global fixture
-// with callback to handle application command line arguments
-#define FIXTURE_TEST_SUITE_WITH_ARGS_HANDLER( suite_name, F, Handler ) \
-DECLARE_EXTERN_C_ENTRYPOINTS \
-typedef F AUTO_TEST_CASE_FIXTURE; \
-int suite_name(int argc, char* argv[]) { \
-    ncbi::NK::TestEnv args(argc, argv, Handler); \
-    if (args.catch_system_errors) { \
-        args.set_handlers(); \
-    } \
-    ncbi::NK::counter_t ec = ncbi::NK::Main<AUTO_TEST_CASE_FIXTURE>(argc, argv, #suite_name); \
-    return ec == 0 ? 0 : -ec; /* positive rc represents the signal that killed the process */ \
-}
-
-// define a suite of test cases with a global fixture; command line parsing, Usage and UsageSummary functions are supplied by the user's code
-#define FIXTURE_TEST_SUITE_WITH_USAGE( suite_name, F ) \
-typedef F AUTO_TEST_CASE_FIXTURE; \
-int suite_name(int argc, char* argv[]) { \
-    ncbi::NK::TestEnv args(argc, argv); \
-    if (args.catch_system_errors) { \
-        args.set_handlers(); \
-    } \
-    ncbi::NK::counter_t ec = ncbi::NK::Main<AUTO_TEST_CASE_FIXTURE>(argc, argv, #suite_name); \
-    return ec == 0 ? 0 : -ec; /* positive rc represents the signal that killed the process */ \
-} 
-
-#define TEST_SUITE( suite_name ) FIXTURE_TEST_SUITE(suite_name, ncbi::NK::Empty)
-#define TEST_SUITE_WITH_USAGE( suite_name ) FIXTURE_TEST_SUITE_WITH_USAGE(suite_name, ncbi::NK::Empty)
-#define TEST_SUITE_WITH_ARGS_HANDLER( suite_name, Handler ) FIXTURE_TEST_SUITE_WITH_ARGS_HANDLER(suite_name, ncbi::NK::Empty, Handler)
-
-#endif// _h_ktst_unit_test_
diff --git a/interfaces/ktst/unit_test_suite.hpp b/interfaces/ktst/unit_test_suite.hpp
deleted file mode 100644
index 0e12d68..0000000
--- a/interfaces/ktst/unit_test_suite.hpp
+++ /dev/null
@@ -1,481 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef NCBI_NK_UNIT_TEST__SUITE_HPP
-#define NCBI_NK_UNIT_TEST__SUITE_HPP
-
-// turn on INT64_C, UINT64_C etc.
-#define __STDC_CONSTANT_MACROS
-#include <klib/defs.h>
-
-#include <string>
-#include <vector>
-#include <cassert>
-#include <iostream>
-
-// it's generally a bad idea to make the test suite rely upon code under test
-#define ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED 0
-
-////////////////////////////////////////////////////////////////////////////////
-// these macros are available outside of test cases' code
-
-#define LOG(log_level, msg) \
-    if (log_level >= ncbi::NK::TestEnv::verbosity) std::cerr << msg
-
-#define TEST_MESSAGE(M) \
-{ ncbi::NK::saveLocation(__FILE__,__LINE__); \
-    LOG(ncbi::NK::LogLevel::e_message, M << std::endl); }
-
-#define TEST_CHECKPOINT(M) TEST_MESSAGE(M)
-
-// report failure from a fixture
-#define FAIL( msg_ )     \
-      ncbi::NK::_REPORT_CRITICAL_ERROR_( (msg_), __FILE__, __LINE__, true )
-
-#define GET_TEST_SUITE ncbi::NK::GetTestSuite
-
-////////////////////////////////////////////////////////////////////////////////
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-struct Args;
-#endif
-
-namespace ncbi { namespace NK { 
-
-typedef int counter_t; 
-
-class Empty {};
-
-class execution_aborted {};
-
-class LogLevel {
-public:
-    enum E {
-        e_undefined,
-        e_all,
-        e_test_suite,
-        e_message,
-        e_warning,
-        e_error,
-        e_fatal_error,
-        e_nothing
-    };
-};
-
-extern void saveLocation(const char* file, int line);
-extern void _REPORT_CRITICAL_ERROR_(const std::string& msg, const char* file, int line, bool is_msg);
-
-template<class T> const T abs(const T& a) { return a >= 0 ? a : -a; }
-
-class TestCase;
-
-class TestEnv {
-public:
-    typedef rc_t ArgsHandler(int argc, char* argv[]);
-
-    TestEnv(int argc, char* argv[], ArgsHandler *argsHandler = NULL);
-    ~TestEnv(void);
-
-    static void set_handlers(void);
-
-    static std::string lastLocation;
-    static LogLevel::E verbosity;
-    bool catch_system_errors;
-
-    static int RunProcessTestCase(TestCase&, void(TestCase::*)(), int);
-    static unsigned int Sleep(unsigned int seconds);
-    
-    static const int TEST_CASE_TIMED_OUT=14;
-    static const int TEST_CASE_FAILED=255;
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-    static struct Args* GetArgs() { return args; }
-#endif
-
-    static rc_t UsageSummary(const char* progname);
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-    static rc_t Usage(const Args* args);
-#else
-    static rc_t Usage(const char *progname);
-#endif
-
-    static bool in_child_process;
-    static std::string GetPidString();
-
-private:
-    static void TermHandler();
-
-    static void SigHandler(int sig);
-
-    rc_t process_args(int argc, char* argv[], ArgsHandler* argsHandler);
-
-    int argc2;
-    char** argv2;
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-    static struct Args* args;
-#endif
-};
-
-class TestCase {
-protected:
-    TestCase(const std::string& name);
-
-public:
-    ncbi::NK::counter_t GetErrorCounter(void) { return _ec; }
-    const std::string& GetName(void) const { return _name; }
-    void ErrorCounterAdd(ncbi::NK::counter_t ec) { _ec += ec; }
-
-protected:
-    void report_error(const char* msg, const char* file, int line, bool is_msg = false, bool isCritical = false);
-
-    void report_passed(const char* msg, const char* file, int line);
-
-    template<class T1>
-    void report_error2(const char* e1, const char* e2, T1 t1, T1 t2,
-        const char* file, int line, const char* eq, const char* ne,
-        bool isCritical = false)
-    {
-        ncbi::NK::saveLocation(file, line);
-        ++_ec;
-        LOG(LogLevel::e_error, file << "(" << line << "): ");
-        if (isCritical) {
-            LOG(LogLevel::e_error, "fatal ");
-        }
-        LOG(LogLevel::e_error, "error in \"" << _name << "\": ");
-        if (isCritical) {
-            LOG(LogLevel::e_error, "critical ");
-        }
-        LOG(LogLevel::e_error, "check " << e1 << " " << eq << " " << e2
-            << " failed [" << t1 << " " << ne << " " << t2 << "]");
-        LOG(LogLevel::e_error, std::endl);
-        if (isCritical)
-        { throw ncbi::NK::execution_aborted(); }
-    }
-    // pointers reported as ints (otherwise << may crash if given an invalid pointer)
-    template<class T1>
-    void report_error2(const char* e1, const char* e2, const T1* t1, const T1* t2,
-        const char* file, int line, const char* eq, const char* ne,
-        bool isCritical = false)
-    {
-        report_error2(e1, e2, (uint64_t)t1, (uint64_t)t2,file, line, eq, ne,isCritical);
-    }
-    template<class T1>
-    void report_error2(const char* e1, const char* e2, T1* t1, T1* t2,
-        const char* file, int line, const char* eq, const char* ne,
-        bool isCritical = false)
-    {
-        report_error2(e1, e2, (uint64_t)t1, (uint64_t)t2,file, line, eq, ne,isCritical);
-    }
-
-
-    template<class T1, class T2>
-    void report_passed2(const char* e1, const char* e2,
-        const T1& t1, const T2& t2,
-        const char* file, int line, const char* eq, const char* ne)
-    {
-        ncbi::NK::saveLocation(file, line);
-        LOG(LogLevel::e_all, file << "(" << line << "): info: "
-            "check " << e1 << " " << eq << " " << e2 << " passed" << std::endl);
-    }
-
-    template<class T1, class T2, class T3>
-    void report_passed_close(const char* e1, const char* e2,
-        const T1& t1, const T2& t2, const T3& tolerance,
-        const char* file, int line)
-    {
-        ncbi::NK::saveLocation(file, line);
-        LOG(LogLevel::e_all, file << "(" << line << "): "
-            "info: difference between "
-            << e1 << "{" << t1 << "} and " << e2 << "{" << t2 << "} "
-            "doesn't exceed " << tolerance << std::endl);
-    }
-
-    template<class T1, class T2, class T3, class T4>
-    void report_error_close(const char* e1, const char* e2,
-        const T1& t1, const T2& t2, const T3& tolerance, const T4& diff,
-        const char* file, int line, bool isCritical = false)
-    {
-        ncbi::NK::saveLocation(file, line);
-        ++_ec;
-        LOG(LogLevel::e_error, file << "(" << line << "): ");
-        if (isCritical) {
-            LOG(LogLevel::e_error, "fatal ");
-        }
-        LOG(LogLevel::e_error, "error in \"" << _name << "\": "
-            "difference{" << diff << "} between "
-            << e1 << "{" << t1 << "} and " << e2 << "{" << t2 << "} "
-            "exceeds " << tolerance << std::endl);
-        if (isCritical)
-        { throw ncbi::NK::execution_aborted(); }
-    }
-
-    void _REPORT_CRITICAL_ERROR_(const std::string& msg, const char* file, int line, bool is_msg = false);
-
-#define CHECK(exp)       \
-  ( (exp)                      \
-      ? report_passed((#exp), __FILE__, __LINE__) \
-      : report_error ((#exp), __FILE__, __LINE__) )
-
-/* TODO #define CHECK_MESSAGE(exp, M)       \
-  std::ostringstream s, s << M, \
-  ( (exp)                      \
-      ? report_passed(s.str(),__FILE__,__LINE__) \
-      : report_error (s.str(),__FILE__,__LINE__) )*/
-
-#define REQUIRE(exp)     \
-  ( (exp)                      \
-      ? report_passed        ((#exp), __FILE__, __LINE__) \
-      : _REPORT_CRITICAL_ERROR_((#exp), __FILE__, __LINE__) )
-
-#define CHECK_CLOSE(left, right, tolerance) \
-( (ncbi::NK::abs((left) - (right)) < (tolerance)) \
-?report_passed_close(#left,#right,(left),(right),(tolerance),__FILE__,__LINE__)\
-: report_error_close(#left,#right,(left),(right),(tolerance), \
-    ncbi::NK::abs((left) - (right)), __FILE__, __LINE__) )
-
-#define REQUIRE_CLOSE(left, right, tolerance) \
-( (ncbi::NK::abs((left) - (right)) < (tolerance)) \
-?report_passed_close(#left,#right,(left),(right),(tolerance),__FILE__,__LINE__)\
-: report_error_close(#left,#right,(left),(right),(tolerance), \
-    ncbi::NK::abs((left) - (right)), __FILE__, __LINE__, true) )
-
-    template<class T>
-    void AssertEqual(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 == e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, "==", "!=");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, "==", "!=", critical);
-        }
-    }
-#define CHECK_EQUAL(e1, e2)     AssertEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define CHECK_EQ(e1, e2)        CHECK_EQUAL(e1,e2)
-#define REQUIRE_EQUAL(e1, e2)   AssertEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-#define REQUIRE_EQ(e1, e2)      REQUIRE_EQUAL(e1,e2)
-
-    template<class T>
-    void AssertNotEqual(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 != e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, "!=", "==");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, "!=", "==", critical);
-        }
-    }
-#define CHECK_NE(e1, e2)     AssertNotEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define REQUIRE_NE(e1, e2)   AssertNotEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-
-    template<class T>
-    void AssertGreaterOrEqual(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 >= e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, ">=", "<");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, ">=", "<", critical);
-        }
-    }
-#define CHECK_GE(e1, e2)    AssertGreaterOrEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define REQUIRE_GE(e1, e2)  AssertGreaterOrEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-
-    template<class T>
-    void AssertGreater(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 > e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, ">", "<=");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, ">", "<=", critical);
-        }
-    }
-#define CHECK_GT(e1, e2)    AssertGreater((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define REQUIRE_GT(e1, e2)  AssertGreater((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-
-    template<class T>
-    void AssertLessOrEqual(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 <= e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, "<=", ">");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, "<=", ">", critical);
-        }
-    }
-#define CHECK_LE(e1, e2)    AssertLessOrEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define REQUIRE_LE(e1, e2)  AssertLessOrEqual((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-
-    template<class T>
-    void AssertLess(const T& e1, const T& e2, const char* e1str, const char* e2str, const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 < e2)
-        {
-            report_passed2(e1str, e2str, e1, e2, file, line, "<", ">=");
-        }
-        else
-        {
-            report_error2 (e1str, e2str, e1, e2, file, line, "<", ">=", critical);
-        }
-    }
-#define CHECK_LT(e1, e2)    AssertLess((e1),(e2),#e1,#e2,__FILE__,__LINE__, false)
-#define REQUIRE_LT(e1, e2)  AssertLess((e1),(e2),#e1,#e2,__FILE__,__LINE__, true)
-
-    void report_rc(rc_t rc, const char* callStr, const char* file, int line, int successExpected, bool isCritical = false);
-
-#define CHECK_RC(exp)   report_rc((exp), #exp, __FILE__, __LINE__, true, false)
-#define REQUIRE_RC(exp) report_rc((exp), #exp, __FILE__, __LINE__, true, true)
-#define CHECK_RC_FAIL(exp)   report_rc((exp), #exp, __FILE__, __LINE__, false, false)
-#define REQUIRE_RC_FAIL(exp) report_rc((exp), #exp, __FILE__, __LINE__, false, true)
-
-    template<class T>
-    void AssertNull(const T* e1, const char* e1str,const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 == 0)
-        {
-            report_passed2(e1str, "NULL", e1, (const T*)0, file, line, "==", "!=");
-        }
-        else
-        {
-            report_error2 (e1str, "NULL", e1, (const T*)0, file, line, "==", "!=", critical);
-        }
-    }
-#define CHECK_NULL(e1)   AssertNull((e1), #e1, __FILE__,__LINE__, false)
-#define REQUIRE_NULL(e1) AssertNull((e1), #e1, __FILE__,__LINE__, true)
-
-    template<class T>
-    void AssertNotNull(const T* e1, const char* e1str,const char* file, unsigned int line, bool critical=false)
-    {
-        if (e1 != 0)
-        {
-            report_passed2(e1str, "NULL", e1, (const T*)0, file, line, "!=", "==");
-        }
-        else
-        {
-            report_error2 (e1str, "NULL", e1, (const T*)0, file, line, "!=", "==", critical);
-        }
-    }
-#define CHECK_NOT_NULL(e1)   AssertNotNull((e1), #e1, __FILE__,__LINE__, false)
-#define REQUIRE_NOT_NULL(e1) AssertNotNull((e1), #e1, __FILE__,__LINE__, true)
-
-private:
-    const std::string _name;
-    ncbi::NK::counter_t _ec;
-};
-
-class TestInvoker {
-protected:
-    TestInvoker(const std::string& name) : _name(name), _ec(0) {}
-    virtual ~TestInvoker(void) {}
-public:
-    virtual void Run(void* globalFixtute) = 0;
-    const std::string& GetName(void) const { return _name; }
-    ncbi::NK::counter_t GetErrorCounter(void) { return _ec; }
-protected:
-    void SetErrorCounter(ncbi::NK::counter_t ec) { _ec = ec; }
-private:
-    const std::string _name;
-    ncbi::NK::counter_t _ec;
-};
-
-class TestRunner {
-    typedef std::vector<ncbi::NK::TestInvoker*> T;
-    typedef T::const_iterator TCI;
-
-public:
-    TestRunner();
-
-    int    argc;
-    char** argv;
-
-    void ReportTestNumber(void);
-    void SetArgs(int argc, char* argv[]);
-    void Add(ncbi::NK::TestInvoker* t);
-    counter_t Run(void* globalFixtute) const;
-
-private:
-    T _cases;
-};
-
-extern ncbi::NK::TestRunner* GetTestSuite();
-
-template<class TFixture>
-ncbi::NK::counter_t Main(int argc, char* argv[],
-                         const char* suite_name)
-{
-    ncbi::NK::counter_t ec = 0;
-    ncbi::NK::TestRunner* t = ncbi::NK::GetTestSuite();
-    assert(t);
-    t->SetArgs(argc, argv);
-    t->ReportTestNumber();
-    try {
-        TFixture globalFixtute;
-        LOG(ncbi::NK::LogLevel::e_test_suite,
-            "Entering test suite \"" << suite_name << "\"\n");
-        ec = t->Run(&globalFixtute);
-        LOG(ncbi::NK::LogLevel::e_test_suite,
-            "Leaving test suite \"" << suite_name << "\"\n";)
-    } 
-    catch (std::exception& ex) 
-    { 
-        LOG(ncbi::NK::LogLevel::e_nothing, std::string("*** Exception caught: ") + ex.what());
-        ++ec; 
-    }
-    catch (...) 
-    { 
-        ++ec; 
-    }
-    switch (ec) {
-        case 0:
-          LOG(ncbi::NK::LogLevel::e_nothing, "\n*** No errors detected\n");
-          break;
-        case 1:
-          LOG(ncbi::NK::LogLevel::e_nothing, "\n*** " << ec <<
-           " failure detected in test suite \"" << suite_name << "\"\n");
-          break;
-        default:
-          LOG(ncbi::NK::LogLevel::e_nothing, "\n*** " << ec <<
-           " failures detected in test suite \"" << suite_name << "\"\n");
-          break;
-    }
-    return ec;
-}
-
-} } // namespace ncbi::NK
-
-
-#endif// NCBI_NK_UNIT_TEST__SUITE_HPP
diff --git a/interfaces/kxml/xml.h b/interfaces/kxml/xml.h
deleted file mode 100644
index 2f42564..0000000
--- a/interfaces/kxml/xml.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kxml_xml_
-#define _h_kxml_xml_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#include <klib/defs.h>
-
-#include <stdarg.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KNamelist;
-struct KXMLNodeset;
-
-
-/*--------------------------------------------------------------------------
- * XML node
- */
-typedef struct KXMLNode KXMLNode;
-
-/* AddRef
- * Release
- */
-KLIB_EXTERN rc_t CC KXMLNodeAddRef ( const KXMLNode *self );
-KLIB_EXTERN rc_t CC KXMLNodeRelease ( const KXMLNode *self );
-
-/* GetName
- * Get node path from parent nodeset
- */
-KLIB_EXTERN rc_t CC KXMLNodeGetName ( const KXMLNode *self, const char **name );
-
-/* Get element name (tag)
- */
-KLIB_EXTERN rc_t CC KXMLNodeElementName ( const KXMLNode *self, const char **name );
-
-/* Read
- */
-KLIB_EXTERN rc_t CC KXMLNodeRead ( const KXMLNode *self,
-    size_t offset, void *buffer, size_t size,
-    size_t *num_read, size_t *remaining );
-
-/* Write
- */
-KLIB_EXTERN rc_t CC KXMLNodeWrite ( KXMLNode *self,
-    size_t offset, const void *buffer, size_t size );
-
-/* Append
- */
-KLIB_EXTERN rc_t CC KXMLNodeAppend ( KXMLNode *self,
-    const void *buffer, size_t bsize );
-
-
-/* ReadAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadAsI16 ( const KXMLNode *self, int16_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsU16 ( const KXMLNode *self, uint16_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsI32 ( const KXMLNode *self, int32_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsU32 ( const KXMLNode *self, uint32_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsI64 ( const KXMLNode *self, int64_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsU64 ( const KXMLNode *self, uint64_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAsF64 ( const KXMLNode *self, double *f );
-
-
-/* ReadCString ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadCString ( const KXMLNode *self,
-    char *buffer, size_t bsize, size_t *size );
-
-/* ReadCStr
- *  reads node value as C-string
- *
- *  "str" [ IN ] - returned pointer to a NULL terminated string.
- *                 Caller responsible to dealloc (free)!
- *  "default_value" [IN] - default value used in case node value is empty, NULL - none
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadCStr( const KXMLNode *self, char** str, const char* default_value );
-
-/* Write ( formatted )
- *  writes string
- *
- *  "str" [ IN ] - NULL terminated string.
- */
-KLIB_EXTERN rc_t CC KXMLNodeWriteCString ( KXMLNode *self, const char *str );
-
-
-/* OpenNodesetRead
- *
- * NB. OpenNodesetRead could return Nodeset with 0 elements.
- *  To make sure the node exists you should verify that (KXMLNodesetCount > 0)
- */
-KLIB_EXTERN rc_t CC KXMLNodeOpenNodesetRead ( const KXMLNode *self,
-    struct KXMLNodeset const **ns, const char *path, ... );
-KLIB_EXTERN rc_t CC KXMLNodeVOpenNodesetRead ( const KXMLNode *self,
-    struct KXMLNodeset const **ns, const char *path, va_list args );
-
-/* OpenNodesetUpdate
- */
-KLIB_EXTERN rc_t CC KXMLNodeOpenNodesetUpdate ( KXMLNode *self,
-    struct KXMLNodeset **ns, const char *path, ... );
-KLIB_EXTERN rc_t CC KXMLNodeVOpenNodesetUpdate ( KXMLNode *self,
-    struct KXMLNodeset **ns, const char *path, va_list args );
-
-/* ReadAttr
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadAttr ( const KXMLNode *self,
-     const char *attr, void *buffer, size_t bsize,
-     size_t *num_read, size_t *remaining );
-
-/* WriteAttr
- */
-KLIB_EXTERN rc_t CC KXMLNodeWriteAttr ( KXMLNode *self,
-     const char *attr, const void *buffer, size_t size );
-
-
-/* ReadAttrAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsI16 ( const KXMLNode *self, const char *attr, int16_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsU16 ( const KXMLNode *self, const char *attr, uint16_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsI32 ( const KXMLNode *self, const char *attr, int32_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsU32 ( const KXMLNode *self, const char *attr, uint32_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsI64 ( const KXMLNode *self, const char *attr, int64_t *i );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsU64 ( const KXMLNode *self, const char *attr, uint64_t *u );
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrAsF64 ( const KXMLNode *self, const char *attr, double *f );
-
-
-/* ReadAttrCString ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrCString ( const KXMLNode *self, const char *attr,
-    char *buffer, size_t bsize, size_t *size );
-
-/* ReadAttrCStr
- *  reads attribute as C-string
- *
- *  "str" [ IN ] - returned pointer to a NULL terminated string.
- *                 Caller responsible to dealloc (free)!
- *  "default_value" [IN] - default value used in case node value is empty, NULL - none
- */
-KLIB_EXTERN rc_t CC KXMLNodeReadAttrCStr( const KXMLNode *self, const char *attr, char** str, const char* default_value);
-
-/* CountChildNodes
- *  count child nodes
- */
-KLIB_EXTERN rc_t CC KXMLNodeCountChildNodes(const KXMLNode *self,
-    uint32_t *count);
-
-/* GetNodeRead
- *  access indexed node
- *  "idx" [ IN ] - a zero-based index
- */
-KLIB_EXTERN rc_t CC KXMLNodeGetNodeRead ( const KXMLNode *self,
-    const KXMLNode **node, uint32_t idx );
-
-/* ListAttr
- *  list all named attributes
- */
-KLIB_EXTERN rc_t CC KXMLNodeListAttr ( const KXMLNode *self,
-    struct KNamelist const **names );
-
-/* ListChild
- *  list all named children
- */
-KLIB_EXTERN rc_t CC KXMLNodeListChild ( const KXMLNode *self,
-    struct KNamelist const **names );
-
-
-/* GetFirstChildNodeRead
- *  Returns the first(with index 0) sub-node of self using path.
- *  Is equivalent to:
- *          KXMLNodeOpenNodesetRead(self, &nc, path, ...);
- *          KXMLNodesetGetNodeRead(ns, node, 0);
- *  It will return NotFound error if any node exists
- */
-KLIB_EXTERN rc_t CC KXMLNodeGetFirstChildNodeRead ( const KXMLNode *self,
-    const KXMLNode **node, const char *path, ... );
-KLIB_EXTERN rc_t CC KXMLNodeVGetFirstChildNodeRead ( const KXMLNode *self,
-    const KXMLNode **node, const char *path, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * XML node set
- */
-typedef struct KXMLNodeset KXMLNodeset;
-
-/* AddRef
- * Release
- */
-KLIB_EXTERN rc_t CC KXMLNodesetAddRef ( const KXMLNodeset *self );
-KLIB_EXTERN rc_t CC KXMLNodesetRelease ( const KXMLNodeset *self );
-
-/* Count
- *  retrieve the number of nodes in set
- */
-KLIB_EXTERN rc_t CC KXMLNodesetCount ( const KXMLNodeset *self, uint32_t *count );
-
-/* GetNode
- *  access indexed node
- *  "idx" [ IN ] - a zero-based index
- */
-KLIB_EXTERN rc_t CC KXMLNodesetGetNodeRead ( const KXMLNodeset *self,
-    const KXMLNode **node, uint32_t idx );
-
-
-/*--------------------------------------------------------------------------
- * XML document
- */
-typedef struct KXMLDoc KXMLDoc;
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KLIB_EXTERN rc_t CC KXMLDocAddRef ( const KXMLDoc *self );
-KLIB_EXTERN rc_t CC KXMLDocRelease ( const KXMLDoc *self );
-
-/* OpenNodesetRead
- *  opens a node set with given path
- */
-KLIB_EXTERN rc_t CC KXMLDocOpenNodesetRead ( const KXMLDoc *self,
-    const KXMLNodeset **ns, const char *path, ... );
-KLIB_EXTERN rc_t CC KXMLDocVOpenNodesetRead ( const KXMLDoc *self,
-    const KXMLNodeset **ns, const char *path, va_list args );
-
-/* OpenNodesetUpdate
- *  opens a node set with given path
- */
-KLIB_EXTERN rc_t CC KXMLDocOpenNodesetUpdate ( KXMLDoc *self,
-    KXMLNodeset **ns, const char *path, ... );
-KLIB_EXTERN rc_t CC KXMLDocVOpenNodesetUpdate ( KXMLDoc *self,
-    KXMLNodeset **ns, const char *path, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * XML manager
- */
-typedef struct KXMLMgr KXMLMgr;
-
-/* Make
- *  make an XML manager object
- */
-KLIB_EXTERN rc_t CC KXMLMgrMakeRead ( const KXMLMgr **mgr );
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-KLIB_EXTERN rc_t CC KXMLMgrAddRef ( const KXMLMgr *self );
-KLIB_EXTERN rc_t CC KXMLMgrRelease ( const KXMLMgr *self );
-
-/* MakeDoc
- *  create a document object from source file
- */
-KLIB_EXTERN rc_t CC KXMLMgrMakeDocRead ( const KXMLMgr *self,
-    const KXMLDoc **doc, struct KFile const *src );
-
-/* MakeDoc
- *  create a document object from memory
- */
-KLIB_EXTERN rc_t KXMLMgrMakeDocReadFromMemory ( const KXMLMgr *self,
-    const KXMLDoc **result, const char* buffer, uint64_t size );
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  this will probably be relocated later on
- */
-struct KDirectory;
-struct KFile;
-struct String;
-struct VFSManager;
-struct VPath;
-
-/* OpenXTocDirRead
- *  open copycat XML as a chroot'd directory
- *  XML data comes from a KFile in this case
- *
- *  "dir" [ OUT ] - return parameter for directory object
- *
- *  "base_path" [ IN ] - NUL terminated string giving the path
- *   of the new directory relative to "self". NB - can be absolute
- *   or relative, but is always interpreted by "self".
- *
- *  "xml" [ IN ] - file containing XML data produced by copycat tool
- */
-rc_t CC KDirectoryOpenXTocDirRead (const struct KDirectory * self,
-                                   const struct KDirectory ** pnew_dir,
-                                   bool chroot,
-                                   const struct KFile * xml,
-                                   const char * path, ... );
-rc_t CC KDirectoryVOpenXTocDirRead (const struct KDirectory * self,
-                                    const struct KDirectory ** pnew_dir,
-                                    bool chroot,
-                                    const struct KFile * xml,
-                                    const char * _path,
-                                    va_list args );
-rc_t CC KDirectoryOpenXTocDirRead (const struct KDirectory * self,
-                                   const struct KDirectory ** pnew_dir,
-                                   bool chroot,
-                                   const struct KFile * xml,
-                                   const char * path, ... );
-rc_t CC KDirectoryOpenXTocDirReadDir (const struct KDirectory * self,
-                                      const struct KDirectory ** pnew_dir,
-                                      const struct KFile * xml,
-                                      const struct String * spath);
-
-rc_t CC VFSManagerOpenXTocDirRead (const struct VFSManager * self,
-                                   const struct KDirectory ** pnew_dir,
-                                   const struct KFile * xml,
-                                   const struct VPath * path);
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kxml_xml_ */
diff --git a/interfaces/loader/alignment-writer.h b/interfaces/loader/alignment-writer.h
deleted file mode 100644
index c995fb9..0000000
--- a/interfaces/loader/alignment-writer.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_ALIGNMENT_WRITER_H_
-#define BAM_LOAD_ALIGNMENT_WRITER_H_ 1
-
-#include <klib/text.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <insdc/insdc.h>
-
-#include <align/writer-alignment.h>
-
-typedef struct AlignmentWriter AlignmentWriter;
-typedef struct AlignmentRecord AlignmentRecord;
-
-struct AlignmentRecord {
-    TableWriterAlgnData data;
-    int64_t alignId;
-    bool isPrimary;
-
-    INSDC_coord_one read_id;
-    int64_t ref_id;
-    INSDC_coord_zero ref_start;
-    uint64_t global_ref_start;
-    bool ref_orientation;
-    uint32_t mapq;
-    uint64_t tmp_key_id;
-
-    INSDC_coord_zero read_start;
-    INSDC_coord_len read_len;
-
-    bool mate_ref_orientation;
-    int64_t mate_ref_id;
-    INSDC_coord_zero mate_ref_pos;
-    int64_t mate_align_id;
-    int32_t template_len;
-};
-
-#define AR_REF_ID(X) ((X).ref_id)
-#define AR_REF_START(X) ((X).global_ref_start)
-#define AR_REF_LEN(X) ((X).ref_len)
-#define AR_REF_ORIENT(X) ((X).ref_orientation)
-#define AR_READNO(X) ((X).read_id)
-#define AR_MAPQ(X) ((X).mapq)
-#define AR_KEY(X) ((X).tmp_key_id)
-
-#define AR_BASECOUNT(X) ((X).data.has_mismatch.elements)
-#define AR_HAS_MISMATCH(X) ((bool *)((X).data.has_mismatch.buffer))
-#define AR_HAS_OFFSET(X) ((bool *)((X).data.has_ref_offset.buffer))
-
-#define AR_NUM_MISMATCH(X) ((X).data.mismatch.elements)
-#define AR_MISMATCH(X) ((char *)((X).data.mismatch.buffer))
-
-#define AR_NUM_MISMATCH_QUAL(X) ((X).data.mismatch_qual.elements)
-#define AR_MISMATCH_QUAL(X) ((uint8_t *)((X).data.mismatch_qual.buffer))
-
-#define AR_NUM_OFFSET(X) ((X).data.ref_offset.elements)
-#define AR_OFFSET(X) ((INSDC_coord_zero *)((X).data.ref_offset.buffer))
-
-AlignmentWriter *AlignmentMake(VDatabase *db);
-
-rc_t AlignmentWriteRecord(AlignmentWriter * const self, AlignmentRecord * const data, bool expectUnsorted);
-
-rc_t AlignmentStartUpdatingSpotIds(AlignmentWriter * const self);
-
-rc_t AlignmentGetSpotKey(AlignmentWriter * const self, uint64_t *keyId, int64_t *alignId, bool *isPrimary);
-
-rc_t AlignmentGetRefPos(AlignmentWriter *const self, int64_t row, ReferenceStart *const rslt);
-
-rc_t AlignmentUpdateInfo(AlignmentWriter *const self, int64_t const spotId,
-                         int64_t const mateId, ReferenceStart const *const mateRefPos);
-
-rc_t AlignmentWhack(AlignmentWriter * const self, bool const commit);
-
-size_t AlignmentRecordBufferSize(size_t const readlen, bool const hasMismatchQual);
-
-void AlignmentRecordInit(AlignmentRecord *self, void *buffer, unsigned readlen,
-                         char **endp,
-                         bool expectUnsorted,
-                         bool hasMismatchQual
-                         );
-
-#endif
diff --git a/interfaces/loader/common-reader-priv.h b/interfaces/loader/common-reader-priv.h
deleted file mode 100644
index 26a8e19..0000000
--- a/interfaces/loader/common-reader-priv.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_common_reader_priv_
-#define _h_common_reader_priv_
-
-#include <loader/common-reader.h>
-
-#include <klib/refcount.h>
-#include <klib/text.h>
-#include <klib/data-buffer.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*TODO: add module rcLoader to rc.h? */
-#define RC_MODULE rcAlign
-
-/*--------------------------------------------------------------------------
- ReaderFile
- */
-#ifndef READERFILE_IMPL
-    #define READERFILE_IMPL struct ReaderFile
-#endif
-
-typedef struct ReaderFile_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( *destroy   )                 ( READERFILE_IMPL* self );
-    rc_t ( *getRecord )                 ( const READERFILE_IMPL *self, const Record** result );
-    float ( *getProportionalPosition )  ( const READERFILE_IMPL *self );
-    rc_t ( *getReferenceInfo )          ( const READERFILE_IMPL *self, const ReferenceInfo** result );
-    /* end minor version == 0 */
-
-} ReaderFile_vt_v1;
-
-typedef union ReaderFile_vt {
-    ReaderFile_vt_v1* v1;
-} ReaderFile_vt;
-
-struct ReaderFile
-{
-    ReaderFile_vt vt;
-    KRefcount refcount;
-    char* pathname;
-};
-
-/* Init
- *  polymorphic parent constructor
- */
-rc_t CC ReaderFileInit ( READERFILE_IMPL *self );
-
-/* Whack
- *  destructor
- */
-rc_t CC ReaderFileWhack ( ReaderFile *self );
-
-/*--------------------------------------------------------------------------
- Record
- */
-#ifndef RECORD_IMPL
-    #define RECORD_IMPL struct Record
-#endif
-
-typedef struct Record_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( *addRef  ) ( const RECORD_IMPL* self );
-    rc_t ( *release ) ( const RECORD_IMPL* self );
-    rc_t ( *getSequence  ) ( const RECORD_IMPL *self, const Sequence** result );
-    rc_t ( *getAlignment ) ( const RECORD_IMPL *self, const Alignment** result );
-    rc_t ( *getRejected  ) ( const RECORD_IMPL *self, const Rejected** result );
-    /* end minor version == 0 */
-
-} Record_vt_v1;
-
-typedef union Record_vt {
-    Record_vt_v1* v1;
-} Record_vt;
-
-struct Record
-{
-    Record_vt vt;
-};
-
-/*--------------------------------------------------------------------------
- Sequence
- */
-#ifndef SEQUENCE_IMPL
-    #define SEQUENCE_IMPL struct Sequence
-#endif
-
-typedef struct Sequence_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( *addRef  ) ( const SEQUENCE_IMPL* self );
-    rc_t ( *release ) ( const SEQUENCE_IMPL* self );
-
-    rc_t ( *getReadLength   )   ( const SEQUENCE_IMPL *self, uint32_t *length );
-    rc_t ( *getRead         )   ( const SEQUENCE_IMPL *self, char *sequence );
-    rc_t ( *getRead2        )   ( const SEQUENCE_IMPL *self, char *sequence, uint32_t start, uint32_t stop );
-    rc_t ( *getQuality      )   ( const SEQUENCE_IMPL *self, const int8_t **quality, uint8_t *offset, int *qualType );
-    rc_t ( *getSpotGroup    )   ( const SEQUENCE_IMPL *self, const char **name, size_t *length );
-    rc_t ( *getSpotName     )   ( const SEQUENCE_IMPL *self, const char **name, size_t *length );
-    bool ( *isColorSpace    )   ( const SEQUENCE_IMPL *self );
-    rc_t ( *getCSKey        )   ( const SEQUENCE_IMPL *self, char cskey[1] );
-    rc_t ( *getCSReadLength )   ( const SEQUENCE_IMPL *self, uint32_t *length );
-    rc_t ( *getCSRead       )   ( const SEQUENCE_IMPL *self, char *sequence );
-    rc_t ( *getCSQuality    )   ( const SEQUENCE_IMPL *self, const int8_t **quality, uint8_t *offset, int *qualType );
-                          
-    bool ( *wasPaired     )     ( const SEQUENCE_IMPL *self );
-    int  ( *orientationSelf )   ( const SEQUENCE_IMPL *self );
-    int  ( *orientationMate )   ( const SEQUENCE_IMPL *self );
-    bool ( *isFirst       )     ( const SEQUENCE_IMPL *self );
-    bool ( *isSecond      )     ( const SEQUENCE_IMPL *self );
-    bool ( *isDuplicate   )     ( const SEQUENCE_IMPL *self ); 
-    bool ( *isLowQuality   )    ( const SEQUENCE_IMPL *self ); 
-
-    rc_t ( *getTI ) ( const SEQUENCE_IMPL *self, uint64_t *ti );
-    
-    /* end minor version == 0 */
-
-} Sequence_vt_v1;
-
-typedef union Sequence_vt {
-    Sequence_vt_v1* v1;
-} Sequence_vt;
-
-struct Sequence
-{
-    Sequence_vt vt;
-};
-
-/*--------------------------------------------------------------------------
- Alignment
- */
-#ifndef ALIGNMENT_IMPL
-    #define ALIGNMENT_IMPL struct Alignment
-#endif
-
-typedef struct Alignment_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    
-    rc_t ( *addRef  ) ( const ALIGNMENT_IMPL* self );
-    rc_t ( *release ) ( const ALIGNMENT_IMPL* self );
-    
-    rc_t ( *getRefSeqId         )   ( const ALIGNMENT_IMPL *self, int32_t *refSeqId );
-    rc_t ( *getMateRefSeqId     )   ( const ALIGNMENT_IMPL *self, int32_t *refSeqId );
-    rc_t ( *getPosition         )   ( const ALIGNMENT_IMPL *self, int64_t *pos );
-    rc_t ( *getMatePosition     )   ( const ALIGNMENT_IMPL *self, int64_t *pos );
-    rc_t ( *getMapQuality       )   ( const ALIGNMENT_IMPL *self, uint8_t *qual );
-    rc_t ( *getAlignmentDetail  )   ( const ALIGNMENT_IMPL *self, AlignmentDetail *rslt, uint32_t count, uint32_t *actual, int32_t *firstMatch, int32_t *lastMatch );
-    rc_t ( *getAlignOpCount     )   ( const ALIGNMENT_IMPL *self, uint32_t *n );
-    rc_t ( *getInsertSize       )   ( const ALIGNMENT_IMPL *self, int64_t *size );
-    rc_t ( *getCG               )   ( const ALIGNMENT_IMPL *self, const CGData** result );
-    rc_t ( *getBAMCigar         )   ( const ALIGNMENT_IMPL *self, uint32_t const **rslt, uint32_t *length );
-    
-    bool ( *isSecondary ) ( const ALIGNMENT_IMPL *self ); 
-    
-    /* end minor version == 0 */
-
-} Alignment_vt_v1;
-
-typedef union Alignment_vt {
-    Alignment_vt_v1* v1;
-} Alignment_vt;
-
-struct Alignment
-{
-    Alignment_vt vt;
-};
-
-/*--------------------------------------------------------------------------
- CGData
- */
-#ifndef CGDATA_IMPL
-    #define CGDATA_IMPL struct CGData
-#endif
-
-typedef struct CGData_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    
-    rc_t ( *addRef  ) ( const CGDATA_IMPL* self );
-    rc_t ( *release ) ( const CGDATA_IMPL* self );
-
-    rc_t ( * getSeqQual )       ( const CGDATA_IMPL* self, char sequence[/* 35 */], uint8_t quality[/* 35 */] );
-    rc_t ( * getCigar )         ( const CGDATA_IMPL* self, uint32_t *cigar, uint32_t cig_max, uint32_t *cig_act );
-    rc_t ( * getAlignGroup )    ( const CGDATA_IMPL* self, char buffer[], size_t max_size, size_t *act_size);
-    /* end minor version == 0 */
-
-} CGData_vt_v1;
-
-typedef union CGData_vt {
-    CGData_vt_v1* v1;
-} CGData_vt;
-
-struct CGData
-{
-    CGData_vt vt;
-};
-
-/*--------------------------------------------------------------------------
- Rejected
- */
-
-struct Rejected {
-    KRefcount   refcount;
-
-    String      source;
-    const char* message;
-    uint64_t    line;
-    uint64_t    column;
-    bool        fatal;
-};
-
-rc_t CC RejectedInit ( Rejected *self );
-
-/*--------------------------------------------------------------------------
- ReferenceInfo
- */
-
-#ifndef REFERENCEINFO_IMPL
-    #define REFERENCEINFO_IMPL struct ReferenceInfo
-#endif
-
-typedef struct ReferenceInfo_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    
-    rc_t ( *addRef  ) ( const REFERENCEINFO_IMPL* self );
-    rc_t ( *release ) ( const REFERENCEINFO_IMPL* self );
-
-    rc_t ( *getRefSeqCount )        ( const REFERENCEINFO_IMPL* self, uint32_t* count );
-    rc_t ( *getRefSeq )             ( const REFERENCEINFO_IMPL* self, uint32_t n, ReferenceSequence* result );
-    rc_t ( *getReadGroupCount )     ( const REFERENCEINFO_IMPL* self, uint32_t* count );
-    rc_t ( *getReadGroup )          ( const REFERENCEINFO_IMPL* self, unsigned n, ReadGroup* result );
-    rc_t ( *getReadGroupByName )    ( const REFERENCEINFO_IMPL* self, const char* name, ReadGroup* result );
-
-    /* end minor version == 0 */
-
-} ReferenceInfo_vt_v1;
-
-typedef union ReferenceInfo_vt {
-    ReferenceInfo_vt_v1* v1;
-} ReferenceInfo_vt;
-
-struct ReferenceInfo
-{
-    ReferenceInfo_vt vt;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_common_reader_priv_ */
diff --git a/interfaces/loader/common-reader.h b/interfaces/loader/common-reader.h
deleted file mode 100644
index b6cd796..0000000
--- a/interfaces/loader/common-reader.h
+++ /dev/null
@@ -1,486 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_common_reader_
-#define _h_common_reader_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef struct ReaderFile           ReaderFile;
-typedef struct Record               Record;
-typedef struct Sequence             Sequence;
-typedef struct Alignment            Alignment;
-typedef struct CGData               CGData;  
-typedef struct Rejected             Rejected;
-typedef struct ReferenceInfo        ReferenceInfo;
-
-/*--------------------------------------------------------------------------
- ReaderFile
- */
-rc_t CC ReaderFileAddRef ( const ReaderFile *self );
-rc_t CC ReaderFileRelease ( const ReaderFile *self );
-
-/* GetRecord
- * Parses the next record from the source. At the end of the file, rc == 0, *result == 0.
- */
-rc_t CC ReaderFileGetRecord( const ReaderFile *self, const Record** result);
-
-/* GetPathname
- * Returns input's pathname, if applicable.
- */
-const char* CC ReaderFileGetPathname ( const ReaderFile *self );
-
-/* GetProportionalPosition
- *  get the aproximate proportional position in the input file
- *  this is intended to be useful for computing progress
- *
- * NB - does not return rc_t
- */
-float CC ReaderFileGetProportionalPosition ( const ReaderFile *self );
-
-/* GetReferenceInfo
- *
- */
-rc_t CC ReaderFileGetReferenceInfo ( const ReaderFile *self, const ReferenceInfo** result );
-
-/*--------------------------------------------------------------------------
- Record
- */
-
-/* AddRef
- * Release
- */
-rc_t CC RecordAddRef ( const Record *self );
-rc_t CC RecordRelease ( const Record *self );
-
-rc_t CC RecordGetRejected ( const Record *self, const Rejected** result);
-rc_t CC RecordGetSequence ( const Record *self, const Sequence** result);
-rc_t CC RecordGetAlignment( const Record *self, const Alignment** result);
-
-/*--------------------------------------------------------------------------
- Sequence
- */
-
-/* AddRef
- * Release
- */
-rc_t CC SequenceAddRef ( const Sequence *self );
-rc_t CC SequenceRelease ( const Sequence *self );
-
-/* GetReadLength
- *  get the sequence length
- *  i.e. the number of elements of both sequence and quality
- *
- *  "length" [ OUT ] - length in bases of query sequence and quality
- */
-rc_t CC SequenceGetReadLength ( const Sequence *self, uint32_t *length );
-
-/* GetRead
- *  get the sequence data [0..ReadLength)
- *  caller provides buffer of ReadLength bytes
- *
- *  "sequence" [ OUT ] - pointer to a buffer of at least ReadLength bytes
- */
-rc_t CC SequenceGetRead( const Sequence *self, char *sequence );
-
-/* GetRead2
- *  get the sequence data [0..ReadLength)
- *  caller provides buffer of ReadLength bytes
- *
- *  "sequence" [ OUT ] - pointer to a buffer of at least ReadLength bytes
- *
- *  "start" [ IN ] and "stop" [ IN ] - zero-based coordinates, half-closed interval; both have to be within ReadLength
- */
-rc_t CC SequenceGetRead2 ( const Sequence *self, char *sequence, uint32_t start, uint32_t stop);
-
-enum QualityType {
-    QT_Unknown = 0,
-    QT_Phred,
-    QT_LogOdds
-};
-/* GetQuality
- *  get the raw quality data [0..ReadLength) from OQ if possible else from QUAL
- *  values are unsigned with 0xFF == missing
- *
- *  "quality" [ OUT ] - return param for quality sequence
- *   held internally, validity is guaranteed for the life of the sequence
- *  
- *  "offset" [ OUT ] - the zero point of quality (33, 64; 0 for binary)
- *  
- *  "qualType" [ OUT ] - quality type (phred, log-odds, unknown)
- */
-rc_t CC SequenceGetQuality(const Sequence *self, const int8_t **quality, uint8_t *offset, int *qualType);
-
-/* SequenceGetSpotGroup
- *  get the name of the spot group (e.g. accession)
- *
- *  "name" [ OUT ] - return param for group name
- *   held internally, validity is guaranteed for the life of the sequence
- *
- *  "length" [ OUT ] - return the number of bytes in "name"
- */
-rc_t CC SequenceGetSpotGroup ( const Sequence *self, const char **name, size_t *length );
-
-
-/* SequenceGetSpotName
- *  get the read name and length in bytes
- *
- *  "name" [ OUT ] - return param for read group name
- *   held internally, validity is guaranteed for the life of the sequence
- *
- *  "length" [ OUT ] - return the number of bytes in "name"
- */
-rc_t CC SequenceGetSpotName ( const Sequence *self, const char **name, size_t *length );
-
-/* IsColorSpace
- *  Does the sequence have colorspace info
- */
-bool CC SequenceIsColorSpace ( const Sequence *self );
-
-/* GetCSKey
- *  get the colorspace key
- *
- *  "cskey" [ OUT ] - return param 
- *
- *  return: if no colorspace info, RC is 0 but the value of cskey is undefined
- */
-rc_t CC SequenceGetCSKey ( const Sequence *self, char cskey[1] );
-
-/* GetCSReadLength
- *  get the color space sequence length
- *  i.e. the number of elements of both sequence and quality
- *
- *  "length" [ OUT ] - length in bases of query sequence and quality
- */
-rc_t CC SequenceGetCSReadLength ( const Sequence *self, uint32_t *length );
-
-/* GetCSRead
- *  get the color space sequence data [0..ReadLength)
- *  caller provides buffer of ReadLength bytes
- *
- *  "sequence" [ OUT ] - pointer to a buffer of at least ReadLength bytes
- */
-rc_t CC SequenceGetCSRead( const Sequence *self, char *sequence );
-
-/* GetCSQuality
- *  get the color spaqce sequence's raw quality data [0..ReadLength) from OQ if possible else from QUAL
- *  values are unsigned with 0xFF == missing
- *
- *  "quality" [ OUT ] - return param for quality sequence
- *   held internally, validity is guaranteed for the life of the sequence
- *  
- *  "offset" [ OUT ] - the zero point of quality (33, 64; 0 for binary)
- *  
- *  "qualType" [ OUT ] - quality type (phred, log-odds, unknown)
- */
-rc_t CC SequenceGetCSQuality(const Sequence *self, const int8_t **quality, uint8_t *offset, int *qualType);
-
-
-/* WasPaired
- * true if read number is present and not 0 
- */ 
-bool CC SequenceWasPaired     ( const Sequence *self ); 
-
-enum ReadOrientation {
-    ReadOrientationUnknown,
-    ReadOrientationForward,
-    ReadOrientationReverse
-};
-/* SequenceGetOrientationSelf
- */ 
-int CC SequenceGetOrientationSelf( const Sequence *self ); 
-/* SequenceGetOrientationMate
- */ 
-int CC SequenceGetOrientationMate( const Sequence *self ); 
-
-/* IsFirst
- * fastq: read number is present and equal to 1
- */ 
-bool CC SequenceIsFirst       ( const Sequence *self ); 
-/* IsSecond
- * fastq: read number is present and equal to 2
- */
-bool CC SequenceIsSecond      ( const Sequence *self ); 
-/* IsDuplicate
- * 
- */
-bool CC SequenceIsDuplicate( const Sequence *self ); 
-/* IsLowQuality
- * 
- */
-bool CC SequenceIsLowQuality( const Sequence *self ); 
-
-/*  RecordGetTI
- *
- */
-rc_t SequenceGetTI(Sequence const *self, uint64_t *ti);
-
-/*--------------------------------------------------------------------------
- Alignment
- */
-
-/* AddRef
- * Release
- */
-rc_t CC AlignmentAddRef ( const Alignment *self );
-rc_t CC AlignmentRelease ( const Alignment *self );
-
-/* GetRefSeqId
- *  get id of reference sequence
- *  pass result into BAMFileGetRefSeqById to get the Reference Sequence record
- *
- *  "refSeqId" [ OUT ] - zero-based id of reference sequence
- *   returns -1 if set is invalid within BAM ( rc may be zero )
- */
-rc_t CC AlignmentGetRefSeqId ( const Alignment *self, int32_t *refSeqId );
-
-/* GetMateRefSeqId
- *  get id of mate's reference sequence
- *  pass result into BAMFileGetRefSeqById to get the Reference Sequence record
- *
- *  "refSeqId" [ OUT ] - zero-based id of reference sequence
- *   returns -1 if invalid
- */
-rc_t CC AlignmentGetMateRefSeqId ( const Alignment *self, int32_t *refSeqId );
-
-/* GetPosition
- *  get the aligned position on the ref. seq.
- *
- *  "n" [ IN ] - zero-based position index for cases of multiple alignments
- *
- *  "pos" [ OUT ] - zero-based position on reference sequence
- *  returns -1 if invalid
- */
-rc_t CC AlignmentGetPosition ( const Alignment *self, int64_t *pos );
-
-/* GetMatePosition
- *  starting coordinate of mate's alignment on ref. seq.
- *
- *  "pos" [ OUT ] - zero-based position on reference sequence
- *  returns -1 if invalid
- */
-rc_t CC AlignmentGetMatePosition ( const Alignment *self, int64_t *pos );
-
-/* GetMapQuality
- *  return the quality score of mapping
- *
- *  "qual" [ OUT ] - return param for quality score
- */
-rc_t CC AlignmentGetMapQuality ( const Alignment *self, uint8_t *qual );
-
-/* GetAlignmentDetail
- *  get the alignment details
- *
- *  "rslt" [ OUT, NULL OKAY ] and "count" [ IN ] - array to hold detail records
- *
- *  "actual" [ OUT, NULL OKAY ] - number of elements written to "rslt"
- *   required if "rslt" is NULL
- *
- *  "firstMatch" [ OUT, NULL OKAY ] - zero-based index into "rslt" of the first match to the refSeq
- *   or < 0 if invalid
- *
- *  "lastMatch" [ OUT, NULL OKAY ] - zero-based index into "rslt" of the last match to the refSeq
- *   or < 0 if invalid
- */
-typedef uint32_t AlignOpType;
-enum AlignOpTypes
-{
-    align_Match    = 'M', /* 0 */
-    align_Insert   = 'I', /* 1 */
-    align_Delete   = 'D', /* 2 */
-    align_Skip     = 'N', /* 3 */
-    align_SoftClip = 'S', /* 4 */
-    align_HardClip = 'H', /* 5 */
-    align_Padded   = 'P', /* 6 */
-    align_Equal    = '=', /* 7 */
-    align_NotEqual = 'X', /* 8 */
-    align_Overlap  = 'B' /* Complete Genomics extension */
-};
-
-typedef struct AlignmentDetail AlignmentDetail;
-struct AlignmentDetail
-{
-    int64_t refSeq_pos; /* position on refSeq where this alignment region starts or -1 if NA */
-    int32_t read_pos;   /* position on read where this alignment region starts or -1 if NA */
-    uint32_t length;    /* length of alignment region */
-    AlignOpType type;  /* type of alignment */
-};
-
-rc_t CC AlignmentGetAlignmentDetail ( const Alignment *self,
-                                      AlignmentDetail *rslt, 
-                                      uint32_t count, 
-                                      uint32_t *actual,
-                                      int32_t *firstMatch, 
-                                      int32_t *lastMatch );
-
-
-/* GetCigarCount
- *  the number of CIGAR elements
- *  a CIGAR element consists of the pair of matching op code and op length
- *
- *  "n" [ OUT ] - return param for cigar count
- */
-rc_t CC AlignmentGetAlignOpCount ( const Alignment *self, uint32_t *n );
-
-
-/* GetInsertSize
- *  distance in bases to start of mate's alignment on ref. seq.
- *
- *  "size" [ OUT ] - >0 for first in pair, <0 for second
- */
-rc_t CC AlignmentGetInsertSize ( const Alignment *self, int64_t *size );
-
-/* GetBAMCigar
- *
- */
-rc_t CC AlignmentGetBAMCigar(const Alignment *cself, uint32_t const **rslt, uint32_t *length);
-
-/* IsSecondary
- * 
- */
-bool CC AlignmentIsSecondary( const Alignment *self ); 
-
-
-/* AlignmentGetCG
- * rc_t == 0, result == 0 if no CG data 
- */
-rc_t CC AlignmentGetCGData ( const Alignment *self, const CGData** result);
-
-/*--------------------------------------------------------------------------
- * CGData
- */
-rc_t CC CGDataAddRef ( const CGData *self );
-rc_t CC CGDataRelease ( const CGData *self );
-
-/* CGGetSeqQual
- */
-rc_t CC CGDataGetSeqQual ( const CGData* self,
-                           char sequence[/* 35 */],
-                           uint8_t quality[/* 35 */] );
-
-/* CGGetCigar
- */
-rc_t CC CGDataGetCigar ( const CGData* self,
-                         uint32_t *cigar,
-                         uint32_t cig_max,
-                         uint32_t *cig_act );
-
-/* CGGetAlignGroup
- */
-rc_t CC CGDataGetAlignGroup ( const CGData* self,
-                              char buffer[],
-                              size_t max_size,
-                              size_t *act_size );
-
-/*--------------------------------------------------------------------------
- * Rejected
- */
-
-/* AddRef
- * Release
- */
-rc_t CC RejectedAddRef ( const Rejected *self );
-rc_t CC RejectedRelease ( const Rejected *self );
-
-/* GetError
- *  "text" [ OUT ] - NUL-terminated error message, held internally
- *  "line" [ OUT ] - 1-based line # in the source (0 for binary formats)
- *  "column" [ OUT ] - 1-based column # in the source (offset from the start of the file for binary formats)
- *  "fatal" [ OUT ] - no further parsing should be done (likely an unsupported format)
- */
-rc_t CC RejectedGetError( const Rejected* self, const char** text, uint64_t* line, uint64_t* column, bool* fatal );
-
-/* GetData
- *  "data" [ OUT ] - raw input representing the rejected record. held internally
- *  "length" [ OUT ] - size of the data buffer
- */
-rc_t CC RejectedGetData( const Rejected* self, const void** text, size_t* length );
-
-/*--------------------------------------------------------------------------
- * ReferenceInfo
- */
-typedef struct ReferenceSequence 
-{
-    uint64_t length;
-    const char *name; /* not null unique */
-    const uint8_t *checksum;
-} ReferenceSequence;
-
-typedef struct ReadGroup
-{
-    const char *name; /* not null unique, accession e.g. SRR001138 */
-    const char *platform; /* e.g. ILLUMINA */
-} ReadGroup;
-
-rc_t CC ReferenceInfoAddRef ( const ReferenceInfo *self );
-rc_t CC ReferenceInfoRelease ( const ReferenceInfo *self );
-
-/* GetRefSeqCount
- *  get the number of Reference Sequences refered to in the header
- *  this is not necessarily the number of Reference Sequences referenced
- *  by the alignments
- */
-rc_t CC ReferenceInfoGetRefSeqCount ( const ReferenceInfo *self, uint32_t* count );
-
-/* GetRefSeq
- *  get the n'th Ref. Seq. where n is [0..RefSeqCount)
- *  the result is populated with pointers that are good for precisely at long as the ReferenceInfo exists.
- */
-rc_t CC ReferenceInfoGetRefSeq ( const ReferenceInfo *self, uint32_t n, ReferenceSequence *result );
-
-/* GetReadGroupCount
- *  get the number of Read Groups (accessions, etc.) refered to in the header
- *  this is not necessarily the number of Read Groups referenced
- *  by the alignments
- */
-rc_t CC ReferenceInfoGetReadGroupCount ( const ReferenceInfo *self, uint32_t *count );
-
-/* GetReadGroup
- *  get the n'th Read Group where n is [0..ReadGroupCount)
- *  the result is populated with pointers that are good for precisely at long as the ReferenceInfo exists.
- */
-rc_t CC ReferenceInfoGetReadGroup ( const ReferenceInfo *self, unsigned n, ReadGroup *result );
-
-/* GetReadGroupByName
- *  get a Read Group by its name
- *  the result is populated with pointers that are good for precisely at long as the ReferenceInfo exists.
- */
-rc_t CC ReferenceInfoGetReadGroupByName ( const ReferenceInfo *self, const char *name, ReadGroup *result );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_common_reader_ */
diff --git a/interfaces/loader/common-writer.h b/interfaces/loader/common-writer.h
deleted file mode 100644
index cf94231..0000000
--- a/interfaces/loader/common-writer.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_common_writer_
-#define _h_common_writer_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_insdc_sra_
-#include <insdc/sra.h>
-#endif
-
-#ifndef _h_mmarray_
-#include <loader/mmarray.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-struct VDBManager;
-struct VDatabase;
-struct KMemBank;
-struct KBTree;
-struct KLoadProgressbar;
-struct ReaderFile;
-struct CommonWriter;
-struct SequenceWriter;
-struct AlignmentWriter;
-struct Reference;
-
-/*--------------------------------------------------------------------------
- * CommonWriterSettings
- */
-enum LoaderModes {
-    mode_Archive,
-    mode_Analysis
-};
-
-typedef struct CommonWriterSettings
-{
-    uint64_t numfiles;
-    char const *inpath;
-    char const *outpath;
-    char const *tmpfs;
-    
-    struct KFile *noMatchLog;
-    
-    char const *schemaPath;
-    char const *schemaIncludePath;
-    
-    char const *refXRefPath;
-    
-    char const *QualQuantizer;
-    
-    char const *refFilter;
-
-    char const** refFiles; /* NULL-terminated array pointing to argv */
-    
-    char const *headerText;
-    
-    uint64_t maxAlignCount;
-    size_t cache_size;
-
-    uint64_t errCount;
-    uint64_t maxErrCount;
-    uint64_t maxErrPct;
-    uint64_t maxWarnCount_NoMatch;
-    uint64_t maxWarnCount_DupConflict;
-    uint64_t pid;
-    uint64_t minMatchCount; /* minimum number of matches to count as an alignment */
-    int minMapQual;
-    enum LoaderModes mode;
-    uint32_t maxSeqLen;
-    bool omit_aligned_reads;
-    bool omit_reference_reads;
-    bool no_real_output;
-    bool expectUnsorted;
-    bool noVerifyReferences;
-    bool onlyVerifyReferences;
-    bool useQUAL;
-    bool limit2config;
-    bool editAlignedQual;
-    bool keepMismatchQual;
-    bool acceptBadDups; /* accept spots with inconsistent PCR duplicate flags */
-    bool acceptNoMatch; /* accept without any matching bases */
-    uint8_t alignedQualValue;
-    bool allUnaligned; /* treat all records as unaligned */
-    bool noColorSpace;
-    bool noSecondary;
-    bool hasTI;
-    bool acceptHardClip;
-    INSDC_SRA_platform_id platform;
-    bool parseSpotName;
-    bool compressQuality;
-    uint64_t maxMateDistance;
-} CommonWriterSettings;
-
-/*--------------------------------------------------------------------------
- * SpotAssembler
- */
-
-#define FRAG_CHUNK_SIZE (128)
-
-typedef struct SpotAssembler {
-    const struct KLoadProgressbar *progress[4];
-    struct KBTree *key2id[NUM_ID_SPACES];
-    char *key2id_names;
-    struct MMArray *id2value;
-    struct KMemBank *fragsBoth; /*** mate will be there soon ***/
-    struct KMemBank *fragsOne;  /*** mate may not be found soon or even show up ***/
-    int64_t spotId;
-    int64_t primaryId;
-    int64_t secondId;
-    uint64_t alignCount;
-    
-    uint32_t idCount[NUM_ID_SPACES];
-    uint32_t key2id_hash[NUM_ID_SPACES];
-    
-    size_t key2id_max;
-    size_t key2id_name_max;
-    size_t key2id_name_alloc;
-    size_t key2id_count;
-    
-    size_t key2id_name[NUM_ID_SPACES];
-    /* this array is kept in name order */
-    /* this maps the names to key2id and idCount */
-    size_t key2id_oid[NUM_ID_SPACES];
-    
-    unsigned pass;
-    bool isColorSpace;
-    
-} SpotAssembler;
-
-INSDC_SRA_platform_id PlatformToId(const char* name);
-
-/*--------------------------------------------------------------------------
- * CommonWriter
- */
-typedef struct CommonWriter {
-    CommonWriterSettings settings;
-    SpotAssembler ctx;
-    struct Reference* ref;
-    struct SequenceWriter* seq;
-    struct AlignmentWriter* align;
-    bool had_alignments;
-    bool had_sequences;
-    unsigned err_count;
-    bool commit;
-} CommonWriter;
-
-rc_t CommonWriterInit(CommonWriter* self, struct VDBManager *mgr, struct VDatabase *db, const CommonWriterSettings* settings);
-
-rc_t CommonWriterArchive(CommonWriter* self, const struct ReaderFile *);
-rc_t CommonWriterComplete(CommonWriter* self, bool quitting, uint64_t maxDistance);
-
-rc_t CommonWriterWhack(CommonWriter* self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_common_writer_ */
diff --git a/interfaces/loader/mmarray.h b/interfaces/loader/mmarray.h
deleted file mode 100644
index 7786b81..0000000
--- a/interfaces/loader/mmarray.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_mmarray_
-#define _h_mmarray_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-struct KFile;
-
-#define NUM_ID_SPACES (256u)
-
-struct MMArray;
-
-rc_t MMArrayMake(struct MMArray **rslt, struct KFile *fp, uint32_t elemSize);
-
-rc_t MMArrayGet(struct MMArray *const self, void **const value, uint64_t const element);
-
-void MMArrayWhack(struct MMArray *self);
-
-#endif
diff --git a/interfaces/loader/reference-writer.h b/interfaces/loader/reference-writer.h
deleted file mode 100644
index a928149..0000000
--- a/interfaces/loader/reference-writer.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef LOADER_REFERENCE_WRITER_H_
-#define LOADER_REFERENCE_WRITER_H_ 1
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-
-#include <align/writer-reference.h>
-#include "alignment-writer.h"
-
-typedef struct Reference {
-    const ReferenceMgr *mgr;
-    const ReferenceSeq *rseq;
-    int64_t lastRefId;
-    int32_t lastOffset;
-    unsigned curPos;
-    unsigned endPos;
-    unsigned length;
-    KDataBuffer coverage;
-    KDataBuffer mismatches;
-    KDataBuffer indels;
-    KDataBuffer pri_align;
-    KDataBuffer sec_align;
-    KDataBuffer pri_overlap;
-    KDataBuffer sec_overlap;
-    bool out_of_order;
-    bool acceptHardClip;
-    char last_id[256];
-} Reference;
-
-rc_t ReferenceInit(Reference *self, const VDBManager *mgr, VDatabase *db, 
-                   bool expectUnsorted,
-                   bool acceptHardClip,
-                   char const *refXRefPath,
-                   char const *inpath,
-                   uint32_t maxSeqLen,  /*TODO: save in Reference object, reuse in other functions*/
-                   char const** refFiles
-                   );
-rc_t ReferenceSetFile(Reference *self, const char *id, uint64_t length, uint8_t const md5[16], uint32_t maxSeqLen);
-rc_t ReferenceVerify(Reference const *self, char const id[], uint64_t length, uint8_t const md5[16]);
-rc_t ReferenceGet1stRow(Reference const *self, int64_t *refID, char const refName[]);
-rc_t ReferenceAddAlignId(Reference *self,
-                         int64_t align_id,
-                         bool is_primary
-                         );
-rc_t ReferenceRead(Reference *self, AlignmentRecord *data, uint64_t const pos,
-                   uint32_t const rawCigar[], uint32_t const cigCount,
-                   char const seqDNA[], uint32_t const seqLen, uint32_t *matches, bool acceptNoMatch, unsigned minMatchCount, uint32_t maxSeqLen);
-rc_t ReferenceWhack(Reference *self, bool commit, uint32_t maxSeqLen, rc_t (*const quitting)(void));
-
-#endif
diff --git a/interfaces/loader/sequence-writer.h b/interfaces/loader/sequence-writer.h
deleted file mode 100644
index c7565cb..0000000
--- a/interfaces/loader/sequence-writer.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_SEQUENCE_WRITER_H_
-#define BAM_LOAD_SEQUENCE_WRITER_H_ 1
-
-#include <insdc/sra.h>
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <klib/text.h>
-#include <klib/data-buffer.h>
-
-struct TableWriterSeq;
-
-typedef struct s_sequence_record {
-    char *seq;
-    uint8_t *qual;
-    uint32_t *readStart;
-    uint32_t *readLen;
-    uint8_t *orientation;
-    uint8_t *is_bad;
-    uint8_t *alignmentCount;
-    char *spotGroup;
-    bool *aligned;
-    char *cskey;
-    uint64_t *ti;
-    uint64_t keyId;
-    unsigned spotGroupLen;
-    KDataBuffer storage;
-    uint8_t numreads;
-} SequenceRecord;
-
-
-rc_t SequenceRecordInit(SequenceRecord *self,
-                        unsigned numreads, unsigned readLen[]);
-
-rc_t SequenceRecordAppend(SequenceRecord *self,
-                          const SequenceRecord *other);
-
-typedef struct SequenceWriter {
-    VDatabase *db;
-    struct TableWriterSeq const *tbl;
-} SequenceWriter;
-
-SequenceWriter *SequenceWriterInit(SequenceWriter *self, VDatabase *db);
-
-rc_t SequenceWriteRecord(SequenceWriter *self, SequenceRecord const *rec,
-                         bool color, bool isDup, INSDC_SRA_platform_id platform,
-                         bool keepMismatchQual,
-                         bool no_real_output,
-                         bool hasTI,
-                         char const *QualQuantizer
-                         );
-
-rc_t SequenceDoneWriting(SequenceWriter *self);
-rc_t SequenceReadKey(const SequenceWriter *self, int64_t row, uint64_t *key);
-rc_t SequenceUpdateAlignData(SequenceWriter *self, int64_t row, unsigned nreads,
-                             const int64_t primeId[/* nreads */],
-                             const uint8_t alignCount[/* nreads */]);
-
-void SequenceWhack(SequenceWriter *self, bool commit);
-
-
-#endif /* ndef BAM_LOAD_SEQUENCE_WRITER_H_ */
diff --git a/interfaces/ncbi/clip.vschema b/interfaces/ncbi/clip.vschema
deleted file mode 100644
index d95efd3..0000000
--- a/interfaces/ncbi/clip.vschema
+++ /dev/null
@@ -1,143 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:tbl:clip
- *  common clip column processing
- *  shared by 454 and ion-torrent
- *
- *  uses spotdesc because it has a dependency upon spot_len
- *
- * history:
- *  1.0.1 - base explicitly upon spotdesc #1.0.1
- *  1.0.2 - base explicitly upon spotdesc #1.0.2
- */
-table NCBI:SRA:tbl:clip #1.0.2 = INSDC:SRA:tbl:spotdesc #1.0.2
-{
-    /* CLIP_ADAPTER_LEFT, CLIP_ADAPTER_RIGHT
-     *  adapter clips in 1-based coordinates
-     *  when value is 0, implies that they are NOT SET
-     */
-    column INSDC:coord:one CLIP_ADAPTER_LEFT = out_clip_adapt_left;
-    column INSDC:coord:one CLIP_ADAPTER_RIGHT = out_clip_adapt_right;
-
-    // casts are required to allow multple storage formats
-    INSDC:coord:one out_clip_adapt_left = cast ( .CLIP_ADAPTER_LEFT );
-    INSDC:coord:one out_clip_adapt_right = cast ( .CLIP_ADAPTER_RIGHT );
-
-
-    /* CLIP_QUALITY_LEFT, CLIP_QUALITY_RIGHT
-     *  quality clips in 1-based coordinates
-     *  when value is 0, implies that they are NOT SET
-     */
-    column INSDC:coord:one CLIP_QUALITY_LEFT = out_clip_qual_left;
-    column INSDC:coord:one CLIP_QUALITY_RIGHT = out_clip_qual_right;
-
-    // casts are required to allow multple storage formats
-    INSDC:coord:one out_clip_qual_left
-        = cast ( .CLIP_QUALITY_LEFT )
-        | < INSDC:coord:one > echo < 1 > ();
-    INSDC:coord:one out_clip_qual_right
-        = cast ( .CLIP_QUALITY_RIGHT )
-        | cast ( spot_len );
-
-    // support for reading 16-bit clips, as in v1 schema
-    readonly column U16 CLIP_ADAPTER_LEFT
-        = .CLIP_ADAPTER_LEFT
-        | cast ( out_clip_adapt_left );
-    readonly column U16 CLIP_ADAPTER_RIGHT
-        = .CLIP_ADAPTER_RIGHT
-        | cast ( out_clip_adapt_right );
-    readonly column U16 CLIP_QUALITY_LEFT = cast ( out_clip_qual_left );
-    readonly column U16 CLIP_QUALITY_RIGHT = cast ( out_clip_qual_right );
-
-
-    /* CLIP-MANIA
-     */
-
-    // 1-based fully-closed right edge is row-length
-    INSDC:coord:one spot_right = ( INSDC:coord:one ) spot_len;
-
-    // processed 1-based coordinates >= 1
-    INSDC:coord:one lim_clip_adapt_left
-        = < INSDC:coord:one > clip < 1, 0x7FFFFFFF > ( out_clip_adapt_left );
-    INSDC:coord:one max_clip_adapt_right
-        = < INSDC:coord:one, INSDC:coord:one > map < 0, 0x7FFFFFFF > ( out_clip_adapt_right );
-    INSDC:coord:one lim_clip_adapt_right
-        = < INSDC:coord:one > min ( spot_right, max_clip_adapt_right );
-    INSDC:coord:one lim_clip_qual_left
-        = < INSDC:coord:one > clip < 1, 0x7FFFFFFF > ( out_clip_qual_left );
-    INSDC:coord:one max_clip_qual_right
-        = < INSDC:coord:one, INSDC:coord:one > map < 0, 0x7FFFFFFF > ( out_clip_qual_right );
-    INSDC:coord:one lim_clip_qual_right
-        = < INSDC:coord:one > min ( spot_right, max_clip_qual_right );
-
-    // read-only columns with 0-based coordinates
-    readonly column INSDC:coord:zero CLIP_ADAPTER_LEFT
-        = ( INSDC:coord:zero ) < I32 > diff < 1 > ( lim_clip_adapt_left );
-    readonly column INSDC:coord:zero CLIP_ADAPTER_RIGHT
-        = ( INSDC:coord:zero ) < I32 > diff < 1 > ( lim_clip_adapt_right );
-    readonly column INSDC:coord:zero CLIP_QUALITY_LEFT
-        = ( INSDC:coord:zero ) < I32 > diff < 1 > ( lim_clip_qual_left );
-    readonly column INSDC:coord:zero CLIP_QUALITY_RIGHT
-        = ( INSDC:coord:zero ) < I32 > diff < 1 > ( lim_clip_qual_right );
-
-    // combined clips
-    INSDC:coord:one max_clip_left
-        = < INSDC:coord:one > max ( lim_clip_adapt_left, lim_clip_qual_left )
-        | lim_clip_adapt_left
-        | lim_clip_qual_left;
-    INSDC:coord:zero max_zclip_left
-        = ( INSDC:coord:zero ) < I32 > diff < 1 > ( max_clip_left );
-    INSDC:coord:one min_clip_right
-        = < INSDC:coord:one > min ( lim_clip_adapt_right, lim_clip_qual_right )
-        | lim_clip_adapt_right
-        | lim_clip_qual_right;
-
-
-    /* TRIMMED SEQUENCE
-     *  need to find the 0-based trim_start and trim_len
-     */
-    INSDC:coord:zero bio_start
-        = NCBI:SRA:bio_start ( out_read_start, out_read_type );
-    INSDC:coord:zero trim_start
-        = < INSDC:coord:zero > max ( bio_start, max_zclip_left )
-        | bio_start;
-    I32 trim_stop
-        = < I32 > max ( min_clip_right, trim_start )
-        | spot_right;
-    INSDC:coord:len trim_len
-        = ( INSDC:coord:len ) < I32 > diff ( trim_stop, trim_start );
-};
diff --git a/interfaces/ncbi/extern.h b/interfaces/ncbi/extern.h
deleted file mode 100644
index 278f394..0000000
--- a/interfaces/ncbi/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_ncbi_extern_
-#define _h_ncbi_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define NCBI_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define NCBI_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_ncbi_extern_ */
diff --git a/interfaces/ncbi/ncbi.vschema b/interfaces/ncbi/ncbi.vschema
deleted file mode 100644
index 5dd7b1c..0000000
--- a/interfaces/ncbi/ncbi.vschema
+++ /dev/null
@@ -1,195 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB Schema intrinsic types and functions
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'insdc/insdc.vschema';
-
-
-/*--------------------------------------------------------------------------
- * data types
- */
-
-// N-encoded phred has values limited to 1..63 and 0 used for N
-typedef INSDC:quality:phred NCBI:quality:n_encoded:phred;
-// N-encoded log-odds has values limite to -5..40 and -6 for N
-typedef INSDC:quality:log_odds NCBI:quality:n_encoded:log_odds;
-
-// these types have been restated
-alias INSDC:dna:text INSDC:fasta;
-alias INSDC:4na:packed INSDC:dna:4na;
-alias INSDC:2na:packed INSDC:dna:2na;
-alias INSDC:2na:packed NCBI:2na;
-alias INSDC:2cs:packed INSDC:color:2cs;
-alias INSDC:2cs:packed NCBI:2cs;
-alias INSDC:quality:phred NCBI:qual1;
-alias NCBI:quality:n_encoded:phred NCBI:SRA:enc_qual1;
-
-// 16-bit integer sample data
-typedef I16 NCBI:isamp1;
-
-// 32-bit floating point sample data
-typedef F32 NCBI:fsamp1, NCBI:fsamp4 [ 4 ];
-
-// ASN.1
-typedef B8 NCBI:asn:binary; 
-typedef ascii NCBI:asn:text;
-
-// GenInfo id - 64 bit because we are almost out of 32 bit ids
-typedef U64 NCBI:gi;
-
-// Taxonomy id
-typedef U32 NCBI:taxid;
-
-// Genbank status
-typedef U32 NCBI:gb_state;
-
-
-/*--------------------------------------------------------------------------
- * formats
- *  many of these formats are older than the current corresponding vdb fmts
- */
-
-fmtdef merged_t;
-fmtdef fp_encoded_t;
-fmtdef rl_encoded_t;
-fmtdef NCBI:zlib_encoded_t;
-fmtdef NCBI:fp_encoded_t;
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-
-/* merge
- * split
- *  the original versions of these functions
- *  used a slightly different format giving them
- *  a different signature from their vdb counterparts.
- *
- *  here to maintain backward compatibility for
- *  column schema functions
- */
-extern function
-merged_t NCBI:merge #1.0 ( any in, ... );
-
-extern function
-any NCBI:split #1.0 < U32 idx > ( merged_t in )
-    = vdb:split;
-
-
-/* cut
- * paste
- *  these have no compiler type-checking
- */
-extern function
-any NCBI:cut #1.0 < U32 idx, ... > ( any in )
-    = vdb:cut;
-
-extern function
-any NCBI:paste #1.0 ( any in, ... )
-    = vdb:paste;
-
-
-/* pack
- * unpack
- *  wildcard typed
- */
-extern function
-any NCBI:pack #1.0 < U32 from, U32 to > ( any in );
-
-extern function
-any NCBI:unpack #1.0 < U32 from, U32 to > ( any in );
-
-
-/* fp_decode
- *  OBSOLETE
- *  here to handle anything encoded with fp_encode
- */
-extern function
-any NCBI:fp_decode #1.0 ( fp_encoded_t in );
-
-
-/* fp_extend
- *  OBSOLETE
- *  here to handle anything encoded with fp_truncate
- */
-extern function
-any NCBI:fp_extend #1.0 < U32 bits > ( NCBI:fp_encoded_t in );
-
-
-/* run_length_encode
- * run_length_decode
- */
-extern function
-rl_encoded_t NCBI:run_length_encode #1.0 ( any in )
-    = vdb:rlencode;
-
-extern function
-any NCBI:run_length_decode #1.0 ( rl_encoded_t in )
-    = vdb:rldecode;
-
-
-/* zlib
- * unzip
- *  variation on the formatting
- */
-extern function
-NCBI:zlib_encoded_t NCBI:zlib #1.0 < * I32 strategy, I32 level > ( any in )
-    = vdb:zip;
-
-extern function
-any NCBI:unzip #1.0 ( NCBI:zlib_encoded_t in );
-
-
-/* zlib_huffman_compress
- *  invokes zlib in huffman + rle mode
- */
-schema function
-NCBI:zlib_encoded_t NCBI:zlib_huffman_compress #1.0 ( any in )
-{
-    // named as Huffman, but apply RLE as well
-    return NCBI:zlib < Z_RLE > ( in );
-}
-
-/* zlib_compress
- *  standard zlib
- */
-schema function
-NCBI:zlib_encoded_t NCBI:zlib_compress #1.0 ( any in )
-{
-    return NCBI:zlib < Z_DEFAULT_STRATEGY > ( in );
-}
-
-/* zlib_decompress
- *  alternate name for unzip
- */
-alias NCBI:unzip NCBI:zlib_decompress;
diff --git a/interfaces/ncbi/seq.vschema b/interfaces/ncbi/seq.vschema
deleted file mode 100644
index bfb8f1a..0000000
--- a/interfaces/ncbi/seq.vschema
+++ /dev/null
@@ -1,889 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * Sequence schema implementation tables
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/ncbi.vschema';
-include 'insdc/sra.vschema';
-
-
-/*--------------------------------------------------------------------------
- * n_encoding - implementation
- *  introduces common virtual productions
- */
-table NCBI:tbl:n_encoding #1
-{
-    U8 n_encoding_dummy
-        = read_unpack
-        | read_ndecode;
-};
-
-
-/*--------------------------------------------------------------------------
- * seqloc
- *  NCBI sequence locator table
- */
-table NCBI:tbl:seqloc #1.0
-{
-    /* SEQ_ID
-     *  a FASTA-style SeqId
-     */
-    extern column < ascii > zip_encoding SEQ_ID;
-
-    /* SEQ_START
-     *  provided in both 1 ( default ) and 0-based coordinates
-     */
-    extern default column < INSDC:coord:one > izip_encoding SEQ_START;
-    readonly column INSDC:coord:zero SEQ_START
-        = ( INSDC:coord:zero ) < INSDC:coord:one > diff < 1 > ( .SEQ_START );
-
-    /* SEQ_LEN
-     */
-    extern column < INSDC:coord:len > izip_encoding SEQ_LEN;
-};
-
-
-/*--------------------------------------------------------------------------
- * base_space - implementation
- *  READ column rules
- */
-
-/* color_from_dna
- *  use starting keys and color matrix to convert individual reads
- *  to base space.
- */
-extern function
-INSDC:x2cs:bin NCBI:color_from_dna #1 ( INSDC:x2na:bin bin_x2na,
-    INSDC:coord:zero read_start, INSDC:coord:len read_len,
-    INSDC:dna:text cs_key, U8 color_matrix );
-
-
-/* dcmp_base_space
- *  table to introduce common virtual productions
- */
-table NCBI:tbl:dcmp_base_space #1
-{
-    // rules to introduce purely virtual productions
-    // never expected to resolve...
-    INSDC:dna:text dcmp_virtual_productions
-        = out_dcmp_4na_bin
-        | out_dcmp_x2na_bin
-        | out_dcmp_2na_bin
-        | out_dcmp_2na_packed;
-}
-
-/* history:
- *  1.0.1 - base explicitly upon sequence #1.0.1, spotdesc #1.0.1
- *  1.0.2 - spotdesc #1.0.2
- *  1.0.3 - base upon dcmp_base_space for "out_dcmp_2na_bin"
- */
-table NCBI:tbl:base_space_common #1.0.3
-    = INSDC:tbl:sequence #1.0.1
-    , INSDC:SRA:tbl:spotdesc #1.0.2
-    , INSDC:SRA:tbl:stats #1.1.0
-    , NCBI:tbl:dcmp_base_space #1.0.0
-{
-	/* INSDC:tbl:sequence inherited virtual productions
-     */
-
-    // cs_native - tells user color space is not native
-    bool cs_native = < bool > echo < false > ();
-
-    // in_cs_key is not writable in base_space
-
-    // color-space key is completely artificial
-    INSDC:dna:text out_cs_key
-        = .CS_KEY
-        | < INSDC:dna:text > echo < 'T' > ( out_read_type )
-        | < INSDC:dna:text > echo < 'T' > ( out_read_len )
-        | < INSDC:dna:text > echo < 'T' > ();
-
-    // unambiguous synthesized 2cs
-    INSDC:2cs:bin out_2cs_bin
-        = < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_x2cs_bin );
-
-    // unambiguous unpacked 2na
-    INSDC:2na:bin out_2na_bin
-        = out_dcmp_2na_bin
-        | ( INSDC:2na:bin ) unpack ( out_2na_packed );
-
-    // synthesized color sequence
-    INSDC:x2cs:bin out_x2cs_bin
-        = NCBI:color_from_dna ( out_x2na_bin, out_read_start, out_read_len, out_cs_key, out_color_matrix );
-
-    // synthesized packed 2cs
-    INSDC:2cs:packed out_2cs_packed
-        = ( INSDC:2cs:packed ) pack ( out_2cs_bin );
-
-    // synthesized packed 4na
-    INSDC:4na:packed out_4na_packed
-        = ( INSDC:4na:packed ) pack ( out_4na_bin );
-
-    // synthesized color text
-    INSDC:color:text out_color_text
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_x2cs_bin );
-
-    // published color matrix
-    U8 out_color_matrix
-        = < U8 > echo < INSDC:color:default_matrix > ();
-
-    // spot_len and fixed_spot_len
-    INSDC:coord:len base_space_spot_len
-        = ( INSDC:coord:len ) row_len ( out_2na_packed );
-    INSDC:coord:len base_space_fixed_spot_len
-        = ( INSDC:coord:len ) fixed_row_len ( out_2na_packed );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2na_bin
-	 *  out_2na_packed
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  in_stats_bin
-	 */
-
-	/* NCBI:tbl:dcmp_base_space inherited productions
-	 *  out_dcmp_2na_bin
-	 *  out_dcmp_4na_bin
-	 *  out_dcmp_x2na_bin
-	 *  out_dcmp_2na_packed
-	 */
-};
-
-
-/* base_space_nocol
- *  this table describes viewing rules
- *  but omits writing rules and physical column description
- *  in order to support older tables
- *
- * history:
- *  1.0.1 - base explicitly upon base_space_common #1.0.1
- *  1.0.2 - base explicitly upon base_space_common #1.0.2
- *  1.0.3 - " " 1.0.3
- */
-table NCBI:tbl:base_space_nocol #1.0.3
-    = NCBI:tbl:base_space_common #1.0.3
-    , NCBI:tbl:n_encoding #1
-{
-    // incoming is disabled
-
-    // synthesized dna text
-    INSDC:dna:text out_dna_text
-        = < INSDC:x2na:bin, INSDC:dna:text > map < INSDC:x2na:map:BINSET, INSDC:x2na:map:CHARSET > ( out_x2na_bin );
-
-    // synthesized 4na
-    INSDC:4na:bin out_4na_bin
-        = < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( out_x2na_bin );
-
-    // unpacked 2na with ambiguities
-    INSDC:x2na:bin out_x2na_bin
-        = ( INSDC:x2na:bin ) read_ndecode;
-
-    // interface with n-encoded qualities
-    U8 read_unpack = out_2na_bin;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 *  out_2na_packed
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_ndecode
-	 */
-};
-
-/* base_space #1
- *  this schema brings in standard .READ column for v1 tables
- *
- * history:
- *  1.0.1 - base explicitly upon base_space_nocol #1.0.1
- *  1.0.2 - base explicitly upon base_space_nocol #1.0.2
- *  1.0.3 - base explicitly upon base_space_nocol #1.0.3
- */
-table NCBI:tbl:base_space #1.0.3 = NCBI:tbl:base_space_nocol #1.0.3
-{
-    // 2-bit 2na representation (0..3)
-    INSDC:2na:packed out_2na_packed = .READ;
-
-    // no rules for writing to .READ
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_ndecode
-	 */
-};
-
-
-/* base_space #2
- *  standard current base-space table
- *
- * history:
- *  2.0.2 - base_space_common #1.0.2
- *  2.0.3 - base_space_common #1.0.3 now has dcmp_base_space as well
- */
-table NCBI:tbl:base_space #2.0.3
-    = NCBI:tbl:base_space_common #1.0.3
-    , NCBI:tbl:dcmp_base_space #1
-{
-    /* input rules
-     */
-
-    // input text
-    INSDC:dna:text in_dna_text
-        = < INSDC:dna:text, INSDC:dna:text > map < '.acmgrsvtwyhkdbn','NACMGRSVTWYHKDBN' > ( READ );
-
-    // input 4na bin
-    INSDC:4na:bin in_4na_bin
-        = < INSDC:4na:bin > range_validate < 0, 15 > ( READ )
-        | ( INSDC:4na:bin ) unpack ( in_4na_packed )
-        | < INSDC:dna:text, INSDC:4na:bin > map < INSDC:4na:map:CHARSET, INSDC:4na:map:BINSET > ( in_dna_text )
-        | < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( in_x2na_bin );
-
-    // input 4na packed
-    INSDC:4na:packed in_4na_packed = READ;
-
-    // input x2na bin
-    INSDC:x2na:bin in_x2na_bin
-        = < INSDC:x2na:bin > range_validate < 0, 4 > ( READ )
-        | < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( in_4na_bin );
-
-    // input 2na bin
-    INSDC:2na:bin in_2na_bin
-        = < INSDC:2na:bin > range_validate < 0, 3 > ( READ )
-        | ( INSDC:2na:bin ) unpack ( in_2na_packed )
-        | INSDC:SEQ:rand_4na_2na ( in_4na_bin );
-
-    // input 2na packed
-    INSDC:2na:packed in_2na_packed = READ;
-
-    // input 4na alt-read ( ambiguities )
-    INSDC:4na:bin in_alt_4na_bin
-        = < INSDC:4na:bin, INSDC:4na:bin > map < INSDC:4na:map:BINSET, [ 15,0,0,3,0,5,6,7,0,9,10,11,12,13,14,15 ] > ( in_4na_bin );
-
-    // preparing a feed into stats column
-    U8 in_stats_bin = in_2na_bin;
-
-
-    /* physical columns
-     */
-
-    physical column INSDC:2na:packed .READ
-        = in_2na_packed
-        | ( INSDC:2na:packed ) pack ( in_2na_bin );
-
-    physical column < INSDC:4na:bin > zip_encoding .ALTREAD
-        = < INSDC:4na:bin > trim < 0, 0 > ( in_alt_4na_bin );
-
-
-    /* output rules
-     */
-
-    // output 2na packed
-    INSDC:2na:packed out_2na_packed
-        = .READ
-        | out_dcmp_2na_packed;
-
-    // output x2na bin
-    INSDC:x2na:bin out_x2na_bin
-        = out_dcmp_x2na_bin
-        | < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( out_4na_bin );
-
-    // output 2na->4na bin
-    INSDC:4na:bin out_2na_4na_bin
-        = < INSDC:2na:bin, INSDC:4na:bin > map < INSDC:2na:map:BINSET, [ 1, 2, 4, 8 ] > ( out_2na_bin );
-
-    // output 4na bin
-    INSDC:4na:bin out_4na_bin
-        = < INSDC:4na:bin > bit_or < ALIGN_RIGHT > ( out_2na_4na_bin, .ALTREAD )
-        | out_dcmp_4na_bin
-        | out_2na_4na_bin;
-
-    // output text
-    INSDC:dna:text out_dna_text
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_4na_bin );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 */
-
-	/* NCBI:tbl:dcmp_base_space inherited productions
-	 *  out_dcmp_2na_bin
-	 *  out_dcmp_4na_bin
-	 *  out_dcmp_x2na_bin
-	 *  out_dcmp_2na_packed
-	 */
-};
-
-
-
-
-/*--------------------------------------------------------------------------
- * color_space - implementation
- *  nucleotide sequences in color space
- */
-
-extern function
-INSDC:x2na:bin NCBI:dna_from_color #1 ( INSDC:x2cs:bin color_bin,
-     INSDC:coord:zero read_start, INSDC:coord:len read_len,
-     INSDC:dna:text cs_key, U8 color_matrix );
-
-
-/* dcmp_color_space
- *  declares common virtual productions
- */
-table NCBI:tbl:dcmp_color_space #1
-{
-    // rules to introduce purely virtual productions
-    // never expected to resolve...
-    INSDC:dna:text dcmp_virtual_productions
-        = out_dcmp_x2cs_bin
-        | out_dcmp_2cs_bin
-        | out_dcmp_2cs_packed;
-}
-
-/* history:
- *  1.0.1 - base explicitly upn sequence #1.0.1, spotdesc #1.0.1
- *  1.0.2 - spotdesc #1.0.2
- *  1.0.3 - base upon dcmp_color_space for "out_dcmp_2cs_bin"
- */
-table NCBI:tbl:color_space_common #1.0.3
-    = INSDC:tbl:sequence #1.0.1
-    , INSDC:SRA:tbl:spotdesc #1.0.2
-    , INSDC:SRA:tbl:stats #1.1.0
-    , NCBI:tbl:dcmp_color_space #1.0.0
-{
-    // cs_native - tells user color space is native
-    bool cs_native = < bool > echo < true > ();
-
-     // unambiguous unpacked 2cs
-    INSDC:2cs:bin out_2cs_bin
-        = out_dcmp_2cs_bin
-        | ( INSDC:2cs:bin ) unpack ( out_2cs_packed );
-
-     // unambiguous synthesized 2na
-    INSDC:2na:bin out_2na_bin
-        = < INSDC:x2na:bin, INSDC:2na:bin > map < INSDC:x2na:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_x2na_bin );
-
-     // synthesized unpacked 4na
-    INSDC:4na:bin out_4na_bin
-        = < INSDC:x2na:bin, INSDC:4na:bin > map < INSDC:x2na:map:BINSET, [ 1, 2, 4, 8, 15 ] > ( out_x2na_bin );
-
-    // synthesized dna text
-    INSDC:dna:text out_dna_text
-        = < INSDC:x2na:bin, INSDC:dna:text > map < INSDC:x2na:map:BINSET, INSDC:x2na:map:CHARSET > ( out_x2na_bin );
-
-    // synthesized dna sequence
-    INSDC:x2na:bin out_x2na_bin
-        = NCBI:dna_from_color ( out_x2cs_bin, out_read_start, out_read_len, out_cs_key, out_color_matrix );
-
-    // synthesized packed 2na
-    INSDC:2na:packed out_2na_packed
-        = ( INSDC:2na:packed ) pack ( out_2na_bin );
-
-    // synthesized packed 4na
-    INSDC:4na:packed out_4na_packed
-        = ( INSDC:4na:packed ) pack ( out_4na_bin );
-
-    // synthesized color text
-    INSDC:color:text out_color_text
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_x2cs_bin );
-
-    // spot_len and fixed_spot_len
-    INSDC:coord:len color_space_spot_len
-        = ( INSDC:coord:len ) row_len ( out_2cs_packed );
-    INSDC:coord:len color_space_fixed_spot_len
-        = ( INSDC:coord:len ) fixed_row_len ( out_2cs_packed );
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  out_x2cs_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  in_stats_bin
-	 */
-
-	/* NCBI:tbl:dcmp_color_space inherited productions
-	 *  out_dcmp_2cs_bin
-	 *  out_dcmp_x2cs_bin
-	 *  out_dcmp_2cs_packed
-	 */
-};
-
-/* color_space_nocol
- *  this table describes viewing rules
- *  but omits writing rules and physical column description
- *  in order to support older tables
- *
- * history:
- *  1.0.1 - base explicitly upon color_space_common #1.0.1
- *  1.0.2 - color_space_common #1.0.2
- *  1.0.3 - color_space_common #1.0.3
- */
-table NCBI:tbl:color_space_nocol #1.0.3
-    = NCBI:tbl:color_space_common #1.0.3
-    , NCBI:tbl:n_encoding #1
-{
-    // incoming is disabled
-
-    // v1 color matrix was stored in metadata
-    U8 out_color_matrix
-        = < U8 > meta:read < "COLOR_MATRIX" > ()
-        | < U8 > echo < INSDC:color:default_matrix > ();
-
-    // unpacked 2cs with ambiguities
-    INSDC:x2cs:bin out_x2cs_bin
-        = ( INSDC:x2cs:bin ) read_ndecode;
-
-    // interface with n-encoded qualities
-    U8 read_unpack = out_2cs_bin;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_cs_key
-	 *  out_signal
-	 *  out_2cs_packed
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_ndecode
-	 */
-};
-
-/* color_space #1
- *  this schema brings in .CSREAD and .CS_KEY columns for v1 tables
- *
- * history:
- *  1.0.1 - base explicitly upon color_space_nocol #1.0.1
- *  1.0.2 - color_space_nocol #1.0.2
- *  1.0.3 - color_space_nocol #1.0.3
- */
-table NCBI:tbl:color_space #1.0.3 = NCBI:tbl:color_space_nocol #1.0.3
-{
-    // stored as text
-    INSDC:dna:text out_cs_key = .CS_KEY;
-
-    // stored color sequence
-    INSDC:2cs:packed out_2cs_packed = .CSREAD;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_ndecode
-	 */
-};
-
-/* color_space #2
- *  standard current color-space table
- *
- * history:
- *  2.0.1 - base explicitly upon color_space_common #1.0.1
- *  2.0.2 - base explicitly upon color_space_common #1.0.2
- *  2.1.0 - introduce hooks for compressed color space
- */
-table NCBI:tbl:color_space #2.1
-    = NCBI:tbl:color_space_common #1.0.3
-    , NCBI:tbl:dcmp_color_space #1.0.0
-{
-    /* input rules
-     */
-
-    // input text is not modified
-    // illegal values are not detected here
-    INSDC:color:text in_color_text = CSREAD;
-
-    // input x2cs bin
-    // illegal values will be caught here
-    INSDC:x2cs:bin in_x2cs_bin
-        = < INSDC:x2cs:bin > range_validate < 0, 4 > ( CSREAD )
-        | < INSDC:color:text, INSDC:x2cs:bin > map < INSDC:x2cs:map:CHARSET, INSDC:x2cs:map:BINSET > ( in_color_text );
-
-    // input 2cs bin
-    INSDC:2cs:bin in_2cs_bin
-        = < INSDC:2cs:bin > range_validate < 0, 3 > ( CSREAD )
-        | ( INSDC:2cs:bin ) unpack ( in_2cs_packed )
-        | < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( in_x2cs_bin );
-
-    // input 2cs packed
-    INSDC:2cs:packed in_2cs_packed = CSREAD;
-
-    // input x2cs alt-csread ( ambiguity )
-    INSDC:x2cs:bin in_alt_x2cs_bin
-        = < INSDC:x2cs:bin, INSDC:x2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 0, 0, 0, 4 ] > ( in_x2cs_bin );
-
-    // color-space keys ARE modified on input
-    INSDC:dna:text in_cs_key
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgt', 'ACGT' > ( CS_KEY );
-
-    // color matrix
-    U8 in_color_matrix = < U8 > range_validate < 0, 4 > ( COLOR_MATRIX );
-
-    // prepairing a feed into stats column
-    U8 in_stats_bin = in_2cs_bin;
-
-
-    /* physical columns
-     */
-
-    physical column INSDC:2cs:packed .CSREAD
-        = in_2cs_packed
-        | ( INSDC:2cs:packed ) pack ( in_2cs_bin );
-
-    physical column < INSDC:x2cs:bin > zip_encoding .ALTCSREAD
-        = < INSDC:x2cs:bin > trim < 0, 0 > ( in_alt_x2cs_bin );
-
-    physical column < INSDC:dna:text > zip_encoding .CS_KEY = in_cs_key;
-
-    physical column < U8 > zip_encoding .COLOR_MATRIX = in_color_matrix;
-
-
-    /* output rules
-     */
-
-    // output 2cs packed
-    INSDC:2cs:packed out_2cs_packed
-        = .CSREAD
-        | out_dcmp_2cs_packed;
-
-    // unpacked 2cs with ambiguity
-    INSDC:x2cs:bin out_x2cs_bin
-        = ( INSDC:x2cs:bin ) < U8 > bit_or < ALIGN_RIGHT > ( out_2cs_bin, .ALTCSREAD )
-        | out_dcmp_x2cs_bin
-        | ( INSDC:x2cs:bin ) out_2cs_bin;
-
-    // read directly from physical column
-    INSDC:dna:text out_cs_key = .CS_KEY;
-
-    // color matrix may be synthesized
-    U8 out_color_matrix
-        = .COLOR_MATRIX
-        | < U8 > echo < INSDC:color:default_matrix > ();
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_signal
-	 */
-
-	/* NCBI:tbl:dcmp_color_space inherited productions
-	 *  out_dcmp_2cs_bin
-	 *  out_dcmp_x2cs_bin
-	 *  out_dcmp_2cs_packed
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * protein
- */
-table NCBI:tbl:protein #1 = INSDC:tbl:protein
-{
-    /* upper-case letters */
-    INSDC:protein:text in_protein_text = < INSDC:protein:text, INSDC:protein:text >
-        map < 'abcdefghiklmnpqrstvwxyzu','ABCDEFGHIKLMNPQRSTVWXYZU' > ( PROTEIN );
-
-    /* std aa */
-    INSDC:aa:bin in_aa_bin
-        = < INSDC:aa:bin > range_validate < 1, 25 > ( PROTEIN )
-        | < INSDC:protein:text, INSDC:aa:bin > map < INSDC:aa:map:CHARSET, INSDC:aa:map:BINSET > ( in_protein_text );
-
-    /* physical column */
-    physical column < INSDC:aa:bin > zip_encoding .PROTEIN = in_aa_bin;
-
-    /* output rules */
-    INSDC:aa:bin out_aa_bin = .PROTEIN;
-    INSDC:protein:text out_protein_text = < INSDC:aa:bin, INSDC:protein:text >
-        map < INSDC:aa:map:BINSET, INSDC:aa:map:CHARSET > ( out_aa_bin );
-};
-
-
-/*--------------------------------------------------------------------------
- * phred
- *  standard phred quality representation
- *  limits values on input to 1..63
- *  reserves value 0 as ambiguity symbol for reads
- */
-
-
-/* history:
- *  1.0.1 - base explicitly upon sequence #1.0.1
- */
-table NCBI:tbl:phred_quality_nocol #1.0.1 = INSDC:tbl:sequence #1.0.1, NCBI:tbl:n_encoding #1
-{
-    /* [CS]READ - decoding
-     */
-    U8 read_ndecode
-        = < INSDC:quality:phred, U8 > map < 0, 4 > ( out_qual_phred, read_unpack );
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_phred
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-};
-
-/* history:
- *  1.0.1 - base explicitly upon phred_quality_nocol #1.0.1
- */
-table NCBI:tbl:phred_quality #1.0.1 = NCBI:tbl:phred_quality_nocol #1.0.1
-{
-    // read directly as n-encoded phred is compatible with phred
-    NCBI:quality:n_encoded:phred out_qual_phred = .QUALITY;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-};
-
-/* history:
- *  2.0.1 - added feed of in_stats_qual
- *  2.0.2 - added input of text encodings
- *  2.0.3 - base explicitly upon sequence #1.0.1
- *  2.0.4 - change compression from izip to zip
- *  2.0.5 - change from zip to delta_average_zip
- */
-table NCBI:tbl:phred_quality #2.0.4 = INSDC:tbl:sequence #1.0.1
-{
-    // read directly quality as  phred
-    INSDC:quality:phred out_qual_phred = .QUALITY;
-
-    // input rules
-    INSDC:quality:text:phred_33 in_qual_text_phred_33 = QUALITY;
-    INSDC:quality:text:phred_64 in_qual_text_phred_64 = QUALITY;
-
-    INSDC:quality:phred in_qual_phred
-        = QUALITY
-        | ( INSDC:quality:phred ) < B8 > diff < 33 > ( in_qual_text_phred_33 )
-        | ( INSDC:quality:phred ) < B8 > diff < 64 > ( in_qual_text_phred_64 );
-
-    // physical storage
-/*** next line is  for future change in production, but we have to wait until supporting code is released to the public ***/
-// physical column < INSDC:quality:phred > delta_average_zip_encoding .QUALITY = in_qual_phred;
-/*** NB *** MUST change table version to 2.0.5 and propagate to all derived tables ***/
-    physical column < INSDC:quality:phred > zip_encoding .QUALITY = in_qual_phred;
-
-    // feed to compressed statistics
-    INSDC:quality:phred in_stats_qual = in_qual_phred;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-};
-
-
-
-/*--------------------------------------------------------------------------
- * log_odds
- *  log-odds quality score support
- *
- *  conversion from log-odds to phred is via formula
- *    10 * log ( 1 + pow ( 10, x / 10 ) ) / log ( 10 ) + 0.499
- *  for x = -4..40 : when x = -5, phred = 0
- */
-
-// the map function requires two lookup tables:
-// the first table detects every legal value...
-const INSDC:quality:log_odds NCBI:quality:from:log_odds =
-[
-             -6,-5,-4,-3,-2,-1, 0,
-     1, 2, 3, 4, 5, 6, 7, 8, 9,10,
-    11,12,13,14,15,16,17,18,19,20,
-    21,22,23,24,25,26,27,28,29,30,
-    31,32,33,34,35,36,37,38,39,40
-];
-
-// ...the second table gives positional translations
-const INSDC:quality:phred NCBI:quality:to:phred =
-[
-              0, 1, 1, 2, 2, 3, 3,
-     4, 4, 5, 5, 6, 7, 8, 9,10,10,
-    11,12,13,14,15,16,17,18,19,20,
-    21,22,23,24,25,26,27,28,29,30,
-    31,32,33,34,35,36,37,38,39,40
-];
-
-function
-INSDC:quality:phred NCBI:log_odds_to_phred #1 ( INSDC:quality:log_odds qual_log_odds )
-{
-    // this range enforcement may not be required
-    INSDC:quality:log_odds log_odds_clip
-        = < INSDC:quality:log_odds > clip < -6, 40 > ( qual_log_odds );
-
-    // use the tables above to map from log-odds to phred
-    return < INSDC:quality:log_odds, INSDC:quality:phred >
-        map < NCBI:quality:from:log_odds, NCBI:quality:to:phred > ( log_odds_clip );
-}
-
-/* history:
- *  1.0.1 - base explicitly upon sequence #1.0.1
- */
-table NCBI:tbl:log_odds_quality_nocol #1.0.1 = INSDC:tbl:sequence #1.0.1, NCBI:tbl:n_encoding #1
-{
-    /* READ - decoding
-     */
-    U8 read_ndecode
-        = < INSDC:quality:log_odds, U8 > map < -6, 4 > ( out_qual_log_odds, read_unpack );
-
-    /* QUALITY
-     *  declared in INSDC:tbl:sequence as phred
-     *  introduce here as log-odds
-     */
-    extern column INSDC:quality:log_odds QUALITY = out_qual_log_odds;
-
-    // resolve for phred
-    INSDC:quality:phred out_qual_phred
-        = out_qual2_phred
-        | NCBI:log_odds_to_phred ( out_qual_log_odds );
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-
-	/* NCBI:tbl:log_odds_quality_nocol productions
-	 *  out_qual2_phred
-	 *  out_qual_log_odds
-	 */
-};
-
-/* history:
- *  1.0.1 - base explicitly upon log_odds_quality_nocol #1.0.1
- */
-table NCBI:tbl:log_odds_quality #1.0.1 = NCBI:tbl:log_odds_quality_nocol #1.0.1
-{
-    // read directly as n-encoded log_odds is compatible with log_odds
-    NCBI:quality:n_encoded:log_odds out_qual_log_odds = .QUALITY;
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-
-	/* NCBI:tbl:log_odds_quality_nocol inherited productions
-	 *  out_qual2_phred
-	 */
-};
-
-/* history:
- *  2.0.1 - base explicitly upon sequence #1.0.1
- */
-table NCBI:tbl:log_odds_quality_nocol #2.0.1 = INSDC:tbl:sequence #1.0.1
-{
-    /* QUALITY
-     *  declared in INSDC:tbl:sequence as phred
-     *  introduce here as log-odds
-     */
-    extern column INSDC:quality:log_odds QUALITY
-        = out_qual_log_odds;
-
-    // resolve for phred
-    INSDC:quality:phred out_qual_phred
-        = NCBI:log_odds_to_phred ( out_qual_log_odds );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:log_odds_quality_nocol productions
-	 *  out_qual_log_odds
-	 */
-};
-
-/* history:
- *  2.0.1 - added feed of in_stats_qual
- *  2.0.2 - added input of text encodings
- *  2.0.3 - base explicitly upon log_odds_quality_nocol #2.0.1
- *  2.0.4 - changed compression from izip to zip
- */
-table NCBI:tbl:log_odds_quality #2.0.4 = NCBI:tbl:log_odds_quality_nocol #2.0.1
-{
-    INSDC:quality:log_odds out_qual_log_odds= .QUALITY;
-
-    extern column INSDC:quality:text:log_odds_64 QUALITY
-        = out_qual_text_log_odds_64
-        | ( INSDC:quality:text:log_odds_64 ) < B8 > sum < 64 > ( out_qual_log_odds );
-
-    // input rules
-    INSDC:quality:text:log_odds_64 in_qual_text_log_odds_64 = QUALITY;
-
-    INSDC:quality:log_odds in_qual_log_odds
-        = QUALITY
-        | ( INSDC:quality:log_odds ) < B8 > diff < 64 > ( in_qual_text_log_odds_64 );
-
-    physical column < INSDC:quality:log_odds > zip_encoding .QUALITY
-        = in_qual_log_odds;
-
-    // feed to compressed statistics
-    INSDC:quality:log_odds in_stats_qual = in_qual_log_odds;
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  out_qual_text_phred_33
-	 *  out_qual_text_phred_64
-	 */
-
-	/* NCBI:tbl:log_odds_quality productions
-	 *  out_qual_text_log_odds_64
-	 */
-};
diff --git a/interfaces/ncbi/spotname.vschema b/interfaces/ncbi/spotname.vschema
deleted file mode 100644
index 5993cda..0000000
--- a/interfaces/ncbi/spotname.vschema
+++ /dev/null
@@ -1,377 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Sequence Read Archive schema
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'insdc/sra.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-/* spot_name_token
- *  a vector describing tokens recognized within a spot name
- *
- * COMPONENTS:
- *  0 - token id
- *  1 - token starting coordinate
- *  2 - token length
- */
-alias text:token NCBI:SRA:spot_name_token;
-
-
-/* token values
- *
- *  tokens are produced by a schema-specific tokenizer function
- *  this function is purposely abstract because it may rely upon
- *  whatever information it needs to perform its task. the only
- *  requirement is that it produce these tokens as its output.
- *
- *  an empty name input must produce no tokens. in this case,
- *  there is no name to tokenize or data to produce.
- *
- *  a non-empty name must produce 1 or more tokens of output.
- *  all tokens must be ordered by starting character position.
- *
- *  if a name does not conform to any pattern recognized by the
- *  tokenizer, then the tokenizer emits a single token of "unrecognized"
- *
- *  if a name conforms to some pattern but does not have any
- *  substitution tokens, the tokenizer emits a single token of "recognized"
- *
- *  if a name may be tokenized, then the resulting tokens should
- *  describe only the portions of the string that should be removed
- *  from the name, e.g. "X" or "Y".
- *
- *  the standard coordinates "X".."L" are given in unsigned decimal.
- *  alternate representations are contained within their respective
- *  namespaces: "signed", "hex" and "octal".
- *
- *  the special coordinate "Q" represents the 454-specific encoding
- *  of X and Y into base-36, where the formula for Q is:
- *    Q = 4096 * X + Y
- *  and ASCII encoding:
- *    0..25 => "A-Z", 26..35 => "0-9"
- */
-const U16 NCBI:SRA:name_token:unrecognized =  1;
-const U16 NCBI:SRA:name_token:recognized   =  2;
-const U16 NCBI:SRA:name_token:Q            =  3;
-const U16 NCBI:SRA:name_token:X            =  4;
-const U16 NCBI:SRA:name_token:Y            =  5;
-const U16 NCBI:SRA:name_token:T            =  6;
-const U16 NCBI:SRA:name_token:L            =  7;
-const U16 NCBI:SRA:name_token:signed:X     =  8;
-const U16 NCBI:SRA:name_token:signed:Y     =  9;
-const U16 NCBI:SRA:name_token:signed:T     = 10;
-const U16 NCBI:SRA:name_token:signed:L     = 11;
-const U16 NCBI:SRA:name_token:octal:X      = 12;
-const U16 NCBI:SRA:name_token:octal:Y      = 13;
-const U16 NCBI:SRA:name_token:octal:T      = 14;
-const U16 NCBI:SRA:name_token:octal:L      = 15;
-const U16 NCBI:SRA:name_token:hex:upper:X  = 16;
-const U16 NCBI:SRA:name_token:hex:upper:Y  = 17;
-const U16 NCBI:SRA:name_token:hex:upper:T  = 18;
-const U16 NCBI:SRA:name_token:hex:upper:L  = 19;
-const U16 NCBI:SRA:name_token:hex:lower:X  = 20;
-const U16 NCBI:SRA:name_token:hex:lower:Y  = 21;
-const U16 NCBI:SRA:name_token:hex:lower:T  = 22;
-const U16 NCBI:SRA:name_token:hex:lower:L  = 23;
-
-
-/* token symbols
- *  when a name matches some pattern and tokens are recognized,
- *  the tokens are extracted from the name and sent to individual
- *  columns, and replaced with the symbols below to create a
- *  formatted name.
- */
-const ascii NCBI:SRA:name_symbol:Q           = '$Q';
-const ascii NCBI:SRA:name_symbol:X           = '$X';
-const ascii NCBI:SRA:name_symbol:Y           = '$Y';
-const ascii NCBI:SRA:name_symbol:T           = '$T';
-const ascii NCBI:SRA:name_symbol:L           = '$L';
-const ascii NCBI:SRA:name_symbol:octal:X     = '$a';
-const ascii NCBI:SRA:name_symbol:octal:Y     = '$b';
-const ascii NCBI:SRA:name_symbol:octal:T     = '$c';
-const ascii NCBI:SRA:name_symbol:octal:L     = '$d';
-const ascii NCBI:SRA:name_symbol:hex:upper:X = '$e';
-const ascii NCBI:SRA:name_symbol:hex:upper:Y = '$f';
-const ascii NCBI:SRA:name_symbol:hex:upper:T = '$g';
-const ascii NCBI:SRA:name_symbol:hex:upper:L = '$h';
-const ascii NCBI:SRA:name_symbol:hex:lower:X = '$x';
-const ascii NCBI:SRA:name_symbol:hex:lower:Y = '$y';
-const ascii NCBI:SRA:name_symbol:hex:lower:T = '$t';
-const ascii NCBI:SRA:name_symbol:hex:lower:L = '$l';
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* extract_spot_name
- *  generates input to .SPOT_NAME column
- *
- *  on NCBI:SRA:name_token:unrecognized, produces the entire spot name row
- *  otherwise, produces an empty row
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
- */
-function ascii
-    NCBI:SRA:extract_spot_name #1 ( ascii name, NCBI:SRA:spot_name_token tok );
-
-
-/* extract_name_fmt
- *  generates input to .NAME_FMT column and/or updates skey index
- *
- *  on NCBI:SRA:name_token:unrecognized, produces an empty row
- *  otherwise, it creates a temporary "name_fmt" string from name row
- *
- *  an attempt is made to insert name_fmt into indicated text index
- *  ( normally 'skey' ). if the insert succeeds, i.e. associates "name_fmt"
- *  with a row_id, then the output for the row is empty.
- *
- *  if the insert fails due to key duplication, an attempt is made to
- *  extend the id range of associated rows. depending upon the type of index,
- *  this may succeed or fail, e.g. if the existing row range for "name_fmt" is
- *  n..m where m = row_id - 1, the range can be extended to n..row_id and
- *  the update succeeds. if the index supports discontiguous id ranges, the
- *  update will also succeed. upon any success updating the index, the output
- *  row will be empty.
- *
- *  finally, if the temporary "name_fmt" cannot be inserted into the index
- *  nor the existing id range updated, the output for the row will be "name_fmt".
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
- */
-function ascii
-    NCBI:SRA:extract_name_fmt #1 < ascii idx > ( ascii name, NCBI:SRA:spot_name_token tok );
-
-
-/* extract_name_coord
- *  generates inputs to .X and .Y and possibly other columns
- *
- *  if no tokens match "coord"constant, produces an empty row
- *  otherwise, produces binary coordinate value
- *  if multiple tokens match criteria, all values must be equivalent
- *  because only a single value will be output per row
- *
- *  "coord" [ CONST ] - either NCBI:SRA:name_token:X or NCBI:SRA:name_token:Y
- *  both of these values also match the token NCBI:SRA:name_token:Q and extract
- *  contents appropriately.
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
- */
-function INSDC:coord:val
-    NCBI:SRA:extract_name_coord #1 < U16 coord > ( ascii name, NCBI:SRA:spot_name_token tok );
-
-
-/* lookup
- */
-function INSDC:SRA:spot_ids_found NCBI:SRA:lookup #1.0
-    < ascii index_name, ascii query_by_name, U8 name_fmt_version > ( * ascii name_prefix );
-
-
-/*--------------------------------------------------------------------------
- * spotcoord
- *  spot coordinate table implementation
- */
-table NCBI:SRA:tbl:spotcoord #1 = INSDC:SRA:tbl:spotcoord #1
-{
-    // X and Y stored as I32
-    INSDC:coord:val out_x_coord = .X;
-    INSDC:coord:val out_y_coord = .Y;
-
-    // T and L are usually present but optional
-    INSDC:coord:val out_t_coord = .T;
-    INSDC:coord:val out_l_coord = .L;
-
-    // .X, .Y, .T and .L get either empty coordinate or proper coordinate
-    physical column < INSDC:coord:val > izip_encoding .X
-        = in_x_coord
-        | in_name_x_coord;
-    physical column < INSDC:coord:val > izip_encoding .Y
-        = in_y_coord
-        | in_name_y_coord;
-    physical column < INSDC:coord:val > izip_encoding .T
-        = in_t_coord
-        | in_name_t_coord;
-    physical column < INSDC:coord:val > izip_encoding .L
-        = in_l_coord
-        | in_name_l_coord;
-};
-
-
-/*--------------------------------------------------------------------------
- * skeyname
- *  spot name table implementation built upon prefix-tree skey index
- *
- * v1 - maintains a 1->1 key=>spot_id relationship
- *      with unique constraint on key. it does NOT
- *      implement name_fmt or x_coord or y_coord.
- *
- * v2 - maintains a 1->1 key=>spot_id-range relationship
- *      with unique constraint on key. it does NOT
- *      implement spot_name. X and Y are stored using
- *      16-bit unsigned quantities.
- *
- * v3 - maintains a flexible naming approach
- *      retrieves name directly from column if so stored
- *      synthesizes name from name_fmt, X and Y otherwise
- *      name_fmt is either retrieved directly from column
- *      or from skey index. X and Y are stored as 32-bit
- *      signed quantities.
- *
- * history:
- *  1.0.1 - explicitly account for spotname #1.0.1 ancestry
- *  2.0.1 - " "
- *  3.0.1 - moved .X and .Y to spotcoord table
- */
-table NCBI:SRA:tbl:skeyname #1.0.1 = INSDC:SRA:tbl:spotname #1.0.1
-{
-    // read the skey entry
-    ascii out_skey = ( ascii ) idx:text:project #1 < 'skey' > ();
-
-    // spot_name
-    ascii out_spot_name
-        = rewritten_spot_name
-        | out_skey;
-
-    // search skey entry
-    INSDC:SRA:spot_ids_found spot_ids_found
-        = ( INSDC:SRA:spot_ids_found ) NCBI:SRA:lookup #1 < 'skey' , 'QUERY_BY_NAME', 1 > ( out_slx_prefix ) 
-        | ( INSDC:SRA:spot_ids_found ) NCBI:SRA:lookup #1 < 'skey' , 'QUERY_BY_NAME', 0 > ();
-
-
-	/* INSDC:SRA:tbl:spotname inherited productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 *  out_name_fmt
-	 */
-
-	/* NCBI:SRA:tbl:skeyname productions
-	 *  out_slx_prefix
-	 *  rewritten_spot_name
-	 */
-};
-
-table NCBI:SRA:tbl:skeyname_nocol #2.0.1 = INSDC:SRA:tbl:spotname #1.0.1
-{
-    // name_fmt
-    //  perform reverse lookup through index to get key
-    ascii out_name_fmt = ( ascii ) idx:text:project #1 < 'skey' > ();
-
-    // search skey entry
-    INSDC:SRA:spot_ids_found spot_ids_found
-        = ( INSDC:SRA:spot_ids_found ) NCBI:SRA:lookup #1 < 'skey' , 'QUERY_BY_NAME', 2 > ( out_slx_prefix ) 
-        | ( INSDC:SRA:spot_ids_found ) NCBI:SRA:lookup #1 < 'skey' , 'QUERY_BY_NAME', 2 > ();
-
-    // X and Y stored as U16
-    INSDC:coord:val out_x_coord = cast ( .X );
-    INSDC:coord:val out_y_coord = cast ( .Y );
-
-
-	/* NCBI:SRA:tbl:skeyname_nocol virtual productions
-	 *  out_slx_prefix
-	 */
-};
-
-table NCBI:SRA:tbl:skeyname #2.0.1 = NCBI:SRA:tbl:skeyname_nocol #2.0.1
-{
-    // spot_name_tok comes from a platform-specific tokenizer
-    // and must be of type 'NCBI:SRA:spot_name_token'
-    physical column < INSDC:coord:val > izip_encoding #1 .X
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:X > ( NAME, in_spot_name_tok );
-    physical column < INSDC:coord:val > izip_encoding .Y
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:Y > ( NAME, in_spot_name_tok );
-
-	/* NCBI:SRA:tbl:skeyname_nocol inherited virtual productions
-	 *  out_slx_prefix
-	 */
-
-	/* NCBI:SRA:tbl:skeyname virtual productions
-	 *  in_spot_name_tok
-	 */
-};
-
-table NCBI:SRA:tbl:skeyname #3.0.1 = INSDC:SRA:tbl:spotname #1.0.1, NCBI:SRA:tbl:spotcoord #1
-{
-    // spot_name
-    //  retrieve from hard column
-    ascii out_spot_name = .SPOT_NAME;
-
-    // name_fmt
-    //  retrieve from hard column or reverse lookup through index
-    ascii out_name_fmt = ( ascii ) idx:text:project #1 < 'skey' > ( .NAME_FMT );
-
-    INSDC:SRA:spot_ids_found  spot_ids_found
-        = ( INSDC:SRA:spot_ids_found ) NCBI:SRA:lookup #1 < 'skey' , 'QUERY_BY_NAME', 2 > ();
-
-
-    /* encoding rules
-     *  the sub-table will provide a platform-specific parser that
-     *  produces as its output a series of NCBI:SRA:spot_name_token
-     *  for each input row in the virtual production "spot_name_tok"
-     *
-     *  the tokenizer will look for X, Y or Q (combined) coordinates
-     *  within the spot name and issue tokens when found, or in the
-     *  case that none are found, an "unrecognized" token is issued.
-     *
-     *  the tokens are then processed here by common rules
-     */
-
-    // .SPOT_NAME gets either empty strings or unrecognized strings
-    physical column < ascii > zip_encoding .SPOT_NAME
-        = NCBI:SRA:extract_spot_name ( NAME, in_spot_name_tok );
-
-    // .NAME_FMT gets either empty strings or unindexed but recognized strings
-    physical column < ascii > zip_encoding .NAME_FMT
-        = NCBI:SRA:extract_name_fmt < 'skey' > ( NAME, in_spot_name_tok );
-
-    // .X, .Y, .T and .L get either empty coordinate or proper coordinate
-    INSDC:coord:val in_name_x_coord
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:X > ( NAME, in_spot_name_tok );
-    INSDC:coord:val in_name_y_coord
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:Y > ( NAME, in_spot_name_tok );
-    INSDC:coord:val in_name_t_coord
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:T > ( NAME, in_spot_name_tok );
-    INSDC:coord:val in_name_l_coord
-        = NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:L > ( NAME, in_spot_name_tok );
-
-
-	/* NCBI:SRA:tbl:skeyname virtual productions
-	 *  in_spot_name_tok
-	 */
-};
diff --git a/interfaces/ncbi/sra.vschema b/interfaces/ncbi/sra.vschema
deleted file mode 100644
index fc4dd63..0000000
--- a/interfaces/ncbi/sra.vschema
+++ /dev/null
@@ -1,743 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Sequence Read Archive schema
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/seq.vschema';
-include 'ncbi/spotname.vschema';
-include 'insdc/sra.vschema';
-include 'ncbi/stats.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-
-/* Segment - DEPRECATED
- *  a ( start, len ) pair where start is a zero-based, unsigned coordinate
- */
-typedef U16 NCBI:SRA:Segment [ 2 ];
-
-
-/* SpotDesc - DEPRECATED
- *   uint16_t spot_len;
- *   uint16_t fixed_len;
- *   uint16_t signal_len;
- *   uint16_t clip_qual_right;
- *   uint8_t num_reads;
- *   uint8_t align [ 7 ];
- */
-typedef B8 NCBI:SRA:SpotDesc [ 16 ];
-
-
-/* ReadDesc - DEPRECATED
- *   SRASegment { uint16_t start, len; } seg;
- *   uint8_t type;
- *   char cs_key;
- *   char label [ 74 ];
- */
-typedef B8 NCBI:SRA:ReadDesc [ 80 ];
-
-
-// some types have been moved to INSDC
-alias INSDC:SRA:platform_id NCBI:SRA:platform_id;
-alias INSDC:SRA:read_type NCBI:SRA:read_type;
-alias INSDC:SRA:read_filter NCBI:SRA:read_filter;
-
-typedef NCBI:fsamp4 NCBI:SRA:rotated_fsamp4, NCBI:SRA:swapped_fsamp4;
-
-// 16-bit POSITION type
-typedef U16 NCBI:SRA:pos16;
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* bio_start
- *  searches through read_type vector
- *  returns the 0-based starting coordinate of first biological read
- *
- *  "read_start" [ DATA ] - vector of read start coordinates
- *
- *  "read_type" [ DATA ] - vector of read types
- */
-extern function INSDC:coord:zero
-    NCBI:SRA:bio_start #1 ( INSDC:coord:zero read_start, INSDC:SRA:xread_type read_type );
-
-
-/* fix_read_seg
- */
-extern function INSDC:coord:len [ 2 ]
-    NCBI:SRA:fix_read_seg #1 ( U16 [ 2 ] rd_seg, INSDC:coord:len spot_len );
-
-
-/* make_spot_desc
- *  assembles several bits of information together into a "C" structure
- *
- *  "spot_len" [ DATA ] - computed spot length value
- *
- *  "fixed_len" [ DATA, DFLT ZERO ] - the stated fixed length of all spots
- *  or zero if not fixed length
- *
- *  "sig_len" [ DATA, DFLT ZERO ] - the length of signal/intensity data
- *  or zero if not present
- *
- *  "trim_start" [ DATA ] - the first base included in the trim segment
- *
- *  "trim_len" [ DATA ] - the length of the trim segment
- *
- *  "num_reads" [ DATA ] - 1..n value
- */
-extern function NCBI:SRA:SpotDesc NCBI:SRA:make_spot_desc #1 ( INSDC:coord:len spot_len,
-    INSDC:coord:len fixed_len,  INSDC:coord:len sig_len, INSDC:coord:zero trim_start,
-    INSDC:coord:len trim_len, U8 num_reads );
-
-
-/* make_read_desc
- *  assembles several bits of information together into a "C" structure
- *  in theory resultant segments may intersect other read segments or leave holes in spot.
- *
- *  "num_reads" [ DATA ] - value indicating the resulting row-length of output
- *
- *  "read_start" [ DATA ] - ordered starting coordinates for each read
- *  not required to be sequential.
- *
- *  "read_len" [ DATA ] - ordered lengths of each read. may be zero when
- *  read has been described but is not identified in spot.
- *
- *  "read_type" [ DATA ] - ordered type id describing each read
- *
- *  "read_filt" [ DATA ] - ordered read filters
- *
- *  "cs_key" [ DATA ] - ordered color-space keys
- *
- *  "label_start" [ DATA ] - ordered starting coordinates for each label
- *  "label_len" [ DATA ] - ordered lengths of each label
- *
- *  "label" [ DATA ] - complete sequence of label characters, possibly empty
- *  individual read labels are identified as {start,len} pairs
- */
-extern function NCBI:SRA:ReadDesc NCBI:SRA:make_read_desc #1 ( U8 num_reads,
-    INSDC:coord:zero read_start, INSDC:coord:len read_len, INSDC:SRA:xread_type read_type,
-    INSDC:SRA:read_filter read_filt, INSDC:dna:text cs_key,
-    INSDC:coord:zero label_start, INSDC:coord:len label_len, ascii label );
-
-
-/* rotate
- *  rotate a quadruple by called base
- *  now normally replaced by swap
- *
- *  "T" [ TYPE ] - element type of quadruple to be rotated
- *
- *  "encoding" [ CONST ] - when true, rotate input left until corresponding
- *  element is in slot 0. when false, rotate input right to restore original
- *  order.
- *
- *  "in" [ DATA ] - data to be rotated, qualities, signal, intensities...
- *
- *  "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors
- */
-extern function < type T >
-T NCBI:SRA:rotate #1 < bool encoding > ( T in, U8 called );
-
-
-/* swap
- *  swap element 0 and the called element
- *  used to ensure that the called element is in slot 0
- *
- *  "T" [ TYPE ] - element type of quadruple to be swapped
- *
- *  "in" [ DATA ] - data to be swapped, qualities, signal, intensities...
- *
- *  "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors
- */
-extern function < type T >
-T NCBI:SRA:swap #1 ( T in, U8 called );
-
-
-/* normalize
- * denormalize
- *
- *  "T" [ TYPE ] - element type of quadruple to be [de]normalized
- *
- *  "intensity" [ DATA ] - intensity data
- *
- *  "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors
- */
-extern function < type T >
-T NCBI:SRA:normalize #1 ( T intensity, U8 called );
-
-extern function < type T >
-T NCBI:SRA:denormalize #1 ( T intensity, U8 called );
-
-
-/* make_position
- *  return a synthesized position row with 1-1 correspondence
- *
- *  "T" [ TYPE ] - position type being generated
- *
- *  "start" [ CONST ] - either 0 or 1, depending upon the coordinate system
- *
- *  "bases" [ DATA ] - the actual row of bases. the output row
- *  will be the same length, but with synthesized data
- */
-extern function < type T >
-T NCBI:SRA:make_position #1 < T start > ( any bases );
-
-/* fsamp4 compression
- *  performs compression individually
- *  on called channel and alternate channels
- */
-function NCBI:SRA:swapped_fsamp4 NCBI:SRA:fsamp4:decode #2 ( merged_fmt in )
-{
-    fzip_fmt cmp0 = split < 0 > ( in );
-    fzip_fmt cmp123 = split < 1 > ( in );
-    F32 ch0 = funzip ( cmp0 );
-    F32 ch123a = funzip ( cmp123 );
-    F32[3] ch123 = redimension ( ch123a );
-    return ( NCBI:SRA:swapped_fsamp4 ) < F32 > paste ( ch0, ch123 );
-}
-
-function merged_fmt NCBI:SRA:fsamp4:encode #2 < U32 called, U32 alt > ( NCBI:SRA:swapped_fsamp4 in )
-{
-    F32 ch0 = < F32 > cut < 0 > ( in );
-    F32[3] ch123 = < F32 > cut < 1, 2, 3 > ( in );
-    fzip_fmt cmp0 = fzip < called > ( ch0 );
-    F32 ch123a = redimension ( ch123 );
-    fzip_fmt cmp123 = fzip < alt > ( ch123a );
-    return merge ( cmp0, cmp123 );
-}
-
-
-/*--------------------------------------------------------------------------
- * spotdesc
- *  NCBI implementation productions
- */
-
-/* history:
- *  1.0.1 - base explicitly upon sequence #1.0.1, spotdesc #1.0.1
- *  1.0.2 - spotdesc #1.0.2
- */
-table NCBI:SRA:tbl:spotdesc_nocol #1.0.2 = INSDC:tbl:sequence #1.0.1, INSDC:SRA:tbl:spotdesc #1.0.2
-{
-    /* LABEL_SEG
-     */
-    readonly column NCBI:SRA:Segment LABEL_SEG
-        = out_label_seg
-        | cast ( out_label_seg32 )
-        | cast ( _out_label_seg32 );
-    U32 _out_label_startU32 = ( U32 ) out_label_start;
-    U32 [ 2 ] _out_label_seg32 = < U32 > paste ( _out_label_startU32, out_label_len );
-
-
-    /* READ_SEG
-     */
-    readonly column NCBI:SRA:Segment READ_SEG
-        = out_read_seg
-        | cast ( out_read_seg32 )
-        | cast ( _out_read_seg32 );
-    U32 _out_read_startU32 = ( U32 ) out_read_start;
-    U32 [ 2 ] _out_read_seg32 = < U32 > paste ( _out_read_startU32, out_read_len );
-
-
-    /* READ_DESC
-     */
-    readonly column NCBI:SRA:ReadDesc READ_DESC
-        = NCBI:SRA:make_read_desc ( out_nreads, out_read_start, out_read_len,
-              out_read_type, _out_rd_filter, out_cs_key, _out_label_start, _out_label_len, _out_label );
-    INSDC:SRA:read_filter _out_rd_filter
-        = out_rd_filter
-        | < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ( out_read_start );
-    ascii _out_label
-        = out_label
-        | < ascii > echo < '' > ();
-    INSDC:coord:zero _out_label_start
-        = out_label_start
-        | < INSDC:coord:zero > echo < 0 > ( out_read_start );
-    INSDC:coord:len _out_label_len
-        = out_label_len
-        | < INSDC:coord:len > echo < 0 > ( out_read_start );
-
-    /* SPOT_DESC
-     */
-    readonly column NCBI:SRA:SpotDesc SPOT_DESC
-        = NCBI:SRA:make_spot_desc ( spot_len, fixed_spot_len, signal_len,
-              trim_start, trim_len, out_nreads );
-
-    /* SIGNAL_LEN
-     *  normally the same as spot length when present,
-     *  but in some cases ( e.g. 454 ) it may be different
-     */
-    readonly column INSDC:coord:len SIGNAL_LEN
-        = signal_len;
-    readonly column U16 SIGNAL_LEN
-        = cast ( signal_len );
-
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 *  out_read_seg32
-	 *  out_label_seg32
-	 */
-};
-
-/* history:
- *  1.0.1 - base explicitly upon spotdesc_nocol #1.0.1
- *  1.0.2 - base explicitly upon spotdesc_nocol #1.0.2
- */
-table NCBI:SRA:tbl:spotdesc_nophys #1.0.2 = NCBI:SRA:tbl:spotdesc_nocol #1.0.2
-{
-    // resolve virtual productions
-    U8 out_nreads = .NREADS; 
-    ascii out_label = .LABEL;
-    INSDC:SRA:xread_type out_read_type = .READ_TYPE;
-    INSDC:SRA:read_filter out_rd_filter  = .RD_FILTER;
-
-    INSDC:coord:zero out_label_start
-        = .LABEL_START
-        | ( INSDC:coord:zero ) < U32 > cut < 0 > ( out_label_seg32 );
-    INSDC:coord:len out_label_len
-        = .LABEL_LEN
-        | ( INSDC:coord:len ) < U32 > cut < 1 > ( out_label_seg32 );
-    U32 [ 2 ] out_label_seg32
-        = cast ( .LABEL_SEG );
-
-    INSDC:coord:zero out_read_start
-        = .READ_START
-        | ( INSDC:coord:zero ) < U32 > cut < 0 > ( out_read_seg32 );
-    INSDC:coord:len out_read_len
-        = .READ_LEN
-        | ( INSDC:coord:len ) < U32 > cut < 1 > ( out_read_seg32 );
-    U32 [ 2 ] out_read_seg32
-        = NCBI:SRA:fix_read_seg ( .READ_SEG, spot_len );
-
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  trim_start
-	 *  out_read_type
-	 *  static_fixed_spot_len
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol inherited productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nophys productions
-	 *  .LABEL
-	 *  .NREADS
-	 *  .READ_LEN
-	 *  .READ_SEG
-	 *  .LABEL_LEN
-	 *  .LABEL_SEG
-	 *  .RD_FILTER
-	 *  .READ_TYPE
-	 *  .READ_START
-	 *  .LABEL_START
-	 */
-}
-
-/* history:
- *  1.0.1 - base explicitly upon spotdesc_nophys #1.0.1
- *  1.0.2 - base explicitly upon spotdesc_nophys #1.0.2
- */
-table NCBI:SRA:tbl:spotdesc #1.0.2 = NCBI:SRA:tbl:spotdesc_nophys #1.0.2
-{
-    // physical column encodings
-    // TBD - this has to be looked at, where dynamic segmentation is involved
-    physical column < U8 > zip_encoding .NREADS = NREADS;
-    physical column < ascii > zip_encoding .LABEL = LABEL;
-    physical column < INSDC:coord:zero > izip_encoding .LABEL_START = LABEL_START;
-    physical column < INSDC:coord:len > izip_encoding .LABEL_LEN = LABEL_LEN;
-    physical column < INSDC:coord:zero > izip_encoding .READ_START = READ_START;
-    physical column < INSDC:coord:len > izip_encoding .READ_LEN = in_read_len;
-    physical column < INSDC:SRA:xread_type > zip_encoding .READ_TYPE = in_read_type;
-    physical column < INSDC:SRA:read_filter > zip_encoding .RD_FILTER = READ_FILTER;
-
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  trim_start
-	 *  out_read_type
-	 *  static_fixed_spot_len
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol inherited productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * pos
- *  synthetic POSITION column on read
- *
- * history:
- *  1.0.1 - base explicitly upon sequence #1.0.1
- */
-
-table NCBI:SRA:tbl:pos #1.0.1 = INSDC:tbl:sequence #1.0.1
-{
-    INSDC:position:one out_position
-        = < INSDC:position:one > NCBI:SRA:make_position < 1 > ( out_2na_packed )
-        | < INSDC:position:one > NCBI:SRA:make_position < 1 > ( out_2cs_packed );
-    NCBI:SRA:pos16 out_position16
-        = < NCBI:SRA:pos16 > NCBI:SRA:make_position < 1 > ( out_2na_packed )
-        | < NCBI:SRA:pos16 > NCBI:SRA:make_position < 1 > ( out_2cs_packed );
-};
-
-
-/*--------------------------------------------------------------------------
- * sra
- *  the NCBI SRA table
- */
-
-/* history:
- *  1.0.1 - base explicitly upon sra #1.0.1
- *  1.0.2 - base explicitly upon sra #1.0.2, spotdesc_nocol #1.0.1
- *  1.0.3 - base explicitly upon sra #1.0.3, spotdesc_nocol #1.0.2
- */
-table NCBI:SRA:tbl:sra_nopos #1.0.3 = INSDC:SRA:tbl:sra #1.0.3, NCBI:SRA:tbl:spotdesc_nocol #1.0.2
-{
-    // v1 declares the POSITION column for all tables
-    // but leaves all physical columns unstated
-
-    /* POSITION
-     *  1-based coordinates
-     *  describes a base's position on signal
-     */
-    column INSDC:position:one POSITION = out_position;
-    readonly column NCBI:SRA:pos16 POSITION = out_position16;
-
-    // zero-based coordinates available upon request
-    readonly column INSDC:position:zero POSITION
-        = ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position );
-
-    // statistics
-    U64 base_count
-        = < U64 > meta:value < "BASE_COUNT" > ();
-    U64 spot_count
-        = < U64 > meta:value < ".seq/spot" > ()
-        | < U64 > meta:value < ".seq" > () ;
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotname inherited productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  max_spot_id
-	 *  min_spot_id
-	 *  in_stats_bin
-	 *  bio_base_count
-	 */
-
-	/* INSDC:SRA:tbl:sra inherited productions
-	 *  out_platform
-	 *  platform_name
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol inherited productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 *  out_read_seg32
-	 *  out_label_seg32
-	 */
-
-	/* NCBI:SRA:tbl:sra_nopos productions
-	 *  out_position
-	 *  out_position16
-	 */
-};
-
-/* history:
- *  1.0.1 - base explicitly upon sra #1.0.1
- *  1.0.2 - base explicitly upon sra_nopos #1.0.2, pos #1.0.1
- *  1.0.3 - base explicitly upon sra_nopos #1.0.3
- */
-table NCBI:SRA:tbl:sra #1.0.3 = NCBI:SRA:tbl:sra_nopos #1.0.3, NCBI:SRA:tbl:pos #1.0.1
-{
-    // the POSITION column is synthesized for all contemporary platforms but 454
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotname inherited productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  max_spot_id
-	 *  min_spot_id
-	 *  in_stats_bin
-	 *  bio_base_count
-	 */
-
-	/* INSDC:SRA:tbl:sra inherited productions
-	 *  out_platform
-	 *  platform_name
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol inherited productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 *  out_read_seg32
-	 *  out_label_seg32
-	 */
-};
-
-
-/* v2 consolidates many of the auxiliary columns into a single treatment
- * left out are reads, qualities and platform-specific columns
- *
- * history:
- * 2.1.2 - base upon sra #1.0.3, spotdesc #1.0.2, stats #1.1.2
- */
-table NCBI:SRA:tbl:sra_nopos #2.1.3 = INSDC:SRA:tbl:sra #1.0.3,
-    NCBI:SRA:tbl:skeyname #3.0.1, NCBI:SRA:tbl:spotdesc #1.0.2, NCBI:SRA:tbl:stats #1.2.0
-{
-    // this is already specified in INSDC:SRA:tbl:sra #1
-    // but putting it here will quiet down outputs
-    INSDC:SRA:platform_id out_platform = .PLATFORM;
-    
-    column INSDC:position:one POSITION
-        = out_position;
-    readonly column NCBI:SRA:pos16 POSITION
-        = cast ( _clip_position );
-    INSDC:position:one _clip_position
-        = < INSDC:position:one > clip < 0, 0xFFFF > ( out_position );
-    readonly column INSDC:position:zero POSITION
-        = ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  trim_start
-	 *  out_read_type
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  in_stats_bin
-	 */
-
-	/* INSDC:SRA:tbl:sra inherited productions
-	 *  out_platform
-	 *  platform_name
-	 */
-
-	/* NCBI:SRA:tbl:skeyname inherited productions
-	 *  in_spot_name_tok
-	 */
-
-	/* NCBI:SRA:tbl:spotdesc_nocol inherited productions
-	 *  out_read_seg
-	 *  out_label_seg
-	 */
-
-	/* NCBI:SRA:tbl:sra_nopos productions
-	 *  out_position
-	 */
-};
-
-/* most platforms don't have a native POSITION
- * mix in "pos" table to synthesize it
- *
- * history:
- *  2.1.2 - base upon sra#1.0.3, spotdesc #1.0.2, stats #1.1.2
- */
-table NCBI:SRA:tbl:sra #2.1.3 = INSDC:SRA:tbl:sra #1.0.3,
-    NCBI:SRA:tbl:skeyname #3.0.1, NCBI:SRA:tbl:spotdesc #1.0.2,
-    NCBI:SRA:tbl:stats #1.2.0, NCBI:SRA:tbl:pos #1.0.1
-{
-    readonly column INSDC:position:one POSITION
-        = out_position;
-    readonly column NCBI:SRA:pos16 POSITION
-        = out_position16;
-    readonly column INSDC:position:zero POSITION
-        = ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  trim_start
-	 *  out_read_type
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  in_stats_bin
-	 */
-
-	/* INSDC:SRA:tbl:sra inherited productions
-	 *  out_platform
-	 *  platform_name
-	 */
-
-	/* NCBI:SRA:tbl:skeyname inherited productions
-	 *  in_spot_name_tok
-	 */
-};
diff --git a/interfaces/ncbi/stats.vschema b/interfaces/ncbi/stats.vschema
deleted file mode 100644
index c462a8a..0000000
--- a/interfaces/ncbi/stats.vschema
+++ /dev/null
@@ -1,119 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Sequence Read Archive schema
- */
-version 1;
-
-include 'insdc/sra.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-typeset NCBI:SRA:stats:qual_type
-{
-    INSDC:quality:phred,
-    INSDC:quality:log_odds,
-    INSDC:quality:log_odds [ 4 ]
-};
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/*
-   trigger to build meta statistics: spot count, base count, etc.
- */
-extern function U8 NCBI:SRA:stats_trigger #1
-    ( U8 read_bin, U32 read_len, INSDC:SRA:xread_type read_type * ascii spot_group );
-
-/* trigger to build meta statistics from compressed reads
- */
-extern function
-U8 NCBI:SRA:cmp_stats_trigger #1 ( B8 cmp_read_bin, NCBI:SRA:stats:qual_type qual_bin,
-    U32 read_len, INSDC:SRA:xread_type read_type * ascii spot_group );
-
-extern function
-U8 NCBI:SRA:cmpf_stats_trigger #1 ( B8 cmp_read_bin, U32 spot_len,
-    U32 read_len, INSDC:SRA:xread_type read_type * ascii spot_group );
-
-
-/* trigger to build phred_quality statistics in meta
- */
-extern function
-U8 NCBI:SRA:phred_stats_trigger #1 ( INSDC:quality:phred qual_bin );
-
-/*--------------------------------------------------------------------------
- * table
- */
-
-/* stats
- *  holds sequence statistics
- *
- * history:
- *  1.0.1 - explicitly interit from sra #1.0.1
- *  1.1.0 - incorporate stats from compressed read
- *  1.1.1 - sra #1.0.2
- *  1.1.2 - sra #1.0.3 + cmp_base_count or to base_count
- */
-table NCBI:SRA:tbl:stats #1.2.0 = INSDC:SRA:tbl:stats #1.1, INSDC:SRA:tbl:sra #1.0.3
-{
-    INSDC:SRA:spotid_t min_spot_id
-        = < INSDC:SRA:spotid_t > meta:value < "STATS/TABLE/SPOT_MIN" > ();
-
-    INSDC:SRA:spotid_t max_spot_id
-        = < INSDC:SRA:spotid_t > meta:value < "STATS/TABLE/SPOT_MAX" > ();
-
-    U64 spot_count
-        = < U64 > meta:value < "STATS/TABLE/SPOT_COUNT" > ();
-
-    U64 base_count
-        = < U64 > meta:value < "STATS/TABLE/BASE_COUNT" > ();
-
-    U64 bio_base_count
-        = < U64 > meta:value < "STATS/TABLE/BIO_BASE_COUNT" > ();
-
-    U64 cmp_base_count
-        = < U64 > meta:value < "STATS/TABLE/CMP_BASE_COUNT" > () | base_count;
-
-    trigger meta_stats
-        = NCBI:SRA:stats_trigger ( in_stats_bin, in_read_len, in_read_type, in_spot_group )
-        | NCBI:SRA:stats_trigger ( in_stats_bin, in_read_len, in_read_type )
-        | NCBI:SRA:cmp_stats_trigger ( in_cmp_stats_bin, in_stats_qual, in_read_len, in_read_type, in_spot_group )
-        | NCBI:SRA:cmp_stats_trigger ( in_cmp_stats_bin, in_stats_qual, in_read_len, in_read_type )
-        | NCBI:SRA:cmpf_stats_trigger ( in_cmp_stats_bin, in_spot_len, in_read_len, in_read_type, in_spot_group )
-        | NCBI:SRA:cmpf_stats_trigger ( in_cmp_stats_bin, in_spot_len, in_read_len, in_read_type );
-        
-    trigger qual_stats
-        = NCBI:SRA:phred_stats_trigger #1 ( in_qual_phred );
-
-	/* INSDC:SRA:tbl:stats inherited virtual productions
-	 *  in_stats_bin
-	 */
-};
diff --git a/interfaces/ncbi/wgs-contig.h b/interfaces/ncbi/wgs-contig.h
deleted file mode 100644
index 7b8ab2d..0000000
--- a/interfaces/ncbi/wgs-contig.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_ncbi_wgs_contig_
-#define _h_ncbi_wgs_contig_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*==========================================================================
- * WGS Contig
- */
-
-
-/*--------------------------------------------------------------------------
- * types
- * constants
- */
-
-/* component_props
- *  a signed value describing either contigs or gaps
- *  where values >= 0 refer to contigs
- *  and negatives describe gaps
- */
-typedef int16_t NCBI_WGS_component_props;
-
-/* component description
- *  the sequencing status of the component
- *
- *  These typically correspond to keywords in the INSDC submission.
- *  Current acceptable values are_
- *    A           Active Finishing
- *    D           Draft HTG (often phase1 and phase2 are called Draft,
- *                whether or not they have the draft keyword).
- *    F           Finished HTG (phase3)
- *    G           Whole Genome Finishing
- *    O           Other sequence (typically means no HTG keyword)
- *    P           Pre Draft
- *    W           WGS contig
- */
-enum
-{
-    NCBI_WGS_component_WGS                  = 0,
-    NCBI_WGS_component_ActiveFinishing      = 1,
-    NCBI_WGS_component_DraftHTG             = 2,
-    NCBI_WGS_component_FinishedHTG          = 3,
-    NCBI_WGS_component_WholeGenomeFinishing = 4,
-    NCBI_WGS_component_OtherSequence        = 5,
-    NCBI_WGS_component_PreDraft             = 6
-};
-
-/* strand
- *  specifies the orientation of the component relative to scaffold
- *  values given allow strand to be determined as "prop / 16"
- *  yielding_
- *    0           unknown orientation
- *    1           plus strand
- *    2           negative strand
- */
-enum
-{
-    NCBI_WGS_strand_plus                    = 1 * 16,
-    NCBI_WGS_strand_minus                   = 2 * 16
-};
-
-
-/* gap description
- *  These typically correspond to keywords in the INSDC submission.
- *  Current acceptable values are_
- *    N           gap with specified size
- *    U           gap of unknown size, defaulting to 100 bases.
- */
-enum
-{
-    NCBI_WGS_gap_known                      = 1 * -1,
-    NCBI_WGS_gap_unknown                    = 2 * -1
-};
-
-/* gap type
- *  scaffold          a gap between two sequence contigs in a scaffold
- *  contig            an unspanned gap between two sequence contigs
- *  centromere        a gap inserted for the centromere
- *  short_arm         a gap inserted at the start of an acrocentric chromosome
- *  heterochromatin   a gap inserted for an especially large region of heterochromatic sequence
- *  telomere          a gap inserted for the telomere
- *  repeat            an unresolvable repeat
- */
-enum
-{
-    NCBI_WGS_gap_scaffold                   = 1 * -4,
-    NCBI_WGS_gap_contig                     = 2 * -4,
-    NCBI_WGS_gap_centromere                 = 3 * -4,
-    NCBI_WGS_gap_short_arm                  = 4 * -4,
-    NCBI_WGS_gap_heterochromatin            = 5 * -4,
-    NCBI_WGS_gap_telomere                   = 6 * -4,
-    NCBI_WGS_gap_repeat                     = 7 * -4
-};
-
-/* gap linkage evidence
- *  paired-ends       paired sequences from the two ends of a DNA fragment
- *  align_genus       alignment to a reference genome within the same genus
- *  align_xgenus      alignment to a reference genome within another genus
- *  align_trnscpt     alignment to a transcript from the same species
- *  within_clone      sequence on both sides of the gap is derived from
- *                    the same clone, but the gap is not spanned by paired-ends
- *  clone_contig      linkage is provided by a clone contig in the tiling path
- *  map               linkage asserted using a non-sequence based map
- *                    such as RH, linkage, fingerprint or optical
- *  strobe            strobe sequencing (PacBio)
- *  unspecified
- */
-enum
-{
-    NCBI_WGS_gap_linkage_paired_ends        = 1 * -64,
-    NCBI_WGS_gap_linkage_align_genus        = 2 * -64,
-    NCBI_WGS_gap_linkage_align_xgenus       = 3 * -64,
-    NCBI_WGS_gap_linkage_align_trnscpt      = 4 * -64,
-    NCBI_WGS_gap_linkage_within_clone       = 5 * -64,
-    NCBI_WGS_gap_linkage_clone_contig       = 6 * -64,
-    NCBI_WGS_gap_linkage_map                = 7 * -64,
-    NCBI_WGS_gap_linkage_strobe             = 8 * -64,
-    NCBI_WGS_gap_linkage_unspecified        = 9 * -64
-};
-
-
-/*--------------------------------------------------------------------------
- * accession tokenization constants
- */
-
-/* tokenize_nuc_accession
- * tokenize_prot_accession
- *  scans name on input
- *  tokenizes into parts
- */
-enum
-{
-    NCBI_WGS_acc_token_unrecognized =  1,
-    NCBI_WGS_acc_token_prefix       =  2,
-    NCBI_WGS_acc_token_contig       =  3
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_ncbi_wgs_contig_ */
diff --git a/interfaces/ncbi/wgs-contig.vschema b/interfaces/ncbi/wgs-contig.vschema
deleted file mode 100644
index 2fa1210..0000000
--- a/interfaces/ncbi/wgs-contig.vschema
+++ /dev/null
@@ -1,660 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * WGS Contig
- */
-version 1;
-
-include 'vdb/vdb.vschema';
-include 'ncbi/ncbi.vschema';
-include 'ncbi/seq.vschema';
-include 'ncbi/spotname.vschema';
-include 'ncbi/stats.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- * constants
- */
-
-/* component_props
- *  a signed value describing either contigs or gaps
- *  where values >= 0 refer to contigs
- *  and negatives describe gaps
- */
-typedef I16 NCBI:WGS:component_props;
-
-/* component description
- *  the sequencing status of the component
- *
- *  These typically correspond to keywords in the INSDC submission.
- *  Current acceptable values are:
- *    A           Active Finishing
- *    D           Draft HTG (often phase1 and phase2 are called Draft,
- *                whether or not they have the draft keyword).
- *    F           Finished HTG (phase3)
- *    G           Whole Genome Finishing
- *    O           Other sequence (typically means no HTG keyword)
- *    P           Pre Draft
- *    W           WGS contig
- */
-const NCBI:WGS:component_props NCBI:WGS:component:WGS                  = 0;
-const NCBI:WGS:component_props NCBI:WGS:component:ActiveFinishing      = 1;
-const NCBI:WGS:component_props NCBI:WGS:component:DraftHTG             = 2;
-const NCBI:WGS:component_props NCBI:WGS:component:FinishedHTG          = 3;
-const NCBI:WGS:component_props NCBI:WGS:component:WholeGenomeFinishing = 4;
-const NCBI:WGS:component_props NCBI:WGS:component:OtherSequence        = 5;
-const NCBI:WGS:component_props NCBI:WGS:component:PreDraft             = 6;
-
-/* strand
- *  specifies the orientation of the component relative to scaffold
- *  values given allow strand to be determined as "prop / 16"
- *  yielding:
- *    0           unknown orientation
- *    1           plus strand
- *    2           negative strand
- */
-const NCBI:WGS:component_props NCBI:WGS:strand:plus                    = 16;
-const NCBI:WGS:component_props NCBI:WGS:strand:minus                   = 32;
-
-
-/* gap description
- *  These typically correspond to keywords in the INSDC submission.
- *  Current acceptable values are:
- *    N           gap with specified size
- *    U           gap of unknown size, defaulting to 100 bases.
- */
-const NCBI:WGS:component_props NCBI:WGS:gap:known                      = -1;
-const NCBI:WGS:component_props NCBI:WGS:gap:unknown                    = -2;
-
-/* gap type
- *  scaffold          a gap between two sequence contigs in a scaffold
- *  contig            an unspanned gap between two sequence contigs
- *  centromere        a gap inserted for the centromere
- *  short_arm         a gap inserted at the start of an acrocentric chromosome
- *  heterochromatin   a gap inserted for an especially large region of heterochromatic sequence
- *  telomere          a gap inserted for the telomere
- *  repeat            an unresolvable repeat
- */
-const NCBI:WGS:component_props NCBI:WGS:gap:scaffold                   = -4;
-const NCBI:WGS:component_props NCBI:WGS:gap:contig                     = -8;
-const NCBI:WGS:component_props NCBI:WGS:gap:centromere                 = -12;
-const NCBI:WGS:component_props NCBI:WGS:gap:short_arm                  = -16;
-const NCBI:WGS:component_props NCBI:WGS:gap:heterochromatin            = -20;
-const NCBI:WGS:component_props NCBI:WGS:gap:telomere                   = -24;
-const NCBI:WGS:component_props NCBI:WGS:gap:repeat                     = -28;
-
-/* gap linkage evidence
- *  paired-ends       paired sequences from the two ends of a DNA fragment
- *  align_genus       alignment to a reference genome within the same genus
- *  align_xgenus      alignment to a reference genome within another genus
- *  align_trnscpt     alignment to a transcript from the same species
- *  within_clone      sequence on both sides of the gap is derived from
- *                    the same clone, but the gap is not spanned by paired-ends
- *  clone_contig      linkage is provided by a clone contig in the tiling path
- *  map               linkage asserted using a non-sequence based map
- *                    such as RH, linkage, fingerprint or optical
- *  strobe            strobe sequencing (PacBio)
- *  unspecified
- */
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:paired_ends        = -64;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:align_genus        = -128;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:align_xgenus       = -192;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:align_trnscpt      = -256;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:within_clone       = -320;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:clone_contig       = -384;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:map                = -448;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:strobe             = -512;
-const NCBI:WGS:component_props NCBI:WGS:gap:linkage:unspecified        = -576;
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* tokenize_nuc_accession
- * tokenize_prot_accession
- *  scans name on input
- *  tokenizes into parts
- */
-extern function text:token
-    NCBI:WGS:tokenize_nuc_accession #1 ( ascii acc );
-extern function text:token
-    NCBI:WGS:tokenize_prot_accession #1 ( ascii acc );
-
-const U16 NCBI:WGS:acc_token:unrecognized =  1;
-const U16 NCBI:WGS:acc_token:prefix       =  2;
-const U16 NCBI:WGS:acc_token:contig       =  3;
-
-
-/* build_scaffold_read
- *  assembles contigs and gaps into a single row
- *  transcribes + strand contigs as they are,
- *  performs reverse complement of - strand contigs,
- *  fills gaps with stated number of N
- *
- * build_scaffold_quality
- *  assembles contig and gap qualities into a single row
- *  contig qualities are taken as they are,
- *  gap qualities are assigned a constant
- *
- *  "component_start" [ DATA ] - starting locations on each
- *   component or 0 for gaps. normal starting point is 0,
- *   but offsets are supported.
- *  NB - ONE-BASED COORDINATES
- *
- *  "component_len" [ DATA ] - length of contig sequence
- *   from component_start, or length of gap, projected onto
- *   scaffold at scaffold_start.
- *
- *  "component_props" [ DATA ] - see discussion of type
- *   distinguish between contigs and gaps, indicate strand
- *
- *  "component_id" [ DATA ] - foreign keys into SEQUENCE table
- *   row_len ( component_id ) == count-of-contigs ( component_props )
- */
-extern function INSDC:4na:bin NCBI:WGS:build_scaffold_read #1
-    ( INSDC:coord:one component_start, INSDC:coord:len component_len,
-      NCBI:WGS:component_props component_props, I64 component_id );
-
-extern function INSDC:quality:phred NCBI:WGS:build_scaffold_qual #1
-    ( INSDC:coord:one component_start, INSDC:coord:len component_len,
-      NCBI:WGS:component_props component_props, I64 component_id );
-
-
-/* build_read_type
- *  generate standard SRA read type from component properties
- *  contigs are biological, gaps are technical
- *
- *  "component_props" [ DATA ] - see discussion of type
- *   distinguish between contigs and gaps, indicate strand
- */
-extern function INSDC:SRA:xread_type
-    NCBI:WGS:build_read_type #1 ( NCBI:WGS:component_props component_props );
-
-
-/*--------------------------------------------------------------------------
- * nucleotide
- */
-table NCBI:WGS:tbl:nucleotide #1.1
-    = NCBI:tbl:base_space #2.0.3
-    , NCBI:tbl:phred_quality #2.0.4
-    , NCBI:SRA:tbl:stats #1.2.0
-{
-    /* ACCESSION
-     *  [<opt-prefix>]<4-letter-prefix><2-digit-version><6-or-7-digit-contig>
-     */
-    extern column ascii ACCESSION = out_accession;
-    extern column U32   ACC_VERSION = .ACC_VERSION | <U32> echo <1> ();
-
-    // input
-    ascii in_accession = ACCESSION;
-
-    // parsed input
-    text:token in_acc_token
-        = NCBI:WGS:tokenize_nuc_accession ( in_accession );
-    //  [<opt-prefix>]<4-letter-prefix><2-digit-version>
-    ascii in_acc_prefix
-        = extract_token < 0 > ( in_accession, in_acc_token );
-    // <6-or-7-digit-contig>
-    ascii in_contig_text
-        = extract_token < 1 > ( in_accession, in_acc_token );
-    U32 in_contig_len
-        = row_len ( in_contig_text );
-    U64 in_contig_bin
-        = strtonum ( in_contig_text );
-
-    // physical storage
-    physical column < ascii > zip_encoding .ACC_PREFIX = in_acc_prefix;
-    physical column < U32 > izip_encoding .ACC_CONTIG_LEN = in_contig_len;
-    physical column < U64 > izip_encoding .ACC_CONTIG = in_contig_bin;
-    physical column < U32 > izip_encoding .ACC_VERSION = ACC_VERSION; //needed to back-fill WGS data from ID where version may be > 1
-
-    // output
-    ascii out_acc_prefix
-        = .ACC_PREFIX
-        | < ascii > meta:read < 'ACC_PREFIX', true > ()
-        ;
-    U32 out_acc_contig_len
-        = .ACC_CONTIG_LEN
-        | < U32 > meta:value < 'ACC_CONTIG_LEN', true > ()
-        ;
-    U64 out_acc_contig
-        = .ACC_CONTIG
-        | ( U64 ) row_id ()
-        ;
-    ascii out_accession
-        = sprintf < "%s%0*u" > ( out_acc_prefix, out_acc_contig_len, out_acc_contig );
-
-    readonly column ascii ACC_PREFIX
-        = .ACC_PREFIX
-        | < ascii > meta:read < 'ACC_PREFIX', true > ()
-        ;
-    readonly column U32 ACC_CONTIG_LEN
-        = .ACC_CONTIG_LEN
-        | < U32 > meta:value < 'ACC_CONTIG_LEN', true > ()
-        ;
-
-    /* CONTIG_NAME
-     *  principal name
-     */
-    extern column utf8 CONTIG_NAME
-        = idx:text:project < 'contig_name' > ( .CONTIG_NAME );
-
-    physical column < utf8 > zip_encoding .CONTIG_NAME
-        = idx:text:insert < 'contig_name' > ( CONTIG_NAME );
-
-    ascii out_contig_name = cast ( CONTIG_NAME );
-
-    // NB - this is only useful if CONTIG_NAME is unique
-    // or if clustered by CONTIG_NAME
-    readonly column vdb:row_id_range CONTIG_NAME_ROW_RANGE
-        = idx:text:lookup < 'contig_name', 'NAME_QUERY' > ();
-
-    /* EXTRA_SEQIDS
-     *  pipe-separated list of additional names
-     */
-    extern column < ascii > zip_encoding EXTRA_SEQIDS;
-
-    /* TITLE
-     */
-    extern column < ascii > zip_encoding TITLE;
-
-    /* GI
-     *  gi is indexed in a parallel table
-     */
-    extern column < NCBI:gi > izip_encoding GI;
-
-    /* TAXID
-     *  taxonomy id
-     */
-    extern column < NCBI:taxid > izip_encoding TAXID;
-
-    /* GB_STATE
-     *  genbank state
-     */
-    extern column < NCBI:gb_state > izip_encoding GB_STATE;
-
-    /* DESCR
-     *  ASN.1 description
-     */
-    extern column < NCBI:asn:binary > zip_encoding DESCR;
-
-    /* ANNOT
-     *  ASN.1 annotation
-     */
-    extern column < NCBI:asn:binary > zip_encoding ANNOT;
-
-    ascii out_seqid_gi = sprintf < "gi|%u" > ( .GI );
-    ascii out_seqid_gb = sprintf < "gb|%s.%u|" > ( out_accession, ACC_VERSION )
-                       | sprintf < "gb|%s.1|" > ( out_accession );
-    ascii out_seqid_gnl = sprintf < "gnl|WGS:%s|%s" > (.ACC_PREFIX, out_contig_name ) | <ascii> echo < '' > ();
-
-
-    /* outputs to spotname */
-    ascii out_seqid_name
-        = sprintf < "%s|%s" > ( out_seqid_gi , out_seqid_gb )
-		| sprintf < "%s" > ( out_seqid_gb );
-
-    ascii out_spot_name = sprintf < "%s %s" > ( out_seqid_name, .TITLE );
-
-    readonly column ascii SEQ_ID = out_seqid_name;
-    readonly column ascii SEQ_ID_GNL = out_seqid_gnl;
-
-    /* outputs to spotdesc */
-    // INSDC:coord:len in_read_len  = (INSDC:coord:len) row_len ( in_2na_bin );
-    INSDC:coord:len  out_read_len = (INSDC:coord:len) row_len ( out_2na_bin );
-    INSDC:coord:len  trim_len = (INSDC:coord:len) row_len ( out_2na_bin );
-    INSDC:coord:zero out_read_start = <INSDC:coord:zero> echo < 0 > ();
-    INSDC:coord:zero trim_start = <INSDC:coord:zero> echo < 0 > ();
-    INSDC:SRA:read_filter out_rd_filter = < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ();
-    INSDC:SRA:xread_type  out_read_type = < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-    // help trigger statistics
-    INSDC:SRA:xread_type  _alt_in_read_type = < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-    INSDC:coord:len       _alt_in_read_len  = (INSDC:coord:len) row_len ( in_2na_bin );
-
-    ascii out_label = < ascii > echo < "contig" > ();
-    INSDC:coord:len out_label_len = < INSDC:coord:len > echo < 6 > ();
-    INSDC:coord:zero out_label_start = < INSDC:coord:zero > echo < 0 > ();
-
-    INSDC:SRA:platform_id out_platform = < INSDC:SRA:platform_id > echo < SRA_PLATFORM_UNDEFINED > ();
-};
-
-
-/*--------------------------------------------------------------------------
- * protein
- *  contig
- */
-table NCBI:WGS:tbl:protein #1
-    = NCBI:tbl:protein #1.0.0
-{
-    /* ACCESSION
-     *  [<opt-prefix>]<4-letter-prefix><2-digit-version><6-or-7-digit-contig>
-     */
-    extern column ascii ACCESSION = out_accession;
-
-    // input
-    ascii in_accession = ACCESSION;
-
-    // parsed input
-    text:token in_acc_token
-        = NCBI:WGS:tokenize_prot_accession ( in_accession );
-    //  [<opt-prefix>]<4-letter-prefix><2-digit-version>
-    ascii in_acc_prefix
-        = extract_token < 0 > ( in_accession, in_acc_token );
-    // <6-or-7-digit-contig>
-    ascii in_contig_text
-        = extract_token < 1 > ( in_accession, in_acc_token );
-    U32 in_contig_len
-        = row_len ( in_contig_text );
-    I64 in_contig_bin
-        = strtonum ( in_contig_text );
-
-    // physical storage
-    physical column < ascii > zip_encoding .ACC_PREFIX = in_acc_prefix;
-    physical column < U32 > izip_encoding .ACC_CONTIG_LEN = in_contig_len;
-    physical column < U64 > izip_encoding .ACC_CONTIG = in_contig_bin;
-
-    // output
-    ascii out_acc_prefix
-        = .ACC_PREFIX
-        | < ascii > meta:read < 'ACC_PREFIX', true > ()
-        ;
-    U32 out_acc_contig_len
-        = .ACC_CONTIG_LEN
-        | < U32 > meta:value < 'ACC_CONTIG_LEN', true > ()
-        ;
-    U64 out_acc_contig
-        = .ACC_CONTIG
-        | ( U64 ) row_id ()
-        ;
-    ascii out_accession
-        = sprintf < "%s%0*u" > ( out_acc_prefix, out_acc_contig_len, out_acc_contig );
-
-    /* TITLE
-     */
-    extern column < ascii > zip_encoding TITLE;
-
-    /* GI
-     *  gi is indexed in a parallel table
-     */
-    extern column < NCBI:gi > izip_encoding GI;
-
-    /* GB_STATE
-     *  genbank state
-     */
-    extern column < NCBI:gb_state > izip_encoding GB_STATE;
-
-    /* DESCR
-     *  ASN.1 description
-     */
-    extern column < NCBI:asn:binary > zip_encoding DESCR;
-
-    /* ANNOT
-     *  ASN.1 annotation
-     */
-    extern column < NCBI:asn:binary > zip_encoding ANNOT;
-
-    /* outputs to spotname */
-    ascii out_seqid_name = sprintf < "TBD" > ( .ACC_PREFIX, out_accession );
-    ascii out_spot_name = sprintf < "%s %s" > ( out_seqid_name, .TITLE );
-
-    /* TBD
-     *  need to create an extension to NCBI:tbl:protein
-     *  that satisfies fastq-dump requirements for READ and QUALITY
-     */
-};
-
-
-/*--------------------------------------------------------------------------
- * gi_idx
- *  gi is row-id
- */
-table NCBI:WGS:tbl:gi_idx #1
-{
-    /* NUC_ROW_ID
-     *  row-id in nucleotide table
-     */
-    extern column < I64 > izip_encoding NUC_ROW_ID;
-
-    /* PROT_ROW_ID
-     *  row-id in protein table
-     */
-    extern column < I64 > izip_encoding PROT_ROW_ID;
-};
-
-
-/*--------------------------------------------------------------------------
- * scaffold
- *  records AGP data
- */
-table NCBI:WGS:tbl:scaffold #1
-{
-    /* SCAFFOLD_NAME
-     *  This is the identifier for the object being assembled.
-     *  This can be a chromosome, scaffold or contig.
-     *  If an accession.version identifier is not used to describe
-     *  the object the naming convention is to precede chromosome numbers
-     *  (e.g. chr1) and linkage group numbers  (e.g. LG3).
-     *  Contigs or scaffolds may have any identifier that is unique
-     *  within the assembly
-     */
-    extern column utf8 SCAFFOLD_NAME
-        = out_scaffold_name;
-    extern column ascii SCAFFOLD_NAME = cast (out_scaffold_name);
-    utf8 out_scaffold_name
-        = idx:text:project < 'scaffold_name' > ( .SCAFFOLD_NAME );
-    physical column < utf8 > zip_encoding .SCAFFOLD_NAME
-        = idx:text:insert < 'scaffold_name' > ( SCAFFOLD_NAME );
-
-    /* COMPONENT_START
-     *  starting position within the component sequence
-     */
-    extern column < INSDC:coord:one > izip_encoding COMPONENT_START;
-
-    /* COMPONENT_LEN
-     *  length of the component/gap projected onto the scaffold
-     */
-    extern column < INSDC:coord:len > izip_encoding COMPONENT_LEN;
-
-    /* COMPONENT_PROPS
-     *  see description of type
-     */
-    extern column < NCBI:WGS:component_props > zip_encoding COMPONENT_PROPS;
-
-    /* COMPONENT_ID
-     *  one row-id for each non-gap component in COMPONENT_TYPE
-     */
-    extern column < I64 > izip_encoding COMPONENT_ID;
-}
-
-table NCBI:WGS:view:scaffold #1 = NCBI:WGS:tbl:scaffold #1
-{
-    /* ACCESSION
-     *  scaffold accession
-     */
-    readonly column ascii ACCESSION
-        = out_accession;
-    I64 scaffold_row_id
-        = row_id ();
-    I64 acc_row_id
-        = < I64 > echo < 1 > ();
-    ascii acc_prefix
-        = < ascii > simple_sub_select < 'SEQUENCE', 'ACC_PREFIX' > ( acc_row_id );
-    U32 acc_contig_len
-        = < ascii > simple_sub_select < 'SEQUENCE', 'ACC_CONTIG_LEN' > ( acc_row_id );
-    ascii out_accession
-        = sprintf < "%sS%0*d" > ( acc_prefix, acc_contig_len, scaffold_row_id );
-
-    /* READ
-     *  base space construction of entire scaffold
-     */
-
-    // construct the read from contigs and gaps
-    INSDC:4na:bin out_4na_bin = NCBI:WGS:build_scaffold_read
-        ( .COMPONENT_START, .COMPONENT_LEN, .COMPONENT_PROPS, .COMPONENT_ID );
-
-    // various READ columns
-    default readonly column INSDC:dna:text READ
-        = < INSDC:4na:bin, INSDC:dna:text > map < INSDC:4na:map:BINSET, INSDC:4na:map:CHARSET > ( out_4na_bin );
-    readonly column INSDC:4na:bin READ
-        = out_4na_bin;
-    readonly column INSDC:4na:packed READ
-        = pack ( out_4na_bin );
-    readonly column INSDC:x2na:bin READ
-        = out_x2na_bin;
-    INSDC:x2na:bin out_x2na_bin
-        = < INSDC:4na:bin, INSDC:x2na:bin > map < INSDC:4na:map:BINSET, [ 4,0,1,4,2,4,4,4,3,4,4,4,4,4,4,4 ] > ( out_4na_bin );
-    readonly column INSDC:2na:bin READ
-        = out_2na_bin;
-    INSDC:2na:bin out_2na_bin
-        = < INSDC:x2na:bin, INSDC:2na:bin > map < INSDC:x2na:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_x2na_bin );
-    readonly column INSDC:2na:packed READ
-        = pack ( out_2na_bin );
-
-
-    /* CSREAD
-     *  base space converted to color space
-     */
-    default readonly column INSDC:color:text CSREAD
-        = < INSDC:x2cs:bin, INSDC:color:text > map <  INSDC:x2cs:map:BINSET, INSDC:x2cs:map:CHARSET > ( out_x2cs_bin );
-    readonly column INSDC:x2cs:bin CSREAD
-        = out_x2cs_bin;
-    INSDC:x2cs:bin out_x2cs_bin
-        = NCBI:color_from_dna ( out_x2na_bin, out_read_start, .COMPONENT_LEN, out_cs_key, out_color_matrix );
-    readonly column INSDC:2cs:bin CSREAD
-        = out_2cs_bin;
-    INSDC:2cs:bin out_2cs_bin
-        = < INSDC:x2cs:bin, INSDC:2cs:bin > map < INSDC:x2cs:map:BINSET, [ 0, 1, 2, 3, 0 ] > ( out_x2cs_bin );
-    readonly column INSDC:2cs:packed CSREAD
-        = pack ( out_2cs_bin );
-
-    /* CS_NATIVE
-     *  is color-space the native sequence space
-     */
-    readonly column bool CS_NATIVE
-        = < bool > echo < false > ();
-
-    /* CS_KEY
-     *  leading call given in base-space
-     */
-    readonly column INSDC:dna:text CS_KEY
-        = out_cs_key;
-    INSDC:dna:text out_cs_key
-        = < INSDC:dna:text > echo < 'T' > ( .COMPONENT_LEN );
-
-    /* COLOR_MATRIX
-     *  matrix used for color-space conversions
-     */
-    readonly column U8 COLOR_MATRIX
-        = out_color_matrix;
-    U8 out_color_matrix
-        = < U8 > echo < INSDC:color:default_matrix > ();
-
-
-    /* QUALITY
-     *  base or color call qualities
-     */
-    INSDC:quality:phred out_qual_phred = NCBI:WGS:build_scaffold_qual
-        ( .COMPONENT_START, .COMPONENT_LEN, .COMPONENT_PROPS, .COMPONENT_ID );
-
-    // PHRED is default
-    default readonly column INSDC:quality:phred QUALITY
-        = out_qual_phred;
-
-    // textual encodings
-    readonly column INSDC:quality:text:phred_33 QUALITY
-        = ( INSDC:quality:text:phred_33 ) < B8 > sum < 33 > ( out_qual_phred );
-    readonly column INSDC:quality:text:phred_64 QUALITY
-        = ( INSDC:quality:text:phred_64 ) < B8 > sum < 64 > ( out_qual_phred );
-
-
-    /* PLATFORM
-     *  sequencing platform, if known
-     */
-    INSDC:SRA:platform_id out_platform
-        = < INSDC:SRA:platform_id > echo < SRA_PLATFORM_UNDEFINED > ();
-    readonly column INSDC:SRA:platform_id PLATFORM
-        = out_platform;
-
-    /* SPOT_ID
-     *  support for libsra
-     */
-    INSDC:SRA:spotid_t out_spot_id
-        = cast ( scaffold_row_id );
-    readonly column INSDC:SRA:spotid_t SPOT_ID
-        = out_spot_id;
-
-    /* NAME
-     *  spot name
-     */
-    readonly column ascii NAME
-        = out_scaffold_name;
-
-    /* SPOT_LEN
-     * TRIM_START
-     * TRIM_LEN
-     *  spot descriptor
-     */
-    readonly column INSDC:coord:len SPOT_LEN
-        = out_spot_len;
-    INSDC:coord:len out_spot_len
-        = < INSDC:coord:len > vec_sum ( .COMPONENT_LEN );
-    readonly column INSDC:coord:zero TRIM_START
-        = < INSDC:coord:zero > echo < 0 > ();
-    readonly column INSDC:coord:len TRIM_LEN
-        = out_spot_len;
-
-
-    /* READ_START
-     * READ_LEN
-     * READ_TYPE
-     *  read descriptor portion
-     */
-    readonly column INSDC:coord:zero READ_START
-        = out_read_start;
-    INSDC:coord:zero out_read_start
-        = ( INSDC:coord:zero ) < U32 > integral_0 ( .COMPONENT_LEN );
-    readonly column INSDC:coord:len READ_LEN
-        = .COMPONENT_LEN;
-    readonly column INSDC:SRA:xread_type READ_TYPE
-        = out_read_type;
-    INSDC:SRA:xread_type out_read_type
-        = NCBI:WGS:build_read_type ( .COMPONENT_PROPS );
-}
-
-
-/*--------------------------------------------------------------------------
- * contig
- */
-database NCBI:WGS:db:contig #1.1
-{
-    table NCBI:WGS:tbl:nucleotide SEQUENCE;
-    table NCBI:WGS:tbl:protein PROTEIN;
-    table NCBI:WGS:tbl:gi_idx GI_IDX;
-    table NCBI:WGS:tbl:scaffold SCAFFOLD;
-};
diff --git a/interfaces/os/linux/os-native.h b/interfaces/os/linux/os-native.h
deleted file mode 100644
index 7dc63e8..0000000
--- a/interfaces/os/linux/os-native.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_os_native_
-#define _h_os_native_
-
-#ifndef _h_unix_native_
-#include "../unix/unix-native.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_os_native_ */
diff --git a/interfaces/os/mac/byteswap.h b/interfaces/os/mac/byteswap.h
deleted file mode 100644
index 172fd8b..0000000
--- a/interfaces/os/mac/byteswap.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_mac_byteswap_
-#define _h_mac_byteswap_
-
-#include <architecture/byte_order.h>
-
-/* make these look the same as on Linux
-   use the lower-level Mac routines, as
-   they are specific in their data types */
-#define bswap_16(x) OSSwapInt16 (x)
-#define bswap_32(x) OSSwapInt32 (x)
-#define bswap_64(x) OSSwapInt64 (x)
-
-#endif /* _h_mac_byteswap_ */
diff --git a/interfaces/os/mac/endian.h b/interfaces/os/mac/endian.h
deleted file mode 100644
index 367e1f0..0000000
--- a/interfaces/os/mac/endian.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_mac_endian_
-#define _h_mac_endian_
-
-#include <machine/endian.h>
-
-#define __LITTLE_ENDIAN   LITTLE_ENDIAN
-#define __BIG_ENDIAN      BIG_ENDIAN
-#define __PDP_ENDIAN      PDP_ENDIAN
-
-#define __BYTE_ORDER      BYTE_ORDER
-
-
-#endif /* _h_mac_endian_ */
diff --git a/interfaces/os/mac/os-native.h b/interfaces/os/mac/os-native.h
deleted file mode 100644
index 079c12b..0000000
--- a/interfaces/os/mac/os-native.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_os_native_
-#define _h_os_native_
-
-#ifndef _h_unix_native_
-#include "../unix/unix-native.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * strdup - declared unless _ANSI_SOURCE is defined - redeclare anyway
- * strndup - implemented inline here
- */
-char *strdup ( const char *str );
-
-#if !defined(__MAC_10_7) || (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7)
-static __inline__
-char *strndup ( const char *str, size_t n )
-{
-    char *dupstr;
-
-    const char *end = ( const char* ) memchr ( str, 0, n );
-    if ( end != NULL )
-        n = end - str;
-
-    dupstr = (char*)malloc ( n + 1 );
-    if ( dupstr != NULL )
-    {
-        memcpy ( dupstr, str, n );
-        dupstr [ n ] = 0;
-    }
-
-    return dupstr;
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * strchrnul - implemented inline here
- */
-static __inline__
-char *strchrnul ( const char *str, int c )
-{
-    int i;
-    for ( i = 0; str [ i ] != 0 && str [ i ] != c; ++i )
-        ( void ) 0;
-    return & ( ( char* ) str ) [ i ];
-}
-
-/*--------------------------------------------------------------------------
- * memchr - implemented inline here
- */
-static __inline__
-void *memrchr ( const void *s, int c, size_t n )
-{
-    size_t i;
-    const char *cp = (const char*)s;
-    for ( i = n; i > 0; )
-    {
-        if ( ( int ) cp [ -- i ] == c )
-            return ( void* ) & cp [ i ];
-    }
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * strtoll - declared unless _ANSI_SOURCE is defined - redeclare anyway
- * strtoul - older includes were not ready for c99
- *
- *  NB - the define __DARWIN_NO_LONG_LONG will be true for
- *       cases when long long would be int64_t.
- */
-#if __DARWIN_NO_LONG_LONG
-int64_t strtoll ( const char *s, char **end, int base );
-uint64_t strtoull ( const char *s, char **end, int base );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_os_native_ */
diff --git a/interfaces/os/unix/sysalloc.h b/interfaces/os/unix/sysalloc.h
deleted file mode 100644
index 2207943..0000000
--- a/interfaces/os/unix/sysalloc.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysalloc_
-#define _h_sysalloc_
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sysalloc_ */
diff --git a/interfaces/os/unix/unix-native.h b/interfaces/os/unix/unix-native.h
deleted file mode 100644
index 236806a..0000000
--- a/interfaces/os/unix/unix-native.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_unix_native_
-#define _h_unix_native_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <time.h>
-#include <sys/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * timeout_t
- *  a structure for communicating a timeout
- *  which under Unix converts to an absolute time once prepared
- */
-struct timeout_t
-{
-    struct timespec ts;
-    uint32_t mS;
-    uint32_t prepared;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_unix_native_ */
diff --git a/interfaces/os/win/atomic.h b/interfaces/os/win/atomic.h
deleted file mode 100644
index 57a2f8f..0000000
--- a/interfaces/os/win/atomic.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic_
-#define _h_atomic_
-
-#define DFLT_ATOMIC_BITS 32
-
-#ifndef _h_atomic32_
-#include "atomic32.h"
-#endif
-
-#if ! defined _h_atomic64_ && _ARCH_BITS == 64
-#include "atomic64.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if DFLT_ATOMIC_BITS == 32
-#define ATOMIC_NAME( suffix ) \
-    atomic32_ ## suffix
-typedef LONG atomic_int;
-#else
-#define ATOMIC_NAME( suffix ) \
-    atomic64_ ## suffix
-typedef LONGLONG atomic_int;
-#endif
-
-typedef struct ATOMIC_NAME ( t ) atomic_t;
-
-/* ( * v ) */
-#define atomic_read( v ) \
-    ATOMIC_NAME ( read ) ( v )
-
-/* ( * v ) = i */
-#define atomic_set( v, i ) \
-    ATOMIC_NAME ( set ) ( v, i )
-
-/* prior = ( * v ), ( * v ) += i, prior */
-#define atomic_read_and_add( v, i ) \
-    ATOMIC_NAME ( read_and_add ) ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add( v, i ) \
-    ATOMIC_NAME ( add ) ( v, i )
-
-/* ( * v ) += i */
-#define atomic_add_and_read( v, i ) \
-    ATOMIC_NAME ( add_and_read ) ( v, i )
-
-/* ( void ) ++ ( * v ) */
-#define atomic_inc( v ) \
-    ATOMIC_NAME ( inc ) ( v )
-
-/* ( void ) -- ( * v ) */
-#define atomic_dec( v ) \
-    ATOMIC_NAME ( dec ) ( v )
-
-/* -- ( * v ) == 0 */
-#define atomic_dec_and_test( v ) \
-    ATOMIC_NAME ( dec_and_test ) ( v )
-
-/* ++ ( * v ) == 0
-   when atomic_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-#define atomic_inc_and_test( v ) \
-    ATOMIC_NAME ( inc_and_test ) ( v )
-
-/* ( * v ) -- == 0
-   HERE's useful */
-#define atomic_test_and_inc( v ) \
-    ATOMIC_NAME ( test_and_inc ) ( v )
-
-/* prior = ( * v ), ( * v ) = ( prior == t ? s : prior ), prior */
-#define atomic_test_and_set( v, s, t ) \
-    ATOMIC_NAME ( test_and_set ) ( v, s, t )
-
-/* THIS FUNCTION IS universal in the case of windows, it uses the sizeof(ptr) */
-#define atomic_test_and_set_ptr( v, s, t ) \
-    InterlockedCompareExchangePointer( ( v ), ( s ), ( t ) )
-
-/* val = ( * v ), ( ( * v ) = ( val < t ) ? val + i : val ), val */
-#define atomic_read_and_add_lt( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_lt ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val <= t ) ? val + i : val ), val */
-#define atomic_read_and_add_le( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_le ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val == t ) ? val + i : val ), val */
-#define atomic_read_and_add_eq( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_eq ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val != t ) ? val + i : val ), val */
-#define atomic_read_and_add_ne( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_ne ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val >= t ) ? val + i : val ), val */
-#define atomic_read_and_add_ge( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_ge ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( val > t ) ? val + i : val ), val */
-#define atomic_read_and_add_gt( v, i, t ) \
-    ATOMIC_NAME ( read_and_add_gt ) ( v, i, t )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 1 ) ? val + i : val ), val */
-#define atomic_read_and_add_odd( v, i ) \
-    ATOMIC_NAME ( read_and_add_odd ) ( v, i )
-
-/* val = ( * v ), ( ( * v ) = ( ( val & 1 ) == 0 ) ? val + i : val ), val */
-#define atomic_read_and_add_even( v, i ) \
-    ATOMIC_NAME ( read_and_add_even ) ( v, i )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic_ */
diff --git a/interfaces/os/win/atomic32.h b/interfaces/os/win/atomic32.h
deleted file mode 100644
index 0e9e0fc..0000000
--- a/interfaces/os/win/atomic32.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic32_
-#define _h_atomic32_
-
-#include <WINDOWS.H>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct atomic32_t atomic32_t;
-struct atomic32_t
-{
-    volatile LONG counter;
-};
-
-/* int atomic32_read ( const atomic32_t *v ); */
-#define atomic32_read( v ) \
-    ( ( v ) -> counter )
-
-/* void atomic32_set ( atomic32_t *v, int i ); */
-#define atomic32_set( v, i ) \
-    ( ( void ) ( ( ( v ) -> counter ) = ( i ) ) )
-
-/* add to v -> counter and return the prior value */
-/* int atomic32_read_and_add ( atomic32_t *v, int i ) */
-#define atomic32_read_and_add( v, i ) \
-    InterlockedExchangeAdd ( & ( v ) -> counter, ( i ) )
-
-/* if no read is needed, define the least expensive atomic add */
-#define atomic32_add( v, i ) \
-    atomic32_read_and_add ( v, i )
-
-/* add to v -> counter and return the result */
-static __inline int atomic32_add_and_read ( atomic32_t *v, int i )
-{
-	return atomic32_read_and_add ( v, i ) + i;
-}
-
-/* void atomic32_inc ( atomic32_t *v ) */
-#define atomic32_inc( v ) \
-    InterlockedIncrement ( & ( v ) -> counter )
-
-/* void atomic32_dec ( atomic32_t *v ) */
-#define atomic32_dec( v ) \
-    InterlockedDecrement ( & ( v ) -> counter )
-
-/* decrement by one and test result for 0 */
-/* int atomic32_dec_and_test ( atomic32_t *v ) */
-#define atomic32_dec_and_test( v ) \
-    ( InterlockedDecrement ( & ( v ) -> counter ) == 0 )
-
-/* when atomic32_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-/* int atomic32_inc_and_test ( atomic32_t *v ) */
-#define atomic32_inc_and_test( v ) \
-    ( InterlockedIncrement ( & ( v ) -> counter ) == 0 )
-
-/* HERE's useful */
-#define atomic32_test_and_inc( v ) \
-    ( atomic32_read_and_add ( v, 1 ) == 0 )
-
-/* int atomic32_test_and_set ( atomic32_t *v, int s, int t ) */
-#define atomic32_test_and_set( v, s, t ) \
-    InterlockedCompareExchange ( & ( v ) -> counter, ( s ), ( t ) )
-
-/* conditional modifications */
-static __inline int atomic32_read_and_add_lt ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val < t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_le ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val <= t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_eq ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val == t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_ne ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val != t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_ge ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val >= t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_gt ( atomic32_t *v, int i, int t )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); val > t; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_odd ( atomic32_t *v, int i )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); ( val & 1 ) != 0; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline int atomic32_read_and_add_even ( atomic32_t *v, int i )
-{
-	LONG val, val_intern;
-	for ( val = atomic32_read ( v ); ( val & 1 ) == 0; val = val_intern )
-	{
-		val_intern = atomic32_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic32_ */
diff --git a/interfaces/os/win/atomic64.h b/interfaces/os/win/atomic64.h
deleted file mode 100644
index cb9870e..0000000
--- a/interfaces/os/win/atomic64.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_atomic64_
-#define _h_atomic64_
-
-#include <WINDOWS.H>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct atomic64_t atomic64_t;
-struct atomic64_t
-{
-    volatile LONGLONG counter;
-};
-
-/* int atomic64_read ( const atomic64_t *v ); */
-#define atomic64_read( v ) \
-    ( ( v ) -> counter )
-
-/* void atomic64_set ( atomic64_t *v, long int i ); */
-#define atomic64_set( v, i ) \
-    ( ( void ) ( ( ( v ) -> counter ) = ( i ) ) )
-
-/* add to v -> counter and return the prior value */
-/* int atomic32_read_and_add ( atomic32_t *v, int i ) */
-#define atomic64_read_and_add( v, i ) \
-    InterlockedExchangeAdd64 ( & ( v ) -> counter, ( i ) )
-
-/* if no read is needed, define the least expensive atomic add */
-#define atomic64_add( v, i ) \
-    atomic64_read_and_add ( v, i )
-
-/* add to v -> counter and return the result */
-static __inline LONG64 atomic64_add_and_read ( atomic64_t *v, int i )
-{
-	return atomic64_read_and_add ( v, i ) + i;
-}
-
-/* void atomic64_inc ( atomic64_t *v ) */
-#define atomic64_inc( v ) \
-    InterlockedIncrement64 ( & ( v ) -> counter )
-
-/* void atomic64_dec ( atomic64_t *v ) */
-#define atomic64_dec( v ) \
-    InterlockedDecrement64 ( & ( v ) -> counter )
-
-/* decrement by one and test result for 0 */
-/* int atomic64_dec_and_test ( atomic64_t *v ) */
-#define atomic64_dec_and_test( v ) \
-    ( InterlockedDecrement64 ( & ( v ) -> counter ) == 0 )
-
-/* when atomic64_dec_and_test uses predecrement, you want
-   postincrement to this function. so it isn't very useful */
-/* int atomic64_inc_and_test ( atomic64_t *v ) */
-#define atomic64_inc_and_test( v ) \
-    ( InterlockedIncrement64 ( & ( v ) -> counter ) == 0 )
-
-/* HERE's useful */
-#define atomic64_test_and_inc( v ) \
-    ( atomic64_read_and_add ( v, 1 ) == 0 )
-
-/* int atomic64_test_and_set ( atomic64_t *v, int s, int t ) */
-#define atomic64_test_and_set( v, s, t ) \
-    InterlockedCompareExchange64 ( & ( v ) -> counter, ( s ), ( t ) )
-
-/* conditional modifications */
-static __inline LONG64 atomic64_read_and_add_lt ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); val < t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_le ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); val <= t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_eq ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read( v ); val == t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_ne ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); val != t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_ge ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); val >= t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_gt ( atomic64_t *v, int i, int t )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); val > t; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_odd ( atomic64_t *v, int i )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); ( val & 1 ) != 0; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-static __inline LONG64 atomic64_read_and_add_even ( atomic64_t *v, int i )
-{
-	LONG64 val, val_intern;
-	for ( val = atomic64_read ( v ); ( val & 1 ) == 0; val = val_intern )
-	{
-		val_intern = atomic64_test_and_set ( v, val + i, val );
-		if ( val_intern == val )
-			break;
-	}
-	return val;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_atomic64_ */
diff --git a/interfaces/os/win/byteswap.h b/interfaces/os/win/byteswap.h
deleted file mode 100644
index 4b92f51..0000000
--- a/interfaces/os/win/byteswap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_win_byteswap_
-#define _h_win_byteswap_
-
-#ifndef _INC_STDLIB
-#include <stdlib.h>
-#endif
-
-/* make these look the same as on Linux
-   use the lower-level Windows routines, as
-   they are specific in their data types */
-#undef bswap_16
-#define bswap_16(x) _byteswap_ushort(x)
-#undef bswap_32
-#define bswap_32(x) _byteswap_ulong(x)
-#undef bswap_64
-#define bswap_64(x) _byteswap_uint64(x)
-
-#endif /* _h_win_byteswap_ */
diff --git a/interfaces/os/win/endian.h b/interfaces/os/win/endian.h
deleted file mode 100644
index 61d9c7d..0000000
--- a/interfaces/os/win/endian.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_win_endian_
-#define _h_win_endian_
-
-/* magic values pulled from RPCNDR.H */
-
-#define __LITTLE_ENDIAN   (0X00000010L)
-#define __BIG_ENDIAN      (0X00000000L)
-
-#if defined(__RPC_MAC__)
-#define __BYTE_ORDER      __BIG_ENDIAN
-#else
-#define __BYTE_ORDER      __LITTLE_ENDIAN
-#endif
-
-
-#endif /* _h_win_endian_ */
diff --git a/interfaces/os/win/os-native.h b/interfaces/os/win/os-native.h
deleted file mode 100644
index 224129a..0000000
--- a/interfaces/os/win/os-native.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_os_native_
-#define _h_os_native_
-
-/* get this guy included so that off_t is 64 bit */
-#ifndef _STDINT_H
-#include "stdint.h"
-#endif
-
-/* specify at least NT 4.0 */
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
-#endif
-
-/* we should never include this directly */
-#include <WINDOWS.H>
-#include <limits.h>
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#include <ctype.h>
-#include <direct.h>
-#include <math.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-/* to make code work that depends on POSIX-bits (octal!) under Windows */
-#define S_IWGRP 0020
-#define S_IWOTH 0002
-
-#define mode_t uint32_t
-
-/*--------------------------------------------------------------------------
- * timeout_t
- *  a structure for communicating a timeout
- *  which under Windows is a relative time
- */
-struct timeout_t
-{
-    uint32_t mS;
-    uint32_t prepared;
-};
-
-/* not consistent across all windows? */
-/* #define snprintf _snprintf */
-
-
-#ifndef putenv
-#define putenv( s ) _putenv ( s )
-#endif
-
-#define mkdir( d, m ) _mkdir( d )
-#define strcasecmp _stricmp
-#define strtoll _strtoi64
-#define strtok_r strtok_s
-
-#undef strdup
-#define strdup( str ) \
-    string_dup_measure ( ( str ), NULL )
-
-#undef strndup
-#define strndup( str, n ) \
-    string_dup ( ( str ), ( n ) )
-
-static __inline int isblank(int x)
-{
-    return (((x) == ' ') || ((x) == '\t'));
-}
-
-int snprintf (char * buffer, size_t bufsize, const char * format, ...);
-
-
-static __inline__
-void *memrchr ( const void *s, int c, size_t n )
-{
-    size_t i;
-    const char *cp = (const char*)s;
-    for ( i = n; i > 0; )
-    {
-        if ( ( int ) cp [ -- i ] == c )
-            return (void *)(cp + i);
-    }
-    return NULL;
-}
-
-static __inline
-char *strchrnul ( const char *s, int c_in )
-{
-    uint32_t i;
-    for ( i=0; s[i] != 0; ++i )
-    {
-        if ( s[i] == c_in ) 
-            break;
-    }
-  return ( char * )&s[ i ];
-}
-
-static __inline
-char *strsep ( char **stringp, const char *delim )
-{
-	char *s, *tok, c, delim_char;
-	const char *p_delim;
-
-	if ( ( s = *stringp ) == NULL )
-		return NULL;
-
-	for ( tok = s; ; )
-	{
-		c = *s++;
-		p_delim = delim;
-		do {
-			if ( ( delim_char = *p_delim++ ) == c )
-			{
-				if ( c == 0 )
-					s = NULL;
-				else
-					s[-1] = 0;
-				*stringp = s;
-				return ( tok );
-			}
-		} while ( delim_char != 0 );
-	}
-	return NULL;
-}
-
-#define gmtime_r(t, tm) gmtime_s(tm, t)
-#define timegm _mkgmtime
-
-static __inline
-int strncasecmp( const char *s1, const char *s2, size_t n )
-{
-    return _strnicmp( s1, s2, n );
-}
-
-static __inline 
-const char *strcasestr (const char *s1, const char *s2)
-{
-    unsigned char c2 = tolower((unsigned char) *s2);
-    size_t l1 = strlen(s1), l2 = strlen(s2);
-    
-    if (l2 == 0) {
-        return s1;
-    }
-
-    while (l1 >= l2) {
-        if (tolower((unsigned char) *s1) == c2
-            &&  (l2 == 1  ||  _strnicmp(s1 + 1, s2 + 1, l2 - 1) == 0)) {
-            return s1;
-        }
-        ++s1;
-        --l1;
-    }
-
-    return NULL;
-}
-
-static __inline
-long int lround ( double x )
-{
-    double val = ( x < 0.0 ) ? ceil ( x - 0.5 ) : floor ( x + 0.5 );
-    if ( val > ( double ) LONG_MAX )
-        return LONG_MAX;
-    if ( val < ( double ) LONG_MIN )
-        return LONG_MIN;
-    return ( long int ) val;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_os_native_ */
diff --git a/interfaces/os/win/strtol.h b/interfaces/os/win/strtol.h
deleted file mode 100644
index 3475dcc..0000000
--- a/interfaces/os/win/strtol.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_strtol_
-#define _h_strtol_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <ctype.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * strtoi32
- * strtoi32
- *  based upon actual usage
- */
-#define strtoi32( str, endp, base ) \
-    ( int32_t ) strtol ( str, endp, base )
-
-#define strtou32( str, endp, base ) \
-    ( uint32_t ) strtoul ( str, endp, base )
-
-
-/*--------------------------------------------------------------------------
- * strtoi64
- * strtoi64
- *  based upon actual usage
- */
-static __inline
-__int64 strtoi64( const char* str, char** endp, uint32_t base )
-{
-    int i = 0;
-    __int64 ret_value = 0;
-
-    if ( str != NULL && base != 1 && base <= 36 )
-    {
-        bool negate = false;
-
-        for ( ; isspace( str [ i ] ); ++ i )
-            ( void ) 0;
-
-        switch ( str [ i ] )
-        {
-        case '-':
-            negate = true;
-        case '+':
-            ++ i;
-            break;
-        }
-
-        if ( base == 0 )
-        {
-            if ( str [ i ] != '0' )
-                base = 10;
-            else if ( tolower ( str [ i + 1 ] == 'x' ) )
-            {
-                base = 16;
-                i += 2;
-            }
-            else
-            {
-                base = 8;
-                i += 1;
-            }
-        }
-
-        if ( base <= 10 )
-        {
-            for ( ; isdigit ( str [ i ] ); ++ i )
-            {
-                uint32_t digit = str [ i ] - '0';
-                if ( digit >= base )
-                    break;
-                ret_value *= base;
-                ret_value += digit;
-            }
-        }
-        else
-        {
-            for ( ; ; ++ i )
-            {
-                if ( isdigit ( str [ i ] ) )
-                {
-                    ret_value *= base;
-                    ret_value += str [ i ] - '0';
-                }
-                else if ( ! isalpha ( str [ i ] ) )
-                    break;
-                else
-                {
-                    uint32_t digit = toupper ( str [ i ] ) - 'A' + 10;
-                    if ( digit >= base )
-                        break;
-                    ret_value *= base;
-                    ret_value += digit;
-                }
-            }
-        }
-
-        if ( negate )
-            ret_value = - ret_value;
-    }
-
-    if ( endp != NULL )
-        * endp = (char *)str + i;
-
-    return ret_value;
-}
-
-static __inline
-unsigned __int64 strtou64( const char* str, char** endp, uint32_t base )
-{
-    return strtoi64( str, endp, base );
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_strtol_ */
diff --git a/interfaces/os/win/sysalloc.h b/interfaces/os/win/sysalloc.h
deleted file mode 100644
index 16c530e..0000000
--- a/interfaces/os/win/sysalloc.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysalloc_
-#define _h_sysalloc_
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#include <malloc.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* malloc, calloc, realloc
- */
-KLIB_EXTERN void * CC klib_malloc ( size_t bytes );
-KLIB_EXTERN void * CC klib_calloc ( size_t count, size_t size );
-KLIB_EXTERN void * CC klib_realloc ( void *obj, size_t bytes );
-
-/* free
- */
-KLIB_EXTERN void CC klib_free ( void *obj );
-
-#ifndef _c_sysalloc_
-
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-
-#define malloc klib_malloc
-#define calloc klib_calloc
-#define realloc klib_realloc
-#define free klib_free
-
-#endif /* _c_sysalloc_ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sysalloc_ */
diff --git a/interfaces/search/extern.h b/interfaces/search/extern.h
deleted file mode 100644
index 453811a..0000000
--- a/interfaces/search/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_search_extern_
-#define _h_search_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define SEARCH_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define SEARCH_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_search_extern_ */
diff --git a/interfaces/search/grep.h b/interfaces/search/grep.h
deleted file mode 100644
index c79a205..0000000
--- a/interfaces/search/grep.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_search_grep_
-#define _h_search_grep_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <search/extern.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * Fgrep
- */
-typedef struct Fgrep Fgrep;
-
-
-/* MatchCallback
- *
- *  "matchinfo" [ IN ] -
- *
- *  "flag" [ OUT ] -
- */
-typedef uint8_t FgrepContinueFlag;
-enum
-{
-    FGREP_CONTINUE = 1,
-    FGREP_STOP = 2
-};
-
-typedef struct FgrepMatch FgrepMatch;
-struct FgrepMatch
-{
-    int32_t position;
-    int32_t length;
-    int32_t whichpattern;
-};
-
-typedef rc_t ( CC * FgrepMatchCallback ) ( void *cbinfo,
-    const FgrepMatch *matchinfo, FgrepContinueFlag *flag );
-
-
-/* Make
- *
- *  "fg" [ OUT ] -
- *
- *  "mode" [ IN ]
- *
- *  "strings" [ IN ] and "numstrings" [ IN ] -
- */
-typedef uint8_t FgrepFlags;
-enum
-{
-    FGREP_MODE_ASCII = 1,
-    FGREP_MODE_ACGT = 2,
-    FGREP_TEXT_EXPANDED_2NA = 4,
-    FGREP_ALG_DUMB = 8,
-    FGREP_ALG_BOYERMOORE = 0x10,
-    FGREP_ALG_AHOCORASICK = 0x20
-};
-
-SEARCH_EXTERN rc_t CC FgrepMake ( Fgrep **fg, FgrepFlags mode,
-    const char *strings[], uint32_t numstrings );
-
-/* Whack
- */
- #if 0
-SEARCH_EXTERN void CC FgrepWhack ( Fgrep *self );
-#endif
-SEARCH_EXTERN void CC FgrepFree ( Fgrep *self );
-
-/* FindFirst
- *  Pass a matchinfo structure to get the info.
- *  Returns nonzero if found, 0 if nothing found.
- *
- *   "buf" [ IN ] and "len" [ IN ]
- *
- *  "matchinfo" [ OUT ]
- */
-SEARCH_EXTERN uint32_t CC FgrepFindFirst ( const Fgrep *self,
-    const char *buf, size_t len, FgrepMatch *matchinfo );
-
-
-/* FindAll
- * TBD - should this return rc_t?
- */
- #if 0
-SEARCH_EXTERN void CC FgrepFindAll ( const Fgrep *self, const char *buf, size_t len,
-    FgrepMatchCallback cb, void *cbinfo );
-#endif
-
-/*----------------------------------------------------------------
- * Fgrep appendix 
- */
-
-/*
- * Sees if a suffix of the pattern exact matches a prefix of the buffer.
- */
-SEARCH_EXTERN uint32_t CC has_left_exact_match(char *pattern, char *buf, size_t buflen,
-                              int32_t *length);
-
-SEARCH_EXTERN uint32_t CC has_right_exact_match(char *pattern, char *buf, size_t buflen, 
-                               int32_t *bestpos);
-
-SEARCH_EXTERN uint32_t CC has_inside_exact_match(char *pattern, char *buf, size_t buflen, 
-                                int32_t *skip);
-
-/*--------------------------------------------------------------------------
- * Agrep
- */
-typedef struct Agrep Agrep;
-
-
-/* MatchCallback
- */
-typedef struct AgrepMatch AgrepMatch;
-struct AgrepMatch
-{
-    int32_t position;
-    int32_t length;
-    int32_t score;
-};
-
-typedef uint8_t AgrepContinueFlag;
-enum
-{
-    AGREP_STOP = 1,
-    AGREP_CONTINUE = 2,
-    AGREP_MOREINFO = 4
-};
-
-typedef rc_t ( CC * AgrepMatchCallback ) ( const void *cbinfo, const AgrepMatch *matchinfo, AgrepContinueFlag *flag );
-
-
-/* Make
- */
-typedef uint32_t AgrepFlags;
-enum
-{
-    AGREP_MODE_ASCII = 0x0001, /* simple text grep */
-    AGREP_PATTERN_4NA = 0x0002, /* pattern is 4na - bio mode */
-    /* text flags */
-    AGREP_IGNORE_CASE = 0x0004, /* ignore case in ascii mode, bio mode always ignores case */
-    /* bio mode flags */
-    AGREP_TEXT_EXPANDED_2NA = 0x0008, /* search string can have 2na */
-    AGREP_ANYTHING_ELSE_IS_N = 0x0010, /* periods, dashes in 4na pattern treated as N */
-    
-    /* algorithm choice */
-    AGREP_ALG_DP = 0x0020,
-    AGREP_ALG_WUMANBER = 0x0040,
-    AGREP_ALG_MYERS = 0x0080, /* shoud be same, internally detect algo based on pattern size */
-    AGREP_ALG_MYERS_UNLTD = 0x0100, /* very faulty, at least will crash on low memory */
-
-    AGREP_EXTEND_SAME = 0x200,
-    AGREP_EXTEND_BETTER = 0x400,
-    AGREP_LEFT_MAINTAIN_SCORE = 0x800, /* Only supported in DP for now */
-    AGREP_ANCHOR_LEFT = 0x1000 /* Only supported in DP for now */
-};
-
-SEARCH_EXTERN rc_t CC AgrepMake(Agrep **self, AgrepFlags mode, const char *pattern);
-
-/* Whack
- */
-SEARCH_EXTERN void CC AgrepWhack ( Agrep *self );
-
-/* FindFirst
- *  Pass in a pointer to an AgrepMatch, and it will be filled out.
- *  Returns nonzero if something found, zero if nothing found.
- */
-SEARCH_EXTERN uint32_t CC AgrepFindFirst( const Agrep *self, int32_t threshold, const char *buf, size_t len, AgrepMatch *matchinfo);
-
-SEARCH_EXTERN uint32_t CC AgrepFindBest( const Agrep *self, int32_t threshold, const char *buf, int32_t len, AgrepMatch *match);
-
-/* FindAll
- */
-typedef struct AgrepCallArgs AgrepCallArgs;
-struct AgrepCallArgs
-{
-    const Agrep *self;
-
-    const char *buf;
-    size_t buflen;
-
-    AgrepMatchCallback cb;
-    void *cbinfo;
-
-    /*
-      This threshold is really intended for algorithms like DP and MYERS
-      that do not require the threshold to be part of the initial setup.
-      We may use this to override the one specified in the setup,
-      but we may not; if you want to use the one in the setup function,
-      pass -1 as the threshold.
-    */
-    int32_t threshold;
-};
-
-SEARCH_EXTERN void CC AgrepFindAll ( const AgrepCallArgs *args );
-
-/*--------------------------------------------------------------------------
- * Agrep appendix
- */
-
-SEARCH_EXTERN uint32_t CC has_left_approx_match(char *pattern, uint32_t errors, 
-                               char *buf, size_t buflen, 
-                               uint32_t *length, uint32_t *errcnt);
-
-SEARCH_EXTERN uint32_t CC has_right_approx_match(char *pattern, uint32_t errors, 
-                                char *buf, size_t buflen, 
-                                uint32_t *bestpos, uint32_t *errcnt);
-
-SEARCH_EXTERN uint32_t CC has_inside_approx_match(char *pattern, uint32_t plen, uint32_t errors, 
-                                 char *buf, size_t buflen, 
-                                 uint32_t *skip, uint32_t *errcnt);
-
-typedef struct LeftMatch LeftMatch;
-struct LeftMatch
-{
-    int32_t position;
-    int32_t hits;
-    int32_t misses;
-};
-
-typedef rc_t ( CC * LeftMatchCallback ) ( void *cbinfo, const LeftMatch *matchinfo, AgrepContinueFlag *flag );
-
-
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_search_grep_ */
diff --git a/interfaces/search/nucstrstr.h b/interfaces/search/nucstrstr.h
deleted file mode 100644
index 095bcf4..0000000
--- a/interfaces/search/nucstrstr.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==============================================================================
-
-  search/nucstrstr.h
-
-    nucleotide k-mer searching facility
- */
-
-
-#ifndef _h_search_nucstrstr_
-#define _h_search_nucstrstr_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <search/extern.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* set to 1 if buffer supplied to NucStrstrSearch is
-   always at least 16 bytes beyond than the sequence */
-#ifndef ENDLESS_BUFFER
-#define ENDLESS_BUFFER 1
-#endif
-
-/* normally used for test only */
-#ifndef ENABLE_AT_EXPR
-#define ENABLE_AT_EXPR 0
-#endif
-
-/* positional returns make little sense with Boolean logic */
-#ifndef ALLOW_POSITIONAL_OPERATOR_MIX
-#define ALLOW_POSITIONAL_OPERATOR_MIX 1
-#endif
-
-
-/*--------------------------------------------------------------------------
- * NucStrstr
- *  prepared handle for nucleotide k-mer strstr
- */
-typedef union NucStrstr NucStrstr;
-
-/* NucStrstrMake
- *  prepares search by parsing expression query string
- *  returns error if conversion was not possible.
- *
- *  "nss" [ OUT ] - return parameter for one-time search handle
- *
- *  "positional" [ IN ] - if non-zero, build an expression tree
- *  to return found position rather than simply a Boolean found.
- *  see NucStrstrSearch. if ENABLE_AT_EXPR is defined as non-zero,
- *  the <position_expr> production can switch this flag to true
- *  for the immediately following fasta_expr from within the
- *  expression string itself. if ALLOW_POSITIONAL_OPERATOR_MIX
- *  is defined as non-zero, operators '!', '&&' and '||' will
- *  be allowed when generating positional results. they will make
- *  no sense otherwise.
- *
- *  "query" [ IN ] and "len" [ IN ] - query string expression, such that:
- *       expr           : <unary_expr>
- *                      | <unary_expr> <boolean_op> <expr>
- *       unary_expr     : <primary_expr>
- *                      | '!' <unary_expr>
- *       primary_expr   : <position_expr>
- *                      | '^' <position_expr>
- *                      | <position_expr> '$'
- *                      | '(' <expr> ')'
- *       position_expr  : <fasta_expr>
- *                      | '@' <fasta_expr>
- *       fasta_expr     : FASTA
- *                      | "'" FASTA "'"
- *                      | '"' FASTA '"'
- *       boolean_op     : '&', '|', '&&', '||'
- *
- *    where the '@' operator may be used to force the "positional"
- *    flag to be true - conditionally enabled.
- *
- *  return values:
- *    EINVAL - invalid parameter or invalid expression
- */
-SEARCH_EXTERN int CC NucStrstrMake ( NucStrstr **nss, int positional,
-    const char *query, unsigned int len );
-
-/* NucStrstrWhack
- *  discard structure when no longer needed
- */
-SEARCH_EXTERN void CC NucStrstrWhack ( NucStrstr *self );
-
-/* NucStrstrSearch
- *  search buffer from starting position
- *
- *  "ncbi2na" [ IN ] - pointer to 2na data
- *
- *    N.B. - "ncbi2na" must be at least long enough to allow for
- *    full 16-byte loads at the tail of the search sequence:
- *
- *    - technically, the size requirement is:
- *     ( ( pos + len + 3 ) / 4 ) == bytes,
- *     ( ( bytes + 15 ) / 16 ) * 16 == min data size
- *
- *    - practically, if "ncbi2na" points to a data buffer
- *      that is at least 16 bytes longer than "bytes" above,
- *      then it is always sufficient, and sometimes excessive.
- *
- *  "pos" [ IN ] - starting base position for search,
- *  relative to "ncbi2na". may be >= 4.
- *
- *  "len" [ IN ] - the number of bases to include in
- *  the search, relative to "pos".
- *
- *  return values:
- *    0 if the pattern was not found
- *    1..N indicating starting position if "self" was
- *      prepared for positional return
- *   !0 if "self" was prepared normally by NucStrstrMake
- */
-SEARCH_EXTERN int CC NucStrstrSearch ( const NucStrstr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len,unsigned int* selflen );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_search_nucstrstr_ */
-
diff --git a/interfaces/sra/454.vschema b/interfaces/sra/454.vschema
deleted file mode 100644
index a3f5bc5..0000000
--- a/interfaces/sra/454.vschema
+++ /dev/null
@@ -1,289 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI 454 Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-include 'ncbi/clip.vschema';
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* dynamic_read_desc
- *  uses inputs to determine read type and segmentation
- *
- *  "edit_distance" [ CONST, OPTIONAL ] - a tolerance figure for
- *  linker matching, where 0 requires exact match, 5 is default.
- *
- *  "spot" [ DATA ] - bases for entire spot
- *
- *  "key" [ DATA, CONTROL ] - bases for key sequence. for version 1,
- *  the first base following key is taken as biological start
- *
- *  "linker" [ DATA, CONTROL, OPTIONAL ] - if present, is used to separate
- *  all bases following "key" into mate pair biological reads
- *
- *  returns a trio for each identified read, with read type, start and length
- */
-typeset NCBI:SRA:_454_:drdparam_set { ascii, U8, INSDC:2na:packed };
-extern function
-U32 [ 3 ] NCBI:SRA:_454_:dynamic_read_desc #1 < * U32 edit_distance >
-    ( NCBI:SRA:_454_:drdparam_set spot, NCBI:SRA:_454_:drdparam_set key
-      * NCBI:SRA:_454_:drdparam_set linker );
-
-const U32 NCBI:SRA:_454_:dyn_read_type  = 0;
-const U32 NCBI:SRA:_454_:dyn_read_start = 1;
-const U32 NCBI:SRA:_454_:dyn_read_len   = 2;
-
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
- */
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:_454_:tokenize_spot_name #1 ( ascii name );
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:_454_:common
- *  Roche 454 SRA Platform
- *
- * history:
- *  1.0.1 - explictly base upon sra #1.0.1
- *  1.0.2 - bring in clip processing from external table
- *  1.0.3 - base explicitly upon sra #1.0.2, clip #1.0.1
- *  1.0.4 - base explicitly upon sra #1.0.3, clip #1.0.2
- */
-table NCBI:SRA:_454_:common #1.0.4 = INSDC:SRA:tbl:sra #1.0.3, NCBI:SRA:tbl:clip #1.0.2
-{
-    /* PLATFORM
-     *  platform name is always 454
-     */
-    ascii platform_name
-        = < ascii > echo < "454" > ();
-
-    /* 454 TECHNICAL SEQUENCES
-     */
-    column INSDC:dna:text FLOW_CHARS = out_flow_chars;
-    INSDC:dna:text in_flow_chars
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgtn.', 'ACGTNN' > ( FLOW_CHARS );
-    column INSDC:dna:text KEY_SEQUENCE = out_key_sequence;
-    INSDC:dna:text in_key_sequence
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgtn.', 'ACGTNN' > ( KEY_SEQUENCE );
-    column INSDC:dna:text LINKER_SEQUENCE = out_linker_sequence;
-    INSDC:dna:text in_linker_sequence
-        = < INSDC:dna:text, INSDC:dna:text > map < 'acgtn.', 'ACGTNN' > ( LINKER_SEQUENCE );
-
-    // binary technical sequences
-    INSDC:x2na:bin out_flow_bin
-        = < INSDC:dna:text, INSDC:x2na:bin > map < INSDC:x2na:map:CHARSET, INSDC:x2na:map:BINSET > ( out_flow_chars );
-    INSDC:x2na:bin out_key_bin
-        = < INSDC:dna:text, INSDC:x2na:bin > map < INSDC:x2na:map:CHARSET, INSDC:x2na:map:BINSET > ( out_key_sequence );
-    INSDC:x2na:bin out_linker_bin
-        = < INSDC:dna:text, INSDC:x2na:bin > map < INSDC:x2na:map:CHARSET, INSDC:x2na:map:BINSET > ( out_linker_sequence );
-
-    /* SIGNAL
-     *  single channel integer
-     */
-    column NCBI:isamp1 SIGNAL = out_signal;
-    NCBI:isamp1 out_signal = .SIGNAL;
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  out_cs_key
-	 *  in_dna_text
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotname inherited productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  trim_len
-	 *  out_label
-	 *  out_nreads
-	 *  trim_start
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  base_count
-	 *  spot_count
-	 *  max_spot_id
-	 *  min_spot_id
-	 *  in_stats_bin
-	 *  bio_base_count
-	 */
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-
-	/* NCBI:SRA:_454_:common productions
-	 *  .SIGNAL
-	 *  .CLIP_ADAPTER_LEFT
-	 *  .CLIP_QUALITY_LEFT
-	 *  .CLIP_ADAPTER_RIGHT
-	 *  .CLIP_QUALITY_RIGHT
-	 *  out_flow_chars
-	 *  out_key_sequence
-	 *  out_linker_sequence
-	 */
-};
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:_454_:tbl:v2
- *  Roche 454 SRA Platform
- *
- * history:
- *  1.0.1 - explictly base upon sra #1.0.1 and related changes
- *  1.0.2 - respond to change to 454:common base table #1.0.2
- */
-
-// encodings are declared to have their own version
-// so that they may be changed over time independently
-physical INSDC:coord:one NCBI:SRA:_454_:encoding:CLIP #2
-{
-    decode { return ( INSDC:coord:one ) iunzip ( @ ); }
-    encode { return izip ( @ ); }
-}
-
-physical NCBI:isamp1 NCBI:SRA:_454_:encoding:SIGNAL #2
-{
-    decode { return ( NCBI:isamp1 ) iunzip ( @ ); }
-    encode { return izip ( @ ); }
-}
-
-physical INSDC:position:one NCBI:SRA:_454_:encoding:POSITION #2
-{
-    decode
-    {
-        I32 pos_1st_deriv = iunzip ( @ );
-        return ( INSDC:position:one ) < I32 > integral ( pos_1st_deriv );
-    }
-    encode
-    { 
-        I32 pos_1st_deriv = < I32 > deriv ( @ );
-        return izip ( pos_1st_deriv ); 
-    }
-}
-
-/* normalized v2 table
- *
- * history:
- *  1.0.6 - base upon updated ancestry
- *  1.0.7 - base upon updated ancestry
- */
-table NCBI:SRA:_454_:tbl:v2 #1.0.7
-    = NCBI:SRA:tbl:sra_nopos #2.1.3
-    , NCBI:tbl:base_space #2.0.3
-    , NCBI:tbl:phred_quality #2.0.3
-    , NCBI:SRA:_454_:common #1.0.4
-{
-    /* NAME tokenizing and coordinates
-     *  most work happens in skeyname table
-     *  we still obtain REGION from name
-     */
-    readonly column INSDC:coord:val REGION = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:T > ( _out_name, out_spot_name_tok );
-    NCBI:SRA:spot_name_token out_spot_name_tok
-        = NCBI:SRA:_454_:tokenize_spot_name ( _out_name );
-
-    NCBI:SRA:spot_name_token in_spot_name_tok
-        = NCBI:SRA:_454_:tokenize_spot_name ( NAME );
-
-    // special sequences
-    INSDC:dna:text out_flow_chars
-        = .FLOW_CHARS
-        | < INSDC:dna:text > echo < 'TACG' > ( .SIGNAL )
-        | < INSDC:dna:text > echo < 'TACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACG' > ();
-
-    physical column < INSDC:dna:text > zip_encoding
-        .FLOW_CHARS = in_flow_chars;
-
-    INSDC:dna:text out_key_sequence
-        = .KEY_SEQUENCE
-        | < INSDC:dna:text > echo < 'TCAG' > ();
-
-    physical column < INSDC:dna:text > zip_encoding
-        .KEY_SEQUENCE = in_key_sequence;
-
-    INSDC:dna:text out_linker_sequence = .LINKER_SEQUENCE;
-    physical column < INSDC:dna:text > zip_encoding
-        .LINKER_SEQUENCE = in_linker_sequence;
-
-// linker needs to be representable by its own table
-// either in metadata or somewhere else
-
-    // position stored as normal 1-based coordinate
-    INSDC:position:one out_position = .POSITION;
-    physical column NCBI:SRA:_454_:encoding:POSITION #2
-        .POSITION = POSITION;
-
-    // clips
-    physical column NCBI:SRA:_454_:encoding:CLIP #2
-        .CLIP_ADAPTER_LEFT = CLIP_ADAPTER_LEFT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #2
-        .CLIP_ADAPTER_RIGHT = CLIP_ADAPTER_RIGHT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #2
-        .CLIP_QUALITY_LEFT = CLIP_QUALITY_LEFT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #2
-        .CLIP_QUALITY_RIGHT = CLIP_QUALITY_RIGHT;
-
-    // signal
-    physical column NCBI:SRA:_454_:encoding:SIGNAL #2
-        .SIGNAL = SIGNAL;
-};
diff --git a/interfaces/sra/abi.h b/interfaces/sra/abi.h
deleted file mode 100644
index 5fdc108..0000000
--- a/interfaces/sra/abi.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_abi_
-#define _h_sra_abi_
-
-#ifndef _h_sra_rd_extern_
-#include <sra/rd-extern.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * AbsolidReader
- */
-typedef struct AbsolidReader AbsolidReader;
-
-/* Make
- *  create AbsolidReader reference based
- *  on opened table and properties:
- *     table      - SRATable
- *     accession  - accession
- *     minReadLen - minimal length of the outputed read, 0 - no minimum (FUSE)
- *     origFormat - excludes SRR accession & length on defline
- *     noclip     - don't clip quality left and right
- *     minSpotId  - starting spot id, 0 - ignored (run information used)
- *     maxSpotId  - ending spot id, 0 - ignored (run information used)
- *                  you cannot seek out of range of [minSpotId:maxSpotId]
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderMake(const AbsolidReader** self, const SRATable* table,
-                                        const char* accession, bool origFormat,
-                                        bool noClip, uint32_t minReadLen,
-                                        spotid_t minSpotId, spotid_t maxSpotId, bool signal);
-
-/* Whack
- *  releases object obtained from AbsolidReaderMake
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderWhack(const AbsolidReader* self);
-
-/* FirstSpot
- *  set current spot to first in the run
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderFirstSpot(const AbsolidReader* self);
-
-/* SeekSpot
- *  set current spot
- * if error occured current spot position becomes 0
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderSeekSpot(const AbsolidReader* self, spotid_t spot);
-
-/* NextSpot
- *  Seek to next spot from current
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderNextSpot(const AbsolidReader* self);
-
-/* CurrentSpot
- *  Get current spot
- *  sopt [OUT] - pointer to assign value of the current spot
- * returns GetRCState(rc) == rcExhausted when out of spots
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderCurrentSpot(const AbsolidReader* self, spotid_t* spot);
-
-/* SpotInfo
- *  Get current spot information
- *  spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
- *  spotname_sz [OUT] - pointer to assign value of the length of the spot name (can be NULL)
- *  spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
- *  num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
- */
-SRA_RD_EXTERN rc_t CC AbsolidReader_SpotInfo(const AbsolidReader* self,
-                                             const char** spotname, size_t* spotname_sz,
-                                             uint32_t* spot_len, uint32_t* num_reads);
-/* SpotReadInfo
- *  Get read information for current spot
- *  readid    [IN]  - 1-based read id
- *  read_type [OUT] - pointer to assign value of the read type (can be NULL)
- *  read_label[OUT] - pointer to assign value of the read label (can be NULL)
- *  read_label_sz [OUT] - pointer to assign value of the length of the read label (can be NULL)
- *  read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
- *  read_len  [OUT] - pointer to assign value of the read length (can be NULL)
- *  cskey     [OUT] - pointer to assign value of the read color space key (can be NULL)
- *  if start and len is == 0 read is empty
- */
-SRA_RD_EXTERN rc_t CC AbsolidReader_SpotReadInfo(const AbsolidReader* self, uint32_t readId, SRAReadTypes* read_type, 
-                                                 const char** read_label, INSDC_coord_len* read_label_sz,
-                                                 INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
-
-/* SpotPrefix
- *  retrieve current spot name prefix
- *  prefix [OUT] - pointer to assign value of the spot name prefix
- *  prefix_sz [OUT] - pointer to assign value of the length of the spot name prefix
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderSpotName(const AbsolidReader* self,
-                                            const char** prefix, size_t* prefix_sz,
-                                            const char** suffix, size_t* suffix_sz);
-
-/* BaseName
- *  retrieve name string for the spot, result always has '\0' at the and (asciiz string)
- *  readid [IN] - 1-based, if <= 0 than the whole spot, otherwise particular read
- *  label  [IN] - overrides read label appending (printLabel), set to NULL by default
- *  data   [IN] - pointer to buffer for printing
- *  dsize  [IN] - data buffer size
- *  written [IN,OUT] - optional number of bytes occupied by string
- *                     (not including the trailing '\0' used to end output), may by more than dsize
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderHeader(const AbsolidReader* self, uint32_t readId,
-                                          char* data, size_t dsize, size_t* written);
-
-/* Base
- *  retrieve bases for the spot
- *  other parameters see description for AbsolidReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderBase(const AbsolidReader* self, uint32_t readId,
-                                        char* data, size_t dsize, size_t* written);
-
-/* Quality
- *  retrieve quality string for the spot
- *  other parameters see description for AbsolidReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderQuality(const AbsolidReader* self, uint32_t readId,
-                                           char* data, size_t dsize, size_t* written);
-
-/* Signals
- *  retrieve signal string for the spot
- *  other parameters see description for AbsolidReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC AbsolidReaderSignalFTC(const AbsolidReader* self, uint32_t readId,
-                                             char* data, size_t dsize, size_t* written);
-SRA_RD_EXTERN rc_t CC AbsolidReaderSignalCY3(const AbsolidReader* self, uint32_t readId,
-                                             char* data, size_t dsize, size_t* written);
-SRA_RD_EXTERN rc_t CC AbsolidReaderSignalTXR(const AbsolidReader* self, uint32_t readId,
-                                             char* data, size_t dsize, size_t* written);
-SRA_RD_EXTERN rc_t CC AbsolidReaderSignalCY5(const AbsolidReader* self, uint32_t readId,
-                                             char* data, size_t dsize, size_t* written);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_abi_ */
diff --git a/interfaces/sra/abi.vschema b/interfaces/sra/abi.vschema
deleted file mode 100644
index dbdfa12..0000000
--- a/interfaces/sra/abi.vschema
+++ /dev/null
@@ -1,241 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI ABI Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:ABI
- *  ABI SRA Platform
- */
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
- */
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:ABI:tokenize_spot_name #1 ( ascii name );
-
-
-/* NCBI:SRA:ABI:common
- *  basic table interface based upon ABI's pipelines
- *
- * history:
- *  1.0.1 - base explicitly upon changes to sra #1.0.1
- *  1.0.2 - base explicitly upon sra #1.0.2
- *  1.0.3 - base explicitly upon sra #1.0.3
- */
-table NCBI:SRA:ABI:common #1.0.3 = INSDC:SRA:tbl:sra #1.0.3
-{
-    // platform name is always 'ABSOLID'
-    ascii platform_name
-        = < ascii > echo < "ABSOLID" > ();
-
-    /* TRIMMED SEQUENCE
-     *  need to find the 0-based trim_start and trim_len
-     */
-    INSDC:coord:zero bio_start = NCBI:SRA:bio_start ( out_read_start, out_read_type );
-    INSDC:coord:zero trim_start = bio_start;
-    U32 trim_left = ( U32 ) trim_start;
-    INSDC:coord:len trim_len = ( INSDC:coord:len ) < U32 > diff ( spot_len, trim_left );
-
-    /* COORDINATES
-     *  in addition to X and Y,
-     *  ABI has PANEL
-     */
-    column INSDC:coord:val PANEL = out_panel_coord;
-
-    // signal
-    column NCBI:fsamp4 SIGNAL
-        = out_signal;
-
-    NCBI:fsamp4 out_signal = ( NCBI:fsamp4 )
-        < NCBI:SRA:swapped_fsamp4 > NCBI:SRA:swap ( out_signal_swapped, out_x2cs_bin );
-
-
-	/* INSDC:tbl:sequence inherited productions
-	 *  cs_native
-	 *  in_cs_key
-	 *  out_cs_key
-	 *  out_signal_swapped
-	 *  out_2cs_bin
-	 *  out_2na_bin
-	 *  out_4na_bin
-	 *  out_dna_text
-	 *  out_x2cs_bin
-	 *  out_x2na_bin
-	 *  in_color_text
-	 *  out_2cs_packed
-	 *  out_2na_packed
-	 *  out_4na_packed
-	 *  out_color_text
-	 *  out_qual_phred
-	 *  out_color_matrix
-	 */
-
-	/* INSDC:SRA:tbl:spotname inherited productions
-	 *  out_x_coord
-	 *  out_y_coord
-	 *  out_name_fmt
-	 *  out_spot_name
-	 *  spot_ids_found
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  out_label
-	 *  out_nreads
-	 *  out_read_len
-	 *  out_label_len
-	 *  out_rd_filter
-	 *  out_read_type
-	 *  out_read_start
-	 *  out_label_start
-	 *  static_fixed_spot_len
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited productions
-	 *  base_count
-	 *  spot_count
-	 *  max_spot_id
-	 *  min_spot_id
-	 *  in_stats_bin
-	 *  bio_base_count
-	 */
-
-	/* INSDC:SRA:tbl:sra inherited productions
-	 *  out_platform
-	 */
-
-	/* NCBI:SRA:ABI:common productions
-	 *  out_panel_coord
-	 */
-};
-
-
-/* NCBI:SRA:ABI:tbl:v2 #1
- *  normalized v2 table
- *
- * history:
- *  1.0.1 - changes to sra #1.0.1
- *  1.0.2 - changes to common #1.0.2
- *  1.0.3 - sra #2.1.2, color_space #2.0.2, common #1.0.3
- *  1.0.4 - updated ancestry
- */
-physical NCBI:SRA:swapped_fsamp4 NCBI:SRA:ABI:encoding:SIGNAL #2
-{
-    decode { return NCBI:SRA:fsamp4:decode #2 ( @ ); }
-    encode { return NCBI:SRA:fsamp4:encode #2 < 14, 10 > ( @ ); }
-}
-
-table NCBI:SRA:ABI:tbl:v2 #1.0.4
-    = NCBI:SRA:tbl:sra #2.1.3
-    , NCBI:tbl:color_space #2.1.0
-    , NCBI:tbl:phred_quality #2.0.3
-    , NCBI:SRA:ABI:common #1.0.3
-{
-    /* NAME tokenizing and coordinates
-     *  most work happens in skeyname table
-     *  we still obtain PANEL from name
-     */
-    INSDC:coord:val out_panel_coord = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:T > ( _out_name, out_spot_name_tok );
-    NCBI:SRA:spot_name_token out_spot_name_tok
-        = NCBI:SRA:ABI:tokenize_spot_name ( _out_name );
-
-    NCBI:SRA:spot_name_token in_spot_name_tok
-        = NCBI:SRA:ABI:tokenize_spot_name ( NAME );
-
-
-    /* SIGNAL
-     *  optional, no longer archived
-     */
-
-    // support for individual color inputs
-    extern column NCBI:fsamp1 FTC
-    {
-        read = out_ftc;
-        validate = < F32 > no_compare #1 ( in_ftc, out_ftc );
-    }
-    NCBI:fsamp1 in_ftc = FTC;
-    NCBI:fsamp1 out_ftc
-        = ( NCBI:fsamp1 ) < F32 > cut < 0 > ( out_signal );
-
-    extern column NCBI:fsamp1 FAM
-    {
-        read = out_fam;
-        validate = < F32 > no_compare #1 ( in_fam, out_fam );
-    }
-    NCBI:fsamp1 in_fam = FAM;
-    NCBI:fsamp1 out_fam
-        = ( NCBI:fsamp1 ) < F32 > cut < 0 > ( out_signal );
-
-    extern column NCBI:fsamp1 CY3
-    {
-        read = out_cy3;
-        validate = < F32 > no_compare #1 ( in_cy3, out_cy3 );
-    }
-    NCBI:fsamp1 in_cy3 = CY3;
-    NCBI:fsamp1 out_cy3
-        = ( NCBI:fsamp1 ) < F32 > cut < 1 > ( out_signal );
-
-    extern column NCBI:fsamp1 TXR
-    {
-        read = out_txr;
-        validate = < F32 > no_compare #1 ( in_txr, out_txr );
-    }
-    NCBI:fsamp1 in_txr = TXR;
-    NCBI:fsamp1 out_txr
-        = ( NCBI:fsamp1 ) < F32 > cut < 2 > ( out_signal );
-
-    extern column NCBI:fsamp1 CY5
-    {
-        read = out_cy5;
-        validate = < F32 > no_compare #1 ( in_cy5, out_cy5 );
-    }
-    NCBI:fsamp1 in_cy5 = CY5;
-    NCBI:fsamp1 out_cy5
-        = ( NCBI:fsamp1 ) < F32 > cut < 3 > ( out_signal );
-
-    // intermediate input (writing) production
-    NCBI:fsamp4 in_signal
-        = SIGNAL
-        | ( NCBI:fsamp4 ) < F32 > paste ( in_ftc, in_cy3, in_txr, in_cy5 )
-        | ( NCBI:fsamp4 ) < F32 > paste ( in_fam, in_cy3, in_txr, in_cy5 );
-
-    // overridden output production
-    NCBI:SRA:swapped_fsamp4 out_signal_swapped = .SIGNAL;
-
-    // rule for writing SIGNAL
-    physical column NCBI:SRA:ABI:encoding:SIGNAL #2 .SIGNAL
-        = ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_signal, in_x2cs_bin )
-        | ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_signal, in_2cs_bin );
-};
diff --git a/interfaces/sra/extern.h b/interfaces/sra/extern.h
deleted file mode 100644
index aa32b37..0000000
--- a/interfaces/sra/extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_extern_
-#define _h_sra_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define SRA_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define SRA_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_sra_extern_ */
diff --git a/interfaces/sra/fastq.h b/interfaces/sra/fastq.h
deleted file mode 100644
index 121d3ce..0000000
--- a/interfaces/sra/fastq.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_fastq_
-#define _h_sra_fastq_
-
-#ifndef _h_sra_rd_extern_
-#include <sra/rd-extern.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * FastqReader
- */
-typedef struct FastqReader FastqReader;
-
-/* Make
- *  create FastqReader reference based
- *  on opened table and properties:
- *     table      - SRATable
- *     accession  - accession
- *     minReadLen - minimal length of the outputed read, 0 - no minimum (FUSE)
- *     colorSpace - color space sequence
- *     origFormat - excludes SRR accession & length on defline
- *     fasta      - prepare only reads, no qualities
- *     readLabel  - prints read label on the name line
- *     readId     - prints .read in spot id on the name line (not in origFormat)
- *     noclip     - don't clip quality left and right
- *     offset     - offset to use for quality conversion (default is 33)
- *     csKey      - desired color space key, '\0' - do not convert
- *     minSpotId  - starting spot id, 0 - ignored (run information used)
- *     maxSpotId  - ending spot id, 0 - ignored (run information used)
- *                  you cannot seek out of range of [minSpotId:maxSpotId]
- */
-SRA_RD_EXTERN rc_t CC FastqReaderMake(const FastqReader** self, const SRATable* table, const char* accession,
-                                      bool colorSpace, bool origFormat, bool fasta,
-                                      bool printLabel, bool printReadId,
-                                      bool noClip, uint32_t minReadLen,
-                                      char offset, char csKey,
-                                      spotid_t minSpotId, spotid_t maxSpotId);
-
-/* Whack
- *  releases object obtained from FastqReaderMake
- */
-SRA_RD_EXTERN rc_t CC FastqReaderWhack(const FastqReader* self);
-
-/* FirstSpot
- *  set current spot to first in the run
- */
-SRA_RD_EXTERN rc_t CC FastqReaderFirstSpot(const FastqReader* self);
-
-/* SeekSpot
- *  set current spot
- * if error occured current spot position becomes 0
- */
-SRA_RD_EXTERN rc_t CC FastqReaderSeekSpot(const FastqReader* self, spotid_t spot);
-
-/* NextSpot
- *  Seek to next spot from current
- */
-SRA_RD_EXTERN rc_t CC FastqReaderNextSpot(const FastqReader* self);
-
-/* CurrentSpot
- *  Get current spot
- *  sopt [OUT] - pointer to assign value of the current spot
- * returns GetRCState(rc) == rcExhausted when out of spots
- */
-SRA_RD_EXTERN rc_t CC FastqReaderCurrentSpot(const FastqReader* self, spotid_t* spot);
-
-/* SpotInfo
- *  Get current spot information
- *  spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
- *  spotname_sz [OUT] - pointer to assign value of the length of the spot name (can be NULL)
- *  spotgroup [OUT] - pointer to assign value of the current spot group (can be NULL)
- *  spotgroup_sz [OUT] - pointer to assign value of the length of the spot group (can be NULL)
- *  spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
- *  num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
- */
-SRA_RD_EXTERN rc_t CC FastqReader_SpotInfo(const FastqReader* self,
-                                           const char** spotname, size_t* spotname_sz,
-                                           const char** spotgroup, size_t* spotgroup_sz,
-                                           uint32_t* spot_len, uint32_t* num_reads);
-
-/* SpotReadInfo
- *  Get read information for current spot
- *  readid    [IN]  - 1-based read id
- *  read_type [OUT] - pointer to assign value of the read type (can be NULL)
- *  read_label[OUT] - pointer to assign value of the read label (can be NULL)
- *  read_label_sz [OUT] - pointer to assign value of the length of the read label (can be NULL)
- *  read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
- *  read_len  [OUT] - pointer to assign value of the read length (can be NULL)
- *  cskey     [OUT] - pointer to assign value of the read color space key (can be NULL)
- *  if start and len is == 0 read is empty
- */
-SRA_RD_EXTERN rc_t CC FastqReader_SpotReadInfo(const FastqReader* self, uint32_t readId, SRAReadTypes* read_type, 
-                                               const char** read_label, INSDC_coord_len* read_label_sz,
-                                               INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
-
-/* BaseName
- *  retrieve name string for the spot, result always has '\0' at the and (asciiz string)
- *  readid [IN] - 1-based, if <= 0 than the whole spot, otherwise particular read
- *  label  [IN] - overrides read label appending (printLabel), set to NULL by default
- *  data   [IN] - pointer to buffer for printing
- *  dsize  [IN] - data buffer size
- *  written [IN,OUT] - optional number of bytes occupied by string
- *                     (not including the trailing '\0' used to end output), may by more than dsize
- */
-SRA_RD_EXTERN rc_t CC FastqReaderBaseName(const FastqReader* self, uint32_t readId,
-                                          bool* label, char* data, size_t dsize, size_t* written);
-
-/* Base
- *  retrieve bases for the spot
- *  other parameters see description for FastqReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC FastqReaderBase(const FastqReader* self, uint32_t readId,
-                                      char* data, size_t dsize, size_t* written);
-
-/* QualityName
- *  retrieve quality name string for the spot
- *  other parameters see description for FastqReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC FastqReaderQualityName(const FastqReader* self, uint32_t readId,
-                                             bool* label, char* data, size_t dsize, size_t* written);
-
-/* Quality
- *  retrieve quality string for the spot
- *  other parameters see description for FastqReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC FastqReaderQuality(const FastqReader* self, uint32_t readId,
-                                         char* data, size_t dsize, size_t* written);
-
-/* GetCurrentSpotData
- *  retrieve current spot data as a blob
- *  other parameters see description for FastqReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC FastqReader_GetCurrentSpotData(const FastqReader* self,
-                                                     char* data, size_t dsize, size_t* written);
-
-/* GetCurrentSpotSplitData
- * same as above but split spot into line with individual reads
- */
-SRA_RD_EXTERN rc_t CC FastqReader_GetCurrentSpotSplitData(const FastqReader* self,
-                                                          char* data, size_t dsize, size_t* written);
-
-/* GetNextSpotData (streaming function)
- *  move to the next spot and retrieve current spot data as a blob
- *  other parameters see description for FastqReaderBaseName above
- */
-SRA_RD_EXTERN rc_t CC FastqReader_GetNextSpotData(const FastqReader* self,
-                                                  char* data, size_t dsize, size_t* written);
-
-/* GetNextSpotSplitData (streaming function)
- * same as above but split spot into line with individual reads
- */
-SRA_RD_EXTERN rc_t CC FastqReader_GetNextSpotSplitData(const FastqReader* self,
-                                                       char* data, size_t dsize, size_t* written);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_fastq_ */
diff --git a/interfaces/sra/helicos.vschema b/interfaces/sra/helicos.vschema
deleted file mode 100644
index e758a0b..0000000
--- a/interfaces/sra/helicos.vschema
+++ /dev/null
@@ -1,85 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Helicos Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
- */
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:Helicos:tokenize_spot_name #1 ( ascii name );
-
-
-/* Helicos:tbl
- *
- * history:
- *  1.0.1 - explictly base upon ancestry
- *  1.0.2 - base explicitly upon latest ancestry
- *  1.0.3 - base explicitly upon latest ancestry
- *  1.0.4 - base explicitly upon latest ancestry
- */
-table NCBI:SRA:Helicos:tbl:v2 #1.0.4
-    = NCBI:SRA:tbl:sra #2.1.3
-    , NCBI:tbl:base_space #2.0.3
-    , NCBI:tbl:phred_quality #2.0.3
-{
-    ascii platform_name
-        = < ascii > echo < "HELICOS" > ();
-
-    /* NAME tokenizing and coordinates
-     *  most work happens in skeyname table
-     *  we still obtain REGION from name
-     */
-
-    readonly column INSDC:coord:val CHANNEL = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:L > ( _out_name, out_spot_name_tok );
-    readonly column INSDC:coord:val FIELD = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:T > ( _out_name, out_spot_name_tok );
-    NCBI:SRA:spot_name_token out_spot_name_tok
-        = NCBI:SRA:Helicos:tokenize_spot_name ( _out_name );
-
-    readonly column INSDC:coord:val CAMERA = out_x_coord;
-    readonly column INSDC:coord:val POS = out_y_coord;
-
-    NCBI:SRA:spot_name_token in_spot_name_tok
-        = NCBI:SRA:Helicos:tokenize_spot_name ( NAME );
-
-    INSDC:coord:zero trim_start
-        = < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len trim_len = spot_len;
-};
diff --git a/interfaces/sra/illumina.h b/interfaces/sra/illumina.h
deleted file mode 100644
index 73062f8..0000000
--- a/interfaces/sra/illumina.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_illumina_
-#define _h_sra_illumina_
-
-#ifndef _h_sra_rd_extern_
-#include <sra/rd-extern.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * IlluminaReader
- */
-typedef struct IlluminaReader IlluminaReader;
-
-/* Make
- *  create IlluminaReader reference based
- *  on opened table and properties:
- *     table      - SRATable
- *     accession  - accession
- *     read       - output reads
- *     qual1      - output quality1
- *     qual4      - output quality4
- *     intensity  - output intensity
- *     noise      - output noise
- *     signal     - output signal
- *     qseq       - output QSEQ format
- *     minSpotId  - starting spot id, 0 - ignored (run information used)
- *     maxSpotId  - ending spot id, 0 - ignored (run information used)
- *                  you cannot seek out of range of [minSpotId:maxSpotId]
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderMake(const IlluminaReader** self, const SRATable* table, const char* accession,
-                                         bool read, bool qual1, bool qual4,
-                                         bool intensity, bool noise, bool signal, bool qseq,
-                                         spotid_t minSpotId, spotid_t maxSpotId);
-/* Whack
- *  releases object obtained from IlluminaReaderMake
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderWhack(const IlluminaReader* self);
-
-/* FirstSpot
- *  set current spot to first in the run
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderFirstSpot(const IlluminaReader* self);
-
-/* SeekSpot
- *  set current spot
- * if error occured current spot position becomes 0
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderSeekSpot(const IlluminaReader* self, spotid_t spot);
-
-/* NextSpot
- *  Seek to next spot from current
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderNextSpot(const IlluminaReader* self);
-
-/* CurrentSpot
- *  Get current spot
- *  sopt [OUT] - pointer to assign value of the current spot
- * returns GetRCState(rc) == rcExhausted when out of spots
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderCurrentSpot(const IlluminaReader* self, spotid_t *spot);
-
-/* SpotInfo
- *  Get current spot information
- *  spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
- *  spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
- *  num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
- */
-SRA_RD_EXTERN rc_t CC IlluminaReader_SpotInfo(const IlluminaReader* self,
-                                              const char** spotname, size_t* spotname_sz,
-                                              INSDC_coord_val* lane, INSDC_coord_val* tile, 
-                                              INSDC_coord_val* x, INSDC_coord_val* y,
-                                              uint32_t* spot_len, uint32_t* num_reads);
-/* SpotReadInfo
- *  Get read information for current spot
- *  readid    [IN]  - 1-based read id
- *  read_label[OUT] - pointer to assign value of the read label (can be NULL)
- *  read_type [OUT] - pointer to assign value of the read type (can be NULL)
- *  read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
- *  read_len  [OUT] - pointer to assign value of the read length (can be NULL)
- *  cskey     [OUT] - pointer to assign value of the read color space key (can be NULL)
- *  if start and len is == 0 read is empty
- */
-SRA_RD_EXTERN rc_t CC IlluminaReader_SpotReadInfo(const IlluminaReader* self, uint32_t readId, SRAReadTypes* read_type,
-                                                  const char** read_label, INSDC_coord_len* read_label_sz,
-                                                  INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
-
-/* Base
- *  retrieve bases for the spot, result always has '\0' at the and (asciiz string)
- *  data   [IN] - pointer to buffer for printing
- *  dsize  [IN] - data buffer size
- *  written [IN,OUT] - optional number of bytes occupied by string
- *                     (not including the trailing '\0' used to end output), may by more than dsize
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderBase(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
-
-/* Noise
- *  retrieve noise in 4 floats per base format
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderNoise(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
-
-/* Intensity
- *  retrieve intensity in 4 floats per base format
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderIntensity(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
-
-/* Signal
- *  retrieve signal in 4 floats per base format
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderSignal(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
-
-/* Quality (BINARY)
- *  retrieve quality as single bytes per bases
- *  readid [IN] - 1-based, if <= 0 than the whole spot, otherwise particular read
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderQuality1(const IlluminaReader* self, uint32_t readId, char* data, size_t dsize, size_t* written);
-
-/* Quality
- *  retrieve quality in 4 integers per base format
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderQuality4(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
-
-/* QSeq
- *  spot information as in QSEQ format
- *  other parameters see description for IlluminaReaderBase above
- */
-SRA_RD_EXTERN rc_t CC IlluminaReaderQSeq(const IlluminaReader* self, uint32_t readId, bool spot_group,
-                                         char* data, size_t dsize, size_t* written);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_illumina_ */
diff --git a/interfaces/sra/illumina.vschema b/interfaces/sra/illumina.vschema
deleted file mode 100644
index af4dbe4..0000000
--- a/interfaces/sra/illumina.vschema
+++ /dev/null
@@ -1,403 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Illumina Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-typedef INSDC:quality:log_odds NCBI:qual4 [ 4 ];
-typedef NCBI:qual4 NCBI:SRA:rotated_qual4, NCBI:SRA:swapped_qual4;
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
- */
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:Illumina:tokenize_spot_name #1 ( ascii name );
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:Illumina:qual4
- *  4-channel log-odds-ish quality
- */
-
-/* history:
- *  1.0.1 - base explicitly upon updated ancestry
- */
-table NCBI:SRA:Illumina:qual4_nocol #1.0.1
-    = INSDC:tbl:sequence #1.0.1
-    , NCBI:tbl:log_odds_quality_nocol #1.0.1
-{
-    /* QUALITY
-     *  4-channel quality column
-     */
-    readonly column NCBI:qual4 QUALITY = out_qual4;
-
-    NCBI:qual4 out_qual4
-        = < NCBI:qual4 > NCBI:SRA:swap ( out_qual4_swapped, read_unpack )
-        | < NCBI:qual4 > NCBI:SRA:rotate < false > ( out_qual4_rotated, read_unpack );
-
-
-    /* single-channel output
-     *  convert 4-channel log-odds to single channel
-     *  must retain n-encoding, which was intended to be the 4-channel pattern
-     *  ( -5, -5, -5, -5 ) and a base of 'A'
-     */
-
-    // first, extract quality for called base
-    INSDC:quality:log_odds out_qual1_ch0
-        = < INSDC:quality:log_odds> cut < 0 > ( out_qual4_swapped )
-        | < INSDC:quality:log_odds> cut < 0 > ( out_qual4_rotated );
-
-    // clip it to -5 and above
-    INSDC:quality:log_odds out_qual1_clip
-        = < INSDC:quality:log_odds > clip < -5, 127 > ( out_qual1_ch0 );
-
-    // convert 4 channel to single 32-bit value
-    U32 out_qual4_32
-        = redimension ( out_qual4_swapped )
-        | redimension ( out_qual4_rotated );
-
-    // detect ( -5, -5, -5, -5 ) and introduce a -6 value into log-odds
-    // this is treated as an 'N', but still not ready
-    INSDC:quality:log_odds out_qual1_fives
-        = < U32, INSDC:quality:log_odds > map < 0xFBFBFBFB, -6 > ( out_qual4_32, out_qual1_clip );
-
-    // now slam zeros into anything that doesn't correspond to an A
-    // essentially this leaves all of the A qualities. any having -6 are really N.
-    INSDC:quality:log_odds out_qual1_n
-        = < U8, INSDC:quality:log_odds > map < [ 1, 2, 3 ], [ 0, 0, 0 ] > ( read_unpack, out_qual1_fives );
-
-    // finally, produce log-odds with n-encoded as -6
-    INSDC:quality:log_odds out_qual_log_odds
-        = < INSDC:quality:log_odds, INSDC:quality:log_odds > map < -6, -6 > ( out_qual1_n, out_qual1_clip );
-
-
-	/* NCBI:tbl:n_encoding inherited productions
-	 *  read_unpack
-	 */
-
-	/* NCBI:SRA:Illumina:qual4_nocol productions
-	 *  out_qual4_rotated
-	 *  out_qual4_swapped
-	 */
-};
-
-
-/* 4-channel log-odds compression
- */
-
-// encoded type - a single byte code for 4-channel pattern
-typedef B8 NCBI:SRA:encoded_qual4;
-
-// decoding function
-extern function
-NCBI:SRA:swapped_qual4 NCBI:SRA:qual4_decode #1 ( NCBI:SRA:encoded_qual4 in );
-
-// encoding function
-extern function
-NCBI:SRA:encoded_qual4 NCBI:SRA:qual4_encode #1 ( NCBI:SRA:swapped_qual4 in );
-
-// compression rules
-physical NCBI:SRA:swapped_qual4 NCBI:SRA:qual4_encoding #1
-{
-    encode
-    {
-        // produce codes
-        NCBI:SRA:encoded_qual4 encoded = NCBI:SRA:qual4_encode ( @ );
-
-        // gzip
-        return zip < Z_RLE, Z_BEST_SPEED > ( encoded );
-    }
-
-    decode
-    {
-        // gunzip
-        NCBI:SRA:encoded_qual4 unzipped = unzip ( @ );
-        
-        // inflate to swapped
-        return NCBI:SRA:qual4_decode ( unzipped );
-    }
-}
-
-/* history:
- *  1.0.1 - base upon updated qual4_nocol
- */
-table NCBI:SRA:Illumina:qual4 #1.0.1 = NCBI:SRA:Illumina:qual4_nocol #1.0.1
-{
-    // read directly as swapped, n-encoded log_odds
-    NCBI:SRA:swapped_qual4 out_qual4_swapped = .QUALITY;
-
-	/* NCBI:tbl:n_encoding inherited virtual productions
-	 *  read_unpack
-	 */
-};
-
-/* history:
- *  2.0.2 - base upon updated ancestry
- *  2.0.3 - base upon updated ancestry
- *  2.0.4 - base upon updated ancestry
- */
-table NCBI:SRA:Illumina:qual4 #2.0.4
-    = NCBI:tbl:base_space #2.0.3
-    , NCBI:tbl:log_odds_quality_nocol #2.0.1
-{
-    /* QUALITY
-     *  4-channel log-odds
-     */
-    extern column NCBI:qual4 QUALITY = out_qual4;
-
-    NCBI:SRA:swapped_qual4 in_qual4
-        = ( NCBI:SRA:swapped_qual4 ) < NCBI:qual4 > NCBI:SRA:swap ( QUALITY, in_x2na_bin )
-        | ( NCBI:SRA:swapped_qual4 ) < NCBI:qual4 > NCBI:SRA:swap ( QUALITY, in_2na_bin );
-
-    NCBI:qual4 out_qual4
-        = < NCBI:SRA:swapped_qual4 > NCBI:SRA:swap ( .QUALITY, out_x2na_bin );
-
-    physical column NCBI:SRA:qual4_encoding .QUALITY = in_qual4;
-
-    // feed to compressed statistics
-    NCBI:qual4 in_stats_qual = in_qual4;
-
-    // single channel
-    INSDC:quality:log_odds out_qual_log_odds
-        = < INSDC:quality:log_odds > cut < 0 > ( .QUALITY );
-};
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:Illumina
- *  Illumina SRA Platform
- */
-
-
-/* NCBI:SRA:Illumina:common #1
- *  basic table interface based upon Illumina's pipelines
- *
- * history:
- *  1.0.1 - explictly base upon sra #1.0.1
- *  1.0.2 - base explicitly upon sra #1.0.2
- *  1.0.3 - base explicitly upon sra #1.0.3
- */
-table NCBI:SRA:Illumina:common #1.0.3 = INSDC:SRA:tbl:sra #1.0.3
-{
-    // platform name is always 'ILLUMINA'
-    ascii platform_name
-        = < ascii > echo < "ILLUMINA" > ();
-
-    /* TRIMMED SEQUENCE
-     *  need to find the 0-based trim_start and trim_len
-     */
-    INSDC:coord:zero bio_start = NCBI:SRA:bio_start ( out_read_start, out_read_type );
-    INSDC:coord:zero trim_start = bio_start;
-    U32 trim_left = ( U32 ) trim_start;
-    INSDC:coord:len trim_len = (INSDC:coord:len) < U32 > diff ( spot_len, trim_left );
-
-    /* COORDINATES
-     *  in addition to X and Y,
-     *  Illumina has LANE and TILE
-     */
-    readonly column INSDC:coord:val LANE = out_lane_coord;
-    readonly column INSDC:coord:val TILE = out_tile_coord;
-};
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:Illumina:tbl:v2 #1
- *  normalized v2 table
- *  still has variants based upon quality type
- *
- * history:
- *  1.0.1 - explictly base upon sra #1.0.1 and related tables
- *  1.0.2 - updated ancestry
- *  1.0.3 - updated ancestry
- */
-
-physical NCBI:SRA:swapped_fsamp4 NCBI:SRA:Illumina:encoding:SIGNAL #2
-{
-    decode { return NCBI:SRA:fsamp4:decode #2 ( @ ); }
-    encode { return NCBI:SRA:fsamp4:encode #2 < 14, 10 > ( @ ); }
-}
-
-physical NCBI:fsamp4 NCBI:SRA:Illumina:encoding:NOISE #2
-{
-    decode
-    {
-        F32 dcmp = funzip ( @ );
-        return redimension ( dcmp );
-    }
-    encode
-    {
-	F32 ncmp = redimension ( @ );
-        return fzip < 10 > ( ncmp );
-    }
-}
-
-physical NCBI:SRA:swapped_fsamp4 NCBI:SRA:Illumina:encoding:INTENSITY #2
-{
-    decode { return NCBI:SRA:fsamp4:decode #2 ( @ ); }
-    encode { return NCBI:SRA:fsamp4:encode #2 < 14, 10 > ( @ ); }
-}
-
-// v2 base table
-table NCBI:SRA:Illumina:tbl:v2 #1.0.4
-    = NCBI:SRA:tbl:sra #2.1.3
-    , NCBI:tbl:base_space #2.0.3
-    , NCBI:SRA:Illumina:common #1.0.3
-{
-    /* NAME tokenizing and coordinates
-     *  most work happens in skeyname table
-     *  we still obtain LANE and TILE from name
-     */
-    INSDC:coord:val out_lane_coord = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:L > ( _out_name, out_spot_name_tok );
-    INSDC:coord:val out_tile_coord = ( INSDC:coord:val )
-        NCBI:SRA:extract_name_coord < NCBI:SRA:name_token:T > ( _out_name, out_spot_name_tok );
-    NCBI:SRA:spot_name_token out_spot_name_tok
-        = NCBI:SRA:Illumina:tokenize_spot_name ( _out_name );
-
-    NCBI:SRA:spot_name_token in_spot_name_tok
-        = NCBI:SRA:Illumina:tokenize_spot_name ( NAME );
-
-    /* SIGNAL
-     *  optional, no longer archived
-     */
-    extern column NCBI:fsamp4 SIGNAL
-    {
-        read = out_signal;
-        validate = < NCBI:fsamp4 > no_compare #1 ( in_signal, out_signal );
-    }
-    NCBI:fsamp4 in_signal = SIGNAL;
-    NCBI:fsamp4 out_signal
-        = < NCBI:SRA:swapped_fsamp4 > NCBI:SRA:swap ( .SIGNAL, out_x2na_bin );
-
-    physical column NCBI:SRA:Illumina:encoding:SIGNAL #2 .SIGNAL
-        = ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_signal, in_x2na_bin )
-        | ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_signal, in_2na_bin );
-
-    /* NOISE
-     *  optional, no longer archived
-     */
-    extern column NCBI:fsamp4 NOISE
-    {
-        read = out_noise;
-        validate = < NCBI:fsamp4 > no_compare #1 ( in_noise, out_noise );
-    }
-    NCBI:fsamp4 in_noise = NOISE;
-    NCBI:fsamp4 out_noise = .NOISE;
-
-    physical column NCBI:SRA:Illumina:encoding:NOISE #2 .NOISE = in_noise;
-
-    /* INTENSITY
-     *  optional, no longer archived
-     */
-    extern column NCBI:fsamp4 INTENSITY
-    {
-        read = out_intensity;
-        validate = < NCBI:fsamp4 > no_compare #1 ( in_intensity, out_intensity );
-    }
-    NCBI:fsamp4 in_intensity = INTENSITY;
-    NCBI:fsamp4 out_intensity
-        = < NCBI:fsamp4 > NCBI:SRA:denormalize ( out_norm_intensity, out_x2na_bin );
-    NCBI:fsamp4 out_norm_intensity
-        = ( NCBI:fsamp4 ) < NCBI:SRA:swapped_fsamp4 > NCBI:SRA:swap ( .INTENSITY, out_x2na_bin );
-    NCBI:fsamp4 in_norm_intensity
-        = < NCBI:fsamp4 > NCBI:SRA:normalize ( in_intensity, in_x2na_bin )
-        | < NCBI:fsamp4 > NCBI:SRA:normalize ( in_intensity, in_2na_bin );
-    physical column NCBI:SRA:Illumina:encoding:INTENSITY #2 .INTENSITY
-        = ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_norm_intensity, in_x2na_bin )
-        | ( NCBI:SRA:swapped_fsamp4 ) < NCBI:fsamp4 > NCBI:SRA:swap ( in_norm_intensity, in_2na_bin );
-
-	/* INSDC:tbl:sequence inherited virtual productions
-	 *  out_qual_phred
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  static_fixed_spot_len
-	 */
-};
-
-/* 4-channel log-odds qualities
- *
- * history:
- *  1.0.2 - updated ancestry
- *  1.0.3 - updated ancestry
- *  1.0.4 - updated ancestry
- */
-table NCBI:SRA:Illumina:tbl:q4:v2 #1.0.4
-    = NCBI:SRA:Illumina:tbl:v2 #1.0.4
-    , NCBI:SRA:Illumina:qual4 #2.0.4
-{
-	/* INSDC:SRA:tbl:spotdesc inherited virtual productions
-	 *  static_fixed_spot_len
-	 */
-};
-
-/* 1-channel log-odds qualities
- *
- * history:
- *  1.0.2 - updated ancestry
- *  1.0.3 - updated ancestry
- *  1.0.4 - updated ancestry
- */
-table NCBI:SRA:Illumina:tbl:q1:v2 #1.0.4
-    = NCBI:SRA:Illumina:tbl:v2 #1.0.4
-    , NCBI:tbl:log_odds_quality #2.0.3
-{
-	/* INSDC:SRA:tbl:spotdesc inherited productions
-	 *  static_fixed_spot_len
-	 */
-};
-
-/* phred qualities
- *
- * history:
- *  1.0.2 - updated ancestry
- *  1.0.3 - updated ancestry
- *  1.0.4 - updated ancestry
- */
-table NCBI:SRA:Illumina:tbl:phred:v2 #1.0.4
-    = NCBI:SRA:Illumina:tbl:v2 #1.0.4
-    , NCBI:tbl:phred_quality #2.0.3
-{
-	/* INSDC:SRA:tbl:spotdesc inherited virtual productions
-	 *  static_fixed_spot_len
-	 */
-};
diff --git a/interfaces/sra/impl.h b/interfaces/sra/impl.h
deleted file mode 100644
index 815d5a6..0000000
--- a/interfaces/sra/impl.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_impl_h_
-#define _h_sra_impl_h_
-
-#ifndef _h_sra_path_extern_
-#include <sra/path-extern.h>
-#endif
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KNamelist;
-struct KDirectory;
-typedef union SRAPath_vt SRAPath_vt;
-typedef struct SRAPath_vt_v1 SRAPath_vt_v1;
-typedef struct SRAPath_vt_v2 SRAPath_vt_v2;
-
-
-/*--------------------------------------------------------------------------
- * SRAPath
- */
-struct SRAPath
-{
-    const SRAPath_vt *vt;
-};
-
-#ifndef SRAPATH_IMPL
-#define SRAPATH_IMPL struct SRAPath
-#endif
-
-struct SRAPath_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    rc_t ( CC *addref ) ( const SRAPATH_IMPL *self );
-    rc_t ( CC *release ) ( const SRAPATH_IMPL *self );
-    rc_t ( CC *version ) ( const SRAPATH_IMPL *self, uint32_t *version );
-    rc_t ( CC *clear ) ( SRAPATH_IMPL *self );
-    rc_t ( CC *addRepPath ) ( SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *addVolPath ) ( SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *fullPath ) ( const SRAPATH_IMPL *self, const char *rep, const char *vol,
-			 const char *acc, char *path, size_t path_max );
-    bool ( CC *testPath ) ( const SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *findPath ) ( const SRAPATH_IMPL *self, const char *acc, char *path, size_t path_max, size_t *rep_len );
-    rc_t ( CC *listPath ) ( const SRAPATH_IMPL *self, struct KNamelist **runs, bool deep );
-};
-
-struct SRAPath_vt_v2
-{
-    /* version == 2.x */
-    uint32_t maj;
-    uint32_t min;
-
-    rc_t ( CC *addref ) ( const SRAPATH_IMPL *self );
-    rc_t ( CC *release ) ( const SRAPATH_IMPL *self );
-    rc_t ( CC *version ) ( const SRAPATH_IMPL *self, uint32_t *version );
-    rc_t ( CC *clear ) ( SRAPATH_IMPL *self );
-    rc_t ( CC *addRepPath ) ( SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *addVolPath ) ( SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *fullPath ) ( const SRAPATH_IMPL *self, const char *rep, const char *vol,
-			 const char *acc, char *path, size_t path_max );
-    bool ( CC *testPath ) ( const SRAPATH_IMPL *self, const char *path );
-    rc_t ( CC *findPath ) ( const SRAPATH_IMPL *self, const char *acc, char *path, size_t path_max, size_t *rep_len );
-};
-
-union SRAPath_vt
-{
-    SRAPath_vt_v1 v1;
-    SRAPath_vt_v2 v2;
-};
-
-
-/* SRAPathMakeImpl
- *  make the SRAPath object within a shared library called "libsra-path"
- */
-MOD_EXPORT rc_t CC SRAPathMakeImpl ( struct SRAPath **pm, struct KDirectory const *dir );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_impl_h_ */
diff --git a/interfaces/sra/ion-torrent.vschema b/interfaces/sra/ion-torrent.vschema
deleted file mode 100644
index ed0d97c..0000000
--- a/interfaces/sra/ion-torrent.vschema
+++ /dev/null
@@ -1,117 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Ion Torrent Sequence Read Archive schema
- */
-version 1;
-
-include 'ncbi/sra.vschema';
-include 'ncbi/spotname.vschema';
-include 'ncbi/clip.vschema';
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
- */
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:IonTorrent:tokenize_spot_name #1 ( ascii name );
-
-
-/*--------------------------------------------------------------------------
- * table
- */
-
-physical INSDC:position:one NCBI:SRA:IonTorrent:encoding:POSITION #1
-{
-    decode
-    {
-        I32 pos_1st_deriv = iunzip ( @ );
-        return ( INSDC:position:one ) < I32 > integral ( pos_1st_deriv );
-    }
-    encode
-    { 
-        I32 pos_1st_deriv = < I32 > deriv ( @ );
-        return izip ( pos_1st_deriv ); 
-    }
-}
-
-/* IonTorrent:tbl
- *
- * history:
- *  1.0.1 - updated ancestry
- *  1.0.2 - updated ancestry
- *  1.0.3 - updated ancestry
- */
-table NCBI:SRA:IonTorrent:tbl:v2 #1.0.3
-    = INSDC:SRA:tbl:sra #1.0.3
-    , NCBI:SRA:tbl:sra_nopos #2.1.3
-    , NCBI:tbl:base_space #2.0.3
-    , NCBI:tbl:phred_quality #2.0.3
-    , NCBI:SRA:tbl:clip #1.0.2
-{
-    /* PLATFORM is always ION_TORRENT */
-    ascii platform_name
-        = < ascii > echo < "ION_TORRENT" > ();
-
-    /* NAME tokenizing and coordinates
-     *  most work happens in skeyname table
-     */
-    NCBI:SRA:spot_name_token out_spot_name_tok
-        = NCBI:SRA:IonTorrent:tokenize_spot_name ( _out_name );
-
-    NCBI:SRA:spot_name_token in_spot_name_tok
-        = NCBI:SRA:IonTorrent:tokenize_spot_name ( NAME );
-
-    // special sequences
-    column < INSDC:dna:text > zip_encoding FLOW_CHARS;
-    column < INSDC:dna:text > zip_encoding KEY_SEQUENCE;
-
-    // position stored as normal 1-based coordinate
-    INSDC:position:one out_position = .POSITION;
-    physical column NCBI:SRA:IonTorrent:encoding:POSITION
-        .POSITION = POSITION;
-
-
-    // clips
-    physical column < INSDC:coord:one > izip_encoding
-        .CLIP_ADAPTER_LEFT = CLIP_ADAPTER_LEFT;
-    physical column < INSDC:coord:one > izip_encoding
-        .CLIP_ADAPTER_RIGHT = CLIP_ADAPTER_RIGHT;
-    physical column < INSDC:coord:one > izip_encoding
-        .CLIP_QUALITY_LEFT = CLIP_QUALITY_LEFT;
-    physical column < INSDC:coord:one > izip_encoding
-        .CLIP_QUALITY_RIGHT = CLIP_QUALITY_RIGHT;
-
-    // signal
-    column < NCBI:isamp1 > izip_encoding SIGNAL;
-};
diff --git a/interfaces/sra/pacbio.h b/interfaces/sra/pacbio.h
deleted file mode 100644
index 0c3ea64..0000000
--- a/interfaces/sra/pacbio.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_pacbio_
-#define _h_sra_pacbio_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*==========================================================================
- * PACBIO types, constants
- */
-
-
-/* hole status for pacbio spots
- */
-#define sra_read_filter_t "INSDC:SRA:read_filter"
-typedef uint8_t PACBIO_HOLE_STATUS;
-enum
-{
-    SRA_PACBIO_HOLE_SEQUENCING = 0,
-    SRA_PACBIO_HOLE_ANTIHOLE = 1,
-    SRA_PACBIO_HOLE_FIDUCIAL = 2,
-    SRA_PACBIO_HOLE_SUSPECT = 3,
-    SRA_PACBIO_HOLE_ANTIMIRROR = 4,
-    SRA_PACBIO_HOLE_FDZMW = 5,
-    SRA_PACBIO_HOLE_FBZMW = 6,
-    SRA_PACBIO_HOLE_ANTIBEAMLET = 7,
-    SRA_PACBIO_HOLE_OUTSIDEFOV = 8
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sra_pacbio_ */
diff --git a/interfaces/sra/path-extern.h b/interfaces/sra/path-extern.h
deleted file mode 100644
index 26f671c..0000000
--- a/interfaces/sra/path-extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_path_extern_
-#define _h_sra_path_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define SRA_PATH_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define SRA_PATH_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_sra_path_extern_ */
diff --git a/interfaces/sra/pevents.vschema b/interfaces/sra/pevents.vschema
deleted file mode 100644
index 8072810..0000000
--- a/interfaces/sra/pevents.vschema
+++ /dev/null
@@ -1,91 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * NCBI Likelihood & Event schema
- */
-version 1;
-include 'vdb/vdb.vschema';
-
-typedef U8 INSDC:phred;
-typedef ascii INSDC:event:text;
-const INSDC:event:text INSDC:event:CHARSET = "ACGT0123B+-";
-const INSDC:event:text INSDC:event:ACCEPTSET = "ACGTacgt0123B+-";
-
-extern function < U32 dim >
-U32 NCBI:SRA:sort_order #1.0 ( F32[dim] likelihoods );
-
-extern function < U32 dim >
-F32 NCBI:SRA:reorder #1.0 ( U32 sort_order, F32[dim] likelihoods );
-
-extern function < U32 dim >
-F32 NCBI:SRA:restore_order #1.0 ( U32 sort_order, F32[dim] likelihoods );
-
-extern function < U32 sdim, U32 rdim >
-INSDC:phred[rdim] NCBI:SRA:likelihood_to_phred #1.0 ( F32 like_scale, F32[sdim] likelihoods );
-
-extern function < U32 sdim, U32 rdim >
-F32[rdim] NCBI:SRA:phred_to_likelihood #1.0 ( F32 like_scale, F32[sdim] phred );
-
-table NCBI:SRA:tbl:pevents #1.0
-{
-    // event labels - single character events
-    extern column
-        INSDC:event:text PEVENTS = .PEVENTS;
-
-    physical column < INSDC:event:text >
-        zip_encoding #1.0 .PEVENTS = PEVENTS;
-
-    // likelihoods
-    extern default column
-        F32[4] LIKELIHOODS = likelihoods;
-    extern readonly column
-        INSDC:phred[4] LIKELIHOODS = phred;
-
-    U32 sort_encode = NCBI:SRA:sort_order < 4 > ( LIKELIHOODS );
-
-    physical column < U32 >
-        zip_encoding #1.0 < Z_RLE > .SORT_ORDER = sort_encode;
-
-    F32 reorder = NCBI:SRA:reorder < 4 > ( sort_encode, LIKELIHOODS );
-    F32 like_scale = vdb:fixed_vec_sum < F32, 4 > ( reorder );
-
-    physical column < F32 >
-        fzip_encoding #1.0 < 4 > .SCALE = like_scale;
-
-    INSDC:phred cut_phred = NCBI:SRA:likelihood_to_phred #1.0 < 4, 3 > ( like_scale, reorder );
-
-    physical column < INSDC:phred >
-        zip_encoding #1.0 < 5 > .PHRED = cut_phred;
-
-    // normalization scaling factors
-    extern readonly column
-        F32 LIKELIHOOD_NORM = .SCALE;
-
-    // phred scores
-    extern readonly column
-        INSDC:phred[4] PHRED = phred;
-};
diff --git a/interfaces/sra/rd-extern.h b/interfaces/sra/rd-extern.h
deleted file mode 100644
index 02c2984..0000000
--- a/interfaces/sra/rd-extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_rd_extern_
-#define _h_sra_rd_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define SRA_RD_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define SRA_RD_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_sra_rd_extern_ */
diff --git a/interfaces/sra/sch-extern.h b/interfaces/sra/sch-extern.h
deleted file mode 100644
index 37d38b8..0000000
--- a/interfaces/sra/sch-extern.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_sch_extern_
-#define _h_sra_sch_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define SRA_SCH_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define SRA_SCH_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_sra_sch_extern_ */
diff --git a/interfaces/sra/sff-file.h b/interfaces/sra/sff-file.h
deleted file mode 100644
index 4b36bc3..0000000
--- a/interfaces/sra/sff-file.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_sff_file_
-#define _h_sra_sff_file_
-
-#include <klib/defs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ======================================================================
- * SFF defines an 8 bit value in the file that tells of the format of the 
- * data signal (flowgrams in Roche 454 SFF parlance).
- *
- * The only currently defined format is a 16 bit unsigned integer in
- * units one hundredths. This enum is to easily allow us to add other
- * formats if ever required.
- */
-typedef enum SFFFormatCode
-{
-    SFFFormatCodeUnset = 0,
-    /* values are 16 integers of hundreths of units: 0 = 0.00, 1 = 0.01, 2 = 0.02, ... */
-    SFFFormatCodeUI16Hundreths,
-    /* currently (SFF (00000001) yet this is the only one SFFFormatCode is defined */
-    SFFFormatCodeUndefined
-}	SFFFormatCode;
-
-/* ----------------------------------------------------------------------
- * Common Header Section 
- * (Genome Sequencer Data Analysis Software Manual Section 13.3.8.1)
- */
-#define SFFCommonHeader_size 31
-
-typedef struct SFFCommonHeader_struct
-{
-    uint32_t magic_number;         /* four bytes ".sff" as string: with wrong endian it would be "ffs." */
-    uint32_t version;              /* four bytes 0x00000001 */
-    uint64_t index_offset;         /* index_offset and index_length are the offset and length of an */
-    uint32_t index_length;         /* optional index of the reads in the file. If no index both are 0 */
-    uint32_t number_of_reads;      /* The number of reads in the file (not individual datum) */
-    uint16_t header_length;        /* length of all headers in this set.  31 + flow_length + key_length + pad to 8 byte boundary */
-    uint16_t key_length;           /* length of the key sequence for these reads */
-    uint16_t num_flows_per_read;   /* the number of flows for each read in this file */
-    uint8_t  flowgram_format_code; /* SFFFormatCode between (SFFFormatCodeUnset..FormateCodeUndefined) exclusive */
-    /* not included variable length portion of header:
-        flow chars   - sequence of uint8_t, actual length is num_flows_per_read above
-        key sequence - sequence of uint8_t, actual length is key_length above
-        padding      - sequence of zeroed uint8_t to make total length of file header 8-byte padded
-    */
-} SFFCommonHeader;
-
-/* ----------------------------------------------------------------------
- * Read Header Section 
- * (Genome Sequencer Data Analysis Software Manual Section 13.3.8.2)
- */
-#define SFFReadHeader_size 16
-
-typedef struct SFFReadHeader_struct
-{
-    uint16_t    header_length;            /* length in bytes of the full section including padding */
-    uint16_t    name_length;            /* length of the name of this spot */
-    uint32_t    number_of_bases;
-    uint16_t    clip_quality_left;
-    uint16_t    clip_quality_right;
-    uint16_t    clip_adapter_left;
-    uint16_t    clip_adapter_right;
-    /* not included variable length portion of header:
-        name    - sequence of uint8_t, actual length is name_length above
-        padding - sequence of zeroed uint8_t to make total length of read header 8-byte padded
-
-        read data section:
-
-        signal - sequence of uint16_t (if flowgram_format_code == SFFFormatCodeUI16Hundreths, see enum above),
-                 actual length is num_flows_per_read from file header above
-        flow_index_per_base (position) - sequence of uint8_t, actual length in number_of_bases above
-        bases - sequence of uint8_t, actual length in number_of_bases above
-        quality_scores - sequence of uint8_t, actual length in number_of_bases above
-        padding - sequence of zeroed uint8_t to make total length of read data section 8-byte padded
-    */
-} SFFReadHeader;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_sff_file_ */
diff --git a/interfaces/sra/sff.h b/interfaces/sra/sff.h
deleted file mode 100644
index b958d49..0000000
--- a/interfaces/sra/sff.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_sff_
-#define _h_sra_sff_
-
-#ifndef _h_sra_rd_extern_
-#include <sra/rd-extern.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SFFReader
- */
-typedef struct SFFReader SFFReader;
-
-/* Make
- *  create SFFReader reference based
- *  on table and properties:
- *     table      - SRATable
- *     accession  - accession
- *     minSpotId  - starting spot id, 0 - ignored (run information used)
- *     maxSpotId  - ending spot id, 0 - ignored (run information used)
- *                  you cannot seek out of range of [minSpotId:maxSpotId]
- */
-SRA_RD_EXTERN rc_t CC SFFReaderMake(const SFFReader** self, const SRATable* table, const char* accession,
-                                    spotid_t minSpotId, spotid_t maxSpotId);
-
-/* Whack
- *  releases object obtained from SFFReaderMake
- */
-SRA_RD_EXTERN rc_t CC SFFReaderWhack(const SFFReader* self);
-
-/* FirstSpot
- *  set current spot to first in the run
- */
-SRA_RD_EXTERN rc_t CC SFFReaderFirstSpot(const SFFReader* self);
-
-/* SeekSpot
- *  set current spot
- * if error occured current spot position becomes 0
- */
-SRA_RD_EXTERN rc_t CC SFFReaderSeekSpot(const SFFReader* self, spotid_t spot);
-
-/* NextSpot
- *  Seek to next spot from current
- */
-SRA_RD_EXTERN rc_t CC SFFReaderNextSpot(const SFFReader* self);
-
-/* CurrentSpot
- *  Get current spot
- *  sopt [OUT] - pointer to assign value of the current spot
- * returns GetRCState(rc) == rcExhausted when out of spots
- */
-SRA_RD_EXTERN rc_t CC SFFReaderCurrentSpot(const SFFReader* self, spotid_t* spot);
-
-/* SpotInfo
- *  Get current spot information
- *  spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
- *  spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
- *  num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
- */
-SRA_RD_EXTERN rc_t CC SFFReader_SpotInfo(const SFFReader* self, const char** spotname, size_t* spotname_sz,
-                                         uint32_t* spot_len, uint32_t* num_reads);
-
-/* SpotReadInfo
- *  Get read information for current spot
- *  readid    [IN]  - 1-based read id
- *  read_label[OUT] - pointer to assign value of the read label (can be NULL)
- *  read_type [OUT] - pointer to assign value of the read type (can be NULL)
- *  read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
- *  read_len  [OUT] - pointer to assign value of the read length (can be NULL)
- *  cskey     [OUT] - pointer to assign value of the read color space key (can be NULL)
- *  if start and len is == 0 read is empty
- */
-SRA_RD_EXTERN rc_t CC SFFReader_SpotReadInfo(const SFFReader* self, uint32_t readId, SRAReadTypes* read_type,
-                                             const char** read_label, INSDC_coord_len* read_label_sz,
-                                             INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
-
-/* Header
- *  retrieve binary file header
- *  spots [IN,OPT]   - sets number of reads in header, ignored if spots == 0
- *  data [IN]        - pointer to buffer for printing
- *  dsize [IN]       - data buffer size
- *  written [IN,OUT] - number of bytes occupied by data, may by more than dsize
- */
-SRA_RD_EXTERN rc_t CC SFFReaderHeader(const SFFReader* self, spotid_t spots, char* data, size_t dsize, size_t* written);
-
-/* Base
- *  retrieve bases for the spot
- *  other parameters see description for SFFReaderHeader above
- */
-SRA_RD_EXTERN rc_t CC SFFReaderReadHeader(const SFFReader* self, char* data, size_t dsize, size_t* written);
-
-/* QualityName
- *  retrieve quality name string for the spot
- *  other parameters see description for SFFReaderHeader above
- */
-SRA_RD_EXTERN rc_t CC SFFReaderReadData(const SFFReader* self, char* data, size_t dsize, size_t* written);
-
-/* GetCurrentSpotData
- *  retrieve current spot data as a blob
- *  other parameters see description for SFFReaderHeader above
- */
-SRA_RD_EXTERN rc_t CC SFFReader_GetCurrentSpotData(const SFFReader* self, char* data, size_t dsize, size_t* written);
-
-/* GetNextSpotData (streaming function)
- *  move to the next spot and retrieve current spot data as a blob
- *  other parameters see description for SFFReaderHeader above
- */ 
-SRA_RD_EXTERN rc_t CC SFFReader_GetNextSpotData(const SFFReader* self, char* data, size_t dsize, size_t* written);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_sff_ */
diff --git a/interfaces/sra/sradb-priv.h b/interfaces/sra/sradb-priv.h
deleted file mode 100644
index 8fdf027..0000000
--- a/interfaces/sra/sradb-priv.h
+++ /dev/null
@@ -1,407 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_sradb_priv_
-#define _h_sra_sradb_priv_
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_text
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_vector
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifndef _h_sra_srapath_
-#include <sra/srapath.h>
-#endif
-
-#ifndef _h_sra_path_extern_
-#include <sra/path-extern.h>
-#endif
-
-#ifndef _h_sra_sch_extern_
-#include <sra/sch-extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct KDirectory;
-struct KDBManager;
-struct KTable;
-struct KLock;
-struct KConfig;
-struct VDBManager;
-struct VTable;
-struct VSchema;
-struct SRAPath;
-struct SRACacheUsage;
-struct SRACacheMetrics;
-/*--------------------------------------------------------------------------
- * SRAMgr
- *  opaque handle to SRA library
- */
- 
-/*  SRAMgrResolve
- *  Convert accession name into a file system path
- */
- 
-SRA_EXTERN rc_t CC SRAMgrResolve( const SRAMgr *self, const char* acc, char* buf, size_t buf_size );
-
-/* Flush
- *  flushes least recently used accessions until the cache size is under the specified threshold
- */
-SRA_EXTERN rc_t CC SRAMgrFlush ( struct SRAMgr const *self, const struct SRACacheMetrics* );
-
-/* RunBGTasks
- *  perform single pass of garbage collection tasks and exit.
- *  also retrieves and processes update messages.
- */
-SRA_EXTERN rc_t CC SRAMgrRunBGTasks ( struct SRAMgr const *self );
-
-/* GetVDBManager
- *  returns a new reference to VDBManager used by SRAMgr
- */
-SRA_EXTERN rc_t CC SRAMgrGetVDBManagerRead ( const SRAMgr *self, struct VDBManager const **vmgr );
-SRA_EXTERN rc_t CC SRAMgrGetVDBManagerUpdate ( SRAMgr *self, struct VDBManager **vmgr );
-
-/* GetKDBManager
- *  returns a new reference to KDBManager used indirectly by SRAMgr
- */
-SRA_EXTERN rc_t CC SRAMgrGetKDBManagerRead ( const SRAMgr *self, struct KDBManager const **kmgr );
-SRA_EXTERN rc_t CC SRAMgrGetKDBManagerUpdate ( SRAMgr *self, struct KDBManager **kmgr );
-
-/* ModDate
- *  return a modification timestamp for table
- */
-SRA_EXTERN rc_t CC SRAMgrVGetTableModDate ( const SRAMgr *self,
-    KTime_t *mtime, const char *spec, va_list args );
-
-SRA_EXTERN rc_t CC SRAMgrGetTableModDate ( const SRAMgr *self,
-    KTime_t *mtime, const char *spec, ... );
-
-/* ConfigReload
- *  update SRAPath object
- */
-SRA_EXTERN rc_t CC SRAMgrConfigReload( const SRAMgr *self, struct KDirectory const *wd );
-
-/* 
- *  Accession Cache usage stats
- */
-SRA_EXTERN rc_t CC SRAMgrGetCacheUsage( const SRAMgr *self, struct SRACacheUsage* stats );
-
-/* 
- *  Configure Accession Cache 
- *  soft_threshold, hard_threshold - new threshold values ( -1 : do not change; < -1 invalid )
- */
-SRA_EXTERN rc_t CC SRAMgrConfigureCache( const SRAMgr *self,  int32_t soft_threshold, int32_t hard_threshold );
-
-/*--------------------------------------------------------------------------
- * SRATable
- */
-
-/* OpenAltTableRead
- *  opens a table within a database structure with a specific name
- */
-SRA_EXTERN rc_t CC SRAMgrOpenAltTableRead ( const SRAMgr *self,
-    const SRATable **tbl, const char *altname, const char *spec, ... );
-
-/* GetVTable
- *  returns a new reference to underlying VTable
- */
-SRA_EXTERN rc_t CC SRATableGetVTableRead ( const SRATable *self, struct VTable const **vtbl );
-SRA_EXTERN rc_t CC SRATableGetVTableUpdate ( SRATable *self, struct VTable **vtbl );
-
-/* GetKTable
- *  returns a new reference to underlying KTable
- */
-SRA_EXTERN rc_t CC SRATableGetKTableRead ( const SRATable *self, struct KTable const **ktbl );
-SRA_EXTERN rc_t CC SRATableGetKTableUpdate ( SRATable *self, struct KTable **ktbl );
-
-
-/* MakeSingleFileArchive
- *  makes a single-file-archive file from an SRA table
- *
- *  contents are ordered by frequency and necessity of access
- *
- *  "lightweight" [ IN ] - when true, include only those components
- *  required for read and quality operations.
- *
- *  "ext" [OUT,NULL] - optional file name extension to use for file
- */
-SRA_EXTERN rc_t CC SRATableMakeSingleFileArchive ( const SRATable *self,
-    struct KFile const **sfa, bool lightweight, const char** ext );
-
-/* SingleFileArchiveExt
- *  retrieve archive extension based on object in the spec
- */
-SRA_EXTERN rc_t CC SRAMgrSingleFileArchiveExt(const SRAMgr *self,
-    const char* spec, const bool lightweight, const char** ext);
-/*--------------------------------------------------------------------------
- * SRAPath
- */
-
-/* FindWithRepLen
- *  finds location of run within rep-server/volume matrix
- *  returns length of rep-server portion
- */
-SRA_EXTERN rc_t CC SRAPathFindWithRepLen ( struct SRAPath const *self,
-    const char *accession, char *path, size_t path_max, size_t *rep_len );
-
-
-
-/*--------------------------------------------------------------------------
- * SRASchema
- */
-
-SRA_SCH_EXTERN rc_t CC SRASchemaMake ( struct VSchema **schema, struct VDBManager const *mgr );
-
-
-#if 0
-
-/*--------------------------------------------------------------------------
- * SRATableData  - DEPRECATED
- *  a collection of spots with several data series, minimally including
- *  base or color calls and their quality ( confidence ) values, and
- *  optionally signal-related values ( signal, intensity, noise, ... ).
- */
-union NucStrstr;
-
-typedef struct SRASpotStructure SRASpotStructure;
-struct SRASpotStructure
-{ 
-    /* preformatted query expression
-       for fixed_seq when search is needed */
-    union NucStrstr *q_str;
-
-    /* read of fixed len if != 0
-       either teminated by fixed_seq or by the end */
-    uint16_t fixed_len;
-
-    /* SRAReadTypes */
-	uint8_t read_type;
-
-    /* colorspace key */
-    char cs_key;
-
-    char fixed_seq [ 1024 ];
-
-    /* label for the read */
-    char read_label [ 54 ];
-
-};
-
-typedef struct SRASpotCoord SRASpotCoord;
-struct SRASpotCoord
-{
-    uint32_t x, y, tile;
-	uint32_t  lane;
-	spotid_t id;
-
-    /* prefix part of spotname */
-	uint32_t platename_len;
-	char spotname [ 1024 ];
-
-};
-
-typedef struct SRATableData SRATableData;
-struct SRATableData
-{
-	uint64_t base_count;
-	uint64_t spot_count;
-	uint64_t bad_spot_count;
-	spotid_t max_spotid;
-
-    /* the spot is always fixed len read */
-	uint32_t fixed_len;
-
-    /* number of reads per spot */
-	uint32_t num_reads;
-
-    /* read mask containing bio reads */
-	uint32_t read_mask_bio;
-
-    /* read description */
-	SRASpotStructure read_descr [ 32 ];
-    uint16_t read_len [ 32 ];
-
-    /* platform type and name */
-	uint8_t platform;
-	char platform_str [ 31 ];
-
-	uint16_t prefix_len;
-
-    /* spot coordinates */
-	SRASpotCoord coord;
-
-};
-
-/* GetTableData
- *  returns a pointer to internal table data
- *  or NULL if "self" is invalid
- *
- * NB - THIS OBJECT IS NOT REFERENCE COUNTED
- */
-SRA_EXTERN const SRATableData *CC SRATableGetTableData ( const SRATable *self );
-
-#endif
-
-/*--------------------------------------------------------------------------
- * SRA Accession Cache
- */
-struct SRACacheIndex;
-
-typedef struct SRACacheMetrics
-{   
-    uint32_t elements; /* open accessions */
-    
-    /* not in use currently: */
-    uint64_t bytes; /* expanded cache bytes, i.e. cursor */
-    uint32_t threads;
-    uint32_t fds;
-} SRACacheMetrics;
-
-#define SRACacheThresholdSoftBytesDefault       ((uint64_t)0)
-#define SRACacheThresholdSoftElementsDefault    ((uint32_t)1000)
-#define SRACacheThresholdSoftThreadsDefault     ((uint32_t)0)
-#define SRACacheThresholdSoftFdsDefault         ((uint32_t)0)
-
-#define SRACacheThresholdHardBytesDefault       ((uint64_t)0)
-#define SRACacheThresholdHardElementsDefault    ((uint32_t)10000)
-#define SRACacheThresholdHardThreadsDefault     ((uint32_t)0)
-#define SRACacheThresholdHardFdsDefault         ((uint32_t)0)
-
-SRA_EXTERN bool CC SRACacheMetricsLessThan(const SRACacheMetrics* a, const SRACacheMetrics* b);
-
-typedef struct SRACacheElement 
-{
-    DLNode dad;
-    
-    SRATable*   object;
-    
-    KTime_t lastAccessed;
-    
-    struct SRACacheIndex* index;
-    uint32_t key;
-
-    SRACacheMetrics metrics;
-} SRACacheElement;
-
-SRA_EXTERN rc_t CC SRACacheElementMake(SRACacheElement**        self, 
-                                       SRATable*                object, 
-                                       struct SRACacheIndex*    index, 
-                                       uint32_t                 key, 
-                                       const SRACacheMetrics*   metrics);
-SRA_EXTERN rc_t CC SRACacheElementDestroy(SRACacheElement* self);
-
-typedef struct SRACacheIndex
-{
-    BSTNode dad;
-    
-    String* prefix;
-    KVector* body; /* KVector<SRACacheElement*> */
-} SRACacheIndex;
-
-SRA_EXTERN rc_t CC SRACacheIndexMake(SRACacheIndex** self, String* prefix);
-SRA_EXTERN rc_t CC SRACacheIndexDestroy(SRACacheIndex* self);
-
-typedef struct SRACacheUsage {
-    /* config */
-    uint32_t soft_threshold;
-    uint32_t hard_threshold;    
-    /* usage stats */ 
-    uint32_t elements;
-    uint64_t requests;
-    uint64_t hits;
-    uint64_t misses;
-    uint64_t busy;
-} SRACacheUsage;
-
-typedef struct SRACache
-{
-    BSTree indexes; /* grows as needed */
-
-    DLList lru; /* DLList<SRACacheElement*>;  head is the oldest */
-    
-    struct KLock* mutex; 
-
-    SRACacheMetrics softThreshold;
-    SRACacheMetrics hardThreshold;
-    SRACacheMetrics current;
-    
-    uint64_t requests;
-    uint64_t hits;
-    uint64_t misses;
-    uint64_t busy;
-} SRACache;
-
-SRA_EXTERN rc_t CC SRACacheInit(SRACache**, struct KConfig*);
-
-SRA_EXTERN rc_t CC SRACacheGetSoftThreshold(SRACache* self, SRACacheMetrics* metrics);
-SRA_EXTERN rc_t CC SRACacheSetSoftThreshold(SRACache* self, const SRACacheMetrics* metrics);
-
-SRA_EXTERN rc_t CC SRACacheGetHardThreshold(SRACache* self, SRACacheMetrics* metrics);
-SRA_EXTERN rc_t CC SRACacheSetHardThreshold(SRACache* self, const SRACacheMetrics* metrics);
-
-SRA_EXTERN rc_t CC SRACacheGetUsage(SRACache* self, SRACacheUsage* usage);
-
-/* flush tables until usage is lower than specified in self->softThreshold */
-SRA_EXTERN rc_t CC SRACacheFlush(SRACache* self); 
-
-/* 
-    if found, moves element to the back of the list; return NULL object if not in the cache 
-    if found but the refcount is not 1, returns RC( rcSRA, rcData, rcAccessing, rcParam, rcBusy)
-*/
-SRA_EXTERN rc_t CC SRACacheGetTable(SRACache* self, const char* acc, const SRATable** object); 
-
-/* 
- * fails if table is already in the cache.
- * Does not affect usage stats.
- */
-SRA_EXTERN rc_t CC SRACacheAddTable(SRACache* self, const char* acc, SRATable*); 
-
-SRA_EXTERN rc_t CC SRACacheWhack(SRACache* self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_sradb_priv_ */
diff --git a/interfaces/sra/sradb.h b/interfaces/sra/sradb.h
deleted file mode 100644
index 747a109..0000000
--- a/interfaces/sra/sradb.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_sradb_
-#define _h_sra_sradb_
-
-#ifndef _h_sra_extern_
-#include <sra/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_insdc_insdc_
-#include <insdc/insdc.h>
-#endif
-
-#ifndef _h_insdc_sra_
-#include <insdc/sra.h>
-#endif
-
-#include <stdarg.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VSchema;
-struct VTypedef;
-struct VTypedecl;
-struct VDatatypes;
-struct KMDataNode;
-struct KDirectory;
-struct SRANamelist;
-
-
-/*--------------------------------------------------------------------------
- * version
- *  current API version is 3.1
- */
-#define SRADB_CURRENT_VERSION 0x03010000
-
-
-/*--------------------------------------------------------------------------
- * spotid_t
- *  a 1-based integer spot identifier
- *  unique within table
- *  see <insdc/sra.h>
- */
-typedef INSDC_SRA_spotid_t spotid_t;
-
-
-/*--------------------------------------------------------------------------
- * REFERENCE COUNTING
- *  most objects used in the API are reference counted.
- *
- *  all functions that return an object return an original reference
- *  to that object ( unless otherwise noted ).
- *
- *  *Release functions are used to discard a reference. under normal
- *  operation objects will be returned by an API function and freed via
- *  the corresponding release.
- *
- *  *AddRef functions are used to attach an additional reference to
- *  an object, which increases the number of *Release messages needed
- *  to actually free an object. manipulating the reference count of an
- *  object is not normally required.
- */
-
-
-/*--------------------------------------------------------------------------
- * SRAMgr
- *  opaque handle to SRA library
- */
-typedef struct SRAMgr SRAMgr;
-
-
-/* MakeRead
- *  create library reference for read-only access
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference
- *
- *  NB - not implemented in update libary
- *  and the read-only library may not be mixed with read/write
- */
-SRA_EXTERN rc_t CC SRAMgrMakeRead ( const SRAMgr **mgr );
-SRA_EXTERN rc_t CC SRAMgrMakeReadWithDir ( const SRAMgr **mgr, struct KDirectory const *wd );
-
-
-/* Release
- *  releases reference to object
- *  obtained from MakeRead, MakeUpdate,
- *  or AddRef ( see above )
- */
-SRA_EXTERN rc_t CC SRAMgrRelease ( const SRAMgr *self );
-
-
-/* AddRef
- *  attach a new reference to an existing object
- *  ( see above )
- */
-SRA_EXTERN rc_t CC SRAMgrAddRef ( const SRAMgr *self );
-
-
-/* Version
- *  returns the library version
- */
-SRA_EXTERN rc_t CC SRAMgrVersion ( const SRAMgr *self, uint32_t *version );
-
-
-/* OpenDatatypes - DEPRECATED
- *  open datatype registry object for requested access
- *
- *  "dt" [ OUT ] - return parameter for datatypes object
- */
-SRA_EXTERN rc_t CC SRAMgrOpenDatatypesRead ( const SRAMgr *self,
-    struct VDatatypes const **dt );
-
-
-/* GetSchema
- *  get a reference to the schema used to create new tables
- *
- *  "schema" [ OUT ] - return parameter for reference to SRA schema
- *
- * NB - returns a new reference that must be released via VSchemaRelease
- */
-SRA_EXTERN rc_t CC SRAMgrGetSchemaRead ( const SRAMgr *self, struct VSchema const **schema );
-
-
-/* UseSchema
- *  allows SRA schema to be entirely replaced
- *  affects creation/update of all subsequent tables
- *
- *  "schema" [ IN ] - new schema to be applied
- *
- * NB - manager will attach a new reference to schema object,
- *  you are still responsible for releasing it via VSchemaRelease
- */
-SRA_EXTERN rc_t CC SRAMgrUseSchemaRead ( const SRAMgr *self, struct VSchema const *schema );
-
-
-/* Writable
- *  returns 0 if table is writable
- *  rcLocked if locked, rcReadonly if read-only
- *  other code upon error
- *
- *  "path" [ IN ] - NUL terminated table path
- */
-SRA_EXTERN rc_t CC SRAMgrWritable ( const SRAMgr *self, const char *path, ... );
-SRA_EXTERN rc_t CC SRAMgrVWritable ( const SRAMgr *self, const char *path, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * SRANamelist
- */
-typedef struct SRANamelist SRANamelist;
-
-/* AddRef
- * Release
- *  see REFERENCE COUNTING, above
- */
-SRA_EXTERN rc_t CC SRANamelistAddRef ( const SRANamelist *self );
-SRA_EXTERN rc_t CC SRANamelistRelease ( const SRANamelist *self );
-
-
-/* Count
- *  gets the number of names
- *
- *  "count" [ OUT ] - return value
- */
-SRA_EXTERN rc_t CC SRANamelistCount ( const SRANamelist *self, uint32_t *count );
-
-
-/* Get
- *  gets an indexed name
- *
- *  "idx" [ IN ] - zero-based name index
- *
- *  "name" [ OUT ] - return parameter for NUL terminated name
- */
-SRA_EXTERN rc_t CC SRANamelistGet ( const SRANamelist *self,
-    uint32_t idx, const char **name );
-    
-    
-/*--------------------------------------------------------------------------
- * SRATable
- *  a collection of spots with several data series, minimally including
- *  base or color calls and their quality ( confidence ) values, and
- *  optionally signal-related values ( signal, intensity, noise, ... ).
- *
- *  to discover the series available, use "SRATableListCol" to get
- *  the names, and "SRATableColDatatypes" to list data types available
- *  for each name.
- *
- *  see below for standard readable columns
- */
-typedef struct SRATable SRATable;
-
-/* AddRef
- * Release
- *  see REFERENCE COUNTING, above
- */
-SRA_EXTERN rc_t CC SRATableAddRef ( const SRATable *self );
-SRA_EXTERN rc_t CC SRATableRelease ( const SRATable *self );
-
-
-/* OpenRead
- *  open an existing table
- *
- *  "tbl" [ OUT ] - return parameter for table
- *
- *  "spec" [ IN ] - NUL terminated UTF-8 string giving path
- *  to table.
- */
-SRA_EXTERN rc_t CC SRAMgrOpenTableRead ( const SRAMgr *self,
-    const SRATable **tbl, const char *spec, ... );
-SRA_EXTERN rc_t CC SRAMgrVOpenTableRead ( const SRAMgr *self,
-    const SRATable **tbl, const char *spec, va_list args );
-
-/* Locked
- *  returns true if locked
- */
-SRA_EXTERN bool CC SRATableLocked ( const SRATable *self );
-
-
-/* BaseCount
- *  get the number of stored bases
- *
- *  "num_bases" [ OUT ] - return parameter for base count
- */
-SRA_EXTERN rc_t CC SRATableBaseCount ( const SRATable *self, uint64_t *num_bases );
-
-
-/* SpotCount
- *  get the number of stored spots
- *
- *  "spot_count" [ OUT ] - return parameter for spot count
- */
-SRA_EXTERN rc_t CC SRATableSpotCount ( const SRATable *self, uint64_t *spot_count );
-
-
-/* MinSpotId
- *  returns the minimum spot id
- *
- *  a table will contain a collection of spots with ids from
- *  min(spot_id) to max(spot_id) unless empty.
- *
- *  "id" [ OUT ] - return parameter of last spot id
- *  or zero if the table is empty.
- */
-SRA_EXTERN rc_t CC SRATableMinSpotId ( const SRATable *self, spotid_t *id );
-
-/* MaxSpotId
- *  returns the maximum spot id
- *
- *  a table will contain a collection of spots with ids from
- *  1 to max ( spot_id ) unless empty.
- *
- *  "id" [ OUT ] - return parameter of last spot id
- *  or zero if the table is empty.
- */
-SRA_EXTERN rc_t CC SRATableMaxSpotId ( const SRATable *self, spotid_t *id );
-
-
-/* GetSpotId
- *  convert spot name to spot id
- *  may fail if original textual spot name is not present
- *
- *  "id" [ OUT ] - return parameter for 1-based spot id
- *
- *  "spot_name" [ IN ] - external spot name string
- *  in platform canonical format.
- */
-SRA_EXTERN rc_t CC SRATableGetSpotId ( const SRATable *self,
-    spotid_t *id, const char *spot_name );
-
-
-/* ListCol
- *  returns a list of simple column names
- *  each name represents at least one typed column
- *
- *  "names" [ out ] - return parameter for names list
- */
-SRA_EXTERN rc_t CC SRATableListCol ( const SRATable *self, SRANamelist **names );
-
-
-/* ColDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
- *  into "typedecls" of the default datatype for the named column
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- */
-SRA_EXTERN rc_t CC SRATableColDatatypes ( const SRATable *self, const char *col,
-    uint32_t *dflt_idx, SRANamelist **typedecls );
-
-
-/* MetaRevision
- *  returns current revision number
- *  where 0 ( zero ) means tip
- */
-SRA_EXTERN rc_t CC SRATableMetaRevision ( const SRATable *self, uint32_t *revision );
-
-
-/* MaxRevision
- *  returns the maximum revision available
- */
-SRA_EXTERN rc_t CC SRATableMaxMetaRevision ( const SRATable *self, uint32_t *revision );
-
-
-/* UseMetaRevision
- *  opens indicated revision of metadata
- *  all non-zero revisions are read-only
- */
-SRA_EXTERN rc_t CC SRATableUseMetaRevision ( const SRATable *self, uint32_t revision );
-
-
-/* OpenMDataNode
- *  open a metadata node
- *
- *  "node" [ OUT ] - return parameter for metadata node
- *
- *  "path" [ IN ] - simple or hierarchical NUL terminated
- *  path to node
- */
-SRA_EXTERN rc_t CC SRATableOpenMDataNodeRead ( const SRATable *self,
-    struct KMDataNode const **node, const char *path, ... );
-SRA_EXTERN rc_t CC SRATableVOpenMDataNodeRead ( const SRATable *self,
-    struct KMDataNode const **node, const char *path, va_list args );
-
-
-/*  SRATableGetSchema
- *  returns current schema of the open cursor
- */
-SRA_EXTERN struct VSchema const* CC SRATableGetSchema ( const SRATable *self );
-
-
-
-/*--------------------------------------------------------------------------
- * SRAColumn
- *  represents a spot data column, where the column is configured as
- *  a sequence of blobs, and each blob is a sequence of records,
- *  indexed by spot id.
- */
-typedef struct SRAColumn SRAColumn;
-
-/* AddRef
- * Release
- *  see REFERENCE COUNTING, above
- */
-SRA_EXTERN rc_t CC SRAColumnAddRef ( const SRAColumn *self );
-SRA_EXTERN rc_t CC SRAColumnRelease ( const SRAColumn *self );
-
-
-/* OpenColumnRead
- *  open a column for read
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
- *
- *  "datatype" [ IN, NULL OKAY ] - optional NUL terminated typedecl
- *  string describing fully qualified column data type, or if NULL
- *  the default type for column.
- */
-SRA_EXTERN rc_t CC SRATableOpenColumnRead ( const SRATable *self,
-    const SRAColumn **col, const char *name, const char *datatype );
-
-
-/* Datatype
- *  access data type
- *
- *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
- *
- *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
- *  returned in "type_decl"
- *
- * NB - one of "type" and "def" must be non-NULL
- */
-SRA_EXTERN rc_t CC SRAColumnDatatype ( const SRAColumn *self,
-    struct VTypedecl *type, struct VTypedef *def );
-
-
-/* GetRange
- *  get a contiguous range around a spot id, e.g. tile for Illumina
- *
- *  "id" [ IN ] - return parameter for 1-based spot id
- *
- *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-SRA_EXTERN rc_t CC SRAColumnGetRange ( const SRAColumn *self,
-    spotid_t id, spotid_t *first, spotid_t *last );
-
-
-/* Read
- *  read row data
- *
- *  "id" [ IN ] - spot row id between 1 and max ( spot id )
- *
- *  "base" [ OUT ] and "offset" [ OUT ] - pointer and bit offset
- *  to start of spot row data.
- *
- *  "size" [ OUT ] - size in bits of row data
- */
-SRA_EXTERN rc_t CC SRAColumnRead ( const SRAColumn *self, spotid_t id,
-    const void **base, bitsz_t *offset, bitsz_t *size );
-
-
-
-/*--------------------------------------------------------------------------
- * SRA column formatted type descriptions
- *
- *  most datatypes are constructed as vectors, rather than structures.
- *  this permits flexibility in data transformations and removes compiler
- *  dependency in layout.
- */
-
-
-/* SRAPlatforms
- *  see <insdc/sra.h>
- */
-typedef INSDC_SRA_platform_id SRAPlatforms;
-
-
-/* SRAReadTypes
- *  read type bits
- *  see <insdc/sra.h>
- */
-typedef INSDC_SRA_xread_type SRAReadTypes;
-
-
-/* SRAReadFilter
- *  read filter attribute bits
- *  see <insdc/sra.h>
- */
-typedef INSDC_SRA_read_filter SRAReadFilter;
-
-
-/* SRASpotDesc - DEPRECATED
- *  a structure returned by SPOT_DESC column
- */
-#define sra_spot_desc_t "NCBI:SRA:SpotDesc"
-typedef struct SRASpotDesc SRASpotDesc;
-struct SRASpotDesc
-{
-    /* lengths in bases */
-    uint16_t spot_len;
-    uint16_t fixed_len;
-    uint16_t signal_len;
-
-    /* quality clips */
-    uint16_t clip_qual_right;
-
-    /* number of reads per spot */
-    uint8_t num_reads;
-
-    /* pad out to have 16 byte structure size */
-    uint8_t align [ 7 ];
-};
-
-/* SRASegment - DEPRECATED
- *  a paired starting coordinate and length
- */
-#define sra_segment_t "NCBI:SRA:Segment"
-typedef struct SRASegment SRASegment;
-struct SRASegment
-{
-    uint16_t start;
-    uint16_t len;
-};
-
-/* SRAReadDesc - DEPRECATED
- *  a structure 
- */
-#define sra_read_desc_t "NCBI:SRA:ReadDesc"
-typedef struct SRAReadDesc SRAReadDesc;
-struct SRAReadDesc
-{
-    /* location and length in bases of read
-       within READ and QUALITY columns */
-    SRASegment seg;
-
-    /* read type from SRAReadTypes */
-    uint8_t type;
-
-    /* optional color space key */
-    char cs_key;
-
-    /* NUL terminated read label */
-    char label [ 74 ];
-};
-
-/* SRAPhredPair
- *  pairs an event character with a phred score
- *  event characters are "ACGT0123B+-"
- */
-#define sra_phred_pair_t "NCBI:SRA:PhredPair"
-typedef struct SRAPhredPair SRAPhredPair;
-struct SRAPhredPair
-{
-    char event;
-    INSDC_quality_phred phred;
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_sradb_ */
diff --git a/interfaces/sra/sradb.hpp b/interfaces/sra/sradb.hpp
deleted file mode 100644
index 2bb3b5b..0000000
--- a/interfaces/sra/sradb.hpp
+++ /dev/null
@@ -1,441 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_sra_sradb_
-#define _hpp_sra_sradb_
-
-#ifdef _hpp_sra_wsradb_
-#error "read and update libraries are mutually exclusive"
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SRAMgr
- *  opaque handle to SRA library
- */
-struct SRAMgr
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw ()
-    { return SRAMgrAddRef ( this ); }
-
-    inline rc_t Release () const throw ()
-    { return SRAMgrRelease ( this ); }
-
-
-    /* Make
-     *  create library handle for read-only access
-     *
-     *  NB - not implemented in read/write library,
-     *  and the read-only library may not be mixed with read/write
-     */
-    static inline rc_t Make ( const SRAMgr **mgr ) throw ()
-    { return SRAMgrMakeRead ( mgr ); }
-    static inline rc_t Make ( const SRAMgr **mgr, const KDirectory *wd ) throw ()
-    { return SRAMgrMakeReadWithDir ( mgr, wd ); }
-
-
-    /* Version
-     *  returns the library version
-     */
-    inline rc_t Version ( uint32_t *version ) const throw ()
-    { return SRAMgrVersion ( this, version ); }
-
-
-    /* OpenDatatypes
-     *  open datatype registry object for requested access
-     *  see <vdb/types.hpp> for VDatatypes
-     *
-     *  "dt" [ OUT ] - return parameter for datatypes object
-     */
-    inline rc_t OpenDatatypes ( const VDatatypes **dt ) const throw ()
-    { return SRAMgrOpenDatatypesRead ( this, dt ); }
-
-
-    /* GetSchema
-     *  get a reference to the schema used to create new tables
-     *
-     *  "schema" [ OUT ] - return parameter for reference to SRA schema
-     *
-     * NB - returns a new reference that must be released via VSchemaRelease
-     */
-    inline rc_t GetSchemaRead ( const VSchema **schema ) const throw ()
-    { return SRAMgrGetSchemaRead ( this, schema ); }
-
-
-    /* UseSchema
-     *  allows SRA schema to be entirely replaced
-     *  affects creation/update of all subsequent tables
-     *
-     *  "schema" [ IN ] - new schema to be applied
-     *
-     * NB - manager will attach a new reference to schema object,
-     *  you are still responsible for releasing it via VSchemaRelease
-     */
-    inline rc_t UseSchemaRead ( const VSchema *schema ) const throw ()
-    { return SRAMgrUseSchemaRead ( this, schema ); }
-
-
-    /* Writable
-     *  returns 0 if table is writable
-     *  rcLocked if locked, rcReadonly if read-only
-     *  other code upon error
-     *
-     *  "path" [ IN ] - NUL terminated table path
-     */
-    inline bool Writable ( const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        bool locked = SRAMgrVWritable ( this, path, args );
-        va_end ( args );
-        return locked;
-    }
-    inline bool Writable ( const char *path, va_list args ) const throw ()
-    { return SRAMgrVWritable ( this, path, args ); }
-
-
-    /* OpenTable
-     *  open an existing table for read
-     *
-     *  "tbl" [ OUT ] - return parameter for table
-     *
-     *  "path" [ IN ] - NUL terminated run name
-     */
-    inline rc_t OpenTable ( const SRATable **tbl,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVOpenTableRead ( this, tbl, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenTable ( const SRATable **tbl, const char *path,
-        va_list args ) const throw ()
-    { return SRAMgrVOpenTableRead ( this, tbl, path, args ); }
-    
-private:
-    SRAMgr ();
-    ~ SRAMgr ();
-    SRAMgr ( const SRAMgr& );
-    SRAMgr &operator = ( const SRAMgr& );
-};
-
-
-/*--------------------------------------------------------------------------
- * SRATable
- *  a collection of spots with several data series, minimally including
- *  base or color calls and their quality ( confidence ) values, and
- *  optionally signal-related values ( signal, intensity, noise, ... ).
- */
-struct SRATable
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw ()
-    { return SRATableAddRef ( this ); }
-
-    inline rc_t Release () const throw ()
-    { return SRATableRelease ( this ); }
-
-
-    /* Locked
-     *  returns true if locked
-     */
-    inline bool Locked () const throw ()
-    { return SRATableLocked ( this ); }
-
-
-    /* BaseCount
-     *  get the number of stored bases
-     *
-     *  "num_bases" [ OUT ] - return parameter for base count
-     */
-    inline rc_t BaseCount ( uint64_t *num_bases ) const throw ()
-    { return SRATableBaseCount ( this, num_bases ); }
-
-
-    /* SpotCount
-     *  get the number of stored spots
-     *
-     *  "spot_count" [ OUT ] - return parameter for spot count
-     */
-    inline rc_t SpotCount ( uint64_t *spot_count ) const throw ()
-    { return SRATableSpotCount ( this, spot_count ); }
-
-
-    /* MaxSpotId
-     *  returns the maximum spot id
-     *
-     *  a table will contain a collection of spots with ids from
-     *  1 to max ( spot_id ).
-     *
-     *  "id" [ OUT ] - return parameter of last spot id
-     */
-    inline rc_t MaxSpotId ( spotid_t *id ) const throw ()
-    { return SRATableMaxSpotId ( this, id ); }
-
-
-    /* MinSpotId
-     *  returns the minimum spot id
-     *
-     *  a table will contain a collection of spots with ids from
-     *  min to max ( spot_id ).
-     *
-     *  "id" [ OUT ] - return parameter of last spot id
-     */
-    inline rc_t MinSpotId ( spotid_t *id ) const throw ()
-    { return SRATableMinSpotId ( this, id ); }
-
-    /* GetSpotId
-     *  project a spot id from a spot name
-     *
-     *  "id" [ OUT ] - return parameter for 1-based spot id
-     *
-     *  "spot_name" [ IN ] - external spot name string
-     */
-    inline rc_t GetSpotId ( spotid_t *id, const char *spot_name ) const throw ()
-    { return SRATableGetSpotId ( this, id, spot_name ); }
-
-
-    /* ListCol
-     *  returns a list of column names
-     *
-     *  "names" [ out ] - return parameter for names list
-     */
-    inline rc_t ListCol ( SRANamelist **names ) const throw ()
-    { return SRATableListCol ( this, names ); }
-
-
-    /* ColDatatypes
-     *  returns list of typedecls for named column
-     *
-     *  "col" [ IN ] - column name
-     *
-     *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
-     *  into "typedecls" of the default datatype for the named column
-     *
-     *  "typedecls" [ OUT ] - list of datatypes available for named column
-     */
-    inline rc_t ColDatatypes ( const char *col,
-        uint32_t *dflt_idx, SRANamelist **typedecls ) const throw ()
-    { return SRATableColDatatypes ( this, col, dflt_idx, typedecls ); }
-
-
-    /* OpenColumn
-     *  open a column for read
-     *
-     *  "col" [ OUT ] - return parameter for newly opened column
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
-     *
-     *  "datatype" [ IN - NULL OKAY ] - optional NUL terminated
-     *   string describing fully qualified column data type in ASCII
-     */
-    inline rc_t OpenColumn ( const SRAColumn **col,
-        const char *name, const char *datatype = 0 ) const throw ()
-    { return SRATableOpenColumnRead ( this, col, name, datatype ); }
-
-
-    /* MetaRevision
-     *  returns current revision number
-     *  where 0 ( zero ) means tip
-     */
-    inline rc_t MetaRevision ( uint32_t *revision ) const throw ()
-    { return SRATableMetaRevision ( this, revision ); }
-
-
-    /* MaxRevision
-     *  returns the maximum revision available
-     */
-    inline rc_t MaxMetaRevision ( uint32_t *revision ) const throw ()
-    { return SRATableMaxMetaRevision ( this, revision ); }
-
-
-    /* UseMetaRevision
-     *  opens indicated revision of metadata
-     *  all non-zero revisions are read-only
-     */
-    inline rc_t UseMetaRevision ( uint32_t revision ) const throw ()
-    { return SRATableUseMetaRevision ( this, revision ); }
-
-
-    /* OpenMDataNode
-     *  open a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for metadata node
-     *
-     *  "path" [ IN ] - simple or hierarchical NUL terminated
-     *  path to node
-     */
-    inline rc_t OpenMDataNode ( const KMDataNode **node,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRATableVOpenMDataNodeRead ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenMDataNode ( const KMDataNode **node,
-        const char *path, va_list args ) const throw ()
-    { return SRATableVOpenMDataNodeRead ( this, node, path, args ); }
-
-
-    /*  GetSchema
-    *  returns current schema of the open cursor
-    */
-    inline struct VSchema const* GetSchema () const throw ()
-    { return SRATableGetSchema ( this ); }
-
-private:
-    SRATable ();
-    ~ SRATable ();
-    SRATable ( const SRATable& );
-    SRATable &operator = ( const SRATable& );
-};
-
-
-/*--------------------------------------------------------------------------
- * SRAColumn
- *  represents a spot data column, where the column is configured as
- *  a sequence of blobs, and each blob is a sequence of records,
- *  indexed by spot id.
- */
-struct SRAColumn
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw ()
-    { return SRAColumnAddRef ( this ); }
-
-    inline rc_t Release () const throw ()
-    { return SRAColumnRelease ( this ); }
-
-
-    /* Datatype
-     *  access data type
-     *
-     *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
-     *
-     *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
-     *  returned in "type_decl"
-     *
-     * NB - one of "type" and "def" must be non-NULL
-     */
-    inline int Datatype ( struct VTypedecl *type, struct VTypedef *def ) const throw ()
-    { return SRAColumnDatatype ( this, type, def ); }
-
-
-    /* GetRange
-     *  get a contiguous range around a spot id, e.g. tile for Illumina
-     *
-     *  "id" [ IN ] - return parameter for 1-based spot id
-     *
-     *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
-     *  id range is returned in these output parameters, where
-     *  at least ONE must be NOT-NULL
-     */
-    inline rc_t GetRange ( spotid_t id, spotid_t *first, spotid_t *last ) const throw ()
-    { return SRAColumnGetRange ( this, id, first, last ); }
-
-
-    /* Read
-     *  read row data
-     *
-     *  "id" [ IN ] - spot row id between 1 and max ( spot id )
-     *
-     *  "base" [ OUT ] and "offset" [ OUT ] - pointer and bit offset
-     *  to start of spot row data.
-     *
-     *  "size" [ OUT ] - size in bits of row data
-     */
-    inline rc_t Read ( spotid_t id,
-        const void **base, bitsz_t *offset, bitsz_t *size ) const throw ()
-    { return SRAColumnRead ( this, id, base, offset, size ); }
-
-
-private:
-    SRAColumn ();
-    ~ SRAColumn ();
-    SRAColumn ( const SRAColumn& );
-    SRAColumn &operator = ( const SRAColumn& );
-};
-
-
-/*--------------------------------------------------------------------------
- * SRANamelist
- *  a list of names, types or other strings
- */
-struct SRANamelist
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw ()
-    { return SRANamelistAddRef ( this ); }
-
-    inline rc_t Release () const throw ()
-    { return SRANamelistRelease ( this ); }
-
-
-    /* Count
-     *  gets the number of names
-     *
-     *  "count" [ OUT ] - return value
-     */
-    inline rc_t Count ( uint32_t *count ) const throw ()
-    { return SRANamelistCount ( this, count ); }
-
-
-    /* Get
-     *  gets an indexed name
-     *
-     *  "idx" [ IN ] - zero-based name index
-     *
-     *  "name" [ OUT ] - return parameter for NUL terminated name
-     */
-    inline rc_t Get ( uint32_t idx, const char **name ) const throw ()
-    { return SRANamelistGet ( this, idx, name ); }
-
-
-private:
-    SRANamelist ();
-    ~ SRANamelist ();
-    SRANamelist ( const SRANamelist& );
-    SRANamelist &operator = ( const SRANamelist& );
-};
-
-#endif // _hpp_sra_sradb_
diff --git a/interfaces/sra/srapath.h b/interfaces/sra/srapath.h
deleted file mode 100644
index 9965e8d..0000000
--- a/interfaces/sra/srapath.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_srapath_
-#define _h_sra_srapath_
-
-#ifndef _h_sra_extern_
-#include <sra/extern.h>
-#endif
-
-#ifndef _h_klib_callconv_
-#include <klib/callconv.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TOOLS_USE_SRAPATH 0
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KNamelist;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * SRAPath
- *  manages accession -> path conversion
- */
-typedef struct SRAPath SRAPath;
-
-
-/* Make
- *  create path manager
- *
- *  the path manager should already be configured with
- *  standard search paths, but can be augmented by using
- *  the Add*Path messages.
- *
- *  "dir" [ IN, NULL OKAY ] - optional root directory to use
- *  attaches a new reference
- */
-SRA_EXTERN rc_t CC SRAPathMake ( SRAPath **pm, struct KDirectory const *dir );
-
-
-/* AddRef
- * Release
- */
-SRA_EXTERN rc_t CC SRAPathAddRef ( const SRAPath *self );
-SRA_EXTERN rc_t CC SRAPathRelease ( const SRAPath *self );
-
-/* Version
- *  returns the library version
- */
-SRA_EXTERN rc_t CC SRAPathVersion ( const SRAPath *self, uint32_t *version );
-
-
-/* Clear
- *  forget existing server and volume paths for the default repository
- */
-SRA_EXTERN rc_t CC SRAPathClear ( SRAPath *self );
-
-
-/* AddRepPath
- *  add a replication path to the default repository
- *
- *  "rep" [ IN ] - NUL-terminated server search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "/panfs/traces01:/panfs/traces31"
- *
- *  NB - servers are searched in the order provided,
- *  first to last, until one of them satisfies a request,
- *  at which time the successful server is placed at the
- *  head of the search path.
- */
-SRA_EXTERN rc_t CC SRAPathAddRepPath ( SRAPath *self, const char *rep );
-
-
-/* AddVolPath
- *  add a volume path to the default repository
- *
- *  "vol" [ IN ] - NUL-terminated volume search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "sra2:sra1:sra0"
- *
- *  NB - volumes are searched in the order provided,
- *  first to last. they are never re-ordered.
- */
-SRA_EXTERN rc_t CC SRAPathAddVolPath ( SRAPath *self, const char *vol );
-
-
-/* Full
- *  creates full path from server, volume & accession
- *
- *  "rep" [ IN ] - NUL terminated full path of replication
- *  server, e.g. "/panfs/traces01"
- *
- *  "vol" [ IN ] - NUL terminated relative path of volume,
- *  e.g. "sra2"
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *  e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- */
-SRA_EXTERN rc_t CC SRAPathFull ( const SRAPath *self, const char *rep,
-    const char *vol, const char *accession, char *path, size_t path_max );
-
-
-/* Test
- *  returns true if path appears to be accession
- *  the test is a heuristic, and may return false positives
- *
- *  "path" [ IN ] - NUL terminated path to run
- */
-SRA_EXTERN bool CC SRAPathTest ( const SRAPath *self, const char *path );
-
-
-/* Find
- *  finds location of run within rep-server/volume matrix
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *   e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- *
- *  returns 0 if path exists, rc state rcNotFound if
- *  path cannot be found, and rcInsufficient if buffer is
- *  too small.
- */
-SRA_EXTERN rc_t CC SRAPathFind ( const SRAPath *self,
-    const char *accession, char *path, size_t path_max );
-
-
-/* List
- *  list all runs known to SRAPath
- *  this can be VERY SLOW due to the large number of runs
- *
- *  "runs" [ OUT ] - return parameter for ordered list of accessions
- *
- *  "deep" [ IN ] - when false, list only first responding server
- */
-SRA_EXTERN rc_t CC SRAPathList ( const SRAPath *self, struct KNamelist **runs, bool deep );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_srapath_ */
diff --git a/interfaces/sra/srapath.hpp b/interfaces/sra/srapath.hpp
deleted file mode 100644
index a863dfa..0000000
--- a/interfaces/sra/srapath.hpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_sra_srapath_
-#define _hpp_sra_srapath_
-
-#ifndef _h_sra_srapath_
-#include <sra/srapath.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SRAPath
- *  archive specific path manager
- */
-struct SRAPath
-{
-    /* Make
-     *  create path manager
-     *
-     *  the path manager should already be configured with
-     *  standard search paths, but can be augmented by using
-     *  the Add*Path messages.
-     *
-     *  "dir" [ IN, NULL OKAY ] - optional root directory to use
-     *  attaches a new reference
-     */
-    static inline rc_t Make ( SRAPath **pm,
-        struct KDirectory const *dir = NULL ) throw()
-    { return SRAPathMake ( pm, dir ); }
-
-
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const  throw()
-    { return SRAPathAddRef ( this ); }
-
-    inline rc_t Release () const  throw()
-    { return SRAPathRelease ( this ); }
-
-
-    /* Version
-     *  returns the library version
-     */
-    inline rc_t Version ( uint32_t *version ) const  throw()
-    { return SRAPathVersion ( this, version ); }
-
-
-    /* Clear
-     *  forget all existing server and volume paths
-     */
-    inline rc_t Clear () throw()
-    { return SRAPathClear ( this ); }
-
-    /* AddRepPath
-     *  add a replication path
-     *
-     *  "rep" [ IN ] - NUL-terminated server search path
-     *  may be a compound path with ':' separator characters, e.g.
-     *  "/panfs/traces01:/panfs/traces31"
-     *
-     *  NB - servers are searched in the order provided,
-     *  first to last, until one of them satisfies a request,
-     *  at which time the successful server is placed at the
-     *  head of the search path.
-     */
-    inline rc_t AddRepPath ( const char *rep )  throw()
-    { return SRAPathAddRepPath ( this, rep ); }
-
-
-    /* AddVolPath
-     *  add a volume path
-     *
-     *  "vol" [ IN ] - NUL-terminated volume search path
-     *  may be a compound path with ':' separator characters, e.g.
-     *  "sra2:sra1:sra0"
-     *
-     *  NB - volumes are searched in the order provided,
-     *  first to last. they are never re-ordered.
-     */
-    inline rc_t AddVolPath ( const char *vol )  throw()
-    { return SRAPathAddVolPath ( this, vol ); }
-
-
-    /* Full
-     *  creates full path from server, volume & accession
-     *
-     *  "rep" [ IN ] - NUL terminated full path of replication
-     *  server, e.g. "/panfs/traces01"
-     *
-     *  "vol" [ IN ] - NUL terminated relative path of volume,
-     *  e.g. "sra2"
-     *
-     *  "accession" [ IN ] - NUL terminated run accession,
-     *  e.g. "SRR000001"
-     *
-     *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
-     *  NUL-terminated full path to accession.
-     */
-    inline rc_t Full ( const char *rep, const char *vol,
-        const char *accession, char *path, size_t path_max ) const  throw()
-    { return SRAPathFull ( this, rep, vol, accession, path, path_max ); }
-
-
-    /* Test
-     *  returns true if path appears to be accession
-     *  the test is a heuristic, and may return false positives
-     *
-     *  "path" [ IN ] - NUL terminated path to run
-     */
-    inline bool Test ( const char *path ) const  throw()
-    { return SRAPathTest ( this, path ); }
-
-
-    /* Find
-     *  finds location of run within rep-server/volume matrix
-     *
-     *  "accession" [ IN ] - NUL terminated run accession,
-     *   e.g. "SRR000001"
-     *
-     *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
-     *  NUL-terminated full path to accession.
-     *
-     *  returns 0 if path exists, rc state rcNotFound if
-     *  path cannot be found, and rcInsufficient if buffer is
-     *  too small.
-     */
-    inline rc_t Find ( const char *accession, char *path,
-        size_t path_max ) const throw()
-    { return SRAPathFind ( this, accession, path, path_max ); }
-
-
-    /* List
-     *  list all runs known to SRAPath
-     *  this can be VERY SLOW due to the large number of runs
-     *
-     *  "runs" [ OUT ] - return parameter for ordered list of accessions
-     *
-     *  "deep" [ IN ] - when false, list only first responding server
-     */
-    inline rc_t List ( struct KNamelist **runs,
-        bool deep = false ) const  throw()
-    { return SRAPathList ( this, runs, deep ); }
-
-private:
-    SRAPath ();
-    ~ SRAPath ();
-    SRAPath ( const SRAPath& );
-    SRAPath &operator = ( const SRAPath& );
-};
-
-#endif // _hpp_sra_srapath_
diff --git a/interfaces/sra/sraschema.h b/interfaces/sra/sraschema.h
deleted file mode 100644
index 428061c..0000000
--- a/interfaces/sra/sraschema.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_sraschema_
-#define _h_sra_sraschema_
-
-#ifndef _h_sra_extern_
-#include <sra/extern.h>
-#endif
-
-#ifndef _h_klib_callconv_
-#include <klib/callconv.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct SRAMgr;
-struct VSchema;
-struct VDBManager;
-
-
-/*--------------------------------------------------------------------------
- * SRASchema
- *  a schema object pre-loaded with default SRA schema
- */
-
-
-/* Make
- *  create an instance of the default SRA schema
- */
-SRA_EXTERN rc_t CC SRAMgrMakeSRASchema ( struct SRAMgr const *self, struct VSchema **schema );
-SRA_EXTERN rc_t CC VDBManagerMakeSRASchema ( struct VDBManager const *self, struct VSchema **schema );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_sraschema_ */
diff --git a/interfaces/sra/types.h b/interfaces/sra/types.h
deleted file mode 100644
index 5cfa126..0000000
--- a/interfaces/sra/types.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_types_
-#define _h_sra_types_
-
-#ifndef _h_sra_extern_
-#include <sra/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * logical intrinsics
- *  CS101 datatypes
- *
- *  logical types are intrinsic and have no signed property. they exist
- *  mainly to support bit manipulation operations. actual numeric types
- *  inherit their size and byte-swapping from logical types.
- */
-
-#define vdb_bit1_t          "B1"
-#define vdb_bit8_t          "B8"
-#define vdb_bit16_t        "B16"
-#define vdb_bit32_t        "B32"
-#define vdb_bit64_t        "B64"
-#define vdb_bit128_t      "B128"
-
-
-/*--------------------------------------------------------------------------
- * numeric types
- *  CS101 datatypes
- *
- *  in general, all numbers are named type + size in bits, where
- *  type = "U" for unsigned, "I" for signed, and "F" for floats.
- */
-
-#define vdb_uint1_t         "U1"       /* supertype "B1"      */
-#define vdb_int8_t          "I8"       /* supertype "B8"      */
-#define vdb_uint8_t         "U8"       /* supertype "B8"      */
-#define vdb_int16_t        "I16"       /* supertype "B16"     */
-#define vdb_uint16_t       "U16"       /* supertype "B16"     */
-#define vdb_int32_t        "I32"       /* supertype "B32"     */
-#define vdb_uint32_t       "U32"       /* supertype "B32"     */
-#define vdb_int64_t        "I64"       /* supertype "B64"     */
-#define vdb_uint64_t       "U64"       /* supertype "B64"     */
-#define vdb_int128_t      "I128"       /* supertype "B128"    */
-#define vdb_uint128_t     "U128"       /* supertype "B128"    */
-#define vdb_float32_t      "F32"       /* supertype "B32"     */
-#define vdb_float64_t      "F64"       /* supertype "B64"     */
-
-
-/*--------------------------------------------------------------------------
- * boolean
- */
-
-#define vdb_bool_t      "bool"          /* supertype "U8"     */
-
-
-/*--------------------------------------------------------------------------
- * character types
- */
-
-#define vdb_utf8_t      "utf8"          /* supertype "B8"     */
-#define vdb_utf16_t     "utf16"         /* supertype "B16"    */
-#define vdb_utf32_t     "utf32"         /* supertype "B32"    */
-#define vdb_ascii_t     "ascii"         /* supertype "utf8"   */
-
-
-/*--------------------------------------------------------------------------
- * INSDC types
- */
-#define insdc_fasta_t   "INSDC:dna:text"        /* supertype "ascii"  */
-#define insdc_csfasta_t "INSDC:color:text"      /* supertype "ascii"  */
-#define insdc_2na_t     "INSDC:2na:packed"      /* supertype "B1[2]"  */
-#define insdc_4na_t     "INSDC:4na:packed"      /* supertype "B1[4]"  */
-#define insdc_2cs_t     "INSDC:2cs:packed"      /* supertype "B1[2]"  */
-#define insdc_phred_t   "INSDC:quality:phred"   /* supertype "U8"     */
-#define insdc_logodds_t "INSDC:quality:log_odds"/* supertype "I8"     */
-
-
-/*--------------------------------------------------------------------------
- * NCBI types
- *  types common within NCBI.
- *
- *  partial byte sized types do not have a registered supertype,
- *  but are commented to indicate their size
- */
-
-#define ncbi_qual4_t    "NCBI:qual4"         /* supertype "I8[4]"  */
-#define ncbi_isamp1_t   "NCBI:isamp1"        /* supertype "I16"    */
-#define ncbi_isamp4_t   "NCBI:isamp4"        /* supertype "I16[4]" */
-#define ncbi_fsamp1_t   "NCBI:fsamp1"        /* supertype "F32"    */
-#define ncbi_fsamp4_t   "NCBI:fsamp4"        /* supertype "F32[4]" */
-
-
-/* alias names */
-#define ncbi_2na_t      insdc_2na_t
-#define ncbi_4na_t      insdc_4na_t
-#define ncbi_2cs_t      insdc_2cs_t
-#define ncbi_qual1_t    insdc_phred_t
-
-
-/*--------------------------------------------------------------------------
- * VTypedef
- *  used to describe properties of a type
- *
- *  when properly filled out, the structure indicates
- *  the 1-based runtime id of type, that of its supertype
- *  or 0 if none, the size in bits of type, the size in
- *  bits of the supertype ( or element type, when dim > 1 )
- *  and the vector dimension given when type was introduced,
- *  as well as whether the type is a signed numeric.
- *
- *  example: "typedef I8 NCBI:qual4 [ 4 ]" translates to:
- *    type_id   = runtime type id of NCBI:qual4
- *    super_id  = runtime type id of I8
- *    size      = 8
- *    dim       = 4
- *    sign      = true
- */
-typedef struct VTypedef VTypedef;
-struct VTypedef
-{
-    /* runtime type id */
-    uint32_t type_id;
-
-    /* supertype id */
-    uint32_t super_id;
-
-    /* size of type element */
-    bitsz_t type_size;
-
-    /* vector dimension */
-    uint32_t dim;
-
-    /* signed property */
-    uint32_t sign;
-};
-
-
-/* Sizeof
- *  returns the bit size of declared type
- *
- *  technically, this is self -> size * self -> dim.
- */
-/* bitsz_t VTypedefSizeof ( const VTypedef *self ); */
-#define VTypedefSizeof(T) ((bitsz_t)(((T)->type_size) * ((T)->dim)))
-
-
-/*--------------------------------------------------------------------------
- * VDatatypes
- */
-typedef struct VDatatypes VDatatypes;
-
-
-/* forward */
-struct VTypedecl;
-
-
-/* AddRef
- * Release
- */
-SRA_EXTERN rc_t CC VDatatypesAddRef ( const VDatatypes *self );
-SRA_EXTERN rc_t CC VDatatypesRelease ( const VDatatypes *self );
-
-
-/* RegisterOpaque
- * RegisterSubtype
- *  registers new datatypes
- *
- *  "newtype" [ IN ] - NUL terminated fully qualified type name
- *
- *  "supertype" [ IN ] and "dim" [ IN ] - NUL terminated fully
- *  qualified parent equivalency type and vector dimension
- *  -OR-
- *  "bits" [ IN ] - size in bits of element.
- *
- *  "byte_swap" [ IN, CONDITIONALLY NULL OKAY ] - a byte swapping function
- *  required when size > 8 and and integral multiple of 8.
- */
-#if 0
-SRA_EXTERN rc_t CC VDatatypesRegisterOpaque ( VDatatypes *self,
-    const char *newtype, uint16_t bits,
-    void ( CC * byte_swap ) ( void *elem ) );
-SRA_EXTERN rc_t CC VDatatypesRegisterSubtype ( VDatatypes *self,
-    const char *newtype, const char *supertype, uint16_t dim,
-    void ( CC * byte_swap ) ( void *elem ) );
-#endif
-
-/* DefineSubtype
- *  creates a subtype definition
- *
- *    typedef = [ 'typedef' ] <supertype> <typedecl>
- */
-#if 0
-SRA_EXTERN rc_t CC VDatatypesDefineSubtype ( VDatatypes *self,
-    const char *definition, ... );
-SRA_EXTERN rc_t CC VDatatypesVDefineSubtype ( VDatatypes *self,
-    const char *definition, va_list args );
-#endif
-
-/* ResolveTypedecl
- *  converts a typedecl string to type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved type declaration
- *
- *  "typedecl" [ IN ] - type declaration
- */
-SRA_EXTERN rc_t CC VDatatypesResolveTypedecl ( const VDatatypes *self,
-    struct VTypedecl *resolved, const char *typedecl, ... );
-SRA_EXTERN rc_t CC VDatatypesVResolveTypedecl ( const VDatatypes *self,
-    struct VTypedecl *resolved, const char *typedecl, va_list args );
-
-
-/* ResolveTypename
- *  convert a type id into its type definition
- *
- *  "resolved" [ OUT ] - resolved type definition
- *
- *  "typname" [ IN ] - NUL-terminated type name
- */
-SRA_EXTERN rc_t CC VDatatypesResolveTypename ( const VDatatypes *self,
-    VTypedef *resolved, const char *typname );
-
-
-/* ResolveTypeid
- *  convert a type id into its type definition
- *
- *  "resolved" [ OUT ] - resolved type definition
- *
- *  "type_id" [ IN ] - 1-based runtime type id
- */
-SRA_EXTERN rc_t CC VDatatypesResolveTypeid ( const VDatatypes *self,
-    VTypedef *resolved, uint32_t type_id );
-
-
-/* SizeofTypedecl
- *  returns the bit size of type declaration
- */
-SRA_EXTERN rc_t CC VDatatypesSizeofTypedecl ( const VDatatypes *self,
-    bitsz_t *type_size, struct VTypedecl const *td );
-
-
-/* SizeofTypeid
- *  returns the bit size of typeid
- *
- *  "type_size" [ OUT ] - bit size of a type
- *
- *  "type_id" [ IN ] - numerical index of a type
- *
- *  "all_elements" [ IN ] - for multi-dimesional types
- *  return the sum of sizes, otherwise - only for a single element
- */
-SRA_EXTERN rc_t CC VDatatypesSizeofTypeid ( const VDatatypes *self,
-    bitsz_t *type_size, uint32_t type_id, bool all_elements );
-
-
-/* MakeTypedecl
- *  convert a VTypedecl into canonical text
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated type declaration string
- *
- *  "typedecl" [ IN ] - binary representation of typedecl
- */
-SRA_EXTERN rc_t CC VDatatypesMakeTypedecl ( const VDatatypes *self,
-    char *buffer, size_t bsize, struct VTypedecl const *typedecl );
-
-
-/* ToSupertype
- *  cast a typedecl to a size-equivalent supertype decl
- *  returns not-found and leaves "typedecl" unchanged
- *  if no supertype exists
- *
- *  "typedecl" [ IN, OUT ] - populated with a correct
- *  type id and vector dimension on input, will be updated
- *  to contain a supertype and equivalent dimension on
- *  output. e.g.:
- *
- *    IN -  { type_id NCBI:qual4, dim 1 }
- *    OUT - { type_id I8, dim 4 }
- */
-SRA_EXTERN rc_t CC VDatatypesToSupertype ( const VDatatypes *self, struct VTypedecl *typedecl );
-
-
-/* ToIntrinsic
- *  cast a typedecl ( if necessary ) to a size-equivalent
- *  intrinsic typedecl.
- *
- *  returns not-found and leaves "typedecl" unchanged
- *  if no intrinsic supertype exists
- *
- *  leaves "typedecl" unchanged if it is already intrinsic.
- *
- *  "typedecl" [ IN, OUT ] - populated with a correct
- *  type id and vector dimension on input, will be updated
- *  to contain a supertype and equivalent dimension on
- *  output. e.g.:
- *
- *    IN -  { type_id NCBI:qual4, dim 1 }
- *    OUT - { type_id I8, dim 4 }
- */
-SRA_EXTERN rc_t CC VDatatypesToIntrinsic ( const VDatatypes *self, struct VTypedecl *typedecl );
-
-
-/* ToAncestor
- *  cast a typedecl to a size-equivalent ancestor decl
- *  returns true if cast can be performed
- */
-SRA_EXTERN bool CC VDatatypesToAncestor ( const VDatatypes *self,
-    struct VTypedecl const *to, struct VTypedecl const *from );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sra_types_ */
diff --git a/interfaces/sra/wsradb.h b/interfaces/sra/wsradb.h
deleted file mode 100644
index 70baa6b..0000000
--- a/interfaces/sra/wsradb.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sra_wsradb_
-#define _h_sra_wsradb_
-
-#ifndef _h_sra_extern_
-#include <sra/extern.h>
-#endif
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VSchema;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * SRAMgr
- *  opaque handle to SRA library
- */
-
-
-/* MakeUpdate
- *  create library handle for read/write access
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- *
- *  NB - not implemented in read-only library,
- *  and the read-only library may not be mixed with read/write
- */
-SRA_EXTERN rc_t CC SRAMgrMakeUpdate ( SRAMgr **mgr, struct KDirectory *wd );
-
-
-/* SetMD5Mode
- *  sets default MD5 file mode for all objects
- *  opened for update under manager
- */
-SRA_EXTERN rc_t CC SRAMgrSetMD5Mode ( SRAMgr *self, bool useMD5 );
-
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-SRA_EXTERN rc_t CC SRAMgrLock ( SRAMgr *self, const char *path, ... );
-SRA_EXTERN rc_t CC SRAMgrVLock ( SRAMgr *self, const char *path, va_list args );
-
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-SRA_EXTERN rc_t CC SRAMgrUnlock ( SRAMgr *self, const char *path, ... );
-SRA_EXTERN rc_t CC SRAMgrVUnlock ( SRAMgr *self, const char *path, va_list args );
-
-
-/* DropTable
- *  drop an existing table
- *
- *  "force" [ IN ] - if true, make every attempt to remove table
- *
- *  "path" [ IN ]  - NUL terminated table name
- */
- SRA_EXTERN rc_t CC SRAMgrDropTable ( SRAMgr *self, bool force, const char *path, ... );
- SRA_EXTERN rc_t CC SRAMgrVDropTable ( SRAMgr *self, bool force, const char *path, va_list args );
-
-
-/*--------------------------------------------------------------------------
- * SRATable
- *  a collection of spots with several data series, minimally including
- *  base or color calls and their quality ( confidence ) values, and
- *  optionally signal-related values ( signal, intensity, noise, ... ).
- */
-
-/* Create
- *  creates a new table
- *
- *  "tbl" [ OUT ] - return parameter for table
- *
- *  "typespec" [ IN ] - type and optionally version of table schema,
- *  e.g. 'MY_NAMESPACE:MyTable' or 'MY_NAMESPACE:MyTable#1.1'
- *
- *  "path" [ IN ] - NUL terminated table name
- */
-SRA_EXTERN rc_t CC SRAMgrCreateTable ( SRAMgr *self, SRATable **tbl,
-    const char *typespec, const char *path, ... );
-SRA_EXTERN rc_t CC SRAMgrVCreateTable ( SRAMgr *self, SRATable **tbl,
-    const char *typespec, const char *path, va_list args );
-
-
-/* OpenUpdate
- *  open an existing table
- *
- *  "run" [ OUT ] - return parameter for table
- *
- *  "path" [ IN ] - NUL terminated table name
- */
-SRA_EXTERN rc_t CC SRAMgrOpenTableUpdate ( SRAMgr *self,
-    SRATable **tbl, const char *path, ... );
-SRA_EXTERN rc_t CC SRAMgrVOpenTableUpdate ( SRAMgr *self,
-    SRATable **tbl, const char *path, va_list args );
-
-
-/* NewSpot
- *  creates a new spot record, returns spot id.
- *
- *  "id" [ OUT ] - return parameter for id of newly created spot
- */
-SRA_EXTERN rc_t CC SRATableNewSpot ( SRATable *self, spotid_t *id );
-
-
-/* OpenSpot
- *  opens an existing spot record from id
- *
- *  "id" [ IN ] - 1-based spot id
- */
-SRA_EXTERN rc_t CC SRATableOpenSpot ( SRATable *self, spotid_t id );
-
-
-/* CloseSpot
- *  closes a spot opened with either NewSpot or OpenSpot
- */
-SRA_EXTERN rc_t CC SRATableCloseSpot ( SRATable *self );
-
-
-/* Commit
- *  commit all changes
- */
-SRA_EXTERN rc_t CC SRATableCommit ( SRATable *self );
-
-
-/* OpenColumnWrite
- *  open a column for write
- *
- *  "idx" [ OUT ] - return parameter for 1-based column index.
- *
- *  "col" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly opened column.
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
- *
- *  "datatype" [ IN ] - NUL terminated string in ASCII
- *   describing fully qualified column data type
- */
-SRA_EXTERN rc_t CC SRATableOpenColumnWrite ( SRATable *self, uint32_t *idx,
-    SRAColumn **col, const char *name, const char *datatype );
-
-
-/* SetIdxColumnDefault
- *  give a default value for column
- *
- *  if no value gets written to a column within an open spot,
- *  this value is substituted.
- *
- *  "idx" [ IN ] - 1-based column index
- *
- *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
- *  to start of row data
- *
- *  "size" [ IN ] - size in bits of row data
- */
-SRA_EXTERN rc_t CC SRATableSetIdxColumnDefault ( SRATable *self, uint32_t idx,
-    const void *base, bitsz_t offset, bitsz_t size );
-
-
-/* WriteIdxColumn
- *  write row data to an indexed column
- *
- *  "idx" [ IN ] - 1-based column index
- *
- *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
- *  to start of row data
- *
- *  "size" [ IN ] - size in bits of row data
- */
-SRA_EXTERN rc_t CC SRATableWriteIdxColumn ( SRATable *self, uint32_t idx,
-    const void *base, bitsz_t offset, bitsz_t size );
-
-
-/* MetaFreeze
- *  freezes current metadata revision
- *  further modification will begin on a copy
- */
-SRA_EXTERN rc_t CC SRATableMetaFreeze ( SRATable *self );
-
-
-/* OpenMDataNode
- *  open a metadata node
- */
-SRA_EXTERN rc_t CC SRATableOpenMDataNodeUpdate ( SRATable *self,
-    struct KMDataNode **node, const char *path, ... );
-SRA_EXTERN rc_t CC SRATableVOpenMDataNodeUpdate ( SRATable *self,
-    struct KMDataNode **node, const char *path, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sra_wsradb_ */
diff --git a/interfaces/sra/wsradb.hpp b/interfaces/sra/wsradb.hpp
deleted file mode 100644
index cd69111..0000000
--- a/interfaces/sra/wsradb.hpp
+++ /dev/null
@@ -1,591 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_sra_wsradb_
-#define _hpp_sra_wsradb_
-
-#ifdef _hpp_sra_sradb_
-#error "read and update libraries are mutually exclusive"
-#endif
-
-#ifndef _h_sra_wsradb_
-#include <sra/wsradb.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SRAMgr
- *  opaque handle to SRA library
- */
-struct SRAMgr
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw()
-    { return SRAMgrAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return SRAMgrRelease ( this ); }
-
-
-    /* Make
-     *  create library handle for read/write access
-     *
-     *  NB - not implemented in read-only library,
-     *  and the read-only library may not be mixed with read/write
-     */
-    static inline rc_t Make ( SRAMgr **mgr, struct KDirectory *wd = 0 )  throw()
-    { return SRAMgrMakeUpdate ( mgr, wd ); }
-
-
-
-    /* SetMD5Mode
-     *  sets default MD5 file mode for all objects
-     *  opened for update under manager
-     */
-    inline rc_t SetMD5Mode ( bool useMD5 )  throw()
-    { return SRAMgrSetMD5Mode ( this, useMD5 ); }
-
-
-    /* Lock
-     *  apply lock
-     *
-     *  if table is already locked, the operation is idempotent
-     *  and returns an rc state of rcLocked
-     *
-     *  "path" [ IN ] - NUL terminated table path
-     */
-    inline rc_t Lock ( const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVLock ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Lock ( const char *path, va_list args ) throw()
-    { return SRAMgrVLock ( this, path, args ); }
-
-
-    /* Unlock
-     *  remove lock
-     *
-     *  if table is already unlocked, the operation is idempotent
-     *  and returns an rc state of rcUnlocked
-     *
-     *  "path" [ IN ] - NUL terminated table path
-     */
-    inline rc_t SRAMgrUnlock ( SRAMgr *self, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVUnlock ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t SRAMgrUnlock ( SRAMgr *self, const char *path, 
-        va_list args ) throw()
-    { return SRAMgrVUnlock ( this, path, args ); }
-
-
-    /* DropTable
-     *  drop an existing table
-     *
-     *  "force" [ IN ] - if true, make every attempt to remove table
-     *
-     *  "path" [ IN ]  - NUL terminated table name
-     */
-    inline rc_t DropTable ( bool force, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVDropTable ( this, force, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t DropTable ( bool force, const char *path, va_list args ) throw()
-    { return SRAMgrVDropTable ( this, force, path, args ); }
-
-
-    /* OpenDatatypes
-     *  open datatype registry object for requested access
-     *  see <vdb/types.hpp> for VDatatypes
-     *
-     *  "dt" [ OUT ] - return parameter for datatypes object
-     */
-    inline rc_t OpenDatatypes ( struct VDatatypes const **dt ) const throw()
-    { return SRAMgrOpenDatatypesRead ( this, dt ); }
-
-
-    /* GetSchema
-     *  get a reference to the schema used to create new tables
-     *
-     *  "schema" [ OUT ] - return parameter for reference to SRA schema
-     *
-     * NB - returns a new reference that must be released via VSchemaRelease
-     */
-    inline rc_t GetSchemaRead ( struct VSchema const **schema ) const throw()
-    { return SRAMgrGetSchemaRead ( this, schema ); }
-
-
-    /* UseSchema
-     *  allows SRA schema to be entirely replaced
-     *  affects creation/update of all subsequent tables
-     *
-     *  "schema" [ IN ] - new schema to be applied
-     *
-     * NB - manager will attach a new reference to schema object,
-     *  you are still responsible for releasing it via VSchemaRelease
-     */
-    inline rc_t UseSchemaRead ( struct VSchema const *schema ) const throw()
-    { return SRAMgrUseSchemaRead ( this, schema ); }
-
-
-    /* Writable
-     *  returns 0 if table is writable
-     *  rcLocked if locked, rcReadonly if read-only
-     *  other code upon error
-     *
-     *  "path" [ IN ] - NUL terminated table path
-     */
-    inline bool Writable ( const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        bool locked = SRAMgrVWritable ( this, path, args );
-        va_end ( args );
-        return locked;
-    }
-    inline bool Writable ( const char *path, va_list args ) const throw()
-    { return SRAMgrVWritable ( this, path, args ); }
-
-    /* Create
-     *  creates a new table
-     *
-     *  "tbl" [ OUT ] - return parameter for table
-     *
-     *  "typespec" [ IN ] - type and optionally version of table schema,
-     *  e.g. 'MY_NAMESPACE:MyTable' or 'MY_NAMESPACE:MyTable#1.1'
-     *
-     *  "path" [ IN ] - NUL terminated table name
-     */
-    inline rc_t CreateTable ( SRATable **tbl, const char *typespec,
-        const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVCreateTable ( this, tbl, typespec, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t CreateTable ( SRATable **tbl, const char *typespec,
-        const char *path, va_list args ) throw()
-    { return SRAMgrVCreateTable ( this, tbl, typespec, path, args ); }
-
-
-    /* OpenTable
-     *  open an existing table for read
-     *
-     *  "tbl" [ OUT ] - return parameter for table
-     *
-     *  "path" [ IN ] - NUL terminated run name
-     */
-    inline rc_t OpenTable ( const SRATable **tbl,
-        const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVOpenTableRead ( this, tbl, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenTable ( const SRATable **tbl, const char *path,
-        va_list args ) const throw()
-    { return SRAMgrVOpenTableRead ( this, tbl, path, args ); }
-
-
-    inline rc_t OpenTable ( SRATable **tbl, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRAMgrVOpenTableUpdate ( this, tbl, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenTable ( SRATable **tbl, const char *path, va_list args ) throw()
-    { return SRAMgrVOpenTableUpdate ( this, tbl, path, args ); }
-
-
-private:
-    SRAMgr ();
-    ~ SRAMgr ();
-    SRAMgr ( const SRAMgr& );
-    SRAMgr &operator = ( const SRAMgr& );
-};
-
-
-/*--------------------------------------------------------------------------
- * SRATable
- *  a collection of spots with several data series, minimally including
- *  base or color calls and their quality ( confidence ) values, and
- *  optionally signal-related values ( signal, intensity, noise, ... ).
- */
-struct SRATable
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw()
-    { return SRATableAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return SRATableRelease ( this ); }
-
-
-    /* Locked
-     *  returns true if locked
-     */
-    inline bool Locked () const throw()
-    { return SRATableLocked ( this ); }
-
-
-    /* BaseCount
-     *  get the number of stored bases
-     *
-     *  "num_bases" [ OUT ] - return parameter for base count
-     */
-    inline rc_t BaseCount ( uint64_t *num_bases ) const throw()
-    { return SRATableBaseCount ( this, num_bases ); }
-
-
-    /* SpotCount
-     *  get the number of stored spots
-     *
-     *  "spot_count" [ OUT ] - return parameter for spot count
-     */
-    inline rc_t SpotCount ( uint64_t *spot_count ) const throw()
-    { return SRATableSpotCount ( this, spot_count ); }
-
-
-    /* MaxSpotId
-     *  returns the maximum spot id
-     *
-     *  a table will contain a collection of spots with ids from
-     *  min to max ( spot_id ).
-     *
-     *  "id" [ OUT ] - return parameter of last spot id
-     */
-    inline rc_t MaxSpotId ( spotid_t *id ) const throw()
-    { return SRATableMaxSpotId ( this, id ); }
-
-    /* MinSpotId
-     *  returns the minimum spot id
-     *
-     *  a table will contain a collection of spots with ids from
-     *  min to max ( spot_id ).
-     *
-     *  "id" [ OUT ] - return parameter of last spot id
-     */
-    inline rc_t MinSpotId ( spotid_t *id ) const throw()
-    { return SRATableMinSpotId ( this, id ); }
-
-    /* GetSpotId
-     *  project a spot id from a spot name
-     *
-     *  "id" [ OUT ] - return parameter for 1-based spot id
-     *
-     *  "spot_name" [ IN ] - external spot name string
-     */
-    inline rc_t GetSpotId ( spotid_t *id, const char *spot_name ) const throw()
-    { return SRATableGetSpotId ( this, id, spot_name ); }
-
-
-    /* NewSpot
-     *  creates a new spot record, returning spot id.
-     *
-     *  "id" [ OUT ] - return parameter for id of newly created spot
-     */
-    inline rc_t NewSpot ( spotid_t *id ) throw()
-    { return SRATableNewSpot ( this, id ); }
-
-
-    /* OpenSpot
-     *  opens an existing spot record from id
-     *
-     *  "id" [ IN ] - 1-based spot id
-     */
-    inline rc_t OpenSpot ( spotid_t id ) throw()
-    { return SRATableOpenSpot ( this, id ); }
-
-
-    /* CloseSpot
-     *  closes a spot opened with either NewSpot or OpenSpot
-     */
-    inline rc_t CloseSpot () throw()
-    { return SRATableCloseSpot ( this ); }
-
-
-    /* Commit
-     *  commit all changes
-     */
-    inline rc_t Commit () throw()
-    { return SRATableCommit ( this ); }
-
-
-    /* ListCol
-     *  returns a list of column names
-     *
-     *  "names" [ out ] - return parameter for names list
-     */
-    inline rc_t ListCol ( SRANamelist **names ) const throw()
-    { return SRATableListCol ( this, names ); }
-
-
-    /* ColDatatypes
-     *  returns list of typedecls for named column
-     *
-     *  "col" [ IN ] - column name
-     *
-     *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
-     *  into "typedecls" of the default datatype for the named column
-     *
-     *  "typedecls" [ OUT ] - list of datatypes available for named column
-     */
-    inline rc_t ColDatatypes ( const char *col,
-        uint32_t *dflt_idx, SRANamelist **typedecls ) const throw()
-    { return SRATableColDatatypes ( this, col, dflt_idx, typedecls ); }
-
-
-    /* OpenColumn
-     *  open a column for read
-     *
-     *  "col" [ OUT ] - return parameter for newly opened column
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
-     *
-     *  "datatype" [ IN - NULL OKAY ] - optional NUL terminated
-     *   string describing fully qualified column data type in ASCII
-     */
-    inline rc_t OpenColumn ( const SRAColumn **col,
-        const char *name, const char *datatype = 0 ) const throw()
-    { return SRATableOpenColumnRead ( this, col, name, datatype ); }
-
-
-    /* OpenColumn
-     *  open a column for write
-     *
-     *  "idx" [ OUT ] - return parameter for 1-based column index.
-     *
-     *  "col" [ OUT, NULL OKAY ] - optional return parameter for
-     *  newly opened column.
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
-     *
-     *  "datatype" [ IN ] - NUL terminated string in ASCII
-     *   describing fully qualified column data type
-     */
-    inline rc_t OpenColumn ( uint32_t *idx, SRAColumn **col,
-        const char *name, const char *datatype ) throw()
-    { return SRATableOpenColumnWrite ( this, idx, col, name, datatype ); }
-
-
-    /* SetIdxColumnDefault
-     *  give a default value for column
-     *
-     *  if no value gets written to a column within an open spot,
-     *  this value is substituted.
-     *
-     *  "idx" [ IN ] - 1-based column index
-     *
-     *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
-     *  to start of row data
-     *
-     *  "size" [ IN ] - size in bits of row data
-     */
-    inline rc_t SetIdxColumnDefault ( uint32_t idx,
-        const void *base, bitsz_t offset, bitsz_t size ) throw()
-    { return SRATableSetIdxColumnDefault ( this, idx, base, offset, size ); }
-
-
-    /* WriteIdxColumn
-     *  write row data to an indexed column
-     *
-     *  "idx" [ IN ] - 1-based column index
-     *
-     *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
-     *  to start of row data
-     *
-     *  "size" [ IN ] - size in bits of row data
-     */
-    inline rc_t WriteIdxColumn ( uint32_t idx,
-        const void *base, bitsz_t offset, bitsz_t size ) throw()
-    { return SRATableWriteIdxColumn ( this, idx, base, offset, size ); }
-
-
-    /* MetaRevision
-     *  returns current revision number
-     *  where 0 ( zero ) means tip
-     */
-    inline rc_t MetaRevision ( uint32_t *revision ) const throw()
-    { return SRATableMetaRevision ( this, revision ); }
-
-
-    /* MaxRevision
-     *  returns the maximum revision available
-     */
-    inline rc_t MaxMetaRevision ( uint32_t *revision ) const throw()
-    { return SRATableMaxMetaRevision ( this, revision ); }
-
-
-    /* UseMetaRevision
-     *  opens indicated revision of metadata
-     *  all non-zero revisions are read-only
-     */
-    inline rc_t UseMetaRevision ( uint32_t revision ) const throw()
-    { return SRATableUseMetaRevision ( this, revision ); }
-
-
-    /* MetaFreeze
-     *  freezes current metadata revision
-     *  further modification will begin on a copy
-     */
-    inline rc_t MetaFreeze () throw()
-    { return SRATableMetaFreeze ( this ); }
-
-
-    /* OpenMDataNode
-     *  open a metadata node
-     *
-     *  "node" [ OUT ] - return parameter for metadata node
-     *
-     *  "path" [ IN ] - simple or hierarchical NUL terminated
-     *  path to node
-     */
-    inline rc_t OpenMDataNode ( struct KMDataNode const **node,
-        const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRATableVOpenMDataNodeRead ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenMDataNode ( struct KMDataNode const **node,
-        const char *path, va_list args ) const throw()
-    { return SRATableVOpenMDataNodeRead ( this, node, path, args ); }
-
-    inline rc_t OpenMDataNode ( struct KMDataNode **node,
-        const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = SRATableVOpenMDataNodeUpdate ( this, node, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenMDataNode ( struct KMDataNode **node,
-        const char *path, va_list args ) throw()
-    { return SRATableVOpenMDataNodeUpdate ( this, node, path, args ); }
-
-
-private:
-    SRATable ();
-    ~ SRATable ();
-    SRATable ( const SRATable& );
-    SRATable &operator = ( const SRATable& );
-};
-
-
-/*--------------------------------------------------------------------------
- * SRAColumn
- *  represents a spot data column, where the column is configured as
- *  a sequence of blobs, and each blob is a sequence of records,
- *  indexed by spot id.
- */
-struct SRAColumn
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw()
-    { return SRAColumnAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return SRAColumnRelease ( this ); }
-
-
-    /* Datatype
-     *  access data type
-     *
-     *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
-     *
-     *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
-     *  returned in "type_decl"
-     *
-     * NB - one of "type" and "def" must be non-NULL
-     */
-    inline int Datatype ( struct VTypedecl *type,
-        struct VTypedef *def ) const throw()
-    { return SRAColumnDatatype ( this, type, def ); }
-
-
-    /* GetRange
-     *  get a contiguous range around a spot id, e.g. tile for Illumina
-     *
-     *  "id" [ IN ] - return parameter for 1-based spot id
-     *
-     *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
-     *  id range is returned in these output parameters, where
-     *  at least ONE must be NOT-NULL
-     */
-    inline rc_t GetRange ( spotid_t id, spotid_t *first,
-        spotid_t *last ) const throw()
-    { return SRAColumnGetRange ( this, id, first, last ); }
-
-
-    /* Read
-     *  read row data
-     *
-     *  "id" [ IN ] - spot row id between 1 and max ( spot id )
-     *
-     *  "base" [ OUT ] and "offset" [ OUT ] - pointer and bit offset
-     *  to start of spot row data.
-     *
-     *  "size" [ OUT ] - size in bits of row data
-     */
-    inline rc_t Read ( spotid_t id,
-        const void **base, bitsz_t *offset, bitsz_t *size ) const throw()
-    { return SRAColumnRead ( this, id, base, offset, size ); }
-
-private:
-    SRAColumn ();
-    ~ SRAColumn ();
-    SRAColumn ( const SRAColumn& );
-    SRAColumn &operator = ( const SRAColumn& );
-};
-
-#endif // _hpp_sra_sradb_
diff --git a/interfaces/vdb/blob.h b/interfaces/vdb/blob.h
deleted file mode 100644
index 89feaa5..0000000
--- a/interfaces/vdb/blob.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_blob_
-#define _h_vdb_blob_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-
-/*--------------------------------------------------------------------------
- * VBlob
- *  a collection of data cells
- */
-typedef struct VBlob VBlob;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VBlobAddRef ( const VBlob *self );
-VDB_EXTERN rc_t CC VBlobRelease ( const VBlob *self );
-
-
-/* IdRange
- *  returns id range for blob
- *
- *  "first" [ OUT, NULL OKAY ] and "count" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-VDB_EXTERN rc_t CC VBlobIdRange ( const VBlob *self,
-    int64_t *first, uint64_t *count );
-
-
-/* Read
- *  read entire single cell of byte-aligned data into a buffer
- *
- *  "row_id" [ IN ] - allows ReadDirect random access to any cell
- *  in column
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required
- *  to be compatible with the actual element size, and be a multiple
- *  of 8 ( byte-aligned ). for non-byte-aligned data, see ReadBits
- *
- *  "buffer" [ OUT ] and "blen" [ IN ] - return buffer for row data
- *  where "blen" gives buffer capacity in elements. the total buffer
- *  size in bytes == ( "elem_bits" * "blen" + 7 ) / 8.
- *
- *  "row_len" [ OUT ] - return parameter for the number of elements
- *  in the requested row.
- *
- *  when the return code is 0, "row_len" will contain the number of
- *  elements read into buffer. if the return code indicates that the
- *  buffer is too small, "row_len" will give the required buffer length.
- */
-VDB_EXTERN rc_t CC VBlobRead ( const VBlob *self, int64_t row_id,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len );
-
-
-/* ReadBits
- *  read single row of potentially bit-aligned cell data into a buffer
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required to be
- *  compatible with the actual element size, and may ( or may not ) be
- *  a multiple of 8 ( byte aligned ).
- *
- *  "start" [ IN ] - zero-based starting index to first element,
- *  valid from 0 .. row_len - 1
- *
- *  "buffer" [ IN ], "boff" [ IN ] and "blen" [ IN ] -
- *  return buffer for row data, where "boff" is in BITS
- *  and "blen" is in ELEMENTS.
- *
- *  "num_read" [ OUT ] - return parameter for the number of elements
- *  read, which is <= "blen"
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of elements remaining to be read. specifically,
- *  "start" + "num_read" + "remaining" == row length, assuming that
- *  "start" <= row length.
- */
-VDB_EXTERN rc_t CC VBlobReadBits ( const VBlob *self, int64_t row_id,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t boff,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining );
-
-
-/* CellData
- *  access pointer to single cell of potentially bit-aligned cell data
- *
- *  "elem_bits" [ OUT, NULL OKAY ] - optional return parameter for
- *  element size in bits
- *
- *  "base" [ OUT ] and "boff" [ OUT, NULL OKAY ] -
- *  compound return parameter for pointer to row starting bit
- *  where "boff" is in BITS
- *
- *  "row_len" [ OUT, NULL OKAY ] - the number of elements in cell
- */
-VDB_EXTERN rc_t CC VBlobCellData ( const VBlob *self, int64_t row_id,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_vdb_blob_ */
diff --git a/interfaces/vdb/built-in.vschema b/interfaces/vdb/built-in.vschema
deleted file mode 100644
index 07b28c0..0000000
--- a/interfaces/vdb/built-in.vschema
+++ /dev/null
@@ -1,397 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB built-in functions, formats and types
- */
-version 1;
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-// Row id range consist of row_id_start and row_id_stop
-typedef I64 vdb:row_id_range [ 2 ];
-
-
-/*--------------------------------------------------------------------------
- * typesets
- */
-typeset integer_set { I8, U8, I16, U16, I32, U32, I64, U64 };
-typeset float_set { F32, F64 };
-typeset numeric_set { integer_set, float_set };
-typeset text_set { utf8, utf16, utf32, ascii };
-typeset text8_set { utf8, ascii };
-typeset transpose_set { B8, B16, B32, B64 };
-
-
-/*--------------------------------------------------------------------------
- * formats
- */
-fmtdef merged_fmt;
-fmtdef transposed_fmt;
-fmtdef delta_averaged_fmt;
-
-
-/*--------------------------------------------------------------------------
- * constants
- */
-const U8 ALIGN_LEFT = 0;
-const U8 ALIGN_RIGHT = 1;
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-
-/* cast
- *  performs a "C++ reinterpret_cast" style cast
- *  rewrites input as required to produce output
- *
- *  legal operations include numeric_set -> numeric_set,
- *  numeric <-> character, etc.
- */
-function
-any cast #1.0 ( any in )
-    = vdb:cast;
-
-/* bit_or
- *  performs a bitwise operation 'OR' for every byte in A and B
- *  A and B are not neccesarily have the same size
- *  the resulting row will have the size of B while OR operation is done for portion of A overlapping B
- *  For different sizes of A and B 'align' parameter provides what edge of A and B are aligned
- *  possible values ALIGN_LEFT, ALIGN_RIGHT
- * 
- */
-function < type T >
-T  bit_or #1 < U8 align > ( T  A, T B  )
-    = vdb:bit_or;
-
-/* trim
- * performs trimming of value val from column A
- * align provides left- or right- trimming
- */
-function < type T >
-T trim #1 < U8 align, T val > ( T A )
-    = vdb:trim;
-
-
-/* redimension
- *  performs a change of dimension without changing bit pattern
- */
-function
-any redimension #1.0 ( any in )
-    = vdb:redimension;
-
-
-/* row_id
- *  returns the row id of a request
- */
-function
-I64 row_id #1.0 ()
-    = vdb:row_id;
-
-
-/* row_len
- *  returns the number of elements in a row
- *
- *  "in" [ DATA ] - column supplying row. if row does not exist
- *  in column, the resultant length is 0.
- */
-function
-U32 row_len #1.0 ( any in )
-    = vdb:row_len;
-
-
-/* fixed_row_len
- *  returns non-zero if the entire page
- *  has a uniform row-length, zero otherwise
- *
- *  "in" [ DATA ] - column to query
- */
-function
-U32 fixed_row_len #1.0 ( any in )
-    = vdb:fixed_row_len;
-
-
-/* compare
- *  evaluates src [ i ] == cmp [ i ]
- *  causes writing exception if unequal.
- *
- *  For whole types, equality is bitwise equal
- *  for floating point types see below.
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "sig_bits" [ OPTIONAL CONST >= 1 ] - for floating point types, ignored
- *  otherwise, the number of significant binary digits in the mantissas to
- *  compare such that |x - y| <= 1, for corresponding numbers x (in a) and
- *  y (in b) both scaled according to sig_bits and their common magnitude.
- *  "sig_bits" may be an array, if so "sel" is required (see below).
- *
- *  "src" [ DATA ] - standard input data derived from source
- *
- *  "cmp" [ DATA ] - feedback data after being written and re-read
- *
- */
-validate function < type T >
-void compare #1.0 < * U32 sig_bits > ( T src, T cmp )
-    = vdb:compare;
-
-validate function < type T >
-void no_compare #1.0 ( T src, T cmp )
-    = vdb:no_compare;
-
-
-/* compare2f
- *  evaluates src [ i ] == cmp [ i ]
- *  causes writing exception if unequal.
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "sig_bits" [ CONST >= 1 ] - for floating point types, ignored otherwise,
- *  array containing the number of significant binary digits in the mantissas
- *  to compare such that |x - y| <= 1, for corresponding numbers x (in a) and
- *  y (in b) both scaled according to sig_bits and their common magnitude.
- *
- *  "src" [ DATA ] - standard input data derived from source
- *
- *  "cmp" [ DATA ] - feedback data after being written and re-read
- *
- *  "sel" [ DATA ] - data to select which element of "sig_bits" to
- *  use for the comparison.  The valid values of "sel" are
- *  [0 .. length sig_bits).
- *
-validate function < type T >
-void compare2f #1.0 < U32 sig_bits > ( float_set src, float_set cmp, T sel )
-    = vdb:compare2f;
-*/
-
-/* range_validate
- *  passes input through if all values fall between lower and
- *  upper bounds, INCLUSIVE
- *
- *  "T" [ TYPE ] - type to be validated
- *
- *  "lower" [ CONST ] and "upper" [ CONST ] - inclusive
- *  bounds on input values
- *
- *  "in" [ DATA ] - data to be validated
- */
-function < type T >
-T range_validate #1.0 < T lower, T upper > ( T in )
-    = vdb:range_validate;
-
-
-/* select
- *  return first non-empty input for id
- *  inputs are taken from first to last
- *
- *  "T" [ TYPE ] - data type of selection
- *
- *  "first" [ DATA ] - first of N inputs
- *
- *  "second" [ DATA ] - second of N inputs
- *  all other inputs are optional and must
- *  be compatible with type "T"
- */
-function < type T >
-T select #1.0 ( T first, T second, ... )
-    = vdb:select;
-
-
-/* transpose
- *  transpose a page of unformatted data
- *
- *  for example - convert a simple page of values,
- *  where vertical scale is row id and horizontal element index:
- *
- *        1   2   3
- *      +---+---+---+
- *    1 | a | b | c |
- *      +---+---+---+
- *    2 | d | e | f |
- *      +---+---+---+
- *    3 | g | h | i |
- *      +---+---+---+
- *    4 | j | k | l |
- *      +---+---+---+
- *
- *  into:
- *
- *        1   2   3   4
- *      +---+---+---+---+
- *    1 | a | d | g | j |
- *      +---+---+---+---+
- *    2 | b | e | h | k |
- *      +---+---+---+---+
- *    3 | c | f | i | l |
- *      +---+---+---+---+
- *
- *  variable row-lengths are supported. The output blob is
- *  formatted, meaning that the result can no longer be addressed
- *  as a matrix, but the transposition has be applied to data.
- *
- *  "in" [ DATA ] - unformatted data to be transposed
- */
-function
-transposed_fmt transpose #1 ( transpose_set in )
-    = vdb:transpose;
-
-
-/* detranspose
- *  pardoning the awful name, apply a transposition on the result
- *  of "transpose" to produce the original blob. "transpose"
- *  itself cannot be reused because of its signature.
- */
-function
-transpose_set detranspose #1 ( transposed_fmt in )
-    = vdb:detranspose;
-
-/*
- * delta_average computes average representation of the maximium 
- * lengh row and deltas every row against it
- */
-function
-delta_averaged_fmt delta_average #1 ( any in ) 
-     = vdb:delta_average;
-
-function
-any undelta_average #1 ( delta_averaged_fmt in )
-    = vdb:undelta_average;
-
-/* merge
- *  merges all input blobs of any format/type into a single blob
- */
-function
-merged_fmt merge #1.0 ( any in, ... )
-    = vdb:merge;
-
-
-/* split
- *  extracts a single blob from a merged blob by index
- *
- *  "idx" [ CONST ] - blob index
- */
-
-function
-any split #1.0 < U32 idx > ( merged_fmt in )
-    = vdb:split;
-
-
-/* meta:read
- *  reads table metadata node as a row
- * meta:value
- *  reads metadata node as single value,
- *  performing size conversion if necessary,
- *  e.g. I8 TO I64, I32 TO I16
- *
- *  "T" [ TYPE ] - cast data type of metadata node
- *
- *  "node" [ CONST ] - path to metadata node
- */
-function < type T >
-T meta:read #1.0 < ascii node, * bool deterministic > ();
-
-function < type T >
-T meta:value #1.0 < ascii node, * bool deterministic > ();
-
-
-/* meta:write
- *  writes row data to table metadata node
- *
- *  "T" [ TYPE ] - cast data type of metadata node
- *
- *  "node" [ CONST ] - path to metadata node
- *
- *  "in" [ DATA ] - source of row data
- */
-function < type T >
-T meta:write #1.0 < ascii node > ( T in );
-
-
-/* meta:attr:read
- *  reads table metadata attribute as a row
- *
- *  "node" [ CONST ] - path to metadata node
- *
- *  "attr" [ CONST ] - attribute name on node
- */
-function
-ascii meta:attr:read #1.0 < ascii node, ascii attr, * bool deterministic > ();
-
-
-/* meta:attr:write
- *  write row data as table metadata attribute
- *
- *  "node" [ CONST ] - path to metadata node
- *
- *  "attr" [ CONST ] - attribute name on node
- */
-function
-ascii meta:attr:write #1.0 < ascii node, ascii attr > ( ascii in );
-
-
-/* parameter:read
- *  reads named cursor parameter text
- *
- *  "name" [ CONST ] - parameter name
- */
-function
-text8_set parameter:read #1.0 < ascii name, * bool deterministic > ();
-
-
-/* environment:read
- *  reads named environment variable text
- *
- *  "name" [ CONST ] - environment variable name
- */
-function
-text8_set environment:read #1.0 < ascii name > ();
-
-
-/* idx:text:project
- *  perform a reverse lookup in an index
- *  if key not found then use substitute
- *
- *  "index_name" [ CONST ] - name of text index
- *
- *  "substitute" [ DATA, OPTIONAL ] - source
- *  of values to substitute for values not
- *  found in the index.
- */
-function text8_set idx:text:project #1.0 < ascii index_name > ( * text8_set substitute );
-
-
-/* idx:text:insert
- */
-function text8_set idx:text:insert #1.0 < ascii index_name > ( text8_set key );
-
-
-/* vdb:row_id_range
- */
-function vdb:row_id_range  idx:text:lookup #1 < ascii index_name , ascii query_by_name > ();
diff --git a/interfaces/vdb/cursor.h b/interfaces/vdb/cursor.h
deleted file mode 100644
index 55dce40..0000000
--- a/interfaces/vdb/cursor.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_cursor_
-#define _h_vdb_cursor_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VBlob;
-struct VTable;
-struct VTypedesc;
-struct VTypedecl;
-
-
-/*--------------------------------------------------------------------------
- * KCreateMode
- *  mode definitions for cursor creation
- *
- *  NB - typedef'd as uint32_t in <klib/defs.h> to ensure uniformly
- *  predictable binary representation.
- */
-enum
-{
-    kcmUpdate,          /* kcmOpen   */
-    kcmReplace,         /* kcmInit   */
-    kcmInsert           /* kcmCreate */
-};
-
-/*--------------------------------------------------------------------------
- * VCursor
- *  a row cursor onto a VTable
- */
-typedef struct VCursor VCursor;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VCursorAddRef ( const VCursor *self );
-VDB_EXTERN rc_t CC VCursorRelease ( const VCursor *self );
-
-
-/* CreateCursor
- *  creates a cursor object onto table
- *  multiple read cursors are allowed
- *  only a single write cursor is allowed
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- *
- *  "mode" [ IN ] - describes update behavior
- *    kcmUpdate   : allow inserts or updates
- *    kcmReplace  : replace all existing rows with newly written rows
- *    kcmInsert   : allow only inserts, i.e. new rows
- *
- *  NB - CreateCursorRead will be deprecated in future releases
- *  use CreateCachedCursorRead instead.
- */
-VDB_EXTERN rc_t CC VTableCreateCursorRead ( struct VTable const *self, const VCursor **curs );
-VDB_EXTERN rc_t CC VTableCreateCursorWrite ( struct VTable *self, VCursor **curs, KCreateMode mode );
-
-
-/* CreateCachedCursorRead
- *  creates a read cursor object onto table with a cache limit in bytes
- *
- *  AVAILABILITY: version 2.1
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- *
- *  "capacity" [ IN ] - the maximum bytes to cache on the cursor before
- *  dropping least recently used blobs
- */
-VDB_EXTERN rc_t CC VTableCreateCachedCursorRead ( struct VTable const *self,
-    const VCursor **curs, size_t capacity );
-
-
-/* AddColumn
- *  add a column to an unopened cursor
- *
- *  "idx" [ OUT ] - return parameter for column index
- *
- *  "name" [ IN ] - NUL terminated column name spec.
- *  to identify a column by name, provide the column name
- *  by itself. if there are multiple types available under
- *  that name, the default type for that column will be
- *  selected. to select a specific type, the name may
- *  be cast to that type using a cast expression, e.g.
- *    "( type ) name"
- *
- * NB - may return a non-zero status code of rcColumn, rcExists
- *  if the column was not added. the return "idx" will still
- *  be set properly and this does NOT indicate an error.
- */
-VDB_EXTERN rc_t CC VCursorAddColumn ( const VCursor *self,
-    uint32_t *idx, const char *name, ... );
-VDB_EXTERN rc_t CC VCursorVAddColumn ( const VCursor *self,
-    uint32_t *idx, const char *name, va_list args );
-
-
-/* GetColumnIdx
- *  retrieve column index by name spec
- *
- *  "idx" [ OUT ] - return parameter for column index
- *
- *  "name" [ IN ] - NUL terminated column name spec.
- */
-VDB_EXTERN rc_t CC VCursorGetColumnIdx ( const VCursor *self,
-    uint32_t *idx, const char *name, ... );
-VDB_EXTERN rc_t CC VCursorVGetColumnIdx ( const VCursor *self,
-    uint32_t *idx, const char *name, va_list args );
-
-
-/* Datatype
- *  returns typedecl and/or typedef for column data
- *
- *  "idx" [ IN ] - column index
- *
- *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
- *
- *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
- *  returned in "type_decl"
- *
- * NB - one of "type" and "def" must be non-NULL
- */
-VDB_EXTERN rc_t CC VCursorDatatype ( const VCursor *self, uint32_t idx,
-    struct VTypedecl *type, struct VTypedesc *desc );
-
-
-/* IdRange
- *  returns id range for column
- *
- *  "idx" [ IN, DEFAULT ZERO ] - single column index or
- *  zero to indicate the range for all columns in cursor
- *
- *  "id" [ IN ] - page containing this row id is target
- *
- *  "first" [ OUT, NULL OKAY ] and "count" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-VDB_EXTERN rc_t CC VCursorIdRange ( const VCursor *self, uint32_t idx,
-    int64_t *first, uint64_t *count );
-
-
-/* Open
- *  open cursor, resolving schema for the set of opened columns
- *
- *  when cursor is created for read, its initial row id
- *  is set to first row available in any contained column.
- *
- *  when cursor is created for write, its initial row id
- *  is set for inserts ( appending ). when empty, initial
- *  row id is set to 1. otherwise, it is set to 1 beyond
- *  the last row available in any contained column.
- *
- *  NB - there is no corresponding "Close"
- *  use "Release" instead.
- */
-VDB_EXTERN rc_t CC VCursorOpen ( const VCursor *self );
-
-
-/* RowId
- *  report current row id
- * SetRowId
- *  seek to given row id
- */
-VDB_EXTERN rc_t CC VCursorRowId ( const VCursor *self, int64_t *row_id );
-VDB_EXTERN rc_t CC VCursorSetRowId ( const VCursor *self, int64_t row_id );
-
-
-/* OpenRow
- *  open currently closed row indicated by row id
- */
-VDB_EXTERN rc_t CC VCursorOpenRow ( const VCursor *self );
-
-/* CommitRow
- *  commit row after writing
- *  prevents further writes
- */
-VDB_EXTERN rc_t CC VCursorCommitRow ( VCursor *self );
-
-/* RepeatRow
- *  repeats the current row by the count provided
- *  row must have been committed
- *
- *  AVAILABILITY: version 2.6
- *
- *  "count" [ IN ] - the number of times to repeat
- *  the current row.
- */
-VDB_EXTERN rc_t CC VCursorRepeatRow ( VCursor *self, uint64_t count );
-
-/* CloseRow
- *  balances OpenRow message
- *  if there are uncommitted modifications,
- *  discard all changes. otherwise,
- *  advance to next row
- */
-VDB_EXTERN rc_t CC VCursorCloseRow ( const VCursor *self );
-
-
-/* FlushPage
- *  forces flush of all buffered page data
- *  fails if row is open
- *
- *  pages are normally auto-committed based upon
- *  size and column affinity
- */
-VDB_EXTERN rc_t CC VCursorFlushPage ( VCursor *self );
-
-
-/* GetBlob
- *  retrieve a blob of data containing the current row id
- * GetBlobDirect
- *  retrieve a blob of data containing the requested row id
- *
- *  "blob" [ OUT ] - return parameter for a new reference
- *  to VBlob containing requested cell. NB - must be released
- *  via VBlobRelease when no longer needed.
- *
- *  "row_id" [ IN ] - allows ReadDirect random access to any cell
- *  in column
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- */
-VDB_EXTERN rc_t CC VCursorGetBlob ( const VCursor *self,
-    struct VBlob const **blob, uint32_t col_idx );
-VDB_EXTERN rc_t CC VCursorGetBlobDirect ( const VCursor *self,
-    struct VBlob const **blob, int64_t row_id, uint32_t col_idx );
-
-
-/* Read
- *  read entire single row of byte-aligned data into a buffer
- * ReadDirect
- *  bypass the need to use SetRowId/OpenRow/CloseRow for addressing
- *
- *  "row_id" [ IN ] - allows ReadDirect random access to any cell
- *  in column
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required
- *  to be compatible with the actual element size, and be a multiple
- *  of 8 ( byte-aligned ). for non-byte-aligned data, see ReadBits
- *
- *  "buffer" [ OUT ] and "blen" [ IN ] - return buffer for row data
- *  where "blen" gives buffer capacity in elements. the total buffer
- *  size in bytes == ( "elem_bits" * "blen" + 7 ) / 8.
- *
- *  "row_len" [ OUT ] - return parameter for the number of elements
- *  in the requested row.
- *
- *  when the return code is 0, "row_len" will contain the number of
- *  elements read into buffer. if the return code indicates that the
- *  buffer is too small, "row_len" will give the required buffer length.
- */
-VDB_EXTERN rc_t CC VCursorRead ( const VCursor *self, uint32_t col_idx,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len );
-VDB_EXTERN rc_t CC VCursorReadDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len );
-
-
-/* ReadBits
- *  read single row of potentially bit-aligned column data into a buffer
- * ReadBitsDirect
- *  bypass the need to use SetRowId/OpenRow/CloseRow for addressing
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required to be
- *  compatible with the actual element size, and may ( or may not ) be
- *  a multiple of 8 ( byte aligned ).
- *
- *  "start" [ IN ] - zero-based starting index to first element,
- *  valid from 0 .. row_len - 1
- *
- *  "buffer" [ IN ], "boff" [ IN ] and "blen" [ IN ] -
- *  return buffer for row data, where "boff" is in BITS
- *  and "blen" is in ELEMENTS.
- *
- *  "num_read" [ OUT ] - return parameter for the number of elements
- *  read, which is <= "blen"
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of elements remaining to be read. specifically,
- *  "start" + "num_read" + "remaining" == row length, assuming that
- *  "start" <= row length.
- */
-VDB_EXTERN rc_t CC VCursorReadBits ( const VCursor *self, uint32_t col_idx,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t boff,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining );
-VDB_EXTERN rc_t CC VCursorReadBitsDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t boff,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining );
-
-
-/* CellData
- *  access pointer to single cell of potentially bit-aligned column data
- * CellDataDirect
- *  bypass the need to use SetRowId/OpenRow/CloseRow for addressing
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ OUT, NULL OKAY ] - optional return parameter for
- *  element size in bits
- *
- *  "base" [ OUT ] and "boff" [ OUT, NULL OKAY ] -
- *  compound return parameter for pointer to row starting bit
- *  where "boff" is in BITS
- *
- *  "row_len" [ OUT, NULL OKAY ] - the number of elements in cell
- */
-VDB_EXTERN rc_t CC VCursorCellData ( const VCursor *self, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff,
-    uint32_t *row_len );
-VDB_EXTERN rc_t CC VCursorCellDataDirect ( const VCursor *self, int64_t row_id,
-    uint32_t col_idx, uint32_t *elem_bits, const void **base,
-    uint32_t *boff, uint32_t *row_len );
-
-
-/* Default
- *  give a default row value for cell
- *  TBD - document full cell data, not append
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - stated element size in bits, required
- *  to be compatible with the actual element size
- *
- *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
- *  to start of default row data where "boff" is in BITS
- *
- *  "row_len" [ IN ] - the number of elements in default row
- */
-VDB_EXTERN rc_t CC VCursorDefault ( VCursor *self, uint32_t col_idx,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff,
-    uint64_t row_len );
-
-
-/* Write
- *  append bit-aligned column data to cell
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - stated element size in bits, required
- *  to be compatible with the actual element size
- *
- *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
- *  to start of default row data where "boff" is in BITS
- *
- *  "count" [ IN ] - the number of elements to append
- */
-VDB_EXTERN rc_t CC VCursorWrite ( VCursor *self, uint32_t col_idx,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff,
-    uint64_t count );
-
-
-/* Commit
- *  commit changes made to cursor
- *  fails if row is open
- */
-VDB_EXTERN rc_t CC VCursorCommit ( VCursor *self );
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VCursorOpenParentRead ( const VCursor *self, struct VTable const **tbl );
-VDB_EXTERN rc_t CC VCursorOpenParentUpdate ( VCursor *self, struct VTable **tbl );
-
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ OUT ] - return parameter for getting data
- *  "data" [ IN ] - parameter for setting data
- *
- *  "destroy" [ IN, NULL OKAY ] - optional destructor param
- *  invoked from destructor of "self"
- */
-VDB_EXTERN rc_t CC VCursorGetUserData ( const VCursor *self, void **data );
-VDB_EXTERN rc_t CC VCursorSetUserData ( const VCursor *self,
-    void *data, void ( CC * destroy ) ( void *data ) );
-
-
-VDB_EXTERN rc_t CC VCursorLinkedCursorGet(const VCursor *cself,const char *tbl,VCursor const **curs);
-VDB_EXTERN rc_t CC VCursorLinkedCursorSet(const VCursor *cself,const char *tbl,VCursor const *curs);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_vdb_cursor_ */
diff --git a/interfaces/vdb/cursor.hpp b/interfaces/vdb/cursor.hpp
deleted file mode 100644
index ba89e2d..0000000
--- a/interfaces/vdb/cursor.hpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_vdb_cursor_
-#define _hpp_vdb_cursor_
-
-#ifndef _h_vdb_cursor_
-#include <vdb/cursor.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- *  a row cursor onto a VTable
- */
-struct VCursor
-{
-    /* AddRef
-     * Release
-     *  all objects are reference counted
-     *  NULL references are ignored
-     */
-    inline rc_t AddRef () const throw()
-    { return VCursorAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return VCursorRelease ( this ); }
-
-
-    /* AddColumn
-     *  add a column to an unopened cursor
-     *
-     *  "idx" [ OUT ] - return parameter for column index
-     *
-     *  "name" [ IN ] - NUL terminated column name spec.
-     *  to identify a column by name, provide the column name
-     *  by itself. if there are multiple types available under
-     *  that name, the default type for that column will be
-     *  selected. to select a specific type, the name may
-     *  be cast to that type using a cast expression, e.g.
-     *    "( type ) name"
-     *  the special name "*" may be added to a read cursor.
-     */
-    inline rc_t AddColumn ( uint32_t *idx,
-        const char *name, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VCursorVAddColumn ( this, idx, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t AddColumn ( uint32_t *idx,
-        const char *name, va_list args ) const throw()
-    { return VCursorVAddColumn ( this, idx, name, args ); }
-
-
-    /* GetColumnIdx
-     *  retrieve column index by name spec
-     *
-     *  "idx" [ OUT ] - return parameter for column index
-     *
-     *  "name" [ IN ] - NUL terminated column name spec.
-     */
-    inline rc_t GetColumnIdx ( uint32_t *idx,
-        const char *name, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VCursorVGetColumnIdx ( this, idx, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t GetColumnIdx ( uint32_t *idx,
-        const char *name, va_list args ) const throw()
-    { return  VCursorVGetColumnIdx ( this, idx, name, args ); }
-
-
-    /* Datatype
-     *  returns typedecl and/or typedef for column data
-     *
-     *  "idx" [ IN ] - column index
-     *
-     *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
-     *
-     *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
-     *  returned in "type_decl"
-     *
-     * NB - one of "type" and "def" must be non-NULL
-     */
-    inline rc_t Datatype ( uint32_t idx, VTypedecl *type, 
-        VTypedesc *desc ) const throw()
-    { return VCursorDatatype ( this, idx, type, desc ); }
-
-
-    /* IdRange
-     *  returns id range for column
-     *
-     *  "idx" [ IN, OPTIONAL ] - single column index or
-     *  zero to indicate the range for all columns in cursor
-     *
-     *  "id" [ IN ] - page containing this row id is target
-     *
-     *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
-     *  id range is returned in these output parameters, where
-     *  at least ONE must be NOT-NULL
-     */
-    inline rc_t IdRange ( int64_t *first, uint64_t *count ) const throw()
-    { return VCursorIdRange ( this, 0, first, count ); }
-
-    inline rc_t IdRange ( uint32_t idx, int64_t *first,
-        uint64_t *count ) const throw()
-    { return VCursorIdRange ( this, idx, first, count ); }
-
-
-    /* Open
-     *  open cursor, resolving schema for the set of opened columns
-     *
-     *  when cursor is created for read, its initial row id
-     *  is set to first row available in any contained column.
-     *
-     *  when cursor is created for write, its initial row id
-     *  is set for inserts ( appending ). when empty, initial
-     *  row id is set to 1. otherwise, it is set to 1 beyond
-     *  the last row available in any contained column.
-     *
-     *  NB - there is no corresponding "Close"
-     *  use "Release" instead.
-     */
-    inline rc_t Open () const throw()
-    { return VCursorOpen ( this ); }
-
-
-    /* RowId
-     *  report current row id
-     * SetRowId
-     *  seek to given row id
-     */
-    inline rc_t RowId ( int64_t *row_id ) const throw()
-    { return VCursorRowId ( this, row_id ); }
-
-    inline rc_t SetRowId ( int64_t row_id ) const throw()
-    { return VCursorSetRowId ( this, row_id ); }
-
-
-    /* OpenRow
-     *  open currently closed row indicated by row id
-     */
-    inline rc_t OpenRow () const throw()
-    { return VCursorOpenRow ( this ); }
-
-
-    /* CommitRow
-     *  commit row after writing
-     *  prevents further writes
-     */
-    inline rc_t CommitRow () throw()
-    { return VCursorCommitRow ( this ); }
-
-
-    /* CloseRow
-     *  balances OpenRow message
-     *  if there are uncommitted modifications,
-     *  discard all changes. otherwise,
-     *  advance to next row
-     */
-    inline rc_t CloseRow () const throw()
-    { return VCursorCloseRow ( this ); }
-
-
-    /* FlushPage
-     *  forces flush of all buffered page data
-     *  fails if row is open
-     *
-     *  pages are normally auto-committed based upon
-     *  size and column affinity
-     */
-    inline rc_t FlushPage () throw()
-    { return VCursorFlushPage ( this ); }
-
-
-    /* Read
-     *  read entire single row of byte-aligned data into a buffer
-     *
-     *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
-     *
-     *  "elem_bits" [ IN ] - expected element size in bits, required
-     *  to be compatible with the actual element size, and be a multiple
-     *  of 8 ( byte-aligned ). for non-byte-aligned data, see ReadBits
-     *
-     *  "buffer" [ OUT ] and "blen" [ IN ] - return buffer for row data
-     *  where "blen" gives buffer capacity in elements. the total buffer
-     *  size in bytes == ( "elem_bits" * "blen" + 7 ) / 8.
-     *
-     *  "row_len" [ OUT ] - return parameter for the number of elements
-     *  in the requested row.
-     *
-     *  when the return code is 0, "row_len" will contain the number of
-     *  elements read into buffer. if the return code indicates that the
-     *  buffer is too small, "row_len" will give the required buffer length.
-     */
-    inline rc_t Read ( uint32_t col_idx, uint32_t elem_bits,
-        void *buffer, uint32_t blen, uint32_t *row_len ) const throw()
-    {
-        return VCursorRead ( this, col_idx, elem_bits, buffer, blen,  row_len );
-    }
-    inline rc_t Read ( int64_t row_id, uint32_t col_idx, uint32_t elem_bits,
-        void *buffer, uint32_t blen, uint32_t *row_len ) const throw()
-    {
-        return VCursorReadDirect ( this, row_id, col_idx, elem_bits, buffer, blen, row_len );
-    }
-
-
-    /* ReadBits
-     *  read single row of potentially bit-aligned column data into a buffer
-     *
-     *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
-     *
-     *  "elem_bits" [ IN ] - expected element size in bits, required to be
-     *  compatible with the actual element size, and may ( or may not ) be
-     *  a multiple of 8 ( byte aligned ).
-     *
-     *  "start" [ IN ] - zero-based starting index to first element,
-     *  valid from 0 .. row_len - 1
-     *
-     *  "buffer" [ IN ], "boff" [ IN ] and "blen" [ IN ] -
-     *  return buffer for row data, where "boff" is in BITS
-     *  and "blen" is in ELEMENTS.
-     *
-     *  "num_read" [ OUT ] - return parameter for the number of elements
-     *  read, which is <= "blen"
-     *
-     *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
-     *  the number of elements remaining to be read. specifically,
-     *  "start" + "num_read" + "remaining" == row length, assuming that
-     *  "start" <= row length.
-     */
-    inline rc_t ReadBits ( const VCursor *self, uint32_t col_idx,
-        uint32_t elem_bits, uint32_t start, void *buffer, uint32_t boff,
-        uint32_t blen, uint32_t *num_read, uint32_t *remaining ) const throw()
-    {
-        return VCursorReadBits ( this, col_idx, elem_bits, start,
-            buffer, boff, blen, num_read, remaining );
-    }
-    inline rc_t ReadBits ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-        uint32_t elem_bits, uint32_t start, void *buffer, uint32_t boff,
-        uint32_t blen, uint32_t *num_read, uint32_t *remaining ) const throw()
-    {
-        return VCursorReadBitsDirect ( this, row_id, col_idx, elem_bits, 
-            start, buffer, boff, blen, num_read, remaining );
-    }
-
-
-    /* CellData
-     *  access pointer to single cell of potentially bit-aligned column data
-     *  can fail if row is dynamically generated
-     *
-     *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
-     *
-     *  "elem_bits" [ OUT, NULL OKAY ] - optional return parameter for
-     *  element size in bits
-     *
-     *  "base" [ OUT ] and "boff" [ OUT, NULL OKAY ] -
-     *  compound return parameter for pointer to row starting bit
-     *  where "boff" is in BITS
-     *
-     *  "row_len" [ OUT, NULL OKAY ] - the number of elements in cell
-     */
-    inline rc_t CellData ( uint32_t col_idx, uint32_t *elem_bits,
-        const void **base, uint32_t *boff, uint32_t *row_len ) const throw()
-    {
-        return VCursorCellData ( this, col_idx, elem_bits, base, boff, row_len );
-    }
-    inline rc_t CellData ( int64_t row_id, uint32_t col_idx, uint32_t *elem_bits,
-        const void **base, uint32_t *boff, uint32_t *row_len ) const throw()
-    {
-        return VCursorCellDataDirect ( this, row_id, col_idx, elem_bits,
-            base, boff, row_len );
-    }
-
-    /* Default
-     *  give a default row value for column
-     *
-     *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
-     *
-     *  "elem_bits" [ IN ] - stated element size in bits, required
-     *  to be compatible with the actual element size
-     *
-     *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
-     *  to start of default row data where "boff" is in BITS
-     *
-     *  "row_len" [ IN ] - the number of elements in default row
-     */
-    inline rc_t Default ( uint32_t col_idx, uint32_t elem_bits,
-        const void *buffer, uint32_t boff, uint32_t row_len ) throw()
-    {
-        return VCursorDefault ( this, col_idx, elem_bits, buffer, boff, row_len );
-    }
-
-
-    /* Write
-     *  append bit-aligned column data to row
-     *
-     *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
-     *
-     *  "elem_bits" [ IN ] - stated element size in bits, required
-     *  to be compatible with the actual element size
-     *
-     *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
-     *  to start of default row data where "boff" is in BITS
-     *
-     *  "count" [ IN ] - the number of elements to append
-     */
-    inline rc_t Write ( uint32_t col_idx, uint32_t elem_bits,
-        const void *buffer, uint32_t boff, uint32_t count ) throw()
-    {
-        return VCursorWrite ( this, col_idx, elem_bits, buffer, boff, count );
-    }
-
-
-    /* Commit
-     *  commit changes made to cursor
-     *  fails if row is open
-     */
-    inline rc_t Commit () throw()
-    { return VCursorCommit ( this ); }
-
-
-    /* OpenParent
-     *  duplicate reference to parent table
-     *  NB - returned reference must be released
-     */
-    inline rc_t OpenParent ( const VTable **tbl ) const throw()
-    { return VCursorOpenParentRead ( this, tbl ); }
-
-    inline rc_t OpenParent ( VTable **tbl ) throw()
-    { return VCursorOpenParentUpdate ( this, tbl ); }
-
-
-    /* GetUserData
-     * SetUserData
-     *  store/retrieve an opaque pointer to user data
-     *
-     *  "data" [ OUT ] - return parameter for getting data
-     *  "data" [ IN ] - parameter for setting data
-     *
-     *  "destroy" [ IN, NULL OKAY ] - optional destructor param
-     *  invoked from destructor of "self"
-     */
-    inline rc_t GetUserData ( void **data ) const throw()
-    { return VCursorGetUserData ( this, data ); }
-
-    inline rc_t SetUserData ( void *data,
-        void ( CC * destroy ) ( void *data ) = 0 ) const throw()
-    { return VCursorSetUserData ( this, data, destroy ); }
-
-
-private:
-    VCursor ();
-    ~ VCursor ();
-    VCursor ( const VCursor& );
-    VCursor &operator = ( const VCursor& );
-};
-
-#endif // _hpp_vdb_cursor_
diff --git a/interfaces/vdb/database.h b/interfaces/vdb/database.h
deleted file mode 100644
index 2753eee..0000000
--- a/interfaces/vdb/database.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_database_
-#define _h_vdb_database_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_kdb_column_
-#include <kdb/column.h>
-#endif
-
-#ifndef _h_klib_namelist_
-#include <klib/namelist.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VSchema;
-struct KMetadata;
-struct VDBManager;
-
-
-/*--------------------------------------------------------------------------
- * VDatabase
- *  opaque connection to a database within file system
- */
-typedef struct VDatabase VDatabase;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VDatabaseAddRef ( const VDatabase *self );
-VDB_EXTERN rc_t CC VDatabaseRelease ( const VDatabase *self );
-
-
-/* CreateDB
- *  create a new or open an existing database using manager
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "schema" [ IN ] - schema object containg database
- *  declaration to be used in creating db.
- *
- *  "typespec" [ IN ] - type and optionally version of db schema,
- *  e.g. 'MY_NAMESPACE:MyDatabase' or 'MY_NAMESPACE:MyDatabase#1.1'
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-VDB_EXTERN rc_t CC VDBManagerCreateDB ( struct VDBManager *self, VDatabase **db,
-    struct VSchema const *schema, const char *typespec,
-    KCreateMode cmode, const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVCreateDB ( struct VDBManager *self, VDatabase **db,
-    struct VSchema const *schema, const char *typespec,
-    KCreateMode cmode, const char *path, va_list args );
-
-
-/* CreateDB
- *  create a new or open an existing database under parent database
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "member" [ IN ] - name of database member template under parent
- *  the named member is a db template rather than a named database.
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in
- *  db-native character set giving actual table name
- */
-VDB_EXTERN rc_t CC VDatabaseCreateDB ( VDatabase *self, VDatabase **db,
-    const char *member, KCreateMode cmode, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVCreateDB ( VDatabase *self, VDatabase **db,
-    const char *member, KCreateMode cmode, const char *name, va_list args );
-
-VDB_EXTERN rc_t CC VDatabaseDropDB ( VDatabase *self, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVDropDB ( VDatabase *self, const char *name, va_list args );
-
-VDB_EXTERN rc_t CC VDatabaseDropTable ( VDatabase *self, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVDropTable ( VDatabase *self, const char *name, va_list args );
-    
-
-/* OpenDBRead
- *  open a database for read using manager
- * OpenDBUpdate
- *  open a database for read/write using manager
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "schema" [ IN, NULL OKAY ] - schema object containg database
- *  declaration to be used in creating db [ needed by manager ].
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-VDB_EXTERN rc_t CC VDBManagerOpenDBRead ( struct VDBManager const *self,
-    const VDatabase **db, struct VSchema const *schema,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVOpenDBRead ( struct VDBManager const *self,
-    const VDatabase **db, struct VSchema const *schema,
-    const char *path, va_list args );
-
-VDB_EXTERN rc_t CC VDBManagerOpenDBUpdate ( struct VDBManager *self,
-    VDatabase **db, struct VSchema const *schema,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVOpenDBUpdate ( struct VDBManager *self,
-    VDatabase **db, struct VSchema const *schema,
-    const char *path, va_list args );
-
-
-/* OpenDBRead
- *  open a database for read under parent db
- * OpenDBUpdate
- *  open or create a database for read/write under parent db
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "name" [ IN ] - NUL terminated string in
- *  db-native character set giving name of database member
- */
-VDB_EXTERN rc_t CC VDatabaseOpenDBRead ( const VDatabase *self,
-    const VDatabase **db, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVOpenDBRead ( const VDatabase *self,
-    const VDatabase **db, const char *name, va_list args );
-
-VDB_EXTERN rc_t CC VDatabaseOpenDBUpdate ( VDatabase *self,
-    VDatabase **db, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVOpenDBUpdate ( VDatabase *self,
-    VDatabase **db, const char *name, va_list args );
-
-
-/* Typespec
- *  retrieve database typespec
- *
- *  AVAILABILITY: version 2.2
- *
- *  "ts_buff" [ IN ] and "ts_size" [ IN ] - buffer for return of NUL-terminated
- *  database typespec, e.g. 'NCBI:db:abc #1.1'
- */
-VDB_EXTERN rc_t CC VDatabaseTypespec ( const VDatabase *self,
-    char *ts_buff, size_t ts_size );
-
-
-/* Locked
- *  returns true if locked
- */
-VDB_EXTERN bool CC VDatabaseLocked ( const VDatabase *self );
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-VDB_EXTERN bool CC VDatabaseIsAlias ( const VDatabase *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name );
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDatabaseWritable ( const VDatabase *self, uint32_t type,
-    const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVWritable ( const VDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDatabaseLock ( VDatabase *self, uint32_t type,
-    const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVLock ( VDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDatabaseUnlock ( VDatabase *self, uint32_t type,
-    const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVUnlock ( VDatabase *self, uint32_t type,
-    const char *name, va_list args );
-
-
-/* OpenMetadataRead
- * OpenMetadataUpdate
- *  opens metadata file
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-VDB_EXTERN rc_t CC VDatabaseOpenMetadataRead ( const VDatabase *self, struct KMetadata const **meta );
-VDB_EXTERN rc_t CC VDatabaseOpenMetadataUpdate ( VDatabase *self, struct KMetadata **meta );
-
-
-/* ColumnCreateParams
- *  sets the creation parameters for physical columns
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - the type of checksum information to
- *  apply when writing blobs
- *
- *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
- *  the default value is indicated by 0 ( zero ).
- *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
- */
-VDB_EXTERN rc_t CC VDatabaseColumnCreateParams ( VDatabase *self,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize );
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VDatabaseOpenManagerRead ( const VDatabase *self, struct VDBManager const **mgr );
-VDB_EXTERN rc_t CC VDatabaseOpenManagerUpdate ( VDatabase *self, struct VDBManager **mgr );
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VDatabaseOpenParentRead ( const VDatabase *self, const VDatabase **par );
-VDB_EXTERN rc_t CC VDatabaseOpenParentUpdate ( VDatabase *self, VDatabase **par );
-
-
-/* OpenSchema
- *  duplicate reference to db schema
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VDatabaseOpenSchema ( const VDatabase *self, struct VSchema const **schema );
-
-
-/* lists the tables of the database
- *
- * "names" [ OUT ] - return parameter for table 
- */
-VDB_EXTERN rc_t CC VDatabaseListTbl ( const VDatabase *self, KNamelist **names );
-
-/* lists the sub-databases of the database
- *
- * "names" [ OUT ] - return parameter for databases
- */
-VDB_EXTERN rc_t CC VDatabaseListDB ( const VDatabase *self, KNamelist **names );
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ OUT ] - return parameter for getting data
- *  "data" [ IN ] - parameter for setting data
- *
- *  "destroy" [ IN, NULL OKAY ] - optional destructor param
- *  invoked from destructor of "self"
- */
-VDB_EXTERN rc_t CC VDatabaseGetUserData ( const VDatabase *self, void **data );
-VDB_EXTERN rc_t CC VDatabaseSetUserData ( const VDatabase *self,
-    void *data, void ( CC * destroy ) ( void *data ) );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vdb_database_ */
diff --git a/interfaces/vdb/dependencies.h b/interfaces/vdb/dependencies.h
deleted file mode 100644
index 353ecb7..0000000
--- a/interfaces/vdb/dependencies.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-#ifndef _h_vdb_dependencies_
-#define _h_vdb_dependencies_
-
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VDatabase;
-struct VTable;
-
-
-/*--------------------------------------------------------------------------
- * VDBDependencies
- *  information about VDatabase dependencies
- *
- *  object contains zero or more dependencies
- *
- *  each dependency has a number of properties, accessible via index
- */
-typedef struct VDBDependencies VDBDependencies;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored */
-VDB_EXTERN rc_t CC VDBDependenciesAddRef ( const VDBDependencies *self );
-VDB_EXTERN rc_t CC VDBDependenciesRelease ( const VDBDependencies *self );
-
-/* ListDependencies
- *  create dependencies object: list dependencies
- *
- *  Cache could be updated after the fuction call, if caching is enabled.
- *
- *  "dep" [ OUT ] - return for VDBDependencies object
- *
- *  "missing" [ IN ] - if true, list only missing dependencies
- *  otherwise, list all dependencies
- */
-VDB_EXTERN rc_t CC VDatabaseListDependencies ( struct VDatabase const *self,
-    const VDBDependencies **dep, bool missing );
-
-/* ListDependenciesWithCaching
- *  create dependencies object: list dependencies
- *
- *  Allows to control cache update inside the function.
- *
- *  "dep" [ OUT ] - return for VDBDependencies object
- *
- *  "missing" [ IN ] - if true, list only missing dependencies
- *  otherwise, list all dependencies
- *
- *  "disableCaching" [ IN ] - if true, disable caching inside of the function
- *  otherwise, do not change the caching state
- */
-VDB_EXTERN rc_t CC VDatabaseListDependenciesWithCaching (
-    struct VDatabase const *self,
-    const VDBDependencies **dep, bool missing,
-    bool disableCaching );
-
-/* Count
- *  retrieve the number of dependencies
- *
- *  "count" [ OUT ] - return parameter for dependencies count
- */
-VDB_EXTERN rc_t CC VDBDependenciesCount ( const VDBDependencies *self,
-    uint32_t *count );
-
-
-/* Type
- *  describe the dependency object type ( see kbd/manager.h )
- *
- *  "type" [ OUT ] - a KDBPathType
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesType ( const VDBDependencies *self,
-    uint32_t *type, uint32_t idx );
-
-
-/* Local
- *  retrieve local property
- *
- *  "local" [ OUT ] - true if object is stored internally
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesLocal ( const VDBDependencies *self,
-    bool *local, uint32_t idx );
-
-
-/* SeqId
- *  retrieve sequence id of object
- *
- *  "seq_id" [ OUT ] - returned pointer should not be freed.
- *   becomes invalid after VDBDependenciesRelease
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesSeqId ( const VDBDependencies *self,
-    const char **seq_id, uint32_t idx );
-
-
-/* Name
- *  retrieve object name
- *
- * "name" [ OUT ] - returner pointed should not be freed.
- *  it becomes invalid after VDBDependenciesRelease
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesName ( const VDBDependencies *self,
-    const char **name, uint32_t idx );
-
-
-/* Circular
- *  retrieve circular property
- *  reference sequences may be circular
- *
- *  "circular" [ OUT ] - true if dependency is a circular reference table
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesCircular ( const VDBDependencies *self,
-    bool *circular, uint32_t idx );
-
-
-/* Path
- *  returns [Local] path for resolved dependency,
- *  returns NULL for local and missing dependency.
- *
- *  "path" [ OUT ] - returned pointer should not be freed.
- *   it becomes invalid after VDBDependenciesRelease
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesPath ( const VDBDependencies *self,
-    const char **path, uint32_t idx );
-
-/* PathRemote
- *  returns Remote path for dependency,
- *  returns NULL for not found dependency.
- *
- *  "path" [ OUT ] - returned pointer should not be freed.
- *   it becomes invalid after VDBDependenciesRelease
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesPathRemote ( const VDBDependencies *self,
-    const char **path, uint32_t idx );
-
-/* PathCache
- *  returns Cache path for dependency,
- *  returns NULL for not found dependency.
- *
- *  "path" [ OUT ] - returned pointer should not be freed.
- *   it becomes invalid after VDBDependenciesRelease
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-VDB_EXTERN rc_t CC VDBDependenciesPathCache ( const VDBDependencies *self,
-    const char **path, uint32_t idx );
-
-/* Error
- *  trying to analyze rc code and object
- *  in order to recognize dependencies error
- *
- *  db OR table - only one is required
- */
-VDB_EXTERN bool CC UIError( rc_t rc,
-    struct VDatabase const *db, struct VTable const *table);
-
-/* report error(s) via PLOGERR based on an object
- * log_list - if true logs the missing items list also
- */
-VDB_EXTERN void CC UIDatabaseLOGError( rc_t rc,
-    struct VDatabase const *db, bool log_list );
-VDB_EXTERN void CC UITableLOGError( rc_t rc,
-    struct VTable const *table, bool log_list );
-
-/* return human-readable string explaining rc code.
- * the string should not be freed
- */
-VDB_EXTERN const char* CC UIDatabaseGetErrorString(rc_t rc);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _h_vdb_dependencies_ */
diff --git a/interfaces/vdb/extern.h b/interfaces/vdb/extern.h
deleted file mode 100644
index 1ea8926..0000000
--- a/interfaces/vdb/extern.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_extern_
-#define _h_vdb_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define VDB_EXTERN LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define VDB_EXTERN LIB_IMPORT
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#ifdef _MSC_VER
-#define MOD_EXPORT __declspec ( dllexport )
-#else
-#define MOD_EXPORT
-#endif
-
-#endif /* _h_vdb_extern_ */
diff --git a/interfaces/vdb/manager.h b/interfaces/vdb/manager.h
deleted file mode 100644
index 90ccb2f..0000000
--- a/interfaces/vdb/manager.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_manager_
-#define _h_vdb_manager_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  opaque handle to library
- */
-typedef struct VDBManager VDBManager;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VDBManagerAddRef ( const VDBManager *self );
-VDB_EXTERN rc_t CC VDBManagerRelease ( const VDBManager *self );
-
-
-/* MakeRead
- * MakeUpdate
- *  create library handle for specific use
- *  NB - only one of the functions will be implemented
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- */
-VDB_EXTERN rc_t CC VDBManagerMakeRead ( const VDBManager **mgr, struct KDirectory const *wd );
-VDB_EXTERN rc_t CC VDBManagerMakeUpdate ( VDBManager **mgr, struct KDirectory *wd );
-
-
-/* Version
- *  returns the library version
- */
-VDB_EXTERN rc_t CC VDBManagerVersion ( const VDBManager *self, uint32_t *version );
-
-
-/* Writable
- *  returns 0 if table is writable
- *  rcLocked if locked, rcReadonly if read-only
- *  other code upon error
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDBManagerWritable ( const VDBManager *self,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVWritable ( const VDBManager *self,
-    const char *path, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDBManagerLock ( VDBManager *self, const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVLock ( VDBManager *self, const char *path, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VDBManagerUnlock ( VDBManager *self, const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVUnlock ( VDBManager *self, const char *path, va_list args );
-
-
-/* Drop
- *  drop an object based on its path
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to the vdb object
- */
-VDB_EXTERN rc_t CC VDBManagerDrop ( VDBManager *self, uint32_t obj_type, const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVDrop ( VDBManager *self, uint32_t obj_type, const char *path, va_list args );
-
-
-/* AddSchemaIncludePath
- *  add a path to schema for locating input files
- */
-VDB_EXTERN rc_t CC VDBManagerAddSchemaIncludePath ( const VDBManager *self,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVAddSchemaIncludePath ( const VDBManager *self,
-    const char *path, va_list args );
-
-
-/* AddLoadLibraryPath
- *  add a path to loader for locating dynamic libraries
- */
-VDB_EXTERN rc_t CC VDBManagerAddLoadLibraryPath ( const VDBManager *self,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVAddLoadLibraryPath ( const VDBManager *self,
-    const char *path, va_list args );
-
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ OUT ] - return parameter for getting data
- *  "data" [ IN ] - parameter for setting data
- *
- *  "destroy" [ IN, NULL OKAY ] - optional destructor param
- *  invoked from destructor of "self"
- */
-VDB_EXTERN rc_t CC VDBManagerGetUserData ( const VDBManager *self, void **data );
-VDB_EXTERN rc_t CC VDBManagerSetUserData ( const VDBManager *self,
-    void *data, void ( CC * destroy ) ( void *data ) );
-
-
-/* GetObjVersion
- *  returns the vdb-version of the given object
- *
- *  "version" [ OUT ] - discovered vdb-version
- *
- *  "path"    [ IN ] - path to the object to be examined ( database or table )
- */
-VDB_EXTERN rc_t CC VDBManagerGetObjVersion ( const VDBManager *self,
-    ver_t * version, const char *path );
-
-
-/* PathType
- *  check the path type of an object/directory path.
- *
- *  this is an extension of the KDirectoryPathType ( see <kdb/manager.h> )
- *  and will return the KDirectory values if a path type is not specifically
- *  a VDB or KDB object.
- */
-VDB_EXTERN int CC VDBManagerPathType ( const VDBManager * self,
-    const char *path, ... );
-VDB_EXTERN int CC VDBManagerVPathType ( const VDBManager * self,
-    const char *path, va_list args );
-        
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vdb_manager_ */
diff --git a/interfaces/vdb/manager.hpp b/interfaces/vdb/manager.hpp
deleted file mode 100644
index b7becc3..0000000
--- a/interfaces/vdb/manager.hpp
+++ /dev/null
@@ -1,371 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_vdb_manager_
-#define _hpp_vdb_manager_
-
-#ifndef _h_vdb_manager_
-#include <vdb/manager.h>
-#endif
-
-#ifndef _h_vdb_table_
-#include <vdb/table.h>
-#endif
-
-#ifndef _h_vdb_schema_
-#include <vdb/schema.h>
-#endif
-
-#ifndef _h_vdb_database_
-#include <vdb/database.h>
-#endif
-
-/*--------------------------------------------------------------------------
- * forward decl. for CreateDB
- */
-struct VDatabase;
-struct VSchema;
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  opaque handle to library
- */
-struct VDBManager
-{
-    /* AddRef
-     * Release
-     *  all objects are reference counted
-     *  NULL references are ignored
-     */
-    inline rc_t AddRef () const throw()
-    { return VDBManagerAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return VDBManagerRelease ( this ); }
-
-
-    /* CreateDB
-     *  create a new or open an existing database using manager
-     *
-     *  "db" [ OUT ] - return parameter for newly opened database
-     *
-     *  "schema" [ IN ] - schema object containg database
-     *  declaration to be used in creating db.
-     *
-     *  "typespec" [ IN ] - type and optionally version of db schema,
-     *  e.g. 'MY_NAMESPACE:MyDatabase' or 'MY_NAMESPACE:MyDatabase#1.1'
-     *
-     *  "cmode" [ IN ] - creation mode
-     *
-     *  "path" [ IN ] - NUL terminated string in
-     *  wd-native character set giving path to database
-     */
-    inline rc_t CreateDB ( VDatabase **db, struct VSchema const *schema,
-        const char *typespec, KCreateMode cmode, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVCreateDB ( this, db, schema, typespec, cmode, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t CreateDB ( VDatabase **db, struct VSchema const *schema,
-        const char *typespec, KCreateMode cmode, const char *path, va_list args ) throw()
-    { return VDBManagerVCreateDB ( this, db, schema, typespec, cmode, path, args ); }
-
-
-    /* OpenDBRead
-     *  open a database for read using manager
-     * OpenDBUpdate
-     *  open a database for read/write using manager
-     *
-     *  "db" [ OUT ] - return parameter for newly opened database
-     *
-     *  "schema" [ IN, NULL OKAY ] - schema object containg database
-     *  declaration to be used in creating db [ needed by manager ].
-     *
-     *  "path" [ IN ] - NUL terminated string in
-     *  wd-native character set giving path to database
-     */
-    inline rc_t OpenDB( const VDatabase **db, struct VSchema const *schema,
-        const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVOpenDBRead ( this, db, schema, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenDB( const VDatabase **db, struct VSchema const *schema,
-        const char *path, va_list args ) const throw()
-    { return VDBManagerVOpenDBRead ( this, db, schema, path, args ); }
-
-    inline rc_t OpenDB( VDatabase **db, struct VSchema const *schema,
-        const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVOpenDBUpdate ( this, db, schema, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenDB( VDatabase **db, struct VSchema const *schema,
-        const char *path, va_list args ) throw()
-    { return VDBManagerVOpenDBUpdate ( this, db, schema, path, args ); }
-
-
-    /* CreateTable
-     *  create a new or open an existing table using manager
-     *
-     *  "tbl" [ OUT ] - return parameter for newly opened table
-     *
-     *  "schema" [ IN ] - schema object containg table
-     *  declaration to be used in creating tbl.
-     *
-     *  "typespec" [ IN ] - type and optionally version of table schema,
-     *  e.g. 'MY_NAMESPACE:MyTable' or 'MY_NAMESPACE:MyTable#1.1'
-     *
-     *  "cmode" [ IN ] - creation mode
-     *
-     *  "path" [ IN ] - NUL terminated string in
-     *  wd-native character set giving path to table
-     */
-    inline rc_t CreateTable ( VTable **tbl, struct VSchema const *schema,
-        const char *typespec, KCreateMode cmode, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVCreateTable ( this, tbl, schema, typespec, cmode, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t CreateTable ( VTable **tbl, struct VSchema const *schema,
-        const char *typespec, KCreateMode cmode, const char *path, va_list args ) throw()
-    { return VDBManagerVCreateTable ( this, tbl, schema, typespec, cmode, path, args ); }
-
-
-    /* OpenTableRead
-     *  open a table for read using manager
-     * OpenTableUpdate
-     *  open a table for read/write using manager
-     *
-     *  "tbl" [ OUT ] - return parameter for newly opened table
-     *
-     *  "schema" [ IN, NULL OKAY ] - optional schema object with
-     *  latest versions of table schema.
-     *
-     *  "path" [ IN ] - NUL terminated string in
-     *  wd-native character set giving path to table
-     */
-    inline rc_t OpenTable ( const VTable **tbl, struct VSchema const *schema,
-        const char *path, ... ) const throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVOpenTableRead ( this, tbl, schema, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenTable ( const VTable **tbl, struct VSchema const *schema,
-        const char *path, va_list args ) const throw ()
-    { return VDBManagerVOpenTableRead ( this, tbl, schema, path, args ); }
-
-    inline rc_t OpenTable ( VTable **tbl, struct VSchema const *schema,
-        const char *path, ... ) throw ()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVOpenTableUpdate ( this, tbl, schema, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenTable ( VTable **tbl, struct VSchema const *schema,
-        const char *path, va_list args ) throw ()
-    { return VDBManagerVOpenTableUpdate ( this, tbl, schema, path, args ); }
-
-
-    /* MakeSchema
-     *  create a schema object
-     */
-    inline rc_t MakeSchema ( VSchema **schema ) const throw()
-    { return VDBManagerMakeSchema ( this, schema ); }
-
-
-    /* MakeRead
-     * MakeUpdate
-     *  create library handle for specific use
-     *  NB - only one of the functions will be implemented
-     *
-     *  "wd" [ IN, NULL OKAY ] - optional working directory for
-     *  accessing the file system. mgr will attach its own reference.
-     */
-    static inline rc_t MakeRead ( const VDBManager **mgr,
-        const KDirectory *wd = 0 ) throw()
-    { return VDBManagerMakeRead ( mgr, wd ); }
-
-    static inline rc_t MakeUpdate ( VDBManager **mgr,
-        KDirectory *wd = 0 ) throw()
-    { return VDBManagerMakeUpdate ( mgr, wd ); }
-
-
-    /* Version
-     *  returns the library version
-     */
-    inline rc_t Version ( uint32_t *version ) const throw()
-    { return VDBManagerVersion ( this, version ); }
-
-
-    /* Writable
-     *  returns 0 if object is writable
-     *  or a reason why if not
-     *
-     *  "path" [ IN ] - NUL terminated path
-     */
-    inline rc_t Writable ( const char *path, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVWritable ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Writable ( const char *path, va_list args ) const throw()
-    { return VDBManagerVWritable ( this, path, args ); }
-
-
-    /* Lock
-     *  apply lock
-     *
-     *  if object is already locked, the operation is idempotent
-     *  and returns an rc state of rcLocked
-     *
-     *  "path" [ IN ] - NUL terminated path
-     */
-    inline rc_t Lock ( const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVLock ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Lock ( const char *path, va_list args ) throw()
-    { return VDBManagerVLock ( this, path, args ); }
-
-
-    /* Unlock
-     *  remove lock
-     *
-     *  if object is already unlocked, the operation is idempotent
-     *  and returns an rc state of rcUnlocked
-     *
-     *  "path" [ IN ] - NUL terminated path
-     */
-    inline rc_t Unlock ( const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVUnlock ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Unlock ( const char *path, va_list args ) throw()
-    { return VDBManagerVUnlock ( this, path, args ); }
-
-
-    /* Drop
-     *  drop an object based on its path
-     *
-     *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to the vdb object
-     */
-    inline rc_t Drop( uint32_t obj_type, const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVDrop ( this, obj_type, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Drop( uint32_t obj_type, const char *path, va_list args ) throw()
-    { return VDBManagerVDrop ( this, obj_type, path, args ); }
-
-
-    /* AddSchemaIncludePath
-     *  add a path to schema for locating input files
-     */
-    inline rc_t AddSchemaIncludePath ( const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVAddSchemaIncludePath ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t AddSchemaIncludePath ( const char *path, va_list args ) throw()
-    { return VDBManagerVAddSchemaIncludePath ( this, path, args ); }
-
-
-    /* AddLoadLibraryPath
-     *  add a path to loader for locating dynamic libraries
-     */
-    inline rc_t AddLoadLibraryPath ( const char *path, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, path );
-        rc_t rc = VDBManagerVAddLoadLibraryPath ( this, path, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t AddLoadLibraryPath ( const char *path, va_list args ) throw()
-    { return VDBManagerVAddLoadLibraryPath ( this, path, args ); }
-
-
-    /* GetUserData
-     * SetUserData
-     *  store/retrieve an opaque pointer to user data
-     *
-     *  "data" [ OUT ] - return parameter for getting data
-     *  "data" [ IN ] - parameter for setting data
-     *
-     *  "destroy" [ IN, NULL OKAY ] - optional destructor param
-     *  invoked from destructor of "self"
-     */
-    inline rc_t GetUserData ( void **data ) const throw()
-    { return VDBManagerGetUserData ( this, data ); }
-
-    inline rc_t SetUserData ( void *data,
-        void ( CC * destroy ) ( void *data ) = 0 ) const throw()
-    { return VDBManagerSetUserData ( this, data, destroy ); }
-
-
-private:
-    VDBManager ();
-    ~ VDBManager ();
-    VDBManager ( const VDBManager& );
-    VDBManager &operator = ( const VDBManager& );
-};
-
-#endif // _hpp_vdb_manager_
diff --git a/interfaces/vdb/report.h b/interfaces/vdb/report.h
deleted file mode 100644
index 90d3695..0000000
--- a/interfaces/vdb/report.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_report_
-#define _h_vdb_report_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VDBManager;
-struct VDatabase;
-struct VTable;
-
-
-/*--------------------------------------------------------------------------
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-
-/* SetVDBManager
- *  remember the manager in use
- */
-VDB_EXTERN rc_t CC ReportSetVDBManager ( struct VDBManager const *mgr );
-
-
-/* SetDatabase
- *  To be called after application successfully opened Database
- *  specified in command line.
- *  If the application supports multiple objects passed in command line
- *  to be processed in a loop: should be called for each argument database.
- *
- *  "path" [ IN ] - path to the database that is used to access it
- */
-VDB_EXTERN rc_t CC ReportResetDatabase ( const char *path,
-    struct VDatabase const *db );
-
-
-/* SetTable
- *  To be called after application successfully opened Table
- *  specified in command line.
- *  If the application supports multiple objects passed in command line
- *  to be processed in a loop: should be called for each argument table.
- *
- *  "path" [ IN ] - path to the table that is used to access it
- */
-VDB_EXTERN rc_t CC ReportResetTable ( const char *path,
-    struct VTable const *tbl );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vdb_report_ */
diff --git a/interfaces/vdb/schema.h b/interfaces/vdb/schema.h
deleted file mode 100644
index e0db467..0000000
--- a/interfaces/vdb/schema.h
+++ /dev/null
@@ -1,460 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_schema_
-#define _h_vdb_schema_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KNamelist;
-struct VDBManager;
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- *  a virtual table schema
- *
- *  a schema is built from column, type and sub-schema declarations. The
- *  pseudo-BNF below gives a simplified description of the structure,
- *  with certain contextual constraints omitted.
- *
- *  at the global level, both read and write column declarations are permitted.
- *  type declarations are permitted at any level but always enter into global
- *  scope.
- *
- *  column names may be overloaded to allow for multiple data types under a
- *  single name. a column is identified by its ( name, datatype ) pair. the
- *  pairing ( name, NULL ) identifies the default type for name.
- *
- *  column declarations are intentionally created by assignment ( '=' ) or
- *  are updated with additional productions by appending ( '+=' ). this
- *  distinction is intended to prevent unintended consequences.
- *
- *  column productions come in the form of a simple column assignment, a
- *  data conversion function, or a sub-schema function. the simple column
- *  production takes a column name, the functions take some combination of
- *  constant and column name parameters.
- *
- *  a column assignment source ( column, function or sub-schema ) will have
- *  its own data type. when assigned directly, it must match the destination
- *  type either exactly or as the result of implicit type promotion. as an
- *  alternative, an explicit up or down cast ( or casts ) may be performed as
- *  an aid in source resolution.
- *
- *  read column declarations introduce a virtual column by ( name, datatype ).
- *  globally, they may be declared as "extern" to make them accessible via the
- *  API. extern columns may have any of their productions tagged as "default"
- *  to assign significance to the pair ( name, NULL ). when more than one type
- *  for a name is tagged as default, the most recently resolved is arbitrarily
- *  chosen. read source columns may be virtual or physical if the latter is
- *  within scope.
- *
- *  write column declarations introduce virtual columns by ( name, datatype ),
- *  and define physical column ( encoding, decoding ) bindings. virtual columns
- *  may be introduced as "extern" at global scope, where they have no source
- *  productions given that they take their input from the API. non-extern
- *  write columns are virtual and allow normal column productions with the
- *  exception that they may not be sourced by physical columns.
- *
- *  one special write column declaration introduces physical columns by
- *  name only ( name overloading cannot exist in the physical layer ) and
- *  requires a special production that binds together two sub-schema functions;
- *  one for encoding and the other for decoding.
- */
-typedef struct VSchema VSchema;
-
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VSchemaAddRef ( const VSchema *self );
-VDB_EXTERN rc_t CC VSchemaRelease ( const VSchema *self );
-
-
-/* Make
- *  create a schema object
- */
-VDB_EXTERN rc_t CC VDBManagerMakeSchema ( struct VDBManager const *self, VSchema **schema );
-
-
-/* AddIncludePath
- *  add an include path to schema for locating input files
- */
-VDB_EXTERN rc_t CC VSchemaAddIncludePath ( VSchema *self, const char *path, ... );
-VDB_EXTERN rc_t CC VSchemaVAddIncludePath ( VSchema *self, const char *path, va_list args );
-
-
-/* ParseText
- *  parse schema text
- *  add productions to existing schema
- *
- *  "name" [ IN, NULL OKAY ] - optional name
- *  representing text, e.g. filename
- *
- *  "text" [ IN ] and "bytes" [ IN ] - input buffer of text
- */
-VDB_EXTERN rc_t CC VSchemaParseText ( VSchema *self, const char *name,
-    const char *text, size_t bytes );
-
-
-/* ParseFile
- *  parse schema file
- *  add productions to existing schema
- *
- *  "name" [ IN ] - filename, absolute or valid relative to
- *  working directory or within an include path
- */
-VDB_EXTERN rc_t CC VSchemaParseFile ( VSchema *self, const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaVParseFile ( VSchema *self, const char *name, va_list args );
-
-
-/* Dump
- *  dump schema as text
- *
- *  "mode" [ IN ] - selects textual conversion mode ( see VSchemaDumpMode )
- *
- *  "decl" [ IN, NULL OKAY ] - selects a declaration to dump
- *
- *  "flush" [ IN ] and "dst" [ IN, OPAQUE ] - callback for delivering
- *  buffered schema text
- */
-enum VSchemaDumpMode
-{
-    sdmPrint,            /* standard display for reading and printing */
-    sdmCompact           /* compacted white-space representation      */
-};
-
-VDB_EXTERN rc_t CC VSchemaDump ( const VSchema *self, uint32_t mode, const char *decl,
-    rc_t ( CC * flush ) ( void *dst, const void *buffer, size_t bsize ), void *dst );
-
-
-/* IncludeFiles
- *  generates a list of paths to include file
- */
-VDB_EXTERN rc_t CC VSchemaIncludeFiles ( const VSchema *self, struct KNamelist const **list );
-
-
-/*--------------------------------------------------------------------------
- * VTypedecl
- *  a runtime type id and vector dimension
- *
- *  describes the general form of a type declaration: "TYPE [ DIM ]"
- */
-typedef struct VTypedecl VTypedecl;
-struct VTypedecl
-{
-    /* runtime type id */
-    uint32_t type_id;
-
-    /* vector dimension */
-    uint32_t dim;
-};
-
-
-/* Resolve
- *  converts a typedecl string to type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved type declaration
- *
- *  "typedecl" [ IN ] - type declaration
- */
-VDB_EXTERN rc_t CC VSchemaResolveTypedecl ( const VSchema *self,
-    VTypedecl *resolved, const char *typedecl, ... );
-VDB_EXTERN rc_t CC VSchemaVResolveTypedecl ( const VSchema *self,
-    VTypedecl *resolved, const char *typedecl, va_list args );
-
-
-/* ToText
- *  convert a VTypedecl into canonical text
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated type declaration string
- */
-VDB_EXTERN rc_t CC VTypedeclToText ( const VTypedecl *self,
-    const VSchema *schema, char *buffer, size_t bsize );
-
-
-/* ToSupertype
- *  attempt to cast a typedecl to a size-equivalent supertype decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "cast" [ OUT ] - return parameter for supertype decl
- *  valid only if function returns true.
- *
- *  returns true if cast succeeded
- */
-VDB_EXTERN bool CC VTypedeclToSupertype ( const VTypedecl *self,
-    const VSchema *schema, VTypedecl *cast );
-
-
-/* ToType
- *  attempt to cast a typedecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target type or typeset for cast
- *
- *  "cast" [ OUT ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" was a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
- *  generations. valid only if function returns true. a value of 0 means
- *  that "self" is a direct match with "ancestor", a value of 1 means that
- *  "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-VDB_EXTERN bool CC VTypedeclToType ( const VTypedecl *self,
-    const VSchema *schema,  uint32_t ancestor,
-    VTypedecl *cast, uint32_t *distance );
-
-
-/* ToTypedecl
- *  attempt to cast a typedecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target typedecl or typeset for cast
- *
- *  "cast" [ OUT, NULL OKAY ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" was a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
- *  generations. valid only if function returns true. a value of 0 means
- *  that "self" is a direct match with "ancestor", a value of 1 means that
- *  "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-VDB_EXTERN bool CC VTypedeclToTypedecl ( const VTypedecl *self,
-    const VSchema *schema, const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance );
-
-
-/* CommonAncestor
- *  find a common ancestor between "self" and "peer"
- *  returns distance as sum of distances from each to "ancestor"
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "peer" [ IN ] - typedecl or typeset to compare against self
- *
- *  "ancestor" [ OUT, NULL OKAY ] - return parameter for closest
- *  common ancestor decl. valid only if function returns true.
- *
- *  "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
- *  generations. valid only if function returns true. a value of 0 means
- *  that "self" is a direct match with "peer", a value of 1 means that
- *  "self" is an immediate subtype of "peer", or vice-versa, etc.
- *  measured as the sum of distances self=>ancestor and peer=>ancestor
- */
-VDB_EXTERN bool CC VTypedeclCommonAncestor ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *peer, VTypedecl *ancestor, uint32_t *distance );
-
-
-/*--------------------------------------------------------------------------
- * VTypedesc
- *  describes the fundamental properties of a VTypedecl
- *  replaces the deprecated structure VTypedef
- *
- *  VTypedecl describes an element in terms of the element's
- *  super-type id and vector dimension.
- *
- *  VTypedesc describes an element in terms of the element's
- *  intrinsic type domain and size, and the vector dimension
- *  is adjusted to reflect the intrinsic super-type.
- *
- *  the effect is as if a VTypedecl were cast toward its most
- *  fundamental supertype using "VTypedeclToSupertype", and
- *  the final size and dimension are taken from there:
- *
- *    given - VTypedecl td; const VSchema *schema;
- *    while ( VTypedeclToSupertype ( & td, schema, & td ) )
- *        ( void ) 0;
- *
- *    then -
- *    VTypedesc desc =
- *    {
- *      bit_sizeof_type ( td . type_id ),
- *      td . dim,
- *      domain_of_type ( td . type_id )
- *    }
- */
-enum
-{
-    /* boolean domain */
-    vtdBool = 1,
-
-    /* numeric domains */
-    vtdUint, vtdInt, vtdFloat,
-
-    /* textual domains */
-    vtdAscii, vtdUnicode
-};
-
-typedef struct VTypedesc VTypedesc;
-struct VTypedesc
-{
-    /* sizeof intrinsic supertype */
-    uint32_t intrinsic_bits;
-
-    /* recalculated vector dimension */
-    uint32_t intrinsic_dim;
-
-    /* data domain */
-    uint32_t domain;
-};
-
-
-/* Sizeof
- */
-VDB_EXTERN uint32_t CC VTypedescSizeof ( const VTypedesc *self );
-
-
-/* DescribeTypedecl
- *  produce a description of typedecl properties
- */
-VDB_EXTERN rc_t CC VSchemaDescribeTypedecl ( const VSchema *self,
-    VTypedesc *desc, const VTypedecl *td );
-
-
-
-/*--------------------------------------------------------------------------
- * VSchemaRuntimeTable
- *  an object that represents a table ( or sub-table ) created at runtime
- *  that can be used to create a VTable object
- */
-typedef struct VSchemaRuntimeTable VSchemaRuntimeTable;
-
-
-/* Make
- *  make a table in the schema provided
- *
- *  "tbl" [ OUT ] - return parameter for new schema table object
- *
- *  "type_name" [ IN ] - NUL terminated string giving desired typename of table
- *   may include version spec - otherwise, a version of #1.0 will be assigned.
- *
- *  "supertype_spec" [ IN, NULL OKAY ] - optional supertype spec, giving
- *   either a single super-table type string or multiple comma-separated tables
- */
-VDB_EXTERN rc_t CC VSchemaMakeRuntimeTable ( VSchema *self,
-    VSchemaRuntimeTable **tbl, const char *type_name, const char *supertype_spec );
-
-
-/* Close
- *  close the schema table handle
- *  discards any uncomitted data
- */
-VDB_EXTERN rc_t CC VSchemaRuntimeTableClose ( VSchemaRuntimeTable *self );
-
-
-/* Commit
- *  commits table data
- *  closes object to further modification
- */
-VDB_EXTERN rc_t CC VSchemaRuntimeTableCommit ( VSchemaRuntimeTable *self );
-
-
-/* AddColumn
- *  add a simple column to the table
- *
- *  "td" [ IN ] - data type of column, obtained from schema object
- *
- *  "encoding" [ IN, NULL OKAY ] - optional compression/encoding type
- *  specified as a NUL-terminated string
- *
- *  "name" [ IN ] - NUL-terminated simple ASCII name
- *   conforming to column name requirements
- */
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddColumn ( VSchemaRuntimeTable *self, 
-    const VTypedecl *td, const char *encoding, const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddColumn ( VSchemaRuntimeTable *self, 
-    const VTypedecl *td, const char *encoding, const char *name, va_list args );
-
-
-/* AddTypedColumn
- *  Gerber versions of AddColumn
- *
- *  AddBooleanColumn - simple boolean column with default compression
- *                     provides both packed ( single bit ) and byte versions
- *  AddIntegerColumn - sized integer column with appropriate sign, size and compression
- *  AddFloatColumn   - sized floating point column with lossy compression
- *  AddAsciiColumn   - 8-bit ASCII text column with standard compression
- *  AddUnicodeColumn - UTF8, UTF16, or UTF32 text column with standard compression
- */
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddBooleanColumn ( VSchemaRuntimeTable *self,
-    const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddIntegerColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, bool has_sign,  const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddFloatColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, uint32_t significant_mantissa_bits,  const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddAsciiColumn ( VSchemaRuntimeTable *self,
-    const char *name, ... );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableAddUnicodeColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, const char *name, ... );
-
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddBooleanColumn ( VSchemaRuntimeTable *self,
-    const char *name, va_list args );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddIntegerColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, bool has_sign,  const char *name, va_list args );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddFloatColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, uint32_t significant_mantissa_bits,  const char *name, va_list args );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddAsciiColumn ( VSchemaRuntimeTable *self,
-    const char *name, va_list args );
-VDB_EXTERN rc_t CC VSchemaRuntimeTableVAddUnicodeColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, const char *name, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_vdb_schema_ */
diff --git a/interfaces/vdb/table.h b/interfaces/vdb/table.h
deleted file mode 100644
index 601740b..0000000
--- a/interfaces/vdb/table.h
+++ /dev/null
@@ -1,401 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_table_
-#define _h_vdb_table_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_kdb_column_
-#include <kdb/column.h>
-#endif
-
-#ifndef _h_kdb_index_
-#include <kdb/index.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VSchema;
-struct KMetadata;
-struct KNamelist;
-struct VDatabase;
-struct VDBManager;
-
-
-/*--------------------------------------------------------------------------
- * VTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-typedef struct VTable VTable;
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-VDB_EXTERN rc_t CC VTableAddRef ( const VTable *self );
-VDB_EXTERN rc_t CC VTableRelease ( const VTable *self );
-
-
-/* CreateTable
- *  create a new or open an existing table using manager
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "schema" [ IN ] - schema object containg table
- *  declaration to be used in creating tbl.
- *
- *  "typespec" [ IN ] - type and optionally version of table schema,
- *  e.g. 'MY_NAMESPACE:MyTable' or 'MY_NAMESPACE:MyTable#1.1'
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-VDB_EXTERN rc_t CC VDBManagerCreateTable ( struct VDBManager *self, VTable **tbl,
-    struct VSchema const *schema, const char *typespec,
-    KCreateMode cmode, const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVCreateTable ( struct VDBManager *self, VTable **tbl,
-    struct VSchema const *schema, const char *typespec,
-    KCreateMode cmode, const char *path, va_list args );
-
-
-/* CreateTable
- *  create a new or open an existing table under database
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "member" [ IN ] - name of table member template under database
- *  the named member is a table template rather than a named table.
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in
- *  db-native character set giving actual table name
- */
-VDB_EXTERN rc_t CC VDatabaseCreateTable ( struct VDatabase *self, VTable **tbl,
-    const char *member, KCreateMode cmode, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVCreateTable ( struct VDatabase *self, VTable **tbl,
-    const char *member, KCreateMode cmode, const char *name, va_list args );
-
-
-/* OpenTableRead
- *  open a table for read using manager
- * OpenTableUpdate
- *  open a table for read/write using manager
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "schema" [ IN, NULL OKAY ] - optional schema object with
- *  latest versions of table schema.
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-VDB_EXTERN rc_t CC VDBManagerOpenTableRead ( struct VDBManager const *self,
-    const VTable **tbl, struct VSchema const *schema,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVOpenTableRead ( struct VDBManager const *self,
-    const VTable **tbl, struct VSchema const *schema,
-    const char *path, va_list args );
-
-VDB_EXTERN rc_t CC VDBManagerOpenTableUpdate ( struct VDBManager *self,
-    VTable **tbl, struct VSchema const *schema,
-    const char *path, ... );
-VDB_EXTERN rc_t CC VDBManagerVOpenTableUpdate ( struct VDBManager *self,
-    VTable **tbl, struct VSchema const *schema,
-    const char *path, va_list args );
-
-
-/* OpenTableRead
- *  open a table for read under database
- * OpenTableUpdate
- *  open or create a table for read/write under database
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "name" [ IN ] - NUL terminated string in
- *  db-native character set giving name of table member
- */
-VDB_EXTERN rc_t CC VDatabaseOpenTableRead ( struct VDatabase const *self,
-    const VTable **tbl, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVOpenTableRead ( struct VDatabase const *self,
-    const VTable **tbl, const char *name, va_list args );
-
-VDB_EXTERN rc_t CC VDatabaseOpenTableUpdate ( struct VDatabase *self,
-    VTable **tbl, const char *name, ... );
-VDB_EXTERN rc_t CC VDatabaseVOpenTableUpdate ( struct VDatabase *self,
-    VTable **tbl, const char *name, va_list args );
-
-
-/* Typespec
- *  retrieve table typespec
- *
- *  AVAILABILITY: version 2.1
- *
- *  "ts_buff" [ IN ] and "ts_size" [ IN ] - buffer for return of NUL-terminated
- *  table typespec, e.g. 'NCBI:tbl:abc #1.1'
- */
-VDB_EXTERN rc_t CC VTableTypespec ( const VTable *self,
-    char *ts_buff, size_t ts_size );
-
-
-/* Locked
- *  returns true if locked
- */
-VDB_EXTERN bool CC VTableLocked ( const VTable *self );
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VTableWritable ( const VTable *self, uint32_t type,
-    const char * name, ... );
-VDB_EXTERN rc_t CC VTableVWritable ( const VTable *self, uint32_t type,
-    const char * name, va_list args );
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VTableLock ( VTable *self, uint32_t type,
-    const char * name, ... );
-VDB_EXTERN rc_t CC VTableVLock ( VTable *self, uint32_t type,
-    const char * name, va_list args );
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-VDB_EXTERN rc_t CC VTableUnlock ( VTable *self, uint32_t type,
-    const char * name, ... );
-VDB_EXTERN rc_t CC VTableVUnlock ( VTable *self, uint32_t type,
-    const char * name, va_list args );
-
-
-/* OpenMetadataRead
- * OpenMetadataUpdate
- *  opens metadata file
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-VDB_EXTERN rc_t CC VTableOpenMetadataRead ( const VTable *self, struct KMetadata const **meta );
-VDB_EXTERN rc_t CC VTableOpenMetadataUpdate ( VTable *self, struct KMetadata **meta );
-
-
-/* ColumnCreateParams
- *  sets the creation parameters for physical columns
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - the type of checksum information to
- *  apply when writing blobs
- *
- *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
- *  the default value is indicated by 0 ( zero ).
- *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
- */
-VDB_EXTERN rc_t CC VTableColumnCreateParams ( VTable *self,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize );
-
-
-/* CreateIndex
- * VCreateIndex
- *  create a new or open an existing index
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "type" [ IN ] - type of index to create
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-VDB_EXTERN rc_t CC VTableCreateIndex ( VTable *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... );
-VDB_EXTERN rc_t CC VTableVCreateIndex ( VTable *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args );
-
-
-/* OpenIndexRead
- * VOpenIndexRead
- *  open an index for read
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-VDB_EXTERN rc_t CC VTableOpenIndexRead ( const VTable *self,
-    const KIndex **idx, const char *name, ... );
-VDB_EXTERN rc_t CC VTableVOpenIndexRead ( const VTable *self,
-    const KIndex **idx, const char *name, va_list args );
-
-
-/* OpenIndexUpdate
- * VOpenIndexUpdate
- *  open an index for read/write
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-
-VDB_EXTERN rc_t CC VTableOpenIndexUpdate ( VTable *self,
-    KIndex **idx, const char *name, ... );
-VDB_EXTERN rc_t CC VTableVOpenIndexUpdate ( VTable *self,
-    KIndex **idx, const char *name, va_list args );
-
-
-/* ListColumns
- *  list readable or writable column names
- *
- *  "names" [ OUT ] - return parameter for namelist
- *
- *  availability: v2.1
- */
-VDB_EXTERN rc_t CC VTableListReadableColumns ( const VTable *self, struct KNamelist **names );
-VDB_EXTERN rc_t CC VTableListWritableColumns ( VTable *self, struct KNamelist **names );
-
-
-/* ListCol
- *  alias for VTableListReadableColumns
- *
- *  availability: v2.0
- */
-VDB_EXTERN rc_t CC VTableListCol ( const VTable *self, struct KNamelist **names );
-
-
-/* ListDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
- *  into "typedecls" of the default datatype for the named column
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- *
- *  availability: v2.1
- */
-VDB_EXTERN rc_t CC VTableListReadableDatatypes ( const VTable *self, const char *col,
-    uint32_t *dflt_idx, struct KNamelist **typedecls );
-VDB_EXTERN rc_t CC VTableListWritableDatatypes ( VTable *self,
-    const char *col, struct KNamelist **typedecls );
-
-
-/* ColumnDatatypes
- *  alias for VTableListReadableDatatypes
- *
- *  availability: v2.0
- */
-VDB_EXTERN rc_t CC VTableColumnDatatypes ( const VTable *self, const char *col,
-    uint32_t *dflt_idx, struct KNamelist **typedecls );
-
-
-/* Reindex
- *  optimize column indices
- */
-VDB_EXTERN rc_t CC VTableReindex ( VTable *self );
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VTableOpenManagerRead ( const VTable *self, struct VDBManager const **mgr );
-VDB_EXTERN rc_t CC VTableOpenManagerUpdate ( VTable *self, struct VDBManager **mgr );
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VTableOpenParentRead ( const VTable *self, struct VDatabase const **db );
-VDB_EXTERN rc_t CC VTableOpenParentUpdate ( VTable *self, struct VDatabase **db );
-
-
-/* OpenSchema
- *  duplicate reference to table schema
- *  NB - returned reference must be released
- */
-VDB_EXTERN rc_t CC VTableOpenSchema ( const VTable *self, struct VSchema const **schema );
-
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ OUT ] - return parameter for getting data
- *  "data" [ IN ] - parameter for setting data
- *
- *  "destroy" [ IN, NULL OKAY ] - optional destructor param
- *  invoked from destructor of "self"
- */
-VDB_EXTERN rc_t CC VTableGetUserData ( const VTable *self, void **data );
-VDB_EXTERN rc_t CC VTableSetUserData ( const VTable *self,
-    void *data, void ( CC * destroy ) ( void *data ) );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_vdb_table_ */
diff --git a/interfaces/vdb/table.hpp b/interfaces/vdb/table.hpp
deleted file mode 100644
index 3270a22..0000000
--- a/interfaces/vdb/table.hpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_vdb_table_
-#define _hpp_vdb_table_
-
-#ifndef _h_vdb_table_
-#include <vdb/table.h>
-#endif
-
-#ifndef _h_vdb_cursor_
-#include <vdb/cursor.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-struct VTable
-{
-    /* AddRef
-     * Release
-     *  all objects are reference counted
-     *  NULL references are ignored
-     */
-    inline rc_t AddRef ( const VTable *self ) const throw()
-    { return VTableAddRef ( this ); }
-    inline rc_t Release ( const VTable *self ) const throw()
-    { return VTableRelease ( this ); }
-
-    /* Locked
-     *  returns true if locked
-     */
-    inline bool Locked () const throw()
-    { return VTableLocked ( this ); }
-
-
-    /* Writable
-     *  returns 0 if object is writable
-     *  or a reason why if not
-     *
-     *  "type" [ IN ] - a KDBPathType
-     *  valid values are kptIndex and kptColumn
-     *
-     *  "path" [ IN ] - NUL terminated path
-     */
-     inline rc_t Writable ( uint32_t type, 
-        const char * name, ... ) const throw()
-     {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVWritable ( this, type, name, args );
-        va_end ( args );
-        return rc;
-     }
-     inline rc_t Writable ( uint32_t type, 
-        const char * name, va_list args ) const throw()
-    { return VTableVWritable ( this, type, name, args ); }
-
-
-    /* Lock
-     *  apply lock
-     *
-     *  if object is already locked, the operation is idempotent
-     *  and returns an rc state of rcLocked
-     *
-     *  "type" [ IN ] - a KDBPathType
-     *  valid values are kptIndex and kptColumn
-     *
-     *  "name" [ IN ] - NUL terminated path
-     */
-    inline rc_t Lock ( uint32_t type, const char * name, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVLock ( this, type, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t Lock ( uint32_t type, const char * name, va_list args ) throw()
-    { return VTableVLock ( this, type, name, args ); }
-
-    
-    /* Unlock
-     *  remove lock
-     *
-     *  if object is already unlocked, the operation is idempotent
-     *  and returns an rc state of rcUnlocked
-     *
-     *  "type" [ IN ] - a KDBPathType
-     *  valid values are kptIndex and kptColumn
-     *
-     *  "name" [ IN ] - NUL terminated path
-     */
-     inline rc_t Unlock ( uint32_t type, const char * name, ... ) throw()
-     {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVUnlock ( this, type, name, args );
-        va_end ( args );
-        return rc;
-     }
-    inline rc_t UnLock ( uint32_t type, const char * name, va_list args ) throw()
-    { return VTableVUnlock ( this, type, name, args ); }
-
-
-    /* OpenMetadataRead
-     * OpenMetadataUpdate
-     *  opens metadata file
-     *
-     *  "meta" [ OUT ] - return parameter for metadata
-     */
-    inline rc_t OpenMetadataRead ( struct KMetadata const **meta ) const throw()
-    { return VTableOpenMetadataRead ( this, meta ); }
-    inline rc_t OpenMetadataUpdate ( struct KMetadata **meta ) throw()
-    { return VTableOpenMetadataUpdate ( this, meta ); }
-    
-
-    /* ColumnCreateParams
-     *  sets the creation parameters for physical columns
-     *
-     *  "cmode" [ IN ] - creation mode
-     *
-     *  "checksum" [ IN ] - the type of checksum information to
-     *  apply when writing blobs
-     *
-     *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
-     *  the default value is indicated by 0 ( zero ).
-     *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
-     */
-    inline rc_t ColumnCreateParams ( KCreateMode cmode, 
-        KChecksum checksum, size_t pgsize ) throw()
-    { return VTableColumnCreateParams ( this, cmode, checksum, pgsize ); }
-
-
-    /* CreateIndex
-     * VCreateIndex
-     *  create a new or open an existing index
-     *
-     *  "idx" [ OUT ] - return parameter for newly opened index
-     *
-     *  "type" [ IN ] - type of index to create
-     *
-     *  "cmode" [ IN ] - creation mode
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
-     */
-    inline rc_t CreateIndex ( KIndex **idx,
-        KIdxType type, KCreateMode cmode, const char *name, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVCreateIndex ( this, idx, type, cmode, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t CreateIndex ( KIndex **idx,
-        KIdxType type, KCreateMode cmode, const char *name, va_list args ) throw()
-    { return VTableVCreateIndex ( this, idx, type, cmode, name, args ); }
-
-
-    /* OpenIndexRead
-     * VOpenIndexRead
-     *  open an index for read
-     *
-     *  "idx" [ OUT ] - return parameter for newly opened index
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
-     */
-    inline rc_t OpenIndexRead ( const KIndex **idx,
-        const char *name, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVOpenIndexRead ( this, idx, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenIndexRead ( const KIndex **idx,
-        const char *name, va_list args ) const throw()
-    { return VTableVOpenIndexRead ( this, idx, name, args ); }
-
-
-    /* OpenIndexUpdate
-     * VOpenIndexUpdate
-     *  open an index for read/write
-     *
-     *  "idx" [ OUT ] - return parameter for newly opened index
-     *
-     *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
-     */
-    inline rc_t OpenIndexUpdate ( KIndex **idx,
-        const char *name, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, name );
-        rc_t rc = VTableVOpenIndexUpdate ( this, idx, name, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t OpenIndexUpdate ( KIndex **idx,
-        const char *name, va_list args ) throw()
-    { return VTableVOpenIndexUpdate ( this, idx, name, args ); }
-
-
-    /* List
-     *  create table listings
-     */
-    inline rc_t ListCol ( struct KNamelist **names ) const throw()
-    { return VTableListCol ( this, names ); }
-
-
-    /* ColumnDatatypes
-     *  returns list of typedecls for named column
-     *
-     *  "col" [ IN ] - column name
-     *
-     *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
-     *  into "typedecls" of the default datatype for the named column
-     *
-     *  "typedecls" [ OUT ] - list of datatypes available for named column
-     */
-    inline rc_t ColumnDatatypes ( const char *col,
-        uint32_t *dflt_idx, struct KNamelist **typedecls ) const throw()
-    { return VTableColumnDatatypes ( this, col, dflt_idx, typedecls ); }
-
-
-    /* Reindex
-     *  optimize column indices
-     */
-    inline rc_t Reindex () throw()
-    { return VTableReindex ( this ); }
-
-
-    /* OpenManager
-     *  duplicate reference to manager
-     *  NB - returned reference must be released
-     */
-    inline rc_t OpenManager ( struct VDBManager const **mgr ) const throw()
-    { return VTableOpenManagerRead ( this, mgr ); }
-    inline rc_t OpenManager ( struct VDBManager **mgr ) throw()
-    { return VTableOpenManagerUpdate ( this, mgr ); }
-
-
-    /* OpenParent
-     *  duplicate reference to parent database
-     *  NB - returned reference must be released
-     */
-    inline rc_t OpenParent ( struct VDatabase const **db ) const throw()
-    { return VTableOpenParentRead ( this, db ); }
-    inline rc_t OpenParent ( struct VDatabase **db ) throw()
-    { return VTableOpenParentUpdate ( this, db ); }
-
-
-    /* OpenSchema
-     *  duplicate reference to table schema
-     *  NB - returned reference must be released
-     */
-    inline rc_t OpenSchema ( struct VSchema const **schema ) const throw()
-    { return  VTableOpenSchema ( this, schema ); }
-
-
-    /* GetUserData
-     * SetUserData
-     *  store/retrieve an opaque pointer to user data
-     *
-     *  "data" [ OUT ] - return parameter for getting data
-     *  "data" [ IN ] - parameter for setting data
-     *
-     *  "destroy" [ IN, NULL OKAY ] - optional destructor param
-     *  invoked from destructor of "self"
-     */
-    inline rc_t GetUserData ( void **data ) const throw()
-    { return VTableGetUserData ( this, data ); }
-    inline rc_t SetUserData ( void *data,
-        void ( CC * destroy ) ( void *data ) ) const throw()
-    { return VTableSetUserData ( this, data, destroy ); }
-
-
-    /* CreateCursor
-     *  creates a cursor object onto table
-     *  multiple read cursors are allowed
-     *  only a single write cursor is allowed
-     *
-     *  "curs" [ OUT ] - return parameter for newly created cursor
-     *
-     *  "mode" [ IN ] - describes update behavior
-     *    kcmUpdate   : allow inserts or updates
-     *    kcmReplace  : replace all existing rows with newly written rows
-     *    kcmInsert   : allow only inserts, i.e. new rows
-     */
-    inline rc_t CreateCursor ( const VCursor **curs ) const throw()
-    { return VTableCreateCursorRead ( this, curs ); }
-    inline rc_t CreateCursor ( VCursor **curs, KCreateMode mode ) throw()
-    { return VTableCreateCursorWrite ( this, curs, mode ); }
-
-private:
-    VTable ();
-    ~ VTable ();
-    VTable ( const VTable& );
-    VTable &operator = ( const VTable& );
-};
-
-#endif //  _hpp_vdb_table_
diff --git a/interfaces/vdb/types.h b/interfaces/vdb/types.h
deleted file mode 100644
index 9e79909..0000000
--- a/interfaces/vdb/types.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/* THIS FILE IS DEPRECATED. */
-#if _DEBUGGING && defined __GNUC__
-#warning "this file is deprecated"
-#endif
-
-#ifndef _h_vdb_types_
-#define _h_vdb_types_
-
-#ifndef _h_sra_types_
-#include <sra/types.h>
-#endif
-
-#endif /*  _h_vdb_types_ */
diff --git a/interfaces/vdb/types.hpp b/interfaces/vdb/types.hpp
deleted file mode 100644
index 1865964..0000000
--- a/interfaces/vdb/types.hpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _hpp_vdb_types_
-#define _hpp_vdb_types_
-
-// types are defined here
-#ifndef _h_vdb_types_
-#include <vdb/types.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VDatatypes
- */
-struct VDatatypes
-{
-    /* AddRef
-     * Release
-     */
-    inline rc_t AddRef () const throw()
-    { return VDatatypesAddRef ( this ); }
-
-    inline rc_t Release () const throw()
-    { return VDatatypesRelease ( this ); }
-
-
-    /* RegisterOpaque
-     * RegisterSubtype
-     *  registers new datatypes
-     *
-     *  "newtype" [ IN ] - NUL terminated fully qualified type name
-     *
-     *  "supertype" [ IN ] and "dim" [ IN ] - NUL terminated fully
-     *  qualified parent equivalency type and vector dimension
-     *  -OR-
-     *  "bits" [ IN ] - size in bits of element.
-     *
-     *  "byte_swap" [ IN, CONDITIONALLY NULL OKAY ] - a byte swapping function
-     *  required when size > 8 and and integral multiple of 8.
-     */
-#if 0 /* is omitted in sra/types.h too */
-    inline rc_t RegisterOpaque ( const char *newtype,
-       uint16_t bits, void ( CC *byte_swap ) ( void *elem ) ) throw()
-    { return VDatatypesRegisterOpaque ( this, newtype, bits, byte_swap ); }
-
-    inline rc_t RegisterSubtype ( const char *newtype, const char *supertype,
-        uint16_t dim, void ( CC *byte_swap ) ( void *elem ) ) throw()
-    { return VDatatypesRegisterSubtype ( this, newtype, supertype, dim, byte_swap ); }
-#endif
-
-
-    /* DefineSubtype
-     *  creates a subtype definition
-     *
-     *    typedef = [ 'typedef' ] <supertype> <typedecl>
-     */
-#if 0 /* is omitted in sra/types.h too */
-     inline rc_t DefineSubtype ( const char *definition, ... ) throw()
-    {
-        va_list args;
-        va_start ( args, definition );
-        rc_t rc = VDatatypesVDefineSubtype ( this, definition, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t DefineSubtype ( const char *definition, va_list args ) throw()
-    { return VDatatypesVDefineSubtype ( this, definition, args ); }
-#endif
-
-
-    /* ResolveTypedecl
-     *  converts a typedecl string to type id and vector dimension
-     *
-     *  "resolved" [ OUT ] - resolved type declaration
-     *
-     *  "typedecl" [ IN ] - type declaration
-     */
-    inline rc_t ResolveTypedecl ( VTypedecl *resolved,
-        const char *typedecl, ... ) const throw()
-    {
-        va_list args;
-        va_start ( args, typedecl );
-        rc_t rc = VDatatypesVResolveTypedecl ( this, resolved, typedecl, args );
-        va_end ( args );
-        return rc;
-    }
-    inline rc_t ResolveTypedecl ( VTypedecl *resolved,
-        const char *typedecl, va_list args ) const throw()
-    { return VDatatypesVResolveTypedecl ( this, resolved, typedecl, args ); }
-
-
-    /* ResolveTypename
-     *  convert a type id into its type definition
-     *
-     *  "resolved" [ OUT ] - resolved type definition
-     *
-     *  "typname" [ IN ] - NUL-terminated type name
-     */
-    inline rc_t ResolveTypename ( VTypedef *resolved,
-        const char *typname ) const throw()
-    { return VDatatypesResolveTypename ( this, resolved, typname ); }
-
-
-    /* ResolveTypeid
-     *  convert a type id into its type definition
-     *
-     *  "resolved" [ OUT ] - resolved type definition
-     *
-     *  "type_id" [ IN ] - 1-based runtime type id
-     */
-    inline rc_t ResolveTypeid ( VTypedef *resolved,
-        uint32_t type_id ) const throw()
-    { return VDatatypesResolveTypeid ( this, resolved, type_id ); }
-
-
-    /* SizeofTypedecl
-     *  returns the bit size of type declaration
-     */
-    inline rc_t SizeofTypedecl ( bitsz_t *type_size,
-        const VTypedecl *td ) const throw()
-    { return VDatatypesSizeofTypedecl ( this, type_size, td ); }
-
-
-    /* SizeofTypeid
-     *  returns the bit size of typeid
-     *
-     *  "type_size" [ OUT ] - bit size of a type
-     *
-     *  "type_id" [ IN ] - numerical index of a type
-     *
-     *  "all_elements" [ IN ] - for multi-dimesional types
-     *  return the sum of sizes, otherwise - only for a single element
-     */
-    inline rc_t SizeofTypeid ( bitsz_t *type_size, uint32_t type_id,
-        bool all_elements ) const throw()
-    { return VDatatypesSizeofTypeid ( this, type_size, type_id, all_elements ); }
-
-
-    /* MakeTypedecl
-     *  convert a VTypedecl into canonical text
-     *
-     *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
-     *  NUL terminated type declaration string
-     *
-     *  "typedecl" [ IN ] - binary representation of typedecl
-     */
-    inline rc_t MakeTypedecl ( char *buffer, size_t bsize,
-        const VTypedecl *typedecl ) const throw()
-    { return VDatatypesMakeTypedecl ( this, buffer, bsize, typedecl ); }
-
-
-    /* ToSupertype
-     *  cast a typedecl to a size-equivalent supertype decl
-     *  returns not-found and leaves "typedecl" unchanged
-     *  if no supertype exists
-     *
-     *  "typedecl" [ IN, OUT ] - populated with a correct
-     *  type id and vector dimension on input, will be updated
-     *  to contain a supertype and equivalent dimension on
-     *  output. e.g.:
-     *
-     *    IN -  { type_id NCBI:qual4, dim 1 }
-     *    OUT - { type_id I8, dim 4 }
-     */
-    inline rc_t ToSupertype ( VTypedecl *typedecl ) const throw()
-    { return VDatatypesToSupertype ( this,  typedecl ); }
-
-
-    /* ToIntrinsic
-     *  cast a typedecl ( if necessary ) to a size-equivalent
-     *  intrinsic typedecl.
-     *
-     *  returns not-found and leaves "typedecl" unchanged
-     *  if no intrinsic supertype exists
-     *
-     *  leaves "typedecl" unchanged if it is already intrinsic.
-     *
-     *  "typedecl" [ IN, OUT ] - populated with a correct
-     *  type id and vector dimension on input, will be updated
-     *  to contain a supertype and equivalent dimension on
-     *  output. e.g.:
-     *
-     *    IN -  { type_id NCBI:qual4, dim 1 }
-     *    OUT - { type_id I8, dim 4 }
-     */
-    inline rc_t ToIntrinsic ( VTypedecl *typedecl ) const throw()
-    { return VDatatypesToIntrinsic ( this, typedecl ); }
-
-
-    /* ToAncestor
-     *  cast a typedecl to a size-equivalent ancestor decl
-     *  returns true if cast can be performed
-     */
-    inline bool ToAncestor ( const VTypedecl *to,
-        const VTypedecl *from ) const throw()
-    { return VDatatypesToAncestor ( this, to, from ); }
-
-
-private:
-    VDatatypes ();
-    ~ VDatatypes ();
-    VDatatypes ( const VDatatypes& );
-    VDatatypes &operator = ( const VDatatypes& );
-};
-
-#endif //  _hpp_vdb_types_
diff --git a/interfaces/vdb/vdb-priv.h b/interfaces/vdb/vdb-priv.h
deleted file mode 100644
index b5f479d..0000000
--- a/interfaces/vdb/vdb-priv.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_vdb_priv_
-#define _h_vdb_vdb_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDatabase;
-struct KTable;
-struct KMetadata;
-struct KDBManager;
-struct KDirectory;
-struct VDBManager;
-struct VFSManager;
-struct VSchema;
-struct VTypedef;
-struct VDatabase;
-struct VTable;
-struct VCursor;
-struct VCursorParams;
-struct VXformInfo;
-struct KDataBuffer;
-struct KNamelist;
-
-
-/*--------------------------------------------------------------------------
- * VDBManager
- */
-
-/* OpenKDBManager
- *  returns a new reference to KDBManager used by VDBManager
- */
-VDB_EXTERN rc_t CC VDBManagerOpenKDBManagerRead ( struct VDBManager const *self,
-    struct KDBManager const **kmgr );
-VDB_EXTERN rc_t CC VDBManagerOpenKDBManagerUpdate ( struct VDBManager *self,
-    struct KDBManager **kmgr );
-
-#define VDBManagerGetKDBManagerRead VDBManagerOpenKDBManagerRead
-#define VDBManagerGetKDBManagerUpdate VDBManagerOpenKDBManagerUpdate
-
-
-/* ListExternalSchemaModules
- */
-VDB_EXTERN rc_t CC VDBManagerListExternalSchemaModules ( struct VDBManager const *self,
-    struct KNamelist **list );
-
-/* DisablePagemapThread
- *  this can cause difficulties for some clients
- */
-VDB_EXTERN rc_t CC VDBManagerDisablePagemapThread ( struct VDBManager const *self );
-
-
-/* Make with custom VFSManager */
-VDB_EXTERN rc_t CC VDBManagerMakeReadWithVFSManager (
-    const struct VDBManager **mgr,
-    struct KDirectory const *wd, struct VFSManager *vmgr );
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-/* DescribeTypedef - PRIVATE
- *  a type is defined as either:
- */
-VDB_EXTERN rc_t CC VSchemaDescribeTypedef ( struct VSchema const *self,
-    struct VTypedef *def, uint32_t type_id );
-
-/* LastIntrinsicTypeId - PRIVATE
- *  used to allow cast to intrinsics
- */
-VDB_EXTERN uint32_t CC VSchemaLastIntrinsicTypeId ( struct VSchema const *self );
-
-/* ListLegacyTables - PRIVATE
- *  scan all tables defined in schema
- *  return the fully-qualified and versioned name of each legacy SRA table
- */
-VDB_EXTERN rc_t CC VSchemaListLegacyTables ( struct VSchema const *self, struct KNamelist **list );
-
-
-/*--------------------------------------------------------------------------
- * VDatabase
- */
-
-/* OpenKDatabase
- *  returns a new reference to underlying KDatabase
- */
-VDB_EXTERN rc_t CC VDatabaseOpenKDatabaseRead ( struct VDatabase const *self, struct KDatabase const **kdb );
-VDB_EXTERN rc_t CC VDatabaseOpenKDatabaseUpdate ( struct VDatabase *self, struct KDatabase **kdb );
-
-
-
-/*--------------------------------------------------------------------------
- * VTable
- */
-
-/* OpenKTable
- *  returns a new reference to underlying KTable
- */
-VDB_EXTERN rc_t CC VTableOpenKTableRead ( struct VTable const *self, struct KTable const **ktbl );
-VDB_EXTERN rc_t CC VTableOpenKTableUpdate ( struct VTable *self, struct KTable **ktbl );
-
-#define VTableGetKTableRead VTableOpenKTableRead
-#define VTableGetKTableUpdate VTableOpenKTableUpdate
-
-
-/* DropColumn
- */
-VDB_EXTERN rc_t CC VTableDropColumn ( struct VTable *self, const char *name, ... );
-VDB_EXTERN rc_t CC VTableVDropColumn ( struct VTable *self, const char *name, va_list args );
-
-/* RenameColumn
- */
-VDB_EXTERN rc_t CC VTableRenameColumn ( struct VTable *self, bool force,
-    const char *from, const char *to );
-
-/* ListPhysColumns
- * ListSeededWritableColumns
- *  avail: 2.4
- */
-VDB_EXTERN rc_t CC VTableListPhysColumns ( struct VTable const *self, struct KNamelist **names );
-VDB_EXTERN rc_t CC VTableListSeededWritableColumns ( struct VTable *self,
-    struct KNamelist **names, struct KNamelist const *seed );
-
-
-/* HasStaticColumn
- *  given a physical column name, report whether it exists
- *  and is ( currently ) static
- *  avail: 2.5
- */
-VDB_EXTERN bool CC VTableHasStaticColumn ( struct VTable const *self, const char *name );
-
-
-/* VUntypedTableTest
- *  support for tables created before embedded schema
- *
- *  "ktbl" [ IN ] - physical table to recognize
- *
- *  "meta" [ IN ] - open metadata for table
- *
- *  returns true if table is recognized
- */
-typedef bool ( CC * VUntypedTableTest )
-   ( struct KTable const *ktbl, struct KMetadata const *meta );
-
-
-/* StoreSchema
- *  stores current schema definition in metadata
- *
- *  useful if table was opened using a later version of schema than
- *  was used for its creation.
- */
-VDB_EXTERN rc_t VTableStoreSchema ( struct VTable *self );
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- */
-
-
-/* CreateCursorView
- *  creates a read-only cursor onto table
- *  uses table schema as base
- *  uses view described in viewspec as view
- *
- *  AVAILABILITY: version 2.3
- *
- *  for pre-vdb-2.3 tables, defaults to CreateCursorRead, ignoring
- *  schema specification
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- *
- *  "viewspec" [ IN ] - NUL terminated string describing the view schema
- */
-VDB_EXTERN rc_t CC VTableCreateCursorView ( struct VTable const *self,
-    struct VCursor const **curs, const char *viewspec );
-
-/* PermitPostOpenAdd
- *  allows columns to be added to open cursor
- *  for write cursor, the effect lasts until the first row commit
- */
-VDB_EXTERN rc_t CC VCursorPermitPostOpenAdd ( struct VCursor const *self );
-/*  SuspendTriggers
- *  blocks resolution of schema-based triggers
- *
- */
-VDB_EXTERN rc_t CC VCursorSuspendTriggers ( struct VCursor const *self );
-
-/*  VCursorGetSchema
- *  returns current schema of the open cursor
- */
-VDB_EXTERN struct VSchema const* CC VCursorGetSchema ( struct VCursor const *self);
-
-/* PageIdRange
- *  returns id range for page
- *
- *  "id" [ IN ] - page containing this row id is target
- *
- *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-VDB_EXTERN rc_t CC VCursorPageIdRange ( struct VCursor const *self,
-    uint32_t idx, int64_t id, int64_t *first, int64_t *last );
-
-
-/* IsStaticColumn
- *  answers question: "does this column have the same value for every cell?"
- */
-VDB_EXTERN rc_t CC VCursorIsStaticColumn ( struct VCursor const *self,
-    uint32_t col_idx, bool *is_static );
-
-
-VDB_EXTERN rc_t CC VCursorLinkedCursorGet(const struct VCursor *cself,const char *tbl, struct VCursor const **curs);
-VDB_EXTERN rc_t CC VCursorLinkedCursorSet(const struct VCursor *cself,const char *tbl, struct VCursor const *curs);
-
-
-/*--------------------------------------------------------------------------
- * VCursorParams
- */
-
-/* Get
- *  return KDataBuffer value by reference
- */
-VDB_EXTERN rc_t CC VCursorParamsGet ( struct VCursorParams const *self,
-    const char *name, struct KDataBuffer **value );
-
-/* Set
- *  set a textual parameter value
- */
-VDB_EXTERN rc_t CC VCursorParamsSet( struct VCursorParams const *self,
-    const char *name, const char *fmt, ... );
-VDB_EXTERN rc_t CC VCursorParamsVSet ( struct VCursorParams const *self,
-    const char *name, const char *fmt, va_list args );
-
-/* Unset
- *  set the value of a named parameter to "undefined"
- */
-VDB_EXTERN rc_t CC VCursorParamsUnset ( struct VCursorParams const *self, const char *name );
-
-
-/*--------------------------------------------------------------------------
- * xform
- */
-
-/*
-  uses vftReserved code
-  returns little-endian data, no row-wise rle
-  fixed row-length is calculated as dst->elem_count / num_rows
- */
-#define vftLegacyBlob vftReserved
-
-typedef struct VLegacyBlobResult VLegacyBlobResult;
-struct VLegacyBlobResult
-{
-    struct KDataBuffer *dst;
-    uint8_t byte_order;
-};
-
-typedef rc_t ( CC * VNoHdrBlobFunc ) ( void *self,
-    struct VXformInfo const *info, VLegacyBlobResult *rslt,
-    struct KDataBuffer const *src );
-
-/* function to call to test table against schema */
-typedef bool ( CC * VUntypedFunc )
-    ( struct KTable const *tbl, struct KMetadata const *meta );
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vdb_vdb_priv_ */
diff --git a/interfaces/vdb/vdb.vschema b/interfaces/vdb/vdb.vschema
deleted file mode 100644
index 9153474..0000000
--- a/interfaces/vdb/vdb.vschema
+++ /dev/null
@@ -1,820 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * VDB external functions, formats and types
- */
-version 1;
-
-// built-in functions should be known to all
-include 'vdb/built-in.vschema';
-
-
-/*--------------------------------------------------------------------------
- * types
- */
-
-/* text_token
- *  a vector describing tokens recognized within a text string
- *
- * COMPONENTS:
- *  0 - token id
- *  1 - token starting coordinate
- *  2 - token length
- */
-typedef U16 text:token [ 3 ];
-
-
-/*--------------------------------------------------------------------------
- * typesets
- */
-typeset pack_set { B8, B16, B32, B64, integer_set };
-typeset izip_set { integer_set };
-typeset fzip_set { F32 };
-
-
-/*--------------------------------------------------------------------------
- * formats
- */
-fmtdef izip_fmt;
-fmtdef fzip_fmt;
-fmtdef rle_fmt;
-fmtdef zlib_fmt;
-fmtdef bzip2_fmt;
-
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* echo
- *  returns single or repeated constant value
- *
- *  "T" [ TYPE ] - type of constant data to return
- *
- *  "val" [ CONST ] - a data constant
- *
- *  "row_len" [ DATA, OPTIONAL ] - if omitted, "val" will be
- *  issued once and the resultant row-length will be the length
- *  of "val". otherwise, "val" will be repeated and/or truncated
- *  as necessary to produce a row-length equal to that of input.
- *
- * USAGE:
- *  to echo a single constant value
- *    U16 len = row_len ( col ) | < U16 > echo < 0 > ();
- *
- *  to create a row of repeated values
- *    ascii allN = < ascii > echo < 'N' > ( col );
- */
-function < type T >
-T echo #1.0 < T val > ( * any row_len )
-    = vdb:echo;
-
-
-/* exists
- *  returns constant or dynamic value if predicate input exists
- *
- *  "T" [ TYPE ] - type of data to return
- *
- *  "cval" [ CONST, OPTIONAL ] - a data constant. when present,
- *  the function will behave like "echo" ( see below )
- *
- *  "predicate" [ DATA ] - an input whose existence determines
- *  whether the function will operate or not.
- *
- *  "dval" [ DATA, OPTIONAL ] - data value, either passed through
- *  or used to determine a repeat count of "cval" ( see below )
- *
- * USAGE:
- *  when "cval" is omitted, "dval" must be present and will be
- *  passed through depending upon the existence of "predicate"
- *    U8 count = < U8 > exists ( col, count2 );
- *
- *  when "cval" is present, "dval" may be omitted, and "cval" will
- *  be passed through just like echo depending upon "predicate"
- *   U8 count = < U8 > exists < 2 > ( col2 ) | < U8 > echo < 1 > ();
- *
- *  when "cval" and "dval" are both present, the behavior is
- *  like echo, but gated with "predicate"
- *    ascii poly = < ascii > exists < 'a' > ( col, repeat );
- */
-function < type T >
-T exists #1.0 < * T cval > ( any predicate, * T dval )
-    = vdb:exists;
-
-
-/* map
- *  translate input elements
- *  behaves much like the Unix "tr" command
- *  except that charsets are not [currently] supported
- *
- *  "A" [ TYPE ] - input data type, e.g. "ascii"
- *
- *  "B" [ TYPE ] - output data type, e.g. "ascii" or "U8"
- *
- *  "from" [ CONST ] - set of key values.
- *
- *  "to" [ CONST ] - set of mapped values,
- *  where length ( from ) === length ( to )
- *
- *  "in" [ DATA ] - input data to be matched against keys
- *  in "from". also serves as source data when "src" is omitted
- *
- *  "src" [ DATA, OPTIONAL ] - source data to be edited by
- *  substituting "to" values when corresponding "in" value
- *  matches key in "from". if omitted, "in" is used.
- *
- * USAGE:
- *  to upper case letters from a given alphabet
- *    ascii upper = < ascii, ascii > map < 'acgtn', 'ACGTN' > ( in );
- *
- *  to translate from ascii to binary
- *    U8 bin = < ascii, U8 > map < 'ACGTN', [ 0, 1, 2, 3, 0 ] > ( in );
- *
- *  to alter certain values of a column based upon values in another
- *    U8 n_encoded = < ascii, U8 > map < 'N', 0 > ( read, quality );
- *
- * CAVEATS:
- *  the full canonical mode of operation uses separate inputs
- *  for key matching and output source.
- *
- *  when a single input is specified:
- *   - sizeof ( A ) must equal sizeof ( B )
- *   - A must be a proper subset of B -OR-
- *   - "from" keys must match every possible "in" value ( total substitution )
- */
-function < type A, type B >
-B map #1.0 < A from, B to > ( A in, * B src )
-    = vdb:map;
-
-
-/* clip
- *  limit data values to given bounds
- *
- *  "T" [ TYPE ] - input and output data type
- *
- *  "dim" [ CONST >= 1 ] - fixed dimension on
- *  input and output vectors
- *
- *  "lower" [ CONST ] - lower bound, inclusive
- *
- *  "upper" [ CONST ] - upper bounds, inclusive
- *
- *  "in" [ DATA ] - data to be clipped
- */
-function < type T >
-T clip #1.0 < T lower, T upper > ( T in )
-    = vdb:clip;
-
-function < type T, U32 dim >
-T [ dim ] vclip #1.0 < T lower, T upper > ( T [ dim ] in )
-    = vdb:clip;
-
-
-/* ceil
- *  round up to the nearest integer
- *
- *  "in" [ DATA ] - data to be processed
- */
-function
-numeric_set ceil #1.0 ( float_set in )
-    = vdb:ceil;
-
-/* floor
- *  round down to the nearest integer
- *
- *  "in" [ DATA ] - data to be processed
- */
-function
-numeric_set floor #1.0 ( float_set in )
-    = vdb:floor;
-
-/* round
- *  round to nearest integer away from zero
- *
- *  "T" [ TYPE = { F32, F64 } ] - input and output data type
- *
- *  "in" [ DATA ] - data to be processed
- */
-function
-numeric_set round #1.0 ( float_set in )
-    = vdb:round;
-
-/* trunc
- *  round to the nearest integer not larger in absolute value
- *
- *  "T" [ TYPE = { F32, F64 } ] - input and output data type
- *
- *  "in" [ DATA ] - data to be processed
- */
-function
-numeric_set trunc #1.0 ( float_set in )
-    = vdb:trunc;
-
-
-/* min
- *  return the minimum value of each element
- * max
- *  return the maximum value of each element
- *
- *  "T" [ TYPE ] - input and output data type
- *
- *  "a" [ DATA ] - first operand
- *
- *  "b" [ DATA ] - second operand
- *
- * SYNOPSIS:
- *  compares two inputs element by element
- *  returns min or max element of each
- *
- * USAGE:
- *  intersections
- *    U32 left = < U32 > max ( left_a, left_b );
- *    U32 right = < U32 > min ( right_a, right_b );
- */
-function < type T >
-T min #1.0 ( T a, T b )
-    = vdb:min;
-
-function < type T >
-T max #1.0 ( T a, T b )
-    = vdb:max;
-
-
-/* sum
- *  return the sum of inputs
- * diff
- *  return the difference of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of numeric_set
- *
- *  "k" [ CONST, DEFAULT 0 ] - optional constant
- *  to be added or subtracted
- *
- *  "a" [ DATA ] - left-most operand
- *
- *  "b" [ DATA ] - optional subtractand
- *
- * SYNOPSIS:
- *  incorporates "k" into expression for every row
- *  returns sum or difference of inputs for all rows
- *
- * USAGE:
- *  length of half-closed interval
- *    U32 len = < U32 > diff ( stop, start );
- *  convert one-based coordinate to zero based
- *    U32 zero_based = < U32 > diff < 1 > ( one_based );
- */
-function < type T >
-T sum #1.0 < * T k > ( T a, ... )
-    = vdb:sum;
-
-function < type T >
-T diff #1.0 < * T k > ( T a * T b )
-    = vdb:diff;
-
-/* deriv
- *  return the 1st derivative of an input row
- * integral
- *  return the integral of an input row
- *   integral   -> starts with 1st value
- *   integral_0 -> starts with 0
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be signed integer of any size
- *
- *  "in" [ DATA ] - input to be modified
- *
- * SYNOPSIS:
- *  Takes/restores chained deltas of integer elements in a row
- *  Fist element is unmodified
- */
-
-function < type T > T deriv #1.0  ( T in ) = vdb:deriv;
-function < type T > T integral #1.0  ( T in ) = vdb:integral;
-function < type T > T integral_0 #1.0  ( T in ) = vdb:integral_0;
-
-/* delta
- *  return the 1st derivative of a whole blob
- * undelta
- *  return the integral of a whole blob
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be signed integer of any size
- *
- *  "in" [ DATA ] - input to be modified
- *
- * SYNOPSIS:
- *  similar to deriv/integral but operates on full blob
- */
-
-function < type T > T delta #1.0  ( T in ) = vdb:delta;
-function < type T > T undelta #1.0  ( T in ) = vdb:undelta;
-
-
-/* outlier_encode
- *  removes a given outlier from a data series
- * outlier_decode
- *  removes the effect of outlier_encode
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be an integer of any size
- *
- *  "in" [ DATA ] - input to be modified
- *
- * SYNOPSIS:
- *  The encode replaces every element that is equal to the
- *  outlier with (the value of the previous element) * 2 + 1
- *  and the remaining elements are replaced with their value * 2.
- */
-
-function < type T > T outlier_encode #1.0 < T outlier > ( T in ) = vdb:outlier_encode;
-function < type T > T outlier_decode #1.0 < T outlier > ( T in ) = vdb:outlier_decode;
-
-/* add_row_id
- *  return the sum of an input and its row-id
- * sub_row_id
- *  return the difference of an input and its row-id
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of numeric_set
- *
- *  "in" [ DATA ] - input to be modified
- *
- * SYNOPSIS:
- *  adjusts for relationship between input and row-id
- *  used primarily to reduce serial ids to constants
- */
-function < type T >
-T add_row_id #1.0 ( T in )
-    = vdb:add_row_id;
-
-function < type T >
-T sub_row_id #1.0 ( T in )
-    = vdb:sub_row_id;
-
-
-/* cut
- *  extract one or more elements from input vector
- *  to form an output vector of equal or less dimension
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "idx" [ CONST ] - mandatory initial element index
- *  count of parameters must equal dimension of output type
- *
- *  "in" [ DATA ] - source of input vectors where the vector
- *  element type is known, but any dimension is accepted.
- *
- * USAGE:
- *  extracting a single channel from a 4 channel vector
- *    F32 [ 4 ] vect ...
- *    F32 chan = < F32 > cut < 0 > ( vect );
- *
- *  extracting multiple channels
- *    U8 [ 16 ] in ...
- *    U8 [ 3 ] out = < U8 > cut < 5, 1, 3 > ( in );
- *
- *  reversing channels
- *    I16 [ 2 ] norm ...
- *    I16 [ 2 ] rev = < I16 > cut < 1, 0 > ( norm );
- */
-function < type T >
-T [ * ] cut #1.0 < U32 idx, ... > ( T [ * ] in )
-    = vdb:cut;
-
-
-/* paste
- *  combine all elements of all inputs into a single vector
- *  output dimension is sum of all input dimensions after type normalization
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "in" [ DATA ] - first of an arbitrary number of columns
- *  the total of input elements produces an output of "T [ total ]"
- */
-function < type T >
-T [ * ] paste #1.0 ( T [ * ] in, ... )
-    = vdb:paste;
-
-
-/* vec_sum
- *  compute the sum of all the elements of the row
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "in" [ DATA ] - the input
- */
-function < type T >
-T vec_sum #1.0 ( T [ * ] in )
-    = vdb:vec_sum;
-
-/* vec_sum
- *  compute the sum of all the elements of the input vector
- *
- *  "T" [ TYPE ] - base element type to be processed
- *
- *  "in" [ DATA ] - the input
- */
-function < type T >
-T fixed_vec_sum #1.0 ( T [ * ] in )
-    = vdb:fixed_vec_sum;
-
-
-/* checksum
- *  compute a checksum ( hash ) of all of the input bytes
- *  to be used in a trigger production
- *
- *  "node" [ CONST ] - path to metadata node where checksum
- *   will be stored.
- *
- *  "algorithm" [ CONST ] - type of checksum to perform:
- *    'crc-32'  # match against POSIX cksum
- *    'md5'     #  "   "  md5sum
- *    'sha-1'   #  "   "  sha1sum
- *    'sha-256' #  "   "  sha256sum
- *    'sha-384' #  "   "  sha384sum
- *    'sha-512' #  "   "  sha512sum
- *
- *  "in" [ DATA ] - the octet-stream to be checksummed
- */
-function
-bool checksum #1.0 < ascii node, ascii algorithm > ( B8 in )
-    = vdb:checksum;
-
-/* md5sum
- *  compute an md5 checksum of all of the input bytes
- */
-function
-bool md5sum #1.0 < ascii node > ( B8 in )
-{
-    return checksum < node, 'md5' > ( in );
-}
-
-
-/* pack
- *  packs words into bit-aligned units
- *  words are expected in architecture native byte-order
- *  and returned in "big-bit-endian" order
- *
- *  the packed size is determined by the dimension of the
- *  left-hand assignment value.
- *
- *  "in" [ DATA ] - B8, B16, B32 or B64 data
- */
-function
-B1 [ * ] pack #1.0 ( pack_set in )
-    = vdb:pack;
-
-
-/* unpack
- *  unpacks bit-aligned units into words
- *  input is expected in "big-bit-endian" order
- *  and returned in architecture native byte-order
- *
- *  the unpacked type is determined from the left-hand
- *  assignment value.
- *
- *  "in" [ DATA ] - B[1]..B[64]
- */
-function
-pack_set unpack #1.0 ( B1 [ * ] in )
-    = vdb:unpack;
-
-
-/* izip
- * iunzip
- *  integer compression
- */
-function
-izip_fmt izip #2.1 ( izip_set in )
-    = vdb:izip;
-
-function
-izip_set iunzip #2.1 ( izip_fmt in )
-    = vdb:iunzip;
-
-physical < type T >
-T izip_encoding #1.0
-{
-    decode { return ( T ) iunzip ( @ ); }
-    encode { return izip ( @ ); }
-};
-
-
-/* fzip
- * funzip
- *  floating point compression
- *
- *  "mantissa" [ CONST ] - the number of mantissa bits
- *  to preserve
- */
-function
-fzip_fmt fzip #1.0 < U32 mantissa > ( fzip_set in )
-    = vdb:fzip;
-
-function
-fzip_set funzip #1.0 ( fzip_fmt in )
-    = vdb:funzip;
-
-physical < type T >
-T fzip_encoding #1.0 < U32 mantissa >
-{
-    decode { return funzip ( @ ); }
-    encode { return fzip < mantissa > ( @ ); }
-};
-
-
-/* rlencode
- * rldecode
- *  run-length encoding
- */
-function
-rle_fmt rlencode #1.0 ( any in )
-    = vdb:rlencode;
-
-function
-any rldecode #1.0 ( rle_fmt in )
-    = vdb:rldecode;
-
-
-/* zip
- * unzip
- *  run things through zlib
- *
- *  "strategy" [ CONST, OPTIONAL ] - set the compression strategy
- *
- *  "level" [ CONST, OPTIONAL ] - set the amount of compression
- *  from 0..9 ( none to best compression ), or use -1 for zlib
- *  default behavior.
- */
-
-// zlib strategy
-const I32 Z_FILTERED            =  1;
-const I32 Z_HUFFMAN_ONLY        =  2;
-const I32 Z_RLE                 =  3;
-const I32 Z_DEFAULT_STRATEGY    =  0;
-
-// zlib level
-const I32 Z_NO_COMPRESSION      =  0;
-const I32 Z_BEST_SPEED          =  1;
-const I32 Z_BEST_COMPRESSION    =  9;
-const I32 Z_DEFAULT_COMPRESSION = -1;
-
-function
-zlib_fmt zip #1.0 < * I32 strategy, I32 level > ( any in )
-    = vdb:zip;
-
-function
-any unzip #1.0 ( zlib_fmt in )
-    = vdb:unzip;
-
-physical < type T >
-T zip_encoding #1.0 < * I32 strategy, I32 level >
-{
-    decode { return unzip ( @ ); }
-    encode { return zip < strategy, level > ( @ ); }
-};
-
-physical
-bool bool_encoding #1.0
-{
-    decode
-    {
-        B1 bit = unzip ( @ );
-        return ( bool ) unpack ( bit );
-    }
-
-    encode
-    {
-        U8 lim = < U8 > clip < 0, 1 > ( @ );
-        B1 bit = pack ( lim );
-        return zip < Z_RLE, Z_BEST_SPEED > ( bit );
-    }
-}
-
-physical < type T >
-T delta_izip_encoding #1.0
-{
-    decode
-    {
-        T dlt = iunzip ( @ );
-        return < T > undelta ( dlt );
-    }
-
-    encode
-    {
-        T dlt = <T> delta ( @ );
-        return izip ( dlt );
-    }
-}
-physical < type T >
-T delta_zip_encoding #1.0
-{
-    decode
-    {
-        T dlt = unzip ( @ );
-        return < T > undelta ( dlt );
-    }
-
-    encode
-    {
-        T dlt = <T> delta ( @ );
-        return zip < Z_RLE, Z_BEST_SPEED > ( dlt );
-    }
-}
-physical < type T >
-T delta_average_zip_encoding #1.0
-{
-    decode
-    {
-        delta_averaged_fmt t = unzip ( @ );
-        return undelta_average ( t );
-    }
-
-    encode
-    {
-        delta_averaged_fmt t = delta_average ( @ );
-        return zip < Z_RLE, Z_BEST_SPEED > ( t );
-    }
-}
-
-/* bzip
- * bunzip
- *  run things through bzip2
- *
- *  "blockSize100k" [ CONST, OPTIONAL ] - set the compression workspace size
- *  from 1..9 inclusive, produces a workspace of blockSize100K * 100000 bytes
- *  default is 5
- *
- *  "workFactor" [ CONST, OPTIONAL ] - set compression level
- *  from 0..250 inclusive, where 0 means bzip2 default, currently 30
- */
-
-function
-bzip2_fmt bzip #1.0 < * U32 blockSize100k, U32 workFactor > ( any in )
-    = vdb:bzip;
-
-function
-any bunzip #1.0 ( bzip2_fmt in )
-    = vdb:bunzip;
-
-physical < type T >
-T bzip_encoding #1.0 < * U32 blockSize100k, U32 workFactor >
-{
-    decode { return bunzip ( @ ); }
-    encode { return bzip < blockSize100k, workFactor > ( @ ); }
-};
-
-
-/* simple_sub_select
- *  project a column from another table within database
- *
- *  "T" [ TYPE ] - data type of column
- *   must be compatible with source column
- *
- *  "tbl" [ CONST ] - name of table within parent
- *
- *  "col" [ CONST ] - column spec, i.e. simple name or
- *   typed name spec
- *
- *  "row" [ DATA ] - row to select
- *
- *  "idx" [ DATA ] - one-based indexing of what element to pick, defaults to all if not given
- */
-function < type T >
-T simple_sub_select #1.0 < ascii tbl, ascii col > ( I64 row *  I32 idx )
-    = vdb:simple_sub_select_1;
-
-
-/* extract_token
- *  extract a textual token from an input string
- *
- *  "idx" [ CONST ] - a zero-based index of the token
- *  if value < row_len ( tok ), then the substring of
- *  indexed token is returned. otherwise, returns empty.
- *
- *  "str" [ DATA ] - input text. type must be compatible with
- *  output production, meaning types must be same, or ascii input
- *  with utf8 output.
- *
- *  "tok" [ DATA ] - results of tokenizing "str"
- */
-function
-text_set extract_token #1.0 < U32 idx > ( text_set str, text:token tok )
-    = vdb:extract_token;
-
-
-/* strtonum
- *  convert string to number
- *
- *  "radix" [ CONST, DEFAULT 10 ]
- *   if not specified, or if given as 0, the default will be 10
- *   unless the string begins with "0x" or "0X", in which case radix will be 16
- *   octal is NOT inferred ( i.e. leading "0" does not imply octal )
- *
- *  "str" [ DATA ] - text to be converted
- */
-function
-numeric_set strtonum #1.0 < * U32 radix > ( text_set str )
-    = vdb:strtonum;
-
-
-/* sprintf
- *  formatted print to a string
- *
- *  formatting rules differ somewhat from C sprintf:
- *
- *        '%' [ <flags> ] [ <field-width> ] [ '.' <precision> ] [ ':' <index> ] <storage-class>
- *
- *  where:
- *
- *    flags
- *        = ' '           : prepend space to a numeral if it does not have a sign
- *        | '+'           : always produce a sign on numeric conversion
- *        | '-'           : left-align parameter within field
- *        | '0'           : left-pad with zeroes rather than spaces
- *        | '#'           : use "alternate" representation
- *        | ','           : produce comma-separated triples
- *        ;
- *
- *    field-width
- *        = DECIMAL       : a base-10 numeral
- *        | '*'           : take field width from args
- *        ;
- *
- *    precision
- *        = DECIMAL       : a base-10 numeral
- *        | '*'           : take precision from args
- *        |               : an empty precision means 0
- *        ;
- *
- *    index
- *        = idx           : a single, zero-based vector element
- *        | idx '-' idx   : a fully-closed, zero-based interval
- *        | idx '/' len   : a start index plus length
- *        ;
- *
- *    idx
- *        = DECIMAL       : an unsigned base-10 numeral
- *        | '*'           : take index from args
- *        | '$'           : last element in cell
- *        |               : an empty index means 0 or $
- *        ;
- *
- *    len
- *        = DECIMAL       : a base-10 numeral
- *        | '*'           : take length from args
- *        | '$'           : row-length of ( cell )
- *        |               : an empty length means $
- *        ;
- *
- *
- *    storage-class
- *        = 'd' | 'i'     : general decimal integer
- *        | 'u'           : decimal unsigned integer
- *        | 'x'           : lower-case hex
- *        | 'X'           : upper-case hex
- *        | 'o'           : octal
- *        | 'b'           : binary
- *        | 'f'           : floating point
- *        | 'e'           : scientific notation
- *        | 'g'           : general floating point
- *        | 'c' | 's'     : character
- *        ;
- *
- *
- *  "fmt" [ CONST ] - constant format string, adhering to
- *  the description above
- *
- *  "p1" [ DATA ] - first param
- *  this and any subsequent params must correspond to format
- *  in type/position/number.
- */
-function
-text_set sprintf #1.0 < ascii fmt > ( any p1, ... )
-    = vdb:sprintf;
diff --git a/interfaces/vdb/xform.h b/interfaces/vdb/xform.h
deleted file mode 100644
index 5e1cea1..0000000
--- a/interfaces/vdb/xform.h
+++ /dev/null
@@ -1,824 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_xform_
-#define _h_vdb_xform_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_vdb_schema_
-#include <vdb/schema.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDataBuffer;
-struct VCursorParams;
-
-/*--------------------------------------------------------------------------
- * VFormatdecl
- */
-typedef struct VFormatdecl VFormatdecl;
-struct VFormatdecl
-{
-    VTypedecl td;
-    uint32_t fmt;
-};
-
-
-/* Resolve
- *  converts a fmtdecl string to fmt id, type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved fmtdecl
- *
- *  "fmtdecl" [ IN ] - type declaration
- */
-VDB_EXTERN rc_t CC VSchemaResolveFmtdecl ( struct VSchema const *self,
-    VFormatdecl *resolved, const char *fmtdecl, ... );
-VDB_EXTERN rc_t CC VSchemaVResolveFmtdecl ( struct VSchema const *self,
-    VFormatdecl *resolved, const char *fmtdecl, va_list args );
-
-
-/* ToText
- *  convert a VFormatdecl into canonical text
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated type declaration string
- */
-VDB_EXTERN rc_t CC VFormatdeclToText ( const VFormatdecl *self,
-    struct VSchema const *schema, char *buffer, size_t bsize );
-
-
-/* ToFormatdecl
- *  attempt to cast a fmtdecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target fmtdecl or typespec for cast
- *
- *  "cast" [ OUT, NULL OKAY ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" contained a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distances" [ OUT, NULL OKAY ] - optional linear measure of independent
- *  casting generations for format ( 0 ) and type ( 1 ). valid only if function
- *  returns true. a value of 0 means that "self" is a direct match with "ancestor",
- *  a value of 1 means that "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-VDB_EXTERN bool CC VFormatdeclToFormatdecl ( const VFormatdecl *self,
-    const VSchema *schema, const VFormatdecl *ancestor,
-    VFormatdecl *cast, uint32_t distances [ 2 ] );
-
-
-/*--------------------------------------------------------------------------
- * VBlobHeader
- *  opaque blob header
- *  used by external functions to read and populate blob headers
- */
-typedef struct VBlobHeader VBlobHeader;
-
-
-/* Release
- *  used to release forked headers
- */
-VDB_EXTERN rc_t CC VBlobHeaderRelease ( const VBlobHeader *self );
-
-
-/* Version
- *  returns previously written blob format version
- */
-VDB_EXTERN uint8_t CC VBlobHeaderVersion ( const VBlobHeader *self );
-VDB_EXTERN void CC VBlobHeaderSetVersion ( VBlobHeader *self, uint8_t version );
-
-
-/* OpPushTail
- * OpPopHead
- * OpPopTail
- *  op-code stack interface
- *
- *  functions that apply encoding to a blob may use this stack to
- *  record one or more "op-codes" that may be useful to decoders
- *  when used in combination with the argument (operand) stack.
- *
- *  the op-code values and significance is entirely defined by the
- *  external functions, and their use is optional (a trivial example
- *  is described below in the argument stack comment).
- *
- *  during update operations, the stack may be pushed as well as popped.
- *  during read-only operations, only pop is permitted.
- */
-VDB_EXTERN rc_t CC VBlobHeaderOpPushTail ( VBlobHeader *self, uint8_t op );
-VDB_EXTERN rc_t CC VBlobHeaderOpPopHead ( const VBlobHeader *self, uint8_t *op );
-VDB_EXTERN rc_t CC VBlobHeaderOpPopTail ( const VBlobHeader *self, uint8_t *op );
-
-
-/* ArgPushTail
- * ArgPopHead
- * ArgPopTail
- *  argument (operand) stack interface
- *
- *  provides arguments to accompany encoding and decoding operations,
- *  where the operation may be implicit or indicated via a related
- *  op-code.
- *
- *  here is a trivial example for a hypothetical function that performs
- *  bit-packing on a series of signed integers. it has two possible
- *  operations: translation and pack. it translates the values by subtracting
- *  the MIN(x) value, converting the sequence into unsigned values starting
- *  at 0. pack will left-truncate bits if the translated MAX(x) can be represented
- *  with fewer bits than in use:
- *
- *    1. calculate min/max
- *    2. if MIN(x) != 0
- *       2a. ArgPushTail ( MIN ( x ) )
- *       2b. OpPushTail ( TRANSLATE-OPCODE ) # e.g. 1
- *       2c. translate sequence by - min
- *       2d. translate MAX ( x )
- *    3. calculate bits required for MAX(x)
- *    4. if bits-required < bits-used
- *       4a. ArgPushTail ( bits-required )
- *       4b. OpPushTail ( PACK-OPCODE )      # e.g. 2
- *       4c. pack sequence
- *
- *  on decode, the process would be reversed:
- *
- *    1. OpPopTail ( & op-code )
- *    2. if op-code == PACK-OPCODE
- *       2a. ArgPopTail ( & packed-bits )
- *       2b. unpack sequence from packed-bits to current size
- *       2c. OpPopTail ( & op-code )
- *    3. if op-code == TRANSLATE-OPCODE
- *       3a. ArgPopTail ( & offset )
- *       3b. translate sequence by + offset
- *
- *  during update operations, the stack may be pushed as well as popped.
- *  during read-only operations, only pop is permitted.
- */
-VDB_EXTERN rc_t CC VBlobHeaderArgPushTail ( VBlobHeader *self, int64_t arg );
-VDB_EXTERN rc_t CC VBlobHeaderArgPopHead ( const VBlobHeader *self, int64_t *arg );
-VDB_EXTERN rc_t CC VBlobHeaderArgPopTail ( const VBlobHeader *self, int64_t *arg );
-
-
-/* CreateFork
- *  create a parallel, writable blob header
- *
- *  blob headers are designed to record operations and arguments
- *  that are serially applied to data. some functions may need to
- *  run operations in parallel ( e.g. compresion ) where each fork
- *  is allowed to compete for best performance.
- *
- *  this function creates an alternate, parallel header object that
- *  may be used to replace the actual headers associated with the blob.
- *
- * NB - returned object must ALWAYS be released before exiting function
- */
-VDB_EXTERN rc_t CC VBlobHeaderCreateFork ( const VBlobHeader *self, VBlobHeader **rslt );
-
-
-/*==========================================================================
- * transformation functions
- *
- *  transformation functions are declared in schema and provided in
- *  dynamically loadable shared libraries. the types described in the
- *  following section will be used during data processing.
- */
-
-
-/* VFormatdesc
- *  combines VFormatdecl and VTypedesc
- */
-typedef struct VFormatdesc VFormatdesc;
-struct VFormatdesc
-{
-    VFormatdecl fd;
-    VTypedesc desc;
-};
-
-
-/* XformInfo
- *  constant input parameter block
- *
- *  "mgr" [ IN ] - db mgr object
- *
- *  "schema" [ IN ] - cursor schema
- *
- *  "tbl" [ IN ] - owning table. can be used
- *   to access enclosing database
- */
-#define VTABLE_PASSED_TO_XFORM 1
-#define VPRODUCTION_PASSED_TO_XFORM 1
-
-struct VProduction;
-typedef struct VXformInfo VXformInfo;
-struct VXformInfo
-{
-#if VMGR_PASSED_TO_XFORM
-    struct VDBManager const *mgr;
-#endif
-#if VSCHEMA_PASSED_TO_XFORM
-    struct VSchema const *schema;
-#endif
-#if VTABLE_PASSED_TO_XFORM
-    struct VTable const *tbl;
-#endif
-#if VPRODUCTION_PASSED_TO_XFORM
-    struct VProduction const *prod;
-#endif
-    VFormatdesc fdesc;
-};
-
-
-/* VRowData
- *  row function input block
- *
- *  "base" [ IN ] and "first_elem" [ IN ] - first element in row
- *  i.e. for any row of type "T", "( ( const T* ) base ) [ first_elem ]"
- *  is the first element.
- *
- *  "elem_count" [ IN ] - the number of elements in this row
- *
- *  "element_bits" [ IN ] - the number of bits in each element
- *
- *  "variant" [ IN ] - describes variant of union "u"
- */
-typedef uint8_t VRowDataVariant;
-enum { vrdData, vrdControl };
-
-typedef struct VRowData VRowData;
-struct VRowData
-{
-    union
-    {
-        struct
-        {
-            /* the number of elements in this row */
-            uint64_t elem_count;
-
-            /* element size in bits */
-            uint64_t elem_bits;
-
-            /* page data base address plus
-               offset to first element of row */
-            uint64_t first_elem;
-            const void *base;
-
-        } data;
-
-    } u;
-
-    /* describes variant of "u" */
-    VRowDataVariant variant;
-};
-
-
-/* VRowResult
- *  row function output block
- *
- *  for functions that operate on a single row of input
- *  but generate an output of independent length.
- *
- *  "data" [ IN/OUT ] - externally allocated data buffer
- *  may be resized or replaced, and must be checked for
- *  adequate capacity before writing.
- *
- *  "elem_count" [ OUT, DEFAULT ZERO ] - return parameter for
- *  the number of elements in result
- *
- *  "elem_bits" [ IN ] - element size in bits
- *
- *  "no_cache" [ OUT, DEFAULT ZERO ] - to indicate whether this result is
- *  cache-able
- */
-typedef struct VRowResult VRowResult;
-struct VRowResult
-{
-    /* return slot for number of elements written */
-    uint64_t elem_count;
-
-    /* size of elements in bits */
-    uint64_t elem_bits;
-
-    /* externally allocated data buffer
-       NB - must be checked for storage capacity before writing */
-    struct KDataBuffer *data;
-    
-    uint8_t no_cache;
-};
-
-
-/* VFixedRowResult
- *  fixed row function output block
- *
- *  for functions that operate on a single row of input
- *  and generate an output row of the same length.
- *
- *  NB. These functions are considered to be deterministic.
- *
- *  "base" [ IN ] and "first_element" [ IN ] - first element in row
- *  i.e. for any row of type "T", "( ( const T* ) base ) [ row_start ]"
- *  is the first element.
- *
- *  "elem_count" [ IN ] - fixed length of output row
- *
- *  "elem_bits" [ IN ] - element size in bits
- */
-typedef struct VFixedRowResult VFixedRowResult;
-struct VFixedRowResult
-{
-    /* fixed row length */
-    uint64_t elem_count;
-
-    /* size of elements in bits */
-    uint64_t elem_bits;
-
-    /* externally allocated buffer of fixed length */
-    uint64_t first_elem;
-    void *base;
-};
-
-
-/* VByteOrder
- *  single byte indicator of byte order
- *
- *  "vboNone" - data are byte order independent
- *
- *  "vboNative" - data are in native byte order
- *
- *  "vboLittleEndian" - specific byte orders
- *  "vboBigEndian"
- */
-typedef uint8_t VByteOrder;
-enum
-{
-    vboNone,
-    vboNative,
-    vboLittleEndian,
-    vboBigEndian
-};
-
-
-/* VBlobData
- *  blob function input block
- *
- *  describes entire blob of input without row boundaries
- *  the size of the blob in bits will be "elem_count" * "elem_bits"
- *
- *  "data" [ IN ] - pointer to first byte in blob
- *
- *  "elem_count" [ IN ] - the number of elements in blob
- *
- *  "elem_bits" [ IN ] - element size in bits
- *
- *  "byte_order" [ IN ] - byte order of input data
- */
-typedef struct VBlobData VBlobData;
-struct VBlobData
-{
-    /* element size in bits */
-    uint64_t elem_bits;
-
-    /* blob data buffer */
-    uint64_t elem_count;
-    const void *data;
-
-    /* byte order of data */
-    VByteOrder byte_order;
-};
-
-
-/* VBlobResult
- *  blob function output block
- *
- *  describes entire blob of output without row boundaries
- *
- *  "header" [ OUT, NULL OKAY ] - optional return parameter
- *  for substituted header when encoding
- *
- *  "data" [ IN ] - pointer to output buffer
- *
- *  "elem_count" [ IN/OUT ] - the maximum number
- *  of elements in blob ( at the current elem_bits )
- *
- *  "elem_bits" [ IN/OUT ] - element size in bits
- *
- *  "byte_order" [ IN/OUT ] - byte order of input data
- */
-typedef struct VBlobResult VBlobResult;
-struct VBlobResult
-{
-    /* element size in bits */
-    uint64_t elem_bits;
-
-    /* blob data buffer */
-    uint64_t elem_count;
-    void *data;
-
-    /* optional replacement header */
-    VBlobHeader *header;
-
-    /* byte order of data */
-    VByteOrder byte_order;
-};
-
-
-/* VBlobFunc
- *  functions that create blobs from a single input
- *
- *  "info" [ IN ] - runtime objects and information
- *
- *  "dst" [ IN ] - return parameter block
- *
- *  "src" [ IN ] - single input parameter
- *
- *  "hdr" [ IN ] - blob header belonging to either the "src"
- *  or "dst" blob depending upon activity. when encoding, "hdr"
- *  pertains to the "dst" blob, and should be populated with
- *  information needed when decoding, when "hdr" will pertain
- *  to "src".
- *
- *  return values:
- *    0 for no error
- *    RC ( *, rcFunction, rcExecuting, rcBuffer, rcInsufficient )
- *      when output buffer is insufficient. this condition is an
- *      error on decompression, but not on compress. on compress,
- *      the size of input buffer == size of output buffer. if no
- *      compression is possible, the library will store data as is.
- *    RC ( *, rcFunction, rcExecuting, *, * )
- *      general errors have this RC format, where your module
- *      and proper object and state defines are substituted.
- */
-typedef rc_t ( CC * VBlobFunc ) ( void *self, const VXformInfo *info,
-    VBlobResult *dst, const VBlobData *src, VBlobHeader *hdr );
-
-
-/* VArrayFunc
- *  functions that perform element-wise transforms
- *
- *  "info" [ IN ] - runtime objects and information
- *
- *  "dst" [ IN ] - return buffer
- *
- *  "src" [ IN ] - input buffer
- *
- *  "elem_count" [ IN ] - the number of elements
- *  in both input and output
- */
-typedef rc_t ( CC * VArrayFunc ) ( void *self, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count );
-
-
-/* VNonDetRowFunc
- *  functions that operate on a single row of input data
- *  and produce a single row of output data, where the
- *  number of elements in the output row is unrelated to
- *  the number of elements of input.
- *  NB. these functions are considered non-deterministic.
- *
- *  "info" [ IN ] - runtime objects and information
- *
- *  "row_id" [ IN ] - specific row id being processed
- *
- *  "rslt" [ IN ] - return parameter block
- *
- *  "argc" [ IN ] and "argv" [ IN ] - zero or more input
- *  parameter blocks
- */
-typedef rc_t ( CC * VNonDetRowFunc ) ( void *self,
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] );
-
-
-/* VRowFunc
- *  functions that operate on a single row of input data
- *  and produce a single row of output data, where the
- *  number of elements in the output row is unrelated to
- *  the number of elements of input.  The results are
- *  cached.
- *
- *  "info" [ IN ] - runtime objects and information
- *
- *  "row_id" [ IN ] - specific starting row id being processed
- *
- *  "rslt" [ IN ] - return parameter block
- *
- *  "argc" [ IN ] and "argv" [ IN ] - zero or more input
- *  parameter blocks
- */
-typedef rc_t ( CC * VRowFunc ) ( void *self,
-     const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-     uint32_t argc, const VRowData argv [] );
-
-    
-/* VFixedRowFunc
- *  functions that operate on a single row of input data
- *  and produce a single row of output data, where the
- *  number of elements in the output row is known to be
- *  equal to the number of elements of input.
- *
- *  "info" [ IN ] - runtime objects and information
- *
- *  "row_id" [ IN ] - specific row id being processed
- *
- *  "rslt" [ IN ] - return parameter block
- *
- *  "argc" [ IN ] and "argv" [ IN ] - zero or more input
- *  parameter blocks
- */
-typedef rc_t ( CC * VFixedRowFunc ) ( void *self,
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt,
-    uint32_t argc, const VRowData argv [] );
-
-
-
-/*==========================================================================
- * factory functions
- *
- *  factory functions are declared in schema - normally implicitly but
- *  sometimes explicitly - and provided in dynamically loadable shared
- *  libraries. the types described in the following section will be used
- *  during cursor open to generate optimized code for data processing.
- */
-
-
-/* XfactInfo
- *  constant input parameter block
- *  holds references to managers and container hierarchy
- *  as well as transform return type information
- *
- *  "mgr" [ IN ] - db mgr object
- *
- *  "dt" [ IN ] - type system mgr
- *
- *  "tbl" [ IN ] - owning table. can be used
- *   to access enclosing database
- *
- *  "desc" [ IN ] - description of return data type
- */
-typedef struct VXfactInfo VXfactInfo;
-struct VXfactInfo
-{
-    struct VDBManager const *mgr;
-    struct VSchema const *schema;
-    struct VTable const *tbl;
-    struct VCursorParams const *parms;
-    VFormatdesc fdesc;
-};
-
-
-/* VFactoryParams
- *  block of parameters to be evaluated by factory
- *  used to "templatize" runtime function
- *
- *  "argc" [ IN ] and "argv" [ IN, DYNAMIC ] - variable
- *  length array of input parameter description blocks:
- *
- *    "desc" [ IN ] - type descriptor tells data domain
- *    and size information for a single element of input
- *
- *    "count" [ IN ] - gives the dimensionality of
- *    data vector.
- *
- *    "data" [ IN, UNION ] - array of input elements
- *    selected by "desc.domain" and "desc.intrinsic_bits"
- */
-typedef struct VFactoryParams VFactoryParams;
-struct VFactoryParams
-{
-    uint32_t argc;
-    uint32_t align;
-
-    struct
-    {
-        /* describes constant element,
-           i.e. sizeof ( arg typedecl ) */
-        VTypedesc desc;
-
-        /* describes length of param vector:
-           bool, numeric: count of [ elem, elem, ... ]
-           utf8: number of bytes
-           other text: number of characters */
-        uint32_t count;
-
-        union
-        {
-            /* boolean */
-            const bool *b;
-
-            /* integer */
-            const int8_t *i8;
-            const int16_t *i16;
-            const int32_t *i32;
-            const int64_t *i64;
-
-            /* unsigned integer */
-            const uint8_t *u8;
-            const uint16_t *u16;
-            const uint32_t *u32;
-            const uint64_t *u64;
-
-            /* floating point */
-            const float *f32;
-            const double *f64;
-
-            /* ascii */
-            const char *ascii;
-
-            /* unicode */
-            const char *utf8;
-            const uint16_t *utf16;
-            const uint32_t *utf32;
-
-            /* missing function pointer */
-
-        } data;
-
-    } argv [ 16 ];
-};
-
-
-/* FunctionParams
- *  block of parameter typedecls to be evaluated by factory
- *  used to "templatize" runtime function
- *
- *  "argc" [ IN ] and "argv" [ IN, DYNAMIC ] - description
- *  of runtime parameters. actual dimension is given by "argc"
- */
-typedef struct VFunctionParams VFunctionParams;
-struct VFunctionParams
-{
-    uint32_t argc;
-    uint32_t align;
-    VFormatdesc argv [ 16 ];
-};
-
-
-/* FuncDesc
- *  parameter block for describing runtime function
- *  guaranteed to be zeroed on input
- *
- *  "self"  [ OUT, OPAQUE ] - optional object or
- *  data pointer for function.
- *
- *  "whack" [ OUT, NULL OKAY ] - optional destructor
- *  called with "self" when function is released
- *
- *  "u" [ OUT ] - several variants of function
- *
- *  "variant" [ OUT ] - selects variant of "u"
- */
-typedef uint32_t VFuncType;
-enum
-{
-    vftInvalid,
-    vftReserved,
-    vftRow,
-    vftIdDepRow, /*** function dependent on row_id ***/
-    vftFixedRow,
-    vftNonDetRow,
-    vftArray,
-    vftBlob
-};
-
-typedef struct VFuncDesc VFuncDesc;
-struct VFuncDesc
-{
-    /* object and optional destructor */
-    void *self;
-    void ( CC * whack ) ( void *self );
-    
-    /* runtime function */
-    union
-    {
-        VRowFunc rf;
-        VNonDetRowFunc ndf;
-        VFixedRowFunc pf;
-        VArrayFunc af;
-        VBlobFunc bf;
-    } u;
-    
-    VFuncType variant;
-};
-
-
-/* TransformFactory
- *  unified typedef for row, page and blob transformation function factories
- *
- *  "self" [ IN, OPAQUE ] - NULL or const object pointer
- *  value registered with the manager
- *
- *  "info" [ IN ] - managers and table for the column,
- *  plus column type information
- *
- *  "rslt" [ IN ] - return value parameter block for resolved function
- *
- *  "cp" [ IN ] - constant template parameters
- *
- *  "dp" [ IN ] - type information for runtime parameters
- */
-typedef
-rc_t ( CC * VTransformFactory ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp );
-
-
-/* VTransDesc
- *  describes a transform factory
- */
-typedef struct VTransDesc VTransDesc;
-struct VTransDesc
-{
-    /* opaque factory data object */
-    void *fself;
-    void ( CC * whack ) ( void *fself );
-
-    /* factory entrypoint */
-    VTransformFactory factory;
-
-    /* interface version */
-    uint32_t itf_version;
-};
-
-#define VTRANSVERS( maj, min, rel ) \
-    ( ( ( maj ) << 24 ) | ( ( min ) << 16 ) | ( rel ) )
-
-/* actual factory function implementation name */
-#define VTRANSFACT_NAME( fact ) \
-    fact ## _fact
-
-/* exported factory name */
-#define VTRANSFACT_DECL( fact ) \
-    rc_t CC fact ( VTransDesc *desc )
-
-/* factory declaration with no self parameter */
-#define VTRANSFACT_IMPL( fact, maj, min, rel ) \
-    VTRANSFACT_IMPL_SELF( fact, maj, min, rel, NULL )
-
-/* factory declaration with static or constant self parameter */
-#define VTRANSFACT_IMPL_SELF( fact, maj, min, rel, self ) \
-    static rc_t CC VTRANSFACT_NAME ( fact ) ( const void*, \
-        const VXfactInfo*, VFuncDesc*, const VFactoryParams*, const VFunctionParams* ); \
-    rc_t CC fact ( VTransDesc *desc ) \
-    { \
-        desc -> fself = ( self ); \
-        desc -> whack = NULL; \
-        desc -> factory = VTRANSFACT_NAME ( fact ); \
-        desc -> itf_version = VTRANSVERS ( maj, min, rel ); \
-        return 0; \
-    } \
-    static rc_t CC VTRANSFACT_NAME ( fact )
-
-/* factory declaration with dynamically allocated self parameter */
-#define VTRANSFACT_IMPL_CONSTRUCT( fact, maj, min, rel, construct, destroy ) \
-    static rc_t CC VTRANSFACT_NAME ( fact ) ( const void*, \
-        const VXfactInfo*, VFuncDesc*, const VFactoryParams*, const VFunctionParams* ); \
-    rc_t CC fact ( VTransDesc *desc ) \
-    { \
-        desc -> whack = ( destroy ); \
-        desc -> factory = VTRANSFACT_NAME ( fact ); \
-        desc -> itf_version = VTRANSVERS ( maj, min, rel ); \
-        return construct ( & desc -> fself ); \
-    } \
-    static rc_t CC VTRANSFACT_NAME ( fact )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vdb_xform_ */
diff --git a/interfaces/vfs/extern.h b/interfaces/vfs/extern.h
deleted file mode 100644
index fd1731a..0000000
--- a/interfaces/vfs/extern.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vfs_extern_
-#define _h_vfs_extern_
-
-#if ! defined EXPORT_LATCH && defined _LIBRARY
-#define VFS_EXTERN LIB_EXPORT
-#define VFS_EXTERN_DATA extern LIB_EXPORT
-#define EXPORT_LATCH 1
-#else
-#define VFS_EXTERN LIB_IMPORT
-#ifdef __cplusplus
-#define VFS_EXTERN_DATA extern /* LIB_IMPORT_DATA */
-#else
-#define VFS_EXTERN_DATA LIB_IMPORT_DATA
-#endif
-#endif
-
-#ifndef _h_klib_extern_
-#include <klib/extern.h>
-#endif
-
-#endif /* _h_vfs_extern_ */
diff --git a/interfaces/vfs/manager-priv.h b/interfaces/vfs/manager-priv.h
deleted file mode 100644
index 00116ed..0000000
--- a/interfaces/vfs/manager-priv.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_vfs_manager_priv_
-#define _h_vfs_manager_priv_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ENV_KRYPTO_PWFILE       "VDB_PWFILE"
-#define KFG_KRYPTO_PWFILE         "krypto/pwfile"
-#define KFG_KRYPTO_PWFD         "krypto/pwfd"
-
-
-struct VFSManager;
-struct KDirectory;
-struct KFile;
-struct VPath;
-struct SRAPath;
-struct KConfig;
-
-/* this resembles the interface functions in manager.h
- * but allows the use of a KDirectory for the base instead of a VPath
- * of a directory
- *
- * this is expected to be more temporary if this code base continues.
- * much longer
- */
-VFS_EXTERN rc_t CC VFSManagerResolvePathRelativeDir (const struct VFSManager * self,
-                                                     uint32_t flags,
-                                                     const struct  KDirectory * base_dir,
-                                                     const struct  VPath * in_path,
-                                                     struct VPath ** out_path);
-
-
-
-/* bad interface.  Bad! Bad!
- * but needed to hack VFS into KDB
- * MORE THAN BAD. REFLECTS A TOTAL MISUNDERSTANDING OF FS.
- */
-VFS_EXTERN rc_t CC VFSManagerOpenFileReadDirectoryRelative (const struct VFSManager *self, 
-    const struct KDirectory * dir, struct KFile const **f, const struct VPath * path);
-
-VFS_EXTERN rc_t CC VFSManagerOpenFileReadDirectoryRelativeDecrypt (const struct VFSManager *self, 
-    const struct KDirectory * dir, struct KFile const **f, const struct VPath * path);
-
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryReadDirectoryRelative ( const struct VFSManager *self,
-    struct KDirectory const * dir, struct KDirectory const **d, const struct VPath * path );
-
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt ( const struct VFSManager *self,
-    struct KDirectory const * dir, struct KDirectory const **d, const struct VPath * path );
-
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryUpdateDirectoryRelative ( const struct VFSManager *self,
-    struct KDirectory const * dir, struct KDirectory **d, const struct VPath * path );
-
-#define VPathMakeDirectoryRelative LegacyVPathMakeDirectoryRelative
-VFS_EXTERN rc_t CC VPathMakeDirectoryRelative ( struct VPath ** new_path,
-    struct KDirectory const * dir, const char * posix_path);
-
-
-VFS_EXTERN rc_t CC VFSManagerOpenFileReadDecrypt (const struct VFSManager *self,
-                                                  struct KFile const **f,
-                                                  const struct VPath * path);
-
-
-/*
- * quick hack for vdb-validate for immediate testing release
- */
-VFS_EXTERN rc_t CC VFSManagerWGAValidateHack (const struct VFSManager * self, 
-                                              const struct KFile * file,
-                                              const char * path); /* we'll move this to a vpath */
-
-/*
- * Access to VFSManager's instance of configuration object, for testing purposes
- */
-VFS_EXTERN const struct KConfig* CC VFSManagerGetConfig(const struct VFSManager * self);
-
-/* Make using a custom KConfig
- */
-VFS_EXTERN rc_t CC VFSManagerMakeFromKfg ( struct VFSManager ** pmanager,
-    struct KConfig * cfg );
-
-/*
- * Set/get pathname of the object_id/object_name bindings file (used for testing; should go away when the functionality
- *  is rolled into KeyRing server)
- * Set to NULL to use the default location ("~/.ncbi/objid.mapping")
- */
-VFS_EXTERN void VFSManagerSetBindingsFile(struct VFSManager * self, const char* path);
-VFS_EXTERN const char* VFSManagerGetBindingsFile(struct VFSManager * self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vfs_manager_priv_ */
diff --git a/interfaces/vfs/manager.h b/interfaces/vfs/manager.h
deleted file mode 100644
index 3cf2588..0000000
--- a/interfaces/vfs/manager.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_vfs_manager_
-#define _h_vfs_manager_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct VPath;
-struct VResolver;
-struct KDirectory;
-struct VPath;
-
-/* temporary */
-
-
-/*--------------------------------------------------------------------------
- * VFSManager
- */
-typedef struct VFSManager VFSManager;
-
-#define VFS_KRYPTO_PASSWORD_MAX_SIZE 4096
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-VFS_EXTERN rc_t CC VFSManagerAddRef ( const VFSManager *self );
-VFS_EXTERN rc_t CC VFSManagerRelease ( const VFSManager *self );
-
-/* OpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] VPath representing the path, URL or URN of the desired file
- */
-VFS_EXTERN rc_t CC VFSManagerOpenFileRead (const VFSManager *self, 
-                                           struct KFile const **f,
-                                           const struct VPath * path);
-
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryRead ( const VFSManager *self,
-    struct KDirectory const **d, const struct VPath * path );
-
-/* it forces decryption to be used for kdb */
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryReadDecrypt ( const VFSManager *self,
-    struct KDirectory const **d, const struct VPath * path );
-
-VFS_EXTERN rc_t CC VFSManagerOpenDirectoryUpdate ( const VFSManager *self,
-    struct KDirectory **d, const struct VPath * path );
-
-
-/* OpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "path" [ IN ] VPath representing the path, URL or URN of the desired file
- */
-VFS_EXTERN rc_t CC VFSManagerOpenFileWrite (const VFSManager *self,
-                                            struct KFile **f,
-                                            bool update,
-                                            const struct VPath * path);
-
-/* CreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] VPath representing the path, URL or URN of the desired file
- */
-VFS_EXTERN rc_t CC VFSManagerCreateFile (const VFSManager *self, 
-                                         struct KFile **f,
-                                         bool update, uint32_t access,
-                                         KCreateMode mode,
-                                         const struct VPath * path );
-
-
-/* Remove
- *  remove an accessible object from its directory
- *
- *  "force" [ IN ] - if true and target is a directory,
- *  remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-VFS_EXTERN rc_t CC VFSManagerRemove (const VFSManager *self, bool force,
-                                     const struct VPath * path );
-
-
-/* Make
- */
-VFS_EXTERN rc_t CC VFSManagerMake ( VFSManager ** pmanager );
-
-/* GetCWD
- */
-VFS_EXTERN rc_t CC VFSManagerGetCWD (const VFSManager * self, struct KDirectory ** cwd);
-
-VFS_EXTERN rc_t CC VFSManagerGetResolver ( const VFSManager * self, struct VResolver ** resolver );
-
-
-VFS_EXTERN rc_t CC VFSManagerGetKryptoPassword (const VFSManager * self, char * new_password, size_t max_size, size_t * size);
-
-/*
-  NULL value for self
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcSelf, rcNull);
-
-  NULL value for password or 0 value for size
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcParam, rcNull);
-
-  size greater than VFS_KRYPTO_PASSWORD_MAX_SIZE
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcSize, rcExcessive);
-
-  illegal CR or LF (NL) in the password
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcEncryptionKey, rcInvalid);
-
-  path/file name for password too long for function as written
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcExcessive);
-
-  existing password path/file name is not a file
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcIncorrect);
-
-  unknown file type for configured path/file name
-  RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcCorrupt);
-
-  incomplete writes to temporary password file
-  RC (rcVFS, rcEncryptionKey, rcWriting, rcFile, rcInsufficient);
-
-  other errors from KFS and KLIB
-*/
-
-/* pwd_dir[pwd_dir_size] -
-    Output parameters for path to directory containing the password file.
-    pwd_dir is not updated if pwd_dir == NULL or pwd_dir_size == 0
-                  or pwd_dir_size is insufficient to copy the path
- */
-VFS_EXTERN rc_t CC VFSManagerUpdateKryptoPassword (const VFSManager * self, 
-                                                   const char * password,
-                                                   size_t size,
-                                                   char * pwd_dir,
-                                                   size_t pwd_dir_size);
-
-
-VFS_EXTERN rc_t CC VFSManagerResolveSpec ( const VFSManager * self,
-                                           const char * spec,
-                                           struct VPath ** path_to_build,
-                                           const struct KFile ** remote_file,
-                                           const struct VPath ** local_cache,
-                                           bool resolve_acc );
-
-struct KDirectory;
-
-VFS_EXTERN rc_t CC VFSManagerResolveSpecIntoDir ( const VFSManager * self,
-                                                  const char * spec,
-                                                  const struct KDirectory ** dir,
-                                                  bool resolve_acc );
-
-/*--------------------------------------------------------------------------
- * KConfig
- *  placing some KConfig code that relies upon VFS here
- */
-struct KConfig;
-struct KConfigNode;
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-VFS_EXTERN rc_t CC KConfigReadVPath ( struct KConfig const* self, const char* path, struct VPath** result );
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-VFS_EXTERN rc_t CC KConfigNodeReadVPath ( struct KConfigNode const *self, struct VPath** result );
-
-/* ResolvePath
- *
- * take a VPath and resolve to a final form apropriate for KDB
- *
- * that is take a relative path and resolve it against the CWD
- * or take an accession and resolve into the local or remote 
- * VResolver file based on config. It is just a single resolution percall
- *
- * flags
- *      can disable all Accession resolution
- *      can let VPath With no scheme be treated as a possible accession
- *
- */
-
-/* bit values for flags */
-    /* allow no local accession resolution */
-#define vfsmgr_rflag_no_acc_local (1<<0)
-    /* allow no remote accession resolution */
-#define vfsmgr_rflag_no_acc_remote (1<<1)
-    /* never do VResolver Accession resolution */
-#define vfsmgr_rflag_no_acc  (vfsmgr_rflag_no_acc_local|vfsmgr_rflag_no_acc_remote)
-    /* use VResolver Accession resolution for simple names with no scheme */
-
-#define vfsmgr_rflag_kdb_acc (1<<2)
-    /* over ridden by vfsmgr_rflag_no_acc */
-
-
-VFS_EXTERN rc_t CC VFSManagerResolvePath (const VFSManager * self,
-                                          uint32_t flags,
-                                          const struct  VPath * in_path,
-                                          struct VPath ** out_path);
-
-VFS_EXTERN rc_t CC VFSManagerResolvePathRelative (const VFSManager * self,
-                                                  uint32_t flags,
-                                                  const struct  VPath * base_path,
-                                                  const struct  VPath * in_path,
-                                                  struct VPath ** out_path);
-
-/*
- * Registering bindings between dbGaP object Ids and object names
- */                                                  
-
-/* VFSManagerRegisterObject
- *  registers a binding between an object Id and an object name (object = accession or dbGaP file) 
- * 
- * self [ IN ] - VFSManager object
- * oid [ IN ] - object id
- * obj [ IN ] - Vpath representing the object's name (scheme is "ncbi-acc" for accessions, "ncbi-file" for dbGaP files; 
- *              the name itself is the 'path' component
- */
-VFS_EXTERN rc_t CC VFSManagerRegisterObject(struct VFSManager* self, uint32_t oid, const struct VPath* obj);
-
-/* VFSManagerGetObjectId
- *  look up an object id by an object name 
- * 
- * self [ IN ] - VFSManager object
- * obj [ IN ] - Vpath representing the object's name (scheme is "ncbi-acc" for accessions, "ncbi-file" for dbGaP files; 
- *              the name itself is the 'path' component
- * oid [ OUT ] - object id
- */
-VFS_EXTERN rc_t CC VFSManagerGetObjectId(const struct VFSManager* self, const struct VPath* obj, uint32_t* oid);
-
-/* VFSManagerGetObject
- *  look up an object name by an object id
- * 
- * self [ IN ] - VFSManager object
- * oid [ IN ] - object id
- * obj [ OUT ] - Vpath representing the object's name (scheme is "ncbi-acc" for accessions, "ncbi-file" for dbGaP files; 
- *              the name itself is the 'path' component
- */
-VFS_EXTERN rc_t CC VFSManagerGetObject(const struct VFSManager* self, uint32_t oid, struct VPath** obj);
-
-
-                                                  
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_manager_ */
diff --git a/interfaces/vfs/path-priv.h b/interfaces/vfs/path-priv.h
deleted file mode 100644
index 66c3fb3..0000000
--- a/interfaces/vfs/path-priv.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/*===========================================================================
-*
-*                            Public Domain Notice
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vfs_path_priv_
-#define _h_vfs_path_priv_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_vfs_path_
-#include <vfs/path.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-
-
-#define NCBI_FILE_SCHEME       "ncbi-file"
-#define NCBI_ACCESSION_SCHEME  "ncbi-acc"
-#define HTTP_SCHEME            "http"
-#define FTP_SCHEME             "ftp"
-#define FASP_SCHEME            "fasp"
-#define NCBI_LEGREFSEQ_SCHEME  "x-ncbi-legrefseq"
-#define NCBI_OBJECT_SCHEME     "ncbi-obj"
-
-/* options for a VPath possibly obtained from a query string on an URI */
-typedef uint32_t VPOption_t;
-enum eVPOption_t
-{
-    vpopt_encrypted,
-    vpopt_pwpath,
-    vpopt_pwfd,
-    vpopt_readgroup,
-#if 0    
-    vpopt_temporary_pw_hack,
-#endif    
-    vpopt_vdb_ctx,
-    vpopt_gap_ticket, 
-    vpopt_count
-};
-
-
-/* =====
- * Much of what follows is expected to move into the interface vfs/path.h
- * once it becomes supported.
- */
-
-/* MakeFmt
- *  make a path object from a format string plus arguments
- *
- *  "new_path" [ OUT ] - a reference to the new object.
- *
- *  "fmt" [ IN ] and "args" [ IN ] - arguments to string_printf
- *  ( see <klib/text.h> ) to build a NUL-terminated string
- *  that conforms with the rules for "posix_path"
- *
- * NB - SECURITY RISK IF USED DIRECTLY FROM EXTERNAL STRINGS.
- *      ALSO, FMT IS **NOT** PRINTF COMPATIBLE - see string_printf.
- */
-
-#if 0
-VFS_EXTERN rc_t CC VPathMakeRelative ( VPath ** new_path, const VPath * base_path,
-                                       const char * relative_path );
-VFS_EXTERN rc_t CC VPathMakeRelativeFmt ( VPath ** new_path, const VPath * base_path,
-                                          const char * fmt, ... );
-VFS_EXTERN rc_t CC VPathVMakeRelativeFmt ( VPath ** new_path, const VPath * base_path,
-                                           const char * fmt, va_list args );
-VFS_EXTERN rc_t CC VPathMakeCurrentPath ( VPath ** new_path );
-
-VFS_EXTERN rc_t CC VPathMakeURI ( VPath ** new_path, const char * uri );
-#endif
-
-
-/* Option
- *  rc == 0 if the option has been specified
- *  for options with a parameter, the value of the parameter is copied to buffer
- */
-VFS_EXTERN rc_t CC VPathOption ( const VPath * self, VPOption_t option,
-                                char * buffer, size_t buffer_size,
-                                size_t * num_read);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vfs_path_priv_ */
-
-/*--------------------------------------------------------------------------
- *
- * The ABNF form described in RFC5234 will be used to define URLS and paths
- * with some handwaving instead of complete character definitions for case 
- * insensitivity.  CORE definitions from RFC5234 will be used again handwaving
- * case insensitivity.
- *
- * --------------------
- *
- * URL for a VPath
- *
- *  as per RFC 3986, an URI consists of:
- *
- *    URI           = scheme ":" heir-part [ "?" query ] [ "#" fragment ]
- *
- *  We will support however something intbetween an URI and an IRI in that we'll
- *  all UTF-8 rather than limit certain characters to ASCII.
- *
- *  For the NCBI path  URL:  The hier-part is intended to be compatible with the 
- *                    "file:" scheme  Authority on any of the Unix-like operating
- *                    systems must either be empty or "localhost".  For Windows
- *                    it must  be a host that can be used if the "file" url is
- *                    translated into a UNC style Windows path.  Also in a
- *                    Windows vfs: URL a single colon ':' will be allowed only at
- *                    the end of a single character rive letter for the first
- *                    sub-part of the path.
- *
- *    scheme        = "ncbi-file" ; ( case insensitive )
- *
- *    hier-part     = "//" authority path-abempty
- *                  / path-absolute
- *                  / path-relative
- *                  / path-empty
- *
- * by RFC 3986 authority is
- *    authority     = [ userinfo "@" ] host [ ":" port]
- * but at this point we only recognize
- *    authority     = host
- *
- * by RFC 3986 host is
- *    host          = IP-literal / IPv4address / reg-name
- * but at this point we only recognize
- *    host          = reg-name
- *
- *    reg-name      = *( unreserved / pct-encoded / sub-delims )
- *
- *    path          = path-abempty
- *                  / path-absolute
- *                  / path-noscheme
- *                  / path-rootless
- *                  / path-empty
- *
- *    path-abempty  = * ( "/" segment )
- *
- *    path-absolute = "/" segment-nz *( "/" segment )
- *
- *    path-noscheme = segment-nz-nc *( "/" segment )
- *
- *    path-rootless = segment-nz *( "/" segment )
- *
- *    path-empty    = ""
- *
- *    segment       = *pchar       ; can be empty
- *    segment-nz    = 1*pchar      ; can't be empty
- *    segment-nz-nc = 1*pchar-nz   ; can't be empty
- *
- *    pchar         = ":" / pchar-nc
- *
- *    pchar-nc      = unreserved / pct-encoded / sub-delims ? "@"
- *
- *    pct-encoded   = "%" HEXDIG HEXDIG ; hex digits are 0-9, a-f or A-F
- *
- *    authority   = "localhost" / host-name ; the host name is an O/S specific 
- *                                          ; name of a remote host 
- *
- *    query       = query_entry [ * ( "&" query_entry ) ]
- *
- *    query_entry = "encrypt" / "enc" / ( "pwfile=" hier-part ) / ( "pwfd=" fd )
- *
- *    fd          = 1* DIGIT
- *
- *    unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~" / UTF-8
- *
- *    reserved    = gen-delims / subdelims
- *
- *    gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
- *
- *    sub-delims  = "!" / "$" / "&" / "'" / "(" / ")" / "*"
- *                / "+" / "," / ";" / "="
- *
- * Handwaving on the UTF-8.  We'll accept it rather than requiring percent encoding
- * in most cases.
-
- * Examples:
- *         "ncbi-file://home/my-name/data-files"
- *         "ncbi-file://win-server/archive/secure/read12345?encrypted"
- *         "ncbi-file:///c:/scanned-data/0001/file.sra?enc?pwd-file=c:/Users/JamesMcCoy/ncbi.pwd"
- *
- *  We allow an implied scheme of "vfs" if none present.
- *  'host-name' is partially implemented for Windows.  Not currently for any the
- *  of the supported Unix systems.  We do not support IP addresses instead of 
- *  host names.
- *
- *  'path' can be either absolute or relative and must be posix style as per 
- *  RFC 3986 and matches the "file" scheme.
- *
- *  'fragment' is not yet implemented or defined.
- *
- *  'fd' is a system specific file handle.  Not yet supported on Windows.
- *
- * --------------------
- *
- * VFS posix_path representation:
- *
- * The internal representation of a path for VFS resembles very closely the
- * POSIX pathname crossed with the Windows UNC path.  Only the Unix "/" 
- * separator is allowed not the "\" for paths.
- *
- * posix-path     = full-path / relative-path
- *
- * full-path      = ["//" host] "/" [ directory-path "/" ] resource
- *
- * relative-path  = [ directory-path "/" ] resource
- *
- * directory-path = resource [ "/" directory-path ]
- *
- * resource       = string ; (UTF-8 O/S specific name for a directory or a file)
- *
- * host           = string ; (UTF-8 O/S specific name for the local or remote host)
- *
- * For a host "localhost" is a synonym for the current host.
- * The "//host" is not guaranteed to work for all systems except "//localhost"
- *
- * The resource "." is assumed to mean the local directory and will be stripped
- * when a path is made canonical.
- *
- * The resource ".." is assumed to mean the containing directory and when made 
- * canonical it will be left in at the begining for relative paths or removed along 
- * with the preceding resource name.
- *
- * For Windows the device is handled in a unique way with some potential for ambiguity.
- * The UNC approach for a named drive "C:" becomes "/c".  So "C:\" becomes "/c/".
- *
- * In the future the complex approach from the "file:" URL should be adopted 
- * with the ":" allowed only in the first directory name in a path.  RFC 3986 
- * notes though that this complex approach puts some five variants into the ABNF
- * to describe the path portion of an URL.
- */
diff --git a/interfaces/vfs/path.h b/interfaces/vfs/path.h
deleted file mode 100644
index d9fa953..0000000
--- a/interfaces/vfs/path.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*===========================================================================
-*
-*                            Public Domain Notice
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vfs_path_
-#define _h_vfs_path_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-struct VFSManager;
-
-
-/*--------------------------------------------------------------------------
- * VPath
- *  represents an unbound object query key
- *  may be created from a simple file-system path,
- *  a more formal URN or URL,
- *  or other modes of creation
- *
- *  a path will have these parts:
- *    scheme       : a scheme for retrieval
- *    auth         : login name for authentication
- *    host         : authoritative source
- *    port         : port for connecting with host
- *    path         : host-relative path
- *    query        : parameters for interpretation
- *    fragment     : internal component of object
- *    proj         : project id
- *    name         : alternate or primary name
- *
- *  file-system paths with no modifying parameters
- *  will be given standard "file" scheme. paths having
- *  parameters will be given the scheme "ncbi-file".
- *
- *  standard networking schemes ( "http", "ftp", etc. )
- *  are supported.
- *
- *  NCBI accessions are given the scheme "ncbi-acc".
- *
- *  NCBI remote object id paths receive scheme "ncbi-obj".
- */
-typedef struct VPath VPath;
-
-
-/* MakePath
- *  make a path object from a string conforming to
- *  either a standard POSIX path or a URI
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "path_str" [ IN ] - a UTF-8 NUL-terminated string
- *  representing a POSIX path or URI, or
- *  a string_printf compatible format string
- *
- *  "path_fmt" [ IN ] and "args" [ IN ] - a UTF-8 NUL-terminated fmt string
- *  compatible with string_vprintf, plus argument list
- *
- *  Examples:
- *      "ncbi-file:/home/my-name/data-files"
- *      "ncbi-file://win-server/archive/secure/read12345?encrypted"
- *      "ncbi-file:///c/scanned-data/0001/file.sra?enc&pwfile=/c/Users/JamesMcCoy/ncbi.pwd"
- */
-VFS_EXTERN rc_t CC VFSManagerMakePath ( struct VFSManager const * self,
-    VPath ** new_path, const char * path_str, ... );
-VFS_EXTERN rc_t CC VFSManagerVMakePath ( struct VFSManager const * self,
-    VPath ** new_path, const char * path_fmt, va_list args );
-
-
-/* MakeSysPath
- *  make a path object from an OS native filesystem path string
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "sys_path" [ IN ] - a UTF-8 NUL-terminated string
- *  representing a native filesystem path
- *
- *  "wide_sys_path" [ IN ] - a wide NUL-terminated string
- *  representing a native filesystem path, where
- *  wchar_t is either USC-2 or UTF-32 depending upon libraries
- */
-VFS_EXTERN rc_t CC VFSManagerMakeSysPath ( struct VFSManager const * self,
-    VPath ** new_path, const char * sys_path );
-VFS_EXTERN rc_t CC VFSManagerWMakeSysPath ( struct VFSManager const * self,
-    VPath ** new_path, const wchar_t * wide_sys_path );
-
-
-/* MakeAccPath - TEMPORARY
- *  takes a textual accession representation
- *  creates a VPath representing an accession
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "acc" [ IN ] - a NUL-terminated ASCII fmt string
- */
-VFS_EXTERN rc_t CC VFSManagerMakeAccPath ( struct VFSManager const * self,
-    VPath ** new_path, const char * acc, ... );
-VFS_EXTERN rc_t CC VFSManagerVMakeAccPath ( struct VFSManager const * self,
-    VPath ** new_path, const char * fmt, va_list args );
-
-
-/* MakeOidPath - TEMPORARY
- *  takes an integer oid
- *  creates a VPath representing an obj-id
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "oid" [ IN ] - a non-zero object id
- */
-VFS_EXTERN rc_t CC VFSManagerMakeOidPath ( struct VFSManager const * self,
-    VPath ** new_path, uint32_t oid );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-VFS_EXTERN rc_t CC VPathAddRef ( const VPath *self );
-VFS_EXTERN rc_t CC VPathRelease ( const VPath *self );
-
-
-/* IsFSCompatible
- *  asks if the path can be used with the OS' filesystems
- */
-VFS_EXTERN bool CC VPathIsFSCompatible ( const VPath * self );
-
-
-/* FromUri
- *  asks if the path was created from a formal URI
- */
-VFS_EXTERN bool CC VPathFromUri ( const VPath * self );
-
-
-/* Read*
- *  read the various parts
- *  copies out data into user-supplied buffer
- *
- *  "buffer" [ OUT ] and "buffer_size" [ IN ] - output buffer
- *  for data read. if sufficient space is available, the copy
- *  will be NUL-terminated.
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  for the number of valid bytes in "buffer" after a successful
- *  read. on failure due to insufficient buffer, contains the
- *  number of bytes required for transfer.
- */
-VFS_EXTERN rc_t CC VPathReadUri ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadScheme ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadAuth ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadHost ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadPortName ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadPath ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadQuery ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadParam ( const VPath * self, const char * param,
-    char * buffer, size_t buffer_size, size_t * num_read );
-VFS_EXTERN rc_t CC VPathReadFragment ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read );
-
-
-/* MakeUri
- *  convert a VPath into a URI
- */
-VFS_EXTERN rc_t CC VPathMakeUri ( const VPath * self,
-    struct String const ** uri );
-
-
-/* MakeString
- *  convert a VPath into a String
- *  respects original source of path,
- *  i.e. does not add scheme unnecessarily
- */
-VFS_EXTERN rc_t CC VPathMakeString ( const VPath * self,
-    struct String const ** str );
-
-
-/* Get*
- *  retrieves internal parts
- *  returns pointers to internal String data
- *  Strings remain valid while "self" is valid
- */
-VFS_EXTERN rc_t CC VPathGetScheme ( const VPath * self, struct String * str );
-VFS_EXTERN rc_t CC VPathGetAuth ( const VPath * self, struct String * str );
-VFS_EXTERN rc_t CC VPathGetHost ( const VPath * self, struct String * str );
-VFS_EXTERN rc_t CC VPathGetPortName ( const VPath * self, struct String * str );
-VFS_EXTERN uint16_t CC VPathGetPortNum ( const VPath * self );
-VFS_EXTERN rc_t CC VPathGetPath ( const VPath * self, struct String * str );
-VFS_EXTERN rc_t CC VPathGetQuery ( const VPath * self, struct String * str );
-VFS_EXTERN rc_t CC VPathGetParam ( const VPath * self, const char * param, struct String * str );
-VFS_EXTERN rc_t CC VPathGetFragment ( const VPath * self, struct String * str );
-/* TEMPORARY */
-VFS_EXTERN uint32_t CC VPathGetOid ( const VPath * self );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vfs_path_ */
diff --git a/interfaces/vfs/resolver.h b/interfaces/vfs/resolver.h
deleted file mode 100644
index 9922c04..0000000
--- a/interfaces/vfs/resolver.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*===========================================================================
-*
-*                            Public Domain Notice
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vfs_resolver_
-#define _h_vfs_resolver_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KFile;
-struct VPath;
-struct KConfig;
-struct KRepository;
-struct VFSManager;
-
-
-/*--------------------------------------------------------------------------
- * VResolver
- */
-typedef struct VResolver VResolver;
-
-
-/* Make
- *  ask the VFS manager to make a resolver
- */
-VFS_EXTERN rc_t CC VFSManagerMakeResolver ( struct VFSManager const * self,
-    VResolver ** new_resolver, struct KConfig const * cfg );
-VFS_EXTERN rc_t CC KRepositoryMakeResolver ( struct KRepository const * self,
-    VResolver ** new_resolver, struct KConfig const * cfg );
-
-
-/* AddRef
- * Release
- */
-VFS_EXTERN rc_t CC VResolverAddRef ( const VResolver * self );
-VFS_EXTERN rc_t CC VResolverRelease ( const VResolver * self );
-
-
-/* Accepted protocol list ordered by preference */
-typedef uint32_t VRemoteProtocols;
-enum
-{
-      eProtocolHttp
-    , eProtocolFasp
-    , eProtocolFaspHttp
-    , eProtocolHttpFasp
-    , eProtocolLastDefined
-};
-
-
-/* Query
- *  resolve object location to either an existing local path,
- *  or a pair of remote URL + local cache location.
- *
- *  "protocols" [ IN ] - the desired protocols for remote resolution
- *
- *  "query" [ IN ] - a path that can represent:
- *     accession : a recognizable accession from NCBI or known organization
- *     obj-id    : a dbGaP object id
- *     name      : a dbGaP filename
- *     path      : a filesystem path
- *     url       : a remote location
- *
- *  "local" [ OUT, NULL OKAY ] - optional return parameter for local path:
- *     accession : resolve to local user or site path
- *     obj-id    : resolve to local user protected path
- *     name      : resolve to local user protected path
- *     url       : set to NULL
- *
- *  "remote" [ OUT, NULL OKAY ] - optional return parameter for remote path:
- *     accession : resolve to URL
- *     obj-id    : resolve to URL
- *     name      : resolve to URL
- *     url       : set to duplicate
- *
- *  "cache" [ OUT, NULL OKAY ] - optional return parameter for cache path:
- *     accession : resolve to user cache path
- *     obj-id    : resolve to user cache path
- *     path      : set to NULL
- *     url       : resolve to user cache path
- *
- *  any of the output parameters may be NULL, but not all, i.e. there
- *  must be at least one non-NULL return parameter.
- *
- *  if you DON'T want local resolution, pass NULL for "local" and
- *  the query will be resolved remotely. if you don't want remote
- *  resolution, pass NULL for "remote".
- *
- *  a query that is resolved locally will always return NULL for
- *  "remote" and "cache", if the parameters are provided.
- */
-VFS_EXTERN rc_t CC VResolverQuery ( const VResolver * self,
-    VRemoteProtocols protocols, struct VPath const * query,
-    struct VPath const ** local, struct VPath const ** remote,
-    struct VPath const ** cache );
-
-
-/* Local - DEPRECATED
- *  Find an existing local file/directory that is named by the accession.
- *  rcState of rcNotFound means it does not exist.
- *
- *  other rc code for failure are possible.
- *
- *  Accession must be an ncbi-acc scheme or a simple name with no 
- *  directory paths.
- */
-VFS_EXTERN rc_t CC VResolverLocal ( const VResolver * self,
-    struct VPath const * accession, struct VPath const ** path );
-
-
-/* Remote - DEPRECATED
- *  Find an existing remote file that is named by the accession.
- *
- *  rcState of rcNotFound means it did not exist and can not be 
- *  downloaded. Probably a bad accession name.
- *
- *  Need a specific rc for no network configured.
- *  Need a specific rc for network access permitted.
- *
- *  Other rc code for failure are possible.
- *
- *  Accession must be an ncbi-acc scheme or a simple name with no 
- *  directory paths.
- *
- *  "opt_file_rtn" [ OUT, NULL OKAY ] - optional return parameter for
- *   any KFile that may be opened as a result of resolution. This can
- *   happen if resolving an accession involves opening a URL to a
- *   remote server, for example, in which case the KFile can be returned.
- */
-VFS_EXTERN rc_t CC VResolverRemote ( const VResolver * self,
-    VRemoteProtocols protocols, struct VPath const * accession,
-    struct VPath const ** path, struct KFile const ** opt_file_rtn );
-
-/* Cache - DEPRECATED
- *  Find a cache directory that might or might not contain a partially
- *  downloaded file.
- *
- *  Accession must be an ncbi-acc scheme, an http url or a simple name with no 
- *  directory paths. All three should return the same directory URL as a VPath. (?)
- *  Or should it be a directory or a file url depending upon finding a partial
- *  download? This would require co-ordination with all download mechanisms that
- *  we permit.
- *
- *  With refseq holding wgs objects we have a case were the downloaded file is not
- *  named the same as the original accession as the file archive you want is a
- *  container for other files.
- *
- *  Find local will give a path that has a special scheme in these cases. 
- *  Find remote will give the url for the container that contains the accession
- *  so using the returned VPath from resolve remote is better than the original
- *  accession in this one case.  I think...
- */
-VFS_EXTERN rc_t CC VResolverCache ( const VResolver * self,
-    struct VPath const * url, struct VPath const ** path, uint64_t file_size );
-
-
-/* EnableState
- *  modifies how the various properties are interpreted
- */
-typedef uint32_t VResolverEnableState;
-enum
-{
-    vrUseConfig = 0,            /* take enable/disable state from KConfig */
-    vrAlwaysEnable = 1,         /* always enable, regardless of KConfig   */
-    vrAlwaysDisable = 2         /* always disable, regardless of KConfig  */
-};
-
-
-/* LocalEnable
- *  modify settings for using local repositories,
- *  meaning site, user-public and user-protected.
- *
- *  "enable" [ IN ] - enable or disable local access,
- *  or follow settings in KConfig
- *
- *  returns the previous state of "remote-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-VFS_EXTERN VResolverEnableState CC VResolverLocalEnable ( const VResolver * self,
-    VResolverEnableState enable );
-
-
-/* RemoteEnable
- *  modify settings for using remote repositories
- *
- *  "enable" [ IN ] - enable or disable remote access,
- *  or follow settings in KConfig
- *
- *  returns the previous state of "remote-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-VFS_EXTERN VResolverEnableState CC VResolverRemoteEnable ( const VResolver * self,
-    VResolverEnableState enable );
-
-
-/* CacheEnable
- *  modify settings for caching files in user repositories
- *
- *  "enable" [ IN ] - enable or disable user repository cache,
- *  or follow settings in KConfig
- *
- *  returns the previous state of "cache-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-VFS_EXTERN VResolverEnableState CC VResolverCacheEnable ( const VResolver * self,
-    VResolverEnableState enable );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vfs_resolver_ */
diff --git a/libs/Makefile b/libs/Makefile
deleted file mode 100644
index ce40007..0000000
--- a/libs/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-TOP ?= $(shell ../build/abspath.sh ..)
-MODULE = libs
-
-include $(TOP)/build/Makefile.shell
-
-#-------------------------------------------------------------------------------
-# default
-#
-SUBDIRS = \
-	ext \
-	klib \
-	kproc \
-	kfs \
-	kns \
-	kxml \
-	kfg \
-	krypto \
-	vfs \
-	kapp \
-	kdb \
-	vdb \
-	vxf \
-	search \
-	sraxf \
-	align \
-	axf \
-	wgsxf \
-	ktst \
-	loader \
-	ascp \
-	sra \
-	ncbi-vdb
-
-
-# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
-include $(TOP)/build/Makefile.targets
-
-$(SUBDIRS):
-	@ $(MAKE) -C $@
-
-.PHONY: default $(SUBDIRS)
-
-#-------------------------------------------------------------------------------
-# pass-through
-#
-out debug profile release GCC ICC VC++:
-	@ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env $@
-
-.PHONY: out debug profile release GCC ICC VC++
diff --git a/libs/align/Makefile b/libs/align/Makefile
deleted file mode 100644
index d2c1d2b..0000000
--- a/libs/align/Makefile
+++ /dev/null
@@ -1,173 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/align
-
-INT_LIBS = \
-	libncbi-bam \
-	libalign-writer \
-	libalign-access \
-	libalign-reader
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# libncbi-bam
-#
-$(ILIBDIR)/libncbi-bam: $(addprefix $(ILIBDIR)/libncbi-bam.,$(ILIBEXT))
-
-BAM_SRC = \
-	bam
-
-BAM_OBJ = \
-	$(addsuffix .$(LOBX),$(BAM_SRC))
-
-BAM_LIB = \
-	-lvfs \
-	-lkfs \
-	-lklib \
-	-lz
-
-$(ILIBDIR)/libncbi-bam.$(LIBX): $(BAM_OBJ)
-	$(LD) --slib -o $@ $^ $(BAM_LIB)
-
-
-#-------------------------------------------------------------------------------
-# align-access
-#
-$(ILIBDIR)/libalign-access: $(addprefix $(ILIBDIR)/libalign-access.,$(ILIBEXT))
-
-ALIGN_ACCESS_SRC = \
-	align-access
-
-ALIGN_ACCESS_OBJ = \
-	$(addsuffix .$(LOBX),$(ALIGN_ACCESS_SRC))
-
-ALIGN_ACCESS_LIB = \
-	-sncbi-bam \
-	-lvfs \
-	-lkfs \
-	-dkproc \
-	-lklib \
-	-lz
-
-$(ILIBDIR)/libalign-access.$(LIBX): $(ALIGN_ACCESS_OBJ)
-	$(LD) --slib -o $@ $^ $(ALIGN_ACCESS_LIB)
-
-#-------------------------------------------------------------------------------
-# align-reader
-#
-$(ILIBDIR)/libalign-reader: $(addprefix $(ILIBDIR)/libalign-reader.,$(ILIBEXT))
-
-ALIGN_READER_SRC = \
-	align_mgr \
-	al_iterator \
-	ref_iterator \
-	pl_iterator \
-	dna-reverse-cmpl \
-	reference-cmn \
-	reader-cmn \
-	reader-refseq \
-	reference \
-	refseq-mgr \
-	quality-quantizer
-
-ALIGN_READER_OBJ = \
-	$(addsuffix .$(LOBX),$(ALIGN_READER_SRC))
-
-ALIGN_READER_LIB = \
-	-lvdb \
-	-lkdb \
-	-lkfg \
-	-lkfs \
-	-lklib \
-	-lz
-
-$(ILIBDIR)/libalign-reader.$(LIBX): $(ALIGN_READER_OBJ)
-	$(LD) --slib -o $@ $^ $(ALIGN_READER_LIB)
-
-#-------------------------------------------------------------------------------
-# align-writer
-#
-$(ILIBDIR)/libalign-writer: $(addprefix $(ILIBDIR)/libalign-writer.,$(LIBX))
-
-ALIGN_WRITER_SRC = \
-    dna-reverse-cmpl \
-	reader-cmn \
-	reference-cmn \
-	reader-refseq \
-	refseq-mgr \
-	writer-cmn \
-	writer-refseq \
-	writer-alignment \
-	writer-sequence \
-	writer-ref \
-	writer-reference
-
-ALIGN_WRITER_OBJ = \
-	$(addsuffix .$(LOBX),$(ALIGN_WRITER_SRC))
-
-ALIGN_WRITER_LIB = \
-	-lwvdb \
-	-lwkdb \
-	-lkfg \
-	-lkfs \
-	-lklib \
-	-lz
-
-$(ILIBDIR)/libalign-writer.$(LIBX): $(ALIGN_WRITER_OBJ)
-	$(LD) --slib -o $@ $^ $(ALIGN_WRITER_LIB)
diff --git a/libs/align/al_iterator.c b/libs/align/al_iterator.c
deleted file mode 100644
index e53fc27..0000000
--- a/libs/align/al_iterator.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <insdc/insdc.h>
-#include <align/iterator.h>
-#include <align/manager.h>
-#include <vdb/cursor.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#define COL_READ "READ"
-#define COL_HAS_MISMATCH "HAS_MISMATCH"
-#define COL_HAS_REF_OFFSET "HAS_REF_OFFSET"
-#define COL_REF_OFFSET "REF_OFFSET"
-
-typedef struct pos_offset
-{
-    uint32_t pos;
-    int32_t offset;
-} pos_offset;
-
-
-struct AlignmentIterator
-{
-    struct AlignMgr const *amgr;   /* the alignment-manager... */
-
-    /* data to walk */
-    bool * has_mismatch;    /* copy of HAS_MISMATCH */
-    INSDC_4na_bin * read;   /* copy of READ */
-    uint32_t read_len;      /* length of READ */
-    uint32_t ref_len;       /* length of projection on reference */
-
-    INSDC_coord_zero ref_window_start;  /* where the requested window on the reference starts */
-    INSDC_coord_len  ref_window_len;    /* how long the requested window on the reference is */
-
-    pos_offset * pos_ofs;   /* computed by walking HAS_REF_OFFSET, REF_OFFSET ( method 1 ) */
-    uint32_t pos_ofs_idx;   /* current index into pos_ofs[] */
-    uint32_t pos_ofs_cnt;   /* how many pos_ofs-values are there */
-
-    int32_t abs_ref_start;  /* absolute reference-related start-position   */
-    int32_t rel_ref_pos;    /* relative reference-related position ( relative to start of sequence )  */
-    uint32_t seq_pos;       /* position on the sequence, as the reference sees it */
-    uint32_t skip;          /* how many bases to skip if we are in DELETE */
-    uint32_t flags;         /* flags it, when we are in INSERT/DELETE */
-    uint32_t inserts;       /* how many inserts */
-
-    KRefcount refcount;
-    bool free_on_whack;     /* true if allocated and allowing references */
-    uint8_t align [ 3 ];
-};
-
-
-/* forward decl. for private helper functions */
-static rc_t compute_posofs(  AlignmentIterator * self,
-    const bool * has_ref_offset,
-    const int32_t * ref_offset,
-    uint32_t ref_offset_len );
-
-static void al_iter_adjust_next( AlignmentIterator * self );
-
-LIB_EXPORT void CC AlignIteratorRecordDestroy ( void *obj, void *data )
-{
-    /* nothing to do, because there are no sub-allocations etc. ... */
-}
-
-
-static rc_t get_idx_and_read( struct VCursor const *curs,
-                              const char * name,
-                              int64_t row_id,
-                              const void ** base,
-                              uint32_t * len )
-{
-    uint32_t column_idx;
-    rc_t rc = VCursorGetColumnIdx ( curs, &column_idx, name );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "VCursorGetColumnIdx() failed" );
-    else
-    {
-        uint32_t elem_bits, boff, len_intern;
-        const void * ptr;
-        rc = VCursorCellDataDirect ( curs, row_id, column_idx, 
-                                     &elem_bits, &ptr, &boff, &len_intern );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "VCursorCellDataDirect() failed" );
-        else
-        {
-            assert( boff == 0 );
-            if ( len != NULL ) *len = len_intern;
-            if ( base != NULL ) *base = ptr;
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignIteratorRecordPopulate ( void *obj,
-    const PlacementRecord *placement, struct VCursor const *curs, 
-    INSDC_coord_zero ref_window_start, INSDC_coord_len ref_window_len, void *data )
-{
-    /* read the data required to build a Alignment-Iterator,
-       then create the Alignment-Iterator into the already allocated memory */
-    const void * base;
-    const void * base_has_ref_offset;
-    const void * base_ref_offset;
-
-    INSDC_coord_len data_len;
-    uint32_t ref_offset_len;
-    rc_t rc;
-
-    AlignmentIterator *iter = ( AlignmentIterator * ) obj;
-    AlignMgr *almgr = ( AlignMgr * ) data;
-
-    uint8_t * ptr = ( void* ) iter;
-    ptr += ( sizeof *iter );
-
-    rc = get_idx_and_read( curs, COL_HAS_MISMATCH, placement->id, &base, &data_len );
-    if ( rc == 0 )
-    {
-        /* copy HAS_MISMATCH into place, point the header-value to it, advance */
-        memcpy( ptr, base, data_len );
-        iter->has_mismatch = (bool *)ptr;
-        ptr += data_len;
-    }
-
-    if ( rc == 0 )
-    {
-        rc = get_idx_and_read( curs, COL_READ, placement->id, &base, &data_len );
-        /* copy READ into place, point the header-value to it, advance */
-        if ( rc == 0 )
-        {
-            memcpy( ptr, base, data_len );
-            iter->read = ( INSDC_4na_bin * )ptr;
-            iter->read_len = data_len;
-            iter->abs_ref_start = placement->pos;
-            iter->ref_len = placement->len;
-            iter->rel_ref_pos = 0;
-            iter->seq_pos = 0;
-            ptr += data_len;
-            iter->pos_ofs = (pos_offset *)ptr;
-            iter->ref_window_start = ref_window_start;
-            iter->ref_window_len = ref_window_len;
-            iter->free_on_whack = false;
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = get_idx_and_read( curs, COL_HAS_REF_OFFSET, placement->id, &base_has_ref_offset, &data_len );
-    }
-    if ( rc == 0 )
-    {
-        rc = get_idx_and_read( curs, COL_REF_OFFSET, placement->id, &base_ref_offset, &ref_offset_len );
-    }
-    if ( rc == 0 )
-    {
-        rc = compute_posofs( iter,
-                             ( const bool * )base_has_ref_offset, 
-                             ( const int32_t * )base_ref_offset, 
-                             ref_offset_len );
-    }
-    if ( rc == 0 )
-    {
-        if ( iter->pos_ofs_idx == 0 )
-            al_iter_adjust_next( iter );
-        KRefcountInit( &iter->refcount, 1, "AlignmentIterator", "Make", "align" );
-        data_len = 0;
-        while( ( iter->abs_ref_start + iter->rel_ref_pos ) < ref_window_start && rc == 0 )
-        {
-            rc = AlignmentIteratorNext ( iter );
-            data_len++;
-        }
-    }
-    if ( rc == 0 )  {   rc = AlignMgrAddRef ( almgr );  }
-    if ( rc == 0 )  {   iter->amgr = almgr;  }
-
-/*
-    if ( rc == 0 )
-    {
-        OUTMSG(( "placement[%lu] at %u (w=%u) next(%u) \n", 
-                 placement->id, iter->abs_ref_start, ref_window_start, data_len ));
-    }
-*/
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignIteratorRecordSize ( struct VCursor const *curs, int64_t row_id, size_t *size, void *data )
-{
-    uint32_t ref_offset_len, read_len;
-
-    rc_t rc = get_idx_and_read( curs, COL_REF_OFFSET, row_id, NULL, &ref_offset_len );
-    if ( rc == 0 )
-        rc = get_idx_and_read( curs, COL_READ, row_id, NULL, &read_len );
-
-    if ( rc == 0 )
-    {
-        AlignmentIterator * ali = NULL;
-        size_t po_size = ( ( sizeof *(ali->pos_ofs) ) * ( ref_offset_len ) );
-        *size = ( ( sizeof *ali ) + ( read_len * 2 ) + po_size );
-    }
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignMgrMakeAlignmentIterator ( struct AlignMgr const *self,
-    AlignmentIterator **iter,
-    bool copy,
-    INSDC_coord_zero ref_pos,
-    INSDC_coord_len ref_len,
-    const INSDC_4na_bin *read,
-    INSDC_coord_len read_len,
-    const bool *has_mismatch,
-    const bool *has_ref_offset,
-    const int32_t *ref_offset,
-    uint32_t ref_offset_len,
-    INSDC_coord_zero ref_window_start,
-    INSDC_coord_len ref_window_len )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( iter == NULL || has_mismatch == NULL || has_ref_offset == NULL ||
-             read == NULL || read_len == 0 )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            AlignmentIterator * ali = NULL;
-            size_t po_size = ( ( sizeof *(ali->pos_ofs) ) * ( ref_offset_len ) );
-            size_t full_size = ( sizeof *ali ) + ( read_len * 2 ) + po_size;
-      
-            uint8_t * ptr = calloc( full_size, 1 );
-            *iter = NULL;
-            if ( ptr == NULL )
-                rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ali = ( AlignmentIterator * )ptr;
-                ptr += ( sizeof *ali );
-
-                KRefcountInit( &ali->refcount, 1, "AlignmentIterator", "Make", "align" );
-
-                /* copy HAS_MISMATCH into place, point the header-value to it, advance */
-                memcpy( ptr, has_mismatch, read_len );
-                ali->has_mismatch = (bool *)ptr;
-                ptr += read_len;
-
-                /* copy READ into place, point the header-value to it, advance */
-                memcpy( ptr, read, read_len );
-                ali->read = ( INSDC_4na_bin * )ptr;
-                ptr += read_len;
-
-                ali->read_len = read_len;
-                ali->ref_len = ref_len;
-                ali->abs_ref_start = ref_pos;
-                ali->pos_ofs = (pos_offset *)ptr;
-                ali->ref_window_start = ref_window_start;
-                ali->ref_window_len = ref_window_len;
-                ali->free_on_whack = true;
-
-                rc = compute_posofs( ali, has_ref_offset, ref_offset, ref_offset_len );
-                if ( ali->pos_ofs_idx == 0 )
-                    al_iter_adjust_next( ali );
-
-                if ( rc == 0 )
-                {
-                    rc = AlignMgrAddRef ( self );
-                    if ( rc == 0 )
-                        ali->amgr = self;
-                }
-            }
-
-            if ( rc == 0 )
-                *iter = ali;
-            else
-                free( ali );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignmentIteratorAddRef( const AlignmentIterator * cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcAttaching, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountAdd( &cself->refcount, "AlignmentIterator" ) != krefOkay )
-        {
-            rc = RC( rcAlign, rcIterator, rcAttaching, rcError, rcUnexpected );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignmentIteratorRelease( const AlignmentIterator * cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountDrop( &cself->refcount, "AlignmentIterator" ) == krefWhack )
-        {
-            AlignmentIterator * self = ( AlignmentIterator * ) cself;
-            AlignMgrRelease ( self->amgr );
-            if ( self->free_on_whack )
-                free( self );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignmentIteratorNext ( AlignmentIterator *self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcPositioning, rcSelf, rcNull );
-    else
-    {
-        self->flags = 0;
-        self->rel_ref_pos++;
-
-        if ( self->rel_ref_pos >= self->ref_len )
-            rc = SILENT_RC( rcAlign, rcIterator, rcPositioning, rcItem, rcDone );
-        else
-        {
-            if ( self->skip > 0 )
-            {
-                self->flags |=  align_iter_skip;
-                self->skip--;
-            }
-            else if ( self->inserts > 0 )
-            {
-                self->seq_pos += ( self->inserts + 1 );
-                self->inserts = 0;
-            }
-            else
-            {
-                self->seq_pos++;
-            }
-            al_iter_adjust_next( self );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT int32_t CC AlignmentIteratorState ( const AlignmentIterator *self,
-                                               INSDC_coord_zero *seq_pos )
-{
-    uint32_t res = align_iter_invalid;
-    if ( self != NULL )
-    {
-        INSDC_coord_zero pos = self->seq_pos;
-        if ( pos < self->read_len )
-        {
-            res = ( self->read[ pos ] & 0x0F );
-
-            if ( self->rel_ref_pos < 1 )
-                res |= align_iter_first;
-
-            if ( self->rel_ref_pos == ( self->ref_len - 1 ) )
-                res |= align_iter_last;
-
-            if ( !self->has_mismatch[ pos ] )
-                res |= align_iter_match;
-
-            res |= self->flags;
-
-            if ( seq_pos != NULL )
-                *seq_pos = pos;
-        }
-    }
-    return res;
-}
-
-
-LIB_EXPORT rc_t CC AlignmentIteratorPosition ( const AlignmentIterator *self,
-                                               INSDC_coord_zero *pos )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcPositioning, rcSelf, rcNull );
-    else
-    {
-        if ( pos == NULL )
-            rc = RC( rcAlign, rcIterator, rcPositioning, rcParam, rcNull );
-        else
-        {
-            *pos = ( self->abs_ref_start + self->rel_ref_pos );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT uint32_t CC AlignmentIteratorBasesInserted
-    ( const AlignmentIterator *self, const INSDC_4na_bin **bases )
-{
-    uint32_t res = 0;
-    if ( ( self != NULL )&&( bases != NULL ) )
-    {
-        res = self->inserts;
-        *bases = &( self->read[ self->seq_pos + 1 ] );
-    }
-    return res;
-}
-
-
-LIB_EXPORT uint32_t CC AlignmentIteratorBasesDeleted
-    ( const AlignmentIterator *self, INSDC_coord_zero *pos )
-{
-    uint32_t res = 0;
-    if ( ( self != NULL )&&( pos != NULL ) )
-    {
-        res = ( self->skip );
-        *pos = ( self->abs_ref_start + self->rel_ref_pos + 1 ); 
-    }
-    return res;
-}
-
-
-/* ============ private static functions ============ */
-static rc_t compute_posofs(  AlignmentIterator * self,
-    const bool * has_ref_offset, const int32_t * ref_offset, uint32_t ref_offset_len )
-{
-    rc_t rc = 0;
-
-    self->pos_ofs_idx = 0;
-    self->pos_ofs_cnt = ref_offset_len;
-    if ( ref_offset_len > 0 )
-    {
-        int32_t shift = 0;
-        uint32_t seq_position;
-        uint32_t src = 0;
-        uint32_t dst = 0;
-
-        if ( has_ref_offset[ 0 ] && ( ref_offset[ 0 ] < 0 ) )
-        {
-            shift = ref_offset[ src++ ];
-            self->seq_pos = -( shift );
-            self->pos_ofs_cnt--;
-        }
-
-        seq_position = self->seq_pos;
-        while( seq_position < self->read_len && rc == 0 )
-        {
-            if ( has_ref_offset[ seq_position ] )
-            {
-                /* we do have to process a reference-offset ! */
-                if ( src < ref_offset_len )
-                {
-                    /* we do have a ref-offset value available... */
-                    int32_t ro = ref_offset[ src++ ];
-                    if ( ro == 0 )
-                    {
-                        /* zero-values in REF_OFFSET are an error ! */
-                        rc = RC( rcAlign, rcIterator, rcConstructing, rcItem, rcNull );
-                    }
-                    else
-                    {
-                        /* ref-offset is positive: DELETE against the reference */
-                        self->pos_ofs[ dst ].pos = ( seq_position + shift - 1 );
-                        self->pos_ofs[ dst++ ].offset = ro;
-                        shift += ro;
-
-                        /* !!! CHANGE on May 04 2012 !!!
-                           the unused bits in has_ref_offset after an insert ( negative ro )
-                           are used now to hint the position of a "B"-cigar-string-case
-                           for cSRA-files created Complete-Genomic-Submissions
-                           that means we have to jump forward with seq_position in this case!
-                        */
-                        if ( ro < 0 )
-                        {
-                            seq_position -= ( ro + 1 );
-                        }
-                    }
-                }
-                else
-                {
-                    /* if has_ref_offset has more flags than ref_offset has values... */
-                    rc = RC( rcAlign, rcIterator, rcConstructing, rcItem, rcTooBig );
-                }
-            }
-            ++seq_position;
-        }
-
-/*      OUTMSG(( "pos_ofs:" ));
-        for ( src = 0; src < self->pos_ofs_cnt; ++src )
-        {
-            OUTMSG(( "[%u/%u]", self->pos_ofs[ src ].pos, self->pos_ofs[ src ].offset ));
-        }
-        OUTMSG(( "\n" )); */
-    }
-    return rc;
-}
-
-
-static void al_iter_adjust_next( AlignmentIterator * self )
-{
-    if ( self->pos_ofs_idx < self->pos_ofs_cnt )
-    {
-        if ( self->rel_ref_pos == self->pos_ofs[ self->pos_ofs_idx ].pos )
-        {
-            /* we have to adjust... */
-            int32_t ro = self->pos_ofs[ self->pos_ofs_idx++ ].offset;
-            if ( ro < 0 )
-            {
-                self->flags |= align_iter_insert;
-                self->inserts = (-ro);
-            }
-            else
-            {
-                self->flags |= align_iter_delete;
-                self->skip = ro;
-            }
-        }
-    }
-}
diff --git a/libs/align/align-access.c b/libs/align/align-access.c
deleted file mode 100644
index 7518d53..0000000
--- a/libs/align/align-access.c
+++ /dev/null
@@ -1,788 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <align/extern.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <align/align-access.h>
-#include <atomic32.h>
-
-#include <vfs/path.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "bam-priv.h"
-
-struct AlignAccessMgr
-{
-    atomic32_t refcount;
-};
-
-LIB_EXPORT rc_t CC AlignAccessMgrMake(const AlignAccessMgr **mgr) {
-    AlignAccessMgr *self = malloc(sizeof(*self));
-
-    *mgr = self;
-    if (self != NULL) {
-        atomic32_set(&self->refcount, 1);
-        return 0;
-    }
-    return RC(rcAlign, rcMgr, rcConstructing, rcMemory, rcExhausted);
-}
-
-LIB_EXPORT rc_t CC AlignAccessMgrAddRef( const AlignAccessMgr *self ) {
-    if (self != NULL)
-        atomic32_inc(&((AlignAccessMgr *)self)->refcount);
-    return 0;
-}
-
-static
-rc_t CC AlignAccessMgrWhack(AlignAccessMgr *self) {
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessMgrRelease(const AlignAccessMgr *cself) {
-    rc_t rc = 0;
-    AlignAccessMgr *self = (AlignAccessMgr *)cself;
-    
-    if (cself != NULL) {
-        if (atomic32_dec_and_test(&self->refcount)) {
-            rc = AlignAccessMgrWhack(self);
-            if (rc)
-                atomic32_set(&self->refcount, 1);
-            else
-                free(self);
-        }
-    }
-    return rc;
-}
-
-struct AlignAccessDB {
-    atomic32_t refcount;
-    const AlignAccessMgr *mgr;
-    const BAMFile *innerSelf;
-};
-
-LIB_EXPORT rc_t CC AlignAccessMgrMakeBAMDB(const AlignAccessMgr *self, const AlignAccessDB **db, const VPath *bam) {
-    AlignAccessDB *lhs = malloc(sizeof(*lhs));
-    rc_t rc;
-
-    if (lhs == NULL)
-        return RC(rcAlign, rcMgr, rcConstructing, rcMemory, rcExhausted);
-    
-    rc = BAMFileMakeWithVPath(&lhs->innerSelf, bam);
-    if (rc) {
-        free(lhs);
-        return rc;
-    }
-    lhs->mgr = self;
-    AlignAccessMgrAddRef(lhs->mgr);
-    atomic32_set(&lhs->refcount, 1);
-    
-    *db = lhs;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessMgrMakeIndexBAMDB(const AlignAccessMgr *self, const AlignAccessDB **db, const VPath *bam, const VPath *bam_index) {
-    rc_t rc = AlignAccessMgrMakeBAMDB(self, db, bam);
-    if (rc == 0) {
-        rc = BAMFileOpenIndexWithVPath((**db).innerSelf, bam_index);
-        if (rc == 0)
-            return 0;
-        AlignAccessDBRelease(*db);
-        *db = NULL;
-    }
-    return rc;
-}
-
-
-/* ExportBAMFile
- *  export the BAMFile object in use by the AlignAccessDB, if any
- *  must be released via BAMFileRelease
- */
-LIB_EXPORT rc_t CC AlignAccessDBExportBAMFile ( const AlignAccessDB *self, const BAMFile **result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcAlign, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcAlign, rcTable, rcAccessing, rcSelf, rcNull );
-        else if ( self -> innerSelf == NULL )
-            rc = RC ( rcAlign, rcTable, rcAccessing, rcType, rcIncorrect );
-        else
-        {
-            rc = BAMFileAddRef ( * result = self -> innerSelf );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * result = NULL;
-    }
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignAccessDBAddRef(const AlignAccessDB *cself) {
-    if (cself != NULL)
-        atomic32_inc(&((AlignAccessDB *)cself)->refcount);
-    return 0;
-}
-
-static rc_t CC AlignAccessDBWhack(AlignAccessDB *self) {
-    rc_t rc;
-    
-    rc = BAMFileRelease(self->innerSelf);
-    if (rc)
-        return rc;
-    return AlignAccessMgrRelease(self->mgr);
-}
-
-LIB_EXPORT rc_t CC AlignAccessDBRelease(const AlignAccessDB *cself) {
-    rc_t rc = 0;
-    AlignAccessDB *self = (AlignAccessDB *)cself;
-    
-    if (cself != NULL) {
-        if (atomic32_dec_and_test(&self->refcount)) {
-            rc = AlignAccessDBWhack(self);
-            if (rc)
-                atomic32_set(&self->refcount, 1);
-            else
-                free(self);
-        }
-    }
-    return rc;
-}
-
-struct AlignAccessRefSeqEnumerator {
-    atomic32_t refcount;
-    const AlignAccessDB *parent;
-    int cur, end;
-};
-
-LIB_EXPORT rc_t CC AlignAccessDBEnumerateRefSequences(const AlignAccessDB *self, AlignAccessRefSeqEnumerator **refseq_enum) {
-    AlignAccessRefSeqEnumerator *lhs;
-    unsigned cur = 0;
-    unsigned end;
-    
-    BAMFileGetRefSeqCount(self->innerSelf, &end);
-    if (BAMFileIsIndexed(self->innerSelf)) {
-        while (cur != end && BAMFileIndexHasRefSeqId(self->innerSelf, cur) == 0)
-            ++cur;
-        if (cur == end)
-            return RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-    }
-    lhs = malloc(sizeof(*lhs));
-    *refseq_enum = lhs;
-    if (lhs != NULL) {
-        lhs->parent = self;
-        AlignAccessDBAddRef(lhs->parent);
-        lhs->cur = cur;
-        lhs->end = end;
-        atomic32_set(&lhs->refcount, 1);
-        return 0;
-    }
-    return RC(rcAlign, rcDatabase, rcConstructing, rcMemory, rcExhausted);
-}
-
-LIB_EXPORT rc_t CC AlignAccessRefSeqEnumeratorAddRef(const AlignAccessRefSeqEnumerator *self) {
-    if (self != NULL)
-        atomic32_inc(&((AlignAccessRefSeqEnumerator *)self)->refcount);
-    return 0;
-}
-
-static
-rc_t CC AlignAccessRefSeqEnumeratorWhack(AlignAccessRefSeqEnumerator *self) {
-    return AlignAccessDBRelease(self->parent);
-}
-
-LIB_EXPORT rc_t CC AlignAccessRefSeqEnumeratorRelease(const AlignAccessRefSeqEnumerator *cself) {
-    rc_t rc = 0;
-    AlignAccessRefSeqEnumerator *self = (AlignAccessRefSeqEnumerator *)cself;
-    
-    if (cself != NULL) {
-        if (atomic32_dec_and_test(&self->refcount)) {
-            rc = AlignAccessRefSeqEnumeratorWhack(self);
-            if (rc)
-                atomic32_set(&self->refcount, 1);
-            else
-                free(self);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AlignAccessRefSeqEnumeratorGetID(const AlignAccessRefSeqEnumerator *cself, char *id_buffer, size_t buffer_size, size_t *id_size) {
-    rc_t rc = 0;
-    const BAMRefSeq *cur;
-    size_t id_act_size;
-    
-    if (cself == NULL)
-        return 0;
-    if (id_buffer == NULL && id_size == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    rc = BAMFileGetRefSeq(cself->parent->innerSelf, cself->cur, &cur);
-    if (rc)
-        return rc;
-    id_act_size = string_size( cur->name ) + 1;
-    if (id_size != NULL)
-        *id_size = id_act_size;
-    if (id_buffer != NULL) {
-        if (buffer_size >= id_act_size)
-            memcpy(id_buffer, cur->name, id_act_size);
-        else
-            rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignAccessRefSeqEnumeratorGetLength ( const AlignAccessRefSeqEnumerator *cself,
-                                           uint64_t *length )
-{
-    rc_t rc = 0;
-    const BAMRefSeq *cur;
-    
-    if (cself == NULL)
-        return 0;
-    if (length == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    rc = BAMFileGetRefSeq(cself->parent->innerSelf, cself->cur, &cur);
-    if (rc)
-        return rc;
-    *length = cur->length;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessRefSeqEnumeratorNext(const AlignAccessRefSeqEnumerator *cself) {
-    AlignAccessRefSeqEnumerator *self = (AlignAccessRefSeqEnumerator *)cself;
-    
-    if (cself->cur + 1 >= cself->end)
-        return RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-    
-    ++self->cur;
-    if (!BAMFileIsIndexed(cself->parent->innerSelf))
-    	return 0;
-	if (BAMFileIndexHasRefSeqId(cself->parent->innerSelf, cself->cur))
-		return 0;
-	return AlignAccessRefSeqEnumeratorNext(cself);
-}
-
-struct AlignAccessAlignmentEnumerator {
-    const AlignAccessDB *parent;
-    const BAMAlignment *innerSelf;
-    uint64_t endpos;
-    uint64_t startpos;
-    BAMFilePosition pos;
-    atomic32_t refcount;
-    int atend;
-    int refSeqID;
-};
-
-static rc_t CC AlignAccessDBMakeEnumerator(const AlignAccessDB *self, AlignAccessAlignmentEnumerator **align_enum) {
-    AlignAccessAlignmentEnumerator *lhs = malloc(sizeof(*lhs));
-    
-    *align_enum = lhs;
-    if (lhs == NULL)
-        return RC(rcAlign, rcTable, rcConstructing, rcMemory, rcExhausted);
-    
-    lhs->innerSelf = NULL;
-    lhs->parent = self;
-    AlignAccessDBAddRef(lhs->parent);
-    atomic32_set(&lhs->refcount, 1);
-    lhs->atend = 0;
-    lhs->refSeqID = -1;
-    lhs->endpos = 0;
-    lhs->startpos = 0;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessDBEnumerateAlignments(const AlignAccessDB *self, AlignAccessAlignmentEnumerator **align_enum) {
-    rc_t rc;
-    
-    *align_enum = NULL;
-
-    rc = BAMFileRewind(self->innerSelf);
-    if (rc)
-        return rc;
-    rc = AlignAccessDBMakeEnumerator(self, align_enum);
-    if (rc)
-        return rc;
-    return AlignAccessAlignmentEnumeratorNext(*align_enum);
-}
-
-LIB_EXPORT rc_t CC AlignAccessDBWindowedAlignments(
-                                     const AlignAccessDB *self,
-                                     AlignAccessAlignmentEnumerator **align_enum,
-                                     const char *refSeqName, uint64_t pos, uint64_t wsize
-) {
-    AlignAccessAlignmentEnumerator *lhs;
-    unsigned i, n;
-    const BAMRefSeq *rs;
-    uint64_t endpos = pos + wsize;
-    rc_t rc;
-    
-    *align_enum = NULL;
-
-    BAMFileGetRefSeqCount(self->innerSelf, &n);
-    for (i = 0; i != n; ++i) {
-        BAMFileGetRefSeq(self->innerSelf, i, &rs);
-        if (strcmp(refSeqName, rs->name) == 0)
-            break;
-    }
-    if (i == n || pos >= rs->length) {
-        return RC(rcAlign, rcTable, rcConstructing, rcParam, rcInvalid);
-    }
-
-    if (wsize == 0 || endpos > rs->length)
-        endpos = rs->length;
-
-    rc = BAMFileSeek(self->innerSelf, i, pos, endpos);
-    if (rc)
-        return rc;
-    
-    rc = AlignAccessDBMakeEnumerator(self, &lhs);
-    if (rc)
-        return rc;
-
-    lhs->refSeqID = i;
-    lhs->endpos = endpos;
-    lhs->startpos = pos;
-
-    *align_enum = lhs;
-    return AlignAccessAlignmentEnumeratorNext(*align_enum);
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorNext(const AlignAccessAlignmentEnumerator *cself) {
-    rc_t rc;
-    AlignAccessAlignmentEnumerator *self = (AlignAccessAlignmentEnumerator *)cself;
-    int32_t refSeqID;
-
-AGAIN:
-    if (self->innerSelf != NULL) {
-        BAMAlignmentRelease(self->innerSelf);
-        self->innerSelf = NULL;
-    }
-    if (self->atend != 0)
-        return RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-    
-    BAMFileGetPosition(self->parent->innerSelf, &self->pos);
-    rc = BAMFileRead(self->parent->innerSelf, &self->innerSelf);
-    if (rc) {
-        if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
-            self->atend = 1;
-            rc = RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-        }
-        return rc;
-    }
-    if (self->refSeqID == -1)
-        return 0;
-    
-    BAMAlignmentGetRefSeqId(self->innerSelf, &refSeqID);
-    if (self->refSeqID != refSeqID) {
-        self->atend = 1;
-        rc = RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-    }
-    if (self->endpos != 0) {
-        int64_t pos;
-        uint32_t length;
-        uint64_t endpos;
-        
-        BAMAlignmentGetPosition2(self->innerSelf, &pos, &length);
-        if (pos < 0 || pos >= (int64_t)self->endpos) {
-            self->atend = 1;
-            return RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound);
-        }
-        endpos = (uint64_t)pos + length;
-        if (endpos <= self->startpos)
-            goto AGAIN;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorAddRef ( const AlignAccessAlignmentEnumerator *self ) {
-    if (self != NULL)
-        atomic32_inc(&((AlignAccessAlignmentEnumerator *)self)->refcount);
-    return 0;
-}
-
-static
-rc_t CC AlignAccessAlignmentEnumeratorWhack(AlignAccessAlignmentEnumerator *self) {
-    if (self->innerSelf)
-        BAMAlignmentRelease(self->innerSelf);
-    AlignAccessDBRelease(self->parent);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorRelease ( const AlignAccessAlignmentEnumerator *cself ) {
-    rc_t rc = 0;
-    AlignAccessAlignmentEnumerator *self = (AlignAccessAlignmentEnumerator *)cself;
-    
-    if (cself != NULL) {
-        if (atomic32_dec_and_test(&self->refcount)) {
-            rc = AlignAccessAlignmentEnumeratorWhack(self);
-            if (rc)
-                atomic32_set(&self->refcount, 1);
-            else
-                free(self);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqID(
-                                               const AlignAccessAlignmentEnumerator *self,
-                                               char *id_buffer, size_t buffer_size, size_t *id_size
-) {
-    rc_t rc = 0;
-    int32_t id;
-    const BAMRefSeq *cur;
-    size_t id_act_size;
-    
-    if (self == NULL)
-        return 0;
-    if (id_buffer == NULL && id_size == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    rc = BAMAlignmentGetRefSeqId(self->innerSelf, &id);
-    if (rc)
-        return rc;
-    if (id < 0)
-        return RC(rcAlign, rcTable, rcAccessing, rcData, rcNotFound);
-    rc = BAMFileGetRefSeq(self->parent->innerSelf, id, &cur);
-    if (rc)
-        return rc;
-    id_act_size = string_size( cur->name ) + 1;
-    if (id_size != NULL)
-        *id_size = id_act_size;
-    if (id_buffer != NULL) {
-        if (buffer_size >= id_act_size)
-            memcpy(id_buffer, cur->name, id_act_size);
-        else
-            rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqPos(
-                                                const AlignAccessAlignmentEnumerator *self,
-                                                uint64_t *start_pos
-) {
-    rc_t rc;
-    int64_t pos;
-    
-    rc = BAMAlignmentGetPosition(self->innerSelf, &pos);
-    if (rc)
-        return rc;
-    if (pos < 0)
-        return RC(rcAlign, rcTable, rcAccessing, rcData, rcNotFound);
-
-    *start_pos = pos;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetMapQuality(
-                                                 const AlignAccessAlignmentEnumerator *self,
-                                                 uint8_t *score
-) {
-    uint8_t y = 0;
-    
-    if (self && self->innerSelf) {
-        uint16_t flags;
-    
-        BAMAlignmentGetFlags(self->innerSelf, &flags);
-        if ((flags & BAMFlags_SelfIsUnmapped) == 0)
-            BAMAlignmentGetMapQuality(self->innerSelf, &y);
-	}
-    if (score) *score = y;
-    
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqAccessionID(
-                                                        const AlignAccessAlignmentEnumerator *self,
-                                                        char *id_buffer, size_t buffer_size, size_t *id_size
-) {
-    rc_t rc;
-    size_t id_act_size;
-    const char *readGroupName;
-    
-    if (self == NULL)
-        return 0;
-    if (id_buffer == NULL && id_size == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    rc = BAMAlignmentGetReadGroupName(self->innerSelf, &readGroupName);
-    if (rc)
-        return rc;
-    if (readGroupName == 0)
-        *id_size = 0;
-    else {
-        id_act_size = string_size( readGroupName ) + 1;
-        if (id_size != NULL)
-            *id_size = id_act_size;
-        if (id_buffer != NULL) {
-            if (buffer_size >= id_act_size)
-                memcpy(id_buffer, readGroupName, id_act_size);
-            else
-                rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-        }
-    }
-    return rc;    
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqID(
-                                                 const AlignAccessAlignmentEnumerator *self,
-                                                 char *id_buffer, size_t buffer_size, size_t *id_size
-) {
-    rc_t rc;
-    size_t id_act_size;
-    const char *readName;
-    
-    if (self == NULL)
-        return 0;
-    if (id_buffer == NULL && id_size == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    rc = BAMAlignmentGetReadName(self->innerSelf, &readName);
-    if (rc)
-        return rc;
-
-    id_act_size = string_size( readName ) + 1;
-    if (id_size != NULL)
-        *id_size = id_act_size;
-    if (id_buffer != NULL) {
-        if (buffer_size >= id_act_size)
-            memcpy(id_buffer, readName, id_act_size);
-        else
-            rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-    }
-    return rc;    
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetCIGAR(
-    const AlignAccessAlignmentEnumerator *self,
-    uint64_t *start_pos, char *cigar_buffer, size_t buffer_size, size_t *cigar_size
-) {
-    int i;
-    unsigned n;
-    rc_t rc;
-    uint32_t sp = 0;
-    char *cigbuf = cigar_buffer;
-    const char *const endp = cigar_buffer + buffer_size;
-    
-    if (cigar_buffer == NULL && cigar_size == NULL) {
-        /* no result can be returned */
-        rc = RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    }
-    
-    rc = BAMAlignmentGetCigarCount(self->innerSelf, &n);
-    if (rc)
-        return rc;
-    if (n == 0) {
-        if (cigar_size != NULL)
-            *cigar_size = 0;
-        if (start_pos != NULL)
-            *start_pos = 0;
-        cigbuf[0] = 0;
-        return 0;
-    }
-    for (i = 0; i != n; ++i) {
-        char cig1[20];
-        BAMCigarType op;
-        uint32_t len;
-        int cig1len;
-        
-        BAMAlignmentGetCigar(self->innerSelf, i, &op, &len);
-        if (i == 0 && op == ct_SoftClip) {
-            sp = len;
-            continue;
-        }
-        if (i == 0 && op == ct_HardClip)
-            continue;
-        if (i == n - 1 && (op == ct_SoftClip || op == ct_HardClip))
-            continue;
-        
-        cig1len = sprintf(cig1, "%c%u", op, len);
-        if (cigbuf + cig1len < endp) {
-            if (cigar_buffer != NULL) {
-                memcpy(cigbuf, cig1, cig1len);
-                cigbuf[cig1len] = 0;
-            }
-        }
-        else
-            rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-        cigbuf += cig1len;
-    }
-    if (cigar_size != NULL)
-        *cigar_size = cigbuf - cigar_buffer + 1;
-    if (start_pos != NULL)
-        *start_pos = sp;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetShortSequence(
-                                                    const AlignAccessAlignmentEnumerator *self,
-                                                    char *seq_buffer, size_t buffer_size, size_t *seq_size
-) {
-    rc_t rc;
-    uint32_t act_size;
-
-    if (self == NULL)
-        return 0;
-    if (seq_buffer == NULL && seq_size == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    rc = BAMAlignmentGetReadLength(self->innerSelf, &act_size);
-    if (rc)
-        return rc;
-    
-    ++act_size;
-    if (seq_size != NULL)
-        *seq_size = act_size;
-    
-    if (seq_buffer != NULL) {
-        if (buffer_size >= act_size) {
-            rc = BAMAlignmentGetSequence(self->innerSelf, seq_buffer);
-            seq_buffer[act_size - 1] = 0;
-        }
-        else
-            rc = RC(rcAlign, rcTable, rcAccessing, rcBuffer, rcInsufficient);
-    }
-    return rc;    
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetStrandDirection(
-                                                      const AlignAccessAlignmentEnumerator *self,
-                                                      AlignmentStrandDirection *result
-) {
-    uint16_t flags;
-    rc_t rc;
-    
-    if (result == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-
-    *result = asd_Unknown;
-    if (self == NULL)
-        return 0;
-    
-    rc = BAMAlignmentGetFlags(self->innerSelf, &flags);
-    if (rc)
-        return rc;
-    
-    *result = ((flags & BAMFlags_SelfIsReverse) == BAMFlags_SelfIsReverse) ? asd_Reverse : asd_Forward;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetIsPaired(const AlignAccessAlignmentEnumerator *self,
-                                               bool *result)
-{
-    uint16_t flags;
-    rc_t rc;
-    
-    if (result == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    *result = asd_Unknown;
-    if (self == NULL)
-        return 0;
-    
-    rc = BAMAlignmentGetFlags(self->innerSelf, &flags);
-    if (rc)
-        return rc;
-    
-    *result = ((flags & BAMFlags_IsMappedAsPair) == 0) ? false : true;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetIsFirstInPair(const AlignAccessAlignmentEnumerator *self,
-                                                    bool *result)
-{
-    uint16_t flags;
-    rc_t rc;
-    
-    if (result == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    if (self == NULL)
-        return 0;
-    
-    rc = BAMAlignmentGetFlags(self->innerSelf, &flags);
-    if (rc)
-        return rc;
-    
-    *result = ((flags & BAMFlags_IsFirst) == 0) ? false : true;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetIsSecondInPair(const AlignAccessAlignmentEnumerator *self,
-                                                     bool *result)
-{
-    uint16_t flags;
-    rc_t rc;
-    
-    if (result == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    if (self == NULL)
-        return 0;
-    
-    rc = BAMAlignmentGetFlags(self->innerSelf, &flags);
-    if (rc)
-        return rc;
-    
-    *result = ((flags & BAMFlags_IsSecond) == 0) ? false : true;
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetRecordID(const AlignAccessAlignmentEnumerator *self, uint64_t *result)
-{
-    if (result == NULL)
-        return RC(rcAlign, rcTable, rcAccessing, rcParam, rcNull);
-    
-    if (self == NULL)
-        return 0;
-    
-    *(BAMFilePosition *)result = self->pos;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorGetBAMAlignment(const AlignAccessAlignmentEnumerator *self, const BAMAlignment **result)
-{
-    *result = self->innerSelf;
-    return BAMAlignmentAddRef(self->innerSelf);
-}
diff --git a/libs/align/align_mgr.c b/libs/align/align_mgr.c
deleted file mode 100644
index c700463..0000000
--- a/libs/align/align_mgr.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <insdc/insdc.h>
-#include <align/iterator.h>
-#include <align/manager.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-struct AlignMgr
-{
-    KRefcount refcount;
-    /* what else will be here ? */
-};
-
-
-LIB_EXPORT rc_t CC AlignMgrMakeRead ( const struct AlignMgr **self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        AlignMgr * alm = calloc( sizeof * alm, 1 );
-        if ( alm == NULL )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            KRefcountInit( &alm->refcount, 1, "AlignMgr", "Make", "align" );
-        }
-
-        if ( rc == 0 )
-            *self = alm;
-        else
-            free( alm );
-    }
-    return rc;
-
-}
-
-
-LIB_EXPORT rc_t CC AlignMgrAddRef ( const AlignMgr *self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAttaching, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountAdd( &self->refcount, "AlignMgr" ) != krefOkay )
-        {
-            rc = RC( rcAlign, rcIterator, rcAttaching, rcError, rcUnexpected );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC AlignMgrRelease ( const AlignMgr *cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountDrop( &cself->refcount, "AlignMgr" ) == krefWhack )
-        {
-            AlignMgr * self = ( AlignMgr * ) cself;
-            free( self );
-        }
-    }
-    return rc;
-
-}
diff --git a/libs/align/bam-priv.h b/libs/align/bam-priv.h
deleted file mode 100644
index 1b2d37c..0000000
--- a/libs/align/bam-priv.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_bam_priv_
-#define _h_bam_priv_
-
-#ifndef _h_align_bam_
-#include <align/bam.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Get the aligned position on the Ref. Seq.
- */
-rc_t BAMAlignmentGetNthPosition(const BAMAlignment *cself, uint32_t n, int64_t *pos);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_bam_priv_ */
diff --git a/libs/align/bam.c b/libs/align/bam.c
deleted file mode 100644
index 2a86445..0000000
--- a/libs/align/bam.c
+++ /dev/null
@@ -1,4237 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <align/extern.h>
-#include <klib/defs.h>
-#include <klib/debug.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfs/mmap.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-
-#include <atomic32.h>
-#include <strtol.h>
-
-#include <align/bam.h>
-#include "bam-priv.h"
-
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <kfs/kfs-priv.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#if 1
-/*_DEBUGGING*/
-#include <stdio.h>
-#endif
-
-#include <endian.h>
-#include <byteswap.h>
-
-#include <zlib.h>
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-static uint16_t LE2HUI16(void const *X) { uint16_t y; memcpy(&y, X, sizeof(y)); return y; }
-static uint32_t LE2HUI32(void const *X) { uint32_t y; memcpy(&y, X, sizeof(y)); return y; }
-static uint64_t LE2HUI64(void const *X) { uint64_t y; memcpy(&y, X, sizeof(y)); return y; }
-static  int16_t  LE2HI16(void const *X) {  int16_t y; memcpy(&y, X, sizeof(y)); return y; }
-static  int32_t  LE2HI32(void const *X) {  int32_t y; memcpy(&y, X, sizeof(y)); return y; }
-static  int64_t  LE2HI64(void const *X) {  int64_t y; memcpy(&y, X, sizeof(y)); return y; }
-#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
-static uint16_t LE2HUI16(void const *X) { uint16_t y; memcpy(&y, X, sizeof(y)); return (uint16_t)bswap_16(y); }
-static uint32_t LE2HUI32(void const *X) { uint32_t y; memcpy(&y, X, sizeof(y)); return (uint32_t)bswap_32(y); }
-static uint64_t LE2HUI64(void const *X) { uint64_t y; memcpy(&y, X, sizeof(y)); return (uint64_t)bswap_64(y); }
-static  int16_t  LE2HI16(void const *X) {  int16_t y; memcpy(&y, X, sizeof(y)); return ( int16_t)bswap_16(y); }
-static  int32_t  LE2HI32(void const *X) {  int32_t y; memcpy(&y, X, sizeof(y)); return ( int32_t)bswap_32(y); }
-static  int64_t  LE2HI64(void const *X) {  int64_t y; memcpy(&y, X, sizeof(y)); return ( int64_t)bswap_64(y); }
-#endif
-
-typedef struct BAMIndex BAMIndex;
-typedef struct BGZFile BGZFile;
-
-/* #pragma mark BGZFile *** Start *** */
-
-#define VALIDATE_BGZF_HEADER 1
-#if (ZLIB_VERNUM < 0x1230)
-#undef VALIDATE_BGZF_HEADER
-#warning "zlib too old, inflateGetHeader not available, not validating BGZF headers"
-#else
-#endif
-
-#define ZLIB_BLOCK_SIZE ( 64 * 1024 )
-typedef uint8_t zlib_block_t[ZLIB_BLOCK_SIZE];
-
-#define MEM_ALIGN_SIZE ( 64 * 1024 )
-/* MEM_CHUNK_SIZE must be an integer multiple of ZLIB_BLOCK_SIZE.
- * The multiple must be >= 2 shouldn't be < 3.
- */
-#define MEM_CHUNK_SIZE ( 256 * ZLIB_BLOCK_SIZE )
-#define CG_NUM_SEGS 4
-
-typedef struct BGZFile_vt_s {
-    rc_t (*FileRead)(void *, zlib_block_t, unsigned *);
-    uint64_t (*FileGetPos)(void const *);
-    float (*FileProPos)(void const *);
-    uint64_t (*FileGetSize)(void const *);
-    rc_t (*FileSetPos)(void *, uint64_t);
-    void (*FileWhack)(void *);
-} BGZFile_vt;
-
-struct BGZFile {
-    uint64_t fsize;
-    uint64_t fpos;  /* position in file of first byte in buffer */
-    const uint8_t *buf;   /* page aligned or memmapped */
-    const KFile *kfp;
-    uint8_t *_buf;  /* allocated */
-    unsigned malign;
-    size_t bcount;  /* number of valid bytes in buffer */
-    uint32_t bpos;  /* position in buffer of read head */
-    z_stream zs;
-};
-
-static
-rc_t BGZFileGetMoreBytes(BGZFile *self)
-{
-    rc_t rc;
-    
-    self->fpos += self->bpos;
-    self->bpos &= (MEM_ALIGN_SIZE - 1);
-    self->fpos -= self->bpos;
-
-    rc = KFileRead(self->kfp, self->fpos, self->_buf + self->malign,
-                   MEM_CHUNK_SIZE, &self->bcount);
-    if (rc) {
-        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("Error reading BAM file: %R\n", rc));
-        return rc;
-    }
-    if (self->bcount == 0 || self->bcount == self->bpos)
-        return RC(rcAlign, rcFile, rcReading, rcData, rcInsufficient);
-
-    self->zs.avail_in = (uInt)(self->bcount - self->bpos);
-    self->zs.next_in = (Bytef *)&self->buf[self->bpos];
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("Read %u bytes from BAM file at position %lu\n", self->zs.avail_in, self->fpos));
-    
-    return 0;
-}
-
-static
-rc_t BGZFileRead(BGZFile *self, zlib_block_t dst, unsigned *pNumRead)
-{
-#if VALIDATE_BGZF_HEADER
-    uint8_t extra[256];
-    gz_header head;
-#endif
-    rc_t rc = 0;
-    unsigned loops;
-    int zr;
-    
-    *pNumRead = 0;
-    if (self->bcount == 0 || self->zs.avail_in == 0) {
-        rc = BGZFileGetMoreBytes(self);
-        if (rc)
-            return rc;
-    }
-
-#if VALIDATE_BGZF_HEADER
-    memset(&head, 0, sizeof(head));
-    head.extra = extra;
-    head.extra_max = sizeof(extra);
-    
-    zr = inflateGetHeader(&self->zs, &head);
-    assert(zr == Z_OK);
-#endif
-    
-    self->zs.next_out = (Bytef *)dst;
-    self->zs.avail_out = sizeof(zlib_block_t);
-
-    for (loops = 0; loops != 2; ++loops) {
-        {
-            uLong const initial = self->zs.total_in;
-            
-            zr = inflate(&self->zs, Z_FINISH);
-            {
-                uLong const final = self->zs.total_in;
-                uLong const len = final - initial;
-                
-                self->bpos += len;
-            }
-        }
-        assert(self->zs.avail_in == self->bcount - self->bpos);
-        
-        switch (zr) {
-        case Z_OK:
-        case Z_BUF_ERROR:
-            rc = BGZFileGetMoreBytes(self);
-            if (rc) {
-                if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient) {
-                    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("EOF in Zlib block after %lu bytes\n", self->fpos + self->bpos));
-                    rc = RC(rcAlign, rcFile, rcReading, rcFile, rcTooShort);
-                }
-                return rc;
-            }
-            break;
-        case Z_STREAM_END:
-            DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("Zlib block size (before/after): %u/%u\n", self->zs.total_in, self->zs.total_out));
-#if VALIDATE_BGZF_HEADER
-            if (head.done) {
-                unsigned const extra_len = head.extra_len;
-                unsigned i;
-                unsigned bsize = 0;
-                
-                DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("GZIP Header extra length: %u\n", extra_len));
-                for (i = 0; i < extra_len; ) {
-                    uint8_t const si1 = extra[i + 0];
-                    uint8_t const si2 = extra[i + 1];
-                    unsigned const slen = LE2HUI16(&extra[i + 2]);
-                    
-                    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("GZIP Header extra: %c%c(%u)\n", si1, si2, slen));
-                    if (si1 == 'B' && si2 == 'C') {
-                        bsize = 1 + LE2HUI16(&extra[i + 4]);
-                        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("BGZF Header extra field BC: bsize %u\n", bsize));
-                        break;
-                    }
-                    i += slen + 4;
-                }
-                if (bsize == 0 || bsize != self->zs.total_in) {
-                    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("BGZF Header extra field BC not found\n"));
-                    rc = RC(rcAlign, rcFile, rcReading, rcFormat, rcInvalid); /* not BGZF */
-                }
-            }
-            else {
-                DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("GZIP Header not found\n"));
-                rc = RC(rcAlign, rcFile, rcReading, rcFile, rcCorrupt);
-            }
-#endif
-            *pNumRead = (unsigned)self->zs.total_out; /* <= 64k */
-            zr = inflateReset(&self->zs);
-            assert(zr == Z_OK);
-            return rc;
-        default:
-            DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("Unexpected Zlib result %i\n", zr));
-            return RC(rcAlign, rcFile, rcReading, rcFile, rcCorrupt);
-        }
-    }
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BGZF), ("Failed reading BAM file after %lu bytes\n", self->fpos + self->bpos));
-    return RC(rcAlign, rcFile, rcReading, rcFile, rcTooShort);
-}
-
-static uint64_t BGZFileGetPos(const BGZFile *self)
-{
-    return self->fpos + self->bpos;
-}
-
-/* returns the position as proportion of the whole file */ 
-static float BGZFileProPos(BGZFile const *const self)
-{
-    return BGZFileGetPos(self) / (double)self->fsize;
-}
-
-static rc_t BGZFileSetPos(BGZFile *const self, uint64_t const pos)
-{
-    unsigned const bpos = (unsigned)(pos - self->fpos); /* < 64k */
-    
-    if (self->fpos <= pos && pos < self->fpos + self->bcount) {
-        self->bpos = bpos;
-        self->zs.avail_in = (uInt)(self->bcount - bpos);
-        self->zs.next_in = (Bytef *)&self->buf[bpos];
-    }
-    else {
-        self->fpos = pos & ~((uint64_t)(MEM_ALIGN_SIZE - 1));
-        self->bpos = bpos;
-        self->bcount = 0; /* force re-read */
-    }
-
-    return 0;
-}
-
-typedef rc_t (*BGZFileWalkBlocks_cb)(void *ctx, const BGZFile *file,
-                                     rc_t rc, uint64_t fpos,
-                                     const zlib_block_t data, unsigned dsize);
-
-/* Without Decompression */
-static rc_t BGZFileWalkBlocksND(BGZFile *const self, BGZFileWalkBlocks_cb const cb, void *const ctx)
-{
-    rc_t rc = 0;
-#if VALIDATE_BGZF_HEADER
-    uint8_t extra[256];
-    char dummy[64];
-    gz_header head;
-    int zr;
-
-    memset(&head, 0, sizeof(head));
-    head.extra = extra;
-    head.extra_max = sizeof(extra);
-    
-    do {
-        unsigned loops;
-        unsigned hsize = 0;
-        unsigned bsize = 0;
-        unsigned bsize2;
-        uint64_t const fpos = self->fpos + self->bpos;
-        
-        self->zs.next_out = (Bytef *)dummy;
-        self->zs.avail_out = sizeof(dummy);
-        
-        zr = inflateGetHeader(&self->zs, &head);
-        assert(zr == Z_OK);
-        
-        for (loops = 0; loops != 2; ++loops) {
-            {
-                uLong const orig = self->zs.total_in;
-                
-                zr = inflate(&self->zs, Z_BLOCK);
-                {
-                    uLong const final = self->zs.total_in;
-                    uLong const bytes = final - orig;
-                    
-                    self->bpos += bytes;
-                    hsize += bytes;
-                }
-            }
-            if (head.done) {
-                unsigned i;
-                
-                for (i = 0; i < head.extra_len; ) {
-                    if (extra[i] == 'B' && extra[i + 1] == 'C') {
-                        bsize = 1 + LE2HUI16(&extra[i + 4]);
-                        break;
-                    }
-                    i += LE2HUI16(&extra[i + 2]);
-                }
-                break;
-            }
-            else if (self->zs.avail_in == 0) {
-                rc = BGZFileGetMoreBytes(self);
-                if (rc) {
-                    rc = RC(rcAlign, rcFile, rcReading, rcFile, rcTooShort);
-                    goto DONE;
-                }
-            }
-            else {
-                rc = RC(rcAlign, rcFile, rcReading, rcFile, rcCorrupt);
-                goto DONE;
-            }
-        }
-        if (bsize == 0) {
-            rc = RC(rcAlign, rcFile, rcReading, rcFormat, rcInvalid); /* not BGZF */
-            break;
-        }
-        bsize2 = bsize;
-        bsize -= hsize;
-        for ( ; ; ) {
-            unsigned const max = (unsigned)(self->bcount - self->bpos); /* <= 64k */
-            unsigned const len = bsize > max ? max : bsize;
-            
-            self->bpos += len;
-            bsize -= len;
-            if (self->bpos == self->bcount) {
-                rc = BGZFileGetMoreBytes(self);
-                if (rc) {
-                    if (bsize)
-                        rc = RC(rcAlign, rcFile, rcReading, rcFile, rcTooShort);
-                    goto DONE;
-                }
-            }
-            else {
-                zr = inflateReset(&self->zs);
-                assert(zr == Z_OK);
-                self->zs.avail_in = (uInt)(self->bcount - self->bpos);
-                self->zs.next_in = (Bytef *)&self->buf[self->bpos];
-                rc = cb(ctx, self, 0, fpos, NULL, bsize2);
-                break;
-            }
-        }
-    } while (rc == 0);
-DONE:
-    if (GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcData)
-        rc = 0;
-    rc = cb(ctx, self, rc, self->fpos + self->bpos, NULL, 0);
-#endif
-    return rc;
-}
-
-static rc_t BGZFileWalkBlocksUnzip(BGZFile *const self, zlib_block_t *const bufp, BGZFileWalkBlocks_cb const cb, void *const ctx)
-{
-    rc_t rc;
-    rc_t rc2;
-    
-    do {
-        uint64_t const fpos = self->fpos + self->bpos;
-        unsigned dsize;
-        
-        rc2 = BGZFileRead(self, *bufp, &dsize);
-        rc = cb(ctx, self, rc2, fpos, *bufp, dsize);
-    } while (rc == 0 && rc2 == 0);
-    if (GetRCState(rc2) == rcInsufficient && GetRCObject(rc2) == rcData)
-        rc2 = 0;
-    rc = cb(ctx, self, rc2, self->fpos + self->bpos, NULL, 0);
-    return rc ? rc : rc2;
-}
-
-static rc_t BGZFileWalkBlocks(BGZFile *self, bool decompress, zlib_block_t *bufp,
-                              BGZFileWalkBlocks_cb cb, void *ctx)
-{
-    rc_t rc;
-    
-#if VALIDATE_BGZF_HEADER
-#else
-    decompress = true;
-#endif
-    self->fpos = 0;
-    self->bpos = 0;
-    
-    rc = BGZFileGetMoreBytes(self);
-    if (rc)
-        return rc;
-    
-    if (decompress)
-        return BGZFileWalkBlocksUnzip(self, bufp, cb, ctx);
-    else
-        return BGZFileWalkBlocksND(self, cb, ctx);
-}
-
-static uint64_t BGZFileGetSize(BGZFile const *const self)
-{
-    return self->fsize;
-}
-
-static void BGZFileWhack(BGZFile *self)
-{
-    inflateEnd(&self->zs);
-    KFileRelease(self->kfp);
-    if (self->_buf)
-        free(self->_buf);
-}
-
-static rc_t BGZFileInit(BGZFile *self, const KFile *kfp, BGZFile_vt *vt)
-{
-    int i;
-    rc_t rc;
-    static BGZFile_vt const my_vt = {
-        (rc_t (*)(void *, zlib_block_t, unsigned *))BGZFileRead,
-        (uint64_t (*)(void const *))BGZFileGetPos,
-        (float (*)(void const *))BGZFileProPos,
-        (uint64_t (*)(void const *))BGZFileGetSize,
-        (rc_t (*)(void *, uint64_t))BGZFileSetPos,
-        (void (*)(void *))BGZFileWhack
-    };
-    
-    memset(self, 0, sizeof(*self));
-    memset(vt, 0, sizeof(*vt));
-    
-    i = inflateInit2(&self->zs, MAX_WBITS + 16); /* max + enable gzip headers */
-    switch (i) {
-    case Z_OK:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-    default:
-        return RC(rcAlign, rcFile, rcConstructing, rcNoObj, rcUnexpected);
-    }
-    
-    rc = KFileSize(kfp, &self->fsize);
-    if (rc)
-        return rc;
-    
-    self->_buf = malloc(MEM_CHUNK_SIZE + MEM_ALIGN_SIZE);
-    if (self->_buf == NULL)
-        return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-    self->malign = (MEM_ALIGN_SIZE - ((intptr_t)self->_buf & (MEM_ALIGN_SIZE - 1))) & (MEM_ALIGN_SIZE - 1);
-    self->buf = self->_buf + self->malign;
-    
-    self->kfp = kfp;
-    KFileAddRef(kfp);
-
-    *vt = my_vt;
-    
-    return 0;
-}
-
-/* #pragma mark BGZFile *** End *** */
-
-#ifndef WINDOWS
-
-#include <kproc/thread.h>
-#include <kproc/lock.h>
-#include <kproc/cond.h>
-
-/* #pragma mark BGZThreadFile *** Start *** */
-typedef struct BGZThreadFile_s BGZThreadFile;
-
-#define BUFFER_COUNT (3)
-
-typedef struct BGZThreadFileWorkQElem_s BGZThreadFileWorkQElem;
-
-struct BGZThreadFileWorkQElem_s {
-    uint8_t *buf;
-    uint64_t pos;
-    unsigned bsz;
-};
-
-struct BGZThreadFile_s {
-    BGZFile file;
-    KLock *lock;
-    KCondition *have_data;
-    KCondition *need_data;
-    KThread *th;
-    uint64_t pos;
-    BGZThreadFileWorkQElem que[BUFFER_COUNT];
-    rc_t volatile rc;
-    unsigned volatile nque;
-    bool eof;
-    uint8_t buffer[sizeof(zlib_block_t) * BUFFER_COUNT];
-};
-
-static rc_t BGZThreadFileRead(BGZThreadFile *self, zlib_block_t dst, unsigned *pNumRead)
-{
-    rc_t rc;
-    
-    *pNumRead = 0;
-    
-    KLockAcquire(self->lock);
-    if ((rc = self->rc) == 0) {
-        while (self->nque == 0 && (rc = self->rc) == 0)
-            KConditionWait(self->have_data, self->lock);
-        if (rc == 0) {
-            BGZThreadFileWorkQElem const work = self->que[0];
-            
-            self->pos = work.pos;
-            if (work.buf) {
-                memcpy(dst, work.buf, *pNumRead = work.bsz);
-                memmove(&self->que[0], &self->que[1], --self->nque * sizeof(self->que[0]));
-                KConditionSignal(self->need_data);
-            }
-            else {
-                self->eof = true;
-                self->rc = rc = RC(rcAlign, rcFile, rcReading, rcData, rcInsufficient);
-            }
-        }
-    }
-    KLockUnlock(self->lock);
-    return rc;
-}
-
-static rc_t CC BGZThreadFileMain(KThread const *const th, void *const vp)
-{
-    BGZThreadFile *const self = (BGZThreadFile *)vp;
-    rc_t rc = 0;
-    unsigned bufno;
-    
-    KLockAcquire(self->lock);
-    for (bufno = 0; ; bufno = (bufno + 1) % BUFFER_COUNT) {
-        while (self->nque == BUFFER_COUNT)
-            KConditionWait(self->need_data, self->lock);
-        {
-            BGZThreadFileWorkQElem work;
-            
-            work.pos = BGZFileGetPos(&self->file);
-            work.buf = &self->buffer[bufno * sizeof(zlib_block_t)];
-            rc = BGZFileRead(&self->file, work.buf, &work.bsz);
-            if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient)
-                work.buf = NULL;
-            else if (rc)
-                break;
-            self->que[self->nque++] = work;
-            KConditionSignal(self->have_data);
-        }
-    }
-    self->rc = rc;
-    KLockUnlock(self->lock);
-    return 0;
-}
-
-static uint64_t BGZThreadFileGetPos(BGZThreadFile const *const self)
-{
-    return self->pos;
-}
-
-/* returns the position as proportion of the whole file */ 
-static float BGZThreadFileProPos(BGZThreadFile const *const self)
-{
-    return BGZThreadFileGetPos(self) / (double)self->file.fsize;
-}
-
-static uint64_t BGZThreadFileGetSize(BGZThreadFile const *const self)
-{
-    return BGZFileGetSize(&self->file);
-}
-
-static rc_t BGZThreadFileSetPos(BGZThreadFile *const self)
-{
-    return RC(rcAlign, rcFile, rcPositioning, rcFunction, rcUnsupported);
-}
-
-static void BGZThreadFileWhack(BGZThreadFile *const self)
-{
-    KThreadCancel(self->th);
-    KThreadWait(self->th, NULL);
-    BGZFileWhack(&self->file);
-    KConditionRelease(self->need_data);
-    KConditionRelease(self->have_data);
-    KLockRelease(self->lock);
-    KThreadRelease(self->th);
-}
-
-static rc_t BGZThreadFileInit(BGZThreadFile *self, const KFile *kfp, BGZFile_vt *vt)
-{
-    rc_t rc;
-    static BGZFile_vt const my_vt = {
-        (rc_t (*)(void *, zlib_block_t, unsigned *))BGZThreadFileRead,
-        (uint64_t (*)(void const *))BGZThreadFileGetPos,
-        (float (*)(void const *))BGZThreadFileProPos,
-        (uint64_t (*)(void const *))BGZThreadFileGetSize,
-        (rc_t (*)(void *, uint64_t))BGZThreadFileSetPos,
-        (void (*)(void *))BGZThreadFileWhack
-    };
-    
-    memset(self, 0, sizeof(*self));
-    
-    rc = BGZFileInit(&self->file, kfp, vt);
-    if (rc == 0) {
-        rc = KLockMake(&self->lock);
-        if (rc == 0) {
-            rc = KConditionMake(&self->have_data);
-            if (rc == 0) {
-                rc = KConditionMake(&self->need_data);
-                if (rc == 0) {
-                    rc = KThreadMake(&self->th, BGZThreadFileMain, self);
-                    if (rc == 0) {
-                        *vt = my_vt;
-                        return 0;
-                    }
-                    KConditionRelease(self->need_data);
-                }
-                KConditionRelease(self->have_data);
-            }
-            KLockRelease(self->lock);
-        }
-        BGZFileWhack(&self->file);
-    }
-    memset(self, 0, sizeof(*self));
-    memset(vt, 0, sizeof(*vt));
-    return rc;
-}
-
-#endif
-
-struct BAMIndex {
-    BAMFilePosition *refSeq[1];
-};
-
-struct BAMFile {
-    uint64_t fpos_first;
-    uint64_t fpos_cur;
-    
-    union {
-        BGZFile plain;
-#ifndef WINDOWS
-        BGZThreadFile thread;
-#endif
-    } file;
-    BGZFile_vt vt;
-    
-    BAMRefSeq *refSeq;          /* pointers into headerData1 except name points into headerData2 */ 
-    BAMReadGroup *readGroup;    /* pointers into headerData1 */
-    char const *version;
-    char const *header;
-    char    *headerData1;       /* gets used for refSeq and readGroup */
-    uint8_t *headerData2;       /* gets used for refSeq */
-    BAMAlignment *bufLocker;
-    BAMIndex const *ndx;
-    
-    unsigned refSeqs;
-    unsigned readGroups;
-    
-    atomic32_t refcount;
-    unsigned ucfirst;           /* offset of first record in uncompressed buffer */
-    unsigned bufSize;           /* current size of uncompressed buffer */
-    unsigned bufCurrent;        /* location in uncompressed buffer of read head */
-    bool eof;
-    bool threaded;
-    zlib_block_t buffer;        /* uncompressed buffer */
-};
-
-struct bam_alignment_s {
-    uint8_t rID[4];
-    uint8_t pos[4];
-    uint8_t read_name_len;
-    uint8_t mapQual;
-    uint8_t bin[2];
-    uint8_t n_cigars[2];
-    uint8_t flags[2];
-    uint8_t read_len[4];
-    uint8_t mate_rID[4];
-    uint8_t mate_pos[4];
-    uint8_t ins_size[4];
-    char read_name[1 /* read_name_len */];
-/* if you change length of read_name,
- * adjust calculation of offsets in BAMFileRead */
-/*  uint32_t cigar[n_cigars];
- *  uint8_t seq[(read_len + 1) / 2];
- *  uint8_t qual[read_len];
- *  uint8_t extra[...];
- */
-};
-
-typedef union bam_alignment_u {
-    struct bam_alignment_s cooked;
-    uint8_t raw[sizeof(struct bam_alignment_s)];
-} bam_alignment;
-
-struct offset_size_s {
-    unsigned offset;
-    unsigned size; /* this is the total length of the tag; length of data is size - 3 */
-};
-
-struct BAMAlignment {
-    atomic32_t refcount;
-    
-    BAMFile *parent;
-    bam_alignment *data;
-    uint8_t *storage;
-    unsigned datasize;
-        
-    unsigned cigar;
-    unsigned seq;
-    unsigned qual;
-    unsigned numExtra;
-    struct offset_size_s extra[1];
-};
-
-static const char cigarChars[] = {
-    ct_Match,
-    ct_Insert,
-    ct_Delete,
-    ct_Skip,
-    ct_SoftClip,
-    ct_HardClip,
-    ct_Padded,
-    ct_Equal,
-    ct_NotEqual
-    /* ct_Overlap must not appear in actual BAM file */
-};
-
-static int32_t getRefSeqId(const BAMAlignment *cself) {
-    return LE2HI32(cself->data->cooked.rID);
-}
-
-static int32_t getPosition(const BAMAlignment *cself) {
-    return LE2HI32(cself->data->cooked.pos);
-}
-
-static uint8_t getReadNameLength(const BAMAlignment *cself) {
-    return cself->data->cooked.read_name_len;
-}
-
-static uint16_t getBin(const BAMAlignment *cself) {
-    return LE2HUI16(cself->data->cooked.bin);
-}
-
-static uint8_t getMapQual(const BAMAlignment *cself) {
-    return cself->data->cooked.mapQual;
-}
-
-static uint16_t getCigarCount(const BAMAlignment *cself) {
-    return LE2HUI16(cself->data->cooked.n_cigars);
-}
-
-static uint16_t getFlags(const BAMAlignment *cself) {
-    return LE2HUI16(cself->data->cooked.flags);
-}
-
-static uint32_t getReadLen(const BAMAlignment *cself) {
-    return LE2HUI32(cself->data->cooked.read_len);
-}
-
-static int32_t getMateRefSeqId(const BAMAlignment *cself) {
-    return LE2HI32(cself->data->cooked.mate_rID);
-}
-
-static int32_t getMatePos(const BAMAlignment *cself) {
-    return LE2HI32(cself->data->cooked.mate_pos);
-}
-
-static int32_t getInsertSize(const BAMAlignment *cself) {
-    return LE2HI32(cself->data->cooked.ins_size);
-}
-
-static char const *getReadName(const BAMAlignment *cself) {
-    return &cself->data->cooked.read_name[0];
-}
-
-static void const *getCigarBase(BAMAlignment const *cself)
-{
-    return &cself->data->raw[cself->cigar];
-}
-
-static int opt_tag_cmp(uint8_t const a[2], uint8_t const b[2])
-{
-    int const d0 = (int)a[0] - (int)b[0];
-    return d0 ? d0 : ((int)a[1] - (int)b[1]);
-}
-
-static int CC OptTag_sort(void const *a, void const *b, void *ctx)
-{
-    BAMAlignment const *const self = ctx;
-    unsigned const a_off = ((struct offset_size_s const *)a)->offset;
-    unsigned const b_off = ((struct offset_size_s const *)b)->offset;
-    
-    return opt_tag_cmp(&self->data->raw[a_off], &self->data->raw[b_off]);
-}
-
-static int CC OptTag_cmp(void const *key, void const *item, void *ctx)
-{
-    BAMAlignment const *const self = ctx;
-    unsigned const offset = ((struct offset_size_s const *)item)->offset;
-    
-    return opt_tag_cmp(key, &self->data->raw[offset]);
-}
-
-static char const *get_RG(BAMAlignment const *cself)
-{
-    struct offset_size_s const *const x = kbsearch("RG", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-    return (char const *)(x && cself->data->raw[x->offset + 2] == 'Z' ? &cself->data->raw[x->offset + 3] : NULL);
-}
-
-static struct offset_size_s const *get_CS_info(BAMAlignment const *cself)
-{
-    return kbsearch("CS", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static struct offset_size_s const *get_CQ_info(BAMAlignment const *cself)
-{
-    return kbsearch("CQ", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static char const *get_CS(BAMAlignment const *cself)
-{
-    struct offset_size_s const *const x = get_CS_info(cself);
-    return (char const *)(x && cself->data->raw[x->offset + 2] == 'Z' ? &cself->data->raw[x->offset + 3] : NULL);
-}
-
-static uint8_t const *get_CQ(BAMAlignment const *cself)
-{
-    struct offset_size_s const *const x = get_CQ_info(cself);
-    return (uint8_t const *)(x && cself->data->raw[x->offset + 2] == 'Z' ? &cself->data->raw[x->offset + 3] : NULL);
-}
-
-static struct offset_size_s const *get_OQ_info(BAMAlignment const *cself)
-{
-    return kbsearch("OQ", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static uint8_t const *get_OQ(BAMAlignment const *cself)
-{
-    struct offset_size_s const *const x = get_OQ_info(cself);
-    return (uint8_t const *)(x && cself->data->raw[x->offset + 2] == 'Z' ? &cself->data->raw[x->offset + 3] : NULL);
-}
-
-static char const *get_XT(BAMAlignment const *cself)
-{
-    struct offset_size_s const *const x = kbsearch("XT", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-    return (char const *)(x && cself->data->raw[x->offset + 2] == 'Z' ? &cself->data->raw[x->offset + 3] : NULL);
-}
-
-static struct offset_size_s const *get_CG_ZA_info(BAMAlignment const *cself)
-{
-    return kbsearch("ZA", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static struct offset_size_s const *get_CG_ZI_info(BAMAlignment const *cself)
-{
-    return kbsearch("ZI", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static struct offset_size_s const *get_CG_GC_info(BAMAlignment const *cself)
-{
-    return kbsearch("GC", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static struct offset_size_s const *get_CG_GS_info(BAMAlignment const *cself)
-{
-    return kbsearch("GS", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static struct offset_size_s const *get_CG_GQ_info(BAMAlignment const *cself)
-{
-    return kbsearch("GQ", cself->extra, cself->numExtra, sizeof(cself->extra[0]), OptTag_cmp, (void *)cself);
-}
-
-static rc_t BAMFileReadn(BAMFile *self, const unsigned len, uint8_t dst[/* len */]) {
-    rc_t rc;
-    unsigned cur;
-    unsigned n = 0;
-    
-    if (len == 0)
-        return 0;
-    
-    for (cur = 0; ; cur += n) {
-        if (self->bufSize > self->bufCurrent) {
-            n = self->bufSize - self->bufCurrent;
-            if (cur + n > len)
-                n = len - cur;
-            memcpy(&dst[cur], &self->buffer[self->bufCurrent], n);
-            self->bufCurrent += n;
-        }
-        if (self->bufCurrent != self->bufSize && self->bufSize != 0)
-            return 0;
-        if (self->bufSize != 0) {
-            /* a seek has not just been done so update the file position.
-             * if we didn't and a request for the position is made before the
-             * next read, we will not have the position of the next read.
-             *
-             * if a seek had just been done then
-             *    self->fpos_cur == BGZFileGetPos(&self->file)
-             * is already true.
-             */
-            self->fpos_cur = self->vt.FileGetPos(&self->file);
-            self->bufCurrent = 0;
-            self->bufSize = 0;
-            if (cur + n == len)
-                return 0;
-        }
-
-        rc = self->vt.FileRead(&self->file, self->buffer, &self->bufSize);
-        if (rc)
-            return rc;
-        if (self->bufSize == 0 || self->bufSize <= self->bufCurrent)
-            return RC(rcAlign, rcFile, rcReading, rcData, rcInsufficient);
-    }
-}
-
-static rc_t BAMFileReadI32(BAMFile *self, int32_t *rhs)
-{
-    uint8_t buf[sizeof(int32_t)];
-    rc_t rc = BAMFileReadn(self, sizeof(int32_t), buf);
-    
-    if (rc == 0)
-        *rhs = LE2HI32(buf);
-    return rc;
-}
-
-static int CC comp_ReadGroup(const void *a, const void *b, void *ignored) {
-    return strcmp(((BAMReadGroup const *)a)->name, ((BAMReadGroup const *)b)->name);
-}
-
-static rc_t ParseHD(BAMFile *self, char hdata[], size_t hlen, unsigned *used)
-{
-    unsigned i;
-    unsigned tag;
-    unsigned value;
-    int st = 0;
-    int ws = 1;
-
-    for (i = 0; i < hlen; ++i) {
-        char const cc = hdata[i];
-        
-        if (ws && isspace(cc))
-            continue;
-        ws = 0;
-        
-        switch (st) {
-        case 0:
-            tag = i;
-            ++st;
-            break;
-        case 1:
-            if (isspace(cc))
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            ++st;
-            break;
-        case 2:
-            if (cc != ':')
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            hdata[i] = '\0';
-            value = i + 1;
-            ++st;
-            break;
-        case 3:
-            if (cc == '\t' || cc == '\r' || cc == '\n') {
-                hdata[i] = '\0';
-                
-                if (strcmp(&hdata[tag], "VN") == 0)
-                    self->version = &hdata[value];
-                
-                ++st;
-                ws = 1;
-            }
-            break;
-        case 4:
-            if (cc == '@')
-                goto DONE;
-            tag = i;
-            st = 1;
-            break;
-        }
-    }
-    if (st == 4) {
-DONE:
-        *used = i;
-        return 0;
-    }
-    return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-}
-
-static rc_t ParseSQ(BAMFile *self, char hdata[], size_t hlen, unsigned *used, unsigned const rs_by_name[])
-{
-    unsigned i;
-    unsigned tag;
-    unsigned value;
-    int st = 0;
-    int ws = 1;
-    BAMRefSeq rs;
-    
-    memset(&rs, 0, sizeof(rs));
-    
-    for (i = 0; i < hlen; ++i) {
-        char const cc = hdata[i];
-        
-        if (ws && isspace(cc))
-            continue;
-        ws = 0;
-        
-        switch (st) {
-        case 0:
-            tag = i;
-            ++st;
-            break;
-        case 1:
-            if (isspace(cc))
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            ++st;
-            break;
-        case 2:
-#define HACKAMATIC 1
-#if HACKAMATIC
-            if (cc != ':') {
-                if (i + 1 >= hlen || hdata[i+1] != ':')
-                    return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-                else
-                    ++i;
-            }
-#else
-            if (cc != ':')
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-#endif
-            hdata[i] = '\0';
-            value = i + 1;
-            ++st;
-            break;
-        case 3:
-            if (cc == '\t' || cc == '\r' || cc == '\n') {
-                unsigned j;
-                
-                hdata[i] = '\0';
-                
-                while (value < i && isspace(hdata[value]))
-                    ++value;
-                for (j = i; value < j && isspace(hdata[j - 1]); )
-                    hdata[--j] = '\0';
-                
-                if (strcmp(&hdata[tag], "SN") == 0)
-                    rs.name = &hdata[value];
-                else if (strcmp(&hdata[tag], "LN") == 0)
-                    rs.length = strtou64(&hdata[value], NULL, 10);
-                else if (strcmp(&hdata[tag], "AS") == 0)
-                    rs.assemblyId = &hdata[value];
-#if HACKAMATIC
-                else if (strcmp(&hdata[tag], "M5") == 0 || strcmp(&hdata[tag], "MD5") == 0)
-#else
-                else if (strcmp(&hdata[tag], "M5") == 0)
-#endif
-#undef HACKAMATIC
-                {
-                    unsigned len = j - value;
-                    
-                    if ((hdata[value] == '\'' || hdata[value] == '"') && hdata[value + len - 1] == hdata[value]) {
-                        ++value;
-                        len -= 2;
-                    }
-                    if (len == 32) {
-                        rs.checksum = &rs.checksum_array[0];
-                        for (j = 0; j != 16; ++j) {
-                            int const ch1 = toupper(hdata[value + j * 2 + 0]);
-                            int const ch2 = toupper(hdata[value + j * 2 + 1]);
-                            
-                            if (isxdigit(ch1) && isxdigit(ch2)) {
-                                rs.checksum_array[j] =
-                                    ((ch1 > '9' ? (ch1 - ('A' - 10)) : (ch1 - '0')) << 4) +
-                                     (ch2 > '9' ? (ch2 - ('A' - 10)) : (ch2 - '0'));
-                            }
-                            else {
-                                rs.checksum = NULL;
-                                break;
-                            }
-                        }
-                    }
-                }
-                else if (strcmp(&hdata[tag], "UR") == 0)
-                    rs.uri = &hdata[value];
-                else if (strcmp(&hdata[tag], "SP") == 0)
-                    rs.species = &hdata[value];
-                
-                ++st;
-                ws = 1;
-            }
-            break;
-        case 4:
-            if (cc == '@')
-                goto DONE;
-            tag = i;
-            st = 1;
-            break;
-        }
-    }
-DONE:
-    if (st == 4) {
-        unsigned f = 0;
-        unsigned e = self->refSeqs;
-        
-        if (rs.name == NULL) /* required tags */
-            return RC(rcAlign, rcFile, rcParsing, rcConstraint, rcViolated);
-        
-        while (f < e) {
-            unsigned const m = (f + e) >> 1;
-            BAMRefSeq *const x = &self->refSeq[rs_by_name[m]];
-            int const cmp = strcmp(rs.name, x->name);
-            
-            if (cmp < 0)
-                e = m;
-            else if (cmp > 0)
-                f = m + 1;
-            else {
-                x->assemblyId = rs.assemblyId;
-                x->uri = rs.uri;
-                x->species = rs.species;
-                if (rs.checksum) {
-                    x->checksum = &x->checksum_array[0];
-                    memcpy(x->checksum_array, rs.checksum_array, 16);
-                }
-                else
-                    x->checksum = NULL;
-                break;
-            }
-        }
-        *used = i;
-        return 0;
-    }
-    return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-}
-
-static rc_t ParseRG(BAMFile *self, char hdata[], size_t hlen, unsigned *used, BAMReadGroup *dst)
-{
-    unsigned i;
-    unsigned tag;
-    unsigned value;
-    int st = 0;
-    int ws = 1;
-#if _DEBUGGING
-    char const *cur = hdata;
-#endif
-    
-    memset(dst, 0, sizeof(*dst));
-    
-    for (i = 0; i < hlen; ++i) {
-        char const cc = hdata[i];
-        
-        if (ws && isspace(cc))
-            continue;
-        ws = 0;
-        
-        switch (st) {
-        case 0:
-            tag = i;
-            ++st;
-            break;
-        case 1:
-            if (isspace(cc))
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            ++st;
-            break;
-        case 2:
-            if (cc != ':')
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-#if _DEBUGGING
-            cur = hdata + i + 1;
-#endif
-            hdata[i] = '\0';
-            value = i + 1;
-            ++st;
-            break;
-        case 3:
-            if (cc == '\t' || cc == '\r' || cc == '\n') {
-                unsigned j = i;
-#if _DEBUGGING
-                cur = hdata + i + 1;
-#endif
-                hdata[i] = '\0';
-
-                while (value < i && isspace(hdata[value]))
-                    ++value;
-                while (value < j && isspace(hdata[j - 1]))
-                    hdata[--j] = '\0';
-                
-                if ((hdata[value] == '\"' || hdata[value] == '\'') && hdata[value] == hdata[j - 1]) {
-                    ++value;
-                    hdata[j - 1] = '\0';
-                }
-                if (strcmp(&hdata[tag], "ID") == 0)
-                    dst->name = &hdata[value];
-                else if (strcmp(&hdata[tag], "SM") == 0)
-                    dst->sample = &hdata[value];
-                else if (strcmp(&hdata[tag], "LB") == 0)
-                    dst->library = &hdata[value];
-                else if (strcmp(&hdata[tag], "DS") == 0)
-                    dst->description = &hdata[value];
-                else if (strcmp(&hdata[tag], "PU") == 0)
-                    dst->unit = &hdata[value];
-                else if (strcmp(&hdata[tag], "PI") == 0)
-                    dst->insertSize = &hdata[value];
-                else if (strcmp(&hdata[tag], "CN") == 0)
-                    dst->center = &hdata[value];
-                else if (strcmp(&hdata[tag], "DT") == 0)
-                    dst->runDate = &hdata[value];
-                else if (strcmp(&hdata[tag], "PL") == 0)
-                    dst->platform = &hdata[value];
-                
-                ++st;
-                ws = 1;
-            }
-            break;
-        case 4:
-            if (cc == '@')
-                goto DONE;
-            tag = i;
-            st = 1;
-            break;
-        }
-    }
-    if (st == 4) {
-DONE:
-        *used = i;
-        if (dst->name == NULL) /* required */
-            return RC(rcAlign, rcFile, rcParsing, rcConstraint, rcViolated);
-        return 0;
-    }
-    return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-}
-
-static rc_t ParseHeader(BAMFile *self, char hdata[], size_t hlen, unsigned const rs_by_name[]) {
-    unsigned rg = 0;
-    unsigned i;
-    unsigned tag;
-    int st = 0;
-    int ws = 1;
-    unsigned used;
-    rc_t rc;
-    
-    for (i = 0; i < hlen; ++i) {
-        char const cc = hdata[i];
-        
-        if (ws && isspace(cc))
-            continue;
-        ws = 0;
-        
-        switch (st) {
-        case 0:
-            if (cc == '@')
-                ++st;
-            else
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            break;
-        case 1:
-            if (isspace(cc))
-                return RC(rcAlign, rcFile, rcParsing, rcData, rcInvalid);
-            tag = i;
-            ++st;
-            break;
-        case 2:
-            if (isspace(cc)) {
-                hdata[i] = '\0';
-                if (i - tag == 2) {
-                    if (strcmp(&hdata[tag], "HD") == 0) {
-                        rc = ParseHD(self, &hdata[i + 1], hlen - i - 1, &used);
-                        if (rc) return rc;
-                        i += used;
-                        st = 0;
-                    }
-                    else if (strcmp(&hdata[tag], "SQ") == 0) {
-                        rc = ParseSQ(self, &hdata[i + 1], hlen - i - 1, &used, rs_by_name);
-                        if (rc) return rc;
-                        i += used;
-                        st = 0;
-                    }
-                    else if (strcmp(&hdata[tag], "RG") == 0) {
-                        rc = ParseRG(self, &hdata[i + 1], hlen - i - 1, &used, &self->readGroup[rg]);
-                        if (GetRCObject(rc) == rcConstraint && GetRCState(rc) == rcViolated) {
-                            (void)LOGERR(klogWarn, rc, "Read Group is missing ID in BAM header");
-                            rc = 0;
-                            if (self->readGroups) --self->readGroups;
-                        }
-                        else if (rc)
-                            return rc;
-                        else
-                            ++rg;
-                        i += used;
-                        st = 0;
-                    }
-                }
-                if (st == 2) {
-                    ++st;
-                    ws = 0;
-                }
-            }
-            else if (i - tag > 2)
-                ++st;
-            break;
-        case 3:
-            if (cc == '\r' || cc == '\n') {
-                st = 0;
-                ws = 1;
-            }
-            break;
-        }
-    }
-    ksort( self->readGroup, self->readGroups, sizeof(self->readGroup[0]), comp_ReadGroup, NULL );
-    for (rg = 0; rg != self->readGroups; ++rg) {
-        if (rg > 0 && strcmp(self->readGroup[rg - 1].name, self->readGroup[rg].name) == 0)
-            return RC(rcAlign, rcFile, rcParsing, rcConstraint, rcViolated);  /* name must be unique */
-        self->readGroup[rg].id = rg;
-    }
-    for (i = 0; i < self->refSeqs; ++i) {
-        if (self->refSeq[i].length == 0) {
-            (void)PLOGMSG(klogWarn, (klogWarn, "Reference '$(ref)' has zero length", "ref=%s", self->refSeq[i].name));
-        }
-    }
-    
-    return 0;
-}
-
-static rc_t CountReadGroups(char const txt[], size_t len, unsigned *reads) {
-    const char *const endp = txt + len;
-    
-    *reads = 0;
-    
-    do {
-        while (txt != endp && isspace(*txt))
-            ++txt;
-        if (txt == endp || txt + 3 >= endp)
-            break;
-        
-        if (txt[0] == '@' && txt[1] == 'R' && txt[2] == 'G')
-            ++*reads;
-        
-        txt = memchr(txt, '\n', endp - txt);
-    } while (txt);
-    return 0;
-}
-
-static rc_t ReadMagic(BAMFile *self)
-{
-    uint8_t sig[4];
-    rc_t rc = BAMFileReadn(self, 4, sig);
-    
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM signature: '%c%c%c' %u\n", sig[0], sig[1], sig[2], sig[3]));
-    if (rc == 0 && (sig[0] != 'B' || sig[1] != 'A' || sig[2] != 'M' || sig[3] != 1))
-        rc = RC(rcAlign, rcFile, rcReading, rcHeader, rcBadVersion);
-    return rc;
-}
-
-static rc_t ReadHeaders(BAMFile *self,
-                        char **headerText, size_t *headerTextLen,
-                        uint8_t **refData, unsigned *numrefs)
-{
-    unsigned hlen;
-    char *htxt = NULL;
-    unsigned nrefs;
-    uint8_t *rdat = NULL;
-    unsigned rdsz;
-    unsigned rdms;
-    unsigned i;
-    int32_t i32;
-    rc_t rc = BAMFileReadI32(self, &i32);
-    
-    if (rc) return rc;
-
-    if (i32 < 0) {
-        rc = RC(rcAlign, rcFile, rcReading, rcHeader, rcInvalid);
-        goto BAILOUT;
-    }
-    hlen = i32;
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM Header text size: %u\n", hlen));
-    if (hlen) {
-        htxt = malloc(hlen + 1);
-        if (htxt == NULL) {
-            rc = RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-            goto BAILOUT;
-        }
-        
-        rc = BAMFileReadn(self, hlen, (uint8_t *)htxt); if (rc) goto BAILOUT;
-        htxt[hlen] = '\0';
-    }
-    rc = BAMFileReadI32(self, &i32); if (rc) goto BAILOUT;
-    if (i32 < 0) {
-        rc = RC(rcAlign, rcFile, rcReading, rcHeader, rcInvalid);
-        goto BAILOUT;
-    }
-    nrefs = i32;
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM Header reference count: %u\n", nrefs));
-    if (nrefs) {
-        rdms = nrefs * 16;
-        if (rdms < 4096)
-            rdms = 4096;
-        rdat = malloc(rdms);
-        if (rdat == NULL) {
-            rc = RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-            goto BAILOUT;
-        }
-        for (i = rdsz = 0; i < nrefs; ++i) {
-            rc = BAMFileReadI32(self, &i32); if (rc) goto BAILOUT;
-            if (i32 <= 0) {
-                rc = RC(rcAlign, rcFile, rcReading, rcHeader, rcInvalid);
-                goto BAILOUT;
-            }
-            if (rdsz + i32 + 8 > rdms) {
-                void *tmp;
-                
-                do { rdms <<= 1; } while (rdsz + i32 + 8 > rdms);
-                tmp = realloc(rdat, rdms);
-                if (tmp == NULL) {
-                    rc = RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-                    goto BAILOUT;
-                }
-                rdat = tmp;
-            }
-            memcpy(rdat + rdsz, &i32, 4);
-            rdsz += 4;
-            rc = BAMFileReadn(self, i32, &rdat[rdsz]); if (rc) goto BAILOUT;
-            rdsz += i32;
-            rc = BAMFileReadI32(self, &i32); if (rc) goto BAILOUT;
-            memcpy(rdat + rdsz, &i32, 4);
-            rdsz += 4;
-        }
-    }
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM Header reference size: %u\n", rdsz));
-    
-    *headerText = htxt;
-    *headerTextLen = hlen;
-    *refData = rdat;
-    *numrefs = nrefs;
-    return 0;
-    
-BAILOUT:
-    if (htxt)
-        free(htxt);
-    if (rdat)
-        free(rdat);
-    
-    return rc;
-}
-
-static int CC comp_RefSeqName(const void *A, const void *B, void *ignored) {
-    BAMFile const *self = (BAMFile const *)ignored;
-    unsigned const a = *(unsigned const *)A;
-    unsigned const b = *(unsigned const *)B;
-    
-    return strcmp(self->refSeq[a].name, self->refSeq[b].name);
-}
-
-static rc_t ProcessHeader(BAMFile *self, char const headerText[])
-{
-    unsigned *rs_by_name = NULL;
-    unsigned i;
-    unsigned cp;
-    char *htxt;
-    uint8_t *rdat;
-    size_t hlen;
-    unsigned nrefs;
-    rc_t rc = ReadMagic(self);
-
-    if (rc) return rc;
-
-    rc = ReadHeaders(self, &htxt, &hlen, &rdat, &nrefs);
-    if (rc) return rc;
-    
-    self->fpos_first = self->fpos_cur;
-    self->ucfirst = self->bufCurrent;
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM Data records start at: %lu+%u\n", self->ucfirst, self->fpos_first));
-
-    if (headerText) {
-        free(htxt);
-        hlen = string_size( headerText );
-        htxt = malloc(hlen + 1);
-        if (htxt == NULL) {
-            free(rdat);
-            return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        }
-        memcpy(htxt, headerText, hlen + 1);
-    }
-    
-    self->headerData2 = rdat;
-    if (hlen) {
-        self->header = htxt;
-        self->headerData1 = malloc(hlen + 1);
-        if (self->headerData1 == NULL)
-            return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        memcpy(self->headerData1, self->header, hlen + 1);
-    }
-    else {
-        htxt = malloc(1);
-        htxt[0] = '\0';
-        self->header = htxt;
-        self->headerData1 = NULL;
-    }
-    self->refSeqs = nrefs;
-    if (nrefs) {
-        self->refSeq = calloc(nrefs, sizeof(self->refSeq[0]));
-        if (self->refSeq == NULL)
-            return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        
-        rs_by_name = calloc(nrefs, sizeof(rs_by_name[0]));
-        if (rs_by_name == NULL)
-            return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        
-        for (i = cp = 0; i < nrefs; ++i) {
-            uint32_t nlen;
-            uint32_t rlen;
-            
-            rs_by_name[i] = i;
-            self->refSeq[i].id = i;
-            memcpy(&nlen, &self->headerData2[cp], 4);
-            cp += 4;
-            self->refSeq[i].name = (char const *)&self->headerData2[cp];
-            cp += nlen;
-            memcpy(&rlen, &self->headerData2[cp], 4);
-            self->headerData2[cp] = 0;
-            cp += 4;
-            self->refSeq[i].length = rlen;
-        }
-        ksort((void *)rs_by_name, self->refSeqs, sizeof(rs_by_name[0]), comp_RefSeqName, self);
-    }
-    if (self->headerData1) {
-        rc = CountReadGroups(self->headerData1, hlen, &self->readGroups);
-        if (rc == 0) {
-            self->readGroup = calloc(self->readGroups, sizeof(self->readGroup[0]));
-            if (self->readGroup != NULL)
-                rc = ParseHeader(self, self->headerData1, hlen, rs_by_name);
-            else
-                rc = RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        }
-    }
-    if (rs_by_name != NULL)
-        free((void *)rs_by_name);
-    
-    return rc;
-}
-
-static rc_t BAMIndexWhack(const BAMIndex *);
-
-static rc_t BAMFileWhack(BAMFile *self) {
-    if (self->refSeq)
-        free(self->refSeq);
-    if (self->readGroup)
-        free(self->readGroup);
-    if (self->header)
-        free((void *)self->header);
-    if (self->headerData1)
-        free((void *)self->headerData1);
-    if (self->headerData2)
-        free((void *)self->headerData2);
-    if (self->ndx)
-        BAMIndexWhack(self->ndx);
-    if (self->vt.FileWhack)
-        self->vt.FileWhack(&self->file);
-
-    return 0;
-}
-
-/* file is retained */
-static rc_t BAMFileMakeWithKFileAndHeader(BAMFile const **cself,
-                                          KFile const *file,
-                                          char const *headerText,
-                                          bool threaded)
-{
-    BAMFile *self = calloc(1, sizeof(*self));
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-    
-    atomic32_set(&self->refcount, 1);
-#ifndef WINDOWS
-    if (threaded)
-        rc = BGZThreadFileInit(&self->file.thread, file, &self->vt);
-    else
-#endif
-        rc = BGZFileInit(&self->file.plain, file, &self->vt);
-
-    if (rc == 0) {
-        rc = ProcessHeader(self, headerText);
-        if (rc == 0) {
-            *cself = self;
-            return 0;
-        }
-    }
-    BAMFileWhack(self);
-    return rc;
-}
-
-/* file is retained */
-LIB_EXPORT rc_t CC BAMFileMakeWithKFile(const BAMFile **cself, const KFile *file)
-{
-    return BAMFileMakeWithKFileAndHeader(cself, file, NULL, false);
-}
-
-LIB_EXPORT rc_t CC BAMFileVMakeWithDir(const BAMFile **result,
-                                         const KDirectory *dir,
-                                         const char *path,
-                                         va_list args
-                                         )
-{
-    rc_t rc;
-    const KFile *kf;
-    
-    if (result == NULL)
-        return RC(rcAlign, rcFile, rcOpening, rcParam, rcNull);
-    *result = NULL;
-    rc = KDirectoryVOpenFileRead(dir, &kf, path, args);
-    if (rc == 0) {
-        rc = BAMFileMakeWithKFile(result, kf);
-        KFileRelease(kf);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileMakeWithDir(const BAMFile **result,
-                                        const KDirectory *dir,
-                                        const char *path, ...
-                                        )
-{
-    va_list args;
-    rc_t rc;
-    
-    va_start(args, path);
-    rc = BAMFileVMakeWithDir(result, dir, path, args);
-    va_end(args);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileMake(const BAMFile **cself, const char *path, ...)
-{
-    KDirectory *dir;
-    va_list args;
-    rc_t rc;
-    
-    if (cself == NULL)
-        return RC(rcAlign, rcFile, rcOpening, rcParam, rcNull);
-    *cself = NULL;
-    
-    rc = KDirectoryNativeDir(&dir);
-    if (rc) return rc;
-    va_start(args, path);
-    rc = BAMFileVMakeWithDir(cself, dir, path, args);
-    va_end(args);
-    KDirectoryRelease(dir);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileMakeWithHeader ( const BAMFile **cself,
-                                          char const headerText[],
-                                          char const path[], ... )
-{
-    KDirectory *dir;
-    va_list args;
-    rc_t rc;
-    const KFile *kf;
-    
-    if (cself == NULL)
-        return RC(rcAlign, rcFile, rcOpening, rcParam, rcNull);
-    *cself = NULL;
-    
-    rc = KDirectoryNativeDir(&dir);
-    if (rc) return rc;
-    va_start(args, path);
-    rc = KDirectoryVOpenFileRead(dir, &kf, path, args);
-    if (rc == 0) {
-        rc = BAMFileMakeWithKFileAndHeader(cself, kf, headerText, false);
-        KFileRelease(kf);
-    }
-    va_end(args);
-    KDirectoryRelease(dir);
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC BAMFileMakeWithVPath(const BAMFile **cself, const VPath *kpath)
-{
-    char path[4096];
-    size_t nread;
-    rc_t rc;
-
-    rc = VPathReadPath(kpath, path, sizeof(path), &nread);
-    if (rc == 0)
-        rc = BAMFileMake(cself, "%.*s", (int)nread, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileAddRef(const BAMFile *cself) {
-    if (cself != NULL)
-        atomic32_inc(&((BAMFile *)cself)->refcount);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileRelease(const BAMFile *cself) {
-    rc_t rc = 0;
-    BAMFile *self = (BAMFile *)cself;
-    
-    if (cself != NULL) {
-        if (atomic32_dec_and_test(&self->refcount)) {
-            rc = BAMFileWhack(self);
-            if (rc)
-                atomic32_set(&self->refcount, 1);
-            else
-                free(self);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT float CC BAMFileGetProportionalPosition(const BAMFile *self)
-{
-    return self->vt.FileProPos(&self->file);
-}
-
-LIB_EXPORT rc_t CC BAMFileGetPosition(const BAMFile *self, BAMFilePosition *pos) {
-    *pos = (self->fpos_cur << 16) | self->bufCurrent;
-    return 0;
-}
-
-static rc_t BAMFileSetPositionInt(const BAMFile *cself, uint64_t fpos, uint16_t bpos)
-{
-    rc_t rc;
-    BAMFile *self = (BAMFile *)cself;
-    
-    if (cself->fpos_first > fpos || fpos > cself->vt.FileGetSize(&cself->file) ||
-        (fpos == cself->fpos_first && bpos < cself->ucfirst))
-    {
-        return RC(rcAlign, rcFile, rcPositioning, rcParam, rcInvalid);
-    }
-    if (cself->fpos_cur == fpos) {
-        if (bpos <= cself->bufSize) {
-            self->eof = false;
-            self->bufCurrent = bpos;
-            return 0;
-        }
-        return RC(rcAlign, rcFile, rcPositioning, rcParam, rcInvalid);
-    }
-    rc = self->vt.FileSetPos(&self->file, fpos);
-    if (rc == 0) {
-        self->eof = false;
-        self->bufSize = 0; /* force re-read */
-        self->bufCurrent = bpos;
-        self->fpos_cur = fpos;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileSetPosition(const BAMFile *cself, const BAMFilePosition *pos)
-{
-    return BAMFileSetPositionInt(cself, *pos >> 16, (uint16_t)(*pos));
-}
-
-LIB_EXPORT rc_t CC BAMFileRewind(const BAMFile *cself)
-{
-    return BAMFileSetPositionInt(cself, cself->fpos_first, cself->ucfirst);
-}
-
-typedef bool (* i_OptData_f)(void *ctx, char const tag[2], BAMOptDataValueType type, unsigned length,
-                             unsigned count, unsigned size, void const *value);
-
-static rc_t ParseOptData(uint8_t const data[], unsigned const n, void *ctx, i_OptData_f f)
-{
-    unsigned i = 0;
-    rc_t rc = 0;
-    
-    while (rc == 0 && i + 3 < n) {
-        char const *const tag = (char const *)&data[i];
-        int type = data[i + 2];
-        uint8_t const *const vp = &data[i + 3];
-        unsigned len = 0;
-        unsigned size = 0;
-        unsigned count = 1;
-        unsigned offset = 0;
-        
-        switch (type) {
-        case dt_CSTRING:
-        case dt_HEXSTRING:
-            len = 0;
-            while (i + len + 3 != n && vp[len] != '\0')
-                ++len;
-            if (i + len + 3 == n) {
-                rc = RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-                break;
-            }
-            size = len;
-            ++len;
-            break;
-        case dt_INT8:
-        case dt_UINT8:
-        case dt_ASCII:
-            size = len = 1;
-            break;
-        case dt_INT16:
-        case dt_UINT16:
-            size = len = 2;
-            break;
-        case dt_INT:
-        case dt_FLOAT32:
-        case dt_UINT:
-            size = len = 4;
-            break;
-        case dt_FLOAT64:
-            size = len = 8;
-            break;
-        case dt_NUM_ARRAY:
-            offset = len = 5;
-            {
-                unsigned elem_size = 0;
-                uint32_t elem_count = 0;
-                
-                switch (vp[0]) {
-                case dt_INT8:
-                case dt_UINT8:
-                    elem_size = 1;
-                    break;
-                case dt_INT16:
-                case dt_UINT16:
-                    elem_size = 2;
-                    break;
-                case dt_FLOAT32:
-                case dt_INT:
-                case dt_UINT:
-                    elem_size = 4;
-                    break;
-                case dt_FLOAT64:
-                    elem_size = 8;
-                    break;
-                default:
-                    rc = RC(rcAlign, rcFile, rcReading, rcData, rcUnexpected);
-                    break;
-                }
-                if (rc)
-                    break;
-                elem_count = LE2HUI32(&vp[1]);
-                len += elem_size * elem_count;
-                if (i + len + 3 > n) {
-                    rc = RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-                    break;
-                }
-                type = vp[0];
-                count = elem_count;
-                size = elem_size;
-            }
-            break;
-        default:
-            rc = RC(rcAlign, rcFile, rcReading, rcData, rcUnexpected);
-            break;
-        }
-        if (rc)
-            break;
-        i += len + 3;
-        if (f(ctx, tag, type, len + 3, count, size, &vp[offset]))
-            break;
-    }
-    return rc;
-}
-
-static bool CountOptTags(void *ctx, char const tag[2], BAMOptDataValueType type, unsigned length,
-                         unsigned count, unsigned size, void const *value)
-{
-    ++*(unsigned *)ctx;
-    return false;
-}
-
-struct ctx_LoadOptTags_s {
-    unsigned i;
-    BAMAlignment *self;
-};
-
-static bool LoadOptTags(void *Ctx, char const tag[2], BAMOptDataValueType type, unsigned length,
-                         unsigned count, unsigned size, void const *value)
-{
-    struct ctx_LoadOptTags_s *ctx = Ctx;
-    BAMAlignment *self = ctx->self;
-    
-    self->extra[ctx->i].offset = (unsigned)((uint8_t const *)&tag[0] - (uint8_t const *)&self->data->raw[0]);
-    self->extra[ctx->i].size = length;
-    ++ctx->i;
-    return false;
-}
-
-LIB_EXPORT rc_t CC BAMFileRead(const BAMFile *cself, const BAMAlignment **rhs)
-{
-    BAMFile *self = (BAMFile *)cself;
-    BAMAlignment *y;
-    BAMAlignment x;
-    struct ctx_LoadOptTags_s load_ctx;
-    bool local = false;
-    int32_t i32;
-    rc_t rc;
-    unsigned xtra;
-    
-    *rhs = NULL;
-
-    if (cself == NULL)
-        return RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    
-    if (cself->bufCurrent >= cself->bufSize && cself->eof)
-        return RC(rcAlign, rcFile, rcReading, rcRow, rcNotFound);
-
-    if (self->bufLocker != NULL) {
-        if (self->bufLocker->storage == NULL)
-            self->bufLocker->storage = malloc(self->bufLocker->datasize);
-        if (self->bufLocker->storage == NULL)
-            return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-        memcpy(self->bufLocker->storage, self->bufLocker->data, self->bufLocker->datasize);
-        self->bufLocker->data = (bam_alignment *)&self->bufLocker->storage[0];
-        self->bufLocker = NULL;
-    }
-    
-    rc = BAMFileReadI32(self, &i32);
-    if (rc) {
-        if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient) {
-            self->eof = true;
-            rc = RC(rcAlign, rcFile, rcReading, rcRow, rcNotFound);
-        }
-        return rc;
-    }
-    if (i32 <= 0)
-        return RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-    
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM record: { size: %i }\n", i32));
-    memset(&x, 0, sizeof(x));
-    x.datasize = i32;
-    
-    if (self->bufCurrent + x.datasize <= self->bufSize) {
-        x.data = (bam_alignment *)&self->buffer[self->bufCurrent];
-        local = true;
-    }
-    else {
-        x.storage = malloc(x.datasize);
-        if (x.storage == NULL)
-            return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-
-        rc = BAMFileReadn(self, x.datasize, x.storage);
-        if (rc) {
-            free(x.storage);
-            return rc;
-        }
-        x.data = (bam_alignment *)x.storage;
-    }
-    {{
-        unsigned const nameLen = getReadNameLength(&x);
-        unsigned const cigCnt  = getCigarCount(&x);
-        unsigned const readLen = getReadLen(&x);
-        
-        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM record: { name length: %u, cigar count: %u, read length %u }\n", nameLen, cigCnt, readLen));
-        x.cigar = sizeof(x.data[0]) + nameLen - 1;
-        x.seq   = x.cigar + 4 * cigCnt;
-        x.qual  = x.seq + (readLen + 1) / 2;
-        xtra    = x.qual + readLen;
-    }}
-    if (   x.cigar >= x.datasize
-        || x.seq   >  x.datasize
-        || x.qual  >  x.datasize
-        || xtra    >  x.datasize
-        || (rc = ParseOptData(&x.data->raw[xtra], x.datasize - xtra, &x.numExtra, CountOptTags)) != 0)
-    {
-	rc = RC(rcAlign, rcFile, rcReading, rcRow, rcInvalid);
-        free(x.storage);
-        return rc;
-    }
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("BAM record: { number of extra fields: %u }\n", x.numExtra));
-    y = calloc(sizeof(*y) + (x.numExtra ? x.numExtra - 1 : 0) * sizeof(y->extra), 1);
-    if (y == NULL) {
-        free(x.storage);
-        return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-    }
-    *y = x;
-    load_ctx.self = y;
-    load_ctx.i = 0;
-    if ((rc = ParseOptData(&y->data->raw[xtra], y->datasize - xtra, &load_ctx, LoadOptTags)) != 0) {
-        free(x.storage);
-        free(y);
-        return rc;
-    }
-    ksort(y->extra, y->numExtra, sizeof(y->extra[0]), OptTag_sort, y);
-
-    BAMFileAddRef(y->parent = self);
-    atomic32_set(&y->refcount, 1);
-    if (local) {
-        self->bufLocker = y;
-        self->bufCurrent += y->datasize;
-        if (self->bufCurrent == self->bufSize) {
-            self->fpos_cur = self->vt.FileGetPos(&self->file);
-            self->bufCurrent = 0;
-            self->bufSize = 0;
-        }
-    }
-    
-    *rhs = y;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetRefSeqById(const BAMFile *cself, int32_t id, const BAMRefSeq **rhs)
-{
-    *rhs = NULL;
-    if (id >= 0 && id < cself->refSeqs)
-        *rhs = &cself->refSeq[id];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetReadGroupByName(const BAMFile *cself, const char *name, const BAMReadGroup **rhs)
-{
-    BAMReadGroup rg;
-    
-    *rhs = NULL;
-
-    rg.name = name;
-    if (rg.name != NULL)
-        *rhs = kbsearch(&rg, cself->readGroup, cself->readGroups, sizeof(rg), comp_ReadGroup, NULL);
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetRefSeqCount(const BAMFile *cself, unsigned *rhs)
-{
-    *rhs = cself->refSeqs;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetRefSeq(const BAMFile *cself, unsigned i, const BAMRefSeq **rhs)
-{
-    *rhs = NULL;
-    if (i < cself->refSeqs)
-        *rhs = &cself->refSeq[i];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetReadGroupCount(const BAMFile *cself, unsigned *rhs)
-{
-    *rhs = cself->readGroups;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetReadGroup(const BAMFile *cself, unsigned i, const BAMReadGroup **rhs)
-{
-    *rhs = NULL;
-    if (i < cself->readGroups)
-        *rhs = &cself->readGroup[i];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMFileGetHeaderText(BAMFile const *cself, char const **header, size_t *header_len)
-{
-    *header = cself->header;
-    *header_len = *header ? string_size( *header ) : 0;
-    return 0;
-}
-
-/* MARK: BAM Alignment Stuff */
-
-LIB_EXPORT rc_t CC BAMAlignmentAddRef(const BAMAlignment *cself)
-{
-    if (cself != NULL)
-        atomic32_inc(&((BAMAlignment *)cself)->refcount);
-    return 0;
-}
-
-static rc_t BAMAlignmentWhack(BAMAlignment *self)
-{
-    if (self->parent->bufLocker == self)
-        self->parent->bufLocker = NULL;
-    BAMFileRelease(self->parent);
-    free(self->storage);
-    free(self);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentRelease(const BAMAlignment *cself)
-{
-    if (cself != NULL) {
-        BAMAlignment *self = (BAMAlignment *)cself;
-        
-        if (atomic32_dec_and_test(&self->refcount))
-            BAMAlignmentWhack(self);
-    }
-    return 0;
-}
-
-#if 0
-LIB_EXPORT uint16_t CC BAMAlignmentIffyFields(const BAMAlignment *self)
-{
-}
-
-LIB_EXPORT uint16_t CC BAMAlignmentBadFields(const BAMAlignment *self)
-{
-}
-#endif
-
-static uint32_t BAMAlignmentGetCigarElement(const BAMAlignment *self, unsigned i)
-{
-    return LE2HUI32(&((uint8_t const *)getCigarBase(self))[i * 4]);
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetRefSeqId(const BAMAlignment *cself, int32_t *rhs)
-{
-    *rhs = getRefSeqId(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetPosition(const BAMAlignment *cself, int64_t *rhs)
-{
-    *rhs = getPosition(cself);
-    return 0;
-}
-
-LIB_EXPORT bool CC BAMAlignmentIsMapped(const BAMAlignment *cself)
-{
-    if (((getFlags(cself) & BAMFlags_SelfIsUnmapped) == 0) && getRefSeqId(cself) >= 0 && getPosition(cself) >= 0)
-        return true;
-    return false;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetAlignmentDetail(
-                                                  const BAMAlignment *self,
-                                                  BAMAlignmentDetail *rslt, uint32_t count, uint32_t *actual,
-                                                  int32_t *pfirst, int32_t *plast
-                                                  )
-{
-    unsigned i;
-    unsigned ccnt; /* cigar count */
-    int32_t  gpos; /* refSeq pos in global coordinates */
-    unsigned rpos; /* read pos (always local coordinates) */
-    uint32_t rlen; /* read length */
-    int32_t first = -1;
-    int32_t last = -1;
-
-    if (!self)
-        return RC(rcAlign, rcFile, rcReading, rcSelf, rcNull);
-
-    rlen = getReadLen(self);
-    ccnt = getCigarCount(self);
-    gpos = getPosition(self);
-    
-    if (gpos < 0)
-        ccnt = 0;
-    
-    if (actual)
-        *actual = ccnt;
-    
-    if (pfirst)
-        *pfirst = -1;
-
-    if (plast)
-        *plast = -1;
-
-    if (ccnt == 0)
-        return 0;
-    
-    if (rslt == NULL) {
-        if (actual == NULL)
-            return RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-        count = 0;
-    }
-    
-    if (count < ccnt)
-        return RC(rcAlign, rcFile, rcReading, rcBuffer, rcInsufficient);
-        
-    for (rpos = 0, i = 0; i != ccnt; ++i) {
-        uint32_t len = BAMAlignmentGetCigarElement(self, i);
-        int op = len & 0x0F;
-        
-        if (op > sizeof(cigarChars))
-            return RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-        
-        op = cigarChars[op];
-        len >>= 4;
-        
-        rslt[i].refSeq_pos = gpos;
-        rslt[i].read_pos = rpos;
-        rslt[i].length = len;
-        rslt[i].type = (BAMCigarType)op;
-        
-        switch ((BAMCigarType)op) {
-        case ct_Match:
-        case ct_Equal:
-            if (first == -1)
-                first = i;
-            last = i;
-            gpos += len;
-            rpos += len;
-            break;
-        case ct_Insert:
-        case ct_SoftClip:
-            gpos += len;
-            break;
-        case ct_Delete:
-        case ct_Skip:
-            rpos += len;
-            break;
-        case ct_HardClip:
-        case ct_Padded:
-            rslt[i].refSeq_pos = -1;
-            rslt[i].read_pos = -1;
-            break;
-        default:
-            break;
-        }
-        
-        if (rslt[i].read_pos > rlen)
-            return RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-    }
-    if (pfirst)
-        *pfirst = first;
-    
-    if (plast)
-        *plast = last;
-    
-    return 0;
-}
-
-static
-unsigned ReferenceLengthFromCIGAR(const BAMAlignment *self)
-{
-    unsigned i;
-    unsigned n = getCigarCount(self);
-    unsigned y;
-    
-    for (i = 0, y = 0; i != n; ++i) {
-        uint32_t const len = BAMAlignmentGetCigarElement(self, i);
-        
-        switch (cigarChars[len & 0x0F]) {
-        case ct_Match:
-        case ct_Equal:
-        case ct_NotEqual:
-        case ct_Delete:
-        case ct_Skip:
-            y += len >> 4;
-            break;
-        default:
-            break;
-        }
-    }
-    return y;
-}
-
-static
-unsigned SequenceLengthFromCIGAR(const BAMAlignment *self)
-{
-    unsigned i;
-    unsigned n = getCigarCount(self);
-    unsigned y;
-    
-    for (i = 0, y = 0; i != n; ++i) {
-        uint32_t const len = BAMAlignmentGetCigarElement(self, i);
-        
-        switch (cigarChars[len & 0x0F]) {
-        case ct_Match:
-        case ct_Equal:
-        case ct_NotEqual:
-        case ct_Insert:
-        case ct_SoftClip:
-            y += len >> 4;
-            break;
-        default:
-            break;
-        }
-    }
-    return y;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetPosition2(const BAMAlignment *cself, int64_t *rhs, uint32_t *length)
-{
-    *rhs = getPosition(cself);
-    if (*rhs >= 0)
-        *length = ReferenceLengthFromCIGAR(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetReadGroupName(const BAMAlignment *cself, const char **rhs)
-{
-    *rhs = get_RG(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetReadName(const BAMAlignment *cself, const char **rhs)
-{
-    *rhs = getReadName(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetReadName2(const BAMAlignment *cself, const char **rhs, size_t *length)
-{
-    *length = getReadNameLength(cself) - 1;
-    *rhs = getReadName(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetReadName3(const BAMAlignment *cself, const char **rhs, size_t *length)
-{
-    char const *const name = getReadName(cself);
-    size_t len = getReadNameLength(cself);
-    size_t i;
-    
-    for (i = len; i; ) {
-        int const ch = name[--i];
-        
-        if (ch == '/') {
-            len = i;
-            break;
-        }
-        if (!isdigit(ch))
-            break;
-    }
-    *rhs = name;
-    *length = len;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetFlags(const BAMAlignment *cself, uint16_t *rhs)
-{
-    *rhs = getFlags(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetMapQuality(const BAMAlignment *cself, uint8_t *rhs)
-{
-    *rhs = getMapQual(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCigarCount(const BAMAlignment *cself, unsigned *rhs)
-{
-    *rhs = getCigarCount(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetRawCigar(const BAMAlignment *cself, uint32_t const *rslt[], uint32_t *length)
-{
-    *rslt = getCigarBase(cself);
-    *length = getCigarCount(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCigar(const BAMAlignment *cself, uint32_t i, BAMCigarType *type, uint32_t *length)
-{
-    uint32_t x;
-    
-    if (i >= getCigarCount(cself))
-        return RC(rcAlign, rcFile, rcReading, rcParam, rcInvalid);
-
-    x = BAMAlignmentGetCigarElement(cself, i);
-    *type = (BAMCigarType)(cigarChars[x & 0x0F]);
-    *length = x >> 4;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetReadLength(const BAMAlignment *cself, uint32_t *rhs)
-{
-    *rhs = getReadLen(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetSequence2(const BAMAlignment *cself, char *rhs, uint32_t start, uint32_t stop)
-{
-    /*
-     *   =    A    C    M    G    R    S    V    T    W    Y    H    K    D    B    N
-     * 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
-     * 1111 1000 0100 1100 0010 1010 0110 1110 0001 1001 0101 1101 0011 1011 0111 0000
-     *   N    T    G    K    C    Y    S    B    A    W    R    D    M    H    V    =
-     */
-    static const char  tr[16] = "=ACMGRSVTWYHKDBN";
- /* static const char ctr[16] = "=TGKCYSBAWRDMHVN"; */
-    unsigned const n = getReadLen(cself);
-    const uint8_t * const seq = &cself->data->raw[cself->seq];
-    unsigned si, di;
-    
-    if (stop == 0 || stop > n)
-        stop = n;
-    
-    for (di = 0, si = start; si != stop; ++si, ++di) {
-        unsigned const b4na2 = seq[si >> 1];
-        unsigned const b4na = (si & 1) == 0 ? (b4na2 >> 4) : (b4na2 & 0x0F);
-        
-        rhs[di] = tr[b4na];
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetSequence(const BAMAlignment *cself, char *rhs)
-{
-    return BAMAlignmentGetSequence2(cself, rhs, 0, 0);
-}
-
-LIB_EXPORT bool CC BAMAlignmentHasColorSpace(BAMAlignment const *cself)
-{
-    return get_CS(cself) != NULL;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCSKey(BAMAlignment const *cself, char rhs[1])
-{
-    char const *const vCS = get_CS(cself);
-    
-    if (vCS)
-        rhs[0] = vCS[0];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCSSeqLen(BAMAlignment const *cself, uint32_t *rhs)
-{
-    struct offset_size_s const *const vCS = get_CS_info(cself);
-    
-    *rhs = vCS ? vCS->size - 5 : 0;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCSSequence(BAMAlignment const *cself, char rhs[], uint32_t seqlen)
-{
-    char const *const vCS = get_CS(cself);
-    
-    if (vCS) {
-        unsigned i;
-        
-        for (i = 0;i != seqlen; ++i) {
-            char const ch = vCS[i+1];
-            
-            rhs[i] = (ch == '4') ? '.' : ch;
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetQuality(const BAMAlignment *cself, const uint8_t **rhs)
-{
-    *rhs = &cself->data->raw[cself->qual];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetQuality2(BAMAlignment const *cself, uint8_t const **rhs, uint8_t *offset)
-{
-    uint8_t const *const OQ = get_OQ(cself);
-    
-    if (OQ) {
-        struct offset_size_s const *const oq = get_OQ_info(cself);
-        
-        if (oq->size - 4 == getReadLen(cself)) {
-            *offset = 33;
-            *rhs = OQ;
-        }
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInconsistent);
-    }
-    else {
-        *offset = 0;
-        *rhs = &cself->data->raw[cself->qual];
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetCSQuality(BAMAlignment const *cself, uint8_t const **rhs, uint8_t *offset)
-{
-    struct offset_size_s const *const cs = get_CS_info(cself);
-    struct offset_size_s const *const cq = get_CQ_info(cself);
-    uint8_t const *const CQ = get_CQ(cself);
-    
-    if (cs && cq && CQ) {
-        if (cs->size == cq->size) {
-            *offset = 33;
-            *rhs = CQ + 1;
-            return 0;
-        }
-        if (cs->size == cq->size + 1) {
-            *offset = 33;
-            *rhs = CQ;
-            return 0;
-        }
-        return RC(rcAlign, rcRow, rcReading, rcData, rcInconsistent);
-    }
-    *offset = 0;
-    *rhs = &cself->data->raw[cself->qual];
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetMateRefSeqId(const BAMAlignment *cself, int32_t *rhs)
-{
-    *rhs = getMateRefSeqId(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetMatePosition(const BAMAlignment *cself, int64_t *rhs)
-{
-    *rhs = getMatePos(cself);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentGetInsertSize(const BAMAlignment *cself, int64_t *rhs)
-{
-    *rhs = getInsertSize(cself);
-    return 0;
-}
-
-typedef struct OptForEach_ctx_s {
-    BAMOptData *val;
-    BAMOptData **alloced;
-    size_t valsize;
-    rc_t rc;
-    BAMOptionalDataFunction user_f;
-    void *user_ctx;
-} OptForEach_ctx_t;
-
-static bool i_OptDataForEach(BAMAlignment const *cself, void *Ctx, char const tag[2], BAMOptDataValueType type, unsigned count, void const *value, unsigned size)
-{
-    OptForEach_ctx_t *ctx = (OptForEach_ctx_t *)Ctx;
-    size_t const need = (size_t)&((BAMOptData const *)NULL)->u.f64[(count * size + sizeof(double) - 1)/sizeof(double)];
-    
-    if (need > ctx->valsize) {
-        void *const temp = realloc(ctx->alloced, need);
-        if (temp == NULL) {
-            ctx->rc = RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-            return true;
-        }
-        *ctx->alloced = ctx->val = temp;
-        ctx->valsize = need;
-    }
-    ctx->val->type = type;
-    ctx->val->element_count = (type == dt_CSTRING || type == dt_HEXSTRING) ? size - 1 : count;
-    
-    memcpy(ctx->val->u.u8, value, size * count);
-#if __BYTE_ORDER == __BIG_ENDIAN
-    {{
-        unsigned di;
-	uint32_t elem_count = ctx->val->element_count;
-        
-        switch (size) {
-        case 2:
-            for (di = 0; di != elem_count; ++di)
-                ctx->val->u.u16[di] = LE2HUI16(&ctx->val->u.u16[di]);
-            break;
-        case 4:
-            for (di = 0; di != elem_count; ++di)
-                ctx->val->u.u32[di] = LE2HUI32(&ctx->val->u.u32[di]);
-            break;
-        case 8:
-            for (di = 0; di != elem_count; ++di)
-                ctx->val->u.u64[di] = LE2HUI64(&ctx->val->u.u64[di]);
-            break;
-        }
-    }}
-#endif
-    ctx->rc = ctx->user_f(ctx->user_ctx, tag, ctx->val);
-    return ctx->rc != 0;
-}
-
-LIB_EXPORT rc_t CC BAMAlignmentOptDataForEach(const BAMAlignment *cself, void *user_ctx, BAMOptionalDataFunction f)
-{
-    union u {
-        BAMOptData value;
-        uint8_t storage[4096];
-    } value_auto;
-    OptForEach_ctx_t ctx;
-    rc_t rc = 0;
-    unsigned i;
-    
-    ctx.val = &value_auto.value;
-    ctx.alloced = NULL;
-    ctx.valsize = sizeof(value_auto);
-    ctx.rc = 0;
-    ctx.user_f = f;
-    ctx.user_ctx = user_ctx;
-    
-    for (i = 0; i != cself->numExtra; ++i) {
-        char const *const tag = (char const *)&cself->data->raw[cself->extra[i].offset];
-        uint8_t type = tag[2];
-        uint8_t const *const vp = (uint8_t const *)&tag[3];
-        unsigned len = cself->extra[i].size - 3;
-        unsigned size = cself->extra[i].size - 3;
-        unsigned count = 1;
-        unsigned offset = 0;
-        
-        if (type == dt_NUM_ARRAY) {
-            unsigned elem_size = 0;
-            uint32_t elem_count = 0;
-            
-            offset = len = 5;
-            switch (vp[0]) {
-            case dt_INT8:
-            case dt_UINT8:
-                elem_size = 1;
-                break;
-            case dt_INT16:
-            case dt_UINT16:
-                elem_size = 2;
-                break;
-            case dt_FLOAT32:
-            case dt_INT:
-            case dt_UINT:
-                elem_size = 4;
-                break;
-            case dt_FLOAT64:
-                elem_size = 8;
-                break;
-            default:
-                rc = RC(rcAlign, rcFile, rcReading, rcData, rcUnexpected);
-                break;
-            }
-            if (rc)
-                break;
-            elem_count = LE2HUI32(&vp[1]);
-            len += elem_size * elem_count;
-            type = vp[0];
-            count = elem_count;
-            size = elem_size;
-            break;
-        }
-        if (i_OptDataForEach(cself, &ctx, tag, type, count, &vp[offset], size))
-            break;
-    }
-    rc = rc ? rc : ctx.rc;
-    if (ctx.alloced)
-        free(ctx.alloced);
-    return rc;
-}
-
-LIB_EXPORT bool CC BAMAlignmentHasCGData(BAMAlignment const *self)
-{
-    return get_CG_GC_info(self) && get_CG_GS_info(self) && get_CG_GQ_info(self);
-}
-
-static bool BAMAlignmentParseCGTag(BAMAlignment const *self, size_t const max_cg_segs, unsigned cg_segs[/* max_cg_segs */])
-{
-    /*** patern in cg_segs should be nSnGnSnG - no more then 7 segments **/
-    struct offset_size_s const *const GCi = get_CG_GC_info(self);
-    char const *cg  = (char const *)&self->data->raw[GCi->offset + 3];
-    char const *const end = cg + GCi->size - 4;
-    unsigned iseg = 0;
-    char last_op = 'S';
-
-    memset(cg_segs, 0, max_cg_segs * sizeof(cg_segs[0]));
-    
-    while (cg < end && iseg < max_cg_segs) {
-        char *endp;
-        long const op_len = strtol(cg, &endp, 10);
-        char const op = *(cg = endp);
-        
-        ++cg;
-        if (op==last_op) {
-            cg_segs[iseg] += op_len;
-        }
-        else {
-            last_op = op;
-            ++iseg;
-            cg_segs[iseg] = (unsigned)op_len;
-        }
-    }
-    return true;
-}
-
-static
-rc_t ExtractInt32(BAMAlignment const *self, int32_t *result,
-                  struct offset_size_s const *const tag)
-{
-    int64_t y;
-    int const type = self->data->raw[tag->offset + 2];
-    void const *const pvalue = &self->data->raw[tag->offset + 3];
-    
-    switch (type) {
-    case 'c':
-        if (tag->size == 4)
-            y = *((int8_t const *)pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    case 'C':
-        if (tag->size == 4)
-            y = *((uint8_t const *)pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    case 's':
-        if (tag->size == 5)
-            y = LE2HI16(pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    case 'S':
-        if (tag->size == 5)
-            y = LE2HUI16(pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    case 'i':
-        if (tag->size == 7)
-            y = LE2HI32(pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    case 'I':
-        if (tag->size == 7)
-            y = LE2HUI32(pvalue);
-        else
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        break;
-    default:
-        return RC(rcAlign, rcRow, rcReading, rcData, rcNotFound);
-    }
-    if (INT32_MIN <= y && y <= INT32_MAX) {
-        *result = (int32_t)y;
-        return 0;
-    }
-    return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-}
-
-LIB_EXPORT
-rc_t CC BAMAlignmentGetCGAlignGroup(BAMAlignment const *self,
-                                    char buffer[],
-                                    size_t max_size,
-                                    size_t *act_size)
-{
-    struct offset_size_s const *const ZA = get_CG_ZA_info(self);
-    struct offset_size_s const *const ZI = get_CG_ZI_info(self);
-    
-    if (ZA && ZI) {
-        rc_t rc;
-        int32_t za;
-        int32_t zi;
-        
-        rc = ExtractInt32(self, &za, ZA); if (rc) return rc;
-        rc = ExtractInt32(self, &zi, ZI); if (rc) return rc;
-        return string_printf(buffer, max_size, act_size, "%i_%i", zi, za);
-    }
-    return RC(rcAlign, rcRow, rcReading, rcData, rcNotFound);
-}
-
-LIB_EXPORT
-rc_t CC BAMAlignmentGetCGSeqQual(BAMAlignment const *self,
-                                 char sequence[],
-                                 uint8_t quality[])
-{
-    struct offset_size_s const *const GCi = get_CG_GC_info(self);
-    struct offset_size_s const *const GSi = get_CG_GS_info(self);
-    struct offset_size_s const *const GQi = get_CG_GQ_info(self);
-    
-    if (GCi && GSi && GQi) {
-        char const *const vGS = (char const *)&self->data->raw[GSi->offset + 3];
-        char const *const GQ  = (char const *)&self->data->raw[GQi->offset + 3];
-        unsigned const GSsize = GSi->size - 4;
-        unsigned const sn = getReadLen(self);
-        unsigned cg_segs[2*CG_NUM_SEGS-1]; /** 4 segments + 3gaps **/
-        unsigned i,G,S;
-        
-        if (GSi->size != GQi->size)
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        
-        if (SequenceLengthFromCIGAR(self) != sn)
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-
-        if (!BAMAlignmentParseCGTag(self, 2*CG_NUM_SEGS-1, cg_segs))
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        
-        for (S = cg_segs[0], G = 0, i = 1; i < CG_NUM_SEGS; ++i) { /** sum all S and G **/
-            S += cg_segs[2*i];
-            G += cg_segs[2*i-1];
-        }
-        if (G + G != GSsize || S + G > sn || sn + G != 35) {
-            /*fprintf(stderr, "GSsize: %u; sn: %u; S: %u; G: %u\n", GSsize, sn, S, G);*/
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-        }
-        if (G > 0) {
-            unsigned nsi = cg_segs[0];   /** new index into sequence */
-            unsigned osi = nsi + G;      /** old index into sequence */
-            unsigned k;                  /** index into inserted sequence **/
-            
-            /***make room for inserts **/
-            memmove(sequence + osi, sequence + nsi, sn - nsi);
-            memmove(quality  + osi, quality  + nsi, sn - nsi);
-            
-            for (i = 1, k = 0; i < CG_NUM_SEGS && nsi < osi; ++i) {/*** when osi and nsi meet we are done ***/
-                unsigned j;
-                
-                for (j = cg_segs[2*i-1]; j > 0; --j) { /** insert mode **/
-                    sequence[nsi] = vGS[k];
-                    quality [nsi] = GQ[k] - 33;
-                    ++nsi; ++k;
-                    sequence[nsi] = vGS[k];
-                    quality [nsi] = GQ[k] - 33;
-                    ++nsi;
-                    ++osi;
-                    ++k;
-                }
-                if (nsi < osi){
-                    for (j = cg_segs[2*i]; j > 0; --j) { /** copy mode **/
-                        sequence[nsi] = sequence[osi];
-                        quality[nsi]  = quality[osi];
-                        ++nsi;
-                        ++osi;
-                    }
-                }
-            }
-        }
-        return 0;
-    }
-    return RC(rcAlign, rcRow, rcReading, rcData, rcNotFound);
-}
-
-
-static unsigned splice(uint32_t cigar[], unsigned n, unsigned at, unsigned out, unsigned in, uint32_t const new_values[/* in */])
-{
-    assert(at + out <= n);
-    memmove(&cigar[at + in], &cigar[at + out], (n - at - out) * 4);
-    if (in)
-        memcpy(&cigar[at], new_values, in * 4);
-    return n + in - out;
-}
-
-#define OPCODE_2_FIX (0xF)
-
-static unsigned insert_B(unsigned S, unsigned G, unsigned const n, uint32_t cigar[/* n */])
-{
-    unsigned i;
-    unsigned pos;
-    unsigned const T = S + G;
-    
-    for (pos = i = 0; i < n; ++i) {
-        int const opcode = cigar[i] & 0xF;
-        
-        switch (opcode) {
-        case 0:
-        case 1:
-        case 4:
-        case 7:
-        case 8:
-            {{
-                unsigned const len = cigar[i] >> 4;
-                unsigned const nxt = pos + len;
-                
-                if (pos <= T && T <= nxt) {
-                    unsigned const l = T - pos;
-                    unsigned const r = len - l;
-                    unsigned B = i + 2;
-                    unsigned in = 4;
-                    uint32_t Ops[4];
-                    uint32_t *ops = Ops;
-                    
-                    Ops[0] = (l << 4) | opcode;
-                    Ops[1] = (G << 4) | 9; /* B */
-                    Ops[2] = (G << 4) | 0; /* M this is not backwards */
-                    Ops[3] = (r << 4) | opcode;
-                    
-                    if (r == 0)
-                        --in;
-                    if (l == 0) {
-                        ++ops;
-                        --in;
-                        --B;
-                    }
-                    return splice(cigar, n, i, 1, in, ops);
-                }
-                pos = nxt;
-            }}
-            break;
-        default:
-            break;
-        }
-    }
-    return n;
-}
-
-static unsigned fix_I(uint32_t cigar[], unsigned n)
-{
-    unsigned i;
-    int last_b = 0;
-    
-    for (i = 0; i < n; ++i) {
-        unsigned const opcode = cigar[i] & 0xF;
-        
-        if (opcode == 0xF) {
-            unsigned const oplen = cigar[i] >> 4;
-            uint32_t ops[2];
-            
-            if (0/*last_b*/) {
-                ops[0] = (oplen << 4) | 0; /* M */
-                ops[1] = (oplen << 4) | 9; /* B */
-            }
-            else {
-                ops[0] = (oplen << 4) | 9; /* B */
-                ops[1] = (oplen << 4) | 0; /* M */
-            }
-            
-            n = splice(cigar, n, i, 1, 2, ops);
-            ++i;
-        }
-        else if (opcode == 9)
-            last_b = 1;
-        else
-            last_b = 0;
-    }
-    return n;
-}
-
-static unsigned fix_IN(uint32_t cigar[], unsigned n)
-{
-    unsigned i;
-    
-    for (i = 1; i < n; ++i) {
-        unsigned const opL = cigar[i-1] & 0xF;
-        unsigned const opI = cigar[ i ] & 0xF;
-        
-        if (opL == 1 && opI == 3) {
-            unsigned const oplen = cigar[i-1] >> 4;
-            uint32_t ops[2];
-            
-            ops[0] = (oplen << 4) | 9; /* B */
-            ops[1] = (oplen << 4) | 0; /* M */
-            
-            n = splice(cigar, n, i-1, 1, 2, ops);
-            ++i;
-        }
-        else if (opL == 3 && opI == 1) {
-            unsigned const oplen = cigar[i] >> 4;
-            uint32_t ops[2];
-            
-            ops[0] = (oplen << 4) | 9; /* M */
-            ops[1] = (oplen << 4) | 0; /* B */
-            
-            n = splice(cigar, n, i, 1, 2, ops);
-            ++i;
-        }
-    }
-    return n;
-}
-
-static unsigned canonicalize(uint32_t cigar[], unsigned n)
-{
-    unsigned i;
-    
-    for (i = n; i > 0; ) {
-        --i;
-        if (cigar[i] >> 4 == 0 || (cigar[i] & 0xF) == 6)
-            n = splice(cigar, n, i, 1, 0, NULL);
-    }
-    for (i = 1; i < n; ) {
-        unsigned const opL = cigar[i-1] & 0xF;
-        unsigned const opI = cigar[ i ] & 0xF;
-        
-        if (opI == opL) {
-            unsigned const oplen = (cigar[i] >> 4) + (cigar[i-1] >> 4);
-            uint32_t const op = (oplen << 4) | opI;
-
-            n = splice(cigar, n, i-1, 2, 1, &op);
-        }
-        else
-            ++i;
-    }
-#if 0
-    if ((cigar[0] & 0xF) == 1)
-        cigar[0] = (cigar[0] & ~(uint32_t)0xF) | 4; /* I -> S */
-    if ((cigar[n - 1] & 0xF) == 1)
-        cigar[n - 1] = (cigar[n - 1] & ~(uint32_t)0xF) | 4; /* I -> S */
-#endif
-    return n;
-}
-
-static void reverse(uint32_t cigar[], unsigned n)
-{
-    unsigned i;
-    unsigned j;
-    
-    for (j = n - 1, i = 0; i < j; ++i, --j) {
-        uint32_t const tmp = cigar[i];
-        cigar[i] = cigar[j];
-        cigar[j] = tmp;
-    }
-}
-
-static unsigned GetCGCigar(BAMAlignment const *self, unsigned const N, uint32_t cigar[/* N */])
-{
-    unsigned i;
-    unsigned G;
-    unsigned S;
-    unsigned n = getCigarCount(self);
-    unsigned cg_segs[2*CG_NUM_SEGS-1]; /** 4 segments + 3 gaps **/
-    
-    if (!BAMAlignmentParseCGTag(self, 2*CG_NUM_SEGS-1, cg_segs))
-        return RC(rcAlign, rcRow, rcReading, rcData, rcInvalid);
-    
-    if (N < n + 5)
-        return RC(rcAlign, rcRow, rcReading, rcBuffer, rcInsufficient);
-    
-    memcpy(cigar, getCigarBase(self), n * 4);
-    n = canonicalize(cigar, n); /* just in case */
-    for (i = 0, S = 0; i < CG_NUM_SEGS - 1; ++i) {
-        S += cg_segs[2*i];
-        G  = cg_segs[2*i+1];
-        if (G > 0) {
-            n = insert_B(S, G, n, cigar);
-            S += G;
-        }
-    }
-    return n;
-}
-
-LIB_EXPORT
-rc_t CC BAMAlignmentGetCGCigar(BAMAlignment const *self,
-                               uint32_t *cigar,
-                               uint32_t cig_max,
-                               uint32_t *cig_act)
-{
-    struct offset_size_s const *const GCi = get_CG_GC_info(self);
-    
-    *cig_act = 0;
-    
-    if (GCi) {
-        *cig_act = GetCGCigar(self, cig_max, cigar);
-        return 0;
-    }
-    return RC(rcAlign, rcRow, rcReading, rcData, rcNotFound);
-}
-
-
-LIB_EXPORT rc_t BAMAlignmentGetTI(BAMAlignment const *self, uint64_t *ti)
-{
-    char const *const TI = get_XT(self);
-    long long unsigned temp;
-    
-    if (TI && sscanf(TI, "ti|%llu", &temp) == 1) {
-        *ti = (uint64_t)temp;
-        return 0;
-    }
-    return RC(rcAlign, rcRow, rcReading, rcData, rcNotFound);
-}
-
-/* MARK: BAMIndex stuff */
-
-static uint64_t get_pos(uint8_t const buf[])
-{
-    return LE2HUI64(buf);
-}
-
-#define MAX_BIN 37449
-static uint16_t bin2ival(uint16_t bin)
-{
-    if (bin < 1)
-        return 0; /* (bin - 0) << 15; */
-    
-    if (bin < 9)
-        return (bin - 1) << 12;
-    
-    if (bin < 73)
-        return (bin - 9) << 9;
-    
-    if (bin < 585)
-        return (bin - 73) << 6;
-    
-    if (bin < 4681)
-        return (bin - 585) << 3;
-    
-    if (bin < 37449)
-        return (bin - 4681) << 0;
-    
-    return 0;
-}
-
-static uint16_t bin_ival_count(uint16_t bin)
-{
-    if (bin < 1)
-        return 1 << 15;
-    
-    if (bin < 9)
-        return 1 << 12;
-    
-    if (bin < 73)
-        return 1 << 9;
-    
-    if (bin < 585)
-        return 1 << 6;
-    
-    if (bin < 4681)
-        return 1 << 3;
-    
-    if (bin < 37449)
-        return 1;
-    
-    return 0;
-}
-
-enum BAMIndexStructureTypes {
-    bai_StartStopPairs,
-    bai_16kIntervals
-};
-
-typedef rc_t (*WalkIndexStructureCallBack)(const uint8_t data[], size_t dlen,
-                                           unsigned refNo,
-                                           unsigned refs,
-                                           enum BAMIndexStructureTypes type,
-                                           unsigned binNo,
-                                           unsigned bins,
-                                           unsigned elements,
-                                           void *ctx);
-
-static
-rc_t WalkIndexStructure(uint8_t const buf[], size_t const blen,
-                        WalkIndexStructureCallBack func,
-                        void *ctx
-                        )
-{
-    unsigned cp = 0;
-    int32_t nrefs;
-    unsigned i;
-    rc_t rc;
-    
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index data length: %u", blen));
-
-    if (cp + 4 > blen)
-        return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-    
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index signature: '%c%c%c%u'", buf[cp+0], buf[cp+1], buf[cp+2], buf[cp+3]));
-    if (memcmp(buf + cp, "BAI\1", 4) != 0)
-        return RC(rcAlign, rcIndex, rcReading, rcFormat, rcUnknown);
-    
-    cp += 4;
-    if (cp + 4 > blen)
-        return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-
-    nrefs = LE2HI32(buf + cp); cp += 4;
-    DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index reference count: %i", nrefs));
-    
-    if (nrefs == 0)
-        return RC(rcAlign, rcIndex, rcReading, rcData, rcEmpty);
-    
-    for (i = 0; i < nrefs; ++i) {
-        int32_t bins;
-        int32_t chunks;
-        int32_t intervals;
-        unsigned di;
-        
-        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index reference %u: starts at %u", i, cp));
-        if (cp + 4 > blen)
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-        
-        bins = LE2HI32(buf + cp); cp += 4;
-        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index reference %u: %i bins", i, nrefs));
-
-        for (di = 0; di < bins; ++di) {
-            uint32_t binNo;
-            
-            if (cp + 8 > blen)
-                return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-
-            binNo = LE2HUI32(buf + cp); cp += 4;
-            chunks = LE2HI32(buf + cp); cp += 4;
-            DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index reference %u, bin %u: %i chunks", i, binNo, chunks));
-            
-            if (cp + 16 * chunks > blen)
-                return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-            rc = func(&buf[cp], 16 * chunks, i, nrefs, bai_StartStopPairs, binNo, bins, chunks, ctx);
-            if (rc)
-                return rc;
-            cp += 16 * chunks;
-        }
-        if (cp + 4 > blen)
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-
-        intervals = LE2HI32(buf + cp); cp += 4;
-        DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_BAM), ("Index reference %u: %i intervals", i, intervals));
-
-        if (cp + 8 * intervals > blen)
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-        rc = func(&buf[cp], 8 * intervals, i, nrefs, bai_16kIntervals, ~(unsigned)0, bins, intervals, ctx);
-        if (rc)
-            return rc;
-        cp += 8 * intervals;
-    }
-    if (cp > blen)
-        return RC(rcAlign, rcIndex, rcReading, rcData, rcInsufficient);
-    return 0;
-}
-
-struct LoadIndex1_s {
-    const BAMFile *self;
-    int refNo;
-    unsigned refs;
-    unsigned intervals;
-    unsigned total_interval_count;
-};
-
-static
-rc_t LoadIndex1(const uint8_t data[], size_t dlen, unsigned refNo,
-                unsigned refs, enum BAMIndexStructureTypes type,
-                unsigned binNo, unsigned bins,
-                unsigned elements, void *Ctx)
-{
-    struct LoadIndex1_s *ctx = (struct LoadIndex1_s *)Ctx;
-    
-    ctx->refs = refs;
-    if (refNo != ctx->refNo) {
-        ctx->total_interval_count += ctx->intervals;
-        ctx->intervals = 0;
-        ctx->refNo = refNo;
-    }
-    if (elements != 0) {
-        if (refNo > ctx->self->refSeqs)
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcInvalid);
-        ctx->intervals = (ctx->self->refSeq[refNo].length + 16383) >> 14;
-        if (type == bai_16kIntervals && elements > ctx->intervals)
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcExcessive);
-    }
-    return 0;
-}
-
-struct LoadIndex2_s {
-    const BAMFile *self;
-    BAMFilePosition **refSeq;
-    BAMFilePosition *cur;
-#if _DEBUGGING
-    BAMFilePosition *end;
-#endif
-    const uint8_t *base;
-    unsigned bins[MAX_BIN + 1];
-    bool hasData;
-};
-
-static
-rc_t LoadIndex2a(const uint8_t data[], size_t dlen, unsigned refNo,
-                 unsigned refs, enum BAMIndexStructureTypes type,
-                 unsigned binNo, unsigned bins,
-                 unsigned elements, struct LoadIndex2_s *ctx)
-{
-    const unsigned max_ival = (ctx->self->refSeq[refNo].length + 16383) >> 14;
-    unsigned i;
-    unsigned cp;
-    unsigned k;
-    uint32_t chunk_count;
-    uint64_t minOffset[1u << 15];
-
-    assert(ctx->refSeq[refNo] == NULL);
-    ctx->refSeq[refNo] = ctx->cur;
-    ctx->cur += max_ival;
-    
-#if _DEBUGGING
-    assert(refNo < ctx->self->refSeqs);
-    assert(ctx->cur <= ctx->end);
-    assert(elements <= max_ival);
-#endif
-    /* get the positions of the first records in the 16kbp intervals */
-    for (cp = i = 0; i != elements; ++i, cp += 8)
-        ctx->refSeq[refNo][i] = get_pos(&data[cp]);
-    /* get the positions of the first records in the 16kbp bins */
-    for (i = MAX_BIN; i != 0; ) {
-        const unsigned ival = bin2ival(--i);
-        const unsigned n_ival = bin_ival_count(i);
-        uint64_t found;
-        
-        cp = ctx->bins[i];
-        if (cp == 0)
-            continue;
-        if (n_ival > 1)
-            break;
-        
-        assert(i == LE2HI32(ctx->base + cp));
-        cp += 4;
-        chunk_count = LE2HI32(ctx->base + cp); cp += 4;
-        found = ctx->refSeq[refNo][ival];
-        for (k = 0; k < chunk_count; ++k) {
-            const uint64_t start = get_pos(ctx->base + cp);
-            
-            cp += 16;
-            if (found == 0 || start < found)
-                found = start;
-        }
-        ctx->refSeq[refNo][ival] = found;
-    }
-    /* The interval list now contains the offsets to the first alignment
-     * that starts at or after the interval's starting position.
-     * An interval's starting position is 16kpb * interval number.
-     *
-     * We will now use the information from the bigger bins to find the
-     * offsets of the first chunk of alignments that ends after an
-     * interval's first alignment.
-     */
-    memset(minOffset, 0, sizeof(minOffset));
-    for (i = 0; i != MAX_BIN; ++i) {
-        const unsigned ival = bin2ival(i);
-        unsigned n_ival = bin_ival_count(i);
-        
-        cp = ctx->bins[i];
-        if (cp == 0)
-            continue;
-        if (n_ival <= 1)
-            break;
-        
-        if (ival + n_ival > max_ival)
-            n_ival = max_ival - ival;
-        
-        chunk_count = LE2HI32(ctx->base + cp + 4); cp += 8;
-        for (k = 0; k < chunk_count; ++k) {
-            const uint64_t start = get_pos(ctx->base + cp);
-            const uint64_t end   = get_pos(ctx->base + cp + 8);
-            unsigned l;
-            
-            cp += 16;
-            for (l = 0; l != n_ival; ++l) {
-                if (start < ctx->refSeq[refNo][ival + l] &&
-                    ctx->refSeq[refNo][ival + l] <= end &&
-                    (start < minOffset[ival + l] ||
-                     minOffset[ival + l] == 0
-                     )
-                    )
-                {
-                    minOffset[ival + l] = start;
-                }
-            }
-        }
-    }
-    /* update the intervals to the new earlier offsets if any */
-    for (i = 0; i != max_ival; ++i) {
-        if (minOffset[i] != 0)
-            ctx->refSeq[refNo][i] = minOffset[i];
-    }
-    memset(ctx->bins, 0, sizeof(ctx->bins));
-    ctx->hasData = false;
-    return 0;
-}
-
-static
-rc_t LoadIndex2(const uint8_t data[], size_t dlen, unsigned refNo,
-                unsigned refs, enum BAMIndexStructureTypes type,
-                unsigned binNo, unsigned bins,
-                unsigned elements, void *Ctx)
-{
-    struct LoadIndex2_s *ctx = (struct LoadIndex2_s *)Ctx;
-    
-    if (type == bai_StartStopPairs) {
-        if (binNo < MAX_BIN && elements != 0) {
-            ctx->bins[binNo] = &data[-8] - ctx->base;
-            ctx->hasData = true;
-        }
-    }
-    else if (elements != 0 || ctx->hasData)
-        return LoadIndex2a(data, dlen, refNo, refs, type, binNo, bins,
-                           elements, (struct LoadIndex2_s *)Ctx);
-    return 0;
-}    
-
-static
-rc_t LoadIndex(BAMFile *self, const uint8_t buf[], size_t blen)
-{
-    BAMIndex *idx;
-    rc_t rc;
-    struct LoadIndex1_s loadIndex1ctx;
-    unsigned const posArray = ((uintptr_t)&((const BAMFilePosition **)(NULL))[self->refSeqs]) / sizeof(BAMFilePosition *);
-
-    memset(&loadIndex1ctx, 0, sizeof(loadIndex1ctx));
-    loadIndex1ctx.refNo = -1;
-    loadIndex1ctx.self = self;
-    
-    rc = WalkIndexStructure(buf, blen, LoadIndex1, &loadIndex1ctx);
-    if (rc == 0) {
-        loadIndex1ctx.total_interval_count += loadIndex1ctx.intervals;
-        idx = calloc(1, posArray * sizeof(BAMFilePosition *) +
-                     loadIndex1ctx.total_interval_count * sizeof(BAMFilePosition));
-        if (idx == NULL)
-            rc = RC(rcAlign, rcIndex, rcReading, rcMemory, rcExhausted);
-        else {
-            struct LoadIndex2_s *loadIndex2ctx;
-            
-            if (self->ndx)
-                BAMIndexWhack(self->ndx);
-            self->ndx = idx;
-            
-            loadIndex2ctx = malloc(sizeof(*loadIndex2ctx));
-            if (loadIndex2ctx == NULL) {
-                rc = RC(rcAlign, rcIndex, rcReading, rcMemory, rcExhausted);
-                free(idx);
-                self->ndx = NULL;
-            }
-            else {
-                memset(loadIndex2ctx->bins, 0, sizeof(loadIndex2ctx->bins));
-                loadIndex2ctx->self = self;
-                loadIndex2ctx->refSeq = &idx->refSeq[0];
-                loadIndex2ctx->base = buf;
-                loadIndex2ctx->hasData = false;
-                loadIndex2ctx->cur = (BAMFilePosition *)&idx->refSeq[posArray];
-#if _DEBUGGING
-                loadIndex2ctx->end = loadIndex2ctx->cur + loadIndex1ctx.total_interval_count;
-#endif
-                
-                WalkIndexStructure(buf, blen, LoadIndex2, loadIndex2ctx);
-                free(loadIndex2ctx);
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t BAMFileOpenIndexInternal(const BAMFile *self, const char *path)
-{
-    const KFile *kf;
-    rc_t rc;
-    size_t fsize;
-    uint8_t *buf;
-    KDirectory *dir;
-    
-    rc = KDirectoryNativeDir(&dir);
-    if (rc) return rc;
-    rc = KDirectoryOpenFileRead(dir, &kf, path);
-    KDirectoryRelease(dir);
-    if (rc) return rc;
-    {
-        uint64_t u64;
-
-        rc = KFileSize(kf, &u64);
-        if (sizeof(size_t) < sizeof(u64) && (size_t)u64 != u64) {
-            KFileRelease(kf);
-            return RC(rcAlign, rcIndex, rcReading, rcData, rcExcessive);
-        }
-        fsize = u64;
-    }
-    if (rc == 0) {
-        buf = malloc(fsize);
-        if (buf != NULL) {
-            size_t nread;
-            
-            rc = KFileRead(kf, 0, buf, fsize, &nread);
-            KFileRelease(kf);
-            if (rc == 0) {
-                if (nread == fsize) {
-                    rc = LoadIndex((BAMFile *)self, buf, nread);
-                    free(buf);
-                    return rc;
-                }
-                rc = RC(rcAlign, rcIndex, rcReading, rcData, rcInvalid);
-            }
-            free(buf);
-        }
-        else
-            rc = RC(rcAlign, rcIndex, rcReading, rcMemory, rcExhausted);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileOpenIndex(const BAMFile *self, const char *path)
-{
-    return BAMFileOpenIndexInternal(self, path);
-}
-
-LIB_EXPORT rc_t CC BAMFileOpenIndexWithVPath(const BAMFile *self, const VPath *kpath)
-{
-    char path[4096];
-    size_t nread;
-    rc_t rc = VPathReadPath(kpath, path, sizeof(path), &nread);
-
-    if (rc == 0) {
-        path[nread] = '\0';
-        rc = BAMFileOpenIndexInternal(self, path);
-    }
-    return rc;
-}
-
-LIB_EXPORT bool CC BAMFileIsIndexed(const BAMFile *self)
-{
-	if (self && self->ndx)
-		return true;
-	return false;
-}
-
-LIB_EXPORT bool CC BAMFileIndexHasRefSeqId(const BAMFile *self, uint32_t refSeqId)
-{
-	if (self && self->ndx && self->ndx->refSeq[refSeqId])
-		return true;
-	return false;
-}
-
-static rc_t BAMFileGetAlignPos(const BAMFile *self, int64_t *beg, int64_t *end, int32_t *refSeq)
-{
-    const BAMAlignment *check;
-    rc_t rc;
-    
-    rc = BAMFileRead(self, &check);
-    if (rc)
-        return rc;
-    BAMAlignmentGetPosition(check, beg);
-    BAMAlignmentGetRefSeqId(check, refSeq);
-    *end = *beg + ReferenceLengthFromCIGAR(check);
-    BAMAlignmentRelease(check);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC BAMFileSeek(const BAMFile *self, uint32_t refSeqId, uint64_t alignStart, uint64_t alignEnd)
-{
-    BAMFilePosition rpos = 0;
-    rc_t rc;
-    int64_t prev_alignPos;
-    int64_t alignPos;
-    int64_t alignEndPos;
-    int32_t refSeq;
-    
-    if (self->ndx == NULL)
-        return RC(rcAlign, rcFile, rcPositioning, rcIndex, rcNotFound);
-    if (refSeqId >= self->refSeqs)
-        return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-    if (self->ndx->refSeq[refSeqId] == NULL)
-        return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-    if (alignStart >= self->refSeq[refSeqId].length)
-        return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-    if (alignEnd > self->refSeq[refSeqId].length)
-        alignEnd = self->refSeq[refSeqId].length;
-    
-    {{
-        unsigned adjust = 0;
-        uint32_t ival_start = (uint32_t)(alignStart >> 14);
-        uint32_t ival_end = (uint32_t)((alignEnd + 16383) >> 14);
-        
-        /* find the first interval >= alignStart that has an alignment */
-        while (ival_start != ival_end && (rpos = self->ndx->refSeq[refSeqId][ival_start]) == 0)
-            ++ival_start;
-        
-        if (rpos == 0)
-            return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-        do {
-            rc = BAMFileSetPosition(self, &rpos);
-            if (rc == 0)
-                rc = BAMFileGetAlignPos(self, &alignPos, &alignEndPos, &refSeq);
-            if (rc)
-                return RC(rcAlign, rcFile, rcPositioning, rcIndex, rcInvalid);
-            if (refSeq != refSeqId)
-                return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-            if (alignPos <= alignEnd)
-                break; /* we found the interval we were looking for */
-            
-            /* we over-shot */
-            if (++adjust >= ival_start)
-                return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-            if ((rpos = self->ndx->refSeq[refSeqId][ival_start - adjust]) == 0)
-                return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-        } while (1);
-    }}
-    prev_alignPos = alignPos;
-    
-    do {
-        if (alignPos > alignEnd)
-            return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-        
-        /* if the alignment overlaps the target range then we are done */
-        if (alignPos >= alignStart || alignEndPos >= alignStart)
-            return BAMFileSetPosition(self, &rpos);
-        
-        /* start linear scan */
-        rc = BAMFileGetPosition(self, &rpos);
-        if (rc)
-            return rc;
-        rc = BAMFileGetAlignPos(self, &alignPos, &alignEndPos, &refSeq);
-        if (rc) return rc;
-        if (refSeq != refSeqId)
-            return RC(rcAlign, rcFile, rcPositioning, rcData, rcNotFound);
-        
-        /*  indexed BAM must be sorted by position
-         *  so verify that we are not out of order
-         *  whether this means that the index is bad
-         *  or the file is bad, likely both
-         *  fix the file and regenerate the index
-         */
-        if (prev_alignPos > alignPos)
-            return RC(rcAlign, rcFile, rcPositioning, rcData, rcInvalid);
-        prev_alignPos = alignPos;
-    } while (1);
-}
-
-static rc_t BAMIndexWhack(const BAMIndex *cself) {
-    free((void *)cself);
-    return 0;
-}
-
-/* MARK: BAM Validation Stuff */
-
-static rc_t OpenVPathRead(const KFile **fp, struct VPath const *path)
-{
-    char buffer[4096];
-    size_t blen;
-    rc_t rc = VPathReadPath(path, buffer, sizeof(buffer), &blen);
-    
-    if (rc == 0) {
-        KDirectory *dir;
-        
-        rc = KDirectoryNativeDir(&dir);
-        if (rc == 0) {
-            rc = KDirectoryOpenFileRead(dir, fp, "%.*s", (int)blen, buffer);
-            KDirectoryRelease(dir);
-        }
-    }
-    return rc;
-}
-
-static rc_t ReadVPath(void **data, size_t *dsize, struct VPath const *path)
-{
-    const KFile *fp;
-    rc_t rc = OpenVPathRead(&fp, path);
-    
-    if (rc == 0) {
-        uint8_t *buff;
-        uint64_t fsz;
-        size_t bsz = 0;
-        
-        rc = KFileSize(fp, &fsz);
-        if (rc == 0) {
-            if ((size_t)fsz != fsz)
-                return RC(rcAlign, rcFile, rcReading, rcFile, rcTooBig);
-            buff = malloc(fsz);
-            if (buff == NULL)
-                return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-            do {
-                size_t nread;
-                
-                rc = KFileRead(fp, 0, buff + bsz, fsz - bsz, &nread);
-                if (rc)
-                    break;
-                bsz += nread;
-            } while (bsz < (size_t)fsz);
-            if (rc == 0) {
-                *data = buff;
-                *dsize = bsz;
-                return 0;
-            }
-            free(buff);
-        }
-    }
-    return rc;
-}
-
-static rc_t VPath2BGZF(BGZFile *bgzf, struct VPath const *path)
-{
-    const KFile *fp;
-    BGZFile_vt dummy;
-    rc_t rc = OpenVPathRead(&fp, path);
-    
-    if (rc == 0) {
-        rc = BGZFileInit(bgzf, fp, &dummy);
-        KFileRelease(fp);
-    }
-    return rc;
-}
-
-struct index_data {
-    uint64_t position;
-    unsigned refNo;
-    unsigned binNo;
-    bool found;
-};
-
-struct buffer_data {
-    uint64_t position;
-    size_t size;
-};
-
-typedef struct BAMValidate_ctx_s BAMValidate_ctx_t;
-struct BAMValidate_ctx_s {
-    BAMValidateCallback callback;
-    void *ctx;
-    BAMValidateStats *stats;
-    const uint8_t *bai;
-    int32_t *refLen;
-    struct index_data *position;
-    uint8_t *buf;
-    uint8_t *nxt;
-    size_t bsize;
-    size_t alloced;
-    size_t dnext;
-    uint32_t options;
-    uint32_t lastRefId;
-    uint32_t lastRefPos;
-    unsigned npositions;
-    unsigned mpositions;
-    unsigned nrefs;
-    bool cancelled;
-};
-
-static
-rc_t IndexValidateStructure(const uint8_t data[], size_t dlen,
-                            unsigned refNo,
-                            unsigned refs,
-                            enum BAMIndexStructureTypes type,
-                            unsigned binNo,
-                            unsigned bins,
-                            unsigned elements,
-                            void *Ctx)
-{
-    BAMValidate_ctx_t *ctx = Ctx;
-    rc_t rc = 0;
-    
-    ctx->stats->baiFilePosition = data - ctx->bai;
-    rc = ctx->callback(ctx->ctx, 0, ctx->stats);
-    if (rc)
-        ctx->cancelled = true;
-    return rc;
-}
-
-static int CC comp_index_data(const void *A, const void *B, void *ignored)
-{
-    const struct index_data *a = A;
-    const struct index_data *b = B;
-    
-    if (a->position < b->position)
-        return -1;
-    else if (a->position > b->position)
-        return 1;
-    else
-        return 0;
-}
-
-static
-rc_t BAMValidateLoadIndex(const uint8_t data[], size_t dlen,
-                          unsigned refNo,
-                          unsigned refs,
-                          enum BAMIndexStructureTypes type,
-                          unsigned binNo,
-                          unsigned bins,
-                          unsigned elements,
-                          void *Ctx)
-{
-    BAMValidate_ctx_t *ctx = Ctx;
-    unsigned const n = type == bai_16kIntervals ? elements : elements * 2;
-    unsigned i;
-    unsigned j;
-    
-    if (type == bai_StartStopPairs && binNo >= MAX_BIN)
-        return 0;
-    
-    if (ctx->npositions + elements > ctx->mpositions) {
-        void *temp;
-        
-        do { ctx->mpositions <<= 1; } while (ctx->npositions + elements > ctx->mpositions);
-        temp = realloc(ctx->position, ctx->mpositions * sizeof(ctx->position[0]));
-        if (temp == NULL)
-            return RC(rcAlign, rcIndex, rcReading, rcMemory, rcExhausted);
-        ctx->position = temp;
-    }
-    for (j = i = 0; i != n; ++i) {
-        uint64_t const pos = get_pos(&data[i * 8]);
-        
-        if (type == bai_StartStopPairs && (i & 1) != 0)
-            continue;
-        
-        if (pos) {
-            ctx->position[ctx->npositions + j].refNo = refNo;
-            ctx->position[ctx->npositions + j].binNo = binNo;
-            ctx->position[ctx->npositions + j].position = pos;
-            ++j;
-        }
-    }
-    ctx->npositions += j;
-    return 0;
-}
-
-static
-rc_t BAMValidateHeader(const uint8_t data[],
-                       unsigned dsize,
-                       unsigned *header_len,
-                       unsigned *refs_start,
-                       unsigned *nrefs,
-                       unsigned *data_start
-                       )
-{
-    int32_t hlen;
-    int32_t refs;
-    unsigned i;
-    unsigned cp;
-    
-    if (dsize < 8)
-        return RC(rcAlign, rcFile, rcValidating, rcData, rcIncomplete);
-    
-    if (memcmp(data, "BAM\1", 4) != 0)
-        return RC(rcAlign, rcFile, rcValidating, rcFormat, rcUnrecognized);
-    
-    hlen = LE2HI32(&data[4]);
-    if (hlen < 0)
-        return RC(rcAlign, rcFile, rcValidating, rcData, rcInvalid);
-    
-    if (dsize < hlen + 12)
-        return RC(rcAlign, rcFile, rcValidating, rcData, rcIncomplete);
-    
-    refs = LE2HI32(&data[hlen + 8]);
-    if (refs < 0)
-        return RC(rcAlign, rcFile, rcValidating, rcData, rcInvalid);
-    
-    for (cp = hlen + 12, i = 0; i != refs; ++i) {
-        int32_t nlen;
-        
-        if (dsize < cp + 4)
-            return RC(rcAlign, rcFile, rcValidating, rcData, rcIncomplete);
-        
-        nlen = LE2HI32(&data[cp]);
-        if (nlen < 0)
-            return RC(rcAlign, rcFile, rcValidating, rcData, rcInvalid);
-        
-        if (dsize < cp + nlen + 4)
-            return RC(rcAlign, rcFile, rcValidating, rcData, rcIncomplete);
-        
-        cp += nlen + 4;
-    }
-    
-    *nrefs = refs;
-    *refs_start = 12 + (*header_len = hlen);
-    *data_start = cp;
-    return 0;
-}
-
-static rc_t BAMValidateIndex(struct VPath const *bampath,
-                             struct VPath const *baipath,
-                             BAMValidateOption options,
-                             BAMValidateCallback callback,
-                             void *callbackContext
-                             )
-{
-    rc_t rc = 0;
-    BGZFile bam;
-    uint8_t *bai = NULL;
-    size_t bai_size;
-    BAMValidateStats stats;
-    BAMValidate_ctx_t ctx;
-    uint8_t data[2 * ZLIB_BLOCK_SIZE];
-    uint32_t dsize = 0;
-    uint64_t pos = 0;
-    uint32_t temp;
-    int32_t ref = -1;
-    int32_t rpos = -1;
-    
-    if ((options & bvo_IndexOptions) == 0)
-        return callback(callbackContext, 0, &stats);
-
-    rc = ReadVPath((void **)&bai, &bai_size, baipath);
-    if (rc)
-        return rc;
-    
-    memset(&stats, 0, sizeof(stats));
-    memset(&ctx, 0, sizeof(ctx));
-    
-    ctx.bai = bai;
-    ctx.stats = &stats;
-    ctx.options = options;
-    ctx.ctx = callbackContext;
-    ctx.callback = callback;
-    
-    if ((options & bvo_IndexOptions) == bvo_IndexStructure)
-        return WalkIndexStructure(bai, bai_size, IndexValidateStructure, &ctx);
-
-    rc = VPath2BGZF(&bam, bampath);
-    if (rc == 0) {
-        ctx.mpositions = 1024 * 32;
-        ctx.position = malloc(ctx.mpositions * sizeof(ctx.position[0]));
-        if (ctx.position == NULL)
-            return RC(rcAlign, rcIndex, rcReading, rcMemory, rcExhausted);
-        
-        rc = WalkIndexStructure(bai, bai_size, BAMValidateLoadIndex, &ctx);
-        free(bai);
-        if (rc) {
-            stats.indexStructureIsBad = true;
-            rc = callback(callbackContext, rc, &stats);
-        }
-        else {
-            unsigned i = 0;
-            
-            stats.indexStructureIsGood = true;
-            stats.baiFileSize = ctx.npositions;
-            
-            ksort(ctx.position, ctx.npositions, sizeof(ctx.position[0]), comp_index_data, 0);
-            
-            stats.bamFileSize = bam.fsize;
-            
-            while (i < ctx.npositions) {
-                uint64_t const ifpos = ctx.position[i].position >> 16;
-                uint16_t const bpos = (uint16_t)ctx.position[i].position;
-                
-                stats.baiFilePosition = i;
-                if (i == 0 || ifpos != pos) {
-                    stats.bamFilePosition = pos = ifpos;
-                    rc = BGZFileSetPos(&bam, pos);
-                    if (rc == 0)
-                        rc = BGZFileRead(&bam, data, &dsize);
-                    if (rc) {
-                        ++stats.indexFileOffset.error;
-                        do {
-                            ++i;
-                            if (i == ctx.npositions)
-                                break;
-                            if (ctx.position[i].position >> 16 != pos)
-                                break;
-                            ++stats.indexFileOffset.error;
-                        } while (1);
-                    }
-                    else
-                        ++stats.indexFileOffset.good;
-
-                    rc = callback(callbackContext, rc, &stats);
-                    if (rc)
-                        break;
-                }
-                else
-                    ++stats.indexFileOffset.good;
-                if ((options & bvo_IndexOptions) > bvo_IndexOffsets1) {
-                    int32_t rsize = 0;
-                    BAMAlignment algn;
-                    
-                    if (bpos >= dsize)
-                        goto BAD_BLOCK_OFFSET;
-                    if (dsize - bpos < 4) {
-                    READ_MORE:
-                        if (dsize > ZLIB_BLOCK_SIZE)
-                            goto BAD_BLOCK_OFFSET;
-
-                        rc = BGZFileRead(&bam, data + dsize, &temp);
-                        if (rc) {
-                            ++stats.blockCompression.error;
-                            goto BAD_BLOCK_OFFSET;
-                        }
-                        dsize += temp;
-                        if (dsize - bpos < 4 || dsize - bpos < rsize)
-                            goto BAD_BLOCK_OFFSET;
-                    }
-                    rsize = LE2HI32(data + bpos);
-                    if (rsize <= 0)
-                        goto BAD_BLOCK_OFFSET;
-                    if (rsize > 0xFFFF) {
-                        ++stats.indexBlockOffset.warning;
-                        ++i;
-                        continue;
-                    }
-                    if (dsize - bpos < rsize)
-                        goto READ_MORE;
-/*                    rc = BAMAlignmentParse(&algn, data + bpos + 4, rsize); */
-                    if (rc)
-                        goto BAD_BLOCK_OFFSET;
-                    ++stats.indexBlockOffset.good;
-                    if ((options & bvo_IndexOptions) > bvo_IndexOffsets2) {
-                        int32_t const refSeqId = getRefSeqId(&algn);
-                        uint16_t const binNo = getBin(&algn);
-                        int32_t const position = getPosition(&algn);
-                        
-                        if (ctx.position[i].refNo == refSeqId &&
-                            (ctx.position[i].binNo == binNo ||
-                             ctx.position[i].binNo == ~((unsigned)0)
-                        ))
-                            ++stats.indexBin.good;
-                        else if (ctx.position[i].refNo == refSeqId)
-                            ++stats.indexBin.warning;
-                        else
-                            ++stats.indexBin.error;
-                        
-                        if (refSeqId < ref || position < rpos)
-                            ++stats.inOrder.error;
-                        
-                        ref = refSeqId;
-                        rpos = position;
-                    }
-                }
-                if (0) {
-                BAD_BLOCK_OFFSET:
-                    ++stats.indexBlockOffset.error;
-                }
-                ++i;
-            }
-        }
-        
-        free(ctx.position);
-        BGZFileWhack(&bam);
-    }
-    stats.bamFilePosition = stats.bamFileSize;
-    return callback(callbackContext, rc, &stats);
-}
-
-static rc_t BAMValidate3(BAMValidate_ctx_t *ctx,
-                         BAMAlignment const *algn
-                         )
-{
-    rc_t rc = 0;
-    uint16_t const flags = getFlags(algn);
-    int32_t const refSeqId = getRefSeqId(algn);
-    int32_t const refPos = getPosition(algn);
-    unsigned const mapQ = getMapQual(algn);
-    bool const aligned =
-        ((flags & BAMFlags_SelfIsUnmapped) == 0) && 
-        (refSeqId >= 0) && (refSeqId < ctx->nrefs) &&
-        (refPos >= 0) && (refPos < ctx->refLen[refSeqId]) && (mapQ > 0);
-    
-    if (ctx->options & bvo_ExtraFields) {
-    }
-    if (aligned) {
-        if ((ctx->options & bvo_Sorted) != 0) {
-            if (ctx->lastRefId < refSeqId || (ctx->lastRefId == refSeqId && ctx->lastRefPos <= refPos))
-                ++ctx->stats->inOrder.good;
-            else
-                ++ctx->stats->inOrder.error;
-            ctx->lastRefId = refSeqId;
-            ctx->lastRefPos = refPos;
-        }
-        if (ctx->options & bvo_CIGARConsistency) {
-        }
-        if (ctx->options & bvo_BinConsistency) {
-        }
-    }
-    if (ctx->options & bvo_FlagsConsistency) {
-    }
-    if (ctx->options & bvo_QualityValues) {
-    }
-    if (ctx->options & bvo_MissingSequence) {
-    }
-    if (ctx->options & bvo_MissingQuality) {
-    }
-    if (ctx->options & bvo_FlagsStats) {
-    }
-    return rc;
-}
-
-static rc_t BAMValidate2(void *Ctx, const BGZFile *file,
-                         rc_t rc, uint64_t fpos,
-                         const zlib_block_t data, unsigned dsize)
-{
-    BAMValidate_ctx_t *ctx = Ctx;
-    rc_t rc2;
-    bool fatal = false;
-    
-    ctx->stats->bamFilePosition = fpos;
-    if (rc) {
-        if (ctx->options == bvo_BlockHeaders)
-            ++ctx->stats->blockHeaders.error;
-        else
-            ++ctx->stats->blockCompression.error;
-    }
-    else if (ctx->options == bvo_BlockHeaders) {
-        ++ctx->stats->blockHeaders.good;
-    }
-    else if (ctx->options == bvo_BlockCompression) {
-        ++ctx->stats->blockHeaders.good;
-        ++ctx->stats->blockCompression.good;
-    }
-    else if (dsize) {
-        ctx->bsize += dsize;
-        if (!ctx->stats->bamHeaderIsBad && !ctx->stats->bamHeaderIsGood) {
-            unsigned header_len;
-            unsigned refs_start;
-            unsigned nrefs;
-            unsigned data_start;
-            
-            rc2 = BAMValidateHeader(ctx->buf, ctx->bsize,
-                                       &header_len, &refs_start,
-                                       &nrefs, &data_start);
-            
-            if (rc2 == 0) {
-                ctx->stats->bamHeaderIsGood = true;
-                if (ctx->options & bvo_BinConsistency) {
-                    ctx->refLen = malloc(nrefs * sizeof(ctx->refLen[0]));
-                    if (ctx->refLen == NULL) {
-                        rc = RC(rcAlign, rcFile, rcValidating, rcMemory, rcExhausted);
-                        fatal = true;
-                    }
-                    else {
-                        unsigned cp;
-                        unsigned i;
-                        
-                        ctx->nrefs = nrefs;
-                        for (i = 0, cp = refs_start; cp != data_start; ++i) {
-                            int32_t len;
-                            
-                            memcpy(&len, &ctx->buf[cp], 4);
-                            memcpy(&ctx->refLen[i], &ctx->buf[cp + 4 + len], 4);
-                            cp += len + 8;
-                        }
-                    }
-                }
-                ctx->dnext = data_start;
-            }
-            else if (GetRCState(rc2) != rcIncomplete || GetRCObject(rc2) != rcData) {
-                ctx->stats->bamHeaderIsBad = true;
-                ctx->options = bvo_BlockCompression;
-                rc = rc2;
-            }
-            else
-                ctx->dnext = ctx->bsize;
-        }
-        if (rc == 0) {
-            if (ctx->stats->bamHeaderIsGood) {
-                unsigned cp = ctx->dnext;
-                
-                while (cp + 4 < ctx->bsize) {
-                    int32_t rsize;
-                    
-                    rsize = LE2HI32(&ctx->buf[cp]);
-                    if (rsize < 0) {
-                        ++ctx->stats->blockStructure.error;
-                        ctx->options = bvo_BlockStructure;
-                        
-                        /* throw away the rest of the current buffer */
-                        if (cp >= ctx->bsize - dsize)
-                            cp = ctx->bsize;
-                        else
-                            cp = ctx->bsize - dsize;
-                        
-                        rc = RC(rcAlign, rcFile, rcValidating, rcData, rcInvalid);
-                        break;
-                    }
-                    else if (cp + 4 + rsize < ctx->bsize) {
-                        if (rsize > UINT16_MAX)
-                            ++ctx->stats->blockStructure.warning;
-                        else
-                            ++ctx->stats->blockStructure.good;
-                        if (ctx->options > bvo_BlockStructure) {
-                            BAMAlignment algn;
-                            
-/*                            rc = BAMAlignmentParse(&algn, &ctx->buf[cp + 4], rsize); */
-                            if (rc == 0) {
-                                ++ctx->stats->recordStructure.good;
-                                if (ctx->options > bvo_RecordStructure)
-                                    rc = BAMValidate3(ctx, &algn);
-                            }
-                            else
-                                ++ctx->stats->recordStructure.error;
-                        }
-                        cp += 4 + rsize;
-                    }
-                    else
-                        break;
-                }
-                if (&ctx->buf[cp] >= data) {
-                    if (cp < ctx->bsize) {
-                        ctx->bsize -= cp;
-                        memmove(ctx->buf, &ctx->buf[cp], ctx->bsize);
-                        cp = ctx->bsize;
-                    }
-                    else {
-                        assert(cp == ctx->bsize);
-                        cp = ctx->bsize = 0;
-                    }
-                }
-                ctx->dnext = cp;
-            }
-            if (ctx->alloced < ctx->bsize + ZLIB_BLOCK_SIZE) {
-                void *temp;
-                
-                temp = realloc(ctx->buf, ctx->alloced + ZLIB_BLOCK_SIZE);
-                if (temp == NULL) {
-                    rc = RC(rcAlign, rcFile, rcValidating, rcMemory, rcExhausted);
-                    fatal = true;
-                }
-                else {
-                    ctx->buf = temp;
-                    ctx->alloced += ZLIB_BLOCK_SIZE;
-                }
-            }
-            ctx->nxt = &ctx->buf[ctx->dnext];
-        }
-    }
-    rc2 = ctx->callback(ctx->ctx, rc, ctx->stats);
-    ctx->cancelled |= rc2 != 0;
-    return fatal ? rc : rc2;
-}
-
-static rc_t BAMValidateBAM(struct VPath const *bampath,
-                           BAMValidateOption options,
-                           BAMValidateCallback callback,
-                           void *callbackContext
-                           )
-{
-    rc_t rc;
-    BGZFile bam;
-    BAMValidate_ctx_t ctx;
-    BAMValidateStats stats;
-
-    if (bampath == NULL)
-        return RC(rcAlign, rcFile, rcValidating, rcParam, rcNull);
-    
-    memset(&ctx, 0, sizeof(ctx));
-    memset(&stats, 0, sizeof(stats));
-    
-    ctx.callback = callback;
-    ctx.ctx = callbackContext;
-    ctx.options = options;
-    ctx.stats = &stats;
-    
-    if (options > bvo_BlockCompression) {
-        ctx.alloced = ZLIB_BLOCK_SIZE * 2;
-        ctx.nxt = ctx.buf = malloc(ctx.alloced);
-        
-        if (ctx.buf == NULL)
-            return RC(rcAlign, rcFile, rcValidating, rcMemory, rcExhausted);
-    }
-    
-    if (options > bvo_RecordStructure)
-        options = bvo_RecordStructure | (options & 0xFFF0);
-    
-    rc = VPath2BGZF(&bam, bampath);
-    if (rc == 0) {
-        stats.bamFileSize = bam.fsize;
-        if ((options & 7) > bvo_BlockHeaders)
-            rc = BGZFileWalkBlocks(&bam, true, (zlib_block_t *)&ctx.nxt, BAMValidate2, &ctx);
-        else
-            rc = BGZFileWalkBlocks(&bam, false, NULL, BAMValidate2, &ctx);
-    }
-    BGZFileWhack(&bam);
-    return rc;
-}
-
-static rc_t CC dummy_cb(void *ctx, rc_t result, const BAMValidateStats *stats)
-{
-    return 0;
-}
-
-LIB_EXPORT rc_t CC BAMValidate(struct VPath const *bampath,
-                               struct VPath const *baipath,
-                               BAMValidateOption options,
-                               BAMValidateCallback callback,
-                               void *callbackContext
-                               )
-{
-    if (callback == NULL)
-        callback = dummy_cb;
-    if (bampath == NULL)
-        return RC(rcAlign, rcFile, rcValidating, rcParam, rcNull);
-    if (baipath == NULL) {
-        if (options & bvo_IndexOptions)
-            return RC(rcAlign, rcFile, rcValidating, rcParam, rcNull);
-        return BAMValidateBAM(bampath, options, callback, callbackContext);
-    }
-    return BAMValidateIndex(bampath, baipath, options, callback, callbackContext);
-}
diff --git a/libs/align/debug.h b/libs/align/debug.h
deleted file mode 100644
index 7c03771..0000000
--- a/libs/align/debug.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_debug_
-#define _h_align_debug_
-
-#include <klib/debug.h>
-
-#if _DEBUGGING
-
-#define ALIGN_DBGF(msg) DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_WRITER), msg)
-#define ALIGN_DBG(fmt, ...) ALIGN_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define ALIGN_DBGERR(rc) if(rc != 0) {ALIGN_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc));}
-#define ALIGN_DBGERRP(fmt, rc, ...) if(rc != 0) {ALIGN_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__));}
-
-#define ALIGN_C_DBGF(msg) DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_COMPRESS), msg)
-#define ALIGN_C_DBG(fmt, ...) ALIGN_C_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define ALIGN_C_DBGERR(rc) if(rc != 0) {ALIGN_C_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc));}
-#define ALIGN_C_DBGERRP(fmt, rc, ...) if(rc != 0) {ALIGN_C_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__));}
-
-#define ALIGN_R_DBGF(msg) DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_COVERAGE), msg)
-#define ALIGN_R_DBG(fmt, ...) ALIGN_R_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define ALIGN_R_DBGERR(rc) if(rc != 0) {ALIGN_R_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc));}
-#define ALIGN_R_DBGERRP(fmt, rc, ...) if(rc != 0) {ALIGN_R_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__));}
-
-#define ALIGN_CF_DBGF(msg) DBGMSG(DBG_ALIGN, DBG_FLAG(DBG_ALIGN_CFG), msg)
-#define ALIGN_CF_DBG(fmt, ...) ALIGN_CF_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define ALIGN_CF_DBGERR(rc) if(rc != 0) {ALIGN_CF_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc));}
-#define ALIGN_CF_DBGERRP(fmt, rc, ...) if(rc != 0) {ALIGN_CF_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__));}
-
-#else
-
-#define ALIGN_DBGF(msg) ((void)0)
-#define ALIGN_DBG(fmt, ...) ((void)0)
-#define ALIGN_DBGERR(rc) ((void)0)
-#define ALIGN_DBGERRP(fmt, rc, ...) ((void)0)
-
-#define ALIGN_C_DBGF(msg) ((void)0)
-#define ALIGN_C_DBG(fmt, ...) ((void)0)
-#define ALIGN_C_DBGERR(rc) ((void)0)
-#define ALIGN_C_DBGERRP(fmt, rc, ...) ((void)0)
-
-#define ALIGN_R_DBGF(msg) ((void)0)
-#define ALIGN_R_DBG(fmt, ...) ((void)0)
-#define ALIGN_R_DBGERR(rc) ((void)0)
-#define ALIGN_R_DBGERRP(fmt, rc, ...) ((void)0)
-
-#define ALIGN_CF_DBGF(msg) ((void)0)
-#define ALIGN_CF_DBG(fmt, ...) ((void)0)
-#define ALIGN_CF_DBGERR(rc) ((void)0)
-#define ALIGN_CF_DBGERRP(fmt, rc, ...) ((void)0)
-
-#endif
-
-#endif /* _h_align_debug_ */
diff --git a/libs/align/dna-reverse-cmpl.c b/libs/align/dna-reverse-cmpl.c
deleted file mode 100644
index 3476106..0000000
--- a/libs/align/dna-reverse-cmpl.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <insdc/insdc.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-#include <align/dna-reverse-cmpl.h>
-#include <string.h>
-
-LIB_EXPORT rc_t CC DNAReverseCompliment(const INSDC_dna_text* seq, INSDC_dna_text* cmpl, uint32_t len)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    static INSDC_dna_text compl[256] = "~";
-
-    if( seq == NULL || compl == NULL ) {
-        rc = RC( rcAlign, rcType, rcConverting, rcParam, rcNull);
-    } else {
-        if( compl[0] == '~' ) {
-            INSDC_dna_text* x = (INSDC_dna_text*)&compl[0];
-            memset(x, 0, sizeof(compl));
-            x['A'] = x['a'] = 'T';
-            x['T'] = x['t'] = 'A';
-            x['U'] = x['u'] = 'A';
-            x['G'] = x['g'] = 'C';
-            x['C'] = x['c'] = 'G';
-            x['Y'] = x['y'] = 'R';
-            x['R'] = x['r'] = 'Y';
-            x['S'] = x['s'] = 'S';
-            x['W'] = x['w'] = 'W';
-            x['K'] = x['k'] = 'M';
-            x['M'] = x['m'] = 'K';
-            x['B'] = x['b'] = 'V';
-            x['D'] = x['d'] = 'H';
-            x['H'] = x['h'] = 'D';
-            x['V'] = x['v'] = 'B';
-            x['N'] = x['n'] = 'N';
-            x['0'] = '0';
-            x['1'] = '1';
-            x['2'] = '2';
-            x['3'] = '3';
-        }
-        cmpl += len;
-        for(i = 0; i < len; i++) {
-            *--cmpl= compl[(int)seq[i]];
-            if( *cmpl == '\0' ) {
-                rc = RC(rcAlign, rcFormatter, rcWriting, rcData, rcInvalid);
-                break;
-            }
-        }
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
diff --git a/libs/align/libalign-access.vers b/libs/align/libalign-access.vers
deleted file mode 100644
index a970716..0000000
--- a/libs/align/libalign-access.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.15
diff --git a/libs/align/libalign-reader.vers b/libs/align/libalign-reader.vers
deleted file mode 100644
index 2ac9634..0000000
--- a/libs/align/libalign-reader.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.13
diff --git a/libs/align/libncbi-bam.vers b/libs/align/libncbi-bam.vers
deleted file mode 100644
index 21e8796..0000000
--- a/libs/align/libncbi-bam.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.3
diff --git a/libs/align/pl_iterator.c b/libs/align/pl_iterator.c
deleted file mode 100644
index 2d2a931..0000000
--- a/libs/align/pl_iterator.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/vector.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <klib/text.h>
-#include <klib/out.h>
-#include <insdc/insdc.h>
-#include <align/manager.h>
-#include <align/iterator.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-typedef struct window
-{
-    INSDC_coord_zero first;
-    INSDC_coord_len len;
-} window;
-
-
-typedef struct pi_entry
-{
-    DLNode n;                       /* to have it in a DLList */
-    PlacementIterator *pi;          /* the placement-iterator we have added */
-    window nxt_avail;               /* the next available position of the placement-iterator */
-} pi_entry;
-
-
-typedef struct pi_window
-{
-    DLNode n;                       /* to have it in a DLList */
-    window w;                       /* the window of the placement-iterator */
-    DLList pi_entries;              /* it has a DLList of pi_entry-struct's */
-    uint32_t count;                 /* how many entries do we have */
-} pi_window;
-
-
-typedef struct pi_ref
-{
-    DLNode n;                       /* to have it in a DLList */
-    char * name;                    /* the name of the reference it referes to */
-    window outer;                   /* the sum of all windows it has... */
-    bool outer_initialized;         /* has the outer-window been initialized */
-    DLList pi_windows;              /* it has a DLList of pi_window-struct's */
-} pi_ref;
-
-
-struct PlacementSetIterator
-{
-    KRefcount refcount;
-    struct AlignMgr const *amgr;    /* the alignment-manager... ( right now: we store it, but that's it )*/
-    DLList pi_refs;                 /* a list of references we have to iterate over... */
-    pi_ref * current_ref;           /* what is the current reference, we are handling ? */
-    pi_window * current_window;     /* what is the current window, we are handling ? */
-    pi_entry * current_entry;       /* what is the current pi-entry, we are handling ? */
-};
-
-
-/* =================================================================================================== */
-
-
-LIB_EXPORT rc_t CC AlignMgrMakePlacementSetIterator ( struct AlignMgr const *self,
-    PlacementSetIterator **iter )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( iter == NULL  )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            PlacementSetIterator * psi = calloc( sizeof * psi, 1 );
-            if ( psi == NULL )
-                rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = AlignMgrAddRef ( self );
-                if ( rc == 0 )
-                {
-                    KRefcountInit( &psi->refcount, 1, "PlacementSetIterator", "Make", "align" );
-                    psi->amgr = self;
-                    psi->current_ref = NULL;          /* we don't know that yet */
-                    psi->current_window = NULL;
-                    psi->current_entry = NULL;
-                    DLListInit( &psi->pi_refs );
-                }
-            }
-            if ( rc == 0 )
-                *iter = psi;
-            else
-                free( psi );
-        }
-    }
-
-    return rc;
-}
-
-
-/* =================================================================================================== */
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-
-/* =================================================================================================== */
-
-
-typedef struct pi_ref_cb_ctx
-{
-    const char * name;
-    pi_ref *res;
-} pi_ref_cb_ctx;
-
-
-static bool CC find_pi_ref_callback( DLNode *n, void *data )
-{
-    pi_ref_cb_ctx *ctx = ( pi_ref_cb_ctx * )data;
-    pi_ref * pr = ( pi_ref * ) n;
-    bool res = ( cmp_pchar( ctx->name, pr->name ) == 0 );
-    if ( res )
-    {
-        ctx->res = pr;
-    }
-    return res;
-}
-
-
-static pi_ref * find_pi_ref( const DLList * list, const char * name )
-{
-    pi_ref_cb_ctx ctx;
-    ctx.res = NULL;
-    ctx.name = name;
-    DLListDoUntil ( list, false, find_pi_ref_callback, &ctx );
-    return ctx.res;
-}
-
-
-/* =================================================================================================== */
-
-typedef struct pi_window_cb_ctx
-{
-    window *w;
-    pi_window *res;
-} pi_window_cb_ctx;
-
-
-static bool CC find_pi_window_callback( DLNode *n, void *data )
-{
-    pi_window_cb_ctx *ctx = ( pi_window_cb_ctx * )data;
-    pi_window * pw = ( pi_window * ) n;
-    bool res = ( pw->w.first == ctx->w->first && pw->w.len == ctx->w->len );
-    if ( res )
-        ctx->res = pw;
-    return res;
-}
-
-
-static pi_window * find_pi_window( const DLList * list, window * w )
-{
-    pi_window_cb_ctx ctx;
-    ctx.res = NULL;
-    ctx.w = w;
-    DLListDoUntil ( list, false, find_pi_window_callback, &ctx );
-    return ctx.res;
-}
-
-
-/* =================================================================================================== */
-
-
-static rc_t make_pi_window( pi_window ** pw, DLList * list, window * w )
-{
-    rc_t rc = 0;
-    *pw = calloc( 1, sizeof ** pw );
-    if ( *pw == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        (*pw)->w.first = w->first;
-        (*pw)->w.len = w->len;
-        DLListInit( &( (*pw)->pi_entries ) );
-        DLListPushTail ( list, ( DLNode * )(*pw) );
-    }
-    return rc;
-}
-
-
-static rc_t add_to_pi_window( pi_window * pw, PlacementIterator *pi )
-{
-    rc_t rc = 0;
-    pi_entry * pie = calloc( 1, sizeof *pie );
-    if ( pie == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        pie->pi = pi;       /* store the placement-iterator in it's entry-struct */
-        rc = PlacementIteratorNextAvailPos ( pi, &(pie->nxt_avail.first), &(pie->nxt_avail.len) );
-        if ( rc == 0 )
-        {
-            PlacementIteratorAddRef ( pi );
-            DLListPushTail ( &pw->pi_entries, ( DLNode * )pie );
-            pw->count += 1;
-        }
-        else
-        {
-            free( pie );
-            ALIGN_DBG( "PlacementIter has no placements...", 0 );
-        }
-    }
-    return rc;
-}
-
-
-/* =================================================================================================== */
-
-
-static rc_t make_pi_ref( pi_ref ** pr, DLList * list, const char * name )
-{
-    rc_t rc = 0;
-    *pr = calloc( 1, sizeof ** pr );
-    if ( *pr == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        (*pr)->name = string_dup_measure ( name, NULL );
-        DLListInit( &( (*pr)->pi_windows ) );
-        DLListPushTail ( list, ( DLNode * )(*pr) );
-    }
-    return rc;
-}
-
-
-static rc_t add_to_pi_ref( pi_ref * pr, window * w, PlacementIterator *pi )
-{
-    rc_t rc = 0;
-    pi_window * pw = find_pi_window( &pr->pi_windows, w );
-
-    if ( pw == NULL )
-        rc = make_pi_window( &pw, &pr->pi_windows, w );
-    if ( rc == 0 )
-        rc = add_to_pi_window( pw, pi );
-
-    if ( rc == 0 )
-    {
-        /* keep track of the outer window... */
-        if ( DLListHead( &pr->pi_windows ) == NULL )
-        {
-            /* first window ?*/
-            pr->outer.first = w->first;
-            pr->outer.len = w->len;
-        }
-        else
-        {
-            if ( w->first < pr->outer.first )
-                pr->outer.first = w->first;
-            if ( w->first + w->len > pr->outer.first + pr->outer.len )
-                pr->outer.len = ( ( w->first + w->len ) - pr->outer.first ) + 1;
-        }
-    }
-    else if ( ( pw != NULL )&&( GetRCState( rc ) == rcDone ) )
-    {
-        /* add_to_pi_window() was not successful because iterator has no
-           alignments int the requested window, that means we have to delete
-           the window if it is empty */
-        if ( pw->count == 0 )
-        {
-            /* first we have to take the pw out of the pr->pi_windows - list...
-               it was pushed at the tail of it, so we pop it from there */
-            DLListPopTail( &pr->pi_windows );
-            /* because it is empty ( count == 0 ) we can just free it now */
-            free( pw );
-        }
-    }
-    return rc;
-}
-
-
-/* =================================================================================================== */
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorAddPlacementIterator ( PlacementSetIterator *self,
-    PlacementIterator *pi )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( pi == NULL  )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            const char * name;      /* what reference are we aligning against */
-            window w;               /* where does the pi start/end, against said reference */
-
-            /* to find the name of the reference used, important for adding the iterator */
-            rc = PlacementIteratorRefWindow ( pi, &name, &(w.first), &(w.len) );
-            if ( rc == 0 )
-            {
-                pi_ref * pr = find_pi_ref( &self->pi_refs, name );
-                /* if we do not have a pi_ref yet with this name: make one! */
-                if ( pr == NULL )
-                    rc = make_pi_ref( &pr, &self->pi_refs, name );
-                /* add the placement-iterator to the newly-made or existing pi_ref! */
-                if ( rc == 0 )
-                    rc = add_to_pi_ref( pr, &w, pi );
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorAddRef ( const PlacementSetIterator *cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcAttaching, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountAdd( &cself->refcount, "PlacementSetIterator" ) != krefOkay )
-        {
-            rc = RC( rcAlign, rcIterator, rcAttaching, rcError, rcUnexpected );
-        }
-    }
-    return rc;
-}
-
-
-/* =================================================================================================== */
-
-
-static void CC pi_entry_whacker( DLNode *n, void *data )
-{
-    pi_entry * pie = ( pi_entry * )n;
-    PlacementIteratorRelease ( pie->pi );
-    free( pie );
-}
-
-static void CC pi_window_whacker( DLNode *n, void *data )
-{
-    pi_window * pw = ( pi_window * )n;
-    DLListWhack ( &pw->pi_entries, pi_entry_whacker, NULL );
-    free( pw );
-}
-
-static void CC pi_ref_whacker( DLNode *n, void *data )
-{
-    pi_ref * pr = ( pi_ref * )n;
-    DLListWhack ( &pr->pi_windows, pi_window_whacker, NULL );
-    free( pr->name );
-    free( pr );
-}
-
-
-static void pl_set_iter_clear_curr_ref_window( PlacementSetIterator *self )
-{
-    if ( self->current_window != NULL )
-    {
-        pi_window_whacker( (DLNode *)self->current_window, NULL );
-        self->current_window = NULL;
-    }
-}
-
-
-static void pl_set_iter_clear_curr_ref( PlacementSetIterator *self )
-{
-    if ( self->current_ref != NULL )
-    {
-        pi_ref_whacker( (DLNode *)self->current_ref, NULL );
-        self->current_ref = NULL;
-    }
-}
-
-/* =================================================================================================== */
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorRelease ( const PlacementSetIterator *cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountDrop( &cself->refcount, "PlacementSetIterator" ) == krefWhack )
-        {
-            PlacementSetIterator * self = ( PlacementSetIterator * ) cself;
-
-            pl_set_iter_clear_curr_ref_window( self );
-            pl_set_iter_clear_curr_ref( self );
-
-            /* release the DLList of pi-ref's and the pi's in it... */
-            DLListWhack ( &self->pi_refs, pi_ref_whacker, NULL );
-
-            AlignMgrRelease ( self->amgr );
-
-            free( self );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorNextReference ( PlacementSetIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len, struct ReferenceObj const ** refobj )
-{
-    rc_t rc = 0;
-    if ( refobj != NULL ) { *refobj = NULL; }
-
-    if ( self == NULL )
-        return RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-
-    pl_set_iter_clear_curr_ref_window( self );
-    pl_set_iter_clear_curr_ref( self );
-    self->current_entry = NULL;     /* what is the current pi-entry, we are handling ? */
-
-    /* !!! here we are taking the next reference from the top of the list */
-    self->current_ref = ( pi_ref * )DLListPopHead ( &self->pi_refs );
-
-    if ( self->current_ref == NULL )
-    {
-        return SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-    }
-
-    if ( first_pos != NULL ) *first_pos = self->current_ref->outer.first;
-    if ( len != NULL) *len = self->current_ref->outer.len;
-
-    /* if the caller wants to know the ref-obj... */
-    if ( refobj != NULL )
-    {
-        pi_window *pw = ( pi_window * )DLListHead( &(self->current_ref->pi_windows) );
-        if ( pw != NULL )
-        {
-            pi_entry * pie = ( pi_entry * )DLListHead( &(pw->pi_entries) );
-            if ( pie != NULL )
-            {
-                rc = PlacementIteratorRefObj( pie->pi, refobj );
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorNextWindow ( PlacementSetIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len )
-{
-    rc_t rc = 0;
-    if ( first_pos != NULL ) { *first_pos = 0; }
-    if ( len != NULL ) { *len = 0; }
-
-    if ( self == NULL )
-        return RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-
-    self->current_entry = NULL;     /* what is the current pi-entry, we are handling ? */
-
-    if ( self->current_ref == NULL )
-    {
-        return SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-    }
-
-    pl_set_iter_clear_curr_ref_window( self );
-
-    /* !!! here we are taking the next window from the top of the list */
-    self->current_window = ( pi_window * )DLListPopHead ( &(self->current_ref->pi_windows) );
-
-    /* check if we have reached the last window on this reference... */
-    if ( self->current_window == NULL )
-    {
-        return SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-    }
-
-    /* point to the first entry in this window... */
-    self->current_entry = ( pi_entry * )DLListHead( &(self->current_window->pi_entries) );
-
-    /* if the caller wants to know first_pos / len */
-    if ( first_pos != NULL )
-    {
-        *first_pos = self->current_window->w.first;
-    }
-    if ( len != NULL )
-    {
-        *len = self->current_window->w.len;
-    }
-
-    return rc;
-}
-
-typedef struct pi_ref_nxt_avail_pos_ctx
-{
-    uint32_t count;
-    INSDC_coord_zero min_pos;
-    INSDC_coord_len min_len;
-    bool min_pos_initialized;
-    rc_t rc;
-} pi_ref_nxt_avail_pos_ctx;
-
-static void CC nxt_avail_pos_cb( DLNode * n, void * data )
-{
-    pi_ref_nxt_avail_pos_ctx * ctx = ( pi_ref_nxt_avail_pos_ctx * ) data;
-    if ( ctx->rc == 0 )
-    {
-        pi_entry * pie = ( pi_entry * )n;
-        rc_t rc = PlacementIteratorNextAvailPos ( pie->pi, &(pie->nxt_avail.first), &(pie->nxt_avail.len) );
-        if ( rc == 0 )
-        {
-/*            OUTMSG(( "nxt_avail.first=%u w.last=%u\n", pie->nxt_avail.first, pie->w.last )); */
-            ( ctx->count )++;
-            if ( ctx->min_pos_initialized )
-            {
-                if ( pie->nxt_avail.first < ctx->min_pos )
-                {
-                    ctx->min_pos = pie->nxt_avail.first;
-                    ctx->min_len = pie->nxt_avail.len;
-                }
-            }
-            else
-            {
-                ctx->min_pos = pie->nxt_avail.first;
-                ctx->min_len = pie->nxt_avail.len;
-                ctx->min_pos_initialized = true;
-            }
-        }
-        else
-        {
-            if ( GetRCState( rc ) != rcDone )
-                ctx->rc = rc;
-        }
-    }
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorNextAvailPos ( const PlacementSetIterator *cself,
-    INSDC_coord_zero *pos, INSDC_coord_len *len )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        if ( pos == NULL )
-            rc = RC( rcAlign, rcIterator, rcAccessing, rcParam, rcNull );
-        else
-        {
-            PlacementSetIterator *self = ( PlacementSetIterator * )cself;
-            if ( self->current_ref == NULL || self->current_window == NULL )
-            {
-                rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-            }
-            else
-            {
-                /* loop through all the pi_entry int the current_pi_ref */
-                pi_ref_nxt_avail_pos_ctx ctx;
-                ctx.count = 0;
-                ctx.rc = 0;
-                ctx.min_pos = 0;
-                ctx.min_len = 0;
-                ctx.min_pos_initialized = false;
-                DLListForEach ( &(self->current_window->pi_entries),
-                                false, nxt_avail_pos_cb, &ctx );
-                rc = ctx.rc;
-                if ( ctx.count == 0 )
-                {
-                    rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-                }
-                else
-                {
-                    *pos = ctx.min_pos;
-                    if ( len != NULL )
-                    {
-                        *len = ctx.min_len;
-                    }
-                }
-            } 
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorNextRecordAt ( PlacementSetIterator *self,
-    INSDC_coord_zero pos, const PlacementRecord **rec )
-{
-    rc_t rc = 0;
-    pi_window * pw;
-    bool done;
-
-    if ( rec == NULL )
-        return RC( rcAlign, rcIterator, rcAccessing, rcParam, rcNull );
-    *rec = NULL;
-    if ( self == NULL )
-        return RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    if ( self->current_ref == NULL )
-    {
-        /* no more reference to iterator over! the iterator is done! */
-        return SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-    }
-    if ( self->current_window == NULL )
-    {
-        /* no more windows to iterator over! the iterator is done! */
-        return SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-    }
-
-    pw = self->current_window;
-    done = false;
-    do
-    {
-        if ( self->current_entry == NULL )
-        {
-            self->current_entry = ( pi_entry * )DLListHead( &(pw->pi_entries) );
-        }
-        done = ( self->current_entry == NULL );
-        rc = ( done ? SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone ) : 0 );
-        if ( rc == 0 )
-        {
-            rc = PlacementIteratorNextRecordAt ( self->current_entry->pi, pos, rec );
-            done = ( GetRCState( rc ) != rcDone );
-            if ( !done )
-            {
-                self->current_entry = ( pi_entry * )DLNodeNext( ( DLNode * )self->current_entry );
-                done = ( self->current_entry == NULL );
-                rc = ( done ? SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone ) : 0 );
-            }
-        }
-    } while ( !done );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementSetIteratorNextIdAt ( PlacementSetIterator *self,
-    INSDC_coord_zero pos, int64_t *row_id, INSDC_coord_len *len )
-{
-    const PlacementRecord *rec;
-    rc_t rc = PlacementSetIteratorNextRecordAt ( self, pos, &rec );
-    if ( rc == 0 )
-    {
-        if ( row_id != NULL ) *row_id = rec->id;
-        if ( len != NULL ) *len = rec->len;
-    }
-    return rc;
-}
diff --git a/libs/align/quality-quantizer.c b/libs/align/quality-quantizer.c
deleted file mode 100644
index 15205ca..0000000
--- a/libs/align/quality-quantizer.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <klib/defs.h>
-#include <align/quality-quantizer.h>
-
-LIB_EXPORT
-bool CC QualityQuantizerInitMatrix(uint8_t dst[256], char const quant[])
-{
-    unsigned i = 0;
-    unsigned limit = 0;
-    unsigned value = 0;
-    unsigned cur;
-    int ws = 1;
-    int st = 0;
-    
-    memset(dst, 0, 256);
-    for (cur = 0; quant[cur] != 0; ++cur) {
-        int const ch = quant[cur];
-        
-        if (ws) {
-            if (isspace(ch))
-                continue;
-            ws = false;
-        }
-        switch (st) {
-        case 0:
-            if (isdigit(ch)) {
-                value = (value * 10) + ch - '0';
-                break;
-            }
-            else if (isspace(ch)) {
-                ++st;
-                ws = true;
-                break;
-            }
-            ++st;
-            /* no break */
-        case 1:
-            if (ch != ':')
-                return false;
-            ws = true;
-            ++st;
-            break;
-        case 2:
-            if (isdigit(ch)) {
-                limit  = (limit * 10) + ch - '0';
-                break;
-            }
-            else if (isspace(ch)) {
-                ++st;
-                ws = true;
-                break;
-            }
-            else if (ch == '-' && limit == 0) {
-                memset(dst + i, value, 256 - i);
-                return true;
-            }
-            ++st;
-            /* no break */
-        case 3:
-            if (ch != ',')
-                return false;
-            ws = true;
-            st = 0;
-            if (i > limit)
-                return false;
-            /* set from dst[i..(limit - 1)] = value
-             * not inclusive of the endpoint
-             */
-            memset(dst + i, value, limit - i);
-            i = limit;
-            limit = value = 0;
-            break;
-        }
-    }
-    return false;
-}
diff --git a/libs/align/reader-cmn.c b/libs/align/reader-cmn.c
deleted file mode 100644
index 607ac09..0000000
--- a/libs/align/reader-cmn.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-
-#include "reader-cmn.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-struct TableReader
-{
-    const VCursor* curs;
-    const TableReaderColumn* cols;
-    int64_t curr;
-};
-
-
-rc_t CC TableReader_Make( const TableReader** cself, const VTable* table,
-                          TableReaderColumn* cols, size_t cache )
-{
-    rc_t rc = 0;
-    const VCursor* curs;
-
-    if ( table == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcInvalid );
-    }
-    else
-    {
-        rc = VTableCreateCachedCursorRead( table, &curs, cache );
-        if ( rc == 0 )
-        {
-            rc = TableReader_MakeCursor( cself, curs, cols );
-            VCursorRelease( curs );
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-rc_t CC TableReader_MakeCursor( const TableReader** cself, const VCursor* cursor,
-                                TableReaderColumn* cols )
-{
-    rc_t rc = 0;
-    TableReader* obj = NULL;
-
-    if ( cself == NULL || cursor == NULL || cols == NULL || cols->name == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcInvalid );
-    }
-    else if ( ( obj = calloc( 1, sizeof( *obj ) ) ) == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcMemory, rcExhausted );
-    }
-    else
-    {
-        rc = VCursorAddRef( cursor );
-        if ( rc == 0 )
-        {
-            obj->curs = cursor;
-/*            obj->cursor_open = false; */
-            obj->cols = cols;
-            while ( rc == 0 && cols->name != NULL)
-            {
-                if ( !( cols->flags & ercol_Skip ) )
-                {
-                    rc = VCursorAddColumn( obj->curs, &cols->idx, cols->name );
-                    if ( rc != 0 )
-                    {
-                        if ( ( rc != 0 && ( cols->flags & ercol_Optional ) ) || GetRCState( rc ) == rcExists )
-                        {
-                            rc = 0;
-                        }
-                        else
-                        {
-                            ALIGN_DBGERRP( "cannot add column '%s' to cursor", rc, cols->name );
-                        }
-                    }
-                }
-                cols++;
-            }
-            if ( rc == 0 )
-            {
-                rc = VCursorOpen( obj->curs );
-            }
-        }
-    }
-
-
-    if( rc == 0 )
-    {
-        *cself = obj;
-/*        ALIGN_DBG("ok%c", '!'); */
-    }
-    else
-    {
-        TableReader_Whack( obj );
-        ALIGN_DBGERRP( "TableReader_MakeCursor() failed", rc, 0 );
-    }
-    return rc;
-}
-
-
-void CC TableReader_Whack( const TableReader* cself )
-{
-    if ( cself != NULL )
-    {
-        VCursorRelease( cself->curs );
-        free( ( TableReader* ) cself );
-    }
-}
-
-/*
-rc_t CC TableReader_OpenCursor( const TableReader* cself )
-{
-    TableReader * tr = ( TableReader * )cself;
-    VCursor * curs = ( VCursor * )tr->curs;
-    rc_t rc = VCursorOpen( curs );
-    tr->cursor_open = ( rc == 0 );
-    return rc;
-}
-*/
-
-rc_t CC TableReader_ReadRow( const TableReader* cself, int64_t rowid )
-{
-    rc_t rc = 0;
-    TableReaderColumn* c = NULL;
-
-    if ( cself == NULL )
-    {
-        rc = RC(rcAlign, rcType, rcOpening, rcSelf, rcNull);
-    }
-    else if ( cself->curr != rowid )
-    {
-/*
-        if ( !cself->cursor_open )
-            rc = TableReader_OpenCursor( cself );
-*/
-        if ( rc == 0 )
-        {
-            rc = VCursorCloseRow( cself->curs );
-            if ( rc == 0 )
-            {
-                rc = VCursorSetRowId( cself->curs, rowid );
-                if ( rc == 0 )
-                {
-                    rc = VCursorOpenRow( cself->curs );
-                    if ( rc == 0 )
-                    {
-                        uint32_t boff = 0;
-                        c = ( TableReaderColumn* )( cself->cols );
-                        while ( c->name != NULL )
-                        {
-                            if ( c->idx != 0 )
-                            {
-                                /* TBD - FIX ME
-                                   this can be dangerous, since VCursorCellData
-                                   can cause cache flushes, invalidating previous
-                                   reads. THESE MUST BE FETCHED UPON DEMAND, NOT
-                                   PREFETCHED!!
-                                */
-                                rc = VCursorCellData( cself->curs, c->idx, NULL, (const void**)&c->base.var, &boff, &c->len );
-                                if ( rc != 0 )
-                                {
-                                    if ( c->flags & ercol_Optional )
-                                        rc = 0;
-                                    c->base.var = NULL;
-                                    c->len = 0;
-                                }
-                                else if ( boff != 0 )
-                                {
-                                    rc = RC( rcAlign, rcType, rcReading, rcData, rcUnsupported );
-                                }
-                            }
-                            c++;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    if ( rc != 0 )
-    {
-        ALIGN_DBGERRP( "column %s row %ld", rc, c ? c->name : "<none>", rowid );
-    }
-    else
-    {
-        ( ( TableReader* )cself )->curr = rowid;
-    }
-    return rc;
-}
-
-
-rc_t CC TableReader_IdRange( const TableReader* cself, int64_t* first, uint64_t* count )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcRetrieving, rcSelf, rcNull );
-    }
-    else
-    {
-/*
-        if ( !cself->cursor_open )
-            rc = TableReader_OpenCursor( cself );
-        if ( rc == 0 )
-*/
-            rc = VCursorIdRange( cself->curs, 0, first, count );
-    }
-    return rc;
-}
-
-
-rc_t CC TableReader_OpenIndex( const TableReader* cself, const char* name, const KIndex** idx )
-{
-    rc_t rc = 0;
-
-    if ( cself == NULL || name == NULL || idx == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcNull );
-    }
-    else
-    {
-/*
-        if ( !cself->cursor_open )
-            rc = TableReader_OpenCursor( cself );
-        if ( rc == 0 )
-        {
-*/
-            const VTable* tbl;
-            rc = VCursorOpenParentRead( cself->curs, &tbl );
-            if ( rc == 0 )
-            {
-                rc = VTableOpenIndexRead( tbl, idx, name );
-                VTableRelease( tbl );
-            }
-/*        } */
-    }
-    return rc;
-}
-
-
-rc_t CC TableReader_PageIdRange( const TableReader *cself, int64_t rowid,
-                                 int64_t *pfirst, int64_t *plast )
-{
-    rc_t rc = 0;
-    
-    if ( cself == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcOpening, rcSelf, rcNull );
-    }
-    else
-    {
-/*
-        if ( !cself->cursor_open )
-            rc = TableReader_OpenCursor( cself );
-        if ( rc == 0 )
-        {
-*/
-            if ( pfirst != NULL || plast != NULL )
-            {
-                int64_t first = INT64_MAX;
-                int64_t last = INT64_MIN;
-                unsigned i;
-                
-                for ( i = 0; cself->cols[ i ].name != NULL; ++i )
-                {
-                    if ( cself->cols[i].idx != 0 )
-                    {
-                        int64_t tfirst;
-                        int64_t tlast;
-                        
-                        rc = VCursorPageIdRange( cself->curs, cself->cols[ i ].idx, rowid, &tfirst, &tlast );
-                        if ( rc == 0 )
-                        {
-                            if ( first > tfirst ) { first = tfirst; }
-                            if ( last < tlast ) { last = tlast; }
-                        }
-                    }
-                }
-                if ( pfirst != NULL ) { *pfirst = first; }
-                if ( plast  != NULL ) { *plast  = last; }
-            }
-/*        } */
-    }
-    return rc;
-}
diff --git a/libs/align/reader-cmn.h b/libs/align/reader-cmn.h
deleted file mode 100644
index 3310999..0000000
--- a/libs/align/reader-cmn.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was readten as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_reader_cmn_
-#define _h_align_reader_cmn_
-
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-
-enum TableReaderColumn_Array {
-    ercol_Optional = 0x01,
-    ercol_Skip = 0x02
-};
-
-/* use ercol_Ignore to skip optional column when cursor is created */
-typedef struct TableReaderColumn_struct {
-    uint32_t idx;
-    const char* name;
-    union {
-        const void* var;
-        const char* str;
-        const bool* buul;
-        const uint8_t* u8;
-        const int16_t* i16;
-        const uint16_t* u16;
-        const int32_t* i32;
-        const uint32_t* u32;
-        const int64_t* i64;
-        const uint64_t* u64;
-        const INSDC_coord_one* coord1;
-        const INSDC_coord_zero* coord0;
-        const INSDC_coord_len* coord_len;
-        const INSDC_coord_val* coord_val;
-        const INSDC_SRA_xread_type* read_type;
-        const INSDC_SRA_read_filter* read_filter;
-    } base;
-    uint32_t len;
-    uint32_t flags;
-} TableReaderColumn;
-
-typedef struct TableReader TableReader;
-
-rc_t CC TableReader_Make(const TableReader** cself, const VTable* table, TableReaderColumn* cols, size_t cache);
-
-rc_t CC TableReader_MakeCursor(const TableReader** cself, const VCursor* cursor, TableReaderColumn* cols );
-
-rc_t CC TableReader_OpenCursor( const TableReader* cself );
-
-void CC TableReader_Whack(const TableReader* cself);
-
-rc_t CC TableReader_ReadRow(const TableReader* cself, int64_t rowid);
-
-rc_t CC TableReader_IdRange(const TableReader* cself, int64_t* first, uint64_t* count);
-
-rc_t CC TableReader_OpenIndex(const TableReader* cself, const char* name, const KIndex** idx);
-
-rc_t CC TableReader_PageIdRange(const TableReader *cself, int64_t rowid, int64_t *first, int64_t *last);
-
-#endif /* _h_align_reader_cmn_ */
diff --git a/libs/align/reader-refseq.c b/libs/align/reader-refseq.c
deleted file mode 100644
index 0a29c53..0000000
--- a/libs/align/reader-refseq.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <insdc/insdc.h>
-#include <vdb/manager.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <align/reader-refseq.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "reader-cmn.h"
-#include "reference-cmn.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-static const TableReaderColumn TableReaderRefSeq_cols[] =
-{
-    /* order important, see code below! */
-    {0, "(INSDC:dna:text)READ", {NULL}, 0, 0},
-    {0, "(INSDC:4na:bin)READ", {NULL}, 0, ercol_Skip},
-    {0, "QUALITY", {NULL}, 0, ercol_Skip | ercol_Optional},
-    {0, "SEQ_LEN", {NULL}, 0, 0},
-    {0, NULL, {NULL}, 0, 0}
-};
-
-struct TableReaderRefSeq {
-    const TableReader* base;
-    TableReaderColumn cols[sizeof(TableReaderRefSeq_cols)/sizeof(TableReaderRefSeq_cols[0])];
-    char seq_id[256];
-    uint32_t max_seq_len;
-    INSDC_coord_len total_seq_len;
-    bool circular;
-    bool has_md5;
-    uint8_t md5[16];
-    const TableReaderColumn* read;
-    const TableReaderColumn* seq_len;
-};
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_MakeTable(const TableReaderRefSeq** cself, const VDBManager* vmgr,
-                                               const VTable* table, uint32_t options, size_t cache)
-{
-    rc_t rc = 0;
-    TableReaderRefSeq* self = NULL;
-
-    if( cself == NULL || table == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (self = calloc(1, sizeof(*self))) == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        const TableReader* tmp;
-        TableReaderColumn static_cols[] = {
-            /* order important, see code below! */
-            {0, "MAX_SEQ_LEN", {NULL}, 0, 0},
-            {0, "SEQ_ID", {NULL}, 0, 0},
-            {0, "TOTAL_SEQ_LEN", {NULL}, 0, 0},
-            {0, "CIRCULAR", {NULL}, 0, 0},
-            {0, "MD5", {NULL}, 0, ercol_Optional},
-            {0, NULL, {NULL}, 0, 0}
-        };
-        if( (rc = TableReader_Make(&tmp, table, static_cols, 0)) == 0 ) {
-            if( (rc = TableReader_ReadRow(tmp, 1)) == 0 ) {
-                self->max_seq_len = static_cols[0].base.u32[0];
-                self->total_seq_len = static_cols[2].base.u64[0];
-                if( self->total_seq_len != static_cols[2].base.u64[0] ) {
-                    rc = RC(rcAlign, rcType, rcConstructing, rcData, rcOutofrange);
-                }
-                if( static_cols[1].base.var != NULL ) {
-                    if ( static_cols[ 1 ].len > sizeof( self->seq_id ) - 1 )
-                    {
-                        rc = RC( rcAlign, rcType, rcConstructing, rcBuffer, rcInsufficient );
-                    }
-                    else
-                    {
-                        string_copy( self->seq_id, ( sizeof self->seq_id ) -  1, static_cols[1].base.str, static_cols[1].len );
-                        self->seq_id[ static_cols[ 1 ].len ] = '\0';
-                    }
-                }
-                self->circular = static_cols[3].base.buul[0];
-                if( static_cols[4].base.var != NULL ) {
-                    memcpy(self->md5, static_cols[4].base.var, sizeof(self->md5));
-                    self->has_md5 = true;
-                }
-            }
-            TableReader_Whack(tmp);
-        }
-
-        memcpy(self->cols, TableReaderRefSeq_cols, sizeof(TableReaderRefSeq_cols));
-        if( options & errefseq_4NA) {
-            self->cols[0].flags |= ercol_Skip;
-            self->cols[1].flags &= ~ercol_Skip;
-            self->read = &self->cols[1];
-        } else {
-            self->read = &self->cols[0];
-        }
-        self->seq_len = &self->cols[3];
-        rc = TableReader_Make(&self->base, table, self->cols, cache);
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        /* ALIGN_DBG("table 0x%p opened 0x%p", table, self); */
-    } else {
-        TableReaderRefSeq_Whack(self);
-        ALIGN_DBGERRP("table for 0x%p", rc, table);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_MakePath(const TableReaderRefSeq** cself, const VDBManager* vmgr,
-                                              const char* path, uint32_t options, size_t cache)
-{
-    rc_t rc = 0;
-    const VTable* tbl = NULL;
-
-    if( vmgr == NULL || path == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = VDBManagerOpenTableRead(vmgr, &tbl, NULL, path)) == 0 ) {
-        rc = TableReaderRefSeq_MakeTable(cself, vmgr, tbl, options, cache);
-        VTableRelease(tbl);
-    }
-    if( rc == 0 ) {
-        /* ALIGN_DBG("table %s opened 0x%p", path, *cself); */
-    } else {
-        ALIGN_DBGERRP("table for %s", rc, path);
-    }
-    return rc;
-}
-
-LIB_EXPORT void CC TableReaderRefSeq_Whack(const TableReaderRefSeq* cself)
-{
-    if( cself != NULL ) {
-        /* ALIGN_DBG("table 0x%p closed", cself); */
-        TableReader_Whack(cself->base);
-        free((TableReaderRefSeq*)cself);
-    }
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_SeqId(const TableReaderRefSeq* cself, const char** id, uint32_t* id_sz)
-{
-    rc_t rc = 0;
-    if( cself == NULL || id == NULL || id_sz == NULL ) {
-        rc = RC(rcAlign, rcType, rcReading, rcParam, rcNull);
-    } else {
-        *id = cself->seq_id;
-        *id_sz = string_size(cself->seq_id);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_SeqLength(const TableReaderRefSeq* cself, INSDC_coord_len* len)
-{
-    rc_t rc = 0;
-    if( cself == NULL || len == NULL ) {
-        rc = RC(rcAlign, rcType, rcReading, rcParam, rcNull);
-    } else {
-        *len = cself->total_seq_len;
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_Circular(const TableReaderRefSeq* cself, bool* circular)
-{
-    rc_t rc = 0;
-    if( cself == NULL || circular == NULL ) {
-        rc = RC(rcAlign, rcType, rcReading, rcParam, rcNull);
-    } else {
-        *circular = cself->circular;
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_MD5(const TableReaderRefSeq* cself, const uint8_t** md5)
-{
-    rc_t rc = 0;
-    if( cself == NULL || md5 == NULL ) {
-        rc = RC(rcAlign, rcType, rcReading, rcParam, rcNull);
-    } else {
-        *md5 = cself->has_md5 ? cself->md5 : NULL;
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableReaderRefSeq_Read(const TableReaderRefSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                          uint8_t* buffer, INSDC_coord_len* written)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || buffer == NULL || written == NULL ) {
-        rc = RC(rcAlign, rcType, rcReading, rcParam, rcNull);
-    } else if( len == 0 ) {
-        *written = 0;
-    } else if( (rc = ReferenceSeq_ReOffset(cself->circular, cself->total_seq_len, &offset)) == 0 ) {
-        INSDC_coord_len q = 0;
-        *written = 0;
-        do {
-            int64_t rowid = offset / cself->max_seq_len + 1;
-            INSDC_coord_zero s = offset % cself->max_seq_len;
-            if( (rc = TableReader_ReadRow(cself->base, rowid)) == 0 ) {
-                q = cself->seq_len->base.coord_len[0] - s;
-                if( q > len ) {
-                    q = len;
-                }
-                memcpy(&buffer[*written], cself->read->base.str + s, q);
-                *written += q;
-                offset += q;
-                len -= q;
-            }
-            /* SEQ_LEN < MAX_SEQ_LEN is last row unless it is CIRCULAR */
-            if( cself->seq_len->base.coord_len[0] < cself->max_seq_len ) {
-                if( !cself->circular ) {
-                    break;
-                }
-                offset = 0;
-            }
-        } while(rc == 0 && q > 0 && len > 0 );
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
diff --git a/libs/align/ref_iterator.c b/libs/align/ref_iterator.c
deleted file mode 100644
index 32e4e5c..0000000
--- a/libs/align/ref_iterator.c
+++ /dev/null
@@ -1,866 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <klib/text.h>
-#include <klib/out.h>
-#include <insdc/insdc.h>
-#include <align/reference.h>
-#include <align/iterator.h>
-#include <align/manager.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#define COL_READ "(INSDC:4na:bin)READ"
-#define COL_HAS_MISMATCH "(bool)HAS_MISMATCH"
-#define COL_HAS_REF_OFFSET "(bool)HAS_REF_OFFSET"
-#define COL_REF_OFFSET "(I32)REF_OFFSET"
-#define COL_READ_GROUP "(ascii)SEQ_SPOT_GROUP"
-
-
-typedef struct spot_group
-{
-    DLNode n;                       /* to have it in a DLList */
-    char * name;                    /* the name of the read-group, can be NULL */
-    size_t len;                     /* the length of the name */
-    DLList records;                 /* has list of PlacementRecords... */
-} spot_group;
-
-
-static rc_t make_spot_group( spot_group ** sg, DLList * list, const char * name, size_t len )
-{
-    rc_t rc = 0;
-    *sg = calloc( 1, sizeof ** sg );
-    if ( *sg == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        if ( len > 0 && name != NULL )
-        {
-            (*sg)->name = string_dup( name, len );
-            if ( (*sg)->name != NULL )
-            {
-                (*sg)->len = len;
-            }
-        }
-        /* if name is NULL, the spot-group is initialized with 0 via calloc() */
-        DLListInit( &( (*sg)->records ) );
-        DLListPushTail ( list, ( DLNode * )(*sg) );
-    }
-    return rc;
-}
-
-
-static void CC whack_the_placement_record( DLNode *n, void *data )
-{    PlacementRecordWhack ( ( PlacementRecord * )n );   }
-
-static void free_spot_group( spot_group *sg )
-{
-    if ( sg->name != NULL ) free( sg->name );
-    DLListWhack ( &sg->records, whack_the_placement_record, NULL );
-    free( sg );
-}
-
-
-static void CC whack_the_spot_group( DLNode *n, void *data )
-{    free_spot_group ( ( spot_group * )n );   }
-
-static void clear_spot_group_list( DLList * list )
-{
-    DLListWhack ( list, whack_the_spot_group, NULL );
-}
-
-
-typedef struct find_spot_group_cb_ctx
-{
-    const char * name;
-    size_t len;
-    spot_group *res;
-} find_spot_group_cb_ctx;
-
-
-static bool CC find_spot_group_callback( DLNode *n, void *data )
-{
-    find_spot_group_cb_ctx *ctx = ( find_spot_group_cb_ctx * )data;
-    spot_group * sg = ( spot_group * ) n;
-    bool res = false;
-
-    if ( ctx->name == NULL || sg->name == NULL )
-    {
-        res = true;
-    }
-    else
-    {
-        res = ( string_cmp ( sg->name, sg->len, 
-                             ctx->name, ctx->len, 
-                             ( sg->len < ctx->len ) ? ctx->len : sg->len ) == 0 );
-    }
-
-    if ( res )
-    {
-        ctx->res = sg;
-    }
-    return res;
-}
-
-static spot_group * find_spot_group( DLList * list, const char * name, size_t len )
-{
-    find_spot_group_cb_ctx ctx;
-    ctx.res = NULL;
-    ctx.name = name;
-    ctx.len = len;
-    DLListDoUntil ( list, false, find_spot_group_callback, &ctx );
-    return ctx.res;
-}
-
-static rc_t add_to_spot_groups( DLList * list, const PlacementRecord *rec )
-{
-    rc_t rc = 0;
-    spot_group * sg = find_spot_group( list, rec->spot_group, rec->spot_group_len );
-    if ( sg == NULL )
-    {
-        rc = make_spot_group( &sg, list, rec->spot_group, rec->spot_group_len );
-    }
-    if ( rc == 0 )
-    {
-        DLListPushTail ( &sg->records, ( DLNode * )(rec) );
-    }
-    return rc;
-}
-
-
-static uint32_t remove_invalid_records( const struct ReferenceObj * const refobj,
-                                        DLList * list, INSDC_coord_zero pos )
-{
-    uint32_t res = 0;
-    spot_group * sg = ( spot_group * )DLListHead( list );
-    while ( sg != NULL )
-    {
-        spot_group *nxt = ( spot_group * )DLNodeNext( ( DLNode * )sg );
-        PlacementRecord *rec = ( PlacementRecord * )DLListHead( &sg->records );
-        while ( rec != NULL )
-        {
-            PlacementRecord *nxt_rec = ( PlacementRecord * )DLNodeNext( ( DLNode * )rec );
-            INSDC_coord_zero end_pos = ( rec->pos + rec->len );
-            bool remove = ( end_pos <= pos );
-            if ( !remove )
-            {
-                AlignmentIterator * al_iter = PlacementRecordCast ( rec, placementRecordExtension0 );
-                int32_t state = AlignmentIteratorState ( al_iter, NULL );
-                remove = ( ( state & align_iter_invalid ) == align_iter_invalid );
-            }
-            if ( remove )
-            {
-                DLListUnlink ( &sg->records, ( DLNode * )rec );
-                PlacementRecordWhack ( rec );
-            }
-            else
-            {
-                res++;
-            }
-            rec = nxt_rec;
-        }
-        sg = nxt;
-    }
-    return res;
-}
-
-
-static void inc_alignment_iterators( DLList * list, INSDC_coord_zero pos )
-{
-    spot_group * sg = ( spot_group * )DLListHead( list );
-    while ( sg != NULL )
-    {
-        spot_group *nxt = ( spot_group * )DLNodeNext( ( DLNode * )sg );
-        PlacementRecord *rec = ( PlacementRecord * )DLListHead( &sg->records );
-        while ( rec != NULL )
-        {
-            PlacementRecord *nxt_rec = ( PlacementRecord * )DLNodeNext( ( DLNode * )rec );
-            AlignmentIterator * al_iter = PlacementRecordCast ( rec, placementRecordExtension0 );
-            if ( rec->pos <= pos && al_iter != NULL )
-            {
-                AlignmentIteratorNext ( al_iter );
-            }
-            rec = nxt_rec;
-        }
-        sg = nxt;
-    }
-}
-
-/* ======================================================================================== */
-
-
-struct ReferenceIterator
-{
-    KRefcount refcount;
-    struct AlignMgr const *amgr;
-
-    DLList spot_groups;                     /* has a list of spot-groups... */
-
-    int32_t min_mapq;                       /* has a minimum mapq-value... */
-    PlacementRecordExtendFuncs ext_func;    /* has a struct with record-extension-functions from client*/
-    PlacementRecordExtendFuncs int_func;    /* has a struct with record-extension-functions for itself*/
-
-    uint32_t depth;                         /* how many records are in the list */
-    INSDC_coord_zero current_pos;           /* what is the current ref-position on the current ref. */
-    INSDC_coord_zero last_pos;              /* what is the current ref-position on the current ref. */
-    INSDC_coord_zero nxt_avail_pos;         /* what is the next available ref-position on the current ref. */
-    spot_group *current_spot_group;         /* what is the next spot-group to be handled */
-    PlacementRecord *current_rec;           /* the current-record at the current position */
-    bool need_init;                         /* do we need to init for the first next()-call */
-    PlacementSetIterator * pl_set_iter;     /* holds a list of placement-iterators */
-    struct ReferenceObj const * refobj;     /* cached result of ReferenceIteratorNextReference(...) */
-};
-
-
-LIB_EXPORT void CC RefIterRecordDestroy ( void *obj, void *data )
-{
-    /* nothing to do, because there are no sub-allocations etc. ... */
-}
-
-
-LIB_EXPORT rc_t CC RefIterRecordSize ( struct VCursor const *curs,
-    int64_t row_id, size_t * size, void *data, void * placement_ctx )
-{
-    /* discover the size of the ref-iter-part to be allocated... */
-    return AlignIteratorRecordSize ( curs, row_id, size, data );
-}
-
-
-LIB_EXPORT rc_t CC RefIterRecordPopulate ( void *obj,
-    const PlacementRecord *placement, struct VCursor const *curs,
-    INSDC_coord_zero ref_window_start, INSDC_coord_len ref_window_len, void *data, void * placement_ctx )
-{
-    return AlignIteratorRecordPopulate ( obj, placement, curs, ref_window_start, ref_window_len, data );
-}
-
-
-static void CC RefIterDestroyRecPart( void *obj, void *data )
-{
-    AlignmentIterator *iter = ( AlignmentIterator * )obj;
-    if ( iter != NULL )
-        AlignmentIteratorRelease( iter );
-}
-
-LIB_EXPORT rc_t CC AlignMgrMakeReferenceIterator ( struct AlignMgr const *self,
-    ReferenceIterator **iter, const PlacementRecordExtendFuncs *ext_1, int32_t min_mapq )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( iter == NULL  )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            ReferenceIterator * refi = calloc( sizeof * refi, 1 );
-            if ( refi == NULL )
-                rc = RC( rcAlign, rcIterator, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                KRefcountInit( &refi->refcount, 1, "ReferenceIterator", "Make", "align" );
-                refi->min_mapq = min_mapq;
-                if ( ext_1 != NULL )
-                {
-                    refi->ext_func.data = ext_1->data;
-                    refi->ext_func.destroy = ext_1->destroy;
-                    refi->ext_func.populate = ext_1->populate;
-                    refi->ext_func.alloc_size = ext_1->alloc_size;
-                    refi->ext_func.fixed_size = ext_1->fixed_size;
-                }
-
-                refi->int_func.data = ( void * )self;
-                refi->int_func.destroy = RefIterDestroyRecPart;
-                refi->int_func.populate = RefIterRecordPopulate;
-                refi->int_func.alloc_size = RefIterRecordSize; 
-
-                DLListInit( &(refi->spot_groups) );
-                rc = AlignMgrMakePlacementSetIterator ( self, &refi->pl_set_iter );
-                refi->need_init = true;
-            }
-
-            if ( rc == 0 )
-                rc = AlignMgrAddRef ( self );
-
-            if ( rc == 0 )
-            {
-                refi->amgr = self;
-                *iter = refi;
-            }
-            else
-                free( refi );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorAddRef ( const ReferenceIterator *self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAttaching, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountAdd( &self->refcount, "ReferenceIterator" ) != krefOkay )
-        {
-            rc = RC( rcAlign, rcIterator, rcAttaching, rcError, rcUnexpected );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorRelease ( const ReferenceIterator *cself )
-{
-    rc_t rc = 0;
-    if ( cself == NULL )
-        rc = RC( rcAlign, rcIterator, rcReleasing, rcSelf, rcNull );
-    else
-    {
-        if ( KRefcountDrop( &cself->refcount, "ReferenceIterator" ) == krefWhack )
-        {
-            ReferenceIterator * self = ( ReferenceIterator * ) cself;
-            /* we 'own' the records! - we have to destroy them, if some are left in here */
-            clear_spot_group_list( &self->spot_groups );
-            rc = PlacementSetIteratorRelease ( self->pl_set_iter );
-            AlignMgrRelease ( self->amgr );
-            free( self );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorAddPlacementIterator( ReferenceIterator *self,
-    PlacementIterator *pi )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( pi == NULL )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            rc = PlacementSetIteratorAddPlacementIterator ( self->pl_set_iter, pi );
-        }
-    }
-    return rc;
-}
-
-
-#define ALIGN_COL_COUNT 4
-
-static const char * align_cols[ ALIGN_COL_COUNT ] = 
-{ COL_REF_OFFSET, COL_HAS_REF_OFFSET, COL_HAS_MISMATCH, COL_READ };
-
-
-static rc_t prepare_align_cursor( struct VCursor const *align )
-{
-    rc_t rc = 0;
-    uint32_t i, throw_away_idx;
-
-    for ( i = 0; i < ALIGN_COL_COUNT && rc == 0; ++i ) {
-        rc =VCursorAddColumn ( align, &throw_away_idx, "%s", align_cols[ i ] );
-        if( GetRCState(rc) == rcExists ) {
-            rc = 0;
-        }
-    }
-        
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorAddPlacements( ReferenceIterator *self,
-     struct ReferenceObj const *ref_obj, INSDC_coord_zero ref_pos, INSDC_coord_len ref_len,
-     struct VCursor const *ref, struct VCursor const *align, align_id_src ids,
-     const char * spot_group, void * placement_ctx )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        if ( ref_obj == NULL )
-            rc = RC( rcAlign, rcIterator, rcConstructing, rcParam, rcNull );
-        else
-        {
-            if ( align != NULL )
-                rc = prepare_align_cursor( align );
-
-            if ( rc == 0 )
-            {
-                PlacementIterator *pi;
-
-                rc = ReferenceObj_MakePlacementIterator ( ref_obj, &pi, ref_pos, ref_len, self->min_mapq,
-                        ref, align, ids, &self->int_func, &self->ext_func, spot_group, placement_ctx );
-                if ( rc == 0 )
-                {
-                    rc = PlacementSetIteratorAddPlacementIterator ( self->pl_set_iter, pi );
-                    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-                }
-            }
-            /* if rc != 0 then ref_obj had NO AddRef inside  ReferenceObj_MakePlacementIterator() ! */
-            if ( rc == 0 )
-                ReferenceObj_Release( ref_obj );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t fill_recordlist( ReferenceIterator *self, INSDC_coord_zero pos )
-{
-    rc_t rc;
-    do
-    {
-        const PlacementRecord *rec;
-        /* from the placement-set-iterator into our list... */
-        rc = PlacementSetIteratorNextRecordAt ( self->pl_set_iter, pos, &rec );
-        if ( rc == 0 )
-        {
-            if ( rec->pos == pos )
-            {
-                self->depth++;
-                rc = add_to_spot_groups( &self->spot_groups, rec );
-            }
-            else
-                PlacementRecordWhack ( rec );
-        }
-    } while( rc == 0 );
-
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorNextReference ( ReferenceIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len, struct ReferenceObj const ** refobj )
-{
-    rc_t rc = 0;
-
-    if ( refobj != NULL )
-        *refobj = NULL;
-
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        struct ReferenceObj const * robj;
-        rc = PlacementSetIteratorNextReference ( self->pl_set_iter, first_pos, len, &robj );
-        clear_spot_group_list( &self->spot_groups );
-        if ( rc == 0 )
-        {
-            /* cache the returned refobj in order to get to reference-bases later... */
-            self->refobj = robj;
-            self->need_init = true;
-        }
-        else
-        {
-            self->refobj = NULL;
-        }
-
-        if ( refobj != NULL )
-        {
-            *refobj = self->refobj;
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorNextWindow ( ReferenceIterator *self,
-    INSDC_coord_zero *first_pos, INSDC_coord_len *len )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        rc = PlacementSetIteratorNextWindow ( self->pl_set_iter, first_pos, len );
-        clear_spot_group_list( &self->spot_groups );
-        if ( rc == 0 )
-        {
-            self->need_init = true;
-            self->current_pos = *first_pos;
-            self->current_spot_group = NULL;
-            self->last_pos = self->current_pos + *len - 1;
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorNextSpotGroup ( ReferenceIterator *self,
-    const char ** name, size_t * len )
-{
-    rc_t rc = 0;
-
-    if ( self->current_spot_group == NULL )
-    {
-        self->current_spot_group = ( spot_group * )DLListHead( &self->spot_groups );
-        if ( self->current_spot_group == NULL )
-        {
-            rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-        }
-    }
-    else
-    {
-        spot_group *nxt  = ( spot_group * )DLNodeNext( ( DLNode * ) self->current_spot_group );
-        if ( nxt == NULL )
-        {
-            rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-        }
-        else
-        {
-            self->current_spot_group = nxt;
-        }
-    }
-    self->current_rec = NULL;
-
-    if ( rc == 0 && self->current_spot_group != NULL )
-    {
-        if ( name != NULL )
-        {
-            *name = self->current_spot_group->name;
-        }
-        if ( len != NULL )
-        {
-            *len = self->current_spot_group->len;
-        }
-    }
-    return rc;
-}
-
-
-/* iterates the PlacementSetIterator forward to reach self->current_pos on the reference */
-static rc_t first_ref_iter_nxt_pos( ReferenceIterator *self, bool skip_empty )
-{
-    rc_t rc;
-    bool loop;
-    self->need_init = false;
-    do
-    {
-        rc = PlacementSetIteratorNextAvailPos ( self->pl_set_iter, &self->nxt_avail_pos, NULL );
-        loop = ( rc == 0 );
-        if ( loop )
-        {
-            loop = ( self->nxt_avail_pos <= self->current_pos );
-            if ( loop )
-            {
-                rc = fill_recordlist( self, self->nxt_avail_pos );
-                self->depth = remove_invalid_records( self->refobj, &self->spot_groups, self->nxt_avail_pos - 1 );
-            }
-        }
-    } while ( loop );
-
-    if ( skip_empty && self->nxt_avail_pos > self->current_pos && self->depth == 0 )
-    {
-        self->current_pos = self->nxt_avail_pos;
-    }
-    self->depth = remove_invalid_records( self->refobj, &self->spot_groups, self->current_pos );
-
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorNextPos ( ReferenceIterator *self, bool skip_empty )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        self->current_rec = NULL;
-        if ( self->need_init )
-        {
-            rc = first_ref_iter_nxt_pos( self, skip_empty );
-        }
-        else
-        {
-            /* increment the current position */
-            self->current_pos++;
-
-            if ( self->current_pos <= self->last_pos )
-            {
-                /* jump over gaps, if requested ... */
-                if ( self->depth == 0 && skip_empty )
-                {
-                    self->current_pos = self->nxt_avail_pos;
-                }
-
-                /* increment the internal alignment-iterator of every placement-record */
-                inc_alignment_iterators( &self->spot_groups, self->current_pos );
-
-                /* loop through the list to look if we have to remove records,
-                   that do end before this new position */
-                self->depth = remove_invalid_records( self->refobj, &self->spot_groups, self->current_pos );
-
-                rc = fill_recordlist( self, self->current_pos );
-                if ( rc == 0 )
-                {
-                    self->current_spot_group = NULL;
-                    /* set our sights to the next position... */
-                    rc = PlacementSetIteratorNextAvailPos ( self->pl_set_iter, &self->nxt_avail_pos, NULL );
-                    if ( GetRCState( rc ) == rcDone )
-                    {
-                        if ( self->depth > 0 )
-                        {
-                            rc = 0;
-                        }
-                        else if ( !skip_empty )
-                        {
-                            if ( self->current_pos <= self->last_pos ) rc = 0;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-                clear_spot_group_list( &self->spot_groups );
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorPosition ( const ReferenceIterator *self,
-    INSDC_coord_zero *pos, uint32_t * depth, INSDC_4na_bin * base )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        /* return position, many records our record-list, and the base at this position */
-        if ( pos != NULL )
-        {
-            *pos = self->current_pos;
-        }
-
-        if ( depth != NULL )
-        {
-            *depth = self->depth;
-        }
-
-        if ( base != NULL )
-        {
-            uint32_t written;
-            *base = 0;
-            /* problem! how to get the base if depth == 0 */
-            if ( self->current_rec != NULL )
-            {
-                rc = ReferenceObj_Read( self->current_rec->ref, self->current_pos, 1, base, &written );
-            }
-            else if ( self->refobj != NULL )
-            {
-                rc = ReferenceObj_Read( self->refobj, self->current_pos, 1, base, &written );
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorNextPlacement ( ReferenceIterator *self,
-    const PlacementRecord **rec )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-    {
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    }
-    else if ( rec == NULL )
-    {
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcParam, rcNull );
-    }
-    else
-    {
-        if ( self->current_spot_group == NULL )
-        {
-            rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-        }
-        else
-        {
-            if ( self->current_rec == NULL )
-            {
-                self->current_rec = ( PlacementRecord * )DLListHead( &self->current_spot_group->records );
-            }
-            else
-            {
-                self->current_rec = ( PlacementRecord * )DLNodeNext( ( DLNode * )self->current_rec );
-            }
-
-            if ( self->current_rec == NULL )
-            {
-                rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-            }
-            else
-            {
-                *rec = self->current_rec;
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceIteratorGetPlacement ( ReferenceIterator *self,
-    const PlacementRecord **rec )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-    {
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
-    }
-    else if ( rec == NULL )
-    {
-        rc = RC( rcAlign, rcIterator, rcAccessing, rcParam, rcNull );
-    }
-    else
-    {
-        if ( self->current_spot_group == NULL )
-        {
-            rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-        }
-        else
-        {
-            if ( self->current_rec != NULL )
-            {
-                /* remove the 'previous' current-rec! */
-                DLListPopHead ( &self->current_spot_group->records );
-                PlacementRecordWhack ( self->current_rec );
-                self->depth--;
-                self->current_rec = NULL;
-            }
-
-            self->current_rec = ( PlacementRecord * )DLListHead( &self->current_spot_group->records );
-            if ( self->current_rec == NULL )
-            {
-                rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
-            }
-            else
-            {
-                *rec = self->current_rec;
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT int32_t CC ReferenceIteratorState ( const ReferenceIterator *self,
-    INSDC_coord_zero *seq_pos )
-{
-    int32_t res = align_iter_invalid;
-    if ( seq_pos != NULL )
-    {
-        *seq_pos = 0;
-    }
-    if ( self != NULL )
-    {
-        /* PlacementRecordCast returns NULL if self->current_rec is NULL */
-        AlignmentIterator * al_iter = PlacementRecordCast ( self->current_rec, placementRecordExtension0 );
-        if ( al_iter != NULL )
-            res = AlignmentIteratorState ( al_iter, seq_pos );
-    }
-    return res;
-}
-
-
-LIB_EXPORT uint32_t CC ReferenceIteratorBasesInserted ( const ReferenceIterator *self,
-    const INSDC_4na_bin **bases )
-{
-    uint32_t res = align_iter_invalid;
-    if ( bases != NULL )
-    {
-        *bases = NULL;
-    }
-    if ( self != NULL )
-    {
-        /* PlacementRecordCast returns NULL if self->current_rec is NULL */
-        AlignmentIterator * al_iter = PlacementRecordCast ( self->current_rec, placementRecordExtension0 );
-        if ( al_iter != NULL )
-            res = AlignmentIteratorBasesInserted( al_iter, bases );
-    }
-    return res;
-}
-
-
-LIB_EXPORT uint32_t CC ReferenceIteratorBasesDeleted ( const ReferenceIterator *self,
-    INSDC_coord_zero *pos, const INSDC_4na_bin **bases )
-{
-    uint32_t res = align_iter_invalid;
-    if ( bases != NULL )
-    {
-        *bases = NULL;
-    }
-    if ( self != NULL )
-    {
-        /* PlacementRecordCast returns NULL if self->current_rec is NULL */
-        AlignmentIterator * al_iter = PlacementRecordCast ( self->current_rec, placementRecordExtension0 );
-        if ( al_iter != NULL )
-        {
-            INSDC_coord_zero temp_pos;
-            res = AlignmentIteratorBasesDeleted( al_iter, &temp_pos );
-            if ( ( res & align_iter_invalid ) != align_iter_invalid )
-            {
-                if ( pos != NULL ) { *pos = temp_pos; }
-                /* where to get the reference-bases from ? PlacementRecord.ref ! */
-                if ( res > 0 && bases != NULL )
-                {
-                    uint8_t * buffer = malloc( res );
-                    if ( buffer != NULL )
-                    {
-                        INSDC_coord_len written;
-                        rc_t rc = ReferenceObj_Read( self->current_rec->ref, temp_pos, res, buffer, &written );
-                        if ( rc == 0 )
-                        {
-                            *bases = buffer;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return res;
-}
diff --git a/libs/align/reference-cmn.c b/libs/align/reference-cmn.c
deleted file mode 100644
index 59e7c3d..0000000
--- a/libs/align/reference-cmn.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <insdc/insdc.h>
-
-#include "reference-cmn.h"
-#include <sysalloc.h>
-
-rc_t CC ReferenceSeq_ReOffset(bool circular, INSDC_coord_len seq_len, INSDC_coord_zero* offset)
-{
-    if( !circular && (*offset < 0 || *offset >= seq_len) ) {
-        return RC(rcAlign, rcType, rcReading, rcOffset, rcOutofrange);
-    } else if( *offset < 0 ) {
-        *offset = seq_len - ((-(*offset)) % seq_len);
-    } else if( circular && *offset > seq_len ) {
-        *offset %= seq_len;
-    }
-    return 0;
-}
diff --git a/libs/align/reference-cmn.h b/libs/align/reference-cmn.h
deleted file mode 100644
index 76fac49..0000000
--- a/libs/align/reference-cmn.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was readten as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_reference_cmn_
-#define _h_align_reference_cmn_
-
-#include <klib/defs.h>
-
-/* Validates and adjusts offset for a RefSeq based on its attributes
- * circular [IN]
- * seq_len [IN]
- * offset [IN,OUT] always be >= 0 upon return
- */
-rc_t CC ReferenceSeq_ReOffset(bool circular, INSDC_coord_len seq_len, INSDC_coord_zero* offset);
-
-#endif /* _h_align_reference_cmn_ */
diff --git a/libs/align/reference.c b/libs/align/reference.c
deleted file mode 100644
index 8827072..0000000
--- a/libs/align/reference.c
+++ /dev/null
@@ -1,1943 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/refcount.h>
-#include <klib/vector.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <insdc/insdc.h>
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/cursor.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <align/iterator.h>
-#include <align/reference.h>
-#include <align/refseq-mgr.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "reader-cmn.h"
-#include "reference-cmn.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-/* This is a temporary define, used to test code to deal with
-   circular references and new means of tracking window end */
-
-enum EReferenceList_ColNames
-{
-    ereflst_cn_READ_dna,
-    ereflst_cn_READ_4na,
-    ereflst_cn_SEQ_LEN,
-    ereflst_cn_PRIMARY_ALIGNMENT_IDS,
-    ereflst_cn_SECONDARY_ALIGNMENT_IDS,
-    ereflst_cn_EVIDENCE_INTERVAL_IDS,
-    ereflst_cn_OVERLAP_REF_POS,
-    ereflst_cn_OVERLAP_REF_LEN
-};
-
-const TableReaderColumn ReferenceList_cols[] =
-{
-    { 0, "(INSDC:dna:text)READ",    { NULL }, 0, 0 },
-    { 0, "(INSDC:4na:bin)READ",     { NULL }, 0, ercol_Skip },
-    { 0, "SEQ_LEN",                 { NULL }, 0, 0 },
-    { 0, "PRIMARY_ALIGNMENT_IDS",   { NULL }, 0, ercol_Skip },
-    { 0, "SECONDARY_ALIGNMENT_IDS", { NULL }, 0, ercol_Skip | ercol_Optional },
-    { 0, "EVIDENCE_INTERVAL_IDS",   { NULL }, 0, ercol_Skip | ercol_Optional },
-    { 0, "OVERLAP_REF_POS",         { NULL }, 0, ercol_Optional },
-    { 0, "OVERLAP_REF_LEN",         { NULL }, 0, ercol_Optional },
-    { 0, NULL,                      { NULL }, 0, 0 }
-};
-
-enum EPlacementIterator_ColNames
-{
-    eplacementiter_cn_REF_POS,
-    eplacementiter_cn_REF_LEN,
-    eplacementiter_cn_MAPQ,
-    eplacementiter_cn_READ_GROUP
-};
-
-const TableReaderColumn PlacementIterator_cols[] =
-{
-    { 0, "REF_POS",     { NULL }, 0, 0 },
-    { 0, "REF_LEN",     { NULL }, 0, 0 },
-    { 0, "MAPQ",        { NULL }, 0, 0 },
-    { 0, "SPOT_GROUP",  { NULL }, 0, 0 },
-    { 0, NULL,          { NULL }, 0, 0 }
-};
-
-struct ReferenceList
-{
-    KRefcount refcount;
-    const RefSeqMgr* refseqmgr;
-    const VCursor* cursor;
-    BSTree name_tree;
-    BSTree seqid_tree;
-    uint32_t options;
-    size_t cache;
-    uint32_t max_seq_len;
-    uint32_t nodes_qty;
-    uint32_t nodes_max_qty;
-    const TableReader* reader;
-    TableReaderColumn reader_cols[ sizeof( ReferenceList_cols ) / sizeof( ReferenceList_cols[ 0 ] ) ];
-    const TableReader* iter;
-    TableReaderColumn iter_cols[ sizeof( PlacementIterator_cols ) / sizeof( PlacementIterator_cols[ 0 ] ) ];
-    /* last are children using realloc!! */
-    ReferenceObj* nodes[ 2 ];
-};
-
-struct ReferenceObj
-{
-    /* we use this in 2 lists so we need to adjust results of Find, etc calls for name tree!! */
-    BSTNode by_seqid; /* primary key */
-    BSTNode by_name; /* struct addr will be by_name[-1]; */
-    ReferenceList* mgr;
-    uint32_t id;
-    uint32_t bin;
-    char* name;
-    char* seqid;
-    bool circular;
-    bool read_present;
-    int64_t start_rowid;
-    int64_t end_rowid;
-    INSDC_coord_len seq_len;
-};
-
-
-static int CC ReferenceObj_CmpSeqId( const void *item, const BSTNode *n )
-{
-    return strcasecmp( ( const char* )item, ( ( const ReferenceObj* )n )->seqid );
-}
-
-
-static int CC ReferenceObj_SortSeqId( const BSTNode *item, const BSTNode *n )
-{
-    return ReferenceObj_CmpSeqId( ( ( const ReferenceObj* )item )->seqid, n );
-}
-
-
-static int CC ReferenceObj_CmpName( const void *item, const BSTNode *n )
-{
-    return strcasecmp( ( const char* )item, ( ( const ReferenceObj* )&n[ -1 ] )->name );
-}
-
-
-static int CC ReferenceObj_SortName( const BSTNode *item, const BSTNode *n )
-{
-    return ReferenceObj_CmpName( ( ( const ReferenceObj* )&item[ -1 ] )->name, n );
-}
-
-static rc_t ReferenceObj_Alloc( ReferenceObj** self, const char* seqid, size_t seqid_sz,
-                                const char* name, size_t name_sz)
-{
-    rc_t rc = 0;
-    if ( self == NULL || seqid == NULL || seqid_sz == 0 || name == NULL || name_sz == 0 )
-    {
-        rc = RC( rcAlign, rcIndex, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        ReferenceObj* obj = calloc( 1,  sizeof( *obj ) + seqid_sz + 1 + name_sz + 1 );
-        if ( obj == NULL )
-        {
-            rc = RC( rcAlign, rcIndex, rcConstructing, rcMemory, rcExhausted );
-        }
-        else
-        {
-            obj->seqid = ( char* )&obj[ 1 ];
-            obj->name = obj->seqid;
-            obj->name += seqid_sz + 1;
-            memcpy( obj->seqid, seqid, seqid_sz );
-            obj->seqid[ seqid_sz ] = '\0';
-            memcpy( obj->name, name, name_sz );
-            obj->name[ name_sz ] = '\0';
-            *self = obj;
-        }
-    }
-    return rc;
-}
-
-
-/* helper function for ReferenceList_MakeCursor() */
-static rc_t ReferenceList_handle_filter( const KIndex* iname, const char * filt_name, uint32_t bin_size,
-                                         int64_t *start, int64_t tbl_start, uint64_t *count, int *bin_num,
-                                         TableReaderColumn *h, const TableReader* tmp )
-{
-    rc_t rc = 0;
-    if ( strncmp( filt_name, "START_ROW:", 10 ) )
-    {
-        if ( bin_size == 0 || strncmp( filt_name, "BIN_NUM:", 8 ) )
-        {
-            rc = KIndexFindText( iname, filt_name, start, count, NULL, NULL );
-            if( rc == 0 && bin_size > 0 )
-            {
-                /** change start to the beginning of the bin **/
-                *bin_num = ( *start - tbl_start ) / bin_size;
-            }
-        }
-        else
-        {
-            *bin_num = atoi( filt_name + 8 );
-        }
-        if ( bin_size > 0 )
-        {
-            *start = tbl_start + ( bin_size * (*bin_num) );
-            rc = TableReader_ReadRow( tmp, *start );
-            if ( rc == 0 )
-            {
-                int64_t r_start;
-                char name[ 4096 ];
-                if ( h[ 0 ].len < sizeof( name ) )
-                {
-                    memcpy( name, h[ 0 ].base.str, h[ 0 ].len );
-                    name[ h[ 0 ].len ] = '\0';
-                    rc = KIndexFindText( iname, name, &r_start, count, NULL, NULL );
-                    if ( rc == 0 && *start > r_start )
-                    { /*** move start to the beginning of the fully contained sequence **/
-                        *start = r_start + *count;
-                    }
-                }
-                else
-                {
-                    rc = RC( rcAlign, rcType, rcConstructing, rcName, rcTooLong );
-                }
-            }
-        }
-    }
-    else
-    {
-        int64_t req_start = atoi( filt_name + 10 );
-        if ( req_start >= *start && req_start < *start + *count )
-        {
-            int64_t delta = req_start - *start;
-            *start = req_start;
-            *count -= delta;
-        }
-        else
-        {
-            rc = RC( rcAlign, rcType, rcConstructing, rcId, rcOutofrange );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_MakeCursor( const ReferenceList** cself, const VCursor* cursor, uint32_t options,
-                                             const char* filt_name, const uint32_t numbins )
-{
-    rc_t rc = 0;
-    ReferenceList* self = NULL;
-
-    if ( cself == NULL || cursor == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else if ( ( self = calloc( 1, sizeof( *self ) ) ) == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcMemory, rcExhausted );
-    }
-    else
-    {
-        const TableReader* tmp = NULL;
-        uint32_t bin_size;
-        int bin_num = -1;
-        TableReaderColumn h[] =
-        {
-            { 0, "NAME",        {NULL}, 0, 0 }, /*0*/
-            { 0, "SEQ_ID",      {NULL}, 0, 0 }, /*1*/
-            { 0, "SEQ_LEN",     {NULL}, 0, 0 }, /*2*/
-            { 0, "CIRCULAR",    {NULL}, 0, 0 }, /*3*/
-            { 0, "MAX_SEQ_LEN", {NULL}, 0, 0 }, /*4*/
-            { 0, "SEQ_START",   {NULL}, 0, 0 }, /*5*/
-            { 0, "CMP_READ",    {NULL}, 0, 0 }, /*6*/
-            { 0, NULL,          {NULL}, 0, 0 }
-        };
-        KRefcountInit( &self->refcount, 1, "ReferenceList", "Make", "align" );
-        BSTreeInit( &self->name_tree );
-        BSTreeInit( &self->seqid_tree );
-        self->options = options;
-        self->nodes_max_qty = sizeof( self->nodes ) / sizeof( self->nodes[ 0 ] );
-
-        rc = VCursorAddRef( self->cursor = cursor );
-        if ( rc == 0 )
-        {
-            rc = TableReader_MakeCursor( &tmp, cursor, h );
-            if ( rc == 0 )
-            {
-                int64_t start, tbl_start, tbl_stop;
-                uint64_t count;
-                const KIndex* iname = NULL;
-                bool only_one = false;
-
-                /* index is optional */
-                rc_t rctmp = TableReader_OpenIndex( tmp, "i_name", &iname );
-                ALIGN_DBGERRP( "index '%s' was not found", rctmp, "i_name" );
-
-                rc = TableReader_IdRange( tmp, &start, &count );
-                assert( rc == 0 );
-                tbl_start = start;
-                tbl_stop  = start + count -1;
-                if ( numbins > 0 )
-                {
-                    bin_size = ( count + numbins -1 ) / numbins;
-                }
-                else
-                {
-                    bin_size = 0;
-                }
-
-                if ( iname && filt_name )
-                {
-                    if ( bin_size == 0 )
-                    {
-                        only_one = true;
-                    }
-                    rc = ReferenceList_handle_filter( iname, filt_name, bin_size, &start, tbl_start,
-                                                      &count, &bin_num, h, tmp );
-                }
-
-                if ( rc == 0 )
-                {
-                    ReferenceObj* node = NULL;
-                    uint32_t last_name_len = 0;
-                    bool read_determination_done = false;
-
-                    while ( rc == 0  && start <= tbl_stop )
-                    {
-                        if ( bin_num < 0 && count == 0 )
-                        {
-                            /*** normal loop without binning ***/
-                            break;
-                        }
-                        rc = TableReader_ReadRow( tmp, start );
-                        if ( rc == 0 )
-                        {
-                            if ( node == NULL || last_name_len != h[0].len ||
-                                 strncmp( h[ 0 ].base.str, node->name, h[ 0 ].len) != 0 )
-                            {
-                                uint32_t cur_bin = ( bin_size > 0 ) ? ( start-tbl_start ) / bin_size : 0;
-                                if ( only_one && self->nodes_qty == 1 )
-                                {
-                                    break;
-                                }
-                                if ( bin_num >= 0 && cur_bin != bin_num )
-                                {
-                                    break;
-                                }
-                                if ( node == NULL && h[ 4 ].len > 0 )
-                                {
-                                    self->max_seq_len = h[ 4 ].base.u32[ 0 ];
-                                }
-                                if ( self->nodes_qty == self->nodes_max_qty )
-                                {
-                                    ReferenceList* tmp = realloc( self, sizeof( *self ) + sizeof( node ) * self->nodes_max_qty );
-                                    if ( tmp == NULL )
-                                    {
-                                        rc = RC(rcAlign, rcType, rcConstructing, rcMemory, rcExhausted);
-                                    }
-                                    else
-                                    {
-                                        self = tmp;
-                                        self->nodes_max_qty += sizeof( self->nodes ) / sizeof( self->nodes[ 0 ] );
-                                    }
-                                }
-                                if ( rc == 0 )
-                                {
-                                    rc = ReferenceObj_Alloc( &node, h[ 1 ].base.str, h[ 1 ].len, h[ 0 ].base.str, h[ 0 ].len );
-                                    if ( rc == 0 )
-                                    {
-                                        node->id = self->nodes_qty;
-                                        self->nodes[ self->nodes_qty++ ] = node;
-                                        last_name_len = h[ 0 ].len;
-                                        node->circular = h[ 3 ].len ? h[ 3 ].base.buul[ 0 ] : false;
-                                        node->start_rowid = start;
-                                        node->seq_len = 0;
-                                        node->bin = cur_bin;
-                                        read_determination_done = false;
-                                        rc = BSTreeInsertUnique( &self->seqid_tree, &node->by_seqid, NULL, ReferenceObj_SortSeqId );
-                                        if ( rc == 0 )
-                                        {
-                                            rc = BSTreeInsertUnique( &self->name_tree, &node->by_name, NULL, ReferenceObj_SortName );
-                                        }
-                                    }
-                                }
-                            }
-                            if ( rc == 0 )
-                            {
-                                INSDC_coord_len cur_seq_len = h[ 2 ].base.coord_len[ 0 ];
-                                if ( cur_seq_len == 0 )
-                                {
-                                    /* assign it to max-seq-len */
-                                    cur_seq_len = h[ 4 ].base.coord_len[ 0 ];
-                                }
-
-                                if ( h[ 6 ].len > 0 )
-                                {/** CMP_READ > 0 -- truly local ***/
-                                    node->read_present = true; 
-                                    read_determination_done = true;
-                                }
-                                else if ( h[ 5 ].base.coord1[ 0 ] != 0 )
-                                { /*** truly remote ***/
-                                    node->read_present = false;
-                                    read_determination_done = true;
-                                } /*** else still not sure **/
-
-                                if ( read_determination_done && iname != NULL )
-                                {
-                                    /* scroll to last row for this reference projecting the seq_len */
-                                    int64_t r_start;
-                                    uint64_t r_count;
-                                    if ( KIndexFindText( iname, node->name, &r_start, &r_count, NULL, NULL ) == 0 )
-                                    {
-                                        assert( node->start_rowid == r_start );
-                                        /* not last ref row */
-                                        if ( start != r_start + r_count - 1 )
-                                        {
-                                            /* we need to pickup last row SEQ_LEN for this reference
-                                            so we step back 2 rows in table from this ref end row
-                                            and also skip rows already scanned for read presence */
-                                            r_count -= ( start - r_start ) + 2;
-                                            node->seq_len += cur_seq_len * r_count;
-                                            start += r_count;
-                                            count -= r_count;
-                                        }
-                                    }
-                                }
-                                node->seq_len += cur_seq_len;
-                                node->end_rowid = start;
-                            }
-                        }
-                        else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcRow )
-                        {
-                            rc = 0;
-                        }
-                        start++;
-                        count--;
-                    }
-                    for ( start = 0; rc == 0 && start < self->nodes_qty; start++ )
-                    {
-                        self->nodes[ start ]->mgr = self;
-                    }
-                    if ( rc == 0 && self->max_seq_len == 0 )
-                    {
-                        rc = RC(rcAlign, rcType, rcConstructing, rcData, rcCorrupt);
-                    }
-                }
-                KIndexRelease( iname );
-            }
-        }
-        TableReader_Whack( tmp );
-    }
-
-    if ( rc == 0 )
-    {
-        *cself = self;
-        /* ALIGN_DBG("created 0x%p with cursor 0x%p", self, cursor); */
-    }
-    else
-    {
-        *cself = NULL;
-        ReferenceList_Release( self );
-        /* ALIGN_DBGERRP( "failed for cursor 0x%p", rc, cursor ); */
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_MakeTable( const ReferenceList** cself, const VTable* table, uint32_t options,
-                                            size_t cache, const char* filt_name, const uint32_t numbins )
-{
-    rc_t rc = 0;
-    const VCursor* curs;
-
-    if ( table == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = VTableCreateCachedCursorRead( table, &curs, cache );
-        if ( rc == 0 )
-        {
-            rc = VCursorPermitPostOpenAdd( curs );
-            if ( rc == 0 )
-            {
-                rc = ReferenceList_MakeCursor( cself, curs, options, filt_name, numbins );
-                if ( rc == 0 )
-                {
-                    ( (ReferenceList*)(*cself))->cache = cache;
-                }
-                VCursorRelease(curs);
-            }
-        }
-    }
-    ALIGN_DBGERRP( "failed for table 0x%p", rc, table );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_MakeDatabase( const ReferenceList** cself, const VDatabase* db, uint32_t options,
-                                               size_t cache, const char* name, const uint32_t numbins )
-{
-    rc_t rc = 0;
-    const VTable* tbl = NULL;
-    const char* nm = "REFERENCE";
-    /*const char* nm = (options & ereferencelist_useEvidence) ? "EVIDENCE_INTERVAL" : "REFERENCE";*/
-
-    if ( db == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = VDatabaseOpenTableRead( db, &tbl, nm );
-        if ( rc == 0 )
-        {
-            rc = ReferenceList_MakeTable( cself, tbl, options, cache, name, numbins );
-            VTableRelease( tbl );
-        }
-    }
-    ALIGN_DBGERRP( "failed for database 0x%p", rc, db );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_MakePath( const ReferenceList** cself, const VDBManager* vmgr, const char* dbpath,
-                                           uint32_t options, size_t cache, const char* name, const uint32_t numbins )
-{
-    rc_t rc = 0;
-    const VDatabase* db = NULL;
-
-    if ( vmgr == NULL || dbpath == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = VDBManagerOpenDBRead( vmgr, &db, NULL, "%s", dbpath );
-        if ( rc == 0 )
-        {
-            rc = ReferenceList_MakeDatabase( cself, db, options, cache, name, numbins );
-            VDatabaseRelease( db );
-        }
-    }
-    ALIGN_DBGERRP( "failed for database %s", rc, dbpath );
-    return rc;
-}
-
-
-static rc_t ReferenceList_OpenCursor( ReferenceList* self )
-{
-    rc_t rc = 0;
-
-    assert( self != NULL );
-
-    memcpy( self->reader_cols, ReferenceList_cols, sizeof( ReferenceList_cols ) );
-
-    if ( self->options & ereferencelist_4na )
-    {
-        self->reader_cols[ ereflst_cn_READ_dna ].flags |= ercol_Skip;
-        self->reader_cols[ ereflst_cn_READ_4na ].flags &= ~ercol_Skip;
-    }
-
-    if ( self->options & ereferencelist_usePrimaryIds )
-    {
-        self->reader_cols[ ereflst_cn_PRIMARY_ALIGNMENT_IDS ].flags &= ~ercol_Skip;
-    }
-
-    if ( self->options & ereferencelist_useSecondaryIds )
-    {
-        self->reader_cols[ ereflst_cn_SECONDARY_ALIGNMENT_IDS ].flags &= ~ercol_Skip;
-    }
-
-    if ( self->options & ereferencelist_useEvidenceIds )
-    {
-        self->reader_cols[ ereflst_cn_EVIDENCE_INTERVAL_IDS ].flags &= ~ercol_Skip;
-    }
-
-    if ( !( self->options &
-          ( ereferencelist_usePrimaryIds | ereferencelist_useSecondaryIds | ereferencelist_useEvidenceIds ) ) )
-    {
-        self->reader_cols[ ereflst_cn_OVERLAP_REF_POS ].flags |= ercol_Skip;
-        self->reader_cols[ ereflst_cn_OVERLAP_REF_LEN ].flags |= ercol_Skip;
-    }
-    rc = TableReader_MakeCursor( &self->reader, self->cursor, self->reader_cols );
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-static rc_t ReferenceList_OpenCursor2( ReferenceList* self, align_id_src ids )
-{
-    rc_t rc = 0;
-
-    assert( self != NULL );
-    if ( ids != primary_align_ids && ids != secondary_align_ids && ids != evidence_align_ids )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcOutofrange );
-    }
-    else if ( ids == primary_align_ids && !( self->options & ereferencelist_usePrimaryIds ) )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else if ( ids == secondary_align_ids && !( self->options & ereferencelist_useSecondaryIds ) )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else if ( ids == evidence_align_ids && !( self->options & ereferencelist_useEvidenceIds ) )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        const VTable* vtbl = NULL;
-        rc = VCursorOpenParentRead( self->cursor, &vtbl );
-        if ( rc == 0 )
-        {
-            if ( rc == 0 )
-            {
-                const VDatabase* db = NULL;
-                rc = VTableOpenParentRead( vtbl, &db );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenTableRead( db, &vtbl, ids == primary_align_ids ? "PRIMARY_ALIGNMENT" :
-                           ( ids == secondary_align_ids ? "SECONDARY_ALIGNMENT" : "EVIDENCE_INTERVAL" ) );
-                    if ( rc == 0 )
-                    {
-                        memcpy( self->iter_cols, PlacementIterator_cols, sizeof( PlacementIterator_cols ) );
-                        rc = TableReader_Make( &self->iter, vtbl, self->iter_cols, self->cache );
-                    }
-                    VDatabaseRelease( db );
-                }
-            }
-            VTableRelease( vtbl );
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-static rc_t ReferenceList_RefSeqMgr( const ReferenceList* cself, const RefSeqMgr** rmgr )
-{
-    rc_t rc = 0;
-
-    assert( rmgr != NULL );
-
-    if ( cself->refseqmgr == NULL )
-    {
-        const VTable* vtbl = NULL;
-        rc = VCursorOpenParentRead( cself->cursor, &vtbl );
-        if ( rc == 0 )
-        {
-            const VDBManager* vmgr;
-            rc = VTableOpenManagerRead( vtbl, &vmgr );
-            if ( rc == 0 )
-            {
-                rc = RefSeqMgr_Make( &( (ReferenceList*)cself )->refseqmgr, vmgr,
-                                     ( cself->options & ereferencelist_4na ) ? errefseq_4NA : 0, cself->cache, 2 );
-                VDBManagerRelease( vmgr );
-            }
-            VTableRelease( vtbl );
-        }
-    }
-    *rmgr = cself->refseqmgr;
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_AddRef( const ReferenceList *cself )
-{
-    rc_t rc = 0;
-    if ( cself != NULL )
-    {
-        if ( KRefcountAdd( &cself->refcount, "ReferenceList" ) != krefOkay )
-        {
-            rc = RC( rcAlign, rcType, rcAttaching, rcError, rcUnexpected );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT void CC ReferenceList_Release( const ReferenceList* cself )
-{
-    if ( cself != NULL )
-    {
-        if ( KRefcountDrop(&cself->refcount, "ReferenceList") == krefWhack )
-        {
-            ReferenceList* self = ( ReferenceList* )cself;
-            TableReader_Whack( self->reader );
-            TableReader_Whack( cself->iter );
-            RefSeqMgr_Release( self->refseqmgr );
-            while( self->nodes_qty-- > 0 )
-            {
-                free( self->nodes[ self->nodes_qty ] );
-            }
-            VCursorRelease( cself->cursor );
-            KRefcountWhack( &self->refcount, "ReferenceList" );
-            free( self );
-        }
-    }
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_Count(const ReferenceList* cself, uint32_t* count)
-{
-    rc_t rc = 0;
-    if ( cself == NULL || count == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcNull );
-    }
-    else
-    {
-        *count = cself->nodes_qty;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_Find( const ReferenceList* cself, const ReferenceObj** obj,
-                                       const char* key, size_t key_sz )
-{
-    rc_t rc = 0;
-    char buf[4096], *b = buf;
-
-    if ( cself == NULL || obj == NULL || key == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcSearching, rcParam, rcNull );
-    }
-    else if ( key_sz >= sizeof( buf ) && ( b = malloc( key_sz + 1 ) ) == NULL )
-    {
-        rc = RC(rcAlign, rcType, rcSearching, rcMemory, rcExhausted);
-    }
-    else
-    {
-        memcpy( b, key, key_sz );
-        b[ key_sz ] = '\0';
-        *obj = ( ReferenceObj* )BSTreeFind( &cself->seqid_tree, b, ReferenceObj_CmpSeqId );
-        if ( *obj == NULL )
-        {
-            const BSTNode* n = BSTreeFind( &cself->name_tree, b, ReferenceObj_CmpName );
-            if ( n != NULL )
-            {
-                *obj = ( ReferenceObj* )&n[ -1 ];
-            }
-        }
-        if ( *obj == NULL )
-        {
-            rc = RC( rcAlign, rcType, rcSearching, rcItem, rcNotFound );
-        }
-        else
-        {
-            rc = ReferenceList_AddRef( cself );
-            if ( rc != 0 )
-            {
-                *obj = NULL;
-            }
-        }
-
-        if ( b != buf )
-        {
-            free( b );
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceList_Get( const ReferenceList* cself, const ReferenceObj** obj, uint32_t idx )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || obj == NULL || idx >= cself->nodes_qty )
-    {
-        rc = RC( rcAlign, rcType, rcRetrieving, rcParam, rcInvalid );
-    }
-    else
-    {
-        rc = ReferenceList_AddRef( cself );
-        if ( rc == 0 )
-        {
-            *obj = cself->nodes[ idx ];
-        }
-        else
-        {
-            *obj = NULL;
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t ReferenceObj_AddRef( const ReferenceObj *cself )
-{
-    if ( cself == NULL )
-    {
-        return RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    } 
-    else
-    {
-        return ReferenceList_AddRef( cself->mgr );
-    }
-}
-
-
-LIB_EXPORT void ReferenceObj_Release( const ReferenceObj *cself )
-{
-    ReferenceList_Release( cself ? cself->mgr : NULL );
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_Idx( const ReferenceObj* cself, uint32_t* idx )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || idx == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *idx = cself->id;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_IdRange( const ReferenceObj* cself, int64_t* start, int64_t* stop )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || (start == NULL && stop == NULL) )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        if ( start != NULL )
-        {
-            *start = cself->start_rowid;
-        }
-        if ( stop != NULL )
-        {
-            *stop = cself->end_rowid;
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_Bin( const ReferenceObj* cself, uint32_t* bin )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || bin == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *bin = cself->bin;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_SeqId( const ReferenceObj* cself, const char** seqid )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || seqid == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *seqid = cself->seqid;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_Name( const ReferenceObj* cself, const char** name )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || name == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *name = cself->name;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_SeqLength( const ReferenceObj* cself, INSDC_coord_len* len )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || len == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *len = cself->seq_len;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_Circular( const ReferenceObj* cself, bool* circular )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || circular == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *circular = cself->circular;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_External( const ReferenceObj* cself, bool* external, char** path )
-{
-    rc_t rc = 0;
-
-    if ( cself == NULL || external == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        const RefSeqMgr* rmgr;
-        *external = !cself->read_present;
-        if ( path != NULL && !cself->read_present )
-        {
-            rc = ReferenceList_RefSeqMgr( cself->mgr, &rmgr );
-            if ( rc == 0 )
-            {
-                *path = NULL;
-                rc = RefSeqMgr_Exists( rmgr, cself->seqid, string_size( cself->seqid ), NULL );
-                if ( GetRCObject( rc ) == rcTable && GetRCState( rc ) == rcNotFound )
-                {
-                    rc = 0;
-                }
-            }
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_Read( const ReferenceObj* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                      uint8_t* buffer, INSDC_coord_len* written )
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || buffer == NULL || written == NULL )
-    {
-        rc = RC ( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        rc = ReferenceSeq_ReOffset( cself->circular, cself->seq_len, &offset );
-        if ( rc == 0 )
-        {
-            if ( cself->mgr->reader != NULL || ( rc = ReferenceList_OpenCursor( cself->mgr ) ) == 0 )
-            {
-                int cid = ( cself->mgr->options & ereferencelist_4na ) ? ereflst_cn_READ_4na : ereflst_cn_READ_dna;
-                INSDC_coord_len q = 0;
-                *written = 0;
-                do
-                {
-                    int64_t rowid = cself->start_rowid + offset / cself->mgr->max_seq_len;
-                    INSDC_coord_zero s = offset % cself->mgr->max_seq_len;
-                    rc = TableReader_ReadRow( cself->mgr->reader, rowid );
-                    if ( rc == 0 )
-                    {
-                        q = cself->mgr->reader_cols[ereflst_cn_SEQ_LEN].base.coord_len[0] - s;
-                        if ( q > len ) { q = len; }
-                        memcpy( &buffer[ *written ], &cself->mgr->reader_cols[ cid ].base.str[ s ], q );
-                        *written += q;
-                        offset += q;
-                        len -= q;
-                    }
-                    /* SEQ_LEN < MAX_SEQ_LEN is last row unless it is CIRCULAR */
-                    if ( cself->mgr->reader_cols[ ereflst_cn_SEQ_LEN ].base.coord_len[ 0 ] < cself->mgr->max_seq_len )
-                    {
-                        if ( !cself->circular ) { break; }
-                        offset = 0;
-                    }
-                } while ( rc == 0 && q > 0 && len > 0 );
-            }
-        }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_GetIdCount( const ReferenceObj* cself, int64_t row_id, uint32_t *count )
-{
-    rc_t rc = 0;
-
-    if ( cself == NULL || count == NULL )
-    {
-        rc = RC ( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else if ( cself->mgr == NULL )
-    {
-        rc = RC ( rcAlign, rcType, rcAccessing, rcItem, rcInvalid );
-    }
-    else
-    {
-        *count = 0;
-
-        if ( cself->mgr->reader == NULL )
-            rc = ReferenceList_OpenCursor( cself->mgr );
-
-        if ( rc == 0 )
-        {
-            rc = TableReader_ReadRow( cself->mgr->reader, row_id );
-            if ( rc == 0 )
-            {
-                TableReaderColumn *col = &( cself->mgr->reader_cols[ ereflst_cn_PRIMARY_ALIGNMENT_IDS ] );
-                count[ 0 ] = col->len;
-                col = &( cself->mgr->reader_cols[ ereflst_cn_SECONDARY_ALIGNMENT_IDS ] );
-                count[ 1 ] = col->len;
-                col = &( cself->mgr->reader_cols[ ereflst_cn_EVIDENCE_INTERVAL_IDS ] );
-                count[ 2 ] = col->len;
-            }
-        }
-    }
-    return rc;
-}
-
-
-typedef struct PlacementRecExtensionInfo PlacementRecExtensionInfo;
-struct PlacementRecExtensionInfo
-{
-    /* data, destructor and size for extension 1 */
-    void * data;
-    void ( CC * destroy ) ( void *obj, void *data );
-    size_t size;
-};
-
-
-LIB_EXPORT void * CC PlacementRecordCast ( const PlacementRecord *self, uint32_t ext )
-{
-    void * res = NULL;
-    if ( self != NULL )
-    {
-        uint8_t * ptr = ( uint8_t * ) self;
-        PlacementRecExtensionInfo * ext_info;
-
-/**********************************************
-    +---------------+
-    | core          |   PlacementRecord *
-    +---------------+
-    | read_group    |   char *
-    +---------------+
-    | ext_info1     |   PlacementRecExtensionInfo *
-    | ext_info2     |   PlacementRecExtensionInfo *
-    +---------------+
-    | ext1          |   ??? *
-    +---------------+
-    | ext2          |   ??? *
-    +---------------+
-**********************************************/
-        ptr += ( sizeof * self );
-        ptr += self->spot_group_len;
-        ext_info = ( PlacementRecExtensionInfo * )( ptr );
-        ptr += ( 2 * ( sizeof * ext_info ) );
-        switch( ext )
-        {
-            case placementRecordExtension0 : res = ( void * ) ptr;
-                                             break;
-
-            case placementRecordExtension1 : res = ( void * ) ( ptr + ext_info->size );
-                                             break;
-        }
-    }
-    return res;
-}
-
-
-LIB_EXPORT void * CC PlacementRecord_get_ext_data_ptr ( const PlacementRecord *self, uint32_t ext )
-{
-    void * res = NULL;
-    if ( self != NULL )
-    {
-        uint8_t * ptr = ( uint8_t * ) self;
-        PlacementRecExtensionInfo * ext_info;
-        ptr += ( sizeof * self );
-        ptr += self->spot_group_len;    /* ptr points now to the 1st ext-info-block */
-        ext_info = ( PlacementRecExtensionInfo * )( ptr );
-        switch( ext )
-        {
-        case placementRecordExtension0 : res = ext_info[ 0 ].data; break;
-        case placementRecordExtension1 : res = ext_info[ 1 ].data; break;
-        }
-    }
-    return res;
-}
-
-
-LIB_EXPORT void CC PlacementRecordWhack( const PlacementRecord *cself )
-{
-    if ( cself != NULL ) 
-    {
-        PlacementRecord * self = ( PlacementRecord * )cself;
-        PlacementRecExtensionInfo * ext_info;
-        uint8_t * ptr = ( uint8_t * )self;
-        ptr += sizeof( *self );
-        ptr += self->spot_group_len;
-        ext_info = ( PlacementRecExtensionInfo * ) ptr;
-
-        /* destroy from the outer callback-block beginning */
-        if ( ext_info[ 1 ].destroy != NULL )
-        {
-            void *obj = PlacementRecordCast ( self, placementRecordExtension1 );
-            ext_info[ 1 ].destroy( obj, ext_info[ 1 ].data );
-        }
-
-        if ( ext_info[ 0 ].destroy != NULL )
-        {
-            void *obj = PlacementRecordCast ( self, placementRecordExtension0 );
-            ext_info[ 0 ].destroy( obj, ext_info[ 0 ].data );
-        }
-        /* now deallocate ( or put back into pool ) */
-        free( self );
-    }
-}
-
-struct PlacementIterator
-{
-    const ReferenceObj* obj;
-    INSDC_coord_zero ref_window_start;
-    INSDC_coord_len ref_window_len;
-
-    int64_t last_ref_row_of_window_rel;     /* relative to start of reference, not window */
-    int64_t cur_ref_row_rel;                /* current row relative to start of reference */
-    int64_t rowcount_of_ref;                /* precomputed: how many rows does this reference has */
-
-    /* own reader in case of ref cursor based construction */
-    const TableReader* ref_reader;
-    TableReaderColumn* ref_cols;
-    TableReaderColumn ref_cols_own[sizeof(ReferenceList_cols)/sizeof(ReferenceList_cols[0])];
-
-    /* own reader in case of align cursor based construction */
-    const TableReader* align_reader;
-    TableReaderColumn* align_cols;
-    TableReaderColumn align_cols_own[sizeof(PlacementIterator_cols)/sizeof(PlacementIterator_cols[0])];
-
-    /* current reference table row */
-    int64_t current_reftable_row;
-
-    const TableReaderColumn* ids_col;
-    Vector ids;
-    /* PlacementRecord c-tor params */
-    PlacementRecordExtendFuncs ext_0;
-    PlacementRecordExtendFuncs ext_1;
-
-    /* if this field is :
-     * NULL ... group by original read-group from the source-file
-     * points to empty string ... do not perform grouping at all
-     * point to non-empty string ... group by this string
-    */
-    const char * spot_group;
-    size_t spot_group_len;
-    int32_t min_mapq;
-
-    const VCursor* align_curs;
-    void * placement_ctx;           /* source-specific context */
-};
-
-
-static void enter_spotgroup ( PlacementIterator *iter, const char * spot_group )
-{
-    if ( spot_group == NULL )
-    {
-        iter->spot_group = NULL;
-        iter->spot_group_len = 0;
-    }
-    else
-    {
-        iter->spot_group_len = string_size ( spot_group );
-        if ( iter->spot_group_len > 0 )
-        {
-            iter->spot_group = string_dup_measure ( spot_group, NULL );
-        }
-        else
-        {
-            iter->spot_group = calloc( 1, 1 );
-        }
-    }
-}
-
-
-static int64_t calc_overlaped( PlacementIterator * o, align_id_src ids )
-{
-    int64_t res = o->ref_window_start;
-    bool from_ref_table = false;
-
-/*
-    uint32_t ofs = 0;
-    switch ( ids )
-    {
-        case primary_align_ids   : ofs = 0; break;
-        case secondary_align_ids : ofs = 1; break;
-        case evidence_align_ids  : ofs = 2; break;
-    }
-
-    if ( o->ref_cols[ ereflst_cn_OVERLAP_REF_LEN ].idx != 0 && 
-         o->ref_cols[ ereflst_cn_OVERLAP_REF_LEN ].len > ofs )
-    {
-        INSDC_coord_len overlap_ref_len = o->ref_cols[ ereflst_cn_OVERLAP_REF_LEN ].base.coord_len[ ofs ];
-        if ( overlap_ref_len < o->obj->mgr->max_seq_len )
-        {
-            if ( o->ref_cols[ ereflst_cn_OVERLAP_REF_POS ].idx != 0 && 
-                 o->ref_cols[ ereflst_cn_OVERLAP_REF_POS ].len > ofs )
-            {
-                res = o->ref_cols[ereflst_cn_OVERLAP_REF_POS].base.coord0[ ofs ];
-                from_ref_table = true;
-            }
-        }
-    }
-*/
-
-    if ( !from_ref_table )
-    {
-        /* default is step back 10 rows/50k bases */
-        int64_t ref_pos_lookback = ( 10 * o->obj->mgr->max_seq_len );
-        if ( o->obj->circular )
-        {
-            int64_t const half = ( o->obj->seq_len / 2 );
-
-            if ( ref_pos_lookback > half )
-            {
-                /* go back no more than one full length */
-                ref_pos_lookback = half;
-            }
-            res = ( o->ref_window_start - ref_pos_lookback ); /* could become negative */
-        }
-        else
-        {
-            res = ( o->ref_window_start < ref_pos_lookback ? 0 : ( o->ref_window_start - ref_pos_lookback ) );
-        }
-    }
-    return res;
-}
-
-
-LIB_EXPORT rc_t CC ReferenceObj_MakePlacementIterator ( const ReferenceObj* cself,
-    PlacementIterator **iter,
-    INSDC_coord_zero ref_window_start, INSDC_coord_len ref_window_len,
-    int32_t min_mapq,
-    struct VCursor const *ref_cur, struct VCursor const *align_cur, align_id_src ids,
-    const PlacementRecordExtendFuncs *ext_0, const PlacementRecordExtendFuncs *ext_1,
-    const char * spot_group, void * placement_ctx )
-{
-    rc_t rc = 0;
-    PlacementIterator* o = NULL;
-
-    if ( cself == NULL || iter == NULL )
-    {
-        rc = RC(rcAlign, rcType, rcAccessing, rcParam, rcInvalid);
-    }
-    else if ( ( rc = ReferenceSeq_ReOffset( cself->circular, cself->seq_len, &ref_window_start ) ) != 0 )
-    {
-    }
-    else if ( ( o = calloc( 1, sizeof( *o ) ) ) == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcMemory, rcExhausted );
-    }
-    else
-    {
-        rc = ReferenceList_AddRef( cself->mgr );
-        if ( rc == 0 )
-        {
-            ReferenceList* mgr = cself->mgr;
-            o->obj = cself;
-            /* o->wrapped_around = false; */
-            ReferenceObj_AddRef( o->obj );
-            o->min_mapq = min_mapq;
-            o->placement_ctx = placement_ctx;
-
-            if ( ext_0 != NULL )
-            {
-                o->ext_0.data = ext_0->data;
-                o->ext_0.destroy = ext_0->destroy;
-                o->ext_0.populate = ext_0->populate;
-                o->ext_0.alloc_size = ext_0->alloc_size;
-                o->ext_0.fixed_size = ext_0->fixed_size;
-            }
-
-            if ( ext_1 != NULL )
-            {
-                o->ext_1.data = ext_1->data;
-                o->ext_1.destroy = ext_1->destroy;
-                o->ext_1.populate = ext_1->populate;
-                o->ext_1.alloc_size = ext_1->alloc_size;
-                o->ext_1.fixed_size = ext_1->fixed_size;
-            }
-
-            if ( ref_cur == NULL )
-            {
-                if ( mgr->reader == NULL )
-                {
-                    rc = ReferenceList_OpenCursor( mgr );
-                }
-                if ( rc == 0 )
-                {
-                    o->ref_reader = mgr->reader;
-                    o->ref_cols = mgr->reader_cols;
-                }
-            }
-            else
-            {
-                memcpy( o->ref_cols_own, ReferenceList_cols, sizeof( o->ref_cols_own ) );
-                o->ref_cols = o->ref_cols_own;
-                rc = TableReader_MakeCursor( &o->ref_reader, ref_cur, o->ref_cols_own );
-            }
-
-            if ( align_cur == NULL )
-            {
-                bool b_assign = ( mgr->iter != NULL );
-                if ( !b_assign )
-                {
-                    rc = ReferenceList_OpenCursor2( mgr, ids );
-                    b_assign = ( rc == 0 );
-                }
-                if ( b_assign )
-                {
-                    o->align_reader = mgr->iter;
-                    o->align_cols = mgr->iter_cols;
-                }
-            }
-            else
-            {
-                memcpy( o->align_cols_own, PlacementIterator_cols, sizeof( o->align_cols_own ) );
-                o->align_cols = o->align_cols_own;
-                o->align_curs = align_cur;
-                rc = TableReader_MakeCursor( &o->align_reader, align_cur, o->align_cols );
-            }
-
-            if ( rc == 0 )
-            {
-                int64_t first_ref_row_of_window_rel = ( ref_window_start / mgr->max_seq_len );
-                int64_t first_ref_row_of_window_abs = ( cself->start_rowid + first_ref_row_of_window_rel );
-
-                /* in bases */
-                o->ref_window_start = ref_window_start;
-                o->ref_window_len = ref_window_len;
-
-                /* in reference-rows */
-                o->last_ref_row_of_window_rel = ref_window_start;
-                o->last_ref_row_of_window_rel += ref_window_len;
-                o->last_ref_row_of_window_rel /= mgr->max_seq_len;
-                o->rowcount_of_ref = ( cself->end_rowid - cself->start_rowid );
-
-                /* get effective starting offset based on overlap
-                   from alignments which started before the requested pos */
-                rc = TableReader_ReadRow( o->ref_reader, first_ref_row_of_window_abs );
-                if ( rc == 0 )
-                {
-                    int64_t ref_pos_overlapped = calc_overlaped( o, ids );
-                    ALIGN_DBG( "ref_pos_overlapped: %,li", ref_pos_overlapped );
-
-                    /* the absolute row where we are reading from */
-                    o->cur_ref_row_rel = ( ref_pos_overlapped / mgr->max_seq_len ) - 1;
-
-                    VectorInit( &o->ids, 0, 100 );
-
-                    o->ids_col = &o->ref_cols[ids == primary_align_ids ? ereflst_cn_PRIMARY_ALIGNMENT_IDS :
-                            ( ids == secondary_align_ids ? ereflst_cn_SECONDARY_ALIGNMENT_IDS : ereflst_cn_EVIDENCE_INTERVAL_IDS ) ];
-
-                    ALIGN_DBG( "iter.last_ref_row_of_window_rel: %,li", o->last_ref_row_of_window_rel );
-                    ALIGN_DBG( "iter.rowcount_of_ref: %,li", o->rowcount_of_ref );
-                    ALIGN_DBG( "iter.cur_ref_row_rel: %,li", o->cur_ref_row_rel );
-                }
-            }
-
-            if ( rc != 0 )
-            {
-                ReferenceObj_Release( o->obj );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        enter_spotgroup ( o, spot_group );
-        *iter = o;
-        ALIGN_DBG( "iter for %s:%s opened 0x%p", cself->seqid, cself->name, o );
-    }
-    else
-    {
-        *iter = NULL;
-        PlacementIteratorRelease( o );
-        ALIGN_DBGERRP( "iter for %s:%s", rc, cself->seqid, cself->name );
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorAddRef ( const PlacementIterator *cself )
-{
-    return ReferenceList_AddRef(cself ? cself->obj->mgr : NULL);
-}
-
-
-static void CC PlacementIterator_whack_recs( void *item, void *data )
-{
-    PlacementRecordWhack( ( PlacementRecord * ) item );
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorRelease ( const PlacementIterator *cself )
-{
-    if ( cself != NULL )
-    {
-        PlacementIterator* self = ( PlacementIterator* )cself;
-
-        VectorWhack( &self->ids, PlacementIterator_whack_recs, NULL );
-
-        if ( self->ref_reader != self->obj->mgr->reader )
-        {
-            TableReader_Whack( self->ref_reader );
-        }
-        if ( self->align_reader != self->obj->mgr->iter )
-        {
-            TableReader_Whack( self->align_reader );
-        }
-        ReferenceObj_Release( self->obj );
-        ReferenceList_Release( self->obj->mgr );
-        if ( self->spot_group != NULL )
-        {
-            free( ( void * )self->spot_group );
-        }
-        free( self );
-    }
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorRefWindow( const PlacementIterator *self,
-                                               const char **idstr, INSDC_coord_zero* pos, INSDC_coord_len* len )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL || (idstr == NULL || pos == NULL || len == NULL ) )
-    {
-        rc = RC(rcAlign, rcType, rcAccessing, rcParam, rcInvalid);
-    }
-    else
-    {
-        if ( idstr != NULL ) { *idstr = self->obj->seqid; }
-        if ( pos != NULL )   { *pos = self->ref_window_start; }
-        if ( len != NULL )   { *len = self -> ref_window_len; }
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorRefObj( const PlacementIterator * self,
-                                            struct ReferenceObj const ** refobj )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL || refobj == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        *refobj = self->obj;
-    }
-    ALIGN_DBGERR( rc );
-    return rc;
-}
-
-
-#if _DEBUGGING
-static void CC PlacementRecordVector_dump( void *item, void *data )
-{
-    const PlacementRecord* i = ( const PlacementRecord* )item;
-    ALIGN_DBG( " {pos:%,u, len:%,u, id:%,li}", i->pos, i->len, i->id );
-}
-#endif
-
-
-/* this comparison function performs last-to-first
-   ordering in the Vector. for this reason, all
-   comparisons and return values are reversed. */
-static int CC PlacementRecordVector_cmp( const void** left, const void** right, void* data )
-{
-    const PlacementRecord* l = *( ( const PlacementRecord** )left );
-    const PlacementRecord* r = *( ( const PlacementRecord** )right );
-
-    /* order by pos desc
-       return right - left rather than
-       normal left - right to reverse result */
-    int32_t d = r -> pos - l -> pos;
-    if ( d != 0 )
-        return d;
-
-    /* ...len asc */
-    if ( l -> len < r -> len )
-        return -1;
-    if ( l -> len > r -> len )
-        return 1;
-
-    /* ...id desc */
-    if ( l -> id > r -> id )
-        return -1;
-    if ( l -> id < r -> id )
-        return 1;
-    return 0;
-}
-
-
-static rc_t allocate_populate_rec( const PlacementIterator *cself,
-                                   PlacementRecord **rec,
-                                   struct VCursor const *curs,
-                                   int64_t id,
-                                   INSDC_coord_zero apos,
-                                   INSDC_coord_len alen )
-{
-    rc_t rc = 0;
-
-    {
-        PlacementRecExtensionInfo * ext_info;
-        size_t spot_group_len, size0, size1, total_size;
-
-        if ( cself->spot_group_len > 0 )
-        {
-            /* use the read-group from the PlacementIterator as an fix override ... */
-            spot_group_len = cself->spot_group_len;
-        }
-        else
-        {
-            if ( cself->spot_group != NULL )
-            {
-                /* iterator has an empty (not NULL) spot-group: use the orignal data! */
-                spot_group_len = cself->align_cols[eplacementiter_cn_READ_GROUP].len;
-            }
-            else
-            {
-                /* do not use spotgroups at all ! */
-                spot_group_len = 0;
-            }
-        }
-
-        /* use callback or fixed size to discover the size of portions 0 and 1 */
-        if ( cself->ext_0.alloc_size != NULL )
-        {
-            rc = cself->ext_0.alloc_size( curs, id, &size0, cself->ext_0.data, cself->placement_ctx );
-            if ( rc != 0 )
-                return rc;
-        }
-        else
-            size0 = cself->ext_0.fixed_size;
-
-        if ( cself->ext_1.alloc_size != NULL )
-        {
-            rc = cself->ext_1.alloc_size( curs, id, &size1, cself->ext_1.data, cself->placement_ctx );
-            if ( rc != 0 )
-                return rc;
-        }
-        else
-            size1 = cself->ext_1.fixed_size;
-        
-        /* allocate the record ( or take it from a pool ) */
-        total_size = ( sizeof **rec ) + spot_group_len + ( 2 * ( sizeof *ext_info ) ) + size0 + size1;
-        *rec = calloc( 1, total_size );
-        if ( *rec == NULL )
-        {
-            rc = RC( rcAlign, rcType, rcAccessing, rcMemory, rcExhausted );
-        }
-        else
-        {
-            PlacementRecord *pr = * rec;
-            uint8_t * ptr = ( uint8_t * )( * rec );
-            ptr += sizeof ( **rec );
-            pr->spot_group = (char *)ptr;
-            ptr += spot_group_len ;
-            ext_info = ( PlacementRecExtensionInfo * )ptr;
-
-            /* prepopulate the core-record : */
-            pr->id  = id;               /* the row-id */
-            pr->ref = cself->obj;       /* the ReferenceObj it refers to */
-            pr->pos = apos;             /* the positon on the reference */
-            pr->len = alen;             /* the length on the reference */
-            pr->mapq = cself->align_cols[eplacementiter_cn_MAPQ].base.i32[ 0 ]; /* mapq */
-
-            /* populate the spot-group : (with the values discovered at the "size-phase" ) */
-            pr->spot_group_len = spot_group_len;
-            if ( cself->spot_group_len > 0 )
-            {
-                /* we make a copy of the spot-group-override commin from the iterator */
-                string_copy ( pr->spot_group, spot_group_len, cself->spot_group, spot_group_len );
-            }
-            else
-            {
-                if ( cself->spot_group != NULL )
-                {
-                    /* iterator has an empty (not NULL) spot-group: use the orignal data! */
-                    string_copy( pr->spot_group, spot_group_len,
-                                 cself->align_cols[eplacementiter_cn_READ_GROUP].base.str, spot_group_len );
-                }
-            }
-
-            ext_info[ 0 ].data = cself->ext_0.data;          /* the opt. context ptr. */
-            ext_info[ 0 ].destroy = cself->ext_0.destroy;    /* the opt. destructor */
-            ext_info[ 0 ].size = size0;                      /* discovered size from above */
-
-            ext_info[ 1 ].data = cself->ext_1.data;          /* the opt. context ptr. */
-            ext_info[ 1 ].destroy = cself->ext_1.destroy;    /* the opt. destructor */
-            ext_info[ 1 ].size = size1;                      /* discovered size from above */
-
-            /* pass the record now to the opt. populate-callbacks */
-            if ( cself->ext_0.populate != NULL )
-            {
-                void * obj = PlacementRecordCast ( pr, placementRecordExtension0 );
-                rc = cself->ext_0.populate( obj, pr, curs,
-                                            cself->ref_window_start,
-                                            cself->ref_window_len,
-                                            cself->ext_0.data,
-                                            cself->placement_ctx );
-                if ( rc != 0 && cself->ext_0.destroy != NULL )
-                {
-                    void *obj = PlacementRecordCast ( pr, placementRecordExtension0 );
-                    cself->ext_0.destroy( obj, cself->ext_0.data );
-                }
-            }
-
-            if ( rc == 0 && cself->ext_1.populate != NULL )
-            {
-                void * obj = PlacementRecordCast ( pr, placementRecordExtension1 );
-                rc = cself->ext_1.populate( obj, pr, curs, 
-                                            cself->ref_window_start,
-                                            cself->ref_window_len,
-                                            cself->ext_1.data,
-                                            cself->placement_ctx );
-                if ( rc != 0 )
-                {
-                    if ( cself->ext_1.destroy != NULL )
-                    {
-                        void *obj = PlacementRecordCast ( pr, placementRecordExtension1 );
-                        cself->ext_1.destroy( obj, cself->ext_1.data );
-                    }
-                    if ( cself->ext_0.destroy != NULL )
-                    {
-                        void *obj = PlacementRecordCast ( pr, placementRecordExtension0 );
-                        cself->ext_0.destroy( obj, cself->ext_0.data );
-                    }
-
-                }
-            }
-
-            if ( rc != 0 )
-            {
-                /* free */
-                free( *rec );
-                *rec = NULL;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t make_alignment( PlacementIterator *self, int64_t align_id,
-                            INSDC_coord_zero apos, INSDC_coord_len alen )
-{
-    PlacementRecord *rec;
-    rc_t rc = allocate_populate_rec( self, &rec, self->align_curs, align_id, apos, alen );
-    if ( rc == 0 )
-    {
-        /*ALIGN_DBG("align %p: {%li, %u, %u} - added[%u]", rec, cself->ids_col->base.i64[i],
-            apos, alen, VectorLength(&cself->ids));*/
-        rc = VectorAppend( &self->ids, NULL, rec );
-        if ( rc != 0 )
-            PlacementRecordWhack( rec );
-    }
-    else
-    {
-        if ( GetRCState( rc ) == rcIgnored )
-            rc = 0; /* do not break the loop if a record is filtered out! */
-    }
-    return rc;
-}
-
-
-/*
-  we have read a single row from REFERENCE, including the
-  alignment ids. use each alignment id from this row to
-  populate internal vector
-*/
-static rc_t read_alignments( PlacementIterator *self )
-{
-    rc_t rc = 0;
-    uint32_t i;
-    /* fill out vector */
-    /*ALIGN_DBG("align rows: %u", cself->ids_col->len);*/
-    for ( i = 0; rc == 0 && i < self->ids_col->len; i++ )
-    {
-        rc = TableReader_ReadRow( self->align_reader, self->ids_col->base.i64[ i ] );
-        if ( rc == 0 )
-        {
-            INSDC_coord_zero apos = self->align_cols[ eplacementiter_cn_REF_POS ].base.coord0[ 0 ];
-            INSDC_coord_len alen  = self->align_cols[ eplacementiter_cn_REF_LEN ].base.coord_len[ 0 ];
-            /*ALIGN_DBG("align row: {%li, %u, %u}", cself->ids_col->base.i64[i], apos, alen);*/
-
-            if ( self->cur_ref_row_rel < 0 )
-                apos -= self->obj->seq_len;
-
-            /* at this point we have the position of the alignment.
-               we want it to intersect with the window */
-
-            /* test mapq */
-            if ( self->align_cols[eplacementiter_cn_MAPQ].base.i32[ 0 ] < self->min_mapq )
-                continue;
-
-            /* case 1: alignment, which is expressed in
-               linear coordinates, is entirely to left of
-               window. */
-            if ( (INSDC_coord_zero)( apos + alen ) <= self -> ref_window_start )
-            {
-                /* ignore this alignment */
-                continue;
-            }
-
-            /* case 2: alignment is to the right of window */
-            if ( apos >= ( self -> ref_window_start + self -> ref_window_len ) )
-            {
-                /* if not circular, it cannot intersect */
-                if ( ! self -> obj -> circular )
-                {
-                    /* this seems like it indicates end of window,
-                       however there is no guarantee that the ids
-                       being fetched are in reference order. they are
-                       supposed to be in row order ( cluster ) to
-                       reduce random access to cursor. unless row
-                       order is guaranteed to be reference order,
-                       we cannot know that the loop can be terminated. */
-                    continue;
-                }
-
-                /* circular, but still within linear range
-                   means it cannot wrap around to intersect */
-                if ( (INSDC_coord_zero)( apos + alen ) <= self->obj->seq_len )
-                    continue;
-
-            }
-            else if ( ( self->obj->circular )&&( apos + alen > self->obj->seq_len ) ) 
-            {
-                /* the end of the alignment sticks over the end of the reference! 
-                   ---> we have the rare case of an alignment that wraps arround !
-                   let as insert the alignment 2 times!
-                   ( one with neg. position, one at real position ) */
-                rc =  make_alignment( self, self->ids_col->base.i64[i], apos - self->obj->seq_len, alen );
-            }
-
-            /* having arrived here, we know the alignment intersects our window
-               apos MAY be < 0 if the alignment wrapped around */
-            if ( rc == 0 )
-                rc =  make_alignment( self, self->ids_col->base.i64[i], apos, alen );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorNextAvailPos( const PlacementIterator *cself,
-    INSDC_coord_zero *pos, INSDC_coord_len *len )
-{
-    rc_t rc = 0;
-    PlacementIterator* self = (PlacementIterator*)cself;
-
-    if ( self == NULL || ( pos == NULL && len == NULL ) )
-    {
-        rc = RC( rcAlign, rcType, rcSelecting, rcParam, rcInvalid );
-    }
-    else
-    {
-        while ( rc == 0 && VectorLength( &self->ids ) == 0 )
-        {
-            /* read ids */
-
-            self->cur_ref_row_rel++;   /* increment row offset */
-
-#if 0
-            ALIGN_DBG( "ref row: ref-start-row-id:%li - curr-rel-row:%li - of:%li",
-                       self->obj->start_rowid, self->cur_ref_row_rel, self->last_ref_row_of_window_rel );
-#endif
-
-            if ( self->cur_ref_row_rel > self->last_ref_row_of_window_rel )
-                rc = SILENT_RC( rcAlign, rcType, rcSelecting, rcRange, rcDone );
-            else
-            {
-                int64_t row = ( self->obj->start_rowid + self->cur_ref_row_rel );
-                if ( self->cur_ref_row_rel < 0 )
-                    row += self->rowcount_of_ref;
-
-                rc = TableReader_ReadRow( self->ref_reader, row );
-                if ( rc == 0 )
-                    rc = read_alignments( self );
-
-                if ( ( rc == 0 || GetRCState( rc ) == rcDone) && VectorLength( &cself->ids ) > 0 )
-                {
-                    VectorReorder( &self->ids, PlacementRecordVector_cmp, NULL );
-#if _DEBUGGING && 0
-                    ALIGN_DBG( "REFERENCE row %li %u recs order by pos asc, len desc, id asc",
-                                row, VectorLength( &cself->ids ) );
-                    VectorForEach( &self->ids, true, PlacementRecordVector_dump, NULL );
-#endif
-                }
-            }
-        }
-
-        if ( rc == 0 || GetRCState( rc ) == rcDone )
-        {
-            uint32_t count = VectorLength( &cself->ids );
-            if ( count > 0 )
-            {
-                PlacementRecord * r = VectorLast( &cself->ids );
-                rc = 0;
-                if ( pos != NULL ) { *pos = r->pos; }
-                if ( len != NULL ) { *len = r->len; }
-
-#if 0
-                ALIGN_DBG( "PlacementIteratorNextAvailPos( id=%,li, pos=%,u, n=%,u )", r->id, r->pos, count );
-#endif
-                if ( !( cself->obj->circular ) && ( r->pos >= ( cself->ref_window_start + cself->ref_window_len ) ) )
-                {
-                    /* the alignment !starts! after the end of the of the requested window! */
-                    rc = SILENT_RC( rcAlign, rcType, rcSelecting, rcRange, rcDone );
-                }
-            }
-            else
-            {
-                ALIGN_DBG( "PlacementIteratorNextAvailPos( no placements )", 0 );
-            }
-        }
-    }
-
-    if ( rc != 0 && GetRCState(rc) != rcDone )
-        ALIGN_DBGERR( rc );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorNextRecordAt( PlacementIterator *cself,
-    INSDC_coord_zero pos, const PlacementRecord **rec )
-{
-    rc_t rc = 0;
-    if ( cself == NULL || rec == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t vlen = VectorLength( &cself->ids );
-        *rec = NULL;
-        if ( vlen > 0 )
-        {
-            PlacementRecord* r = VectorLast( &cself->ids );
-            if ( r->pos == pos )
-            {
-                VectorRemove( &cself->ids, vlen - 1, (void**)rec );
-            }
-        }
-    }
-
-    if ( rc == 0 && *rec == NULL )
-    {
-        rc = SILENT_RC( rcAlign, rcType, rcSelecting, rcOffset, rcDone );
-    }
-    else
-    {
-        ALIGN_DBGERR( rc );
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC PlacementIteratorNextIdAt( PlacementIterator *cself,
-                                              INSDC_coord_zero pos, int64_t *row_id, INSDC_coord_len *len )
-{
-    rc_t rc = 0;
-    const PlacementRecord* r = NULL;
-
-    if ( cself == NULL || row_id == NULL )
-    {
-        rc = RC( rcAlign, rcType, rcAccessing, rcParam, rcInvalid );
-    }
-    else
-    {
-        rc = PlacementIteratorNextRecordAt( cself, pos, &r );
-        if ( rc  == 0 )
-        {
-            *row_id = r->id;
-            if ( len != NULL ) { *len = r->len; }
-            PlacementRecordWhack( r );
-        }
-    }
-
-    if ( GetRCState( rc ) != rcDone )
-    {
-        ALIGN_DBGERR( rc );
-    }
-    return rc;
-}
diff --git a/libs/align/refseq-mgr-priv.h b/libs/align/refseq-mgr-priv.h
deleted file mode 100644
index 4e746c7..0000000
--- a/libs/align/refseq-mgr-priv.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was readten as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_refseq_mgr_priv_
-#define _h_align_refseq_mgr_priv_
-
-#include <align/refseq-mgr.h>
-
-typedef bool (*RefSeqMgr_ForEachVolume_callback)(char const server[], char const volume[], void *data);
-
-rc_t RefSeqMgr_ForEachVolume(const RefSeqMgr* cself, RefSeqMgr_ForEachVolume_callback cb, void *data);
-
-#endif /* _h_align_refseq_mgr_priv_ */
diff --git a/libs/align/refseq-mgr.c b/libs/align/refseq-mgr.c
deleted file mode 100644
index fde6e90..0000000
--- a/libs/align/refseq-mgr.c
+++ /dev/null
@@ -1,809 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was readten as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <kdb/manager.h>
-#include <kfg/config.h>
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/cursor.h>
-#include <align/refseq-mgr.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "refseq-mgr-priv.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-/*#define ALIGN_DBG KOutMsg*/
-
-#define USE_OWN_REFSEQ_RESOLVER 0
-
-struct RefSeqMgr {
-    BSTree tree;
-    KConfig *kfg;
-    const VDBManager* vmgr;
-    uint32_t reader_options;
-    size_t cache;
-    uint32_t num_open_max;
-    uint32_t num_open;
-    uint64_t usage;
-    RefSeq* last_used;
-    BSTree vdbs;
-};
-
-struct RefSeq {
-    BSTNode dad;
-    const RefSeqMgr* mgr;
-    const TableReaderRefSeq* reader;
-    uint64_t usage;
-    uint32_t accession_sz;
-    /* must be last member of struct */
-    char accession[1];
-};
-
-typedef struct RefSeqMgr_Db_struct {
-    BSTNode dad;
-    char key[4096];
-    const VDatabase* db;
-} RefSeqMgr_Db;
-
-#if USE_OWN_REFSEQ_RESOLVER
-struct FindTable_ctx {
-    RefSeqMgr* self;
-    const KDBManager* kmgr;
-    const VTable** tbl;
-    char const* name;
-    uint32_t name_sz;
-    bool found;
-    rc_t rc;
-    char** path; /* optional */
-};
-#endif
-
-static
-rc_t RefSeqMgr_ConfigValue ( const KConfig *kfg, const char *node_path, char *value, size_t value_size )
-{
-    const KConfigNode *node;
-    rc_t rc = KConfigOpenNodeRead ( kfg, & node, node_path );
-    if ( rc == 0 )
-    {
-        size_t num_read, remaining;
-        rc = KConfigNodeRead ( node, 0, value, value_size - 1, & num_read,  & remaining );
-        if ( rc == 0 )
-        {
-            if ( remaining != 0 )
-                rc = RC ( rcSRA, rcMgr, rcConstructing, rcString, rcExcessive );
-            else
-                value [ num_read ] = 0;
-        }
-        
-        KConfigNodeRelease ( node );
-    }
-    return rc;
-}
-
-static
-rc_t RefSeqMgr_KfgReadRepositories(const KConfig* kfg, char* paths, size_t paths_sz)
-{
-    /* servers are children of refseq/repository, e.g.:             /refseq/repository/main="..." */ 
-    /* volumes are in refseq/repository/<serverName>/volumes, e.g.: /refseq/repository/main/volumes="..." */
-    /* all server/volume combinations are returned in paths separated by ':' */
-    
-    rc_t rc = 0;
-    const KConfigNode *node;
-#define KFG_PATH "/refseq/repository/"
-    paths[0] = 0;
-    
-    rc = KConfigOpenNodeRead ( kfg, & node, KFG_PATH );
-    if ( rc == 0 )
-    {
-        KNamelist* children;
-        rc = KConfigNodeListChild ( node, &children );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount ( children, &count );
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for (i = 0; i < count; ++i) /* for all servers */
-                {
-                    const char* name;
-                    rc = KNamelistGet ( children, i, &name );
-                    if ( rc == 0 )
-                    {
-#define BufSize 4096
-                        char server[ BufSize ];
-                        char buf[ BufSize ];
-                        size_t num_writ;
-                        
-                        rc = string_printf(buf, BufSize, &num_writ, KFG_PATH "%s", name);
-                        if (rc == 0)
-                        {
-                            rc = RefSeqMgr_ConfigValue ( kfg, buf, server, sizeof(server) );
-                            if (rc == 0)
-                            {
-                                rc = string_printf(buf, BufSize, &num_writ, KFG_PATH "%s/volumes", name);
-                                if (rc == 0)
-                                {
-                                    char volumes[ BufSize ];
-                                    rc = RefSeqMgr_ConfigValue ( kfg, buf, volumes, sizeof(volumes) );
-                                    if (rc == 0)
-                                    {   /* create a server/volume pair for every combination, append to paths, ':' - separate */ 
-                                        char *vol_rem = volumes;
-                                        char *vol_sep;
-                                        
-                                        do {
-                                            char const *volume = vol_rem;
-                                            vol_sep = string_chr(volume, string_size(volume), ':');
-                                            if(vol_sep) {
-                                                vol_rem = vol_sep + 1;
-                                                *vol_sep = 0;
-                                            }
-                                            string_copy(paths + string_size(paths), paths_sz - string_size(paths), server, string_size(server));
-                                            if (paths[string_size(paths)-1] != '/')
-                                            {
-                                                string_copy(paths + string_size(paths), paths_sz - string_size(paths), "/", 1);
-                                            }
-                                            string_copy(paths + string_size(paths), paths_sz - string_size(paths), volume, string_size(volume));
-                                            string_copy(paths + string_size(paths), paths_sz - string_size(paths), ":", 1);
-                                        } while(vol_sep);
-                                    }
-                                }
-                            }
-                        }
-#undef BufSize
-                    }
-                    if ( rc != 0 )
-                    {
-                        break;
-                    }
-                }
-            }
-            KNamelistRelease ( children );
-        }
-        
-        KConfigNodeRelease ( node );
-    }
-    if (GetRCState(rc) == rcNotFound)
-    {
-        paths[0] = '\0';
-        return 0;
-    }
-    return 0;
-}
-
-static
-rc_t RefSeqMgr_KfgReadStr(const KConfig* kfg, const char* path, char* value, size_t value_sz)
-{
-    rc_t rc = 0;
-    const KConfigNode *node;
-    
-    if ( (rc = KConfigOpenNodeRead(kfg, &node, path)) == 0 ) {
-        size_t num_read, remaining;
-        if( (rc = KConfigNodeRead(node, 0, value, value_sz - 1, &num_read, &remaining)) == 0 ) {
-            if( remaining != 0 ) {
-                rc = RC(rcAlign, rcIndex, rcConstructing, rcString, rcTooLong);
-            } else {
-                value[num_read] = '\0';
-            }
-        }
-        KConfigNodeRelease(node);
-    } else if( GetRCState(rc) == rcNotFound ) {
-        rc = 0;
-        value[0] = '\0';
-    }
-    return rc;
-}
-
-rc_t RefSeqMgr_ForEachVolume(const RefSeqMgr* cself, RefSeqMgr_ForEachVolume_callback cb, void *data)
-{
-    rc_t rc = 0;
-    char servers[4096];
-    char volumes[4096];
-    
-    if( cself == NULL || cb == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( cb(".", NULL, data) ) {
-        /* found in local dir */
-    } else if( (rc = RefSeqMgr_KfgReadStr(cself->kfg, "refseq/paths", servers, sizeof(servers))) != 0 ) {
-        ALIGN_DBGERRP("%s", rc, "RefSeqMgr_KfgReadStr(paths)");
-    } else {
-        bool found = false;
-        if( servers[0] != '\0' ) {
-            char *srv_sep;
-            char *srv_rem = servers;
-            do {
-                char const* server = srv_rem;
-                
-                srv_sep = strchr(server, ':');
-                if(srv_sep) {
-                    srv_rem = srv_sep + 1;
-                    *srv_sep = 0;
-                }
-                if( cb(server, NULL, data) ) {
-                    found = true;
-                    break;
-                }
-            } while(srv_sep);
-        }
-        if( !found ) {
-            /* locate refseq servers/volumes in possibly multiple repositories */
-            if( (rc = RefSeqMgr_KfgReadRepositories(cself->kfg, servers, sizeof(servers))) != 0 ) {
-                ALIGN_DBGERRP("%s", rc, "RefSeqMgr_KfgReadStr(refseq/repository/*)");
-            };
-            if( servers[0] != '\0' ) {
-                char *srv_sep;
-                char *srv_rem = servers;
-                do {
-                    char const* server = srv_rem;
-                    
-                    srv_sep = strchr(server, ':');
-                    if(srv_sep) {
-                        srv_rem = srv_sep + 1;
-                        *srv_sep = 0;
-                    }
-                    if( cb(server, NULL, data) ) {
-                        found = true;
-                        break;
-                    }
-                } while(srv_sep);
-            }
-        }
-        if( !found ) {
-            if ( (rc = RefSeqMgr_KfgReadStr(cself->kfg, "refseq/servers", servers, sizeof(servers))) != 0 ||
-                (rc = RefSeqMgr_KfgReadStr(cself->kfg, "refseq/volumes", volumes, sizeof(volumes))) != 0 ) {
-                ALIGN_DBGERRP("%s", rc, "RefSeqMgr_KfgReadStr(servers/volumes)");
-            } 
-            /* servers and volumes are deprecated and optional */
-            if( rc == 0 && (servers[0] != '\0' || volumes[0] != '\0') ) {
-                char *srv_sep;
-                char *srv_rem = servers;
-                do {
-                    char vol[ 4096 ];
-                    char const *server = srv_rem;
-                    char *vol_rem = vol;
-                    char *vol_sep;
-                    
-                    string_copy ( vol, sizeof vol, volumes, string_size( volumes ) );
-                    srv_sep = strchr(server, ':');
-                    if(srv_sep) {
-                        srv_rem = srv_sep + 1;
-                        *srv_sep = 0;
-                    }
-                    do {
-                        char const *volume = vol_rem;
-                        
-                        vol_sep = strchr(volume, ':');
-                        if(vol_sep) {
-                            vol_rem = vol_sep + 1;
-                            *vol_sep = 0;
-                        }
-                        found = cb(server, volume, data);
-                    } while(!found && vol_sep);
-                } while(!found && srv_sep);
-            }
-        }
-    }
-    return rc;
-}
-
-#if USE_OWN_REFSEQ_RESOLVER
-static
-int CC RefSeqMgr_DbSort(const BSTNode* item, const BSTNode* node)
-{
-    return strcmp(((const RefSeqMgr_Db*)item)->key, ((const RefSeqMgr_Db*)node)->key);
-}
-
-static
-int CC RefSeqMgr_FindDb(const void *item, const BSTNode *node)
-{
-    return strcmp((const char*)item, ((const RefSeqMgr_Db*)node)->key);
-}
-
-static
-bool FindTable(char const server[], char const volume[], void *data)
-{
-    const VTable* tbl = NULL;
-    struct FindTable_ctx *ctx = data;
-    const char* vol_sep = "/";
-    
-    if( volume == NULL || string_size(volume) == 0) {
-        volume = "";
-        vol_sep = "";
-    }
-    ctx->rc = VDBManagerOpenTableRead(ctx->self->vmgr, &tbl, NULL, "%s%s%s/%.*s", server, vol_sep, volume, ctx->name_sz, ctx->name);
-    ALIGN_DBG("trying '%s%s%s/%.*s'...", server, vol_sep, volume, ctx->name_sz, ctx->name);
-    
-    ctx->found = false;
-    
-    if(ctx->rc == 0){
-        ALIGN_DBG("found\n", "");
-	    ctx->found = true;
-    }
-    else if (GetRCState(ctx->rc) == rcNotFound) {
-        ctx->rc = 0;
-        ALIGN_DBG("not found\n", "");
-        
-        /* can be kar */
-        if( ctx->name_sz > 7 ) {
-            uint32_t i = 0;
-            
-            /* check for pattern '\w{4}\d{2}[\.\d]+' */
-            while( isalpha(ctx->name[i]) && i < 4 ) {
-                i++;
-            }
-            if( i == 4 && isdigit(ctx->name[i]) && isdigit(ctx->name[++i]) ) {
-                while( ++i < ctx->name_sz ) {
-                    if( !isdigit(ctx->name[i]) && ctx->name[i] != '.' ) {
-                        break;
-                    }
-                }
-            }
-            if( i == ctx->name_sz ) {
-                char key[4096];
-                size_t n;
-                
-                if( string_printf(key, sizeof(key), &n, "%s%s%s/%.*s", server, vol_sep, volume, 6, ctx->name) != 0 ) {
-                    (void)LOGMSG(klogWarn, "kar-vdb lookup buffer");
-                } else {
-                    RefSeqMgr_Db *db = (RefSeqMgr_Db*)BSTreeFind(&ctx->self->vdbs, key, RefSeqMgr_FindDb);
-                    
-                    ALIGN_DBG("trying database '%s%s%s/%.*s'...", server, vol_sep, volume, 6, ctx->name);
-                    if( db == NULL ) {
-                        const VDatabase* vdb = NULL;
-                        if( (ctx->rc = VDBManagerOpenDBRead(ctx->self->vmgr, &vdb, NULL, key)) == 0 ) {
-                            db = malloc(sizeof(*db));
-                            if( db == NULL ) {
-                                ctx->rc = RC(rcAlign, rcDatabase, rcOpening, rcMemory, rcExhausted);
-                            } else {
-                                string_copy( db->key, sizeof db->key, key, string_size( key ) );
-                                db->db = vdb;
-                                ctx->rc = BSTreeInsertUnique(&ctx->self->vdbs, &db->dad, NULL, RefSeqMgr_DbSort);
-                            }
-                        }
-                        if( ctx->rc != 0 ) {
-                            VDatabaseRelease(vdb);
-                            free(db);
-                            db = NULL;
-                        }
-                    }
-                    if( db != NULL ) {
-                        ALIGN_DBG(" table '%.*s'", ctx->name_sz, ctx->name);
-                        if( (ctx->rc = VDatabaseOpenTableRead(db->db, &tbl, "%.*s", ctx->name_sz, ctx->name)) == 0 ) {
-                            ctx->found = true;
-                            ALIGN_DBG("found\n", "");
-                        }
-                        else
-                            ALIGN_DBG("not found\n", "");
-                    }
-                    else
-                        ALIGN_DBG("not found\n", "");
-                }
-            }
-        }
-    }
-    if( ctx->found){
-        if(ctx->tbl)  *(ctx->tbl) = tbl;
-        else VTableRelease(tbl);
-    }
-    if( ctx->found && ctx->path != NULL ) {
-        size_t path_sz = string_size( server ) + string_size( vol_sep ) + string_size( volume ) + 1 + ctx->name_sz + 1;
-        char* path = malloc(path_sz);
-        if( path == NULL ) {
-            ctx->rc = RC(rcAlign, rcPath, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            if( (ctx->rc = string_printf(path, path_sz, &path_sz, "%s%s%s/%.*s", server, vol_sep, volume, ctx->name_sz, ctx->name)) == 0 ) {
-                *(ctx->path) = path;
-            } else {
-                free(path);
-            }
-        }
-    }
-    return ctx->found;
-}
-
-static
-rc_t RefSeqMgr_FindTable(const RefSeqMgr* cself, char const accession[], uint32_t accession_sz, VTable const **tbl, char** path)
-{
-    rc_t rc;
-    struct FindTable_ctx ctx;
-    
-    if( (rc = VDBManagerOpenKDBManagerRead(cself->vmgr, &ctx.kmgr)) != 0 ) {
-        ALIGN_DBGERRP("%s", rc, "VDBManagerOpenKDBManagerRead");
-    } else {
-        ctx.self = (RefSeqMgr*)cself;
-        ctx.name = accession;
-        ctx.name_sz = accession_sz;
-        ctx.found = false;
-        ctx.tbl = tbl;
-        ctx.rc = 0;
-        ctx.path = path;
-        
-        rc = RefSeqMgr_ForEachVolume(cself, FindTable, &ctx);
-        if(rc == 0 && ctx.rc == 0 && !ctx.found) {
-            rc = RC(rcAlign, rcTable, rcOpening, rcTable, rcNotFound);
-        }
-        KDBManagerRelease(ctx.kmgr);
-    }
-    return rc ? rc : ctx.rc;
-}
-#endif
-
-LIB_EXPORT rc_t CC RefSeqMgr_SetCache(RefSeqMgr const *const cself, size_t cache, uint32_t keep_open_num)
-{
-    if (cself) {
-        RefSeqMgr *const self = (RefSeqMgr *)cself;
-        
-        self->cache = cache;
-        self->num_open_max = keep_open_num;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC RefSeqMgr_Make( const RefSeqMgr** cself, const VDBManager* vmgr,
-                                   uint32_t reader_options, size_t cache, uint32_t keep_open_num )
-{
-    rc_t rc = 0;
-    RefSeqMgr* obj = NULL;
-    
-    if ( cself == NULL || vmgr == NULL )
-    {
-        rc = RC( rcAlign, rcIndex, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        obj = calloc( 1, sizeof( *obj ) );
-        if ( obj == NULL )
-        {
-            rc = RC( rcAlign, rcIndex, rcConstructing, rcMemory, rcExhausted );
-        }
-        else
-        {
-            rc = KConfigMake( &obj->kfg, NULL );
-            if ( rc == 0 )
-            {
-                rc = VDBManagerAddRef( vmgr );
-                if ( rc == 0 )
-                {
-                    BSTreeInit( &obj->tree );
-                    BSTreeInit( &obj->vdbs );
-                    obj->vmgr = vmgr;
-                    obj->cache = cache;
-                    obj->num_open_max = keep_open_num;
-                    obj->reader_options = reader_options;
-                }
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        *cself = obj;
-/*        ALIGN_DBG( "max_open: %u", obj->num_open_max ); */
-    }
-    else
-    {
-        RefSeqMgr_Release( obj );
-        ALIGN_DBGERR( rc );
-    }
-    return rc;
-}
-
-static
-void CC RefSeqMgr_RefSeqWhack(BSTNode *n, void *data)
-{
-    RefSeq* self = (RefSeq*)n;
-    TableReaderRefSeq_Whack(self->reader);
-    free(self);
-}
-
-static
-void CC RefSeqMgr_VDbRelease(BSTNode *n, void *data)
-{
-    RefSeqMgr_Db* self = (RefSeqMgr_Db*)n;
-    VDatabaseRelease(self->db);
-    free(self);
-}
-
-LIB_EXPORT rc_t CC RefSeqMgr_Release(const RefSeqMgr* cself)
-{
-    if( cself != NULL ) {
-        RefSeqMgr* self = (RefSeqMgr*)cself;
-        BSTreeWhack(&self->tree, RefSeqMgr_RefSeqWhack, NULL);
-        BSTreeWhack(&self->vdbs, RefSeqMgr_VDbRelease, NULL);
-        VDBManagerRelease(self->vmgr);
-        KConfigRelease(self->kfg);
-        free(self);
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t RefSeqMgr_Exists(const RefSeqMgr* cself, const char* accession, uint32_t accession_sz, char** path)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || accession == NULL || accession_sz == 0 ) {
-        rc = RC(rcAlign, rcIndex, rcAccessing, rcParam, rcNull);
-    }
-    else {
-#if USE_OWN_REFSEQ_RESOLVER
-        rc = RefSeqMgr_FindTable(cself, accession, accession_sz, NULL, path);
-#else
-        VTable const *tbl = NULL;
-
-        /* if "accession" is not a path,
-           prepend special scheme to tell VResolver
-           to treat WGS accessions as Refseq */
-        if ( string_chr ( accession, accession_sz, '/' ) == NULL )
-            rc = VDBManagerOpenTableRead(cself->vmgr, &tbl, NULL, "ncbi-acc:%.*s?vdb-ctx=refseq", accession_sz, accession);
-        else
-            rc = VDBManagerOpenTableRead(cself->vmgr, &tbl, NULL, "%.*s", accession_sz, accession);
-        VTableRelease(tbl);
-#endif
-    }
-    return rc;
-}
-
-static
-int CC RefSeq_Cmp(const void* item, const BSTNode* node)
-{
-    const String* i = (const String*)item;
-    const RefSeq* n = (const RefSeq*)node;
-
-    if( i->size == n->accession_sz ) {
-        return strncasecmp(i->addr, n->accession, i->size);
-    }
-    return i->size - n->accession_sz;
-}
-
-static
-int CC RefSeq_Sort(const BSTNode* item, const BSTNode* node)
-{
-    const RefSeq* i = (const RefSeq*)item;
-    const RefSeq* n = (const RefSeq*)node;
-
-    if( i->accession_sz == n->accession_sz ) {
-        return strncasecmp(i->accession, n->accession, i->accession_sz);
-    }
-    return i->accession_sz - n->accession_sz;
-}
-
-LIB_EXPORT rc_t CC RefSeqMgr_Read(const RefSeqMgr* cself, const char* seq_id, uint32_t seq_id_sz,
-                                  INSDC_coord_zero offset, INSDC_coord_len len,
-                                  uint8_t* buffer, INSDC_coord_len* written)
-{
-    rc_t rc = 0;
-    const RefSeq* obj;
-
-    if( (rc = RefSeqMgr_GetSeq(cself, &obj, seq_id, seq_id_sz)) == 0 ) {
-        rc = RefSeq_Read(obj, offset, len, buffer, written);
-        RefSeq_Release(obj);
-    }
-    return rc;
-}
-
-static
-void CC RefSeq_Oldest( BSTNode *node, void *Data )
-{
-    RefSeq const *const n = (RefSeq const *)node;
-    RefSeq const **const rslt = (RefSeq const **)Data;
-    RefSeq const *const d = *rslt;
-    
-    if (n->reader != NULL && (d == NULL || n->usage < d->usage))
-        *rslt = n;
-}
-
-static
-rc_t RefSeqMgr_GetReader(RefSeqMgr *const mgr, RefSeq *const obj)
-{
-    rc_t rc = 0;
-    
-    if (obj->reader == NULL) {
-        VTable const *tbl;
-        
-        while (mgr->num_open_max > 0 && mgr->num_open >= mgr->num_open_max) {
-            RefSeq *old;
-            
-        REMOVE_OLDEST:
-            old = NULL;
-            BSTreeForEach(&mgr->tree, false, RefSeq_Oldest, &old);
-            if (old == NULL)
-                break;
-            
-            TableReaderRefSeq_Whack(old->reader);
-            old->reader = NULL;
-            --mgr->num_open;
-        }
-#if USE_OWN_REFSEQ_RESOLVER
-        rc = RefSeqMgr_FindTable(mgr, obj->accession, obj->accession_sz, &tbl, NULL);
-#else
-        /* if "accession" is not a path,
-           prepend special scheme to tell VResolver
-           to treat WGS accessions as Refseq */
-        if ( string_chr ( obj -> accession, obj -> accession_sz, '/' ) == NULL )
-            rc = VDBManagerOpenTableRead(mgr->vmgr, &tbl, NULL, "ncbi-acc:%.*s?vdb-ctx=refseq", obj->accession_sz, obj->accession);
-        else
-            rc = VDBManagerOpenTableRead(mgr->vmgr, &tbl, NULL, "%.*s", obj->accession_sz, obj->accession);
-#endif
-        if (rc == 0)
-            rc = TableReaderRefSeq_MakeTable(&obj->reader, mgr->vmgr, tbl,
-                                             mgr->reader_options, mgr->cache);
-        if (rc == 0) {
-            VTableRelease(tbl);
-            ++mgr->num_open;
-        }
-        else if ( GetRCObject(rc) == rcMemory &&
-                 (GetRCState (rc) == rcInsufficient || GetRCState(rc) == rcExhausted))
-        {
-            if (mgr->num_open_max == 0 || mgr->num_open < mgr->num_open_max)
-                return rc;
-            rc = 0;
-            goto REMOVE_OLDEST;
-        }
-        else
-            return rc;
-    }
-    mgr->last_used = obj;
-    return rc;
-}
-
-static
-rc_t RefSeqMgr_GetSeqInternal(RefSeqMgr *const mgr, RefSeq const **const cself,
-                              char const seq_id[], unsigned const seq_id_sz)
-{
-    
-    rc_t rc;
-    RefSeq *obj;
-    String s;
-    
-    StringInit(&s, seq_id, seq_id_sz, seq_id_sz);
-    
-    *cself = NULL;
-    if (mgr->last_used != NULL && RefSeq_Cmp(&s, &mgr->last_used->dad) == 0)
-        obj = mgr->last_used;
-    else {
-        obj = (RefSeq*)BSTreeFind(&mgr->tree, &s, RefSeq_Cmp);
-        if (obj == NULL) {
-            obj = calloc(1, sizeof(*obj) + seq_id_sz);
-            if (obj) {
-                memcpy(obj->accession, seq_id, seq_id_sz);
-                obj->accession_sz = seq_id_sz;
-                obj->mgr = mgr;
-                rc = BSTreeInsertUnique(&mgr->tree, &obj->dad, NULL, RefSeq_Sort);
-                if (rc) {
-                    free(obj);
-                    return rc;
-                }
-            }
-            else
-                return RC(rcAlign, rcIndex, rcConstructing, rcMemory, rcExhausted);
-        }
-    }
-    rc = RefSeqMgr_GetReader(mgr, obj);
-    *cself = obj;
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeqMgr_GetSeq(const RefSeqMgr* cmgr, const RefSeq** cself, const char* seq_id, uint32_t seq_id_sz)
-{
-    rc_t rc;
-
-    if (cmgr == NULL || cself == NULL || seq_id == NULL)
-        rc = RC(rcAlign, rcIndex, rcConstructing, rcParam, rcNull);
-    else
-        rc = RefSeqMgr_GetSeqInternal((RefSeqMgr *)cmgr, cself, seq_id, seq_id_sz);
-
-    if (rc)
-        ALIGN_DBGERRP("SEQ_ID: '%.*s'", rc, seq_id_sz, seq_id);
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeq_Read(const RefSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                               uint8_t* buffer, INSDC_coord_len* written)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || buffer == NULL || written == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    }
-    else {
-        RefSeq *const self = (RefSeq *)cself;
-        RefSeqMgr *const mgr = (RefSeqMgr *)self->mgr;
-        
-        rc = RefSeqMgr_GetReader(mgr, self);
-        if (rc == 0) {
-            TableReaderRefSeq const *const reader = self->reader;
-            
-            rc = TableReaderRefSeq_Read(reader, offset, len, buffer, written);
-            if (rc == 0)
-                self->usage = ++mgr->usage;
-        }
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeq_Circular(const RefSeq* cself, bool* circular)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else {
-        rc = TableReaderRefSeq_Circular(cself->reader, circular);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeq_SeqLength(const RefSeq* cself, INSDC_coord_len* len)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else {
-        rc = TableReaderRefSeq_SeqLength(cself->reader, len);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeq_MD5(const RefSeq* cself, const uint8_t** md5)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else {
-        rc = TableReaderRefSeq_MD5(cself->reader, md5);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC RefSeq_Release(const RefSeq* cself)
-{
-    return 0;
-}
-
diff --git a/libs/align/writer-alignment.c b/libs/align/writer-alignment.c
deleted file mode 100644
index 5c985d1..0000000
--- a/libs/align/writer-alignment.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <vdb/cursor.h>
-#include <align/writer-alignment.h>
-#include "writer-priv.h"
-#include "reader-cmn.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-static const TableWriterColumn TableWriterAlgn_cols[ewalgn_cn_Last] =
-{
-    /* order is important, see enum in .h !!! */
-    {0, "TMP_KEY_ID", sizeof(uint64_t) * 8, ewcol_Temporary | ewcol_Ignore},
-    {0, "PLOIDY", sizeof(uint32_t) * 8, ewcol_Ignore},
-    {0, "SEQ_SPOT_ID", sizeof(int64_t) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "SEQ_READ_ID", sizeof(INSDC_coord_one) * 8, ewcol_IsArray },
-    {0, "READ_START", sizeof(INSDC_coord_zero) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "READ_LEN", sizeof(INSDC_coord_len) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "REF_ID", sizeof(int64_t) * 8, ewcol_Ignore},
-    {0, "REF_START", sizeof(INSDC_coord_zero) * 8, ewcol_Ignore},
-    {0, "GLOBAL_REF_START", sizeof(uint64_t) * 8, 0},
-    {0, "REF_LEN", sizeof(INSDC_coord_len) * 8, 0},
-    {0, "REF_ORIENTATION", sizeof(bool) * 8, 0},
-    {0, "REF_PLOIDY", sizeof(uint32_t) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "MATE_REF_ORIENTATION", sizeof(bool) * 8, ewcol_Ignore},
-    {0, "MATE_REF_ID", sizeof(int64_t) * 8, ewcol_Ignore},
-    {0, "MATE_REF_POS", sizeof(INSDC_coord_zero) * 8, ewcol_Ignore},
-    {0, "MATE_ALIGN_ID", sizeof(int64_t) * 8, ewcol_Ignore},
-    {0, "TEMPLATE_LEN", sizeof(INSDC_coord_zero) * 8, ewcol_Ignore},
-    {0, "MAPQ", sizeof(int32_t) * 8, 0},
-    {0, "HAS_MISMATCH", sizeof(bool) * 8, ewcol_IsArray},
-    {0, "(bool)HAS_REF_OFFSET", sizeof(bool) * 8, ewcol_IsArray},
-    {0, "MISMATCH", sizeof(INSDC_dna_text) * 8, ewcol_IsArray},
-    {0, "REF_OFFSET", sizeof(int32_t) * 8, ewcol_IsArray},
-    {0, "EVIDENCE_ALIGNMENT_IDS", sizeof(int64_t) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "ALIGN_GROUP", sizeof(char) * 8, ewcol_IsArray | ewcol_Ignore },
-    {0, "MISMATCH_QUALITY", sizeof(uint8_t) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "MATE_GLOBAL_REF_START", sizeof(uint64_t) * 8, ewcol_Ignore},
-    {0, "MATE_REF_START", sizeof(INSDC_coord_zero) * 8, ewcol_Ignore}
-};
-
-static const TableReaderColumn TableAlgnReadTmpKey_cols[] = {
-    {0, "TMP_KEY_ID", {NULL}, 0, 0},
-    {0, "GLOBAL_REF_START", {NULL}, 0, ercol_Skip},
-    {0, "REF_ID", {NULL}, 0, ercol_Skip},
-    {0, "REF_START", {NULL}, 0, ercol_Skip},
-    {0, NULL, {NULL}, 0, 0}
-};
-
-struct TableWriterAlgn {
-    uint32_t options;
-    const TableWriter* base;
-    const char* ref_table_name;
-    uint8_t cursor_id;
-    TableWriterColumn cols[ewalgn_cn_Last];
-    uint8_t spotid_cursor_id;
-    TableWriterColumn cols_spotid[5];
-    const TableReader* tmpkey_reader;
-    TableReaderColumn cols_read_tmpkey[sizeof(TableAlgnReadTmpKey_cols) / sizeof(TableAlgnReadTmpKey_cols[0])];
-};
-
-LIB_EXPORT rc_t CC TableWriterAlgn_Make(const TableWriterAlgn** cself, VDatabase* db,
-                                        ETableWriterAlgn_TableType type, uint32_t options)
-{
-    rc_t rc = 0;
-    TableWriterAlgn* self = NULL;
-    const char* tbl_nm = __func__;
-
-    if( cself == NULL || db == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            self->ref_table_name = "REFERENCE";
-            memcpy(self->cols, TableWriterAlgn_cols, sizeof(TableWriterAlgn_cols));
-            switch(type) {
-            case ewalgn_tabletype_PrimaryAlignment:
-                tbl_nm = "PRIMARY_ALIGNMENT";
-                self->cols[ewalgn_cn_ALIGN_GROUP].flags &= ~ewcol_Ignore;
-                if (options & ewalgn_co_MISMATCH_QUALITY)
-                    self->cols[ewalgn_cn_MISMATCH_QUALITY].flags &= ~ewcol_Ignore;
-                break;
-            case ewalgn_tabletype_SecondaryAlignment:
-                tbl_nm = "SECONDARY_ALIGNMENT";
-#if 0
-                self->cols[ewalgn_cn_HAS_MISMATCH].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_MISMATCH].flags |= ewcol_Ignore;
-#else
-                self->cols[ewalgn_cn_MISMATCH].name = "TMP_MISMATCH";
-                self->cols[ewalgn_cn_HAS_MISMATCH].name = "TMP_HAS_MISMATCH";
-#endif
-                self->cols[ewalgn_cn_MATE_REF_ORIENTATION].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_MATE_REF_ID].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_MATE_REF_POS].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_MATE_ALIGN_ID].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_TEMPLATE_LEN].flags &= ~ewcol_Ignore;
-                break;
-            case ewalgn_tabletype_EvidenceInterval:
-                tbl_nm = "EVIDENCE_INTERVAL";
-                options |= ewalgn_co_unsorted;
-                options |= ewalgn_co_PLOIDY;
-                self->cols[ewalgn_cn_SEQ_SPOT_ID].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_SEQ_READ_ID].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_EVIDENCE_ALIGNMENT_IDS].flags &= ~ewcol_Ignore;
-                break;
-            case ewalgn_tabletype_EvidenceAlignment:
-                tbl_nm = "EVIDENCE_ALIGNMENT";
-                self->ref_table_name = "EVIDENCE_INTERVAL";
-                self->cols[ewalgn_cn_REF_PLOIDY].flags &= ~ewcol_Ignore;
-#if 0
-                self->cols[ewalgn_cn_HAS_MISMATCH].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_MISMATCH].flags |= ewcol_Ignore;
-#else
-                self->cols[ewalgn_cn_MISMATCH].name = "TMP_MISMATCH";
-                self->cols[ewalgn_cn_HAS_MISMATCH].name = "TMP_HAS_MISMATCH";
-#endif
-                options |= ewalgn_co_unsorted;
-                break;
-            default:
-                rc = RC(rcAlign, rcFormatter, rcConstructing, rcType, rcUnrecognized);
-            }
-            if( options & ewalgn_co_SEQ_SPOT_ID ) {
-                self->cols[ewalgn_cn_SEQ_SPOT_ID].flags &= ~ewcol_Ignore;
-            }
-            if( options & ewalgn_co_TMP_KEY_ID ) {
-                self->cols[ewalgn_cn_TMP_KEY_ID].flags &= ~ewcol_Ignore;
-            }
-            if( options & ewalgn_co_PLOIDY ) {
-                self->cols[ewalgn_cn_PLOIDY].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_READ_START].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_READ_LEN].flags &= ~ewcol_Ignore;
-            }
-            if( options & ewalgn_co_unsorted ) {
-                self->cols[ewalgn_cn_REF_ID].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_REF_START].flags &= ~ewcol_Ignore;
-                self->cols[ewalgn_cn_GLOBAL_REF_START].flags |= ewcol_Ignore;
-                if( type == ewalgn_tabletype_SecondaryAlignment ) {
-                    self->cols[ewalgn_cn_MISMATCH].name = "TMP_MISMATCH";
-                    self->cols[ewalgn_cn_MISMATCH].flags &= ~ewcol_Ignore;
-                    self->cols[ewalgn_cn_HAS_MISMATCH].name = "TMP_HAS_MISMATCH";
-                    self->cols[ewalgn_cn_HAS_MISMATCH].flags &= ~ewcol_Ignore;
-                }
-            }
-            if( options & ewalgn_co_MATE_ALIGN_ID_only ) {
-                self->cols[ewalgn_cn_MATE_REF_ORIENTATION].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_MATE_REF_ID].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_MATE_REF_POS].flags |= ewcol_Ignore;
-                self->cols[ewalgn_cn_TEMPLATE_LEN].flags |= ewcol_Ignore;
-            }
-            if( (rc = TableWriter_Make(&self->base, db, tbl_nm, NULL)) == 0 ) {
-                rc = TableWriter_AddCursor(self->base, self->cols, sizeof(self->cols)/sizeof(self->cols[0]), &self->cursor_id);
-                self->options = options;
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        ALIGN_DBG("table %s created", tbl_nm);
-    } else {
-        TableWriterAlgn_Whack(self, false, NULL);
-        ALIGN_DBGERR(rc);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_Whack(const TableWriterAlgn* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        VTable* vtbl;
-
-        TableReader_Whack(cself->tmpkey_reader);
-        if( (rc = TableWriter_GetVTable(cself->base, &vtbl)) == 0 ) {
-            KMetadata* meta;
-            if( (rc = VTableOpenMetadataUpdate(vtbl, &meta)) == 0 ) {
-                KMDataNode* node;
-                if( (rc = KMetadataOpenNodeUpdate(meta, &node, "CONFIG/REF_TABLE")) == 0 ) {
-                    rc = KMDataNodeWriteCString(node, cself->ref_table_name);
-                    KMDataNodeRelease(node);
-                }
-                KMetadataRelease(meta);
-            }
-        }
-        rc = TableWriter_Whack(cself->base, commit, rows);
-        free((TableWriterAlgn*)cself);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_WriteDefault(const TableWriterAlgn* cself, enum ETableWriterAlgn_ColNames col, const TableWriterData* data)
-{
-    return TableWriter_ColumnDefault(cself->base, 0, &cself->cols[col], data);
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_GetNextRowId(const TableWriterAlgn* cself, int64_t* rowid)
-{
-    return TableWriter_GetNextRowId(cself->base, rowid, cself->cursor_id);
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_Write(const TableWriterAlgn* cself, const TableWriterAlgnData* data, int64_t* rowid)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableWriter_OpenRow(cself->base, rowid, cself->cursor_id)) == 0 ) {
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewalgn_cn_PLOIDY], data->ploidy);
-
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_SEQ_SPOT_ID], data->seq_spot_id);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_SEQ_READ_ID], data->seq_read_id);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_READ_START], data->read_start);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_READ_LEN], data->read_len);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_TMP_KEY_ID], data->tmp_key_id);
-
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_HAS_REF_OFFSET], data->has_ref_offset);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_REF_OFFSET], data->ref_offset);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_REF_ID], data->ref_id);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_REF_START], data->ref_start);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_GLOBAL_REF_START], data->global_ref_start);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_HAS_MISMATCH], data->has_mismatch);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MISMATCH], data->mismatch);
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewalgn_cn_REF_LEN], data->ref_len);
-
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_REF_ORIENTATION], data->ref_orientation);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_REF_PLOIDY], data->ref_ploidy);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MAPQ], data->mapq);
-
-        if( data->mate_align_id.elements != 1 ) {
-            TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MATE_ALIGN_ID], data->mate_align_id);
-        } else {
-            TW_COL_WRITE_BUF(cself->base, cself->cols[ewalgn_cn_MATE_ALIGN_ID], data->mate_align_id.buffer,
-                             ((const int64_t*)(data->mate_align_id.buffer))[0] ? 1 : 0);
-        }
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MATE_REF_ORIENTATION], data->mate_ref_orientation);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MATE_REF_ID], data->mate_ref_id);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_MATE_REF_POS], data->mate_ref_pos);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_TEMPLATE_LEN], data->template_len);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_EVIDENCE_ALIGNMENT_IDS], data->alingment_ids);
-        TW_COL_WRITE(cself->base, cself->cols[ewalgn_cn_ALIGN_GROUP], data->align_group);
-
-        if( rc == 0 ) {
-            rc = TableWriter_CloseRow(cself->base);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_TmpKeyStart(const TableWriterAlgn* cself)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( (cself->options & ewalgn_co_SEQ_SPOT_ID) || !(cself->options & ewalgn_co_TMP_KEY_ID) ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcViolated);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableWriter_CloseCursor(cself->base, cself->cursor_id, NULL)) == 0 ) {
-        TableWriterAlgn* self = (TableWriterAlgn*)cself;
-        VTable* vtbl = NULL;
-        
-        memcpy(&self->cols_read_tmpkey, &TableAlgnReadTmpKey_cols, sizeof(TableAlgnReadTmpKey_cols));
-        if (self->cols[ewalgn_cn_GLOBAL_REF_START].flags & ewcol_Ignore) {
-            self->cols_read_tmpkey[2].flags = 0;
-            self->cols_read_tmpkey[3].flags = 0;
-        }
-        else
-            self->cols_read_tmpkey[1].flags = 0;
-
-        if( (rc = TableWriter_GetVTable(self->base, &vtbl)) == 0 &&
-            (rc = TableReader_Make(&self->tmpkey_reader, vtbl, self->cols_read_tmpkey, 50 * 1024 * 1024)) == 0 ) {
-            int64_t v = 0;
-            
-            memcpy(self->cols_spotid + 0, &TableWriterAlgn_cols[ewalgn_cn_SEQ_SPOT_ID], sizeof(self->cols_spotid[0]));
-            memcpy(self->cols_spotid + 1, &TableWriterAlgn_cols[ewalgn_cn_MATE_GLOBAL_REF_START], sizeof(self->cols_spotid[0]));
-            memcpy(self->cols_spotid + 2, &TableWriterAlgn_cols[ewalgn_cn_MATE_REF_ID], sizeof(self->cols_spotid[0]));
-            memcpy(self->cols_spotid + 3, &TableWriterAlgn_cols[ewalgn_cn_MATE_REF_START], sizeof(self->cols_spotid[0]));
-            memcpy(self->cols_spotid + 3, &TableWriterAlgn_cols[ewalgn_cn_MATE_ALIGN_ID], sizeof(self->cols_spotid[0]));
-            
-            self->cols_spotid[0].flags &= ~ewcol_Ignore;
-            if (self->options & ewalgn_co_MATE_POSITION) {
-                if (self->cols[ewalgn_cn_GLOBAL_REF_START].flags & ewcol_Ignore) {
-                    self->cols_spotid[2].flags &= ~ewcol_Ignore;
-                    self->cols_spotid[3].flags &= ~ewcol_Ignore;
-                }
-                else
-                    self->cols_spotid[1].flags &= ~ewcol_Ignore;
-                self->cols_spotid[4].flags &= ~ewcol_Ignore;
-            }
-            else {
-                self->cols_spotid[1].flags |= ewcol_Ignore;
-                self->cols_spotid[2].flags |= ewcol_Ignore;
-                self->cols_spotid[3].flags |= ewcol_Ignore;
-                self->cols_spotid[4].flags |= ewcol_Ignore;
-            }
-            rc = TableWriter_AddCursor(self->base, self->cols_spotid,
-                                       sizeof(self->cols_spotid) / sizeof(self->cols_spotid[0]),
-                                       &self->spotid_cursor_id);
-
-            TW_COL_WRITE_DEF_VAR(self->base, self->spotid_cursor_id, self->cols_spotid[0], v);
-            TW_COL_WRITE_DEF_VAR(self->base, self->spotid_cursor_id, self->cols_spotid[1], v);
-            TW_COL_WRITE_DEF_VAR(self->base, self->spotid_cursor_id, self->cols_spotid[2], v);
-            TW_COL_WRITE_DEF_VAR(self->base, self->spotid_cursor_id, self->cols_spotid[3], v);
-            TW_COL_WRITE_DEF_VAR(self->base, self->spotid_cursor_id, self->cols_spotid[4], v);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_TmpKey(const TableWriterAlgn* cself, int64_t rowid, uint64_t* key_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || rowid == 0 || key_id == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->tmpkey_reader == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcMode, rcNotOpen);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableReader_ReadRow(cself->tmpkey_reader, rowid)) == 0 ) {
-        memcpy(key_id, cself->cols_read_tmpkey[0].base.var, sizeof(*key_id));
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_RefStart(const TableWriterAlgn* cself, int64_t rowid, ReferenceStart *const rslt)
-{
-    rc_t rc = 0;
-    
-    if( cself == NULL || rowid == 0 || rslt == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->tmpkey_reader == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcMode, rcNotOpen);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableReader_ReadRow(cself->tmpkey_reader, rowid)) == 0 ) {
-        if (cself->cols_read_tmpkey[1].flags & ewcol_Ignore) {
-            memcpy(&rslt->local.ref_id, cself->cols_read_tmpkey[2].base.var, sizeof(rslt->local.ref_id));
-            memcpy(&rslt->local.ref_start, cself->cols_read_tmpkey[3].base.var, sizeof(rslt->local.ref_start));
-        }
-        else
-            memcpy(&rslt->global_ref_start, cself->cols_read_tmpkey[1].base.var, sizeof(rslt->global_ref_start));
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_Write_SpotId(const TableWriterAlgn* cself, int64_t rowid, int64_t spot_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || rowid == 0 ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->options & ewalgn_co_SEQ_SPOT_ID ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcViolated);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableWriter_OpenRowId(cself->base, rowid, cself->spotid_cursor_id)) == 0 ) {
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[0], spot_id);
-        if( rc == 0 ) {
-            rc = TableWriter_CloseRow(cself->base);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterAlgn_Write_SpotInfo(const TableWriterAlgn* cself,
-                                                  int64_t rowid,
-                                                  int64_t spot_id,
-                                                  int64_t mate_id,
-                                                  ReferenceStart const *ref_start)
-{
-    rc_t rc = 0;
-    
-    if( cself == NULL || rowid == 0 ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->options & ewalgn_co_SEQ_SPOT_ID ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcViolated);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableWriter_OpenRowId(cself->base, rowid, cself->spotid_cursor_id)) == 0 ) {
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[0], spot_id);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[1], ref_start->global_ref_start);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[2], ref_start->local.ref_id);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[3], ref_start->local.ref_start);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_spotid[4], mate_id);
-        
-        if( rc == 0 ) {
-            rc = TableWriter_CloseRow(cself->base);
-        }
-    }
-    return rc;
-}
diff --git a/libs/align/writer-cmn.c b/libs/align/writer-cmn.c
deleted file mode 100644
index 4659a1d..0000000
--- a/libs/align/writer-cmn.c
+++ /dev/null
@@ -1,568 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <kdb/meta.h>
-#include <kapp/main.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <align/writer-cmn.h>
-#include "writer-priv.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define TW_MAX_CURSORS 8
-
-struct TableWriter {
-    /* db OR mgr not both */
-    VDatabase* vdb;
-    VDBManager* vmgr;
-    char* table_path;
-    VSchema* vschema;
-    bool is_update;
-
-    VTable* vtbl;
-    char* table;
-    struct {
-        uint32_t col_qty; /* != 0 cursor is used */
-        const TableWriterColumn* cols;
-        VCursor* cursor; /* != NULL cursor is opened */
-        uint64_t rows;
-    } *curr, cursors[TW_MAX_CURSORS];
-};
-
-static
-rc_t TableWriter_Init(TableWriter** self, const char* table, const char* table_path)
-{
-    rc_t rc = 0;
-
-    if( self == NULL || table == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (*self = calloc(1, sizeof(**self))) == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        (*self)->table = string_dup( table, string_size( table ) );
-        if( (*self)->table == NULL ) {
-            rc = RC(rcAlign, rcType, rcConstructing, rcMemory, rcExhausted);
-        } else if( table_path != NULL ) {
-            (*self)->table_path = string_dup( table_path, string_size( table_path ) );
-            if( (*self)->table_path == NULL ) {
-                rc = RC(rcAlign, rcType, rcConstructing, rcMemory, rcExhausted);
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t TableWriter_OpenCursor(const TableWriter* cself, uint8_t cursor_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcInvalid);
-    } else if( cself->cursors[cursor_id].cursor == NULL ) {
-        TableWriter* self = (TableWriter*)cself;
-
-        if( self->vtbl == NULL ) {
-            if( self->vmgr != NULL ) {
-                rc = VDBManagerCreateTable(self->vmgr, &self->vtbl, self->vschema, self->table, kcmCreate | kcmMD5, self->table_path);
-            } else if( self->is_update ) {
-                rc = VDatabaseOpenTableUpdate(self->vdb, &self->vtbl, self->table);
-            } else {
-                rc = VDatabaseCreateTable(self->vdb, &self->vtbl, self->table, kcmCreate | kcmMD5, self->table_path);
-            }
-        }
-
-        if( rc == 0 &&
-            (rc = VTableColumnCreateParams(self->vtbl, kcmCreate, kcsCRC32, 0)) == 0 &&
-            (rc = VTableCreateCursorWrite(self->vtbl, &self->cursors[cursor_id].cursor, kcmInsert)) == 0 ) {
-            uint32_t i;
-            for(i = 0; rc == 0 && i < self->cursors[cursor_id].col_qty; i++) {
-                if( !(self->cursors[cursor_id].cols[i].flags & ewcol_Ignore) ) {
-                    if( (rc = VCursorAddColumn(self->cursors[cursor_id].cursor,
-                                               (uint32_t*)&self->cursors[cursor_id].cols[i].idx,
-                                               self->cursors[cursor_id].cols[i].name)) == 0 ) {
-                        ALIGN_DBG("column %s opened", self->cursors[cursor_id].cols[i].name);
-                    } else {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "table $(table) failed to create column '$(column)'",
-                                                             "table=%s,column=%s", self->table, self->cursors[cursor_id].cols[i].name));
-                    }
-                }
-            }
-            if( rc == 0 ) {
-                rc = VCursorOpen(self->cursors[cursor_id].cursor);
-            }
-        }
-        if( rc == 0 ) {
-            ALIGN_DBG("table %s opened cursor %u for writing", self->table, cursor_id);
-        } else {
-            ALIGN_DBGERRP("table %s failed to open cursor %u for writing", rc, self->table, cursor_id);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_Make(const TableWriter** cself, VDatabase *db, const char* table, const char* table_path)
-{
-    rc_t rc = 0;
-    TableWriter* obj = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = TableWriter_Init(&obj, table, table_path ? table_path : table)) == 0 &&
-               (rc = VDatabaseAddRef(db)) == 0 ) {
-        obj->vdb = db;
-    }
-    if( rc == 0 ) {
-        *cself = obj;
-        ALIGN_DBG("table %s opened for writing", (*cself)->table);
-    } else {
-        TableWriter_Whack(obj, false, NULL);
-        ALIGN_DBGERRP("table %s at %s", rc, table, table_path);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_MakeMgr(const TableWriter** cself, VDBManager* mgr, const char* schema_path,
-                            const char* type, const char* table_path)
-{
-    rc_t rc = 0;
-    TableWriter* obj = NULL;
-
-    if( cself == NULL || mgr == NULL || schema_path == NULL || type == NULL || table_path == NULL) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = TableWriter_Init(&obj, type, table_path)) == 0 &&
-               (rc = VDBManagerMakeSchema(mgr, &obj->vschema)) == 0 &&
-               (rc = VSchemaParseFile(obj->vschema, schema_path)) == 0 &&
-               (rc = VDBManagerAddRef(mgr)) == 0 ) {
-       obj->vmgr = mgr;
-    }
-    if( rc == 0 ) {
-        *cself = obj;
-        ALIGN_DBG("table %s at %s opened for writing", (*cself)->table, (*cself)->table_path);
-    } else {
-        TableWriter_Whack(obj, false, NULL);
-        ALIGN_DBGERRP("table %s at %s", rc, type, table_path);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_MakeUpdate(const TableWriter** cself, VDatabase *db, const char* table)
-{
-    rc_t rc = 0;
-    TableWriter* obj = NULL;
-
-    if( cself == NULL || db == NULL ) {
-        rc = RC(rcAlign, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = TableWriter_Init(&obj, table, NULL)) == 0 &&
-               (rc = VDatabaseAddRef(db)) == 0 ) {
-        obj->is_update = true;
-        obj->vdb = db;
-    }
-    if( rc == 0 ) {
-        *cself = obj;
-        ALIGN_DBG("table %s opened for update", (*cself)->table);
-    } else {
-        TableWriter_Whack(obj, false, NULL);
-        ALIGN_DBGERRP("table %s", rc, table);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_GetVTable(const TableWriter* cself, VTable** vtbl)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || vtbl == NULL ) {
-        rc = RC(rcAlign, rcType, rcAccessing, rcParam, rcNull);
-    } else {
-        *vtbl = cself->vtbl;
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_Sign(const TableWriter *const cself,
-                         const char loader_name[],
-                         const ver_t loader_version,
-                         const char loader_date[],
-                         const char app_name[],
-                         const ver_t app_version)
-{
-    rc_t rc = 0;
-    KMetadata* meta = NULL;
-    KMDataNode* root = NULL;
-
-    if( cself == NULL || loader_name == NULL || loader_date == NULL || app_name == NULL || app_version == 0 ) {
-        rc = RC(rcAlign, rcMetadata, rcWriting, rcParam, rcNull);
-    } else if( (rc = VTableOpenMetadataUpdate(cself->vtbl, &meta)) == 0 &&
-               (rc = KMetadataOpenNodeUpdate(meta, &root, "/")) == 0 ) {
-        KMDataNode *node = NULL;
-        if( (rc = KMDataNodeOpenNodeUpdate(root, &node, "SOFTWARE")) == 0 ) {
-            char str_vers[64];
-            KMDataNode *subNode = NULL;
-            if( (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "loader")) == 0 ) {
-                if( (rc = string_printf(str_vers, sizeof(str_vers), NULL, "%V", loader_version)) == 0 ) {
-                    rc = KMDataNodeWriteAttr(subNode, "vers", str_vers);
-                }
-                if(rc == 0) {
-                    rc = KMDataNodeWriteAttr(subNode, "date", loader_date);
-                }
-                if(rc == 0) {
-                    const char* tool_name = strrchr(loader_name, '/');
-                    const char* r = strrchr(loader_name, '\\');
-                    if( tool_name != NULL && r != NULL && tool_name < r ) {
-                        tool_name = r;
-                    }
-                    if( tool_name++ == NULL) {
-                        tool_name = loader_name;
-                    }
-                    rc = KMDataNodeWriteAttr(subNode, "name", tool_name);
-                }
-                KMDataNodeRelease(subNode);
-            }
-            if(rc == 0 && (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "formatter")) == 0 ) {
-                if( (rc = string_printf(str_vers, sizeof(str_vers), NULL, "%V", app_version)) == 0 ) {
-                    rc = KMDataNodeWriteAttr(subNode, "vers", str_vers);
-                }
-                if(rc == 0) {
-                    rc = KMDataNodeWriteAttr(subNode, "name", app_name);
-                }
-                KMDataNodeRelease(subNode);
-            }
-            KMDataNodeRelease(node);
-        }
-        if( rc == 0 && (rc = KMDataNodeOpenNodeUpdate(root, &node, "LOAD")) == 0 ) {
-            KMDataNode *subNode = NULL;
-            if( (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "timestamp")) == 0 ) {
-                time_t t = time(NULL);
-                rc = KMDataNodeWrite(subNode, &t, sizeof(t));
-                KMDataNodeRelease(subNode);
-            }
-            KMDataNodeRelease(node);
-        }
-    }
-    KMDataNodeRelease(root);
-    KMetadataRelease(meta);
-    return rc;
-}
-
-rc_t CC TableWriter_Whack(const TableWriter* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-
-    if( rows != NULL ) {
-        *rows = 0;
-    }
-    if( cself != NULL ) {
-        TableWriter* self = (TableWriter*)cself;
-        uint32_t i, j;
-        
-        for(i = 0; i < TW_MAX_CURSORS; i++) {
-            if( self->cursors[i].col_qty > 0 ) {
-                self->curr = &self->cursors[i];
-                if( self->curr->cursor != NULL ) {
-                    rc_t rc1 = 0, rc2;
-                    if( commit ) {
-                        rc1 = VCursorCommit(self->curr->cursor);
-                    }
-                    rc2 = VCursorRelease(self->curr->cursor);
-                    rc = rc ? rc : (rc1 ? rc1 : rc2);
-                    self->curr->cursor = NULL;
-                }
-                if( i == 0 && rows != NULL ) {
-                    *rows = self->curr->rows;
-                }
-            }
-        }
-        for(i = 0; i < TW_MAX_CURSORS; i++) {
-            if( self->cursors[i].col_qty > 0 ) {
-                self->curr = &self->cursors[i];
-                for(j = 0; j < self->curr->col_qty; j++) {
-                    if( self->curr->cols[j].idx != 0 && (self->curr->cols[j].flags & ewcol_Temporary) ) {
-                        rc_t rc1;
-                        if( (rc1 = VTableDropColumn(self->vtbl, self->curr->cols[j].name)) != 0 ) {
-                            (void)PLOGERR(klogWarn, (klogWarn, rc1,
-                                "table $(table) failed to drop temporary column '$(column)'",
-                                "table=%s,column=%s", self->table, self->curr->cols[j].name));
-                        } else {
-                            ALIGN_DBG("table %s dropped tmp col %s", self->table, self->curr->cols[j].name);
-                        }
-                    }
-                }
-            }
-        }
-        if( commit && rc == 0 && self->vtbl != NULL ) {
-            rc = VTableReindex(self->vtbl);
-        }
-        VTableRelease(self->vtbl);
-        VSchemaRelease(self->vschema);
-        VDBManagerRelease(self->vmgr);
-        VDatabaseRelease(self->vdb);
-        if( rc == 0 ) {
-            ALIGN_DBG("table %s%s%s", self->table, self->table_path ? " at " : "", self->table_path ? self->table_path : "");
-        } else {
-            ALIGN_DBGERRP("table %s%s%s", rc, self->table, self->table_path ? " at " : "", self->table_path ? self->table_path : "");
-        }
-        free(self->table);
-        free(self->table_path);
-        free(self);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_AddCursor(const TableWriter* cself, TableWriterColumn* cols, uint32_t col_qty, uint8_t* cursor_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || cols == NULL || col_qty == 0 || cursor_id == NULL ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    } else {
-        uint32_t i;
-        TableWriter* self = (TableWriter*)cself;
-
-        *cursor_id = TW_MAX_CURSORS;
-        for(i = 0; i < TW_MAX_CURSORS; i++) {
-            if( self->cursors[i].col_qty == 0 ) {
-                self->cursors[i].col_qty = col_qty;
-                self->cursors[i].cols = cols;
-                self->cursors[i].cursor = NULL;
-                self->cursors[i].rows = 0;
-                *cursor_id = i;
-                break;
-            }
-        }
-        if( *cursor_id >= TW_MAX_CURSORS ) {
-            rc = RC(rcAlign, rcType, rcOpening, rcConstraint, rcExhausted);
-        }
-    }
-    if( rc != 0 ) {
-        ALIGN_DBGERRP("table %s", rc, cself->table);
-    } else {
-        ALIGN_DBG("table %s added cursor %hu", cself->table, *cursor_id);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_CloseCursor(const TableWriter* cself, uint8_t cursor_id, uint64_t* rows)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].cursor == NULL ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    } else {
-        rc_t rc2;
-        TableWriter* self = (TableWriter*)cself;
-        uint64_t r = 0;
-
-        if( rows == NULL ) {
-            rows = &r;
-        }
-        self->curr = &self->cursors[cursor_id];
-        rc = VCursorCommit(self->curr->cursor);
-        *rows = cself->curr->rows;
-        rc2 = VCursorRelease(self->curr->cursor);
-        self->curr->cursor = NULL;
-        rc = rc ? rc : rc2;
-    }
-    if( rc == 0 ) {
-        ALIGN_DBG("table %s closed cursor %hu rows %ld", cself->table, cursor_id, *rows);
-    } else {
-        ALIGN_DBGERRP("table %s cursor %hu row %ld", rc, cself->table, cursor_id, *rows);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_Flush(const TableWriter *cself, const uint8_t cursor_id)
-{
-    rc_t rc = 0;
-    
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    }
-    else if( cself->cursors[cursor_id].cursor != NULL ) {
-        rc = VCursorFlushPage(cself->cursors[cursor_id].cursor);
-        if( rc == 0 ) {
-            ALIGN_DBG("table %s cursor %hu flushed", cself->table, cursor_id);
-        } else {
-            ALIGN_DBGERRP("table %s cursor %hu flushing", rc, cself->table, cursor_id);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_OpenRow(const TableWriter* cself, int64_t* rowid, const uint8_t cursor_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    }
-    else if( cself->cursors[cursor_id].cursor != NULL || (rc = TableWriter_OpenCursor(cself, cursor_id)) == 0 ) {
-        TableWriter* self = (TableWriter*)cself;
-
-        self->curr = &self->cursors[cursor_id];
-        if( (rc = VCursorOpenRow(self->curr->cursor)) == 0 && rowid != NULL ) {
-            rc = VCursorRowId(self->curr->cursor, rowid);
-        }
-        if( rc == 0 ) {
-            ALIGN_DBG("table %s cursor %hu opened row %ld", self->table, cursor_id, self->curr->rows + 1);
-        } else {
-            ALIGN_DBGERRP("table %s cursor %hu row %ld", rc, self->table, cursor_id, self->curr->rows + 1);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_OpenRowId(const TableWriter* cself, const int64_t rowid, const uint8_t cursor_id)
-{
-    rc_t rc = 0;
-    
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    } else if( cself->cursors[cursor_id].cursor != NULL || (rc = TableWriter_OpenCursor(cself, cursor_id)) == 0 ) {
-        TableWriter* self = (TableWriter*)cself;
-
-        self->curr = &self->cursors[cursor_id];
-        /* loop through missed rows to assign default values */
-        if( rowid > self->curr->rows + 1 ) {
-            int64_t r;
-            for(r = self->curr->rows + 1; rc == 0 && r < rowid; r++) {
-                if( (rc = VCursorOpenRow(self->curr->cursor)) == 0 &&
-                    (rc = VCursorCommitRow(self->curr->cursor)) == 0 ) {
-                    ALIGN_DBG("table %s written default row for cursor %hu row %ld", self->table, cursor_id, r);
-                    rc = VCursorCloseRow(self->curr->cursor);
-                }
-            }
-        }
-        if( rc == 0 /* && (rc = VCursorSetRowId(cself->curr->cursor, rowid)) == 0 */ ) {
-            rc = VCursorOpenRow(cself->curr->cursor);
-        }
-        if( rc == 0 ) {
-            if( rowid > self->curr->rows + 1) {
-                self->curr->rows = rowid - 1;
-            }
-            ALIGN_DBG("table %s cursor %hu opened row %ld", self->table, cursor_id, rowid);
-        } else {
-            ALIGN_DBGERRP("table %s cursor %hu row %ld", rc, self->table, cursor_id, rowid);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_GetNextRowId(const TableWriter* cself, int64_t* rowid, const uint8_t cursor_id)
-{
-    rc_t rc = 0;
-    
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ) {
-        rc = RC(rcAlign, rcType, rcOpening, rcParam, rcInvalid);
-        ALIGN_DBGERR(rc);
-    } else {
-        *rowid = cself->cursors[cursor_id].rows + 1;
-        ALIGN_DBG("table %s next rowid %li", cself->table, *rowid);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_ColumnDefault(const TableWriter* cself, const uint8_t cursor_id,
-                                  const TableWriterColumn* column, const TableWriterData *data)
-{
-    rc_t rc = 0;
-    if( cself == NULL || cursor_id >= TW_MAX_CURSORS || cself->cursors[cursor_id].col_qty == 0 ||
-        column == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-    } else if( !(column->flags & ewcol_IsArray) && data->elements != 1 ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcData, rcTooLong);
-        ALIGN_DBGERRP("column %s is not an array of values", rc, column->name);
-    } else if( cself->cursors[cursor_id].cursor != NULL || (rc = TableWriter_OpenCursor(cself, cursor_id)) == 0 ) {
-        if( column->idx != 0 ) {
-            rc = VCursorDefault(cself->cursors[cursor_id].cursor, column->idx, column->element_bits, data->buffer, 0, data->elements);
-        }
-    }
-    if( rc != 0 ) {
-        ALIGN_DBGERRP("table %s column %s default value", rc, cself->table, column->name);
-    } else {
-        ALIGN_DBG("table %s column %s default value %lu elements", cself->table, column->name, data->elements);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_ColumnWrite(const TableWriter* cself, const TableWriterColumn* column, const TableWriterData *data)
-{
-    rc_t rc = 0;
-    if( cself == NULL || column == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcInvalid);
-    } else if( cself->curr == NULL || cself->curr->cursor == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcMode, rcInvalid);
-    } else if( !(column->flags & ewcol_IsArray) && data->elements > 1 ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcData, rcTooLong);
-        ALIGN_DBGERRP("column %s is not an array of values", rc, column->name);
-    } else if( column->idx != 0 ) {
-        rc = VCursorWrite(cself->curr->cursor, column->idx, column->element_bits, data->buffer, 0, data->elements);
-    }
-    if( rc != 0 ) {
-        ALIGN_DBGERRP("table %s column %s row %ld", rc, cself->table, column->name, cself->curr->rows + 1);
-    } else {
-        ALIGN_DBG("table %s column %s value %lu elements", cself->table, column->name, data->elements);
-    }
-    return rc;
-}
-
-rc_t CC TableWriter_CloseRow(const TableWriter* cself)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcType, rcClosing, rcSelf, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->curr == NULL || cself->curr->cursor == NULL ) {
-        rc = RC( rcAlign, rcType, rcClosing, rcMode, rcInvalid);
-    } else {
-        if( (rc = VCursorCommitRow(cself->curr->cursor)) == 0 ) {
-            rc = VCursorCloseRow(cself->curr->cursor);
-        }
-        if( rc == 0 ) {
-            cself->curr->rows++;
-        } else {
-            ALIGN_DBGERRP("table %s row %ld", rc, cself->table, cself->curr->rows + 1);
-        }
-        ((TableWriter*)cself)->curr = NULL;
-    }
-    return rc;
-}
diff --git a/libs/align/writer-priv.h b/libs/align/writer-priv.h
deleted file mode 100644
index dab67f5..0000000
--- a/libs/align/writer-priv.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_align_writer_priv_
-#define _h_align_writer_priv_
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <kdb/meta.h>
-
-#include <align/writer-cmn.h>
-
-enum TableWriterColumn_Array {
-    ewcol_Ignore = 0x01,
-    ewcol_IsArray = 0x02,
-    ewcol_Temporary = 0x04
-};
-
-/* use ewcol_Ignore to skip optional column when cursor is created */
-typedef struct TableWriterColumn_struct {
-    uint32_t idx;
-    const char* name;
-    bitsz_t element_bits;
-    uint32_t flags;
-} TableWriterColumn;
-
-typedef struct TableWriter TableWriter;
-
-rc_t CC TableWriter_Make(const TableWriter** cself, VDatabase *db, const char* table, const char* table_path /* NULL */);
-
-rc_t CC TableWriter_MakeMgr(const TableWriter** cself, VDBManager* mgr, const char* schema_path, const char* type, const char* table_path);
-
-rc_t CC TableWriter_MakeUpdate(const TableWriter** cself, VDatabase *db, const char* table);
-
-/* add scursor based on column list */
-rc_t CC TableWriter_AddCursor(const TableWriter* cself, TableWriterColumn* cols, uint32_t col_qty, uint8_t* cursor_id);
-
-rc_t CC TableWriter_GetVTable(const TableWriter* cself, VTable** vtbl);
-
-rc_t CC TableWriter_Sign(const TableWriter *const cself,
-                         const char loader_name[],
-                         const ver_t loader_version,
-                         const char loader_date[],
-                         const char app_name[],
-                         const ver_t app_version);
-
-/* optionally return internal vtbl still open but committed */
-rc_t CC TableWriter_Whack(const TableWriter* cself, bool commit, uint64_t* rows);
-
-/* commits and closes cursor_id, returns number of rows written in cursor, optionally */
-rc_t CC TableWriter_CloseCursor(const TableWriter* cself, uint8_t cursor_id, uint64_t* rows);
-
-/* flushes any pending writes into the table */
-rc_t CC TableWriter_Flush(const TableWriter *cself, const uint8_t cursor_id);
-
-/* CANNOT OPEN ROWS IN MULTIPLE CURSORS AT ONCE
-    Use sequence:
-    OpenRow
-    ColumnWrite - 0 (better set some defaults if not writing to a column!) or more times.
-    CloseRow
- */
-/* open a row for writing by cursor_id */
-rc_t CC TableWriter_OpenRow(const TableWriter* cself, int64_t* rowid, const uint8_t cursor_id);
-
-/* open a specific row for writing by cursor_id */
-rc_t CC TableWriter_OpenRowId(const TableWriter* cself, const int64_t rowid, const uint8_t cursor_id);
-
-/* return sequentially next rowid which will be created on OpenRow request */
-rc_t CC TableWriter_GetNextRowId(const TableWriter* cself, int64_t* rowid, const uint8_t cursor_id);
-
-/* writes cursor_id cursor default value to column
-   column pointer must use same object as passed into AddCursor
- */
-rc_t CC TableWriter_ColumnDefault(const TableWriter* cself, const uint8_t cursor_id,
-                                  const TableWriterColumn* column, const TableWriterData *data);
-
-/* writes value to column into cursor last passed to OpenRow*
-   column pointer must use same object as passed into AddCursor
- */
-rc_t CC TableWriter_ColumnWrite(const TableWriter* cself,
-                                const TableWriterColumn* column, const TableWriterData *data);
-
-/* closes row in cursor last used in OpenRow* */
-rc_t CC TableWriter_CloseRow(const TableWriter* cself);
-
-#define TW_COL_WRITE_DEF(writer, curs, col, data) \
-    if( rc == 0 ) { \
-        rc = TableWriter_ColumnDefault(writer, curs, &(col), &(data)); \
-    }
-
-#define TW_COL_WRITE_DEF_VAR(writer, curs, col, var) \
-    if( rc == 0 ) { \
-        TableWriterData dz; \
-        dz.buffer = &(var); \
-        dz.elements = 1; \
-        TW_COL_WRITE_DEF(writer, curs, col, dz); \
-    }
-
-#define TW_COL_WRITE_DEF_BUF(writer, curs, col, buf, elems) \
-    if( rc == 0 ) { \
-        TableWriterData dz; \
-        dz.buffer = buf; \
-        dz.elements = elems; \
-        TW_COL_WRITE_DEF(writer, curs, col, dz); \
-    }
-
-#define TW_COL_WRITE(writer, col, data) \
-    if( rc == 0 && (col).idx != 0) { \
-        rc = TableWriter_ColumnWrite(writer, &(col), &(data)); \
-    }
-
-#define TW_COL_WRITE_VAR(writer, col, var) \
-    if( rc == 0 && (col).idx != 0) { \
-        TableWriterData dz; \
-        dz.buffer = &(var); \
-        dz.elements = 1; \
-        TW_COL_WRITE(writer, col, dz); \
-    }
-
-#define TW_COL_WRITE_BUF(writer, col, buf, elems) \
-    if( rc == 0 && (col).idx != 0) { \
-        TableWriterData dz; \
-        dz.buffer = buf; \
-        dz.elements = elems; \
-        TW_COL_WRITE(writer, col, dz); \
-    }
-
-#endif /* _h_align_writer_priv_ */
diff --git a/libs/align/writer-ref.c b/libs/align/writer-ref.c
deleted file mode 100644
index d4d04a9..0000000
--- a/libs/align/writer-ref.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <insdc/insdc.h>
-#include <vdb/table.h>
-#include <align/writer-refseq.h>
-#include "writer-ref.h"
-#include "writer-priv.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-static const TableWriterColumn TableWriterRefData_cols[ewrefd_cn_Last + 1] =
-{
-    /* order is important, see enum in .h !!! */
-    {0, "MAX_SEQ_LEN", sizeof(uint32_t) * 8, 0},
-    {0, "NAME", sizeof(char) * 8, ewcol_IsArray},
-    {0, "(INSDC:dna:text)CS_KEY", sizeof(char) * 8, 0},
-    {0, "(INSDC:dna:text)CMP_READ", sizeof(char) * 8, ewcol_IsArray},
-    {0, "QUALITY", sizeof(INSDC_quality_phred) * 8, ewcol_IsArray},
-    {0, "SEQ_ID", sizeof(char) * 8, ewcol_IsArray},
-    {0, "SEQ_START", sizeof(INSDC_coord_one) * 8, 0},
-    {0, "SEQ_LEN", sizeof(INSDC_coord_len) * 8, 0},
-    {0, "CIRCULAR", sizeof(bool) * 8, 0}
-};
-
-static const TableWriterColumn TableWriterRefCoverage_cols[ewrefcv_cn_Last + 1] =
-{
-    /* order is important, see enum in .h !!! */
-    {0, "CGRAPH_HIGH", sizeof(uint8_t) * 8, 0},
-    {0, "CGRAPH_LOW", sizeof(uint8_t) * 8, 0},
-    {0, "CGRAPH_MISMATCHES", sizeof(uint32_t) * 8, 0},
-    {0, "CGRAPH_INDELS", sizeof(uint32_t) * 8, 0},
-    {0, "OVERLAP_REF_POS", sizeof(INSDC_coord_zero) * 8, ewcol_IsArray},
-    {0, "OVERLAP_REF_LEN", sizeof(INSDC_coord_len) * 8, ewcol_IsArray},
-    {0, "PRIMARY_ALIGNMENT_IDS", sizeof(int64_t) * 8, ewcol_IsArray},
-    {0, "SECONDARY_ALIGNMENT_IDS", sizeof(int64_t) * 8, ewcol_IsArray},
-    {0, "EVIDENCE_INTERVAL_IDS", sizeof(int64_t) * 8, ewcol_IsArray}
-};
-
-struct TableWriterRef {
-    uint32_t options;
-    const TableWriter* base;
-    uint8_t cursor_id;
-    TableWriterColumn cols_data[sizeof(TableWriterRefData_cols)/sizeof(TableWriterRefData_cols[0])];
-    uint8_t coverage_cursor_id;
-    TableWriterColumn cols_coverage[sizeof(TableWriterRefCoverage_cols)/sizeof(TableWriterRefCoverage_cols[0])];
-    INSDC_coord_one seq_start_last;
-    uint32_t max_seq_len;
-    char last_cs_key;
-    uint64_t last_seq_id_len;
-    char last_seq_id[2048];
-    int64_t last_coverage_row;
-};
-
-rc_t CC TableWriterRef_Make(const TableWriterRef** cself, VDatabase* db, const uint32_t options)
-{
-    rc_t rc = 0;
-    TableWriterRef* self = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            memcpy(self->cols_data, TableWriterRefData_cols, sizeof(TableWriterRefData_cols));
-            memcpy(self->cols_coverage, TableWriterRefCoverage_cols, sizeof(TableWriterRefCoverage_cols));
-            if( !(options & ewref_co_QUALITY) ) {
-                self->cols_data[ewrefd_cn_QUALITY].flags |= ewcol_Ignore;
-            }
-            if( (rc = TableWriter_Make(&self->base, db, "REFERENCE", NULL)) == 0 &&
-                (rc = TableWriter_AddCursor(self->base, self->cols_data,
-                            sizeof(self->cols_data) / sizeof(self->cols_data[0]), &self->cursor_id)) == 0 ) {
-                self->options = options;
-            }
-            if( rc == 0 && (options & ewref_co_Coverage) ) {
-                rc = TableWriter_AddCursor(self->base, self->cols_coverage,
-                    sizeof(self->cols_coverage) / sizeof(self->cols_coverage[0]), &self->coverage_cursor_id);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        ALIGN_DBG("table %s", "created");
-    } else {
-        TableWriterRef_Whack(self, false, NULL);
-        ALIGN_DBGERR(rc);
-    }
-    return rc;
-}
-
-static
-rc_t TableWriterRef_DefaultCoverage(const TableWriterRef* cself, int64_t rowid)
-{
-    rc_t rc = 0;
-    int64_t i;
-    ReferenceSeqCoverage c;
-
-    memset(&c, 0, sizeof(c));
-    for(i = cself->last_coverage_row + 1; rc == 0 && i < rowid; i++) {
-        rc = TableWriterRef_WriteCoverage(cself, i, 0, &c);
-    }
-    return rc;
-}
-
-rc_t CC TableWriterRef_Whack(const TableWriterRef* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        TableWriterRef* self = (TableWriterRef*)cself;
-
-        if( commit && (cself->options & ewref_co_Coverage) ) {
-            int64_t next_row;
-            if( (rc = TableWriter_GetNextRowId(cself->base, &next_row, 0)) == 0 ) {
-                if( (next_row - 1) > cself->last_coverage_row ) {
-                    ALIGN_DBG("adding default coverage to tail of table (%li,%li]", cself->last_coverage_row, next_row);
-                    rc = TableWriterRef_DefaultCoverage(cself, next_row);
-                }
-            }
-        }
-        if( rc == 0 ) {
-            rc = TableWriter_Whack(cself->base, commit, rows);
-        }
-        free(self);
-    }
-    return rc;
-}
-
-static
-rc_t TableWriterRef_WriteDefaults(const TableWriterRef* cself)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        TableWriterRef* self = (TableWriterRef*)cself;
-        self->max_seq_len = TableWriterRefSeq_MAX_SEQ_LEN;
-        self->seq_start_last = 1;
-        self->last_cs_key = 'T';
-        self->last_seq_id_len = 0;
-        TW_COL_WRITE_DEF_VAR(self->base, cself->cursor_id, self->cols_data[ewrefd_cn_MAX_SEQ_LEN], self->max_seq_len);
-        if( rc == 0 && (cself->options & ewref_co_Coverage) ) {
-            ReferenceSeqCoverage c;
-
-            memset(&c, 0, sizeof(c));
-            TW_COL_WRITE_DEF_VAR(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_CGRAPH_HIGH], c.low);
-            TW_COL_WRITE_DEF_VAR(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_CGRAPH_LOW], c.high);
-            TW_COL_WRITE_DEF_VAR(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_CGRAPH_MISMATCHES], c.mismatches);
-            TW_COL_WRITE_DEF_VAR(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_CGRAPH_INDELS], c.indels);
-            TW_COL_WRITE_DEF_BUF(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_OVERLAP_REF_POS],
-                    c.overlap_ref_pos, sizeof(c.overlap_ref_pos) / sizeof(c.overlap_ref_pos[0]));
-            TW_COL_WRITE_DEF_BUF(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_OVERLAP_REF_LEN],
-                    c.overlap_ref_len, sizeof(c.overlap_ref_len) / sizeof(c.overlap_ref_len[0]));
-            TW_COL_WRITE_DEF(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_PRIMARY_ALIGNMENT_IDS], c.ids[ewrefcov_primary_table]);
-            TW_COL_WRITE_DEF(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_SECONDARY_ALIGNMENT_IDS], c.ids[ewrefcov_secondary_table]);
-            TW_COL_WRITE_DEF(self->base, self->coverage_cursor_id, self->cols_coverage[ewrefcv_cn_EVIDENCE_INTERVAL_IDS], c.ids[ewrefcov_evidence_table]);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriterRef_WriteDefaultData(const TableWriterRef* cself, enum ETableWriterRefData_ColNames col,
-                                        const TableWriterData* data)
-{
-    rc_t rc = 0;
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRef_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else {
-        TW_COL_WRITE_DEF(cself->base, cself->cursor_id, cself->cols_data[col], (*data));
-        if( col == ewrefd_cn_MAX_SEQ_LEN ) {
-            ((TableWriterRef*)cself)->max_seq_len = *((uint32_t*)data->buffer);
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriterRef_WriteDefaultCovarage(const TableWriterRef* cself, enum ETableWriterRefCoverage_ColNames col,
-                                            const TableWriterData* data)
-{
-    rc_t rc = 0;
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRef_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else {
-        TW_COL_WRITE_DEF(cself->base, cself->coverage_cursor_id, cself->cols_coverage[col], (*data));
-    }
-    return rc;
-}
-
-rc_t CC TableWriterRef_Write(const TableWriterRef* cself, const TableWriterRefData* data, int64_t* rowid)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRef_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else if( data->read.elements > cself->max_seq_len ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInvalid);
-        ALIGN_DBGERRP("%s is longer than %s", rc, cself->cols_data[ewrefd_cn_READ].name, cself->cols_data[ewrefd_cn_MAX_SEQ_LEN].name);
-    } else if( data->seq_id.elements > sizeof(cself->last_seq_id) ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcBuffer, rcInsufficient);
-        ALIGN_DBGERRP("%s is longer than %s", rc, cself->cols_data[ewrefd_cn_READ].name, cself->cols_data[ewrefd_cn_MAX_SEQ_LEN].name);
-    } else if( (rc = TableWriter_OpenRow(cself->base, rowid, cself->cursor_id)) == 0 ) {
-        const INSDC_dna_text* b = data->read.buffer;
-        INSDC_coord_len const len = data->read.elements;
-        bool write_read = data->seq_id.elements < 1 || data->force_READ_write;
-        INSDC_coord_len trim_len = len;
-        
-        if( cself->last_seq_id_len != data->seq_id.elements ||
-            strncmp(cself->last_seq_id, data->seq_id.buffer, cself->last_seq_id_len) != 0 ) {
-            /* new seq_id: reset counters and mem it */
-            TableWriterRef* self = (TableWriterRef*)cself;
-            self->last_seq_id_len = data->seq_id.elements;
-            memcpy(self->last_seq_id, data->seq_id.buffer, cself->last_seq_id_len);
-            self->seq_start_last = 1;
-            self->last_cs_key = 'T';
-        }
-        /* trunc trailing N */
-        b += len - 1;
-        while( trim_len > 0 && (*b == 'N' || *b == 'n' || *b == '.') ) {
-            trim_len--; b--;
-        }
-        TW_COL_WRITE(cself->base, cself->cols_data[ewrefd_cn_NAME], data->name);
-        TW_COL_WRITE_BUF(cself->base, cself->cols_data[ewrefd_cn_READ], data->read.buffer, (write_read ? trim_len : 0));
-        TW_COL_WRITE(cself->base, cself->cols_data[ewrefd_cn_QUALITY], data->quality);
-        TW_COL_WRITE(cself->base, cself->cols_data[ewrefd_cn_SEQ_ID], data->seq_id);
-        if( trim_len == 0 ) {
-            TW_COL_WRITE_VAR(cself->base, cself->cols_data[ewrefd_cn_SEQ_START], trim_len);
-        } else {
-            TW_COL_WRITE_VAR(cself->base, cself->cols_data[ewrefd_cn_SEQ_START], cself->seq_start_last);
-        }
-        TW_COL_WRITE_VAR(cself->base, cself->cols_data[ewrefd_cn_SEQ_LEN], len);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_data[ewrefd_cn_CS_KEY], cself->last_cs_key);
-        TW_COL_WRITE_VAR(cself->base, cself->cols_data[ewrefd_cn_CIRCULAR], data->circular);
-        if( rc == 0 && (rc = TableWriter_CloseRow(cself->base)) == 0 ) {
-            TableWriterRef* self = (TableWriterRef*)cself;
-            
-            self->last_cs_key = ((const char*)(data->read.buffer))[data->read.elements - 1];
-            switch (self->last_cs_key) {
-            case 'A':
-            case 'C':
-            case 'G':
-            case 'T':
-                break;
-            default:
-                self->last_cs_key = 'T';
-                break;
-            }
-            self->seq_start_last += data->read.elements;
-        }
-    }
-    return rc;
-}
-
-rc_t CC TableWriterRef_WriteCoverage(const TableWriterRef* cself, int64_t rowid, INSDC_coord_zero offset, const ReferenceSeqCoverage* coverage)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || coverage == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRef_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else if( !(cself->options & ewref_co_Coverage) ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcUnexpected);
-        ALIGN_DBGERRP("coverage %s", rc, "data");
-    } else if( offset > cself->seq_start_last ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInvalid);
-        ALIGN_DBGERRP("%i is beyond last written chunk", rc, offset);
-    } else {
-        if( (rowid + offset / cself->max_seq_len) - cself->last_coverage_row > 1 ) {
-            /* fill in gap in coverage rows with default values */
-            ALIGN_DBG("gap in coverage rows (%li,%li) -> use defaults", cself->last_coverage_row, rowid + offset / cself->max_seq_len);
-            rc = TableWriterRef_DefaultCoverage(cself, rowid + offset / cself->max_seq_len);
-        }
-        if( rc == 0 && (rc = TableWriter_OpenRowId(cself->base, rowid + offset / cself->max_seq_len, cself->coverage_cursor_id)) == 0 ) {
-            TW_COL_WRITE_VAR(cself->base, cself->cols_coverage[ewrefcv_cn_CGRAPH_HIGH], coverage->high);
-            TW_COL_WRITE_VAR(cself->base, cself->cols_coverage[ewrefcv_cn_CGRAPH_LOW], coverage->low);
-            TW_COL_WRITE_VAR(cself->base, cself->cols_coverage[ewrefcv_cn_CGRAPH_MISMATCHES], coverage->mismatches);
-            TW_COL_WRITE_VAR(cself->base, cself->cols_coverage[ewrefcv_cn_CGRAPH_INDELS], coverage->indels);
-            TW_COL_WRITE_BUF(cself->base, cself->cols_coverage[ewrefcv_cn_OVERLAP_REF_POS],
-                    coverage->overlap_ref_pos, sizeof(coverage->overlap_ref_pos) / sizeof(coverage->overlap_ref_pos[0]));
-            TW_COL_WRITE_BUF(cself->base, cself->cols_coverage[ewrefcv_cn_OVERLAP_REF_LEN],
-                    coverage->overlap_ref_len, sizeof(coverage->overlap_ref_len) / sizeof(coverage->overlap_ref_len[0]));
-            TW_COL_WRITE(cself->base, cself->cols_coverage[ewrefcv_cn_PRIMARY_ALIGNMENT_IDS], coverage->ids[ewrefcov_primary_table]);
-            TW_COL_WRITE(cself->base, cself->cols_coverage[ewrefcv_cn_SECONDARY_ALIGNMENT_IDS], coverage->ids[ewrefcov_secondary_table]);
-            TW_COL_WRITE(cself->base, cself->cols_coverage[ewrefcv_cn_EVIDENCE_INTERVAL_IDS], coverage->ids[ewrefcov_evidence_table]);
-            if( rc == 0 ) {
-                TableWriterRef* self = (TableWriterRef*)cself;
-                self->last_coverage_row = rowid + offset / cself->max_seq_len;
-                rc = TableWriter_CloseRow(cself->base);
-            }
-        }
-    }
-    return rc;
-}
-
-struct TableWriterRefCoverage {
-    const TableWriter* base;
-    bool init; /* default written indicator */
-    uint8_t cursor_id;
-    TableWriterColumn cols[ewrefcv_cn_ReCover + 1];
-};
-
-rc_t CC TableWriterRefCoverage_MakeCoverage(const TableWriterRefCoverage** cself, VDatabase* db, const uint32_t options)
-{
-    rc_t rc = 0;
-    TableWriterRefCoverage* self = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            memcpy(self->cols, TableWriterRefCoverage_cols, sizeof(self->cols));
-            if( (rc = TableWriter_MakeUpdate(&self->base, db, "REFERENCE")) == 0 ) {
-                rc = TableWriter_AddCursor(self->base, self->cols,
-                        sizeof(self->cols) / sizeof(self->cols[0]), &self->cursor_id);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        ALIGN_R_DBG("table %s", "opened");
-    } else {
-        TableWriterRefCoverage_Whack(self, false, NULL);
-        ALIGN_DBGERR(rc);
-    }
-    return rc;
-}
-rc_t CC TableWriterRefCoverage_MakeIds(const TableWriterRefCoverage** cself, VDatabase* db, const char  * col_name)
-{
-    rc_t rc = 0;
-    TableWriterRefCoverage* self = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            if( (rc = TableWriter_MakeUpdate(&self->base, db, "REFERENCE")) == 0 ) {
-                self->cols[0].idx = 0;
-                self->cols[0].name = col_name;
-                self->cols[0].element_bits = 8 * sizeof(int64_t);
-                self->cols[0].flags=ewcol_IsArray;
-                rc = TableWriter_AddCursor(self->base, self->cols,1, &self->cursor_id);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        ALIGN_R_DBG("table %s", "opened");
-    } else {
-        TableWriterRefCoverage_Whack(self, false, NULL);
-        ALIGN_DBGERR(rc);
-    }
-    return rc;
-}
-
-
-rc_t CC TableWriterRefCoverage_Whack(const TableWriterRefCoverage* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        TableWriterRefCoverage* self = (TableWriterRefCoverage*)cself;
-        rc = TableWriter_Whack(cself->base, commit, rows);
-        free(self);
-    }
-    return rc;
-}
-
-
-rc_t CC TableWriterRefCoverage_WriteCoverage(const TableWriterRefCoverage* cself, int64_t rowid, const ReferenceSeqCoverage* coverage)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || coverage == NULL ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    }
-    else {
-        if( !cself->init ) {
-            /* set the defaults */
-            ReferenceSeqCoverage c;
-            
-            memset(&c, 0, sizeof(c));
-            TW_COL_WRITE_DEF_VAR(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_CGRAPH_HIGH], c.low);
-            TW_COL_WRITE_DEF_VAR(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_CGRAPH_LOW], c.high);
-            TW_COL_WRITE_DEF_VAR(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_CGRAPH_MISMATCHES], c.mismatches);
-            TW_COL_WRITE_DEF_VAR(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_CGRAPH_INDELS], c.indels);
-            TW_COL_WRITE_DEF_BUF(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_OVERLAP_REF_POS],
-                                 c.overlap_ref_pos, sizeof(c.overlap_ref_pos) / sizeof(c.overlap_ref_pos[0]));
-            TW_COL_WRITE_DEF_BUF(cself->base, cself->cursor_id, cself->cols[ewrefcv_cn_OVERLAP_REF_LEN],
-                                 c.overlap_ref_len, sizeof(c.overlap_ref_len) / sizeof(c.overlap_ref_len[0]));
-            
-            ((TableWriterRefCoverage*)cself)->init = true;
-        }
-        if( rc == 0 && (rc = TableWriter_OpenRowId(cself->base, rowid, cself->cursor_id)) == 0 ) {
-            TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefcv_cn_CGRAPH_HIGH], coverage->high);
-            TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefcv_cn_CGRAPH_LOW], coverage->low);
-            TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefcv_cn_CGRAPH_MISMATCHES], coverage->mismatches);
-            TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefcv_cn_CGRAPH_INDELS], coverage->indels);
-            TW_COL_WRITE_BUF(cself->base, cself->cols[ewrefcv_cn_OVERLAP_REF_POS],
-                             coverage->overlap_ref_pos, sizeof(coverage->overlap_ref_pos) / sizeof(coverage->overlap_ref_pos[0]));
-            TW_COL_WRITE_BUF(cself->base, cself->cols[ewrefcv_cn_OVERLAP_REF_LEN],
-                             coverage->overlap_ref_len, sizeof(coverage->overlap_ref_len) / sizeof(coverage->overlap_ref_len[0]));
-            
-            if( rc == 0 ) {
-                rc = TableWriter_CloseRow(cself->base);
-            }
-        }
-    }
-    return rc;
-}
-rc_t CC TableWriterRefCoverage_WriteIds(const TableWriterRefCoverage* cself, int64_t rowid, const int64_t* buf,uint32_t num)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || (buf  == NULL && num > 0)) {
-        rc = RC(rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    }
-    else {
-        if( !cself->init ) {
-            /* set the defaults */
-            TW_COL_WRITE_DEF_BUF(cself->base, cself->cursor_id, cself->cols[0],NULL,0);
-            ((TableWriterRefCoverage*)cself)->init = true;
-        }
-        if( rc == 0 && (rc = TableWriter_OpenRowId(cself->base, rowid, cself->cursor_id)) == 0 ) {
-            TW_COL_WRITE_BUF(cself->base, cself->cols[0],buf,num);
-            if( rc == 0 ) {
-                rc = TableWriter_CloseRow(cself->base);
-            }
-        }
-    }
-    return rc;
-}
-
diff --git a/libs/align/writer-ref.h b/libs/align/writer-ref.h
deleted file mode 100644
index e059a0b..0000000
--- a/libs/align/writer-ref.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_align_writer_ref_
-#define _h_align_writer_ref_
-
-#include <vdb/database.h>
-#include <align/writer-alignment.h>
-#include <align/writer-reference.h>
-
-enum ETableWriterRefData_ColNames {
-    ewrefd_cn_MAX_SEQ_LEN, /* static/default value from refseq writer */
-    ewrefd_cn_NAME,
-    ewrefd_cn_CS_KEY, /* handled by writer */
-    ewrefd_cn_READ,
-    ewrefd_cn_QUALITY,
-    ewrefd_cn_SEQ_ID,
-    ewrefd_cn_SEQ_START, /* calculated on fly by writer */
-    ewrefd_cn_SEQ_LEN, /* calculated on fly by writer */
-    ewrefd_cn_CIRCULAR, 
-    ewrefd_cn_Last = ewrefd_cn_CIRCULAR
-};
-
-enum ETableWriterRefCoverage_ColNames {
-    /* coverage data starts here */
-    ewrefcv_cn_CGRAPH_HIGH=0,
-    ewrefcv_cn_CGRAPH_LOW,
-    ewrefcv_cn_CGRAPH_MISMATCHES,
-    ewrefcv_cn_CGRAPH_INDELS,
-    ewrefcv_cn_OVERLAP_REF_POS,
-    ewrefcv_cn_OVERLAP_REF_LEN,
-    ewrefcv_cn_ReCover = ewrefcv_cn_OVERLAP_REF_LEN,
-    ewrefcv_cn_PRIMARY_ALIGNMENT_IDS,
-    ewrefcv_cn_SECONDARY_ALIGNMENT_IDS,
-    ewrefcv_cn_EVIDENCE_INTERVAL_IDS,
-    ewrefcv_cn_Last = ewrefcv_cn_EVIDENCE_INTERVAL_IDS
-};
-
-enum ETableWriterRef_ColOptions {
-    ewref_co_SaveRead = 0x01, /* always write READ */
-    ewref_co_QUALITY = 0x02,  /* use QUALITY column, by default not opened */
-    ewref_co_Coverage = 0x04  /* use coverage columns, by default not opened */
-};
-
-typedef struct TableWriterRefData_struct {
-    TableWriterData name;
-    bool force_READ_write;
-    TableWriterData read;
-    TableWriterData quality;
-    TableWriterData seq_id;
-    bool circular;
-} TableWriterRefData;
-
-typedef struct TableWriterRef TableWriterRef;
-
-rc_t CC TableWriterRef_Make(const TableWriterRef** cself, VDatabase* db, const uint32_t options);
-
-/* rows optional here */
-rc_t CC TableWriterRef_Whack(const TableWriterRef* cself, bool commit, uint64_t* rows);
-
-rc_t CC TableWriterRef_WriteDefaultData(const TableWriterRef* cself, enum ETableWriterRefData_ColNames col,
-                                        const TableWriterData* data);
-
-rc_t CC TableWriterRef_WriteDefaultCovarage(const TableWriterRef* cself, enum ETableWriterRefCoverage_ColNames col,
-                                            const TableWriterData* data);
-
-/* rowid optional here */
-rc_t CC TableWriterRef_Write(const TableWriterRef* cself, const TableWriterRefData* data, int64_t* rowid);
-
-rc_t CC TableWriterRef_WriteCoverage(const TableWriterRef* cself, int64_t rowid, INSDC_coord_zero offset, const ReferenceSeqCoverage* coverage);
-
-
-
-
-typedef struct TableWriterRefCoverage TableWriterRefCoverage;
-
-rc_t CC TableWriterRefCoverage_MakeCoverage(const TableWriterRefCoverage** cself, VDatabase* db, const uint32_t options);
-rc_t CC TableWriterRefCoverage_MakeIds(const TableWriterRefCoverage** cself, VDatabase* db, const char *col_name);
-/* rows optional here */
-rc_t CC TableWriterRefCoverage_Whack(const TableWriterRefCoverage* cself, bool commit, uint64_t* rows);
-rc_t CC TableWriterRefCoverage_WriteCoverage(const TableWriterRefCoverage* cself, int64_t rowid, const ReferenceSeqCoverage* coverage);
-rc_t CC TableWriterRefCoverage_WriteIds(const TableWriterRefCoverage* cself, int64_t rowid, const int64_t* buf,uint32_t num);
-
-#endif /* _h_align_writer_ref_ */
diff --git a/libs/align/writer-reference.c b/libs/align/writer-reference.c
deleted file mode 100644
index cccfa14..0000000
--- a/libs/align/writer-reference.c
+++ /dev/null
@@ -1,2592 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <align/extern.h>
-
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/sort.h>
-#include <klib/data-buffer.h>
-#include <klib/container.h>
-#include <klib/checksum.h>
-#include <klib/text.h>
-#include <kfs/mmap.h>
-#include <kfs/file.h>
-#include <kdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/manager.h>
-#include <vdb/vdb-priv.h>
-#include <sra/sradb.h>
-
-#include <align/writer-reference.h>
-#include <align/writer-refseq.h>
-#include <align/refseq-mgr.h>
-#include "refseq-mgr-priv.h"
-#include "writer-ref.h"
-#include "reader-cmn.h"
-#include "reference-cmn.h"
-#include "debug.h"
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-/*
- * ReferenceSeq objects:
- *  ReferenceSeq objects may be unattached, i.e. they might not yet represent an
- *  actual sequence.
- *
- *  ReferenceSeq objects may be attached, i.e. they represent a sequence from
- *  either RefSeq or a fasta file.
- *
- *  A ReferenceSeq object may be refered to by more than one id, but a
- *  ReferenceSeq object has only one canonical id.
- *
- *  More than one ReferenceSeq object may be associated with the same seqId.
- *
- *  More than one ReferenceSeq object may be attached to the same sequence.
- *  This will cause the REFERENCE table to have more than one copy of the
- *  sequence.
- *
- *  ReferenceSeq objects may be created from the config file.  These objects
- *  will have an id, a seqId, but no fastaSeqId.  These are unattached.
- *
- *  ReferenceSeq objects may be created from explicit fasta files.  These
- *  objects will have a fastaSeqId, but *** NO id OR seqId ***. These are
- *  attached.
- *
- *  ReferenceSeq objects may be created on the fly by requesting an id that
- *  isn't already in the collection.  These objects will have the requested id.
- *
- * When a reference is requested (by id):
- *  Resolve the id to a ReferenceSeq object.
- *  If the object is unattached, attach it to a sequence.
- *  If the sequence is not yet written to the REFERENCE table, write it to the
- *  REFERENCE table.  NAME gets id; SEQID gets seqId unless seqId is null, then
- *  SEQID gets id.
- *
- * Resolving id's to ReferenceSeq objects:
- *  Search the id index and if the found object is attached, return it.
- *  Search the identifiers in the fastaSeqIds or seqIds.
- *  If different objects were found from both searches, use sequence length and
- *  MD5 to break the tie (if both match then use RefSeq).  If no sequence length
- *  or MD5 then fail.
- *  If no objects were found from either search, then create a new unattached
- *  ReferenceSeq object.
- *  If the object's id is null, set it to the id.
- *  It the object was not found in the id index, add it.
- *
- * Attaching ReferenceSeq objects to sequences:
- *  Search RefSeq for seqId.
- *  Else search RefSeq for id.
- *  Else search for seqId in the loaded fasta files.
- *  Else search data directory for id.fasta or id.fa; load it or fail.
- *  Else search data directory for seqId.fasta or seqId.fa; load it or fail.
- *  Else fail.
- *  If failed, mark the object as dead.
- *
- *
- *
- * Config file:
- *  The config file consists of lines containing whitespace (preferably tab)
- *  seperated fields.  The fields are:
- *      NAME (unique)
- *      SEQID
- *      extra (optional)
- *
- *  There is one ReferenceSeq object created per record in the config file.
- *  NAME is stored in id; SEQID is stored in seqId; if extra contains the word
- *  'circular' (case-insensitive), true is stored in circular.  These
- *  ReferenceSeq object are created in the unattached state, i.e. not attached
- *  to a fasta file or a RefSeq library object.
- *
- * Fasta files:
- *  Fasta file consists of one of more sequences.  A sequence in a fasta file
- *  consists of a seqid line followed by lines containing the bases of the
- *  sequence.  A seqid line starts with '>' and the next word (whitespace
- *  delimited) is the seqid.  The seqid may consist of '|' delimited identifiers
- *  (this is purposely vague).  The fasta seqid is stored in fastaSeqId.
- *
- * Fasta files may be loaded explicitly:
- *  When a fasta file is loaded explicitly, a new ReferenceSeq object is created
- *  (with id == NULL) for each sequence found in the file.
- *
- * Fasta files may be loaded implicitly:
- *  When an id can't be found in the set of ReferenceSeq objects and can't be
- *  found as an accession by RefSeq, an attempt is made to load a fasta file
- *  named <id>.fasta or <id>.fa in the directory given to the constructor.  If
- *  this succeeds, a new ReferenceSeq object with the given id is attached to
- *  the sequence.  In this situation, to avoid ambiquity, there can be only one
- *  sequence in the fasta file.
- *
- */
-
-enum ReferenceSeqType {
-    rst_unattached,
-    rst_local,
-    rst_refSeqById,
-    rst_refSeqBySeqId,
-    rst_dead
-};
-
-struct ReferenceSeq {
-    ReferenceMgr *mgr;
-    char *id;
-    char *seqId;
-    char *fastaSeqId;
-    /* ref table position */
-    int64_t start_rowid;
-    /* total reference length */
-    INSDC_coord_len seq_len;
-    int type;
-    bool circular;
-    uint8_t md5[16];
-    union {
-        struct {
-            KDataBuffer buf;
-            uint8_t const *data;
-        } local;
-        RefSeq const *refseq;
-    } u;
-};
-
-struct ReferenceMgr {
-    TableWriterRef const *writer;
-    KDirectory const *dir;
-    RefSeqMgr const *rmgr;
-    VDatabase *db;
-    ReferenceSeq *refSeq;
-    
-    int64_t ref_rowid;
-    
-    size_t cache;
-    
-    uint32_t options;
-    uint32_t num_open_max;
-    uint32_t num_open;
-    uint32_t max_seq_len;
-    
-    KDataBuffer compress;
-    KDataBuffer seq;
-    KDataBuffer refSeqs;
-    KDataBuffer refSeqsById;
-};
-
-typedef struct key_id_t {
-    char const *key;
-    int64_t id;
-} key_id_t;
-
-static
-int CC key_id_cmp(const void *arg1, const void *arg2, void *data)
-{
-    key_id_t const *a = arg1;
-    key_id_t const *b = arg2;
-    
-    return strcmp(a->key, b->key);
-}
-
-static
-void CC ReferenceSeq_Whack(ReferenceSeq *self)
-{
-    if (self->type == rst_local) {
-        KDataBufferWhack(&self->u.local.buf);
-    }
-    else if (self->type == rst_refSeqById || self->type == rst_refSeqBySeqId) {
-        RefSeq_Release(self->u.refseq);
-    }
-    free(self->id);
-    free(self->seqId);
-    free(self->fastaSeqId);
-}
-
-struct OpenConfigFile_ctx {
-    char const *name;
-    KDirectory const *dir;
-    KFile const **kfp;
-    rc_t rc;
-};
-
-static
-bool OpenConfigFile(char const server[], char const volume[], void *Ctx)
-{
-    struct OpenConfigFile_ctx *ctx = Ctx;
-    KDirectory const *dir;
-    
-    if( volume == NULL ) {
-        ctx->rc = KDirectoryOpenDirRead(ctx->dir, &dir, false, "%s", server);
-    } else {
-        ctx->rc = KDirectoryOpenDirRead(ctx->dir, &dir, false, "%s/%s", server, volume);
-    }
-    if (ctx->rc == 0) {
-        ctx->rc = KDirectoryOpenFileRead(dir, ctx->kfp, ctx->name);
-        KDirectoryRelease(dir);
-        if (ctx->rc == 0) {
-            return true;
-        }
-    }
-    return false;
-}
-
-static
-rc_t FindAndOpenConfigFile(RefSeqMgr const *const rmgr,
-                           KDirectory const *const dir,
-                           KFile const **const kfp, char const conf[])
-{
-    rc_t rc = KDirectoryOpenFileRead(dir, kfp, conf);
-    
-    if (rc) {
-        struct OpenConfigFile_ctx ctx;
-
-        ctx.name = conf;
-        ctx.dir = dir;
-        ctx.kfp = kfp;
-        ctx.rc = 0;
-        
-        rc = RefSeqMgr_ForEachVolume(rmgr, OpenConfigFile, &ctx);
-        if (rc == 0 && *kfp == NULL) {
-            rc = RC(rcAlign, rcIndex, rcConstructing, rcFile, rcNotFound);
-        }
-    }
-    return rc;
-}
-
-enum comparison_weights {
-    no_match        = 0,
-    substring_match = (1u << 0),
-    expected_prefix = (1u << 1),
-    exact_match     = (1u << 2),
-    seq_len_match   = (1u << 3),
-    md5_match       = (1u << 4)
-};
-
-static
-unsigned str_weight(char const str[], char const qry[], unsigned const qry_len)
-{
-    char const *const fnd = strcasestr(str, qry);
-    unsigned wt = no_match;
-    
-    if (fnd) {
-        unsigned const fnd_len = string_size( fnd );
-        unsigned const fndlen = (fnd_len > qry_len && fnd[qry_len] == '|') ? qry_len : fnd_len;
-        
-        if (fndlen == qry_len && (fnd == str || fnd[-1] == '|')) {
-            wt |= substring_match;
-            
-            if (fnd == str) {
-                if (fnd[fndlen] == '\0')
-                    wt |= exact_match;
-            }
-            else {
-                /* check for expected prefices */
-                char const *ns = fnd - 1;
-                
-                while (ns != str && ns[-1] != '|')
-                    --ns;
-                
-                if (   memcmp(ns, "ref|", 4) == 0
-                    || memcmp(ns, "emb|", 4) == 0
-                    || memcmp(ns, "dbg|", 4) == 0
-                    || memcmp(ns, "tpg|", 4) == 0
-                    || memcmp(ns, "tpe|", 4) == 0
-                    || memcmp(ns, "tpd|", 4) == 0
-                    || memcmp(ns, "gpp|", 4) == 0
-                    || memcmp(ns,  "gb|", 3) == 0
-                    )
-                {
-                    wt |= expected_prefix;
-                }
-            }
-        }
-    }
-    return wt;
-}
-
-static
-rc_t ReferenceMgr_AddId(ReferenceMgr *const self, char const ID[],
-                        ReferenceSeq const *const obj)
-{
-    char *id = string_dup( ID, string_size( ID ) );
-    unsigned const last_id = self->refSeqsById.elem_count;
-    
-    if (id) {
-        rc_t rc = KDataBufferResize(&self->refSeqsById, last_id + 1);
-        
-        if (rc == 0) {
-            key_id_t *kid = &((key_id_t *)self->refSeqsById.base)[last_id];
-            
-            kid->key = id;
-            kid->id = obj - self->refSeq;
-            
-            ksort(self->refSeqsById.base, self->refSeqsById.elem_count, sizeof(key_id_t), key_id_cmp, NULL);
-        }
-        else
-            free(id);
-        
-        return rc;
-    }
-    else
-        return RC(rcAlign, rcIndex, rcInserting, rcMemory, rcExhausted);
-}
-
-static
-key_id_t *ReferenceMgr_FindId(ReferenceMgr const *const self, char const id[])
-{
-    key_id_t qry;
-    
-    qry.key = id;
-    qry.id = 0;
-    
-    return kbsearch(&qry, self->refSeqsById.base,
-                    self->refSeqsById.elem_count,
-                    sizeof(qry), key_id_cmp, NULL);
-}
-
-static
-rc_t ReferenceMgr_NewReferenceSeq(ReferenceMgr *const self, ReferenceSeq **const rslt)
-{
-    unsigned const last_rs = self->refSeqs.elem_count;
-    rc_t rc = KDataBufferResize(&self->refSeqs, last_rs + 1);
-    
-    if (rc) return rc;
-    self->refSeq = self->refSeqs.base;
-    
-    *rslt = &self->refSeq[last_rs];
-    memset(&self->refSeq[last_rs], 0, sizeof(self->refSeq[0]));
-    self->refSeq[last_rs].mgr = self;
-
-    return 0;
-}
-
-static
-int CC config_cmp(void const *A, void const *B, void *Data)
-{
-    struct {
-        unsigned id;
-        unsigned seqId;
-        unsigned extra;
-        unsigned extralen;
-    } const *const a = A;
-    struct {
-        unsigned id;
-        unsigned seqId;
-        unsigned extra;
-        unsigned extralen;
-    } const *const b = B;
-    char const *const data = Data;
-    
-    return strcmp(&data[a->id], &data[b->id]);
-}
-
-static
-rc_t ReferenceMgr_ProcessConf(ReferenceMgr *const self, char Data[], unsigned const len)
-{
-    rc_t rc;
-    unsigned i;
-    unsigned j;
-    struct {
-        unsigned id;
-        unsigned seqId;
-        unsigned extra;
-        unsigned extralen;
-    } *data, tmp;
-    KDataBuffer buf;
-    
-    memset(&buf, 0, sizeof(buf));
-    buf.elem_bits = sizeof(data[0]) * 8;
-    
-    for (j = i = 0; i < len; ++j) {
-        unsigned lineEnd;
-        unsigned id;
-        unsigned acc;
-        unsigned ii;
-        
-        for (lineEnd = i; lineEnd != len; ++lineEnd) {
-            int const ch = Data[lineEnd];
-            
-            if (ch == '\n')
-                break;
-            if (ch == '\r')
-                break;
-        }
-        if (i == lineEnd) {
-            ++i;
-            continue;
-        }
-        Data[lineEnd] = '\0';
-        for (id = i; id != lineEnd; ++id) {
-            int const ch = Data[id];
-            
-            if (!isspace(ch))
-                break;
-        }
-        for (ii = id; ii != lineEnd; ++ii) {
-            int const ch = Data[ii];
-            
-            if (isspace(ch)) {
-                Data[ii++] = '\0';
-                break;
-            }
-        }
-        for (acc = ii; acc < lineEnd; ++acc) {
-            int const ch = Data[acc];
-            
-            if (!isspace(ch))
-                break;
-        }
-        if (acc >= lineEnd)
-            return RC(rcAlign, rcFile, rcReading, rcFormat, rcInvalid);
-        
-        for (ii = acc; ii != lineEnd; ++ii) {
-            int const ch = Data[ii];
-            
-            if (isspace(ch)) {
-                Data[ii++] = '\0';
-                break;
-            }
-        }
-        tmp.id = id;
-        tmp.seqId = acc;
-        tmp.extra = ii;
-        tmp.extralen = lineEnd > ii ? lineEnd - ii : 0;
-        
-        if ((rc = KDataBufferResize(&buf, buf.elem_count + 1)) != 0) return rc;
-        data = buf.base;
-        
-        data[buf.elem_count-1] = tmp;
-        i = lineEnd + 1;
-    }
-    
-    /* check unique */
-    ksort(data, buf.elem_count, sizeof(data[0]), config_cmp, Data);
-    for (i = 1; i < buf.elem_count; ++i) {
-        if (strcmp(&Data[data[i-1].id], &Data[data[i].id]) == 0)
-            return RC(rcAlign, rcIndex, rcConstructing, rcItem, rcExists);
-    }
-
-    for (i = 0; i != buf.elem_count; ++i) {
-        unsigned const extralen = data[i].extralen;
-        char const *const id    = &Data[data[i].id];
-        char const *const seqId = &Data[data[i].seqId];
-        char const *const extra = extralen ? &Data[data[i].extra] : NULL;
-        bool circular = false;
-        ReferenceSeq *rs;
-        
-        if (extra && extralen >= 8) {
-            char const *const circ = strcasestr(extra, "circular");
-            
-            circular = circ && (circ == extra || isspace(circ[-1])) &&
-                       (circ[8] == '\0' || isspace(circ[8]));
-        }
-        if ((rc = ReferenceMgr_NewReferenceSeq(self, &rs)) != 0) return rc;
-        
-        rs->id = string_dup( id, string_size( id ) );
-        if ( rs->id == NULL )
-            return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-
-        rs->seqId = string_dup( seqId, string_size( seqId ) );
-        if ( rs->seqId == NULL )
-            return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-        
-        rs->circular = circular;
-    }
-    KDataBufferWhack(&buf);
-    return 0;
-}
-
-static
-rc_t ReferenceMgr_Conf(ReferenceMgr *const self, char const conf[])
-{
-    rc_t rc;
-    const KFile* kf = NULL;
-
-    if (conf == NULL)
-        return 0;
-    
-    rc = FindAndOpenConfigFile(self->rmgr, self->dir, &kf, conf);
-    if (rc == 0) {
-        uint64_t sz;
-        KDataBuffer buf;
-        
-        rc = KFileSize(kf, &sz);
-        assert(rc == 0);
-        if (sz == 0)
-            (void)PLOGMSG(klogWarn, (klogWarn, "Configuration file '$(file)' is empty", "file=%s", conf));
-        else {
-            rc = KDataBufferMakeBytes(&buf, sz + 1);
-            if (rc == 0) {
-                size_t nread;
-                
-                rc = KFileReadAll(kf, 0, buf.base, sz, &nread);
-                if (rc == 0) {
-                    assert(nread == sz);
-                    ((char *)buf.base)[sz] = '\n'; /* make sure that last line is terminated */
-                    rc = ReferenceMgr_ProcessConf(self, buf.base, sz + 1);
-                }
-                KDataBufferWhack(&buf);
-            }
-        }
-        KFileRelease(kf);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceMgr_FastaFile_GetSeqIds(KDataBuffer *const buf, char const data[], uint64_t const len)
-{
-    uint64_t pos;
-    int st = 0;
-    
-    for (pos = 0; pos < len; ++pos) {
-        int const ch = data[pos];
-        
-        if (st == 0) {
-            if (ch == '>') {
-                uint64_t const n = buf->elem_count;
-                rc_t rc = KDataBufferResize(buf, n + 1);
-                
-                if (rc)
-                    return rc;
-                ((uint64_t *)buf->base)[n] = pos;
-                st = 1;
-            }
-        }
-        else if (ch == '\r' || ch == '\n') 
-            st = 0;
-    }
-    return 0;
-}
-
-static
-rc_t ReferenceMgr_ImportFasta(ReferenceMgr *const self, ReferenceSeq *obj, KDataBuffer *const buf)
-{
-    unsigned seqId;
-    unsigned seqIdLen;
-    unsigned ln;
-    unsigned src;
-    unsigned dst;
-    unsigned start=0;
-    char *const data = buf->base;
-    unsigned const len = buf->elem_count;
-    rc_t rc;
-    MD5State mds;
-    
-    memset(obj, 0, sizeof(*obj));
-    obj->mgr = self;
-    
-    if (len == 0)
-        return 0;
-    assert(data[0] == '>');
-    
-    for (ln = 1; ln != len; ++ln) {
-        int const ch = data[ln];
-        
-        if (ch == '\r' || ch == '\n') {
-            data[ln] = '\0';
-            start = ln + 1;
-            break;
-        }
-    }
-    for (seqId = 1; seqId != ln; ++seqId) {
-        if (!isspace(data[seqId]))
-            break;
-    }
-    for (seqIdLen = 0; seqId + seqIdLen < ln; ++seqIdLen) {
-        if (isspace(data[seqId + seqIdLen])) {
-            ln = seqId + seqIdLen;
-            data[ln] = '\0';
-            break;
-        }
-    }
-    if (seqIdLen == 0)
-        return RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-    
-    obj->fastaSeqId = string_dup( &data[ seqId ], string_size( &data[ seqId ] ) );
-    if ( obj->fastaSeqId == NULL )
-        return RC(rcAlign, rcFile, rcReading, rcMemory, rcExhausted);
-    
-    MD5StateInit(&mds);
-    for (dst = src = start; src != len; ++src) {
-        int const ch = toupper(data[src]);
-        
-        if (isspace(ch))
-            continue;
-        
-        if (strchr(INSDC_4na_map_CHARSET, ch) == NULL && ch != 'X')
-            return RC(rcAlign, rcFile, rcReading, rcData, rcInvalid);
-        
-        data[dst] = ch == 'X' ? 'N' : ch;
-        MD5StateAppend(&mds, data + dst, 1);
-        ++dst;
-    }
-    MD5StateFinish(&mds, obj->md5);
-    rc = KDataBufferSub(buf, &obj->u.local.buf, start, dst - start);
-    if (rc == 0) {
-        obj->type = rst_local;
-        obj->seq_len = dst - start;
-    }
-    else
-        obj->type = rst_dead;
-    return rc;
-}
-
-#define READ_CHUNK_SIZE (1024 * 1024)
-
-static
-rc_t ReferenceMgr_ImportFastaFile(ReferenceMgr *const self, KFile const *kf,
-                                  ReferenceSeq *rslt)
-{
-    uint64_t file_size;
-    rc_t rc = KFileSize(kf, &file_size);
-    
-    if (rc == 0) {
-        KDataBuffer fbuf;
-        
-        rc = KDataBufferMake(&fbuf, 8, file_size);
-        if (rc == 0) {
-            fbuf.elem_count = 0;
-            do {
-                size_t const readable = file_size - fbuf.elem_count;
-                size_t const to_read = readable > READ_CHUNK_SIZE ? READ_CHUNK_SIZE : readable;
-                size_t nread = 0;
-                
-                rc = KFileRead(kf, fbuf.elem_count, &((uint8_t *)fbuf.base)[fbuf.elem_count], to_read, &nread);
-                if (rc != 0 || nread == 0)
-                    break;
-                fbuf.elem_count += nread;
-            } while (fbuf.elem_count < file_size);
-            if (rc == 0) {
-                char const *const base = fbuf.base;
-                KDataBuffer seqIdBuf;
-                
-                memset(&seqIdBuf, 0, sizeof(seqIdBuf));
-                seqIdBuf.elem_bits = sizeof(file_size) * 8;
-                
-                rc = ReferenceMgr_FastaFile_GetSeqIds(&seqIdBuf, base, file_size);
-                if (rc == 0) {
-                    uint64_t const *const seqIdOffset = seqIdBuf.base;
-                    unsigned const seqIds = seqIdBuf.elem_count;
-                    unsigned i;
-                    KDataBuffer sub;
-                    
-                    if (rslt) {
-                        if (seqIds > 1)
-                            rc = RC(rcAlign, rcFile, rcReading, rcItem, rcUnexpected);
-                        
-                        memset(&sub, 0, sizeof(sub));
-                        KDataBufferSub(&fbuf, &sub, seqIdOffset[0], file_size - seqIdOffset[0]);
-                        rc = ReferenceMgr_ImportFasta(self, rslt, &sub);
-                        KDataBufferWhack(&sub);
-                    }
-                    else
-                        for (i = 0; i != seqIds; ++i) {
-                            uint64_t const ofs = seqIdOffset[i];
-                            uint64_t const nxt = (i < seqIds - 1) ? seqIdOffset[i + 1] : file_size;
-                            uint64_t const len = nxt - ofs;
-                            ReferenceSeq tmp;
-                            ReferenceSeq *new_seq;
-                            
-                            memset(&sub, 0, sizeof(sub));
-                            KDataBufferSub(&fbuf, &sub, ofs, len);
-                            rc = ReferenceMgr_ImportFasta(self, &tmp, &sub);
-                            KDataBufferWhack(&sub);
-                            if (rc) break;
-                            
-                            rc = ReferenceMgr_NewReferenceSeq(self, &new_seq);
-                            if (rc) break;
-                            
-                            *new_seq = tmp;
-                        }
-                }
-                KDataBufferWhack(&seqIdBuf);
-            }
-            KDataBufferWhack(&fbuf);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t OpenFastaFile(KFile const **const kf,
-                   KDirectory const *const dir,
-                   char const base[],
-                   unsigned const len)
-{
-    char fname_a[4096];
-    char *fname_h = NULL;
-    char *fname = fname_a;
-    rc_t rc;
-    
-    if (len + 7 >= sizeof(fname_a)) {
-        fname_h = malloc(len + 7);
-        if (fname_h)
-            fname = fname_h;
-        else
-            return RC(rcAlign, rcFile, rcOpening, rcMemory, rcExhausted);
-    }
-    memcpy(fname, base, len);
-    memcpy(fname + len, ".fasta", 7);
-    
-    rc = KDirectoryOpenFileRead(dir, kf, fname);
-    if (rc) {
-        fname[len + 3] = '\0'; /* base.fasta -> base.fa */
-        
-        rc = KDirectoryOpenFileRead(dir, kf, fname);
-    }
-    free(fname_h);
-    return rc;
-}
-
-#if 1
-void ReferenceSeq_Dump(ReferenceSeq const *const rs, unsigned const i, key_id_t const *const key_id_array, unsigned const m)
-{
-    static char const *types[] = {
-        "'unattached'",
-        "'fasta'",
-        "'RefSeq-by-id'",
-        "'RefSeq-by-seqid'",
-        "'dead'"
-    };
-    unsigned j;
-    
-    ALIGN_CF_DBGF(("{ "));
-    ALIGN_CF_DBGF(("type: %s, ", (rs->type < 0 || rs->type > rst_dead) ? "null" : types[rs->type]));
-    
-    if (rs->id)
-        ALIGN_CF_DBGF(("id: '%s', ", rs->id));
-    else
-        ALIGN_CF_DBGF(("id: null, "));
-    
-    if (rs->seqId)
-        ALIGN_CF_DBGF(("seqId: '%s', ", rs->seqId));
-    else
-        ALIGN_CF_DBGF(("seqId: null, "));
-    
-    if (rs->fastaSeqId)
-        ALIGN_CF_DBGF(("fastaSeqId: '%s', ", rs->fastaSeqId));
-    else
-        ALIGN_CF_DBGF(("fastaSeqId: null, "));
-    
-    ALIGN_CF_DBGF(("seq-len: %u, ", rs->seq_len));
-    ALIGN_CF_DBGF(("circular: %s, ", rs->circular ? "true" : "false"));
-    
-    if (rs->md5) {
-        ALIGN_CF_DBGF(("md5: '"));
-        for (j = 0; j != 16; ++j)
-            ALIGN_CF_DBGF(("%02X", rs->md5[j]));
-        ALIGN_CF_DBGF(("', "));
-    }
-    else
-        ALIGN_CF_DBGF(("md5: null, "));
-    
-    
-    ALIGN_CF_DBGF(("keys: [ "));
-    for (j = 0; j != m; ++j) {
-        key_id_t const *const kid = &key_id_array[j];
-        
-        if (kid->id == i)
-            ALIGN_CF_DBGF(("'%s', ", kid->key));
-    }
-    ALIGN_CF_DBGF(("] }"));
-}
-
-void ReferenceMgr_DumpConfig(ReferenceMgr const *const self)
-{
-    unsigned const n = self->refSeqs.elem_count;
-    unsigned const m = self->refSeqsById.elem_count;
-    key_id_t const *const key_id_array = self->refSeqsById.base;
-    unsigned i;
-    
-    ALIGN_CF_DBGF(("config: [\n"));
-    for (i = 0; i != n; ++i) {
-        ALIGN_CF_DBGF(("\t"));
-        ReferenceSeq_Dump(&self->refSeq[i], i, key_id_array, m);
-        ALIGN_CF_DBGF((",\n"));
-    }
-    ALIGN_CF_DBGF(("]\n"));
-}
-#endif
-
-static
-rc_t ReferenceMgr_TryFasta(ReferenceMgr *const self, ReferenceSeq *const seq,
-                           char const id[], unsigned const idLen)
-{
-    KFile const *kf = NULL;
-    rc_t rc;
-    
-    rc = OpenFastaFile(&kf, self->dir, id, idLen);
-    
-    if (rc == 0) {
-        rc = ReferenceMgr_ImportFastaFile(self, kf, seq);
-        KFileRelease(kf);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceSeq_GetRefSeqInfo(ReferenceSeq *const self)
-{
-    rc_t rc;
-    uint8_t const *md5;
-    
-    assert(self != NULL);
-    assert(self->type == rst_refSeqById || self->type == rst_refSeqBySeqId);
-    
-    if ((rc = RefSeq_Circular(self->u.refseq, &self->circular)) != 0)
-        return rc;
-    if ((rc = RefSeq_SeqLength(self->u.refseq, &self->seq_len)) != 0)
-        return rc;
-    if ((rc = RefSeq_MD5(self->u.refseq, &md5)) != 0)
-        return rc;
-    
-    memcpy(self->md5, md5, 16);
-    return 0;
-}
-
-static
-rc_t ReferenceSeq_Attach(ReferenceMgr *const self, ReferenceSeq *const rs)
-{
-    unsigned const seqid_len = rs->seqId ? string_size( rs->seqId ) : 0;
-    unsigned const id_len = rs->id ? string_size( rs->id ) : 0;
-    rc_t rc = 0;
-    KFile const *kf = NULL;
-    
-    assert(rs->type == rst_unattached);
-    assert(id_len != 0 || seqid_len != 0);
-    
-    if (seqid_len) {
-        if (RefSeqMgr_Exists(self->rmgr, rs->seqId, seqid_len, NULL) == 0) {
-            rc = RefSeqMgr_GetSeq(self->rmgr, &rs->u.refseq, rs->seqId, seqid_len);
-            if (rc == 0) {
-                rs->type = rst_refSeqBySeqId;
-                rc = ReferenceSeq_GetRefSeqInfo(rs);
-            }
-            return rc;
-        }
-    }
-    if (id_len) {
-        if (RefSeqMgr_Exists(self->rmgr, rs->id, id_len, NULL) == 0) {
-            rc = RefSeqMgr_GetSeq(self->rmgr, &rs->u.refseq, rs->id, id_len);
-            if (rc == 0) {
-                rs->type = rst_refSeqById;
-                rc = ReferenceSeq_GetRefSeqInfo(rs);
-            }
-            return rc;
-        }
-    }
-    if (id_len) {
-        rc = OpenFastaFile(&kf, self->dir, rs->id, id_len);
-        if (rc && seqid_len)
-            rc = OpenFastaFile(&kf, self->dir, rs->seqId, seqid_len);
-    }
-    else
-        rc = OpenFastaFile(&kf, self->dir, rs->seqId, seqid_len);
-    
-    if (kf) {
-        ReferenceSeq tmp;
-        
-        rc = ReferenceMgr_ImportFastaFile(self, kf, &tmp);
-        KFileRelease(kf);
-        if (rc == 0) {
-            tmp.id = rs->id;
-            tmp.seqId = rs->seqId;
-            tmp.circular = rs->circular;
-            
-            *rs = tmp;
-        }
-        return rc;
-    }
-    return 0;
-}
-
-static
-rc_t ReferenceMgr_OpenSeq(ReferenceMgr *const self, ReferenceSeq **const rslt,
-                          char const id[],
-                          unsigned const seq_len,
-                          uint8_t const md5[16])
-{
-    unsigned const idLen = string_size( id );
-    key_id_t const *const fnd = ReferenceMgr_FindId(self, id);
-    
-    assert(rslt != NULL);
-    *rslt = NULL;
-    if (fnd) {
-        if (self->refSeq[fnd->id].type == rst_dead)
-            return RC(rcAlign, rcIndex, rcSearching, rcItem, rcInvalid);
-        *rslt = &self->refSeq[fnd->id];
-        return 0;
-    }
-    else {
-        unsigned const n = self->refSeqs.elem_count;
-        unsigned i;
-        ReferenceSeq *seq = NULL;
-        rc_t rc = 0;
-        
-        /* try to find by id; this should work most of the time */
-        for (i = 0; i != n; ++i) {
-            ReferenceSeq *const rs = &self->refSeq[i];
-
-            if (rs->type == rst_dead)
-                continue;
-            
-            if (rs->id && strcmp(rs->id, id) == 0) {
-                seq = rs;
-                break;
-            }
-        }
-        if (seq == NULL) {
-            /* try to find by seqId */
-            for (i = 0; i != n; ++i) {
-                ReferenceSeq *const rs = &self->refSeq[i];
-                
-                if (rs->type == rst_dead)
-                    continue;
-                
-                if (rs->seqId && strcasecmp(rs->seqId, id) == 0) {
-                    seq = rs;
-                    break;
-                }
-            }
-        }
-        if (seq == NULL) {
-            /* try to find id within fasta seqIds */
-            unsigned best_wt = 0;
-            unsigned best = n;
-            
-            for (i = 0; i != n; ++i) {
-                ReferenceSeq const *const rs = &self->refSeq[i];
-                
-                if (rs->fastaSeqId) {
-                    unsigned wt = str_weight(rs->fastaSeqId, id, idLen);
-                    
-                    if (wt != no_match) {
-                        if (seq_len && rs->seq_len == seq_len)
-                            wt |= seq_len_match;
-                        if (md5 && memcmp(rs->md5, md5, 16) == 0)
-                            wt |= md5_match;
-                    }
-                    if (best_wt < wt) {
-                        best_wt = wt;
-                        best = i;
-                    }
-                }
-            }
-            if (best < n)
-                seq = &self->refSeq[best];
-        }
-        if (seq == NULL) {
-            /* try id.fasta or id.fa */
-            rc = ReferenceMgr_NewReferenceSeq(self, &seq);
-            if (rc) return rc;
-            rc = ReferenceMgr_TryFasta(self, seq, id, idLen);
-            if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcPath)
-                rc = 0;
-            else if (rc) return rc;
-        }
-        else if (seq->type == rst_unattached) {
-            /* expect to get here most of the time
-             *
-             * ReferenceSeq_Attach tries to get reference:
-             *  from RefSeqMgr:
-             *   by seqId
-             *   by id
-             *  from self->dir (data directory)
-             *   id.fasta
-             *   id.fa
-             *   seqId.fasta
-             *   seqId.fa
-             */
-            rc = ReferenceSeq_Attach(self, seq);
-            if (rc) return rc;
-            
-            if (seq->type == rst_unattached && seq->seqId != NULL) {
-                /* attach didn't work for id; try to find seqId within fasta seqIds */
-                unsigned const seqIdLen = string_size( seq->seqId );
-                unsigned best_wt = 0;
-                unsigned best = n;
-                
-                for (i = 0; i != n; ++i) {
-                    ReferenceSeq const *const rs = &self->refSeq[i];
-                    
-                    if (rs->type == rst_local && rs->fastaSeqId) {
-                        unsigned wt = str_weight(rs->fastaSeqId, seq->seqId, seqIdLen);
-                        
-                        if (wt != no_match) {
-                            if (seq_len && rs->seq_len == seq_len)
-                                wt |= seq_len_match;
-                            if (md5 && memcmp(rs->md5, md5, 16) == 0)
-                                wt |= md5_match;
-                        }
-                        if (best_wt < wt) {
-                            best_wt = wt;
-                            best = i;
-                        }
-                    }
-                }
-                if (best < n) {
-                    char *const tmp_id = seq->id;
-                    char *const tmp_seqId = seq->seqId;
-                    bool const tmp_circ = seq->circular;
-                    
-                    *seq = self->refSeq[best];
-                    seq->id = tmp_id;
-                    seq->seqId = tmp_seqId;
-                    seq->fastaSeqId = NULL;
-                    seq->circular = tmp_circ;
-
-                    /* add another reference to the data buffer */
-                    rc = KDataBufferSub(&self->refSeq[best].u.local.buf, &seq->u.local.buf, 0, 0);
-                    if (rc) return rc;
-                }
-            }
-        }
-        assert(seq != NULL);
-        if (seq->type == rst_unattached) {
-            /* nothing has worked and nothing left to try */
-            seq->type = rst_dead;
-            rc = RC(rcAlign, rcFile, rcConstructing, rcId, rcNotFound);
-        }
-        else {
-            ReferenceSeq *alt = NULL;
-            
-            /* perform ambiguity check
-             *
-             * This search follows the same pattern as the main search but has
-             * more stringent conditions.  One hopes that it fails to find
-             * anything.
-             */
-            for (i = 0; i != n; ++i) {
-                ReferenceSeq *const rs = &self->refSeq[i];
-                
-                if (   rs->type != rst_dead
-                    && rs->type != rst_unattached
-                    && rs != seq
-                    && rs->id != NULL
-                    && strcmp(id, rs->id) == 0
-                    && (seq_len == 0 || seq_len == rs->seq_len))
-                {
-                    alt = rs;
-                    break;
-                }
-            }
-            if (alt == NULL) {
-                for (i = 0; i != n; ++i) {
-                    ReferenceSeq *const rs = &self->refSeq[i];
-                    
-                    if (   rs->type != rst_dead
-                        && rs->type != rst_unattached
-                        && rs != seq
-                        && rs->seqId != NULL
-                        && strcasecmp(id, rs->seqId) == 0
-                        && (seq_len == 0 || seq_len == rs->seq_len))
-                    {
-                        alt = rs;
-                        break;
-                    }
-                }
-            }
-            if (alt == NULL) {
-                unsigned best_wt = 0;
-                unsigned best = n;
-                
-                for (i = 0; i != n; ++i) {
-                    ReferenceSeq const *const rs = &self->refSeq[i];
-                    
-                    if (rs != seq && rs->fastaSeqId && rs != seq) {
-                        unsigned wt = str_weight(rs->fastaSeqId, id, idLen);
-                        
-                        if (wt != no_match) {
-                            if (seq_len && rs->seq_len == seq_len)
-                                wt |= seq_len_match;
-                            if (md5 && memcmp(rs->md5, md5, 16) == 0)
-                                wt |= md5_match;
-                        }
-                        if (best_wt < wt) {
-                            best_wt = wt;
-                            best = i;
-                        }
-                    }
-                }
-                if (best < n)
-                    alt = &self->refSeq[best];
-            }
-            /* try to knock the alternative out of consideration
-             * if it survives length and md5 tests, it is *really* likely to be
-             * a duplicate.
-             */
-            if (alt != NULL && seq_len != 0 && seq_len != alt->seq_len)
-                alt = NULL;
-            if (alt != NULL && md5 != NULL && memcmp(md5, alt->md5, 16) != 0)
-                alt = NULL;
-            if (alt != NULL) {
-                seq->type = rst_dead;
-                rc = RC(rcAlign, rcFile, rcConstructing, rcId, rcAmbiguous);
-            }
-        }
-        if ( seq->id == NULL )
-        {
-            seq->id = string_dup( id, string_size( id ) );
-            if ( seq->id == NULL )
-                return RC(rcAlign, rcFile, rcConstructing, rcMemory, rcExhausted);
-        }
-        /* finally, associate the id with the object and put it in the index */
-        {{
-            rc_t rc2 = ReferenceMgr_AddId(self, id, seq);
-            if (rc == 0)
-                rc = rc2;
-        }}
-        if (rc == 0)
-            *rslt = seq;
-        return rc;
-    }
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_SetCache(ReferenceMgr const *const self, size_t cache, uint32_t num_open)
-{
-    return RefSeqMgr_SetCache(self->rmgr, cache, num_open);
-}
-
-static
-rc_t OpenDataDirectory(KDirectory const **rslt, char const path[])
-{
-    KDirectory *dir;
-    rc_t rc = KDirectoryNativeDir(&dir);
-    
-    if (rc == 0) {
-        if (path) {
-            rc = KDirectoryOpenDirRead(dir, rslt, false, path);
-            KDirectoryRelease(dir);
-        }
-        else
-            *rslt = dir;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_Make(ReferenceMgr const **cself, VDatabase *db,
-                                     VDBManager const* vmgr,
-                                     const uint32_t options, char const conf[], char const path[],
-                                     uint32_t max_seq_len, size_t cache, uint32_t num_open)
-{
-    rc_t rc;
-    ReferenceMgr *self;
-    uint32_t wopt = 0;
-    
-    if (cself == NULL)
-        return RC(rcAlign, rcIndex, rcConstructing, rcParam, rcNull);
-    
-    wopt |= (options & ewrefmgr_co_allREADs) ? ewref_co_SaveRead : 0;
-    wopt |= (options & ewrefmgr_co_Coverage) ? ewref_co_Coverage : 0;
-
-    if (max_seq_len == 0)
-        max_seq_len = TableWriterRefSeq_MAX_SEQ_LEN;
-    
-    self = calloc(1, sizeof(*self));
-    if (self) {
-        rc = KDataBufferMakeBytes(&self->seq, max_seq_len);
-        if (rc == 0) {
-            self->compress.elem_bits = 32;
-            self->refSeqs.elem_bits = sizeof(ReferenceSeq) * 8;
-            self->refSeqsById.elem_bits = sizeof(key_id_t) * 8;
-            
-            self->options = options;
-            self->cache = cache;
-            self->num_open_max = num_open;
-            self->max_seq_len = max_seq_len;
-            if (db) VDatabaseAddRef(self->db = db);
-            rc = OpenDataDirectory(&self->dir, path);
-            if (rc == 0) {
-                rc = RefSeqMgr_Make(&self->rmgr, vmgr, 0, cache, num_open);
-                if (rc == 0) {
-                    rc = ReferenceMgr_Conf(self, conf);
-                    if (rc == 0) {
-                        *cself = self;
-                        ALIGN_DBG("conf %s, local path '%s'", conf ? conf : "", path ? path : "");
-                        return 0;
-                    }
-                    (void)PLOGERR(klogErr, (klogErr, rc, "failed to open configuration $(file)", "file=%s/%s", path ? path : ".", conf));
-                }
-            }
-        }
-        ReferenceMgr_Release(self, false, NULL, false, NULL);
-    }
-    else
-        rc = RC(rcAlign, rcIndex, rcConstructing, rcMemory, rcExhausted);
-
-    ALIGN_DBGERR(rc);
-
-    return rc;
-}
-
-#define ID_CHUNK_SZ 256
-
-typedef struct TChunk32_struct {
-    struct TChunk32_struct* next;
-    uint32_t id[ID_CHUNK_SZ]; /*** will only work with positive ids **/
-} TChunk32;
-
-typedef struct AlignId32List_struct {
-	TChunk32* head;
-	TChunk32* tail;
-	uint32_t  tail_qty;  /** number elements in the last chunk **/
-	uint32_t  chunk_qty; /** number of chunks */
-} AlignId32List;
-typedef struct AlignIdList_struct {
-	AlignId32List **sub_list;
-	uint32_t        sub_list_count; 
-} AlignIdList;
-
-static uint64_t AlignId32ListCount(AlignId32List *l)
-{ return (l->chunk_qty>0)?ID_CHUNK_SZ*(l->chunk_qty-1)+ l->tail_qty:0;}
-
-static uint64_t AlignIdListCount(AlignIdList *l)
-{
-	uint64_t ret=0;
-	if(l){
-		uint32_t i;
-		for(i=0;i<l->sub_list_count;i++){
-			if(l->sub_list[i]){
-				ret += AlignId32ListCount(l->sub_list[i]);
-			}
-		}
-	}
-	return ret;
-}
-static int int64_compare(const void *A, const void *B, void *ignore)
-{
-	return *(int64_t*)A -  *(int64_t*)B;
-}
-static uint64_t AlignIdListFlatCopy(AlignIdList *l,int64_t *buf,uint64_t num_elem,bool do_sort)
-{
-	uint64_t res=0;
-	uint32_t i,j;
-	AlignId32List* cl;
-	assert(l!=0);
-
-	if((cl = l->sub_list[0])!=NULL){
-		TChunk32* head  = cl->head;
-		while(head !=  cl->tail){
-			for(i=0;i<ID_CHUNK_SZ && res < num_elem;i++,res++){
-				buf[res] = head->id[i];
-			}
-			head = head->next;
-		}
-		for(i=0;i<cl->tail_qty && res < num_elem;i++,res++){
-			buf[res] = head->id[i];
-		}
-	}
-	for(j = 1; j< l->sub_list_count && res < num_elem;j++){
-		if((cl = l->sub_list[j])!=NULL){
-			TChunk32* head  = cl->head;
-			uint64_t  hi = ((uint64_t)j) << 32;
-			while(head !=  cl->tail){
-				for(i=0;i<ID_CHUNK_SZ && res < num_elem;i++,res++){
-					buf[res] = hi | head->id[i];
-				}
-				head = head->next;
-			}
-			for(i=0;i<cl->tail_qty && res < num_elem;i++,res++){
-				buf[res] = hi | head->id[i];
-			}
-		}
-	}
-	if(do_sort && res > 1) 
-		ksort(buf,res,sizeof(*buf),int64_compare,NULL);
-	return res;
-}
-
-static rc_t AlignId32ListAddId(AlignId32List *l,const uint32_t id)
-{
-	if(l->tail  == NULL){
-		l->head = l->tail = malloc(sizeof(*l->tail));
-		if(l->tail == NULL) return RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-		l->chunk_qty =1;
-		l->tail_qty = 0;	
-	}
-	if(l->tail_qty == ID_CHUNK_SZ){/** chunk is full **/
-		l->tail->next = malloc(sizeof(*l->tail));
-		if(l->tail == NULL) return RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-		l->tail = l->tail->next;
-		l->chunk_qty ++;
-		l->tail_qty = 0;	
-	}
-	l->tail->id[l->tail_qty++]=id;
-	return 0;
-}
-
-static rc_t AlignIdListAddId(AlignIdList *l,const int64_t id)
-{
-	uint32_t  sub_id,id32;
-	if(id < 0) return RC(rcAlign, rcTable, rcCommitting, rcId, rcOutofrange);
-	id32 = (uint32_t) id;
-	sub_id = id >> 32;
-	if(sub_id >= l->sub_list_count) return RC(rcAlign, rcTable, rcCommitting, rcId, rcOutofrange);
-	if(l->sub_list[sub_id] == NULL){
-		l->sub_list[sub_id] = calloc(1,sizeof(AlignId32List));
-		if(l->sub_list[sub_id] == NULL) return RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-	}
-	return AlignId32ListAddId(l->sub_list[sub_id],id32);
-}
-
-static void AlignId32ListRelease(AlignId32List *l)
-{
-	if(l){
-		while(l->head != l->tail){
-			TChunk32* head = l->head;
-			l->head = l->head->next;
-			free(head);
-		}
-		free(l->head);
-		free(l);
-	}
-}
-static void AlignIdListRelease(AlignIdList *l)
-{
-        if(l){
-		uint32_t i;
-		for(i=0;i<l->sub_list_count;i++){
-			AlignId32ListRelease(l->sub_list[i]);
-		}
-		free(l->sub_list);
-		free(l);
-        }
-}
-
-
-typedef struct {
-    AlignIdList*	idlist;
-    ReferenceSeqCoverage cover;
-    INSDC_coord_len bin_seq_len;
-} TCover;
-
-static
-void ReferenceMgr_TCoverRelease(TCover* c)
-{
-	if(c){
-		AlignIdListRelease(c->idlist);
-		c->idlist = NULL;
-	}
-}
-static 
-rc_t ReferenceMgr_TCoverSetMaxId(TCover* c,int64_t id)
-{
-	uint32_t  sub_id;
-	if(id < 0) return RC(rcAlign, rcTable, rcCommitting, rcId, rcOutofrange);
-	sub_id = id >> 32;
-	if(c->idlist == NULL){
-		c->idlist = calloc(1,sizeof(AlignIdList));
-		if(c->idlist==NULL) return RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-		c->idlist->sub_list_count = sub_id+1;
-		c->idlist->sub_list = calloc(c->idlist->sub_list_count,sizeof(c->idlist->sub_list[0]));
-		if( c->idlist->sub_list == NULL) return RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-	} else {
-		return RC(rcAlign, rcTable, rcCommitting, rcParam, rcUnexpected);
-	}
-	return 0;
-}
-
-static
-rc_t CoverageGetSeqLen(ReferenceMgr const *const mgr, TCover data[], uint64_t const rows)
-{
-    TableReaderColumn acols[] =
-    {
-        {0, "(INSDC:coord:len)SEQ_LEN", {NULL}, 0, 0},
-        {0, NULL, {NULL}, 0, 0}
-    };
-    VTable const *tbl;
-    rc_t rc = VDatabaseOpenTableRead(mgr->db, &tbl, "REFERENCE");
-    
-    if (rc == 0) {
-        TableReader const *reader;
-        
-        rc = TableReader_Make(&reader, tbl, acols, 0);
-        if (rc == 0) {
-            uint64_t i;
-            
-            for (i = 0; i != rows; ++i) {
-                rc = TableReader_ReadRow(reader, i + 1);
-                if (rc == 0 && acols->len > 0)
-                    data[i].bin_seq_len = acols->base.coord_len[0];
-            }
-            TableReader_Whack(reader);
-        }
-        VTableRelease(tbl);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceMgr_ReCover(const ReferenceMgr* cself, uint64_t ref_rows, rc_t (*const quitting)(void))
-{
-    rc_t rc = 0;
-    uint64_t new_rows = 0;
-    const TableWriterRefCoverage* cover_writer = NULL;
-    
-    TableReaderColumn acols[] =
-    {
-        {0, "REF_ID", {NULL}, 0, 0},
-        {0, "REF_START", {NULL}, 0, 0},
-        {0, "CIGAR_LONG",{NULL}, 0, 0},
-        {0, "REF_POS",{NULL}, 0, 0},
-        {0, NULL, {NULL}, 0, 0}
-    };
-    const int64_t** al_ref_id = &acols[0].base.i64;
-    const INSDC_coord_zero** al_ref_start = &acols[1].base.coord0;
-    const TableReaderColumn* cigar =  &acols[2];
-    const INSDC_coord_zero** al_ref_pos = &acols[3].base.coord0;
-    /* order is important see ReferenceSeqCoverage struct */
-    struct {
-        const char* nm;
-	    const char* col;
-        bool ids_only;
-    } tbls[] = { {"PRIMARY_ALIGNMENT", "PRIMARY_ALIGNMENT_IDS",false},
-        {"SECONDARY_ALIGNMENT", "SECONDARY_ALIGNMENT_IDS",false},
-        {"EVIDENCE_INTERVAL", "EVIDENCE_INTERVAL_IDS", true} };
-	int tbls_qty=(sizeof(tbls)/sizeof(tbls[0]));
-    rc_t rc1 = 0;
-    int64_t rr;
-    uint32_t i;
-    uint8_t* hilo=NULL;
-    TCover* data = NULL;
-    
-    /* allocate mem for ref_rows of reference coverage*/
-    if((data = calloc(ref_rows, (sizeof(*data) + cself->max_seq_len))) == NULL ) {
-		rc = RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-    } else {
-		/** allocation for both data and hilo was done in 1 shot ***/
-		hilo = (uint8_t *)&data[ref_rows];
-        rc = CoverageGetSeqLen(cself, data, ref_rows);
-    }
-    /* grep through tables for coverage data */
-    ALIGN_R_DBG("covering REFERENCE rowid range [1:%ld]",ref_rows);
-    for(i = 0; rc == 0 && i < tbls_qty; i++) { /* TABLE LOOP STARTS */
-        const VTable* table = NULL;
-        const TableReader* reader = NULL;
-        int64_t al_from;
-        uint64_t al_qty;
-        
-        ALIGN_R_DBG("covering REFERENCE with %s", tbls[i].nm);
-        if( (rc = VDatabaseOpenTableRead(cself->db, &table, tbls[i].nm)) != 0 ) {
-            if( GetRCState(rc) == rcNotFound ) {
-                ALIGN_R_DBG("table %s was not found, ignored", tbls[i].nm);
-                rc = 0;
-                continue;
-            } else {
-                break;
-            }
-        }
-        if( (rc = TableReader_Make(&reader, table, acols, cself->cache)) == 0 &&
-           (rc = TableReader_IdRange(reader, &al_from, &al_qty)) == 0 ) {
-            int64_t al_rowid;
-            
-            for(al_rowid = al_from; rc == 0 && al_rowid < al_from + al_qty; al_rowid++) {
-                if( (rc = TableReader_ReadRow(reader, al_rowid)) != 0 ) {
-                    break;
-                }
-                rr    = **al_ref_id-1;
-                /**** Record ALIGNMENT_IDS ***/
-                if(   data[rr].idlist == NULL 
-                   && (rc = ReferenceMgr_TCoverSetMaxId(data+rr,al_from + al_qty))!=0){
-                    break; /*** out-of-memory ***/
-                }
-                if((rc = AlignIdListAddId(data[rr].idlist,al_rowid))!=0){
-                    break; /*** out-of-memory ***/
-                }
-                /**** Done alignment ids ***/
-                if( !tbls[i].ids_only ) { /*** work on statistics ***/
-                    char const *c = cigar->base.str;
-                    const char *c_end = c + cigar->len;
-                    int64_t const global_ref_pos = rr*cself->max_seq_len + **al_ref_start; /** global_ref_start **/
-                    int64_t const global_refseq_start = global_ref_pos -  **al_ref_pos;   /** global_ref_start of current reference **/
-                    unsigned const bin_no = global_ref_pos / cself->max_seq_len;
-                    TCover *const bin = &data[bin_no];
-                    uint8_t *const cov = &hilo[global_ref_pos];
-                    int64_t ref_offset = 0;
-                    int64_t max_ref_offset = 0;
-                    int64_t min_ref_offset = 0;
-                    int64_t j;
-
-                    while (rc == 0 && c < c_end) {
-                        int op_len = strtol(c, (char **)&c, 10);
-                        int const op = *c++;
-                        
-                        switch (op){
-                        case 'I':/* extra bases in the read **/
-                            ++bin->cover.indels;
-                        case 'S':/* skip in the read */
-                            break;
-                        case 'B':/* back up in the sequence */
-                            if (ref_offset > op_len)
-                                ref_offset -= op_len;
-                            else
-                                ref_offset = 0;
-                            break;
-                        case 'D': /** delete in the reference ***/
-                            ++bin->cover.indels;
-                        case 'N': /** expected skip in the reference ***/
-                            ref_offset += op_len;
-                            break;
-                        case 'X':
-                            bin->cover.mismatches += op_len;
-                        case '=':
-                            ref_offset += op_len;
-                            break;
-                        default:
-                            rc = RC(rcAlign, rcTable, rcCommitting, rcData, rcUnrecognized);
-                        }
-                        if (min_ref_offset > ref_offset)
-                            min_ref_offset = ref_offset;
-                        if (max_ref_offset < ref_offset)
-                            max_ref_offset = ref_offset;
-                    }
-                    for (j = min_ref_offset; j < max_ref_offset; ++j) {
-                        unsigned const hl = cov[j];
-                        
-                        if (hl < UINT8_MAX)
-                            cov[j] = hl + 1;
-                    }
-                    /*** check if OVERLAPS are needed ***/
-                    {
-                        int64_t min_rr = (global_ref_pos + min_ref_offset)/cself->max_seq_len;
-                        int64_t max_rr = (global_ref_pos + max_ref_offset)/cself->max_seq_len;
-                        
-                        if(min_rr < 0) min_rr = 0;
-                        if(max_rr >= ref_rows) max_rr = ref_rows -1;
-                        
-                        assert(min_rr<= max_rr);
-                        
-                        if(min_rr < max_rr){
-                            int64_t  overlap_ref_pos; /** relative the beginning of the reference **/
-                            uint32_t overlap_ref_len = (global_ref_pos + max_ref_offset) % cself->max_seq_len ;
-                            
-                            min_rr++;
-                            if (global_ref_pos + min_ref_offset > global_refseq_start) {
-                                overlap_ref_pos = global_ref_pos + min_ref_offset - global_refseq_start;
-                            }
-                            else {
-                                overlap_ref_pos = 1;
-                            }
-                            for ( ; min_rr < max_rr; ++min_rr) {
-                                if (   data[min_rr].cover.overlap_ref_pos[i] == 0 /*** NOT SET***/
-                                    || overlap_ref_pos < data[min_rr].cover.overlap_ref_pos[i])
-                                {
-									data[min_rr].cover.overlap_ref_pos[i] = overlap_ref_pos;
-                                }
-                                data[min_rr].cover.overlap_ref_len[i] = cself->max_seq_len; /*** in between chunks get full length of overlap **/
-                            }
-                            if (   data[min_rr].cover.overlap_ref_pos[i] == 0
-                                || overlap_ref_pos < data[min_rr].cover.overlap_ref_pos[i])
-                            {
-								data[min_rr].cover.overlap_ref_pos[i] = overlap_ref_pos;
-                            }
-                            if (overlap_ref_len > data[min_rr].cover.overlap_ref_len[i])
-								data[min_rr].cover.overlap_ref_len[i] = overlap_ref_len;
-                        }
-                    }
-                } /**** DONE WITH WORK ON STATISTICS ***/
-                ALIGN_DBGERR(rc);
-                rc = rc ? rc : quitting();
-            }
-		    /*** HAVE TO RELEASE **/
-		    TableReader_Whack(reader);
-		    VTableRelease(table);
-		    /*** NOW SAVE AND RELEASE THE COLUMN ***/
-		    if( (rc = TableWriterRefCoverage_MakeIds(&cover_writer, cself->db, tbls[i].col)) == 0 ) {
-                for(rr=0; rc ==0 &&  rr < ref_rows; rr ++){
-                    uint64_t num_elem = AlignIdListCount( data[rr].idlist);
-                    uint64_t num_elem_copied = 0;
-                    if(num_elem > 0 ){
-#define BUF_STACK_COUNT 128 * 1024
-                        int64_t buf_stack[BUF_STACK_COUNT];
-                        int64_t *buf_alloc = NULL;
-                        int64_t *buf = buf_stack;
-                        if(num_elem > BUF_STACK_COUNT){
-                            buf=buf_alloc=malloc(num_elem*sizeof(buf[0]));
-                            if(buf_alloc == NULL) 
-                                rc = RC(rcAlign, rcTable, rcCommitting, rcMemory, rcExhausted);
-                        }
-                        if(rc == 0){
-                            num_elem_copied = AlignIdListFlatCopy(data[rr].idlist,buf,num_elem,true);
-                            assert(num_elem == num_elem_copied);
-                        }
-                        ReferenceMgr_TCoverRelease(data+rr); /** release memory ***/
-                        if(rc == 0){
-                            rc = TableWriterRefCoverage_WriteIds(cover_writer, rr+1, buf,num_elem);
-                        }
-                        if(buf_alloc) free(buf_alloc);
-                    } else {
-                        rc = TableWriterRefCoverage_WriteIds(cover_writer, rr+1, NULL,0);
-                    }
-                }
-                if(rc == 0){
-                    rc = TableWriterRefCoverage_Whack(cover_writer, rc == 0, &new_rows);
-                    if( rc == 0  && ref_rows != new_rows ) {
-                        rc = RC(rcAlign, rcTable, rcCommitting, rcData, rcInconsistent);
-                    }
-                }
-                ALIGN_DBGERR(rc);
-		    }
-		} else {
-			TableReader_Whack(reader);
-			VTableRelease(table);
-		}
-	}/* TABLE LOOP ENDS **/
-    /* prep and write coverage data */
-	if(rc == 0) {
-        uint64_t k;
-        
-		rc = TableWriterRefCoverage_MakeCoverage(&cover_writer, cself->db, 0);
-		for (rr = 0, k = 0; rc == 0 && rr != ref_rows; ++rr, k += cself->max_seq_len) {
-            unsigned hi = 0;
-            unsigned lo = 255;
-            
-		    for (i = 0; i != data[rr].bin_seq_len; ++i) {
-                unsigned const depth = hilo[k + i];
-                
-                if (hi < depth) hi = depth;
-                if (lo > depth) lo = depth;
-		    }
-            data[rr].cover.high = hi;
-            data[rr].cover.low  = lo;
-		    rc = TableWriterRefCoverage_WriteCoverage(cover_writer,rr+1, &data[rr].cover);
-		}
-		free(data);
-		rc1 = TableWriterRefCoverage_Whack(cover_writer, rc == 0, &new_rows);
-		rc = rc ? rc : rc1;
-		if( rc == 0 && ref_rows != new_rows ) {
-		    rc = RC(rcAlign, rcTable, rcCommitting, rcData, rcInconsistent);
-		}
-	}
-    ALIGN_DBGERR(rc);
-	return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_Release(const ReferenceMgr *cself,
-                                        const bool commit,
-                                        uint64_t *const Rows,
-                                        const bool build_coverage,
-                                        rc_t (*const quitting)(void)
-                                        )
-{
-    rc_t rc = 0;
-
-    if (cself != NULL) {
-        ReferenceMgr *const self = (ReferenceMgr *)cself;
-        uint64_t rows;
-        unsigned i;
-        
-        rc = TableWriterRef_Whack(self->writer, commit, &rows);
-        if (Rows) *Rows = rows;
-        KDirectoryRelease(self->dir);
-        
-        for (i = 0; i != self->refSeqsById.elem_count; ++i)
-            free((void *)((key_id_t *)self->refSeqsById.base)[i].key);
-        
-        for (i = 0; i != self->refSeqs.elem_count; ++i)
-            ReferenceSeq_Whack(&self->refSeq[i]);
-        
-        KDataBufferWhack(&self->compress);
-        KDataBufferWhack(&self->seq);
-        KDataBufferWhack(&self->refSeqs);
-        KDataBufferWhack(&self->refSeqsById);
-        
-        if (rc == 0 && build_coverage && commit)
-            rc = ReferenceMgr_ReCover(cself, rows, quitting);
-#if 0 
-        {
-            VTable* t = NULL;
-            
-            if (VDatabaseOpenTableUpdate(self->db, &t, "SECONDARY_ALIGNMENT") == 0) {
-                VTableDropColumn(t, "TMP_MISMATCH");
-                VTableDropColumn(t, "TMP_HAS_MISMATCH");
-            }
-            VTableRelease(t);
-        }
-#endif
-        VDatabaseRelease(self->db);
-        RefSeqMgr_Release(self->rmgr);
-        free(self);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceSeq_ReadDirect(ReferenceSeq *self,
-                             int offset,
-                             unsigned const len,
-                             bool read_circular,
-                             uint8_t buffer[],
-                             unsigned* written,
-                             bool force_linear)
-{
-    *written = 0;
-    if (len == 0)
-        return 0;
-    
-    if (read_circular || self->circular) {
-        if (offset < 0) {
-            unsigned const n = (-offset) / self->seq_len;
-            offset = (self->seq_len * (n + 1) + offset) % self->seq_len;
-        }
-        else if (offset > self->seq_len)
-            offset %= self->seq_len;
-    }
-    else if (offset >= self->seq_len)
-        return RC(rcAlign, rcType, rcReading, rcOffset, rcOutofrange);
-    
-    if (self->type == rst_local) {
-        uint8_t const *const src = self->u.local.buf.base;
-        unsigned dst_off = 0;
-        
-        while (dst_off < len) {
-            unsigned const writable = len - dst_off;
-            unsigned const readable = self->seq_len - offset;
-            unsigned const to_write = readable < writable ? readable : writable;
-            
-            memcpy(&buffer[dst_off], &src[offset], to_write);
-            *written += to_write;
-            if (!self->circular)
-                break;
-            offset = 0;
-            dst_off += to_write;
-        }
-        return 0;
-    }
-    else if (self->type == rst_refSeqById || self->type == rst_refSeqBySeqId) {
-        unsigned to_write = len;
-        
-        if (!self->circular || force_linear) {
-            unsigned const readable = self->seq_len - offset;
-            
-            if (to_write > readable)
-                to_write = readable;
-        }
-        return RefSeq_Read(self->u.refseq, offset, to_write, buffer, written);
-    }
-    return RC(rcAlign, rcType, rcReading, rcType, rcInvalid);
-}
-
-static
-rc_t ReferenceMgr_LoadSeq(ReferenceMgr *const self, ReferenceSeq *obj)
-{
-    KDataBuffer readBuf;
-    rc_t rc = KDataBufferMake(&readBuf, 8, self->max_seq_len);
-    
-    if (rc == 0) {
-        char const *const id = obj->id;
-        char const *const seqId = obj->seqId ? obj->seqId : id;
-        TableWriterRefData data;
-        INSDC_coord_zero offset = 0;
-        
-        obj->start_rowid = self->ref_rowid + 1;
-        data.name.buffer = id;
-        data.name.elements = string_size( id );
-        data.read.buffer = readBuf.base;
-        data.seq_id.buffer = seqId;
-        data.seq_id.elements = string_size( seqId );
-        data.force_READ_write = obj->type == rst_local || (self->options & ewrefmgr_co_allREADs);
-        data.circular = obj->circular;
-        
-        if (self->writer == NULL) {
-            uint32_t wopt = 0;
-            
-            wopt |= (self->options & ewrefmgr_co_allREADs) ? ewref_co_SaveRead : 0;
-            wopt |= (self->options & ewrefmgr_co_Coverage) ? ewref_co_Coverage : 0;
-            if( (rc = TableWriterRef_Make(&self->writer, self->db, wopt)) == 0 ) {
-                TableWriterData mlen;
-                
-                mlen.buffer = &self->max_seq_len;
-                mlen.elements = 1;
-                rc = TableWriterRef_WriteDefaultData(self->writer, ewrefseq_cn_MAX_SEQ_LEN, &mlen);
-            }
-        }
-        while (rc == 0 && offset < obj->seq_len) {
-            unsigned row_len;
-            
-            rc = ReferenceSeq_ReadDirect(obj, offset, self->max_seq_len, false,
-                                         readBuf.base, &row_len, true);
-            if (rc != 0 || row_len == 0) break;
-            
-            data.read.elements = row_len;
-            rc = TableWriterRef_Write(self->writer, &data, NULL);
-            offset += row_len;
-            ++self->ref_rowid;
-        }
-        KDataBufferWhack(&readBuf);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_GetSeq(ReferenceMgr const *const cself,
-                                       ReferenceSeq const **const seq,
-                                       char const id[])
-{
-    ReferenceMgr *const self = (ReferenceMgr *)cself;
-    
-    if  (self == NULL || seq == NULL || id == NULL )
-        return RC(rcAlign, rcFile, rcConstructing, rcParam, rcNull);
-    
-    *seq = NULL;
-    {
-        ReferenceSeq *obj;
-        rc_t rc = ReferenceMgr_OpenSeq(self, &obj, id, 0, NULL);
-        
-        if (rc) return rc;
-        if (obj->start_rowid == 0) {
-            rc = ReferenceMgr_LoadSeq(self, obj);
-            if (rc) return rc;
-        }
-        *seq = obj;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_Verify(const ReferenceMgr* cself, const char* id, INSDC_coord_len seq_len, const uint8_t* md5)
-{
-#if 0
-    rc_t rc = 0;
-    ReferenceSeq* rseq;
-    const KFile* kf;
-    
-    if( cself == NULL || id == NULL ) {
-        rc = RC(rcAlign, rcFile, rcConstructing, rcParam, rcNull);
-    } else if( (rc = ReferenceMgr_Find(cself, id, &rseq, &kf)) == 0 ) {
-        if( rseq == NULL ) {
-            uint64_t size = 0;
-            if( (rc = KFileSize(kf, &size)) == 0 && size == 0 ) {
-                rc = RC(rcAlign, rcTable, rcValidating, rcSize, rcEmpty);
-            }
-            KFileRelease(kf);
-        } else if( rseq->local ) {
-            if( rseq->seq_len != seq_len ) {
-                rc = RC(rcAlign, rcFile, rcValidating, rcSize, rcUnequal);
-                ALIGN_DBGERRP("%s->%s SEQ_LEN verification", rc, id, rseq->accession);
-            }
-            if( rc == 0 && md5 != NULL && memcmp(md5, rseq->u.local.md5, sizeof(rseq->u.local.md5)) != 0 ) {
-                unsigned i;
-                rc = RC(rcAlign, rcTable, rcValidating, rcChecksum, rcUnequal);
-                ALIGN_DBGERRP("%s->%s MD5 verification", rc, id, rseq->accession);
-                ALIGN_DBGF((" local '"));
-                for(i = 0; i < sizeof(rseq->u.local.md5); i++) {
-                    ALIGN_DBGF(("%02hx", rseq->u.local.md5[i]));
-                }
-                ALIGN_DBGF(("'  <> match '"));
-                for(i = 0; i < sizeof(rseq->u.local.md5); i++) {
-                    ALIGN_DBGF(("%02hx", md5[i]));
-                }
-                ALIGN_DBGF(("'\n"));
-            } else {
-                ALIGN_DBG("%s->%s MD5 verification ok", id, rseq->accession);
-            }
-        } else {
-            const RefSeq* tmp = rseq->u.refseq.o;
-            INSDC_coord_len o_len;
-            const uint8_t* o_md5;
-
-            if( tmp == NULL ) {
-                if( (rc = RefSeqMgr_GetSeq(cself->rmgr, &tmp, rseq->accession, string_size( rseq->accession ))) != 0 ||
-                    (rc = RefSeq_SeqLength(tmp, &o_len)) != 0 ) {
-                    ALIGN_DBGERRP("%s->%s verification", rc, id, rseq->accession);
-                }
-            } else {
-                o_len = rseq->seq_len;
-            }
-            if( rc == 0 ) {
-                if( seq_len != 0 && o_len != seq_len ) {
-                    rc = RC(rcAlign, rcTable, rcValidating, rcSize, rcUnequal);
-                    ALIGN_DBGERRP("%s->%s SEQ_LEN verification", rc, id, rseq->accession);
-                } else {
-                    ALIGN_DBG("%s->%s SEQ_LEN verification ok", id, rseq->accession);
-                }
-            }
-            if( rc == 0 && (rc = RefSeq_MD5(tmp, &o_md5)) == 0 ) {
-                if( md5 != NULL && o_md5 != NULL && memcmp(md5, o_md5, sizeof(rseq->u.local.md5)) != 0 ) {
-                    rc = RC(rcAlign, rcTable, rcValidating, rcChecksum, rcUnequal);
-                    ALIGN_DBGERRP("%s->%s MD5 verification", rc, id, rseq->accession);
-                } else {
-                    ALIGN_DBG("%s->%s MD5 verification ok", id, rseq->accession);
-                }
-            }
-            if( tmp != rseq->u.refseq.o ) {
-                RefSeq_Release(tmp);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        ALIGN_DBG("%s verification ok", id);
-    } else {
-        ALIGN_DBGERRP("%s verification", rc, id);
-    }
-    return rc;
-#else
-    if (cself == NULL || id == NULL)
-        return RC(rcAlign, rcFile, rcValidating, rcParam, rcNull);
-    {
-        ReferenceMgr *self = (ReferenceMgr *)cself;
-        ReferenceSeq *rseq;
-        rc_t rc = ReferenceMgr_OpenSeq(self, &rseq, id, seq_len, md5);
-        
-        if (rc) return rc;
-        if (rseq->seq_len != seq_len) {
-            rc = RC(rcAlign, rcFile, rcValidating, rcSize, rcUnequal);
-            ALIGN_DBGERRP("%s->%s SEQ_LEN verification", rc, id, rseq->seqId);
-        }
-        if (md5 && memcmp(md5, rseq->md5, sizeof(rseq->md5)) != 0 ) {
-            unsigned i;
-            
-            rc = RC(rcAlign, rcTable, rcValidating, rcChecksum, rcUnequal);
-            ALIGN_DBGERRP("%s->%s MD5 verification", rc, id, rseq->seqId);
-            ALIGN_DBGF((" found '"));
-            for(i = 0; i < sizeof(rseq->md5); i++) {
-                ALIGN_DBGF(("%02hx", rseq->md5[i]));
-            }
-            ALIGN_DBGF(("'  != requested '"));
-            for(i = 0; i < sizeof(rseq->md5); i++) {
-                ALIGN_DBGF(("%02hx", md5[i]));
-            }
-            ALIGN_DBGF(("'\n"));
-        } else {
-            ALIGN_DBG("%s->%s MD5 verification ok", id, rseq->seqId);
-        }
-        if( rc == 0 ) {
-            ALIGN_DBG("%s verification ok", id);
-        } else {
-            ALIGN_DBGERRP("%s verification", rc, id);
-        }
-        return rc;
-    }
-#endif
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_FastaPath(const ReferenceMgr* cself, const char* fasta_path)
-{
-    rc_t rc = 0;
-    KDirectory* dir;
-
-    if( cself == NULL || fasta_path == NULL ) {
-        rc = RC(rcAlign, rcFile, rcConstructing, rcParam, rcNull);
-    } else if( (rc = KDirectoryNativeDir(&dir)) == 0 ) {
-        const KFile* kf;
-        if( (rc = KDirectoryOpenFileRead(dir, &kf, "%s", fasta_path)) == 0 ) {
-            rc = ReferenceMgr_FastaFile(cself, kf);
-            KFileRelease(kf);
-        }
-        KDirectoryRelease(dir);
-    }
-    ALIGN_DBGERRP("from file %s", rc, fasta_path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_FastaFile(const ReferenceMgr* cself, const KFile* file)
-{
-    if( cself == NULL || file == NULL ) {
-        return RC(rcAlign, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    return ReferenceMgr_ImportFastaFile((ReferenceMgr *)cself, file, NULL);
-}
-
-static
-int extrace_cigar_op(char *op,
-                     uint32_t *op_len,
-                     char const *const cigar,
-                     uint32_t const cigar_len,
-                     uint32_t const offset,
-                     uint32_t const options,
-                     unsigned *const bin)
-{
-    static char const op_txt[] = "MIDNSHP=XB??????";
-    uint32_t i = offset;
-    
-    if (options & ewrefmgr_cmp_Binary) {
-        uint32_t c;
-        
-        memcpy(&c, cigar + i * 4, 4);
-        *bin = c & 0x0F;
-        *op = op_txt[c & 0x0F];
-        *op_len = c >> 4;
-    }
-    else {
-        uint32_t len = 0;
-        int ch;
-
-        while(i < cigar_len && (ch = cigar[i]) != '\0' && isdigit(ch)) {
-            len *= 10;
-            len += ch - '0';
-            ++i;
-        }
-        *bin = *op = ch;
-        *op_len = len;
-    }
-    return i - offset;
-}
-
-static
-rc_t cigar2offset(const uint32_t options, const void* cigar, uint32_t cigar_len, int32_t* out, uint32_t out_sz, uint32_t out_used,
-                  INSDC_coord_len* seq_len, INSDC_coord_len* ref_len, INSDC_coord_len* max_ref_len)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    uint32_t last_match = 0;
-    uint32_t op_len;
-    uint32_t last_soft_len = 0;
-    uint32_t b_len = 0;
-    uint32_t last_op = cigar_len - 1;
-    char op;
-    unsigned op_bin;
-    
-    if ((options & ewrefmgr_cmp_Binary) == 0) {
-        for (i = 0; i < cigar_len; last_op = ++i) {
-            i += extrace_cigar_op(&op, &op_len, cigar, cigar_len, i, options, &op_bin);
-        }
-    }
-    
-#if _DEBUGGING
-    ALIGN_C_DBGF(("%s:%u: ", __func__, __LINE__));
-    if( options & ewrefmgr_cmp_Binary ) {
-        ALIGN_C_DBGF(("bin cigar '"));
-        for(i = 0; i < cigar_len; i++) {
-            extrace_cigar_op(&op, &op_len, cigar, cigar_len, i, options, &op_bin);
-            ALIGN_C_DBGF(("%u%c", op_len, op));
-        }
-    } else {
-        ALIGN_C_DBGF(("cigar '%.*s", cigar_len, cigar));
-    }
-    ALIGN_C_DBGF(("'[%u]\n", cigar_len));
-#endif
-    
-    *seq_len = 0;
-    *ref_len = 0;
-    *max_ref_len = 0;
-    memset(out, 0, out_used * sizeof(*out) * 2);
-    for(i = 0; rc == 0 && i < cigar_len; i++) {
-        i += extrace_cigar_op(&op, &op_len, cigar, cigar_len, i, options, &op_bin);
-        if (op == 'P') {
-            continue;
-        }
-        if( op != 'S' && op != 'I' ) {
-            last_soft_len = 0;
-        }
-        switch(op) {
-        case 'M':
-        case '=':
-        case 'X':
-            *seq_len += op_len;
-            *ref_len += op_len;
-            *max_ref_len += op_len;
-            if(b_len > op_len) {
-                b_len -= op_len;
-            }
-            else {
-                b_len=0;
-                last_match = *seq_len;
-            }
-            break;
-        case 'S':
-        case 'I':
-            last_soft_len += op_len;
-            *max_ref_len += op_len;
-            *seq_len += op_len;
-            if (last_match < out_sz) {
-                if (i < last_op) {
-                    if (b_len > 0) {/** not right soft clip **/
-                        assert(out[last_match] < 0);
-                        out[last_match-out[last_match]] = 0x80000000;
-                    }
-                    out[last_match] += -op_len;
-                }
-                if (b_len == 0) last_match = *seq_len;
-            } else {
-                rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInconsistent);
-            }
-            
-            break;
-        case 'B':
-            /* Complete Genomics CIGAR style specific:
-             overlap between consecutive reads
-             ex: sequence 6 bases: ACACTG, reference 2 bases: ACTG,
-             cigar will be: 2M2B2M
-             no need to move sequence position
-             */
-            if( last_match < out_sz ) {
-                if(b_len > 0 && i < cigar_len -1){/** not right soft clip **/
-                    assert(out[last_match] < 0);
-                    out[last_match-out[last_match]] = 0x80000000;
-                }
-                out[last_match] -= op_len;
-            } else {
-                rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInconsistent);
-            }
-            if( *ref_len < op_len ) {
-                *ref_len = 0;
-            } else {
-                *ref_len -= op_len;
-            }
-            *max_ref_len += op_len;
-            b_len += op_len;
-            break;
-        case 'D':
-        case 'N':
-            if( last_match < out_sz ) {
-                out[last_match] += op_len;
-            } else if (last_match == out_sz && last_match > 0 ){ /*** delete at the end ***/
-                out[last_match-1] += op_len;
-            } else {
-                rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInconsistent);
-            }
-            *ref_len += op_len;
-            *max_ref_len += op_len;
-            break;
-        case 'H':
-            if ((options & ewrefmgr_co_AcceptHardClip) == 0)
-            {
-                rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInvalid);
-                (void)LOGERR(klogErr, rc, "Hard clipping of sequence data is not allowed");
-            }
-            break;
-        default:
-            rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcUnrecognized);
-            if ((options & ewrefmgr_cmp_Binary) == 0)
-                (void)PLOGERR(klogErr, (klogErr, rc, "Invalid or unrecognized CIGAR operation '$(opcode)'", "opcode=%c", op));
-            else if (op != '?')
-                (void)PLOGERR(klogErr, (klogErr, rc, "Invalid or unrecognized CIGAR operation '$(opcode)' (binary code: $(opbin))", "opcode=%c,opbin=%u", op, op_bin));
-            else
-                (void)PLOGERR(klogErr, (klogErr, rc, "Invalid or unrecognized CIGAR operation (binary code: $(opbin))", "opbin=%u", op_bin));
-            break;
-        }
-    }
-    if( !(options & ewrefmgr_cmp_Exact) && last_soft_len > 0 ) {
-        ALIGN_C_DBG("trailing soft clip %u @ %u", last_soft_len, last_match);
-        out[last_match] += last_soft_len;
-    }
-#if _DEBUGGING
-    ALIGN_C_DBGF(("%s:%u: offsets: ", __func__, __LINE__));
-    last_match = last_match > *seq_len ? last_match : *seq_len;
-    for(i = 0; i <= last_match; i++) {
-        if( i == *seq_len ) {
-            ALIGN_C_DBGF((" | "));
-        }
-        ALIGN_C_DBGF(("%i%c", out[i], ((i + 1) % 5) ? ',' : ' '));
-    }
-    ALIGN_C_DBGF((" cigar derived seq_len %u, ref_len %u, max_ref_len %u\n", *seq_len, *ref_len, *max_ref_len));
-#endif
-    return rc;
-}
-
-static
-void ReferenceSeq_TranslateOffset_int(ReferenceSeq const *const cself,
-                                      INSDC_coord_zero const offset,
-                                      int64_t *const ref_id,
-                                      INSDC_coord_zero *const ref_start,
-                                      uint64_t *const global_ref_start)
-{
-    if (ref_id)
-        *ref_id = cself->start_rowid + offset / cself->mgr->max_seq_len;
-    
-    if (ref_start)
-        *ref_start = offset % cself->mgr->max_seq_len;
-    
-    if (global_ref_start)
-        *global_ref_start = (cself->start_rowid - 1) * cself->mgr->max_seq_len + offset;
-}
-
-LIB_EXPORT rc_t CC ReferenceMgr_Compress(const ReferenceMgr* cself, uint32_t options,
-                                         const char* id, INSDC_coord_zero offset,
-                                         const char* seq, INSDC_coord_len seq_len,
-                                         const void* cigar, uint32_t cigar_len,
-                                         INSDC_coord_zero allele_offset, const char* allele, INSDC_coord_len allele_len,INSDC_coord_zero offset_in_allele,
-                                         const void* allele_cigar, uint32_t allele_cigar_len,
-                                         TableWriterAlgnData* data)
-{
-    rc_t rc = 0;
-    const ReferenceSeq* refseq;
-
-    if( cself == NULL || id == NULL ) {
-        rc = RC(rcAlign, rcFile, rcProcessing, rcParam, rcNull);
-    } else if( (rc = ReferenceMgr_GetSeq(cself, &refseq, id)) == 0 ) {
-        rc = ReferenceSeq_Compress(refseq, options, offset, seq, seq_len, cigar, cigar_len,
-                                   allele_offset, allele, allele_len,offset_in_allele,
-				   allele_cigar, allele_cigar_len, data);
-        ReferenceSeq_Release(refseq);
-    }
-    ALIGN_C_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT size_t CC ReferenceMgr_CompressHelper(uint8_t cmp_rslt[],
-                                                 TableWriterAlgnData const *const data,
-                                                 uint8_t const input[])
-{
-    size_t const len = data->has_mismatch.elements;
-    bool const *const has_mismatch = data->has_mismatch.buffer;
-    size_t i;
-    size_t n;
-    
-    for (n = i = 0; i != len; ++i) {
-        if (has_mismatch[i]) {
-            cmp_rslt[n] = input[i];
-            ++n;
-        }
-    }
-    return n;
-}
-
-LIB_EXPORT rc_t CC ReferenceSeq_Compress(const ReferenceSeq* cself, uint32_t options, INSDC_coord_zero offset,
-                                         const char* seq, INSDC_coord_len seq_len,
-                                         const void* cigar, uint32_t cigar_len,
-                                         INSDC_coord_zero allele_offset, const char* allele,
-                                         INSDC_coord_len allele_len,
-                                         INSDC_coord_zero offset_in_allele,
-                                         const void* allele_cigar, uint32_t allele_cigar_len,
-                                         TableWriterAlgnData* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || seq == NULL || cigar == NULL || cigar_len == 0 || data == NULL ||
-        (!(allele == NULL && allele_len == 0 && allele_cigar == NULL && allele_cigar_len == 0) &&
-         !(allele != NULL && allele_cigar != NULL && allele_cigar_len != 0)) ) {
-        return RC(rcAlign, rcFile, rcProcessing, rcParam, rcInvalid);
-    }
-    if (seq_len * 2 > cself->mgr->compress.elem_count) {
-        rc = KDataBufferResize(&cself->mgr->compress, seq_len * 2);
-        if (rc) return rc;
-    }
-    if ((rc = ReferenceSeq_ReOffset(cself->circular, cself->seq_len, &offset)) == 0 ) {
-        INSDC_coord_len i, seq_pos = 0, allele_ref_end = 0, ref_len = 0, rl = 0, max_rl = 0;
-        INSDC_coord_zero* read_start = &((INSDC_coord_zero*)(data->read_start.buffer))[data->ploidy];
-        INSDC_coord_len* read_len = &((INSDC_coord_len*)(data->read_len.buffer))[data->ploidy];
-        bool* has_ref_offset, *has_mismatch;
-        int32_t* ref_offset;
-        uint8_t* mismatch; 
-        uint8_t sref_buf[64 * 1024];
-        void *href_buf = NULL;
-        uint8_t *ref_buf = sref_buf;
-	int32_t  allele_off_buf[1024];
-#if _DEBUGGING
-        uint64_t i_ref_offset_elements, i_mismatch_elements;
-        char x[4096];
-#endif
-
-        if( data->ploidy == 0 ) {
-            data->has_ref_offset.elements = seq_len;
-            data->ref_offset.elements = 0;
-            data->has_mismatch.elements = seq_len;
-            data->mismatch.elements = 0;
-            *read_start = 0;
-        }
-        else {
-            data->has_ref_offset.elements += seq_len;
-            data->has_mismatch.elements += seq_len;
-            *read_start = read_start[-1] + read_len[-1];
-        }
-        *read_len = seq_len;
-        has_ref_offset = &((bool*)(data->has_ref_offset.buffer))[*read_start];
-        ref_offset = (int32_t*)(data->ref_offset.buffer);
-        has_mismatch = &((bool*)(data->has_mismatch.buffer))[*read_start];
-        mismatch = (uint8_t*)(data->mismatch.buffer);
-
-#if _DEBUGGING
-        i_ref_offset_elements = data->ref_offset.elements;
-        i_mismatch_elements = data->mismatch.elements;
-        ALIGN_C_DBG("align%s '%.*s'[%u] to '%s:%s' at %i", (options & ewrefmgr_cmp_Exact) ? " EXACT" : "",
-                    seq_len, seq, seq_len, cself->id, cself->seqId, offset);
-#endif
-        if( allele != NULL ) {
-            /* determine length of reference for subst by allele */
-            ALIGN_C_DBG("apply allele %.*s[%u] at %i w/cigar below",
-                        allele_len, allele, allele_len, allele_offset);
-            rc = cigar2offset(options, allele_cigar, allele_cigar_len,
-                    allele_off_buf, sizeof(allele_off_buf)/sizeof(*allele_off_buf)/2,
-                    allele_len, &seq_pos, &allele_ref_end, &max_rl);
-            /* where allele ends on reference */
-            allele_ref_end += allele_offset;
-        }
-        if( rc == 0 ) {
-            rc = cigar2offset(options, cigar, cigar_len,
-                              (int32_t*)(cself->mgr->compress.base), cself->mgr->compress.elem_count / 2,
-                             seq_len, &seq_pos, &rl, &max_rl);
-        }
-        if( allele != NULL ) {
-            if( allele_offset + allele_ref_end < offset || allele_offset >= offset + rl ) {
-                (void)PLOGMSG(klogWarn, (klogWarn,
-                    "allele $(a) offset $(ao) $(ac) is not within referenced region in $(id) at offset $(ro) $(rc)",
-                    "a=%.*s,ao=%i,ac=%.*s,id=%s,ro=%i,rc=%.*s",
-                    allele_len, allele, allele_offset, (options & ewrefmgr_cmp_Binary) ? 0 : allele_cigar_len, allele_cigar,
-                    cself->seqId, offset, (options & ewrefmgr_cmp_Binary) ? 0 : cigar_len, cigar));
-                allele = NULL;
-            }
-        }
-        if( rc == 0 ) {
-            if( !(options & ewrefmgr_cmp_Exact) ) {
-                /* do not write leading deletes just move reference offset */
-                int32_t *const compress_buf = cself->mgr->compress.base;
-                if( compress_buf[0] > 0 ) {
-                    offset += compress_buf[0];
-                    rl -= compress_buf[0];
-                    max_rl -= compress_buf[0];
-                    compress_buf[0] = 0;
-                    ALIGN_C_DBG("adjusted offset %i", offset);
-                }
-            }
-            ref_len = rl;
-            if( (offset + max_rl) > cself->seq_len && !cself->circular ) {
-                max_rl = cself->seq_len - offset;
-                if( max_rl < rl ) {
-                    /* ref_len used for compression cannot be shorter than ref_len derived from cigar,
-                       if there is a shortage it will fail later here */
-                    max_rl = rl;
-                }
-                ALIGN_C_DBG("max_ref_len truncated to %u cause it goes beyond refseq length %lu at offset %i",
-                             max_rl, cself->seq_len, offset);
-            }
-            ALIGN_C_DBG("chosen REF_LEN %u, ref len for match %u", ref_len, max_rl);
-
-            assert(seq_len == seq_pos);
-            if (max_rl > sizeof(sref_buf)) {
-                if (href_buf)
-                    free(href_buf);
-                href_buf = malloc(max_rl);
-                if (href_buf == NULL)
-                    rc = RC(rcAlign, rcFile, rcProcessing, rcMemory, rcExhausted);
-                ref_buf = href_buf;
-            }
-            if (rc == 0) {
-                int64_t ref_pos;
-
-                if( allele != NULL ) {
-                    /* subst allele in reference */
-                    if( allele_offset <= offset ) {
-                        /* move allele start inside referenced chunk */
-			    allele     += offset_in_allele;
-			    allele_len -= offset_in_allele;
-                            rl = 0;
-                    } else {
-                        /* fetch portion of reference which comes before allele */
-                        rl = allele_offset - offset;
-                        rc = ReferenceSeq_ReadDirect((ReferenceSeq*)cself, offset, rl, true, ref_buf, &i, false);
-                        if( rc == 0 && rl != i ) {
-                            /* here we need to test it otherwise excessive portion of allele could be fetch in next if */
-                            rc = RC(rcAlign, rcFile, rcProcessing, rcRange, rcExcessive);
-                        }
-                    }
-                    if( rc == 0 && allele_len < (max_rl - rl) ) {
-                        memcpy(&ref_buf[rl], allele, allele_len);
-                        rl += allele_len;
-                        /* append tail of actual reference */
-                        rc = ReferenceSeq_ReadDirect((ReferenceSeq*)cself, allele_ref_end, max_rl - rl, true, &ref_buf[rl], &i, false);
-                        rl += i;
-                    } else if( rc == 0 ) {
-                        /* allele is longer than needed */
-                        memcpy(&ref_buf[rl], allele, max_rl - rl);
-                        rl = max_rl;
-                    }
-                } else {
-                    rc = ReferenceSeq_ReadDirect((ReferenceSeq*)cself, offset, max_rl, true, ref_buf, &rl, false);
-                }
-                if( rc != 0 || max_rl != rl ) {
-                    rc = rc ? rc : RC(rcAlign, rcFile, rcProcessing, rcRange, rcExcessive);
-                    ALIGN_C_DBGERRP("refseq is shorter: at offset %i need %u bases", rc, offset, max_rl);
-                } else {
-                    int32_t *const compress_buf = cself->mgr->compress.base;
-                    for(seq_pos = 0, ref_pos = 0; seq_pos < seq_len; seq_pos++, ref_pos++) {
-                        has_ref_offset[seq_pos] = compress_buf[seq_pos] != 0;
-                        if( has_ref_offset[seq_pos]){
-                            if(compress_buf[seq_pos] == 0x80000000 ){
-                                compress_buf[seq_pos] = 0; /** the hack has served its purpose **/
-                            } else {
-                                ref_offset[data->ref_offset.elements++] = compress_buf[seq_pos];
-                                ref_pos += compress_buf[seq_pos];
-                            }
-                        }
-                        if( (ref_pos < 0) || (ref_pos >= max_rl) || 
-                            ((toupper(ref_buf[ref_pos]) != toupper(seq[seq_pos])) && (seq[seq_pos] != '=')) ) {
-                            has_mismatch[seq_pos] = true;
-                            mismatch[data->mismatch.elements++] = seq[seq_pos];
-                        } else {
-                            /* match! */
-                            has_mismatch[seq_pos] = false;
-                        }
-                    }
-                    data->mismatch.elements = ReferenceMgr_CompressHelper(mismatch, data, (uint8_t const *)seq);
-                }
-            }
-        }
-#if _DEBUGGING
-        if(rc == 0 ) {
-            int32_t j;
-            memset(x, '-', sizeof(x) - 1);
-            x[sizeof(x) - 2] = '\0';
-
-            ALIGN_C_DBG("ref: %.*s [%u]", max_rl, ref_buf, max_rl);
-            ALIGN_C_DBGF(("%s:%u: ref: ", __func__, __LINE__));
-            for(seq_pos = 0, j = 0, rl = 0, i = 0; seq_pos < seq_len; seq_pos++, j++) {
-                if( has_ref_offset[seq_pos] ) {
-                    if( ref_offset[i_ref_offset_elements + rl] > 0 ) {
-                        ALIGN_C_DBGF(("%.*s", (uint32_t)(ref_offset[i_ref_offset_elements + rl]), &ref_buf[j]));
-                    } else {
-                        i = -ref_offset[i_ref_offset_elements + rl];
-                    }
-                    j += ref_offset[i_ref_offset_elements + rl];
-                    rl++;
-                }
-                ALIGN_C_DBGF(("%c", (j < 0 || j >= max_rl) ? '-' : (i > 0) ? tolower(ref_buf[j]) : ref_buf[j]));
-                if( i > 0  ) {
-                    i--;
-                }
-            }
-            ALIGN_C_DBGF(("\n%s:%u: seq: ", __func__, __LINE__));
-            for(i = 0, j = 0; i < seq_len; i++) {
-                if( has_ref_offset[i] && ref_offset[i_ref_offset_elements + j++] > 0 ) {
-                    ALIGN_C_DBGF(("%.*s", ref_offset[i_ref_offset_elements + j - 1], x));
-                }
-                ALIGN_C_DBGF(("%c", seq[i]));
-            }
-            ALIGN_C_DBGF((" [%u]\n", seq_len));
-            ALIGN_C_DBGF(("%s:%u: hro: ", __func__, __LINE__));
-            for(i = 0, j = 0; i < seq_len; i++) {
-                if( has_ref_offset[i] && ref_offset[i_ref_offset_elements + j++] > 0 ) {
-                    ALIGN_C_DBGF(("%.*s", ref_offset[i_ref_offset_elements + j - 1], x));
-                }
-                ALIGN_C_DBGF(("%c", has_ref_offset[i] + '0'));
-            }
-            ALIGN_C_DBGF((", ro:"));
-            for(i = i_ref_offset_elements; i < data->ref_offset.elements; i++) {
-                ALIGN_C_DBGF((" %i,", ref_offset[i]));
-            }
-            ALIGN_C_DBGF(("[%u]\n", data->ref_offset.elements - i_ref_offset_elements));
-            ALIGN_C_DBGF(("%s:%u: hmm: ", __func__, __LINE__));
-            for(i = 0, j = 0; i < seq_len; i++) {
-                if( has_ref_offset[i] && ref_offset[i_ref_offset_elements + j++] > 0 ) {
-                    ALIGN_C_DBGF(("%.*s", ref_offset[i_ref_offset_elements + j - 1], x));
-                }
-                ALIGN_C_DBGF(("%c", has_mismatch[i] + '0'));
-            }
-            ALIGN_C_DBGF((", mm: '%.*s'[%u]\n", (int)(data->mismatch.elements - i_mismatch_elements),
-                &mismatch[i_mismatch_elements], data->mismatch.elements - i_mismatch_elements));
-        }
-#endif
-        if( rc == 0 ) {
-            if( data->ploidy == 0 ) {
-                int64_t *const ref_id = (int64_t *)data->ref_id.buffer;
-                INSDC_coord_zero *const ref_start = (INSDC_coord_zero *)data->ref_start.buffer;
-                uint64_t *const global_ref_start = (uint64_t *)data->global_ref_start.buffer;
-                
-                data->ref_1st_row_id = cself->start_rowid;
-                data->effective_offset = offset;
-                data->ref_len = ref_len;
-                ALIGN_C_DBGF(("%s:%u: reference 1st ROW_ID %li OFFSET %i REF_LEN %u",
-                    __func__, __LINE__, data->ref_1st_row_id, data->effective_offset, data->ref_len));
-                
-                ReferenceSeq_TranslateOffset_int(cself, offset, ref_id, ref_start, global_ref_start);
-                
-                if (ref_id) {
-                    data->ref_id.elements = 1;
-                    ALIGN_C_DBGF((" REF_ID %li", ref_id[0]));
-                }
-                if (ref_start) {
-                    data->ref_start.elements = 1;
-                    ALIGN_C_DBGF((" REF_START %i", ref_start[0]));
-                }
-                if (global_ref_start) {
-                    data->global_ref_start.elements = 1;
-                    ALIGN_C_DBGF((" GLOBAL_REF_START %lu", global_ref_start[0]));
-                }
-                ALIGN_C_DBGF(("\n"));
-            } else {
-                if( data->ref_1st_row_id != cself->start_rowid || data->effective_offset != offset ) {
-                    rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInconsistent);
-                    (void)PLOGERR(klogErr, (klogErr, rc,
-                        "all reads in alignment record must align to same refseq at same location $(r1)@$(o1) <> $(r2):$(a2)@$(o2)",
-                        "r1=%li,o1=%i,r2=%s,a2=%s,o2=%i", data->ref_1st_row_id, data->effective_offset, cself->id, cself->seqId, offset));
-                } else if( data->ref_len != ref_len ) {
-                    rc = RC(rcAlign, rcFile, rcProcessing, rcData, rcInconsistent);
-                    (void)PLOGERR(klogErr, (klogErr, rc,
-                        "all reads in alignment record must have same size projection on refseq $(rl1) <> $(rl2) $(r):$(a)@$(o)",
-                        "rl1=%u,rl2=%u,r=%s,a=%s,o=%i", data->ref_len, ref_len, cself->id, cself->seqId, offset));
-                }
-            }
-        }
-        if( rc == 0 ) {
-            data->ploidy++;
-            data->read_start.elements = data->ploidy;
-            data->read_len.elements = data->ploidy;
-        }
-        if (href_buf)
-            free(href_buf);
-    }
-    ALIGN_C_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceSeq_Read(const ReferenceSeq* cself, INSDC_coord_zero offset, INSDC_coord_len len,
-                                     uint8_t* buffer, INSDC_coord_len* ref_len)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || buffer == NULL || ref_len == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else {
-        rc = ReferenceSeq_ReadDirect((ReferenceSeq*)cself, offset, len, true, buffer, ref_len, false);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceSeq_Get1stRow(const ReferenceSeq* cself, int64_t* row_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || row_id == NULL ) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else {
-        *row_id = cself->start_rowid;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceSeq_AddCoverage(const ReferenceSeq* cself, INSDC_coord_zero offset, const ReferenceSeqCoverage* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL) {
-        rc = RC(rcAlign, rcFile, rcReading, rcParam, rcNull);
-    } else if( !(cself->mgr->options & ewrefmgr_co_Coverage) ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcData, rcUnexpected);
-        ALIGN_R_DBGERRP("coverage %s", rc, "data");
-    } else if( (rc = ReferenceSeq_ReOffset(cself->circular, cself->seq_len, &offset)) == 0 ) {
-        rc = TableWriterRef_WriteCoverage(cself->mgr->writer, cself->start_rowid, offset, data);
-    }
-    ALIGN_DBGERR(rc);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReferenceSeq_Release(const ReferenceSeq *cself)
-{
-    return 0;
-}
diff --git a/libs/align/writer-refseq.c b/libs/align/writer-refseq.c
deleted file mode 100644
index 5361a92..0000000
--- a/libs/align/writer-refseq.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <insdc/insdc.h>
-#include <vdb/manager.h>
-#include <align/writer-refseq.h>
-#include "writer-priv.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-static const TableWriterColumn TableWriterRefSeq_cols[ewrefseq_cn_Last + 1] =
-{
-    /* order is important, see enum in .h !!! */
-    {0, "MAX_SEQ_LEN", sizeof(uint32_t) * 8, 0},
-    {0, "DEF_LINE", sizeof(char) * 8, ewcol_IsArray},
-    {0, "(INSDC:dna:text)CS_KEY", sizeof(char) * 8, 0},
-    {0, "(INSDC:dna:text)READ", sizeof(char) * 8, ewcol_IsArray},
-    {0, "QUALITY", sizeof(INSDC_quality_phred) * 8, ewcol_IsArray},
-    {0, "SEQ_ID", sizeof(char) * 8, ewcol_IsArray},
-    {0, "SEQ_START", sizeof(INSDC_coord_one) * 8, 0},
-    {0, "SEQ_LEN", sizeof(INSDC_coord_len) * 8, 0},
-    {0, "CIRCULAR", sizeof(bool) * 8, 0}
-};
-
-struct TableWriterRefSeq {
-    const TableWriter* base;
-    uint8_t cursorid;
-    TableWriterColumn cols[sizeof(TableWriterRefSeq_cols)/sizeof(TableWriterRefSeq_cols[0])];
-    INSDC_coord_one seq_start_last;
-    uint32_t max_seq_len;
-    INSDC_dna_text last_cs_key;
-};
-
-LIB_EXPORT rc_t CC TableWriterRefSeq_Make(const TableWriterRefSeq** cself, VDBManager* mgr, const char* schema_path,
-                                          const char* table_path, const uint32_t options)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        TableWriterRefSeq* self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            memcpy(self->cols, TableWriterRefSeq_cols, sizeof(TableWriterRefSeq_cols));
-            if( !(options & ewrefseq_co_QUALITY) ) {
-                self->cols[ewrefseq_cn_QUALITY].flags |= ewcol_Ignore;
-            }
-            if( (rc = TableWriter_MakeMgr(&self->base, mgr, schema_path, "NCBI:refseq:tbl:reference", table_path)) == 0 ) {
-                rc = TableWriter_AddCursor(self->base, self->cols, sizeof(self->cols)/sizeof(self->cols[0]), &self->cursorid);
-            }
-        }
-        if( rc == 0 ) {
-            *cself = self;
-            ALIGN_DBG("table %s created", table_path);
-        } else {
-            TableWriterRefSeq_Whack(self, false, NULL, 0, NULL, NULL, NULL, 0);
-            ALIGN_DBGERRP("table %s", rc, table_path);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterRefSeq_Whack(const TableWriterRefSeq* cself, bool commit, uint64_t* rows,
-                                           const char loader_name[],
-                                           const ver_t loader_version,
-                                           const char loader_date[],
-                                           const char app_name[],
-                                           const ver_t app_version)
-{
-    rc_t rc = 0;
-
-    if( cself != NULL ) {
-        rc_t rc1;
-        if( commit ) {
-            rc = TableWriter_Sign(cself->base, loader_name, loader_version, loader_date, app_name, app_version);
-        }
-        rc1 = TableWriter_Whack(cself->base, rc ? false : commit, rows);
-        rc = rc ? rc : rc1;
-        free((TableWriterRefSeq*)cself);
-    }
-    return rc;
-}
-
-static
-rc_t TableWriterRefSeq_WriteDefaults(const TableWriterRefSeq* cself)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        TableWriterRefSeq* self = (TableWriterRefSeq*)cself;
-        self->max_seq_len = TableWriterRefSeq_MAX_SEQ_LEN;
-        self->seq_start_last = 1;
-        self->last_cs_key = 'T';
-        TW_COL_WRITE_DEF_VAR(cself->base, cself->cursorid, cself->cols[ewrefseq_cn_MAX_SEQ_LEN], cself->max_seq_len);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterRefSeq_WriteDefault(const TableWriterRefSeq* cself,
-                                                  enum ETableWriterRefSeq_ColNames col, const TableWriterData* data)
-{
-    rc_t rc = 0;
-    if( cself == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRefSeq_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else {
-        TW_COL_WRITE_DEF(cself->base, cself->cursorid, cself->cols[col], (*data));
-        if( col == ewrefseq_cn_MAX_SEQ_LEN ) {
-            ((TableWriterRefSeq*)cself)->max_seq_len = *((uint32_t*)data->buffer);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterRefSeq_Write(const TableWriterRefSeq* cself, const TableWriterRefSeqData* data, int64_t* rowid)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->last_cs_key == '\0' && (rc = TableWriterRefSeq_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else if( data->read.elements > cself->max_seq_len ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcData, rcInvalid);
-        ALIGN_DBGERRP("%s is longer than %s", rc, cself->cols[ewrefseq_cn_READ].name, cself->cols[ewrefseq_cn_MAX_SEQ_LEN].name);
-    } else if( (rc = TableWriter_OpenRow(cself->base, rowid, cself->cursorid)) == 0 ) {
-        INSDC_coord_len len = data->read.elements;
-        TW_COL_WRITE(cself->base, cself->cols[ewrefseq_cn_READ], data->read);
-        TW_COL_WRITE(cself->base, cself->cols[ewrefseq_cn_QUALITY], data->quality);
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefseq_cn_SEQ_START], cself->seq_start_last);
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefseq_cn_SEQ_LEN], len);
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewrefseq_cn_CS_KEY], cself->last_cs_key);
-        if( rc == 0 && (rc = TableWriter_CloseRow(cself->base)) == 0 ) {
-            TableWriterRefSeq* self = (TableWriterRefSeq*)cself;
-            
-            self->last_cs_key = ((const INSDC_dna_text*)(data->read.buffer))[data->read.elements - 1];
-            self->seq_start_last += len;
-        }
-    }
-    return rc;
-}
diff --git a/libs/align/writer-sequence.c b/libs/align/writer-sequence.c
deleted file mode 100644
index 3cd09cb..0000000
--- a/libs/align/writer-sequence.c
+++ /dev/null
@@ -1,636 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <align/extern.h>
-
-#include <klib/rc.h>
-#include <klib/vector.h>
-#include <klib/sort.h>
-#include <klib/data-buffer.h>
-#include <klib/printf.h>
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <vdb/cursor.h>
-#include <sra/sradb.h>
-#include <align/writer-sequence.h>
-#include "writer-priv.h"
-#include "reader-cmn.h"
-#include "debug.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-static const TableWriterColumn TableWriterSeq_cols[ewseq_cn_Last + 1] =
-{
-    /* order is important, see Write below!!! */
-    {0, "(INSDC:dna:text)CMP_READ", sizeof(char) * 8, ewcol_IsArray},
-    {0, "(INSDC:color:text)CMP_CSREAD", sizeof(char) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "CS_KEY", sizeof(char) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "QUALITY", sizeof(INSDC_quality_phred) * 8, ewcol_IsArray},
-    {0, "PRIMARY_ALIGNMENT_ID", sizeof(int64_t) * 8, ewcol_IsArray},
-    {0, "ALIGNMENT_COUNT", sizeof(uint8_t) * 8, ewcol_IsArray},
-    {0, "PLATFORM", sizeof(INSDC_SRA_platform_id) * 8, 0},
-    {0, "LABEL", sizeof(char) * 8, ewcol_IsArray},
-    {0, "LABEL_START", sizeof(INSDC_coord_zero) * 8, ewcol_IsArray},
-    {0, "LABEL_LEN", sizeof(INSDC_coord_len) * 8, ewcol_IsArray},
-    {0, "READ_TYPE", sizeof(SRAReadTypes) * 8, ewcol_IsArray},
-    {0, "READ_START", sizeof(INSDC_coord_zero) * 8, ewcol_IsArray},
-    {0, "READ_LEN", sizeof(INSDC_coord_len) * 8, ewcol_IsArray},
-    {0, "TMP_KEY_ID", sizeof(uint64_t) * 8, ewcol_Temporary},
-    {0, "SPOT_GROUP", sizeof(char) * 8, ewcol_IsArray | ewcol_Ignore},
-    {0, "READ_FILTER", sizeof(uint8_t) * 8, ewcol_IsArray},
-    {0, "TI", sizeof(uint64_t) * 8, ewcol_IsArray | ewcol_Ignore}
-};
-
-static const TableReaderColumn TableSeqReadTmpKey_cols[] = {
-    {0, "TMP_KEY_ID", {NULL}, 0, 0},
-    {0, "READ_LEN", {NULL}, 0, 0},
-    {0, NULL, {NULL}, 0, 0}
-};
-
-struct TableWriterSeq {
-    uint32_t options;
-    const TableWriter* base;
-    uint8_t cursor_id;
-    TableWriterColumn cols[sizeof(TableWriterSeq_cols)/sizeof(TableWriterSeq_cols[0])];
-    bool init; /* default written indicator */
-    int64_t qual_buf_sz;
-    uint8_t* qual_buf;
-    uint8_t discrete_qual[256];
-    uint8_t alignd_cursor_id;
-    TableWriterColumn cols_alignd[2];
-    const TableReader* tmpkey_reader;
-    TableReaderColumn cols_read_tmpkey[sizeof(TableSeqReadTmpKey_cols) / sizeof(TableSeqReadTmpKey_cols[0])];
-    KVector *stats;
-    unsigned statsCount;
-    int64_t tmpKeyIdFirst;
-    int64_t tmpKeyIdLast;
-    bool flush;
-};
-
-static bool TableWriterSeq_InitQuantMatrix(uint8_t dst[256], char const quant[])
-{
-    unsigned i = 0;
-    unsigned limit = 0;
-    unsigned value = 0;
-    unsigned cur;
-    int ws = 1;
-    int st = 0;
-    
-    memset(dst, 0, 256);
-    for (cur = 0; quant[cur] != 0; ++cur) {
-        int const ch = quant[cur];
-        
-        if (ws) {
-            if (isspace(ch))
-                continue;
-            ws = false;
-        }
-        switch (st) {
-        case 0:
-            if (isdigit(ch)) {
-                value = (value * 10) + ch - '0';
-                break;
-            }
-            else if (isspace(ch)) {
-                ++st;
-                ws = true;
-                break;
-            }
-            ++st;
-            /* no break */
-        case 1:
-            if (ch != ':')
-                return false;
-            ws = true;
-            ++st;
-            break;
-        case 2:
-            if (isdigit(ch)) {
-                limit  = (limit * 10) + ch - '0';
-                break;
-            }
-            else if (isspace(ch)) {
-                ++st;
-                ws = true;
-                break;
-            }
-            else if (ch == '-' && limit == 0) {
-                memset(dst + i, value, 256 - i);
-                return true;
-            }
-            ++st;
-            /* no break */
-        case 3:
-            if (ch != ',')
-                return false;
-            ws = true;
-            st = 0;
-            if (i > limit)
-                return false;
-            memset(dst + i, value, limit - i);
-            i = limit;
-            limit = value = 0;
-            break;
-        }
-    }
-    if (st == 0) {
-        switch (value) {
-        case 1:
-            break;
-        case 2:
-            break;
-        }
-    }
-    return false;
-}
-
-typedef struct { uint64_t distance, count; } stats_pair_t;
-
-typedef struct { 
-    stats_pair_t *stats;
-    unsigned i;
-} pb_t;
-
-static rc_t CC stats_cb(uint64_t key, uint64_t value, void *user_data)
-{
-    pb_t *pb = user_data;
-    
-    pb->stats[pb->i].distance = key;
-    pb->stats[pb->i].count = value;
-    ++pb->i;
-    
-    return 0;
-}
-
-static int CC stats_cmp_count(const void *A, const void *B, void *ignore)
-{
-    if (((stats_pair_t const *)A)->distance == 0)
-        return -1;
-    if (((stats_pair_t const *)B)->distance == 0)
-        return 1;
-    if (((stats_pair_t const *)B)->count < ((stats_pair_t const *)A)->count)
-        return -1;
-    if (((stats_pair_t const *)B)->count > ((stats_pair_t const *)A)->count)
-        return 1;
-    if (((stats_pair_t const *)B)->distance < ((stats_pair_t const *)A)->distance)
-        return 1;
-    if (((stats_pair_t const *)B)->distance > ((stats_pair_t const *)A)->distance)
-        return -1;
-    return 0;
-}
-
-static int CC stats_cmp_distance(const void *A, const void *B, void *ignore)
-{
-    if (((stats_pair_t const *)A)->distance < ((stats_pair_t const *)B)->distance)
-        return -1;
-    if (((stats_pair_t const *)A)->distance > ((stats_pair_t const *)B)->distance)
-        return 1;
-    return 0;
-}
-
-static rc_t TableWriterSeq_WriteStatistics(TableWriterSeq const *cself, KMDataNode *node)
-{
-    pb_t pb;
-    rc_t rc;
-    KDataBuffer buf;
-    
-    rc = KDataBufferMake(&buf, 8 * sizeof(pb.stats[0]), cself->statsCount);
-    if (rc) return rc;
-    
-    pb.stats = buf.base;
-    pb.i = 0;
-    rc = KVectorVisitU64(cself->stats, 0, stats_cb, &pb);
-    if (rc == 0) {
-        unsigned i;
-        unsigned const n = cself->statsCount < 126 ? cself->statsCount : 126;
-        uint64_t *const distance = buf.base;
-        
-        ksort(pb.stats, cself->statsCount, sizeof(pb.stats[0]), stats_cmp_count, NULL);
-        ksort(pb.stats, n, sizeof(pb.stats[0]), stats_cmp_distance, NULL);
-        for (i = 0; i != n; ++i) {
-            distance[i] = pb.stats[i].distance;
-        }
-        rc = KMDataNodeWrite(node, distance, n * sizeof(distance[0]));
-    }
-    KDataBufferWhack(&buf);
-    return rc;
-}
-
-static rc_t TableWriterSeq_CollectStatistics(TableWriterSeq *self, const TableWriterData* primary_alignment_id)
-{
-    rc_t rc;
-    int64_t mate[2] = {0, 0};
-    uint64_t distance = 0;
-    uint64_t count = 0;
-    
-    memcpy(mate, primary_alignment_id->buffer, sizeof(mate[0]) * primary_alignment_id->elements);
-    if (mate[0] && mate[1]) {
-        distance = (mate[0] < mate[1]) ? (mate[1] - mate[0]) : (mate[0] - mate[1]);
-    }
-    else
-        return 0;
-    if (self->stats == NULL) {
-        rc = KVectorMake(&self->stats); if (rc) return rc;
-    }
-    rc = KVectorGetU64(self->stats, distance, &count);
-    if (GetRCObject(rc) == rcItem && GetRCState(rc) == rcNotFound) {
-        rc = KVectorSetU64(self->stats, distance, 1);
-        if (rc == 0) ++self->statsCount;
-    }
-    else if (rc == 0) {
-        ++count;
-        rc = KVectorSetU64(self->stats, distance, count);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_Make(const TableWriterSeq** cself, VDatabase* db,
-                                       uint32_t options, char const qual_quantization[])
-{
-    rc_t rc = 0;
-    TableWriterSeq* self = NULL;
-    char const *tblName = (options & ewseq_co_ColorSpace) ? "CS_SEQUENCE" : "SEQUENCE";
-
-    options |= ewseq_co_SaveQual; /* TODO: remove when ready */
-    if( cself == NULL || db == NULL ) {
-        rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        self = calloc(1, sizeof(*self));
-        if( self == NULL ) {
-            rc = RC(rcAlign, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            memcpy(self->cols, TableWriterSeq_cols, sizeof(TableWriterSeq_cols));
-            if( options & ewseq_co_AlignData ) {
-                self->cols[ewseq_cn_TMP_KEY_ID].flags |= ewcol_Ignore;
-            } else {
-                self->cols[ewseq_cn_PRIMARY_ALIGNMENT_ID].flags |= ewcol_Ignore;
-                self->cols[ewseq_cn_ALIGNMENT_COUNT].flags |= ewcol_Ignore;
-            }
-            if(options & ewseq_co_NoLabelData) {
-                self->cols[ewseq_cn_LABEL].flags |= ewcol_Ignore;
-                self->cols[ewseq_cn_LABEL_LEN].flags |= ewcol_Ignore;
-                self->cols[ewseq_cn_LABEL_START].flags |= ewcol_Ignore;
-            }
-            if(options & ewseq_co_ColorSpace) {
-                self->cols[ewseq_cn_READ].flags |= ewcol_Ignore;
-                self->cols[ewseq_cn_CSREAD].flags &= ~ewcol_Ignore;
-                self->cols[ewseq_cn_CSKEY].flags &= ~ewcol_Ignore;
-            }
-            if( options & ewseq_co_SpotGroup) {
-                self->cols[ewseq_cn_SPOT_GROUP].flags &= ~ewcol_Ignore;
-            }
-            if( options & ewseq_co_TI) {
-                self->cols[ewseq_cn_TI].flags &= ~ewcol_Ignore;
-            }
-            if( (rc = TableWriter_Make(&self->base, db, tblName, "SEQUENCE")) == 0 ) {
-                rc = TableWriter_AddCursor(self->base, self->cols, sizeof(self->cols)/sizeof(self->cols[0]), &self->cursor_id);
-            }
-        }
-        if( rc == 0 ) {
-            self->options = options;
-            if (qual_quantization && strcmp(qual_quantization, "0") == 0) {
-                self->options |= ewseq_co_FullQuality;
-            }
-            if( !(self->options & ewseq_co_FullQuality) ) {
-                char const *quant_string = qual_quantization;
-                
-                if (quant_string == NULL || strcmp(quant_string, "1") == 0) {
-                    quant_string = "1:10,10:20,20:30,30:-";
-                } else if (strcmp(quant_string, "2") == 0) {
-                    quant_string = "1:30,30:-";
-                }
-                if (!TableWriterSeq_InitQuantMatrix(self->discrete_qual, quant_string)) {
-                    rc = RC(rcAlign, rcFormatter, rcConstructing, rcParam, rcInvalid);
-                }
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-        ALIGN_DBG("table %s", "created");
-    } else {
-        TableWriterSeq_Whack(self, false, NULL);
-        ALIGN_DBGERR(rc);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_Whack(const TableWriterSeq* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-
-    if( cself != NULL ) {
-        TableWriterSeq* self = (TableWriterSeq*)cself;
-        VTable *vtbl;
-        
-        TableReader_Whack(cself->tmpkey_reader);
-#if 1
-        if (cself->stats && commit && (rc = TableWriter_GetVTable(cself->base, &vtbl)) == 0 ) {
-            KMetadata* meta;
-            if( (rc = VTableOpenMetadataUpdate(vtbl, &meta)) == 0 ) {
-                KMDataNode* node;
-                if( (rc = KMetadataOpenNodeUpdate(meta, &node, "MATE_STATISTICS")) == 0 ) {
-                    rc = TableWriterSeq_WriteStatistics(cself, node);
-                    KMDataNodeRelease(node);
-                }
-                KMetadataRelease(meta);
-            }
-        }
-#endif
-        rc = TableWriter_Whack(cself->base, commit && (rc == 0), rows);
-        KVectorRelease(cself->stats);
-        free(self->qual_buf);
-        free(self);
-    }
-    return rc;
-}
-
-static
-rc_t TableWriteSeq_WriteDefaults(const TableWriterSeq* cself)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        TableWriterSeq* self = (TableWriterSeq*)cself;
-        self->init = true;
-        if( (self->options & ewseq_co_AlignData) ) {
-            static TableWriterData const d = { "", 0 };
-            TW_COL_WRITE_DEF(self->base, cself->cursor_id, self->cols[ewseq_cn_PRIMARY_ALIGNMENT_ID], d);
-            TW_COL_WRITE_DEF(self->base, cself->cursor_id, self->cols[ewseq_cn_ALIGNMENT_COUNT], d);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriteSeq_WriteDefault(const TableWriterSeq* cself,
-                                              enum ETableWriterSeq_ColNames col, const TableWriterData* data)
-{
-    rc_t rc = 0;
-    if( !cself->init ) {
-        rc = TableWriteSeq_WriteDefaults(cself);
-    }
-    if( rc == 0 ) {
-        rc = TableWriter_ColumnDefault(cself->base, cself->cursor_id, &cself->cols[col], data);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_GetNextRowId(const TableWriterSeq* cself, int64_t* rowid)
-{
-    return TableWriter_GetNextRowId(cself->base, rowid, cself->cursor_id);
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_Write(const TableWriterSeq* cself, const TableWriterSeqData* data, int64_t* rowid)
-{
-    rc_t rc = 0;
-    int lbl;
-    
-    if( cself == NULL || data == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( !cself->init && (rc = TableWriteSeq_WriteDefaults(cself)) != 0 ) {
-        ALIGN_DBGERR(rc);
-    } else if( data->quality.buffer == NULL || data->sequence.elements != data->quality.elements ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, data->quality.buffer ? rcInconsistent : rcEmpty);
-        ALIGN_DBGERRP("sequence and quality length %lu <> %lu", rc, data->sequence.elements, data->quality.elements);
-    } else if( data->read_start.elements != data->nreads ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("nreads and read_start length %u <> %lu", rc, data->nreads, data->read_start.elements);
-    } else if( data->read_len.elements != data->nreads ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent );
-        ALIGN_DBGERRP("nreads and read_len length %u <> %lu", rc, data->nreads, data->read_len.elements);
-    } else if( (cself->options & ewseq_co_AlignData) && data->primary_alignment_id.elements != data->nreads ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("nreads and primary_alignment_id length %u <> %lu", rc, data->nreads, data->primary_alignment_id.elements);
-    } else if( (cself->options & ewseq_co_AlignData) && data->alignment_count.elements != data->nreads ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("nreads and alignment_count length %u <> %lu", rc, data->nreads, data->alignment_count.elements);
-    } else if( data->no_quantize_mask.buffer && data->no_quantize_mask.elements != data->quality.elements ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("quality and no_quantize_mask length %u <> %lu", rc, data->quality.elements, data->no_quantize_mask.elements);
-    } else if( !(cself->options & ewseq_co_NoLabelData) &&
-               (lbl = ((data->label.buffer ? 1 : 0) + (data->label_start.buffer ? 1 : 0) +
-                                                  (data->label_len.buffer ? 1 : 0))) != 0 && lbl != 3 ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("LABEL %s", rc, "incomplete");
-    } else if( (rc = TableWriter_OpenRow(cself->base, rowid, cself->cursor_id)) == 0 ) {
-        if( cself->options & ewseq_co_AlignData ) {
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_PRIMARY_ALIGNMENT_ID], data->primary_alignment_id);
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_ALIGNMENT_COUNT], data->alignment_count);
-            if (rc == 0) {
-                rc = TableWriterSeq_CollectStatistics((TableWriterSeq *)cself, &data->primary_alignment_id);
-            }
-        }
-        if( cself->options & ewseq_co_SaveRead ) {
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_READ], data->sequence);
-        }
-        else {
-            uint32_t i;
-            const char* seq = data->sequence.buffer;
-            const uint8_t* ac = data->alignment_count.buffer;
-            const INSDC_coord_zero* rs = data->read_start.buffer;
-            const INSDC_coord_len* rl = data->read_len.buffer;
-
-            TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_READ], NULL, 0);
-            TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_CSREAD], NULL, 0);
-            for(i = 0; i < data->nreads; i++ ) {
-                if( ac[i] == 0 ) {
-                    TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_READ], &seq[rs[i]], rl[i]);
-                    TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_CSREAD], &seq[rs[i]], rl[i]);
-                }
-            }
-        }
-        if( cself->options & ewseq_co_FullQuality ) {
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_QUALITY], data->quality);
-        } else {
-            uint64_t i;
-            const uint8_t* b = data->quality.buffer;
-            if( data->quality.elements > cself->qual_buf_sz ) {
-                uint8_t* p = realloc(cself->qual_buf, data->quality.elements * cself->cols[ewseq_cn_QUALITY].element_bits);
-                if( p == NULL ) {
-                    rc = RC(rcAlign, rcType, rcWriting, rcMemory, rcExhausted);
-                    ALIGN_DBGERRP("quality %s", rc, "discretization");
-                } else {
-                    ((TableWriterSeq*)cself)->qual_buf_sz = data->quality.elements;
-                    ((TableWriterSeq*)cself)->qual_buf = p;
-                }
-            }
-            if (data->no_quantize_mask.buffer) {
-                bool const *mask = data->no_quantize_mask.buffer;
-                
-                for(i = 0; i < data->quality.elements; i++ ) {
-                    uint8_t const q = b[i] & 0x3F;
-                    cself->qual_buf[i] = mask[i] ? q : cself->discrete_qual[q];
-                }
-            }
-            else {
-                for(i = 0; i < data->quality.elements; i++ ) {
-                    cself->qual_buf[i] = cself->discrete_qual[b[i]];
-                }
-            }
-            if (cself->options & ewseq_co_SaveQual) {
-                TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_QUALITY], cself->qual_buf, data->quality.elements);
-            }
-            else {
-                uint32_t i;
-                uint8_t const *const qual = data->sequence.buffer;
-                uint8_t const *const aligned = data->alignment_count.buffer;
-                INSDC_coord_zero const *const rs = data->read_start.buffer;
-                INSDC_coord_len const *const rl = data->read_len.buffer;
-                
-                TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_QUALITY], NULL, 0);
-                for (i = 0; i < data->nreads; ++i) {
-                    if (!aligned[i]) {
-                        INSDC_coord_zero const readStart = rs[i];
-                        INSDC_coord_len const readLen = rl[i];
-                        
-                        TW_COL_WRITE_BUF(cself->base, cself->cols[ewseq_cn_QUALITY], &qual[readStart], readLen);
-                    }
-                }
-            }
-        }
-        if( !(cself->options & ewseq_co_NoLabelData) ) {
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_LABEL], data->label);
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_LABEL_START], data->label_start);
-            TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_LABEL_LEN], data->label_len);
-        }
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_READ_TYPE], data->read_type);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_READ_START], data->read_start);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_READ_LEN], data->read_len);
-        TW_COL_WRITE_VAR(cself->base, cself->cols[ewseq_cn_TMP_KEY_ID], data->tmp_key_id);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_SPOT_GROUP], data->spot_group);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_CSKEY], data->cskey);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_READ_FILTER], data->read_filter);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_PLATFORM], data->platform);
-        TW_COL_WRITE(cself->base, cself->cols[ewseq_cn_TI], data->ti);
-        if( rc == 0 ) {
-            rc = TableWriter_CloseRow(cself->base);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_TmpKeyStart(const TableWriterSeq* cself)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->options & ewseq_co_AlignData ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcViolated);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableWriter_CloseCursor(cself->base, 0, NULL)) == 0 ) {
-        TableWriterSeq* self = (TableWriterSeq*)cself;
-        VTable* vtbl = NULL;
-        
-        self->tmpKeyIdFirst = INT64_MAX;
-        self->tmpKeyIdLast = INT64_MIN;
-        memcpy(&self->cols_read_tmpkey, &TableSeqReadTmpKey_cols, sizeof(TableSeqReadTmpKey_cols));
-        if( (rc = TableWriter_GetVTable(cself->base, &vtbl)) == 0 &&
-            (rc = TableReader_Make(&self->tmpkey_reader, vtbl, self->cols_read_tmpkey, 50 * 1024 * 1024)) == 0 ) {
-            memcpy(self->cols_alignd, &TableWriterSeq_cols[ewseq_cn_PRIMARY_ALIGNMENT_ID], sizeof(self->cols_alignd));
-            rc = TableWriter_AddCursor(self->base, self->cols_alignd,
-                                       sizeof(self->cols_alignd) / sizeof(self->cols_alignd[0]),
-                                       &self->alignd_cursor_id);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_TmpKey(const TableWriterSeq* cself, int64_t rowid, uint64_t* key_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || rowid == 0 || key_id == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->tmpkey_reader == NULL ) {
-        rc = RC( rcAlign, rcType, rcReading, rcMode, rcNotOpen);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableReader_ReadRow(cself->tmpkey_reader, rowid)) == 0 ) {
-        memcpy(key_id, cself->cols_read_tmpkey[0].base.var, sizeof(*key_id));
-        if (cself->tmpKeyIdLast < rowid || rowid < cself->tmpKeyIdFirst) {
-            rc = TableReader_PageIdRange(cself->tmpkey_reader, rowid,
-                                        &((TableWriterSeq*)cself)->tmpKeyIdFirst,
-                                        &((TableWriterSeq*)cself)->tmpKeyIdLast);
-            ((TableWriterSeq*)cself)->flush = rc == 0;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC TableWriterSeq_WriteAlignmentData(const TableWriterSeq* cself, int64_t rowid,
-                                                     const TableWriterData* primary_alignment_id,
-                                                     const TableWriterData* alignment_count)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( cself->options & ewseq_co_AlignData ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcViolated);
-        ALIGN_DBGERR(rc);
-    } else if( rowid == 0 ) {
-        rc = TableWriter_Flush(cself->base, cself->alignd_cursor_id);
-    }
-    else if( primary_alignment_id == NULL || alignment_count == NULL ) {
-        rc = RC( rcAlign, rcType, rcWriting, rcParam, rcNull);
-        ALIGN_DBGERR(rc);
-    } else if( (rc = TableReader_ReadRow(cself->tmpkey_reader, rowid)) != 0 ||
-        cself->cols_read_tmpkey[1].len != primary_alignment_id->elements ) {
-        rc = rc ? rc : RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("nreads and primary_alignment_id length %u <> %lu",
-            rc, cself->cols_read_tmpkey[1].len, primary_alignment_id->elements);
-    } else if( primary_alignment_id->elements != alignment_count->elements ) {
-        rc = RC(rcAlign, rcType, rcWriting, rcData, rcInconsistent);
-        ALIGN_DBGERRP("primary_alignment_id and alignment_count length %u <> %lu",
-            rc, primary_alignment_id->elements, alignment_count->elements);
-    }
-    else {
-        if (cself->flush) {
-            rc = TableWriter_Flush(cself->base, cself->alignd_cursor_id);
-            ((TableWriterSeq*)cself)->flush = false;
-        }
-        if( rc == 0 &&
-           (rc = TableWriter_OpenRowId(cself->base, rowid, cself->alignd_cursor_id)) == 0 ) {
-            TW_COL_WRITE(cself->base, cself->cols_alignd[0], *primary_alignment_id);
-            TW_COL_WRITE(cself->base, cself->cols_alignd[1], *alignment_count);
-            if( rc == 0 ) {
-                rc = TableWriter_CloseRow(cself->base);
-            }
-            if (rc == 0/* && (cself->options & ewseq_co_WantMateStats)*/) {
-                rc = TableWriterSeq_CollectStatistics((TableWriterSeq *)cself, primary_alignment_id);
-            }
-        }
-    }
-    return rc;
-}
diff --git a/libs/ascp/Makefile b/libs/ascp/Makefile
deleted file mode 100644
index 59c3a4c..0000000
--- a/libs/ascp/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/ascp
-
-INT_LIBS = \
-    libascp
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# testing framework
-#
-$(ILIBDIR)/libascp: $(addprefix $(ILIBDIR)/libascp.,$(LIBX))
-
-SRC = \
-	ascp \
-	ascp-path \
-	connect
-#	silent-system
-
-OBJ = \
-	$(addsuffix .$(LOBX),$(SRC))
-
-$(ILIBDIR)/libascp.$(LIBX): $(OBJ)
-	$(LD) --slib -o $@ $^ $(LIB)
diff --git a/libs/ascp/ascp-priv.h b/libs/ascp/ascp-priv.h
deleted file mode 100644
index 557adbc..0000000
--- a/libs/ascp/ascp-priv.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_libs_ascp_ascp_priv_
-#define _h_libs_ascp_ascp_priv_
-
-#include <kns/ascp.h> /* EAscpState */
-#include <klib/text.h> /* String */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define STS_INFO 1
-#define STS_DBG 2
-
-typedef enum {
-      eUnknown
-    , eChild
-    , eStart
-    , eLog
-    , eKeyStart
-    , eKeyMayBeIn
-    , eKeyIn
-    , eKeyEnd
-    , eProgress
-    , eWriteFailed
-    , eFailed
-    , eCompleted
-    , eEnd
-} EAscpState;
-
-rc_t ascpParse(const char *buf, size_t len, const char *filename,
-    EAscpState *state, String *line);
-
-bool ascp_path(const char **cmd, const char **key);
-
-rc_t run_ascp(const char *ascp_bin, const char *private_file,
-    const char *src, const char *dest, const AscpOptions *opt);
-
-rc_t mkAscpCmd(const char *ascp_bin, const char *private_file,
-    const char *src, const char *dest, const AscpOptions *opt,
-    char *const argv[], size_t argvSz);
-
-int silent_system(const char *command);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libs/ascp/ascp.c b/libs/ascp/ascp.c
deleted file mode 100644
index d9fae95..0000000
--- a/libs/ascp/ascp.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ==============================================================================
-*
-*/
-
-#include "ascp-priv.h"
-
-#include <kfg/config.h> /* KConfig */
-
-#include <kfs/directory.h> /* KDirectory */
-
-#include <klib/log.h> /* LOGERR */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/printf.h> /* string_vprintf */
-#include <klib/rc.h>
-#include <klib/status.h> /* STSMSG */
-
-#include <sysalloc.h> /* free */
-
-#include <assert.h>
-#include <stdlib.h> /* free */
-#include <string.h> /* memset */
-
-#define DISP_RC(rc, err) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, err))
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-#define STS_INFO 1
-#define STS_FIN 3
-
-static bool _StringStartsWith(const String *self, const char *buf) {
-    size_t len = 0;
-    assert(self && buf);
-    len = string_size(buf);
-    assert(len);
-/*printf("_StringStartsWith(%.*s, %s)\n", self->len, self->addr, buf);*/
-    if (self->len < len) {
-        return false;
-    }
-    return string_cmp(self->addr, self->len, buf, len, len) == 0;
-}
-
-static
-bool _StringHas(const String *self, const char *buf, String *res)
-{
-    String dummy;
-    size_t len = 0;
-    assert(self && buf);
-    if (res == NULL) {
-        res = &dummy;
-    }
-    len = string_size(buf);
-    assert(len);
-    StringInit(res, self->addr, self->size, self->len);
-    while (true) {
-        if (res->len < len) {
-            StringInit(res, NULL, 0, 0);
-            return false;
-        }
-        if (_StringStartsWith(res, buf)) {
-            res->len = res->size = len;
-            return true;
-        }
-        res->len = res->size = res->len - 1;
-        ++res->addr;
-    }
-}
-
-typedef struct {
-    EAscpState s;
-    char *msg;
-    bool failure;
-} SAscpState;
-static void SAscpStateFini(SAscpState *self) {
-    assert(self);
-
-/* #if ! WINDOWS #endif */
-    free(self->msg);
-
-    memset(self, 0, sizeof *self);
-}
-
-static bool sStatus = false;
-
-static rc_t parseAscpLine(const String *s, SAscpState *state, const char *name)
-{
-    bool debug = true;
-    if (!sStatus) {
-        debug = false;
-    }
-
-    assert(s && state);
-
-    memset(state, 0, sizeof *state);
-
-    if (_StringHas(s, "CHILD: ", NULL)) {
-        if (sStatus) {
-            OUTMSG(("%.*s\n",  s->len, s->addr));
-        }
-        state->s = eChild;
-    }
-    else if (_StringStartsWith(s, "Cannot open log file: ")) {
-        if (debug) OUTMSG(("matched: LOG: '%.*s'\n", s->len, s->addr));
-        state->s = eLog;
-    }
-    else if (_StringStartsWith(s, "The server's host key is not")) {
-        if (debug) OUTMSG(("matched: KeySTART: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyStart;
-    }
-    else if (_StringHas(s, "no guarantee that the server is th", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "think it is.", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "The server's rsa2 key fingerprint ", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "ssh-rsa 1024 ", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "If you trust this host, enter ", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "PuTTY's cache and carry on connect", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "If you want to carry on connecting", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "adding the key to the cache, enter", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, " you do not trust this host, press", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "connection.", NULL)) {
-        if (debug) OUTMSG(("matched: KeyIN: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyIn;
-    }
-    else if (_StringHas(s, "Store key in cache? (y/n) ", NULL)) {
-        if (debug) OUTMSG(("matched: KeyEND: '%.*s'\n", s->len, s->addr));
-        state->s = eKeyEnd;
-    }
-    else if (string_chr(s->addr, s->len, '%') != NULL) {
-        if (debug) OUTMSG(("matched: PROGRESS: '%.*s'\n", s->len, s->addr));
-        state->s = eProgress;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringStartsWith(s, "Completed: ")) {
-        if (debug) OUTMSG(("matched: COMPLETED: '%.*s'\n", s->len, s->addr));
-        state->s = eCompleted;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringStartsWith(s, "Partial Completion: ")) {
-        if (debug) OUTMSG(("matched: END: '%.*s'\n", s->len, s->addr));
-        state->s = eEnd;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }    
-    else if (_StringStartsWith(s, "Connection abandoned.")) {
-/* printed in caller     printf("matched: END: '%.*s'\n", s->len, s->addr); */
-        state->s = eFailed;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringHas(s, "failed to open connection to remot", NULL)) {
-/* printed in caller       printf("matched: END: '%.*s'\n", s->len, s->addr); */
-        state->s = eFailed;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringHas(s, "exiting", NULL)) {
-        state->s = eFailed;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringStartsWith(s, "Session Stop  (Error: Disk write ")) {
-   if (debug) OUTMSG(("matched: Disk write failed: '%.*s'\n", s->len, s->addr));
-        state->s = eWriteFailed;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringStartsWith(s, "Session Stop ")) {
-        if (debug) OUTMSG(("matched: COMPLETED: '%.*s'\n", s->len, s->addr));
-        state->s = eFailed;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringHas(s, " bits/sec), in 1 file", NULL)) {
-        if (debug) OUTMSG(("matched: END: '%.*s'\n", s->len, s->addr));
-        state->s = eEnd;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else if (_StringStartsWith(s, name)) {
-        /* in the beginning:
-           line starting by dest file name, then some white characters */
-        if (debug) OUTMSG(("matched: PROGRESS: '%.*s'\n", s->len, s->addr));
-        state->s = eProgress;
-        if ((state->msg = string_dup(s->addr, s->len)) == NULL) {
-            return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-    else {
-        OUTMSG(("LINE = (%d) '%.*s'\n", s->len, s->len, s->addr));
-/*      assert(0); */
-    }
-    return 0;
-}
-
-rc_t ascpParse(const char *buf, size_t len, const char *filename,
-    EAscpState *state, String *line)
-{
-    bool failure = false;
-    const char *p = buf;
-    int64_t l = len;
-    assert(buf && len && filename && state && line);
-    StringInit(line, NULL, 0, 0);
-    while (true) {
-        const char *n = string_chr(p, l, '\n');
-        const char *r = string_chr(p, l, '\r');
-        if (n == NULL) {
-            if (r != NULL) {
-                n = r;
-            }
-        }
-        else {
-            if (r != NULL) {
-                if (r < n) {
-                    n = r;
-                }
-            }
-        }
-        if (n != NULL) {
-            StringInit(line, p, n - p, n - p);
-            l -= n - p + 1;
-        }
-        else {
-            StringInit(line, p, l, l);
-        }
-        if (line->addr && line->len && line->addr[line->len - 1] == '\r') {
-            line->len = line->size = line->len - 1;
-        }
-        if (line->addr && line->len && line->addr[0] == '\r') {
-            ++line->addr;
-            line->len = line->size = line->len - 1;
-        }
-        if (line->len != 0) {
-            SAscpState full;
-            rc_t rc = parseAscpLine(line, &full, filename);
-            if (rc != 0) {
-                return rc;
-            }
-            switch (full.s) {
-                case eChild:
-                    break;
-                case eUnknown:
-                    switch (*state) {
-                        case eKeyStart:
-                        case eKeyMayBeIn:
-                        case eKeyIn:
-                            *state = eKeyMayBeIn;
-                            break;
-                        case eCompleted:
-                        case eFailed:
-                        case eWriteFailed:
-                            *state = eEnd;
-                            /* report to user */
-                            break;
-                        case eProgress:
-                            if (sStatus) {
-                                OUTMSG(("\n"));
-                            }
-/*                          no break; */
-                        default:
-                            *state = eUnknown;
-                            /* report to user */
-                            break;
-                    }
-                    break;
-                case eFailed:
-                    if (*state == eProgress) {
-                        if (sStatus) {
-                            OUTMSG(("\n"));
-                        }
-                    }
-                    failure = true;
-                    *state = full.s;
-                    if (sStatus) {
-                        OUTMSG(("%s\n", full.msg));
-                    }
-/*                  no break; */
-                    break;
-                case eWriteFailed:
-                    if (*state == eProgress) {
-                        if (sStatus) {
-                            OUTMSG(("\n"));
-                        }
-                    }
-                    failure = true;
-                    *state = full.s;
-                    if (sStatus) {
-                        OUTMSG(("%s\n", full.msg));
-                    }
-/*                  no break; */
-                    break;
-                case eCompleted:
-                    if (*state == eProgress) {
-                        if (sStatus) {
-                            OUTMSG(("\n"));
-                        }
-                    }
-                    failure = false;
-                    *state = full.s;
-                    if (sStatus) {
-                        OUTMSG(("%s\n", full.msg));
-                    }
-/*                  no break; */
-                    break;
-                case eProgress:
-                    if (*state == eProgress) {
-                        if (sStatus) {
-                            OUTMSG(("\r"));
-                        }
-                    }
-                    *state = full.s;
-                    if (sStatus) {
-                        OUTMSG(("%s", full.msg));
-                    }
-                    break;
-                case eEnd:
-                    if (*state == eProgress) {
-                        if (sStatus) {
-                            OUTMSG(("\n"));
-                        }
-                    }
-                    *state = full.s;
-                    if (sStatus) {
-                        OUTMSG(("%s\n", full.msg));
-                    }
-                    /* report to user */
-                    break;
-                default:
-                    *state = full.s;
-                    break;
-            }
-            SAscpStateFini(&full);
-        }
-        if (n == NULL || l <= 0) {
-            break;
-        }
-        if (*state == eKeyEnd) {
-            String end;
-            if (_StringHas(line, "Store key in cache? (y/n) ", &end)) {
-                if (n > end.addr + end.len) {
-                    l += n - end.addr + end.len;
-                    n = end.addr + end.len - 1;
-                }
-            }
-        }
-        p = n + 1;
-        if (p >= buf + len) {
-            break;
-        }
-    }
-    if (sStatus) {
-        STSMSG(STS_FIN, ("%.*s", len, buf));
-    }
-    return 0;
-}
-
-static bool _KConfigAscpDisabled(const KConfig *self, bool status) {
-    bool disabled = false;
-    const char path[] = "tools/ascp/disabled";
-    rc_t rc = KConfigReadBool(self, path, &disabled);
-    if (rc != 0) {
-        if (rc != SILENT_RC(rcKFG, rcNode, rcOpening, rcPath, rcNotFound)) {
-            DISP_RC(rc, path);
-        }
-        else {
-            if (status) {
-                STSMSG(STS_DBG, ("'%s': not found in configuration", path));
-            }
-        }
-        disabled = false;
-    }
-    else {
-        if (status) {
-            STSMSG(STS_DBG, ("'%s' = '%s'", path, disabled ? "true" : "false"));
-        }
-    }
-    return disabled;
-}
-
-static String* _KConfigAscpString(const KConfig *self,
-    const char *path, const char *name)
-{
-    String *ascp = NULL;
-    rc_t rc = KConfigReadString(self, path, &ascp);
-    if (rc == 0) {
-        assert(ascp);
-/*      STSMSG(STS_INFO, ("Using %s from configuration: '%s'",
-            name, ascp->addr)); */
-        return ascp;
-    }
-    else {
-        if (rc != SILENT_RC(rcKFG, rcNode, rcOpening, rcPath, rcNotFound)) {
-            DISP_RC(rc, path);
-        }
-        else {
-/*          STSMSG(STS_DBG, ("'%s': not found in configuration", path)); */
-        }
-        free(ascp);
-        return NULL;
-    }
-}
-
-/******************************************************************************/
-
-static int _SilentSystem(const char *fmt, ...) {
-    rc_t rc = 0;
-    char buffer[4096];
-    size_t num_writ = 0;
-    va_list args;
-    va_start(args, fmt);
-    rc = string_vprintf(buffer, sizeof buffer, &num_writ, fmt, args);
-    va_end(args);
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "while making ascp command line");
-        return 1;
-    }
-    return silent_system(buffer);
-}
-
-static bool _SystemHelp(const char *command, bool status) {
-    int value = 0;
-    if (status) {
-        STSMSG(STS_DBG, ("Checking '%s'", command));
-    }
-    value = _SilentSystem("\"%s\" -h", command);
-    if (value == 0) {
-        if (status) {
-            STSMSG(STS_INFO, ("Using '%s'", command));
-        }
-        return true;
-    }
-    else {
-        if (status) {
-            STSMSG(STS_DBG, ("'%s': not found", command));
-        }
-        return false;
-    }
-}
-
-static rc_t _KConfigGetAscp(const KConfig *self,
-    const char **ascp_bin, const char **private_file)
-{
-    String *bin = NULL;
-    String *key = NULL;
-    assert(self && ascp_bin && private_file);
-    *ascp_bin = *private_file = NULL;
-    bin = _KConfigAscpString(self, "tools/ascp/path", "ascp");
-    key = _KConfigAscpString(self, "tools/ascp/key", "Aspera key");
-    if (bin != NULL && key != NULL) {
-        *ascp_bin = string_dup_measure(bin->addr, NULL);
-        *private_file = string_dup_measure(key->addr, NULL);
-        free(bin);
-        free(key);
-        if (*ascp_bin == NULL || *private_file == NULL) {
-            free((void*)*ascp_bin);
-            free((void*)*private_file);
-            *ascp_bin = *private_file = NULL;
-            return RC(rcNS, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-        return 0;
-    }
-    free(bin);
-    free(key);
-    return 0;
-}
-static bool _KDirectoryFileFound(const KDirectory *self,
-    const char *path, bool status)
-{
-    KPathType type = kptNotFound;
-    if (status) {
-        STSMSG(STS_DBG, ("Checking '%s'", path));
-    }
-    type = KDirectoryPathType(self, path);
-    if ((type & ~kptAlias) == kptFile) {
-        if (status) {
-            STSMSG(STS_DBG, ("'%s': found", path));
-        }
-        return true;
-    }
-    else {
-        if (status) {
-            STSMSG(STS_DBG, ("'%s': not found", path));
-        }
-        return false;
-    }
-}
-
-LIB_EXPORT rc_t CC ascp_locate(const char **ascp_bin, const char **private_file,
-    bool use_config, bool status)
-{
-    rc_t rc = 0;
-    KConfig *cfg = NULL;
-    if (ascp_bin == NULL || private_file == NULL) {
-        return RC(rcNS, rcFile, rcCopying, rcParam, rcNull);
-    }
-    *ascp_bin = *private_file = NULL;
-    rc = KConfigMake(&cfg, NULL);
-    if (rc != 0) {
-        return rc;
-    }
-    if (_KConfigAscpDisabled(cfg, status)) {
-        if (status) {
-            STSMSG(STS_INFO, ("Use of Aspera transfer is disabled "
-                "by the configuration, using HTTP transfer"));
-        }
-    }
-    else {
-        KDirectory *dir = NULL;
-        const char *bin = NULL;
-        const char *key = NULL;
-        rc = _KConfigGetAscp(cfg, ascp_bin, private_file);
-        if (*ascp_bin != NULL) {
-            assert(*private_file && !rc);
-            RELEASE(KConfig, cfg);
-            return 0;
-        }
-        rc = KDirectoryNativeDir(&dir);
-        if (rc != 0) {
-            return rc;
-        }
-        while (ascp_path(&bin, &key)) {
-            if (_SystemHelp(bin, status)) {
-                if (_KDirectoryFileFound(dir, key, status)) {
-                    *ascp_bin = string_dup_measure(bin, NULL);
-                    *private_file = string_dup_measure(key, NULL);
-                    if (*ascp_bin == NULL || *private_file == NULL) {
-                        free((void*)*ascp_bin);
-                        free((void*)*private_file);
-                        *ascp_bin = *private_file = NULL;
-                        return RC(rcNS,
-                            rcStorage, rcAllocating, rcMemory, rcExhausted);
-                    }
-                    break;
-                }
-            }
-        }
-        RELEASE(KDirectory, dir);
-    }
-    RELEASE(KConfig, cfg);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC aspera_get(
-    const char *ascp_bin, const char *private_file, const char *src,
-    const char *dest, AscpOptions *opt)
-{
-    AscpOptions dummy;
-    bool status = false;
-    uint64_t prev = 0;
-    int attempt = 0;
-    KDirectory *dir = NULL;
-    TQuitting *quitting = NULL;
-    rc_t rc = KDirectoryNativeDir(&dir);
-    if (rc != 0) {
-        return rc;
-    }
-    if (ascp_bin == NULL || private_file == NULL ||
-        src == NULL || dest == NULL)
-    {
-        return RC(rcNS, rcFile, rcCopying, rcParam, rcNull);
-    }
-    if (opt == NULL) {
-        memset(&dummy, 0, sizeof dummy);
-        opt = &dummy;
-    }
-
-    sStatus = status = opt->status;
-    quitting = opt->quitting;
-
-    while (true) {
-        rc = run_ascp(ascp_bin, private_file, src, dest, opt);
-        if (rc == 0) {
-            if (status) {
-                STSMSG(STS_DBG, ("ascp finished with success"));
-            }
-            break;
-        }
-        else if (rc == SILENT_RC(rcExe,
-            rcProcess, rcExecuting, rcMemory, rcExhausted))
-        {
-            if (status) {
-                STSMSG(STS_DBG, ("ascp failed: %R", rc));
-            }
-            break;
-        }
-        else {
-            rc_t rc = 0;
-            uint64_t size = 0;
-            if (quitting != NULL) {
-                rc = quitting();
-                if (rc != 0) {
-                    break;
-                }
-            }
-            if (status) {
-                STSMSG(STS_DBG, ("ascp failed: %R", rc));
-            }
-            rc = KDirectoryFileSize(dir, &size, dest);
-            if (rc != 0 || size < prev) {
-            if (status) {
-STSMSG(0, ("KDirectoryFileSize after ascp run: "
-"rc = %ld, size = %ld", rc, size));
-            }
-                break;
-            }
-            else if (size > prev) {
-                if (status) {
-                    STSMSG(STS_INFO, ("  fasp download failed. %ld bytes "
-                        "received so far. Retrying...", size));
-                }
-                attempt = 0;
-                prev = size;
-            } else {
-                if (attempt++ > 3) {
-                    break;
-                }
-                if (status) {
-                    STSMSG(STS_INFO, ("  fasp download failed. %ld bytes "
-                        "received so far. Retrying %d...", size, attempt));
-                }
-            }
-        }
-    }
-    RELEASE(KDirectory, dir);
-    return rc;
-}
-
-rc_t mkAscpCmd(const char *ascp_bin, const char *private_file,
-    const char *src, const char *dest, const AscpOptions *opt,
-    char *const argv[], size_t argvSz)
-{
-    rc_t rc = 0;
-    return rc;
-}
diff --git a/libs/ascp/linux/ascp-path.c b/libs/ascp/linux/ascp-path.c
deleted file mode 100644
index 362b0bd..0000000
--- a/libs/ascp/linux/ascp-path.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "ascp-priv.h" /* ascp_path */
-#include <klib/printf.h> /* string_printf */
-#include <assert.h>
-#include <limits.h> /* PATH_MAX */
-#include <stdlib.h> /* getenv */
-
-bool ascp_path(const char **cmd, const char **key) {
-    static int idx = 0;
-    static const char k[] = "/opt/aspera/etc/asperaweb_id_dsa.putty";
-    static const char *c[]
-        = { "ascp", "/usr/bin/ascp", "/opt/aspera/bin/ascp" };
-    assert(cmd && key);
-    if (idx < sizeof c / sizeof c[0]) {
-        *cmd = c[idx];
-        *key = k;
-        ++idx;
-        return true;
-    }
-    else if (idx == sizeof c / sizeof c[0]) {
-        rc_t rc = 0;
-        static char k[PATH_MAX] = "";
-        static char c[PATH_MAX] = "";
-        if (k[0] == '\0') {
-            size_t num_writ = 0;
-            const char* home = getenv("HOME");
-            if (home == NULL) {
-                home = "";
-            }
-            rc = string_printf(k, sizeof k, &num_writ,
-                    "%s/.aspera/connect/etc/asperaweb_id_dsa.putty", home);
-            if (rc != 0 || num_writ >= PATH_MAX) {
-                assert(0);
-                k[0] = '\0';
-            }
-            else {
-                rc = string_printf(c, sizeof c, &num_writ,
-                    "%s/.aspera/connect/bin/ascp", home);
-                if (rc != 0 || num_writ >= PATH_MAX) {
-                    assert(0);
-                    c[0] = '\0';
-                }
-            }
-        }
-        if (rc != 0) {
-            *cmd = *key = NULL;
-            idx = 0;
-            return false;
-        }
-        else {
-            *cmd = c;
-            *key = k;
-            ++idx;
-            return true;
-        }
-    }
-    else {
-        *cmd = *key = NULL;
-        idx = 0;
-        return false;
-    }
-}
\ No newline at end of file
diff --git a/libs/ascp/mac/ascp-path.c b/libs/ascp/mac/ascp-path.c
deleted file mode 100644
index f5ed131..0000000
--- a/libs/ascp/mac/ascp-path.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "ascp-priv.h" /* ascp_path */
-#include <klib/printf.h> /* string_printf */
-#include <assert.h>
-#include <limits.h> /* PATH_MAX */
-#include <stdlib.h> /* getenv */
-
-bool ascp_path(const char **cmd, const char **key) {
-    static int idx = 0;
-    static const char k[] = "/Applications/Aspera Connect.app/Contents/"
-        "Resources/asperaweb_id_dsa.putty";
-    static const char c[] = "/Applications/Aspera Connect.app/Contents/"
-        "Resources/ascp";
-    assert(cmd && key);
-    if (idx == 0) {
-        ++idx;
-        *cmd = c;
-        *key = k;
-        return true;
-    }
-    else if (idx == 1) {
-        rc_t rc = 0;
-        static char k[PATH_MAX] = "";
-        static char c[PATH_MAX] = "";
-        if (k[0] == '\0') {
-            size_t num_writ = 0;
-            const char* home = getenv("HOME");
-            if (home == NULL) {
-                home = "";
-            }
-            rc = string_printf(k, sizeof k, &num_writ,
- "%s/Applications/Aspera Connect.app/Contents/Resources/asperaweb_id_dsa.putty"
-                , home);
-            if (rc != 0 || num_writ >= PATH_MAX) {
-                assert(0);
-                k[0] = '\0';
-            }
-            else {
-                rc = string_printf(c, sizeof c, &num_writ,
- "%s/Applications/Aspera Connect.app/Contents/Resources/ascp"
-                   , home);
-                if (rc != 0 || num_writ >= PATH_MAX) {
-                    assert(0);
-                    c[0] = '\0';
-                }
-            }
-        }
-        if (rc != 0) {
-            *cmd = *key = NULL;
-            idx = 0;
-            return false;
-        }
-        else {
-            *cmd = c;
-            *key = k;
-            ++idx;
-            return true;
-        }
-        return true;
-    }
-    else {
-        idx = 0;
-        *cmd =  *key = NULL;
-        return false;
-    }
-}
\ No newline at end of file
diff --git a/libs/ascp/unix/connect.c b/libs/ascp/unix/connect.c
deleted file mode 100644
index 002c264..0000000
--- a/libs/ascp/unix/connect.c
+++ /dev/null
@@ -1,555 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "ascp-priv.h" /* STS_DBG */
-
-#include <kfs/directory.h> /* KDirectory */
-
-#include <klib/time.h> /* KTimeStamp */
-#include <klib/printf.h> /* string_printf */
-#include <klib/text.h> /* string_copy */
-#include <klib/log.h> /* LOGERR */
-#include <klib/status.h> /* STSMSG */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/rc.h> /* RC */
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h> /* open */
-#include <signal.h> /* kill */
-#include <stdlib.h> /* system */
-#include <stdio.h> /* fflush */
-#include <unistd.h> /* dup */
-#include <sys/wait.h> /* waitpid */
-
-#define DISP_RC(rc, err) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, err))
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-static int logevp(const char *file, char *const argv[]) {
-    int result = 0;
-    if (STS_INFO > KStsLevelGet()) {
-        return 0;
-    }
-    result = printf("%s", file);
-    while (true) {
-        int res = printf(" %s", *argv);
-        if (result >= 0) {
-            if (res < 0) {
-                result = res;
-            }
-            else {
-                result += res;
-            }
-        }
-        if (*(++argv) == NULL) {
-            break;
-        }
-    }
-    printf("\n");
-    return result;
-}
-
-static
-uint64_t humanize(uint64_t number, char *sfx, uint64_t *fraction)
-{
-    assert(sfx);
-    if (fraction != NULL) {
-        *fraction = 0;
-    }
-    *sfx = 'B';
-    if (number > 1024L * 1024L * 1024L) {
-        if (fraction != NULL) {
-            number *= 1000;
-        }
-        number /=     1024L * 1024L * 1024L;
-        if (fraction != NULL) {
-            *fraction = number % 1000;
-            number /= 1000;
-        }
-        *sfx = 'G';
-    }
-    else if (number > 1024L * 1024L) {
-        number /=     1024L * 1024L;
-        *sfx = 'M';
-    }
-    else if (number > 1024) {
-        number /=     1024;
-        *sfx = 'K';
-    }
-    return number;
-}
-
-static void progress(const char *acc, uint64_t sz,
-    uint64_t srcSz, uint64_t hSrc, char sfSrc, KTime_t date)
-{
-    if (sz > 0) {
-        if (srcSz > 0) {
-            uint64_t p = 100 * sz / srcSz;
-            char sf = 'B';
-            uint64_t fr = 0;
-            uint64_t h = humanize(sz, &sf, &fr);
-            if (p > 0) {
-                if (sfSrc != 'B' && sf != 'B') {
-                    if (fr == 0) {
-                        if (date == 0) {
-                            OUTMSG(("%s %,ld/%,ld %ld%c/%,ld%c %ld%%        \r",
-                                    acc, sz, srcSz, h,sf,hSrc,sfSrc,p));
-                        }
-                        else {
-                            OUTMSG(("%s %,ld/%,ld %ld%c/%,ld%c %ld%% %ld    \r",
-                                    acc, sz, srcSz, h,sf,hSrc,sfSrc,p,
-                                    KTimeStamp() - date));
-                        }
-                    }
-                    else {
-                        OUTMSG(("%s %,ld/%,ld %ld.%03ld%c/%,ld%c %ld%%      \r",
-                                acc, sz, srcSz,h,fr,sf,hSrc,sfSrc,p));
-                    }
-                }
-                else {
-                    OUTMSG(("%s %,ld/%,ld %ld%%                             \r",
-                        acc, sz, srcSz, p));
-                }
-            }
-            else {
-                if (sfSrc != 'B' && sf != 'B') {
-                    if (fr == 0) {
-                        OUTMSG((
-                        "%s %,ld/%,ld %ld%c/%ld%c                           \r",
-                         acc, sz,srcSz,h, sf,hSrc,sfSrc));
-                    }
-                    else {
-                        OUTMSG((
-                        "%s %,ld/%,ld %ld.%03ld%c/%ld%c                     \r",
-                         acc, sz,srcSz,h, fr,sf,hSrc,sfSrc));
-                    }
-                }
-                else {
-                    OUTMSG(("%s %,ld/%,ld                 \r", acc, sz, srcSz));
-                }
-            }
-        }
-        else {
-            OUTMSG(("%s %,ld                                     \r", acc, sz));
-        }
-    }
-    else {
-        OUTMSG(("                                                \r%s\r", acc));
-    }
-}
-
-/******************************************************************************/
-rc_t run_ascp(const char *path, const char *key,
-    const char *src, const char *dest, const AscpOptions *opt)
-{
-    const char *host = NULL;
-    const char *user = NULL;
-    const char *maxRate = NULL;
-    bool cache_key = false;
-    uint64_t heartbeat = 0;
-    const char *acc = NULL;
-    uint64_t srcSz = 0;
-    uint64_t id = 0;
-    TProgress *callback = NULL;
-    TQuitting *quitting = NULL;
-    rc_t rc = 0;
-    pid_t nPid = 0;
-    int pipeto[2];      /* pipe to feed the exec'ed program input */
-    int pipefrom[2];    /* pipe to get the exec'ed program output */
-    char *argv[64];
-
-    int i = 0;
-    int ret = 0;
-    i = 0;
-
-    if (opt != NULL) {
-        acc = opt->name;
-        cache_key = opt->cache_key;
-        callback = opt->callback;
-        heartbeat = opt->heartbeat;
-        host = opt->host;
-        id = opt->id;
-        maxRate = opt->target_rate;
-        quitting = opt->quitting;
-        srcSz = opt->src_size;
-        user = opt->user;
-    }
-
-    if (acc == NULL) {
-        acc = dest;
-    }
-
-    if (heartbeat > 0) {
-        heartbeat /= 1000;
-        if (heartbeat == 0) {
-            heartbeat = 1;
-        }
-    }
-
-    if (pipe(pipeto) != 0) {
-        perror("pipe() to");
-        rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "while pipe");
-        return rc;
-    }
-    if (pipe(pipefrom) != 0) {
-        perror("pipe() from");
-        rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "while pipe");
-        return rc;
-    }
-
-    argv[i++] = (char*)path;
-    argv[i++] = "-i";
-    argv[i++] = (char*)key;
-    argv[i++] = "-pQTk1";
-    if (maxRate != NULL) {
-        argv[i++] = "-l";
-        argv[i++] = (char*)maxRate;
-    }
-    if (user != NULL) {
-        argv[i++] = "--user";
-        argv[i++] = (char*)user;
-    }
-    if (host != NULL) {
-        argv[i++] = "--host";
-        argv[i++] = (char*)user;
-    }
-    argv[i++] = (char*)src;
-    argv[i++] = (char*)dest;
-    argv[i++] = NULL;
-
-    logevp(path, argv);
-
-    if (quitting) {
-        rc = quitting();
-    }
-    if (rc != 0) {
-        return rc;
-    }
-
-    nPid = fork();
-    if (nPid < 0 ) {
-        perror("fork() 1");
-        rc = RC(rcExe, rcProcess, rcCreating, rcProcess, rcFailed);
-        LOGERR(klogErr, rc, "after fork");
-        return rc;
-    }
-    else if (nPid == 0) {
-        /* dup pipe read/write to stdin/stdout */
-        dup2(pipeto  [0], STDIN_FILENO);
-        dup2(pipefrom[1], STDOUT_FILENO);
-        dup2(pipefrom[1], STDERR_FILENO);
-        close(pipeto[1]);
-        ret = execvp(path, argv);
-        STSMSG(STS_DBG, ("CHILD: Done %s %s %s = %d", path, src, dest, ret));
-        exit(EXIT_FAILURE);
-    }
-    else {
-        bool progressing = false;
-        bool writeFailed = false;
-        EAscpState state = eStart;
-        const char y[] = "y\n";
-        const char n[] = "n\n";
-        int status = 0;
-        int w = 0;
-        int fd = pipefrom[0];
-        const char *answer = n;
-        String line;
-        StringInit(&line, NULL, 0, 0);
-        if (cache_key) {
-            answer = y;
-        }
-
-        {
-            int flags = fcntl(fd, F_GETFL, 0);
-            fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-        }
-
-        close(pipeto[0]);
-        close(pipefrom[1]);
-        assert(sizeof y == sizeof n);
-
-        {
-            int hang = 0;
-            uint64_t prev = 0;
-            KTime_t tPrev = 0;
-            char sfSrc = 'B';
-            uint64_t hSrc = humanize(srcSz, &sfSrc, NULL);
-            int sig = 0;
-            uint64_t i = 0;
-            KDirectory *dir = NULL;
-            rc_t rc = KDirectoryNativeDir(&dir);
-            DISP_RC(rc, "KDirectoryNativeDir");
-            if (rc != 0) {
-                return rc;
-            }
-            while (w == 0) {
-                bool quit = false;
-                w = waitpid(nPid, &status, WNOHANG);
-                if (w == 0) {
-                    bool got = false;
-                    rc_t rc = 0;
-                    if (quitting) {
-                        rc = quitting();
-                    }
-                    if (rc != 0 || quit) {
-                        if (sig == 0) {
-                            sig = SIGINT;
-                        }
-                        else if (sig >= SIGKILL) {
-                            break;
-                        }
-                        else {
-                            ++sig;
-                        }
-                        if (progressing) {
-                            OUTMSG(("\n"));
-                        }
-                        PLOGMSG(klogInfo, (klogInfo, "^C pressed: "
-                            "Senging $(sgn) to ascp", "sgn=%s", sig));
-                        kill(nPid, sig);
-                    }
-                    while (true) {
-                        char buf[4096];
-                        int s = read(fd, buf, sizeof buf);
-                        if (s == 0) {
-                            break;
-                        }
-                        else if (s < 0) {
-                            if (errno != EAGAIN) {
-                                if (progressing) {
-                                    OUTMSG(("\n"));
-                                }
-                                perror("read(child)");
-                            }
-                            break;
-                        }
-                        ascpParse(buf, s, dest, &state, &line);
-                        switch (state) {
-                            case eKeyEnd:
-                                write(pipeto[1], answer, sizeof y - 1);
-                                break;
-                            case eWriteFailed:
-                                writeFailed = true;
-                                break;
-                            default:
-                                break;
-                        }
-                        got = true;
-                    }
-                    if (!got) {
-                        sleep(1);
-                        ++i;
-                        if ((heartbeat > 0 && i >= heartbeat) || (i > 99)) {
-                            uint64_t size = 0;
-                            rc_t rc = KDirectoryFileSize(dir, &size, dest);
-                            if (rc != 0) {
-                                size = 0;
-                            }
-                            else {
-                                if (size != prev) {
-                                   prev = size;
-                                   tPrev = 0;
-                                   hang = 0;
-                                }
-                                else {
-                                    KTime_t date = 0;
-                                    rc_t rc = KDirectoryDate(dir, &date, dest);
-                                    if (rc == 0) {
-                                        tPrev = date;
-                                        if ((KTimeStamp() - date) > 60 * 99) {
-                                            /* no file update during 99' */
-                                            if (hang == 0) {
-                                                write(pipeto[1],
-                                                    answer, sizeof y - 1);
-                                                ++hang;
-                                            }
-                                            else if (hang < 9) {
-                                                ++hang;
-                                                sig = 0;
-                                            }
-                                            else {
-                                                if (sig == 0) {
-                                                    sig = SIGINT;
-                                                }
-                                                else {
-                                                    ++sig;
-                                                }
-                                                if (progressing) {
-                                                   OUTMSG(("\n"));
-                                                }
-                                                if (sig > SIGKILL) {
-                                                   rc = RC(rcExe,
-                                                       rcProcess, rcExecuting,
-                                                       rcProcess,rcDetached);
-                                                   return rc;
-                                                }
-
-                                                PLOGMSG(klogInfo, (klogInfo,
-                                                    "Senging $(sgn) to ascp",
-                                                    "sgn=%s", sig));
-                                                kill(nPid, sig);
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                            if (heartbeat > 0) {
-                                if (callback) {
-                                    quit = !callback(id,
-                                        eAscpStateRunning, size, 0);
-                                }
-                                else {
-                                    progress(acc, size, srcSz, hSrc, sfSrc,
-                                        tPrev);
-                                }
-                                progressing = true;
-                            }
-                            i = 0;
-                        }
-                    }
-                }
-            }
-            RELEASE(KDirectory, dir);
-        }
-
-        if (progressing) {
-            OUTMSG(("\n"));
-        }
-
-        while (1) {
-            char buf[4096];
-            int s = read(fd, buf, sizeof buf);
-            if (s == 0) {
-                break;
-            }
-            else if (s < 0) {
-                if (errno != EAGAIN) {
-                    perror("read(child)");
-                    break;
-                }
-                continue;
-            }
-            ascpParse(buf, s, dest, &state, &line);
-            if (state == eWriteFailed) {
-                writeFailed = true;
-            }
-        }
-        STSMSG(    STS_DBG, ("ascp exited with pid=%d status=%d", w, status));
-        if (WIFEXITED(status)) {
-            STSMSG(STS_DBG, ("ascp exited with exit status %d",
-                WEXITSTATUS(status)));
-        }
-        else {
-            STSMSG(STS_DBG, ("ascp has not terminated correctly"));
-        }
-        if (w == -1) {
-            perror("waitpid");
-            rc = RC(rcExe, rcProcess, rcWaiting, rcProcess, rcFailed);
-            LOGERR(klogErr, rc, "after waitpid");
-            exit(EXIT_FAILURE);
-        }
-        if (WIFEXITED(status)) {
-    	    if (WEXITSTATUS(status) == 0) {
-	            STSMSG(STS_DBG, ("ascp succeed"));
-                if (callback) {
-                    callback(id, eAscpStateExitSuccess, 0, 0);
-                }
-            } else if (writeFailed) {
-                rc = RC(rcExe, rcProcess, rcExecuting, rcMemory, rcExhausted);
-                if (callback) {
-                    callback(id, eAscpStateExitWriteFailure, 0, 0);
-                }
-            }
-            else {
-                if (rc == 0) {
-                    rc = RC(rcExe, rcProcess, rcWaiting, rcProcess, rcFailed);
-                }
-                PLOGERR(klogErr, (klogErr, rc,
-                    "ascp failed with $(ret)", "ret=%d", WEXITSTATUS(status)));
-                if (callback) {
-                    callback(id, eAscpStateExitFailure, 0, 0);
-                }
-            }
-        } else if (WIFSIGNALED(status)) {
-            if (rc == 0) {
-                if (quitting) {
-                    rc = quitting();
-                    if (rc == 0) {
-                        rc = RC(rcExe,
-                            rcProcess, rcWaiting, rcProcess, rcFailed);
-                    }
-                }
-            }
-            if (rc != SILENT_RC(rcExe, rcProcess, rcExecuting,
-                rcProcess, rcCanceled))
-            {
-                PLOGERR(klogErr, (klogErr, rc, "ascp killed by signal $(sig)",
-                    "sig=%d", WTERMSIG(status)));
-                if (callback) {
-                    callback(id, eAscpStateExitFailure, 0, 0);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-int silent_system(const char *command) {
-    int ret = 0;
-
-    int oldOut = 0;
-    int youngOut = 0;
-    int oldErr = 0;
-    int youngErr = 0;
-
-    fflush(stdout);
-    oldOut = dup(STDOUT_FILENO);
-    youngOut = open("/dev/null", O_WRONLY);
-    dup2(youngOut, STDOUT_FILENO);
-    close(youngOut);
-
-    fflush(stderr);
-    oldErr = dup(STDERR_FILENO);
-    youngErr = open("/dev/null", O_WRONLY);
-    dup2(youngErr, STDERR_FILENO);
-    close(youngErr);
-
-    ret = system(command);
-
-    fflush(stdout);
-    dup2(oldOut, STDOUT_FILENO);
-    close(oldOut);    
-
-    fflush(stderr);
-    dup2(oldErr, STDERR_FILENO);
-    close(oldErr);    
-
-    return ret;
-}
diff --git a/libs/ascp/win/ascp-path.c b/libs/ascp/win/ascp-path.c
deleted file mode 100644
index f3eb105..0000000
--- a/libs/ascp/win/ascp-path.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "ascp-priv.h" /* ascp_path */
-#include <assert.h>
-
-bool ascp_path(const char **cmd, const char **key) {
-    static int idx = 0;
-    static const char *c[] = {
-"\"C:\\Program Files (x86)\\Aspera\\Aspera Connect\\bin\\ascp.exe\"",
-"\"C:\\Program Files\\Aspera\\Aspera Connect\\bin\\ascp.exe\""
-    };
-    static const char *k[] = {
- "C:\\Program Files (x86)\\Aspera\\Aspera Connect\\etc\\asperaweb_id_dsa.putty",
- "C:\\Program Files\\Aspera\\Aspera Connect\\etc\\asperaweb_id_dsa.putty"
-    };
-    assert(cmd && key && sizeof c / sizeof c[0] == sizeof k / sizeof k[0]);
-    if (idx < sizeof c / sizeof c[0]) {
-        *cmd = c[idx];
-        *key = k[idx];
-        ++idx;
-        return true;
-    }
-    else {
-        *cmd =  *key = NULL;
-        idx = 0;
-        return false;
-    }
-}
diff --git a/libs/ascp/win/connect.c b/libs/ascp/win/connect.c
deleted file mode 100644
index cbc2df9..0000000
--- a/libs/ascp/win/connect.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "ascp-priv.h" /* STS_DBG */
-
-#include <kfs/directory.h> // KDirectory
-#include <kfs/impl.h> // KSysDir
-
-#include <klib/log.h> /* LOGERR */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/rc.h>
-#include <klib/status.h> /* STSMSG */
-
-#include <Windows.h>
-
-#include <assert.h>
-#include <stdio.h> /* stderr */
-
-#define STS_FIN 3
-
-static rc_t posixStringToSystemString(char *buffer, size_t len,
-    const char *path, ...)
-{
-    KDirectory *wd = NULL;
-    rc_t rc = KDirectoryNativeDir(&wd);
-    struct KSysDir *sysDir = KDirectoryGetSysDir(wd);
-    wchar_t wd_path[MAX_PATH];
-    int ret = 0;
-    va_list args;
-    va_start(args, path);
-    rc = KSysDirOSPath(sysDir, wd_path, sizeof wd_path, path, args);
-    va_end(args);
-    KDirectoryRelease(wd);
-    if (rc == 0) {
-        ret = wcstombs(buffer, wd_path, len);
-        if (ret >= MAX_PATH) {
-            return RC(rcExe, rcPath, rcConverting, rcPath, rcExcessive);
-        }
-    }
-    
-    return rc;
-}
-
-static void beat(uint64_t heartbeat, bool flush) {
-    static int i = 0;
-    static char c = '1';
-    return;
-    if (heartbeat == 0) {
-        return;
-    }
-    if (flush) {
-        fprintf(stderr, "\n");
-/*      fflush(stderr); */
-        return;
-    }
-    fprintf(stderr, "%c", c);
-    if (++i >= 60) {
-        fprintf(stderr,
-            "\r                                                            \r");
-        i = 0;
-        ++c;
-        switch (c) {
-            case ':':
-                c = 'A';
-                break;
-            case '[':
-                c = 'a';
-                break;
-            case 127:
-                c = '!';
-                break;
-        }
-    }
-}
-
-static rc_t mkAscpCommand(char *buffer, size_t len,
-    const char *path, const char *key,
-    const char *src, const char *dest, const AscpOptions *opt)
-{
-    const char *maxRate = NULL;
-    const char *host = NULL;
-    const char *user = NULL;
-    size_t num_writ = 0;
-
-    size_t pos = 0;
-
-    char system[MAX_PATH] = "";
-    rc_t rc = posixStringToSystemString(system, sizeof system, dest);
-    if (rc != 0) {
-        return rc;
-    }
-
-    if (opt != NULL) {
-        host = opt->host;
-        maxRate = opt->target_rate;
-        user = opt->user;
-    }
-
-    rc = string_printf(buffer, len, &num_writ,
-        "%s -i \"%s\" -pQTk1%s%s%s%s%s%s %s %s",
-        path, key,
-        maxRate == NULL ? "" : " -l", maxRate == NULL ? "" : maxRate,
-        host == NULL ? "" : " --host ", host == NULL ? "" : host,
-        user == NULL ? "" : " --user ", user == NULL ? "" : host,
-        src, system);
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "while creating ascp command line");
-    }
-    else {
-        assert(num_writ < len);
-    }
-
-    return rc;
-}
-
-static int execute(const char *command, uint64_t heartbeat, bool cacheKey,
-    bool *writeFailed, bool *canceled, const char *name, TQuitting *quitting)
-{
-    DWORD exitCode = STILL_ACTIVE;
-    HANDLE g_hChildStd_IN_Rd = NULL;
-    HANDLE g_hChildStd_IN_Wr = NULL;
-    HANDLE g_hChildStd_OUT_Rd = NULL;
-    HANDLE g_hChildStd_OUT_Wr = NULL;
-    SECURITY_ATTRIBUTES saAttr; 
-    BOOL bSuccess = FALSE;
-    PROCESS_INFORMATION pi;
-    STARTUPINFO si;
-
-    assert(writeFailed && canceled);
-    *writeFailed = false;
-
-    STSMSG(STS_INFO, ("Starting %s ", command));
-
-    saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); 
-    saAttr.bInheritHandle = TRUE; 
-    saAttr.lpSecurityDescriptor = NULL; 
-
-    // Create a pipe for the child process's STDOUT. 
-    if (!CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr,
-        0))
-    {
-        rc_t rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "Stdout CreatePipe");
-        return 1;
-    }
-
-    // Ensure the read handle to the pipe for STDOUT is not inherited.
-    if (!SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT,
-        0))
-    {
-        rc_t rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "Stdout SetHandleInformation");
-        return 1;
-    }
-
-    // Create a pipe for the child process's STDIN. 
-    if (!CreatePipe(&g_hChildStd_IN_Rd, &g_hChildStd_IN_Wr, &saAttr,
-        0))
-    {
-        puts("Stdin CreatePipe");
-        return 1;
-    }
-
-    // Ensure the write handle to the pipe for STDIN is not inherited.  
-    if (!SetHandleInformation(g_hChildStd_IN_Wr, HANDLE_FLAG_INHERIT,
-        0))
-    {
-        puts("Stdin SetHandleInformation");
-        return 1;
-    }
-
-    // Set up members of the PROCESS_INFORMATION structure. 
-    ZeroMemory(&pi, sizeof(pi)); 
-
-    // Set up members of the STARTUPINFO structure. 
-    // This structure specifies the STDIN and STDOUT handles for redirection.
-    ZeroMemory(&si, sizeof(si));
-    si.cb = sizeof(si);
-    si.hStdError = g_hChildStd_OUT_Wr;
-    si.hStdOutput = g_hChildStd_OUT_Wr;
-    si.hStdInput = g_hChildStd_IN_Rd;
-    si.dwFlags |= STARTF_USESTDHANDLES;
-
-    bSuccess = CreateProcess(
-        NULL,//_In_opt_ LPCTSTR              lpApplicationName,
-        (char*)command,//_Inout_opt_  LPTSTR lpCommandLine, command line 
-        NULL,//_In_opt_ LPSECURITY_ATTRIBUTES process security attributes 
-        NULL,//_In_opt_ LPSECURITY_ATTRIBUTES primary thread security attributes
-        TRUE,//_In_     BOOL                  handles are inherited 
-        0,   //_In_     DWORD                 creation flags 
-        NULL,//_In_opt_ LPVOID                use parent's environment 
-        NULL,//_In_opt_ LPCTSTR               use parent's current directory 
-        &si, //_In_     LPSTARTUPINFO         STARTUPINFO pointer 
-        &pi  //_Out_    LPPROCESS_INFORMATION receives PROCESS_INFORMATION 
-    );
-    if (bSuccess) {
-        bool progressing = false;
-        EAscpState state = eStart;
-        const char y[] = "y\r\n";
-        const char n[] = "n\r\n";
-        const char *answer = cacheKey ? y : n;
-        bool first = true;
-        CHAR chBuf[4096];
-        DWORD dwRead = 0;
-        DWORD dwWritten = 0;
-        DWORD dwFileSize = 0;
-        HANDLE hParentStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
-        DWORD dwMilliseconds = 1000;
-        DWORD dwMillisecondsRemains = 1000;
-        String line;
-        StringInit(&line, NULL, 0, 0);
-        if (heartbeat > 0) {
-            dwMillisecondsRemains = heartbeat;
-        }
-        // Write to the pipe that is the standard input for a child process. 
-        // Data is written to the pipe's buffers, so it is not necessary to wait
-        // until the child process is running before writing data.
-        assert(sizeof y == sizeof n);
-        bSuccess = WriteFile(g_hChildStd_IN_Wr, answer, sizeof y - 1,
-            &dwWritten, NULL);
-        if (!bSuccess) {
-            puts("failed to write to child's Stdin");
-            return 1;
-        }
-        if (!CloseHandle(g_hChildStd_IN_Wr)) {
-            puts("StdInWr CloseHandle");
-            return 1;
-        }
-        CloseHandle(pi.hThread);
-
-        // Successfully created the process.  Wait for it to finish.
-        while (true) {
-            char noprogress[] = "\r                                "
-                "                                               \r";
-            if (exitCode != STILL_ACTIVE) {
-/*                  printf(">>GetExitCodeProcess = %d\n", exitCode); */
-            }
-            bSuccess = GetExitCodeProcess(pi.hProcess, &exitCode);
-            if (exitCode != STILL_ACTIVE) {
-/*                  printf(">>GetExitCodeProcess = %d\n", exitCode); */
-            }
-            if (!bSuccess) {
-                rc_t rc = RC(rcExe,
-                    rcProcess, rcExecuting, rcProcess, rcFailed);
-                if (progressing) {
-                    WriteFile(hParentStdOut, noprogress, sizeof noprogress - 1,
-                        &dwWritten, NULL);
-                }
-                LOGERR(klogErr, rc,
-                    "Executed command, couldn't get exit code");
-                return 1;
-            }
-            if (exitCode == STILL_ACTIVE) {
-                if (first) {
-                    first = false;
-                }
-                else {
-                    if (STS_DBG > KStsLevelGet()) {
-                        beat(heartbeat, false);
-                    }
-                }
-                WaitForSingleObject(pi.hProcess, dwMilliseconds);
-                dwFileSize = GetFileSize(g_hChildStd_OUT_Rd,  NULL);
-                if (dwFileSize > 0) {
-                    STSMSG(STS_FIN + 1,
-                        ("GetFileSize(ChildStdOut) = %d", dwFileSize));
-                }
-                while (dwFileSize > 0) {
-                    bSuccess = ReadFile(g_hChildStd_OUT_Rd,
-                        chBuf, sizeof chBuf, &dwRead, NULL);
-                    if (!bSuccess) {
-                        if (progressing) {
-                            WriteFile(hParentStdOut, noprogress,
-                                sizeof noprogress - 1, &dwWritten, NULL);
-                        }
-                        break;
-                    }
-                    ascpParse(chBuf, dwRead, name, &state, &line);
-                    if (state == eWriteFailed) {
-                        *writeFailed = true;
-                    }
-                    else if (state == eProgress) {
-                        if (heartbeat > 0) {
-                            if (dwMillisecondsRemains > dwMilliseconds) {
-                                dwMillisecondsRemains -= dwMilliseconds;
-                            }
-                            else {
-                                const char *p = chBuf;
-                                size_t l = dwRead;
-                                if (line.addr != NULL && line.len != 0) {
-                                    p = line.addr;
-                                    l = line.len;
-                                    WriteFile(hParentStdOut, "\r", 1,
-                                        &dwWritten, NULL);
-                                    bSuccess = WriteFile(hParentStdOut, p, l,
-                                        &dwWritten, NULL);
-                                    dwMillisecondsRemains = heartbeat;
-                                    progressing = true;
-                                }
-                            }
-                        }
-                    }
-/*                      OUTMSG(("%.*s", dwRead, chBuf)); */
-                    if (STS_DBG <= KStsLevelGet()) {
-                        if (KStsMsg("%.*s", dwRead, chBuf) != 0) {
-                            bSuccess = WriteFile(hParentStdOut, chBuf,
-                                dwRead, &dwWritten, NULL);
-                        }
-                    }
-                    dwFileSize = GetFileSize(g_hChildStd_OUT_Rd,  NULL);
-                    if (dwFileSize > 0) {
-                        STSMSG(STS_FIN + 1,
-                            ("GetFileSize(ChildStdOut) = %d", dwFileSize));
-                    }
-                }
-            }
-            else {
-                if (STS_DBG > KStsLevelGet()) {
-//                  beat(heartbeat, true);
-                }
-                if (progressing) {
-                    WriteFile(hParentStdOut, noprogress,
-                        sizeof noprogress - 1, &dwWritten, NULL);
-                }
-                break;
-            }
-            if (quitting != NULL) {
-                rc_t rc = quitting();
-                if (rc != 0) {
-                    if (progressing) {
-                        WriteFile(hParentStdOut, noprogress,
-                            sizeof noprogress - 1, &dwWritten, NULL);
-                    }
-                    *canceled = true;
-                    break;
-                }
-            }
-        }
-        if (!*canceled) {
-            WaitForSingleObject(pi.hProcess, INFINITE);
-
-        // Get the exit code.
-/*      printf(">GetExitCodeProcess = %d\n", exitCode); */
-            bSuccess = GetExitCodeProcess(pi.hProcess, &exitCode);
-            if (!bSuccess) {
-                rc_t rc = RC(rcExe,
-                    rcProcess, rcExecuting, rcProcess, rcFailed);
-                LOGERR(klogErr,
-                    rc, "Executed command but couldn't get exit code");
-                return 1;
-            }
-        }
-/*      printf("<GetExitCodeProcess = %d\n", exitCode); */
-
-        CloseHandle(pi.hProcess);
-
-        if (exitCode != 0 && STS_DBG > KStsLevelGet()) {
-            if (KStsMsg("%.*s", dwRead, chBuf) != 0) {
-                bSuccess = WriteFile(hParentStdOut, chBuf,
-                    dwRead, &dwWritten, NULL);
-            }
-        }
-        if (dwFileSize > 0) {
-            STSMSG(STS_FIN, ("GetFileSize(ChildStdOut) = %d", dwFileSize));
-        }
-        while (dwFileSize > 0) { 
-            bSuccess = ReadFile(g_hChildStd_OUT_Rd,
-                chBuf, sizeof chBuf, &dwRead, NULL);
-            if (!bSuccess || dwRead == 0) {
-                break; 
-            }
-            ascpParse(chBuf, dwRead, name, &state, &line);
-            if (state == eWriteFailed) {
-                *writeFailed = true;
-            }
-            dwFileSize = GetFileSize(g_hChildStd_OUT_Rd,  NULL);
-            if (dwFileSize > 0) {
-                STSMSG(STS_FIN, ("GetFileSize(ChildStdOut) = %d", dwFileSize));
-            }
-        }
-
-        return exitCode;
-    }
-    else {
-        return GetLastError();
-    }
-}
-
-rc_t run_ascp(const char *path, const char *key,
-    const char *src, const char *dest, const AscpOptions *opt)
-{
-    rc_t rc = 0;
-    uint64_t heartbeat = 0;
-    char buffer[MAX_PATH * 3] = "";
-    bool writeFailed = false;
-    TQuitting *quitting = NULL;
-
-    if (opt != NULL) {
-        heartbeat = opt->heartbeat;
-        quitting = opt->quitting;
-    }
-
-    rc = mkAscpCommand(buffer, sizeof buffer, path, key, src, dest, opt);
-    if (rc == 0) {
-        bool cacheKey = false;
-        if (opt != NULL && opt->cache_key) {
-            cacheKey = true;
-        }
-        {
-            int value = 0;
-            bool canceled = false;
-            const char *name = strrchr(dest, '/');
-            if (name == NULL) {
-                name = dest;
-            }
-            else {
-                if (*(name + 1) != '\0') {
-                    ++name;
-                }
-                else {
-                    name = dest;
-                }
-            }
-            value = execute(buffer, heartbeat, cacheKey,
-                &writeFailed, &canceled, name, quitting);
-            if (value != 0) {
-                if (writeFailed) {
-                    rc = RC(rcExe, rcProcess, rcExecuting,
-                        rcMemory, rcExhausted);
-                }
-                else {
-                    rc = RC(rcExe, rcProcess, rcExecuting, rcProcess, rcFailed);
-                }
-            }
-            if (value == 0 && rc == 0 && canceled && quitting != NULL) {
-                rc = quitting();
-            }
-        }
-    }
-
-    return rc;
-}
-
-int silent_system(const char *command) {
-    HANDLE g_hChildStd_OUT_Rd = NULL;
-    HANDLE g_hChildStd_OUT_Wr = NULL;
-    BOOL bSuccess = FALSE;
-    PROCESS_INFORMATION pi;
-    STARTUPINFO si;
-    SECURITY_ATTRIBUTES saAttr; 
-
-    // Set the bInheritHandle flag so pipe handles are inherited. 
-    saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); 
-    saAttr.bInheritHandle = TRUE; 
-    saAttr.lpSecurityDescriptor = NULL; 
-
-    // Create a pipe for the child process's STDOUT. 
-    if (!CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0)) {
-        rc_t rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "Stdout CreatePipe");
-        return 1;
-    }
-
-    // Ensure the read handle to the pipe for STDOUT is not inherited.
-    if (!SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0)) {
-        rc_t rc = RC(rcExe, rcFileDesc, rcCreating, rcFileDesc, rcFailed);
-        LOGERR(klogErr, rc, "Stdout SetHandleInformation");
-        return 1;
-    }
-
-    ZeroMemory(&pi, sizeof(pi)); 
-
-    ZeroMemory(&si, sizeof(si));
-    si.cb = sizeof(si);
-    si.hStdError = g_hChildStd_OUT_Wr;
-    si.hStdOutput = g_hChildStd_OUT_Wr;
-    si.dwFlags |= STARTF_USESTDHANDLES;
-
-    bSuccess = CreateProcess(
-        NULL,           //_In_opt_    LPCTSTR               lpApplicationName,
-        (char*)command, //_Inout_opt_ LPTSTR                lpCommandLine,
-        NULL,           //_In_opt_    LPSECURITY_ATTRIBUTES lpProcessAttributes,
-        NULL,           //_In_opt_    LPSECURITY_ATTRIBUTES lpThreadAttributes,
-        TRUE,           //_In_        BOOL                  bInheritHandles,
-        0,              //_In_        DWORD                 dwCreationFlags,
-        NULL,           //_In_opt_    LPVOID                lpEnvironment,
-        NULL,           //_In_opt_    LPCTSTR               lpCurrentDirectory,
-        &si,            //_In_        LPSTARTUPINFO         lpStartupInfo,
-        &pi             //_Out_       LPPROCESS_INFORMATION lpProcessInformation
-    );
-    if (bSuccess) {
-        return 0;
-    }
-    else {
-        return GetLastError();
-    }
-}
diff --git a/libs/axf/Makefile b/libs/axf/Makefile
deleted file mode 100644
index 45f0026..0000000
--- a/libs/axf/Makefile
+++ /dev/null
@@ -1,133 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/axf
-
-INT_LIBS = \
-	libaxf \
-	libwaxf
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_LIBS): makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(TARGDIR)/,$(ALL_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# alignment transform library
-#
-$(TARGDIR)/libaxf: $(addprefix $(ILIBDIR)/libaxf.,$(ILIBEXT))
-
-AXF_SRC = \
-	ref-tbl-sub-select \
-	ref-restore-read \
-	align-restore-read \
-	raw-restore-read \
-	raw-restore-qual \
-	seq-restore-read \
-	seq-construct-read \
-	cigar \
-	project_read_from_sequence \
-	not-my-row \
-	template-len \
-	get-sam-flags \
-	align-ref-pos \
-	align-ref-name \
-	align-ref-seq-id \
-	align-local_ref_id \
-	align-local_ref_start \
-	generate-mismatch-qual \
-	mismatch-restore-qual \
-	ref-preserve_qual \
-	ref-tbl \
-	make-cmp-read_desc \
-	get_mate_align_ids
-
-AXF_OBJ = \
-	$(addsuffix .$(LOBX),$(AXF_SRC))
-
-AXF_LIB = \
-	-lalign-reader \
-	-dvdb \
-	-dkdb \
-	-dklib \
-	-dm \
-	-dz
-
-$(ILIBDIR)/libaxf.$(LIBX): $(AXF_OBJ)
-	$(LD) --slib -o $@ $^ $(AXF_LIB)
-
-
-#-------------------------------------------------------------------------------
-# alignment transform update library
-#
-$(TARGDIR)/libwaxf: $(addprefix $(ILIBDIR)/libwaxf.,$(ILIBEXT))
-
-WAXF_SRC = \
-	$(AXF_SRC) \
-	refseq-stats
-
-WAXF_OBJ = \
-	$(addsuffix .$(LOBX),$(WAXF_SRC))
-
-WAXF_LIB = \
-	-lalign-reader \
-	-dwvdb \
-	-dwkdb \
-	-lkfg \
-	-dklib \
-	-dm \
-	-dz
-
-$(ILIBDIR)/libwaxf.$(LIBX): $(WAXF_OBJ)
-	$(LD) --slib -o $@ $^ $(WAXF_LIB)
diff --git a/libs/axf/align-local_ref_id.c b/libs/axf/align-local_ref_id.c
deleted file mode 100644
index 97f8efb..0000000
--- a/libs/axf/align-local_ref_id.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct LocalRefID LocalRefID;
-struct LocalRefID
-{
-    uint32_t max_seq_len;
-};
-
-static
-void CC LocalRefIDWhack ( void *obj )
-{
-    LocalRefID * self = obj;
-    if ( self != NULL )
-    {
-        free ( self );
-    }
-}
-
-static
-rc_t LocalRefIDMake ( LocalRefID **objp, const VTable *tbl, const VCursor *native_curs)
-{
-    rc_t rc;
-    /* create the object */
-    LocalRefID *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-	const VCursor *curs=NULL;
-	 /* open the reference table cursor*/
-	if( (rc = AlignRefTableCursor(tbl, native_curs, &curs, NULL)) == 0 ){
-		uint32_t itmp;
-                if(  (rc = VCursorAddColumn(curs, &itmp, "(U32)MAX_SEQ_LEN")) == 0 || GetRCState(rc) == rcExists)  {
-                    const void *base;
-                    uint32_t row_len;
-                    rc = VCursorCellDataDirect(curs, 1, itmp, NULL, &base, NULL, &row_len);
-                    if(rc == 0) {
-                        assert(row_len == 1);
-                        memcpy(&obj->max_seq_len, base, 4);
-                    }
-                }
-                if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-                    obj->max_seq_len = 0;
-                    rc = 0;
-                }
-		VCursorRelease(curs);
-		if(rc == 0){
-			*objp = obj;
-			return 0;
-		}
-	}
-        free ( obj );
-    }
-    return rc;
-}
-
-/*
- function I64 NCBI:align:local_ref_id ( U64 global_ref_start )
- */
-static
-rc_t CC align_local_ref_id ( void *data, const VXformInfo *info, void *Dst, const void *Src, uint64_t elem_count )
-{
-    LocalRefID const *self = (void const *)data;
-    int64_t *dst=(int64_t*)Dst;
-    uint64_t const *global_ref_start = Src; 
-    uint64_t i;
-
-    for (i = 0; i != elem_count; ++i) {
-        dst[i] = global_ref_start[i] / self->max_seq_len + 1;
-    }
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_local_ref_id, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    LocalRefID *fself;
-    rc_t rc = LocalRefIDMake ( & fself, info -> tbl,  (const VCursor*)info->parms );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = LocalRefIDWhack;
-        rslt -> u . af = align_local_ref_id;
-        rslt -> variant = vftArray;
-    }
-
-    return rc;
-}
diff --git a/libs/axf/align-local_ref_start.c b/libs/axf/align-local_ref_start.c
deleted file mode 100644
index 6b37120..0000000
--- a/libs/axf/align-local_ref_start.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct LocalRefStart LocalRefStart;
-struct LocalRefStart
-{
-    uint32_t max_seq_len;
-};
-
-static
-void CC LocalRefStartWhack ( void *obj )
-{
-    LocalRefStart * self = obj;
-    if ( self != NULL )
-    {
-        free ( self );
-    }
-}
-
-static
-rc_t LocalRefStartMake ( LocalRefStart **objp, const VTable *tbl, const VCursor *native_curs )
-{
-    rc_t rc;
-
-    /* create the object */
-    LocalRefStart *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-	const VCursor *curs=NULL;
-         /* open the reference table cursor*/
-        if( (rc = AlignRefTableCursor(tbl, native_curs, &curs, NULL)) == 0 ){
-                uint32_t itmp;
-                if(  (rc = VCursorAddColumn(curs, &itmp, "(U32)MAX_SEQ_LEN")) == 0 || GetRCState(rc) == rcExists)  {
-                    const void *base;
-                    uint32_t row_len;
-                    rc = VCursorCellDataDirect(curs, 1, itmp, NULL, &base, NULL, &row_len);
-                    if(rc == 0) {
-                        assert(row_len == 1);
-                        memcpy(&obj->max_seq_len, base, 4);
-                    }
-                }
-                if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-                    obj->max_seq_len = 0;
-                    rc = 0;
-                }
-                VCursorRelease(curs);
-                if(rc == 0){
-                        *objp = obj;
-                        return 0;
-                }
-        }
-        free ( obj );
-    }
-    return rc;
-}
-
-/*
- function INSDC:coord:zero NCBI:align:local_ref_start ( U64 global_ref_start )
- */
-static
-rc_t CC align_local_ref_start ( void *data, const VXformInfo *info, void *Dst, const void *Src, uint64_t elem_count )
-{
-    LocalRefStart const *self = (void const *)data;
-    INSDC_coord_zero *dst=Dst;
-    uint64_t const *global_ref_start = Src;
-    unsigned i;
-    
-    for (i = 0; i != elem_count; ++i) {
-        dst[i] = global_ref_start[i] % self->max_seq_len;
-    }
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_local_ref_start, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    LocalRefStart *fself;
-    rc_t rc = LocalRefStartMake ( & fself, info -> tbl, (const VCursor*)info->parms  );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = LocalRefStartWhack;
-        rslt -> u . af = align_local_ref_start;
-        rslt -> variant = vftArray;
-    }
-
-    return rc;
-}
diff --git a/libs/axf/align-ref-name.c b/libs/axf/align-ref-name.c
deleted file mode 100644
index ce7fc21..0000000
--- a/libs/axf/align-ref-name.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct RefName RefName;
-struct RefName
-{
-    const VCursor *curs;
-    uint32_t name_idx;
-};
-
-static
-void CC RefNameWhack ( void *obj )
-{
-    RefName * self = obj;
-    if ( self != NULL )
-    {
-        VCursorRelease ( self -> curs );
-        free ( self );
-    }
-}
-
-static
-rc_t RefNameMake ( RefName **objp, const VTable *tbl, const VCursor *native_curs )
-{
-    rc_t rc;
-
-    /* create the object */
-    RefName *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-	obj->curs=NULL;
-        /* open the reference cursor */
-	rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL);
-	if(rc == 0){
-                /* add columns to cursor */
-		rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)REF_NAME");
-		if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-			rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
-		}
-		if(GetRCState(rc) == rcExists){
-			rc = 0;
-		}
-                if( rc == 0 ) {
-                    *objp = obj;
-                    return 0;
-                }
-                VCursorRelease ( obj -> curs );
-        }
-        free ( obj );
-    }
-    return rc;
-}
-
-enum align_ref_name_args {
-    REF_ID
-};
-
-/*
- function ascii NCBI:align:ref_name ( I64 ref_id );
-*/
-static
-rc_t CC align_ref_name ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    rc_t rc;
-    RefName const *self = (void const *)data;
-    char const *name = NULL;
-    uint32_t name_len;
-
-    /* get start and length of reference segment */
-    int64_t const *ref_id = argv[REF_ID].u.data.base;
-
-    if (argv[REF_ID].u.data.elem_count == 0)
-        rc = RC(rcAlign, rcFunction, rcExecuting, rcRow, rcNotFound);
-    else {
-        assert(argv[REF_ID].u.data.elem_bits == sizeof(*ref_id) * 8);
-        
-        ref_id += argv[REF_ID].u.data.first_elem;
-        
-        rc = VCursorCellDataDirect(self->curs, ref_id[0], self->name_idx, NULL, (void const **)&name, NULL, &name_len);
-    }
-    
-    if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
-        name = "";
-        name_len = 0;
-    }
-    else if (rc) return rc;
-    
-    rc = KDataBufferCast(rslt->data, rslt->data, sizeof(name[0]) * 8, true);
-    if (rc) return rc;
-
-    rc = KDataBufferResize(rslt->data, name_len);
-    if (rc) return rc;
-    
-    memcpy(rslt->data->base, name, sizeof(name[0]) * name_len);
-    rslt->elem_count = name_len;
-    rslt->elem_bits = sizeof(name[0]) * 8;
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_ref_name, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RefName *fself;
-    rc_t rc = RefNameMake ( & fself, info -> tbl,(const VCursor*)info->parms  );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = RefNameWhack;
-        rslt -> u . rf = align_ref_name;
-        rslt -> variant = vftRow;
-    }
-
-    return rc;
-}
diff --git a/libs/axf/align-ref-pos.c b/libs/axf/align-ref-pos.c
deleted file mode 100644
index 4143553..0000000
--- a/libs/axf/align-ref-pos.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct RefPos RefPos;
-
-
-struct RefPos
-{
-    const VCursor *curs;
-    uint32_t name_idx;
-    uint32_t name_range_idx;
-    uint32_t max_seq_len;
-/***** cache ****/
-    BSTree   tr_range; /** region tree ***/
-};
-
-typedef struct {
-    int64_t start_id;
-    int64_t stop_id;
-}RowRange;
-
-typedef struct {
-    BSTNode  n;
-    RowRange rr;
-}BSTRowRange;
-
-static
-int CC row_range_cmp ( const void *a, const BSTNode *b )
-{
-	const int64_t  *key=a;
-	const BSTRowRange *node = ( const BSTRowRange* ) b;
-	if(key[0] < node->rr.start_id) return -1;
-	if(key[0] > node->rr.stop_id) return +1;
-	return 0;
-}
-static
-int CC row_range_sort(const BSTNode *a, const BSTNode *b )
-{
-    const BSTRowRange * item = ( const BSTRowRange* ) a;
-    const BSTRowRange * node = ( const BSTRowRange* ) b;
-
-    return item->rr.start_id - node->rr.start_id;
-}    
-
-
-static
-void CC bst_range_free ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-
-static
-void CC RefPosWhack ( void *obj )
-{
-    RefPos * self = obj;
-    if ( self != NULL )
-    {
-    	BSTreeWhack(&self->tr_range,bst_range_free,NULL);
-        VCursorRelease ( self -> curs );
-        free ( self );
-    }
-}
-
-static
-rc_t RefPosMake ( RefPos **objp, const VTable *tbl, const VCursor *native_curs )
-{
-    rc_t rc;
-
-    /* create the object */
-    RefPos *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-	obj->curs=NULL;
-        BSTreeInit(&obj->tr_range);
-        /* open the reference table cursor*/
-	  
-	if( (rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL)) == 0 ) {
-                uint32_t itmp;
-                if(  (rc = VCursorAddColumn(obj->curs, &itmp, "(U32)MAX_SEQ_LEN")) == 0 || GetRCState(rc) == rcExists)  {
-                    const void *base;
-                    uint32_t row_len;
-                    rc = VCursorCellDataDirect(obj->curs, 1, itmp, NULL, &base, NULL, &row_len);
-                    if(rc == 0) {
-                        assert(row_len == 1);
-                        memcpy(&obj->max_seq_len, base, 4);
-                    }
-                }
-                if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-		    /*** no MAX_SEQ_LEN means that REF_POS==REF_START **/
-		    VCursorRelease(obj->curs);
-		    obj->curs = NULL;
-                    obj->max_seq_len = 0;
-		    obj->name_range_idx = 0;
-		    obj->name_idx = 0;
-                    rc = 0;
-                } else if( rc == 0 ) {
-                        /* add columns to cursor */
-			rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
-			if(rc == 0 || GetRCState(rc) == rcExists)
-				rc = VCursorAddColumn(obj->curs, &obj->name_range_idx, "NAME_RANGE");
-			if(GetRCState(rc) == rcExists)
-				rc = 0;
-                }
-        }
-        if( rc == 0 ) {
-            *objp = obj;
-        } else {
-	    VCursorRelease(obj->curs);
-            free(obj);
-        }
-    }
-    return rc;
-}
-
-enum align_ref_pos_args {
-    REF_ID,
-    REF_START,
-    REF_PLOIDY,
-    PLOIDY
-};
-
-/*
-function INSDC:coord:zero NCBI:align:ref_pos ( I64 ref_id, INSDC:coord:zero ref_start );
-*/
-static
-rc_t CC align_ref_pos ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    rc_t rc;
-    RefPos const *self = (void const *)data;
-    int64_t ref_row_id = 0;
-    INSDC_coord_zero *ref_pos;
-    unsigned const ploidy = argv[REF_START].u.data.elem_count;
-    unsigned i;
-
-    /* get start and length of reference segment */
-    int64_t const *ref_id = 0;
-    INSDC_coord_zero const *ref_start;
-
-    assert(argv[REF_ID].u.data.elem_bits == sizeof(*ref_id) * 8);
-    assert(argv[REF_START].u.data.elem_bits == sizeof(*ref_start) * 8);
-
-    ref_start = argv[REF_START].u.data.base;
-    ref_start += argv[REF_START].u.data.first_elem;
-
-    if( self->curs != NULL ) {
-        char const *name = NULL;
-        uint32_t name_len;
-        BSTRowRange *brr;
-
-        ref_id = argv[REF_ID].u.data.base;
-        ref_id += argv[REF_ID].u.data.first_elem;
-
-        brr = (BSTRowRange*)BSTreeFind(&self->tr_range,&ref_id[0],row_range_cmp);
-        if(brr==NULL) {
-            RowRange *new_rr;
-            rc = VCursorCellDataDirect(self->curs, ref_id[0], self->name_idx, NULL, (void const **)&name, NULL, &name_len);
-            if (rc) return rc;
-            rc = VCursorParamsSet((struct VCursorParams const *)self->curs, "QUERY_SEQ_NAME", "%.*s", name_len, name);
-            if (rc) return rc;
-
-            rc = VCursorCellDataDirect(self->curs, ref_id[0], self->name_range_idx, NULL, (void const **)&new_rr, NULL, NULL);
-            if (rc) return rc;
-
-            brr=malloc(sizeof(*brr));
-            memcpy(&brr->rr,new_rr,sizeof(*new_rr));
-            BSTreeInsert((BSTree*)&self->tr_range,(BSTNode*)brr, row_range_sort);
-        }
-        ref_row_id = brr->rr.start_id;
-    }
-
-    rc = KDataBufferResize(rslt->data, ploidy);
-    if (rc) return rc;
-    
-    ref_pos = rslt->data->base;
-    for (i = 0; i != ploidy; ++i) {
-        ref_pos[i] = ref_start[i];
-        if( self->curs != NULL ) {
-            ref_pos[i] += (ref_id[0] - ref_row_id) * self->max_seq_len;
-        }
-    }
-    rslt->elem_count = ploidy;
-    rslt->elem_bits = sizeof(ref_pos[0]) * 8;
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_ref_pos, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RefPos *fself;
-    rc_t rc = RefPosMake ( & fself, info -> tbl,  (const VCursor*)info->parms);
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = RefPosWhack;
-        rslt -> u . rf = align_ref_pos;
-        rslt -> variant = vftRow;
-    }
-
-    return rc;
-}
diff --git a/libs/axf/align-ref-seq-id.c b/libs/axf/align-ref-seq-id.c
deleted file mode 100644
index 6d0d8a7..0000000
--- a/libs/axf/align-ref-seq-id.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct RefSeqID RefSeqID;
-struct RefSeqID
-{
-    const VCursor *curs;
-    uint32_t seqID_idx;
-};
-
-static
-void CC RefSeqIDWhack ( void *obj )
-{
-    RefSeqID * self = obj;
-    if ( self != NULL )
-    {
-        VCursorRelease ( self -> curs );
-        free ( self );
-    }
-}
-
-static
-rc_t RefSeqIDMake ( RefSeqID **objp, const VTable *tbl, const VCursor *native_curs )
-{
-    rc_t rc;
-
-    /* create the object */
-    RefSeqID *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-	obj->curs=NULL;
-        /* open the reference cursor */
-        rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL);
-        if(rc == 0){
-                /* add columns to cursor */
-                rc = VCursorAddColumn(obj->curs, &obj->seqID_idx, "SEQ_ID");
-                if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-                        rc = VCursorAddColumn(obj->curs, &obj->seqID_idx, "REF_SEQ_ID");
-                }
-                if(GetRCState(rc) == rcExists){
-                        rc = 0;
-                }
-                if( rc == 0 ) {
-                    *objp = obj;
-                    return 0;
-                }
-                VCursorRelease ( obj -> curs );
-        }
-        free ( obj );
-    }
-    return rc;
-}
-
-enum align_ref_name_args {
-    REF_ID
-};
-
-/*
- function ascii NCBI:align:ref_seq_id ( I64 ref_id );
-*/
-static
-rc_t CC align_ref_seq_id ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    rc_t rc;
-    RefSeqID const *self = (void const *)data;
-    char const *name = NULL;
-    uint32_t name_len;
-
-    /* get start and length of reference segment */
-    int64_t const *ref_id = argv[REF_ID].u.data.base;
-
-    assert(argv[REF_ID].u.data.elem_bits == sizeof(*ref_id) * 8);
-
-    if( self->curs == NULL || argv[REF_ID].u.data.elem_count == 0 ) {
-        rslt->elem_count = 0;
-        return 0;
-    }
-    ref_id += argv[REF_ID].u.data.first_elem;
-    
-    rc = VCursorCellDataDirect(self->curs, ref_id[0], self->seqID_idx, NULL, (void const **)&name, NULL, &name_len);
-    if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
-        name = "";
-        name_len = 0;
-    } else if( rc != 0 ) {
-        return rc;
-    }
-    rc = KDataBufferCast(rslt->data, rslt->data, sizeof(name[0]) * 8, true);
-    if (rc) return rc;
-
-    rc = KDataBufferResize(rslt->data, name_len);
-    if (rc) return rc;
-    
-    memcpy(rslt->data->base, name, sizeof(name[0]) * name_len);
-    rslt->elem_count = name_len;
-    rslt->elem_bits = sizeof(name[0]) * 8;
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_ref_seq_id, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RefSeqID *fself;
-    rc_t rc = RefSeqIDMake ( & fself, info -> tbl, (const VCursor*)info->parms  );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = RefSeqIDWhack;
-        rslt -> u . rf = align_ref_seq_id;
-        rslt -> variant = vftRow;
-    }
-
-    return rc;
-}
diff --git a/libs/axf/align-restore-read.c b/libs/axf/align-restore-read.c
deleted file mode 100644
index 95b2066..0000000
--- a/libs/axf/align-restore-read.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-
-static
-rc_t CC align_restore_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int mmi,roi,rri,di,bi;
-    const INSDC_4na_bin	*ref_read 	= argv[0].u.data.base;
-    const uint32_t	ref_read_len 	= argv[0].u.data.elem_count;
-    const uint8_t	*has_mismatch	= argv[1].u.data.base;
-    const uint32_t	has_mismatch_len= argv[1].u.data.elem_count;
-    const INSDC_4na_bin *mismatch	= argv[2].u.data.base;
-    const uint32_t	mismatch_len	= argv[2].u.data.elem_count;
-    const uint8_t	*has_ref_offset	   = argv[3].u.data.base;
-    const uint32_t	has_ref_offset_len = argv[3].u.data.elem_count;
-    const int32_t 	*ref_offset	= argv[4].u.data.base;
-    const uint32_t	ref_offset_len  = argv[4].u.data.elem_count;
-    uint32_t ploidy = 1, rl;
-    const INSDC_coord_len* read_len = &has_mismatch_len;
-
-    INSDC_4na_bin *dst;
-    uint32_t	dst_len;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(argv[2].u.data.elem_bits == 8);
-    assert(argv[3].u.data.elem_bits == 8);
-    assert(argv[4].u.data.elem_bits == 32);
-
-    ref_read	   += argv [ 0 ] . u . data . first_elem;
-    has_mismatch   += argv [ 1 ] . u . data . first_elem;
-    mismatch	   += argv [ 2 ] . u . data . first_elem;
-    has_ref_offset += argv [ 3 ] . u . data . first_elem;
-    ref_offset     += argv [ 4 ] . u . data . first_elem;
-
-    if ( has_mismatch_len != has_ref_offset_len )
-		return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-
-    if( argc > 5 ) {
-        assert(argv[5].u.data.elem_bits == 32);
-        ploidy = argv[5].u.data.elem_count;
-        read_len = argv[5].u.data.base;
-        read_len += argv[5].u.data.first_elem;
-    }
-    dst_len = has_mismatch_len;
-
-    /* resize output row for the total number of reads */    
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, dst_len );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = dst_len;
-    dst = rslt -> data -> base;
-    /**** MAIN RESTORATION LOOP ***/
-    for(mmi=roi=rri=di=bi=0, rl = 1; di < dst_len; di++,rri++,rl++,bi++){
-        if(has_ref_offset[di] && bi >= 0){ /** bi can only become negative on Bs; skip has_ref_offset if Bs are not exhausted ***/
-            if(roi >= ref_offset_len)
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-            memcpy ( & bi, ref_offset + roi, sizeof bi );
-            rri += bi; /** can lead to negative rri ***/                
-            roi++;
-        }
-        if(has_mismatch[di]){
-            if(mmi >= mismatch_len)
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-            dst[di]=mismatch[mmi];
-            mmi++;
-        } else {
-            if(rri < 0 || rri >= ref_read_len){ /*** can not have match after rolling back off the right edge ***/
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-            }
-            dst[di]=ref_read[rri];
-        }
-        if( ploidy > 1 && rl == read_len[0] ) {
-            rri = -1;
-            rl = 0;
-            ploidy--;
-            read_len++;
-        }
-    }
-    return 0;
-}
-
-
-/* 
- * function
- * INSDC:4na:bin ALIGN:align_restore_read #1( INSDC:4na:bin ref_read, bool has_mismatch, INSDC:4na:bin mismatch, bool has_ref_offset, I32 ref_offset);
- */
-VTRANSFACT_IMPL ( ALIGN_align_restore_read, 1, 0, 1 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-
-    rslt->u.rf = align_restore_read_impl;
-    rslt->variant = vftRow;
-    rslt -> whack = NULL;
-    return 0;
-}
diff --git a/libs/axf/cigar.c b/libs/axf/cigar.c
deleted file mode 100644
index 487c61c..0000000
--- a/libs/axf/cigar.c
+++ /dev/null
@@ -1,1914 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <klib/printf.h>
-
-#include <klib/out.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include <insdc/insdc.h>
-
-#define ARG_BASE(TYPE, N) (((TYPE const *)argv[(N)].u.data.base) + argv[(N)].u.data.first_elem)
-#define ARG_ALIAS(TYPE, NAME, N) TYPE const *const NAME = ARG_BASE(TYPE, N)
-#define ARG_ALIAS_COND(TYPE, NAME, N, ALT) TYPE const *const NAME = ((argc > (N)) ? ARG_BASE(TYPE, N) : ALT)
-
-typedef struct trim_self_struct {
-    uint8_t version;
-} self_t;
-
-static
-rc_t op2b(KDataBuffer *dst, unsigned const offset, unsigned *const count, int const opcode, unsigned oplen)
-{
-    unsigned digits = 1;
-    unsigned scale = 10;
-    
-    if (oplen == 0) {
-        *count = 0;
-        return 0;
-    }
-    while (scale < oplen) {
-        scale *= 10;
-        ++digits;
-    }
-    if (scale == oplen) /* oplen is whole power of 10 */
-        ++digits;
-
-    *count = digits + 1;
-    
-    if (dst) {
-        unsigned const need = offset + digits + 1;
-        
-        if (need > dst->elem_count) {
-            rc_t rc = KDataBufferResize(dst, need);
-            if (rc) return rc;
-        }
-        {
-            char *const base = &((char *)dst->base)[offset];
-            
-            base[digits] = opcode;
-            do {
-                unsigned const digit = oplen % 10;
-                
-                oplen /= 10;
-                base[--digits] = digit + '0';
-            } while (digits);
-        }
-    }
-    return 0;
-}
-
-static
-rc_t cigar_string(KDataBuffer *dst, size_t boff, uint64_t *bsize, bool const full,
-                  bool const has_mismatch[], bool const has_ref_offset[],
-                  INSDC_coord_zero const read_start, INSDC_coord_zero const read_end,
-                  int32_t const ref_offset[], unsigned const ro_len, unsigned *ro_offset)
-{
-    size_t bsz = 0;
-    unsigned nwrit;
-    uint32_t i,m,mm;
-    rc_t rc;
-    unsigned cur_off = ro_offset ? *ro_offset : 0;
-    
-#define BUF_WRITE(OP, LEN) if ((rc = op2b(dst, bsz + boff, &nwrit, (OP), (LEN))) != 0) return rc; bsz += nwrit;
-
-#define MACRO_FLUSH_MATCH    { BUF_WRITE('=', m); m = 0; }
-#define MACRO_FLUSH_MISMATCH { BUF_WRITE(i == read_end ? 'S' : 'X', mm); mm = 0; }
-
-#define MACRO_FLUSH_BOTH \
-if(m+mm > 0) { \
-    if(i==read_end && has_ref_offset[i]) { \
-        BUF_WRITE('M', m); BUF_WRITE('S', mm); \
-    } else { \
-        BUF_WRITE('M', m + mm) \
-    } \
-    m=mm=0; \
-}
-
-#define MACRO_FLUSH \
-if(full){ \
-    MACRO_FLUSH_MATCH; \
-    MACRO_FLUSH_MISMATCH; \
-} else { \
-    MACRO_FLUSH_BOTH; \
-}
-    for(i = read_start, bsz = m = mm = 0; i < read_end; i++) {
-        if(has_ref_offset[i]){ /*** No offset in the reference **/
-            int32_t offset;
-            
-            if( cur_off >= ro_len) /*** bad data ***/
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-            
-            offset = ref_offset[cur_off++];
-            
-            if( offset > 0 ){ /*** insert in the reference, delete in sequence ***/
-                if(i==0) /**** deletes in the beginning are disallowed, REF_START should have been moved and delete converted to insert **/
-                    return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-                MACRO_FLUSH;
-                BUF_WRITE('D', offset);
-            } else if ( offset < 0){ /**** delete from the reference ***/
-                offset = -offset;
-                if( i + offset > read_end)
-                    return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-                if(i > 0) { /** normally indels are before the current base ***/
-                    MACRO_FLUSH;
-                    BUF_WRITE('I', offset);
-                } else { /***  this  is a soft clip at the beginning ***/
-                    BUF_WRITE('S', offset);
-                }
-                i += offset;
-            } else { /*** Not possible ??? ***/
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-            }
-        }
-        if(i < read_end ){
-            if(has_mismatch[i]){
-                if(full) {
-                    MACRO_FLUSH_MATCH;
-                }
-                mm++;
-            } else {
-                if(full) {
-                    MACRO_FLUSH_MISMATCH;
-                } else {
-                    m+=mm;
-                    mm=0;
-                }
-                m++;
-            }
-        }
-    }
-    MACRO_FLUSH;
-    *bsize = bsz;
-    if (ro_offset) *ro_offset = cur_off;
-    return 0;
-    
-#undef BUF_WRITE
-#undef MACRO_FLUSH_MATCH
-#undef MACRO_FLUSH_MISMATCH
-#undef MACRO_FLUSH_BOTH
-#undef MACRO_FLUSH
-}
-
-
-static
-rc_t cigar_string_2(KDataBuffer *dst, size_t boff, uint64_t *bsize, const int version,
-                    bool const has_mismatch[], bool const has_ref_offset[],
-                    INSDC_coord_zero const read_start, INSDC_coord_zero const read_end,
-                    int32_t const ref_offset[], unsigned const ro_len, unsigned* ro_offset,
-                    unsigned const reflen, bool use_S)
-{
-    int ri;
-    unsigned si;
-    unsigned di;
-    rc_t rc;
-    unsigned nwrit;
-    unsigned cur_off = ro_offset ? *ro_offset : 0;
-    unsigned op_len;
-    int opcode;
-    int const opM = version == 1 ? '=' : 'M';
-    int const opX = version == 1 ? 'X' : 'M';
-    int const opS = use_S ? 'S' : 'I';
-    
-#define BUF_WRITE(OP, LEN) { if ((rc = op2b(dst, di + boff, &nwrit, (OP), (LEN))) != 0) return rc; di += nwrit; }
-    si=read_start;
-    if (/* !use_S && */read_start == read_end && reflen > 0) {/** full delete as a last ploidy ends up written nowhere  **/
-        di=0;
-        opcode = 'D';
-        op_len = reflen;
-    }
-    else for (op_len = di = 0, opcode = ri = 0; si < read_end && ri <= (int)reflen; ) {
-        if (has_ref_offset[si]) {
-            int offs;
-            
-            if(op_len > 0) {
-                BUF_WRITE(opcode, op_len);
-                op_len = 0;
-            }
-            if (cur_off >= ro_len) /*** bad data ***/
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-
-            offs = ref_offset[cur_off++];
-            if (offs < 0) {
-                unsigned j;
-                for(j=1; j<-offs && (si + j) < read_end;){
-                    if(has_ref_offset[si+j]){/*** structured insert **/
-                        BUF_WRITE(si ? 'I' : opS, j);
-                        offs += j;
-                        si   += j;
-                        j=1;
-                    } else {
-                        j++;
-                    }
-                }
-                if(offs < 0){
-                    BUF_WRITE(si ? 'I' : opS, -offs);
-                    si -= offs;
-                }
-                continue;
-            }
-            else if (offs > 0) {
-                BUF_WRITE('D', offs);
-                ri += offs;
-            }
-            else
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        }
-        if (ri < (int)reflen) {
-            int const op_nxt = (has_mismatch[si] ? opX : opM);
-            
-            if (op_len == 0 || opcode == op_nxt)
-                ++op_len;
-            else {
-                BUF_WRITE(opcode, op_len);
-                op_len = 1;
-            }
-            opcode = op_nxt;
-        }
-        else
-            break;
-        ++si;
-        ++ri;
-    }
-    BUF_WRITE(opcode, op_len);
-    if (si < read_end){
-        if (cur_off + 1 < ro_len) { 
-            assert(read_end + ref_offset[cur_off] == si);
-            cur_off++;
-            BUF_WRITE('I', read_end - si);
-        }
-        else {
-            BUF_WRITE(opS, read_end - si);
-        }
-    }
-    *bsize = di;
-    if (ro_offset) *ro_offset = cur_off;
-
-    return 0;
-#undef BUF_WRITE
-}
-
-static INSDC_coord_len right_soft_clip(unsigned seq_len, unsigned ref_len,
-                                       unsigned noffsets,
-                                       int32_t const ref_offset[])
-{
-    INSDC_coord_len a = ref_len;
-    unsigned i;
-    
-    for (i = 0; i < noffsets; ++i)
-        a -= ref_offset[i];
-    return a < seq_len ? seq_len - a : 0;
-}
-
-static
-rc_t CC cigar_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    self_t const *self = data;
-    unsigned const rdln = argv[0].u.data.elem_count;
-    unsigned const ro_len = argv[2].u.data.elem_count;
-    bool const *has_mismatch   = argv[0].u.data.base;
-    bool const *has_ref_offset = argv[1].u.data.base;
-    int32_t const *ref_offset   = argv[2].u.data.base;
-    rc_t rc;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(argv[2].u.data.elem_bits == 32);
-
-    assert(rdln == argv[1].u.data.elem_count);
-
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-
-    rslt->data->elem_bits = 8;
-    if (argc == 3)
-        rc = cigar_string(rslt->data, 0, &rslt->elem_count, self->version & 0x1,
-                          has_mismatch, has_ref_offset,
-                          0, rdln, ref_offset, ro_len, NULL);
-    else {
-        int32_t const *const rfln = argv[3].u.data.base;
-        
-        rc = cigar_string_2(rslt->data, 0, &rslt->elem_count, self->version & 0x1,
-                            has_mismatch, has_ref_offset,
-                            0, rdln, ref_offset, ro_len, NULL,
-                            rfln[argv[3].u.data.first_elem],true);
-    }
-    return rc;
-}
-
-static
-rc_t CC cigar_impl_2 ( void *data, const VXformInfo *info, int64_t row_id,
-                        VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    self_t const *self = data;
-    bool const *has_mismatch        = argv[0].u.data.base;
-    bool const *has_ref_offset      = argv[1].u.data.base;
-    int32_t const *ref_offset       = argv[2].u.data.base;
-    INSDC_coord_len const *read_len = argv[3].u.data.base;
-    uint32_t const nreads = argv[3].u.data.elem_count;
-    uint32_t const ro_len = argv[2].u.data.elem_count;
-    uint32_t n;
-    uint32_t ro_offset = 0;
-    rc_t rc = 0;
-    uint64_t cnt;
-    INSDC_coord_zero start;
-    INSDC_coord_len *cigar_len = NULL;
-    KDataBuffer *buf = (self->version & 0x04) ? NULL : rslt->data;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(argv[2].u.data.elem_bits == 32);
-    assert(argv[3].u.data.elem_bits == 32);
-    
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    read_len       += argv[3].u.data.first_elem;
-
-    if( self->version & 0x4 ) {
-        rslt->data->elem_bits = sizeof(*cigar_len) * 8;
-        rslt->elem_count = nreads;
-        rc = KDataBufferResize(rslt->data, rslt->elem_count); if (rc) return rc;
-        cigar_len = rslt->data->base;
-        if (argv[0].u.data.elem_count == 0 ||
-            argv[1].u.data.elem_count == 0)
-        {
-            memset(cigar_len, 0, sizeof(cigar_len[0]) * nreads);
-            return 0;
-        }
-    }
-    else {
-        rslt->data->elem_bits = 8;
-        rslt->elem_count = 0;
-    }
-    for (n = 0, start = 0, ro_offset = 0; n < nreads; start += read_len[n++]) {
-        if (argc == 4)
-            rc = cigar_string(buf, rslt->elem_count, &cnt, self->version & 0x1,
-                              has_mismatch, has_ref_offset,
-                              start, start + read_len[n],
-                              ref_offset, ro_len, &ro_offset);
-        else {
-            int32_t const *const reflen = argv[4].u.data.base;
-            
-            rc = cigar_string_2(buf, rslt->elem_count, &cnt, self->version & 0x1,
-                                has_mismatch, has_ref_offset,
-                                start, start + read_len[n],
-                                ref_offset, ro_len, &ro_offset,
-                                reflen[argv[4].u.data.first_elem],(nreads==1));
-        }
-        if (rc) return rc;
-        if (cigar_len != NULL /*self->version & 0x04*/)
-            cigar_len[n] = cnt;
-        else
-            rslt->elem_count += cnt;
-    }
-    return 0;
-}
-
-static
-void CC self_whack( void *ptr )
-{
-    free( ptr );
-}
-
-
-/* 
- * function
- * ascii ALIGN:cigar #1 ( bool has_mismatch, bool has_ref_offset, I32 ref_offset);
- */
-VTRANSFACT_IMPL ( ALIGN_cigar, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t self;
-
-    self.version =cp -> argv [ 0 ] . data . u8 [ 0 ];
-    switch(self.version){
-    case 0:
-    case 1:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-    }
-    rslt->u.rf = cigar_impl;
-    rslt->variant = vftRow;
-    rslt -> self = malloc ( sizeof self );
-    memcpy(rslt -> self,&self,sizeof(self));
-    rslt -> whack = self_whack;
-
-    return 0;
-}
-
-VTRANSFACT_IMPL ( ALIGN_cigar_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                          VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t self;
-    const VTypedesc* tp = &info->fdesc.desc;
-
-    self.version = cp->argv[0].data.u8[0];
-    switch(self.version) {
-    case 0x0:
-    case 0x1:
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect);
-    }
-
-    if( tp->domain == vtdAscii && tp->intrinsic_bits == 8 ) {
-        self.version |= 0x2;
-    } else if( tp->domain == vtdUint && tp->intrinsic_bits == sizeof(INSDC_coord_len) * 8 ) {
-        self.version |= 0x4;
-    } else {
-        return RC(rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect);
-    }
-    rslt->u.rf = cigar_impl_2;
-    rslt->variant = vftRow;
-    rslt->self = malloc(sizeof self);
-    memcpy(rslt->self, &self, sizeof(self));
-    rslt->whack = self_whack;
-    return 0;
-}
-
-static
-rc_t CC edit_distance_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                            VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t i,roi,mrun;
-    uint32_t len    = argv[0].u.data.elem_count;
-    uint32_t *dst;
-    
-    uint8_t const *has_mismatch   = argv [ 0 ] . u . data . base;
-    uint8_t const *has_ref_offset = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset     = argv [ 2 ] . u . data . base;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(argv[2].u.data.elem_bits == 32);
-    
-    assert(len == argv[1].u.data.elem_count);
-    
-    has_mismatch   += argv [ 0 ] . u . data . first_elem;
-    has_ref_offset += argv [ 1 ] . u . data . first_elem;
-    ref_offset     += argv [ 2 ] . u . data . first_elem;
-    
-    /* resize output row for the total number of reads */    
-    rslt->data->elem_bits = rslt->elem_bits;
-    rc = KDataBufferResize ( rslt -> data, 1);
-    if ( rc != 0 ) return rc;
-    
-    rslt -> elem_count = 1;
-    dst = rslt -> data -> base;
-    dst[0]=0;
-    if(len == 0) return 0; /** nothing to do **/
-    
-    if(has_ref_offset[0]){/** skip mismatches from the beginning == soft clip ***/
-        if(ref_offset[0] > 0)  /**** deletes in the beginning are disallowed, REF_START should have been moved and delete converted to insert **/
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-        i=-ref_offset[0];
-        roi=1;
-        mrun=0;
-    } else {
-        i=roi=0;
-    }
-    for(mrun=0;i<len;i++){
-        if(has_mismatch[i]){
-            mrun++;
-        } else {/*** intentionally skipping last run of mismatches **/
-            dst[0]+=mrun;
-            mrun=0;
-        }
-    }
-    return 0;
-}
-
-/*
- * function
- * ascii NCBI:align:edit_distance #1 ( bool has_mismatch, bool has_ref_offset, I32 ref_offset);
- */
-VTRANSFACT_IMPL ( NCBI_align_edit_distance, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = edit_distance_impl;
-    rslt->variant = vftRow;
-    return 0;
-}
-
-
-/*
- * edit distance = sum of lengths of inserts
- *               + sum of lengths of deletes
- *               + number of mismatches
- * excluding soft clips
- */
-
-unsigned edit_distance(bool const has_ref_offset[],
-                       bool const has_mismatch[],
-                       unsigned const readlen,
-                       unsigned const reflen,
-                       int32_t const ref_offset[],
-                       unsigned const offsets)
-{
-    if (readlen == 0) {
-        /* full delete */
-        return reflen;
-    }
-    else {
-        INSDC_coord_len const rsc = right_soft_clip(readlen, reflen, offsets, ref_offset);
-        unsigned indels = 0;
-        unsigned misses = 0;
-        unsigned i = 0;
-        unsigned j = 0;
-        
-        if (has_ref_offset[0] && ref_offset[j] < 0)
-            j = i = 1;
-        
-        /* sum of insert lengths + sum of delete lengths excluding soft clips */
-        for ( ; i < readlen - rsc; ++i) {
-            if (has_ref_offset[i]) {
-                int const offset = ref_offset[j++];
-                
-                if (offset < 0)
-                    indels += -offset;
-                else
-                    indels +=  offset;
-            }
-        }
-        /* sum of mismatches not in inserts or soft clips */
-        for (j = i = 0; i < readlen - rsc;) {
-            if (has_ref_offset[i]) {
-                int offset = ref_offset[j++];
-                
-                if (offset < 0) {
-                    i += -offset;
-                    continue;
-                }
-            }
-            misses += has_mismatch[i] ? 1 : 0;
-            ++i;
-        }
-        return indels + misses;
-    }
-}
-
-static
-rc_t CC edit_distance_2_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    unsigned const nreads = argc > 4 ? argv[4].u.data.elem_count : 1;
-    unsigned const len = argv[0].u.data.elem_count;
-    unsigned const noffsets = argv[2].u.data.elem_count;
-    INSDC_coord_len const dummy_rl = len;
-
-    ARG_ALIAS     (bool           , has_mismatch  , 0);
-    ARG_ALIAS     (bool           , has_ref_offset, 1);
-    ARG_ALIAS     (int32_t        , ref_offset    , 2);
-    ARG_ALIAS     (INSDC_coord_len, ref_len       , 3);
-    ARG_ALIAS_COND(INSDC_coord_len, readlen       , 4, &dummy_rl);
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch  [0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset    [0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len       [0]) * 8);
-
-    rslt->data->elem_bits = rslt->elem_bits;
-    if (len == 0) {
-        return KDataBufferResize(rslt->data, rslt->elem_count = 0);
-    }
-    
-    assert(len == argv[1].u.data.elem_count);
-
-    rslt->elem_count = nreads;
-    rc = KDataBufferResize(rslt->data, nreads);
-    if (rc == 0) {
-        unsigned i;
-        unsigned start = 0;
-        unsigned offset = 0;
-        uint32_t *const dst = rslt->data->base;
-        
-        for (i = 0; i < nreads; ++i) {
-            unsigned const rlen = readlen[i];
-            unsigned j;
-            unsigned offsets = 0;
-            
-            for (j = 0; j < rlen; ++j) {
-                if (has_ref_offset[start + j])
-                    ++offsets;
-            }
-            if (offsets + offset > noffsets)
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-            
-            dst[i] = edit_distance(has_ref_offset + start,
-                                   has_mismatch + start,
-                                   rlen,
-                                   ref_len[0],
-                                   ref_offset + offset,
-                                   offsets);
-            start += rlen;
-            offset += offsets;
-        }
-    }
-    return rc;
-}
-
-/*
- * function
- * U32 NCBI:align:edit_distance #2 ( bool has_mismatch, bool has_ref_offset,
- *     I32 ref_offset, INSDC:coord:len ref_len );
- */
-VTRANSFACT_IMPL ( NCBI_align_edit_distance_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = edit_distance_2_impl;
-    rslt->variant = vftRow;
-    return 0;
-}
-
-
-/*
- * function bool ALIGN:generate_has_mismatch #1 (INSDC:4na:bin reference,
- *     INSDC:4na:bin subject, bool has_ref_offset, I32 ref_offset);
- */
-static
-rc_t CC generate_has_mismatch_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int32_t si,ri,roi;
-    uint32_t ref_len = argv[0].u.data.elem_count;
-    uint32_t sbj_len = argv[1].u.data.elem_count;
-    uint32_t hro_len = argv[2].u.data.elem_count;
-    uint32_t ro_len  = argv[3].u.data.elem_count;
-    const uint8_t *ref  = argv [ 0 ] . u . data . base;
-    const uint8_t *sbj  = argv [ 1 ] . u . data . base;
-    const uint8_t *has_ref_offset     = argv [ 2 ] . u . data . base;
-    const int32_t *ref_offset = argv [ 3 ] . u . data . base;
-
-    uint8_t * dst;
-    uint32_t  len = 0;
-
-    rslt -> data -> elem_bits = 8;
-    if (sbj_len == 0) {
-        rc = KDataBufferResize ( rslt -> data, 0 );
-        if ( rc != 0 )
-            return rc;
-        rslt -> elem_count = 0;
-        return 0;
-    }
-    assert(sbj_len == hro_len);
-    len = sbj_len;
-
-    ref            += argv [ 0 ] . u . data . first_elem;
-    sbj            += argv [ 1 ] . u . data . first_elem;
-    has_ref_offset += argv [ 2 ] . u . data . first_elem;
-    ref_offset     += argv [ 3 ] . u . data . first_elem;
-
-    /* resize output row for the total number of reads */
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, len );
-    if ( rc != 0 )
-        return rc;
-    rslt -> elem_count = len;
-    dst = rslt -> data->base;
-    for(si=ri=roi=0;si< len;si++,ri++){
-        if(has_ref_offset[si] != 0){/*** need to offset the reference ***/
-            if( roi >= ro_len){
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-            }
-            ri += ref_offset[roi++];
-        }
-        if(ri >=0 && ri < ref_len && sbj[si]==ref[ri])
-            dst[si]=0;
-        else
-            dst[si]=1;
-    }
-    return 0;
-}
-
-
-VTRANSFACT_IMPL ( ALIGN_generate_has_mismatch, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = generate_has_mismatch_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-/*
- * function bool ALIGN:generate_mismatch #1 (INSDC:4na:bin reference,INSDC:4na:bin subject, bool has_ref_offset, I32 ref_offset);
- */
-static
-rc_t CC generate_mismatch_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int32_t si,ri,roi;
-    uint32_t ref_len = argv[0].u.data.elem_count;
-    uint32_t sbj_len = argv[1].u.data.elem_count;
-    uint32_t hro_len = argv[2].u.data.elem_count;
-    uint32_t ro_len  = argv[3].u.data.elem_count;
-    const uint8_t *ref  = argv [ 0 ] . u . data . base;
-    const uint8_t *sbj  = argv [ 1 ] . u . data . base;
-    const uint8_t *has_ref_offset     = argv [ 2 ] . u . data . base;
-    const int32_t *ref_offset = argv [ 3 ] . u . data . base;
-    uint8_t	buf[5*1024];
-    uint32_t  len;
-
-    rslt -> data -> elem_bits = 8;
-    if (sbj_len == 0) {
-        return KDataBufferResize(rslt->data, rslt->elem_count = 0);
-    }
-    assert(sbj_len == hro_len );
-
-    ref            += argv [ 0 ] . u . data . first_elem;
-    sbj            += argv [ 1 ] . u . data . first_elem;
-    has_ref_offset += argv [ 2 ] . u . data . first_elem;
-    ref_offset     += argv [ 3 ] . u . data . first_elem;
-
-    for(si=ri=roi=0,len=0;si<sbj_len;si++,ri++){
-        if(has_ref_offset[si] != 0){/*** need to offset the reference ***/
-            if( roi >= ro_len){
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-            }
-            ri += ref_offset[roi++];
-        }
-        if(ri >=0 && ri < ref_len && sbj[si]==ref[ri]){/*noop*/}
-        else {
-            if(len > sizeof(buf)) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-            buf[len++]=sbj[si];
-        }
-    }
-    /* resize output row for the total number of reads */
-    rc = KDataBufferResize ( rslt -> data, len );
-    if ( rc != 0 )
-        return rc;
-    rslt -> elem_count = len;
-    memcpy(rslt -> data->base,buf,len);
-    return 0;
-}
-
-VTRANSFACT_IMPL ( ALIGN_generate_mismatch, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = generate_mismatch_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function INSDC:quality:phred NCBI:align:generate_mismatch_qual #1 (INSDC:quality:phred qual,bool has_mismatch)
- */
-static
-rc_t CC generate_mismatch_qual_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const uint8_t *q  = argv[0].u.data.base; 
-    const uint8_t *h_mm           = argv[1].u.data.base;
-    uint8_t	buf[5*1024];
-    uint32_t	mm_cnt,i;
-
-    q    += argv[0].u.data.first_elem;
-    h_mm += argv[1].u.data.first_elem;
-    for(mm_cnt=0,i=0;i<argv[0].u.data.elem_count;i++){
-        if(h_mm[i]){
-            buf[mm_cnt++]=q[i];
-        }
-    }
-    /* resize output row for the total number of reads */
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, mm_cnt );
-    if ( rc != 0 )
-        return rc;
-    rslt -> elem_count = mm_cnt;
-    if(mm_cnt > 0) memcpy(rslt -> data->base,buf,mm_cnt);
-    return 0;
-}
-
-
-VTRANSFACT_IMPL ( ALIGN_generate_mismatch_qual, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = generate_mismatch_qual_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function ascii NCBI:align:get_mismatch_read #1
- *    ( bool has_mismatch, INSDC:dna:text mismatch )
- */
-static
-rc_t CC get_mismatch_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    char *result;
-    unsigned const readlen = argv[0].u.data.elem_count;
-    
-    rslt->data->elem_bits = sizeof(result[0]) * 8;
-    rslt->elem_count = readlen;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        unsigned i;
-        unsigned j;
-        bool const *has_mismatch = argv[0].u.data.base;
-        char const *mismatch = argv[1].u.data.base;
-        
-        assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-        has_mismatch += argv[0].u.data.first_elem;
-        
-        assert(argv[1].u.data.elem_bits == sizeof(mismatch[0]) * 8);
-        mismatch += argv[1].u.data.first_elem;
-        
-        result = rslt->data->base;
-        for (i = j = 0; i != readlen; ++i) {
-            result[i] = has_mismatch[i] ? mismatch[j++] : '=';
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_mismatch_read, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_mismatch_read_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function INSDC:coord:len NCBI:align:get_left_soft_clip #1 (
- *     bool has_ref_offset, INSDC:coord:zero ref_offset )
- */
-static
-rc_t CC left_soft_clip_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len result;
-    unsigned const n_offsets = argv[1].u.data.elem_count;
-    
-    result = 0;
-    
-    if (n_offsets > 0) {
-        bool const *has_ref_offset = argv[0].u.data.base;
-        int32_t const *ref_offset = argv[1].u.data.base;
-        
-        assert(argv[0].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-        assert(argv[1].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-        
-        has_ref_offset += argv[0].u.data.first_elem;
-        ref_offset += argv[1].u.data.first_elem;
-        
-        if (has_ref_offset[0] && ref_offset[0] < 0) {
-            result = -ref_offset[0];
-        }
-    }
-    rslt->data->elem_bits = sizeof(result) * 8;
-    rslt->elem_count = 1;
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc == 0)
-        memcpy(rslt->data->base, &result, sizeof(result));
-    return rc;
-}
-
-static
-rc_t CC left_soft_clip_impl_2 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len* result;
-    const bool* has_ref_offset = argv[0].u.data.base;
-    const int32_t* ref_offset = argv[1].u.data.base;
-    const uint64_t n_offsets = argv[1].u.data.elem_count;
-    const INSDC_coord_len* read_len = argv[2].u.data.base;
-    const uint32_t nreads = argv[2].u.data.elem_count;
-    uint32_t n, roi;
-    INSDC_coord_zero start;
-
-    assert(argv[0].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(read_len[0]) * 8);
-    
-    has_ref_offset += argv[0].u.data.first_elem;
-    ref_offset += argv[1].u.data.first_elem;
-    read_len += argv[2].u.data.first_elem;
-
-    rslt->data->elem_bits = sizeof(*result) * 8;
-    rslt->elem_count = nreads;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    result = rslt->data->base;
-
-    for(n = roi = start = 0; rc == 0 && n < nreads; start += read_len[n++]) {
-        if(has_ref_offset[start] && ref_offset[roi] < 0) {
-            if( roi >= n_offsets ) {
-                rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-                break;
-            }
-            result[n] = -ref_offset[roi];
-        } else {
-            result[n] = 0;
-        }
-        if( n < nreads - 1 && roi < n_offsets ) {
-            /* scroll through has_ref_offset and consume ref_offsets for this read
-               only if there is next read or more offsets */
-            uint32_t k;
-            for(k = start; k < start + read_len[n]; k++) {
-                if( has_ref_offset[k] ) {
-                    if( roi >= n_offsets ) {
-                        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-                        break;
-                    }
-                    roi++;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_left_soft_clip, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = left_soft_clip_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_left_soft_clip_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = left_soft_clip_impl_2;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-/*
- * function INSDC:coord:len NCBI:align:get_right_soft_clip #1 ( 
- *     bool has_mismatch, INSDC:coord:len left_clip )
- */
-static
-rc_t CC right_soft_clip_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len result = 0;
-    INSDC_coord_len left = 0;
-    uint32_t    right = argv[0].u.data.elem_count;
-    bool const *has_mismatch = argv[0].u.data.base;
-    bool const *has_ref_offset = NULL;
-    int32_t    last_ref_offset = 0;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    has_mismatch += argv[0].u.data.first_elem;
-    
-    if( argc > 2 ) {
-        has_ref_offset = argv[2].u.data.base;
-        has_ref_offset += argv[2].u.data.first_elem;
-        if(argc > 3 ) {
-            const int32_t *ro = argv[3].u.data.base;
-            ro += argv[3].u.data.first_elem;
-            if(argv[3].u.data.elem_count > 0){
-                last_ref_offset = ro[argv[3].u.data.elem_count-1];
-            }
-        }
-    }
-    
-    assert(argv[1].u.data.elem_bits == sizeof(left) * 8);
-    left = ((INSDC_coord_len const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    
-    while (right != left && has_mismatch[right - 1] &&
-           (has_ref_offset == NULL || has_ref_offset[right - 1] == 0) )
-    {
-        ++result;
-        --right;
-    }
-    while(right > 0 && last_ref_offset <0 && has_ref_offset[right - 1] == 0){ /*** some mismatches from left needs to be recovered to cover for inserts **/
-        last_ref_offset++;
-        right--;
-    }
-    if(last_ref_offset < -1 ){
-        last_ref_offset ++;
-        if(result < -last_ref_offset) result=0;
-        else result += last_ref_offset;
-    } else if (last_ref_offset > 0){
-	result += last_ref_offset;
-    }
-    
-    rslt->data->elem_bits = sizeof(result) * 8;
-    rslt->elem_count = 1;
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc == 0)
-        memcpy(rslt->data->base, &result, sizeof(result));
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_right_soft_clip, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = right_soft_clip_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_right_soft_clip_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = right_soft_clip_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-/*
- * function INSDC:coord:len NCBI:align:get_right_soft_clip #3 
- *     ( bool has_ref_offset, I32 ref_offset, INSDC:coord:len ref_len )
- */
-static
-rc_t CC right_soft_clip_3_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len const ref_len = ((INSDC_coord_len const *)argv[2].u.data.base)[argv[2].u.data.first_elem];
-    unsigned const seq_len = argv[0].u.data.elem_count;
-    int32_t const *ref_offset  = &((int32_t const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    unsigned const n = argv[1].u.data.elem_count;
-    
-    assert(argv[1].u.data.elem_bits == sizeof(ref_offset    [0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_len          ) * 8);
-
-    rslt->data->elem_bits = rslt->elem_bits;
-    rslt->elem_count = 1;
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc == 0)
-        ((INSDC_coord_len *)rslt->data->base)[0] = right_soft_clip(seq_len, ref_len, n, ref_offset);
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_right_soft_clip_3, 3, 0, 0 )
-    ( const void *Self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = right_soft_clip_3_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-static
-rc_t CC right_soft_clip_4_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                                 VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len* result;
-    const bool* has_ref_offset = argv[0].u.data.base;
-    const int32_t* ref_offset = argv[1].u.data.base;
-    const uint64_t n_offsets = argv[1].u.data.elem_count;
-    const INSDC_coord_len* read_len = argv[2].u.data.base;
-    const uint32_t nreads = argv[2].u.data.elem_count;
-    const INSDC_coord_len* ref_len = argv[3].u.data.base;
-    uint32_t n, roi;
-    INSDC_coord_zero start;
-
-    assert(argv[0].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(read_len[0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len[0]) * 8);
-    assert(argv[3].u.data.elem_count == 1);
-    
-    has_ref_offset += argv[0].u.data.first_elem;
-    ref_offset += argv[1].u.data.first_elem;
-    read_len += argv[2].u.data.first_elem;
-    ref_len += argv[3].u.data.first_elem;
-
-    rslt->data->elem_bits = sizeof(*result) * 8;
-    rslt->elem_count = nreads;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    result = rslt->data->base;
-
-    for(n = roi = start = 0; rc == 0 && n < nreads; ++n) {
-        INSDC_coord_len const rlen = read_len[n];
-        unsigned k;
-        unsigned offset_count;
-        
-        for (k = offset_count = 0; k < rlen; ++k) {
-            if (has_ref_offset[k + start])
-                ++offset_count;
-        }
-        result[n] = right_soft_clip(rlen, ref_len[0], offset_count, ref_offset);
-        ref_offset += offset_count;
-        start += rlen;
-#if 0
-        result[n] = read_len[n] - ref_len[0];
-        for(k = start; k < start + read_len[n]; k++) {
-            if( has_ref_offset[k] ) {
-                if( roi >= n_offsets ) {
-                    rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-                    break;
-                }
-                result[n] += ref_offset[roi++];
-            }
-        }
-#endif
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_right_soft_clip_4, 4, 0, 0 )
-    ( const void *Self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = right_soft_clip_4_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-/*
- * function ascii NCBI:align:get_clipped_cigar #1 ( ascii cigar )
- */
-static
-rc_t CC clipped_cigar_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    char const *cigar = argv[0].u.data.base;
-    unsigned const ciglen = argv[0].u.data.elem_count;
-    int n;
-    unsigned start = 0;
-    unsigned end = ciglen;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(cigar[0]) * 8);
-    cigar += argv[0].u.data.first_elem;
-    
-    for (n = 0; n != ciglen; ++n) {
-        if (!isdigit(cigar[n]))
-            break;
-    }
-    if (cigar[n] == 'S')
-        start = n + 1;
-    
-    if (cigar[end - 1] == 'S') {
-        --end;
-        while (end > start && isdigit(cigar[end - 1]))
-            --end;
-    }
-    
-    rslt->data->elem_bits = sizeof(cigar[0]) * 8;
-    rslt->elem_count = (end > start)? end - start:0;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0 && rslt->elem_count > 0)
-        memcpy(rslt->data->base, &cigar[start], rslt->elem_count);
-    
-    return rc;
-}
-
-static
-rc_t CC clipped_cigar_impl_v2 ( void *data, const VXformInfo *info, int64_t row_id,
-                                VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    const char* cigar = argv[0].u.data.base;
-    const INSDC_coord_len* cigar_len = argv[1].u.data.base;
-    const uint32_t nreads = argv[1].u.data.elem_count;
-    INSDC_coord_len* new_cigar_len;
-    uint32_t n;
-    INSDC_coord_zero rstart;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(*cigar) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(*cigar_len) * 8);
-
-    if (argv[0].u.data.elem_count == 0) {
-        return KDataBufferResize(rslt->data, rslt->elem_count = 0);
-    }
-    
-    cigar += argv[0].u.data.first_elem;
-    cigar_len += argv[1].u.data.first_elem;
-
-    if( data != NULL ) {
-        rslt->data->elem_bits = sizeof(*cigar_len) * 8;
-        rslt->elem_count = nreads;
-        rc = KDataBufferResize(rslt->data, rslt->elem_count);
-        new_cigar_len = rslt->data->base;
-    } else {
-        rslt->elem_count = 0;
-        rslt->data->elem_bits = sizeof(*cigar) * 8;
-    }
-    for(n = rstart = 0; n < nreads; rstart += cigar_len[n++]) {
-        INSDC_coord_zero i = rstart, start = rstart;
-        INSDC_coord_zero end = start + cigar_len[n];
-
-        /* drop all \d+S groups at head */
-        while(i < end) {
-            if(cigar[i] == 'S') {
-                start = i + 1;
-            } else if( !isdigit(cigar[i]) ) {
-                break;
-            }
-            i++;
-        }
-        /* drop all \d+S groups at tail */
-        while(end > start) {
-            end--;
-            if(cigar[end] != 'S' && !isdigit(cigar[end]) ) {
-                break;
-            }
-        }
-        if( data == NULL ) {
-            int64_t x = end - start + 1;
-            if( x > 0 && (rc = KDataBufferResize(rslt->data, rslt->elem_count + x)) == 0 ) {
-                char* b = rslt->data->base;
-                memcpy(&b[rslt->elem_count], &cigar[start], x);
-                rslt->elem_count += x;
-            }
-        } else {
-            new_cigar_len[n] = end - start + 1;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_clipped_cigar, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = clipped_cigar_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_clipped_cigar_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    const VTypedesc* tp = &info->fdesc.desc;
-
-    if( tp->domain == vtdAscii && tp->intrinsic_bits == 8 ) {
-        rslt->self = NULL;
-    } else if( tp->domain == vtdUint && tp->intrinsic_bits == sizeof(INSDC_coord_len) * 8 ) {
-        rslt->self = rslt; /* something different from NULL :) */
-    } else {
-        return RC(rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect);
-    }
-    rslt->u.rf = clipped_cigar_impl_v2;
-    rslt->variant = vftRow;
-    rslt->whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function I32 NCBI:align:get_clipped_ref_offset #1 (
- *     bool has_ref_offset, I32 ref_offset )
- */
-static
-rc_t CC clipped_ref_offset_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    unsigned start = 0;
-    unsigned const n_offsets = argv[1].u.data.elem_count;
-    int32_t const *ref_offset = argv[1].u.data.base;
-    
-    assert(argv[1].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    ref_offset += argv[1].u.data.first_elem;
-    
-    if (n_offsets > 0) {
-        bool const *has_ref_offset = argv[0].u.data.base;
-        
-        assert(argv[0].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-        has_ref_offset += argv[0].u.data.first_elem;
-        
-        if (has_ref_offset[0] && ref_offset[0] < 0)
-            start = 1;
-    }
-    rslt->data->elem_bits = sizeof(ref_offset[0]) * 8;
-    rslt->elem_count = n_offsets - start;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0)
-        memcpy(rslt->data->base, &ref_offset[start], sizeof(ref_offset[0]) * rslt->elem_count);
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_clipped_ref_offset, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = clipped_ref_offset_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function INSDC:coord:len NCBI:align:get_ref_len #1 (
- *     bool has_ref_offset, I32 ref_offset, INSDC:coord:len right_clip )
- */
-static
-rc_t CC get_ref_len_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len result,right=0;
-    
-    unsigned const read_len = argv[0].u.data.elem_count;
-    unsigned const n_offsets = argv[1].u.data.elem_count;
-    bool const *hro = argv[0].u.data.base;
-    int32_t const *ref_offset = argv[1].u.data.base;
-    
-    assert(argv[1].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    
-    hro += argv[0].u.data.first_elem;
-    ref_offset += argv[1].u.data.first_elem;
-
-    if( argc > 2 ) {
-	right = ((INSDC_coord_len*)argv[2].u.data.base)[argv[2].u.data.first_elem];
-        
-        assert(argv[2].u.data.elem_bits == sizeof(right) * 8);
-        assert(read_len >= right);
-    }
-    if( n_offsets == 0){
-	if(read_len < right) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-	result = read_len - right;
-    } else {
-	int32_t  ires, rov;
-	unsigned i;
-	
-	if(argc > 2){/*** clipping ***/
-		for(i=0,ires=read_len - right;i<n_offsets;i++){
-			memcpy( & rov, ref_offset + i, sizeof rov );
-			ires += rov;
-        }
-	} else {
-		int32_t sum_pos,sum_neg;
-		for(i=0,sum_pos=sum_neg=0;i<n_offsets;i++){
-			memcpy( & rov, ref_offset + i, sizeof rov );
-			if (rov > 0) sum_pos += rov;
-			else         sum_neg += rov;            
-		}
-		if(sum_pos + sum_neg >= 0){/** all offsets may not over-shorten needed reference ***/
-			ires = read_len + sum_pos + sum_neg;
-		} else { /** inefficient case - exact reach into the reference is needed **/
-			unsigned j;
-			for(i=0,j=0,sum_pos=0,ires=0;j<read_len; j++){
-				if(hro[i]){
-					if(i >= n_offsets) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-					memcpy( & rov, ref_offset + i, sizeof rov );
-					ires += rov;
-					i++;
-				}
-				sum_pos ++;
-				if(sum_pos > ires) ires=sum_pos;
-			}
-		}
-	}
-	if(ires < 0) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-	result=ires;
-    }
-    rslt->data->elem_bits = sizeof(result) * 8;
-    rslt->elem_count = 1;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0)
-	memcpy(rslt->data->base,&result,sizeof(result));
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_ref_len, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_ref_len_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function < type T > T NCBI:align:clip #1 ( T value,
- *     INSDC:coord:len left, INSDC:coord:len right )
- */
-static
-rc_t CC clip_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    INSDC_coord_len left =  ((INSDC_coord_len const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    INSDC_coord_len right = ((INSDC_coord_len const *)argv[2].u.data.base)[argv[2].u.data.first_elem];
-
-    rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    if (argv[0].u.data.elem_count >= left + right)
-        rslt->elem_count = argv[0].u.data.elem_count - left - right;
-    else
-        rslt->elem_count = 0;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        if ((rslt->data->elem_bits & 7) == 0)
-            memcpy(rslt->data->base,
-                   &((char const *)argv[0].u.data.base)[((left + argv[0].u.data.first_elem) * argv[0].u.data.elem_bits) >> 3],
-                   (rslt->elem_count * rslt->data->elem_bits) >> 3);
-        else
-            bitcpy(rslt->data->base, 0, argv[0].u.data.base,
-                   (left + argv[0].u.data.first_elem) * argv[0].u.data.elem_bits,
-                   rslt->elem_count * rslt->data->elem_bits);
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_clip, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = clip_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-static
-rc_t CC clip_impl_2 ( void *data, const VXformInfo *info, int64_t row_id,
-                      VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const INSDC_coord_len* read_len = argv[1].u.data.base;
-    const uint32_t nreads = argv[1].u.data.elem_count;
-    const INSDC_coord_len* left =  argv[2].u.data.base;
-    const INSDC_coord_len* right = argv[3].u.data.base;
-    uint32_t n;
-    INSDC_coord_zero start;
-
-    assert(argv[1].u.data.elem_count == argv[2].u.data.elem_count);
-    assert(argv[1].u.data.elem_count == argv[3].u.data.elem_count);
-    assert(argv[1].u.data.elem_bits == sizeof(read_len[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(left[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(right[0]) * 8);
-
-    read_len += argv[1].u.data.first_elem;
-    left += argv[2].u.data.first_elem;
-    right += argv[3].u.data.first_elem;
-
-    rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rslt->elem_count = 0;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc)
-        return rc;
-    if (argv[0].u.data.elem_count == 0)
-        return 0;
-
-    for(n = start = 0; rc == 0 && n < nreads; start += read_len[n++]) {
-        uint64_t x = left[n] + right[n];
-        assert(argv[0].u.data.elem_count >= start);
-        assert(argv[0].u.data.elem_count >= start + read_len[n]);
-        if( read_len[n] > x ) {
-            x = read_len[n] - x;
-            if( x > 0 && (rc = KDataBufferResize(rslt->data, rslt->elem_count + x)) == 0) {
-                bitcpy(rslt->data->base, rslt->elem_count * argv[0].u.data.elem_bits,
-                       argv[0].u.data.base, (argv[0].u.data.first_elem + start + left[n]) * argv[0].u.data.elem_bits,
-                       x * rslt->data->elem_bits);
-                rslt->elem_count += x;
-            }
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_clip_2, 2, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = clip_impl_2;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-/*
- * function bool NCBI:align:get_ref_mismatch #1
- *     ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
- *       INSDC:coord:len ref_len )
- */
-static
-rc_t CC get_ref_mismatch_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                   VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    bool const *has_mismatch       = argv [ 0 ] . u . data . base;
-    bool const *has_ref_offset     = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset      = argv [ 2 ] . u . data . base;
-    INSDC_coord_len const *ref_len = argv [ 3 ] . u . data . base; 
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len[0]) * 8);
-    
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(bool) * 8;
-    rslt->elem_count = ref_len[argv[3].u.data.first_elem];
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        bool *result = (bool *)rslt->data->base;
-        unsigned j;
-        unsigned ri;
-        unsigned si;
-        
-        memset(result, 0, sizeof(result[0]) * rslt->elem_count);
-        for (j = ri = si = 0; si < argv[0].u.data.elem_count;) {
-            if (has_ref_offset[si]) {
-                int offset = ref_offset[j++];
-                
-                if (offset > 0)
-                    ri += offset;
-                else {
-                    si -= offset;
-                    continue;
-                }
-            }
-            if (ri >= rslt->elem_count) break;
-            if (has_mismatch[si]) {
-                result[ri] = 1;
-            }
-            ++si;
-            ++ri;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_ref_mismatch, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_ref_mismatch_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function bool NCBI:align:get_ref_insert #1
- *     ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
- *       INSDC:coord:len ref_len )
- */
-static
-rc_t CC get_ref_insert_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                               VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    bool const *has_mismatch       = argv [ 0 ] . u . data . base;
-    bool const *has_ref_offset     = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset      = argv [ 2 ] . u . data . base;
-    INSDC_coord_len const *ref_len = argv [ 3 ] . u . data . base; 
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len[0]) * 8);
-    
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(bool) * 8;
-    rslt->elem_count = ref_len[argv[3].u.data.first_elem];
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        bool *result = (bool *)rslt->data->base;
-        unsigned j;
-        unsigned ri;
-        unsigned si;
-        
-        memset(result, 0, sizeof(result[0]) * rslt->elem_count);
-        for (j = ri = si = 0; si < argv[0].u.data.elem_count;) {
-            if (has_ref_offset[si]) {
-                int offset = ref_offset[j++];
-                
-                if (offset > 0) {
-                    ri += offset;
-                }
-                else {
-                    if (si) {
-                        if (ri >= 1) result[ri-1] = 1;
-                        result[ri] = 1;
-                    }
-                    si -= offset;
-                    continue;
-                }
-            }
-            ++si;
-            ++ri;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_ref_insert, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_ref_insert_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function bool NCBI:align:get_ref_delete #1
- *     ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
- *       INSDC:coord:len ref_len )
- */
-static
-rc_t CC get_ref_delete_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    bool const *has_mismatch       = argv [ 0 ] . u . data . base;
-    bool const *has_ref_offset     = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset      = argv [ 2 ] . u . data . base;
-    INSDC_coord_len const *ref_len = argv [ 3 ] . u . data . base; 
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len[0]) * 8);
-    
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(bool) * 8;
-    rslt->elem_count = ref_len[argv[3].u.data.first_elem];
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        bool *result = (bool *)rslt->data->base;
-        unsigned j;
-        unsigned ri;
-        unsigned si;
-        
-        memset(result, 0, sizeof(result[0]) * rslt->elem_count);
-        for (j = ri = si = 0; si < argv[0].u.data.elem_count;) {
-            if (has_ref_offset[si]) {
-                int offset = ref_offset[j++];
-                
-                if (offset > 0) {
-                    memset(&result[ri], 1, offset);
-                    ri += offset;
-                }
-                else {
-                    si -= offset;
-                    continue;
-                }
-            }
-            ++si;
-            ++ri;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_ref_delete, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_ref_delete_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-#define USE_BIGGER_PRESERVE_BORDER 1
-/*
- * function bool NCBI:align:get_preserve_qual #1
- *     ( bool has_mismatch, bool has_ref_offset, I32 ref_offset,
- *       INSDC:coord:len ref_len )
- */
-static
-rc_t CC get_ref_preserve_qual_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    bool const *has_mismatch       = argv [ 0 ] . u . data . base;
-    bool const *has_ref_offset     = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset      = argv [ 2 ] . u . data . base;
-    INSDC_coord_len const *ref_len = argv [ 3 ] . u . data . base; 
-    
-    assert(argv[0].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    assert(argv[3].u.data.elem_bits == sizeof(ref_len[0]) * 8);
-    
-    has_mismatch   += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(bool) * 8;
-    rslt->elem_count = ref_len[argv[3].u.data.first_elem];
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        bool *result = (bool *)rslt->data->base;
-        unsigned j;
-        unsigned ri;
-        unsigned si;
-        
-        memset(result, 0, sizeof(result[0]) * rslt->elem_count);
-        for (j = ri = si = 0; si < argv[0].u.data.elem_count;) {
-            if (has_ref_offset[si]) {
-                int offset = ref_offset[j++];
-                
-                if (offset > 0) {
-                    /* Preserve the qualities for deleted bases + plus the border */
-#if USE_BIGGER_PRESERVE_BORDER
-                    if (ri >= 2) result[ri-2] = 1;
-#endif
-                    if (ri >= 1) result[ri-1] = 1;
-                    memset(&result[ri], 1, offset);
-                    ri += offset;
-                    result[ri] = 1;
-#if USE_BIGGER_PRESERVE_BORDER
-                    if (ri + 1 < rslt->elem_count) result[ri+1] = 1;
-#endif
-                }
-                else {
-                    if (si) {
-                        /* Preserve the qualites for the bases bordering the insert */
-#if USE_BIGGER_PRESERVE_BORDER
-                        if (ri >= 2) result[ri-2] = 1;
-#endif
-                        if (ri >= 1) result[ri-1] = 1;
-                        result[ri] = 1;
-#if USE_BIGGER_PRESERVE_BORDER
-                        if (ri + 1 < rslt->elem_count) result[ri+1] = 1;
-#endif
-                    }
-                    si -= offset;
-                    continue;
-                }
-            }
-            if (ri >= rslt->elem_count) break;
-            if (has_mismatch[si]) {
-#if USE_BIGGER_PRESERVE_BORDER
-                if (ri >= 1) result[ri-1] = 1;
-#endif
-                result[ri] = 1;
-#if USE_BIGGER_PRESERVE_BORDER
-                if (ri + 1 < rslt->elem_count) result[ri+1] = 1;
-#endif
-            }
-            ++si;
-            ++ri;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_ref_preserve_qual, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_ref_preserve_qual_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-
-
-/*
- * function bool NCBI:align:get_seq_preserve_qual #1
- *    ( bool ref_preserve_qual, bool has_ref_offset, I32 ref_offset );
- */
-static
-rc_t CC get_seq_preserve_qual_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                                    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    bool const *ref_pq             = argv [ 0 ] . u . data . base;
-    bool const *has_ref_offset     = argv [ 1 ] . u . data . base;
-    int32_t const *ref_offset      = argv [ 2 ] . u . data . base;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(ref_pq[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(has_ref_offset[0]) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(ref_offset[0]) * 8);
-    
-    ref_pq         += argv[0].u.data.first_elem;
-    has_ref_offset += argv[1].u.data.first_elem;
-    ref_offset     += argv[2].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(bool) * 8;
-    rslt->elem_count = argv[1].u.data.elem_count;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0) {
-        bool *result = (bool *)rslt->data->base;
-        unsigned j;
-        unsigned ri;
-        unsigned si;
-        
-        memset(result, 1, sizeof(result[0]) * rslt->elem_count);
-        for (j = ri = si = 0; si < argv[1].u.data.elem_count;) {
-            if (has_ref_offset[si]) {
-                int offset = ref_offset[j++];
-                
-                if (offset > 0) {
-                    ri += offset;
-                }
-                else {
-                    si -= offset;
-                    continue;
-                }
-            }
-            if (ri >= argv[0].u.data.elem_count) break;
-            result[si] = ref_pq[ri];
-            ++si;
-            ++ri;
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_get_seq_preserve_qual, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                                               VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = get_seq_preserve_qual_impl;
-    rslt->variant = vftRow;
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    return 0;
-}
diff --git a/libs/axf/generate-mismatch-qual.c b/libs/axf/generate-mismatch-qual.c
deleted file mode 100644
index 5adbd09..0000000
--- a/libs/axf/generate-mismatch-qual.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-enum args {
-    QUAL,
-    HAS_MISMATCH,
-    LEFT_CLIP,
-    RIGHT_CLIP
-};
-
-static
-rc_t CC generate_mismatch_qual ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    INSDC_quality_phred const *qual = argv[QUAL].u.data.base;
-    bool const *has_mismatch = argv[HAS_MISMATCH].u.data.base;
-    INSDC_coord_len const *left  = argv[LEFT_CLIP].u.data.base;
-    INSDC_coord_len const *right = argv[RIGHT_CLIP].u.data.base;
-    unsigned const readlen = argv[QUAL].u.data.elem_count;
-    INSDC_quality_phred *dst;
-    rc_t rc;
-    unsigned i;
-    unsigned j;
-    
-    assert(argv[QUAL].u.data.elem_bits == sizeof(qual[0]) * 8);
-    assert(argv[HAS_MISMATCH].u.data.elem_bits == sizeof(has_mismatch[0]) * 8);
-    assert(argv[LEFT_CLIP].u.data.elem_bits == sizeof(left[0]) * 8);
-    assert(argv[RIGHT_CLIP].u.data.elem_bits == sizeof(right[0]) * 8);
-    assert(argv[HAS_MISMATCH].u.data.elem_count == readlen);
-    
-    qual += argv[QUAL].u.data.first_elem;
-    has_mismatch += argv[HAS_MISMATCH].u.data.first_elem;
-    left  += argv[LEFT_CLIP ].u.data.first_elem;
-    right += argv[RIGHT_CLIP].u.data.first_elem;
-    
-    rslt->data->elem_bits = argv[QUAL].u.data.elem_bits;
-    rc = KDataBufferResize(rslt->data, argv[QUAL].u.data.elem_count);
-    if (rc)
-        return rc;
-    dst = rslt->data->base;
-    
-    for (j = 0, i = left[0]; i != readlen - right[0]; ++i) {
-        if (has_mismatch[i])
-            dst[j++] = qual[i];
-    }
-    rslt->elem_count = j;
-    return 0;
-}
-
-/*
- * function INSDC:quality:phred NCBI:align:generate_mismatch_qual #2 (
- *    INSDC:quality:phred qual, bool has_mismatch,
- *    INSDC:coord:len left_clip, INSDC:coord:len right_clip );
- */
-VTRANSFACT_IMPL ( NCBI_align_generate_mismatch_qual_2, 2, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = generate_mismatch_qual;
-    rslt -> variant = vftRow;
-    
-    return 0;
-}
-
-static
-rc_t CC compress_quality_impl ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    INSDC_quality_phred const *qual = argv[0].u.data.base;
-    bool const *preserve = argv[1].u.data.base;
-    unsigned const readlen = argv[0].u.data.elem_count;
-    INSDC_quality_phred *dst;
-    rc_t rc;
-    unsigned i;
-    unsigned j;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(qual[0]) * 8);
-    assert(argv[1].u.data.elem_bits == sizeof(preserve[0]) * 8);
-    assert(argv[1].u.data.elem_count == readlen);
-    
-    qual += argv[0].u.data.first_elem;
-    preserve += argv[1].u.data.first_elem;
-    
-    rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rc = KDataBufferResize(rslt->data, argv[0].u.data.elem_count);
-    if (rc)
-        return rc;
-    dst = rslt->data->base;
-    
-    for (j = 0, i = 0; i != readlen; ++i) {
-        if (preserve[i])
-            dst[j++] = qual[i];
-    }
-    rslt->elem_count = j;
-    return 0;
-}
-
-/*
- * function INSDC:quality:phred NCBI:align:compress_quality #1
- *    ( INSDC:quality:phred quality, bool preserved );
- */
-VTRANSFACT_IMPL ( NCBI_align_compress_quality, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = compress_quality_impl;
-    rslt -> variant = vftRow;
-    
-    return 0;
-}
diff --git a/libs/axf/get-sam-flags.c b/libs/axf/get-sam-flags.c
deleted file mode 100644
index 4d6574f..0000000
--- a/libs/axf/get-sam-flags.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <insdc/sra.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* "properly aligned" fragments according to the aligner
-   may mean minimally that the fragments are on the same
-   chromosome. */
-#define PROPER_ALIGNED_MEANS_SAME_CHROMOSOME 1
-
-
-static
-rc_t CC get_sam_flags_impl(void *data, const VXformInfo *info,
-                           int64_t row_id, VRowResult *rslt,
-                           uint32_t nreads,
-                           uint32_t argc, const VRowData argv [] ) 
-{
-    rc_t 	rc;
-    int32_t	*dst;
-    const INSDC_coord_one  *rid = argv[1].u.data.base; /* SEQ_READ_ID */
-    const int32_t         *tlen = argv[2].u.data.base; /* TEMPLATE_LEN */
-    const bool	           *ro1 = argv[3].u.data.base; /* REF_ORIENTATION */
-    const bool             *ro2 = argv[4].u.data.base; /* MATE_REF_ORIENTATION */
-    const bool             *sec = argv[5].u.data.base; 
-    const bool             mate_present = (argv[4].u.data.elem_count > 0 );
-    const SRAReadFilter    *flt = argc > 6 ? argv[6].u.data.base : NULL;
-
-    assert(argv[1].u.data.elem_count == 1);
-    assert(argv[2].u.data.elem_count == 1);
-    assert(argv[3].u.data.elem_count == 1);
-    assert(argv[5].u.data.elem_count == 1);
-    
-    
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if(rc != 0)
-        return rc;
-    rslt->elem_count=1;
-    dst = rslt->data->base;
-    dst[0]=0;
-    if(nreads == 0) return 0;
-    
-    
-    rid  += argv[1].u.data.first_elem;
-    tlen += argv[2].u.data.first_elem;
-    ro1  += argv[3].u.data.first_elem;
-    ro2  += argv[4].u.data.first_elem;
-    sec  += argv[5].u.data.first_elem;
-    if (flt)
-        flt += argv[6].u.data.first_elem;
-    
-    /***************** SAM FLAGS************
-      Bit  Description
-     0x001 template having multiple fragments in sequencing
-     0x002 each fragment properly aligned according to the aligner
-     0x004 fragment unmapped
-     0x008 next fragment in the template unmapped
-     0x010 SEQ being reverse complemented
-     0x020 SEQ of the next fragment in the template being reversed
-     0x040 the first fragment in the template
-     0x080 the last fragment in the template
-     0x100 secondary alignment
-     0x200 not passing quality controls
-     0x400 PCR or optical duplicate
-    ****************************/
-    if(ro1[0])
-        dst[0] |= 0x10;
-    if(sec[0])
-        dst[0] |= 0x100;
-    if(nreads > 1) {
-        if(rid[0] == 1)
-            dst[0] |= 0x40;
-        if (rid[0] == nreads)
-            dst[0] |= 0x80;
-        dst[0] |= 0x1;
-        if(mate_present) {
-#if PROPER_ALIGNED_MEANS_SAME_CHROMOSOME
-           if( tlen[0] != 0 )
-#endif
-                dst[0] |= 0x2;
-           if(ro2[0])
-                dst[0] |= 0x20;
-        } else {
-            dst[0] |= 0x8;
-        }
-    }
-    if( flt ) {
-        if( flt[0] == SRA_READ_FILTER_REJECT ) {
-            dst[0] |= 0x200;
-        } else if( flt[0] == SRA_READ_FILTER_CRITERIA ) {
-            dst[0] |= 0x400;
-        }
-    }
-    return rc;	
-}
-
-static
-rc_t CC get_sam_flags_impl_v1(void *data,const VXformInfo *info, int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] ) 
-{
-	uint32_t nreads = 0;
-    INSDC_coord_len const *read_len = argv[0].u.data.base;
-    unsigned i;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(read_len[0]) * 8);
-    read_len += argv[0].u.data.first_elem;
-   
-#if 1 
-    for (i = 0, nreads = 0; i != argv[0].u.data.elem_count; ++i) {
-        if (read_len[i] != 0)
-            ++nreads;
-    }
-#else
-    nreads = argv[0].u.data.elem_count;
-#endif
-    return get_sam_flags_impl(data, info, row_id, rslt, nreads, argc, argv);
-}
-
-static
-rc_t CC get_sam_flags_impl_v2(void *data,const VXformInfo *info, int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] ) 
-{
-	uint32_t nreads = 1;
-    int64_t const *mate_id = argv[0].u.data.base;
-    unsigned i;
-    
-    assert(argv[0].u.data.elem_bits == sizeof(mate_id[0]) * 8);
-    mate_id += argv[0].u.data.first_elem;
-    
-    for (i = 0; i != argv[0].u.data.elem_count; ++i) {
-        if (mate_id[i] != 0)
-            ++nreads;
-    }
-    return get_sam_flags_impl(data, info, row_id, rslt, nreads, argc, argv);
-}
-
-/*
- * extern function U32 NCBI:align:get_sam_flags #1 (INSDC:coord:len read_len,
- *                                                  INSDC:coord:one read_id,
- *                                                  I32 template_len,
- *                                                  bool strand,
- *                                                  bool mate_strand,
- *                                                  bool is_secondary);
- *
- */
-VTRANSFACT_IMPL ( NCBI_align_get_sam_flags, 1, 0, 0 ) ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-                                                 const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = get_sam_flags_impl_v1;
-    return 0;
-}
-
-/*
- * extern function U32 NCBI:align:get_sam_flags #2 (I64 mate_id,
- *                                                  INSDC:coord:one read_id,
- *                                                  I32 template_len,
- *                                                  bool strand,
- *                                                  bool mate_strand,
- *                                                  bool is_secondary);
- *
- */
-VTRANSFACT_IMPL ( NCBI_align_get_sam_flags_2, 2, 0, 0 ) ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-                                                       const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = get_sam_flags_impl_v2;
-    return 0;
-}
diff --git a/libs/axf/get_mate_align_ids.c b/libs/axf/get_mate_align_ids.c
deleted file mode 100644
index d96e65d..0000000
--- a/libs/axf/get_mate_align_ids.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-
-#include <kdb/meta.h>
-
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <klib/sort.h>
-#include <klib/vector.h>
-
-#include <insdc/sra.h>
-#include <insdc/insdc.h>
-
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-typedef struct ID_cache_t
-{
-    uint32_t idx;
-    VCursor const *curs;
-    KVector *j_cache;
-    KVector *p_cache;
-}ID_cache_t;
-
-#define MIN_DIFF_TO_CACHE 10000
-#define TMP_CACHE_PAGESIZE (16*1024)
-
-
-static rc_t lookup_mate(ID_cache_t *const self, int64_t const id, int64_t *mateid)
-{
-    return KVectorGetI64(self->j_cache, (uint64_t)id,mateid);
-}
-
-static rc_t cache_mate(ID_cache_t *self, int64_t id, int64_t mateid)
-{
-    return KVectorSetU64(self->j_cache, (uint64_t)id, mateid);
-}
-
-static rc_t fetch_mates(ID_cache_t *self, int64_t spotid, const int64_t **ids,uint32_t *rlen)
-{
-    rc_t rc = 0;
-    uint32_t elem_bits;
-    uint32_t boff;
-
-    rc = VCursorCellDataDirect(self->curs, spotid, self->idx,&elem_bits, (const void**) ids, &boff, rlen);
-    assert(*rlen==0 || elem_bits==64);
-    assert(boff==0);
-    return rc;
-}
-static rc_t fetch_mate_id(ID_cache_t *self, int64_t spotid, int64_t const id, int64_t *mateid)
-{
-    rc_t rc = 0;
-    uint32_t rlen;
-    int i;
-    const int64_t *base;
-
-    
-
-    rc = fetch_mates(self, spotid,&base,&rlen);
-    if(rc) return rc;
-    if (rlen > 2) return RC(rcXF, rcFunction, rcExecuting, rcConstraint, rcViolated);
-    mateid[0]=0;
-    for(i=0;i<rlen;i++){
-	if(base[i] != id) {
-		mateid[0] = base[i];
-	}
-    }
-    return rc;
-}
-
-static
-rc_t get_mate_algn_id_impl(ID_cache_t *const self,
-                          int64_t const row, int64_t rslt[],
-                          int64_t const spotid)
-{
-    rc_t rc = 0;
-    bool    page_processed=false;
-    int64_t first,first_blob,last,last_blob;
-
-    /** check cache **/
-    rc = lookup_mate(self, row, rslt);
-    if (rc == 0) return 0;
-
-    /** Page boundary is defined by the variable "first" **/
-    rc = VCursorPageIdRange(self->curs, self->idx, spotid, &first_blob, &last_blob);      if (rc) return rc;
-    first = spotid & ~(TMP_CACHE_PAGESIZE - 1 );
-    if(first < first_blob) first = first_blob;
-    last = first + TMP_CACHE_PAGESIZE -1;
-    if(last > last_blob) last = last_blob;
-
-    rc = KVectorGetBool(self->p_cache, (uint64_t)first,&page_processed);
-    if (rc == 0 && page_processed) { /*** This page was processed before. Row did not need caching. Just fetch Row being asked **/
-	return fetch_mate_id(self, spotid, row, rslt);
-    } else { /** unprocessed page **/
-	int64_t i;
-	
-	rc = KVectorSetBool(self->p_cache, (uint64_t)first,true); /** mark as processed **/
-	if(rc) return rc;
-	
-	for(i=first;i<=last;i++){
-		int64_t	ids[2]={0,0};
-		const int64_t *ptr;
-		uint32_t rlen;
-		rc = fetch_mates(self, i, &ptr,&rlen);
-		if(rc){
-			if(GetRCState ( rc ) == rcNotFound ) rc = 0;
-			else return rc;
-		}
-		memcpy(ids,ptr,rlen*sizeof(*ptr));
-		if(ids[0]!= 0 && ids[1] != 0 && labs(ids[0] - ids[1])> MIN_DIFF_TO_CACHE){
-			rc = cache_mate((ID_cache_t*)self,ids[0],ids[1]);
-			if(rc) return rc;
-			rc = cache_mate((ID_cache_t*)self,ids[1],ids[0]);
-			if(rc) return rc;
-		}
-		if(i==spotid){
-			if(ids[0] == row){
-				rslt[0] = ids[1];
-			} else if(ids[1] == row){
-				rslt[0] = ids[0];
-			} else {
-				return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-			} 
-		}
-	}
-    }
-    return rc;
-}
-static
-rc_t CC get_mate_algn_id_drvr(void *Self,
-                              const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt,
-                              uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    ID_cache_t *self = Self;
-
-    rslt->data->elem_bits = rslt->elem_bits;
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc == 0) {
-#if 0
-        rc = get_mate_algn_id_impl(self, row_id, rslt->data->base,
-           ((int64_t const *)argv[0].u.data.base)[argv[0].u.data.first_elem]);
-#else
-	rc = fetch_mate_id(self, ((int64_t const *)argv[0].u.data.base)[argv[0].u.data.first_elem], row_id, rslt->data->base);
-#endif
-        if (rc == 0){
-	    if(*(int64_t*)rslt->data->base == 0) rslt->elem_count = 0;
-            else rslt->elem_count = 1;
-	}
-    }
-    return rc;
-}
-
-/* open_sub_cursor
- */
-static
-rc_t open_sub_cursor(ID_cache_t *self, const VXfactInfo *info, const VCursor *native_curs)
-{
-    rc_t rc;
-
-    rc = VCursorLinkedCursorGet(native_curs,"SEQUENCE",&self->curs);
-    if(rc != 0){
-	const VDatabase *db;
-	const VTable *tbl;
-	/* get at the parent database */
-	rc = VTableOpenParentRead ( info -> tbl, & db );
-	if(rc != 0) return rc;
-	/* open the table */
-	rc = VDatabaseOpenTableRead ( db, &tbl, "SEQUENCE" );
-	VDatabaseRelease ( db );
-	if(rc != 0) return rc;
-	/* create a cursor */
-	rc = VTableCreateCachedCursorRead(tbl, &self->curs,2UL*1024*1024*1024);
-	VTableRelease(tbl);
-	if(rc != 0) return rc;
-	rc = VCursorPermitPostOpenAdd( self->curs );
-	if(rc != 0) return rc;
-	rc = VCursorOpen( self->curs );
-	if(rc != 0) return rc;
-	rc = VCursorLinkedCursorSet(native_curs,"SEQUENCE",self->curs);
-	if(rc != 0) return rc;
-    } else {
-	    VCursorAddRef(self->curs);
-    }
-    rc = VCursorAddColumn(self->curs, &self->idx, "(I64)PRIMARY_ALIGNMENT_ID");
-    if (rc == 0) {
-	rc = KVectorMake(&self->j_cache);
-	if(rc==0) rc = KVectorMake(&self->p_cache);
-	if(rc==0) return 0;
-    }
-    VCursorRelease(self->curs);
-    return rc;
-}
-
-
-/* close_sub_cursor
- */
-static
-void CC close_sub_cursor(void *data)
-{
-    ID_cache_t *self = data;
-
-    VCursorRelease(self->curs);
-    KVectorRelease(self->j_cache);
-    KVectorRelease(self->p_cache);
-    free(self);
-}
-
-
-/*
- * extern function I64[2] NCBI:align:get_mate_id #1 (I64 spotId);
- */
-VTRANSFACT_IMPL(NCBI_align_get_mate_align_id, 1, 0, 0) (const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp)
-{
-    rc_t rc;
-    ID_cache_t *self = calloc(1, sizeof(*self));
-
-    if (self == NULL)
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-
-    rc = open_sub_cursor(self, info, (const VCursor*)info->parms);
-    if (rc == 0) {
-        rslt->self = self;
-        rslt->u.rf = get_mate_algn_id_drvr;
-        rslt->variant = vftIdDepRow;
-        rslt->whack = close_sub_cursor;
-    }
-    else {
-        free(self);
-    }
-
-    return rc;
-}
diff --git a/libs/axf/libaxf.vers b/libs/axf/libaxf.vers
deleted file mode 100644
index b0f3d96..0000000
--- a/libs/axf/libaxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.8
diff --git a/libs/axf/libwaxf.vers b/libs/axf/libwaxf.vers
deleted file mode 100644
index b0f3d96..0000000
--- a/libs/axf/libwaxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.8
diff --git a/libs/axf/make-cmp-read_desc.c b/libs/axf/make-cmp-read_desc.c
deleted file mode 100644
index 67026c0..0000000
--- a/libs/axf/make-cmp-read_desc.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <insdc/sra.h>
-
-static void copy(void *dst, size_t doff, void const *src, size_t soff, size_t bits)
-{
-    if ((doff & 7) == 0 && (soff & 7) == 0 && (bits & 7) == 0)
-        memcpy(&((char *)dst)[doff >> 3], &((char const *)src)[soff >> 3], bits >> 3);
-    else
-        bitcpy(dst, doff, src, soff, bits);
-}
-
-static
-rc_t CC make_cmp_read_desc_inv_impl(void *data, const VXformInfo *info, int64_t row_id,
-    VFixedRowResult const *rslt, uint32_t argc, VRowData const argv [] )
-{
-    int64_t const *const alignId = &((int64_t const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    void const *const ZERO = data;
-    void const *const base = argv[0].u.data.base;
-    unsigned src = argv[0].u.data.first_elem * rslt->elem_bits;
-    unsigned dst = rslt->first_elem * rslt->elem_bits;
-    unsigned i;
-    
-    for (i = 0; i != rslt->elem_count; ++i) {
-        bool const aligned = alignId[i] != 0;
-
-        copy(rslt->base, dst, !aligned ? base : ZERO, !aligned ? src : 0, rslt->elem_bits);
-
-        src += rslt->elem_bits;
-        dst += rslt->elem_bits;
-    }
-    return 0;
-}
-
-static
-rc_t CC make_cmp_read_desc_impl(void *data, const VXformInfo *info, int64_t row_id,
-    VFixedRowResult const *rslt, uint32_t argc, VRowData const argv [] )
-{
-    int64_t const *const alignId = &((int64_t const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    void const *const ZERO = data;
-    void const *const base = argv[0].u.data.base;
-    unsigned src = argv[0].u.data.first_elem * rslt->elem_bits;
-    unsigned dst = rslt->first_elem * rslt->elem_bits;
-    unsigned i;
-    
-    for (i = 0; i != rslt->elem_count; ++i) {
-        bool const aligned = alignId[i] != 0;
-
-        copy(rslt->base, dst, aligned ? base : ZERO, aligned ? src : 0, rslt->elem_bits);
-
-        src += rslt->elem_bits;
-        dst += rslt->elem_bits;
-    }
-    return 0;
-}
-
-static
-rc_t CC make_read_start_impl(void *data, const VXformInfo *info, int64_t row_id,
-                             VFixedRowResult const *rslt, uint32_t argc, VRowData const argv [] )
-{
-    INSDC_coord_zero *const dst = &((INSDC_coord_zero *)rslt->base)[rslt->first_elem];
-    INSDC_coord_len const *const readlen = &((INSDC_coord_len const *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    INSDC_coord_zero start;
-    unsigned i;
-    
-    for (start = 0, i = 0; i != rslt->elem_count; ++i) {
-        INSDC_coord_len const rlen = readlen[i];
-
-        dst[i] = start;
-        start += rlen;
-    }
-    return 0;
-}
-
-static rc_t make_cmp_read_desc_factory(const void *Self,
-                                       const VXfactInfo *info,
-                                       VFuncDesc *rslt,
-                                       const VFactoryParams *cp,
-                                       const VFunctionParams *dp)
-{
-    rslt->self = calloc(1, (info->fdesc.desc.intrinsic_bits * info->fdesc.desc.intrinsic_bits + 7) >> 3);
-    if (rslt->self == NULL)
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    rslt->whack = free;
-    rslt->u.pf = cp->argv[0].data.b[0] ? make_cmp_read_desc_inv_impl : make_cmp_read_desc_impl;
-    rslt->variant = vftFixedRow;
-    return 0;
-}
-
-/* 
- * function < type T >
- * T NCBI:align:make_cmp_read_desc #1 <bool invert>(T operand, I64 align_id);
- */
-VTRANSFACT_IMPL ( NCBI_align_make_cmp_read_desc, 1, 0, 0 )
-    ( const void *Self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    return make_cmp_read_desc_factory(Self, info, rslt, cp, dp);
-}
-
-/*
- * extern function INSDC:coord:zero NCBI:align:make_read_start #1
- *     (INSDC:coord:len read_len, I64 align_id);
- */
-VTRANSFACT_IMPL ( NCBI_align_make_read_start, 1, 0, 0 )
-    ( const void *Self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.pf = make_read_start_impl;
-    rslt->variant = vftFixedRow;
-    return 0;
-}
diff --git a/libs/axf/mismatch-restore-qual.c b/libs/axf/mismatch-restore-qual.c
deleted file mode 100644
index 8460751..0000000
--- a/libs/axf/mismatch-restore-qual.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-static
-rc_t CC mismatch_restore_qual_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    unsigned i, j;
-    INSDC_quality_phred const *qual	= argv[0].u.data.base;
-    unsigned const nqual = argv[0].u.data.elem_count;
-    bool const *mismatch = argv[1].u.data.base;
-    unsigned const nmis = argv[1].u.data.elem_count;
-    INSDC_quality_phred const rqual = (intptr_t)data;
-    INSDC_quality_phred *dst;
-    
-    qual += argv[0].u.data.first_elem;
-    mismatch += argv[1].u.data.first_elem;
-    
-    rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rc = KDataBufferResize( rslt -> data, nmis );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = nmis;
-    dst = rslt -> data -> base;
-    
-    for (j = i = 0; i != nmis; ++i) {
-        dst[i] = mismatch[i] ? qual[j++] : rqual;
-    }
-    assert(j == nqual);
-    return 0;
-}
-
-/* 
- * function INSDC:quality:phred NCBI:align:mismatch_restore_qual #1 < INSDC:quality:phred matched_qual >
- *    ( INSDC:quality:phred mismatch_qual, bool has_mismatch );
- */
-VTRANSFACT_IMPL ( NCBI_align_mismatch_restore_qual, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->self = (void *)(intptr_t)cp->argv[0].data.u8[0];
-    rslt->u.rf = mismatch_restore_qual_impl;
-    rslt->variant = vftRow;
-    rslt -> whack = NULL;
-    return 0;
-}
-
-static
-rc_t CC decompress_quality_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                                    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    unsigned i, j;
-    INSDC_quality_phred const *qual	= argv[0].u.data.base;
-    unsigned const nqual = argv[0].u.data.elem_count;
-    bool const *preserved = argv[1].u.data.base;
-    unsigned const readlen = argv[1].u.data.elem_count;
-    INSDC_quality_phred const rqual = (intptr_t)data;
-    INSDC_quality_phred *dst;
-    
-    qual += argv[0].u.data.first_elem;
-    preserved += argv[1].u.data.first_elem;
-    
-    rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rc = KDataBufferResize( rslt -> data, readlen );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = readlen;
-    dst = rslt -> data -> base;
-    
-    for (j = i = 0; i != readlen; ++i) {
-        dst[i] = preserved[i] ? qual[j++] : rqual;
-    }
-    assert(j == nqual);
-    return 0;
-}
-
-/* 
- * function INSDC:quality:phred NCBI:align:decompress_quality #1
- *    < INSDC:quality:phred restored_qual_value >
- *    ( INSDC:quality:phred cmp_quality, bool preserved );
- */
-VTRANSFACT_IMPL ( NCBI_align_decompress_quality, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                                               VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->self = (void *)(intptr_t)cp->argv[0].data.u8[0];
-    rslt->u.rf = decompress_quality_impl;
-    rslt->variant = vftRow;
-    rslt -> whack = NULL;
-    return 0;
-}
diff --git a/libs/axf/not-my-row.c b/libs/axf/not-my-row.c
deleted file mode 100644
index 165b205..0000000
--- a/libs/axf/not-my-row.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-static
-rc_t CC not_my_row_impl(void *data,const VXformInfo *info, int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] ) 
-{
-	rc_t 	rc;
-	const int64_t*	src=argv[0].u.data.base;
-	uint32_t	len=argv[0].u.data.elem_count;
-	
-	src += argv[0].u.data.first_elem;
-	assert(argv[0].u.data.elem_bits == 64);
-	rc = KDataBufferResize(rslt->data, len);
-	if(rc == 0){
-		int64_t*        dst;
-		int i,j;
-		dst = rslt->data->base;
-		for(i=j=0;i<len;i++){
-			if(src[i]!=row_id && src[i] > 0/**we used alignment is as 0 to indicate no alignmnent**/){
-				dst[j++]=src[i];
-			}
-		}
-		rslt->elem_count = j;
-	}
-	return rc;	
-}
-
-VTRANSFACT_IMPL ( NCBI_align_not_my_row, 1, 0, 0 ) ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-                                                 const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftIdDepRow; /*** row_id influences behavior of the function ***/ 
-    rslt->u.ndf = not_my_row_impl;
-    return 0;
-}
diff --git a/libs/axf/project_read_from_sequence.c b/libs/axf/project_read_from_sequence.c
deleted file mode 100644
index cb2e6f2..0000000
--- a/libs/axf/project_read_from_sequence.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <insdc/sra.h>
-
-typedef struct RestoreRead RestoreRead;
-struct RestoreRead
-{
-    const VCursor *curs;
-    uint32_t col_idx;
-    uint32_t read_len_idx;
-    uint32_t read_start_idx;
-};
-
-static
-void CC RestoreReadWhack ( void *obj )
-{
-    RestoreRead * self = obj;
-    if ( self != NULL ) {
-        VCursorRelease ( self -> curs );
-        free ( self );
-    }
-}
-
-static
-rc_t RestoreReadMake ( RestoreRead **objp, const VXfactInfo *info, const VFactoryParams *cp, const VCursor *native_curs )
-{
-    rc_t rc;
-
-    /* create the object */
-    RestoreRead *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-        rc = VCursorLinkedCursorGet(native_curs,"SEQUENCE",&obj->curs);
-	if(rc != 0){
-		const VDatabase *db;
-		const VTable *tbl;
-		/* get at the parent database */
-		rc = VTableOpenParentRead ( info -> tbl, & db );
-		if(rc != 0) return rc;
-		/* open the table */
-		rc = VDatabaseOpenTableRead ( db, &tbl, "SEQUENCE" );
-		VDatabaseRelease ( db );
-		if(rc != 0) return rc;
-		/* create a cursor */
-                rc = VTableCreateCachedCursorRead(tbl, &obj->curs,2UL*1024*1024*1024);
-		VTableRelease(tbl);
-		if(rc != 0) return rc;
-		rc = VCursorPermitPostOpenAdd( obj->curs );
-                if(rc != 0) return rc;
-                rc = VCursorOpen( obj->curs );
-                if(rc != 0) return rc;
-                rc = VCursorLinkedCursorSet(native_curs,"SEQUENCE",obj->curs);
-                if(rc != 0) return rc;
-	} else {
-		VCursorAddRef(obj->curs);
-	}
-	if ( rc == 0 )
-	{
-	    /* add columns to cursor */
-	    assert ( cp -> argc == 1 );
-	    rc = VCursorAddColumn ( obj -> curs, & obj -> col_idx, "%.*s",
-		cp -> argv [ 0 ] . count, cp -> argv [ 0 ] . data . ascii );
-	    if ( rc == 0 || GetRCState(rc) == rcExists )
-		rc = VCursorAddColumn ( obj -> curs, & obj -> read_len_idx, "(INSDC:coord:len)READ_LEN" );
-	    if ( rc == 0 || GetRCState(rc) == rcExists )
-		rc = VCursorAddColumn ( obj -> curs, & obj -> read_start_idx, "(INSDC:coord:zero)READ_START");
-	    if ( rc == 0  || GetRCState(rc) == rcExists) {
-		VTypedesc src;
-		rc = VCursorDatatype ( obj -> curs, obj -> col_idx, NULL, & src );
-		if ( rc == 0 ){
-			/* selected column should have same characteristics */
-			if ( src . domain != info -> fdesc . desc . domain                 ||
-			     src . intrinsic_bits != info -> fdesc . desc . intrinsic_bits ||
-			     src . intrinsic_dim != info -> fdesc . desc. intrinsic_dim )
-			{
-			    rc = RC ( rcXF, rcFunction, rcConstructing, rcType, rcInconsistent );
-			}
-			else if ( ( src . intrinsic_bits & 7 ) != 0 )
-			    rc = RC ( rcXF, rcFunction, rcConstructing, rcType, rcUnsupported );
-			else
-			{
-			    * objp = obj;
-			    return 0;
-			}
-		}
-	    }
-        }
-        free ( obj );
-    }
-    return rc;
-}
-
-static
-rc_t CC project_from_sequence_impl ( void *data, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const RestoreRead *self = ( const void* ) data;
-
-    rc_t rc;
-    INSDC_coord_zero read_id;
-    const int64_t *spot_id = argv [ 0 ] . u . data . base;
-    const INSDC_coord_one *read_id_in = argv [ 1 ] . u . data . base;
-    const INSDC_coord_one *read_start;
-    const INSDC_coord_len *read_len;
-    const void *src;
-    uint32_t src_sz;
-    uint32_t src_bits;
-    uint32_t nreads;
-    uint32_t nreads_2;
-    
-    spot_id += argv [ 0 ] . u . data . first_elem;
-    read_id_in += argv [ 1 ] . u . data . first_elem;
-
-    assert(argv[0].u.data.elem_bits == 64);
-    assert(argv[0].u.data.elem_count == 1);
-
-    assert(argv[1].u.data.elem_bits == 32);
-    assert(argv[1].u.data.elem_count == 1);
-
-    if(spot_id[0] == 0){ /*** valid case , the projection should be empty ***/
-	rslt->elem_count =0;
-	return 0;
-    }
-    assert ( read_id_in[0] > 0 );
-    read_id = read_id_in[0] - 1; /** make zero - based **/
-
-
-    rc = VCursorCellDataDirect(self->curs, spot_id[0], self->read_len_idx, NULL, (void const **)&read_len, NULL, &nreads);
-    if (rc) return rc;
-    
-    rc = VCursorCellDataDirect(self->curs, spot_id[0], self->read_start_idx, NULL, (void const **)&read_start, NULL, &nreads_2);
-    if (rc) return rc;
-    
-    if (nreads != nreads_2 || read_id >= nreads) {
-        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-    }
-    
-    rc = VCursorCellDataDirect(self->curs, spot_id[0], self->col_idx, &src_bits, &src, NULL, &src_sz);
-    if (rc) return rc;
-    
-    if (src_sz == nreads) {
-        rslt->elem_count = 1;
-        rslt->data->elem_bits = src_bits;
-        rc = KDataBufferResize(rslt->data, 1);
-        if (rc == 0)
-            memcpy(rslt->data->base, &((char const *)src)[(read_id * src_bits) >> 3],
-                   src_bits >> 3);
-    }
-    else if (src_sz == read_start[nreads - 1] + read_len[nreads - 1]) {
-        /* like READ or QUALITY */
-        rslt->elem_count = read_len[read_id];
-        rslt->data->elem_bits = src_bits;
-        rc = KDataBufferResize(rslt->data, rslt->elem_count);
-        if (rc == 0)
-            memcpy(rslt->data->base, &((char const *)src)[(read_start[read_id] * src_bits) >> 3],
-                   (src_bits * rslt->elem_count) >> 3);
-    }
-    else {
-        /* don't know how to break up the read or should use simple_sub_select */
-        return RC(rcXF, rcFunction, rcExecuting, rcConstraint, rcViolated );
-    }
-    return 0;
-}
-
-/* 
- * function
- * INSDC:4na:bin NCBI:align:project_from_sequence #1 < ascii col > ( I64 seq_spot_id, INSDC:coord:one seq_read_id )
- *     = ALIGN:project_from_sequence;
- */
-VTRANSFACT_IMPL ( ALIGN_project_from_sequence, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RestoreRead *fself;
-    rc_t rc = RestoreReadMake ( & fself, info, cp, (const VCursor*)info->parms  );
-    if(rc == 0 ) {
-        rslt->self = fself;
-        rslt->u.ndf = project_from_sequence_impl;
-        rslt->variant = vftRow;
-        rslt -> whack = RestoreReadWhack;
-    }
-    return rc;
-}
-
diff --git a/libs/axf/raw-restore-qual.c b/libs/axf/raw-restore-qual.c
deleted file mode 100644
index de4469f..0000000
--- a/libs/axf/raw-restore-qual.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-static
-rc_t CC raw_restore_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int i,j;
-    const INSDC_4na_bin	*qual	= argv[0].u.data.base;
-    const uint32_t	read_len 	= argv[0].u.data.elem_count;
-    const uint8_t	*strand		= argv[1].u.data.base;
-    const uint32_t	strand_len 	= argv[1].u.data.elem_count;
-    
-    INSDC_4na_bin *dst;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(strand_len==1);
-    
-    qual   += argv[0].u.data.first_elem;
-    strand += argv[1].u.data.first_elem;
-    
-    /* resize output row for the total number of reads */    
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, read_len );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = read_len;
-    dst = rslt -> data -> base;
-    /**** MAIN RESTORATION LOOP ***/
-    if(strand[0] == false){ /*** nothing to do **/
-        memcpy(dst,qual,read_len);
-    } else for(i=0,j=read_len-1;i<read_len;i++,j--){
-        dst[i]=qual[j];
-    }
-    return 0;
-}
-
-/* 
- * function
- * INSDC:quality:phred NCBI:align:raw_restore_qual #1( INSDC:quality:phred align_qual, bool ref_orientation);
- */
-VTRANSFACT_IMPL ( NCBI_align_raw_restore_qual, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-
-    rslt->u.rf = raw_restore_read_impl;
-    rslt->variant = vftRow;
-    rslt -> whack = NULL;
-    return 0;
-}
diff --git a/libs/axf/raw-restore-read.c b/libs/axf/raw-restore-read.c
deleted file mode 100644
index 7db8bc1..0000000
--- a/libs/axf/raw-restore-read.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-
-static INSDC_4na_bin  map[]={
-/*0  0000 - 0000*/ 0,
-/*1  0001 - 1000*/ 8,
-/*2  0010 - 0100*/ 4,
-/*3  0011 - 1100*/ 12,
-/*4  0100 - 0010*/ 2,
-/*5  0101 - 1010*/ 10,
-/*6  0110 - 0110*/ 6,
-/*7  0111 - 1110*/ 14,
-/*8  1000 - 0001*/ 1,
-/*9  1001 - 1001*/ 9,
-/*10  1010 - 0101*/ 5,
-/*11  1011 - 1101*/ 13,
-/*12  1100 - 0011*/ 3,
-/*13  1101 - 1011*/ 11,
-/*14  1110 - 0111*/ 7,
-/*15  1111 - 1111*/ 15
-};
-
-
-
-static
-rc_t CC raw_restore_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int i,j;
-    const INSDC_4na_bin	*read 		= argv[0].u.data.base;
-    const uint32_t	read_len 	= argv[0].u.data.elem_count;
-    const uint8_t	*strand		= argv[1].u.data.base;
-    const uint32_t	strand_len 	= argv[1].u.data.elem_count;
-    
-    INSDC_4na_bin *dst;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(strand_len==1);
-    
-    read   += argv[0].u.data.first_elem;
-    strand += argv[1].u.data.first_elem;
-    
-    /* resize output row for the total number of reads */    
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, read_len );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = read_len;
-    dst = rslt -> data -> base;
-    /**** MAIN RESTORATION LOOP ***/
-    if(strand[0] == false){ /*** nothing to do **/
-        memcpy(dst,read,read_len);
-    } else for(i=0,j=read_len-1;i<read_len;i++,j--){
-        dst[i]=map[read[j]&15];
-    }
-    return 0;
-}
-
-
-/* 
- * function
- * INSDC:4na:bin ALIGN:raw_restore_read #1( INSDC:4na:bin ref_read, bool ref_orientation);
- */
-VTRANSFACT_IMPL ( ALIGN_raw_restore_read, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-
-    rslt->u.rf = raw_restore_read_impl;
-    rslt->variant = vftRow;
-    rslt -> whack = NULL;
-    return 0;
-}
diff --git a/libs/axf/ref-preserve_qual.c b/libs/axf/ref-preserve_qual.c
deleted file mode 100644
index b4d1e3f..0000000
--- a/libs/axf/ref-preserve_qual.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <vdb/database.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/pack.h>
-#include <klib/sort.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-struct node {
-    BSTNode link;
-    char const *name;
-    uint8_t *bitmap;
-    int64_t first_row;
-    uint64_t row_count;
-    size_t namelen;
-};
-typedef struct node Node;
-
-static
-int CC NodeNameCmp(void const *a, BSTNode const *n)
-{
-    String b;
-    
-    StringInit(&b, ((Node const *)n)->name, ((Node const *)n)->namelen, ((Node const *)n)->namelen);
-    return StringOrderNoNullCheck(a, &b);
-}
-
-static
-int CC NodeCmp(BSTNode const *A, BSTNode const *B)
-{
-    String a;
-    String b;
-    
-    StringInit(&a, ((Node const *)A)->name, ((Node const *)A)->namelen, ((Node const *)A)->namelen);
-    StringInit(&b, ((Node const *)B)->name, ((Node const *)B)->namelen, ((Node const *)B)->namelen);
-    return StringOrderNoNullCheck(&a, &b);
-}
-
-static
-void CC NodeWhack(BSTNode *n, void *data)
-{
-    free(n);
-}
-
-static
-rc_t NodeProcessIDs(Node *self, unsigned row, VCursor const *curs, uint32_t const cid[],
-                    bool buf[], size_t sz, size_t *bmax, INSDC_coord_len const max_seq_len,
-                    bool isPrimary, int64_t const ID[], unsigned N)
-{
-    rc_t rc = 0;
-    unsigned i;
-    bitsz_t dummy;
-    size_t max = *bmax;
-    
-    for (i = 0; i != N; ++i) {
-        uint64_t const *globalRefStart;
-        bool const *preserveQual;
-        uint32_t elem_bits;
-        uint32_t boff;
-        uint32_t n;
-        unsigned offset;
-
-        rc = VCursorCellDataDirect(curs, ID[i], cid[0], &elem_bits, (void const **)&globalRefStart, &boff, &n);
-        if (rc) return rc;
-        rc = VCursorCellDataDirect(curs, ID[i], cid[1], &elem_bits, (void const **)&preserveQual, &boff, &n);
-        if (rc) return rc;
-        
-        offset = (globalRefStart[0]) % max_seq_len;
-        if (offset + n > max)
-            max = offset + n;
-        if (max >= sz) 
-            return RC(rcXF, rcNode, rcConstructing, rcBuffer, rcInsufficient);
-        {
-            unsigned j;
-            
-            for (j = 0; j != n; ++j) {
-                buf[j + offset] |= preserveQual[j];
-            }
-        }
-    }
-    Pack(8, 1, buf, max_seq_len, NULL, self->bitmap, (size_t)row * max_seq_len,
-         (size_t)self->row_count * max_seq_len, &dummy);
-
-    if (max > max_seq_len) {
-        max -= max_seq_len;
-        memmove(buf, buf + max_seq_len, max);
-        memset(buf + max, 0, max_seq_len);
-    }
-    else {
-        memset(buf, 0, max); 
-        max = 0;
-    }
-    *bmax = max;
-
-    return rc;
-}
-
-static
-rc_t OpenAlignCursor(VCursor const **curs, uint32_t cid[], VDatabase const *db, bool isPrimary)
-{
-    char const *tname = isPrimary ? "PRIMARY_ALIGNMENT" : "SECONDARY_ALIGNMENT";
-    VTable const *atbl;
-    rc_t rc = VDatabaseOpenTableRead(db, &atbl, tname);
-    
-    if (rc == 0) {
-        VCursor const *acurs;
-        rc = VTableCreateCursorRead(atbl, &acurs);
-        VTableRelease(atbl);
-        
-        while (rc == 0) {
-            rc = VCursorAddColumn(acurs, &cid[0], "(U64)GLOBAL_REF_START");
-            assert(rc == 0);
-            if (rc) break;
-            
-            rc = VCursorAddColumn(acurs, &cid[1], "(bool)REF_PRESERVE_QUAL");
-            assert(rc == 0);
-            if (rc) break;
-            
-            rc = VCursorOpen(acurs); if (rc) break;
-            *curs = acurs;
-            return 0;
-        }
-        VCursorRelease(acurs);
-    }
-    return rc;
-}
-
-static
-rc_t NodeLoadIDs(Node *self, VTable const *tbl, VDatabase const *db, bool buf[],
-              size_t sz, INSDC_coord_len const max_seq_len, bool isPrimary)
-{
-    char const *cname = isPrimary ? "PRIMARY_ALIGNMENT_IDS" : "SECONDARY_ALIGNMENT_IDS";
-    VCursor const *algn;
-    uint32_t algn_cid[2];
-    rc_t rc = OpenAlignCursor(&algn, algn_cid, db, isPrimary);
-
-    if (rc == 0) {
-        VCursor const *curs;
-        rc = VTableCreateCursorRead(tbl, &curs);
-        
-        if (rc == 0) {
-            uint32_t cid;
-            
-            rc = VCursorAddColumn(curs, &cid, cname);
-            if (rc == 0) {
-                rc = VCursorOpen(curs);
-                if (rc == 0) {
-                    unsigned i;
-                    size_t bmax = 0;
-                    
-                    memset(buf, 0, sz);
-                    for (i = 0; i != self->row_count; ++i) {
-                        void const *base;
-                        uint32_t elem_bits;
-                        uint32_t boff;
-                        uint32_t n;
-                        
-                        rc = VCursorCellDataDirect(curs, self->first_row + i, cid,
-                                                   &elem_bits, &base, &boff, &n);
-                        if (rc) break;
-                        if (n) {
-                            rc = NodeProcessIDs(self, i, algn, algn_cid,
-                                                buf, sz, &bmax, max_seq_len,
-                                                isPrimary, base, n);
-                            if (rc) break;
-                        }
-                    }
-                }
-            }
-            VCursorRelease(curs);
-        }
-        VCursorRelease(algn);
-    }
-    else if (!isPrimary)
-        rc = 0;
-    
-    return rc;
-}
-
-static
-rc_t NodeLoad(Node *self, VTable const *tbl, VDatabase const *db, bool buf[],
-              size_t sz, INSDC_coord_len const max_seq_len)
-{
-    rc_t rc = NodeLoadIDs(self, tbl, db, buf, sz, max_seq_len, true);
-    if (rc == 0) {
-        rc = NodeLoadIDs(self, tbl, db, buf, sz, max_seq_len, false);
-    }
-    return rc;
-}
-
-static
-rc_t NodeMake(Node **rslt, VTable const *tbl, String const *refName, INSDC_coord_len const max_seq_len)
-{
-    Node *self;
-    int64_t data[2];
-    VDatabase const *db;
-    VCursor const *curs;
-    rc_t rc = VTableCreateCursorRead(tbl, &curs);
-    
-    if (rc == 0) {
-        uint32_t cid;
-        
-        rc = VCursorAddColumn(curs, &cid, "NAME_RANGE");
-        if (rc == 0) {
-            rc = VCursorParamsSet((struct VCursorParams const *)curs, "QUERY_SEQ_NAME", "%.*s", refName->len, refName->addr);
-            if (rc == 0) {
-                rc = VCursorOpen(curs);
-                if (rc == 0) {
-                    rc = VCursorOpenRow(curs);
-                    if (rc == 0) {
-                        uint32_t dummy;
-                        
-                        rc = VCursorRead(curs, cid, 64, data, 2, &dummy);
-                    }
-                }
-            }
-        }
-        VCursorRelease(curs);
-    }
-    if (rc) return rc;
-    
-    self = malloc(sizeof(*self) + refName->len + (((data[1] - data[0] + 1) * max_seq_len + 7) >> 3));
-    if (self == NULL) return RC(rcXF, rcNode, rcConstructing, rcMemory, rcExhausted);
-    
-    memcpy(&self[1], refName->addr, self->namelen = refName->len);
-    self->name = (char const *)&self[1];
-    self->bitmap = (uint8_t *)&self->name[refName->len];
-    self->row_count = data[1] - (self->first_row = data[0]) + 1;
-    
-    rc = VTableOpenParentRead(tbl, &db);
-    if (rc == 0) {
-        void *scratch = malloc(32 * max_seq_len);
-        if (scratch) {
-            rc = NodeLoad(self, tbl, db, scratch, 32 * max_seq_len, max_seq_len);
-            if (rc == 0) {
-                VDatabaseRelease(db);
-                free(scratch);
-                *rslt = self;
-                return 0;
-            }
-            free(scratch);
-        }
-        else
-            rc = RC(rcXF, rcNode, rcConstructing, rcMemory, rcExhausted);
-        VDatabaseRelease(db);
-    }
-    free(self);
-    *rslt = NULL;
-    
-    return rc;
-}
-
-/* generate_preserve_qual
- *  compute the positions where corresponding qualities should be preserved
- *  when converting to an analysis database.
- * Preserve where:
- *  there is a mismatch
- *  two positions to each side of an insert
- *
- * extern function bool NCBI:align:generate_preserve_qual #1
- *  ( utf8 ref_name, INSDC:coord:len seq_len, U32 max_seq_len );
- */
-static
-rc_t CC generate_preserve_qual_impl(void *Self, VXformInfo const *info,
-                                    int64_t row_id, VRowResult *rslt,
-                                    uint32_t argc, VRowData const argv[])
-{
-    BSTree *tree = Self;
-    Node *map;
-    rc_t rc;
-    String refName;
-    uint32_t const max_seq_len = ((uint32_t const *)argv[2].u.data.base)[argv[2].u.data.first_elem];
-    INSDC_coord_len const seq_len = ((INSDC_coord_len const *)argv[1].u.data.base)[argv[1].u.data.first_elem];
-
-    assert(argv[1].u.data.elem_bits == sizeof(seq_len) * 8);
-    assert(argv[2].u.data.elem_bits == sizeof(max_seq_len) * 8);
-    
-    rslt->data->elem_bits = rslt->elem_bits;
-    rslt->elem_count = seq_len;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);                       if (rc) return rc;
-    memset(rslt->data->base, 0, (seq_len * rslt->elem_bits + 7) >> 3);
-    return 0;
-    
-    StringInit(&refName, &((char const *)argv[0].u.data.base)[argv[0].u.data.first_elem],
-               argv[0].u.data.elem_count, argv[0].u.data.elem_count);
-    map = (Node *)BSTreeFind(tree, &refName, NodeNameCmp);
-    if (!map) {
-        rc = NodeMake(&map, info->tbl, &refName, max_seq_len);                  if (rc) return rc;
-        rc = BSTreeInsert(tree, &map->link, NodeCmp);                           if (rc) return rc;
-    }
-    {{
-        size_t const start = (row_id - map->first_row) * max_seq_len;
-        size_t dummy;
-        
-        Unpack(1, 8, map->bitmap, start, seq_len, NULL, rslt->data->base, seq_len, &dummy);
-    }}
-    
-    return 0;
-}
-
-static
-void CC Whack_generate_preserve_qual(void *vp)
-{
-    BSTreeWhack(vp, NodeWhack, NULL);
-    free(vp);
-}
-
-VTRANSFACT_IMPL ( NCBI_align_generate_preserve_qual, 1, 0, 0 )
-    ( const void *Self, VXfactInfo const *info,
-      VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->self = malloc(sizeof(BSTree));
-    if (rslt->self) {
-        BSTreeInit((BSTree *)rslt->self);
-        rslt->u.rf = generate_preserve_qual_impl;
-        rslt->variant = vftIdDepRow;
-        rslt -> whack = Whack_generate_preserve_qual;
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/axf/ref-restore-read.c b/libs/axf/ref-restore-read.c
deleted file mode 100644
index beb4599..0000000
--- a/libs/axf/ref-restore-read.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <vdb/manager.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-typedef struct RestoreRead RestoreRead;
-struct RestoreRead
-{
-    const RefSeqMgr* rmgr;
-};
-
-static
-void CC RestoreReadWhack ( void *obj )
-{
-    RestoreRead * self = obj;
-    if( self != NULL ) {
-        rc_t rc;
-        rc = RefSeqMgr_Release(self->rmgr);
-        assert(rc == 0);
-        free(self);
-    }
-}
-
-static
-rc_t RestoreReadMake ( RestoreRead **objp, const VDBManager *mgr )
-{
-	rc_t rc = 0;
-	RestoreRead *obj;
-
-	assert(objp != NULL);
-    assert(mgr != NULL);
-
-    obj = calloc(1, sizeof(*obj));
-    if( obj == NULL ) {
-		rc = RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        if( (rc = RefSeqMgr_Make(&obj->rmgr, mgr, errefseq_4NA, 1024 * 1024 * 1024, 30)) == 0 ) {
-		    *objp = obj;
-        } else {
-            *objp = NULL;
-            RestoreReadWhack(obj);
-        }
-	}
-	return rc;
-}
-
-static
-rc_t CC ref_restore_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                               VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    RestoreRead* self = data;
-    uint8_t* dst;
-    uint32_t read_len     = argv[0].u.data.elem_count;
-    const uint8_t *read   = argv[0].u.data.base;
-    uint32_t seqid_len    = argv[1].u.data.elem_count;
-    const char* seqid     = argv[1].u.data.base;
-    INSDC_coord_one   seq_start;
-    INSDC_coord_len   seq_len;
-
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 8);
-    assert(argv[2].u.data.elem_bits == sizeof(INSDC_coord_one)*8);
-    assert(argv[3].u.data.elem_bits == sizeof(INSDC_coord_len)*8);
-    assert(argv[2].u.data.elem_count == 1);
-    assert(argv[3].u.data.elem_count == 1);
-
-    read   += argv [ 0 ] . u . data . first_elem;
-    seqid  += argv [ 1 ] . u . data . first_elem;
-    seq_start = ((INSDC_coord_one*)argv[2].u.data.base)[argv[2].u.data.first_elem];
-    seq_len   = ((INSDC_coord_len*)argv[3].u.data.base)[argv[3].u.data.first_elem];
-
-    if(seq_len < read_len) {
-        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-    } else {
-        /* resize output row for the total number of reads */    
-        rslt->data->elem_bits = 8;
-        rc = KDataBufferResize(rslt->data, seq_len);
-        if ( rc == 0 ) {
-            rslt->elem_count = seq_len;
-            dst = rslt->data->base;
-
-            if(seq_len > 0) {
-                if(read_len > 0) {
-                    memcpy(dst, read, read_len);
-                    if(read_len < seq_len) {
-                        memset(dst + read_len, 15, seq_len - read_len); /* pad with 'N' */
-                    }
-                } else if(seq_start == 0) {
-                    memset(dst, 15, seq_len); /* fill with 'N' */
-                } else {
-                    INSDC_coord_len read = 0;
-                    if( (rc = RefSeqMgr_Read(self->rmgr, seqid, seqid_len, seq_start - 1, seq_len, dst, &read)) == 0 ) {
-                        if( read != seq_len) {
-                            rc = RC(rcXF, rcFunction, rcExecuting, rcData, read < seq_len ? rcTooShort : rcTooLong);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/* 
- * function
- * INSDC:4na:bin ALIGN:ref_restore_read #1 (  INSDC:4na:bin rd , ascii seq_id , INSDC:coord:one seq_start, INSDC:coord:len seq_len);
- */
-VTRANSFACT_IMPL ( ALIGN_ref_restore_read, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                                     VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RestoreRead *fself;
-    rc_t rc = RestoreReadMake ( & fself, info -> mgr);
-    if(rc == 0 ) {
-        rslt->self = fself;
-        rslt->u.ndf = ref_restore_read_impl;
-        rslt->variant = vftRow;
-        rslt -> whack = RestoreReadWhack;
-    }
-    return rc;
-}
diff --git a/libs/axf/ref-tbl-sub-select.c b/libs/axf/ref-tbl-sub-select.c
deleted file mode 100644
index 7354fbf..0000000
--- a/libs/axf/ref-tbl-sub-select.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include "ref-tbl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-typedef struct RefTableSubSelect RefTableSubSelect;
-struct RefTableSubSelect
-{
-    rc_t (*func)(struct RefTableSubSelect* self, int64_t ref_row_id,
-                 INSDC_coord_zero offset, INSDC_coord_len ref_len,
-                 uint32_t ref_ploidy, VRowResult* rslt);
-    const VCursor *curs;
-    uint32_t out_idx;
-    union {
-        struct {
-            uint32_t circular_idx;
-            uint32_t name_idx;
-            uint32_t name_range_idx;
-            uint32_t seq_len_idx;
-            uint32_t max_seq_len_idx;
-            uint32_t cmp_read_idx;
-            /* set once upon 1st call */
-            /* set once per each call, if changed from previous */
-            char* name;
-            int64_t start_id;
-            int64_t stop_id;
-            uint32_t name_len;
-            uint32_t max_seq_len;
-            INSDC_coord_len seq_len;
-            bool circular;
-            bool local;
-        } ref;
-        struct {
-            uint32_t ref_id_idx;
-            uint32_t ref_start_idx;
-            uint32_t ref_len_idx;
-            uint32_t read_start_idx;
-            uint32_t read_len_idx;
-            struct RefTableSubSelect* parent;
-        } mod;
-    } u;
-};
-
-/*
-  ref_ploidy != 0 means that offset here is relative to ref_row_id, so it can be
-    negative or positive and can extend between rows within same refseq
-  ref_ploidy means that offset is normal REF_START
- */
-
-static
-rc_t CC REFERENCE_TABLE_sub_select(RefTableSubSelect* self, int64_t ref_row_id,
-                             INSDC_coord_zero offset, INSDC_coord_len ref_len,
-                             uint32_t ref_ploidy, VRowResult* rslt)
-{
-    rc_t rc = 0;
-    INSDC_coord_len num_read;
-    
-    if (ref_row_id < self->u.ref.start_id || ref_row_id > self->u.ref.stop_id ) {
-        /* update cached ref data if ref has changed */
-        const char* n;
-        uint32_t n_len;
-        struct {
-            int64_t start_id;
-            int64_t stop_id;
-        } *out;
-        
-        if ((rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.ref.name_idx, NULL, (const void**)&n, NULL, &n_len)) == 0 &&
-            /* use i_name to find current ref rowid range */
-            (rc = VCursorParamsSet((const struct VCursorParams *)(self->curs), "QUERY_SEQ_NAME", "%.*s", n_len, n)) == 0 &&
-            (rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.ref.name_range_idx, NULL, (const void**)&out, NULL, NULL)) == 0 )
-        {
-            if (self->u.ref.name_len < n_len ) {
-                void* p = realloc(self->u.ref.name, n_len);
-                if (p == NULL ) {
-                    rc = RC(rcXF, rcFunction, rcSelecting, rcMemory, rcExhausted);
-                }
-                else {
-                    self->u.ref.name = (char*)p;
-                }
-            }
-            if (rc == 0) {
-                const bool* c;
-                INSDC_coord_len* sl;
-                uint32_t* m;
-                uint32_t cmp_read_len = 0;
-                int64_t row;
-                
-                memcpy(self->u.ref.name, n, n_len);
-                self->u.ref.name_len = n_len;
-                self->u.ref.start_id = out->start_id;
-                self->u.ref.stop_id = out->stop_id;
-                for (row = out->start_id; row <= out->stop_id && cmp_read_len == 0; ++row) {
-                    uint32_t tmp_len = 0;
-                    void const *dummy = NULL;
-                    
-                    rc = VCursorCellDataDirect(self->curs, row, self->u.ref.cmp_read_idx, NULL, &dummy, NULL, &tmp_len);
-                    if (rc) break;
-                    cmp_read_len += tmp_len;
-                }
-                if (rc == 0
-                    && (rc = VCursorCellDataDirect(self->curs, self->u.ref.stop_id, self->u.ref.circular_idx, NULL, (const void**)&c, NULL, NULL)) == 0
-                    && (rc = VCursorCellDataDirect(self->curs, self->u.ref.stop_id, self->u.ref.seq_len_idx, NULL, (const void**)&sl, NULL, NULL)) == 0
-                    && (rc = VCursorCellDataDirect(self->curs, self->u.ref.stop_id, self->u.ref.max_seq_len_idx, NULL, (const void**)&m, NULL, NULL)) == 0
-                    )
-                {
-                    self->u.ref.circular = c[0] || cmp_read_len != 0;
-                    self->u.ref.seq_len = m[0] * (self->u.ref.stop_id - self->u.ref.start_id) + sl[0];
-                    self->u.ref.max_seq_len = m[0];
-                    
-                }
-            }
-        }
-    }
-    if (rc == 0 && ref_ploidy != 0 ) {
-        /* convert offset to normal from start of ref relative to current row */
-        offset += self->u.ref.max_seq_len * (ref_row_id - self->u.ref.start_id);
-        if (self->u.ref.circular ) {
-            /* make offset positive starting from refseq actual start */
-            if (offset < 0 ) {
-                offset = self->u.ref.seq_len - ((-offset) % self->u.ref.seq_len);
-            }
-            else {
-                offset %= self->u.ref.seq_len;
-            }
-        } else if (offset < 0 || offset >= self->u.ref.seq_len ) {
-            rc = RC(rcXF, rcFunction, rcSelecting, rcData, rcCorrupt);
-        }
-        ref_row_id = self->u.ref.start_id + offset / self->u.ref.max_seq_len;
-        offset %= self->u.ref.max_seq_len;
-    }
-    /* read the data */
-    for(num_read = 0; rc == 0 && num_read < ref_len && ref_row_id <= self->u.ref.stop_id; offset = 0) {
-        uint32_t bits;
-        const void* output;
-        uint32_t boff;
-        uint32_t row_len;
-        
-        if ((rc = VCursorCellDataDirect(self->curs, ref_row_id,self->out_idx, &bits, &output, &boff, &row_len)) == 0 ) {
-            /* row_len MUST be > offset */
-            if (row_len <= offset ) {
-                rc = RC(rcXF, rcFunction, rcSelecting, rcData, rcCorrupt);
-            }
-            else {
-                row_len -= offset;
-                if(ref_len < row_len + num_read) {
-                    row_len = ref_len - num_read;
-                }
-                /* copy data */
-                bitcpy(rslt->data->base, rslt->elem_count * bits, output, offset * bits + boff, row_len * bits);
-                rslt->elem_count += row_len;
-                num_read += row_len;
-                if (++ref_row_id > self->u.ref.stop_id && self->u.ref.circular ) {
-                    ref_row_id = self->u.ref.start_id;
-                }
-            }
-        }
-    }
-    /* detect incomplete read */
-    if (rc == 0 && num_read == 0 ) {
-        rc = RC(rcXF, rcFunction, rcSelecting, rcTransfer, rcIncomplete);
-    }
-    return rc;
-}
-
-static
-rc_t CC ALIGN_CMN_TABLE_sub_select(RefTableSubSelect* self, int64_t ref_row_id,
-                                   INSDC_coord_zero offset, INSDC_coord_len ref_len,
-                                   uint32_t ref_ploidy, VRowResult* rslt)
-{
-	rc_t rc=0;
-    INSDC_coord_len num_read = 0;
-    const int64_t* al_ref_id = NULL;
-    int64_t al_ref_id_value;
-    const INSDC_coord_zero* al_ref_start = NULL;
-    
-    if (offset < 0 ) {
-        if ((rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.ref_id_idx, NULL, (void const **)&al_ref_id, NULL, NULL)) == 0 &&
-            (rc = VCursorCellDataDirect(self->curs, ref_row_id,self->u.mod.ref_start_idx, NULL, (void const **)&al_ref_start, NULL, NULL)) == 0 )
-        {
-            memcpy ( & al_ref_id_value, al_ref_id, sizeof *al_ref_id );
-            if (-offset > ref_len ) {
-                /* requested chunk is to the left and is not using allele data */
-                rc = RC(rcXF, rcFunction, rcSelecting, rcData, rcCorrupt);
-            }
-            else if ((rc = self->u.mod.parent->func(self->u.mod.parent, al_ref_id_value, offset + al_ref_start[0],
-                                                      -offset, ref_ploidy, rslt)) == 0 )
-            {
-                /* read left portion of underlying reference */
-                num_read += rslt->elem_count;
-                offset = 0;
-            }
-        }
-    }
-    if (rc == 0 && num_read < ref_len ) {
-        /* copy self */
-        void const* output;
-        uint32_t bits, boff, rs_len, rl_len;
-        const INSDC_coord_zero* rs;
-        const INSDC_coord_len* rl;
-        
-        if ((rc = VCursorCellDataDirect(self->curs, ref_row_id, self->out_idx, &bits, &output, &boff, NULL)) == 0 &&
-            (rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.read_start_idx, NULL, (void const **)&rs, NULL, &rs_len)) == 0 &&
-            (rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.read_len_idx, NULL, (void const **)&rl, NULL, &rl_len)) == 0 )
-        {
-            assert(rs_len == rl_len);
-            assert(ref_ploidy > 0 && ref_ploidy <= rl_len);
-            if (offset > rl[ref_ploidy - 1] ) {
-                /* requested chunk starts beyond allele */
-                rc = RC(rcXF, rcFunction, rcSelecting, rcData, rcCorrupt);
-            }
-            else {
-                INSDC_coord_len left = ref_len - num_read;
-                if ((rl[ref_ploidy - 1] - offset) < left ) {
-                    left = rl[ref_ploidy - 1] - offset;
-                }
-                bitcpy(rslt->data->base, rslt->elem_count * bits, output, (rs[ref_ploidy - 1] + offset) * bits + boff, left * bits);
-                num_read += left;
-                rslt->elem_count += left;
-            }
-        }
-    }
-    if (rc == 0 && num_read < ref_len ) {
-        const INSDC_coord_len* al_ref_len;
-        /* copy right portion of underlying reference */
-        if (al_ref_id == NULL || al_ref_start == NULL ) {
-            if ((rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.ref_id_idx, NULL, (void const **)&al_ref_id, NULL, NULL)) == 0 ) {
-                rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.ref_start_idx, NULL, (void const **)&al_ref_start, NULL, NULL);
-            }
-        }
-        if (rc == 0 ) {
-            rc = VCursorCellDataDirect(self->curs, ref_row_id, self->u.mod.ref_len_idx, NULL, (void const **)&al_ref_len, NULL, NULL);
-        }
-        memcpy ( & al_ref_id_value, al_ref_id, sizeof *al_ref_id );
-        if ( rc == 0 &&
-            (rc = self->u.mod.parent->func(self->u.mod.parent, al_ref_id_value, al_ref_start[0] + al_ref_len[0],
-                                           ref_len - num_read, ref_ploidy, rslt)) == 0 )
-        {
-        }
-    }
-    return rc;
-}
-
-static
-void CC RefTableSubSelect_Whack ( void *obj )
-{
-    if (obj != NULL ) {
-        RefTableSubSelect* self = (RefTableSubSelect*)obj;
-        VCursorRelease(self->curs);
-        if (self->func != REFERENCE_TABLE_sub_select ) {
-            RefTableSubSelect_Whack(self->u.mod.parent);
-        }
-        else {
-            free(self->u.ref.name);
-        }
-        free(self);
-    }
-}
-
-/* normal way to do it */
-#define IS_ADDED(c, i, n) ((rc = VCursorAddColumn(c, i, n)) == 0 || \
-                           (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
-
-static
-rc_t RefTableSubSelect_Make( RefTableSubSelect **objp, const VTable *tbl, const VCursor *native_curs, const char* out_col_name )
-{
-    rc_t rc;
-
-    /* create the object */
-    RefTableSubSelect* obj = (RefTableSubSelect*)calloc(1, sizeof(*obj));
-    if (obj == NULL ) {
-        rc = RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    }
-    else {
-        const VTable *reftbl=NULL;
-        /* open the reference table cursor*/
-        if ((rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, &reftbl)) == 0 ) {
-            /* add columns to cursor */
-            if (IS_ADDED(obj->curs, &obj->u.ref.circular_idx, "CIRCULAR") ) {
-                /* normal REFERENCE table */
-                if (   IS_ADDED(obj->curs, &obj->u.ref.name_idx, "(utf8)NAME")
-                    && IS_ADDED(obj->curs, &obj->u.ref.name_range_idx, "NAME_RANGE")
-                    && IS_ADDED(obj->curs, &obj->u.ref.seq_len_idx, "SEQ_LEN")
-                    && IS_ADDED(obj->curs, &obj->u.ref.max_seq_len_idx, "MAX_SEQ_LEN")
-                    && IS_ADDED(obj->curs, &obj->u.ref.cmp_read_idx, "CMP_READ")
-                    )
-                {
-                    obj->func = REFERENCE_TABLE_sub_select;
-                    rc = 0;
-                }
-            }
-            else if (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
-                /* try as align_cmn */
-                if ((rc = RefTableSubSelect_Make(&obj->u.mod.parent, reftbl, native_curs, out_col_name)) ==0 &&
-                    IS_ADDED(obj->curs, &obj->u.mod.ref_id_idx, "REF_ID") &&
-                    IS_ADDED(obj->curs, &obj->u.mod.ref_start_idx, "REF_START") &&
-                    IS_ADDED(obj->curs, &obj->u.mod.ref_len_idx, "REF_LEN") &&
-                    IS_ADDED(obj->curs, &obj->u.mod.read_start_idx, "READ_START") &&
-                    IS_ADDED(obj->curs, &obj->u.mod.read_len_idx, "READ_LEN") )
-                {
-                    obj->func = ALIGN_CMN_TABLE_sub_select;
-                    rc = 0;
-                }
-            }
-            if (rc == 0 && IS_ADDED(obj->curs, &obj->out_idx,  out_col_name) ) {
-                rc = 0;
-            }
-            if (rc == 0 ) {
-                *objp = obj;
-                VTableRelease(reftbl);
-                return 0;
-            }
-            VCursorRelease(obj->curs);
-        }
-        VTableRelease(reftbl);
-        free(obj);
-    }
-    return rc;
-}
-
-static
-rc_t CC reftbl_sub_select ( void *data, const VXformInfo *info,
-                           int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv[] )
-{
-    rc_t rc;
-    RefTableSubSelect* self = (RefTableSubSelect*)data;
-    const int64_t* ref_id = (const int64_t*)argv[0].u.data.base;
-    const INSDC_coord_zero* ref_start = (const INSDC_coord_zero*)argv[1].u.data.base;
-    const INSDC_coord_len* ref_len = (const INSDC_coord_len*)argv[2].u.data.base;
-    const uint32_t* ref_ploidy = NULL;
-    
-    if (argc > 3 ) {
-        ref_ploidy = (const uint32_t*)argv[3].u.data.base;
-        ref_ploidy += argv[3].u.data.first_elem;
-        assert(argv[3].u.data.elem_bits == sizeof(*ref_ploidy) * 8 );
-    }
-    assert(argv[0].u.data.elem_bits == sizeof(*ref_id) * 8 );
-    assert(argv[1].u.data.elem_bits == sizeof(*ref_start) * 8 );
-    assert(argv[2].u.data.elem_bits == sizeof(*ref_len) * 8 );
-
-    ref_id += argv[0].u.data.first_elem;
-    ref_start += argv[1].u.data.first_elem;
-    ref_len += argv[2].u.data.first_elem;
-
-    /* get the memory for output row */
-    rslt->data->elem_bits = rslt->elem_bits;
-    if ((rc = KDataBufferResize(rslt->data, ref_len[0])) == 0 ) {
-        /* must set it to 0 here - functions above accumulate */
-        rslt->elem_count = 0;
-	if(ref_len[0] > 0){
-		int64_t ref_id_val;
-		memcpy ( & ref_id_val, ref_id, sizeof ref_id_val );
-		rc = self->func(self, ref_id_val, ref_start[0], ref_len[0], ref_ploidy ? ref_ploidy[0] : 0, rslt);
-	}
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( ALIGN_ref_sub_select, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RefTableSubSelect *fself;
-    rc_t rc = RefTableSubSelect_Make ( & fself, info -> tbl, (const VCursor*)info->parms ,"(INSDC:4na:bin)READ" );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = RefTableSubSelect_Whack;
-        rslt -> u . ndf = reftbl_sub_select;
-        rslt -> variant = vftRow;
-    }
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_align_ref_sub_select_preserve_qual, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-                                                   VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RefTableSubSelect *fself;
-    rc_t rc = RefTableSubSelect_Make( & fself, info -> tbl, (const VCursor*)info->parms , "(bool)PRESERVE_QUAL" );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> whack = RefTableSubSelect_Whack;
-        rslt -> u . ndf = reftbl_sub_select;
-        rslt -> variant = vftRow;
-    }
-    
-    return rc;
-}
diff --git a/libs/axf/ref-tbl.c b/libs/axf/ref-tbl.c
deleted file mode 100644
index 57e0933..0000000
--- a/libs/axf/ref-tbl.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/cursor.h>
-#include <kdb/meta.h>
-#include <klib/rc.h>
-
-#include "ref-tbl.h"
-#include <string.h>
-
-rc_t AlignRefTableCursor(const VTable* table, const VCursor *native_curs, const VCursor** ref_cursor,const VTable **reftbl)
-{
-	rc_t rc = 0;
-	char ref_tbl_name[512] =  "REFERENCE";
-	const KMetadata* meta;
-	const VCursor *curs;
-
-	if( (rc = VTableOpenMetadataRead(table, &meta)) == 0 ) {
-	    const KMDataNode* node;
-            if( (rc = KMetadataOpenNodeRead(meta, &node, "CONFIG/REF_TABLE")) == 0 ) {
-                size_t sz;
-                rc = KMDataNodeReadCString(node, ref_tbl_name, sizeof(ref_tbl_name), &sz);
-                ref_tbl_name[sz] = '\0';
-                KMDataNodeRelease(node);
-            }
-            KMetadataRelease(meta);
-        }
-	rc = VCursorLinkedCursorGet(native_curs,ref_tbl_name,&curs);
-	if(rc != 0){
-		const VDatabase *db;
-                const VTable *tbl;
-                /* get at the parent database */
-                rc = VTableOpenParentRead ( table, & db );
-                if(rc != 0) return rc;
-                /* open the table */
-                rc = VDatabaseOpenTableRead ( db, &tbl, ref_tbl_name);
-                VDatabaseRelease ( db );
-                if(rc != 0) return rc;
-                /* create a cursor */
-                rc = VTableCreateCachedCursorRead(tbl, &curs,256*1024*1024);
-		if(reftbl){
-			*reftbl = tbl;
-                } else {
-			VTableRelease(tbl);
-		}
-                if(rc != 0) return rc;
-                rc = VCursorPermitPostOpenAdd( curs );
-                if(rc != 0) return rc;
-                rc = VCursorOpen( curs );
-                if(rc != 0) return rc;
-                if(native_curs)
-                    rc = VCursorLinkedCursorSet(native_curs,ref_tbl_name,curs);
-                
-                if(rc != 0) return rc;
-	} else {
-		VCursorAddRef(curs);
-	}
-	*ref_cursor = curs;
-	return 0;
-}
diff --git a/libs/axf/ref-tbl.h b/libs/axf/ref-tbl.h
deleted file mode 100644
index 24cbf80..0000000
--- a/libs/axf/ref-tbl.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_axf_ref_tbl_
-#define _h_axf_ref_tbl_
-
-/* Caller must release ref_cursor */
-rc_t AlignRefTableCursor(const VTable* table, const VCursor *native_curs, const VCursor** ref_cursor, const VTable **reftbl);
-
-#endif /* _h_axf_ref_tbl_ */
diff --git a/libs/axf/refseq-stats.c b/libs/axf/refseq-stats.c
deleted file mode 100644
index c77368c..0000000
--- a/libs/axf/refseq-stats.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/checksum.h>
-#include <kdb/meta.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef struct refseq_meta_stats_data_struct {
-    uint64_t total_seq_len;
-    uint32_t crc32;
-    MD5State md5;
-    KMDataNode* stats;
-    uint64_t buf_sz;
-    char* buf;
-} refseq_meta_stats_data;
-
-
-static
-void CC refseq_meta_stats_whack( void* self )
-{
-    if( self != NULL ) {
-        refseq_meta_stats_data* data = self;
-        KMDataNodeRelease(data->stats);
-        free(data->buf);
-        free(data);
-    }
-}
-
-static
-rc_t CC refseq_meta_stats( void *self, const VXformInfo *info, int64_t row_id,
-                             VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    KMDataNode* node;
-    refseq_meta_stats_data* data = self;
-    uint64_t i, seq_len = argv[0].u.data.elem_count;
-    const INSDC_4na_bin * seq = argv[0].u.data.base;
-   
-    seq +=  argv[0].u.data.first_elem;
-
-    assert(data != NULL);
-
-    if( data->buf_sz < seq_len ) {
-        char* x = realloc(data->buf, seq_len);
-        if( x == NULL ) {
-            rc = RC(rcVDB, rcFunction, rcUpdating, rcMemory, rcExhausted);
-        } else {
-            data->buf = x;
-            data->buf_sz = seq_len;
-        }
-    }
-    for(i = 0; rc == 0 && i < seq_len; i++) {
-        data->buf[i] = INSDC_4na_map_CHARSET[seq[i]];
-    }
-    if( rc == 0 && (rc = KMDataNodeOpenNodeUpdate(data->stats, &node, "TOTAL_SEQ_LEN")) == 0 ) {
-        if( data->total_seq_len + seq_len < data->total_seq_len ) {
-            rc = RC(rcVDB, rcFunction, rcUpdating, rcMetadata, rcOutofrange);
-        } else {
-            data->total_seq_len += seq_len;
-            rc = KMDataNodeWriteB64(node, &data->total_seq_len);
-        }
-        KMDataNodeRelease(node);
-    }
-    if( rc == 0 && (rc = KMDataNodeOpenNodeUpdate(data->stats, &node, "CRC32")) == 0 ) {
-        data->crc32 = CRC32(data->crc32, data->buf, seq_len);
-        rc = KMDataNodeWriteB32(node, &data->crc32);
-        KMDataNodeRelease(node);
-    }
-    if( rc == 0 && (rc = KMDataNodeOpenNodeUpdate(data->stats, &node, "MD5")) == 0 ) {
-        uint8_t digest[16];
-        MD5State md5;
-        MD5StateAppend(&data->md5, data->buf, seq_len);
-        memcpy(&md5, &data->md5, sizeof(md5));
-        MD5StateFinish(&md5, digest);
-        rc = KMDataNodeWrite(node, digest, sizeof(digest));
-        KMDataNodeRelease(node);
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_refSeq_stats, 1, 0, 0 ) ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-                                                 const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-
-    if( dp->argc < 1 ) {
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    } else {
-        refseq_meta_stats_data* data;
-        if( (data = calloc(1, sizeof(refseq_meta_stats_data))) == NULL ) {
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            KMetadata *meta;
-            if( (rc = VTableOpenMetadataUpdate((VTable*)info->tbl, &meta)) == 0 ) {
-                rc = KMetadataOpenNodeUpdate(meta, &data->stats, "STATS");
-                KMetadataRelease(meta);
-            }
-            if( rc == 0 ) {
-                rslt->self = data;
-                rslt->whack = refseq_meta_stats_whack;
-                rslt->variant = vftRow;
-                rslt->u.rf = refseq_meta_stats;
-                data->crc32 = 0;
-                CRC32Init();
-                MD5StateInit(&data->md5);
-            } else {
-                refseq_meta_stats_whack(data);
-            }
-        }
-    }
-    return rc;
-}
diff --git a/libs/axf/seq-construct-read.c b/libs/axf/seq-construct-read.c
deleted file mode 100644
index d0fc66e..0000000
--- a/libs/axf/seq-construct-read.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <insdc/sra.h>
-
-
-static
-rc_t CC seq_construct_read ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint8_t *dst;
-
-    /* base pointers to input data */
-    const uint8_t *aligned = argv [ 0 ] . u . data . base;
-    const INSDC_coord_len *aligned_len = argv [ 1 ] . u . data . base;
-    const uint8_t *unaligned = argv [ 2 ] . u . data . base;
-    const INSDC_coord_len *unaligned_len = argv [ 3 ] . u . data . base;
-
-    /* the number of reads */
-    uint32_t i, seqlen, aligned_seqlen, unaligned_seqlen;
-    uint32_t nreads = argv [ 1 ] . u . data . elem_count;
-
-    /* require the same dimension for both inputs */
-    if ( argv [ 1 ] . u . data . elem_count != argv [ 3 ] . u . data . elem_count )
-        return RC ( rcXF, rcFunction, rcExecuting, rcData, rcInconsistent );
-
-    /* offset base pointers to start of row */
-    aligned += argv [ 0 ] . u . data . first_elem;
-    aligned_len += argv [ 1 ] . u . data . first_elem;
-    unaligned += argv [ 2 ] . u . data . first_elem;
-    unaligned_len += argv [ 3 ] . u . data . first_elem;
-
-    /* calculate new sequence length */
-    for ( i = seqlen = 0; i < nreads; ++ i )
-        seqlen += unaligned_len [ i ] != 0 ? unaligned_len [ i ] : aligned_len [ i ];
-
-    /* set output buffer size */
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, seqlen );
-    if ( rc != 0 )
-        return rc;
-
-    /* produce final sequence */
-    for ( dst = rslt -> data -> base, i = seqlen = aligned_seqlen = unaligned_seqlen = 0; i < nreads; ++ i )
-    {
-        /* give preference to unaligned */
-        if ( unaligned_len [ i ] != 0 )
-        {
-            memcpy ( & dst [ seqlen ], & unaligned [ unaligned_seqlen ], unaligned_len [ i ] );
-            seqlen += unaligned_len [ i ];
-        }
-        else
-        {
-            memcpy ( & dst [ seqlen ], & aligned [ aligned_seqlen ], aligned_len [ i ] );
-            seqlen += aligned_len [ i ];
-        }
-
-        aligned_seqlen += aligned_len [ i ];
-        unaligned_seqlen += unaligned_len [ i ];
-    }
-
-    rslt -> elem_count = seqlen;
-
-    return 0;
-}
-
-/* 
- * function < type T >
- * T NCBI:align:seq_construct_read #1 (T     read, INSDC:coord:len     read_len,
- *                                     T cmp_read, INSDC:coord:len cmp_read_len);
- */
-VTRANSFACT_IMPL ( NCBI_align_seq_construct_read, 1, 0, 0 )
-    ( const void *Self, const VXfactInfo *info,
-      VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    if (info->fdesc.desc.intrinsic_bits * info->fdesc.desc.intrinsic_dim != 8)
-        return RC(rcAlign, rcFunction, rcConstructing, rcType, rcIncorrect);
-    rslt->u.ndf = seq_construct_read;
-    rslt->variant = vftRow;
-    return 0;
-}
diff --git a/libs/axf/seq-restore-read.c b/libs/axf/seq-restore-read.c
deleted file mode 100644
index 1141717..0000000
--- a/libs/axf/seq-restore-read.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <insdc/sra.h>
-
-typedef struct RestoreRead RestoreRead;
-struct RestoreRead
-{
-    const VCursor *curs;
-    uint32_t read_idx;
-};
-
-static
-void CC RestoreReadWhack ( void *obj )
-{
-    RestoreRead * self = obj;
-    if ( self != NULL ) {
-        VCursorRelease ( self -> curs );
-        free ( self );
-    }
-}
-
-static
-rc_t RestoreReadMake ( RestoreRead **objp, const VTable *tbl )
-{
-    rc_t rc;
-
-    /* create the object */
-    RestoreRead *obj = malloc ( sizeof * obj );
-    if ( obj == NULL ) {
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    } else {
-        /* get at the parent database */
-        const VDatabase *db;
-        rc = VTableOpenParentRead ( tbl, & db );
-        if ( rc == 0 ) {
-            /* open the primary alignment table */
-            const VTable *patbl;
-            rc = VDatabaseOpenTableRead ( db, & patbl, "PRIMARY_ALIGNMENT" );
-            VDatabaseRelease ( db );
-            if ( rc == 0 ) {
-                /* create a cursor */
-                rc = VTableCreateCachedCursorRead(patbl, &obj->curs, 256*1024*1024UL);
-                VTableRelease ( patbl );
-                if ( rc == 0 ) {
-                    /* add columns to cursor */
-                    rc = VCursorAddColumn ( obj -> curs, & obj -> read_idx, "( INSDC:4na:bin ) READ" );
-                    if ( rc == 0 ){
-                        rc = VCursorOpen ( obj -> curs );
-			if ( rc == 0 ) {
-			   * objp = obj;
-			   return 0;
-			}
-		    }
-                    VCursorRelease ( obj -> curs );
-                }
-            }
-        }
-        free ( obj );
-    }
-    return rc;
-}
-static INSDC_4na_bin  map[]={
-/*0  0000 - 0000*/ 0,
-/*1  0001 - 1000*/ 8,
-/*2  0010 - 0100*/ 4,
-/*3  0011 - 1100*/ 12,
-/*4  0100 - 0010*/ 2,
-/*5  0101 - 1010*/ 10,
-/*  0110 - 0110*/ 6,
-/*7  0111 - 1110*/ 14,
-/*8  1000 - 0001*/ 1,
-/*9  1001 - 1001*/ 9,
-/*10  1010 - 0101*/ 5,
-/*11  1011 - 1101*/ 13,
-/*12  1100 - 0011*/ 3,
-/*13  1101 - 1011*/ 11,
-/*14  1110 - 0111*/ 7,
-/*15  1111 - 1111*/ 15
-};
-
-static
-rc_t CC seq_restore_read_impl ( void *data, const VXformInfo *info, int64_t row_id,
-                               VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    int i;
-    RestoreRead		*self = data;
-    INSDC_4na_bin	*dst;
-    INSDC_coord_len 	len;
-    uint32_t		src_len		= argv[0].u.data.elem_count;
-    const INSDC_4na_bin	*src		= argv[0].u.data.base;
-    const uint32_t 	num_reads	= argv[1].u.data.elem_count;
-    const int64_t	*align_id	= argv[1].u.data.base;
-    const INSDC_coord_len *read_len  	= argv[2].u.data.base;
-    const uint8_t	*read_type	= argv[3].u.data.base;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 64);
-    assert(argv[2].u.data.elem_bits == sizeof(INSDC_coord_len)*8);
-    assert(argv[2].u.data.elem_count == num_reads);
-    assert(argv[3].u.data.elem_count == num_reads);
-    
-    
-    src   += argv [ 0 ] . u . data . first_elem;
-    align_id  += argv [ 1 ] . u . data . first_elem;
-    read_len  += argv [ 2 ] . u . data . first_elem;
-    read_type += argv [ 3 ] . u . data . first_elem;
-    
-    for(i=0,len=0;i<num_reads;i++){
-        len+=read_len[i];
-    }
-    /* resize output row */    
-    rslt->data->elem_bits = 8;
-    rc = KDataBufferResize(rslt->data, len);
-    rslt->elem_count = len;
-    dst = rslt->data->base;
-    if ( rc == 0  && len > 0 ) {
-        if(len == src_len){ /*** shortcut - all data is local ***/
-            memcpy(dst,src,len);
-        } else for(i=0;i<num_reads && rc == 0;i++){ /*** checking read by read ***/
-            if(align_id[i] > 0) {
-                    const INSDC_4na_bin *r_src;
-                    uint32_t             r_src_len;
-                    rc = VCursorCellDataDirect ( self -> curs,  align_id[i], self -> read_idx, NULL, ( const void** ) & r_src, NULL, & r_src_len );
-                    if(rc == 0){
-                        if(r_src_len == read_len[i]){
-                            if(read_type[i]&SRA_READ_TYPE_FORWARD){
-                                memcpy(dst,r_src,read_len[i]);
-                            }else if(read_type[i]&SRA_READ_TYPE_REVERSE){
-                                int j,k;
-                                for(j=0,k=read_len[i]-1;j<read_len[i];j++,k--){
-                                    dst[j]=map[r_src[k]&15];
-                                }
-                            } else {
-                                rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-                            }
-                        } else {
-                            rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent);
-                        }
-                    }
-            } else { /*** data is in READ column **/
-                if(src_len >= read_len[i]){
-                    memcpy(dst,src,read_len[i]);
-                    src_len -= read_len[i];
-                    src     += read_len[i];
-                } else {
-                    return RC(rcXF, rcFunction, rcExecuting, rcData, rcInconsistent );
-                }
-            }
-            dst += read_len[i];
-        }
-    }
-    return rc;
-}
-
-/* 
- * function
- * INSDC:4na:bin ALIGN:seq_restore_read #1 (  INSDC:4na:bin rd , I64 align_id , INSDC:coord:len read_len);
- */
-VTRANSFACT_IMPL ( ALIGN_seq_restore_read, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                                     VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    RestoreRead *fself;
-    rc_t rc = RestoreReadMake ( & fself, info -> tbl);
-    if(rc == 0 ) {
-        rslt->self = fself;
-        rslt->u.ndf = seq_restore_read_impl;
-        rslt->variant = vftRow;
-        rslt -> whack = RestoreReadWhack;
-    }
-    return rc;
-}
diff --git a/libs/axf/template-len.c b/libs/axf/template-len.c
deleted file mode 100644
index 07266db..0000000
--- a/libs/axf/template-len.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-static
-rc_t CC template_len_impl(void *data,const VXformInfo *info, int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] ) 
-{
-    rc_t 	rc;
-    int32_t	*dst;
-    const INSDC_coord_zero *p1 = argv[0].u.data.base;
-    const INSDC_coord_zero *p2 = argv[1].u.data.base;
-    const INSDC_coord_len  *l1 = argv[2].u.data.base;
-    const INSDC_coord_len  *l2 = argv[3].u.data.base;
-    const char             *n1 = argv[4].u.data.base;
-    const char             *n2 = argv[5].u.data.base;
-    const INSDC_coord_one  *r1 = argv[6].u.data.base;
-
-    /** primary should have everything defines ***/
-    assert(argv[0].u.data.elem_count == 1);
-    assert(argv[2].u.data.elem_count == 1);
-    assert(argv[4].u.data.elem_count > 0 );
-    assert(argv[6].u.data.elem_count == 1);
-
-    rc = KDataBufferResize(rslt->data, 1);
-    if(rc != 0) return rc;
-    rslt->elem_count=1;
-    dst = rslt->data->base;
-    dst[0] = 0;
-
-    /*** check if the mate is mapped **/
-    if(   argv[1].u.data.elem_count > 0
-        && argv[3].u.data.elem_count > 0
-        && argv[4].u.data.elem_count == argv[5].u.data.elem_count)
-    {
-        n1+=argv[4].u.data.first_elem;
-        n2+=argv[5].u.data.first_elem;
-        r1+=argv[6].u.data.first_elem;
-        
-        if(   argv[4].u.data.elem_count == argv[5].u.data.elem_count
-            && memcmp(n1,n2,argv[4].u.data.elem_count)==0) /*** same reference name ***/
-        {
-#if 1
-            unsigned const self_left  = p1[argv[0].u.data.first_elem];
-            unsigned const mate_left  = p2[argv[1].u.data.first_elem];
-            unsigned const self_right = self_left + l1[argv[2].u.data.first_elem];
-            unsigned const mate_right = mate_left + l2[argv[3].u.data.first_elem];
-            unsigned const  leftmost  = (self_left  < mate_left ) ? self_left  : mate_left;
-            unsigned const rightmost  = (self_right > mate_right) ? self_right : mate_right;
-            unsigned const tlen = rightmost - leftmost;
-            
-            /* The standard says, "The leftmost segment has a plus sign and the rightmost has a minus sign." */
-            if (   (self_left <= mate_left && self_right >= mate_right)     /* mate fully contained within self or */
-                || (mate_left <= self_left && mate_right >= self_right))    /* self fully contained within mate; */
-            {
-                if (self_left < mate_left || (r1[0] == 1 && self_left == mate_left))
-                    dst[0] = tlen;
-                else
-                    dst[0] = -tlen;
-            }
-            else if (   (self_right == mate_right && mate_left == leftmost) /* both are rightmost, but mate is leftmost */
-                     ||  self_right == rightmost)
-            {
-                dst[0] = -tlen;
-            }
-            else
-                dst[0] = tlen;
-#else
-            dst[0] = p2[argv[1].u.data.first_elem] -  p1[argv[0].u.data.first_elem];
-            if(dst[0] < 0){
-                dst[0] -= l1[argv[2].u.data.first_elem];
-            } else if (dst[0] > 0) {
-                dst[0] += l2[argv[3].u.data.first_elem];
-            } else if(r1[0]==1){/*** bam wants to give positive TLEN ***/
-                dst[0] = l1[argv[2].u.data.first_elem];
-            } else if(r1[0]==2){/*** bam wants to give negative TLEN ***/
-                dst[0] = -l2[argv[3].u.data.first_elem];
-            } 
-#endif
-        }
-    }
-    return 0;	
-}
-
-VTRANSFACT_IMPL ( NCBI_align_template_len, 1, 0, 0 ) ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-                                                 const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = template_len_impl;
-    return 0;
-}
diff --git a/libs/ext/Makefile b/libs/ext/Makefile
deleted file mode 100644
index 3fcd509..0000000
--- a/libs/ext/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/ext
-
-include $(TOP)/build/Makefile.shell
-
-#-------------------------------------------------------------------------------
-# default
-#
-SUBDIRS = \
-	zlib \
-	bzip2 \
-	curl
-
-include $(TOP)/build/Makefile.targets
-
-default: $(SUBDIRS)
-
-$(SUBDIRS):
-	@ $(MAKE) -C $@
-
-.PHONY: default $(SUBDIRS)
-
-
-#-------------------------------------------------------------------------------
-# pass-through
-#
-out debug profile release GCC ICC VC++:
-	@ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env $@
-
-.PHONY: out debug profile release GCC ICC VC++
diff --git a/libs/ext/bzip2/Makefile b/libs/ext/bzip2/Makefile
deleted file mode 100644
index 79ae1a8..0000000
--- a/libs/ext/bzip2/Makefile
+++ /dev/null
@@ -1,143 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../../build/abspath.sh ../../..)
-MODULE = libs/ext/bzip2
-
-include $(TOP)/build/Makefile.env
-
-INT_LIBS = \
-	libbz2
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-std all: makedirs download
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(INT_LIBS): makedirs download
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: $(ILIBDIR)/libbz2
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: $(ILIBDIR)/libbz2
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f libbz2.vers
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# libbz2
-#
-$(ILIBDIR)/libbz2: $(addprefix $(ILIBDIR)/libbz2.,$(LIBX))
-
-LIBBZ2_SRC = \
-	blocksort \
-	huffman \
-	crctable \
-	randtable \
-	compress \
-	decompress \
-	bzlib
-
-LIBBZ2_OBJ = \
-	$(addsuffix .$(LOBX),$(LIBBZ2_SRC))
-
-$(ILIBDIR)/libbz2.$(LIBX): $(LIBBZ2_OBJ)
-	$(LD) --slib -o $@ $^ $(LIBBZ2_LIB)
-
-
-#-------------------------------------------------------------------------------
-# libbz2 download
-#
-BZIP2_VERS := \
-	1.0.6
-
-BZIP2_TAR = \
-	bzip2-$(BZIP2_VERS).tar
-
-BZIP2_TAR_GZ = \
-	$(BZIP2_TAR).gz
-
-ifeq (win,$(OS))
-ECHO_VERS = echo -ne $(BZIP2_VERS) "\n"
-else
-ECHO_VERS = echo $(BZIP2_VERS)
-endif
-
-ifeq (sun,$(OS))
-	BZIP2_TAR_GET = $(BZIP2_TAR)
-	TAR_CMD = tar -xf
-else
-	BZIP2_TAR_GET = $(BZIP2_TAR_GZ)
-	TAR_CMD = tar --no-same-owner -x -z -f
-endif
-
-ifeq (mac,$(OS))
-RETRIEVE = curl -O
-else
-RETRIEVE = wget
-endif
-
-$(BZIP2_TAR_GZ):
-	@ echo downloading the sources
-	$(RETRIEVE) http://bzip.org/$(BZIP2_VERS)/bzip2-$(BZIP2_VERS).tar.gz
-	@ touch $@
-
-$(BZIP2_TAR): $(BZIP2_TAR_GZ)
-	gzcat $^ > $@
-
-libbz2.vers: $(BZIP2_TAR_GET)
-	@ echo unpacking the sources
-	$(TAR_CMD) $^
-	cp bzip2-$(BZIP2_VERS)/*.[ch] .
-	cp bzip2-$(BZIP2_VERS)/*.def .
-	#-rm -rf bzip2-$(BZIP2_VERS)
-	@ $(ECHO_VERS) > $@
-
-download: libbz2.vers
-
-.PHONY: download
diff --git a/libs/ext/curl/Makefile b/libs/ext/curl/Makefile
deleted file mode 100644
index e5736a8..0000000
--- a/libs/ext/curl/Makefile
+++ /dev/null
@@ -1,103 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../../build/abspath.sh ../../..)
-MODULE = libs/ext/curl
-
-include $(TOP)/build/Makefile.env
-
-INT_LIBS = \
-
-EXT_LIBS = \
-	libcurl
-
-ALL_LIBS = \
-	$(INT_LIBS) \
-	$(EXT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-ifneq (rwin,$(BUILD_OS))
-
-all std clean $(ALL_LIBS):
-	@true
-
-.PHONY: all std clean $(ALL_LIBS)
-
-else
-
-std: makedirs 
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-all: makedirs 
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(INT_LIBS): makedirs 
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(EXT_LIBS): makedirs 
-	@ $(MAKE_CMD) $(LIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: $(BINDIR)/libcurl.$(DLLX)
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: $(BINDIR)/libcurl.$(DLLX)
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	rm -f $(BINDIR)/libcurl.$(DLLX)
-    
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# libcurl
-#
-LIBCURL_VERS := \
-	7.29.0
-
-ifeq (dbg,$(BUILD))
-    DBG=-dbg
-endif
-$(BINDIR)/libcurl.$(DLLX): /panfs/pan1/sra-test/TOOLKIT/libcurl/$(LIBCURL_VERS)/win$(BITS)$(DBG)/libcurl.$(DLLX)
-	cp $^ $@
-
-endif
-    
diff --git a/libs/ext/zlib/Makefile b/libs/ext/zlib/Makefile
deleted file mode 100644
index 4ae581a..0000000
--- a/libs/ext/zlib/Makefile
+++ /dev/null
@@ -1,150 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../../build/abspath.sh ../../..)
-MODULE = libs/ext/zlib
-
-include $(TOP)/build/Makefile.env
-
-INT_LIBS = \
-	libz
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-std all: makedirs download
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(INT_LIBS): makedirs download
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: $(ILIBDIR)/libz
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: $(ILIBDIR)/libz
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# libz
-#
-$(ILIBDIR)/libz: $(addprefix $(ILIBDIR)/libz.,$(LIBX))
-
-LIBZ_SRC = \
-	adler32 \
-	compress \
-	crc32 \
-	deflate \
-	gzclose \
-	gzlib \
-	gzread \
-	gzwrite \
-	infback \
-	inffast \
-	inflate \
-	inftrees \
-	trees \
-	uncompr \
-	zutil
-
-
-LIBZ_OBJ = \
-	$(addsuffix .$(LOBX),$(LIBZ_SRC))
-
-$(ILIBDIR)/libz.$(LIBX): $(LIBZ_OBJ)
-	$(LD) --slib -o $@ $^ $(LIBZ_LIB)
-
-
-#-------------------------------------------------------------------------------
-# libz download
-#
-ZLIB_VERS := \
-	1.2.8
-
-ZLIB_TAR = \
-	zlib-$(ZLIB_VERS).tar
-
-ZLIB_TAR_GZ = \
-	$(ZLIB_TAR).gz
-
-ifeq (win,$(OS))
-ECHO_VERS = echo -ne $(ZLIB_VERS) "\n"
-else
-ECHO_VERS = echo $(ZLIB_VERS)
-endif
-
-ifeq (sun,$(OS))
-	ZLIB_TAR_GET = $(ZLIB_TAR)
-	TAR_CMD = tar -xf
-else
-	ZLIB_TAR_GET = $(ZLIB_TAR_GZ)
-	TAR_CMD = tar --no-same-owner -x -z -f
-endif
-
-ifeq (mac,$(OS))
-RETRIEVE = curl -O
-else
-RETRIEVE = wget
-endif
-
-$(ZLIB_TAR_GZ):
-	@ echo downloading the sources
-	$(RETRIEVE) http://zlib.net/$@
-	@ touch $@
-
-$(ZLIB_TAR): $(ZLIB_TAR_GZ)
-	gzcat $^ > $@
-
-libz.vers: $(ZLIB_TAR_GET)
-	@ echo unpacking the sources
-	$(TAR_CMD) $^
-	cp zlib-$(ZLIB_VERS)/*.[ch] .
-	cp zlib-$(ZLIB_VERS)/win32/zlib.def libz.def
-	@ $(ECHO_VERS) > $@
-
-download: libz.vers
-
-.PHONY: download
diff --git a/libs/kapp/Makefile b/libs/kapp/Makefile
deleted file mode 100644
index f833d17..0000000
--- a/libs/kapp/Makefile
+++ /dev/null
@@ -1,115 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kapp
-
-include $(TOP)/build/Makefile.env
-
-INT_LIBS = \
-	libkapp \
-    libload
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# OS specific application support
-#
-$(ILIBDIR)/libkapp: $(addprefix $(ILIBDIR)/libkapp.,$(LIBX))
-
-KAPP_SRC = \
-	main \
-	args \
-	tokenizer \
-	sysmain
-
-KAPP_OBJ = \
-	$(addsuffix .$(OBJX),$(KAPP_SRC))
-
-KAPP_LIB = \
-	-dvfs \
-	-dklib
-
-$(ILIBDIR)/libkapp.$(LIBX): $(KAPP_OBJ)
-	$(LD) --slib -o $@ $^ $(KAPP_LIB)
-
-
-#-------------------------------------------------------------------------------
-# loaders common libarary
-#
-$(ILIBDIR)/libload: $(addprefix $(ILIBDIR)/libload.,$(LIBX))
-
-LOADLIB_SRC = \
-	progressbar \
-	loader-file \
-	loader-meta \
-	log-xml
-
-ifneq (win,$(OS))
-	LOADLIB_SRC += queue-file
-endif
-
-LOADLIB_OBJ = \
-	$(addsuffix .$(LOBX),$(LOADLIB_SRC))
-
-LOADLIB_LIB = \
-	-dkfs \
-	-dklib
-
-ifneq (win,$(OS))
-	LOADLIB_LIB += -dkq
-endif
-
-$(ILIBDIR)/libload.$(LIBX): $(LOADLIB_OBJ)
-	$(LD) --slib -o $@ $^ $(LOADLIB_LIB)
diff --git a/libs/kapp/args.c b/libs/kapp/args.c
deleted file mode 100644
index 06ef91c..0000000
--- a/libs/kapp/args.c
+++ /dev/null
@@ -1,2004 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <kapp/extern.h>
-#include <sysalloc.h>
-
-#include <klib/report.h>
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/debug.h>
-#include <kfg/config.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include "args_debug.h"
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#define USE_INLINING   0
-#ifndef USE_OPTFILE
-#define USE_OPTFILE    0
-#endif
-#define USE_EARLY_HELP 1
-#define USE_EARLY_VERSION 1
-
-/* many tools acquired some usage for '-q'
-   other than the standard meaning of "be quiet".
-   while we phase this out, allow these tools
-   to replace the default usage. */
-#define HONOR_LEGACY_Q_ALIAS 1
-#if HONOR_LEGACY_Q_ALIAS
-#define LEGACY_Q_ALIAS_DEPRECATED 1
-#define LEGACY_Q_ALIAS_ERROR      0
-#endif
-
-bool CC is_valid_name (const char * string)
-{
-    /* we do not allow leading - or empty names */
-    if ((*string == '\0') || (*string == '-'))
-        return false;
-    /* we do not allow ASCII control or ASCII space
-     * but we do not disallow punctuation.  Use at your own risk */
-    for ( ; *string != '\0'; ++string)
-        if (isspace (*string) || iscntrl (*string))
-            return false;
-    return true;
-}
-
-
-/* ==========
- * ParamValue
- *   the value for an option is a NUL terminated ASCII / UTF-8 string
- */
-typedef char ParamValue [1];
-
-/*
- * Make
- *   allocated memory for a ASCII/UTF-8 string including one extra for NUL
- *   the value passed in must be a NUL termintaed string as well
- */
-static
-rc_t CC ParamValueMake (ParamValue ** pself, const char * value, size_t value_size)
-{
-    size_t alloc_size;
-
-    assert (pself);
-    assert (value);
-    assert (value_size);
-
-    alloc_size = sizeof (ParamValue) + value_size;
-    *pself = malloc (alloc_size);
-
-    if (*pself == NULL)
-    {
-        fprintf (stderr, "Error allocating memory for option parameter %s\n",
-                 value);
-        return RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-    }
-
-    string_copy (**pself, alloc_size, value, value_size);
-    return 0;
-}
-
-/*
- * Whack
- *   undo the Make.  That is free the memory
- */
-static
-void CC ParamValueWhack (void * self)
-{
-    assert (self); /* not an absolute requirement but if NULL we got programming error */
-
-    free (self);
-}
-
-static
-void CC ParamValueVectorWhack (void * self, void * ignored)
-{
-    assert (self);
-
-    ParamValueWhack(self);
-}
-
-
-/* ==========
- * Option
- *  this is the primary node ofr an option
- *  It contains the name of the long option that is also the key to pulling
- *  out values.  The storage of these nodes is in a BSTree.
- */
-typedef struct Option
-{
-    BSTNode     n;              /* BSTree node storage */
-
-    size_t      size;           /* name length (size if UTF-8) */
-    Vector      values;         /* Vector of set values */
-    uint32_t    count;          /* count of times option seen on the command line */
-    uint32_t    max_count;      /* if non-zero, how many times is it legal to be seen */
-    bool        needs_value;    /* does this option take/require a value? */
-    bool        required;       
-    bool        deprecated;     /* a warning if used */
-    bool        error;          /* an error if used */
-    char        name [1];       /* key value The 1 will be the NUL */
-} Option;
-
-static
-rc_t CC OptionMake (Option ** pself, const char * name, size_t size, uint32_t max_count, bool needs_value, bool required)
-{
-    Option *   self;
-    rc_t rc;
-
-    assert (pself);
-    assert (name);
-    assert ((needs_value == true)||(needs_value == false)); /* not really but lets be rigorous */
-    assert ((required == true)||(required == false)); /* not really but lets be rigorous */
-
-    self = malloc (sizeof (*self) + size);
-    if (self == NULL)
-    {
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-        PLOGERR (klogErr, (klogErr, rc, "Error adding option '$(O)'","O=--%s",name));
-    }
-    else 
-    {
-        if ((self->needs_value = needs_value) != false)
-            VectorInit (&self->values,0,4);
-        else
-            memset (&self->values, sizeof(self->values), 0);
-
-        self->required = required;
-        self->deprecated = self->error = false;
-        self->count = 0;
-        self->max_count = max_count;
-        self->size = size;
-        string_copy (self->name, size+1, name, size);
-    }
-    *pself = self;
-    return 0;
-}
-
-static
-void CC OptionWhack (Option * self)
-{
-    assert (self);
-
-    if (self->needs_value)
-        VectorWhack (&self->values, ParamValueVectorWhack, NULL);
-
-    free (self);
-}
-
-static
-void CC OptionTreeWhack (BSTNode * node, void * ignored)
-{
-    OptionWhack ((Option*)node);
-}
-#ifdef OptionGetName_needed
-static
-const char * CC OptionGetName (const Option * self, size_t * size)
-{
-    assert (self);
-    if (size)
-        *size = self->size;
-    return self->name;
-}
-#endif
-/*
- * NeedsValue
- *  return bool, does this option require a value
- */
-static
-bool CC OptionNeedsValue (const Option * self)
-{
-    assert (self);
-
-    return self->needs_value;
-}
-
-/*
- * GetCount
- *  return the count of values seen so far.
- */
-static
-uint32_t CC OptionGetCount (const Option *self)
-{
-    assert (self);
-
-    return self->count;
-}
-
-/* 
- * GetValue
- *    returns the address of the Nth value (not a copy of the value)
- */
-static
-rc_t CC OptionGetValue (const Option * self, uint32_t number, const char ** value)
-{
-    /* SKH -- not sure why this was here. 
-       const char * pc; */
-    uint32_t count;
-
-    assert (self);
-    assert (value);
-
-    count = OptionGetCount(self);
-
-    *value = VectorGet (&self->values, number);
-    /* SKH -- this was checking pc, which is uninitialized */
-    if (*value == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcIndex, rcExcessive);
-
-    return 0;
-}
-
-/*
- * add a value to this node.  If a value isn't needed this is just incrementing the count
- */
-static
-rc_t CC OptionAddValue (Option * self, const char * value, size_t size)
-{
-    ParamValue * pvalue;
-    rc_t rc = 0;
-
-    assert (self);
-
-    ++self->count;
-
-/*     KOutMsg ("%s: name %s count %u max_count %u value %s\n", __func__, self->name, self->count, self->max_count, value); */
-    if (self->max_count && (self->count > self->max_count))
-    {
-        --self->count;
-        rc = RC (rcRuntime, rcArgv, rcInserting, rcData, rcExcessive);
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Too many occurrences of option '$(O)'",
-                  "O=--%s", self->name));
-    }
-    else if (self->needs_value)
-    {
-        assert (value);     /* gotta have a value */
-        assert (size);      /* value can't be a NUL string */
-
-        rc = ParamValueMake (&pvalue, value, size);
-        if (rc == 0)
-        {
-            /* NOTE: effectively going in as a char ** though we will 
-             * pull it out as a char* with the same value */
-            rc = VectorAppend (&self->values, NULL, pvalue);
-            if (rc)
-            {
-                PLOGERR (klogErr,
-                         (klogErr, rc, "error capturing parameter '$(O)'",
-                          "O=--%s", self->name));
-                ParamValueWhack (pvalue);
-            }
-            else
-            {
-                ARGS_DBG( "added option-value %s", self->name );
-            }
-        }
-    }
-    return rc;
-}
-
-static
-int CC OptionCmp (const void * item, const BSTNode * n)
-{
-    const char * name;
-    const Option * option;
-    size_t l;
-
-    assert (item);
-    assert (n);
-
-    name = item;
-    option = (Option*)n;
-    l = string_size (name);
-    return string_cmp (name, l, option->name, option->size, (uint32_t)(l + option->size) );
-}
-
-static
-int CC OptionSort (const BSTNode * item, const BSTNode * n)
-{
-    const Option * l = (Option*)item;
-    const Option * r = (Option*)n;
-    return string_cmp (l->name, l->size, r->name, r->size, (uint32_t)(l->size + r->size) );
-}
-
-/* ==========
- */
-typedef struct OptAlias
-{
-    BSTNode     n;              /* BSTree Node storage */
-
-    Option *   option;          /* full name node for which this is an alias */
-    size_t      size;
-    bool        deprecated;     /* warning if used */
-    bool        error;          /* error if used */
-    char        name[1];        /* utf8 name */
-} OptAlias;
-
-static
-rc_t CC OptAliasMake (OptAlias ** pself, const char * name, size_t size,
-                      Option * option)
-{
-    OptAlias * self;
-
-    assert (pself);
-    assert (name);
-    assert (size);
-
-    self = malloc (sizeof (*self) + size);
-    if (self == NULL)
-    {
-        rc_t rc = RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error creating structure for alias '$(A)' for parameter '$(B)", 
-                  "A=%s,B=%s", name, option->name));
-        *pself = NULL;
-        return rc;
-    }
-    self->option = option;
-    self->size = size;
-    self->deprecated = self->error = false;
-    string_copy (self->name, size + 1, name, size);
-    *pself = self;
-    return 0;
-}
-
-static
-void CC OptAliasWhack (const OptAlias * self)
-{
-    assert (self);
-    free ((void*)self);
-}
-
-static
-void CC OptAliasTreeWhack (BSTNode * node, void * ignored)
-{
-    assert (node); /* catch programming errors; freeing NULL wouldn't hurt */
-
-    OptAliasWhack ((OptAlias*)node);
-}
-
-#if 0
-static
-const char * CC OptAliasName (const OptAlias * self, size_t * size)
-{
-    assert (self);
-
-    if (size)
-        *size = self->size;
-    return self->name;
-}
-#endif
-static
-Option * CC OptAliasOption (const OptAlias *self)
-{
-    assert (self != NULL);
-
-    return self->option;
-}
-
-static
-int CC OptAliasCmp (const void * item, const BSTNode * n)
-{
-    const char * name;
-    const OptAlias * option;
-    size_t l;
-
-    assert (item);
-    assert (n);
-
-    name = item;
-    option = (OptAlias*)n;
-    l = string_size (name);
-    return string_cmp (name, l, option->name, option->size, (uint32_t)( l + option->size ) );
-}
-
-static
-int CC OptAliasSort (const BSTNode * item, const BSTNode * n)
-{
-    const OptAlias * l;
-    const OptAlias * r;
-
-    assert (item);
-    assert (n);
-
-    l = (OptAlias*)item;
-    r = (OptAlias*)n;
-    return string_cmp (l->name, l->size, r->name, r->size, (uint32_t)( l->size + r->size ) );
-}
-
-#if NOT_USED_YET
-static
-rc_t CC OptDefMakeCopy (OptDef ** pself, OptDef * original)
-{
-    OptDef * self;
-    size_t nsize;
-    size_t asize;
-    size_t hsize;
-
-    nsize = string_size (original->name);
-    asize = original->aliases ? string_size (original->aliases) : 0;
-    hsize = original->help ? string_size (original->help) : 0;
-
-    self = malloc (sizeof (*self) + nsize + 1 + asize + 1 + hsize + 1);
-    if (self == NULL)
-    {
-        rc_t rc;
-        /* assuming DebugMsg is stderr equivalent */
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-        LOGERR (klogFatal, rc, "error creating help for option");
-        return rc;
-    }
-    self->name = (char*)(self+1);
-    string_copy (self->name, nsize + 1, original->name, nsize);
-    self->aliases = self->name + nsize + 1;
-    if (original->aliases)
-    {
-        string_copy (self->aliases, asize + 1, original->aliases, asize);
-    }
-    else
-        self->aliases[0] = '\0';
-    self->help = self->aliases + asize + 1;
-    if (original->help)
-    {
-        string_copy (self->help, hsize + 1, original->help, asize);
-    }
-    else
-        self->help[0] = '\0';
-    self->max_count = original->max_count;
-    self->needs_value = original->needs_value;
-    *pself = self;
-    return 0;
-}
-static
-void CC OptDefCopyVectorWhack (void * self, void * ignored)
-{
-    free (self);
-}
-
-#endif
-
-#if NOT_USED_YET
-
-typedef struct HelpGroup
-{
-    rc_t ( CC * header_fmt) (Args * args, const char * header);
-    Vector options;
-    const char header[1];
-} HelpGroup;
-
-
-static
-rc_t CC HelpGroupMake (HelpGroup ** pself, const char * name)
-{
-    HelpGroup * self;
-    size_t size;
-
-    size = string_size (name);
-    self = malloc (sizeof (*self) + size);
-    if (self == NULL)
-    {
-        fprintf (stderr, "Error allocating help group structure %s\n", name);
-        return RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-    }
-    string_copy (self->name, size+1, name, size);
-    VectorInit (&self->optdefs, 0, 16);
-
-    *pself = self;
-    return 0;
-}
-
-
-static
-rc_t CC HelpGroupAddOptDef (HelpGroup * self, OptDef * option)
-{
-    OptDef * opt;
-    rc_t rc;
-
-    rc = OptDefCopy (&opt, option);
-    if (rc)
-        return rc;
-
-    rc = VectorAppend (&self->optdefs, NULL, opt);
-    if (rc)
-    {
-        fprintf (stderr, "Error appending option for help\n");
-        OptDefCopyVectorWhack (opt, NULL);
-        return rc;
-    }
-    return 0;
-}
-
-static
-void CC HelpGroupVectorWhack (void * item, void * ignored)
-{
-    HelpGroup * self = item;
-
-    assert (self);
-    VectorWhack (&self->optdefs, OptDefCopyVectorWhack, NULL);
-    free (self);
-}
-#endif
-
-/* ==========
- */
-struct Args
-{
-    BSTree names;
-    BSTree aliases;
-    Vector argv;
-    Vector params;
-    Vector help;
-#if NOT_USED_YET
-    HelpGroup * def_help;
-#endif
-#if HONOR_LEGACY_Q_ALIAS
-    bool   qalias_replaced;
-#endif
-};
-
-rc_t CC ArgsMake (Args ** pself)
-{
-    rc_t rc;
-    Args * self;
-
-    assert (pself);
-
-    self = malloc (sizeof (*self));
-    if (self == NULL)
-    {
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-#if NOT_USED_YET
-        HelpGroup * help;
-#endif
-        BSTreeInit (&self->names);
-        BSTreeInit (&self->aliases);
-        VectorInit (&self->argv,0,8);
-        VectorInit (&self->params,0,8);
-        VectorInit (&self->help,0,16);
-#if HONOR_LEGACY_Q_ALIAS
-        self -> qalias_replaced = false;
-#endif
-#if NOT_USED_YET
-        rc = HelpGroupMake (&help, "NCBI Options");
-        if (rc)
-        {
-            ArgsWhack (self);
-        }
-        else
-        {
-            self->def_help = help;
-            rc = VectorAppend (&self->help, NULL, help);
-        }
-#else
-        rc = 0;
-#endif
-    }
-    *pself = (rc == 0) ? self : NULL;
-    return rc;
-}
-
-rc_t CC ArgsWhack (Args * self)
-{
-    if (self)
-    {
-        BSTreeWhack (&self->names, OptionTreeWhack, NULL);
-        BSTreeWhack (&self->aliases, OptAliasTreeWhack, NULL);
-        VectorWhack (&self->argv, ParamValueVectorWhack, NULL);
-        VectorWhack (&self->params, NULL, NULL);
-#if NOT_USED_YET
-        VectorWhack (&self->help, HelpGroupVectorWhack, NULL);
-#endif
-        free (self);
-    }
-    return 0;
-}
-
-static
-rc_t CC ArgsAddOption (Args * self, const OptDef * option)
-{
-    rc_t rc = 0;
-    Option * node;
-    Option * prev;
-    const char * name;
-    size_t size; /* will be used for the help tree side */
-
-    if (self == NULL)
-    {
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcSelf, rcNull);
-        LOGERR (klogInt, rc, "Error adding an opion with no object");
-        return rc;
-    }
-    if (option == NULL)
-    {
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcParam, rcNull);
-        LOGERR (klogInt, rc, "Error adding an option with no option name");
-        return rc;
-    }
-    name = option->name;
-    if (! is_valid_name (name))
-    {
-        rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcInvalid);
-        PLOGERR (klogInt, (klogInt, rc, "Error using illegal option name '$(O)'", "O=--%s", name));
-        return rc;
-    }
-    size = string_size (name);
-    rc = OptionMake (&node, name, size, option->max_count, option->needs_value, option->required);
-    if (rc)
-        return rc;
-    size ++;
-
-    prev = NULL;
-    rc = BSTreeInsertUnique (&self->names, &node->n, (BSTNode**)&prev, OptionSort);
-    if (rc)
-    {
-        if (GetRCState(rc) == rcBusy)
-        {
-            rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcBusy);
-            PLOGERR (klogInt,
-                     (klogInt, rc, "duplicate option name '$(O)'", "O=--%s", name));
-        }
-        else
-            PLOGERR (klogInt,
-                     (klogInt, rc, "unknown error inserting option name '$(O)'", "O=--%s", name));
-
-        OptionWhack (node);
-        return rc;
-    }
-    if (option->aliases)     /* any single character aliases? */
-    {
-        const char * startc;
-        const char * endc;
-        int incr;
-
-        for ((startc = option->aliases),(endc = startc + string_size (startc));
-             startc < endc; startc += incr)
-        {
-            OptAlias * snode;
-            OptAlias * sprev;
-            uint32_t c;
-            char alias_name [8]; /* 4 should be enough + 1 for NUL */
-
-            incr = utf8_utf32 (&c, startc, endc);
-            if (incr < 0)
-            {
-                rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcCorrupt);
-                PLOGERR (klogInt,
-                         (klogInt, rc, "Error parsing alias string '$(A)' from '$(B)' for '$(C)'",
-                          "A=%s,B=%s,C=%s", startc, option->aliases, name));
-                break;
-            }
-            if (incr > 4)
-            {
-                rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcCorrupt);
-                PLOGERR (klogInt,
-                         (klogInt, rc,"Error parsing UTF-8 string '$(S)'",
-                          "S=%s", startc));
-                break;
-            }
-            size = string_copy (alias_name, sizeof (alias_name), startc, incr);
-            if (! is_valid_name (alias_name))
-            {
-                rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcInvalid);
-                PLOGERR (klogInt,
-                         (klogInt, rc, "Error using invalid alias name '$(S)'",
-                          "S=%s", alias_name));
-                break;
-            }
-#if 0
-            size += incr + 1;
-#endif
-            rc = OptAliasMake (&snode, alias_name, incr, node);
-            if (rc)
-                break;
-            rc = BSTreeInsertUnique (&self->aliases, &snode->n, (BSTNode**)&sprev, OptAliasSort);
-            if (rc)
-            {
-                if (GetRCState(rc) == rcExists)
-                {
-#if HONOR_LEGACY_Q_ALIAS
-                    if ( ! self -> qalias_replaced && size == 1 && alias_name [ 0 ] == 'q' )
-                    {
-                        BSTreeUnlink ( & self -> aliases, & sprev -> n );
-                        rc = BSTreeInsertUnique ( & self -> aliases, & snode -> n, NULL, OptAliasSort );
-                        if ( rc != 0 )
-                            BSTreeInsert ( & self -> aliases, & sprev -> n, OptAliasSort );
-                        else
-                        {
-                            OptAliasWhack ( sprev );
-                            self -> qalias_replaced = true;
-#if LEGACY_Q_ALIAS_DEPRECATED
-                            snode -> deprecated = true;
-#elif LEGACY_Q_ALIAS_ERROR
-                            snode -> error = true;
-#endif
-                            continue;
-                        }
-                    }
-#endif
-                    rc = RC (rcRuntime, rcArgv, rcConstructing, rcName, rcExists);
-                    PLOGERR (klogInt,
-                             (klogInt, rc, "duplicate alias name '$(S)'",
-                              "S=%s", alias_name));
-                }
-                else
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, rc, "unknown error inserting alias '$(S)'",
-                              "S=%s", alias_name));
-                }
-
-                OptAliasWhack (snode);
-                break;
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t CC ArgsAddOptionArray (Args * self, const OptDef * option, uint32_t count /*, 
-                                                                                             rc_t (*header_fmt)(Args * args, const char * header),
-                                                                                             const char * header */)
-{
-    rc_t rc;
-#if NOT_USED_YET
-    HelpGroup * hg;
-
-    rc = HelpGroupMake (&hg, header, header_fmt, option, count);
-    if (rc == 0)
-    {
-
-        rc = VectorAppend (&self->help, NULL, hg);
-        if (rc == 0)
-        {
-
-            /* count might be zero for help only sections */
-            for (rc = 0; count > 0; --count, ++option)
-            {
-                rc = ArgsAddOption (self, option);
-                if (rc)
-                    break;
-            }
-            if (rc == 0)
-                return 0;
-        }
-        else
-            HelpGroupVectorWhack (hg, NULL);
-    }
-#else
-    for (rc = 0; (rc == 0) && (count > 0); --count, ++option)
-    {
-        rc = ArgsAddOption (self, option);
-    }
-#endif
-    return rc;
-}
-
-/*
- */
-rc_t CC next_arg (const Args * self, int * pix, int max, const char ** pvalue)
-{
-    int ix;
-
-    if (*pix >= max)
-        return RC (rcApp, rcArgv, rcAccessing, rcString, rcNotFound);
-
-    ix = *pix;
-    ix++;
-    *pvalue = (const char *) VectorGet (&self->argv, ix);
-    *pix = ix;
-    return 0;
-}
-
-typedef struct ArgsReqCheckData
-{
-    Option * missing_option;
-    rc_t rc;
-} ArgsReqCheckData;
-
-static
-void CC ArgsCheckRequiredInt (BSTNode * n, void * _data)
-{
-#if 1
-    ArgsReqCheckData * data;
-    Option * opt;
-    rc_t rc;
-
-    data = _data;
-    opt = (Option*)n;
-    if (opt->required && ! opt->count)
-    {
-        rc = RC( rcRuntime, rcArgv, rcParsing, rcParam, rcNotFound );
-        PLOGERR (klogWarn, (klogWarn, rc, "Error missing required parameter '$(P)'",
-                            "P=%s", opt->name));
-        if (data->missing_option == NULL)
-        {
-            data->missing_option = opt;
-            data->rc = rc;
-        }
-    }
-#endif
-}
-
-/* check for required parameters */
-rc_t CC ArgsCheckRequired (Args * self)
-{
-    ArgsReqCheckData r = { NULL, false };
-
-    BSTreeForEach ( &self->names, false, ArgsCheckRequiredInt, &r );
-
-    return r.rc;
-}
-
-static
-rc_t ArgsParseInt (Args * self, int argc, char *argv[])
-{
-    rc_t rc = 0;        /* hard fail - quit processing */
-    rc_t orc = 0;       /* soft fail - keep processing but we'll fail in the end */
-    rc_t qrc = 0;       /* transient - if set will move to a previously unset orc */
-    int ix, ix_from, ix_to;
-    size_t jx;
-    Option * node;
-    const char * parg;
-    char * equal_sign;
-    ParamValue * arg;
-    char name [32];
-    const char * value = NULL;
-    size_t value_len;
-    bool needs_value;
-    uint32_t n_in_argv_before;
-
-    n_in_argv_before = VectorLength( &self->argv );
-
-    /* first capture original argument list and store in our format */
-    for ( ix = 0; ix < argc; ++ix )
-    {
-        size_t len;
-
-        parg = argv[ix];
-        len = strlen ( parg );
-
-        rc = ParamValueMake ( &arg, parg, len );
-        if ( rc == 0 )
-            rc = VectorAppend ( &self->argv, NULL, arg );
-        if ( rc )
-            break;
-        else
-            ARGS_DBG( "ArgsParse: inserted '%s' into self->argv", parg );
-    }
-    
-    if ( rc )
-        return rc;
-
-    if ( n_in_argv_before == 0 )
-    {
-        ix_from = 1;
-        ix_to = argc;
-    }
-    else
-    {
-        ix_from = n_in_argv_before;
-        ix_to = n_in_argv_before + argc;
-    }
-
-    for ( ix = ix_from; ix < ix_to; ++ix )
-    {
-        parg = ( const char * )VectorGet( &self->argv, ix );
-
-        ARGS_DBG( "ArgsParse: parsing '%s' from self->argv", parg );
-
-        if ( parg[ 0 ] != '-' )
-        {
-            /* we can do this because it is already a (const char *)
-             * and (ParamValue *) after the first loop */
-            rc = VectorAppend ( &self->params, NULL, parg );
-            if ( rc )
-                break;
-            ARGS_DBG( "ArgsParse: appending to params '%s'", parg );
-        }
-        else
-        {
-            node = NULL;
-            if ( parg[ 1 ] == '-' )
-            {
-                size_t nlen = string_copy( name, sizeof( name ), parg + 2, string_size( parg + 2 ) );
-                ARGS_DBG( "ArgsParse: '%s' is a '--' parameter!", parg );
-                equal_sign = string_chr( name, nlen, '=' );
-                if ( equal_sign )
-                    *equal_sign = '\0';
-
-                node = ( Option* )BSTreeFind( &self->names, name, OptionCmp );
-                if ( node == NULL )
-                {
-                    qrc = RC( rcApp, rcArgv, rcParsing, rcParam, rcUnknown );
-                    PLOGERR (klogErr,
-                             (klogErr, qrc,
-                              "Unknown argument '$(O)'", "O=--%s", name ));
-/*                     break; */
-                    if (orc == 0) /* non-fatal */
-                        orc = qrc;
-                }
-                else
-                {
-                    needs_value = OptionNeedsValue( node );
-                    ARGS_DBG( "ArgsParse: found node for parameter '%s'", parg );
-                    if ( needs_value )
-                    {
-                        ARGS_DBG( "ArgsParse: parameter '%s' needs value", parg );
-                        if ( equal_sign != NULL )
-                            value = parg + 2 + ( ( equal_sign + 1 ) - name );
-
-                        else if ( ix + 1 >= ix_to )
-                        {
-                            rc = RC( rcRuntime, rcArgv, rcParsing, rcParam, rcExhausted );
-                            PLOGERR (klogErr,
-                                     (klogErr, qrc,"Option '$(O)' is missing a value", "O=--%s", node->name ));
-                        }
-                        else
-                        {
-                            ARGS_DBG( "ArgsParse: calling next_arg()", 0 );
-                            rc = next_arg( self, &ix, ix_to, &value );
-                        }
-
-                        if ( rc == 0 )
-                        {
-                            assert ( value != NULL );
-
-                            value_len = string_size( value );
-
-                            rc = OptionAddValue( node, value, value_len );
-                        }
-                    }
-                    else
-                    {
-                        rc = OptionAddValue( node, NULL, 0 );
-                    }
-
-                    if ( rc != 0 )
-                        break;
-
-                    if ( node -> error )
-                    {
-                        rc = RC ( rcApp, rcArgv, rcParsing, rcParam, rcUnsupported );
-                        PLOGERR (klogErr,
-                                 (klogErr, rc,
-                                  "Deprecated argument '$(O)' is no longer supported.", "O=--%s", name ));
-                        break;
-                    }
-
-                    if ( node -> deprecated )
-                    {
-                        PLOGMSG (klogWarn,
-                                 (klogWarn,
-                                  "Deprecated argument '$(O)' may not be supported in future releases.", "O=--%s", name ));
-                    }
-                }
-            }
-            else
-            {
-                const char * end;
-                uint32_t name_len;
-
-                end = parg + string_size( parg );
-                ARGS_DBG( "ArgsParse: '%s' is a '-' parameter!", parg );
-                for ( jx = 1; parg[ jx ]; jx += name_len )
-                {
-                    OptAlias *alias;
-                    uint32_t c;
-
-                    name_len = utf8_utf32( &c, parg + jx, end ); 
-                    string_copy( name, sizeof( name ), parg + jx, name_len );
-
-                    alias = ( OptAlias* )BSTreeFind( &self->aliases, name, OptAliasCmp );
-                    if ( alias == NULL )
-                    {
-                        qrc = RC( rcApp, rcArgv, rcParsing, rcParam, rcUnknown );
-                        PLOGERR (klogErr,
-                                 (klogErr, qrc,
-                                  "Unknown argument '$(O)'", "O=-%s", name ));
-
-                        if (orc == 0)
-                            orc = qrc;
-                    }
-                    else
-                    {
-                        bool break_loop = false;
-                        node = OptAliasOption( alias );
-                        if ( OptionNeedsValue( node ) )
-                        {
-                            if ( parg[ jx + name_len ] == '=' )
-                            {
-                                ++jx;
-                                if ( parg[ jx + name_len ] )
-                                    value = parg + jx + name_len;
-                                else
-                                {
-                                    qrc = RC( rcRuntime, rcArgv, rcParsing, rcParam, rcExhausted );
-                                    LOGERR (klogErr, qrc,
-                                            "Value missing with alias followed by =" );
-                                    if (orc == 0)
-                                        orc = qrc;
-                                    break_loop = true;
-                                }
-                            }
-                            else if ( parg[ jx + name_len ] )
-                            {
-                                value = parg + jx + name_len;
-                            }
-                            else if ( ix + 1 >= ix_to )
-                            {
-                                rc = RC( rcRuntime, rcArgv, rcParsing, rcParam, rcExhausted );
-                                PLOGERR (klogErr,
-                                         (klogErr, rc,
-                                          "Option '$(O)' ( alias for '$(N)' ) is missing a value",
-                                          "O=-%s,N=--%s", name, node->name ));
-                                break;
-                            }
-                            else
-                            {
-                                value = ( const char * )VectorGet( &self->argv, ++ix );
-                            }
-                            ARGS_DBG( "ArgsParse: the value of '%s' is '%s'", name, value );
-
-                            if ( rc == 0 )
-                                rc = OptionAddValue( node, value, string_size( value ) );
-                            break_loop = true;
-                        }
-                        else
-                        {
-                            rc = OptionAddValue( node, NULL, 0 );
-                        }
-
-                        if ( rc != 0 )
-                            break;
-
-                        if ( node -> error )
-                        {
-                            rc = RC ( rcApp, rcArgv, rcParsing, rcParam, rcUnsupported );
-                            PLOGERR (klogErr,
-                                     (klogErr, rc,
-                                      "Deprecated argument '$(O)' ( alias for '$(N)' ) is no longer supported.",
-                                      "O=-%s,N=--%s"
-                                      , name
-                                      , node->name
-                                         ));
-                            break;
-                        }
-
-                        if ( alias -> error )
-                        {
-                            rc = RC ( rcApp, rcArgv, rcParsing, rcParam, rcUnsupported );
-                            PLOGERR (klogErr,
-                                     (klogErr, rc,
-                                      "Deprecated argument '$(O)' is no longer supported. "
-                                      "Please use '$(N)' instead.",
-                                      "O=-%s,N=--%s"
-                                      , name
-                                      , node->name
-                                         ));
-                            break;
-                        }
-
-                        if ( node -> error )
-                        {
-                            PLOGMSG (klogWarn,
-                                     (klogWarn,
-                                      "Deprecated argument '$(O)' ( alias for '$(N)' ) may not be supported in future releases.",
-                                      "O=-%s,N=--%s"
-                                      , name
-                                      , node->name
-                                         ));
-                        }
-
-                        else if ( alias -> deprecated )
-                        {
-                            PLOGMSG (klogWarn,
-                                     (klogWarn,
-                                      "Deprecated argument '$(O)' may not be supported in future releases. "
-                                      "Please use '$(N)' instead.",
-                                      "O=-%s,N=--%s"
-                                      , name
-                                      , node->name
-                                         ));
-                        }
-
-                        if ( break_loop )
-                            break;
-                    }
-                }
-            }
-        }
-        if ( rc )
-            break;
-    }
-
-#if _DEBUGGING
-    (void)ArgsHandleDebug (self);
-#endif
-#if USE_EARLY_HELP
-    if (rc == 0)
-    {
-        rc = ArgsHandleHelp (self);
-        /* if "help" wasn't found we aren't using standard arguments so don't
-         * call it an error: if OptionGout changes this might have to as well */
-        if (rc == SILENT_RC (rcRuntime, rcArgv, rcAccessing, rcName, rcNotFound))
-            rc = 0;
-    }
-#endif
-#if USE_EARLY_VERSION
-    if (rc == 0)
-    {
-        rc = ArgsHandleVersion (self);
-        if (rc == SILENT_RC (rcRuntime, rcArgv, rcAccessing, rcName, rcNotFound))
-            rc = 0;
-    }
-#endif
-    /* now recovery non-fatal errors into final rc */
-    if (rc == 0)
-        rc = orc;
-
-    if ( rc )
-    {
-        ReportSilence();
-    }
-    return rc;
-}
-
-rc_t CC ArgsParse (Args * self, int argc, char *argv[])
-{
-    KLogLevel lvl = KLogLevelGet ();
-    rc_t rc = KLogLevelSet ( klogWarn );
-    rc = ArgsParseInt ( self, argc, argv );
-    KLogLevelSet ( lvl );
-    return rc;
-}
-
-rc_t CC ArgsOptionCount (const Args * self, const char * option_name, uint32_t * count)
-{
-    rc_t rc;
-
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-    else if (count == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcNull);
-    else
-    {
-        const Option * node;
-
-        node = (const Option*)BSTreeFind (&self->names, option_name, OptionCmp);
-        if (node == NULL)
-        {
-            rc = RC (rcRuntime, rcArgv, rcAccessing, rcName, rcNotFound);
-/* this was removed to shut up about "help" not being found during tests
-            PLOGERR (klogWarn, (klogWarn, rc, "Option name not found '$(S)'", "S=%s", option_name));
- */
-            return rc;
-        }
-
-        *count = OptionGetCount (node);
-        return 0;
-    }
-}
-
-rc_t CC ArgsOptionValue (const Args * self, const char * option_name, uint32_t iteration,
-                                     const char ** value_string)
-{
-    const Option * node;
-
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-
-    if ((option_name == NULL) || (value_string == NULL))
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcNull);
-
-    *value_string = NULL;
-
-    node = (const Option*)BSTreeFind (&self->names, option_name, OptionCmp);
-    if (node == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcName, rcNotFound);
-    else
-        return  OptionGetValue (node, iteration, value_string);
-}
-
-rc_t CC ArgsParamCount (const Args * self, uint32_t * count)
-{
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-    else if (count == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcNull);
-
-    *count = VectorLength (&self->params);
-    return 0;
-}
-
-rc_t CC ArgsParamValue (const Args * self, uint32_t iteration, const char ** value_string)
-{
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-
-    if (value_string == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcNull);
-
-    if (iteration >= VectorLength (&self->params))
-    {
-        *value_string = NULL;
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcExcessive);
-    }
-
-    *value_string = (const char*) VectorGet (&self->params, iteration);
-    return 0;
-}
-
-rc_t CC ArgsArgvCount (const Args * self, uint32_t * count)
-{
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-    else if (count == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcArgv, rcNull);
-
-    *count = VectorLength (&self->argv);
-    return 0;
-}
-#ifdef ArgsArgc
-#undef ArgsArgc
-#endif
-
-rc_t CC ArgsArgc (const Args * self, uint32_t * count)
-{
-    return ArgsArgvCount (self, count);
-}
-
-rc_t CC ArgsArgvValue (const Args * self, uint32_t iteration, const char ** value_string)
-{
-    if (self == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcSelf, rcNull);
-
-    if (value_string == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcArgv, rcNull);
-
-    if (iteration >= VectorLength (&self->argv))
-    {
-        *value_string = NULL;
-        return RC (rcRuntime, rcArgv, rcAccessing, rcArgv, rcExcessive);
-    }
-
-    *value_string = (const char*) VectorGet (&self->argv, iteration);
-    return 0;
-}
-
-#define USAGE_MAX_SIZE 81
-static
-const char * verbose_usage[] = 
-{ "Increase the verbosity of the program status messages.",
-  "Use multiple times for more verbosity.","Negates quiet.", NULL };
-static
-const char * quiet_usage[] = 
-{ "Turn off all status messages for the program.",
-  "Negated by verbose.", NULL };
-static
-const char * debug_usage[] = 
-{ "Turn on debug output for module.",
-  "All flags if not specified.", NULL };
-static
-const char * help_usage[] = 
-{ "Output a brief explanation for the program.", NULL };
-static
-const char * report_usage[] = 
-{ "Control program execution environment report generation (if implemented).",
-    "One of (never|error|always). Default is error", NULL };
-static
-const char * version_usage[] = 
-{ "Display the version of the program then quit.", NULL };
-static
-const char * optfile_usage[] = 
-{ "Read more options and parameters from the file.", NULL};
-static 
-char log0 [USAGE_MAX_SIZE];
-static 
-char log1 [USAGE_MAX_SIZE];
-static
-const char * log_usage[] = 
-{ "Logging level as number or enum string.", log0, log1, NULL };
-static
-const char * no_user_settings_usage[] = 
-{ "Turn off user-specific configuration.", NULL };
-
-static
-void CC gen_log_usage (const char ** _buffers)
-{
-    static const char div[] = "|";
-
-    /* these have to be mutable for this to work */
-    char ** buffers = (char **) _buffers;
-
-    char * pc;
-    char * p0;
-    char * p1;
-    size_t rem;
-    size_t used;
-    KLogLevel level;
-
-    rc_t rc;
-    char buffv[USAGE_MAX_SIZE];
-
-
-    p0 = pc = buffers[1];
-    p1 = pc = buffers[2];
-
-    *p0 = *p1 = '\0';
-
-    rem = USAGE_MAX_SIZE; /* makes an assumption */
-    pc = buffv;
-    for (level = klogLevelMin; level <= klogLevelMax; ++level)
-    {
-        rc = KLogLevelExplain (level, pc, rem, &used);
-        if (rc || used == 0)
-        {
-            p0 = NULL;
-            pc = NULL;
-            break;
-        }
-        pc += used;
-        rem -= used;
-        strcpy (pc, div);
-        pc += sizeof div - 1;
-        rem -= sizeof div - 1;
-    }
-    if (p0)
-    {
-        pc -= sizeof div - 1;
-        rem += sizeof div - 1;
-        *pc = '\0';
-        
-        rc = string_printf (p0, USAGE_MAX_SIZE, & used,
-                            "One of (%s) or (%u-%u)",
-                            buffv, klogLevelMin, klogLevelMax);
-        if (used == 0)
-            p0 = NULL;
-    }
-    rc = KLogLevelExplain (KLogLevelGet(), buffv, sizeof buffv, &used);
-    if (rc || used == 0)
-        p1 = NULL;
-    else
-    {
-        buffv[used] = '\0';
-        rc = string_printf (p1, USAGE_MAX_SIZE, & used,
-                         "Current/default is %s",
-                         buffv);
-        if (used == 0)
-            p1 = NULL;
-    }
-    if (p0 == NULL)
-    {
-        p0 = p1;
-        p1 = NULL;
-    }
-}
-
-
-
-OptDef StandardOptions[]  =
-{
-    {
-        OPTION_HELP,    ALIAS_HELP,    NULL, 
-        help_usage,
-        OPT_UNLIM, false, false
-    },
-    {
-        OPTION_VERSION, ALIAS_VERSION, NULL,
-        version_usage,
-        OPT_UNLIM, false, false
-    },
-    {
-        OPTION_LOG_LEVEL, ALIAS_LOG_LEVEL, gen_log_usage,
-        log_usage,
-        OPT_UNLIM, true, false
-    },
-    {
-        OPTION_VERBOSE, ALIAS_VERBOSE, NULL,
-        verbose_usage,
-        OPT_UNLIM, false, false
-    },
-    {
-        OPTION_QUIET, ALIAS_QUIET, NULL,
-        quiet_usage,
-        OPT_UNLIM, false, false
-    },
-#if USE_OPTFILE
-    {
-        OPTION_OPTFILE, ALIAS_OPTFILE, NULL,
-        optfile_usage,
-        OPT_UNLIM, true, false
-    },
-#endif
-    {
-        OPTION_DEBUG, ALIAS_DEBUG, NULL,
-        debug_usage, 
-        OPT_UNLIM, true, false
-    },
-    {
-        OPTION_NO_USER_SETTINGS, NULL, NULL,
-        no_user_settings_usage,
-        OPT_UNLIM, false, false
-    },
-    {   /* OPTION_REPORT is used in klib/report.c */
-        OPTION_REPORT, NULL, NULL,
-        report_usage, 
-        OPT_UNLIM, true, false
-    }
-};
-
-rc_t CC ArgsAddStandardOptions(Args * self)
-{
-    return ArgsAddOptionArray (self, StandardOptions,
-                               sizeof (StandardOptions) / sizeof (OptDef)
-                               /*, NULL, NULL */ );
-}
-
-rc_t CC ArgsMakeStandardOptions (Args** pself)
-{
-    Args * self;
-    rc_t rc;
-
-    rc = ArgsMake (&self);
-    if (rc == 0)
-    {
-        rc = ArgsAddStandardOptions (self);
-        if (rc)
-            ArgsWhack (self);
-    }
-    *pself = (rc == 0) ? self : NULL;
-    return rc;
-}
-
-rc_t CC ArgsHandleHelp (Args * self)
-{
-    uint32_t count;
-    rc_t rc;
-
-    rc = ArgsOptionCount (self, OPTION_HELP, &count);
-    if (rc == 0)
-    {
-        if (count)
-        {
-            /* this is a call into the main program code */
-            Usage(self);
-            ArgsWhack (self);
-            exit (0);
-        }
-    }
-    return rc;
-}
-
-
-rc_t CC ArgsHandleVersion (Args * self)
-{
-    uint32_t count;
-    rc_t rc;
-
-    rc = ArgsOptionCount (self, OPTION_VERSION, &count);
-    if (rc == 0)
-    {
-        if (count)
-        {
-            const char * progname = UsageDefaultName;
-            const char * fullpath = UsageDefaultName;
-
-            if (self)
-                rc = ArgsProgram (self, &fullpath, &progname);
-
-            HelpVersion (fullpath, KAppVersion());
-
-            ArgsWhack (self);
-            exit (0);
-        }
-    }
-    return rc;
-}
-
-
-rc_t CC ArgsHandleLogLevel (const Args * self)
-{
-    uint32_t count;
-    rc_t rc;
-
-    rc = ArgsOptionCount (self, OPTION_LOG_LEVEL, &count);
-    if (rc == 0)
-    {
-        if (count == 0)
-        {
-        }
-        else
-        {
-            const char * value;
-            uint32_t ix;
-
-            for (ix = 0; ix < count; ++ix)
-            {
-                rc = ArgsOptionValue (self, OPTION_LOG_LEVEL,
-                                      ix, &value);
-                if (rc == 0)
-                    rc = LogLevelSet (value);
-                if (rc)
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t CC ArgsHandleStatusLevel (const Args * self)
-{
-    uint32_t vcount, qcount;
-    rc_t rc;
-
-    rc = ArgsOptionCount (self, OPTION_VERBOSE, &vcount);
-    if (rc == 0)
-    {
-        rc = ArgsOptionCount (self, OPTION_QUIET, &qcount);
-        if (rc == 0)
-        {
-            KStsLevel current;
-
-            current = KStsLevelGet();
-
-            if (vcount)
-            {
-                rc_t irc;
-
-                irc = SILENT_RC (rcRuntime, rcArgv, rcParsing, rcParam, rcIncorrect);
-                if (qcount)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, irc,
-                              "$(V)($(v)) and $(Q)($(q)) should not be used together",
-                              "V=%s,v=%s,Q=$s,q=%s",
-                              OPTION_VERBOSE,ALIAS_VERBOSE,
-                              OPTION_QUIET,ALIAS_QUIET));
-                }
-                KStsLevelSet (current + vcount);
-            }
-            else if (qcount)
-                KStsLevelSet (0);
-        }
-    }
-    return rc;
-}
-
-rc_t CC ArgsHandleNoUserSettings (const Args * self)
-{
-    uint32_t count = 0;
-    rc_t rc = ArgsOptionCount (self, OPTION_NO_USER_SETTINGS, &count);
-    if (rc == 0 && count != 0)
-        KConfigDisableUserSettings ();
-    return rc;
-}
-
-
-#if USE_OPTFILE
-rc_t CC ArgsHandleOptfile (Args * self)
-{
-    return Args_parse_inf_file (self, OPTION_OPTFILE);
-}
-#endif
-
-
-#if _DEBUGGING
-rc_t CC ArgsHandleDebug (const Args * self)
-{
-    uint32_t count;
-    rc_t rc;
-
-    rc = ArgsOptionCount (self, OPTION_DEBUG, &count);
-    if (rc == 0)
-    {
-        if (count == 0)
-        {
-        }
-        else
-        {
-            const char * value;
-            uint32_t ix;
-
-            for (ix = 0; ix < count; ++ix)
-            {
-                rc = ArgsOptionValue (self, OPTION_DEBUG,
-                                      ix, &value);
-                if (rc == 0)
-                    rc = KDbgSetString (value);
-                if (rc)
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-rc_t CC ArgsHandleStandardOptions (Args * self)
-{
-    rc_t rc;
-
-    do
-    {
-        rc = ArgsHandleHelp (self);
-        if (rc)
-            break;
-        rc = ArgsHandleVersion (self);
-        if (rc)
-            break;
-        rc = ArgsHandleLogLevel (self);
-        if (rc)
-            break;
-
-        rc = ArgsHandleStatusLevel (self);
-        if (rc)
-            break;
-
-        rc = ArgsHandleNoUserSettings (self);
-        if (rc)
-            break;
-
-#if _DEBUGGING 
-	/* called a second time in case more symbols in in files */
-        rc = ArgsHandleDebug (self);
-#endif
-    } while (0); /* not a real loop */
-    return rc;
-}
-
-rc_t CC ArgsMakeAndHandle (Args ** pself, int argc, char ** argv, uint32_t table_count, ...)
-{
-    rc_t rc;
-    Args * self;
-
-    *pself = NULL;
-    rc = ArgsMakeStandardOptions (&self);
-    if (rc == 0)
-    {
-        for (;;)
-        {
-            /* load added OptDef tables */
-            if (table_count)
-            {
-                va_list ap;
-
-                va_start (ap, table_count);
-
-                while (table_count--)
-                {
-                    OptDef * options;
-                    uint32_t opt_count;
-
-                    options = va_arg (ap, OptDef *);
-                    opt_count = va_arg (ap, uint32_t);
-
-                    rc = ArgsAddOptionArray (self, options, opt_count /* , NULL, NULL */);
-                    if (rc)
-                        break;
-                }
-
-                va_end (ap);
-
-                if (rc)
-                    break;
-            }
-
-            rc = ArgsParse (self, argc, argv);
-            if (rc)
-                break;
-
-#if USE_OPTFILE
-            /*
-             * recursively check for files full of options
-             * we want this done before flagging missing arguments
-             */
-            rc = ArgsHandleOptfile (self);
-            if (rc)
-                break;
-#endif
-            /*
-             * now handle (maybe even rehandle except the optfile
-             * the standard arguments all applications/tools support
-             */
-            rc = ArgsHandleStandardOptions (self);
-            if (rc)
-                break;
-
-            rc = ArgsCheckRequired (self);
-            if (rc)
-            {
-                MiniUsage(self);
-                break;
-            }
-
-            *pself = self;
-            return 0;
-
-            break;
-        }
-    
-        ArgsWhack (self);
-    }
-    return rc;
-}
-
-
-
-
-/* NOTE:
- * This needs to move into a unix/win32 seperated file
- * and quite probably outside of args.
- */
-
-const char * CC trim_path (const char * full_name)
-{
-    const char * name;
-
-    name = strrchr (full_name, '/');
-    if (name == NULL)
-        name = full_name;
-    else
-        ++name; /* skip past '/' */
-    return name;
-}
-
-
-rc_t CC ArgsProgram (const Args * args, const char ** fullpath, const char ** progname)
-{
-    const char * defaultname = UsageDefaultName;
-    const char * f;
-    rc_t rc;
-
-    rc = ArgsArgvValue (args, 0, &f);
-    if (rc == 0)
-    {
-        if (fullpath)
-            *fullpath = f;
-        if (progname)
-            *progname = trim_path (f);
-    }
-    else
-    {
-        f = defaultname;
-        
-        if (fullpath != NULL)
-        {
-            if (*fullpath == NULL)
-                *fullpath = f;
-            else
-                f = *fullpath;
-        }
-        if (progname)
-        {
-            if (*progname == NULL)
-                *progname = trim_path (f);
-        }
-    }
-    return rc;
-}
-
-void CC HelpVersion (const char * fullpath, ver_t version)
-{
-    OUTMSG (("\n%s : %.3V\n\n", fullpath, version));
-}
-
-
-static void print_indented( const size_t first_indent, const size_t indent,
-                            const size_t max_line_len, const char ** msgs )
-{
-    const char * msg;
-    size_t line_len;
-
-    if ( *msgs == NULL )
-    {
-        OUTMSG(( "\n" ));
-        return;
-    }
-
-    if ( first_indent < indent )
-    {
-        OUTMSG(( "%*s", indent - first_indent, " " ));
-        line_len = indent;
-    }
-    else
-    {
-        OUTMSG(( "  " ));
-        line_len = first_indent + 2;
-    }
-    while ( ( msg = *msgs++ ) != NULL )
-    {
-        while ( msg != NULL )
-        {
-            const char * space = strchr( msg, ' ' );
-            if ( space != NULL )
-            {
-                /* space found, can we print the word on the current line? */
-                int wordlen = ( space - msg );
-                if ( ( line_len + wordlen + 1 ) < max_line_len )
-                {
-                    if ( wordlen > 1 )
-                        OUTMSG(( "%.*s", wordlen + 1, msg )); /* yes */
-                }
-                else
-                {
-                    OUTMSG(( "\n%*s%.*s", indent, " ", wordlen + 1, msg )); /* no: new line */
-                    line_len = indent;
-                }
-                line_len += ( wordlen + 1 );
-                msg += ( wordlen + 1 );
-            }
-            else
-            {
-                /* no space found, can we print the string on the current line? */
-                size_t remainder = string_size( msg );
-                if ( line_len + remainder < max_line_len )
-                {
-                    OUTMSG(( "%s ", msg )); /* yes */
-                }
-                else
-                {
-                    OUTMSG(( "\n%*s%s ", indent, " ", msg )); /* no: new line */
-                    line_len = indent;
-                }
-                line_len += remainder;
-                msg = NULL; /* we are done with one source-line... */
-            }
-        }
-    }
-    OUTMSG(( "\n" ));
-}
-
-void CC HelpOptionLine(const char * alias, const char * option, const char * param, const char ** msgs)
-{
-/*    const char * msg; */
-#define INDENT 2
-#define MSG_INDENT 35
-#define MSG_MAXLEN 80
-
-    bool has_alias = (alias != NULL && alias[0] != '\0');
-    bool has_opt = (option != NULL && option[0] != '\0');
-
-    if( has_alias || has_opt )
-    {
-        int n, msgc;
-
-        OUTMSG(("%*s%n", INDENT, " ", & msgc ));
-
-        if( has_alias )
-        {
-            OUTMSG(("-%s%n", alias, &n));
-            msgc += n;
-        }
-
-        if( has_alias && has_opt )
-        {
-            OUTMSG(("|"));
-            msgc++;
-        }
-
-        if( has_opt )
-        {
-            OUTMSG(("--%s%n", option, &n));
-            msgc += n;
-        }
-
-        if( param != NULL)
-        {
-            OUTMSG((" <%s>%n", param, &n));
-            msgc += n;
-        }
-
-        print_indented( msgc, MSG_INDENT, MSG_MAXLEN, msgs );
-    }
-}
-
-void CC HelpParamLine (const char * param, const char * const * msgs)
-{
-    int msgc;
-    const char * msg;
-
-    msg = *msgs++;
-
-    if (param)
-    {
-        OUTMSG (("%*s%s%n", INDENT, " ", param, &msgc));
-	if (msg == NULL)
-	    OUTMSG (("\n"));
-	else
-	{
-	    OUTMSG (("%*s%s\n", MSG_INDENT-msgc, " ", msg));
-	}
-    }
-    if (msg != NULL)
-	while ((msg = *msgs++) != NULL)
-	    OUTMSG (("%*s%s\n", MSG_INDENT, " ", msg));
-}
-
-void CC HelpOptionsStandard (void)
-{
-    HelpOptionLine (ALIAS_HELP1, OPTION_HELP, NULL, help_usage);
-
-    HelpOptionLine (ALIAS_VERSION, OPTION_VERSION, NULL, version_usage);
-
-    gen_log_usage (log_usage);
-    HelpOptionLine (ALIAS_LOG_LEVEL, OPTION_LOG_LEVEL, "level", log_usage);
-
-    HelpOptionLine (ALIAS_VERBOSE, OPTION_VERBOSE, NULL, verbose_usage);
-    HelpOptionLine (ALIAS_QUIET, OPTION_QUIET, NULL, quiet_usage);
-#if USE_OPTFILE
-    HelpOptionLine (ALIAS_OPTFILE, OPTION_OPTFILE, "file", optfile_usage);
-#endif
-#if _DEBUGGING
-    HelpOptionLine (ALIAS_DEBUG, OPTION_DEBUG, "Module[-Flag]", debug_usage); 
-#endif
-}
-
-
-void CC HelpOptionsReport (void)
-{
-    HelpOptionLine (ALIAS_REPORT, OPTION_REPORT, "type", report_usage);
-}
-
-
-rc_t CC MiniUsage (const Args * args)
-{
-    KWrtWriter w;
-    void * d;
-    const char * progname;
-    rc_t rc;
-
-    w = KOutWriterGet();
-    d = KOutDataGet();
-
-    rc = ArgsProgram (args, NULL, &progname);
-    if (rc)
-        progname = UsageDefaultName;
-    KOutHandlerSetStdErr();
-    UsageSummary (progname);
-    KOutMsg ("\nUse option --help for more information.\n\n");
-
-    KOutHandlerSet (w,d);
-
-    return rc;
-}
diff --git a/libs/kapp/args_debug.h b/libs/kapp/args_debug.h
deleted file mode 100644
index 3221434..0000000
--- a/libs/kapp/args_debug.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_args_priv_libs_
-#define _h_args_priv_libs_
-
-#include <klib/debug.h>
-
-#if _DEBUGGING
-
-#define ARGS_DBGF(msg) DBGMSG(DBG_ARGS, DBG_FLAG(DBG_ARGS_WRITER), msg)
-#define ARGS_DBG(fmt, ...) ARGS_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define ARGS_DBGERR(rc) if(rc != 0) {ARGS_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc));}
-#define ARGS_DBGERRP(fmt, rc, ...) if(rc != 0) {ARGS_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__));}
-
-#else
-
-#define ARGS_DBGF(msg) ((void)0)
-#define ARGS_DBG(fmt, ...) ((void)0)
-#define ARGS_DBGERR(rc) ((void)0)
-#define ARGS_DBGERRP(fmt, rc, ...) ((void)0)
-
-#endif
-
-#endif
\ No newline at end of file
diff --git a/libs/kapp/libkapp.vers b/libs/kapp/libkapp.vers
deleted file mode 100644
index 9084fa2..0000000
--- a/libs/kapp/libkapp.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.0
diff --git a/libs/kapp/libload.vers b/libs/kapp/libload.vers
deleted file mode 100644
index 66c4c22..0000000
--- a/libs/kapp/libload.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.9
diff --git a/libs/kapp/loader-file.c b/libs/kapp/loader-file.c
deleted file mode 100644
index 26fc1b6..0000000
--- a/libs/kapp/loader-file.c
+++ /dev/null
@@ -1,643 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <kapp/extern.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-#include <kapp/progressbar.h>
-#include <kapp/queue-file.h>
-
-#include <kapp/loader-file.h>
-#define KFILE_IMPL KLoaderFile
-#include <kfs/impl.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-#include <os-native.h> /* for strdup on Windows */
-
-#define DBG(msg) DBGMSG(DBG_LOADLIB,DBG_FLAG(DBG_LOADLIB_FILE), msg)
-
-#if _DEBUGGING
-#   ifndef KLoaderFile_BUFFERSIZE
-#       define KLoaderFile_BUFFERSIZE (256 * 1024)
-#   endif
-#else
-#   undef KLoaderFile_BUFFERSIZE
-#   define KLoaderFile_BUFFERSIZE (256 * 1024)
-#endif
-
-struct KLoaderFile
-{
-    KFile dad;
-    /* physical file */
-    uint64_t kfile_pos;
-    const KFile* kfile;
-    const KLoadProgressbar* job;
-
-    const KFile* file;
-    const KDirectory* dir;
-    char* filename;
-    char* realname;
-    bool has_md5;
-    bool ahead;
-    uint8_t md5_digest[16];
-
-    /* current file */
-    enum {
-        compress_none = 0,
-        compress_gzip,
-        compress_bzip2
-    } compress_type;
-    uint64_t pos;
-    bool eof;
-    uint32_t eol; /* next line start in buffer (next symbol after previously detected eol) */
-    uint64_t line_no;
-
-    /* file buffer */
-    uint8_t *buffer_pos;
-    uint32_t avail;
-    uint8_t *buffer;
-    size_t buffer_size;
-#if _DEBUGGING
-    uint32_t small_reads; /* used to detect ineffective reads from file */
-#endif
-};
-
-static
-rc_t CC KLoaderFile_Destroy(KLoaderFile* self)
-{
-    if( self != NULL ) {
-        DBG(("%s %s\n", __func__, self->realname));
-        KFileRelease(self->kfile);
-        self->kfile = NULL;
-    }
-    return 0;
-}
-
-static
-struct KSysFile* CC KLoaderFile_GetSysFile(const KLoaderFile *self, uint64_t *offset)
-{
-    return KFileGetSysFile(self ? self->kfile : NULL, offset);
-}
-
-static
-rc_t CC KLoaderFile_RandomAccess(const KLoaderFile *self)
-{
-    return KFileRandomAccess(self ? self->kfile : NULL);
-}
-
-static
-uint32_t CC KLoaderFile_Type(const KLoaderFile *self)
-{
-    if( self && self->kfile ) {
-        return KFileType(self->kfile);
-    }
-    return KDirectoryPathType(self ? self->dir : NULL, self->realname);
-}
-
-static
-rc_t CC KLoaderFile_Size(const KLoaderFile *self, uint64_t *size)
-{
-    if( self && self->kfile ) {
-        return KFileSize(self->kfile, size);
-    }
-    return KDirectoryFileSize(self ? self->dir : NULL, size, self->realname);
-}
-
-static
-rc_t CC KLoaderFile_SetSize(KLoaderFile *self, uint64_t size)
-{
-    return RC(rcApp, rcFile, rcUpdating, rcInterface, rcUnsupported);
-}
-
-static
-rc_t CC KLoaderFile_ReadKFile(const KLoaderFile* cself, uint64_t pos, void *buffer, size_t size, size_t *num_read)
-{
-    rc_t rc = KFileRead(cself ? cself->kfile : NULL, pos, buffer, size, num_read);
-    DBG(("%s: %s: %lu\n", __func__, cself->realname, *num_read));
-    if( rc == 0 && cself->job != NULL ) {
-        if( pos > cself->kfile_pos ) {
-            rc = KLoadProgressbar_Process(cself->job, pos - cself->kfile_pos, false);
-            ((KLoaderFile*)cself)->kfile_pos = pos;
-        }
-        pos += *num_read;
-        if( pos > cself->kfile_pos ) {
-            rc = KLoadProgressbar_Process(cself->job, pos - cself->kfile_pos, false);
-            ((KLoaderFile*)cself)->kfile_pos= pos;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC KLoaderFile_WriteKFile(KLoaderFile *self, uint64_t pos, const void *buffer, size_t size, size_t *num_writ)
-{
-    return RC(rcApp, rcFile, rcWriting, rcInterface, rcUnsupported);
-}
-
-static KFile_vt_v1 KLoaderFile_vtbl = {
-    1, 1,
-    KLoaderFile_Destroy,
-    KLoaderFile_GetSysFile,
-    KLoaderFile_RandomAccess,
-    KLoaderFile_Size,
-    KLoaderFile_SetSize,
-    KLoaderFile_ReadKFile,
-    KLoaderFile_WriteKFile,
-    KLoaderFile_Type
-};
-
-static
-rc_t KLoaderFile_Open(KLoaderFile* self)
-{
-    rc_t rc = 0;
-
-    DBG(("%s opening %s\n", __func__, self->realname));
-    if( (rc = KDirectoryOpenFileRead(self->dir, &self->kfile, self->realname)) == 0 ) {
-        if( self->has_md5 ) {
-            const KFile *md5File = NULL;
-            DBG(("%s opening as md5 wrapped %s\n", __func__, self->realname));
-            if( (rc = KFileMakeMD5Read(&md5File, self->file, self->md5_digest)) == 0) {
-                self->file = md5File;
-            }
-        }
-        if( rc == 0 ) {
-            const KFile *z = NULL;
-            switch(self->compress_type) {
-                case compress_none:
-                    break;
-                case compress_gzip:
-                    DBG(("%s opening as gzip wrapped %s\n", __func__, self->realname));
-                    if( (rc = KFileMakeGzipForRead(&z, self->file)) == 0 ) {
-                        KFileRelease(self->file);
-                        self->file = z;
-                    }
-                    break;
-                case compress_bzip2:
-                    DBG(("%s opening as bzip2 wrapped %s\n", __func__, self->realname));
-                    if( (rc = KFileMakeBzip2ForRead(&z, self->file)) == 0 ) {
-                        KFileRelease(self->file);
-                        self->file = z;
-                    }
-                    break;
-                default:
-                    rc = RC(rcApp, rcFile, rcOpening, rcType, rcUnexpected);
-                    break;
-            }
-#if ! WINDOWS
-            if( rc == 0 && self->ahead ) {
-                const KFile *z = NULL;
-                if( (rc = KQueueFileMakeRead(&z, self->pos, self->file,
-                                             self->buffer_size * 10,  self->buffer_size, 0)) == 0 ) {
-                    KFileRelease(self->file);
-                    self->file = z;
-                }
-            }
-#endif
-        }
-    }
-    if( rc != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "opening $(file)", PLOG_S(file), self->filename));
-        KFileRelease(self->file);
-    }
-    return rc;
-}
-
-/* Fill
- *  fill buffer as far as possible, shift unread data in buffer to buffer start
- */
-static
-rc_t KLoaderFile_Fill(KLoaderFile *self)
-{
-    rc_t rc = 0;
-
-    if (self->kfile == NULL) {
-        rc = KLoaderFile_Open(self);
-    }
-    if( rc == 0 ) {
-        /* determine space in buffer available */
-        size_t to_read = self->buffer_size - self->avail;
-        if( to_read > 0 ) {
-#if _DEBUGGING
-            if( to_read < self->buffer_size * 0.5 ) {
-                self->small_reads++;
-                if( self->small_reads > 10 ) {
-                    PLOGMSG(klogWarn, (klogWarn, "$(filename) INEFFECTIVE READING: $(times) times, now $(bytes) bytes",
-                        PLOG_3(PLOG_S(filename),PLOG_U32(times),PLOG_U32(bytes)), self->filename, self->small_reads, to_read));
-                }
-            }
-#endif
-            /* shift left unread data */
-            memmove(self->buffer, self->buffer_pos, self->avail);
-            /* skip read chunk in buffer */
-            self->pos += self->buffer_pos - self->buffer;
-            /* reset pointer */
-            self->buffer_pos = self->buffer;
-            do { /* fill buffer up to eof */
-                size_t num_read = 0;
-                if( (rc = KFileRead(self->file, self->pos + self->avail,
-                                    &self->buffer[self->avail], to_read, &num_read)) == 0 ) {
-                    self->eof = (num_read == 0);
-                    self->avail += num_read;
-                    to_read -= num_read;
-                    DBG(("KLoaderFile read %s from %lu %u bytes%s\n",
-                         self->filename, self->pos + self->avail - num_read, num_read, self->eof ? " EOF" : ""));
-                }
-            } while( rc == 0 && to_read > 0 && !self->eof );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_IsEof(const KLoaderFile* cself, bool* eof)
-{
-    if( cself == NULL || eof == NULL ) {
-        return RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    /* end of file is when file is at eof and nothing in buffer or last readline returned the buffer */
-    *eof = cself->eof && ((cself->avail - cself->eol) == 0);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Close(const KLoaderFile* cself)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        /* TBD possible delays if file has md5 set */
-        DBG(("%s closing %s\n", __func__, cself->realname));
-        rc = KFileRelease(cself->file);
-        KFileAddRef(&cself->dad);
-        ((KLoaderFile*)cself)->file = &cself->dad;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Reset(const KLoaderFile* cself)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        KLoaderFile* self = (KLoaderFile*)cself;
-        if( cself->pos != 0 && (cself->ahead || cself->compress_type != compress_none) ) {
-            /* threaded buffering || data in buffer is not first portion of the file */
-            rc = KLoaderFile_Close(cself);
-            self->avail = 0;
-            self->buffer[0] = 0;
-            self->eof = false;
-        } else {
-            self->avail += self->buffer_pos - self->buffer;
-        }
-        self->pos = 0;
-        self->eol = 0;
-        self->line_no = 0;
-        self->buffer_pos = self->buffer;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_SetReadAhead(const KLoaderFile* cself, bool read_ahead)
-{
-    if( cself == NULL ) {
-        return RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    }
-#if ! WINDOWS
-    ((KLoaderFile*)cself)->ahead = read_ahead;
-#endif
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_LOG(const KLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    rc = KLoaderFile_VLOG(cself, lvl, rc, msg, fmt, args);
-    va_end(args);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_VLOG(const KLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, va_list args)
-{
-    if( cself == NULL || (msg == NULL && rc == 0) ) {
-        rc = RC(rcApp, rcFile, rcAccessing, rcParam, rcInvalid);
-        LOGERR(klogErr, rc, __func__);
-    }  else if( msg == NULL && rc != 0 ) {
-        if( cself->line_no == 0 ) {
-            PLOGERR(lvl, (lvl, rc, "$(file):$(offset)", "file=%s,offset=%lu", cself->filename, cself->pos));
-        } else {
-            PLOGERR(lvl, (lvl, rc, "$(file):$(line)", "file=%s,line=%lu", cself->filename, cself->line_no));
-        }
-    } else {
-        rc_t fmt_rc;
-        char xfmt[4096];
-        const char* f = fmt ? fmt : "";
-        const char* c = fmt ? "," : "";
-
-        if( cself->line_no == 0 ) {
-            fmt_rc = string_printf(xfmt, sizeof xfmt, NULL, "file=%s,offset=%lu%s%s", cself->filename, cself->pos, c, f);
-        } else {
-            fmt_rc = string_printf(xfmt, sizeof xfmt, NULL, "file=%s,line=%lu%s%s", cself->filename, cself->line_no, c, f);
-        }
-        if ( fmt_rc == 0 ) {
-            fmt = xfmt;
-        }
-        if( rc == 0 ) {
-            VLOGMSG(lvl, (lvl, msg, fmt, args));
-        } else {
-            VLOGERR(lvl, (lvl, rc, msg, fmt, args));
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Offset(const KLoaderFile* cself, uint64_t* offset)
-{
-    if( cself == NULL || offset == NULL ) {
-        return RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    *offset = cself->pos + (cself->buffer_pos - cself->buffer);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Line(const KLoaderFile* cself, uint64_t* line)
-{
-    if( cself == NULL || line == NULL ) {
-        return RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    *line = cself->line_no;
-    return 0;
-}
-
-static
-rc_t KLoaderFile_AllocateBuffer(KLoaderFile *self)
-{
-    self->buffer_size = KLoaderFile_BUFFERSIZE;
-    if( (self->buffer = malloc(self->buffer_size)) == NULL ) {
-        self->buffer_size = 0;
-        return RC(rcApp, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    self->buffer[0] = 0;
-    self->buffer_pos = self->buffer;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Readline(const KLoaderFile* cself, const void** buffer, size_t* length)
-{
-    rc_t rc = 0;
-
-    if(cself == NULL || buffer == NULL || length == NULL) {
-        rc = RC( rcApp, rcFile, rcAccessing, rcParam, rcNull);
-    } else {
-        KLoaderFile *self = (KLoaderFile*)cself;
-        uint8_t* nl;
-        bool refilled = false;
-        bool eof;
-        
-        rc = KLoaderFile_IsEof(cself, &eof);
-        if( rc == 0 && eof ) {
-            *buffer = NULL;
-            return 0;
-        }
-        
-        while( rc == 0 ) {
-            bool CR_last = false;
-            int i, cnt = self->avail - self->eol;
-            uint8_t* buf = &self->buffer_pos[self->eol];
-            *buffer = buf;
-            /* find first eol from current position */
-            for(nl = NULL, i = 0; i < cnt && nl == NULL; i++) {
-                if(buf[i] == '\n' || buf[i] == '\r') {
-                    nl = &buf[i];
-                }
-            }
-            if( nl != NULL || refilled ) {
-                break;
-            }
-            refilled = true;
-            /* none found we need to push out processed portion and load full buffer */
-            if( self->eol > 0 ) {
-                /* mark that line ended on buffer end and last char in buffer is \r */
-                CR_last = self->eol == self->avail && self->buffer_pos[self->eol - 1] == '\r';
-                self->buffer_pos += self->eol;
-                self->avail -= self->eol;
-                self->eol = 0;
-            }
-            if( (rc = KLoaderFile_Fill(self)) == 0 ) {
-                if( CR_last && self->buffer_pos[0] == '\n' ) {
-                    /* in previous chunk last char was \r and in next chunk 1st char is \n
-                    this is \r\n seq split by buffer, need to ignore \n */
-                    self->eol++;
-                }
-            }
-        }
-        if( rc == 0 ) {
-            if( nl == NULL ) {
-                self->eol = self->avail;
-                *length = self->avail;
-                if( self->buffer_size == self->avail ) {
-                    /* buffer could be copied and next call will provide tail of line */
-                    rc = RC( rcApp, rcFile, rcReading, rcString, rcTooLong);
-                } 
-            } else {
-                *length = nl - (uint8_t*)*buffer;
-                self->eol = nl - self->buffer_pos + 1;
-                if( *nl == '\r' && nl < &self->buffer[self->buffer_size - 1] && *(nl + 1) == '\n' ) {
-                    /* \r\n */
-                    self->eol++;
-                }
-                self->line_no++;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Read(const KLoaderFile* cself, size_t advance, size_t size, const void** buffer, size_t* length)
-{
-    rc_t rc = 0;
-
-    if (cself == NULL || buffer == NULL || length == NULL ) {
-        return RC(rcApp, rcFile, rcPositioning, rcSelf, rcNull);
-    } else {
-        KLoaderFile* self = (KLoaderFile*)cself;
-        if( advance > 0 ) {
-            if(advance >= self->avail) {
-                self->pos += advance;
-                self->avail = 0;
-                self->eol = 0;
-            } else {
-                self->buffer_pos += advance;
-                self->avail -= advance;
-                self->eol = self->eol > advance ? self->eol - advance : 0;
-            }
-        }
-        if( size > self->avail || self->avail == 0 ) {
-            rc = KLoaderFile_Fill(self);
-        }
-        if( rc == 0 ) {
-            *buffer = self->buffer_pos;
-            *length = self->avail;
-            if( self->avail == 0 && self->eof ) {
-                *buffer = NULL;
-            } else if( size > self->avail ) {
-                if( !self->eof ) {
-                    rc = RC( rcApp, rcFile, rcReading, rcBuffer, rcInsufficient);
-                }
-            } else if( size > 0 ) {
-                *length = size;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Name(const KLoaderFile *self, const char **name)
-{
-    if( self == NULL || name == NULL ) {
-        return RC(rcApp, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *name = self->filename;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_FullName(const KLoaderFile *self, const char **name)
-{
-    if( self == NULL || name == NULL ) {
-        return RC(rcApp, rcFile, rcAccessing, rcParam, rcNull);
-    } else {
-        *name = self->realname;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_ResolveName(const KLoaderFile *self, char *resolved, size_t rsize)
-{
-    if( self == NULL || resolved == NULL ) {
-        return RC(rcApp, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    return KDirectoryResolvePath(self->dir, true, resolved, rsize, self->realname);
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Release(const KLoaderFile* cself, bool exclude_from_progress)
-{
-    rc_t rc = 0;
-
-    if( cself != NULL ) {
-        KLoaderFile* self = (KLoaderFile*)cself;
-        DBG(("%s: '%s'%s\n", __func__, cself->filename, exclude_from_progress ? " excluded" : ""));
-        /* may return md5 check error here */
-        if( (rc = KFileRelease(self->file)) == 0 && !exclude_from_progress ) {
-            PLOGMSG(klogInt, (klogInfo, "done file $(file) $(bytes) bytes",
-                    "severity=file,file=%s,bytes=%lu",
-                    self->filename, self->pos + (self->buffer_pos - self->buffer)));
-        }
-        KLoadProgressbar_Release(self->job, exclude_from_progress);
-        KDirectoryRelease(self->dir);
-        free(self->filename);
-        free(self->realname);
-        free(self->buffer);
-        free(self);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoaderFile_Make(const KLoaderFile **file, const KDirectory* dir, const char* filename,
-                                    const uint8_t* md5_digest, bool read_ahead)
-{
-    rc_t rc = 0;
-    KLoaderFile* obj = NULL;
-
-    if( file == NULL || dir == NULL || filename == NULL ) {
-        rc = RC(rcApp, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        *file = NULL;
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ||
-            (obj->filename = strdup(filename)) == NULL ) {
-            rc = RC(rcApp, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            if( (rc = KDirectoryAddRef(dir)) == 0 ) {
-                obj->dir = dir;
-                if( md5_digest != NULL ) {
-                    obj->has_md5 = true;
-                    memcpy(obj->md5_digest, md5_digest, sizeof(obj->md5_digest));
-                }
-                if( (rc = KLoaderFile_AllocateBuffer(obj)) == 0 ) {
-                    char resolved[4096];
-                    char* ext = NULL;
-
-                    strcpy(resolved, filename);
-                    ext = strrchr(resolved, '.');
-                    DBG(("%s adding %s\n", __func__, resolved));
-                    rc = KLoadProgressbar_File(&obj->job, resolved, obj->dir);
-                    if( ext != NULL && strcmp(ext, ".gz") == 0 ) {
-                        obj->compress_type = compress_gzip;
-                    } else if( ext != NULL && strcmp(ext, ".bz2") == 0 ) {
-                        obj->compress_type = compress_bzip2;
-                    }
-                    if( rc != 0 && obj->compress_type != compress_none ) {
-                        *ext = '\0';
-                        DBG(("%s retry adding as %s\n", __func__, resolved));
-                        if( (rc = KLoadProgressbar_File(&obj->job, resolved, obj->dir)) == 0 ) {
-                            obj->has_md5 = false;
-                            obj->compress_type = compress_none;
-                        }
-                    }
-                    if( rc == 0 &&
-                        (rc = KFileInit(&obj->dad, (const KFile_vt*)&KLoaderFile_vtbl, "KLoaderFile", filename, true, false)) == 0 ) {
-                        obj->file = &obj->dad;
-#if WINDOWS
-                        obj->ahead = false;
-#else
-                        obj->ahead = read_ahead;
-#endif
-                        obj->realname = strdup(resolved);
-                        if( obj->realname == NULL ) {
-                            rc = RC(rcApp, rcFile, rcConstructing, rcMemory, rcExhausted);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *file = obj;
-    } else {
-        *file = NULL;
-        KLoaderFile_Release(obj, false);
-    }
-    return rc;
-}
diff --git a/libs/kapp/loader-meta.c b/libs/kapp/loader-meta.c
deleted file mode 100644
index 131ddb3..0000000
--- a/libs/kapp/loader-meta.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kapp/extern.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <kapp/loader-meta.h>
-#include <kapp/main.h>
-
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-
-static
-rc_t MakeVersion(ver_t vers, char* b, size_t bsize)
-{
-    assert(b != NULL && bsize != 0);
-    return string_printf(b, bsize, NULL, "%V", vers);
-}
-
-LIB_EXPORT rc_t CC KLoaderMeta_Write(KMDataNode* root,
-                                     const char* argv0, const char* argv0_date,
-                                     const char* app_name, ver_t app_version)
-{
-    rc_t rc = 0;
-    KMDataNode *node = NULL;
-
-    if( root == NULL || argv0 == NULL || argv0_date == NULL ) {
-        rc = RC(rcApp, rcMetadata, rcWriting, rcParam, rcNull);
-    } else if( (rc = KMDataNodeOpenNodeUpdate(root, &node, "SOFTWARE")) == 0 ) {
-        char str_vers[64];
-        KMDataNode *subNode = NULL;
-        if( (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "loader")) == 0 ) {
-            if( (rc = MakeVersion(KAppVersion(), str_vers, sizeof(str_vers))) == 0 ) {
-                rc = KMDataNodeWriteAttr(subNode, "vers", str_vers);
-            }
-            if(rc == 0) {
-                rc = KMDataNodeWriteAttr(subNode, "date", argv0_date);
-            }
-            if(rc == 0) {
-                const char* tool_name = strrchr(argv0, '/');
-                const char* r = strrchr(argv0, '\\');
-                if( tool_name != NULL && r != NULL && tool_name < r ) {
-                    tool_name = r;
-                }
-                if( tool_name++ == NULL) {
-                    tool_name = argv0;
-                }
-                rc = KMDataNodeWriteAttr(subNode, "name", tool_name);
-            }
-            KMDataNodeRelease(subNode);
-        }
-        if(rc == 0 && (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "formatter")) == 0 ) {
-            if( (rc = MakeVersion(app_version, str_vers, sizeof(str_vers))) == 0 ) {
-                rc = KMDataNodeWriteAttr(subNode, "vers", str_vers);
-            }
-            if(rc == 0) {
-                rc = KMDataNodeWriteAttr(subNode, "name", app_name ? app_name : "internal");
-            }
-            KMDataNodeRelease(subNode);
-        }
-        KMDataNodeRelease(node);
-    }
-    if( rc == 0 && (rc = KMDataNodeOpenNodeUpdate(root, &node, "LOAD")) == 0 ) {
-        KMDataNode *subNode = NULL;
-        if( (rc = KMDataNodeOpenNodeUpdate(node, &subNode, "timestamp")) == 0 ) {
-            time_t t = time(NULL);
-            rc = KMDataNodeWrite(subNode, &t, sizeof(t));
-            KMDataNodeRelease(subNode);
-        }
-        KMDataNodeRelease(node);
-    }
-    return rc;
-}
diff --git a/libs/kapp/log-xml.c b/libs/kapp/log-xml.c
deleted file mode 100644
index 891dbfc..0000000
--- a/libs/kapp/log-xml.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kapp/extern.h>
-#include <kapp/main.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <kxml/xml.h>
-#include <kfs/file.h>
-#include <kfs/kfs-priv.h>
-#include <kfs/directory.h>
-#include <klib/rc.h>
-#include <kapp/log-xml.h>
-
-#include <os-native.h>
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <assert.h>
-
-#define DBG(msg) DBGMSG(DBG_LOADLIB,DBG_FLAG(DBG_LOADLIB_XLOG), msg)
-
-enum OptDefIndex {
-    eopt_file = 0,
-    eopt_fd
-};
-
-const char* XMLLogger_file_usage[] = {"produce XML-formatted log file", NULL};
-const char* XMLLogger_fd_usage[] = {NULL, "produce XML-formatted output to given file descriptor", NULL};
-
-const OptDef XMLLogger_Args[] =
-{
-    {"xml-log", "z", NULL, XMLLogger_file_usage, 1, true, false},
-    {"xml-log-fd", NULL, NULL, XMLLogger_fd_usage, 1, true, false}
-};
-const size_t XMLLogger_ArgsQty = sizeof(XMLLogger_Args) / sizeof(XMLLogger_Args[0]);
-
-typedef struct XMLFormatterFile
-{
-    KFile* file;
-    uint64_t pos;
-} XMLFormatterFile;
-
-typedef struct XMLFormatterData
-{
-    XMLFormatterFile* file;
-    KFmtHandler fmt;
-    KWrtHandler wrt;
-} XMLFormatterData;
-
-struct XMLLogger {
-    XMLFormatterFile file;
-    XMLFormatterData log;
-    XMLFormatterData loglib;
-    XMLFormatterData sts;
-    XMLFormatterData stslib;
-};
-
-LIB_EXPORT
-rc_t CC XMLLogger_Encode(const char* src, char *dst, size_t dst_sz, size_t *num_writ)
-{
-    rc_t rc = 0;
-
-    if( src == NULL || dst == NULL || num_writ == NULL ) {
-        rc = RC(rcApp, rcArgv, rcParsing, rcParam, rcNull);
-    } else {
-        *num_writ = 0;
-        do {
-            size_t bytes;
-            const char* p;
-            switch(*src) {
-                case '\'':
-                    bytes = 6;
-                    p = "'";
-                    break;
-                case '"':
-                    bytes = 6;
-                    p = """;
-                    break;
-                case '&':
-                    bytes = 5;
-                    p = "&";
-                    break;
-                case '<':
-                    bytes = 4;
-                    p = "<";
-                    break;
-                case '>':
-                    bytes = 4;
-                    p = ">";
-                    break;
-                default:
-                    bytes = 1;
-                    p = src;
-                    break;
-            }
-            if( (*num_writ + bytes) > dst_sz ) {
-                rc = RC(rcApp, rcLog, rcEncoding, rcBuffer, rcInsufficient);
-                break;
-            } else {
-                memcpy(dst, p, bytes);
-                *num_writ = *num_writ + bytes;
-                dst += bytes;
-            }
-        } while(*src++ != '\0');
-        *num_writ = *num_writ - 1;
-    }
-    return rc;
-}
-
-static
-rc_t CC LoaderXMLFormatter( void* data, KWrtHandler* writer,
-                            size_t argc, const wrt_nvp_t args[],
-                            size_t envc, const wrt_nvp_t envs[])
-
-{
-    rc_t rc = 0;
-    size_t i, remaining, num_writ = 0;
-    XMLFormatterData* self = (XMLFormatterData*)data;
-    char buffer[4096];
-    const char* severity, *msg_val = NULL;
-    bool severity_std = false;
-    char* pbuffer;
-    const char* const tag_nvp_name = "severity";
-    const wrt_nvp_t* msg_nvp = NULL;
-    static const char* tags[] = {
-        "fatal",
-        "system",
-        "internal",
-        "error",
-        "warning",
-        "info"
-    };
-
-    msg_nvp = wrt_nvp_find(envc, envs, "message");
-    if( msg_nvp != NULL ) {
-        msg_val = msg_nvp->value;
-    }
-    severity = wrt_nvp_find_value(argc, args, tag_nvp_name);
-    if( severity == NULL ) {
-        severity = wrt_nvp_find_value(envc, envs, tag_nvp_name);
-        if( severity != NULL ) {
-            severity_std = true;
-            /* translate std severity name to full name */
-            for(i = 0; i < sizeof(tags)/sizeof(tags[0]); i++) {
-                if( strncmp(severity, tags[i], strlen(severity)) == 0 ) {
-                    severity = tags[i];
-                    break;
-                }
-            }
-        }
-    }
-    if( severity == NULL ) {
-        severity = "status";
-    }
-
-#define FIX_UP() if(rc != 0){break;} remaining -= num_writ; pbuffer += num_writ
-    
-    pbuffer = buffer;
-    remaining = sizeof(buffer);
-    do {
-        size_t k, pq = envc;
-        const wrt_nvp_t* p = envs;
-        const char* subst = NULL;
-
-        rc = LogInsertSpace("<", pbuffer, remaining, &num_writ);
-        FIX_UP();
-        rc = LogInsertSpace(severity, pbuffer, remaining, &num_writ);
-        FIX_UP();
-        /* print env first and than args! */
-        for(k = 0; rc == 0 && k < 2; k++) {
-            for(i = 0; i < pq; i++ ) {
-                if( strcmp(p[i].name, tag_nvp_name) == 0 ) {
-                    continue;
-                }
-                if( p == args ) {
-                    if( i == 0 && msg_nvp != NULL ) {
-                        /* grab args attr buffer start */
-                        subst = pbuffer;
-                    }
-                    if( severity_std ) {
-                        /* allow only specific attributes from message into xml log
-                           for LOG calls with standard severity */
-                        int x, yes = 0;
-                        static const char* allowed_attr[] = {
-                            "file", "line", "offset",
-                            "spot", "spot_name", "spotname"
-                        };
-                        for(x = 0; x < sizeof(allowed_attr)/sizeof(allowed_attr[0]); x++) {
-                            if( strcasecmp(p[i].name, allowed_attr[x]) == 0 ) {
-                                yes = 1;
-                                break;
-                            }
-                        }
-                        if( !yes ) {
-                            continue;
-                        }
-                    }
-                }
-                rc = LogInsertSpace(" ", pbuffer, remaining, &num_writ);
-                FIX_UP();
-                rc = XMLLogger_Encode(p[i].name, pbuffer, remaining, &num_writ);
-                FIX_UP();
-                rc = LogInsertSpace("=\"", pbuffer, remaining, &num_writ);
-                FIX_UP();
-                rc = XMLLogger_Encode(p[i].value, pbuffer, remaining, &num_writ);
-                FIX_UP();
-                rc = LogInsertSpace("\"", pbuffer, remaining, &num_writ);
-                FIX_UP();
-            }
-            p = args;
-            pq = argc;
-        }
-        if( subst != NULL && subst[0] != '\0' ) {
-            /* hack 'message' to print curr argv to std log as text attr="value" */
-            ((wrt_nvp_t*)msg_nvp)->value = subst + 1; /* \0 terminated pre LogInsertSpace behavior */
-            if( (rc = self->fmt.formatter(self->fmt.data, &self->wrt, 0, NULL, envc, envs)) != 0 ) {
-                break;
-            }
-            ((wrt_nvp_t*)msg_nvp)->value = msg_val;
-        }
-        rc = LogInsertSpace("/>\n", pbuffer, remaining, &num_writ);
-        FIX_UP();
-    } while(false);
-
-    if( self->file->file != NULL ) {
-        if( rc != 0 ) {
-            pbuffer = buffer;
-            remaining = sizeof(buffer);
-            rc = string_printf(pbuffer, remaining, & num_writ, "<error severity=\"err\" message=\"XML log failed: %R\"/>\n", rc);
-            pbuffer += num_writ <= remaining ? num_writ : 0;
-        }
-        rc = KFileWrite(self->file->file, self->file->pos, buffer, pbuffer - buffer, &num_writ);
-        self->file->pos += num_writ;
-    }
-    rc = self->fmt.formatter(self->fmt.data, &self->wrt, argc, args, envc, envs);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC XMLLogger_Make(const XMLLogger** cself, KDirectory* dir, const Args *args)
-{
-    rc_t rc = 0;
-    const char* path = NULL, *sfd = NULL;
-    int fd = -1;
-    uint32_t count;
-
-    if( (rc = ArgsOptionCount(args, XMLLogger_Args[eopt_file].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcApp, rcArgv, rcParsing, rcParam, rcExcessive);
-    } else if( count > 0 && (rc = ArgsOptionValue(args, XMLLogger_Args[eopt_file].name, 0, &path)) != 0 ) {
-
-    } else if( (rc = ArgsOptionCount(args, XMLLogger_Args[eopt_fd].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcApp, rcArgv, rcParsing, rcParam, rcExcessive);
-    } else if( count > 0 && (rc = ArgsOptionValue(args, XMLLogger_Args[eopt_fd].name, 0, &sfd)) != 0 ) {
-
-    } else {
-        do {
-            long val = 0;
-            char* end = NULL;
-
-            if( sfd != NULL ) {
-                if( path != NULL ) {
-                    rc = RC(rcApp, rcArgv, rcParsing, rcParam, rcExcessive);
-                    break;
-                }
-                errno = 0;
-                val = strtol(sfd, &end, 10);
-                if( errno != 0 || sfd == end || *end != '\0' || val < 0 || val > INT_MAX ) {
-                    rc = RC(rcApp, rcArgv, rcReading, rcParam, rcInvalid);
-                    break;
-                }
-                fd = val;
-            }
-            rc = XMLLogger_Make2(cself, dir, path, fd);
-        } while( false );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC XMLLogger_Make2(const XMLLogger** self, KDirectory* dir, const char* logpath, const int fd)
-{
-    rc_t rc = 0;
-    XMLLogger* obj;
-    KDirectory* my_dir = NULL;
-
-    const uint32_t lopt = klogFmtTimestamp | klogFmtSeverity |
-                          klogFmtMessage | klogFmtAppName | klogFmtAppVersion | klogFmtReasonShort;
-
-    const uint32_t sopt = kstsFmtTimestamp | kstsFmtMessage | kstsFmtAppName | kstsFmtAppVersion;
-
-    KLogFmtFlagsSet(lopt);
-    KLogLibFmtFlagsSet(lopt);
-    KStsFmtFlagsSet(sopt);
-    KStsLibFmtFlagsSet(sopt);
-
-    obj = calloc(1, sizeof(*obj));
-    if( obj == NULL ) {
-        rc = RC(rcApp, rcLog, rcAllocating, rcMemory, rcExhausted);
-    } else if( fd < 0 && dir == NULL && (rc = KDirectoryNativeDir(&my_dir)) != 0 ) {
-    } else if( fd >= 0 && (rc = KFileMakeFDFileWrite(&obj->file.file, false, fd)) != 0 ) {
-    } else if( logpath != NULL && fd < 0 && (rc = KDirectoryCreateFile(dir ? dir : my_dir, &obj->file.file, false, 0644, kcmInit, logpath)) != 0 ) {
-    } else {
-    
-        obj->file.pos = 0;
-        obj->log.file = &obj->file;
-        obj->log.fmt.formatter = KLogFmtWriterGet();
-        obj->log.fmt.data = KLogFmtDataGet();
-        obj->log.wrt.writer = KLogWriterGet();
-        obj->log.wrt.data = KLogDataGet();
-
-        obj->loglib.file = &obj->file;
-        obj->loglib.fmt.formatter = KLogLibFmtWriterGet();
-        obj->loglib.fmt.data = KLogLibFmtDataGet();
-        obj->loglib.wrt.writer = KLogLibWriterGet();
-        obj->loglib.wrt.data = KLogLibDataGet();
-
-        obj->sts.file = &obj->file;
-        obj->sts.fmt.formatter = KStsFmtWriterGet();
-        obj->sts.fmt.data = KStsFmtDataGet();
-        obj->sts.wrt.writer = KStsWriterGet();
-        obj->sts.wrt.data = KStsDataGet();
-
-        obj->stslib.file = &obj->file;
-        obj->stslib.fmt.formatter = KStsLibFmtWriterGet();
-        obj->stslib.fmt.data = KStsLibFmtDataGet();
-        obj->stslib.wrt.writer = KStsLibWriterGet();
-        obj->stslib.wrt.data = KStsLibDataGet();
-
-        if( (rc = KLogFmtHandlerSet(LoaderXMLFormatter, lopt, &obj->log)) == 0 &&
-            (rc = KLogLibFmtHandlerSet(LoaderXMLFormatter, lopt, &obj->loglib)) == 0 &&
-            (rc = KStsFmtHandlerSet(LoaderXMLFormatter, sopt, &obj->sts)) == 0 &&
-            (rc = KStsLibFmtHandlerSet(LoaderXMLFormatter, sopt, &obj->stslib)) == 0 ) {
-            /* make log valid XML */
-            if( obj->file.file != NULL ) {
-                size_t num_writ = 0;
-                rc = KFileWrite(obj->file.file, obj->file.pos, "<Log>\n", 6, &num_writ);
-                obj->file.pos += num_writ;
-            }
-        }
-    }
-    KDirectoryRelease(my_dir);
-    if( rc == 0 ) {
-        *self = obj;
-        if( fd >= 0 ) {
-            DBG(("XML Log file set to handle %d\n", fd));
-        } else if( logpath != NULL) {
-            DBG(("XML Log file set to %s\n", logpath));
-        } 
-    } else {
-        XMLLogger_Release(obj);
-        *self = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT void CC XMLLogger_Usage(void)
-{
-    int i;
-    for(i = 0; i < XMLLogger_ArgsQty; i++ ) {
-        if( XMLLogger_Args[i].help[0] != NULL ) {
-            HelpOptionLine(XMLLogger_Args[i].aliases, XMLLogger_Args[i].name, NULL, XMLLogger_Args[i].help);
-        }
-    }
-}
-
-LIB_EXPORT void CC XMLLogger_Release(const XMLLogger* cself)
-{
-    if( cself != NULL ) {
-        XMLLogger* self = (XMLLogger*)cself;
-        KLogFmtHandlerSet(self->log.fmt.formatter, 0, self->log.fmt.data);
-        KLogLibFmtHandlerSet(self->loglib.fmt.formatter, 0, self->loglib.fmt.data);
-        KLogHandlerSet(self->log.wrt.writer, self->log.wrt.data);
-        KLogLibHandlerSet(self->loglib.wrt.writer, self->loglib.wrt.data);
-        KStsFmtHandlerSet(self->sts.fmt.formatter, 0, self->sts.fmt.data);
-        KStsLibFmtHandlerSet(self->stslib.fmt.formatter, 0, self->stslib.fmt.data);
-        KStsHandlerSet(self->sts.wrt.writer, self->sts.wrt.data);
-        KStsLibHandlerSet(self->stslib.wrt.writer, self->stslib.wrt.data);
-        /* make log valid XML */
-        if( self->file.file != NULL ) {
-            if( self->file.pos > 0 ) {
-                KFileWrite(self->file.file, self->file.pos, "</Log>\n", 7, NULL);
-            }
-            KFileRelease(self->file.file);
-        }
-        free(self);
-    }
-}
diff --git a/libs/kapp/main-priv.h b/libs/kapp/main-priv.h
deleted file mode 100644
index f6aa7c3..0000000
--- a/libs/kapp/main-priv.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_main_priv_
-#define _h_main_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_kapp_extern_
- #include <kapp/extern.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    
-/*--------------------------------------------------------------------------
- * KMane
- *  invoked by platform specific "main" entrypoint
- */
-
-/* KMane
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t KMane ( int argc, char *argv [] );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_main_priv_ */
diff --git a/libs/kapp/main.c b/libs/kapp/main.c
deleted file mode 100644
index 125a64d..0000000
--- a/libs/kapp/main.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kapp/extern.h>
-#include "main-priv.h"
-#include <sysalloc.h>
-#include <kapp/main.h>
-#include <kfg/config.h>
-#include <kproc/procmgr.h>
-#include <klib/report.h>
-#include <klib/writer.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-
-#include <strtol.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-#if 0
-/* NextArg
- *  extracts the next argument from a switch parameter
- *
- *  "arg" is an indirect pointer to somewhere within an
- *  argument string, representing the last character parsed,
- *  e.g. "-auv"
- *         ^    : "arg" indicates the 'a'.
- *  in the example given, NextArg will advance the pointer
- *  to point to the 'u'.
- *
- *  had "arg" pointed instead to the 'v' above, i.e. there
- *  are no characters remaining in "arg" to be parsed, then
- *  an attempt to return the next element of "argv" will be
- *  made by invoking NextArgh.
- *
- *  "arg" [ IN, OUT ] - current argument string as indicated above
- *
- *  "i" [ IN, OUT ] - loop counter. required to be < argc,
- *  advanced if necessary to access next argument in argv.
- *
- *  "argc" [ IN ] - number of arguments in argv
- *
- *  "argv" [ IN ] - program arguments
- *
- *  "handle_null" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ] -
- *  optional callback function to handle NULL arguments. default
- *  behavior is to log error using "logerr" and invoke "exit".
- */
-const char * CC NextArg ( const char **argp, int *i, int argc, char *argv [],
-    const char * ( CC * handle_null ) ( void *data ), void *data )
-{
-    if ( argp != NULL )
-    {
-        const char *arg = * argp;
-        if ( arg != NULL && arg [ 0 ] != 0 && arg [ 1 ] != 0 )
-        {
-            * argp = "-";
-            return arg + 1;
-        }
-        return NextArgh ( i, argc, argv, handle_null, data );
-    }
-
-    /* report a fatal error if no arg given */
-    if ( handle_null == NULL )
-    {
-        rc_t rc = RC ( rcApp, rcArgv, rcAccessing, rcParam, rcNull );
-        LOGERR ( klogFatal, ( klogFatal, rc, "internal error" ));
-        exit ( 5 );
-    }
-
-    return ( * handle_null ) ( data );
-}
-#endif
-
-/* AsciiToXXX
- *  replacement for atoi
- *  converts NUL terminated string in "arg" to integer
- *  invokes error handler if there is a format error in string
- *
- *  "arg" [ IN ] - NUL terminated textual representation of integer
- *  obeys standard conversion rules:
- *    starts with "0x" or "0X" - interpret as hex
- *    starts with '0' - interpret as octal
- *    otherwise - interpret as decimal
- *
- *  "handler_error" [ IN, NULL OKAY ] and "data" [ IN, OPAQUE ] -
- *  optional callback function to handle case where "arg" could not
- *  be processed in its entirety. default behavior is to log error
- *  using "logerr" and invoke "exit".
- */
-static
-void CC HandleAsciiToIntError ( const char *arg, void *ignore )
-{
-    rc_t rc;
-
-    if ( arg == NULL )
-        rc = RC ( rcApp, rcNumeral, rcConverting, rcString, rcNull );
-    else if ( arg [ 0 ] == 0 )
-        rc = RC ( rcApp, rcNumeral, rcConverting, rcString, rcEmpty );
-    else
-        rc = RC ( rcApp, rcNumeral, rcConverting, rcString, rcInvalid );
-
-    LOGERR ( klogFatal, rc, "expected numeral" );
-    exit ( 10 );
-}
-
-int32_t CC AsciiToI32 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data )
-{
-    if ( handle_error == NULL )
-        handle_error = HandleAsciiToIntError;
-
-    if ( arg != NULL && arg [ 0 ] != 0 )
-    {
-        char *end;
-        long int i = strtol ( arg, & end, 0 );
-        if ( end [ 0 ] == 0 )
-        {
-            if ( sizeof i == sizeof ( int32_t ) )
-                return ( int32_t ) i;
-
-            if ( ( ( i < 0 ) && ( ( ( uint64_t ) - i ) >> 32 ) == 0 ) ||
-                 ( ( i > 0 ) && ( ( ( uint64_t ) i ) >> 32 ) == 0 ) )
-                return ( int32_t ) i;
-        }
-    }
-
-    ( * handle_error ) ( arg, data );
-    return 0;
-}
-
-uint32_t CC AsciiToU32 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data )
-{
-    if ( handle_error == NULL )
-        handle_error = HandleAsciiToIntError;
-
-    if ( arg != NULL && arg [ 0 ] != 0 )
-    {
-        char *end;
-        unsigned long int i = strtoul ( arg, & end, 0 );
-        if ( end [ 0 ] == 0 )
-        {
-            if ( sizeof i == sizeof ( uint32_t ) )
-                return ( uint32_t ) i;
-
-            if ( ( ( ( uint64_t ) i ) >> 32 ) == 0 )
-                return ( uint32_t ) i;
-        }
-    }
-
-    ( * handle_error ) ( arg, data );
-    return 0;
-}
-
-int64_t CC AsciiToI64 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data )
-{
-    if ( handle_error == NULL )
-        handle_error = HandleAsciiToIntError;
-
-    if ( arg != NULL && arg [ 0 ] != 0 )
-    {
-        char *end;
-        int64_t i = strtoi64 ( arg, & end, 0 );
-
-        if ( end [ 0 ] == 0 )
-            return i;
-    }
-
-    ( * handle_error ) ( arg, data );
-    return 0;
-}
-
-uint64_t CC AsciiToU64 ( const char *arg,
-    void ( CC * handle_error ) ( const char *arg, void *data ), void *data )
-{
-    if ( handle_error == NULL )
-        handle_error = HandleAsciiToIntError;
-
-    if ( arg != NULL && arg [ 0 ] != 0 )
-    {
-        char *end;
-        uint64_t i = strtou64 ( arg, & end, 0 );
-
-        if ( end [ 0 ] == 0 )
-            return i;
-    }
-
-    ( * handle_error ) ( arg, data );
-    return 0;
-}
-
-/* KLogLevelParamStrings
- *  Used to compare against command line parameters
- *  These must match KLogLEvel enum in log.h
- */
-static
-void CC logLevelFromString ( const char * str, void *data )
-{
-    KLogLevel ix;
-    const char ** paramStrings;
-
-    paramStrings = KLogGetParamStrings();
-
-    for ( ix = klogLevelMin; ix <= klogLevelMax; ++ix )
-    {
-        if ( strcmp ( str, paramStrings [ ( int ) ix ] ) == 0 )
-        {
-            * ( int32_t* ) data = ix;
-            return;
-        }
-    }
-
-    /* this RC should reflect an invalid string parameter to set the log level */
-    PLOGERR ( klogFatal, ( klogFatal, RC ( rcApp, rcArgv, rcParsing, rcRange, rcInvalid ),
-                           "log level '$(lvl)' is unrecognized", "lvl=%s", str ));
-    exit ( 10 );
-}
-
-static
-rc_t LogLevelAbsolute ( const char * string )
-{
-    int32_t 	new_level;
-    int32_t	absolute_level = -1;	/* if this remains -1 then we didn't have a good symbolic string */
-
-    /* parse as if integer value but fail over to symbolic strings */
-    new_level = AsciiToU32 ( string, logLevelFromString, & absolute_level );
-
-    return KLogLevelSet( ( KLogLevel ) ( ( absolute_level == -1 ) ? new_level : absolute_level ) );
-}
-
-static
-rc_t LogLevelRelative ( const char * string )
-{
-    int32_t adjust = 0;
-    int i;
-
-    for ( i = 0; string [ i ] != 0; ++ i )
-    {
-        switch ( string [ i ] )
-        {
-        case '+':
-            ++ adjust;
-            break;
-            
-        case '-':
-            -- adjust;
-            break;
-            
-        default:
-            return RC ( rcApp, rcArgv, rcParsing, rcToken, rcUnrecognized );
-        }
-    }
-    KLogLevelAdjust(adjust);
-    return 0;
-}
-
-rc_t CC NextLogLevelCommon ( const char * level_parameter )
-{
-    if ( level_parameter == NULL )
-        return RC ( rcApp, rcArgv, rcParsing, rcString, rcNull );
-
-    if ( ( level_parameter [ 0 ] == '+' ) || ( level_parameter [ 0 ] == '-' ) )
-        return LogLevelRelative ( level_parameter );
-
-    return LogLevelAbsolute ( level_parameter );
-}
-
-#if 0
-static
-void CC HandleLogLevelError ( rc_t rc )
-{
-    LOGERR ( klogFatal, rc, "expected log level" );
-    exit ( 10 );
-}
-
-/* NextLogLevel
- *  handle a numeric or textual argument to --log-level <level>  The --log-level is not
- *  specified here and could be any string of the programmers choice
- */ 
-void CC NextLogLevel ( const char ** argp,
-		    int *ip,
-		    int argc,
-		    char *argv [],
-		    const char* ( CC * handle_null ) ( void *data ), void *data )
-{
-    rc_t rc = NextLogLevelCommon ( NextArg ( argp, ip, argc, argv, handle_null, data ) );
-    if ( rc != 0 )
-    {
-        if ( handle_null != NULL )
-            ( * handle_null ) ( data );
-        else
-            HandleLogLevelError ( rc );
-    }
-}
-
-/* NextLogLevelh
- *  handle a numeric or textual argument to --log-level <level>  The --log-level is not
- *  specified here and could be any string of the programmers choice
- */ 
-void CC NextLogLevelh (int *ip,
-		    int argc,
-		    char *argv [],
-		    const char* ( CC * handle_null ) ( void *data ), void *data )
-{
-    rc_t rc = NextLogLevelCommon ( NextArgh ( ip, argc, argv, handle_null, data ) );
-    if ( rc != 0 )
-    {
-        if ( handle_null != NULL )
-            ( * handle_null ) ( data );
-        else
-            HandleLogLevelError ( rc );
-    }
-}
-#endif
-
-/* KMane
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-static
-void CC atexit_task ( void )
-{
-    KProcMgrWhack ();
-}
-
-rc_t KMane ( int argc, char *argv [] )
-{
-    rc_t rc;
-
-    /* get application version */
-    ver_t vers = KAppVersion ();
-
-    /* initialize cleanup tasks */
-    int status = atexit ( atexit_task );
-    if ( status != 0 )
-        return SILENT_RC ( rcApp, rcNoTarg, rcInitializing, rcFunction, rcNotAvailable );
-
-    /* initialize error reporting */
-    ReportInit ( argc, argv, vers );
-
-    /* initialize proc mgr */
-    rc = KProcMgrInit ();
-    if ( rc != 0 )
-        return rc;
-
-    /* initialize logging */
-    rc = KWrtInit(argv[0], vers);
-    if ( rc == 0 )
-        rc = KLogLibHandlerSetStdErr ();
-    if ( rc == 0 )
-        rc = KStsLibHandlerSetStdOut ();
-
-    if ( rc == 0 )
-    {
-#if KFG_COMMON_CREATION
-        KConfig *kfg;
-        rc = KConfigMake ( & kfg );
-        if ( rc == 0 )
-        {
-#endif
-            rc = KMain ( argc, argv );
-            if ( rc != 0 )
-            {
-
-#if _DEBUGGING
-                rc_t rc2;
-                uint32_t lineno;
-                const char *filename, *function;
-                while ( GetUnreadRCInfo ( & rc2, & filename, & function, & lineno ) )
-                {
-                    pLogErr ( klogWarn, rc2, "$(filename):$(lineno) within $(function)"
-                              , "filename=%s,lineno=%u,function=%s"
-                              , filename
-                              , lineno
-                              , function
-                        );
-                }
-#endif
-
-            }
-#if KFG_COMMON_CREATION
-            KConfigRelease ( kfg );
-        }
-#endif
-    }
-
-    /* finalize error reporting */
-    ReportSilence ();
-    ReportFinalize ( rc );
-
-    return rc;
-}
diff --git a/libs/kapp/progressbar.c b/libs/kapp/progressbar.c
deleted file mode 100644
index 37bdd81..0000000
--- a/libs/kapp/progressbar.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <kapp/extern.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/debug.h>
-#include <klib/container.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kapp/progressbar.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#define DBG(msg) DBGMSG(DBG_LOADLIB,DBG_FLAG(DBG_LOADLIB_PBAR), msg)
-
-struct KLoadProgressbar
-{
-    SLNode node;
-    bool active;
-    uint64_t used;
-    uint64_t total;
-};
-
-struct KJobs {
-    const char* severity;
-    SLList jobs;
-    uint64_t percent;
-} g_jobs =
-{
-    "status",
-    {NULL, NULL},
-    0
-};
-
-LIB_EXPORT rc_t CC KLoadProgressbar_Make(const KLoadProgressbar** cself, uint64_t size)
-{
-    rc_t rc = 0;
-    KLoadProgressbar* obj = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcApp, rcFunction, rcConstructing, rcSelf, rcNull);
-    } else if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-        *cself = NULL;
-        rc = RC(rcApp, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        DBG(("%s: %p %lu\n", __func__, obj, size));
-        SLListPushTail(&g_jobs.jobs, &obj->node);
-        *cself = obj;
-        obj->active = true;
-        obj->total = size;
-    }
-    return rc;
-}
-
-static
-bool CC job_active( SLNode *n, void *data )
-{
-    return ((KLoadProgressbar*)n)->active;
-}
-
-static
-void CC job_whack( SLNode *n, void *data )
-{
-    free(n);
-}
-
-struct job_data {
-    float percent;
-    uint64_t qty;
-};
-
-static
-void CC job_percent( SLNode *node, void *data )
-{
-    const KLoadProgressbar* n = (const KLoadProgressbar*)node;
-    struct job_data* d = (struct job_data*)data;
-    if (n->used && n->total)
-        d->percent += n->used * 100 / n->total;
-    d->qty++;
-}
-
-static
-void CC job_report(bool force_report, bool final)
-{
-    struct job_data d;
-
-    memset(&d, 0, sizeof(d));
-    SLListForEach(&g_jobs.jobs, job_percent, &d);
-    d.qty = d.qty ? d.percent / d.qty : (final ? 100 : 0);
-    if( force_report || d.qty != g_jobs.percent ) {
-        g_jobs.percent = d.qty;
-        PLOGMSG(klogInfo, (klogInfo, "processed $(percent)%",
-            "severity=%s,percent=%lu", g_jobs.severity, g_jobs.percent));
-    }
-}
-
-LIB_EXPORT void CC KLoadProgressbar_Release(const KLoadProgressbar* cself, bool exclude)
-{
-    if( cself ) {
-        KLoadProgressbar* self = (KLoadProgressbar*)cself;
-        if( exclude ) {
-            SLListUnlink(&g_jobs.jobs, &self->node);
-            free(self);
-        } else {
-            self->active = false;
-        }
-        if( !SLListDoUntil(&g_jobs.jobs, job_active, NULL) ) {
-            /* no more active jobs: make last report and drop whole list */
-            job_report(false, true);
-            SLListWhack(&g_jobs.jobs, job_whack, NULL);
-        }
-    }
-}
-
-LIB_EXPORT rc_t CC KLoadProgressbar_Append(const KLoadProgressbar* cself, uint64_t chunk)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcApp, rcFunction, rcWriting, rcSelf, rcNull);
-    } else {
-        uint64_t c = cself->total + chunk;
-        DBG(("%s: +%lu\n", __func__, chunk));
-        if( c >= cself->total ) {
-            ((KLoadProgressbar*)cself)->total += chunk;
-        } else {
-            rc = RC(rcApp, rcFunction, rcResizing, rcData, rcOutofrange);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoadProgressbar_File(const KLoadProgressbar** cself, const char* filename, const KDirectory* dir)
-{
-    rc_t rc = 0;
-    uint64_t sz;
-    KDirectory* tmp = (KDirectory*)dir;
-
-    if( cself == NULL || filename == NULL ) {
-        rc = RC(rcApp, rcFunction, rcWriting, rcParam, rcNull);
-    } else if( tmp == NULL && (rc = KDirectoryNativeDir(&tmp)) != 0 ) {
-    } else if( (rc = KDirectoryFileSize(tmp, &sz, filename)) == 0 ) {
-        rc = KLoadProgressbar_Make(cself, sz);
-    }
-    if( tmp != dir ) {
-        KDirectoryRelease(tmp);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoadProgressbar_KFile(const KLoadProgressbar** cself, const KFile* file)
-{
-    rc_t rc = 0;
-    uint64_t sz;
-
-    if( cself == NULL || file == NULL ) {
-        rc = RC(rcApp, rcFunction, rcWriting, rcParam, rcNull);
-    } else if( (rc = KFileSize(file, &sz)) == 0 ) {
-        rc = KLoadProgressbar_Make(cself, sz);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLoadProgressbar_Process(const KLoadProgressbar* cself, uint64_t chunk, bool force_report)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcApp, rcFunction, rcLogging, rcSelf, rcNull);
-    } else {
-        ((KLoadProgressbar*)cself)->used += chunk;
-        DBG(("%s: %p +%lu %lu of %lu\n", __func__, cself, chunk, cself->used, cself->total));
-        job_report(force_report, false);
-    }
-    return rc;
-}
diff --git a/libs/kapp/queue-file.c b/libs/kapp/queue-file.c
deleted file mode 100644
index e8dfd14..0000000
--- a/libs/kapp/queue-file.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-typedef struct KQueueFile KQueueFile;
-#define KFILE_IMPL KQueueFile
-
-#include <kapp/extern.h>
-#include <kapp/queue-file.h>
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <kproc/timeout.h>
-#include <kproc/thread.h>
-#include <kproc/queue.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <klib/out.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#if _DEBUGGING && 0
-#define DEFAULT_BLOCK_SIZE 4 * 1024
-#define QFMSG( msg, ... ) \
-    KOutMsg ( msg, __VA_ARGS__ )
-#else
-#define DEFAULT_BLOCK_SIZE 64 * 1024
-#define QFMSG( msg, ... ) \
-    ( void ) 0
-#endif
-
-#define DEFAULT_TIMEOUT_MS 150
-
-/*--------------------------------------------------------------------------
- * KQueueFileBuffer
- *  a block that describes its valid bytes and position
- */
-typedef struct KQueueFileBuffer KQueueFileBuffer;
-struct KQueueFileBuffer
-{
-    uint64_t pos;
-    size_t bytes;
-    rc_t rc;
-    uint32_t align;
-    uint8_t data [ 1 ];
-};
-
-static
-bool KQueueFileBufferContains ( const KQueueFileBuffer *self, uint64_t pos )
-{
-    if ( self != NULL )
-    {
-        if ( self -> pos <= pos && ( self -> pos + self -> bytes ) > pos )
-            return true;
-    }
-    return false;
-}
-
-
-/*--------------------------------------------------------------------------
- * KQueueFile
- *  an extension to KFile that runs on a background thread
- */
-struct KQueueFile
-{
-    KFile dad;
-
-    /* the source file's size on open */
-    uint64_t apparent_size;
-
-    /* starting position for read-ahead */
-    uint64_t start_pos;
-
-    /* the file really being accessed */
-    KFile *f;
-
-    /* buffer info */
-    KQueueFileBuffer *b;
-    size_t bsize;
-
-    /* thread and buffer queue */
-    KThread *t;
-    KQueue *q;
-
-    /* captured upon open */
-    rc_t rc_from_size_on_open;
-
-    /* timeout when queue is not responding */
-    uint32_t timeout_ms;
-};
-
-/* Whack
- */
-static
-rc_t KQueueFileWhackRead ( KQueueFile *self )
-{
-    void *b;
-
-    /* no more reading */
-    QFMSG ( "%s: sealing queue\n", __func__ );
-    KQueueSeal ( self -> q );
-
-    /* flush the queue */
-    QFMSG ( "%s: popping queue\n", __func__ );
-    while ( KQueuePop ( self -> q, & b, NULL ) == 0 )
-    {
-        QFMSG ( "%s: dousing a buffer\n", __func__ );
-        free ( b );
-    }
-
-    /* wait for thread to exit */
-    QFMSG ( "%s: waiting for bg thread to exit\n", __func__ );
-    KThreadWait ( self -> t, NULL );
-
-    /* tear it down */
-    QFMSG ( "%s: freeing object\n", __func__ );
-    free ( self -> b );
-    KThreadRelease ( self -> t );
-    KQueueRelease ( self -> q );
-    KFileRelease ( self -> f );
-    free ( self );
-
-    return 0;
-}
-
-static
-rc_t KQueueFileFlush ( KQueueFile *self, KQueueFileBuffer *b )
-{
-    rc_t rc;
-
-    /* timeout is in mS */
-    timeout_t tm;
-    QFMSG ( "%s: initializing timeout for %,umS\n", __func__, self->timeout_ms);
-    TimeoutInit ( & tm, self->timeout_ms );
-
-    /* push buffer */
-    QFMSG ( "%s: pushing buffer...\n", __func__ );
-    rc = KQueuePush ( self -> q, b, & tm );
-    QFMSG ( "%s: ...done: rc = %R\n", __func__, rc );
-    if ( rc != 0 )
-    {
-        /* see if the bg thread exited */
-        if ( GetRCState ( rc ) == rcReadonly )
-        {
-            rc = RC ( rcApp, rcFile, rcWriting, rcTransfer, rcIncomplete );
-            QFMSG ( "%s: resetting rc to %R\n", __func__, rc );
-        }
-        return rc;
-    }
-
-    QFMSG ( "%s: forgetting about buffer\n", __func__ );
-    self -> b = NULL;
-    return 0;
-}
-
-static
-rc_t KQueueFileWhackWrite ( KQueueFile *self )
-{
-    void *b;
-    rc_t rc = 0;
-
-    /* flush last buffer */
-    if ( self -> b != NULL )
-    {
-        QFMSG ( "%s: have non-null buffer\n", __func__ );
-        if ( self -> b -> bytes != 0 )
-        {
-            QFMSG ( "%s: buffer has %zu bytes\n", __func__, self -> b -> bytes );
-            rc = KQueueFileFlush ( self, self -> b );
-        }
-
-        free ( self -> b );
-        self -> b = NULL;
-    }
-
-    /* no more writing */
-    QFMSG ( "%s: sealing queue\n", __func__ );
-    KQueueSeal ( self -> q );
-
-    /* wait for thread to exit */
-    QFMSG ( "%s: waiting for bg thread to exit\n", __func__ );
-    KThreadWait ( self -> t, NULL );
-
-    /* the file should be written
-       but flush the queue if bg thread didn't */
-    QFMSG ( "%s: popping queue\n", __func__ );
-    while ( KQueuePop ( self -> q, & b, NULL ) == 0 )
-    {
-        QFMSG ( "%s: dousing a buffer\n", __func__ );
-        free ( b );
-    }
-
-    /* tear it down */
-    QFMSG ( "%s: freeing object\n", __func__ );
-    KThreadRelease ( self -> t );
-    KQueueRelease ( self -> q );
-    KFileRelease ( self -> f );
-    free ( self );
-
-    return rc;
-}
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-static
-struct KSysFile* CC KQueueFileGetSysFile ( const KQueueFile *self, uint64_t *offset )
-{
-    return NULL;
-}
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *
- *  certain file types will refuse random access
- *  these include FIFO and socket based files, but also
- *  wrappers that require serial access ( e.g. compression )
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KQueueFileRandomAccess ( const KQueueFile *self )
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-/* Type
- *  returns a KQueueFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KQueueFileType ( const KQueueFile *self )
-{
-    return kptFIFO;
-}
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KQueueFileSize ( const KQueueFile *self, uint64_t *size )
-{
-    * size = self -> apparent_size;
-    return self -> rc_from_size_on_open;
-}
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KQueueFileSetSize ( KQueueFile *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* RunRead
- *  runs read loop on background thread
- */
-static
-rc_t CC KQueueFileRunRead ( const KThread *t, void *data )
-{
-    KQueueFile *self = data;
-
-    rc_t rc;
-    bool loop;
-    uint64_t pos;
-    size_t num_read;
-
-    QFMSG ( "BG: %s: running read-ahead loop\n", __func__ );
-    for ( rc = 0, loop = true, pos = self -> start_pos; loop; pos += num_read )
-    {
-        timeout_t tm;
-
-        KQueueFileBuffer *b = malloc ( sizeof * b - sizeof b -> data + self -> bsize );
-        if ( b == NULL )
-        {
-            rc = RC ( rcApp, rcFile, rcReading, rcMemory, rcExhausted );
-            QFMSG ( "BG: %s: failed to allocate %zu byte buffer\n", __func__, self -> bsize );
-            b = malloc ( sizeof * b );
-            if ( b == NULL )
-                break;
-
-            num_read = 0;
-            b -> rc = rc;
-            QFMSG ( "BG: %s: created empty buffer with rc = %R.\n", __func__, b -> rc );
-            loop = false;
-        }
-        else
-        {
-            QFMSG ( "BG: %s: reading %zu byte buffer\n", __func__, self -> bsize );
-            b -> rc = KFileReadAll ( self -> f, pos, b -> data, self -> bsize, & num_read );
-            QFMSG ( "BG: %s: read %zu bytes, rc = %R\n", __func__, num_read, b -> rc );
-            if ( b -> rc != 0 || num_read == 0 )
-                loop = false;
-        }
-
-        /* update buffer data */
-        b -> pos = pos;
-        b -> bytes = num_read;
-#if _DEBUGGING
-        b -> align = 0;
-#endif
-
-PushAgain:
-        /* timeout is in mS */
-        QFMSG ( "BG: %s: initializing timeout for %,umS\n", __func__, self->timeout_ms );
-        TimeoutInit ( & tm, self->timeout_ms );
-
-        /* push buffer */
-        QFMSG ( "BG: %s: pushing buffer...\n", __func__ );
-        rc = KQueuePush ( self -> q, b, & tm );
-        QFMSG ( "BG: %s: ...done: rc = %R\n", __func__, rc );
-        if ( rc != 0 )
-        {
-            /* if queue has been sealed by fg */
-            if ( GetRCState ( rc ) == rcReadonly )
-            {
-                rc = 0;
-                QFMSG ( "BG: %s: clearing rc\n", __func__ );
-
-            } else if( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted ) {
-                goto PushAgain;
-            }
-            QFMSG ( "BG: %s: dousing buffer\n", __func__ );
-            free ( b );
-            break;
-        }
-    }
-    
-    /* going to exit thread */
-    QFMSG ( "BG: %s: sealing thread\n", __func__ );
-    KQueueSeal ( self -> q );
-
-    QFMSG ( "BG: %s: exit with rc = %R\n", __func__, rc );
-    return rc;
-}
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of file.
- */
-static
-rc_t CC KQueueFileNoRead ( const KQueueFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    return RC ( rcFS, rcFile, rcReading, rcFile, rcWriteonly );
-}
-
-static
-rc_t CC KQueueFileRead ( const KQueueFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    size_t to_read;
-    KQueueFile *self = ( KQueueFile* ) cself;
-    KQueueFileBuffer *b = self -> b;
-
-    assert ( num_read != NULL );
-    assert ( * num_read == 0 );
-    assert ( buffer != NULL && bsize != 0 );
-
-    /* detect attempt to back up */
-    if ( b != NULL && pos < b -> pos )
-    {
-        QFMSG ( "%s: detected attempt to back up from %lu to %lu\n", __func__, b -> pos, pos );
-        return RC ( rcApp, rcFile, rcReading, rcConstraint, rcViolated );
-    }
-    
-    QFMSG ( "%s: loop to read %zu bytes at offset %lu\n", __func__, bsize, pos );
-    while ( ! KQueueFileBufferContains ( b, pos ) )
-    {
-        /* fetch next buffer */
-        KQueueFileBuffer *tmp;
-
-        /* timeout is in mS */
-        timeout_t tm;
-        QFMSG ( "%s: initializing timeout for %,umS\n", __func__, self->timeout_ms );
-        TimeoutInit ( & tm, self->timeout_ms );
-
-        /* pop buffer */
-        QFMSG ( "%s: popping buffer...\n", __func__ );
-        rc = KQueuePop ( self -> q, ( void** ) & tmp, & tm );
-        QFMSG ( "%s: ...done: rc = %R\n", __func__, rc );
-        if ( rc != 0 )
-        {
-            /* see if the bg thread is done */
-            if ( GetRCState ( rc ) == rcDone && GetRCObject ( rc ) == rcData )
-            {
-                QFMSG ( "%s: BG thread has exited with end-of-input\n", __func__ );
-                return 0;
-            } else if( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted ) {
-                continue; /* timeout is not a problem, try again */
-            }
-
-            QFMSG ( "%s: read failed with rc = %R\n", __func__, rc );
-            return rc;
-        }
-
-        /* queue is not supposed to be able to contain NULL */
-        assert ( tmp != NULL );
-
-        /* buffer may indicate read error or end of input */
-        if ( tmp -> rc != 0 || tmp -> bytes == 0 )
-        {
-            rc = tmp -> rc;
-            QFMSG ( "%s: BG thread has delivered %zu size buffer with rc = %R\n", __func__, tmp -> bytes, rc );
-            free ( tmp );
-            return rc;
-        }
-
-        /* free existing buffer */
-        if ( b != NULL )
-        {
-            QFMSG ( "%s: freeing buffer of %zu bytes at position %lu\n", __func__, b -> bytes, b -> pos );
-            free ( b );
-        }
-
-        /* take new buffer */
-        self -> b = b = tmp;
-        QFMSG ( "%s: caching buffer of %zu bytes at position %lu\n", __func__, b -> bytes, b -> pos );
-    }
-
-    pos -= b -> pos;
-    to_read = b -> bytes - ( size_t ) pos;
-    if ( to_read > bsize )
-        to_read = bsize;
-
-    QFMSG ( "%s: copying %zu bytes from buffer at local offset %lu\n", __func__, to_read, pos );
-    memcpy ( buffer, & b -> data [ pos ], to_read );
-
-    QFMSG ( "%s: successful read\n", __func__ );
-    * num_read = to_read;
-    return 0;
-}
-
-
-/* RunWrite
- *  runs write loop on background thread
- */
-static
-rc_t CC KQueueFileRunWrite ( const KThread *t, void *data )
-{
-    KQueueFile *self = data;
-
-    rc_t rc;
-    do
-    {
-        size_t num_writ;
-        KQueueFileBuffer *b;
-
-        /* timeout is in mS */
-        timeout_t tm;
-        TimeoutInit ( & tm, self->timeout_ms );
-
-        /* pop buffer */
-        rc = KQueuePop ( self -> q, ( void** ) & b, & tm );
-        if ( rc != 0 )
-        {
-            /* see if the fg thread is done */
-            if ( GetRCState ( rc ) == rcDone && GetRCObject ( rc ) == rcData )
-            {
-                rc = 0;
-            }
-            else if ( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted )
-            {
-                rc = 0;
-                continue;
-            }
-
-            break;
-        }
-
-        /* queue won't accept NULL object references */
-        assert ( b != NULL );
-
-        /* look at buffer for end of input */
-        if ( b -> rc != 0 || b -> bytes == 0 )
-        {
-            free ( b );
-            break;
-        }
-
-        /* write to file */
-        rc = KFileWriteAll ( self -> f, b -> pos, b -> data, b -> bytes, & num_writ );
-        assert ( num_writ == b -> bytes || rc != 0 );
-
-        /* TBD - need a better way to deal with this */
-        if ( rc != 0 )
-        {
-            PLOGERR ( klogSys, ( klogSys, rc, "$(func): wrote $(num_writ) of $(bytes) bytes to file",
-                                 "func=%s,num_writ=%zu,bytes=%zu", __func__, num_writ, b -> bytes ) );
-        }
-
-        /* done with buffer */
-        free ( b );
-    }
-    while ( rc == 0 );
-
-    /* going to exit thread */
-    KQueueSeal ( self -> q );
-
-    return rc;
-}
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t CC KQueueFileNoWrite ( KQueueFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcApp, rcFile, rcWriting, rcFile, rcReadonly );
-}
-
-static
-rc_t CC KQueueFileWrite ( KQueueFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    size_t total, to_write;
-
-    for ( rc = 0, total = 0; total < size; pos += to_write, total += to_write )
-    {
-        /* current buffer */
-        KQueueFileBuffer *b = self -> b;
-
-        /* if we have a buffer, test for a write within bounds */
-        if ( self -> b != NULL )
-        {
-            /* an attempt to write first byte BEFORE
-               current buffer or BEYOND current contents
-               or AT current end while being full provokes
-               a flush of the current buffer */
-            if ( pos < b -> pos ||
-                 pos > b -> pos + b -> bytes ||
-                 pos == b -> pos + self -> bsize )
-            {
-                rc = KQueueFileFlush ( self, b );
-                if ( rc != 0 )
-                {   /* the background thread is probably gone */
-                    break;
-                }
-            }
-        }
-
-        /* if by now we don't have a buffer, allocate one */
-        if ( self -> b == NULL )
-        {
-            b = malloc ( sizeof * b - sizeof b -> data + self -> bsize );
-            if ( b == NULL )
-            {
-                rc = RC ( rcApp, rcFile, rcWriting, rcMemory, rcExhausted );
-                break;
-            }
-
-            self -> b = b;
-            b -> pos = pos/* + total*/;
-            b -> bytes = 0;
-            b -> rc = 0;
-#if _DEBUGGING
-            b -> align = 0;
-#endif
-        }
-
-        assert ( b != NULL );
-        assert ( b == self -> b );
-/*        assert ( pos >= b -> pos ); */
-        assert ( pos <= b -> pos + b -> bytes );
-        assert ( pos < b -> pos + self -> bsize );
-
-        /* write into the buffer */
-        to_write = size - total;
-        if ( b -> bytes + to_write > self -> bsize )
-            to_write = self -> bsize - b -> bytes;
-
-        memcpy ( & b -> data [ b -> bytes ], & ( ( const uint8_t* ) buffer ) [ total ], to_write );
-        b -> bytes += to_write;
-    }
-
-
-    * num_writ = total;
-    if ( total != 0 )
-        return 0;
-
-    return rc;
-}
-
-
-static KFile_vt_v1 KQueueFileRead_vt_v1 =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* v1.0 */
-    KQueueFileWhackRead,
-    KQueueFileGetSysFile,
-    KQueueFileRandomAccess,
-    KQueueFileSize,
-    KQueueFileSetSize,
-    KQueueFileRead,
-    KQueueFileNoWrite,
-
-    /* v1.1 */
-    KQueueFileType
-};
-
-
-static KFile_vt_v1 KQueueFileWrite_vt_v1 =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* v1.0 */
-    KQueueFileWhackWrite,
-    KQueueFileGetSysFile,
-    KQueueFileRandomAccess,
-    KQueueFileSize,
-    KQueueFileSetSize,
-    KQueueFileNoRead,
-    KQueueFileWrite,
-
-    /* v1.1 */
-    KQueueFileType
-};
-
-
-/* MakeRead
- *  make a queue file for reading-ahead on background thread
- *
- *  when the file is created, a background thread is started
- *  that begins reading from "src" at position "pos", into
- *  buffers of size "buffer_size". each buffer is pushed into
- *  a cross-thread queue where it is consumed by the reading
- *  thread.
- *
- *  the background thread is throttled by queue capacity - determined
- *  by "queue_bytes" and "block_size", such that if the queue is full,
- *  the thread will sleep. the consumer thread is also throttled by the
- *  queue in that it will sleep if the queue is empty with pending data.
- *
- *  the background thread will exit upon reaching end of file,
- *  upon a permanent error, or if the queue is sealed by the consumer
- *  thread.
- *
- *  when the file is collected in response to a release message,
- *  the queue will be sealed against further inserts, pending buffers
- *  will be discarded, the background thread will be joined, and
- *  the source file will be released.
- *
- *  the intended usage is serial reading of the file. reads
- *  may only progress forward, i.e. backing up is not permitted.
- *
- *  "qf" [ OUT ] - return parameter for queue file
- *
- *  "pos" [ IN ] - starting position for reads from "src".
- *  NB - "src" must support being addressed at this position.
- *
- *  "src" [ IN ] - source file for read-ahead on background thread.
- *  must have read permissions.
- *
- *  "queue_bytes" [ IN ] - the read-ahead limit of the background
- *  thread, in bytes. this is the amount of data that will be queued
- *  for the consumer thread before the bg thread sleeps.
- *
- *  "block_size" [ IN, DEFAULT ZERO ] - optional parameter giving
- *  desired block size when reading from "src". this may be used
- *  to tune reading for source data, e.g. 64K blocks for gzip.
- */
-LIB_EXPORT rc_t CC KQueueFileMakeRead ( const KFile **qfp, uint64_t pos,
-    const KFile *src, size_t queue_bytes, size_t block_size, uint32_t timeout_ms )
-{
-    rc_t rc;
-
-    if ( qfp == NULL )
-        rc = RC ( rcApp, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( src == NULL )
-            rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! src -> read_enabled )
-        {
-            if ( src -> write_enabled )
-                rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcWriteonly );
-            else
-                rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else if ( pos == 0 || ( rc = KFileRandomAccess ( src ) ) == 0 )
-        {
-            KQueueFile *qf = malloc ( sizeof * qf );
-            if ( qf == NULL )
-                rc = RC ( rcApp, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & qf -> dad, ( const KFile_vt* ) & KQueueFileRead_vt_v1, "KQueueFile", "no-name", true, false );
-                if ( rc == 0 )
-                {
-                    qf -> f = ( KFile* ) src;
-                    rc = KFileAddRef ( src );
-                    if ( rc == 0 )
-                    {
-                        uint32_t capacity;
-
-                        /* zero block size means default */
-                        if ( block_size == 0 )
-                            block_size = DEFAULT_BLOCK_SIZE;
-
-                        /* queue capacity is expressed in bytes originally
-                           translate to buffer count */
-                        capacity = ( queue_bytes + block_size - 1 ) / block_size;
-                        if ( capacity == 0 )
-                            capacity = 1;
-
-                        /* actual capacity will be a power of 2 */
-                        rc = KQueueMake ( & qf -> q, capacity );
-                        if ( rc == 0 )
-                        {
-                            /* capture current size if supported */
-                            qf -> rc_from_size_on_open = KFileSize ( src, & qf -> apparent_size );
-
-                            /* starting position for read */
-                            qf -> start_pos = pos;
-
-                            /* requested buffer size */
-                            qf -> b = NULL;
-                            qf -> bsize = block_size;
-
-                            /* timeout */
-                            qf -> timeout_ms = timeout_ms == 0 ? DEFAULT_TIMEOUT_MS : timeout_ms;
-
-                            /* finally, start the background thread */
-                            rc = KThreadMake ( & qf -> t, KQueueFileRunRead, qf );
-                            if ( rc == 0 )
-                            {
-                                * qfp = & qf -> dad;
-                                return 0;
-                            }
-
-                            KQueueRelease ( qf -> q );
-                        }
-
-                        KFileRelease ( qf -> f );
-                    }
-                }
-
-                free ( qf );
-            }
-        }
-
-        * qfp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* MakeWrite
- *  make a queue file for writing-behind on background thread
- *
- *  when the file is created, a background thread is started that
- *  waits for buffers to appear in the cross-thread queue. as the producer
- *  thread writes, data are accumulated into buffers which are pushed
- *  into the queue as they fill, and written in turn on the bg thread.
- *
- *  the producer thread is throttled by queue capacity - determined by
- *  "queue_bytes" and "block_size", such that if the queue is full,
- *  the thread will sleep. the background thread is also throttled by
- *  the queue in that it will sleep if the queue is empty with pending
- *  data.
- *
- *  the background thread will exit upon a permanent error, or if the
- *  queue is sealed by the producer thread.
- *
- *  when the file is collected in response to a release message,
- *  the queue will be sealed against further inserts, pending buffers
- *  will be written, the background thread will be joined, and
- *  the source file will be released.
- *
- *  the intended usage is serial writing of the file. random writes
- *  will be accepted, but may reduce the queue efficiency.
- *
- *  "qf" [ OUT ] - return parameter for queue file
- *
- *  "dst" [ IN ] - destination file for write-behind on background thread.
- *  must have write permissions.
- *
- *  "queue_bytes" [ IN ] - the write-behind limit of the producer
- *  thread, in bytes. this is the amount of data that will be queued
- *  for the background thread before the producer thread sleeps.
- *
- *  "block_size" [ IN, DEFAULT ZERO ] - optional parameter giving
- *  desired block size when writing to "dst". this may be used
- *  to tune writing for source data, e.g. 64K blocks for gzip.
- */
-LIB_EXPORT rc_t CC KQueueFileMakeWrite ( KFile **qfp,
-    KFile *dst, size_t queue_bytes, size_t block_size, uint32_t timeout_ms )
-{
-    rc_t rc;
-
-    if ( qfp == NULL )
-        rc = RC ( rcApp, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( dst == NULL )
-            rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! dst -> write_enabled )
-        {
-            if ( dst -> read_enabled )
-                rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcApp, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            KQueueFile *qf = malloc ( sizeof * qf );
-            if ( qf == NULL )
-                rc = RC ( rcApp, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & qf -> dad, ( const KFile_vt* ) & KQueueFileWrite_vt_v1, "KQueueFile", "no-name", false, true );
-                if ( rc == 0 )
-                {
-                    qf -> f = dst;
-                    rc = KFileAddRef ( dst );
-                    if ( rc == 0 )
-                    {
-                        uint32_t capacity;
-
-                        /* zero block size means default */
-                        if ( block_size == 0 )
-                            block_size = DEFAULT_BLOCK_SIZE;
-
-                        /* queue capacity is expressed in bytes originally
-                           translate to buffer count */
-                        capacity = ( queue_bytes + block_size - 1 ) / block_size;
-                        if ( capacity == 0 )
-                            capacity = 1;
-
-                        /* actual capacity will be a power of 2 */
-                        rc = KQueueMake ( & qf -> q, capacity );
-                        if ( rc == 0 )
-                        {
-                            /* capture current size if supported */
-                            qf -> rc_from_size_on_open = KFileSize ( dst, & qf -> apparent_size );
-
-                            /* starting position not used */
-                            qf -> start_pos = 0;
-
-                            /* requested buffer size */
-                            qf -> b = NULL;
-                            qf -> bsize = block_size;
-
-                            /* timeout */
-                            qf -> timeout_ms = timeout_ms == 0 ? DEFAULT_TIMEOUT_MS : timeout_ms;
-
-                            /* finally, start the background thread */
-                            rc = KThreadMake ( & qf -> t, KQueueFileRunWrite, qf );
-                            if ( rc == 0 )
-                            {
-                                * qfp = & qf -> dad;
-                                return 0;
-                            }
-
-                            KQueueRelease ( qf -> q );
-                        }
-
-                        KFileRelease ( qf -> f );
-                    }
-                }
-
-                free ( qf );
-            }
-        }
-
-        * qfp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kapp/tokenizer.c b/libs/kapp/tokenizer.c
deleted file mode 100644
index b386f37..0000000
--- a/libs/kapp/tokenizer.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kapp/extern.h>
-#include <sysalloc.h>
-
-#include <kapp/args.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/text.h>
-
-#include <vfs/path.h>
-#include <vfs/manager.h>
-#include <kfs/file.h>
-
-#include <os-native.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-
-#define ARGV_INC 10
-#define TOKEN_INC 512
-
-/*
-   strtok() not used, because we tokenize the content of a file!
-   we do that in chunks of 4096 char's
-   a token can span multiple chunks!
-   we also support quoting and escaping ( a la bash )
-*/
-
-typedef struct tokenzr
-{
-    int * argc;
-    char *** argv;
-    char *token;
-    size_t allocated;
-    size_t used;
-    uint32_t state;
-    uint32_t nargs;
-    char escape[ 3 ];
-    char n_escape;
-    char m_escape;
-} tokenzr;
-
-
-static rc_t make_tokenzr( tokenzr **t, int * argc, char *** argv )
-{
-    rc_t rc = 0;
-    if ( t == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcSelf, rcNull );
-    }
-    else
-    {
-        tokenzr *t1 = malloc( sizeof *t1 );
-        if ( t1 == NULL )
-        {
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        }
-        else
-        {
-            t1->token = malloc( TOKEN_INC );
-            if ( t1->token == NULL )
-            {
-                rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            }
-            else
-            {
-                t1->allocated = TOKEN_INC;
-                t1->used = 0;
-                t1->state = 0;
-                t1->nargs = 0;
-                t1->argc = argc;
-                t1->argv = argv;
-                t1->n_escape = 0;
-                t1->m_escape = 0;
-            }
-        }
-        if ( rc == 0 )
-        {
-            *t = t1;
-        }
-    }
-    return rc;
-}
-
-
-static void free_tokenzr( tokenzr *t )
-{
-    if ( t != NULL )
-    {
-        if ( t->token != NULL )
-            free( t->token );
-        free( t );
-    }
-}
-
-
-static rc_t expand_argv( tokenzr *t )
-{
-    rc_t rc = 0;
-    char ** pargv = *(t->argv);
-
-    if ( pargv == NULL )
-    {
-        pargv = malloc( ARGV_INC * ( sizeof pargv[ 0 ] ) );
-        if ( pargv != NULL )
-        {
-            t->nargs = ARGV_INC;
-            ( *(t->argc) ) = 0;
-        }
-        else
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    }
-    else
-    {
-        if ( ( *(t->argc) ) >= t->nargs )
-        {
-            char ** pargv1 = realloc( pargv, ( ( t->nargs + ARGV_INC ) * ( sizeof pargv[ 0 ] ) ) );
-            if ( pargv1 != NULL )
-            {
-                t->nargs += ARGV_INC;
-                pargv = pargv1;
-            }
-            else
-            {
-                rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-                free( pargv );
-                pargv = NULL;
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        *(t->argv) =  pargv;
-    }
-    return rc;
-}
-
-
-static rc_t add_string_to_argv( tokenzr *t, const char * str, size_t len )
-{
-    rc_t rc = expand_argv( t );
-    if ( rc == 0 )
-    {
-        int argc = *(t->argc);
-        char ** pargv = *(t->argv);
-
-        pargv[ argc ] = string_dup ( str, len );
-        if ( pargv[ argc ] == NULL )
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            ( *(t->argc) )++;
-            *(t->argv) =  pargv;
-            t->used = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t add_token_to_argv( tokenzr *t )
-{
-    return add_string_to_argv( t, t->token, t->used );
-}
-
-
-static rc_t add_buffer_to_token( tokenzr *t, const char *buffer, size_t buflen )
-{
-    rc_t rc = 0;
-    if ( t->used + buflen > t->allocated )
-    {
-        size_t new_size = t->used + buflen + TOKEN_INC;
-        char * temp = realloc( t->token, new_size );
-        if ( temp == NULL )
-        {
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        }
-        else
-        {
-            t->token = temp;
-            t->allocated = new_size;
-        }
-    }
-    if ( rc == 0 )
-    {
-        memcpy( t->token + t->used, buffer, buflen );
-        t->used += buflen;
-    }
-    return rc;
-}
-
-
-/* this is the 'normal' state, that the buffer is divided into tokens by white-space */
-const static char delim0[] = " \r\n\f\t\v\\\"";
-static rc_t tokenize_state0( tokenzr *t, bool *done, char ** ptr, const char *buffer, size_t buflen )
-{
-    rc_t rc;
-    char * s = strpbrk ( *ptr, delim0 );
-    if ( s == NULL )
-    {
-        /* delimiting char not found!
-            ---> add everything to the tokenbuffer */
-        size_t to_add = buflen - ( *ptr - buffer );
-        rc = add_buffer_to_token( t, *ptr, to_add );
-        *done = true;
-    }
-    else
-    {
-        /* delimiting char found!
-            ---> add everything from ptr to s to the tokenbuffer
-            ---> then add token to argv
-            ---> then clear token */
-        rc = add_buffer_to_token( t, *ptr, s - *ptr );
-        if ( rc == 0 )
-        {
-            if ( t->used > 0 && *s != '\\' )
-                rc = add_token_to_argv( t );
-            *ptr = s + 1;
-            *done = ( *ptr >= buffer + buflen );
-            switch( *s )
-            {
-                case '"'  : t->state =  1; break;
-                case '\\' : t->state =  2; break;
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* this state, provides 'quoting' ( prevents tokenizing by putting quotes "" around strings
-    which would be otherwise separated by whitespace ) */
-const static char delim1[] = "\"";
-static rc_t tokenize_state1( tokenzr *t, bool *done, char ** ptr, const char *buffer, size_t buflen )
-{
-    rc_t rc;
-    char * s = strpbrk ( *ptr, delim1 );
-    if ( s == NULL )
-    {
-        /* delimiting char not found!
-            ---> add everything to the tokenbuffer */
-        size_t to_add = buflen - ( *ptr - buffer );
-        rc = add_buffer_to_token( t, *ptr, to_add );
-        *done = true;
-    }
-    else
-    {
-        /* delimiting char found!
-            ---> add everything from ptr to s to the tokenbuffer
-            ---> then add token to argv
-            ---> then clear token */
-        rc = add_buffer_to_token( t, *ptr, s - *ptr );
-        if ( rc == 0 )
-        {
-            if ( t->used > 0 )
-                rc = add_token_to_argv( t );
-            *ptr = s + 1;
-            *done = ( *ptr >= buffer + buflen );
-            if ( *s == '"' )
-                t->state = 0;
-        }
-    }
-    return rc;
-}
-
-
-/* this state, provides 'escaping' ( \nnn or \xHH or \' or \" ) */
-static rc_t tokenize_state2( tokenzr *t, bool *done, char ** ptr, const char *buffer, size_t buflen )
-{
-    rc_t rc = 0;
-    char c = **ptr;
-    switch( c )
-    {
-        case '\\' : /* no break intended ! */
-        case '\'' :
-        case '\"' : rc = add_buffer_to_token( t, (*ptr)++, 1 );
-                    break;
-
-        case 't'  : rc = add_buffer_to_token( t, "\t", 1 );
-                    (*ptr)++;
-                    break;
-        case 'n'  : rc = add_buffer_to_token( t, "\n", 1 );
-                    (*ptr)++;
-                    break;
-        case 'r'  : rc = add_buffer_to_token( t, "\r", 1 );
-                    (*ptr)++;
-                    break;
-
-    }
-    t->state = 0;
-    *done = ( *ptr >= buffer + buflen );
-    return rc;
-}
-
-
-static rc_t tokenize_buffer( tokenzr *t, const char *buffer, size_t buflen )
-{
-    rc_t rc = 0;
-    char * ptr = ( char * ) buffer;
-    bool done = false;
-    while ( rc == 0 && !done )
-        switch( t->state )
-        {
-            case 0 : rc = tokenize_state0( t, &done, &ptr, buffer, buflen ); break;
-            case 1 : rc = tokenize_state1( t, &done, &ptr, buffer, buflen ); break;
-            case 2 : rc = tokenize_state2( t, &done, &ptr, buffer, buflen ); break;
-        }
-    return rc;
-}
-
-
-static rc_t tokenize_file_and_progname_into_argv( const char * filename, const char * progname,
-                                                  int * argc, char *** argv )
-{
-    rc_t rc2, rc = 0;
-    VFSManager *vfs_mgr;
-
-    ( *argv ) = NULL;
-    ( *argc ) = 0;
-    rc = VFSManagerMake ( &vfs_mgr );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "VFSManagerMake() failed" );
-    else
-    {
-        VPath * vfs_path;
-        rc = VFSManagerMakePath ( vfs_mgr, &vfs_path, filename );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "VPathMake() failed" );
-        else
-        {
-            struct KFile const *my_file;
-            rc = VFSManagerOpenFileRead ( vfs_mgr, &my_file, vfs_path );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "VFSManagerOpenFileRead() failed" );
-            else
-            {
-                tokenzr *t;
-                uint64_t pos = 0;
-                char buffer[ 4096 + 1 ];
-                size_t num_read;
-
-                rc = make_tokenzr( &t, argc, argv );
-                if ( rc != 0 )
-                    LOGERR( klogInt, rc, "make_tokenzr() failed" );
-                else
-                {
-                    if ( progname != NULL )
-                        rc = add_string_to_argv( t, progname, string_size( progname ) );
-
-                    if ( rc == 0 )
-                    {
-                        do
-                        {
-                            rc = KFileRead ( my_file, pos, buffer, ( sizeof buffer ) - 1, &num_read );
-                            if ( rc != 0 )
-                                LOGERR( klogInt, rc, "KFileRead() failed" );
-                            else if ( num_read > 0 )
-                            {
-                                buffer[ num_read ]  = 0;
-                                rc = tokenize_buffer( t, buffer, num_read );
-                                if ( rc != 0 )
-                                    LOGERR( klogInt, rc, "tokenize_buffer() failed" );
-                                pos += num_read;
-                            }
-                        } while ( rc == 0 && num_read > 0 );
-                    }
-
-                    if ( rc == 0 && t->used > 0 )
-                    {
-                        rc = add_token_to_argv( t );
-                        if ( rc != 0 )
-                            LOGERR( klogInt, rc, "add_token_to_argv() failed" );
-                    }
-                    free_tokenzr( t );
-                }
-                rc2 = KFileRelease ( my_file );
-                if ( rc2 != 0 )
-                    LOGERR( klogInt, rc2, "KFileRelease() failed" );
-            }
-            rc2 = VPathRelease ( vfs_path );
-            if ( rc2 != 0 )
-                LOGERR( klogInt, rc2, "VPathRelease() failed" );
-        }
-        rc2 = VFSManagerRelease ( vfs_mgr );
-        if ( rc2 != 0 )
-            LOGERR( klogInt, rc2, "VFSManagerRelease() failed" );
-    }
-    return rc;
-}
-
-
-rc_t CC Args_tokenize_file_into_argv( const char * filename, int * argc, char *** argv )
-{
-    return tokenize_file_and_progname_into_argv( filename, NULL, argc, argv );
-}
-
-
-rc_t CC Args_tokenize_file_and_progname_into_argv( const char * filename, const char * progname,
-                                                               int * argc, char *** argv )
-{
-    return tokenize_file_and_progname_into_argv( filename, progname, argc, argv );
-}
-
-
-void CC Args_free_token_argv( int argc, char * argv[] )
-{
-    if ( argv != NULL )
-    {
-        int i;
-        for ( i = 0; i < argc; ++i )
-            free( argv[ i ] );
-        free( argv );
-    }
-}
-
-
-static int sized_str_cmp( const char *a, const char *b )
-{
-    size_t asize = string_size ( a );
-    size_t bsize = string_size ( b );
-    return strcase_cmp ( a, asize, b, bsize, ( asize > bsize ) ? asize : bsize );
-}
-
-
-/* get's the filename following a file_option - parameter into the file-name-buffer */
-rc_t CC Args_find_option_in_argv( int argc, char * argv[],
-                                              const char * option_name,
-                                              char * option, size_t option_len )
-{
-    rc_t rc = 0;
-    int i, opt_idx;
-
-    if ( option == NULL )
-        return RC( rcRuntime, rcArgv, rcConstructing, rcParam, rcNull );
-
-    option[ 0 ] = 0;
-
-    if ( argv == NULL || argc < 1 )
-        return RC( rcRuntime, rcArgv, rcConstructing, rcSelf, rcNull );
-    if ( option_name == NULL || option_len == 0 )
-        return RC( rcRuntime, rcArgv, rcConstructing, rcParam, rcNull );
-
-    opt_idx = -1;
-    for ( i = 0; i < argc && ( option[ 0 ] == 0 ); ++i )
-    {
-        if ( sized_str_cmp( (const char *)argv[i], option_name ) == 0 )
-        {
-                opt_idx = ( i + 1 );
-        }
-        else if ( i == opt_idx )
-        {
-            string_copy( option, option_len, argv[i], string_size( argv[i] ) );
-        }
-    }
-    if ( option[ 0 ] == 0 )
-        rc = RC( rcRuntime, rcArgv, rcConstructing, rcParam, rcNotFound );
-    return rc;
-}
-
-
-rc_t CC Args_parse_inf_file( Args * args, const char * file_option )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, file_option, &count );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-    else if ( count > 0 )
-    {
-        uint32_t count2 = 0;
-        do
-        {
-            uint32_t idx;
-            for ( idx = count2; idx < count && rc == 0; ++idx )
-            {
-                const char *filename;
-                rc = ArgsOptionValue( args, file_option, idx, &filename );
-                if ( rc != 0 )
-                    LOGERR( klogInt, rc, "ArgsOptionValue() failed" );
-                else if ( filename != NULL )
-                {
-                    int argc;
-                    char ** argv;
-                    rc = Args_tokenize_file_into_argv( filename, &argc, &argv );
-                    if ( rc == 0 && argv != NULL && argc > 0 )
-                    {
-                        rc = ArgsParse ( args, argc, argv );
-                        Args_free_token_argv( argc, argv );
-                    }
-                }
-            }
-            count2 = count;
-            rc = ArgsOptionCount( args, file_option, &count );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-        } while ( rc == 0 && count > count2 );
-    }
-    return rc;
-}
diff --git a/libs/kapp/unix/sysmain.c b/libs/kapp/unix/sysmain.c
deleted file mode 100644
index cbeb87e..0000000
--- a/libs/kapp/unix/sysmain.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "../main-priv.h"
-#include <sysalloc.h>
-#include <kapp/main.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/status.h>
-#include <klib/report.h>
-#include <klib/rc.h>
-#include <atomic32.h>
-
-#include <unistd.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <assert.h>
-
-#if ! _DEBUGGING && ! defined CATCH_SIGSEGV
-#define CATCH_SIGSEGV 1
-#endif
-
-/*--------------------------------------------------------------------------
- * Main
- */
-
-static bool no_hup;
-static atomic32_t hangup;
-static atomic32_t quitting;
-
-/* Quitting
- *  is the program supposed to exit
- */
-rc_t Quitting ( void )
-{
-    if ( atomic32_read ( & quitting ) == 0 )
-        return 0;
-    LOGMSG ( klogInfo, "EXITING..." );
-    return RC ( rcExe, rcProcess, rcExecuting, rcProcess, rcCanceled );
-}
-
-/* SignalQuit
- *  tell the program to quit
- */
-rc_t SignalQuit ( void )
-{
-    ReportSilence ();
-
-    if ( kill ( 0, SIGTERM ) != 0 ) switch ( errno )
-    {
-    case EINVAL:
-        return RC ( rcExe, rcProcess, rcSignaling, rcMessage, rcInvalid );
-    case EPERM:
-        return RC ( rcExe, rcProcess, rcSignaling, rcMessage, rcUnauthorized );
-    default:
-        return RC ( rcExe, rcProcess, rcSignaling, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-/* Hangup
- *  has the program received a SIGHUP
- */
-rc_t Hangup ( void )
-{
-    if ( atomic32_read ( & hangup ) == 0 )
-        return 0;
-    LOGMSG ( klogInfo, "HANGUP...\n" );
-    return RC ( rcExe, rcProcess, rcExecuting, rcProcess, rcIncomplete );
-}
-
-/* SignalHup
- *  send the program a SIGHUP
- */
-rc_t SignalHup ( void )
-{
-    if ( kill ( 0, SIGHUP ) != 0 ) switch ( errno )
-    {
-    case EINVAL:
-        return RC ( rcExe, rcProcess, rcSignaling, rcMessage, rcInvalid );
-    case EPERM:
-        return RC ( rcExe, rcProcess, rcSignaling, rcMessage, rcUnauthorized );
-    default:
-        return RC ( rcExe, rcProcess, rcSignaling, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-/* SignalNoHup
- *  tell the program to stay alive even after SIGHUP
- */
-rc_t SignalNoHup ( void )
-{
-    no_hup = true;
-    return 0;
-}
-
-/* SigHupHandler
- */
-static
-void SigHupHandler ( int sig )
-{
-    ( ( void ) sig );
-    atomic32_inc ( & hangup );
-    if ( ! no_hup )
-        atomic32_inc ( & quitting );
-    PLOGMSG ( klogInfo, (klogInfo, "SIGNAL - $(sig)\n", "sig=HUP" ));
-}
-
-/* SigQuitHandler
- */
-static
-void SigQuitHandler ( int sig )
-{
-    const char *msg;
-
-    ReportSilence ();
-
-    atomic32_inc ( & quitting );
-    switch ( sig )
-    {
-    case SIGINT:
-        msg = "^C";
-        break;
-    case SIGQUIT:
-        msg = "QUIT";
-        break;
-    case SIGTERM:
-        msg = "TERM";
-        break;
-    default:
-        PLOGMSG ( klogWarn, ( klogWarn, "SIGNAL - $(sig)\n", "sig=%d", sig ));
-        return;
-    }
-
-    PLOGMSG ( klogInfo, ( klogInfo, "SIGNAL - $(sig)", "sig=%s", msg ));
-}
-
-/* SigSegvHandler
- */
-#if CATCH_SIGSEGV
-static
-void SigSegvHandler ( int sig )
-{
-    ( ( void ) sig );
-    PLOGMSG ( klogFatal, ( klogFatal, "SIGNAL - $(sig)\n", "sig=Segmentation fault" ));
-    abort ();
-    exit ( 1 );
-}
-#endif
-
-/* main
- *  Unix specific main entrypoint
- */
-int main ( int argc, char *argv [] )
-{
-    static struct
-    {
-        void ( * handler ) ( int );
-        int sig;
-    } sigs [] =
-    {
-        { SigHupHandler, SIGHUP },
-        { SigQuitHandler, SIGINT },
-        { SigQuitHandler, SIGQUIT },
-#if CATCH_SIGSEGV
-        { SigSegvHandler, SIGSEGV },
-#endif
-        { SigQuitHandler, SIGTERM }
-    };
-
-    rc_t rc;
-    int i, status;
-    struct sigaction sig_saves [ sizeof sigs / sizeof sigs [ 0 ] ];
-
-    /* install signal handlers */
-    for ( i = 0; i < sizeof sigs / sizeof sigs [ 0 ]; ++ i )
-    {
-        struct sigaction act;
-        memset ( & act, 0, sizeof act );
-        act . sa_handler = sigs [ i ] . handler;
-        act . sa_flags = SA_RESETHAND;
-
-        status = sigaction ( sigs [ i ] . sig, & act, & sig_saves [ i ] );
-        if ( status < 0 )
-        {
-            PLOGMSG ( klogFatal, ( klogFatal,
-                     "failed to install handler for signal $(sig) - $(msg)"
-                     , "sig=%d,msg='%s'"
-                     , sigs [ i ] . sig
-                     , strerror ( errno )
-                          ));
-            return 2;
-        }
-    }
-
-    /* run this guy */
-    rc = KMane ( argc, argv );
-
-    /* remove handlers, for what it's worth */
-    for ( i = 0; i < sizeof sigs / sizeof sigs [ 0 ]; ++ i )
-        sigaction ( sigs [ i ] . sig, & sig_saves [ i ], NULL );
-
-    return ( rc == 0 ) ? 0 : 3;
-}
diff --git a/libs/kapp/win/sysmain.c b/libs/kapp/win/sysmain.c
deleted file mode 100644
index e8f3bcc..0000000
--- a/libs/kapp/win/sysmain.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define UNICODE 1
-#define _UNICODE 1
-
-#include "../main-priv.h"
-#include <sysalloc.h>
-#include <kapp/main.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <atomic32.h>
-
-/* #define _WIN32_WINNT 0x0500 */
-/* commented out: 10/21/2010 by wolfgang
-   reason: Kurt introduced in sysdll.c a new functionality
-   which requires a newer windows-version 
-   (i realized it as compiler parameter in build/Makefile.vc++) */
-
-#include <WINDOWS.H>
-#include <OBJBASE.H>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <ctype.h>
-
-/*--------------------------------------------------------------------------
- * Main
- */
-
-static bool no_hup;
-static atomic32_t hangup;
-static atomic32_t quitting;
-
-/* Quitting
- *  is the program supposed to exit
- */
-rc_t CC Quitting ( void )
-{
-    if ( atomic32_read ( & quitting ) == 0 )
-        return 0;
-    LOGMSG ( klogInfo, "EXITING..." );
-    return RC ( rcExe, rcProcess, rcExecuting, rcProcess, rcCanceled );
-}
-
-/* SignalQuit
- *  tell the program to quit
- */
-rc_t CC SignalQuit ( void )
-{
-    return RC ( rcExe, rcProcess, rcSignaling, rcNoObj, rcUnknown );
-}
-
-/* Hangup
- *  has the program received a SIGHUP
- */
-rc_t CC Hangup ( void )
-{
-    if ( atomic32_read ( & hangup ) == 0 )
-        return 0;
-    LOGMSG ( klogInfo, "HANGUP...\n" );
-    return RC ( rcExe, rcProcess, rcExecuting, rcProcess, rcIncomplete );
-}
-
-/* SignalHup
- *  send the program a SIGHUP
- */
-rc_t CC SignalHup ( void )
-{
-    return RC ( rcExe, rcProcess, rcSignaling, rcNoObj, rcUnknown );
-}
-
-/* SignalNoHup
- *  tell the program to stay alive even after SIGHUP
- */
-rc_t CC SignalNoHup ( void )
-{
-    no_hup = true;
-    return 0;
-}
-
-
-BOOL CC Our_HandlerRoutine( DWORD dwCtrlType )
-{
-    BOOL res = FALSE;
-    switch( dwCtrlType )
-    {
-    case CTRL_C_EVENT : ReportSilence ();
-                        atomic32_inc ( & quitting );
-                        res = TRUE;
-                        break;
-    }
-    return res;
-}
-
-
-/* main
- *  Windows specific main entrypoint
- */
-static
-int main2 ( int argc, char *argv [] )
-{
-    rc_t rc;
-
-    SetConsoleCtrlHandler( ( PHANDLER_ROUTINE ) Our_HandlerRoutine, TRUE );
-
-    /* run this guy */
-    rc = KMane ( argc, argv );
-
-    return ( rc == 0 ) ? 0 : 3;
-}
-
-static
-char *rewrite_arg ( const wchar_t *arg )
-{
-    char *utf8;
-    bool has_drive = false;
-    size_t i, src_size, dst_size;
-    DWORD len;
-
-    /* detect drive or full path */
-    wchar_t rewrit [ MAX_PATH ];
-    if ( arg [ 0 ] < 128 )
-    {
-        bool rewrite = false;
-
-        /* look for non-drive path */
-        if ( arg [ 0 ] == '\\' || arg [ 0 ] == '/' )
-        {
-            /* full path - not network */
-            if ( arg [ 1 ] != '\\' && arg [ 1 ] != '/' )
-            {
-                /* check for cygdrive */
-                if ( memcmp( arg, L"/cygdrive/", sizeof L"/cygdrive/" - sizeof L"" ) == 0 )
-                    arg += sizeof "/cygdrive" - 1;
-                else
-                    rewrite = true;
-             
-            }
-            
-        }
-        /* look for drive path */
-        else if ( isalpha ( arg [ 0 ] ) && arg [ 1 ] == ':' )
-        {
-            has_drive = true;
-
-            /* look for drive relative */
-            if ( arg [ 2 ] != '\\' && arg [ 2 ] != '/' )
-                rewrite = true;
-        }
-        if ( rewrite )
-        {
-            /* incomplete path */
-            len = GetFullPathNameW ( arg, sizeof rewrit / sizeof rewrit [ 0 ], rewrit, NULL );
-            if ( len == 0 || len >= MAX_PATH )
-            {
-                /* complain */
-                return NULL;
-            }
-            arg = rewrit;
-        }
-    }
-
-    /* this point, we should only have normal arguments,
-       or network/full/drive-full/relative paths */
-
-    /* measure the string */
-    len = wchar_cvt_string_measure ( arg, & src_size, & dst_size );
-
-    /* allocate a UTF-8 buffer */
-    utf8 = malloc ( dst_size + 1 );
-    if ( utf8 != NULL )
-    {
-        /* normal arguments get no offsets */
-        uint32_t offset = 0;
-
-        /* check for need to convert drive */
-        if ( has_drive )
-        {
-            /* convert to pseudo mount point */
-            utf8 [ 0 ] = '/';
-            utf8 [ 1 ] = ( char ) arg [ 0 ];
-            offset = 2;
-        }
-
-        /* copy the wide argument to utf8 */
-        wchar_cvt_string_copy ( & utf8 [ offset ], dst_size - offset + 1,
-            & arg [ offset ], src_size - offset * sizeof * arg );
-
-        /* terminate the string */
-        utf8 [ dst_size ] = 0;
-
-        /* map all backslashes to fwdslashes */
-        for ( i = 0; i < dst_size; ++ i )
-        {
-            if ( utf8 [ i ] == '\\' )
-                utf8 [ i ] = '/';
-        }
-    }
-
-    return utf8;
-}
-
-
-int __cdecl wmain ( int argc, wchar_t *wargv [], wchar_t *envp [] )
-{
-    char **argv;
-    int i, status;
-
-    /* must initialize COM... must initialize COM... */
-    /* CoInitializeEx ( NULL, COINIT_MULTITHREADED ); */
-    CoInitialize(NULL);
-
-    /* create a copy of args */
-    argv = calloc ( argc + 1, sizeof * argv );
-    if ( argv == NULL )
-        status = 5;
-    else
-    {
-        /* convert wchar_t arguments to UTF-8
-           rewriting anything that looks like a path */
-        for ( i = 0; i < argc; ++ i )
-        {
-            argv [ i ] = rewrite_arg ( wargv [ i ] );
-            if ( argv [ i ] == NULL )
-                break;
-        }
-
-        /* perform normal main operations on UTF-8 with POSIX-style paths */
-        if ( i == argc )
-            status = main2 ( argc, argv );
-
-        /* tear down argv */
-        while ( -- i >= 0 )
-            free ( argv [ i ] );
-        free ( argv );
-    }
-
-    /* balance the COM initialization */
-    CoUninitialize ();
-
-    return status;
-}
diff --git a/libs/kdb/Makefile b/libs/kdb/Makefile
deleted file mode 100644
index 67bb0ff..0000000
--- a/libs/kdb/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kdb
-
-INT_LIBS = \
-	libkdb \
-	libwkdb
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS) $(ALL_DEFS)
-
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# kdb
-#
-$(ILIBDIR)/libkdb: $(addprefix $(ILIBDIR)/libkdb.,$(ILIBEXT))
-
-KDB_CMN = \
-	btree \
-	dbmgr-cmn \
-#	database-cmn
-
-KDB_SRC = \
-	$(KDB_CMN) \
-	kdb \
-	dbmgr \
-	dbcc-cmn \
-	database \
-	database-cc \
-	table \
-	table-cc \
-	column \
-	column-cc \
-	coldata \
-	colidx \
-	colidx0 \
-	colidx1 \
-	colidx2 \
-	idxblk \
-	meta \
-	index \
-	idstats \
-	trieidx-v1 \
-	trieval-v1 \
-	ptrieval-v1 \
-	trieidx-v2 \
-	trieval-v2 \
-	ptrieval-v2 \
-	u64idx-v3
-
-KDB_OBJ = \
-	$(addsuffix .$(LOBX),$(KDB_SRC))
-
-KDB_LIB = \
-	-dvfs \
-	-dkrypto \
-	-dkfs \
-	-dklib
-
-$(ILIBDIR)/libkdb.$(LIBX): $(KDB_OBJ)
-	$(LD) --slib -o $@ $^ $(KDB_LIB)
-
-
-#-------------------------------------------------------------------------------
-# wkdb
-#
-$(ILIBDIR)/libwkdb: $(addprefix $(ILIBDIR)/libwkdb.,$(ILIBEXT))
-
-WKDB_SRC = \
-	$(KDB_CMN) \
-	wkdb \
-	wdbmgr \
-	wdatabase \
-	wtable \
-	wcolumn \
-	wcoldata \
-	wcolidx \
-	wcolidx0 \
-	wcolidx1 \
-	wcolidx2 \
-	idxblk \
-	widxblk \
-	wmeta \
-	windex \
-	wtrieidx-v1 \
-	wtrieidx-v2 \
-	wu64idx-v3
-
-WKDB_OBJ = \
-	$(addsuffix .$(LOBX),$(WKDB_SRC))
-
-WKDB_LIB = \
-	-dvfs \
-	-dkrypto \
-	-dkfs \
-	-dklib
-
-$(ILIBDIR)/libwkdb.$(LIBX): $(WKDB_OBJ)
-	$(LD) --slib -o $@ $^ $(WKDB_LIB)
diff --git a/libs/kdb/btree.c b/libs/kdb/btree.c
deleted file mode 100644
index ec8f159..0000000
--- a/libs/kdb/btree.c
+++ /dev/null
@@ -1,3055 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define BTREE_KEY2ID 1
-
-#include <kdb/extern.h>
-#include <kdb/btree.h>
-#include <kfs/file.h>
-#include <kfs/pagefile.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-/* must be kept in sync with kfs/pagefile.c */
-#define PGBITS 15
-#define PGSIZE ( 1U << PGBITS )
-
-#if _DEBUGGING
-static
-rc_t page_access_read ( const KPage *page, const void **mem )
-{
-    size_t bytes;
-    rc_t rc = KPageAccessRead ( page, mem, & bytes );
-    if ( rc == 0 && bytes != PGSIZE )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcFormat, rcIncorrect );
-    return rc;
-}
-
-static
-rc_t page_access_update ( KPage *page, void **mem )
-{
-    size_t bytes;
-    rc_t rc = KPageAccessUpdate ( page, mem, & bytes );
-    if ( rc == 0 && bytes != PGSIZE )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcFormat, rcIncorrect );
-    return rc;
-}
-#else
-
-#define page_access_read( page, mem ) \
-    KPageAccessRead ( page, mem, NULL )
-#define page_access_update( page, mem ) \
-    KPageAccessUpdate ( page, mem, NULL )
-
-#endif
-
-
-#if ! BTREE_KEY2ID
-
-/*--------------------------------------------------------------------------
- * KBTreeValue
- *  gives access to a value within a data page
- */
-typedef struct KBTreeValueImpl KBTreeValueImpl;
-struct KBTreeValueImpl
-{
-    KPage *page;
-    size_t offset;
-    size_t size;
-};
-
-/* Whack
- *  destroys object for further use
- *  may write modifications to disk ( see "write_through" below )
- */
-LIB_EXPORT rc_t CC KBTreeValueWhack ( KBTreeValue *xself )
-{
-    KBTreeValueImpl *self = ( KBTreeValueImpl* ) xself;
-    assert ( sizeof * self <= sizeof * xself );
-    if ( self != NULL )
-    {
-        rc_t rc = KPageRelease ( self -> page );
-        memset ( self, 0, sizeof * xself );
-        return rc;
-    }
-    return 0;
-}
-
-
-/* AccessRead
- * AccessUpdate
- *  gain access to value address
- *  update access marks data page as modified
- *
- *  "mem" [ OUT ] - pointer to value
- *
- *  "bytes" [ OUT, NULL OKAY ] - size of value memory
- */
-LIB_EXPORT rc_t CC KBTreeValueAccessRead ( const KBTreeValue *xself,
-    const void **mem, size_t *bytes )
-{
-    rc_t rc;
-    size_t dummy;
-
-    const KBTreeValueImpl *self = ( const KBTreeValueImpl* ) xself;
-    assert ( sizeof * self <= sizeof * xself );
-
-    if ( bytes == NULL )
-        bytes = & dummy;
-
-    if ( mem == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcBlob, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KPageAccessRead ( self -> page, mem, bytes );
-            if ( rc == 0 )
-            {
-                const uint8_t *byte_ptr = * mem;
-                assert ( self -> offset + self -> size <= * bytes );
-                * bytes = self -> size;
-                * mem = byte_ptr + self -> offset;
-                return 0;
-            }
-        }
-
-        * mem = NULL;
-    }
-
-    * bytes = 0;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KBTreeValueAccessUpdate ( KBTreeValue *xself, void **mem, size_t *bytes )
-{
-    rc_t rc;
-    size_t dummy;
-
-    KBTreeValueImpl *self = ( KBTreeValueImpl* ) xself;
-    assert ( sizeof * self <= sizeof * xself );
-
-    if ( bytes == NULL )
-        bytes = & dummy;
-
-    if ( mem == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcBlob, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KPageAccessUpdate ( self -> page, mem, bytes );
-            if ( rc == 0 )
-            {
-                uint8_t *byte_ptr = * mem;
-                assert ( self -> offset + self -> size <= * bytes );
-                * bytes = self -> size;
-                * mem = byte_ptr + self -> offset;
-                return 0;
-            }
-        }
-
-        * mem = NULL;
-    }
-
-    * bytes = 0;
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KPageFileStream
- *  represents a data stream made of pages and nodes
- *
- *  empty representation
- *    eof == 0, root == 0
- *
- *  simplest representation:
- *    0 < eof <= PGSIZE, root != 0 :: root page is data
- *
- *  common representation:
- *    PGSIZE < eof, root != 0 :: root page is a node
- */
-typedef struct KPageFileStream KPageFileStream;
-struct KPageFileStream
-{
-    uint64_t eof;                         /* logical end of file */
-    uint32_t root;                        /* starting page id    */
-    uint32_t min_size;                    /* minimum entry size  */
-    uint32_t max_size;                    /* maximum entry size  */
-    uint32_t chunk_bytes;                 /* alignment factor    */
-    uint32_t page_adj;                    /* bytes to adjust pg  */
-    uint32_t size_bytes;                  /* leading size bytes  */
-};
-
-#define SNBITS ( PGBITS - 2 )
-#define SNSIZE ( 1U << SNBITS )
-
-typedef struct KStreamNode KStreamNode;
-struct KStreamNode
-{
-    uint32_t page [ SNSIZE ];             /* data or node pages  */
-};
-
-
-/* Init
- */
-static
-rc_t KPageFileStreamInit ( KPageFileStream *s, size_t min_size, size_t max_size, size_t chunk_size )
-{
-    /* zero is a good default for most things */
-    memset ( s, 0, sizeof * s );
-
-    /* min and max size must be reasonable */
-    if ( min_size > max_size || max_size == 0 )
-        return RC ( rcDB, rcFile, rcConstructing, rcRange, rcInvalid );
-    if ( max_size > PGSIZE )
-        return RC ( rcDB, rcFile, rcConstructing, rcRange, rcExcessive );
-
-    /* chunk size cannot be too large, either */
-    if ( chunk_size > PGSIZE )
-        return RC ( rcDB, rcFile, rcConstructing, rcParam, rcExcessive );
-
-    /* record limits */
-    s -> min_size = ( uint32_t ) min_size;
-    s -> max_size = ( uint32_t ) max_size;
-
-    /* detect size bytes */
-    if ( min_size == max_size )
-        s -> chunk_bytes = ( uint32_t ) max_size;
-    else
-    {
-        if ( max_size <= UINT8_MAX )
-            s -> size_bytes = 1;
-        else if ( max_size <= UINT16_MAX )
-            s -> size_bytes = 2;
-        else
-            s -> size_bytes = 4;
-
-        s -> chunk_bytes = ( uint32_t ) chunk_size;
-    }
-
-    /* produce page adjustment for chunking */
-    s -> page_adj = PGSIZE % s -> chunk_bytes;
-
-    return 0;
-}
-
-
-/* Check
- */
-static
-rc_t KPageFileStreamCheck ( KPageFileStream *self, size_t min_size, size_t max_size, size_t chunk_size )
-{
-    if ( self -> eof == 0 )
-    {
-        assert ( self -> root == 0 );
-        return KPageFileStreamInit ( self, min_size, max_size, chunk_size );
-    }
-
-    assert ( self -> root != 0 );
-    if ( self -> min_size > min_size || self -> max_size < max_size )
-        return RC ( rcDB, rcFile, rcConstructing, rcParam, rcInconsistent );
-
-    return 0;
-}
-
-
-/* Alloc
- *  allocate space in stream
- *
- *  there are 7 cases to handle within this function
- *
- *  1. allocation within first page of data, including initial allocation
- *  2. initial allocation from second data page
- *  3. no space in root node for allocation
- *  4. allocation crosses slot boundaries
- *  5. end slot is null
- *  6. end slot has data page
- *  7. end slot has node page
- */
-static
-rc_t KPageFileStreamAlloc ( KPageFileStream *self, KPageFile *pgfile, KBTreeValue *valp, size_t size, uint32_t *chunk )
-{
-    /* give return parameter a type */
-    KBTreeValueImpl *val = ( KBTreeValueImpl* ) valp;
-
-    rc_t rc;
-    KPage *page;
-    uint32_t new_root;
-    KStreamNode *node;
-    uint64_t start, end, chunk_mask;
-    uint64_t num_pages, virt_eof;
-
-    /* chunk parameter can be NULL */
-    uint32_t dummy;
-    if ( chunk == NULL )
-        chunk = & dummy;
-
-    /* we're static - these should be okay */
-    assert ( self != NULL );
-    assert ( pgfile != NULL );
-    assert ( val != NULL );
-
-    /* check against size constraint */
-    if ( size < self -> min_size || size > self -> max_size )
-        return RC ( rcDB, rcFile, rcAllocating, rcConstraint, rcViolated );
-
-    /* calcuate starting offset */
-    chunk_mask = self -> chunk_bytes - 1;
-    if ( self -> page_adj != 0 )
-    {
-        /* this is a case where the chunking is not a power of two
-           which is generally used only for fixed sized elements.
-           the case is that a single data page will not completely
-           fill with an integral number of elements, leaving an amount
-           in "page_adj" for each page used.
-
-           for simplicity, the actual eof is converted to a virtual
-           eof by imagining contiguous storage, subtracting off the
-           page adjust for each page used.
-
-           the chunk alignment is then performed against the virtual
-           eof, giving a new start offset which is finally converted
-           back to actual space by adding in an adjustment for each
-           page used.
-        */
-        
-        num_pages = self -> eof >> PGBITS;
-        virt_eof = self -> eof - num_pages * self -> page_adj; 
-        start = virt_eof + chunk_mask;
-        start -= start % ( chunk_mask + 1 );
-        if ( ( ( start / self -> chunk_bytes ) >> 32 ) != 0 )
-            return RC ( rcDB, rcFile, rcAllocating, rcId, rcExhausted );
-        * chunk = start / self -> chunk_bytes;
-        start += ( start / ( PGSIZE - self -> page_adj ) ) * self -> page_adj;
-    }
-    else
-    {
-        /* this is the general case where chunk size is a nice power of 2 */
-        assert ( ( self -> chunk_bytes & ( self -> chunk_bytes - 1 ) ) == 0 );
-        start = ( self -> eof + chunk_mask ) & ~ chunk_mask;
-        if ( ( ( start / self -> chunk_bytes ) >> 32 ) != 0 )
-            return RC ( rcDB, rcFile, rcAllocating, rcId, rcExhausted );
-        * chunk = start / self -> chunk_bytes;
-    }
-
-    end = start + size + self -> size_bytes;
-
-    /* detect need to go to next page */
-    if ( ( start >> PGBITS ) != ( ( end - 1 ) >> PGBITS ) )
-    {
-        start = ( start + PGSIZE - 1 ) & ~ ( uint64_t ) ( PGSIZE - 1 );
-        end = start + size;
-        assert ( ( start >> PGBITS ) == ( ( end - 1 ) >> PGBITS ) );
-
-        /* reassign chunk */
-        if ( self -> page_adj != 0 )
-        {
-            num_pages = start >> PGBITS;
-            virt_eof = start - num_pages * self -> page_adj; 
-            virt_eof += chunk_mask;
-            virt_eof -= virt_eof % ( chunk_mask + 1 );
-            if ( ( ( virt_eof / self -> chunk_bytes ) >> 32 ) != 0 )
-                return RC ( rcDB, rcFile, rcAllocating, rcId, rcExhausted );
-            * chunk = virt_eof / self -> chunk_bytes;
-        }
-        else
-        {
-            * chunk = start / self -> chunk_bytes;
-        }
-    }
-
-    /* CASE 1 - stream is empty or has single data page */
-    if ( end <= PGSIZE )
-    {
-        /* return data page reference in "val" */
-        if ( self -> root == 0 )
-            /* create initial root data page */
-            rc = KPageFileAlloc ( pgfile, & val -> page, & self -> root );
-        else
-            /* access existing page */
-            rc = KPageFileGet ( pgfile, & val -> page, self -> root );
-    }
-    /* CASE 2 - conversion from data to node page */
-    else if ( self -> eof <= PGSIZE )
-    {
-        /* create new root */
-        rc = KPageFileAlloc ( pgfile, & page, & new_root );
-        if ( rc == 0 )
-        {
-            rc = page_access_update ( page, ( void** ) & node );
-            if ( rc == 0 )
-            {
-                /* put old root in slot 0 */
-                node -> page [ 0 ] = self -> root;
-
-                /* create new data page, returning reference in "val" */
-                rc = KPageFileAlloc ( pgfile, & val -> page, & node -> page [ 1 ] );
-                if ( rc == 0 )
-
-                    /* update root */
-                    self -> root = new_root;
-            }
-
-            /* release new root page */
-            KPageRelease ( page );
-        }
-    }
-    /* root is a node page and eof > PGSIZE, node_size */
-    else
-    {
-        /* bytes currently represented by root node */
-        uint64_t slot_size = PGSIZE;
-        while ( self -> eof > slot_size )
-            slot_size <<= SNBITS;
-
-        /* CASE 3 - create a new root page due to overflow at this level */
-        rc = 0;
-        if ( end > slot_size )
-        {
-            /* create a new root as before */
-            rc = KPageFileAlloc ( pgfile, & page, & new_root );
-            if ( rc == 0 )
-            {
-                rc = page_access_update ( page, ( void** ) & node );
-                if ( rc == 0 )
-                {
-                    /* put old root in slot 0 */
-                    node -> page [ 0 ] = self -> root;
-
-                    /* update root */
-                    self -> root = new_root;
-
-                    /* root size is now much bigger */
-                    slot_size <<= SNBITS;
-                }
-                
-                KPageRelease ( page );
-            }
-        }
-        if ( rc == 0 )
-        {
-            bool done;
-            uint32_t page_id, slot_id;
-
-            /* convert to size represented by each slot */
-            slot_size >>= SNBITS;
-
-            /* slot number
-               NB - "end" has been modified to point AT last byte */
-            slot_id = ( uint32_t ) ( -- end / slot_size );
-
-            for ( done = false, page_id = self -> root; rc == 0 && ! done; )
-            {
-                rc = KPageFileGet ( pgfile, & page, page_id );
-                if ( rc == 0 )
-                {
-                    const KStreamNode *cnode;
-                    rc = page_access_read ( page, ( const void** ) & cnode );
-                    if ( rc == 0 )
-                    {
-                        /* slots hold data pages */
-                        if ( slot_size == PGSIZE )
-                        {
-                            /* return reference to page in "val" */
-                            if ( cnode -> page [ slot_id ] != 0 )
-                                rc = KPageFileGet ( pgfile, & val -> page, cnode -> page [ slot_id ] );
-                            else
-                            {
-                                rc = page_access_update ( page, ( void** ) & node );
-                                if ( rc == 0 )
-                                    rc = KPageFileAlloc ( pgfile, & val -> page, & node -> page [ slot_id ] );
-                            }
-                            done = true;
-                        }
-
-                        /* slots hold node pages */
-                        else
-                        {
-                            /* look for empty node slot */
-                            if ( cnode -> page [ slot_id ] == 0 )
-                            {
-                                /* make current node writable */
-                                rc = page_access_update ( page, ( void** ) & node );
-                                if ( rc == 0 )
-                                {
-                                    /* allocate a new child */
-                                    KPage *newpage;
-                                    rc = KPageFileAlloc ( pgfile, & newpage, & node -> page [ slot_id ] );
-                                    if ( rc == 0 )
-                                        KPageRelease ( newpage );
-                                }
-                            }
-
-                            /* retrieve child node page id */
-                            page_id = cnode -> page [ slot_id ];
-
-                            /* convert end to offset within child */
-                            end %= slot_size;
-
-                            /* convert slot_size to child slot_size */
-                            slot_size >>= SNBITS;
-
-                            /* new slot_id within child */
-                            slot_id = ( uint32_t ) ( end / slot_size );
-                        }
-                    }
-
-                    KPageRelease ( page );
-                }
-            }
-        }
-    }
-
-    /* finish the value */
-    if ( rc == 0 )
-    {
-        self -> eof = start + size + self -> size_bytes;
-
-        if ( self -> size_bytes != 0 )
-        {
-            uint8_t *mem;
-
-            /* access the node data for update */
-            assert ( val -> page != NULL );
-            rc = page_access_update ( val -> page, ( void** ) & mem );
-
-            /* store the size if variable */
-            mem += start & ( PGSIZE - 1 );
-            switch ( self -> size_bytes )
-            {
-            case 1:
-                mem [ 0 ] = ( uint8_t ) size;
-                break;
-            case 2:
-                ( ( uint16_t* ) mem ) [ 0 ] = ( uint16_t ) size;
-                break;
-            case 4:
-                ( ( uint32_t* ) mem ) [ 0 ] = ( uint32_t ) size;
-                break;
-            }
-        }
-
-        /* record the page offset to DATA and data size */
-        val -> offset = ( ( uint32_t ) start + self -> size_bytes ) & ( PGSIZE - 1 );
-        val -> size = size;
-
-        return 0;
-    }
-
-    * chunk = 0;
-    memset ( val, 0, sizeof * val );
-    return rc;
-}
-
-
-/* Get
- *  retrieve data from stream
- *
- *  there are N cases to handle within this function
- *
- *  1. chunk not contained within stream
- *  2. root page is data
- *  3. root page is node
- */
-static
-rc_t KPageFileStreamGet ( const KPageFileStream *self, KPageFile *pgfile, KBTreeValue *valp, uint32_t chunk )
-{
-    KBTreeValueImpl *val = ( KBTreeValueImpl* ) valp;
-
-    rc_t rc;
-    uint64_t start, num_pages;
-
-    assert ( self != NULL );
-    assert ( val != NULL );
-    assert ( self -> eof == 0 || self -> root != 0 );
-
-    /* convert chunk into byte offset */
-    start = ( uint64_t ) chunk * self -> chunk_bytes;
-    num_pages = start / ( PGSIZE - self -> page_adj );
-    start += num_pages * self -> page_adj;
-
-    /* CASE 1 - chunk is not in stream */
-    if ( start >= self -> eof )
-        rc = RC ( rcDB, rcFile, rcReading, rcData, rcNotFound );
-
-    /* CASE 2 - root page is data */
-    else if ( self -> eof <= PGSIZE )
-        rc = KPageFileGet ( pgfile, & val -> page, self -> root );
-
-    /* CASE 3 - root page is node */
-    else
-    {
-        bool done;
-        uint32_t pgid;
-        uint32_t shift_bits;
-        uint64_t slot_id = ( self -> eof - 1 ) >> PGBITS;
-
-        /* determine CURRENT root node status */
-        uint64_t slot_size;
-        for ( shift_bits = PGBITS, slot_size = PGSIZE; slot_id >= SNSIZE; slot_id >>= SNBITS, shift_bits += SNBITS )
-            slot_size <<= SNBITS;
-
-        /* now generate slot_id */
-        slot_id = start >> shift_bits;
-
-        for ( rc = 0, pgid = self -> root, done = false; rc == 0 && ! done; )
-        {
-            KPage *page;
-            rc = KPageFileGet ( pgfile, & page, pgid );
-            if ( rc == 0 )
-            {
-                const KStreamNode *cnode;
-                rc = page_access_read ( page, ( const void** ) & cnode );
-                if ( rc == 0 )
-                {
-                    assert ( cnode -> page [ slot_id ] != 0 );
-                    if ( slot_size <= PGSIZE )
-                    {
-                        rc = KPageFileGet ( pgfile, & val -> page, cnode -> page [ slot_id ] );
-                        done = true;
-                    }
-                    else
-                    {
-                        pgid = cnode -> page [ slot_id ];
-                        slot_size >>= SNBITS;
-                        slot_id = ( start / slot_size ) & ( SNSIZE - 1 );
-                    }
-                }
-
-                KPageRelease ( page );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        const uint8_t *mem;
-
-        /* access the node data for update */
-        assert ( val -> page != NULL );
-        rc = page_access_read ( val -> page, ( const void** ) & mem );
-
-        /* store the size if variable */
-        mem += start & ( PGSIZE - 1 );
-        switch ( self -> size_bytes )
-        {
-        case 0:
-            val -> size = self -> max_size;
-            break;
-        case 1:
-            val -> size = mem [ 0 ];
-            break;
-        case 2:
-            val -> size = ( ( const uint16_t* ) mem ) [ 0 ];
-            break;
-        case 4:
-            val -> size = ( ( const uint32_t* ) mem ) [ 0 ];
-            break;
-        }
-
-        /* record the page offset to DATA */
-        val -> offset = ( ( uint32_t ) start + self -> size_bytes ) & ( PGSIZE - 1 );
-
-        return 0;
-    }
-
-    memset ( val, 0, sizeof * val );
-    return rc;
-}
-
-#endif /* BTREE_KEY2ID */
-
-
-/*--------------------------------------------------------------------------
- * KBTree
- *  this implementation is an extremely simplified structure
- *  meant to provide the ability to create an index for temporary use
- */
-#define eByteOrderTag 0x05031988
-#define eByteOrderReverse 0x88190305
-
-#if ! BTREE_KEY2ID
-
-/* v1 stores keys in a stream */
-typedef struct KBTreeHdr_v1 KBTreeHdr_v1;
-struct KBTreeHdr_v1
-{
-    /* streams of data */
-    KPageFileStream key_stream;
-    KPageFileStream val_stream;
-
-    /* only type [ 0 ] is used - rest are for alignment */
-    KBTreeKeyType type [ 4 ];
-
-    /* tree root */
-    uint32_t root;
-
-    /* next to last */
-    uint32_t version;
-
-    /* last */
-    uint32_t endian;
-};
-
-/* v2 does not have a key stream, but keeps the size */
-typedef struct KBTreeHdr_v2 KBTreeHdr_v2;
-struct KBTreeHdr_v2
-{
-    /* data stream */
-    KPageFileStream val_stream;
-
-    /* key min/max */
-    uint16_t key_min, key_max;
-
-    /* type [ 0 ] is type
-       type [ 1 ] is non-zero if comparison function was used
-       rest are for alignment */
-    KBTreeKeyType type [ 4 ];
-
-    /* tree root */
-    uint32_t root;
-
-    /* next to last */
-    uint32_t version;
-
-    /* last */
-    uint32_t endian;
-};
-
-#endif /* ! BTREE_KEY2ID */
-
-/* v3 does not store values, but stores keys in node pages */
-typedef struct KBTreeHdr_v3 KBTreeHdr_v3;
-struct KBTreeHdr_v3
-{
-    /* last entry id */
-    uint32_t id_seq;
-
-    /* key min/max */
-    uint16_t key_min, key_max;
-
-    /* type [ 0 ] is type
-       type [ 1 ] is non-zero if comparison function was used
-       rest are for alignment */
-    KBTreeKeyType type [ 4 ];
-
-    /* tree root */
-    uint32_t root;
-
-    /* next to last */
-    uint32_t version;
-
-    /* last */
-    uint32_t endian;
-};
-
-#if BTREE_KEY2ID
-typedef struct KBTreeHdr_v3 KBTreeHdr;
-#else
-typedef struct KBTreeHdr_v2 KBTreeHdr;
-#endif
-
-
-static
-rc_t KBTreeReadHeader ( KBTreeHdr *hdr, const KFile *f )
-{
-    uint64_t eof;
-    rc_t rc = KFileSize ( f, & eof );
-    if ( rc == 0 )
-    {
-        size_t num_read;
-
-        /* this would be an empty file */
-        if ( eof == 0 )
-        {
-            memset ( hdr, 0, sizeof * hdr );
-            return RC ( rcDB, rcTree, rcConstructing, rcData, rcNotFound );
-        }
-
-        if ( eof < sizeof * hdr )
-            return RC ( rcDB, rcTree, rcConstructing, rcData, rcCorrupt );
-
-        rc = KFileReadAll ( f, eof - sizeof * hdr, hdr, sizeof * hdr, & num_read );
-        if ( rc == 0 && num_read != sizeof * hdr )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcData, rcInsufficient );
-        if ( rc == 0 )
-        {
-            if ( hdr -> endian != eByteOrderTag )
-            {
-                if ( hdr -> endian == eByteOrderReverse )
-                    return RC ( rcDB, rcTree, rcConstructing, rcByteOrder, rcIncorrect );
-                return RC ( rcDB, rcTree, rcConstructing, rcData, rcCorrupt );
-            }
-            if ( hdr -> version != 2 )
-                return RC ( rcDB, rcTree, rcConstructing, rcHeader, rcBadVersion );
-        }
-    }
-    return rc;
-}
-
-struct KBTree
-{
-    /* file itself */
-    KFile *file;
-
-    /* page cache layered on top */
-    KPageFile *pgfile;
-
-    /* comparison function */
-    KBTreeCompareFunc cmp;
-
-    /* "header" is stored at end */
-    KBTreeHdr hdr;
-
-    KRefcount refcount;
-
-    bool read_only;
-};
-
-typedef struct KBTreeSrchWindow{
-   uint16_t	lower;
-   uint16_t	upper;
-} KBTreeSrchWindow;
-
-
-/* the leaf node works out naturally to be an odd count
-   which is needed for splitting at the median. so we
-   let a leaf fill, then split before further insert */
-#define LNSIZE ( ( PGSIZE - 2 ) / 8 )
-#define LNMEDIAN ( LNSIZE / 2 )
-#define LNHALF ( LNSIZE / 2 )
-
-typedef struct KBTreeLeafNode_v1 KBTreeLeafNode_v1;
-struct KBTreeLeafNode_v1
-{
-    uint32_t key [ LNSIZE ];
-    uint32_t val [ LNSIZE ];
-    uint16_t count;
-};
-
-typedef struct KBTreeLeafEntry_v2 KBTreeLeafEntry_v2;
-struct KBTreeLeafEntry_v2
-{
-    uint16_t key;
-    uint16_t ksize;
-};
-
-typedef struct KBTreeLeafNode_v2 KBTreeLeafNode_v2;
-struct KBTreeLeafNode_v2
-{
-    uint16_t key_prefix;       /*** prefix offset into the blob ***/
-    uint16_t key_prefix_len;   /*** length of the prefix ***/
-    KBTreeSrchWindow   win[256]; /*** search windows for first letter of the key ***/
-    uint16_t count;	       /*** number of elements **/
-    uint16_t key_bytes;        /*** bytes used for storing keys ***/
-    KBTreeLeafEntry_v2 ord [ ( PGSIZE - 8 - 256 * sizeof(KBTreeSrchWindow)) / sizeof ( KBTreeLeafEntry_v2 ) ];
-};
-
-typedef struct KBTreeLeafEntry_v2 KBTreeLeafEntry;
-
-
-/* the branch node works out to be an even key count
-   which means that we also split before insert when
-   full, but the split leaves the target insert side
-   light, corrected immediately with an insert */
-#define BRSIZE ( ( PGSIZE - 2 - 4 ) / 12 )
-
-typedef struct KBTreeBranchNode_v1 KBTreeBranchNode_v1;
-struct KBTreeBranchNode_v1
-{
-    uint32_t key [ BRSIZE ];
-    uint32_t val [ BRSIZE ];
-    uint32_t trans [ BRSIZE + 1 ];
-    uint16_t count;
-};
-
-typedef struct KBTreeBranchEntry_v2 KBTreeBranchEntry_v2;
-struct KBTreeBranchEntry_v2
-{
-    uint16_t key;
-    uint16_t ksize;
-    uint32_t trans;
-};
-
-typedef struct KBTreeBranchNode_v2 KBTreeBranchNode_v2;
-struct KBTreeBranchNode_v2
-{
-    uint16_t key_prefix;       /*** offset into the blob ***/
-    uint16_t key_prefix_len;   /*** length of the prefix ***/
-    KBTreeSrchWindow   win[256]; /*** search windows for first letter of the key ***/
-    /* the exact structure here is important:
-       "ltrans" will be accessed as node -> ord [ -1 ] . trans */
-    uint16_t count;
-    uint16_t key_bytes;
-    
-    uint32_t ltrans;
-    KBTreeBranchEntry_v2 ord [ ( PGSIZE - 12 - 256 * sizeof(KBTreeSrchWindow) ) / sizeof ( KBTreeBranchEntry_v2 ) ];
-};
-
-typedef struct KBTreeBranchEntry_v2 KBTreeBranchEntry;
-
-typedef struct KBTreeLeafNode_v2 KBTreeLeafNode;
-typedef struct KBTreeBranchNode_v2 KBTreeBranchNode;
-
-/* when keys are stored in pages, the max key size
-   will be such that some number of keys are guaranteed to fit */
-#define MIN_KEY_COUNT 2
-#define MAX_KEY_SIZE \
-    (( PGSIZE - 12 - 256 * sizeof(KBTreeSrchWindow)   - \
-        MIN_KEY_COUNT * ( sizeof ( KBTreeBranchEntry_v2 ) + sizeof ( uint32_t ) ) \
-        ) / MIN_KEY_COUNT )
-
-
-
-#if _DEBUGGING 
-#define VALIDATE_SEARCH_WINDOW 0
-#endif
-
-#if VALIDATE_SEARCH_WINDOW
-static
-bool validate_search_window(KBTreeSrchWindow *win)
-{
-	int i;
-	if(win[0].lower != 0) return false;
-	for(i=0;i<255;i++){
-		if(win[i+1].lower != win[i].upper) return false;
-	}
-	return true;
-}
-#else
-#define validate_search_window(A) true
-#endif
-
-/* Whack
- */
-static
-rc_t KBTreeWhack ( KBTree *self )
-{
-    if ( self -> read_only || self -> file == NULL )
-        KPageFileRelease ( self -> pgfile );
-    else
-    {
-        size_t num_writ;
-
-        /* request page file size */
-        uint64_t eof;
-        rc_t rc = KPageFileSize ( self -> pgfile, & eof, NULL, NULL );
-        if ( rc != 0 )
-            return rc;
-
-        /* drop the page file and its cache */
-        KPageFileRelease ( self -> pgfile );
-
-        /* write header to tail */        
-        rc = KFileWrite ( self -> file, eof, & self -> hdr, sizeof self -> hdr, & num_writ );
-        if ( rc == 0 && num_writ != sizeof self -> hdr )
-            rc = RC ( rcDB, rcTree, rcPersisting, rcTransfer, rcIncomplete );
-        if ( rc == 0 )
-            rc = KFileSetSize ( self -> file, eof + sizeof self -> hdr );
-        if ( rc != 0 )
-        {
-            /* TBD - can issue a warning here */
-        }
-    }
-
-    KFileRelease ( self -> file );
-    free ( self );
-    return 0;
-}
-
-
-/* MakeRead
- * MakeUpdate
- *  make a b-tree object backed by supplied KFile
- *
- *  "backing" [ IN ] - open file with read permissions.
- *   NB - a reference will be attached to this file.
- *
- *  "climit" [ IN ] - cache limit in bytes. the internal cache will
- *   retain UP TO ( but not exceeding ) the limit specified. a value
- *   of 0 ( zero ) will disable caching.
- *
- *  "cmp" [ IN, NULL OKAY ] - optional comparison callback function for opaque keys.
- *   specific key types will use internal comparison functions. for opaque keys, a
- *   NULL function pointer will cause ordering by size and binary comparison.
- */
-LIB_EXPORT rc_t CC KBTreeMakeRead ( const KBTree **btp,
-    const KFile *backing, size_t climit, KBTreeCompareFunc cmp )
-{
-    rc_t rc;
-
-    if ( btp == NULL )
-        rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( backing == NULL )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcFile, rcNull );
-        else
-        {
-            KBTree *bt = malloc ( sizeof * bt );
-            if ( bt == NULL )
-                rc = RC ( rcDB, rcTree, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KBTreeReadHeader ( & bt -> hdr, backing );
-                if ( rc == 0 )
-                {
-                    rc = KFileAddRef ( backing );
-                    if ( rc == 0 )
-                    {
-                        /* create page file */
-                        rc = KPageFileMakeRead ( ( const KPageFile** ) & bt -> pgfile, backing, climit );
-                        if ( rc == 0 )
-                        {
-                            /* ready to go */
-                            bt -> file = ( KFile* ) backing;
-                            if ( bt -> hdr . type [ 1 ] )
-                                bt -> cmp = cmp;
-                            KRefcountInit ( & bt -> refcount, 1, "KBTree", "make-read", "btree" );
-                            bt -> read_only = true;
-
-                            * btp = bt;
-                            return 0;
-                        }
-
-                        KFileRelease ( backing );
-                    }
-                }
-
-                free ( bt );
-            }
-        }
-
-        * btp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* MakeUpdate
- *  make a b-tree object backed by supplied KFile
- *
- *  "backing" [ IN ] - open file with read & write permissions.
- *   NB - a reference will be attached to this file.
- *
- *  "climit" [ IN ] - cache limit in bytes. the internal cache will
- *   retain UP TO ( but not exceeding ) the limit specified. a value
- *   of 0 ( zero ) will disable caching.
- *
- *  "write_through" [ IN ] - if true, causes flushing of modified page
- *   after its value is released
- *
- *  "type" [ IN ] - describes the key type ( see above )
- *
- *  "key_chunk_size" [ IN ] - the "chunking" ( alignment ) factor for
- *   storing keys, rounded up to the nearest power of 2.
- *
- *  "value_chunk_size" [ IN ] - chunking factor for values
- *   ( see "key_chunk_size" )
- *
- *  "min_key_size" [ IN ] and "max_key_size" [ IN ] - specifies the allowed
- *   opaque key sizes. min == max implies fixed size. ignored for well
- *   known fixed size key types.
- *
- *  "min_value_size" [ IN ] and "max_value_size" [ IN ] - specifies the allowed
- *   value sizes. min == max implies fixed size.
- *
- *  "cmp" [ IN ] - comparison callback function for opaque keys.
- */
-#if BTREE_KEY2ID
-LIB_EXPORT rc_t CC KBTreeMakeUpdate ( KBTree **btp, KFile *backing,
-    size_t climit, bool write_through, KBTreeKeyType type,
-    size_t min_key_size, size_t max_key_size, size_t id_size,
-    KBTreeCompareFunc cmp )
-#else
-LIB_EXPORT rc_t CC KBTreeMakeUpdate ( KBTree **btp, KFile *backing,
-    size_t climit, bool write_through, KBTreeKeyType type,
-    size_t key_chunk_size, size_t value_chunk_size,
-    size_t min_key_size, size_t max_key_size,
-    size_t min_value_size, size_t max_value_size,
-    KBTreeCompareFunc cmp )
-#endif
-{
-    rc_t rc;
-
-    if ( btp == NULL )
-        rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( type >= kbtLastDefined )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcType, rcUnrecognized );
-        else if ( min_key_size == 0 )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcInvalid );
-        else if ( max_key_size > MAX_KEY_SIZE )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcExcessive );
-        else if ( min_key_size > max_key_size )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcInconsistent );
-#if BTREE_KEY2ID && ! BTREE_KEY2ID64
-        else if ( id_size != sizeof ( uint32_t ) )
-            rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcInvalid );
-#endif
-        else
-        {
-            KBTree *bt = calloc ( 1,sizeof * bt );
-            if ( bt == NULL )
-                rc = RC ( rcDB, rcTree, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                if ( backing == NULL || ( rc = KBTreeReadHeader ( & bt -> hdr, backing )) == 0 || GetRCState ( rc ) == rcNotFound )
-                {
-                    /* detect empty file */
-                    if ( bt -> hdr . version == 0 )
-                    {
-#if BTREE_KEY2ID
-                        assert ( bt -> hdr . id_seq == 0 );
-#else
-                        KPageFileStreamInit ( & bt -> hdr . val_stream, min_value_size, max_value_size, value_chunk_size );
-#endif
-                        bt -> hdr . type [ 0 ] = type;
-                        bt -> hdr . type [ 1 ] = cmp != NULL;
-                        bt -> hdr . key_min = ( uint16_t ) min_key_size;
-                        bt -> hdr . key_max = ( uint16_t ) max_key_size;
-#if BTREE_KEY2ID
-                        bt -> hdr . version = 3;
-#else
-                        bt -> hdr . version = 2;
-#endif
-                        bt -> hdr . endian = eByteOrderTag;
-                        rc = 0;
-                    }
-                    else
-                    {
-                        /* check for parameter equivalence */
-#if BTREE_KEY2ID
-                        if ( bt -> hdr . version < 3 )
-#else
-                        if ( bt -> hdr . version < 2 )
-#endif
-                            rc = RC ( rcDB, rcTree, rcConstructing, rcHeader, rcBadVersion );
-                        else if ( bt -> hdr . key_min > min_key_size || bt -> hdr . key_max < max_key_size )
-                            rc = RC ( rcDB, rcTree, rcConstructing, rcParam, rcInconsistent );
-                        else
-#if ! BTREE_KEY2ID
-                            rc = KPageFileStreamCheck ( & bt -> hdr . val_stream, min_value_size, max_value_size, value_chunk_size );
-#endif
-                        if ( rc == 0 && bt -> hdr . type [ 0 ] != type )
-                            rc = RC ( rcDB, rcTree, rcConstructing, rcType, rcInconsistent );
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        if(backing) rc = KFileAddRef ( backing );
-                        if ( rc == 0 )
-                        {
-                            /* create page file */
-                            rc = KPageFileMakeUpdate ( & bt -> pgfile, backing, climit, write_through );
-                            if ( rc == 0 )
-                            {
-                                /* ready to go */
-                                bt -> file = backing;
-                                if ( ! bt -> hdr . type [ 1 ] )
-                                    bt -> cmp = NULL;
-                                else
-                                    bt -> cmp = cmp;
-                                KRefcountInit ( & bt -> refcount, 1, "KBTree", "make-update", "btree" );
-                                bt -> read_only = false;
-
-                                * btp = bt;
-                                return 0;
-                            }
-
-                            if(backing) KFileRelease ( backing );
-                        }
-                    }
-                }
-
-                free ( bt );
-            }
-        }
-
-        * btp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KBTreeAddRef ( const KBTree *self )
-{
-    if ( self != NULL ) switch ( KRefcountAdd ( & self -> refcount, "KBTree" ) )
-    {
-    case krefOkay:
-        break;
-    default:
-        return RC ( rcDB, rcTree, rcAttaching, rcConstraint, rcViolated );
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KBTreeRelease ( const KBTree *self )
-{
-    if ( self != NULL ) switch ( KRefcountDrop ( & self -> refcount, "KBTree" ) )
-    {
-    case krefOkay:
-        break;
-    case krefWhack:
-        return KBTreeWhack ( ( KBTree* ) self );
-    default:
-        return RC ( rcDB, rcTree, rcReleasing, rcConstraint, rcViolated );
-    }
-    return 0;
-}
-
-
-/* DropBacking
- *  used immediately prior to releasing
- *  prevents modified pages from being flushed to disk
- *  renders object nearly useless
- */
-LIB_EXPORT rc_t CC KBTreeDropBacking ( KBTree *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTree, rcDetaching, rcSelf, rcNull );
-
-    rc = KPageFileDropBacking ( self -> pgfile );
-    if ( rc == 0 )
-    {
-        rc = KFileRelease ( self -> file );
-        if ( rc == 0 )
-            self -> file = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Size
- *  returns size in bytes of file and cache
- *
- *  "lsize" [ OUT, NULL OKAY ] - return parameter for logical size
- *
- *  "fsize" [ OUT, NULL OKAY ] - return parameter for file size
- *
- *  "csize" [ OUT, NULL OKAY ] - return parameter for cache size
- */
-LIB_EXPORT rc_t CC KBTreeSize ( const KBTree *self,
-    uint64_t *lsize, uint64_t *fsize, size_t *csize )
-{
-    size_t dummysz;
-    uint64_t dummy64;
-
-    if ( self != NULL )
-        return KPageFileSize ( self -> pgfile, lsize, fsize, csize );
-
-    if ( lsize == NULL )
-        lsize = & dummy64;
-    if ( fsize == NULL )
-        fsize = & dummy64;
-    if ( csize == NULL )
-        csize = & dummysz;
-
-    * lsize = 0;
-    * fsize = 0;
-    * csize = 0;
-
-    return RC ( rcDB, rcTree, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* Find
- *  searches for a match
- *
- *  "val" [ OUT ] - return parameter for value found
- *   accessed via KBTreeValueAccess* described above
- *   must be balanced with a call to KBTreeValueWhack.
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- */
-
-static __inline__
-int compare_keys ( const KBTree *self, const void *query, size_t qsize, const void *key, size_t key_size )
-{
-    if ( self -> cmp != NULL )
-        return ( * self -> cmp ) ( query, qsize, key, key_size );
-    else {
-	int csize = (qsize < key_size) ? qsize : key_size;
-	int diff = memcmp ( query, key, csize);
-	if(diff == 0)
-		return qsize-key_size;
-	return diff;
-    }
-}
-
-#if BTREE_KEY2ID
-static
-rc_t leaf_find ( const KBTree *self, const KPage *page,
-    uint32_t *id, const void *query, size_t qsize )
-#else
-static
-rc_t leaf_find ( const KBTree *self, const KPage *page,
-    KBTreeValue *val, const void *query, size_t qsize )
-#endif
-{
-    int lower, upper;
-    const uint8_t *query_8 = query;
-    uint16_t	q;
-
-    const KBTreeLeafNode *cnode;
-    rc_t rc = page_access_read ( page, ( const void** ) & cnode );
-    if ( rc != 0 )
-        return rc;
-    if(cnode->key_prefix_len > 0){
-    	const size_t key_prefix_len=cnode->key_prefix_len;
- 	/*** prefix must match ***/	
-        assert(compare_keys(self,query,key_prefix_len, ((char *)cnode )+cnode->key_prefix,key_prefix_len) == 0);
-	/*************************/
-	query_8 += key_prefix_len;
-	qsize   -= key_prefix_len;
-    }
-
-    /* perform search on branch node */
-    q = (qsize > 0)?*query_8:0;
-    for ( lower = cnode->win[q].lower, upper = cnode -> win[q].upper; lower < upper; )
-    {
-        /* determine the slot to examine */
-        int slot = ( lower + upper ) >> 1;
-
-        /* perform comparison */
-        const uint8_t *key = & ( ( const uint8_t* ) cnode ) [ cnode -> ord [ slot ] . key ];
-        int diff = compare_keys ( self, query_8, qsize, key , cnode -> ord [ slot ] . ksize);
-        if ( diff == 0 )
-        {
-            uint32_t val_id = * ( const uint32_t* ) & key [ cnode -> ord [ slot ] . ksize ];
-#if BTREE_KEY2ID
-            * id = val_id;
-            return 0;
-#else
-            return KPageFileStreamGet ( & self -> hdr . val_stream, self -> pgfile, val, val_id );
-#endif
-        }
-        if ( diff < 0 )
-            upper = slot;
-        else
-            lower = slot + 1;
-    }
-
-    return RC ( rcDB, rcTree, rcSelecting, rcItem, rcNotFound );
-}
-
-#if BTREE_KEY2ID
-static
-rc_t branch_find ( const KBTree *self, const KPage *page,
-    uint32_t *id, const void *query, size_t qsize )
-#else
-static
-rc_t branch_find ( const KBTree *self, const KPage *page,
-    KBTreeValue *val, const void *query, size_t qsize )
-#endif
-{
-    int lower, upper;
-    const uint8_t *query_8 = query;
-    size_t  qsize_8 = qsize;
-    uint16_t q;
-    KPage *child;
-    uint32_t nid;
-
-    const KBTreeBranchNode *cnode;
-    rc_t rc = page_access_read ( page, ( const void** ) & cnode );
-    if ( rc != 0 )
-        return rc;
-    if(cnode->key_prefix_len > 0){
-        const size_t key_prefix_len=cnode->key_prefix_len;
- 	/*** prefix must match ***/	
-        assert(compare_keys(self,query,key_prefix_len, ((char *)cnode )+cnode->key_prefix,key_prefix_len) == 0);
-	/*************************/
-	query_8 += key_prefix_len;
-        qsize_8 -= key_prefix_len;
-    }
-    /* perform search on branch node */
-    q = (qsize_8 > 0)?*query_8:0;
-    for ( lower = cnode->win[q].lower, upper = cnode -> win[q].upper; lower < upper; )
-    {
-        /* determine the slot to examine */
-        int slot = ( lower + upper ) >> 1;
-
-        /* perform comparison */
-        const uint8_t *key = & ( ( const uint8_t* ) cnode ) [ cnode -> ord [ slot ] . key ];
-        int diff = compare_keys ( self, query_8, qsize_8, key , cnode -> ord [ slot ] . ksize );
-        if ( diff == 0 )
-        {
-            uint32_t val_id = * ( const uint32_t* ) & key [ cnode -> ord [ slot ] . ksize ];
-#if BTREE_KEY2ID
-            * id = val_id;
-            return 0;
-#else
-            return KPageFileStreamGet ( & self -> hdr . val_stream, self -> pgfile, val, val_id );
-#endif
-        }
-        if ( diff < 0 )
-            upper = slot;
-        else
-            lower = slot + 1;
-    }
-    /* should have the last slot tried ( < 0 ) or next slot to try ( > 0 ) */
-    assert ( lower == upper );
-
-    /* the node id is left-shifted by 1 and has the "branch-bit" indicator
-       in the LSB. the remaining bits should NOT be zero */
-    /* NB - if "upper" is 0 and type is signed,
-       this will access entry -1, giving "ltrans" */
-    nid = cnode -> ord [ upper - 1 ] . trans;
-    assert ( ( nid >> 1 ) != 0 );
-
-    /* access child node */
-    rc = KPageFileGet ( self -> pgfile, & child, nid >> 1 );
-    if ( rc == 0 )
-    {
-        rc = ( ( ( nid & 1 ) == 0 ) ? leaf_find : branch_find )
-#if BTREE_KEY2ID
-            ( self, child, id, query, qsize );
-#else
-            ( self, child, val, query, qsize );
-#endif
-
-        KPageRelease ( child );
-    }
-
-    return rc;
-}
-
-
-#if BTREE_KEY2ID
-LIB_EXPORT rc_t CC KBTreeFind ( const KBTree *self, uint64_t *id,
-    const void *key, size_t key_size )
-#else
-LIB_EXPORT rc_t CC KBTreeFind ( const KBTree *self, KBTreeValue *val,
-    const void *key, size_t key_size )
-#endif
-{
-    rc_t rc;
-
-#if BTREE_KEY2ID
-    if ( id == NULL )
-#else
-    if ( val == NULL )
-#endif
-        rc = RC ( rcDB, rcTree, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTree, rcSelecting, rcSelf, rcNull );
-        else if ( key_size == 0 )
-            rc = RC ( rcDB, rcTree, rcSelecting, rcParam, rcEmpty );
-        else if ( key == NULL )
-            rc = RC ( rcDB, rcTree, rcSelecting, rcParam, rcNull );
-        else if ( self -> hdr . root == 0 )
-            rc = RC ( rcDB, rcTree, rcSelecting, rcItem, rcNotFound );
-        else
-        {
-            /* bring in root page */
-            KPage *page;
-            rc = KPageFileGet ( self -> pgfile, & page, self -> hdr . root >> 1 );
-            if ( rc == 0 )
-            {
-#if BTREE_KEY2ID && ! BTREE_KEY2ID64
-                uint32_t id32;
-#endif
-                rc = ( ( ( self -> hdr . root & 1 ) == 0 ) ? leaf_find : branch_find )
-#if BTREE_KEY2ID64
-                    ( self, page, id, key, key_size );
-#elif BTREE_KEY2ID
-                    ( self, page, & id32, key, key_size );
-#else
-                    ( self, page, val, key, key_size );
-#endif
-#if BTREE_KEY2ID && ! BTREE_KEY2ID64
-                    * id = id32;
-#endif
-                
-                KPageRelease ( page );
-            }
-        }
-
-        if ( rc != 0 )
-#if BTREE_KEY2ID
-            * id = 0;
-#else
-            memset ( val, 0, sizeof * val );
-#endif
-    }
-
-    return rc;
-}
-
-
-/* Entry
- *  searches for a match or creates a new entry
- *
- *  "val" [ OUT ] - return parameter for value found
- *   accessed via KBTreeValueAccess* described above
- *   must be balanced with a call to KBTreeValueWhack.
- *
- *  "was_inserted" [ OUT ] - if true, the returned value was the result of an
- *   insertion and can be guaranteed to be all 0 bits. otherwise, the returned
- *   value will be whatever was there previously.
- *
- *  "alloc_size" [ IN ] - the number of value bytes to allocate upon insertion,
- *   i.e. if the key was not found. this value must agree with the limits
- *   specified in Make ( see above ).
- *
- *  "key" [ IN ] and "key_size" [ IN ] - describes an
- *   opaque key
- */
-typedef struct KBTreeSplit_v1 KBTreeSplit_v1;
-struct KBTreeSplit_v1
-{
-    uint32_t left;
-    uint32_t right;
-    uint32_t key;
-    uint32_t val;
-};
-
-typedef struct KBTreeSplit_v2 KBTreeSplit_v2;
-struct KBTreeSplit_v2
-{
-    void *key;
-    uint32_t left;
-    uint32_t right;
-    uint16_t ksize;
-    uint8_t buff [ 256 ];
-};
-
-typedef struct KBTreeSplit_v2 KBTreeSplit;
-#define KBTreeSplitInit( split ) \
-    ( void ) ( ( split ) -> key = NULL )
-#define KBTreeSplitWhack( split ) \
-    ( ( split ) -> key != NULL && ( split ) -> key != ( void* ) ( split ) -> buff ) ? \
-    free ( ( split ) -> key ) : ( void ) 0
-
-typedef struct KBTreeEntryData KBTreeEntryData;
-struct KBTreeEntryData
-{
-    KBTree *self;
-#if BTREE_KEY2ID
-    uint32_t *id;
-#else
-    KBTreeValue *val;
-    size_t alloc_size;
-#endif
-    const void *key;
-    size_t key_size;
-    bool was_inserted;
-};
-
-
-#if _DEBUGGING
-#include <stdio.h>
-
-static
-void dump_leaf_page ( const KBTreeLeafNode *cnode )
-{
-    int i;
-    const char *page;
-
-    if ( cnode == NULL )
-    {
-        printf ( "NULL\n\n" );
-        return;
-    }
-
-    printf ( "KBTreeLeafNode\n"
-             "  count:     %u\n"
-             "  key bytes: %u\n"
-             , cnode -> count
-             , cnode -> key_bytes
-        );
-
-    if ( cnode -> count == 0 )
-    {
-        putchar ( '\n' );
-        return;
-    }
-
-    page = ( const void* ) cnode;
-
-    printf ( "  entries:\n" );
-    for ( i = 0; i < cnode -> count; ++ i )
-    {
-        int key_size = cnode -> ord [ i ] . ksize;
-        const char *key = & page [ cnode -> ord [ i ] . key ];
-        uint32_t val_id = * ( const uint32_t* ) & key [ key_size ];
-        printf ( "  % 5d. key = '%.*s', offset = %u, value-id = %u\n"
-                 , i
-                 , key_size, key
-                 , cnode -> ord [ i ] . key
-                 , val_id
-            );
-    }
-
-    putchar ( '\n' );
-}
-
-
-#if _HUGE_CROWBAR_KLUDGE
-static
-void validate_key_order ( const KBTree *self, const KBTreeEntryData *pb, const KBTreeLeafNode *cnode )
-{
-    if ( cnode -> count != 0 )
-    {
-        KBTreeValue left, right;
-        rc_t rc = KPageFileStreamGet ( & self -> hdr . key_stream, self -> pgfile, & left, cnode -> key [ 0 ] );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-            size_t sleft, sright;
-            const void *mleft, *mright;
-            rc = KBTreeValueAccessRead ( & left, & mleft, & sleft );
-
-            for ( i = 1; rc == 0 && i < cnode -> count; ++ i )
-            {
-                rc = KPageFileStreamGet ( & self -> hdr . key_stream, self -> pgfile, & right, cnode -> key [ i ] );
-                if ( rc == 0 )
-                {
-                    rc = KBTreeValueAccessRead ( & right, & mright, & sright );
-                    if ( rc == 0 )
-                    {
-                        int diff = ( * self -> cmp ) ( mleft, sleft, mright, sright );
-                        if ( diff > 0 )
-                        {
-                            fprintf ( stderr, "AAAAAHHHH!!!!\n" );
-                            rc = -1;
-                        }
-                    }
-
-                    KBTreeValueWhack ( & left );
-                    left = right;
-                }
-            }
-
-            KBTreeValueWhack ( & left );
-        }
-    }
-}
-#endif /* _HUGE_CROWBAR_KLUDGE */
-#endif /* _DEBUGGING */
-
-static
-rc_t make_entry ( KBTree *self, KBTreeEntryData *pb, void *hdrp, void *ordp )
-{
-#if BTREE_KEY2ID
-    rc_t rc=0;
-    /* use id provided from outside */
-#if 0 /* automatically generate */
-    if ( ( * pb -> id = ++ self -> hdr . id_seq ) == 0 )
-    {
-        -- self -> hdr . id_seq;
-        rc = RC ( rcDB, rcTree, rcInserting, rcId, rcExhausted );
-    }
-    else
-#endif
-#else
-    /* insert value */
-    uint32_t val_id;
-    rc_t rc = KPageFileStreamAlloc ( & self -> hdr . val_stream, self -> pgfile,
-            pb -> val, pb -> alloc_size, & val_id );
-    if ( rc == 0 )
-#endif
-    {
-        uint8_t *page = hdrp;
-        KBTreeLeafNode *hdr = hdrp;
-        KBTreeLeafEntry *ord = ordp;
-	const uint8_t *key = pb -> key;
-	uint16_t key_size = pb -> key_size - hdr->key_prefix_len;
-
-
-        assert(memcmp(key,page + hdr->key_prefix, hdr -> key_prefix_len)==0);/*** validate in debug mode **/ 
-        key += hdr->key_prefix_len;
-
-        /* grab memory for key and value-id */
-        hdr -> key_bytes += key_size + sizeof ( uint32_t );
-        assert ( hdr -> key_bytes < PGSIZE );
-
-        /* location of key within page */
-        ord -> key = PGSIZE - hdr -> key_bytes;
-        ord -> ksize = ( uint16_t ) key_size;
-
-        /* insert key */
-        memcpy ( page + ord -> key, key,  key_size );
-
-        /* record value id */
-#if BTREE_KEY2ID
-        memcpy ( & page [ ord -> key + key_size ], pb -> id, sizeof * pb -> id );
-#else
-        memcpy ( page  +  ord -> key + key_size, & val_id, sizeof val_id );
-#endif
-
-        /* mark inserted */
-        pb -> was_inserted = true;
-    }
-
-    return rc;
-}
-
-static
-bool leaf_node_full ( const KBTreeLeafNode *node, size_t key_size )
-{
-    /*** add existing keys ***/
-    size_t size = node -> key_bytes;
-    /*** add new key ***/
-
-    assert( key_size >= node -> key_prefix_len);
-    size += key_size + sizeof ( uint32_t ) - node -> key_prefix_len;
-    /*** add key index **/
-    size += (uint8_t*)(node->ord + node -> count+1)  - (uint8_t*)node ;
-
-    if ( size > PGSIZE )
-        return true;
-    return false;
-}
-
-static
-rc_t leaf_insert ( KBTree *self, KBTreeEntryData *pb, KBTreeLeafNode *node, uint32_t slot )
-{
-    rc_t rc;
-    uint16_t q;
-
-    /* check that key will fit */
-    if ( leaf_node_full ( node, pb->key_size ) ) {
-        return RC ( rcDB, rcTree, rcInserting, rcConstraint, rcViolated );
-    }
-
-    /* open hole */
-    if ( slot != node -> count )
-        memmove ( & node -> ord [ slot + 1 ], & node -> ord [ slot ], sizeof node -> ord [ 0 ] * ( node -> count - slot ) );
-
-    /* enter into the leaf */
-    rc = make_entry ( self, pb, node, & node -> ord [ slot ] );
-    if ( rc == 0 )
-        ++ node -> count;
-
-    /* recover from error */
-    else if ( slot != node -> count )
-        memmove ( & node -> ord [ slot ], & node -> ord [ slot + 1 ], sizeof node -> ord [ 0 ] * ( node -> count - slot ) );
-
-    /* correct search windows */
-    q=(pb->key_size > node->key_prefix_len)?((uint8_t*)pb->key)[node->key_prefix_len]:0;
-    /*** unused windows should have been maintained properly ****/
-    assert((node->win[q].upper==node->win[q].lower)?(node->win[q].lower==slot):true);
-    node->win[q].upper ++; 
-    for(q=q+1; q < 256; q++){
-	node->win[q].lower++;
-	node->win[q].upper++;
-    }
-    assert(validate_search_window(node->win));
-    return rc;
-}
-
-static
-int CC KBTreeLeafEntry_sort_desc_by_offset ( const void *a, const void *b, void *data )
-{
-    const KBTreeLeafEntry *ord = ( const void* ) data;
-    int left = * ( const uint16_t* ) a;
-    int right = * ( const uint16_t* ) b;
-    return ord [ right ] . key - ord [ left ] . key;
-}
-
-static
-rc_t split_leaf ( KBTree *self, KBTreeEntryData *pb,
-    KBTreeLeafNode *left, KBTreeLeafNode *right, uint32_t slot, KBTreeSplit *split)
-{
-    size_t off, ksize;
-    bool hoist_existing;
-    uint16_t ord [ ( sizeof left -> ord / sizeof left -> ord [ 0 ] + 1 ) / 2 ];
-
-    /* calculate median */
-    int32_t i, j, median = ( left -> count + 1 ) >> 1;
-
-    /* pointers to pages */
-    uint8_t * lpage = ( void* ) left;
-    uint8_t * rpage = ( void* ) right;
-
-    /* check to see if key being inserted would be hoisted */
-    if ( slot == median && median > ( left -> count >> 1 ) )
-    {
-        hoist_existing = false;
-        ksize = pb -> key_size;
-    }
-    else
-    {
-        /* TBD - choose median based upon count and slot */
-        /* get median key size */
-        hoist_existing = true;
-        ksize = left -> ord [ median ] . ksize + left -> key_prefix_len;
-    }
-
-    /* allocate key space */
-    split -> key = split -> buff;
-    if ( ksize > ( sizeof split -> buff - sizeof ( uint32_t ) ) )
-    {
-        split -> key = malloc ( ksize + sizeof ( uint32_t ) );
-        if ( split -> key == NULL )
-            return RC ( rcDB, rcTree, rcInserting, rcMemory, rcExhausted );
-    }
-
-    /* copy out key plus value id */
-    if ( hoist_existing ){
-	split -> ksize = 0;
-	if(left -> key_prefix_len > 0){
-		memcpy ( ((uint8_t*)split -> key) + split -> ksize, lpage + left -> key_prefix, left -> key_prefix_len );
-		split -> ksize +=left -> key_prefix_len;
-	}
-        memcpy(((uint8_t*)split -> key) + split -> ksize, lpage + left -> ord [ median ] . key , left -> ord [ median ] . ksize + sizeof ( uint32_t ) );
-    	split -> ksize += left -> ord [ median ] . ksize;
-    }
-
-    /* right page is empty */
-    right -> key_bytes = 0;
-
-    /* copy all of the keys to the right of median from left to right */
-    for ( i = 0, j = median + hoist_existing; j < left -> count; ++ i, ++ j )
-    {
-        ksize = left -> ord [ j ] . ksize + sizeof ( uint32_t );
-        right -> ord [ i ] . ksize = left -> ord [ j ] . ksize;
-        right -> key_bytes += ksize;
-        right -> ord [ i ] . key = ( uint16_t ) ( PGSIZE - right -> key_bytes );
-        memcpy (rpage + right -> ord [ i ] . key, lpage + left -> ord [ j ] . key, ksize );
-	if(i == 0 && left->key_prefix_len > 0){
-		right -> key_prefix_len = left -> key_prefix_len;
-		right -> key_bytes     += left -> key_prefix_len;
-		right -> key_prefix     = PGSIZE - right -> key_bytes;
-		memcpy ( rpage + right -> key_prefix, lpage + left->key_prefix, left -> key_prefix_len );
-	}
-    }
-
-    /* each node has half its former count */
-    right -> count = ( uint16_t ) i;
-    left -> count = median;
-
-    /* compact the keys */
-    for ( i = 0; i < median; ++ i )
-        ord [ i ] = i;
-    ksort ( ord, median, sizeof ord [ 0 ], KBTreeLeafEntry_sort_desc_by_offset, left -> ord );
-    for ( left -> key_bytes = 0, i = 0; i < median; ++ i )
-    {
-        j = ord [ i ];
-        ksize = left -> ord [ j ] . ksize + sizeof ( uint32_t );
-        off = PGSIZE - ( left -> key_bytes += ksize );
-        if ( left -> ord [ j ] . key != off )
-        {
-            memmove ( & lpage [ off ], & lpage [ left -> ord [ j ] . key ], ksize );
-            left -> ord [ j ] . key = ( uint16_t ) off;
-        }
-	if(i == 0 && left->key_prefix_len > 0){ /** need to restore prefix from the right ***/
-		left -> key_bytes += left -> key_prefix_len;
-		left -> key_prefix = PGSIZE - left -> key_bytes;
-		memcpy ( lpage + left -> key_prefix, rpage + right -> key_prefix, left -> key_prefix_len );
-	}
-    }
-    /*** maintain search windows ****/
-    /*** find the last window of left ***/
-    for(i=0;left->win[i].upper < left->count; i++){
-	assert(i<256);
-	right->win[i].lower=0;
-	right->win[i].upper=0;
-    }
-    j=right->ord[0].ksize?((uint8_t*)right)[right->ord[0].key]:0;
-    assert(i<=j);
-    for(;i<j;i++){
-	right->win[i].lower=0;
-        right->win[i].upper=0;
-        left->win[i].upper=left->count;
-	left->win[i+1].lower=left->count;
-    }
-    /*** set first window of right ***/
-    right->win[i].lower = 0;
-    assert( left->win[i].upper >= left->count + hoist_existing);
-    right->win[i].upper = left->win[i].upper - left->count - hoist_existing;
-    /*** set last window of left ***/ 
-    left->win[i].upper = left->count;
-    i++;
-    /*** set right windows from left, reset left ***/
-    for(;i<256;i++){
-	assert( left->win[i].lower >= left->count + hoist_existing );
-	assert( left->win[i].upper >= left->count + hoist_existing );
-	right->win[i].lower = left->win[i].lower - left->count  - hoist_existing;
-	right->win[i].upper = left->win[i].upper - left->count  - hoist_existing;
-	left->win[i].lower=left->count;
-	left->win[i].upper=left->count;
-    }
-    assert(right->win[255].upper == right -> count);
-    /*** reset right window ***/
-    for(;i<256;i++){
-	right->win[i].lower=right->count;
-        right->win[i].upper=right->count;
-    }
-    assert(validate_search_window(right->win));
-    assert(validate_search_window(left->win));
-    /*****************************************/
-
-    /* if insert would be hoisted, do it directly */
-    if ( ! hoist_existing )
-    {
-#if BTREE_KEY2ID
-#if 0 /*** use external id ***/
-        if ( ( * pb -> id = ++ self -> hdr . id_seq ) == 0 )
-        {
-            -- self -> hdr . id_seq;
-            return RC ( rcDB, rcTree, rcInserting, rcId, rcExhausted );
-        }
-#endif
-        memcpy ( split -> key, pb -> key , pb -> key_size );
-        memcpy ( & ( ( uint8_t* ) split -> key ) [ pb -> key_size ], pb -> id, sizeof * pb -> id );
-	split -> ksize =  pb -> key_size;
-        return 0;
-#else
-        /* insert value */
-        uint32_t val_id;
-        rc_t rc = KPageFileStreamAlloc ( & self -> hdr . val_stream, self -> pgfile,
-            pb -> val, pb -> alloc_size, & val_id );
-        if ( rc == 0 )
-        {
-            memcpy ( split -> key, pb->key, pb->key_size);
-            * ( uint32_t* ) & ( ( uint8_t* ) split -> key ) [ pb->key_size ] = val_id;
-	    split -> ksize =  pb -> key_size;
-        }
-        return rc;
-#endif
-    }
-
-    /* TBD - with keys in pages, there is no guarantee that the following insert
-       will succeed, unless there would be a provision for overflow. */
-
-    /* decide where to insert entry */
-    if ( slot <= median )
-        return leaf_insert ( self, pb, left, slot );
-    return leaf_insert ( self, pb, right, slot - median - 1 );
-}
-
-
-
-static
-rc_t leaf_entry ( KBTree *self, KBTreeEntryData *pb, KPage *page, KBTreeSplit *split)
-{
-    int lower, upper;
-    KBTreeLeafNode *node;
-
-    const uint8_t *query = pb -> key;
-    size_t qsize = pb -> key_size;
-    uint16_t q;
-
-    /* access page for read */
-    const KBTreeLeafNode *cnode;
-    rc_t rc = page_access_read ( page, ( const void** ) & cnode );
-    if ( rc != 0 )
-        return rc;
-
-    /* special case for root node initial insert */
-    if ( cnode -> count == 0 )
-    {
-        rc = page_access_update ( page, ( void** ) & node );
-        if ( rc == 0 )
-        {
-            rc = make_entry ( self, pb, node, & node -> ord [ 0 ] );
-            if ( rc == 0 ){
-		int i;
-	    	q=(qsize >0)? *query:0;
-                node -> count = 1;
-		node -> win[q].lower = 0;
-		node -> win[q].upper = 1;
-		for(i=0;i<q;i++){
-			node -> win[i].lower = 0;
-			node -> win[i].upper = 0;
-		}
-		for(i=q+1;i<256;i++){
-                        node -> win[i].lower = 1;
-                        node -> win[i].upper = 1;
-                }
-    		assert(validate_search_window(node->win));
-
-	    }
-        }
-        return rc;
-    }
-
-    /* perform search on branch node */
-    /* start with prefix compare */
-    if(cnode->key_prefix_len > 0){
-        const size_t key_prefix_len=cnode->key_prefix_len;
- 	/*** prefix must match ***/	
-        assert(compare_keys(self,query,key_prefix_len, ((char *)cnode )+cnode->key_prefix,key_prefix_len) == 0);
-	/*************************/
-	query += cnode->key_prefix_len;
-	qsize -= cnode->key_prefix_len;
-	
-    }
-    q=(qsize >0)? *query:0;
-    for ( lower = cnode->win[q].lower, upper = cnode -> win[q].upper; lower < upper; )
-    {
-        /* determine the slot to examine */
-        int slot = ( lower + upper ) >> 1;
-
-        /* perform comparison */
-        const uint8_t *key = & ( ( const uint8_t* ) cnode ) [ cnode -> ord [ slot ] . key ];
-        int diff = compare_keys ( self, query, qsize, key, cnode -> ord [ slot ] . ksize );
-        if ( diff == 0 )
-        {
-            uint32_t val_id;
-            memcpy ( & val_id, & key [ cnode -> ord [ slot ] . ksize ], sizeof val_id );
-#if BTREE_KEY2ID
-            * pb -> id = val_id;
-            return 0;
-#else
-            return KPageFileStreamGet ( & self -> hdr . val_stream, self -> pgfile, pb -> val, val_id );
-#endif
-        }
-        if ( diff < 0 )
-            upper = slot;
-        else
-            lower = slot + 1;
-    }
-
-    /* should have the last slot tried ( < 0 ) or next slot to try ( > 0 ) */
-    assert ( lower == upper );
-
-    /* going to need to update the node */
-    rc = page_access_update ( page, ( void** ) & node );
-    if ( rc != 0 )
-        return rc;
-
-    /* unless an error occurs */
-    pb -> was_inserted = true;
-
-    /* test for split */
-    if ( leaf_node_full ( node, pb->key_size ) )
-    {
-        KPage *dup;
-
-        /* create another leaf node to right */
-        rc = KPageFileAlloc ( self -> pgfile, & dup, & split -> right );
-        if ( rc == 0 )
-        {
-            void *mem;
-            rc = page_access_update ( dup, & mem );
-            if ( rc == 0 )
-            {
-                rc = split_leaf ( self, pb, node, mem, upper, split);
-                if ( rc == 0 )
-                {
-                    rc = RC ( rcDB, rcTree, rcInserting, rcId, rcInsufficient );
-                    split -> right <<= 1;
-                }
-            }
-
-            KPageRelease ( dup );
-        }
-    }
-    else
-    {
-        /* simple insert */
-        rc = leaf_insert ( self, pb, node, upper );
-
-#if _DEBUGGING && _HUGE_CROWBAR_KLUDGE
-        validate_key_order ( self, pb, node );
-#endif
-    }
-
-    return rc;
-}
-
-
-#if _DEBUGGING
-static
-void dump_branch_page ( const KBTreeBranchNode *cnode )
-{
-    int i;
-    const char *page;
-
-    if ( cnode == NULL )
-    {
-        printf ( "NULL\n\n" );
-        return;
-    }
-
-    printf ( "KBTreeBranchNode\n"
-             "  count:     %u\n"
-             "  key bytes: %u\n"
-             , cnode -> count
-             , cnode -> key_bytes
-        );
-
-    if ( cnode -> count == 0 )
-    {
-        putchar ( '\n' );
-        return;
-    }
-
-    page = ( const void* ) cnode;
-
-    printf ( "  entries:\n" );
-    for ( i = 0; i < cnode -> count; ++ i )
-    {
-        int key_size = cnode -> ord [ i ] . ksize;
-        const char *key = & page [ cnode -> ord [ i ] . key ];
-        uint32_t val_id = * ( const uint32_t* ) & key [ key_size ];
-        printf ( "  % 5d. key = '%.*s', offset = %u, value-id = %u\n"
-                 , i
-                 , key_size, key
-                 , cnode -> ord [ i ] . key
-                 , val_id
-            );
-    }
-
-    printf ( "  transitions:\n" );
-    for ( i = 0; i <= cnode -> count; ++ i )
-    {
-        uint32_t node_id = cnode -> ord [ i - 1 ] . trans;
-        printf ( "  % 5d. node-id = %u\n"
-                 , i
-                 , node_id
-            );
-    }
-
-    putchar ( '\n' );
-}
-#endif
-
-static
-bool branch_node_full ( const KBTreeBranchNode *node, size_t key_size )
-{
-    /*** add existing keys ***/
-    size_t size = node -> key_bytes;
-    /*** add new key ***/
-    assert( key_size >= node -> key_prefix_len);
-    size += key_size + sizeof ( uint32_t ) - node -> key_prefix_len;
-
-    /*** add key index **/
-    size += (uint8_t*)(node->ord + node -> count+1)  - (uint8_t*)node ;
-    if ( size > PGSIZE )
-        return true;
-    return false;
-}
-
-static
-rc_t branch_insert ( KBTree *self, KBTreeBranchNode *node, const KBTreeSplit *split, uint32_t slot )
-{
-    uint16_t ksize = split -> ksize;
-    uint8_t *key   = split -> key;
-    uint8_t *page = (uint8_t*) node;
-    uint16_t q;
-
-    /* remove prefix from the key */
-    ksize -= node -> key_prefix_len;
-
-    assert(memcmp(key,page + node->key_prefix, node -> key_prefix_len)==0);/*** validate in debug mode **/ 
-    key   += node -> key_prefix_len;
-
-    /* check that key will fit */
-    if ( branch_node_full ( node, split -> ksize ) )
-        return RC ( rcDB, rcTree, rcInserting, rcConstraint, rcViolated );
-
-    /* open hole */
-    if ( slot != node -> count )
-        memmove ( & node -> ord [ slot + 1 ], & node -> ord [ slot ], sizeof node -> ord [ 0 ] * ( node -> count - slot ) );
-
-    /* enter key value pair */
-    node -> key_bytes += ksize + sizeof ( uint32_t );
-    node -> ord [ slot ] . ksize = ksize;
-    node -> ord [ slot ] . key = ( uint16_t ) ( PGSIZE - node -> key_bytes );
-    memcpy ( & ( ( uint8_t* ) node ) [ PGSIZE - node -> key_bytes ], key, ksize + sizeof ( uint32_t ) );
-
-    /* enter the new transitions */
-    assert ( node -> ord [ ( int ) slot - 1 ] . trans == split -> left );
-    node -> ord [ ( int ) slot - 1 ] . trans = split -> left;
-    node -> ord [ slot ] . trans = split -> right;
-#if 0
-    printf("branch_insert: count:%d prefix_len:%d slot:%d left:%d right:%d \n",node->count, node->key_prefix_len, slot,split -> left,split -> right);
-#endif
-
-    ++ node -> count;
-    
-    /* correct search windows */
-    q=(split->ksize > node->key_prefix_len)?((uint8_t*)split->key)[node->key_prefix_len]:0;
-    /*** unused windows should have beed maintained properly ****/
-    assert((node->win[q].upper==node->win[q].lower)?(node->win[q].lower==slot):true);
-    node->win[q].upper ++;
-    for(q=q+1; q < 256; q++){
-        node->win[q].lower++;
-        node->win[q].upper++;
-    }
-    assert(validate_search_window(node->win));
-    return 0;
-}
-
-static
-int CC KBTreeBranchEntry_sort_desc_by_offset ( const void *a, const void *b, void *data )
-{
-    const KBTreeBranchEntry *ord = ( const void* ) data;
-    int left = * ( const uint16_t* ) a;
-    int right = * ( const uint16_t* ) b;
-    return ord [ right ] . key - ord [ left ] . key;
-}
-
-static
-rc_t split_branch ( KBTree *self,
-    KBTreeBranchNode *left, KBTreeBranchNode *right,
-    const KBTreeSplit *val, KBTreeSplit *split, uint32_t slot)
-{
-    size_t off, ksize;
-    bool hoist_existing;
-    uint16_t ord [ ( sizeof left -> ord / sizeof left -> ord [ 0 ] + 1 ) / 2 ];
-
-    /* calculate median */
-    int32_t i, j, median = ( left -> count + 1 ) >> 1;
-
-    /* pointers to pages */
-    uint8_t * lpage = ( void* ) left;
-    uint8_t * rpage = ( void* ) right;
-
-    /* check to see if key being inserted would be hoisted */
-    if ( slot == median && median > ( left -> count >> 1 ) )
-    {
-        hoist_existing = false;
-        ksize = val -> ksize;
-    }
-    else
-    {
-        /* get median key size */
-        hoist_existing = true;
-        ksize = left -> ord [ median ] . ksize + left -> key_prefix_len;
-    }
-
-    /* allocate key space */
-    split -> key = split -> buff;
-    if ( ksize > ( sizeof split -> buff - sizeof ( uint32_t ) ) )
-    {
-        split -> key = malloc ( ksize + sizeof ( uint32_t ) );
-        if ( split -> key == NULL )
-            return RC ( rcDB, rcTree, rcInserting, rcMemory, rcExhausted );
-    }
-
-    /* copy out key plus value id */
-    if ( hoist_existing ){
-        split -> ksize = 0;
-        if(left -> key_prefix_len > 0){
-                memcpy ( ((uint8_t*)split -> key) + split -> ksize, lpage + left -> key_prefix, left -> key_prefix_len );
-                split -> ksize +=left -> key_prefix_len;
-        }
-        memcpy(((uint8_t*)split -> key) + split -> ksize, lpage + left -> ord [ median ] . key , left -> ord [ median ] . ksize + sizeof ( uint32_t ) );
-        split -> ksize +=  left -> ord [ median ] . ksize;
-    }
-
-
-    /* right page is empty */
-    right -> key_bytes = 0;
-
-    /* copy all of the keys to the right of the median from left to right */
-    for ( i = 0, j = median + hoist_existing; j < left -> count; ++ i, ++ j )
-    {
-        ksize = left -> ord [ j ] . ksize + sizeof ( uint32_t );
-        right -> ord [ i ] . ksize = left -> ord [ j ] . ksize;
-        right -> key_bytes += ksize;
-        right -> ord [ i ] . key = ( uint16_t ) ( PGSIZE - right -> key_bytes );
-        memcpy ( & rpage [ PGSIZE - right -> key_bytes ], & lpage [ left -> ord [ j ] . key ], ksize );
-        right -> ord [ i - 1 ] . trans = left -> ord [ j - 1 ] . trans;
-	if(i == 0 && left->key_prefix_len > 0){
-                off = PGSIZE - right -> key_bytes - left -> key_prefix_len;
-                memcpy ( & rpage [ off ], lpage + left -> key_prefix, left -> key_prefix_len );
-                right -> key_bytes += left -> key_prefix_len;
-                right -> key_prefix_len = left -> key_prefix_len;
-                right -> key_prefix = off;
-        }
-    }
-
-    /* copy the last trans */
-    right -> ord [ i - 1 ] . trans = left -> ord [ j - 1 ] . trans;
-
-    /* each node has half its former count */
-    right -> count = ( uint16_t ) i;
-    left -> count = median;
-
-    /* compact the keys */
-    for ( i = 0; i < median; ++ i )
-        ord [ i ] = i;
-    ksort ( ord, median, sizeof ord [ 0 ], KBTreeBranchEntry_sort_desc_by_offset, left -> ord );
-    for ( left -> key_bytes = 0, i = 0; i < median; ++ i )
-    {
-        j = ord [ i ];
-        ksize = left -> ord [ j ] . ksize + sizeof ( uint32_t );
-        off = PGSIZE - ( left -> key_bytes += ksize );
-        if ( left -> ord [ j ] . key != off )
-        {
-            memmove ( & lpage [ off ], & lpage [ left -> ord [ j ] . key ], ksize );
-            left -> ord [ j ] . key = ( uint16_t ) off;
-        }
-	if(i == 0 && left->key_prefix_len > 0){ /** need to restore prefix from the right ***/
-                off = PGSIZE - left -> key_bytes - left -> key_prefix_len;
-                memcpy ( & lpage [ off ], rpage + right -> key_prefix, left -> key_prefix_len );
-                left -> key_bytes += left -> key_prefix_len;
-                left -> key_prefix = off;
-        }
-    }
-    /*** maintain search windows ****/
-    /*** find the last window of left ***/
-    for(i=0;left->win[i].upper < left->count; i++){
-	assert(i<256);
-	right->win[i].lower=0;
-	right->win[i].upper=0;
-    }
-    j=right->ord[0].ksize?((uint8_t*)right)[right->ord[0].key]:0;
-    assert(i<=j);
-    for(;i<j;i++){
-	right->win[i].lower=0;
-        right->win[i].upper=0;
-        left->win[i].upper=left->count;
-	left->win[i+1].lower=left->count;
-    }
-    /*** set first window of right ***/
-    right->win[i].lower = 0;
-    assert( left->win[i].upper >= left->count + hoist_existing);
-    right->win[i].upper = left->win[i].upper - left->count - hoist_existing;
-    /*** set last window of left ***/ 
-    left->win[i].upper = left->count;
-    i++;
-    /*** set right windows from left, reset left ***/
-    for(;i<256;i++){
-	assert( left->win[i].lower >= left->count + hoist_existing );
-	assert( left->win[i].upper >= left->count + hoist_existing );
-	right->win[i].lower = left->win[i].lower - left->count  - hoist_existing;
-	right->win[i].upper = left->win[i].upper - left->count  - hoist_existing;
-	left->win[i].lower=left->count;
-	left->win[i].upper=left->count;
-    }
-    assert(right->win[255].upper == right -> count);
-    /*** reset right window ***/
-    for(;i<256;i++){
-	right->win[i].lower=right->count;
-        right->win[i].upper=right->count;
-    }
-    assert(validate_search_window(right->win));
-    assert(validate_search_window(left->win));
-    /*****************************************/
-
-    /* if insert would be hoisted, do it directly */
-    if ( ! hoist_existing )
-    {
-        /* copy key and value */
-        memcpy ( split -> key, val -> key, val -> ksize + sizeof ( uint32_t ) );
-	split ->  ksize = val -> ksize;
-
-        /* set left and right transitions */
-        assert ( left -> ord [ median - 1 ] . trans == val -> left );
-        left -> ord [ median - 1 ] . trans = val -> left;
-        right -> ltrans = val -> right;
-
-        return 0;
-    }
-
-    /* decide where to insert entry */
-    if ( slot <= median )
-        return branch_insert ( self, left, val, slot );
-    return branch_insert ( self, right, val, slot - median - 1 );
-}
-#define MIN_PREFIX_TO_COMPACT 1 /*** minimum prefix delta to initiate compacting ****/
-static
-rc_t leaf_compact (KBTree *self, KPage *pg,uint16_t prefix_len)
-{
-    const KBTreeLeafNode *cnode;
-    rc_t rc = page_access_read(pg, ( const void** ) & cnode );
-    if(rc == 0  && cnode->key_prefix_len < prefix_len) {
-	assert(cnode->count   > 0); 
-	if( cnode->count   > 0 && prefix_len > cnode->key_prefix_len ){
-	    prefix_len -= cnode->key_prefix_len; /*** need only to compact the delta **/
-	    assert(memcmp(((uint8_t*)cnode)+cnode->ord[0].key,
-		          ((uint8_t*)cnode)+cnode->ord[cnode->count-1].key,
-			  prefix_len )==0);/****** To be sure ****/
-            if( prefix_len >= MIN_PREFIX_TO_COMPACT){ /*** good to compact ***/
-		KBTreeLeafNode *node;
-		rc = page_access_update ( pg, ( void** ) & node );
-		if(rc == 0){
-			uint8_t  q,last;
-			uint16_t i;
-			uint16_t ord [ ( sizeof node -> ord / sizeof node -> ord [ 0 ] + 1 ) / 2 ];
-			for ( i = 0; i < node->count; ++ i ) ord[i]=i; /*** build and sort indexing array ***/
-			ksort ( ord, node->count, sizeof ord [ 0 ], KBTreeLeafEntry_sort_desc_by_offset, node -> ord );
-			/*** deal with prefix and index 0 ***/
-			/*** prefix is cut from the last stored key on the page **/
-			if(node->key_prefix_len == 0){
-				node->key_prefix = node->ord[ord[0]].key;
-			}
-			node->key_prefix_len    += prefix_len;
-			node->ord[ord[0]].key   += prefix_len;
-			node->ord[ord[0]].ksize -= prefix_len;
-			/*** deal with index 1 (shift) ***/
-			if(node->count > 1){
-				node->ord[ord[1]].key   += prefix_len;
-				node->ord[ord[1]].ksize -= prefix_len;
-			}
-			/*** cut all other values ***/
-			for ( i = 2; i < node->count; ++ i ){
-				uint16_t j = ord[i];
-				uint8_t *src = ((uint8_t*)node) + node->ord[j].key + prefix_len;
-				uint8_t *dst = src + (i-1)*prefix_len; /*** proportional offset ***/
-				uint16_t ksize = node->ord[j].ksize + sizeof ( uint32_t ) - prefix_len;
-				memmove(dst,src,ksize);
-				node->ord[j].ksize -= prefix_len;
-				node->ord[j].key    = dst -  ((uint8_t*)node);
-			}
-			assert( node -> key_bytes > (node->count-1) * prefix_len);
-			node -> key_bytes -= (node->count-1) * prefix_len;
-			/*** rebuild search windows ***/
-			q=node->ord[0].ksize?((uint8_t*)node)[node->ord[0].key]:0;
-			for(i=0;i<q;i++){
-				node->win[i].lower=0;
-				node->win[i].upper=0;
-			}
-			node->win[q].lower=0;
-			for(i=0,last=q;i< node->count; ++ i ){
-				q=node->ord[i].ksize?((uint8_t*)node)[node->ord[i].key]:0;
-				assert(last<=q);
-				if(q!=last){
-					node->win[last++].upper = i;
-					for(;last<q;last++){/*** need to catch up ***/
-						node->win[last].lower=i;
-						node->win[last].upper=i;
-					}
-					node->win[q].lower=i;
-					last=q;
-				}
-			}
-			node->win[last].upper=node->count;
-			for(i=last+1;i<256;i++){
-				node->win[i].lower=node->count;
-				node->win[i].upper=node->count;
-			}
-			assert(validate_search_window(node->win));
-		}	
-	    }
-	}
-    }
-    return rc;
-}
-static
-rc_t branch_compact (KBTree *self, KPage *pg,uint16_t prefix_len)
-{
-    const KBTreeBranchNode *cnode;
-    rc_t rc = page_access_read(pg, ( const void** ) & cnode );
-    if(rc == 0 && cnode->key_prefix_len < prefix_len) {
-	assert(cnode->count   > 0); 
-	if( cnode->count   > 0 && prefix_len > cnode->key_prefix_len ){
-	    prefix_len -= cnode->key_prefix_len; /*** need only to compact the delta **/
-	    assert(memcmp(((uint8_t*)cnode)+cnode->ord[0].key,
-		          ((uint8_t*)cnode)+cnode->ord[cnode->count-1].key,
-			  prefix_len )==0);/****** To be sure ****/
-            if( prefix_len >= MIN_PREFIX_TO_COMPACT){ /*** good to compact ***/
-		KBTreeBranchNode *node;
-		rc = page_access_update ( pg, ( void** ) & node );
-		if(rc == 0){
-			uint8_t	 q,last;
-			uint16_t i;
-			uint16_t ord [ ( sizeof node -> ord / sizeof node -> ord [ 0 ] + 1 ) / 2 ];
-			for ( i = 0; i < node->count; ++ i ) ord[i]=i; /*** build and sort indexing array ***/
-			ksort ( ord, node->count, sizeof ord [ 0 ], KBTreeBranchEntry_sort_desc_by_offset, node -> ord );
-			/*** deal with prefix and index 0 ***/
-			/*** prefix is cut from the last stored key on the page **/
-			if(node->key_prefix_len == 0){
-				node->key_prefix = node->ord[ord[0]].key;
-			}
-			node->key_prefix_len    += prefix_len;
-			node->ord[ord[0]].key   += prefix_len;
-			node->ord[ord[0]].ksize -= prefix_len;
-			/*** deal with index 1 (shift) ***/
-			if(node->count > 1){
-				node->ord[ord[1]].key   += prefix_len;
-				node->ord[ord[1]].ksize -= prefix_len;
-			}
-			/*** cut all other values ***/
-			for ( i = 2; i < node->count; ++ i ){
-				uint16_t j = ord[i];
-				uint8_t *src = ((uint8_t*)node) + node->ord[j].key + prefix_len;
-				uint8_t *dst = src + (i-1)*prefix_len; /*** proportional offset ***/
-				uint16_t ksize = node->ord[j].ksize + sizeof ( uint32_t ) - prefix_len;
-				memmove(dst,src,ksize);
-				node->ord[j].ksize -= prefix_len;
-				node->ord[j].key    = dst -  ((uint8_t*)node);
-			}
-			assert( node -> key_bytes > (node->count-1) * prefix_len);
-			node -> key_bytes -= (node->count-1) * prefix_len;
-			/*** rebuild search windows ***/
-			 q=node->ord[0].ksize?((uint8_t*)node)[node->ord[0].key]:0;
-                        for(i=0;i<q;i++){
-                                node->win[i].lower=0;
-                                node->win[i].upper=0;
-                        }
-                        node->win[q].lower=0;
-                        for(i=0,last=q;i< node->count; ++ i ){
-                                q=node->ord[i].ksize?((uint8_t*)node)[node->ord[i].key]:0;
-                                assert(last<=q);
-                                if(q!=last){
-                                        node->win[last++].upper = i;
-                                        for(;last<q;last++){/*** need to catch up ***/
-                                                node->win[last].lower=i;
-                                                node->win[last].upper=i;
-                                        }
-                                        node->win[q].lower=i;
-                                        last=q;
-                                }
-                        }
-                        node->win[last].upper=node->count;
-                        for(i=last+1;i<256;i++){
-                                node->win[i].lower=node->count;
-                                node->win[i].upper=node->count;
-                        }
-                        assert(validate_search_window(node->win));
-		}	
-	    }
-	}
-    }
-    return rc;
-}
-
-static
-rc_t compact_page ( KBTree *self, uint32_t nid, uint16_t prefix_len)
-{
-    KPage *pg;
-    rc_t rc = KPageFileGet ( self -> pgfile, & pg, nid >> 1 );
-    if ( rc == 0 ){
-	rc = ( ( nid & 1 ) == 0 ) ?
-            leaf_compact ( self, pg, prefix_len):
-            branch_compact ( self, pg, prefix_len);
-	KPageRelease(pg);
-    }
-    return rc;
-}
-
-
-static
-rc_t branch_entry ( KBTree *self, KBTreeEntryData *pb, KPage *page, KBTreeSplit *rsplit)
-{
-    KPage *child;
-    uint32_t nid;
-    int lower, upper;
-    const uint8_t *query = pb -> key;
-    size_t qsize = pb -> key_size;
-    uint16_t q;
-
-    /* look at node in read-only mode */
-    const KBTreeBranchNode *cnode;
-    rc_t rc = page_access_read ( page, ( const void** ) & cnode );
-    if ( rc != 0 )
-        return rc;
-
-    /* perform search on branch node */
-    /* start with prefix compare */
-    if(cnode->key_prefix_len > 0){
-        const size_t key_prefix_len=cnode->key_prefix_len;
- 	/*** prefix must match ***/	
-        assert(compare_keys(self,query,key_prefix_len, ((char *)cnode )+cnode->key_prefix,key_prefix_len) == 0);
-	/*************************/
-	query += cnode->key_prefix_len;
-	qsize -= cnode->key_prefix_len;
-    }
-    q = (qsize>0)?*query:0;
-
-    for ( lower = cnode->win[q].lower, upper = cnode -> win[q].upper; lower < upper; )
-    {
-        /* determine the slot to examine */
-        int slot = ( lower + upper ) >> 1;
-
-        /* perform comparison */
-        const uint8_t *key = & ( ( const uint8_t* ) cnode ) [ cnode -> ord [ slot ] . key ];
-        int diff = compare_keys ( self, query, qsize, key, cnode -> ord [ slot ] . ksize );
-        if ( diff == 0 )
-        {
-            uint32_t val_id = * ( const uint32_t* ) & key [ cnode -> ord [ slot ] . ksize ];
-#if BTREE_KEY2ID
-            * pb -> id = val_id;
-            return 0;
-#else
-            return KPageFileStreamGet ( & self -> hdr . val_stream, self -> pgfile, pb -> val, val_id );
-#endif
-        }
-        if ( diff < 0 )
-            upper = slot;
-        else
-            lower = slot + 1;
-    }
-
-    /* should have the last slot tried ( < 0 ) or next slot to try ( > 0 ) */
-    assert ( lower == upper );
-
-    /* the node id is left-shifted by 1 and has the "branch-bit" indicator
-       in the LSB. the remaining bits should NOT be zero */
-    nid = cnode -> ord [ upper - 1 ] . trans;
-    assert ( ( nid >> 1 ) != 0 );
-
-    /* access child node */
-    rc = KPageFileGet ( self -> pgfile, & child, nid >> 1 );
-    if ( rc == 0 )
-    {
-        KBTreeSplit split;
-        KBTreeSplitInit ( & split );
-        /* recursively continue search */
-        rc = ( ( nid & 1 ) == 0 ) ?
-            leaf_entry ( self, pb, child, & split):
-            branch_entry ( self, pb, child, & split);
-        if ( rc != 0 )
-        {
-            /* detect split */
-            if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcId )
-            {
-		/* splitting may replace value being inserted in to the branch ***/
-                /* access current node */
-                KBTreeBranchNode *node;
-                rc = page_access_update ( page, ( void** ) & node );
-                if ( rc == 0 )
-                {
-                    split . left = nid;
-
-                    /* if we are also full, we have to split */
-                    if ( branch_node_full ( node, split.ksize ) )
-                    {
-                        KPage *dup;
-                        /* create another branch node to right */
-                        rc = KPageFileAlloc ( self -> pgfile, & dup, & rsplit -> right );
-                        if ( rc == 0 )
-                        {
-                            void *mem;
-                            rc = page_access_update ( dup, & mem );
-                            if ( rc == 0 )
-                            {
-                                split_branch( self, node, mem, & split, rsplit, upper);
-                                rc = RC ( rcDB, rcTree, rcInserting, rcId, rcInsufficient );
-                                rsplit -> right += rsplit -> right + 1;
-                            }
-
-                            KPageRelease ( dup );
-                        }
-                    }
-                    else
-                    {
-			int pl;/**common prefix_len **/
-                        /* hoist into location */
-			/* it will increase node->count and upper will start pointing into a new key ***/
-			if(rc==0 && upper > 0 ){ /*** left side compact is possible  upper is 1 based ***/
-				uint8_t   *a = (uint8_t*)split.key;
-				uint8_t   *b = (uint8_t*)node;
-
-				a += node->key_prefix_len;
-				b += node->ord[upper-1].key;
-				assert ( node->ord[upper-1].trans == split.left );
-				for(pl=0;pl < split.ksize - node->key_prefix_len && pl < node->ord[upper-1].ksize && a[pl]==b[pl];pl++){}
-				pl+=node->key_prefix_len;
-                                if(pl >= MIN_PREFIX_TO_COMPACT){
-					rc=compact_page(self,split.left,pl);
-				}
-			}
-			if(rc==0 && upper < node->count ){ /*** right side compact is possible ***/
-				uint8_t   *a = (uint8_t*)split.key;
-				uint8_t   *b = (uint8_t*)node;
-				a += node->key_prefix_len;
-				b += node->ord[upper].key;
-				for(pl=0;pl < split.ksize - node->key_prefix_len && pl < node->ord[upper].ksize && a[pl]==b[pl];pl++){}
-				pl+=node->key_prefix_len;
-                                if(pl >= MIN_PREFIX_TO_COMPACT){
-					rc=compact_page(self,split.right,pl);
-                                }
-			} 
-			if(rc == 0 ){
-				rc=branch_insert ( self, node, & split, upper );
-				assert(rc==0);
-			}
-                    }
-                }
-            }
-        }
-
-        KBTreeSplitWhack ( & split );
-
-        KPageRelease ( child );
-    }
-
-    return rc;
-}
-
-
-#if BTREE_KEY2ID
-LIB_EXPORT rc_t CC KBTreeEntry ( KBTree *self, uint64_t *id,
-    bool *was_inserted, const void *key, size_t key_size )
-#else
-LIB_EXPORT rc_t CC KBTreeEntry ( KBTree *self,
-    KBTreeValue *val, bool *was_inserted, size_t alloc_size,
-    const void *key, size_t key_size )
-#endif
-{
-    rc_t rc;
-
-    bool dummy;
-    if ( was_inserted == NULL )
-        was_inserted = & dummy;
-
-#if BTREE_KEY2ID
-    if ( id == NULL )
-#else
-    if ( val == NULL )
-#endif
-        rc = RC ( rcDB, rcTree, rcUpdating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTree, rcUpdating, rcSelf, rcNull );
-        else if ( key_size == 0 )
-            rc = RC ( rcDB, rcTree, rcUpdating, rcParam, rcEmpty );
-        else if ( key == NULL )
-            rc = RC ( rcDB, rcTree, rcUpdating, rcParam, rcNull );
-        else if ( key_size < self -> hdr . key_min )
-            rc = RC ( rcDB, rcTree, rcUpdating, rcParam, rcInsufficient );
-        else if ( key_size > self -> hdr . key_max )
-            rc = RC ( rcDB, rcTree, rcUpdating, rcParam, rcExcessive );
-        else
-        {
-            bool leaf;
-            KPage *page;
-
-#if BTREE_KEY2ID && ! BTREE_KEY2ID64
-            /* TEMPORARY
-               until full 64-bit ids are supported
-            */
-            uint32_t id32 = ( uint32_t ) * id;
-#endif
-
-            /* package the entry params into a block */
-            KBTreeEntryData pb;
-            pb . self = self;
-#if BTREE_KEY2ID64
-            pb . id = id;
-#elif BTREE_KEY2ID
-            pb . id = & id32;
-#else
-            pb . val = val;
-            pb . alloc_size = alloc_size;
-#endif
-            pb . key = key;
-            pb . key_size = key_size;
-            pb . was_inserted = false;
-
-            /* get root node */
-            if ( self -> hdr . root == 0 )
-            {
-                /* allocate initial node */
-                leaf = true;
-                rc = KPageFileAlloc ( self -> pgfile, & page, & self -> hdr . root );
-                self -> hdr . root <<= 1;
-            }
-            else
-            {
-                /* fetch existing */
-                leaf = ( self -> hdr . root & 1 ) == 0;
-                rc = KPageFileGet ( self -> pgfile, & page, self -> hdr . root >> 1 );
-            }
-            if ( rc == 0 )
-            {
-                KBTreeSplit split;
-                KBTreeSplitInit ( & split );
-
-                /* perform recursive operation */
-		/* top page is always unbounded */
-                rc = leaf ?
-                    leaf_entry ( self, & pb, page, & split ):
-                    branch_entry ( self, & pb, page, & split );
-
-#if BTREE_KEY2ID && ! BTREE_KEY2ID64
-                * id = id32;
-#endif
-                if ( rc != 0 )
-                {
-                    /* detect split */
-                    if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcId )
-                    {
-                        KPage *new_root;
-
-                        /* record old root */
-                        split . left = self -> hdr . root;
-                        rc = KPageFileAlloc ( self -> pgfile, & new_root, & self -> hdr . root );
-                        if ( rc == 0 )
-                        {
-                            KBTreeBranchNode *node;
-                            rc = page_access_update ( new_root, ( void** ) & node );
-                            if ( rc == 0 )
-                            {
-				uint16_t	q,i;
-                                /* install the new root */
-                                node -> key_bytes = split . ksize + sizeof ( uint32_t );
-                                node -> key_prefix_len = 0;
-                                node -> key_prefix = 0;
-                                node -> ord [ 0 ] . ksize = split . ksize;
-                                node -> ord [ 0 ] . key = ( uint16_t ) ( PGSIZE - node -> key_bytes );
-                                memcpy ( & ( ( uint8_t* ) node ) [ PGSIZE - node -> key_bytes ], split . key, node -> key_bytes );
-                                node -> ltrans = split . left;
-                                node -> ord [ 0 ] . trans = split . right;
-                                node -> count = 1;
-/* 				assert ( split . left < 10000 && split . right < 10000); */
-                                /*** init search windows ***/
-                                q=(split.ksize>0)? *(uint8_t*)split.key:0;
-				node -> win[q].lower = 0;
-				node -> win[q].upper = 1;
-				for(i=0;i<q;i++){
-					node -> win[i].lower = 0;
-					node -> win[i].upper = 0;
-				}
-				for(i=q+1;i<256;i++){
-					node -> win[i].lower = 1;
-					node -> win[i].upper = 1;
-				}
-				assert(validate_search_window(node->win));
-
-                                /* mark as branch node */
-                                self -> hdr . root += self -> hdr . root + 1;
-                            }
-
-                            KPageRelease ( new_root );
-                        }
-
-                        if ( rc != 0 )
-                            self -> hdr . root = split . left;
-                    }
-                }
-
-                KPageRelease ( page );
-
-                KBTreeSplitWhack ( & split );
-
-                if ( rc == 0 )
-                {
-                    * was_inserted = pb . was_inserted;
-                    return 0;
-                }
-            }
-        }
-
-#if BTREE_KEY2ID
-        * id = 0;
-#else
-        memset ( val, 0, sizeof * val );
-#endif
-    }
-
-    * was_inserted = false;
-    return rc;
-}
-
-
-/* ForEach
- *  executes a function on each tree element
- *
- *  "reverse" [ IN ] - if true, iterate in reverse order
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - callback function
- */
-#if BTREE_KEY2ID
-static
-rc_t invoke_foreach_func ( const KBTree *self, const void *cnode, const void *ordp,
-    void ( CC * f ) ( const void *key, size_t key_size, uint64_t id, void *data ), void *data )
-#else
-static
-rc_t invoke_foreach_func ( const KBTree *self, const void *cnode, const void *ordp,
-    void ( CC * f ) ( const void *key, size_t key_size, KBTreeValue *val, void *data ), void *data )
-#endif
-{
-#if ! BTREE_KEY2ID
-    rc_t rc;
-    KBTreeValue val;
-#endif
-
-    const KBTreeLeafEntry *ord = ordp;
-    const uint8_t *page = cnode;
-    const uint8_t *key = & page [ ord -> key ];
-    size_t key_size = ord -> ksize;
-
-    uint32_t val_id;
-    memcpy ( & val_id, & key [ key_size ], sizeof val_id );
-
-#if BTREE_KEY2ID
-    ( * f ) ( key, key_size, val_id, data );
-    return 0;
-#else
-    rc = KPageFileStreamGet ( & self -> hdr . val_stream, self -> pgfile, & val, val_id );
-    if ( rc == 0 )
-    {
-        ( * f ) ( key, key_size, & val, data );
-        KBTreeValueWhack ( & val );
-    }
-    return rc;
-#endif
-}
-
-#if BTREE_KEY2ID
-static
-rc_t leaf_foreach ( const KBTree *self, bool reverse, uint64_t nid,
-    void ( CC * f ) ( const void *key, size_t key_size, uint64_t id, void *data ), void *data )
-#else
-static
-rc_t leaf_foreach ( const KBTree *self, bool reverse, uint32_t nid,
-    void ( CC * f ) ( const void *key, size_t key_size, KBTreeValue *val, void *data ), void *data )
-#endif
-{
-    rc_t rc;
-    KPage *page;
-
-    if ( nid == 0 )
-        return 0;
-
-    rc = KPageFileGet ( self -> pgfile, & page, nid >> 1 );
-    if ( rc == 0 )
-    {
-        const KBTreeLeafNode *cnode;
-        rc = page_access_read ( page, ( const void** ) & cnode );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-            if ( reverse ) for ( i = cnode -> count; rc == 0 && i > 0; )
-            {
-                rc = invoke_foreach_func ( self, cnode, & cnode -> ord [ i ], f, data );
-            }
-            else for ( i = 0; rc == 0 && i < cnode -> count; ++ i )
-            {
-                rc = invoke_foreach_func ( self, cnode, & cnode -> ord [ i ], f, data );
-            }
-        }
-
-        KPageRelease ( page );
-    }
-    return rc;
-}
-
-#if BTREE_KEY2ID
-static
-rc_t branch_foreach ( const KBTree *self, bool reverse, uint64_t nid,
-    void ( CC * f ) ( const void *key, size_t key_size, uint64_t id, void *data ), void *data )
-#else
-static
-rc_t branch_foreach ( const KBTree *self, bool reverse, uint32_t nid,
-    void ( CC * f ) ( const void *key, size_t key_size, KBTreeValue *val, void *data ), void *data )
-#endif
-{
-    KPage *page;
-    rc_t rc = KPageFileGet ( self -> pgfile, & page, nid >> 1 );
-    if ( rc == 0 )
-    {
-        const KBTreeBranchNode *cnode;
-        rc = page_access_read ( page, ( const void** ) & cnode );
-        if ( rc == 0 )
-        {
-            uint32_t i, child;
-            if ( reverse )
-            {
-                for ( i = cnode -> count; rc == 0 && i > 0; )
-                {
-                    child = cnode -> ord [ -- i ] . trans;
-                    rc = ( ( child & 1 ) == 0 ) ?
-                        leaf_foreach ( self, reverse, child, f, data ):
-                        branch_foreach ( self, reverse, child, f, data );
-
-                    if ( rc == 0 )
-                        rc = invoke_foreach_func ( self, cnode, & cnode -> ord [ i ], f, data );
-                }
-                if ( rc == 0 && cnode -> count != 0 )
-                {
-                    child = cnode -> ltrans;
-                    rc = ( ( child & 1 ) == 0 ) ?
-                        leaf_foreach ( self, reverse, child, f, data ):
-                        branch_foreach ( self, reverse, child, f, data );
-                }
-            }
-            else
-            {
-                child = cnode -> ltrans;
-                rc = ( ( child & 1 ) == 0 ) ?
-                    leaf_foreach ( self, reverse, child, f, data ):
-                    branch_foreach ( self, reverse, child, f, data );
-
-                for ( i = 0; rc == 0 && i < cnode -> count; ++ i )
-                {
-                    rc = invoke_foreach_func ( self, cnode, & cnode -> ord [ i ], f, data );
-                    if ( rc == 0 )
-                    {
-                        child = cnode -> ord [ i ] . trans;
-                        rc = ( ( child & 1 ) == 0 ) ?
-                            leaf_foreach ( self, reverse, child, f, data ):
-                            branch_foreach ( self, reverse, child, f, data );
-                    }
-                }
-            }
-        }
-
-        KPageRelease ( page );
-    }
-    return rc;
-}
-
-#if BTREE_KEY2ID
-LIB_EXPORT rc_t CC KBTreeForEach ( const KBTree *self, bool reverse,
-    void ( CC * f ) ( const void *key, size_t key_size, uint64_t id, void *data ), void *data )
-#else
-LIB_EXPORT rc_t CC KBTreeForEach ( const KBTree *self, bool reverse,
-    void ( CC * f ) ( const void *key, size_t key_size, KBTreeValue *val, void *data ), void *data )
-#endif
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcDB, rcTree, rcVisiting, rcSelf, rcNull );
-    else if ( f == NULL )
-        rc = RC ( rcDB, rcTree, rcVisiting, rcFunction, rcNull );
-    else
-    {
-        rc = ( ( self -> hdr . root & 1 ) == 0 ) ?
-            leaf_foreach ( self, reverse, self -> hdr . root, f, data ):
-            branch_foreach ( self, reverse, self -> hdr . root, f, data );
-    }
-
-    return rc;
-}
diff --git a/libs/kdb/cc-priv.h b/libs/kdb/cc-priv.h
deleted file mode 100644
index fe25705..0000000
--- a/libs/kdb/cc-priv.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#ifndef _h_cc_priv_
-#define _h_cc_priv_
-
-#ifndef _h_kdb_consistency_check_
-#include <kdb/consistency-check.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-
-
-rc_t DirectoryCheckMD5 ( const KDirectory *dir, const char *name,
-    CCReportInfoBlock *info, CCReportFunc report, void *data );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_cc_priv_ */
diff --git a/libs/kdb/coldata-priv.h b/libs/kdb/coldata-priv.h
deleted file mode 100644
index 45e98c0..0000000
--- a/libs/kdb/coldata-priv.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_coldata_priv_
-#define _h_coldata_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef union KColumnPageMap KColumnPageMap;
-
-
-/*--------------------------------------------------------------------------
- * KColumnData
- *  data fork
- *
- *  only handling append-mode today
- *
- *  kept 64-bit aligned
- */
-typedef struct KColumnData KColumnData;
-struct KColumnData
-{
-    /* cached end of data fork */
-    uint64_t eof;
-
-    /* data fork itself */
-    struct KFile const *f;
-
-    /* page size */
-    size_t pgsize;
-};
-
-/* DefaultPageSize
- *  static method
- */
-#define KColumnDataDefaultPageSize( reuse_pages ) \
-    ( ( reuse_pages ) ? 4096 : 1 )
-
-/* Open
- */
-rc_t KColumnDataOpenRead ( KColumnData *self,
-    const KDirectory *dir, uint64_t eof, size_t pgsize );
-
-/* Whack
- */
-rc_t KColumnDataWhack ( KColumnData *self );
-
-/* Read
- *  reads from the data fork using a blob map
- */
-rc_t KColumnDataRead ( const KColumnData *self, const KColumnPageMap *pm,
-    size_t offset, void *buffer, size_t bsize, size_t *num_read );
-
-
-/*--------------------------------------------------------------------------
- * KColumnPageMap
- *  map of pages involved in column blob
- */
-union KColumnPageMap
-{
-    /* for non-paged data forks, a single page id
-       describes the start of the blob, where the
-       remainder is sequential */
-    uint64_t pg;
-};
-
-/* Open
- *  opens a page map by raw page id and size
- *
- *  "pm" [ OUT ] - modifiable parameter for blob page map
- *
- *  "pg" [ IN ] and "sz" [ IN ] - identifies pages of data fork included
- *  within the blob.
- */
-rc_t KColumnPageMapOpen ( KColumnPageMap *pm,
-    KColumnData *cd, uint64_t pg, size_t sz );
-
-/* Whack
- *  disposes of memory in the case of a page array
- */
-void KColumnPageMapWhack ( KColumnPageMap *self, const KColumnData *cd );
-
-/* Id
- *  captures id of initial page
- */
-rc_t KColumnPageMapId ( const KColumnPageMap *self,
-    const KColumnData *cd, uint64_t *pg );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_coldata_priv_ */
diff --git a/libs/kdb/coldata.c b/libs/kdb/coldata.c
deleted file mode 100644
index 8434b7f..0000000
--- a/libs/kdb/coldata.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "coldata-priv.h"
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-
-#define DATA_READ_FILE_BUFFER 32* 1024
-
-
-/*--------------------------------------------------------------------------
- * KColumnData
- */
-
-
-/* Init
- */
-static
-rc_t KColumnDataInit ( KColumnData *self, uint64_t pos, size_t pgsize )
-{
-    rc_t rc = KFileSize ( self -> f, & self -> eof );
-    if ( rc == 0 )
-    {
-        if ( self -> eof < pos || pgsize == 0 || ( pos % pgsize ) != 0 )
-            rc = RC ( rcDB, rcColumn, rcConstructing, rcData, rcCorrupt );
-        else
-        {
-            self -> eof = pos;
-            self -> pgsize = pgsize;
-            return 0;
-        }
-    }
-
-    KFileRelease ( self -> f );
-    self -> f = NULL;
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnDataOpenRead ( KColumnData *self,
-    const KDirectory *dir, uint64_t eof, size_t pgsize )
-{
-    rc_t rc = KDirectoryVOpenFileRead ( dir,
-        & self -> f, "data", NULL );
-#if DATA_READ_FILE_BUFFER
-    if ( rc == 0 )
-    {
-        const KFile * orig = self -> f;
-        rc = KBufFileMakeRead ( & self -> f, self -> f, DATA_READ_FILE_BUFFER );
-	if ( rc == 0 )
-        {
-            KFileRelease ( orig );
-        }
-        else
-        {
-            self -> f = orig;
-            rc = 0;
-        }
-    }
-#endif
-    if ( rc == 0 )
-        rc = KColumnDataInit ( self, eof, pgsize );
-    return rc;
-}
-
-/* Whack
- */
-rc_t KColumnDataWhack ( KColumnData *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-        self -> f = NULL;
-    return rc;
-}
-
-/* Read
- *  reads from the data fork using a blob map
- */
-rc_t KColumnDataRead ( const KColumnData *self, const KColumnPageMap *pm,
-    size_t offset, void *buffer, size_t bsize, size_t *num_read )
-{
-    uint64_t pos;
-
-    assert ( self != NULL );
-    assert ( pm != NULL );
-
-    if ( bsize == 0 )
-    {
-        assert ( num_read != NULL );
-        * num_read = 0;
-        return 0;
-    }
-
-    pos = pm -> pg * self -> pgsize;
-    return KFileRead ( self -> f, pos + offset, buffer, bsize, num_read );
-}
-
-
-/*--------------------------------------------------------------------------
- * KColumnPageMap
- *  map of pages involved in column blob
- */
-
-/* Open
- *  opens an blob by raw page id and size
- *
- *  "pm" [ OUT ] - modifiable parameter for blob page map
- *
- *  "pg" [ IN ] and "sz" [ IN ] - identifies pages of data fork included
- *  within the blob.
- */
-rc_t KColumnPageMapOpen ( KColumnPageMap *self,
-    KColumnData *cd, uint64_t pg, size_t sz )
-{
-    uint64_t pos;
-
-    assert ( cd != NULL );
-    pos = pg * cd -> pgsize;
-    if ( pos + sz > cd -> eof )
-    {
-        if ( pos >= cd -> eof )
-            return RC ( rcDB, rcBlob, rcOpening, rcPagemap, rcExcessive );
-        return RC ( rcDB, rcBlob, rcOpening, rcRange, rcExcessive );
-    }
-
-    assert ( self != NULL );
-    self -> pg = pg;
-
-    return 0;
-}
-
-/* Whack
- *  disposes of memory in the case of a page array
- */
-void KColumnPageMapWhack ( KColumnPageMap *self, const KColumnData *cd )
-{
-    assert ( self != NULL );
-    assert ( cd != NULL );
-}
-
-/* Id
- *  captures id of initial page
- */
-rc_t KColumnPageMapId ( const KColumnPageMap *self,
-    const KColumnData *cd, uint64_t *pg )
-{
-    assert ( self != NULL );
-    assert ( cd != NULL );
-    assert ( pg != NULL );
-
-    * pg = self -> pg;
-    return 0;
-}
diff --git a/libs/kdb/colfmt-priv.h b/libs/kdb/colfmt-priv.h
deleted file mode 100644
index 0564ede..0000000
--- a/libs/kdb/colfmt-priv.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colfmt_priv_
-#define _h_colfmt_priv_
-
-#ifndef _h_kdbfmt_priv_
-#include "kdbfmt-priv.h"
-#endif
-
-#include <endian.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColLocDesc
- *  general location descriptor
- */
-typedef struct KColLocDesc KColLocDesc;
-struct KColLocDesc
-{
-    /* the data fork page id */
-    uint64_t pg;
-
-    union
-    {
-        /* pertains to KColBlobLoc */
-        struct
-        {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            /* the blob size in bytes */
-            uint32_t size : 31;
-
-            /* used for level-0 journal */
-            uint32_t remove : 1;
-#else
-            uint32_t remove : 1;
-            uint32_t size : 31;
-#endif
-        } blob;
-
-        /* pertains to KColBlockLoc */
-        struct
-        {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            /* the block size in bytes */
-            uint32_t size : 27;
-
-            /* block type */
-            uint32_t id_type : 2;
-            uint32_t pg_type : 2;
-
-            /* block compression */
-            uint32_t compressed : 1;
-#else
-            uint32_t compressed : 1;
-            uint32_t pg_type : 2;
-            uint32_t id_type : 2;
-            uint32_t size : 27;
-#endif
-        } blk;
-
-        /* the general 32 bits */
-        uint32_t gen;
-
-    } u;
-
-    /* the id range */
-    uint32_t id_range;
-    int64_t start_id;
-};
-
-
-/*--------------------------------------------------------------------------
- * KColBlobLoc
- *  a single blob locator
- *  stored in level-0 index
- *  and in various compressed forms in level-2
- */
-typedef struct KColLocDesc KColBlobLoc;
-
-
-/*--------------------------------------------------------------------------
- * KColBlockLoc
- *  an index block locator
- *  stored in level-1 index
- *
- *  the type ids pertain to group representation of { start_id, id_range }
- *  and { pg, size } from KColBlobLoc. An individual KColBlobLoc has no
- *  context and must represent all data. a KColBlockLoc stores grouped locators
- *  and can economize on representations.
- *
- *  there are 4 types of representations applied to each index and data:
- *   0) fully specified "random" access - having { id, range } or { pg, size }
- *      this type can group together locators with no apparent relationship
- *      whatsoever. they are stored within a b-tree ordered by id.
- *
- *   1) uniformly sized discontiguous sequence - any time the range/size is a
- *      constant, then it needs only to be represented once.
- *
- *   2) predictable sequence - when id/pg [ n + 1 ] == id/pg [ n ] +
- *      range/size [ n ] they need not both be stored since the range/size
- *      is a delta of id/pg. the storage format is by magnitude while
- *      the in-core format is by id, with a 32-bit magnitude of the
- *      final entry in a header.
- *
- *   3) uniformly sized contiguous sequence - when the conditions of type #2 apply
- *      and the range/size is always the same, then all values except for the
- *      count are known and may be eliminated.
- *
- *  the specific interpretation of KColBlockLoc depends upon the combination
- *  of id and pg types:
- *
- *   a) when both are "btypePredictable"
- *      "pos"       => idx2 offset to 12 byte block
- *      "size"      => "count", i.e. number of blobs in block
- *      "start_id"  => first id in block
- *      "id_range"  => span of ids, evenly divided into "count" blob indices
- *      "block::pg" => data offset to first blob in block
- *      "block::sz" => size of each blob in block
- *
- *   b) when id type is "btypePredictable":
- *      "pos"       => idx2 offset to dynamically sized block
- *      "size"      => size of block
- *      "start_id"  => first id in block
- *      "id_range"  => span of ids, evenly divided into "count" blob indices
- *      "count"     => functionally derived from pg type and "size"
- *
- *   c) all other cases:
- *      "pos"       => idx2 offset to dynamically sized block
- *      "size"      => size of block
- *      "start_id"  => first id in block
- *      "id_range"  => span of ids
- *      "count"     => functionally derived from id/pg types and "size"
- */
-enum
-{
-    btypeRandom,       /* { pg/id, span/sz } */
-    btypeUniform,      /* { pg/id }          */
-    btypeMagnitude,    /* { span/sz }        */
-    btypePredictable   /* {}                 */
-};
-
-typedef struct KColLocDesc KColBlockLoc;
-
-
-/* KColumnHdr
- *  stored in either "idx1" ( under v1 )
- *  or in "idx" ( v2+ )
- *
- *  in ALL cases, "idx1" starts with at least
- *  a HDBHdr giving the column's current version.
- *  when this version == 1, then the entire header
- *  is in idx1.
- *
- * - ALL VERSIONS -
- *  "dad" - gives endian and version information
- *
- * - VERSION 1 -
- *  "data_eof" - official eof of last segment of data fork
- *
- *  "idx2_eof" - official eof of idx block fork
- *
- *  "num_blocks" - describes the number of idx blocks
- *  in idx2, as well as the number of block descriptors
- *  ( KColBlockLoc ) in idx1.
- *
- *  "page_size" - number of bytes in data pages.
- *  when 1 ( in practice anything less than some higher
- *  power of 2, 64 minimum, 4K typical, 64K etc. ), the
- *  data fork operates in append mode.
- *
- *  "checksum" - one of the blob-wise checksum modes:
- *  kcsNone, kcsCRC32, kcsMD5, tbd...
- *
- *  "align" - round header size out to multiples of 8 bytes
- *
- * - VERSION 3 -
- *  "idx0_count" - a committed entry count on idx0. in v1, this
- *  was always inferred from the file system. in v2, the code
- *  was never writing this value, so it's garbage.
- *
- * - VERSION 4 -
- *  idx1 needs to be written in straight-shot mode when MD5
- *  is involved. in version 3 it had been written in append mode.
- *
- * - VERSION 5 -
- *  "data_limit" - when not zero, imposes a limit for opening
- *  new blobs in append mode and an absolute file size limit
- *  in paged mode ( requiring limit to be a multiple of page_size ).
- *
- *  "data_total" - total size of all segments of data fork
- *
- *  "data_seg" - zero-based id of last data segment
- */
-#define KCOL_CURRENT_VERSION 3
-#define vCUR v3
-
-typedef struct KColumnHdr KColumnHdr;
-struct KColumnHdr
-{
-    KDBHdr dad;
-
-    union
-    {
-        /* v1 header */
-        struct
-        {
-            uint64_t data_eof;
-            uint64_t idx2_eof;
-            uint32_t num_blocks;
-            uint32_t page_size;
-            uint8_t checksum;
-
-            uint8_t align1 [ 7 ];
-
-        } v1;
-
-        /* v2 header - note one field should be ignored */
-        struct
-        {
-            uint64_t data_eof;
-            uint64_t idx2_eof;
-            uint32_t ignore;
-            uint32_t num_blocks;
-            uint32_t page_size;
-            uint8_t checksum;
-
-            uint8_t align1 [ 3 ];
-
-        } v2;
-
-        /* v3 header - same as v2, except idx2_count is
-           being populated by the implementation */
-
-        /* v4 header - same as v3 in every way
-           except that idx1 is expected to be
-           written without MD5 append-mode information */
-        struct
-        {
-            uint64_t data_eof;
-            uint64_t idx2_eof;
-            uint32_t idx0_count;
-            uint32_t num_blocks;
-            uint32_t page_size;
-            uint8_t checksum;
-
-            uint8_t align1 [ 3 ];
-
-        } v3, v4;
-
-        /* v5 header ( proposed ) - supports multi-file data fork */
-        struct
-        {
-            uint64_t data_limit;
-            uint64_t data_total;
-            uint64_t data_eof;
-            uint64_t idx2_eof;
-            uint32_t idx0_count;
-            uint32_t num_blocks;
-            uint32_t page_size;
-            uint32_t data_seg;
-            uint8_t checksum;
-
-            uint8_t align1 [ 7 ];
-
-        } v5;
-
-    } u;
-};
-
-/* NULL_HDR
- *  substitute for a variable when needed
- */
-#define NULL_HDR \
-    ( * ( const KColumnHdr* ) 0 )
-
-/* KColumnHdrOffset
- *  calculates the idx file offset to beginning of indices
- */
-#define KColumnHdrOffset( hdr, var ) \
-    ( sizeof ( hdr ) - sizeof ( hdr ) . u + sizeof ( hdr ) . u . var )
-
-/* KColumnHdrMinSize
- *  calculates the minimum size of a header
- */
-#define KColumnHdrMinSize( hdr ) \
-    sizeof ( hdr ) . dad
-
-/* KColBlockLocEntryCount - INTERNAL
- *  returns the number of entries within a block
- *  uses the original size of the uncompressed block
- *
- *  "orig" [ IN, OUT ] - taken as the original size of an
- *  uncompressed block, but may be updated in the case of
- *  all predictable types.
- */
-uint32_t KColBlockLocEntryCount ( const KColBlockLoc *self, size_t *orig );
-
-/* KColBlockLocAllocSize - INTERNAL
- *  returns a size for the block
- *  since a type 3 index ( range/size only ) is nice for storage
- *  but needs to be converted to id/pos for in-memory lookup
- */
-size_t KColBlockLocAllocSize ( const KColBlockLoc *self,
-    size_t orig, uint32_t count );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colfmt_priv_ */
diff --git a/libs/kdb/colidx-priv.h b/libs/kdb/colidx-priv.h
deleted file mode 100644
index 0ef7849..0000000
--- a/libs/kdb/colidx-priv.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx_priv_
-#define _h_colidx_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_colidx0_priv_
-#include "colidx0-priv.h"
-#endif
-
-#ifndef _h_colidx1_priv_
-#include "colidx1-priv.h"
-#endif
-
-#ifndef _h_colidx2_priv_
-#include "colidx2-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx
- *  the index fork
- */
-typedef struct KColumnIdx KColumnIdx;
-struct KColumnIdx
-{
-    /* first active id within db
-       and first id on upper limit
-       i.e. outside of db such that
-       id_upper - id_first == num_ids */
-    int64_t id_first;
-    int64_t id_upper;
-
-    /* level 0 index */
-    KColumnIdx0 idx0;
-
-    /* level 1 index */
-    KColumnIdx1 idx1;
-
-    /* level 2 index */
-    KColumnIdx2 idx2;
-};
-
-/* Open
- */
-rc_t KColumnIdxOpenRead ( KColumnIdx *self, const KDirectory *dir,
-    uint64_t *data_eof, size_t *pgsize, int32_t *checksum );
-
-/* Whack
- */
-rc_t KColumnIdxWhack ( KColumnIdx *self );
-
-/* Version
- */
-rc_t KColumnIdxVersion ( const KColumnIdx *self, uint32_t *version );
-#define KColumnIdxVersion( self, version ) \
-    KColumnIdx1Version ( & ( self ) -> idx1, version )
-
-/* ByteOrder
- */
-rc_t KColumnIdxByteOrder ( const KColumnIdx *self, bool *reversed );
-#define KColumnIdxByteOrder( self, reversed ) \
-    KColumnIdx1ByteOrder ( & ( self ) -> idx1, reversed )
-
-/* IdRange
- *  returns range of ids contained within
- */
-rc_t KColumnIdxIdRange ( const KColumnIdx *self,
-    int64_t *first, int64_t *last );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdxLocateBlob ( const KColumnIdx *self,
-    KColBlobLoc *loc, int64_t first, int64_t last );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx_priv_ */
diff --git a/libs/kdb/colidx.c b/libs/kdb/colidx.c
deleted file mode 100644
index 6ac7941..0000000
--- a/libs/kdb/colidx.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "colidx-priv.h"
-#include "idxblk-priv.h"
-#include <kfs/file.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx
- *  the index fork
- */
-
-
-/* EstablishIdRange
- */
-static
-void KColumnIdxEstablishIdRange ( KColumnIdx *self )
-{
-    int64_t first, upper;
-
-    if ( ! KColumnIdx0IdRange ( & self -> idx0, & self -> id_first, & self -> id_upper ) )
-    {
-        if ( ! KColumnIdx1IdRange ( & self -> idx1, & self -> id_first, & self -> id_upper ) )
-            self -> id_first = self -> id_upper = 1;
-    }
-    else if ( KColumnIdx1IdRange ( & self -> idx1, & first, & upper ) )
-    {
-        if ( self -> id_first > first )
-            self -> id_first = first;
-        if ( self -> id_upper < upper )
-            self -> id_upper = upper;
-    }
-}
-
-/* Open
- */
-rc_t KColumnIdxOpenRead ( KColumnIdx *self, const KDirectory *dir,
-    uint64_t *data_eof, size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-    uint64_t idx2_eof;
-    uint32_t idx0_count;
-
-    assert ( self != NULL );
-
-    rc = KColumnIdx1OpenRead ( & self -> idx1,
-        dir, data_eof, & idx0_count, & idx2_eof, pgsize, checksum );
-    if ( rc == 0 )
-    {
-        rc = ( self -> idx1 . vers < 3 ) ?
-            KColumnIdx0OpenRead_v1 ( & self -> idx0, dir, self -> idx1 . bswap ):
-            KColumnIdx0OpenRead ( & self -> idx0, dir, idx0_count, self -> idx1 . bswap );
-        if ( rc == 0 )
-        {
-            rc = KColumnIdx2OpenRead ( & self -> idx2, dir, idx2_eof );
-            if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-            {
-                KColumnIdxEstablishIdRange ( self );
-                return 0;
-            }
-
-            KColumnIdx0Whack ( & self -> idx0 );
-        }
-
-        KColumnIdx1Whack ( & self -> idx1 );
-    }
-
-    return 0;
-}
-
-/* Whack
- */
-rc_t KColumnIdxWhack ( KColumnIdx *self )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-
-    rc = KColumnIdx1Whack ( & self -> idx1 );
-    if ( rc == 0 )
-    {
-        KColumnIdx0Whack ( & self -> idx0 );
-        KColumnIdx2Whack ( & self -> idx2 );
-    }
-
-    return rc;
-}
-
-/* Version
- */
-#ifndef KColumnIdxVersion
-rc_t KColumnIdxVersion ( const KColumnIdx *self, uint32_t *version )
-{
-    return KColumnIdx1Version ( & self -> idx1, version );
-}
-#endif
-
-/* IdRange
- *  returns range of ids contained within
- */
-rc_t KColumnIdxIdRange ( const KColumnIdx *self,
-    int64_t *first, int64_t *last )
-{
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( last != NULL );
-
-    * first = self -> id_first;
-    * last = self -> id_upper - 1;
-
-    if ( self -> id_first == self -> id_upper )
-        return RC ( rcDB, rcColumn, rcAccessing, rcRange, rcInvalid );
-    return 0;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdxLocateBlob ( const KColumnIdx *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-
-    /* convert "last" to "upper" */
-    if ( first >= ++ upper )
-        return RC ( rcDB, rcColumn, rcSelecting, rcRange, rcInvalid );
-
-    /* global reject */
-    if ( first < self -> id_first || upper > self -> id_upper )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-
-    /* look in idx0 */
-    rc = KColumnIdx0LocateBlob ( & self -> idx0, loc, first, upper );
-    if ( GetRCState ( rc ) == rcNotFound )
-    {
-        KColBlockLoc bloc;
-
-        /* find block containing range */
-        rc = KColumnIdx1LocateBlock ( & self -> idx1, & bloc, first, upper );
-        if ( rc == 0 )
-        {
-            /* find location in idx2 */
-            rc = KColumnIdx2LocateBlob ( & self -> idx2,
-                loc, & bloc, first, upper, self -> idx1 . bswap );
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/kdb/colidx0-priv.h b/libs/kdb/colidx0-priv.h
deleted file mode 100644
index ff3c421..0000000
--- a/libs/kdb/colidx0-priv.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx0_priv_
-#define _h_colidx0_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0
- *  level 0 index - event journaling
- */
-typedef struct KColumnIdx0 KColumnIdx0;
-struct KColumnIdx0
-{
-    /* the in-core indices */
-    BSTree bst;
-    size_t count;
-};
-
-
-/* Open
- */
-rc_t KColumnIdx0OpenRead_v1 ( KColumnIdx0 *self,
-    const KDirectory *dir, bool bswap );
-rc_t KColumnIdx0OpenRead ( KColumnIdx0 *self,
-    const KDirectory *dir, uint32_t count, bool bswap );
-
-/* Whack
- */
-void KColumnIdx0Whack ( KColumnIdx0 *self );
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx0IdRange ( const KColumnIdx0 *self,
-    int64_t *first, int64_t *upper );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx0LocateBlob ( const KColumnIdx0 *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx0_priv_ */
diff --git a/libs/kdb/colidx0.c b/libs/kdb/colidx0.c
deleted file mode 100644
index b0f2653..0000000
--- a/libs/kdb/colidx0.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "colidx0-priv.h"
-#include <kfs/file.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0Node
- *  a b-tree node
- */
-typedef struct KColumnIdx0Node KColumnIdx0Node;
-struct KColumnIdx0Node
-{
-    BSTNode n;
-    KColBlobLoc loc;
-};
-
-/* Find
- */
-static
-int CC KColumnIdx0NodeFind ( const void *item, const BSTNode *n )
-{
-#define a ( * ( const int64_t* ) item )
-#define b ( ( const KColumnIdx0Node* ) n )
-
-    if ( a < b -> loc . start_id )
-        return -1;
-    return a >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Sort
- */
-static
-int CC KColumnIdx0NodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KColumnIdx0Node* ) item )
-#define b ( ( const KColumnIdx0Node* ) n )
-
-    if ( ( a -> loc . start_id + a -> loc . id_range ) <= b -> loc . start_id )
-        return -1;
-    return a -> loc . start_id >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Whack
- */
-static
-void CC KColumnIdx0NodeWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/* Next
- */
-#define KColumnIdx0NodeNext( node ) \
-    ( const KColumnIdx0Node* ) BSTNodeNext ( & ( node ) -> n )
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0
- *  level 0 index - event journaling
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx0Inflate ( KColumnIdx0 *self,
-     const KColBlobLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    KColumnIdx0Node *n;
-
-    for ( n = NULL, i = 0; i < count; ++ i )
-    {
-        KColumnIdx0Node *exist;
-
-        if ( n == NULL )
-        {
-            n = malloc ( sizeof * n );
-            if ( n == NULL )
-                return RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-        }
-
-        n -> loc = buffer [ i ];
-        if ( BSTreeInsertUnique ( & self -> bst,
-             & n -> n, ( BSTNode** ) & exist, KColumnIdx0NodeSort ) )
-        {
-            assert ( n -> loc . start_id == exist -> loc . start_id );
-            assert ( n -> loc . id_range == exist -> loc . id_range );
-
-            assert ( ! n -> loc . u . blob . remove );
-            exist -> loc . pg = n -> loc . pg;
-            exist -> loc . u . blob . size = n -> loc . u . blob . size;
-        }
-        else
-        {
-            ++ self -> count;
-            n = NULL;
-        }
-    }
-
-    free ( n );
-
-    return 0;
-}
-
-static
-void KColumnIdx0Swap ( KColBlobLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        buffer [ i ] . pg = bswap_64 ( buffer [ i ] . pg );
-        buffer [ i ] . u . gen = bswap_32 ( buffer [ i ] . u . gen );
-        buffer [ i ] . id_range = bswap_32 ( buffer [ i ] . id_range );
-        buffer [ i ] . start_id = bswap_64 ( buffer [ i ] . start_id );
-    }
-}
-
-static
-rc_t KColumnIdx0Init_v1 ( KColumnIdx0 *self, const KFile *f, bool bswap )
-{
-    rc_t rc;
-    KColBlobLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        uint64_t pos;
-        size_t num_read;
-
-        for ( pos = 0;; pos += num_read )
-        {
-            uint32_t count;
-
-            rc = KFileReadAll ( f, pos,
-                buffer, 2048 * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-            if ( num_read == 0 )
-                break;
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcColumn, rcConstructing, rcIndex, rcCorrupt );
-                break;
-            }
-
-            count = (uint32_t)( num_read / sizeof * buffer );
-
-            if ( bswap )
-                KColumnIdx0Swap ( buffer, count );
-
-            rc = KColumnIdx0Inflate ( self, buffer, count );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-static
-rc_t KColumnIdx0Init ( KColumnIdx0 *self, const KFile *f, uint32_t total, bool bswap )
-{
-    rc_t rc;
-    KColBlobLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        uint32_t i, count;
-
-        for ( rc = 0, i = 0; i < total; i += count )
-        {
-            size_t num_read;
-
-            count = total - i;
-            if ( count > 2048 )
-                count = 2048;
-
-            rc = KFileReadAll ( f, i * sizeof * buffer,
-                buffer, count * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-
-            /* detect EOF */
-            if ( num_read == 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcData, rcCorrupt );
-                break;
-            }
-
-            /* detect short read -
-               see comment in idx1. */
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTransfer, rcIncomplete );
-                break;
-            }
-
-            count = (uint32_t)( num_read / sizeof * buffer );
-
-            if ( bswap )
-                KColumnIdx0Swap ( buffer, count );
-
-            rc = KColumnIdx0Inflate ( self, buffer, count );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx0OpenRead_v1 ( KColumnIdx0 *self, const KDirectory *dir, bool bswap )
-{
-    rc_t rc;
-    uint64_t eof;
-
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-
-    rc = KDirectoryVFileSize ( dir, & eof, "idx0", NULL );
-    if ( rc == 0 )
-    {
-        if ( eof != 0 )
-        {
-            const KFile *f;
-            rc = KDirectoryVOpenFileRead ( dir, & f, "idx0", NULL );
-            if ( rc == 0 )
-            {
-                rc = KColumnIdx0Init_v1 ( self, f, bswap );
-                KFileRelease ( f );
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = 0;
-    }
-
-    return rc;
-}
-
-rc_t KColumnIdx0OpenRead ( KColumnIdx0 *self, const KDirectory *dir, uint32_t count, bool bswap )
-{
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-
-    if ( count != 0 )
-    {
-        const KFile *f;
-        rc_t rc = KDirectoryVOpenFileRead ( dir, & f, "idx0", NULL );
-        if ( rc == 0 )
-        {
-            rc = KColumnIdx0Init ( self, f, count, bswap );
-            KFileRelease ( f );
-        }
-        return rc;
-    }
-
-    return 0;
-}
-
-/* Whack
- */
-void KColumnIdx0Whack ( KColumnIdx0 *self )
-{
-    BSTreeWhack ( & self -> bst, KColumnIdx0NodeWhack, NULL );
-    BSTreeInit ( & self -> bst );
-}
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx0IdRange ( const KColumnIdx0 *self,
-    int64_t *first, int64_t *upper )
-{
-    const KColumnIdx0Node *a, *z;
-
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( upper != NULL );
-
-    a = ( const KColumnIdx0Node* ) BSTreeFirst ( & self -> bst );
-    if ( a == NULL )
-        return false;
-
-    z = ( const KColumnIdx0Node* ) BSTreeLast ( & self -> bst );
-    assert ( z != NULL );
-
-    * first = a -> loc . start_id;
-    * upper = z -> loc . start_id + z -> loc . id_range;
-    assert ( * first < * upper );
-
-    return true;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx0LocateBlob ( const KColumnIdx0 *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper )
-{
-    const KColumnIdx0Node *n;
-
-    assert ( self != NULL );
-    assert ( loc != NULL );
-    assert ( first < upper );
-
-    n = ( const KColumnIdx0Node* )
-        BSTreeFind ( & self -> bst, & first, KColumnIdx0NodeFind );
-
-    if ( n == NULL )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-
-    assert ( first >= n -> loc . start_id );
-    assert ( first < ( n -> loc . start_id + n -> loc . id_range ) );
-
-    if ( upper > ( n -> loc . start_id + n -> loc . id_range ) )
-        return RC ( rcDB, rcColumn, rcSelecting, rcRange, rcInvalid );
-
-    * loc = n -> loc;
-    assert ( ! loc -> u . blob . remove );
-    return 0;
-}
diff --git a/libs/kdb/colidx1-priv.h b/libs/kdb/colidx1-priv.h
deleted file mode 100644
index 37fe3cf..0000000
--- a/libs/kdb/colidx1-priv.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx1_priv_
-#define _h_colidx1_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColIdxBlock;
-struct KColBlockLocInfo;
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1
- *  level 1 index
- */
-typedef struct KColumnIdx1 KColumnIdx1;
-struct KColumnIdx1
-{
-    /* tree of level-2 block locators */
-    BSTree bst;
-    struct KFile const *f;
-    struct KFile const *fidx;
-    uint32_t count;
-    uint32_t vers;
-    bool bswap;
-    uint8_t align [ sizeof ( size_t ) - 1 ];
-};
-
-/* Open
- */
-rc_t KColumnIdx1OpenRead ( KColumnIdx1 *self, const KDirectory *dir,
-    uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-    size_t *pgsize, int32_t *checksum );
-
-/* Whack
- */
-rc_t KColumnIdx1Whack ( KColumnIdx1 *self );
-
-/* Version
- */
-rc_t KColumnIdx1Version ( const KColumnIdx1 *self, uint32_t *version );
-#define KColumnIdx1Version( self, version ) \
-    ( * ( version ) = ( self ) -> vers, 0 )
-
-/* ByteOrder
- */
-rc_t KColumnIdx1ByteOrder ( const KColumnIdx1 *self, bool *reversed );
-#define KColumnIdx1ByteOrder( self, reversed ) \
-    ( * ( reversed ) = ( self ) -> bswap, 0 )
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx1IdRange ( const KColumnIdx1 *self,
-    int64_t *first, int64_t *upper );
-
-/* LocateBlock
- *  locates an idx2 block by range
- */
-rc_t KColumnIdx1LocateBlock ( const KColumnIdx1 *self,
-    KColBlockLoc *bloc, int64_t first, int64_t upper );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx1_priv_ */
diff --git a/libs/kdb/colidx1.c b/libs/kdb/colidx1.c
deleted file mode 100644
index 83439de..0000000
--- a/libs/kdb/colidx1.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "colidx1-priv.h"
-#include <kfs/file.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1Node
- *  a binary search tree node
- */
-typedef struct KColumnIdx1Node KColumnIdx1Node;
-struct KColumnIdx1Node
-{
-    BSTNode n;
-    KColBlockLoc loc;
-};
-
-/* Find
- */
-static
-int CC KColumnIdx1NodeFind ( const void *item, const BSTNode *n )
-{
-#define a ( * ( const int64_t* ) item )
-#define b ( ( const KColumnIdx1Node* ) n )
-
-    if ( a < b -> loc . start_id )
-        return -1;
-    return a >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Sort
- */
-static
-int CC KColumnIdx1NodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KColumnIdx1Node* ) item )
-#define b ( ( const KColumnIdx1Node* ) n )
-
-    if ( ( a -> loc . start_id + a -> loc . id_range ) <= b -> loc . start_id )
-        return -1;
-    return a -> loc . start_id >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Whack
- */
-static
-void CC KColumnIdx1NodeWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1
- *  level 1 index
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx1Inflate ( KColumnIdx1 *self,
-    const KColBlockLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        KColumnIdx1Node *exist, *n = malloc ( sizeof * n );
-        if ( n == NULL )
-            return RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-
-        n -> loc = buffer [ i ];
-        if ( BSTreeInsertUnique ( & self -> bst,
-             & n -> n, ( BSTNode** ) & exist, KColumnIdx1NodeSort ) )
-        {
-            free ( n );
-            return RC ( rcDB, rcColumn, rcConstructing, rcIndex, rcCorrupt );
-        }
-
-        ++ self -> count;
-    }
-
-    return 0;
-}
-
-static
-void KColumnIdx1Swap ( KColBlockLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        buffer [ i ] . pg = bswap_64 ( buffer [ i ] . pg );
-        buffer [ i ] . u . gen = bswap_32 ( buffer [ i ] . u . gen );
-        buffer [ i ] . id_range = bswap_32 ( buffer [ i ] . id_range );
-        buffer [ i ] . start_id = bswap_64 ( buffer [ i ] . start_id );
-    }
-}
-
-static
-rc_t KColumnIdx1Init ( KColumnIdx1 *self, uint32_t off, uint32_t count )
-{
-    rc_t rc;
-    KColBlockLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-        uint32_t i, cnt;
-        for ( rc = 0, i = 0; i < count; off += ( uint32_t ) num_read, i += cnt )
-        {
-            cnt = count - i;
-            if ( cnt > 2048 )
-                cnt = 2048;
-
-            rc = KFileReadAll ( self -> f, off,
-                buffer, cnt * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-            if ( num_read == 0 )
-                break;
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcColumn, rcConstructing, rcIndex, rcCorrupt );
-                break;
-            }
-
-            if ( self -> bswap )
-                KColumnIdx1Swap ( buffer, cnt );
-
-            rc = KColumnIdx1Inflate ( self, buffer, cnt );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx1OpenRead ( KColumnIdx1 *self, const KDirectory *dir,
-    uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-    size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-    self -> vers = 0;
-    self -> bswap = false;
-    self -> fidx = NULL;
-            
-    rc = KDirectoryVOpenFileRead ( dir, & self -> f, "idx1", NULL );
-    if ( rc == 0 )
-    {
-        KColumnHdr hdr;
-        size_t num_bytes;
-        rc = KFileReadAll ( self -> f, 0, & hdr, sizeof hdr, & num_bytes );
-        if ( rc == 0 )
-        {
-            if ( num_bytes == 0 )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcNotFound );
-            else if ( num_bytes < KColumnHdrMinSize ( hdr ) )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-            else
-            {
-                rc = KDBHdrValidate ( & hdr . dad, num_bytes, 1, KCOL_CURRENT_VERSION );
-                if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                {
-                    self -> bswap = true;
-                    hdr . dad . endian = bswap_32 ( hdr . dad . endian );
-                    hdr . dad . version = bswap_32 ( hdr . dad . version );
-                    rc = KDBHdrValidate ( & hdr . dad, num_bytes, 1, KCOL_CURRENT_VERSION );
-                }
-                if ( rc == 0 )
-                {
-                    uint32_t off, count;
-
-                    switch ( hdr . dad . version )
-                    {
-                    case 1:
-                        if ( num_bytes < KColumnHdrOffset ( hdr, v1 ) )
-                            rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                        else
-                        {
-                            if ( self -> bswap )
-                            {
-                                hdr . u . v1 . data_eof = bswap_64 ( hdr . u . v1 . data_eof );
-                                hdr . u . v1 . idx2_eof = bswap_64 ( hdr . u . v1 . idx2_eof );
-                                hdr . u . v1 . num_blocks = bswap_32 ( hdr . u . v1 . num_blocks );
-                                hdr . u . v1 . page_size = bswap_32 ( hdr . u . v1 . page_size );
-                            }
-
-                            * data_eof = hdr . u . v1 . data_eof;
-                            * idx2_eof = hdr . u . v1 . idx2_eof;
-                            * pgsize = hdr . u . v1 . page_size;
-                            * checksum = hdr . u . v1 . checksum;
-                            count = hdr . u . v1 . num_blocks;
-                            off = KColumnHdrOffset ( hdr, v1 );
-
-                            /* not supported in v1 */
-                            * idx0_count = 0;
-                        }
-                        break;
-
-                    default:
-                        rc = KDirectoryVOpenFileRead ( dir, ( const KFile** ) & self -> fidx, "idx", NULL );
-                        if ( rc == 0 )
-                        {
-                            off = sizeof hdr . dad;
-                            rc = KFileReadAll ( self -> fidx, 0, & hdr, sizeof hdr, & num_bytes );
-                            if ( rc == 0 )
-                            {
-                                if ( num_bytes < KColumnHdrOffset ( hdr, v2 ) )
-                                    rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                                else
-                                {
-                                    rc = KDBHdrValidate ( & hdr . dad,
-                                        num_bytes, 2, KCOL_CURRENT_VERSION );
-                                    if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                                    {
-                                        if ( ! self->bswap ) /* catch mis-matched endianess */
-                                            rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                                        else
-                                        {
-                                            hdr . dad . endian = bswap_32 ( hdr . dad . endian );
-                                            hdr . dad . version = bswap_32 ( hdr . dad . version );
-                                            rc = KDBHdrValidate ( & hdr . dad, num_bytes, 1, KCOL_CURRENT_VERSION );
-                                        }
-                                    }
-                                    else if ( self -> bswap ) /* catch mis-matched endianess */
-                                        rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-
-                                    if ( rc == 0 ) switch ( hdr . dad . version )
-                                    {
-                                    case 2:
-                                        if ( self -> bswap )
-                                        {
-                                            hdr. u . v2 . data_eof = bswap_64 ( hdr. u . v2 . data_eof );
-                                            hdr. u . v2 . idx2_eof = bswap_64 ( hdr. u . v2 . idx2_eof );
-                                            hdr. u . v2 . num_blocks = bswap_32 ( hdr. u . v2 . num_blocks );
-                                            hdr. u . v2 . page_size = bswap_32 ( hdr. u . v2 . page_size );
-                                        }
-
-                                        * data_eof = hdr . u . v2 . data_eof;
-                                        * idx2_eof = hdr . u . v2 . idx2_eof;
-                                        * pgsize = hdr . u . v2 . page_size;
-                                        * checksum = hdr . u . v2 . checksum;
-                                        count = hdr . u . v2 . num_blocks;
-                                        * idx0_count = 0;
-                                        break;
-
-                                    case 3:
-                                        if ( self -> bswap )
-                                        {
-                                            hdr. u . v3 . data_eof = bswap_64 ( hdr. u . v3 . data_eof );
-                                            hdr. u . v3 . idx2_eof = bswap_64 ( hdr. u . v3 . idx2_eof );
-                                            hdr. u . v3 . idx0_count = bswap_32 ( hdr. u . v3 . idx0_count );
-                                            hdr. u . v3 . num_blocks = bswap_32 ( hdr. u . v3 . num_blocks );
-                                            hdr. u . v3 . page_size = bswap_32 ( hdr. u . v3 . page_size );
-                                        }
-
-                                        * data_eof = hdr . u . v3 . data_eof;
-                                        * idx2_eof = hdr . u . v3 . idx2_eof;
-                                        * idx0_count = hdr . u . v3 . idx0_count;
-                                        * pgsize = hdr . u . v3 . page_size;
-                                        * checksum = hdr . u . v3 . checksum;
-                                        count = hdr . u . v3 . num_blocks;
-                                        break;
-
-                                    default:
-                                        rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcBadVersion );
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        self -> vers = hdr . dad . version;
-                        rc = KColumnIdx1Init ( self, off, count );
-                        if ( rc == 0 )
-                            return rc;
-                    }
-
-                    KFileRelease ( self -> fidx );
-                    self -> fidx = NULL;
-                }
-            }
-        }
-
-        KFileRelease ( self -> f );
-        self -> f = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Whack
- */
-rc_t KColumnIdx1Whack ( KColumnIdx1 *self )
-{
-    rc_t rc = KFileRelease ( self -> fidx );
-    if ( rc == 0 )
-    {
-        self -> fidx = NULL;
-        rc = KFileRelease ( self -> f );
-        if ( rc == 0 )
-        {
-            self -> f = NULL;
-            BSTreeWhack ( & self -> bst, KColumnIdx1NodeWhack, NULL );
-            BSTreeInit ( & self -> bst );
-        }
-    }
-    return rc;
-}
-
-/* Version
- */
-#ifndef KColumnIdx1Version
-rc_t KColumnIdx1Version ( const KColumnIdx1 *self, uint32_t *version )
-{
-    * version = ( uint32_t ) self -> vers;
-    return 0;
-}
-#endif
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx1IdRange ( const KColumnIdx1 *self,
-    int64_t *first, int64_t *upper )
-{
-    const KColumnIdx1Node *a, *z;
-
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( upper != NULL );
-
-    a = ( const KColumnIdx1Node* ) BSTreeFirst ( & self -> bst );
-    if ( a == NULL )
-        return false;
-
-    z = ( const KColumnIdx1Node* ) BSTreeLast ( & self -> bst );
-    assert ( z != NULL );
-
-    * first = a -> loc . start_id;
-    * upper = z -> loc . start_id + z -> loc . id_range;
-    assert ( * first < * upper );
-
-    return true;
-}
-
-/* LocateBlock
- *  locates an idx2 block by range
- *  return values:
- */
-rc_t KColumnIdx1LocateBlock ( const KColumnIdx1 *self,
-    KColBlockLoc *bloc, int64_t first, int64_t upper )
-{
-    const KColumnIdx1Node *n;
-
-    assert ( self != NULL );
-    assert ( bloc != NULL );
-    assert ( first < upper );
-
-    n = ( const KColumnIdx1Node* )
-        BSTreeFind ( & self -> bst, & first, KColumnIdx1NodeFind );
-
-    if ( n == NULL )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-
-    assert ( first >= n -> loc . start_id );
-    assert ( first < ( n -> loc . start_id + n -> loc . id_range ) );
-
-    if ( upper > ( n -> loc . start_id + n -> loc . id_range ) )
-        return RC ( rcDB, rcColumn, rcSelecting, rcRange, rcInvalid );
-
-    * bloc = n -> loc;
-    return 0;
-}
diff --git a/libs/kdb/colidx2-priv.h b/libs/kdb/colidx2-priv.h
deleted file mode 100644
index 2e28a65..0000000
--- a/libs/kdb/colidx2-priv.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx2_priv_
-#define _h_colidx2_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#include <klib/data-buffer.h>
-#include "idxblk-priv.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx2
- *  level 2 index
- */
-
-typedef struct KColumnIdx2BlockCache
-{
-    /* single page cache */
-    void *block;
-    int64_t start_id;
-    size_t count;
-    KColIdxBlock iblk;
-} KColumnIdx2BlockCache;
-
-typedef struct KColumnIdx2 KColumnIdx2;
-struct KColumnIdx2
-{
-    /* for adding new blocks */
-    uint64_t eof;
-
-    /* idx2 itself */
-    struct KFile const *f;
-
-    /* full caching mechanism */
-    KDataBuffer cstorage;
-    uint32_t	last;
-};
-
-/* Open
- */
-rc_t KColumnIdx2OpenRead ( KColumnIdx2 *self,
-    const KDirectory *dir, uint64_t eof );
-
-/* Whack
- */
-rc_t KColumnIdx2Whack ( KColumnIdx2 *self );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx2LocateBlob ( const KColumnIdx2 *self,
-    KColBlobLoc *loc, const KColBlockLoc *bloc,
-    int64_t first, int64_t upper, bool bswap );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx2_priv_ */
diff --git a/libs/kdb/colidx2.c b/libs/kdb/colidx2.c
deleted file mode 100644
index 59743c3..0000000
--- a/libs/kdb/colidx2.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "colidx2-priv.h"
-#include "idxblk-priv.h"
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-#define IDX2_READ_FILE_BUFFER 64 * 1024
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx2
- *  level 2 index
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx2Init ( KColumnIdx2 *self, uint64_t idx2_eof )
-{
-    rc_t rc;
-
-#if 0
-    memset(&self->cstorage,0,sizeof(self->cstorage));
-    self->cstorage.elem_bits = sizeof(KColumnIdx2BlockCache)*8;
-    self->last = 0;
-#endif
-    rc = KFileSize ( self -> f, & self -> eof );
-    if ( rc == 0 )
-    {
-        if ( self -> eof < idx2_eof )
-            rc = RC ( rcDB, rcColumn, rcConstructing, rcIndex, rcCorrupt );
-        else
-        {
-            self -> eof = idx2_eof;
-            return 0;
-        }
-    }
-    
-    KFileRelease ( self -> f );
-
-    self -> f = NULL;
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx2OpenRead ( KColumnIdx2 *self,
-    const KDirectory *dir, uint64_t eof )
-{
-    rc_t rc;
-
-    rc = KDataBufferMake ( & self -> cstorage, sizeof ( KColumnIdx2BlockCache ) * 8, 0 );
-    if ( rc != 0 )
-    {
-        memset ( self, 0, sizeof * self );
-        return rc;
-    }
-
-    self -> last = 0;
-
-    if ( eof == 0 )
-    {
-#if 0
-        KDataBufferResize(&self->cstorage,0);
-        self -> last = 0;
-#endif
-        self -> eof = 0;
-        self -> f = NULL;
-        return 0;
-    }
-
-    rc = KDirectoryVOpenFileRead ( dir,
-        & self -> f, "idx2", NULL );
-#if IDX2_READ_FILE_BUFFER
-    if ( rc == 0 )
-    {
-        const KFile * orig = self -> f;
-        rc = KBufFileMakeRead ( & self -> f, self -> f, IDX2_READ_FILE_BUFFER );
-	if ( rc == 0 )
-        {
-            KFileRelease ( orig );
-        }
-        else
-        {
-            self -> f = orig;
-            rc = 0;
-        }
-    }
-#endif
-    if ( rc == 0 )
-        rc = KColumnIdx2Init ( self, eof );
-    return rc;
-}
-
-/* Whack
- */
-rc_t KColumnIdx2Whack ( KColumnIdx2 *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-    {
-        int i;
-        KColumnIdx2BlockCache * cache=(KColumnIdx2BlockCache *)self -> cstorage.base;
-        self -> f = NULL;
-        for(i=0;i<self->cstorage.elem_count;i++){
-            free(cache[i].block);
-        }
-        KDataBufferWhack(&self->cstorage);
-    }
-    return rc;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-static
-rc_t KColIdxBlockLocateBlob ( const KColIdxBlock *iblk,
-    KColBlobLoc *loc, const KColBlockLoc *bloc, uint32_t count,
-    int64_t first, int64_t upper )
-{
-    uint32_t span;
-    int64_t start_id;
-    int slot = KColIdxBlockFind ( iblk,
-        bloc, count, first, & start_id, & span );
-    if ( slot < 0 )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-    if ( upper > ( start_id + span ) )
-        return RC ( rcDB, rcColumn, rcSelecting, rcRange, rcInvalid );
-
-    loc -> start_id = start_id;
-    loc -> id_range = span;
-
-    KColIdxBlockGet ( iblk, bloc, count, slot, & loc -> pg, & span );
-    loc -> u . blob . size = span;
-
-    return 0;
-}
-
-rc_t KColumnIdx2LocateBlob ( const KColumnIdx2 *self,
-    KColBlobLoc *loc, const KColBlockLoc *bloc,
-    int64_t first, int64_t upper, bool bswap )
-{
-    rc_t rc;
-    uint32_t count;
-    size_t block_size, orig;
-    uint32_t slot=0;
-
-    void *block;
-
-    /* check within page cache */
-    if(self -> cstorage.elem_count > 0){
-        KColumnIdx2BlockCache * cache=(KColumnIdx2BlockCache *)self -> cstorage.base;
-        assert(self->last < self->cstorage.elem_count);
-        if(bloc -> start_id == cache[self->last].start_id){
-            rc = KColIdxBlockLocateBlob ( & cache[self->last].iblk, loc, bloc, ( uint32_t ) cache[self->last].count, first, upper );
-            if ( rc == 0) return 0;
-        } else {
-            uint32_t lower,upper,pivot;
-            if(bloc -> start_id > cache[self->last].start_id){
-                lower=self->last+1;
-                upper=self->cstorage.elem_count;
-            } else {
-                lower=0;
-                upper = self->last;
-            }
-            while(lower < upper){
-                pivot = (lower + upper) / 2;
-                if(bloc -> start_id == cache[pivot].start_id){
-                    KColumnIdx2 * nc_self=(KColumnIdx2 *)self;
-                    nc_self->last = pivot;
-                    rc = KColIdxBlockLocateBlob ( & cache[self->last].iblk, loc, bloc, ( uint32_t ) cache[self->last].count, first, upper );
-                    if ( rc == 0) return 0;
-                    goto BSEARCH_DONE;
-                } else if(bloc -> start_id < cache[pivot].start_id){
-                    upper=pivot;
-                } else {
-                    lower =pivot+1;
-                }
-            }
-            assert(lower == upper );
-            slot = upper;
-        }
-    }
-BSEARCH_DONE:
-
-    /* file may be empty or non-existent */
-    if ( self -> eof == 0 )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-
-    /* TBD - compression not supported */
-    if ( bloc -> u . blk . compressed )
-        return RC ( rcDB, rcColumn, rcSelecting, rcData, rcUnsupported );
-
-    /* determine the number of entries in block */
-    orig = bloc -> u . blk . size;
-    count = KColBlockLocEntryCount ( bloc, & orig );
-
-    /* determine the size to allocate */
-    block_size = KColBlockLocAllocSize ( bloc, orig, count );
-
-    /* allocate a block */
-        block = malloc ( block_size );
-    if ( block == NULL )
-        rc = RC ( rcDB, rcColumn, rcSelecting, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-        rc = KFileReadAll ( self -> f, bloc -> pg, block, orig, & num_read );
-        if ( rc == 0 )
-        {
-            if ( num_read != orig )
-                rc = RC ( rcDB, rcIndex, rcReading, rcTransfer, rcIncomplete );
-            else
-            {
-                KColIdxBlock iblk;
-                rc = KColIdxBlockInit ( & iblk, bloc, orig, block, block_size, bswap );
-                if ( rc == 0 )
-                {
-                    rc = KColIdxBlockLocateBlob ( & iblk,
-                        loc, bloc, count, first, upper );
-                    if ( rc == 0 )
-                    {
-                        KColumnIdx2BlockCache * cache;
-                        KDataBufferResize(&((KColumnIdx2 *)self)->cstorage,self->cstorage.elem_count+1);
-                        cache=(KColumnIdx2BlockCache *)self -> cstorage.base;
-                        if(slot < self->cstorage.elem_count -1){ /** not adding to the end **/
-                            memmove(cache+slot+1,cache+slot,sizeof(*cache)*(self->cstorage.elem_count - slot - 1));
-                        }
-                        cache += slot; 
-                        cache -> block = block;
-                        cache -> start_id = bloc -> start_id;
-                        cache -> count = count;
-                        cache -> iblk = iblk;
-                        return 0;
-                    }
-                }
-            }
-        }
-        
-            free ( block );
-    }
-
-    return rc;
-}
diff --git a/libs/kdb/column-cc.c b/libs/kdb/column-cc.c
deleted file mode 100644
index c283d4b..0000000
--- a/libs/kdb/column-cc.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#include <kdb/extern.h>
-
-#define KONST const
-#include "column-priv.h"
-#undef KONST
-
-#include "cc-priv.h"
-
-#include <klib/rc.h>
-
-#include <string.h>
-
-struct col_check_ctx {
-    CCReportFunc report;
-    void *ctx;
-    int found;
-    rc_t rc;
-    bool failed;
-};
-
-static
-rc_t CC col_check_report(const CCReportInfoBlock *nfo, void *Ctx)
-{
-    struct col_check_ctx *ctx = Ctx;
-    
-    if (nfo->type == ccrpt_MD5) {
-        const char *fname = nfo->info.MD5.file;
-        
-        if (strcmp(fname, "data") == 0)
-            ctx->found |= 1;
-        else if (strcmp(fname, "idx0") == 0)
-            ctx->found |= 2;
-        else if (strcmp(fname, "idx1") == 0)
-            ctx->found |= 4;
-        else if (strcmp(fname, "idx2") == 0)
-            ctx->found |= 8;
-        
-        if (nfo->info.MD5.rc != 0 && !ctx->failed) {
-            ctx->failed = true;
-            ctx->rc = nfo->info.MD5.rc;
-        }
-    }
-    else if (nfo->type == ccrpt_Done && nfo->info.done.rc != 0 && !ctx->failed) {
-        ctx->failed = true;
-        ctx->rc = nfo->info.done.rc;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC CheckExists(const KDirectory *dir, uint32_t type, const char *name, void *Ctx)
-{
-    struct col_check_ctx *ctx = Ctx;
-    
-    if ((type & ~kptAlias) == kptFile) {
-        if (strcmp(name, "data") == 0)
-            ctx->found |= 1;
-        else if (strcmp(name, "idx0") == 0)
-            ctx->found |= 2;
-        else if (strcmp(name, "idx1") == 0)
-            ctx->found |= 4;
-        else if (strcmp(name, "idx2") == 0)
-            ctx->found |= 8;
-    }
-    return 0;
-}
-
-static
-rc_t KColumnCheckMD5(const KColumn *self,
-                     CCReportInfoBlock *nfo,
-                     CCReportFunc report, void *ctx)
-{
-    struct col_check_ctx local_ctx;
-    rc_t rc;
-    
-    local_ctx.report = report;
-    local_ctx.ctx = ctx;
-    local_ctx.found = 0;
-    local_ctx.failed = false;
-    local_ctx.rc = 0;
-    
-    rc = DirectoryCheckMD5(self->dir, "md5", nfo, col_check_report, &local_ctx);
-    if (rc == 0 && !local_ctx.failed && local_ctx.found != 0x0F) {
-        local_ctx.found = 0;
-        KDirectoryVisit(self->dir, false, CheckExists, &local_ctx, NULL);
-        nfo->type = ccrpt_Done;
-        if (local_ctx.found == 0x0F) {
-            nfo->info.done.rc = RC(rcDB, rcColumn, rcValidating, rcChecksum, rcNotFound);
-            nfo->info.done.mesg = "Some files are missing checksums";
-        }
-        else {
-            nfo->info.done.rc = RC(rcDB, rcColumn, rcValidating, rcFile, rcNotFound);
-            nfo->info.done.mesg = "Some files are missing";
-        }
-        rc = report(nfo, ctx);
-    }
-    else if (rc == 0) {
-        nfo->type = ccrpt_Done;
-        nfo->info.done.rc = 0;
-        nfo->info.done.mesg = "md5 ok";
-        rc = report(nfo, ctx);
-    }
-    else {
-        nfo->type = ccrpt_Done;
-        rc = report(nfo, ctx);
-    }
-
-    return rc;
-}
-
-static
-rc_t KColumnCheckBlobs(const KColumn *self,
-                       CCReportInfoBlock *nfo,
-                       CCReportFunc report, void *ctx)
-{
-    int64_t start;
-    int64_t row;
-    uint64_t rows;
-    rc_t rc;
-    
-    rc = KColumnIdRange(self, &start, &rows);
-    if (rc) {
-        nfo->info.done.rc = rc;
-        nfo->info.done.mesg = "could not be read";
-        nfo->type = ccrpt_Done;
-        return report(nfo, ctx);
-    }
-    for (row = 0; row < rows && rc == 0; ) {
-        const KColumnBlob *blob;
-        int64_t first;
-        uint32_t count;
-        
-        rc = KColumnOpenBlobRead(self, &blob, row + start);
-        if (rc) {
-            nfo->info.done.rc = rc;
-            nfo->info.done.mesg = "could not be read";
-            nfo->type = ccrpt_Done;
-            return report(nfo, ctx);
-        }
-        rc = KColumnBlobIdRange(blob, &first, &count);
-        if (rc) {
-            KColumnBlobRelease(blob);
-            nfo->info.done.rc = rc;
-            nfo->info.done.mesg = "could not be read";
-            nfo->type = ccrpt_Done;
-            return report(nfo, ctx);
-        }
-        rc = KColumnBlobValidate(blob);
-        KColumnBlobRelease(blob);
-        if (rc) {
-            nfo->info.done.rc = rc;
-            nfo->info.done.mesg = "contains bad data";
-            nfo->type = ccrpt_Done;
-            return report(nfo, ctx);
-        }
-        nfo->type = ccrpt_Blob;
-        nfo->info.blob.start = first;
-        nfo->info.blob.count = count;
-        rc = report(nfo, ctx);
-
-        row += count;
-    }
-    nfo->info.done.rc = 0;
-    nfo->info.done.mesg = "checksums ok";
-    nfo->type = ccrpt_Done;
-    rc = report(nfo, ctx);
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KColumnConsistencyCheck(const KColumn *self,
-    uint32_t level, CCReportInfoBlock *nfo, CCReportFunc report, void *ctx )
-{
-    rc_t rc = 0;
-
-    bool indexOnly = level & CC_INDEX_ONLY;
-    if (indexOnly) {
-        level &= ~CC_INDEX_ONLY;
-    }
-
-    if (KDirectoryPathType(self->dir, "md5") != kptNotFound)
-        rc = level == 0 ? KColumnCheckMD5(self, nfo, report, ctx) : 0;
-    else {
-        nfo->type = ccrpt_Done;
-        nfo->info.done.mesg = "missing md5 file";
-        nfo->info.done.rc = 0; /* RC(rcDB, rcColumn, rcValidating, rcFile, rcNotFound); */
-        
-        rc = report(nfo, ctx);
-        
-        if (level == 0)
-            level = 1;
-    }
-    
-    if (rc == 0 && level > 0)
-        rc = KColumnCheckBlobs(self, nfo, report, ctx);
-    return rc;
-}
diff --git a/libs/kdb/column-priv.h b/libs/kdb/column-priv.h
deleted file mode 100644
index dc9a84f..0000000
--- a/libs/kdb/column-priv.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_column_priv_
-#define _h_column_priv_
-
-#ifndef _h_kdb_column_
-#include <kdb/column.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_coldata_priv_
-#include "coldata-priv.h"
-#endif
-
-#ifndef _h_colidx_priv_
-#include "colidx-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct KDBManager;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- */
-struct KColumn
-{
-    struct KTable const *tbl;
-    struct KDBManager const *mgr;
-    struct KDirectory const *dir;
-
-    KColumnIdx idx;
-    KColumnData df;
-
-    KRefcount refcount;
-    uint32_t csbytes;
-    int32_t checksum;
-    char path [ 1 ];
-};
-
-/* Attach
- * Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-KColumn *KColumnAttach ( const KColumn *self );
-rc_t KColumnSever ( const KColumn *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_column_priv_ */
diff --git a/libs/kdb/column.c b/libs/kdb/column.c
deleted file mode 100644
index fb1ce2a..0000000
--- a/libs/kdb/column.c
+++ /dev/null
@@ -1,876 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define KONST const
-#include <kdb/extern.h>
-#include "column-priv.h"
-#include "dbmgr-priv.h"
-#include "table-priv.h"
-#include "kdb-priv.h"
-#include <kdb/kdb-priv.h>
-#include <klib/checksum.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <atomic32.h>
-#include <sysalloc.h>
-#undef KONST
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- *  a collection of blobs indexed by oid
- */
-
-
-/* Whack
- */
-static
-rc_t KColumnWhack ( KColumn *self )
-{
-    rc_t rc;
-
-    KRefcountWhack ( & self -> refcount, "KColumn" );
-
-    /* shut down index */
-    rc = KColumnIdxWhack ( & self -> idx );
-    if ( rc == 0 )
-    {
-        /* shut down data fork */
-        KColumnDataWhack ( & self -> df );
-
-        /* release owning table
-           should never fail, and our recovery is flawed */
-        if ( self -> tbl != NULL )
-        {
-            rc = KTableSever ( self -> tbl );
-            if ( rc == 0 )
-                self -> tbl = NULL;
-        }
-
-        /* release manager
-           should never fail */
-        if ( rc == 0 )
-            rc = KDBManagerSever ( self -> mgr );
-
-        if ( rc == 0 )
-        {
-            KDirectoryRelease ( self -> dir );
-            free ( self );
-            return 0;
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KColumn", "whack", "kcol" );
-    return rc;
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KColumnAddRef ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KColumn" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcColumn, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnRelease ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KColumn" ) )
-        {
-        case krefWhack:
-            return KColumnWhack ( ( KColumn* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcColumn, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- */
-KColumn *KColumnAttach ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KColumn" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KColumn* ) self;
-}
-
-rc_t KColumnSever ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KColumn" ) )
-        {
-        case krefWhack:
-            return KColumnWhack ( ( KColumn* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcColumn, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KColumnMake ( KColumn **colp, const KDirectory *dir, const char *path )
-{
-    KColumn *col = malloc ( sizeof * col + strlen ( path ) );
-    if ( col == NULL )
-        return RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-
-    memset ( col, 0, sizeof * col );
-    col -> dir = dir;
-    KRefcountInit ( & col -> refcount, 1, "KColumn", "make", path );
-    strcpy ( col -> path, path );
-
-    * colp = col;
-    return 0;
-}
-
-static
-rc_t KColumnMakeRead ( KColumn **colp, const KDirectory *dir, const char *path )
-{
-    rc_t rc = KColumnMake ( colp, dir, path );
-    if ( rc == 0 )
-    {
-        size_t pgsize;
-        uint64_t data_eof;
-        KColumn *self = * colp;
-
-        rc = KColumnIdxOpenRead ( & self -> idx,
-            dir, & data_eof, & pgsize, & self -> checksum );
-        if ( rc == 0 )
-        {
-            rc = KColumnDataOpenRead ( & self -> df,
-                dir, data_eof, pgsize );
-            if ( rc == 0 )
-            {
-                switch ( self -> checksum )
-                {
-                case kcsNone:
-                    break;
-                case kcsCRC32:
-                    self -> csbytes = 4;
-                    break;
-                case kcsMD5:
-                    self -> csbytes = 16;
-                    break;
-                }
-
-                return 0;
-            }
-
-            KColumnIdxWhack ( & self -> idx );
-        }
-
-        free ( self );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-
-/* OpenColumnRead
- * VOpenColumnRead
- *  open a column for read
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-static
-rc_t KDBManagerVOpenColumnReadInt ( const KDBManager *self,
-    const KColumn **colp, const KDirectory *wd, bool try_srapath,
-    const char *path, va_list args )
-{
-    char colpath [ 4096 ];
-    rc_t rc;
-    size_t z;
-
-/*    rc = KDirectoryVResolvePath ( wd, 1,
-        colpath, sizeof colpath, path, args ); */
-    rc = string_vprintf( colpath, sizeof colpath, &z, path, args );
-    if ( rc == 0 )
-    {
-        KColumn *col;
-        const KDirectory *dir;
-
-        /* open table directory */
-        rc = KDBOpenPathTypeRead ( self, wd, colpath, &dir, kptColumn, NULL, try_srapath );
-        if ( rc == 0 )
-        {
-            rc = KColumnMakeRead ( & col, dir, colpath );
-            if ( rc == 0 )
-            {
-                col -> mgr = KDBManagerAttach ( self );
-                * colp = col;
-                return 0;
-            }
-
-            KDirectoryRelease ( dir );
-        }
-    }
-    
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerOpenColumnRead ( const KDBManager *self,
-    const KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenColumnRead ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerVOpenColumnRead ( const KDBManager *self,
-    const KColumn **col, const char *path, va_list args )
-{
-    if ( col == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * col = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenColumnReadInt
-        ( self, col, self -> wd, true, path, args );
-}
-
-
-LIB_EXPORT rc_t CC KTableOpenColumnRead ( const KTable *self,
-    const KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KTableVOpenColumnRead ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenColumnRead ( const KTable *self,
-    const KColumn **colp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( colp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * colp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "col", 3, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenColumnReadInt ( self -> mgr,
-            colp, self -> dir, false, path, NULL );
-        if ( rc == 0 )
-        {
-            KColumn *col = ( KColumn* ) * colp;
-            col -> tbl = KTableAttach ( self );
-        }
-    }
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KColumnLocked ( const KColumn *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "" );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-/* Version
- *  returns the column format version
- */
-LIB_EXPORT rc_t CC KColumnVersion ( const KColumn *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * version = 0;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-     
-    return KColumnIdxVersion ( & self -> idx, version );
-}
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KColumnByteOrder ( const KColumn *self, bool *reversed )
-{
-    if ( reversed == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * reversed = false;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-     
-    return KColumnIdxByteOrder ( & self -> idx, reversed );
-}
-
-/* IdRange
- *  returns id range for column
- */
-LIB_EXPORT rc_t CC KColumnIdRange ( const KColumn *self, int64_t *first, uint64_t *count )
-{
-    rc_t rc;
-    int64_t dummy, last;
-
-    if ( first == NULL && count == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( first == NULL )
-        first = & dummy;
-    else if ( count == NULL )
-        count = ( uint64_t * ) & dummy;
-
-    if ( self == NULL )
-    {
-        * first = 0;
-        * count = 0;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-
-    rc = KColumnIdxIdRange ( & self -> idx, first, & last );
-    if ( rc != 0 )
-        * count = 0;
-    else
-        * count = last - * first + 1;
-
-    return rc;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KColumnOpenManagerRead ( const KColumn *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KColumnOpenParentRead ( const KColumn *self, const KTable **tbl )
-{
-    rc_t rc;
-
-    if ( tbl == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KTableAddRef ( self -> tbl );
-            if ( rc == 0 )
-            {
-                * tbl = self -> tbl;
-                return 0;
-            }
-        }
-
-        * tbl = NULL;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KColumnBlob
- *  one or more rows of column data
- */
-struct KColumnBlob
-{
-    /* holds existing blob loc */
-    KColBlobLoc loc;
-    KColumnPageMap pmorig;
-
-    /* owning column */
-    const KColumn *col;
-
-    /* refcount */
-    atomic32_t refcount;
-
-    /* captured from idx1 for CRC32 validation */
-    bool bswap;
-};
-
-
-/* Whack
- */
-static
-rc_t KColumnBlobWhack ( KColumnBlob *self )
-{
-    const KColumn *col = self -> col;
-    assert ( col != NULL );
-
-    KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-
-    /* cannot recover from errors here,
-       since the page maps needed whacking first,
-       and the column is needed for that. */
-    KColumnSever ( col );
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KColumnBlobAddRef ( const KColumnBlob *cself )
-{
-    if ( cself != NULL )
-    {
-        atomic32_inc ( & ( ( KColumnBlob* ) cself ) -> refcount );
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnBlobRelease ( const KColumnBlob *cself )
-{
-    KColumnBlob *self = ( KColumnBlob* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KColumnBlobWhack ( self );
-    }
-    return 0;
-}
-
-/* OpenRead
- * OpenUpdate
- */
-static
-rc_t KColumnBlobOpenRead ( KColumnBlob *self, const KColumn *col, int64_t id )
-{
-    /* locate blob */
-    rc_t rc = KColumnIdxLocateBlob ( & col -> idx, & self -> loc, id, id );
-    if ( rc == 0 )
-    {
-        /* open page map to blob */
-        rc = KColumnPageMapOpen ( & self -> pmorig,
-            ( KColumnData* ) & col -> df, self -> loc . pg, self -> loc . u . blob . size );
-        if ( rc == 0 )
-        {
-            /* existing blob must have proper checksum bytes */
-            if ( self -> loc . u . blob .  size >= col -> csbytes )
-            {
-                /* remove them from apparent blob size */
-                self -> loc . u . blob . size -= col -> csbytes;
-                return 0;
-            }
-
-            /* the blob is corrupt */
-            KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-            rc = RC ( rcDB, rcColumn, rcOpening, rcBlob, rcCorrupt );
-        }
-    }
-
-    return rc;
-}
-
-/* Make
- */
-static
-rc_t KColumnBlobMake ( KColumnBlob **blobp, bool bswap )
-{
-    KColumnBlob *blob = malloc ( sizeof * blob );
-    if ( blob == NULL )
-        return RC ( rcDB, rcBlob, rcConstructing, rcMemory, rcExhausted );
-
-    memset ( blob, 0, sizeof * blob );
-    atomic32_set ( & blob -> refcount, 1 );
-    blob -> bswap = bswap;
-
-    * blobp = blob;
-    return 0;
-}
-
-/* OpenBlobRead
- *  opens an existing blob containing row data for id
- */
-LIB_EXPORT rc_t CC KColumnOpenBlobRead ( const KColumn *self, const KColumnBlob **blobp, int64_t id )
-{
-    rc_t rc;
-    KColumnBlob *blob;
-
-    if ( blobp == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-
-    * blobp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-
-
-    rc = KColumnBlobMake ( & blob, self -> idx . idx1 . bswap );
-    if ( rc == 0 )
-    {
-        rc = KColumnBlobOpenRead ( blob, self, id );
-        if ( rc == 0 )
-        {
-            blob -> col = KColumnAttach ( self );
-            * blobp = blob;
-            return 0;
-        }
-        
-        free ( blob );
-    }
-
-    return rc;
-}
-
-/* IdRange
- *  returns id range for blob
- *
- *  "first" [ OUT ] - return parameter for first id
- *
- *  "last" [ OUT ] - return parameter for count
- */
-LIB_EXPORT rc_t CC KColumnBlobIdRange ( const KColumnBlob *self, int64_t *first, uint32_t *count )
-{
-    rc_t rc;
-
-    if ( first == NULL || count == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else if ( self == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcSelf, rcNull );
-    else if ( self -> loc . id_range == 0 )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcRange, rcEmpty );
-    else
-    {
-        * first = self -> loc . start_id;
-        * count = self -> loc . id_range;
-        return 0;
-    }
-
-    if ( first != NULL )
-        * first = 0;
-    if ( count != NULL )
-        * count = 0;
-
-    return rc;
-}
-
-/* KColumnBlobValidate
- *  runs checksum validation on unmodified blob
- */
-static
-rc_t KColumnBlobValidateCRC32 ( const KColumnBlob *self )
-{
-    rc_t rc;
-    const KColumn *col = self -> col;
-
-    uint8_t buffer [ 1024 ];
-    size_t to_read, num_read, total, size;
-
-    uint32_t cs, crc32 = 0;
-
-    /* calculate checksum */
-    for ( size = self -> loc . u . blob . size, total = 0; total < size; total += num_read )
-    {
-        to_read = size - total;
-        if ( to_read > sizeof buffer )
-            to_read = sizeof buffer;
-
-        rc = KColumnDataRead ( & col -> df,
-            & self -> pmorig, total, buffer, to_read, & num_read );
-        if ( rc != 0 )
-            return rc;
-        if ( num_read == 0 )
-            return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-        crc32 = CRC32 ( crc32, buffer, num_read );
-    }
-
-    /* read stored checksum */
-    rc = KColumnDataRead ( & col -> df,
-        & self -> pmorig, size, & cs, sizeof cs, & num_read );
-    if ( rc != 0 )
-        return rc;
-    if ( num_read != sizeof cs )
-        return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-    if ( self -> bswap )
-        cs = bswap_32 ( cs );
-
-    if ( cs != crc32 )
-        return RC ( rcDB, rcBlob, rcValidating, rcBlob, rcCorrupt );
-
-    return 0;
-}
-
-static
-rc_t KColumnBlobValidateMD5 ( const KColumnBlob *self )
-{
-    rc_t rc;
-    const KColumn *col = self -> col;
-
-    uint8_t buffer [ 1024 ];
-    size_t to_read, num_read, total, size;
-
-    MD5State md5;
-    uint8_t digest [ 16 ];
-
-    MD5StateInit ( & md5 );
-
-    /* calculate checksum */
-    for ( size = self -> loc . u . blob . size, total = 0; total < size; total += num_read )
-    {
-        to_read = size - total;
-        if ( to_read > sizeof buffer )
-            to_read = sizeof buffer;
-
-        rc = KColumnDataRead ( & col -> df,
-            & self -> pmorig, total, buffer, to_read, & num_read );
-        if ( rc != 0 )
-            return rc;
-        if ( num_read == 0 )
-            return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-        MD5StateAppend ( & md5, buffer, num_read );
-    }
-
-    /* read stored checksum */
-    rc = KColumnDataRead ( & col -> df,
-        & self -> pmorig, size, buffer, sizeof digest, & num_read );
-    if ( rc != 0 )
-        return rc;
-    if ( num_read != sizeof digest )
-        return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-    /* finish MD5 digest */
-    MD5StateFinish ( & md5, digest );
-
-    if ( memcmp ( buffer, digest, sizeof digest ) != 0 )
-        return RC ( rcDB, rcBlob, rcValidating, rcBlob, rcCorrupt );
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnBlobValidate ( const KColumnBlob *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcBlob, rcValidating, rcSelf, rcNull );
-
-    if ( self -> loc . u . blob . size != 0 ) switch ( self -> col -> checksum )
-    {
-    case kcsCRC32:
-        return KColumnBlobValidateCRC32 ( self );
-    case kcsMD5:
-        return KColumnBlobValidateMD5 ( self );
-    }
-
-    return 0;
-}
-
-/* KColumnBlobRead
- *  read data from blob
- *
- *  "offset" [ IN ] - starting offset into blob
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read. specifically,
- *  "offset" + "num_read" + "remaining" == sizeof blob
- */
-LIB_EXPORT rc_t CC KColumnBlobRead ( const KColumnBlob *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining )
-{
-    rc_t rc;
-    size_t ignore;
-    if ( remaining == NULL )
-        remaining = & ignore;
-
-    if ( num_read == NULL )
-        rc = RC ( rcDB, rcBlob, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcBlob, rcReading, rcSelf, rcNull );
-        else
-        {
-            size_t size = self -> loc . u . blob . size;
-            const KColumn *col = self -> col;
-
-            if ( offset > size )
-                offset = size;
-
-            if ( bsize == 0 )
-                rc = 0;
-            else if ( buffer == NULL )
-                rc = RC ( rcDB, rcBlob, rcReading, rcBuffer, rcNull );
-            else
-            {
-                size_t to_read = size - offset;
-                if ( to_read > bsize )
-                    to_read = bsize;
-                rc = KColumnDataRead ( & col -> df,
-                    & self -> pmorig, offset, buffer, to_read, num_read );
-                if ( rc == 0 )
-                {
-                    * remaining = size - offset - * num_read;
-                    return 0;
-                }
-            }
-
-            * remaining = size - offset;
-            * num_read = 0;
-            return rc;
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-    return rc;
-}
-
-/* GetDirectory
- */
-LIB_EXPORT rc_t CC KColumnGetDirectoryRead ( const KColumn *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kdb/database-cc.c b/libs/kdb/database-cc.c
deleted file mode 100644
index a0e0b1c..0000000
--- a/libs/kdb/database-cc.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#include <kdb/extern.h>
-
-#define KONST const
-#include "index-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "table-priv.h"
-#include "kdb-priv.h"
-#include "column-priv.h"
-#undef KONST
-
-#include "cc-priv.h"
-
-#include <kdb/index.h>
-
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <kdb/namelist.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-#undef index
-
-static void KDatabaseGetName(KDatabase const *self, char const **rslt)
-{
-    char *sep;
-    
-    *rslt = self->path;
-    sep = strrchr(self->path, '/');
-    if (sep != NULL)
-        *rslt = sep + 1;
-}
-
-static
-rc_t KDatabaseCheckMD5 (const KDatabase *self, CCReportFunc report, void *ctx)
-{
-    CCReportInfoBlock info;
-    memset (& info, 0, sizeof info);
-
-    info.objType = kptDatabase;
-    KDatabaseGetName(self, &info.objName);
-    
-    return DirectoryCheckMD5 (self -> dir, "md5", & info, report, ctx);
-}
-
-static
-rc_t KDatabaseCheckTables (const KDatabase *self, uint32_t depth, int level, CCReportFunc report, void *ctx)
-{
-    uint32_t n;
-    
-    KNamelist *list;
-    rc_t rc = KDatabaseListTbl (self, & list);
-    if (rc != 0)
-        return rc;
-    
-    rc = KNamelistCount (list, & n);
-    if (rc == 0)
-    {
-        CCReportInfoBlock nfo;
-        memset (& nfo, 0, sizeof nfo);
-        nfo.objType = kptTable;
-        
-        for (nfo.objId = 0; rc == 0 && nfo.objId != (int) n; ++ nfo.objId)
-        {
-            rc = KNamelistGet (list, nfo.objId, &nfo.objName);
-            if (rc == 0)
-            {
-                const KTable *tbl;
-                
-                nfo.type = ccrpt_Visit;
-                nfo.info.visit.depth = depth + 1;
-                rc = report(&nfo, ctx); if (rc) break;
-                
-                rc = KDatabaseOpenTableRead (self, & tbl, nfo.objName);
-                if (rc == 0)
-                {
-                    rc = KTableConsistencyCheck (tbl, depth + 1, level, report,
-                        ctx, SRA_PLATFORM_UNDEFINED);
-                    KTableRelease (tbl);
-                }
-            }
-        }
-    }
-    
-    KNamelistRelease (list);
-    return rc;
-}
-
-static
-rc_t KDatabaseCheckIndexMD5 (const KDirectory *dir,
-    CCReportInfoBlock *nfo, CCReportFunc report, void *ctx)
-{
-    char md5 [ 4100 ];
-
-    snprintf (md5, sizeof md5, "%s.md5", nfo -> objName);
-    return DirectoryCheckMD5 (dir, md5, nfo, report, ctx);
-}
-
-static
-const KDirectory *KDatabaseFindIndexDir (const KDatabase *self)
-{
-    const KDirectory *idxDir;
-    
-    rc_t rc = KDirectoryOpenDirRead (self -> dir, & idxDir, false, "idx");
-    if (rc == 0)
-        return idxDir;
-
-    return NULL;
-}
-
-static
-rc_t KDatabaseCheckIndices (const KDatabase *self, uint32_t depth, uint32_t level, CCReportFunc report, void *ctx)
-{
-    uint32_t n;
-
-    KNamelist *list;
-    rc_t rc = KDatabaseListIdx (self, & list);
-    if (rc != 0)
-    {
-        if (GetRCState (rc) == rcNotFound)
-            return 0;
-        return rc;
-    }
-
-/* TEST    assert(0); */
-    rc = KNamelistCount (list, & n);
-    if (rc == 0)
-    {
-        const KDirectory *idxDir = KDatabaseFindIndexDir (self);
-        if (idxDir == NULL)
-            rc = RC (rcDB, rcDatabase, rcValidating, rcDirectory, rcNull);
-        else
-        {
-            CCReportInfoBlock nfo;
-            memset (& nfo, 0, sizeof nfo);
-            nfo.objType = kptIndex;
-
-            for (nfo.objId = 0; rc == 0 && nfo.objId != (int) n; ++ nfo.objId)
-            {
-                rc = KNamelistGet(list, nfo.objId, &nfo.objName);
-                if (rc != 0)
-                    break;
-            
-                nfo.type = ccrpt_Visit;
-                nfo.info.visit.depth = depth + 1;
-                rc = report(&nfo, ctx); if (rc) break;
-                
-                rc = KDatabaseCheckIndexMD5 (idxDir, &nfo, report, ctx);
-                if (rc == 0 && level > 0)
-                {
-                    const KIndex *idx;
-                    rc = KDatabaseOpenIndexRead (self, &idx, nfo.objName);
-                    if (rc != 0)
-                    {
-                        nfo.type = ccrpt_Done;
-                        nfo.info.done.rc = rc;
-                        nfo.info.done.mesg = "could not be opened";
-                    }
-                    else
-                    {
-                        nfo.type = ccrpt_Index;
-                        rc = KIndexConsistencyCheck(idx, level < 3 ? 1 : 3,
-                                                    &nfo.info.index.start_id,
-                                                    &nfo.info.index.id_range,
-                                                    &nfo.info.index.num_keys,
-                                                    &nfo.info.index.num_rows,
-                                                    &nfo.info.index.num_holes);
-                        KIndexRelease(idx);
-                        if (rc != 0)
-                        {
-                            nfo.type = ccrpt_Done;
-                            nfo.info.done.rc = rc;
-                            nfo.info.done.mesg = "could not be validated";
-                        }
-                    }
-
-                    rc = report (& nfo, ctx);
-                }
-            }
-
-            KDirectoryRelease (idxDir);
-        }
-    }
-
-    KNamelistRelease (list);
-    return rc;
-}
-
-static
-rc_t KDatabaseCheckDatabases (const KDatabase *self, uint32_t depth, int level, CCReportFunc report, void *ctx)
-{
-    uint32_t n;
-
-    KNamelist *list;
-    rc_t rc = KDatabaseListDB (self, & list);
-    if (rc != 0)
-    {
-        if (GetRCState (rc) == rcNotFound)
-            return 0;
-        return rc;
-    }
-
-    rc = KNamelistCount (list, & n);
-    if (rc == 0)
-    {
-        CCReportInfoBlock nfo;
-        memset (& nfo, 0, sizeof nfo);
-        nfo.objType = kptDatabase;
-        
-        for (nfo.objId = 0; rc == 0 && nfo.objId != (int) n; ++ nfo.objId)
-        {
-            rc = KNamelistGet (list, nfo.objId, &nfo.objName);
-            if (rc == 0)
-            {
-                const KDatabase *db;
-                
-                nfo.type = ccrpt_Visit;
-                nfo.info.visit.depth = depth + 1;
-                rc = report(&nfo, ctx); if (rc) break;
-                
-                rc = KDatabaseOpenDBRead (self, & db, nfo.objName);
-                if (rc == 0)
-                {
-                    rc = KDatabaseConsistencyCheck (db, depth + 1, level, report, ctx);
-                    KDatabaseRelease (db);
-                }
-            }
-        }
-    }
-    
-    KNamelistRelease (list);
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KDatabaseConsistencyCheck (const KDatabase *self,
-    uint32_t depth, uint32_t level, CCReportFunc report, void *ctx)
-{
-    rc_t rc = 0;
-    uint32_t type;
-
-    bool indexOnly = level & CC_INDEX_ONLY;
-    if (indexOnly) {
-        level &= ~CC_INDEX_ONLY;
-    }
-
-    if (self == NULL)
-        return RC (rcDB, rcDatabase, rcValidating, rcSelf, rcNull);
-    
-    if (depth == 0) {
-        CCReportInfoBlock info;
-        
-        KDatabaseGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptDatabase;
-        info.type = ccrpt_Visit;
-        info.info.visit.depth = 0;
-        
-        rc = report(&info, ctx);
-        if (rc) return rc;
-    }
-    
-    type = KDirectoryPathType(self->dir, "md5");
-    if (type == kptZombieFile) {
-        CCReportInfoBlock info;
-        
-        KDatabaseGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptTable;
-        info.type = ccrpt_Done;
-        info.info.done.mesg = "Database may be truncated";
-        info.info.done.rc = 0;
-        
-        rc = report(&info, ctx);
-    }
-    else if (type != kptNotFound)
-        rc = KDatabaseCheckMD5 (self, report, ctx);
-    else {
-        CCReportInfoBlock info;
-        
-        KDatabaseGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptDatabase;
-        info.type = ccrpt_Done;
-        info.info.done.mesg = "no md5 file";
-        info.info.done.rc = 0;
-        
-        rc = report(&info, ctx);
-    }
-    
-
-    if (rc == 0)
-        rc = KDatabaseCheckTables (self, depth, level, report, ctx);
-
-    if (rc == 0)
-        rc = KDatabaseCheckIndices (self, depth, level, report, ctx);
-
-    if (rc == 0)
-        rc = KDatabaseCheckDatabases (self, depth, level, report, ctx);
-
-    return rc;
-}
diff --git a/libs/kdb/database-cmn.c b/libs/kdb/database-cmn.c
deleted file mode 100644
index 27d4ed6..0000000
--- a/libs/kdb/database-cmn.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define KONST const
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#include "kdb-priv.h"
-#undef KONST
-
-#include <sysalloc.h>
-#include <klib/namelist.h>
-#include <klib/rc.h>
-#include <kfs/md5.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  connection to a database within file system
- */
-
-/* Whack
- */
-static
-rc_t KDatabaseWhack ( KDatabase *self )
-{
-    rc_t rc = 0;
-
-    /* unused: const KDBManager *mgr; */
-
-    KRefcountWhack ( & self -> refcount, "KDatabase" );
-
-    /* shut down md5 fmt file */
-    if ( self -> md5 != NULL )
-    {
-        rc = KMD5SumFmtRelease ( self -> md5 );
-        if ( rc == 0 )
-            self -> md5 = NULL;
-    }
-    if ( rc == 0 )
-    {
-        /* release dad */
-        if ( self -> dad != NULL )
-        {
-            rc = KDatabaseSever ( self -> dad );
-            if ( rc == 0 )
-                self -> dad = NULL;
-        }
-        /* remove from mgr */
-        if ( rc == 0 )
-        {
-            /* rc = KDBManagerSever ( self -> mgr, & self -> sym ); */
-			rc = KDBManagerSever ( self -> mgr );
-
-            /* complete */
-            if ( rc == 0 )
-            {
-                KDirectoryRelease ( self -> dir );
-                free ( self );
-                return 0;
-            }
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KDatabase", "whack", "kdb" );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-rc_t KDatabaseAddRef ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-rc_t KDatabaseRelease ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-KDatabase *KDatabaseAttach ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDatabase* ) self;
-}
-
-rc_t KDatabaseSever ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- *  make an initialized structure
- */
-static
-rc_t KDatabaseMake ( KDatabase **dbp, const KDirectory *dir, const char *path )
-{
-    KDatabase *db;
-
-    assert ( dbp != NULL );
-    assert ( path != NULL );
-
-    db = malloc ( sizeof * db + strlen ( path ) );
-    if ( db == NULL )
-    {
-        * dbp = NULL;
-        return RC ( rcDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    memset ( db, 0, sizeof * db );
-    db -> dir = dir;
-    KRefcountInit ( & db -> refcount, 1, "KDatabase", "make", path );
-    strcpy ( db -> path, path );
-
-    * dbp = db;
-    return 0;
-}
-
-
-/* OpenDBRead
- * VOpenDBRead
- *  open a database for read
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KDBManagerVOpenDBReadInt ( const KDBManager *self,
-    const KDatabase **dbp, const KDirectory *wd,
-    const char *path, va_list args )
-{
-    /* generate absolute path to db */
-    char dbpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        dbpath, sizeof dbpath, path, args );
-    if ( rc == 0 )
-    {
-        KDatabase *db;
-        const KDirectory *dir;
-
-        /* open the directory if its a database */
-        rc = KDBOpenPathTypeRead ( wd, dbpath, &dir, kptDatabase, NULL );
-        if ( rc == 0 )
-        {
-            /* allocate a new guy */
-            rc = KDatabaseMake ( & db, dir, dbpath );
-            if ( rc == 0 )
-            {
-                db -> mgr = KDBManagerAttach ( self );
-                * dbp = db;
-                return 0;
-            }
-
-            KDirectoryRelease ( dir );
-        }
-    }
-    
-    return rc;
-}
-
-rc_t KDBManagerOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenDBRead ( self, db, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-rc_t KDatabaseOpenDBRead ( const KDatabase *self,
-    const KDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenDBRead ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-rc_t KDBManagerVOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, va_list args )
-{
-    if ( db == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * db = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenDBReadInt ( self, db, self -> wd, path, args );
-}
-
-rc_t KDatabaseVOpenDBRead ( const KDatabase *self,
-    const KDatabase **dbp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( dbp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * dbp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "db", 2, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenDBReadInt ( self -> mgr, dbp,
-            self -> dir, path, NULL );
-        if ( rc == 0 )
-        {
-            KDatabase *db = ( KDatabase* ) * dbp;
-            db -> dad = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-bool KDatabaseLocked ( const KDatabase *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-bool KDatabaseVExists ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    /* TBD */
-    return false;
-}
-
-bool KDatabaseExists ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KDatabaseVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-rc_t KDatabaseVWritable ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    /* TBD */
-    return -1;
-}
-
-rc_t KDatabaseWritable ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = KDatabaseVWritable ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-rc_t KDatabaseOpenManagerRead ( const KDatabase *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-rc_t KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KNameList
- */
-
-/* List
- *  create database listings
- */
-static
-bool KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data )
-{
-    return ( KDBOpenPathTypeRead ( dir, name, NULL, (( long int ) data ), NULL ) == 0 );
-}
-
-rc_t KDatabaseListDB ( const KDatabase *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, ( void* ) kptDatabase, "db", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-rc_t KDatabaseListTbl ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, ( void* ) kptTable, "tbl", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-rc_t KDatabaseListIdx ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, ( void* ) kptIndex, "idx", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
diff --git a/libs/kdb/database-priv.h b/libs/kdb/database-priv.h
deleted file mode 100644
index fa8aee1..0000000
--- a/libs/kdb/database-priv.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_database_priv_
-#define _h_database_priv_
-
-#ifndef _h_kdb_database_
-#include <kdb/database.h>
-#endif
-
-#ifndef _h_klib_symbol_
-#include <klib/symbol.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDBManager;
-struct KDirectory;
-struct KMD5SumFmt;
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  connection to a database within file system
- */
-struct KDatabase
-{
-    /* manager reference */
-    struct KDBManager KONST *mgr;
-
-    /* if a sub-directory */
-    struct KDatabase KONST *dad;
-
-    /* database directory */
-    struct KDirectory KONST *dir;
-
-    /* MD5 format object */
-    struct KMD5SumFmt *md5;
-
-    /* open references */
-#if 1
-    KRefcount refcount;
-    uint32_t opencount;
-#else
-    KDualRef refcount;
-    uint32_t align;
-#endif
-
-    /* fits into manager symbol table */
-    KSymbol sym;
-
-    /* global md5 usage for entire db */
-    bool use_md5;
-
-    /* true if database was opened read-only */
-    bool read_only;
-
-    /* symbol text space */
-    char path [ 1 ];
-};
-
-/* Attach
- * Sever
- *  like AddRef/Release, except called internally
- *  indicates that a child object is letting go...
- */
-KDatabase *KDatabaseAttach ( const KDatabase *self );
-rc_t KDatabaseSever ( const KDatabase *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_database_priv_ */
diff --git a/libs/kdb/database.c b/libs/kdb/database.c
deleted file mode 100644
index d81aba2..0000000
--- a/libs/kdb/database.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define KONST const
-#include <kdb/extern.h>
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#include "kdb-priv.h"
-#undef KONST
-
-#include <klib/namelist.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  connection to a database within file system
- */
-
-/* GetPath
- *  return the absolute path to DB
- */
-LIB_EXPORT rc_t CC KDatabaseGetPath ( KDatabase const *self,
-    const char **path )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-
-    *path = self->path;
-
-    return 0;
-}
-
-/* Whack
- */
-static
-rc_t KDatabaseWhack ( KDatabase *self )
-{
-    rc_t rc = 0;
-
-    KRefcountWhack ( & self -> refcount, "KDatabase" );
-
-    /* release dad */
-    if ( self -> dad != NULL )
-    {
-        rc = KDatabaseSever ( self -> dad );
-        if ( rc == 0 )
-            self -> dad = NULL;
-    }
-
-    /* remove from mgr */
-    if ( rc == 0 )
-        rc = KDBManagerSever ( self -> mgr );
-
-    /* complete */
-    if ( rc == 0 )
-    {
-        KDirectoryRelease ( self -> dir );
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KDatabase", "whack", "kdb" );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KDatabaseAddRef ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDatabaseRelease ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-KDatabase *KDatabaseAttach ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDatabase* ) self;
-}
-
-rc_t KDatabaseSever ( const KDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- *  make an initialized structure
- */
-static
-rc_t KDatabaseMake ( KDatabase **dbp, const KDirectory *dir, const char *path )
-{
-    KDatabase *db;
-
-    assert ( dbp != NULL );
-    assert ( path != NULL );
-
-    db = malloc ( sizeof * db + strlen ( path ) );
-    if ( db == NULL )
-    {
-        * dbp = NULL;
-        return RC ( rcDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    db -> mgr = NULL;
-    db -> dad = NULL;
-    db -> dir = dir;
-    KRefcountInit ( & db -> refcount, 1, "KDatabase", "make", path );
-    strcpy ( db -> path, path );
-
-    * dbp = db;
-    return 0;
-}
-
-
-/* OpenDBRead
- * VOpenDBRead
- *  open a database for read
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KDBManagerVOpenDBReadInt ( const KDBManager *self, const KDatabase **dbp,
-                                const KDirectory *wd, bool try_srapath,
-                                const char *path, va_list args )
-{
-    rc_t rc;
-
-    /* MUST use vsnprintf because the documented behavior of "path"
-       is that of stdc library's printf, not vdb printf */
-    char dbpath [ 4096 ];
-    int z = ( args == NULL ) ?
-        snprintf ( dbpath, sizeof dbpath, path ):
-        vsnprintf ( dbpath, sizeof dbpath, path, args );
-    if ( z < 0 || ( size_t ) z >= sizeof dbpath )
-        rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
-    else
-    {
-        const KDirectory *dir;
-
-        /* open the directory if its a database */
-        rc = KDBOpenPathTypeRead ( self, wd, dbpath, &dir, kptDatabase, NULL, try_srapath );
-        if ( rc == 0 )
-        {
-            KDatabase *db;
-
-            /* allocate a new guy */
-            rc = KDatabaseMake ( & db, dir, dbpath );
-            if ( rc == 0 )
-            {
-                db -> mgr = KDBManagerAttach ( self );
-                * dbp = db;
-                return 0;
-            }
-
-            KDirectoryRelease ( dir );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenDBRead ( self, db, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenDBRead ( const KDatabase *self,
-    const KDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenDBRead ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, va_list args )
-{
-    if ( db == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * db = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenDBReadInt ( self, db, self -> wd, true, path, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenDBRead ( const KDatabase *self,
-    const KDatabase **dbp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( dbp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * dbp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "db", 2, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenDBReadInt ( self -> mgr, dbp,
-            self -> dir, false, path, NULL );
-        if ( rc == 0 )
-        {
-            KDatabase *db = ( KDatabase* ) * dbp;
-            db -> dad = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KDatabaseLocked ( const KDatabase *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT bool CC KDatabaseVExists ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        size_t len;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptDatabase:
-            ns = "db";
-            len = 2;
-            break;
-
-        case kptTable:
-            ns = "tbl";
-            len = 3;
-            break;
-
-        case kptIndex:
-            ns = "idx";
-            len = 3;
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, len, name, args );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile:
-            case kptDir:
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC KDatabaseExists ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KDatabaseVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-LIB_EXPORT bool CC KDatabaseIsAlias ( const KDatabase *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        size_t len;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptDatabase:
-            ns = "db";
-            len = 2;
-            break;
-
-        case kptTable:
-            ns = "tbl";
-            len = 3;
-            break;
-
-        case kptIndex:
-            ns = "idx";
-            len = 3;
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, len, name );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                if ( resolved != NULL && rsize != 0 )
-                {
-                    const KDirectory *sub;
-                    rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
-                    * resolved = 0;
-                    if ( rc != 0 )
-                        PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
-                    else
-                    {
-                        rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
-                        KDirectoryRelease ( sub );
-                        if ( rc != 0 )
-                            PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
-                    }
-                }
-                return true;
-            }
-        }
-    }
-
-    if ( resolved != NULL && rsize != 0 )
-        * resolved = 0;
-
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDatabaseVWritable ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    /* TBD */
-    return -1;
-}
-
-LIB_EXPORT rc_t CC KDatabaseWritable ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = KDatabaseVWritable ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KDatabaseOpenManagerRead ( const KDatabase *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-
-/* GetDirectory
- *  access the directory in use
- */
-LIB_EXPORT rc_t CC KDatabaseOpenDirectoryRead ( const KDatabase *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-
-/* ModDate
- *  get modification date
- */
-LIB_EXPORT rc_t CC KDatabaseModDate ( const KDatabase *self, KTime_t *mtime )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            /* HACK ALERT - there needs to be a proper way to record modification times */
-            const KDirectory *dir = self -> dir;
-
-            /* this only tells the last time the table was locked,
-               which may be close to the last time it was modified */
-            rc = KDirectoryDate ( dir, mtime, "lock" );
-            if ( rc == 0 )
-                return 0;
-
-            /* get directory timestamp */
-            rc = KDirectoryDate ( dir, mtime, "." );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * mtime = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KNameList
- */
-
-/* List
- *  create database listings
- */
-struct FilterData
-{
-    const KDBManager * mgr;
-    int type;
-};
-
-static
-bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
-{
-    struct FilterData * data = data_;
-    return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListDB ( const KDatabase *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptDatabase;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "db", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListTbl ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptTable;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "tbl", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListIdx ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptIndex;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "idx", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
diff --git a/libs/kdb/dbcc-cmn.c b/libs/kdb/dbcc-cmn.c
deleted file mode 100644
index 09d287c..0000000
--- a/libs/kdb/dbcc-cmn.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#include <kdb/extern.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-
-#include "cc-priv.h"
-#include <os-native.h>
-
-#include <stdio.h> /* for sprintf */
-#include <string.h>
-
-static
-rc_t FileCheckMD5(const KDirectory *dir, const char name[], const uint8_t digest[])
-{
-    rc_t rc;
-    const KFile *fp;
-    const KFile *mds;
-    uint64_t pos;
-    size_t nr;
-    char buf[4096];
-    
-    rc = KDirectoryOpenFileRead(dir, &fp, name);
-    if (rc)
-        return rc;
-    rc = KFileMakeMD5Read(&mds, fp, digest);
-    if (rc) {
-        KFileRelease(fp);
-        return rc;
-    }
-    for (pos = 0; ; ) {
-        rc = KFileRead(mds, pos, buf, sizeof(buf), &nr);
-        if (rc || nr == 0)
-            break;
-        pos += nr;
-    }
-    KFileRelease(mds);
-
-    return rc;
-}
-
-rc_t DirectoryCheckMD5(const KDirectory *dir, const char name[],
-                       CCReportInfoBlock *nfo,
-                       CCReportFunc report, void *ctx)
-{
-    rc_t rc;
-    rc_t rc2 = 0;
-    const KFile *kf;
-    const KMD5SumFmt *sum;
-    uint32_t i;
-    uint32_t n;
-    uint8_t digest[16];
-    char pathbuf[4096];
-    char mesg[1024];
-    
-    mesg[0] = '\0';
-    
-    nfo->type = ccrpt_Done;
-    nfo->info.done.mesg = mesg;
-    
-    rc = KDirectoryOpenFileRead(dir, &kf, name);
-    if (rc) {
-        snprintf(mesg, sizeof(mesg), "MD5 file '%s' could not be opened", name);
-        nfo->info.done.rc = rc;
-        return report(nfo, ctx);
-    }
-    rc = KMD5SumFmtMakeRead(&sum, kf);
-    if (rc) {
-        KFileRelease(kf);
-        snprintf(mesg, sizeof(mesg), "MD5 file '%s' could not be read", name);
-        nfo->info.done.rc = rc;
-        return report(nfo, ctx);
-    }
-    rc = KMD5SumFmtCount(sum, &n);
-    if (rc)
-        return rc;
-    for (i = 0; i != n; ++i) {
-        char *path = pathbuf;
-        rc = KMD5SumFmtGet(sum, i, pathbuf, sizeof(pathbuf), digest, NULL);
-        if (rc)
-            break;
-
-        /* catch case where skey.md5 contains full path */
-        if ( path [ 0 ] == '/' )
-        {
-            size_t sz = strlen ( path );
-            if ( sz >= 5 && strcmp ( & path [ sz - 5 ], "/skey" ) == 0 )
-                path = "skey";
-        }
-
-        rc = FileCheckMD5(dir, path, digest);
-        if (rc2 == 0)
-            rc2 = rc;
-        nfo->type = ccrpt_MD5;
-        nfo->info.MD5.rc = rc;
-        nfo->info.MD5.file = path;
-        rc = report(nfo, ctx);
-        if ( rc != 0 )
-            break;
-    }
-    KMD5SumFmtRelease(sum);
-    if (rc)
-        return rc;
-    
-    nfo->type = ccrpt_Done;
-    if (rc2) {
-        nfo->info.done.mesg = "failed md5 validation";
-        nfo->info.done.rc = rc2;
-    }
-    else {
-        nfo->info.done.mesg = "md5 ok";
-        nfo->info.done.rc = 0;
-    }
-    return report(nfo, ctx);
-}
diff --git a/libs/kdb/dbmgr-cmn.c b/libs/kdb/dbmgr-cmn.c
deleted file mode 100644
index 3a5daeb..0000000
--- a/libs/kdb/dbmgr-cmn.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kdb/extern.h>
-#include "libkdb.vers.h"
-
-#define KONST const
-#include "dbmgr-priv.h"
-#include "kdb-priv.h"
-#undef KONST
-
-#include <vfs/manager.h>
-#include <kfs/directory.h>
-#include <klib/symbol.h>
-#include <klib/checksum.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * KDBManager
- *  handle to library
- */
-
-
-/* Whack
- */
-static
-rc_t KDBManagerWhack ( KDBManager *self )
-{
-    rc_t rc;
-
-    KRefcountWhack ( & self -> refcount, "KDBManager" );
-
-    /* everything should be closed */
-    assert ( self -> open_objs . root == NULL );
-
-    rc = VFSManagerRelease ( self -> vfsmgr );
-
-    rc = KDirectoryRelease ( self -> wd );
-    if ( rc == 0 )
-    {
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KDBManager", "whack", "kmgr" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KDBManagerAddRef ( const KDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDBManager" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDBManagerRelease ( const KDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDBManager" ) )
-        {
-        case krefWhack:
-            return KDBManagerWhack ( ( KDBManager* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Attach
- * Sever
- */
-KDBManager* KDBManagerAttach ( const KDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDBManager" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDBManager* ) self;
-}
-
-rc_t KDBManagerSever ( const KDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDBManager" ) )
-        {
-        case krefWhack:
-            return KDBManagerWhack ( ( KDBManager* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make - PRIVATE
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- */
-rc_t KDBManagerMake ( KDBManager **mgrp, const KDirectory *wd, const char *op,
-    VFSManager *vmanager )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcDB, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KDBManager *mgr = malloc ( sizeof * mgr );
-        if ( mgr == NULL )
-            rc = RC ( rcDB, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            memset ( mgr, 0, sizeof * mgr );
-            mgr -> wd = wd;
-            if ( wd != NULL )
-                rc = KDirectoryAddRef ( wd );
-            else
-                rc = KDirectoryNativeDir ( ( KDirectory** ) & mgr -> wd );
-
-            if ( rc == 0 )
-            {
-                if (vmanager == NULL) {
-                    rc = VFSManagerMake ( & mgr -> vfsmgr );
-                }
-                else {
-                    rc = VFSManagerAddRef ( vmanager );
-                    if (rc == 0) {
-                        mgr -> vfsmgr = vmanager;
-                    }
-                }
-
-                if ( rc == 0 )
-                {
-                    CRC32Init ();
-
-                    BSTreeInit ( & mgr -> open_objs );
-
-                    KRefcountInit ( & mgr -> refcount, 1, "KDBManager", op, "kmgr" );
-
-                    * mgrp = mgr;
-                    return 0;
-                }
-            }
-
-            free ( mgr );
-        }
-
-        * mgrp = NULL;
-    }
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerGetVFSManager ( const KDBManager *self,
-    const struct VFSManager **vmanager )
-{
-    if (self == NULL) {
-        return RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-    }
-    else if (vmanager == NULL) {
-        return RC ( rcDB, rcMgr, rcAccessing, rcParam, rcNull );
-    }
-    else {
-        rc_t rc = VFSManagerAddRef(self -> vfsmgr);
-        if (rc == 0) {
-            * vmanager = self -> vfsmgr;
-        }
-        else {
-            * vmanager = NULL;
-        }
-        return rc;
-    }
-}
-
-
-/* Version
- *  returns the library version
- */
-LIB_EXPORT rc_t CC KDBManagerVersion ( const KDBManager *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcMgr, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    * version = LIBKDB_VERS;
-    return 0;
-}
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "requested" [ IN ] - a KDBPathType
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT bool CC KDBManagerVExists ( const KDBManager *self, uint32_t requested, const char *name, va_list args )
-{
-    int type;
-
-    type = KDBManagerVPathType (self, name, args);
-    switch ( type )
-    {
-    case kptDatabase:
-    case kptTable:
-    case kptIndex:
-    case kptColumn:
-    case kptMetadata:
-        break;
-    case kptPrereleaseTbl:
-        type = kptTable;
-        break;
-    default:
-        return false;
-    }
-    return requested == ( uint32_t ) type;
-}
-
-bool KDBManagerExists ( const KDBManager *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KDBManagerVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "path" [ IN ] - NUL terminated path
- */
-
-/* TBD - should be in this file */
-
-/* CheckOpen
- */
-rc_t KDBManagerCheckOpen ( const KDBManager * self, const char *path )
-{
-    /* try to find the open object by path */
-    KSymbol *sym = KDBManagerOpenObjectFind ( self, path );
-
-    /* if not open, return no error */
-    if ( sym == NULL )
-        return 0;
-
-    /* put together an appropriate response */
-    switch ( sym -> type )
-    {
-    case kptDatabase:
-        return RC ( rcDB, rcMgr, rcAccessing, rcDatabase, rcBusy );
-    case kptTable:
-        return RC ( rcDB, rcMgr, rcAccessing, rcTable, rcBusy );
-    case kptColumn:
-        return RC ( rcDB, rcMgr, rcAccessing, rcColumn, rcBusy );
-    case kptIndex:
-        return RC ( rcDB, rcMgr, rcAccessing, rcIndex, rcBusy );
-    case kptMetadata:
-        return RC ( rcDB, rcMgr, rcAccessing, rcMetadata, rcBusy );
-    case kptPrereleaseTbl:
-        return RC ( rcDB, rcMgr, rcAccessing, rcTable, rcBusy );
-    default:
-        break;
-    }
-
-    return RC ( rcDB, rcMgr, rcAccessing, rcUnknown, rcBusy );
-}
-
-
-
-/* OpenObjectFind
- *  return a pointer to the openobject with path
- */
-static
-KSymbol *KDBManagerOpenObjectFindInt ( const KDBManager * self, String *s )
-{
-    return ( KSymbol* ) BSTreeFind ( & self -> open_objs, s, KSymbolCmp );
-}
-
-KSymbol *KDBManagerOpenObjectFind ( const KDBManager * self, const char * path )
-{
-    String s;
-    StringInitCString ( & s, path );
-    return KDBManagerOpenObjectFindInt ( self, & s );
-}
-
-
-/* OpenObjectBusy
- *  Is this path to an object in the OpenObjects list?
- */
-bool KDBManagerOpenObjectBusy ( const KDBManager *self, const char *path )
-{
-    return KDBManagerOpenObjectFind ( self, path ) != NULL;
-}
-
-
-/* OpenObjectAdd
- *  Put an object in to the open objects list
- */
-rc_t KDBManagerOpenObjectAdd ( KDBManager *self, KSymbol *obj )
-{
-    KSymbol *exists;
-    rc_t rc = BSTreeInsertUnique ( & self -> open_objs,
-        & obj -> n, ( BSTNode** ) & exists, KSymbolSort );
-
-    if ( rc == 0 )
-        return 0;
-
-    switch ( exists -> type )
-    {
-    case kptDatabase:
-        return RC ( rcDB, rcMgr, rcInserting, rcDatabase, rcBusy );
-    case kptTable:
-    case kptPrereleaseTbl:
-        return RC ( rcDB, rcMgr, rcInserting, rcTable, rcBusy );
-    case kptColumn:
-        return RC ( rcDB, rcMgr, rcInserting, rcColumn, rcBusy );
-    case kptIndex:
-        return RC ( rcDB, rcMgr, rcInserting, rcIndex, rcBusy );
-    case kptMetadata:
-        return RC ( rcDB, rcMgr, rcInserting, rcMetadata, rcBusy );
-    }
-
-    return RC ( rcDB, rcMgr, rcInserting, rcUnknown, rcBusy );
-}
-
-
-/* OpenDelete
- *  Take an object out of the open objects list
- */
-rc_t KDBManagerOpenObjectDelete ( KDBManager *self, KSymbol *obj )
-{
-    if ( obj != NULL )
-    {
-        /* we can expect that the only valid reason for
-           "obj" not being unlinked is that it was not in
-           the tree. other reasons would be that "obj" was
-           corrupt, but in any event, it's not in the tree */
-        if ( ! BSTreeUnlink ( & self -> open_objs, & obj -> n ) )
-
-            /* to be truly weird, we could tell what kind of node
-               it was that we didn't find */
-            return RC ( rcDB, rcMgr, rcRemoving, rcNode, rcNotFound );
-    }
-
-    return 0;
-}
-
-
-/* ModDate
- *  return a modification timestamp for table
- */
-LIB_EXPORT rc_t CC KDBManagerVGetTableModDate ( const KDBManager *self,
-    KTime_t *mtime, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self != NULL )
-            return KDBVGetPathModDate ( self -> wd, mtime, path, args );
-
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-        * mtime = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerGetTableModDate ( const KDBManager *self,
-    KTime_t *mtime, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-    rc = KDBManagerVGetTableModDate ( self, mtime, path, args );
-    va_end ( args );
-
-    return rc;
-}
diff --git a/libs/kdb/dbmgr-priv.h b/libs/kdb/dbmgr-priv.h
deleted file mode 100644
index 3ef8617..0000000
--- a/libs/kdb/dbmgr-priv.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_dbmgr_priv_
-#define _h_dbmgr_priv_
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSymbol;
-struct KDirectory;
-struct VFSManager;
-
-/*--------------------------------------------------------------------------
- * KDBManager
- *  handle to library
- */
-struct KDBManager
-{
-    /* root directory */
-    struct KDirectory KONST *wd;
-
-    /* open objects */
-    BSTree open_objs;
-
-    /* open references */
-    KRefcount refcount;
-
-    /* other managers needed by the KDB manager */
-    struct VFSManager * vfsmgr;
-};
-
-
-/* Make - PRIVATE
- */
-rc_t KDBManagerMake ( KDBManager **mgrp, struct KDirectory const *wd,
-    const char *op, struct VFSManager *vmanager );
-
-/* Attach
- * Sever
- */
-#if 1
-KDBManager *KDBManagerAttach ( const KDBManager *self );
-rc_t KDBManagerSever ( const KDBManager *self );
-#else
-KDBManager *KDBManagerAttach ( const KDBManager *self, struct KSymbol *sym );
-rc_t KDBManagerSever ( const KDBManager *self, struct KSymbol *sym );
-#endif
-
-/* CheckOpen
- *  tests if object is open and returns an error code
- *  of 0 if not, or <target>, rcBusy if so, where
- *  <target> is generated from object type.
- */
-rc_t KDBManagerCheckOpen ( const KDBManager *self, const char *path );
-
-/* OpenObjectBusy
- *   Does this path reference an object already open?
- */
-bool KDBManagerOpenObjectBusy ( const KDBManager *self, const char *path );
-
-/* OpenObjectFind
- *   return a reference to an object with this "symbol" - path
- */
-struct KSymbol *KDBManagerOpenObjectFind ( const KDBManager *self, const char *path );
-
-/* OpenObjectAdd
- *   Put this symbol in the list of open objects
- */
-rc_t KDBManagerOpenObjectAdd ( KDBManager *self, struct KSymbol *obj );
-
-/* OpenObjectDelete
- *   remove this symbol in the list of open objects
- */
-rc_t KDBManagerOpenObjectDelete ( KDBManager *self, struct KSymbol *obj );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_dbmgr_priv_ */
diff --git a/libs/kdb/dbmgr.c b/libs/kdb/dbmgr.c
deleted file mode 100644
index 90ac480..0000000
--- a/libs/kdb/dbmgr.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kdb/extern.h>
-
-#include <kdb/kdb-priv.h> /* KDBManagerMakeReadWithVFSManager */
-
-#include "libkdb.vers.h"
-
-#include <vfs/manager.h>
-#include <vfs/resolver.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <kfs/directory.h>
-
-#define KONST const
-#include "dbmgr-priv.h"
-#include "kdb-priv.h"
-#include "kdbfmt-priv.h"
-#include <klib/checksum.h>
-#include <klib/rc.h>
-#undef KONST
-
-#include <klib/text.h>
-
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * KDBManager
- *  handle to library
- */
-
-
-/* MakeRead
- * MakeReadWithVFSManager
- *  create library handle for specific use
- *  NB - only one of the functions will be implemented
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- */
-LIB_EXPORT rc_t CC KDBManagerMakeRead ( const KDBManager **mgrp, const KDirectory *wd )
-{
-    return KDBManagerMakeReadWithVFSManager(mgrp, wd, NULL);
-}
-
-LIB_EXPORT rc_t CC KDBManagerMakeReadWithVFSManager ( const KDBManager **mgrp,
-    const KDirectory *wd, struct VFSManager *vmanager )
-{
-    return KDBManagerMake ( ( KDBManager** ) mgrp, wd, "make-read", vmanager );
-}
-
-/*
- * Resolve using manager, possibly against this directory, using or not uri
- * accession resolution of those dangerous formatted path thingies
- *
-
-
-
- * 1. If naked accession or uri accession resolve to local, 
-
-
- * self                         = a kdbmanager
- * disable_accession_resolution = turn off VResolver usage for accessions
- *                                read versus create/upate 
- * resolved+path                = a vpath created based on text path
- * fmt                          = our scary interface that is 'sprintf'ish
- * args                         = goes with the fmt
- *
- * NOTE: as usual a path with a '%' becomes broken at unsuspected times
- */
-rc_t KDBManagerResolveVPathInt (const KDBManager * self, 
-                                bool disable_accession_resolution,
-                                VPath ** resolved_path, 
-                                const VPath * path)
-{
-    uint32_t flags;
-
-    assert (self != NULL);
-    assert (resolved_path != NULL);
-    assert (path != NULL);
-
-    flags = disable_accession_resolution
-        ? vfsmgr_rflag_no_acc
-        : vfsmgr_rflag_kdb_acc;
-
-    return VFSManagerResolvePath (self->vfsmgr, 
-                                  flags,
-                                  path, resolved_path);
-}
-
-
-rc_t KDBManagerVResolveVPath (const KDBManager * self, 
-                                bool disable_accession_resolution,
-                                VPath ** resolved_path, 
-                                const VPath * path)
-{
-    return KDBManagerResolveVPathInt (self, disable_accession_resolution,
-                                      resolved_path, path);
-}
-
-
-rc_t KDBManagerVResolvePath (const KDBManager * self, 
-                             bool disable_accession_resolution,
-                             VPath ** resolved_path, 
-                             const char * fmt, va_list args)
-{
-    VPath * p;
-    rc_t rc;
-
-    if (resolved_path == NULL)
-        return RC (rcDB, rcMgr, rcResolving, rcParam, rcNull);
-
-    *resolved_path = NULL;
-
-    if (self == NULL)
-        return RC (rcDB, rcMgr, rcResolving, rcSelf, rcNull);
-
-    if ((fmt == NULL) || (fmt[0] == '\0'))
-        return RC (rcDB, rcMgr, rcResolving, rcParam, rcNull);
-
-    rc = VFSManagerVMakePath ( self -> vfsmgr, &p, fmt, args);
-    if (rc == 0)
-    {
-        rc = KDBManagerVResolveVPath (self, disable_accession_resolution,
-                                      resolved_path, p);
-        VPathRelease (p);
-    }
-    return rc;
-}
-
-rc_t KDBManagerVResolvePathRelativeDir (const KDBManager * self, const KDirectory * dir,
-                                        bool disable_accession_resolution,
-                                        VPath ** resolved_path, 
-                                        const char * fmt, va_list args)
-{
-    VPath * p;
-    rc_t rc;
-
-    if (resolved_path == NULL)
-        return RC (rcDB, rcMgr, rcResolving, rcParam, rcNull);
-
-    *resolved_path = NULL;
-
-    if (self == NULL)
-        return RC (rcDB, rcMgr, rcResolving, rcSelf, rcNull);
-
-    if ((fmt == NULL) || (fmt[0] == '\0'))
-        return RC (rcDB, rcMgr, rcResolving, rcParam, rcNull);
-
-    rc = VFSManagerVMakePath ( self -> vfsmgr, &p, fmt, args);
-    if (rc == 0)
-    {
-        rc = KDBManagerVResolveVPath (self, disable_accession_resolution,
-                                      resolved_path, p);
-        VPathRelease (p);
-    }
-    return rc;
-}
-
-
-rc_t KDBManagerResolvePathRelativeDir (const KDBManager * self,
-                                       const KDirectory * dir,
-                                       bool disable_accession_resolution,
-                                       VPath ** resolved_path, const char * fmt, ...)
-{
-    va_list args;
-    rc_t rc;
-
-    va_start (args, fmt);
-
-    rc = KDBManagerVResolvePathRelativeDir (self, dir, 
-                                            disable_accession_resolution,
-                                            resolved_path, fmt, args);
-    va_end (args);
-    return rc;
-}
-
-
-
-/* KDBHdrValidate
- *  validates that a header sports a supported byte order
- *  and that the version is within range
- */
-rc_t KDBHdrValidate ( const KDBHdr *hdr, size_t size,
-    uint32_t min_vers, uint32_t max_vers )
-{
-    assert ( hdr != NULL );
-
-    if ( size < sizeof * hdr )
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-
-    if ( hdr -> endian != eByteOrderTag )
-    {
-        if ( hdr -> endian == eByteOrderReverse )
-            return RC ( rcDB, rcHeader, rcValidating, rcByteOrder, rcIncorrect );
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-    }
-
-    if ( hdr -> version < min_vers || hdr -> version > max_vers )
-        return RC ( rcDB, rcHeader, rcValidating, rcHeader, rcBadVersion );
-
-    return 0;
-}
-
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDBManagerVWritable ( const KDBManager *self, const char * path, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        char dbpath [ 4096 ];
-
-        /* get full path to object */
-        rc = KDirectoryVResolvePath ( self -> wd, true, dbpath, sizeof dbpath, path, args );
-        if ( rc == 0 )
-        {
-            int type = KDBPathType ( self -> wd, NULL, path ) & ~ kptAlias;
-            switch ( type )
-            {
-            case kptDatabase:
-            case kptTable:
-            case kptColumn:
-            case kptIndex:
-                rc = KDBWritable ( self -> wd, path );
-                break;
-            case kptNotFound:
-                rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcNotFound );
-                break;
-            case kptBadPath:
-                rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcInvalid );
-                break;
-            default:
-                rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcIncorrect );
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerWritable ( const KDBManager *self, const char * path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDBManagerVWritable ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* RunPeriodicTasks
- *  executes periodic tasks, such as cache flushing
- */
-LIB_EXPORT rc_t CC KDBManagerRunPeriodicTasks ( const KDBManager *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcExecuting, rcSelf, rcNull );
-
-    return 0;
-}
-
-
-/* PathType
- *  check the path type of an object/directory path.
- *  this is an extension of the KDirectoryPathType and will return
- *  the KDirectory values if a path type is not specifically a
- *  kdb object
- */
-LIB_EXPORT int CC KDBManagerPathTypeVP ( const KDBManager * self, const VPath * path )
-{
-    VPath * rpath;
-    int path_type;
-    rc_t rc;
-
-    path_type = kptBadPath;
-    if ((self != NULL) && (path != NULL))
-    {
-        /*
-         * resolve the possible relative path or accession into
-         * a final path we can open directly
-         */
-        rc = KDBManagerResolveVPathInt (self, false, &rpath, path);
-        if (rc == 0)
-        {
-            const KDirectory * dir;
-
-            /*
-             * Most KDBPathType values are based on 'directories'
-             * so try to open the resolved path as a directory
-             */
-            rc = VFSManagerOpenDirectoryReadDecrypt (self->vfsmgr, &dir, rpath);
-            if (rc == 0)
-            {
-                path_type = KDBPathTypeDir (dir, kptDir, NULL, ".");
-                KDirectoryRelease (dir);
-            }
-            /*
-             * If we couldn't open the path as a directory we 'might'
-             * have a KDB idx but we will only try that for a limited
-             * set of uri schemes.
-             */
-            else
-            {
-#if 1
-                if ( VPathIsFSCompatible ( rpath ) )
-                {
-                    char buffer [ 4096 ];
-                    rc = VPathReadPath ( rpath, buffer, sizeof buffer, NULL );
-                    if ( rc == 0 )
-                        path_type = KDBPathType ( self -> wd, false, buffer );
-                }
-#else
-                VPUri_t t;
-
-                rc = VPathGetScheme_t (rpath, &t);
-                if (rc == 0)
-                {
-                    switch (t)
-                    {
-                    default:
-                        break;
-                    case vpuri_ncbi_vfs:
-                    case vpuri_file:
-                    case vpuri_none:
-                    {
-                        char b [4 * 1024];
-                        size_t z;
-                        rc = VPathReadPath (path, b, sizeof b, &z);
-                        if (rc == 0)
-                            path_type = KDBPathType (self->wd, false, b);
-                        break;
-                    }}
-                }
-#endif
-            }
-            VPathRelease (rpath);
-        }
-    }
-    return path_type;
-}
-
-
-LIB_EXPORT int CC KDBManagerVPathType ( const KDBManager * self, const char *path, va_list args )
-{
-    int path_type = kptBadPath;
-
-    if ((self != NULL) && (path != NULL))
-    {
-        VPath * vp;
-        rc_t rc;
-
-        rc = VFSManagerVMakePath ( self -> vfsmgr, &vp, path, args);
-        if (rc == 0)
-        {
-            path_type = KDBManagerPathTypeVP (self, vp);
-            VPathRelease (vp);
-        }
-    }
-    return path_type;
-}
-
-
-LIB_EXPORT int CC KDBManagerPathType ( const KDBManager * self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-
-    rc = KDBManagerVPathType ( self, path, args );
-
-    va_end (args);
-    return rc;
-}
diff --git a/libs/kdb/idstats-priv.h b/libs/kdb/idstats-priv.h
deleted file mode 100644
index cae6809..0000000
--- a/libs/kdb/idstats-priv.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_idstats_priv_
-#define _h_idstats_priv_
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KIdStats
- *  maintains statistics about id mappings
- */
-typedef struct KIdStats KIdStats;
-struct KIdStats
-{
-    int64_t i_min_id, x_max_id;
-    uint64_t num_entries;
-    uint64_t num_ids;
-    uint64_t num_holes;
-    BSTree ids;
-};
-
-
-/* Init
- *  initialize the object
- */
-void KIdStatsInit ( KIdStats *s );
-
-/* Whack
- *  tear down the object
- */
-void KIdStatsWhack ( KIdStats *self );
-
-/* Insert
- *  add an entry representing 1 or more consecutive ids
- */
-rc_t KIdStatsInsert ( KIdStats *self, int64_t id, uint64_t count );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_idstats_priv_ */
diff --git a/libs/kdb/idstats.c b/libs/kdb/idstats.c
deleted file mode 100644
index e37b872..0000000
--- a/libs/kdb/idstats.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "idstats-priv.h"
-
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KIdStatsNode
- */
-typedef struct KIdStatsNode KIdStatsNode;
-struct KIdStatsNode
-{
-    BSTNode n;
-    int64_t i_left, x_right;
-};
-
-
-/* Init
- */
-static
-void KIdStatsNodeInit ( KIdStatsNode *node, int64_t id, uint64_t count )
-{
-    if ( node != NULL )
-    {
-        node -> i_left = id;
-        node -> x_right = id + count;
-    }
-}
-
-
-/* Make
- */
-static
-KIdStatsNode *KIdStatsNodeMake ( int64_t id, uint64_t count )
-{
-    KIdStatsNode *node = malloc ( sizeof * node );
-    KIdStatsNodeInit ( node, id, count );
-    return node;
-}
-
-/* Whack
- */
-static
-void CC KIdStatsNodeWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/* Cmp
- * Sort
- */
-static
-int CC KIdStatsNodeCmp ( const void *item, const BSTNode *n )
-{
-    const KIdStatsNode *a = item;
-    const KIdStatsNode *b = ( const KIdStatsNode* ) n;
-
-    if ( a -> x_right < b -> i_left )
-        return -1;
-    if ( a -> i_left > b -> x_right )
-        return 1;
-    return 0;
-}
-
-static
-int CC KIdStatsNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-    const KIdStatsNode *a = ( const KIdStatsNode* ) item;
-    const KIdStatsNode *b = ( const KIdStatsNode* ) n;
-
-    if ( a -> x_right < b -> i_left )
-        return -1;
-    if ( a -> i_left > b -> x_right )
-        return 1;
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * KIdStats
- *  maintains statistics about text index mappings
- */
-
-/* Init
- *  initialize the object
- */
-void KIdStatsInit ( KIdStats *s )
-{
-    if ( s != NULL )
-        memset ( s, 0, sizeof * s );
-}
-
-/* Whack
- *  tear down the object
- */
-void KIdStatsWhack ( KIdStats *self )
-{
-    if ( self != NULL )
-    {
-        BSTreeWhack ( & self -> ids, KIdStatsNodeWhack, NULL );
-        BSTreeInit ( & self -> ids );
-    }
-}
-
-/* Insert
- *  add an entry representing 1 or more consecutive ids
- */
-rc_t KIdStatsInsert ( KIdStats *self, int64_t id, uint64_t count )
-{
-    rc_t rc;
-    KIdStatsNode *node, *existing;
-
-    /* could be an assert - but here we go */
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcParam, rcNull );
-
-    /* if this is not the first entry */
-    if ( self -> num_entries != 0 )
-    {
-        KIdStatsNode item;
-        KIdStatsNodeInit ( & item, id, count );
-        existing = ( KIdStatsNode* ) BSTreeFind ( & self -> ids, & item, KIdStatsNodeCmp );
-        if ( existing != NULL )
-        {
-            /* min/max the range */
-            if ( id < self -> i_min_id )
-                self -> i_min_id = id;
-            if ( id + count > self -> x_max_id )
-                self -> x_max_id = id + count;
-            ++ self -> num_entries;
-
-            /* merge this insert with the returned node */
-            if ( existing -> i_left > item . i_left )
-            {
-                self -> num_ids += existing -> i_left - item . i_left;
-                existing -> i_left = item . i_left;
-
-                /* merge node toward left */
-                for ( node = ( KIdStatsNode* ) BSTNodePrev ( & existing -> n );
-                      node != NULL;
-                      node = ( KIdStatsNode* ) BSTNodePrev ( & existing -> n ) )
-                {
-                    /* exit loop if no intersection */
-                    if ( existing -> i_left > node -> x_right )
-                        break;
-
-                    /* a hole will be closed */
-                    assert ( self -> num_holes > 0 );
-                    -- self -> num_holes;
-
-                    /* remove overlaps from count and extend "existing" */
-                    if ( existing -> i_left <= node -> i_left )
-                        self -> num_ids -= node -> x_right - node -> i_left;
-                    else
-                    {
-                        self -> num_ids -= node -> x_right - existing -> i_left;
-                        existing -> i_left = node -> i_left;
-                    }
-
-                    /* drop old node */
-                    BSTreeUnlink ( & self -> ids, & node -> n );
-                    KIdStatsNodeWhack ( & node -> n, NULL );
-                }
-            }
-
-            /* now merge right edge */
-            if ( item . x_right > existing -> x_right )
-            {
-                self -> num_ids += item . x_right - existing -> x_right;
-                existing -> x_right = item . x_right;
-
-                /* merge node toward right */
-                for ( node = ( KIdStatsNode* ) BSTNodeNext ( & existing -> n );
-                      node != NULL;
-                      node = ( KIdStatsNode* ) BSTNodeNext ( & existing -> n ) )
-                {
-                    /* exit loop if no intersection */
-                    if ( existing -> x_right < node -> i_left )
-                        break;
-
-                    /* a hole will be closed */
-                    assert ( self -> num_holes > 0 );
-                    -- self -> num_holes;
-
-                    /* remove overlaps from count and extend "existing" */
-                    if ( existing -> x_right >= node -> x_right )
-                        self -> num_ids -= node -> x_right - node -> i_left;
-                    else
-                    {
-                        self -> num_ids -= existing -> x_right - node -> i_left;
-                        existing -> x_right = node -> x_right;
-                    }
-
-                    /* drop old node */
-                    BSTreeUnlink ( & self -> ids, & node -> n );
-                    KIdStatsNodeWhack ( & node -> n, NULL );
-                }
-            }
-
-            return 0;
-        }
-    }
-
-    /* create the node */
-    node = KIdStatsNodeMake ( id, count );
-    if ( node == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcMemory, rcExhausted );
-
-    /* insert it and be certain there are no collisions */
-    rc = BSTreeInsertUnique ( & self -> ids, & node -> n,
-        ( BSTNode** ) & existing, KIdStatsNodeSort );
-
-    if ( rc != 0 )
-        KIdStatsNodeWhack ( & node -> n, NULL );
-    else if ( self -> num_entries == 0 )
-    {
-        /* initial insert */
-        self -> i_min_id = id;
-        self -> x_max_id = id + count;
-        self -> num_entries = 1;
-        self -> num_ids = count;
-    }
-    else
-    {
-        /* min/max the range */
-        if ( id < self -> i_min_id )
-            self -> i_min_id = id;
-        if ( id + count > self -> x_max_id )
-            self -> x_max_id = id + count;
-        ++ self -> num_entries;
-        self -> num_ids += count;
-
-        /* the insert represents a hole */
-        ++ self -> num_holes;
-    }
-
-    return rc;
-}
diff --git a/libs/kdb/idxblk-priv.h b/libs/kdb/idxblk-priv.h
deleted file mode 100644
index 71fc191..0000000
--- a/libs/kdb/idxblk-priv.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_idxblk_priv_
-#define _h_idxblk_priv_
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColConstBlockMap
- *  maps an index or page section of block index
- */
-typedef struct KColConstBlockMap KColConstBlockMap;
-struct KColConstBlockMap
-{
-    /* types 1-3 have a header section */
-    union
-    {
-        /* for assignment and manipulation */
-        const void *p;
-        const char *c;
-
-        /* type 1 has a constant range/size */
-        const uint32_t *span;
-
-        /* type 2 has a predictable id/pos */
-        const uint64_t *first;
-
-        /* type 3 has a starting page and constant size */
-        const struct
-        {
-            uint64_t pg;
-            uint32_t sz;
-        } *pred;
-
-        /* for rewriting columns */
-        uint32_t *last;
-
-    } h;
-
-    /* types 0 and 1 have explicit id/pos, where id is ordered */
-    const uint64_t *d;
-
-    /* types 0 and 2 have explicit range/size */
-    const uint32_t *s;
-};
-
-
-/*--------------------------------------------------------------------------
- * KColIdxBlock
- *  level 2 index reading block
- *
- *  each index block has two sections
- */
-typedef struct KColIdxBlock KColIdxBlock;
-struct KColIdxBlock
-{
-    /* function for locating index */
-    int ( * find ) ( const KColIdxBlock *self,
-        const KColBlockLoc *bloc, uint32_t count,
-        int64_t id, int64_t *first, uint32_t *span );
-
-    /* function for locating blob */
-    void ( * get ) ( const KColIdxBlock *self,
-        const KColBlockLoc *bloc, uint32_t count,
-        uint32_t idx, uint64_t *pos, uint32_t *sz );
-
-    /* index section map */
-    KColConstBlockMap id;
-
-    /* page locator section map */
-    KColConstBlockMap pg;
-};
-
-/* Init
- */
-rc_t KColIdxBlockInit ( KColIdxBlock *self,
-    const KColBlockLoc *bloc, size_t orig,
-    const void *block, size_t block_size, bool bswap );
-
-/* Find
- *  find zero-based index of entry into block
- *  that satisfies request
- *  returns -1 if not found
- */
-int KColIdxBlockFind ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span );
-#define KColIdxBlockFind( self, bloc, count, id, first, span ) \
-    ( * ( self ) -> find ) ( self, bloc, count, id, first, span )
-
-/* Get
- *  get blob location information
- */
-void KColIdxBlockGet ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    uint32_t idx, uint64_t *pg, uint32_t *sz );
-#define KColIdxBlockGet( self, bloc, count, idx, pg, sz ) \
-    ( * ( self ) -> get ) ( self, bloc, count, idx, pg, sz )
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_idxblk_priv_ */
diff --git a/libs/kdb/idxblk.c b/libs/kdb/idxblk.c
deleted file mode 100644
index e5c14cf..0000000
--- a/libs/kdb/idxblk.c
+++ /dev/null
@@ -1,695 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "idxblk-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColConstBlockMap
- *  maps an index or page section of block index
- */
-static
-void KColConstBlockMapSwap ( KColConstBlockMap *self, uint32_t count, int type )
-{
-    uint32_t i;
-
-    switch ( type )
-    {
-    case btypeUniform:
-        ( ( uint32_t* ) self -> h . span ) [ 0 ] = bswap_32 ( self -> h . span [ 0 ] );
-        break;
-    case btypeMagnitude:
-        ( ( uint64_t* ) self -> h . first ) [ 0 ] = bswap_64 ( self -> h . first [ 0 ] );
-        break;
-    case btypePredictable:
-        * ( uint64_t* ) & ( self -> h . pred -> pg ) = bswap_64 ( self -> h . pred -> pg );
-        * ( uint32_t* ) & ( self -> h . pred -> sz ) = bswap_32 ( self -> h . pred -> sz );
-        break;
-    }
-
-    switch ( type )
-    {
-    case btypeRandom:
-    case btypeUniform:
-        for ( i = 0; i < count; ++ i )
-            ( ( uint64_t* ) self -> d ) [ i ] = bswap_64 ( self -> d [ i ] );
-        break;
-    }
-
-    switch ( type )
-    {
-    case btypeRandom:
-    case btypeMagnitude:
-        for ( i = 0; i < count; ++ i )
-            ( ( uint32_t* ) self -> s ) [ i ] = bswap_32 ( self -> s [ i ] );
-        break;
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * KColIdxBlock
- *  level 2 index reading block
- *
- *  each index block has two sections
- */
-
-/* Find
- */
-static
-int KColIdxBlockFind0 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span )
-{
-    unsigned int left = 0;
-    unsigned int right = count;
-
-    do
-    {
-        unsigned int i = ( left + right ) >> 1;
-        int64_t start_id = ( int64_t ) self -> id . d [ i ];
-        if ( start_id == id )
-        {
-            * first = start_id;
-            * span = self -> id . s [ i ];
-            return ( int ) i;
-        }
-        if ( start_id > id )
-            right = i;
-        else
-        {
-            if ( start_id + self -> id . s [ i ] > id )
-            {
-                * span = self -> id . s [ i ];
-                * first = start_id;
-                return ( int ) i;
-            }
-
-            left = i + 1;
-        }
-    }
-    while ( left < right );
-
-    return -1;
-}
-
-static
-int KColIdxBlockFind1 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span )
-{
-    unsigned int left = 0;
-    unsigned int right = count;
-    unsigned int range = self -> id . h . span [ 0 ];
-
-    do
-    {
-        unsigned int i = ( left + right ) >> 1;
-        int64_t start_id = ( int64_t ) self -> id . d [ i ];
-        if ( start_id == id )
-        {
-            * first = start_id;
-            * span = range;
-            return ( int ) i;
-        }
-        if ( start_id > id )
-            right = i;
-        else
-        {
-            if ( start_id + range > id )
-            {
-                * first = start_id;
-                * span = range;
-                return ( int ) i;
-            }
-
-            left = i + 1;
-        }
-    }
-    while ( left < right );
-
-    return -1;
-}
-
-static
-int KColIdxBlockFind2 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span )
-{
-    /* special case for in-core image
-       the length of an entry is determined
-       by looking at the start of next entry
-       with the last entry having its length
-       stored in header */
-
-    unsigned int left, right;
-
-    /* examine last entry first, since it's the special case */
-    int64_t start_id = ( int64_t ) self -> id . d [ count - 1 ];
-    if ( start_id <= id )
-    {
-        if ( start_id == id ||
-             start_id + self -> id . h . span [ 0 ] > id )
-        {
-            * span = self -> id . h . span [ 0 ];
-            * first = start_id;
-            return ( int ) ( count - 1 );
-        }
-        return -1;
-    }
-
-    /* now perform normal binary search */
-    left = 0;
-    right = count - 1;
-    while ( left < right )
-    {
-        unsigned int i = ( left + right ) >> 1;
-        start_id = ( int64_t ) self -> id . d [ i ];
-        if ( start_id == id )
-        {
-            * first = start_id;
-            * span = ( uint32_t ) ( self -> id . d [ i + 1 ] - ( uint64_t ) start_id );
-            return ( int ) i;
-        }
-        if ( start_id > id )
-            right = i;
-        else
-        {
-            if ( self -> id . d [ i + 1 ] > (uint64_t)id )
-            {
-                * span = ( uint32_t ) ( self -> id . d [ i + 1 ] - ( uint64_t ) start_id );
-                * first = start_id;
-                return ( int ) i;
-            }
-
-            left = i + 1;
-        }
-    }
-
-    return -1;
-}
-
-static
-int KColIdxBlockFind3 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span )
-{
-    int i;
-    unsigned int ids_per;
-
-    assert ( id >= bloc -> start_id );
-    assert ( id < bloc -> start_id + bloc -> id_range );
-    assert ( bloc -> id_range != 0 );
-
-    if ( bloc -> id_range == ( uint32_t ) count )
-    {
-        * first = id;
-        * span = 1;
-        return ( int ) ( id - bloc -> start_id );
-    }
-
-    assert ( count != 0 );
-    ids_per = bloc -> id_range / count;
-    assert ( ids_per * count == bloc -> id_range );
-
-    i = ( int ) ( ( id - bloc -> start_id ) / ids_per );
-    * first = bloc -> start_id + ( i * ids_per );
-    * span = ids_per;
-    return i;
-}
-
-static
-void KColIdxBlockGet0 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    unsigned int idx, uint64_t *pg, uint32_t *sz )
-{
-    * pg = self -> pg . d [ idx ];
-    * sz = self -> pg . s [ idx ];
-}
-
-static
-void KColIdxBlockGet1 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    unsigned int idx, uint64_t *pg, uint32_t *sz )
-{
-    * pg = self -> pg . d [ idx ];
-    * sz = self -> pg . h . span [ 0 ];
-}
-
-static
-void KColIdxBlockGet2 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    unsigned int idx, uint64_t *pg, uint32_t *sz )
-{
-    if ( idx + 1 == count )
-    {
-        * pg = self -> pg . d [ idx ];
-        * sz = self -> pg . h . span [ 0 ];
-    }
-    else
-    {
-        * pg = self -> pg . d [ idx ];
-        * sz = ( uint32_t )
-            ( self -> pg . d [ idx + 1 ] - self -> pg . d [ idx ] );
-    }
-}
-
-static
-void KColIdxBlockGet3 ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    unsigned int idx, uint64_t *pg, uint32_t *sz )
-{
-    * sz = self -> pg . h . pred [ 0 ] . sz;
-    * pg = self -> pg . h . pred [ 0 ] . pg +
-        ( (uint64_t) self -> pg . h . pred [ 0 ] . sz * idx );
-}
-
-/* RewriteColumns
- *  convert btypeMagnitude columns to id/pg
- *  for best in-core representation
- */
-static
-void KColIdxBlockRewriteColumns ( KColIdxBlock *self, size_t size,
-    char *block, size_t block_size, int count,
-    int id_ssz, int id_adj, int pg_ssz, int pg_adj )
-{
-    int i;
-    uint64_t *d;
-    uint32_t last;
-
-    /* the blob size array is last */
-    if ( pg_adj != 0 )
-    {
-        assert ( pg_ssz != 0 );
-
-        d = ( uint64_t* ) ( block + size - pg_ssz - pg_adj );
-
-        /* save the last entry in size array */
-        last = self -> pg . s [ count - 1 ];
-
-        /* transfer sizes, shifted down by 1 slot */
-        for ( i = count; -- i > 0; )
-            d [ i ] = self -> pg . s [ i - 1 ];
-
-        /* set slot zero to be first pg */
-        d [ 0 ] = self -> pg . h . first [ 0 ];
-
-        /* integrate sizes */
-        for ( i = 1; i < count; ++ i )
-            d [ i ] += d [ i - 1 ];
-
-        /* store last size in header */
-        self -> pg . h . last [ 0 ] = last;
-
-        /* update columns */
-        self -> pg . d = d;
-        self -> pg . s = ( const uint32_t* ) d;
-
-        /* now convert to id/pg values */
-    }
-    else if ( pg_ssz != 0 )
-    {
-        /* pg size array trails column needing expansion */
-        uint32_t *s = ( uint32_t* ) ( block + size - pg_ssz );
-        for ( i = count; -- i >= 0; )
-            s [ i ] = self -> pg . s [ i ];
-        
-        self -> pg . d = ( const uint64_t* ) s;
-        self -> pg . s = s;
-    }
-
-    /* the index range array is either last
-       or next to last before size array
-       which, if there, was already moved */
-    if ( id_adj != 0 )
-    {
-        assert ( id_ssz != 0 );
-
-        d = ( uint64_t* ) ( block + size - pg_ssz - pg_adj - id_ssz - id_adj );
-
-        /* save last as above */
-        last = self -> id . s [ count - 1 ];
-
-        /* transfer shifted */
-        for ( i = count; -- i > 0; )
-            d [ i ] = self -> id . s [ i - 1 ];
-
-        /* set slot zero to first id */
-        d [ 0 ] = self -> id . h . first [ 0 ];
-
-        /* integrate spans */
-        for ( i = 1; i < count; ++ i )
-            d [ i ] += d [ i - 1 ];
-
-        /* store last span in header */
-        self -> id . h . last [ 0 ] = last;
-
-        /* update columns */
-        self -> id . d = d;
-        self -> id . s = ( const uint32_t* ) d;
-    }
-}
-
-/* Init
- */
-rc_t KColIdxBlockInit ( KColIdxBlock *self,
-    const KColBlockLoc *bloc, size_t orig,
-    const void *block, size_t block_size, bool bswap )
-{
-    int id_hsz, id_dsz, id_ssz, id_adj = 0;
-    int pg_hsz, pg_dsz, pg_ssz, pg_adj = 0;
-
-    int count = ( int ) orig;
-
-    switch ( bloc -> u . blk . id_type )
-    {
-    case btypeRandom:
-        self -> find = KColIdxBlockFind0;
-        id_hsz = 0;
-        id_dsz = 8;
-        id_ssz = 4;
-        break;
-    case btypeUniform:
-        self -> find = KColIdxBlockFind1;
-        id_hsz = 4;
-        id_dsz = 8;
-        id_ssz = 0;
-        break;
-    case btypeMagnitude:
-        self -> find = KColIdxBlockFind2;
-        id_hsz = 8;
-        id_dsz = 0;
-        id_ssz = 4;
-        id_adj = 4;
-        break;
-    case btypePredictable:
-    default: /* to quiet unused variable warnings */
-        self -> find = KColIdxBlockFind3;
-        id_hsz = 0;
-        id_dsz = 0;
-        id_ssz = 0;
-        break;
-    }
-
-    switch ( bloc -> u . blk . pg_type )
-    {
-    case btypeRandom:
-        self -> get = KColIdxBlockGet0;
-        pg_hsz = 0;
-        pg_dsz = 8;
-        pg_ssz = 4;
-
-        count -= id_hsz;
-        count /= id_dsz + id_ssz + 12;
-        break;
-
-    case btypeUniform:
-        self -> get = KColIdxBlockGet1;
-        pg_hsz = 4;
-        pg_dsz = 8;
-        pg_ssz = 0;
-
-        count -= id_hsz + 4;
-        count /= id_dsz + id_ssz + 8;
-        break;
-
-    case btypeMagnitude:
-        self -> get = KColIdxBlockGet2;
-        pg_hsz = 8;
-        pg_dsz = 0;
-        pg_ssz = 4;
-        pg_adj = 4;
-
-        count -= id_hsz + 8;
-        count /= id_dsz + id_ssz + 4;
-        break;
-
-    case btypePredictable:
-    default: /* to quiet unused variable warnings */
-        self -> get = KColIdxBlockGet3;
-        pg_hsz = 12;
-
-        if ( bloc -> u . blk . id_type == btypePredictable )
-        {
-            assert ( bloc -> u . blk . compressed == 0 );
-            count = ( int ) bloc -> u . blk . size;
-        }
-        else
-        {
-            assert ( id_dsz + id_ssz != 0 );
-
-            count -= id_hsz + pg_hsz;
-            count /= id_dsz + id_ssz;
-        }
-
-        pg_dsz = 0;
-        pg_ssz = 0;
-        break;
-    }
-
-    id_dsz *= count;
-    id_ssz *= count;
-    id_adj *= count;
-    pg_dsz *= count;
-    pg_ssz *= count;
-    pg_adj *= count;
-
-    /* TBD - check the optimized output on this...
-       some compilers aren't smart enough to recognize
-       that union members are not independent objects */
-    self -> id . h . p = block;
-    self -> pg . h . c = ( const char* ) block + id_hsz;
-/*  self -> pg . h . c = self -> id . h . c + id_hsz; */
-    self -> id . d = ( const uint64_t* )
-        ( self -> pg . h . c + pg_hsz );
-    self -> pg . d = ( const uint64_t* )
-        ( ( const char* ) self -> id . d + id_dsz );
-    self -> id . s = ( const uint32_t * )
-        ( ( const char* ) self -> pg . d + pg_dsz );
-    self -> pg . s = ( const uint32_t * )
-        ( ( const char* ) self -> id . s + id_ssz );
-
-    /* sanity check against block size */
-    if ( ( const char* ) block + orig != ( const char* ) self -> pg . s + pg_ssz )
-        return RC ( rcDB, rcIndex, rcReading, rcData, rcCorrupt );
-
-    /* byte-swap contents if needed */
-    if ( bswap )
-    {
-        KColConstBlockMapSwap ( & self -> id, count, bloc -> u . blk . id_type );
-        if ( self -> pg . h . p != self -> id . h . p )
-            KColConstBlockMapSwap ( & self -> pg, count, bloc -> u . blk . pg_type );
-    }
-
-    /* check for need to rewrite columns */
-    if ( id_adj + pg_adj != 0 )
-    {
-        size_t size = id_hsz + pg_hsz +
-            id_dsz + id_ssz + id_adj +
-            pg_dsz + pg_ssz + pg_adj;
-        
-        if ( size > block_size )
-            return RC ( rcDB, rcIndex, rcReading, rcBuffer, rcInsufficient );
-
-        assert ( id_adj == 0 || id_dsz == 0 );
-        assert ( pg_adj == 0 || pg_dsz == 0 );
-
-        KColIdxBlockRewriteColumns ( self, size,
-            ( char* ) block, block_size, count,
-            id_ssz, id_adj, pg_ssz, pg_adj );
-    }
-
-    return 0;
-}
-
-/* Find
- *  find zero-based index of entry into block
- *  that satisfies request
- *  returns -1 if not found
- */
-#ifndef KColIdxBlockFind
-LIB_EXPORT int CC KColIdxBlockFind ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    int64_t id, int64_t *first, uint32_t *span )
-{
-    ( * self -> find ) ( self, bloc, count, id, first, span );
-}
-#endif
-
-/* Get
- *  get blob location information
- */
-#ifndef KColIdxBlockGet
-LIB_EXPORT void CC KColIdxBlockGet ( const KColIdxBlock *self,
-    const KColBlockLoc *bloc, uint32_t count,
-    unsigned int idx, uint64_t *pg, uint32_t *sz )
-{
-    ( * self -> get ) ( self, bloc, count, idx, pg, sz );
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KColBlockLoc
- */
-
-/* EntryCount
- *  returns the number of entries within a block
- *  uses the original size of the uncompressed block
- */
-uint32_t KColBlockLocEntryCount ( const KColBlockLoc *self, size_t *orig )
-{
-    uint32_t count;
-
-    /* when everything is predictable, the
-       block size is 12 while the entry count
-       is contained in self -> size */
-    if ( self -> u . blk . id_type == btypePredictable &&
-         self -> u . blk . pg_type == btypePredictable )
-    {
-        count = self -> u . blk . size;
-        * orig = 12;
-    }
-    else
-    {
-        int id_hsz, id_dsz, id_ssz;
-        int pg_hsz, pg_dsz, pg_ssz;
-
-        count = ( uint32_t ) * orig;
-
-        switch ( self -> u . blk . id_type )
-        {
-        case btypeRandom:
-            id_hsz = 0;
-            id_dsz = 8;
-            id_ssz = 4;
-            break;
-        case btypeUniform:
-            id_hsz = 4;
-            id_dsz = 8;
-            id_ssz = 0;
-            break;
-        case btypeMagnitude:
-            id_hsz = 8;
-            id_dsz = 0;
-            id_ssz = 4;
-            break;
-        case btypePredictable:
-        default: /* to quiet unused variable warnings */
-            id_hsz = 0;
-            id_dsz = 0;
-            id_ssz = 0;
-            break;
-        }
-
-        switch ( self -> u . blk . pg_type )
-        {
-        case btypeRandom:
-            pg_hsz = 0;
-            pg_dsz = 8;
-            pg_ssz = 4;
-            break;
-        case btypeUniform:
-            pg_hsz = 4;
-            pg_dsz = 8;
-            pg_ssz = 0;
-            break;
-        case btypeMagnitude:
-            pg_hsz = 8;
-            pg_dsz = 0;
-            pg_ssz = 4;
-            break;
-        case btypePredictable:
-        default: /* to quiet unused variable warnings */
-            pg_hsz = 12;
-            pg_dsz = 0;
-            pg_ssz = 0;
-            break;
-        }
-
-        assert ( id_dsz + id_ssz + pg_dsz + pg_ssz != 0 );
-
-        /* decompose size into number of entries */
-        count -= id_hsz + pg_hsz;
-        count /= id_dsz + id_ssz + pg_dsz + pg_ssz;
-    }
-
-    return count;
-}
-
-/* AllocSize
- *  returns a size for the block
- *  since a type 3 index ( range/size only ) is nice for storage
- *  but needs to be converted to id/pos for in-memory lookup
- */
-size_t KColBlockLocAllocSize ( const KColBlockLoc *self,
-    size_t orig, uint32_t count )
-{
-    size_t size;
-
-    /* when everything is predictable, the
-       pg information is stored within BlocLoc */
-    if ( self -> u . blk . id_type == btypePredictable &&
-         self -> u . blk . pg_type == btypePredictable )
-        size = 12;
-    else
-    {
-        /* there is something within the idx2 block */
-        size = 0;
-
-        /* if either index or page loc are magnitude only,
-           they'll need to be converted to id/pg when resident */
-        if ( self -> u . blk . id_type == btypeMagnitude )
-            size += 4;
-        if ( self -> u . blk . pg_type == btypeMagnitude )
-            size += 4;
-
-        /* if neither are magnitude only,
-           keep the original size */
-        if ( size == 0 )
-            size = orig;
-        else
-        {
-            /* otherwise, convert the single entry
-               size adjustment to whole block adjustment */
-            size *= count;
-
-            /* add this to the original size */
-            size += orig;
-        }
-    }
-
-    return size;
-}
diff --git a/libs/kdb/index-cmn.h b/libs/kdb/index-cmn.h
deleted file mode 100644
index ff2dc6f..0000000
--- a/libs/kdb/index-cmn.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_index_cmn_
-#define _h_index_cmn_
-
-#ifndef _h_kdbfmt_priv_
-#include "kdbfmt-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define KDBINDEXVERS 4
-#define V2FIND_RETURNS_SPAN 1
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMMap;
-struct PTrie;
-struct BSTNode;
-struct PBSTNode;
-struct KIndex;
-
-
-
-/*--------------------------------------------------------------------------
- * KIndexFileHeader
- */
-
-/* v1, v2
- *  just normal simple kdb header
- */
-typedef struct KDBHdr KIndexFileHeader_v1, KIndexFileHeader_v2, KIndexFileHeader_v1_v2;
-
-/* v3, v4
- *  indicates type
- */
-typedef struct KIndexFileHeader_v3 KIndexFileHeader_v3, KIndexFileHeader_v4, KIndexFileHeader_v3_v4;
-struct KIndexFileHeader_v3
-{
-    KIndexFileHeader_v1_v2 h;
-    uint32_t index_type;
-    uint32_t reserved1;
-};
-
-
-/*--------------------------------------------------------------------------
- * V1
- *  version 1 of the trie index was hard-coded to enforce uniqueness of
- *  both the string, and a 32-bit id. furthermore, the id was unfortunately
- *  assumed to occupy a mostly contiguous space, such that the projection
- *  was always implemented as an array of ptrie node ids where the id was
- *  used to index the array.
- *
- *  the introduction of highly sparse ids led to deprecation of this
- *  implementation. see version 2 for further information.
- */
-
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v1
- *  persisted keymap
- */
-typedef struct KPTrieIndex_v1 KPTrieIndex_v1;
-struct KPTrieIndex_v1
-{
-    struct KMMap const *mm;
-    struct PTrie *key2id;
-    const uint32_t *id2node;
-    uint32_t first;
-    uint32_t last;
-    bool byteswap;
-};
-
-/* initialize an index from file */
-rc_t KPTrieIndexInit_v1 ( KPTrieIndex_v1 *self, struct KMMap const *mm, bool byteswap );
-
-/* whackitywhack */
-void KPTrieIndexWhack_v1 ( KPTrieIndex_v1 *self );
-
-/* consistency check */
-rc_t KPTrieIndexCheckConsistency_v1 ( const KPTrieIndex_v1 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key );
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v1
- */
-typedef struct KTrieIndex_v1 KTrieIndex_v1;
-
-/* initialize an index from file - can be NULL */
-rc_t KTrieIndexOpen_v1 ( KTrieIndex_v1 *self, struct KMMap const *mm, bool byteswap );
-
-/* whack whack */
-void KTrieIndexWhack_v1 ( KTrieIndex_v1 *self );
-
-/* map key to id ( was Key2Id ) */
-rc_t KTrieIndexFind_v1 ( const KTrieIndex_v1 *self,
-    const char *key, uint32_t *id,
-    int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
-    void *data );
-
-/* projection index id to key-string ( was Id2Key ) */
-rc_t KTrieIndexProject_v1 ( const KTrieIndex_v1 *self,
-    uint32_t id, char *key_buff, size_t buff_size, size_t *actsize );
-
-/* consistency check */
-rc_t KTrieIndexCheckConsistency_v1 ( const KTrieIndex_v1 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key );
-
-
-/*--------------------------------------------------------------------------
- * V2
- *  version 2 of the trie index was introduced to handle sparse ids,
- *  and to recognize that ids may be 64 bits and/or negative.
- *
- *  v2 introduces strategy identifiers to handle various cases.
- *
- *  CONSTRAINTS
- *  - both key and id are unique ( version 1 )
- *  - key is not unique, but must map to a contiguous range of ids,
- *    while ids are unique ( the main use case for SRA )
- *
- *  INSERTION
- *  - ids are observed in increasing order
- *
- *  PROJECTION
- *  - id range is contiguous or nearly so ( can use single array )
- *  - id range is sparse
- *
- *  the implementation may be extended by adding new strategies,
- *  but the moment the implementation supports 1 to many mappings,
- *  inserted with ids in increasing order, and an unique constraint
- *  on the ids themselves.
- *
- *  the general case for v2 is "key -> id range", where "id range -> key"
- *  is via contiguous array if avg ( id range ) <= 2, and via sparse
- *  array otherwise.
- *
- *  for the key -> id mappings, this means that the in-core node
- *  either retains an id range ( when not using a projection index ),
- *  or it retains a start-id only, since its range can be determined
- *  from the projection index.
- *
- *  for id -> key mappings, the id is first converted to an ordinal, and
- *  the ordinal to a node. when ids are contiguous, id -> ordinal is simply
- *  derived by subtracting the initial start id. when sparse, an id -> ord
- *  array is used in a binary search to produce the ordinal.
- *
- *  ids are assumed to be 64 bit, stored as id - start id, and packed to
- *  a minimum number of bits to represent the id. ptrie node ids are still
- *  32-bit entities.
- */
-
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v2
- *  persisted keymap
- */
-typedef struct KPTrieIndex_v2 KPTrieIndex_v2;
-struct KPTrieIndex_v2
-{
-    int64_t first, last, maxid;
-    struct KMMap const *mm;
-    struct PTrie *key2id;
-    const uint32_t *ord2node;
-    union
-    {
-        const uint8_t *v8;
-        const uint16_t *v16;
-        const uint32_t *v32;
-        const int64_t *v64;
-    } id2ord;
-    uint32_t count;
-    uint8_t variant;
-    uint8_t id_bits;
-    uint8_t span_bits;
-    uint8_t byteswap;
-};
-
-
-/* initialize an index from file */
-rc_t KPTrieIndexInit_v2 ( KPTrieIndex_v2 *self, struct KMMap const *mm, bool byteswap );
-rc_t KPTrieIndexInit_v3_v4 ( KPTrieIndex_v2 *self, struct KMMap const *mm, bool byteswap, bool ptorig );
-
-/* whackitywhack */
-void KPTrieIndexWhack_v2 ( KPTrieIndex_v2 *self );
-
-/* map a row id to ord */
-uint32_t KPTrieIndexID2Ord_v2 ( const KPTrieIndex_v2 *self, int64_t id );
-
-/* consistency check */
-rc_t KPTrieIndexCheckConsistency_v2 ( const KPTrieIndex_v2 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key, bool all_ids, bool convertFromV1 );
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v2
- */
-typedef struct KTrieIndex_v2 KTrieIndex_v2;
-
-/* initialize an index from file */
-rc_t KTrieIndexOpen_v2 ( KTrieIndex_v2 *self, struct KMMap const *mm, bool byteswap );
-
-/* whack whack */
-void KTrieIndexWhack_v2 ( KTrieIndex_v2 *self );
-
-/* map key to id range */
-rc_t KTrieIndexFind_v2 ( const KTrieIndex_v2 *self,
-    const char *key, int64_t *start_id,
-#if V2FIND_RETURNS_SPAN
-    uint32_t *span,
-#endif
-    int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
-    void * data,
-    bool convertFromV1);
-
-/* projection index id to key-string */
-#if V2FIND_RETURNS_SPAN
-rc_t KTrieIndexProject_v2 ( const KTrieIndex_v2 *self,
-    int64_t id, int64_t *start_id, uint32_t *span,
-    char *key_buff, size_t buff_size, size_t *actsize );
-#else
-rc_t KTrieIndexProject_v2 ( const KTrieIndex_v2 *self,
-    int64_t id, char *key_buff, size_t buff_size, size_t *actsize );
-#endif
-
-/* consistency check */
-rc_t KTrieIndexCheckConsistency_v2 ( const KTrieIndex_v2 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key, bool all_ids, bool convertFromV1 );
-
-
-/*--------------------------------------------------------------------------
- * KU64Index_v3
- */
-typedef struct KU64Index_v3 KU64Index_v3;
-
-rc_t KU64IndexOpen_v3 ( KU64Index_v3 *self, struct KMMap const *mm, bool byteswap );
-rc_t KU64IndexWhack_v3 ( KU64Index_v3 *self );
-
-rc_t KU64IndexFind_v3 ( const KU64Index_v3 *self, uint64_t offset,
-    uint64_t *key, uint64_t *key_size, int64_t *id, uint64_t *id_qty );
-
-rc_t KU64IndexFindAll_v3 ( const KU64Index_v3 *self, uint64_t offset, 
-    rc_t ( CC * f ) ( uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data ),
-    void* data );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_index_priv_ */
diff --git a/libs/kdb/index-priv.h b/libs/kdb/index-priv.h
deleted file mode 100644
index 41e2505..0000000
--- a/libs/kdb/index-priv.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_index_priv_
-#define _h_index_priv_
-
-#ifndef _h_index_cmn_
-#include "index-cmn.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMMap;
-struct PBSTree;
-
-
-/*--------------------------------------------------------------------------
- * V1
- *  version 1 of the trie index was hard-coded to enforce uniqueness of
- *  both the string, and a 32-bit id. furthermore, the id was unfortunately
- *  assumed to occupy a mostly contiguous space, such that the projection
- *  was always implemented as an array of ptrie node ids where the id was
- *  used to index the array.
- *
- *  the introduction of highly sparse ids led to deprecation of this
- *  implementation. see version 2 for further information.
- */
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v1
- */
-struct KTrieIndex_v1
-{
-    KPTrieIndex_v1 pt;
-};
-
-
-/*--------------------------------------------------------------------------
- * V2
- *  version 2 of the trie index was introduced to handle sparse ids,
- *  and to recognize that ids may be 64 bits and/or negative.
- *
- *  v2 introduces strategy identifiers to handle various cases.
- *
- *  CONSTRAINTS
- *  - both key and id are unique ( version 1 )
- *  - key is not unique, but must map to a contiguous range of ids,
- *    while ids are unique ( the main use case for SRA )
- *
- *  INSERTION
- *  - ids are observed in increasing order
- *
- *  PROJECTION
- *  - id range is contiguous or nearly so ( can use single array )
- *  - id range is sparse
- *
- *  the implementation may be extended by adding new strategies,
- *  but the moment the implementation supports 1 to many mappings,
- *  inserted with ids in increasing order, and an unique constraint
- *  on the ids themselves.
- *
- *  the general case for v2 is "key -> id range", where "id range -> key"
- *  is via contiguous array if avg ( id range ) <= 2, and via sparse
- *  array otherwise.
- *
- *  for the key -> id mappings, this means that the in-core node
- *  either retains an id range ( when not using a projection index ),
- *  or it retains a start-id only, since its range can be determined
- *  from the projection index.
- *
- *  for id -> key mappings, the id is first converted to an ordinal, and
- *  the ordinal to a node. when ids are contiguous, id -> ordinal is simply
- *  derived by subtracting the initial start id. when sparse, an id -> ord
- *  array is used in a binary search to produce the ordinal.
- *
- *  ids are assumed to be 64 bit, stored as id - start id, and packed to
- *  a minimum number of bits to represent the id. ptrie node ids are still
- *  32-bit entities.
- */
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v2
- */
-struct KTrieIndex_v2
-{
-    KPTrieIndex_v2 pt;
-};
-
-
-/*--------------------------------------------------------------------------
- * KU64Index_v3
- */
-struct KU64Index_v3
-{
-    struct PBSTree *tree;
-    struct KMMap const *mm;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_index_priv_ */
diff --git a/libs/kdb/index.c b/libs/kdb/index.c
deleted file mode 100644
index b4cd1f6..0000000
--- a/libs/kdb/index.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#define KONST const
-#include "index-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "table-priv.h"
-#include "kdb-priv.h"
-#undef KONST
-
-#include <kdb/index.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <byteswap.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * KIndex
- *  an object capable of mapping an object to integer oid
- */
-struct KIndex
-{
-    const KDBManager *mgr;
-    const KDatabase *db;
-    const KTable *tbl;
-    KRefcount refcount;
-    uint32_t vers;
-    union
-    {
-        KTrieIndex_v1 txt1;
-        KTrieIndex_v2 txt234;
-        KU64Index_v3  u64_3;
-    } u;
-    bool converted_from_v1;
-    uint8_t type;
-    char path [ 1 ];
-};
-
-
-/* Whack
- */
-static
-rc_t KIndexWhack ( KIndex *self )
-{
-    rc_t rc = 0;
-
-    KRefcountWhack ( & self -> refcount, "KIndex" );
-
-    /* release owner */
-    if ( self -> db != NULL )
-    {
-        rc = KDatabaseSever ( self -> db );
-        if ( rc == 0 )
-            self -> db = NULL;
-    }
-    else if ( self -> tbl != NULL )
-    {
-        rc = KTableSever ( self -> tbl );
-        if ( rc == 0 )
-            self -> tbl = NULL;
-    }
-
-    /* remove from mgr */
-    if ( rc == 0 )
-        rc = KDBManagerSever ( self -> mgr );
-    if ( rc == 0 )
-    {
-        self -> mgr = NULL;
-
-        /* complete */
-        rc = SILENT_RC ( rcDB, rcIndex, rcDestroying, rcIndex, rcBadVersion );
-
-        switch ( self -> type )
-        {
-        case kitText:
-        case kitText | kitProj:
-            switch ( self -> vers )
-            {
-            case 1:
-                KTrieIndexWhack_v1 ( & self -> u . txt1 );
-                rc = 0;
-                break;
-            case 2:
-            case 3:
-            case 4:
-                KTrieIndexWhack_v2 ( & self -> u . txt234 );
-                rc = 0;
-                break;
-            }
-            break;
-
-        case kitU64:
-            switch ( self -> vers )
-            {
-            case 3:
-            case 4:
-                rc = KU64IndexWhack_v3 ( & self -> u . u64_3 );
-                break;
-            }
-            break;
-
-        }
-
-        if ( rc == 0 )
-        {
-            free ( self );
-            return 0;
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KIndex", "whack", "kidx" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KIndexAddRef ( const KIndex *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KIndex" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcIndex, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KIndexRelease ( const KIndex *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KIndex" ) )
-        {
-        case krefWhack:
-            return KIndexWhack ( ( KIndex* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcIndex, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KIndexMake ( KIndex **idxp, const char *path )
-{
-    rc_t rc;
-
-    if ( idxp == NULL )
-        rc = RC ( rcDB, rcIndex, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( path == NULL )
-            rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcEmpty );
-        else
-        {
-            KIndex* idx = malloc ( sizeof *idx + strlen ( path ) );
-            if ( idx == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                memset ( idx, 0, sizeof * idx );
-                KRefcountInit ( & idx -> refcount, 1, "KIndex", "make", path );
-                strcpy ( idx -> path, path );
-                * idxp = idx;
-                return 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t KIndexAttach ( KIndex *self, const KMMap *mm, bool *byteswap )
-{
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const void *addr;
-        rc = KMMapAddrRead ( mm, & addr );
-        if ( rc == 0 )
-        {
-            union
-            {
-                KIndexFileHeader_v1 v1;
-                KIndexFileHeader_v2 v2;
-                KIndexFileHeader_v3 v3;
-            } hdrs;
-
-            const KDBHdr *hdr = addr;
-            const KIndexFileHeader_v3 *fh = addr;
-
-            * byteswap = false;
-            rc = KDBHdrValidate ( hdr, size, 1, KDBINDEXVERS );
-            if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-            {
-                hdrs . v1 . endian = bswap_32 ( hdr -> endian );
-                hdrs . v1 . version = bswap_32 ( hdr -> version );
-                rc = KDBHdrValidate ( & hdrs . v1, size, 1, KDBINDEXVERS );
-                if ( rc == 0 )
-                {
-                    * byteswap = true;
-                    switch ( hdrs . v1 . version )
-                    {
-                    case 1:
-                        hdr = & hdrs . v1;
-                        break;
-                    case 2:
-                        hdr = & hdrs . v2;
-                        break;
-                    case 3:
-                    case 4:
-                        hdrs . v3 . index_type = bswap_32 ( fh -> index_type );
-                        hdrs . v3 . reserved1 = bswap_32 ( fh -> reserved1 );
-                        hdr = & hdrs . v3 . h;
-                        fh = & hdrs . v3;
-                        break;
-                    }
-                }
-            }
-            if ( rc == 0 )
-            {
-                self -> vers = hdr -> version;
-                switch ( hdr -> version )
-                {
-                case 1:
-#if KDBINDEXVERS != 1
-                    self -> converted_from_v1 = true;
-#endif
-                case 2:
-                    self -> type = kitText;
-                    break;
-                case 3:
-                case 4:
-                {
-                    self -> type = fh -> index_type;
-                    switch ( self -> type )
-                    {
-                    case kitText:
-                    case kitU64:
-                        break;
-                    default:
-                        rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcUnrecognized);
-                    }
-                    break;
-                }
-                default:
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t KIndexMakeRead ( KIndex **idxp,
-    const KDirectory *dir, const char *path )
-{
-    const KFile *f;
-    rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
-    if ( rc == 0 )
-    {
-        const KMMap *mm;
-        rc = KMMapMakeRead ( & mm, f );
-        if ( rc == 0 )
-        {
-            rc = KIndexMake ( idxp, path );
-            if ( rc == 0 )
-            {
-                bool byteswap;
-                KIndex *idx = * idxp;
-                rc = KIndexAttach ( idx, mm, & byteswap );
-                if ( rc == 0 )
-                {
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
-
-                    switch ( idx -> vers )
-                    {
-                    case 1:
-                        /* open using v1 code only if KDBINDEXVERS is 1
-                           if 2 or later, open as a v2 index */
-#if KDBINDEXVERS == 1
-                        rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, mm );
-                        if ( rc == 0 )
-                        {
-                            if ( idx -> u . txt1 . pt . id2node != NULL )
-                                idx -> type = ( uint8_t ) ( kitText | kitProj );
-                            else
-                                idx -> type = ( uint8_t ) kitText;
-                        }
-                        break;
-#else
-                    case 2:
-                        idx -> vers = 3;
-                    case 3:
-                    case 4:
-                        switch ( idx -> type )
-                        {
-                            case kitText:
-                            case kitText | kitProj:
-                                /* will guess version in open */
-                                rc = KTrieIndexOpen_v2 ( & idx -> u . txt234, mm, byteswap );
-                                if( rc == 0 && idx -> u . txt234 . pt . ord2node != NULL )
-                                    idx -> type |= kitProj;
-                                break;
-
-                            case kitU64:
-                                rc = KU64IndexOpen_v3 ( & idx -> u . u64_3, mm, byteswap );
-                                break;
-                        }
-                        break;
-#endif
-                    }
-                }
-
-                if ( rc != 0 )
-                    KIndexWhack ( idx );
-            }
-
-            KMMapRelease ( mm );
-        }
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-
-/* OpenIndexRead
- * VOpenIndexRead
- *  open an index for read
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-static
-rc_t KDBManagerOpenIndexReadInt ( const KDBManager *self,
-    KIndex **idxp, const KDirectory *wd, const char *path )
-{
-    char idxpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        idxpath, sizeof idxpath, path, NULL );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-
-        switch ( KDirectoryVPathType ( wd, idxpath, NULL ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcIndex, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        }
-
-        rc = KIndexMakeRead ( & idx, wd, idxpath );
-        if ( rc == 0 )
-        {
-            idx -> mgr = KDBManagerAttach ( self );
-            * idxp = idx;
-            return 0;
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenIndexRead ( struct KDatabase const *self,
-    const KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenIndexRead ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenIndexRead ( const KDatabase *self,
-    const KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "idx", 3, name, args );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        rc = KDBManagerOpenIndexReadInt ( self -> mgr,
-            & idx, self -> dir, path );
-        if ( rc == 0 )
-        {
-            idx -> db = KDatabaseAttach ( self );
-            * idxp = idx;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenIndexRead ( struct KTable const *self,
-    const KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVOpenIndexRead ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenIndexRead ( const KTable *self,
-    const KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    if ( self -> prerelease )
-    {
-        int len;
-        if ( args == 0 )
-            len = snprintf ( path, sizeof path, name );
-        else
-            len = vsnprintf ( path, sizeof path, name, args );
-        if ( len < 0 || ( size_t ) len >= sizeof path )
-            return RC ( rcDB, rcTable, rcOpening, rcPath, rcExcessive );
-        rc = 0;
-    }
-    else
-    {
-        rc = KDBVMakeSubPath ( self -> dir,
-            path, sizeof path, "idx", 3, name, args );
-    }
-
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        rc = KDBManagerOpenIndexReadInt ( self -> mgr,
-            & idx, self -> dir, path );
-        if ( rc == 0 )
-        {
-            idx -> tbl = KTableAttach ( self );
-            * idxp = idx;
-        }
-    }
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KIndexLocked ( const KIndex *self )
-{
-    rc_t rc;
-    const KDirectory *dir;
-
-    if ( self == NULL )
-        return false;
-
-    assert ( self -> db != NULL || self -> tbl != NULL );
-    dir = ( self -> db != NULL ) ?
-        self -> db -> dir : self -> tbl -> dir;
-
-    rc = KDBWritable ( dir, self -> path );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-
-/* Version
- *  returns the format version
- */
-LIB_EXPORT rc_t CC KIndexVersion ( const KIndex *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * version = 0;
-        return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
-    }
-    
-    * version = self -> vers;
-    return 0;
-}
-
-
-/* Type
- *  returns the type of index
- */
-LIB_EXPORT rc_t CC KIndexType ( const KIndex *self, KIdxType *type )
-{
-    if ( type == NULL )
-        return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * type = ( KIdxType ) 0;
-        return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
-    }
-
-    * type = ( KIdxType ) self -> type;
-    return 0;
-}
-
-
-/* CheckConsistency
- *  run a consistency check on the open index
- *
- *  "level" [ IN ] - a measure of rigor of the exercise:
- *    0 is the lightest
- *    1 will test all id mappings
- *    2 will perform key->id retrievals
- *    3 will perform id->key retrievals if a projection index exists
- *
- *  "start_id" [ OUT, NULL OKAY ] - returns the first id in index
- *
- *  "id_range" [ OUT, NULL OKAY ] - returns the range of ids from first to last
- *
- *  "num_keys" [ OUT, NULL OKAY ] - returns the number of key entries
- *
- *  "num_rows" [ OUT, NULL OKAY ] - returns the number of key->id mappings
- *
- *  "num_holes" [ OUT, NULL OKAY ] - returns the number of holes in the mapped id range
- */
-LIB_EXPORT rc_t CC KIndexConsistencyCheck ( const KIndex *self, uint32_t level,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcDB, rcIndex, rcValidating, rcSelf, rcNull );
-    else
-    {
-        bool key2id, id2key, all_ids;
-        switch ( level )
-        {
-        case 0:
-            key2id = id2key = all_ids = false;
-            break;
-        case 1:
-            key2id = id2key = false;
-            all_ids = true;
-            break;
-        case 2:
-            key2id = id2key = true;
-            all_ids = false;
-            break;
-        default:
-            key2id = id2key = all_ids = true;
-        }
-
-        switch ( self -> type )
-        {
-        case kitText:
-            id2key = false;
-        case kitText | kitProj:
-            switch ( self -> vers )
-            {
-            case 1:
-                rc = KTrieIndexCheckConsistency_v1 ( & self -> u . txt1,
-                    start_id, id_range, num_keys, num_rows, num_holes,
-                    self, key2id, id2key );
-                break;
-            case 2:
-            case 3:
-            case 4:
-                rc = KTrieIndexCheckConsistency_v2 ( & self -> u . txt234,
-                    start_id, id_range, num_keys, num_rows, num_holes,
-                    self, key2id, id2key, all_ids, self -> converted_from_v1 );
-                break;
-            default:
-                return RC ( rcDB, rcIndex, rcValidating, rcIndex, rcBadVersion );
-            }
-            break;
-
-        default:
-            rc = RC ( rcDB, rcIndex, rcValidating, rcFunction, rcUnsupported );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Find
- *  finds a single mapping from key
- */
-LIB_EXPORT rc_t CC KIndexFindText ( const KIndex *self, const char *key, int64_t *start_id, uint64_t *id_count,
-    int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
-    void *data )
-{
-    rc_t rc = 0;
-    uint32_t id32, span;
-
-    if ( id_count != NULL )
-        * id_count = 0;
-
-    if ( start_id == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcParam, rcNull );
-
-    * start_id = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
-
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
-    if ( key [ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, custom_cmp, data );
-            if ( rc == 0 )
-                * start_id = id32;
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, & span, custom_cmp, data, self -> converted_from_v1 );
-#else
-            rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, custom_cmp, data, self -> converted_from_v1 );
-#endif
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
-    }
-
-    if ( id_count != NULL )
-        * id_count = span;
-    
-    return rc;
-}
-
-
-/* FindAll
- *  finds all mappings from key
- */
-LIB_EXPORT rc_t CC KIndexFindAllText ( const KIndex *self, const char *key,
-    rc_t ( CC * f ) ( int64_t id, uint64_t id_count, void *data ), void *data )
-{
-    rc_t rc = 0;
-    int64_t id64;
-    uint32_t id32, span;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
-
-    if ( f == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcFunction, rcNull );
-
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
-    if ( key [ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, NULL, NULL );
-            if ( rc == 0 )
-                rc = ( * f ) ( id32, 1, data );
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, & span, NULL, NULL, self -> converted_from_v1 );
-#else
-            rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, NULL, NULL, self -> converted_from_v1 );
-#endif
-            if ( rc == 0 )
-                rc = ( * f ) ( id64, span, data );
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
-    }
-    
-    return rc;
-}
-
-
-/* Project
- *  finds key(s) mapping to value/id if supported
- */
-LIB_EXPORT rc_t CC KIndexProjectText ( const KIndex *self,
-    int64_t id, int64_t *start_id, uint64_t *id_count,
-    char *key, size_t kmax, size_t *actsize )
-{
-    rc_t rc = 0;
-    int64_t dummy;
-    uint32_t span;
-
-    if ( start_id == NULL )
-        start_id = & dummy;
-
-    * start_id = 0;
-
-    if ( id_count != NULL )
-        * id_count = 0;
-
-    if ( key == NULL && kmax != 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
-
-    if ( kmax != 0 )
-        key [ 0 ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
-
-    if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
-
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            /* there is a limit on ids in v1 */
-            if ( id <= 0 || ( id >> 32 ) != 0 )
-                return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-
-            rc = KTrieIndexProject_v1 ( & self -> u . txt1,
-                ( uint32_t ) id, key, kmax, actsize );
-            if ( rc == 0 )
-                * start_id = id;
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, start_id, & span, key, kmax, actsize );
-#else
-            rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, key, kmax, actsize );
-            if ( rc == 0 )
-                * start_id = id;
-#endif
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
-    }
-
-    if ( id_count != NULL )
-        * id_count = span;
-    
-    return rc;
-}
-
-
-/* ProjectAll
- *  finds key(s) mapping to value/id if supported
- */
-LIB_EXPORT rc_t CC KIndexProjectAllText ( const KIndex *self, int64_t id,
-    rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, const char *key, void *data ),
-    void *data )
-{
-    rc_t rc = 0;
-    char key [ 256 ];
-
-    uint32_t span;
-    int64_t start_id;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
-
-    if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
-
-    if ( f == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcNull );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            /* there is a limit on ids in v1 */
-            if ( id <= 0 || ( id >> 32 ) != 0 )
-                return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-
-            rc = KTrieIndexProject_v1 ( & self -> u . txt1,
-                ( uint32_t ) id, key, sizeof key, NULL );
-            if ( rc == 0 )
-                rc = ( * f ) ( id, 1, key, data );
-            break;
-
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, & start_id, & span, key, sizeof key, NULL );
-#else
-            rc = KTrieIndexProject_v2 ( & self -> u . txt234, start_id = id, key, sizeof key );
-#endif
-            if ( rc == 0 )
-                rc = ( * f ) ( start_id, span, key, data );
-            break;
-            
-        default:
-            return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexFindU64( const KIndex* self, uint64_t offset, uint64_t* key, uint64_t* key_size, int64_t* id, uint64_t* id_qty )
-{
-    rc_t rc = 0;
-
-    if( key == NULL || key_size == NULL || id == NULL || id_qty == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcParam, rcNull);
-    }
-    *key = *key_size = *id = *id_qty = 0;
-    if( self == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
-    }
-
-    switch( self->type )
-    {
-    case kitU64:
-        switch( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexFind_v3(&self->u.u64_3, offset, key, key_size, id, id_qty);
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
-        }
-        break;
-    default:
-        return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexFindAllU64( const KIndex* self, uint64_t offset,
-    rc_t ( CC * f )(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data ), void* data)
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
-    if ( f == NULL )
-        return RC(rcDB, rcIndex, rcSelecting, rcFunction, rcNull);
-
-    switch ( self->type )
-    {
-    case kitU64:
-        switch ( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexFindAll_v3(&self->u.u64_3, offset, f, data);
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
-        }
-        break;
-    default:
-        return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
-    }
-
-    return rc;
-}
-
-
-/* SetMaxId
- *  certain legacy versions of skey were built to know only the starting id
- *  of the NAME_FMT column, but were never given a maximum id. allow them
- *  to be corrected here.
- */
-LIB_EXPORT void CC KIndexSetMaxRowId ( const KIndex *cself, int64_t max_row_id )
-{
-    if ( cself != NULL ) switch ( cself -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( cself -> vers )
-        {
-        case 2:
-        case 3:
-        case 4:
-            /* here we can repair the max row id */
-            if ( cself -> u . txt234 . pt . maxid < max_row_id )
-                ( ( KIndex* ) cself ) -> u . txt234 . pt . maxid = max_row_id;
-            break;
-        }
-        break;
-    }
-}
diff --git a/libs/kdb/kdb-priv.h b/libs/kdb/kdb-priv.h
deleted file mode 100644
index f9440f1..0000000
--- a/libs/kdb/kdb-priv.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_priv_
-#define _h_kdb_priv_
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KDirectory;
-struct KDBManager;
-
-/*
- * This symbol is inserted where the KDB is being tweaked to allow
- * VFS URI syntax in opening KDB database objects initially to support
- * krypto passwords more fully.  By specifying the password source
- * individually for opens two KDB objects with different passwords can be opened.
- */
-#define SUPPORT_VFS_URI 1
-
-/*--------------------------------------------------------------------------
- * KDB utility
- */
-
-
-/* PathType
- *  checks type of path
- */
-int KDBPathTypeDir ( const struct KDirectory *dir, int type,bool *zombies, const char *path );
-int KDBPathType ( const struct KDirectory *dir, bool *zombies, const char *path );
-
-/* OpenPathType
- * Opens a path if it is of the specified type.  Even if it is an archive file
- * instead of a directory.
- *
- * if dpdir is NULL it will not return with an open Directory but it will have
- * checked that the type requested is the type present even if in an archive.
- *
- * if realpathtype is not NULL the found type will be returned regardless
- * of a match to request path type.
- *
- * the return will be zero only if the path does point to a directory or
- * archive that is of the requested type.  An archive will have been opened
- * but reshut if dpdir is NULL.
- */ 
-rc_t KDBOpenPathTypeRead ( const struct KDBManager * mgr, const struct KDirectory * dir, const char * path, 
-    const struct KDirectory ** dpdir, int pathtype, int * realpathtype, bool try_srapath );
-
-/* Writable
- *  examines a directory structure for any "lock" files
- *  examines a file for ( any ) write permission
- */
-rc_t KDBWritable ( const struct KDirectory *dir, const char *path );
-
-/* GetObjModDate
- *  extract mod date from a path
- */
-rc_t KDBGetObjModDate ( const struct KDirectory *dir, KTime_t *mtime );
-
-/* GetPathModDate
- *  extract mod date from a path
- */
-rc_t KDBVGetPathModDate ( const struct KDirectory *dir,
-    KTime_t *mtime, const char *path, va_list args );
-
-/* KDBMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, ... );
-/* VMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBVMakeSubPath ( const struct KDirectory *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, va_list args );
-
-
-/* KDBIsPathUri
- * A hack to get some of VFS into KDB that is too tightly bound to KFS
- */
-bool KDBIsPathUri (const char * path);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_priv_ */
diff --git a/libs/kdb/kdb.c b/libs/kdb/kdb.c
deleted file mode 100644
index 8a799c7..0000000
--- a/libs/kdb/kdb.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "kdb-priv.h"
-#include "kdbfmt-priv.h"
-#include "dbmgr-priv.h"
-
-#include <krypto/key.h>
-#include <krypto/encfile.h>
-#include <krypto/wgaencrypt.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/resolver.h>
-#include <vfs/manager-priv.h>
-#include <sra/srapath.h>
-
-#include <kfs/kfs-priv.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/arc.h>
-#include <kfs/tar.h>
-#include <kfs/sra.h>
-#include <kfs/kfs-priv.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <va_copy.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <errno.h>
-
-#ifndef SUPPORT_VFS_URI
-#define SUPPORT_VFS_URI 0
-#endif
-
-/*--------------------------------------------------------------------------
- * KDB utility
- */
-
-/* KDBHdrValidate
- *  validates that a header sports a supported byte order
- *  and that the version is within range
- */
-/* this is included to make kdb.c vs. wkdb.c file comparisons easier in [x]emacs.*/
-#if NOT_USED_IN_READ_ONLY_SIDE
-rc_t KDBHdrValidate ( const KDBHdr *hdr, size_t size,
-    uint32_t min_vers, uint32_t max_vers )
-{
-    assert ( hdr != NULL );
-
-    if ( size < sizeof * hdr )
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-
-    if ( hdr -> endian != eByteOrderTag )
-    {
-        if ( hdr -> endian == eByteOrderReverse )
-            return RC ( rcDB, rcHeader, rcValidating, rcByteOrder, rcIncorrect );
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-    }
-
-    if ( hdr -> version < min_vers || hdr -> version > max_vers )
-        return RC ( rcDB, rcHeader, rcValidating, rcHeader, rcBadVersion );
-
-    return 0;
-}
-#endif
-
-/* KDBPathType
- *  checks type of path
- */
-enum ScanBits
-{
-    scan_db     = ( 1 <<  0 ),
-    scan_tbl    = ( 1 <<  1 ),
-    scan_idx    = ( 1 <<  2 ),
-    scan_col    = ( 1 <<  3 ),
-    scan_idxN   = ( 1 <<  4 ),
-    scan_data   = ( 1 <<  5 ),
-    scan_dataN  = ( 1 <<  6 ),
-    scan_md     = ( 1 <<  7 ),
-    scan_cur    = ( 1 <<  8 ),
-    scan_rNNN   = ( 1 <<  9 ),
-    scan_lock   = ( 1 << 10 ),
-    scan_odir   = ( 1 << 11 ),
-    scan_ofile  = ( 1 << 12 ),
-    scan_meta   = ( 1 << 13 ),
-    scan_skey   = ( 1 << 14 ),
-    scan_sealed = ( 1 << 15 ),
-    scan_zombie = ( 1 << 16 )
-};
-
-static
-rc_t CC scan_dbdir ( const KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    uint32_t *bits = data;
-
-    type &= kptAlias - 1;
-
-    if ( type == kptDir )
-    {
-        switch ( name [ 0 ] )
-        {
-        case 'c':
-            if ( strcmp ( name, "col" ) == 0 )
-            { * bits |= scan_col; return 0; }
-            break;
-        case 'm':
-            if ( strcmp ( name, "md" ) == 0 )
-            { * bits |= scan_md; return 0; }
-            break;
-        case 't':
-            if ( strcmp ( name, "tbl" ) == 0 )
-            { * bits |= scan_tbl; return 0; }
-            break;
-        case 'i':
-            if ( strcmp ( name, "idx" ) == 0 )
-            { * bits |= scan_idx; return 0; }
-            break;
-        case 'd':
-            if ( strcmp ( name, "db" ) == 0 )
-            { * bits |= scan_db; return 0; }
-            break;
-        }
-
-        * bits |= scan_odir;
-    }
-    else if ( type == kptFile )
-    {
-        switch ( name [ 0 ] )
-        {
-        case 'l':
-            if ( strcmp ( name, "lock" ) == 0 )
-            { * bits |= scan_lock; return 0; }
-            break;
-        case 'i':
-            if ( memcmp ( name, "idx", 3 ) == 0 )
-            {
-                if ( isdigit ( name [ 3 ] ) )
-                { * bits |= scan_idxN; return 0; }
-            }
-            break;
-        case 'd':
-            if ( memcmp ( name, "data", 4 ) == 0 )
-            {
-                if ( name [ 4 ] == 0 )
-                { * bits |= scan_data; return 0; }
-                if ( isdigit ( name [ 4 ] ) )
-                { * bits |= scan_dataN; return 0; }
-            }
-        case 'c':
-            if ( strcmp ( name, "cur" ) == 0 )
-            { * bits |= scan_cur; return 0; }
-            break;
-        case 'r':
-            if ( isdigit ( name [ 1 ] ) && isdigit ( name [ 2 ] ) &&
-                 isdigit ( name [ 3 ] ) && name [ 4 ] == 0 )
-            { * bits |= scan_rNNN; return 0; }
-            break;
-        case 'm':
-            if ( strcmp ( name, "meta" ) == 0 )
-            { * bits |= scan_meta; return 0; }
-            break;
-        case 's':
-            if ( strcmp ( name, "skey" ) == 0 )
-            { * bits |= scan_skey; return 0; }
-            if ( strcmp ( name, "sealed" ) == 0 )
-            { * bits |= scan_sealed; return 0; }
-            break;
-        }
-
-        * bits |= scan_ofile;
-    }
-    else if (type == kptZombieFile )
-    {
-        * bits |= scan_zombie;
-    }
-    
-    return 0;
-}
-
-
-int KDBPathTypeDir (const KDirectory * dir, int type, bool * pHasZombies, const char * path)
-{
-    const char * leaf, * parent;
-    uint32_t bits;
-    rc_t rc;
-
-    bits = 0;
-
-    assert ((type == kptDir) || (type == (kptDir|kptAlias)));
-
-    rc = KDirectoryVVisit ( dir, false, scan_dbdir, & bits, path, NULL );
-    if ( rc == 0 ) do
-    {
-        if ( ( bits & scan_zombie ) != 0 ) {
-            bits &= ~scan_zombie;
-            if (pHasZombies)
-                *pHasZombies = true;
-        }
-        /* look for a column */
-        if ( ( bits & scan_idxN ) != 0 &&
-             ( bits & ( scan_data | scan_dataN ) ) != 0 )
-        {
-            if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                type += kptColumn - kptDir;
-            break;
-        }
-
-        /* look for a table */
-        if ( ( bits & scan_col ) != 0 )
-        {
-            /* can't have sub-tables or a db */
-            if ( ( bits & ( scan_db | scan_tbl ) ) == 0 )
-            {
-                /* look for an old-structure table */
-                if ( ( bits & ( scan_meta | scan_md ) ) == scan_meta ||
-                     ( bits & ( scan_skey | scan_idx ) ) == scan_skey )
-                    type += kptPrereleaseTbl - kptDir;
-                else
-                    type += kptTable - kptDir;
-            }
-            break;
-        }
-
-        /* look for metadata */
-        if ( ( bits & ( scan_cur | scan_rNNN ) ) != 0 )
-        {
-            if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                type += kptMetadata - kptDir;
-            break;
-        }
-
-        /* look for a database */
-        if ( ( bits & scan_tbl ) != 0 )
-        {
-            if ( ( bits & scan_col ) == 0 )
-                type += kptDatabase - kptDir;
-            break;
-        }
-
-        /* look for a structured column */
-        if ( ( bits & scan_odir ) != 0 )
-        {
-            leaf = strrchr ( path, '/' );
-            if ( leaf != NULL )
-            {
-                parent = string_rchr ( path, leaf - path, '/' );
-                if ( parent ++ == NULL )
-                    parent = path;
-                if ( memcmp ( parent, "col/", 4 ) != 0 )
-                    break;
-
-                bits = 0;
-                if ( KDirectoryVVisit ( dir, 1, scan_dbdir, & bits, path, NULL ) == 0 )
-                {
-                    if ( ( bits & scan_idxN ) != 0 &&
-                         ( bits & ( scan_data | scan_dataN ) ) != 0 )
-                    {
-                        if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                            type += kptColumn - kptDir;
-                        break;
-                    }
-                }
-            }
-        }
-    } while (0);
-
-    return type;
-}
-
-
-int KDBPathType ( const KDirectory *dir, bool *pHasZombies, const char *path )
-{
-    const char *leaf, *parent;
-
-
-    rc_t rc;
-    int type = KDirectoryVPathType ( dir, path, NULL );
-    
-    if (pHasZombies)
-        *pHasZombies = false;
-
-    switch ( type )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        type = KDBPathTypeDir (dir, type, pHasZombies, path);
-        break;
-
-    case kptFile:
-    case kptFile | kptAlias:
-    {
-        /* if we hit a file first try it as an archive */
-        const KDirectory * ldir;
-
-        rc = KDirectoryOpenSraArchiveRead_silent ( dir, &ldir, false, path );
-        if ( rc != 0 )
-            rc = KDirectoryOpenTarArchiveRead_silent ( dir, &ldir, false, path );
-        /* it was an archive so recur */
-        if ( rc == 0 )
-        {
-            /* recheck this newly opened directory for KDB/KFS type */
-            int type2;
-
-            type2 = KDBPathType ( ldir, NULL, "." );
-            if ((type2 != kptDir) || (type != (kptDir|kptAlias)))
-                type = type2;
-
-            KDirectoryRelease (ldir);
-        }
-        /* it was not an archive so see if it it's an idx file */
-        else
-        {
-            leaf = strrchr ( path, '/' );
-            if ( leaf != NULL )
-            {
-                parent = string_rchr ( path, leaf - path, '/' );
-                if ( parent ++ == NULL )
-                    parent = path;
-                if ( memcmp ( parent, "idx/", 4 ) == 0 )
-                    type += kptIndex - kptFile;
-            }
-        }
-        break;
-    }
-    }
-    return type;
-}
-
-
-
-#if SUPPORT_VFS_URI
-#else
-/* return configured password as ASCIZ
- * opertates on vfs/kfs/kfg objects, not kdb objects */
-static
-rc_t KDBOpenFileGetPassword (char * pw, size_t pwz)
-{
-    VFSManager * mgr;
-    rc_t rc;
-
-    assert (pw);
-    assert (pwz);
-
-    pw[0] = '\0';
-
-    rc = VFSManagerMake (&mgr);
-    if (rc)
-        ;                      /* failure to make VFS manager: pass along rc */
-    else
-    {
-        size_t pwfz;
-        char pwf [4096 + 1];
-
-        rc = VFSManagerGetConfigPWFile (mgr, pwf, sizeof (pwf) - 1, &pwfz);
-        if (rc)
-            /* failure to get password file path: tweak rc */
-            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcNotFound);
-
-        else
-        {
-            VPath * pwp;
-
-            pwf [pwfz] = '\0'; /* force to ASCIZ */
-
-#if 0
-            rc = VPathMakeSysPath (&pwp, pwf);
-#else
-            rc = VFSManagerMakePath (mgr, &pwp, pwf);
-#endif
-
-            if (rc)
-                ;       /* failure to construct a path from the string */
-            
-            else
-            {
-                const KFile * pwf;
-          
-                rc = VFSManagerOpenFileRead (mgr, &pwf, pwp);
-                if (rc)
-                    /* failure to open password file */
-                    rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcNotOpen);
-
-                else
-                {
-                    size_t z;
-                    char pwb [4098]; /* arbitrarily using 4096 as maximum
-                                        allowed length */
-
-                    /* at this point we are only getting the password from a 
-                     * file but in the future if we can get it from a pipe of
-                     * some sort we can't count on the ReadAll to really know
-                     * if we hit end of file and not just a pause in the
-                     * streaming.  VFS/KFS 2 will have to fix this somehow
-                     */
-
-                    rc = KFileReadAll (pwf, 0, pwb, sizeof pwb, &z);
-                    if (rc)
-                        ;       /* failure to read password file: pass along rc */
-                    else
-                    {
-                        /* trim off EOL if present */
-                        char * pc;
-
-                        pwb[z] = '\0';   /* force ASCIZ */
-
-                        pc = string_chr (pwb, z, '\r');
-                        if (pc)
-                        {
-                            *pc = '\0';
-                            z = 1 + pc - pwb;
-                        }
-                        pc = string_chr (pwb, z, '\n');
-                        if (pc)
-                        {
-                            *pc = '\0';
-                            z = 1 + pc - pwb;
-                        }
-                        if (z == 0)
-                            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcTooShort);
-
-                        else if (pwz < z) /* pwz came in as 4096 */
-                            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcTooLong);
-
-                        else
-                        {
-                            memmove (pw, pwb, z+1);
-                        }
-                    }
-                    KFileRelease (pwf);
-                }
-                VPathRelease (pwp);
-            }
-        }
-        VFSManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-/* not KDB specific - just uses vfs/krypto/kfs objects */
-static
-rc_t KDBOpenFileAsDirectory (const KDirectory * dir,
-                             const char * path, 
-                             const KDirectory ** pdir,
-                             uint32_t rcobj)
-{
-    const KFile * file;
-    const KFile * f;
-    const KDirectory * ldir;
-    bool encrypted = false;
-
-    rc_t rc;
-
-    *pdir = NULL;
-
-    rc = KDirectoryOpenFileRead (dir, &file, path);
-    if (rc == 0)
-    {
-        rc = KFileRandomAccess(file);
-        if (rc)
-            rc = RC (rcDB, rcMgr, rcOpening, rcobj, rcUnsupported);
-        else
-        {
-            size_t tz;
-            char tbuff [4096];
-            char pbuff [4096 + 1];
-
-            rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-            if (rc == 0)
-            {
-                if (KFileIsEnc (tbuff, tz) == 0)
-                {
-                    encrypted = true;
-
-                    rc = KDBOpenFileGetPassword (pbuff, sizeof (pbuff) - 1);
-                    if (rc == 0)
-                    {
-                        KKey key;
-
-                        rc = KKeyInitRead (&key, kkeyAES128, pbuff, string_size (pbuff));
-                        if (rc == 0)
-                        {
-                            rc = KEncFileMakeRead (&f, file, &key);
-                            if (rc == 0)
-                            {
-                                /* KEncFileMakeRead adds a reference */
-                                KFileRelease (file);
-                                file = f;
-                                rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-                            }
-                        }
-                    }
-                }
-                else if (KFileIsWGAEnc (tbuff, tz) == 0)
-                {
-                    encrypted = true;
-
-                    rc = KDBOpenFileGetPassword (pbuff, sizeof (pbuff) - 1);
-                    if (rc == 0)
-                    {
-                        rc = KFileMakeWGAEncRead (&f, file, pbuff, string_size (pbuff));
-                        if (rc == 0)
-                        {
-                            /* KFileMakeWGAEncRead adds a reference */
-                            KFileRelease (file);
-                            file = f;
-                            rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-                        }
-                    }
-                }
-                /* else not a handled encryption or unencrypted: we can't distinguish too much */
-
-                if (rc == 0)
-                {
-                    if (KFileIsSRA (tbuff, tz) == 0)
-                    {
-                        rc = KDirectoryOpenSraArchiveReadUnbounded_silent_preopened (dir,
-                                                                                     &ldir,
-                                                                                     false,
-                                                                                     file,
-                                                                                     path);
-                    }
-                    else
-                    {
-                        rc = KDirectoryOpenTarArchiveRead_silent_preopened (dir, &ldir, false,
-                                                                            file, path);
-                    }
-
-                    /* not an archive type we handle or a bad archive */
-                    if (rc)
-                    {
-                        if (encrypted)
-                            rc = RC ( rcDB, rcMgr, rcOpening, rcEncryptionKey, rcIncorrect );
-                        else
-                            rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-                    }
-                    else
-                    {
-                        /*
-                         * release our ownership of the KFile that but archive will 
-                         * keep theirs
-                         */
-                        KFileRelease (file);
-                        *pdir = ldir;
-                        return 0;
-                    }
-                }
-            }
-        }
-        KFileRelease (file);
-    }
-    return rc;
-}
-#endif
-
-
-static rc_t KDBOpenPathTypeReadInt ( const KDBManager * mgr, const KDirectory * dir, const char * path,
-                                     const KDirectory ** pdir, int * type,
-                                     int pathtype, uint32_t rcobj, bool try_srapath )
-{
-    VFSManager * vmgr = mgr->vfsmgr;
-    const KDirectory * ldir = NULL;
-    rc_t rc = 0;
-
-    /* object relative opens can be done using KFS - we hacked in VFS after all */
-    if (! try_srapath)
-    {
-        rc = KDirectoryOpenDirUpdate ((KDirectory*)dir, (KDirectory**)pdir, false, path);
-        if ((rc) && (GetRCState(rc) != rcNotFound))
-            rc = KDirectoryOpenDirRead (dir, pdir, false, path);
-    }
-    else
-    {
-        VPath * vpath;
-
-        /*
-         * We've got to decide if the path coming in is a full or relative
-         * path and if relative make it relative to dir or possibly its a srapath
-         * accession
-         *
-         */
-        rc = VPathMakeDirectoryRelative ( &vpath, dir, path );
-        if ( rc == 0 )
-        {
-            rc = VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt ( vmgr, dir, &ldir, vpath );
-
-            if ( rc == 0 )
-            {
-                *type = (~kptAlias) & KDBPathType ( ldir, NULL, "." );
-
-                /* just a directory, not a kdb type */
-                if ( *type == kptDir )
-                    rc = RC (rcDB, rcMgr, rcOpening, rcPath, rcIncorrect);
-
-                else if ( *type != pathtype )
-                {
-                    KDirectoryRelease( ldir );
-                    rc = RC ( rcDB, rcMgr, rcOpening, rcobj, rcIncorrect );
-                }
-                else
-                {
-                    if ( pdir != NULL )
-                        *pdir = ldir;
-                    else
-                        KDirectoryRelease( ldir );
-                }
-            }
-            VPathRelease ( vpath );
-        }
-    }
-    return rc;
-}
-
-rc_t KDBOpenPathTypeRead ( const KDBManager * mgr, const KDirectory * dir, const char * path, 
-    const KDirectory ** pdir, int pathtype, int * ppathtype, bool try_srapath )
-{
-    const KDirectory *ldir;
-    rc_t rc = 0;
-    uint32_t rcobj;
-    int type = kptNotFound; /* bogus? */
-
-/*     KOutMsg ("%s: %s\n", __func__, path); */
-
-    if ( pdir != NULL )
-        *pdir = NULL;
-    if ( ppathtype != NULL )
-        *ppathtype = type;
-
-    switch (pathtype & ~ kptAlias) /* tune the error message based on path type */
-    {
-        /* we'll hit this if we don't track defines in kdb/manager.h */
-    default:
-        rc = RC (rcDB, rcMgr, rcOpening, rcType, rcInvalid);
-        return rc;
-
-    case kptTable:
-    case kptPrereleaseTbl:
-        rcobj = rcTable;
-        break;
-
-    case kptColumn:
-        rcobj = rcColumn;
-        break;
-
-    case kptDatabase:
-    case kptDatabase | kptAlias:
-        rcobj = rcDatabase;
-        break;
-    }
-
-    rc = KDBOpenPathTypeReadInt( mgr, dir, path, &ldir, &type, pathtype, rcobj, try_srapath );
-
-    if (rc == 0)
-    {
-        if ( ppathtype != NULL )
-            *ppathtype = type;
-
-        if (pdir != NULL)
-            *pdir = ldir;
-        else
-            KDirectoryRelease (ldir);
-    }
-
-    return rc;
-}
-
-
-/* Writable
- *  examines a directory structure for any "lock" files
- */
-rc_t KDBWritable ( const KDirectory *dir, const char *path )
-{
-    uint32_t access;
-    rc_t rc;
-
-    /* protect us from bad parameters */
-    if (dir == NULL)
-        return RC (rcDB, rcPath, rcAccessing, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcPath, rcAccessing, rcPath, rcNull);
-
-    /* we have to be able to check the access if it is to be writable */
-    rc = KDirectoryVAccess ( dir, & access, path, NULL );
-    if ( rc == 0 )
-    {
-        /* if there is a lock (or deprecated sealed) file in this directory */
-        switch ( KDirectoryPathType ( dir, "%s/lock", path ) )
-        {
-        case kptFile:
-        case kptFile | kptAlias:
-            rc = RC ( rcDB, rcPath, rcAccessing, rcLock, rcLocked );
-            break;
-        case kptNotFound:
-            /* much simpler handling for the sealed file */
-            switch ( KDirectoryPathType ( dir, "%s/sealed", path ) )
-            {
-            case kptFile:
-            case kptFile | kptAlias:
-                rc = RC ( rcDB, rcPath, rcAccessing, rcLock, rcLocked );
-                break;
-            case kptNotFound:
-                /* check if there are no write permissions */
-                if ( ( access & 0222 ) == 0 )
-                    rc = RC ( rcDB, rcPath, rcAccessing, rcPath, rcReadonly );
-                /* else rc is still 0 from VAccess */
-            }
-            break;
-        case kptBadPath:
-            /* likely to be a non-driectory or something */
-            rc = RC ( rcDB, rcPath, rcAccessing, rcPath, rcInvalid);
-            break;
-        default:
-            /* an illegal type of object named "lock" is in this directory
-             * which will block the ability to lock it
-             */
-            rc = RC ( rcDB, rcPath, rcAccessing, rcPath, rcIncorrect );
-        }
-    }
-    return rc;
-}
-
-
-bool KDBIsLocked ( const KDirectory *dir, const char *path )
-{
-    return ( KDBWritable (dir, path) != 0 );
-}
-
-
-/* GetObjModDate
- *  extract mod date from a path
- */
-rc_t KDBGetObjModDate ( const KDirectory *dir, KTime_t *mtime )
-{
-    /* HACK ALERT - there needs to be a proper way to record modification times */
-    
-    /* this only tells the last time the table was locked,
-       which may be close to the last time it was modified */
-    rc_t rc = KDirectoryDate ( dir, mtime, "lock" );
-    if ( rc == 0 )
-        return 0;
-
-    if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = KDirectoryDate ( dir, mtime, "sealed" );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    /* get directory timestamp */
-    rc = KDirectoryDate ( dir, mtime, "." );
-    if ( rc == 0 )
-        return 0;
-
-    * mtime = 0;
-    return rc;
-}
-
-/* GetPathModDate
- *  extract mod date from a path
- */
-rc_t KDBVGetPathModDate ( const KDirectory *dir,
-    KTime_t *mtime, const char *path, va_list args )
-{
-    rc_t rc;
-    uint32_t ptype;
-    const KDirectory *obj_dir;
-
-    va_list cpy;
-    va_copy ( cpy, args );
-    ptype = KDirectoryVPathType ( dir, path, cpy );
-    va_end ( cpy );
-
-    switch ( ptype )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        break;
-
-    default:
-        return KDirectoryVDate ( dir, mtime, path, args );
-    }
-
-    * mtime = 0;
-    rc = KDirectoryVOpenDirRead ( dir, & obj_dir, true, path, args );
-    if ( rc == 0 )
-    {
-        rc = KDBGetObjModDate ( obj_dir, mtime );
-        KDirectoryRelease ( obj_dir );
-    }
-
-    return rc;
-}
-
-
-/* KDBVMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBVMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( ns_size > 0 )
-    {
-        subpath += ns_size + 1;
-        subpath_max -= ns_size + 1;
-    }
-
-#if CRUFTY_USE_OF_RESOLVE_PATH
-    /* because this call only builds a path instead of resolving anything
-     * is is okay that we are using the wrong directory */
-    rc = KDirectoryVResolvePath ( dir, false,
-        subpath, subpath_max, path, args );
-#else
-    {
-        int sz = vsnprintf ( subpath, subpath_max, path, args );
-        if ( sz < 0 || ( size_t ) sz >= subpath_max )
-            rc = RC ( rcDB, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        else if ( sz == 0 )
-            rc = RC ( rcDB, rcDirectory, rcResolving, rcPath, rcEmpty );
-        else
-        {
-            rc = 0;
-        }
-    }
-#endif
-    switch ( GetRCState ( rc ) )
-    {
-    case 0:
-        assert ( subpath [ 0 ] != 0 );
-        if ( subpath [ 0 ] == '.' || subpath [ 1 ] == '/' )
-            return RC ( rcDB, rcDirectory, rcResolving, rcPath, rcInvalid );
-        break;
-    case rcInsufficient:
-        return RC ( rcDB, rcDirectory, rcResolving, rcPath, rcExcessive );
-    default:
-        return rc;
-    }
-
-    if ( ns_size != 0 )
-    {
-        subpath -= ns_size + 1;
-        memcpy ( subpath, ns, ns_size );
-        subpath [ ns_size ] = '/';
-    }
-    return rc;
-}
-
-/* KDBMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-    va_start(args, path);
-    rc = KDBVMakeSubPath(dir, subpath, subpath_max, ns, ns_size, path, args);
-    va_end(args);
-    return rc;
-}
-
-/* this is included to make kdb.c vs. wkdb.c file comparisons easier in [x]emacs.*/
-#if NOT_USED_IN_READ_ONLY_SIDE
-/* VDrop
- */
-static
-rc_t KDBDropInt ( KDirectory * dir, const KDBManager * mgr,
-                  const char * path )
-{
-}
-
-rc_t KDBMgrVDrop ( KDirectory * dir, const KDBManager * mgr, uint32_t obj_type,
-                   const char * path, va_list args )
-{
-}
-#endif
-
-/* KDBIsPathUri
- * A hack to get some of VFS into KDB that is too tightly bound to KFS
- */
-
-bool KDBIsPathUri (const char * path)
-{
-    const char * pc;
-    size_t z;
-
-    z = string_size (path);
-
-    if (NULL != (pc = string_chr (path, z, ':')))
-        return true;
-
-    if (NULL != (pc = string_chr (path, z, '?')))
-        return true;
-
-    if (NULL != (pc = string_chr (path, z, '#')))
-        return true;
-
-    return false;
-}
diff --git a/libs/kdb/kdbfmt-priv.h b/libs/kdb/kdbfmt-priv.h
deleted file mode 100644
index 1ffc30f..0000000
--- a/libs/kdb/kdbfmt-priv.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdbfmt_priv_
-#define _h_kdbfmt_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KDBHdr
- *  the various file types used:
- *
- *  a) metadata
- *  b) key => id
- *  c) id => key
- *
- * will begin with a standard header to tag format
- */
-#define eByteOrderTag 0x05031988
-#define eByteOrderReverse 0x88190305
-
-typedef struct KDBHdr KDBHdr;
-struct KDBHdr
-{
-    uint32_t endian;
-    uint32_t version;
-};
-
-/* KDBHdrInit
- *  simple initialization
- */
-#define KDBHdrInit( hdr, vers ) \
-    ( void ) ( ( hdr ) -> endian = eByteOrderTag, ( hdr ) -> version = vers )
-
-/* KDBHdrValidate
- *  validates that a header sports a supported byte order
- *  and that the version is within range
- */
-rc_t KDBHdrValidate ( const KDBHdr *hdr, size_t size,
-    uint32_t min_vers, uint32_t max_vers );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdbfmt_priv_ */
diff --git a/libs/kdb/libkdb.vers b/libs/kdb/libkdb.vers
deleted file mode 100644
index 0b1f1ed..0000000
--- a/libs/kdb/libkdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.2.13
diff --git a/libs/kdb/libkdb.vers.h b/libs/kdb/libkdb.vers.h
deleted file mode 100644
index 6d0ed76..0000000
--- a/libs/kdb/libkdb.vers.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define LIBKDB_VERS 0x0102000D
diff --git a/libs/kdb/libwkdb.vers b/libs/kdb/libwkdb.vers
deleted file mode 100644
index 0b1f1ed..0000000
--- a/libs/kdb/libwkdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.2.13
diff --git a/libs/kdb/libwkdb.vers.h b/libs/kdb/libwkdb.vers.h
deleted file mode 100644
index 06e1100..0000000
--- a/libs/kdb/libwkdb.vers.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define LIBWKDB_VERS 0x0102000D
diff --git a/libs/kdb/meta.c b/libs/kdb/meta.c
deleted file mode 100644
index 046ff89..0000000
--- a/libs/kdb/meta.c
+++ /dev/null
@@ -1,2141 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kdb/extern.h>
-
-struct KMDataNodeNamelist;
-#define KNAMELIST_IMPL struct KMDataNodeNamelist
-
-#define KONST const
-#include "kdb-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "table-priv.h"
-#include "column-priv.h"
-#include "kdbfmt-priv.h"
-#undef KONST
-
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <klib/container.h>
-#include <klib/pbstree.h>
-#include <klib/namelist.h>
-#include <klib/impl.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/refcount.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <strtol.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include <strtol.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#define KMETADATAVERS 2
-#define NODE_SIZE_LIMIT ( 25 * 1024 * 1024 )
-#define NODE_CHILD_LIMIT ( 100 * 1024 )
-
-
-typedef struct KMDataNodeInflateData KMDataNodeInflateData;
-struct KMDataNodeInflateData
-{
-    const KMetadata *meta;
-    const KMDataNode *par;
-    BSTree *bst;
-    size_t node_size_limit;
-    uint32_t node_child_limit;
-    rc_t rc;
-    bool byteswap;
-};
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-struct KMetadata
-{
-    const KDirectory *dir;
-    const KDBManager *mgr;
-
-    /* owner */
-    const KDatabase *db;
-    const KTable *tbl;
-    const KColumn *col;
-
-    /* root node */
-    KMDataNode *root;
-
-    KRefcount refcount;
-    uint32_t vers;
-    uint32_t rev;
-    bool byteswap;
-    char path [ 1 ];
-};
-
-static
-KMetadata *KMetadataAttach ( const KMetadata *self );
-
-static
-rc_t KMetadataSever ( const KMetadata *self );
-
-
-/*--------------------------------------------------------------------------
- * KMAttrNode
- */
-typedef struct KMAttrNode KMAttrNode;
-struct KMAttrNode
-{
-    BSTNode n;
-    void *value;
-    size_t vsize;
-    char name [ 1 ];
-};
-
-static
-int CC KMAttrNodeCmp ( const void *item, const BSTNode *n )
-{
-#define a ( ( const char* ) item )
-#define b ( ( const KMAttrNode* ) n )
-
-    return strcmp ( a, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-int CC KMAttrNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KMAttrNode* ) item )
-#define b ( ( const KMAttrNode* ) n )
-
-    return strcmp ( a -> name, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-void CC KMAttrNodeWhack ( BSTNode *n, void *data )
-{
-    free ( n );
-}
-
-static
-bool CC KMAttrNodeInflate ( PBSTNode *n, void *data )
-{
-    KMAttrNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    const char *name = n -> data . addr;
-    size_t size = strlen ( name );
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    /* v2 attributes are more easily allocated
-       as a single (name,value) block because
-       there are no other associated structures */
-    b = malloc ( sizeof * b + n -> data . size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    b -> value = & b -> name [ 1 + size ];
-    b -> vsize = n -> data . size - size - 1;
-    memcpy ( b -> name, name, n -> data . size );
-    BSTreeInsert ( pb -> bst, & b -> n, KMAttrNodeSort );
-    return false;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- *  a node with an optional value,
- *  optional attributes, and optional children
- *
- *  nodes are identified by path, relative to a starting node,
- *  where "/" serves as a path separator.
- */
-struct KMDataNode
-{
-    BSTNode n;
-    const KMDataNode *par;
-    const KMetadata *meta;
-    void *value;
-    size_t vsize;
-    BSTree attr;
-    BSTree child;
-    KRefcount refcount;
-    char name [ 1 ];
-};
-
-static
-int CC KMDataNodeCmp ( const void *item, const BSTNode *n )
-{
-#define a ( ( const char* ) item )
-#define b ( ( const KMDataNode* ) n )
-
-    return strcmp ( a, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-int CC KMDataNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KMDataNode* ) item )
-#define b ( ( const KMDataNode* ) n )
-
-    return strcmp ( a -> name, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-void CC KMDataNodeWhack ( BSTNode *n, void *data )
-{
-    KMDataNode *self = ( KMDataNode* ) n;
-
-    REFMSG ( "KMDataNode", "flush", & self -> refcount );
-
-    self -> meta = NULL;
-    atomic32_inc ( & self -> refcount );
-    KMDataNodeRelease ( self );
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KMDataNodeAddRef ( const KMDataNode *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KMDataNode" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeRelease ( const KMDataNode *cself )
-{
-    KMDataNode *self = ( KMDataNode* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KMDataNode" ) )
-        {
-        case krefOkay:
-            return KMetadataSever ( self -> meta );
-        case krefWhack:
-
-            if ( self -> meta != NULL )
-                return KMetadataSever ( self -> meta );
-
-            KRefcountWhack ( & self -> refcount, "KMDataNode" );
-
-            BSTreeWhack ( & self -> attr, KMAttrNodeWhack, NULL );
-            BSTreeWhack ( & self -> child, KMDataNodeWhack, NULL );
-            free ( self -> value );
-            free ( self );
-            break;
-
-        case krefNegative:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Inflate
- */
-static
-bool CC KMDataNodeInflate_v1 ( PBSTNode *n, void *data )
-{
-    void *value;
-    KMDataNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    /* v1 metadata are flat, with the name
-       stored as a NUL terminated string
-       followed by value payload */
-    const char *name = n -> data . addr;
-    size_t size = strlen ( name );
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    b = malloc ( sizeof * b + size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    b -> par = pb -> par;
-    b -> meta = pb -> meta;
-    b -> value = ( void* ) ( name + size + 1 );
-    b -> vsize = n -> data . size - size - 1;
-    BSTreeInit ( & b -> attr );
-    BSTreeInit ( & b -> child );
-    KRefcountInit ( & b -> refcount, 0, "KMDataNode", "inflate", name );
-    strcpy ( b -> name, name );
-     
-    /* a name with no associated value */
-    if ( b -> vsize == 0 )
-    {
-        b -> value = NULL;
-        BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-        return false;
-    }
-
-    /* allocate value because v2+ code expects this */
-    value = malloc ( b -> vsize );
-    if ( value != NULL )
-    {
-        memcpy ( value, b -> value, b -> vsize );
-        b -> value = value;
-        BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-        return false;
-    }
-
-    pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-    free ( b );
-    return true;
-}
-
-static
-rc_t KMDataNodeInflateAttr ( KMDataNode *n, bool byteswap )
-{
-    PBSTree *bst;
-    rc_t rc = PBSTreeMake ( & bst, n -> value, n -> vsize, byteswap );
-    if ( rc != 0 )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-    else
-    {
-        KMDataNodeInflateData pb;
-        size_t bst_size = PBSTreeSize ( bst );
-        
-        pb . meta = n -> meta;
-        pb . par = n;
-        pb . bst = & n -> attr;
-        pb . node_size_limit = NODE_SIZE_LIMIT;
-        pb . node_child_limit = NODE_CHILD_LIMIT;
-        pb . rc = 0;
-        pb . byteswap = byteswap;
-        PBSTreeDoUntil ( bst, 0, KMAttrNodeInflate, & pb );
-        rc = pb . rc;
-        
-        PBSTreeWhack ( bst );
-        
-        n -> value = ( char* ) n -> value + bst_size;
-        n -> vsize -= bst_size;
-    }
-    return rc;
-}
-
-static
-bool CC KMDataNodeInflate ( PBSTNode *n, void *data );
-
-static
-rc_t KMDataNodeInflateChild ( KMDataNode *n,
-    size_t node_size_limit, uint32_t node_child_limit, bool byteswap )
-{
-    PBSTree *bst;
-    rc_t rc = PBSTreeMake ( & bst, n -> value, n -> vsize, byteswap );
-    if ( rc != 0 )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-    else
-    {
-        uint32_t bst_count = PBSTreeCount ( bst );
-        size_t bst_size = PBSTreeSize ( bst );
-        if ( bst_count > node_child_limit )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn,
-                                  "refusing to inflate metadata node '$(node)' within file '$(path)': "
-                                  "number of children ($(num_children)) exceeds limit ($(limit))."
-                                  , "node=%s,path=%s,num_children=%u,limit=%u"
-                                  , n -> name
-                                  , n -> meta -> path
-                                  , bst_count
-                                  , node_child_limit )
-                );
-        }
-        else if ( bst_size > node_size_limit )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn,
-                                  "refusing to inflate metadata node '$(node)' within file '$(path)': "
-                                 "node size ($(node_size)) exceeds limit ($(limit))."
-                                 , "node=%s,path=%s,node_size=%zu,limit=%zu"
-                                 , n -> name
-                                 , n -> meta -> path
-                                 , bst_size
-                                 , node_size_limit )
-                );
-        }
-        else
-        {
-            KMDataNodeInflateData pb;
-            pb . meta = n -> meta;
-            pb . par = n;        
-            pb . bst = & n -> child;
-            pb . node_size_limit = node_size_limit;
-            pb . node_child_limit = node_child_limit;
-            pb . rc = 0;
-            pb . byteswap = byteswap;
-            PBSTreeDoUntil ( bst, 0, KMDataNodeInflate, & pb );
-            rc = pb . rc;
-        }
-        
-        PBSTreeWhack ( bst );
-        
-        n -> value = ( char* ) n -> value + bst_size;
-        n -> vsize -= bst_size;
-    }
-    return rc;
-}
-
-static
-bool CC KMDataNodeInflate ( PBSTNode *n, void *data )
-{
-    KMDataNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    /* v2 names are preceded by a decremented length byte
-       that has its upper two bits dedicated to
-       signaling existence of attributes & children */
-    const char *name = n -> data . addr;
-    int bits = * ( ( const uint8_t* ) name ++ );
-    size_t size = ( bits >> 2 ) + 1;
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    b = malloc ( sizeof * b + size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    b -> par = pb -> par;
-    b -> meta = pb -> meta;
-    b -> value = ( void* ) ( name + size );
-    b -> vsize = n -> data . size - size - 1;
-    BSTreeInit ( & b -> attr );
-    BSTreeInit ( & b -> child );
-    KRefcountInit ( & b -> refcount, 0, "KMDataNode", "inflate", b -> name );
-    memcpy ( b -> name, name, size );
-    b -> name [ size ] = 0;
-
-    pb -> rc = ( bits & 1 ) != 0 ? KMDataNodeInflateAttr ( b, pb -> byteswap ) : 0;
-    if ( pb -> rc == 0 )
-    {
-        pb -> rc = ( bits & 2 ) != 0 ?
-            KMDataNodeInflateChild ( b, pb -> node_size_limit, pb -> node_child_limit, pb -> byteswap ) : 0;
-        if ( pb -> rc == 0 )
-        {
-            void *value;
-
-            if ( b -> vsize == 0 )
-            {
-                b -> value = NULL;
-                BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-                return false;
-            }
-
-            value = malloc ( b -> vsize );
-            if ( value != NULL )
-            {
-                memcpy ( value, b -> value, b -> vsize );
-                b -> value = value;
-                BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-                return false;
-            }
-            pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-
-            BSTreeWhack ( & b -> child, KMDataNodeWhack, NULL );
-        }
-
-        BSTreeWhack ( & b -> attr, KMAttrNodeWhack, NULL );
-    }
-
-    free ( b );
-    return true;
-}
-
-
-/* Find
- */
-static
-rc_t KMDataNodeFind ( const KMDataNode *self, const KMDataNode **np, char **path )
-{
-    const KMDataNode *found;
-
-    char *end, *name = * path;
-
-    /* interpret leading '/' */
-    if ( name [ 0 ] == '/' )
-    {
-        while ( self -> par != NULL )
-            self = self -> par;
-        ++ name;
-    }
-
-    /* find node */
-    for ( found = self; name != NULL; self = found, name = end )
-    {
-        /* segment path */
-        end = strchr ( name, '/' );
-        if ( end != NULL )
-            * end ++ = 0;
-
-        /* interpret special paths */
-        switch ( name [ 0 ] )
-        {
-        case 0:
-            continue;
-        case '.':
-            switch ( name [ 1 ] )
-            {
-            case 0:
-                continue;
-            case '.':
-                if ( name [ 2 ] == 0 )
-                {
-                    /* this is a backup */
-                    if ( ( self = self -> par ) == NULL )
-                        return RC ( rcDB, rcMetadata, rcSelecting, rcPath, rcInvalid );
-                    continue;
-                }
-                break;
-            }
-            break;
-        }
-
-        /* find actual path */
-        found = ( const KMDataNode* )
-            BSTreeFind ( & self -> child, name, KMDataNodeCmp );
-        if ( found == NULL )
-        {
-            /* not found also gets partially found state */
-            if ( end != NULL )
-                end [ -1 ] = '/';
-            * path = name;
-            * np = self;
-            return RC ( rcDB, rcMetadata, rcSelecting, rcPath, rcNotFound );
-        }
-    }
-
-    /* the current self is our guy */
-    * np = self;
-    return 0;
-}
-
-
-/* OpenNodeRead
- * VOpenNodeRead
- *  opens a metadata node
- *
- *  "node" [ OUT ] - return parameter for indicated metadata node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within metadata hierarchy. when NULL, empty, ".", or "/",
- *  return root node in "node". path separator is "/".
- */
-LIB_EXPORT rc_t CC KMDataNodeVOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-    KMDataNode *found;
-    char full [ 4096 ], *p = full;
-
-    if ( node == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcParam, rcNull );
-
-    * node = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcSelf, rcNull );
-
-    /* handle special NULL path */
-    if ( path == NULL )
-        full [ 0 ] = 0;
-    else
-    {
-        int len;
-
-        /* generate full path */
-        if ( args == NULL )
-            len = snprintf ( full, sizeof full, "%s", path );
-        else
-            len = vsnprintf ( full, sizeof full, path, args );
-        if ( len < 0 || len >= sizeof full )
-            return RC ( rcDB, rcNode, rcOpening, rcPath, rcExcessive );
-    }
-
-    rc = KMDataNodeFind ( self, ( const KMDataNode** ) & found, & p );
-    if ( rc == 0 )
-    {
-        KMetadataAttach ( found -> meta );
-        KMDataNodeAddRef ( found );
-        * node = found;
-    }
-
-    DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-                ("KMDataNodeVOpenNodeRead(%s) = %d\n", full, rc));
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMDataNodeVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataVOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc = 0;
-
-    if ( node == NULL )
-        rc = RC ( rcDB, rcMetadata, rcOpening, rcParam, rcNull );
-    else if ( self == NULL )
-    {
-        * node = NULL;
-        rc = RC ( rcDB, rcMetadata, rcOpening, rcSelf, rcNull );
-    }
-    else
-        rc = KMDataNodeVOpenNodeRead ( self -> root, node, path, args );
-
-    DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-                ("KMetadataVOpenNodeRead(%s) = %d\n", path, rc));
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMetadataVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KMDataNodeByteOrder ( const KMDataNode *self, bool *reversed )
-{
-    if ( self != NULL )
-        return KMetadataByteOrder ( self -> meta, reversed );
-
-    if ( reversed == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    * reversed = false;
-    return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* Read
- *  read a node value or attribute
- *
- *  "offset" [ IN ] - initial offset into metadata
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read.
- *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
- */
-LIB_EXPORT rc_t CC KMDataNodeRead ( const KMDataNode *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( remaining == NULL )
-        remaining = & dummy;
-
-    if ( num_read == NULL )
-        rc = RC ( rcDB, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcNode, rcReading, rcSelf, rcNull );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcDB, rcNode, rcReading, rcBuffer, rcNull );
-        else
-        {
-            size_t to_read, avail = self -> vsize;
-            if ( offset > avail )
-                offset = avail;
-
-            to_read = avail -= offset;
-            if ( to_read > bsize )
-                to_read = bsize;
-
-            if ( to_read > 0 )
-                memcpy ( buffer, ( const char* ) self -> value + offset, to_read );
-
-            * num_read = to_read;
-            * remaining = avail - to_read;
-
-            return 0;
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-    return rc;
-}
-
-
-/* Addr - PRIVATE
- *  reach into node and get address
- *  returns raw pointer and node size
- */
-LIB_EXPORT rc_t CC KMDataNodeAddr ( const KMDataNode *self,
-    const void **addr, size_t *size )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( size == NULL )
-        size = & dummy;
-
-    if ( addr == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcSelf, rcNull );
-        else
-        {
-            * addr = self -> value;
-            * size = self -> vsize;
-
-            return 0;
-        }
-
-        * addr = NULL;
-    }
-
-    * size = 0;
-    return rc;
-}
-
-
-/* Read ( formatted )
- *  reads as integer or float value in native byte order
- *
- *  "bXX" [ OUT ] - return parameter for numeric value
- */
-LIB_EXPORT rc_t CC KMDataNodeReadB8 ( const KMDataNode *self, void *b8 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b8, 1,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 1 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB16 ( const KMDataNode *self, void *b16 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b16, 2,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 2 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint16_t* ) b16 = bswap_16 ( * ( const uint16_t* ) b16 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB32 ( const KMDataNode *self, void *b32 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b32, 4,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 4 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint32_t* ) b32 = bswap_32 ( * ( const uint32_t* ) b32 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB64 ( const KMDataNode *self, void *b64 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b64, 8,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 8 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint64_t* ) b64 = bswap_64 ( * ( const uint64_t* ) b64 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB128 ( const KMDataNode *self, void *b128 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b128, 16,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 16 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-        {
-            uint64_t *b64 = b128;
-            uint64_t tmp = bswap_64 ( b64 [ 0 ] );
-            b64 [ 0 ] = bswap_64 ( b64 [ 1 ] );
-            b64 [ 1 ] = tmp;
-        }
-    }
-    return rc;
-}
-
-
-/* ReadAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAsI16 ( const KMDataNode *self, int16_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU16 ( const KMDataNode *self, uint16_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsI32 ( const KMDataNode *self, int32_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( ( ( const int16_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int16_t* ) i ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * i = bswap_32 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU32 ( const KMDataNode *self, uint32_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( ( ( const uint16_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint16_t* ) u ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * u = bswap_32 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsI64 ( const KMDataNode *self, int64_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( ( ( const int16_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int16_t* ) i ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * i = bswap_32 ( ( ( const int32_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int32_t* ) i ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * i = bswap_64 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU64 ( const KMDataNode *self, uint64_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( ( ( const uint16_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint16_t* ) u ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * u = bswap_32 ( ( ( const uint32_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint32_t* ) u ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * u = bswap_64 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsF64 ( const KMDataNode *self, double *f )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, f, sizeof * f,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 4:
-            if ( self -> meta -> byteswap )
-                * ( uint32_t* ) f = bswap_32 ( * ( const uint32_t* ) f );
-            * f = ( ( const float* ) f ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * ( uint64_t* ) f = bswap_64 ( * ( const uint64_t* ) f );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-
-/* Read ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-LIB_EXPORT rc_t CC KMDataNodeReadCString ( const KMDataNode *self,
-    char *buffer, size_t bsize, size_t *size )
-{
-    size_t remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, buffer, bsize - 1, size, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-        {
-            * size += remaining;
-            return RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcInsufficient );
-        }
-
-        buffer [ * size ] = 0;
-    }
-    return rc;
-}
-
-
-/* ReadAttr
- *  reads as NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAttr ( const KMDataNode *self, const char *name,
-    char *buffer, size_t bsize, size_t *size )
-{
-    rc_t rc;
-
-    if ( size == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcString, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcString, rcEmpty );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcNull );
-        else
-        {
-            const KMAttrNode *n = ( const KMAttrNode* )
-                BSTreeFind ( & self -> attr, name, KMAttrNodeCmp );
-            if ( n == NULL )
-            {
-                * size = 0;
-                if ( bsize != 0 )
-                    buffer [ 0 ] = 0;
-                rc = RC ( rcDB, rcMetadata, rcReading, rcAttr, rcNotFound );
-            }
-            else
-            {
-                * size = n -> vsize;
-                if ( n -> vsize < bsize )
-                {
-                    memcpy ( buffer, n -> value, n -> vsize );
-                    buffer [ n -> vsize ] = 0;
-                    return 0;
-                }
-
-                return RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcInsufficient );
-            }
-        }
-
-        * size = 0;
-    }
-
-    return rc;
-}
-
-
-/* ReadAttrAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI16 ( const KMDataNode *self, const char *attr, int16_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            int64_t val = strtoi64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val < SHRT_MIN || val > SHRT_MAX )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * i = ( int16_t ) val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU16 ( const KMDataNode *self, const char *attr, uint16_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            uint64_t val = strtou64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val > USHRT_MAX )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * u = ( uint16_t ) val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI32 ( const KMDataNode *self, const char *attr, int32_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            int64_t val = strtoi64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val < INT_MIN || val > INT_MAX )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * i = ( int32_t ) val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU32 ( const KMDataNode *self, const char *attr, uint32_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            uint64_t val = strtou64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val > UINT_MAX )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * u = ( uint32_t ) val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI64 ( const KMDataNode *self, const char *attr, int64_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            int64_t val =  strtoi64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * i = val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU64 ( const KMDataNode *self, const char *attr, uint64_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            uint64_t val =  strtou64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * u = val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsF64 ( const KMDataNode *self, const char *attr, double *f )
-{
-    rc_t rc;
-    if ( f == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            double val = strtod ( buffer, & end );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * f = val;
-                return 0;
-            }
-        }
-
-        * f = 0.0;
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-
-/* Whack
- */
-static
-rc_t KMetadataWhack ( KMetadata *self )
-{
-    rc_t rc = 0;
-
-    KRefcountWhack ( & self -> refcount, "KMetadata" );
-
-    if ( self -> db != NULL )
-    {
-        rc = KDatabaseSever ( self -> db );
-        if ( rc == 0 )
-            self -> db = NULL;
-    }
-    else if ( self -> tbl != NULL )
-    {
-        rc = KTableSever ( self -> tbl );
-        if ( rc == 0 )
-            self -> tbl = NULL;
-    }
-    else if ( self -> col != NULL )
-    {
-        rc = KColumnSever ( self -> col );
-        if ( rc == 0 )
-            self -> col = NULL;
-    }
-
-    if ( rc == 0 )
-        rc = KDBManagerSever ( self -> mgr );
-
-    if ( rc == 0 )
-    {
-        KDirectoryRelease ( self -> dir );
-        KMDataNodeWhack ( ( BSTNode* ) & self -> root -> n, NULL );
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KMetadata", "whack", "kmeta" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KMetadataAddRef ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMetadataRelease ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefWhack:
-            return KMetadataWhack ( ( KMetadata* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-static
-KMetadata *KMetadataAttach ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KMetadata* ) self;
-}
-
-static
-rc_t KMetadataSever ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefWhack:
-            return KMetadataWhack ( ( KMetadata* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Make
- */
-
-static
-rc_t KMetadataPopulate ( KMetadata *self, const KDirectory *dir, const char *path )
-{
-    const KFile *f;
-    rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
-    if ( rc == 0 )
-    {
-        const KMMap *mm;
-        rc = KMMapMakeRead ( & mm, f );
-        if ( rc == 0 )
-        {
-            size_t size;
-            const void *addr;
-            rc = KMMapSize ( mm, & size );
-            if ( rc == 0 )
-                rc = KMMapAddrRead ( mm, & addr );
-
-            if ( rc == 0 )
-            {
-                union
-                {
-                    KDBHdr v1;
-                    KDBHdr v2;
-                } hdrs;
-
-                const KDBHdr *hdr = ( const KDBHdr* ) addr;
-                const void *pbstree_src = hdr + 1;
-
-                rc = KDBHdrValidate ( hdr, size, 1, KMETADATAVERS );
-                if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                {
-                    hdrs . v1 . endian = bswap_32 ( hdr -> endian );
-                    hdrs . v1 . version = bswap_32 ( hdr -> version );
-                    rc = KDBHdrValidate ( & hdrs . v1, size, 1, KMETADATAVERS );
-                    if ( rc == 0 )
-                    {
-                        self -> byteswap = true;
-                        switch ( hdrs . v1 . version )
-                        {
-                        case 1:
-                            hdr = & hdrs . v1;
-                            break;
-                        case 2:
-                            hdr = & hdrs . v2;
-                            break;
-                        }
-                    }
-                }
-                if ( rc == 0 )
-                {
-                    PBSTree *bst;
-                    rc = PBSTreeMake ( & bst, pbstree_src, size - sizeof * hdr, self -> byteswap );
-                    if ( rc != 0 )
-                        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-                    else
-                    {
-                        KMDataNodeInflateData pb;
-
-                        pb . meta = self;
-                        pb . par = self -> root;
-                        pb . bst = & self -> root -> child;
-                        pb . node_size_limit = NODE_SIZE_LIMIT;
-                        pb . node_child_limit = NODE_CHILD_LIMIT;
-                        pb . rc = 0;
-                        pb . byteswap = self -> byteswap;
-
-                        if ( hdr -> version == 1 )
-                            PBSTreeDoUntil ( bst, 0, KMDataNodeInflate_v1, & pb );
-                        else
-                            PBSTreeDoUntil ( bst, 0, KMDataNodeInflate, & pb );
-                        rc = pb . rc;
-
-                        self -> vers = hdr -> version;
-
-                        PBSTreeWhack ( bst );
-                    }
-                }
-            }
-
-            KMMapRelease ( mm );
-        }
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-static
-rc_t KMetadataMakeRead ( KMetadata **metap,
-    const KDirectory *dir, const char *path, uint32_t rev )
-{
-    rc_t rc;
-    KMetadata *meta = malloc ( sizeof * meta + strlen ( path ) );
-    if ( meta == NULL )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( meta, 0, sizeof * meta );
-        meta -> root = calloc ( 1, sizeof * meta -> root );
-        if ( meta -> root == NULL )
-            rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            meta -> root -> meta = meta;
-            meta -> dir = dir;
-            KRefcountInit ( & meta -> refcount, 1, "KMetadata", "make-read", path );
-            meta -> rev = rev;
-            meta -> byteswap = false;
-            strcpy ( meta -> path, path );
-
-            KRefcountInit ( & meta -> root -> refcount, 0, "KMDataNode", "make-read", "/" );
-
-            rc = KMetadataPopulate ( meta, dir, path );
-            if ( rc == 0 )
-            {
-                KDirectoryAddRef ( dir );
-                * metap = meta;
-                return 0;
-            }
-
-            free ( meta -> root );
-        }
-
-        free ( meta );
-    }
-    * metap = NULL;
-    return rc;
-}
-
-
-/* OpenMetadataRead
- *  opens metadata for read
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-static
-rc_t KDBManagerOpenMetadataReadInt ( const KDBManager *self,
-    KMetadata **metap, const KDirectory *wd, uint32_t rev, bool prerelease )
-{
-    char metapath [ 4096 ];
-    rc_t rc = ( prerelease == 1 ) ?
-        KDirectoryVResolvePath ( wd, true, metapath, sizeof metapath, "meta", NULL ):
-        ( ( rev == 0 ) ?
-          KDirectoryVResolvePath ( wd, true, metapath, sizeof metapath, "md/cur", NULL ):
-          KDirectoryResolvePath ( wd, true, metapath, sizeof metapath, "md/r%.3u", rev ) );
-    if ( rc == 0 )
-    {
-        KMetadata *meta;
-
-        switch ( KDirectoryVPathType ( wd, metapath, NULL ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcMetadata, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        }
-
-        rc = KMetadataMakeRead ( & meta, wd, metapath, rev );
-        if ( rc == 0 )
-        {
-            meta -> mgr = KDBManagerAttach ( self );
-            * metap = meta;
-            return 0;
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenMetadataRead ( const KDatabase *self, const KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta, self -> dir, 0, false );
-    if ( rc == 0 )
-    {
-        meta -> db = KDatabaseAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenMetadataRead ( const KTable *self, const KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta,
-        self -> dir, 0, self -> prerelease );
-    if ( rc == 0 )
-    {
-        meta -> tbl = KTableAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenMetadataRead ( const KColumn *self, const KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta, self -> dir, 0, false );
-    if ( rc == 0 )
-    {
-        meta -> col = KColumnAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-
-/* Version
- *  returns the metadata format version
- */
-LIB_EXPORT rc_t CC KMetadataVersion ( const KMetadata *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * version = 0;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * version = self -> vers;
-    return 0;
-}
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KMetadataByteOrder ( const KMetadata *self, bool *reversed )
-{
-    if ( reversed == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * reversed = false;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * reversed = self -> byteswap;
-    return 0;
-}
-
-
-/* Revision
- *  returns current revision number
- *  where 0 ( zero ) means tip
- */
-LIB_EXPORT rc_t CC KMetadataRevision ( const KMetadata *self, uint32_t *revision )
-{
-    if ( revision == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * revision = 0;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * revision = self -> rev;
-    return 0;
-}
-
-
-/* MaxRevision
- *  returns the maximum revision available
- */
-LIB_EXPORT rc_t CC KMetadataMaxRevision ( const KMetadata *self, uint32_t *revision )
-{
-    if ( revision == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    * revision = 0;
-
-    if ( self != NULL )
-    {
-        KNamelist *listing;
-        rc_t rc = KDirectoryVList ( self -> dir,
-            & listing, NULL, NULL, "md", NULL );
-        if ( rc == 0 )
-        {
-            uint32_t rev_max, count;
-            rc = KNamelistCount ( listing, & count );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                for ( rev_max = idx = 0; idx < count; ++ idx )
-                {
-                    const char *name;
-                    
-                    rc = KNamelistGet ( listing, idx, & name );
-                    if ( rc != 0 )
-                        break;
-                    
-                    if ( name [ 0 ] == 'r' )
-                    {
-                        char *end;
-                        uint32_t rev = strtou32 ( name + 1, & end, 10 );
-                        if ( end [ 0 ] == 0 && rev > rev_max )
-                            rev_max = rev;
-                    }
-                }
-
-                * revision = rev_max;
-            }
-                
-            KNamelistRelease ( listing );
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-        {
-            rc = 0;
-        }
-
-        return rc;
-    }
-
-    return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* OpenRevision
- *  opens a read-only indexed revision of metadata
- */
-LIB_EXPORT rc_t CC KMetadataOpenRevision ( const KMetadata *self,
-    const KMetadata **metap, uint32_t revision )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcMetadata, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr,
-        & meta, self -> dir, revision, false );
-    if ( rc == 0 )
-    {
-        if ( self -> db != NULL )
-            meta -> db = KDatabaseAttach ( self -> db );
-        else if ( self -> tbl != NULL )
-            meta -> tbl = KTableAttach ( self -> tbl );
-        else if ( self -> col != NULL )
-            meta -> col = KColumnAttach ( self -> col );
-
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-
-/* GetSequence
- *  access a named sequence
- *
- *  "seq" [ IN ] - NUL terminated sequence name
- *
- *  "val" [ OUT ] - return parameter for sequence value
- */
-LIB_EXPORT rc_t CC KMetadataGetSequence ( const KMetadata *self,
-    const char *seq, int64_t *val )
-{
-    rc_t rc;
-    const KMDataNode *found;
-
-    if ( val == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    * val = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-
-    if ( seq == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcString, rcNull );
-    if ( seq [ 0 ] == 0 )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcString, rcInvalid );
-
-    rc = KMDataNodeOpenNodeRead
-        ( self -> root, & found, ".seq/%s", seq );
-    if ( rc == 0 )
-    {
-        size_t num_read, remaining;
-        rc = KMDataNodeRead ( found, 0, val, sizeof * val, & num_read, & remaining );
-        assert ( rc != 0 || ( num_read == sizeof * val && remaining == 0 ) );
-        KMDataNodeRelease ( found );
-    }
-
-    return rc;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-typedef struct KMDataNodeNamelist KMDataNodeNamelist;
-struct KMDataNodeNamelist
-{
-    KNamelist dad;
-    const KMDataNode *node;
-    size_t count;
-    const char *namelist [ 1 ];
-};
-
-/* Whack
- */
-static
-rc_t CC KMDataNodeNamelistWhack ( KMDataNodeNamelist *self )
-{
-    rc_t rc = KMDataNodeRelease ( self -> node );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Count
- */
-static
-rc_t CC KMDataNodeNamelistCount ( const KMDataNodeNamelist *self, uint32_t *count )
-{
-    * count = ( uint32_t ) self -> count;
-    return 0;
-}
-
-/* Get
- */
-static
-rc_t CC KMDataNodeNamelistGet ( const KMDataNodeNamelist *self,
-    uint32_t idx, const char **name )
-{
-    if ( ( size_t ) idx >= self -> count )
-        return RC ( rcDB, rcNamelist, rcAccessing, rcParam, rcInvalid );
-    * name = self -> namelist [ idx ];
-    return 0;
-}
-
-/* Make
- */
-static KNamelist_vt_v1 vtKMDataNodeNamelist =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KMDataNodeNamelistWhack,
-    KMDataNodeNamelistCount,
-    KMDataNodeNamelistGet
-    /* end minor version 0 methods */
-};
-
-static
-rc_t KMDataNodeNamelistMake ( KNamelist **names, uint32_t count )
-{
-    rc_t rc;
-    KMDataNodeNamelist *self = calloc ( 1, sizeof * self -
-        sizeof self -> namelist + count * sizeof self -> namelist [ 0 ] );
-    if ( self == NULL )
-        rc = RC ( rcDB, rcMetadata, rcListing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KNamelistInit ( & self -> dad,
-            ( const KNamelist_vt* ) & vtKMDataNodeNamelist );
-        if ( rc == 0 )
-        {
-            * names = & self -> dad;
-            return 0;
-        }
-        
-        free ( self );
-    }
-
-    return rc;
-}
-
-/* List
- *  create metadata node listings
- */
-static
-void CC KMDataNodeListCount ( BSTNode *n, void *data )
-{
-    * ( uint32_t* ) data += 1;
-}
-
-static
-void CC KMDataNodeGrabAttr ( BSTNode *n, void *data )
-{
-    KMDataNodeNamelist *list = data;
-    list -> namelist [ list -> count ++ ] = ( ( const KMAttrNode* ) n ) -> name;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeListAttr ( const KMDataNode *self, KNamelist **names )
-{
-    if ( names == NULL )
-        return RC ( rcDB, rcMetadata, rcListing, rcParam, rcNull );
-
-    * names = NULL;
-
-    if ( self != NULL )
-    {
-        rc_t rc;
-
-        uint32_t count = 0;
-        BSTreeForEach ( & self -> attr, 0, KMDataNodeListCount, & count );
-
-        rc = KMDataNodeNamelistMake ( names, count );
-        if ( rc == 0 )
-            BSTreeForEach ( & self -> attr, 0, KMDataNodeGrabAttr, * names );
-
-        return rc;
-    }
-
-    return RC ( rcDB, rcMetadata, rcListing, rcSelf, rcNull );
-}
-
-static
-void CC KMDataNodeGrabName ( BSTNode *n, void *data )
-{
-    KMDataNodeNamelist *list = data;
-    list -> namelist [ list -> count ++ ] = ( ( const KMDataNode* ) n ) -> name;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeListChildren ( const KMDataNode *self, KNamelist **names )
-{
-    if ( names == NULL )
-        return RC ( rcDB, rcMetadata, rcListing, rcParam, rcNull );
-
-    * names = NULL;
-
-    if ( self != NULL )
-    {
-        rc_t rc;
-
-        uint32_t count = 0;
-        BSTreeForEach ( & self -> child, 0, KMDataNodeListCount, & count );
-
-        rc = KMDataNodeNamelistMake ( names, count );
-        if ( rc == 0 )
-            BSTreeForEach ( & self -> child, 0, KMDataNodeGrabName, * names );
-
-        return rc;
-    }
-
-    return RC ( rcDB, rcMetadata, rcListing, rcSelf, rcNull );
-}
diff --git a/libs/kdb/ptrieval-v1.c b/libs/kdb/ptrieval-v1.c
deleted file mode 100644
index 6324288..0000000
--- a/libs/kdb/ptrieval-v1.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "index-priv.h"
-#include "idstats-priv.h"
-
-#include <kdb/index.h>
-#include <klib/ptrie.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KPTrieIndexCCParms
- *  consistency check parameter block
- */
-typedef struct KPTrieIndexCCParms_v1 KPTrieIndexCCParms_v1;
-struct KPTrieIndexCCParms_v1
-{
-    KIdStats stats;
-    rc_t rc;
-    const KPTrieIndex_v1 *self;
-    const KIndex *outer;
-    bool key2id;
-    bool id2key;
-    bool failed;
-};
-
-/* Init
- */
-static
-void KPTrieIndexCCParmsInit_v1 ( KPTrieIndexCCParms_v1 *pb,
-    const KPTrieIndex_v1 *self, const KIndex *outer, bool key2id, bool id2key )
-{
-    KIdStatsInit ( & pb -> stats );
-    pb -> rc = 0;
-    pb -> self = self;
-    pb -> outer = outer;
-    pb -> key2id = key2id;
-    pb -> id2key = self -> id2node ? id2key : false;
-    pb -> failed = false;
-}
-
-/* Whack
- */
-static
-void KPTrieIndexCCParmsWhack_v1 ( KPTrieIndexCCParms_v1 *pb )
-{
-    KIdStatsWhack ( & pb -> stats );
-}
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v1
- *  persisted keymap
- */
-
-/* CheckConsistency
- *  runs a consistency check as efficiently as possible
- *
- *  in all cases, we make use of "PTrieForEach" to visit each node
- *  using the natural storage order. each node returned is counted,
- *  read and inserted into a BSTree whose nodes merge adjacent and
- *  overlapping ids into existing nodes.
- *
- *  if running a deep "key->id" test, then the key is first regenerated
- *  from the node, and then used to retrieve the id via the KIndex.
- *
- *  if the projection index exists, the id is tested against the node
- *  to ensure that projection works. if "id->key" is true, then use
- *  the KIndex to produce a key and compare it against the node.
- */
-static
-bool CC KPTrieIndexCCVisit_v1 ( PTNode *n, void *data )
-{
-    KPTrieIndexCCParms_v1 *pb = data;
-    const KPTrieIndex_v1 *self = pb -> self;
-
-    /* payload of v1 PTNode is a 32-bit spot id */
-    uint32_t id;
-    assert ( n -> data . size == sizeof id );
-    memcpy ( & id, n -> data . addr, sizeof id );
-    if ( self -> byteswap )
-        id = bswap_32 ( id );
-
-    /* record the node, row id, and range of 1 */
-    pb -> rc = KIdStatsInsert ( & pb -> stats, id, 1 );
-    if ( pb -> rc != 0 )
-    {
-        PLOGERR ( klogSys, ( klogSys, pb -> rc, "failed when examining node id $(nid) with row id $(rid)",
-                              "nid=0x%08x,rid=%u", n -> id, id ));
-        return true;
-    }
-
-    /* if we have a projection index, test it */
-    if ( self -> id2node != NULL )
-    {
-        if ( id < self -> first || id > self -> last )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn, "node id $(nid) with row id $(rid) is not within projection range of $(min_rid)..$(max_rid)",
-                                 "nid=0x%08x,rid=%u,min_rid=%u,max_rid=%u", n -> id, id, self -> first, self -> last ));
-            pb -> failed = true;
-            return false;
-        }
-        if ( self -> id2node [ id - self -> first ] != n -> id )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn, "node id $(nid) with row id $(rid) does not match projection node id of $(pnid)",
-                                 "nid=0x%08x,rid=%u,pnid=0x%08x", n -> id, id, self -> id2node [ id - self -> first ] ));
-            pb -> failed = true;
-            return false;
-        }
-    }
-
-    /* if performing deeper tests */
-    if ( pb -> key2id || pb -> id2key )
-    {
-        rc_t rc;
-        int64_t start_id;
-        uint64_t id_count;
-
-        /* need to recover key from given node */
-        const String *orig;
-        pb -> rc = PTNodeMakeKey ( n, & orig );
-        if ( pb -> rc != 0 )
-        {
-            PLOGERR ( klogSys, ( klogSys, pb -> rc, "failed when retrieving text for node id $(nid) with row id $(rid)",
-                                 "nid=0x%08x,rid=%u", n -> id, id ));
-            return true;
-        }
-
-        /* key->id test */
-        if ( pb -> key2id )
-        {
-            rc = KIndexFindText ( pb -> outer, orig -> addr, & start_id, & id_count, NULL, NULL );
-            if ( rc != 0 )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "failed to retrieve start id and count for key '$(key)', row id $(rid)",
-                                      "key=%S,rid=%u", orig, id ) );
-                pb -> failed = true;
-            }
-            else if ( start_id != ( int64_t ) id || id_count != 1 )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "key '$(key)' maps to start id $(start_id), count $(id_count): expected id $(rid), count 1.",
-                                      "key=%S,rid=%u,start_id=%ld,id_count=%lu", orig, id, start_id, id_count ) );
-                pb -> failed = true;
-            }
-        }
-
-        /* id->key test */
-        if ( pb -> id2key )
-        {
-            char buffer [ 256 ], *key = buffer;
-            size_t key_size, bsize = sizeof buffer;
-            if ( sizeof buffer <= orig -> size )
-            {
-                key = malloc ( bsize = orig -> size + 1 );
-                if ( key == 0 )
-                {
-                    pb -> rc = RC ( rcDB, rcIndex, rcValidating, rcMemory, rcExhausted );
-                    StringWhack ( ( String* ) orig );
-                    return true;
-                }
-            }
-
-            rc = KIndexProjectText ( pb -> outer, id, & start_id, & id_count, key, bsize, & key_size );
-            if ( rc != 0 )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "failed to retrieve key, start id and count for row id $(rid)",
-                                      "rid=%u", id ) );
-                pb -> failed = true;
-            }
-            else
-            {
-                if ( orig -> size != key_size || memcmp ( orig -> addr, key, key_size ) != 0 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "row $(rid) maps to key '$(key)': expected key '$(orig)'.",
-                                          "rid=%u,key=%.*s,orig=%S", id, ( int ) key_size, key, orig ) );
-                    pb -> failed = true;
-                }
-                if ( start_id != ( int64_t ) id || id_count != 1 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "single row $(rid) maps to start id $(start_id), count $(id_count).",
-                                          "rid=%u,id_count=%u,start_id=%ld", id, id_count, start_id ) );
-                    pb -> failed = true;
-                }
-            }
-
-            if ( key != buffer )
-                free ( key );
-        }
-
-        StringWhack ( ( String* ) orig );
-    }
-
-    return false;
-}
-
-rc_t KPTrieIndexCheckConsistency_v1 ( const KPTrieIndex_v1 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    const KIndex *outer, bool key2id, bool id2key )
-{
-    rc_t rc = 0;
-    KPTrieIndexCCParms_v1 pb;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcParam, rcNull );
-
-    if ( ( key2id || id2key ) && outer == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcSelf, rcNull );
-
-    KPTrieIndexCCParmsInit_v1 ( & pb, self, outer, key2id, id2key );
-    if ( PTrieDoUntil ( self -> key2id, KPTrieIndexCCVisit_v1, & pb ) )
-        rc = pb . rc;
-    else if ( pb . failed )
-        rc = RC ( rcDB, rcIndex, rcValidating, rcSelf, rcCorrupt );
-
-    if ( start_id != NULL )
-        * start_id = pb . stats . i_min_id;
-    if ( id_range != NULL )
-        * id_range = ( uint32_t ) ( pb . stats . x_max_id - pb . stats . i_min_id );
-    if ( num_keys != NULL )
-        * num_keys = pb . stats . num_entries;
-    if ( num_rows != NULL )
-        * num_rows = pb . stats . num_ids;
-    if ( num_holes != NULL )
-        * num_holes = pb . stats . num_holes;
-
-    KPTrieIndexCCParmsWhack_v1 ( & pb );
-    return rc;
-}
diff --git a/libs/kdb/ptrieval-v2.c b/libs/kdb/ptrieval-v2.c
deleted file mode 100644
index 7a8b939..0000000
--- a/libs/kdb/ptrieval-v2.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "index-priv.h"
-#include "idstats-priv.h"
-
-#include <kdb/index.h>
-#include <klib/ptrie.h>
-#include <klib/pack.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * KPTrieIndexCCParms
- *  consistency check parameter block
- */
-typedef struct KPTrieIndexCCParms_v2 KPTrieIndexCCParms_v2;
-struct KPTrieIndexCCParms_v2
-{
-    KIdStats stats;
-    rc_t rc;
-    const KPTrieIndex_v2 *self;
-    const KIndex *outer;
-    bool key2id;
-    bool id2key;
-    bool all_ids;
-    bool convertFromV1;
-    bool failed;
-};
-
-/* Init
- */
-static
-void KPTrieIndexCCParmsInit_v2 ( KPTrieIndexCCParms_v2 *pb,
-    const KPTrieIndex_v2 *self, const KIndex *outer, bool key2id, bool id2key, bool all_ids, bool convertFromV1 )
-{
-    KIdStatsInit ( & pb -> stats );
-    pb -> rc = 0;
-    pb -> self = self;
-    pb -> outer = outer;
-    pb -> key2id = key2id;
-    pb -> id2key = self -> ord2node ? id2key : false;
-    pb -> all_ids = all_ids;
-    pb -> convertFromV1 = convertFromV1;
-    pb -> failed = false;
-}
-
-/* Whack
- */
-static
-void KPTrieIndexCCParmsWhack_v2 ( KPTrieIndexCCParms_v2 *pb )
-{
-    KIdStatsWhack ( & pb -> stats );
-}
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v2
- *  persisted keymap
- */
-
-/* CheckConsistency
- *  runs a consistency check as efficiently as possible
- *
- *  in all cases, we make use of "PTrieForEach" to visit each node
- *  using the natural storage order. each node returned is counted,
- *  read and inserted into a BSTree whose nodes merge adjacent and
- *  overlapping ids into existing nodes.
- *
- *  if running a deep "key->id" test, then the key is first regenerated
- *  from the node, and then used to retrieve the id via the KIndex.
- *
- *  if the projection index exists, the id is tested against the node
- *  to ensure that projection works. if "id->key" is true, then use
- *  the KIndex to produce a key and compare it against the node.
- */
-static
-bool CC KPTrieIndexCCVisit_v2 ( PTNode *n, void *data )
-{
-    KPTrieIndexCCParms_v2 *pb = (KPTrieIndexCCParms_v2 *)data;
-    const KPTrieIndex_v2 *self = pb -> self;
-
-    rc_t rc;
-    int64_t id;
-    size_t usize;
-    uint64_t span;
-    uint32_t i, ord;
-
-    /* detect conversion from v1 */
-    if ( pb -> convertFromV1 && self -> id_bits == 0 )
-    {
-        uint32_t id32;
-
-        /* payload of v1 PTNode is a 32-bit spot id */
-        assert ( n -> data . size == sizeof id32 );
-        memcpy ( & id32, n -> data . addr, sizeof id32 );
-        id = self -> byteswap ? bswap_32 ( id32 ) : id32;
-    }
-    else
-    {
-        /* native v2 */
-        /* TBD - should this pass n -> data . size * 8 ??? */
-        if ( self -> id_bits != 0 )
-        {
-            rc = Unpack ( self -> id_bits, sizeof id * 8,
-                n -> data . addr, 0, self -> id_bits, NULL,
-                & id, sizeof id, & usize );
-            if ( rc != 0 )
-            {
-                PLOGMSG ( klogWarn, ( klogWarn, "could not determine row id of v2 node $(nid)",
-                                 "nid=0x%08x", n -> id ));
-                pb -> failed = true;
-                return false;
-            }
-        }
-        else
-        {
-            id = 0;
-        }
-
-        id += self -> first;
-    }
-
-    /* convert from row-id to 1-based ordinal index */
-    ord = KPTrieIndexID2Ord_v2 ( self, id );
-    if ( ord == 0 )
-    {
-        /* 0 means not found */
-        PLOGMSG ( klogWarn, ( klogWarn, "v2 node $(nid): row id $(rid) not found in trie",
-                              "nid=0x%08x,rid=%ld", n -> id, id ));
-        pb -> failed = true;
-        return false;
-    }
-
-    if ( self -> ord2node != NULL )
-    {
-        /* to calculate span of last entry, where
-           1-based "ord" == the number of nodes,
-           just find the distance between the last row-id
-           in index ( self->maxid ) and the current row-id */
-        if ( ord == self -> count )
-            span = self -> maxid - id + 1;
-        else
-        {
-            /* from here on, we will use "ord" to be the
-               ZERO-BASED index of the slot FOLLOWING the
-               one corresponding to id. we want to find the
-               row-id AFTER the current one and calculate distance */
-            switch ( self -> variant )
-            {
-            /* linear array */
-            case 0:
-                /* starting with the FOLLOWING slot,
-                   count duplicate entries */
-                for ( i = ord; i < self -> count; ++ i )
-                {
-                    if ( n -> id != self -> ord2node [ i ] )
-                        break;
-                }
-                span = self -> first + i - id;
-                break;
-
-            /* packed ordered array of sparse row-ids from here on
-               we already have "id" for this node, so the span will
-               be the distance from NEXT id - 1-based ord is 0-based next */
-            case 1:
-                span = self -> first + self -> id2ord . v8 [ ord ] - id;
-                break;
-            case 2:
-                span = self -> first + self -> id2ord . v16 [ ord ] - id;
-                break;
-            case 3:
-                span = self -> first + self -> id2ord . v32 [ ord ] - id;
-                break;
-            case 4:
-                span = self -> first + self -> id2ord . v64 [ ord ] - id;
-                break;
-            default:
-                PLOGMSG ( klogErr, ( klogErr, "PTrie v2 index has bad variant code: $(variant)",
-                                     "variant=%u", self -> variant ));
-                pb -> rc = RC ( rcDB, rcIndex, rcValidating, rcIndex, rcCorrupt );
-                return true;
-            }
-        }
-    }
-    else if ( self -> span_bits == 0 )
-        span = 1;
-    else
-    {
-        /* TBD - this case is never used in practice.
-           it would be an skey without a projection index */
-        rc = Unpack ( self -> span_bits, sizeof span * 8,
-                      n -> data . addr, 0, self -> id_bits, NULL,
-                      & span, sizeof span, & usize );
-        if ( rc != 0 )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn, "could not determine span of v2 node $(nid), row id $(rid)",
-                                  "nid=0x%08x,rid=%ld", n -> id, id ));
-            pb -> failed = true;
-            return false;
-        }
-    }
-
-    /* record the node, row id, span */
-    pb -> rc = KIdStatsInsert ( & pb -> stats, id, span );
-    if ( pb -> rc != 0 )
-    {
-        PLOGERR ( klogSys, ( klogSys, pb -> rc, "failed when examining node id $(nid) with row id $(rid), span $(span)",
-                             "nid=0x%08x,span=%u,rid=%ld", n -> id, span, id ));
-        return true;
-    }
-
-    /* if we have a projection index, test it */
-    if ( self -> ord2node != NULL )
-    {
-        if ( id < self -> first || id > self -> last )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn, "node id $(nid) with row id $(rid) is not within projection range of $(min_rid)..$(max_rid)",
-                                 "nid=0x%08x,rid=%ld,min_rid=%ld,max_rid=%ld",
-                                  n -> id, id, self -> first, self -> last ));
-            pb -> failed = true;
-            return false;
-        }
-        for ( i = 0; i < span; ++ i )
-        {
-            if ( self -> ord2node [ i + ord - 1 ] != n -> id )
-            {
-                PLOGMSG ( klogWarn, ( klogWarn, "node id $(nid) with row id $(rid) does not match projection node id of $(pnid)",
-                                      "nid=0x%08x,rid=%ld,pnid=0x%08x", n -> id, id + 1, self -> ord2node [ i + ord - 1 ] ));
-                pb -> failed = true;
-                return false;
-            }
-            if ( ! pb -> all_ids || self -> variant != 0 )
-                break;
-        }
-    }
-
-    /* if performing deeper tests */
-    if ( pb -> key2id || pb -> id2key )
-    {
-        int64_t start_id;
-        uint64_t id_count;
-
-        /* need to recover key from given node */
-        const String *orig;
-        pb -> rc = PTNodeMakeKey ( n, & orig );
-        if ( pb -> rc != 0 )
-        {
-            PLOGERR ( klogSys, ( klogSys, pb -> rc, "failed when retrieving text for node id $(nid) with row id $(rid)",
-                                 "nid=0x%08x,rid=%u", n -> id, id ));
-            return true;
-        }
-
-        /* key->id test */
-        if ( pb -> key2id )
-        {
-            rc = KIndexFindText ( pb -> outer, orig -> addr, & start_id, & id_count, NULL, NULL );
-            if ( rc != 0 )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "failed to retrieve start id and count for key '$(key)', row id $(rid)",
-                                      "key=%S,rid=%u", orig, id ) );
-                pb -> failed = true;
-            }
-            else if ( start_id != ( int64_t ) id || id_count != span )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "key '$(key)' maps to start id $(start_id), count $(id_count): expected id $(rid), count 1.",
-                                      "key=%S,rid=%u,start_id=%ld,id_count=%lu", orig, id, start_id, id_count ) );
-                pb -> failed = true;
-            }
-        }
-
-        /* id->key test */
-        if ( pb -> id2key )
-        {
-            char buffer [ 256 ], *key = buffer;
-            size_t key_size, bsize = sizeof buffer;
-            if ( sizeof buffer <= orig -> size )
-            {
-                key = (char *)malloc ( bsize = orig -> size + 1 );
-                if ( key == 0 )
-                {
-                    pb -> rc = RC ( rcDB, rcIndex, rcValidating, rcMemory, rcExhausted );
-                    StringWhack ( ( String* ) orig );
-                    return true;
-                }
-            }
-
-            for ( i = 0; i < span; ++ i )
-            {
-                rc = KIndexProjectText ( pb -> outer, id + i, & start_id, & id_count, key, bsize, & key_size );
-                if ( rc != 0 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "failed to retrieve key, start id and count for row id $(rid)",
-                                          "rid=%u", id + i ) );
-                    pb -> failed = true;
-                    break;
-                }
-
-                if ( orig -> size != key_size || memcmp ( orig -> addr, key, key_size ) != 0 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "row $(rid) maps to key '$(key)': expected key '$(orig)'.",
-                                          "rid=%u,key=%.*s,orig=%S", id + i, ( int ) key_size, key, orig ) );
-                    pb -> failed = true;
-                }
-                if ( start_id != id || id_count != ( uint64_t ) span )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "row $(rid) maps to start id $(start_id), count $(id_count): expected $(row_start), $(span).",
-                                          "rid=%u,id_count=%lu,start_id=%ld,row_start=%ld,span=%u",
-                                          id, id_count, start_id, id, span ) );
-                    pb -> failed = true;
-                }
-
-                if ( ! pb -> all_ids || pb -> failed )
-                    break;
-            }
-
-            if ( key != buffer )
-                free ( key );
-        }
-
-        StringWhack ( ( String* ) orig );
-    }
-
-    return false;
-}
-
-rc_t KPTrieIndexCheckConsistency_v2 ( const KPTrieIndex_v2 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    const KIndex *outer, bool key2id, bool id2key, bool all_ids, bool convertFromV1 )
-{
-    rc_t rc = 0;
-    KPTrieIndexCCParms_v2 pb;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcParam, rcNull );
-
-    if ( ( key2id || id2key ) && outer == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcSelf, rcNull );
-
-    KPTrieIndexCCParmsInit_v2 ( & pb, self, outer, key2id, id2key, all_ids, convertFromV1 );
-    if ( PTrieDoUntil ( self -> key2id, KPTrieIndexCCVisit_v2, & pb ) )
-        rc = pb . rc;
-    else if ( pb . failed )
-        rc = RC ( rcDB, rcIndex, rcValidating, rcSelf, rcCorrupt );
-
-    if ( start_id != NULL )
-        * start_id = pb . stats . i_min_id;
-    if ( id_range != NULL )
-        * id_range = pb . stats . x_max_id - pb . stats . i_min_id;
-    if ( num_keys != NULL )
-        * num_keys = pb . stats . num_entries;
-    if ( num_rows != NULL )
-        * num_rows = pb . stats . num_ids;
-    if ( num_holes != NULL )
-        * num_holes = pb . stats . num_holes;
-
-    KPTrieIndexCCParmsWhack_v2 ( & pb );
-    return rc;
-}
diff --git a/libs/kdb/table-cc.c b/libs/kdb/table-cc.c
deleted file mode 100644
index 17bcb4a..0000000
--- a/libs/kdb/table-cc.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- *============================================================================
- *
- */
-
-#include <kdb/extern.h>
-
-#define KONST const
-#include "index-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "table-priv.h"
-#include "kdb-priv.h"
-#include "column-priv.h"
-#undef KONST
-
-#include "cc-priv.h"
-
-#include <kdb/index.h>
-#include <kdb/meta.h>
-#include <kdb/kdb-priv.h>
-
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <klib/refcount.h>
-#include <klib/log.h> /* PLOGMSG */
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <kdb/namelist.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-#undef index
-
-static void KTableGetName(KTable const *self, char const **rslt)
-{
-    char *sep;
-    
-    *rslt = self->path;
-    sep = strrchr(self->path, '/');
-    if (sep != NULL)
-        *rslt = sep + 1;
-}
-
-static
-rc_t KTableCheckMD5 ( const KTable *self, CCReportFunc report, void *ctx )
-{
-    CCReportInfoBlock info;
-    memset ( & info, 0, sizeof info );
-
-    info.objType = kptTable;
-    KTableGetName(self, &info.objName);
-    
-    return DirectoryCheckMD5 ( self->dir, "md5", & info, report, ctx );
-}
-
-#if 0
-static bool KTableCheckColumnsFilter(const KDirectory *dir, const char *name, void *data)
-{
-    return (KDirectoryPathType(dir, name) & ~kptAlias) == kptDir;
-}
-#endif
-
-typedef struct KTableCheckColumn_pb_s {
-    KTable const *self;
-    CCReportFunc report;
-    void *rpt_ctx;
-    unsigned n;
-    int level;
-    uint32_t depth;
-    INSDC_SRA_platform_id platform;
-} KTableCheckColumn_pb_t;
-
-static rc_t CC KTableCheckColumn(const KDirectory *dir, uint32_t type, const char *name, void *data)
-{
-    KTableCheckColumn_pb_t *pb = (KTableCheckColumn_pb_t *)data;
-    CCReportInfoBlock info;
-    
-    memset(&info, 0, sizeof(info));
-    
-    if ((type & ~kptAlias) != kptDir) {
-        char mesg[4096];
-        
-        snprintf(mesg, sizeof(mesg), "unexpected object '%s'", name);
-        KTableGetName(pb->self, &info.objName);
-        info.objId = 0;
-        info.objType = kptTable;
-        info.type = ccrpt_Done;
-        info.info.done.mesg = mesg;
-        info.info.done.rc = 0;
-        return pb->report(&info, pb->rpt_ctx);
-    }
-    else {
-        bool hasZombies;
-        INSDC_SRA_platform_id platform = pb->platform;
-        uint32_t ktype = KDBPathType(dir, &hasZombies, name);
-        rc_t rc;
-        
-        info.objType = kptColumn;
-        info.objId = pb->n++;
-        info.objName = name;
-        info.type = ccrpt_Visit;
-        info.info.visit.depth = pb->depth + 1;
-        rc = pb->report(&info, pb->rpt_ctx);
-        if (rc) return rc;
-        
-        info.type = ccrpt_Done;
-        
-        if (hasZombies) {
-#if 0
-            info.info.done.rc = RC(rcDB, rcTable, rcValidating, rcFile, rcTooShort);
-#else
-            info.info.done.rc = 0;
-#endif
-            info.info.done.mesg = "Column may be truncated";
-            rc = pb->report(&info, pb->rpt_ctx);
-            if (rc) return rc;
-        }
-        info.info.done.rc = RC(rcDB, rcTable, rcValidating, rcType, rcIncorrect);
-        if ((ktype & ~kptAlias) == kptColumn) {
-            const KColumn *col;
-            
-            info.info.done.rc = KTableOpenColumnRead(pb->self, &col, name);
-            if (info.info.done.rc == 0) {
-                info.info.done.rc = KColumnConsistencyCheck(col, pb->level, &info, pb->report, pb->rpt_ctx);
-                KColumnRelease(col);
-                return info.info.done.rc;
-            }
-        }
-        if (platform != SRA_PLATFORM_UNDEFINED && platform != SRA_PLATFORM_454
-            && name != NULL && name[0] != '\0' && strcmp(name, "SIGNAL") == 0)
-        {
-            (void)PLOGMSG(klogWarn, (klogWarn, "COLUMN '$(name)' IS INCOMPLETE",
-                "name=%s", name));
-            return 0;
-        }
-        info.info.done.mesg = "Failed to open column";
-        return pb->report(&info, pb->rpt_ctx);
-    }
-}
-
-static
-rc_t KTableCheckColumns ( const KTable *self, uint32_t depth, int level,
-    CCReportFunc report, void *ctx, INSDC_SRA_platform_id platform )
-{
-    KTableCheckColumn_pb_t pb;
-    
-    pb.self = self;
-    pb.report = report;
-    pb.rpt_ctx = ctx;
-    pb.n = 0;
-    pb.level = level;
-    pb.depth = depth;
-    pb.platform = platform;
-    return KDirectoryVVisit(self->dir, false, KTableCheckColumn, &pb, "col", NULL);
-}
-
-static
-rc_t KTableCheckIndexMD5(const KDirectory *dir,
-                         CCReportInfoBlock *nfo,
-                         CCReportFunc report, void *ctx)
-{
-    char md5[4096];
-
-    snprintf(md5, sizeof(md5), "%s.md5", nfo->objName);
-    if (KDirectoryPathType(dir, md5) != kptNotFound)
-        return DirectoryCheckMD5(dir, md5, nfo, report, ctx);
-    return 0;
-}
-
-static const KDirectory *KTableFindIndexDir(const KTable *self)
-{
-    const KDirectory *idxDir;
-    
-    rc_t rc = KDirectoryOpenDirRead ( self -> dir, & idxDir, false, "idx" );
-    if ( rc == 0 )
-        return idxDir;
-
-    /* some old tables have a single index at table level */
-    KDirectoryAddRef ( self -> dir );
-    return self -> dir;
-}
-
-static
-rc_t KTableCheckIndices(const KTable *self, uint32_t depth, int level, CCReportFunc report, void *ctx)
-{
-    uint32_t n;
-    const KMetadata *meta;
-    int64_t max_row_id = 0;
-
-    KNamelist *list;
-    rc_t rc = KTableListIdx(self, &list);
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) == rcNotFound )
-            return 0;
-        return rc;
-    }
-
-    rc = KTableOpenMetadataRead ( self, & meta );
-    if ( rc == 0 )
-    {
-        const KMDataNode *seq;
-        rc = KMetadataOpenNodeRead ( meta, & seq, "/.seq/spot" );
-        if ( rc == 0 )
-        {
-            rc = KMDataNodeReadAsI64 ( seq, & max_row_id );
-            if ( rc != 0 )
-                max_row_id = 0;
-            KMDataNodeRelease ( seq );
-        }
-
-        KMetadataRelease ( meta );
-    }
-
-    rc = KNamelistCount(list, &n);
-    if ( rc == 0 )
-    {
-        const KDirectory *idxDir = KTableFindIndexDir ( self );
-        if ( idxDir == NULL )
-            rc = RC ( rcDB, rcTable, rcValidating, rcDirectory, rcNull );
-        else
-        {
-            CCReportInfoBlock nfo;
-            memset(&nfo, 0, sizeof(nfo));
-            nfo.objType = kptIndex;
-
-            for ( nfo . objId = 0; rc == 0 && nfo . objId != (int) n; ++ nfo . objId)
-            {
-                rc = KNamelistGet(list, nfo.objId, &nfo.objName);
-                if ( rc != 0 )
-                    break;
-                
-                nfo.type = ccrpt_Visit;
-                nfo.info.visit.depth = depth + 1;
-                rc = report(&nfo, ctx); if (rc) break;
-                
-                rc = KTableCheckIndexMD5(idxDir, &nfo, report, ctx);
-                if (rc == 0 && level > 0)
-                {
-                    const KIndex *idx;
-                    rc = KTableOpenIndexRead(self, &idx, nfo.objName);
-
-                    if ( rc != 0 )
-                    {
-                        nfo.type = ccrpt_Done;
-                        nfo.info.done.rc = rc;
-                        nfo.info.done.mesg = "could not be opened";
-                    }
-                    else
-                    {
-                        KIndexSetMaxRowId ( idx, max_row_id );
-
-                        nfo.type = ccrpt_Index;
-                        rc = KIndexConsistencyCheck(idx, level < 3 ? 1 : 3,
-                                                    &nfo.info.index.start_id,
-                                                    &nfo.info.index.id_range,
-                                                    &nfo.info.index.num_keys,
-                                                    &nfo.info.index.num_rows,
-                                                    &nfo.info.index.num_holes);
-                        KIndexRelease ( idx );
-                        if ( rc != 0 )
-                        {
-                            nfo.type = ccrpt_Done;
-                            nfo.info.done.rc = rc;
-                            nfo.info.done.mesg = "could not be validated";
-                        }
-                    }
-
-                    rc = report(&nfo, ctx);
-                }
-            }
-
-            KDirectoryRelease(idxDir);
-        }
-    }
-
-    KNamelistRelease(list);
-
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KTableConsistencyCheck(const KTable *self, uint32_t depth, uint32_t level,
-    CCReportFunc report, void *ctx, INSDC_SRA_platform_id platform)
-{
-    rc_t rc = 0;
-    uint32_t type;
-    
-    bool indexOnly = level & CC_INDEX_ONLY;
-    if (indexOnly) {
-        level &= ~CC_INDEX_ONLY;
-    }
-
-    if (self == NULL)
-        return RC(rcDB, rcTable, rcValidating, rcSelf, rcNull);
-    
-    if (depth == 0) {
-        CCReportInfoBlock info;
-        
-        KTableGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptTable;
-        info.type = ccrpt_Visit;
-        info.info.visit.depth = 0;
-        
-        rc = report(&info, ctx);
-        if (rc) return rc;
-    }
-    
-    type = KDirectoryPathType(self->dir, "md5");
-    if (type == kptZombieFile) {
-        CCReportInfoBlock info;
-        
-        KTableGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptTable;
-        info.type = ccrpt_Done;
-        info.info.done.mesg = "Table may be truncated";
-        info.info.done.rc = 0;
-        
-        rc = report(&info, ctx);
-    }
-    else if (type != kptNotFound) {
-        if (!indexOnly) {
-            rc = KTableCheckMD5(self, report, ctx);
-        }
-    }
-    else {
-        CCReportInfoBlock info;
-        
-        KTableGetName(self, &info.objName);
-        info.objId = 0;
-        info.objType = kptTable;
-        info.type = ccrpt_Done;
-        info.info.done.mesg = "missing md5 file";
-        info.info.done.rc = 0;
-        
-        rc = report(&info, ctx);
-    }
-
-    if ( rc == 0 && ! indexOnly )
-        rc = KTableCheckColumns(self, depth, level, report, ctx, platform);
-
-    if ( rc == 0 )    
-        rc = KTableCheckIndices(self, depth, level, report, ctx);
-        
-    return rc;
-}
diff --git a/libs/kdb/table-priv.h b/libs/kdb/table-priv.h
deleted file mode 100644
index 7b26462..0000000
--- a/libs/kdb/table-priv.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_table_priv_
-#define _h_table_priv_
-
-#ifndef _h_kdb_table_
-#include <kdb/table.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDatabase;
-struct KDBManager;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KTable
- *  represents a table
- *  normally implemented as a directory
- *  but may be a single archive file
- *  in either executable or streamable format
- */
-struct KTable
-{
-    struct KDirectory const *dir;
-    struct KDBManager const *mgr;
-    struct KDatabase const *db;
-    KRefcount refcount;
-    uint8_t prerelease;
-    char path [ 1 ];
-};
-
-/* Attach
- * Sever
- *  like KTableRelease, except called internally
- *  indicates that a child object is letting go...
- */
-KTable *KTableAttach ( const KTable *self );
-rc_t KTableSever ( const KTable *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_table_priv_ */
diff --git a/libs/kdb/table.c b/libs/kdb/table.c
deleted file mode 100644
index 3072e5a..0000000
--- a/libs/kdb/table.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "table-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "kdb-priv.h"
-#undef KONST
-
-#include <kdb/extern.h>
-#include <klib/namelist.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-
-/* GetPath
- *  return the absolute path to table
- */
-LIB_EXPORT rc_t CC KTableGetPath ( const KTable *self,
-    const char **path )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-
-    *path = self->path;
-
-    return 0;
-}
-
-/* Whack
- */
-static
-rc_t KTableWhack ( KTable *self )
-{
-    rc_t rc = 0;
-
-    KRefcountWhack ( & self -> refcount, "KTable" );
-
-    if ( self -> db != NULL )
-    {
-        rc = KDatabaseSever ( self -> db );
-        if ( rc == 0 )
-            self -> db = NULL;
-    }
-
-    if ( rc == 0 )
-        rc = KDBManagerSever ( self -> mgr );
-
-    if ( rc == 0 )
-    {
-        KDirectoryRelease ( self -> dir );
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KTable", "whack", "ktbl" );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KTableAddRef ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KTable" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcTable, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTableRelease ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KTable" ) )
-        {
-        case krefWhack:
-            return KTableWhack ( ( KTable* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- */
-KTable *KTableAttach ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KTable" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KTable* ) self;
-}
-
-/* Sever
- *  like KTableRelease, except called internally
- *  indicates that a child object is letting go...
- */
-rc_t KTableSever ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KTable" ) )
-        {
-        case krefWhack:
-            return KTableWhack ( ( KTable* ) self );
-        case krefNegative:
-            return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Make
- *  make an initialized structure
- *  NB - does NOT attach reference to dir, but steals it
- */
-static
-rc_t KTableMake ( KTable **tblp, const KDirectory *dir, const char *path )
-{
-    KTable *tbl;
-
-    assert ( tblp != NULL );
-    assert ( path != NULL );
-
-    tbl = malloc ( sizeof * tbl + strlen ( path ) );
-    if ( tbl == NULL )
-    {
-        * tblp = NULL;
-        return RC ( rcDB, rcTable, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    memset ( tbl, 0, sizeof * tbl );
-    tbl -> dir = dir;
-    KRefcountInit ( & tbl -> refcount, 1, "KTable", "make", path );
-    strcpy ( tbl -> path, path );
-
-    * tblp = tbl;
-    return 0;
-}
-
-
-/* OpenTableRead
- * VOpenTableRead
- *  open a table for read
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-static
-rc_t KDBManagerVOpenTableReadInt ( const KDBManager *self,
-    const KTable **tblp, const KDirectory *wd, bool try_srapath,
-    const char *path, va_list args )
-{
-    rc_t rc;
-
-    char tblpath [ 4096 ];
-    int z = ( args == NULL ) ?
-        snprintf ( tblpath, sizeof tblpath, path ):
-        vsnprintf ( tblpath, sizeof tblpath, path, args );
-    if ( z < 0 || ( size_t ) z >= sizeof tblpath )
-        rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
-    else
-    {
-        KTable *tbl;
-        const KDirectory *dir;
-        bool prerelease = false;
-
-        rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptTable, NULL, try_srapath );
-        if ( rc != 0 )
-        {
-            prerelease = true;
-            rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptPrereleaseTbl, NULL, try_srapath );
-        }
-
-        if ( rc == 0 )
-        {
-            rc = KTableMake ( & tbl, dir, tblpath );
-            if ( rc == 0 )
-            {
-                tbl -> mgr = KDBManagerAttach ( self );
-                tbl -> prerelease = prerelease;
-                * tblp = tbl;
-                return 0;
-            }
-            KDirectoryRelease ( dir );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerOpenTableRead ( const KDBManager *self,
-    const KTable **tbl, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenTableRead ( self, tbl, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerVOpenTableRead ( const KDBManager *self,
-    const KTable **tbl, const char *path, va_list args )
-{
-    if ( tbl == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * tbl = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenTableReadInt ( self, tbl, self -> wd, true, path, args);
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenTableRead ( const KDatabase *self,
-    const KTable **tbl, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenTableRead ( self, tbl, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenTableRead ( const KDatabase *self,
-    const KTable **tblp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( tblp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * tblp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "tbl", 3, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenTableReadInt ( self -> mgr, tblp,
-            self -> dir, false, path, NULL );
-        if ( rc == 0 )
-        {
-            KTable *tbl = ( KTable* ) * tblp;
-            tbl -> db = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KTableLocked ( const KTable *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT bool CC KTableVExists ( const KTable *self, uint32_t type, const char *name, va_list args )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptIndex:
-            ns = "idx";
-            break;
-
-        case kptColumn:
-            ns = "col";
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name, args );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile:
-            case kptDir:
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC KTableExists ( const KTable *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KTableVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-LIB_EXPORT bool CC KTableIsAlias ( const KTable *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptIndex:
-            ns = "idx";
-            break;
-
-        case kptColumn:
-            ns = "col";
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                if ( resolved != NULL && rsize != 0 )
-                {
-                    const KDirectory *sub;
-                    rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
-                    * resolved = 0;
-                    if ( rc != 0 )
-                        PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
-                    else
-                    {
-                        rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
-                        KDirectoryRelease ( sub );
-                        if ( rc != 0 )
-                            PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
-                    }
-                }
-                return true;
-            }
-        }
-    }
-
-    if ( resolved != NULL && rsize != 0 )
-        * resolved = 0;
-
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KTableVWritable ( const KTable *self, uint32_t type, const char *name, va_list args )
-{
-    /* TBD */
-    return -1;
-}
-
-LIB_EXPORT rc_t CC KTableWritable ( const KTable *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = KTableVWritable ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KTableOpenManagerRead ( const KTable *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KTableOpenParentRead ( const KTable *self, const KDatabase **db )
-{
-    rc_t rc;
-
-    if ( db == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> db );
-            if ( rc == 0 )
-            {
-                * db = self -> db;
-                return 0;
-            }
-        }
-
-        * db = NULL;
-    }
-
-    return rc;
-}
-
-
-/* GetDirectory
- *  access the directory in use
- */
-LIB_EXPORT rc_t CC KTableOpenDirectoryRead ( const KTable *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-
-/* ModDate
- *  get modification date
- */
-LIB_EXPORT rc_t CC KTableModDate ( const KTable *self, KTime_t *mtime )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            /* HACK ALERT - there needs to be a proper way to record modification times */
-            const KDirectory *dir = self -> dir;
-
-            /* this only tells the last time the table was locked,
-               which may be close to the last time it was modified */
-            rc = KDirectoryDate ( dir, mtime, "lock" );
-            if ( rc == 0 )
-                return 0;
-
-            if ( GetRCState ( rc ) == rcNotFound )
-            {
-                rc = KDirectoryDate ( dir, mtime, "sealed" );
-                if ( rc == 0 )
-                    return 0;
-            }
-
-            /* get directory timestamp */
-            rc = KDirectoryDate ( dir, mtime, "." );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * mtime = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-
-/* List
- *  create table listings
- */
-struct FilterData
-{
-    const KDBManager * mgr;
-    int type;
-};
-
-static
-bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
-{
-    struct FilterData * data = data_;
-    return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
-}
-
-LIB_EXPORT rc_t CC KTableListCol ( const KTable *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-
-        data.mgr = self->mgr;
-        data.type = kptColumn;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "col", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
-}
-
-static
-bool CC KTableListIdxFilter ( const KDirectory *dir, const char *name, void *data )
-{
-    const size_t sz = strlen(name);
-    
-    if (sz > 4 && strcmp(&name[sz - 4], ".md5") == 0)
-        return false;
-    return true;
-}
-
-static
-bool CC KTableListSkeyFilter ( const KDirectory *dir, const char *name, void *data )
-{
-    if ( strcmp ( name, "skey" ) == 0 )
-        return true;
-    return false;
-}
-
-LIB_EXPORT rc_t CC KTableListIdx ( const KTable *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        if ( ! self -> prerelease )
-        {
-            return KDirectoryVList ( self -> dir,
-                names, KTableListIdxFilter, NULL, "idx", NULL );
-        }
-
-        return KDirectoryVList ( self -> dir,
-            names, KTableListSkeyFilter, NULL, ".", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
-}
diff --git a/libs/kdb/trieidx-priv.h b/libs/kdb/trieidx-priv.h
deleted file mode 100644
index a4174ff..0000000
--- a/libs/kdb/trieidx-priv.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_trieidx_priv_
-#define _h_trieidx_priv_
-
-#include "index-priv.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KPTrieIndexHdr_v1
- */
-typedef KIndexFileHeader_v1_v2 KPTrieIndexHdr_v1;
-
-/*--------------------------------------------------------------------------
- * KPTrieIndexHdr_v2
- */
-typedef struct KPTrieIndexHdr_v2 KPTrieIndexHdr_v2;
-struct KPTrieIndexHdr_v2
-{
-    KIndexFileHeader_v1_v2 dad;
-    int64_t first;
-    int64_t last;
-    uint16_t id_bits;
-    uint16_t span_bits;
-    uint16_t align [ 2 ];
-};
-
-/*--------------------------------------------------------------------------
- * KPTrieIndexHdr_v3
- */
-typedef struct KPTrieIndexHdr_v3 KPTrieIndexHdr_v3;
-struct KPTrieIndexHdr_v3
-{
-    struct KIndexFileHeader_v3 dad;
-    int64_t first;
-    int64_t last;
-    uint16_t id_bits;
-    uint16_t span_bits;
-    uint16_t align [ 2 ];
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _h_trieidx_priv_ */
diff --git a/libs/kdb/trieidx-v1.c b/libs/kdb/trieidx-v1.c
deleted file mode 100644
index 18e7e26..0000000
--- a/libs/kdb/trieidx-v1.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "index-priv.h"
-#include "kdbfmt-priv.h"
-#include <klib/ptrie.h>
-#include <klib/text.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <byteswap.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v1
- *  persisted keymap
- */
-
-/* KPTrieIndexInit
- *  opens and initializes persisted keymap structure
- */
-rc_t KPTrieIndexInit_v1 ( KPTrieIndex_v1 *self, const KMMap *mm, bool byteswap )
-{
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KDBHdr *hdr;
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* try to create the pttree */
-            rc = PTrieMakeOrig ( & self -> key2id,
-                hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* just in case */
-                    self -> mm = NULL;
-
-                    /* record for projection */
-                    self -> byteswap = byteswap;
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                    {
-                        self -> id2node = NULL;
-                        self -> first = self -> last = 0;
-                        return 0;
-                    }
-                            
-                    /* assume this is projection index */
-                    self -> id2node = ( void* )
-                        ( ( char* ) ( hdr + 1 ) + ptsize );
-                    size -= ptsize;
-                            
-                    /* it must have at least 4 bytes
-                       and be 4 byte aligned */
-                    if ( size >= sizeof ( uint32_t ) && ( size & 3 ) == 0 )
-                    {
-                        /* first entry is starting key
-                           remaining entries are node ids */
-                        self -> first = * self -> id2node ++;
-                        size -= sizeof self -> id2node [ 0 ];
-                        if ( size == 0 )
-                        {
-                            /* forget if empty */
-                            self -> id2node = NULL;
-                            self -> first = self -> last = 0;
-                            return 0;
-                        }
-                        /* remaining entries */
-                        self -> last = self -> first + ( size >> 2 ) - 1;
-                        return 0;
-                    }
-                }
-
-                PTrieWhack ( self -> key2id );
-                self -> key2id = NULL;
-
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* KPTrieIndexWhack_v1
- *  closes down keymap
- */
-void KPTrieIndexWhack_v1 ( KPTrieIndex_v1 *self )
-{
-    PTrieWhack ( self -> key2id );
-    KMMapRelease ( self -> mm );
-    memset ( self, 0, sizeof * self );
-}
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v1
- */
-
-/* whack whack */
-void KTrieIndexWhack_v1 ( KTrieIndex_v1 *self )
-{
-    KPTrieIndexWhack_v1 ( & self -> pt );
-}
-
-/* initialize an index from file */
-rc_t KTrieIndexOpen_v1 ( KTrieIndex_v1 *self, const KMMap *mm, bool byteswap )
-{
-    rc_t rc;
-
-    memset ( self, 0, sizeof * self );
-
-    rc = KPTrieIndexInit_v1 ( & self -> pt, mm, byteswap );
-    if ( rc == 0 )
-    {
-        rc = KMMapAddRef ( mm );
-        if ( rc == 0 )
-        {
-            self -> pt . mm = mm;
-            return 0;
-        }
-    }
-
-    KTrieIndexWhack_v1 ( self );
-    return rc;
-}
-
-/* map key to id ( was Key2Id ) */
-rc_t KTrieIndexFind_v1 ( const KTrieIndex_v1 *self, const char *str, uint32_t *id,
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void * data )
-{
-    if ( self -> pt . key2id != NULL )
-    {
-        PTNode n;
-        String key;
-        unsigned int nid;
-
-        StringInitCString ( & key, str );
-        nid = PTrieFind ( self -> pt . key2id, & key, & n, custom_cmp, data );
-        if ( nid != 0 )
-        {
-            assert ( n . data . size == sizeof * id );
-            memcpy ( id, n . data . addr, sizeof * id );
-            return 0;
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-}
-
-/* projection index id to key-string ( was Id2Key ) */
-rc_t KTrieIndexProject_v1 ( const KTrieIndex_v1 *self,
-    uint32_t id, char *key_buff, size_t buff_size, size_t *actsize)
-{
-    if ( self -> pt . id2node != NULL &&
-         id >= self -> pt . first &&
-         id <= self -> pt . last )
-    {
-        PTNode n;
-        uint32_t node = self -> pt . id2node [ id - self -> pt . first ];
-        rc_t rc = PTrieGetNode ( self -> pt . key2id,
-            & n, self -> pt . byteswap ? bswap_32 ( node ) : node );
-        if ( rc == 0 )
-        {
-            const String *key;
-            rc = PTNodeMakeKey ( & n, & key );
-            if ( rc == 0 )
-            {
-                if ( actsize != NULL )
-                    * actsize = key -> size;
-                if ( key -> size >= buff_size )
-                    rc = RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                else
-                    string_copy ( key_buff, buff_size, key -> addr, key -> size );
-
-                StringWhack ( ( String* ) key );
-            }
-            return rc;
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-}
diff --git a/libs/kdb/trieidx-v2.c b/libs/kdb/trieidx-v2.c
deleted file mode 100644
index c0eeaa4..0000000
--- a/libs/kdb/trieidx-v2.c
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "index-priv.h"
-#include "trieidx-priv.h"
-#include <klib/ptrie.h>
-#include <klib/text.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/pack.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#define KTRIE_ZEROS_KPTRIE 1
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v2
- *  persisted keymap
- */
-
-
-/* Init
- *  opens and initializes persisted keymap structure
- */
-static
-rc_t KPTrieIndexInitID2Ord ( KPTrieIndex_v2 *self, size_t in_size,
-    int variant, int span_bits, int elem_bits )
-{
-    rc_t rc;
-    union
-    {
-        uint8_t *v8;
-        uint16_t *v16;
-        uint32_t *v32;
-        uint64_t *v64;
-    } dst;
-    size_t elem_bytes = elem_bits >> 3;
-    uint32_t scount = self -> count - 1;
-
-    assert ( self -> count != 0 );
-
-    if ( span_bits * scount > in_size * 8 )
-        return RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-
-    dst . v8 = malloc ( self -> count * elem_bytes );
-    if ( dst . v8 == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t usize;
-        rc = Unpack ( span_bits, elem_bits,
-            & self -> ord2node [ self -> count ], 0,
-            span_bits * scount, NULL, & dst . v8 [ elem_bytes ],
-            scount * elem_bytes, & usize );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-
-            self -> id2ord . v8 = dst . v8;
-            self -> variant = variant;
-
-            /* integrate to simple translation */
-            switch ( variant )
-            {
-            case 1:
-                dst . v8 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v8 [ i + 1 ] += dst . v8 [ i ];
-                break;
-            case 2:
-                dst . v16 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v16 [ i + 1 ] += dst . v16 [ i ];
-                break;
-            case 3:
-                dst . v32 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v32 [ i + 1 ] += dst . v32 [ i ];
-                break;
-            case 4:
-                dst . v64 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v64 [ i + 1 ] += dst . v64 [ i ];
-                break;
-            }
-
-            return 0;
-        }
-
-        free ( dst . v8 );
-    }
-
-    return rc;
-}
-
-static
-void CC KPTrieIndexExtractV1Range_v2 ( PTNode *n, void *data )
-{
-    KPTrieIndex_v2 *self = data;
-
-    /* capture node id */
-    uint32_t id;
-    assert ( n -> data . size == sizeof id );
-    memcpy ( & id, n -> data . addr, sizeof id );
-
-    /* perform min/max */
-    if ( self -> count == 0 )
-        self -> first = self -> last = id;
-    else if ( id < self -> first )
-        self -> first = id;
-    else if ( id > self -> last )
-        self -> last = id;
-
-    ++ self -> count;
-}
-
-static
-rc_t KPTrieIndexInitFromV1_v2 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    KPTrieIndex_v1 v1;
-    rc_t rc = KPTrieIndexInit_v1 ( & v1, mm, byteswap );
-    if ( rc == 0 )
-    {
-        uint32_t *ord2node;
-        uint32_t total_id, test_id;
-        uint32_t i, id, id_bits, num_ids;
-
-        /* assume preservation of persisted projection index */
-        self -> byteswap = byteswap;
-
-        /* hopefully we got a projection index */
-        if ( v1 . id2node == NULL )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> count = 0;
-#endif
-            /* need to derive first and last from trie */
-            PTrieForEach ( v1 . key2id, KPTrieIndexExtractV1Range_v2, self );
-            if ( self -> count == 0 )
-                KPTrieIndexWhack_v1 ( & v1 );
-            else
-            {
-                /* take trie as-is */
-                self -> key2id = v1 . key2id;
-                self -> maxid = self -> last;
-            }
-
-            /* note that this assumes a span of 1 for
-               each id. there are no known uses of v1 without
-               a projection index, so this is unlikely to be important */
-
-            return 0;
-        }
-
-        /* take id range */
-        self -> first = v1 . first;
-        self -> last = self -> maxid = v1 . last;
-
-        /* count comes from trie as always */
-        self -> count = PTrieCount ( v1 . key2id );
-
-        /* detect empty trie */
-        if ( self -> count == 0 || self -> first > self -> last )
-        {
-            self -> first = self -> last = self -> maxid = 0;
-            return 0;
-        }
-
-        /* take trie as-is */
-        self -> key2id = v1 . key2id;
-
-        /* now decide whether to use 1-1 or sparse projection
-           if the number of slots is less than twice the number of nodes,
-           it is more efficient to store the nodes as a linear array,
-           and represent missing ids as nulls.
-         */
-        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-        {
-            /* take the old projection array as-is,
-               treating NULL node ids as holes */
-            self -> ord2node = v1 . id2node;
-            return 0;
-        }
-
-        /* need to create a new projection index */
-        self -> byteswap = false;
-
-        /* convert to sparse
-           calculate id bits - notice that
-           test_id gets left shifted so that
-           the loop is guaranteed to exit */
-        num_ids = ( uint32_t ) ( self -> last - self -> first + 1 );
-        for ( total_id = num_ids >> 1, id_bits = 1, test_id = 1;
-            test_id <= total_id;
-            ++ id_bits, test_id <<= 1 )
-            ( void ) 0;
-
-        /* determine variant */
-        if ( id_bits <= 8 )
-        {
-            /* allocate 4 bytes for new ord2node and 1 for id2ord */
-            uint8_t *id2ord = malloc ( self -> count * 5 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = ( uint32_t* ) & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v8 = id2ord;
-                self -> variant = 1;
-
-                /* walk across v1 table, looking at each id */
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    /* detect non NULL node ids
-                       and pretend they represent a contiguous
-                       span with no holes in id space */
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        /* prevent overwriting */
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        /* record id and node for slot */
-                        id2ord [ i ] = ( uint8_t ) id;
-                        ord2node [ i ] = byteswap ? bswap_32 ( v1 . id2node [ id ] ) : v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-        else if ( id_bits <= 16 )
-        {
-            uint16_t *id2ord = malloc ( self -> count * 6 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = ( uint32_t* ) & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v16 = id2ord;
-                self -> variant = 2;
-
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        id2ord [ i ] = ( uint16_t ) id;
-                        ord2node [ i ] = byteswap ? bswap_32 ( v1 . id2node [ id ] ) : v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-        else
-        {
-            uint32_t *id2ord = malloc ( self -> count * 8 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v32 = id2ord;
-                self -> variant = 3;
-
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        id2ord [ i ] = id;
-                        ord2node [ i ] = byteswap ? bswap_32 ( v1 . id2node [ id ] ) : v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-        
-        if ( rc == 0 )
-        {
-            if ( i == self -> count )
-                return 0;
-
-            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-        }
-
-        KPTrieIndexWhack_v1 ( & v1 );
-    }
-
-    return rc;
-}
-
-rc_t KPTrieIndexInit_v2 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    /* get size of map, assumed to be size of file */
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KPTrieIndexHdr_v2 *hdr;
-
-#if ! KTRIE_ZEROS_KPTRIE
-        self -> mm = NULL;
-        self -> ord2node = NULL;
-        self -> id2ord . v32 = NULL;
-        self -> variant = 0;
-#endif
-
-        /* ignore empty file */
-        if ( size == 0 )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> first = self -> last = self -> maxid = 0;
-            self -> key2id = NULL;
-            self -> count = 0;
-#endif
-            return 0;
-        }
-
-        /* have to have at least the base header */
-        if ( size < sizeof hdr -> dad )
-            return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* recheck header size */
-            if ( size < sizeof * hdr )
-                return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-            self -> first = hdr -> first;
-            self -> last = self -> maxid = hdr -> last;
-            self -> id_bits = ( uint8_t ) hdr -> id_bits;
-            self -> span_bits = ( uint8_t ) hdr -> span_bits;
-            self -> byteswap = byteswap;
-
-            /* try to create the pttree */
-            rc = PTrieMakeOrig ( & self -> key2id,
-                hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* the count covers at least the number of trie nodes */
-                    self -> count = PTrieCount ( self -> key2id );
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                        return 0;
-
-                    /* calculate remaining bytes */                     
-                    size -= ptsize;
-
-                    /* there must be enough for an array of 4-byte node ids */
-                    if ( size >= ( ( size_t ) self -> count << 2 ) )
-                    {
-                        /* take the persisted array as-is */
-                        self -> ord2node = ( const uint32_t* )
-                            ( ( const char* ) ( hdr + 1 ) + ptsize );
-
-                        /* read the count */
-                        if ( size >= 4 )
-                        {
-                            self -> count = * ( self -> ord2node ) ++;
-                            size -= 4;
-                            if ( byteswap )
-                                self -> count = bswap_32 ( self -> count );
-                        }
-
-                        /* determine strategy from id span and count */
-                        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-                        {
-                            /* must be contiguous */
-                            self -> count = ( uint32_t ) ( self -> last - self -> first + 1 );
-
-                            /* size should be exactly this number of slots */
-                            if ( size == ( ( size_t ) self -> count << 2 ) )
-                                return 0;
-
-                            /* fall through to error return */
-                        }
-                        else if ( ( size == 4 && self -> count == 1 ) || size > ( ( size_t ) self -> count << 2 ) )
-                        {
-                            /* sparse */
-                            size -= ( size_t ) self -> count << 2;
-
-                            /* unpack id map */
-                            if ( hdr -> id_bits <= 8 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 1, hdr -> span_bits, 8 );
-                            else if ( hdr -> id_bits <= 16 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 2, hdr -> span_bits, 16 );
-                            else if ( hdr -> id_bits <= 32 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 3, hdr -> span_bits, 32 );
-                            else
-                                rc = KPTrieIndexInitID2Ord ( self, size, 4, hdr -> span_bits, 64 );
-
-                            /* done */
-                            if ( rc == 0 )
-                                return 0;
-
-                            PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                            return rc;
-                        }
-                    }
-                }
-
-                PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KPTrieIndexInit_v3_v4 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap, bool ptorig )
-{
-    /* get size of map, assumed to be size of file */
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KPTrieIndexHdr_v3 *hdr;
-
-#if ! KTRIE_ZEROS_KPTRIE
-        self -> mm = NULL;
-        self -> ord2node = NULL;
-        self -> id2ord . v32 = NULL;
-        self -> variant = 0;
-#endif
-
-        /* ignore empty file */
-        if ( size == 0 )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> first = self -> last = self -> maxid = 0;
-            self -> key2id = NULL;
-            self -> count = 0;
-#endif
-            return 0;
-        }
-
-        /* have to have at least the base header */
-        if ( size < sizeof hdr -> dad )
-            return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* recheck header size */
-            if ( size < sizeof * hdr )
-                return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-            self -> first = hdr -> first;
-            self -> last = self -> maxid = hdr -> last;
-            self -> id_bits = ( uint8_t ) hdr -> id_bits;
-            self -> span_bits = ( uint8_t ) hdr -> span_bits;
-            self -> byteswap = byteswap;
-
-            /* try to create the pttree */
-            rc = ( ptorig ? PTrieMakeOrig : PTrieMake )
-                ( & self -> key2id, hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* the count covers at least the number of trie nodes */
-                    self -> count = PTrieCount ( self -> key2id );
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                        return 0;
-
-                    /* calculate remaining bytes */                     
-                    size -= ptsize;
-
-                    /* there must be enough for an array of 4-byte node ids */
-                    if ( size >= ( ( size_t ) self -> count << 2 ) )
-                    {
-                        /* take the persisted array as-is */
-                        self -> ord2node = ( const uint32_t* )
-                            ( ( const char* ) ( hdr + 1 ) + ptsize );
-
-                        /* read the count */
-                        if ( size >= 4 )
-                        {
-                            self -> count = * ( self -> ord2node ) ++;
-                            size -= 4;
-                            if ( byteswap )
-                                self -> count = bswap_32 ( self -> count );
-                        }
-
-                        /* determine strategy from id span and count */
-                        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-                        {
-                            /* must be contiguous */
-                            self -> count = ( uint32_t ) ( self -> last - self -> first + 1 );
-
-                            /* size should be exactly this number of slots */
-                            if ( size == ( ( size_t ) self -> count << 2 ) )
-                                return 0;
-
-                            /* fall through to error return */
-                        }
-                        else if ( ( size == 4 && self -> count == 1 ) || size > ( ( size_t ) self -> count << 2 ) )
-                        {
-                            /* sparse */
-                            size -= ( size_t ) self -> count << 2;
-
-                            /* unpack id map */
-                            if ( hdr -> id_bits <= 8 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 1, hdr -> span_bits, 8 );
-                            else if ( hdr -> id_bits <= 16 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 2, hdr -> span_bits, 16 );
-                            else if ( hdr -> id_bits <= 32 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 3, hdr -> span_bits, 32 );
-                            else
-                                rc = KPTrieIndexInitID2Ord ( self, size, 4, hdr -> span_bits, 64 );
-
-                            /* done */
-                            if ( rc == 0 )
-                                return 0;
-
-                            PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                            return rc;
-                        }
-                    }
-                }
-
-                PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Whack
- *  closes down keymap
- */
-void KPTrieIndexWhack_v2 ( KPTrieIndex_v2 *self )
-{
-    free ( ( void* ) self -> id2ord . v8 );
-    PTrieWhack ( self -> key2id );
-    KMMapRelease ( self -> mm );
-    memset ( self, 0, sizeof * self );
-}
-
-uint32_t KPTrieIndexID2Ord_v2 ( const KPTrieIndex_v2 *self, int64_t id )
-{
-    if ( id >= self -> first && id <= self -> maxid )
-    {
-        int64_t nid;
-        uint32_t left, right, ord, count = self -> count;
-
-        /* convert id either to a zero-based ord,
-           or else the translated id in id2ord */
-        id -= self -> first;
-
-        /* handle type of projection */
-        switch ( self -> variant )
-        {
-        case 0:
-            /* return one-based ord */
-            return ( uint32_t ) ( id + 1 );
-
-        case 1:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v8 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v8 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 2:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v16 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v16 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 3:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v32 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v32 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 4:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v64 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v64 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-        }
-    }
-    return 0;
-}
-
-static
-rc_t KPTrieIndexProject_v2 ( const KPTrieIndex_v2 *self,
-    int64_t id,
-#if V2FIND_RETURNS_SPAN
-    int64_t *start_id, uint32_t *span,
-#endif
-    char *key_buff, size_t buff_size, size_t *actsize )
-{
-    uint32_t nid, ord = KPTrieIndexID2Ord_v2 ( self, id );
-    if ( ord != 0 )
-    {
-        assert ( start_id != NULL );
-        assert ( span != NULL );
-
-        nid = self -> ord2node [ ord - 1 ];
-
-        switch ( self -> variant )
-        {
-        case 0:
-            * start_id = id;
-            for ( ; ord < self -> count; ++ ord )
-            {
-                if ( nid != self -> ord2node [ ord ] )
-                    break;
-            }
-            * span = ( uint32_t ) ( self -> first + ord - * start_id );
-            break;
-        case 1:
-            * start_id = self -> id2ord . v8 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid - self -> first + 1 ) : self -> id2ord . v8 [ ord ] ) - * start_id );
-            *start_id += self -> first;
-            break;
-        case 2:
-            * start_id = self -> id2ord . v16 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid - self -> first + 1 ) : self -> id2ord . v16 [ ord ] ) - * start_id );
-            *start_id += self -> first; 
-            break;
-        case 3:
-            * start_id = self -> id2ord . v32 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid - self -> first + 1 ) : self -> id2ord . v32 [ ord ] ) - * start_id );
-            *start_id += self -> first; 
-            break;
-        case 4:
-            * start_id = self -> id2ord . v64 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid - self -> first + 1 ) : self -> id2ord . v64 [ ord ] ) - * start_id );
-            *start_id += self -> first; 
-            break;
-        }
-
-        if ( nid != 0 )
-        {
-            rc_t rc;
-            PTNode node;
-
-            if ( self -> byteswap )
-                nid = bswap_32 ( nid );
-
-            rc = PTrieGetNode ( self -> key2id, & node, nid );
-            if ( rc == 0 )
-            {
-                const String *key;
-                rc = PTNodeMakeKey ( & node, & key );
-                if ( rc == 0 )
-                {
-                    if ( actsize != NULL )
-                        * actsize = key -> size;
-                    if ( key -> size >= buff_size )
-                        rc = RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                    else
-                        string_copy ( key_buff, buff_size, key -> addr, key -> size );
-
-                    StringWhack ( ( String* ) key );
-                }
-            }
-            return rc;
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-}
-
-/* Find
- */
-static
-rc_t KPTrieIndexFind_v2 ( const KPTrieIndex_v2 *self,
-    const char *str, int64_t *start_id,
-#if V2FIND_RETURNS_SPAN
-    uint32_t *span,
-#endif
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data, bool convertFromV1 )
-{
-    rc_t rc;
-
-    /* search within in-core index */
-    if ( self -> count == 0 )
-        rc = RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-    else
-    {
-        uint32_t nid;
-        PTNode pnode;
-
-        String key;
-        StringInitCString ( & key, str );
-
-        nid = PTrieFind ( self -> key2id, & key, & pnode, custom_cmp, data );
-        if ( nid == 0 )
-            rc = RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-        else
-        {
-            size_t usize;
-
-            /* detect conversion from v1 */
-            if ( convertFromV1 && self -> id_bits == 0 )
-            {
-                /* v1 stored tree will have just a 32-bit spot id as data */
-                uint32_t id;
-                assert ( pnode . data . size == sizeof id );
-                memcpy ( & id, pnode . data . addr, sizeof id );
-                * start_id = id;
-                rc = 0;
-            }
-            else
-            {
-                /* should be native v2 */
-                if ( self -> id_bits > 0 )
-                {
-                    rc = Unpack ( self -> id_bits, sizeof * start_id * 8,
-                        pnode . data . addr, 0, self -> id_bits, NULL,
-                        start_id, sizeof * start_id, & usize );
-                }
-                else
-                {
-                    rc = 0;
-                }
-                * start_id += self -> first;
-            }
-
-            if ( rc == 0 )
-            {
-#if V2FIND_RETURNS_SPAN
-                if ( self -> ord2node != NULL )
-                {
-                    uint32_t ord = KPTrieIndexID2Ord_v2 ( self, * start_id );
-                    if ( ord == 0 )
-                        rc = RC ( rcDB, rcIndex, rcSelecting, rcId, rcNotFound );
-                    else if ( ord == self -> count )
-                        * span = ( uint32_t ) ( self -> maxid - * start_id + 1 );
-                    else switch ( self -> variant )
-                    {
-                    case 0:
-                        for ( ; ord < self -> count; ++ ord )
-                        {
-                            if ( nid != self -> ord2node [ ord ] )
-                                break;
-                        }
-                        * span = ( uint32_t ) ( self -> first + ord - * start_id );
-                        break;
-                    case 1:
-                        * span = ( uint32_t ) ( self -> first + self -> id2ord . v8 [ ord ] - * start_id );
-                        break;
-                    case 2:
-                        * span = ( uint32_t ) ( self -> first + self -> id2ord . v16 [ ord ] - * start_id );
-                        break;
-                    case 3:
-                        * span = ( uint32_t ) ( self -> first + self -> id2ord . v32 [ ord ] - * start_id );
-                        break;
-                    case 4:
-                        * span = ( uint32_t ) ( self -> first + self -> id2ord . v64 [ ord ] - * start_id );
-                        break;
-                    }
-                }
-                else if ( self -> span_bits == 0 )
-                    * span = 1;
-                else
-                {
-                    rc = Unpack ( self -> span_bits, sizeof * span * 8,
-                        pnode . data . addr, 0, self -> id_bits, NULL,
-                        span, sizeof * span, & usize );
-                }
-#endif
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v2
- */
-
-
-/* whack whack */
-void KTrieIndexWhack_v2 ( KTrieIndex_v2 *self )
-{
-    KPTrieIndexWhack_v2 ( & self -> pt );
-}
-
-/* initialize an index from file */
-rc_t KTrieIndexOpen_v2 ( KTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    rc_t rc;
-    uint32_t version;
-    bool ptorig = false;
-    const KDBHdr *hdr = NULL;
-
-#if ! KTRIE_ZEROS_KPTRIE
-#error "KTrie is supposed to zero KPTrie"
-#endif
-    memset ( self, 0, sizeof * self );
-
-    /* open the prior index in persisted mode, but
-       don't load it into the core-based Trie */
-    rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-    if ( rc != 0 )
-        return rc;
-
-    self -> pt . byteswap = byteswap;
-    version = byteswap ? bswap_32 ( hdr -> version ) : hdr -> version;
-
-    switch ( version )
-    {
-    case 1:
-        rc = KPTrieIndexInitFromV1_v2 ( & self -> pt, mm, byteswap );
-        break;
-    case 2:
-        rc = KPTrieIndexInit_v2 ( & self -> pt, mm, byteswap );
-        break;
-    case 3:
-        ptorig = true;
-    case 4:
-        rc = KPTrieIndexInit_v3_v4 ( & self -> pt, mm, byteswap, ptorig );
-        break;
-    default:
-        rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion);
-        break;
-    }
-    if ( rc == 0 )
-    {
-        /* the file existed but was empty */
-        if ( self -> pt . key2id == NULL )
-        {
-            self -> pt . mm = NULL;
-            return 0;
-        }
-
-        /* retain a reference to memory map */
-        rc = KMMapAddRef ( mm );
-        if ( rc == 0 )
-        {
-            self -> pt . mm = mm;
-            return 0;
-        }
-
-        /* self -> pt gets whacked below */
-    }
-
-    KTrieIndexWhack_v2 ( self );
-    return rc;
-}
-
-
-/* map key to id range */
-rc_t KTrieIndexFind_v2 ( const KTrieIndex_v2 *self,
-    const char *str, int64_t *start_id,
-#if V2FIND_RETURNS_SPAN
-    uint32_t *span,
-#endif
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data, bool convertFromV1  )
-{
-    /* search within persisted index */
-    if ( self -> pt . key2id != NULL )
-    {
-        return KPTrieIndexFind_v2 ( & self -> pt, str, start_id,
-#if V2FIND_RETURNS_SPAN
-                                    span,
-#endif
-                                    custom_cmp, data, convertFromV1 );
-    }
-
-    return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-}
-
-rc_t KTrieIndexProject_v2 ( const KTrieIndex_v2 *self,
-    int64_t id,
-#if V2FIND_RETURNS_SPAN
-     int64_t *start_id, uint32_t *span,
-#endif
-    char *key_buff, size_t buff_size, size_t *actsize )
-{
-    if ( self -> pt . ord2node == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-
-    return KPTrieIndexProject_v2 ( & self -> pt, id,
-#if V2FIND_RETURNS_SPAN
-       start_id, span,
-#endif
-        key_buff, buff_size, actsize );
-}
diff --git a/libs/kdb/trieval-v1.c b/libs/kdb/trieval-v1.c
deleted file mode 100644
index fff6cff..0000000
--- a/libs/kdb/trieval-v1.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "index-priv.h"
-
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-
-rc_t KTrieIndexCheckConsistency_v1 ( const KTrieIndex_v1 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcParam, rcNull );
-
-    return KPTrieIndexCheckConsistency_v1 ( & self -> pt,
-        start_id, id_range, num_keys, num_rows, num_holes,
-        outer, key2id, id2key );
-}
diff --git a/libs/kdb/trieval-v2.c b/libs/kdb/trieval-v2.c
deleted file mode 100644
index e3e095b..0000000
--- a/libs/kdb/trieval-v2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "index-priv.h"
-
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-
-rc_t KTrieIndexCheckConsistency_v2 ( const KTrieIndex_v2 *self,
-    int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
-    uint64_t *num_rows, uint64_t *num_holes,
-    struct KIndex const *outer, bool key2id, bool id2key, bool all_ids, bool convertFromV1  )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcValidating, rcParam, rcNull );
-
-    return KPTrieIndexCheckConsistency_v2 ( & self -> pt,
-        start_id, id_range, num_keys, num_rows, num_holes,
-        outer, key2id, id2key, all_ids, convertFromV1 );
-}
diff --git a/libs/kdb/u64idx-v3.c b/libs/kdb/u64idx-v3.c
deleted file mode 100644
index ce5c13f..0000000
--- a/libs/kdb/u64idx-v3.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "index-priv.h"
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/mmap.h>
-#include <klib/pbstree.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <string.h>
-
-typedef struct KU64Index_PNode KU64Index_PNode;
-struct KU64Index_PNode
-{
-    uint64_t key;
-    uint64_t key_size;
-    int64_t id;
-    uint64_t id_qty;
-};
-
-rc_t KU64IndexOpen_v3( KU64Index_v3* self, const KMMap *mm, bool byteswap )
-{
-    rc_t rc;
-    const KIndexFileHeader_v3 *hdr;
-
-    /* when opened for create, there will be no existing index */
-    if( mm == NULL )
-        return 0;
-
-    /* open the prior index in persisted mode */
-    rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-    if( rc == 0 )
-    {
-        size_t msize;
-        rc = KMMapSize ( mm, & msize );
-        if ( rc == 0 )
-        {
-            if ( msize == 0 )
-                return 0;
-            if ( msize < sizeof * hdr )
-                return RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-            rc = PBSTreeMake ( & self -> tree, hdr + 1, msize - sizeof * hdr, byteswap);
-            if( rc == 0 )
-            {
-                rc = KMMapAddRef(mm);
-                if ( rc == 0 )
-                {
-                    self -> mm = mm;
-                    return 0;
-                }
-            }
-        }
-    }
-
-    KU64IndexWhack_v3(self);
-    return rc;
-}
-
-rc_t KU64IndexWhack_v3(KU64Index_v3* self)
-{
-    PBSTreeWhack(self->tree);
-    KMMapRelease(self->mm);
-    self->tree = NULL;
-    return 0;
-}
-
-typedef struct KU64Index_GrepData_struct {
-    rc_t rc;
-    rc_t (CC*func)(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data);
-    void* data;
-    KU64Index_PNode search;
-    uint64_t* key;
-    uint64_t* key_size;
-    int64_t* id;
-    uint64_t* id_qty;
-} KU64Index_GrepData;
-
-/*
- * return true: if found or break DoUntil for FindAll
- */
-static
-bool CC KU64Index_Grep(PBSTNode *node, void *data)
-{
-    const KU64Index_PNode* n = node->data.addr;
-    KU64Index_GrepData* d = data;
-
-    if( d->search.key >= n->key && (d->search.key - n->key) < n->key_size ) {
-        if( d->func ) {
-            d->rc = (*d->func)(n->key, n->key_size, n->id, n->id_qty, d->data);
-            if( d->rc != 0 ) {
-                return true;
-            }
-        } else {
-            *d->key = n->key;
-            *d->key_size = n->key_size;
-            *d->id = n->id;
-            *d->id_qty = n->id_qty;
-            return true;
-        }
-    }
-    return false;
-}
-
-rc_t KU64IndexFind_v3( const KU64Index_v3* self, uint64_t offset, uint64_t* key, 
-    uint64_t* key_size, int64_t* id, uint64_t* id_qty )
-{
-    KU64Index_GrepData d;
-
-    memset(&d, 0, sizeof(KU64Index_GrepData));
-    d.search.key = offset;
-    d.key = key;
-    d.key_size = key_size;
-    d.id = id;
-    d.id_qty = id_qty;
-    if( !PBSTreeDoUntil(self->tree, false, KU64Index_Grep, &d) ) {
-        d.rc = RC(rcDB, rcIndex, rcSelecting, rcId, rcNotFound);
-    }
-    return d.rc;
-}
-
-
-rc_t KU64IndexFindAll_v3( const KU64Index_v3* self, uint64_t offset, 
-    rc_t (CC*f)(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data), void* data)
-{
-    KU64Index_GrepData d;
-
-    memset(&d, 0, sizeof(KU64Index_GrepData));
-    d.func = f;
-    d.data = data;
-    d.search.key = offset;
-    PBSTreeDoUntil(self->tree, false, KU64Index_Grep, &d);
-    return d.rc;
-}
diff --git a/libs/kdb/wcoldata-priv.h b/libs/kdb/wcoldata-priv.h
deleted file mode 100644
index 9d27d09..0000000
--- a/libs/kdb/wcoldata-priv.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_coldata_priv_
-#define _h_coldata_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_klib_checksum_
-#include <klib/checksum.h>
-#endif
-
-#include <kfs/file.h>
-#include <kfs/md5.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMD5SumFmt;
-typedef union KColumnPageMap KColumnPageMap;
-
-
-/*--------------------------------------------------------------------------
- * KColumnData
- *  data fork
- *
- *  only handling append-mode today
- *
- *  kept 64-bit aligned
- */
-typedef struct KColumnData KColumnData;
-struct KColumnData
-{
-    /* cached end of data fork */
-    uint64_t eof;
-
-    /* data fork itself */
-    KFile *f;
-    KMD5File *fmd5;
-
-    /* page size */
-    size_t pgsize;
-
-};
-
-/* DefaultPageSize
- *  static method
- */
-#define KColumnDataDefaultPageSize( reuse_pages ) \
-    ( ( reuse_pages ) ? 4096 : 1 )
-
-/* Create
- */
-rc_t KColumnDataCreate ( KColumnData *self, KDirectory *dir,
-    KMD5SumFmt *md5, KCreateMode mode, uint64_t eof, size_t pgsize );
-
-/* Open
- */
-rc_t KColumnDataOpenRead ( KColumnData *self,
-    const KDirectory *dir, uint64_t eof, size_t pgsize );
-rc_t KColumnDataOpenUpdate ( KColumnData *self, KDirectory *dir,
-    KMD5SumFmt *md5, uint64_t eof, size_t pgsize );
-
-/* Whack
- */
-rc_t KColumnDataWhack ( KColumnData *self );
-
-/* Read
- *  reads from the data fork using a blob map
- */
-rc_t KColumnDataRead ( const KColumnData *self, const KColumnPageMap *pm,
-    size_t offset, void *buffer, size_t bsize, size_t *num_read );
-
-/* Write
- *  writes to the data fork using a blob map
- */
-rc_t  KColumnDataWrite ( KColumnData *self, KColumnPageMap *pm,
-    size_t offset, const void *buffer, size_t bytes, size_t *num_writ );
-
-/* Commit
- *  keeps changes indicated by page map and blob size
- */
-rc_t KColumnDataCommit ( KColumnData *self,
-    const KColumnPageMap *pm, size_t bytes );
-
-/* CommitDone
- *  finalizes a commit
- */
-rc_t KColumnDataCommitDone ( KColumnData * self );
-
-/* Free
- *  frees pages from a map
- */
-rc_t KColumnDataFree ( KColumnData *self,
-    const KColumnPageMap *pm, size_t bytes );
-
-
-/*--------------------------------------------------------------------------
- * KColumnPageMap
- *  map of pages involved in column blob
- */
-union KColumnPageMap
-{
-    /* for non-paged data forks, a single page id
-       describes the start of the blob, where the
-       remainder is sequential */
-    uint64_t pg;
-};
-
-/* Create
- *  creates a new page map using the first available page id
- *  obtains first free data fork page
- */
-rc_t KColumnPageMapCreate (  KColumnPageMap *self, KColumnData *cd );
-
-/* Open
- *  opens an blob by raw page id and size
- *
- *  "pm" [ OUT ] - modifiable parameter for blob page map
- *
- *  "pg" [ IN ] and "sz" [ IN ] - identifies pages of data fork included
- *  within the blob.
- */
-rc_t KColumnPageMapOpen ( KColumnPageMap *pm,
-    KColumnData *cd, uint64_t pg, size_t sz );
-
-/* Whack
- *  disposes of memory in the case of a page array
- */
-void KColumnPageMapWhack ( KColumnPageMap *self, const KColumnData *cd );
-
-/* Id
- *  captures id of initial page
- */
-rc_t KColumnPageMapId ( const KColumnPageMap *self,
-    const KColumnData *cd, uint64_t *pg );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_coldata_priv_ */
diff --git a/libs/kdb/wcoldata.c b/libs/kdb/wcoldata.c
deleted file mode 100644
index ba55abd..0000000
--- a/libs/kdb/wcoldata.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcoldata-priv.h"
-#include "wcolumn-priv.h"
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/md5.h>
-#include <kfs/impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-
-#define DATA_READ_FILE_BUFFER 32 * 1024
-
-
-/*--------------------------------------------------------------------------
- * KColumnData
- */
-
-
-/* Init
- */
-static
-rc_t KColumnDataInit ( KColumnData *self, uint64_t pos, size_t pgsize )
-{
-    rc_t rc = KFileSize ( self -> f, & self -> eof );
-    if ( rc == 0 )
-    {
-        if ( self -> eof < pos || pgsize == 0 || ( pos % pgsize ) != 0 )
-            rc = RC ( rcDB, rcColumn, rcConstructing, rcData, rcCorrupt );
-        else
-        {
-            self -> eof = pos;
-            self -> pgsize = pgsize;
-            return 0;
-        }
-    }
-
-    KFileRelease ( self -> f );
-    self -> f = NULL;
-    return rc;
-}
-
-/* Create
- */
-rc_t KColumnDataCreate ( KColumnData *self, KDirectory *dir,
-    KMD5SumFmt *md5, KCreateMode mode, uint64_t eof, size_t pgsize )
-{
-    rc_t rc = KColumnFileCreate ( & self -> f, & self -> fmd5, dir, md5, mode, true, "data" );
-    if ( rc == 0 )
-        rc = KColumnDataInit ( self, eof, pgsize );
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnDataOpenRead ( KColumnData *self,
-    const KDirectory *dir, uint64_t eof, size_t pgsize )
-{
-    rc_t rc = KDirectoryVOpenFileRead ( dir,
-        ( const KFile** ) & self -> f, "data", NULL );
-#if DATA_READ_FILE_BUFFER
-    if ( rc == 0 )
-    {
-        KFile * orig = self -> f;
-        rc = KBufFileMakeRead ( ( const KFile** ) & self -> f, self -> f, DATA_READ_FILE_BUFFER );
-        if ( rc == 0 )
-	{
-	    KFileRelease ( orig );
-	}
-	else
-        {
-            self -> f = orig;
-            rc = 0;
-        }
-    }
-#endif
-    if ( rc == 0 )
-        rc = KColumnDataInit ( self, eof, pgsize );
-    return rc;
-}
-
-rc_t KColumnDataOpenUpdate ( KColumnData *self, KDirectory *dir,
-    KMD5SumFmt *md5, uint64_t eof, size_t pgsize )
-{
-    rc_t rc = KColumnFileOpenUpdate ( & self -> f, & self -> fmd5, dir, md5, true, "data" );
-    if ( rc == 0 )
-        rc = KColumnDataInit ( self, eof, pgsize );
-    return rc;
-}
-
-/* Whack
- */
-rc_t KColumnDataWhack ( KColumnData *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-    {
-        self -> f = NULL;
-        self -> fmd5 = NULL;
-    }
-    return rc;
-}
-
-/* Read
- *  reads from the data fork using a blob map
- */
-rc_t KColumnDataRead ( const KColumnData *self, const KColumnPageMap *pm,
-    size_t offset, void *buffer, size_t bsize, size_t *num_read )
-{
-    uint64_t pos;
-
-    assert ( self != NULL );
-    assert ( pm != NULL );
-
-    if ( bsize == 0 )
-    {
-        assert ( num_read != NULL );
-        * num_read = 0;
-        return 0;
-    }
-
-    pos = pm -> pg * self -> pgsize;
-    return KFileRead ( self -> f, pos + offset, buffer, bsize, num_read );
-}
-
-/* Write
- *  writes to the data fork using a blob map
- */
-rc_t KColumnDataWrite ( KColumnData *self, KColumnPageMap *pm,
-    size_t offset, const void *buffer, size_t bytes, size_t *num_writ )
-{
-    uint64_t pos;
-
-    assert ( self != NULL );
-    assert ( pm != NULL );
-
-    if ( bytes == 0 )
-    {
-        assert ( num_writ != NULL );
-        * num_writ = 0;
-        return 0;
-    }
-
-    pos = pm -> pg * self -> pgsize;
-    return KFileWrite ( self -> f, pos + offset, buffer, bytes, num_writ );
-}
-
-/* Commit
- *  keeps changes indicated by page map and blob size
- */
-rc_t KColumnDataCommit ( KColumnData *self,
-    const KColumnPageMap *pm, size_t bytes )
-{
-    uint64_t pos;
-    size_t remainder;
-
-    assert ( self != NULL );
-    assert ( pm != NULL );
-
-    if ( self -> pgsize == 1 )
-    {
-        /* can only commit if extending page */
-        if ( pm -> pg != self -> eof )
-            return RC ( rcDB, rcBlob, rcCommitting, rcPagemap, rcInvalid );
-
-        self -> eof += bytes;
-        return 0;
-    }
-
-    assert ( ( self -> eof % self -> pgsize ) == 0 );
-    pos = self -> eof / self -> pgsize;
-
-    /* can only commit if extending page */
-    if ( pm -> pg != pos )
-        return RC ( rcDB, rcBlob, rcCommitting, rcPagemap, rcInvalid );
-
-    /* advance eof */
-    if ( bytes == 0 )
-        return 0;
-
-    pos = self -> eof + bytes;
-
-    /* maintain page boundary */
-    remainder = bytes % self -> pgsize;
-    if ( remainder != 0 )
-    {
-        pos += self -> pgsize - remainder;
-        assert ( ( pos % self -> pgsize ) == 0 );
-    }
-
-    self -> eof = pos;
-    return 0;
-}
-
-rc_t KColumnDataCommitDone ( KColumnData * self )
-{
-    rc_t rc = 0;
-
-    assert ( self != NULL );
-    if ( self -> fmd5 != NULL )
-    {
-	assert ( self -> f == KMD5FileToKFile ( self -> fmd5 ) );
-
-	rc = KMD5FileCommit ( self -> fmd5 );
-    }
-    return rc ;
-}
-
-/* Free
- *  frees pages from a map
- */
-rc_t KColumnDataFree ( KColumnData *self,
-    const KColumnPageMap *pm, size_t bytes )
-{
-    uint64_t pos;
-    size_t remainder;
-
-    if ( self -> pgsize == 1 )
-    {
-        if ( pm -> pg + bytes != self -> eof )
-            return RC ( rcDB, rcBlob, rcReleasing, rcPagemap, rcInvalid );
-
-        self -> eof = pm -> pg;
-        return 0;
-    }
-
-    assert ( ( self -> eof % self -> pgsize ) == 0 );
-    pos = pm -> pg * self -> pgsize;
-
-    remainder = bytes % self -> pgsize;
-    if ( pos + bytes + remainder != self -> eof )
-        return RC ( rcDB, rcBlob, rcReleasing, rcPagemap, rcInvalid );
-
-    self -> eof = pos;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KColumnPageMap
- *  map of pages involved in column blob
- */
-
-/* Create
- *  creates a new page map using the first available page id
- *  obtains first free data fork page
- */
-rc_t KColumnPageMapCreate (  KColumnPageMap *self, KColumnData *cd )
-{
-    assert ( cd != NULL );
-    if ( ! cd -> f -> write_enabled )
-        return RC ( rcDB, rcPagemap, rcConstructing, rcColumn, rcReadonly );
-
-    assert ( self != NULL );
-    assert ( ( cd -> eof % cd -> pgsize ) == 0 );
-    self -> pg = cd -> eof / cd -> pgsize;
-
-    return 0;
-}
-
-/* Open
- *  opens an blob by raw page id and size
- *
- *  "pm" [ OUT ] - modifiable parameter for blob page map
- *
- *  "pg" [ IN ] and "sz" [ IN ] - identifies pages of data fork included
- *  within the blob.
- */
-rc_t KColumnPageMapOpen ( KColumnPageMap *self,
-    KColumnData *cd, uint64_t pg, size_t sz )
-{
-    uint64_t pos;
-
-    assert ( cd != NULL );
-    pos = pg * cd -> pgsize;
-    if ( pos + sz > cd -> eof )
-    {
-        if ( pos >= cd -> eof )
-            return RC ( rcDB, rcColumn, rcOpening, rcParam, rcExcessive );
-        return RC ( rcDB, rcColumn, rcOpening, rcRange, rcExcessive );
-    }
-
-    assert ( self != NULL );
-    self -> pg = pg;
-
-    return 0;
-}
-
-/* Whack
- *  disposes of memory in the case of a page array
- */
-void KColumnPageMapWhack ( KColumnPageMap *self, const KColumnData *cd )
-{
-    assert ( self != NULL );
-    assert ( cd != NULL );
-}
-
-/* Id
- *  captures id of initial page
- */
-rc_t KColumnPageMapId ( const KColumnPageMap *self,
-    const KColumnData *cd, uint64_t *pg )
-{
-    assert ( self != NULL );
-    assert ( cd != NULL );
-    assert ( pg != NULL );
-
-    * pg = self -> pg;
-    return 0;
-}
diff --git a/libs/kdb/wcolidx-priv.h b/libs/kdb/wcolidx-priv.h
deleted file mode 100644
index 38cc2f6..0000000
--- a/libs/kdb/wcolidx-priv.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx_priv_
-#define _h_colidx_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#include <kfs/md5.h>
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_colidx0_priv_
-#include "wcolidx0-priv.h"
-#endif
-
-#ifndef _h_colidx1_priv_
-#include "wcolidx1-priv.h"
-#endif
-
-#ifndef _h_colidx2_priv_
-#include "wcolidx2-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMD5SumFmt;
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx
- *  the index fork
- */
-typedef struct KColumnIdx KColumnIdx;
-struct KColumnIdx
-{
-    /* first active id within db
-       and first id on upper limit
-       i.e. outside of db such that
-       id_upper - id_first == num_ids */
-    int64_t id_first;
-    int64_t id_upper;
-
-/*     struct KFile * f; */
-    uint32_t vers;
-
-    /* level 0 index */
-    KColumnIdx0 idx0;
-
-    /* level 1 index */
-    KColumnIdx1 idx1;
-
-    /* level 2 index */
-    KColumnIdx2 idx2;
-
-    /* commit counter */
-    uint32_t commit_count;
-};
-
-/* Create
- */
-rc_t KColumnIdxCreate ( KColumnIdx *self,
-    KDirectory *dir, struct KMD5SumFmt *md5, KCreateMode mode,
-    uint64_t *data_eof, size_t pgsize, int32_t checksum );
-
-/* Open
- */
-rc_t KColumnIdxOpenRead ( KColumnIdx *self, const KDirectory *dir,
-			  uint64_t *data_eof, size_t *pgsize, 
-			  int32_t *checksum );
-rc_t KColumnIdxOpenUpdate ( KColumnIdx *self, KDirectory *dir,
-    KMD5SumFmt *md5, uint64_t *data_eof, size_t *pgsize,
-    int32_t *checksum );
-
-/* Whack
- */
-rc_t KColumnIdxWhack ( KColumnIdx *self, 
-    uint64_t data_eof, size_t pgsize, int32_t checksum );
-
-/* Version
- */
-rc_t KColumnIdxVersion ( const KColumnIdx *self, uint32_t *version );
-#define KColumnIdxVersion( self, version ) \
-    KColumnIdx1Version ( & ( self ) -> idx1, version )
-
-/* ByteOrder
- */
-rc_t KColumnIdxByteOrder ( const KColumnIdx *self, bool *reversed );
-#define KColumnIdxByteOrder( self, reversed ) \
-    KColumnIdx1ByteOrder ( & ( self ) -> idx1, reversed )
-
-/* IdRange
- *  returns range of ids contained within
- */
-rc_t KColumnIdxIdRange ( const KColumnIdx *self,
-    int64_t *first, int64_t *last );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdxLocateBlob ( const KColumnIdx *self,
-    KColBlobLoc *loc, int64_t first, int64_t last );
-
-/* Commit
- *  writes a new blob location to idx0
- *  updates idx1 with header information
- *  this should be the final step in committing a write operation
- */
-rc_t KColumnIdxCommit ( KColumnIdx *self, struct KMD5SumFmt *md5,
-    const KColBlobLoc *loc, uint32_t commit_freq,
-    uint64_t data_eof, size_t pgsize, int32_t checksum );
-
-/* CommitDone
- *  finalizes a commit
- */
-rc_t KColumnIdxCommitDone ( KColumnIdx * self );
-
-/* Reindex
- */
-rc_t KColumnIdxReindex ( KColumnIdx *self, struct KMD5SumFmt *md5,
-    uint32_t commit_freq, uint64_t data_eof, size_t pgsize, int32_t checksum );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx_priv_ */
diff --git a/libs/kdb/wcolidx.c b/libs/kdb/wcolidx.c
deleted file mode 100644
index dc8ce6a..0000000
--- a/libs/kdb/wcolidx.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcolidx-priv.h"
-#include "widxblk-priv.h"
-#include "werror-priv.h"
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx
- *  the index fork
- */
-
-
-/* EstablishIdRange
- */
-static
-void KColumnIdxEstablishIdRange ( KColumnIdx *self )
-{
-    int64_t first, upper;
-
-    if ( ! KColumnIdx0IdRange ( & self -> idx0, & self -> id_first, & self -> id_upper ) )
-    {
-        if ( ! KColumnIdx1IdRange ( & self -> idx1, & self -> id_first, & self -> id_upper ) )
-            self -> id_first = self -> id_upper = 1;
-    }
-    else if ( KColumnIdx1IdRange ( & self -> idx1, & first, & upper ) )
-    {
-        if ( self -> id_first > first )
-            self -> id_first = first;
-        if ( self -> id_upper < upper )
-            self -> id_upper = upper;
-    }
-}
-
-
-/* Create
- */
-rc_t KColumnIdxCreate ( KColumnIdx *self, KDirectory *dir,
-    KMD5SumFmt *md5, KCreateMode mode, uint64_t *data_eof,
-    size_t pgsize, int32_t checksum )
-{
-    rc_t rc = 0;
-    uint64_t idx2_eof;
-    uint32_t idx0_count;
-
-    assert ( self != NULL );
-
-    rc = KColumnIdx1Create ( & self -> idx1, dir, md5, mode,
-        data_eof, & idx0_count, & idx2_eof, pgsize, checksum );
-    if ( rc == 0 )
-    {
-        rc = ( self -> idx1 . vers < 3 ) ?
-            KColumnIdx0Create_v1 ( & self -> idx0, dir, md5, mode, self -> idx1 . bswap ):
-            KColumnIdx0Create ( & self -> idx0, dir, idx0_count, md5, mode, self -> idx1 . bswap );
-        if ( rc == 0 )
-        {
-            rc = KColumnIdx2Create ( & self -> idx2, dir, md5, mode, idx2_eof );
-            if ( rc == 0 )
-            {
-                KColumnIdxEstablishIdRange ( self );
-
-                /* successful return */
-                return 0;
-            }
-
-            KColumnIdx0Whack ( & self -> idx0 );
-        }
-   
-        KColumnIdx1Whack ( & self -> idx1 );
-    }
-
-    /* failure return */
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdxOpenRead ( KColumnIdx *self, const KDirectory *dir,
-    uint64_t *data_eof, size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-    uint64_t idx2_eof;
-    uint32_t idx0_count;
-
-    assert ( self != NULL );
-
-    rc = KColumnIdx1OpenRead ( & self -> idx1,
-        dir, data_eof, & idx0_count, & idx2_eof, pgsize, checksum );
-    if ( rc == 0 )
-    {
-        rc = ( self -> idx1 . vers < 3 ) ?
-            KColumnIdx0OpenRead_v1 ( & self -> idx0, dir, self -> idx1 . bswap ):
-            KColumnIdx0OpenRead ( & self -> idx0, dir, idx0_count, self -> idx1 . bswap );
-        if ( rc == 0 )
-        {
-            rc = KColumnIdx2OpenRead ( & self -> idx2, dir, idx2_eof );
-            if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-            {
-                KColumnIdxEstablishIdRange ( self );
-                return 0;
-            }
-
-            KColumnIdx0Whack ( & self -> idx0 );
-        }
-
-        KColumnIdx1Whack ( & self -> idx1 );
-    }
-
-    return rc;
-}
-
-rc_t KColumnIdxOpenUpdate ( KColumnIdx *self, KDirectory *dir,
-    KMD5SumFmt *md5, uint64_t *data_eof, size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-    uint64_t idx2_eof;
-    uint32_t idx0_count;
-
-    assert ( self != NULL );
-
-    rc = KColumnIdx1OpenUpdate ( & self -> idx1, dir,
-        md5, data_eof, & idx0_count, & idx2_eof, pgsize, checksum );
-    if ( rc == 0 )
-    {
-        rc = ( self -> idx1 . vers < 3 ) ?
-            KColumnIdx0Create_v1 ( & self -> idx0, dir, md5, kcmOpen, self -> idx1 . bswap ):
-            KColumnIdx0Create ( & self -> idx0, dir, idx0_count, md5, kcmOpen, self -> idx1 . bswap );
-        if ( rc == 0 )
-        {
-            rc = KColumnIdx2Create ( & self -> idx2, dir, md5, kcmOpen, idx2_eof );
-            if ( rc == 0 )
-            {
-                KColumnIdxEstablishIdRange ( self );
-                return 0;
-            }
-
-            KColumnIdx0Whack ( & self -> idx0 );
-        }
-        KColumnIdx1Whack ( & self -> idx1 );
-    }
-
-    return rc;
-}
-
-/* Whack
- */
-rc_t KColumnIdxWhack ( KColumnIdx *self, 
-    uint64_t data_eof, size_t pgsize, int32_t checksum )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-
-    if ( self -> commit_count != 0 )
-    {
-        rc = KColumnIdx1WriteHeader ( & self -> idx1,
-            data_eof, self -> idx0 . count, self -> idx2 . eof,
-            pgsize, checksum );
-        if ( rc != 0 )
-            return rc;
-
-        self -> commit_count = 0;
-    }
-
-    rc = KColumnIdx1Whack ( & self -> idx1 );
-    if ( rc == 0 )
-    {
-        KColumnIdx0Whack ( & self -> idx0 );
-        KColumnIdx2Whack ( & self -> idx2 );
-    }
-
-    return rc;
-}
-
-/* Version
- */
-#ifndef KColumnIdxVersion
-rc_t KColumnIdxVersion ( const KColumnIdx *self, uint32_t *version )
-{
-    return KColumnIdx1Version ( & self -> idx1, version );
-}
-#endif
-
-/* IdRange
- *  returns range of ids contained within
- */
-rc_t KColumnIdxIdRange ( const KColumnIdx *self,
-    int64_t *first, int64_t *last )
-{
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( last != NULL );
-
-    * first = self -> id_first;
-    * last = self -> id_upper - 1;
-
-    if ( self -> id_first == self -> id_upper )
-        return RC ( rcDB, rcColumn, rcAccessing, rcRange, rcInvalid );
-    return 0;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdxLocateBlob ( const KColumnIdx *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-
-    /* convert "last" to "upper" */
-    if ( first >= ++ upper )
-        return RC ( rcDB, rcColumn, rcSelecting, rcRange, rcInvalid );
-
-    /* global reject */
-    if ( first < self -> id_first || upper > self -> id_upper )
-        return RC ( rcDB, rcColumn, rcSelecting, rcBlob, rcNotFound );
-
-    /* look in idx0 */
-    rc = KColumnIdx0LocateBlob ( & self -> idx0, loc, first, upper );
-    if ( GetRCState ( rc ) == rcNotFound )
-    {
-        KColBlockLoc bloc;
-
-        /* find block containing range */
-        rc = KColumnIdx1LocateBlock ( & self -> idx1, & bloc, first, upper );
-        if ( rc == 0 )
-        {
-            /* find location in idx2 */
-            rc = KColumnIdx2LocateBlob ( & self -> idx2,
-                loc, & bloc, first, upper, self -> idx1 . bswap );
-        }
-    }
-
-    return rc;
-}
-
-/* KColumnIdxCommit
- *  writes a new blob location to idx0
- *  updates idx1 with header information
- *  this should be the final step in committing a write operation
- */
-rc_t KColumnIdxCommit ( KColumnIdx *self, KMD5SumFmt *md5,
-    const KColBlobLoc *loc, uint32_t commit_freq,
-    uint64_t data_eof, size_t pgsize, int32_t checksum )
-{
-    rc_t idx0rc, rc;
-    KColBlobLoc prior;
-
-    assert ( self != NULL );
-    assert ( loc != NULL );
-
-    /* check index range for wraparound */
-    if ( ( loc -> start_id + loc -> id_range ) <= loc -> start_id )
-        return RC ( rcDB, rcColumn, rcCommitting, rcRange, rcInvalid );
-
-    /* journal to idx0 */
-    rc = idx0rc =
-        KColumnIdx0Commit ( & self -> idx0, loc, & prior, self -> idx1 . bswap );
-    if ( rc == 0 || rc == kdbReindex )
-    {
-        rc = 0;
-
-        if ( ++ self -> commit_count >= commit_freq )
-        {
-            rc = KColumnIdx1WriteHeader ( & self -> idx1,
-                data_eof, self -> idx0 . count, self -> idx2 . eof,
-                pgsize, checksum );
-            if ( rc == 0 )
-                self -> commit_count = 0;
-        }
-
-        if ( rc == 0 )
-        {
-            int64_t upper = loc -> start_id + loc -> id_range;
-
-            /* incorporate index into range */
-            if ( self -> id_first == self -> id_upper )
-            {
-                self -> id_first = loc -> start_id;
-                self -> id_upper = upper;
-            }
-            else
-            {
-                if ( self -> id_first > loc -> start_id )
-                    self -> id_first = loc -> start_id;
-                if ( self -> id_upper < upper )
-                    self -> id_upper = upper;
-            }
-
-            assert ( self -> id_first < self -> id_upper );
-
-            return idx0rc;
-        }
-
-        /* revert idx0 commit */
-        KColumnIdx0Revert ( & self -> idx0, loc, & prior );
-    }
-
-    return rc;
-}
-
-rc_t KColumnIdxCommitDone ( KColumnIdx * self )
-{
-    rc_t rc = 0;
-
-    assert ( self != NULL );
-    rc = KColumnIdx1CommitDone ( & self -> idx1 );
-    if ( rc == 0 )
-	rc = KColumnIdx0CommitDone ( & self -> idx0 );
-    if ( rc == 0 )
-	rc = KColumnIdx2CommitDone ( & self -> idx2 );
-    return rc;
-}
-
-/* KColumnIdxRecordIdx0Edges
- *  creates tentative idx1 blocks from idx0 entries
- *  at the block type edges as identified by KColumnIdx0
- */
-typedef struct Idx0EdgeNode Idx0EdgeNode;
-struct Idx0EdgeNode
-{
-    DLNode n;
-    KColBlockLocInfo loc;
-};
-
-static
-void CC Idx0EdgeNodeWhack ( DLNode *n, void *ignore )
-{
-    free ( n );
-}
-
-static
-rc_t KColumnIdxRecordIdx0Edges ( const KColBlockLocInfo *info, void *edges )
-{
-    Idx0EdgeNode *node;
-
-    assert ( edges != NULL );
-    assert ( info != NULL );
-
-    assert ( info -> start_id < info -> end_id );
-    assert ( info -> start_pg < info -> end_pg );
-    assert ( info -> size != 0 );
-    assert ( info -> count != 0 );
-    assert ( info -> id_type < 4 );
-    assert ( info -> pg_type < 4 );
-
-    assert ( ( ( info -> end_id - info -> start_id ) >> 32 ) == 0 );
-
-    node = malloc ( sizeof * node );
-    if ( node == NULL )
-        return RC ( rcDB, rcColumn, rcReindexing, rcMemory, rcExhausted );
-
-    node -> loc = * info;
-
-    DLListPushTail ( edges, & node -> n );
-
-    return 0;
-}
-
-/* KColumnIdxCollapseBlocks
- *  scans over blocks, looking for opportunities to
- *  combine them and collapse their number
- */
-static
-rc_t KColumnIdxCollapseBlocks ( KColumnIdx *self, DLList *edges )
-{
-    uint32_t count;
-
-    do
-    {
-        Idx0EdgeNode *prior;
-
-        /* merge count */
-        count = 0;
-
-        /* apply collapse */
-        prior = ( Idx0EdgeNode* ) DLListHead ( edges );
-        if ( prior != NULL )
-        {
-            Idx0EdgeNode *next, *cur;
-            for ( cur = ( Idx0EdgeNode* ) DLNodeNext( & prior -> n );
-                  cur != NULL; cur = next )
-            {
-                int64_t cost_left, cost_right;
-                KColBlockLocInfo buffer [ 2 ], *info;
-
-                /* grab next guy right away
-                   now we have prior, current, and next */
-                next = ( Idx0EdgeNode* ) DLNodeNext ( & cur -> n );
-
-                /* calculate a cost of merging prior and current */
-                buffer [ 0 ] = prior -> loc;
-                cost_left = KColBlockLocInfoMerge ( info = & buffer [ 0 ], & cur -> loc );
-
-                /* if there would be some advantage to the merge */
-                if ( cost_left <= 0 )
-                {
-                    /* calculate cost of merging current with next if there */
-                    if ( next != NULL )
-                    {
-                        buffer [ 1 ] = cur -> loc;
-                        cost_right = KColBlockLocInfoMerge
-                            ( info = & buffer [ 1 ], & next -> loc );
-
-                        /* if prev merge beats next,
-                           set info to previous block value */
-                        if ( cost_left <= cost_right )
-                            info = & buffer [ 0 ];
-                        else
-                        {
-                            /* otherwise shift our window
-                               and keep next block value */
-                            prior = cur;
-                            cur = next;
-                            next = ( Idx0EdgeNode* ) DLNodeNext ( & next -> n );
-                        }
-                    }
-
-                    /* merge prior with cur */
-                    prior -> loc = * info;
-                    DLListUnlink ( edges, & cur -> n );
-                    Idx0EdgeNodeWhack ( & cur -> n, NULL );
-                    ++ count;
-                    continue;
-                }
-
-                /* leave block alone */
-                prior = cur;
-            }
-        }
-    }
-    while ( count != 0 );
-
-    return 0;
-}
-
-
-/* KColumnIdxWriteNewBlock
- *  writes each block into idx1 and idx2
- */
-typedef struct WriteNewBlockData WriteNewBlockData;
-struct WriteNewBlockData
-{
-    uint64_t data_eof;
-    KColumnIdx *idx;
-    size_t pgsize;
-    uint32_t commit_freq;
-    int32_t checksum;
-    rc_t rc;
-    bool bswap;
-};
-
-static
-bool CC KColumnIdxWriteNewBlock ( DLNode *n, void *data )
-{
-    WriteNewBlockData *pb = data;
-    const Idx0EdgeNode *node = ( const Idx0EdgeNode* ) n;
-    KColumnIdx *self = pb -> idx;
-
-    KColBlockLoc bloc;
-    KColWIdxBlock iblk;
-
-    /* create and map a block of memory */
-    pb -> rc = KColWIdxBlockInit ( & iblk, & node -> loc );
-    if ( pb -> rc == 0 )
-    {
-        size_t to_write;
-
-        /* tell idx0 to fill in block */
-        KColumnIdx0TranscribeBlocks ( & self -> idx0,
-            node -> loc . start_id, node -> loc . end_id, & iblk );
-        if ( iblk . idx != node -> loc . count )
-            pb -> rc = RC ( rcDB, rcColumn, rcCommitting, rcNoObj, rcUnknown );
-        else
-        {
-            /* compress block */
-            pb -> rc = KColWIdxBlockCompress ( & iblk,
-                pb -> bswap, & node -> loc, & bloc, & to_write );
-            if ( pb -> rc == 0 )
-            {
-                /* write block appropriately */
-                pb -> rc = KColumnIdx2Write ( & self -> idx2,
-                    & bloc . pg, KColWIdxBlockPersistPtr ( & iblk, & bloc ), to_write );
-            }
-        }
-
-        KColWIdxBlockWhack ( & iblk );
-
-        if ( pb -> rc == 0 )
-        {
-            /* write idx1 block location information */
-            pb -> rc = KColumnIdx1Commit ( & self -> idx1, & bloc );
-            if ( pb -> rc == 0 )
-            {
-                /* update the header */
-                if ( ++ self -> commit_count >= pb -> commit_freq )
-                {
-                    pb -> rc = KColumnIdx1WriteHeader ( & self -> idx1,
-                        pb -> data_eof, self -> idx0 . count,
-                        self -> idx2 . eof + bloc . u . blk . size,
-                        pb -> pgsize, pb -> checksum );
-
-                    if ( pb -> rc == 0 )
-                        self -> commit_count = 0;
-                }
-                if ( pb -> rc == 0 )
-                {
-                    /* done writing block */
-                    KColumnIdx2Commit ( & self -> idx2, to_write );
-                    return false;
-                }
-
-                /* revert idx1 */
-                KColumnIdx1Revert ( & self -> idx1, bloc . start_id, bloc . id_range );
-            }
-        }
-    }
-
-    return true;
-}
-
-/* KColumnIdxFixIdx1
- */
-static
-bool CC KColumnIdxFixIdx1 ( DLNode *n, void *data )
-{
-    const Idx0EdgeNode *node = ( const Idx0EdgeNode* ) n;
-    return KColumnIdx1Revert ( data, node -> loc . start_id,
-        ( uint32_t ) ( node -> loc . end_id  - node -> loc . start_id ) );
-}
-
-/* KColumnIdxReindex
- */
-rc_t KColumnIdxReindex ( KColumnIdx *self, KMD5SumFmt *md5,
-    uint32_t commit_freq, uint64_t data_eof, size_t pgsize, int32_t checksum )
-{
-    rc_t rc;
-    DLList edges;
-
-    assert ( self != NULL );
-    assert ( pgsize > 0 );
-
-    DLListInit ( & edges );
-
-    /* map the new entries */
-    rc = KColumnIdx0DefineBlocks ( & self -> idx0,
-        KColumnIdxRecordIdx0Edges, & edges, pgsize );
-    if ( rc == 0 )
-    {
-        rc = KColumnIdxCollapseBlocks ( self, & edges );
-        if ( rc == 0 )
-        {
-            /* preserve for restoration */
-            uint64_t idx2_eof = self -> idx2 . eof;
-            size_t count = self -> idx1 . count;
-
-            WriteNewBlockData pb;
-            pb . data_eof = data_eof;
-            pb . idx = self;
-            pb . pgsize = pgsize;
-            pb . commit_freq = commit_freq;
-            pb . checksum = checksum;
-            pb . rc = 0;
-            pb . bswap = self -> idx1 . bswap;
-
-            /* write new blocks */
-            DLListDoUntil ( & edges, false, KColumnIdxWriteNewBlock, & pb );
-            if ( ( rc = pb . rc ) == 0 )
-            {
-                /* idx2 is correct,
-                   idx1 has proper count and bst,
-                   idx0 needs to whack bst and file,
-                   idx1 needs to update header */
-                rc = KColumnIdx1WriteHeader ( & self -> idx1,
-                    data_eof, 0, self -> idx2 . eof,
-                    pgsize, checksum );
-                if ( rc == 0 )
-                {
-                    self -> commit_count = 0;
-                    KColumnIdx0Truncate ( & self -> idx0 );
-                    DLListWhack ( & edges, Idx0EdgeNodeWhack, NULL );
-                    return 0;
-                }
-            }
-
-            /* restore idx2 eof */
-            self -> idx2 . eof = idx2_eof;
-
-            /* restore idx1 count and fix bst */
-            DLListDoUntil ( & edges, false, KColumnIdxFixIdx1, & self -> idx1 );
-            self -> idx1 . count = count;
-        }
-    }
-
-    DLListWhack ( & edges, Idx0EdgeNodeWhack, NULL );
-
-    return rc;
-}
diff --git a/libs/kdb/wcolidx0-priv.h b/libs/kdb/wcolidx0-priv.h
deleted file mode 100644
index f9d1238..0000000
--- a/libs/kdb/wcolidx0-priv.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx0_priv_
-#define _h_colidx0_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-#ifndef _h_kfs_file_
-#include <kfs/file.h>
-#endif
-#ifndef _h_kfs_md5_
-#include <kfs/md5.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColWIdxBlock;
-struct KColBlockLocInfo;
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0
- *  level 0 index - event journaling
- */
-typedef struct KColumnIdx0 KColumnIdx0;
-struct KColumnIdx0
-{
-    /* always append */
-    uint64_t eof;
-
-    /* the in-core indices */
-    BSTree bst;
-    size_t count;
-
-    /* the on-disk indices */
-    KFile *f;
-    KMD5File *fmd5;
-};
-
-
-/* Create
- */
-rc_t KColumnIdx0Create_v1 ( KColumnIdx0 *self, KDirectory *dir,
-    struct KMD5SumFmt *md5, KCreateMode mode, bool bswap );
-rc_t KColumnIdx0Create ( KColumnIdx0 *self, KDirectory *dir,
-    uint32_t count, struct KMD5SumFmt *md5, KCreateMode mode, bool bswap );
-
-/* Open
- */
-rc_t KColumnIdx0OpenRead_v1 ( KColumnIdx0 *self,
-    const KDirectory *dir, bool bswap );
-rc_t KColumnIdx0OpenRead ( KColumnIdx0 *self,
-    const KDirectory *dir, uint32_t count, bool bswap );
-
-/* Whack
- */
-void KColumnIdx0Whack ( KColumnIdx0 *self );
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx0IdRange ( const KColumnIdx0 *self,
-    int64_t *first, int64_t *upper );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx0LocateBlob ( const KColumnIdx0 *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper );
-
-/* Commit
- *  records an index location for addition or removal
- *  returns any prior value for rollback
- */
-rc_t KColumnIdx0Commit ( KColumnIdx0 *self,
-    const KColBlobLoc *loc, KColBlobLoc *prior, bool bswap );
-rc_t KColumnIdx0CommitDone ( KColumnIdx0 *self );
-
-/* Revert
- *  reverses effect of commit
- */
-void KColumnIdx0Revert ( KColumnIdx0 *self,
-    const KColBlobLoc *loc, const KColBlobLoc *prior );
-
-/* DefineBlocks
- *  scans existing blob locators
- *  invokes handler with ranges of ids from similar blob entries
- */
-rc_t KColumnIdx0DefineBlocks ( const KColumnIdx0 *self,
-    rc_t ( * handle_range ) ( struct KColBlockLocInfo const *info, void *data ),
-    void *data, size_t pgsize );
-
-/* TranscribeBlocks
- *  writes all blocks within a range
- */
-void KColumnIdx0TranscribeBlocks ( const KColumnIdx0 *self,
-    int64_t first, int64_t upper, struct KColWIdxBlock *iblk );
-
-/* Truncate
- *  whacks bt contents and truncates file
- */
-void KColumnIdx0Truncate ( KColumnIdx0 *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx0_priv_ */
diff --git a/libs/kdb/wcolidx0.c b/libs/kdb/wcolidx0.c
deleted file mode 100644
index b16973a..0000000
--- a/libs/kdb/wcolidx0.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcolumn-priv.h"
-#include "wcolidx0-priv.h"
-#include "widxblk-priv.h"
-#include "werror-priv.h"
-#include <kfs/file.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0Node
- *  a b-tree node
- */
-typedef struct KColumnIdx0Node KColumnIdx0Node;
-struct KColumnIdx0Node
-{
-    BSTNode n;
-    KColBlobLoc loc;
-};
-
-/* Match
- */
-static
-int CC KColumnIdx0NodeMatch ( const void *item, const BSTNode *n )
-{
-#define a ( ( const KColBlobLoc* ) item )
-#define b ( ( const KColumnIdx0Node* ) n )
-
-    if ( a -> start_id == b -> loc . start_id )
-    {
-        if ( a -> id_range < b -> loc . id_range )
-            return -1;
-        return a -> id_range > b -> loc . id_range;
-    }
-
-    if ( a -> start_id < b -> loc . start_id )
-        return -1;
-    return a -> start_id > b -> loc . start_id;
-
-#undef a
-#undef b
-}
-
-/* Find
- */
-static
-int CC KColumnIdx0NodeFind ( const void *item, const BSTNode *n )
-{
-#define a ( * ( const int64_t* ) item )
-#define b ( ( const KColumnIdx0Node* ) n )
-
-    if ( a < b -> loc . start_id )
-        return -1;
-    return a >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Sort
- */
-static
-int CC KColumnIdx0NodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KColumnIdx0Node* ) item )
-#define b ( ( const KColumnIdx0Node* ) n )
-
-    if ( ( a -> loc . start_id + a -> loc . id_range ) <= b -> loc . start_id )
-        return -1;
-    return a -> loc . start_id >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* Whack
- */
-static
-void CC KColumnIdx0NodeWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/* Next
- */
-#define KColumnIdx0NodeNext( node ) \
-    ( const KColumnIdx0Node* ) BSTNodeNext ( & ( node ) -> n )
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx0
- *  level 0 index - event journaling
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx0Inflate ( KColumnIdx0 *self,
-     const KColBlobLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    KColumnIdx0Node *n;
-
-    for ( n = NULL, i = 0; i < count; ++ i )
-    {
-        KColumnIdx0Node *exist;
-
-        if ( n == NULL )
-        {
-            n = malloc ( sizeof * n );
-            if ( n == NULL )
-                return RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-        }
-
-        n -> loc = buffer [ i ];
-        if ( BSTreeInsertUnique ( & self -> bst,
-             & n -> n, ( BSTNode** ) & exist, KColumnIdx0NodeSort ) )
-        {
-            assert ( n -> loc . start_id == exist -> loc . start_id );
-            assert ( n -> loc . id_range == exist -> loc . id_range );
-
-            assert ( ! n -> loc . u . blob . remove );
-            exist -> loc . pg = n -> loc . pg;
-            exist -> loc . u . blob . size = n -> loc . u . blob . size;
-        }
-        else
-        {
-            ++ self -> count;
-            n = NULL;
-        }
-    }
-
-    free ( n );
-
-    return 0;
-}
-
-static
-void KColumnIdx0Swap ( KColBlobLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        buffer [ i ] . pg = bswap_64 ( buffer [ i ] . pg );
-        buffer [ i ] . u . gen = bswap_32 ( buffer [ i ] . u . gen );
-        buffer [ i ] . id_range = bswap_32 ( buffer [ i ] . id_range );
-        buffer [ i ] . start_id = bswap_64 ( buffer [ i ] . start_id );
-    }
-}
-
-static
-rc_t KColumnIdx0Init_v1 ( KColumnIdx0 *self, bool bswap )
-{
-    rc_t rc;
-    KColBlobLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-
-        BSTreeInit ( & self -> bst );
-        self -> count = 0;
-
-        for ( self -> eof = 0;; self -> eof += num_read )
-        {
-            uint32_t count;
-
-            rc = KFileReadAll ( self -> f, self -> eof,
-                buffer, 2048 * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-            if ( num_read == 0 )
-                break;
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcData, rcCorrupt );
-                break;
-            }
-
-            count = num_read / sizeof * buffer;
-
-            if ( bswap )
-                KColumnIdx0Swap ( buffer, count );
-
-            rc = KColumnIdx0Inflate ( self, buffer, count );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-static
-rc_t KColumnIdx0Init ( KColumnIdx0 *self, uint32_t total, bool bswap )
-{
-    rc_t rc;
-    KColBlobLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-        uint32_t i, count;
-
-        BSTreeInit ( & self -> bst );
-        self -> count = 0;
-        self -> eof = 0;
-
-        for ( rc = 0, i = 0; i < total; self -> eof += num_read, i += count )
-        {
-            count = total - i;
-            if ( count > 2048 )
-                count = 2048;
-
-            rc = KFileReadAll ( self -> f, i * sizeof * buffer,
-                buffer, count * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-
-            /* detect EOF */
-            if ( num_read == 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcData, rcCorrupt );
-                break;
-            }
-
-            /* detect short read -
-               see comment in idx1. */
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTransfer, rcIncomplete );
-                break;
-            }
-
-            count = num_read / sizeof * buffer;
-
-            if ( bswap )
-                KColumnIdx0Swap ( buffer, count );
-
-            rc = KColumnIdx0Inflate ( self, buffer, count );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-/* Create
- */
-rc_t KColumnIdx0Create_v1 ( KColumnIdx0 *self, KDirectory *dir,
-    struct KMD5SumFmt *md5, KCreateMode mode, bool bswap )
-{
-    rc_t rc = KColumnFileCreate ( & self -> f, & self -> fmd5,
-        dir, md5, mode, true, "idx0" );
-
-    if ( rc == 0 )
-        rc = KColumnIdx0Init_v1 ( self, bswap );
-
-    return rc;
-}
-
-rc_t KColumnIdx0Create ( KColumnIdx0 *self, KDirectory *dir,
-    uint32_t count, struct KMD5SumFmt *md5, KCreateMode mode, bool bswap )
-{
-    rc_t rc = KColumnFileCreate ( & self -> f, & self -> fmd5,
-        dir, md5, mode, true, "idx0" );
-
-    if ( rc == 0 )
-        rc = KColumnIdx0Init ( self, count, bswap );
-
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx0OpenRead_v1 ( KColumnIdx0 *self, const KDirectory *dir, bool bswap )
-{
-    rc_t rc = KDirectoryVOpenFileRead ( dir,
-        ( const KFile** ) & self -> f, "idx0", NULL );
-
-    if ( rc == 0 )
-        rc = KColumnIdx0Init_v1 ( self, bswap );
-    else if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-
-    return rc;
-}
-
-rc_t KColumnIdx0OpenRead ( KColumnIdx0 *self,
-    const KDirectory *dir, uint32_t count, bool bswap )
-{
-    rc_t rc = KDirectoryVOpenFileRead ( dir,
-        ( const KFile** ) & self -> f, "idx0", NULL );
-
-    if ( rc == 0 )
-        rc = KColumnIdx0Init ( self, count, bswap );
-
-    return rc;
-}
-
-/* Whack
- */
-void KColumnIdx0Whack ( KColumnIdx0 *self )
-{
-    KFileRelease ( self -> f );
-    self -> f = NULL;
-    self -> fmd5 = NULL;
-    BSTreeWhack ( & self -> bst, KColumnIdx0NodeWhack, NULL );
-    BSTreeInit ( & self -> bst );
-}
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx0IdRange ( const KColumnIdx0 *self,
-    int64_t *first, int64_t *upper )
-{
-    const KColumnIdx0Node *a, *z;
-
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( upper != NULL );
-
-    a = ( const KColumnIdx0Node* ) BSTreeFirst ( & self -> bst );
-    if ( a == NULL )
-        return false;
-
-    z = ( const KColumnIdx0Node* ) BSTreeLast ( & self -> bst );
-    assert ( z != NULL );
-
-    * first = a -> loc . start_id;
-    * upper = z -> loc . start_id + z -> loc . id_range;
-    assert ( * first < * upper );
-
-    return true;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx0LocateBlob ( const KColumnIdx0 *self,
-    KColBlobLoc *loc, int64_t first, int64_t upper )
-{
-    const KColumnIdx0Node *n;
-
-    assert ( self != NULL );
-    assert ( loc != NULL );
-    assert ( first < upper );
-
-    n = ( const KColumnIdx0Node* )
-        BSTreeFind ( & self -> bst, & first, KColumnIdx0NodeFind );
-
-    if ( n == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcBlob, rcNotFound );
-
-    assert ( first >= n -> loc . start_id );
-    assert ( first < ( n -> loc . start_id + n -> loc . id_range ) );
-
-    if ( upper > ( n -> loc . start_id + n -> loc . id_range ) )
-        return RC ( rcDB, rcIndex, rcSelecting, rcRange, rcInvalid );
-
-    * loc = n -> loc;
-    assert ( ! loc -> u . blob . remove );
-    return 0;
-}
-
-/* Commit
- *  records an index location for addition or removal
- *  returns any prior value for rollback
- */
-rc_t KColumnIdx0Commit ( KColumnIdx0 *self,
-    const KColBlobLoc *loc, KColBlobLoc *prior, bool bswap )
-{
-    rc_t rc = 0;
-    size_t num_writ;
-    KColumnIdx0Node *n;
-
-    assert ( self != NULL );
-    assert ( loc != NULL );
-    assert ( prior != NULL );
-
-    /* this assert tests two things:
-       1) that loc -> id_range != 0
-       2) that loc -> start_id + loc -> id_range does not wrap around */
-    assert ( ( loc -> start_id + loc -> id_range ) > loc -> start_id );
-
-    /* if the index already exists, it's being overwritten */
-    n = ( KColumnIdx0Node* )
-        BSTreeFind ( & self -> bst, loc, KColumnIdx0NodeMatch );
-    if ( n != NULL )
-    {
-        /* just hold onto the prior value */
-        * prior = n -> loc;
-        assert ( n -> loc . u . blob . size != 0 );
-        assert ( ! n -> loc . u . blob . remove );
-        assert ( n -> loc . start_id == loc -> start_id );
-        assert ( n -> loc . id_range == loc -> id_range );
-    }
-    else
-    {
-        /* no prior value */
-        memset ( prior, 0, sizeof * prior );
-
-        /* record an insert/overwrite */
-        if ( ! loc -> u . blob . remove )
-        {
-            n = malloc ( sizeof * n );
-            if ( n == NULL )
-                return RC ( rcDB, rcBlob, rcCommitting, rcMemory, rcExhausted );
-
-            n -> loc . u . blob . remove = 0;
-            n -> loc . start_id = loc -> start_id;
-            n -> loc . id_range = loc -> id_range;
-        }
-    }
-
-    /* journal index to idx0 */
-    if ( ! bswap )
-        rc = KFileWrite ( self -> f, self -> eof, loc, sizeof * loc, & num_writ );
-    else
-    {
-        KColBlobLoc loc_copy;
-        loc_copy . pg = bswap_64 ( loc -> pg );
-        loc_copy . u . gen = bswap_32 ( loc -> u . gen );
-        loc_copy . id_range = bswap_32 ( loc -> id_range );
-        loc_copy . start_id = bswap_64 ( loc -> start_id );
-
-        rc = KFileWrite ( self -> f, self -> eof,
-            & loc_copy, sizeof loc_copy, & num_writ );
-    }
-    if ( rc == 0 )
-    {
-        /* detect complete write */
-        if ( num_writ == sizeof * loc )
-        {
-            self -> eof += sizeof * loc;
-
-            /* detect insert/overwrite */
-            if ( n != NULL )
-            {
-                /* if deleting, "n" is prior value */
-                if ( loc -> u . blob . remove )
-                {
-                    /* perform a delete */
-                    assert ( self -> count > 0 );
-                    BSTreeUnlink ( & self -> bst, & n -> n );
-                    -- self -> count;
-                    free ( n );
-                }
-                else
-                {
-                    /* insert new or overwrite old */
-                    n -> loc . pg = loc -> pg;
-                    n -> loc . u . blob . size = loc -> u . blob . size;
-                    if ( prior -> u . blob . size == 0 )
-                    {
-                        /* complete insertion */
-                        BSTreeInsert ( & self -> bst, & n -> n, KColumnIdx0NodeSort );
-                        if ( ++ self -> count >= 64 * 1024 )
-                            return kdbReindex;
-                    }
-                }
-            }
-
-            /* done */
-            return 0;
-        }
-
-        /* got here due to incomplete write to idx0 */
-        rc = RC ( rcDB, rcBlob, rcCommitting, rcTransfer, rcIncomplete );
-    }
-
-    /* free allocated insertion block */
-    if ( prior -> u . blob . size == 0 )
-        free ( n );
-
-    return rc;
-}
-
-rc_t KColumnIdx0CommitDone ( KColumnIdx0 *self )
-{
-    assert ( self != NULL );
-
-    if ( self -> fmd5 == NULL )
-        return 0;
-
-    assert ( self -> f == KMD5FileToKFile ( self -> fmd5 ) );
-    return KMD5FileCommit ( self -> fmd5 );
-}
-
-/* Revert
- *  reverses effect of commit
- */
-void KColumnIdx0Revert ( KColumnIdx0 *self,
-    const KColBlobLoc *loc, const KColBlobLoc *prior )
-{
-    rc_t rc = 0;
-    KColumnIdx0Node *n;
-
-    assert ( self != NULL );
-    assert ( loc != NULL );
-    assert ( prior != NULL );
-
-    /* exit MD5 transaction */
-    if ( self -> fmd5 != NULL )
-        KMD5FileRevert ( self -> fmd5 );
-
-    /* remove the blip from idx0 */
-    assert ( self -> eof >= sizeof * loc );
-    rc = KFileSetSize ( self -> f, self -> eof - sizeof * loc );
-    if ( rc != 0 )
-        exit ( 99 );
-    self -> eof -= sizeof * loc;
-
-    /* next, repair the binary search tree */
-    if ( prior -> u . blob . size != 0 )
-    {
-        if ( ! loc -> u . blob . remove )
-        {
-            /* revert an update */
-            n = ( KColumnIdx0Node* )
-                BSTreeFind ( & self -> bst, prior, KColumnIdx0NodeMatch );
-            if ( n == NULL )
-                rc = RC ( rcDB, rcIndex, rcReverting, rcNoObj, rcUnknown );
-        }
-        else
-        {
-            /* revert a delete */
-            n = malloc ( sizeof * n );
-            if ( n == NULL )
-                rc = RC ( rcDB, rcIndex, rcReverting, rcMemory, rcExhausted );
-            else
-            {
-                n -> loc . u . blob . remove = 0;
-                n -> loc . start_id = prior -> start_id;
-                n -> loc . id_range = prior -> id_range;
-                BSTreeInsert ( & self -> bst, & n -> n, KColumnIdx0NodeSort );
-                ++ self -> count;
-            }
-        }
-
-        if ( n == NULL )
-            exit ( 98 );
-
-        /* put back location information */
-        n -> loc . pg = prior -> pg;
-        n -> loc . u . blob . size = prior -> u . blob . size;
-    }
-    else if ( ! loc -> u . blob . remove )
-    {
-        /* revert an insert */
-        n = ( KColumnIdx0Node* )
-            BSTreeFind ( & self -> bst, loc, KColumnIdx0NodeMatch );
-        if ( n == NULL )
-            exit ( 97 );
-
-        assert ( self -> count > 0 );
-        BSTreeUnlink ( & self -> bst, & n -> n );
-        -- self -> count;
-        free ( n );
-    }
-}
-
-/* DefineBlocks
- *  scans existing blob locators
- *  invokes handler with ranges of ids from similar blob entries
- */
-rc_t KColumnIdx0DefineBlocks ( const KColumnIdx0 *self,
-    rc_t ( * define_block ) ( struct KColBlockLocInfo const *info, void *data ),
-    void *data, size_t pgsize )
-{
-    rc_t rc;
-    const KColumnIdx0Node *start;
-
-    assert ( self != NULL );
-    assert ( pgsize > 0 );
-    assert ( define_block != NULL );
-
-    start = ( const KColumnIdx0Node* ) BSTreeFirst ( & self -> bst );
-    for ( rc = 0; start != NULL; )
-    {
-        KColBlockLocInfo info;
-
-        uint32_t count;
-        uint32_t id_type, pg_type;
-        const KColumnIdx0Node *next, *end;
-
-        id_type = pg_type = btypePredictable;
-
-        /* build a block from start to prior */
-        for ( next = KColumnIdx0NodeNext ( end = start ), count = 1;
-              next != NULL; next = KColumnIdx0NodeNext ( end = next ), ++ count )
-        {
-            size_t pgbytes;
-            int64_t end_id;
-            int id_next, pg_next;
-
-            size_t hdr_size_div4;
-            size_t entry_size_div4;
-
-            /* look at transition from end to next */
-            id_next = pg_next = btypePredictable;
-
-            if ( end -> loc . id_range != next -> loc . id_range )
-                id_next = btypeMagnitude;
-            if ( end -> loc . u . blob . size != next -> loc . u . blob . size )
-                pg_next = btypeMagnitude;
-
-            pgbytes = ( ( end -> loc . u . blob . size + pgsize - 1 ) / pgsize ) * pgsize;
-            if ( end -> loc . start_id + end -> loc . id_range != next -> loc . start_id )
-                id_next -= btypeMagnitude;
-            if ( end -> loc . pg + pgbytes != next -> loc . pg )
-                pg_next -= btypeMagnitude;
-
-            /* check for combine-ability */
-            if ( count != 1 && ( id_type != id_next || pg_type != pg_next ) )
-                break;
-
-            /* can be stopped by excessive id range */
-            end_id = next -> loc . start_id + next -> loc . id_range;
-            if ( ( ( end_id - start -> loc . start_id ) >> 32 ) != 0 )
-                break;
-
-            /* only produces change when count == 1
-               in which case we're confident that
-               block size will not be an issue */
-            id_type &= id_next;
-            pg_type &= pg_next;
-
-            /* calculate block header size based upon types:
-               id = { 0:0, 1:4, 2:8, 3:0  }
-               pg = { 0:0, 1:4, 2:8, 3:12 } */
-            hdr_size_div4 = pg_type;
-            if ( id_type != btypePredictable )
-                hdr_size_div4 += id_type;
-
-            /* calculate block entry size as inverse of types:
-               { 0:12, 1:8, 2:4, 3:0 } */
-            entry_size_div4 = ( id_type ^ 3 ) + ( pg_type ^ 3 );
-
-            /* block size ( div 4 ) cannot exceed 64 ( div 4 ) */
-            if ( ( hdr_size_div4 + entry_size_div4 * ( count + 1 ) ) > ( 0x10000 / 4 ) )
-                break;
-        }
-
-        /* we're at the end of a block */
-        info . start_id = start -> loc . start_id;
-        info . start_pg = start -> loc . pg;
-        info . end_id = end -> loc . start_id + end -> loc . id_range;
-        info . end_pg = end -> loc . pg + end -> loc . u . blob . size;
-        info . size = end -> loc . u . blob . size;
-        info . count = count;
-        info . id_type = ( uint16_t ) id_type;
-        info . pg_type = ( uint16_t ) pg_type;
-
-        /* keep page end on even page boundary */
-        if ( pgsize != 1 )
-            info . end_pg = ( ( info . end_pg + pgsize - 1 ) / pgsize ) * pgsize;
-
-        /* define a block */
-        rc = ( * define_block ) ( & info, data );
-        if ( rc != 0 )
-            break;
-
-        /* the next block becomes our start */
-        start = next;
-    }
-    
-    return rc;
-}
-
-/* TranscribeBlocks
- *  writes all blocks within a range
- */
-void KColumnIdx0TranscribeBlocks ( const KColumnIdx0 *self,
-    int64_t first, int64_t upper, struct KColWIdxBlock *iblk )
-{
-    const KColumnIdx0Node *n;
-
-    assert ( self != NULL );
-    assert ( first < upper );
-    assert ( iblk != NULL );
-
-    n = ( const KColumnIdx0Node* )
-        BSTreeFind ( & self -> bst, & first, KColumnIdx0NodeFind );
-    assert ( n != NULL );
-    assert ( n -> loc . start_id == first );
-
-    while ( n != NULL && n -> loc . start_id < upper )
-    {
-        assert ( ( n -> loc . start_id + n -> loc . id_range ) <= upper );
-
-        KColWIdxBlockSetEntry ( iblk,
-            n -> loc . start_id, n -> loc . id_range,
-            n -> loc . pg, n -> loc . u . blob . size );
-
-        n = KColumnIdx0NodeNext ( n );
-    }
-}
-
-/* Truncate
- *  whacks bst contents and truncates file
- */
-void KColumnIdx0Truncate ( KColumnIdx0 *self )
-{
-    assert ( self != NULL );
-    KFileSetSize ( self -> f, self -> eof = 0 );
-    BSTreeWhack ( & self -> bst, KColumnIdx0NodeWhack, NULL );
-    self -> count = 0;
-}
diff --git a/libs/kdb/wcolidx1-priv.h b/libs/kdb/wcolidx1-priv.h
deleted file mode 100644
index aeedf66..0000000
--- a/libs/kdb/wcolidx1-priv.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx1_priv_
-#define _h_colidx1_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#include <kfs/md5.h>
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColIdxBlock;
-struct KColBlockLocInfo;
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1
- *  level 1 index
- */
-typedef struct KColumnIdx1 KColumnIdx1;
-struct KColumnIdx1
-{
-    /* tree of level-2 block locators */
-    BSTree bst;
-    struct KFile *f;
-    struct KFile *fidx;
-    struct KMD5File *fmd5;
-    struct KMD5File *fidxmd5;
-
-    uint32_t count;
-    uint32_t vers;
-    /* might have to switch to bit flags if more needed */
-    bool bswap;
-    bool use_md5;
-#define CONVERT_ON_SAVE_NONE	0
-#define CONVERT_ON_SAVE_V1	1
-    uint8_t convert;
-    uint8_t align [ sizeof ( size_t ) - 3 ];
-};
-
-/* Create
- */
-rc_t KColumnIdx1Create ( KColumnIdx1 *self,
-    KDirectory *dir, KMD5SumFmt *md5, KCreateMode mode,
-    uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-    size_t pgsize, int32_t checksum );
-
-/* Open
- */
-rc_t KColumnIdx1OpenRead ( KColumnIdx1 *self, const KDirectory *dir,
-    uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-    size_t *pgsize, int32_t *checksum );
-rc_t KColumnIdx1OpenUpdate ( KColumnIdx1 *self, KDirectory *dir,
-    KMD5SumFmt *md5, uint64_t *data_eof, uint32_t *idx0_count,
-    uint64_t *idx2_eof, size_t *pgsize, int32_t *checksum );
-
-/* Whack
- */
-rc_t KColumnIdx1Whack ( KColumnIdx1 *self );
-
-/* Version
- */
-rc_t KColumnIdx1Version ( const KColumnIdx1 *self, uint32_t *version );
-#define KColumnIdx1Version( self, version ) \
-    ( * ( version ) = ( uint32_t ) ( self ) -> vers, 0 )
-
-/* ByteOrder
- */
-rc_t KColumnIdx1ByteOrder ( const KColumnIdx1 *self, bool *reversed );
-#define KColumnIdx1ByteOrder( self, reversed ) \
-    ( * ( reversed ) = ( self ) -> bswap, 0 )
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx1IdRange ( const KColumnIdx1 *self,
-    int64_t *first, int64_t *upper );
-
-/* LocateBlock
- *  locates an idx2 block by range
- */
-rc_t KColumnIdx1LocateBlock ( const KColumnIdx1 *self,
-    KColBlockLoc *bloc, int64_t first, int64_t upper );
-
-/* WriteHeader
- */
-rc_t KColumnIdx1WriteHeader ( KColumnIdx1 *self,
-    uint64_t data_eof, uint32_t idx0_count, uint64_t idx2_eof,
-    size_t pgsize, int32_t checksum );
-
-/* Commit
- *  records a block location
- */
-rc_t KColumnIdx1Commit ( KColumnIdx1 *self, const KColBlockLoc *bloc );
-rc_t KColumnIdx1CommitDone ( KColumnIdx1 *self );
-
-/* Revert
- *  reverses effect of commit
- */
-bool KColumnIdx1Revert ( KColumnIdx1 *self, int64_t start_id, uint32_t id_range );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx1_priv_ */
diff --git a/libs/kdb/wcolidx1.c b/libs/kdb/wcolidx1.c
deleted file mode 100644
index a1f897e..0000000
--- a/libs/kdb/wcolidx1.c
+++ /dev/null
@@ -1,857 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcolumn-priv.h"
-#include "wcolidx1-priv.h"
-#include "werror-priv.h"
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1Node
- *  a binary search tree node
- */
-typedef struct KColumnIdx1Node KColumnIdx1Node;
-struct KColumnIdx1Node
-{
-    BSTNode n;
-    KColBlockLoc loc;
-};
-
-/* KColumnIdx1NodeFind
- */
-static
-int CC KColumnIdx1NodeFind ( const void *item, const BSTNode *n )
-{
-#define a ( * ( const int64_t* ) item )
-#define b ( ( const KColumnIdx1Node* ) n )
-
-    if ( a < b -> loc . start_id )
-        return -1;
-    return a >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* KColumnIdx1NodeSort
- */
-static
-int CC KColumnIdx1NodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KColumnIdx1Node* ) item )
-#define b ( ( const KColumnIdx1Node* ) n )
-
-    if ( ( a -> loc . start_id + a -> loc . id_range ) <= b -> loc . start_id )
-        return -1;
-    return a -> loc . start_id >= ( b -> loc . start_id + b -> loc . id_range );
-
-#undef a
-#undef b
-}
-
-/* KColumnIdx1NodeWhack
- */
-static
-void CC KColumnIdx1NodeWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/*--------------------------------------------------------------------------
- * KColumnIdx1
- *  level 1 index
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx1Inflate ( KColumnIdx1 *self,
-    const KColBlockLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        KColumnIdx1Node *exist, *n = malloc ( sizeof * n );
-        if ( n == NULL )
-            return RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-
-        n -> loc = buffer [ i ];
-        if ( BSTreeInsertUnique ( & self -> bst,
-             & n -> n, ( BSTNode** ) & exist, KColumnIdx1NodeSort ) )
-        {
-            free ( n );
-            return RC ( rcDB, rcIndex, rcConstructing, rcData, rcCorrupt );
-        }
-
-        ++ self -> count;
-    }
-
-    return 0;
-}
-
-static
-void KColumnIdx1Swap ( KColBlockLoc *buffer, uint32_t count )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        buffer [ i ] . pg = bswap_64 ( buffer [ i ] . pg );
-        buffer [ i ] . u . gen = bswap_32 ( buffer [ i ] . u . gen );
-        buffer [ i ] . id_range = bswap_32 ( buffer [ i ] . id_range );
-        buffer [ i ] . start_id = bswap_64 ( buffer [ i ] . start_id );
-    }
-}
-
-static
-rc_t KColumnIdx1Init ( KColumnIdx1 *self, uint32_t off, uint32_t count )
-{
-    rc_t rc;
-    KColBlockLoc *buffer = malloc ( 2048 * sizeof * buffer );
-    if ( buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-        uint32_t i, cnt;
-        for ( rc = 0, i = 0; i < count; off += num_read, i += cnt )
-        {
-            /* maximum number of blocks available
-               that will fit into buffer */
-            cnt = count - i;
-            if ( cnt > 2048 )
-                cnt = 2048;
-
-            /* read into buffer an even number of blocks */
-            rc = KFileReadAll ( self -> f, off,
-                buffer, cnt * sizeof * buffer, & num_read );
-            if ( rc != 0 )
-                break;
-
-            /* detect EOF */
-            if ( num_read == 0 )
-                break;
-
-            /* detect corrupt short read
-               it's not clear how this is intended to work...
-               we either get ALL count blocks, or the file
-               is corrupt. a short read is possible, but
-               is not an error until we hit EOF... */
-            if ( ( num_read % sizeof * buffer ) != 0 )
-            {
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcData, rcCorrupt );
-                break;
-            }
-
-            /* byte-swap entire buffer */
-            if ( self -> bswap )
-                KColumnIdx1Swap ( buffer, cnt );
-
-            /* create master index blocks */
-            rc = KColumnIdx1Inflate ( self, buffer, cnt );
-            if ( rc != 0 )
-                break;
-        }
-
-        free ( buffer );
-    }
-    return rc;
-}
-
-/* Create
- */
-rc_t KColumnIdx1Create ( KColumnIdx1 *self, KDirectory *dir,
-    struct KMD5SumFmt *md5, KCreateMode mode,
-	uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-	size_t pgsize, int32_t checksum )
-{
-    rc_t rc;
-
-    if ( ( mode & kcmValueMask ) == kcmOpen )
-    {
-        size_t f_pgsize;
-        int32_t f_checksum;
-	
-        /* try to open update first */
-        rc = KColumnIdx1OpenUpdate ( self, dir, md5, data_eof, 
-            idx0_count, idx2_eof, &f_pgsize, &f_checksum);
-
-        if ( rc == 0 )
-        {
-            if ( pgsize != f_pgsize || checksum != f_checksum )
-            {
-                KFileRelease ( self -> f );
-                KFileRelease ( self -> fidx );
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcParam, rcIncorrect );
-            }
-            return rc;
-        }
-        if ( GetRCState ( rc ) != rcNotFound )
-            return rc;
-
-        /* if it failed on not found try to create */
-    }
-
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-    self -> vers = 0;
-    self -> bswap = false;
-
-    rc = KColumnFileCreate ( & self -> f, & self -> fmd5, dir, md5, mode, true, "idx1" );
-    if ( rc == 0 )
-    {
-#if KCOL_CURRENT_VERSION != 1
-        rc = KColumnFileCreate ( & self -> fidx, & self -> fidxmd5, dir, md5, mode, false, "idx" );
-        if ( rc == 0 )
-        {
-#endif
-            KColumnHdr hdr;
-            size_t num_bytes;
-
-            memset ( & hdr, 0, sizeof hdr );
-            hdr . dad . endian = eByteOrderTag;
-            hdr . dad . version = KCOL_CURRENT_VERSION;
-#if KCOL_CURRENT_VERSION == 1
-            hdr . u . v1 . page_size = ( uint32_t ) pgsize;
-            hdr . u . v1 . checksum = ( uint8_t ) checksum;
-#elif KCOL_CURRENT_VERSION == 2
-            hdr . u . v2 . page_size = ( uint32_t ) pgsize;
-            hdr . u . v2 . checksum = ( uint8_t ) checksum;
-#elif KCOL_CURRENT_VERSION == 3
-            hdr . u . v3 . page_size = ( uint32_t ) pgsize;
-            hdr . u . v3 . checksum = ( uint8_t ) checksum;
-#else
-#error "lack code for current version"
-#endif
-            * data_eof = 0;
-            * idx0_count = 0;
-            * idx2_eof = 0;
-#if KCOL_CURRENT_VERSION == 1
-            rc = KFileWrite ( self -> f, 0, & hdr,
-              KColumnHdrOffset ( hdr, vCUR ),  & num_bytes );
-#else
-            rc = KFileWrite ( self -> f, 0, & hdr, sizeof hdr . dad, & num_bytes );
-            if ( rc == 0 )
-            {
-                if ( num_bytes != sizeof hdr . dad )
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcTransfer, rcIncomplete );
-                else
-                {
-                    rc = KFileWrite ( self -> fidx, 0, & hdr,
-                        KColumnHdrOffset ( hdr, vCUR ),  & num_bytes );
-#endif
-                    if ( rc == 0 )
-                    {
-                        if ( num_bytes == KColumnHdrOffset ( hdr, vCUR ) )
-                        {
-                            self -> vers = KCOL_CURRENT_VERSION;
-                            /* Here is the exit with two new files */
-                            return 0;
-                        }
-                    }
-#if KCOL_CURRENT_VERSION != 1
-                }
-
-                KFileRelease ( self -> fidx );
-            }
-#endif
-
-            KFileRelease ( self -> f );
-        }
-    }
-
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx1OpenRead ( KColumnIdx1 *self, const KDirectory *dir,
-    uint64_t *data_eof, uint32_t *idx0_count, uint64_t *idx2_eof,
-    size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-    self -> vers = 0;
-    self -> bswap = false;
-
-    rc = KDirectoryVOpenFileRead ( dir,
-        ( const KFile** ) & self -> f, "idx1", NULL );
-    if ( rc == 0 )
-    {
-        KColumnHdr hdr;
-        size_t num_bytes;
-        rc = KFileReadAll ( self -> f, 0, & hdr, sizeof hdr, & num_bytes );
-        if ( rc == 0 )
-        {
-            if ( num_bytes == 0 )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcEmpty );
-            else if ( num_bytes < KColumnHdrMinSize ( hdr ) )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-            else
-            {
-                rc = KDBHdrValidate ( & hdr . dad,
-                    num_bytes, 1, KCOL_CURRENT_VERSION );
-                if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                {
-                    self -> bswap = true;
-                    hdr . dad . endian = bswap_32 ( hdr . dad . endian );
-                    hdr . dad . version = bswap_32 ( hdr . dad . version );
-                    rc = KDBHdrValidate ( & hdr . dad, num_bytes, 1, KCOL_CURRENT_VERSION );
-                }
-                if ( rc == 0 )
-                {
-                    uint32_t off, count;
-
-                    switch ( hdr . dad . version )
-                    {
-                    case 1:
-                        if ( num_bytes < KColumnHdrOffset ( hdr, v1 ) )
-                            rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                        else
-                        {
-                            if ( self -> bswap )
-                            {
-                                hdr . u . v1 . data_eof = bswap_64 ( hdr . u . v1 . data_eof );
-                                hdr . u . v1 . idx2_eof = bswap_64 ( hdr . u . v1 . idx2_eof );
-                                hdr . u . v1 . num_blocks = bswap_32 ( hdr . u . v1 . num_blocks );
-                                hdr . u . v1 . page_size = bswap_32 ( hdr . u . v1 . page_size );
-                            }
-
-                            * data_eof = hdr . u . v1 . data_eof;
-                            * idx2_eof = hdr . u . v1 . idx2_eof;
-                            * pgsize = hdr . u . v1 . page_size;
-                            * checksum = hdr . u . v1 . checksum;
-                            count = hdr . u . v1 . num_blocks;
-                            off = KColumnHdrOffset ( hdr, v1 );
-
-                            * idx0_count = 0;
-                        }
-                        break;
-
-                    default:
-                        rc = KDirectoryVOpenFileRead ( dir, ( const KFile** ) & self -> fidx, "idx", NULL );
-                        if ( rc == 0 )
-                        {
-                            off = sizeof hdr . dad;
-                            rc = KFileReadAll ( self -> fidx, 0, & hdr, sizeof hdr, & num_bytes );
-                            if ( rc == 0 )
-                            {
-                                if ( num_bytes < KColumnHdrOffset ( hdr, v2 ) )
-                                    rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                                else
-                                {
-                                    rc = KDBHdrValidate ( & hdr . dad,
-                                        num_bytes, 2, KCOL_CURRENT_VERSION );
-                                    if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                                    {
-                                        if ( ! self->bswap ) /* catch mis-matched endianess */
-                                            rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                                        else
-                                        {
-                                            hdr . dad . endian = bswap_32 ( hdr . dad . endian );
-                                            hdr . dad . version = bswap_32 ( hdr . dad . version );
-                                            rc = KDBHdrValidate ( & hdr . dad, num_bytes, 1, KCOL_CURRENT_VERSION );
-                                        }
-                                    }
-                                    else if ( self -> bswap ) /* catch mis-matched endianess */
-                                        rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-
-                                    if ( rc == 0 ) switch ( hdr . dad . version )
-                                    {
-                                    case 2:
-                                        if ( self -> bswap )
-                                        {
-                                            hdr. u . v2 . data_eof = bswap_64 ( hdr. u . v2 . data_eof );
-                                            hdr. u . v2 . idx2_eof = bswap_64 ( hdr. u . v2 . idx2_eof );
-                                            hdr. u . v2 . num_blocks = bswap_32 ( hdr. u . v2 . num_blocks );
-                                            hdr. u . v2 . page_size = bswap_32 ( hdr. u . v2 . page_size );
-                                        }
-
-                                        * data_eof = hdr . u . v2 . data_eof;
-                                        * idx2_eof = hdr . u . v2 . idx2_eof;
-                                        * pgsize = hdr . u . v2 . page_size;
-                                        * checksum = hdr . u . v2 . checksum;
-                                        count = hdr . u . v2 . num_blocks;
-                                        * idx0_count = 0;
-                                        break;
-
-                                    case 3:
-                                        if ( self -> bswap )
-                                        {
-                                            hdr. u . v3 . data_eof = bswap_64 ( hdr. u . v3 . data_eof );
-                                            hdr. u . v3 . idx2_eof = bswap_64 ( hdr. u . v3 . idx2_eof );
-                                            hdr. u . v3 . idx0_count = bswap_32 ( hdr. u . v3 . idx0_count );
-                                            hdr. u . v3 . num_blocks = bswap_32 ( hdr. u . v3 . num_blocks );
-                                            hdr. u . v3 . page_size = bswap_32 ( hdr. u . v3 . page_size );
-                                        }
-
-                                        * data_eof = hdr . u . v3 . data_eof;
-                                        * idx2_eof = hdr . u . v3 . idx2_eof;
-                                        * idx0_count = hdr . u . v3 . idx0_count;
-                                        * pgsize = hdr . u . v3 . page_size;
-                                        * checksum = hdr . u . v3 . checksum;
-                                        count = hdr . u . v3 . num_blocks;
-                                        break;
-
-                                    default:
-                                        rc = RC ( rcDB, rcColumn, rcOpening, rcColumn, rcBadVersion );
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        self -> vers = hdr . dad . version;
-                        rc = KColumnIdx1Init ( self, off, count );
-                        if ( rc == 0 )
-                            return rc;
-                    }
-
-                    KFileRelease ( self -> fidx );
-                    self -> fidx = NULL;
-                }
-            }
-        }
-
-        KFileRelease ( self -> f );
-        self -> f = NULL;
-    }
-
-    return rc;
-}
-
-rc_t KColumnIdx1OpenUpdate ( KColumnIdx1 *self, KDirectory *dir,
-    struct KMD5SumFmt *md5, uint64_t *data_eof, uint32_t *idx0_count,
-    uint64_t *idx2_eof, size_t *pgsize, int32_t *checksum )
-{
-    rc_t rc;
-
-    BSTreeInit ( & self -> bst );
-    self -> count = 0;
-    self -> vers = 0;
-    self -> bswap = false;
-
-    rc = KColumnFileOpenUpdate ( & self -> f, & self -> fmd5, dir, md5, true, "idx1" );
-#if 0
-    /* why open a transaction? */
-    if ( rc == 0 && md5 != NULL )
-        rc = KMD5FileBeginTransaction ( self -> fmd5 );
-#endif
-    if ( rc == 0 )
-    {
-        KColumnHdr hdr;
-        size_t num_bytes;
-        rc = KFileReadAll ( self -> f, 0, & hdr, sizeof hdr, & num_bytes );
-        if ( rc == 0 )
-        {
-            /* if file was there, open will pass but if empty should be
-               treated as if it were not there at all */
-            if ( num_bytes == 0 )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcNotFound );
-            else if ( num_bytes < KColumnHdrMinSize ( hdr ) )
-                rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-            else
-            {
-                /* allow open for update only on compatible architecture and version */
-                rc = KDBHdrValidate ( & hdr . dad,
-                    num_bytes, 1, KCOL_CURRENT_VERSION );
-                if ( rc == 0 )
-                {
-                    uint32_t off, count;
-
-                    switch ( hdr . dad . version )
-                    {
-                    case 1:
-                        /* ensure hdr is minimally v1 size */
-                        if ( num_bytes < KColumnHdrOffset ( hdr, v1 ) )
-                            rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                        else
-                        {
-#if KCOL_CURRENT_VERSION != 1
-                            /* convert to current version */
-                            rc = KColumnFileCreate ( & self -> fidx, & self -> fidxmd5,
-                                dir, md5, kcmOpen, false, "idx" );
-                            if ( rc == 0 )
-                            {
-#endif
-                                * idx0_count = 0;
-                                * data_eof = hdr . u . v1 . data_eof;
-                                * idx2_eof = hdr . u . v1 . idx2_eof;
-                                * pgsize = hdr . u . v1 . page_size;
-                                * checksum = hdr . u . v1 . checksum;
-                                count = hdr . u . v1 . num_blocks;
-                                off = KColumnHdrOffset ( hdr, v1 );
-#if KCOL_CURRENT_VERSION == 1
-                                self -> convert = CONVERT_ON_SAVE_NONE;
-#else
-                                self -> convert = CONVERT_ON_SAVE_V1;
-                            }
-#endif
-                        }
-                        break;
-
-                    default:
-                        /* hdr should be incomplete - instead open "idx" */
-                        rc = KColumnFileOpenUpdate ( & self -> fidx, & self -> fidxmd5, dir, md5, false, "idx" );
-                        if ( rc == 0 )
-                        {
-                            self -> convert = CONVERT_ON_SAVE_NONE;
-                            off = sizeof hdr . dad; /* where to read in idx1 */
-                            rc = KFileReadAll ( self -> fidx, 0, & hdr, sizeof hdr, & num_bytes );
-                            if ( rc == 0 )
-                            {
-                                if ( num_bytes < KColumnHdrOffset ( hdr, v2 ) )
-                                    rc = RC ( rcDB, rcColumn, rcOpening, rcIndex, rcCorrupt );
-                                else
-                                {
-                                    rc = KDBHdrValidate ( & hdr . dad,
-                                        num_bytes, 2, KCOL_CURRENT_VERSION );
-                                    if ( rc == 0 ) switch ( hdr . dad . version )
-                                    {
-                                    case 2:
-                                        * data_eof = hdr . u . v2 . data_eof;
-                                        * idx2_eof = hdr . u . v2 . idx2_eof;
-                                        * pgsize = hdr . u . v2 . page_size;
-                                        * checksum = hdr . u . v2 . checksum;
-                                        count = hdr . u . v2 . num_blocks;
-                                        * idx0_count = 0;
-                                        break; /* skip to initialize and return */
-
-                                    case 3:
-                                        * data_eof = hdr . u . v3 . data_eof;
-                                        * idx2_eof = hdr . u . v3 . idx2_eof;
-                                        * idx0_count = hdr . u . v3 . idx0_count;
-                                        * pgsize = hdr . u . v3 . page_size;
-                                        * checksum = hdr . u . v3 . checksum;
-                                        count = hdr . u . v3 . num_blocks;
-                                        break; /* skip to initialize and return */
-
-                                    default:
-                                        rc = RC ( rcDB, rcColumn, rcOpening, rcColumn, rcBadVersion );
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    if ( rc == 0 ) /* initialize and return */
-                    {
-                        self -> vers = hdr . dad . version;
-                        rc = KColumnIdx1Init ( self, off, count );
-                        if ( rc == 0 )
-                            return rc;
-                    }
-
-                    KFileRelease ( self -> fidx );
-                    self -> fidx = NULL;
-                }
-            }
-        }
-        
-        KFileRelease ( self -> f );
-        self -> f = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Whack
- */
-rc_t KColumnIdx1Whack ( KColumnIdx1 *self )
-{
-    rc_t rc = KFileRelease ( self -> fidx );
-    if ( rc == 0 )
-    {
-        self -> fidx = NULL;
-        self -> fidxmd5 = NULL;
-        rc = KFileRelease ( self -> f );
-        if ( rc == 0 )
-        {
-            self -> f = NULL;
-            self -> fmd5 = NULL;
-            BSTreeWhack ( & self -> bst, KColumnIdx1NodeWhack, NULL );
-            BSTreeInit ( & self -> bst );
-        }
-    }
-    return rc;
-}
-
-/* Version
- */
-#ifndef KColumnIdx1Version
-rc_t KColumnIdx1Version ( const KColumnIdx1 *self, uint32_t *version )
-{
-    * version = ( uint32_t ) self -> vers;
-    return 0;
-}
-#endif
-
-/* IdRange
- *  returns range of ids contained within
- */
-bool KColumnIdx1IdRange ( const KColumnIdx1 *self,
-    int64_t *first, int64_t *upper )
-{
-    const KColumnIdx1Node *a, *z;
-
-    assert ( self != NULL );
-    assert ( first != NULL );
-    assert ( upper != NULL );
-
-    a = ( const KColumnIdx1Node* ) BSTreeFirst ( & self -> bst );
-    if ( a == NULL )
-        return false;
-
-    z = ( const KColumnIdx1Node* ) BSTreeLast ( & self -> bst );
-    assert ( z != NULL );
-
-    * first = a -> loc . start_id;
-    * upper = z -> loc . start_id + z -> loc . id_range;
-    assert ( * first < * upper );
-
-    return true;
-}
-
-/* LocateBlock
- *  locates an idx2 block by range
- *  return values:
- */
-rc_t KColumnIdx1LocateBlock ( const KColumnIdx1 *self,
-    KColBlockLoc *bloc, int64_t first, int64_t upper )
-{
-    const KColumnIdx1Node *n;
-
-    assert ( self != NULL );
-    assert ( bloc != NULL );
-    assert ( first < upper );
-
-    n = ( const KColumnIdx1Node* )
-        BSTreeFind ( & self -> bst, & first, KColumnIdx1NodeFind );
-
-    if ( n == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcRange, rcNotFound );
-
-    assert ( first >= n -> loc . start_id );
-    assert ( first < ( n -> loc . start_id + n -> loc . id_range ) );
-
-    if ( upper > ( n -> loc . start_id + n -> loc . id_range ) )
-        return RC ( rcDB, rcIndex, rcSelecting, rcRange, rcInvalid );
-
-    * bloc = n -> loc;
-    return 0;
-}
-
-/* WriteHeader
- */
-rc_t KColumnIdx1WriteHeader ( KColumnIdx1 *self,
-    uint64_t data_eof, uint32_t idx0_count, uint64_t idx2_eof,
-    size_t pgsize, int32_t checksum )
-{
-    rc_t rc = 0;
-    KColumnHdr hdr;
-    bool write_idx1 = false;
-    size_t off, off1, num_writ, num_writ1;
-
-    off1 = sizeof hdr . dad;
-
-    hdr . dad . endian = eByteOrderTag;
-    hdr . dad . version = ( uint32_t ) self -> vers;
-
-    switch ( self -> vers )
-    {
-    case 1:
-        hdr . u . v1 . data_eof = data_eof;
-        hdr . u . v1 . idx2_eof = idx2_eof;
-        hdr . u . v1 . num_blocks = ( uint32_t ) self -> count;
-        hdr . u . v1 . page_size = ( uint32_t ) pgsize;
-        hdr . u . v1 . checksum = ( uint8_t ) checksum;
-        memset ( hdr . u . v1 . align1, 0, sizeof hdr . u . v1 . align1 );
-        off = off1 = KColumnHdrOffset ( hdr, v1 );
-        write_idx1 = true;
-        break;
-    case 2:
-        hdr . u . v2 . data_eof = data_eof;
-        hdr . u . v2 . idx2_eof = idx2_eof;
-        hdr . u . v2 . ignore = 0;
-        hdr . u . v2 . num_blocks = ( uint32_t ) self -> count;
-        hdr . u . v2 . page_size = ( uint32_t ) pgsize;
-        hdr . u . v2 . checksum = ( uint8_t ) checksum;
-        memset ( hdr . u . v2 . align1, 0, sizeof hdr . u . v2 . align1 );
-        off = KColumnHdrOffset ( hdr, v2 );
-        break;
-    case 3:
-        hdr . u . v3 . data_eof = data_eof;
-        hdr . u . v3 . idx2_eof = idx2_eof;
-        hdr . u . v3 . idx0_count = idx0_count;
-        hdr . u . v3 . num_blocks = ( uint32_t ) self -> count;
-        hdr . u . v3 . page_size = ( uint32_t ) pgsize;
-        hdr . u . v3 . checksum = ( uint8_t ) checksum;
-        memset ( hdr . u . v3 . align1, 0, sizeof hdr . u . v2 . align1 );
-        off = KColumnHdrOffset ( hdr, v3 );
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcWriting, rcColumn, rcBadVersion );
-    }
-
-#if KCOL_CURRENT_VERSION != 1
-    if ( self -> fidxmd5 != NULL )
-        rc = KMD5FileReset ( self -> fidxmd5 );
-    if ( rc == 0 )
-    {
-        rc = KFileWrite ( self -> fidx, 0, & hdr, off, & num_writ );
-        if ( rc == 0 )
-        {
-            /* don't have a failsafe recover here - no undoing write to idx figured out */
-            if ( write_idx1 )
-            {
-#endif
-                if ( self -> fmd5 != NULL )
-                    rc = KMD5FileReset ( self -> fmd5 );
-                if ( rc == 0 )
-                    rc = KFileWrite ( self -> f, 0, & hdr, off1, & num_writ1 );
-#if KCOL_CURRENT_VERSION != 1
-            }
-        }
-    }
-#endif
-    if ( rc == 0 )
-    {
-#if KCOL_CURRENT_VERSION != 1
-        if ( num_writ != off )
-            rc = RC ( rcDB, rcIndex, rcWriting, rcTransfer, rcIncomplete );
-        else
-#endif
-        if ( write_idx1 && num_writ1 != off1 )
-            rc = RC ( rcDB, rcIndex, rcWriting, rcTransfer, rcIncomplete );
-    }
-
-    return rc;
-}
-
-/* Commit
- *  records a block location
- */
-rc_t KColumnIdx1Commit ( KColumnIdx1 *self, const KColBlockLoc *bloc )
-{
-    rc_t rc;
-    uint64_t pos;
-    size_t num_writ;
-
-    switch ( self -> vers )
-    {
-    case 1:
-        pos = KColumnHdrOffset ( NULL_HDR, v1 );
-        break;
-    default:
-        pos = KColumnHdrMinSize ( NULL_HDR );
-    }
-
-    pos += self -> count * sizeof * bloc;
-    rc = KFileWrite ( self -> f, pos, bloc, sizeof * bloc, & num_writ );
-    if ( rc == 0 )
-    {
-        if ( num_writ != sizeof * bloc )
-            rc = RC ( rcDB, rcIndex, rcCommitting, rcTransfer, rcIncomplete );
-        else
-        {
-            KColumnIdx1Node *n, *exist;
-            n = malloc ( sizeof * n );
-            if ( n == NULL )
-                rc = RC ( rcDB, rcIndex, rcCommitting, rcMemory, rcExhausted );
-            else
-            {
-                n -> loc = * bloc;
-                if ( BSTreeInsertUnique ( & self -> bst,
-                     & n -> n, ( BSTNode** ) & exist, KColumnIdx1NodeSort ) )
-                {
-                    free ( n );
-                    rc = RC ( rcDB, rcIndex, rcCommitting, rcRange, rcExists );
-                }
-                else
-                {
-                    ++ self -> count;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KColumnIdx1CommitDone ( KColumnIdx1 *self )
-{
-    rc_t rc = 0;
-    if ( self -> fmd5 != NULL )
-    {
-        rc = KMD5FileCommit ( self -> fmd5 );
-        if ( rc == 0 )
-            rc = KMD5FileCommit ( self -> fidxmd5 );
-    }
-    return rc;
-}
-
-/* Revert
- *  reverses effect of commit
- *  return value is used to trigger DLListDoUntil exit
- */
-bool KColumnIdx1Revert ( KColumnIdx1 *self, int64_t start_id, uint32_t id_range )
-{
-    KColumnIdx1Node *n = ( KColumnIdx1Node* )
-        BSTreeFind ( & self -> bst, & start_id, KColumnIdx1NodeFind );
-    if ( n == NULL )
-        return true;
-
-    assert ( n -> loc . start_id == start_id );
-    assert ( n -> loc . id_range == id_range );
-
-    BSTreeUnlink ( & self -> bst, & n -> n );
-    free ( n );
-    -- self -> count;
-
-    if ( self -> fmd5 != NULL )
-    {
-        assert ( self -> f == (KFile*) self -> fmd5 );
-        assert ( self -> fidx == (KFile*) self -> fidxmd5 );
-
-        KMD5FileRevert ( self -> fmd5 );
-    }
-    
-    return false;
-}
diff --git a/libs/kdb/wcolidx2-priv.h b/libs/kdb/wcolidx2-priv.h
deleted file mode 100644
index ee45610..0000000
--- a/libs/kdb/wcolidx2-priv.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_colidx2_priv_
-#define _h_colidx2_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#include <kfs/md5.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColIdxBlock;
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx2
- *  level 2 index
- */
-typedef struct KColumnIdx2 KColumnIdx2;
-struct KColumnIdx2
-{
-    /* for adding new blocks */
-    uint64_t eof;
-
-    /* idx2 itself */
-    struct KFile *f;
-    struct KMD5File *fmd5;
-};
-
-/* Create
- */
-rc_t KColumnIdx2Create ( KColumnIdx2 *self,
-    KDirectory *dir, struct KMD5SumFmt *md5, KCreateMode mode, uint64_t eof );
-
-/* Open
- */
-rc_t KColumnIdx2OpenRead ( KColumnIdx2 *self,
-    const KDirectory *dir, uint64_t eof );
-
-/* Whack
- */
-rc_t KColumnIdx2Whack ( KColumnIdx2 *self );
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx2LocateBlob ( const KColumnIdx2 *self,
-    KColBlobLoc *loc, const KColBlockLoc *bloc,
-    int64_t first, int64_t upper, bool bswap );
-
-/* Write
- *  writes block to idx2 at end of file
- *
- *  "pos" [ OUT ] - location at which block was written
- *
- *  "buffer" [ IN ] and "bytes" [ IN ] - describes data buffer
- *
- *  return values:
- */
-rc_t KColumnIdx2Write ( KColumnIdx2 *self,
-    uint64_t *pos, const void *buffer, size_t bytes );
-
-/* Commit
- *  keeps changes indicated by block size
- */
-rc_t KColumnIdx2Commit ( KColumnIdx2 *self, size_t bytes );
-rc_t KColumnIdx2CommitDone ( KColumnIdx2 *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx2_priv_ */
diff --git a/libs/kdb/wcolidx2.c b/libs/kdb/wcolidx2.c
deleted file mode 100644
index 563aa44..0000000
--- a/libs/kdb/wcolidx2.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcolumn-priv.h"
-#include "wcolidx2-priv.h"
-#include "idxblk-priv.h"
-#include "werror-priv.h"
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/md5.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#define IDX2_READ_FILE_BUFFER 1024 * 1024
-
-
-/*--------------------------------------------------------------------------
- * KColumnIdx2
- *  level 2 index
- */
-
-/* Init
- */
-static
-rc_t KColumnIdx2Init ( KColumnIdx2 *self, uint64_t idx2_eof )
-{
-    rc_t rc = KFileSize ( self -> f, & self -> eof );
-    if ( rc == 0 )
-    {
-        if ( self -> eof < idx2_eof )
-            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-        else
-        {
-            self -> eof = idx2_eof;
-            return 0;
-        }
-    }
-
-    KFileRelease ( self -> f );
-    self -> f = NULL;
-    return rc;
-}
-
-/* Create
- */
-rc_t KColumnIdx2Create ( KColumnIdx2 *self,
-    KDirectory *dir, KMD5SumFmt *md5, KCreateMode mode, uint64_t eof )
-{
-    rc_t rc = KColumnFileCreate (&self->f, &self->fmd5, dir, md5, mode, true, "idx2");
-    if ( rc == 0 )
-        rc = KColumnIdx2Init ( self, eof );
-    return rc;
-}
-
-/* Open
- */
-rc_t KColumnIdx2OpenRead ( KColumnIdx2 *self,
-    const KDirectory *dir, uint64_t eof )
-{
-    rc_t rc = KDirectoryVOpenFileRead ( dir,
-        ( const KFile** ) & self -> f, "idx2", NULL );
-#if IDX2_READ_FILE_BUFFER
-    if ( rc == 0 )
-    {
-        KFile * orig = self -> f;
-        rc = KBufFileMakeRead ( ( const KFile** ) & self -> f, self -> f, IDX2_READ_FILE_BUFFER );
-	if ( rc == 0 )
-        {
-            KFileRelease ( orig );
-        }
-        else
-        {
-            self -> f = orig;
-            rc = 0;
-        }
-    }
-#endif
-    if ( rc == 0 )
-        rc = KColumnIdx2Init ( self, eof );
-    return rc;
-}
-
-/* Whack
- */
-rc_t KColumnIdx2Whack ( KColumnIdx2 *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-    {
-        self -> f = NULL;
-        self -> fmd5 = NULL;
-    }
-    return rc;
-}
-
-/* LocateBlob
- *  locate an existing blob
- */
-rc_t KColumnIdx2LocateBlob ( const KColumnIdx2 *self,
-    KColBlobLoc *loc, const KColBlockLoc *bloc,
-    int64_t first, int64_t upper, bool bswap )
-{
-    rc_t rc;
-
-    /* compression not supported */
-    if ( bloc -> u . blk . compressed )
-        rc = RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnsupported );
-    else
-    {
-        uint64_t buffer [ 1024 / 8 ]; /* make sure is uint64_t aligned */
-        void *block = buffer;
-
-        /* determine the number of entries in block */
-        size_t orig = bloc -> u . blk . size;
-        uint32_t count = KColBlockLocEntryCount ( bloc, & orig );
-
-        /* determine the size to allocate */
-        size_t block_size = KColBlockLocAllocSize ( bloc, orig, count );
-
-        /* allocate a block */
-        if ( block_size > sizeof buffer )
-            block = malloc ( block_size );
-        if ( block == NULL )
-            rc = RC ( rcDB, rcIndex, rcSelecting, rcMemory, rcExhausted );
-        else
-        {
-            size_t num_read;
-            rc = KFileReadAll ( self -> f, bloc -> pg, block, orig, & num_read );
-            if ( rc == 0 )
-            {
-                if ( num_read != orig )
-                    rc = RC ( rcDB, rcIndex, rcSelecting, rcTransfer, rcIncomplete );
-                else
-                {
-                    KColIdxBlock iblk;
-                    rc = KColIdxBlockInit ( & iblk, bloc, orig, block, block_size, bswap );
-                    if ( rc == 0 )
-                    {
-                        uint32_t span;
-                        int64_t start_id;
-                        int slot = KColIdxBlockFind ( & iblk,
-                            bloc, count, first, & start_id, & span );
-                        if ( slot < 0 )
-                            rc = RC ( rcDB, rcIndex, rcSelecting, rcRange, rcNotFound );
-                        else if ( upper > ( start_id + span ) )
-                            rc = RC ( rcDB, rcIndex, rcSelecting, rcRange, rcInvalid );
-                        else
-                        {
-                            loc -> start_id = start_id;
-                            loc -> id_range = span;
-
-                            KColIdxBlockGet ( & iblk,
-                                bloc, count, slot, & loc -> pg, & span );
-                            loc -> u . blob . size = span;
-                        }
-                    }
-                }
-            }
-
-            if ( block != buffer )
-                free ( block );
-        }
-    }
-
-    return rc;
-}
-
-/* Write
- *  writes block to idx2 at end of file
- *
- *  "pos" [ OUT ] - location at which block was written
- *
- *  "buffer" [ IN ] and "bytes" [ IN ] - describes data buffer
- *
- *  return values:
- */
-rc_t KColumnIdx2Write ( KColumnIdx2 *self,
-    uint64_t *pos, const void *buffer, size_t bytes )
-{
-    rc_t rc;
-    size_t num_writ;
-
-    * pos = self -> eof;
-
-    rc = KFileWrite ( self -> f,
-        self -> eof, buffer, bytes, & num_writ );
-    if ( rc == 0 )
-    {
-        if ( num_writ != bytes )
-            rc = RC ( rcDB, rcIndex, rcWriting, rcTransfer, rcIncomplete );
-    }
-
-    return rc;
-}
-
-/* Commit
- *  keeps changes indicated by block size
- */
-rc_t KColumnIdx2Commit ( KColumnIdx2 *self, size_t bytes )
-{
-    self -> eof += bytes;
-    return 0;
-}
-
-rc_t KColumnIdx2CommitDone ( KColumnIdx2 *self )
-{
-    assert ( self != NULL );
-
-    if ( self -> fmd5 != NULL )
-        return KMD5FileCommit ( self -> fmd5 );
-
-    return 0;
-}
diff --git a/libs/kdb/wcolumn-priv.h b/libs/kdb/wcolumn-priv.h
deleted file mode 100644
index 3360b78..0000000
--- a/libs/kdb/wcolumn-priv.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_column_priv_
-#define _h_column_priv_
-
-#ifndef _h_kdb_column_
-#include <kdb/column.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_coldata_priv_
-#include "wcoldata-priv.h"
-#endif
-
-#ifndef _h_colidx_priv_
-#include "wcolidx-priv.h"
-#endif
-
-#include <klib/symbol.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct KDBManager;
-struct KDirectory;
-struct KMD5SumFmt;
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- */
-struct KColumn
-{
-    struct KTable *tbl;
-    struct KDBManager *mgr;
-    struct KDirectory *dir;
-
-    KMD5SumFmt *md5;
-
-    KColumnIdx idx;
-    KColumnData df;
-
-    KRefcount refcount;
-    uint32_t opencount;
-    uint32_t commit_freq;
-    uint32_t csbytes;
-    int32_t checksum;
-    bool read_only;
-
-    KSymbol sym;
-
-    char path [ 1 ];
-};
-
-/* Attach
- * Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-KColumn *KColumnAttach ( const KColumn *self );
-rc_t KColumnSever ( const KColumn *self );
-
-/* Cmp
- * Sort
- */
-int KColumnCmp ( const void *item, struct BSTNode const *n );
-int KColumnSort ( struct BSTNode const *item, struct BSTNode const *n );
-
-
-rc_t KColumnFileCreate ( KFile ** ppf, KMD5File ** ppfmd5, KDirectory * dir, 
-			 KMD5SumFmt * md5, KCreateMode mode,
-			 bool append, const char * name);
-rc_t KColumnFileOpenUpdate ( KFile ** ppf, KMD5File ** ppfmd5, KDirectory * dir, 
-			     KMD5SumFmt * md5, bool append,
-			     const char * name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_column_priv_ */
diff --git a/libs/kdb/wcolumn.c b/libs/kdb/wcolumn.c
deleted file mode 100644
index 650fe07..0000000
--- a/libs/kdb/wcolumn.c
+++ /dev/null
@@ -1,2437 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "wcolumn-priv.h"
-#include "dbmgr-priv.h"
-#include "wtable-priv.h"
-#include "wkdb-priv.h"
-#include "werror-priv.h"
-#include <kdb/kdb-priv.h>
-#include <klib/symbol.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/impl.h>
-#include <klib/checksum.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColumn
- *  a collection of blobs indexed by oid
- */
-
-/* Whack
- */
-static
-rc_t KColumnWhack ( KColumn *self )
-{
-    rc_t rc;
-    KDBManager *mgr = self -> mgr;
-    KSymbol * symb;
-    assert ( mgr != NULL );
-
-    KRefcountWhack ( & self -> refcount, "KColumn" );
-
-    /* shut down and checkpoint index */
-    rc = KColumnIdxWhack ( & self -> idx, 
-        self -> df . eof, self -> df . pgsize, self -> checksum );
-    if ( rc )
-        return rc;
-
-    /* shut down data fork */
-    KColumnDataWhack ( & self -> df );
-
-    /* shut down md5 sum file if it is open */
-    KMD5SumFmtRelease ( self -> md5 ), self -> md5 = NULL;
-
-    /* release owning table
-       should never fail, and our recovery is flawed */
-    if ( self -> tbl != NULL )
-    {
-        rc = KTableSever ( self -> tbl );
-        if ( rc != 0 )
-            return rc;
-        self -> tbl = NULL;
-    }
-
-    symb = KDBManagerOpenObjectFind (mgr, self->path);
-    if (symb != NULL)
-    {
-        rc = KDBManagerOpenObjectDelete (mgr, symb);
-        if (rc == 0)
-        {
-            /* release manager
-               should never fail */
-            rc = KDBManagerSever ( mgr );
-            if ( rc != 0 )
-                rc = KDBManagerOpenObjectAdd (mgr, symb);
-            else
-            {
-                /* complete */
-                KDirectoryRelease ( self -> dir );
-                free ( self );
-                return 0;
-            }
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KColumn", "whack", "kcol" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KColumnAddRef ( const KColumn *cself )
-{
-    KColumn *self = ( KColumn* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KColumn" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcColumn, rcAttaching, rcRange, rcExcessive );
-        }
-        ++ self -> opencount;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnRelease ( const KColumn *cself )
-{
-    KColumn *self = ( KColumn* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KColumn" ) )
-        {
-        case krefWhack:
-            return KColumnWhack ( ( KColumn* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcColumn, rcReleasing, rcRange, rcExcessive );
-        }
-        -- self -> opencount;
-    }
-    return 0;
-}
-
-
-/* Attach
- */
-KColumn *KColumnAttach ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KColumn" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KColumn* ) self;
-}
-
-/* Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-rc_t KColumnSever ( const KColumn *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KColumn" ) )
-        {
-        case krefWhack:
-            return KColumnWhack ( ( KColumn* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcColumn, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- *  make an initialized structure
- *  NB - does NOT attach reference to dir, but steals it
- */
-static
-rc_t KColumnMake ( KColumn **colp, const KDirectory *dir, const char *path,
-		   KMD5SumFmt * md5, bool read_only )
-{
-    rc_t rc;
-    KColumn *col = malloc ( sizeof * col + strlen ( path ) );
-    if ( col == NULL )
-    {
-	* colp = NULL;
-        return RC ( rcDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    memset ( col, 0, sizeof * col );
-    col -> dir = ( KDirectory* ) dir;
-    col -> md5 = md5;
-    rc = KMD5SumFmtAddRef ( md5 );
-    KRefcountInit ( & col -> refcount, 1, "KColumn", "make", path );
-    col -> opencount = 1;
-    col -> commit_freq = 1;
-    col -> read_only = read_only;
-
-    strcpy ( col -> path, path );
-
-    col->sym.u.obj = col;
-    StringInitCString (&col->sym.name, col->path);
-    col->sym.type = kptColumn;
-
-    * colp = col;
-    return rc;
-}
-
-
-static
-rc_t KDBManagerInsertColumn ( KDBManager * self, KColumn * col )
-{
-    rc_t rc;
-    rc = KDBManagerOpenObjectAdd (self, &col->sym);
-    if ( rc == 0 )
-        col -> mgr = KDBManagerAttach ( self );
-    return rc;
-}
-
-
-static
-rc_t KColumnMakeRead ( KColumn **colp, const KDirectory *dir, const char *path,
-		       KMD5SumFmt * md5 )
-{
-    rc_t rc = KColumnMake ( colp, dir, path, md5, true );
-    if ( rc == 0 )
-    {
-        size_t pgsize;
-        uint64_t data_eof;
-        KColumn *self = * colp;
-
-        rc = KColumnIdxOpenRead ( & self -> idx,
-            dir, & data_eof, & pgsize, & self -> checksum );
-        if ( rc == 0 )
-        {
-            rc = KColumnDataOpenRead ( & self -> df,
-				       dir, data_eof, pgsize );
-            if ( rc == 0 )
-            {
-                switch ( self -> checksum )
-                {
-                case kcsNone:
-                    break;
-                case kcsCRC32:
-                    self -> csbytes = 4;
-                    break;
-                case kcsMD5:
-                    self -> csbytes = 16;
-                    break;
-                }
-
-                self -> commit_freq = 0;
-                return 0;
-            }
-
-            KColumnIdxWhack ( & self -> idx,
-                data_eof, pgsize, self -> checksum );
-        }
-
-        free ( self );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-static
-rc_t KColumnMakeUpdate ( KColumn **colp,
-    KDirectory *dir, const char *path, KMD5SumFmt *md5 )
-{
-    rc_t rc = KColumnMake ( colp, dir, path, md5, false );
-    if ( rc == 0 )
-    {
-        size_t pgsize;
-        uint64_t data_eof;
-        KColumn *self = * colp;
-
-        rc = KColumnIdxOpenUpdate ( & self -> idx, dir,
-            md5, & data_eof, & pgsize, & self -> checksum );
-        if ( rc == 0 )
-        {
-            rc = KColumnDataOpenUpdate ( & self -> df, dir,
-                md5, data_eof, pgsize );
-            if ( rc == 0 )
-            {
-                switch ( self -> checksum )
-                {
-                case kcsNone:
-                    break;
-                case kcsCRC32:
-                    self -> csbytes = 4;
-                    break;
-                case kcsMD5:
-                    self -> csbytes = 16;
-                    break;
-                }
-
-                return 0;
-            }
-
-            /* why is this here? */
-            KColumnDataWhack ( & self -> df );
-
-            KColumnIdxWhack ( & self -> idx,
-                data_eof, pgsize, self -> checksum );
-        }
-
-        free ( self );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-
-/* Create
- * VCreate
- *  create a new or open an existing column
- *
- *  "colp" [ OUT ] - return parameter for newly opened database
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KColumnCreate ( KColumn **colp, KDirectory *dir,
-    KCreateMode cmode, KChecksum checksum,
-	size_t pgsize, const char *path, KMD5SumFmt *md5 )
-{
-    rc_t rc;
-
-    /* only supporting pgsize of 1 */
-    if ( pgsize == 0 )
-        pgsize = 1;
-    else if ( pgsize != 1 )
-        return RC ( rcDB, rcColumn, rcConstructing, rcParam, rcInvalid );
-
-    rc = KColumnMake ( colp, dir, path, md5, false );
-
-    if ( rc == 0 )
-    {
-        uint64_t data_eof;
-        KColumn *self = * colp;
-
-        self -> checksum = ( int32_t ) checksum;
-
-        rc = KColumnIdxCreate ( & self -> idx,
-            dir, md5, cmode, & data_eof, pgsize, ( int32_t ) checksum );
-        if ( rc == 0 )
-        {
-            rc = KColumnDataCreate ( & self -> df,
-                dir, md5, cmode, data_eof, pgsize );
-            if ( rc == 0 )
-            {
-                switch ( self -> checksum )
-                {
-                case kcsNone:
-                    break;
-                case kcsCRC32:
-                    self -> csbytes = 4;
-                    break;
-                case kcsMD5:
-                    self -> csbytes = 16;
-                    break;
-                }
-
-                /* successful exit */
-                return 0;
-            }
-
-            /* close data ? redundant? my thoughts exactly */
-            KColumnDataWhack ( & self -> df );
-
-            KColumnIdxWhack ( & self -> idx,
-                data_eof, pgsize, self -> checksum );
-        }
-
-        free ( self );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-rc_t KColumnFileCreate ( KFile **ppf,
-    KMD5File **ppfmd5, KDirectory *dir, KMD5SumFmt *md5,
-    KCreateMode mode, bool append, const char *name )
-{
-#if 1
-    rc_t rc;
-
-    KFile *pf = NULL;
-    * ppfmd5 = NULL;
-
-    rc = KDirectoryVCreateFile ( dir, & pf, true, 0664, mode, name, NULL );
-    if ( rc == 0 && md5 != NULL )
-    {
-        /* if the file was opened in "open" mode, leave its entry alone
-           if the file was opened in "init" mode, delete any existing entry
-           if the file was opened in "create" mode, it will fail if there
-           was an existing file, but still delete any digest entry */
-        if ( ( mode & kcmValueMask ) != kcmOpen )
-            rc = KMD5SumFmtDelete ( md5, name );
-        if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-        {
-            KMD5File *md5file;
-            rc = ( append ? KMD5FileMakeAppend : KMD5FileMakeWrite ) ( & md5file, pf, md5, name );
-            if ( rc == 0 )
-            {
-                * ppfmd5 = md5file;
-                pf = KMD5FileToKFile ( md5file );
-            }
-        }
-
-        if ( rc != 0 )
-        {
-            KFileRelease ( pf );
-            pf = NULL;
-        }
-    }
-
-    * ppf = pf;
-
-    return rc;
-#else
-
-    /* this looks like it needs some rethinking */
-    rc_t rc = 0;
-    KFile * pf;
-
-    *ppfmd5 = NULL;
-    *ppf = NULL;
-    /* -----
-     * This is used even when opening for update on some files
-     * so we have extra work
-     *
-     * If mode is kcmOpen try to open with normal open functions
-     * so the MD5 part gets handled correctly
-     */
-    rc = KColumnFileOpenUpdate (ppf, ppfmd5, dir, md5, append, name);
-    if (rc == 0)
-        return 0;
-
-    else if (GetRCState (rc) == rcNotFound)
-        rc = 0; /* this is not a true failure here so go on to create it */
-    if (rc == 0)
-    {
-        rc = KDirectoryVCreateFile (dir, &pf, true, 0664, mode, name, NULL);
-        if ((rc == 0) && (md5 != NULL))
-        {
-            rc = KMD5SumFmtDelete (md5, name);
-            if ((rc == 0) || (GetRCState (rc) == rcNotFound))
-            {
-                KMD5File * md5file;
-
-                rc = (append ? KMD5FileMakeAppend : KMD5FileMakeWrite)
-                    (&md5file, pf, md5, name);
-                if (rc == 0)
-                {
-                    *ppfmd5 = md5file;
-                    pf = KMD5FileToKFile (md5file);
-                }
-                else
-                {
-                    KFileRelease (pf);
-                    pf = NULL;
-                }
-            }
-        }
-    }
-    *ppf = pf;
-    return rc;
-#endif
-}
-
-rc_t KColumnFileOpenUpdate ( KFile **ppf, KMD5File **ppfmd5,
-    KDirectory *dir, KMD5SumFmt *md5, bool append, const char *name )
-{
-    rc_t rc;
-
-    KFile *pf = NULL;
-    * ppfmd5 = NULL;
-
-    rc = KDirectoryVOpenFileWrite ( dir, & pf, true, name, NULL );
-    if ( rc == 0 && md5 != NULL )
-    {
-        KMD5File *md5file;
-        rc = ( append ? KMD5FileMakeAppend : KMD5FileMakeWrite ) ( & md5file, pf, md5, name );
-        if ( rc != 0 )
-        {
-            KFileRelease ( pf );
-            pf = NULL;
-        }
-        else
-        {
-            * ppfmd5 = md5file;
-            pf = KMD5FileToKFile ( md5file );
-        }
-    }
-
-    * ppf = pf;
-
-    return rc;
-}
-
-
-/* CreateColumn
- * VCreateColumn
- *  create a new or open an existing column
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - checksum mode
- *
- *  "pgsize" [ IN ] - size of internal column pages
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-static
-rc_t KDBManagerVCreateColumnInt ( KDBManager *self,
-    KColumn **colp, KDirectory *wd, KCreateMode cmode,
-    KChecksum checksum, size_t pgsize, const char *path, va_list args )
-{
-    char colpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        colpath, sizeof colpath, path, args );
-    if ( rc == 0 )
-    {
-        KDirectory *dir;
-
-        switch ( KDBPathType ( /*NULL,*/ wd, NULL, colpath ) )
-        {
-        case kptNotFound:
-            /* first good path */
-            break;
-
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcInvalid );
-        case kptColumn:
-        case kptColumn | kptAlias:
-            /* found so is not good if we want to create new and not
-             * clear/init or open old
-             */
-            if ( ( cmode & kcmValueMask ) == kcmCreate )
-                return RC ( rcDB, rcMgr, rcCreating, rcColumn, rcExists );
-            if (KDBManagerOpenObjectBusy (self, colpath))
-                return RC ( rcDB, rcMgr, rcCreating, rcColumn, rcBusy );
-            /* test now for locked directory */
-            rc = KDBWritable (wd, colpath);
-            if (rc)
-            {
-                switch (GetRCState(rc))
-                {
-                default:
-                    return rc;
-                case rcLocked:
-                    return RC ( rcDB, rcMgr, rcCreating, rcColumn, rcLocked );
-                case rcReadonly:
-                    return RC ( rcDB, rcMgr, rcCreating, rcColumn, rcReadonly );
-                case rcNotFound:
-                    /* not found is good but probably unreachable */
-                    break;
-                case 0:
-                    rc = 0;
-                    break;
-                }
-            }
-            /* second good path */
-            break;
-
-        case kptDatabase:
-        case kptDatabase | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcDatabase, rcExists);
-
-        case kptTable:
-        case kptTable | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcTable, rcExists);
-
-        case kptIndex:
-        case kptIndex | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcIndex, rcExists);
-
-        case kptMetadata:
-        case kptMetadata | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcMetadata, rcExists);
-
-	case kptFile:
-	case kptFile | kptAlias:
-	    /* if we find a file, vary the failure if it is an archive that is a column
-	     * or a non related file */
-	    if ( KDBOpenPathTypeRead ( self, wd, colpath, NULL, kptColumn, NULL, false ) == 0 )
-		return RC ( rcDB, rcMgr, rcCreating, rcDirectory, rcUnauthorized );
-	    /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcIncorrect );
-        }
-
-        /* [re]create directory */
-        rc = KDirectoryVCreateDir ( wd, 0775, cmode, colpath, NULL );
-        if ( rc != 0 )
-            return rc;
-
-        /* create column as a directory */
-        rc = KDirectoryVOpenDirUpdate ( wd, & dir, false, colpath, NULL );
-        if ( rc == 0 )
-        {
-            KColumn *col;
-            KMD5SumFmt *md5 = NULL;
-
-            /* create an MD5 digest file for column */
-            if ( KCOL_CURRENT_VERSION >= 3 && ( cmode & kcmMD5 ) != 0 )
-            {
-                KFile * f;
-                
-                /* create or open the md5 digest file */
-                rc = KDirectoryCreateFile ( wd, &f, true, 0664, kcmOpen, "%s/md5", colpath );
-                if ( rc == 0 )
-                {
-                    /* create a formatter around file
-                       formatter will own "f" afterward */
-                    rc = KMD5SumFmtMakeUpdate ( & md5, f );
-
-                    /* if failed to create formatter, release "f" */
-                    if ( rc != 0 )
-                        KFileRelease ( f );
-                }
-
-            }
-            
-            /* create column - will attach several references to "md5" */
-            if ( rc == 0 )
-                rc = KColumnCreate ( & col, dir, cmode, checksum, pgsize, colpath, md5 );
-
-            /* release our reference to "md5" if NULL then no problem */
-            if (md5)
-                KMD5SumFmtRelease ( md5 );
-
-            if ( rc == 0 )
-            {
-                rc = KDBManagerInsertColumn ( self, col );
-                if (rc == 0 )
-                {
-                    * colp = col;
-                    return 0;
-                }
-                
-                KColumnRelease ( col );                
-            }
-            KDirectoryRelease ( dir );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerVCreateColumn ( KDBManager *self, KColumn **col,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize,
-    const char *path, va_list args )
-{
-    if ( col == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcParam, rcNull );
-
-    * col = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcSelf, rcNull );
-
-    return KDBManagerVCreateColumnInt
-        ( self, col, self -> wd, cmode, checksum, pgsize, path, args );
-}
-
-LIB_EXPORT rc_t CC KDBManagerCreateColumn ( KDBManager *self, KColumn **col,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVCreateColumn ( self, col, cmode, checksum, pgsize, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KTableCreateColumn ( KTable *self, KColumn **col,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KTableVCreateColumn ( self, col, cmode, checksum, pgsize, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVCreateColumn ( KTable *self, KColumn **colp,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize,
-    const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( colp == NULL )
-        return RC ( rcDB, rcTable, rcCreating, rcParam, rcNull );
-
-    * colp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcCreating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcTable, rcCreating, rcColumn, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "col", 3, name, args );
-    if ( rc == 0 )
-    {
-        /* set MD5 mode according to table */
-        if ( self -> use_md5 )
-            cmode |= kcmMD5;
-        else
-            cmode &= ~ kcmMD5;
-
-        rc = KDBManagerVCreateColumnInt ( self -> mgr, colp,
-            self -> dir, cmode | kcmParents, checksum, pgsize, path, NULL );
-        if ( rc == 0 )
-        {
-            KColumn *col = * colp;
-            col -> tbl = KTableAttach ( self );
-        }
-    }
-    return rc;
-}
-
-
-/* OpenColumnRead
- * VOpenColumnRead
- *  open a column for read
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-static
-rc_t KDBManagerVOpenColumnReadInt ( const KDBManager *cself,
-    const KColumn **colp, const KDirectory *wd,
-    const char *path, va_list args, bool *cached, bool try_srapath )
-{
-    char colpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        colpath, sizeof colpath, path, args );
-    if ( rc == 0 )
-    {
-        KSymbol *sym;
-
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (cself, colpath);
-        if (sym != NULL)
-        {
-            const KColumn *ccol;
-            rc_t obj;
-
-            if(cached != NULL ) *cached = true;
-
-            switch (sym->type)
-            {
-            case kptColumn:
-                ccol = (const KColumn*)sym->u.obj;
-                /* if open for update, refuse */
-                if ( ccol -> read_only )
-                {
-                    /* attach a new reference and we're gone */
-                    rc = KColumnAddRef ( ccol );
-                    if ( rc == 0 )
-                        * colp = ccol;
-                    return rc;
-                }
-                obj = rcColumn;
-                break;
-            default:
-                obj = rcPath;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            rc = RC (rcDB, rcMgr, rcOpening, obj, rcBusy);
-        }
-        else
-        {
-            const KDirectory *dir;
-
-            if ( cached != NULL )
-                *cached = false;
-
-            rc = KDBOpenPathTypeRead ( cself, wd, path, &dir, kptColumn, NULL, try_srapath );
-
-            if ( rc == 0 )
-            { 
-                KColumn *col;
-
-                rc = KColumnMakeRead ( & col, dir, colpath, NULL );
-
-                if ( rc == 0 )
-                {
-                    rc = KDBManagerInsertColumn ( (KDBManager*)cself, col );
-                    if ( rc == 0 )
-                    {
-                        * colp = col;
-                        return 0;
-                    }
-
-                    KColumnRelease ( col );
-                }
-
-                KDirectoryRelease ( dir );
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenColumnRead ( const KDBManager *self,
-    const KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenColumnRead ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenColumnRead ( const KDBManager *self,
-    const KColumn **col, const char *path, va_list args )
-{
-    if ( col == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * col = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenColumnReadInt ( self, col, self -> wd, path, args , NULL, true);
-}
-
-LIB_EXPORT rc_t CC KTableOpenColumnRead ( const KTable *self,
-    const KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KTableVOpenColumnRead ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenColumnRead ( const KTable *self,
-    const KColumn **colp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( colp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * colp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "col", 3, name, args );
-    if ( rc == 0 )
-    {
-	bool col_is_cached;
-        rc = KDBManagerVOpenColumnReadInt ( self -> mgr,
-            colp, self -> dir, path, NULL, &col_is_cached, false );
-        if ( rc == 0 )
-        {
-            KColumn *col = ( KColumn* ) * colp;
-            if(!col_is_cached) col -> tbl = KTableAttach ( self );
-        }
-    }
-    return rc;
-}
-
-
-/* OpenColumnUpdate
- * VOpenColumnUpdate
- *  open a column for read/write
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
- *  where "." acts as a structure name separator, i.e. struct.member
- */
-static
-rc_t KDBManagerVOpenColumnUpdateInt ( KDBManager *self,
-    KColumn **colp, KDirectory *wd, bool try_srapath,
-    const char *path, va_list args )
-{
-    char colpath [ 4096 ];
-    rc_t rc;
-    size_t z;
-
-/*    rc = KDirectoryVResolvePath ( wd, 1,
-        colpath, sizeof colpath, path, args ); */
-    rc = string_vprintf( colpath, sizeof colpath, &z, path, args );
-    if ( rc == 0 )
-    {
-        KSymbol * sym;
-/*         KFile *f; */
-/*         KMD5SumFmt * md5 = NULL; */
-        KDirectory *dir;
-
-        /* if already open, refuse */
-        sym = KDBManagerOpenObjectFind (self, colpath);
-        if (sym != NULL)
-        {
-            rc_t obj;
-            switch (sym->type)
-            {
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return RC ( rcDB, rcMgr, rcOpening, obj, rcBusy );
-        }
-        /* only open existing dbs */
-        switch (KDBPathType ( /*NULL,*/ wd, NULL, colpath ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcColumn, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-	case kptFile:
-	case kptFile | kptAlias:
-	    /* if we find a file, vary the failure if it is an archive that is a table
-	     * or a non related file
-	     * this should be changed to a readonly as it is not possible not 
-	     * disallowed.  rcReadonly not rcUnauthorized
-	     */
-	    if ( KDBOpenPathTypeRead ( self, wd, colpath, NULL, kptColumn, NULL, try_srapath ) == 0 )
-		return RC ( rcDB, rcMgr, rcOpening, rcDirectory, rcUnauthorized );
-	    /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        case kptColumn:
-        case kptColumn | kptAlias:
-            break;
-        }
-
-        /* test now for locked directory */
-        rc = KDBWritable (wd, colpath);
-        switch (GetRCState(rc))
-        {
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcColumn, rcUnexpected );
-        case rcLocked:
-            return RC ( rcDB, rcMgr, rcOpening, rcColumn, rcLocked );
-        case rcReadonly:
-            return RC ( rcDB, rcMgr, rcOpening, rcColumn, rcReadonly );
-        case 0:
-            rc = 0;
-            break;
-        }
-
-
-        rc = KDirectoryVOpenDirUpdate ( wd, & dir, 0, colpath, NULL );
-        if ( rc == 0 )
-        {
-            KColumn *col;
-            KMD5SumFmt *md5 = NULL;
-            /* open existing md5 digest file */
-            KFile * f;
-            rc = KDirectoryVOpenFileWrite ( dir, & f, true, "md5", NULL );
-            if ( rc == 0 )
-            {
-                rc = KMD5SumFmtMakeUpdate ( &md5, f );
-                if ( rc != 0 )
-                    KFileRelease ( f );
-            }
-            else if ( GetRCState ( rc ) == rcNotFound )
-                rc = 0;
-
-            /* make column - will attach several references to "md5" */
-            if ( rc == 0 )
-                rc = KColumnMakeUpdate ( & col, dir, colpath, md5 );
-
-            /* release our reference to "md5" */
-            KMD5SumFmtRelease ( md5 );
-
-            if ( rc == 0 )
-            {
-                rc = KDBManagerInsertColumn ( self, col );
-                if ( rc == 0 )
-                {
-                    * colp = col;
-                    return 0;
-                }
-                
-                KColumnRelease ( col );                
-            }
-            KDirectoryRelease ( dir );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenColumnUpdate ( KDBManager *self,
-    KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenColumnUpdate ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenColumnUpdate ( KDBManager *self,
-    KColumn **col, const char *path, va_list args )
-{
-    if ( col == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * col = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenColumnUpdateInt
-        ( self, col, self -> wd, true, path, args );
-}
-
-LIB_EXPORT rc_t CC KTableOpenColumnUpdate ( KTable *self,
-    KColumn **col, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KTableVOpenColumnUpdate ( self, col, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenColumnUpdate ( KTable *self,
-    KColumn **colp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( colp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * colp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcTable, rcOpening, rcColumn, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "col", 3, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenColumnUpdateInt ( self -> mgr,
-            colp, self -> dir, false, path, NULL );
-        if ( rc == 0 )
-        {
-            KColumn *col = * colp;
-            col -> tbl = KTableAttach ( self );
-        }
-    }
-    return rc;
-}
-
-bool KTableColumnNeedsReindex ( KTable *self, const char *colname )
-{
-    if ( self != NULL )
-    {
-        char path [ 256 ];
-        rc_t rc = KDBMakeSubPath ( self -> dir,
-            path, sizeof path, "col", 3, colname );
-        if ( rc == 0 )
-        {
-            uint64_t idx0_size;
-            rc = KDirectoryFileSize ( self -> dir, & idx0_size, "%s/idx0", path );
-            if ( rc == 0 && idx0_size > 0 )
-                return true;
-        }
-    }
-
-    return false;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KColumnLocked ( const KColumn *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptMetadata and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-static
-rc_t KColumnLockInt (const KColumn  * self, char * path, size_t path_size,
-                        int type, const char * name, va_list args )
-{
-    rc_t rc;
-
-    if (self == NULL)
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    else if (name == NULL)
-        rc =  RC (rcDB, rcMgr, rcAccessing, rcPath, rcNull);
-
-    else
-    {
-        const char * ns;
-        char path [ 256 ];
-
-        ns = KDBGetNamespaceString (type);
-
-        switch (type)
-        {
-        default:
-            rc = RC (rcDB, rcMgr, rcAccessing, rcParam, rcInvalid);
-            break;
-        case kptIndex:
-        case kptMetadata:
-/*         case kptIndex: */
-            rc = KDBVMakeSubPath (self->dir, path, sizeof path, ns, strlen (ns),
-                                  name, args);
-            break;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnVWritable ( const KColumn *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    rc = KColumnLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBWritable (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnWritable ( const KColumn *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KColumnVWritable ( self, type, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptMetadata and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KColumnVLock ( KColumn *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KColumnLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBLockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnLock ( KColumn *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KColumnVLock (self, type, name, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptMetadata and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KColumnVUnlock ( KColumn *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KColumnLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBUnlockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnUnlock ( KColumn *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, name );
-    rc = KColumnVUnlock (self, type, name, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* Version
- *  returns the column format version
- */
-LIB_EXPORT rc_t CC KColumnVersion ( const KColumn *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    return KColumnIdxVersion ( & self -> idx, version );
-}
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KColumnByteOrder ( const KColumn *self, bool *reversed )
-{
-    if ( reversed == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * reversed = false;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-     
-    return KColumnIdxByteOrder ( & self -> idx, reversed );
-}
-
-/* IdRange
- *  returns id range for column
- */
-LIB_EXPORT rc_t CC KColumnIdRange ( const KColumn *self, int64_t *first, uint64_t *count )
-{
-    rc_t rc;
-    int64_t dummy, last;
-
-    if ( first == NULL && count == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( first == NULL )
-        first = & dummy;
-    else if ( count == NULL )
-        count = ( uint64_t * ) & dummy;
-
-    if ( self == NULL )
-    {
-        * first = 0;
-        * count = 0;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-
-    rc = KColumnIdxIdRange ( & self -> idx, first, & last );
-    if ( rc != 0 )
-        * count = 0;
-    else
-        * count = last - * first + 1;
-
-    return rc;
-}
-
-
-/* Reindex
- *  optimize indices
- */
-LIB_EXPORT rc_t CC KColumnReindex ( KColumn *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcReindexing, rcSelf, rcNull );
-    if ( self -> read_only )
-        return RC ( rcDB, rcColumn, rcReindexing, rcColumn, rcReadonly );
-    return KColumnIdxReindex ( & self -> idx, self -> md5, self -> commit_freq,
-        self -> df . eof, self -> df . pgsize, self -> checksum );
-}
-
-
-/* CommitFreq
- * SetCommitFreq
- *  manage frequency of commits
- */
-LIB_EXPORT rc_t CC KColumnCommitFreq ( KColumn *self, uint32_t *freq )
-{
-    if ( freq == NULL )
-        return RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * freq = 0;
-        return RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-
-    * freq = self -> commit_freq;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnSetCommitFreq ( KColumn *self, uint32_t freq )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcUpdating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcColumn, rcUpdating, rcColumn, rcReadonly );
-
-    self -> commit_freq = freq;
-    return 0;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KColumnOpenManagerRead ( const KColumn *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenManagerUpdate ( KColumn *self, KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KColumnOpenParentRead ( const KColumn *self, const KTable **tbl )
-{
-    rc_t rc;
-
-    if ( tbl == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KTableAddRef ( self -> tbl );
-            if ( rc == 0 )
-            {
-                * tbl = self -> tbl;
-                return 0;
-            }
-        }
-
-        * tbl = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenParentUpdate ( KColumn *self, KTable **tbl )
-{
-    rc_t rc;
-
-    if ( tbl == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else if ( self -> tbl != NULL && self -> tbl -> read_only )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcTable, rcReadonly );
-        else
-        {
-            rc = KTableAddRef ( self -> tbl );
-            if ( rc == 0 )
-            {
-                * tbl = self -> tbl;
-                return 0;
-            }
-        }
-
-        * tbl = NULL;
-    }
-
-    return rc;
-}
-
-/* OpenDirectory
- *  duplicate reference to the directory in use
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KColumnOpenDirectoryRead ( const KColumn *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDirectoryAddRef ( self -> dir );
-            if ( rc == 0 )
-            {
-                * dir = self -> dir;
-                return 0;
-            }
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenDirectoryUpdate ( KColumn *self, KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcSelf, rcNull );
-        else if ( self -> dir != NULL && self -> dir -> read_only )
-            rc = RC ( rcDB, rcColumn, rcAccessing, rcDirectory, rcReadonly );
-        else
-        {
-            rc = KDirectoryAddRef ( self -> dir );
-            if ( rc == 0 )
-            {
-                * dir = self -> dir;
-                return 0;
-            }
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KColumnBlob
- *  one or more rows of column data
- */
-struct KColumnBlob
-{
-    /* holds either an existing blob loc
-       or new blob index range */
-    KColBlobLoc loc;
-
-    /* holds old and new page maps */
-    KColumnPageMap pmorig;
-    KColumnPageMap pmnew;
-
-    /* owning column */
-    KColumn *col;
-
-    /* refcount */
-    atomic32_t refcount;
-
-    /* number of bytes written to blob */
-    uint32_t num_writ;
-
-    /* checksums */
-    uint32_t crc32;
-    MD5State md5;
-
-    /* open mode */
-    uint8_t read_only;
-
-    /* for validation */
-    bool bswap;
-};
-
-
-/* Whack
- */
-static
-rc_t KColumnBlobWhack ( KColumnBlob *self )
-{
-    KColumn *col = self -> col;
-    assert ( col != NULL );
-
-    KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-    if ( ! self -> read_only )
-        KColumnPageMapWhack ( & self -> pmnew, & col -> df );
-
-    /* cannot recover from errors here,
-       since the page maps needed whacking first,
-       and the column is needed for that. */
-    KColumnSever ( col );
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KColumnBlobAddRef ( const KColumnBlob *cself )
-{
-    if ( cself != NULL )
-    {
-        atomic32_inc ( & ( ( KColumnBlob* ) cself ) -> refcount );
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnBlobRelease ( const KColumnBlob *cself )
-{
-    KColumnBlob *self = ( KColumnBlob* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KColumnBlobWhack ( self );
-    }
-    return 0;
-}
-
-/* OpenRead
- * OpenUpdate
- */
-static
-rc_t KColumnBlobOpenRead ( KColumnBlob *self, const KColumn *col, int64_t id )
-{
-    /* locate blob */
-    rc_t rc = KColumnIdxLocateBlob ( & col -> idx, & self -> loc, id, id );
-    if ( rc == 0 )
-    {
-        /* indicates not written */
-        /*assert ( self -> num_writ == 0 );*/
-
-        /* open page map to blob */
-        rc = KColumnPageMapOpen ( & self -> pmorig,
-            ( KColumnData* ) & col -> df, self -> loc . pg, self -> loc . u . blob . size );
-        if ( rc == 0 )
-        {
-            /* existing blob must have proper checksum bytes */
-            if ( self -> loc . u . blob . size >= col -> csbytes )
-            {
-                /* remove them from apparent blob size */
-                self -> loc . u . blob . size -= col -> csbytes;
-                return 0;
-            }
-
-            /* the blob is corrupt */
-            KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-            rc = RC ( rcDB, rcBlob, rcOpening, rcBlob, rcCorrupt );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t KColumnBlobOpenUpdate ( KColumnBlob *self, KColumn *col, int64_t id )
-{
-    /* open existing blob */
-    rc_t rc = KColumnBlobOpenRead ( self, col, id );
-    if ( rc == 0 )
-    {
-        /* create a new page map for replacement */
-        rc = KColumnPageMapCreate ( & self -> pmnew, & col -> df );
-        if ( rc == 0 )
-        {
-            /* initialize for writing checksums */
-            switch ( col -> checksum )
-            {
-            case kcsCRC32:
-                self -> crc32 = 0;
-                break;
-            case kcsMD5:
-                MD5StateInit ( & self -> md5 );
-                break;
-            }
-        }
-
-        /* tear down results of opening for read */
-        KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-    }
-
-    return rc;
-}
-
-/* Create
- */
-static
-rc_t KColumnBlobCreate ( KColumnBlob *self, KColumn *col )
-{
-    rc_t rc;
-
-    if ( col -> md5 != NULL )
-    {
-	/* this perhaps should be split into wcoldat.c and wcolidx.c */
-	rc = KMD5FileBeginTransaction ( col -> df . fmd5 );
-	if ( rc == 0 )
-	{
-	    rc = KMD5FileBeginTransaction ( col -> idx . idx2 . fmd5 );
-	    if ( rc == 0 )
-	    {
-		rc = KMD5FileBeginTransaction ( col -> idx . idx0 . fmd5 );
-		if ( rc == 0 )
-		{
-		    rc = KMD5FileBeginTransaction ( col -> idx . idx1 . fmd5 );
-		    if ( rc == 0 )
-		    {
-			rc = KMD5FileBeginTransaction ( col -> idx . idx1 . fidxmd5 );
-			if ( rc != 0 )
-			    KMD5FileCommit ( col -> idx . idx1 .  fmd5 );
-		    }
-		    if ( rc != 0 )
-			KMD5FileCommit ( col -> idx . idx0 .  fmd5 );
-		}
-		if ( rc != 0 )
-		    KMD5FileCommit ( col -> idx . idx2 .  fmd5 );
-	    }
-	    if ( rc != 0 )
-		KMD5FileCommit ( col -> df . fmd5 );
-	}
-	if ( rc != 0 )
-	    return rc;
-    }
-
-    /* no location yet */
-    memset ( & self -> loc, 0, sizeof self -> loc );
-
-    /* invalid existing page map */
-    memset ( & self -> pmorig, 0, sizeof self -> pmorig );
-
-    /* create a new page map */
-    rc = KColumnPageMapCreate ( & self -> pmnew, & col -> df );
-    if ( rc == 0 )
-    {
-        /* initialize for writing checksums */
-        switch ( col -> checksum )
-        {
-        case kcsCRC32:
-            self -> crc32 = 0;
-            break;
-        case kcsMD5:
-            MD5StateInit ( & self -> md5 );
-            break;
-        }
-    }
-
-    return rc;
-}
-
-/* Make
- */
-static
-rc_t KColumnBlobMake ( KColumnBlob **blobp, bool bswap )
-{
-    KColumnBlob *blob = malloc ( sizeof * blob );
-    if ( blob == NULL )
-        return RC ( rcDB, rcBlob, rcConstructing, rcMemory, rcExhausted );
-
-    memset ( blob, 0, sizeof * blob );
-    atomic32_set ( & blob -> refcount, 1 );
-    blob -> bswap = bswap;
-
-    * blobp = blob;
-    return 0;
-}
-
-/* OpenBlobRead
- * OpenBlobUpdate
- *  opens an existing blob containing row data for id
- */
-LIB_EXPORT rc_t CC KColumnOpenBlobRead ( const KColumn *self, const KColumnBlob **blobp, int64_t id )
-{
-    rc_t rc;
-    KColumnBlob *blob;
-
-    if ( blobp == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-    * blobp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-
-    rc = KColumnBlobMake ( & blob, self -> idx . idx1 . bswap );
-    if ( rc == 0 )
-    {
-        rc = KColumnBlobOpenRead ( blob, self, id );
-        if ( rc == 0 )
-        {
-            blob -> col = KColumnAttach ( self );
-            blob -> read_only = true;
-            * blobp = blob;
-            return 0;
-        }
-        
-        free ( blob );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenBlobUpdate ( KColumn *self, KColumnBlob **blobp, int64_t id )
-{
-    rc_t rc;
-
-    if ( blobp == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-    * blobp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-    if ( self -> read_only )
-        return RC ( rcDB, rcColumn, rcOpening, rcColumn, rcReadonly );
-
-    rc = KColumnBlobMake ( blobp, self -> idx . idx1 . bswap );
-    if ( rc == 0 )
-    {
-        KColumnBlob *blob = * blobp;
-        rc = KColumnBlobOpenUpdate ( blob, self, id );
-        if ( rc == 0 )
-        {
-            blob -> col = KColumnAttach ( self );
-            * blobp = blob;
-            return 0;
-        }
-                    
-        free ( blob );
-    }
-
-    return rc;
-}
-
-/* CreateBlob
- *  creates a new, unassigned blob
- */
-LIB_EXPORT rc_t CC KColumnCreateBlob ( KColumn *self, KColumnBlob **blobp )
-{
-    rc_t rc;
-
-    if ( blobp == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-    * blobp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-    if ( self -> read_only )
-        return RC ( rcDB, rcColumn, rcOpening, rcColumn, rcReadonly );
-
-    rc = KColumnBlobMake ( blobp, self -> idx . idx1 . bswap );
-    if ( rc == 0 )
-    {
-        KColumnBlob *blob = * blobp;
-        rc = KColumnBlobCreate ( blob, self );
-        if ( rc == 0 )
-        {
-            blob -> col = KColumnAttach ( self );
-            * blobp = blob;
-            return 0;
-        }
-                    
-        free ( blob );
-    }
-
-    return rc;
-}
-
-/* IdRange
- *  returns id range for blob
- *
- *  "first" [ OUT, NULL OKAY ] - optional return parameter for first id
- *
- *  "last" [ OUT, NULL OKAY ] - optional return parameter for last id
- */
-LIB_EXPORT rc_t CC KColumnBlobIdRange ( const KColumnBlob *self, int64_t *first, uint32_t *count )
-{
-    rc_t rc;
-
-    if ( first == NULL || count == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else if ( self == NULL )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcSelf, rcNull );
-    else if ( self -> loc . id_range == 0 )
-        rc = RC ( rcDB, rcBlob, rcAccessing, rcRange, rcEmpty );
-    else
-    {
-        * first = self -> loc . start_id;
-        * count = self -> loc . id_range;
-        return 0;
-    }
-
-    if ( first != NULL )
-        * first = 0;
-    if ( count != NULL )
-        * count = 0;
-
-    return rc;
-}
-
-/* KColumnBlobValidate
- *  runs checksum validation on unmodified blob
- */
-static
-rc_t KColumnBlobValidateCRC32 ( const KColumnBlob *self )
-{
-    rc_t rc;
-    const KColumn *col = self -> col;
-
-    uint8_t buffer [ 1024 ];
-    size_t to_read, num_read, total, size;
-
-    uint32_t cs, crc32 = 0;
-
-    /* calculate checksum */
-    for ( size = self -> loc . u . blob. size, total = 0; total < size; total += num_read )
-    {
-        to_read = size - total;
-        if ( to_read > sizeof buffer )
-            to_read = sizeof buffer;
-
-        rc = KColumnDataRead ( & col -> df,
-            & self -> pmorig, total, buffer, to_read, & num_read );
-        if ( rc != 0 )
-            return rc;
-        if ( num_read == 0 )
-            return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-        crc32 = CRC32 ( crc32, buffer, num_read );
-    }
-
-    /* read stored checksum */
-    rc = KColumnDataRead ( & col -> df,
-        & self -> pmorig, size, & cs, sizeof cs, & num_read );
-    if ( rc != 0 )
-        return rc;
-    if ( num_read != sizeof cs )
-        return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-    if ( self -> bswap )
-        cs = bswap_32 ( cs );
-
-    if ( cs != crc32 )
-        return RC ( rcDB, rcBlob, rcValidating, rcBlob, rcCorrupt );
-
-    return 0;
-}
-
-static
-rc_t KColumnBlobValidateMD5 ( const KColumnBlob *self )
-{
-    rc_t rc;
-    const KColumn *col = self -> col;
-
-    uint8_t buffer [ 1024 ];
-    size_t to_read, num_read, total, size;
-
-    MD5State md5;
-    uint8_t digest [ 16 ];
-
-    MD5StateInit ( & md5 );
-
-    /* calculate checksum */
-    for ( size = self -> loc . u . blob . size, total = 0; total < size; total += num_read )
-    {
-        to_read = size - total;
-        if ( to_read > sizeof buffer )
-            to_read = sizeof buffer;
-
-        rc = KColumnDataRead ( & col -> df,
-            & self -> pmorig, total, buffer, to_read, & num_read );
-        if ( rc != 0 )
-            return rc;
-        if ( num_read == 0 )
-            return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-        MD5StateAppend ( & md5, buffer, num_read );
-    }
-
-    /* read stored checksum */
-    rc = KColumnDataRead ( & col -> df,
-        & self -> pmorig, size, buffer, sizeof digest, & num_read );
-    if ( rc != 0 )
-        return rc;
-    if ( num_read != sizeof digest )
-        return RC ( rcDB, rcBlob, rcValidating, rcTransfer, rcIncomplete );
-
-    /* finish MD5 digest */
-    MD5StateFinish ( & md5, digest );
-
-    if ( memcmp ( buffer, digest, sizeof digest ) != 0 )
-        return RC ( rcDB, rcBlob, rcValidating, rcBlob, rcCorrupt );
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KColumnBlobValidate ( const KColumnBlob *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcBlob, rcValidating, rcSelf, rcNull );
-
-    if ( self -> num_writ != 0 )
-        return RC ( rcDB, rcBlob, rcValidating, rcBlob, rcBusy );
-
-    if ( self -> loc . u . blob . size != 0 ) switch ( self -> col -> checksum )
-    {
-    case kcsCRC32:
-        return KColumnBlobValidateCRC32 ( self );
-    case kcsMD5:
-        return KColumnBlobValidateMD5 ( self );
-    }
-
-    return 0;
-}
-
-/* KColumnBlobRead
- *  read data from blob
- *
- *  "offset" [ IN ] - starting offset into blob
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read. specifically,
- *  "offset" + "num_read" + "remaining" == sizeof blob
- */
-LIB_EXPORT rc_t CC KColumnBlobRead ( const KColumnBlob *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining )
-{
-    rc_t rc;
-    const KColumnPageMap *pm;
-
-    size_t ignore;
-    if ( remaining == NULL )
-        remaining = & ignore;
-
-    if ( num_read == NULL )
-        rc = RC ( rcDB, rcBlob, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcBlob, rcReading, rcSelf, rcNull );
-        else
-        {
-            size_t size = self -> num_writ;
-            const KColumn *col = self -> col;
-
-            if ( size != 0 )
-                pm = & self -> pmnew;
-            else
-            {
-                pm = & self -> pmorig;
-                size = self -> loc . u . blob . size;
-            }
-
-            if ( offset > size )
-                offset = size;
-
-            if ( bsize == 0 )
-                rc = 0;
-            else if ( buffer == NULL )
-                rc = RC ( rcDB, rcBlob, rcReading, rcBuffer, rcNull );
-            else
-            {
-                size_t to_read = size - offset;
-                if ( to_read > bsize )
-                    to_read = bsize;
-                rc = KColumnDataRead ( & col -> df,
-                    pm, offset, buffer, to_read, num_read );
-                if ( rc == 0 )
-                {
-                    * remaining = size - offset - * num_read;
-                    return 0;
-                }
-            }
-
-            * remaining = size - offset;
-            * num_read = 0;
-            return rc;
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-    return rc;
-}
-
-/* KColumnBlobAppend
- *  append data to open blob
- *
- *  "buffer" [ IN ] and "size" [ IN ] - blob data
- */
-LIB_EXPORT rc_t CC KColumnBlobAppend ( KColumnBlob *self, const void *buffer, size_t size )
-{
-    KColumn *col;
-    size_t total, num_writ;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcBlob, rcWriting, rcSelf, rcNull );
-
-    /* data fork will refuse write anyway, but... */
-    if ( self -> read_only )
-        return RC ( rcDB, rcBlob, rcWriting, rcBlob, rcReadonly );
-
-    col = self -> col;
-
-    for ( total = 0; total < size; total += num_writ )
-    {
-        rc_t rc = KColumnDataWrite ( & col -> df,
-            & self -> pmnew, self -> num_writ + total,
-            ( const char* ) buffer + total, size - total, & num_writ );
-        if ( rc != 0 )
-            return rc;
-        if ( num_writ == 0 )
-            return RC ( rcDB, rcBlob, rcWriting, rcTransfer, rcIncomplete );
-    }
-
-    self -> num_writ += size;
-
-    switch ( col -> checksum )
-    {
-    case kcsCRC32:
-        self -> crc32 = CRC32 ( self -> crc32, buffer, size );
-        break;
-    case kcsMD5:
-        MD5StateAppend ( & self -> md5, buffer, size );
-        break;
-    }
-    
-    return 0;
-}
-
-/* KColumnBlobAssignRange
- *  assign a total id range to blob at any time before commit
- *
- *  "first" [ IN ] and "count" [ IN ] - range parameters for assign
- */
-LIB_EXPORT rc_t CC KColumnBlobAssignRange ( KColumnBlob *self, int64_t first, uint32_t count )
-{
-    rc_t rc;
-    const KColumn *col;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcBlob, rcUpdating, rcSelf, rcNull );
-
-    if ( count == 0 )
-        return RC ( rcDB, rcBlob, rcUpdating, rcRange, rcEmpty );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcBlob, rcUpdating, rcBlob, rcReadonly );
-
-    if ( self -> loc . id_range != 0 )
-    {
-        /* allow benign reassignment */
-        if ( self -> loc . start_id == first &&
-             self -> loc . id_range == count )
-            return 0;
-
-        /* can't be reset */
-        return RC ( rcDB, rcBlob, rcUpdating, rcBlob, rcBusy );
-    }
-
-    col = self -> col;
-
-    /* try to open read map */
-    rc = KColumnBlobOpenRead ( self, col, first );
-    if ( rc == 0 )
-    {
-        /* blob already exists
-           again, allow benign reassignment */                    
-        if ( self -> loc . start_id == first &&
-             self -> loc . id_range == count )
-            return 0;
-
-        /* conflicting assignment */
-        KColumnPageMapWhack ( & self -> pmorig, & col -> df );
-        memset ( & self -> loc, 0, sizeof self -> loc );
-        memset ( & self -> pmorig, 0, sizeof self -> pmorig );
-        return RC ( rcDB, rcBlob, rcUpdating, rcRange, rcIncorrect );
-    }
-
-    /* expect status of not found */
-    if ( GetRCState ( rc ) != rcNotFound )
-        return rc;
-
-    /* assign the range */
-    self -> loc . pg = 0;
-    self -> loc . u . blob . remove = 0;
-    self -> loc . start_id = first;
-    self -> loc . id_range = count;
-    return 0;
-}
-
-/* KColumnBlobCommit
- *  commit changes to blob
- *  close to further updates
- */
-static
-char zero [ 4096 ];
-
-static
-rc_t KColumnBlobZeroPad ( KColumnBlob *self )
-{
-    KColumn *col = self -> col;
-    size_t pad_bytes = self -> num_writ % col -> df . pgsize;
-    if ( pad_bytes != 0 )
-    {
-        size_t total, num_writ;
-
-        pad_bytes = col -> df . pgsize - pad_bytes;
-        for ( total = 0; total < pad_bytes; total += num_writ )
-        {
-            rc_t rc;
-
-            size_t to_write = pad_bytes - total;
-            if ( to_write > sizeof zero )
-                to_write = sizeof zero;
-
-            rc = KColumnDataWrite ( & col -> df,
-                & self -> pmnew, self -> num_writ + total,
-                zero, to_write, & num_writ );
-            if ( rc != 0 )
-                return rc;
-            if ( num_writ == 0 )
-                return RC ( rcDB, rcBlob, rcCommitting, rcTransfer, rcIncomplete );
-        }
-    }
-    return 0;
-}
-
-static
-rc_t KColumnBlobDoCommit ( KColumnBlob *self )
-{
-    rc_t rc;
-    KColBlobLoc loc;
-    KColumn *col = self -> col;
-
-    /* finish checksum */
-    if ( col -> csbytes != 0 )
-    {
-        MD5State md5;
-        uint32_t crc32;
-        uint8_t digest [ 16 ];
-
-        void *cs;
-        size_t num_writ;
-
-        switch ( col -> checksum )
-        {
-        case kcsCRC32:
-            crc32 = self -> crc32;
-            if ( self -> bswap )
-                crc32 = bswap_32 ( crc32 );
-            cs = & crc32;
-            break;
-        case kcsMD5:
-        default: /* to quiet compiler warnings */
-            /* work on copy in case of failure */
-            md5 = self -> md5;
-            MD5StateFinish ( & md5, digest );
-            cs = digest;
-            break;
-        }
-
-        rc = KColumnDataWrite ( & col -> df,
-            & self -> pmnew, self -> num_writ,
-            cs, col -> csbytes, & num_writ );
-        if ( rc != 0 )
-            return rc;
-        if ( num_writ != col -> csbytes )
-            return RC ( rcDB, rcBlob, rcCommitting, rcTransfer, rcIncomplete );
-
-        self -> num_writ += num_writ;
-    }
-
-    /* extract index information */
-    rc = KColumnPageMapId ( & self -> pmnew, & col -> df, & loc . pg );
-    if ( rc == 0 )
-    {
-        loc . u . blob . size = ( uint32_t ) self -> num_writ;
-        loc . u . blob . remove = 0;
-        loc . start_id = self -> loc . start_id;
-        loc . id_range = self -> loc . id_range;
-
-        /* pad out rest of page */
-        if ( col -> df . pgsize > 1 )
-            rc = KColumnBlobZeroPad ( self );
-        if ( rc == 0 )
-        {
-            /* commit data fork */
-            rc = KColumnDataCommit ( & col -> df,
-                & self -> pmnew, self -> num_writ );
-            if ( rc == 0 )
-            {
-                /* commit index fork */
-                rc = KColumnIdxCommit ( & col -> idx, col -> md5,
-                    & loc, col -> commit_freq, col -> df . eof,
-                    col -> df . pgsize, col -> checksum );
-                if ( rc == 0 || rc == kdbReindex )
-                {
-                    rc_t status = rc;
-
-                    /* release old pages */
-                    if ( self -> loc . u . blob . size == 0 )
-                        rc = 0;
-                    else
-                    {
-                        rc = KColumnDataFree ( & col -> df,
-                            & self -> pmorig, self -> loc . u . blob . size + col -> csbytes );
-                        if ( GetRCState ( rc ) == rcInvalid )
-                            rc = 0;
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        /* transfer new map */
-                        self -> pmorig = self -> pmnew;
-                        memset ( & self -> pmnew, 0, sizeof self -> pmnew );
-
-                        /* fill out location */
-                        loc . u . blob . size -= col -> csbytes;
-                        self -> loc = loc;
-
-                        /* HACK - should open new pm on demand
-                           but since the code does not yet support it,
-                           disallow further writes */
-                        self -> read_only = true;
-                        
-                        /* mark blob as clean */
-                        self -> num_writ = 0;
-
-			/* these must not be a point of failure 
-			   The only failure from the KMD5FileCommit
-			   behind these is on NULL parameter */
-			rc = KColumnDataCommitDone ( & col -> df );
-			if ( rc == 0 )
-			    rc = KColumnIdxCommitDone ( & col -> idx );
-
-                        return status;
-                    }
-                }
-
-                /* revert data fork */
-                KColumnDataFree ( & col -> df,
-                    & self -> pmnew, self -> num_writ );
-		KMD5FileRevert ( self -> col -> df . fmd5 );
-            }
-        }
-    }
-
-    /* remove checksum bytes */
-    self -> num_writ -= col -> csbytes;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnBlobCommit ( KColumnBlob *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcBlob, rcCommitting, rcSelf, rcNull );
-
-    if ( self -> loc . id_range == 0 )
-        return RC ( rcDB, rcBlob, rcCommitting, rcRange, rcInvalid );
-
-    if ( self -> num_writ == 0 && self -> loc . u . blob . size != 0 )
-        return 0;
-
-    assert ( self -> read_only == false );
-
-    rc = KColumnBlobDoCommit ( self );
-
-    if ( rc == kdbReindex )
-        rc = KColumnReindex ( self -> col );
-
-    return rc;
-}
diff --git a/libs/kdb/wdatabase-priv.h b/libs/kdb/wdatabase-priv.h
deleted file mode 100644
index 958089e..0000000
--- a/libs/kdb/wdatabase-priv.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_database_priv_
-#define _h_database_priv_
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifndef _h_kdb_database_
-#include <kdb/database.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#include <klib/symbol.h>
-#include <kfs/md5.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  connection to a database within file system
- */
-struct KDatabase
-{
-    /* manager reference */
-    KDBManager *mgr;
-
-    /* if a sub-directory */
-    KDatabase *dad;
-
-    /* database directory */
-    KDirectory *dir;
-
-    KMD5SumFmt *md5;
-
-    /* open references */
-    KRefcount refcount;
-    uint32_t opencount;
-    bool use_md5;
-    bool read_only;
-
-    KSymbol sym;
-
-    char path [1];
-};
-
-/* Attach
- * Sever
- *  like AddRef/Release, except called internally
- *  indicates that a child object is letting go...
- */
-KDatabase *KDatabaseAttach ( const KDatabase *self );
-rc_t KDatabaseSever ( const KDatabase *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_database_priv_ */
diff --git a/libs/kdb/wdatabase.c b/libs/kdb/wdatabase.c
deleted file mode 100644
index 0d29f89..0000000
--- a/libs/kdb/wdatabase.c
+++ /dev/null
@@ -1,1503 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#include "wtable-priv.h"
-#include "windex-priv.h"
-#include "wkdb-priv.h"
-#include <klib/namelist.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <kfs/md5.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KDatabase
- *  connection to a database within file system
- */
-
-/* GetPath
- *  return the absolute path to DB
- */
-LIB_EXPORT rc_t CC KDatabaseGetPath ( struct KDatabase const *self,
-    const char **path )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    *path = self->path;
-    return 0;
-}
-
-/* Whack
- */
-static
-rc_t KDatabaseWhack ( KDatabase *self )
-{
-    rc_t rc = 0;
-    KDBManager *mgr = self -> mgr;
-    KSymbol * symb;
-    assert ( mgr != NULL );
-
-    KRefcountWhack ( & self -> refcount, "KDatabase" );
-
-    /* release dad */
-    if ( self -> dad != NULL )
-    {
-        rc = KDatabaseSever ( self -> dad );
-        if ( rc != 0 )
-            return rc;
-        self -> dad = NULL;
-    }
-
-    /* shut down md5 sum file if it is open */
-    KMD5SumFmtRelease ( self -> md5 ), self -> md5 = NULL;
-
-    /* remove from mgr */
-    symb = KDBManagerOpenObjectFind (mgr, self->path);
-    if (symb != NULL)
-    {
-        rc = KDBManagerOpenObjectDelete (mgr, symb);
-        if (rc == 0)
-        {
-            /* release manager
-               should never fail */
-            rc = KDBManagerSever ( mgr );
-            if ( rc != 0 )
-                rc = KDBManagerOpenObjectAdd (mgr, symb);
-            else
-            {
-                /* complete */
-                KDirectoryRelease ( self -> dir );
-                free ( self );
-                return 0;
-            }
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KDatabase", "whack", "kdb" );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KDatabaseAddRef ( const KDatabase *cself )
-{
-    KDatabase *self = ( KDatabase* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
-        }
-        ++ self -> opencount;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDatabaseRelease ( const KDatabase *cself )
-{
-    KDatabase *self = ( KDatabase* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-        -- self -> opencount;
-    }
-    return 0;
-}
-
-
-/* Attach
- */
-KDatabase *KDatabaseAttach ( const KDatabase *cself )
-{
-    KDatabase *self = ( KDatabase* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return self;
-}
-
-/* Sever
- *  like Release, except called internally
- *  indicates that a child object is letting go...
- */
-rc_t KDatabaseSever ( const KDatabase *cself )
-{
-    KDatabase *self = ( KDatabase* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDatabase" ) )
-        {
-        case krefWhack:
-            return KDatabaseWhack ( ( KDatabase* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- *  make an initialized structure
- *  NB - does NOT attach reference to dir, but steals it
- */
-static
-rc_t KDatabaseMake ( KDatabase **dbp, const KDirectory *dir,
-    const char *path, KMD5SumFmt *md5, bool read_only )
-{
-    KDatabase *db;
-    rc_t rc = 0;
-
-    assert ( dbp != NULL );
-    assert ( path != NULL );
-
-    db = malloc ( sizeof * db + strlen ( path ) );
-    if ( db == NULL )
-    {
-        * dbp = NULL;
-        return RC ( rcDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    memset ( db, 0, sizeof * db );
-    db -> dir = ( KDirectory* ) dir;
-    db -> md5 = md5;
-    rc = KMD5SumFmtAddRef ( md5 );
-    db -> use_md5 = ( md5 == NULL ) ? false : true;
-    KRefcountInit ( & db -> refcount, 1, "KDatabase", "make", path );
-    db -> opencount = 1;
-    db -> read_only = read_only;
-
-    strcpy ( db -> path, path );
-
-    db->sym.u.obj = db;
-    StringInitCString (&db->sym.name, db->path);
-    db->sym.type = kptDatabase;
-
-    * dbp = db;
-    return rc;
-}
-
-
-static
-rc_t KDBManagerInsertDatabase ( KDBManager * self, KDatabase * db )
-{
-    rc_t rc;
-    rc = KDBManagerOpenObjectAdd (self, &db->sym);
-    if ( rc == 0 )
-        db -> mgr = KDBManagerAttach ( self );
-    return rc;
-}
-
-
-static
-rc_t KDBManagerMakeDBUpdate ( KDBManager *self,
-    KDatabase **dbp, KDirectory *wd, const char *path, KMD5SumFmt *md5 )
-{
-    rc_t rc;
-    KDirectory *dir;
-
-    rc = KDirectoryVOpenDirUpdate ( wd, & dir, false, path, NULL );
-    if ( rc == 0 )
-    {
-        KDatabase *db;
-	    
-        /* Make the base object */
-        rc = KDatabaseMake ( & db, dir, path, md5, false );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerInsertDatabase ( self, db );
-
-            if ( rc == 0 )
-            {
-                * dbp = db;
-                return 0;   /* successful exit */
-            }
-
-            rc = RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcBusy );
-                
-            free ( db );
-        }
-        KDirectoryRelease ( dir );
-    }
-    return rc;
-}
-
-
-/* CreateDB
- * VCreateDB
- *  create a new or open an existing database
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KDBManagerVCreateDBInt ( KDBManager *self,
-    KDatabase **db, KDirectory *wd, KCreateMode cmode,
-    const char *path, va_list args )
-{
-    char dbpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        dbpath, sizeof dbpath, path, args );
-    if ( rc == 0 )
-    {
-        /* we won't try accession resolution here */
-        int type = KDBPathType ( /*NULL,*/ wd, NULL, dbpath );
-        switch ( type )
-        {
-        case kptNotFound:
-            /* first good path */
-            break;
-
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcInvalid );
-
-        case kptDatabase:
-        case kptDatabase | kptAlias:
-            /* found so is not good if we want to create new and not
-             * clear/init or open old
-             */
-            if ((cmode & kcmValueMask) == kcmCreate)
-                return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcExists );
-            if (KDBManagerOpenObjectBusy (self, dbpath))
-                return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcBusy );
-            /* test now for locked directory */
-            rc = KDBWritable ( wd, dbpath );
-            if (rc)
-            {
-                switch (GetRCState(rc))
-                {
-                default:
-                    return rc;
-                case rcLocked:
-                    return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcLocked );
-                case rcReadonly:
-                    return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcReadonly );
-                case rcNotFound:
-                    /* not found is good but probably unreachable */
-                    break;
-                case 0:
-                    rc = 0;
-                    break;
-                }
-            }
-            /* second good path */
-            break;
-
-        case kptTable:
-        case kptTable | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcTable, rcExists);
-
-        case kptColumn:
-        case kptColumn | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcColumn, rcExists);
-
-        case kptIndex:
-        case kptIndex | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcIndex, rcExists);
-
-        case kptMetadata:
-        case kptMetadata | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcMetadata, rcExists);
-
-	case kptFile:
-	case kptFile | kptAlias:
-	    /* if we find a file, vary the failure if it is an archive that is a database
-	     * or a non related file */
-	    if ( KDBOpenPathTypeRead ( self, wd, dbpath, NULL, kptDatabase, NULL, false ) == 0 )
-		return RC ( rcDB, rcMgr, rcCreating, rcDirectory, rcUnauthorized );
-	    /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcIncorrect );
-        }
-
-        /* [re]create directory */
-        rc = KDirectoryVCreateDir ( wd, 0775, cmode, dbpath, NULL );
-        if (rc == 0)
-            /* create tbl subdirectory as required for db */
-            rc = KDirectoryCreateDir ( wd, 0775, kcmOpen, "%s/tbl", dbpath );
-
-        if ( rc == 0 )
-        {
-            KMD5SumFmt *md5 = NULL;
-
-            if ( ( cmode & kcmMD5 ) != 0 )
-            {
-                KFile * f;
-
-                /* if needed create the md5 digest file */
-                rc = KDirectoryCreateFile ( wd, &f, true, 0664, kcmOpen, "%s/md5", dbpath );
-                if ( rc == 0 )
-                {
-                    /* create a formatter around file
-                       formatter will own "f" afterward */
-                    rc = KMD5SumFmtMakeUpdate ( & md5, f );
-
-                    /* if failed to create formatter, release "f" */
-                    if ( rc != 0 )
-                        KFileRelease ( f );
-                }
-            }
-
-            if ( rc == 0 )
-                rc = KDBManagerMakeDBUpdate ( self, db, wd, dbpath, md5 );
-
-            KMD5SumFmtRelease ( md5 );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVCreateDB ( KDBManager *self,
-    KDatabase **db, KCreateMode cmode, const char *path, va_list args )
-{
-    if ( db == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcParam, rcNull );
-
-    * db = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcSelf, rcNull );
-
-    return KDBManagerVCreateDBInt ( self, db, self -> wd, cmode, path, args );
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerCreateDB ( KDBManager *self,
-    KDatabase **db, KCreateMode cmode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVCreateDB ( self, db, cmode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* =====
- * create a KDatabase as a sub of another KDatabase
- */
-LIB_EXPORT rc_t CC KDatabaseCreateDB ( KDatabase *self,
-    KDatabase **db, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVCreateDB ( self, db, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVCreateDB ( KDatabase *self,
-    KDatabase **dbp, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( dbp == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcParam, rcNull );
-
-    * dbp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcCreating, rcDatabase, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "db", 2, name, args );
-    if ( rc == 0 )
-    {
-        /* ensure that the "db" namespace directory is there */
-        rc = KDirectoryVCreateDir ( self -> dir,
-            0775, kcmOpen, "db", NULL );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerVCreateDBInt ( self -> mgr, dbp,
-                self -> dir, cmode, path, NULL );
-            if ( rc == 0 )
-            {
-                KDatabase *db = ( KDatabase* ) * dbp;
-                db -> dad = self;
-                atomic32_inc ( & self -> refcount );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* OpenDBRead
- * VOpenDBRead
- *  open a database for read
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KDBManagerVOpenDBReadInt ( const KDBManager *cself,
-    const KDatabase **dbp, KDirectory *wd,
-    const char *path, va_list args, bool *cached, bool try_srapath )
-{
-    rc_t rc;
-    char dbpath [4096];
-    size_t z;
-
-    rc = string_vprintf (dbpath, sizeof dbpath, &z, path, args);
-    if ( rc == 0 )
-    {
-        KSymbol *sym;
-
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (cself, dbpath);
-        if (sym != NULL)
-        {
-            const KDatabase *cdb;
-            rc_t obj;
-
-            if ( cached != NULL )
-                * cached = true;
-
-            switch (sym->type)
-            {
-            case kptDatabase:
-                cdb = (KDatabase*)sym->u.obj;
-                /* if open for update, refuse */
-                if ( cdb -> read_only )
-                {
-                    /* attach a new reference and we're gone */
-                    rc = KDatabaseAddRef ( cdb );
-                    if ( rc == 0 )
-                        * dbp = cdb;
-                    return rc;
-                }
-                obj = rcDatabase;
-                break;
-
-            default:
-                obj = rcPath;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            rc = RC (rcDB, rcMgr, rcOpening, obj, rcBusy);
-        }
-        else
-        {
-            const KDirectory *dir;
-
-            if ( cached != NULL )
-                * cached = false;
-
-            /* open the directory if its a database */
-            rc = KDBOpenPathTypeRead ( cself, wd, dbpath, &dir, kptDatabase, NULL, try_srapath );
-            if ( rc == 0 )
-            {
-                KDatabase *db;
-
-                rc = KDatabaseMake ( &db, dir, dbpath, NULL, true );
-                if ( rc == 0 )
-                {
-                    KDBManager *self = ( KDBManager* ) cself;
-
-                    rc = KDBManagerInsertDatabase ( self, db );
-                    if ( rc == 0 )
-                    {
-                        * dbp = db;
-                        return 0;
-                    }
-                    free (db);
-                }
-                KDirectoryRelease (dir);
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDBManagerOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenDBRead ( self, db, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenDBRead ( const KDBManager *self,
-    const KDatabase **db, const char *path, va_list args )
-{
-    if ( db == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * db = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenDBReadInt ( self, db, self -> wd, path, args, NULL, true );
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenDBRead ( const KDatabase *self,
-    const KDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenDBRead ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenDBRead ( const KDatabase *self,
-    const KDatabase **dbp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( dbp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * dbp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "db", 2, name, args );
-    if ( rc == 0 )
-    {
-        bool is_cached;
-        rc = KDBManagerVOpenDBReadInt ( self -> mgr, dbp,
-                                        self -> dir, path, NULL, & is_cached, false );
-        if ( rc == 0 && ! is_cached )
-        {
-            KDatabase *db = ( KDatabase* ) * dbp;
-            db -> dad = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* OpenDBUpdate
- * VOpenDBUpdate
- *  open a database for read/write
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-static
-rc_t KDBManagerVOpenDBUpdateInt ( KDBManager *self,
-    KDatabase **db, KDirectory *wd, const char *path, va_list args )
-{
-    char dbpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        dbpath, sizeof dbpath, path, args );
-    if ( rc == 0 )
-    {
-        KSymbol * sym;
-        KFile *f;
-        KMD5SumFmt * md5 = NULL;
-
-        /* if already open, refuse */
-        sym = KDBManagerOpenObjectFind (self, dbpath);
-        if (sym != NULL)
-        {
-            rc_t obj;
-            switch (sym->type)
-            {
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return RC ( rcDB, rcMgr, rcOpening, obj, rcBusy );
-        }
-        /* only open existing dbs */
-        switch (KDBPathType ( /*self,*/ wd, NULL, dbpath ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-	case kptFile:
-	case kptFile | kptAlias:
-	    /* if we find a file, vary the failure if it is an archive that is a database
-	     * or a non related file */
-	    if ( KDBOpenPathTypeRead ( self, wd, dbpath, NULL, kptDatabase, NULL, false ) == 0 )
-		return RC ( rcDB, rcMgr, rcOpening, rcDirectory, rcUnauthorized );
-	    /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        case kptDatabase:
-        case kptDatabase | kptAlias:
-            break;
-        }
-
-        /* test now for locked directory */
-        rc = KDBWritable (wd, dbpath);
-        switch (GetRCState (rc))
-        {
-        default:
-#if 0
-            return RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcNoPerm ); /* TBD: better state? */
-#endif
-
-        case rcLocked:
-            return RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcLocked );
-
-        case rcReadonly:
-            return RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcReadonly );
-
-
-        case 0:
-            rc = 0;
-            break;
-        }
-
-        rc = KDirectoryOpenFileWrite ( wd, &f, true, "%s/md5", dbpath );
-        if ( rc == 0 )
-        {
-            rc = KMD5SumFmtMakeUpdate ( & md5, f );
-            if ( rc != 0 )
-                KFileRelease ( f );
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-            rc = 0;
-
-        if ( rc == 0 )
-            rc = KDBManagerMakeDBUpdate ( self, db, wd, dbpath, md5 );
-
-        KMD5SumFmtRelease ( md5 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenDBUpdate ( KDBManager *self,
-    KDatabase **db, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenDBUpdate ( self, db, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenDBUpdate ( KDBManager *self,
-    KDatabase **db, const char *path, va_list args )
-{
-    if ( db == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * db = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenDBUpdateInt ( self, db, self -> wd, path, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenDBUpdate ( KDatabase *self,
-    KDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenDBUpdate ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenDBUpdate ( KDatabase *self,
-    KDatabase **dbp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( dbp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * dbp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcOpening, rcDatabase, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "db", 2, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenDBUpdateInt ( self -> mgr, dbp,
-            self -> dir, path, NULL );
-        if ( rc == 0 )
-        {
-            KDatabase *db = ( KDatabase* ) * dbp;
-            db -> dad = self;
-            atomic32_inc ( & self -> refcount );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KDatabaseLocked ( const KDatabase *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptTable
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT bool CC KDatabaseVExists ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        size_t len;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptDatabase:
-            ns = "db";
-            len = 2;
-            break;
-
-        case kptTable:
-            ns = "tbl";
-            len = 3;
-            break;
-
-        case kptIndex:
-            ns = "idx";
-            len = 3;
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, len, name, args );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile:
-            case kptDir:
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC KDatabaseExists ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KDatabaseVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-LIB_EXPORT bool CC KDatabaseIsAlias ( const KDatabase *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        size_t len;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptDatabase:
-            ns = "db";
-            len = 2;
-            break;
-
-        case kptTable:
-            ns = "tbl";
-            len = 3;
-            break;
-
-        case kptIndex:
-            ns = "idx";
-            len = 3;
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, len, name );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                if ( resolved != NULL && rsize != 0 )
-                {
-                    const KDirectory *sub;
-                    rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
-                    * resolved = 0;
-                    if ( rc != 0 )
-                        PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
-                    else
-                    {
-                        rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
-                        KDirectoryRelease ( sub );
-                        if ( rc != 0 )
-                            PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
-                    }
-                }
-                return true;
-            }
-        }
-    }
-
-    if ( resolved != NULL && rsize != 0 )
-        * resolved = 0;
-
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-static
-rc_t KDatabaseLockInt (const KDatabase  * self, char * path, size_t path_size,
-                        int type, const char * name, va_list args )
-{
-    rc_t rc;
-
-    if (self == NULL)
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    else if (name == NULL)
-        rc =  RC (rcDB, rcMgr, rcAccessing, rcPath, rcNull);
-
-    else
-    {
-        const char * ns;
-        char path [ 256 ];
-
-        ns = KDBGetNamespaceString (type);
-
-        switch (type)
-        {
-        default:
-            rc = RC (rcDB, rcMgr, rcAccessing, rcParam, rcInvalid);
-            break;
-        case kptDatabase:
-        case kptTable:
-/*         case kptIndex: */
-            rc = KDBVMakeSubPath (self->dir, path, sizeof path, ns, strlen (ns),
-                                  name, args);
-            break;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVWritable ( const KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    rc = KDatabaseLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBWritable (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseWritable ( const KDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVWritable ( self, type, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDatabaseVLock ( KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KDatabaseLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBLockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseLock ( KDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVLock (self, type, name, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDatabaseVUnlock ( KDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KDatabaseLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBUnlockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseUnlock ( KDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, name );
-    rc = KDatabaseVUnlock (self, type, name, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* Rename
- */
-LIB_EXPORT rc_t CC KDatabaseRenameDB ( KDatabase *self, bool force, const char *from, const char *to )
-{
-    return KDBRename ( self -> dir, self -> mgr, kptDatabase, force, from, to );
-}
-
-LIB_EXPORT rc_t CC KDatabaseRenameTable ( KDatabase *self, bool force, const char *from, const char *to )
-{
-    return KDBRename ( self -> dir, self -> mgr, kptTable, force, from, to );
-}
-
-#if 1
-LIB_EXPORT rc_t CC KDatabaseRenameIndex ( KDatabase *self, bool force, const char *from, const char *to )
-{
-    return KDBRename ( self -> dir, self -> mgr, kptIndex, force, from, to );
-}
-#endif
-
-/* Alias
- */
-LIB_EXPORT rc_t CC KDatabaseAliasDB ( KDatabase *self, const char *db, const char *alias )
-{
-    return KDBAlias ( self -> dir, kptDatabase, db, alias );
-}
-
-LIB_EXPORT rc_t CC KDatabaseAliasTable ( KDatabase *self, const char *tbl, const char *alias )
-{
-    return KDBAlias ( self -> dir, kptTable, tbl, alias );
-}
-
-LIB_EXPORT rc_t CC KDatabaseAliasIndex ( KDatabase *self, const char *idx, const char *alias )
-{
-    return KDBAlias ( self -> dir, kptIndex, idx, alias );
-}
-
-/* Drop
- */
-
-LIB_EXPORT rc_t CC KDatabaseDropDB ( KDatabase *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVDropDB ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVDropDB ( KDatabase *self, const char *name, va_list args )
-{
-    return KDBVDrop ( self -> dir, self -> mgr, kptDatabase, name, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseDropTable ( KDatabase *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVDropTable ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVDropTable ( KDatabase *self, const char *name, va_list args )
-{
-    return KDBVDrop ( self -> dir, self -> mgr, kptTable, name, args );
-}
-
-#if 1
-LIB_EXPORT rc_t CC KDatabaseDropIndex ( KDatabase *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVDropIndex ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVDropIndex ( KDatabase *self, const char *name, va_list args )
-{
-    return KDBVDrop ( self -> dir, self -> mgr, kptIndex, name, args );
-}
-#endif
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KDatabaseOpenManagerRead ( const KDatabase *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenManagerUpdate ( KDatabase *self, KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenParentUpdate ( KDatabase *self, KDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else if ( self -> dad != NULL && self -> dad -> read_only )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcDatabase, rcReadonly );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenDirectory
- *  access the directory in use
- */
-LIB_EXPORT rc_t CC KDatabaseOpenDirectoryRead ( const KDatabase *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenDirectoryUpdate ( KDatabase *self, KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-         else if ( self -> dir != NULL && self -> dir -> read_only )
-             rc = RC ( rcDB, rcDatabase, rcAccessing, rcDirectory, rcReadonly );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-
-/* ModDate
- *  get modification date
- */
-LIB_EXPORT rc_t CC KDatabaseModDate ( const KDatabase *self, KTime_t *mtime )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self != NULL )
-            return KDBGetObjModDate ( self -> dir, mtime );
-
-        rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        * mtime = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-
-/* List
- *  create database listings
- */
-struct FilterData
-{
-    const KDBManager * mgr;
-    int type;
-};
-
-static
-bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
-{
-    struct FilterData * data = data_;
-    return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListDB ( const KDatabase *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptDatabase;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "db", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListTbl ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptTable;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "tbl", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KDatabaseListIdx ( struct KDatabase const *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptIndex;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "idx", NULL );
-    }
-
-    if ( names != NULL )
-        * names = NULL;
-
-    return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
-}
-
diff --git a/libs/kdb/wdbmgr.c b/libs/kdb/wdbmgr.c
deleted file mode 100644
index 59289c7..0000000
--- a/libs/kdb/wdbmgr.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kdb/extern.h>
-#include "libwkdb.vers.h"
-#include "dbmgr-priv.h"
-#include "wkdb-priv.h"
-#include <kfs/impl.h>
-#include <klib/symbol.h>
-#include <klib/checksum.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * KDBManager
- *  handle to library
- */
-
-
-/* MakeUpdate
- *  create library handle
- */
-LIB_EXPORT rc_t CC KDBManagerMakeUpdate ( KDBManager **mgrp, KDirectory *wd )
-{
-    if ( wd == NULL || ! wd -> read_only )
-        return KDBManagerMake ( mgrp, wd, "make-update", NULL );
-
-    if ( mgrp != NULL )
-        * mgrp = NULL;
-
-    return RC ( rcDB, rcMgr, rcConstructing, rcDirectory, rcReadonly );
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "path" [ IN ] - NUL terminated path
- *
- * TBD: Better reasons for non local paths
- */
-static
-rc_t KDBManagerWritableInt ( const KDirectory * dir, const char * path )
-{
-    rc_t rc;
-
-    int type = KDBPathType ( /*NULL,*/ dir, NULL, path ) & ~ kptAlias;
-    switch ( type )
-    {
-    case kptDatabase:
-    case kptTable:
-    case kptPrereleaseTbl:
-    case kptColumn:
-        rc = KDBWritable ( dir, path );
-        break;
-
-    case kptIndex:
-    case kptMetadata:
-        /* a wrong database type */
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcIncorrect );
-        break;
-#if 0
-        /*TBD - eventually we need to check for an archive here */
-    case kptFile: 
-        /* check if this is an archive .tar or .sra and return rcReadonly if it is */
-#endif
-    case kptNotFound:
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcNotFound );
-        break;
-    case kptBadPath:
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcInvalid );
-        break;
-    default:
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcIncorrect );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVWritable ( const KDBManager *self, const char * path, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        char dbpath [ 4096 ];
-
-        /* get full path to object */
-        rc = KDirectoryVResolvePath ( self -> wd, true, dbpath, sizeof dbpath, path, args );
-        if ( rc == 0 )
-            rc = KDBManagerWritableInt ( self -> wd, dbpath );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerWritable ( const KDBManager *self, const char * path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDBManagerVWritable ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDBManagerVLock ( KDBManager *self, const char *path, va_list args )
-{
-    rc_t rc;
-    char full [ 4096 ];
-
-    if ( self == NULL )
-        rc =  RC ( rcDB, rcMgr, rcLocking, rcSelf, rcNull );
-    else
-    {
-        /* TBD:
-           Add code to validate that this path is not in a container
-           object's control.  That is the last facet in the path
-           is the name of the object.  To be valid the facet before
-           must not be "col", "tbl", or "db" as in those cases
-           the KDBManager should not be called for this object but 
-           its containing object
-        */
-
-        /* get full path to object */
-        rc = KDirectoryVResolvePath ( self -> wd, true,
-            full, sizeof full, path, args );
-        if ( rc == 0 )
-        {
-            /* if the path is not writable because it is already locked
-             * the return from this will contain "rcLocked" and the 
-             * caller will be forced to check for zero or RCState(rcLocked)
-             *
-             * a side effect is that if the call does not return 0 it will
-             * be a wrong type to lock with the DBManager
-             */
-            rc = KDBManagerWritableInt ( self -> wd, full );
-            if ( rc == 0 )
-            {
-                rc = KDBManagerCheckOpen ( self, full );
-                if ( rc == 0 )
-                    rc = KDBLockDir ( self -> wd, full );
-            }
-        }
-
-        /* return dbmgr context */
-        if ( rc != 0 )
-            rc = ResetRCContext ( rc, rcDB, rcMgr, rcLocking );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerLock ( KDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDBManagerVLock ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KDBManagerVUnlock ( KDBManager *self, const char *path, va_list args )
-{
-    rc_t rc;
-    char full [ 4096 ];
-
-    if ( self == NULL )
-        rc =  RC ( rcDB, rcMgr, rcUnlocking, rcSelf, rcNull );
-    else
-    {
-        /* get full path to object */
-        rc = KDirectoryVResolvePath ( self -> wd, true,
-            full, sizeof full, path, args );
-        if ( rc == 0 )
-        {
-            /* TBD:
-               Add code to validate that this path is not in a container
-               object's control.  That is the last facet in the path
-               is the name of the object.  To be valid the facet before
-               must not be "col", "tbl", or "db" as in those cases
-               the KDBManager should not be called for this object but 
-               its containing object
-            */
-
-            /* if the path is not writable because it is already locked
-             * we attempt to unlock it.
-             *
-             * if the return is 0 from Writable than it was already 
-             * unlocked so we say so and thus again the
-             * the return from this will contain "rcLocked" and the 
-             * caller will be forced to check for zero or RCState(rcUnlocked)
-             *
-             * a side effect is that if the call does not return 0 it will
-             * be a wrong type to lock with the DBManager
-             */
-            rc = KDBManagerWritableInt ( self -> wd, path );
-            if ( rc == 0 )
-                rc = RC ( rcDB, rcMgr, rcUnlocking, rcLock, rcUnlocked );
-            else if ( GetRCState ( rc ) == rcLocked )
-            {
-                rc = KDBManagerCheckOpen ( self, path );
-                if ( rc == 0 )
-                    rc = KDBUnlockDir ( self -> wd, path );
-            }
-        }
-
-        if ( rc != 0 )
-            rc = ResetRCContext ( rc, rcDB, rcMgr, rcUnlocking );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerUnlock ( KDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDBManagerVUnlock ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVDrop ( KDBManager *self, uint32_t obj_type, const char *path, va_list args )
-{
-    return KDBMgrVDrop ( self -> wd, self, obj_type, path, args );
-}
-
-LIB_EXPORT rc_t CC KDBManagerDrop ( KDBManager *self, uint32_t obj_type, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVDrop ( self, obj_type, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-
-/* RunPeriodicTasks
- *  executes periodic tasks, such as cache flushing
- */
-LIB_EXPORT rc_t CC KDBManagerRunPeriodicTasks ( const KDBManager *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcExecuting, rcSelf, rcNull );
-
-    return 0;
-}
-
-/* PathType
- * check the path type of an object/directory path.
- * this is an extension of the KDirectoryPathType and will return
- * the KDirectory values if a path type is not specifically a
- * kdb object
- */
-
-LIB_EXPORT int CC KDBManagerVPathType ( const KDBManager * self, const char *path, va_list args )
-{
-    if ( self != NULL )
-    {
-        char full [ 4096 ];
-        rc_t rc = KDirectoryVResolvePath ( self -> wd, false, full, sizeof full, path, args );
-        if ( rc == 0 )
-            return KDBPathType ( /*self,*/ self -> wd, NULL, full );
-    }
-    return kptBadPath;
-}
-
-
-LIB_EXPORT int CC KDBManagerPathType ( const KDBManager * self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-
-    rc = KDBManagerVPathType ( self, path, args );
-
-    va_end (args);
-    return rc;
-}
-
diff --git a/libs/kdb/werror-priv.h b/libs/kdb/werror-priv.h
deleted file mode 100644
index a9ae5b0..0000000
--- a/libs/kdb/werror-priv.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_werror_priv_
-#define _h_werror_priv_
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * RC
- */
-
-/*
-AK: TODO check the fix is correct
-#define kdbReindex RC ( rcDB, rcNoObj, rcCommitting, rcIndex, rcExcessive )
-*/
-
-#define kdbReindex RC ( rcDB, rcNoTarg, rcCommitting, rcIndex, rcExcessive )
-
-#if 0
-    kdbBadBlockSize,
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_werror_priv_ */
diff --git a/libs/kdb/widxblk-priv.h b/libs/kdb/widxblk-priv.h
deleted file mode 100644
index 2187210..0000000
--- a/libs/kdb/widxblk-priv.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_widxblk_priv_
-#define _h_widxblk_priv_
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_colfmt_priv_
-#include "colfmt-priv.h"
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColIdxBlock;
-
-
-/*--------------------------------------------------------------------------
- * KColBlockMap
- *  maps an index or page section of block index
- */
-typedef struct KColBlockMap KColBlockMap;
-struct KColBlockMap
-{
-    void ( * trans ) ( KColBlockMap *self, uint32_t idx,
-        uint64_t first, uint32_t span );
-
-    union
-    {
-        /* for assignment and manipulation */
-        void *p;
-        char *c;
-
-        /* type 1 has a constant range/size */
-        uint32_t *span;
-
-        /* type 2 has a predictable id/pos */
-        uint64_t *first;
-
-        /* type 3 has a predictable id/pos and constant range/size */
-        struct
-        {
-            uint64_t pg;
-            uint32_t sz;
-        } *pred;
-
-    } h;
-
-    /* types 0 and 1 have explicit id/pos, where id is ordered */
-    uint64_t *d;
-
-    /* type 2 has explicit range/size */
-    uint32_t *s;
-};
-
-/* SetEntry
- *  sets an entry
- */
-void KColBlockMapSetEntry ( KColBlockMap *self,
-    uint32_t slot, uint64_t first, uint32_t span );
-#define KColBlockMapSetEntry( self, slot, first, span ) \
-    ( * ( self ) -> trans ) ( self, slot, first, span )
-
-
-/*--------------------------------------------------------------------------
- * KColBlockLocInfo
- *  extensions for defining prospective idx2 blocks
- */
-typedef struct KColBlockLocInfo KColBlockLocInfo;
-struct KColBlockLocInfo
-{
-    /* the range of ids in a block */
-    int64_t start_id;
-    int64_t end_id;
-
-    /* the range of data pages */
-    uint64_t start_pg;
-    uint64_t end_pg;
-
-    /* the size of the last blob in block
-       which is the size of them all in the
-       case of pg_type == 2 or 3 */
-    uint32_t size;
-
-    /* the number of entries in block */
-    uint32_t count;
-
-    /* the types */
-    uint16_t id_type;
-    uint16_t pg_type;
-};
-
-/* Merge
- *  calculates the cost of merging two blocks
- *  returns the cost in bytes where a benefit is negative
- *  merges right into left
- */
-int64_t KColBlockLocInfoMerge ( KColBlockLocInfo *left,
-    const KColBlockLocInfo *right );
-
-
-/*--------------------------------------------------------------------------
- * KColWIdxBlock
- *  level 2 index building block
- *
- *  each index block has two sections
- */
-typedef struct KColWIdxBlock KColWIdxBlock;
-struct KColWIdxBlock
-{
-    KColBlockMap id;
-    KColBlockMap pg;
-
-    uint32_t count;
-    uint32_t size;
-
-    /* for assigning */
-    uint32_t idx;
-};
-
-/* Init
- */
-rc_t KColWIdxBlockInit ( KColWIdxBlock *iblk, const KColBlockLocInfo *info );
-
-/* Whack
- */
-void KColWIdxBlockWhack ( KColWIdxBlock *self );
-
-/* SetEntry
- *  sets index and page location information
- */
-void KColWIdxBlockSetEntry ( KColWIdxBlock *self,
-    int64_t start_id, uint32_t span,
-    uint64_t pg, uint32_t sz );
-#if 0
-#define KColWIdxBlockSetEntry( self, start_id, span, pos, sz ) \
-    ( KColBlockMapSetEntry ( & ( self ) -> id, ( self ) -> idx, start_id, span ), \
-      KColBlockMapSetEntry ( & ( self ) -> pg, ( self ) -> idx, pos, sz ), \
-      ( void ) ++ ( self ) -> idx )
-#endif
-
-/* Compress
- *  compress the block
- *  update the BlockLoc
- */
-rc_t KColWIdxBlockCompress ( KColWIdxBlock *self, bool bswap,
-    const KColBlockLocInfo *info, KColBlockLoc *bloc, size_t *to_write );
-
-/* PersistPtr
- *  access the pointer for persisting to disk
- */
-const void *KColWIdxBlockPersistPtr ( const KColWIdxBlock *self,
-    const KColBlockLoc *bloc );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_colidx2_priv_ */
diff --git a/libs/kdb/widxblk.c b/libs/kdb/widxblk.c
deleted file mode 100644
index edac6de..0000000
--- a/libs/kdb/widxblk.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "widxblk-priv.h"
-#include "werror-priv.h"
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KColBlockMap
- *  maps an index or page section of block index
- */
-
-/* KColBlockMapSetEntry
- *  sets an entry
- */
-#ifndef KColBlockMapSetEntry
-LIB_EXPORT void CC KColBlockMapSetEntry ( KColBlockMap *self,
-    uint32_t slot, uint64_t first, uint32_t span )
-{
-    ( * self -> trans ) ( self, slot, first, span );
-}
-#endif
-
-static
-void KColBlockMapTrans0 ( KColBlockMap *self, uint32_t idx,
-    uint64_t first, uint32_t span )
-{
-    self -> d [ idx ] = first;
-    self -> s [ idx ] = span;
-}
-
-static
-void KColBlockMapTrans1 ( KColBlockMap *self, uint32_t idx,
-    uint64_t first, uint32_t span )
-{
-    self -> d [ idx ] = first;
-    assert ( idx == 0 || self -> h . span [ 0 ] == span );
-    if ( idx == 0 )
-        self -> h . span [ 0 ] = span;
-}
-
-static
-void KColBlockMapTrans2 ( KColBlockMap *self, uint32_t idx,
-    uint64_t first, uint32_t span )
-{
-    self -> s [ idx ] = span;
-    if ( idx == 0 )
-        self -> h . first [ 0 ] = first;
-}
-
-static
-void KColBlockMapTrans3 ( KColBlockMap *self, uint32_t idx,
-    uint64_t first, uint32_t span )
-{
-    assert ( idx == 0 || self -> h . pred -> sz == span );
-    if ( idx == 0 )
-    {
-        self -> h . pred -> pg = first;
-        self -> h . pred -> sz = span;
-    }
-}
-
-static
-void KColBlockMapTransNull ( KColBlockMap *self, uint32_t idx,
-    uint64_t first, uint32_t span )
-{
-}
-
-static
-void KColBlockMapSwap ( KColBlockMap *self, uint32_t count, int type )
-{
-    uint32_t i;
-
-    switch ( type )
-    {
-    case btypeUniform:
-        self -> h . span [ 0 ] = bswap_32 ( self -> h . span [ 0 ] );
-        break;
-    case btypeMagnitude:
-        self -> h . first [ 0 ] = bswap_64 ( self -> h . first [ 0 ] );
-        break;
-    case btypePredictable:
-        self -> h . pred -> pg = bswap_64 ( self -> h . pred -> pg );
-        self -> h . pred -> sz = bswap_32 ( self -> h . pred -> sz );
-        break;
-    }
-
-    switch ( type )
-    {
-    case btypeRandom:
-    case btypeUniform:
-        for ( i = 0; i < count; ++ i )
-            self -> d [ i ] = bswap_64 ( self -> d [ i ] );
-        break;
-    }
-
-    switch ( type )
-    {
-    case btypeRandom:
-    case btypeMagnitude:
-        for ( i = 0; i < count; ++ i )
-            self -> s [ i ] = bswap_32 ( self -> s [ i ] );
-        break;
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * KColBlockLocInfo
- *  extensions for defining prospective idx2 blocks
- */
-
-/* MergeIDTest
- *  tests viability of merging two blocks with same id type
- *  returns the required type for merge
- */
-static
-uint32_t KColBlockLocInfoMergeIDTest ( uint32_t id_type,
-    const KColBlockLocInfo *left, const KColBlockLocInfo *right )
-{
-    switch ( id_type )
-    {
-    case btypeRandom:
-        break;
-
-    case btypeUniform:
-        assert ( left -> count != 0 );
-        assert ( right -> count != 0 );
-        if ( ( left -> end_id - left -> start_id ) / left -> count ==
-             ( right -> end_id - right -> start_id ) / right -> count )
-            return btypeUniform;
-        break;
-
-    case btypeMagnitude:
-        if ( left -> end_id == right -> start_id )
-            return btypeMagnitude;
-        break;
-
-    case btypePredictable:
-        assert ( left -> count != 0 );
-        assert ( right -> count != 0 );
-
-        if ( ( left -> end_id - left -> start_id ) / left -> count ==
-             ( right -> end_id - right -> start_id ) / right -> count )
-        {
-            if ( left -> end_id == right -> start_id )
-                return btypePredictable;
-            return btypeUniform;
-        }
-
-        if ( left -> end_id == right -> start_id )
-            return btypeMagnitude;
-        break;
-    }
-
-    return btypeRandom;
-}
-
-/* MergePGTest
- *  tests viability of merging two blocks with same id type
- */
-static
-uint32_t KColBlockLocInfoMergePGTest ( uint32_t pg_type,
-    const KColBlockLocInfo *left, const KColBlockLocInfo *right )
-{
-    switch ( pg_type )
-    {
-    case btypeRandom:
-        break;
-
-    case btypeUniform:
-        if ( left -> size == right -> size )
-            return btypeUniform;
-        break;
-
-    case btypeMagnitude:
-        if ( left -> end_pg == right -> start_pg )
-            return btypeMagnitude;
-        break;
-
-    case btypePredictable:
-        if ( left -> size == right -> size )
-        {
-            if ( left -> end_pg == right -> start_pg )
-                return btypePredictable;
-            return btypeUniform;
-        }
-        if ( left -> end_pg == right -> start_pg )
-            return btypeMagnitude;
-        break;
-    }
-
-    return btypeRandom;
-}
-
-/* ConvertIDCost
- *  measures cost of converting an id type
- */
-static
-int64_t KColBlockLocInfoConvertIDCost ( const KColBlockLocInfo *bloc, uint32_t id_type )
-{
-    size_t cost;
-
-    if ( bloc -> id_type == ( uint16_t ) id_type )
-        return 0;
-
-    switch ( ( id_type << 2 ) | bloc -> id_type )
-    {
-        /* conversions to most expensive type */
-    case ( ( btypeRandom << 2 ) | btypeUniform ):
-        cost = ( ( size_t ) bloc -> count << 2 ) - 4;
-        break;
-    case ( ( btypeRandom << 2 ) | btypeMagnitude ):
-        cost = ( ( size_t ) bloc -> count << 3 ) - 8;
-        break;
-    case ( ( btypeRandom << 2 ) | btypePredictable ):
-        cost = ( size_t ) bloc -> count * 12;
-        break;
-
-        /* other supported conversions */
-    case ( ( btypeUniform << 2 ) | btypePredictable ):
-        cost = ( size_t ) bloc -> count << 3;
-        break;
-    case ( ( btypeMagnitude << 2 ) | btypePredictable ):
-        cost = ( size_t ) bloc -> count << 2;
-        break;
-
-        /* no other conversions are supported */
-    default:
-        return 0xFFFFFFFF;
-    }
-
-    /* consider the conversion done */
-    return cost;
-}
-
-/* ConvertPGCost
- *  measures cost of converting a pg type
- */
-static
-int64_t KColBlockLocInfoConvertPGCost ( const KColBlockLocInfo *bloc, uint32_t pg_type )
-{
-    int64_t cost;
-
-    if ( bloc -> pg_type == ( uint16_t ) pg_type )
-        return 0;
-
-    switch ( ( pg_type << 2 ) | bloc -> pg_type )
-    {
-        /* conversion to most expensive type */
-    case ( ( btypeRandom << 2 ) | btypeUniform ):
-        cost = ( ( uint32_t ) bloc -> count << 2 ) - 4;
-        break;
-    case ( ( btypeRandom << 2 ) | btypeMagnitude ):
-        cost = ( ( uint32_t ) bloc -> count << 3 ) - 8;
-        break;
-    case ( ( btypeRandom << 2 ) | btypePredictable ):
-        cost = ( uint32_t ) ( bloc -> count - 1 ) * 12;
-        break;
-
-        /* other supported conversions */
-    case ( ( btypeUniform << 2 ) | btypePredictable ):
-        cost = ( ( int64_t ) bloc -> count << 3 ) - 12;
-        break;
-    case ( ( btypeMagnitude << 2 ) | btypePredictable ):
-        cost = ( ( int64_t ) bloc -> count << 2 ) - 12;
-        break;
-
-        /* no other conversions are supported */
-    default:
-        return 0xFFFFFFFF;
-    }
-
-    /* consider the conversion done */
-    return cost;
-}
-
-/* Merge
- *  calculates the cost of merging two blocks
- *  returns the cost in bytes where a benefit is negative
- *  merges right into left
- */
-int64_t KColBlockLocInfoMerge ( KColBlockLocInfo *a, const KColBlockLocInfo *b )
-{
-    int64_t cost;
-    uint32_t id_type, pg_type;
-
-    /* calculate optimistic lowest-common types */
-    id_type = ( uint32_t ) a -> id_type & ( uint32_t ) b -> id_type;
-    pg_type = ( uint32_t ) a -> pg_type & ( uint32_t ) b -> pg_type;
-
-    /* test merge of b into a */
-    id_type = KColBlockLocInfoMergeIDTest ( id_type, a, b );
-    pg_type = KColBlockLocInfoMergePGTest ( pg_type, a, b );
-
-    /* calculate cost of type conversion */
-    cost = KColBlockLocInfoConvertIDCost ( a, id_type );
-    cost += KColBlockLocInfoConvertPGCost ( a, pg_type );
-    cost += KColBlockLocInfoConvertIDCost ( b, id_type );
-    cost += KColBlockLocInfoConvertPGCost ( b, pg_type );
-
-    /* perform the merge */
-    a -> end_id = b -> end_id;
-    a -> end_pg = b -> end_pg;
-    a -> count += b -> count;
-    a -> id_type = id_type;
-    a -> pg_type = pg_type;
-
-    /* the resultant block cannot be too large */
-    if ( ( ( a -> end_id - a -> start_id ) >> 32 ) == 0 )
-    {
-        size_t hdr_size_div4 = pg_type;
-        size_t entry_size_div4 = ( id_type ^ 3 ) + ( pg_type ^ 3 );
-        if ( id_type != 3 )
-            hdr_size_div4 += id_type;
-
-        if ( ( hdr_size_div4 + entry_size_div4 * a -> count ) <= ( 0x10000 / 4 ) )
-            return cost - sizeof ( KColBlockLoc );
-    }
-
-    /* too big */
-    return 0xFFFFFFFF;
-}
-
-
-/*--------------------------------------------------------------------------
- * KColWIdxBlock
- *  level 2 index building block
- *
- *  each index block has two sections
- */
-
-/* Init
- */
-rc_t KColWIdxBlockInit ( KColWIdxBlock *iblk, const KColBlockLocInfo *info )
-{
-    /* start out with entry count */
-    int block_size = ( int ) info -> count;
-
-    /* determine block size and write funcs */
-    int id_hsz, id_dsz, id_ssz;
-    int pg_hsz, pg_dsz, pg_ssz;
-    switch ( info -> id_type )
-    {
-    case btypeRandom:
-        iblk -> id . trans = KColBlockMapTrans0;
-        id_hsz = 0;
-        id_dsz = 8;
-        id_ssz = 4;
-        break;
-    case btypeUniform:
-        iblk -> id . trans = KColBlockMapTrans1;
-        id_hsz = 4;
-        id_dsz = 8;
-        id_ssz = 0;
-        break;
-    case btypeMagnitude:
-        iblk -> id . trans = KColBlockMapTrans2;
-        id_hsz = 8;
-        id_dsz = 0;
-        id_ssz = 4;
-        break;
-    case btypePredictable:
-    default: /* to quiet compiler warnings */
-        iblk -> id . trans = KColBlockMapTransNull;
-        id_hsz = 0;
-        id_dsz = 0;
-        id_ssz = 0;
-        break;
-    }
-
-    switch ( info -> pg_type )
-    {
-    case btypeRandom:
-        iblk -> pg . trans = KColBlockMapTrans0;
-        pg_hsz = 0;
-        pg_dsz = 8;
-        pg_ssz = 4;
-        break;
-    case btypeUniform:
-        iblk -> pg . trans = KColBlockMapTrans1;
-        pg_hsz = 4;
-        pg_dsz = 8;
-        pg_ssz = 0;
-        break;
-    case btypeMagnitude:
-        iblk -> pg . trans = KColBlockMapTrans2;
-        pg_hsz = 8;
-        pg_dsz = 0;
-        pg_ssz = 4;
-        break;
-    case btypePredictable:
-    default: /* to quiet compiler warnings */
-        iblk -> pg . trans = KColBlockMapTrans3;
-        pg_hsz = 12;
-        pg_dsz = 0;
-        pg_ssz = 0;
-        break;
-    }
-
-    /* record count */
-    iblk -> count = block_size;
-
-    /* account for the number of entries */
-    id_dsz *= block_size;
-    id_ssz *= block_size;
-    pg_dsz *= block_size;
-    pg_ssz *= block_size;
-
-    /* allocate a block with compression buffer */
-    block_size = id_hsz + id_dsz + id_ssz +
-        pg_hsz + pg_dsz + pg_ssz;
-    iblk -> id . h . p = malloc ( block_size + block_size );
-    if ( iblk -> id . h . p == NULL )
-        return RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-
-    /* record uncompressed block size */
-    iblk -> size = block_size;
-
-    /* map the block */
-    iblk -> pg . h . c = iblk -> id . h . c + id_hsz;
-    iblk -> id . d = ( uint64_t* ) ( iblk -> pg . h . c + pg_hsz );
-    iblk -> pg . d = ( uint64_t* ) ( ( char* ) iblk -> id . d + id_dsz );
-    iblk -> id . s = ( uint32_t * ) ( ( char* ) iblk -> pg . d + pg_dsz );
-    iblk -> pg . s = ( uint32_t * ) ( ( char* ) iblk -> id . s + id_ssz );
-
-    /* prepare index */
-    iblk -> idx = 0;
-
-    return 0;
-}
-
-/* Whack
- */
-void KColWIdxBlockWhack ( KColWIdxBlock *self )
-{
-    if ( self != NULL )
-        free ( self -> id . h . p );
-}
-
-/* SetEntry
- *  sets index and page location information
- */
-#ifndef KColWIdxBlockSetEntry
-void KColWIdxBlockSetEntry ( KColWIdxBlock *self,
-    int64_t start_id, uint32_t span,
-    uint64_t pg, uint32_t sz )
-{
-    KColBlockMapSetEntry ( & self -> id, self -> idx, start_id, span );
-    KColBlockMapSetEntry ( & self -> pg, self -> idx, pg, sz );
-    ++ self -> idx;
-}
-#endif
-
-/* Compress
- *  compress the block
- *  update the KColBlockLoc
- */
-rc_t KColWIdxBlockCompress ( KColWIdxBlock *self, bool bswap,
-    const KColBlockLocInfo *info, KColBlockLoc *bloc, size_t *to_write )
-{
-    assert ( info -> id_type < 4 );
-    bloc -> u . blk . id_type = ( uint32_t ) info -> id_type;
-
-    assert ( info -> pg_type < 4 );
-    bloc -> u . blk . pg_type = ( uint32_t ) info -> pg_type;
-
-    assert ( ( ( info -> end_id - info -> start_id ) >> 32 ) == 0 );
-    bloc -> id_range = ( uint32_t ) ( info -> end_id - info -> start_id );
-
-    bloc -> start_id = info -> start_id;
-
-    bloc -> pg = 0;
-
-    if ( info -> id_type == btypePredictable &&
-         info -> pg_type == btypePredictable )
-    {
-        assert ( ( self -> count >> 27 ) == 0 );
-        bloc -> u . blk . size = self -> count;
-        bloc -> u . blk . compressed = 0;
-        * to_write = 12;
-
-        if ( bswap )
-        {
-            KColBlockMapSwap ( & self -> id, self -> count, info -> id_type );
-            KColBlockMapSwap ( & self -> pg, self -> count, info -> pg_type );
-        }
-
-        return 0;
-    }
-
-    assert ( ( self -> size >> 27 ) == 0 );
-    bloc -> u . blk . size = self -> size;
-    * to_write = self -> size;
-
-    if ( bswap )
-    {
-        KColBlockMapSwap ( & self -> id, self -> count, info -> id_type );
-        KColBlockMapSwap ( & self -> pg, self -> count, info -> pg_type );
-    }
-
-    /* not compressing today */
-    bloc -> u . blk . compressed = 0;
-    return 0;
-}
-
-/* PersistPtr
- *  access the pointer for persisting to disk
- */
-const void *KColWIdxBlockPersistPtr ( const KColWIdxBlock *self,
-    const KColBlockLoc *bloc )
-{
-    assert ( bloc -> u . blk . compressed == 0 );
-    return self -> id . h . p;
-}
diff --git a/libs/kdb/windex-priv.h b/libs/kdb/windex-priv.h
deleted file mode 100644
index 5b9847d..0000000
--- a/libs/kdb/windex-priv.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_index_priv_
-#define _h_index_priv_
-
-#ifndef _h_index_cmn_
-#include "index-cmn.h"
-#endif
-
-#ifndef _h_klib_trie_
-#include <klib/trie.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTNode;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * V1
- *  version 1 of the trie index was hard-coded to enforce uniqueness of
- *  both the string, and a 32-bit id. furthermore, the id was unfortunately
- *  assumed to occupy a mostly contiguous space, such that the projection
- *  was always implemented as an array of ptrie node ids where the id was
- *  used to index the array.
- *
- *  the introduction of highly sparse ids led to deprecation of this
- *  implementation. see version 2 for further information.
- */
-
-
-/*--------------------------------------------------------------------------
- * KTrieIdxNode_v1
- */
-typedef struct KTrieIdxNode_v1 KTrieIdxNode_v1;
-struct KTrieIdxNode_v1
-{
-    TNode n;
-    uint32_t id;
-    char key [ 1 ];
-};
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v1
- */
-struct KTrieIndex_v1
-{
-    KPTrieIndex_v1 pt;
-    Trie key2id;
-    KTrieIdxNode_v1 **id2node;
-    uint32_t first;
-    uint32_t last;
-    uint32_t len;
-};
-
-/* insert string into trie, mapping to 32 bit id */
-rc_t KTrieIndexInsert_v1 ( KTrieIndex_v1 *self,
-    bool proj, const char *key, uint32_t id );
-
-/* drop string from trie and all mappings */
-rc_t KTrieIndexDelete_v1 ( KTrieIndex_v1 *self,
-    bool proj, const char *key );
-
-/* persist index to file */
-rc_t KTrieIndexPersist_v1 ( const KTrieIndex_v1 *self,
-    bool proj, struct KDirectory *dir, const char *path, bool use_md5 );
-
-
-/*--------------------------------------------------------------------------
- * V2
- *  version 2 of the trie index was introduced to handle sparse ids,
- *  and to recognize that ids may be 64 bits and/or negative.
- *
- *  v2 introduces strategy identifiers to handle various cases.
- *
- *  CONSTRAINTS
- *  - both key and id are unique ( version 1 )
- *  - key is not unique, but must map to a contiguous range of ids,
- *    while ids are unique ( the main use case for SRA )
- *
- *  INSERTION
- *  - ids are observed in increasing order
- *
- *  PROJECTION
- *  - id range is contiguous or nearly so ( can use single array )
- *  - id range is sparse
- *
- *  the implementation may be extended by adding new strategies,
- *  but the moment the implementation supports 1 to many mappings,
- *  inserted with ids in increasing order, and an unique constraint
- *  on the ids themselves.
- *
- *  the general case for v2 is "key -> id range", where "id range -> key"
- *  is via contiguous array if avg ( id range ) <= 2, and via sparse
- *  array otherwise.
- *
- *  for the key -> id mappings, this means that the in-core node
- *  either retains an id range ( when not using a projection index ),
- *  or it retains a start-id only, since its range can be determined
- *  from the projection index.
- *
- *  for id -> key mappings, the id is first converted to an ordinal, and
- *  the ordinal to a node. when ids are contiguous, id -> ordinal is simply
- *  derived by subtracting the initial start id. when sparse, an id -> ord
- *  array is used in a binary search to produce the ordinal.
- *
- *  ids are assumed to be 64 bit, stored as id - start id, and packed to
- *  a minimum number of bits to represent the id. ptrie node ids are still
- *  32-bit entities.
- */
-
-
-/*--------------------------------------------------------------------------
- * KTrieIdxNode_v2_s1
- *  strategy 1 - store only start id, derive range from proj index
- */
-typedef struct KTrieIdxNode_v2_s1 KTrieIdxNode_v2_s1;
-struct KTrieIdxNode_v2_s1
-{
-    TNode n;
-    int64_t start_id;
-    char key [ 1 ];
-};
-
-/*--------------------------------------------------------------------------
- * KTrieIdxNode_v2_s2
- *  strategy 2 - store complete range when not using proj index
- */
-typedef struct KTrieIdxNode_v2_s2 KTrieIdxNode_v2_s2;
-struct KTrieIdxNode_v2_s2
-{
-    TNode n;
-    int64_t start_id;
-    uint32_t span;
-    char key [ 1 ];
-};
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v2
- */
-struct KTrieIndex_v2
-{
-    int64_t first, last;
-    KPTrieIndex_v2 pt;
-    Trie key2id;
-    KTrieIdxNode_v2_s1 **ord2node;
-    uint32_t count;
-    uint32_t max_span;
-};
-
-/* cause persisted tree to be loaded into trie */
-rc_t KTrieIndexAttach_v2 ( KTrieIndex_v2 *self, bool proj );
-
-/* insert string into trie, mapping to 64 bit id */
-rc_t KTrieIndexInsert_v2 ( KTrieIndex_v2 *self,
-    bool proj, const char *key, int64_t id );
-
-/* drop string from trie and all mappings */
-rc_t KTrieIndexDelete_v2 ( KTrieIndex_v2 *self,
-    bool proj, const char *key );
-
-/* persist index to file */
-rc_t KTrieIndexPersist_v2 ( const KTrieIndex_v2 *self,
-    bool proj, struct KDirectory *dir, const char *path, bool use_md5 );
-
-
-/*--------------------------------------------------------------------------
- * KU64Index_v3
- */
-struct KU64Index_v3
-{
-    BSTree tree;
-    rc_t rc;
-};
-
-rc_t KU64IndexInsert_v3(KU64Index_v3* self, bool unique, uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty);
-rc_t KU64IndexDelete_v3(KU64Index_v3* self, uint64_t key);
-
-rc_t KU64IndexPersist_v3(KU64Index_v3* self, bool proj, struct KDirectory *dir, const char *path, bool use_md5);
-
-
-
-/*--------------------------------------------------------------------------
- * KIndex
- *  represents an index
- */
-
-/* Cmp
- * Sort
- */
-int KIndexCmp ( const void *item, struct BSTNode const *n );
-int KIndexSort ( struct BSTNode const *item, struct BSTNode const *n );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_index_priv_ */
diff --git a/libs/kdb/windex.c b/libs/kdb/windex.c
deleted file mode 100644
index 7a3b317..0000000
--- a/libs/kdb/windex.c
+++ /dev/null
@@ -1,1889 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "windex-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "wtable-priv.h"
-#include "wkdb-priv.h"
-#include "kdbfmt-priv.h"
-
-#include <kdb/kdb-priv.h>
-#include <kdb/index.h>
-#include <klib/symbol.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <byteswap.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * KIndex
- *  an object capable of mapping an object to integer oid
- */
-
-struct KIndex
-{
-    BSTNode n;
-
-    KDBManager *mgr;
-    KDatabase *db;
-    KTable *tbl;
-    KDirectory *dir;
-
-    KRefcount refcount;
-    uint32_t opencount;
-    uint32_t vers;
-    union
-    {
-        KTrieIndex_v1 txt1;
-        KTrieIndex_v2 txt2;
-        KU64Index_v3  u64_3;
-    } u;
-    bool converted_from_v1;
-    uint8_t type;
-    uint8_t read_only;
-    uint8_t dirty;
-    bool use_md5;
-
-    KSymbol sym;
-
-    char path [ 1 ];
-};
-
-
-/* Whack
- */
-static
-rc_t KIndexWhack ( KIndex *self )
-{
-    rc_t rc;
-    KDBManager *mgr = self -> mgr;
-    KSymbol * symb;
-
-    KRefcountWhack ( & self -> refcount, "KIndex" );
-
-    rc = KIndexCommit( self );
-    if ( rc == 0 )
-    {
-        /* release owner */
-        if ( self -> db != NULL )
-        {
-            rc = KDatabaseSever ( self -> db );
-            if ( rc != 0 )
-                return rc;
-            self -> db = NULL;
-        }
-        else if ( self -> tbl != NULL )
-        {
-            rc = KTableSever ( self -> tbl );
-            if ( rc != 0 )
-                return rc;
-            self -> tbl = NULL;
-        }
-    }
-
-    /* remove from mgr */
-    symb = KDBManagerOpenObjectFind (mgr, self->path);
-    if (symb != NULL)
-    {
-        rc = KDBManagerOpenObjectDelete (mgr, symb);
-        if (rc == 0)
-        {
-            /* release manager
-               should never fail */
-            rc = KDBManagerSever ( mgr );
-            if ( rc != 0 )
-                rc = KDBManagerOpenObjectAdd (mgr, symb);
-            else
-            {
-                self -> mgr = NULL;
-
-                rc = SILENT_RC ( rcDB, rcIndex, rcDestroying, rcIndex, rcBadVersion );
-
-                /* complete */
-                switch ( self -> type )
-                {
-                case kitText:
-                case kitText | kitProj:
-                    switch ( self -> vers )
-                    {
-                    case 1:
-                        KTrieIndexWhack_v1 ( & self -> u . txt1 );
-                        rc = 0;
-                        break;
-                    case 2:
-                    case 3:
-                    case 4:
-                        KTrieIndexWhack_v2 ( & self -> u . txt2 );
-                        rc = 0;
-                        break;
-                    }
-                    break;
-
-                case kitU64:
-                    switch ( self -> vers )
-                    {
-                    case 3:
-                    case 4:
-                        rc = KU64IndexWhack_v3 ( & self -> u . u64_3 );
-                        break;
-                    }
-                    break;
-                }
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        KDirectoryRelease ( self -> dir );
-        free ( self );
-    }
-    else
-        KRefcountInit ( & self -> refcount, 1, "KIndex", "whack", "kidx" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KIndexAddRef ( const KIndex *cself )
-{
-    KIndex *self = ( KIndex* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KIndex" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcIndex, rcAttaching, rcRange, rcExcessive );
-        }
-        ++ self -> opencount;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KIndexRelease ( const KIndex *cself )
-{
-    KIndex *self = ( KIndex* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KIndex" ) )
-        {
-        case krefWhack:
-            return KIndexWhack ( ( KIndex* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcIndex, rcReleasing, rcRange, rcExcessive );
-        }
-        -- self -> opencount;
-    }
-    return 0;
-}
-
-
-/* Attach
- */
-static
-rc_t KIndexAttach ( KIndex *self, const KMMap *mm, bool *byteswap )
-{
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const void *addr;
-        rc = KMMapAddrRead ( mm, & addr );
-        if ( rc == 0 )
-        {
-            union
-            {
-                KIndexFileHeader_v1 v1;
-                KIndexFileHeader_v2 v2;
-                KIndexFileHeader_v3 v3;
-            } hdrs;
-
-            const KDBHdr *hdr = addr;
-            const KIndexFileHeader_v3 *fh = addr;
-
-            * byteswap = false;
-            rc = KDBHdrValidate ( hdr, size, 1, KDBINDEXVERS );
-            if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-            {
-                hdrs . v1 . endian = bswap_32 ( hdr -> endian );
-                hdrs . v1 . version = bswap_32 ( hdr -> version );
-                rc = KDBHdrValidate ( & hdrs . v1, size, 1, KDBINDEXVERS );
-                if ( rc == 0 )
-                {
-                    * byteswap = true;
-                    switch ( hdrs . v1 . version )
-                    {
-                    case 1:
-                        hdr = & hdrs . v1;
-                        break;
-                    case 2:
-                        hdr = & hdrs . v2;
-                        break;
-                    case 3:
-                    case 4:
-                        hdrs . v3 . index_type = bswap_32 ( fh -> index_type );
-                        hdrs . v3 . reserved1 = bswap_32 ( fh -> reserved1 );
-                        hdr = & hdrs . v3 . h;
-                        fh = & hdrs . v3;
-                        break;
-                    }
-                }
-            }
-            if ( rc == 0 )
-            {
-                self -> vers = hdr -> version;
-                switch ( hdr -> version )
-                {
-                case 1:
-#if KDBINDEXVERS != 1
-                    self -> converted_from_v1 = true;
-#endif
-                case 2:
-                    self -> type = kitText;
-                    break;
-                case 3:
-                case 4:
-                {
-                    self -> type = fh -> index_type;
-                    switch( self->type )
-                    {
-                    case kitText:
-                    case kitU64:
-                        break;
-                    default:
-                        rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcUnrecognized);
-                    }
-                    break;
-                }
-                default:
-                    rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/* Sever
- * there is no KIndexSever()
- */
-
-/* Make
- *  make an initialized structure
- *  NB - does NOT attach reference to dir, but steals it
- */
-static
-rc_t KIndexMake ( KIndex **idxp, KDirectory *dir, const char *path )
-{
-    rc_t rc;
-    char fullpath[4096];
-
-    if ( idxp == NULL )
-        rc = RC ( rcDB, rcIndex, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( dir == NULL )
-            rc = RC ( rcDB, rcIndex, rcCreating, rcDirectory, rcNull );
-        else if ( path == NULL )
-            rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcEmpty );
-        else
-        {
-            rc = KDirectoryResolvePath(dir, true, fullpath, sizeof(fullpath), path);
-            if (rc == 0)
-            {
-                KIndex* idx = malloc ( sizeof *idx + strlen ( fullpath ) );
-                if ( idx == NULL )
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-                else
-                {
-                    memset ( idx, 0, sizeof * idx );
-                    rc = KDirectoryAddRef ( dir );
-                    if ( rc == 0 )
-                    {
-                        idx -> dir = dir;
-                        KRefcountInit ( & idx -> refcount, 1, "KIndex", "make", fullpath );
-                        idx -> opencount = 1;
-
-                        strcpy ( idx -> path, fullpath );
-
-                        idx->sym.u.obj = idx;
-                        idx->sym.dad = NULL;   /* not strictly needed */
-                        StringInitCString (&idx->sym.name, idx->path);
-                        idx->sym.type = kptIndex;
-
-                        * idxp = idx;
-                        return 0;
-                    }
-
-                    free ( idx );
-                }
-            }
-        }
-
-        * idxp = NULL;
-    }
-
-    return rc;
-}
-
-static
-rc_t KDBManagerInsertIndex ( KDBManager * self, KIndex * idx)
-{
-    rc_t rc;
-    rc = KDBManagerOpenObjectAdd (self, &idx->sym);
-    if (rc == 0)
-        idx->mgr = KDBManagerAttach (self);
-    return rc;
-}
-
-static
-rc_t KIndexMakeRead ( KIndex **idxp, const KDirectory *dir, const char *path )
-{
-    const KFile *f;
-    rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
-    if ( rc == 0 )
-    {
-        const KMMap *mm;
-        rc = KMMapMakeRead ( & mm, f );
-        if ( rc == 0 )
-        {
-            rc = KIndexMake ( idxp, ( KDirectory* ) dir, path );
-            if ( rc == 0 )
-            {
-                bool byteswap;
-                KIndex *idx = * idxp;
-                rc = KIndexAttach ( idx, mm, & byteswap );
-                if ( rc == 0 )
-                {
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
-                    idx -> read_only = true;
-                    switch ( idx -> vers )
-                    {
-                    case 1:
-                        /* open using v1 code only if KDBINDEXVERS is 1
-                           if 2 or later, open as a v2 index */
-#if KDBINDEXVERS == 1
-                        rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, mm );
-                        if ( rc == 0 )
-                        {
-                            if ( idx -> u . txt1 . pt . id2node != NULL )
-                                idx -> type = ( uint8_t ) ( kitText | kitProj );
-                            else
-                                idx -> type = ( uint8_t ) kitText;
-                        }
-                        break;
-#else
-                    case 2:
-                    case 3:
-                    case 4:
-                        switch(idx->type) {
-                            case kitText:
-                            case kitText | kitProj:
-                                /* will guess version in open */
-                                rc = KTrieIndexOpen_v2 ( & idx -> u . txt2, mm, byteswap );
-                                if( rc == 0 && idx -> u.txt2.pt.ord2node != NULL ) {
-                                    idx -> type |= kitProj;
-                                }
-                                idx -> vers = 3;
-                                break;
-
-                            case kitU64:
-                                rc = KU64IndexOpen_v3(&idx->u.u64_3, mm, byteswap);
-                                break;
-                        }
-                        break;
-#endif
-                    }
-                }
-
-                if ( rc != 0 )
-                    KIndexWhack ( idx );
-            }
-
-            KMMapRelease ( mm );
-        }
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-static
-rc_t KIndexMakeUpdate ( KIndex **idxp, KDirectory *dir, const char *path )
-{
-    const KFile *f;
-    rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
-
-    if ( rc == 0 )
-    {
-        const KMMap *mm;
-        rc = KMMapMakeRead ( & mm, f );
-        if ( rc == 0 )
-        {
-            rc = KIndexMake ( idxp, dir, path );
-            if ( rc == 0 )
-            {
-                bool byteswap;
-                KIndex *idx = * idxp;
-                rc = KIndexAttach ( idx, mm, & byteswap );
-                if ( rc == 0 )
-                {
-                    switch ( idx -> vers )
-                    {
-                    case 1:
-                        /* open using v1 code only if KDBINDEXVERS is 1
-                           if 2 or later, open as a v2 index */
-#if KDBINDEXVERS == 1
-                        rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, mm, byteswap );
-                        if ( rc == 0 )
-                        {
-                            if ( idx -> u . txt1 . pt . id2node != NULL )
-                                idx -> type = ( uint8_t ) ( kitText | kitProj );
-                            else
-                                idx -> type = ( uint8_t ) kitText;
-                        }
-                        break;
-#else
-                    case 2:
-                    case 3:
-                    case 4:
-                        switch(idx->type) {
-                            case kitText:
-                            case kitText | kitProj:
-                                /* will guess version in open */
-                                rc = KTrieIndexOpen_v2 ( & idx -> u . txt2, mm, byteswap );
-                                if ( rc == 0 )
-                                {
-                                    if( idx -> u . txt2 . pt . ord2node != NULL ) {
-                                        idx -> type |= kitProj;
-                                    }
-                                    /* v3 takes over v1 and v2 */
-                                    if( idx->vers < 3 ) {
-                                        idx -> vers = 3;
-                                        /* check for a sparse id space */
-                                        if( idx -> u . txt2 . pt . variant != 0 ) {
-                                            /* try to load existing guy */
-                                            rc = KTrieIndexAttach_v2 ( & idx -> u . txt2,
-                                                          idx -> type != ( uint8_t ) kitText );
-                                            if ( rc == 0 )
-                                                idx -> dirty = true;
-                                        }
-                                    }
-                                }
-                                break;
-
-                            case kitU64:
-                                rc = KU64IndexOpen_v3(&idx->u.u64_3, mm, byteswap);
-                                break;
-                        }
-                        break;
-#endif
-                    default:
-                        rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
-                    }
-                }
-
-                if ( rc != 0 )
-                    KIndexWhack ( idx );
-            }
-
-            KMMapRelease ( mm );
-        }
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-/* MarkModified
- *  make the index think it has been modified, such that it may be committed
- *  useful when forcing conversion from an older version
- */
-#if KDBINDEXVERS > 1
-LIB_EXPORT rc_t CC KIndexMarkModified ( KIndex *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcDB, rcIndex, rcUpdating, rcSelf, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcDB, rcIndex, rcUpdating, rcIndex, rcReadonly );
-    else if ( self -> dirty )
-        rc = 0;
-    else switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        default:
-            rc = RC ( rcDB, rcIndex, rcUpdating, rcIndex, rcBadVersion );
-            break;
-        case 1:
-        case 2:
-        case 3:
-        case 4:
-            rc = KTrieIndexAttach_v2 ( & self -> u . txt2,
-                self -> type != ( uint8_t ) kitText );
-            if ( rc == 0 )
-                self -> dirty = true;
-        }
-        break;
-    default:
-        rc = RC ( rcDB, rcIndex, rcUpdating, rcIndex, rcInvalid );
-    }
-
-    return rc;
-}
-#endif
-
-static
-rc_t KIndexCreate ( KIndex **idxp, KDirectory *dir,
-    KIdxType type, KCreateMode cmode, const char *path, int ptype )
-{
-    rc_t rc = 0;
-    KIndex *idx;
-
-    if ( ptype != kptNotFound )
-    {
-        switch ( cmode & kcmValueMask )
-        {
-        case kcmOpen:
-            rc = KIndexMakeUpdate ( idxp, dir, path );
-            if ( rc == 0 )
-            {
-                idx = * idxp;
-                if ( ( KIdxType ) idx -> type != type )
-                {
-                    * idxp = NULL;
-                    KIndexWhack ( idx );
-                    rc = RC ( rcDB, rcIndex, rcConstructing, rcType, rcIncorrect );
-                }
-            }
-            return rc;
-
-        case kcmInit:
-            break;
-
-        case kcmCreate:
-            return RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcExists );
-        }
-    }
-#if KDBINDEXVERS == 1 || KDBIDXVERS == 2
-    else if ( type != kitText && type != ( kitText | kitProj ) )
-    {
-        * idxp = NULL;
-        return RC ( rcDB, rcIndex, rcConstructing, rcType, rcUnsupported );
-    }
-#endif
-
-    rc = KIndexMake ( idxp, dir, path );
-    if ( rc == 0 )
-    {
-        idx = * idxp;
-
-        switch ( type )
-        {
-        case kitText:
-        case kitText | kitProj:
-#if KDBINDEXVERS == 1
-            rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, NULL, false );
-#else
-            rc = KTrieIndexOpen_v2 ( & idx -> u . txt2, NULL, false );
-#endif
-            break;
-
-        case kitU64:
-            rc = KU64IndexOpen_v3 ( & idx->u.u64_3, NULL, false );
-            break;
-
-        default:
-            rc = RC ( rcDB, rcIndex, rcConstructing, rcType, rcUnsupported );
-        }
-
-        if ( rc != 0 )
-        {
-            * idxp = NULL;
-            KIndexWhack ( idx );
-        }
-        else
-        {
-            idx -> vers = KDBINDEXVERS;
-            idx -> type = ( uint8_t ) type;
-        }
-    }
-
-    return rc;
-}
-
-/* CreateIndex
- * VCreateIndex
- *  create a new or open an existing index
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-static
-rc_t KDBManagerCreateIndexInt ( KDBManager *self, KIndex **idxp,
-    KDirectory *wd, KIdxType type, KCreateMode cmode, const char *path, bool use_md5 )
-{
-    rc_t rc;
-    int ptype;
-    char idxpath [ 4096 ];
-
-    rc = KDirectoryVResolvePath ( wd, true,
-        idxpath, sizeof idxpath, path, NULL );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        switch ( ptype = KDBPathType ( wd, NULL, idxpath ) )
-        {
-        case kptNotFound:
-            /* first good path */
-            break;
-
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcInvalid );
-
-        case kptIndex:
-        case kptIndex | kptAlias:
-            /* found so is not good if we want to create new and not
-             * clear/init or open old
-             */
-            if ((cmode & kcmValueMask) == kcmCreate)
-                return RC ( rcDB, rcMgr, rcCreating, rcIndex, rcExists );
-            if (KDBManagerOpenObjectBusy (self, idxpath))
-                return RC ( rcDB, rcMgr, rcCreating, rcIndex, rcBusy );
-
-            /* test now for locked file */
-            rc = KDBWritable ( wd, idxpath );
-            if (rc)
-            {
-                switch (GetRCState(rc))
-                {
-                default:
-                    return rc;
-                case rcLocked:
-                    return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcLocked );
-                case rcReadonly:
-                    return RC ( rcDB, rcMgr, rcCreating, rcDatabase, rcReadonly );
-                case rcNotFound:
-                    /* not found is good but probably unreachable */
-                    break;
-                case 0:
-                    rc = 0;
-                    break;
-                }
-            }
-            /* second good path */
-            break;
-
-        case kptTable:
-        case kptTable | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcTable, rcExists);
-
-        case kptColumn:
-        case kptColumn | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcColumn, rcExists);
-
-        case kptDatabase:
-        case kptDatabase | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcDatabase, rcExists);
-
-        case kptMetadata:
-        case kptMetadata | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcMetadata, rcExists);
-
-        default:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcIncorrect );
-        }
-
-        rc = KIndexCreate ( & idx, wd, type, cmode, path, ptype );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerInsertIndex (self, idx);
-            if ( rc == 0 )
-            {
-                idx -> use_md5 = use_md5;
-                * idxp = idx;
-                return 0;
-            }
-            
-            KIndexRelease ( idx );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseCreateIndex ( struct KDatabase *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVCreateIndex ( self, idx, type, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVCreateIndex ( KDatabase *self, KIndex **idxp,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    KDirectory *dir;
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcCreating, rcDatabase, rcReadonly );
-
-    rc = KDirectoryVCreateDir ( self -> dir, 0777, kcmOpen, "idx", NULL );
-    if ( rc == 0 )
-        rc = KDirectoryVOpenDirUpdate ( self -> dir, & dir, false, "idx", NULL );
-    if ( rc == 0 )
-    {
-        char path [ 256 ];
-        rc = KDirectoryVResolvePath ( dir, false, path, sizeof path, name, args );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerCreateIndexInt ( self -> mgr, idxp, dir,
-                type, cmode | kcmParents, path, self -> use_md5 );
-            if ( rc == 0 )
-            {
-                KIndex *idx = * idxp;
-                idx -> db = KDatabaseAttach ( self );
-            }
-        }
-
-        KDirectoryRelease ( dir );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableCreateIndex ( struct KTable *self, KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVCreateIndex ( self, idx, type, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVCreateIndex ( KTable *self, KIndex **idxp,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    KDirectory *dir;
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcTable, rcCreating, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcCreating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcTable, rcCreating, rcTable, rcReadonly );
-
-    rc = KDirectoryVCreateDir ( self -> dir, 0777, kcmOpen, "idx", NULL );
-    if ( rc == 0 )
-        rc = KDirectoryVOpenDirUpdate ( self -> dir, & dir, false, "idx", NULL );
-    if ( rc == 0 )
-    {
-        char path [ 256 ];
-        rc = KDirectoryVResolvePath ( dir, false, path, sizeof path, name, args );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerCreateIndexInt ( self -> mgr, idxp, dir,
-                type, cmode | kcmParents, path, self -> use_md5 );
-            if ( rc == 0 )
-            {
-                KIndex *idx = * idxp;
-                idx -> tbl = KTableAttach ( self );
-            }
-        }
-
-        KDirectoryRelease ( dir );
-    }
-
-    return rc;
-}
-
-
-/* OpenIndexRead
- * VOpenIndexRead
- *  open an index for read
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-static
-rc_t KDBManagerOpenIndexReadInt ( KDBManager *self,
-    const KIndex **idxp, const KDirectory *wd, const char *path )
-{
-    char idxpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        idxpath, sizeof idxpath, path, NULL );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        KSymbol * sym;
-
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (self, idxpath);
-        if (sym != NULL)
-        {
-            const KIndex * cidx;
-            rc_t obj;
-            
-            switch (sym->type)
-            {
-            case kptIndex:
-                cidx = (const KIndex *)sym->u.obj;
-#if 0
-                /* if open for update, refuse */
-                if ( cidx -> read_only )
-#endif
-#if 0
-                if (cidx is coherent)
-#endif
-                {
-                    /* attach a new reference and we're gone */
-                    rc = KIndexAddRef ( cidx );
-                    if ( rc == 0 )
-                        * idxp = cidx;
-                    return rc;
-                }
-                obj = rcDatabase;
-                break;
-                
-            default:
-                obj = rcPath;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return  RC (rcDB, rcMgr, rcOpening, obj, rcBusy);
-        }
-        
-        switch ( KDirectoryVPathType ( wd, idxpath, NULL ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcIndex, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        }
-
-        rc = KIndexMakeRead ( & idx, wd, idxpath );
-        if ( rc == 0 )
-        {
-            idx -> read_only = true;
-            rc = KDBManagerInsertIndex (self, idx);
-            if ( rc == 0 )
-            {
-                * idxp = idx;
-                return 0;
-            }
-
-            KIndexRelease ( idx );
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenIndexRead ( struct KDatabase const *self,
-    const KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenIndexRead ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenIndexRead ( const KDatabase *cself,
-    const KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( cself == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( cself -> dir,
-        path, sizeof path, "idx", 3, name, args );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        rc = KDBManagerOpenIndexReadInt ( cself -> mgr, (const KIndex **)& idx,
-                                          cself -> dir, path );
-        if ( rc == 0 )
-        {
-            KDatabase *self = ( KDatabase* ) cself;
-            idx -> db = KDatabaseAttach ( self );
-            * idxp = idx;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenIndexRead ( struct KTable const *self,
-    const KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVOpenIndexRead ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenIndexRead ( const KTable *self,
-    const KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    const char *ns = "idx";
-    uint32_t ns_size = 3;
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    if ( self -> prerelease )
-    {
-        ns = "";
-        ns_size = 0;
-    }
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, ns, ns_size, name, args );
-    if ( rc == 0 )
-    {
-        KIndex *idx;
-        rc = KDBManagerOpenIndexReadInt ( self -> mgr, (const KIndex**)& idx,
-                                          self -> dir, path );
-        if ( rc == 0 )
-        {
-            if (idx->tbl != self)
-                idx -> tbl = KTableAttach ( self );
-            * idxp = idx;
-        }
-    }
-    return rc;
-}
-
-
-/* OpenIndexUpdate
- * VOpenIndexUpdate
- *  open an index for read/write
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-static
-rc_t KDBManagerOpenIndexUpdate ( KDBManager *self,
-    KIndex **idxp, KDirectory *wd, const char *path )
-{
-    char idxpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        idxpath, sizeof idxpath, path, NULL );
-    if ( rc == 0 )
-    {
-        KSymbol * sym;
-        KIndex *idx;
-
-        sym =  KDBManagerOpenObjectFind (self, idxpath);
-        if (sym != NULL)
-        {
-            rc_t obj;
-            switch (sym->type)
-            {
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return RC ( rcDB, rcMgr, rcOpening, obj, rcBusy );
-        }
-        /* only open existing indices
-         * this seems wrong but its because the KDBPathType seems wrong
-         */
-        switch ( KDirectoryVPathType ( wd, idxpath, NULL ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcIndex, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        }
-
-        rc = KIndexMakeUpdate ( & idx, wd, path );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerInsertIndex (self, idx);
-            if ( rc == 0 )
-            {
-                * idxp = idx;
-                return 0;
-            }
-            
-            KIndexRelease ( idx );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenIndexUpdate ( struct KDatabase *self,
-    KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenIndexUpdate ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenIndexUpdate ( KDatabase *self,
-    KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    KDirectory *dir;
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcOpening, rcDatabase, rcReadonly );
-
-    rc = KDirectoryVOpenDirUpdate ( self -> dir, & dir, false, "idx", NULL );
-    if ( rc == 0 )
-    {
-        char path [ 256 ];
-        rc = KDirectoryVResolvePath ( dir, false, path, sizeof path, name, args );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerOpenIndexUpdate ( self -> mgr, idxp, dir, path );
-            if ( rc == 0 )
-            {
-                KIndex *idx = * idxp;
-                idx -> db = KDatabaseAttach ( self );
-            }
-        }
-
-        KDirectoryRelease ( dir );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenIndexUpdate ( struct KTable *self,
-    KIndex **idx, const char *name, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVOpenIndexUpdate ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVOpenIndexUpdate ( KTable *self,
-    KIndex **idxp, const char *name, va_list args )
-{
-    rc_t rc = 0;
-    KDirectory *dir;
-
-    if ( idxp == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * idxp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcTable, rcOpening, rcTable, rcReadonly );
-
-    rc = KDirectoryVOpenDirUpdate ( self -> dir, & dir, false, "idx", NULL );
-    if ( rc == 0 )
-    {
-        char path [ 256 ];
-        rc = KDirectoryVResolvePath ( dir, false, path, sizeof path, name, args );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerOpenIndexUpdate ( self -> mgr, idxp, dir, path );
-            if ( rc == 0 )
-            {
-                KIndex *idx = * idxp;
-                idx -> tbl = KTableAttach ( self );
-            }
-        }
-
-        KDirectoryRelease ( dir );
-    }
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KIndexLocked ( const KIndex *self )
-{
-    if ( self != NULL )
-    {
-        rc_t rc = KDBWritable ( self -> dir, "" );
-        if (GetRCState ( rc ) == rcLocked)
-            return true;
-    }
-    return false;
-}
-
-
-/* Version
- *  returns the format version
- */
-LIB_EXPORT rc_t CC KIndexVersion ( const KIndex *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * version = 0;
-        return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
-    }
-
-    * version = self -> vers;
-    return 0;
-}
-
-
-/* Type
- *  returns the type of index
- */
-LIB_EXPORT rc_t CC KIndexType ( const KIndex *self, KIdxType *type )
-{
-    if ( type == NULL )
-        return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * type = ( KIdxType ) 0;
-        return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
-    }
-
-    * type = ( KIdxType ) self -> type;
-    return 0;
-}
-
-/* Commit
- *  ensure any changes are committed to disk
- */
-LIB_EXPORT rc_t CC KIndexCommit ( KIndex *self )
-{
-    rc_t rc = 0;
-    bool proj;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcCommitting, rcSelf, rcNull );
-
-    if ( ! self -> dirty )
-        return 0;
-
-    rc = RC ( rcDB, rcIndex, rcCommitting, rcType, rcUnsupported );
-
-    proj = ( self -> type & kitProj ) != 0;
-
-    switch ( self -> type )
-    {
-        case kitText:
-        case kitText | kitProj:
-            switch ( self -> vers )
-            {
-            case 1:
-                rc = KTrieIndexPersist_v1 ( & self -> u . txt1,
-                    proj, self -> dir, self -> path, self -> use_md5 );
-                break;
-            case 2:
-            case 3:
-            case 4:
-                rc = KTrieIndexPersist_v2 ( & self -> u . txt2,
-                    proj, self -> dir, self -> path, self -> use_md5 );
-                break;
-            }
-            break;
-
-        case kitU64:
-            switch(self -> vers) {
-            case 3:
-            case 4:
-                rc = KU64IndexPersist_v3(&self->u.u64_3, proj, self->dir,
-                                         self->path, self->use_md5);
-                break;
-            }
-            break;
-    }
-
-    if ( rc == 0 )
-        self -> dirty = false;
-
-    return rc;
-}
-
-/* Insert
- *  creates a mapping from key to id
- *  and potentially from id to key if supported
- *
- *  "unique" [ IN ] - if non zero, key must be unique
- *
- *  "key" [ IN ] - NUL terminated string for text
- *
- *  "id" [ IN ] - id
- */
-LIB_EXPORT rc_t CC KIndexInsertText ( KIndex *self, bool unique,
-    const char *key, int64_t id )
-{
-    rc_t rc = 0;
-    bool proj;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcInserting, rcSelf, rcNull );
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcInserting, rcString, rcNull );
-    if ( key [ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcInserting, rcString, rcInvalid );
-    if ( self -> read_only )
-        return RC ( rcDB, rcIndex, rcInserting, rcIndex, rcReadonly );
-
-    proj = false;
-    switch ( self -> type )
-    {
-    case kitText | kitProj:
-        proj = true;
-    case kitText:
-        switch ( self -> vers )
-        {
-        case 1:
-            /* there is a limit on ids in v1 */
-            if ( id <= 0 || ( id >> 32 ) != 0 )
-                return RC ( rcDB, rcIndex, rcInserting, rcId, rcExcessive );
-
-            rc = KTrieIndexInsert_v1 ( & self -> u . txt1,
-                proj, key, ( uint32_t ) id );
-            break;
-        case 2:
-        case 3:
-        case 4:
-            rc = KTrieIndexInsert_v2 ( & self -> u . txt2,
-                proj, key, id );
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcInserting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcInserting, rcType, rcUnsupported );
-    }
-
-    switch ( GetRCState ( rc ) )
-    {
-    case 0:
-        self -> dirty = true;
-        break;
-    case rcExists:
-        if ( ! unique )
-            rc = RC ( rcDB, rcIndex, rcInserting, rcConstraint, rcViolated );
-    default:
-        break;
-    }
-
-    return rc;
-}
-
-
-/* Delete
- *  deletes all mappings from key
- */
-LIB_EXPORT rc_t CC KIndexDeleteText ( KIndex *self, const char *key )
-{
-    rc_t rc;
-    bool proj;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcRemoving, rcSelf, rcNull );
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcRemoving, rcString, rcNull );
-    if ( key [ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcRemoving, rcString, rcInvalid );
-    if ( self -> read_only )
-        return RC ( rcDB, rcIndex, rcRemoving, rcIndex, rcReadonly );
-
-    proj = false;
-    switch ( self -> type )
-    {
-    case kitText | kitProj:
-        proj = true;
-    case kitText:
-        switch ( self -> vers )
-        {
-        case 1:
-            rc = KTrieIndexDelete_v1 ( & self -> u . txt1, proj, key );
-            break;
-        case 2:
-        case 3:
-        case 4:
-            rc = KTrieIndexDelete_v2 ( & self -> u . txt2, proj, key );
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcRemoving, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcRemoving, rcType, rcUnsupported );
-    }
-
-    if ( rc == 0 )
-        self -> dirty = true;
-
-    return rc;
-}
-
-
-/* Find
- *  finds a single mapping from key
- */
-LIB_EXPORT rc_t CC KIndexFindText ( const KIndex *self, const char *key, int64_t *start_id, uint64_t *id_count,
-    int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
-    void *data )
-{
-    rc_t rc = 0;
-    uint32_t id32, span;
-
-    if ( id_count != NULL )
-        * id_count = 0;
-
-    if ( start_id == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcParam, rcNull );
-
-    * start_id = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
-    if ( key[ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcInvalid );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, custom_cmp, data );
-            if ( rc == 0 )
-                * start_id = id32;
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexFind_v2 ( & self -> u . txt2, key, start_id, & span, custom_cmp, data, self -> converted_from_v1 );
-#else
-            ( void ) ( span = 0 );
-            rc = KTrieIndexFind_v2 ( & self -> u . txt2, key, start_id, custom_cmp, data, self -> converted_from_v1  );
-#endif
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcSelecting, rcType, rcUnsupported );
-    }
-
-    if ( id_count != NULL )
-        * id_count = span;
-    
-    return rc;
-}
-
-
-/* FindAll
- *  finds all mappings from key
- */
-LIB_EXPORT rc_t CC KIndexFindAllText ( const KIndex *self, const char *key,
-    rc_t ( CC * f ) ( int64_t id, uint64_t id_count, void *data ), void *data )
-{
-    rc_t rc = 0;
-    int64_t id64;
-    uint32_t id32, span;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
-    if ( f == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcFunction, rcNull );
-    if ( key == NULL )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
-    if ( key[ 0 ] == 0 )
-        return RC ( rcDB, rcIndex, rcSelecting, rcString, rcInvalid );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, NULL, NULL );
-            if ( rc == 0 )
-                rc = ( * f ) ( id32, 1, data );
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexFind_v2 ( & self -> u . txt2, key, & id64, & span, NULL, NULL, self -> converted_from_v1 );
-#else
-            rc = KTrieIndexFind_v2 ( & self -> u . txt2, key, & id64, NULL, NULL, self -> converted_from_v1 );
-#endif
-            if ( rc == 0 )
-                rc = ( * f ) ( id64, span, data );
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcSelecting, rcType, rcUnsupported );
-    }
-    
-    return rc;
-}
-
-
-/* Project
- *  finds key(s) mapping to value/id if supported
- */
-LIB_EXPORT rc_t CC KIndexProjectText ( const KIndex *self,
-    int64_t id, int64_t *start_id, uint64_t *id_count,
-    char *key, size_t kmax, size_t *actsize )
-{
-    rc_t rc = 0;
-    int64_t dummy;
-    uint32_t span;
-
-    if ( start_id == NULL )
-        start_id = & dummy;
-
-    * start_id = 0;
-
-    if ( id_count != NULL )
-        * id_count = 0;
-
-    if ( key == NULL && kmax != 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
-
-    if ( kmax != 0 )
-        key [ 0 ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
-        
-    if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcInvalid );
-
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            /* there is a limit on ids in v1 */
-            if ( id <= 0 || ( id >> 32 ) != 0 )
-                return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-
-            rc = KTrieIndexProject_v1 ( & self -> u . txt1,
-                    ( uint32_t ) id, key, kmax, actsize );
-            if ( rc == 0 )
-                * start_id = id;
-            break;
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexProject_v2 ( & self -> u . txt2, id, start_id, & span, key, kmax, actsize );
-#else
-            rc = KTrieIndexProject_v2 ( & self -> u . txt2, id, key, kmax, actsize );
-            if ( rc == 0 )
-                * start_id = id;
-#endif
-            break;
-        default:
-            return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcProjecting, rcType, rcUnsupported );
-    }
-
-    if ( id_count != NULL )
-        * id_count = span;
-        
-    return rc;
-}
-
-
-/* ProjectAll
- *  finds key(s) mapping to value/id if supported
- */
-LIB_EXPORT rc_t CC KIndexProjectAllText ( const KIndex *self, int64_t id,
-    rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, const char *key, void *data ),
-    void *data )
-{
-    rc_t rc = 0;
-    char key [ 256 ];
-
-    uint32_t span;
-    int64_t start_id;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
-    if ( f == NULL )
-        return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcNull );
-    if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
-        return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcInvalid );
-        
-    span = 1;
-
-    switch ( self -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( self -> vers )
-        {
-        case 1:
-            /* there is a limit on ids in v1 */
-            if ( id <= 0 || ( id >> 32 ) != 0 )
-                return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-
-            rc = KTrieIndexProject_v1 ( & self -> u . txt1,
-                ( uint32_t ) id, key, sizeof key, NULL );
-            if ( rc == 0 )
-                rc = ( * f ) ( id, 1, key, data );
-            break;
-            
-        case 2:
-        case 3:
-        case 4:
-#if V2FIND_RETURNS_SPAN
-            rc = KTrieIndexProject_v2 ( & self -> u . txt2, id, & start_id, & span, key, sizeof key, NULL );
-#else
-            rc = KTrieIndexProject_v2 ( & self -> u . txt2, id, key, sizeof key, NULL );
-#endif
-            if ( rc == 0 )
-                rc = ( * f ) ( start_id, span, key, data );
-            break;
-            
-        default:
-            return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcDB, rcIndex, rcProjecting, rcType, rcUnsupported );
-    }
-        
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexInsertU64( KIndex *self, bool unique, uint64_t key, 
-    uint64_t key_size, int64_t id, uint64_t id_qty )
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        return RC(rcDB, rcIndex, rcInserting, rcSelf, rcNull);
-    }
-    if( self->read_only ) {
-        return RC(rcDB, rcIndex, rcInserting, rcIndex, rcReadonly);
-    }
-
-    switch( self->type )
-    {
-    case kitU64:
-        switch( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexInsert_v3(&self->u.u64_3, unique, key, key_size, id, id_qty );
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcInserting, rcIndex, rcBadVersion);
-        }
-        break;
-        
-    default:
-        return RC(rcDB, rcIndex, rcInserting, rcType, rcUnsupported);
-    }
-
-    switch( GetRCState(rc) ) {
-        case 0:
-            self->dirty = true;
-            break;
-        case rcExists:
-            if( !unique ) {
-                rc = RC(rcDB, rcIndex, rcInserting, rcConstraint, rcViolated);
-            }
-        default:
-            break;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexDeleteU64( KIndex *self, uint64_t key )
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        return RC(rcDB, rcIndex, rcRemoving, rcSelf, rcNull);
-    }
-    if( self->read_only ) {
-        return RC(rcDB, rcIndex, rcRemoving, rcIndex, rcReadonly);
-    }
-
-    switch( self->type )
-    {
-    case kitU64:
-        switch( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexDelete_v3(&self->u.u64_3, key);
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcRemoving, rcIndex, rcBadVersion);
-        }
-        break;
-    default:
-        return RC(rcDB, rcIndex, rcRemoving, rcType, rcUnsupported);
-    }
-
-    if( rc == 0 ) {
-        self -> dirty = true;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexFindU64( const KIndex* self, uint64_t offset, uint64_t* key, 
-    uint64_t* key_size, int64_t* id, uint64_t* id_qty )
-{
-    rc_t rc = 0;
-
-    if( key == NULL || key_size == NULL || id == NULL || id_qty == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcParam, rcNull);
-    }
-    *key = *key_size = *id = *id_qty = 0;
-    if( self == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
-    }
-
-    switch( self->type )
-    {
-    case kitU64:
-        switch( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexFind_v3(&self->u.u64_3, offset, key, key_size, id, id_qty);
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
-        }
-        break;
-    default:
-        return RC(rcDB, rcIndex, rcSelecting, rcType, rcUnsupported);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KIndexFindAllU64( const KIndex* self, uint64_t offset,
-    rc_t ( CC * f )(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data ), void* data)
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
-    }
-    if( f == NULL ) {
-        return RC(rcDB, rcIndex, rcSelecting, rcFunction, rcNull);
-    }
-
-    switch( self->type )
-    {
-    case kitU64:
-        switch( self->vers )
-        {
-        case 3:
-        case 4:
-            rc = KU64IndexFindAll_v3(&self->u.u64_3, offset, f, data);
-            break;
-        default:
-            return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
-        }
-        break;
-    default:
-        return RC(rcDB, rcIndex, rcSelecting, rcType, rcUnsupported);
-    }
-    return rc;
-}
-
-
-/* SetMaxId
- *  certain legacy versions of skey were built to know only the starting id
- *  of the NAME_FMT column, but were never given a maximum id. allow them
- *  to be corrected here.
- */
-LIB_EXPORT void CC KIndexSetMaxRowId ( const KIndex *cself, int64_t max_row_id )
-{
-    if ( cself != NULL ) switch ( cself -> type )
-    {
-    case kitText:
-    case kitText | kitProj:
-        switch ( cself -> vers )
-        {
-        case 2:
-        case 3:
-        case 4:
-            /* here we can repair the max row id */
-            if ( cself -> u . txt2 . pt . maxid < max_row_id )
-                ( ( KIndex* ) cself ) -> u . txt2 . pt . maxid = max_row_id;
-            break;
-        }
-        break;
-    }
-}
diff --git a/libs/kdb/wkdb-priv.h b/libs/kdb/wkdb-priv.h
deleted file mode 100644
index 5f18aba..0000000
--- a/libs/kdb/wkdb-priv.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kdb_priv_
-#define _h_kdb_priv_
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifndef _h_kdb_manager_
-#include <kdb/manager.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This symbol is inserted where the KDB is being tweaked to allow
- * VFS URI syntax in opening KDB database objects initially to support
- * krypto passwords more fully.  By specifying the password source
- * individually for opens two KDB objects with different passwords can be opened.
- */
-#define SUPPORT_VFS_URI 1
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTree;
-struct BSTNode;
-struct KDirectory;
-struct KDBManager;
-
-/*--------------------------------------------------------------------------
- * KDB utility
- */
-
-
-/* PathType
- *  checks type of path
- *
- * if mgr != NULL we will try accession and uri resolution on path
- */
-int KDBPathTypeDir ( const struct KDirectory *dir, int type,bool *zombies, const char *path );
-int KDBPathType ( const struct KDirectory *dir, bool *zombies, const char *path );
-
-/* OpenPathType
- * Opens a path if it is of the specified type.  Even if it is an archive file
- * instead of a directory.
- *
- * if dpdir is NULL it will not return with an open Directory but it will have
- * checked that the type requested is the type present even if in an archive.
- *
- * if realpathtype is not NULL the found type will be returned regardless
- * of a match to request path type.
- *
- * the return will be zero only if the path does point to a directory or
- * archive that is of the requested type.  An archive will have been opened
- * but reshut if dpdir is NULL.
- */ 
-rc_t KDBOpenPathTypeRead ( const struct KDBManager * mgr, const struct KDirectory * dir, const char * path, 
-    const struct KDirectory ** dpdir, int pathtype, int * realpathtype, bool try_srapath );
-
-/* Writable
- *  examines a directory structure for any "lock" files
- *  examines a file for ( any ) write permission
- */
-bool KDBIsLocked ( const struct KDirectory *dir, const char *path );
-rc_t KDBWritable ( const struct KDirectory *dir, const char *path );
-
-/* Lock
- *  performs directory locking
- */
-rc_t KDBLockDir ( struct KDirectory *dir, const char *path );
-rc_t KDBLockFile ( struct KDirectory *dir, const char *path );
-
-/* Unlock
- *  performs directory unlocking
- */
-rc_t KDBUnlockDir ( struct KDirectory *dir, const char *path );
-rc_t KDBUnlockFile ( struct KDirectory *dir, const char *path );
-
-/* GetObjModDate
- *  extract mod date from a path
- */
-rc_t KDBGetObjModDate ( const struct KDirectory *dir, KTime_t *mtime );
-
-/* GetPathModDate
- *  extract mod date from a path
- */
-rc_t KDBVGetPathModDate ( const struct KDirectory *dir,
-    KTime_t *mtime, const char *path, va_list args );
-
-/* GetNamespaceString
- *  return a static const reference to a string representing 
- *  a namespace for the given kpt<database> type in namespace
- */
-const char * KDBGetNamespaceString ( int namespace );
-
-/* KDBMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, ... );
-/* VMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBVMakeSubPath ( const struct KDirectory *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, va_list args );
-
-/* VDrop
- */
-rc_t KDBMgrVDrop ( struct KDirectory * dir, const struct KDBManager * mgr, uint32_t obj_type,
-                   const char * path, va_list args );
-rc_t KDBVDrop ( struct KDirectory *dir, const struct KDBManager * mgr,
-    uint32_t type, const char *name, va_list args );
-
-/* Rename
- */
-rc_t KDBRename ( struct KDirectory *dir, struct KDBManager *mgr,
-                 uint32_t type, bool force, const char *from, const char *to );
-
-/* Alias
- */
-rc_t KDBAlias ( struct KDirectory *dir, uint32_t type,
-    const char *targ, const char *alias );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kdb_priv_ */
diff --git a/libs/kdb/wkdb.c b/libs/kdb/wkdb.c
deleted file mode 100644
index 301ec32..0000000
--- a/libs/kdb/wkdb.c
+++ /dev/null
@@ -1,1417 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "wkdb-priv.h"
-#include "kdbfmt-priv.h"
-#include "dbmgr-priv.h"
-
-#include <krypto/key.h>
-#include <krypto/encfile.h>
-#include <krypto/wgaencrypt.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/resolver.h>
-#include <vfs/manager-priv.h>
-#include <sra/srapath.h>
-
-#include <kfs/kfs-priv.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/arc.h>
-#include <kfs/tar.h>
-#include <kfs/sra.h>
-#include <kfs/kfs-priv.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <va_copy.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <errno.h>
-
-#ifndef SUPPORT_VFS_URI
-#define SUPPORT_VFS_URI 0
-#endif
-
-/*--------------------------------------------------------------------------
- * (W)KDB utility
- */
-
-/* KDBHdrValidate
- *  validates that a header sports a supported byte order
- *  and that the version is within range
- */
-rc_t KDBHdrValidate ( const KDBHdr *hdr, size_t size,
-    uint32_t min_vers, uint32_t max_vers )
-{
-    assert ( hdr != NULL );
-
-    if ( size < sizeof * hdr )
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-
-    if ( hdr -> endian != eByteOrderTag )
-    {
-        if ( hdr -> endian == eByteOrderReverse )
-            return RC ( rcDB, rcHeader, rcValidating, rcByteOrder, rcIncorrect );
-        return RC ( rcDB, rcHeader, rcValidating, rcData, rcCorrupt );
-    }
-
-    if ( hdr -> version < min_vers || hdr -> version > max_vers )
-        return RC ( rcDB, rcHeader, rcValidating, rcHeader, rcBadVersion );
-
-    return 0;
-}
-
-/* KDBPathType
- *  checks type of path
- */
-enum ScanBits
-{
-    scan_db     = ( 1 <<  0 ),
-    scan_tbl    = ( 1 <<  1 ),
-    scan_idx    = ( 1 <<  2 ),
-    scan_col    = ( 1 <<  3 ),
-    scan_idxN   = ( 1 <<  4 ),
-    scan_data   = ( 1 <<  5 ),
-    scan_dataN  = ( 1 <<  6 ),
-    scan_md     = ( 1 <<  7 ),
-    scan_cur    = ( 1 <<  8 ),
-    scan_rNNN   = ( 1 <<  9 ),
-    scan_lock   = ( 1 << 10 ),
-    scan_odir   = ( 1 << 11 ),
-    scan_ofile  = ( 1 << 12 ),
-    scan_meta   = ( 1 << 13 ),
-    scan_skey   = ( 1 << 14 ),
-    scan_sealed = ( 1 << 15 ),
-    scan_zombie = ( 1 << 16 )
-};
-
-static
-rc_t CC scan_dbdir ( const KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    uint32_t *bits = data;
-
-    type &= kptAlias - 1;
-
-    if ( type == kptDir )
-    {
-        switch ( name [ 0 ] )
-        {
-        case 'c':
-            if ( strcmp ( name, "col" ) == 0 )
-            { * bits |= scan_col; return 0; }
-            break;
-        case 'm':
-            if ( strcmp ( name, "md" ) == 0 )
-            { * bits |= scan_md; return 0; }
-            break;
-        case 't':
-            if ( strcmp ( name, "tbl" ) == 0 )
-            { * bits |= scan_tbl; return 0; }
-            break;
-        case 'i':
-            if ( strcmp ( name, "idx" ) == 0 )
-            { * bits |= scan_idx; return 0; }
-            break;
-        case 'd':
-            if ( strcmp ( name, "db" ) == 0 )
-            { * bits |= scan_db; return 0; }
-            break;
-        }
-
-        * bits |= scan_odir;
-    }
-    else if ( type == kptFile )
-    {
-        switch ( name [ 0 ] )
-        {
-        case 'l':
-            if ( strcmp ( name, "lock" ) == 0 )
-            { * bits |= scan_lock; return 0; }
-            break;
-        case 'i':
-            if ( memcmp ( name, "idx", 3 ) == 0 )
-            {
-                if ( isdigit ( name [ 3 ] ) )
-                { * bits |= scan_idxN; return 0; }
-            }
-            break;
-        case 'd':
-            if ( memcmp ( name, "data", 4 ) == 0 )
-            {
-                if ( name [ 4 ] == 0 )
-                { * bits |= scan_data; return 0; }
-                if ( isdigit ( name [ 4 ] ) )
-                { * bits |= scan_dataN; return 0; }
-            }
-        case 'c':
-            if ( strcmp ( name, "cur" ) == 0 )
-            { * bits |= scan_cur; return 0; }
-            break;
-        case 'r':
-            if ( isdigit ( name [ 1 ] ) && isdigit ( name [ 2 ] ) &&
-                 isdigit ( name [ 3 ] ) && name [ 4 ] == 0 )
-            { * bits |= scan_rNNN; return 0; }
-            break;
-        case 'm':
-            if ( strcmp ( name, "meta" ) == 0 )
-            { * bits |= scan_meta; return 0; }
-            break;
-        case 's':
-            if ( strcmp ( name, "skey" ) == 0 )
-            { * bits |= scan_skey; return 0; }
-            if ( strcmp ( name, "sealed" ) == 0 )
-            { * bits |= scan_sealed; return 0; }
-            break;
-        }
-
-        * bits |= scan_ofile;
-    }
-    else if (type == kptZombieFile )
-    {
-        * bits |= scan_zombie;
-    }
-    
-    return 0;
-}
-
-const char *KDBGetNamespaceString ( int namespace )
-{
-    static const char * ns_array [] = { NULL, "db", "tbl", "col", "idx", "md" };
-
-    switch (namespace)
-    {
-    default:
-        return ns_array [0];
-    case kptDatabase:
-        return ns_array [1];
-    case kptTable:
-        return ns_array [2];
-    case kptColumn:
-        return ns_array [3];
-    case kptIndex:
-        return ns_array [4];
-    case kptMetadata:
-        return ns_array [5];
-    }
-}
-
-
-int KDBPathTypeDir (const KDirectory * dir, int type, bool * pHasZombies, const char * path)
-{
-    const char * leaf, * parent;
-    uint32_t bits;
-    rc_t rc;
-
-    bits = 0;
-
-    assert ((type == kptDir) || (type == (kptDir|kptAlias)));
-
-    rc = KDirectoryVVisit ( dir, false, scan_dbdir, & bits, path, NULL );
-    if ( rc == 0 ) do
-    {
-        if ( ( bits & scan_zombie ) != 0 ) {
-            bits &= ~scan_zombie;
-            if (pHasZombies)
-                *pHasZombies = true;
-        }
-        /* look for a column */
-        if ( ( bits & scan_idxN ) != 0 &&
-             ( bits & ( scan_data | scan_dataN ) ) != 0 )
-        {
-            if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                type += kptColumn - kptDir;
-            break;
-        }
-
-        /* look for a table */
-        if ( ( bits & scan_col ) != 0 )
-        {
-            /* can't have sub-tables or a db */
-            if ( ( bits & ( scan_db | scan_tbl ) ) == 0 )
-            {
-                /* look for an old-structure table */
-                if ( ( bits & ( scan_meta | scan_md ) ) == scan_meta ||
-                     ( bits & ( scan_skey | scan_idx ) ) == scan_skey )
-                    type += kptPrereleaseTbl - kptDir;
-                else
-                    type += kptTable - kptDir;
-            }
-            break;
-        }
-
-        /* look for metadata */
-        if ( ( bits & ( scan_cur | scan_rNNN ) ) != 0 )
-        {
-            if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                type += kptMetadata - kptDir;
-            break;
-        }
-
-        /* look for a database */
-        if ( ( bits & scan_tbl ) != 0 )
-        {
-            if ( ( bits & scan_col ) == 0 )
-                type += kptDatabase - kptDir;
-            break;
-        }
-
-        /* look for a structured column */
-        if ( ( bits & scan_odir ) != 0 )
-        {
-            leaf = strrchr ( path, '/' );
-            if ( leaf != NULL )
-            {
-                parent = string_rchr ( path, leaf - path, '/' );
-                if ( parent ++ == NULL )
-                    parent = path;
-                if ( memcmp ( parent, "col/", 4 ) != 0 )
-                    break;
-
-                bits = 0;
-                if ( KDirectoryVVisit ( dir, 1, scan_dbdir, & bits, path, NULL ) == 0 )
-                {
-                    if ( ( bits & scan_idxN ) != 0 &&
-                         ( bits & ( scan_data | scan_dataN ) ) != 0 )
-                    {
-                        if ( ( bits & ( scan_db | scan_tbl | scan_idx | scan_col ) ) == 0 )
-                            type += kptColumn - kptDir;
-                        break;
-                    }
-                }
-            }
-        }
-    } while (0);
-
-    return type;
-}
-
-
-int KDBPathType ( const KDirectory *dir, bool *pHasZombies, const char *path )
-{
-    const char *leaf, *parent;
-
-
-    rc_t rc;
-    int type = KDirectoryVPathType ( dir, path, NULL );
-    
-    if (pHasZombies)
-        *pHasZombies = false;
-
-    switch ( type )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        type = KDBPathTypeDir (dir, type, pHasZombies, path);
-        break;
-
-    case kptFile:
-    case kptFile | kptAlias:
-    {
-        /* if we hit a file first try it as an archive */
-        const KDirectory * ldir;
-
-        rc = KDirectoryOpenSraArchiveRead_silent ( dir, &ldir, false, path );
-        if ( rc != 0 )
-            rc = KDirectoryOpenTarArchiveRead_silent ( dir, &ldir, false, path );
-        /* it was an archive so recur */
-        if ( rc == 0 )
-        {
-            /* recheck this newly opened directory for KDB/KFS type */
-            int type2;
-
-            type2 = KDBPathType ( ldir, NULL, "." );
-            if ((type2 != kptDir) || (type != (kptDir|kptAlias)))
-                type = type2;
-
-            KDirectoryRelease (ldir);
-        }
-        /* it was not an archive so see if it it's an idx file */
-        else
-        {
-            leaf = strrchr ( path, '/' );
-            if ( leaf != NULL )
-            {
-                parent = string_rchr ( path, leaf - path, '/' );
-                if ( parent ++ == NULL )
-                    parent = path;
-                if ( memcmp ( parent, "idx/", 4 ) == 0 )
-                    type += kptIndex - kptFile;
-            }
-        }
-        break;
-    }
-    }
-    return type;
-}
-
-
-
-#if SUPPORT_VFS_URI
-#else
-/* return configured password as ASCIZ
- * opertates on vfs/kfs/kfg objects, not kdb objects */
-static
-rc_t KDBOpenFileGetPassword (char * pw, size_t pwz)
-{
-    VFSManager * mgr;
-    rc_t rc;
-
-    assert (pw);
-    assert (pwz);
-
-    pw[0] = '\0';
-
-    rc = VFSManagerMake (&mgr);
-    if (rc)
-        ;                      /* failure to make VFS manager: pass along rc */
-    else
-    {
-        size_t pwfz;
-        char pwf [4096 + 1];
-
-        rc = VFSManagerGetConfigPWFile (mgr, pwf, sizeof (pwf) - 1, &pwfz);
-        if (rc)
-            /* failure to get password file path: tweak rc */
-            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcNotFound);
-
-        else
-        {
-            VPath * pwp;
-
-            pwf [pwfz] = '\0'; /* force to ASCIZ */
-
-#if 0
-            rc = VPathMakeSysPath (&pwp, pwf);
-#else
-            rc = VFSManagerMakePath (mgr, &pwp, pwf);
-#endif
-
-            if (rc)
-                ;       /* failure to construct a path from the string */
-            
-            else
-            {
-                const KFile * pwf;
-          
-                rc = VFSManagerOpenFileRead (mgr, &pwf, pwp);
-                if (rc)
-                    /* failure to open password file */
-                    rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcNotOpen);
-
-                else
-                {
-                    size_t z;
-                    char pwb [4098]; /* arbitrarily using 4096 as maximum
-                                        allowed length */
-
-                    /* at this point we are only getting the password from a 
-                     * file but in the future if we can get it from a pipe of
-                     * some sort we can't count on the ReadAll to really know
-                     * if we hit end of file and not just a pause in the
-                     * streaming.  VFS/KFS 2 will have to fix this somehow
-                     */
-
-                    rc = KFileReadAll (pwf, 0, pwb, sizeof pwb, &z);
-                    if (rc)
-                        ;       /* failure to read password file: pass along rc */
-                    else
-                    {
-                        /* trim off EOL if present */
-                        char * pc;
-
-                        pwb[z] = '\0';   /* force ASCIZ */
-
-                        pc = string_chr (pwb, z, '\r');
-                        if (pc)
-                        {
-                            *pc = '\0';
-                            z = 1 + pc - pwb;
-                        }
-                        pc = string_chr (pwb, z, '\n');
-                        if (pc)
-                        {
-                            *pc = '\0';
-                            z = 1 + pc - pwb;
-                        }
-                        if (z == 0)
-                            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcTooShort);
-
-                        else if (pwz < z) /* pwz came in as 4096 */
-                            rc = RC (rcDB, rcMgr, rcOpening, rcEncryptionKey, rcTooLong);
-
-                        else
-                        {
-                            memmove (pw, pwb, z+1);
-                        }
-                    }
-                    KFileRelease (pwf);
-                }
-                VPathRelease (pwp);
-            }
-        }
-        VFSManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-/* not KDB specific - just uses vfs/krypto/kfs objects */
-static
-rc_t KDBOpenFileAsDirectory (const KDirectory * dir,
-                             const char * path, 
-                             const KDirectory ** pdir,
-                             uint32_t rcobj)
-{
-    const KFile * file;
-    const KFile * f;
-    const KDirectory * ldir;
-    bool encrypted = false;
-
-    rc_t rc;
-
-    *pdir = NULL;
-
-    rc = KDirectoryOpenFileRead (dir, &file, path);
-    if (rc == 0)
-    {
-        rc = KFileRandomAccess(file);
-        if (rc)
-            rc = RC (rcDB, rcMgr, rcOpening, rcobj, rcUnsupported);
-        else
-        {
-            size_t tz;
-            char tbuff [4096];
-            char pbuff [4096 + 1];
-
-            rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-            if (rc == 0)
-            {
-                if (KFileIsEnc (tbuff, tz) == 0)
-                {
-                    encrypted = true;
-
-                    rc = KDBOpenFileGetPassword (pbuff, sizeof (pbuff) - 1);
-                    if (rc == 0)
-                    {
-                        KKey key;
-
-                        rc = KKeyInitRead (&key, kkeyAES128, pbuff, string_size (pbuff));
-                        if (rc == 0)
-                        {
-                            rc = KEncFileMakeRead (&f, file, &key);
-                            if (rc == 0)
-                            {
-                                /* KEncFileMakeRead adds a reference */
-                                KFileRelease (file);
-                                file = f;
-                                rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-                            }
-                        }
-                    }
-                }
-                else if (KFileIsWGAEnc (tbuff, tz) == 0)
-                {
-                    encrypted = true;
-
-                    rc = KDBOpenFileGetPassword (pbuff, sizeof (pbuff) - 1);
-                    if (rc == 0)
-                    {
-                        rc = KFileMakeWGAEncRead (&f, file, pbuff, string_size (pbuff));
-                        if (rc == 0)
-                        {
-                            /* KFileMakeWGAEncRead adds a reference */
-                            KFileRelease (file);
-                            file = f;
-                            rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-                        }
-                    }
-                }
-                /* else not a handled encryption or unencrypted: we can't distinguish too much */
-
-                if (rc == 0)
-                {
-                    if (KFileIsSRA (tbuff, tz) == 0)
-                    {
-                        rc = KDirectoryOpenSraArchiveReadUnbounded_silent_preopened (dir,
-                                                                                     &ldir,
-                                                                                     false,
-                                                                                     file,
-                                                                                     path);
-                    }
-                    else
-                    {
-                        rc = KDirectoryOpenTarArchiveRead_silent_preopened (dir, &ldir, false,
-                                                                            file, path);
-                        if (rc == 0)
-                            KFileRelease (file);
-                    }
-
-                    /* not an archive type we handle or a bad archive */
-                    if (rc)
-                    {
-                        if (encrypted)
-                            rc = RC ( rcDB, rcMgr, rcOpening, rcEncryptionKey, rcIncorrect );
-                        else
-                            rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-                    }
-                    else
-                    {
-                        /*
-                         * release our ownership of the KFile that but archive will 
-                         * keep theirs
-                         */
-                        KFileRelease (file);
-                        *pdir = ldir;
-                        return 0;
-                    }
-                }
-            }
-        }
-        KFileRelease (file);
-    }
-    return rc;
-}
-#endif
-
-
-static rc_t KDBOpenPathTypeReadInt ( const KDBManager * mgr, const KDirectory * dir, const char * path,
-                                     const KDirectory ** pdir, int * type,
-                                     int pathtype, uint32_t rcobj, bool try_srapath )
-{
-    VFSManager * vmgr = mgr->vfsmgr;
-    const KDirectory * ldir = NULL;
-    rc_t rc = 0;
-
-    /* object relative opens can be done using KFS - we hacked in VFS after all */
-    if (! try_srapath)
-    {
-        rc = KDirectoryOpenDirUpdate ((KDirectory*)dir, (KDirectory**)pdir, false, path);
-        if ((rc) && (GetRCState(rc) != rcNotFound))
-            rc = KDirectoryOpenDirRead (dir, pdir, false, path);
-    }
-    else
-    {
-        VPath * vpath;
-
-        /*
-         * We've got to decide if the path coming in is a full or relative
-         * path and if relative make it relative to dir or possibly its a srapath
-         * accession
-         *
-         */
-        rc = VPathMakeDirectoryRelative ( &vpath, dir, path );
-        if ( rc == 0 )
-        {
-            rc = VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt ( vmgr, dir, &ldir, vpath );
-
-            if ( rc == 0 )
-            {
-                *type = (~kptAlias) & KDBPathType ( ldir, NULL, "." );
-
-                /* just a directory, not a kdb type */
-                if ( *type == kptDir )
-                    rc = RC (rcDB, rcMgr, rcOpening, rcPath, rcIncorrect);
-
-                else if ( *type != pathtype )
-                {
-                    KDirectoryRelease( ldir );
-                    rc = RC ( rcDB, rcMgr, rcOpening, rcobj, rcIncorrect );
-                }
-                else
-                {
-                    if ( pdir != NULL )
-                        *pdir = ldir;
-                    else
-                        KDirectoryRelease( ldir );
-                }
-            }
-            VPathRelease ( vpath );
-        }
-    }
-    return rc;
-}
-
-rc_t KDBOpenPathTypeRead ( const KDBManager * mgr, const KDirectory * dir, const char * path, 
-    const KDirectory ** pdir, int pathtype, int * ppathtype, bool try_srapath )
-{
-    const KDirectory *ldir;
-    rc_t rc = 0;
-    uint32_t rcobj;
-    int type = kptNotFound; /* bogus? */
-
-/*     KOutMsg ("%s: %s\n", __func__, path); */
-
-    if ( pdir != NULL )
-        *pdir = NULL;
-    if ( ppathtype != NULL )
-        *ppathtype = type;
-
-    switch (pathtype & ~ kptAlias) /* tune the error message based on path type */
-    {
-        /* we'll hit this if we don't track defines in kdb/manager.h */
-    default:
-        rc = RC (rcDB, rcMgr, rcOpening, rcType, rcInvalid);
-        return rc;
-
-    case kptTable:
-    case kptPrereleaseTbl:
-        rcobj = rcTable;
-        break;
-
-    case kptColumn:
-        rcobj = rcColumn;
-        break;
-
-    case kptDatabase:
-    case kptDatabase | kptAlias:
-        rcobj = rcDatabase;
-        break;
-    }
-
-    rc = KDBOpenPathTypeReadInt( mgr, dir, path, &ldir, &type, pathtype, rcobj, try_srapath );
-
-    if (rc == 0)
-    {
-        if ( ppathtype != NULL )
-            *ppathtype = type;
-
-        if (pdir != NULL)
-            *pdir = ldir;
-        else
-            KDirectoryRelease (ldir);
-    }
-
-    return rc;
-}
-
-
-/* Writable
- *  examines a directory structure for any reason it can't be opened for update
- *  NOTE: will not currently check for archive
- */
-rc_t KDBWritable ( const KDirectory *dir, const char *path )
-{
-    uint32_t access;
-    rc_t rc;
-
-    /* protect us from bad parameters */
-    if (dir == NULL)
-        return RC (rcDB, rcPath, rcAccessing, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcPath, rcAccessing, rcPath, rcNull);
-
-    /* we have to be able to check the access if it is to be writable */
-    rc = KDirectoryVAccess ( dir, & access, path, NULL );
-    if ( rc == 0 )
-    {
-        int kpt;
-
-        /* we could use KDBPathType with some modifications */
-        kpt = KDirectoryPathType (dir, path) & ~kptAlias;
-        switch (kpt)
-        {
-        case kptDir:
-            /* if there is a lock (or deprecated sealed) file in this directory */
-            switch ( KDirectoryPathType ( dir, "%s/lock", path ) )
-            {
-            case kptFile:
-            case kptFile | kptAlias:
-                rc = RC (rcDB, rcPath, rcAccessing, rcLock, rcLocked );
-                break;
-            case kptNotFound:
-                /* much simpler handling for the sealed file */
-                switch ( KDirectoryPathType ( dir, "%s/sealed", path ) )
-                {
-                case kptFile:
-                case kptFile | kptAlias:
-                    rc = RC (rcDB, rcPath, rcAccessing, rcLock, rcLocked );
-                    break;
-                case kptNotFound:
-                    if ( ( access & 0222 ) == 0 )
-                        rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcReadonly );
-                    /* else rc is still 0 from VAccess */
-                }
-                break;
-            case kptBadPath:
-                /* likely to be a non-directory or something */
-                rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcInvalid);
-                break;
-            default:
-                /* an illegal type of object named "lock" is in this directory
-                 * which will block the ability to lock it
-                 */
-                rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcUnexpected);
-            }
-            break;
-        case kptFile:
-            /* if there is a lock (or deprecated sealed) file in this directory */
-            switch ( KDirectoryPathType ( dir, "%s.lock", path ) )
-            {
-            case kptFile:
-            case kptFile | kptAlias:
-                rc = RC ( rcDB, rcPath, rcAccessing, rcLock, rcLocked );
-                break;
-            case kptNotFound:
-                break;
-            case kptBadPath:
-                /* unlikely */
-                rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcInvalid);
-                break;
-            default:
-                /* an illegal type of object named "lock" is in this directory
-                 * which will block the ability to lock it
-                 */
-                rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcUnexpected);
-            }
-            break;
-        case kptBadPath:
-            /* likely to be a non-driectory or something */
-            rc = RC ( rcDB, rcPath, rcAccessing, rcPath, rcInvalid);
-            break;
-        default:
-            /* an illegal type of object named "lock" is in this directory
-             * which will block the ability to lock it
-             */
-            rc = RC (rcDB, rcPath, rcAccessing, rcPath, rcUnexpected);
-        }
-    }
-    return rc;
-}
-
-
-bool KDBIsLocked ( const KDirectory *dir, const char *path )
-{
-
-    rc_t rc = KDBWritable (dir, path);
-    if (GetRCState (rc) == rcLocked)
-        return true;
-    return false;
-}
-
-
-/* Lock
- *  performs directory locking
- */
-rc_t KDBLockDir ( KDirectory *dir, const char *path )
-{
-    KFile *f;
-    rc_t rc;
-
-    if (dir == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcPath, rcNull);
-
-    rc = KDirectoryCreateFile ( dir, & f, 0, 0444, kcmOpen, "%s/lock", path );
-    if ( rc == 0 )
-    {
-        KFileRelease ( f );
-        rc = KDirectoryVSetAccess ( dir, 1, 0, 0222, path, NULL );
-    }
-    return rc;
-}
-
-rc_t KDBLockFile ( KDirectory *dir, const char *path )
-{
-    KFile *f;
-    rc_t rc;
-
-    if (dir == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcPath, rcNull);
-
-    rc = KDirectoryCreateFile ( dir, & f, false, 0444, kcmOpen, "%s.lock", path );
-    if ( rc == 0 )
-    {
-        KFileRelease ( f );
-        rc = KDirectoryVSetAccess ( dir, 0, 0, 0222, path, NULL );
-    }
-    return rc;
-}
-
-/* Unlock
- *  performs directory unlocking
- */
-static
-rc_t CC KDBUnlockVisitor ( KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    switch ( type )
-    {
-    case kptFile:
-    case kptFile | kptAlias:
-
-        /* don't ever unlock frozen metadata revisions */
-        if ( name [ 0 ] == 'r' )
-        {
-            char *end;
-            strtoul ( name + 1, & end, 10 );
-            if ( end [ 0 ] == 0 )
-                return 0;
-        }
-
-        return KDirectoryVSetAccess ( dir, false, 0220, 0222, name, NULL );
-
-    case kptDir:
-    case kptDir | kptAlias:
-        if ( KDirectoryPathType ( dir, "%s/lock", name ) == kptNotFound )
-        {
-            rc_t rc = KDirectoryVSetAccess ( dir, 0, 0220, 0222, name, NULL );
-            if ( rc == 0 )
-            {
-                rc = KDirectoryVVisitUpdate ( dir, false,
-                    KDBUnlockVisitor, NULL, name, NULL );
-            }
-            return rc;
-        }
-        break;
-    }
-
-    return 0;
-}
-
-rc_t KDBUnlockDir ( KDirectory *dir, const char *path )
-{
-    /* change directory access bits */
-    rc_t rc;
-
-    if (dir == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcPath, rcNull);
-
-    rc = KDirectoryVSetAccess ( dir, false, 0220, 0222, path, NULL );
-    if ( rc == 0 )
-    {
-        /* remove lock file */
-        rc = KDirectoryRemove ( dir, false, "%s/lock", path );
-        if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-            rc = KDirectoryRemove ( dir, false, "%s/sealed", path );
-
-        /* recursively unlock everything underneath
-           that is not itself explicitly locked */
-        if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-            rc = KDirectoryVVisitUpdate ( dir, false, KDBUnlockVisitor, NULL, path, NULL );
-    }
-    return rc;
-
-}
-
-rc_t KDBUnlockFile ( KDirectory *dir, const char *path )
-{
-    rc_t rc;
-
-    if (dir == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcDirectory, rcNull);
-    if (path == NULL)
-        return RC (rcDB, rcLock, rcLocking, rcPath, rcNull);
-
-    rc = KDirectoryRemove ( dir, true, "%s.lock", path );
-    if ( rc == 0 )
-    {
-        rc = KDirectoryVSetAccess ( dir, false, 0220, 0222, path, NULL );
-    }
-    return rc;
-}
-
-
-/* GetObjModDate
- *  extract mod date from a path
- */
-rc_t KDBGetObjModDate ( const KDirectory *dir, KTime_t *mtime )
-{
-    /* HACK ALERT - there needs to be a proper way to record modification times */
-    
-    /* this only tells the last time the table was locked,
-       which may be close to the last time it was modified */
-    rc_t rc = KDirectoryDate ( dir, mtime, "lock" );
-    if ( rc == 0 )
-        return 0;
-
-    if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = KDirectoryDate ( dir, mtime, "sealed" );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    /* get directory timestamp */
-    rc = KDirectoryDate ( dir, mtime, "." );
-    if ( rc == 0 )
-        return 0;
-
-    * mtime = 0;
-    return rc;
-}
-
-/* GetPathModDate
- *  extract mod date from a path
- */
-rc_t KDBVGetPathModDate ( const KDirectory *dir,
-    KTime_t *mtime, const char *path, va_list args )
-{
-    rc_t rc;
-    uint32_t ptype;
-    const KDirectory *obj_dir;
-
-    va_list cpy;
-    va_copy ( cpy, args );
-    ptype = KDirectoryVPathType ( dir, path, cpy );
-    va_end ( cpy );
-
-    switch ( ptype )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        break;
-
-    default:
-        return KDirectoryVDate ( dir, mtime, path, args );
-    }
-
-    * mtime = 0;
-    rc = KDirectoryVOpenDirRead ( dir, & obj_dir, true, path, args );
-    if ( rc == 0 )
-    {
-        rc = KDBGetObjModDate ( obj_dir, mtime );
-        KDirectoryRelease ( obj_dir );
-    }
-
-    return rc;
-}
-
-
-/* KDBVMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBVMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( ns_size > 0 )
-    {
-        subpath += ns_size + 1;
-        subpath_max -= ns_size + 1;
-    }
-
-#if CRUFTY_USE_OF_RESOLVE_PATH
-    /* because this call only builds a path instead of resolving anything
-     * is is okay that we are using the wrong directory */
-    rc = KDirectoryVResolvePath ( dir, false,
-        subpath, subpath_max, path, args );
-#else
-    {
-        int sz = vsnprintf ( subpath, subpath_max, path, args );
-        if ( sz < 0 || ( size_t ) sz >= subpath_max )
-            rc = RC ( rcDB, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        else if ( sz == 0 )
-            rc = RC ( rcDB, rcDirectory, rcResolving, rcPath, rcEmpty );
-        else
-        {
-            rc = 0;
-        }
-    }
-#endif
-    switch ( GetRCState ( rc ) )
-    {
-    case 0:
-        assert ( subpath [ 0 ] != 0 );
-        if ( subpath [ 0 ] == '.' || subpath [ 1 ] == '/' )
-            return RC ( rcDB, rcDirectory, rcResolving, rcPath, rcInvalid );
-        break;
-    case rcInsufficient:
-        return RC ( rcDB, rcDirectory, rcResolving, rcPath, rcExcessive );
-    default:
-        return rc;
-    }
-
-    if ( ns_size != 0 )
-    {
-        subpath -= ns_size + 1;
-        memcpy ( subpath, ns, ns_size );
-        subpath [ ns_size ] = '/';
-    }
-    return 0;
-}
-
-/* KDBMakeSubPath
- *  adds a namespace to path spec
- */
-rc_t KDBMakeSubPath ( struct KDirectory const *dir,
-    char *subpath, size_t subpath_max, const char *ns,
-    uint32_t ns_size, const char *path, ... )
-{
-    rc_t rc = 0;
-    va_list args;
-    va_start(args, path);
-    rc = KDBVMakeSubPath(dir, subpath, subpath_max, ns, ns_size, path, args);
-    va_end(args);
-    return rc;
-}
-
-/* VDrop
- */
-static
-rc_t KDBDropInt ( KDirectory * dir, const KDBManager * mgr,
-                  const char * path )
-{
-    if (KDBManagerOpenObjectBusy (mgr, path))
-        return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcBusy );
-
-    return KDirectoryVRemove ( dir, 1, path, NULL );
-}
-
-rc_t KDBMgrVDrop ( KDirectory * dir, const KDBManager * mgr, uint32_t obj_type,
-                   const char * path, va_list args )
-{
-    rc_t rc;
-    char full_path [ 4096 ];
-
-    rc = KDirectoryVResolvePath ( dir, true, full_path, sizeof (full_path),
-                                  path, args );
-    if (rc == 0)
-    {
-        int pt = KDBPathType ( /*mgr,*/ dir, NULL, full_path );
-        switch ( pt )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcInvalid );
-
-        case kptDatabase | kptAlias:
-        case kptTable | kptAlias:
-        case kptIndex | kptAlias:
-        case kptColumn | kptAlias:
-        case kptDatabase:
-        case kptTable:
-        case kptIndex:
-        case kptColumn:
-            /* this really needs a new rcWrongType or similar RCState */
-            if ((obj_type != kptAny) && (obj_type != (pt & ~kptAlias)))
-                return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcIncorrect );
-            break;
-
-        case kptFile | kptAlias:
-        case kptFile:
-	    /* can we get here?  Will we have needed to open for update to get here? */
-/* 	    rc = KDBOpenPathTypeRead ( dir, path, NULL, type, NULL ); */
-/* 	    if ( rc == 0 ) */
-/*                 return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcReadonly ); */
-            /* fall through */
-        default:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcIncorrect );
-        }
-        if (rc == 0)
-        {
-            rc = KDBDropInt ( dir, mgr, full_path );
-        }
-    }
-    return rc;
-}
-
-
-rc_t KDBVDrop ( KDirectory *dir, const KDBManager * mgr,
-    uint32_t type, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 4096 ];
-
-    int ns_size;
-    const char *ns;
-
-    switch ( type )
-    {
-    case kptDatabase:
-        ns = "db"; ns_size = 2; break;
-    case kptTable:
-        ns = "tbl"; ns_size = 3; break;
-    case kptIndex:
-        ns = "idx"; ns_size = 3; break;
-    case kptColumn:
-        ns = "col"; ns_size = 3; break;
-    default:
-        return RC ( rcDB, rcDirectory, rcRemoving, rcType, rcIncorrect );
-    }
-
-    rc = KDBVMakeSubPath ( dir,
-        path, sizeof path, ns, ns_size, name, args );
-    if ( rc == 0 )
-    {
-        int pt = KDBPathType ( /*mgr,*/ dir, NULL, path );
-        switch ( pt )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcInvalid );
-
-        case kptDatabase | kptAlias:
-        case kptTable | kptAlias:
-        case kptIndex | kptAlias:
-        case kptColumn | kptAlias:
-            pt -= kptAlias;
-
-        case kptDatabase:
-        case kptTable:
-        case kptIndex:
-        case kptColumn:
-            if ( pt == type )
-                break;
-
-        case kptFile | kptAlias:
-        case kptFile:
-	    /* can we get here?  Will we have needed to open for update to get here? */
-	    rc = KDBOpenPathTypeRead ( mgr, dir, path, NULL, type, NULL, false );
-	    if ( rc == 0 )
-                return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcReadonly );
-            /* fall through */
-        default:
-            return RC ( rcDB, rcDirectory, rcRemoving, rcPath, rcIncorrect );
-        }
-
-        rc = KDirectoryVResolvePath ( dir, true, path, sizeof path, path, NULL );
-        if ( rc == 0 )
-        {
-            rc = KDBWritable ( dir, "." );
-            switch (GetRCState(rc))
-            {
-            default:
-                rc = RC ( rcDB, rcDirectory, rcRemoving, rcTable, rcUnexpected );
-                break;
-            case rcLocked:
-                rc = RC ( rcDB, rcDirectory, rcRemoving, rcTable, rcLocked );
-                break;
-            case rcReadonly:
-                rc = RC ( rcDB, rcDirectory, rcRemoving, rcTable, rcReadonly );
-                break;
-            case 0:
-                rc = KDBDropInt ( dir, mgr, path );                
-                break;
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Rename
- */
-rc_t KDBRename ( KDirectory *dir, KDBManager *mgr, uint32_t type, bool force,
-    const char *from, const char *to )
-{
-    rc_t rc;
-    char src [ 4096 ];
-
-    int ns_size;
-    const char *ns;
-
-    switch ( type )
-    {
-    case kptDatabase:
-        ns = "db"; ns_size = 2; break;
-    case kptTable:
-        ns = "tbl"; ns_size = 3; break;
-    case kptIndex:
-        ns = "idx"; ns_size = 3; break;
-    case kptColumn:
-        ns = "col"; ns_size = 3; break;
-    default:
-        return RC ( rcDB, rcDirectory, rcRenaming, rcType, rcIncorrect );
-    }
-
-    rc = KDBMakeSubPath ( dir,
-        src, sizeof src, ns, ns_size, from);
-    if ( rc == 0 )
-    {
-        char dst [ 256 ];
-        int pt = KDBPathType ( /*mgr,*/ dir, NULL, src );
-        switch ( pt )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcInvalid );
-
-        case kptDatabase | kptAlias:
-        case kptTable | kptAlias:
-        case kptIndex | kptAlias:
-        case kptColumn | kptAlias:
-            pt -= kptAlias;
-
-        case kptDatabase:
-        case kptTable:
-        case kptIndex:
-        case kptColumn:
-            if ( pt == type )
-                break;
-
-        default:
-            return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcIncorrect );
-        }
-
-        rc = KDBMakeSubPath ( dir,
-            dst, sizeof dst, ns, ns_size, to );
-        if ( rc == 0 )
-        {
-            if ( KDirectoryVPathType ( dir, dst, NULL ) != kptNotFound )
-                return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcIncorrect );
-
-            rc = KDirectoryVResolvePath ( dir, 1, src, sizeof src, src, NULL );
-            if ( rc == 0 )
-            {
-                if (KDBManagerOpenObjectBusy (mgr, src))
-                    return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcBusy );
-                if (KDBManagerOpenObjectBusy (mgr, dst))
-                    return RC ( rcDB, rcDirectory, rcRenaming, rcPath, rcBusy );
-
-                rc = KDBWritable ( dir, "." );
-                switch (GetRCState(rc))
-                {
-                default:
-                    rc = RC ( rcDB, rcDirectory, rcRenaming, rcTable, rcUnexpected );
-                    break;
-                case rcLocked:
-                    rc = RC ( rcDB, rcDirectory, rcRenaming, rcTable, rcLocked );
-                    break;
-                case rcReadonly:
-                    rc = RC ( rcDB, rcDirectory, rcRenaming, rcTable, rcReadonly );
-                    break;
-                case 0:
-                    rc = KDirectoryRename ( dir, force, src, dst );
-                    break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Alias
- */
-rc_t KDBAlias ( KDirectory *dir, uint32_t type,
-    const char *targ, const char *alias )
-{
-    rc_t rc;
-    char src [ 256 ];
-
-    int ns_size;
-    const char *ns;
-
-    switch ( type )
-    {
-    case kptDatabase:
-        ns = "db"; ns_size = 2; break;
-    case kptTable:
-        ns = "tbl"; ns_size = 3; break;
-    case kptIndex:
-        ns = "idx"; ns_size = 3; break;
-    case kptColumn:
-        ns = "col"; ns_size = 3; break;
-    default:
-        return RC ( rcDB, rcDirectory, rcAliasing, rcType, rcIncorrect );
-    }
-
-    rc = KDBMakeSubPath ( dir,
-        src, sizeof src, ns, ns_size, targ );
-    if ( rc == 0 )
-    {
-        char dst [ 256 ];
-        int pt = KDBPathType ( /*NULL,*/ dir, NULL, src );
-        switch ( pt )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcDirectory, rcAliasing, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcDB, rcDirectory, rcAliasing, rcPath, rcInvalid );
-
-        case kptDatabase | kptAlias:
-        case kptTable | kptAlias:
-        case kptIndex | kptAlias:
-        case kptColumn | kptAlias:
-            pt &= ~ kptAlias;
-
-        case kptDatabase:
-        case kptTable:
-        case kptIndex:
-        case kptColumn:
-            if ( pt == type )
-                break;
-
-        default:
-            return RC ( rcDB, rcDirectory, rcAliasing, rcPath, rcIncorrect );
-        }
-
-        rc = KDBMakeSubPath ( dir,
-            dst, sizeof dst, ns, ns_size, alias );
-        if ( rc == 0 )
-        {
-            rc = KDirectoryCreateAlias ( dir,
-                0775, kcmCreate, src, dst );
-        }
-    }
-
-    return rc;
-}
-
-
-/* KDBIsPathUri
- * A hack to get some of VFS into KDB that is too tightly bound to KFS
- */
-
-bool KDBIsPathUri (const char * path)
-{
-    const char * pc;
-    size_t z;
-
-    z = string_size (path);
-
-    if (NULL != (pc = string_chr (path, z, ':')))
-        return true;
-
-    if (NULL != (pc = string_chr (path, z, '?')))
-        return true;
-
-    if (NULL != (pc = string_chr (path, z, '#')))
-        return true;
-
-    return false;
-}
diff --git a/libs/kdb/wmeta.c b/libs/kdb/wmeta.c
deleted file mode 100644
index 890bf73..0000000
--- a/libs/kdb/wmeta.c
+++ /dev/null
@@ -1,3526 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-struct KMDataNodeNamelist;
-#define KNAMELIST_IMPL struct KMDataNodeNamelist
-
-#include <kdb/extern.h>
-#include "wkdb-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "wtable-priv.h"
-#include "wcolumn-priv.h"
-#include "kdbfmt-priv.h"
-
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <klib/container.h>
-#include <klib/pbstree.h>
-#include <klib/namelist.h>
-#include <klib/impl.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <kfs/md5.h>
-#include <klib/symbol.h>
-#include <klib/refcount.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <atomic.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include <strtol.h>
-
-#ifndef TRACK_REFERENCES
-#define TRACK_REFERENCES 0
-#endif
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#define KMETADATAVERS 2
-#define NODE_SIZE_LIMIT ( 25 * 1024 * 1024 )
-#define NODE_CHILD_LIMIT ( 100 * 1024 )
-
-
-typedef struct KMDataNodeInflateData KMDataNodeInflateData;
-struct KMDataNodeInflateData
-{
-    KMetadata *meta;
-    KMDataNode *par;
-    BSTree *bst;
-    size_t node_size_limit;
-    uint32_t node_child_limit;
-    rc_t rc;
-    bool byteswap;
-};
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-struct KMetadata
-{
-    BSTNode n;
-
-    KDirectory *dir;
-    KDBManager *mgr;
-
-    /* owner */
-    KDatabase *db;
-    KTable *tbl;
-    KColumn *col;
-
-    KMD5SumFmt * md5;
-
-    /* root node */
-    KMDataNode *root;
-
-    KSymbol sym;
-
-    KRefcount refcount;
-    uint32_t opencount;
-    uint32_t vers;
-    uint32_t rev;
-    uint8_t read_only;
-    uint8_t dirty;
-    bool byteswap;
-
-    char path [ 1 ];
-};
-
-static
-KMetadata *KMetadataAttach ( const KMetadata *self );
-
-static
-rc_t KMetadataSever ( const KMetadata *self );
-
-
-/*--------------------------------------------------------------------------
- * KMAttrNode
- */
-typedef struct KMAttrNode KMAttrNode;
-struct KMAttrNode
-{
-    BSTNode n;
-    void *value;
-    size_t vsize;
-    char name [ 1 ];
-};
-
-static
-int CC KMAttrNodeCmp ( const void *item, const BSTNode *n )
-{
-#define a ( ( const char* ) item )
-#define b ( ( const KMAttrNode* ) n )
-
-    return strcmp ( a, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-int CC KMAttrNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KMAttrNode* ) item )
-#define b ( ( const KMAttrNode* ) n )
-
-    return strcmp ( a -> name, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-void CC KMAttrNodeWhack ( BSTNode *n, void *data )
-{
-    free ( n );
-}
-
-static
-bool CC KMAttrNodeInflate ( PBSTNode *n, void *data )
-{
-    KMAttrNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    const char *name = n -> data . addr;
-    size_t size = strlen ( name );
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    /* v2 attributes are more easily allocated
-       as a single (name,value) block because
-       there are no other associated structures */
-    b = malloc ( sizeof * b + n -> data . size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    b -> value = & b -> name [ 1 + size ];
-    b -> vsize = n -> data . size - size - 1;
-    memcpy ( b -> name, name, n -> data . size );
-    BSTreeInsert ( pb -> bst, & b -> n, KMAttrNodeSort );
-    return false;
-}
-
-static
-rc_t KMAttrNodeRename ( const KMAttrNode *self,
-    KMAttrNode **renamed, const char *name )
-{
-    size_t size = strlen ( name );
-    KMAttrNode *b = malloc ( sizeof * b + self -> vsize + size );
-    if ( b == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcMemory, rcExhausted );
-
-    b -> value = & b -> name [ 1 + size ];
-    b -> vsize = self -> vsize;
-    strcpy ( b -> name, name );
-    memcpy ( b -> value, self -> value, self -> vsize );
-    * renamed = b;
-    return 0;
-}
-
-static
-rc_t KMAttrNodeMake ( KMAttrNode **np,
-    const char *name, const void *value, size_t vsize )
-{
-    size_t size = strlen ( name );
-    KMAttrNode *n = malloc ( sizeof * n + vsize + size );
-    if ( n == NULL )
-        return RC ( rcDB, rcNode, rcConstructing, rcMemory, rcExhausted );
-
-    n -> value = & n -> name [ 1 + size ];
-    n -> vsize = vsize;
-    strcpy ( n -> name, name );
-    if ( vsize != 0 )
-        memcpy ( n -> value, value, vsize );
-    * np = n;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- *  a node with an optional value,
- *  optional attributes, and optional children
- *
- *  nodes are identified by path, relative to a starting node,
- *  where "/" serves as a path separator.
- */
-struct KMDataNode
-{
-    BSTNode n;
-    KMDataNode *par;
-    KMetadata *meta;
-    void *value;
-    size_t vsize;
-    BSTree attr;
-    BSTree child;
-    KRefcount refcount;
-    uint8_t read_only;
-    char name [ 1 ];
-};
-
-static
-int CC KMDataNodeCmp ( const void *item, const BSTNode *n )
-{
-#define a ( ( const char* ) item )
-#define b ( ( const KMDataNode* ) n )
-
-    return strcmp ( a, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-int CC KMDataNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const KMDataNode* ) item )
-#define b ( ( const KMDataNode* ) n )
-
-    return strcmp ( a -> name, b -> name );
-
-#undef a
-#undef b
-}
-
-static
-void CC KMDataNodeWhack ( BSTNode *n, void *data )
-{
-    KMDataNode *self = ( KMDataNode* ) n;
-
-    REFMSG ( "KMDataNode", "flush", & self -> refcount );
-
-    self -> meta = NULL;
-    atomic32_inc ( & self -> refcount );
-    KMDataNodeRelease ( self );
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KMDataNodeAddRef ( const KMDataNode *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KMDataNode" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeRelease ( const KMDataNode *cself )
-{
-    KMDataNode *self = ( KMDataNode* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KMDataNode" ) )
-        {
-        case krefOkay:
-            return KMetadataSever ( self -> meta );
-        case krefWhack:
-
-            if ( self -> meta != NULL )
-            {
-                self -> read_only = 0;
-                return KMetadataSever ( self -> meta );
-            }
-
-            KRefcountWhack ( & self -> refcount, "KMDataNode" );
-
-            BSTreeWhack ( & self -> attr, KMAttrNodeWhack, NULL );
-            BSTreeWhack ( & self -> child, KMDataNodeWhack, NULL );
-            free ( self -> value );
-            free ( self );
-            break;
-
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Inflate
- */
-static
-bool CC KMDataNodeInflate_v1 ( PBSTNode *n, void *data )
-{
-    void *value;
-    KMDataNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    /* v1 metadata are flat, with the name
-       stored as a NUL terminated string
-       followed by value payload */
-    const char *name = n -> data . addr;
-    size_t size = strlen ( name );
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    b = malloc ( sizeof * b + size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-     
-    b -> par = pb -> par;
-    b -> meta = pb -> meta;
-    b -> value = ( void* ) ( name + size + 1 );
-    b -> vsize = n -> data . size - size - 1;
-    BSTreeInit ( & b -> attr );
-    BSTreeInit ( & b -> child );
-    KRefcountInit ( & b -> refcount, 0, "KMDataNode", "inflate", name );
-    b -> read_only = 0;
-    strcpy ( b -> name, name );
-     
-    /* a name with no associated value */
-    if ( b -> vsize == 0 )
-    {
-        b -> value = NULL;
-        BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-        return false;
-    }
-
-    /* allocate value because v2+ code expects this */
-    value = malloc ( b -> vsize );
-    if ( value != NULL )
-    {
-        memcpy ( value, b -> value, b -> vsize );
-        b -> value = value;
-        BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-        return false;
-    }
-
-    pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-    free ( b );
-    return true;
-}
-
-static
-rc_t KMDataNodeInflateAttr ( KMDataNode *n, bool byteswap )
-{
-    PBSTree *bst;
-    rc_t rc = PBSTreeMake ( & bst, n -> value, n -> vsize, byteswap );
-    if ( rc != 0 )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-    else
-    {
-        KMDataNodeInflateData pb;
-        size_t bst_size = PBSTreeSize ( bst );
-        
-        pb . meta = n -> meta;
-        pb . par = n;
-        pb . bst = & n -> attr;
-        pb . node_size_limit = 0;
-        pb . node_child_limit = 0;
-        pb . rc = 0;
-        pb . byteswap = byteswap;
-        PBSTreeDoUntil ( bst, 0, KMAttrNodeInflate, & pb );
-        rc = pb . rc;
-        
-        PBSTreeWhack ( bst );
-        
-        n -> value = ( char* ) n -> value + bst_size;
-        n -> vsize -= bst_size;
-    }
-    return rc;
-}
-
-static
-bool CC KMDataNodeInflate ( PBSTNode *n, void *data );
-
-static
-rc_t KMDataNodeInflateChild ( KMDataNode *n,
-    size_t node_size_limit, uint32_t node_child_limit, bool byteswap )
-{
-    PBSTree *bst;
-    rc_t rc = PBSTreeMake ( & bst, n -> value, n -> vsize, byteswap );
-    if ( rc != 0 )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-    else
-    {
-        uint32_t bst_count = PBSTreeCount ( bst );
-        size_t bst_size = PBSTreeSize ( bst );
-        bool inflate = node_child_limit == 0;
-        if ( ! inflate ) {
-            if ( bst_count > node_child_limit )
-            {
-                PLOGMSG ( klogWarn, ( klogWarn,
-                                      "refusing to inflate metadata node '$(node)' "
-                                      "within file '$(path)': "
-                                      "number of children ($(num_children)) "
-                                      "exceeds limit ($(limit))."
-                                      , "node=%s,path=%s,num_children=%u,limit=%u"
-                                      , n -> name
-                                      , n -> meta -> path
-                                      , bst_count
-                                      , node_child_limit )
-                    );
-            }
-            else if ( bst_size > node_size_limit )
-            {
-                PLOGMSG ( klogWarn, ( klogWarn,
-                                      "refusing to inflate metadata node '$(node)' "
-                                      "within file '$(path)': "
-                                      "node size ($(node_size)) exceeds limit ($(limit))."
-                                     , "node=%s,path=%s,node_size=%zu,limit=%zu"
-                                     , n -> name
-                                     , n -> meta -> path
-                                     , bst_size
-                                     , node_size_limit )
-                    );
-            }
-            else {
-                inflate = true;
-            }
-        }
-
-        if ( inflate ) {
-            KMDataNodeInflateData pb;
-
-            pb . meta = n -> meta;
-            pb . par = n;        
-            pb . bst = & n -> child;
-            pb . node_size_limit = node_size_limit;
-            pb . node_child_limit = node_child_limit;
-            pb . rc = 0;
-            pb . byteswap = byteswap;
-            PBSTreeDoUntil ( bst, 0, KMDataNodeInflate, & pb );
-            rc = pb . rc;
-        }
-        
-        PBSTreeWhack ( bst );
-        
-        n -> value = ( char* ) n -> value + bst_size;
-        n -> vsize -= bst_size;
-    }
-    return rc;
-}
-
-static
-bool CC KMDataNodeInflate ( PBSTNode *n, void *data )
-{
-    KMDataNode *b;
-    KMDataNodeInflateData *pb = data;
-
-    /* v2 names are preceded by a decremented length byte
-       that has its upper two bits dedicated to
-       signaling existence of attributes & children */
-    const char *name = n -> data . addr;
-    int bits = * ( ( const uint8_t* ) name ++ );
-    size_t size = ( bits >> 2 ) + 1;
-    if ( size >= n -> data . size )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-        return true;
-    }
-
-    b = malloc ( sizeof * b + size );
-    if ( b == NULL )
-    {
-        pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    b -> par = pb -> par;
-    b -> meta = pb -> meta;
-    b -> value = ( void* ) ( name + size );
-    b -> vsize = n -> data . size - size - 1;
-    BSTreeInit ( & b -> attr );
-    BSTreeInit ( & b -> child );
-    KRefcountInit ( & b -> refcount, 0, "KMDataNode", "inflate", b -> name );
-    b -> read_only = 0;
-    memcpy ( b -> name, name, size );
-    b -> name [ size ] = 0;
-
-    pb -> rc = ( bits & 1 ) != 0 ? KMDataNodeInflateAttr ( b, pb -> byteswap ) : 0;
-    if ( pb -> rc == 0 )
-    {
-        pb -> rc = ( bits & 2 ) != 0 ?
-            KMDataNodeInflateChild ( b, pb -> node_size_limit, pb -> node_child_limit, pb -> byteswap ) : 0;
-        if ( pb -> rc == 0 )
-        {
-            void *value;
-
-            if ( b -> vsize == 0 )
-            {
-                b -> value = NULL;
-                BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-                return false;
-            }
-
-            value = malloc ( b -> vsize );
-            if ( value != NULL )
-            {
-                memcpy ( value, b -> value, b -> vsize );
-                b -> value = value;
-                BSTreeInsert ( pb -> bst, & b -> n, KMDataNodeSort );
-                return false;
-            }
-            pb -> rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-
-            BSTreeWhack ( & b -> child, KMDataNodeWhack, NULL );
-        }
-
-        BSTreeWhack ( & b -> attr, KMAttrNodeWhack, NULL );
-    }
-
-    free ( b );
-    return true;
-}
-
-
-/* Find
- */
-static
-rc_t KMDataNodeFind ( const KMDataNode *cself, KMDataNode **np, char **path )
-{
-    KMDataNode *found, *self= ( KMDataNode* ) cself;
-
-    char *end, *name = * path;
-
-    /* interpret leading '/' */
-    if ( name [ 0 ] == '/' )
-    {
-        while ( self -> par != NULL )
-            self = self -> par;
-        ++ name;
-    }
-
-    /* find node */
-    for ( found = self; name != NULL; self = found, name = end )
-    {
-        /* segment path */
-        end = strchr ( name, '/' );
-        if ( end != NULL )
-            * end ++ = 0;
-
-        /* interpret special paths */
-        switch ( name [ 0 ] )
-        {
-        case 0:
-            continue;
-        case '.':
-            switch ( name [ 1 ] )
-            {
-            case 0:
-                continue;
-            case '.':
-                if ( name [ 2 ] == 0 )
-                {
-                    /* this is a backup */
-                    if ( ( self = self -> par ) == NULL )
-                    {
-                        * np = NULL;
-                        return RC ( rcDB, rcMetadata, rcSelecting, rcPath, rcInvalid );
-                    }
-                    continue;
-                }
-                break;
-            }
-            break;
-        }
-
-        /* find actual path */
-        found = ( KMDataNode* ) BSTreeFind ( & self -> child, name, KMDataNodeCmp );
-        if ( found == NULL )
-        {
-            /* not found also gets partially found state */
-            if ( end != NULL )
-                end [ -1 ] = '/';
-            * path = name;
-            * np = self;
-            return RC ( rcDB, rcMetadata, rcSelecting, rcPath, rcNotFound );
-        }
-    }
-
-    /* the current self is our guy */
-    * np = self;
-    return 0;
-}
-
-/* Make
- */
-static
-rc_t KMDataNodeMake ( KMDataNode *self, KMDataNode **np, char *name )
-{
-    rc_t rc;
-    char *end;
-
-    /* create nodes */
-    for ( ; name != NULL; name = end )
-    {
-        BSTNode *x;
-        size_t size;
-        KMDataNode *n;
-
-        /* segment path */
-        end = strchr ( name, '/' );
-        if ( end != NULL )
-            * end ++ = 0;
-
-        /* interpret special paths */
-        switch ( name [ 0 ] )
-        {
-        case 0:
-            continue;
-        case '.':
-            switch ( name [ 1 ] )
-            {
-            case 0:
-                continue;
-            case '.':
-                if ( name [ 2 ] == 0 )
-                {
-                    /* this is a backup */
-                    if ( ( self = self -> par ) == NULL )
-                        return RC ( rcDB, rcMetadata, rcInserting, rcPath, rcInvalid );
-                    continue;
-                }
-                break;
-            }
-            break;
-        case '*':
-            if ( name [ 1 ] == 0 )
-                return RC ( rcDB, rcMetadata, rcInserting, rcPath, rcInvalid );
-        }
-
-        /* we use 2 bits of a size byte to indicate
-           whether a node has attributes and/or children,
-           so limit the node leaf name size to 6 bits.
-           since empty names are not allowed, subtract
-           one from length to give range 0..64 => 1..64 */
-        size = strlen ( name );
-        if ( size > ( 0x3F + 1 ) )
-            return RC ( rcDB, rcMetadata, rcInserting, rcPath, rcExcessive );
-
-        n = malloc ( sizeof * n + size );
-        if ( n == NULL )
-            return RC ( rcDB, rcMetadata, rcInserting, rcMemory, rcExhausted );
-        n -> par = self;
-        n -> meta = self -> meta;
-        n -> value = NULL;
-        n -> vsize = 0;
-        BSTreeInit ( & n -> attr );
-        BSTreeInit ( & n -> child );
-        KRefcountInit ( & n -> refcount, 0, "KMDataNode", "make", n -> name );
-        n -> read_only = 0;
-        strcpy ( n -> name, name );
-
-        /* insert */
-        rc = BSTreeInsertUnique ( & self -> child,
-            & n -> n, & x, KMDataNodeSort );
-        if ( rc != 0 )
-        {
-            free ( n );
-            n = ( KMDataNode* ) x;
-        }
-
-        /* transition */
-        self = n;
-    }
-
-    /* the current self is our guy */
-    * np = self;
-    return 0;
-}
-
-
-/* OpenNodeRead
- * VOpenNodeRead
- *  opens a metadata node
- *
- *  "node" [ OUT ] - return parameter for indicated metadata node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within metadata hierarchy. when NULL, empty, ".", or "/",
- *  return root node in "node". path separator is "/".
- */
-LIB_EXPORT rc_t CC KMetadataOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMetadataVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataVOpenNodeRead ( const KMetadata *self,
-    const KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc = 0;
-
-    if ( node == NULL )
-        rc = RC ( rcDB, rcMetadata, rcOpening, rcParam, rcNull );
-    else if ( self == NULL )
-    {
-        * node = NULL;
-        rc = RC ( rcDB, rcMetadata, rcOpening, rcSelf, rcNull );
-    }
-    else
-        rc = KMDataNodeVOpenNodeRead ( self -> root, node, path, args );
-
-    DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-            ("KMetadataVOpenNodeRead(%s) = %d\n", path, rc));
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMDataNodeVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeVOpenNodeRead ( const KMDataNode *self,
-    const KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-    KMDataNode *found;
-    char full [ 4096 ], *p = full;
-
-    if ( node == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcParam, rcNull );
-
-    * node = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcSelf, rcNull );
-
-    /* handle special NULL path */
-    if ( path == NULL )
-        full [ 0 ] = 0;
-    else
-    {
-        int len;
-
-        /* generate full path */
-        if ( args == NULL )
-            len = snprintf ( full, sizeof full, "%s", path );
-        else
-            len = vsnprintf ( full, sizeof full, path, args );
-        if ( len < 0 || len >= sizeof full )
-            return RC ( rcDB, rcNode, rcOpening, rcPath, rcExcessive );
-    }
-    
-    rc = KMDataNodeFind ( self, & found, & p );
-    if ( rc == 0 )
-    {
-        /* check if the node is not open */
-        if ( atomic32_read ( & found -> refcount ) == 0 )
-        {
-            /* mark as read-only, since we're the first to open */
-            found -> read_only = 1;
-        }
-        /* disallow open if already open for write */
-        else if ( ! found -> read_only )
-        {
-            return RC ( rcDB, rcNode, rcOpening, rcNode, rcBusy );
-        }
-
-        KMetadataAttach ( found -> meta );
-        KMDataNodeAddRef ( found );
-        * node = found;
-    }
-
-    DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-            ("KMDataNodeVOpenNodeRead(%s) = %d\n", full, rc));
-
-    return rc;
-}
-
-
-/* OpenNodeUpdate
- * VOpenNodeUpdate
- *  opens a metadata node
- *
- *  "node" [ OUT ] - return parameter for indicated metadata node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within metadata hierarchy. when NULL, empty, ".", or "/",
- *  return root node in "node". path separator is "/".
- */
-LIB_EXPORT rc_t CC KMetadataOpenNodeUpdate ( KMetadata *self,
-    KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMetadataVOpenNodeUpdate ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataVOpenNodeUpdate ( KMetadata *self,
-    KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( node == NULL )
-        rc = RC ( rcDB, rcMetadata, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcMetadata, rcOpening, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcDB, rcMetadata, rcOpening, rcNode, rcReadonly );
-        else {
-            rc = KMDataNodeVOpenNodeUpdate ( self -> root, node, path, args );
-            DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-                        ("KMetadataVOpenNodeUpdate(%s) = %d\n", path, rc));
-            return rc;
-        }
-
-        * node = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeOpenNodeUpdate ( KMDataNode *self,
-    KMDataNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMDataNodeVOpenNodeUpdate ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeVOpenNodeUpdate ( KMDataNode *self,
-    KMDataNode **node, const char *path, va_list args )
-{
-    rc_t rc = 0;
-    KMDataNode *found;
-    char full [ 4096 ], *p = full;
-
-    if ( node == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcParam, rcNull );
-
-    * node = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcOpening, rcSelf, rcNull );
-
-    /* handle special NULL path */
-    if ( path == NULL )
-        full [ 0 ] = 0;
-    else
-    {
-        int len;
-
-        /* generate full path */
-        if ( args == NULL )
-            len = snprintf ( full, sizeof full, "%s", path );
-        else
-            len = vsnprintf ( full, sizeof full, path, args );
-        if ( len < 0 || len >= sizeof full )
-            return RC ( rcDB, rcNode, rcOpening, rcPath, rcExcessive );
-    }
-
-    /* don't allow update when open for read */
-    if ( self -> read_only ) {
-        rc = RC ( rcDB, rcNode, rcOpening, rcNode, rcReadonly );
-        DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-                    ("KMDataNodeVOpenNodeUpdate(%s) = %d\n", full, rc));
-        return rc;
-    }
-
-    /* find an existing one */
-    rc = KMDataNodeFind ( self, & found, & p );
-    if ( rc == 0 )
-    {
-        if ( atomic32_read ( & found -> refcount ) != 0 )
-            return RC ( rcDB, rcNode, rcOpening, rcNode, rcBusy );
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = KMDataNodeMake ( found, & found, p );
-        if ( rc != 0 )
-            return rc;
-    }
-    else
-    {
-        return rc;
-    }
-
-    KMetadataAttach ( found -> meta );
-    KMDataNodeAddRef ( found );
-    found -> read_only = false;
-    * node = found;
-
-    DBGMSG(DBG_KDB, DBG_FLAG(DBG_KDB_KDB),
-                ("KMDataNodeVOpenNodeUpdate(%s) = %d\n", full, rc));
-
-    return rc;
-}
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KMDataNodeByteOrder ( const KMDataNode *self, bool *reversed )
-{
-    if ( self != NULL )
-        return KMetadataByteOrder ( self -> meta, reversed );
-
-    if ( reversed == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    * reversed = false;
-    return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* Read
- *  read a node value or attribute
- *
- *  "offset" [ IN ] - initial offset into metadata
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read.
- *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
- */
-LIB_EXPORT rc_t CC KMDataNodeRead ( const KMDataNode *self,
-    size_t offset, void *buffer, size_t bsize,
-    size_t *num_read, size_t *remaining )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( remaining == NULL )
-        remaining = & dummy;
-
-    if ( num_read == NULL )
-        rc = RC ( rcDB, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcNode, rcReading, rcSelf, rcNull );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcDB, rcNode, rcReading, rcBuffer, rcNull );
-        else
-        {
-            size_t to_read, avail = self -> vsize;
-            if ( offset > avail )
-                offset = avail;
-
-            to_read = avail -= offset;
-            if ( to_read > bsize )
-                to_read = bsize;
-
-            if ( to_read > 0 )
-                memcpy ( buffer, ( const char* ) self -> value + offset, to_read );
-
-            * num_read = to_read;
-            * remaining = avail - to_read;
-
-            return 0;
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-    return rc;
-}
-
-
-/* Addr - PRIVATE
- *  reach into node and get address
- *  returns raw pointer and node size
- */
-LIB_EXPORT rc_t CC KMDataNodeAddr ( const KMDataNode *self,
-    const void **addr, size_t *size )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( size == NULL )
-        size = & dummy;
-
-    if ( addr == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcSelf, rcNull );
-        else
-        {
-            * addr = self -> value;
-            * size = self -> vsize;
-
-            return 0;
-        }
-
-        * addr = NULL;
-    }
-
-    * size = 0;
-    return rc;
-}
-
-
-/* Write
- *  write a node value or attribute
- *  overwrites anything already there
- *
- *  "buffer" [ IN ] and "size" [ IN ] - new value data
- */
-LIB_EXPORT rc_t CC KMDataNodeWrite ( KMDataNode *self, const void *buffer, size_t size )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcMetadata, rcNull );
-    if ( buffer == NULL && size != 0 )
-        return RC ( rcDB, rcNode, rcWriting, rcBuffer, rcNull );
-
-    /* don't allow update when open for read or root node */
-    if ( self -> read_only || self -> par == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcNode, rcReadonly );
-
-    if ( size == self -> vsize )
-    {
-        if ( size == 0 )
-            return 0;
-
-        memcpy ( self -> value, buffer, size );
-    }
-    else
-    {
-        void *value;
-
-        if ( buffer == NULL || size == 0 )
-        {
-            value = NULL;
-            size = 0;
-        }
-        else
-        {
-            value = malloc ( size );
-            if ( value == NULL )
-                return RC ( rcDB, rcNode, rcWriting, rcMemory, rcExhausted );
-            memcpy ( value, buffer, size );
-        }
-            
-        if ( self -> value != NULL )
-            free ( self -> value );
-
-        self -> value = value;
-        self -> vsize = size;
-    }
-    
-    self -> meta -> dirty = true;
-
-    return 0;
-}
-
-
-/* Append
- *  append data to value
- *
- *  "buffer" [ IN ] and "size" [ IN ] - value data to be appended
- */
-LIB_EXPORT rc_t CC KMDataNodeAppend ( KMDataNode *self, const void *buffer, size_t size )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcMetadata, rcNull );
-    if ( buffer == NULL && size != 0 )
-        return RC ( rcDB, rcNode, rcWriting, rcBuffer, rcNull );
-
-    /* don't allow update when open for read or root node */
-    if ( self -> read_only || self -> par == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcNode, rcReadonly );
-
-    if ( size != 0 )
-    {
-        void *value = realloc ( self -> value, self -> vsize + size );
-        if ( value == NULL )
-            return RC ( rcDB, rcNode, rcWriting, rcMemory, rcExhausted );
-        memcpy ( ( char* ) value + self -> vsize, buffer, size );
-        self -> value = value;
-        self -> vsize += size;
-        self -> meta -> dirty = true;
-    }
-    return 0;
-}
-
-
-/* Read ( formatted )
- *  reads as integer or float value in native byte order
- *
- *  "bXX" [ OUT ] - return parameter for numeric value
- */
-LIB_EXPORT rc_t CC KMDataNodeReadB8 ( const KMDataNode *self, void *b8 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b8, 1,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 1 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB16 ( const KMDataNode *self, void *b16 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b16, 2,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 2 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint16_t* ) b16 = bswap_16 ( * ( const uint16_t* ) b16 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB32 ( const KMDataNode *self, void *b32 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b32, 4,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 4 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint32_t* ) b32 = bswap_32 ( * ( const uint32_t* ) b32 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB64 ( const KMDataNode *self, void *b64 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b64, 8,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 8 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-            * ( uint64_t* ) b64 = bswap_64 ( * ( const uint64_t* ) b64 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadB128 ( const KMDataNode *self, void *b128 )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, b128, 16,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-        if ( num_read < 16 )
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-
-        if ( self -> meta -> byteswap )
-        {
-            uint64_t *b64 = b128;
-            uint64_t tmp = bswap_64 ( b64 [ 0 ] );
-            b64 [ 0 ] = bswap_64 ( b64 [ 1 ] );
-            b64 [ 1 ] = tmp;
-        }
-    }
-    return rc;
-}
-
-
-/* ReadAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAsI16 ( const KMDataNode *self, int16_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU16 ( const KMDataNode *self, uint16_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsI32 ( const KMDataNode *self, int32_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( ( ( const int16_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int16_t* ) i ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * i = bswap_32 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU32 ( const KMDataNode *self, uint32_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( ( ( const uint16_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint16_t* ) u ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * u = bswap_32 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsI64 ( const KMDataNode *self, int64_t *i )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, i, sizeof * i,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * i = ( ( const int8_t* ) i ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * i = bswap_16 ( ( ( const int16_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int16_t* ) i ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * i = bswap_32 ( ( ( const int32_t* ) i ) [ 0 ] );
-            else
-                * i = ( ( const int32_t* ) i ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * i = bswap_64 ( * i );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsU64 ( const KMDataNode *self, uint64_t *u )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, u, sizeof * u,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 1:
-            * u = ( ( const uint8_t* ) u ) [ 0 ];
-            break;
-        case 2:
-            if ( self -> meta -> byteswap )
-                * u = bswap_16 ( ( ( const uint16_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint16_t* ) u ) [ 0 ];
-            break;
-        case 4:
-            if ( self -> meta -> byteswap )
-                * u = bswap_32 ( ( ( const uint32_t* ) u ) [ 0 ] );
-            else
-                * u = ( ( const uint32_t* ) u ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * u = bswap_64 ( * u );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAsF64 ( const KMDataNode *self, double *f )
-{
-    size_t num_read, remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, f, sizeof * f,
-        & num_read, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-            return RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-
-        switch ( num_read )
-        {
-        case 4:
-            if ( self -> meta -> byteswap )
-                * ( uint32_t* ) f = bswap_32 ( * ( const uint32_t* ) f );
-            * f = ( ( const float* ) f ) [ 0 ];
-            break;
-        case 8:
-            if ( self -> meta -> byteswap )
-                * ( uint64_t* ) f = bswap_64 ( * ( const uint64_t* ) f );
-            break;
-        default:
-            return RC ( rcDB, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-        }
-    }
-    return rc;
-}
-
-
-/* Read ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-LIB_EXPORT rc_t CC KMDataNodeReadCString ( const KMDataNode *self,
-    char *buffer, size_t bsize, size_t *size )
-{
-    size_t remaining;
-    rc_t rc = KMDataNodeRead ( self, 0, buffer, bsize - 1, size, & remaining );
-    if ( rc == 0 )
-    {
-        if ( remaining != 0 )
-        {
-            * size += remaining;
-            return RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcInsufficient );
-        }
-
-        buffer [ * size ] = 0;
-    }
-    return rc;
-}
-
-
-/* Write ( formatted )
- *  writes integer or float value in metadata byte order
- *
- *  "bXX" [ IN ] - numeric value
- *
- * NB - we do not currently ( and maybe never ) support
- *  writing in non-native byte-order.
- */
-LIB_EXPORT rc_t CC KMDataNodeWriteB8 ( KMDataNode *self, const void *b8 )
-{
-    return KMDataNodeWrite ( self, b8, 1 );
-}
-
-LIB_EXPORT rc_t CC KMDataNodeWriteB16 ( KMDataNode *self, const void *b16 )
-{
-    return KMDataNodeWrite ( self, b16, 2 );
-}
-
-LIB_EXPORT rc_t CC KMDataNodeWriteB32 ( KMDataNode *self, const void *b32 )
-{
-    return KMDataNodeWrite ( self, b32, 4 );
-}
-
-LIB_EXPORT rc_t CC KMDataNodeWriteB64 ( KMDataNode *self, const void *b64 )
-{
-    return KMDataNodeWrite ( self, b64, 8 );
-}
-
-LIB_EXPORT rc_t CC KMDataNodeWriteB128 ( KMDataNode *self, const void *b128 )
-{
-    return KMDataNodeWrite ( self, b128, 16 );
-}
-
-
-/* Write ( formatted )
- *  writes C-string
- *
- *  "str" [ IN ] - NUL terminated string.
- */
-LIB_EXPORT rc_t CC KMDataNodeWriteCString ( KMDataNode *self, const char *str )
-{
-    if ( str != NULL )
-        return KMDataNodeWrite ( self, str, strlen ( str ) );
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcSelf, rcNull );
-
-    return RC ( rcDB, rcNode, rcWriting, rcString, rcNull );
-}
-
-
-/* ReadAttr
- *  reads as NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAttr ( const KMDataNode *self, const char *name,
-    char *buffer, size_t bsize, size_t *size )
-{
-    rc_t rc;
-
-    if ( size == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcString, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcString, rcEmpty );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcNull );
-        else
-        {
-            const KMAttrNode *n = ( const KMAttrNode* )
-                BSTreeFind ( & self -> attr, name, KMAttrNodeCmp );
-            if ( n == NULL )
-            {
-                * size = 0;
-                if ( bsize != 0 )
-                    buffer [ 0 ] = 0;
-                rc = RC ( rcDB, rcMetadata, rcReading, rcAttr, rcNotFound );
-            }
-            else
-            {
-                * size = n -> vsize;
-                if ( n -> vsize < bsize )
-                {
-                    memcpy ( buffer, n -> value, n -> vsize );
-                    buffer [ n -> vsize ] = 0;
-                    return 0;
-                }
-
-                return RC ( rcDB, rcMetadata, rcReading, rcBuffer, rcInsufficient );
-            }
-        }
-
-        * size = 0;
-    }
-
-    return rc;
-}
-
-
-/* WriteAttr
- *  writes NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "value" [ IN ] - NUL terminated attribute value
- */
-LIB_EXPORT rc_t CC KMDataNodeWriteAttr ( KMDataNode *self,
-    const char *name, const char *value )
-{
-    rc_t rc;
-    size_t size;
-    KMAttrNode *n;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcMetadata, rcNull );
-    if ( name == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcPath, rcNull );
-    if ( name [ 0 ] == 0 )
-        return RC ( rcDB, rcNode, rcWriting, rcPath, rcInvalid );
-
-    /* don't allow update when open for read or root node */
-    if ( self -> read_only || self -> par == NULL )
-        return RC ( rcDB, rcNode, rcWriting, rcNode, rcReadonly );
-
-    size = ( value == NULL ) ? 0 : strlen ( value );
-    rc = KMAttrNodeMake ( & n, name, value, size );
-    if ( rc == 0 )
-    {
-        BSTNode *x;
-        if ( BSTreeInsertUnique ( & self -> attr,
-             & n -> n, & x, KMAttrNodeSort ) != 0 )
-        {
-            BSTreeUnlink ( & self -> attr, x );
-            KMAttrNodeWhack ( x, NULL );
-            BSTreeInsert ( & self -> attr, & n -> n, KMAttrNodeSort );
-        }
-
-        self -> meta -> dirty = true;
-    }
-    return rc;
-}
-
-
-/* ReadAttrAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI16 ( const KMDataNode *self, const char *attr, int16_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            long val = strtol ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val < -32768 || val > 32767 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * i = ( int16_t ) val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU16 ( const KMDataNode *self, const char *attr, uint16_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            unsigned long val = strtoul ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val > 0xFFFF )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * u = ( uint16_t ) val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI32 ( const KMDataNode *self, const char *attr, int32_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            long val = strtol ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val < (-2147483647 - 1) || val > 2147483647 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * i = ( int32_t ) val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU32 ( const KMDataNode *self, const char *attr, uint32_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            unsigned long val = strtoul ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else if ( val > 0xFFFFFFFF )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcRange, rcExcessive );
-            else
-            {
-                * u = ( uint32_t ) val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsI64 ( const KMDataNode *self, const char *attr, int64_t *i )
-{
-    rc_t rc;
-    if ( i == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            int64_t val =  strtoi64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * i = val;
-                return 0;
-            }
-        }
-
-        * i = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsU64 ( const KMDataNode *self, const char *attr, uint64_t *u )
-{
-    rc_t rc;
-    if ( u == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            uint64_t val =  strtou64 ( buffer, & end, 0 );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * u = val;
-                return 0;
-            }
-        }
-
-        * u = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeReadAttrAsF64 ( const KMDataNode *self, const char *attr, double *f )
-{
-    rc_t rc;
-    if ( f == NULL )
-        rc = RC ( rcDB, rcMetadata, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t size;
-        char buffer [ 256 ];
-        rc = KMDataNodeReadAttr ( self, attr, buffer, sizeof buffer, & size );
-        if ( rc == 0 )
-        {
-            char *end;
-            double val = strtod ( buffer, & end );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcDB, rcMetadata, rcReading, rcNode, rcIncorrect );
-            else
-            {
-                * f = val;
-                return 0;
-            }
-        }
-
-        * f = 0.0;
-    }
-    return rc;
-}
-
-
-/* Drop
- * VDrop
- *  drop some or all node content
- */
-LIB_EXPORT rc_t CC KMDataNodeDropAll ( KMDataNode *self )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcClearing, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcClearing, rcMetadata, rcNull );
-    if ( self -> read_only )
-        return RC ( rcDB, rcNode, rcClearing, rcNode, rcReadonly );
-
-    BSTreeWhack ( & self -> attr, KMAttrNodeWhack, NULL );
-    BSTreeInit ( & self -> attr );
-
-    BSTreeWhack ( & self -> child, KMDataNodeWhack, NULL );
-    BSTreeInit ( & self -> child );
-
-    free ( self -> value );
-    self -> value = NULL;
-    self -> vsize = 0;
-    self -> meta -> dirty = true;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeDropAttr ( KMDataNode *self, const char *attr )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcMetadata, rcNull );
-    if ( attr == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcPath, rcNull );
-    if ( attr [ 0 ] == 0 )
-        return RC ( rcDB, rcNode, rcUpdating, rcPath, rcInvalid );
-    if ( self -> read_only )
-        return RC ( rcDB, rcNode, rcUpdating, rcNode, rcReadonly );
-
-    /* recognize wildcard */
-    if ( attr [ 0 ] == '*' && attr [ 1 ] == 0 )
-    {
-        BSTreeWhack ( & self -> attr, KMAttrNodeWhack, NULL );
-        BSTreeInit ( & self -> attr );
-    }
-    else
-    {
-        KMAttrNode *found = ( KMAttrNode* )
-            BSTreeFind ( & self -> attr, attr, KMAttrNodeCmp );
-        if ( found == NULL )
-            return RC ( rcDB, rcNode, rcUpdating, rcAttr, rcNotFound );
-
-        BSTreeUnlink ( & self -> attr, & found -> n );
-        KMAttrNodeWhack ( & found -> n, NULL );
-    }
-
-    self -> meta -> dirty = true;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeDropChild ( KMDataNode *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KMDataNodeVDropChild ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeVDropChild ( KMDataNode *self, const char *path, va_list args )
-{
-    int len;
-    rc_t rc;
-    KMDataNode *found;
-    char full [ 4096 ], *p = full;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcMetadata, rcNull );
-    if ( path == NULL )
-        return RC ( rcDB, rcNode, rcUpdating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcDB, rcNode, rcUpdating, rcPath, rcInvalid );
-
-    /* generate full path */
-    if ( args == NULL )
-        len = snprintf ( full, sizeof full, "%s", path );
-    else
-        len = vsnprintf ( full, sizeof full, path, args );
-    if ( len < 0 || len >= sizeof full )
-        return RC ( rcDB, rcNode, rcUpdating, rcPath, rcExcessive );
-
-    /* don't allow update when open for read */
-    if ( self -> read_only )
-        return RC ( rcDB, rcNode, rcUpdating, rcNode, rcReadonly );
-
-    rc = KMDataNodeFind ( self, & found, & p );
-    if ( GetRCState ( rc ) == rcNotFound )
-    {
-        if ( p [ 0 ] != '*' || p [ 1 ] != 0 )
-            return rc;
-
-        BSTreeWhack ( & found -> child, KMDataNodeWhack, NULL );
-        BSTreeInit ( & found -> child );
-    }
-    else
-    {
-        BSTreeUnlink ( & self -> child, & found -> n );
-        KMDataNodeWhack ( & found -> n, NULL );
-    }
-
-    self -> meta -> dirty = true;
-
-    return 0;
-}
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving simple name of existing attr
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new simple attr name
- */
-LIB_EXPORT rc_t CC KMDataNodeRenameAttr ( KMDataNode *self, const char *from, const char *to )
-{
-    rc_t rc;
-    KMAttrNode *found, *renamed;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcMetadata, rcNull );
-    if ( from == NULL || to == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcPath, rcNull );
-    if ( from [ 0 ] == 0 || to [ 0 ] == 0 )
-        return RC ( rcDB, rcNode, rcRenaming, rcPath, rcInvalid );
-    if ( self -> read_only )
-        return RC ( rcDB, rcNode, rcRenaming, rcNode, rcReadonly );
-
-    found = ( KMAttrNode* )
-        BSTreeFind ( & self -> attr, from, KMAttrNodeCmp );
-    if ( found == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcAttr, rcNotFound );
-
-    rc = KMAttrNodeRename ( found, & renamed, to );
-    if ( rc == 0 )
-    {
-        BSTNode *x;
-        rc = BSTreeInsertUnique ( & self -> attr,
-            & renamed -> n, & x, KMAttrNodeSort );
-        if ( rc != 0 )
-        {
-            KMAttrNodeWhack ( & renamed -> n, NULL );
-            if ( x == & found -> n )
-                return 0;
-            return RC ( rcDB, rcNode, rcRenaming, rcAttr, rcExists );
-        }
-
-        BSTreeUnlink ( & self -> attr, & found -> n );
-        KMAttrNodeWhack ( & found -> n, NULL );
-        self -> meta -> dirty = true;
-    }
-
-    return rc;
-}
-
-static
-void CC KMDataNodeRelinkParent ( BSTNode *n, void *data )
-{
-    ( ( KMDataNode* ) n ) -> par = data;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeRenameChild ( KMDataNode *self, const char *from, const char *to )
-{
-    int len;
-    rc_t rc;
-    KMDataNode *found;
-    char full [ 4096 ], *p = full;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcSelf, rcNull );
-    if ( self -> meta == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcMetadata, rcNull );
-    if ( from == NULL || to == NULL )
-        return RC ( rcDB, rcNode, rcRenaming, rcPath, rcNull );
-    if ( from [ 0 ] == 0 || to [ 0 ] == 0 )
-        return RC ( rcDB, rcNode, rcRenaming, rcPath, rcInvalid );
-    if ( self -> read_only )
-        return RC ( rcDB, rcNode, rcRenaming, rcNode, rcReadonly );
-
-    /* generate full path */
-    len = snprintf ( full, sizeof full, "%s", from );
-    if ( len < 0 || len >= sizeof full )
-        return RC ( rcDB, rcNode, rcRenaming, rcPath, rcExcessive );
-
-    rc = KMDataNodeFind ( self, & found, & p );
-    if ( rc == 0 )
-    {
-        KMDataNode *renamed;
-
-        if ( atomic32_read ( & found -> refcount ) != 0 )
-            return RC ( rcDB, rcNode, rcRenaming, rcNode, rcBusy );
-
-        len = snprintf ( p = full, sizeof full, "%s", to );
-        if ( len < 0 || len >= sizeof full )
-            return RC ( rcDB, rcNode, rcRenaming, rcPath, rcExcessive );
-
-        rc = KMDataNodeFind ( self, & renamed, & p );
-        if ( GetRCState ( rc ) == rcNotFound )
-        {
-            rc = KMDataNodeMake ( renamed, & renamed, p );
-            if ( rc == 0 )
-            {
-                BSTreeUnlink ( & found -> par -> child, & found -> n );
-
-                renamed -> attr = found -> attr;
-                BSTreeInit ( & found -> attr );
-
-                renamed -> child = found -> child;
-                BSTreeInit ( & found -> child );
-                BSTreeForEach ( & renamed -> child,
-                    false, KMDataNodeRelinkParent, renamed );
-
-                renamed -> value = found -> value;
-                renamed -> vsize = found -> vsize;
-                found -> value = NULL;
-                found -> vsize = 0;
-
-                KMDataNodeWhack ( & found -> n, NULL );
-                self -> meta -> dirty = true;
-            }
-        }
-        else if ( rc == 0 )
-            rc = RC ( rcDB, rcNode, rcRenaming, rcNode, rcExists );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMetadata
- *  a versioned, hierarchical structure
- */
-
-/* Flush
- */
-typedef struct KMDFlushData KMDFlushData;
-struct KMDFlushData
-{
-    uint64_t pos;
-    KFile *f;
-    KMD5File *fmd5;
-    uint8_t *buffer;
-    size_t bsize;
-    size_t marker;
-    rc_t rc;
-};
-
-static
-rc_t CC KMDWriteFunc ( void *param, const void *buffer, size_t size, size_t *num_writ )
-{
-    KMDFlushData *pb = param;
-    size_t total, to_write;
-
-    for ( total = 0; total < size; total += to_write )
-    {
-        to_write = size - total;
-        if ( pb -> marker + to_write > pb -> bsize )
-            to_write = pb -> bsize - pb -> marker;
-
-        if ( to_write > 0 )
-        {
-            memcpy ( pb -> buffer + pb -> marker,
-                ( const uint8_t* ) buffer + total, to_write );
-            pb -> marker += to_write;
-        }
-
-        if ( pb -> marker == pb -> bsize )
-        {
-            size_t num_flushed;
-            pb -> rc = KFileWrite ( pb -> f, pb -> pos,
-                pb -> buffer, pb -> bsize, & num_flushed );
-            if ( pb -> rc != 0 )
-            {
-                * num_writ = 0;
-                return pb -> rc;
-            }
-
-            if ( num_flushed == 0 )
-            {
-                * num_writ = total + to_write;
-                return pb -> rc = RC ( rcDB, rcMetadata, rcPersisting, rcTransfer, rcIncomplete );
-            }
-
-            pb -> marker -= num_flushed;
-            pb -> pos += num_flushed;
-
-            if ( pb -> marker != 0 )
-                memcpy ( pb -> buffer, pb -> buffer + num_flushed, pb -> marker );
-        }
-    }
-
-    * num_writ = total;
-    return 0;
-}
-
-static
-rc_t CC KMAttrNodeAuxFunc ( void *param, const void *node, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    const KMAttrNode *n = node;
-    size_t nsize = strlen ( n -> name );
-
-    if ( write != NULL )
-        return ( * write ) ( write_param, n -> name, nsize + n -> vsize + 1, num_writ );
-
-    * num_writ = nsize + n -> vsize + 1;
-    return 0;
-}
-
-static
-rc_t CC KMDataNodeAuxFunc ( void *param, const void *node, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    rc_t rc;
-    const KMDataNode *n = node;
-    size_t nsize = strlen ( n -> name );
-    size_t auxsize = 0;
-
-    /* first write node name */
-    if ( write != NULL )
-    {
-        uint8_t bits = ( uint8_t ) ( nsize - 1 ) << 2;
-        if ( n -> attr . root != NULL )
-            bits |= 1;
-        if ( n -> child . root != NULL )
-            bits |= 2;
-        rc = ( * write ) ( write_param, & bits, 1, num_writ );
-        if ( rc == 0 )
-            rc = ( * write ) ( write_param, n -> name, nsize, num_writ );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* if there are any attributes */
-    if ( n -> attr . root != NULL )
-    {
-        rc = BSTreePersist ( & n -> attr, num_writ,
-            write, write_param, KMAttrNodeAuxFunc, NULL );
-        if ( rc != 0 )
-            return rc;
-        auxsize += * num_writ;
-    }
-
-    /* if there are any children */
-    if ( n -> child . root != NULL )
-    {
-        rc = BSTreePersist ( & n -> child, num_writ,
-            write, write_param, KMDataNodeAuxFunc, NULL );
-        if ( rc != 0 )
-            return rc;
-        auxsize += * num_writ;
-    }
-
-    /* finally write value */
-    if ( write == NULL )
-    {
-        * num_writ = nsize + 1 + auxsize + n -> vsize;
-        return 0;
-    }
-
-    rc = ( * write ) ( write_param, n -> value, n -> vsize, num_writ );
-    * num_writ += nsize + 1 + auxsize;
-    return rc;
-}
-
-static
-rc_t KMetadataFlush ( KMetadata *self )
-{
-    rc_t rc;
-    KMDFlushData pb;
-    memset ( & pb, 0, sizeof pb );
-
-    /* allocate buffer */
-    pb . buffer = malloc ( pb . bsize = 32 * 1024 );
-    if ( pb . buffer == NULL )
-        rc = RC ( rcDB, rcMetadata, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        /* open output file */
-        rc = KColumnFileCreate ( & pb . f, & pb . fmd5, self -> dir, self -> md5,
-                                 kcmInit | kcmParents, false, "md/cur.tmp" );
-        /* ZZZZ do we need a "KMD5FileReset ( pb -> fmd5 )" ? I don't think so */
-        if ( rc == 0 )
-        {
-            /* write header */
-            KDBHdr *hdr = ( KDBHdr* ) pb . buffer;
-            hdr -> endian = eByteOrderTag;
-            hdr -> version = KMETADATAVERS;
-            pb . marker = sizeof * hdr;
-
-            /* persist root node */
-            rc = BSTreePersist ( & self -> root -> child, NULL,
-                KMDWriteFunc, & pb, KMDataNodeAuxFunc, NULL );
-            if ( rc == 0 && pb . marker != 0 )
-            {
-                size_t num_flushed;
-                rc = KFileWrite ( pb . f, pb . pos,
-                                  pb . buffer, pb . marker, & num_flushed );
-                if ( rc == 0 && num_flushed != pb . marker )
-                    rc = RC ( rcDB, rcMetadata, rcPersisting, rcTransfer, rcIncomplete );
-            }
-            pb . rc = KFileRelease ( pb . f );
-            if ( pb . rc  ==  0 )
-                pb . fmd5 = NULL;
-            if ( rc == 0 && ( rc = pb . rc ) == 0 )
-            {
-                /* rename file */
-                rc = KDirectoryRename ( self -> dir, true, "md/cur.tmp", "md/cur" );
-
-                if ( self->md5 != NULL && rc == 0 )
-                    rc = KMD5SumFmtRename ( self -> md5, "md/cur.tmp", "md/cur" );
-
-                if ( rc == 0 )
-                    self -> dirty = false;
-            }
-        }
-
-        free ( pb . buffer );
-    }
-    return rc;
-}
-
-/* Whack
- */
-static
-rc_t KMetadataWhack ( KMetadata *self )
-{
-    rc_t rc = 0;
-    KSymbol * symb;
-    KDBManager *mgr = self -> mgr;
-    assert ( mgr != NULL );
-
-    KRefcountWhack ( & self -> refcount, "KMetadata" );
-
-    if ( self -> dirty )
-    {
-        /* if this was a version 1 file,
-           first freeze it */
-        if ( self -> vers == 1 )
-        {
-            rc = KMetadataFreeze ( self );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* flush it */
-        rc = KMetadataFlush ( self );
-        if ( rc != 0 )
-            return rc;
-        self -> dirty = false;
-    }
-
-    if ( self -> db != NULL )
-    {
-        rc = KDatabaseSever ( self -> db );
-        if ( rc != 0 )
-            return rc;
-        self -> db = NULL;
-    }
-    else if ( self -> tbl != NULL )
-    {
-        rc = KTableSever ( self -> tbl );
-        if ( rc != 0 )
-            return rc;
-        self -> tbl = NULL;
-    }
-    else if ( self -> col != NULL )
-    {
-        rc = KColumnSever ( self -> col );
-        if ( rc != 0 )
-            return rc;
-        self -> col = NULL;
-    }
-
-    if ( self -> md5 != NULL )
-    {
-	rc = KMD5SumFmtRelease ( self -> md5 );
-	if ( rc != 0 )
-	    return rc;
-	self -> md5 = NULL;
-    }
-
-    /* remove from mgr */
-    symb = KDBManagerOpenObjectFind (mgr, self->path);
-    if (symb != NULL)
-    {
-        rc = KDBManagerOpenObjectDelete (mgr, symb);
-        if (rc == 0)
-        {
-            /* release manager
-               should never fail */
-            rc = KDBManagerSever ( mgr );
-            if ( rc != 0 )
-                KDBManagerOpenObjectAdd (mgr, symb);
-            else
-            {
-                /* complete */
-                KDirectoryRelease ( self -> dir );
-                atomic32_set ( & self -> refcount, 0 );
-                KMDataNodeWhack ( & self -> root -> n, NULL );
-                free ( self );
-                return 0;
-            }
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KMetadata", "whack", "kmeta" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KMetadataAddRef ( const KMetadata *cself )
-{
-    KMetadata *self = ( KMetadata* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcAttaching, rcRange, rcExcessive );
-        }
-        ++ self -> opencount;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMetadataRelease ( const KMetadata *cself )
-{
-    KMetadata *self = ( KMetadata* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefWhack:
-            return KMetadataWhack ( ( KMetadata* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-        -- self -> opencount;
-    }
-    return 0;
-}
-
-static
-KMetadata *KMetadataAttach ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KMetadata* ) self;
-}
-
-static
-rc_t KMetadataSever ( const KMetadata *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KMetadata" ) )
-        {
-        case krefWhack:
-            return KMetadataWhack ( ( KMetadata* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcMetadata, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Make
- */
-
-static
-rc_t KMetadataPopulate ( KMetadata *self, const KDirectory *dir, const char *path, bool read_only )
-{
-    const KFile *f;
-    rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
-    if ( rc == 0 )
-    {
-        const KMMap *mm;
-        rc = KMMapMakeRead ( & mm, f );
-        if ( rc == 0 )
-        {
-            size_t size;
-            const void *addr;
-            rc = KMMapSize ( mm, & size );
-            if ( rc == 0 )
-                rc = KMMapAddrRead ( mm, & addr );
-
-            if ( rc == 0 )
-            {
-                union
-                {
-                    KDBHdr v1;
-                    KDBHdr v2;
-                } hdrs;
-
-                const KDBHdr *hdr = ( const KDBHdr* ) addr;
-                const void *pbstree_src = hdr + 1;
-
-                rc = KDBHdrValidate ( hdr, size, 1, KMETADATAVERS );
-                if ( self -> read_only && GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
-                {
-                    hdrs . v1 . endian = bswap_32 ( hdr -> endian );
-                    hdrs . v1 . version = bswap_32 ( hdr -> version );
-                    rc = KDBHdrValidate ( & hdrs . v1, size, 1, KMETADATAVERS );
-                    if ( rc == 0 )
-                    {
-                        self -> byteswap = true;
-                        switch ( hdrs . v1 . version )
-                        {
-                        case 1:
-                            hdr = & hdrs . v1;
-                            break;
-                        case 2:
-                            hdr = & hdrs . v2;
-                            break;
-                        }
-                    }
-                }
-                if ( rc == 0 )
-                {
-                    PBSTree *bst;
-                    rc = PBSTreeMake ( & bst, pbstree_src, size - sizeof * hdr, self -> byteswap );
-                    if ( rc != 0 )
-                        rc = RC ( rcDB, rcMetadata, rcConstructing, rcData, rcCorrupt );
-                    else
-                    {
-                        KMDataNodeInflateData pb;
-
-                        pb . meta = self;
-                        pb . par = self -> root;
-                        pb . bst = & self -> root -> child;
-                        pb . node_size_limit = read_only ? NODE_SIZE_LIMIT : 0;
-                        pb . node_child_limit = read_only ? NODE_CHILD_LIMIT : 0;
-                        pb . rc = 0;
-                        pb . byteswap = self -> byteswap;
-
-                        if ( hdr -> version == 1 )
-                            PBSTreeDoUntil ( bst, false, KMDataNodeInflate_v1, & pb );
-                        else
-                            PBSTreeDoUntil ( bst, false, KMDataNodeInflate, & pb );
-                        rc = pb . rc;
-
-                        self -> vers = hdr -> version;
-
-                        PBSTreeWhack ( bst );
-                    }
-                }
-            }
-
-            KMMapRelease ( mm );
-        }
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-
-static
-rc_t KDBManagerInsertMetadata ( KDBManager * self, KMetadata * meta )
-{
-    rc_t rc;
-    rc = KDBManagerOpenObjectAdd (self, &meta->sym);
-    if ( rc == 0 )
-        meta -> mgr = KDBManagerAttach ( self );
-    return rc;
-}
-
-
-static
-rc_t KMetadataMake ( KMetadata **metap,
-    KDirectory *dir, const char *path, uint32_t rev,
-    bool populate, bool read_only )
-{
-    rc_t rc;
-    KMetadata *meta = malloc ( sizeof * meta + strlen ( path ) );
-    if ( meta == NULL )
-        rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( meta, 0, sizeof * meta );
-        meta -> root = calloc ( 1, sizeof * meta -> root );
-        if ( meta -> root == NULL )
-            rc = RC ( rcDB, rcMetadata, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            meta -> root -> meta = meta;
-            meta -> dir = dir;
-            KRefcountInit ( & meta -> refcount, 1, "KMetadata", "make-update", path );
-            meta -> opencount = 1;
-            meta -> rev = rev;
-            meta -> read_only = read_only;
-
-            strcpy ( meta -> path, path );
-
-            meta->sym.u.obj = meta;
-            StringInitCString (&meta->sym.name, meta->path);
-            meta->sym.type = kptMetadata;
-
-            KRefcountInit ( & meta -> root -> refcount, 0, "KMDataNode", "make-read", "/" );
-
-            if ( ! populate )
-            {
-                meta -> vers = KMETADATAVERS;
-                KDirectoryAddRef ( dir );
-                * metap = meta;
-                return 0;
-            }
-            
-            rc = KMetadataPopulate ( meta, dir, path, read_only );
-            if ( rc == 0 )
-            {
-                KDirectoryAddRef ( dir );
-                * metap = meta;
-                return 0;
-            }
-
-            free ( meta -> root );
-        }
-
-        free ( meta );
-    }
-    * metap = NULL;
-    return rc;
-}
-
-#if 0
-static
-rc_t KMetadataMakeRead ( KMetadata **meta,
-    const KDirectory *dir, const char *path, uint32_t rev )
-{
-    rc_t rc = KMetadataMakeUpdate ( meta,
-        ( KDirectory* ) dir, path, rev, true );
-    if ( rc == 0 )
-        ( * meta ) -> read_only = true;
-    return rc;
-}
-#endif
-
-
-/* OpenMetadataRead
- *  opens metadata for read
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-static
-rc_t KDBManagerOpenMetadataReadInt ( KDBManager *self,
-    const KMetadata **metap, const KDirectory *wd, uint32_t rev, bool prerelease,bool *cached )
-{
-    char metapath [ 4096 ];
-    rc_t rc = ( prerelease == 1 ) ?
-        KDirectoryVResolvePath ( wd, true, metapath, sizeof metapath, "meta", NULL ):
-        ( ( rev == 0 ) ?
-          KDirectoryVResolvePath ( wd, true, metapath, sizeof metapath, "md/cur", NULL ):
-          KDirectoryResolvePath ( wd, true, metapath, sizeof metapath, "md/r%.3u", rev ) );
-    if(cached != NULL ) *cached = false;
-    if ( rc == 0 )
-    {
-        KMetadata * meta;
-        KSymbol * sym;
-
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (self, metapath);
-        if (sym != NULL)
-        {
-            const KMetadata * cmeta;
-            rc_t obj;
-
-	    if(cached != NULL ) *cached = true;
-            switch (sym->type)
-            {
-            case kptMetadata:
-                cmeta = (KMetadata*)sym->u.obj;
-                /* if open for update, refuse */
-                if ( cmeta -> read_only )
-                {
-                    /* attach a new reference and we're gone */
-                    rc = KMetadataAddRef ( cmeta );
-                    if ( rc == 0 )
-                        * metap = cmeta;
-                    return rc;
-                }
-                obj = rcMetadata;
-                break;
-
-            default:
-                obj = rcPath;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            }
-            return  RC (rcDB, rcMgr, rcOpening, obj, rcBusy);
-	}
-
-
-        switch ( KDirectoryVPathType ( wd, metapath, NULL ) )
-        {
-        case kptNotFound:
-            rc = RC ( rcDB, rcMgr, rcOpening, rcMetadata, rcNotFound );
-            break;
-        case kptBadPath:
-            rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-            break;
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-            break;
-        }
-
-        if ( rc == 0 )
-        {
-            rc = KMetadataMake ( & meta, ( KDirectory* ) wd, metapath, rev, true, true );
-            
-            if ( rc == 0 )
-            {
-                rc = KDBManagerInsertMetadata (self, meta );
-                if ( rc == 0 )
-                {
-                    * metap = meta;
-                    return 0;
-                }
-
-                KMetadataRelease ( meta );
-            }
-
-/*             rc = RC ( rcDB, rcMgr, rcOpening, rcMetadata, rcExists ); */
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenMetadataRead ( const KDatabase *self, const KMetadata **metap )
-{
-    rc_t rc;
-    const KMetadata *meta;
-    bool  meta_is_cached;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta, self -> dir, 0, false, &meta_is_cached );
-    if ( rc == 0 )
-    {
-        if(!meta_is_cached) ((KMetadata*)meta) -> db = KDatabaseAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenMetadataRead ( const KTable *self, const KMetadata **metap )
-{
-    rc_t rc;
-    const KMetadata *meta;
-    bool  meta_is_cached;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta, self -> dir, 0, self -> prerelease, &meta_is_cached );
-    if ( rc == 0 )
-    {
-        if(!meta_is_cached) ((KMetadata*)meta) -> tbl = KTableAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenMetadataRead ( const KColumn *self, const KMetadata **metap )
-{
-    rc_t rc;
-    const KMetadata *meta;
-    bool  meta_is_cached;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr, & meta, self -> dir, 0, false, &meta_is_cached );
-    if ( rc == 0 )
-    {
-        if(!meta_is_cached) ((KMetadata*)meta) -> col = KColumnAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-/* OpenMetadataUpdate
- *  open metadata for read/write
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-static
-rc_t KDBManagerOpenMetadataUpdateInt ( KDBManager *self,
-    KMetadata **metap, KDirectory *wd, KMD5SumFmt * md5 )
-{
-/* WAK
- * NEEDS MD5 UPDATE???
- */
-    char metapath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        metapath, sizeof metapath, "md/cur", NULL );
-    if ( rc == 0 )
-    {
-        KSymbol * sym;
-        KMetadata *meta;
-        bool populate = true;
-
-        switch ( KDirectoryVPathType ( wd, metapath, NULL ) )
-        {
-        case kptNotFound:
-            populate = false;
-            break;
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-        case kptFile:
-        case kptFile | kptAlias:
-            break;
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        }
-
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (self, metapath);
-        if (sym != NULL)
-        {
-            rc_t obj;
-            switch (sym->type)
-            {
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return RC ( rcDB, rcMgr, rcOpening, obj, rcBusy );
-        }
-
-        rc = KMetadataMake ( & meta, wd, metapath, 0, populate, false );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerInsertMetadata (self, meta);
-            if (rc == 0)
-            {
-                if ( md5 != NULL )
-                {
-                    meta -> md5 = md5;
-                    rc = KMD5SumFmtAddRef ( md5 );
-                }
-
-                if ( rc == 0 )
-                {
-                    * metap = meta;
-                    return 0;
-                }
-            }
-
-            KMetadataRelease ( meta );
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenMetadataUpdate ( KDatabase *self, KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcOpening, rcDatabase, rcReadonly );
-
-    rc = KDBManagerOpenMetadataUpdateInt ( self -> mgr, & meta, self -> dir, self -> md5 );
-    if ( rc == 0 )
-    {
-        meta -> db = KDatabaseAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenMetadataUpdate ( KTable *self, KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcTable, rcOpening, rcTable, rcReadonly );
-
-    rc = KDBManagerOpenMetadataUpdateInt ( self -> mgr, & meta, self -> dir, self -> md5 );
-    if ( rc == 0 )
-    {
-        meta -> tbl = KTableAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KColumnOpenMetadataUpdate ( KColumn *self, KMetadata **metap )
-{
-    rc_t rc;
-    KMetadata *meta;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcColumn, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcColumn, rcOpening, rcColumn, rcReadonly );
-
-    rc = KDBManagerOpenMetadataUpdateInt ( self -> mgr, & meta, self -> dir, self -> md5 );
-    if ( rc == 0 )
-    {
-        meta -> col = KColumnAttach ( self );
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-
-/* Version
- *  returns the metadata format version
- */
-LIB_EXPORT rc_t CC KMetadataVersion ( const KMetadata *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * version = 0;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * version = self -> vers;
-    return 0;
-}
-
-
-/* ByteOrder
- *  indicates whether original byte order is reversed
- *  under current architecture.
- *
- *  the byte order of the column is established by
- *  the host architecture when created.
- *
- *  "reversed" [ OUT ] - if true, the original byte
- *  order is reversed with regard to host native byte order.
- */
-LIB_EXPORT rc_t CC KMetadataByteOrder ( const KMetadata *self, bool *reversed )
-{
-    if ( reversed == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * reversed = false;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * reversed = self -> byteswap;
-    return 0;
-}
-
-
-/* Revision
- *  returns current revision number
- *  where 0 ( zero ) means tip
- */
-LIB_EXPORT rc_t CC KMetadataRevision ( const KMetadata *self, uint32_t *revision )
-{
-    if ( revision == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    if ( self == NULL )
-    {
-        * revision = 0;
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    }
-
-    * revision = self -> rev;
-    return 0;
-}
-
-
-/* MaxRevision
- *  returns the maximum revision available
- */
-LIB_EXPORT rc_t CC KMetadataMaxRevision ( const KMetadata *self, uint32_t *revision )
-{
-    rc_t rc;
-    KNamelist *listing;
-
-    if ( revision == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-
-    * revision = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-
-    rc = KDirectoryVList ( self -> dir,
-        & listing, NULL, NULL, "md", NULL );
-    if ( rc == 0 )
-    {
-        uint32_t rev_max, count;
-        rc = KNamelistCount ( listing, & count );
-        if ( rc == 0 )
-        {
-            uint32_t idx;
-            for ( rev_max = idx = 0; idx < count; ++ idx )
-            {
-                const char *name;
-                    
-                rc = KNamelistGet ( listing, idx, & name );
-                if ( rc != 0 )
-                    break;
-                    
-                if ( name [ 0 ] == 'r' )
-                {
-                    char *end;
-                    uint32_t rev = strtou32 ( name + 1, & end, 10 );
-                    if ( end [ 0 ] == 0 && rev > rev_max )
-                        rev_max = rev;
-                }
-            }
-
-            * revision = rev_max;
-        }
-                
-        KNamelistRelease ( listing );
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* Commit
- *  ensure any changes are committed to disk
- */
-LIB_EXPORT rc_t CC KMetadataCommit ( KMetadata *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcCommitting, rcSelf, rcNull );
-
-    /* only flush if dirty */
-    if ( ! self -> dirty )
-        return 0;
-
-    /* if this was a version 1 file,
-       first freeze it */
-    if ( self -> vers == 1 )
-    {
-        rc = KMetadataFreeze ( self );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* flush it */
-    rc = KMetadataFlush ( self );
-    if ( rc == 0 )
-        self -> dirty = false;
-
-    return rc;
-}
-
-
-/* Freeze
- *  freezes current metadata revision
- *  further modification will begin on a copy
- */
-LIB_EXPORT rc_t CC KMetadataFreeze ( KMetadata *self )
-{
-    rc_t rc;
-    uint32_t rev_max;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcFreezing, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcMetadata, rcFreezing, rcMetadata, rcReadonly );
-
-    switch ( KDirectoryVPathType ( self -> dir, "md/cur", NULL ) )
-    {
-    case kptFile:
-        break;
-    case kptFile | kptAlias:
-        return 0;
-    default:
-        return RC ( rcDB, rcMetadata, rcFreezing, rcPath, rcInvalid );
-    }
-
-    /* find max revision */
-    rc = KMetadataMaxRevision ( self, & rev_max );
-    if ( rc == 0 )
-    {
-        int len;
-        char revision [ 16 ];	/* nice even stack (could have been 8) */
-
-        /* rename tip to new version */
-        len = snprintf ( revision, sizeof revision, "md/r%.3u", rev_max + 1 );
-        if ( len < 0 || len >= sizeof revision )
-            return RC ( rcDB, rcMetadata, rcFreezing, rcPath, rcInvalid );
-
-        rc = KDirectoryRename ( self -> dir, false, "md/cur", revision );
-        if ( rc == 0 )
-        {
-            /* now create link to this guy */
-            rc = KDirectoryCreateAlias ( self -> dir,
-                0777, kcmCreate, revision, "md/cur" );
-
-            if ( rc == 0 )
-            {
-                if ( self -> md5 != NULL )
-                {
-                    rc = KMD5SumFmtRename ( self -> md5, "md/cur", revision );
-                    if ( rc != 0 )	/* attempt to recover */
-                        KDirectoryRemove ( self -> dir, false, "md/cur" );
-                }
-            }
-            if ( rc != 0 )                /* attempt to recover */
-                KDirectoryRename ( self -> dir, false, revision, "md/cur" );
-        }
-    }
-        
-    return rc;
-}
-
-
-/* OpenRevision
- *  opens a read-only indexed revision of metadata
- */
-LIB_EXPORT rc_t CC KMetadataOpenRevision ( const KMetadata *self,
-    const KMetadata **metap, uint32_t revision )
-{
-    rc_t rc;
-    const KMetadata *meta;
-    bool  meta_is_cached;
-
-    if ( metap == NULL )
-        return RC ( rcDB, rcMetadata, rcOpening, rcParam, rcNull );
-
-    * metap = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcOpening, rcSelf, rcNull );
-
-    rc = KDBManagerOpenMetadataReadInt ( self -> mgr,
-        & meta, self -> dir, revision, false, &meta_is_cached  );
-    if ( rc == 0 )
-    {
-        if(!meta_is_cached)
-	{
-	    if ( self -> db != NULL )
-                ((KMetadata*)meta) -> db = KDatabaseAttach ( self -> db );
-            else if ( self -> tbl != NULL )
-                ((KMetadata*)meta) -> tbl = KTableAttach ( self -> tbl );
-            else if ( self -> col != NULL )
-                ((KMetadata*)meta) -> col = KColumnAttach ( self -> col );
-	}
-
-        * metap = meta;
-    }
-
-    return rc;
-}
-
-
-/* GetSequence
- * SetSequence
- * NextSequence
- *  access a named sequence
- *
- *  "seq" [ IN ] - NUL terminated sequence name
- *
- *  "val" [ OUT ] - return parameter for sequence value
- *  "val" [ IN ] - new sequence value
- */
-LIB_EXPORT rc_t CC KMetadataGetSequence ( const KMetadata *self,
-    const char *seq, int64_t *val )
-{
-    rc_t rc;
-    const KMDataNode *found;
-
-    if ( val == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcParam, rcNull );
-    * val = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcSelf, rcNull );
-    if ( seq == NULL )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcPath, rcNull );
-    if ( seq [ 0 ] == 0 )
-        return RC ( rcDB, rcMetadata, rcAccessing, rcPath, rcInvalid );
-
-    rc = KMDataNodeOpenNodeRead ( self -> root, & found, ".seq/%s", seq );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeReadB64 ( found, val );
-        KMDataNodeRelease ( found );
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataSetSequence ( KMetadata *self,
-    const char *seq, int64_t val )
-{
-    rc_t rc;
-    KMDataNode *found;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcSelf, rcNull );
-    if ( seq == NULL )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcPath, rcNull );
-    if ( seq [ 0 ] == 0 )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcPath, rcInvalid );
-
-    rc = KMDataNodeOpenNodeUpdate ( self -> root, & found, ".seq/%s", seq );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeWriteB64 ( found, & val );
-        KMDataNodeRelease ( found );
-    }
-        
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMetadataNextSequence ( KMetadata *self,
-    const char *seq, int64_t *val )
-{
-    rc_t rc;
-    KMDataNode *found;
-
-    if ( val == NULL )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcParam, rcNull );
-    * val = 0;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcSelf, rcNull );
-    if ( seq == NULL )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcPath, rcNull );
-    if ( seq [ 0 ] == 0 )
-        return RC ( rcDB, rcMetadata, rcUpdating, rcPath, rcInvalid );
-
-    rc = KMDataNodeOpenNodeUpdate ( self -> root, & found, ".seq/%s", seq );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeReadB64 ( found, val );
-        if ( rc == 0 || GetRCState ( rc ) == rcIncomplete )
-        {
-            * val += 1;
-            rc = KMDataNodeWriteB64 ( found, val );
-        }
-
-        KMDataNodeRelease ( found );
-    }
-
-    return rc;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-typedef struct KMDataNodeNamelist KMDataNodeNamelist;
-struct KMDataNodeNamelist
-{
-    KNamelist dad;
-    const KMDataNode *node;
-    size_t count;
-    const char *namelist [ 1 ];
-};
-
-/* Whack
- */
-static
-rc_t CC KMDataNodeNamelistWhack ( KMDataNodeNamelist *self )
-{
-    rc_t rc = KMDataNodeRelease ( self -> node );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Count
- */
-static
-rc_t CC KMDataNodeNamelistCount ( const KMDataNodeNamelist *self, uint32_t *count )
-{
-    * count = ( uint32_t ) self -> count;
-    return 0;
-}
-
-/* Get
- */
-static
-rc_t CC KMDataNodeNamelistGet ( const KMDataNodeNamelist *self,
-    uint32_t idx, const char **name )
-{
-    if ( ( size_t ) idx >= self -> count )
-        return RC ( rcDB, rcNamelist, rcAccessing, rcParam, rcExcessive );
-    * name = self -> namelist [ idx ];
-    return 0;
-}
-
-/* Make
- */
-static KNamelist_vt_v1 vtKMDataNodeNamelist =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KMDataNodeNamelistWhack,
-    KMDataNodeNamelistCount,
-    KMDataNodeNamelistGet
-    /* end minor version 0 methods */
-};
-
-static
-rc_t KMDataNodeNamelistMake ( KNamelist **names, unsigned int count )
-{
-    rc_t rc;
-    KMDataNodeNamelist *self = calloc ( 1, sizeof * self -
-        sizeof self -> namelist + count * sizeof self -> namelist [ 0 ] );
-    if ( self == NULL )
-        rc = RC ( rcDB, rcNamelist, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KNamelistInit ( & self -> dad,
-            ( const KNamelist_vt* ) & vtKMDataNodeNamelist );
-        if ( rc == 0 )
-        {
-            * names = & self -> dad;
-            return 0;
-        }
-        
-        free ( self );
-    }
-
-    return rc;
-}
-
-/* List
- *  create metadata node listings
- */
-static
-void CC KMDataNodeListCount ( BSTNode *n, void *data )
-{
-    * ( unsigned int* ) data += 1;
-}
-
-static
-void CC KMDataNodeGrabAttr ( BSTNode *n, void *data )
-{
-    KMDataNodeNamelist *list = data;
-    list -> namelist [ list -> count ++ ] = ( ( const KMAttrNode* ) n ) -> name;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeListAttr ( const KMDataNode *self, KNamelist **names )
-{
-    rc_t rc;
-    unsigned int count;
-
-    if ( names == NULL )
-        return RC ( rcDB, rcNode, rcListing, rcParam, rcNull );
-    * names = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcListing, rcSelf, rcNull );
-
-    count = 0;
-    BSTreeForEach ( & self -> attr, 0, KMDataNodeListCount, & count );
-
-    rc = KMDataNodeNamelistMake ( names, count );
-    if ( rc == 0 )
-        BSTreeForEach ( & self -> attr, false, KMDataNodeGrabAttr, * names );
-
-    return rc;
-}
-
-static
-void CC KMDataNodeGrabName ( BSTNode *n, void *data )
-{
-    KMDataNodeNamelist *list = data;
-    list -> namelist [ list -> count ++ ] = ( ( const KMDataNode* ) n ) -> name;
-}
-
-LIB_EXPORT rc_t CC KMDataNodeListChildren ( const KMDataNode *self, KNamelist **names )
-{
-    rc_t rc;
-    unsigned int count;
-
-    if ( names == NULL )
-        return RC ( rcDB, rcNode, rcListing, rcParam, rcNull );
-    * names = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcNode, rcListing, rcSelf, rcNull );
-
-    count = 0;
-    BSTreeForEach ( & self -> child, 0, KMDataNodeListCount, & count );
-
-    rc = KMDataNodeNamelistMake ( names, count );
-    if ( rc == 0 )
-        BSTreeForEach ( & self -> child, false, KMDataNodeGrabName, * names );
-
-    return rc;
-}
diff --git a/libs/kdb/wtable-priv.h b/libs/kdb/wtable-priv.h
deleted file mode 100644
index cda3fa5..0000000
--- a/libs/kdb/wtable-priv.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_table_priv_
-#define _h_table_priv_
-
-#ifndef _h_kdb_table_
-#include <kdb/table.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#include <klib/symbol.h>
-#include <kfs/md5.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDatabase;
-struct KDBManager;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KTable
- *  represents a table
- *  normally implemented as a directory
- *  but may be a single archive file
- *  in either executable or streamable format
- */
-struct KTable
-{
-    struct KDirectory *dir;
-    struct KDBManager *mgr;
-    struct KDatabase *db;
-    struct KMD5SumFmt *md5;
-
-    KRefcount refcount;
-    uint32_t opencount;
-    bool use_md5;
-    bool read_only;
-    bool prerelease;
-    uint8_t align [ 5 ];
-
-    KSymbol sym;
-
-    char path [ 1 ];
-};
-
-/* Attach
- * Sever
- *  like KTableRelease, except called internally
- *  indicates that a child object is letting go...
- */
-KTable *KTableAttach ( const KTable *self );
-rc_t KTableSever ( const KTable *self );
-
-/* Cmp
- * Sort
- */
-int KTableCmp ( const void *item, const BSTNode *n );
-int KTableSort ( const BSTNode *item, const BSTNode *n );
-
-/* check a disk-resident column for needing re-indexing */
-bool KTableColumnNeedsReindex ( KTable *self, const char *colname );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_table_priv_ */
diff --git a/libs/kdb/wtable.c b/libs/kdb/wtable.c
deleted file mode 100644
index 8ce9885..0000000
--- a/libs/kdb/wtable.c
+++ /dev/null
@@ -1,1590 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kdb/extern.h>
-#include "wtable-priv.h"
-#include "dbmgr-priv.h"
-#include "database-priv.h"
-#include "wcolumn-priv.h"
-#include "windex-priv.h"
-#include "wkdb-priv.h"
-
-#include <klib/namelist.h>
-#include <klib/symbol.h>
-#include <kdb/namelist.h>
-#include <klib/log.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/impl.h>
-#include <sysalloc.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* keep file system structure compatible with v0 code */
-#define V0_BACKWARD_COMPAT 0
-
-/*--------------------------------------------------------------------------
- * KTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-
-/* GetPath
- *  return the absolute path to table
- */
-LIB_EXPORT rc_t CC KTableGetPath ( const KTable *self,
-    const char **path )
-{
-    if ( self == NULL )
-        return RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-
-    *path = self->path;
-
-    return 0;
-}
-
-/* Whack
- */
-static
-rc_t KTableWhack ( KTable *self )
-{
-    rc_t rc = 0;
-    KDBManager *mgr = self -> mgr;
-    KSymbol * symb;
-    assert ( mgr != NULL );
-
-    KRefcountWhack ( & self -> refcount, "KTable" );
-
-    if ( self -> db != NULL )
-    {
-        rc = KDatabaseSever ( self -> db );
-        if ( rc != 0 )
-            return rc;
-        self -> db = NULL;
-    }
-
-    /* shut down md5 sum file if it is open */
-    KMD5SumFmtRelease ( self -> md5 ), self -> md5 = NULL;
-
-    /* remove from mgr */
-    symb = KDBManagerOpenObjectFind (mgr, self->path);
-    if (symb != NULL)
-    {
-        rc = KDBManagerOpenObjectDelete (mgr, symb);
-        if (rc == 0)
-        {
-            rc = KDBManagerSever ( mgr );
-            if ( rc != 0 )
-                rc = KDBManagerOpenObjectAdd (mgr, symb);
-            else
-            {
-                /* complete */
-                KDirectoryRelease ( self -> dir );
-                free ( self );
-                return 0;
-            }
-        }
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "KTable", "whack", "ktbl" );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KTableAddRef ( const KTable *cself )
-{
-    KTable *self = ( KTable* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KTable" ) )
-        {
-        case krefLimit:
-            return RC ( rcDB, rcTable, rcAttaching, rcRange, rcExcessive );
-        }
-        ++ self -> opencount;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTableRelease ( const KTable *cself )
-{
-    KTable *self = ( KTable* ) cself;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KTable" ) )
-        {
-        case krefWhack:
-            return KTableWhack ( ( KTable* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-        -- self -> opencount;
-    }
-    return 0;
-}
-
-
-/* Attach
- * Sever
- */
-KTable *KTableAttach ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KTable" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KTable* ) self;
-}
-
-/* Sever
- *  like KTableRelease, except called internally
- *  indicates that a child object is letting go...
- */
-rc_t KTableSever ( const KTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KTable" ) )
-        {
-        case krefWhack:
-            assert ( self -> opencount == 0 );
-            return KTableWhack ( ( KTable* ) self );
-        case krefLimit:
-            return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- *  make an initialized structure
- *  NB - does NOT attach reference to dir, but steals it
- */
-static
-rc_t KTableMake ( KTable **tblp, const KDirectory *dir, const char *path,
-		  KMD5SumFmt * md5, bool read_only )
-{
-    KTable *tbl;
-
-    assert ( tblp != NULL );
-    assert ( path != NULL );
-
-    tbl = malloc ( sizeof * tbl + strlen ( path ) );
-    if ( tbl == NULL )
-    {
-        * tblp = NULL;
-        return RC ( rcDB, rcTable, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    memset ( tbl, 0, sizeof * tbl );
-    tbl -> dir = ( KDirectory* ) dir;
-    KRefcountInit ( & tbl -> refcount, 1, "KTable", "make", path );
-    tbl -> opencount = 1;
-    tbl -> md5 = md5;
-    KMD5SumFmtAddRef ( md5 );
-    tbl -> use_md5 = ( md5 == NULL ) ? false : true;
-    tbl -> read_only = read_only;
-    strcpy ( tbl -> path, path );
-
-    tbl->sym.u.obj = tbl;
-    StringInitCString (&tbl->sym.name, tbl->path);
-    tbl->sym.type = kptTable;
-
-    * tblp = tbl;
-    return 0;
-}
-
-static
-rc_t KDBManagerInsertTable ( KDBManager * self, KTable * tbl )
-{
-    rc_t rc;
-    rc = KDBManagerOpenObjectAdd (self, &tbl->sym);
-    if ( rc == 0 )
-        tbl -> mgr = KDBManagerAttach ( self );
-    return rc;
-}
-
-
-static
-rc_t KDBManagerMakeTableUpdate ( KDBManager *self,
-    KTable **tblp, KDirectory *wd, const char *path, bool convert, KMD5SumFmt * md5 )
-{
-    rc_t rc;
-    KDirectory *dir;
-
-    rc = KDirectoryVOpenDirUpdate ( wd, & dir, false, path, NULL );
-    if ( rc == 0 )
-    {
-        KTable * tbl;
-
-        if ( convert )
-        {
-            /* the old table layout:
-               <tbl>/
-               col/...
-               meta
-               sealed
-               skey
-            */
-            rc = KDirectoryVSetAccess ( dir, true, 0220, 0222, ".", NULL );
-            if ( rc == 0 )
-                rc = KDirectoryVCreateDir ( dir, 0775, kcmCreate, "md", NULL );
-            if ( rc == 0 )
-            {
-                rc = KDirectoryRename ( dir, false, "meta", "md/r001" );
-                if ( GetRCState ( rc ) == rcNotFound )
-                    rc = 0;
-                else if ( rc == 0 )
-                {
-                    rc = KDirectoryCreateAlias ( dir, 0777, kcmCreate, "md/r001", "md/cur" );
-#if V0_BACKWARD_COMPAT
-                    if ( rc == 0 )
-                        rc = KDirectoryCreateAlias ( dir, 0777, kcmCreate, "md/r001", "meta" );
-#endif
-                    if( rc == 0 ) {
-                        KFile* md5_file = NULL;
-                        if( (rc = KDirectoryOpenFileWrite(dir, &md5_file, true, "md5")) == 0 ) {
-                            KMD5SumFmt* fmd5 = NULL;
-                            if( (rc = KMD5SumFmtMakeUpdate(&fmd5, md5_file)) == 0 ) {
-                                if( (rc = KMD5SumFmtRename(fmd5, "meta", "md/r001")) == 0 ) {
-                                    rc = KMD5SumFmtFlush(fmd5);
-                                }
-                                KMD5SumFmtRelease(fmd5);
-                            } else {
-                                KFileRelease(md5_file);
-                            }
-                        }
-                    }
-                }
-            }
-            if ( rc == 0 )
-                rc = KDirectoryVCreateDir ( dir, 0775, kcmCreate, "idx", NULL );
-            if ( rc == 0 )
-            {
-                rc = KDirectoryRename ( dir, false, "skey", "idx/skey" );
-                if ( GetRCState ( rc ) == rcNotFound )
-                    rc = 0;
-                else if ( rc == 0 )
-                {
-                    KDirectoryRename ( dir, false, "skey.md5", "idx/skey.md5" );
-#if V0_BACKWARD_COMPAT
-                    rc = KDirectoryCreateAlias ( dir, 0777, kcmCreate, "idx/skey", "skey" );
-#endif
-                }
-            }
-            if ( rc == 0 )
-            {
-                if ( KDirectoryVPathType ( dir, "sealed", NULL ) == kptFile )
-                {
-                    rc = KDBLockDir ( dir, "." );
-#if ! V0_BACKWARD_COMPAT
-                    if ( rc == 0 )
-                        KDirectoryVRemove ( dir, true, "sealed", NULL );
-#endif
-                }
-            }
-            
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* Make the base object */
-        rc = KTableMake ( & tbl, dir, path, md5, false );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerInsertTable ( self, tbl );
-
-            if ( rc == 0 )
-            {
-                * tblp = tbl;
-                return 0;
-            }
-
-            rc = RC ( rcDB, rcMgr, rcOpening, rcTable, rcBusy );
-                
-            free ( tbl );
-        }
-            
-        KDirectoryRelease ( dir );
-    }
-
-    return rc;
-}
-
-
-/* CreateTable
- * VCreateTable
- *  create a new or open an existing table
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-static
-rc_t KDBManagerVCreateTableInt ( KDBManager *self,
-    KTable **tbl, KDirectory *wd, KCreateMode cmode, 
-    const char *path, va_list args )
-{
-    char tblpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        tblpath, sizeof tblpath, path, args );
-    if ( rc == 0 )
-    {
-        bool convert = false;
-        bool not_found = false;
-
-        switch ( KDBPathType ( /*NULL,*/ wd, NULL, tblpath ) )
-        {
-        case kptNotFound:
-            not_found = true;
-            /* first good path */
-            break;
-
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcInvalid );
-
-        case kptTable:
-        case kptTable | kptAlias:
-            break;
-
-        case kptPrereleaseTbl:
-        case kptPrereleaseTbl | kptAlias:
-            convert = true;
-            break;
-
-        case kptDatabase:
-        case kptDatabase | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcDatabase, rcExists);
-
-        case kptColumn:
-        case kptColumn | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcColumn, rcExists);
-
-        case kptIndex:
-        case kptIndex | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcIndex, rcExists);
-
-        case kptMetadata:
-        case kptMetadata | kptAlias:
-            return RC (rcDB, rcMgr, rcCreating, rcMetadata, rcExists);
-
-        case kptFile:
-        case kptFile | kptAlias:
-            /* if we find a file, vary the failure if it is an archive that is a table
-             * or a non related file */
-            if (( KDBOpenPathTypeRead ( self, wd, tblpath, NULL, kptTable, NULL, false ) == 0 ) ||
-                ( KDBOpenPathTypeRead ( self, wd, tblpath, NULL, kptPrereleaseTbl, NULL, false ) == 0 ) )
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcReadonly );
-            /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcCreating, rcPath, rcIncorrect );
-        }
-
-        if (not_found == false)
-        {
-            /* found so is not good if we want to create new and not
-             * clear/init or open old
-             */
-            if ((cmode & kcmValueMask) == kcmCreate)
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcExists );
-            if (KDBManagerOpenObjectBusy (self, tblpath))
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcBusy );
-            /* test now for locked directory */
-            rc = KDBWritable ( wd, tblpath );
-            switch (GetRCState(rc))
-            {
-            default:
-                return rc;
-            case rcLocked:
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcLocked );
-            case rcReadonly:
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcReadonly );
-            case rcNotFound:
-                /* not found is good but probably unreachable */
-                break;
-            case 0:
-                break;
-            }
-        }
-
-        /* [re]create directory */
-        rc = KDirectoryVCreateDir ( wd, 0775, cmode, tblpath, NULL );
-        if ( rc == 0 )
-        {
-            KMD5SumFmt *md5 = NULL;
-
-            /* create column sub-directory */
-            rc = KDirectoryCreateDir ( wd, 0775, kcmOpen, "%s/col", tblpath );
-            if ( rc == 0 && ( cmode & kcmMD5 ) != 0 )
-            {
-                KFile * f;
-
-                /* create the md5 digest file */
-                rc = KDirectoryCreateFile ( wd, &f, true, 0664, kcmOpen, "%s/md5", tblpath );
-                if ( rc == 0 )
-                {
-                    rc = KMD5SumFmtMakeUpdate ( & md5, f );
-                    if ( rc != 0 )
-                        KFileRelease ( f );
-                }
-            }
-            
-            if ( rc == 0 )
-                rc = KDBManagerMakeTableUpdate ( self, tbl, wd, tblpath, convert, md5 );
-
-            KMD5SumFmtRelease ( md5 );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerCreateTable ( KDBManager *self,
-    KTable **tbl, KCreateMode cmode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVCreateTable ( self, tbl, cmode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVCreateTable ( KDBManager *self,
-    KTable **tbl, KCreateMode cmode, const char *path, va_list args )
-{
-    if ( tbl == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcParam, rcNull );
-
-    * tbl = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcCreating, rcSelf, rcNull );
-
-    return KDBManagerVCreateTableInt ( self, tbl, self -> wd, cmode, path, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseCreateTable ( KDatabase *self,
-    KTable **tbl, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVCreateTable ( self, tbl, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVCreateTable ( KDatabase *self,
-    KTable **tblp, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( tblp == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcParam, rcNull );
-
-    * tblp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcCreating, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcCreating, rcDatabase, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "tbl", 3, name, args );
-    if ( rc == 0 )
-    {
-        /* ensure that the "tbl" namespace directory is there */
-        rc = KDirectoryVCreateDir ( self -> dir,
-            0775, kcmOpen, "tbl", NULL );
-        if ( rc == 0 )
-        {
-            rc = KDBManagerVCreateTableInt ( self -> mgr, tblp,
-                self -> dir, cmode, path, NULL );
-            if ( rc == 0 )
-            {
-                KTable *tbl = ( KTable* ) * tblp;
-                tbl -> db = KDatabaseAttach ( self );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* OpenTableRead
- * VOpenTableRead
- *  open a table for read
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-static
-rc_t KDBManagerVOpenTableReadInt ( const KDBManager *cself,
-    const KTable **tblp, const KDirectory *wd, bool try_srapath,
-    const char *path, va_list args )
-{
-    rc_t rc;
-    char tblpath [ 4096 ];
-    size_t z;
-
-/*    rc = KDirectoryVResolvePath ( wd, 1,
-        tblpath, sizeof tblpath, path, args ); */
-    rc = string_vprintf( tblpath, sizeof tblpath, &z, path, args );
-    if ( rc == 0 )
-    {
-        KSymbol *sym;
-        
-        /* if already open */
-        sym = KDBManagerOpenObjectFind (cself, tblpath);
-        if (sym != NULL)
-        {
-            const KTable * ctbl;
-            rc_t obj;
-
-            switch (sym->type)
-            {
-            case kptTable:
-                ctbl = (KTable*)sym->u.obj;
-                /* if open for update, refuse */
-                if ( ctbl -> read_only )
-                {
-                    /* attach a new reference and we're gone */
-                    rc = KTableAddRef ( ctbl );
-                    if ( rc == 0 )
-                        * tblp = ctbl;
-                    return rc;
-                }
-                obj = rcTable;
-                break;
-                
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            rc = RC (rcDB, rcMgr, rcOpening, obj, rcBusy);
-        }
-        else
-        {
-            KTable * tbl;
-            const KDirectory *dir;
-            bool prerelease = false;
-
-            rc = KDBOpenPathTypeRead ( cself, wd, tblpath, &dir, kptTable, NULL, try_srapath );
-            if ( rc != 0 )
-            {
-                prerelease = true;
-                rc = KDBOpenPathTypeRead ( cself, wd, tblpath, &dir, kptPrereleaseTbl, NULL, try_srapath );
-            }        
-            if ( rc == 0 )
-            {
-                rc = KTableMake ( & tbl, dir, tblpath, NULL, true );
-                if ( rc == 0 )
-                {
-                    KDBManager * self = (KDBManager *)cself;
-
-                    rc = KDBManagerInsertTable (self, tbl );
-
-                    if (rc == 0)
-                    {
-                        tbl -> prerelease = prerelease;
-                        * tblp = tbl;
-                        return 0;
-                    }
-                    free ( tbl );
-                }
-                KDirectoryRelease ( dir );
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenTableRead ( const KDBManager *self,
-    const KTable **tbl, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenTableRead ( self, tbl, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenTableRead ( const KDBManager *self,
-    const KTable **tbl, const char *path, va_list args )
-{
-    if ( tbl == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * tbl = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenTableReadInt ( self, tbl, self -> wd, true, path, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenTableRead ( const KDatabase *self,
-    const KTable **tbl, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenTableRead ( self, tbl, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenTableRead ( const KDatabase *self,
-    const KTable **tblp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( tblp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * tblp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "tbl", 3, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenTableReadInt ( self -> mgr, tblp,
-                                           self -> dir, false, path, NULL );
-        if ( rc == 0 )
-        {
-            KTable *tbl = ( KTable* ) * tblp;
-            tbl -> db = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* OpenTableUpdate
- * VOpenTableUpdate
- *  open a table for read/write
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving name of table
- */
-static
-rc_t KDBManagerVOpenTableUpdateInt ( KDBManager *self,
-    KTable **tbl, KDirectory *wd, const char *path, va_list args )
-{
-    char tblpath [ 4096 ];
-    rc_t rc = KDirectoryVResolvePath ( wd, true,
-        tblpath, sizeof tblpath, path, args );
-    if ( rc == 0 )
-    {
-        KSymbol * sym;
-        KFile *f;
-        KMD5SumFmt * md5 = NULL;
-        bool convert = false;
-
-        /* if already open, refuse */
-        sym = KDBManagerOpenObjectFind (self, tblpath);
-        if (sym != NULL)
-        {
-            rc_t obj;
-            switch (sym->type)
-            {
-            default:
-                obj = rcPath;
-                break;
-            case kptDatabase:
-                obj = rcDatabase;
-                break;
-            case kptTable:
-                obj = rcTable;
-                break;
-            case kptColumn:
-                obj = rcColumn;
-                break;
-            case kptIndex:
-                obj = rcIndex;
-                break;
-            case kptMetadata:
-                obj = rcMetadata;
-                break;
-            }
-            return RC ( rcDB, rcMgr, rcOpening, obj, rcBusy );
-        }
-        /* only open existing tbls */
-        switch ( KDBPathType ( /*NULL,*/ wd, NULL, tblpath ) )
-        {
-        case kptNotFound:
-            return RC ( rcDB, rcMgr, rcOpening, rcTable, rcNotFound );
-
-        case kptBadPath:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
-
-        case kptFile:
-        case kptFile | kptAlias:
-            /* if we find a file, vary the failure if it is an archive that is a table
-             * or a non related file */
-            if (( KDBOpenPathTypeRead ( self, wd, tblpath, NULL, kptTable, NULL, false ) == 0 ) ||
-                ( KDBOpenPathTypeRead ( self, wd, tblpath, NULL, kptPrereleaseTbl, NULL, false ) == 0 ) )
-                return RC ( rcDB, rcMgr, rcCreating, rcTable, rcUnauthorized );
-            /* fall through */
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
-        case kptTable:
-        case kptTable | kptAlias:
-            break;
-
-        case kptPrereleaseTbl:
-        case kptPrereleaseTbl | kptAlias:
-            convert = true;
-            break;
-        }
-
-        /* test now for locked directory */
-        rc = KDBWritable ( wd, tblpath );
-        switch (GetRCState(rc))
-        {
-        default:
-            return RC ( rcDB, rcMgr, rcOpening, rcTable, rcNoPerm );
-
-        case rcLocked:
-            return RC ( rcDB, rcMgr, rcOpening, rcTable, rcLocked );
-
-        case rcReadonly:
-            return RC ( rcDB, rcMgr, rcOpening, rcTable, rcReadonly );
-
-        case 0:
-            rc = 0;
-            break;
-        }
-
-        rc = KDirectoryOpenFileWrite ( wd, &f, true, "%s/md5", tblpath );
-        if ( rc == 0 )
-        {
-            rc = KMD5SumFmtMakeUpdate ( & md5, f );
-            if ( rc != 0 )
-                KFileRelease ( f );
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-            rc = 0;
-#if 0
-        else if ( GetRCState ( rc ) == rcUnauthorized )
-            return RC ( rcDB, rcMgr, rcCreating, rcTable, rUnauthorized );
-#endif
-
-        if ( rc == 0 )
-            rc = KDBManagerMakeTableUpdate ( self, tbl, wd, tblpath, convert, md5 );
-
-        KMD5SumFmtRelease ( md5 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerOpenTableUpdate ( KDBManager *self,
-    KTable **tbl, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDBManagerVOpenTableUpdate ( self, tbl, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDBManagerVOpenTableUpdate ( KDBManager *self,
-    KTable **tbl, const char *path, va_list args )
-{
-    if ( tbl == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
-
-    * tbl = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
-
-    return KDBManagerVOpenTableUpdateInt ( self, tbl, self -> wd, path, args );
-}
-
-LIB_EXPORT rc_t CC KDatabaseOpenTableUpdate ( KDatabase *self,
-    KTable **tbl, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KDatabaseVOpenTableUpdate ( self, tbl, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDatabaseVOpenTableUpdate ( KDatabase *self,
-    KTable **tblp, const char *name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    if ( tblp == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
-
-    * tblp = NULL;
-
-    if ( self == NULL )
-        return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcDB, rcDatabase, rcOpening, rcDatabase, rcReadonly );
-
-    rc = KDBVMakeSubPath ( self -> dir,
-        path, sizeof path, "tbl", 3, name, args );
-    if ( rc == 0 )
-    {
-        rc = KDBManagerVOpenTableUpdateInt ( self -> mgr, tblp,
-            self -> dir, path, NULL );
-        if ( rc == 0 )
-        {
-            KTable *tbl = ( KTable* ) * tblp;
-            tbl -> db = KDatabaseAttach ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Locked
- *  returns non-zero if locked
- */
-LIB_EXPORT bool CC KTableLocked ( const KTable *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return false;
-
-    rc = KDBWritable ( self -> dir, "." );
-    return GetRCState ( rc ) == rcLocked;
-}
-
-
-/* Exists
- *  returns true if requested object exists
- *
- *  "type" [ IN ] - a KDBPathType
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT bool CC KTableVExists ( const KTable *self, uint32_t type, const char *name, va_list args )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptIndex:
-            ns = "idx";
-            break;
-
-        case kptColumn:
-            ns = "col";
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name, args );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile:
-            case kptDir:
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC KTableExists ( const KTable *self, uint32_t type, const char *name, ... )
-{
-    bool exists;
-
-    va_list args;
-    va_start ( args, name );
-
-    exists = KTableVExists ( self, type, name, args );
-
-    va_end ( args );
-
-    return exists;
-}
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-LIB_EXPORT bool CC KTableIsAlias ( const KTable *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        rc_t rc;
-        const char *ns;
-        char path [ 256 ];
-
-        switch ( type )
-        {
-        case kptIndex:
-            ns = "idx";
-            break;
-
-        case kptColumn:
-            ns = "col";
-            break;
-
-        default:
-            return false;
-        }
-
-        rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name );
-        if ( rc == 0 )
-        {
-            switch ( KDirectoryPathType ( self -> dir, path ) )
-            {
-            case kptFile | kptAlias:
-            case kptDir | kptAlias:
-                if ( resolved != NULL && rsize != 0 )
-                {
-                    const KDirectory *sub;
-                    rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
-                    * resolved = 0;
-                    if ( rc != 0 )
-                        PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
-                    else
-                    {
-                        rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
-                        KDirectoryRelease ( sub );
-                        if ( rc != 0 )
-                            PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
-                    }
-                }
-                return true;
-            }
-        }
-    }
-
-    if ( resolved != NULL && rsize != 0 )
-        * resolved = 0;
-
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-static
-rc_t KTableLockInt (const KTable  * self, char * path, size_t path_size,
-                        int type, const char * name, va_list args )
-{
-    rc_t rc;
-
-    if (self == NULL)
-        rc = RC ( rcDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    else if (name == NULL)
-        rc =  RC (rcDB, rcMgr, rcAccessing, rcPath, rcNull);
-
-    else
-    {
-        const char * ns;
-
-        ns = KDBGetNamespaceString (type);
-
-        switch (type)
-        {
-        default:
-            rc = RC (rcDB, rcMgr, rcAccessing, rcParam, rcInvalid);
-            break;
-        case kptColumn:
-        case kptIndex:
-            rc = KDBVMakeSubPath (self->dir, path, path_size, ns, strlen (ns),
-                                  name, args);
-            break;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVWritable (const KTable *self, uint32_t type, const char * name, va_list args )
-{
-    rc_t rc;
-    char path [ 256 ];
-
-    rc = KTableLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBWritable (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableWritable ( const KTable *self, uint32_t type, const char * name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVWritable ( self, type, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KTableVLock ( KTable *self, uint32_t type, const char * name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KTableLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBLockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableLock ( KTable *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVLock (self, type, name, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC KTableVUnlock ( KTable *self, uint32_t type, const char * name, va_list args )
-{
-    rc_t rc = 0;
-    char path [ 256 ];
-
-    rc = KTableLockInt (self, path, sizeof path, type, name, args);
-    if (rc == 0)
-        rc = KDBUnlockDir (self->dir, path);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableUnlock ( KTable *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, name );
-    rc = KTableVUnlock ( self, type, name, args );
-    va_end ( args );
-    return rc;
-}
-
-
-/* Rename
- */
-LIB_EXPORT rc_t CC KTableRenameColumn ( KTable *self, bool force, const char *from, const char *to )
-{
-    return KDBRename ( self -> dir, self -> mgr, kptColumn, force, from, to );
-}
-
-LIB_EXPORT rc_t CC KTableRenameIndex ( KTable *self, bool force, const char *from, const char *to )
-{
-    return KDBRename ( self -> dir, self -> mgr, kptIndex, force, from, to );
-}
-
-/* Alias
- */
-LIB_EXPORT rc_t CC KTableAliasColumn ( KTable *self, const char *col, const char *alias )
-{
-    return KDBAlias ( self -> dir, kptColumn, col, alias );
-}
-
-LIB_EXPORT rc_t CC KTableAliasIndex ( KTable *self, const char *idx, const char *alias )
-{
-    return KDBAlias ( self -> dir, kptIndex, idx, alias );
-}
-
-/* Drop
- */
-LIB_EXPORT rc_t CC KTableDropColumn ( KTable *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KTableVDropColumn ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVDropColumn ( KTable *self, const char *name, va_list args )
-{
-    return KDBVDrop ( self -> dir, self -> mgr, kptColumn, name, args );
-}
-
-LIB_EXPORT rc_t CC KTableDropIndex ( KTable *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = KTableVDropIndex ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableVDropIndex ( KTable *self, const char *name, va_list args )
-{
-    return KDBVDrop ( self -> dir, self -> mgr, kptIndex, name, args );
-}
-
-
-/* Reindex
- *  optimize column indices
- */
-LIB_EXPORT rc_t CC KTableReindex ( KTable *self )
-{
-    if ( self != NULL )
-    {
-        KNamelist *names;
-        rc_t rc = KTableListCol ( self, & names );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount ( names, & count );
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for ( i = 0; i < count; ++ i )
-                {
-                    KColumn *col;
-
-                    const char *name;
-                    rc = KNamelistGet ( names, i, & name );
-                    if ( rc != 0 )
-                        break;
-
-                    /* check it the column has idx0 data
-                       TBD - this whole operation goes away when
-                       idx0 is used for cursor sessions */
-                    if ( KTableColumnNeedsReindex ( self, name ) )
-                    {
-                        rc = KTableOpenColumnUpdate ( self, & col, name );
-                        if ( rc != 0 )
-                        {
-                            if ( GetRCState ( rc ) == rcBusy )
-                                continue;
-                            break;
-                        }
-
-                        rc = KColumnReindex ( col );
-                        KColumnRelease ( col );
-                        if ( rc != 0 )
-                            break;
-                    }
-                }
-            }
-
-            KNamelistRelease ( names );
-        }
-        return rc;
-    }
-    return RC ( rcDB, rcTable, rcReindexing, rcSelf, rcNull );
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KTableOpenManagerRead ( const KTable *self, const KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenManagerUpdate ( KTable *self, KDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC KTableOpenParentRead ( const KTable *self, const KDatabase **db )
-{
-    rc_t rc;
-
-    if ( db == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> db );
-            if ( rc == 0 )
-            {
-                * db = self -> db;
-                return 0;
-            }
-        }
-
-        * db = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenParentUpdate ( KTable *self, KDatabase **db )
-{
-    rc_t rc;
-
-    if ( db == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else if ( self -> db != NULL && self -> db -> read_only )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcDatabase, rcReadonly );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> db );
-            if ( rc == 0 )
-            {
-                * db = self -> db;
-                return 0;
-            }
-        }
-
-        * db = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenDirectory
- *  access the directory in use
- */
-LIB_EXPORT rc_t CC KTableOpenDirectoryRead ( const KTable *self, const KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTableOpenDirectoryUpdate ( KTable *self, KDirectory **dir )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-         else if ( self -> dir != NULL && self -> dir -> read_only )
-             rc = RC ( rcDB, rcTable, rcAccessing, rcDirectory, rcReadonly );
-        else
-        {
-            * dir = self -> dir;
-            return KDirectoryAddRef ( * dir );
-        }
-
-        * dir = NULL;
-    }
-
-    return rc;
-}
-
-
-/* ModDate
- *  get modification date
- */
-LIB_EXPORT rc_t CC KTableModDate ( const KTable *self, KTime_t *mtime )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self != NULL )
-            return KDBGetObjModDate ( self -> dir, mtime );
-
-        rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
-        * mtime = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-
-/* List
- *  create table listings
- */
-struct FilterData
-{
-    const KDBManager * mgr;
-    int type;
-};
-
-static
-bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
-{
-    struct FilterData * data = data_;
-
-    return KDBOpenPathTypeRead(data->mgr, dir, name, NULL, data->type, NULL, false) == 0;
-}
-
-LIB_EXPORT rc_t CC KTableListCol ( const KTable *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        struct FilterData data;
-        data.mgr = self->mgr;
-        data.type = kptColumn;
-
-        return KDirectoryVList ( self -> dir,
-            names, KDatabaseListFilter, &data, "col", NULL );
-    }
-    
-    if ( names != NULL )
-        * names = NULL;
-    
-    return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
-}
-
-static
-bool CC KTableListIdxFilter ( const KDirectory *dir, const char *name, void *data )
-{
-    const size_t sz = strlen(name);
-    
-    if (sz > 4 && strcmp(&name[sz - 4], ".md5") == 0)
-        return false;
-    return true;
-}
-
-static
-bool CC KTableListSkeyFilter ( const KDirectory *dir, const char *name, void *data )
-{
-    if ( strcmp ( name, "skey" ) == 0 )
-        return true;
-    return false;
-}
-
-LIB_EXPORT rc_t CC KTableListIdx ( const KTable *self, KNamelist **names )
-{
-    if ( self != NULL )
-    {
-        if ( ! self -> prerelease )
-        {
-            return KDirectoryVList ( self -> dir,
-                                    names, KTableListIdxFilter, NULL, "idx", NULL );
-        }
-        
-        return KDirectoryVList ( self -> dir,
-                                names, KTableListSkeyFilter, NULL, ".", NULL );
-    }
-    
-    if ( names != NULL )
-        * names = NULL;
-    
-    return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
-}
diff --git a/libs/kdb/wtrieidx-v1.c b/libs/kdb/wtrieidx-v1.c
deleted file mode 100644
index b5073c3..0000000
--- a/libs/kdb/wtrieidx-v1.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-#include "windex-priv.h"
-#include "kdbfmt-priv.h"
-#include <klib/ptrie.h>
-#include <klib/text.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/mmap.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#define DISABLE_PROJ 0
-#define LIMIT_INSERTS 0
-
-#if LIMIT_INSERTS
-#define INSERT_LIMIT 100000000
-#endif
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v1
- *  persisted keymap
- */
-
-/* KPTrieIndexInit
- *  opens and initializes persisted keymap structure
- */
-rc_t KPTrieIndexInit_v1 ( KPTrieIndex_v1 *self, const KMMap *mm, bool byteswap )
-{
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KDBHdr *hdr;
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* try to create the pttree */
-            rc = PTrieMakeOrig ( & self -> key2id,
-                hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* just in case */
-                    self -> mm = NULL;
-
-                    /* record for projection */
-                    self -> byteswap = byteswap;
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                    {
-                        self -> id2node = NULL;
-                        self -> first = self -> last = 0;
-                        return 0;
-                    }
-                            
-                    /* assume this is projection index */
-                    self -> id2node = ( void* )
-                        ( ( char* ) ( hdr + 1 ) + ptsize );
-                    size -= ptsize;
-                            
-                    /* it must have at least 4 bytes
-                       and be 4 byte aligned */
-                    if ( size >= sizeof ( uint32_t ) && ( size & 3 ) == 0 )
-                    {
-                        /* first entry is starting key
-                           remaining entries are node ids */
-                        self -> first = * self -> id2node ++;
-                        size -= sizeof self -> id2node [ 0 ];
-                        if ( size == 0 )
-                        {
-                            /* forget if empty */
-                            self -> id2node = NULL;
-                            self -> first = self -> last = 0;
-                            return 0;
-                        }
-                        /* remaining entries */
-                        self -> last = self -> first + ( size >> 2 ) - 1;
-                        return 0;
-                    }
-                }
-
-                PTrieWhack ( self -> key2id );
-                self -> key2id = NULL;
-
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* KPTrieIndexWhack_v1
- *  closes down keymap
- */
-void KPTrieIndexWhack_v1 ( KPTrieIndex_v1 *self )
-{
-    PTrieWhack ( self -> key2id );
-    KMMapRelease ( self -> mm );
-    memset ( self, 0, sizeof * self );
-}
-
-
-/*--------------------------------------------------------------------------
- * KTrieIdxNode_v1
- */
-
-static
-void CC KTrieIdxNodeWhack_v1 ( TNode *n, void *data )
-{
-    TNodeWhack ( n );
-}
-
-static
-void CC KTrieIdxNodeUnlink_v1 ( TNode *n, void *data )
-{
-    if ( TrieUnlink ( data, n ) )
-        TNodeWhack ( n );
-}
-
-static
-void CC KTrieIdxNodeCaptureID_v1 ( TNode *n, void *data )
-{
-    KTrieIndex_v1 *self = data;
-    KTrieIdxNode_v1 *node = ( KTrieIdxNode_v1* ) n;
-    self -> id2node [ node -> id - self -> first ] = node;
-}
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v1
- */
-
-/* KTrieIndexWrite_v1
- */
-typedef struct PersistTrieData PersistTrieData;
-struct PersistTrieData
-{
-    uint64_t pos;
-    KFile *f;
-    uint8_t *buffer;
-    size_t bsize;
-    size_t marker;
-
-    size_t ptt_size;
-    uint32_t first;
-    uint32_t last;
-    rc_t rc;
-};
-
-static
-rc_t CC KTrieIndexWrite_v1 ( void *param,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    PersistTrieData *pb = param;
-    size_t total, to_write;
-
-    for ( total = 0; total < size; total += to_write )
-    {
-        to_write = size - total;
-        if ( pb -> marker + to_write > pb -> bsize )
-            to_write = pb -> bsize - pb -> marker;
-
-        if ( to_write > 0 )
-        {
-            memcpy ( pb -> buffer + pb -> marker,
-                ( const uint8_t* ) buffer + total, to_write );
-            pb -> marker += to_write;
-        }
-
-        if ( pb -> marker == pb -> bsize )
-        {
-            size_t num_flushed;
-            pb -> rc = KFileWrite ( pb -> f, pb -> pos,
-                pb -> buffer, pb -> bsize, & num_flushed );
-            if ( pb -> rc != 0 )
-            {
-                * num_writ = 0;
-                return pb -> rc;
-            }
-
-            if ( num_flushed == 0 )
-            {
-                * num_writ = total + to_write;
-                return pb -> rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-            }
-
-            pb -> marker -= num_flushed;
-            pb -> pos += num_flushed;
-
-            if ( pb -> marker != 0 )
-                memcpy ( pb -> buffer, pb -> buffer + num_flushed, pb -> marker );
-        }
-    }
-
-    * num_writ = total;
-    return 0;
-}
-
-/* KTrieIndexAux_v1
- */
-static
-rc_t CC KTrieIndexAux_v1 ( void *param, const void *node, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    const KTrieIdxNode_v1 *n = node;
-
-    if ( write != NULL )
-    {
-        PersistTrieData *pb = param;
-        if ( n -> id < pb -> first )
-            pb -> first = n -> id;
-        if ( n -> id > pb -> last )
-            pb -> last = n -> id;
-
-        return ( * write ) ( write_param, & n -> id, sizeof n -> id, num_writ );
-    }
-
-    * num_writ = sizeof n -> id;
-    return 0;
-}
-
-/* KTrieIndexPersist_v1
- *  write keymap to indicated location
- */
-static
-rc_t KTrieIndexPersistTrie_v1 ( const KTrieIndex_v1 *self, PersistTrieData *pb )
-{
-    rc_t rc;
-    KDBHdr *hdr;
-
-    pb -> pos = 0;
-
-    hdr = ( KDBHdr* ) pb -> buffer;
-    KDBHdrInit ( hdr, 1 );
-    pb -> marker = sizeof * hdr;
-
-    /* persist the trie to file,
-       using tree-internal key storage,
-       capture the image size in pb */
-    rc = TriePersist ( & self -> key2id, & pb -> ptt_size,
-        false, KTrieIndexWrite_v1, pb, KTrieIndexAux_v1, pb );
-    if ( rc == 0 && pb -> marker != 0 )
-    {
-        size_t num_writ;
-        rc = KFileWrite ( pb -> f, pb -> pos,
-            pb -> buffer, pb -> marker, & num_writ );
-        if ( rc == 0 && num_writ != pb -> marker )
-            rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-    }
-
-    return rc;
-}
-
-
-typedef struct PersistReverseData PersistReverseData;
-struct PersistReverseData
-{
-    PTrie *tt;
-    uint32_t *a;
-    uint32_t first;
-    uint32_t count;
-    uint32_t notfound;
-};
-
-static
-void CC KTrieIndexRecordNodeId_v1 ( TNode *node, void *data )
-{
-    PTNode pn;
-    PersistReverseData *pb = data;
-    const KTrieIdxNode_v1 *n = ( const KTrieIdxNode_v1* ) node;
-
-    /* lookup up the persisted node within image */
-    uint32_t id = PTrieFind ( pb -> tt, & n -> n . key, & pn, NULL, NULL );
-
-    /* write it into array */
-    pb -> a [ n -> id - pb -> first ] = ( uint32_t ) id;
-
-    if ( id == 0 )
-        ++ pb -> notfound;
-    else
-        ++ pb -> count;
-}
-
-static
-rc_t KTrieIndexPersistProj_v1 ( const KTrieIndex_v1 *self, PersistTrieData *pb )
-{
-#if 0
-    rc_t rc;
-    KMMap *mmr;
-    size_t map_size;
-
-    /* there must be something to do */
-    if ( pb -> first > pb -> last )
-        return 0;
-
-
-    /* open a read-write map onto file
-       start at offset 0, which is the header,
-       followed by pb -> ptt_size bytes which is the tree,
-       and add on a slot for first id,
-       followed by last - first + 1 slots for id to node id map */
-    map_size = pb -> ptt_size + ( ( pb -> last - pb -> first + 2 ) << 2 );
-
-    rc = KMMapMakeRgnUpdate ( & mmr, pb -> f, sizeof ( KDBHdr ), map_size );
-    if ( rc == 0 )
-    {
-        void *addr;
-        PersistReverseData pb2;
-
-        rc = KMMapAddrUpdate ( mmr, & addr );
-        if ( rc == 0 )
-        {
-            rc = PTrieMakeOrig ( & pb2 . tt, addr, pb -> ptt_size );
-            if ( rc == 0 )
-            {
-                assert ( pb -> ptt_size == PTrieSize ( pb2 . tt ) );
-                pb2 . a = ( void* ) ( ( char* ) addr + pb -> ptt_size );
-                assert ( ( ( size_t ) pb2 . a & 3 ) == 0 );
-
-                /* record first id */
-                * pb2 . a ++ = pb -> first;
-                pb2 . first = pb -> first;
-                pb2 . count = pb2 . notfound = 0;
-
-                /* record all id to node mappings */
-                TrieForEach ( & self -> key2id, KTrieIndexRecordNodeId_v1, & pb2 );
-
-                /* check for having written ids */
-                assert ( pb2 . count == PTrieCount ( pb2 . tt ) );
-
-                /* done with pttree */
-                PTrieWhack ( pb2 . tt );
-
-                /* if there were nodes not found,
-                   the initial persist was bad */
-                if ( pb2 . notfound != 0 )
-                    rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-            }
-        }
-
-        /* done with map - commits changes to disk */
-        KMMapRelease ( mmr );
-
-        /* truncate file to desired size */
-        KFileSetSize ( pb -> f, map_size + sizeof ( KDBHdr ) );
-    }
-
-    return rc;
-#else
-    rc_t rc;
-    void * addr;
-    uint64_t file_size;
-    size_t num_to_read;
-    size_t map_size;
-
-    /* there must be something to do */
-    if ( pb -> first > pb -> last )
-        return 0;
-
-    /* open a read-write map onto file
-       start at offset 0, which is the header,
-       followed by pb -> ptt_size bytes which is the tree,
-       and add on a slot for first id,
-       followed by last - first + 1 slots for id to node id map */
-    map_size = pb -> ptt_size + ( ( pb -> last - pb -> first + 2 ) << 2 );
-
-    rc = KFileSize ( pb -> f, & file_size );
-    if ( rc == 0 )
-    {
-        addr = malloc ( map_size );
-        if ( addr == NULL )
-            rc = RC ( rcDB, rcIndex, rcPersisting, rcMemory, rcExhausted );
-        else
-        {
-            size_t num_read;
-            num_to_read = file_size - sizeof ( KDBHdr );
-            rc = KFileReadAll ( pb -> f, sizeof ( KDBHdr ),
-                addr, num_to_read, & num_read );
-            if ( rc != 0 )
-                free ( addr );
-            else if ( num_read != num_to_read )
-            {
-                free ( addr );
-                rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        PersistReverseData pb2;
-
-        rc = PTrieMakeOrig ( & pb2 . tt, addr, pb -> ptt_size, false );
-        if ( rc == 0 )
-        {
-            assert ( pb -> ptt_size == PTrieSize ( pb2 . tt ) );
-            pb2 . a = ( void* ) ( ( char* ) addr + pb -> ptt_size );
-            assert ( ( ( size_t ) pb2 . a & 3 ) == 0 );
-
-            /* record first id */
-            * pb2 . a ++ = pb -> first;
-            pb2 . first = pb -> first;
-            pb2 . count = pb2 . notfound = 0;
-
-            /* record all id to node mappings */
-            TrieForEach ( & self -> key2id, KTrieIndexRecordNodeId_v1, & pb2 );
-
-            /* check for having written ids */
-            assert ( pb2 . count == PTrieCount ( pb2 . tt ) );
-
-            /* done with pttree */
-            PTrieWhack ( pb2 . tt );
-
-            /* if there were nodes not found,
-               the initial persist was bad */
-            if ( pb2 . notfound != 0 )
-                rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-            else
-            {
-                rc = KFileWrite ( pb -> f, file_size, ( uint8_t* ) addr + num_to_read,
-                    map_size - num_to_read, & num_writ );
-                if ( rc == 0  && num_writ != map_size - num_to_read )
-                    rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-            }
-        }
-
-        /* done with map - commits changes to disk */
-        free ( addr );
-
-        /* truncate file to desired size */
-        KFileSetSize ( pb -> f, map_size + sizeof ( KDBHdr ) );
-    }
-
-    return rc;
-#endif
-}
-
-rc_t KTrieIndexPersist_v1 ( const KTrieIndex_v1 *self,
-    bool proj, KDirectory *dir, const char *path, bool use_md5 )
-{
-    rc_t rc;
-    PersistTrieData pb;
-
-    assert ( self != NULL );
-
-    pb . buffer = malloc ( pb . bsize = 32 * 1024 );
-    if ( pb . buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        char tmpname [ 256 ];
-        char tmpmd5name [ 256 ];
-        char md5path [ 256 ];
-        rc = KDirectoryResolvePath ( dir, false,
-            tmpname, sizeof tmpname, "%s.tmp", path );
-        if ( rc == 0 )
-        {
-            rc = KDirectoryVCreateFile ( dir, & pb . f,
-                true, 0664, kcmInit, tmpname, NULL );
-
-	    if (use_md5 && rc == 0 )
-	    {
-		size_t tmplen = snprintf ( tmpmd5name, sizeof tmpmd5name, "%s.md5", tmpname );
-		KFile * kf;
-		KMD5SumFmt *km;
-		if ( tmplen >= sizeof ( tmpmd5name ) ) /* can't be == or no NUL */
-		{
-		    rc = RC ( rcDB, rcIndex, rcPersisting, rcName, rcExcessive );
-		}
-		else
-		{
-		    tmplen = snprintf ( md5path, sizeof md5path, "%s.md5", path );
-		    
-		    if ( tmplen >= sizeof ( md5path ) ) /* can't be == or no NUL */
-		    {
-			rc = RC ( rcDB, rcIndex, rcPersisting, rcName, rcExcessive );
-		    }
-		    else
-		    {
-			rc = KDirectoryVCreateFile ( dir, &kf, true, 0664, 
-						     kcmInit, tmpmd5name, NULL );
-			if ( rc == 0 )
-			{
-			    rc = KMD5SumFmtMakeUpdate ( &km, kf );
-			    if ( rc == 0 )
-			    {
-				KMD5File * k5f;
-				kf = NULL;
-				rc = KMD5FileMakeWrite ( &k5f, pb . f, km, path );
-				if ( rc == 0 )
-				{
-				    pb . f = KMD5FileToKFile ( k5f );
-				}
-				/* release pass or fail */
-				KMD5SumFmtRelease ( km );
-			    }
-			    else
-				KFileRelease ( kf );
-			}
-			else
-			    KFileRelease ( kf );
-		    }
-		}
-		if ( rc != 0 )
-		    KFileRelease ( pb . f );
-	    }
-
-            if ( rc == 0 )
-            {
-                pb . ptt_size = 0;
-                pb . first = ~ 0;
-                pb . last = 0;
-
-                rc = KTrieIndexPersistTrie_v1 ( self, & pb );
-                if ( rc == 0 )
-                {
-                    if ( proj )
-                        rc = KTrieIndexPersistProj_v1 ( self, & pb );
-                }
-                
-                KFileRelease ( pb . f );
-                pb . f = NULL;
-            }
-        }
-        
-        free ( pb . buffer );
-        pb . buffer = NULL;
-        
-        if ( rc == 0 )
-        {
-            rc = KDirectoryRename ( dir, false, tmpname, path );                        
-            if ( rc == 0 )
-            {
-		if ( use_md5 )
-		    rc = KDirectoryRename ( dir, false, tmpmd5name, md5path );                        
-		if ( rc == 0 )
-		{
-		    /* done */
-		    return 0;
-		}
-            }
-        }
-        
-        /* whack temporary file */
-        KDirectoryVRemove ( dir, false, tmpname, NULL );
-	if ( use_md5 )
-	    KDirectoryVRemove ( dir, false, tmpmd5name, NULL );
-    }
-    
-    return rc;
-}
-
-
-/* whack whack */
-void KTrieIndexWhack_v1 ( KTrieIndex_v1 *self )
-{
-    KPTrieIndexWhack_v1 ( & self -> pt );
-    TrieWhack ( & self -> key2id, KTrieIdxNodeWhack_v1, NULL );
-}
-
-/* initialize an index from file - can be NULL */
-rc_t KTrieIndexOpen_v1 ( KTrieIndex_v1 *self, const KMMap *mm, bool byteswap )
-{
-    rc_t rc;
-
-    memset ( self, 0, sizeof * self );
-    rc = TrieInit ( & self -> key2id, "0-9", 512, true );
-    if ( rc != 0 )
-        return rc;
-
-    self -> first = ~ 0;
-
-    if ( mm == NULL )
-        return 0;
-
-    rc = KPTrieIndexInit_v1 ( & self -> pt, mm, byteswap );
-    if ( rc == 0 )
-    {
-        rc = KMMapAddRef ( mm );
-        if ( rc == 0 )
-        {
-            self -> pt . mm = mm;
-            return 0;
-        }
-    }
-
-    KTrieIndexWhack_v1 ( self );
-    return rc;
-}
-
-/* KTrieIndexPopulate_v1
- */
-typedef struct KTrieIndexPopulateData_v1 KTrieIndexPopulateData_v1;
-struct KTrieIndexPopulateData_v1
-{
-    KTrieIndex_v1 *idx;
-    uint32_t id;
-    rc_t rc;
-};
-
-static
-bool CC KTrieIndexPopulate_v1 ( PTNode *n, void *data )
-{
-    const String *key;
-    KTrieIndexPopulateData_v1 *pb = data;
-
-    /* capture node id */
-    uint32_t id;
-    assert ( n -> data . size == sizeof id );
-    memcpy ( & id, n -> data . addr, sizeof id );
-
-    /* reject already mapped */
-    if ( id == pb -> id )
-    {
-        pb -> rc = RC ( rcDB, rcIndex, rcConstructing, rcNode, rcExists );
-        return true;
-    }
-
-    pb -> rc = PTNodeMakeKey ( n, & key );
-    if ( pb -> rc == 0 )
-    {
-        KTrieIdxNode_v1 *node;
-        pb -> rc = TNodeMake ( ( TNode** ) & node,
-            sizeof * node + key -> size );
-        if ( pb -> rc == 0 )
-        {
-            KTrieIndex_v1 *self = pb -> idx;
-
-            StringInit ( & node -> n . key, node -> key, key -> size, key -> len );
-            node -> id = id;
-            string_copy ( node -> key, key -> size + 1,
-                key -> addr, key -> size );
-
-            pb -> rc = TrieInsert ( & self -> key2id, & node -> n );
-            if ( pb -> rc == 0 )
-            {
-                free ( ( void* ) key );
-    
-                /* if copying projection index */
-                if ( self -> id2node != NULL )
-                {
-                    if ( self -> pt . id2node != NULL )
-                        self -> id2node [ node -> id - self -> pt . first ] = node;
-                    else
-                    {
-                        if ( node -> id < self -> first )
-                            self -> first = node -> id;
-                        if ( node -> id > self -> last )
-                            self -> last = node -> id;
-                    }
-                }
-                return 0;
-            }
-
-            TNodeWhack ( & node -> n );
-        }
-
-        StringWhack ( ( String* ) key );
-    }
-
-    return true;
-}
-
-/* KTrieIndexAttach_v1
- *  attach a keymap to an existing table
- *
- *  "pkm" [ IN ] - a persisted keymap
- */
-static
-rc_t KTrieIndexAttach_v1 ( KTrieIndex_v1 *self, bool proj, uint32_t id )
-{
-    uint32_t proj_len;
-    KTrieIndexPopulateData_v1 pb;
-
-#if LIMIT_INSERTS
-    proj_len = self -> pt . last - self -> pt . first + 1;
-#endif
-
-    /* see if we can use existing projection index */
-    if ( proj && self -> pt . id2node != NULL )
-    {
-        /* reject if already mapped */
-        if ( id != 0 &&
-             id >= self -> pt . first &&
-             id <= self -> pt . last &&
-             self -> pt . id2node [ id - self -> pt . first ] != 0 )
-        {
-            return RC ( rcDB, rcIndex, rcUpdating, rcId, rcExists );
-        }
-
-        /* allocate index array */
-#if LIMIT_INSERTS
-        if ( proj_len > INSERT_LIMIT )
-            return RC ( rcDB, rcIndex, rcUpdating, rcRange, rcExcessive );
-#else
-        proj_len = self -> pt . last - self -> pt . first + 1;
-#endif
-        proj_len = ( proj_len + 4095 ) & - 4096;
-        self -> id2node = calloc ( proj_len, sizeof self -> id2node [ 0 ] );
-        if ( self -> id2node == NULL )
-            return RC ( rcDB, rcIndex, rcUpdating, rcMemory, rcExhausted );
-
-        /* record known dimensions */
-        self -> first = self -> pt . first;
-        self -> last = self -> pt . last;
-        self -> len = proj_len;
-    }
-
-#if LIMIT_INSERTS
-    else if ( proj_len > INSERT_LIMIT )
-        return RC ( rcDB, rcIndex, rcUpdating, rcRange, rcExcessive );
-#endif
-
-    /* inflate persisted trie */
-    pb . idx = self;
-    pb . id = id;
-    pb . rc = 0;
-    PTrieDoUntil ( self -> pt . key2id, KTrieIndexPopulate_v1, & pb );
-
-    /* if successful but needing to add projection index */
-    if ( pb . rc == 0 && proj && self -> id2node == NULL )
-    {
-        proj_len = self -> last - self -> first + 1;
-        proj_len = ( proj_len + 4095 ) & - 4096;
-        self -> id2node = calloc ( proj_len, sizeof self -> id2node [ 0 ] );
-        if ( self -> id2node == NULL )
-            pb . rc = RC ( rcDB, rcIndex, rcUpdating, rcMemory, rcExhausted );
-        else
-        {
-            self -> len = proj_len;
-            TrieForEach ( & self -> key2id, KTrieIdxNodeCaptureID_v1, self );
-        }
-    }
-
-    if ( pb . rc == 0 )
-        KPTrieIndexWhack_v1 ( & self -> pt );
-    else if ( self -> id2node != NULL )
-    {
-        TrieForEach ( & self -> key2id,
-            KTrieIdxNodeUnlink_v1, & self -> key2id );
-        free ( self -> id2node );
-        self -> id2node = NULL;
-        self -> first = ~0;
-        self -> last = 0;
-        self -> len = 0;
-    }
-    return pb . rc;
-}
-
-/* insert string into trie, mapping to 32 bit id */
-static
-rc_t KTrieIndexExpandId2Node_v1 ( KTrieIndex_v1 *self, uint32_t range )
-{
-    KTrieIdxNode_v1 **id2node;
-    range = ( range + 4095 ) & - 4096;
-    id2node = realloc ( self -> id2node, range * sizeof id2node [ 0 ] );
-    if ( id2node == NULL )
-        return RC ( rcDB, rcIndex, rcInserting, rcMemory, rcExhausted );
-
-    self -> id2node = id2node;
-
-#if ZERO_ID2NODE
-    /* why zero this when it is known to be invalid? */
-    memset ( id2node + self -> len, 0,
-        ( range - self -> len ) * sizeof id2node [ 0 ] );
-#endif
-
-    self -> len = range;
-
-    return 0;
-}
-
-rc_t KTrieIndexInsert_v1 ( KTrieIndex_v1 *self,
-    bool proj, const char *str, uint32_t id )
-{
-    rc_t rc;
-
-    String key;
-    KTrieIdxNode_v1 *node;
-
-#if DISABLE_PROJ
-    proj = false;
-#endif
-
-    /* detect first modification */
-    if ( self -> last < self -> first )
-    {
-        /* detect persisted data */
-        if ( self -> pt . key2id != NULL )
-        {
-            rc = KTrieIndexAttach_v1 ( self, proj, id );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* create empty projection array */
-        else if ( proj )
-        {
-            self -> id2node = malloc ( 4096 * sizeof self -> id2node [ 0 ] );
-            if ( self -> id2node == NULL )
-                return RC ( rcDB, rcIndex, rcInserting, rcMemory, rcExhausted );
-            self -> first = self -> last = id;
-            self -> len = 4096;
-        }
-    }
-
-    /* reject if already mapped */
-    else if ( self -> id2node != NULL &&
-              id >= self -> first &&
-              id <= self -> last &&
-              self -> id2node [ id - self -> first ] != NULL )
-    {
-        return RC ( rcDB, rcIndex, rcInserting, rcId, rcExists );
-    }
-#if LIMIT_INSERTS && INSERT_LIMIT > 0
-    else if ( ( self -> last - self -> first ) >= ( INSERT_LIMIT - 1 ) )
-    {
-        return RC ( rcDB, rcIndex, rcUpdating, rcRange, rcExcessive );
-    }
-#endif
-
-    StringInitCString ( & key, str );
-    rc = TNodeMake ( ( TNode** ) & node, sizeof * node + key . size );
-    if ( rc != 0 )
-        rc = RC ( rcDB, rcIndex, rcInserting, rcMemory, rcExhausted );
-    else
-    {
-        StringInit ( & node -> n . key, node -> key, key . size, key . len );
-        node -> id = id;
-        strcpy ( node -> key, str );
-
-        rc = TrieInsertUnique ( & self -> key2id, & node -> n, NULL );
-        if ( rc != 0 )
-            TNodeWhack ( & node -> n );
-        else if ( proj )
-        {
-            uint32_t range, offset;
-
-            if ( id < self -> first )
-            {
-                range = self -> last - id + 1;
-                if ( range > self -> len )
-                {
-                    rc = KTrieIndexExpandId2Node_v1 ( self, range );
-                    if ( rc != 0 )
-                    {
-                        TrieUnlink ( & self -> key2id, & node -> n );
-                        KTrieIdxNodeWhack_v1 ( & node -> n, NULL );
-                        return rc;
-                    }
-                }
-
-                offset = self -> first - id;
-                memmove ( & self -> id2node [ offset ], self -> id2node,
-                    ( self -> last - self -> first + 1 ) * sizeof self -> id2node [ 0 ] );
-                memset ( & self -> id2node [ 1 ], 0,
-                    ( offset - 1 ) * sizeof self -> id2node [ 0 ] );
-
-                self -> first = id;
-            }
-            else if ( id > self -> last )
-            {
-                range = id - self -> first + 1;
-                if ( range > self -> len )
-                {
-                    rc = KTrieIndexExpandId2Node_v1 ( self, range );
-                    if ( rc != 0 )
-                    {
-                        TrieUnlink ( & self -> key2id, & node -> n );
-                        KTrieIdxNodeWhack_v1 ( & node -> n, NULL );
-                        return rc;
-                    }
-                }
-
-                offset = id - 1 - self -> last;
-                if ( offset > 0 )
-                {
-                    memset ( & self -> id2node [ self -> last - self -> first + 1 ],
-                        0, offset * sizeof self -> id2node [ 0 ] );
-                }
-
-                self -> last = id;
-            }
-
-            assert ( self -> id2node != NULL );
-            self -> id2node [ id - self -> first ] = node;
-        }
-    }
-
-    return rc;
-}
-
-/* drop string from trie and all mappings */
-rc_t KTrieIndexDelete_v1 ( KTrieIndex_v1 *self, bool proj, const char *str )
-{
-    rc_t rc;
-
-    String key;
-    KTrieIdxNode_v1 *node;
-
-#if DISABLE_PROJ
-    proj = 0;
-#endif
-
-    /* detect first modification */
-    if ( self -> last < self -> first )
-    {
-        /* detect persisted data */
-        if ( self -> pt . key2id != NULL )
-        {
-            rc = KTrieIndexAttach_v1 ( self, proj, 0 );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* create empty projection array */
-        else if ( proj )
-        {
-            self -> id2node = malloc ( 4096 * sizeof self -> id2node [ 0 ] );
-            if ( self -> id2node == NULL )
-                return RC ( rcDB, rcIndex, rcRemoving, rcMemory, rcExhausted );
-            self -> first = self -> last = 0;
-            self -> len = 4096;
-        }
-    }
-
-    /* interface states that all objects are dropped.
-       however, this implementation only allows unique
-       mappings, so a simple find is sufficient */
-    StringInitCString ( & key, str );
-    node = ( KTrieIdxNode_v1* ) TrieFind ( & self -> key2id, & key );
-    if ( node == NULL )
-        return RC ( rcDB, rcIndex, rcRemoving, rcString, rcNotFound );
-
-    /* drop from projection index */
-    if ( self -> id2node != NULL &&
-         node -> id >= self -> first &&
-         node -> id <= self -> last )
-    {
-        assert ( self -> id2node [ node -> id - self -> first ] == node );
-        if ( node -> id == self -> last )
-        {
-            if ( -- self -> last < self -> first )
-            {
-                free ( self -> id2node );
-                self -> id2node = NULL;
-                self -> len = 0;
-            }
-        }
-        else if ( node -> id == self -> first )
-        {
-            memcpy ( self -> id2node, self -> id2node + 1,
-                ( self -> last - self -> first ) * sizeof self -> id2node [ 0 ] );
-            ++ self -> first;
-        }
-        else
-        {
-            self -> id2node [ node -> id - self -> first ] = NULL;
-        }
-    }
-
-    TrieUnlink ( & self -> key2id, & node -> n );
-    KTrieIdxNodeWhack_v1 ( & node -> n, NULL );
-
-    return 0;
-}
-
-/* map key to id ( was Key2Id ) */
-rc_t KTrieIndexFind_v1 ( const KTrieIndex_v1 *self, const char *str, uint32_t *id,
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void * data )
-{
-    String key;
-
-    if ( self -> last < self -> first )
-    {
-        if ( self -> pt . key2id != NULL )
-        {
-            PTNode n;
-            uint32_t nid;
-            StringInitCString ( & key, str );
-            nid = PTrieFind ( self -> pt . key2id, & key, & n, custom_cmp ,data);
-            if ( nid != 0 )
-            {
-                assert ( n . data . size == sizeof * id );
-                memcpy ( id, n . data . addr, sizeof * id );
-                return 0;
-            }
-        }
-    }
-    else
-    {
-        const KTrieIdxNode_v1 *n;
-
-        StringInitCString ( & key, str );
-        n = ( const KTrieIdxNode_v1* ) TrieFind ( & self -> key2id, & key );
-        if ( n != NULL )
-        {
-            * id = n -> id;
-            return 0;
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-}
-
-/* projection index id to key-string ( was Id2Key ) */
-rc_t KTrieIndexProject_v1 ( const KTrieIndex_v1 *self,
-    uint32_t id, char *key_buff, size_t buff_size, size_t *actsize )
-{
-    if ( self -> last < self -> first )
-    {
-        if ( self -> pt . id2node != NULL &&
-             id >= self -> pt . first &&
-             id <= self -> pt . last )
-        {
-            PTNode n;
-            uint32_t node = self -> pt . id2node [ id - self -> pt . first ];
-            rc_t rc = PTrieGetNode ( self -> pt . key2id,
-                & n, self -> pt . byteswap ? bswap_32 ( node ) : node );
-            if ( rc == 0 )
-            {
-                const String *key;
-                rc = PTNodeMakeKey ( & n, & key );
-                if ( rc == 0 )
-                {
-                    if (actsize)
-                        *actsize = key -> size;
-                    
-                    if ( key -> size >= buff_size )
-                        rc = RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                    else
-                        string_copy ( key_buff, buff_size, key -> addr, key -> size );
-
-                    StringWhack ( ( String* ) key );
-                    return rc;
-                }
-            }
-        }
-    }
-    else
-    {
-        if ( self -> id2node != NULL &&
-             id >= self -> first &&
-             id <= self -> last )
-        {
-            const KTrieIdxNode_v1 *n = self -> id2node [ id - self -> first ];
-            if ( n != NULL )
-            {
-                if ( n -> n . key . size >= buff_size )
-                    return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                string_copy ( key_buff, buff_size,
-                    n -> n . key . addr, n -> n . key . size );
-                return 0;
-            }
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-}
diff --git a/libs/kdb/wtrieidx-v2.c b/libs/kdb/wtrieidx-v2.c
deleted file mode 100644
index b3dd8ab..0000000
--- a/libs/kdb/wtrieidx-v2.c
+++ /dev/null
@@ -1,2560 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "windex-priv.h"
-#include "trieidx-priv.h"
-
-#include <kdb/index.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/mmap.h>
-#include <klib/ptrie.h>
-#include <klib/text.h>
-#include <klib/pack.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <byteswap.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#define KTRIE_ZEROS_KPTRIE 1
-
-/*--------------------------------------------------------------------------
- * KPTrieIndex_v2
- *  persisted keymap
- */
-
-
-/* Init
- *  opens and initializes persisted keymap structure
- */
-static
-rc_t KPTrieIndexInitID2Ord ( KPTrieIndex_v2 *self, size_t in_size,
-    int variant, int span_bits, int elem_bits )
-{
-    rc_t rc;
-    union
-    {
-        uint8_t *v8;
-        uint16_t *v16;
-        uint32_t *v32;
-        uint64_t *v64;
-    } dst;
-    size_t elem_bytes = elem_bits >> 3;
-    uint32_t scount = self -> count - 1;
-
-    assert ( self -> count != 0 );
-
-    if ( span_bits * scount > in_size * 8 )
-        return RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-
-    dst . v8 = malloc ( self -> count * elem_bytes );
-    if ( dst . v8 == NULL )
-        rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t usize;
-        rc = Unpack ( span_bits, elem_bits,
-            & self -> ord2node [ self -> count ], 0,
-            span_bits * scount, NULL, & dst . v8 [ elem_bytes ],
-            scount * elem_bytes, & usize );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-
-            self -> id2ord . v8 = dst . v8;
-            self -> variant = variant;
-
-            /* integrate to simple translation */
-            switch ( variant )
-            {
-            case 1:
-                dst . v8 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v8 [ i + 1 ] += dst . v8 [ i ];
-                break;
-            case 2:
-                dst . v16 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v16 [ i + 1 ] += dst . v16 [ i ];
-                break;
-            case 3:
-                dst . v32 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v32 [ i + 1 ] += dst . v32 [ i ];
-                break;
-            case 4:
-                dst . v64 [ 0 ] = 0;
-                for ( i = 0; i < scount; ++ i )
-                    dst . v64 [ i + 1 ] += dst . v64 [ i ];
-                break;
-            }
-
-            return 0;
-        }
-
-        free ( dst . v8 );
-    }
-
-    return rc;
-}
-
-static
-void CC KPTrieIndexExtractV1Range_v2 ( PTNode *n, void *data )
-{
-    KPTrieIndex_v2 *self = data;
-
-    /* capture node id */
-    uint32_t id;
-    assert ( n -> data . size == sizeof id );
-    memcpy ( & id, n -> data . addr, sizeof id );
-
-    /* perform min/max */
-    if ( self -> count == 0 )
-        self -> first = self -> last = id;
-    else if ( id < self -> first )
-        self -> first = id;
-    else if ( id > self -> last )
-        self -> last = id;
-
-    ++ self -> count;
-}
-
-static
-rc_t KPTrieIndexInitFromV1_v2 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    KPTrieIndex_v1 v1;
-    rc_t rc = KPTrieIndexInit_v1 ( & v1, mm, byteswap );
-    if ( rc == 0 )
-    {
-        uint32_t *ord2node;
-        uint32_t total_id, test_id;
-        uint32_t i, id, id_bits, num_ids;
-
-        /* hopefully we got a projection index */
-        if ( v1 . id2node == NULL )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> count = 0;
-#endif
-            /* need to derive first and last from trie */
-            PTrieForEach ( v1 . key2id, KPTrieIndexExtractV1Range_v2, self );
-            if ( self -> count == 0 )
-                KPTrieIndexWhack_v1 ( & v1 );
-            else
-            {
-                /* take trie as-is */
-                self -> key2id = v1 . key2id;
-                self -> maxid = self -> last;
-            }
-
-            /* note that this assumes a span of 1 for
-               each id. there are no known uses of v1 without
-               a projection index, so this is unlikely to be important */
-
-            return 0;
-        }
-
-        /* take id range */
-        self -> first = v1 . first;
-        self -> last = self -> maxid = v1 . last;
-
-        /* count comes from trie as always */
-        self -> count = PTrieCount ( v1 . key2id );
-
-        /* detect empty trie */
-        if ( self -> count == 0 || self -> first > self -> last )
-        {
-            self -> first = self -> last = self -> maxid = 0;
-            return 0;
-        }
-
-        /* take trie as-is */
-        self -> key2id = v1 . key2id;
-
-        /* now decide whether to use 1-1 or sparse projection */
-        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-        {
-            /* take the old projection array as-is,
-               treating NULL node ids as holes */
-            self -> ord2node = v1 . id2node;
-            return 0;
-        }
-
-        /* convert to sparse
-           calculate id bits - notice that
-           total_id gets right shifted so that
-           the loop is guaranteed to exit */
-        num_ids = ( uint32_t ) ( self -> last - self -> first + 1 );
-        for ( total_id = num_ids >> 1, id_bits = 1, test_id = 1;
-            test_id <= total_id;
-            ++ id_bits, test_id <<= 1 )
-            ( void ) 0;
-
-        /* determine variant */
-        if ( id_bits <= 8 )
-        {
-            /* allocate 4 bytes for new ord2node and 1 for id2ord */
-            uint8_t *id2ord = malloc ( self -> count * 5 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = ( uint32_t* ) & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v8 = id2ord;
-                self -> variant = 1;
-
-                /* walk across v1 table, looking at each id */
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    /* detect non NULL node ids
-                       and pretend they represent a contiguous
-                       span with no holes in id space */
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        /* prevent overwriting */
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        /* record id and node for slot */
-                        id2ord [ i ] = ( uint8_t ) id;
-                        ord2node [ i ] = v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-        else if ( id_bits <= 16 )
-        {
-            uint16_t *id2ord = malloc ( self -> count * 6 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = ( uint32_t* ) & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v16 = id2ord;
-                self -> variant = 2;
-
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        id2ord [ i ] = ( uint16_t ) id;
-                        ord2node [ i ] = v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-        else
-        {
-            uint32_t *id2ord = malloc ( self -> count * 8 );
-            if ( id2ord == NULL )
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                ord2node = & id2ord [ self -> count ];
-                self -> ord2node = ord2node;
-                self -> id2ord . v32 = id2ord;
-                self -> variant = 3;
-
-                for ( i = id = 0; id < num_ids; ++ id )
-                {
-                    if ( v1 . id2node [ id ] != 0 )
-                    {
-                        if ( i == self -> count )
-                        {
-                            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-                            break;
-                        }
-
-                        id2ord [ i ] = id;
-                        ord2node [ i ] = v1 . id2node [ id ];
-                        ++ i;
-                    }
-                }
-            }
-        }
-
-        if ( rc == 0 )
-        {        
-            if ( i == self -> count )
-                return 0;
-            rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcCorrupt );
-        }
-
-        KPTrieIndexWhack_v1 ( & v1 );
-    }
-
-    return rc;
-}
-
-rc_t KPTrieIndexInit_v2 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    /* get size of map, assumed to be size of file */
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KPTrieIndexHdr_v2 *hdr;
-
-#if ! KTRIE_ZEROS_KPTRIE
-        self -> mm = NULL;
-        self -> ord2node = NULL;
-        self -> id2ord . v32 = NULL;
-        self -> variant = 0;
-#endif
-
-        /* ignore empty file */
-        if ( size == 0 )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> first = self -> last = self -> maxid = 0;
-            self -> key2id = NULL;
-            self -> count = 0;
-#endif
-            return 0;
-        }
-
-        /* have to have at least the base header */
-        if ( size < sizeof hdr -> dad )
-            return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* recheck header size */
-            if ( size < sizeof * hdr )
-                return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-            self -> first = hdr -> first;
-            self -> last = self -> maxid = hdr -> last;
-            self -> id_bits = ( uint8_t ) hdr -> id_bits;
-            self -> span_bits = ( uint8_t ) hdr -> span_bits;
-            self -> byteswap = byteswap;
-
-            /* try to create the pttree */
-            rc = PTrieMakeOrig ( & self -> key2id,
-                hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* the count covers at least the number of trie nodes */
-                    self -> count = PTrieCount ( self -> key2id );
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                        return 0;
-
-                    /* calculate remaining bytes */                     
-                    size -= ptsize;
-
-                    /* there must be enough for an array of 4-byte node ids */
-                    if ( size >= ( ( size_t ) self -> count << 2 ) )
-                    {
-                        /* take the persisted array as-is */
-                        self -> ord2node = ( const uint32_t* )
-                            ( ( const char* ) ( hdr + 1 ) + ptsize );
-
-                        /* read the count */
-                        if ( size >= 4 )
-                        {
-                            self -> count = * ( self -> ord2node ) ++;
-                            size -= 4;
-                        }
-
-                        /* determine strategy from id span and count */
-                        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-                        {
-                            /* must be contiguous */
-                            self -> count = ( uint32_t ) ( self -> last - self -> first + 1 );
-
-                            /* size should be exactly this number of slots */
-                            if ( size == ( ( size_t ) self -> count << 2 ) )
-                                return 0;
-
-                            /* fall through to error return */
-                        }
-                        else if ( ( size == 4 && self -> count == 1 ) || size > ( ( size_t ) self -> count << 2 ) )
-                        {
-                            /* sparse */
-                            size -= ( size_t ) self -> count << 2;
-
-                            /* unpack id map */
-                            if ( hdr -> id_bits <= 8 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 1, hdr -> span_bits, 8 );
-                            else if ( hdr -> id_bits <= 16 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 2, hdr -> span_bits, 16 );
-                            else if ( hdr -> id_bits <= 32 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 3, hdr -> span_bits, 32 );
-                            else
-                                rc = KPTrieIndexInitID2Ord ( self, size, 4, hdr -> span_bits, 64 );
-
-                            /* done */
-                            if ( rc == 0 )
-                                return 0;
-
-                            PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                            return rc;
-                        }
-                    }
-                }
-
-                PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KPTrieIndexInit_v3_v4 ( KPTrieIndex_v2 *self, const KMMap *mm, bool byteswap, bool ptorig )
-{
-    /* get size of map, assumed to be size of file */
-    size_t size;
-    rc_t rc = KMMapSize ( mm, & size );
-    if ( rc == 0 )
-    {
-        const KPTrieIndexHdr_v3 *hdr;
-
-#if ! KTRIE_ZEROS_KPTRIE
-        self -> mm = NULL;
-        self -> ord2node = NULL;
-        self -> id2ord . v32 = NULL;
-        self -> variant = 0;
-#endif
-
-        /* ignore empty file */
-        if ( size == 0 )
-        {
-#if ! KTRIE_ZEROS_KPTRIE
-            self -> first = self -> last = self -> maxid = 0;
-            self -> key2id = NULL;
-            self -> count = 0;
-#endif
-            return 0;
-        }
-
-        /* have to have at least the base header */
-        if ( size < sizeof hdr -> dad )
-            return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-        rc = KMMapAddrRead ( mm, ( const void** ) & hdr );
-        if ( rc == 0 )
-        {
-            /* recheck header size */
-            if ( size < sizeof * hdr )
-                return RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-
-            self -> first = hdr -> first;
-            self -> last = self -> maxid = hdr -> last;
-            self -> id_bits = ( uint8_t ) hdr -> id_bits;
-            self -> span_bits = ( uint8_t ) hdr -> span_bits;
-            self -> byteswap = byteswap;
-
-            /* try to create the pttree */
-            rc = ( ptorig ? PTrieMakeOrig : PTrieMake )
-                ( & self -> key2id, hdr + 1, size -= sizeof * hdr, byteswap );
-            if ( rc == 0 )
-            {
-                size_t ptsize = PTrieSize ( self -> key2id );
-                if ( ptsize <= size )
-                {
-                    /* the count covers at least the number of trie nodes */
-                    self -> count = PTrieCount ( self -> key2id );
-
-                    /* it could be stored without projection */
-                    if ( ptsize == size )
-                        return 0;
-
-                    /* calculate remaining bytes */                     
-                    size -= ptsize;
-
-                    /* there must be enough for an array of 4-byte node ids */
-                    if ( size >= ( ( size_t ) self -> count << 2 ) )
-                    {
-                        /* take the persisted array as-is */
-                        self -> ord2node = ( const uint32_t* )
-                            ( ( const char* ) ( hdr + 1 ) + ptsize );
-
-                        /* read the count */
-                        if ( size >= 4 )
-                        {
-                            self -> count = * ( self -> ord2node ) ++;
-                            size -= 4;
-                        }
-
-                        /* determine strategy from id span and count */
-                        if ( ( self -> last - self -> first ) < ( ( int64_t ) self -> count << 1 ) )
-                        {
-                            /* must be contiguous */
-                            self -> count = ( uint32_t ) ( self -> last - self -> first + 1 );
-
-                            /* size should be exactly this number of slots */
-                            if ( size == ( ( size_t ) self -> count << 2 ) )
-                                return 0;
-
-                            /* fall through to error return */
-                        }
-                        else if ( ( size == 4 && self -> count == 1 ) || size > ( ( size_t ) self -> count << 2 ) )
-                        {
-                            /* sparse */
-                            size -= ( size_t ) self -> count << 2;
-
-                            /* unpack id map */
-                            if ( hdr -> id_bits <= 8 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 1, hdr -> span_bits, 8 );
-                            else if ( hdr -> id_bits <= 16 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 2, hdr -> span_bits, 16 );
-                            else if ( hdr -> id_bits <= 32 )
-                                rc = KPTrieIndexInitID2Ord ( self, size, 3, hdr -> span_bits, 32 );
-                            else
-                                rc = KPTrieIndexInitID2Ord ( self, size, 4, hdr -> span_bits, 64 );
-
-                            /* done */
-                            if ( rc == 0 )
-                                return 0;
-
-                            PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                            return rc;
-                        }
-                    }
-                }
-
-                PTrieWhack ( self -> key2id ), self -> key2id = NULL;
-                rc = RC ( rcDB, rcIndex, rcConstructing, rcTrie, rcCorrupt );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Whack
- *  closes down keymap
- */
-void KPTrieIndexWhack_v2 ( KPTrieIndex_v2 *self )
-{
-    free ( ( void* ) self -> id2ord . v8 );
-    PTrieWhack ( self -> key2id );
-    KMMapRelease ( self -> mm );
-    memset ( self, 0, sizeof * self );
-}
-
-uint32_t KPTrieIndexID2Ord_v2 ( const KPTrieIndex_v2 *self, int64_t id )
-{
-    if ( id >= self -> first && id <= self -> maxid )
-    {
-        int64_t nid;
-        uint32_t left, right, ord, count = self -> count;
-
-        /* convert id either to a zero-based ord,
-           or else the translated id in id2ord */
-        id -= self -> first;
-
-        /* handle type of projection */
-        switch ( self -> variant )
-        {
-        case 0:
-            /* return one-based ord */
-            return ( uint32_t ) ( id + 1 );
-
-        case 1:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v8 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v8 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 2:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v16 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v16 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 3:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v32 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v32 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-
-        case 4:
-            for ( left = 1, right = count; left <= right; )
-            {
-                ord = ( left + right ) >> 1;
-                nid = self -> id2ord . v64 [ ord - 1 ];
-                if ( id == nid )
-                    return ord;
-
-                if ( id < nid )
-                {
-                    right = ord - 1;
-                    continue;
-                }
-                if ( ord == count )
-                    return ord;
-
-                nid = self -> id2ord . v64 [ ord ];
-                if ( id < nid )
-                    return ord;
-
-                left = ord + 1;
-            }
-            break;
-        }
-    }
-    return 0;
-}
-
-static
-rc_t KPTrieIndexProject_v2 ( const KPTrieIndex_v2 *self,
-    int64_t id,
-#if V2FIND_RETURNS_SPAN
-    int64_t *start_id, uint32_t *span,
-#endif
-    char *key_buff, size_t buff_size, size_t *actsize )
-{
-    uint32_t nid, ord = KPTrieIndexID2Ord_v2 ( self, id );
-    if ( ord != 0 )
-    {
-        assert ( start_id != NULL );
-        assert ( span != NULL );
-
-        nid = self -> ord2node [ ord - 1 ];
-
-        switch ( self -> variant )
-        {
-        case 0:
-            * start_id = id;
-            for ( ; ord < self -> count; ++ ord )
-            {
-                if ( nid != self -> ord2node [ ord ] )
-                    break;
-            }
-            * span = self -> first + ord - * start_id;
-            break;
-        case 1:
-            * start_id = self -> id2ord . v8 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid  - self -> first + 1 ) : self -> id2ord . v8 [ ord ] ) - * start_id );
-            *start_id += self->first; 
-            break;
-        case 2:
-            * start_id = self -> id2ord . v16 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid  - self -> first + 1 ) : self -> id2ord . v16 [ ord ] ) - * start_id );
-            *start_id += self->first; 
-            break;
-        case 3:
-            * start_id = self -> id2ord . v32 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid  - self -> first + 1 ) : self -> id2ord . v32 [ ord ] ) - * start_id );
-            *start_id += self->first; 
-            break;
-        case 4:
-            * start_id = self -> id2ord . v64 [ ord - 1 ];
-            * span = ( uint32_t ) ( ( ( ord == self -> count ) ?
-                ( self -> maxid  - self -> first + 1 ) : self -> id2ord . v64 [ ord ] ) - * start_id );
-            *start_id += self->first; 
-            break;
-        }
-
-        if ( nid != 0 )
-        {
-            rc_t rc;
-            PTNode node;
-
-            if ( self -> byteswap )
-                nid = bswap_32 ( nid );
-
-            rc = PTrieGetNode ( self -> key2id, & node, nid );
-            if ( rc == 0 )
-            {
-                const String *key;
-                rc = PTNodeMakeKey ( & node, & key );
-                if ( rc == 0 )
-                {
-                    if (actsize)
-                        *actsize = key -> size;
-                    if ( key -> size >= buff_size )
-                        rc = RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                    else
-                        string_copy ( key_buff, buff_size, key -> addr, key -> size );
-
-                    StringWhack ( ( String* ) key );
-                }
-            }
-            return rc;
-        }
-    }
-
-    return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-}
-
-/* Find
- */
-static
-rc_t KPTrieIndexFind_v2 ( const KPTrieIndex_v2 *self,
-    const char *str, int64_t *start_id,
-#if V2FIND_RETURNS_SPAN
-    uint32_t *span,
-#endif
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data, bool convertFromV1 )
-{
-    rc_t rc;
-
-    /* detect empty index */
-    if ( self -> count == 0 )
-        rc = RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-    else
-    {
-        uint32_t nid;
-        PTNode pnode;
-
-        String key;
-        StringInitCString ( & key, str );
-
-        /* try to find string */
-        nid = PTrieFind ( self -> key2id, & key, & pnode, custom_cmp, data );
-        if ( nid == 0 )
-            rc = RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-        else
-        {
-            size_t usize;
-
-            /* detect conversion from v1 */
-            if ( convertFromV1 && self -> id_bits == 0 )
-            {
-                /* v1 stored tree will have just a 32-bit spot id as data */
-                uint32_t id;
-                assert ( pnode . data . size == sizeof id );
-                memcpy ( & id, pnode . data . addr, sizeof id );
-                * start_id = id;
-                rc = 0;
-            }
-            else
-            {
-                /* should be native v2 */
-                rc = Unpack ( self -> id_bits, sizeof * start_id * 8,
-                    pnode . data . addr, 0, self -> id_bits, NULL,
-                    start_id, sizeof * start_id, & usize );
-                * start_id += self -> first;
-            }
-
-            if ( rc == 0 )
-            {
-#if V2FIND_RETURNS_SPAN
-                if ( self -> ord2node != NULL )
-                {
-                    uint32_t ord = KPTrieIndexID2Ord_v2 ( self, * start_id );
-                    if ( ord == 0 )
-                        rc = RC ( rcDB, rcIndex, rcSelecting, rcId, rcNotFound );
-                    else if ( ord == self -> count )
-                        * span = self -> maxid - * start_id + 1;
-                    else switch ( self -> variant )
-                    {
-                    case 0:
-                        for ( ; ord < self -> count; ++ ord )
-                        {
-                            if ( nid != self -> ord2node [ ord ] )
-                                break;
-                        }
-                        * span = self -> first + ord - * start_id;
-                        break;
-                    case 1:
-                        * span = self -> first + self -> id2ord . v8 [ ord ] - * start_id;
-                        break;
-                    case 2:
-                        * span = self -> first + self -> id2ord . v16 [ ord ] - * start_id;
-                        break;
-                    case 3:
-                        * span = self -> first + self -> id2ord . v32 [ ord ] - * start_id;
-                        break;
-                    case 4:
-                        * span = self -> first + self -> id2ord . v64 [ ord ] - * start_id;
-                        break;
-                    }
-                }
-                else if ( self -> span_bits == 0 )
-                    * span = 1;
-                else
-                {
-                    rc = Unpack ( self -> span_bits, sizeof * span * 8,
-                        pnode . data . addr, 0, self -> id_bits, NULL,
-                        span, sizeof * span, & usize );
-                }
-#endif
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KTrieIdxNode_v2
- */
-
-static
-rc_t KTrieIdxNodeMake_v2_s1 ( KTrieIdxNode_v2_s1 **n, const String *key, int64_t id )
-{
-    rc_t rc = TNodeMake ( ( TNode** ) n, sizeof ** n + key -> size );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcDB, rcIndex, rcInserting );
-    else
-    {
-        KTrieIdxNode_v2_s1 *node = * n;
-        string_copy ( node -> key, key -> size + 1, key -> addr, key -> size);
-        StringInit ( & node -> n . key, node -> key, key -> size, key -> len );
-        node -> start_id = id;
-    }
-
-    return rc;
-}
-
-static
-rc_t KTrieIdxNodeMakeHole_v2_s1 ( KTrieIdxNode_v2_s1 **n, int64_t id )
-{
-    rc_t rc = TNodeMake ( ( TNode** ) n, sizeof ** n );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcDB, rcIndex, rcInserting );
-    else
-    {
-        KTrieIdxNode_v2_s1 *node = * n;
-        node -> key [ 0 ] = 0;
-        StringInit ( & node -> n . key, node -> key, 0, 0 );
-        node -> start_id = id;
-    }
-
-    return rc;
-}
-
-static
-rc_t KTrieIdxNodeMake_v2_s2 ( KTrieIdxNode_v2_s2 **n, const String *key, int64_t id )
-{
-    rc_t rc = TNodeMake ( ( TNode** ) n, sizeof ** n + key -> size );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcDB, rcIndex, rcInserting );
-    else
-    {
-        KTrieIdxNode_v2_s2 *node = * n;
-        string_copy ( node -> key, key -> size + 1, key -> addr, key -> size);
-        StringInit ( & node -> n . key, node -> key, key -> size, key -> len );
-        node -> start_id = id;
-        node -> span = 1;
-    }
-    return rc;
-}
-
-static
-void CC KTrieIdxNodeWhack_v2 ( TNode *n, void *data )
-{
-    TNodeWhack ( n );
-}
-
-#if 0
-static
-void CC KTrieIdxNodeUnlink_v2 ( TNode *n, void *data )
-{
-    if ( TrieUnlink ( data, n ) )
-        TNodeWhack ( n );
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KTrieIndex_v2
- */
-
-static
-uint32_t KTrieIndexID2Ord_v2 ( const KTrieIndex_v2 *self, int64_t id )
-{
-    if ( id >= self -> first && id <= self -> last )
-    {
-        uint32_t left, right, count = self -> count;
-        for ( left = 1, right = count; left <= right; )
-        {
-            uint32_t ord = ( left + right ) >> 1;
-            const KTrieIdxNode_v2_s1 *node = self -> ord2node [ ord - 1 ];
-            if ( id == node -> start_id )
-                return ord;
-
-            if ( id < node -> start_id )
-            {
-                right = ord - 1;
-                continue;
-            }
-
-            if ( ord == count )
-                return ord;
-
-            node = self -> ord2node [ ord ];
-            if ( id < node -> start_id )
-                return ord;
-
-            left = ord + 1;
-        }
-    }
-    return 0;
-}
-
-static
-uint32_t KTrieIndexNode2Ord_v2 ( const KTrieIndex_v2 *self, const KTrieIdxNode_v2_s1 *node )
-{
-    if ( self -> ord2node != NULL )
-        return KTrieIndexID2Ord_v2 ( self, node -> start_id );
-    return 0;
-}
-
-/* KTrieIndexWrite_v2
- */
-typedef struct PersistTrieData PersistTrieData;
-struct PersistTrieData
-{
-    uint64_t pos;
-    KFile *f;
-    KMD5File *fmd5;
-    uint8_t *buffer;
-    size_t bsize;
-    size_t marker;
-
-    int64_t first;
-    size_t ptt_size;
-    size_t node_data_size;
-    uint16_t id_bits;
-    uint16_t span_bits;
-    rc_t rc;
-};
-
-static
-rc_t CC KTrieIndexWrite_v2 ( void *param,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    PersistTrieData *pb = param;
-    size_t total, to_write;
-
-    for ( total = 0; total < size; total += to_write )
-    {
-        to_write = size - total;
-        if ( pb -> marker + to_write > pb -> bsize )
-            to_write = pb -> bsize - pb -> marker;
-
-        if ( to_write > 0 )
-        {
-            memcpy ( pb -> buffer + pb -> marker,
-                ( const uint8_t* ) buffer + total, to_write );
-            pb -> marker += to_write;
-        }
-
-        if ( pb -> marker == pb -> bsize )
-        {
-            size_t num_flushed;
-            pb -> rc = KFileWrite ( pb -> f, pb -> pos,
-                pb -> buffer, pb -> bsize, & num_flushed );
-            if ( pb -> rc != 0 )
-            {
-                * num_writ = 0;
-                return pb -> rc;
-            }
-
-            if ( num_flushed == 0 )
-            {
-                * num_writ = total + to_write;
-                return pb -> rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-            }
-
-            pb -> marker -= num_flushed;
-            pb -> pos += num_flushed;
-
-            if ( pb -> marker != 0 )
-                memcpy ( pb -> buffer, pb -> buffer + num_flushed, pb -> marker );
-        }
-    }
-
-    * num_writ = total;
-    return 0;
-}
-
-/* KTrieIndexAux_v2
- */
-static
-rc_t CC KTrieIndexAux_v2_s1 ( void *param, const void *node, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    PersistTrieData *pb = param;
-
-    if ( write != NULL && pb -> node_data_size != 0 )
-    {
-        char buffer [ 8 ];
-        const KTrieIdxNode_v2_s1 *n = node;
-
-        /* pack from 64 possible bits down to total id span */
-        if ( pb -> id_bits != 0 )
-        {
-            /* store name->id mapping as a simple translation
-               from first, because we don't have easy access to
-               neighboring nodes for storage as 1st derivative. */
-            uint64_t idd = n -> start_id - pb -> first;
-
-            bitsz_t psize;
-            rc_t rc = Pack ( 64, pb -> id_bits, & idd,
-                sizeof idd, NULL, buffer, 0, sizeof buffer * 8, & psize );
-            if ( rc != 0 )
-                return rc;
-
-            /* the packing should produce a single unit */
-            if ( psize != pb -> id_bits )
-                return RC ( rcDB, rcIndex, rcPacking, rcData, rcCorrupt );
-        }
-
-        /* write out the node */
-        return ( * write ) ( write_param, buffer, pb -> node_data_size, num_writ );
-    }
-
-    /* will always store an integral number of bytes */
-    * num_writ = pb -> node_data_size;
-    return 0;
-}
-
-static
-rc_t CC KTrieIndexAux_v2_s2 ( void *param, const void *node, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    PersistTrieData *pb = param;
-
-    if ( write != NULL && pb -> node_data_size != 0 )
-    {
-        const KTrieIdxNode_v2_s2 *n = node;
-
-        rc_t rc;
-        char buffer [ 12 ];
-        bitsz_t psize, offset;
-
-        if ( pb -> id_bits == 0 )
-            offset = 0;
-        else
-        {
-            /* again store name->id mapping as a simple translation
-               from first, but pack bits tightly */
-            uint64_t idd = n -> start_id - pb -> first;
-            rc = Pack ( 64, pb -> id_bits, & idd,
-                sizeof idd, NULL, buffer, 0, sizeof buffer * 8, & offset );
-            if ( rc != 0 )
-                return rc;
-            if ( offset != pb -> id_bits )
-                return RC ( rcDB, rcIndex, rcPacking, rcData, rcCorrupt );
-        }
-
-        /* now pack id span down to a minimal number of bits
-           6/8/09 - this is known to fail because Pack hasn't been
-           updated to start on a non-0 bit offset */
-        if ( pb -> span_bits != 0 )
-        {
-            rc = Pack ( 32, pb -> span_bits, & n -> span, sizeof n -> span,
-                NULL, buffer, offset, sizeof buffer * 8 - offset, & psize );
-            if ( rc != 0 )
-                return rc;
-            if ( psize != pb -> span_bits )
-                return RC ( rcDB, rcIndex, rcPacking, rcData, rcCorrupt );
-        }
-
-        /* write out packed combination */
-        return ( * write ) ( write_param, buffer, pb -> node_data_size, num_writ );
-    }
-
-    * num_writ = pb -> node_data_size;
-    return 0;
-}
-
-/* KTrieIndexPersist_v*
- *  write keymap to indicated location
- */
-#if KDBINDEXVERS == 2
-
-static
-void KTrieIndexPersistHdr_v2 ( KTrieIndex_v2 *self, PersistTrieData *pb )
-{
-    KPTrieIndexHdr_v2 *hdr;
-
-    uint64_t total_id, test_id;
-    uint32_t total_span, test_span;
-
-    pb -> pos = 0;
-
-    hdr = ( KPTrieIndexHdr_v2* ) pb -> buffer;
-    pb -> marker = sizeof * hdr;
-
-    /* stamp version header */
-    KDBHdrInit(&hdr->dad, 2);
-
-    /* store first and last ids */
-    pb -> first = self -> first;
-    hdr -> first = self -> first;
-    hdr -> last = self -> last;
-
-    /* calculate id bits - notice that
-       total_id gets right shifted so that
-       the loop is guaranteed to exit */
-    total_id = self -> last - self -> first;
-    if ( total_id == 0 )
-        pb -> id_bits = 0;
-    else for ( total_id >>= 1, pb -> id_bits = 1, test_id = 1;
-          test_id <= total_id;
-          ++ pb -> id_bits, test_id <<= 1 )
-        ( void ) 0;
-
-    /* if we have maintained a projection index,
-       calculate max span now */
-    if ( self -> ord2node != NULL )
-    {
-        uint32_t i, span, max_span;
-        int64_t cur, prev = self -> first;
-        for ( i = max_span = 1; i < self -> count; prev = cur, ++ i )
-        {
-            cur = self -> ord2node [ i ] -> start_id;
-            span = ( uint32_t ) ( cur - prev );
-            if ( span > max_span )
-                max_span = span;
-        }
-        
-        span = ( uint32_t ) ( self -> last - prev );
-        if ( span > max_span )
-            max_span = span;
-
-        self -> max_span = max_span;
-    }
-
-    /* calculate span bits */
-    total_span = self -> max_span;
-    if ( total_span == 0 )
-        pb -> span_bits = 0;
-    else for ( total_span >>= 1, pb -> span_bits = 1, test_span = 1;
-          test_span <= total_span;
-          ++ pb -> span_bits, test_span <<= 1 )
-        ( void ) 0;
-
-    /* record these as header data */
-    hdr -> id_bits = pb -> id_bits;
-    hdr -> span_bits = pb -> span_bits;
-
-    /* zero trailing junk */
-    hdr -> align [ 0 ] = hdr -> align [ 1 ] = 0;
-}
-
-#else
-
-static
-void KTrieIndexPersistHdr_v3_v4 ( KTrieIndex_v2 *self, PersistTrieData *pb )
-{
-    KPTrieIndexHdr_v3 *hdr;
-
-    uint64_t total_id, test_id;
-    uint32_t total_span, test_span;
-
-    pb -> pos = 0;
-
-    hdr = ( KPTrieIndexHdr_v3* ) pb -> buffer;
-    pb -> marker = sizeof * hdr;
-
-    /* stamp version header */
-    KDBHdrInit(&hdr->dad.h, KDBINDEXVERS);
-    hdr->dad.index_type = kitText;
-
-    /* store first and last ids */
-    pb -> first = self -> first;
-    hdr -> first = self -> first;
-    hdr -> last = self -> last;
-
-    /* calculate id bits - notice that
-       total_id gets right shifted so that
-       the loop is guaranteed to exit */
-    total_id = self -> last - self -> first;
-    if ( total_id == 0 )
-        pb -> id_bits = 0;
-    else for ( total_id >>= 1, pb -> id_bits = 1, test_id = 1;
-          test_id <= total_id;
-          ++ pb -> id_bits, test_id <<= 1 )
-        ( void ) 0;
-
-    /* if we have maintained a projection index,
-       calculate max span now */
-    if ( self -> ord2node != NULL )
-    {
-        uint32_t i, span, max_span;
-        int64_t cur, prev = self -> first;
-        for ( i = max_span = 1; i < self -> count; prev = cur, ++ i )
-        {
-            cur = self -> ord2node [ i ] -> start_id;
-            span = ( uint32_t ) ( cur - prev );
-            if ( span > max_span )
-                max_span = span;
-        }
-        
-        span = ( uint32_t ) ( self -> last - prev );
-        if ( span > max_span )
-            max_span = span;
-
-        self -> max_span = max_span;
-    }
-
-    /* calculate span bits */
-    total_span = self -> max_span;
-    if ( total_span == 0 )
-        pb -> span_bits = 0;
-    else for ( total_span >>= 1, pb -> span_bits = 1, test_span = 1;
-          test_span <= total_span;
-          ++ pb -> span_bits, test_span <<= 1 )
-        ( void ) 0;
-
-    /* record these as header data */
-    hdr -> id_bits = pb -> id_bits;
-    hdr -> span_bits = pb -> span_bits;
-
-    /* zero trailing junk */
-    hdr -> align [ 0 ] = hdr -> align [ 1 ] = 0;
-}
-
-#endif 
-
-static
-rc_t KTrieIndexPersistTrie_v2 ( const KTrieIndex_v2 *self, PersistTrieData *pb )
-{
-    rc_t rc;
-
-    /* persist the trie to file,
-       using tree-internal key storage,
-       capture the image size in pb */
-    if ( self -> ord2node != NULL )
-    {
-        pb -> node_data_size = ( pb -> id_bits + 7 ) >> 3;
-        rc = TriePersist ( & self -> key2id, & pb -> ptt_size,
-            false, KTrieIndexWrite_v2, pb, KTrieIndexAux_v2_s1, pb );
-    }
-    else
-    {
-        pb -> node_data_size = ( pb -> id_bits + pb -> span_bits + 7 ) >> 3;
-        rc = TriePersist ( & self -> key2id, & pb -> ptt_size,
-            false, KTrieIndexWrite_v2, pb, KTrieIndexAux_v2_s2, pb );
-    }
-
-    if ( rc == 0 && pb -> marker != 0 )
-    {
-        size_t num_writ;
-        rc = KFileWrite ( pb -> f, pb -> pos,
-            pb -> buffer, pb -> marker, & num_writ );
-        if ( rc == 0 && num_writ != pb -> marker )
-            rc = RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-    }
-
-    return rc;
-}
-
-
-static
-rc_t KTrieIndexPersistProjContig_v2 ( const KTrieIndex_v2 *self,
-    PersistTrieData *pb, PTrie *tt, uint32_t *ord2node )
-{
-    uint32_t i, j, nid;
-    int64_t id = self -> first;
-    for ( i = j = nid = 0; i < self -> count; ++ id, ++ j, ++ i )
-    {
-        const KTrieIdxNode_v2_s1 *node = self -> ord2node [ i ];
-
-        /* back fill repeats */
-        for ( ; id < node -> start_id; ++ id )
-            ord2node [ j ++ ] = nid;
-
-        /* check for a hole in id space */
-        if ( node -> n . key . size == 0 )
-            nid = 0;
-        else
-        {
-            PTNode pn;
-            nid = PTrieFind ( tt, & node -> n . key, & pn, NULL, NULL );
-            if ( nid == 0 )
-                return RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-        }
-
-        /* record nid for i at j */
-        ord2node [ j ] = nid;
-    }
-
-    /* finish off trailing span */
-    for ( ; id <= self -> last; ++ id )
-        ord2node [ j ++ ] = nid;
-
-    return 0;
-}
-
-static
-rc_t KTrieIndexPersistProjSparse_v2 ( const KTrieIndex_v2 *self,
-    PersistTrieData *pb, PTrie *tt, uint32_t *ord2node, bitsz_t *psize )
-{
-    uint32_t i, nid;
-    int64_t *id2ord = ( void* ) & ord2node [ self -> count ];
-    for ( i = 0; i < self -> count; ++ i )
-    {
-        const KTrieIdxNode_v2_s1 *node = self -> ord2node [ i ];
-
-        /* record negated id for i - see 1st derivative below */
-        id2ord [ i ] = - node -> start_id;
-
-        /* check for a hole in id space */
-        if ( node -> n . key . size == 0 )
-            nid = 0;
-        else
-        {
-            PTNode pn;
-            nid = PTrieFind ( tt, & node -> n . key, & pn, NULL, NULL );
-            if ( nid == 0 )
-                return RC ( rcDB, rcIndex, rcPersisting, rcTransfer, rcIncomplete );
-        }
-
-        /* record nid for i */
-        ord2node [ i ] = nid;
-    }
-
-    /* produce first derivative of ids
-       for any given pair, the 1st derivative is generally
-       right - left, which is usually stored right, such that
-       we start at the end and move left toward the start, i.e.
-
-       right -= left and move left
-
-       in this case, we want to eliminate the leading 0
-       and shift everything down, so we produce the result
-       to the left side and move right toward end, but this
-       requires more complicated arithmetic in order to preserve
-       right - left, i.e.
-
-       left = right - left and move right
-
-       to avoid this arithmetic, the ids were stored negated above
-       which converts the operation into
-
-       left -= right and move right
-    */
-    for ( i = 1; i < self -> count; ++ i )
-        id2ord [ i - 1 ] -= id2ord [ i ];
-
-    /* pack from 64 to span-bits */
-    return Pack ( 64, pb -> span_bits, id2ord, ( size_t ) ( self -> count - 1 ) << 3,
-                NULL, id2ord, 0, ( bitsz_t ) self -> count << 6, psize );
-}
-
-#if KDBINDEXVERS == 2
-
-static
-rc_t KTrieIndexPersistProj_v2 ( const KTrieIndex_v2 *self, PersistTrieData *pb )
-{
-    rc_t rc = 0;
-    void * addr;
-    size_t map_size;
-    uint64_t file_size;
-    size_t num_to_read;
-    uint64_t num_ids;
-    bool is_sparse;
-
-    /* there must be something to do */
-    if ( self -> count == 0 || self -> ord2node == NULL )
-        return 0;
-
-    /* calculate what kind of projection strategy to use:
-       when avg ( id span ) <= 2.0, just use a straight array.
-       otherwise, use two arrays: first for node ids and last
-       being 1st derivative of positional start_ids.
-
-       the calculation of the ratio would be
-         num_ids = self -> last - self -> first + 1;
-         ratio = num_ids / self -> count;
-         if ( ratio <= 2.0 )
-             use 1-1
-         else
-             use sparse
-
-       by reorganizing the comparison, we get
-         if ( num_ids <= 2 * self -> count )...
-    */
-    num_ids = self -> last - self -> first + 1;
-    if ( num_ids <= ( ( uint64_t ) self -> count << 1 ) )
-    {
-        /* store 1-1 projection index */
-        is_sparse = false;
-
-        /* map size is 4 bytes per id */
-        map_size = pb -> ptt_size + ( ( size_t ) num_ids << 2 );
-    }
-    else
-    {
-        /* store sparse projection index */
-        is_sparse = true;
-
-        /* map size for node ids is 4 bytes per slot */
-        map_size = pb -> ptt_size + ( ( size_t ) self -> count << 2 );
-
-        /* map size for 1st derivative ids is initially 8 bytes per slot
-           used initially to store full ids and then reduced 1st deriv. */
-        map_size += ( size_t ) self -> count << 3;
-    }
-
-    /* add in 4 bytes for count */
-    map_size += 4;
-
-    /* create an updatable region spanning from end of header,
-       starting from PTrie and extending to end of projection index */
-    addr = malloc ( map_size );
-    if ( addr == NULL )
-        rc = RC ( rcDB, rcIndex, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read;
-
-        rc = KFileSize ( pb -> f, & file_size );
-        num_to_read = file_size - sizeof ( KPTrieIndexHdr_v2 );
-        if ( rc == 0 )
-        {
-            rc = KFileReadAll ( pb -> f, sizeof ( KPTrieIndexHdr_v2 ), addr,
-			     num_to_read, & num_read );
-            if ( rc == 0 )
-            {
-                if ( num_read != num_to_read )
-                {
-                    rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-                }
-            }
-        }
-        if ( rc != 0 )
-            free ( addr );
-    }
-
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        /* inflate the PTrie */
-        PTrie *tt;
-        rc = PTrieMakeOrig ( & tt, addr, pb -> ptt_size );
-        if ( rc == 0 )
-        {
-            uint32_t *ord2node;
-            assert ( pb -> ptt_size == PTrieSize ( tt ) );
-            assert ( self -> count >= PTrieCount ( tt ) );
-            ord2node = ( void* ) ( ( char* ) addr + pb -> ptt_size );
-            assert ( ( ( size_t ) ord2node & 3 ) == 0 );
-            
-            /* set count */
-            * ord2node ++ = self -> count;
-
-            if ( ! is_sparse )
-                rc = KTrieIndexPersistProjContig_v2 ( self, pb, tt, ord2node );
-            else
-            {
-                bitsz_t psize;
-                rc = KTrieIndexPersistProjSparse_v2 ( self, pb, tt, ord2node, & psize );
-                if ( rc == 0 )
-                {
-                    map_size -= ( size_t ) self -> count << 3;
-                    map_size += ( psize + 7 ) >> 3;
-                }
-            }
-
-            /* done with pttree */
-            PTrieWhack ( tt );
-        }
-        rc = KFileWrite ( pb -> f, file_size, 
-			  (uint8_t*)addr + num_to_read,  map_size - num_to_read, & num_writ );
-        if ( rc == 0  &&  num_writ != map_size - num_to_read )
-            rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-        free ( addr );
-    }
-
-    return rc;
-}
-
-#else
-
-static
-rc_t KTrieIndexPersistProj_v3 ( const KTrieIndex_v2 *self, PersistTrieData *pb )
-{
-    rc_t rc = 0;
-    void * addr;
-    size_t map_size;
-    uint64_t file_size;
-    size_t num_to_read;
-    uint64_t num_ids;
-    bool is_sparse;
-
-    /* there must be something to do */
-    if ( self -> count == 0 || self -> ord2node == NULL )
-        return 0;
-
-    /* calculate what kind of projection strategy to use:
-       when avg ( id span ) <= 2.0, just use a straight array.
-       otherwise, use two arrays: first for node ids and last
-       being 1st derivative of positional start_ids.
-
-       the calculation of the ratio would be
-         num_ids = self -> last - self -> first + 1;
-         ratio = num_ids / self -> count;
-         if ( ratio <= 2.0 )
-             use 1-1
-         else
-             use sparse
-
-       by reorganizing the comparison, we get
-         if ( num_ids <= 2 * self -> count )...
-    */
-    num_ids = self -> last - self -> first + 1;
-    if ( num_ids <= ( ( uint64_t ) self -> count << 1 ) )
-    {
-        /* store 1-1 projection index */
-        is_sparse = false;
-
-        /* map size is 4 bytes per id */
-        map_size = pb -> ptt_size + ( ( size_t ) num_ids << 2 );
-    }
-    else
-    {
-        /* store sparse projection index */
-        is_sparse = true;
-
-        /* map size for node ids is 4 bytes per slot */
-        map_size = pb -> ptt_size + ( ( size_t ) self -> count << 2 );
-
-        /* map size for 1st derivative ids is initially 8 bytes per slot
-           used initially to store full ids and then reduced 1st deriv. */
-        map_size += ( size_t ) self -> count << 3;
-    }
-
-    /* add in 4 bytes for count */
-    map_size += 4;
-
-    rc = KFileSize ( pb -> f, & file_size );
-    if ( rc == 0 )
-    {
-        /* create an updatable region spanning from end of header,
-           starting from PTrie and extending to end of projection index */
-        addr = malloc ( map_size );
-        if ( addr == NULL )
-            rc = RC ( rcDB, rcIndex, rcPersisting, rcMemory, rcExhausted );
-        else
-        {
-            size_t num_read;
-            num_to_read = file_size - sizeof ( KPTrieIndexHdr_v3 );
-            rc = KFileReadAll ( pb -> f, sizeof ( KPTrieIndexHdr_v3 ),
-                addr, num_to_read, & num_read );
-            if ( rc != 0 )
-                free ( addr );
-            else if ( num_read != num_to_read )
-            {
-                free ( addr );
-                rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        /* inflate the PTrie */
-        PTrie *tt;
-#if KDBINDEXVERS > 3
-        rc = PTrieMake ( & tt, addr, pb -> ptt_size, self -> pt . byteswap );
-#else
-        rc = PTrieMakeOrig ( & tt, addr, pb -> ptt_size, self -> pt . byteswap );
-#endif
-        if ( rc == 0 )
-        {
-            uint32_t *ord2node;
-            assert ( pb -> ptt_size == PTrieSize ( tt ) );
-            assert ( self -> count >= PTrieCount ( tt ) );
-            ord2node = ( void* ) ( ( char* ) addr + pb -> ptt_size );
-            assert ( ( ( size_t ) ord2node & 3 ) == 0 );
-            
-            /* set count */
-            * ord2node ++ = self -> count;
-
-            if ( ! is_sparse )
-                rc = KTrieIndexPersistProjContig_v2 ( self, pb, tt, ord2node );
-            else
-            {
-                bitsz_t psize;
-                rc = KTrieIndexPersistProjSparse_v2 ( self, pb, tt, ord2node, & psize );
-                if ( rc == 0 )
-                {
-                    map_size -= ( size_t ) self -> count << 3;
-                    map_size += ( psize + 7 ) >> 3;
-                }
-            }
-
-            /* done with pttree */
-            PTrieWhack ( tt );
-
-            if ( rc == 0 )
-            {
-                rc = KFileWrite ( pb -> f, file_size, 
-                     ( uint8_t* ) addr + num_to_read,  map_size - num_to_read, & num_writ );
-
-                if ( rc == 0  &&  num_writ != map_size - num_to_read )
-                    rc = RC ( rcDB, rcIndex, rcPersisting, rcHeader, rcInsufficient );
-            }
-        }
-
-        free ( addr );
-    }
-
-    return rc;
-}
-
-#endif
-
-static
-rc_t KTrieIndexCreateMD5Wrapper ( KDirectory *dir, KFile ** fp, KMD5File ** wrapper,
-    char relpath [ 256 ], const char md5_relpath [ 260 ] )
-{
-    /* create the md5 file for read/write */
-    KFile *f;
-    rc_t rc = KDirectoryVCreateFile ( dir, & f, true,
-        0664, kcmInit, md5_relpath, NULL );
-    if ( rc == 0 )
-    {
-        /* create an md5sum formatter */
-        KMD5SumFmt *fmt;
-        rc = KMD5SumFmtMakeUpdate ( & fmt, f );
-        if ( rc == 0 )
-        {
-            int dot_pos;
-
-            /* convert relative path to a leaf */
-            char *leaf = strrchr ( relpath, '/' );
-            if ( leaf ++ == NULL )
-                leaf = relpath;
-
-            /* trim off ".tmp" from "leaf"
-               so that the format string reflects final name
-               without the need to rename later */
-            dot_pos = strlen ( leaf ) - 4;
-            assert ( dot_pos > 0 );
-            assert ( strcmp ( & leaf [ dot_pos ], ".tmp" ) == 0 );
-            leaf [ dot_pos ] = 0;
-
-            /* "fmt" now owns "f" */
-            f = NULL;
-
-            /* create a file wrapper that calculates and prints md5 */
-            rc = KMD5FileMakeWrite ( wrapper, * fp, fmt, leaf );
-
-            /* "wrapper" attaches a reference to "fmt", so we have to
-               dump our reference regardless of "rc" */
-            KMD5SumFmtRelease ( fmt );
-
-            /* restore dot */
-            leaf [ dot_pos ] = '.';
-
-            /* if we succeeded, swap the "wrapper" for input file */
-            if ( rc == 0 )
-            {
-                * fp = KMD5FileToKFile ( * wrapper );
-                return 0;
-            }
-        }
-
-        /* failed */
-        KFileRelease ( f );
-    }
-
-    return rc;
-}
-
-rc_t KTrieIndexPersist_v2 ( const KTrieIndex_v2 *self,
-    bool proj, KDirectory *dir, const char *path, bool use_md5 )
-{
-    rc_t rc;
-    PersistTrieData pb;
-
-    assert ( self != NULL );
-    if ( self -> count == 0 )
-        return 0;
-
-    pb . fmd5 = NULL;
-
-    /** Trie may have holes in serialization due to memory alignments ***/
-    pb . buffer = calloc ( pb . bsize = 32 * 1024, 1 );
-    if ( pb . buffer == NULL )
-        rc = RC ( rcDB, rcIndex, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        /* determine the name of the file:
-           it is created under a temporary name
-           relative to the directory provided */
-        char tmpname [ 256 ];
-        rc = KDirectoryResolvePath ( dir, false,
-            tmpname, sizeof tmpname, "%s.tmp", path );
-        if ( rc == 0 )
-        {
-            /* create the name of temporary md5 file */
-            char tmpmd5name [ 260 ];
-            sprintf ( tmpmd5name, "%s.md5", tmpname );
-
-            /* create the output file under temporary name
-               ? why does it need read/write capabilities? */
-            rc = KDirectoryVCreateFile ( dir, & pb . f,
-                true, 0664, kcmInit, tmpname, NULL );
-            if ( rc == 0 )
-            {
-                /* if using md5, wrap output file */
-                if ( use_md5 )
-                    rc = KTrieIndexCreateMD5Wrapper ( dir, & pb . f, & pb . fmd5, tmpname, tmpmd5name );
-                if ( rc == 0 )
-                {
-                    /* initial size */
-                    pb . ptt_size = 0;
-#if KDBINDEXVERS == 2
-                    KTrieIndexPersistHdr_v2 ( ( KTrieIndex_v2* ) self, & pb );
-#else
-                    KTrieIndexPersistHdr_v3_v4 ( ( KTrieIndex_v2* ) self, & pb );
-#endif
-
-                    /* persist tree */
-                    rc = KTrieIndexPersistTrie_v2 ( self, & pb );
-                    if ( rc == 0 )
-                    {
-                        /* persist projection table */
-                        if ( proj )
-                        {
-#if KDBINDEXVERS == 2
-                            rc = KTrieIndexPersistProj_v2 ( self, & pb );
-#else
-                            rc = KTrieIndexPersistProj_v3 ( self, & pb );
-#endif
-                        }
-                    }
-                }
-                    
-                /* close down the file now, success or not */
-                KFileRelease ( pb . f );
-                pb . f = NULL;
-
-                /* douse buffer and mark NULL in case of later attempt */
-                free ( pb . buffer );
-                pb . buffer = NULL;
-
-                /* rename the files on success */
-                if ( rc == 0 )
-                {
-                    /* works even if "path" is absolute */
-                    rc = KDirectoryRename ( dir, false, tmpname, path );                        
-                    if ( rc == 0 )
-                    {
-                        int tmplen;
-
-                        /* done if this was the only file to rename */
-                        if ( ! use_md5 )
-                            return 0;
-
-                        /* use "tmpname" as a real "md5" name */
-                        tmplen = strlen ( tmpname );
-                        assert ( strcmp ( & tmpname [ tmplen - 4 ], ".tmp" ) == 0 );
-                        strcpy ( & tmpname [ tmplen - 3 ], "md5" );
-
-                        /* rename md5 file and be done on success */
-                        rc = KDirectoryRename ( dir, false, tmpmd5name, tmpname );
-                        if ( rc == 0 )
-                            return 0;
-
-                        /* failure here means we have a good index file,
-                           but a bad md5 file, so convert "tmpname" to the
-                           actual name of the index file */
-                        tmpname [ tmplen - 4 ] = 0;
-                    }
-                }
-
-                /* failed, remove the output files here */
-                KDirectoryVRemove ( dir, false, tmpname, NULL );
-                if ( use_md5 )
-                    KDirectoryVRemove ( dir, false, tmpmd5name, NULL );
-            }
-        }
-
-        /* douse buffer */
-        free ( pb . buffer );
-    }
-    
-    return rc;
-}
-
-
-/* whack whack */
-void KTrieIndexWhack_v2 ( KTrieIndex_v2 *self )
-{
-    KPTrieIndexWhack_v2 ( & self -> pt );
-    TrieWhack ( & self -> key2id, KTrieIdxNodeWhack_v2, NULL );
-    free ( self -> ord2node );
-}
-
-/* initialize an index from file - can be NULL */
-rc_t KTrieIndexOpen_v2 ( KTrieIndex_v2 *self, const KMMap *mm, bool byteswap )
-{
-    rc_t rc;
-    bool ptorig = false;
-    const KDBHdr *hdr = NULL;
-
-#if ! KTRIE_ZEROS_KPTRIE
-#error "KTrie is supposed to zero KPTrie"
-#endif
-    memset ( self, 0, sizeof * self );
-    self -> pt . byteswap = byteswap;
-
-    /* create an empty Trie index,
-       with numeric but auto-expand character set,
-       and a bucket size of 512, beyond which the
-       tree will branch.
-    */
-    rc = TrieInit ( & self -> key2id, "0-9", 512, true );
-    if ( rc != 0 )
-        return rc;
-
-    /* when opened for create, there will be no existing index */
-    if ( mm == NULL )
-        return 0;
-
-    rc = KMMapAddrRead ( mm, (const void**) & hdr );
-    if ( rc != 0 )
-        return rc;
-
-    switch ( hdr -> version )
-    {
-    case 1:
-        rc = KPTrieIndexInitFromV1_v2 ( & self -> pt, mm, byteswap );
-        break;
-    case 2:
-        rc = KPTrieIndexInit_v2 ( & self -> pt, mm, byteswap );
-        break;
-    case 3:
-        ptorig = true;
-    case 4:
-        rc = KPTrieIndexInit_v3_v4 ( & self -> pt, mm, byteswap, ptorig );
-        break;
-    default:
-        rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion);
-    }
-    /* open the prior index in persisted mode, but
-       don't load it into the core-based Trie */
-    if ( rc == 0 )
-    {
-        /* the file existed but was empty */
-        if ( self -> pt . key2id == NULL )
-        {
-            self -> pt . mm = NULL;
-            return 0;
-        }
-
-        /* retain a reference to memory map */
-        rc = KMMapAddRef ( mm );
-        if ( rc == 0 )
-        {
-            self -> pt . mm = mm;
-            return 0;
-        }
-
-        /* self -> pt gets whacked below */
-    }
-
-    KTrieIndexWhack_v2 ( self );
-    return rc;
-}
-
-/* KTrieIndexPopulate_v2
- */
-typedef struct KTrieIndexPopulateData_v2_s2 KTrieIndexPopulateData_v2_s2;
-struct KTrieIndexPopulateData_v2_s2
-{
-    int64_t first;
-
-    KTrieIndex_v2 *self;
-    uint32_t count;
-    rc_t rc;
-
-    uint8_t id_bits;
-    uint8_t span_bits;
-};
-
-static
-bool CC KTrieIndexPopulate_v2_s2 ( PTNode *n, void *data )
-{
-    const String *key;
-    KTrieIndexPopulateData_v2_s2 *pb = data;
-
-    int64_t id;
-    size_t usize;
-    uint32_t span;
-
-    /* capture node data */
-    assert ( n -> data . size == sizeof id );
-    pb -> rc = Unpack ( pb -> id_bits, sizeof id * 8,
-        n -> data . addr, 0, pb -> id_bits, NULL, & id, sizeof id, & usize );
-    if ( pb -> rc == 0 )
-    {
-        pb -> rc = Unpack ( pb -> span_bits, sizeof span * 8,
-            n -> data . addr, pb -> id_bits, pb -> span_bits, NULL, & span, sizeof span, & usize );
-    }
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> rc = PTNodeMakeKey ( n, & key );
-    if ( pb -> rc == 0 )
-    {
-        KTrieIdxNode_v2_s2 *node;
-        pb -> rc = KTrieIdxNodeMake_v2_s2 ( & node, key, id + pb -> first );
-        StringWhack ( ( String* ) key );
-        if ( pb -> rc == 0 )
-        {
-            node -> span = span;
-
-            pb -> rc = TrieInsert ( & pb -> self -> key2id, & node -> n );
-            if ( pb -> rc == 0 )
-            {
-                ++ pb -> count;
-                return false;
-            }
-
-            KTrieIdxNodeWhack_v2 ( & node -> n, NULL );
-        }
-    }
-
-    return true;
-}
-
-/* KTrieIndexAttach_v2
- *  attach a keymap to an existing table
- */
-static
-rc_t KTrieIndexPopulate_v2_s1 ( KTrieIndex_v2 *self, uint32_t i, int64_t idd )
-{
-    rc_t rc;
-    uint32_t nid = self -> pt . ord2node [ i ];
-
-    if ( i != 0 && self -> pt . ord2node [ i - 1 ] == nid )
-        return 0;
-
-    i = self -> count;
-
-    if ( nid == 0 )
-    {
-        rc = KTrieIdxNodeMakeHole_v2_s1 ( & self -> ord2node [ i ], self -> pt . first + idd );
-        if ( rc == 0 )
-            self -> count = i + 1;
-    }
-    else
-    {
-        PTNode pnode;
-        rc = PTrieGetNode ( self -> pt . key2id, & pnode, nid );
-        if ( rc == 0 )
-        {
-            const String *key;
-            rc = PTNodeMakeKey ( & pnode, & key );
-            if ( rc == 0 )
-            {
-                rc = KTrieIdxNodeMake_v2_s1 ( & self -> ord2node [ i ],
-                    key, self -> pt . first + idd );
-                StringWhack ( ( String* ) key );
-                if ( rc == 0 )
-                {
-                    rc = TrieInsert ( & self -> key2id, & self -> ord2node [ i ] -> n );
-                    if ( rc != 0 )
-                        KTrieIdxNodeWhack_v2 ( & self -> ord2node [ i ] -> n, NULL );
-                    else
-                        self -> count = i + 1;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KTrieIndexAttach_v2 ( KTrieIndex_v2 *self, bool proj )
-{
-    rc_t rc = 0;
-
-    /* if persisted index is empty, bail */
-    if ( self -> count != 0 || self -> pt . count == 0 )
-        return 0;
-
-    /* see if we can use existing projection index */
-    if ( proj && self -> pt . ord2node != NULL )
-    {
-        uint32_t i;
-
-        self -> ord2node =
-            malloc ( ( ( self -> pt . count + 4095 ) & ~ 4095 ) * sizeof self -> ord2node [ 0 ] );
-        if ( self -> ord2node == NULL )
-            return RC ( rcDB, rcIndex, rcUpdating, rcMemory, rcExhausted );
-
-        /* we were called because our count is 0 */
-        assert ( self -> count == 0 );
-
-        /* handle variant */
-        assert ( self -> pt . variant == 0 || self -> pt . id2ord . v8 != NULL );
-        switch ( self -> pt . variant )
-        {
-        case 0:  /* 1-1 id to name */
-            for ( rc = 0, i = 0; i < self -> pt . count && rc == 0; ++ i )
-                rc = KTrieIndexPopulate_v2_s1 ( self, i, i );
-            break;
-        case 1:  /* sparse 8-bit   */
-            for ( rc = 0, i = 0; i < self -> pt . count && rc == 0; ++ i )
-                rc = KTrieIndexPopulate_v2_s1 ( self, i, self -> pt . id2ord . v8 [ i ] );
-            break;
-        case 2:  /* sparse 16-bit  */
-            for ( rc = 0, i = 0; i < self -> pt . count && rc == 0; ++ i )
-                rc = KTrieIndexPopulate_v2_s1 ( self, i, self -> pt . id2ord . v16 [ i ] );
-            break;
-        case 3:  /* sparse 32-bit  */
-            for ( rc = 0, i = 0; i < self -> pt . count && rc == 0; ++ i )
-                rc = KTrieIndexPopulate_v2_s1 ( self, i, self -> pt . id2ord . v32 [ i ] );
-            break;
-        case 4:  /* sparse 64-bit  */
-            for ( rc = 0, i = 0; i < self -> pt . count && rc == 0; ++ i )
-                rc = KTrieIndexPopulate_v2_s1 ( self, i, self -> pt . id2ord . v64 [ i ] );
-            break;
-        }
-
-        if ( rc != 0 )
-        {
-            for ( i = self -> count; i > 0; )
-                KTrieIdxNodeWhack_v2 ( & self -> ord2node [ -- i ] -> n, NULL );
-            free ( self -> ord2node ), self -> ord2node = NULL;
-            return rc;
-        }
-    }
-    else
-    {
-        KTrieIndexPopulateData_v2_s2 pb;
-        pb . first = self -> pt . first;
-        pb . self = self;
-        pb . count = 0;
-        pb . rc = 0;
-        PTrieDoUntil ( self -> pt . key2id, KTrieIndexPopulate_v2_s2, & pb );
-        if ( pb . rc == 0 && pb . count != self -> pt . count )
-            return RC ( rcDB, rcIndex, rcUpdating, rcIndex, rcCorrupt );
-        self -> count = pb . count;
-    }
-
-    /* record known dimensions */
-    self -> first = self -> pt . first;
-    self -> last = self -> pt . last;
-
-    /* should be able to drop persisted copy now */
-    KPTrieIndexWhack_v2 ( & self -> pt );
-
-    return 0;
-}
-
-rc_t KTrieIndexInsert_v2 ( KTrieIndex_v2 *self,
-    bool proj, const char *str, int64_t id )
-{
-    rc_t rc;
-    String key;
-    void *ord2node;
-    uint32_t count;
-
-#if DISABLE_PROJ
-    proj = false;
-#endif
-
-    /* get the number of nodes in proj index or Trie.
-       the persisted tree is only loaded into the in-core
-       tree for edits ( insert/delete ), so the counts
-       may differ. also, when in projection mode, the
-       count refers to the number of array slots, which
-       can be > the number of Trie nodes if there are
-       holes in the id space. when not projecting, count
-       is exactly the number of nodes in the Trie.
-    */
-    count = self -> count;
-
-    /* detect first modification */
-    if ( self -> count == 0 )
-    {
-        /* detect persisted data */
-        if ( self -> pt . key2id != NULL )
-        {
-            /* load persisted data into core */
-            rc = KTrieIndexAttach_v2 ( self, proj );
-            if ( rc != 0 )
-                return rc;
-
-            /* should have loaded everything */
-            assert ( self -> count != 0 );
-            count = self -> count;
-        }
-    }
-
-    /* v2 only allows increasing ids
-       they don't have to be contiguous,
-       but they cannot repeat and cannot decrease */
-    else if ( id <= self -> last )
-        return RC ( rcDB, rcIndex, rcInserting, rcConstraint, rcViolated );
-
-    /* convert key to String */
-    StringInitCString ( & key, str );
-
-    /* insertion strategy depends upon projection index */
-    if ( proj )
-    {
-        KTrieIdxNode_v2_s1 *node;
-
-        /* check for extension of last node */
-        if ( count != 0 )
-        {
-            /* a non-zero count implies nodes in projection array */
-            assert ( self -> ord2node != NULL );
-
-            /* get last node */
-            node = self -> ord2node [ count - 1 ];
-            assert ( node != NULL );
-
-            /* if the keys match, this is an update to the node */
-            if ( StringEqual ( & key, & node -> n . key ) )
-            {
-                /* this must be an extension of range */
-                if ( id != self -> last + 1 )
-                    return RC ( rcDB, rcIndex, rcInserting, rcConstraint, rcViolated );
-
-                /* extend and done */
-                self -> last = id;
-                return 0;
-            }
-
-            /* not last node - create a hole if needed */
-            if ( id != self -> last + 1 )
-            {
-                /* extend array if needed
-                   should never have to handle initial insert,
-                   but would be happy to do so if asked */
-                if ( ( count & 4095 ) == 0 )
-                {
-                    ord2node = realloc ( self -> ord2node,
-                        ( count + 4096 ) * sizeof self -> ord2node [ 0 ] );
-                    if ( ord2node == NULL )
-                        return RC ( rcDB, rcIndex, rcInserting, rcMemory, rcExhausted );
-                    self -> ord2node = ord2node;
-                }
-
-                /* create NULL mapping */
-                rc = KTrieIdxNodeMakeHole_v2_s1 ( & node, self -> last + 1 );
-                if ( rc != 0 )
-                    return rc;
-
-                /* NB - this will cause count to be > num_nodes in Trie */
-                self -> ord2node [ count ++ ] = node;
-            }
-        }
-
-        /* make a new mapping starting with id */
-        rc = KTrieIdxNodeMake_v2_s1 ( & node, & key, id );
-        if ( rc == 0 )
-        {
-            /* attempt insertion */
-            rc = TrieInsertUnique ( & self -> key2id, & node -> n, NULL );
-            if ( rc == 0 )
-            {
-                /* create or extend projection array */
-                if ( ( count & 4095 ) == 0 )
-                {
-                    ord2node = realloc ( self -> ord2node,
-                        ( count + 4096 ) * sizeof self -> ord2node [ 0 ] );
-                    if ( ord2node == NULL )
-                        rc = RC ( rcDB, rcIndex, rcInserting, rcMemory, rcExhausted );
-                    else
-                        self -> ord2node = ord2node;
-                }
-
-                if ( rc == 0 )
-                {
-                    /* set/extend range, detecting first insertion */
-                    self -> last = id;
-                    if ( count == 0 )
-                        self -> first = id;
-
-                    /* project */
-                    self -> ord2node [ count ] = node;
-                    self -> count = count + 1;
-
-                    /* insertion complete */
-                    return 0;
-                }
-
-                /* remove failed insertion */
-                TrieUnlink ( & self -> key2id, & node -> n );
-            }
-
-            /* clean up new node */
-            KTrieIdxNodeWhack_v2 ( & node -> n, NULL );
-        }
-
-        /* clean up insertion of hole */
-        if ( count != self -> count )
-        {
-            assert ( count - 1 == self -> count );
-            KTrieIdxNodeWhack_v2 ( & self -> ord2node [ count - 1 ] -> n, NULL );
-        }
-    }
-    else
-    {
-        KTrieIdxNode_v2_s2 *node;
-
-        /* make a new mapping starting with id and a span of 1 */
-        rc = KTrieIdxNodeMake_v2_s2 ( & node, & key, id );
-        if ( rc == 0 )
-        {
-            /* attempt insertion */
-            KTrieIdxNode_v2_s2 *exist;
-            rc = TrieInsertUnique ( & self -> key2id, & node -> n, ( TNode** ) & exist );
-            if ( rc == 0 )
-            {
-                /* set/extend range, detecting first insertion */
-                if ( count == 0 )
-                {
-                    self -> max_span = 1;
-                    self -> first = id;
-                }
-                self -> last = id;
-
-                /* insertion complete */
-                self -> count = count + 1;
-                return 0;
-            }
-
-            /* clean up new node */
-            KTrieIdxNodeWhack_v2 ( & node -> n, NULL );
-
-            /* check existing for proper extension */
-            if ( exist != NULL )
-            {
-                if ( id == exist -> start_id + exist -> span )
-                {
-                    assert ( count != 0 );
-
-                    /* we already know id > last
-                       and that it boarders the range of "exist"
-                       so it must be last + 1 */
-                    assert ( id - 1 == self -> last );
-                    self -> last = id;
-
-                    /* extend the span of "exist" */
-                    ++ exist -> span;
-                    if ( exist -> span > self -> max_span )
-                        self -> max_span = exist -> span;
-
-                    return 0;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* drop string from trie and all mappings */
-rc_t KTrieIndexDelete_v2 ( KTrieIndex_v2 *self, bool proj, const char *str )
-{
-    rc_t rc;
-    String key;
-    TNode *tnode;
-    uint32_t count;
-
-#if DISABLE_PROJ
-    proj = false;
-#endif
-
-    /* detect first modification */
-    count = self -> count;
-    if ( self -> count != 0 )
-    {
-        /* detect persisted data */
-        if ( self -> pt . key2id != NULL )
-        {
-            rc = KTrieIndexAttach_v2 ( self, proj );
-            if ( rc != 0 )
-                return rc;
-        }
-    }
-
-    StringInitCString ( & key, str );
-
-    /* interface states that all objects are dropped.
-       however, this implementation only allows unique
-       mappings to a contig range, so a simple find is sufficient */
-    tnode = TrieFind ( & self -> key2id, & key );
-    if ( tnode == NULL )
-        return RC ( rcDB, rcIndex, rcRemoving, rcString, rcNotFound );
-
-    /* remove from trie */
-    TrieUnlink ( & self -> key2id, tnode );
-
-    /* neutralize node in projection index */
-    if ( proj )
-    {
-        KTrieIdxNode_v2_s1 *node = ( KTrieIdxNode_v2_s1* ) tnode;
-        uint32_t ord = KTrieIndexNode2Ord_v2 ( self, node );
-        if ( ord != 0 )
-        {
-            self -> ord2node [ ord - 1 ] -> n . key . size = 0;
-            self -> ord2node [ ord - 1 ] -> n . key . len = 0;
-            self -> ord2node [ ord - 1 ] -> key [ 0 ] = 0;
-            return 0;
-        }
-    }
-
-    /* whack node */
-    KTrieIdxNodeWhack_v2 ( tnode, NULL );
-
-    return 0;
-}
-
-/* map key to id range */
-rc_t KTrieIndexFind_v2 ( const KTrieIndex_v2 *self,
-    const char *str, int64_t *start_id,
-#if V2FIND_RETURNS_SPAN
-    uint32_t *span,
-#endif
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data, bool convertFromV1 )
-{
-    /* search within in-core index */
-    if ( self -> count != 0 )
-    {
-        const TNode *tnode;
-
-        String key;
-        StringInitCString ( & key, str );
-
-        tnode = TrieFind ( & self -> key2id, & key );
-        if ( tnode != NULL )
-        {
-            if ( self -> ord2node != NULL )
-            {
-                const KTrieIdxNode_v2_s1 *node = ( const KTrieIdxNode_v2_s1* ) tnode;
-                uint32_t ord = KTrieIndexNode2Ord_v2 ( self, node );
-                if ( ord == 0 )
-                    return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcCorrupt );
-
-                * start_id = node -> start_id;
-#if V2FIND_RETURNS_SPAN
-                if ( ord == self -> count )
-                    * span = ( uint32_t ) ( self -> last - node -> start_id + 1 );
-                else
-                    * span = ( uint32_t ) ( self -> ord2node [ ord ] -> start_id - node -> start_id );
-#endif
-            }
-            else
-            {
-                const KTrieIdxNode_v2_s2 *node = ( const KTrieIdxNode_v2_s2* ) tnode;
-                * start_id = node -> start_id;
-#if V2FIND_RETURNS_SPAN
-                * span = node -> span;
-#endif
-            }
-
-            return 0;
-        }
-    }
-
-    /* search within persisted index */
-    else if ( self -> pt . key2id != NULL )
-    {
-        return KPTrieIndexFind_v2 ( & self -> pt, str, start_id,
-#if V2FIND_RETURNS_SPAN
-                                    span,
-#endif
-                                    custom_cmp, data, convertFromV1 );
-    }
-
-    return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNotFound );
-}
-
-/* projection index id to key-string */
-typedef struct KTrieIndexProjectData_v2 KTrieIndexProjectData_v2;
-struct KTrieIndexProjectData_v2
-{
-    int64_t id;
-    const KTrieIdxNode_v2_s2 *node;
-};
-
-static
-bool CC KTrieIndexProjectScan_v2 ( TNode *n, void *data )
-{
-    KTrieIndexProjectData_v2 *pb = (KTrieIndexProjectData_v2 *)data;
-    const KTrieIdxNode_v2_s2 *node = ( const KTrieIdxNode_v2_s2* ) n;
-
-    if ( pb -> id >= node -> start_id &&
-         pb -> id < node -> start_id + node -> span )
-    {
-        pb -> node = node;
-        return true;
-    }
-
-    return false;
-}
-
-rc_t KTrieIndexProject_v2 ( const KTrieIndex_v2 *self,
-    int64_t id,
-#if V2FIND_RETURNS_SPAN
-     int64_t *start_id, uint32_t *span,
-#endif
-    char *key_buff, size_t buff_size, size_t *actsize )
-{
-    if ( self -> count != 0 )
-    {
-        if ( self -> ord2node != NULL )
-        {
-            uint32_t ord = KTrieIndexID2Ord_v2 ( self, id );
-            if ( ord != 0 )
-            {
-                const KTrieIdxNode_v2_s1 *node = self -> ord2node [ ord - 1 ];
-                
-                if (actsize)
-                    *actsize = node -> n . key . size;
-                if ( node -> n . key . size >= buff_size )
-                    return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                string_copy ( key_buff, buff_size,
-                    node -> n . key . addr, node -> n . key . size );
-                * start_id = node -> start_id;
-                * span = ( ( ord == self -> count ) ?
-                    ( self -> last + 1 ) : ( self -> ord2node [ ord ] -> start_id ) ) - node -> start_id;
-                return 0;
-            }
-        }
-        else
-        {
-            KTrieIndexProjectData_v2 pb;
-            pb . id = id;
-            if ( TrieDoUntil ( & self -> key2id, KTrieIndexProjectScan_v2, & pb ) )
-            {
-                const KTrieIdxNode_v2_s2 *node = pb . node;
-                
-                if (actsize)
-                    *actsize = node -> n . key . size;
-                if ( node -> n . key . size >= buff_size )
-                    return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcInsufficient );
-                string_copy ( key_buff, buff_size,
-                    node -> n . key . addr, node -> n . key . size );
-                * start_id = node -> start_id;
-                * span = node -> span;
-                return 0;
-            }
-        }
-    }
-
-    else if ( self -> pt . ord2node != NULL )
-    {
-        return KPTrieIndexProject_v2 ( & self -> pt, id,
-#if V2FIND_RETURNS_SPAN
-            start_id, span,
-#endif
-            key_buff, buff_size, actsize );
-    }
-
-    return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
-}
diff --git a/libs/kdb/wu64idx-v3.c b/libs/kdb/wu64idx-v3.c
deleted file mode 100644
index dd39415..0000000
--- a/libs/kdb/wu64idx-v3.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/extern.h>
-
-#include "windex-priv.h"
-
-#include <kdb/index.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/md5.h>
-#include <kfs/mmap.h>
-#include <klib/pbstree.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef struct KU64Index_PNode_struct {
-    uint64_t key;
-    uint64_t key_size;
-    int64_t id;
-    uint64_t id_qty;
-} KU64Index_PNode;
-
-typedef struct KU64Index_Node_struct {
-    BSTNode node;
-    uint64_t key;
-    uint64_t key_size;
-    int64_t id;
-    uint64_t id_qty;
-} KU64Index_Node;
-
-static
-int CC KU64Index_NodeSort( const BSTNode *item, const BSTNode *node )
-{
-    const KU64Index_Node* i = (const KU64Index_Node*)item;
-    const KU64Index_Node* n = (const KU64Index_Node*)node;
-
-    if( i->key < n->key ) {
-        return -1;
-    } else if( i->key > n->key ) {
-        return 1;
-    }
-    return 0;
-}
-
-static
-int CC KU64Index_NodeSortUnique( const BSTNode *item, const BSTNode *node )
-{
-    const KU64Index_Node* i = (const KU64Index_Node*)item;
-    const KU64Index_Node* n = (const KU64Index_Node*)node;
-
-    if( (i->key + i->key_size - 1) < n->key ) {
-        return -1;
-    } else if( i->key > (n->key + n->key_size - 1) ) {
-        return 1;
-    }
-    return 0;
-}
-
-static
-bool CC KU64Index_UnrollPersisted( PBSTNode *n, void *data )
-{
-    KU64Index_v3* self = data;
-    const KU64Index_PNode* pn = n->data.addr;
-
-    KU64Index_Node* node = calloc(1, sizeof(KU64Index_Node));
-    if( node == NULL ) {
-        self->rc = RC(rcExe, rcNode, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        node->key = pn->key;
-        node->key_size = pn->key_size;
-        node->id = pn->id;
-        node->id_qty = pn->id_qty;
-        self->rc = BSTreeInsert(&self->tree, &node->node, KU64Index_NodeSort);
-    }
-    if( self->rc != 0 ) {
-        free(node);
-    }
-    return self->rc == 0 ? false : true;
-}
-
-rc_t KU64IndexOpen_v3(KU64Index_v3* self, struct KMMap const *mm, bool byteswap)
-{
-    rc_t rc = 0;
-    const char* maddr;
-    size_t msize;
-    PBSTree* ptree = NULL;
-
-    self->rc = 0;
-    BSTreeInit(&self->tree);
-
-    /* when opened for create, there will be no existing index */
-    if( mm == NULL ) {
-        return 0;
-    }
-
-    /* open the prior index in persisted mode */
-    rc = KMMapAddrRead(mm, (const void**)&maddr);
-    if( rc != 0 ) {
-        return rc;
-    }
-    rc = KMMapSize(mm, &msize);
-    if( rc != 0 ) {
-        return rc;
-    }
-    if( msize <= sizeof(struct KIndexFileHeader_v3) ) {
-        return 0;
-    }
-
-    rc = PBSTreeMake(&ptree, (const void**)(maddr + sizeof(struct KIndexFileHeader_v3)),
-                     msize - sizeof(struct KIndexFileHeader_v3), byteswap);
-    if( rc != 0 ) {
-        return rc;
-    }
-
-    PBSTreeDoUntil(ptree, false, KU64Index_UnrollPersisted, self);
-    rc = self->rc;
-
-    PBSTreeWhack(ptree);
-
-    if( rc != 0 ) {
-        KU64IndexWhack_v3(self);
-    }
-    return rc;
-}
-
-static
-void CC KU64Index_WhackBSTree( BSTNode *n, void *data )
-{
-    free((KU64Index_Node*)n);
-}
-
-rc_t KU64IndexWhack_v3(KU64Index_v3* self)
-{
-    self->rc = 0;
-    BSTreeWhack(&self->tree, KU64Index_WhackBSTree, NULL);
-    return 0;
-}
-
-rc_t KU64IndexInsert_v3(KU64Index_v3* self, bool unique, uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty)
-{
-    KU64Index_Node* node = calloc(1, sizeof(KU64Index_Node));
-    self->rc = 0;
-
-    if( node == NULL ) {
-        self->rc = RC(rcExe, rcNode, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        node->key = key;
-        node->key_size = key_size;
-        node->id = id;
-        node->id_qty = id_qty;
-        if( unique ) {
-            self->rc = BSTreeInsertUnique(&self->tree, &node->node, NULL, KU64Index_NodeSortUnique);
-        } else {
-            self->rc = BSTreeInsert(&self->tree, &node->node, KU64Index_NodeSort);
-        }
-    }
-    if( self->rc != 0 ) {
-        free(node);
-    }
-    return self->rc;
-}
-
-static
-int CC KU64Index_Cmp4Delete( const void *item, const BSTNode *node )
-{
-    const KU64Index_Node* i = (const KU64Index_Node*)item;
-    const KU64Index_Node* n = (const KU64Index_Node*)node;
-
-    if( i->key < n->key ) {
-        return -1;
-    } else if( i->key > n->key ) {
-        return 1;
-    }
-    return 0;
-}
-
-rc_t KU64IndexDelete_v3(KU64Index_v3* self, uint64_t key)
-{
-    KU64Index_Node node;
-    BSTNode* n = NULL;
-
-    self->rc = 0;
-    node.key = key;
-    n = BSTreeFind(&self->tree, &node, KU64Index_Cmp4Delete);
-    if( n != NULL ) {
-        if( !BSTreeUnlink(&self->tree, n) ) {
-            self->rc = RC(rcDB, rcIndex, rcDestroying, rcId, rcCorrupt);
-        }
-    } else {
-        self->rc = RC(rcDB, rcIndex, rcDestroying, rcId, rcNotFound);
-    }
-    return self->rc;
-}
-
-typedef struct KU64Index_PersistData_struct
-{
-    uint64_t pos;
-    KFile *file;
-    KMD5File *file_md5;
-} KU64Index_PersistData;
-
-static
-rc_t CC KU64Index_WriteFunc( void *param, const void *buffer, size_t size, size_t *num_writ )
-{
-    KU64Index_PersistData* pd = param;
-    rc_t rc = KFileWrite(pd->file, pd->pos, buffer, size, num_writ);
-    pd->pos += *num_writ;
-    return rc;
-}
-
-static
-rc_t CC KU64Index_AuxFunc(void *param, const void *node, size_t *num_writ, PTWriteFunc write, void *write_param )
-{
-    rc_t rc = 0;
-    const KU64Index_Node* n = (const KU64Index_Node*)node;
-    int sz = sizeof(KU64Index_Node) - sizeof(BSTNode);
-
-    if( write != NULL ) {
-        rc = (*write)(write_param, &n->key, sz, num_writ);
-    } else {
-        *num_writ = sz;
-    }
-    return rc;
-}
-
-rc_t KU64IndexPersist_v3(KU64Index_v3* self, bool proj, KDirectory *dir, const char *path, bool use_md5)
-{
-    KU64Index_PersistData pd;
-    char tmpname[256];
-    char tmpmd5name[256];
-    char md5path[256];
-
-    self->rc = 0;
-    memset(&pd, 0, sizeof(KU64Index_PersistData));
-
-    self->rc = KDirectoryResolvePath(dir, false, tmpname, sizeof(tmpname), "%s.tmp", path);
-
-    if( self->rc == 0 ) {
-        self->rc = KDirectoryVCreateFile(dir, &pd.file, true, 0664, kcmInit, tmpname, NULL);
-
-        if(use_md5 && self->rc == 0 ) {
-
-            KMD5SumFmt *km = NULL;
-            size_t tmplen = snprintf(tmpmd5name, sizeof(tmpmd5name), "%s.md5", tmpname);
-            KFile* kf = NULL;
-
-            if( tmplen >= sizeof(tmpmd5name) ) {
-                self->rc = RC(rcDB, rcIndex, rcPersisting, rcName, rcExcessive);
-            } else {
-
-                tmplen = snprintf(md5path, sizeof(md5path), "%s.md5", path);
-                if( tmplen >= sizeof(md5path) ) {
-                    self->rc = RC(rcDB, rcIndex, rcPersisting, rcName, rcExcessive);
-                } else {
-
-                    self->rc = KDirectoryVCreateFile(dir, &kf, true, 0664, kcmInit, tmpmd5name, NULL);
-                    if( self->rc == 0 ) {
-                        self->rc = KMD5SumFmtMakeUpdate(&km, kf);
-                        if( self->rc == 0 ) {
-                            KMD5File * k5f;
-                            kf = NULL;
-                            self->rc = KMD5FileMakeWrite(&k5f, pd.file, km, path);
-                            if( self->rc == 0 ) {
-                                pd.file_md5 = k5f;
-                                pd.file = KMD5FileToKFile(k5f);
-                            }
-                            /* release pass or fail */
-                            KMD5SumFmtRelease(km);
-                        } else {
-                            KFileRelease ( kf );
-                        }
-                    } else {
-                        KFileRelease ( kf );
-                    }
-                }
-            }
-            if( self->rc != 0 ) {
-                KFileRelease(pd.file);
-            }
-        }
-
-        if( self->rc == 0 ) {
-            struct KIndexFileHeader_v3 head;
-            size_t writ = 0;
-
-            KDBHdrInit(&head.h, 3);
-            head.index_type = kitU64;
-            self->rc = KFileWrite(pd.file, pd.pos, &head, sizeof(struct KIndexFileHeader_v3), &writ);
-            if( self->rc == 0 ) {
-                pd.pos += writ;
-                if( use_md5 ) {
-                    KMD5FileBeginTransaction(pd.file_md5);
-                }
-                self->rc = BSTreePersist(&self->tree, NULL, KU64Index_WriteFunc, &pd, KU64Index_AuxFunc, &pd);
-            }
-            KFileRelease(pd.file);
-            pd.file = NULL;
-        }
-    }
-
-    if( self->rc == 0 ) {
-        self->rc = KDirectoryRename(dir, false, tmpname, path);
-        if( self->rc == 0 ) {
-            if ( use_md5 ) {
-                self->rc = KDirectoryRename(dir, false, tmpmd5name, md5path);
-            }
-            if( self->rc == 0 ) {
-                /* done */
-                return 0;
-            }
-        }
-    }
-
-    /* whack temporary file */
-    KDirectoryVRemove(dir, false, tmpname, NULL);
-    if( use_md5 ) {
-        KDirectoryVRemove(dir, false, tmpmd5name, NULL);
-    }
-    return self->rc;
-}
-
-typedef struct KU64Index_GrepData_struct {
-    rc_t rc;
-    rc_t (CC*func)(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data);
-    void* data;
-    KU64Index_Node search;
-    uint64_t* key;
-    uint64_t* key_size;
-    int64_t* id;
-    uint64_t* id_qty;
-} KU64Index_GrepData;
-
-/*
- * return true: if found or break DoUntil for FindAll
- */
-static
-bool CC KU64Index_Grep(BSTNode *node, void *data)
-{
-    KU64Index_Node* n = (KU64Index_Node*)node;
-    KU64Index_GrepData* d = data;
-
-    if( d->search.key >= n->key && (d->search.key - n->key) < n->key_size ) {
-        if( d->func ) {
-            d->rc = (*d->func)(n->key, n->key_size, n->id, n->id_qty, d->data);
-            if( d->rc != 0 ) {
-                return true;
-            }
-        } else {
-            *d->key = n->key;
-            *d->key_size = n->key_size;
-            *d->id = n->id;
-            *d->id_qty = n->id_qty;
-            return true;
-        }
-    }
-    return false;
-}
-
-rc_t KU64IndexFind_v3( const KU64Index_v3* self, uint64_t offset, uint64_t* key, uint64_t* key_size, int64_t* id, uint64_t* id_qty )
-{
-    KU64Index_GrepData d;
-
-    memset(&d, 0, sizeof(KU64Index_GrepData));
-    d.search.key = offset;
-    d.key = key;
-    d.key_size = key_size;
-    d.id = id;
-    d.id_qty = id_qty;
-    if( !BSTreeDoUntil(&self->tree, false, KU64Index_Grep, &d) ) {
-        d.rc = RC(rcDB, rcIndex, rcSelecting, rcId, rcNotFound);
-    }
-    return d.rc;
-}
-
-
-rc_t KU64IndexFindAll_v3( const KU64Index_v3* self, uint64_t offset, 
-    rc_t (CC*f)(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data), void* data)
-{
-    KU64Index_GrepData d;
-
-    memset(&d, 0, sizeof(KU64Index_GrepData));
-    d.func = f;
-    d.data = data;
-    d.search.key = offset;
-    BSTreeDoUntil(&self->tree, false, KU64Index_Grep, &d);
-    return d.rc;
-}
diff --git a/libs/kfg/Makefile b/libs/kfg/Makefile
deleted file mode 100644
index 7220a5a..0000000
--- a/libs/kfg/Makefile
+++ /dev/null
@@ -1,103 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kfg
-
-INT_LIBS = \
-	libkfg
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-TEST_TOOLS = \
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(TEST_TOOLS): makedirs
-	@ $(MAKE_CMD) $(TEST_BINDIR)/$@
-
-.PHONY: all std $(ALL_LIBS) $(TEST_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(TEST_TOOLS)))
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# kfg
-#
-$(ILIBDIR)/libkfg: $(TARGDIR)/default.kfg $(addprefix $(ILIBDIR)/libkfg.,$(ILIBEXT))
-
-$(TARGDIR)/default.kfg: $(NCBIDIR)/default.kfg $(TEST_BINDIR)/ncbi/default.kfg
-
-$(NCBIDIR)/default.kfg: $(SRCDIR)/default.kfg
-	rm -f $(NCBIDIR)/config.kfg
-	cp $^ $@
-
-$(TEST_BINDIR)/ncbi/default.kfg: $(SRCDIR)/default.kfg
-	mkdir -p $(TEST_BINDIR)/ncbi
-	cp $^ $@
-
-KFG_SRC = \
-	config-grammar \
-	config-lex \
-	config \
-	kart \
-	repository \
-	report-kfg \
-    keystore 
-
-KFG_OBJ = \
-	$(addsuffix .$(LOBX),$(KFG_SRC))
-
-KFG_LIB = \
-	-dkfs \
-	-dklib
-
-$(ILIBDIR)/libkfg.$(LIBX): $(INTERM_SRC) $(KFG_OBJ)
-	$(LD) --slib -o $@ $^ $(KFG_LIB)
-
diff --git a/libs/kfg/config-grammar.c b/libs/kfg/config-grammar.c
deleted file mode 100644
index 60c9a8a..0000000
--- a/libs/kfg/config-grammar.c
+++ /dev/null
@@ -1,1725 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
-
-/* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
-   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 3 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, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "2.5"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names.  */
-#define yyparse         KFG_parse
-#define yylex           KFG_lex
-#define yyerror         KFG_error
-#define yylval          KFG_lval
-#define yychar          KFG_char
-#define yydebug         KFG_debug
-#define yynerrs         KFG_nerrs
-
-
-/* Copy the first part of user declarations.  */
-
-  
-	#include <sysalloc.h>
-
-	#include "kfg-parse.h"
-	
-	#define YYSTYPE KFGSymbol
-	#include "config-tokens.h"
-		
-	#define KFG_lex KFGScan_yylex
-	
-	/* required parameter to VNamelistMake */
-	#define NAMELIST_ALLOC_BLKSIZE 10
-	
-	static void ReportRc(KFGParseBlock* pb, KFGScanBlock* sb, rc_t rc);
-	static void AppendName(KFGScanBlock* sb, VNamelist*, const KFGParseBlock*);
-
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     kfgEND_INPUT = 0,
-     kfgEND_LINE = 258,
-     kfgUNTERM_STRING = 259,
-     kfgUNTERM_ESCAPED_STRING = 260,
-     kfgUNRECOGNIZED = 261,
-     kfgVAR_REF = 262,
-     kfgUNTERM_VAR_REF = 263,
-     kfgASSIGN = 264,
-     kfgSTRING = 265,
-     kfgESCAPED_STRING = 266,
-     kfgABS_PATH = 267,
-     kfgREL_PATH = 268
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-
-	KFGParseBlock		pb;
-	const VNamelist*	namelist;
-
-
-
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-/* Copy the second part of user declarations.  */
-
-
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
-#endif
-{
-  return yyi;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef EXIT_SUCCESS
-#      define EXIT_SUCCESS 0
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
-       && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef EXIT_SUCCESS
-#    define EXIT_SUCCESS 0
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss_alloc;
-  YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
-#  endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  13
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   21
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  14
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  8
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  17
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  23
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   268
-
-#define YYTRANSLATE(YYX)						\
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11,    12,    13
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     5,     7,     9,    12,    17,    19,    22,
-      24,    26,    28,    30,    32,    35,    38,    40
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      15,     0,    -1,    16,    -1,     0,    -1,    17,    -1,    16,
-      17,    -1,    18,    19,    20,    21,    -1,     3,    -1,     1,
-      21,    -1,    12,    -1,    13,    -1,     9,    -1,    10,    -1,
-      11,    -1,    20,    10,    -1,    20,    11,    -1,     3,    -1,
-       0,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_uint8 yyrline[] =
-{
-       0,    82,    82,    83,    87,    88,    92,   101,   102,   106,
-     107,   111,   115,   116,   117,   118,   122,   123
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "kfgEND_INPUT", "error", "$undefined", "kfgEND_LINE",
-  "kfgUNTERM_STRING", "kfgUNTERM_ESCAPED_STRING", "kfgUNRECOGNIZED",
-  "kfgVAR_REF", "kfgUNTERM_VAR_REF", "kfgASSIGN", "kfgSTRING",
-  "kfgESCAPED_STRING", "kfgABS_PATH", "kfgREL_PATH", "$accept", "config",
-  "name_value_pairs", "name_value_pair", "pathname", "assign_op", "value",
-  "line_end", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    14,    15,    15,    16,    16,    17,    17,    17,    18,
-      18,    19,    20,    20,    20,    20,    21,    21
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     1,     1,     1,     2,     4,     1,     2,     1,
-       1,     1,     1,     1,     2,     2,     1,     1
-};
-
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,     3,     0,     7,     9,    10,     0,     0,     4,     0,
-      17,    16,     8,     1,     5,    11,     0,    12,    13,     0,
-      14,    15,     6
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     6,     7,     8,     9,    16,    19,    12
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -5
-static const yytype_int8 yypact[] =
-{
-       0,    -5,     6,    -5,    -5,    -5,     2,     4,    -5,     1,
-      -5,    -5,    -5,    -5,    -5,    -5,    10,    -5,    -5,     8,
-      -5,    -5,    -5
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-      -5,    -5,    -5,     7,    -5,    -5,    -5,    -4
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -3
-static const yytype_int8 yytable[] =
-{
-       1,     2,    13,     3,    -2,     2,    10,     3,    10,    11,
-      15,    11,     4,     5,    14,    22,     4,     5,    20,    21,
-      17,    18
-};
-
-#define yypact_value_is_default(yystate) \
-  ((yystate) == (-5))
-
-#define yytable_value_is_error(yytable_value) \
-  YYID (0)
-
-static const yytype_uint8 yycheck[] =
-{
-       0,     1,     0,     3,     0,     1,     0,     3,     0,     3,
-       9,     3,    12,    13,     7,    19,    12,    13,    10,    11,
-      10,    11
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     0,     1,     3,    12,    13,    15,    16,    17,    18,
-       0,     3,    21,     0,    17,     9,    19,    10,    11,    20,
-      10,    11,    21
-};
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)					\
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    {								\
-      yychar = (Token);						\
-      yylval = (Value);						\
-      YYPOPSTACK (1);						\
-      goto yybackup;						\
-    }								\
-  else								\
-    {								\
-      yyerror (pb, sb, YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
-
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)				\
-    do									\
-      if (YYID (N))                                                    \
-	{								\
-	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
-	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
-	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
-	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
-	}								\
-      else								\
-	{								\
-	  (Current).first_line   = (Current).last_line   =		\
-	    YYRHSLOC (Rhs, 0).last_line;				\
-	  (Current).first_column = (Current).last_column =		\
-	    YYRHSLOC (Rhs, 0).last_column;				\
-	}								\
-    while (YYID (0))
-#endif
-
-
-/* This macro is provided for backward compatibility. */
-
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, sb)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value, pb, sb); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, KFGParseBlock* pb, KFGScanBlock* sb)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, pb, sb)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    KFGParseBlock* pb;
-    KFGScanBlock* sb;
-#endif
-{
-  if (!yyvaluep)
-    return;
-  YYUSE (pb);
-  YYUSE (sb);
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
-# endif
-  switch (yytype)
-    {
-      default:
-	break;
-    }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, KFGParseBlock* pb, KFGScanBlock* sb)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, pb, sb)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    KFGParseBlock* pb;
-    KFGScanBlock* sb;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, pb, sb);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; yybottom <= yytop; yybottom++)
-    {
-      int yybot = *yybottom;
-      YYFPRINTF (stderr, " %d", yybot);
-    }
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, KFGParseBlock* pb, KFGScanBlock* sb)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule, pb, sb)
-    YYSTYPE *yyvsp;
-    int yyrule;
-    KFGParseBlock* pb;
-    KFGScanBlock* sb;
-#endif
-{
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       		       , pb, sb);
-      YYFPRINTF (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, Rule, pb, sb); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
-
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
-
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
-                yytype_int16 *yyssp, int yytoken)
-{
-  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
-  YYSIZE_T yysize = yysize0;
-  YYSIZE_T yysize1;
-  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-  /* Internationalized format string. */
-  const char *yyformat = 0;
-  /* Arguments of yyformat. */
-  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Number of reported tokens (one for the "unexpected", one per
-     "expected"). */
-  int yycount = 0;
-
-  /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
-     - If this state is a consistent state with a default action, then
-       the only way this function was invoked is if the default action
-       is an error action.  In that case, don't check for expected
-       tokens because there are none.
-     - The only way there can be no lookahead present (in yychar) is if
-       this state is a consistent state with a default action.  Thus,
-       detecting the absence of a lookahead is sufficient to determine
-       that there is no unexpected or expected token to report.  In that
-       case, just report a simple "syntax error".
-     - Don't assume there isn't a lookahead just because this state is a
-       consistent state with a default action.  There might have been a
-       previous inconsistent state, consistent state with a non-default
-       action, or user semantic action that manipulated yychar.
-     - Of course, the expected token list depends on states to have
-       correct lookahead information, and it depends on the parser not
-       to perform extra reductions after fetching a lookahead from the
-       scanner and before detecting a syntax error.  Thus, state merging
-       (from LALR or IELR) and default reductions corrupt the expected
-       token list.  However, the list is correct for canonical LR with
-       one exception: it will still contain any token that will not be
-       accepted due to an error action in a later state.
-  */
-  if (yytoken != YYEMPTY)
-    {
-      int yyn = yypact[*yyssp];
-      yyarg[yycount++] = yytname[yytoken];
-      if (!yypact_value_is_default (yyn))
-        {
-          /* Start YYX at -YYN if negative to avoid negative indexes in
-             YYCHECK.  In other words, skip the first -YYN actions for
-             this state because they are default actions.  */
-          int yyxbegin = yyn < 0 ? -yyn : 0;
-          /* Stay within bounds of both yycheck and yytname.  */
-          int yychecklim = YYLAST - yyn + 1;
-          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-          int yyx;
-
-          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
-                && !yytable_value_is_error (yytable[yyx + yyn]))
-              {
-                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                  {
-                    yycount = 1;
-                    yysize = yysize0;
-                    break;
-                  }
-                yyarg[yycount++] = yytname[yyx];
-                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-                if (! (yysize <= yysize1
-                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                  return 2;
-                yysize = yysize1;
-              }
-        }
-    }
-
-  switch (yycount)
-    {
-# define YYCASE_(N, S)                      \
-      case N:                               \
-        yyformat = S;                       \
-      break
-      YYCASE_(0, YY_("syntax error"));
-      YYCASE_(1, YY_("syntax error, unexpected %s"));
-      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
-    }
-
-  yysize1 = yysize + yystrlen (yyformat);
-  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-    return 2;
-  yysize = yysize1;
-
-  if (*yymsg_alloc < yysize)
-    {
-      *yymsg_alloc = 2 * yysize;
-      if (! (yysize <= *yymsg_alloc
-             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-      return 1;
-    }
-
-  /* Avoid sprintf, as that infringes on the user's name space.
-     Don't have undefined behavior even if the translation
-     produced a string with the wrong number of "%s"s.  */
-  {
-    char *yyp = *yymsg;
-    int yyi = 0;
-    while ((*yyp = *yyformat) != '\0')
-      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-        {
-          yyp += yytnamerr (yyp, yyarg[yyi++]);
-          yyformat += 2;
-        }
-      else
-        {
-          yyp++;
-          yyformat++;
-        }
-  }
-  return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, KFGParseBlock* pb, KFGScanBlock* sb)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, pb, sb)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    KFGParseBlock* pb;
-    KFGScanBlock* sb;
-#endif
-{
-  YYUSE (yyvaluep);
-  YYUSE (pb);
-  YYUSE (sb);
-
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-      case 20: /* "value" */
-
-	{
-	VNamelistRelease((yyvaluep->namelist));
-};
-
-	break;
-
-      default:
-	break;
-    }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (KFGParseBlock* pb, KFGScanBlock* sb);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (KFGParseBlock* pb, KFGScanBlock* sb)
-#else
-int
-yyparse (pb, sb)
-    KFGParseBlock* pb;
-    KFGScanBlock* sb;
-#endif
-#endif
-{
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-
-    /* Number of syntax errors so far.  */
-    int yynerrs;
-
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-
-       Refer to the stacks thru separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-  int yyn;
-  int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken;
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
-  yystacksize = YYINITDEPTH;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yystacksize);
-
-	yyss = yyss1;
-	yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
-
-      {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-#  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     lookahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-  yyn = yypact[yystate];
-  if (yypact_value_is_default (yyn))
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yytable_value_is_error (yyn))
-        goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the lookahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
-  yystate = yyn;
-  *++yyvsp = yylval;
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 6:
-
-    { 
-			rc_t rc=sb->write_nvp(sb->self, (yyvsp[(1) - (4)].pb).tokenText, (yyvsp[(1) - (4)].pb).tokenLength, (yyvsp[(3) - (4)].namelist));
-			if (rc != 0)
-			{
-				ReportRc(pb, sb, rc);
-			}
-			VNamelistRelease((yyvsp[(3) - (4)].namelist));
-		}
-    break;
-
-  case 12:
-
-    { VNamelistMake(&(yyval.namelist), NAMELIST_ALLOC_BLKSIZE); AppendName(sb, (yyval.namelist), &(yyvsp[(1) - (1)].pb)); }
-    break;
-
-  case 13:
-
-    { VNamelistMake(&(yyval.namelist), NAMELIST_ALLOC_BLKSIZE); AppendName(sb, (yyval.namelist), &(yyvsp[(1) - (1)].pb)); }
-    break;
-
-  case 14:
-
-    { AppendName(sb, (yyvsp[(1) - (2)].namelist), &(yyvsp[(2) - (2)].pb)); (yyval.namelist)=(yyvsp[(1) - (2)].namelist); }
-    break;
-
-  case 15:
-
-    { AppendName(sb, (yyvsp[(1) - (2)].namelist), &(yyvsp[(2) - (2)].pb)); (yyval.namelist)=(yyvsp[(1) - (2)].namelist); }
-    break;
-
-
-
-      default: break;
-    }
-  /* User semantic actions sometimes alter yychar, and that requires
-     that yytoken be updated with the new translation.  We take the
-     approach of translating immediately before every use of yytoken.
-     One alternative is translating here after every semantic action,
-     but that translation would be missed if the semantic action invokes
-     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-     incorrect destructor might then be invoked immediately.  In the
-     case of YYERROR or YYBACKUP, subsequent parser actions might lead
-     to an incorrect destructor call or verbose syntax error message
-     before the lookahead is translated.  */
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* Make sure we have latest lookahead translation.  See comments at
-     user semantic actions for why this is necessary.  */
-  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (pb, sb, YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
-                                        yyssp, yytoken)
-      {
-        char const *yymsgp = YY_("syntax error");
-        int yysyntax_error_status;
-        yysyntax_error_status = YYSYNTAX_ERROR;
-        if (yysyntax_error_status == 0)
-          yymsgp = yymsg;
-        else if (yysyntax_error_status == 1)
-          {
-            if (yymsg != yymsgbuf)
-              YYSTACK_FREE (yymsg);
-            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
-            if (!yymsg)
-              {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
-              }
-            else
-              {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
-              }
-          }
-        yyerror (pb, sb, yymsgp);
-        if (yysyntax_error_status == 2)
-          goto yyexhaustedlab;
-      }
-# undef YYSYNTAX_ERROR
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
-
-      if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
-      else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, pb, sb);
-	  yychar = YYEMPTY;
-	}
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-	YYABORT;
-
-
-      yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, pb, sb);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  *++yyvsp = yylval;
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#if !defined(yyoverflow) || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (pb, sb, YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEMPTY)
-    {
-      /* Make sure we have latest lookahead translation.  See comments at
-         user semantic actions for why this is necessary.  */
-      yytoken = YYTRANSLATE (yychar);
-      yydestruct ("Cleanup: discarding lookahead",
-                  yytoken, &yylval, pb, sb);
-    }
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, pb, sb);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
-}
-
-
-
-
-
-#include <assert.h>
-#include <klib/token.h>
-#include <klib/log.h>
-#include <klib/writer.h>
-
-void KFG_error(KFGParseBlock* pb, KFGScanBlock* sb, const char* msg)
-{
-    sb->report_error(sb, msg);
-}
-
-void ReportRc(KFGParseBlock* pb, KFGScanBlock* sb, rc_t rc)
-{
-	char buf[1025];
-	size_t num_writ;
-	RCExplain(rc, buf, 1024, &num_writ);
-	buf[1024]=0;
-	yyerror(0, sb, buf);
-}
-
-void AppendName(KFGScanBlock* sb, VNamelist* nl, const KFGParseBlock* pb)
-{	/* pb represents either a kfgSTRING or a kfgESCAPED_STRING with opening and closed quotes clipped */
-    rc_t rc;
-    KToken t;
-    size_t value_size;
-    char* buf;
-
-	if (pb->tokenLength == 0)
-	{
-		return;
-	}
-		    
-    t.id= pb->tokenId == kfgESCAPED_STRING ? eEscapedString : eString;
-    StringInit(&t.str, pb->tokenText-1, pb->tokenLength+2, pb->tokenLength+2); /* compensate for clipped quotes in order to use KTokenToString */
-    buf=(char*)malloc(t.str.size);
-
-	/* KTokenToString removes opening and closing quotes and handles escapes if present */
-	rc = KTokenToString (&t, buf, t.str.size, &value_size);
-	if (rc != 0)
-	{
-		ReportRc(0, sb, rc);
-	}
-	else
-	{	
-		assert(value_size < t.str.size);
-        buf[value_size]=0;
-		rc = VNamelistAppend(nl, buf);
-		if (rc != 0)
-		{
-			ReportRc(0, sb, rc);
-		}
-	}		
-	free(buf);
-}
-
-
-	
-
diff --git a/libs/kfg/config-lex.c b/libs/kfg/config-lex.c
deleted file mode 100644
index 74d1c4b..0000000
--- a/libs/kfg/config-lex.c
+++ /dev/null
@@ -1,2511 +0,0 @@
-
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
-   are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yyg->yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yyg->yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin ,yyscanner )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
-     *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yylex. 
-     *       One obvious solution it to make yy_act a global. I tried that, and saw
-     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
-     *       normally declared as a register variable-- so it is not worth it.
-     */
-    #define  YY_LESS_LINENO(n) \
-            do { \
-                int yyl;\
-                for ( yyl = n; yyl < yyleng; ++yyl )\
-                    if ( yytext[yyl] == '\n' )\
-                        --yylineno;\
-            }while(0)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = yyg->yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
-                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-
-void yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void yypop_buffer_state (yyscan_t yyscanner );
-
-static void yyensure_buffer_stack (yyscan_t yyscanner );
-static void yy_load_buffer_state (yyscan_t yyscanner );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        yyensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        yyensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define yywrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-typedef int yy_state_type;
-
-#define yytext_ptr yytext_r
-
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yyg->yytext_ptr = yy_bp; \
-	yyleng = (size_t) (yy_cp - yy_bp); \
-	yyg->yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yyg->yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 35
-#define YY_END_OF_BUFFER 36
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_accept[135] =
-    {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-       13,   13,   36,   34,    8,    9,   24,    7,   34,   15,
-       34,   11,   32,    2,    4,   35,   35,   35,   35,   31,
-       35,   35,   35,   22,   13,   13,   24,   23,    0,    0,
-        7,    0,   15,    0,   14,    0,    1,   10,   11,    0,
-        2,    3,    4,    0,    5,    0,    6,    0,   31,    0,
-       29,    0,    0,   22,   20,   13,   13,   23,    0,   27,
-       26,   26,    0,    0,   14,   18,   17,   17,   10,    0,
-       11,   30,   21,   13,   27,   26,   25,   26,    0,   26,
-        0,   33,    0,    0,   18,   17,   17,   16,    0,   17,
-
-        0,   10,   11,   12,   13,   13,    0,   26,   25,   26,
-       26,   26,   28,    0,    0,   17,   17,   16,   17,   17,
-       19,   10,   13,   26,   25,   26,   26,    0,   17,   17,
-       16,   17,   13,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        2,    4,    4,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    5,    6,    7,    1,    1,    8,    9,
-       10,   11,    1,    1,   12,   12,   13,   14,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,    1,    1,    1,
-       15,    1,    1,    1,   14,   14,   14,   14,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
-        1,   16,    1,    1,   14,    1,   14,   14,   14,   14,
-
-       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
-       14,   14,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[17] =
-    {   0,
-        1,    1,    2,    3,    1,    1,    1,    1,    1,    4,
-        5,    6,    6,    6,    1,    7
-    } ;
-
-static yyconst flex_int16_t yy_base[163] =
-    {   0,
-        0,    0,   14,   15,   16,   17,   26,   40,   54,   68,
-       82,   90,   86,  670,  670,  670,   96,    0,   74,  106,
-       10,   69,  670,    0,  670,  120,  131,   27,  670,  670,
-      142,   15,  149,  670,    0,   72,  154,  670,  168,    0,
-        0,   66,  178,  192,  670,    0,  670,   66,   65,   63,
-        0,  206,  670,  217,  670,  228,  670,   30,  670,   65,
-      670,   31,   64,  670,  670,    0,   55,  670,   59,  670,
-      237,  249,  256,   58,  670,  670,  264,  274,   53,   51,
-       51,  670,  670,  281,  670,  291,  670,  305,    0,  317,
-      331,  670,    0,   49,  670,  341,  355,  670,    0,  365,
-
-      379,   47,   46,  670,    0,   41,  393,    0,    0,  407,
-      420,    0,  670,   34,  434,    0,  448,    0,  461,    0,
-      670,   41,   37,    0,    0,    0,  474,    0,    0,    0,
-        0,  487,   38,  670,  503,  510,  517,  524,  531,  538,
-      545,   47,  552,  559,  566,  572,  578,  585,  592,   35,
-      599,  606,  613,  620,   34,  627,  634,  641,  648,   30,
-      655,  662
-    } ;
-
-static yyconst flex_int16_t yy_def[163] =
-    {   0,
-      134,    1,  135,  135,  135,  135,  136,  136,  137,  137,
-      138,  138,  134,  134,  134,  134,  139,  140,  134,  141,
-      134,  142,  134,  143,  134,  144,  144,  145,  134,  134,
-      145,  146,  146,  134,  147,  147,  139,  134,  139,  148,
-      140,  134,  141,  141,  134,  149,  134,  150,  142,  134,
-      143,  144,  134,  144,  134,  144,  134,  145,  134,   31,
-      134,  146,   33,  134,  134,  147,  147,  134,   39,  134,
-      151,  152,  134,   44,  134,  134,  153,  154,  150,  134,
-      155,  134,  134,  147,  134,  151,  134,  156,  157,  152,
-      152,  134,   73,  134,  134,  153,  158,  134,  159,  154,
-
-      154,  160,  155,  134,   84,  147,  151,   86,   86,  156,
-      161,   86,  134,   73,  153,   96,  158,   96,  162,   96,
-      134,  160,   84,   86,   86,  110,  161,  114,   96,  117,
-       96,  162,   84,    0,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134
-    } ;
-
-static yyconst flex_int16_t yy_nxt[687] =
-    {   0,
-       14,   15,   16,   15,   17,   18,   19,   20,   14,   14,
-       14,   14,   21,   22,   23,   14,   25,   25,   25,   25,
-       47,   63,   64,   48,   26,   26,   27,   27,   29,   29,
-       30,   59,   31,   60,   59,  122,   60,   63,   64,  103,
-       79,   29,   29,   29,   30,  128,   31,  128,  133,  133,
-      133,  133,   49,   80,  123,   29,   29,   29,   50,   80,
-       33,   34,  114,   50,  102,   80,   95,   85,   84,   29,
-       29,   29,   83,   82,   33,   34,   81,   50,   80,   73,
-       67,   50,   42,   29,   29,  134,  134,  134,   36,  134,
-      134,   29,   29,  134,  134,  134,   36,  134,  134,   29,
-
-       38,  134,   39,  134,  134,  134,  134,  134,  134,  134,
-      134,   40,   44,   45,  134,  134,  134,  134,  134,  134,
-      134,   46,   53,  134,  134,  134,  134,  134,  134,  134,
-       54,  134,   55,   53,  134,  134,  134,  134,  134,  134,
-      134,   56,  134,   57,   58,   58,  134,  134,  134,  134,
-       61,   62,   62,  134,  134,  134,  134,   65,   68,  134,
-       69,  134,  134,  134,  134,  134,  134,  134,  134,   40,
-       37,   37,  134,  134,  134,  134,   70,  134,  134,  134,
-      134,  134,  134,   71,   74,   75,  134,  134,  134,  134,
-      134,  134,  134,   46,   43,   43,  134,  134,  134,  134,
-
-       76,  134,  134,  134,  134,  134,  134,   77,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,   53,
-      134,  134,  134,  134,  134,  134,  134,   54,  134,   55,
-       53,  134,  134,  134,  134,  134,  134,  134,   56,  134,
-       57,   87,  134,   88,  134,  134,  134,  134,  134,  134,
-      134,  134,   89,   87,  134,   91,  134,  134,  134,  134,
-      134,  134,  134,  134,   40,   92,  134,   93,   94,   93,
-       97,   98,  134,  134,  134,  134,  134,  134,  134,   99,
-      101,   98,  134,  134,  134,  134,  134,  134,  134,   46,
-      104,  134,  105,  106,  105,   87,  134,  107,  134,  134,
-
-      134,  134,  134,  134,  134,  134,   89,   86,   86,  109,
-      134,  110,  134,   86,  134,  134,  134,  134,  134,  134,
-      111,   87,  134,   91,  134,  134,  134,  134,  134,  134,
-      134,  134,   40,   90,   90,  134,  134,  134,  134,  113,
-      134,  134,  134,  134,  134,  134,   71,  115,   98,  134,
-      134,  134,  134,  134,  134,  134,   99,   96,   96,  134,
-      134,  117,  118,   96,  134,  134,  134,  134,  134,  134,
-      119,  101,   98,  134,  134,  134,  134,  134,  134,  134,
-       46,  100,  100,  134,  134,  134,  134,  121,  134,  134,
-      134,  134,  134,  134,   77,   86,   86,  134,  134,  134,
-
-      134,  134,  134,  134,  134,  134,  134,  134,   71,   86,
-       86,  109,  134,  110,  134,   86,  134,  134,  134,  134,
-      134,  134,  111,  112,  125,  134,  126,  134,  134,  134,
-      134,  134,  134,  134,  134,  127,   96,   96,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,   77,
-       96,   96,  134,  134,  117,  118,   96,  134,  134,  134,
-      134,  134,  134,  119,  120,  134,  134,  130,  131,  134,
-      134,  134,  134,  134,  134,  134,  132,  112,  125,  134,
-       88,  134,  134,  134,  134,  134,  134,  134,  134,  127,
-      120,  134,  134,   97,  131,  134,  134,  134,  134,  134,
-
-      134,  134,  132,   24,   24,   24,   24,   24,   24,   24,
-       28,   28,   28,   28,   28,   28,   28,   32,   32,   32,
-       32,   32,   32,   32,   35,   35,   35,   35,   35,   35,
-       35,   37,  134,  134,   37,   37,   37,   37,   41,  134,
-       41,   41,   41,   41,   41,   43,  134,  134,   43,   43,
-       43,   43,   51,  134,   51,   51,  134,   51,   51,   52,
-       52,   52,   52,   52,   52,   52,   58,  134,  134,   58,
-       58,   58,   62,  134,  134,   62,   62,   62,   66,  134,
-       66,  134,   66,   66,   66,   72,  134,   72,   72,   72,
-       72,   72,   78,  134,   78,   78,   78,   78,   78,   86,
-
-      134,  134,   86,   86,   86,   86,   90,  134,  134,   90,
-       90,   90,   90,   96,  134,  134,   96,   96,   96,   96,
-      100,  134,  134,  100,  100,  100,  100,  108,  108,  108,
-      108,  108,  108,  108,  112,  134,  112,  112,  112,  112,
-      112,  116,  116,  116,  116,  116,  116,  116,  120,  134,
-      120,  120,  120,  120,  120,  124,  134,  124,  124,  124,
-      124,  124,  129,  134,  129,  129,  129,  129,  129,   13,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134
-    } ;
-
-static yyconst flex_int16_t yy_chk[687] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    3,    4,    5,    6,
-       21,   32,   32,   21,    3,    4,    5,    6,    7,    7,
-        7,   28,    7,   28,   58,  160,   58,   62,   62,  155,
-      150,    7,    8,    8,    8,  114,    8,  114,  123,  133,
-      123,  133,  142,  122,  106,    8,    9,    9,  103,  102,
-        9,    9,   94,   81,   80,   79,   74,   69,   67,    9,
-       10,   10,   63,   60,   10,   10,   50,   49,   48,   42,
-       36,   22,   19,   10,   11,   13,    0,    0,   11,    0,
-        0,   11,   12,    0,    0,    0,   12,    0,    0,   12,
-
-       17,    0,   17,    0,    0,    0,    0,    0,    0,    0,
-        0,   17,   20,   20,    0,    0,    0,    0,    0,    0,
-        0,   20,   26,    0,    0,    0,    0,    0,    0,    0,
-       26,    0,   26,   27,    0,    0,    0,    0,    0,    0,
-        0,   27,    0,   27,   31,   31,    0,    0,    0,    0,
-       31,   33,   33,    0,    0,    0,    0,   33,   37,    0,
-       37,    0,    0,    0,    0,    0,    0,    0,    0,   37,
-       39,   39,    0,    0,    0,    0,   39,    0,    0,    0,
-        0,    0,    0,   39,   43,   43,    0,    0,    0,    0,
-        0,    0,    0,   43,   44,   44,    0,    0,    0,    0,
-
-       44,    0,    0,    0,    0,    0,    0,   44,   52,    0,
-        0,    0,    0,    0,    0,    0,   52,    0,   52,   54,
-        0,    0,    0,    0,    0,    0,    0,   54,    0,   54,
-       56,    0,    0,    0,    0,    0,    0,    0,   56,    0,
-       56,   71,    0,   71,    0,    0,    0,    0,    0,    0,
-        0,    0,   71,   72,    0,   72,    0,    0,    0,    0,
-        0,    0,    0,    0,   72,   73,    0,   73,   73,   73,
-       77,   77,    0,    0,    0,    0,    0,    0,    0,   77,
-       78,   78,    0,    0,    0,    0,    0,    0,    0,   78,
-       84,    0,   84,   84,   84,   86,    0,   86,    0,    0,
-
-        0,    0,    0,    0,    0,    0,   86,   88,   88,   88,
-        0,   88,    0,   88,    0,    0,    0,    0,    0,    0,
-       88,   90,    0,   90,    0,    0,    0,    0,    0,    0,
-        0,    0,   90,   91,   91,    0,    0,    0,    0,   91,
-        0,    0,    0,    0,    0,    0,   91,   96,   96,    0,
-        0,    0,    0,    0,    0,    0,   96,   97,   97,    0,
-        0,   97,   97,   97,    0,    0,    0,    0,    0,    0,
-       97,  100,  100,    0,    0,    0,    0,    0,    0,    0,
-      100,  101,  101,    0,    0,    0,    0,  101,    0,    0,
-        0,    0,    0,    0,  101,  107,  107,    0,    0,    0,
-
-        0,  107,    0,    0,    0,    0,    0,    0,  107,  110,
-      110,  110,    0,  110,    0,  110,    0,    0,    0,    0,
-        0,    0,  110,  111,  111,    0,  111,    0,    0,    0,
-        0,    0,    0,    0,    0,  111,  115,  115,    0,    0,
-        0,    0,  115,    0,    0,    0,    0,    0,    0,  115,
-      117,  117,    0,    0,  117,  117,  117,    0,    0,    0,
-        0,    0,    0,  117,  119,    0,    0,  119,  119,    0,
-        0,    0,    0,    0,    0,    0,  119,  127,  127,    0,
-      127,    0,    0,    0,    0,    0,    0,    0,    0,  127,
-      132,    0,    0,  132,  132,    0,    0,    0,    0,    0,
-
-        0,    0,  132,  135,  135,  135,  135,  135,  135,  135,
-      136,  136,  136,  136,  136,  136,  136,  137,  137,  137,
-      137,  137,  137,  137,  138,  138,  138,  138,  138,  138,
-      138,  139,    0,    0,  139,  139,  139,  139,  140,    0,
-      140,  140,  140,  140,  140,  141,    0,    0,  141,  141,
-      141,  141,  143,    0,  143,  143,    0,  143,  143,  144,
-      144,  144,  144,  144,  144,  144,  145,    0,    0,  145,
-      145,  145,  146,    0,    0,  146,  146,  146,  147,    0,
-      147,    0,  147,  147,  147,  148,    0,  148,  148,  148,
-      148,  148,  149,    0,  149,  149,  149,  149,  149,  151,
-
-        0,    0,  151,  151,  151,  151,  152,    0,    0,  152,
-      152,  152,  152,  153,    0,    0,  153,  153,  153,  153,
-      154,    0,    0,  154,  154,  154,  154,  156,  156,  156,
-      156,  156,  156,  156,  157,    0,  157,  157,  157,  157,
-      157,  158,  158,  158,  158,  158,  158,  158,  159,    0,
-      159,  159,  159,  159,  159,  161,    0,  161,  161,  161,
-      161,  161,  162,    0,  162,  162,  162,  162,  162,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134
-    } ;
-
-/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[36] =
-    {   0,
-0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0,     };
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-	#include <sysalloc.h>
-    
-	#include "kfg-parse.h"
-	#include "config-tokens.h"    
-	
-    #define YYSTYPE KFGParseBlock
-    
-    /* code to populate token with internal values */
-    #define YY_USER_ACTION              \
-        yylval -> tokenText		= yytext;	\
-        yylval -> tokenLength	= yyleng;	\
-        yylval -> line_no		= yylineno;	\
-        yylval -> column_no		= yycolumn; \
-        yycolumn += yyleng; 
-        
-    #define REM_LQUOTE \
-		++ yylval -> tokenText;	\
-		-- yylval -> tokenLength; \
-		++ yylval -> column_no;
-		
-    #define REM_RQUOTE \
-		-- yylval -> tokenLength; 
-#define YY_NO_UNISTD_H 1
-/* re-entrant scanner */
-/* bison options */
-/* maintain state stack */
-/* let parser handle EOF */
-/* start-state for slash-star comments */
-
-/* states for strings */
-
-/* in-string variable reference */
-
-/* node/name in a path */
-
-#define INITIAL 0
-#define CMT_SLASH_STAR 1
-#define CMT_MULTI_LINE 2
-#define IN_DBL_STRING 3
-#define IN_SNG_STRING 4
-#define IN_VAR_REF 5
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
-    {
-
-    /* User-defined. Not touched by flex. */
-    YY_EXTRA_TYPE yyextra_r;
-
-    /* The rest are the same as the globals declared in the non-reentrant scanner. */
-    FILE *yyin_r, *yyout_r;
-    size_t yy_buffer_stack_top; /**< index of top of stack. */
-    size_t yy_buffer_stack_max; /**< capacity of stack. */
-    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
-    char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
-    char *yy_c_buf_p;
-    int yy_init;
-    int yy_start;
-    int yy_did_buffer_switch_on_eof;
-    int yy_start_stack_ptr;
-    int yy_start_stack_depth;
-    int *yy_start_stack;
-    yy_state_type yy_last_accepting_state;
-    char* yy_last_accepting_cpos;
-
-    int yylineno_r;
-    int yy_flex_debug_r;
-
-    char *yytext_r;
-    int yy_more_flag;
-    int yy_more_len;
-
-    YYSTYPE * yylval_r;
-
-    }; /* end struct yyguts_t */
-
-static int yy_init_globals (yyscan_t yyscanner );
-
-    /* This must go here because YYSTYPE and YYLTYPE are included
-     * from bison output in section 1.*/
-    #    define yylval yyg->yylval_r
-    
-int yylex_init (yyscan_t* scanner);
-
-int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (yyscan_t yyscanner );
-
-int yyget_debug (yyscan_t yyscanner );
-
-void yyset_debug (int debug_flag ,yyscan_t yyscanner );
-
-YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-
-FILE *yyget_in (yyscan_t yyscanner );
-
-void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
-
-FILE *yyget_out (yyscan_t yyscanner );
-
-void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
-
-int yyget_leng (yyscan_t yyscanner );
-
-char *yyget_text (yyscan_t yyscanner );
-
-int yyget_lineno (yyscan_t yyscanner );
-
-void yyset_lineno (int line_number ,yyscan_t yyscanner );
-
-YYSTYPE * yyget_lval (yyscan_t yyscanner );
-
-void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (yyscan_t yyscanner );
-#else
-extern int yywrap (yyscan_t yyscanner );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
-#else
-static int input (yyscan_t yyscanner );
-#endif
-
-#endif
-
-    static void yy_push_state (int new_state ,yyscan_t yyscanner);
-    
-    static void yy_pop_state (yyscan_t yyscanner );
-    
-    static int yy_top_state (yyscan_t yyscanner );
-    
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		unsigned n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex \
-               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
-
-#define YY_DECL int yylex \
-               (YYSTYPE * yylval_param , yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- /* multi-line comments */
-
-    yylval = yylval_param;
-
-	if ( !yyg->yy_init )
-		{
-		yyg->yy_init = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! yyg->yy_start )
-			yyg->yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			yyensure_buffer_stack (yyscanner);
-			YY_CURRENT_BUFFER_LVALUE =
-				yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-		}
-
-		yy_load_buffer_state(yyscanner );
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yyg->yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yyg->yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yyg->yy_start;
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				yyg->yy_last_accepting_state = yy_current_state;
-				yyg->yy_last_accepting_cpos = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 135 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_current_state != 134 );
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-
-		YY_DO_BEFORE_ACTION;
-
-		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-			{
-			int yyl;
-			for ( yyl = 0; yyl < yyleng; ++yyl )
-				if ( yytext[yyl] == '\n' )
-					   
-    do{ yylineno++;
-        yycolumn=0;
-    }while(0)
-;
-			}
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yyg->yy_hold_char;
-			yy_cp = yyg->yy_last_accepting_cpos;
-			yy_current_state = yyg->yy_last_accepting_state;
-			goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-{ yy_push_state ( CMT_SLASH_STAR, yyscanner ); }
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-/* ignore */
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-/* ignore */
-	YY_BREAK
-case 4:
-/* rule 4 can match eol */
-YY_RULE_SETUP
-{ BEGIN CMT_MULTI_LINE; }
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-{ yy_pop_state ( yyscanner ); }
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-{ yy_pop_state ( yyscanner ); return kfgEND_LINE; }
-	YY_BREAK
-/* line comments */
-case 7:
-YY_RULE_SETUP
-/* ignore */
-	YY_BREAK
-/* ignored tokens */
-case 8:
-YY_RULE_SETUP
-/* ignore */
-	YY_BREAK
-/* end of line is significant */
-case 9:
-/* rule 9 can match eol */
-YY_RULE_SETUP
-{ return kfgEND_LINE; }
-	YY_BREAK
-/* normal, POSIX-style paths */
-case 10:
-YY_RULE_SETUP
-{ return kfgABS_PATH; }
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-{ return kfgREL_PATH; }
-	YY_BREAK
-/* variable references inside strings */
-case 12:
-YY_RULE_SETUP
-{ yy_pop_state ( yyscanner ); return kfgVAR_REF; }
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-{ yy_pop_state ( yyscanner ); return kfgUNTERM_VAR_REF; }
-	YY_BREAK
-case YY_STATE_EOF(IN_VAR_REF):
-{ yy_pop_state ( yyscanner ); return kfgUNTERM_VAR_REF; } 
-	YY_BREAK
-/* single quoted strings */
-case 14:
-/* rule 14 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; REM_RQUOTE; return kfgSTRING; }
-	YY_BREAK
-case 15:
-/* rule 15 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; return kfgUNTERM_STRING; }
-	YY_BREAK
-case 16:
-/* rule 16 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; REM_RQUOTE; return kfgESCAPED_STRING; }
-	YY_BREAK
-case 17:
-/* rule 17 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; return kfgUNTERM_ESCAPED_STRING; }
-	YY_BREAK
-/* single quoted strings with variable references*/
-case 18:
-/* rule 18 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ REM_LQUOTE; yy_push_state ( IN_SNG_STRING, yyscanner ); yy_push_state ( IN_VAR_REF, yyscanner ); return kfgSTRING; }
-	YY_BREAK
-case 19:
-/* rule 19 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ REM_LQUOTE; yy_push_state ( IN_SNG_STRING, yyscanner ); yy_push_state ( IN_VAR_REF, yyscanner ); return kfgESCAPED_STRING; }
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-{ yy_push_state ( IN_VAR_REF, yyscanner ); yyless(0); }
-	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ yy_push_state ( IN_VAR_REF, yyscanner ); return kfgSTRING; }
-	YY_BREAK
-case 22:
-/* rule 22 can match eol */
-YY_RULE_SETUP
-{ REM_RQUOTE; yy_pop_state ( yyscanner ); return kfgSTRING; } 
-	YY_BREAK
-/* double quoted strings */
-case 23:
-/* rule 23 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; REM_RQUOTE; return kfgSTRING; }
-	YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; return kfgUNTERM_STRING; }
-	YY_BREAK
-case 25:
-/* rule 25 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; REM_RQUOTE; return kfgESCAPED_STRING; }
-	YY_BREAK
-case 26:
-/* rule 26 can match eol */
-YY_RULE_SETUP
-{ REM_LQUOTE; return kfgUNTERM_ESCAPED_STRING; }
-	YY_BREAK
-/* double quoted strings with variable references*/
-case 27:
-/* rule 27 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ REM_LQUOTE; yy_push_state ( IN_DBL_STRING, yyscanner ); yy_push_state ( IN_VAR_REF, yyscanner ); return kfgSTRING; }
-	YY_BREAK
-case 28:
-/* rule 28 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ REM_LQUOTE; yy_push_state ( IN_DBL_STRING, yyscanner ); yy_push_state ( IN_VAR_REF, yyscanner ); return kfgESCAPED_STRING; }
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-{ yy_push_state ( IN_VAR_REF, yyscanner ); yyless(0); }
-	YY_BREAK
-case 30:
-/* rule 30 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ yy_push_state ( IN_VAR_REF, yyscanner ); return kfgSTRING; }
-	YY_BREAK
-case 31:
-/* rule 31 can match eol */
-YY_RULE_SETUP
-{ REM_RQUOTE; yy_pop_state ( yyscanner ); return kfgSTRING; } 
-	YY_BREAK
-/* literals */
-case 32:
-YY_RULE_SETUP
-{ return kfgASSIGN; }
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-{ return kfgVAR_REF; }
-	YY_BREAK
-/* unrecognized input */
-case 34:
-YY_RULE_SETUP
-{ return kfgUNRECOGNIZED; }
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-ECHO;
-	YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(CMT_SLASH_STAR):
-case YY_STATE_EOF(CMT_MULTI_LINE):
-case YY_STATE_EOF(IN_DBL_STRING):
-case YY_STATE_EOF(IN_SNG_STRING):
-	yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yyg->yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state( yyscanner );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
-
-			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yyg->yy_last_accepting_cpos;
-				yy_current_state = yyg->yy_last_accepting_state;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer( yyscanner ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yyg->yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap(yyscanner ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yyg->yy_c_buf_p =
-					yyg->yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yyg->yy_c_buf_p =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = yyg->yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-	else
-		{
-			int num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-			int yy_c_buf_p_offset =
-				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	if ( yyg->yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart(yyin  ,yyscanner);
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	yyg->yy_n_chars += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	yy_current_state = yyg->yy_start;
-
-	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			yyg->yy_last_accepting_state = yy_current_state;
-			yyg->yy_last_accepting_cpos = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 135 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
-{
-	register int yy_is_jam;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
-	register char *yy_cp = yyg->yy_c_buf_p;
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		yyg->yy_last_accepting_state = yy_current_state;
-		yyg->yy_last_accepting_cpos = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 135 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 134);
-
-	return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
-{
-	register char *yy_cp;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-    yy_cp = yyg->yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yyg->yy_hold_char;
-
-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yyg->yy_n_chars + 2;
-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-		register char *source =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-    if ( c == '\n' ){
-        --yylineno;
-    }
-
-	yyg->yytext_ptr = yy_bp;
-	yyg->yy_hold_char = *yy_cp;
-	yyg->yy_c_buf_p = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (yyscan_t yyscanner)
-#else
-    static int input  (yyscan_t yyscanner)
-#endif
-
-{
-	int c;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	*yyg->yy_c_buf_p = yyg->yy_hold_char;
-
-	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			/* This was really a NUL. */
-			*yyg->yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-			++yyg->yy_c_buf_p;
-
-			switch ( yy_get_next_buffer( yyscanner ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart(yyin ,yyscanner);
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap(yyscanner ) )
-						return EOF;
-
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput(yyscanner);
-#else
-					return input(yyscanner);
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
-	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
-	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-
-	if ( c == '\n' )
-		   
-    do{ yylineno++;
-        yycolumn=0;
-    }while(0)
-;
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * @param yyscanner The scanner object.
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if ( ! YY_CURRENT_BUFFER ){
-        yyensure_buffer_stack (yyscanner);
-		YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-	}
-
-	yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
-	yy_load_buffer_state(yyscanner );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * @param yyscanner The scanner object.
- */
-    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		yypop_buffer_state();
-	 *		yypush_buffer_state(new_buffer);
-     */
-	yyensure_buffer_stack (yyscanner);
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	yy_load_buffer_state(yyscanner );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-static void yy_load_buffer_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	yyg->yy_hold_char = *yyg->yy_c_buf_p;
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * @param yyscanner The scanner object.
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer(b,file ,yyscanner);
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * @param yyscanner The scanner object.
- */
-    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yyfree((void *) b->yy_ch_buf ,yyscanner );
-
-	yyfree((void *) b ,yyscanner );
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
-
-{
-	int oerrno = errno;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	yy_flush_buffer(b ,yyscanner);
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * @param yyscanner The scanner object.
- */
-    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		yy_load_buffer_state(yyscanner );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  @param yyscanner The scanner object.
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (new_buffer == NULL)
-		return;
-
-	yyensure_buffer_stack(yyscanner);
-
-	/* This block is copied from yy_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		yyg->yy_buffer_stack_top++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from yy_switch_to_buffer. */
-	yy_load_buffer_state(yyscanner );
-	yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  @param yyscanner The scanner object.
- */
-void yypop_buffer_state (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (!YY_CURRENT_BUFFER)
-		return;
-
-	yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if (yyg->yy_buffer_stack_top > 0)
-		--yyg->yy_buffer_stack_top;
-
-	if (YY_CURRENT_BUFFER) {
-		yy_load_buffer_state(yyscanner );
-		yyg->yy_did_buffer_switch_on_eof = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (yyscan_t yyscanner)
-{
-	int num_to_alloc;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if (!yyg->yy_buffer_stack) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-		num_to_alloc = 1;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-								  
-		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		yyg->yy_buffer_stack_max = num_to_alloc;
-		yyg->yy_buffer_stack_top = 0;
-		return;
-	}
-
-	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
-								(yyg->yy_buffer_stack,
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
-		yyg->yy_buffer_stack_max = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer(b ,yyscanner );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
-{
-    
-	return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) yyalloc(n ,yyscanner );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer(buf,n ,yyscanner);
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-    static void yy_push_state (int  new_state , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yyg->yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yyg->yy_start_stack_depth * sizeof( int );
-
-		if ( ! yyg->yy_start_stack )
-			yyg->yy_start_stack = (int *) yyalloc(new_size ,yyscanner );
-
-		else
-			yyg->yy_start_stack = (int *) yyrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
-
-		if ( ! yyg->yy_start_stack )
-			YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-		}
-
-	yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-}
-
-    static void yy_pop_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( --yyg->yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
-}
-
-    static int yy_top_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
-{
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		yytext[yyleng] = yyg->yy_hold_char; \
-		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
-		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
-		*yyg->yy_c_buf_p = '\0'; \
-		yyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the user-defined data for this scanner.
- * @param yyscanner The scanner object.
- */
-YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyextra;
-}
-
-/** Get the current line number.
- * @param yyscanner The scanner object.
- */
-int yyget_lineno  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
-        if (! YY_CURRENT_BUFFER)
-            return 0;
-    
-    return yylineno;
-}
-
-/** Get the current column number.
- * @param yyscanner The scanner object.
- */
-int yyget_column  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
-        if (! YY_CURRENT_BUFFER)
-            return 0;
-    
-    return yycolumn;
-}
-
-/** Get the input stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_in  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyin;
-}
-
-/** Get the output stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_out  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyout;
-}
-
-/** Get the length of the current token.
- * @param yyscanner The scanner object.
- */
-int yyget_leng  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyleng;
-}
-
-/** Get the current token.
- * @param yyscanner The scanner object.
- */
-
-char *yyget_text  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yytext;
-}
-
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * @param yyscanner The scanner object.
- */
-void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyextra = user_defined ;
-}
-
-/** Set the current line number.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void yyset_lineno (int  line_number , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-        /* lineno is only valid if an input buffer exists. */
-        if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); 
-    
-    yylineno = line_number;
-}
-
-/** Set the current column.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void yyset_column (int  column_no , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-        /* column is only valid if an input buffer exists. */
-        if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yyset_column called with no buffer" , yyscanner); 
-    
-    yycolumn = column_no;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * @param yyscanner The scanner object.
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE *  in_str , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyin = in_str ;
-}
-
-void yyset_out (FILE *  out_str , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyout = out_str ;
-}
-
-int yyget_debug  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yy_flex_debug;
-}
-
-void yyset_debug (int  bdebug , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yy_flex_debug = bdebug ;
-}
-
-/* Accessor methods for yylval and yylloc */
-
-YYSTYPE * yyget_lval  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yylval;
-}
-
-void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yylval = yylval_param;
-}
-
-/* User-visible API */
-
-/* yylex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-
-int yylex_init(yyscan_t* ptr_yy_globals)
-
-{
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
-
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-/* yylex_init_extra has the same functionality as yylex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to yyalloc in
- * the yyextra field.
- */
-
-int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
-{
-    struct yyguts_t dummy_yyguts;
-
-    yyset_extra (yy_user_defined, &dummy_yyguts);
-
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-	
-    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-	
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-    
-    /* By setting to 0xAA, we expose bugs in
-    yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-    
-    yyset_extra (yy_user_defined, *ptr_yy_globals);
-    
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-static int yy_init_globals (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    yyg->yy_buffer_stack = 0;
-    yyg->yy_buffer_stack_top = 0;
-    yyg->yy_buffer_stack_max = 0;
-    yyg->yy_c_buf_p = (char *) 0;
-    yyg->yy_init = 0;
-    yyg->yy_start = 0;
-
-    yyg->yy_start_stack_ptr = 0;
-    yyg->yy_start_stack_depth = 0;
-    yyg->yy_start_stack =  NULL;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		yypop_buffer_state(yyscanner);
-	}
-
-	/* Destroy the stack itself. */
-	yyfree(yyg->yy_buffer_stack ,yyscanner);
-	yyg->yy_buffer_stack = NULL;
-
-    /* Destroy the start condition stack. */
-        yyfree(yyg->yy_start_stack ,yyscanner );
-        yyg->yy_start_stack = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( yyscanner);
-
-    /* Destroy the main struct (reentrant only). */
-    yyfree ( yyscanner , yyscanner );
-    yyscanner = NULL;
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
-{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
-{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
-{
-	return (void *) malloc( size );
-}
-
-void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
-{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-}
-
-void yyfree (void * ptr , yyscan_t yyscanner)
-{
-	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-rc_t CC KFGScan_yylex_init(KFGScanBlock* sb, const char *str)
-{
-	if (yylex_init(&sb->scanner) != 0)
-	{
-		return RC ( rcKFG, rcMgr, rcParsing, rcMemory, rcExhausted );
-	}		
-	sb->buffer=yy_scan_string(str,sb->scanner); 
-	
-	{	/* initialize line/col counters */
-		/* yylineno and yycolumn are macros using variable yyg, so we have to prepare it for them */
-		struct yyguts_t * yyg = (struct yyguts_t*)sb->scanner;
-		yylineno=1;
-		yycolumn=1;
-	}
-	
-	return 0;
-}
-
-void CC KFGScan_yylex_destroy(KFGScanBlock* sb)
-{
-	yy_delete_buffer(sb->buffer,sb->scanner); 
-	if (sb->scanner)
-	{
-		yylex_destroy(sb->scanner);
-	}		
-	sb->scanner=0;
-	sb->buffer=0;
-}
-
-void CC KFGScan_set_debug(bool on, KFGScanBlock* sb)
-{
-	yyset_debug(on ? 1 : 0,sb->scanner);
-}
-
-int CC KFGScan_yylex(KFGSymbol* sym, KFGScanBlock* sb) 
-{ 
-	sym->pb.tokenId=yylex(&sym->pb,sb->scanner); 
-	sb->lastToken= &sym->pb;
-	
-	switch (sym->pb.tokenId)
-	{
-	case kfgVAR_REF:
-		if (!sb->look_up_var(sb->self, &sym->pb)) 
-		{
-			/* undefined variable reference is handled silently, to behave like a shell script */
-			/* KFG_error(&sym->pb, sb, "variable not found");*/
-			sym->pb.tokenLength = 0; 
-		}
-		sym->pb.tokenId = kfgSTRING;
-		break;
-	case kfgUNTERM_VAR_REF: /* convert bad var ref into a string */ 
-		KFG_error(&sym->pb, sb, "unterminated variable reference inside a string (use '\\$(' to avoid this message)");
-		sym->pb.tokenId = kfgSTRING; 
-		break;
-	case kfgUNTERM_STRING:
-	case kfgUNTERM_ESCAPED_STRING:
-		KFG_error(&sym->pb, sb, "unterminated string");
-		break;
-	default:
-		break;
-	}
-	
-	return sym->pb.tokenId;
-}
-
diff --git a/libs/kfg/config-tokens.h b/libs/kfg/config-tokens.h
deleted file mode 100644
index 2090822..0000000
--- a/libs/kfg/config-tokens.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
-
-/* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
-   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 3 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, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     kfgEND_INPUT = 0,
-     kfgEND_LINE = 258,
-     kfgUNTERM_STRING = 259,
-     kfgUNTERM_ESCAPED_STRING = 260,
-     kfgUNRECOGNIZED = 261,
-     kfgVAR_REF = 262,
-     kfgUNTERM_VAR_REF = 263,
-     kfgASSIGN = 264,
-     kfgSTRING = 265,
-     kfgESCAPED_STRING = 266,
-     kfgABS_PATH = 267,
-     kfgREL_PATH = 268
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-
-	KFGParseBlock		pb;
-	const VNamelist*	namelist;
-
-
-
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-
-
diff --git a/libs/kfg/config.c b/libs/kfg/config.c
deleted file mode 100644
index ae1cf47..0000000
--- a/libs/kfg/config.c
+++ /dev/null
@@ -1,3425 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <kfg/kfg-priv.h>
-
-struct KfgConfigNamelist;
-#define KNAMELIST_IMPL struct KfgConfigNamelist
-#include <klib/namelist.h>
-#include <klib/impl.h>
-
-#include <klib/token.h>
-#include <klib/container.h>
-#include <klib/data-buffer.h> /* KDataBuffer */
-#include <klib/refcount.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/debug.h>
-#include <klib/log.h> 
-#include <klib/out.h> /* OUTMSG */
-#include <klib/klib-priv.h>
-#include <kfs/directory.h>
-#include <kfs/gzip.h> /* KFileMakeGzipForRead */
-#include <kfs/subfile.h> /* KFileMakeSubRead */
-#include <kfs/file.h>
-#include <kfs/dyload.h>
-#include <kfs/mmap.h>
-#include <os-native.h>
-#include <vfs/path.h>
-#include <strtol.h>
-#include <sysalloc.h>
-#include <os-native.h>
-
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <va_copy.h>
-
-#if !WINDOWS
-    #include <sys/utsname.h>
-#endif
-
-#include "kfg-parse.h"
-#include "config-tokens.h"
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-/* the leaf name of the user's modifiable settings,
-   must reside in the user's $HOME/.ncbi directory */
-#define MAGIC_LEAF_NAME "user-settings.mkfg"
-
-static bool s_disable_user_settings = false;
-
-
-/*--------------------------------------------------------------------------
- * KConfig
- */
-static
-rc_t KConfigSever ( const KConfig *self );
-
-
-/*--------------------------------------------------------------------------
- * KConfigIncluded
- *  node within configuration tree
- */
-
-typedef struct KConfigIncluded KConfigIncluded;
-struct KConfigIncluded
-{
-    BSTNode n;
-    bool is_magic_file;
-    char path [ 1 ];
-};
-
-
-static
-void CC KConfigIncludedWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-static
-int CC KConfigIncludedSort ( const BSTNode *item, const BSTNode *n )
-{
-    const KConfigIncluded *a = ( const KConfigIncluded* ) item;
-    const KConfigIncluded *b = ( const KConfigIncluded* ) n;
-    return strcmp ( a -> path, b -> path );
-}
-
-/*--------------------------------------------------------------------------
- * KConfigNode
- *  node within configuration tree
- */
-struct KConfigNode
-{
-    BSTNode n;
-
-    /* needs to hold a dependency reference to mgr */
-    KConfig *mgr;
-
-    /* uncounted reference to parent node */
-    KConfigNode *dad;
-
-    /* File node came from; null if created during runtime*/
-    KConfigIncluded *came_from;
-
-    /* named children - always unique */
-    BSTree children;
-
-    /* named attributes */
-    BSTree attr;
-
-    /* node value */
-    char * val_buffer;
-    String value;
-
-    /* node name */
-    String name;
-
-    KRefcount refcount;
-
-    bool internal;
-    bool read_only;
-    bool dirty;
-};
-
-/* replace this once we introduce attributes */
-#define KConfigAttrWhack NULL
-
-
-/* Whack
- */
-static
-void CC KConfigNodeWhack ( BSTNode *n, void * data )
-{
-    KConfigNode *self = ( KConfigNode* ) n;
-    KConfig *mgr = data;
-
-    if ( mgr == NULL )
-    {
-        /* just releasing reference */
-        KConfigSever ( self -> mgr );
-        self -> mgr = NULL;
-        self -> read_only = false;
-    }
-    else
-    {
-        /* tearing down structure */
-        BSTreeWhack ( & self -> children, KConfigNodeWhack, mgr );
-        BSTreeWhack ( & self -> attr, KConfigAttrWhack, mgr );
-        free ( self -> val_buffer );
-        free ( self );
-    }
-}
-
-/* Init
- */
-static
-void KConfigNodeInit ( KConfigNode *self, const String *name )
-{
-    /* clear out here, ignoring the string space */
-    memset ( self, 0, sizeof * self );
-
-    /* initialize name early for the sake of KRefcountInit */
-    string_copy ( ( char* ) ( self + 1 ), name -> size + 1, name -> addr, name -> size );
-    StringInit ( & self -> name, ( char* ) ( self + 1 ), name -> size, name -> len );
-    StringInit ( & self -> value, "", 0, 0 );
-    KRefcountInit ( & self -> refcount, 0, "KConfigNode", "init", self -> name . addr );
-}
-
-/* Make
- */
-static
-rc_t KConfigNodeMake ( KConfigNode **n, const String *name )
-{
-    /* don't use calloc, because of string space */
-    KConfigNode *cn = malloc ( sizeof * cn + name -> size + 1 );
-    if ( cn == NULL )
-    {
-        rc_t rc = RC ( rcKFG, rcNode, rcCreating, rcMemory, rcExhausted );
-        PLOGERR (klogErr, (klogErr, rc, "Unable to create a config item for $(i)", "i=%S", name));
-        return rc;
-    }
-    KConfigNodeInit ( cn, name );
-    * n = cn;
-
-    return 0;
-}
-
-
-/* Cmp
- * Sort
- */
-static
-int CC KConfigNodeCmp ( const void *item, const BSTNode *n )
-{
-    const String *a = ( const String* ) item;
-    const KConfigNode *b = ( const KConfigNode* ) n;
-    return StringCompare ( a, & b -> name );
-}
-
-static
-int CC KConfigNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-    const KConfigNode *a = ( const KConfigNode* ) item;
-    const KConfigNode *b = ( const KConfigNode* ) n;
-    return StringCompare ( & a -> name, & b -> name );
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KConfigNodeAddRef ( const KConfigNode *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KConfigNode" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcNode, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeRelease ( const KConfigNode *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KConfigNode" ) )
-        {
-        case krefWhack:
-            KConfigNodeWhack ( & ( ( KConfigNode* ) self ) -> n, NULL );
-        break;
-        case krefNegative:
-            return RC ( rcKFG, rcNode, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KConfig
- *  configuration parameter manager
- */
-struct KConfig
-{
-    BSTree tree;
-    BSTree included;
-    KDualRef refcount;
-    KConfigIncluded *current_file;
-
-    char * load_path;
-    size_t load_path_sz_tmp;
-
-    const char *magic_file_path;
-    size_t magic_file_path_size;
-
-    bool dirty;
-    bool initialized;
-};
-
-
-rc_t KConfigAppendToLoadPath(KConfig *self, const char* chunk)
-{
-    rc_t rc = 0;
-    size_t new_sz = 0;
-
-    assert(self);
-
-    if (chunk == NULL || chunk[0] == '\0') {
-        return rc;
-    }
-
-    if (self->load_path == NULL) {
-        self->load_path_sz_tmp = PATH_MAX;
-        self->load_path = malloc(self->load_path_sz_tmp);
-        if (self->load_path == NULL) {
-            return RC ( rcKFG, rcMgr, rcCreating, rcMemory, rcExhausted );
-        }
-        self->load_path[0] = '\0';
-    }
-
-    new_sz = string_size(self->load_path) + 1 + string_size(chunk) + 1;
-    if (self->load_path_sz_tmp < new_sz) {
-        self->load_path_sz_tmp = 2 * new_sz;
-        self->load_path = realloc(self->load_path, self->load_path_sz_tmp);
-        if (self->load_path == NULL) {
-            return RC ( rcKFG, rcMgr, rcCreating, rcMemory, rcExhausted );
-        }
-    }
-
-    if (self->load_path[0] != '\0') {
-        strcat(self->load_path, ":");
-    }
-    strcat(self->load_path, chunk);
-
-    return rc;
-}
-
-
-/* Whack
- */
-static
-rc_t KConfigEmpty ( KConfig * self)
-{
-    if (self)
-    {
-        BSTreeWhack ( & self -> tree, KConfigNodeWhack, self );
-        BSTreeWhack ( & self -> included, KConfigIncludedWhack, NULL );
-
-        self -> magic_file_path_size = 0;
-        free ( ( void* ) self -> magic_file_path );
-        self -> magic_file_path = NULL;
-
-        self->load_path_sz_tmp = 0;
-        free ( self->load_path );
-        self->load_path = NULL;
-    }
-    return 0;
-}
-
-static
-rc_t KConfigWhack ( KConfig *self )
-{
-    KConfigEmpty (self);
-
-    free ( self );
-
-    return 0;
-}
-
-/* Init
- */
-static
-void KConfigInit ( KConfig *self, KConfigNode * root )
-{
-    KDualRefInit ( & self -> refcount, 1, 0, "KConfig", "init", "kfg" );
-    BSTreeInit ( & self -> tree );
-    self -> dirty = false;
-    self -> initialized = false;
-    BSTreeInit ( & self -> included );
-    BSTreeInsert ( & self -> tree, & root -> n, KConfigNodeSort );
-    self -> magic_file_path = NULL;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KConfigAddRef ( const KConfig *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KDualRefAdd ( & self -> refcount, "KConfig" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConfigRelease ( const KConfig *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KDualRefDrop ( & self -> refcount, "KConfig" ) )
-        {
-        case krefWhack:
-            return KConfigWhack ( ( KConfig* ) self );
-        case krefLimit:
-            return RC ( rcKFG, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-static
-KConfig *KConfigAttach ( const KConfig *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KDualRefAddDep ( & self -> refcount, "KConfig" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KConfig* ) self;
-}
-
-static
-rc_t KConfigSever ( const KConfig *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KDualRefDropDep ( & self -> refcount, "KConfig" ) )
-        {
-        case krefWhack:
-            return KConfigWhack ( ( KConfig* ) self );
-        case krefLimit:
-            return RC ( rcKFG, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* init_token_source
- */
-static
-rc_t init_token_source ( KTokenText *tt, KTokenSource *src,
-                         char *full, size_t fsize, const char *srcpath, const char *path, va_list args )
-{
-    size_t num_writ;
-    rc_t rc = 0;
-
-    if (args == NULL)
-        num_writ = string_copy ( full, fsize, path, string_size ( path ));
-    else
-        rc = string_vprintf ( full, fsize, & num_writ, path, args );
-    if ( rc == 0 )
-    {
-        String text, fpath;
-        StringInit ( & text, full, num_writ, string_len ( full, num_writ ) );
-        StringInitCString ( & fpath, srcpath );
-        KTokenTextInit ( tt, & text, & fpath );
-        KTokenSourceInit ( src, tt );
-    }
-    return rc;
-}
-
-/* Find
- */
-static
-KToken *KConfigNodeFind ( const KConfigNode *self, const KConfigNode **n, KTokenSource *src, KToken *t )
-{
-    * n = NULL;
-
-    while ( t -> id != eEndOfInput )
-    {
-        switch ( t -> id )
-        {
-        case ePeriod:
-            break;
-        case eDblPeriod:
-            if ( self -> dad == NULL )
-                return NULL;
-            self = self -> dad;
-            break;
-        case eDecimal:
-        case eHex:
-        case eOctal:
-        case eIdent:
-        case eName:
-            self = ( const KConfigNode* ) BSTreeFind
-                ( & self -> children, &t -> str, KConfigNodeCmp );
-            if ( self == NULL )
-                return t;
-            break;
-        default:
-            * n = self;
-            return t;
-        }
-
-        if ( KTokenizerNext ( kPOSIXPathTokenizer, src, t ) -> id != eFwdSlash )
-            break;
-
-        KTokenizerNext ( kPOSIXPathTokenizer, src, t );
-    }
-
-    * n = self;
-    return t;
-}
-
-/* Create
- */
-static
-KToken *KConfigNodeCreate ( KConfigNode *self, KConfigNode **n, KTokenSource *src, KToken *t, 
-                            KConfigIncluded *current_file )
-{
-    bool created = false;
-    KConfigNode * nself;
-    * n = NULL;
-
-    while ( t -> id != eEndOfInput )
-    {
-        switch ( t -> id )
-        {
-        case ePeriod:
-            break;
-        case eDblPeriod:
-            if ( self -> dad == NULL )
-                return NULL;
-            self = self -> dad;
-            break;
-        case eDecimal:
-        case eHex:
-        case eOctal:
-        case eName:
-        case eIdent:
-            nself = ( KConfigNode* ) BSTreeFind
-                ( & self -> children, & t -> str, KConfigNodeCmp );
-            if ( nself == NULL )
-            {
-                KConfigNode *child;
-                rc_t rc = KConfigNodeMake ( & child, & t -> str );
-                if ( rc != 0 )
-                    return t;
-                BSTreeInsert ( & self -> children, & child -> n, KConfigNodeSort );  
-                child -> dad = self;
-                self = child;
-                created = true;
-            }
-            else
-            {
-                self = nself;
-            }
-            break;
-        default:
-            * n = self;
-            return t;
-        }
-
-        if ( KTokenizerNext ( kPOSIXPathTokenizer, src, t ) -> id != eFwdSlash )
-            break;
-
-        KTokenizerNext ( kPOSIXPathTokenizer, src, t );
-    }
-
-    if ( created )
-        self -> came_from = current_file;
-
-    * n = self;
-    return t;
-}
-
-
-/* OpenNodeRead
- * VOpenNodeRead
- *  opens a configuration node
- *
- *  "node" [ OUT ] - return parameter for indicated configuration node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within configuration hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-static
-rc_t KConfigNodeVOpenNodeReadInt ( const KConfigNode *self, const KConfig *mgr,
-                                   const KConfigNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( node == NULL )
-    {
-        rc = RC ( rcKFG, rcNode, rcOpening, rcParam, rcNull );
-        PLOGERR (klogErr, (klogErr, rc, "faile to provide node to open $(n)", "n=%s", path));
-    }
-    else
-    {
-        if ( self == NULL )
-        {
-            rc = RC ( rcKFG, rcNode, rcOpening, rcSelf, rcNull );
-            PLOGERR (klogErr, (klogErr, rc, "failed to provide node reference for opening $(n)", "n=%s", path));
-        }
-        else
-        {
-            if ( path == NULL || path [ 0 ] == 0 )
-            {
-                * node = self;
-                rc = 0;
-            }
-            else
-            {
-                KTokenText tt;
-                KTokenSource src;
-                char full [ 4096 ];
-        
-                rc = init_token_source ( & tt, & src, full, sizeof full, "", path, args );
-                if ( rc == 0 )
-                {
-                    /* look ahead */
-                    KToken t;
-
-                    /* skip over fwd slashes */
-                    do
-                        KTokenizerNext ( kPOSIXPathTokenizer, & src, & t );
-                    while ( t.id == eFwdSlash );
-
-                    /* follow path */
-                    if ( KConfigNodeFind ( self, node, & src, & t ) == NULL )
-                    {
-                        rc = RC ( rcKFG, rcNode, rcOpening, rcPath, rcInvalid );
-                        PLOGERR (klogErr, (klogErr, rc, "bad path $(p)", "p=%s", path));
-                    }
-                    if ( ( self = * node ) == NULL )
-                    {
-                        rc = RC ( rcKFG, rcNode, rcOpening, rcPath, rcNotFound );
-                        /* don't complain about this
-                           PLOGERR (klogErr, (klogErr, rc, "can't find symbol $(p)", "p=%s", path));
-                        */
-                    }
-                    else if ( t . id != eEndOfInput )
-                    {
-                        rc = RC ( rcKFG, rcNode, rcOpening, rcPath, rcInvalid );
-                        PLOGERR (klogErr, (klogErr, rc, "bad path $(p)", "p=%s", path));
-                    }
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                /* open node for read */
-                if ( self -> read_only )
-                {
-                    assert ( self -> mgr == mgr );
-                    return KConfigNodeAddRef ( self );
-                }
-
-                /* check to see if already open */
-                if ( atomic32_read ( & self -> refcount ) == 0 )
-                {
-                    ( ( KConfigNode* ) self ) -> mgr = KConfigAttach ( mgr );
-                    ( ( KConfigNode* ) self ) -> read_only = true;
-                    return KConfigNodeAddRef ( self );
-                }
-
-                rc = RC ( rcKFG, rcNode, rcOpening, rcNode, rcBusy );
-            }
-        }
-
-        * node = NULL;
-    }
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KConfigNodeGetMgr( const KConfigNode * self, KConfig ** mgr )
-{
-    if ( self == NULL )
-        return RC ( rcKFG, rcNode, rcOpening, rcSelf, rcNull );
-    if ( mgr == NULL )
-        return RC ( rcKFG, rcNode, rcOpening, rcParam, rcNull );
-    *mgr = self->mgr;
-    return KConfigAddRef ( *mgr );
-}
-
-
-LIB_EXPORT rc_t CC KConfigNodeVOpenNodeRead ( const KConfigNode *self,
-                                              const KConfigNode **node, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return KConfigNodeVOpenNodeReadInt ( self, self -> mgr, node, path, args );
-
-    if ( node == NULL )
-        return RC ( rcKFG, rcNode, rcOpening, rcParam, rcNull );
-
-    * node = NULL;
-    return RC ( rcKFG, rcNode, rcOpening, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KConfigNodeOpenNodeRead ( const KConfigNode *self,
-                                             const KConfigNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KConfigNodeVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigVOpenNodeRead ( const KConfig *self,
-                                          const KConfigNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( node == NULL )
-        rc = RC ( rcKFG, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcOpening, rcSelf, rcNull );
-        else if (self->tree.root == NULL)
-            rc = RC ( rcKFG, rcMgr, rcOpening, rcPath, rcNotFound );
-        else
-        {
-            return KConfigNodeVOpenNodeReadInt
-                ( (const KConfigNode *) self -> tree . root, self, node, path, args );
-        }
-
-        * node = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigOpenNodeRead ( const KConfig *self,
-                                         const KConfigNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KConfigVOpenNodeRead ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenNodeUpdate
- * VOpenNodeUpdate
- *  opens a configuration node
- *
- *  "node" [ OUT ] - return parameter for indicated configuration node
- *
- *  "path" [ IN, NULL OKAY ] - optional path for specifying named
- *  node within configuration hierarchy. paths will be interpreted as
- *  if they were file system paths, using '/' as separator. the
- *  special values NULL and "" are interpreted as "."
- */
-static
-rc_t KConfigNodeVOpenNodeUpdateInt ( KConfigNode *self, KConfig *mgr,
-                                     KConfigNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( node == NULL )
-        rc = RC ( rcKFG, rcNode, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcOpening, rcSelf, rcNull );
-        else
-        {
-            if ( path == NULL || path [ 0 ] == 0 )
-            {
-                * node = self;
-                rc = 0;
-            }
-            else
-            {
-                KTokenText tt;
-                KTokenSource src;
-                char full [ 4096 ];
-        
-                rc = init_token_source ( & tt, & src, full, sizeof full, "", path, args );
-                if ( rc == 0 )
-                {
-                    /* look ahead */
-                    KToken t;
-
-                    do
-                        KTokenizerNext ( kPOSIXPathTokenizer, & src, & t );
-                    while ( t.id == eFwdSlash);
-
-                    /* follow path */
-                    assert ( mgr != NULL );
-                    if ( KConfigNodeCreate ( self, node, & src, & t, mgr -> current_file ) == NULL )
-                        return RC ( rcKFG, rcNode, rcOpening, rcPath, rcInvalid );
-                    if ( ( self = * node ) == NULL )
-                        rc = RC ( rcKFG, rcNode, rcOpening, rcMemory, rcExhausted );
-                    else if ( t . id != eEndOfInput )
-                        rc = RC ( rcKFG, rcNode, rcOpening, rcPath, rcInvalid );
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                /* check to see if internal */
-                if ( self -> internal )
-                    rc = RC ( rcKFG, rcNode, rcOpening, rcNode, rcReadonly );
-                else
-                {
-                    /* check to see if open */
-                    if ( atomic32_read ( & self -> refcount ) == 0 )
-                    {
-                        self -> mgr = KConfigAttach ( mgr );
-                        assert ( ! self -> read_only );
-                        return KConfigNodeAddRef ( self );
-                    }
-
-                    rc = RC ( rcKFG, rcNode, rcOpening, rcNode, rcBusy );
-                }
-            }
-        }
-
-        * node = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeVOpenNodeUpdate ( KConfigNode *self,
-                                                KConfigNode **node, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return KConfigNodeVOpenNodeUpdateInt ( self, self -> mgr, node, path, args );
-
-    if ( node == NULL )
-        return RC ( rcKFG, rcNode, rcOpening, rcParam, rcNull );
-
-    * node = NULL;
-    return RC ( rcKFG, rcNode, rcOpening, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KConfigNodeOpenNodeUpdate ( KConfigNode *self,
-                                               KConfigNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KConfigNodeVOpenNodeUpdate ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigVOpenNodeUpdate ( KConfig *self,
-                                            KConfigNode **node, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( node == NULL )
-        rc = RC ( rcKFG, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcOpening, rcSelf, rcNull );
-        else if (self->tree.root == NULL)
-            rc = RC ( rcKFG, rcMgr, rcOpening, rcSelf, rcCorrupt );
-        else
-        {
-            return KConfigNodeVOpenNodeUpdateInt
-                ( ( KConfigNode* ) self -> tree . root, self, node, path, args );
-        }
-
-        * node = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigOpenNodeUpdate ( KConfig *self,
-                                           KConfigNode **node, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KConfigVOpenNodeUpdate ( self, node, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Read
- *  read a node value
- *
- *  "offset" [ IN ] - initial offset into configuration
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of bytes remaining to be read.
- *  specifically, "offset" + "num_read" + "remaining" == sizeof node data
- */
-LIB_EXPORT rc_t CC KConfigNodeRead ( const KConfigNode *self,
-                                     size_t offset, char *buffer, size_t bsize,
-                                     size_t *num_read, size_t *remaining )
-{
-    rc_t rc;
-    size_t dummy;
-
-    if ( remaining == NULL )
-        remaining = & dummy;
-
-    if ( num_read == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcKFG, rcNode, rcReading, rcBuffer, rcNull );
-        else if ( offset >= self -> value . size )
-            rc = 0;
-        else
-        {
-            size_t avail = * remaining = self -> value . size - offset;
-            if ( avail > bsize )
-                avail = bsize;
-            if ( avail > 0 )
-                memcpy ( buffer, & self -> value . addr [ offset ], avail );
-            * num_read = avail;
-            * remaining -= avail;
-            return 0;
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-
-    return rc;
-}
-
-static
-void KConfigNodeSetDirty ( KConfigNode *self )
-{
-    KConfig *mgr = self -> mgr;
-
-    if ( mgr == NULL )
-        self -> dirty = true;
-    else if ( mgr -> initialized )
-        self -> dirty = mgr -> dirty = true;
-}
-
-/* Write
- *  write a node value or attribute
- *  replaces anything already there
- *
- *  "buffer" [ IN ] and "size" [ IN ] - new value data
- */
-LIB_EXPORT rc_t CC KConfigNodeWrite ( KConfigNode *self, const char *buffer, size_t size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcSelf, rcNull );
-    else if ( self -> read_only || self -> internal )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcSelf, rcReadonly );
-    else if ( size == 0 )
-    {
-        free ( self -> val_buffer ), self -> val_buffer = NULL;
-        StringInit ( & self -> value, "", 0, 0 );
-        rc = 0;
-    }
-    else if ( buffer == NULL )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcBuffer, rcNull );
-    else
-    {
-        if ( size != self -> value . size )
-        {
-            void *new_buffer = realloc ( self -> val_buffer, size + 1 );
-            if ( new_buffer == NULL )
-                return RC ( rcKFG, rcNode, rcWriting, rcMemory, rcExhausted );
-            self -> val_buffer = new_buffer;
-            self -> value . size = size;
-            self -> value . addr = new_buffer;
-        }
-
-        assert ( self -> val_buffer != NULL );
-        string_copy ( self -> val_buffer, self -> value . size + 1, buffer, size );
-        self -> value . len = string_len ( self -> val_buffer, size );
-        
-        KConfigNodeSetDirty ( self );
-        
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* Append
- *  append data to value
- *
- *  "buffer" [ IN ] and "size" [ IN ] - value data to be appended
- */
-LIB_EXPORT rc_t CC KConfigNodeAppend ( KConfigNode *self, const char *buffer, size_t size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcSelf, rcNull );
-    else if ( self -> read_only || self -> internal )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcSelf, rcReadonly );
-    else if ( size == 0 )
-        rc = 0;
-    else if ( buffer == NULL )
-        rc = RC ( rcKFG, rcNode, rcWriting, rcBuffer, rcNull );
-    else
-    {
-        void *new_buffer = realloc ( self -> val_buffer, self -> value . size + size + 1 );
-        if ( new_buffer == NULL )
-            return RC ( rcKFG, rcNode, rcWriting, rcMemory, rcExhausted );
-        self -> val_buffer = new_buffer;
-        string_copy ( & self -> val_buffer [ self -> value . size ], self -> value . size + size + 1, buffer, size );
-        self -> value . size += size;
-        self -> value . len = string_len ( self -> val_buffer, self -> value . size );
-        
-        KConfigNodeSetDirty ( self );
-
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* ReadAttr
- *  reads as NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "buffer" [ OUT ] and "bsize" - return parameter for attribute value
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-LIB_EXPORT rc_t CC KConfigNodeReadAttr ( const KConfigNode *self, const char *name,
-                                         char *buffer, size_t bsize, size_t *size )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-
-/* WriteAttr
- *  writes NUL-terminated string
- *
- *  "name" [ IN ] - NUL terminated attribute name
- *
- *  "value" [ IN ] - NUL terminated attribute value
- */
-LIB_EXPORT rc_t CC KConfigNodeWriteAttr ( KConfigNode *self,
-                                          const char *name, const char *value )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-
-/* Drop
- * VDrop
- *  drop some or all node content
- */
-LIB_EXPORT rc_t CC KConfigNodeDropAll ( KConfigNode *self )
-{
-    if ( self == NULL )
-        return RC ( rcKFG, rcNode, rcClearing, rcSelf, rcNull );
-    BSTreeWhack ( & self->children, KConfigNodeWhack, self->mgr); 
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeDropAttr ( KConfigNode *self, const char *attr )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeVDropChild ( KConfigNode *self, const char *path, va_list args )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeDropChild ( KConfigNode *self, const char *path, ... )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-
-/* Rename
- *  renames a contained object
- *
- *  "from" [ IN ] - NUL terminated string in UTF-8
- *  giving simple name of existing attr
- *
- *  "to" [ IN ] - NUL terminated string in UTF-8
- *  giving new simple attr name
- */
-LIB_EXPORT rc_t CC KConfigNodeRenameAttr ( KConfigNode *self, const char *from, const char *to )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-LIB_EXPORT rc_t CC KConfigNodeRenameChild ( KConfigNode *self, const char *from, const char *to )
-{
-    PLOGMSG (klogFatal, (klogFatal, "$(F) unimplemented", "F=%s", __func__));
-    return -1;
-}
-
-
-/*--------------------------------------------------------------------------
- * KConfig
- */
-
-static
-rc_t
-update_node ( KConfig* self, const char* key, const char* value, bool internal )
-{
-    KConfigNode * node;
-    rc_t rc = KConfigVOpenNodeUpdate ( self, &node, key, NULL);
-    if (rc == 0)
-    {
-/*        pLogMsg(klogInfo, "updating config key $(KEY) with '$(VALUE)'", 
-                          "KEY=%s,VALUE=%s", 
-                          key, value);*/
-        rc = KConfigNodeWrite (node, value, string_size(value));
-        node -> internal = internal;
-        KConfigNodeRelease ( node );
-    }
-    return rc;
-}
-
-static
-rc_t write_nvp(void * self, const char* name, size_t nameLen, VNamelist* values)
-{   /* concatenate all values from the namelist and put the result into config under the given name */
-    uint32_t count;
-    uint32_t size=0;
-    uint32_t concatTo=0;
-    uint32_t i;
-
-    char* buf;
-    rc_t rc=VNameListCount(values, &count);
-    if (rc != 0)
-    {
-        return rc;
-    }
-    for (i=0; i < count; ++i)
-    {
-        const char* val;
-        rc=VNameListGet(values, i, &val);
-        if (rc != 0)
-        {
-            return rc;
-        }
-        size+=string_size(val);
-    }
-
-    buf=(char*)malloc(size+1);
-    if (buf == 0)
-    {
-        return RC ( rcKFG, rcMgr, rcLoading, rcMemory, rcExhausted );
-    }
-
-    concatTo=0;
-    for (i=0; i < count; ++i)
-    {
-        const char* val;
-        rc=VNameListGet(values, i, &val);
-        if (rc != 0)
-        {
-            free(buf);
-            return rc;
-        }
-        string_copy(buf+concatTo, size+1-concatTo, val, string_size(val));
-        concatTo+=string_size(val);
-    }
-    buf[size]=0;
-
-    {   /* create the node */
-        String* nameStr;
-    
-        /* some old config files may have "dbGaP" in their repository keys misspelled as "dbGap" - fix if seen */
-        const char* oldGaPprefix = "/repository/user/protected/dbGap-";
-        size_t size = sizeof("/repository/user/protected/dbGap-") - 1;
-        bool needsFix = string_cmp(name, string_measure(name, NULL), oldGaPprefix, size, size) == 0;
-
-        String tmp;
-        StringInit(&tmp, name, nameLen, nameLen);
-        StringCopy((const String**)&nameStr, &tmp);
-        if (needsFix)
-            ((char*)(nameStr->addr)) [ size - 2 ] = 'P';
-    
-        rc = update_node((KConfig *)self, nameStr->addr, buf, false);
-        if (needsFix)
-        {
-            KConfigNode * node;
-            rc = KConfigVOpenNodeUpdate ( self, &node, nameStr->addr, NULL);
-            if (rc == 0)
-            {   /* we are likely to be initializing, so have to set the dirty flags directly, not through KConfigNodeSetDirty() */
-                ((KConfig *)self) -> dirty = true;
-                node -> dirty = true;
-                KConfigNodeRelease ( node );
-            }
-        }
-        StringWhack(nameStr);
-    }
-    
-    free(buf);
-    return rc;
-}
-
-static
-bool look_up_var(void * self, struct KFGParseBlock* pb)
-{
-    const KConfigNode* node;
-    rc_t rc = KConfigOpenNodeRead((KConfig*)self, &node, "%.*s", pb->tokenLength-3, pb->tokenText+2);
-    if (rc == 0)
-    {
-        pb->tokenText   = node->value.addr; 
-        pb->tokenLength = node->value.len;
-        pb->tokenId     = kfgVAR_REF;
-    }
-    KConfigNodeRelease(node);
-    return rc == 0;
-}
-
-static
-void CC report_error(KFGScanBlock* sb, const char* msg)
-{
-    pLogMsg(klogErr, "$(file):$(line):$(column): error: token='$(token)', msg='$(msg)'", 
-                     "file=%s,line=%d,column=%d,token=%.*s,msg=%s", 
-                     sb->file, 
-                     sb->lastToken->line_no, 
-                     sb->lastToken->column_no, 
-                     sb->lastToken->tokenLength, 
-                     sb->lastToken->tokenText, 
-                     msg);
-}
-
-/*
- * Set up the parameter block and start parsing lines
- */
-static
-rc_t parse_file ( KConfig * self, const char* path, const char * src )
-{
-    KFGParseBlock pb;
-    KFGScanBlock sb;
-    rc_t rc;
-
-    pb.tokenLength  = 0;
-    pb.line_no      = 0;
-    pb.column_no    = 0;
-
-    sb.self         = self;
-    sb.file         = path;
-    sb.write_nvp    = write_nvp;
-    sb.look_up_var  = look_up_var;
-    sb.report_error = report_error;
-
-    rc = KFGScan_yylex_init(&sb, src);
-    if (rc == 0)
-    {
-        KFG_parse(&pb, &sb); /* may have reported parse errors into log, but we should have been able to extract enough data to proceed regardless */
-        KFGScan_yylex_destroy(&sb);
-    }
-
-    return rc;
-}
-
-/* LoadFile
- * loads a configuration file
- */
-LIB_EXPORT rc_t CC KConfigLoadFile ( KConfig * self, const char * path, const KFile * file )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcMgr, rcLoading, rcSelf, rcNull );
-    else if ( file == NULL )
-        rc = RC ( rcKFG, rcMgr, rcLoading, rcFile, rcNull );
-    else
-    {
-        const KMMap * mm;
-        bool entry_initialized = self -> initialized;
-        self -> initialized = false;
-
-        /* populate file-specific predefined nodes */
-#define UPDATE_NODES(dir, file)                             \
-        rc = update_node(self, "kfg/dir", dir, false );     \
-        if (rc == 0)                                        \
-            rc = update_node(self, "kfg/name", file, false )
-
-        if ( path == NULL || path [ 0 ] == 0)
-        {
-            path = "UNSPECIFIED";
-            UPDATE_NODES ( "", "" );
-        }
-        else
-        {
-            KDirectory* dir;
-            rc = KDirectoryNativeDir(&dir);
-            if (rc == 0 )
-            {
-                char buff [ 4096 ];
-                rc = KDirectoryResolvePath ( dir, true, buff, sizeof buff,
-                    "%.*s", string_size(path), path );
-                if ( rc == 0 )
-                {
-                    char* name = strrchr (buff, '/');
-                    if (name == NULL)
-                    {   /* no dir name */
-                        UPDATE_NODES("", buff);
-                    }
-                    else
-                    {
-                        *name=0; /* nul-terminate dir name; file name follows the 0 */
-                        UPDATE_NODES(buff, name+1);
-                    }
-                }
-                KDirectoryRelease ( dir );
-            }
-            else
-            {
-                update_node(self, "kfg/dir", "", false);
-                update_node(self, "kfg/name", "", false);
-            }
-        }
-#undef UPDATE_NODES
-
-
-        rc = KMMapMakeRead ( & mm, file );
-        if ( rc == 0 )
-        {
-            size_t size;
-            const void * ptr;
-            rc = KMMapAddrRead ( mm, & ptr );
-            if ( rc == 0 )
-                rc = KMMapSize ( mm, & size );
-            if ( rc == 0 )
-            {
-                /* make a 0-terminated copy for parsing */
-                char* buf=malloc(size+1);
-                if (buf == 0)
-                {
-                    rc = RC ( rcKFG, rcMgr, rcLoading, rcMemory, rcExhausted );
-                }
-                else
-                {
-                    string_copy(buf, size+1, ptr, size);
-                    buf[size]=0;
-
-                    /* Parse the path to populate: */
-                    /* update_node(self, "kfg/dir", dir, false);*/
-                    /* update_node(self, "kfg/name", name, false);*/
-
-                    /* parse config file */
-                    rc = parse_file ( self, path, buf );
-                    free(buf);
-                }
-            }
-
-            KMMapRelease ( mm );
-        }
-        self -> initialized = entry_initialized;
-    }
-
-    return rc;
-}
-
-
-typedef struct PrintBuff PrintBuff;
-struct PrintBuff
-{
-    KFile *f;
-    /* total bytes flushed to the file*/
-    size_t flushed;
-    /* total bytes in buffer */
-    size_t buffered;
-    
-    rc_t rc;
-    
-    /* buffer */
-    char buffer [ 32 * 1024 ];
-    
-};
-
-/* Init
- *  initialize your structure    
- */
-static
-void PrintBuffInit ( PrintBuff *pb, KFile *f )
-{
-    assert ( pb != NULL );
-    pb -> f = f;
-    pb -> flushed = 0;
-    pb -> buffered = 0;
-    pb -> rc = 0;
-}
-
-/* Flush
- * Write buffer out to file
- */
-static rc_t PrintBuffFlush ( PrintBuff *self )
-{
-    rc_t rc = 0;
-
-    assert ( self != NULL );
-    if ( self -> buffered != 0 )
-    {
-        size_t num_writ;
-        rc = KFileWriteAll ( self -> f, self -> flushed, self -> buffer, self -> buffered, & num_writ );
-        
-        if ( rc == 0 )
-        {
-            if ( num_writ != self -> buffered )
-                rc = RC ( rcKFG, rcBuffer, rcFlushing, rcTransfer, rcIncomplete );
-            else
-            {
-                self -> flushed += num_writ;
-                self -> buffered = 0;
-            }
-        }
-    }
-    return self -> rc = rc;
-}
-
-/* Print
- *  printf style writing to the buffer
- */
-static
-rc_t PrintBuffPrint ( PrintBuff *self, const char *fmt, ... )
-{
-    rc_t rc;
-    size_t num_writ;
-    va_list args1, args2;
-
-    assert ( self != NULL );
-    assert ( fmt != NULL );
-    assert ( fmt [ 0 ] != 0 );
-
-    va_start ( args1, fmt );
-    va_copy ( args2, args1 );
-
-    rc = string_vprintf ( & self -> buffer [ self -> buffered ], 
-                          sizeof self -> buffer - self -> buffered, & num_writ, fmt, args1 );
-    if ( rc == 0 )
-        self -> buffered += num_writ;
-    else if ( GetRCObject ( rc ) == rcBuffer && GetRCState ( rc ) == rcInsufficient )
-    {
-        rc = PrintBuffFlush ( self );
-        if ( rc == 0 )
-        {
-            rc = string_vprintf ( & self -> buffer [ self -> buffered ],
-                                  sizeof self -> buffer - self -> buffered, & num_writ, fmt, args2 );
-            if ( rc == 0 )
-                self -> buffered += num_writ;
-        }
-    }
-
-    va_end ( args2 );
-    va_end ( args1 );
-
-    return self -> rc = rc;
-    
-}
-
-char ToHex(uint32_t i)
-{
-    if (i <= 9)
-        return '0' + i;
-    return 'A' + (i - 10);
-}
-
-static
-rc_t CC PrintBuffPrintQuoted ( PrintBuff *self, const String* data )
-{
-    rc_t rc = PrintBuffPrint(self, "\"");
-    const char* str = (const char*)(data->addr);
-    uint32_t i;
-    for ( i = 0; i < StringLength(data); ++i )
-    {
-        if (rc != 0)
-            break;
-        if (str[i] < ' ')
-        {
-            rc = PrintBuffPrint(self, "\\x%c%c", ToHex(str[i]/16), ToHex(str[i]%16) );
-        }
-        else
-        {
-            switch (str[i])
-            {
-            case '"':
-                rc = PrintBuffPrint(self, "\\\"");
-                break;
-            default:
-                rc = PrintBuffPrint(self, "%c", str[i]);
-            }
-        }
-    }
-    if (rc == 0)
-        rc = PrintBuffPrint(self, "\"");
-    return rc;
-}
-
-static
-bool KConfigNodePrintPath ( KConfigNode *self, PrintBuff *pb )
-{
-    if ( self -> dad == NULL )
-        PrintBuffPrint ( pb, "%S", & self -> name );
-    else
-    {
-        if ( KConfigNodePrintPath ( self -> dad, pb ) )
-            return true;
-
-        PrintBuffPrint ( pb, "/%S", & self -> name );
-    }
-    return pb -> rc != 0;
-}
-
-static
-bool CC WriteDirtyNode ( BSTNode *n, void *data )
-{
-    KConfigNode *self = ( KConfigNode * ) n;
-    PrintBuff *pb = data;
-
-    if ( self -> dirty || ( self -> came_from != NULL && self -> came_from -> is_magic_file ) )
-    {
-        if ( KConfigNodePrintPath ( self, pb ) )
-            return true;
-
-        if ( PrintBuffPrint ( pb, " = " ) != 0 )
-            return true;
-            
-        if ( PrintBuffPrintQuoted ( pb, &self->value ) != 0 )
-            return true;
-            
-        if ( PrintBuffPrint ( pb, "\n" ) != 0 )
-            return true;
-    }
-
-    return BSTreeDoUntil ( & self -> children, false, WriteDirtyNode, pb );
-}
-
-static
-void CC UnsetDirtyNode ( BSTNode *n, void *data )
-{
-    KConfigNode *self = ( KConfigNode * ) n;
-
-    if ( self -> dirty )
-        self -> dirty = false;
-
-    BSTreeForEach ( & self -> children, false, UnsetDirtyNode, data );
-}
-
-static
-rc_t path_to_magic_file ( const KConfig *self, char *path, size_t buffer_size, size_t *path_size )
-{
-    const KConfigNode *node;
-    rc_t rc = KConfigOpenNodeRead ( self, & node, "NCBI_SETTINGS" );
-
-    if ( rc == 0 )
-    {
-        size_t num_read, remaining;
-        rc = KConfigNodeRead ( node, 0, path, buffer_size - 1, & num_read, & remaining );
-
-        if ( rc == 0 && remaining != 0 )
-           rc = RC ( rcKFG, rcNode, rcReading, rcBuffer, rcInsufficient );
-
-        path[num_read] = '\0';
-        
-        KConfigNodeRelease ( node );
-    }
-    return rc;
-}
-
-/* Commit
- *  commits changes to user's private configuration file
- */
-LIB_EXPORT rc_t CC KConfigCommit ( KConfig *self )
-{
-    rc_t rc;
-    size_t path_size;
-    char magic_file_path [ 4096 ];
-
-    if ( self == NULL )
-        return RC ( rcKFG, rcData, rcCommitting, rcSelf, rcNull );
-
-    /* Must only commit dirty nodes*/
-    if ( ! self -> dirty )
-        return 0;
-
-    rc = path_to_magic_file ( self, magic_file_path, sizeof magic_file_path, & path_size );
-    if ( rc == 0 )
-    {
-        char tmp_file_path [ 4096 ];
-        rc = string_printf ( tmp_file_path, sizeof tmp_file_path, NULL, "%s.tmp", magic_file_path );
-        if ( rc == 0 )
-        {
-            KDirectory *dir;        
-            
-            /* get current directory */
-            rc = KDirectoryNativeDir ( & dir );
-            if ( rc == 0 )
-            {
-                KFile *tmp;
-
-                /* create temp magic file */
-                rc = KDirectoryCreateFile ( dir, & tmp, false, 0600, kcmInit | kcmParents, tmp_file_path );
-
-                if ( rc == 0 )
-                {
-                    PrintBuff pb;
-                    PrintBuffInit ( & pb, tmp );
-
-                    /* issue warning */
-                    rc = PrintBuffPrint ( & pb, "## auto-generated configuration file - DO NOT EDIT ##\n\n" );
-                    if ( rc == 0 )
-                    {
-                        /* flush nodes to file */
-                        if ( BSTreeDoUntil ( & self -> tree, false, WriteDirtyNode, & pb ) )
-                            /* failure */
-                            rc = pb . rc;
-                        else 
-                            rc = PrintBuffFlush ( & pb );
-                    }
-                        
-                    KFileRelease ( tmp );
-                        
-                    if ( rc == 0 )
-                    {
-                        /* Rename file */
-                        rc = KDirectoryRename ( dir, true, tmp_file_path, magic_file_path  );
-                        if ( rc == 0 )
-                        {
-                            /* clear dirty flags */
-                            BSTreeForEach (  & self -> tree, false, UnsetDirtyNode, & pb);
-                                
-                            self -> dirty = false;
-                        }
-                    }
-                        
-                    if ( rc != 0 )
-                        KDirectoryRemove ( dir, true, tmp_file_path );
-                }
-            
-                /* release dir */
-                KDirectoryRelease ( dir );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t record_magic_path ( KConfig *self, const KDirectory *dir, const char *path, size_t sz )
-{
-    char buff [ 4096 ];
-    rc_t rc = KDirectoryResolvePath ( dir, true, buff, sizeof buff, "%.*s", ( int ) sz, path );
-    if ( rc == 0 )
-    {
-        char *magic_file_path;
-        sz = string_size ( buff );
-        magic_file_path = malloc ( sz + 1 );
-        if ( magic_file_path == NULL )
-            rc = RC ( rcKFG, rcMgr, rcLoading, rcMemory, rcExhausted );
-        else
-        {
-            free ( (void*) self -> magic_file_path );
-            self -> magic_file_path = magic_file_path;
-            self -> magic_file_path_size = sz;
-            memcpy ( magic_file_path, buff, sz + 1 );
-        }
-    }
-
-    return rc;
-}
-
-
-static
-rc_t make_include_path ( KConfigIncluded **p, const KDirectory *dir, const char *path, size_t sz, bool is_magic )
-{
-    char buff [ 4096 ];
-    rc_t rc = KDirectoryResolvePath ( dir, true, buff, sizeof buff, "%.*s", ( int ) sz, path );
-    if ( rc == 0 )
-    {
-        KConfigIncluded *include;
-        sz = string_size ( buff );
-        include = malloc ( sizeof * include + sz );
-        if ( include == NULL )
-            rc = RC ( rcKFG, rcMgr, rcLoading, rcMemory, rcExhausted );
-        else
-        {
-            include -> is_magic_file = is_magic;
-            string_copy ( include -> path, sz + sizeof include -> path, buff, sz );
-            * p = include;
-            return 0;
-        }
-    }
-    * p = NULL;
-    return rc;
-}
-
-
-static
-bool load_from_file_path ( KConfig *self, const KDirectory *dir, const char *path, size_t sz, bool is_magic )
-{
-    rc_t rc;
-    const KFile *cfg_file;
-
-    /* record magic file path, regardless of whether it exists as a file */
-    if ( is_magic )
-        record_magic_path ( self, dir, path, sz );
-    
-    DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from file '%.*s'\n", (int)sz, path ) );
-    rc = KDirectoryOpenFileRead ( dir, & cfg_file, "%.*s", ( int ) sz, path );
-    if ( rc == 0 )
-    {
-        KConfigIncluded *include;
-        rc = make_include_path ( & include, dir, path, sz, is_magic );
-        if ( rc == 0 )
-        {
-            BSTNode *existing;
-            if ( BSTreeInsertUnique ( & self -> included, & include -> n, & existing, KConfigIncludedSort ) != 0 )
-                free ( include );
-            else
-            {
-                self -> current_file = include;
-                rc = KConfigLoadFile ( self, include -> path, cfg_file );
-                self -> current_file = NULL;
-                if ( rc != 0 )
-                {
-                    BSTreeUnlink ( & self -> included, & include -> n );
-                    free ( include );
-                }
-            }
-        }
-
-        KFileRelease ( cfg_file );
-    }
-    return ( rc == 0 ) ? true : false;
-}
-
-typedef struct scan_config_path_data scan_config_path_data;
-struct scan_config_path_data
-{
-    KConfig *self;
-    bool loaded;
-};
-
-static
-rc_t CC scan_config_path ( const KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    scan_config_path_data * pb = data;
-    switch ( type )
-    {
-    case kptFile:
-    case kptFile | kptAlias:
-    {
-        size_t sz = string_size ( name );
-        if ( sz >= 5 && strcase_cmp ( & name [ sz - 4 ], 4, ".kfg", 4, 4 ) == 0 )
-            pb -> loaded |= load_from_file_path ( pb -> self, dir, name, sz, false );
-
-        break;
-    }}
-
-    return 0;
-}
-
-static
-bool scan_config_dir ( KConfig *self, const KDirectory *dir )
-{
-    scan_config_path_data pb;
-
-    pb . self = self;
-    pb . loaded = false;
-
-    KDirectoryVVisit ( dir, false, scan_config_path, & pb, ".", NULL );
-
-    return pb . loaded;
-}
-
-static
-bool load_from_dir_path ( KConfig *self, const KDirectory *dir, const char *path, size_t sz )
-{
-    bool loaded = false;
-    const KDirectory *cfg_dir;
-    rc_t rc = KDirectoryOpenDirRead ( dir, & cfg_dir, false, "%.*s", ( uint32_t ) sz, path );
-    if ( rc == 0 )
-    {
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from directory '%.*s'\n", (int)sz, path ) );
-        loaded = scan_config_dir ( self, cfg_dir );
-        KDirectoryRelease ( cfg_dir );
-    }
-    return loaded;
-}
-
-static
-bool load_from_path ( KConfig *self, const KDirectory * dir, const char *path, size_t sz )
-{
-    bool loaded = false;
-    const char *naughty = string_chr ( path, sz, '%' );
-    if ( naughty == NULL && sz != 0 )
-    {
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from path '%.*s'\n", (int)sz, path ) );
-        switch ( KDirectoryPathType ( dir, "%.*s", ( int ) sz, path ) & ~ kptAlias )
-        {
-        case kptFile:
-            loaded = load_from_file_path ( self, dir, path, sz, false );
-            break;
-        case kptDir:
-            loaded = load_from_dir_path ( self, dir, path, sz );
-            break;
-        }
-    }
-    return loaded;
-}
-
-static
-bool load_from_path_list ( KConfig *self, const KDirectory *dir, const char *path )
-{
-    bool loaded = false;
-    const char *end = path + string_size ( path );
-    while ( path < end )
-    {
-        const char *sep = string_chr ( path, end - path, ':' );
-        if ( sep == NULL )
-            sep = end;
-        if ( load_from_path ( self, dir, path, sep - path ) )
-            loaded = true;
-        path = sep + 1;
-    }
-    return loaded;
-}
-
-static
-bool load_from_env_variable ( KConfig *self, const KDirectory *dir )
-{
-    const char * env_list [] =
-    {
-        "KLIB_CONFIG",
-        "VDB_CONFIG",
-        "VDBCONFIG"
-    };
-    
-    int i;
-    bool loaded = false;
-    for ( i = 0; ! loaded && i < sizeof env_list / sizeof env_list [ 0 ]; ++ i )
-    {
-        const char *eval = getenv ( env_list [ i ] );
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from env. var '%s'\n", env_list[ i ] ) );
-        if ( eval != NULL && eval [ 0 ] != 0 )
-        {
-            rc_t rc = 0;
-            DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from env. var '%s'\n", eval ) );
-            rc = KConfigAppendToLoadPath(self, eval);
-            loaded = load_from_path_list ( self, dir, eval );
-            if ( loaded )
-                DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: found from env. var '%s'\n", eval ) );
-        }
-    }
-
-    return loaded;
-}
-
-static
-bool load_from_std_location ( KConfig *self, const KDirectory *dir )
-{
-    const char * std_locs [] =
-    {
-#if ! WINDOWS
-        "/etc/ncbi",
-#else
-        "/c/ncbi",
-#endif
-    };
-
-    rc_t rc = 0;
-
-    int i;
-    bool loaded = false;
-    for ( i = 0; ! loaded && i < sizeof std_locs / sizeof std_locs [ 0 ]; ++ i )
-    {
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from std. location '%s'\n", std_locs[ i ] ) );
-        rc = KConfigAppendToLoadPath(self, std_locs [ i ]);
-        loaded = load_from_path ( self, dir,
-            std_locs [ i ], string_size ( std_locs [ i ] ));
-    }
-    if ( loaded )
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: found from std. location\n" ) );
-    return loaded;
-}
-
-static
-rc_t load_from_fs_location ( KConfig *self )
-{
-    KDyld *dyld;
-    rc_t rc = KDyldMake ( & dyld );
-    if ( rc == 0 )
-    {
-        const KDirectory *dir;
-        rc = KDyldHomeDirectory ( dyld, & dir, ( fptr_t ) KConfigMake );
-        if ( rc == 0 )
-        {
-            char resolved[PATH_MAX + 1];
-            DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try to load from dyn. loader\n" ) );
-
-/* N.B. Duplication of ResolvePath here and in load_from_dir_path ? */
-            if (KDirectoryResolvePath
-                    (dir, true, resolved, sizeof resolved, "ncbi") == 0)
-            {
-                rc = KConfigAppendToLoadPath(self, resolved);
-            }
-            if ( load_from_dir_path ( self, dir, "ncbi", 4 ) )
-                DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: found from dyn. loader\n" ) );
-            KDirectoryRelease ( dir );
-        }
-        KDyldRelease ( dyld );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigGetLoadPath ( const KConfig *self,
-    const char **path )
-{
-    if (self == NULL) {
-        return RC ( rcKFG, rcPath, rcListing, rcSelf, rcNull );
-    }
-
-    if (path == NULL) {
-        return RC ( rcKFG, rcPath, rcListing, rcParam, rcNull );
-    }
-
-    *path = self->load_path;
-    return 0;
-}
-
-static
-bool load_user_settings(KConfig *self, const KDirectory *dir, const char* dir_path)
-{
-    size_t num_writ;
-    char path[PATH_MAX];
-    rc_t rc = string_printf ( path, sizeof(path), & num_writ, "%s/%s", dir_path, MAGIC_LEAF_NAME );
-    if ( rc == 0 )
-        return load_from_file_path ( self, dir, path, string_measure(path, NULL), true );
-
-    return false;
-}
-
-static
-bool load_from_home(KConfig *self, const KDirectory *dir)
-{
-    const char *home = getenv("HOME");
-    DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: checking HOME\n" ) );
-
-    if (home == NULL) {
-        home = getenv("USERPROFILE");
-    }
-
-    if (home != NULL)
-    {
-        bool loaded;
-        size_t num_writ;
-        char path[PATH_MAX];
-        rc_t rc = string_printf(path, sizeof path, &num_writ, "%s/.ncbi", home);
-        if (rc != 0)
-            return false;
-
-        assert(num_writ < sizeof path);
-        
-        loaded = load_from_path ( self, dir, path, num_writ );
-        if ( loaded )
-        {
-            DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG),
-                ( "KFG: found from '%s'\n", path ) );
-        }
-
-        if ( load_user_settings ( self, dir, path ) )
-            loaded = true;
-            
-        return loaded;
-    }
-    else {
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG),
-            ( "KFG: none of env{HOME}, env{USERPROFILE} is defined\n" ) );
-    }
-
-    return false;
-}
-
-static
-void load_config_files ( KConfig *self, const KDirectory *dir )
-{
-    rc_t rc;
-    bool loaded;
-    KDirectory *wd;
-
-    /* if user supplied a starting point, try that */
-    if ( dir != NULL )
-    {
-        DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: try load from supplied directory\n" ) );
-
-        loaded = scan_config_dir ( self, dir );
-        if ( loaded )
-            DBGMSG( DBG_KFG, DBG_FLAG(DBG_KFG), ( "KFG: found from supplied directory\n" ) );
-
-        if ( load_user_settings ( self, dir, "." ) )
-            loaded = true;
-
-        if ( loaded )
-            return;
-    }
-
-    /* open up the native directory */
-    rc = KDirectoryNativeDir ( & wd );
-    if ( rc != 0 )
-        return;
-
-    /* try to load from environment variable */
-    loaded = load_from_env_variable ( self, wd );
-
-    /* try to load from standard locations */
-    if ( ! loaded )
-        loaded = load_from_std_location ( self, wd );
-
-    /* check for config as the result of a user install
-       i.e. not an admin installation */
-    if ( ! loaded )
-        load_from_fs_location ( self );
-
-    if ( ! s_disable_user_settings )
-        loaded |= load_from_home ( self, wd );
-
-    KDirectoryRelease ( wd );
-
-    if (self->load_path) {
-        char* tmp = NULL;
-        self->load_path_sz_tmp = string_size(self->load_path) + 1;
-        tmp = realloc(self->load_path, self->load_path_sz_tmp);
-        if (tmp) {
-            self->load_path = tmp;
-        }
-    }
-}
-
-static
-void add_predefined_nodes ( KConfig * self, const char *appname )
-{
-    size_t bytes;
-    char buf [ 4096 ];
-    const char *value;
-
-    KDirectory *cwd;
-    const KDirectory *dir;
-
-#if ! WINDOWS
-    struct utsname name;
-#endif
-
-    /* Path to libkfg.so */
-    KDyld *dyld;
-    rc_t rc = KDyldMake ( & dyld );
-    if ( rc == 0 )
-    {
-        rc = KDyldHomeDirectory ( dyld, & dir, ( fptr_t ) KConfigMake );
-        if ( rc == 0 )
-        {
-            KDirectoryResolvePath ( dir, true, buf, sizeof buf, "." );
-            KDirectoryRelease ( dir );
-        }
-        KDyldRelease ( dyld );
-    }
-    update_node ( self, "vdb/lib/paths/kfg", rc == 0 ? buf : "", true );
-
-    /* Architecture */ 
-#if ! WINDOWS
-    if (uname(&name) >= 0)
-        update_node(self, "kfg/arch/name", name.nodename, true);
-    else
-#endif
-        update_node ( self, "kfg/arch/name", "", true);
-
-    string_printf(buf, sizeof(buf), &bytes, "%u", _ARCH_BITS);
-    update_node ( self, "kfg/arch/bits", buf, true );
-
-    /* *OS */
-#if LINUX
-    #define OS "linux"
-#elif MAC 
-    #define OS "mac"
-#elif WINDOWS
-    #define OS "win"
-#elif SUN
-    #define OS "sun"
-#else
-    #error unrecognized OS
-#endif
-    update_node ( self, "OS", OS, true );
-#undef OS
-
-    /* BUILD_LINKAGE */
-#if _STATIC
-    #define BUILD_LINKAGE "STATIC"
-#else
-    #define BUILD_LINKAGE "DYNAMIC"
-#endif
-    update_node ( self, "BUILD_LINKAGE", BUILD_LINKAGE, true );
-#undef BUILD_LINKAGE
-
-    /* BUILD */
-#if _PROFILING
-    #define BUILD "PROFILE"
-#elif _DEBUGGING
-    #define BUILD "DEBUG"
-#else 
-    #define BUILD "RELEASE"
-#endif
-    update_node(self, "BUILD", BUILD, true );
-#undef BUILD
-
-    cwd = NULL;
-
-    /* PWD */
-    rc = KDirectoryNativeDir ( & cwd );
-    if ( rc == 0 )
-        rc = KDirectoryResolvePath ( cwd, true, buf, sizeof buf, "." );
-    update_node(self, "PWD", rc == 0 ? buf : "", true );
-
-    /* APPPATH */
-    if ( appname != NULL && rc == 0 )
-    {
-        bytes = string_size ( appname );
-        value = string_rchr ( appname, bytes, '/' );
-        if ( value == NULL )
-            value = string_rchr ( appname, bytes, '\\' );
-        if ( value != NULL )
-            bytes = appname + bytes - value;
-        rc = KDirectoryResolvePath ( cwd, true, buf, sizeof buf, "%s", appname);
-        if ( rc == 0 && bytes != 0 )
-            buf [ string_size(buf) - bytes ] = 0;    
-        update_node(self, "APPPATH", rc == 0 ? buf : "", true );
-    }
-
-    /* APPNAME */
-    rc = LogAppName(buf, sizeof(buf), &bytes);
-    if ( rc == 0 )
-        buf [ bytes ] = 0;
-    update_node(self, "APPNAME", rc == 0 ? buf : "", true );
-
-    /* Environment variables */
-    /* some of the variables may be undefined, create nodes with empty values for them */
-#define DEFINE_ENV(name)                                         \
-    value=getenv(name);                                          \
-    update_node(self, name, value == NULL ? "" : value, true )
-
-    DEFINE_ENV("HOST");
-    DEFINE_ENV("USER");
-    value = getenv("HOME");
-    if (value == NULL) 
-    {   /* apparently on Windows, use USERPROFILE */
-        value = getenv("USERPROFILE");
-    }
-    if (value == NULL)
-    {
-        update_node(self, "HOME", "", true );
-        update_node(self, "NCBI_HOME", "", false );
-        update_node(self, "NCBI_SETTINGS", "", false );
-    }
-    else
-    {
-        rc = KDirectoryResolvePath(cwd, true, buf, sizeof(buf), value);
-        if (rc == 0)
-        {
-            size_t bytes2;
-            char buf2 [ 4096 ];
-        
-            update_node(self, "HOME", buf, true );
-            
-            string_printf(buf2, sizeof(buf2), &bytes2, "%s/.ncbi", buf);
-            update_node(self, "NCBI_HOME", buf2, false );    /* can be overridden by the user */ 
-            
-            string_printf(buf2, sizeof(buf2), &bytes2, "%s/.ncbi/%s", buf, MAGIC_LEAF_NAME);
-            update_node(self, "NCBI_SETTINGS", buf2, false );    /* can be overridden by the user */ 
-        }
-        else
-            LOGERR (klogErr, rc, "Unable to create a config item for $HOME");
-    }
-
-    DEFINE_ENV("VDB_ROOT");
-    DEFINE_ENV("VDB_CONFIG");
-#undef DEFINE_ENV
-
-    KDirectoryRelease ( cwd );
-}
-
-static
-rc_t KConfigFill ( KConfig * self, const KDirectory * cfgdir, const char *appname, bool local)
-{
-    KConfigNode * root;
-    String empty;
-    rc_t rc;
-
-    CONST_STRING ( & empty, "" );
-
-    rc = KConfigNodeMake ( & root, & empty );
-    if (rc == 0)
-    {
-        KConfigInit ( self, root );
-        add_predefined_nodes ( self, appname );
-        load_config_files ( self, cfgdir );
-        KConfigCommit ( self ); /* commit changes made to magic file nodes duting parsing (e.g. fixed spelling of dbGaP names) */
-    }
-    return rc;
-}
-
-
-extern rc_t ReportKfg ( const ReportFuncs *f, uint32_t indent );
-
-/* "cfg" [ OUT ] - return parameter for mgr
-   if ("local" == true) do not initialize G_kfg */
-static
-rc_t KConfigMakeImpl ( KConfig **cfg, const KDirectory * cfgdir, bool local )
-{
-    rc_t rc;
-    const char *appname = NULL;
-
-    static bool latch;
-    if ( ! latch )
-    {
-        appname = ReportInitConfig ( ReportKfg );
-        latch = true;
-    }
-
-    if ( cfg == NULL )
-        rc = RC ( rcKFG, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        KConfig *mgr = calloc ( 1, sizeof * mgr );
-        if ( mgr == NULL )
-            rc = RC ( rcKFG, rcMgr, rcCreating, rcMemory, rcExhausted );
-        else
-        {
-            rc = KConfigFill (mgr, cfgdir, appname, local);
-
-            mgr -> initialized = true;
-            if ( rc == 0 )
-            {
-                * cfg = mgr;
-                return 0;
-            }
-
-            KConfigWhack ( mgr );
-        }
-
-        * cfg = NULL;
-    }
-
-    return rc;
-}
-
-/* call KConfigMake; do not initialize G_kfg */
-LIB_EXPORT rc_t CC KConfigMakeLocal ( KConfig **cfg, const KDirectory * cfgdir )
-{   return KConfigMakeImpl(cfg, cfgdir, true); }
-
-/* Make
- *  create a process-global configuration manager
- *
- *  "cfg" [ OUT ] - return parameter for mgr
- */
-LIB_EXPORT rc_t CC KConfigMake ( KConfig **cfg, const KDirectory * cfgdir )
-{   return KConfigMakeImpl(cfg, cfgdir, false); }
-
-/*--------------------------------------------------------------------------
- * KNamelist
- */
-typedef struct KfgConfigNamelist KfgConfigNamelist;
-struct KfgConfigNamelist
-{
-    KNamelist dad;
-    size_t count;
-    const char *namelist [ 1 ];
-};
- 
-/* Whack
- */
-static
-rc_t CC KfgConfigNamelistWhack ( KfgConfigNamelist *self )
-{
-    free ( self );
-    return 0;
-}
- 
-/* Count
- */
-static
-rc_t CC KfgConfigNamelistCount ( const KfgConfigNamelist *self,
-uint32_t *count )
-{
-    * count = ( uint32_t ) self -> count;
-    return 0;
-}
- 
-/* Get
- */
-static
-rc_t CC KfgConfigNamelistGet ( const KfgConfigNamelist *self,
-    uint32_t idx, const char **name )
-{
-    if ( ( size_t ) idx >= self -> count )
-        return RC ( rcDB, rcNamelist, rcAccessing, rcParam, rcInvalid );
-    * name = self -> namelist [ idx ];
-    return 0;
-}
- 
-/* Make
- */
-static KNamelist_vt_v1 vtKfgConfigNamelist =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KfgConfigNamelistWhack,
-    KfgConfigNamelistCount,
-    KfgConfigNamelistGet
-    /* end minor version 0 methods */
-};
- 
- static
- rc_t KfgConfigNamelistMake ( KNamelist **names, uint32_t count )
- {
-     rc_t rc;
-     KfgConfigNamelist *self = malloc ( sizeof * self -
-         sizeof self -> namelist + count * sizeof self -> namelist [ 0 ] );
-     if ( self == NULL )
-         rc = RC ( rcKFG, rcMetadata, rcListing, rcMemory, rcExhausted );
-     else
-     {
-         self -> count = 0;
-         
-         rc = KNamelistInit ( & self -> dad,
-             ( const KNamelist_vt* ) & vtKfgConfigNamelist );
-         if ( rc == 0 )
-         {
-             * names = & self -> dad;
-             return 0;
-         }
-         
-         free ( self );
-     }
- 
-     return rc;
- }
- 
-/* List
- *  create metadata node listings
- */
-static
-void CC BSTNodeCount ( BSTNode *n, void *data )
-{
-    * ( uint32_t* ) data += 1;
-}
-
-static
-void CC KConfigNodeGrabName ( BSTNode *n, void *data )
-{
-    KfgConfigNamelist *list = data;
-    list -> namelist [ list -> count ++ ]
-        = ( ( const KConfigNode* ) n ) -> name . addr;
-}
-
-/* ListChildren
- *  list all named children
- */
-LIB_EXPORT rc_t CC KConfigNodeListChildren ( const KConfigNode *self,
-    KNamelist **names )
-{
-    if ( names == NULL )
-        return RC ( rcKFG, rcNode, rcListing, rcParam, rcNull );
-
-    * names = NULL;
-
-    if ( self != NULL )
-    {
-        rc_t rc;
-
-        uint32_t count = 0;
-        BSTreeForEach ( & self -> children, 0, BSTNodeCount, & count );
-
-        rc = KfgConfigNamelistMake ( names, count );
-        if ( rc == 0 )
-            BSTreeForEach
-                ( & self -> children, 0, KConfigNodeGrabName, * names );
-
-        return rc;
-    }
-
-    return RC ( rcKFG, rcNode, rcListing, rcSelf, rcNull );
-}
-
-static
-void CC KConfigGrabName ( BSTNode *n, void *data )
-{
-    KfgConfigNamelist *list = data;
-    list -> namelist [ list -> count ++ ]
-        = ( ( const KConfigIncluded* ) n ) -> path;
-}
-
-/* ListIncluded
- *  list all included files
- */
-LIB_EXPORT rc_t CC KConfigListIncluded ( const KConfig *self,
-    KNamelist **names )
-{
-    if ( names == NULL )
-        return RC ( rcKFG, rcMgr, rcListing, rcParam, rcNull );
-
-    * names = NULL;
-
-    if ( self != NULL )
-    {
-        rc_t rc;
-
-        uint32_t count = 0;
-        BSTreeForEach ( & self -> included, 0, BSTNodeCount, & count );
-
-        rc = KfgConfigNamelistMake ( names, count );
-        if ( rc == 0 )
-            BSTreeForEach
-                ( & self -> included, 0, KConfigGrabName, * names );
-
-        return rc;
-    }
-
-    return RC ( rcKFG, rcMgr, rcListing, rcSelf, rcNull );
-}
-
-/************** Internal node-reading helpers *************/
-
-/* ReadNodeValueFixed
- * copy the node's value into the caller's fixed size buffer and 0-terminate
- */
-static rc_t ReadNodeValueFixed ( const KConfigNode* self, char *buf, size_t bsize )
-{
-    size_t num_read, remaining;
-    rc_t rc = KConfigNodeRead ( self, 0, buf, bsize - 1, &num_read, &remaining);
-    if (rc == 0)
-    {
-        if (remaining != 0)
-            rc = RC ( rcKFG, rcNode, rcReading, rcBuffer, rcInsufficient );
-        else
-            buf[num_read] = '\0';
-    }        
-    return rc;
-}
-
-/**********************************************************/
- 
-/* ReadBool
- *  read a boolean node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (true if "TRUE", false if "FALSE"; rc != 0 if neither)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadBool ( const KConfigNode *self, bool *result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = false;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            char buf [ 6 ];
-            rc = ReadNodeValueFixed ( self, buf, sizeof buf );
-            if ( rc == 0 )
-            {
-                switch ( tolower ( buf [ 0 ] ) )
-                {
-                case 'f':
-                    if ( buf [ 1 ] == 0 )
-                        return 0;
-                    if ( strncasecmp ( buf, "false", sizeof buf ) == 0 )
-                        return 0;
-                    break;
-
-                case 'n':
-                    if ( buf [ 1 ] == 0 )
-                        return 0;
-                    if ( strncasecmp ( buf, "no", sizeof buf ) == 0 )
-                        return 0;
-                    break;
-
-                case 't':
-                    * result = true;
-                    if ( buf [ 1 ] == 0 )
-                        return 0;
-                    if ( strncasecmp ( buf, "true", sizeof buf ) == 0 )
-                        return 0;
-                    break;
-
-                case 'y':
-                    * result = true;
-                    if ( buf [ 1 ] == 0 )
-                        return 0;
-                    if ( strncasecmp ( buf, "yes", sizeof buf ) == 0 )
-                        return 0;
-                    break;
-                }
-
-                * result = false;
-                rc = RC ( rcKFG, rcNode, rcReading, rcFormat, rcIncorrect );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* ReadI64
- *  read an integer node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadI64 ( const KConfigNode *self, int64_t *result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = 0;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            /* allow for leading zeros */
-            char buf [ 256 ];
-    
-            rc = ReadNodeValueFixed(self, buf, sizeof(buf));
-            if (rc == 0)
-            {
-                char* endptr;
-                int64_t res = strtoi64(buf, &endptr, 0);
-                if ( *endptr == '\0' )
-                    *result = res;
-                else
-                    rc = RC(rcKFG, rcNode, rcReading, rcFormat, rcIncorrect);
-            }
-        }
-    }
-    return rc;
-}
-
-/* ReadU64
- *  read an unsiged node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadU64 ( const KConfigNode *self, uint64_t* result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = 0;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            /* allow for leading zeros */
-            char buf [ 256 ];
-    
-            rc = ReadNodeValueFixed(self, buf, sizeof(buf));
-            if (rc == 0)
-            {
-                char* endptr;
-                int64_t res = strtou64(buf, &endptr, 0);
-                if ( *endptr == '\0' )
-                    *result = res;
-                else
-                    rc = RC(rcKFG, rcNode, rcReading, rcFormat, rcIncorrect);
-            }
-        }
-    }
-    return rc;
-}
-
-/* ReadF64
- *  read a floating point node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadF64( const KConfigNode *self, double* result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = 0.0;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            /* allow for leading zeros, trailing digits */
-            char buf [ 256 ];
-
-            rc = ReadNodeValueFixed(self, buf, sizeof(buf));
-            if (rc == 0)
-            {
-                char* endptr;
-                double res = strtod(buf, &endptr);
-                if ( *endptr == '\0' )
-                    *result = res;
-                else
-                    rc = RC(rcKFG, rcNode, rcReading, rcFormat, rcIncorrect);
-            }
-        }
-    }
-    return rc;
-}
-
-#if 0
-/*** NB - code needs to be located in VFS ***/
-/* ReadNodeValueFixed
- * Allocate a character buffer of sufficient size, copy the node's value into it, 0-terminate. Caller deallocates.
- */
-static rc_t ReadNodeValueVariable( const KConfigNode* self, char** buf )
-{
-    size_t num_read, to_read;
-    /* first we ask about the size to be read */
-    rc_t rc = KConfigNodeRead ( self, 0, NULL, 0, &num_read, &to_read );
-    if ( rc == 0 )
-    {
-        char* value = malloc( to_read + 1 );
-        if ( value )
-        {
-            rc = ReadNodeValueFixed( self, value, to_read + 1 );
-            if ( rc == 0 )
-                *buf = value;
-            else
-                free (value);
-        }
-        else
-            rc = RC( rcKFG, rcNode, rcReading, rcMemory, rcExhausted );
-    }   
-    return rc;
-}
-
-/* ReadFloat
- *  read a VPath node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadVPath ( const KConfigNode *self, struct VPath** result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            char* buf;
-            rc = ReadNodeValueVariable ( self, &buf );
-            if ( rc == 0)
-            {
-                rc = VPathMake(result, buf);
-                free(buf);
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-/* ReadString
- *  read a String node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadString ( const KConfigNode *self, String** result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        * result = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcNode, rcReading, rcSelf, rcNull );
-        else
-        {
-            size_t num_read, to_read;
-
-            /* first we ask about the size to be read */
-            rc = KConfigNodeRead ( self, 0, NULL, 0, &num_read, &to_read );
-            if ( rc == 0 )
-            {
-                String *value = malloc ( sizeof * value + to_read + 1 );
-                if ( value == NULL )
-                    rc = RC( rcKFG, rcNode, rcReading, rcMemory, rcExhausted );
-                else
-                {
-                    /* TBD - this is broken for non-ascii strings
-                       much better to be WITHIN the config.c implementation
-                       and reach into the node value directly! */
-                    StringInit ( value, (char*)( value + 1 ), to_read, to_read + 1 );
-                    rc = ReadNodeValueFixed(self, (char*)value->addr, to_read + 1);
-                    if ( rc == 0 )
-                        *result = value;
-                    else
-                    {
-                        rc = RC(rcKFG, rcNode, rcReading, rcFormat, rcIncorrect);
-                        free ( value );
-                    }
-                }
-            }
-        }
-    }    
-    return rc;
-}
-
-/* this macro wraps a call to KConfigNodeGetXXX in a node-accessing
-   code to implement the corresponding KConfigGetXXX function */
-#define NODE_TO_CONFIG_ACCESSOR(fn) \
-    const KConfigNode* node;                                \
-    rc_t rc = KConfigOpenNodeRead ( self, &node, path );    \
-    if ( rc == 0)                                           \
-    {                                                       \
-        rc_t rc2;                                           \
-        rc = fn(node, result);                              \
-        rc2 = KConfigNodeRelease(node);                     \
-        if (rc == 0)                                        \
-            rc = rc2;                                       \
-    }                                                       \
-    return rc;                                              
-    
-/* THESE FUNCTIONS ARE PROTECTED AGAINST BAD "self" AND "path"
-   BY KConfigOpenNodeRead, BUT THE CONVERSION FUNCTIONS ARE NOT */
-LIB_EXPORT rc_t CC KConfigReadBool ( const KConfig* self, const char* path, bool* result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadBool);
-}    
-LIB_EXPORT rc_t CC KConfigReadI64 ( const KConfig* self, const char* path, int64_t* result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadI64);
-}
-LIB_EXPORT rc_t CC KConfigReadU64 ( const KConfig* self, const char* path, uint64_t* result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadU64);
-}
-LIB_EXPORT rc_t CC KConfigReadF64 ( const KConfig* self, const char* path, double* result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadF64);
-}
-#if 0
-LIB_EXPORT rc_t CC KConfigReadVPath ( const KConfig* self, const char* path, struct VPath** result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadVPath);
-}
-#endif
-LIB_EXPORT rc_t CC KConfigReadString ( const KConfig* self, const char* path, struct String** result )
-{
-    NODE_TO_CONFIG_ACCESSOR(KConfigNodeReadString);
-}
-
-#define DISP_RC(rc, msg) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, msg))
-#define DISP_RC2(rc, name, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt, rc, \
-        "$(name): $(msg)", "name=%s,msg=%s", name, msg)))
-
-static rc_t KConfigNodeReadData(const KConfigNode* self,
-    char* buf, size_t blen, size_t* num_read)
-{
-    rc_t rc = 0;
-    size_t remaining = 0;
-
-    assert(buf && blen && num_read);
-
-    rc = KConfigNodeRead(self, 0, buf, blen, num_read, &remaining);
-
-    assert(remaining == 0); /* TODO overflow check */
-    assert(*num_read <= blen);
-
-    return rc;
-}
-
-static rc_t printIndent(int indent) {
-    rc_t rc = 0;
-
-    int i = 0;
-    for (i = 0; i < indent * 2; ++i) {
-        rc_t rc2 = OUTMSG((" "));
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t KConfigNodePrint(const KConfigNode* self,
-    int indent, const char* root)
-{
-    rc_t rc = 0;
-    KNamelist* names = NULL;
-    uint32_t count = 0;
-    uint32_t i = 0;
-    char data[512] = "";
-    size_t num_data = 0;
-    assert(self);
-
-    printIndent(indent);
-    OUTMSG(("<%s>", root));
-
-    if (rc == 0) {
-        rc_t rc = KConfigNodeReadData(self, data, sizeof data, &num_data);
-        DISP_RC2(rc, "KConfigNodeReadData()", root);
-        if (rc == 0 && num_data > 0) {
-            OUTMSG(("%.*s", (int)num_data, data));
-        }
-    }
-
-    if (rc == 0) {
-        rc = KConfigNodeListChild(self, &names);
-        DISP_RC2(rc, "KConfigNodeListChild()", root);
-    }
-    if (rc == 0) {
-        rc = KNamelistCount(names, &count);
-        DISP_RC2(rc, "KNamelistCount()", root);
-    }
-
-
-    if (rc == 0) {
-        if (count > 0) {
-            OUTMSG(("\n"));
-        }
-        for (i = 0; i < count; ++i) {
-            const char* name = NULL;
-            const KConfigNode* node = NULL;
-            if (rc == 0) {
-                rc = KNamelistGet(names, i, &name);
-                DISP_RC2(rc, "KNamelistGet()", root);
-            }
-            if (rc == 0) {
-                rc = KConfigNodeOpenNodeRead(self, &node, name);
-                DISP_RC2(rc, "KConfigNodeOpenNodeRead()", name);
-            }
-            if (rc == 0) {
-                KConfigNodePrint(node, indent + 1, name);
-            }
-            KConfigNodeRelease(node);
-        }
-    }
-
-    if (count > 0) {
-        printIndent(indent);
-    }
-    OUTMSG(("</%s>\n", root));
-
-    KNamelistRelease(names);
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigPrint(const KConfig* self, int indent) {
-    rc_t rc = 0;
-
-    const char root[] = "Config";
-
-    if (self == NULL) {
-        OUTMSG(("<%s>", root));
-        OUTMSG(("KConfigPrint(const KConfig* self = NULL)\n"));
-        OUTMSG(("</%s>\n", root));
-    }
-    else {
-        const KConfigNode* node = NULL;
-        if (rc == 0) {
-            rc = KConfigOpenNodeRead(self, &node, "/");
-            DISP_RC2(rc, "KConfigOpenNodeRead()", "/");
-        }
-        if (rc == 0) {
-            KConfigNodePrint(node, indent, "Config");
-        }
-        KConfigNodeRelease(node);
-    }
-
-    return rc;
-}
-
-LIB_EXPORT void CC KConfigDisableUserSettings ( void )
-{
-    s_disable_user_settings = true;
-}
-
-static
-rc_t open_file ( const KFile **f, const char *path )
-{
-    /* get current directory */
-    KDirectory *wd;
-    rc_t rc = KDirectoryNativeDir ( & wd );
-    if ( rc == 0 )
-    {
-        rc = KDirectoryOpenFileRead ( wd, f, path );
-        KDirectoryRelease ( wd );
-    }
-
-    return rc;
-}
-
-static
-rc_t decode_file ( KDataBuffer *mem, const KFile *orig )
-{
-    char hdr [ 8 ];
-    size_t num_read;
-    rc_t rc = KFileReadAll ( orig, 0, hdr, sizeof hdr, & num_read );
-    if ( rc == 0 && num_read == sizeof hdr )
-    {
-        if ( memcmp ( hdr, "ncbi_gap", sizeof hdr ) == 0 )
-        {
-            uint64_t eof;
-            rc = KFileSize ( orig, & eof );
-            if ( rc == 0 )
-            {
-                const KFile *sub;
-                rc = KFileMakeSubRead ( & sub, orig, sizeof hdr,
-                    eof - sizeof hdr );
-                if ( rc == 0 )
-                {
-                    const KFile *gzip;
-                    rc = KFileMakeGzipForRead ( & gzip, sub );
-                    if ( rc == 0 )
-                    {
-                        rc = KDataBufferMakeBytes ( mem, 0 );
-                        if ( rc == 0 )
-                        {
-                            size_t total, to_read;
-
-                            /* after all of that, we're ready to decompress */
-                            for ( total = 0; ; )
-                            {
-                                char *buff;
-
-                                rc = KDataBufferResize ( mem,
-                                    total + 32 * 1024 );
-                                if ( rc != 0 )
-                                    break;
-
-                                buff = mem -> base;
-                                to_read = ( size_t ) mem -> elem_count - total;
-
-                                rc = KFileReadAll ( gzip, total,
-                                    & buff [ total ], to_read, & num_read );
-                                if ( rc != 0 )
-                                    break;
-
-                                total += num_read;
-                                
-                                if ( num_read < to_read )
-                                {
-                                    buff [ total ] = 0;
-                                    mem -> elem_count = total;
-                                    break;
-                                }
-                            }
-                        }
-
-                        KFileRelease ( gzip );
-                    }
-
-                    KFileRelease ( sub );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-typedef struct {
-    const char *projectId;
-    const char *encryptionKey;
-    const char *downloadTicket;
-    const char *description;
-} KGapConfig;
-
-static
-rc_t _KConfigNncToKGapConfig(const KConfig *self, char *text, KGapConfig *kgc)
-{
-    size_t len = 0;
-    int i = 0;
-
-    assert(self && text && kgc);
-
-    memset(kgc, 0, sizeof *kgc);
-    len = string_size(text);
-
-    {
-        const char version[] = "version ";
-        size_t l = sizeof version - 1;
-        if (string_cmp(version, l, text, len, l) != 0) {
-            return RC(rcKFG, rcMgr, rcUpdating, rcFormat, rcUnrecognized);
-        }
-        text += l;
-        len -= l;
-    }
-
-    {
-        const char version[] = "1.0";
-        size_t l = sizeof version - 1;
-        if (string_cmp(version, l, text, l, l) != 0) {
-            return RC(rcKFG, rcMgr, rcUpdating, rcFormat, rcUnsupported);
-        }
-        text += l;
-        len -= l;
-    }
-
-    while (len > 0 && (text[0] == '\r' || text[0] == '\n')) {
-        ++text;
-        --len;
-    }
-
-    for (i = 0; ; ++i) {
-        const char *p = NULL;
-        if (i == 0) {
-            p = strtok(text, "|");
-        }
-        else {
-            p = strtok (NULL, "|");
-        }
-        if (p == NULL) {
-            break;
-        }
-        switch (i) {
-            case 0:
-                kgc->projectId = p;
-                break;
-            case 1:
-                kgc->encryptionKey = p;
-                break;
-            case 2:
-                kgc->downloadTicket = p;
-                break;
-            case 3:
-                kgc->description = p;
-                break;
-        }
-    }
-
-    if (!kgc->projectId || !kgc->encryptionKey || !kgc->downloadTicket ||
-        !kgc->description)
-    {
-        return RC(rcKFG, rcMgr, rcUpdating, rcFile, rcInvalid);
-    }
-
-    return 0;
-}
-
-static rc_t _KConfigFixResolverCgiNode(KConfig *self) {
-    rc_t rc = 0;
-
-    KConfigNode *node = NULL;
-    struct String *result = NULL;
-
-    assert(self);
-
-    if (rc == 0) {
-        rc = KConfigOpenNodeUpdate(self, &node,
-            "/repository/remote/protected/CGI/resolver-cgi");
-    }
-
-    if (rc == 0) {
-        rc = KConfigNodeReadString(node, &result);
-    }
-
-    if (rc == 0) {
-        assert(result);
-        if (result->size == 0) {
-            const char buffer[]
-                = "http://www.ncbi.nlm.nih.gov/Traces/names/names.cgi";
-            rc = KConfigNodeWrite(node, buffer, sizeof buffer);
-        }
-    }
-
-    free(result);
-
-    KConfigNodeRelease(node);
-
-    return rc;
-}
-
-static rc_t _KConfigNodeUpdateChild(KConfigNode *self,
-    const char *name, const char *val)
-{
-    rc_t rc = 0;
-
-    KConfigNode *node = NULL;
-
-    assert(self && name && val);
-
-    if (rc == 0) {
-        rc = KConfigNodeOpenNodeUpdate(self, &node, name);
-    }
-
-    if (rc == 0) {
-        rc = KConfigNodeWrite(node, val, string_size(val));
-    }
-
-    {
-        rc_t rc2 = KConfigNodeRelease(node);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
-
-static rc_t _KConfigMkPwdFileAndNode(KConfig *self,
-    KConfigNode *rep, const KGapConfig *kgc)
-{
-    rc_t rc = 0;
-    const KConfigNode *ncbiHome = NULL;
-    KConfigNode *node = NULL;
-    struct String *result = NULL;
-    char encryptionKeyPath[PATH_MAX];
-    KDirectory *dir = NULL;
-    KFile *encryptionKeyFile = NULL;
-    size_t num_writ = 0;
-
-    assert(self && kgc && rep);
-
-    if (rc == 0) {
-        rc = KConfigOpenNodeRead(self, &ncbiHome, "NCBI_HOME");
-    }
-    if (rc == 0) {
-        rc = KConfigNodeReadString(ncbiHome, &result);
-    }
-    KConfigNodeRelease(ncbiHome);
-    ncbiHome = NULL;
-
-    if (rc == 0) {
-        size_t num_writ = 0;
-        assert(result && result->addr);
-        rc = string_printf(encryptionKeyPath, sizeof encryptionKeyPath,
-            &num_writ, "%s/dbGaP-%s.enc_key", result->addr, kgc->projectId);
-        if (rc == 0) {
-            assert(num_writ < sizeof encryptionKeyPath);
-        }
-    }
-    free(result);
-    result = NULL;
-
-    if (rc == 0) {
-        rc = KDirectoryNativeDir(&dir);
-    }
-
-    if (rc == 0) {
-        rc = KDirectoryCreateFile(dir, &encryptionKeyFile,
-            false, 0600, kcmInit | kcmParents, encryptionKeyPath);
-    }
-
-    KDirectoryRelease(dir);
-
-    if (rc == 0) {
-        assert(kgc->encryptionKey);
-        rc = KFileWrite(encryptionKeyFile, 0,
-            kgc->encryptionKey, string_size(kgc->encryptionKey), &num_writ);
-        if (rc == 0) {
-            assert(num_writ == string_size(kgc->encryptionKey));
-        }
-    }
-
-    if (rc == 0) {
-        rc = KFileWrite(encryptionKeyFile, string_size(kgc->encryptionKey),
-            "\n", 1, &num_writ);
-        if (rc == 0) {
-            assert(num_writ == 1);
-        }
-    }
-
-    {
-        rc_t rc2 = KFileRelease(encryptionKeyFile);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-    }
-
-    if (rc == 0) {
-        rc = _KConfigNodeUpdateChild(rep,
-            "encryption-key-path", encryptionKeyPath);
-    }
-
-    KConfigNodeRelease(node);
-
-    return rc;
-}
-
-static rc_t _mkNotFoundDir(const char *repoParentPath) {
-    rc_t rc = 0;
-
-    KPathType type = kptNotFound;
-
-    KDirectory *wd = NULL;
-    rc = KDirectoryNativeDir(&wd);
-
-    if (rc == 0) {
-        type = KDirectoryPathType(wd, repoParentPath);
-        if (type == kptNotFound) {
-            rc = KDirectoryCreateDir(wd,
-                0777, kcmCreate|kcmParents, repoParentPath);
-        }
-    }
-
-    KDirectoryRelease(wd);
-
-    return rc;
-}
-
-static rc_t _KConfigDBGapRepositoryNodes(KConfig *self,
-    KConfigNode *rep, const KGapConfig *kgc, const char *repoParentPath,
-    const char **newRepoParentPath)
-{
-    rc_t rc = 0;
-
-    assert(self && rep && kgc);
-
-    if (rc == 0) {
-        rc = _KConfigMkPwdFileAndNode(self, rep, kgc);
-    }
-
-    if (rc == 0) {
-        assert(kgc->downloadTicket);
-        rc = _KConfigNodeUpdateChild(rep,
-            "download-ticket", kgc->downloadTicket);
-    }
-
-    if (rc == 0) {
-        rc = _KConfigNodeUpdateChild(rep, "description", kgc->description);
-    }
-
-    if (rc == 0) {
-        rc = _KConfigNodeUpdateChild(rep, "apps/sra/volumes/sraFlat", "sra");
-    }
-
-    if (rc == 0) {
-        rc = _KConfigNodeUpdateChild(rep, "cache-enabled", "true");
-    }
-
-    if (rc == 0) {
-        static char rootPath[PATH_MAX] = "";
-        if (repoParentPath == NULL) {
-            size_t num_writ = 0;
-            const KConfigNode *home = NULL;
-            String *result = NULL;
-
-            if (rc == 0) {
-                rc = KConfigOpenNodeRead(self, &home, "HOME");
-            }
-
-            if (rc == 0) {
-                rc = KConfigNodeReadString(home, &result);
-            }
-
-            if (rc == 0) {
-                assert(result && result->addr);
-                rc = string_printf(rootPath, sizeof rootPath, &num_writ,
-                    "%s/ncbi/dbGaP-%s", result->addr, kgc->projectId);
-            }
-
-            if (rc == 0) {
-                repoParentPath = rootPath;
-            }
-
-            free(result);
-            KConfigNodeRelease(home);
-        }
-
-        if (rc == 0) {
-            rc = _KConfigNodeUpdateChild(rep, "root", repoParentPath);
-        }
-        if (rc == 0) {
-            rc = _mkNotFoundDir(repoParentPath);
-        }
-        if (rc == 0 && newRepoParentPath != NULL) {
-            *newRepoParentPath = repoParentPath;
-        }
-    }
-
-    return rc;
-}
-
-static rc_t _KConfigAddDBGapRepository(KConfig *self,
-    const KGapConfig *kgc, const char *repoParentPath,
-    const char **newRepoParentPath)
-{
-    rc_t rc = 0;
-
-    KConfigNode *rep = NULL;
-
-    char repNodeName[512] = "";
-
-    assert(self && kgc);
-
-    if (rc == 0) {
-        size_t num_writ = 0;
-        rc = string_printf(repNodeName, sizeof repNodeName, &num_writ,
-            "/repository/user/protected/dbGaP-%s", kgc->projectId);
-        if (rc == 0) {
-            assert(num_writ < sizeof repNodeName);
-        }
-    }
-
-    if (rc == 0) {
-        rc = KConfigOpenNodeUpdate(self, &rep, repNodeName);
-    }
-
-    if (rc == 0) {
-        rc = _KConfigDBGapRepositoryNodes(self, rep, kgc, repoParentPath,
-            newRepoParentPath);
-    }
-
-    KConfigNodeRelease(rep);
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigImportNgc(KConfig *self,
-    const char *ngcPath, const char *repoParentPath,
-    const char **newRepoParentPath)
-{
-    if (self == NULL) {
-        return RC(rcKFG, rcMgr, rcUpdating, rcSelf, rcNull);
-    }
-
-    if (ngcPath == NULL) {
-        return RC(rcKFG, rcMgr, rcUpdating, rcParam, rcNull);
-    }
-    else {
-        const KFile *orig = NULL;
-        rc_t rc = open_file ( & orig, ngcPath );
-        if (rc != 0) {
-            return rc;
-        }
-        else {
-            KGapConfig kgc;
-
-            KDataBuffer mem;
-            memset ( & mem, 0, sizeof mem );
-
-            rc = decode_file ( & mem, orig );
-            KFileRelease ( orig );
-            orig = NULL;
-
-            if (rc == 0) {
-                rc = _KConfigNncToKGapConfig(self, mem.base, &kgc);
-            }
-
-            if (rc == 0) {
-                rc = _KConfigFixResolverCgiNode(self);
-            }
-
-            if (rc == 0) {
-                rc = _KConfigAddDBGapRepository(self, &kgc, repoParentPath,
-                    newRepoParentPath);
-            }
-
-            KDataBufferWhack ( & mem );
-        }
-
-        return rc;
-    }
-}
diff --git a/libs/kfg/default.kfg b/libs/kfg/default.kfg
deleted file mode 100644
index 14f8ac9..0000000
--- a/libs/kfg/default.kfg
+++ /dev/null
@@ -1,45 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-## DEFAULT CONFIGURATION FOR SRA-TOOLKIT
-# 
-#  These settings are intended to allow the tools to work under conditions
-#  when the user has not yet performed any configuration.
-/config/default = "true"
-
-# The user's default public repository
-/repository/user/main/public/apps/refseq/volumes/refseq = "refseq"
-/repository/user/main/public/apps/sra/volumes/sraFlat = "sra"
-/repository/user/main/public/apps/wgs/volumes/wgsFlat = "wgs"
-/repository/user/main/public/cache-enabled = "true"
-/repository/user/main/public/root = "$(HOME)/ncbi/public"
-
-# Remote access to NCBI's public repository
-/repository/remote/main/NCBI/apps/refseq/volumes/refseq = "refseq"
-/repository/remote/main/NCBI/apps/sra/volumes/fuse1000 = "sra-instant/reads/ByRun/sra"
-/repository/remote/main/NCBI/apps/wgs/volumes/fuseWGS = "wgs"
-/repository/remote/main/NCBI/root = "http://ftp-trace.ncbi.nlm.nih.gov/sra"
-
-# Remote access to NCBI's protected repository
-/repository/remote/protected/CGI/resolver-cgi = "http://www.ncbi.nlm.nih.gov/Traces/names/names.cgi"
diff --git a/libs/kfg/kart.c b/libs/kfg/kart.c
deleted file mode 100644
index 976570c..0000000
--- a/libs/kfg/kart.c
+++ /dev/null
@@ -1,608 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <kfg/kart.h>
-
-#include <kfs/directory.h> /* KDirectoryOpenFileRead */
-#include <kfs/file.h> /* KFile */
-#include <kfs/gzip.h> /* KFileMakeGzipForRead */
-#include <kfs/subfile.h> /* KFileMakeSubRead */
-
-#include <klib/data-buffer.h> /* KDataBuffer */
-#include <klib/rc.h>
-#include <klib/refcount.h> /* KRefcount */
-#include <klib/out.h> /* OUTMSG */
-
-#include <strtol.h> /* strtou64 */
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h> /* free */
-#include <string.h> /* memcmp */
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-struct KartItem {
-    KRefcount refcount;
-
-    const Kart *dad;
-
-/*  String typeId; */
-    String projId;
-    String itemId;
-    String accession;
-    String name;
-    String itemDesc;
-};
-
-static void KartItemWhack(KartItem *self) {
-    assert(self);
-
-    KartRelease(self->dad);
-
-    memset(self, 0, sizeof *self);
-
-    free(self);
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KartItemAddRef(const KartItem *self) {
-    if (self != NULL) {
-        switch (KRefcountAdd(&self->refcount, "KartItem")) {
-            case krefLimit:
-                return RC(rcKFG, rcFile, rcAttaching, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KartItemRelease(const KartItem *self) {
-    if (self != NULL) {
-        switch (KRefcountDrop(&self -> refcount, "KartItem")) {
-            case krefWhack:
-                KartItemWhack((KartItem*)self);
-                break;
-            case krefLimit:
-                return RC(rcKFG, rcFile, rcReleasing, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-static rc_t StringAsUint64(const String *self, uint64_t *pid) {
-    uint64_t id = 0;
-
-    char buffer[21] = "";
-    size_t bytes = 0;
-    char *end = NULL;
-
-    assert(self);
-
-    if (pid == NULL) {
-        return RC(rcKFG, rcFile, rcAccessing, rcParam, rcNull);
-    }
-
-    *pid = 0;
-
-    if (sizeof buffer - 1 < self->len) {
-        return RC(rcKFG, rcFile, rcAccessing, rcBuffer, rcInsufficient);
-    }
-
-    bytes = string_copy(buffer, sizeof buffer, self->addr, self->len);
-    if (bytes != self->len) {
-        return RC(rcKFG, rcFile, rcAccessing, rcBuffer, rcInsufficient);
-    }
-
-    id = strtou64(buffer, &end, 0);
-    if (end[0] != 0) {
-        return RC(rcKFG, rcFile, rcAccessing, rcParam, rcInvalid);
-    }
-
-    *pid = id;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KartItemProjIdNumber(const KartItem *self, uint64_t *pid) {
-    if (self == NULL) {
-        return RC(rcKFG, rcFile, rcAccessing, rcSelf, rcNull);
-    }
-    return StringAsUint64(&self->projId, pid);
-}
-
-LIB_EXPORT rc_t CC KartItemItemIdNumber(const KartItem *self, uint64_t *pid) {
-    if (self == NULL) {
-        return RC(rcKFG, rcFile, rcAccessing, rcSelf, rcNull);
-    }
-    return StringAsUint64(&self->itemId, pid);
-}
-
-static rc_t KartItemCheck(const KartItem *self, const String **elem) {
-    if (elem == NULL) {
-        return RC(rcKFG, rcFile, rcAccessing, rcParam, rcNull);
-    }
-
-    *elem = NULL;
-
-    if (self == NULL) {
-        return RC(rcKFG, rcFile, rcAccessing, rcSelf, rcNull);
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KartItemProjId(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->projId;
-    }
-    return rc;
-}
-LIB_EXPORT rc_t CC KartItemItemId(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->itemId;
-    }
-    return rc;
-}
-LIB_EXPORT rc_t CC KartItemAccession(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->accession;
-    }
-    return rc;
-}
-LIB_EXPORT rc_t CC KartItemName(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->name;
-    }
-    return rc;
-}
-LIB_EXPORT rc_t CC KartItemItemDesc(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->itemDesc;
-    }
-    return rc;
-}
-/*LIB_EXPORT rc_t CC KartItemTypeId(const KartItem *self, const String **elem)
-{
-    rc_t rc = KartItemCheck(self, elem);
-    if (rc == 0) {
-        *elem = &self->typeId;
-    }
-    return rc;
-}*/
-
-/** Print KartItem using OUTMSG; if (self == NULL) then print the header */
-LIB_EXPORT rc_t CC KartItemPrint(const KartItem *self) { /* AA-833 */
-    if (self != NULL) {
-        return OUTMSG(("'%S'\t'%S'\t'%S'\t'%S'\t'%S'\n", &self->projId,
-            &self->itemId, &self->accession, &self->name, &self->itemDesc));
-    }
-    return 0;
-}
-
-struct Kart {
-    KRefcount refcount;
-
-    KDataBuffer mem;
-
-    const char *text;
-    uint64_t len;
-};
-
-static void KartWhack(Kart *self) {
-    assert(self);
-
-    KDataBufferWhack(&self->mem);
-
-    memset(self, 0, sizeof *self);
-
-    free(self);
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC KartAddRef(const Kart *self) {
-    if (self != NULL) {
-        switch (KRefcountAdd(&self->refcount, "Kart")) {
-            case krefLimit:
-                return RC(rcKFG, rcFile, rcAttaching, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KartRelease(const Kart *self) {
-    if (self != NULL) {
-        switch (KRefcountDrop(&self -> refcount, "Kart")) {
-            case krefWhack:
-                KartWhack((Kart*)self);
-                break;
-            case krefLimit:
-                return RC(rcKFG, rcFile, rcReleasing, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-static rc_t KartItemInitFromKartRow(const Kart *self, const KartItem **item,
-    const char *line, size_t len)
-{
-    rc_t rc = 0;
-    int i = 0;
-    KartItem *obj = NULL;
-    assert(self && item && line && len);
-    obj = calloc(1, sizeof *obj);
-    if (obj == NULL) {
-        return RC(rcKFG, rcData, rcAllocating, rcMemory, rcExhausted);
-    }
-    for (i = 0; ; ++i) {
-        size_t l = 0;
-        String *next = NULL;
-        const char *p = string_chr(line, len, '|');
-        if (p == NULL) {
-            if (i != 4) {
-                return RC(rcKFG, rcFile, rcParsing, rcFile, rcInsufficient);
-            }
-            l = len;
-        }
-        else {
-            l = p - line;
-        }
-        switch (i) { /* AA-833 */
-            case 0:
-                next = &obj->projId;
-                break;
-            case 1:
-                next = &obj->itemId;
-                break;
-            case 2:
-                next = &obj->accession;
-                break;
-            case 3:
-                next = &obj->name;
-                break;
-            case 4:
-                next = &obj->itemDesc;
-                break;
-            default:
-                return RC(rcKFG, rcFile, rcParsing, rcFile, rcExcessive);
-                break;
-        }
-        assert(next);
-        StringInit(next, line, l, l);
-        if (l > len) {
-            return RC(rcKFG, rcFile, rcParsing, rcFile, rcInvalid);
-        }
-        if (len == l) {
-            break;
-        }
-        ++l;
-        line += l;
-        len -= l;
-    }
-    rc = KartAddRef(self);
-    if (rc == 0) {
-        obj->dad = self;
-        *item = obj;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KartPrint(const Kart *self) {
-    uint32_t len = self->mem.elem_count;
-    if (self == NULL) {
-        return RC(rcKFG, rcFile, rcLoading, rcSelf, rcNull);
-    }
-    return OUTMSG(("%.*s", len, self->mem.base));
-}
-
-LIB_EXPORT rc_t CC KartMakeNextItem(Kart *self, const KartItem **item) {
-    size_t len = 0;
-    const char *line = NULL;
-    const char *next = NULL;
-
-    if (item == NULL) {
-        return RC(rcKFG, rcFile, rcLoading, rcParam, rcNull);
-    }
-    *item = NULL;
-    if (self == NULL) {
-        return RC(rcKFG, rcFile, rcLoading, rcSelf, rcNull);
-    }
-
-    while (self->len > 0
-        && (self->text[0] == '\r' || self->text[0] == '\n'))
-    {
-        ++self->text;
-        --self->len;
-    }
-
-    line = self->text;
-    next = string_chr(self->text, self->len, '\n');
-    if (next == NULL) {
-        return RC(rcKFG, rcFile, rcLoading, rcFile, rcInsufficient);
-    }
-
-    len = next - self->text;
-    if (*(next - 1) == '\r') {
-        --len;
-    }
-
-    if (self->len >= next - self->text + 1) {
-        self->len -= next - self->text + 1;
-    }
-    else {
-        OUTMSG(("WARNING: STRING OVERFLOW DURING KART ROW PARSING"));
-        self->len = 0;
-    }
-
-    self->text = next + 1;
-
-    {
-        const char end[] = "$end";
-        if (string_cmp(line, string_size(line), end,
-            sizeof end - 1, sizeof end - 1) == 0)
-        {
-            return 0;
-        }
-    }
-
-    return KartItemInitFromKartRow(self, item, line, len);
-}
-
-static rc_t decode_kart(KDataBuffer *mem, const KFile *orig, size_t hdr_sz) {
-    rc_t rc = 0;
-    size_t num_read;
-    uint64_t eof;
-    assert(mem && orig && hdr_sz);
-    rc = KFileSize ( orig, & eof );
-    if ( rc == 0 )
-    {
-        const KFile *sub;
-        rc = KFileMakeSubRead(&sub, orig, hdr_sz, eof - hdr_sz);
-        if ( rc == 0 )
-        {
-            const KFile *gzip;
-            rc = KFileMakeGzipForRead ( & gzip, sub );
-            if ( rc == 0 )
-            {
-                rc = KDataBufferMakeBytes ( mem, 0 );
-                if ( rc == 0 )
-                {
-                    size_t total, to_read;
-
-                    /* after all of that, we're ready to decompress */
-                    for ( total = 0; ; )
-                    {
-                        char *buff;
-
-                        rc = KDataBufferResize ( mem,
-                            total + 32 * 1024 );
-                        if ( rc != 0 )
-                            break;
-
-                        buff = mem -> base;
-                        to_read = ( size_t ) mem -> elem_count - total;
-
-                        rc = KFileReadAll ( gzip, total,
-                            & buff [ total ], to_read, & num_read );
-                        if ( rc != 0 )
-                            break;
-
-                        total += num_read;
-                        
-                        if ( num_read < to_read )
-                        {
-                            buff [ total ] = 0;
-                            mem -> elem_count = total;
-                            break;
-                        }
-                    }
-                }
-
-                KFileRelease ( gzip );
-            }
-
-            KFileRelease ( sub );
-        }
-    }
-
-    return rc;
-}
-
-static rc_t KartProcessHeader(Kart *self) {
-    assert(self);
-
-    self->text = self->mem.base;
-    self->len = self->mem.elem_count;
-
-    {
-        const char version[] = "version ";
-        size_t l = sizeof version - 1;
-        if (string_cmp(version, l, self->text, self->len, l) != 0) {
-            return RC(rcKFG, rcMgr, rcUpdating, rcFormat, rcUnrecognized);
-        }
-
-        self->text += l;
-        self->len -= l;
-    }
-
-    {
-        const char version[] = "1.0";
-        size_t l = sizeof version - 1;
-        if (string_cmp(version, l, self->text, l, l) != 0) {
-            return RC(rcKFG, rcMgr, rcUpdating, rcFormat, rcUnsupported);
-        }
-
-        self->text += l;
-        self->len -= l;
-    }
-
-    while (self->len > 0 && (self->text[0] == '\r' || self->text[0] == '\n')) {
-        ++self->text;
-        --self->len;
-    }
-
-    return 0;
-}
-
-#ifdef _DEBUGGING
-static rc_t read_textkart(KDataBuffer *mem, const KFile *orig) {
-    rc_t rc = 0;
-    size_t num_read;
-    uint64_t eof;
-    assert(mem && orig);
-    rc = KFileSize ( orig, & eof );
-    if ( rc == 0 )
-    {
-        rc = KDataBufferMakeBytes ( mem, 0 );
-        if ( rc == 0 ) {
-            /* after all of that, we're ready to read */
-            rc = KDataBufferResize(mem, eof);
-            if ( rc != 0 )
-                return rc;
-            rc = KFileReadAll ( orig, 0, mem -> base, eof, & num_read );
-            if ( rc != 0 )
-                return rc;
-        }
-    }
-    return rc;
-}
-KFG_EXTERN rc_t CC KartMakeText(const struct KDirectory *dir, const char *path,
-    Kart **kart, bool *isKart)
-{
-    rc_t rc = 0;
-    const KFile *f = NULL;
-
-    if (dir == NULL || path == NULL || kart == NULL || isKart == NULL) {
-        return RC(rcKFG, rcFile, rcReading, rcParam, rcNull);
-    }
-
-    *isKart = false;
-    *kart = NULL;
-
-    rc = KDirectoryOpenFileRead(dir, &f, path);
-    if (rc != 0) {
-        return rc;
-    }
-
-    {
-        Kart *obj = NULL;
-
-        *isKart = true;
-
-        obj = calloc(1, sizeof *obj);
-        if (obj == NULL) {
-            return RC(rcKFG, rcData, rcAllocating, rcMemory, rcExhausted);
-        }
-
-        rc = read_textkart(&obj->mem, f);
-        if (rc == 0) {
-            rc = KartProcessHeader(obj);
-        }
-        if (rc == 0) {
-            KRefcountInit(&obj->refcount, 0, "Kart", "MakeText", "kart");
-            *kart = obj;
-        }
-        else {
-            KartWhack(obj);
-        }
-    }
-
-    RELEASE(KFile, f);
-    return rc;
-}
-#endif
-
-LIB_EXPORT rc_t KartMake(const KDirectory *dir, const char *path,
-    Kart **kart, bool *isKart)
-{
-    rc_t rc = 0;
-    const KFile *f = NULL;
-    char hdr[8] = "";
-    size_t num_read = 0;
-
-    if (dir == NULL || path == NULL || kart == NULL || isKart == NULL) {
-        return RC(rcKFG, rcFile, rcReading, rcParam, rcNull);
-    }
-
-    *isKart = false;
-    *kart = NULL;
-
-    rc = KDirectoryOpenFileRead(dir, &f, path);
-    if (rc != 0) {
-        return rc;
-    }
-
-    rc = KFileReadAll(f, 0, hdr, sizeof hdr, &num_read);
-    if (rc == 0 && num_read == sizeof hdr &&
-        memcmp(hdr, "ncbikart", sizeof hdr) == 0)
-    {
-        Kart *obj = NULL;
-
-        *isKart = true;
-
-        obj = calloc(1, sizeof *obj);
-        if (obj == NULL) {
-            return RC(rcKFG, rcData, rcAllocating, rcMemory, rcExhausted);
-        }
-
-        rc = decode_kart(&obj->mem, f, sizeof hdr);
-        if (rc == 0) {
-            rc = KartProcessHeader(obj);
-        }
-        if (rc == 0) {
-            KRefcountInit(&obj->refcount, 0, "Kart", "Make", "kart");
-            *kart = obj;
-        }
-        else {
-            KartWhack(obj);
-        }
-    }
-
-    RELEASE(KFile, f);
-    return rc;
-}
diff --git a/libs/kfg/keystore.c b/libs/kfg/keystore.c
deleted file mode 100644
index abf2384..0000000
--- a/libs/kfg/keystore.c
+++ /dev/null
@@ -1,836 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfg/extern.h>
-
-#include <kfg/keystore-priv.h>
-
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-
-#include <kfg/config.h>
-#include <kfg/repository.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/lockfile.h>
-#include <kfs/nullfile.h>
-
-#include <strtol.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define PASSWORD_MAX_SIZE 4096
-#define KFG_KRYPTO_PWFILE   "krypto/pwfile"
-#define MAX_PATH_SIZE 4096
-
-static char defaultBindingsFile[MAX_PATH_SIZE];
-
-static rc_t KEncryptionKeyMakeFromFile(const char* path, KEncryptionKey** self);
-
-/* 
- * Non-keyring implementation, using a combination of location-based and global keys
- */
-
-struct KKeyStore
-{
-    KKeyStore_vt vt;
-    KRefcount refcount;
-    
-    KEncryptionKey* temp_key; /* temp key provided by the client code*/
-    
-    const KConfig* kfg;
-    char* bindingsFile;
-};
-
-static rc_t KKeyStoreWhack(KKeyStore* self);
-
-static KKeyStore_vt_v1 v1 = {
-    1, 0,
-    KKeyStoreWhack,
-    KKeyStoreGetKey
-};
-
-rc_t KKeyStoreWhack(KKeyStore* self)
-{
-    rc_t rc = KConfigRelease(self->kfg);
-    rc_t rc2 = KEncryptionKeyRelease(self->temp_key);
-    if (rc == 0)
-        rc = rc2;
-    if (self->bindingsFile != defaultBindingsFile)
-        free(self->bindingsFile);
-    free(self);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreMake(KKeyStore** self, KConfig* kfg)
-{
-    rc_t rc = 0;
-    KKeyStore* ret;
-    
-    if ( self == NULL )
-        return RC ( rcKFG, rcStorage, rcCreating, rcSelf, rcNull );
-
-    *self = NULL;
-    
-    ret = malloc(sizeof(*ret));
-    if (ret == NULL)
-        return RC ( rcKFG, rcStorage, rcCreating, rcMemory, rcExhausted );
-    
-    ret -> vt . v1 =  &v1;
-    
-    KRefcountInit ( & ret -> refcount, 1, "KKeyStore", "init", "" );
-    
-    ret->temp_key = NULL;
-    ret->bindingsFile = NULL;
-    ret->kfg = kfg;
-    if (kfg != NULL)
-    {
-        rc = KConfigAddRef(kfg);
-        if (rc == 0)
-            ret->kfg = kfg;
-    }
-    else
-        ret->kfg = NULL;
-    
-    if (rc == 0)
-        *self = ret;
-    else
-        KKeyStoreWhack(ret);
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreAddRef ( const KKeyStore *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KKeyStore" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcStorage, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreRelease ( const KKeyStore *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KKeyStore" ) )
-        {
-        case krefWhack:
-            self -> vt . v1 -> destroy ( ( KKeyStore* ) self );
-        break;
-        case krefLimit:
-            return RC ( rcKFG, rcStorage, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/*
- * the result is always 0-terminated
- */
-static
-rc_t ReadEncKey(const KFile* file, char* buf, size_t bufsize)
-{
-    /* at this point we are only getting the password from a 
-     * file but in the future if we can get it from a pipe of
-     * some sort we can't count on the ReadAll to really know
-     * if we hit end of file and not just a pause in the
-     * streaming.  VDB 3 / VFS/KFS 2 will have to fix this somehow
-     */
-    size_t readNum;
-    rc_t rc = KFileReadAll (file, 0, buf, bufsize - 1, &readNum);
-
-    if (rc == 0)
-    {
-        /* -----
-         * trim back the contents of the file to
-         * a single ASCII/UTF-8 text line
-         * We actually only check for the two normal
-         * end of line characters so it could have other
-         * control characters...
-         */
-        char* pc = string_chr (buf, readNum, '\r');
-        if (pc == NULL)
-            pc = string_chr (buf, readNum, '\n');
-
-        if (pc != NULL)
-            *pc = 0;
-        else
-            buf[readNum]=0;
-            
-        if (string_measure(buf, NULL) == 0)
-            rc = RC (rcKFG, rcEncryptionKey, rcRetrieving, rcSize, rcTooShort);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreSetTemporaryKeyFromFile(KKeyStore* self, const struct KFile* file)
-{
-    rc_t rc;
-    char key[PASSWORD_MAX_SIZE + 1];
-    
-    if ( self == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcRetrieving, rcSelf, rcNull );
-        
-    if ( file == NULL )
-    {
-        rc = KEncryptionKeyRelease(self->temp_key);
-        self->temp_key = NULL;
-    }
-    else
-    {    
-        rc = ReadEncKey(file, key, PASSWORD_MAX_SIZE);
-        if (rc == 0)
-        {
-            rc = KEncryptionKeyRelease(self->temp_key);
-            if ( rc == 0)
-                rc = KEncryptionKeyMake(key, &self->temp_key);
-            memset(key, 0, PASSWORD_MAX_SIZE); /* is this enough security? */
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreGetKey(const KKeyStore* self, const char* obj_key, KEncryptionKey** enc_key)
-{
-    rc_t rc = 0;
-    
-    if ( self == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcRetrieving, rcSelf, rcNull );
-    if ( enc_key == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcRetrieving, rcParam, rcNull );
-    
-    if (self->temp_key != NULL)
-    {
-        rc = KEncryptionKeyAddRef(self->temp_key);
-        if (rc == 0)
-            *enc_key = self->temp_key;
-    }
-    else
-    {
-        const char * env = getenv (ENV_KRYPTO_PWFILE);
-        if (env != NULL)
-            rc = KEncryptionKeyMakeFromFile(env, enc_key);
-        else 
-        {   /* try protected repository */
-            if ( self -> kfg == NULL )
-                rc = KConfigMake( (KConfig**) &(self -> kfg), NULL );
-            if ( rc == 0 )
-            {
-                rc_t rc2;
-                const KRepositoryMgr *rmgr;
-                rc = KConfigMakeRepositoryMgrRead ( self -> kfg, & rmgr );
-                if ( rc == 0 )
-                {
-                    const KRepository *protected;
-                    rc = KRepositoryMgrCurrentProtectedRepository ( rmgr, & protected );
-                    if ( rc == 0 )
-                    {   /* in a protected area */
-                        char path [ MAX_PATH_SIZE ];
-                        rc = KRepositoryEncryptionKeyFile ( protected, path, sizeof(path), NULL );
-                        if ( rc == 0 && path [ 0 ] != 0 )
-                            rc = KEncryptionKeyMakeFromFile(path, enc_key);
-                            
-                        rc2 = KRepositoryRelease ( protected );
-                        if (rc == 0)
-                            rc = rc2;
-                    }
-                    else /* use global password file */
-                    {
-                        String* path;
-                        rc = KConfigReadString ( self -> kfg, KFG_KRYPTO_PWFILE, &path );        
-                        if (rc == 0)
-                        {
-                            rc = KEncryptionKeyMakeFromFile(path->addr, enc_key);
-                            StringWhack(path);
-                        }
-                        else 
-                            rc = RC(rcKFG, rcEncryptionKey, rcRetrieving, rcItem, rcNotFound); 
-                    }
-                    rc2 = KRepositoryMgrRelease ( rmgr );
-                    if (rc == 0)
-                        rc = rc2;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreSetConfig(struct KKeyStore* self, const struct KConfig* kfg)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcRetrieving, rcSelf, rcNull );
-        
-    if ( kfg != NULL )
-        rc = KConfigAddRef(kfg);
-        
-    if ( rc == 0 )
-    {
-        if ( self->kfg != NULL )
-            KConfigRelease(self->kfg);
-        self->kfg = kfg;
-    }
-        
-    return rc;
-}
-
-/* 
- * KEncryptionKey
- */
-
-LIB_EXPORT rc_t CC KEncryptionKeyAddRef ( KEncryptionKey *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KEncryptionKey" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcEncryptionKey, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KEncryptionKeyRelease ( KEncryptionKey *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KEncryptionKey" ) )
-        {
-        case krefWhack:
-            free((char*)self->value.addr); /*TODO: unlock memory? */
-            free(self);
-            break;
-        case krefLimit:
-            return RC ( rcKFG, rcEncryptionKey, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-static rc_t KEncryptionKeyMakeInt(const char* value, KEncryptionKey** self)
-{
-    KEncryptionKey* ret;
-    
-    *self = NULL;
-    
-    ret = malloc(sizeof(KEncryptionKey));
-    if (ret == NULL)
-        return RC ( rcKFG, rcEncryptionKey, rcCreating, rcMemory, rcExhausted );
-    else
-    {
-        size_t size = string_measure(value, NULL);
-        char* data = malloc(size+1);/*TODO: place in protected memory*/
-        if (data == NULL)
-        {
-            free(ret);
-            return RC ( rcKFG, rcEncryptionKey, rcCreating, rcMemory, rcExhausted );
-        }
-
-        string_copy(data, size + 1, value, size);    
-        StringInit( & ret -> value, data, size, size ); /* do not include the 0-terminator */
-        
-        KRefcountInit ( & ret -> refcount, 1, "KEncryptionKey", "init", "" );
-        
-        *self = ret;
-        return 0;
-    }
-}
-
-LIB_EXPORT rc_t CC KEncryptionKeyMake(const char* value, KEncryptionKey** self)
-{
-    if ( value == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcCreating, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcCreating, rcSelf, rcNull );
-
-    return KEncryptionKeyMakeInt(value, self);
-}
-
-static rc_t KEncryptionKeyMakeFromFile(const char* path, KEncryptionKey** self)
-{
-    rc_t rc;
-    KDirectory* wd;
-    
-    if ( path == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcCreating, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcKFG, rcEncryptionKey, rcCreating, rcSelf, rcNull );
-    
-    rc = KDirectoryNativeDir(&wd);
-    if (rc == 0)
-    {
-        rc_t rc2;
-        const KFile* file;
-        const char dev_stdin [] = "/dev/stdin";
-        const char dev_null [] = "/dev/null";        
-        
-        if (strcmp (dev_stdin, path) == 0)
-            rc = KFileMakeStdIn (&file);
-        else if (strcmp (dev_null, path) == 0)
-            rc = KFileMakeNullRead (&file);
-        else 
-            rc = KDirectoryOpenFileRead(wd, &file, path);
-        if (rc == 0)
-        {
-            char key[PASSWORD_MAX_SIZE + 1];
-            rc = ReadEncKey(file, key, PASSWORD_MAX_SIZE);
-            if (rc == 0)
-                rc = KEncryptionKeyMakeInt(key, self);
-                
-            rc2 = KFileRelease(file);
-            if (rc == 0)
-                rc = rc2;
-        }
-        rc2 = KDirectoryRelease(wd);
-        if (rc == 0)
-            rc = rc2;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreSetBindingsFile(struct KKeyStore* self, const char* path)
-{
-    if ( self == NULL )
-        return RC ( rcKFG, rcStorage, rcInitializing, rcSelf, rcNull );
-        
-    if (self->bindingsFile != defaultBindingsFile)
-        free(self->bindingsFile);
-    if (path == NULL)
-        self->bindingsFile = NULL;
-    else
-    {
-        self->bindingsFile = string_dup(path, string_size(path));
-        if (self->bindingsFile == NULL)
-            return RC ( rcKFG, rcStorage, rcInitializing, rcMemory, rcExhausted );
-    }
-    return 0;
-}
-
-LIB_EXPORT const char* KKeyStoreGetBindingsFile(const struct KKeyStore* self)
-{
-    if ( self == NULL )
-        return NULL;
-        
-    return self->bindingsFile;
-}
-
-
-#define MAX_OBJID_SIZE 20
-#define MAX_NAME_SIZE 4096
-
-static rc_t LocateObjectId(const KFile* file, const char* key, char* value, size_t value_size, size_t* value_read)
-{
-    char buf[MAX_OBJID_SIZE + 1 + MAX_NAME_SIZE + 1];
-    size_t num_read;
-    uint64_t pos = 0;
-    size_t key_size = string_size(key);
-    bool eof = false;
-    do
-    {
-        rc_t rc = KFileReadAll(file, pos, buf, sizeof(buf), &num_read);
-        if (rc != 0)
-            return rc;
-        else
-        {
-            size_t start;
-            if (num_read == sizeof(buf))
-            {   /* locate the last incomplete line and ignore it; will be considered after the next read() */
-                while (num_read > 0)
-                {
-                    --num_read;
-                    if (buf[num_read] == '\r' || buf[num_read] == '\n')
-                        break;
-                }
-                if (num_read == 0)
-                    return RC ( rcVFS, rcMgr, rcReading, rcRow, rcTooLong);
-            }
-            else
-                eof = true;
-            
-            start = 0;
-            while (start + key_size < num_read)
-            {   
-                /* find the beginning of a line */
-                while (buf[start] == '\r' || buf[start] == '\n') 
-                {
-                    ++start;
-                    if (start >= num_read)
-                        break;
-                }
-                /* check the key */
-                if (string_cmp(key, key_size, buf + start, key_size, num_read - start) == 0)
-                {
-                    if (buf [ start + key_size ] == '=')
-                    {
-                        int32_t i = 0;
-                        size_t sourceIdx = start + key_size + 1; /* 1st character after '=' */
-                        while (sourceIdx < num_read)
-                        {
-                            if (i >= value_size)
-                                return RC ( rcVFS, rcMgr, rcReading, rcName, rcTooLong);
-                                
-                            if (buf[sourceIdx] == '\r' || buf[sourceIdx] == '\n') 
-                                break;
-                                
-                            value[i] = buf[sourceIdx];
-                            
-                            ++i;
-                            ++sourceIdx;
-                        }
-                        *value_read = i;
-                        return 0;
-                    }
-                }
-                
-                /* skip until the next end of line */
-                while (buf[start] != '\r' && buf[start] != '\n') 
-                {
-                    ++start;
-                    if (start >= num_read)
-                        break;
-                }
-            }
-            
-            pos += num_read;
-        }
-    }
-    while (!eof);
-    
-    return RC ( rcVFS, rcMgr, rcReading, rcId, rcNotFound );
-}
-
-/*
- * Reverse lookup
- */
-static rc_t LocateObject(const KFile* file, const char* value, const size_t value_size, char* key, size_t key_size, size_t* key_read)
-{
-    char buf[MAX_OBJID_SIZE + 1 + MAX_NAME_SIZE + 1];
-    size_t num_read;
-    uint64_t pos = 0;
-    bool eof = false;
-    do
-    {
-        rc_t rc = KFileReadAll(file, pos, buf, sizeof(buf), &num_read);
-        if (rc != 0)
-            return rc;
-        else
-        {
-            size_t start;
-            if (num_read == sizeof(buf))
-            {   /* locate the last incomplete line and ignore it; will be considered after the next read() */
-                while (num_read > 0)
-                {
-                    --num_read;
-                    if (buf[num_read] == '\r' || buf[num_read] == '\n')
-                        break;
-                }
-                if (num_read == 0)
-                    return RC ( rcVFS, rcMgr, rcReading, rcRow, rcTooLong);
-            }
-            else
-                eof = true;
-            
-            start = 0; 
-            while (start + value_size < num_read)
-            {   
-                size_t key_start, key_end;
-                size_t value_start;
-                
-                /* find the beginning of a line */
-                while (buf[start] == '\r' || buf[start] == '\n') 
-                {
-                    ++start;
-                    if (start >= num_read)
-                        break;
-                }
-                if (start >= num_read)
-                    continue;
-                    
-                key_start = start;
-                
-                /* find the separator */
-                while (buf[start] != '=') 
-                {
-                    if (buf[start] == '\r' || buf[start] == '\n') /* separator not found, ignore the line*/
-                        break;
-                        
-                    ++start;
-                    if (start >= num_read)
-                        break;
-                }
-                if (start >= num_read || buf[start] != '=')
-                    continue;
-                
-                key_end = start;
-                
-                ++start; /* skip the separator */
-
-                value_start = start;
-                /* find the next end of line */
-                while (buf[start] != '\r' && buf[start] != '\n') 
-                {
-                    ++start;
-                    if (start >= num_read)
-                        break;
-                }
-
-                /* compare the value */
-                if (string_cmp(value, value_size, buf + value_start, start - value_start, start - value_start) == 0)
-                {
-                    *key_read = key_end - key_start;
-                    if (string_copy(key, key_size, buf + key_start, *key_read) != *key_read)
-                        return RC ( rcVFS, rcMgr, rcReading, rcId, rcTooLong);
-                    return 0;
-                }
-            }
-            
-            pos += num_read;
-        }
-    }
-    while (!eof);
-    
-    return RC ( rcVFS, rcMgr, rcReading, rcId, rcNotFound );
-}
-
-static rc_t AppendObject(KFile* file, const char* name, const String* value)
-{
-    uint64_t size;
-    rc_t rc = KFileSize ( file, &size );
-    if (rc == 0)
-    {
-        char buf[MAX_OBJID_SIZE + 1 + MAX_NAME_SIZE + 1];
-        size_t num_writ;
-        rc = string_printf(buf, sizeof(buf), &num_writ, "%s=%S\n", name, value);
-        if (rc == 0)
-            rc = KFileWrite ( file, size, buf, num_writ, &num_writ );
-    }
-    return rc;
-}
-
-static rc_t OpenBindingsFile(KKeyStore* self, const KFile** ret)
-{
-    rc_t rc = 0;
-    if (self->bindingsFile == NULL)
-    {
-        String* home;
-        if ( self->kfg == NULL )
-            rc = KConfigMake( (KConfig**) &(self -> kfg), NULL );
-        if (rc == 0)
-        {
-            if (KConfigReadString(self->kfg, "NCBI_HOME", &home) == 0 ||
-                KConfigReadString(self->kfg, "HOME", &home) == 0 ||
-                KConfigReadString(self->kfg, "USERPROFILE", &home) == 0 )
-            {
-                size_t num_writ;
-                rc = string_printf(defaultBindingsFile, sizeof(defaultBindingsFile), &num_writ, "%S/objid.mapping", home);
-                if (rc == 0)
-                    self->bindingsFile = defaultBindingsFile;
-                StringWhack(home);
-            }
-            else
-                rc = RC ( rcVFS, rcMgr, rcOpening, rcEnvironment, rcNull );
-        }
-    }
-    
-    if (rc == 0)
-    {
-        rc_t rc2;
-        KDirectory* wd;
-        rc = KDirectoryNativeDir (&wd);
-        if (rc == 0)
-            rc = KDirectoryOpenFileRead(wd, ret, self->bindingsFile);
-        else
-            *ret = NULL;
-            
-        rc2 = KDirectoryRelease(wd);
-        if (rc == 0)
-            rc = rc2;
-    }
-    return rc;
-}
- 
-LIB_EXPORT rc_t CC KKeyStoreRegisterObject(struct KKeyStore* self, uint32_t oid, const struct String* newName)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        return RC ( rcKFG, rcStorage, rcInitializing, rcSelf, rcNull );
-    else if ( newName == NULL )
-        rc = RC ( rcKFG, rcStorage, rcInitializing, rcParam, rcNull );
-    else
-    {
-        char oidString[MAX_OBJID_SIZE];
-        size_t num_writ;
-        rc = string_printf(oidString, sizeof(oidString), &num_writ, "%d", oid);
-        if (rc == 0)
-        {
-            rc_t rc2;
-            const KFile* file;
-            char oldName[MAX_NAME_SIZE];
-            size_t num_read;
-            
-            rc = OpenBindingsFile(self, &file);
-            if (rc == 0)
-            {   /* see if already registered */
-                if (LocateObjectId(file, oidString, oldName, sizeof(oldName), &num_read) == 0 &&
-                    string_cmp(oldName, num_read, newName->addr, newName->size, newName->size) != 0)
-                    rc = RC ( rcVFS, rcMgr, rcRegistering, rcId, rcExists );
-                rc2 = KFileRelease(file);
-                if (rc == 0)
-                    rc = rc2;
-            }
-            else /* no bindings file; will create */
-                rc = 0;
-            
-            if (rc == 0)
-            {   /* not registered; lock the bindings file and append the binding */
-                KDirectory* wd;
-                rc = KDirectoryNativeDir (&wd);
-                if (rc == 0)
-                {
-                    KFile* lockedFile;
-                    /*TODO: loop until locking succeeds or times out */
-                    rc = KDirectoryCreateExclusiveAccessFile(wd, &lockedFile, true, 0600, kcmOpen, self->bindingsFile);
-                    if (rc == 0)
-                    {
-                        if (LocateObjectId(lockedFile, oidString, oldName, sizeof(oldName), &num_read) == 0)
-                        {   /* somebody inserted the binding before we locked - make sure their binding was the same */
-                            if (string_cmp(oldName, num_read, newName->addr, newName->size, newName->size) != 0)
-                                rc = RC ( rcVFS, rcMgr, rcRegistering, rcId, rcExists );
-                        }
-                        else
-                            rc = AppendObject(lockedFile, oidString, newName);
-                            
-                        rc2 = KFileRelease(lockedFile);
-                        if (rc == 0)
-                            rc = rc2;
-                    }
-                    rc2 = KDirectoryRelease(wd);
-                    if (rc == 0)
-                        rc = rc2;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VKKeyStoreGetObjectId(const struct KKeyStore* self, const struct String* name, uint32_t* oid)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        return RC ( rcKFG, rcStorage, rcRetrieving, rcSelf, rcNull );
-    else if ( oid == NULL )
-        rc = RC ( rcKFG, rcStorage, rcRetrieving, rcParam, rcNull );
-    else
-    {
-        const KFile* file;
-        rc = OpenBindingsFile((KKeyStore*)self, &file);
-        if (rc == 0)
-        {
-            rc_t rc2;
-            char id_buf[MAX_OBJID_SIZE+1];
-            size_t id_read;
-            if (LocateObject(file, name->addr, name->size, id_buf, MAX_OBJID_SIZE, &id_read) == 0)
-            {
-                char* endptr;
-                unsigned long int res;
-                id_buf[id_read] = 0;
-                res = strtou32(id_buf, &endptr, 10);
-                if (*endptr != 0)
-                    rc = RC ( rcKFG, rcStorage, rcRetrieving, rcId, rcCorrupt);
-                else
-                    *oid = (uint32_t)res;
-            }
-            else
-                rc = RC ( rcKFG, rcStorage, rcRetrieving, rcName, rcNotFound);
-            
-            rc2 = KFileRelease(file);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KKeyStoreGetObjectName(const struct KKeyStore* self, uint32_t oid, const struct String** result)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        return RC ( rcKFG, rcStorage, rcRetrieving, rcSelf, rcNull );
-    else if ( result == NULL )
-        rc = RC ( rcKFG, rcStorage, rcRetrieving, rcParam, rcNull );
-    else
-    {
-        char oidString[MAX_OBJID_SIZE];
-        size_t num_writ;
-        rc = string_printf(oidString, sizeof(oidString), &num_writ, "%d", oid);
-        if (rc == 0)
-        {
-            const KFile* file;
-            
-            rc = OpenBindingsFile((KKeyStore*)self, &file);
-            if (rc == 0)
-            {   
-                rc_t rc2;
-                char name[MAX_NAME_SIZE];
-                size_t num_read;
-                if (LocateObjectId(file, oidString, name, sizeof(name), &num_read) == 0)
-                {
-                    String* res = (String*)malloc(sizeof(String) + num_read);
-                    if (res != NULL)
-                    {
-                        string_copy((char*)res + sizeof(String), num_read, name, num_read);
-                        StringInit(res, (char*)res + sizeof(String), num_read, num_read);
-                        *result = res;
-                    }
-                    else
-                        rc = RC ( rcKFG, rcStorage, rcRetrieving, rcMemory, rcExhausted );
-                }
-                else
-                    rc = RC ( rcKFG, rcStorage, rcRetrieving, rcId, rcNotFound);
-                    
-                rc2 = KFileRelease(file);
-                if (rc == 0)
-                    rc = rc2;
-            }
-        }
-    }
-    return rc;
-}
-
diff --git a/libs/kfg/kfg-parse.h b/libs/kfg/kfg-parse.h
deleted file mode 100644
index c271b98..0000000
--- a/libs/kfg/kfg-parse.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_kfg_scan_
-#define _h_kfg_scan_
-
-#include <kfg/extern.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct KFGParseBlock
-{
-    const char* tokenText;
-    size_t tokenLength;
-    int tokenId;
-    size_t line_no;
-    size_t column_no;
-} KFGParseBlock;
-
-typedef struct KFGScanBlock
-{
-    void* scanner;
-    void* buffer;
-    void* self; 
-    const char* file;
-    KFGParseBlock* lastToken; /* used for error reporting */
-    rc_t (*write_nvp)(void * self, const char* name, size_t nameLen, VNamelist*);
-    bool (*look_up_var)(void * self, struct KFGParseBlock*);
-    void (*report_error)(struct KFGScanBlock* sb, const char* msg);
-} KFGScanBlock;
-
-#define YYSTYPE_IS_DECLARED
-typedef union 
-{
-	KFGParseBlock   pb;
-	VNamelist*	    namelist;
-} KFGSymbol;
-
-/* Exposed for the sake of wb-test-kfg. */
-KFG_EXTERN rc_t CC KFGScan_yylex_init(KFGScanBlock* sb, const char *str);
-KFG_EXTERN void CC KFGScan_yylex_destroy(KFGScanBlock* sb);
-
-KFG_EXTERN void CC KFGScan_set_debug(bool on, KFGScanBlock* scannerContext);
-
-KFG_EXTERN int CC KFGScan_yylex(KFGSymbol* pb, KFGScanBlock* scannerContext);
-
-KFG_EXTERN int CC KFG_parse(KFGParseBlock* pb, KFGScanBlock* scannerContext);
-void CC KFG_error(KFGParseBlock* pb, KFGScanBlock* sb, const char* msg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfg_scan_ */
diff --git a/libs/kfg/libkfg.vers b/libs/kfg/libkfg.vers
deleted file mode 100644
index a970716..0000000
--- a/libs/kfg/libkfg.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.15
diff --git a/libs/kfg/report-kfg.c b/libs/kfg/report-kfg.c
deleted file mode 100644
index a0e45e0..0000000
--- a/libs/kfg/report-kfg.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfg/extern.h>
-
-#include <kfg/config.h>
-#include <kfg/repository.h> /* KRepositoryMgr */
-#include <kfg/kfg-priv.h>
-
-#include <klib/namelist.h> /* KNamelistRelease */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/klib-priv.h>
-#include <klib/rc.h>
-
-#include <kfs/directory.h>
-#include <kfs/dyload.h> /* KDyld */
-#include <kfs/file.h> /* KFileRead */
-#include <kfs/nullfile.h> /* KFileMakeNullUpdate */
-#include <kfs/md5.h> /* KMD5SumFmt */
-
-#include <sysalloc.h>
-
-#include <stdarg.h> /* va_start */
-#include <stdio.h> /* sprintf */
-#include <stdlib.h> /* malloc */
-#include <string.h> /* memset */
-#include <limits.h> /* PATH_MAX */
-#include <assert.h>
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-/*
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-#define report ( * f -> report )
-#define reportData ( * f -> reportData )
-#define reportData1 ( * f -> reportData1 )
-#define reportOpen ( * f -> reportOpen )
-#define reportOpen1 ( * f -> reportOpen1 )
-#define reportClose ( * f -> reportClose )
-#define reportClose1 ( * f -> reportClose1 )
-#define reportError ( * f -> reportError )
-#define reportErrorStr ( * f -> reportErrorStr )
-#define reportErrorStrImpl ( * f -> reportErrorStrImpl )
-#define reportErrorStrInt ( * f -> reportErrorStrInt )
-#define reportError3Str ( * f -> reportError3Str )
-
-static rc_t ReportKfgFiles(const ReportFuncs *f,
-    int indent, const KConfig* cfg)
-{
-    rc_t rc = 0;
-
-    uint32_t count = 0;
-    KNamelist* names = NULL;
-
-    rc = KConfigListIncluded(cfg, &names);
-
-    if (rc != 0) {
-        reportOpen(indent, "Files", 0);
-        reportError(indent + 1, rc, "KConfigListIncluded");
-    }
-    else {
-        rc = KNamelistCount(names, &count);
-        if (rc != 0) {
-            reportOpen(indent, "Files", 0);
-            reportErrorStr(indent + 1,
-                rc, "KNamelistCount", "origin", "KConfigListIncluded");
-        }
-        else {
-            int i = 0;
-            reportOpen(indent, "Files", 1, "count", 'd', count);
-            for (i = 0; i < count && rc == 0; ++i) {
-                const char* name = NULL;
-                rc = KNamelistGet(names, i, &name);
-                if (rc != 0) {
-                    reportErrorStrInt(indent + 1, rc, "KNamelistGet",
-                        "origin", "KConfigListIncluded", "idx", i);
-                }
-                else
-                {   report(indent + 1, "File", 1, "name", 's', name); }
-            }
-        }
-    }
-    reportClose(indent, "Files");
-
-    RELEASE(KNamelist, names);
-
-    return rc;
-}
-
-static
-rc_t sKConfigNode_Read(const KConfigNode* node, char* buffer, size_t buf_sz,
-    char** overflow_buf, bool* cant_allocate)
-{
-    rc_t rc = 0;
-    size_t num_read = 0;
-    size_t remaining = 0;
-    assert(overflow_buf && cant_allocate);
-    *cant_allocate = false;
-    *overflow_buf = NULL;
-    rc = KConfigNodeRead(node, 0, buffer, buf_sz, &num_read, &remaining);
-    if (rc != 0)
-    {   return rc; }
-    if (num_read < buf_sz)
-    {   buffer[num_read] = '\0'; }
-    else {
-        size_t new_buf_sz = num_read + remaining + 1;
-        char* overflow = malloc(new_buf_sz);
-        if (overflow == NULL) {
-            int i = 0;
-            for (i = 2; i < 5 && buf_sz - i > 0; ++i)
-            {   buffer[buf_sz - i] = '.'; }
-            buffer[buf_sz - 1] = '\0';
-            *cant_allocate = true;
-        }
-        else {
-            buffer = *overflow_buf = overflow;
-            buf_sz = 
-            rc = KConfigNodeRead
-                (node, 0, buffer, new_buf_sz, &num_read, &remaining);
-            if (rc != 0)
-            {   return rc; }
-            assert(num_read < new_buf_sz && remaining == 0);
-            buffer[num_read] = '\0';
-        }
-    }
-    return rc;
-}
-
-static rc_t ReportChildNode(const ReportFuncs *f, int indent,
-    const KNamelist* names, const KConfigNode* node, const char* root, uint32_t idx);
-
-static
-rc_t ReportConfigNodeChildren(const ReportFuncs *f, int indent,
-    const KConfigNode* node, const char* nodeName)
-{
-    KNamelist* names = NULL;
-    rc_t rc = KConfigNodeListChild(node, &names);
-    if (rc != 0) {
-        reportErrorStrImpl(indent,
-            rc, "KConfigNodeListChild", "node", nodeName, false);
-    }
-    else {
-        uint32_t count = 0;
-        rc = KNamelistCount(names, &count);
-        if (rc != 0) {
-            reportErrorStrImpl
-                (indent, rc, "KNamelistCount", "node", nodeName, false);
-        }
-        else {
-            if (count) {
-                int i = 0;
-                OUTMSG(("\n"));
-                for (i = 0; i < count && rc == 0; ++i) {
-                    rc = ReportChildNode
-                        (f, indent + 1, names, node, nodeName, i);
-                }
-                for (i = 0; i < indent; ++i)
-                {   OUTMSG((" ")); }
-            }
-        }
-    }
-    RELEASE(KNamelist, names);
-    return rc;
-}
-
-static rc_t ReportConfigNode(const ReportFuncs *f, int indent, const char* root,
-    const char* name, const KConfigNode* node, const char* node_name)
-{
-    rc_t rc = 0;
-
-    char local[PATH_MAX + 1] = "";
-    const char* nodeName = node_name ? node_name : name;
-    char* overflow = NULL;
-    bool cantallocate = false;
-
-    reportOpen1(indent, nodeName);
-    rc = sKConfigNode_Read(node, local, sizeof local, &overflow, &cantallocate);
-    if (rc == 0) {
-        char* buf = overflow ? overflow : local;
-        rc = reportData1(buf);
-        free(overflow);
-        overflow = NULL;
-        if (rc == 0)
-        {   rc = ReportConfigNodeChildren(f, indent, node, nodeName); }
-    }
-    else {
-        reportError3Str
-            (indent + 1, rc, "KConfigNodeRead", "node", root, "/", name, false);
-    }
-    reportClose1(nodeName);
-
-    return rc;
-}
-
-static rc_t ReportConfigNode_File(const ReportFuncs *f, int indent,
-    const char* root,
-    const char* name, const KConfigNode* node, const char* node_name)
-{
-    rc_t rc = 0;
-    char local[PATH_MAX + 1] = "";
-    const char* nodeName = node_name ? node_name : name;
-    char* overflow = NULL;
-    bool cantallocate = false;
-    rc = sKConfigNode_Read(node, local, sizeof local, &overflow, &cantallocate);
-    if (rc) {
-        reportError3Str
-            (indent, rc, "KConfigNodeRead", "node", root, "/", name, false);
-    }
-    else {
-        const char* buf = overflow ? overflow : local;
-        KPathType file_type = kptNotFound;
-        const char* type = NULL;
-        if (!cantallocate) {
-            KDirectory* dir = NULL;
-            rc = KDirectoryNativeDir(&dir);
-            if (rc == 0) {
-                file_type = KDirectoryPathType(dir, buf);
-                file_type &= ~kptAlias;
-                type = file_type == kptFile ? "exists" :
-                          file_type == kptNotFound ? "not found" : "unexpected";
-            }
-            RELEASE(KDirectory, dir);
-        }
-        else
-        {   type = "noo long"; }
-        if (rc == 0)
-        {   reportData(indent, nodeName, buf, 1, "file", 's', type); }
-    }
-    free(overflow);
-    overflow = NULL;
-    return rc;
-}
-
-static rc_t ReportChildNode(const ReportFuncs *f, int indent,
-    const KNamelist* names,
-    const KConfigNode* node, const char* root, uint32_t idx)
-{
-    rc_t rc = 0;
-
-    const char* name = NULL;
-    rc = KNamelistGet(names, idx, &name);
-    if (rc != 0) {
-        reportErrorStrInt
-            (indent + 1, rc, "KNamelistGet", "node", root, "idx", idx);
-    }
-    else {
-        const KConfigNode* child = NULL;
-        rc = KConfigNodeOpenNodeRead(node, &child, name);
-        if (rc != 0) {
-            reportOpen(indent, name, 0);
-            reportError3Str(indent + 1, rc, "KConfigNodeOpenNodeRead",
-                "node", root, "/", name, true);
-            reportClose(indent, name);
-        }
-        else
-        {   rc = ReportConfigNode(f, indent, root, name, child, NULL); }
-    }
-
-    return rc;
-}
-
-static
-rc_t ReportRefseq(const ReportFuncs *f, int indent, const KConfig* cfg)
-{
-    rc_t rc = 0;
-
-    const char root[] = "refseq";
-
-    const KConfigNode* node = NULL;
-    rc = KConfigOpenNodeRead(cfg, &node, root);
-    if (rc != 0) {
-        if (GetRCState(rc) == rcNotFound) {
-            report(indent, root, 1, "state", 's', "not found");
-            rc = 0;
-        }
-        else
-        {   reportErrorStr(indent, rc, "KConfigOpenNodeRead", "node", root); }
-    }
-    else {
-        KNamelist* names = NULL;
-        rc = KConfigNodeListChild(node, &names);
-        if (rc != 0)
-        {   reportErrorStr(indent, rc, "KConfigNodeListChild", "node", root); }
-        else {
-            uint32_t count = 0;
-            rc = KNamelistCount(names, &count);
-            if (rc != 0)
-            {   reportErrorStr(indent, rc, "KNamelistCount", "node", root); }
-            else {
-                uint32_t i = 0;
-                reportOpen(indent, root, 0);
-                for (i = 0; i < count && rc == 0; ++i)
-                {   rc = ReportChildNode(f, indent + 1, names, node, root, i); }
-                reportClose(indent, root);
-            }
-        }
-        RELEASE(KNamelist, names);
-    }
-
-    RELEASE(KConfigNode, node);
-
-    return rc;
-}
-
-static
-rc_t ReportSra(const ReportFuncs *f, int indent, const KConfig* cfg)
-{
-    rc_t rc = 0;
-    const char root[] = "sra";
-    const KConfigNode* node = NULL;
-    assert(cfg);
-    rc = KConfigOpenNodeRead(cfg, &node, root);
-    if (rc != 0) {
-        if (GetRCState(rc) == rcNotFound) {
-            report(indent, root, 1, "state", 's', "not found");
-            rc = 0;
-        }
-        else
-        {   reportErrorStr(indent, rc, "KConfigOpenNodeRead", "node", root); }
-    }
-    else {
-        KNamelist* names = NULL;
-        rc = KConfigNodeListChild(node, &names);
-        if (rc != 0)
-        {   reportErrorStr(indent, rc, "KConfigNodeListChild", "node", root); }
-        else {
-            uint32_t count = 0;
-            rc = KNamelistCount(names, &count);
-            if (rc != 0)
-            {   reportErrorStr(indent, rc, "KNamelistCount", "node", root); }
-            else {
-                uint32_t i = 0;
-                reportOpen(indent, root, 0);
-                for (i = 0; i < count && rc == 0; ++i)
-                {   rc = ReportChildNode(f, indent + 1, names, node, root, i); }
-                reportClose(indent, root);
-            }
-        }
-        RELEASE(KNamelist, names);
-    }
-    RELEASE(KConfigNode, node);
-    return rc;
-}
-
-static
-rc_t ReportKrypto(const ReportFuncs *f, int indent, const KConfig* cfg)
-{
-    rc_t rc = 0;
-
-    const char root[] = "krypto/pwfile";
-    const char name[] = "krypto";
-
-    const KConfigNode* node = NULL;
-    rc = KConfigOpenNodeRead(cfg, &node, root);
-    if (rc != 0) {
-        if (GetRCState(rc) == rcNotFound) {
-            report(indent, name, 1, "state", 's', "pwfile: not found");
-            rc = 0;
-        }
-        else
-        {   reportErrorStr(indent, rc, "KConfigOpenNodeRead", "node", root); }
-    }
-    else {
-        rc = ReportConfigNode_File(f, indent, "krypto", "pwfile", node, "krypto");
-    }
-
-    RELEASE(KConfigNode, node);
-
-    return rc;
-}
-
-static
-rc_t ReportCrntRepository(const ReportFuncs *f, int indent, const KConfig *cfg)
-{
-    rc_t rc = 0;
-    const KRepositoryMgr *mgr = NULL;
-    const KRepository *protectd = NULL;
-    const char root[] = "CurrentProtectedRepository";
-    bool open = false;
-    rc = KConfigMakeRepositoryMgrRead(cfg, &mgr);
-    if (rc != 0) {
-        reportError(indent, rc, "KConfigMakeRepositoryMgrRead");
-    }
-    if (rc == 0) {
-        rc = KRepositoryMgrCurrentProtectedRepository(mgr, &protectd);
-        if (rc != 0) {
-            if (rc == SILENT_RC(
-                rcKFG, rcMgr, rcAccessing, rcNode, rcNotFound))
-            {
-                report(indent, root, 1, "found", 's', "false");
-            }
-            else {
-                reportOpen(indent, root, 0);
-                open = true;
-                reportErrorStr(indent + 1, rc,
-                    "KRepositoryMgrCurrentProtectedRepository", NULL, NULL);
-            }
-        }
-    }
-    if (rc == 0) {
-        char buffer[256];
-        size_t name_size = 0;
-        reportOpen(indent, root, 1, "found", 's', "true");
-        open = true;
-        rc = KRepositoryName(protectd, buffer, sizeof buffer, &name_size);
-        if (rc != 0) {
-            reportErrorStr(indent + 1, rc, "KRepositoryName",
-                "origin", "KRepositoryMgrCurrentProtectedRepository");
-        }
-        else {
-            reportData(indent + 1, "name", buffer, 0);
-        }
-    }
-    RELEASE(KRepository, protectd);
-    RELEASE(KRepositoryMgr, mgr);
-    if (open) {
-        reportClose(indent, root);
-    }
-    return rc;
-}
-
-rc_t ReportKfg ( const ReportFuncs *f, uint32_t indent )
-{
-    rc_t rc = 0;
-
-    KConfig* cfg = NULL;
-
-    const char tag[] = "Configuration";
-    reportOpen(indent, tag, 0);
-
-    rc = KConfigMake(&cfg, NULL);
-    if (rc != 0) {
-        reportError(indent + 1, rc, "KConfigMake");
-    }
-    else {
-        {
-            rc_t rc2 = ReportKfgFiles(f, indent + 1, cfg);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        {
-            rc_t rc2 = ReportRefseq(f, indent + 1, cfg);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        {
-            rc_t rc2 = ReportKrypto(f, indent + 1, cfg);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        {
-            rc_t rc2 = ReportSra(f, indent + 1, cfg);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        {
-            rc_t rc2 = KConfigPrint(cfg, indent);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        {
-            rc_t rc2 = ReportCrntRepository(f, indent + 1, cfg);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-    }
-
-    reportClose(indent, tag);
-
-    RELEASE(KConfig, cfg);
-
-    return rc;
-}
diff --git a/libs/kfg/repository.c b/libs/kfg/repository.c
deleted file mode 100644
index 278c7ac..0000000
--- a/libs/kfg/repository.c
+++ /dev/null
@@ -1,1186 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <kfg/extern.h>
-
-#include <kfg/repository.h>
-#include <kfg/config.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfs/impl.h>
-#include <klib/refcount.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/vector.h>
-#include <klib/namelist.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/*--------------------------------------------------------------------------
- * KRepository
- *  presents structured access to a storage repository
- *  as modeled in KConfig.
- *
- *  all objects are obtained via KRepositoryMgr ( see below )
- */
-struct KRepository
-{
-    const KConfigNode *node;
-    String name;
-    KRefcount refcount;
-    KRepCategory category;
-    KRepSubCategory subcategory;
-};
-
-
-/* Whack
- */
-static
-rc_t KRepositoryWhack ( KRepository *self )
-{
-    KConfigNodeRelease ( self -> node );
-    free ( self );
-    return 0;
-}
-
-/* Sort
- */
-static
-int CC KRepositorySort ( const void **a, const void **b, void *ignore )
-{
-    const KRepository *left = * a;
-    const KRepository *right = * b;
-
-    if ( left -> category < right -> category )
-        return -1;
-    if ( left -> category > right -> category )
-        return 1;
-    if ( left -> subcategory < right -> subcategory )
-        return -1;
-    if ( left -> subcategory > right -> subcategory )
-        return 1;
-    return StringCompare ( & left -> name, & right -> name );
-}
-
-/* Make
- */
-static
-rc_t KRepositoryMake ( KRepository **rp, const KConfigNode *node,
-    const char *name, KRepCategory category, KRepSubCategory subcategory )
-{
-    rc_t rc;
-    KRepository *r;
-    String name_str;
-
-    /* measure string */
-    StringInitCString ( & name_str, name );
-
-    /* create object */
-    r = malloc ( sizeof * r + name_str . size + 1 );
-    if ( r == NULL )
-        return RC ( rcKFG, rcNode, rcConstructing, rcMemory, rcExhausted );
-
-    rc = KConfigNodeAddRef ( node );
-    if ( rc != 0 )
-    {
-        free ( r );
-        return rc;
-    }
-
-    r -> node = node;
-    r -> name = name_str;
-    r -> name . addr = ( char* ) ( r + 1 );
-    KRefcountInit ( & r -> refcount, 1, "KRepository", "make", name );
-    r -> category = category;
-    r -> subcategory = subcategory;
-    memcpy ( r + 1, name, name_str . size );
-    ( ( char* ) ( r + 1 ) ) [ name_str . size ] = 0;
-
-    * rp = r;
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRepositoryAddRef ( const KRepository *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KRepository" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcNode, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRepositoryRelease ( const KRepository *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KRepository" ) )
-        {
-        case krefWhack:
-            return KRepositoryWhack ( ( KRepository* ) self );
-        case krefNegative:
-            return RC ( rcKFG, rcNode, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* WhackEntry
- *  for cleaning up these vectors
- */
-static
-void CC KRepositoryWhackEntry ( void *item, void *ignore )
-{
-    KRepository *self = item;
-    KRepositoryRelease ( self );
-}
-
-
-/* Category
- * SubCategory
- *  tells what the repository category or sub-category are
- *  or returns "bad" if the repository object is not usable.
- */
-LIB_EXPORT KRepCategory CC KRepositoryCategory ( const KRepository *self )
-{
-    if ( self != NULL )
-        return self -> category;
-    return krepBadCategory;
-}
-
-LIB_EXPORT KRepSubCategory CC KRepositorySubCategory ( const KRepository *self )
-{
-    if ( self != NULL )
-        return self -> subcategory;
-    return krepBadSubCategory;
-}
-
-
-/* Name
- *  get the repository name
- *  attempts to copy NUL-terminated name into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - name output parameter
- *
- *  "name_size" [ OUT, NULL OKAY ] - returns the name size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryName ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *name_size )
-{
-    if ( self == NULL )
-        return RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-
-    if ( name_size != NULL )
-        * name_size = self -> name . size;
-
-    if ( bsize < self -> name . size )
-        return RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-
-    if ( buffer == NULL )
-        return RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcNull );
-
-    memcpy ( buffer, self -> name . addr, self -> name . size );
-
-    if ( bsize > self -> name . size )
-        buffer [ self -> name . size ] = 0;
-
-    return 0;
-}
-
-
-/* DisplayName
- *  get the repository display name,
- *  if different from its actual name
- *
- *  attempts to copy NUL-terminated name into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - name output parameter
- *
- *  "name_size" [ OUT, NULL OKAY ] - returns the name size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryDisplayName ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *name_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( name_size != NULL )
-            * name_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "display-name" );
-        if ( rc != 0 )
-            rc = KRepositoryName ( self, buffer, bsize, name_size );
-        else
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( name_size != NULL )
-                    * name_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    buffer [ num_read ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* Root
- *  read the root path as a POSIX path or URL
- *
- *  attempts to copy NUL-terminated path into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - path output parameter
- *
- *  "root_size" [ OUT, NULL OKAY ] - returns the path size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryRoot ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *root_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( root_size != NULL )
-            * root_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "root" );
-        if ( rc == 0 )
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( root_size != NULL )
-                    * root_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    buffer [ num_read ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* Disabled
- *  discover whether the repository is enabled
- */
-LIB_EXPORT bool CC KRepositoryDisabled ( const KRepository *self )
-{
-    if ( self != NULL )
-    {
-        const KConfigNode *node;
-        rc_t rc = KConfigNodeOpenNodeRead ( self -> node, & node, "disabled" );
-        if ( rc == 0 )
-        {
-            bool disabled = false;
-            rc = KConfigNodeReadBool ( node, & disabled );
-            KConfigNodeRelease ( node );
-            if ( rc == 0 )
-                return disabled;
-        }
-    }
-
-    return false;
-}
-
-
-static const char * STR_TRUE  = "true";
-static const char * STR_FALSE = "false";
-
-LIB_EXPORT rc_t CC KRepositorySetDisabled ( const KRepository *self, bool disabled )
-{
-    rc_t rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    if ( self != NULL )
-    {
-        KConfigNode * self_node = ( KConfigNode * )self->node;  /* casting away const-ness */
-        KConfigNode * node;
-        rc = KConfigNodeOpenNodeUpdate ( self_node, &node, "disabled" );
-        if ( rc == 0 )
-        {
-            const char * value = disabled ? STR_TRUE : STR_FALSE;
-            rc = KConfigNodeWrite ( node, value, string_size( value ) );
-            if ( rc == 0 )
-            {
-                KConfig * cfg;
-                rc = KConfigNodeGetMgr( self->node, &cfg );
-                if ( rc == 0 )
-                {
-                    rc = KConfigCommit ( cfg );
-                    KConfigRelease ( cfg );
-                }
-            }
-            KConfigNodeRelease ( node );
-        }
-    }
-    return rc;
-}
-
-
-/* CacheEnabled
- *  discover whether the repository supports caching
- */
-LIB_EXPORT bool CC KRepositoryCacheEnabled ( const KRepository *self )
-{
-    if ( self != NULL )
-    {
-        const KConfigNode *node;
-        rc_t rc = KConfigNodeOpenNodeRead ( self -> node, & node, "cache-enabled" );
-        if ( rc == 0 )
-        {
-            bool enabled = false;
-            rc = KConfigNodeReadBool ( node, & enabled );
-            KConfigNodeRelease ( node );
-            if ( rc == 0 )
-                return enabled;
-        }
-    }
-
-    return false;
-}
-
-
-/* DownloadTicket
- *  return any associated download ticket
- *
- *  attempts to copy NUL-terminated ticket into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - ticket output parameter
- *
- *  "ticket_size" [ OUT, NULL OKAY ] - returns the ticket size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryDownloadTicket ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *ticket_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( ticket_size != NULL )
-            * ticket_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "download-ticket" );
-        if ( rc == 0 )
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( ticket_size != NULL )
-                    * ticket_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    buffer [ num_read ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* EncryptionKey
- *  return any associated encryption key
- *
- *  attempts to copy NUL-terminated key into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - encryption key output parameter
- *
- *  "key_size" [ OUT, NULL OKAY ] - returns the key size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryEncryptionKey ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *key_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( key_size != NULL )
-            * key_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "encryption-key" );
-        if ( rc == 0 )
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( key_size != NULL )
-                    * key_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    memset ( & buffer [ num_read ], 0, bsize - num_read );
-            }
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-        {
-            char path [ 4096 ];
-            rc_t rc2 = KRepositoryEncryptionKeyFile ( self, path, sizeof path, NULL );
-            if ( rc2 == 0 )
-            {
-                KDirectory *wd;
-                rc2 = KDirectoryNativeDir ( & wd );
-                if ( rc2 == 0 )
-                {
-                    const KFile *keyFile;
-                    rc2 = KDirectoryOpenFileRead ( wd, & keyFile, path );
-                    KDirectoryRelease ( wd );
-                    if ( rc2 == 0 )
-                    {
-                        size_t num_read;
-                        rc = KFileReadAll ( keyFile, 0, buffer, bsize, & num_read );
-                        if ( rc == 0 )
-                        {
-                            if ( num_read == bsize )
-                            {
-                                uint64_t eof;
-                                rc = KFileSize ( keyFile, & eof );
-                                if ( rc == 0 )
-                                    num_read = ( size_t ) eof;
-                                else
-                                    num_read = 0;
-
-                                rc = RC ( rcKFG, rcFile, rcReading, rcBuffer, rcInsufficient );
-                                memset ( buffer, 0, bsize );
-                            }
-                            else if ( num_read == 0 )
-                            {
-                                rc = RC ( rcKFG, rcFile, rcReading, rcFile, rcEmpty );
-                                memset ( buffer, 0, bsize );
-                            }
-                            else
-                            {
-                                char *eoln = string_chr ( buffer, num_read, '\n' );
-                                if ( eoln != NULL )
-                                {
-                                    if ( eoln == buffer )
-                                        num_read = 0;
-                                    else if ( eoln [ -1 ] == '\r' )
-                                        num_read = eoln - buffer - 1;
-                                    else
-                                        num_read = eoln - buffer;
-                                }
-
-                                if ( key_size != NULL )
-                                    * key_size = num_read;
-
-                                memset ( & buffer [ num_read ], 0, bsize - num_read );
-                            }
-                        }
-
-                        KFileRelease ( keyFile );
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* EncryptionKeyFile
- *  return path to any associated encryption key file
- *
- *  attempts to copy NUL-terminated path into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - key file path output parameter
- *
- *  "path_size" [ OUT, NULL OKAY ] - returns the path size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryEncryptionKeyFile ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *path_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( path_size != NULL )
-            * path_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "encryption-key-path" );
-        if ( rc == 0 )
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( path_size != NULL )
-                    * path_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    buffer [ num_read ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* Description
- *  return any associated descriptive text
- *
- *  attempts to copy NUL-terminated description into provided buffer
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - description text output parameter
- *
- *  "desc_size" [ OUT, NULL OKAY ] - returns the text size in
- *  bytes, excluding any NUL termination.
- */
-LIB_EXPORT rc_t CC KRepositoryDescription ( const KRepository *self,
-    char *buffer, size_t bsize, size_t *desc_size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcNode, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        const KConfigNode *node;
-
-        if ( desc_size != NULL )
-            * desc_size = 0;
-
-        rc = KConfigNodeOpenNodeRead ( self -> node, & node, "description" );
-        if ( rc == 0 )
-        {
-            size_t num_read, remaining;
-            rc = KConfigNodeRead ( node, 0, buffer, bsize, & num_read, & remaining );
-            KConfigNodeRelease ( node );
-
-            if ( rc == 0 )
-            {
-                if ( desc_size != NULL )
-                    * desc_size = num_read + remaining;
-
-                if ( remaining != 0 )
-                    rc = RC ( rcKFG, rcNode, rcAccessing, rcBuffer, rcInsufficient );
-                else if ( num_read < bsize )
-                    buffer [ num_read ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KRepositoryVector
- *  uses Vector API
- *  holds zero or more KRepository objects
- */
-
-
-/* Whack
- *  destroy your vector
- */
-LIB_EXPORT rc_t CC KRepositoryVectorWhack ( KRepositoryVector *self )
-{
-    if ( self == NULL )
-        return RC ( rcKFG, rcVector, rcDestroying, rcSelf, rcNull );
-
-    VectorWhack ( self, KRepositoryWhackEntry, NULL );
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KRepositoryMgr
- *  manages structured access to repositories
- */
-struct KRepositoryMgr
-{
-    const KConfig *ro_cfg;
-    KConfig *rw_cfg;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KRepositoryMgrWhack ( KRepositoryMgr *self )
-{
-    if ( self -> ro_cfg )
-        KConfigRelease ( self -> ro_cfg );
-    if ( self -> rw_cfg )
-        KConfigRelease ( self -> rw_cfg );
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  create a repository manager
- *  uses values from "self"
- */
-LIB_EXPORT rc_t CC KConfigMakeRepositoryMgrRead ( const KConfig *self, const KRepositoryMgr **mgrp )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcKFG, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcConstructing, rcSelf, rcNull );
-        else
-        {
-            KRepositoryMgr *mgr = calloc ( 1, sizeof * mgr );
-            if ( mgr == NULL )
-                rc = RC ( rcKFG, rcMgr, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KConfigAddRef ( self );
-                if ( rc == 0 )
-                {
-                    mgr -> ro_cfg = self;
-                    KRefcountInit ( & mgr -> refcount, 1, "KRepositoryMgr", "make-read", "mgr" );
-                    * mgrp = mgr;
-                    return 0;
-                }
-
-                free ( mgr );
-            }
-        }
-
-        * mgrp = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KConfigMakeRepositoryMgrUpdate ( KConfig *self, KRepositoryMgr **mgrp )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcKFG, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcConstructing, rcSelf, rcNull );
-        else
-        {
-            KRepositoryMgr *mgr = calloc ( 1, sizeof * mgr );
-            if ( mgr == NULL )
-                rc = RC ( rcKFG, rcMgr, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KConfigAddRef ( self );
-                if ( rc == 0 )
-                {
-                    mgr -> rw_cfg = self;
-                    KRefcountInit ( & mgr -> refcount, 1, "KRepositoryMgr", "make-update", "mgr" );
-                    * mgrp = mgr;
-                    return 0;
-                }
-
-                free ( mgr );
-            }
-        }
-
-        * mgrp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRepositoryMgrAddRef ( const KRepositoryMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KRepositoryMgr" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRepositoryMgrRelease ( const KRepositoryMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KRepositoryMgr" ) )
-        {
-        case krefWhack:
-            return KRepositoryMgrWhack ( ( KRepositoryMgr* ) self );
-        case krefNegative:
-            return RC ( rcKFG, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-static
-const KConfig *KRepositoryMgrGetROKConfig ( const KRepositoryMgr *self )
-{
-    return self -> ro_cfg ? self -> ro_cfg : self -> rw_cfg;
-}
-
-static
-rc_t KRepositoryMgrSubCategoryRepositories ( const KConfigNode *sub,
-    KRepCategory category, KRepSubCategory subcategory, KRepositoryVector *repositories )
-{
-    KNamelist *repo_names;
-    rc_t rc = KConfigNodeListChildren ( sub, & repo_names );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( repo_names, & count );
-        for ( i = 0; i < count && rc == 0; ++ i )
-        {
-            const char *repo_name;
-            rc = KNamelistGet ( repo_names, i, & repo_name );
-            if ( rc == 0 )
-            {
-                const KConfigNode *node;
-                rc = KConfigNodeOpenNodeRead ( sub, & node, repo_name );
-                if ( rc == 0 )
-                {
-                    KRepository *repo;
-                    rc = KRepositoryMake ( & repo, node, repo_name, category, subcategory );
-                    if ( rc == 0 )
-                    {
-                        rc = VectorAppend ( repositories, NULL, repo );
-                        if ( rc != 0 )
-                            KRepositoryWhack ( repo );
-                    }
-
-                    KConfigNodeRelease ( node );
-                }
-            }
-        }
-
-        KNamelistRelease ( repo_names );
-    }
-
-    return rc;
-}
-
-static
-rc_t KRepositoryMgrCategoryRepositories ( const KConfigNode *cat,
-    KRepCategory category, KRepositoryVector *repositories )
-{
-    KNamelist *sub_names;
-    rc_t rc = KConfigNodeListChildren ( cat, & sub_names );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( sub_names, & count );
-        for ( i = 0; i < count && rc == 0; ++ i )
-        {
-            const char *sub_name;
-            rc = KNamelistGet ( sub_names, i, & sub_name );
-            if ( rc == 0 )
-            {
-                KRepSubCategory subcategory = krepBadSubCategory;
-                if ( strcmp ( "main", sub_name ) == 0 )
-                    subcategory = krepMainSubCategory;
-                else if ( strcmp ( "aux", sub_name ) == 0 )
-                    subcategory = krepAuxSubCategory;
-                else if ( strcmp ( "protected", sub_name ) == 0 )
-                    subcategory = krepProtectedSubCategory;
-
-                if ( subcategory != krepBadSubCategory )
-                {
-                    const KConfigNode *sub;
-                    rc = KConfigNodeOpenNodeRead ( cat, & sub, sub_name );
-                    if ( rc == 0 )
-                    {
-                        rc = KRepositoryMgrSubCategoryRepositories ( sub, category, subcategory, repositories );
-                        KConfigNodeRelease ( sub );
-                    }
-                }
-            }
-        }
-
-        KNamelistRelease ( sub_names );
-    }
-
-    return rc;
-}
-
-
-/* UserRepositories
- *  retrieve all user repositories in a Vector
- */
-LIB_EXPORT rc_t CC KRepositoryMgrUserRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *user_repositories )
-{
-    rc_t rc;
-
-    if ( user_repositories == NULL )
-        rc = RC ( rcKFG, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        VectorInit ( user_repositories, 0, 8 );
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const KConfig *kfg = KRepositoryMgrGetROKConfig ( self );
-
-            const KConfigNode *user;
-            rc = KConfigOpenNodeRead ( kfg, & user, "/repository/user" );
-            if ( rc == 0 )
-            {
-                rc = KRepositoryMgrCategoryRepositories ( user, krepUserCategory, user_repositories );
-                KConfigNodeRelease ( user );
-                if ( rc == 0 )
-                    VectorReorder ( user_repositories, KRepositorySort, NULL );
-            }
-
-            if ( rc != 0 )
-                KRepositoryVectorWhack ( user_repositories );
-        }
-    }
-
-    return rc;
-}
-
-
-/* SiteRepositories
- *  retrieve all site repositories in a Vector
- */
-LIB_EXPORT rc_t CC KRepositoryMgrSiteRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *site_repositories )
-{
-    rc_t rc;
-
-    if ( site_repositories == NULL )
-        rc = RC ( rcKFG, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        VectorInit ( site_repositories, 0, 8 );
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const KConfig *kfg = KRepositoryMgrGetROKConfig ( self );
-
-            const KConfigNode *site;
-            rc = KConfigOpenNodeRead ( kfg, & site, "/repository/site" );
-            if ( rc == 0 )
-            {
-                rc = KRepositoryMgrCategoryRepositories ( site, krepSiteCategory, site_repositories );
-                KConfigNodeRelease ( site );
-                if ( rc == 0 )
-                    VectorReorder ( site_repositories, KRepositorySort, NULL );
-            }
-
-            if ( rc != 0 )
-                KRepositoryVectorWhack ( site_repositories );
-        }
-    }
-
-    return rc;
-}
-
-
-/* RemoteRepositories
- *  retrieve all remote repositories in a Vector
- */
-LIB_EXPORT rc_t CC KRepositoryMgrRemoteRepositories ( const KRepositoryMgr *self,
-    KRepositoryVector *remote_repositories )
-{
-    rc_t rc;
-
-    if ( remote_repositories == NULL )
-        rc = RC ( rcKFG, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        VectorInit ( remote_repositories, 0, 8 );
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const KConfig *kfg = KRepositoryMgrGetROKConfig ( self );
-
-            const KConfigNode *remote;
-            rc = KConfigOpenNodeRead ( kfg, & remote, "/repository/remote" );
-            if ( rc == 0 )
-            {
-                rc = KRepositoryMgrCategoryRepositories ( remote, krepRemoteCategory, remote_repositories );
-                KConfigNodeRelease ( remote );
-                if ( rc == 0 )
-                    VectorReorder ( remote_repositories, KRepositorySort, NULL );
-            }
-
-            if ( rc != 0 )
-                KRepositoryVectorWhack ( remote_repositories );
-        }
-    }
-
-    return rc;
-}
-
-
-/* CurrentProtectedRepository
- *  returns the currently active user protected repository
- */
-LIB_EXPORT rc_t CC KRepositoryMgrCurrentProtectedRepository ( const KRepositoryMgr *self, const KRepository **protected )
-{
-    rc_t rc;
-
-    if ( protected == NULL )
-        rc = RC ( rcKFG, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * protected = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            KRepositoryVector v;
-            rc = KRepositoryMgrUserRepositories ( self, & v );
-            if ( rc == 0 )
-            {
-                KDirectory *wd;
-                rc = KDirectoryNativeDir ( & wd );
-                if ( rc == 0 )
-                {
-                    /* we need services of system directory */
-                    struct KSysDir *sysDir = KDirectoryGetSysDir ( wd );
-
-                    /* allocate buffer space for 3 paths */
-                    const size_t path_size = 4096;
-                    char *wd_path = malloc ( path_size * 3 );
-                    if ( wd_path == NULL )
-                        rc = RC ( rcKFG, rcMgr, rcAccessing, rcMemory, rcExhausted );
-                    else
-                    {
-                        /* the working directory already has a canonical path */
-                        rc = KDirectoryResolvePath ( wd, true, wd_path, path_size, "." );
-                        if ( rc == 0 )
-                        {
-                            size_t wd_size = string_size ( wd_path );
-
-                            /* look for all protected user repositories */
-                            uint32_t i, count = VectorLength ( & v );
-                            for ( i = 0; i < count; ++ i )
-                            {
-                                const KRepository *r = ( const void* ) VectorGet ( & v, i );
-                                if ( r -> subcategory == krepProtectedSubCategory )
-                                {
-                                    rc_t rc2 = 0;
-                                    size_t resolved_size;
-                                    char *resolved = wd_path + path_size;
-
-                                    /* get stated root path to repository */
-                                    char *root = resolved + path_size;
-                                    rc2 = KRepositoryRoot ( r,
-                                        root, path_size, NULL );
-                                    if ( rc2 != 0 ) {
-                                        /* VDB-1096:
-                                        We cannot get repository root:
-                                        is it a bad repository configuration?
-                                        Then ignore this repository node
-                                        and try another repository */
-                                        continue;
-                                    }
-
-                                    /* get its canonical path */
-                                    rc = KSysDirRealPath ( sysDir, resolved, path_size, root );
-                                    if ( rc != 0 )
-                                        break;
-
-                                    /* we know the current directory's canonical path size
-                                       and we know the repository's canonical path size.
-                                       to be "within" the repository, the current directory's
-                                       size must be >= repository path size, and must match
-                                       exactly the repository path itself over those bytes. */
-                                    resolved_size = string_size ( resolved );
-                                    if ( resolved_size <= wd_size && memcmp ( wd_path, resolved, resolved_size ) == 0 )
-                                    {
-                                        /* still have a little more to check */
-                                        if ( resolved_size == wd_size ||
-                                             wd_path [ resolved_size ] == '/' )
-                                        {
-                                            /* we are in the repository */
-                                            rc = KRepositoryAddRef ( r );
-                                            if ( rc == 0 )
-                                                * protected = r;
-                                            break;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        free ( wd_path );
-                    }
-
-                    KDirectoryRelease ( wd );
-                }
-
-                KRepositoryVectorWhack ( & v );
-            }
-
-            if ( rc == 0 && * protected == NULL )
-                rc = RC ( rcKFG, rcMgr, rcAccessing, rcNode, rcNotFound );
-        }
-    }
-
-    return rc;
-}
-
-/* GetProtectedRepository
- *  retrieves a user protected repository by its associated project-id
- */
-KFG_EXTERN rc_t CC KRepositoryMgrGetProtectedRepository ( const KRepositoryMgr *self, 
-    uint32_t projectId, 
-    const KRepository **protected )
-{
-    rc_t rc;
-
-    if ( protected == NULL )
-        rc = RC ( rcKFG, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcKFG, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            char repNodeName[512] = "";
-            size_t numWrit = 0;
-            KRepositoryVector v;
-            rc = string_printf(repNodeName, sizeof repNodeName, &numWrit, "dbgap-%u", projectId); /* go case-insensitive */
-            assert(numWrit < sizeof(repNodeName));
-            
-            rc = KRepositoryMgrUserRepositories ( self, & v );
-            if ( rc == 0 )
-            {  /* look for all protected user repositories */
-                uint32_t i, count = VectorLength ( & v );
-                for ( i = 0; i < count; ++ i )
-                {
-                    const KRepository *r = ( const void* ) VectorGet ( & v, i );
-                    if ( r -> subcategory == krepProtectedSubCategory )
-                    {
-                        char localName[512] = "";
-                        size_t localNumWrit = 0;
-                        KRepositoryName(r, localName, sizeof(localName), &localNumWrit);
-                        assert(localNumWrit < sizeof(localName));
-                        if (strcase_cmp(repNodeName, numWrit, localName, localNumWrit, sizeof(localName)) == 0)
-                        {
-                            rc = KRepositoryAddRef ( r );
-                            if ( rc == 0 )
-                            {
-                                * protected = r;
-                                KRepositoryVectorWhack(&v);
-                                return 0;
-                            }
-                        }
-                    }
-                }
-                KRepositoryVectorWhack(&v);
-                rc = RC ( rcKFG, rcMgr, rcAccessing, rcNode, rcNotFound );
-            }
-        }
-    }
-
-    return rc;
-}    
diff --git a/libs/kfs/Makefile b/libs/kfs/Makefile
deleted file mode 100644
index 12237b2..0000000
--- a/libs/kfs/Makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kfs
-
-INT_LIBS = \
-	libkfs
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# kfs
-#
-$(ILIBDIR)/libkfs: $(addprefix $(ILIBDIR)/libkfs.,$(ILIBEXT))
-
-$(ILIBDIR)/libkfs-nommap: $(addprefix $(ILIBDIR)/libkfs-nommap.,$(LIBX))
-
-KFS_CMN = \
-	directory \
-	arrayfile \
-	file \
-	sysdir \
-	sysfile \
-	sysmmap \
-	syslockfile \
-	sysdll \
-	gzip \
-	bzip \
-	md5 \
-	crc32 \
-	arc \
-	toc \
-	tocentry \
-	tocdir \
-	tocfile \
-	sra \
-	tar \
-	teefile \
-	buffile \
-	buffile-read \
-	buffile-write \
-	subfile \
-	nullfile \
-	countfile \
-	dir_test \
-	pagefile \
-	pmem \
-	readheadfile \
-	ramfile \
-	quickmount \
-	report \
-	lockfile \
-	syslockfile \
-	cacheteefile
-
-KFS_SRC = \
-	mmap \
-	$(KFS_CMN)
-
-
-KFS_OBJ = \
-	$(addsuffix .$(LOBX),$(KFS_SRC))
-
-KFS_LIB = \
-	-dkproc \
-	-dklib \
-	-ddl \
-	-dz \
-	-dbz2
-
-$(ILIBDIR)/libkfs.$(LIBX): $(KFS_OBJ)
-	$(LD) --slib -o $@ $^ $(KFS_LIB)
-
-
-#-------------------------------------------------------------------------------
-# kff
-#
-ifeq (linux,$(OS))
-$(ILIBDIR)/libkff: $(addprefix $(ILIBDIR)/libkff.,$(ILIBEXT))
-else
-$(ILIBDIR)/libkff:
-	@ echo "not building libkff on "$(OS)
-endif
-
-KFF_SRC = \
-	fileformat \
-	ffext \
-	ffkey \
-	ffmagic
-
-KFF_OBJ = \
-	$(addsuffix .$(LOBX),$(KFF_SRC))
-
-KFF_LIB = \
-	-dkfg \
-	-dklib
-
-ifneq (win,$(OS))
-	KFF_LIB += -lmagic
-endif
-
-$(ILIBDIR)/libkff.$(LIBX): $(KFF_OBJ)
-	$(LD) --slib -o $@ $^ $(KFF_LIB)
diff --git a/libs/kfs/arc.c b/libs/kfs/arc.c
deleted file mode 100644
index 1779673..0000000
--- a/libs/kfs/arc.c
+++ /dev/null
@@ -1,4019 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include "karc-priv.h"
-#include "toc-priv.h"
-
-#include <kfs/arc.h>
-
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/pbstree.h>
-#include <klib/text.h>
-#include <klib/sort.h>
-#include <klib/printf.h>
-#include <klib/klib-priv.h> /* ReportRecordZombieFile */
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/toc.h>
-#include <kfs/sra.h>
-
-#include <sysalloc.h>
-
-#include <atomic32.h>
-#include <os-native.h>
-
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* SHOULD NOT INCLUDE THESE DIRECTLY */
-#include <fcntl.h>
-#include <sys/stat.h>
-
-const char * get_mode_string (KCreateMode mode);
-/* defined in dir_test.c */
-
-extern const char *gRCModule_str[];
-extern const char *gRCTarget_str[];
-extern const char *gRCContext_str[];
-extern const char *gRCObject_str[];
-extern const char *gRCState_str[];
-#define _LOG_RC(level,rc)	PLOGMSG(( level,			\
-					  "Return Code:: $(M):$(T):$(C):$(O):$(S)", \
-					  PLOG_5(PLOG_U32(M),PLOG_U32(T),PLOG_U32(C),PLOG_U32(O),PLOG_U32(S)), \
-					  GetRCModule(rc),		\
-					  GetRCTarget(rc),		\
-					  GetRCContext(rc),		\
-					  GetRCObject(rc),		\
-					  GetRCState(rc)))
-#define LOG_RC(level,rc)	PLOGMSG(( level,			\
-					  "Return Code:: $(M):$(T):$(C):$(O):$(S)", \
-					  PLOG_5(PLOG_S(M),PLOG_S(T),PLOG_S(C),PLOG_S(O),PLOG_S(S)), \
-					  gRCModule_str[GetRCModule(rc)], \
-					  gRCTarget_str[GetRCTarget(rc)], \
-					  gRCContext_str[GetRCContext(rc)], \
-					  (GetRCObject(rc)<rcLastTarget_v1_0)? \
-					  gRCTarget_str[GetRCObject(rc)]: \
-					  gRCObject_str[1+GetRCObject(rc)-rcLastTarget_v1_0], \
-					  gRCState_str[GetRCState(rc)]))
-/* #define LOG_RC(level,rc)	\ */
-/*     PLOGMSG(( level, "m $(R)",PLOG_S(R),gRCModule_str[GetRCModule(rc)])),	\ */
-/* 	PLOGMSG(( level, "t $(R)",PLOG_S(R),gRCTarget_str[GetRCTarget(rc)])), \ */
-/* 	PLOGMSG(( level, "c $(R)",PLOG_S(R),gRCContext_str[GetRCContext(rc)])), \ */
-/* 	PLOGMSG(( level, "o $(R)",PLOG_S(R),(GetRCObject(rc)<rcLastTarget_v1_0)? \ */
-/* 		  gRCTarget_str[GetRCObject(rc)]:			\ */
-/* 		  gRCObject_str[1+GetRCObject(rc)-rcLastTarget_v1_0])), \ */
-/* 	PLOGMSG(( level, "s $(R)",PLOG_S(R),gRCState_str[GetRCState(rc)])) */
-
-
-#ifdef _DEBUGGING
-#define FUNC_ENTRY() DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_ARCENTRY), ("Enter: %s\n", __func__))
-#define KFF_DEBUG(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_ARC), msg)
-#else
-#define FUNC_ENTRY()
-#define KFF_DEBUG(msg)
-#endif
-
-
-/* ----------------------------------------------------------------------
- * 
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KDIR_IMPL struct KArcDir
-#define KFILE_IMPL struct KArcFile
-#include <kfs/impl.h>
-
-static rc_t KArcDirResolvePathNode (const KArcDir *self,
-                                    enum RCContext ctx,
-                                    const char *path,
-                                    bool follow_sym_link,
-                                    const KTocEntry ** pnode,
-                                    KTocEntryType * ptype);
-
-
-
-/* ======================================================================
- * Defines relevant to the whole compilation unit.
- */
-/* arbitrary number that was originially set much much higher than expected needs. */
-#define	KARC_LINK_RESOLVE_LOOPMAX		(16)
-
-/* -----
- * We use MAX_PATH if it is available but not religiously.  We handle most
- * buffer over-runs with in the module only truncating paths at the border
- * of the module where KDirectory doesn't handle path's longer than MAX_PATH
- */
-#ifdef MAX_PATH
-#define	KARC_DEFAULT_PATH_ALLOC			(MAX_PATH)
-#else
-#define	KARC_DEFAULT_PATH_ALLOC			(4096)
-#endif
-
-
-
-
-
-/* ======================================================================
- * KArcDirIterator
- *
- * This very simple iterator steps in order through the nodes of the binary
- * search tree that is a "directory" in a KToc and thus steps through the
- * list of elements in a directory.  Only the name is made available at each
- * step.  That worked better for sysdir than arcdir from where this was 
- * borrowed (it was called SysDirEnum there)
- *
- * It is primarily used to build a directory listing.
- *
- * This iterator is a once through iterator.  Whack must be called after Init
- * or a dangling reference is left open.  Init can be called again but only if 
- * Whack was indeed called.
- *
- * NOTE:
- * This class unlike most in the KFS system is built in place and is not
- * constructed by default allocating memory in the constructor.
- * This means it can not be truly opaque as the structure of the base struct
- * has to be exposed so it can be created.
- */
-
-
-/*--------------------------------------------------------------------------
- * KArcDirIterator
- *
- * a ArcDir directory enumerator/iterator getting the names of elements in
- * the TOC.
- *
- * const KToc *	  toc		a keep alive so the BSTree won't go
- *					away in the middle
- * union                  u		A union to allow pointers to base and
- *					derivative class
- *					without casting
- *   const BSTNode * 	  bnp		point to a node as a BSTNode
- *   const KTocEntry *  tnp		point to a node as a KTocEntry
- * bool                   isFirst;	upon creation this flag is set to true;
- *					set to false the first next call
- */
-typedef struct KArcDirIterator 	
-{
-    const KToc *		toc;	/* a keep alive so the BSTree won't go away in the middle */
-    union
-    {
-	const BSTNode * 	bnp;	/* point to a node as a BSTNode */
-	const KTocEntry *	tnp;	/* point to a node as a KTocEntry */
-    }			u;
-    bool isFirst;	/* upon creation this flag is set to true; set to false the first next call */
-} KArcDirIterator;
-
-
-/* ----------------------------------------------------------------------
- * KArcDirIteratorWhack
- * 	The Object destructor
- * [INOUT] KArcDirIterator *self	Iterator self reference: object oriented in C
- */
-static
-void KArcDirIteratorWhack (KArcDirIterator *self)
-{
-    KTocRelease (self->toc);
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirIteratorInit
- * 
- * The object constructor
- *
- * [OUT] KArcDirIterator *	self		Iterator self reference: object oriented in C
- * [IN]  const KArcDir * 	arcdir		A directory that contains beneath it (or as it)
- *						the directory to be iterated.
- * [IN]	 const char * 		path		The directory to be iterated as referenced from
- *						arcdir.
- *
- * To iterate arcdir use a path of ".".
- */
-static
-rc_t KArcDirIteratorInit (KArcDirIterator *self, const KArcDir * arcdir, 
-                          const char * path)
-{
-    const BSTree * 	tree;
-    const KTocEntry * node;
-    const KToc *	toc;
-    KTocEntryType	type;
-    rc_t		rc;
-
-    /* is self parameter possibly bad? */
-    if (self == NULL)
-    {
-        return RC (rcFS, rcDirectory, rcConstructing, rcSelf, rcNull);
-    }
-
-    self->toc = NULL;
-    self->isFirst = true;	/* warning squelcher ? that breaks type opacity */
-    self->u.bnp = NULL;
-
-    /* is another parameter possibly bad? */
-    if ((path == NULL)||(arcdir == NULL))
-    {
-	return RC (rcFS, rcDirectory, rcConstructing, rcParam, rcNull);
-    }
-    if (KArcDirGetTOC(arcdir,&toc) != 0)
-    {
-	return RC (rcFS, rcDirectory, rcConstructing, rcParam, rcNotFound);
-    }
-    self->toc = toc;
-    KTocAddRef(toc);
-    /* get the KTocEntry from which all things are possible */
-    rc = KArcDirResolvePathNode (arcdir, rcConstructing, path, true, &node, &type);
-    if (rc != 0)
-    {
-    }
-    else if ((type == ktocentrytype_dir) || (type == ktocentrytype_hardlink))
-    {
-	rc = KTocEntryGetBSTree (node, &tree);
-	if (rc == 0)
-	{
-	    /* success */
-	    self->u.bnp = BSTreeFirst(tree);
-	    return 0;
-	}
-    }
-    else
-    {
-	rc = RC (rcFS, rcDirectory, rcConstructing, rcParam, rcInvalid);
-    }
-    /* failure */
-    KTocRelease (self->toc);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirIteratorNext
- *
- * Go to the next node (or the first node if the iterator has not been used.
- *
- * [RET]   const char * 			The return is the name of the next element
- * [INOUT] KArcDirIterator *	self		Iterator self reference: object oriented in C
- */
-static const char * KArcDirIteratorNext (KArcDirIterator *self)
-{
-    const char * name;
-
-    assert (self != NULL);
-
-    /* -----
-     * The initialization put the first node's address into the pointer
-     * so do do nothing about the pointer before using it except say we
-     * need to update it next time.
-     */
-    if (self->isFirst)
-    {
-	self->isFirst = false;
-    }
-    /* -----
-     * After the first time we need to bump the pointer until it can't be bumped.
-     */
-    else	
-    {
-	/* -----
-	 * It's not specified in klib/container.h but BSTNodeNext
-	 * returns NULL at end of tree
-	 */
-	self->u.bnp = BSTNodeNext (self->u.bnp);
-    }
-
-    /* -----
-     * The first test isn't necesary so letting KTocEntryGetName return NULL
-     * could be used instead of the extra check.
-     * Checking against NULL adds a little to each call while not checking
-     * adds more but only to the last call.
-     * Pick your poison.
-     */
-    if ((self->u.bnp == NULL) || (KTocEntryGetName (self->u.tnp, &name) != 0))
-    {
-	return NULL;
-    }
-    return name;
-}
-
-
-/* ======================================================================
- */
-typedef struct KArcListing KArcListing;
-
-#define KNAMELIST_IMPL struct KArcListing
-#include <klib/impl.h>
-
-/*--------------------------------------------------------------------------
- * KArcListing
- *  a directory listing
- *
- * NOTE:
- * This is nearly identical to KSysDirListing but both are currently private to
- * their compilation units.
- */
-struct KArcListing
-{
-    KNamelist     dad;      /* base class */
-    const char ** namelist; /* pointer to a malloced array of pointers to names */
-    int           cnt;      /* specific size chosen by compiler for efficiency */
-};
-
-
-/* ----------------------------------------------------------------------
- * KArcListingWhack
- *
- * Class destructor
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT] const KArcListing* self		Listing self reference: object oriented in C
- */
-static
-rc_t CC KArcListingWhack (const KArcListing *self)
-{
-    int ix;
-    for ( ix = 0; ix < self->cnt; ++ix )
-    {
-        free ( (void*)self->namelist[ix] );
-    }
-    free ( (void*)self->namelist );
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KArcListingDestroy
- * Class destructor
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT] KArcListing *	self		Listing self reference: object oriented in C
- */
-static
-rc_t CC KArcListingDestroy (KArcListing *self)
-{
-    rc_t rc = KArcListingWhack (self);
-    if (rc == 0)
-        free (self);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcListingCount
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcListing *	self		Listing self reference: object oriented in C
- * [OUT] uint32_t *		count		Where to put the count of names
- */
-static rc_t CC KArcListingCount (const KArcListing *self, uint32_t *count)
-{
-    *count = self->cnt;
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcListingGet
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcListing *	self		Listing self reference: object oriented in C
- * [IN]  uint32_t		idx		?
- * [OUT] const char **		name		Where to put the name
- */
-static rc_t CC KArcListingGet (const KArcListing *self, uint32_t idx, const char **name)
-{
-    if (idx >= (uint32_t)self->cnt)
-	return RC (rcFS, rcNamelist, rcAccessing, rcParam, rcExcessive);
-    * name = self -> namelist [ idx ];
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcListingSort
- *
- * This function has the signature needed to use with the NameList base class for
- * KArcListings to determine the order of two names.  Matches the signature of
- * strcmp() and other functions suitable for use by qsort() and others
- *
- * [RET] int					0:  if a == b 
- *						<0: if a < b
- *						>0: if a > b
- * [IN] const void *		a
- * [IN] const void *		b
- *
- * Elements are typed as const void * to match the signature needed for 
- * a call to qsort() but they should be pointers to namelist elements
- */
-static int CC KArcListingSort (const void *a, const void *b, void * ignored)
-{
-    return strcmp (*(const char**)a, *(const char**)b);
-}
-
-static KNamelist_vt_v1 vtKArcListing =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KArcListingDestroy,
-    KArcListingCount,
-    KArcListingGet
-    /* end minor version 0 methods */
-};
-
-
-/* ----------------------------------------------------------------------
- * KArcListingInit
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT] KArcListing *	self		Listing self reference: object oriented in C
- * [IN]    const char *		path		?
- * [IN]    const KDirectory *	dir		?
- * [IN]    bool (* 		f	)(const KDirectory*, const char*, void*),
- *						This is a filter function - any listing element
- *						passed to this function will generate a true ot
- *						a false.  If flase that listing element is dropped.
- *						If this parameter is NULL all elements are kept.
- * [IN]	   void *		data		Ignored.  May use NULL if permitted
- *						by 'f'.
- */
-static rc_t KArcListingInit (KArcListing *self,
-                             const char *path,
-                             const KDirectory *dir,
-                             bool (CC* f) (const KDirectory*, const char*, void*),
-                             void *data)
-{
-    rc_t rc;
-
-    /* is self parameter possibly NULL? */
-    if (self == NULL)
-    {
-	return  RC (rcFS, rcDirectory, rcConstructing, rcSelf, rcNull);
-    }
-
-    /* start with an empty name list */
-    self->namelist = NULL;
-    self->cnt = 0;
-
-    /* initialize the Namelist base class */
-    if ((rc = KNamelistInit (& self -> dad,
-			     (const KNamelist_vt*)&vtKArcListing)) == 0)
-    {
-	/* -----
-	 * so we'll build a list iterator
-	 */
-	KArcDirIterator listitr;
-
-	if ((rc = KArcDirIteratorInit (& listitr, (const KArcDir*)dir, path)) == 0)
-	{
-
-#define	LEN_INCREMENT	(512)
-
-	    uint32_t len = LEN_INCREMENT;
-
-	    /* allocate heap for the default start size of a namelist */
-
-	    self->namelist = malloc (len * sizeof (self->namelist[0]));
-	    if (self->namelist == NULL)
-	    {
-		rc = RC (rcFS, rcDirectory, rcListing, rcMemory, rcExhausted);
-	    }
-	    else
-	    {
-		void *r;
-		const char *name;
-
-		/* -----
-		 * loop through the directory (the BSTree for a Archive TOC)
-		 */
-		while ((name = KArcDirIteratorNext (&listitr)) != NULL)
-		{
-		    /* if there is a filter function, run it */
-		    if (f != NULL)
-		    {
-			/* skip if the filter doesn't say use it */
-			if (! (*f) (dir, name, data))
-			    continue;
-		    }
-		    
-		    /* if the buffer is full, reallocate it larger */
-		    if (self->cnt == len)
-		    {
-			len += LEN_INCREMENT;
-			if ( NULL == ( r = realloc ( (void*)self -> namelist,
-						   len * sizeof self -> namelist [ 0 ] ) ) )
-			{
-			    /* -----
-			     * malloc failure so we fail too  - break not return so we can 
-			     * free allocated memory
-			     */
-			    rc = RC (rcFS, rcDirectory, rcListing, rcMemory, rcExhausted);
-			    break;
-			}
-			self->namelist = r;
-		    }
-		    
-		    /* get ourselves memory for the name */
-		    self->namelist[self->cnt] = malloc (strlen (name) + 1);
-		    if (self->namelist[self->cnt] == NULL)
-		    {
-			/* oops a failure so we fail */
-			rc = RC (rcFS, rcDirectory, rcListing, rcMemory, rcExhausted);
-			break;
-		    }
-		    strcpy ((char*)self->namelist[self->cnt], name);
-		    ++self->cnt;
-		}
-		
-		if (rc == 0)
-		{
-		    /* -----
-		     * now that we have our list and know how big it should have been we'll shrink it
-		     * if the count was zero this a effectively just a free()
-		     */
-		    r = realloc ( ( void* )self->namelist,
-				          self->cnt * sizeof ( self->namelist[0] ) );
-		    /* -----
-		     * if we have a new non-NULL pointer we know we have a list of non-zero length
-		     * store the pointer and sort the list
-		     */
-		    if (r != NULL)
-		    {
-			self -> namelist = r;
-			ksort ((void*)r, self -> cnt, sizeof self -> namelist [ 0 ], KArcListingSort, NULL);
-		    }
-		    /* -----
-		     * If we have a NULL pointer but have a non-zero count, we have a malloc() heap
-		     * space failure
-		     */
-		    else if (self -> cnt != 0)
-		    {
-			rc = RC (rcFS, rcDirectory, rcListing, rcMemory, rcExhausted);
-		    }
-		    /* -----
-		     * Or we have a NULL pointer and a count of zero so stow the NULL so its not
-		     * a dangling bad pointer
-		     */
-		    else
-		    {
-			self->namelist = r;
-		    }
-		}
-		/* if we got here because of a problem, kill the listing */
-		if (rc != 0)
-		{
-		    KArcListingWhack (self);
-		    self->namelist = NULL;
-		    self->cnt = 0;
-		}
-	    }
-	    /* we're done with the iterator so kill it */
-	    KArcDirIteratorWhack (&listitr);
-	}
-    }
-    return rc;
-}
-
-
-/* ======================================================================
- */
-
-/*--------------------------------------------------------------------------
- * KArcDir
- *  a directory inside an archive (tar or SRA for example)
- *
- * This type is being engineered to mimic KSysDir.
- */
-struct KArcDir
-{
-    KDirectory		dad;					/* parent class as in inheritance */
-
-    const KDirectory *  parent;					/* parent object */
-    const KToc *	toc;					/* table of contents class */
-    const KTocEntry *	node;					/* table of contents entry NULL for top level */
-    KArcFSType	arctype;
-    union
-    {
-	const void *		v;
-	const KFile *		f;
-	const KDirectory * 	d;
-    } archive;
-
-    uint32_t	  	root;					/* offset of / in path to treat as root */
-    uint32_t 	  	size;					/* length of path */		
-    char 	  	path	 [KARC_DEFAULT_PATH_ALLOC];	/* name of archive = mount point */
-   
-/* actual allocation is based on actual string length */
-};
-
-static rc_t KArcDirMake (KArcDir ** self,
-                         enum RCContext ctx,
-                         const KDirectory * parent,
-                         const KToc * toc,
-                         const KTocEntry * node,
-                         const void * archive,
-                         KArcFSType baseType,
-                         uint32_t dad_root,
-                         const char *path,
-                         uint32_t path_size,
-                         bool update, /* ignored */
-                         bool chroot);
-
-
-/* ----------------------------------------------------------------------
- * KArcDirDestroy
- */
-static rc_t CC KArcDirDestroy (KArcDir *self)
-{
-    if (self->toc != NULL)
-	KTocRelease (self->toc);
-    if (self->archive.v != NULL)
-	switch (self->arctype)
-	{
-	default:
-	    free ((void*)self->archive.v);
-	    break;
-	case tocKFile:
-	    KFileRelease (self->archive.f);
-	    break;
-	case tocKDirectory:
-	    KDirectoryRelease (self->archive.d);
-	    break;
-	}
-    free (self);
-
-    return 0;
-}
-
-
-
-/* ----------------------------------------------------------------------
- * KArcDirCanonPath
- *
- * In this context CanonPath means to make the path a pure /x/y/z with no back tracking 
- * by using ~/../~ or redundant ~/./~ or ~//~ here notations.  Not exactly the usage of 
- * canonical in describing a path in other places but consistent within KFS.  It matches
- * the common meaning of canonical path as the one true path except that processing out
- * of sym links isn't done here but would normally have been.  Not processing the 
- * links means potentially more than one canonical path can reach the same target 
- * violating the usual meaning of canonical path as the one true shortest path to any
- * element.
- *
- * const KArcDir *		self		Object oriented C; KArcDir object for this method
- * enum RCContext 		ctx
- * char * 			path
- * size_t			psize
- */
-static
-rc_t		KArcDirCanonPath	(const KArcDir *self,
-					 enum RCContext ctx,
-					 char *path,
-					 size_t psize)
-{
-    char *	low;	/* a pointer to the root location in path; not changed after initialization */
-    char *	dst;	/* a target reference for compressing a path to remove . and .. references */
-    char *	last;	/* the end of the last processed facet of the path */
-    char *	end;	/* absolute end of the incoming path */
-    char * 	src;	/* the start of the current facet to be processed */
-
-    /* end is the character after the end of the incoming path */
-    end = path + psize;
-
-    /* point all other temp pointers at the root point in the incoming path */
-    last = path + self->root;
-
-    /* handle windows / / network path starter */
-    if ((last == path) && (last[0] == '/') && (last[1] == '/'))
-      last ++;
-
-    low = dst = last;
-
-    for (;;)
-    {
-
-	/* point at the first / after the most recent processed facet */
-	src = strchr (last + 1, '/');
-	if (src == NULL)	/* if no '/' point to the end */
-	    src = end;
-
-	/* detect special sequences */
-	switch (src - last)
-	{
-	case 1: /* / / (with nothing between) is a superflouous / hurting us to parse later;
-		 * /. is a here reference to the same directory as the previous */
-	    if ((last[1] == '/')||(last[1] == '.'))
-	    {
-		/* skip over */
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-	case 2: /* /./ is a "here" reference point and is omitted by not copying it over */
-	    if (last[1] == '.')
-	    {
-		/* skip over */
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-
-	case 3: /* /../ is a up one directory and is processed by deleting the last facet copied */
-	    if (last [1] == '.' && last [2] == '.')
-	    {
-		/* remove previous leaf in path */
-		dst [ 0 ] = 0;
-		dst = strrchr (path, '/');
-		/* can't up a directory past the root */
-		if (dst == NULL || dst < low)
-		{
-		    return RC (rcFS, rcDirectory, ctx, rcPath, rcInvalid);
-		}
-
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-	}
-
-	/* if rewriting, copy leaf */
-	if (dst != last)
-	{
-	    memmove (dst, last, src - last);
-	}
-
-	/* move destination ahead */
-	dst += src - last;
-        
-	/* if we're done, go */
-	if (src == end)
-	    break;
-
-	/* find next separator */
-	last = src;
-    }
-
-    /* NUL terminate if modified */
-    if (dst != end)
-	* dst = 0;
-
-    /* say we did did it with no problems */
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirMakePath
- *
- *  creates a full path from partial
- *
- * [IN]  const KArcDir *	self	object oriented self
- * [IN]  enum RCContext		ctx	a hint for context in building
- *					an error return rc_t
- * [IN]  bool			canon	Should the output be made 
- *					canonical per KDirectory's
- *					definition of canonical
- * [OUT] char **		pbuffer The output path
- * [IN]  const char *		path	The input path
- * [IN]  va_list		args	Possible additions to path
- */
-static
-rc_t KArcDirMakePath (const KArcDir *self,
-		      enum RCContext ctx,
-		      bool canon,
-		      char ** pbuffer,
-		      const char *path,
-		      va_list args)
-{
-    int    psize;	/* 'printed' size - output from vsnprintf */
-    size_t asize;	/* allocated buffer size */
-    size_t bsize;	/* base size */
-    char * buffer;
-
-    /* -----
-     * Validate parameters and fail if unusable
-     */
-    assert (path != NULL);
-    assert (pbuffer != NULL);
-
-    if (path == NULL)
-    {
-	return RC (rcFS, rcDirectory, ctx, rcPath, rcNull);
-    }
-    if (path[0] == 0)
-    {
-	return RC (rcFS, rcDirectory, ctx, rcPath, rcInvalid);
-    }
-
-    buffer = NULL;
-    asize = KARC_DEFAULT_PATH_ALLOC;
-    for (;;)
-    {
-	/* -----
-	 * allocate a buffer of the default size or a better size determined below
-	 */
-	buffer = realloc (buffer, asize);
-	*pbuffer = buffer;
-	if (buffer == NULL)
-	{
-	    return RC (rcFS, rcDirectory, rcAllocating, rcPath, rcExhausted);
-	}
-	/* -----
-	 * inherited from linux/sysdir.c
-	 *
-	 * if path starts with % we build something out of va_list?
-	 *
-	 * use vsnprintf (printf to string with size limit and argument list
-	 *	pointer instead of a list of arguments:
-	 * build path to buffer using a path that is a printf format string
-	 * with a requirement that the first thing in the format be a format inducing %
-	 */
-	if ((args != NULL) && (path[0] == '%'))
-	{
-	    psize = vsnprintf (buffer, asize, path, args);
-
-	    /* -----
-	     * decoding of path failed due a failure of printf
-	     * <0 is an unspecified failure unspecified (check errno?)
-	     */
-	    if (psize < 0)
-		return RC (rcFS, rcDirectory, ctx, rcPath, rcUnknown);
-
-	    /* -----
-	     * decoding of path failed due to length truncation
-	     * try to realloc using a larger size
-	     */
-	    if ( (size_t)psize >= asize )
-	    {
-		asize = psize;
-		continue;
-	    }
-
-	    /* -----
-	     * maybe the decoded path is a relative partial path
-	     */
-	    if (buffer[0] != '/')
-	    {
-		/* -----
-		 * if our KArcDir self has a mount point self->path of length more than 0
-		 * but that length isn't too long to prepend it to the derived path than
-		 * move the derived path over making room for the KArcDir base path and 
-		 * then insert that base at the beginning
-		 */
-		bsize = self->size;
-		if (bsize + psize >= asize)
-		{
-		    asize = bsize + psize;
-		    continue;
-		}
-		/* make room */
-		memmove (buffer + self->size, buffer, psize+1);
-		/* fail if the kDirectory path doesn't end in /? (inherited) */
-		assert (self->path[bsize-1] == '/');
-		/* prepend self's path */
-		memcpy (buffer, self->path, bsize);
-	    }
-
-	    /* -----
-	     * or maybe we have a path base for the KArcDir
-	     */
-	    else if ((bsize = self->root) != 0)
-	    {
-		/* -----
-		 * if we got a full path from the decoding do the same thing but only the
-		 * amount of the self's path that is up to an effective "chroot" point
-		 */
-		if (bsize + psize >= asize)
-		{
-		    asize = bsize + psize;
-		    continue;
-		}
-		memmove (buffer + self->size, buffer, psize+1);
-		assert (self->path [bsize-1] != '/');
-		memcpy (buffer, self -> path, bsize);
-	    }
-	    /* -----
-	     * or maybe the new path is cool as is.  unlikely?
-	     */
-	}
-	else
-	{
-	    /* -----
-	     * copy a partial/relative  path parameter into the buffer leaving room for the
-	     * self's base path
-	     */
-	    if (path[0] != '/')
-	    {
-		assert (self->path[self->size - 1] == '/');
-		memcpy (buffer, self->path, bsize = self->size);
-	    }
-	    /* -----
-	     * copy the pre-root portion of the self's path into the buffer
-	     */
-	    else if ((bsize = self->root) != 0)
-	    {
-		assert (self->path[bsize-1] != '/');
-		memcpy (buffer, self->path, bsize);
-	    }
-
-	    /* -----
-	     * okay use snprintf to append the incoming path into the buffer after the
-	     * self's base or root either using a simple string format or again assuming
-	     * that the path has printf format symbols if there are arguments in the
-	     * va_list
-	     */
-	    if (args == NULL)
-		psize = snprintf (buffer+bsize, asize-bsize, "%s", path);
-	    else
-		psize = vsnprintf (buffer+bsize, asize-bsize, path, args);
-
-	    /* -----
-	     * decoding of path failed due a failure of printf
-	     * <0 is an unspecified failure unspecified (check errno?)
-	     */
-	    if (psize < 0)
-		return RC (rcFS, rcDirectory, ctx, rcPath, rcUnknown);
-
-	    /* -----
-	     * decoding of path failed due to length truncation
-	     * try to realloc using a larger size
-	     */
-	    if (bsize+psize >= asize)
-	    {
-		asize = bsize+psize;
-		continue;
-	    }
-	}
-	break;
-    }
-    /* -----
-     * if the last character is a '/' get rid of it?
-     */
-    if (buffer[bsize+psize] == '/')
-	buffer[bsize+(--psize)] = 0;
-
-    /* -----
-     * if the incoming path turns out to be a single character (I think) AND
-     * we either have the canon flag set or if the the KArcDir root is not empty
-     * "canonize" it.
-     */
-    if (canon || (self->root != 0))
-    {
-	return KArcDirCanonPath (self, ctx, *pbuffer, bsize+psize);
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirList
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "."
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]	 const KArcDir *	self		Object oriented C; KArcDir object for this method
- * [OUT] KNamelist **		listp,
- * [IN]  bool (* 		f	)(const KDirectory*,const char *, void *)
- * [IN]  void *			data
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static
-rc_t CC KArcDirList (const KArcDir *self,
-                     KNamelist **listp,
-                     bool (CC* f) (const KDirectory *dir, const char *name, void *data),
-                     void *data,
-                     const char *path,
-                     va_list args)
-{
-    char * full_path;
-    rc_t rc;
-
-    rc = KArcDirMakePath (self, rcListing, true,
-			  &full_path, path, args);
-    if (rc == 0)
-    {
-	const KTocEntry * pnode;
-	KTocEntryType	type;
-	KArcDir * full_dir;
-
-	rc = KArcDirResolvePathNode(self, rcListing, full_path, true, &pnode, &type);
-	if (rc == 0)
-	{
-	    rc = KArcDirMake (&full_dir,
-			      rcListing,
-			      self->parent,
-			      self->toc,
-			      pnode,
-			      self->archive.v,
-			      self->arctype,
-			      self->root,
-			      full_path,
-			      (uint32_t)strlen(full_path),
-			      false, 
-			      0);
-	    if (rc == 0)
-	    {
-		KArcListing *list = malloc (sizeof *list);
-
-		if (list == NULL)
-		{
-		    rc = RC (rcFS, rcDirectory, rcListing, rcMemory, rcExhausted);
-		}
-		else
-		{
-		    rc = KArcListingInit (list,
-					  full_dir->path,
-					  &full_dir->dad,
-					  f,
-					  data);
-
-		    if (rc != 0)
-		    {
-			free (list);
-		    }
-		    else
-		    {
-			*listp = &list->dad;
-		    }
-		}
-		KArcDirDestroy (full_dir);
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirFullPathType
- *
- * Get the KDirectory defined KPathType for whatever is referred to 
- * by path that is accessible through the KArcDir self.  The path's
- * root is based on self's root (?) and a relative path is relative to 
- * self.
- *
- * [RET] uint32_t			actually this is enum KPathType
- * [IN]  const KArcDir *	self	base KDirectory for the call to
- *					find the type of path
- * [IN]  const char * 		path	what path of which to type the
- *					last facet
- */
-static
-uint32_t KArcDirFullPathType (const KArcDir *self, const char * path)
-{
-    const KTocEntry * node;
-    const char *	local_path = path;
-    KTocEntryType	type;
-    uint32_t		tt = 0;
-    int			loopcount;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (path != NULL);
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-        rc = KArcDirResolvePathNode (self,
-            rcConstructing, local_path, false, &node, &type); 
-        if (rc != 0)
-        {
-            /* TODO: filter rc into kptBadPath or kptNotFound... */
-            return (tt | kptNotFound);
-        }
-        switch (type)
-        {
-        default:
-            return kptBadPath;
-
-        case ktocentrytype_unknown:
-            return kptBadPath;
-
-        case ktocentrytype_hardlink:
-            return kptDir;
-
-        case ktocentrytype_dir:
-            return tt | kptDir;
-
-        case ktocentrytype_file:
-        case ktocentrytype_emptyfile:
-            return tt | kptFile;
-
-        case ktocentrytype_chunked:
-            return tt | kptFile;
-
-        case ktocentrytype_softlink:
-            tt = kptAlias;
-            if (KTocEntryGetSoftTarget(node,&local_path) != 0)
-                return kptAlias|kptNotFound;
-            break;
-
-        case ktocentrytype_zombiefile:
-            PLOGMSG (klogWarn, (klogWarn,
-                "zombie file detected: '$(P)'", "P=%s", path));
-            ReportRecordZombieFile();
-            return tt | kptZombieFile;
-
-        }
-    }
-    return kptBadPath;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirPathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- *
- * [RET] uint32_t
- * [IN]  const KArcDir *	self		Object oriented C; KArcDir object for this method
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static uint32_t CC KArcDirPathType (const KArcDir *self, const char *path, va_list args)
-{
-    rc_t	rc;
-    uint32_t 	type;
-    char * 	full;
-
-    rc = KArcDirMakePath (self, rcAccessing, false, &full, path, args);
-
-    if (rc == 0)
-    {
-	type = KArcDirFullPathType (self, full);
-	free (full);
-    }
-    else
-    {
-	type = kptBadPath;
-    }
-    return type;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirVisitDir
- *
- * [IN] KArcDirVisitData *	pb
- */
-typedef struct KArcDirVisitData		
-{
-    rc_t   (CC* f )(const KDirectory*, uint32_t, const char*, void*);
-    void *      data;
-    KArcDir *   dir;
-    bool        recurse;
-} KArcDirVisitData;
-
-
-static
-rc_t KArcDirVisitDir(KArcDirVisitData *pb)
-{
-    /* get a directory listing */
-    KArcDirIterator 	listing;
-    rc_t		rc; 
-
-    assert (pb != NULL);
-
-    rc = KArcDirIteratorInit (&listing, pb->dir, pb->dir->path);
-    if (rc == 0)
-    {
-        const char * base;
-        const char * name;
-        char * full_name = NULL;
-        uint32_t 	size;
-
-        size = pb->dir->size;
-        base = pb->dir->path;
-
-        for(pb->dir->size = size, name = KArcDirIteratorNext (&listing);
-            name != NULL; name = KArcDirIteratorNext (&listing))
-        {
-            uint32_t len = (uint32_t)strlen (name);
-            free(full_name);
-            full_name = malloc(size + len + 1);
-
-            if(full_name == NULL) {
-                rc = RC (rcFS, rcDirectory, rcVisiting, rcMemory, rcExhausted);
-                break;
-            } else {
-                const KTocEntry *	pnode;
-                KTocEntryType		type;
-                /* -----
-                * build up the path from the base and the name
-                */
-                memcpy(full_name, base, size);
-                memcpy(full_name+size, name, len);
-                full_name[size+len] = 0;
-
-                rc = KArcDirResolvePathNode(pb->dir, rcVisiting, full_name,
-                                            true, &pnode, &type);
-                if(rc != 0) {
-                    break;
-                }
-                /* -----
-                * call the function per visit
-                */
-                /* type is wrong "type"  needs to be a kpt not karctoctype */
-                {
-                    uint32_t kptype;
-                    kptype = KArcDirFullPathType(pb->dir, full_name);
-                    rc = pb->f(&pb->dir->dad, kptype, name, pb->data);
-                }
-                if(rc != 0) {
-                    break;
-                }
-                if(pb->recurse && ((type == ktocentrytype_dir)||(type == ktocentrytype_hardlink))) {
-                    KArcDir * rdir;
-                    KArcDirVisitData rpb;
-
-                    rc = KArcDirMake(&rdir, rcVisiting, pb->dir->parent, pb->dir->toc,
-                                     pnode, pb->dir->archive.v, pb->dir->arctype, pb->dir->root,
-                                     full_name, (uint32_t)strlen ( full_name ), false, false);
-                    if(rc != 0) {
-                        break;
-                    }
-                    rpb.f = pb->f;
-                    rpb.data = pb->data;
-                    rpb.dir = rdir;
-                    rpb.recurse = pb->recurse;
-                    rc = KArcDirVisitDir(&rpb);
-                    KArcDirDestroy(rdir);
-                    if(rc != 0) {
-                        break;
-                    }
-                }
-            }
-        }
-        free(full_name);
-        KArcDirIteratorWhack (& listing);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirRelativePath
- *
- * KArcDirRelativePath
- *  makes "path" relative to "root"
- *  both "root" and "path" MUST be absolute
- *  both "root" and "path" MUST be canonical, i.e. have no "//", "/./" or "/../" sequences
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] const KArcDir *		self		Object oriented C; KArcDir object for this method
- * [IN] enum RCContext 		ctx
- * [IN] const char *		root
- * [IN] char *			path
- * [IN] size_t			path_max
- */
-static
-rc_t KArcDirRelativePath (const KArcDir *self, enum RCContext ctx,
-			  const char *root, char *path, size_t path_max)
-{
-    int backup;
-    size_t bsize, psize;
-
-    const char *r = root + self -> root;
-    const char *p = path + self -> root;
-
-    assert (r != NULL && r [ 0 ] == '/');
-    assert (p != NULL && p [ 0 ] == '/');
-
-    for (; * r == * p; ++ r, ++ p)
-    {
-	/* disallow identical paths */
-	if (* r == 0)
-	    return RC (rcFS, rcDirectory, ctx, rcPath, rcInvalid);
-    }
-
-    /* paths are identical up to "r","p"
-       if "r" is within a leaf name, then no backup is needed
-       by counting every '/' from "r" to end, obtain backup count */
-     for (backup = 0; * r != 0; ++ r)
-    {
-	if (* r == '/')
-	    ++ backup;
-    }
-
-    /* the number of bytes to be inserted */
-    bsize = backup * 3;
-
-    /* align "p" to last directory separator */
-    while (p [ -1 ] != '/') -- p;
-
-    /* the size of the remaining relative path */
-    psize = strlen (p);
-
-    /* open up space if needed */
-    if ( (size_t)(p - path) < bsize )
-    {
-	/* prevent overflow */
-	if (bsize + psize >= path_max)
-	    return RC (rcFS, rcDirectory, ctx, rcPath, rcExcessive);
-	memmove (path + bsize, p, psize);
-    }
-
-    /* insert backup sequences */
-    for (bsize = 0; backup > 0; bsize += 3, -- backup)
-	memcpy (& path [ bsize ], "../", 3);
-
-    /* close gap */
-    if ( (size_t)( p - path ) > bsize )
-	{
-		strcpy (& path [ bsize ], p);
-	}
-
-	return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirResolvePathNode
- *
- * Resolve a path to a KToc Node with a triple return type of
- * success/failure, KTocEntry to use to access the leaf of the path,
- * and the type of the node that could have been easily obtained from 
- * that node
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcDir *      self	OOP in C self/this pointer
- * [IN]  const char *         path	the path to resolve
- * [IN]  bool		      follow	Follow any links
- * [OUT] const KTocEntry ** pnode	a pointer that will point to the 
- *					ArcTOCNode for the path
- * [OUT] KTocEntryType *    ptype	Archive specific type for the
- *					entry matching path
- * TODO: Make this prettier for human readabilty by breaking out into sub-functions?
- */
-static
-rc_t	KArcDirResolvePathNode	(const KArcDir *	self,
-				 enum RCContext 	ctx,
-				 const char *		path,
-				 bool			follow,
-				 const KTocEntry ** 	pnode,
-				 KTocEntryType * ptype)
-{
-    rc_t		rc = 0;
-
-    assert (self != NULL);
-    assert (path != NULL);
-    assert (pnode != NULL);
-    assert (ptype != NULL);
-
-    *pnode = NULL;
-    *ptype = ktocentrytype_unknown;
-
-    if (path[0] == 0)
-    {
-	rc = RC (rcFS, rcDirectory, ctx, rcPath, rcInvalid);
-    }
-    else
-    {
-	/* -----
-	 * This loop is to replace recursive approaches to resolving sym links in 
-	 * the path.before the last facet.
-	 *
-	 * we used temp_path as an alias for path because we can "recur" by 
-	 * going through the loop iteratively instead of recursively changing
-	 * temp_path each time where we would have called this function again
-	 */
-	const char *	temp_path = path;	/* no alloc */
-	const KToc *	toc = self->toc;	/* no alloc */
-	char *		allocated_path = NULL;	/* alloc; must free{} */
-	char * 		abpath = NULL;		/* alloc; must free{} */
-
-	while(rc == 0) /* loop as long as no failures or until break */
-	{
-	    /* -----
-	     * clean up the path to its KFS canonical form
-	     */
-	    if (abpath != NULL)
-		free (abpath);
-	    rc = KArcDirMakePath (self, ctx, /* canon*/true, &abpath,
-				  temp_path, NULL);
-	    if (rc != 0)
-	    {
-		/* -----
-		 * If we couldn't "make the path" we'll just fail passing along
-		 * the fail reason from MakePath.
-		 */
-		break;	/* TODO fix rc context? Object? */
-	    }
-	    else
-	    {
-		const String * pathstring;
-
-		rc = KTocGetPath (toc, &pathstring);
-		/* -----
-		 * validate that this canonical path is in the TOC
-		 */
-		if (strncmp(abpath, pathstring->addr, pathstring->size) != 0)
-		{
-		    /* -----
-		     * This is a key return as it could be used to trigger a call to 
-		     * a containing "parent" KDirectory to try again outside of this KArcDir
-		     * be it another KArcDir, KSysDir, or other KDirectory interface 
-		     * implementation.
-		     */
-		    rc = RC (rcFS, rcDirectory, ctx, rcPath, rcOutOfKDirectory);
-		    break;
-		}
-		else
-		{
-		    const KTocEntry *	node;		/* no alloc */
-		    const String *	toc_path_string;	/* no alloc */
-		    const char *	toc_path;		/* no alloc */
-		    const char *	left;		/* no alloc */
-		    KTocEntryType	type  = ktocentrytype_unknown;
-		    /* -----
-		     * now get the path that is just that which is inside the TOC by pointing
-		     * past the path of the TOC and get the relevant TOC.  Since the incoming path
-		     * and the "makepath" path have all been ASCIZ so is this abbreviated path.
-		     */
-
-
-		    rc = KTocGetPath (toc, &toc_path_string);
-		    toc_path = abpath + toc_path_string->size; /* point past toc's path to either NUL or '/' */
-		    if (toc_path[0] == '/')		/* if '/' move forward one char */
-			toc_path++;
-		    else if (toc_path[0] != 0x00)	/* if not NUL we are not in this TOC */
-		    {
-			rc = RC (rcFS, rcDirectory, ctx, rcPath, rcOutOfKDirectory);
-			break;
-		    }
-
-		    /* if the called resolve failed then this resolve fails too */
-		    rc = KTocResolvePathTocEntry (toc, &node, toc_path, strlen(toc_path), &type, &left);
-		    if (rc != 0)
-		    {
-			/* nothing? or fix ret? */
-		    }
-		    else if (type != ktocentrytype_softlink)
-		    {
-			/* -----
-			 * This is the non soft link successful result
-			 */
-			*ptype = type;
-			*pnode = node;
-			/* rc is 0 at this point */
-			break; /* out of for (;;) */
-		    }
-		    else
-		    {
-			size_t	lsize;
-			
-			/* -----
-			 * successful so far but there might still be some path left if we hit a soft link
-			 */
-			lsize = strlen(left);	/* points to NUL for empty string if we got to the end */
-
-			if ((lsize == 0) && (! follow))
-			{
-			    /* -----
-			     * This is a soft link successful result
-			     */
-			    *ptype = type;
-			    *pnode = node;
-			    /* rc is 0 at this point */
-			    break; /* out of for (;;) */
-			}
-			/* -----
-			 * If we did hit a soft link with path remaining we have work to do resolving the
-			 * facets in the path before the end.
-			 *
-			 * the remaining path could be as little as a single "/".
-			 */
-			else
-			{
-			    const char *	symlink_path;		/* no alloc */
-			    rc = KTocEntryGetSoftTarget(node, &symlink_path);
-			    if (rc != 0)
-			    {
-				/* fix rc_t? */
-				break;
-			    }
-			    else
-			    {
-				/* -----
-				 * If the symbolic link's path starts with '/' it is an absolute path
-				 */
-				if (symlink_path[0] == '/')
-				{
-				    free (abpath); /* abandon the last presumed absolute path */
-				    temp_path = symlink_path;
-				    continue; /* back to for(;;) */
-				}
-				else
-				{
-				    /* -----
-				     * if the first character isn't '/' it is relative to the current
-				     * directory within the TOC
-				     */
-				    size_t		asize;		/* allocated size */
-				    size_t		fsize;		/* first - before symlink - size */
-				    size_t  	ssize;		/* symlink value size */
-				    const char * 	backtrack;
-				    /* -----
-				     * Backtrack across the last facet - which was the link name
-				     */
-				    for (backtrack = left - 1; *backtrack != '/'; --backtrack)
-					;
-				    backtrack++; /* get back the '/' */
-
-				    /* -----
-				     * we need enough space for the 
-				     */
-				    fsize = backtrack - abpath;	/* current path through start of link */
-				    ssize = strlen(symlink_path);/* length of the link's replacement value */
-				    asize = fsize+ssize+lsize+1;/* total of the three pieces and NUL */
-				    allocated_path		/* get a temp buffer to build this new path */
-					= realloc (allocated_path, asize);
-				    if (allocated_path == NULL)
-				    {
-					rc = RC (rcFS, rcDirectory, ctx, rcMemory, rcExhausted);
-					break; /* end for(;;) */
-				    }
-				    else
-				    {
-					char * pc;
-					/* -----
-					 * TODO verify that there is or is not a problem
-					 * with  "~//~" showing up from these memcopies
-					 * and that a final NUL is added add extra buffer
-					 * space as needed to asize
-					 */
-					memcpy (allocated_path, abpath, fsize);
-					pc = allocated_path + fsize;
-					memcpy (pc, symlink_path, ssize);
-					pc += ssize;
-					if (*(pc-1) == '/')
-					    --pc;
-					memcpy (pc, left, lsize+1);
-					temp_path = allocated_path;
-					continue;
-
-				    } /* if (allocated_path == NULL) {} else { */
-				} /* if (symlink_path[0] == '/') {} else { */
-			    } /* if (rc != 0) {} else { */
-			} /* if ((lsize == 0) && (! follow)) {} else { */
-		    } /* if (rc != 0) {} else if (type != ktocentrytype_softlink) {} else { */
-		} /* if (strncmp(abpath, self->path, self->size) != 0) {} else { */
-	    } /* if (rc != 0) {} else { */
-	} /* while(rc == 0) */
-	if (abpath != NULL)
-	    free (abpath);
-	if (allocated_path != NULL)
-	    free (allocated_path);
-    } /* if (path[0] == 0) {} else { */
-    return rc;
-}
-
-
-/* ======================================================================
- * KArcFile
- *  a file inside an archive
- */
-
-/*-----------------------------------------------------------------------
- * KArcFile
- *  an archive file including tar and sra
- */
-struct KArcFile
-{
-    KFile		dad;
-    const KToc *	toc;	/* not accessed directly but it owns the node so need a ref to it */
-    const KTocEntry *	node;
-    const KFile *	archive;
-};
-
-/*-----------------------------------------------------------------------
- * KArcFileDestroy
- *
- * Destructor for objects of class KArcFile.  Usually not called directly but instead called
- * when the reference count for the object drops to 0.
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KArcFile *		self		OOP self pointer - the object to be destroyed
- */
-static
-rc_t CC KArcFileDestroy (KArcFile *self)
-{
-    rc_t ret1, ret2;
-
-    assert (self != NULL);
-
-    ret1 = KFileRelease (self->archive);
-    ret2 = KTocRelease (self->toc);
-    free (self);
-
-    /* -----
-     * this seems a tad silly but pass along one or the other failure
-     * We chose to call the second release even of the first failed
-     * erring on the side of releasing as much as possible
-     */
-    return (ret1 != 0) ? ret1 : ret2;
-}
-
-
-/*-----------------------------------------------------------------------
- * KArcFileGetSysFile
- *
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- * Returns the KSysFile/KFile associated with a KArcFile.  NULL if not appropriate.
- *
- * [RET] struct KSysFile *
- * [IN]  const KArcFile *	self		Object oriented C; KArcFile object for this method
- * [OUT] uint64_t *		offset		An offset into the KSysfile where the KArcFile's
- *						data starts.
- */
-static
-struct KSysFile *CC KArcFileGetSysFile (const KArcFile *self, uint64_t *offset)
-{
-    rc_t rc;
-    KTocEntryType type;
-    struct KSysFile * fp;
-    uint64_t fo;
-    uint64_t ao;
-
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    /* check the type which must be a contiguous file */
-    rc = KTocEntryGetType (self->node, &type);
-    if (rc == 0)
-    {
-	if (type == ktocentrytype_file)
-	{
-	    /* recur into the KFile to see if it allows this */
-	    fp = KFileGetSysFile (self->archive, &ao);
-
-	    /* -----
-	     * if all this is true get the offset from the TOC entry and
-	     * return it
-	     */
-	    if (fp != NULL)
-	    {
-		if (KTocEntryGetFileOffset (self->node, &fo) == 0)
-		{
-		    *offset = ao + fo;
-		    return fp;
-		}
-	    }
-	}
-    }
-    /* any failure alng the way leads to returning NULL */
-    *offset = 0;
-    return NULL;
-}
-
-
-/*-----------------------------------------------------------------------
- * KArcFileRandomAccess
- *
- * Returns zero if Random access is allowed for this KFile
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details		
- * [IN] const KArcFile *	self		Object oriented C; KArcFile object for this method
- */
-static
-rc_t CC KArcFileRandomAccess (const KArcFile *self)
-{
-    assert (self != NULL);
-    return 0;
-}
-
-
-/*-----------------------------------------------------------------------
- * KArcFileType
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KArcFileType ( const KArcFile *self )
-{
-    return KFileType ( self -> archive );
-}
-
-
-/*-----------------------------------------------------------------------
- * KArcFileSize
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcFile *	self		Object oriented C; KArcFile object for this method
- * [OUT] uint64_t *		size		Where to put the virtual size of the file
- */
-static
-rc_t CC KArcFileSize (const KArcFile *self, uint64_t *size)
-{
-    rc_t	rc;
-    uint64_t	fsize;
-
-    assert (self != NULL);
-    assert (size != NULL);
-
-    rc = KTocEntryGetFileSize(self->node, &fsize);
-    if (rc == 0)
-    {
-	/* success */
-	*size = fsize;
-    }
-    /* pass along RC value */
-    return rc;
-}
-
-
-/*-----------------------------------------------------------------------
- * KArcFileSetSize
- *
- * Change the size of the KFile.  Not supported for files inside archives.
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KArcFile *		self		Object oriented C; KArcFile object for this method
- * [IN] uint64_t		size
- */
-static
-rc_t CC KArcFileSetSize (KArcFile *self, uint64_t size)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcArc, rcUnsupported);
-}
-
-
-
-/*-----------------------------------------------------------------------
- * KArcFileRead
- *
- * Read bytes from a file represented by this KArcFile
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcFile *	self		Object oriented C; KArcFile object for this method
- * [IN]  uint64_t		pos		Offset with in the file from where to start reading
- * [OUT] void *			buffer		buffer to which to write the read bytes 
- * [IN]  size_t			bsize		how many bytes to read
- * [OUT] size_t *		num_read	how many bytes actually read. Will get written even
- *						in failure
- */
-/* ----------------------------------------------------------------------
- * KArcFileReadContiguous
- *
- * Read data from a contiguously stored file at a specified position
- *
- * The parameters are the same as KArcFileRead.  This private function could be
- * inlined.  It is broken out for human readabilty.
- *
- * We just fix the offset by adding the offset to the file within the archive
- * (we fixed the number to read before we got here) and pass the read to the
- * archive.
- */
-static
-rc_t KArcFileReadContiguous (const KArcFile *self, uint64_t pos,
-			     void *buffer, size_t bsize, size_t *num_read)
-{
-    rc_t	rc;
-    uint64_t	offset;
-
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    rc = KTocEntryGetFileOffset (self->node, &offset);
-    if (rc == 0)
-    {
-	rc = KFileRead (self->archive, pos + offset, buffer, bsize, num_read);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcFileReadEmpty
- *
- * Read data from a file with no content.
- *
- * The parameters are the same as KArcFileRead.  This private function could be
- * inlined.  It is broken out for human readabilty.
- *
- * We just fix the offset by adding the offset to the file within the archive
- * (we fixed the number to read before we got here) and pass the read to the
- * archive.
- */
-static
-rc_t KArcFileReadEmpty (const KArcFile *self, uint64_t pos,
-                        void *buffer, size_t bsize, size_t *num_read)
-{
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    *num_read = 0;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KArcFileReadChunked
- *
- * Read data from a  chunked file at a specified position
- *
- * The parameters are the same as KArcFileRead.  This private function could be
- * inlined.  It is broken out for human readabilty.
- */
-static
-rc_t KArcFileReadChunked (const KArcFile *self,
-			  uint64_t pos,
-			  void *buffer,
-			  size_t bsize,
-			  size_t *num_read)
-{
-    const KTocChunk *	pchunk;		/* pointer to the chunk table */
-    size_t		count;		/* how many to read/write in an action */
-    uint32_t		num_chunks;	/* how many chunks in the array */
-    rc_t		rc;		/* general purpose return from calls and pass along */
-
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    /* -----
-     * assume no read/write will happen or rather start with having read none;
-     * this write could be superfluous but we need to prepare *num_read for += operations
-     */
-    *num_read = 0;
-
-    /* -----
-     * Get the count of chunks and a pointer to the array of chunks for this file
-     */
-    rc = KTocEntryGetChunks (self->node, &num_chunks, &pchunk);
-    if (rc == 0)
-    {
-	uint8_t *	pbuff;		/* access the buffer as an array of bytes */
-	uint64_t	end;		/* this will be set to the end offset */
-
-	pbuff = buffer;
-	end = pos + bsize;	
-
-	/* -----
-	 * step through the chunks
-	 */
-	for (; (num_chunks) && (pos < end); --num_chunks, ++pchunk)
-	{
-	    uint64_t 	cend;		/* end offset of this chunk */
-
-	    /* -----
-	     * determine the end of this chunk
-	     */
-	    cend = pchunk->logical_position + pchunk->size;
-
-	    /* -----
-	     * if this chunk is entirely before the current position
-	     * we are looking for
-	     * skip to the next (if any) chunk
-	     */
-	    if (pos > cend)
-		continue;
-
-	    /* -----
-	     * handle any needed zero fill section before the next chunk
-	     */
-	    if (pos < pchunk->logical_position)
-	    {
-		/* -----
-		 * try to fake-read as many bytes of zero as possible
-		 * so start assuming you need enough zeros to reach the next chunk
-		 * but cut it back to the remaining requested if that was too many
-		 */
-		count = (size_t)( pchunk->logical_position - pos );
-		if (count > bsize)
-		    count = bsize;
-
-		/* fake read the zeros */
-		memset (pbuff, 0, count);
-
-		/* update tracking variables */
-		pbuff += count;
-		pos += count;
-		*num_read += count;
-	    }
-
-	    /* -----
-	     * handle a chunk section
-	     *
-	     * if we are here, then we still have bytes to get and
-	     * pos >= pchunk_logical_position
-	     *
-	     * Get the most we can from this chunk.
-	     * If there are enough bytes in this chunk to finish the read: do so.
-	     * Else read through the end of the chunk
-	     */
-	    count = (size_t)( (end <= cend) ? end - pos : cend - pos );
-
-	    /* -----
-	     * a little tricky is we call by value the wanted count and the function
-	     * called will over write that with the actual read count
-	     */
-	    rc = KFileRead (self->archive, 
-			    pchunk->source_position + (pchunk->logical_position - pos), 
-			    pbuff, count, &count);
-
-	    *num_read += count;
-	    if (rc != 0)
-	    {
-		/* failure so abort */
-		break;
-	    }
-	    pbuff += count;
-	    pos += count;
-	    *num_read += count;
-	}
-	/* -----
-	 * If eveything so far is okay but we have more bytes to read
-	 * yet no more chunks; then fill to the end with zeroes
-	 */
-	if ((rc == 0) && (pos < end))
-	{
-	    count = (size_t)( end - pos );
-	    memset (pbuff, 0, count);
-	    *num_read += count;
-	}
-    }
-    return rc;
-}
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KArcFileRead	(const KArcFile *self,
-			 uint64_t pos,
-			 void *buffer,
-			 size_t bsize,
-			 size_t *num_read)
-{
-    KTocEntryType	type;
-    rc_t		rc;
-
-    /* -----
-     * self and buffer were validated as not NULL before calling here
-     *
-     * So get the KTocEntry type: chunked files and contiguous files 
-     * are read differently.
-     */
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    rc = KTocEntryGetType(self->node, &type);
-
-    assert ((type == ktocentrytype_file) || 
-            (type == ktocentrytype_chunked) ||
-            (type == ktocentrytype_emptyfile));
-
-    if (rc == 0)
-    {
-	uint64_t	size;
-
-	/* -----
-	 * We have to validate the size to be read and will modify the number
-	 * down if necessary
-	 */
-	rc = KTocEntryGetFileSize (self->node, &size);
-	if (rc == 0)
-	{
-	    /* ----- 
-	     * if we are seeking beyond the end match sysfile.c's use of pread
-	     * and return number read as 0 to mark EOF
-	     */
-	    if (pos >= size)
-	    {
-		*num_read = 0;
-	    }
-	    else
-	    {
-		uint64_t	limit;
-
-		limit = 
-		    (pos + bsize > size)	/* if attempt to read beyond end of file */
-		    ? size - pos		/* then force smaller read */
-		    : bsize;			/* else allow full read */
-
-		switch (type)
-		{
-		default:
-		case ktocentrytype_unknown:
-		case ktocentrytype_dir:
-		case ktocentrytype_softlink:
-		case ktocentrytype_hardlink:
-		    /* -----
-		     * We should not have been able to open these as a KArcFile
-		     * so this is probably superfluous
-		     */
-		    rc = RC (rcFS, rcFile, rcReading, rcArc, rcUnexpected);
-		    break;
-		case ktocentrytype_file:
-		    rc = KArcFileReadContiguous (self, pos, buffer, (size_t)limit, num_read);
-		    break;
-		case ktocentrytype_chunked:
-		    rc = KArcFileReadChunked (self, pos, buffer, (size_t)limit, num_read);
-		    break;
-		case ktocentrytype_emptyfile:
-		    rc = KArcFileReadEmpty (self, pos, buffer, (size_t)limit, num_read);
-		    break;
-		}
-	    }
-	}
-    }
-    return rc;
-}
-
-
-
-/*-----------------------------------------------------------------------
- * KArcFileWrite
- *
- * Write bytes to a file represented by this KArcFile.
- * Fails as unsupported for files inside archives.
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  KArcFile *		self		Object oriented C; KArcFile object for this method
- * [IN]  uint64_t 		pos		Offset within file to start writing (ignored)
- * [IN]  const void *		buffer		pointer to data to write (ignored)
- * [IN]  size_t 		size		how many bytes to write (ignored)
- * [OUT] size_t *		num_writ	how many bytes written - always set to 0
- */
-static
-rc_t CC KArcFileWrite (KArcFile *self, uint64_t pos,
-		       const void *buffer, size_t size,
-		       size_t *num_writ)
-{
-    assert (num_writ != NULL);
-
-    /* duplicates write in KFileWrite() so this can be deleted */
-    *num_writ = 0;
-
-    return RC (rcFS, rcArc, rcWriting, rcSelf, rcUnsupported);
-}
-
-
-
-static	KFile_vt_v1	vtKArcFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KArcFileDestroy,
-    KArcFileGetSysFile,
-    KArcFileRandomAccess,
-    KArcFileSize,
-    KArcFileSetSize,
-    KArcFileRead,
-    KArcFileWrite,
-
-    /* 1.1 */
-    KArcFileType
-};
-
-/*-----------------------------------------------------------------------
- * KArcFileMake
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KArcFile ** 		self		were to put a reference to the newly allocated
- *						KArcFile structure
- * [IN]  const KFile *		archive		The KFile for the archive containing this archive
- * [IN]  const KArcToc *	toc		The controlling TOC for the Archive File
- * [IN]  const KTocEntry *	node		The specific node somewhere in that TOC for this file
- */
-static
-rc_t KArcFileMake (KArcFile ** self,
-		   const KFile * archive,
-		   const KToc * toc,
-		   const KTocEntry * node)
-{
-    rc_t	rc;
-    KArcFile *	pF;
-    uint64_t    size;
-
-    /* -----
-     * we can not accept any of the four parameters as NULL
-     */
-    assert (self != NULL);
-    assert (archive != NULL);
-    assert (toc != NULL);
-    assert (node != NULL);
-
-    /* -----
-     * Proceed with non-NULL parameters
-     */
-    rc = KFileSize (archive, &size);
-    if (GetRCState(rc) == rcUnsupported)
-    {
-        size = ~(uint64_t)0;
-        rc = 0;
-    }
-
-    if (rc == 0)
-    {
-        /* we need to check chunked files here as well */
-        if (((node->type == ktocentrytype_file) &&
-             (node->u.contiguous_file.file_size > 0) &&
-             (size < (node->u.contiguous_file.file_size +
-                      node->u.contiguous_file.archive_offset))) ||
-            ((node->type == ktocentrytype_chunked) &&
-             (node->u.chunked_file.file_size > 0) &&
-             (size < (node->u.chunked_file.chunks[node->u.chunked_file.num_chunks-1].source_position +
-                      node->u.chunked_file.chunks[node->u.chunked_file.num_chunks-1].size))))
-            rc = RC (rcFS, rcFile, rcConstructing, rcArc, rcIncomplete);
-        else
-        {
-            /* get space for the object */
-            pF = malloc (sizeof * pF);
-            if (pF == NULL)	/* allocation failed */
-            {
-                /* fail */
-                rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-            }
-            else
-            {
-                rc = KFileInit (&pF->dad,				/* initialize base class */
-                                (const KFile_vt*)&vtKArcFile,	/* VTable for KArcFile */
-                                "KArcFile", "no-name",
-                                true,				/* read allowed */
-                                false);				/* write disallowed */
-                if (rc == 0)
-                {
-                    /* succeed */
-                    pF->toc = toc;					/* shared TOC */
-                    KTocAddRef(toc);				/* keep alive reference */
-                    pF->node = node;				/* file specific TOC entry */
-                    pF->archive = archive;				/* shared archive file */
-                    KFileAddRef(archive);				/* keep alive reference */
-                    *self = pF;					/* and to the output */
-                }
-                if (rc != 0)
-                    /* fail */
-                    free (pF);
-            }
-	}
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirVisit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry, where each path is also given the leaf name
- *  for convenience. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-static 
-rc_t CC KArcDirVisit (const KArcDir *self, 
-                      bool recurse,
-                      rc_t (CC* f) (const KDirectory *, uint32_t, const char *, void *), 
-                      void *data,
-                      const char *path,
-                      va_list args)
-{
-    char * full_path;
-    rc_t   rc;
-
-
-    /* -----
-     * First fix the path to make it useable
-     */
-    rc = KArcDirMakePath (self, rcVisiting, true, &full_path, path, args);
-    if (rc != 0)
-    {
-	LOGERR (klogInt, rc, "failed to make path in Visit");
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType	type;
-
-	/* -----
-	 * Now find that path as a node and validate it is a directory
-	 */
-	rc = KArcDirResolvePathNode(self, rcListing, full_path, true, &pnode, &type);
-	if (rc != 0)
-	{
-	    PLOGERR (klogInt, (klogInt, rc, "failed to resolve path $(P) in Visit", "P=%s", full_path));
-	}
-	else
-	{
-	    if ((type == ktocentrytype_dir) || (type == ktocentrytype_hardlink))
-	    {
-		KArcDir * full_dir;
-		uint32_t path_size;
-
-		/* -----
-		 * make a locally accessible private KDirectory/KArcDir
-		 */
-		for ( path_size = (uint32_t)strlen ( full_path );
-		      ( path_size > self->root ) && ( full_path[ path_size - 1 ] == '/' );
-		      -- path_size )
-		{}
-		rc = KArcDirMake (&full_dir, 
-				  rcVisiting,
-				  self->parent,
-				  self->toc,
-				  pnode,
-				  self->archive.v,
-				  self->arctype,
-				  self->root,
-				  full_path,
-				  path_size, 
-				  true,
-				  false);
-		if (rc == 0)
-		{
-		    KArcDirVisitData pb;
-
-		    pb.f = f;
-		    pb.data = data;
-		    pb.dir = full_dir;
-		    pb.recurse = recurse;
-/*		    pb.dir.path[--pb.dir.size] = 0; */
-
-		    rc = KArcDirVisitDir (&pb);
-
-		    KArcDirDestroy (full_dir);
-		}
-	    }
-	    else
-	    {
-		rc = RC (rcFS, rcDirectory, rcVisiting, rcPath, rcIncorrect);
-		LOGERR (klogInt, rc, "Type is not a directory");
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirVisitUpdate
- */
-static rc_t CC KArcDirVisitUpdate (KArcDir *self,
-                                   bool recurse,
-                                   rc_t (CC*f) (KDirectory *,uint32_t,const char *,void *),
-                                   void *data,
-                                   const char *path,
-                                   va_list args)
-{
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirResolvePath
- *
- *  resolves path to an absolute or directory-relative path
- *
- * [IN]  const KArcDir *self		Objected oriented self
- * [IN]	 bool 		absolute	if non-zero, always give a path starting
- *  					with '/'. NB - if the directory is 
- *					chroot'd, the absolute path
- *					will still be relative to directory root.
- * [OUT] char *		resolved	buffer for NUL terminated result path in 
- *					directory-native character set
- * [IN]	 size_t		rsize		limiting size of resolved buffer
- * [IN]  const char *	path		NUL terminated string in directory-native
- *					character set denoting target path. 
- *					NB - need not exist.
- *
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KArcDirResolvePath (const KArcDir *self,
-                                   bool absolute,
-                                   char *resolved,
-                                   size_t rsize,
-                                   const char *path,
-                                   va_list args)
-{
-    char * full;
-    rc_t   rc; 
-
-    assert (self != NULL);
-    assert (resolved != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true, &full, path, args);
-
-    if (rc == 0)
-    {
-	uint32_t path_size = (uint32_t)strlen ( full );
-
-	if (absolute)
-	{
-	    /* test buffer capacity -  this is a limitation of KDirectory not in KArcDir */
-	    if ((path_size - self->root) >= rsize)
-	    {
-		rc =  RC (rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient);
-	    }
-	    else
-	    {
-		/* ready to go */
-		strcpy (resolved, & full[self->root]);
-		assert (resolved[0] == '/');
-	    }
-	}
-	else
-	{
-	    rc = KArcDirRelativePath (self, rcResolving, self->path, full, path_size);
-	    if (rc == 0)
-	    {
-		path_size = (uint32_t)strlen ( full );
-		/* test buffer capacity -  this is a limitation of KDirectory not in KArcDir */
-		if (path_size >= rsize)
-		{
-		    rc = RC (rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient);
-		}
-		else
-		{
-		    strcpy (resolved, full);
-		}
-	    }
-	}
-    }
-    if (full != NULL)
-	free (full);
-
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KArcDirResolveAlias (const KArcDir * self, 
-				 bool absolute,
-				 char * resolved,
-				 size_t rsize,
-				 const char *alias,
-				 va_list args)
-{
-    char *		full_path;
-    const char *	link_path;
-    const KTocEntry * pnode;
-    KTocEntryType	type;
-    rc_t		rc;
-    size_t		ssize;
-
-    assert (self != NULL);
-    assert (resolved != NULL);
-    assert (alias != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true,
-			  &full_path, alias, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	/* first find the node and it has to be an alias */
-	rc = KArcDirResolvePathNode (self, rcResolving, alias, false, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else if (type != ktocentrytype_softlink)
-	{
-	    rc = RC (rcFS, rcDirectory, rcResolving, rcLink, rcInvalid);
-	}
-	else
-	{
-	    rc = KTocEntryGetSoftTarget(pnode, &link_path);
-	    if (rc != 0)
-	    {
-		/* can't "fix" path */
-		/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	    }
-	    else
-	    {
-		ssize = strlen(link_path);
-		if (ssize > rsize)
-		{
-		    rc = RC (rcFS, rcDirectory,rcResolving, rcParam, rcInsufficient);
-		}
-		else
-		{
-		    strcpy (resolved, link_path);
-		}
-	    }
-	}
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirRename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-static
-rc_t CC KArcDirRename (KArcDir *self, bool force, const char *from, const char *to)
-{
-    assert (self != NULL);
-    assert (from != NULL);
-    assert (to != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirRemove
- *  remove an accessible object from its directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- */
-static
-rc_t CC KArcDirRemove (KArcDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirClearDir
- *  remove all directory contents
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- */
-static
-rc_t CC KArcDirClearDir (KArcDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirAccess
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KArcDirVAccess (const KArcDir *self,
-			    uint32_t *access,
-			    const char *path,
-			    va_list args)
-{
-    const KTocEntry *	entry;
-    rc_t 		rc;
-    uint32_t		acc;
-    KTocEntryType	type;
-    char * 		full;
-
-    assert (self != NULL);
-    assert (access != NULL);
-    assert (path != NULL);
-
-    /* -----
-     * by C standard the nested ifs (if A { if B { if C ... could have been if A && B && C
-     */
-    if ((rc = KArcDirMakePath (self, rcAccessing, false, &full, path, args)) == 0)
-    {
-	if ((rc = KArcDirResolvePathNode (self, rcAccessing, path, true, &entry, &type)) == 0)
-	{
-	    if ((rc = KTocEntryGetAccess (entry, &acc)) == 0)
-	    {
-                /*
-                 * We want to filter the access because within an Archive
-                 * a file is unwritable
-                 */
-		*access = acc & ~(S_IWRITE|S_IWGRP|S_IWOTH);
-		rc = 0;
-	    }
-	}
-    }
-    if (full != NULL)
-	free (full);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirSetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static rc_t CC KArcDirSetAccess (KArcDir *self,
-			      bool recurse,
-			      uint32_t access,
-			      uint32_t mask,
-			      const char *path,
-			      va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-static	rc_t CC KArcDirVDate		(const KArcDir *self,
-					 KTime_t *date,
-					 const char *path,
-					 va_list args)
-{
-/*     const KToc *	toc; */
-    const KTocEntry * node;
-    rc_t 		rc;
-    KTime_t		ldate;
-    KTocEntryType	type;
-    char * 		full;
-
-    assert (self != NULL);
-    assert (date != NULL);
-    assert (path != NULL);
-
-    /* -----
-     * by C standard the nested ifs (if A { if B { if C ... could have been if A && B && C
-     */
-    if ((rc = KArcDirMakePath (self, rcAccessing, false, &full, path, args)) == 0)
-    {
-/* 	if ((rc = KArcDirGetTOC (self, &toc)) == 0) */
-/* 	{ */
-	if ((rc = KArcDirResolvePathNode (self, rcAccessing, path, true, &node, &type)) == 0)
-	{
-	    if ((rc = KTocEntryGetTime (node, &ldate)) == 0)
-	    {
-		*date =  ldate;
-		rc = 0;
-	    }
-	}
-/* 	} */
-    }
-    if (full != NULL)
-	free (full);
-    return rc;
-}
-static	rc_t CC KArcDirSetDate		(KArcDir *self,
-					 bool recurse,
-					 KTime_t date,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-static
-struct KSysDir *CC KArcDirGetSysDir ( const KArcDir *self )
-{
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirCreateAlias
- *  creates a path alias according to create mode
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KArcDirCreateAlias (KArcDir *self,
-			 uint32_t access,
-			 KCreateMode mode,
-			 const char *targ,
-			 const char *alias)
-{
-    assert (self != NULL);
-    assert (targ != NULL);
-    assert (alias != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirOpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KArcDirOpenFileRead	(const KArcDir *self,
-					 const KFile **f,
-					 const char *path,
-					 va_list args)
-{
-    char *	full_path = NULL;
-    rc_t	rc;
-
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcOpening, true, &full_path, path, args);
-
-    if (rc == 0)
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KArcDirResolvePathNode (self, rcOpening, full_path, true, &pnode, &type);
-
-	if (rc == 0)
-	{
-
-	    switch (type)
-	    {
-	    case ktocentrytype_unknown:
-	    case ktocentrytype_dir:
-	    case ktocentrytype_softlink:
-	    case ktocentrytype_hardlink:
-	    default:
-		rc = RC (rcFS, rcDirectory, rcOpening, rcFile, rcInvalid);
-		break;
-	    case ktocentrytype_emptyfile:
-	    case ktocentrytype_file:
-	    case ktocentrytype_chunked:
-		rc = KArcFileMake ((KArcFile**)f, self->archive.v, self->toc, pnode);
-		break;
-	    }
-	}
-	free (full_path);
-    }    
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirOpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- */
-static
-rc_t CC KArcDirOpenFileWrite	(KArcDir *self,
-					 KFile **f,
-					 bool update,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirCreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KArcDirCreateFile	(KArcDir *self,
-					 KFile **f,
-					 bool update,
-					 uint32_t access,
-					 KCreateMode cmode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirFileLocator
- *  returns locator in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "locator" [ OUT ] - return parameter for file locator
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KArcDirFileLocator		(const KArcDir *self,
-					 uint64_t *locator,
-					 const char *path,
-					 va_list args)
-{
-    char *		full_path;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (locator != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true,
-			  &full_path, path, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KArcDirResolvePathNode (self, rcResolving, full_path, /*follow links*/true, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /* can't resolve path */
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else
-	{
-	    uint64_t	flocator;
-
-	    rc = KTocEntryGetFileLocator(pnode, &flocator);
-	    if (rc != 0)
-	    {
-		/* can't "fix" path */
-		/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	    }
-	    else
-	    {
-		*locator = flocator;
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KArcDirFileSize		(const KArcDir *self,
-					 uint64_t *size,
-					 const char *path,
-					 va_list args)
-{
-    char *		full_path;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (size != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true,
-			  &full_path, path, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KArcDirResolvePathNode (self, rcResolving, full_path, /*follow links*/true, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /* can't resolve path */
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else
-	{
-	    uint64_t	fsize;
-
-	    rc = KTocEntryGetFileSize(pnode, &fsize);
-	    if (rc != 0)
-	    {
-		/* can't "fix" path */
-		/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	    }
-	    else
-	    {
-		*size = fsize;
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KArcDirFilePhysicalSize		(const KArcDir *self,
-					 uint64_t *size,
-					 const char *path,
-					 va_list args)
-{
-    char *		full_path;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (size != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true,
-			  &full_path, path, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KArcDirResolvePathNode (self, rcResolving, full_path, /*follow links*/true, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /* can't resolve path */
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else
-	{
-	    uint64_t	fsize;
-
-	    rc = KTocEntryGetFilePhysicalSize(pnode, &fsize);
-	    if (rc != 0)
-	    {
-		/* can't "fix" path */
-		/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	    }
-	    else
-	    {
-		*size = fsize;
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirSetFileSize
- *  sets size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KArcDirSetFileSize	(KArcDir *self,
-					 uint64_t size,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcWriting, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirOpenDirRead
- *
- *  opens a sub-directory
- *
- * [IN]  const KArcDir *	self	Object Oriented C KArcDir self
- * [OUT] const KDirectory **	subp	Where to put the new KDirectory/KArcDir
- * [IN]  bool			chroot	Create a chroot cage for this new subdirectory
- * [IN]  const char *		path	Path to the directory to open
- * [IN]  va_list		args	So far the only use of args is possible additions to path
- */
-static 
-rc_t CC KArcDirOpenDirRead	(const KArcDir *self,
-					 const KDirectory **subp,
-					 bool chroot,
-					 const char *path,
-					 va_list args)
-{
-    char * full;
-    rc_t rc;
-
-    assert (self != NULL);
-    assert (subp != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcOpening, true, &full, path, args);
-    if (rc == 0)
-    {
-	const KTocEntry *	pnode;
-	KTocEntryType		type;
-	size_t path_size = strlen (full);
-
-	/* -----
-	 * get rid of any extra '/' characters at the end of path
-	 */
-	while (path_size > 0 && full [ path_size - 1 ] == '/')
-	    full [ -- path_size ] = 0;
-
-	/* -----
-	 * get the node for this path 
-	 */
-	rc = KArcDirResolvePathNode (self, rcOpening, full, true, &pnode, &type);
-	if (rc == 0)
-	{
-            switch (type)
-            {
-            default:
-		/* fail */
-		rc = RC (rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect);
-                break;
-            case ktocentrytype_dir:
-            case ktocentrytype_hardlink:
-	    {
-		KArcDir *	sub;
-
-		rc = KArcDirMake (&sub,
-				  rcOpening,
-				  self->parent,
-				  self->toc,
-				  pnode,
-				  self->archive.v,
-				  self->arctype,
-				  self->root,
-				  full,
-				  (uint32_t)path_size,
-				  false,
-				  chroot);
-		if (rc == 0)
-		{
-		    /* succeed */
-		    *subp = &sub->dad;
-		}
-	    }
-            }
-	}
-	free (full);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirOpenDirUpdate
- *  opens a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- */
-static
-rc_t CC KArcDirOpenDirUpdate	(KArcDir *self,
-					 KDirectory ** subp, 
-					 bool chroot, 
-					 const char *path, 
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (subp != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirCreateDir
- *  create a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "access" [ IN ] - standard Unix directory permissions
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KArcDirCreateDir	(KArcDir *self,
-					 uint32_t access,
-					 KCreateMode mode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirDestroyFile
- */
-static
-rc_t CC KArcDirDestroyFile	(KArcDir *self,
-					 KFile * f)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-
-    return RC (rcFS, rcArc, rcDestroying, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KArcDirFileContiguous
- *  
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "contiguous" [ OUT ] - return parameter for file status
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KArcDirFileContiguous		(const KArcDir *self,
-                                         bool * contiguous,
-					 const char *path,
-					 va_list args)
-{
-    char *		full_path;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (contiguous != NULL);
-    assert (path != NULL);
-
-    rc = KArcDirMakePath (self, rcResolving, true,
-			  &full_path, path, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KArcDirResolvePathNode (self, rcResolving, full_path, /*follow links*/true, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /* can't resolve path */
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else
-	{
-	    switch (type)
-	    {
-	    default:
-                *contiguous = false;
-		break;
-	    case ktocentrytype_emptyfile:
-	    case ktocentrytype_file:
-                *contiguous = true;
-		break;
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-static KDirectory_vt_v1 vtKArcDir =
-{
-    /* version 1.0 */
-    1, 3,
-
-    /* start minor version 0 methods*/
-    KArcDirDestroy,
-    KArcDirList,
-    KArcDirVisit,
-    KArcDirVisitUpdate,
-    KArcDirPathType,
-    KArcDirResolvePath,
-    KArcDirResolveAlias,
-    KArcDirRename,
-    KArcDirRemove,
-    KArcDirClearDir,
-    KArcDirVAccess,
-    KArcDirSetAccess,
-    KArcDirCreateAlias,
-    KArcDirOpenFileRead,
-    KArcDirOpenFileWrite,
-    KArcDirCreateFile,
-    KArcDirFileSize,
-    KArcDirSetFileSize,
-    KArcDirOpenDirRead,
-    KArcDirOpenDirUpdate,
-    KArcDirCreateDir,
-    KArcDirDestroyFile,
-    /* end minor version 0 methods*/
-    /* start minor version 1 methods*/
-    KArcDirVDate,
-    KArcDirSetDate,
-    KArcDirGetSysDir,
-    /* end minor version 2 methods*/
-    KArcDirFileLocator,
-    /* end minor version 2 methods*/
-    /* end minor version 3 methods*/
-    KArcDirFilePhysicalSize,
-    KArcDirFileContiguous
-    /* end minor version 3 methods*/
-};
-
-/* ----------------------------------------------------------------------
- * KArcDirMake
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KArcDir **		self		objected oriented c "self"
- * [IN] enum RCContext 		ctx		context to use when passing along rc_t
- * [IN] const KDirectory * 	parent		KDirectory type for path before the archive
- * [IN] const KToc * 	toc		table of contents for the archive
- * [IN] const KTocEntry * 	node		this directory's node within the TOC
- * [IN] const KFile * 		archive		open archive file as KFile
- * [IN] uint32_t 		dad_root	offset of end of "root" within the path
- * [IN] const char *		path		path all the way back to file system root not
- *						effective but real root
- * [IN] uint32_t		path_size	length of path
- * [IN] bool			update		!read_only -- ignored for now and forced read_only
- * [IN] bool			chroot		make this a chroot to dad root?
- */
-static
-rc_t	KArcDirMake	(KArcDir ** self,
-                         enum RCContext ctx,
-                         const KDirectory * parent,
-                         const KToc * toc,
-                         const KTocEntry * node,
-                         const void * archive,
-                         KArcFSType baseType,
-                         uint32_t dad_root,
-                         const char *path,
-                         uint32_t path_size,
-                         bool update, /* ignored */
-                         bool chroot)
-{
-    KArcDir * dir;
-    rc_t rc;
-
-    assert (self != NULL);
-    assert (parent != NULL);
-    assert (toc != NULL);
-    /* node will be NULL at base archive file */
-    assert (archive != NULL);
-    assert (path != NULL);
-
-    dir = malloc ((sizeof(KArcDir) - sizeof dir->path) + path_size + 2);
-
-    if (dir == NULL)
-    {
-        *self = NULL;
-	return RC (rcFS, rcArc, rcCreating, rcMemory, rcExhausted);
-    }
-
-    dir->toc = NULL;
-    dir->archive.v = NULL;
-
-    rc = KDirectoryInit (&dir->dad, (const KDirectory_vt*) &vtKArcDir,
-                         "KArcDir", path,
-			 /* update*/ false); /* force KDirectory to read_only here */
-    if (rc != 0)
-    {
-        free (dir);
-        return ResetRCContext (rc, rcFS, rcDirectory, ctx);
-    }
-
-    dir->parent = parent;
-    dir->toc = toc;
-    KTocAddRef(toc);
-    dir->node = node;
-    dir->arctype = baseType;
-    dir->archive.v = archive;
-
-    switch (baseType)
-    {
-    default:
-        free (dir);
-        return RC (rcFS, rcArc, rcConstructing, rcParam, rcInvalid);
-    case tocKFile:
-        KFileAddRef (archive);
-        break;
-    case tocKDirectory:
-        KDirectoryAddRef (archive);
-        break;
-    }
-    memcpy (dir->path, path, path_size);
-    dir->root = chroot ? path_size : dad_root;
-    dir->size = path_size+1; /* make space for the next two operations */
-    dir->path [path_size] = '/';
-    dir->path [path_size+1] = 0;
-    *self = dir;
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KArcDirGetTOC
- *
- * [IN]  const KArcDir * 	self	Object oriented C
- * [OUT] const KToc ** 	toc	Where to put a pointer to the TOC for the KArcDir
- *
- * Set a pointer to point the TOC for this KArcDir(KDirectory)
- */
-rc_t KArcDirGetTOC (const KArcDir * self,
-                    const struct KToc ** toc)
-{
-    assert (self != NULL);
-    assert (toc != NULL);
-
-    *toc = self->toc;
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KDirectoryToKArcDir
- *
- * [IN]  const KDirectory * 	self	Object oriented C
- * [OUT] const KArcDir * 	cast	Object oriented C
- *
- *
- * Get a reference to a KArcDir from a KDirectory as a cast.  It is a new reference.
- */
-
-LIB_EXPORT rc_t CC KDirectoryToKArcDir (const KDirectory * self, const KArcDir ** cast)
-{
-    rc_t rc;
-    if ( cast == NULL )
-        rc = RC ( rcFS, rcArc, rcCasting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcArc, rcCasting, rcSelf, rcNull );
-        else
-        {
-            if (self->vt != (const KDirectory_vt*)&vtKArcDir)
-                rc = RC ( rcFS, rcArc, rcCasting, rcSelf, rcIncorrect );
-            else
-            {
-                rc = KDirectoryAddRef ( self );
-                if ( rc == 0 )
-                {
-                    * cast = (const KArcDir*)self;
-                    return 0;
-                }
-            }
-        }
-
-        * cast = NULL;
-    }
-
-    return rc;
-}
-
-
-static
-rc_t KDirectoryOpenArcDirRead_intern( const KDirectory * self,
-                                      const KDirectory ** pdir,
-                                      bool chroot,
-                                      bool silent,
-                                      const char * path,
-                                      KArcFSType baseType,
-                                      void * _archive,
-                                      rc_t ( CC * parse )( KToc *, const void *,
-                                                           bool( CC* )( const KDirectory*,
-                                                                        const char *, void*),
-                                                           void * ),
-                                      bool( CC* filter )( const KDirectory*, const char *, void * ),
-                                      void * filterparam )
-{
-    union
-    {
-        const void * v;
-        const KFile * f;
-        const KDirectory * d;
-    } archive;
-    KArcDir * arcdir = NULL;
-    KToc   * toc = NULL;
-    String   spath;
-    size_t   pathlen;
-    rc_t     rc = 0;
-    rc_t     rcaux = 0;
-    char     cpath [ 4096 ];
-    uint32_t type;
-
-    archive.v = _archive;
-    /* -----
-     * sanity check parameters  The first bunch is from the base class KDirectory.
-     */
-    if ( pdir == NULL )
-    {
-        if ( !silent )
-            PLOGMSG ( klogErr, ( klogErr,
-                      "NULL parameter for the root KArcDir for $(file)",
-                       PLOG_S ( file ),
-                       path ) );
-        return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcNull );
-    }
-    *pdir = NULL;
-
-    if ( self == NULL )
-    {
-        if ( !silent )
-            PLOGMSG ( klogErr, ( klogErr,
-                      "NULL parameter for self for $(file)",
-                      PLOG_S ( file ),
-                      path ) );
-        return RC ( rcFS, rcDirectory, rcOpening, rcSelf, rcNull );
-    }
-
-    if ( path == NULL )
-    {
-        if ( !silent )
-            PLOGMSG ( klogErr,( klogErr,
-                      "NULL parameter for the root KArcDir for $(file)",
-                      PLOG_S ( file ),
-                      path ) );
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    }
-
-    if ( path[0] == 0x00 )
-    {
-        if ( !silent )
-            PLOGMSG ( klogErr,( klogErr,
-                      "NULL string for the root KArcDir for $(file)",
-                      PLOG_S ( file ),
-                      path ) );
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-    }
-
-    if (_archive == NULL)
-    {
-        /* -----
-         * we got a local String type mixed in along with ASCIZ cstrings
-         */
-        rc = KDirectoryResolvePath ( self, true, cpath, sizeof (cpath), path );
-        if ( rc == 0 )
-        {
-            size_t ln;
-            ln = strlen (cpath);
-            if ((cpath[ln-1] == '.')&&(cpath[ln-2] == '/'))
-                cpath[ln-2] = '\0';
-        }
-        else
-            return rc;
-    }
-    else
-    {
-        size_t ln;
-
-        rc = string_printf (cpath, sizeof cpath, &ln, path);
-        if ((rc == 0) && (ln > sizeof cpath))
-            rc = RC (rcFS, rcArc, rcOpening, rcBuffer, rcInsufficient);
-    }
-
-    StringInitCString ( &spath, cpath );
-    pathlen = strlen ( cpath );
-
-    if (_archive != NULL)
-    {
-        switch (baseType)
-        {
-        case tocKFile:
-            rc = KFileAddRef (_archive);
-            break;
-        case tocKDirectory:
-            rc = KDirectoryAddRef (_archive);
-            break;
-        default:
-            /* i dunno */
-            break;
-        }
-        if (rc)
-            return rc;
-    }
-    else
-    {
-        type = KDirectoryVPathType ( self, cpath, NULL );
-        switch ( type & ~kptAlias )
-        {
-        default:
-            rc = RC ( rcFS, rcArc, rcOpening, rcFile, rcUnexpected );
-            if ( !silent )
-                LOGERR (klogErr, rc, "Unusable file type" );
-            break;
-        case kptNotFound:
-        case kptBadPath:
-            rc = RC ( rcFS, rcArc, rcOpening, rcFile, rcNotFound );
-            break;
-
-        case kptFile:
-            /* -----
-             * Open the archive file as a KFILE for internal use
-             *
-             * Fail / quit if we couldn't
-             */
-            if ( baseType != tocKFile )
-            {
-                rc = RC ( rcFS, rcArc, rcOpening, rcFile, rcIncorrect );
-                if ( !silent )
-                    LOGERR ( klogErr, rc, "Mismatch of file type and expected type" );
-                return rc;
-            }
-
-            rc = KDirectoryVOpenFileRead ( self, &archive.f, cpath, NULL );
-            if ( rc != 0 && !silent )
-            {
-                PLOGERR ( klogErr, ( klogErr, rc,
-                                     "Failed to open archive file $(file)",
-                                     PLOG_S (file),
-                                     path ) );
-            }
-        
-            break;
-
-        case kptDir:
-            if ( baseType != tocKDirectory )
-            {
-                rc = RC ( rcFS, rcArc, rcOpening, rcFile, rcInconsistent );
-                if ( !silent )
-                    LOGERR ( klogErr, rc, "Mismatch of file type and expected type" );
-                return rc;
-            }
-
-            rc = KDirectoryVOpenDirRead ( self, &archive.d, false, cpath, NULL );
-            if ( rc != 0 && !silent )
-            {
-                PLOGMSG ( klogErr,
-                          ( klogErr, "Failed to open archive directory $(file)",
-                            PLOG_S ( file ), path ) );
-            }
-            break;
-        } /* switch ( type & ~kptAlias ) */
-    }
-    if ( rc == 0 )
-    {
-        /* -----
-         * Build the TOC necessary to get to all internal files and subdirectories
-         * Any sub KArcDir or KFile created will also need to reference the same TOC
-         */
-        rc = KTocInit ( &toc, &spath, baseType, archive.v, sraAlign4Byte );
-        if ( rc != 0 )
-        {
-            if ( !silent )
-                PLOGERR ( klogErr, 
-                     ( klogErr, rc, "Failed to initialize Table of Contents for $(path)", 
-                     PLOG_S ( path ), cpath ) );
-        }
-        else
-        {
-            const KTocEntry * node;
-
-            node = KTocGetRoot( toc );
-
-            rc = KArcDirMake (&arcdir,      /* where to build the KArcDir */
-                              rcAccessing,  /* funky RC replacement thingie */
-                              self,         /* parent KDirectory - for previous path */
-                              toc,          /* table of contents structure for this archive */
-                              node,         /* archive "root" has no node */
-                              archive.v,    /* KFile for the archive */
-                              baseType,     /* base type o archive */
-                              0,            /* dad_root */
-                              cpath,        /* path to archive will be the path of the directory */
-                              (uint32_t)pathlen, /* length of path (the Init will append "/") */
-                              true,         /* readonly */
-                              false);       /* not chroot */
-            if ( rc != 0 )
-            {
-                if ( !silent )
-                PLOGERR ( klogErr, 
-                          ( klogErr, rc, "Failed to allocate for the root KArcDir for $(file)",
-                          PLOG_S ( file ), path ) );
-            }
-            else
-            {
-                rc = parse( toc,archive.v, filter, filterparam );
-                if ( rc == RC ( rcFS, rcArc, rcParsing, rcToc, rcIncomplete ) )
-                {
-                    rcaux = rc;
-                    rc = 0;
-                }
-                if ( rc != 0 )
-                {
-                    if ( !silent )
-                        PLOGERR ( klogErr, 
-                             ( klogErr, rc, "Failed to parse $(file)",
-                             PLOG_S ( file ), cpath ) );
-                }
-                else
-                {
-                    *pdir = &arcdir->dad;
-                }
-            }
-        }
-    }
-    /* -----
-     * if rc is non-zero we failed somewhere above.
-     * Release allocated memory and exit with that error code.
-     */
-    if ( archive.v != NULL )
-    {
-        switch ( baseType )
-        {
-        default:
-            free ( (void*)archive.v );
-            break;
-        case tocKFile:
-            KFileRelease ( archive.f );
-            break;
-        case tocKDirectory:
-            KDirectoryRelease ( archive.d );
-            break;
-        }
-    }
-
-    rc = rc | rcaux;
-
-    if ( rc != 0 )
-    {
-        if ( arcdir != NULL )
-            KDirectoryRelease ( &arcdir->dad );
-        *pdir = NULL;
-    }
-
-    if ( toc != NULL )
-        KTocRelease ( toc );
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KDirectoryOpenArcDirRead
- *  Open an archive file as a KDirectory derived type: made to match 
- *  KDirectoryOpenDirRead() where parse could be the first element of arg
- *
- * Much of the code in this function is copied directly from KDirectoryVOpenDirRead
- *
- * [IN]  dir   A KDirectory (of any derived type) to reach the archive file
- * [OUT] pdir  The KDirectory (of type KArcDir)
- * [IN]  chroot if non-zero, the new directory becomes chroot'd and interprets paths
- *       stating with '/'
- * [IN]  path   The path to the archive - this will decome the directory path
- * [IN]  parse  A pointer to the function needed to build a TOC by parsing the file
- *
- * This function is made difficult because a path is not a global type.  Where we
- * would like to be able to take path and args and have them parsed nicely as they
- * are for KSysDir or KArcDir with nearly identical functions those functions are
- * not available here as self is a KDirectory but we do not know and should not know
- * whether it is a KSysDir or KArcDir.  Unfortunately KSysDir was made overly opaque.
- * [this is a result of providing full encapsulation, i.e. KDirectory is ONLY an
- *  interface and there is no implementation provided.][well very little]
- * If we could take path and args (path and ...) and pass them to a function
- * equivalent to KSysDirMakePath we would be able to do this right.  Or if we could
- * ask the self what it's path was and what it considered size and root we could do
- * the path build here and tidy up properly what we got.  .As is, we have  to be more
- * limited.
- *
- * We will have to wait and fix this right in directory.c where we can instead have
- * an attempt to open using KDirectory[V]OpenDirRead() check if when it tries to
- * open a directory but instead finds it has been given a path it will try to parse 
- * the file using a known set of parse functions to see if the file can be treated
- * as a directory. Then this function can be called from KDirectoryOpenDirRead.
- */
-LIB_EXPORT rc_t CC KDirectoryOpenArcDirRead( const KDirectory * self,
-    const KDirectory ** pdir,
-    bool chroot,
-    const char * path,
-    KArcFSType baseType,
-    rc_t ( CC * parse )( KToc *, const void *,
-        bool( CC * )( const KDirectory *, const char *, void * ), void * ),
-    bool ( CC * filter )( const KDirectory*, const char *, void *),
-    void * filterparam )
-{
-    return KDirectoryOpenArcDirRead_intern( self,
-        pdir,
-        chroot, 
-        false,
-        path,
-        baseType,
-        NULL,
-        parse,
-        filter,
-        filterparam );
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryOpenArcDirRead_silent( const KDirectory * self,
-    const KDirectory ** pdir,
-    bool chroot,
-    const char * path,
-    KArcFSType baseType,
-    rc_t ( CC * parse )( KToc *, const void *,
-        bool( CC * )( const KDirectory *, const char *, void * ), void * ),
-    bool ( CC * filter )( const KDirectory*, const char *, void *),
-    void * filterparam )
-{
-    return KDirectoryOpenArcDirRead_intern( self,
-        pdir,
-        chroot, 
-        true,
-        path, 
-        baseType,
-        NULL,
-        parse,
-        filter,
-        filterparam );
-}
-LIB_EXPORT rc_t CC KDirectoryOpenArcDirRead_silent_preopened( const KDirectory * self,
-    const KDirectory ** pdir,
-    bool chroot,
-    const char * path,
-    KArcFSType baseType,
-    void * archive,
-    rc_t ( CC * parse )( KToc *, const void *,
-        bool( CC * )( const KDirectory *, const char *, void * ), void * ),
-    bool ( CC * filter )( const KDirectory*, const char *, void *),
-    void * filterparam )
-{
-    return KDirectoryOpenArcDirRead_intern( self,
-        pdir,
-        chroot, 
-        true,
-        path, 
-        baseType,
-        archive,
-        parse,
-        filter,
-        filterparam );
-}
-
-
-/* ======================================================================
- * 
- */
-typedef struct KArcDirPersistVisitFuncData
-{
-    Vector * vector;
-    KArcDir * dir;
-    char path[4096];
-} KArcDirPersistVisitFuncData;
-
-
-static
-rc_t CC KArcDirPersistVisitFunc (const KDirectory * dir, uint32_t unused_type, const char * name, void * data)
-{
-    KPathType type;
-    KArcDirPersistVisitFuncData * vdata;
-    char * path;
-    size_t len = 0;
-    rc_t rc;
-
-    rc = 0;
-    vdata = data;
-
-    type = (KPathType)KDirectoryPathType (dir, name, NULL);
-    switch (type)
-    {
-    default:
-	return 0;
-    case kptDir:
-	len = strlen (vdata->path);
-	if (len > 0)
-	{
-	    vdata->path[len] = '/';
-	    strcpy (vdata->path+len+1, name);
-	}
-	else
-	    strcpy (vdata->path, name);
-
-
-/* this needs cleaning up - dir moved along but path did not.  path handling is weak through out */
-/* 	rc = KArcDirVisit ((const KArcDir*)dir, false, KArcDirPersistVisitFunc, data, vdata->path, NULL); */
-	rc = KArcDirVisit ((const KArcDir*)dir, false, KArcDirPersistVisitFunc, data, name, NULL);
-	if (rc != 0)
-	{
-	    LOGERR (klogInt, rc, "KArcDirPersist Visit failed");
-	}
-	vdata->path[len] = '\0';
-	return rc;
-    case kptFile:
-    case kptFile|kptAlias:
-	len = strlen (vdata->path);
-	if (len > 0)
-	{
-	    vdata->path[len] = '/';
-	    strcpy (vdata->path+len+1, name);
-	}
-	else
-	    strcpy (vdata->path, name);
-	path = malloc (strlen(vdata->path)+1);
-	if (path == NULL)
-	{
-	    rc = RC (rcFS, rcArc, rcReindexing, rcMemory, rcExhausted);
-	}
-	else
-	{
-	    strcpy (path, vdata->path);
-	    rc = VectorAppend (vdata->vector, NULL, path);
-	}
-	vdata->path[len] = '\0';
-
-	return rc;
-    }
-}
-
-static
-void CC whack ( void *item, void *data )
-{
-    free (item);
-}
-
-/* ========================================
- * Build a Persisted version of a TOC in a buffer
- * return the allocated buffer
- */
-#ifdef _DEBUGGING
-static
-void CC write_entry( void * item, void *data)
-{
-    const char * path = item;
-    uint32_t * count = data;
-
-    TOC_SORT(("%3u: %s\n", *count, path));
-
-    (*count)++;
-}
-#endif
-rc_t KArcDirPersistHeader (const KArcDir * self,
-                           void ** buffer,
-                           size_t * buffer_size,
-                           uint64_t * file_size,
-                           KSRAFileAlignment align,
-                           rc_t (CC*usort)(const KDirectory*, Vector*))
-{
-    rc_t         rc;
-    const KToc * toc;
-
-    FUNC_ENTRY();
-
-    if (self == NULL)
-    {
-	rc = RC (rcFS, rcDirectory, rcPersisting, rcSelf, rcNull);
-	LOGERR (klogInt, rc, "KArcDirPersist Self is NULL");
-	return rc;
-    }
-    if (buffer == NULL)
-    {
-	rc = RC (rcFS, rcDirectory, rcPersisting, rcParam, rcNull);
-	LOGERR (klogInt, rc, "KArcDirPersist buffer is NULL");
-	return rc;
-    }
-    rc = KArcDirGetTOC (self, &toc);
-    if (rc != 0)
-        LOGERR (klogInt, rc, "KArcDirPersist TOC retrieval failed");
-    else
-    {
-        /* mutable field as it only applies to this specific operation */
-        rc = KTocAlignmentSet ((KToc*)toc, align);
-        if (rc != 0)
-            LOGERR (klogInt, rc, "KArcDirPersist TOC alignment failed");
-        else
-        {
-            Vector filevector;
-            KArcDirPersistVisitFuncData	data;
-
-            VectorInit (&filevector, 0, 0);
-
-            data.path[0] = '\0'; /* looks like "" */
-            data.vector = &filevector;
-
-
-            rc = KArcDirVisit (self, false, KArcDirPersistVisitFunc, &data, ".", NULL);
-            if (rc != 0)
-            {
-                LOGERR (klogInt, rc, "KArcDirPersist Visit failed");
-            }
-            else
-            {
-
-#ifdef _DEBUGGING
-/* this loop and the next just can be used in a debug build to verify the sorting function used */
-                {
-                    uint32_t ix;
-                    TOC_SORT (("Pre-sort order:\n"));
-
-                    ix = 1;
-                    VectorForEach ( &filevector, false, write_entry, &ix);
-                }
-#endif
-
-                if (usort)
-                    rc = usort(&self->dad, &filevector);
-
-#ifdef _DEBUGGING
-                {
-                    uint32_t ix;
-                    TOC_SORT (("Post-sort order:\n"));
-
-                    ix = 1;
-                    VectorForEach ( &filevector, false, write_entry, &ix);
-                }
-#endif
-
-
-                if (rc != 0)
-                {
-                    LOGERR (klogInt, rc, "KArcDirPersist user sort failed failed");
-                }
-                else
-                {
-                    rc = KTocPersist (toc, buffer, buffer_size, file_size, &filevector);
-                    if (rc != 0)
-                        LOGERR (klogInt, rc, "KArcDirPersist TOC retrieval failed");
-                }
-            }
-/*     free (data.path); */
-            VectorWhack (&filevector, whack, NULL);
-	}
-    }
- 
-    return rc;
-}
-
-
-/* end of file arc.c */
-
diff --git a/libs/kfs/arrayfile.c b/libs/kfs/arrayfile.c
deleted file mode 100644
index 0f19006..0000000
--- a/libs/kfs/arrayfile.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-
-/*--------------------------------------------------------------------------
- * KArrayFile
- */
-
-
-/* Destroy
- *  destroy array-file
- */
-LIB_EXPORT rc_t CC KArrayFileDestroy ( KArrayFile *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcDestroying, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . destroy ) ( self );
-    }
-
-    return RC ( rcFS, rcFile, rcDestroying, rcInterface, rcBadVersion );
-}
-
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KArrayFileAddRef ( const KArrayFile *self )
-{
-    if ( self != NULL )
-        atomic32_inc ( & ( ( KArrayFile* ) self ) -> refcount );
-    return 0;
-}
-
-/* Release
- *  discard reference to file
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KArrayFileRelease ( const KArrayFile *cself )
-{
-    KArrayFile *self = ( KArrayFile* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            rc_t rc = KArrayFileDestroy ( self );
-            if ( rc != 0 )
-                atomic32_set ( & self -> refcount, 1 );
-            return rc;
-        }
-    }
-    return 0;
-}
-
-/* Dimensionality
- *  returns the number of dimensions in the ArrayFile
- *
- *  "dim" [ OUT ] - return parameter for number of dimensions
- */
-LIB_EXPORT rc_t CC KArrayFileDimensionality ( const KArrayFile *self, uint8_t *dim )
-{
-    if ( dim == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-
-    * dim = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . dimensionality ) ( self, dim );
-    }
-
-    return RC ( rcFS, rcFile, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* SetDimensionality
- *  sets the number of dimensions in the ArrayFile
- *
- *  "dim" [ IN ] - new number of dimensions; must be > 0
- */
-LIB_EXPORT rc_t CC KArrayFileSetDimensionality ( KArrayFile *self, uint8_t dim )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcResizing, rcSelf, rcNull );
-
-    if ( dim == 0 )
-        return RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcResizing, rcFile, rcNoPerm );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . set_dimensionality ) ( self, dim );
-    }
-
-    return RC ( rcFS, rcFile, rcResizing, rcInterface, rcBadVersion );
-}
-
-
-/* DimExtents
- *  returns the extent of every dimension
- *
- *  "dim" [ IN ] - the dimensionality of "extents"
- *
- *  "extents" [ OUT ] - returns the extent for every dimension
- */
-LIB_EXPORT rc_t CC KArrayFileDimExtents ( const KArrayFile *self, uint8_t dim, uint64_t *extents )
-{
-    uint8_t i;
-    if ( extents == NULL || dim == 0 )
-        return RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-
-    for ( i = 0; i < dim; ++i )
-        extents[ i ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . dim_extents ) ( self, dim, extents );
-    }
-
-    return RC ( rcFS, rcFile, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* SetDimExtents
- *  sets the new extents for every dimension
- *
- *  "dim" [ IN ] - the dimensionality of "extents"
- *
- *  "extents" [ IN ] - new extents for every dimension
- */
-LIB_EXPORT rc_t CC KArrayFileSetDimExtents ( KArrayFile *self, uint8_t dim, uint64_t *extents )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcResizing, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcResizing, rcFile, rcNoPerm );
-
-    if ( extents == NULL || dim == 0 )
-        return RC ( rcFS, rcFile, rcResizing, rcParam, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . set_dim_extents ) ( self, dim, extents );
-    }
-
-    return RC ( rcFS, rcFile, rcResizing, rcInterface, rcBadVersion );
-}
-
-
-/* ElementSize
- *  returns the element size in bits
- *
- *  "elem_bits" [ OUT ] - size of each element in bits
- */
-LIB_EXPORT rc_t CC KArrayFileElementSize ( const KArrayFile *self, uint64_t *elem_bits )
-{
-    if ( elem_bits == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-
-    *elem_bits = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . element_size ) ( self, elem_bits );
-    }
-
-    return RC ( rcFS, rcFile, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* Read
- *  read from n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional starting position in elements
- *
- *  "buffer" [ OUT ] and "elem_count" [ IN ] - return buffer for read
- *  where "elem_count" is n-dimensional in elements
- *
- *  "num_read" [ OUT ] - n-dimensional return parameter giving back
- *      the number of read elements in every dimension
- */
-LIB_EXPORT rc_t CC KArrayFileRead ( const KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, void *buffer, const uint64_t *elem_count,
-    uint64_t *num_read )
-{
-    uint8_t i;
-    if ( num_read == NULL || pos == NULL || elem_count == NULL || dim == 0 )
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    for ( i = 0; i < dim; ++i )
-        num_read[ i ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcFS, rcFile, rcReading, rcFile, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . read ) ( self, dim, pos, buffer, elem_count, num_read );
-    }
-
-    return RC ( rcFS, rcFile, rcReading, rcInterface, rcBadVersion );
-}
-
-
-/* Read_v
- *  read one element of variable length from n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional starting position in elements
- *
- *  "buffer" [ OUT ] and "elem_count" [ IN ] - return buffer for read
- *  where "elem_count" is length of buffer in elements
- *
- *  "num_read" [ OUT ] - return parameter giving back
- *      the number of read elements in every dimension
- */
-LIB_EXPORT rc_t CC KArrayFileRead_v ( const KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, void *buffer, const uint64_t elem_count,
-    uint64_t *num_read )
-{
-    if ( num_read == NULL || pos == NULL || elem_count == 0 || dim == 0 )
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    *num_read = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcFS, rcFile, rcReading, rcFile, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . read_v ) ( self, dim, pos, buffer, elem_count, num_read );
-    }
-
-    return RC ( rcFS, rcFile, rcReading, rcInterface, rcBadVersion );
-}
-
-
-/* Write
- *  write into n-dimensional position
- *
- *  "dim" [ IN ] - the dimensionality of all vectors
- *
- *  "pos"  [ IN ] - n-dimensional offset where to write to
- *                   in elements
- *
- *  "buffer" [ IN ] and "elem_count" [ IN ] - data to be written
- *  where "elem_count" is n-dimensional in elements
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of elements actually written per dimension
- */
-LIB_EXPORT rc_t CC KArrayFileWrite ( KArrayFile *self, uint8_t dim,
-    const uint64_t *pos, const void *buffer, const uint64_t *elem_count,
-    uint64_t *num_writ )
-{
-    uint8_t i;
-    if ( num_writ == NULL || pos == NULL || elem_count == NULL || dim == 0 )
-        return RC ( rcFS, rcFile, rcWriting, rcParam, rcNull );
-
-    for ( i = 0; i < dim; ++i )
-        num_writ[ i ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcWriting, rcFile, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . write ) ( self, dim, pos, buffer, elem_count, num_writ );
-    }
-
-    return RC ( rcFS, rcFile, rcWriting, rcInterface, rcBadVersion );
-}
-
-
-/* GetMeta
- *  extracts metadata into a string-vector
- *
- *  "key"   [ IN ]  - the key which part of the metadata to retrieve
- *
- *  "list"  [ OUT ] - pointer to a KNamelist-pointer
- *
- */
-LIB_EXPORT rc_t CC KArrayFileGetMeta ( struct KArrayFile const *self, const char *key,
-    const struct KNamelist **list )
-{
-    if ( key == NULL || list == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-
-    *list = NULL;
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . get_meta ) ( self, key, list );
-    }
-
-    return RC ( rcFS, rcFile, rcWriting, rcInterface, rcBadVersion );
-}
-
-
-/* Init
- *  initialize a newly allocated file object
- */
-LIB_EXPORT rc_t CC KArrayFileInit ( KArrayFile *self, const KArrayFile_vt *vt,
-    bool read_enabled, bool write_enabled )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcSelf, rcNull );
-    if ( vt == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-    switch ( vt -> v1 . maj )
-    {
-    case 0:
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcInvalid );
-
-    case 1:
-        switch ( vt -> v1 . min )
-        {
-            /* ADD NEW MINOR VERSION CASES HERE */
-        case 0:
-#if _DEBUGGING
-        if ( vt -> v1 . write == NULL              ||
-             vt -> v1 . read == NULL               ||
-             vt -> v1 . element_size == NULL       ||
-             vt -> v1 . set_dim_extents == NULL    ||
-             vt -> v1 . dim_extents == NULL        ||
-             vt -> v1 . set_dimensionality == NULL ||
-             vt -> v1 . dimensionality == NULL     ||
-             vt -> v1 . get_meta == NULL           ||
-             vt -> v1 . destroy == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            break;
-        default:
-            return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcBadVersion );
-        }
-        break;
-
-    default:
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcBadVersion );
-    }
-
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, "KArrayFile", "Creating", "-" );
-    self -> read_enabled = ( uint8_t ) ( read_enabled != 0 );
-    self -> write_enabled = ( uint8_t ) ( write_enabled != 0 );
-
-    return 0;
-}
diff --git a/libs/kfs/buffile-read.c b/libs/kfs/buffile-read.c
deleted file mode 100644
index 7635568..0000000
--- a/libs/kfs/buffile-read.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-typedef struct KBufReadFile KBufReadFile;
-#define KFILE_IMPL KBufReadFile
-
-#include <kfs/extern.h>
-
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-
-/*-----------------------------------------------------------------------
- * KBufReadFile
- */
-struct KBufReadFile
-{
-    KFile dad;
-
-    uint64_t pos;       /* position of buff within the original file */
-
-    const KFile *f;           /* original file being buffered */
-
-    size_t bsize;       /* size of the buffer */
-    size_t num_valid;   /* how much of the buffer is actually valid */
-
-    uint8_t buff [ 1 ];
-};
-
-static
-rc_t CC KBufReadFileDestroy ( KBufReadFile *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-static
-struct KSysFile* CC KBufReadFileSysFile ( const KBufReadFile *self, uint64_t *offset )
-{
-    /* does not support SysFile */
-    * offset = 0;
-    return NULL;
-}
-
-static
-rc_t CC KBufReadFileRandomAccess ( const KBufReadFile *self )
-{
-    return KFileRandomAccess ( self -> f );
-}
-
-static
-rc_t CC KBufReadFileSize ( const KBufReadFile *self, uint64_t *size )
-{
-    return KFileSize ( self -> f, size );
-}
-
-static
-rc_t CC KBufReadFileSetSize ( KBufReadFile *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-static
-rc_t CC KBufReadFileRead ( const KBufReadFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-
-    assert (cself);
-    assert (buffer);
-    assert (num_read);
-
-    /* start assuming nothing will be read */
-    *num_read = 0;
-
-    if (bsize != 0)
-    {
-        KBufReadFile * self = (KBufReadFile *)cself;
-        uint64_t new_pos; 
-        size_t new_offset;
-
-        /* cast might be a no-op */
-        new_offset = (size_t)(pos % cself->bsize);
-        new_pos = pos - new_offset;
-
-        /* we need to read if we are on the wrong 'sector page'
-         * or the current 'sector page' isn't long enough.
-         *
-         * If on the wrong page just kill the contents
-         */
-        if (new_pos != cself->pos)
-        {
-            self->num_valid = 0;
-            self->pos = new_pos;
-        }
-
-        /* new we agree on the 'sector page' even if we have nothing
-         * valid in it */
-        if ((self->num_valid == 0) || (self->num_valid <= (size_t)new_offset))
-        {
-            size_t new_num_read;
-            rc = KFileReadAll (self->f, self->pos + self->num_valid,
-                               self->buff + self->num_valid, 
-                               self->bsize - self->num_valid,
-                               &new_num_read);
-            if (rc == 0)
-                self->num_valid += new_num_read;
-        }
-
-        /* now we have all we're gonna get this time */
-        if (new_offset < self->num_valid)
-        {
-            size_t to_copy;
-
-            to_copy = self->num_valid - new_offset;
-            if (to_copy > bsize)
-                to_copy = bsize;
-            
-            memmove (buffer, self->buff + new_offset, to_copy);
-            *num_read = to_copy;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC KBufReadFileWrite ( KBufReadFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcFS, rcFile, rcWriting, rcFunction, rcUnsupported );
-}
-
-static
-uint32_t CC KBufReadFileType ( const KBufReadFile * self )
-{
-    return KFileType ( self -> f );
-}
-
-static
-rc_t KBufReadFileMake ( KBufReadFile ** bp, const KFile *f, size_t bsize,
-    const KFile_vt *vt, bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-
-    KBufReadFile *buf = calloc ( sizeof * buf - 1 + bsize, 1 );
-    if ( buf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KFileInit ( & buf -> dad, vt, "KBufReadFile", "no-name", read_enabled, write_enabled );
-        if ( rc == 0 )
-        {
-            rc = KFileAddRef ( f );
-            if ( rc == 0 )
-            {
-                buf -> f = ( KFile* ) f;
-                buf -> bsize = bsize;
-                * bp = buf;
-                return 0;
-            }
-        }
-
-        free ( buf );
-    }
-
-    return rc;
-}
-
-/* MakeBufferedWrite
- *  make a writable file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "bsize" [ IN ] - buffer size
- */
-
-static
-const KFile_vt_v1 vtKBufReadFileRandWR_v1 =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KBufReadFileDestroy,
-    KBufReadFileSysFile,
-    KBufReadFileRandomAccess,
-    KBufReadFileSize,
-    KBufReadFileSetSize,
-    KBufReadFileRead,
-    KBufReadFileWrite,
-
-    /* 1.1 */
-    KBufReadFileType
-};
-
-LIB_EXPORT 
-rc_t CC KBufReadFileMakeRead ( const KFile ** bp, const KFile * original, size_t bsize )
-{
-    rc_t rc;
-
-    if ( bp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( original == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! original -> read_enabled )
-        {
-            if ( original -> write_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcWriteonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            KBufReadFile *buf;
-            rc = KBufReadFileMake ( & buf, original, bsize,
-                ( const KFile_vt* ) & vtKBufReadFileRandWR_v1, true, false );
-            if ( rc == 0 )
-            {
-                * bp = & buf -> dad;
-                return 0;
-            }
-        }
-
-        * bp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/buffile-write.c b/libs/kfs/buffile-write.c
deleted file mode 100644
index 1d46ce9..0000000
--- a/libs/kfs/buffile-write.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-typedef struct KBufWriteFile KBufWriteFile;
-#define KFILE_IMPL KBufWriteFile
-
-#include <kfs/extern.h>
-
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-
-/*-----------------------------------------------------------------------
- * KBufWriteFile
- */
-struct KBufWriteFile
-{
-    KFile dad;
-
-    uint64_t pos;
-
-    KFile *f;
-
-    size_t bsize;
-    size_t num_valid;
-
-    uint8_t buff [ 1 ];
-};
-
-static
-rc_t CC KBufWriteFileDestroy ( KBufWriteFile *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-static
-rc_t KBufWriteFileFlush ( KBufWriteFile *self, uint64_t dpos )
-{
-    rc_t rc;
-    size_t total_writ, partial;
-
-    /* flush buffer */
-    for ( rc = 0, total_writ = 0; total_writ < self -> num_valid; total_writ += partial )
-    {
-        rc = KFileWrite ( self -> f, dpos + total_writ,
-            & self -> buff [ total_writ ],
-            self -> num_valid - total_writ, & partial );
-        if ( rc != 0 )
-            break;
-        if ( partial == 0 )
-        {
-            rc = RC ( rcFS, rcFile, rcWriting, rcTransfer, rcIncomplete );
-            break;
-        }
-    }
-
-    if ( rc == 0 )
-        self -> num_valid = 0;
-
-    return rc;
-}
-
-static
-rc_t CC KBufWriteFileFlushDestroy ( KBufWriteFile *self )
-{
-    rc_t rc = KBufWriteFileFlush ( self, self -> pos );
-    if ( rc == 0 )
-        rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-static
-struct KSysFile* CC KBufWriteFileNoSysFile ( const KBufWriteFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return NULL;
-}
-
-static
-rc_t CC KBufWriteFileRandomAccess ( const KBufWriteFile *self )
-{
-    return KFileRandomAccess ( self -> f );
-}
-
-static
-rc_t CC KBufWriteFileSize ( const KBufWriteFile *self, uint64_t *size )
-{
-    return KFileSize ( self -> f, size );
-}
-
-static
-rc_t CC KBufWriteFileSetSize ( KBufWriteFile *self, uint64_t size )
-{
-    if ( self -> pos + self -> num_valid > size )
-    {
-        if ( self -> pos < size )
-        {
-            size_t total, num_writ, to_write = ( size_t ) ( size - self -> pos );
-            for ( total = 0; total < to_write; total += num_writ )
-            {
-                rc_t rc = KFileWrite ( self -> f, self -> pos + total,
-                    & self -> buff [ total ], to_write - total, & num_writ );
-                if ( rc != 0 )
-                    return rc;
-                if ( num_writ == 0 )
-                    return RC ( rcFS, rcFile, rcReading, rcTransfer, rcIncomplete );
-            }
-        }
-
-        self -> pos = 0;
-        self -> num_valid = 0;
-    }
-
-    return KFileSetSize ( self -> f, size );
-}
-
-static
-rc_t CC KBufWriteFileNoRead ( const KBufWriteFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    return RC ( rcFS, rcFile, rcReading, rcFunction, rcUnsupported );
-}
-
-static
-rc_t CC KBufWriteFileWrite ( KBufWriteFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    size_t total, partial, trailing;
-
-    const uint8_t *bbuff = buffer;
-    uint64_t send = pos + size;
-
-    /* case 1: empty write */
-    if ( size == 0 )
-    {
-        * num_writ = 0;
-        return 0;
-    }
-
-    /* perform write */
-    for ( rc = 0, total = trailing = 0; total < size; total += partial )
-    {
-        size_t boff = total - trailing;
-        uint64_t dpos = self -> pos;
-        uint64_t dend = self -> pos + self -> num_valid;
-        uint64_t dlim = self -> pos + self -> bsize;
-        uint64_t spos = pos + boff;
-
-        /* case 2: left within buffer */
-        if ( dpos <= spos && spos <= dend && spos < dlim )
-        {
-            partial = ( size_t ) ( ( dlim < send ? dlim : send ) - spos );
-            memcpy ( & self -> buff [ spos - dpos ], & bbuff [ boff ], partial );
-            if ( spos + partial > dend )
-            {
-                dend = spos + partial;
-                self -> num_valid = ( size_t ) ( dend - dpos );
-            }
-        }
-
-        /* case 3: right within buffer */
-        else if ( spos < dpos && dpos < send && send <= dlim )
-        {
-            partial = ( size_t ) ( send - dpos );
-            memcpy ( & self -> buff [ spos - dpos ], & bbuff [ boff ], partial );
-            if ( send > dend )
-            {
-                dend = send;
-                self -> num_valid = ( size_t ) ( dend - dpos );
-            }
-
-            /* adjust other components for trailing copy */
-            assert ( trailing == 0 );
-            trailing = partial;
-            send = dpos;
-        }
-
-        /* case 4: no intersection */
-        else if ( send <= dpos || dend <= spos )
-        {
-            /* flush buffer as-is */
-            rc = KBufWriteFileFlush ( self, dpos );
-            if ( rc != 0 )
-                break;
-
-            /* empty buffer centered on this write */
-            self -> pos = spos;
-
-            /* if write is >= buffer size, just write it directy */
-            partial = size - total;
-            if ( partial < self -> bsize )
-            {
-                memcpy ( self -> buff, & bbuff [ boff ], partial );
-                self -> num_valid = partial;
-            }
-            else
-            {
-                rc = KFileWrite ( self -> f, spos, & bbuff [ boff ], partial, & partial );
-                if ( rc != 0 )
-                    break;
-                if ( partial == 0 )
-                {
-                    rc = RC ( rcFS, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                    break;
-                }
-            }
-        }
-
-        /* case 5: completely engulfs */
-        else
-        {
-            assert ( spos < dpos && dlim < send );
-            rc = KFileWrite ( self -> f, spos, & bbuff [ boff ], ( size_t ) ( send - spos ), & partial );
-            if ( rc != 0 )
-                break;
-            if ( partial == 0 )
-            {
-                rc = RC ( rcFS, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                break;
-            }
-
-            /* anything in the buffer is invalid now */
-            self -> num_valid = 0;
-        }
-    }
-
-    * num_writ = total;
-
-    return rc;
-}
-
-static
-uint32_t CC KBufWriteFileType ( const KBufWriteFile * self )
-{
-    return KFileType ( self -> f );
-}
-
-static
-rc_t KBufWriteFileMake ( KBufWriteFile ** bp, const KFile *f, size_t bsize,
-    const KFile_vt *vt, bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-
-    KBufWriteFile *buf = malloc ( sizeof * buf - 1 + bsize );
-    if ( buf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( buf, 0, sizeof * buf );
-        rc = KFileInit ( & buf -> dad, vt, "KBufWriteFile", "no-name", read_enabled, write_enabled );
-        if ( rc == 0 )
-        {
-            rc = KFileAddRef ( f );
-            if ( rc == 0 )
-            {
-                buf -> f = ( KFile* ) f;
-                buf -> bsize = bsize;
-                * bp = buf;
-                return 0;
-            }
-        }
-
-        free ( buf );
-    }
-
-    return rc;
-}
-
-/* MakeBufferedWrite
- *  make a writable file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "bsize" [ IN ] - buffer size
- */
-
-static
-const KFile_vt_v1 vtKBufWriteFileRandWR_v1 =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KBufWriteFileFlushDestroy,
-    KBufWriteFileNoSysFile,
-    KBufWriteFileRandomAccess,
-    KBufWriteFileSize,
-    KBufWriteFileSetSize,
-    KBufWriteFileNoRead,
-    KBufWriteFileWrite,
-
-    /* 1.1 */
-    KBufWriteFileType
-};
-
-LIB_EXPORT rc_t KBufWriteFileMakeWrite ( KFile ** bp, KFile * original, size_t bsize )
-{
-    rc_t rc;
-
-    if ( bp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( original == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! original -> write_enabled )
-        {
-            if ( original -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            KBufWriteFile *buf;
-            rc = KBufWriteFileMake ( & buf, original, bsize,
-                ( const KFile_vt* ) & vtKBufWriteFileRandWR_v1, false, true );
-            if ( rc == 0 )
-            {
-                * bp = & buf -> dad;
-                return 0;
-            }
-        }
-
-        * bp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/buffile.c b/libs/kfs/buffile.c
deleted file mode 100644
index ecff70c..0000000
--- a/libs/kfs/buffile.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#define KFILE_IMPL struct KBufFile
-
-#include <kfs/extern.h>
-#include <kfs/buffile.h>
-
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <kfs/pagefile.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-rc_t KBufWriteFileMakeWrite ( KFile ** bp, KFile * original, size_t bsize );
-
-
-/*-----------------------------------------------------------------------
- * KBufFile
- */
-typedef struct KBufFile KBufFile;
-struct KBufFile
-{
-    KFile dad;
-
-    uint64_t max_write;
-
-    KFile *f;
-    KPageFile *pf;
-
-    KPage *pg;
-    size_t pgsize;
-    uint32_t pgid;
-};
-
-
-#define KBufFileSerialAccess( self ) \
-    ( ( const KFile* ) & ( self ) -> dad ) -> align [ 0 ]
-
-#define KBufFileSetSerialAccess( self, val ) \
-    ( self ) -> dad . align [ 0 ] = ( val )
-    
-
-static
-rc_t CC KBufFileDestroy ( KBufFile *self )
-{
-    rc_t rc = KPageRelease ( self -> pg );
-    if ( rc == 0 )
-    {
-        self -> pg = NULL;
-        self -> pgid = 0;
-
-        rc = KPageFileRelease ( self -> pf );
-        if ( rc == 0 )
-        {
-            KFileRelease ( self -> f );
-            free ( self );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC KBufFileDestroyTrunc ( KBufFile *self )
-{
-    /* grab some information */
-    KFile *f = self -> f;
-    rc_t rc = KFileAddRef ( self -> f );
-    uint64_t max_write = self -> max_write;
-
-    if ( rc == 0 )
-    {
-        /* destroy self and write all pages */
-        rc = KBufFileDestroy ( self );
-        if ( rc == 0 )
-            rc = KFileSetSize ( f, max_write );
-
-        KFileRelease ( f );
-    }
-    return rc;
-}
-
-static
-struct KSysFile* CC KBufFileGetSysFile ( const KBufFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return NULL;
-}
-
-static
-rc_t CC KBufFileRandomAccess ( const KBufFile *self )
-{
-    return KFileRandomAccess ( self -> f );
-}
-
-static
-rc_t CC KBufFileSizeRead ( const KBufFile *self, uint64_t *size )
-{
-    uint64_t lsize, fsize;
-    rc_t rc = KPageFileSize ( self -> pf, & lsize, & fsize, NULL );
-
-    if ( rc != 0 )
-        * size = 0;
-    else
-        * size = fsize;
-
-    return rc;
-}
-
-static
-rc_t CC KBufFileSize ( const KBufFile *self, uint64_t *size )
-{
-    uint64_t lsize, fsize;
-    rc_t rc = KPageFileSize ( self -> pf, & lsize, & fsize, NULL );
-
-    if ( rc != 0 )
-        * size = 0;
-    else if ( lsize < fsize )
-        * size = fsize;
-    else
-        * size = lsize;
-
-    return rc;
-}
-
-static
-rc_t CC KBufFileSetSize ( KBufFile *self, uint64_t size )
-{
-    KPageRelease ( self -> pg );
-    self -> pg = NULL;
-    self -> pgid = 0;
-
-    return KPageFileSetSize ( self -> pf, size );
-}
-
-static
-rc_t CC KBufFileNoSetSize ( KBufFile *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcResizing, rcFunction, rcUnsupported );
-}
-
-static
-rc_t CC KBufFileRead ( const KBufFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    KBufFile *self = ( KBufFile* ) cself;
-
-    rc_t rc;
-    uint8_t *dst = buffer;
-    size_t total, partial;
-
-    for ( rc = 0, total = 0; total < bsize; pos += partial, total += partial )
-    {
-        const uint8_t *src;
-        size_t bytes, offset;
-
-        /* bytes remaining to be read */
-        size_t remain = bsize - total;
-
-        /* user wants to access this page */
-        uint32_t pgid = ( uint32_t ) ( pos / self -> pgsize ) + 1;
-
-        /* check against cached page */
-        if ( self -> pgid != pgid )
-        {
-            /* release previous page */
-            KPageRelease ( self -> pg );
-
-            /* get requested page */
-            rc = KPageFilePosGet ( self -> pf, & self -> pg, pos );
-            if ( rc != 0 )
-            {
-                if ( GetRCState ( rc ) == rcNotFound )
-                    rc = 0;
-
-                self -> pg = NULL;
-                self -> pgid = 0;
-                break;
-            }
-            self -> pgid = pgid;
-        }
-
-        /* access page memory */
-        rc = KPageAccessRead ( self -> pg, ( const void** ) & src, & bytes );
-        if ( rc != 0 )
-            break;
-
-        /* going to copy from page at the given offset */
-        offset = ( size_t ) ( pos % bytes );
-        assert ( bytes == self -> pgsize );
-
-        /* limit to end of file if serial access */
-        if ( KBufFileSerialAccess ( self ) )
-        {
-            uint64_t fsize;
-            rc = KPageFileSize ( self -> pf, NULL, & fsize, NULL );
-            if ( rc != 0 )
-                break;
-            if ( pgid * bytes > fsize )
-            {
-                bytes = ( size_t ) ( fsize % bytes ); 
-                if ( bytes <= offset )
-                    break;
-            }
-        }
-        /* limit to eof if read-only */
-        else if ( ! self -> dad . write_enabled )
-        {
-            if ( pgid * bytes > self -> max_write )
-            {
-                bytes = ( size_t ) ( self -> max_write % bytes ); 
-                if ( bytes <= offset )
-                    break;
-            }
-        }
-
-        /* limit bytes to request */
-        partial = bytes - offset;
-        if ( partial > remain )
-            partial = remain;
-
-        /* copy bytes */
-        memcpy ( & dst [ total ], & src [ offset ], partial );
-    }
-
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-
-    * num_read = 0;
-    return rc;
-}
-
-static
-rc_t CC KBufFileWrite ( KBufFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    size_t total, partial;
-    const uint8_t *src = buffer;
-
-    /* record start marker */
-    uint64_t start = pos;
-
-    for ( rc = 0, total = 0; total < size; pos += partial, total += partial )
-    {
-        uint8_t *dst;
-        size_t bytes, offset;
-
-        /* bytes remaining to be writ */
-        size_t remain = size - total;
-
-        /* user wants to access this page */
-        uint32_t pgid = ( uint32_t ) ( pos / self -> pgsize ) + 1;
-
-        /* check against cached page */
-        if ( self -> pgid != pgid )
-        {
-            /* release previous page */
-            KPageRelease ( self -> pg );
-
-            /* get requested page */
-            rc = KPageFilePosGet ( self -> pf, & self -> pg, pos );
-            if ( rc != 0 )
-            {
-                self -> pg = NULL;
-                self -> pgid = 0;
-                break;
-            }
-            self -> pgid = pgid;
-        }
-
-        /* access page memory */
-        rc = KPageAccessUpdate ( self -> pg, ( void** ) & dst, & bytes );
-        if ( rc != 0 )
-            break;
-
-        /* going to copy to page at the given offset */
-        offset = ( size_t ) ( pos % bytes );
-        partial = bytes - offset;
-        assert ( bytes == self -> pgsize );
-
-        /* limit bytes to request */
-        if ( partial > remain )
-            partial = remain;
-
-        /* copy bytes */
-        memcpy ( & dst [ offset ], & src [ total ], partial );
-    }
-
-    if ( total != 0 )
-    {
-        if ( start + total > self -> max_write )
-            self -> max_write = start + total;
-        * num_writ = total;
-        return 0;
-    }
-
-    * num_writ = 0;
-    return rc;
-}
-
-
-static
-rc_t CC KBufFileNoWrite ( KBufFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcFS, rcFile, rcWriting, rcFunction, rcUnsupported );
-}
-
-static
-uint32_t CC KBufFileType ( const KBufFile * self )
-{
-    return KFileType ( self -> f );
-}
-
-static
-const KFile_vt_v1 vtKBufFileRD_v1 =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KBufFileDestroy,
-    KBufFileGetSysFile,
-    KBufFileRandomAccess,
-    KBufFileSizeRead,
-    KBufFileNoSetSize,
-    KBufFileRead,
-    KBufFileNoWrite,
-
-    /* 1.1 */
-    KBufFileType
-};
-
-static
-const KFile_vt_v1 vtKBufFileRW_v1 =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KBufFileDestroyTrunc,
-    KBufFileGetSysFile,
-    KBufFileRandomAccess,
-    KBufFileSize,
-    KBufFileSetSize,
-    KBufFileRead,
-    KBufFileWrite,
-
-    /* 1.1 */
-    KBufFileType
-};
-
-static
-rc_t KBufFileMake ( KBufFile ** bp, const KFile_vt *vt,
-    const KFile *f, uint64_t eof, const KPageFile *pf,
-    bool read_enabled, bool write_enabled, bool serial )
-{
-    rc_t rc;
-
-    KBufFile *buf = malloc ( sizeof * buf );
-    if ( buf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KFileInit ( & buf -> dad, vt, "KBufFile", "no-name", read_enabled, write_enabled );
-        if ( rc == 0 )
-        {
-            rc = KFileAddRef ( f );
-            if ( rc == 0 )
-            {
-                buf -> max_write = serial ? 0 : eof;
-
-                buf -> f = ( KFile* ) f;
-                buf -> pf = ( KPageFile* ) pf;
-
-                buf -> pg = NULL;
-                buf -> pgsize = KPageConstSize ();
-                buf -> pgid = 0;
-
-                KBufFileSetSerialAccess ( buf, serial );
-
-                * bp = buf;
-                return 0;
-            }
-        }
-
-        free ( buf );
-    }
-
-    return rc;
-}
-
-/* MakeBufferedRead
- *  make a read-only file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "bsize" [ IN ] - buffer size
- */
-LIB_EXPORT rc_t CC KBufFileMakeRead ( const KFile ** bp,
-    const KFile * original, size_t bsize )
-{
-    rc_t rc;
-
-    if ( bp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( original == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else
-        {
-            uint64_t eof;
-            bool serial = false;
-            const KPageFile *pf;
-
-            /* round bsize to next higher page */
-            size_t pgmask = KPageConstSize () - 1;
-            assert ( ( pgmask & ( pgmask + 1 ) ) == 0 );
-            bsize = ( bsize + pgmask ) & ~ pgmask;
-
-            /* check for serial access */
-            if ( KFileRandomAccess ( original ) != 0 )
-                serial = true;
-
-            /* try to get end of file */
-            rc = KFileSize ( original, & eof );
-            if ( rc != 0 )
-                serial = true;
-
-            /* create page file for read */
-            rc = KPageFileMakeRead ( & pf, original, bsize );
-            if ( rc == 0 )
-            {
-                /* create buffered file */
-                KBufFile *buf;
-                rc = KBufFileMake ( & buf, ( const KFile_vt* ) & vtKBufFileRD_v1,
-                    original, eof, pf, true, false, serial );
-                if ( rc == 0 )
-                {
-                    * bp = & buf -> dad;
-                    return 0;
-                }
-
-                KPageFileRelease ( pf );
-            }
-        }
-
-        * bp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* MakeBufferedWrite
- *  make a writable file buffer
- *
- *  "buf" [ OUT ] - return parameter for new buffered file
- *
- *  "original" [ IN ] - source file to be buffered. must have read access
- *
- *  "update" [ IN ] - if true, make a read/write buffer
- *
- *  "bsize" [ IN ] - buffer size
- */
-LIB_EXPORT rc_t CC KBufFileMakeWrite ( KFile ** bp,
-    KFile * original, bool update, size_t bsize )
-{
-    rc_t rc;
-
-    if ( bp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( original == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! original -> write_enabled )
-        {
-            if ( original -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            /* check for serial access */
-            bool serial = false;
-            if ( KFileRandomAccess ( original ) != 0 )
-                serial = true;
-
-            /* if read-write is not required */
-            if ( ! update )
-                return KBufWriteFileMakeWrite ( bp, original, bsize );
-
-            /* can only use page file if backing is r/w */
-            if ( ! original -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcWriteonly );
-            else
-            {
-                uint64_t eof;
-                KPageFile *pf;
-
-                /* round bsize to next higher page */
-                size_t pgmask = KPageConstSize () - 1;
-                assert ( ( pgmask & ( pgmask + 1 ) ) == 0 );
-                bsize = ( bsize + pgmask ) & ~ pgmask;
-
-                /* try to get end of file */
-                rc = KFileSize ( original, & eof );
-                if ( rc != 0 )
-                    serial = true;
-
-                /* create page file for update */
-                rc = KPageFileMakeUpdate ( & pf, original, bsize, serial );
-                if ( rc == 0 )
-                {
-                    /* create buffered file */
-                    KBufFile *buf;
-                    rc = KBufFileMake ( & buf, ( const KFile_vt* ) & vtKBufFileRW_v1,
-                        original, eof, pf, update, true, serial );
-                    if ( rc == 0 )
-                    {
-                        * bp = & buf -> dad;
-                        return 0;
-                    }
-
-                    KPageFileRelease ( pf );
-                }
-            }
-        }
-
-        * bp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/bzip.c b/libs/kfs/bzip.c
deleted file mode 100644
index 4fe4362..0000000
--- a/libs/kfs/bzip.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/*=======================================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-struct KBZipFile;
-#define KFILE_IMPL struct KBZipFile
-
-#include <kfs/extern.h>
-#include <kfs/impl.h>
-#include <kfs/bzip.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-
-#include <bzlib.h>      /* bz_stream */
-#include <assert.h>
-#include <stdlib.h>    /* malloc */
-#include <string.h>
-
-#ifdef _DEBUGGING
-#define BZIP_DEBUG(msg) DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_BZIP), msg)
-#else
-#define BZIP_DEBUG(msg)
-#endif
-
-#define BZIP_DBGSTREAM(strm,msg)                                 \
-    BZIP_DEBUG(("%s: bz_stream (%p) %.35s\nnext_in %p "          \
-                "avail_in %6u total_in %10lu next_out %p "       \
-                "avail_out %6u total_out %10lu\n",               \
-                __func__, strm, msg,                             \
-                strm->next_in, strm->avail_in,                   \
-                (uint64_t)strm->total_in_lo32 +                  \
-                (((uint64_t)strm->total_in_hi32)<<32),           \
-                strm->next_out, strm->avail_out,                 \
-                (uint64_t)strm->total_out_lo32 +                 \
-                (((uint64_t)strm->total_out_hi32)<<32)))
-
-
-/***************************************************************************************/
-/* bzip2 File                                                                    */
-/***************************************************************************************/
-
-#define BZ2CHUNK 0x20000    /* 128K */
-
-/* ======================================================================
- * bzip2 KFile structure
- */
-typedef struct KBZipFile KBZipFile;
-struct KBZipFile
-{
-    KFile dad;
-    KFile *file; /* underlying KFile */
-    uint64_t filePosition;
-    uint64_t myPosition;
-    int BZ2_bzDecompressResult;
-    bz_stream strm;
-    char buff[BZ2CHUNK]; /* buffer to cache KFile data */
-    bool completed;
-};
-
-
-/* ======================================================================
- * subroutine functions for KBZipFile methods
- */
-static
-rc_t KBZipFileWriteInt (KBZipFile *self,
-                          int action,
-                          size_t *pnumwrit)
-{
-    bz_stream *strm;
-    unsigned avail_in;
-    int ret;
-    rc_t rc = 0;
-
-    assert (self);
-    assert (pnumwrit);
-
-    *pnumwrit = 0;
-
-    strm = &self->strm;
-    avail_in = strm->avail_in;
-    ret = 0;
-    /* run deflate() on input until output buffer not full, finish
-       compression if all of source has been read in */
-    do
-    {
-        uint32_t num_comp;
-        size_t written;
-        int zret;
-
-        /* compress one internal buffers worth */
-        strm->next_out = self->buff;
-        strm->avail_out = sizeof (self->buff);
-
-        zret = BZ2_bzCompress (strm, action);    /* no bad return value */
-
-        /* state not clobbered */
-        assert(zret == BZ_OK || zret == BZ_RUN_OK
-               || zret == BZ_FINISH_OK || zret == BZ_STREAM_END);
-
-        /* compression used the sizeof of the outbuffer - the amount
-         * it says it didn't use */
-        num_comp = sizeof(self->buff) - strm->avail_out;
-
-        rc = KFileWrite (self->file, self->filePosition, self->buff, num_comp, &written);
-
-        self->filePosition += written;
-
-        *pnumwrit = avail_in - strm->avail_in;
-
-    } while (strm->avail_out == 0);
-
-    assert (strm->avail_in == 0);     /* all input will be used */
-    return rc;
-}
-
-
-#if 0 /* obsolete */
-static
-int s_read(KBZipFile *self,
-           char *buffer,
-           size_t bsize,
-           size_t *num_read,
-           rc_t *rc)
-{
-    bz_stream* strm;
-    int ret;
-
-    assert(self && buffer && bsize && num_read);
-
-    strm = &self->strm;
-
-    ret = 0;
-    while (!*num_read) {
-        strm->next_out  = buffer;
-        strm->avail_out = bsize;
-        ret = BZ2_bzDecompress(strm);
-        assert(ret == BZ_OK || ret == BZ_STREAM_END);  /* state not clobbered */
-        *num_read = bsize - strm->avail_out;
-        if (strm->avail_out > 0) {
-            size_t src_read;
-            * rc = KFileRead
-                (self->file, self->filePosition, self->buff, sizeof(self->buff), &src_read);
-            if (*rc != 0)
-            {   return -70; }
-            strm->avail_in = src_read;
-            self->filePosition += src_read;
-            strm->next_in = self->buff;
-        }
-        if (!strm->avail_in)
-        {   break; }
-    }
-    return ret;
-}
-
-static rc_t old_KBZipFileReadInt ( KBZipFile * self, void * buffer, size_t bsize, size_t * num_read )
-{
-    rc_t rc = 0;
-    size_t numRead = 0;
-
-    do
-    {
-        int ret;
-        size_t have = 0;
-
-        if (self->BZ2_bzDecompressResult == BZ_STREAM_END)
-            break;
-        ret = s_read(self, (char*)buffer + numRead, bsize - numRead, &have, &rc);
-        if ( ret == -70 ) /* rc hack - known to not collide with bzlib errors */
-            return rc;
-        self->BZ2_bzDecompressResult = ret;
-        if (!have)
-            break;
-        numRead += have;
-    } while (numRead != bsize);
-
-    *num_read = numRead;
-    return rc;
-}
-#endif
-
-static
-rc_t KBZipFileReadInt (KBZipFile * self, void * buffer, size_t bsize, size_t * pnumread)
-{
-    bz_stream temp;     /* store some values here during a reinit after stream end */
-    bz_stream * strm;   /* alias for the object's bzip stream object */
-    size_t bleft = bsize;
-    size_t num_read;
-    size_t tot_read = 0;
-    rc_t rc = 0;
-
-    BZIP_DEBUG (("---------------\n%s: Enter requesting bsize %lu\n", __func__, bsize));
-
-    strm = &self->strm;
-
-    for (tot_read = 0; tot_read < bsize ; )
-    {
-        char * this_out;
-        size_t src_read;
-        int zret;
-        bool bin;
-        bool bout;
-        bool end;
-
-        bin = (strm->avail_in != 0);
-
-        BZIP_DEBUG (("%s: loop start tot_read %zu\n", __func__, tot_read));
-
-        strm->next_out = this_out = (char*)buffer + tot_read;
-        strm->avail_out = bsize - tot_read;
-
-        BZIP_DEBUG(("%s: call Decompress\n", __func__));
-
-        BZIP_DBGSTREAM (strm, "before BZ2_bzDecompress");
-
-        zret = BZ2_bzDecompress(strm);
-
-        BZIP_DBGSTREAM (strm, "after BZ2_bzDecompress");
-
-        switch (zret)
-        {
-            /* unexpected error returns from zlib */
-        default:
-            BZIP_DEBUG (("%s: undocumented error return in bzip Decompress\n", __func__));
-            rc = RC (rcFS, rcFile, rcReading, rcFile, rcUnknown);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown error decompressing BZip2 file "
-                      "error code '$(EC)'", "EC=%d", zret));
-            return rc;
-
-            /* known unfixable errors */
-        case BZ_PARAM_ERROR:
-            BZIP_DEBUG (("%s: internal programming error - bad parameters\n", __func__));
-            rc = RC (rcFS, rcFile, rcReading, rcSelf, rcInvalid);
-            if (strm == NULL)
-                BZIP_DEBUG (("%s: strm is NULL\n", __func__));
-            else
-            {
-                if (strm->state == NULL)
-                    BZIP_DEBUG (("%s: strm->state is NULL\n", __func__));
-                if (strm->avail_out < 1)
-                    BZIP_DEBUG (("%s: strm->avail_out < 1\n", __func__));
-            }
-            LOGERR (klogInt, rc, "bzip strm structure bad");
-            return rc;
-
-        case BZ_DATA_ERROR:
-            BZIP_DEBUG (("%s: data integrity error in bzip stream\n", __func__));
-            rc = RC (rcFS, rcFile, rcReading, rcData, rcCorrupt);
-            LOGERR (klogErr, rc, "bzip stream data error");
-            return rc;
-
-        case BZ_DATA_ERROR_MAGIC:
-            BZIP_DEBUG (("%s: data magic bytes error in bzip stream\n", __func__));
-            rc = RC (rcFS, rcFile, rcReading, rcData, rcIncorrect);
-            LOGERR (klogErr, rc, "bzip stream not a bzip stream");
-            return rc;
-
-        case BZ_MEM_ERROR:
-            BZIP_DEBUG (("%s: memory exhausted during BZip decompress\n", __func__));
-            rc = RC (rcFS, rcFile, rcReading, rcMemory, rcExhausted);
-            LOGERR (klogErr, rc, "not enough memory available during bzip decompress");
-            return rc;
-
-        case BZ_STREAM_END:
-            BZIP_DEBUG (("%s: BZ_STREAM_END\n", __func__));
-            end = true;
-            num_read = strm->next_out - this_out;
-            bout = (num_read != 0);
-            BZIP_DEBUG (("%s: num_read %zu\n", __func__, num_read));
-            self->completed = true;
-            BZIP_DBGSTREAM (strm, "before BZ2_bzDecompressEnd");
-            zret = BZ2_bzDecompressEnd(strm);
-            BZIP_DBGSTREAM (strm, "after BZ2_bzDecompressEnd");
-            if (zret == BZ_OK)
-            {
-                temp = *strm;
-                memset (strm, 0, sizeof *strm);
-                zret = BZ2_bzDecompressInit (strm, 1, 0);
-                BZIP_DBGSTREAM (strm, "after BZ2_bzDecompressInit");
-                strm->next_in = temp.next_in;
-                strm->avail_in = temp.avail_in;
-/*                 strm->next_out = temp.next_out; */
-/*                 strm->avail_out = temp.avail_out; */
-                strm->total_in_lo32 = temp.total_in_lo32;
-                strm->total_in_hi32 = temp.total_in_hi32;
-                strm->total_out_lo32 = temp.total_out_lo32;
-                strm->total_out_hi32 = temp.total_out_hi32;
-                BZIP_DBGSTREAM (strm, "after restore");
-            }
-            switch (zret)
-            {
-            case BZ_OK:
-                break;
-            default:
-                return RC (rcFS, rcFile, rcReading, rcFile, rcUnknown);
-            }
-            goto read_more;
-
-        case BZ_OK:
-            BZIP_DEBUG (("%s: BZ_OK\n", __func__));
-            end = false;
-            num_read = strm->next_out - this_out;
-            bout = (num_read != 0);
-            BZIP_DEBUG (("%s: num_read %zu\n", __func__, num_read));
-
-        read_more:
-            /* if we wanted more on this read, read some more compressed */
-            tot_read += num_read;
-            if (strm->avail_in == 0)
-            {
-                rc = KFileRead (self->file, self->filePosition, self->buff, 
-                                sizeof self->buff, &src_read);
-                if (rc)
-                    return rc;
-
-                BZIP_DEBUG (("%s: KFileRead read %u\n", __func__, src_read));
-
-                if (src_read == 0)
-                {
-                    BZIP_DEBUG (("%s: end %u in %u out %u\n", __func__, end, bin, bout));
-                
-                    if (!end && bin && !bout)
-                        rc = RC (rcFS, rcFile, rcReading, rcData, rcInsufficient);
-                    goto done;
-                }
-                strm->avail_in = src_read;
-                self->filePosition += src_read;
-                strm->next_in = self->buff;
-
-                /* if src_read == 0 but we are not at BZ_STREAM_END
-                 * we have an error
-                 */
-                if (src_read == 0)
-                    bleft = 0;
-            }
-            break;
-        }
-        if (rc)
-            break;
-        BZIP_DEBUG (("%s: loop end tot_read %zu\n", __func__, tot_read));
-    }
-done:
-    BZIP_DEBUG (("%s: returning tot_read %zu\n\n\n", __func__, tot_read));
-    *pnumread = tot_read;
-    return rc;
-}
-
-
-static rc_t KBZipFileReadSeek (KBZipFile *self, uint64_t pos)
-{
-    rc_t rc = 0;
-    size_t num_read = 0;
-    size_t to_read;
-    uint8_t buff [ 32 * 1024 ];
-
-    for ( to_read = sizeof buff; self -> myPosition < pos; self -> myPosition += num_read )
-    {
-	if (self->myPosition + sizeof buff > pos)
-	    to_read = pos - self->myPosition;
-
-        BZIP_DEBUG(("%s: call KBZipFileReadInt to_read %zu \n",__func__));
-
-	rc = KBZipFileReadInt ( self, buff, to_read, &num_read);
-
-        BZIP_DEBUG(("%s: return KBZipFileReadInt num_read %zu \n",__func__));
-
-	if ( rc )
-	    break;
-
-	if (num_read == 0)
-	    break;
-    }
-    return rc;
-}
-
-
-/* ======================================================================
- * virtual table methods for KBZipFile object
- */
-
-/* Destroy
- *  destroy file
- */
-static rc_t CC KBZipFileDestroy (KBZipFile *self)
-{
-    rc_t rc = 0, orc = 0;
-
-    if (self)
-    {
-        if (self->file != NULL)
-        {
-            int zret = BZ_OK;
-
-            if (self->dad.write_enabled)
-            {
-                /* flush out end of compressed data */
-/*                 if (self->completed == false) */
-/*                 { */
-                    size_t ignored;
-                    bz_stream* strm = &self->strm;
-
-                    strm->avail_in = 0;
-                    strm->next_in = NULL;
-                    rc = KBZipFileWriteInt(self, BZ_FINISH, &ignored);
-/*                     assert (zret == BZ_STREAM_END); */        /* stream will be complete */
-/*                 } */
-
-                zret = BZ2_bzCompressEnd(&self->strm);   /* clean up */
-
-                self->completed = true;
-            }
-            else if (self->dad.read_enabled)
-            {
-                zret = BZ2_bzDecompressEnd (&self->strm);
-            }
-            else
-            {
-                rc = RC (rcFS, rcFile, rcDestroying, rcSelf, rcInvalid);
-                LOGERR (klogInt, orc, "corrupt object "
-                        "closing bzip file object");
-            }
-            if (zret != BZ_OK)
-            {
-                orc = RC (rcFS, rcFile, rcDestroying, rcParam, rcInvalid);
-                LOGERR (klogInt, orc, "bad parameters - coding error on "
-                        "closing bzip file object");
-                if (rc == 0)
-                    rc = orc;
-            }
-
-            orc = KFileRelease (self->file);
-            if (rc == 0)
-                rc = orc;
-        }
-        free (self);
-    }
-    return rc;
-}
-
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-static struct KSysFile *CC KBZipFileGetSysFile (const KBZipFile *self,
-                                                uint64_t *offset)
-{
-    return NULL;
-}
-
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *
- *  certain file types will refuse random access
- *  these include FIFO and socket based files, but also
- *  wrappers that require serial access ( e.g. compression )
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KBZipFileRandomAccess (const KBZipFile *self)
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KBZipFileSize (const KBZipFile *self, uint64_t *size)
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KBZipFileSetSize(KBZipFile *self,
-                                uint64_t size)
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of file.
- */
-static
-rc_t CC KBZipFileRead (const KBZipFile *cself,
-                              uint64_t pos,
-                              void *buffer,
-                              size_t bsize,
-                              size_t *num_read)
-{
-    KBZipFile *self = (KBZipFile*) cself;
-    rc_t rc = 0;
-
-    size_t numRead = 0, ignore;
-
-    if (self->dad.read_enabled == false)
-        return RC (rcFS, rcFile, rcReading, rcFunction, rcUnsupported);
-
-    if (!num_read)
-    {   num_read = &ignore; }
-
-    *num_read = 0;
-
-    if (!cself || !buffer)
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    if (!bsize)
-    {   return 0; }
-
-    if (pos < self->myPosition)
-    {
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcInvalid );
-    }
-
-    BZIP_DEBUG(("%s: pos %lu bsize %zu\n", __func__, pos, bsize));
-    BZIP_DEBUG(("%s: myPosition %lu numRead '%zu'\n", __func__, self->myPosition, numRead));
-
-    if (pos > self->myPosition)
-    {
-        rc =  KBZipFileReadSeek (self, pos);
-        if (rc)
-            return rc;
-        if (pos != self->myPosition)
-            return 0;
-    }
-
-    rc = KBZipFileReadInt ( self, buffer, bsize, &numRead );
-    if (rc)
-        return rc;
-
-    *num_read = numRead;
-
-    self->myPosition += numRead;
-
-    BZIP_DEBUG(("%s: myPosition %lu numRead '%zu'\n", __func__, self->myPosition, numRead));
-
-    return 0;
-}
-
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t CC KBZipFileWrite (struct KBZipFile *self,
-                        uint64_t pos,
-                        const void *buffer,
-                        size_t bsize,
-                        size_t *pnum_writ)
-{
-    rc_t rc = 0;
-
-    if (self->dad.write_enabled == false)
-        rc = RC (rcFS, rcFile, rcWriting, rcFunction, rcUnsupported);
-    else
-    {
-        *pnum_writ = 0;
-
-        if (pos != self->myPosition)
-            rc = RC (rcFS, rcFile, rcWriting, rcParam, rcIncorrect);
-
-        else
-        {
-            bz_stream * strm;
-            size_t num_writ;
-
-            strm = &self->strm;
-            strm->next_in  = (char*) buffer;
-            strm->avail_in = bsize;
-
-            rc =  KBZipFileWriteInt (self, BZ_RUN, &num_writ);
-            if (rc == 0)
-            {
-                self->myPosition += num_writ;
-                *pnum_writ = num_writ;
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KBZipFileType (const KBZipFile *self)
-{
-    return KFileType (self->file);
-}
-
-
-/* ======================================================================
- * virtual table for KBZipFile object
- */
-static
-KFile_vt_v1 KBZipFile_vt_v1 =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KBZipFileDestroy,
-    KBZipFileGetSysFile,
-    KBZipFileRandomAccess,
-    KBZipFileSize,
-    KBZipFileSetSize,
-    KBZipFileRead,
-    KBZipFileWrite,
-
-    /* 1.1 */
-    KBZipFileType
-};
-
-
-/* ======================================================================
- * Factory functions
- */
-
-LIB_EXPORT rc_t CC KFileMakeBzip2ForRead (const struct KFile **pnew_obj,
-                                          const struct KFile *compfile)
-{
-    rc_t rc;
-
-    if ( pnew_obj == NULL || compfile == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-
-    else
-    {
-        KBZipFile *obj;
-
-        *pnew_obj = NULL;
-
-        obj = (KBZipFile*) calloc(1,sizeof(KBZipFile));
-        if (!obj)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-            LOGERR (klogErr, rc, "memory exhausted building bzip2 "
-                    "file object");
-        }
-        else
-        {
-            rc = KFileInit(&obj->dad, (const KFile_vt*) &KBZipFile_vt_v1,
-                           "KBZipFile", "no-name", true, false);
-            if (rc == 0)
-            {
-                bz_stream * strm;
-                int zret;
-
-                strm = &obj->strm;
-                zret = BZ2_bzDecompressInit (strm, 1, /* verbosity */
-                                             0); /* small */
-
-                switch (zret)
-                {
-                case BZ_OK:
-                    obj->completed = true;
-                    rc = KFileAddRef (compfile);
-                    if (rc == 0)
-                    {
-                        obj->file = (KFile *)compfile;
-                        *pnew_obj = &obj->dad;
-                        return 0;
-                    }
-                    break;
-
-                case BZ_CONFIG_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcLibrary,
-                             rcCorrupt);
-                    LOGERR (klogFatal, rc, "bzip2 library miscompiled");
-                    break;
-
-                case BZ_PARAM_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-                    LOGERR (klogInt, rc, "coding error bzip2 file object");
-                    break;
-
-                case BZ_MEM_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcMemory,
-                             rcExhausted);
-                    LOGERR (klogErr, rc, "memory exhausted building bzip2 "
-                            "file object");
-                    break;
-
-                default:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcLibrary,
-                             rcUnexpected);
-                    LOGERR (klogFatal, rc, "bzip2 library return unexpected "
-                            "error");
-                    break;
-
-                }
-            }
-        }
-        KBZipFileDestroy (obj);
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KFileMakeBzip2ForWrite (struct KFile **pnew_obj,
-                                           struct KFile *compfile)
-{
-    rc_t rc;
-
-    if ( pnew_obj == NULL || compfile == NULL )
-        rc= RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-
-    else
-    {
-        KBZipFile *obj;
-
-        *pnew_obj = NULL;
-
-        obj = (KBZipFile*)calloc(1,sizeof(KBZipFile));
-        if (obj == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-            LOGERR (klogErr, rc, "memory exhausted building bzip2 "
-                    "file object");
-        }
-        else
-        {
-            rc = KFileInit(&obj->dad, (const KFile_vt*)&KBZipFile_vt_v1,
-                           "KBZipFile", "no-name", false, true);
-            if (rc == 0)
-            {
-                bz_stream* strm;
-                int zret;
-
-                strm = &obj->strm;
-                zret = BZ2_bzCompressInit(strm, 9, /* blockSize100k */
-                                          1, /* verbosity */
-                                          30); /* workFactor */
-                switch (zret)
-                {
-                case BZ_OK:
-                    obj->completed = true;
-                    rc = KFileAddRef (compfile);
-                    if (rc == 0)
-                    {
-                        obj->file = compfile;
-                        *pnew_obj = &obj->dad;
-                        return 0;
-                    }
-                    break;
-
-                case BZ_CONFIG_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcLibrary,
-                             rcCorrupt);
-                    LOGERR (klogFatal, rc, "bzip2 library miscompiled");
-                    break;
-
-                case BZ_PARAM_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-                    LOGERR (klogInt, rc, "coding error bzip2 file object");
-                    break;
-
-                case BZ_MEM_ERROR:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcMemory,
-                             rcExhausted);
-                    LOGERR (klogErr, rc, "memory exhausted building bzip2 "
-                            "file object");
-                    break;
-
-                default:
-                    rc = RC (rcFS, rcFile, rcConstructing, rcLibrary,
-                             rcUnexpected);
-                    LOGERR (klogFatal, rc, "bzip2 library return unexpected "
-                            "error");
-                    break;
-
-                }
-            }
-        }
-        KBZipFileDestroy (obj);
-    }
-    return rc;
-}
-
-
-/* EOF */
diff --git a/libs/kfs/cacheteefile.c b/libs/kfs/cacheteefile.c
deleted file mode 100644
index 791e7ca..0000000
--- a/libs/kfs/cacheteefile.c
+++ /dev/null
@@ -1,1689 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-
-struct KCacheTeeFile;
-#define KFILE_IMPL struct KCacheTeeFile
-#include <kfs/impl.h>
-#include <kfs/lockfile.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/checksum.h>
-
-#include <kfs/cacheteefile.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- layout of local file:
- 
- CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC MMMMMMMMMMMMMM SS BB
-
- C ... file content in valid/invalid blocks
- M ... bitmap of blocks bytes = ( ( ( content-size / block-size ) + 1 ) / 8 ) + 1 )
- S ... size of content ( uint64_t ) 8 bytes
- B ... used blocksize  ( uint32_t ) 4 bytes
- */
-
-
-/*--------------------------------------------------------------------------
- * KCacheTeeFile
- */
-
-#define CACHE_TEE_DEFAULT_BLOCKSIZE ( 32 * 1024 )
-#define CACHE_TEE_REPORT 0
-
-typedef struct KCacheTeeFile
-{
-    KFile dad;
-    const KFile * remote;
-    KFile * local;
-    KFile * logger;
-    KDirectory * dir;
-    KLockFile * lock;
-
-    uint8_t * bitmap;
-    uint8_t * scratch_buffer;
-
-    uint64_t remote_size;
-    uint64_t local_size;
-    uint64_t block_count;
-    uint64_t log_file_pos;
-    uint64_t first_block_in_scratch;
-
-    /* size_t */ uint64_t bitmap_bytes;
-    /* size_t */ uint64_t scratch_size;
-    /* size_t */ uint64_t valid_scratch_bytes;
-    uint32_t block_size;
-    uint32_t cluster_factor;
-    bool fully_in_cache;
-    bool report;
-    bool local_read_only;
-    char local_path [ 1 ];
-} KCacheTeeFile;
-
-
-const uint8_t BitNr2Mask[ 8 ] =
-{
-         /* 0  1  2  3   4   5   6    7  */
-            1, 2, 4, 8, 16, 32, 64, 128
-};
-
-#define IS_CACHE_BIT( CacheFile, Block_Nr ) ( CacheFile->bitmap[ (Block_Nr) >> 3 ] & BitNr2Mask[ (Block_Nr) & 7 ] ) > 0
-
-#define IS_BITMAP_BIT( BitMap, Block_Nr ) ( BitMap[ (Block_Nr) >> 3 ] & BitNr2Mask[ (Block_Nr) & 7 ] ) > 0
-
-#define BITS_2_BYTES( BitCount ) ( ( ( BitCount ) + 7 ) >> 3 )
-
-#define SIZE_2_BLOCK_COUNT( Number_Of_Bytes, Block_Size ) ( ( ( Number_Of_Bytes ) + ( Block_Size ) - 1 ) / ( Block_Size ) )
-
-
-static rc_t calculate_local_size_from_remote_size( KCacheTeeFile *self )
-{
-    rc_t rc = 0;
-    if ( self->block_size > 0 )
-    {
-        self->block_count = SIZE_2_BLOCK_COUNT( self->remote_size, self->block_size );
-        self->bitmap_bytes = BITS_2_BYTES( self->block_count );
-        self->local_size = ( self->remote_size +
-                             self->bitmap_bytes + 
-                             sizeof self->remote_size + 
-                             sizeof self->block_size );
-    }
-    else
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-        LOGERR( klogErr, rc, "div by zero attempt in calculating local size" );
-    }
-    return rc;
-}
-
-
-static rc_t create_bitmap_buffer( uint8_t ** bitmap, /* size_t */ uint64_t bitmap_bytes )
-{
-    rc_t rc = 0;
-    *bitmap = calloc ( sizeof **bitmap, bitmap_bytes );
-    if ( *bitmap == NULL )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        LOGERR( klogErr, rc, "init local bitmap-area" );
-    }
-    return rc;
-}
-
-static rc_t create_bitmap( KCacheTeeFile *self )
-{
-    return create_bitmap_buffer( &self->bitmap, self->bitmap_bytes );
-}
-
-
-static bool is_bitmap_full( const uint8_t * bitmap, /* size_t */ uint64_t bitmap_bytes, uint64_t block_count )
-{
-    /* size_t */ uint64_t bitmap_byte = 0;
-    while( bitmap_byte < ( bitmap_bytes - 1 ) )
-    {
-        if ( bitmap[ bitmap_byte++ ] != 0xFF )
-            return false;
-    }
-    {
-        uint64_t block_id = ( bitmap_byte << 3 );
-        while ( block_id < block_count )
-        {
-            bool block_cached = IS_BITMAP_BIT( bitmap, block_id );
-            if ( !block_cached )
-                return false;
-            ++block_id;
-        }
-    }
-    return true;
-}
-
-
-static void report( const KCacheTeeFile * cf )
-{
-    OUTMSG(( "log  : %s\n", cf -> logger != NULL ? "YES" : "NO" ));
-    OUTMSG(( "size : local=%,lu remote=%,lu\n", cf -> local_size, cf -> remote_size ));
-    OUTMSG(( "block: size=%,u count=%,u\n", cf -> block_size, cf -> block_count ));
-    OUTMSG(( "bitmp: bytes=%,u\n", cf -> bitmap_bytes ));
-    OUTMSG(( "fully: %s\n", cf -> fully_in_cache ? "YES" : "NO" ));
-}
-
-
-static rc_t init_new_local_file( KCacheTeeFile * cf )
-{
-    rc_t rc = create_bitmap( cf );
-    cf->fully_in_cache = false;
-    if ( rc == 0 )
-    {
-        size_t written;
-        uint64_t pos = cf -> remote_size;
-        /* write the bitmap ( zero'd out ) into the local file */
-        rc = KFileWriteAll ( cf -> local, pos, 
-                             cf -> bitmap, cf -> bitmap_bytes, &written );
-        if ( rc == 0 && written != cf -> bitmap_bytes )
-        {
-            rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-            LOGERR( klogErr, rc, "no full initialization of local file bitmap" );
-        }
-        if ( rc == 0 && cf->report )
-        {
-            OUTMSG(( "init new cachefile: %u bytes of bitmaps written at pos %lu\n", written, pos ));
-        }
-
-        /* write the remote-file-size into the local file ( uint64_t = 8 bytes )*/
-        if ( rc == 0 )
-        {
-            pos += cf -> bitmap_bytes;
-            rc = KFileWriteAll ( cf -> local, pos,
-                                 &cf -> remote_size, sizeof( cf -> remote_size ), &written );
-            if ( rc == 0 && written != sizeof( cf -> remote_size ) )
-            {
-                rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-                LOGERR( klogErr, rc, "cannot write remote-filesize into local file" );
-            }
-        }
-        if ( rc == 0 && cf->report )
-        {
-            OUTMSG(( "init new cachefile: %u bytes of remote size written at pos %lu ( remote-size = %lu )\n", written, pos, cf->remote_size ));
-        }
-
-        /* write the block-size into the local file ( size_t = 4 bytes )*/
-        if ( rc == 0 )
-        {
-            pos += sizeof( cf -> remote_size );
-            rc = KFileWriteAll ( cf -> local, pos,
-                                 &cf -> block_size, sizeof( cf -> block_size ), &written );
-            if ( rc == 0 && written != sizeof( cf -> block_size ) )
-            {
-                rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-                LOGERR( klogErr, rc, "cannot write block-size into local file" );
-            }
-        }
-        if ( rc == 0 && cf->report )
-        {
-            OUTMSG(( "init new cachefile: %u bytes of block_size written at pos %lu ( block-size = %lu )\n", written, pos, cf->block_size ));
-        }
-
-    }
-    if ( rc == 0 && cf -> report )
-        report( cf );
-    return rc;
-}
-
-
-static rc_t read_block_size( const struct KFile * self, uint64_t local_size, uint32_t *block_size, bool silent )
-{
-    size_t num_read;
-    uint64_t pos = local_size - ( sizeof *block_size );
-    /* read the block-size, compare to the requested block-size */
-    rc_t rc =  KFileRead( self, pos, block_size, sizeof *block_size, &num_read );
-    if ( rc != 0 )
-    {
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "cannot read block-size from local file" );
-        }
-    }
-    else if ( num_read != sizeof *block_size )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "cannot read block-size from local file" );
-        }
-    }
-    if ( rc == 0 && *block_size == 0 )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "block-size read from local file is zero" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t read_content_size( const struct KFile * self, uint64_t local_size, uint64_t *content_size, bool silent )
-{
-    size_t num_read;
-    uint64_t pos = ( local_size - 4 ) - sizeof( *content_size );
-    rc_t rc =  KFileRead ( self, pos, content_size, sizeof *content_size, &num_read );
-    if ( rc != 0 )
-    {
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "cannot read content-size from local file" );
-        }
-    }
-    else if ( num_read != sizeof *content_size )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "cannot read content-size from local file" );
-        }
-    }
-    if ( rc == 0 && *content_size == 0 )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "content-size read from local file is zero" );
-        }
-    }
-    if ( rc == 0 && *content_size >= local_size )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "content-size read from local file is invalid" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t verify_file_structure( const uint64_t local_size, const uint32_t block_size, const uint64_t content_size,
-                                   uint64_t * block_count, /* size_t */ uint64_t * bitmap_bytes, bool silent )
-{
-    rc_t rc = 0;
-    uint64_t expected_size;
-
-    *block_count = SIZE_2_BLOCK_COUNT( content_size, block_size );
-    *bitmap_bytes = BITS_2_BYTES( *block_count );
-
-    /* check if the values 'content-size' and 'block_size' result in the currect real file size */
-    expected_size = content_size + *bitmap_bytes + sizeof ( local_size ) + sizeof ( block_size );
-    if ( expected_size != local_size )
-    {
-        rc = RC ( rcFS, rcFile, rcValidating, rcParam, rcInvalid );
-        if ( !silent )
-        {
-            LOGERR( klogErr, rc, "content-size/blocksize do not make sense for this file" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t verify_existing_local_file( KCacheTeeFile * cf, bool silent )
-{
-    /* size_t */ uint64_t bitmap_bytes;
-    uint32_t block_size;
-    uint64_t content_size, block_count;
-
-    rc_t rc = read_block_size ( cf -> local, cf -> local_size, &block_size, silent );
-    /* read content-size, compare to the content-size of the remote file */
-    if ( rc == 0 )
-        rc = read_content_size ( cf -> local, cf -> local_size, &content_size, silent );
-
-    if ( rc == 0 && content_size != cf -> remote_size )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-        PLOGERR( klogErr, ( klogErr, rc, "content-size in local file $(ls) does not match size of remote file $(rs)", 
-                           "ls=%lu,rs=%lu", content_size, cf -> remote_size ) );
-    }
-
-    /* check if the local file has the right size ( content + bitmap + content_size + block_size )*/
-    if ( rc == 0 )
-        rc = verify_file_structure ( cf -> local_size, block_size, content_size, &block_count, &bitmap_bytes, silent );
-
-    /* check if the requested block-size equals the stored block-size */
-    if ( rc == 0 )
-    {
-        if ( cf -> block_size == 0 )
-            cf -> block_size = CACHE_TEE_DEFAULT_BLOCKSIZE;
-        if ( cf -> block_size != block_size )
-        {
-            PLOGMSG( klogWarn, ( klogWarn, "block-size in local file $(ls) does not match requested value $(rv)",
-                                "ls=%u,rv=%u", block_size, cf -> block_size ) );
-        }
-        /* use the block-size as stored in the file */
-        cf -> block_size = block_size;
-        cf -> block_count = block_count;
-        cf -> bitmap_bytes = bitmap_bytes;
-        rc = create_bitmap( cf );
-    }
-
-    /* read the bitmap into the memory ... */
-    if ( rc == 0 )
-    {
-        size_t num_read;
-        /* read the bitmap from the local file */
-        rc = KFileReadAll ( cf -> local, content_size,
-                            cf -> bitmap, cf -> bitmap_bytes, &num_read );
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "cannot read bitmap from local file" );
-        }
-        else if ( num_read != cf -> bitmap_bytes )
-        {
-            rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-            PLOGERR( klogErr, ( klogErr, rc, "cannot read $(ls) bitmap-bytes from local file, read $(rs) instead", 
-                           "ls=%lu,rs=%lu", cf -> bitmap_bytes, num_read ));
-        }
-    }
-
-    /* check if we have the whole remote file in cache */
-    if ( rc == 0 )
-        cf -> fully_in_cache = is_bitmap_full( cf -> bitmap, cf -> bitmap_bytes, cf -> block_count ); 
-
-    if ( rc == 0 && cf -> report )
-        report( cf );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC IsCacheFileComplete( const struct KFile * self, bool * is_complete, bool silent )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcSelf, rcNull );
-    else if ( is_complete == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcParam, rcNull );
-    else
-    {
-        uint64_t local_size;
-        *is_complete = false;
-        rc = KFileSize( self, &local_size );
-        if ( rc != 0 )
-        {
-            if ( !silent )
-            {
-                LOGERR( klogErr, rc, "cannot detect filesize when checking if cached file is complete" );
-            }
-        }
-        /* TODO: need to do a better constant tha a magic number */
-        else if (local_size < 13)
-        {
-            rc = RC ( rcFS, rcFile, rcValidating, rcSize, rcInsufficient );
-            if ( !silent )
-            {
-                LOGERR( klogErr, rc, "cannot use filesize of zero when checking if cached file is complete" );
-            }
-        }
-        else
-        {
-            uint32_t block_size;
-            rc = read_block_size( self, local_size, &block_size, silent );
-            if ( rc == 0 )
-            {
-                uint64_t content_size;
-
-                rc = read_content_size( self, local_size, &content_size, silent );
-                /* create bitmap buffer */
-                if ( rc == 0 )
-                {
-                    uint64_t block_count;
-                    /* size_t */ uint64_t bitmap_bytes;
-                    rc = verify_file_structure( local_size, block_size, content_size, &block_count, &bitmap_bytes, silent );
-                    if ( rc == 0 )
-                    {
-                        uint8_t * bitmap = NULL;
-                        rc = create_bitmap_buffer( &bitmap, bitmap_bytes );
-                        if ( rc == 0 )
-                        {
-                            size_t num_read;
-                            /* read the bitmap into the memory ... */
-                            rc = KFileReadAll ( self, content_size, bitmap, bitmap_bytes, &num_read );
-                            if ( rc != 0 )
-                            {
-                                if ( !silent )
-                                    LOGERR( klogErr, rc, "cannot read bitmap from local file" );
-                            }
-                            else if ( num_read != bitmap_bytes )
-                            {
-                                rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-                                if ( !silent )
-                                {
-                                    PLOGERR( klogErr, ( klogErr, rc, "cannot read $(ls) bitmap-bytes from local file, read $(rs) instead", 
-                                                        "ls=%lu,rs=%lu", bitmap_bytes, num_read ));
-                                }
-                            }
-                        }
-                        if ( rc == 0 )
-                            *is_complete = is_bitmap_full( bitmap, bitmap_bytes, block_count );
-
-                        if ( bitmap != NULL )
-                            free( bitmap );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC TruncateCacheFile( struct KFile * self )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC( rcFS, rcFile, rcResizing, rcSelf, rcNull );
-    else
-    {
-        uint64_t local_size;
-        rc = KFileSize( self, &local_size );
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "cannot detect filesize when truncating cached file" );
-        }
-        else
-        {
-            uint32_t block_size;
-            rc = read_block_size( self, local_size, &block_size, false );
-            if ( rc == 0 )
-            {
-                uint64_t content_size;
-                rc = read_content_size( self, local_size, &content_size, false );
-                if ( rc == 0 )
-                {
-                    uint64_t block_count;
-                    /* size_t */ uint64_t bitmap_bytes;
-                    rc = verify_file_structure( local_size, block_size, content_size, &block_count, &bitmap_bytes, false );
-
-                    /* truncate the file by setting the new (shorter) filesize */
-                    if ( rc == 0 )
-                        rc = KFileSetSize( self, content_size );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t promote_cache( KCacheTeeFile * cf )
-{
-    char cache_file_name [ 4096 ];
-    char temp_file_name [ 4096 ];
-    size_t num_writ;
-    rc_t rc = string_printf ( cache_file_name, sizeof cache_file_name, &num_writ, "%s.cache", cf -> local_path );
-    if ( rc == 0 )
-        rc = string_printf ( temp_file_name, sizeof temp_file_name, &num_writ, "%s.cache.temp", cf -> local_path );
-
-    /* (1) releaes open cache file ( windows cannot rename open files ) */
-    if ( rc == 0 )
-        rc = KFileRelease( cf -> local );
-
-    /* (2) rename to temporary name */
-    if ( rc == 0 )
-    {
-        cf -> local = NULL;
-        rc = KDirectoryRename ( cf -> dir, true, cache_file_name, temp_file_name );
-    }
-
-    /* (3) open from temporary name */
-    if ( rc == 0 )
-        rc = KDirectoryOpenFileWrite( cf -> dir, &cf -> local, true, "%s", temp_file_name );
-
-    /* (4) perform truncation */
-    if ( rc == 0 )
-        rc = TruncateCacheFile( cf -> local );
-    
-    /* (5) releaes open temp. cache file ( windows cannot rename open files ) */
-    if ( rc == 0 )
-        rc = KFileRelease( cf -> local );
-
-    /* (6) rename to final filename ( windows cannot rename open files ) */
-    if ( rc == 0 )
-    {
-        cf -> local = NULL;
-        rc = KDirectoryRename ( cf -> dir, true, temp_file_name, cf -> local_path );
-    }
-
-    /* (6) open from final filename */
-    if ( rc == 0 )
-        rc = KDirectoryOpenFileWrite( cf -> dir, &cf -> local, true, "%s", cf -> local_path );
-
-    return rc;
-}
-
-
-/* Destroy
- */
-static rc_t CC KCacheTeeFileDestroy( KCacheTeeFile *self )
-{
-    if ( self->report )
-    {
-        OUTMSG(( "\nDESTROY cacheteefile '%s'\n\n", self -> local_path ));
-    }
-
-    if ( !self -> local_read_only && self -> lock != NULL )
-    {
-        rc_t rc = IsCacheFileComplete ( self -> local, &self -> fully_in_cache, false );
-        if ( rc == 0 && self -> fully_in_cache )
-        {
-            if ( self->report )
-            {
-                OUTMSG(( "\nPROMOTING cacheteefile '%s'\n\n", self -> local_path ));
-            }
-            promote_cache( self );
-        }
-    }
-
-    if ( self->bitmap != NULL )
-        free( self->bitmap );
-    if ( self->scratch_buffer != NULL )
-        free( self->scratch_buffer );
-
-    KDirectoryRelease ( self->dir );
-    KFileRelease ( self -> remote );
-    KFileRelease ( self -> local );
-    KLockFileRelease ( self -> lock );
-    KFileRelease ( self -> logger );
-
-    free ( self );
-    return 0;
-}
-
-
-
-static rc_t log_to_file( KFile *log, uint64_t *log_file_pos,
-                         uint64_t pos, size_t bsize, size_t num_read )
-{
-    char buffer[ 1024 ];
-    size_t printf_written;
-    rc_t rc = string_printf( buffer, sizeof buffer, &printf_written, 
-                             "READ at %lu.%u read = %u\n",
-                             pos, bsize, num_read );
-    if ( rc == 0 )
-    {
-        size_t log_written;
-        rc = KFileWriteAll ( log, *log_file_pos, buffer, printf_written, &log_written );
-        if ( rc == 0 )
-            *log_file_pos += log_written;
-    }
-    return rc;
-}
-
-
-static void set_bitmap( const KCacheTeeFile *cself, uint64_t start_block, uint64_t block_count )
-{
-    uint64_t block_idx, block_nr;
-    for ( block_idx = 0, block_nr = start_block; 
-          block_idx < block_count; 
-          ++block_idx, ++block_nr )
-    {
-        cself->bitmap[ block_nr >> 3 ] |= BitNr2Mask[ block_nr & 0x07 ];
-    }
-}
-
-
-static rc_t write_bitmap( const KCacheTeeFile *cself, uint64_t start_block, uint64_t block_count )
-{
-    size_t written;
-    uint32_t start_block_byte = ( start_block >> 3 );
-    uint32_t end_block_byte = ( ( start_block + block_count - 1 ) >> 3 );
-    uint64_t pos = cself->remote_size + start_block_byte;
-    size_t to_write = ( end_block_byte - start_block_byte ) + 1;
-    rc_t rc = KFileWriteAll( cself->local, pos, &cself->bitmap[ start_block_byte ], to_write, &written );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc, "cannot write local-file-bitmap block $(sb).$(cn)", 
-                           "sb=%lu,cn=%lu", start_block, block_count ) );
-    }
-    if ( rc == 0 && cself->report )
-    {
-        OUTMSG(( "writing bitmap: %u bytes written at pos %lu\n", written, pos ));
-    }
-
-    return rc;
-}
-
-
-static rc_t resize_scratch_buffer( const KCacheTeeFile *cself, /* size_t */ uint64_t new_size )
-{
-    rc_t rc = 0;
-    KCacheTeeFile *self = ( KCacheTeeFile * )cself;
-
-    /* create scratch-buffer or resize it if needed */
-    if ( self->scratch_size == 0 )
-    {
-        self->scratch_buffer = malloc( new_size );
-        if ( self->scratch_buffer == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        else
-            self->scratch_size = new_size;
-    }
-    else if ( self->scratch_size < new_size )
-    {
-        uint8_t * tmp = realloc( self->scratch_buffer, new_size );
-        if ( tmp == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            self->scratch_buffer = tmp;
-            self->scratch_size = new_size;
-        }
-    }
-    return rc;
-}
-
-
-size_t check_rd_len( const KCacheTeeFile *cself, uint64_t pos, size_t bsize )
-{
-    size_t res = bsize;
-    uint64_t last_pos = pos;
-    last_pos += bsize;
-    if ( last_pos >= cself->remote_size )
-    {
-        if ( pos >= cself->remote_size )
-            res = 0;
-        else
-            res = ( cself->remote_size - pos );
-    }
-    return res;
-}
-
-
-static rc_t rd_remote_wr_local( const KCacheTeeFile *cself, uint64_t pos,
-                                void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-    if ( bsize > 0 )
-    {
-        size_t bytes_read;
-        *num_read = 0;
-        rc = KFileReadAll( cself->remote, pos, buffer, bsize, &bytes_read );
-        if ( rc == 0 )
-        {
-            if ( cself->report )
-            {
-                OUTMSG(( "reading remote data: %u bytes read at pos %lu\n", bytes_read, pos ));
-            }
-
-            if ( cself->local_read_only )
-            {
-                *num_read = bytes_read;
-            }
-            else
-            {
-                rc = KFileWriteAll( cself->local, pos, buffer, bytes_read, num_read );
-                if ( rc == 0 && cself->report )
-                {
-                    OUTMSG(( "writing local data: %u bytes written at pos %lu\n", *num_read, pos ));
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-#if 0
-static rc_t KCacheTeeFileRead_Starting_with_Cache_Hit( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t *num_read, uint64_t first_requested_block )
-{
-    rc_t rc = 0;
-    uint64_t t_pos, end_block, last_block = first_requested_block;
-    size_t to_read = check_rd_len( cself, pos, bsize );
-
-    if ( to_read == 0 )
-        return rc;
-
-    t_pos = pos + to_read - 1;
-    end_block = ( t_pos / cself->block_size );
-
-    /* the requested range starts with a cache-hit : 
-        - detect the last block after this first hit, that is still in cache */
-    if ( end_block > first_requested_block )
-    {
-        while( ( last_block <= end_block ) && ( IS_CACHE_BIT( cself, last_block + 1 ) ) )
-            ++last_block;
-    }
-
-    /* if not the whole requested range is a cache-hit: reduce to_read */
-    if ( last_block < end_block )
-/*        to_read = ( ( ( ( last_block + 1 ) * cself->block_size ) - 1 ) - pos ); */
-        to_read = ( ( ( last_block + 1 ) * cself->block_size ) - pos );
-    assert( to_read <= bsize );
-
-    if ( cself->report )
-        OUTMSG(( "RD LOCAL: %,lu.%,lu\n", pos, to_read ));
-
-    /* now read it from the local file into the user-supplied buffer */
-    if ( to_read > 0 )
-        rc = KFileReadAll( cself->local, pos, buffer, to_read, num_read );
-
-    return rc;
-}
-#endif
-
-#if 0
-static rc_t KCacheTeeFileRead_Block_Aligned_Cache_Miss( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t *num_read, uint64_t first_requested_block )
-{
-    rc_t rc;
-    /* we are block-aligned ! */
-    uint64_t block_count = ( bsize / cself->block_size );
-    if ( cself->report )
-        OUTMSG(( "RD REMOTE (block aligned): %,lu.%,lu (%,lu blocks)\n", pos, bsize, block_count ));
-    rc = rd_remote_wr_local( cself, pos, buffer, bsize, num_read );
-    if ( rc == 0 && !cself->local_read_only )
-    {
-        set_bitmap( cself, first_requested_block, block_count );
-        rc = write_bitmap( cself, first_requested_block, block_count );
-    }
-    if ( rc == 0 && cself->cluster_factor > 1 )
-    {
-        size_t over_read_size = cself->cluster_factor * cself->block_size;
-        rc = resize_scratch_buffer( cself, over_read_size );
-        if ( rc == 0 )
-        {
-            size_t tmp_read;
-            uint64_t r_pos = pos + bsize;
-            rc = rd_remote_wr_local( cself, r_pos, cself->scratch_buffer, over_read_size, &tmp_read );
-            if ( rc == 0 && !cself->local_read_only )
-            {
-                set_bitmap( cself, first_requested_block + block_count, cself->cluster_factor );
-                rc = write_bitmap( cself, first_requested_block + block_count, cself->cluster_factor );
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-#if 0
-static rc_t KCacheTeeFileRead_Starting_with_Cache_Miss_small( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t to_read, size_t *num_read,
-                               uint64_t first_requested_block, uint64_t last_cache_miss_block )
-{
-    rc_t rc = 0;
-    uint64_t t_pos, block_count;
-    size_t t_len, processed;
-
-    /* we are not block-aligned, and the request is smaller than 1 block in size ! */
-    if ( cself->report )
-        OUTMSG(( "RD REMOTE (small) : %,lu.%,lu\n", pos, to_read ));
-
-    /* that means we request 1 or 2 blocks of memory from our scratch-buffer ... */
-    t_pos = ( first_requested_block * cself->block_size );
-    block_count = ( ( last_cache_miss_block - first_requested_block ) + 1 );
-    t_len = ( block_count * cself->block_size );
-    rc = resize_scratch_buffer( cself, t_len );
-
-    if ( cself->report )
-        OUTMSG(( "RD REMOTE (small) : from <%,lu> %,lu blocks\n", t_pos, block_count ));
-
-    assert( to_read <= t_len );
-
-    /* we read that from remote, write it local and set the bitmap */
-    if ( rc == 0 )
-    {
-        rc = rd_remote_wr_local( cself, t_pos, cself->scratch_buffer, t_len, &processed );
-        if ( rc == 0 && !cself->local_read_only )
-        {
-            set_bitmap( cself, first_requested_block, block_count );
-            rc = write_bitmap( cself, first_requested_block, block_count );
-        }
-    }
-
-    /* then we copy the requested amount out of the scratch-buffer */
-    if ( rc == 0 )
-    {
-        memcpy( buffer, &( cself->scratch_buffer[ pos - t_pos ] ), to_read );
-        *num_read = to_read;
-    }
-    return rc;
-}
-#endif
-
-#if 0
-static rc_t KCacheTeeFileRead_Starting_with_Cache_Miss_large( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t to_read, size_t *num_read,
-                               uint64_t first_requested_block, uint64_t last_cache_miss_block )
-{
-    rc_t rc = 0;
-    uint64_t t_pos;
-    int64_t t_len;
-    size_t processed;
-
-    /* we are not block-aligned ! */
-    if ( cself->report )
-        OUTMSG(( "RD REMOTE (large) : %,lu.%,lu\n", pos, to_read ));
-
-    /* THERE IS AN EVENTUAL PRE-READ if pos is not block-aligned, using the user-supplied buffer */
-    t_pos = ( first_requested_block * cself->block_size );
-    if ( t_pos < pos )
-    {
-        t_len = ( pos - t_pos );
-        if ( cself->report )
-            OUTMSG(( "PRE : %,lu.%,lu\n", t_pos, t_len ));
-
-        assert( t_len < bsize );
-        rc = rd_remote_wr_local( cself, t_pos, buffer, t_len, &processed );
-    }
-
-    if ( rc == 0 )
-    {
-        /* THERE IS AN EVENTUAL POST-READ if pos + to_read is not block-aligned */
-        uint64_t last_pos = ( last_cache_miss_block + 1 ) * cself->block_size;
-        t_pos = pos + processed;
-        if ( last_pos > t_pos )
-        {
-            t_len = ( last_pos - t_pos );
-            if ( cself->report )
-                OUTMSG(( "POST: %,lu.%,lu\n", t_pos, t_len ));
-            if ( t_len <= bsize )
-                rc = rd_remote_wr_local( cself, t_pos, buffer, t_len, &processed );
-        }
-
-        if ( rc == 0 )
-        {
-            /* finally we read what was requested, into the user-supplied buffer */
-            if ( cself->report )
-                OUTMSG(( "MAIN: %,lu.%,lu\n", pos, to_read ));
-
-            rc = rd_remote_wr_local( cself, pos, buffer, to_read, num_read );
-            if ( rc == 0 && !cself->local_read_only )
-            {
-                uint64_t block_count = ( last_cache_miss_block - first_requested_block ) + 1;
-                set_bitmap( cself, first_requested_block, block_count );
-                rc = write_bitmap( cself, first_requested_block, block_count );
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-#if 0
-static rc_t KCacheTeeFileRead_Starting_with_Cache_Miss( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t *num_read, uint64_t first_requested_block )
-{
-    rc_t rc = 0;
-    size_t to_read = check_rd_len( cself, pos, bsize );
-    uint64_t end_pos = pos + to_read;
-    uint64_t last_requested_block = ( end_pos / cself->block_size );
-    uint64_t last_cache_miss_block = first_requested_block;
-
-    if ( to_read == 0 )
-        return rc;
-
-    assert( to_read <= bsize );
-
-    /* detect the last block after this first miss, that is still not in cache */
-    while( last_cache_miss_block <= last_requested_block && 
-           !( IS_CACHE_BIT( cself, last_cache_miss_block ) ) )
-    {
-        ++last_cache_miss_block;
-    }
-
-    if ( cself->report )
-        OUTMSG(( "CACHE-MISS from block #%,lu to #%,lu (end-block #%,lu)\n",
-                  first_requested_block, last_cache_miss_block, last_requested_block ));
-
-    /* check if the request is aligned to our block */
-    if ( ( pos == ( first_requested_block * cself->block_size ) ) &&
-         ( ( to_read % cself->block_size ) == 0 ) )
-    {
-        /* we are block-aligned ! */
-        rc = KCacheTeeFileRead_Block_Aligned_Cache_Miss( cself, pos, buffer, to_read, num_read, first_requested_block );
-    }
-    else
-    {
-        if ( to_read < cself->block_size )
-        {
-            rc = KCacheTeeFileRead_Starting_with_Cache_Miss_small( cself, pos, buffer, bsize, to_read, num_read,
-                                                first_requested_block, last_cache_miss_block );
-        }
-        else
-        {
-            rc = KCacheTeeFileRead_Starting_with_Cache_Miss_large( cself, pos, buffer, bsize, to_read, num_read,
-                                                first_requested_block, last_cache_miss_block );
-        }
-    }
-    return rc;
-}
-#endif
-
-#if 0
-static rc_t KCacheTeeFileRead_clustered( const KCacheTeeFile *cself, uint64_t pos,
-                                         void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    size_t l_num_read = 0;
-    uint64_t first_requested_block = ( pos / cself->block_size );
-    
-    if ( num_read != NULL )
-        *num_read = 0;
-
-    if ( cself->report )
-        OUTMSG(( "\nREQUEST: %,lu .[ %,lu ] ( first_requested_block=%,lu )\n", pos, bsize, first_requested_block ));
-
-     if ( IS_CACHE_BIT( cself, first_requested_block ) )
-    {
-        rc = KCacheTeeFileRead_Starting_with_Cache_Hit( cself, pos, buffer, bsize, &l_num_read, first_requested_block );
-    }
-    else
-    {
-        rc = KCacheTeeFileRead_Starting_with_Cache_Miss( cself, pos, buffer, bsize, &l_num_read, first_requested_block );
-    }
-
-    if ( rc == 0 && num_read != NULL )
-        *num_read = l_num_read;
-
-    if ( cself->logger != NULL )
-    {
-        KCacheTeeFile * self = ( KCacheTeeFile * ) cself;
-        log_to_file( self->logger, &self->log_file_pos, pos, bsize, l_num_read );
-    }
-    return rc;
-}
-#endif
-
-static uint64_t calc_req_blocks( uint64_t pos, uint64_t first_req_block, size_t bsize, uint32_t block_size )
-{
-    uint64_t res, temp;
-
-    res = pos;
-    res += bsize;
-    temp = first_req_block;
-    temp *= block_size;
-    res -= temp;
-    res += block_size;
-    res--;
-    res /= block_size;
-
-/*    res = ( ( ( pos + bsize ) - ( first_req_block * block_size ) + ( block_size - 1 ) ) / block_size ); */
-/*    uint64_t req_blocks = ( ( ( pos + bsize - 1 ) / block_size ) - first_req_block ) + 1; */
-    return res;
-}
-
-static rc_t KCacheTeeFileRead_simple_cached( const KCacheTeeFile *cself, uint64_t pos,
-                                             void *buffer, size_t bsize, size_t *num_read, uint64_t first_req_block )
-{
-    rc_t rc = 0;
-    bool found_in_scratch = false;
-    size_t to_read;
-    size_t block_count = 1;
-    uint64_t req_blocks = calc_req_blocks( pos, first_req_block, bsize, cself->block_size );
-
-    /* we read as much as we have from the local cache, forcing the caller
-       to eventually make another request ( the non-cached part of it ) afterwards */
-    if ( req_blocks > 1 )
-    {
-        /* detect how many blocks are in cache after the first_req_block */
-        uint64_t block = first_req_block;
-        block_count = 0;
-        do
-        {
-            block++;
-            block_count++;
-        }
-        while ( ( block_count < req_blocks ) && ( IS_CACHE_BIT( cself, block ) ) );
-    }
-
-    /* check if we eventually have the requested bytes in the scratch-buffer */
-    if ( cself -> first_block_in_scratch == first_req_block )
-    {
-        uint64_t first_pos_in_scratch = first_req_block;
-        first_pos_in_scratch *= cself->block_size;
-        if ( pos >= first_pos_in_scratch )
-        {
-            uint64_t last_pos_in_scratch = first_pos_in_scratch;
-            last_pos_in_scratch += cself -> valid_scratch_bytes;
-            found_in_scratch = ( pos < last_pos_in_scratch );
-            if ( found_in_scratch )
-            {
-                uint64_t available_in_scratch = ( last_pos_in_scratch - pos );
-                if ( bsize > available_in_scratch )
-                    to_read = available_in_scratch;
-                else
-                    to_read = bsize;
-
-                memmove ( buffer, &( cself->scratch_buffer[ pos - first_pos_in_scratch ] ), to_read );
-                *num_read = to_read;
-            }
-        }
-    }
-
-    if ( !found_in_scratch )
-    {
-        /* now we have to check how much of the request can be satisfied from the local file */
-        uint64_t reachable = first_req_block;
-        reachable += block_count;
-        reachable *= cself->block_size;
-        reachable -= pos;
-
-        /* are we requesting beyond the end of file? */
-        if ( reachable >= bsize )
-            to_read = check_rd_len( cself, pos, bsize );
-        else
-            to_read = check_rd_len( cself, pos, reachable );
-
-        rc = KFileReadAll( cself->local, pos, buffer, to_read, num_read );
-    }
-
-    return rc;
-}
-
-
-static rc_t KCacheTeeFileRead_simple_not_cached( const KCacheTeeFile *cself, uint64_t pos,
-                                                 void *buffer, size_t bsize, size_t *num_read, uint64_t first_req_block )
-{
-    rc_t rc;
-    size_t to_read_remote;
-    size_t block_count = 1;
-    uint64_t req_blocks = calc_req_blocks( pos, first_req_block, bsize, cself->block_size );
-
-    if ( req_blocks >  1 )
-    {
-        uint64_t block = first_req_block;
-        block_count = 0;
-        do
-        {
-            block++;
-            block_count++;
-        }
-        while ( ( block_count < req_blocks ) && ( !( IS_CACHE_BIT( cself, block ) ) ) );
-    }
-
-    to_read_remote = ( block_count * cself->block_size );
-    rc = resize_scratch_buffer( cself, to_read_remote );
-    if ( rc == 0 )
-    {
-        size_t l_num_read;
-        uint64_t block_start = first_req_block;
-        block_start *= cself->block_size;
-        to_read_remote = check_rd_len( cself, block_start, to_read_remote );
-        rc = rd_remote_wr_local( cself, block_start, cself->scratch_buffer, to_read_remote, &l_num_read );
-        if ( rc == 0 )
-        {
-            ( ( KCacheTeeFile * )cself ) -> first_block_in_scratch = first_req_block;
-            ( ( KCacheTeeFile * )cself ) -> valid_scratch_bytes = l_num_read;
-            if ( !cself->local_read_only )
-            {
-                set_bitmap( cself, first_req_block, block_count );
-                rc = write_bitmap( cself, first_req_block, block_count );
-            }
-        }
-        if ( rc == 0 )
-        {
-            /* what we have to return to the caller is somewhere in the scratch_buffer */
-            uint64_t offset = pos;
-            offset -= block_start;
-
-            /* how much we can copy depends on how much was not in cache,
-               and how much was requested in the first place... */
-            if ( l_num_read >= offset )
-            {
-                l_num_read -= offset;
-                if ( l_num_read > bsize )
-                    l_num_read = bsize;
-                memmove ( buffer, &( cself->scratch_buffer[ offset ] ), l_num_read );
-            }
-            else
-            {
-                l_num_read = 0;
-            }
-            *num_read = l_num_read;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t KCacheTeeFileRead_simple( const KCacheTeeFile *cself, uint64_t pos,
-                                      void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    uint64_t first_req_block = pos;
-    first_req_block /= cself->block_size;
-
-    *num_read = 0;
-    if ( cself->report )
-        OUTMSG(( "\nREQUEST '%s': %,lu .[%,lu] ( first_req_block=%,lu )\n",
-                 cself->local_path, pos, bsize, first_req_block ));
-
-    /* "simple" strategy, read only that much as requested... */
-    if ( IS_CACHE_BIT( cself, first_req_block ) )
-    {
-        rc = KCacheTeeFileRead_simple_cached( cself, pos, buffer, bsize, num_read, first_req_block );
-    }
-    else
-    {
-        rc = KCacheTeeFileRead_simple_not_cached( cself, pos, buffer, bsize, num_read, first_req_block );
-    }
-
-    if ( cself->logger != NULL )
-    {
-        KCacheTeeFile * self = ( KCacheTeeFile * ) cself;
-        log_to_file( self->logger, &self->log_file_pos, pos, bsize, *num_read );
-    }
-
-    return rc;
-}
-
-
-/**********************************************************************************************
-    START vt-functions
-**********************************************************************************************/
-
-static struct KSysFile* KCacheTeeFileGetSysFile( const KCacheTeeFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return NULL;
-}
-
-
-static rc_t KCacheTeeFileRandomAccess( const KCacheTeeFile *self )
-{
-    return 0;
-}
-
-
-static rc_t KCacheTeeFileSize( const KCacheTeeFile *self, uint64_t *size )
-{
-    *size = self->remote_size;
-    return 0;
-}
-
-
-static rc_t KCacheTeeFileSetSize( KCacheTeeFile *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFile, rcReadonly );
-}
-
-static rc_t KCacheTeeFileRead( const KCacheTeeFile *cself, uint64_t pos,
-                               void *buffer, size_t bsize, size_t *num_read )
-{
-    /*
-    if ( cself -> cluster_factor != 0 )
-        return KCacheTeeFileRead_clustered( cself, pos, buffer, bsize, num_read );
-    else
-        return KCacheTeeFileRead_simple( cself, pos, buffer, bsize, num_read );
-    */
-
-    return KCacheTeeFileRead_simple( cself, pos, buffer, bsize, num_read );
-}
-
-
-static rc_t KCacheTeeFileWrite( KCacheTeeFile *self, uint64_t pos,
-                                const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcInterface, rcUnsupported );
-}
-
-/**********************************************************************************************
-    END vt-functions
-**********************************************************************************************/
-
-
-static KFile_vt_v1 vtKCacheTeeFile =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KCacheTeeFileDestroy,
-    KCacheTeeFileGetSysFile,
-    KCacheTeeFileRandomAccess,
-    KCacheTeeFileSize,
-    KCacheTeeFileSetSize,
-    KCacheTeeFileRead,
-    KCacheTeeFileWrite
-    /* end minor version 0 methods */
-};
-
-
-static rc_t make_cache_tee( struct KDirectory *self, struct KFile const **tee,
-    struct KFile const *remote, struct KFile *local, struct KFile *logger, KLockFile *lock,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path )
-{
-    rc_t rc;
-    size_t path_size = string_size ( path );
-    KCacheTeeFile * cf = malloc ( sizeof * cf + path_size + 1 );
-    if ( cf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        cf -> dir = self;
-        string_copy( cf -> local_path, path_size + 1, path, path_size );
-        cf -> remote = remote;     /* store the file-objects but no AddRef()'s yet! */
-        cf -> local  = local;
-        cf -> logger = logger;
-        cf -> lock = lock;
-        cf -> report = report;
-        cf -> cluster_factor = cluster;
-        cf -> local_read_only = !( local -> write_enabled );
-        cf -> block_size = ( blocksize > 0 ) ? blocksize : CACHE_TEE_DEFAULT_BLOCKSIZE;
-        cf -> bitmap = NULL;
-        cf -> scratch_buffer = NULL;
-        cf -> scratch_size = 0;
-        cf -> first_block_in_scratch = 0;
-        cf -> valid_scratch_bytes = 0;
-
-        rc = KFileSize( local, &cf -> local_size );
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "cannot detect size of local file" );
-        }
-        else
-        {
-            rc = KFileSize( cf -> remote, &cf -> remote_size );
-            if ( rc != 0 )
-            {
-                LOGERR( klogErr, rc, "cannot detect size of remote file" );
-            }
-            else
-            {
-                if ( cf -> local_size == 0 )
-                {
-                    /* the local file was just created... */
-                    if ( cf -> remote_size == 0 )
-                    {
-                        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-                        LOGERR( klogErr, rc, "size of remote file is zero" );
-                    }
-                    else
-                    {
-                        rc = calculate_local_size_from_remote_size( cf );
-                        if ( rc == 0 )
-                        {
-                            rc = KFileSetSize ( cf -> local, cf -> local_size );
-                            if ( rc == 0 )
-                            {
-                                rc = init_new_local_file( cf );
-                            }
-                            else
-                            {
-                                PLOGERR( klogInt, ( klogInt, rc, "cannot size local file to $(l) bytes", "l=%lu", cf->local_size ) );
-                            }
-                        }
-                    }
-                }
-                else
-                    rc = verify_existing_local_file( cf, false );
-            }
-
-            if ( rc == 0 && cf -> fully_in_cache && ! cf -> local_read_only && cf -> lock != NULL )
-            {
-                /* here is the up-front-test: the cache is complete and we have write access! */
-                rc = promote_cache( cf );
-                /*
-                if ( rc == 0 )
-                    rc = KFileAddRef( cf -> local );
-                */
-                if ( rc == 0 )
-                {
-                    *tee = cf -> local;
-                    KLockFileRelease ( cf -> lock );
-                    free ( cf );
-                    return rc;  /* here we return the truncated, promoted cache as tee-file ! */
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                if ( cf -> remote_size == 0 )
-                    cf -> remote_size = cf -> local_size;
-
-                /* now we have to AddRef() everything we hang on until the final release! */
-                rc = KDirectoryAddRef ( cf -> dir );
-                if ( rc == 0 )
-                {
-                    rc = KFileAddRef( cf -> remote );
-                    if ( rc == 0 )
-                    {
-                        /* rc = KFileAddRef( cf -> local ); */
-                        if ( rc == 0 )
-                        {
-                            if ( cf -> logger != NULL )
-                                rc = KFileAddRef( cf -> logger );
-                            if ( rc == 0 )
-                            {
-                                rc = KFileInit( &cf -> dad, (const union KFile_vt *)&vtKCacheTeeFile, "KCacheTeeFile", path, true, false );
-                                if ( rc == 0 )
-                                {
-                                    /* the wrapper is ready to use now! */
-                                    *tee = ( const KFile * ) &cf -> dad;
-                                    return 0;
-                                }
-                                else
-                                {
-                                    LOGERR( klogErr, rc, "cannot initialize KFile-structure" );
-                                    KFileRelease( cf -> logger );
-                                    KFileRelease( cf -> local );
-                                    KFileRelease( cf -> remote );
-                                    KDirectoryRelease ( cf -> dir );
-                                }
-                            }
-                            else
-                            {
-                                KFileRelease( cf -> local );
-                                KFileRelease( cf -> remote );
-                                KDirectoryRelease ( cf -> dir );
-                            }
-                        }
-                        else
-                        {
-                            KFileRelease( cf -> remote );
-                            KDirectoryRelease ( cf -> dir );
-                        }
-                    }
-                    else
-                        KDirectoryRelease ( cf -> dir );
-                }
-            }
-        }
-        free ( cf );
-    }
-    return rc;
-}
-
-
-static rc_t make_read_only_cache_tee( struct KDirectory *self,
-    struct KFile const **tee, struct KFile const *remote, struct KFile *logger,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path )
-{
-    const struct KFile * local;
-    rc_t rc = KDirectoryOpenFileRead( self, &local, "%s.cache", path );
-    if ( rc == 0 )
-    {
-        if ( report )
-            KOutMsg( "successfuly opened cache file '%s.cache' in read/only-mode\n",
-                      path );
-        rc = make_cache_tee( self, tee, remote, ( struct KFile * )local, logger, NULL,
-                             blocksize, cluster, report, path );
-    }
-    else
-    {
-        /* we cannot even open the local cache in read-only mode,
-           we give up - and return a reference to the remote file... */
-        rc = KFileAddRef( remote );
-        if ( rc == 0 )
-        {
-            if ( report )
-                KOutMsg( "cannot open cache file '%s.cache' in read/only-mode ( returning remote-file )\n",
-                          path );
-            *tee = remote;
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryVMakeCacheTee ( struct KDirectory *self,
-    struct KFile const **tee, struct KFile const *remote, struct KFile *logger,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path, va_list args )
-{
-    rc_t rc;
-    if ( tee == NULL || remote == NULL )
-        rc = RC ( rcFS, rcFile, rcAllocating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcAllocating, rcSelf, rcNull );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcAllocating, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcAllocating, rcPath, rcEmpty );
-        else
-        {
-            char full [ 4096 ];
-
-#if CACHE_TEE_REPORT == 1
-            report = true;
-#endif
-
-            rc = KDirectoryVResolvePath ( self, false, full, sizeof full, path, args );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc, "cannot resolve path of cache file '$(path)'", 
-                        "path=%s", full ) );
-            }
-            else
-            {
-                KLockFile *lock = NULL;
-
-                if ( report )
-                    KOutMsg( "CREATE CacheTeeFile for '%s'\n", full );
-
-                rc = KDirectoryCreateLockFile ( self, &lock, "%s.cache.lock", full );
-                if ( rc == 0 )
-                {
-                    /* it was possible to aquire the lock on the cache-file */
-                    struct KFile * local;
-
-                    if ( report )
-                        KOutMsg( "successfuly aquired lockfile '%s.cache.lock'\n", full );
-
-
-                    rc = KDirectoryOpenFileWrite( self, &local, true, "%s.cache", full );
-                    if ( rc == 0 )
-                    {
-                        if ( report )
-                            KOutMsg( "successfuly opened '%s.cache'\n", full );
-
-                        /* we have the exclusive rd/wr access to the cache file !*/
-                        rc = make_cache_tee( self, tee, remote, local, logger, lock,
-                                             blocksize, cluster, report, full );
-                    }
-                    else if ( GetRCState( rc ) == rcNotFound )
-                    {
-                        rc = KDirectoryCreateFile( self, &local, true, 0664, kcmOpen, "%s.cache", full );
-                        if ( rc == 0 )
-                        {
-                            if ( report )
-                                KOutMsg( "cache-file '%s.cache' created with rd/wr-access\n", full );
-                            /* we have the exclusive rd/wr access to the cache file !*/
-                            rc = make_cache_tee( self, tee, remote, local, logger, lock,
-                                                 blocksize, cluster, report, full );
-                        }
-                    }
-                    else
-                    {
-                        if ( report )
-                            KOutMsg( "no rd/wr access to cache-file '%s.cache' rc=%R\n", full, rc );
-
-                        /* we do not have the exclusive rd/wr access to the cache file !*/
-                        rc = KLockFileRelease ( lock );
-                        if ( rc == 0 )
-                            rc = make_read_only_cache_tee( self, tee, remote, logger,
-                                    blocksize, cluster, report, full );
-                    }
-                }
-                else if ( GetRCState ( rc ) == rcBusy )
-                {
-                    if ( report )
-                        KOutMsg( "failed to aquired lockfile '%s.cache.lock'\n", full );
-
-                    /* it was NOT possible to aquire the lock on the cache-file */
-                    rc = make_read_only_cache_tee( self, tee, remote, logger,
-                            blocksize, cluster, report, full );
-                }
-                else
-                {
-                    PLOGERR( klogErr, ( klogErr, rc, "cannot create lock-file '$(path).cache.lock'", 
-                            "path=%s", full ) );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryMakeCacheTee ( struct KDirectory *self,
-    struct KFile const **tee, struct KFile const *remote, struct KFile *logger,
-    uint32_t blocksize, uint32_t cluster, bool report, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDirectoryVMakeCacheTee ( self, tee, remote, logger, blocksize, cluster, report, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC GetCacheCompleteness( const struct KFile * self, float * percent )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcSelf, rcNull );
-    else if ( percent == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcParam, rcNull );
-    else
-    {
-        uint64_t local_size;
-        *percent = 0;
-        rc = KFileSize( self, &local_size );
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "cannot detect filesize when checking if cached file is complete" );
-        }
-        else
-        {
-            uint32_t block_size;
-            rc = read_block_size( self, local_size, &block_size, false );
-            if ( rc == 0 )
-            {
-                uint64_t content_size;
-                rc = read_content_size( self, local_size, &content_size, false );
-                /* create bitmap buffer */
-                if ( rc == 0 )
-                {
-                    uint64_t block_count;
-                    /* size_t */ uint64_t bitmap_bytes;
-                    rc = verify_file_structure( local_size, block_size, content_size, &block_count, &bitmap_bytes, false );
-                    if ( rc == 0 )
-                    {
-                        uint8_t * bitmap = NULL;
-                        rc = create_bitmap_buffer( &bitmap, bitmap_bytes );
-                        if ( rc == 0 )
-                        {
-                            size_t num_read;
-                            /* read the bitmap into the memory ... */
-                            rc = KFileReadAll ( self, content_size, bitmap, bitmap_bytes, &num_read );
-                            if ( rc != 0 )
-                            {
-                                LOGERR( klogErr, rc, "cannot read bitmap from local file" );
-                            }
-                            else if ( num_read != bitmap_bytes )
-                            {
-                                rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcInvalid );
-                                PLOGERR( klogErr, ( klogErr, rc, "cannot read $(ls) bitmap-bytes from local file, read $(rs) instead", 
-                                               "ls=%lu,rs=%lu", bitmap_bytes, num_read ));
-                            }
-                        }
-                        if ( rc == 0 )
-                        {
-                            uint64_t idx, in_cache = 0;
-                            for ( idx = 0; idx < block_count; ++idx )
-                            {
-                                if ( IS_BITMAP_BIT( bitmap, idx ) )
-                                    in_cache++;
-                            }
-                            if ( in_cache > 0 && block_count > 0 )
-                            {
-                                float res = in_cache;
-                                res *= 100;
-                                res /= block_count;
-                                * percent = res;
-                            }
-                        }
-                        if ( bitmap != NULL )
-                            free( bitmap );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* -----
- * examens the file, and reports the size of the original file ( without the cachefile-footer )
- *
- */
-LIB_EXPORT rc_t CC GetCacheTruncatedSize( const struct KFile * self, uint64_t * truncated_size, bool silent )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcSelf, rcNull );
-    else if ( truncated_size == NULL )
-        rc = RC( rcFS, rcFile, rcValidating, rcParam, rcNull );
-    else
-    {
-        uint64_t local_size;
-        *truncated_size = 0;
-        rc = KFileSize( self, &local_size );
-        if ( rc != 0 )
-        {
-            if ( !silent )
-            {
-                LOGERR( klogErr, rc, "cannot detect filesize when checking if cached file is complete" );
-            }
-        }
-        /* TODO: need to do a better constant tha a magic number */
-        else if (local_size < 13)
-        {
-            rc = RC ( rcFS, rcFile, rcValidating, rcSize, rcInsufficient );
-            if ( !silent )
-            {
-                LOGERR( klogErr, rc, "cannot use filesize of zero when checking if cached file is complete" );
-            }
-        }
-        else
-        {
-            uint32_t block_size;
-            rc = read_block_size( self, local_size, &block_size, true );
-            if ( rc == 0 )
-            {
-                uint64_t content_size;
-                rc = read_content_size( self, local_size, &content_size, true );
-                if ( rc == 0 )
-                {
-                    uint64_t block_count;
-                    /* size_t */ uint64_t bitmap_bytes;
-                    rc = verify_file_structure( local_size, block_size, content_size, &block_count, &bitmap_bytes, true );
-                    if ( rc == 0 )
-                    {
-                        *truncated_size = content_size;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
diff --git a/libs/kfs/countfile.c b/libs/kfs/countfile.c
deleted file mode 100644
index d34c5e9..0000000
--- a/libs/kfs/countfile.c
+++ /dev/null
@@ -1,652 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/countfile.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-/* ======================================================================
- * KCounterFile
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KFILE_IMPL struct KCounterFile
-#include <kfs/impl.h>
-
-/* clear out possible macro definitions of FS and GS,
- * which show up on Solaris/x86 when building with GCC (per sys/ucontext.h)
- */
-#ifdef FS
-#  undef FS
-#endif
-#ifdef GS
-#  undef GS
-#endif
-
-static rc_t CC KCounterFileDestroy (KCounterFile *self);
-static struct KSysFile *CC KCounterFileGetSysFile (const KCounterFile *self,
-					    uint64_t *offset);
-static rc_t CC KCounterFileRandomAccess (const KCounterFile *self);
-static uint32_t CC KCounterFileType (const KCounterFile *self);
-static rc_t CC KCounterFileSize (const KCounterFile *self, uint64_t *size);
-static rc_t CC KCounterFileSetSize (KCounterFile *self, uint64_t size);
-static rc_t CC KCounterFileRead (const KCounterFile *self, uint64_t pos,
-                                 void *buffer, size_t bsize, size_t *num_read);
-static rc_t CC KCounterFileWrite (KCounterFile *self, uint64_t pos, const void *buffer,
-			       size_t size, size_t *num_writ);
-
-
-static const KFile_vt_v1 vtKCounterFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KCounterFileDestroy,
-    KCounterFileGetSysFile,
-    KCounterFileRandomAccess,
-    KCounterFileSize,
-    KCounterFileSetSize,
-    KCounterFileRead,
-    KCounterFileWrite,
-
-    /* 1.1 */
-    KCounterFileType
-};
-
-/*-----------------------------------------------------------------------
- * KCounterFile
- */
-typedef uint8_t lstate;
-enum elstate
-{
-    ENOTHING,
-    EASCII,
-    ECR,
-    ELF,
-    ECRLF,
-    ELFCR,
-    EBINARY
-};
-struct KCounterFile
-{
-    KFile	dad;
-    uint64_t	max_position;
-    KFile *	original;
-    uint64_t *	bytecounter; /* we do not trust reads from bytecounter */
-    uint64_t *	linecounter; /* we do not trust reads from linecounter */
-    lstate      line_state;
-    bool	size_allowed;
-    bool	force;
-};
-
-/* ----------------------------------------------------------------------
- * KCounterFileMake
- *  create a new file object
- */
-
-static
-rc_t KCounterFileMake (KCounterFile ** pself,
-		       KFile * original,
-		       uint64_t * bytecounter,
-		       uint64_t * linecounter,
-                       bool force)
-{
-    uint64_t		fsize;
-    rc_t		rc;
-    KCounterFile *	self;
-
-    /* -----
-     * we can not accept any of the three pointer parameters as NULL
-     */
-    assert (pself != NULL);
-    assert (original != NULL);
-    assert (bytecounter != NULL);
-
-    /* -----
-     * get space for the object
-     */
-    self = malloc (sizeof (KCounterFile));
-    if (self == NULL)	/* allocation failed */
-    {
-	/* fail */
-	rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-	rc = KFileInit (&self->dad,			/* initialize base class */
-			(const KFile_vt*)&vtKCounterFile,/* VTable for KCounterFile */
-            "KCounterFile", "no-name",
-			original->read_enabled,
-			original->write_enabled);
-	if (rc == 0)
-	{
-            for (;;)
-            {
-                if (force) /* all sizes come from actual reads */
-                {
-                    fsize = 0;
-                    self->force = true;
-                    self->size_allowed = false;
-                }
-                else
-                {
-                    rc = KFileSize(original,&fsize);
-                    if (GetRCState(rc) == rcUnsupported)
-                    {
-                        force = true;
-                        continue;
-                    }
-                    else if (rc)
-                        break;
-                    self->force = false;
-                    self->size_allowed = true;
-                }
-                self->max_position = fsize;
-                self->original = original;
-                self->bytecounter = bytecounter;
-                self->linecounter = linecounter;
-                if (linecounter)
-                {
-                    self->line_state = ENOTHING;
-                    *linecounter = 0;
-                }
-                else
-                {
-                    self->line_state = EBINARY;
-                }
-                *bytecounter = fsize;
-                *pself = self;
-                return 0;
-            }
-	}
-	/* fail */
-	free (self);
-    }
-    *pself = NULL;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KFileMakeCounterRead (const KFile ** self, const KFile * original,
-                                         uint64_t * bytecounter, uint64_t * linecounter,
-                                         bool force_reads)
-{
-    return KCounterFileMake ((KCounterFile **)self, (KFile*)original, bytecounter, linecounter, force_reads);
-}
-LIB_EXPORT rc_t CC KFileMakeCounterUpdate (KFile ** self, KFile * original,
-                                           uint64_t * bytecounter, uint64_t * linecounter,
-                                           bool force_reads)
-{
-    return KCounterFileMake ((KCounterFile **)self, original, bytecounter, linecounter, force_reads);
-}
-LIB_EXPORT rc_t CC KFileMakeCounterWrite (KFile ** self, KFile * original,
-                                          uint64_t * bytecounter, uint64_t * linecounter,
-                                          bool force_reads)
-{
-    return KCounterFileMake ((KCounterFile **)self, original, bytecounter, linecounter, force_reads);
-}
-
-enum ecc
-{
-    NUL,
-    SOH,
-    STX,
-    ETX,
-    EOT,
-    ENQ,
-    ACK,
-    BEL,
-    BS,
-    TAB,
-    LF,
-    VT,
-    FF,
-    CR,
-    SO,
-    SI,
-    DLE,
-    DC1,
-    DC2,
-    DC3,
-    DC4,
-    NAK,
-    SYN,
-    ETB,
-    CAN,
-    EM,
-    SUB,
-    ESC,
-    FS,
-    GS,
-    RS,
-    US,
-    DEL = 127
-};
-
-static
-void check_state (KCounterFile * self, void * _buffer, size_t size)
-{
-    uint8_t * buffer = _buffer;
-    size_t idx;
-
-    if (self->linecounter == NULL)
-        return;
-
-    if (self->line_state == EBINARY)
-        return;
-
-    for (idx = 0; idx < size; ++idx)
-    {
-        if (buffer[idx] >= DEL)
-        {
-            self->line_state = EBINARY;
-        }
-        else
-        {
-            switch (buffer[idx])
-            {
-            case NUL:
-            case SOH:
-            case STX:
-            case ETX:
-            case EOT:
-            case ENQ:
-            case ACK:
-            case BEL:
-            case BS:
-            case SO:
-            case SI:
-            case DLE:
-            case DC1:
-            case DC2:
-            case DC3:
-            case DC4:
-            case NAK:
-            case SYN:
-            case ETB:
-            case CAN:
-            case EM:
-            case SUB:
-            case ESC:
-            case FS:
-            case GS:
-            case RS:
-            case US:
-            case DEL:
-                /* leave line count mode */
-                self->line_state = EBINARY;
-                *self->linecounter = 0;
-                return;
-
-            case 128: /* not in use yet - a pseudo-EOL */
-                /* FF might go here? */
-                ++*self->linecounter;
-                self->line_state = EASCII;
-                break;
-                
-
-            case LF:
-                switch (self->line_state)
-                {
-                case ENOTHING:
-                case ELF:
-                case ECRLF:
-                case ELFCR:
-                    ++*self->linecounter;
-                case EASCII:
-                    self->line_state = ELF;
-                    break;
-                case ECR:
-                    self->line_state = ECRLF;
-                    break;
-                }
-                break;
-            case CR:
-                switch (self->line_state)
-                {
-                case ENOTHING:
-                case ECR:
-                case ECRLF:
-                case ELFCR:
-                    ++*self->linecounter;
-                case EASCII:
-                    self->line_state = ECR;
-                    break;
-                case ELF:
-                    self->line_state = ELFCR;
-                    break;
-                }
-                break;
-
-            case TAB:
-            case VT:
-            case FF:
-            default:
-                if (self->line_state != EASCII)
-                {
-                    ++*self->linecounter;
-                }
-                self->line_state = EASCII;
-                break;
-            }
-        }       
-    }
-}
-
-static
-rc_t KCounterFileSeek (KCounterFile * self, uint64_t pos)
-{
-    uint64_t	max_position;
-    rc_t	rc = 0;
-    size_t	num_read = 0;
-    size_t	to_read;
-    uint8_t	ignored[64*1024];
-
-    assert (self->max_position < pos);
-    for (max_position = self->max_position; max_position < pos; max_position += num_read)
-    {
-            to_read = (size_t)( pos - max_position );
-            if (to_read > sizeof ignored)
-                to_read = sizeof ignored;
-            rc = KFileRead (self->original, max_position, ignored, to_read, &num_read);
-            if (rc || (num_read == 0))
-                break;
-            check_state (self, ignored, num_read);
-    }
-    self->max_position = max_position;
-    *self->bytecounter = max_position;
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KCounterFileDestroy (KCounterFile *self)
-{
-    rc_t rc = 0;
-    uint64_t size;
-
-    assert (self != NULL);
-    assert (self->bytecounter != NULL);
-
-    if (self->force || ! self->size_allowed)
-    {
-        size_t	num_read = 0;
-        uint8_t	ignored[64*1024];
-        
-        size = self->max_position;
-        if (self->dad.read_enabled)
-            do
-            {
-                rc = KFileRead (self->original, size,
-                                ignored, sizeof ignored, &num_read);
-                size += num_read;
-                DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_COUNTER),
-                       ("%s: size '%lu' num_read '%lu'\n", __func__, size, num_read));
-                if (rc != 0)
-                    break;
-                check_state (self, ignored, num_read);
-            } while (num_read != 0);
-    }
-    else
-    {
-        rc = KFileSize (self->original, &size);
-        DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_COUNTER),
-               ("%s: lazy way size '%lu'\n", __func__, size));
-    }
-    *self->bytecounter = size;
-    if (rc == 0)
-    {
-        rc = KFileRelease (self->original);
-        free (self);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * bytes could not be counted if memory mapped so this is disallowed
- */
-
-static
-struct KSysFile *CC KCounterFileGetSysFile (const KCounterFile *self, uint64_t *offset)
-{
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KCounterFileRandomAccess (const KCounterFile *self)
-{
-    assert (self != NULL);
-    assert (self->original != NULL);
-    return KFileRandomAccess (self->original);
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KCounterFileType (const KCounterFile *self)
-{
-    assert (self != NULL);
-    assert (self->original != NULL);
-
-    return KFileType (self->original);
-}
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KCounterFileSize (const KCounterFile *self, uint64_t *size)
-{
-    rc_t	rc;
-    uint64_t	fsize;
-
-    assert (self != NULL);
-    assert (self->original != NULL);
-    assert (size != NULL);
-
-    rc = KFileSize (self->original, &fsize);
-
-    if (rc == 0)
-    {
-	/* success: refreshing the value */
-	*size = ((KCounterFile *)self)->max_position = fsize;
-    }
-    /* pass along RC value */
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KCounterFileSetSize (KCounterFile *self, uint64_t size)
-{
-    rc_t rc;
-
-    rc = KFileSetSize (self->original, size);
-    if (rc == 0)
-	self->max_position = size;
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KCounterFileRead	(const KCounterFile *cself,
-				 uint64_t pos,
-				 void *buffer,
-				 size_t bsize,
-				 size_t *num_read)
-{
-    KCounterFile * 	self;
-    uint64_t	max_position;
-    uint64_t	temp_max_position;
-    rc_t	rc;
-
-
-    /* -----
-     * self and buffer were validated as not NULL before calling here
-     *
-     * So get the KTTOCNode type: chunked files and contiguous files 
-     * are read differently.
-     */
-    assert (cself != NULL);
-    assert (cself->original != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    self = (KCounterFile*)cself;
-    max_position = cself->max_position;
-
-    if ((pos > max_position) && (! self->size_allowed))
-    {
-	rc = KCounterFileSeek (self, pos);
-	if (rc != 0)
-	    return rc;
-        /* if seek failed */
-        if (pos > self->max_position)
-        {
-            *num_read = 0;
-            return 0;
-        }
-    }
-    rc = KFileRead (self->original, pos, buffer, bsize, num_read);
-    temp_max_position = pos + *num_read;
-    if (temp_max_position > max_position)
-    {
-        uint32_t new_bytes = (uint32_t)(temp_max_position - max_position);
-
-        check_state (self, ((char *)buffer) + (*num_read) - new_bytes, new_bytes);
-
-	*self->bytecounter = self->max_position = temp_max_position;
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KCounterFileWrite (KCounterFile *self, uint64_t pos,
-			   const void *buffer, size_t bsize,
-			   size_t *num_writ)
-{
-    uint64_t	max_position;
-    uint64_t	temp_max_position;
-    rc_t	rc;
-
-
-    /* -----
-     * self and buffer were validated as not NULL before calling here
-     *
-     * So get the KTTOCNode type: chunked files and contiguous files 
-     * are read differently.
-     */
-    assert (self != NULL);
-    assert (self->original != NULL);
-    assert (buffer != NULL);
-    assert (num_writ != NULL);
-    assert (bsize != 0);
-
-    max_position = self->max_position;
-
-    if ((self->dad.read_enabled) && (pos > max_position) && (! self->size_allowed))
-    {
-	rc = KCounterFileSeek (self, pos);
-	if (rc != 0)
-	    return rc;
-    }
-
-    rc = KFileWrite (self->original, pos, buffer, bsize, num_writ);
-    temp_max_position = pos + *num_writ;
-
-    if (temp_max_position > max_position)
-    {
-	*self->bytecounter = self->max_position = temp_max_position;
-    }
-    return rc;
-}
-
-
-/* end of file countfile.c */
-
diff --git a/libs/kfs/crc32.c b/libs/kfs/crc32.c
deleted file mode 100644
index a2a38a0..0000000
--- a/libs/kfs/crc32.c
+++ /dev/null
@@ -1,1771 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-
-#define CRC_DBG_REF(msg) DBGMSG(DBG_LEGREF,DBG_FLAG(DBG_LEGREF_CRC), msg)
-
-struct KCRC32File;
-#define KFILE_IMPL struct KCRC32File
-
-#include <kfs/crc.h>
-#include <kfs/impl.h>
-#include <klib/checksum.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-
-/*--------------------------------------------------------------------------
- * KCRC32SumEntry
- *  describes an entry into a CRC32 checksum file
- */
-typedef struct KCRC32SumEntry KCRC32SumEntry;
-struct KCRC32SumEntry
-{
-    SLNode n;
-    uint32_t crc32;
-    bool bin;
-    char path [ 1 ];
-};
-
-static
-void CC KCRC32SumEntryWhack ( SLNode *n, void *ignore )
-{
-    free ( n );
-}
-
-typedef struct KCRC32SumEntryFlushData KCRC32SumEntryFlushData;
-struct KCRC32SumEntryFlushData
-{
-    uint64_t pos;
-    KFile *f;
-    rc_t rc;
-};
-
-static
-bool CC KCRC32SumEntryFlush ( SLNode *n, void *data )
-{
-    KCRC32SumEntryFlushData *pb = data;
-    const KCRC32SumEntry *self = ( const KCRC32SumEntry* ) n;
-
-    int len;
-    size_t num_writ;
-    char line [ 4096 + 16 ];
-
-    len = snprintf ( line, sizeof line, "%08x %c%s\n",
-        self -> crc32, self -> bin ? '*' : ' ', self -> path );
-    if ( len < 0 || len >= sizeof line )
-    {
-        pb -> rc = RC ( rcFS, rcFile, rcFormatting, rcString, rcExcessive );
-        return true;
-    }
-
-    pb -> rc = KFileWrite ( pb -> f, pb -> pos, line, len, & num_writ );
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> pos += num_writ;
-
-    if ( num_writ == ( size_t ) len )
-        return false;
-
-    pb -> rc = RC ( rcFS, rcFile, rcFormatting, rcTransfer, rcIncomplete );
-    return true;
-}
-
-static
-rc_t KCRC32SumEntryMake ( KCRC32SumEntry **ep,
-    const char *path, uint32_t crc32, bool bin )
-{
-    KCRC32SumEntry *entry = malloc ( sizeof * entry + strlen ( path ) );
-    if ( entry == NULL )
-        return RC ( rcFS, rcFile, rcUpdating, rcMemory, rcExhausted );
-
-    entry -> crc32 = crc32;
-    entry -> bin = bin;
-    strcpy ( entry -> path, path );
-
-    * ep = entry;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KCRC32SumFmt
- *  a formatter for reading or writing an crc32sum-style checksum file
- */
-struct KCRC32SumFmt
-{
-    SLList entries;
-    KFile *f;
-    atomic32_t refcount;
-    uint32_t count;
-    bool read_only;
-    bool dirty;
-};
-
-/* Flush
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtFlush ( KCRC32SumFmt *self )
-{
-    if ( self != NULL && self -> dirty )
-    {
-        KCRC32SumEntryFlushData pb;
-        pb . pos = 0;
-        pb . f = self -> f;
-        pb . rc = 0;
-
-        SLListDoUntil ( & self -> entries, KCRC32SumEntryFlush, & pb );
-
-        if ( pb . rc != 0 )
-            return pb . rc;
-
-        self -> dirty = false;
-    }
-    return 0;
-}
-
-
-/* Whack
- */
-static
-rc_t KCRC32SumFmtWhack ( KCRC32SumFmt *self )
-{
-    rc_t rc;
-
-    atomic32_set ( & self -> refcount, 1 );
-
-    rc = KCRC32SumFmtFlush ( self );
-    if ( rc == 0 )
-        rc = KFileRelease ( self -> f );
-    if ( rc != 0 )
-        return rc;
-
-    SLListWhack ( & self -> entries, KCRC32SumEntryWhack, NULL );
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtAddRef ( const KCRC32SumFmt *cself )
-{
-    if ( cself != NULL )
-    {
-        CRC_DBG_REF (("%s self %p prior count %u\n", __func__, cself, atomic32_read ( & cself -> refcount ) ));
-        atomic32_inc ( & ( ( KCRC32SumFmt* ) cself ) -> refcount );
-    }
-    else
-    {
-        CRC_DBG_REF(("%s self %p\n", __func__, cself));
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KCRC32SumFmtRelease ( const KCRC32SumFmt *cself )
-{
-    KCRC32SumFmt *self = ( KCRC32SumFmt* ) cself;
-    if ( cself != NULL )
-    {
-        CRC_DBG_REF (("%s self %p prior count %u\n", __func__, cself, atomic32_read ( & cself -> refcount ) ));
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KCRC32SumFmtWhack ( self );
-    }
-    else
-    {
-        CRC_DBG_REF(("%s self %p\n", __func__, cself));
-    }
-    return 0;
-}
-
-
-/* Extract
- *  extract a single line
- */
-static
-rc_t KCRC32SumFmtExtract ( KCRC32SumFmt *self, const char *line, size_t size )
-{
-    rc_t rc = 0;
-    KCRC32SumEntry *entry;
-
-    /* check for a DOS condition not caught by parse */
-    if ( line [ size - 1 ] == '\r' )
-    {
-        /* drop CR from line */
-        size -= 1;
-    }
-
-    /* quick validity check */
-    if ( size < 11 || line [ 8 ] != ' ' )
-        return RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-
-    /* create entry */
-    entry = malloc ( sizeof * entry + size - ( 8 /* cs */ + 2 /* sp + mode */ ) );
-    if ( entry == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        /* read checksum */
-        char *p;
-        entry -> crc32 = strtoul ( line, & p, 16 );
-        if ( ( ( const char* ) p - line ) != 8 )
-            rc = RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-
-        /* parse mode */
-        else if ( line [ 9 ] == ' ' )
-            entry -> bin = false;
-        else if ( line [ 9 ] == '*' )
-            entry -> bin = true;
-        else
-            rc = RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-
-        /* the rest is path */
-        if ( rc == 0 )
-        {
-            string_copy ( entry -> path, size, & line [ 10 ], size - 10 );
-            SLListPushTail ( & self -> entries, & entry -> n );
-            ++ self -> count;
-            return 0;
-        }
-
-        free ( entry );
-    }
-
-    return rc;
-}
-
-
-/* Parse
- *  parse *.crc32 file
- */
-static
-rc_t KCRC32SumFmtParse ( KCRC32SumFmt *self, const char *start, const char *stop )
-{
-    rc_t rc;
-    const char *end;
-
-    for ( rc = 0; start < stop; start = end + 1 )
-    {
-        end = string_chr ( start, stop - start, '\n' );
-        if ( end == NULL )
-            end = stop;
-
-        /* allow '#' comments and blank lines */
-        if ( ( end - start ) == 0 )
-            continue;
-        if ( start [ 0 ] == '#' )
-            continue;
-
-        /* line must have minimum length */
-        if ( ( end - start ) < ( 8 /* cs */ + 2 /* sp + mode */ + 1 /* path */ ) )
-        {
-            /* check for empty line ending in CR-LF */
-            if ( end [ -1 ] == '\r' && ( end - start ) == 1 )
-                continue;
-
-            /* other stuff is garbage */
-            rc = RC ( rcFS, rcFile, rcParsing, rcData, rcInsufficient );
-            break;
-        }
-
-        /* extract entry */
-        rc = KCRC32SumFmtExtract ( self, start, end - start );
-        if ( rc != 0 )
-            break;
-    }
-
-    return rc;
-}
-
-
-/* Populate
- *  reads all lines of input from *.crc32 file
- */
-static
-rc_t KCRC32SumFmtPopulate ( KCRC32SumFmt *self, const KFile *in )
-{
-    uint64_t eof;
-    rc_t rc = KFileSize ( in, & eof );
-    if ( rc == 0 )
-    {
-        char *buff = malloc ( ( size_t ) eof );
-        if ( buff == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            size_t num_read, total;
-            for ( total = 0; total < ( size_t ) eof; total += num_read )
-            {
-                rc = KFileRead ( in, total,
-                    & buff [ total ], ( size_t ) eof - total, & num_read );
-                if ( rc != 0 )
-                    break;
-                if ( num_read == 0 )
-                {
-                    rc = RC ( rcFS, rcFile, rcReading, rcTransfer, rcIncomplete );
-                    break;
-                }
-            }
-
-            if ( rc == 0 )
-                rc = KCRC32SumFmtParse ( self, buff, buff + total );
-
-            free ( buff );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Make
- *  creates a formatted accessor to textual checksum file
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtMakeRead ( const KCRC32SumFmt **fp, const KFile *in )
-{
-    rc_t rc;
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( in == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! in -> read_enabled )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KCRC32SumFmt *f = malloc ( sizeof * f );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                SLListInit ( & f -> entries );
-                atomic32_set ( & f -> refcount, 1 );
-                f -> f = NULL;
-                f -> count = 0;
-                f -> read_only = true;
-                f -> dirty = false;
-
-                rc = KCRC32SumFmtPopulate ( f, in );
-                if ( rc == 0 )
-                {
-                    f -> f = ( KFile* ) in;
-                    * fp = f;
-                    return 0;
-                }
-                
-                KCRC32SumFmtWhack ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KCRC32SumFmtMakeUpdate ( KCRC32SumFmt **fp, KFile *out )
-{
-    rc_t rc;
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            KCRC32SumFmt *f = malloc ( sizeof * f );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                SLListInit ( & f -> entries );
-                atomic32_set ( & f -> refcount, 1 );
-                f -> f = NULL;
-                f -> count = 0;
-                f -> read_only = false;
-                f -> dirty = false;
-
-                rc = 0;
-                if ( out -> read_enabled )
-                    rc = KCRC32SumFmtPopulate ( f, out );
-                if ( rc == 0 )
-                {
-                    f -> f = out;
-                    * fp = f;
-                    return 0;
-                }
-                
-                KCRC32SumFmtWhack ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Count
- *  return the number of checksums in file
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtCount ( const KCRC32SumFmt *self, uint32_t *count )
-{
-    rc_t rc;
-    if ( count == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * count = self -> count;
-            return 0;
-        }
-
-        * count = 0;
-    }
-    return rc;
-}
-
-
-/* Get
- *  retrieve an indexed checksum line
- *
- *  "idx" [ IN ] - zero-based index of checksum to access
- *
- *  "path" [ OUT ] and "size" [ IN ] - return buffer for file path
- *
- *  "crc32" [ OUT ] - return parameter for the checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtGet ( const KCRC32SumFmt *self, uint32_t idx,
-    char *path, size_t size, uint32_t *crc32, bool *bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-    else if ( idx >= self -> count )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcId, rcNotFound );
-    else
-    {
-        uint32_t i;
-        const KCRC32SumEntry *entry = ( const KCRC32SumEntry* )
-            SLListHead ( & self -> entries );
-        for ( i = 0; entry != NULL && i < idx; ++ i )
-        {
-            entry = ( const KCRC32SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcId, rcNotFound );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcBuffer, rcNull );
-        else if ( crc32 == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-        else
-        {
-            /* copy everything out */
-            * crc32 = entry -> crc32;
-            if ( bin != NULL )
-                * bin = entry -> bin;
-
-            /* return success if buffer large enough */
-            if ( string_copy_measure ( path, size, entry -> path ) < size )
-                return 0;
-
-            rc = RC ( rcFS, rcFile, rcAccessing, rcBuffer, rcInsufficient );
-        }
-    }
-
-    if ( path != NULL && size != 0 )
-        path [ 0 ] = 0;
-
-    if ( crc32 != NULL )
-        * crc32 = 0;
-
-    if ( bin != NULL )
-        * bin = false;
-
-    return rc;
-}
-
-
-/* Find
- *  retrieve checksum line by path
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "crc32" [ OUT ] - return parameter for the checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtFind ( const KCRC32SumFmt *self,
-    const char *path, uint32_t *crc32, bool *bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcEmpty );
-    else
-    {
-        const KCRC32SumEntry *entry = ( const KCRC32SumEntry* )
-            SLListHead ( & self -> entries );
-        while ( entry != NULL )
-        {
-            if ( strcmp ( path, entry -> path ) == 0 )
-                break;
-
-            entry = ( const KCRC32SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcNotFound );
-        else if ( crc32 == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-        else
-        {
-            /* copy everything out */
-            *crc32 = entry -> crc32;
-            if ( bin != NULL )
-                * bin = entry -> bin;
-
-            return 0;
-        }
-    }
-
-    if ( crc32 != NULL )
-        * crc32 = 0;
-
-    if ( bin != NULL )
-        * bin = false;
-
-    return rc;
-}
-
-
-/* Delete
- *  remove an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  returns rcNotFound if not present
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtDelete ( KCRC32SumFmt *self, const char *path )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcEmpty );
-    else
-    {
-        KCRC32SumEntry *entry = ( KCRC32SumEntry* )
-            SLListHead ( & self -> entries );
-        while ( entry != NULL )
-        {
-            if ( strcmp ( path, entry -> path ) == 0 )
-                break;
-
-            entry = ( KCRC32SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcNotFound );
-        else
-        {
-            /* pop entry from list */
-            SLListUnlink ( & self -> entries, & entry -> n );
-
-            /* delete entry */
-            KCRC32SumEntryWhack ( & entry -> n, NULL );
-
-            /* mark the modification */
-            self -> dirty = true;
-            assert ( self -> count > 0 );
-            -- self -> count;
-
-            return 0;
-        }
-    }
-
-    return rc;
-}
-
-
-/* Update
- *  add a checksum line to file or update an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "crc32" [ IN ] - calculated checksum
- *
- *  "bin" [ IN ] - true if checksum was calculated on all bytes
- *  in file, false if fopen mode used to read file was text.
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtUpdate ( KCRC32SumFmt *self, const char *path, uint32_t crc32, bool bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else
-    {
-        /* create an entry */
-        KCRC32SumEntry *entry;
-        rc = KCRC32SumEntryMake ( & entry, path, crc32, bin );
-        if ( rc == 0 )
-        {
-            /* scan for existing entry */
-            KCRC32SumEntry *exist = ( KCRC32SumEntry* )
-                SLListHead ( & self -> entries );
-            while ( exist != NULL )
-            {
-                if ( strcmp ( exist -> path, entry -> path ) == 0 )
-                    break;
-                exist = ( KCRC32SumEntry* )
-                    SLNodeNext ( & exist -> n );
-            }
-
-            /* if new entry, insert */
-            if ( exist == NULL )
-            {
-                SLListPushTail ( & self -> entries, & entry -> n );
-                self -> dirty = true;
-                ++ self -> count;
-            }
-
-            /* if existing, perform update */
-            else
-            {
-                if ( exist -> crc32 != entry -> crc32 || exist -> bin != entry -> bin )
-                {
-                    exist -> crc32 = entry -> crc32;
-                    exist -> bin = entry -> bin;
-                    self -> dirty = true;
-                }
-                KCRC32SumEntryWhack ( & entry -> n, NULL );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Rename
- * Rename the checksum line to reflect a file name change but no content change.
- *
- *  "newpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's new name
- *
- *  "oldpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's old name
- *
- */
-LIB_EXPORT rc_t CC KCRC32SumFmtRename ( KCRC32SumFmt *self, const char *oldpath, const char *newpath )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcSelf, rcNull );
-    else if ( newpath == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( newpath [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else if ( oldpath == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( oldpath [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else
-    {
-        bool bin;
-        uint32_t crc32;
-
-        rc = KCRC32SumFmtFind ( self, oldpath, & crc32, & bin );
-        if ( rc == 0 )
-            rc = KCRC32SumFmtUpdate ( self, newpath, crc32, bin );
-        if ( rc == 0 )
-            rc = KCRC32SumFmtDelete ( self, oldpath );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * CRC32 KFile extensions
- */
-typedef enum KCRC32FileUnionType
-{
-    KCRC32FileTypeRead,
-    KCRC32FileTypeWrite
-} KCRC32FileUnionType;
-
-struct KCRC32File
-{
-    KFile dad;
-
-    /* this is position of next byte to read or write
-       relative to the CRC not actual read/write */
-    uint64_t position;
-    KFile *file;
-    KCRC32SumFmt *fmt;
-    uint32_t crc32;
-    KCRC32FileUnionType type;
-    union
-    {
-        struct
-        {
-            rc_t rc;
-            uint32_t crc32;
-            bool eof;
-        } rd;
-
-        struct
-        {
-            /* maximum position written to "file" */
-            uint64_t max_position;
-
-            /* saved information for a transaction */
-            uint64_t tposition;
-            uint32_t crc32;
-
-            /* is transaction open */
-            bool topen;
-
-            /* path to file for crc32 fmt */
-            char path [ 1 ];
-        } wr;
-
-    } u;
-};
-
-/* Whack
- */
-static
-rc_t CC KCRC32FileWhackRead ( KCRC32File *self )
-{
-    rc_t rc;
-
-    atomic32_set ( & self -> dad . refcount, 1 );
-
-    rc = KFileRelease ( self -> file );
-    if ( rc == 0 )
-        free ( self );
-
-    return rc;
-}
-
-static
-rc_t CC KCRC32FileWhackWrite ( KCRC32File *self )
-{
-    rc_t rc;
-
-    atomic32_set ( & self -> dad . refcount, 1 );
-
-    /* if destination file has been written farther
-       than our concept of eof, truncate */
-    if ( self -> u . wr . max_position > self -> position )
-    {
-        rc = KFileSetSize ( self -> file, self -> position );
-        if ( rc != 0 )
-            return rc;
-        self -> u . wr . max_position = self -> position;
-    }
-
-    rc = KFileRelease ( self -> file );
-    if ( rc == 0 )
-    {
-        KCRC32SumFmtUpdate ( self -> fmt, self -> u . wr . path, self -> crc32, true );
-        KCRC32SumFmtRelease ( self -> fmt );
-        free ( self );
-    }
-
-    return rc;
-}
-
-static const char CRCTAG [8] = "CRC32CTX";
-static const char ENDIANTAG [4] =
-{ 
-    '0' + (char)((__BYTE_ORDER/1000)%10),
-    '0' + (char)((__BYTE_ORDER/100)%10),
-    '0' + (char)((__BYTE_ORDER/10)%10),
-    '0' + (char)((__BYTE_ORDER/1)%10)
-};
-static const char ENDIANSWAPTAG [4] =
-{ 
-    '0' + (char)((__BYTE_ORDER/1)%10),
-    '0' + (char)((__BYTE_ORDER/10)%10),
-    '0' + (char)((__BYTE_ORDER/100)%10),
-    '0' + (char)((__BYTE_ORDER/1000)%10)
-};
-
-static
-rc_t CC KCRC32FileWrite ( KCRC32File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ );
-
-static
-rc_t CC KCRC32FileWhackAppend ( KCRC32File *self )
-{
-    rc_t rc;
-
-    /* if the file is empty, just whack it */
-    if ( self -> position == 0 )
-        return KCRC32FileWhackWrite ( self );
-
-    /* begin transaction will save current state */
-    rc = KCRC32FileBeginTransaction ( self );
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-
-        /* create a closing tag with current checksum */
-        uint8_t closer [ sizeof CRCTAG + sizeof ENDIANTAG + sizeof self -> crc32 ];
-        memcpy ( closer, CRCTAG, sizeof CRCTAG );
-        memcpy ( & closer [ sizeof CRCTAG ], ENDIANTAG, sizeof ENDIANTAG );
-        memcpy ( & closer [ sizeof CRCTAG + sizeof ENDIANTAG ], & self -> crc32, sizeof self -> crc32 );
-            
-        /* append this to the file */
-        rc = KCRC32FileWrite ( self, self -> position, closer, sizeof closer, & num_writ );
-        if ( rc == 0 )
-        {
-            /* test transfer */
-            if ( num_writ != sizeof closer )
-                rc = RC ( rcFS, rcFile, rcDestroying, rcTransfer, rcIncomplete );
-            else
-            {
-                /* complete operation */
-                rc = KCRC32FileWhackWrite ( self );
-                if ( rc == 0 )
-                    return rc;
-            }
-        }
-
-        /* restore entry state */
-        KCRC32FileRevert ( self );
-    }
-
-    /* bail on errors */
-    atomic32_set ( & self -> dad . refcount, 1 );
-    return rc;
-}
-
-
-/* GetSysFile
- */
-static
-struct KSysFile *CC KCRC32FileGetSysFile ( const KCRC32File *self, uint64_t *offset )
-{
-    if ( offset != NULL )
-        * offset = 0;
-    return NULL;
-}
-
-
-/* RandomAccess
- */
-static
-rc_t CC KCRC32FileRandomAccessRead ( const KCRC32File *self )
-{
-    return KFileRandomAccess ( self -> file );
-}
-
-static
-rc_t CC KCRC32FileRandomAccessWrite ( const KCRC32File *self )
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* Type
- */
-static
-uint32_t CC KCRC32FileType ( const KCRC32File *self )
-{
-    return KFileType ( self -> file );
-}
-
-
-/* Size
- */
-static
-rc_t CC KCRC32FileSize ( const KCRC32File *self, uint64_t *size )
-{
-    return KFileSize ( self -> file, size );
-}
-
-static
-rc_t CC KCRC32FileSizeAppend ( const KCRC32File *self, uint64_t *size )
-{
-    *size = self -> position;
-    return 0;
-}
-
-
-/* SetSize
- *  the read-only version should never be called, because
- *  the message dispatch checks for write enable
- *
- *  the writable version disallows all but a total reset
- *  and setting size to current size
- */
-static
-rc_t CC KCRC32FileSetSizeRead ( KCRC32File *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-static
-rc_t CC KCRC32FileSetSizeWrite ( KCRC32File *self, uint64_t size )
-{
-    rc_t rc;
-
-    /* allow a noop */
-    if ( size == self -> position )
-        return 0;
-
-    /* disallow if not a reset */
-    if ( size != 0 )
-        return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-
-    /* ensure we're not in a transaction */
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcUpdating, rcFile, rcBusy );
-
-    /* go ahead and try to truncate destination */
-    rc = KFileSetSize ( self -> file, 0 );
-    if ( rc == 0 )
-    {
-        /* reset our internal state */
-        self -> position = self -> u . wr . max_position = 0;
-        self -> crc32 = 0;
-    }
-
-    return rc;
-}
-
-
-/* Finish
- *  returns the results of crc comparison
- */
-static
-rc_t KCRC32FileFinish ( KCRC32File *self )
-{
-    if ( ! self -> u . rd . eof )
-    {
-        if ( self -> crc32 != self -> u. rd . crc32 )
-            self -> u . rd . rc = RC ( rcFS, rcFile, rcReading, rcFile, rcCorrupt );
-        self -> u . rd . eof = true;
-    }
-
-    return self -> u . rd . rc;
-}
-
-
-/* Seek
- *  used to scan ahead in a read-only file
- *  "self" is modifiable, but file is read-only
- */
-static
-rc_t KCRC32FileSeek ( KCRC32File *self, uint64_t pos )
-{
-    rc_t rc;
-    size_t num_read;
-    uint8_t buff [ 32 * 1024 ];
-
-    /* should never be called by writable file */
-    assert ( ! self -> dad . write_enabled );
-
-    /* seek to "pos" */
-    for ( rc = 0; self -> position < pos; self -> position += num_read )
-    {
-        /* maximum to read in this buffer */
-        size_t to_read = sizeof buff;
-        if ( self -> position + sizeof buff > pos )
-            to_read = ( size_t ) ( pos - self -> position );
-
-        /* read bytes */
-        rc = KFileRead ( self -> file, self -> position, buff, to_read, & num_read );
-        if ( rc != 0 )
-            break;
-
-        /* detect EOF */
-        if ( num_read == 0 )
-        {
-            switch (self->type)
-            {
-            case KCRC32FileTypeRead:
-                rc = KCRC32FileFinish ( self );
-                break;
-            case KCRC32FileTypeWrite:
-                if ( self -> fmt != NULL)
-                {
-                    KCRC32SumFmtUpdate ( self -> fmt, self -> u . wr . path, self -> crc32, true );
-                    KCRC32SumFmtRelease ( self -> fmt );
-                    self -> fmt = NULL;
-                }
-                break;
-            }
-            break;
-        }
-        
-        /* append bytes */
-        self -> crc32 = CRC32 ( self -> crc32, buff, num_read );
-    }
-    
-    return rc;
-}
-
-/* Read
- *  read-only version allows random access reads
- */
-static
-rc_t CC KCRC32FileRead ( const KCRC32File *cself,
-    uint64_t pos, void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    size_t total = 0;
-    uint64_t end = pos + bsize;
-    KCRC32File *self = ( KCRC32File* ) cself;
-
-    * num_read = 0;
-
-    /* no buffer means no bytes */
-    if ( bsize == 0 )
-        return 0;
-
-    /* test for starting a read before the current marker
-       meaning that it does not figure in to the checksum */
-    if ( self -> position > pos )
-    {
-        /* test for entire buffer being before marker */
-        if ( end <= self -> position )
-            return KFileRead ( self -> file, pos, buffer, bsize, num_read );
-
-        /* perform a partial read without affecting checksum */
-        rc = KFileRead ( self -> file, pos, buffer, ( size_t )( self -> position - pos ), num_read );
-        if ( rc != 0 )
-            return rc;
-
-        /* adjust as if a new read request, remembering number read so far */
-        pos += * num_read;
-        total = * num_read;
-        buffer = & ( ( uint8_t* ) buffer ) [ * num_read ];
-
-        /* in case num_read != all bytes up to marker */
-        if ( pos != self -> position )
-            return 0;
-    }
-
-    /* test for hole between current marker and desired start */
-    else if ( self -> position < pos )
-    {
-        /* scan ahead, discarding */
-        rc = KCRC32FileSeek ( self, pos );
-        if ( rc != 0 || self -> position < pos )
-            return rc;
-    }
-
-    /* no hole - and still some space in buffer */
-    assert ( self -> position == pos );
-    assert ( pos < end );
-
-    /* read bytes */
-    rc = KFileRead ( self -> file, pos, buffer, ( size_t ) ( end - pos ), num_read );
-    if ( rc == 0 )
-    {
-        /* detect bytes read */
-        if ( * num_read != 0 )
-        {
-            /* accumulate into checksum */
-            self -> position += * num_read;
-            self -> crc32 = CRC32 ( self -> crc32, buffer, * num_read );
-
-            /* add in any previously read bytes and return success */
-            * num_read += total;
-            return 0;
-        }
-
-        switch (self->type)
-        {
-        case KCRC32FileTypeRead:
-            /* EOF - get results */
-            rc = KCRC32FileFinish ( self );
-            break;
-        case KCRC32FileTypeWrite:
-            if ( self -> fmt != NULL)
-            {
-                KCRC32SumFmtUpdate ( self -> fmt, self -> u . wr . path, self -> crc32, true );
-                KCRC32SumFmtRelease ( self -> fmt );
-                self -> fmt = NULL;
-            }
-            break;
-        }
-
-    }
-
-    /* always return 0 if some bytes were read */
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-    
-    return rc;
-}
-
-/* Read
- *  writeable version isn't keeping track of checksum on read,
- *  so just forward to destination file
- */
-static
-rc_t CC KCRC32FileFwdRead ( const KCRC32File *self,
-    uint64_t pos, void *buffer, size_t bsize, size_t *num_read )
-{
-    return KFileRead ( self -> file, pos, buffer, bsize, num_read );
-}
-
-
-/* Write
- */
-static
-rc_t CC KCRC32FileBadWrite ( KCRC32File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    * num_writ = 0;
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcBuffer, rcNull );
-
-    return RC ( rcFS, rcFile, rcReading, rcFile, rcReadonly );
-}
-
-static
-rc_t CC KCRC32FileWrite ( KCRC32File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-
-    if ( pos != self -> position )
-        return RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-
-    rc = KFileWrite ( self -> file, pos, buffer, size, num_writ );
-    if ( rc == 0 && * num_writ != 0 )
-    {
-        self -> position += * num_writ;
-        if ( self -> position > self -> u . wr . max_position )
-            self -> u . wr . max_position = self -> position;
-        self -> crc32 = CRC32 ( self -> crc32, buffer, * num_writ );
-    }
-
-    return rc;
-}
-
-
-/* ToKFile
- *  a CRC file is a subclass of KFile
- *  this is an explicit cast operator
- */
-LIB_EXPORT KFile* CC KCRC32FileToKFile ( KCRC32File *self )
-{
-    if ( self != NULL )
-        return & self -> dad;
-    return NULL;
-}
-
-LIB_EXPORT const KFile* CC KCRC32FileToKFileConst ( const KCRC32File *self )
-{
-    if ( self != NULL )
-        return & self -> dad;
-    return NULL;
-}
-
-
-/* BeginTransaction
- *  preserve current state and file marker
- *  in preparation for rollback
- */
-LIB_EXPORT rc_t CC KCRC32FileBeginTransaction ( KCRC32File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcFreezing, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcFreezing, rcFile, rcReadonly );
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcFreezing, rcFile, rcBusy );
-
-    self -> u . wr . topen = true;
-    self -> u . wr . tposition = self -> position;
-    self -> u . wr . crc32 = self -> crc32;
-
-    return 0;
-}
-
-
-/* Commit
- *  accept current state as correct
- */
-LIB_EXPORT rc_t CC KCRC32FileCommit ( KCRC32File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcCommitting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcCommitting, rcFile, rcReadonly );
-
-    self -> u . wr . topen = false;
-
-    return 0;
-}
-
-
-/* Revert
- *  revert state to previous transaction boundary conditions
- */
-LIB_EXPORT rc_t CC KCRC32FileRevert ( KCRC32File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReverting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcReverting, rcFile, rcReadonly );
-    if ( ! self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcReverting, rcFile, rcInconsistent );
-
-    self -> position = self -> u . wr . tposition;
-    self -> crc32 = self -> u . wr . crc32;
-    self -> u . wr . topen = false;
-
-    return 0;
-}
-
-/* Reset
- *  reset state to that of an empty file
- *  aborts any open transaction
- */
-LIB_EXPORT rc_t CC KCRC32FileReset ( KCRC32File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcResetting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcResetting, rcFile, rcReadonly );
-#if 1
-    self -> u . wr . topen = false;
-#else
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcResetting, rcFile, rcBusy );
-#endif
-
-    self -> position = 0;
-    self -> crc32 = 0;
-
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * CRC32File factories
- */
-
-
-/* MakeCRC32Read
- *  creates an adapter to check CRC32 checksum for a source file
- *
- *  "f" [ OUT ] - return parameter for file with crc32 check
- *
- *  "src" [ IN ] - source file with read permission
- *
- *  "crc32" [ IN ] - checksum to match
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-static KFile_vt_v1 KCRC32FileRead_vt =
-{
-    1, 1,
-
-    /* 1.0 */
-    KCRC32FileWhackRead,
-    KCRC32FileGetSysFile,
-    KCRC32FileRandomAccessRead,
-    KCRC32FileSize,
-    KCRC32FileSetSizeRead,
-    KCRC32FileRead,
-    KCRC32FileBadWrite,
-
-    /* 1.1 */
-    KCRC32FileType
-};
-
-LIB_EXPORT rc_t CC KFileMakeCRC32Read ( const KFile **fp,
-    const KFile *src, uint32_t crc32 )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( src == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! src -> read_enabled )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KCRC32File *f = malloc ( sizeof * f - sizeof f -> u + sizeof f -> u . rd );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-				     ( const KFile_vt* ) & KCRC32FileRead_vt, "KCRC32File", "no-name", true, false );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    f -> crc32 = 0;
-                    f -> file = ( KFile* ) src;
-                    f -> fmt = NULL;
-                    f -> type = KCRC32FileTypeRead;
-                    f -> u . rd . rc = 0;
-                    f -> u . rd . eof = 0;
-                    f -> u . rd . crc32 = crc32;
-
-                    * fp = & f -> dad;
-                    return 0;
-                }
-            }
-
-            free ( f );
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* MakeWrite
- *  creates an adapter to create checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with crc32 check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "fmt" [ IN ] - checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "fmt".
- *
- *  "path" [ IN ] - checksum output file path, used to
- *  create standard crc32sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-static KFile_vt_v1 sKCRC32FileWrite_vt =
-{
-    1, 0,
-
-    KCRC32FileWhackWrite,
-    KCRC32FileGetSysFile,
-    KCRC32FileRandomAccessWrite,
-    KCRC32FileSize,
-    KCRC32FileSetSizeWrite,
-    KCRC32FileFwdRead,
-    KCRC32FileWrite
-};
-
-LIB_EXPORT rc_t CC KCRC32FileMakeWrite ( KCRC32File **fp,
-    KFile *out, KCRC32SumFmt *fmt, const char *path )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else if ( fmt == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( fmt -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            KCRC32File *f = malloc ( sizeof * f - sizeof f -> u +
-                sizeof f -> u . wr + strlen ( path ) );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKCRC32FileWrite_vt, "KCRC32File", path, out -> read_enabled, true );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    f -> crc32 = 0;
-                    f -> file = out;
-                    f -> fmt = fmt;
-                    f -> type = KCRC32FileTypeWrite;
-
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    strcpy ( f -> u . wr . path, path );
-
-                    rc = KFileSize ( out, & f -> u . wr . max_position );
-                    if (rc)
-                    {
-                        if (GetRCState (rc) == rcUnsupported)
-                        {
-                            f -> u . wr . max_position  = 0;
-                            rc = 0;
-                        }
-                    }    
-                    if ( rc == 0 )
-                        rc = KCRC32SumFmtAddRef ( fmt );
-                    if ( rc == 0 )
-                    {
-                        * fp = f;
-                        return 0;
-                    }
-                }
-
-                free ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-/* MakeAppend
- *  creates an adapter to create CRC32 checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with crc32 check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "fmt" [ IN ] - checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "fmt".
- *
- *  "path" [ IN ] - checksum output file path, used to
- *  create standard crc32sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from current EOF (minus the stored crc context)
- */
-static KFile_vt_v1 sKCRC32FileAppend_vt =
-{
-    1, 0,
-
-    KCRC32FileWhackAppend,
-    KCRC32FileGetSysFile,
-    KCRC32FileRandomAccessWrite,
-    KCRC32FileSizeAppend,
-    KCRC32FileSetSizeWrite,
-    KCRC32FileFwdRead,
-    KCRC32FileWrite
-};
-
-LIB_EXPORT rc_t CC KCRC32FileMakeAppend ( KCRC32File **fp, KFile *out, KCRC32SumFmt *fmt, const char *path )
-{
-    rc_t rc;
-    KLogLevel lvl = klogInt;
-    
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else if ( fmt == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( fmt -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            KCRC32File *f = malloc ( sizeof * f - sizeof f -> u +
-                sizeof f -> u . wr + strlen ( path ) );
-            if ( f == NULL )
-            {
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-                lvl = klogSys;
-            }
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKCRC32FileAppend_vt, "KCRC32File", path, out -> read_enabled, true );
-                if ( rc == 0 )
-                {
-                    f -> crc32 = 0;
-                    f -> file = out;
-                    f -> fmt = fmt;
-                    f -> type = KCRC32FileTypeWrite;
-
-                    rc = KCRC32SumFmtAddRef ( fmt );
-                    if ( rc != 0 )
-                    {
-                        free ( f );
-                        * fp = NULL;
-                        return rc;
-                    }
-
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    strcpy ( f -> u . wr . path, path );
-
-                    lvl = klogSys;
-                    rc = KFileSize ( out, & f -> position );
-                    if ( rc == 0 )
-                    {
-                        uint8_t buffer [ sizeof CRCTAG + sizeof ENDIANTAG + sizeof f -> crc32 ];
-
-                        /* an empty file is fine */
-                        if ( f -> position == 0 )
-                        {
-                            * fp = f;
-                            return 0;
-                        }
-
-                        /* set max */
-                        f -> u . wr . max_position = f -> position;
-
-                        /* a file without a trailing crc state is incorrect or corrupt */
-                        if ( f -> position < sizeof buffer )
-                        {
-                            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcIncorrect );
-                            lvl = klogErr;
-                        }
-                        else
-                        {
-                            /* try to read crc state */
-                            size_t num_read;
-                            rc = KFileRead ( out, f -> position - sizeof buffer, buffer, sizeof buffer, & num_read );
-                            if ( rc == 0 )
-                            {
-                                if ( num_read != sizeof buffer )
-                                    rc = RC ( rcFS, rcFile, rcConstructing, rcTransfer, rcIncomplete );
-                                else
-                                {
-                                    /* errors from here are usage errors */
-                                    lvl = klogErr;
-                                    
-                                    if ( memcmp ( buffer, CRCTAG, sizeof CRCTAG ) != 0 )
-                                        rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcIncorrect );
-                                    else
-                                    {
-                                        /* forget about the CRC state */
-                                        f -> position -= sizeof buffer;
-                                        memcpy ( & f -> crc32, & buffer [ sizeof CRCTAG + sizeof ENDIANTAG ], sizeof f -> crc32 );
-                                        
-                                        /* check for proper byte order */
-                                        if ( memcmp ( & buffer [ sizeof CRCTAG ], ENDIANTAG, sizeof ENDIANTAG ) == 0 )
-                                        {
-                                            * fp = f;
-                                            return 0;
-                                        }
-
-                                        /* probably swapped, but confirm */
-                                        if ( memcmp ( & buffer [ sizeof CRCTAG ], ENDIANSWAPTAG, sizeof ENDIANSWAPTAG ) == 0 )
-                                        {
-                                            f -> crc32 = bswap_32 ( f -> crc32 );
-                                            * fp = f;
-                                            return 0;
-                                        }
-                                        
-                                        /* garbage */
-                                        rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcCorrupt );
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    
-                    KCRC32SumFmtRelease ( fmt );
-                }
-                
-                free ( f );
-            }
-        }
-        
-        * fp = NULL;
-    }
-    
-    LOGERR ( lvl, rc, "append-mode CRC32 file" );
-    
-    return rc;
-}
-
-static KFile_vt_v1 sKCRC32FileReadCreate_vt =
-{
-    1, 1,
-
-    KCRC32FileWhackRead,
-    KCRC32FileGetSysFile,
-    KCRC32FileRandomAccessRead,
-    KCRC32FileSize,
-    KCRC32FileSetSizeRead,
-    KCRC32FileRead,
-    KCRC32FileBadWrite,
-
-    /* 1.1 */
-    KCRC32FileType
-};
-
-LIB_EXPORT rc_t CC KFileMakeNewCRC32Read ( const KFile **fp,
-    const KFile *in, KCRC32SumFmt *fmt, const char *path )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( in == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! in -> read_enabled )
-	    rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else if ( fmt == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( fmt -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            KCRC32File *f = malloc ( sizeof * f - sizeof f -> u +
-                sizeof f -> u . wr + strlen ( path ) );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKCRC32FileReadCreate_vt, "KCRC32File", path, in -> read_enabled, false );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    f -> crc32 = 0;
-                    f -> file = ( KFile* ) in;
-                    f -> fmt = fmt;
-                    f -> type = KCRC32FileTypeWrite;
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    strcpy ( f -> u . wr . path, path );
-#if 0
-                    /* KFileSize can't always be used */
-                    rc = KFileSize ( in, & f -> u . wr . max_position );
-#endif
-                    if ( rc == 0 )
-                        rc = KCRC32SumFmtAddRef ( fmt );
-                    if ( rc == 0 )
-                    {
-                        * fp = & f -> dad;
-                        return 0;
-                    }
-                }
-
-                free ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/dir_test.c b/libs/kfs/dir_test.c
deleted file mode 100644
index 9be919e..0000000
--- a/libs/kfs/dir_test.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/directory.h>
-#include <sysalloc.h>
-
-/* ======================================================================
- */
-const char *get_mode_string ( KCreateMode mode )
-{
-    switch (mode)
-    {
-    default:
-	return "BAD MODE";
-    case kcmOpen:
-	return "kcmOpen";
-    case kcmInit:
-	return "kcmInit";
-    case kcmCreate:
-	return "kcmCreate";
-    case kcmOpen|kcmParents:
-	return "kcmOpen|kcmParents";
-    case kcmInit|kcmParents:
-	return "kcmInit|kcmParents";
-    case kcmCreate|kcmParents:
-	return "kcmCreate|kcmParents";
-    }
-}
-
-/* end of file */
diff --git a/libs/kfs/directory.c b/libs/kfs/directory.c
deleted file mode 100644
index bf6d969..0000000
--- a/libs/kfs/directory.c
+++ /dev/null
@@ -1,1538 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <kfs/extern.h>
-#include <kfs/impl.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  a directory
- */
-
-static const char classname[] = "KDirectory";
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KDirectoryAddRef ( const KDirectory *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, classname ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDirectory, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Release
- *  discard reference to directory
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KDirectoryRelease ( const KDirectory *cself )
-{
-    KDirectory *self = ( KDirectory* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, classname ) )
-        {
-        case krefWhack:
-        {
-            rc_t rc;
-
-            switch ( self -> vt -> v1 . maj )
-            {
-            case 1:
-                rc = ( * self -> vt -> v1 . destroy ) ( self );
-                break;
-
-            default:
-                rc = RC ( rcFS, rcDirectory, rcReleasing, rcInterface, rcBadVersion );
-            }
-
-            if ( rc != 0 )
-                KRefcountInit ( & self -> refcount, 1, classname, "failed-release", "orphan" );
-            return rc;
-        }
-        case krefNegative:
-            return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* List
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "." will be
- *  interpreted as format string if arguments follow
- */
-LIB_EXPORT rc_t CC KDirectoryList ( const KDirectory *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-    void *data, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVList ( self, list, f, data, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVList ( const KDirectory *self, struct KNamelist **list,
-    bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ),
-    void *data, const char *path, va_list args )
-{
-    if ( list == NULL )
-        return RC ( rcFS, rcDirectory, rcListing, rcParam, rcNull );
-
-    * list = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcListing, rcSelf, rcNull );
-
-    if ( path == NULL || path [ 0 ] == 0 )
-        path = ".";
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . list_dir ) ( self, list, f, data, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcListing, rcInterface, rcBadVersion );
-}
-
-/* Visit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-LIB_EXPORT rc_t CC KDirectoryVisit ( const KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVVisit ( self, recurse, f, data, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVVisit ( const KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( const KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcVisiting, rcSelf, rcNull );
-    if ( f == NULL )
-        return RC ( rcFS, rcDirectory, rcVisiting, rcFunction, rcNull );
-
-    if ( path == NULL || path [ 0 ] == 0 )
-        path = ".";
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . visit ) ( self, recurse, f, data, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcVisiting, rcInterface, rcBadVersion );
-}
-
-/* VisitUpdate
- *  
- */
-LIB_EXPORT rc_t CC KDirectoryVisitUpdate ( KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVVisitUpdate ( self, recurse, f, data, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVVisitUpdate ( KDirectory *self, bool recurse,
-    rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ),
-    void *data, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcVisiting, rcSelf, rcNull );
-    if ( f == NULL )
-        return RC ( rcFS, rcDirectory, rcVisiting, rcFunction, rcNull );
-
-    if ( path == NULL || path [ 0 ] == 0 )
-        path = ".";
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcVisiting, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . visit_update )
-            ( self, recurse, f, data, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcVisiting, rcInterface, rcBadVersion );
-}
-
-/* PathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-LIB_EXPORT uint32_t CC KDirectoryPathType ( const KDirectory *self, const char *path, ... )
-{
-    uint32_t type;
-    va_list args;
-
-    va_start ( args, path );
-    type = KDirectoryVPathType ( self, path, args );
-    va_end ( args );
-
-    return type;
-}
-
-LIB_EXPORT uint32_t CC KDirectoryVPathType ( const KDirectory *self, const char *path, va_list args )
-{
-    if ( self == NULL || path == NULL || path [ 0 ] == 0 )
-        return kptBadPath;
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . path_type ) ( self, path, args );
-    }
-
-    return kptBadPath;
-}
-
-/* ResolvePath
- *  resolves path to an absolute or directory-relative path
- *
- *  "absolute" [ IN ] - if non-zero, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *  the resolved path will be directory relative
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target path. NB - need not exist.
- */
-LIB_EXPORT rc_t CC KDirectoryResolvePath ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVResolvePath ( self, absolute,
-        resolved, rsize, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVResolvePath ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcResolving, rcSelf, rcNull );
-
-    /* allow NULL buffers of 0 size */
-    if ( resolved == NULL && rsize != 0 )
-        return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . resolve_path )
-            ( self, absolute, resolved, rsize, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcResolving, rcInterface, rcBadVersion );
-}
-
-/* ResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "absolute" [ IN ] - if non-zero, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *  the resolved path will be directory relative
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- */
-LIB_EXPORT rc_t CC KDirectoryResolveAlias ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *alias, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, alias );
-    rc = KDirectoryVResolveAlias ( self, absolute,
-        resolved, rsize, alias, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVResolveAlias ( const KDirectory *self, bool absolute,
-    char *resolved, size_t rsize, const char *alias, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcResolving, rcSelf, rcNull );
-
-    /* allow NULL buffers of 0 size */
-    if ( resolved == NULL && rsize != 0 )
-        return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcNull );
-
-    if ( alias == NULL )
-        return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcNull );
-    if ( alias [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . resolve_alias )
-            ( self, absolute, resolved, rsize, alias, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcResolving, rcInterface, rcBadVersion );
-}
-
-/* Rename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-LIB_EXPORT rc_t CC KDirectoryRename ( KDirectory *self, bool force, const char *from, const char *to )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcRenaming, rcSelf, rcNull );
-
-    if ( from == NULL || to == NULL )
-        return RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcNull );
-    if ( from [ 0 ] == 0 || to [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcRenaming, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . rename ) ( self, force, from, to );
-    }
-
-    return RC ( rcFS, rcDirectory, rcRenaming, rcInterface, rcBadVersion );
-}
-
-/* Remove
- *  remove an accessible object from its directory
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC KDirectoryRemove ( KDirectory *self, bool force, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVRemove ( self, force, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVRemove ( KDirectory *self, bool force, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . remove ) ( self, force, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcRemoving, rcInterface, rcBadVersion );
-}
-
-/* ClearDir
- *  remove all directory contents
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-LIB_EXPORT rc_t CC KDirectoryClearDir ( KDirectory *self, bool force, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVClearDir ( self, force, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVClearDir ( KDirectory *self, bool force, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . clear_dir ) ( self, force, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcRemoving, rcInterface, rcBadVersion );
-}
-
-/* Access
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC KDirectoryAccess ( const KDirectory *self,
-    uint32_t *access, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVAccess ( self, access, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVAccess ( const KDirectory *self,
-    uint32_t *access, const char *path, va_list args )
-{
-    if ( access == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * access = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . access ) ( self, access, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* SetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC KDirectorySetAccess ( KDirectory *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVSetAccess ( self, recurse,
-        access, mask, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVSetAccess ( KDirectory *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        /* TBD - perhaps limit bits to lower 9 */
-        return ( * self -> vt -> v1 . set_access )
-            ( self, recurse, access, mask, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcUpdating, rcInterface, rcBadVersion );
-}
-
-/* Date
- *  get date/time to object
- *
- *  "date" [ OUT ] - return parameter
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC KDirectoryDate ( const KDirectory *self,
-    KTime_t *date, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVDate ( self, date, path, args );
-    va_end ( args );
-
-    return rc;
-}
-LIB_EXPORT rc_t CC KDirectoryVDate ( const KDirectory *self,
-    KTime_t *date, const char *path, va_list args )
-{
-    if ( date == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * date = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        if ( self -> vt -> v1 . min >= 1 )
-            return ( * self -> vt -> v1 . date ) ( self, date, path, args );
-        break;
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* SetDate
- *  set date to object
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- *
- *  "date" [ IN ] - new time and date for the object
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC KDirectorySetDate ( KDirectory *self, bool recurse,
-    KTime_t date, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVSetDate ( self, recurse,
-			      date, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVSetDate ( KDirectory *self, bool recurse,
-    KTime_t date, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        /* TBD - perhaps limit bits to lower 9 */
-        if ( self -> vt -> v1 . min >= 1 )
-            return ( * self -> vt -> v1 . setdate ) ( self, recurse, date, path, args );
-        break;
-    }
-
-    return RC ( rcFS, rcDirectory, rcUpdating, rcInterface, rcBadVersion );
-}
-
-
-/* CreateAlias
- *  creates a path alias according to create mode
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- */
-LIB_EXPORT rc_t CC KDirectoryCreateAlias ( KDirectory *self,
-    uint32_t access, KCreateMode mode,
-    const char *targ, const char *alias )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcSelf, rcNull );
-
-    if ( targ == NULL || alias == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNull );
-    if ( targ [ 0 ] == 0 || alias [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . create_alias )
-            ( self, access, mode, targ, alias );
-    }
-
-    return RC ( rcFS, rcDirectory, rcUpdating, rcInterface, rcBadVersion );
-}
-
-/* OpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryOpenFileRead ( const KDirectory *self,
-    struct KFile const **f, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenFileRead ( self, f, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVOpenFileRead ( const KDirectory *self,
-    struct KFile const **f, const char *path, va_list args )
-{
-    if ( f == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcFile, rcNull );
-
-    * f = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . open_file_read ) ( self, f, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcOpening, rcInterface, rcBadVersion );
-}
-
-/* OpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryOpenFileWrite ( KDirectory *self,
-    struct KFile **f, bool update, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenFileWrite ( self, f, update, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVOpenFileWrite ( KDirectory *self,
-    struct KFile **f, bool update, const char *path, va_list args )
-{
-    if ( f == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcFile, rcNull );
-
-    * f = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcInvalid );
-
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . open_file_write )
-            ( self, f, update, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcOpening, rcInterface, rcBadVersion );
-}
-
-/* CreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryCreateFile ( KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVCreateFile ( self, f, update,
-        access, mode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVCreateFile ( KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    if ( f == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcFile, rcNull );
-
-    * f = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . create_file )
-            ( self, f, update, access, mode, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcCreating, rcInterface, rcBadVersion );
-}
-
-/* FileLocator
- *  returns locator in bytes of target file
- *
- *  "locator" [ OUT ] - return parameter for file locator
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryFileLocator ( const KDirectory *self,
-    uint64_t *locator, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVFileLocator ( self, locator, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVFileLocator ( const KDirectory *self,
-    uint64_t *locator, const char *path, va_list args )
-{
-    if ( locator == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * locator = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        if ( self -> vt -> v1 . min >= 2 )
-            return ( * self -> vt -> v1 . file_locator ) ( self, locator, path, args );
-        break;
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* FileSize
- *  returns size in bytes of target file
- *
- *  "size" [ OUT ] - return parameter for file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryFileSize ( const KDirectory *self,
-    uint64_t *size, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVFileSize ( self, size, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVFileSize ( const KDirectory *self,
-    uint64_t *size, const char *path, va_list args )
-{
-    if ( size == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * size = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . file_size ) ( self, size, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* FilePhysicalSize
- *  returns size in bytes of target file
- *
- *  "size" [ OUT ] - return parameter for file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryFilePhysicalSize ( const KDirectory *self,
-    uint64_t *size, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVFilePhysicalSize ( self, size, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVFilePhysicalSize ( const KDirectory *self,
-    uint64_t *size, const char *path, va_list args )
-{
-    if ( size == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * size = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        if ( self -> vt -> v1 . min >= 3 )
-            return ( * self -> vt -> v1 . file_phys_size ) ( self, size, path, args );
-        break;
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* SetFileSize
- *  sets size in bytes of target file
- *
- *  "size" [ IN ] - new file size
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectorySetFileSize ( KDirectory *self,
-    uint64_t size, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVSetFileSize ( self, size, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVSetFileSize ( KDirectory *self,
-    uint64_t size, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . set_size ) ( self, size, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* FileContiguous
- *  returns true if the file is "contiguous".  Chunked or sparse files are not
- *  contiguous while most data files are.  Virtual generated files would likely
- *  not be contiguous.  
- *
- *  "contiguous" [ OUT ] - return parameter for file contiguous
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryFileContiguous ( const KDirectory *self,
-    bool *contiguous, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVFileContiguous ( self, contiguous, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVFileContiguous ( const KDirectory *self,
-    bool *contiguous, const char *path, va_list args )
-{
-    if ( contiguous == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * contiguous = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        if ( self -> vt -> v1 . min >= 3 )
-            return ( * self -> vt -> v1 . file_contiguous ) ( self, contiguous, path, args );
-        break;
-    }
-
-    return RC ( rcFS, rcDirectory, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* OpenDirRead
- * KDirectoryOpenDirUpdate
- *  opens a sub-directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-LIB_EXPORT rc_t CC KDirectoryOpenDirRead ( const KDirectory *self,
-    const KDirectory **sub, bool chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenDirRead ( self, sub, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVOpenDirRead ( const KDirectory *self,
-    const KDirectory **sub, bool chroot, const char *path, va_list args )
-{
-    if ( sub == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcNull );
-
-    * sub = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcSelf, rcNull );
-
-    if ( path == NULL || path [ 0 ] == 0 )
-        path = ".";
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . open_dir_read )
-            ( self, sub, chroot, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcOpening, rcInterface, rcBadVersion );
-}
-
-LIB_EXPORT rc_t CC KDirectoryOpenDirUpdate ( KDirectory *self,
-    KDirectory **sub, bool chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenDirUpdate ( self, sub, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVOpenDirUpdate ( KDirectory *self,
-    KDirectory **sub, bool chroot, const char *path, va_list args )
-{
-    if ( sub == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcNull );
-
-    * sub = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcOpening, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcReadonly );
-
-    if ( path == NULL || path [ 0 ] == 0 )
-        path = ".";
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . open_dir_update )
-            ( self, sub, chroot, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcOpening, rcInterface, rcBadVersion );
-}
-
-/* CreateDir
- *  create a sub-directory
- *
- *  "access" [ IN ] - standard Unix directory mode, e.g.0775
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-LIB_EXPORT rc_t CC KDirectoryCreateDir ( KDirectory *self,
-    uint32_t access, KCreateMode mode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVCreateDir ( self, access, mode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryVCreateDir ( KDirectory *self,
-    uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcSelf, rcNull );
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcReadonly );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . create_dir ) ( self, access, mode, path, args );
-    }
-
-    return RC ( rcFS, rcDirectory, rcCreating, rcInterface, rcBadVersion );
-}
-
-/* Init
- *  initialize a newly allocated directory object
- */
-LIB_EXPORT rc_t CC KDirectoryInit ( KDirectory *self, const KDirectory_vt *vt,
-    const char * class_name, const char * path, bool update )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDirectory, rcConstructing, rcSelf, rcNull );
-    if ( vt == NULL )
-        return RC ( rcFS, rcDirectory, rcConstructing, rcInterface, rcNull );
-    switch ( vt -> v1 . maj )
-    {
-    case 0:
-        return RC ( rcFS, rcDirectory, rcConstructing, rcInterface, rcInvalid );
-    case 1:
-        switch ( vt -> v1 . min )
-        {
-            /* ADD NEW MINOR VERSION CASES HERE */
-        case 3:
-#if _DEBUGGING
-            if ( vt -> v1 . file_phys_size == NULL )
-                return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            /* no break */
-        case 2:
-#if _DEBUGGING
-            if ( vt -> v1 . file_locator == NULL )
-                return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            /* no break */
-        case 1:
-#if _DEBUGGING
-            if ( vt -> v1 . get_sysdir == NULL      ||
-                 vt -> v1 . setdate == NULL         ||
-                 vt -> v1 . date == NULL )
-                return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            /* no break */
-        case 0:
-#if _DEBUGGING
-            /* vt -> v1 . destroy_file CAN be NULL */
-            if ( vt -> v1 . create_dir == NULL      ||
-                 vt -> v1 . open_dir_update == NULL ||
-                 vt -> v1 . open_dir_read == NULL   ||
-                 vt -> v1 . set_size == NULL        ||
-                 vt -> v1 . file_size == NULL       ||
-                 vt -> v1 . create_file == NULL     ||
-                 vt -> v1 . open_file_write == NULL ||
-                 vt -> v1 . open_file_read == NULL  ||
-                 vt -> v1 . create_alias == NULL    ||
-                 vt -> v1 . set_access == NULL      ||
-                 vt -> v1 . access == NULL          ||
-                 vt -> v1 . clear_dir == NULL       ||
-                 vt -> v1 . remove == NULL          ||
-                 vt -> v1 . rename == NULL          ||
-                 vt -> v1 . resolve_alias == NULL   ||
-                 vt -> v1 . resolve_path == NULL    ||
-                 vt -> v1 . path_type == NULL       ||
-                 vt -> v1 . visit_update == NULL    ||
-                 vt -> v1 . visit == NULL           ||
-                 vt -> v1 . list_dir == NULL        ||
-                 vt -> v1 . destroy == NULL )
-                return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            break;
-        default:
-            return RC ( rcFS, rcDirectory, rcConstructing, rcInterface, rcBadVersion );
-        }
-        break;
-    default:
-        return RC ( rcFS, rcDirectory, rcConstructing, rcInterface, rcBadVersion );
-    }
-
-    self -> vt = vt;
-    self -> read_only = ( uint8_t ) ( update == 0 );
-
-
-    KRefcountInit ( &self->refcount, 1, class_name, "init", path );
-
-    return 0;
-}
-
-/* DestroyFile
- *  does whatever is necessary with an unreferenced file
- */
-LIB_EXPORT rc_t CC KDirectoryDestroyFile ( const KDirectory *self, KFile *f )
-{
-    const KDirectory_vt *vt = self -> vt;
-    switch ( vt -> v1 . maj )
-    {
-    case 1:
-        if ( vt -> v1 . destroy_file != NULL )
-            return ( * vt -> v1 . destroy_file ) ( ( KDirectory* ) self, f );
-        return KFileDestroy ( f );
-    }
-
-    return RC ( rcFS, rcDirectory, rcDestroying, rcInterface, rcBadVersion );
-}
-
-/* GetSysDir
- *  returns an underlying system file object
- */
-LIB_EXPORT struct KSysDir* CC KDirectoryGetSysDir ( const KDirectory *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            if ( self -> vt -> v1 . min > 0 )
-                return ( * self -> vt -> v1 . get_sysdir ) ( self );
-            break;
-        }
-    }
-    return NULL;
-}
-
-
-static rc_t copy_loop( const KFile *src, KFile *dst, size_t bsize )
-{
-    rc_t rc = 0;
-    uint64_t pos = 0;
-    size_t num_read = 1;
-
-    char * buffer = malloc( bsize );
-    if ( buffer == NULL )
-        return RC( rcFS, rcDirectory, rcCopying, rcMemory, rcExhausted );
-
-    while ( rc == 0 && num_read > 0 )
-    {
-        rc = KFileRead ( src, pos, buffer, bsize, &num_read );
-        if ( rc == 0 && num_read > 0 )
-        {
-            size_t num_writ;
-            rc = KFileWrite ( dst, pos, buffer, num_read, &num_writ );
-            pos += num_read;
-        }
-    }
-    free( buffer );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryCopyPath ( const KDirectory *src_dir,
-    KDirectory *dst_dir, const char *src_path, const char * dst_path )
-{
-    rc_t rc;
-    struct KFile const *f_src;
-
-    if ( src_dir == NULL || dst_dir == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcSelf, rcNull );
-    if ( src_path == NULL || dst_path == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcParam, rcNull );
-
-    rc = KDirectoryOpenFileRead ( src_dir, &f_src, "%s", src_path );
-    if ( rc == 0 )
-    {
-        uint32_t pt = KDirectoryPathType ( dst_dir, "%s", dst_path );
-        switch( pt )
-        {
-            case kptFile : ; /* intentional fall through! */
-            case kptDir  : rc = KDirectoryRemove ( dst_dir, true, "%s", dst_path ); break;
-        }
-        if ( rc == 0 )
-        {
-            struct KFile *f_dst;
-            uint32_t access = 0664;
-            rc = KDirectoryCreateFile ( dst_dir, &f_dst, false, access, kcmCreate, "%s", dst_path );
-            if ( rc == 0 )
-            {
-                rc = copy_loop( f_src, f_dst, 1024 * 16 );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t build_obj_path( char **s, const char *path, const char * objname )
-{
-    rc_t rc;
-    size_t lp = string_size( path );
-    size_t l = lp + string_size( objname ) + 2;
-    *s = malloc( l );
-    if ( *s == NULL )
-        rc = RC( rcFS, rcDirectory, rcCopying, rcMemory, rcExhausted );
-    else
-    {
-        size_t written;
-        const char * concat = ( ( path[ lp - 1 ] == '/' ) ? "%s%s" : "%s/%s" );
-        rc = string_printf( *s, l, &written, concat, path, objname );
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryCopyPaths( const KDirectory * src_dir,
-    KDirectory * dst_dir, bool recursive, const char *src, const char *dst )
-{
-    rc_t rc;
-    struct KNamelist *list;
-
-    if ( src_dir == NULL || dst_dir == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcSelf, rcNull );
-    if ( src == NULL || dst == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcParam, rcNull );
-
-    rc = KDirectoryList ( src_dir, &list, NULL, NULL, "%s", src );
-    if ( rc == 0 )
-    {
-        uint32_t pt = KDirectoryPathType ( dst_dir, "%s", dst );
-        /* if the output-directory does not exist: create it! */
-        switch( pt )
-        {
-            case kptFile : rc = KDirectoryRemove ( dst_dir, true, "%s", dst );
-                            /* intentially no break ! */
-
-            case kptNotFound : if ( rc == 0 )
-                                    rc = KDirectoryCreateDir ( dst_dir, 0775, kcmCreate | kcmParents, "%s", dst );
-                               break;
-        }
-        if ( rc == 0 )
-        {
-            uint32_t i, n;
-            rc = KNamelistCount ( list, &n );
-            for ( i = 0; i < n && rc == 0; ++i )
-            {
-                const char *name;
-                rc = KNamelistGet ( list, i, &name );
-                if ( rc == 0 )
-                {
-                    char *src_obj;
-                    rc = build_obj_path( &src_obj, src, name );
-                    if ( rc == 0 )
-                    {
-                        char *dst_obj;
-                        rc = build_obj_path( &dst_obj, dst, name );
-                        if ( rc == 0 )
-                        {
-                            pt = KDirectoryPathType ( src_dir, "%s", src_obj );
-                            switch( pt )
-                            {
-                                case kptFile : rc = KDirectoryCopyPath ( src_dir, dst_dir, src_obj, dst_obj );
-                                               break;
-
-                                case kptDir  : if ( recursive )
-                                                    rc = KDirectoryCopyPaths( src_dir, dst_dir, true, src_obj, dst_obj );
-                                               break;
-                            }
-                            free( dst_obj );
-                        }
-                        free( src_obj );
-                    }
-                }
-            }
-        }
-        KNamelistRelease ( list );
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryCopy( const KDirectory * src_dir,
-    KDirectory * dst_dir, bool recursive, const char *src, const char *dst )
-{
-    rc_t rc = 0;
-    uint32_t pt;
-
-    if ( src_dir == NULL || dst_dir == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcSelf, rcNull );
-    if ( src == NULL || dst == NULL )
-        return RC ( rcFS, rcDirectory, rcCopying, rcParam, rcNull );
-
-    pt = KDirectoryPathType ( src_dir, "%s", src );
-    switch( pt )
-    {
-        case kptFile : rc = KDirectoryCopyPath ( src_dir, dst_dir, src, dst );
-                        break;
-        case kptDir  : rc = KDirectoryCopyPaths ( src_dir, dst_dir, recursive, src, dst );
-                        break;
-    }
-    return rc;
-}
diff --git a/libs/kfs/ffext.c b/libs/kfs/ffext.c
deleted file mode 100644
index 390fa28..0000000
--- a/libs/kfs/ffext.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/container.h>
-#include <kfs/fileformat.h>
-#include "fileformat-priv.h"
-struct KExtFileFormat;
-#define KFILEFORMAT_IMPL struct KExtFileFormat
-#include "impl.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-
-struct KDirectory;
-
-typedef
-struct KExtNode
-{
-    BSTNode		node;
-    atomic32_t 		refcount;
-    KFileFormatType	typeid;
-    size_t		kfflen;
-    size_t		extlen;
-    char *		extdescr;
-    char		kffdescr [1];
-} KExtNode;
-
-static
-rc_t KExtNodeDestroy (const KExtNode * cself)
-{
-    rc_t rc = 0;
-    KExtNode * self = (KExtNode*)cself;
-
-    FUNC_ENTRY();
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KExtNodeDestroy: self == NULL");
-    }
-    else
-    {
-
-        /* memory leak?  do we need to release KFFTables? */
-
-
-	free (self);
-    }
-    return rc;
-}
-
-static
-rc_t KExtNodeRelease (const KExtNode * cself)
-{
-    rc_t rc = 0;
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KFileFormat *self = (KFileFormat*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KExtNodeDestroy (cself);
-    }
-    return rc;
-}
-/* not used at this time */
-#if 0
-static
-rc_t KExtNodeAddRef (const KExtNode * self)
-{
-    rc_t rc = 0;
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (&((KFileFormat*)self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KExtNodeMake (KExtNode ** kmmp, const KFFTables * tables,
-		     const char * extdescr, size_t extlen,
-		     const char * kffdescr, size_t kfflen)
-
-{
-    KExtNode * self;
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-
-    if (extdescr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KExtNodeMake: extdescr == NULL");
-    }
-    else if (kffdescr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KKffNodeMake: kffdescr == NULL");
-    }
-    else
-    {
-	if (extlen > DESCRLEN_MAX)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KExtNodeMake: extdescr too long");
-	}
-	else if (extlen == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KExtNodeMake: extdescr too short");
-	}
-	else if (kfflen > DESCRLEN_MAX)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KKffNodeMake: kffdescr too long");
-	}
-	else if (kfflen == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KKffNodeMake: kffdescr too short");
-	}
-	else
-	{
-	    KFileFormatType typeid;
-	    rc = KFFTablesGetTypeId (tables, kffdescr, &typeid, NULL);
-	    if (rc == 0)
-	    {
-		self = malloc (sizeof (*self) + extlen + kfflen + 1);
-		if (self == NULL)
-		{
-		    rc = RC (rcFF,  rcIndex, rcConstructing, rcMemory, rcExhausted);
-		    LOGERR (klogErr, rc, "KExtNodeMake: self could not be allocated");
-		}
-		else
-		{
-		    atomic32_set (&self->refcount,1);
-		    self->typeid = typeid;
-		    self->kfflen = kfflen;
-		    self->extlen = extlen;
-		    self->extdescr = self->kffdescr + kfflen + 1;
-		    memcpy (self->kffdescr, kffdescr, kfflen);
-		    memcpy (self->extdescr, extdescr, extlen);
-		    self->kffdescr[self->kfflen] = '\0';
-		    self->extdescr[self->extlen] = '\0';
-		    *kmmp = self;
-		    return 0;
-		}
-	    }
-	}
-    }
-    return rc;
-}
-
-
-/* -------------------------
- *
- */
-typedef
-struct KExtTable
-{
-    atomic32_t 	refcount;
-    BSTree	tree;
-} KExtTable;
-
-static
-void KExtNodeWhack (BSTNode * n, void * ignored)
-{
-    FUNC_ENTRY();
-
-    (void)KExtNodeRelease((KExtNode*)n);
-}
-static
-rc_t KExtTableDestroy (KExtTable * cself)
-{
-    rc_t rc;
-    KExtTable * self;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    self = (KExtTable*)cself;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KExtTableDestroy: self == NULL");
-    }
-    else
-    {
-	BSTreeWhack (&self->tree, KExtNodeWhack, NULL);
-	free (self);
-    }
-    return rc;
-}
-static
-rc_t KExtTableRelease (const KExtTable * cself)
-{
-    rc_t rc = 0;
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KExtTable *self = (KExtTable*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KExtTableDestroy (self);
-    }
-    return rc;
-}
-#if 0
-static /* not used at this time */
-rc_t KExtTableAddRef (const KExtTable * self)
-{
-    rc_t rc = 0;
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (& ((KFileFormat*) self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KExtTableMake (KExtTable ** kmmtp)
-{
-    KExtTable * self;
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    self = malloc (sizeof *self);
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KExtTableMake: self could not be allocated");
-    }
-    else
-    {
-	BSTreeInit (&self->tree);
-	*kmmtp = self;
-    }
-    return rc;
-}
-
-static
-int KExtNodeCmp (const void* item, const BSTNode * n)
-{
-    size_t len;
-    KExtNode * mn = (KExtNode *)n;
-
-    FUNC_ENTRY();
-
-    /* -----
-     * we only check this many characters of the comparison item
-     * we need only this part to match and ignore characters after
-     * this in the comparison string
-     */
-    len = mn->extlen;
-    return strncmp (item, mn->extdescr, len);
-}
-
-static
-rc_t KExtTableFind (KExtTable * self, KExtNode ** node, const char * str)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    *node = (KExtNode*)BSTreeFind (&self->tree, str, KExtNodeCmp);
-    if (*node == NULL)
-    {
-/* 	rc = RC (rcFF, rcTable, rcSearching, rcNode, rcNotFound); */
-        KFF_DEBUG (("%s: Could not find %s\n", __func__, str));
-    }
-    return rc;
-}
-/* maxlen includes the terminating NUL */
-#if 0 /* not in use at this time */
-static
-rc_t KExtTableFindKFFDescr (KExtTable * self, const char * str, char * kff, size_t maxlen)
-{
-    rc_t rc;
-    KExtNode * np;
-
-    FUNC_ENTRY();
-
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KExtTableFindKFFDecr:self == NULL");
-	return rc;
-    }
-    if (str == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KExtTableFindKFFDecr: searchstring is NULL");
-	return rc;
-    }
-    if (kff == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KExtTableFindKFFDecr: found storage is NULL");
-	return rc;
-    }
-    rc = KExtTableFind (self, &np, str);
-    if (maxlen <= np->kfflen) /* kfflen does not include NUL */
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcTooLong);
-	LOGERR (klogErr, rc, "KExtTableFindKFFDecr: found storage is NULL");
-	return rc;
-    }
-    memcpy (kff, np->kffdescr, np->kfflen);
-    kff[np->kfflen] = '\0';
-    return rc;
-}
-#endif
-static
-int KExtNodeSort (const BSTNode* item, const BSTNode * n)
-{
-    const char * str1;
-    const char * str2;
-
-    FUNC_ENTRY();
-
-    str1 = ((KExtNode *)item)->extdescr;
-    str2 = ((KExtNode *)n)->extdescr;
-    return strcmp (str1, str2);
-}
-static
-rc_t KExtTableInsert (KExtTable * self, KExtNode *node)
-{
-
-    FUNC_ENTRY();
-
-    return (BSTreeInsert (&self->tree, &node->node, KExtNodeSort));
-}
-/* not is use at this time */
-#if 0
-static
-rc_t KExtTableBufferRead (KExtTable * self, KFFTables * tables,
-			    const char * buff, size_t bufflen)
-{
-    rc_t rc = 0;
-    const char * kff;
-    const char * ext;
-    const char * nl;
-    size_t kfflen;
-    size_t extlen;
-
-
-    FUNC_ENTRY();
-
-
-    /* -----
-     * until we get all the way through the buffer
-     * which by this coding could actually be all blank
-     */
-    while (bufflen)
-    {
-	ext = buff;
-	/* -----
-	 * allow leading white space including blank lines
-	 */
-	if (isspace (*ext))	
-	{
-	    buff++;
-	    bufflen --;
-	    continue;
-	}
-	/* -----
-	 * not a comment line so find the tab splitting the sections
-	 */
-	kff = memchr (ext, '\t', bufflen);
-	if (kff == NULL)
-	{
-	    /* couldn't find it so blae the document and quit */
-	bad_line:
-	    rc = RC (rcFF, rcBuffer, rcParsing, rcFormat, rcCorrupt);
-	    /* log error */
-	    bufflen = 0;
-	    continue;
-	}
-	/* -----
-	 * the ext portion of the line is from the first non-white space
-	 * through the character before the tab.
-	 */
-	extlen = kff - ext;
-	bufflen -= extlen + 1;
-	kff++; /* point past the tab */
-	while (bufflen) /* skip white space */
-	{
-	    if (*kff == '\n') /* end of line now is a format error */
-	    {
-		goto bad_line;
-	    }
-	    if (!isspace (*kff)) /* break at non shite space character */
-		break;
-	    bufflen --;
-	    kff ++;
-	}
-	if (bufflen == 0) /* no kff descr */
-	    goto bad_line;
-	nl = memchr (kff, '\n', bufflen);
-	if (nl == NULL) /* no EOL but last line in buffer */
-	{
-	    kfflen = bufflen;
-	    bufflen = 0;
-	}
-	else /* not last unfinished line */
-	{
-	    kfflen = nl - ext;
-	    bufflen -= kfflen + 1;
-	    buff = nl + 1;
-	}
-	{
-	    KExtNode * np;
-	    rc = KExtNodeMake (&np, tables, ext, extlen,
-				 kff, kfflen);
-	    if (rc != 0)
-	    {
-		/* LOG ERR */
-		break;
-	    }
-	}
-    }
-    ( break;
-	    }
-	}
-    }
-    return rc;
-}
-#endif
-/* not used at this time */
-#if 0
-LIB_EXPORT rc_t CC KExtTableRead (KExtTable * self, const KFile * file))
-{
-    rc_t rc = 0;
-    /* setup KMMap */
-    /* call KExtTableBufferRead */
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KExtTableWrite (const KExtTable * self, KFile * file)
-{
-    rc_t rc = 0;
-
-    return rc;
-}
-#endif
-/* -----
- * format is
- * whitechar := {' '|'\f'|'\t'|'\v'}
- * whitespace := whitechar*
- * ext-str = !whitespace!{'\t'|'\n'}*
- * kff-str = !whitespace!{'\t'|'\n'}*
- *
- * A line is 
- * [<whitespace>]#<comment line skipped>\n
- * Or 
- * [<whitespace>]<ext-str>\t[<whitespace>]<kff-str>\n
- * Or
- * [<whitespace>]\n
- *
- * NOTE: whitespace at the right end of the two strings is included in the strings
- * NOTE: We do not look for '\v'|'\f' within the strings though we maybe should
- * NOTE: the ext string definitely allows white space and punctuation
- */
-static
-rc_t KExtTableInit (KExtTable * self, const KFFTables * tables, const char * buffer, size_t len)
-{
-    rc_t rc;
-    const char * ext;
-    const char * kff;
-    const char * tab;
-    const char * newline;
-    const char * line;
-    const char * limit;
-    KExtNode * node;
-
-    FUNC_ENTRY();
-
-
-    rc = 0;
-
-    /* -----
-     * we try to go all the way through the buffer line by line
-     * which by this coding could actually be all blank
-     */
-    limit = buffer + len;
-    for (line = buffer; line < limit; line = newline+1)
-    {
-	for (ext = line; isspace (*ext); ext++, len--)
-	{
-	    if (len == 0) /* last of the file was all whitespace so quit */
-		break;
-	}
-	newline = memchr (ext, '\n', len);
-	if (newline == NULL)
-	    newline = ext + len;
-	/* -----
-	 * If the first character on the line is #
-	 * we treat it as a comment (matches sh/bash/libext/etc.
-	 */
-	if (*ext == '#')
-	{
-	    /* -----
-	     * skip this line
-	     */
-	    len -= newline+1 - ext;
-	    continue;
-	}
-	
-	tab = memchr (ext, '\t', len);
-	if (tab == NULL)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No <TAB> between ext and kff");
-	    break;
-	}
-	kff = tab + 1;
-	for (len -= kff - ext;
-	     isspace (*kff);
-	     len--, kff++)
-	{
-	    if (len == 0)
-	    {
-		rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-		LOGERR (klogFatal, rc, "No kff after <TAB>");
-		break;
-	    }
-	}
-	if (newline == kff)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No kff after whitespace");
-	    break;
-	}
-	len -= newline+1 - kff;
- 	rc = KExtNodeMake (&node, tables, ext, tab-ext, kff, newline-kff);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to make node");
-	    break;
-	}
-	rc = KExtTableInsert(self, node);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to insert node");
-	    break;
-	}
-    }
-    if (rc == 0)
-    {
-	char unknown[] = "Unknown";
-
-	rc = KExtNodeMake (&node, tables, unknown, sizeof (unknown) - 1, unknown, sizeof (unknown) - 1);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to make node");
-	}
-	else
-	{
-	    rc = KExtTableInsert(self, node);
-	    if (rc != 0)
-	    {
-		LOGERR (klogFatal, rc, "Failure to insert node");
-	    }
-	}
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KExtFileFormat
- *  a file content (format) categorizer
- */
-
-typedef
-struct KExtFileFormat
-{
-    KFileFormat	  dad;
-    KExtTable * table;
-} KExtFileFormat;
-
-static rc_t KExtFileFormatDestroy (KExtFileFormat *self);
-static rc_t KExtFileFormatGetTypeBuff (const KExtFileFormat *self,
-				       const void * buff, size_t buff_len,
-				       KFileFormatType * type,
-				       KFileFormatClass * class,
-				       char * description,
-				       size_t descriptionmax,
-				       size_t * descriptionlength);
-static rc_t KExtFileFormatGetTypePath (const KExtFileFormat *self,
-				       const struct  KDirectory * dir, const char * path,
-				       KFileFormatType * type,
-				       KFileFormatClass * class,
-				       char * description,
-				       size_t descriptionmax,
-				       size_t * descriptionlength);
-static
-KFileFormat_vt_v1 vt_v1 =
-{
-    1, 1, /* maj, min */
-    KExtFileFormatDestroy,
-    KExtFileFormatGetTypeBuff,
-    KExtFileFormatGetTypePath
-};
-
-
-
-/* Destroy
- *  destroy FileFormat
- */
-static
-rc_t KExtFileFormatDestroy (KExtFileFormat *self)
-{
-
-    FUNC_ENTRY();
-
-    return 0;
-}
-
-/* Type
- *  returns a KExtFileFormatDesc
- *  [OUT] rc_t               return
- *  [IN]  const KExtFileFormat *  self         
- *  [IN]  void **            buffer       buffer to hold returned description
- *  [IN]  size_t             buffer_size  size of the buffer
- *  [OUT] char **            descr        text description of file type
- *  [IN]  size_t             descr_max    maximum size of string descr can hold
- *  [OUT] size_t *           descr_len    length of returned descr (not including NUL
- */
-static
-rc_t CC KExtFileFormatGetTypeBuff (const KExtFileFormat *self, const void * buff, size_t buff_len,
-				KFileFormatType * type, KFileFormatClass * class,
-				char * descr, size_t descr_max, size_t *descr_len)
-{
-
-    FUNC_ENTRY();
-
-    return RC (rcFF, rcFileFormat, rcSearching, rcFormat, rcUnsupported);
-}
-
-
-static
-rc_t CC KExtFileFormatGetTypePath (const KExtFileFormat *self,
-                                const struct KDirectory * dir_ignored, const char * path,
-                                KFileFormatType * type, KFileFormatClass * class,
-                                char * descr, size_t descr_max, size_t *descr_len)
-{
-    rc_t rc = 0;
-    const char * b;
-    const char * s;
-    size_t size;
-
-
-    FUNC_ENTRY();
-
-
-    if (type != NULL)
-	*type = kfftError;
-    if (class != NULL)
-	*class = kffcError;
-
-    s = strrchr (path, '/');
-    if (s == NULL)
-	s = path;
-
-
-    b = strrchr (s, '.');
-    if (b == NULL)
-	b = path + string_measure(path, &size) - 1; /* will be an empty string when calls KExtTableFind */
-    {
-	KExtNode * node;
-	size_t c;
-
-        KFF_DEBUG (("%s: extension is %s\n", __func__, b+1));
-#if 1
- 	rc = KExtTableFind (self->table, &node, ++b);
-	if (rc == 0)
-	{
-	    KFileFormatClass cid;
-	    KFileFormatType tid;
-	    if (node == NULL)
-		rc = KExtTableFind (self->table, &node, "Unknown");
-	    if (rc == 0)
-		rc = KFFTablesGetTypeId (self->dad.tables, node->kffdescr, &tid, &cid);
-	    if (rc == 0)
-	    {
-		c = node->kfflen;
-		if (c > descr_max)
-		    c = descr_max-1;
-		if (descr)
-		    string_copy (descr, descr_max, node->kffdescr, c);
-		descr[c] = '\0';
-		if (descr_len)
-		    *descr_len = c;
-		if (type)
-		    *type = tid;
-		if (class)
-		    *class = cid;
-	    }
-	}
-	if (rc != 0)
-	{
-	    if (descr_len != NULL)
-		*descr_len = 0;
-	    if (type != NULL)
-		*type = kfftNotFound;
-	    if (class != NULL)
-		*class = kffcNotFound;
-	}	
-
-
-#else
-	size_t l = string_measure (b, &size);
-	if (desc != NULL)
-	{
-	    string_copy (desc, desc_max, b, l);
-	    if (desc_max < l)
-		desc[desc_max-1] = 0;
-	}
-	if (descr_len != NULL)
-	    *descr_len = l;
-	if (type != NULL)
-	    *type = kfftUnknown;
-	if (class != NULL)
-	    *class = kffcUnknown;
-#endif
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KExtFileFormatMake (KFileFormat ** pft,
-			 const char* ext, size_t extlen,
-			 const char * typeAndClass, size_t tclen)
-{
-    rc_t rc = 0;
-    KExtFileFormat * self;
-
-
-    FUNC_ENTRY();
-
-    self = malloc (sizeof * self);
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcAllocating, rcMemory, rcExhausted);
-	LOGERR (klogFatal, rc, "Failed to allocate for KExtFileFormat");
-    }
-    else
-    {
-	rc = KFileFormatInit (&self->dad, (const KFileFormat_vt *)&vt_v1, typeAndClass, tclen);
-	if (rc == 0)
-	{
-	    rc = KExtTableMake (&self->table);
-	    if (rc == 0)
-	    {
-		rc = KExtTableInit (self->table, self->dad.tables, ext, extlen);
-		{
-		    if (rc == 0)
-		    {
-			*pft = &self->dad;
-			return 0;
-		    }
-		}
-		KExtTableRelease (self->table);
-	    }
-	}
-	free (self);
-    }
-    return rc;
-}
-
diff --git a/libs/kfs/ffkey.c b/libs/kfs/ffkey.c
deleted file mode 100644
index a7d844a..0000000
--- a/libs/kfs/ffkey.c
+++ /dev/null
@@ -1,833 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/container.h>
-#include <kfs/fileformat.h>
-#include <sysalloc.h>
-#include "fileformat-priv.h"
-
-#include <atomic.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* ----------------------------------------------------------------------
- * Private type used only with in this compilation unit.
- */
-typedef
-struct KFFClass
-{
-    BSTNode	node;
-    atomic32_t	refcount;
-    KFileFormatClass	class;		/* scalar ID of the class */
-    size_t	len;		/* length of the descriptor */
-    char 	descr	[1];	/* ASCIZ text description of the class */
-} KFFClass;
-
-static
-rc_t KFFClassDestroy (const KFFClass * cself)
-{
-    rc_t rc;
-    KFFClass * self;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    self = (KFFClass*)cself;
-    if (cself == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFClassDestroy: self == NULL");
-    }
-    else
-    {
-	free (self);
-    }
-    return rc;
-}
-
-static
-rc_t KFFClassRelease (const KFFClass * cself)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KFFClass *self = (KFFClass*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KFFClassDestroy (cself);
-    }
-    return rc;
-}
-/* not used at this time */
-#if 0
-static
-rc_t KFFClassAddRef (const KFFClass * self)
-{
-    rc_t rc = 0; 
-
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (&((KFFClass*)self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KFFClassMake (KFFClass ** kffcp,	/* pointer to new object */
-		   KFileFormatClass class, /* ID of new class */
-		   const char * descr,	/* description of new class */
-		   size_t len)		/* length of description */
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (kffcp == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFClassMake: kffkmp == NULL");
-    }
-    else if (descr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KFFClassMake: descr == NULL");
-    }
-    else
-    {
-	if (len > DESCRLEN_MAX)
-	{
-/* 	    printf("len %u DESCRLEN_MAX %u\n", len, DESCRLEN_MAX); */
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KFFClassMake: descr too long");
-	}
-	else if (len == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KFFClassMake: descr too short");
-	}
-	else
-	{
-	    KFFClass * self = malloc (sizeof (*self) + len);
-	    if (self == NULL)
-	    {
-		rc = RC (rcFF,  rcIndex, rcConstructing, rcMemory, rcExhausted);
-		LOGERR (klogErr, rc, "KFFClassMake: object could not be allocated");
-	    }
-	    else
-	    {
-		/* self->node needs not be initialized  */
-		atomic32_set (&self->refcount,1);
-		self->class = class;
-		self->len = len;
-		memcpy (self->descr, descr, len);
-		self->descr[self->len] = '\0';
-		*kffcp = self;
-		return 0;
-	    }
-	}
-    }
-    *kffcp = NULL;
-    return rc;
-}
-
-/* -----
- * Private type used only with in this compilation unit.
- */
-typedef
-struct KFFType
-{
-    BSTNode	node;
-    atomic32_t 	refcount;	/* how many open references to this object */
-    KFileFormatType	type;		/* scalar ID of the type */
-    KFileFormatClass	class;		/* scalar ID of the class the type belongs in */
-    size_t	len;		/* length of the descriptor */
-    char 	descr	[1];	/* ASCIZ text description of the type */
-} KFFType;
-
-static
-rc_t KFFTypeDestroy (const KFFType * cself)
-{
-    rc_t rc = 0;
-    KFFType * self = (KFFType*)cself;
-
-    FUNC_ENTRY();
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTypeDestroy: self == NULL");
-    }
-    else
-    {
-	free (self);
-    }
-    return rc;
-}
-
-static
-rc_t KFFTypeRelease (const KFFType * cself)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KFFType *self = (KFFType*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KFFTypeDestroy (cself);
-    }
-    return rc;
-}
-/* not used at this time */
-#if 0
-static
-rc_t KFFTypeAddRef (const KFFType * self)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (&((KFFType*)self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KFFTypeMake (KFFType ** kfftp,
-		  KFileFormatType  type,
-		  KFileFormatClass class,
-		  const char * descr,
-		  size_t len)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (kfftp == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTypeMake: kffkmp == NULL");
-    }
-    else if (descr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KFFTypeMake: descr == NULL");
-    }
-    else
-    {
-	if (len > DESCRLEN_MAX)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KFFTypeMake: descr too long");
-	}
-	else if (len == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KFFTypeMake: descr too short");
-	}
-	else
-	{
-	    KFFType * self = malloc (sizeof (*self) + len);
-	    if (self == NULL)
-	    {
-		rc = RC (rcFF,  rcIndex, rcConstructing, rcMemory, rcExhausted);
-		LOGERR (klogErr, rc, "KFFTypeMake: object could not be allocated");
-	    }
-	    else
-	    {
-		/* self->node needs not be initialized  */
-		atomic32_set (&self->refcount,1);
-		self->len = len;
-		memcpy (self->descr, descr, len);
-		self->descr[self->len] = '\0';
-		self->type = type;
-		self->class = class;
-		*kfftp = self;
-		return 0;
-	    }
-	}
-    }
-    *kfftp = NULL;
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- *
- * A table will have a descr based bstree for type, a descr based bstree
- * for class,
- *
- * A type indexed and class indexed set of indexes into the same stuff.
- *
- * All table are thus the "node" and pointer to a node.  the same nodes
- * are referred to by the descr based bstree and the linear tables.
- *
- * Linear tables are pre allocated arrays that are increased by chunks.
-*/
-
-struct KFFTables
-{
-    atomic32_t 	refcount;
-    BSTree	classtree;
-    BSTree	typetree;
-    KFFClass **	classindex;
-    KFFType **	typeindex;
-    uint32_t	typecount;
-    uint32_t	classcount;
-    uint32_t	typesize;
-    uint32_t	classsize;
-
-};
-
-static
-void KFFTypeNodeWhack (BSTNode * n, void * ignored)
-{
-    FUNC_ENTRY();
-
-    KFFTypeDestroy ((KFFType*)n);
-}
-static
-void KFFClassNodeWhack (BSTNode * n, void * ignored)
-{
-    FUNC_ENTRY();
-    KFFClassDestroy ((KFFClass*)n);
-}
-static 
-rc_t KFFTablesDestroy (const KFFTables * cself)
-{
-    KFFTables * self = (KFFTables*)cself;
-    rc_t rc = 0;
-/*     uint32_t ix; */
-    FUNC_ENTRY();
-
-    BSTreeWhack (&self->typetree, KFFTypeNodeWhack, NULL);
-    BSTreeWhack (&self->classtree, KFFClassNodeWhack, NULL);
-    if (self->classindex != NULL)
-	free (self->classindex);
-    if (self->typeindex != NULL)
-	free (self->typeindex);
-    free (self);
-    return rc;
-}
-
-rc_t CC KFFTablesRelease (const KFFTables * cself)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KFFTables *self = (KFFTables*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KFFTablesDestroy (self);
-    }
-    return rc;
-}
-
-rc_t CC KFFTablesAddRef (const KFFTables * self)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (& ((KFFTables*) self)->refcount);
-    return rc;
-}
-
-/* -----
- * if descr is too short, not NUL terminated, and at the edge of legal memory
- * there is a chance the next two functions could have a segmentation fault
- */
-static
-int classcmp (const void * descr, const BSTNode * n)
-{
-    KFFClass * nn = (KFFClass*)n;
-    return strncmp ((const char *)descr, nn->descr, nn->len);
-}
-static
-int typecmp (const void * descr, const BSTNode * n)
-{
-    KFFType * nn = (KFFType *)n;
-
-    return strncmp ((const char *)descr, nn->descr, nn->len);
-}
-static
-int classsort (const BSTNode * i ,const BSTNode * n)
-{
-    KFFClass * ii = (KFFClass *)i;
-    KFFClass * nn = (KFFClass *)n;
-    return strncmp (ii->descr, nn->descr, nn->len);
-}
-static
-int typesort (const BSTNode * i, const BSTNode * n)
-{
-    KFFType * ii = (KFFType *)i;
-    KFFType * nn = (KFFType *)n;
-    return strncmp (ii->descr, nn->descr, nn->len);
-}
-
-static
-KFFClass * KFFTablesFindKFFClass (KFFTables * self,
-				  const char * descr )
-{
-    BSTNode * pbn;
-    if ((self == NULL) || (descr == NULL))
-	return NULL;
-    pbn = BSTreeFind (&self->classtree, descr, classcmp);
-    return (KFFClass*)pbn;
-}
-static
-KFFType * KFFTablesFindKFFType (KFFTables * self,
-				const char * descr )
-{
-    BSTNode * pbn;
-    FUNC_ENTRY ();
-    if ((self == NULL) || (descr == NULL))
-	return NULL;
-    pbn = BSTreeFind (&self->typetree, descr, typecmp);
-    return (KFFType*)pbn;
-}
-/* Not currently used
-static
-KFileFormatClass KFFTablesFindKFileFormatClass (KFFTables * self,
-						const char * descr )
-{
-    BSTNode * pbn;
-    LOGENTRY (10, "(10, "KFFTablesFindKFileFormatClass"));
-    if ((self == NULL) || (descr == NULL))
-	return kffcError;
-    pbn = BSTreeFind (&self->classtree, descr, classcmp);
-    if (pbn == NULL)
-	return kffcUnknown;
-    return ((KFFClass*)pbn)->class;
-}
-*/
-static
-KFileFormatType KFFTablesFindKFileFormatType (const KFFTables * self,
-					      const char * descr )
-{
-    union
-    {
-	BSTNode * bn;
-	KFFType * kt;
-    } node;
-
-    FUNC_ENTRY();
- 
-    if ((self == NULL) || (descr == NULL))
-    {
-	LOGMSG(klogWarn,"Not Found");
-	return kfftError;
-    }
-    node.bn = BSTreeFind (&self->typetree, descr, typecmp);
-    if (node.bn == NULL)
-    {
-        PLOGMSG(klogWarn,(klogWarn,"Unknown $(D)", PLOG_S(D),descr));
-	return kfftUnknown;
-    }
-
-/*     printf("KFFTablesFindKFileFormatType:\n" */
-/* 	   "\trefcount\t%u\n" */
-/* 	   "\ttype\t\t%u\n" */
-/* 	   "\tclass\t\t%u\n" */
-/* 	   "\tlen\t\t%lu\n" */
-/* 	   "\tdescr\t\t%s\n", */
-/* 	   node.kt->refcount,  */
-/* 	   node.kt->type, */
-/* 	   node.kt->class, */
-/* 	   node.kt->len, */
-/* 	   node.kt->descr); */
-
-    return (node.kt->type);
-}
-
-rc_t CC KFFTablesAddClass (KFFTables * self,
-                           KFileFormatClass * pclassid, /* returned ID: NULL okay */
-                           const char * descr,
-                           size_t len)
-{
-    rc_t rc;
-
-    FUNC_ENTRY();
-
-/*     PLOGMSG ((klogDebug10, "Descr is $(L) $(D)", PLOG_2(PLOG_U32(L),PLOG_S(D)), len,descr)); */
-    rc = 0;
-    if (self == NULL)
-    {
-	rc = -1;
-	LOGERR (klogErr, rc, "Error making type: NULL pointer");
-    }
-    else if (descr == NULL)
-    {
-	rc = -1;
-	LOGERR (klogErr, rc, "Error making type: NULL descr");
-    }
-    else
-    {
-	KFFClass * pclass;
-
-	pclass = KFFTablesFindKFFClass (self, descr);
-	if (pclass != NULL)
-	{
-	    rc = -1;
-	    PLOGERR (klogErr, (klogErr, rc, "Class already inserted <$(d)>", PLOG_S(d),  descr));
-	}
-	else
-	{
-	    /* not thread safe if multiple "creators" */
-	    if (self->classcount * sizeof(KFFClass*) == self->classsize)
-	    {
-		void * vp;
-		self->classsize += 32 * sizeof(KFFClass*);
-		/* realloc will not be undone if anything fails */
-		vp = realloc (self->classindex,self->classsize);
-		if (vp == NULL)
-		{
-		    rc = -1;
-		    LOGERR (klogErr, rc, "Error allocating class table");
-		}
-		self->classindex = vp;
-	    }
-	}
-	if (rc == 0)
-	{
-	    KFileFormatClass cid;
-	    KFFClass * kc;
-	    cid = self->classcount++;
-	    rc = KFFClassMake (&kc, cid, descr, len);
-	    if (rc != 0)
-	    {
-		PLOGERR (klogErr, (klogErr, rc, "Error making class: $(c) $(d)",
-			  PLOG_2(PLOG_U32(c),PLOG_S(d)),
-			  cid, descr));
-	    }
-	    else
-	    {
-		rc = BSTreeInsert (&self->classtree, &kc->node,
-				   classsort);
-		if (rc == 0)
-		{
-		    self->classindex[cid] = kc;
-		    if (pclassid)
-			*pclassid = cid;
-		    return 0;
-		}
-		PLOGERR (klogErr, (klogErr, rc, "Error inserting class $(c) $(d)",
-                                   PLOG_2(PLOG_U32(c),PLOG_S(d)),
-                                   cid, descr));
-		KFFClassRelease (kc);
-	    }
-	    self->classcount--;
-	}
-    }
-    if (pclassid)
-	*pclassid = 0;
-    return rc;
-}
-
-rc_t CC KFFTablesAddType (KFFTables * self,
-                          KFileFormatType * ptype, /* returned new ID */
-                          const char * class,
-                          const char * type,
-                          size_t clen,
-                          size_t tlen)
-{
-    rc_t rc;
-    KFFType * ptn;
-    KFFClass * pcn;
-    KFileFormatClass classid;
-    KFileFormatType pid;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcConstructing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "Error making type: NULL pointer");
-	goto quickout;
-    }
-    if ((class == NULL)||(type == NULL))
-    {
- 	rc = -1;
-	LOGERR (klogErr, rc, "Error making type: NULL parameter");
-	goto quickout;
-    }
-    ptn = KFFTablesFindKFFType (self, type);
-    pcn = KFFTablesFindKFFClass (self, class);
-    if (ptn != NULL)
-    {
-	rc = -1;
-	PLOGERR (klogErr, (klogErr, rc, "Type already inserted <$(d)>", PLOG_S(d), type));
-	goto quickout;
-    }
-
-    if (pcn == NULL)
-    {
-	rc = KFFTablesAddClass (self, &classid, class, clen);
-	if (rc != 0)
-	{
-	    PLOGERR (klogErr, (klogErr, rc, "unable to insert new class <$(d)>", PLOG_S(d), class));
-	    goto quickout;
-	}
-    }
-    else
-    {
-	classid = pcn->class;
-    }
-
-    /* not thread safe if multiple "creators" */
-    if (self->typecount * sizeof(KFFType*) == self->typesize)
-    {
-	void * vp;
-	self->typesize += 32 * sizeof(KFFType*);
-	/* realloc will not be undone of anything fails */
-	vp = realloc (self->typeindex,self->typesize);
-	if (vp == NULL)
-	{
-	    rc = -1;
-	    LOGERR (klogErr, rc, "Error allocating type table");
-	    goto quickout;
-	}
-	self->typeindex = vp;
-
-    }
-    pid = self->typecount++;
-    rc = KFFTypeMake (&ptn, pid, classid, type, tlen);
-    if (rc != 0)
-    {
-	PLOGERR (klogErr, (klogErr, rc, "Error making type: $(c) $(d)",
-                           PLOG_2(PLOG_I32(c),PLOG_S(d)),
-                           pid, type));
-    }
-    else
-    {
-	rc = BSTreeInsert (&self->typetree, &ptn->node, typesort);
-	if (rc == 0)
-	{
-	    self->typeindex[pid] = ptn;
-	    if (ptype)
-		*ptype = pid;
-	    return 0;
-	}
-	KFFTypeRelease (ptn);
-    }
-    self->typecount--;
-
-quickout:
-    if (ptype)
-	*ptype = 0;
-    return rc;
-}
-
-rc_t CC KFFTablesMake (KFFTables ** kmmtp)
-{
-    KFFTables * self;
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    self = calloc (1,sizeof *self); /* we need it zeroed */
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KFFTablesMake: self could not be allocated");
-    }
-    else
-    {
-/* 	uint32_t unknown; */
-/* calloc does all this
-	self->typecount = self->typesize = self->classcount = 
-	    self->classsize = 0;
-	KFFClass = NULL;
-	KFFType = NULL;
-*/
-/* might not want to count on BSTreeInit to set to zero and nothing else */
-	BSTreeInit (&self->typetree);
-	BSTreeInit (&self->classtree);
-	atomic32_set (&self->refcount,1);
-	/* initialize the tables to have an unknown class and unknown type */
-#if 1
-/* is this wise? */
-	rc = KFFTablesAddType (self, NULL, "Unknown", "Unknown", 7, 7);
-	if (rc == 0)
-	{
-	    *kmmtp = self;
-	    return 0;
-	}
-#else
-	rc = KFFTablesAddClass (self, &unknown,
-				"Unknown", 7);
-	if (rc == 0)
-	{
-	    uint32_t u;
-	    rc = KFFTablesAddType (self, &u, unknown,
-				   "Unknown", 7);
-	    if (rc == 0)
-	    {
-		*kmmtp = self;
-		return 0;
-	    }
-	}
-#endif
-	KFFTablesRelease (self);
-    }
-    return rc;
-}
-
-rc_t CC KFFTablesGetClassDescr (const KFFTables * self,
-                                KFileFormatClass tid,
-                                size_t * len,
-                                char ** pd)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    *pd = NULL;
-    *len = 0;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcAccessing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTablesGetClassDescr: self is Null");
-    }
-    else
-    {
-	if ( ( tid < 0 )||( (uint32_t)tid > self->classcount ) )
-	{
-	    rc = RC (rcFF, rcTable, rcAccessing, rcParam, rcNotFound);
-	    LOGERR (klogErr, rc, "KFFTablesGetClassDescr: class ID out of range");
-	}
-	else
-	{
-	    *pd = self->classindex[tid]->descr;
-	    *len = self->classindex[tid]->len;
-	}
-    }
-    return rc;
-}
-
-rc_t CC KFFTablesGetTypeDescr (const KFFTables * self,
-                               KFileFormatType tid,
-                               size_t * len,
-                               char ** pd)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    *pd = NULL;
-    *len = 0;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcAccessing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTablesGetTypeDescr: self is Null");
-    }
-    else
-    {
-	if ( (uint32_t)tid > self->typecount )
-	{
-	    rc = RC (rcFF, rcTable, rcAccessing, rcParam, rcNotFound);
-	    LOGERR (klogErr, rc, "KFFTablesGetTypeDescr: type ID out of range");
-	}
-	else
-	{
-	    *pd = self->typeindex[tid]->descr;
-	    *len = self->typeindex[tid]->len;
-	}
-    }
-    return rc;
-}
-
-/* not currently used and incomplete
-rc_t KFFTablesGetClassId (const KFFTables * self,
-			  const char ** pd,
-			  KFileFormatClass * cid)
-{
-    rc_t rc;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    *cid = 0;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcAccessing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTablesGetClassId: self is Null");
-    }
-    else
-    {
-    }
-    return rc;
-}
-*/
-rc_t CC KFFTablesGetTypeId (const KFFTables * self,
-                            const char * pd,
-                            KFileFormatType * tid,
-                            KFileFormatClass * cid)
-{
-    rc_t rc;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    *tid = 0;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcAccessing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KFFTablesGetTypeId: self is Null");
-    }
-    else
-    {
-	KFileFormatType tt;
-	tt = KFFTablesFindKFileFormatType (self, pd);
-	if (tt > 0)
-	{
-	    if (tid)
-		*tid = tt;
-	    if (cid)
-		*cid = self->typeindex[tt]->class;
-	}
-	else
-	{
-	    if (tid)
-		*tid = tt;
-	    if (cid)
-		*cid = tt; /* same fail values */
-	}
-    }
-    return rc;
-}
diff --git a/libs/kfs/ffmagic.c b/libs/kfs/ffmagic.c
deleted file mode 100644
index f572a04..0000000
--- a/libs/kfs/ffmagic.c
+++ /dev/null
@@ -1,942 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <magic.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/container.h>
-#include <kfs/directory.h>
-#include <kfs/fileformat.h>
-#include <kfg/config.h>
-#include <sysalloc.h>
-#include "fileformat-priv.h"
-struct KMagicFileFormat;
-#define KFILEFORMAT_IMPL struct KMagicFileFormat
-#include "impl.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-
-typedef
-struct KMagicNode
-{
-    BSTNode		node;
-    atomic32_t 		refcount;
-    KFileFormatType	typeid;
-    size_t		kfflen;
-    size_t		magiclen;
-    char *		magicdescr;
-    char		kffdescr [1];
-} KMagicNode;
-
-static
-rc_t KMagicNodeDestroy (const KMagicNode * cself)
-{
-    rc_t rc;
-    KMagicNode * self;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    self = (KMagicNode*)cself;
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KMagicNodeDestroy: self == NULL");
-    }
-    else
-    {
-	free (self);
-    }
-    return rc;
-}
-
-static
-rc_t KMagicNodeRelease (const KMagicNode * cself)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KFileFormat *self = (KFileFormat*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KMagicNodeDestroy (cself);
-    }
-    return rc;
-}
-/* not used at this time */
-#if 0
-static
-rc_t KMagicNodeAddRef (const KMagicNode * self)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (&((KFileFormat*)self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KMagicNodeMake (KMagicNode ** kmmp, const KFFTables * tables,
-		     const char * magicdescr, size_t magiclen,
-		     const char * kffdescr, size_t kfflen)
-
-{
-    KMagicNode * self;
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (magicdescr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KMagicNodeMake: magicdescr == NULL");
-    }
-    else if (kffdescr == NULL)
-    {
-	rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KKffNodeMake: kffdescr == NULL");
-    }
-    else
-    {
-	if (magiclen > DESCRLEN_MAX)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KMagicNodeMake: magicdescr too long");
-	}
-	else if (magiclen == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KMagicNodeMake: magicdescr too short");
-	}
-	else if (kfflen > DESCRLEN_MAX)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcInvalid);
-	    LOGERR (klogErr, rc, "KKffNodeMake: kffdescr too long");
-	}
-	else if (kfflen == 0)
-	{
-	    rc = RC (rcFF, rcIndex, rcConstructing, rcParam, rcEmpty);
-	    LOGERR (klogErr, rc, "KKffNodeMake: kffdescr too short");
-	}
-	else
-	{
-	    KFileFormatType typeid;
-	    rc = KFFTablesGetTypeId (tables, kffdescr, &typeid, NULL);
-	    if (rc == 0)
-	    {
-		self = malloc (sizeof (*self) + magiclen + kfflen + 1);
-		if (self == NULL)
-		{
-		    rc = RC (rcFF,  rcIndex, rcConstructing, rcMemory, rcExhausted);
-		    LOGERR (klogErr, rc, "KMagicNodeMake: self could not be allocated");
-		}
-		else
-		{
-		    atomic32_set (&self->refcount,1);
-		    self->typeid = typeid;
-		    self->kfflen = kfflen;
-		    self->magiclen = magiclen;
-		    self->magicdescr = self->kffdescr + kfflen + 1;
-		    memcpy (self->kffdescr, kffdescr, kfflen);
-		    memcpy (self->magicdescr, magicdescr, magiclen);
-		    self->kffdescr[self->kfflen] = '\0';
-		    self->magicdescr[self->magiclen] = '\0';
-		    *kmmp = self;
-		    return 0;
-		}
-	    }
-	}
-    }
-    return rc;
-}
-
-
-/* -------------------------
- *
- */
-typedef
-struct KMagicTable
-{
-    atomic32_t 	refcount;
-    BSTree	tree;
-} KMagicTable;
-
-static
-void KMagicNodeWhack (BSTNode * n, void * ignored)
-{
-    FUNC_ENTRY();
-
-    (void)KMagicNodeRelease((KMagicNode*)n);
-}
-static
-rc_t KMagicTableDestroy (KMagicTable * cself)
-{
-    rc_t rc;
-    KMagicTable * self;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    self = (KMagicTable*)cself;
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcDestroying, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KMagicTableDestroy: self == NULL");
-    }
-    else
-    {
-	BSTreeWhack (&self->tree, KMagicNodeWhack, NULL);
-	free (self);
-    }
-    return rc;
-}
-static
-rc_t KMagicTableRelease (const KMagicTable * cself)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (cself != NULL)
-    {
-	KMagicTable *self = (KMagicTable*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KMagicTableDestroy (self);
-    }
-    return rc;
-}
-#if 0
-static /* not used at this time */
-rc_t KMagicTableAddRef (const KMagicTable * self)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    if (self != NULL)
-        atomic32_inc (& ((KFileFormat*) self)->refcount);
-    return rc;
-}
-#endif
-static
-rc_t KMagicTableMake (KMagicTable ** kmmtp)
-{
-    KMagicTable * self;
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    self = malloc (sizeof *self);
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcTable, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KMagicTableMake: self could not be allocated");
-    }
-    else
-    {
-	BSTreeInit (&self->tree);
-	*kmmtp = self;
-    }
-    return rc;
-}
-
-static
-int KMagicNodeCmp (const void* item, const BSTNode * n)
-{
-    size_t len;
-    KMagicNode * mn = (KMagicNode *)n;
-
-    FUNC_ENTRY();
-
-    /* -----
-     * we only check this many characters of the comparison item
-     * we need only this part to match and ignore characters after
-     * this in the comparison string
-     */
-    len = mn->magiclen;
-    return strncmp (item, mn->magicdescr, len);
-}
-
-static
-rc_t KMagicTableFind (KMagicTable * self, KMagicNode ** node, const char * str)
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    *node = (KMagicNode*)BSTreeFind (&self->tree, str, KMagicNodeCmp);
-    if (*node == NULL)
-    {
-/* 	rc = RC (rcFF, rcTable, rcSearching, rcNode, rcNotFound); */
-        KFF_DEBUG (("%s: Could not find %s\n", __func__, str));
-    }
-    return rc;
-}
-/* maxlen includes the terminating NUL */
-#if 0 /* not in use at this time */
-static
-rc_t KMagicTableFindKFFDescr (KMagicTable * self, const char * str, char * kff, size_t maxlen)
-{
-    rc_t rc;
-    KMagicNode * np;
-
-    FUNC_ENTRY();
-
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "KMagicTableFindKFFDecr:self == NULL");
-	return rc;
-    }
-    if (str == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KMagicTableFindKFFDecr: searchstring is NULL");
-	return rc;
-    }
-    if (kff == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcNull);
-	LOGERR (klogErr, rc, "KMagicTableFindKFFDecr: found storage is NULL");
-	return rc;
-    }
-    rc = KMagicTableFind (self, &np, str);
-    if (maxlen <= np->kfflen) /* kfflen does not include NUL */
-    {
-	rc = RC (rcFF, rcFileFormat, rcSearching, rcParam, rcTooLong);
-	LOGERR (klogErr, rc, "KMagicTableFindKFFDecr: found storage is NULL");
-	return rc;
-    }
-    memcpy (kff, np->kffdescr, np->kfflen);
-    kff[np->kfflen] = '\0';
-    return rc;
-}
-#endif
-static
-int KMagicNodeSort (const BSTNode* item, const BSTNode * n)
-{
-    const char * str1;
-    const char * str2;
-
-    FUNC_ENTRY();
-
-    str1 = ((KMagicNode *)item)->magicdescr;
-    str2 = ((KMagicNode *)n)->magicdescr;
-    return strcmp (str1, str2);
-}
-static
-rc_t KMagicTableInsert (KMagicTable * self, KMagicNode *node)
-{
-    FUNC_ENTRY();
-
-    return (BSTreeInsert (&self->tree, &node->node, KMagicNodeSort));
-}
-/* not is use at this time */
-#if 0
-
-static
-rc_t KMagicTableBufferRead (KMagicTable * self, KFFTables * tables,
-			    const char * buff, size_t bufflen)
-{
-    rc_t rc = 0;
-    const char * kff;
-    const char * magic;
-    const char * nl;
-    size_t kfflen;
-    size_t magiclen;
-
-    FUNC_ENTRY();
-
-
-    /* -----
-     * until we get all the way through the buffer
-     * which by this coding could actually be all blank
-     */
-    while (bufflen)
-    {
-	magic = buff;
-	/* -----
-	 * allow leading white space including blank lines
-	 */
-	if (isspace (*magic))	
-	{
-	    buff++;
-	    bufflen --;
-	    continue;
-	}
-	/* -----
-	 * not a comment line so find the tab splitting the sections
-	 */
-	kff = memchr (magic, '\t', bufflen);
-	if (kff == NULL)
-	{
-	    /* couldn't find it so blae the document and quit */
-	bad_line:
-	    rc = RC (rcFF, rcBuffer, rcParsing, rcFormat, rcCorrupt);
-	    /* log error */
-	    bufflen = 0;
-	    continue;
-	}
-	/* -----
-	 * the magic portion of the line is from the first non-white space
-	 * through the character before the tab.
-	 */
-	magiclen = kff - magic;
-	bufflen -= magiclen + 1;
-	kff++; /* point past the tab */
-	while (bufflen) /* skip white space */
-	{
-	    if (*kff == '\n') /* end of line now is a format error */
-	    {
-		goto bad_line;
-	    }
-	    if (!isspace (*kff)) /* break at non shite space character */
-		break;
-	    bufflen --;
-	    kff ++;
-	}
-	if (bufflen == 0) /* no kff descr */
-	    goto bad_line;
-	nl = memchr (kff, '\n', bufflen);
-	if (nl == NULL) /* no EOL but last line in buffer */
-	{
-	    kfflen = bufflen;
-	    bufflen = 0;
-	}
-	else /* not last unfinished line */
-	{
-	    kfflen = nl - magic;
-	    bufflen -= kfflen + 1;
-	    buff = nl + 1;
-	}
-	{
-	    KMagicNode * np;
-	    rc = KMagicNodeMake (&np, tables, magic, magiclen,
-				 kff, kfflen);
-	    if (rc != 0)
-	    {
-		/* LOG ERR */
-		break;
-	    }
-	}
-    }
-    ( break;
-	    }
-	}
-    }
-    return rc;
-}
-#endif
-
-/* not used at this time */
-#if 0
-LIB_EXPORT rc_t CC KMagicTableRead (KMagicTable * self, const KFile * file))
-{
-    rc_t rc = 0;
-    /* setup KMMap */
-    /* call KMagicTableBufferRead */
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMagicTableWrite (const KMagicTable * self, KFile * file)
-{
-    rc_t rc = 0;
-
-    return rc;
-}
-#endif
-
-/* -----
- * format is
- * whitechar := {' '|'\f'|'\t'|'\v'}
- * whitespace := whitechar*
- * magic-str = !whitespace!{'\t'|'\n'}*
- * kff-str = !whitespace!{'\t'|'\n'}*
- *
- * A line is 
- * [<whitespace>]#<comment line skipped>\n
- * Or 
- * [<whitespace>]<magic-str>\t[<whitespace>]<kff-str>\n
- * Or
- * [<whitespace>]\n
- *
- * NOTE: whitespace at the right end of the two strings is included in the strings
- * NOTE: We do not look for '\v'|'\f' within the strings though we maybe should
- * NOTE: the magic string definitely allows white space and punctuation
- */
-static
-rc_t KMagicTableInit (KMagicTable * self, const KFFTables * tables, const char * buffer, size_t len)
-{
-    rc_t rc;
-    const char * magic;
-    const char * kff;
-    const char * tab;
-    const char * newline;
-    const char * line;
-    const char * limit;
-    KMagicNode * node;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-
-    /* -----
-     * we try to go all the way through the buffer line by line
-     * which by this coding could actually be all blank
-     */
-    limit = buffer + len;
-    for (line = buffer; line < limit; line = newline+1)
-    {
-	for (magic = line; isspace (*magic); magic++, len--)
-	{
-	    if (len == 0) /* last of the file was all whitespace so quit */
-		break;
-	}
-	newline = memchr (magic, '\n', len);
-	if (newline == NULL)
-	    newline = magic + len;
-	/* -----
-	 * If the first character on the line is #
-	 * we treat it as a comment (matches sh/bash/libmagic/etc.
-	 */
-	if (*magic == '#')
-	{
-	    /* -----
-	     * skip this line
-	     */
-	    len -= newline+1 - magic;
-	    continue;
-	}
-	
-	tab = memchr (magic, '\t', len);
-	if (tab == NULL)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No <TAB> between magic and kff");
-	    break;
-	}
-	kff = tab + 1;
-	for (len -= kff - magic;
-	     isspace (*kff);
-	     len--, kff++)
-	{
-	    if (len == 0)
-	    {
-		rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-		LOGERR (klogFatal, rc, "No kff after <TAB>");
-		break;
-	    }
-	}
-	if (newline == kff)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No kff after whitespace");
-	    break;
-	}
-	len -= newline+1 - kff;
- 	rc = KMagicNodeMake (&node, tables, magic, tab-magic, kff, newline-kff);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to make node");
-	    break;
-	}
-	rc = KMagicTableInsert(self, node);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to insert node");
-	    break;
-	}
-    }
-    if (rc == 0)
-    {
-	char unknown[] = "Unknown";
-
-	rc = KMagicNodeMake (&node, tables, unknown, sizeof (unknown) - 1, unknown, sizeof (unknown) - 1);
-	if (rc != 0)
-	{
-	    LOGERR (klogFatal, rc, "Failure to make node");
-	}
-	else
-	{
-	    rc = KMagicTableInsert(self, node);
-	    if (rc != 0)
-	    {
-		LOGERR (klogFatal, rc, "Failure to insert node");
-	    }
-	}
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMagicFileFormat
- *  a file content (format) categorizer
- */
-
-typedef
-struct KMagicFileFormat
-{
-    KFileFormat	  dad;
-    magic_t 	  cookie;
-    KMagicTable * table;
-} KMagicFileFormat;
-
-static rc_t KMagicFileFormatDestroy (KMagicFileFormat *self);
-static rc_t KMagicFileFormatGetTypeBuff (const KMagicFileFormat *self,
-					 const void * buff, size_t buff_len,
-					 KFileFormatType * type,
-					 KFileFormatClass * class,
-					 char * description,
-					 size_t descriptionmax,
-					 size_t * descriptionlength);
-static rc_t KMagicFileFormatGetTypePath (const KMagicFileFormat *self,
-					 const KDirectory * dir,
-					 const char * path,
-					 KFileFormatType * type,
-					 KFileFormatClass * class,
-					 char * description,
-					 size_t descriptionmax,
-					 size_t * descriptionlength);
-static
-KFileFormat_vt_v1 vt_v1 =
-{
-    1, 1, /* maj, min */
-    KMagicFileFormatDestroy,
-    KMagicFileFormatGetTypeBuff,
-    KMagicFileFormatGetTypePath
-};
-
-
-
-/* Destroy
- *  destroy FileFormat
- */
-static
-rc_t KMagicFileFormatDestroy (KMagicFileFormat *self)
-{
-    FUNC_ENTRY();
-
-    magic_close (self->cookie);
-    return 0;
-}
-
-/* Type
- *  returns a KMagicFileFormatDesc
- *  [OUT] rc_t               return
- *  [IN]  const KMagicFileFormat *  self         
- *  [IN]  void **            buffer       buffer to hold returned description
- *  [IN]  size_t             buffer_size  size of the buffer
- *  [OUT] char **            descr        text description of file type
- *  [IN]  size_t             descr_max    maximum size of string descr can hold
- *  [OUT] size_t *           descr_len    length of returned descr (not including NUL
- */
-static
-rc_t KMagicFileFormatGetTypePath (const KMagicFileFormat *self, const KDirectory * dir, const char * path,
-				  KFileFormatType * type, KFileFormatClass * class,
-				  char * descr, size_t descr_max, size_t *descr_len)
-{
-    rc_t rc = 0;
-    uint8_t	buff	[8192];
-    size_t	bytes_read;
-
-    rc = KDirectoryAddRef (dir);
-    if (rc == 0)
-    {
-	const KFile * file;
-	rc = KDirectoryVOpenFileRead (dir, &file, path, NULL);
-	if (rc == 0)
-	{
-	    rc = KFileRead (file, 0, buff, sizeof buff, &bytes_read);
-	    {
-		rc = KMagicFileFormatGetTypeBuff (self,buff, bytes_read,
-						  type, class, descr,
-						  descr_max, descr_len);
-	    }
-	    KFileRelease (file);
-	}
-	KDirectoryRelease (dir);
-    }
-    return rc;
-}
-static
-rc_t KMagicFileFormatGetTypeBuff (const KMagicFileFormat *self, const void * buff, size_t buff_len,
-				  KFileFormatType * type, KFileFormatClass * class,
-				  char * descr, size_t descr_max, size_t *descr_len)
-{
-    rc_t rc = 0;
-    const char * b;
-
-    FUNC_ENTRY();
-
-    if (type != NULL)
-	*type = kfftError;
-    if (class != NULL)
-	*class = kffcError;
-    b = magic_buffer (self->cookie, buff, buff_len);
-    if (b == NULL)
-	rc = RC (rcFF, rcFileFormat, rcParsing, rcFormat, rcUnrecognized);
-    else
-    {
-	KMagicNode * node;
-	size_t c;
-
-        KFF_DEBUG (("magic_buffer returned %s\n", b));
-#if 1
- 	rc = KMagicTableFind (self->table, &node, b);
-	if (rc == 0)
-	{
-	    KFileFormatClass cid;
-	    KFileFormatType tid;
-#define TABLES self->dad.tables
-	    if (node == NULL)
-		rc = KMagicTableFind (self->table, &node, "Unknown");
-	    if (rc == 0)
-		rc = KFFTablesGetTypeId (TABLES, node->kffdescr, &tid, &cid);
-	    if (rc == 0)
-	    {
-		c = node->kfflen;
-		if (c > descr_max)
-		    c = descr_max-1;
-		if (descr)
-		    string_copy(descr, descr_max, node->kffdescr, c);
-		descr[c] = '\0';
-		if (descr_len)
-		    *descr_len = c;
-		if (type)
-		    *type = tid;
-		if (class)
-		    *class = cid;
-	    }
-	}
-	if (rc != 0)
-	{
-	    if (descr_len != NULL)
-		*descr_len = 0;
-	    if (type != NULL)
-		*type = kfftNotFound;
-	    if (class != NULL)
-		*class = kffcNotFound;
-	}	
-
-
-#else
-    size_t size;
-	size_t l = string_measure(b, &size);
-	if (descr != NULL)
-	{
-	    string_copy (descr, descr_max, b, l);
-	    if (descr_max < l)
-		descr[descr_max-1] = 0;
-	}
-	if (descr_len != NULL)
-	    *descr_len = strlen (b);
-	if (type != NULL)
-	    *type = kfftUnknown;
-	if (class != NULL)
-	    *class = kffcUnknown;
-#endif
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KMagicFileFormatMake (KFileFormat ** pft, const char * magic_path,
-			   const char* magic, size_t magiclen,
-			   const char * typeAndClass, size_t tclen)
-{
-    rc_t rc = 0;
-    KMagicFileFormat * self;
-
-    FUNC_ENTRY();
-
-    DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-            ("%s: load path as called %s\n", __func__, magic_path));
-
-    self = malloc (sizeof * self);
-    if (self == NULL)
-    {
-	rc = RC (rcFF, rcFileFormat, rcAllocating, rcMemory, rcExhausted);
-	LOGERR (klogFatal, rc, "Failed to allocate for KMagicFileFormat");
-    }
-    else
-
-
-    {
-	rc = KFileFormatInit (&self->dad, (const KFileFormat_vt *)&vt_v1, typeAndClass, tclen);
-	if (rc == 0)
-	{
-	    rc = KMagicTableMake (&self->table);
-	    if (rc == 0)
-	    {
-		rc = KMagicTableInit (self->table, self->dad.tables, magic, magiclen);
-		if (rc == 0)
-		{
- 		    self->cookie = magic_open (MAGIC_PRESERVE_ATIME);
-/* 		    self->cookie = magic_open (MAGIC_PRESERVE_ATIME|MAGIC_DEBUG|MAGIC_CHECK); */
-		    if (self->cookie == NULL)
-		    {
-			rc = RC (rcFF, rcFileFormat, rcConstructing, rcResources, rcNull);
-			LOGERR (klogFatal, rc, "Unable to obtain libmagic cookie");
-		    }
-		    else
-		    {
-                        KDirectory * pwd;
-                        KConfig * kfg;
-                        static const char unix_magic_path[] = "/usr/share/file/magic";
-                        static const char kfg_magic_path[] = "kfs/kff/magic";
-                        char * magic_path_cursor;
-                        char kfg_magic_path_buff [1024];
-                        char magic_path_buff [4096];
-                        size_t z;
-			int load_code;
-
-
-                        magic_path_cursor = magic_path_buff;
-
-                        if (magic_path)
-                        {
-                            z = strlen (magic_path);
-                            if (magic_path_cursor != magic_path_buff)
-                                *magic_path_cursor++ = ':';
-                            memcpy (magic_path_cursor, magic_path, z);
-                            magic_path_cursor += z;
-                            *magic_path_cursor = '\0';
-                            DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                    ("%s: 1 magic_path_buff %s\n", __func__, magic_path_buff));
-                        }
-
-                        /* see if we have a configured alternate magic path */
-                        rc = KConfigMake (&kfg, NULL);
-                        if (rc == 0)
-                        {
-                            const KConfigNode * node;
-                            rc = KConfigOpenNodeRead (kfg, &node, kfg_magic_path);
-                            if (rc == 0)
-                            {
-                                size_t remaining;
-                                rc = KConfigNodeRead (node, 0, kfg_magic_path_buff,
-                                                      sizeof kfg_magic_path_buff-1,
-                                                      &z, &remaining);
-                                if (rc == 0)
-                                {
-                                    if (remaining != 0)
-                                    {
-                                        rc = RC (rcFF, rcFileFormat, rcLoading, 
-                                                 rcString, rcExcessive);
-                                        DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                                ("%s: failed KConfigOpenNodeRead remaining %zu %R\n",
-                                                 __func__, remaining, rc));
-                                    }
-                                    else if (z)
-                                    {
-                                        kfg_magic_path_buff[z] = '\0';
-                                        if (magic_path_cursor != magic_path_buff)
-                                            *magic_path_cursor++ = ':';
-                                        memcpy (magic_path_cursor,kfg_magic_path_buff, z);
-                                        magic_path_cursor += z;
-                                        *magic_path_cursor = '\0';
-                                        DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                                ("%s: 3 magic_path_buff %s\n", __func__, magic_path_buff));
-                                    }
-                                }
-                                else
-                                    DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                            ("%s: failed KConfigNodeRead %R\n", __func__, rc));
-                            }
-                            else
-                                DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                        ("%s: failed KConfigOpenNodeRead %R\n", __func__, rc));
-                        }
-                        else
-                            DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                    ("%s: failed KConfigMake %R\n", __func__, rc));
-			
-                        rc = KDirectoryNativeDir (&pwd);
-                        if (rc == 0)
-                        {
-                            KPathType kpt = KDirectoryPathType (pwd, unix_magic_path);
-                            DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                    ("%s: %s %x\n", __func__, unix_magic_path, kpt));
-                            if ((kpt & ~ kptAlias) == kptFile)
-                            {
-                                z = strlen (unix_magic_path);
-                                if (magic_path_cursor != magic_path_buff)
-                                    *magic_path_cursor++ = ':';
-                                memcpy (magic_path_cursor, unix_magic_path, z);
-                                magic_path_cursor += z;
-                                *magic_path_cursor = '\0';
-                                DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                        ("%s: 2 magic_path_buff %s\n", __func__, magic_path_buff));
-                            }
-                        }
-                        else
-                            LOGERR (klogErr, rc, "Failed to open NativeDir for Magic");
-
-                        DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF),
-                                ("%s: loading path %s\n", __func__, magic_path_buff));
-
-			load_code = magic_load (self->cookie, magic_path_buff);
-			if (load_code != 0) /* defined as 0 success and -1 as fail */
-			{
-                            KFF_DEBUG (("%s: magic_load() failed with load code %d\n", __func__, load_code));
-			    rc = RC (rcFF, rcFileFormat, rcLoading, rcLibrary, rcUnexpected);
-			}
-			else
-			{
-			    *pft = &self->dad;
-                            KFF_DEBUG (("%s Success\n", __func__));
-			    return 0;
-			}
-			magic_close (self->cookie);
-		    }
-		}
-		else
-		    LOGERR (klogErr, rc, "Fail from KMagicTableInit");
-		KMagicTableRelease (self->table);
-	    }
-	    else
-		LOGERR (klogErr, rc, "Fail from KMagicTableMake");
-	}
-	else
-	    LOGERR (klogErr, rc, "Fail from KFileFormatInit");
-	free (self);
-    }
-    return rc;
-}
-
diff --git a/libs/kfs/file.c b/libs/kfs/file.c
deleted file mode 100644
index b331a9a..0000000
--- a/libs/kfs/file.c
+++ /dev/null
@@ -1,460 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-
-/*--------------------------------------------------------------------------
- * KFile
- *  a file
- */
-
-/* Destroy
- *  destroy file
- */
-LIB_EXPORT rc_t CC KFileDestroy ( KFile *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcDestroying, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . destroy ) ( self );
-    }
-
-    return RC ( rcFS, rcFile, rcDestroying, rcInterface, rcBadVersion );
-}
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-LIB_EXPORT struct KSysFile* CC KFileGetSysFile ( const KFile *self, uint64_t *offset )
-{
-    if ( offset != NULL )
-    {
-        * offset = 0;
-        if ( self != NULL )
-        {
-            switch ( self -> vt -> v1 . maj )
-            {
-            case 1:
-                return ( * self -> vt -> v1 . get_sysfile ) ( self, offset );
-            }
-        }
-    }
-    return NULL;
-}
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KFileAddRef ( const KFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KFile" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcFile, rcAttaching, rcRange, rcExcessive );
-        case krefNegative:
-            return RC ( rcFS, rcFile, rcAttaching, rcSelf, rcInvalid );
-        default:
-            break;
-        }
-    }
-    return 0;
-}
-
-/* Release
- *  discard reference to file
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KFileRelease ( const KFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KFile" ) )
-        {
-        case krefWhack:
-            if ( self -> dir != NULL )
-                return KDirectoryDestroyFile ( self -> dir, ( KFile* ) self );
-            return KFileDestroy ( ( KFile* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcFile, rcReleasing, rcRange, rcExcessive );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *  certain file types ( notably compressors ) will refuse random access
- *
- *  returns 0 if random access, error code otherwise
- */
-LIB_EXPORT rc_t CC KFileRandomAccess ( const KFile *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . random_access ) ( self );
-    }
-
-    return RC ( rcFS, rcFile, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-LIB_EXPORT uint32_t CC KFileType ( const KFile *self )
-{
-    if ( self == NULL )
-        return kfdNull;
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        if ( self -> vt -> v1 . min >= 1 )
-            return ( * self -> vt -> v1 . get_type ) ( self );
-        break;
-    }
-
-    return kfdInvalid;
-}
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-LIB_EXPORT rc_t CC KFileSize ( const KFile *self, uint64_t *size )
-{
-    if ( size == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-
-    * size = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . get_size ) ( self, size );
-    }
-
-    return RC ( rcFS, rcFile, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-LIB_EXPORT rc_t CC KFileSetSize ( KFile *self, uint64_t size )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcResizing, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcResizing, rcFile, rcNoPerm );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . set_size ) ( self, size );
-    }
-
-    return RC ( rcFS, rcFile, rcResizing, rcInterface, rcBadVersion );
-}
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - number of bytes actually read
- */
-LIB_EXPORT rc_t CC KFileRead ( const KFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    if ( num_read == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    * num_read = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcFS, rcFile, rcReading, rcFile, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcNull );
-    if ( bsize == 0 )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcInsufficient );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . read ) ( self, pos, buffer, bsize, num_read );
-    }
-
-    return RC ( rcFS, rcFile, rcReading, rcInterface, rcBadVersion );
-}
-
-/* ReadAll
- *  read from file until "bsize" bytes have been retrieved
- *  or until end-of-input
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of file.
- */
-LIB_EXPORT rc_t CC KFileReadAll ( const KFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    uint8_t *b;
-    size_t total, count;
-
-    if ( num_read == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    * num_read = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcFS, rcFile, rcReading, rcFile, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcNull );
-    if ( bsize == 0 )
-        return RC ( rcFS, rcFile, rcReading, rcBuffer, rcInsufficient );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        for ( rc = 0, b = buffer, total = 0; total < bsize; total += count )
-        {
-            count = 0;
-            rc = ( * self -> vt -> v1 . read ) ( self, pos + total, b + total, bsize - total, & count );
-            if ( rc != 0 )
-                break;
-            if ( count == 0 )
-                break;
-        }
-        break;
-    default:
-        return RC ( rcFS, rcFile, rcReading, rcInterface, rcBadVersion );
-    }
-
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-
-    return rc;
-}
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT ] - number of bytes actually written
- */
-LIB_EXPORT rc_t CC KFileWrite ( KFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    size_t ignore;
-    if ( num_writ == NULL )
-        num_writ = & ignore;
-
-    * num_writ = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcWriting, rcFile, rcNoPerm );
-
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . write ) ( self, pos, buffer, size, num_writ );
-    }
-
-    return RC ( rcFS, rcFile, rcWriting, rcInterface, rcBadVersion );
-}
-
-/* WriteAll
- *  write from file until "size" bytes have been transferred
- *  or until no further progress can be made
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-LIB_EXPORT rc_t CC KFileWriteAll ( KFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    const uint8_t *b;
-    size_t total, count;
-
-    size_t ignore;
-    if ( num_writ == NULL )
-        num_writ = & ignore;
-
-    * num_writ = 0;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcFS, rcFile, rcWriting, rcFile, rcNoPerm );
-
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        for ( rc = 0, b = buffer, total = 0; total < size; total += count )
-        {
-            count = 0;
-            rc = ( * self -> vt -> v1 . write ) ( self, pos + total, b + total, size - total, & count );
-            if ( rc != 0 )
-                break;
-            if ( count == 0 )
-                break;
-        }
-        break;
-    default:
-        return RC ( rcFS, rcFile, rcWriting, rcInterface, rcBadVersion );
-    }
-
-    * num_writ = total;
-    if ( total == size )
-        return 0;
-    if ( rc == 0 )
-        return RC ( rcFS, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return rc;
-}
-
-/* Init
- *  initialize a newly allocated file object
- */
-LIB_EXPORT rc_t CC KFileInit ( KFile *self, const KFile_vt *vt,
-    const char *classname, const char *fname,
-    bool read_enabled, bool write_enabled )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcSelf, rcNull );
-    if ( vt == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-    switch ( vt -> v1 . maj )
-    {
-    case 0:
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcInvalid );
-
-    case 1:
-        switch ( vt -> v1 . min )
-        {
-            /* ADD NEW MINOR VERSION CASES HERE */
-        case 1:
-#if _DEBUGGING
-            if ( vt -> v1 . get_type == NULL )
-                return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            /* no break */
-        case 0:
-#if _DEBUGGING
-        if ( vt -> v1 . write == NULL         ||
-             vt -> v1 . read == NULL          ||
-             vt -> v1 . set_size == NULL      ||
-             vt -> v1 . get_size == NULL      ||
-             vt -> v1 . random_access == NULL ||
-             vt -> v1 . get_sysfile == NULL   ||
-             vt -> v1 . destroy == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcNull );
-#endif
-            break;
-        default:
-            return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcBadVersion );
-        }
-        break;
-
-    default:
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcBadVersion );
-    }
-
-    self -> vt = vt;
-    self -> dir = NULL;
-    KRefcountInit ( & self -> refcount, 1, classname, "init", fname );
-    self -> read_enabled = ( uint8_t ) ( read_enabled != 0 );
-    self -> write_enabled = ( uint8_t ) ( write_enabled != 0 );
-
-    return 0;
-}
diff --git a/libs/kfs/fileformat-priv.h b/libs/kfs/fileformat-priv.h
deleted file mode 100644
index 4f19e62..0000000
--- a/libs/kfs/fileformat-priv.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_fileformat_priv_
-#define _h_fileformat_priv_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/debug.h>
-
-#define	DEBUG_KFF	1
-
-#ifndef	DEBUG_KFF
-#define	DEBUG_KFF	0
-#endif
-
-#ifdef _DEBUGGING
-#define FUNC_ENTRY() /* DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFFENTRY), ("Enter: %s\n", __func__)) */
-#define KFF_DEBUG(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_KFF), msg)
-#else
-#define FUNC_ENTRY()
-#define KFF_DEBUG(msg)
-#endif
-
-#define KFILEFORMAT_LATEST 1
-
-#define DESCRLEN_MAX	(256)
-
-typedef struct KFFTables KFFTables;
-/* -----
- * KFFTablesMake
- *	Build the tables that contain classes and types.
- *
- * This make installs only a default "unknown" description which
- * will end up with class id and file id of 0.  This FileId 0 will
- * be in class with id of 0.
- */
-rc_t KFFTablesMake (KFFTables ** kmmtp);
-
-/* -----
- * KFFTablesAddClass
- *	Add class with description (descr) to the tables
- *	new class id is returned to where pclass points.
- *	if pclass is NULL the new ID is not returned
- */
-rc_t KFFTablesAddClass (KFFTables * self,
-			KFileFormatClass * pclass, /* returned new ID */
-			const char * descr,
-			size_t descrlen);
-
-/* -----
- * KFFTablesAddType
- *	Add type with description (descr) to the tables
- *	new type id is returned to where ptype points.
- *	if ptype is NULL the new ID is not returned
- *	the new type will be in the refered class
- */
-rc_t KFFTablesAddType (KFFTables * self,
-		       KFileFormatType * ptype, /* returned new ID */
-		       const char * class,
-		       const char * type,
-		       size_t clen,
-		       size_t tlen);
-
-rc_t KFFTablesAddRef (const KFFTables * self);
-rc_t KFFTablesRelease (const KFFTables * cself);
-
-rc_t KFFTablesGetClassDescr (const KFFTables * self,
-			     KFileFormatClass tid,
-			     size_t * len,
-			     char ** pd);
-rc_t KFFTablesGetTypeDescr (const KFFTables * self,
-			    KFileFormatType tid,
-			    size_t * len,
-			    char ** pd);
-rc_t KFFTablesGetClassId (const KFFTables * self,
-			  const char ** pd,
-			  KFileFormatClass * cid);
-rc_t KFFTablesGetTypeId (const KFFTables * self,
-			 const char * pd,
-			 KFileFormatType * tid,
-			 KFileFormatClass * cid);
-
-
-
-
-
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_fileformat_priv_ */
diff --git a/libs/kfs/fileformat.c b/libs/kfs/fileformat.c
deleted file mode 100644
index 5c334c8..0000000
--- a/libs/kfs/fileformat.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <klib/rc.h>
-#include <kfs/fileformat.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <sysalloc.h>
-
-
-/* #include <kfs/directory.h> */
-
-#include "impl.h"
-
-#include <stdio.h> /* remove after debugging */
-#include <ctype.h>
-#include <string.h>
-
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * KFileFormat
- *  
- */
-
-
-/* Destroy
- *  destroy file
- */
-rc_t CC KFileFormatDestroy ( KFileFormat *self )
-{
-    FUNC_ENTRY();
-
-    if (self == NULL)
-        return RC (rcFS, rcFile, rcDestroying, rcSelf, rcNull);
-
-    switch (self->vt->v1 . maj)
-    {
-    case 1:
-        return (* self->vt->v1 . destroy) (self);
-    }
-
-    return RC (rcFS, rcFile, rcDestroying, rcInterface, rcBadVersion);
-}
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KFileFormatAddRef ( const KFileFormat *self )
-{
-    FUNC_ENTRY();
-    if (self != NULL)
-        atomic32_inc (& ((KFileFormat*) self)->refcount);
-    return 0;
-}
-
-/* Release
- *  discard reference to file
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KFileFormatRelease ( const KFileFormat *cself )
-{
-    FUNC_ENTRY();
-    if (cself != NULL)
-    {
-	KFileFormat *self = (KFileFormat*)cself;
-        if (atomic32_dec_and_test (&self->refcount))
-	    return  KFileFormatDestroy (self);
-    }
-    return 0;
-}
-
-
-/* Type
- *  returns a KFileFormatDesc
- *  [OUT] rc_t               return
- *  [IN]  const KFileFormat *  self         
- *  [IN]  void **            buffer       buffer to hold returned description
- *  [IN]  size_t             buffer_size  size of the buffer
- *  [OUT] char **            descr        text description of file type
- *  [IN]  size_t             descr_max    maximum size of string descr can hold
- *  [OUT] size_t *           descr_len    length of returned descr (not including NUL
- */
-LIB_EXPORT rc_t CC KFileFormatGetTypePath ( const KFileFormat *self, 
-			     const struct KDirectory * dir, const char * path,
-			     KFileFormatType * type, KFileFormatClass * class,
-			     char * description, size_t descriptionmax,
-			     size_t * descriptionlength )
-{
-    FUNC_ENTRY();
-
-    if (self == NULL)
-        return RC (rcFF, rcFileFormat, rcClassifying, rcSelf, rcNull);
-
-    switch (self->vt->v1.maj)
-    {
-    case 1:
-        if (self->vt->v1.min >= 1)
-	    return (* self->vt->v1 . gettypepath) (self, dir, path, type, class,
-						   description, descriptionmax,
-						   descriptionlength);
-        break;
-    }
-    return RC (rcFF, rcFileFormat, rcClassifying, rcInterface, rcBadVersion);
-}
-
-LIB_EXPORT rc_t CC KFileFormatGetTypeBuff ( const KFileFormat *self, const void * buff, size_t buff_len,
-			     KFileFormatType * type, KFileFormatClass * class,
-			     char * description, size_t descriptionmax,
-			     size_t * descriptionlength )
-{
-    FUNC_ENTRY();
-
-    if (self == NULL)
-        return RC (rcFF, rcFileFormat, rcClassifying, rcSelf, rcNull);
-
-    switch (self->vt->v1.maj)
-    {
-    case 1:
-        if (self->vt->v1.min >= 1)
-	    return (* self->vt->v1 . gettypebuff) (self, buff, buff_len, type, class,
-						   description, descriptionmax,
-						   descriptionlength);
-        break;
-    }
-    return RC (rcFF, rcFileFormat, rcClassifying, rcInterface, rcBadVersion);
-}
-
-LIB_EXPORT rc_t CC KFileFormatGetClassDescr ( const KFileFormat *self, KFileFormatClass c,
-			       char * description, size_t descriptionmax )
-{
-    rc_t rc;
-    size_t max;
-
-#undef ERROR
-#define ERROR "ERROR"
-#undef NOT_FOUND
-#define NOT_FOUND "NOT FOUND"
-
-    FUNC_ENTRY();
-
-    if (c < kffcError)
-    {
-    error:
-	max = (sizeof (ERROR) > descriptionmax-1) ? descriptionmax-1 : sizeof (ERROR)-1;
-	memcpy (description, ERROR, max);
-	description[max] = '\0';
-	return 0;
-    }
-    else if (c == kffcNotFound)
-    {
-	max = (sizeof (NOT_FOUND) > descriptionmax-1) ? descriptionmax-1 : sizeof (NOT_FOUND)-1;
-	memcpy (description, NOT_FOUND, max);
-	description[max] = '\0';
-	return 0;
-    }
-    else
-    {
-	char * cp;
-	size_t z;
-
-	rc = KFFTablesGetClassDescr(self->tables, c, &z, &cp);
-	if (rc)
-	    goto error;
-	max = (z > descriptionmax-1) ? descriptionmax-1 : z;
-	memcpy (description, cp, max);
-	description[max] = '\0';
-	return 0;
-    }
-
-#undef ERROR
-#undef NOT_FOUND
-}
-static
-rc_t KFileFormatInitTypeAndClass (KFileFormat *self, const char * typeAndClass,
-			    size_t len)
-{
-    rc_t rc;
-    const char * type;
-    const char * class;
-    const char * tab;
-    const char * newline;
-    const char * line;
-    const char * limit;
-
-    FUNC_ENTRY();
-
-    rc = 0;
-    limit = typeAndClass + len;
-    for (line = typeAndClass; line < limit; line = newline+1)
-    {
-	for (type = line; isspace (*type) && len; len--, type++)
-	{
-	    if (len == 0)
-		break;
-	}
-	newline = memchr (type, '\n', len);
-	if (newline == NULL)
-	    newline = type + len;
-	if (*type == '#')
-	{
-	    /* -----
-	     * skip this line
-	     */
-	    len -= newline+1 - type;
-	    continue;
-	}
-	tab = memchr (type, '\t', len);
-	if (tab == NULL)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No <TAB> between type and class");
-	    break;
-	}
-	class = tab + 1;
-	for ( len -= class - line;
-	      isspace (*class); len--, class++)
-	{
-	    if (len == 0)
-	    {
-		rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-		LOGERR (klogFatal, rc, "No class after <TAB>");
-		break;
-	    }
-	}
-	if (newline == class)
-	{
-	    rc = RC (rcFF, rcFileFormat, rcConstructing, rcFile, rcInvalid);
-	    LOGERR (klogFatal, rc, "No class after whitespace");
-	    break;
-	}
-	rc = KFFTablesAddType (self->tables, NULL, class, type, newline-class, tab-type);
-	if (rc != 0)
-	    break;
-    }
-
-    return rc;
-}
-
-rc_t CC KFileFormatInit ( KFileFormat *self, const KFileFormat_vt *vt,
-		      const char * typeAndClass, size_t len )
-{
-    rc_t rc = 0;
-
-    FUNC_ENTRY();
-
-    self->vt = vt;
-    atomic32_set (&self->refcount,1);
-
-    rc = KFFTablesMake(&self->tables);
-    if (rc == 0)
-    {
-	rc = KFileFormatInitTypeAndClass (self, typeAndClass, len);
-
-
-        /* memory leak?  If Tables Make succeeds and InitType and Class fails do we leak? */
-
-    }
-    return rc;
-}
-
-
-
-
diff --git a/libs/kfs/gzip.c b/libs/kfs/gzip.c
deleted file mode 100644
index ebf088f..0000000
--- a/libs/kfs/gzip.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-struct KGZipFile;
-#define KFILE_IMPL struct KGZipFile
-
-#include <kfs/extern.h>
-#include <kfs/impl.h>  /* KFile_vt_v1 */
-#include <kfs/gzip.h>  /* KFileMakeGzipFor... */
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <sysalloc.h>
-
-#include <zlib.h>      /* z_stream */
-#include <assert.h>
-#include <stdlib.h>    /* malloc */
-
-#ifdef _DEBUGGING
-#define GZIP_DEBUG(msg) DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_GZIP), msg)
-#else
-#define GZIP_DEBUG(msg)
-#endif
-
-/***************************************************************************************/
-/* Gzip File                                                                     */
-/***************************************************************************************/
-
-#define GZFCHUNK 0x20000    /* 128K */
-/** Gzip KFile structure */
-struct KGZipFile {
-    KFile dad;
-    KFile *file; /* inderlying KFile */
-    uint64_t filePosition;
-    uint64_t myPosition;
-    z_stream strm;
-    unsigned char buff[GZFCHUNK]; /* buffer to cache KFile data */
-    bool completed;
-};
-typedef struct KGZipFile KGZipFile;
-
-/* virtual functions declarations (definitions for unsupported ) ***********************/
-
-static struct KSysFile *CC s_GetSysFile(const KGZipFile *self,
-    uint64_t *offset)
-{ return NULL; }
-
-static rc_t CC s_FileRandomAccess(const KGZipFile *self)
-{ return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported ); }
-
-static uint32_t CC s_FileType ( const KGZipFile *self )
-{ return KFileType ( self -> file ); }
-
-static rc_t CC s_FileSize(const KGZipFile *self, uint64_t *size)
-{ return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported ); }
-
-static rc_t CC s_FileSetSize(KGZipFile *self,
-    uint64_t size)
-{ return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported ); }
-
-/* read-only methods *******************************************************************/
-
-static rc_t CC KGZipFile_InDestroy(KGZipFile *self);
-
-static rc_t CC KGZipFile_InRead(const KGZipFile *cself,
-    uint64_t pos,
-    void *buffer,
-    size_t bsize,
-    size_t *num_read);
-
-static rc_t CC KGZipFile_InWrite(KGZipFile *self,
-    uint64_t pos,
-    const void *buffer,
-    size_t size,
-    size_t *num_writ)
-{ return RC ( rcFS, rcFile, rcWriting, rcFunction, rcUnsupported ); }
-
-/** virtual table **********************************************************************/
-static KFile_vt_v1 s_vtKFile_InGz = {
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KGZipFile_InDestroy,
-    s_GetSysFile,
-    s_FileRandomAccess,
-    s_FileSize,
-    s_FileSetSize,
-    KGZipFile_InRead,
-    KGZipFile_InWrite,
-
-    /* 1.1 */
-    s_FileType
-};
-
-#define WINDOW_BITS (15 + 16)
-
-/** Factory method definition **********************************************************/
-
-LIB_EXPORT rc_t CC KFileMakeGzipForRead( const struct KFile **result,
-    const struct KFile *file )
-{
-    rc_t rc;
-    z_stream* strm;
-    KGZipFile *obj;
-
-    if ( result == NULL || file == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-
-    obj = (KGZipFile*) malloc(sizeof(KGZipFile));
-    if (!obj)
-        return RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-
-    rc = KFileInit(&obj->dad, (const KFile_vt*) &s_vtKFile_InGz, "KGZipFile", "no-name", true, false);
-    if (rc != 0) {
-        free(obj);
-        return rc;
-    }
-
-    strm = &obj->strm;
-    strm->zalloc   = Z_NULL;
-    strm->zfree    = Z_NULL;
-    strm->opaque   = Z_NULL;
-    strm->avail_in = 0;
-    strm->next_in  = Z_NULL;
-
-    /* TBD - this should check gzlib error codes */
-    if (inflateInit2(strm, WINDOW_BITS) != Z_OK) {
-        free(obj);
-        return RC ( rcFS, rcFile, rcConstructing, rcNoObj, rcUnknown );
-    }
-
-        obj->myPosition   = 0;
-        obj->filePosition = 0;
-
-    rc = KFileAddRef(file);
-    if ( rc != 0 )
-    {
-        obj->file = NULL;
-        KGZipFile_InDestroy ( obj );
-    }
-    else
-    {
-        obj->file = (KFile*) file;
-        obj->completed = true; /* we could have an empty file and this would be okay */
-        *result = &obj->dad;
-    }
-
-    return rc;
-}
-
-/* private functions declarations ******************************************************/
-
-static rc_t z_read ( KGZipFile * self, void * buffer, size_t bsize, size_t * num_read );
-static rc_t z_skip (KGZipFile *self, uint64_t pos);
-
-/* virtual functions definitions *******************************************************/
-
-static rc_t CC KGZipFile_InDestroy(KGZipFile *self) {
-    rc_t rc = KFileRelease(self->file);
-    if (rc == 0) {
-        inflateEnd(&self->strm);
-        free(self);
-    }
-
-    return rc;
-}
-
-static rc_t CC KGZipFile_InRead(const KGZipFile *cself,
-    uint64_t pos,
-    void *buffer,
-    size_t bsize,
-    size_t *num_read)
-{
-    KGZipFile *self = (KGZipFile*) cself;
-    rc_t rc = 0;
-
-    size_t numRead = 0, ignore;
-    if (!num_read)
-    {   num_read = &ignore; }
-
-    *num_read = 0;
-
-    if (!cself || !buffer)
-        return RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-
-    if (!bsize)
-    {   return 0; }
-
-    if (pos < self->myPosition)
-    {
-	return RC ( rcFS, rcFile, rcReading, rcParam, rcInvalid );
-    }
-
-    GZIP_DEBUG(("%s: pos %lu bsize %zu\n", __func__, pos, bsize));
-
-    if (pos > self->myPosition)
-    {
-	rc =  z_skip (self, pos);
-	if (rc)
-	    return rc;
-	if (pos != self->myPosition)
-	    return 0;
-    }
-
-    rc = z_read ( self, buffer, bsize, &numRead );
-    if (rc)
-	return rc;
-
-    *num_read = numRead;
-
-    self->myPosition += numRead;
-
-    return 0;
-}
-
-/* private functions definitions *******************************************************/
-
-static rc_t z_read ( KGZipFile * self, void * buffer, size_t bsize, size_t * _num_read )
-{
-    rc_t rc = 0;
-    size_t num_read, bleft ;
-
-    GZIP_DEBUG(("%s: Enter\n",__func__));
-
-
-    for (num_read = 0, bleft=bsize; bleft  > 0; )
-    {
-        z_stream * strm = &self->strm;
-        size_t src_read;
-        int zret;
-        
-        strm->next_out  = (uint8_t*)buffer + num_read;
-        strm->avail_out = bleft;
-
-        GZIP_DEBUG(("%s: call inflate\n",__func__));
-
-
-        GZIP_DEBUG(("%s: before inflate next_in %14p avail_in %6u total_in %10lu next_out %14p avail_out %6u total_out %10lu\n",
-                    __func__, strm->next_in, strm->avail_in, strm->total_in,
-                    strm->next_out, strm->avail_out, strm->total_out));
-
-        zret = inflate (strm, Z_NO_FLUSH);
-
-        GZIP_DEBUG(("%s: after inflate  next_in %14p avail_in %6u total_in %10lu next_out %14p avail_out %6u total_out %10lu\n",
-                    __func__, strm->next_in, strm->avail_in, strm->total_in,
-                    strm->next_out, strm->avail_out, strm->total_out));
-
-	bleft = strm->avail_out;
-	num_read = bsize - bleft;
-
-        switch (zret)
-        {
-            /* unexpected error returns from zlib */
-        default:
-        case Z_ERRNO:
-            GZIP_DEBUG(("%s: unknown error %d\n",__func__, zret));
-            return RC (rcFS, rcFile, rcReading, rcFile, rcUnknown);
-
-            /* known unfixable errors */
-        case Z_STREAM_ERROR:
-            GZIP_DEBUG(("%s: stream error %d\n",__func__, zret));
-            return RC (rcFS, rcFile, rcReading, rcSelf, rcCorrupt);
-
-        case Z_DATA_ERROR:
-            GZIP_DEBUG(("%s: data error %d\n",__func__, zret));
-            return RC (rcFS, rcFile, rcReading, rcData, rcCorrupt);
-
-        case Z_STREAM_END:
-            GZIP_DEBUG(("%s: stream end %d\n",__func__, zret));
-            self->completed = true;
-            zret = inflateReset (strm);
-            GZIP_DEBUG (("%s: recall inflateReset zret = %d\n",__func__,zret));
-            switch (zret)
-            {
-            case Z_OK:
-                break;
-            default:
-                rc = RC (rcFS, rcFile, rcReading, rcData, rcInvalid);
-                break;
-            }
-            break;
-
-        case Z_BUF_ERROR:
-            GZIP_DEBUG(("%s: buf error %d\n",__func__, zret));
-            if (strm->avail_out > 0)
-            {
-                rc = KFileRead (self->file, self->filePosition, 
-                                self->buff, sizeof (self->buff), &src_read);
-                if (rc)
-                    break;
-
-                strm->avail_in = src_read;
-                self->filePosition += src_read;
-                strm->next_in = self->buff;
-                if (src_read)
-                    self->completed = false;
-                else if (self->completed)
-                    goto done;
-                else if (zret == Z_BUF_ERROR)
-                {                
-                    /* this is either a truncated file or a blocked stream
-                     * code outside of here has to handle it */
-                    GZIP_DEBUG(("%s: truncated input\n",__func__));
-                    rc = RC (rcFS, rcFile, rcReading, rcData, rcInsufficient);
-                    break;
-                }
-            }
-            break;
-        case Z_OK:
-            break;
-        }
-        if (rc)
-            break;
-    }
-done:
-    *_num_read = num_read;
-    return rc;
-}
-
-static rc_t z_skip (KGZipFile *self, uint64_t pos)
-{
-    rc_t rc = 0;
-    size_t num_read = 0; /* superfluous to quiet compiler */
-    size_t to_read;
-    uint8_t buff [ 32 * 1024 ];
-
-    GZIP_DEBUG(("%s: enter pos %lu\n",__func__, pos));
-
-    for ( to_read = sizeof buff; self -> myPosition < pos; self -> myPosition += num_read )
-    {
-	if (self->myPosition + sizeof buff > pos)
-	    to_read = pos - self->myPosition;
-
-        GZIP_DEBUG(("%s: call z_read to_read %zu \n",__func__));
-
-	rc = z_read ( self, buff, to_read, &num_read );
-
-        GZIP_DEBUG(("%s: return z_read num_read %zu \n",__func__));
-
-	if ( rc )
-	    break;
-
-	if (num_read == 0)
-	    break;
-
-    }
-    return rc;
-}
-
-/***************************************************************************************/
-/* Gzip Output File                                                                    */
-/***************************************************************************************/
-
-/* write-only methods ******************************************************************/
-
-static rc_t CC KGZipFile_OutDestroy(KGZipFile *self);
-
-static rc_t CC KGZipFile_OutRead(const KGZipFile *cself,
-    uint64_t pos,
-    void *buffer,
-    size_t bsize,
-    size_t *num_read)
-{ return RC ( rcFS, rcFile, rcReading, rcFunction, rcUnsupported ); }
-
-static rc_t CC KGZipFile_OutWrite(KGZipFile *self,
-    uint64_t pos,
-    const void *buffer,
-    size_t bsize,
-    size_t *num_writ);
-
-/** virtual table **********************************************************************/
-static KFile_vt_v1 s_vtKFile_OutGz = {
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KGZipFile_OutDestroy,
-    s_GetSysFile,
-    s_FileRandomAccess,
-    s_FileSize,
-    s_FileSetSize,
-    KGZipFile_OutRead,
-    KGZipFile_OutWrite,
-
-    /* 1.1 */
-    s_FileType
-};
-
-/** Factory method definition **********************************************************/
-LIB_EXPORT rc_t CC KFileMakeGzipForWrite( struct KFile **result,
-    struct KFile *file )
-{
-    rc_t rc;
-    z_stream* strm;
-    KGZipFile *obj;
-
-    if ( result == NULL || file == NULL )
-        return RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-
-    obj = (KGZipFile*) malloc(sizeof(KGZipFile));
-    if (!obj)
-        return RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-
-    rc = KFileInit(&obj->dad, (const KFile_vt*) &s_vtKFile_OutGz, "KGZipFile", "no-name", false, true);
-    if (rc != 0) {
-        free(obj);
-        return rc;
-    }
-
-    strm = &obj->strm;
-    strm->zalloc   = Z_NULL;
-    strm->zfree    = Z_NULL;
-    strm->opaque   = Z_NULL;
-    strm->avail_in = 0;
-    strm->next_in  = Z_NULL;
-
-    /* TBD - this should check gzlib error codes */
-    if (deflateInit2(strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, WINDOW_BITS,
-        8, /* The default value for the memLevel parameter is 8 */
-        Z_DEFAULT_STRATEGY) != Z_OK)
-    {
-        free(obj);
-        return RC ( rcFS, rcFile, rcConstructing, rcNoObj, rcUnknown );
-    }
-
-    obj->myPosition   = 0;
-    obj->filePosition = 0;
-    obj->completed    = false;
-
-    rc = KFileAddRef(file);
-    if ( rc != 0 )
-    {
-        obj->file = NULL;
-        KGZipFile_OutDestroy ( obj );
-    }
-    else
-    {
-        obj->file = file;
-        *result = &obj->dad;
-    }
-
-    return rc;
-}
-
-/* private functions declarations ******************************************************/
-
-static int s_GzipAndWrite(KGZipFile *self,
-    int flush,
-    size_t *num_writ,
-    rc_t *rc);
-
-/* virtual functions definitions *******************************************************/
-
-static rc_t CC KGZipFile_OutDestroy( KGZipFile *self)
-{
-    rc_t rc;
-    if ( !self->completed )
-    {
-        int ret;
-        size_t wrtn;
-        z_stream* strm = &self->strm;
-        strm->avail_in = 0;
-        strm->next_in = Z_NULL;
-
-        ret = s_GzipAndWrite( self, Z_FINISH, &wrtn, &rc );
-        if ( rc != 0 )
-            return rc;
-
-        assert( ret == Z_STREAM_END ); /* stream will be complete */
-        
-        deflateEnd( strm ); /* clean up */
-        self->completed = true;
-    }
-
-    rc = KFileRelease( self->file );
-    if ( rc == 0 )
-        free( self );
-
-    return rc;
-}
-
-static rc_t CC KGZipFile_OutWrite( struct KGZipFile *self,
-    uint64_t pos,
-    const void *buffer,
-    size_t bsize,
-    size_t *num_writ )
-{
-    int ret;
-    rc_t rc;
-    z_stream* strm;
-    size_t ignore;
-    if (!num_writ)
-    {   num_writ = &ignore; }
-
-    *num_writ = 0;
-
-    if ( pos != self->myPosition )
-        return RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-
-    strm = &self->strm;
-    strm->next_in  = (Bytef*) buffer;
-    strm->avail_in = bsize;
-
-    rc = 0;
-    ret = s_GzipAndWrite( self, Z_NO_FLUSH, num_writ, &rc );
-    if ( rc != 0 )
-        return rc;
-    assert( ret != Z_STREAM_END );  /* stream will be complete */
-
-    self->myPosition += * num_writ;
-
-    return 0;
-}
-
-/* private functions definitions *******************************************************/
-
-static int s_GzipAndWrite ( KGZipFile *self,
-    int flush,
-    size_t *num_writ,
-    rc_t *rc )
-{
-    z_stream *strm;
-    uInt avail_in;
-    int ret;
-
-    assert( self && num_writ && rc );
-
-    *num_writ = 0;
-    strm = &self->strm;
-    avail_in = strm->avail_in;
-    ret = 0;
-    /* run deflate() on input until output buffer not full, finish
-       compression if all of source has been read in */
-    do {
-        uint32_t have;
-        size_t written;
-        strm->avail_out = sizeof( self->buff );
-        strm->next_out = self->buff;
-        ret = deflate( strm, flush );    /* no bad return value */
-/*
-        OUTMSG (( "deflate: ret=%u | avail-out+%u\n", ret, strm->avail_out ));
-*/
-        assert( ret != Z_STREAM_ERROR );  /* state not clobbered */
-        have = sizeof( self->buff ) - strm->avail_out;
-        written = 0;
-        *rc = KFileWrite( self->file, self->filePosition, self->buff, have, &written );
-        /* this is wrong - Z_ERRNO would tell us to check errno for error
-           but the error is in *rc */
-        if ( *rc != 0 )
-            return Z_ERRNO;
-        self->filePosition += written;
-        *num_writ = avail_in - strm->avail_in;
-    } while ( strm->avail_out == 0 );
-
-    assert( strm->avail_in == 0 );     /* all input will be used */
-    return ret;
-}
-
-/* EOF */
diff --git a/libs/kfs/impl.h b/libs/kfs/impl.h
deleted file mode 100644
index ae37b37..0000000
--- a/libs/kfs/impl.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_impl_
-#define _h_kfs_impl_
-
-#include <klib/rc.h>
-#include <atomic.h>
-#include <kfs/fileformat.h>
-#include "fileformat-priv.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-
-typedef union KFileFormat_vt KFileFormat_vt;
-
-
-/*--------------------------------------------------------------------------
- * KFileFormat
- *  a virtual file
- */
-struct KFileFormat
-{
-    const KFileFormat_vt *vt;
-    atomic32_t refcount;
-    KFFTables * tables;
-};
-
-#ifndef KFILEFORMAT_IMPL
-#define KFILEFORMAT_IMPL KFileFormat
-#endif
-
-typedef struct KFileFormat_vt_v1 KFileFormat_vt_v1;
-struct KFileFormat_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t (*destroy) (KFILEFORMAT_IMPL * self);
-    rc_t (*gettypebuff) (const KFILEFORMAT_IMPL *self, const void * buff, size_t buff_len,
-			 KFileFormatType * type, KFileFormatClass * class,
-			 char * description, size_t descriptionmax,
-			 size_t * descriptionlength);
-    rc_t (*gettypepath) (const KFILEFORMAT_IMPL *self, const struct KDirectory * dir, const char * path,
-			 KFileFormatType * type, KFileFormatClass * class,
-			 char * description, size_t descriptionmax,
-			 size_t * descriptionlength);
-
-    /* end minor version == 0 */
-    /* start minor version == 1 */
-    /* end minor version == 1 */
-    /* end version == 1.x */
-};
-
-union KFileFormat_vt
-{
-    KFileFormat_vt_v1 v1;
-};
-
-/* Init
- *  initialize a newly allocated file object
- */
-rc_t KFileFormatInit (KFileFormat *self, const KFileFormat_vt *vt,
-		      const char * typeAndClass, size_t len);
-
-/* Destroy
- *  destroy file
- */
-rc_t KFileFormatDestroy ( KFileFormat *self );
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-struct KSysFile *KFileFormatGetSysFile ( const KFileFormat *self, uint64_t *offset );
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_impl_ */
diff --git a/libs/kfs/karc-priv.h b/libs/kfs/karc-priv.h
deleted file mode 100644
index bd96614..0000000
--- a/libs/kfs/karc-priv.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_arc_priv_h_
-#define _h_kfs_arc_priv_h_
-
-typedef struct KArcTOCNode KArcTOCNode;
-
-#ifdef _DEBUGGING
-#define FUNC_ENTRY() DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_ARCENTRY), ("Enter: %s\n", __func__))
-#define ARC_DEBUG(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_ARC), msg)
-#else
-#define FUNC_ENTRY()
-#define ARC_DEBUG(msg)
-#endif
-
-
-
-#endif /* #ifndef _h_kfs_arc_priv_h_ */
-/* end of file */
diff --git a/libs/kfs/kfs-priv.h b/libs/kfs/kfs-priv.h
deleted file mode 100644
index f994f3f..0000000
--- a/libs/kfs/kfs-priv.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_priv_
-#define _h_kfs_priv_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KFile;
-struct KMD5File;
-
-/* exported private functions
- */
-struct KFile *KMD5FileToKFile ( struct KMD5File *self );
-struct KFile const *KMD5FileToKFileConst ( struct KMD5File const *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kfs_priv_ */
diff --git a/libs/kfs/libkdl.vers b/libs/kfs/libkdl.vers
deleted file mode 100644
index 7dea76e..0000000
--- a/libs/kfs/libkdl.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.1
diff --git a/libs/kfs/libkff.vers b/libs/kfs/libkff.vers
deleted file mode 100644
index 21e8796..0000000
--- a/libs/kfs/libkff.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.3
diff --git a/libs/kfs/libkfs.vers b/libs/kfs/libkfs.vers
deleted file mode 100644
index 1892b92..0000000
--- a/libs/kfs/libkfs.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.3.2
diff --git a/libs/kfs/lockfile.c b/libs/kfs/lockfile.c
deleted file mode 100644
index 2533cc3..0000000
--- a/libs/kfs/lockfile.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-struct KRemoveLockFileTask;
-#define KTASK_IMPL struct KRemoveLockFileTask
-
-#include <kfs/extern.h>
-#include <kfs/lockfile.h>
-#include <kfs/impl.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kproc/task.h>
-#include <kproc/impl.h>
-#include <kproc/procmgr.h>
-#include <klib/text.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#if _DEBUGGING
-#define CRIPPLE_CLEANUP 0
-#define DISABLE_CLEANUP 0
-#endif
-
-/*--------------------------------------------------------------------------
- * KRemoveLockFileTask
- */
-typedef struct KRemoveLockFileTask KRemoveLockFileTask;
-struct KRemoveLockFileTask
-{
-    KTask dad;
-    KDirectory *dir;
-    char path [ 1 ];
-};
-
-static
-rc_t CC KRemoveLockFileTaskWhack ( KRemoveLockFileTask *self )
-{
-    rc_t rc = KDirectoryRelease ( self -> dir );
-    KTaskDestroy ( & self -> dad, "KRemoveLockFileTask" );
-    free ( self );
-    return rc;
-}
-
-static
-rc_t CC KRemoveLockFileTaskExecute ( KRemoveLockFileTask *self )
-{
-    return KDirectoryRemove ( self -> dir, true, self -> path );
-}
-
-static
-KTask_vt_v1 KRemoveLockFileTask_vt =
-{
-    1, 0,
-    KRemoveLockFileTaskWhack,
-    KRemoveLockFileTaskExecute
-};
-
-static
-rc_t KRemoveLockFileTaskMake ( KTask **task, KDirectory *dir, const char *path )
-{
-    rc_t rc;
-    size_t path_size = string_size ( path );
-    KRemoveLockFileTask *t = malloc ( sizeof * t + path_size );
-    if ( t == NULL )
-        rc = RC ( rcFS, rcLock, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KTaskInit ( & t -> dad, ( const KTask_vt* ) & KRemoveLockFileTask_vt, "KRemoveLockFileTask", path );
-        if ( rc == 0 )
-        {
-            rc = KDirectoryAddRef ( t -> dir = dir );
-            if ( rc == 0 )
-            {
-                strcpy ( t -> path, path );
-                * task = & t -> dad;
-                return 0;
-            }
-        }
-
-        free ( t );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KLockFile
- *  a mutual exclusion lock on a file
- *  the lock is acquired upon creation
- *  and released upon destruction
- *
- * NB - only guaranteed to work when used from a single host
- */
-struct KLockFile
-{
-    KProcMgr *pmgr;
-    KTask *cleanup;
-    KTaskTicket ticket;
-    KRefcount refcount;
-};
-
-static
-rc_t KLockFileWhack ( KLockFile *self )
-{
-    rc_t rc;
-
-    /* remove task from cleanup queue */
-    if ( self -> pmgr != NULL )
-    {
-        rc = KProcMgrRemoveCleanupTask ( self -> pmgr, & self -> ticket );
-        KProcMgrRelease ( self -> pmgr );
-    }
-
-#if ! CRIPPLE_CLEANUP && ! DISABLE_CLEANUP
-    /* remove the lock file from file system */
-    rc = KTaskExecute ( self -> cleanup );
-#endif
-    KTaskRelease ( self -> cleanup );
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- */
-LIB_EXPORT rc_t CC KLockFileAddRef ( const KLockFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KLockFile" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcLock, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Release
- */
-LIB_EXPORT rc_t CC KLockFileRelease ( const KLockFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KLockFile" ) )
-        {
-        case krefWhack:
-            return KLockFileWhack ( ( KLockFile* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcLock, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Make
- */
-static
-rc_t KLockFileMake ( KLockFile **lock, KDirectory *dir, const char *path )
-{
-    rc_t rc;
-    KLockFile *f = malloc ( sizeof * f );
-    if ( f == NULL )
-        rc = RC ( rcFS, rcLock, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KRemoveLockFileTaskMake ( & f -> cleanup, dir, path );
-        if ( rc == 0 )
-        {
-#if ! DISABLE_CLEANUP
-            /* register cleanup task with proc mgr */
-            rc = KProcMgrMakeSingleton ( & f -> pmgr );
-            if ( rc == 0 )
-                rc = KProcMgrAddCleanupTask ( f -> pmgr, & f -> ticket, f -> cleanup );
-            else
-#else
-            f -> pmgr = NULL;
-#endif
-            {
-                /* this is allowed to fail if mgr has not been initialized */
-                memset ( & f -> ticket, 0, sizeof f -> ticket );
-                rc = 0;
-            }
-
-            if ( rc == 0 )
-            {
-                KRefcountInit ( & f -> refcount, 1, "KLockFile", "make", path );
-                * lock = f;
-                return 0;
-            }
-
-            if ( f -> pmgr != NULL )
-                KProcMgrRelease ( f -> pmgr );
-        }
-
-        free ( f );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  interface extensions
- */
-
-
-/* CreateLockFile
- *  attempts to create a KLockFile
- *
- *  "lock" [ OUT ] - return parameter for newly created lock file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting lock file
- */
-LIB_EXPORT rc_t CC KDirectoryVCreateLockFile ( KDirectory *self,
-    KLockFile **lock, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( lock == NULL )
-        rc = RC ( rcFS, rcFile, rcLocking, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcLocking, rcSelf, rcNull );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcLocking, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcLocking, rcPath, rcEmpty );
-        else
-        {
-            char full [ 4096 ];
-            rc = KDirectoryVResolvePath ( self, false, full, sizeof full, path, args );
-            if ( rc == 0 )
-            {
-                KFile *lock_file;
-                rc = KDirectoryCreateFile ( self, & lock_file, false, 0600, kcmCreate | kcmParents, full );
-                if ( rc == 0 )
-                {
-                    rc_t rc2;
-
-                    /* no longer need the file - not going to write to it anyway */
-                    KFileRelease ( lock_file );
-
-                    /* we have the lock */
-                    rc = KLockFileMake ( lock, self, full );
-                    if ( rc == 0 )
-                        return 0;
-
-                    /* must unlink lockfile */
-                    rc2 = KDirectoryRemove ( self, true, full );
-                    if ( rc2 != 0 )
-                        /* issue a report */;
-                }
-                else if ( GetRCState ( rc ) == rcExists )
-                {
-                    /* map the rc to kproc type values */
-                    rc = RC ( rcFS, rcFile, rcLocking, rcLocking, rcBusy );
-                }
-                else
-                {
-                    rc = ResetRCContext ( rc, rcFS, rcFile, rcLocking );
-                }
-            }
-        }
-
-        * lock = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryCreateLockFile ( KDirectory *self,
-    KLockFile **lock, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDirectoryVCreateLockFile ( self, lock, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* CreateExclusiveAccessFile
- *  opens a file with exclusive write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-
-LIB_EXPORT rc_t CC KDirectoryCreateExclusiveAccessFile ( KDirectory *self, KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = KDirectoryVCreateExclusiveAccessFile ( self, f, update, access, mode, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
diff --git a/libs/kfs/md5.c b/libs/kfs/md5.c
deleted file mode 100644
index e172b0c..0000000
--- a/libs/kfs/md5.c
+++ /dev/null
@@ -1,1901 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-struct KMD5File;
-#define KFILE_IMPL struct KMD5File
-
-#include <kfs/extern.h>
-#include <kfs/md5.h>
-#include <kfs/impl.h>
-#include <klib/checksum.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#define MD5_DBG_REF(msg) DBGMSG(DBG_LEGREF,DBG_FLAG(DBG_LEGREF_MD5), msg)
-
-
-/*--------------------------------------------------------------------------
- * KMD5SumEntry
- *  describes an entry into an MD5 checksum file
- */
-typedef struct KMD5SumEntry KMD5SumEntry;
-struct KMD5SumEntry
-{
-    SLNode n;
-    uint8_t digest [ 16 ];
-    bool bin;
-    char path [ 1 ];
-};
-
-static
-void CC KMD5SumEntryWhack ( SLNode *n, void *ignore )
-{
-    free ( n );
-}
-
-typedef struct KMD5SumEntryFlushData KMD5SumEntryFlushData;
-struct KMD5SumEntryFlushData
-{
-    uint64_t pos;
-    KFile *f;
-    rc_t rc;
-};
-
-static
-bool CC KMD5SumEntryFlush ( SLNode *n, void *data )
-{
-    KMD5SumEntryFlushData *pb = data;
-    const KMD5SumEntry *self = ( const KMD5SumEntry* ) n;
-    int i, len;
-    size_t num_writ, total;
-    char line [ 4096 + 40 ];
-
-    for ( total = 0, i = 0; i < 16; ++ i )
-    {
-        len = snprintf ( & line [ total ], sizeof line - total,
-            "%02x", self -> digest [ i ] );
-        assert ( len == 2 );
-        total += len;
-    }
-
-    len = snprintf ( & line [ total ], sizeof line - total,
-        " %c%s\n", self -> bin ? '*' : ' ', self -> path );
-
-    if ( len < 0 )
-    {
-        pb -> rc = RC ( rcFS, rcFile, rcFormatting, rcString, rcExcessive );
-        return true;
-    }
-
-    total += len;
-    if ( total >= sizeof line )
-    {
-        pb -> rc = RC ( rcFS, rcFile, rcFormatting, rcString, rcExcessive );
-        return true;
-    }
-
-    pb -> rc = KFileWrite ( pb -> f, pb -> pos, line, total, & num_writ );
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> pos += num_writ;
-
-    if ( num_writ == total )
-        return false;
-
-    pb -> rc = RC ( rcFS, rcFile, rcFormatting, rcTransfer, rcIncomplete );
-    return true;
-}
-
-static
-rc_t KMD5SumEntryMake ( KMD5SumEntry **ep,
-    const char *path, const uint8_t digest [ 16 ], bool bin )
-{
-    KMD5SumEntry *entry = malloc ( sizeof * entry + strlen ( path ) );
-    if ( entry == NULL )
-        return RC ( rcFS, rcFile, rcUpdating, rcMemory, rcExhausted );
-
-    memcpy ( entry -> digest, digest, sizeof entry -> digest );
-    entry -> bin = bin;
-    strcpy ( entry -> path, path );
-
-    * ep = entry;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMD5SumFmt
- *  a formatter for reading or writing an md5sum-style checksum file
- */
-struct KMD5SumFmt
-{
-    SLList entries;
-    KFile *f;
-    atomic32_t refcount;
-    uint32_t count;
-    bool read_only;
-    bool dirty;
-};
-
-/* Flush
- */
-LIB_EXPORT rc_t CC KMD5SumFmtFlush ( KMD5SumFmt *self )
-{
-    if ( self != NULL && self -> dirty )
-    {
-        KMD5SumEntryFlushData pb;
-        pb . pos = 0;
-        pb . f = self -> f;
-        pb . rc = 0;
-
-        SLListDoUntil ( & self -> entries, KMD5SumEntryFlush, & pb );
-
-        if ( pb . rc != 0 )
-            return pb . rc;
-
-        self -> dirty = false;
-    }
-    return 0;
-}
-
-
-/* Whack
- */
-static
-rc_t KMD5SumFmtWhack ( KMD5SumFmt *self )
-{
-    rc_t rc;
-
-    atomic32_set ( & self -> refcount, 1 );
-
-    rc = KMD5SumFmtFlush ( self );
-    if ( rc == 0 )
-        rc = KFileRelease ( self -> f );
-    if ( rc != 0 )
-        return rc;
-
-    SLListWhack ( & self -> entries, KMD5SumEntryWhack, NULL );
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KMD5SumFmtAddRef ( const KMD5SumFmt *cself )
-{
-    if ( cself != NULL )
-    {
-        MD5_DBG_REF (("%s self %p prior count %u\n", __func__, cself, atomic32_read ( & cself -> refcount ) ));
-        atomic32_inc ( & ( ( KMD5SumFmt* ) cself ) -> refcount );
-    }
-    else
-    {
-        MD5_DBG_REF(("%s self %p\n", __func__, cself));
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMD5SumFmtRelease ( const KMD5SumFmt *cself )
-{
-    KMD5SumFmt *self = ( KMD5SumFmt* ) cself;
-    if ( cself != NULL )
-    {
-        MD5_DBG_REF (("%s self %p prior count %u\n", __func__, cself, atomic32_read ( & cself -> refcount ) ));
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KMD5SumFmtWhack ( self );
-    }
-    else
-    {
-        MD5_DBG_REF(("%s self %p\n", __func__, cself));
-    }
-    return 0;
-}
-
-
-/* Extract
- *  extract a single line
- */
-static
-int hex_to_int ( char hex )
-{
-    int i = hex - '0';
-    if ( hex > '9' )
-    {
-        if ( hex < 'a' )
-            i = hex - 'A' + 10;
-        else
-            i = hex - 'a' + 10;
-
-        if ( i > 15 )
-            return -1;
-    }
-    return i;
-}
-
-static
-rc_t KMD5SumFmtExtract ( KMD5SumFmt *self, const char *line, size_t size )
-{
-    rc_t rc;
-    KMD5SumEntry *entry;
-
-    /* check for a DOS condition not caught by parse */
-    if ( line [ size - 1 ] == '\r' )
-    {
-        /* drop CR from line */
-        size -= 1;
-    }
-
-    /* create entry */
-    entry = malloc ( sizeof * entry + size - ( 32 /* cs */ + 2 /* sp + mode */ ) );
-    if ( entry == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        int i;
-
-        /* parse checksum */
-        for ( rc = 0, i = 0; i < 16; ++ i )
-        {
-            int l, u = hex_to_int ( line [ i + i + 0 ] );
-            l = hex_to_int ( line [ i + i + 1 ] );
-            if ( u < 0 || l < 0 )
-            {
-                rc = RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-                break;
-            }
-
-            entry -> digest [ i ] = ( uint8_t ) ( ( u << 4 ) | l );
-        }
-
-        /* parse mode */
-        if ( rc == 0 )
-        {
-            if ( line [ 32 ] != ' ' )
-                rc = RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-            else if ( line [ 33 ] == ' ' )
-                entry -> bin = false;
-            else if ( line [ 33 ] == '*' )
-                entry -> bin = true;
-            else
-                rc = RC ( rcFS, rcFile, rcConverting, rcFormat, rcInvalid );
-        }
-
-        /* the rest is path */
-        if ( rc == 0 )
-        {
-            string_copy ( entry -> path, size, & line [ 32 + 2 ], size - ( 32 + 2 ) );
-            SLListPushTail ( & self -> entries, & entry -> n );
-            ++ self -> count;
-            return 0;
-        }
-
-        free ( entry );
-    }
-
-    return rc;
-}
-
-
-/* Parse
- *  parse *.md5 file
- */
-static
-rc_t KMD5SumFmtParse ( KMD5SumFmt *self, const char *start, const char *stop )
-{
-    rc_t rc;
-    const char *end;
-
-    for ( rc = 0; start < stop; start = end + 1 )
-    {
-        end = string_chr ( start, stop - start, '\n' );
-        if ( end == NULL )
-            end = stop;
-
-        /* allow '#' comments and blank lines */
-        if ( ( end - start ) == 0 )
-            continue;
-        if ( start [ 0 ] == '#' )
-            continue;
-
-        /* line must have minimum length */
-        if ( ( end - start ) < ( 32 /* cs */ + 2 /* sp + mode */ + 1 /* path */ ) )
-        {
-            /* check for empty line ending in CR-LF */
-            if ( end [ -1 ] == '\r' && ( end - start ) == 1 )
-                continue;
-
-            /* other stuff is garbage */
-            rc = RC ( rcFS, rcFile, rcParsing, rcData, rcInsufficient );
-            break;
-        }
-
-        /* extract entry */
-        rc = KMD5SumFmtExtract ( self, start, end - start );
-        if ( rc != 0 )
-            break;
-    }
-
-    return rc;
-}
-
-
-/* Populate
- *  reads all lines of input from *.md5 file
- */
-static
-rc_t KMD5SumFmtPopulate ( KMD5SumFmt *self, const KFile *in )
-{
-    uint64_t eof;
-    rc_t rc = KFileSize ( in, & eof );
-    if ( rc == 0 )
-    {
-        char *buff = malloc ( ( size_t ) eof );
-        if ( buff == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            size_t num_read, total;
-            for ( total = 0; total < ( size_t ) eof; total += num_read )
-            {
-                rc = KFileRead ( in, total,
-                    & buff [ total ], ( size_t ) eof - total, & num_read );
-                if ( rc != 0 )
-                    break;
-                if ( num_read == 0 )
-                {
-                    rc = RC ( rcFS, rcFile, rcReading, rcTransfer, rcIncomplete );
-                    break;
-                }
-            }
-
-            if ( rc == 0 )
-                rc = KMD5SumFmtParse ( self, buff, buff + total );
-
-            free ( buff );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Make
- *  creates a formatted accessor to textual checksum file
- *  takes over ownership of "in"/"out" file reference
- */
-LIB_EXPORT rc_t CC KMD5SumFmtMakeRead ( const KMD5SumFmt **fp, const KFile *in )
-{
-    rc_t rc;
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( in == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! in -> read_enabled )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KMD5SumFmt *f = malloc ( sizeof * f );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                SLListInit ( & f -> entries );
-                atomic32_set ( & f -> refcount, 1 );
-                f -> f = NULL;
-                f -> count = 0;
-                f -> read_only = true;
-                f -> dirty = false;
-
-                rc = KMD5SumFmtPopulate ( f, in );
-                if ( rc == 0 )
-                {
-                    f -> f = ( KFile* ) in;
-                    * fp = f;
-                    return 0;
-                }
-                
-                KMD5SumFmtWhack ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-/* Make
- *  creates a formatted accessor to textual checksum file
- *  takes over ownership of "in"/"out" file reference
- */
-LIB_EXPORT rc_t CC KMD5SumFmtMakeUpdate ( KMD5SumFmt **fp, KFile *out )
-{
-    rc_t rc;
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else
-        {
-            KMD5SumFmt *f = malloc ( sizeof * f );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                SLListInit ( & f -> entries );
-                atomic32_set ( & f -> refcount, 1 );
-                f -> f = NULL;
-                f -> count = 0;
-                f -> read_only = false;
-                f -> dirty = false;
-
-                rc = 0;
-                if ( out -> read_enabled )
-                    rc = KMD5SumFmtPopulate ( f, out );
-                if ( rc == 0 )
-                {
-                    f -> f = out;
-                    * fp = f;
-                    return 0;
-                }
-                
-                KMD5SumFmtWhack ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Count
- *  return the number of checksums in file
- */
-LIB_EXPORT rc_t CC KMD5SumFmtCount ( const KMD5SumFmt *self, uint32_t *count )
-{
-    rc_t rc;
-    if ( count == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * count = self -> count;
-            return 0;
-        }
-
-        * count = 0;
-    }
-    return rc;
-}
-
-
-/* Get
- *  retrieve an indexed checksum line
- *
- *  "idx" [ IN ] - zero-based index of checksum to access
- *
- *  "path" [ OUT ] and "size" [ IN ] - return buffer for file path
- *
- *  "digest" [ OUT ] - return parameter for the MD5 checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-LIB_EXPORT rc_t CC KMD5SumFmtGet ( const KMD5SumFmt *self, uint32_t idx,
-    char *path, size_t size, uint8_t digest [ 16 ], bool *bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-    else if ( idx >= self -> count )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcId, rcNotFound );
-    else
-    {
-        uint32_t i;
-        const KMD5SumEntry *entry = ( const KMD5SumEntry* )
-            SLListHead ( & self -> entries );
-        for ( i = 0; entry != NULL && i < idx; ++ i )
-        {
-            entry = ( const KMD5SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcId, rcNotFound );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcBuffer, rcNull );
-        else if ( digest == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-        else
-        {
-            /* copy everything out */
-            memcpy ( digest, entry -> digest, sizeof entry -> digest );
-            if ( bin != NULL )
-                * bin = entry -> bin;
-
-            /* return success if buffer large enough */
-            if ( string_copy_measure ( path, size, entry -> path ) < size )
-                return 0;
-
-            rc = RC ( rcFS, rcFile, rcAccessing, rcBuffer, rcInsufficient );
-        }
-    }
-
-    if ( path != NULL && size != 0 )
-        path [ 0 ] = 0;
-
-    if ( bin != NULL )
-        * bin = false;
-
-    return rc;
-}
-
-
-/* Find
- *  retrieve checksum line by path
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "digest" [ OUT ] - return parameter for the MD5 checksum
- *
- *  "bin" [ OUT, NULL OKAY ] - true if fopen mode used to
- *  calculate "digest" was binary, false if text. pertinent if
- *  digest was calculated using DOS text mode.
- */
-LIB_EXPORT rc_t CC KMD5SumFmtFind ( const KMD5SumFmt *self,
-    const char *path, uint8_t digest [ 16 ], bool *bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcEmpty );
-    else
-    {
-        const KMD5SumEntry *entry = ( const KMD5SumEntry* )
-            SLListHead ( & self -> entries );
-        while ( entry != NULL )
-        {
-            if ( strcmp ( path, entry -> path ) == 0 )
-                break;
-
-            entry = ( const KMD5SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcPath, rcNotFound );
-        else if ( digest == NULL )
-            rc = RC ( rcFS, rcFile, rcAccessing, rcParam, rcNull );
-        else
-        {
-            /* copy everything out */
-            memcpy ( digest, entry -> digest, sizeof entry -> digest );
-            if ( bin != NULL )
-                * bin = entry -> bin;
-
-            return 0;
-        }
-    }
-
-    if ( bin != NULL )
-        * bin = false;
-
-    return rc;
-}
-
-
-/* Delete
- *  remove an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  returns rcNotFound if not present
- */
-LIB_EXPORT rc_t CC KMD5SumFmtDelete ( KMD5SumFmt *self, const char *path )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcEmpty );
-    else
-    {
-        KMD5SumEntry *entry = ( KMD5SumEntry* )
-            SLListHead ( & self -> entries );
-        while ( entry != NULL )
-        {
-            if ( strcmp ( path, entry -> path ) == 0 )
-                break;
-
-            entry = ( KMD5SumEntry* )
-                SLNodeNext ( & entry -> n );
-        }
-
-        if ( entry == NULL )
-            rc = RC ( rcFS, rcFile, rcRemoving, rcPath, rcNotFound );
-        else
-        {
-            /* pop entry from list */
-            SLListUnlink ( & self -> entries, & entry -> n );
-
-            /* delete entry */
-            KMD5SumEntryWhack ( & entry -> n, NULL );
-
-            /* mark the modification */
-            self -> dirty = true;
-            assert ( self -> count > 0 );
-            -- self -> count;
-
-            return 0;
-        }
-    }
-
-    return rc;
-}
-
-
-/* Update
- *  add a checksum line to file or update an existing line
- *
- *  "path" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file
- *
- *  "digest" [ IN ] - calculated MD5 checksum
- *
- *  "bin" [ IN ] - true if checksum was calculated on all bytes
- *  in file, false if fopen mode used to read file was text.
- *
- * NB - the md5sum tool operates with the assumption that files
- *  are opened using "fopen". it records the mode used by prepending
- *  '*' to indicate binary and ' ' to indicate text mode within the
- *  checksum line.
- *
- *  unfortunately, this creates a situation where text-mode files
- *  checksummed on DOS cannot be properly checked on any other
- *  platform without the aid of some filter to drop out '\r' from
- *  a '\r\n' sequence.
- *
- *  fortunately, most users are unaware of the binary/text mode
- *  switches available with md5sum and use the default mode, which
- *  is binary on DOS and text on Unix, which happens to be equivalent
- *  to binary ( making one wonder why binary is not instead the
- *  universal default ).
- *
- *  the end result is that we need to indicate whether CR stripping
- *  was performed while at the same time behaving like md5sum.
- */
-LIB_EXPORT rc_t CC KMD5SumFmtUpdate ( KMD5SumFmt *self, const char *path,
-    const uint8_t digest [ 16 ], bool bin )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcSelf, rcNull );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else if ( digest == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcParam, rcNull );
-    else
-    {
-        /* create an entry */
-        KMD5SumEntry *entry;
-        rc = KMD5SumEntryMake ( & entry, path, digest, bin );
-        if ( rc == 0 )
-        {
-            /* scan for existing entry */
-            KMD5SumEntry *exist = ( KMD5SumEntry* )
-                SLListHead ( & self -> entries );
-            while ( exist != NULL )
-            {
-                if ( strcmp ( exist -> path, entry -> path ) == 0 )
-                    break;
-                exist = ( KMD5SumEntry* )
-                    SLNodeNext ( & exist -> n );
-            }
-
-            /* if new entry, insert */
-            if ( exist == NULL )
-            {
-                SLListPushTail ( & self -> entries, & entry -> n );
-                self -> dirty = true;
-                ++ self -> count;
-            }
-            else
-            {
-                /* if existing, perform update */
-                if ( memcmp ( exist -> digest, entry -> digest, sizeof exist -> digest ) != 0 ||
-                     exist -> bin != entry -> bin )
-                {
-                    memcpy ( exist -> digest, entry -> digest, sizeof exist -> digest );
-                    exist -> bin = entry -> bin;
-                    self -> dirty = true;
-                }
-                KMD5SumEntryWhack ( & entry -> n, NULL );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Rename
- * Rename the checksum line to reflect a file name change but no content change.
- *
- *  "newpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's new name
- *
- *  "oldpath" [ IN ] - NUL terminated string in OS-native char set
- *  denoting path to file's old name
- *
- */
-LIB_EXPORT rc_t CC KMD5SumFmtRename ( KMD5SumFmt *self, const char *oldpath, const char *newpath )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcSelf, rcNull );
-    else if ( newpath == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( newpath [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else if ( oldpath == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcNull );
-    else if ( oldpath [ 0 ] == 0 )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcString, rcEmpty );
-    else
-    {
-	uint8_t	digest [16];
-	bool    bin;
-
-	rc = KMD5SumFmtFind (self, oldpath, digest, &bin);
-
-	if (rc == 0)
-	    rc = KMD5SumFmtUpdate (self, newpath, digest, bin);
-
-	if (rc == 0)
-	    rc = KMD5SumFmtDelete (self, oldpath);
-;
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * MD5 KFile extensions
- */
-typedef enum KMD5FileUnionType
-{
-    KMD5FileTypeRead,
-    KMD5FileTypeWrite
-} KMD5FileUnionType;
-struct KMD5File
-{
-    KFile dad;
-
-    /* this is position of next byte to read or write
-       relative to the MD5 not actual read/write */
-    uint64_t position;
-    MD5State md5;
-
-    KFile *file;
-    KMD5SumFmt *fmt;
-    KMD5FileUnionType type;
-    union
-    {
-        struct
-        {
-            rc_t rc;
-            uint8_t digest [ 16 ];
-            bool eof;
-        } rd;
-
-        struct
-        {
-            /* maximum position written to "file" */
-            uint64_t max_position;
-
-            /* saved information for a transaction */
-            uint64_t tposition;
-            MD5State tmd5;
-
-            /* is transaction open */
-            bool topen;
-
-            /* path to file for md5 fmt */
-            char path [ 1 ];
-        } wr;
-
-    } u;
-};
-
-/* Whack
- */
-static
-rc_t CC KMD5FileWhackRead ( KMD5File *self )
-{
-    rc_t rc;
-
-    atomic32_set ( & self -> dad . refcount, 1 );
-
-    rc = KFileRelease ( self -> file );
-    if ( rc == 0 )
-        free ( self );
-
-    return rc;
-}
-static
-rc_t CC KMD5FileWhackCreate ( KMD5File *self )
-{
-    uint64_t	position;
-    size_t	num_read;
-    rc_t	rc;
-    uint8_t	ignored [64 * 1024];
-
-    atomic32_set ( & self -> dad . refcount, 1 );
-
-    position = self->position;
-    for (;;)
-    {
-	rc = KFileRead (&self->dad, position, ignored, sizeof ignored, &num_read);
-	if (rc != 0)
-	    break;
-
-	if (num_read == 0)
-	    break;
-
-	position += num_read;
-    }
-    if (rc == 0)
-    {
-	rc = KFileRelease ( self -> file );
-	if ( rc == 0 )
-	    free ( self );
-    }
-    return rc;
-}
-
-static
-rc_t CC KMD5FileWhackWrite ( KMD5File *self )
-{
-    rc_t rc;
-    uint8_t digest [ 16 ];
-
-    atomic32_set ( & self -> dad . refcount, 1 );
-
-    /* if destination file has been written farther
-       than our concept of eof, truncate */
-    if ( self -> u . wr . max_position > self -> position )
-    {
-        rc = KFileSetSize ( self -> file, self -> position );
-        if ( rc != 0 )
-            return rc;
-        self -> u . wr . max_position = self -> position;
-    }
-
-    rc = KFileRelease ( self -> file );
-    if ( rc == 0 )
-    {
-        MD5StateFinish ( & self -> md5, digest );
-        KMD5SumFmtUpdate ( self -> fmt, self -> u . wr . path, digest, true );
-        KMD5SumFmtRelease ( self -> fmt );
-        free ( self );
-    }
-
-    return rc;
-}
-
-static const char MD5TAG [8] = "MD5CNTXT";
-static const char ENDIANTAG [4] =
-{ 
-    '0' + (char)((__BYTE_ORDER/1000)%10),
-    '0' + (char)((__BYTE_ORDER/100)%10),
-    '0' + (char)((__BYTE_ORDER/10)%10),
-    '0' + (char)((__BYTE_ORDER/1)%10)
-};
-static const char ENDIANSWAPTAG [4] =
-{ 
-    '0' + (char)((__BYTE_ORDER/1)%10),
-    '0' + (char)((__BYTE_ORDER/10)%10),
-    '0' + (char)((__BYTE_ORDER/100)%10),
-    '0' + (char)((__BYTE_ORDER/1000)%10)
-};
-
-static
-rc_t CC KMD5FileWrite ( KMD5File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ );
-
-static
-rc_t CC KMD5FileWhackAppend ( KMD5File *self )
-{
-    rc_t rc;
-
-    /* if the file is empty, just whack it */
-    if ( self -> position == 0 )
-        return KMD5FileWhackWrite ( self );
-
-    /* begin transaction will save current state */
-    rc = KMD5FileBeginTransaction ( self );
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-
-        /* create a closing tag with current MD5State */
-        uint8_t closer [ sizeof MD5TAG + sizeof ENDIANTAG + sizeof self -> md5 ];
-        memcpy ( closer, MD5TAG, sizeof MD5TAG );
-        memcpy ( & closer [ sizeof MD5TAG ], ENDIANTAG, sizeof ENDIANTAG );
-        memcpy ( & closer [ sizeof MD5TAG + sizeof ENDIANTAG ], & self -> md5, sizeof self -> md5 );
-            
-        /* append this to the file */
-        rc = KMD5FileWrite ( self, self -> position, closer, sizeof closer, & num_writ );
-        if ( rc == 0 )
-        {
-            /* test transfer */
-            if ( num_writ != sizeof closer )
-                rc = RC ( rcFS, rcFile, rcDestroying, rcTransfer, rcIncomplete );
-            else
-            {
-                /* complete operation */
-                rc = KMD5FileWhackWrite ( self );
-                if ( rc == 0 )
-                    return rc;
-            }
-        }
-
-        /* restore entry state */
-        KMD5FileRevert ( self );
-    }
-
-    /* bail on errors */
-    atomic32_set ( & self -> dad . refcount, 1 );
-    return rc;
-}
-
-
-/* GetSysFile
- */
-static
-struct KSysFile *CC KMD5FileGetSysFile ( const KMD5File *self, uint64_t *offset )
-{
-    if ( offset != NULL )
-        * offset = 0;
-    return NULL;
-}
-
-
-/* RandomAccess
- */
-static
-rc_t CC KMD5FileRandomAccessRead ( const KMD5File *self )
-{
-    return KFileRandomAccess ( self -> file );
-}
-
-static
-rc_t CC KMD5FileRandomAccessWrite ( const KMD5File *self )
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* Type
- */
-static
-uint32_t CC KMD5FileType ( const KMD5File *self )
-{
-    return KFileType ( self -> file );
-}
-
-
-/* Size
- */
-static
-rc_t CC KMD5FileSize ( const KMD5File *self, uint64_t *size )
-{
-    return KFileSize ( self -> file, size );
-}
-
-static
-rc_t CC KMD5FileSizeAppend ( const KMD5File *self, uint64_t *size )
-{
-    assert (self);
-    assert (size);
-    *size = self->position;
-    return 0;
-}
-
-
-/* SetSize
- *  the read-only version should never be called, because
- *  the message dispatch checks for write enable
- *
- *  the writable version disallows all but a total reset
- *  and setting size to current size
- */
-static
-rc_t CC KMD5FileSetSizeRead ( KMD5File *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-static
-rc_t CC KMD5FileSetSizeWrite ( KMD5File *self, uint64_t size )
-{
-    rc_t rc;
-
-    /* allow a noop */
-    if ( size == self -> position )
-        return 0;
-
-    /* disallow if not a reset */
-    if ( size != 0 )
-        return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-
-    /* ensure we're not in a transaction */
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcUpdating, rcFile, rcBusy );
-
-    /* go ahead and try to truncate destination */
-    rc = KFileSetSize ( self -> file, 0 );
-    if ( rc == 0 )
-    {
-        /* reset our internal state */
-        self -> position = self -> u . wr . max_position = 0;
-        MD5StateInit ( & self -> md5 );
-    }
-
-    return rc;
-}
-
-
-/* Finish
- *  finishes an MD5State if necessary
- *  returns the results of digest comparison
- */
-static
-rc_t KMD5FileFinish ( KMD5File *self )
-{
-    /* finish MD5State on first time */
-    if ( ! self -> u . rd . eof )
-    {
-        uint8_t digest [ 16 ];
-        MD5StateFinish ( & self -> md5, digest );
-
-        if ( memcmp ( digest, self -> u . rd . digest, sizeof digest ) != 0 )
-            self -> u . rd . rc = RC ( rcFS, rcFile, rcReading, rcFile, rcCorrupt );
-
-        self -> u . rd . eof = true;
-    }
-
-    return self -> u . rd . rc;
-}
-
-
-/* Seek
- *  used to scan ahead in a read-only file
- *  "self" is modifiable, but file is read-only
- */
-static
-rc_t KMD5FileSeek ( KMD5File *self, uint64_t pos )
-{
-    rc_t rc;
-    size_t num_read;
-    uint8_t buff [ 32 * 1024 ];
-
-    /* should never be called by writable file */
-    assert ( ! self -> dad . write_enabled );
-
-    /* seek to "pos" */
-    for ( rc = 0; self -> position < pos; self -> position += num_read )
-    {
-        /* maximum to read in this buffer */
-        size_t to_read = sizeof buff;
-        if ( self -> position + sizeof buff > pos )
-            to_read = ( size_t ) ( pos - self -> position );
-
-        /* read bytes */
-        rc = KFileRead ( self -> file, self -> position, buff, to_read, & num_read );
-        if ( rc != 0 )
-            break;
-
-        /* detect EOF */
-        if ( num_read == 0 )
-        {
-	    switch (self->type)
-	    {
-	    case KMD5FileTypeRead:
-		rc = KMD5FileFinish ( self );
-		break;
-	    case KMD5FileTypeWrite:
-		if ( self -> fmt != NULL)
-		{
-		    uint8_t digest [ 16 ];
-
-		    MD5StateFinish ( & self -> md5, digest );
-		    KMD5SumFmtUpdate ( self -> fmt, self -> u . wr . path, digest, true );
-		    KMD5SumFmtRelease ( self -> fmt );
-		    self -> fmt = NULL;
-		}
-		break;
-	    }
-	    break;
-        }
-
-        /* append bytes */
-        MD5StateAppend ( & self -> md5, buff, num_read );
-    }
-
-    return rc;
-}
-
-/* Read
- *  read-only version allows random access reads
- */
-static
-rc_t CC KMD5FileRead ( const KMD5File *cself,
-    uint64_t pos, void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    size_t total = 0;
-    uint64_t end = pos + bsize;
-    KMD5File *self = ( KMD5File* ) cself;
-
-    * num_read = 0;
-
-    /* no buffer means no bytes */
-    if ( bsize == 0 )
-        return 0;
-
-    /* test for starting a read before the current marker
-       meaning that it does not figure in to the md5sum */
-    if ( self -> position  > pos )
-    {
-        /* test for entire buffer being before marker */
-        if ( end <= self -> position )
-            return KFileRead ( self -> file, pos, buffer, bsize, num_read );
-
-        /* perform a partial read without affecting md5 */
-        rc = KFileRead ( self -> file, pos, buffer, ( size_t ) ( self -> position - pos ), num_read );
-        if ( rc != 0 )
-            return rc;
-
-        /* adjust as if a new read request, remembering number read so far */
-        pos += * num_read;
-        total = * num_read;
-        buffer = & ( ( uint8_t* ) buffer ) [ * num_read ];
-
-        /* in case num_read != all bytes up to marker */
-        if ( pos != self -> position )
-            return 0;
-    }
-
-    /* test for hole between current marker and desired start */
-    else if ( self -> position < pos )
-    {
-        /* scan ahead, discarding */
-        rc = KMD5FileSeek ( self, pos );
-        if ( rc != 0 || self -> position < pos )
-            return rc;
-    }
-
-    /* no hole - and still some space in buffer */
-    assert ( self -> position == pos );
-    assert ( pos < end );
-
-    /* read bytes */
-    rc = KFileRead ( self -> file, pos, buffer, ( size_t ) ( end - pos ), num_read );
-    if ( rc == 0 )
-    {
-        /* detect bytes read */
-        if ( * num_read != 0 )
-        {
-            /* accumulate into MD5 */
-            self -> position += * num_read;
-            MD5StateAppend ( & self -> md5, buffer, * num_read );
-
-            /* add in any previously read bytes and return success */
-            * num_read += total;
-            return 0;
-        }
-	switch (self->type)
-	{
-	case KMD5FileTypeRead:
-	    /* EOF - get MD5 digest results */
-	    rc = KMD5FileFinish ( self );
-	    break;
-	case KMD5FileTypeWrite:
-	    if ( self -> fmt != NULL)
-	    {
-		uint8_t digest [ 16 ];
-
-		MD5StateFinish ( & self -> md5, digest );
-		KMD5SumFmtUpdate ( self -> fmt, self -> u . wr . path, digest, true );
-		KMD5SumFmtRelease ( self -> fmt );
-		self -> fmt = NULL;
-	    }
-	    break;
-	}
-
-    }
-
-    /* always return 0 if some bytes were read */
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-
-    return rc;
-}
-
-/* Read
- *  writeable version isn't keeping track of MD5 on read,
- *  so just forward to destination file
- */
-static
-rc_t CC KMD5FileFwdRead ( const KMD5File *self,
-    uint64_t pos, void *buffer, size_t bsize, size_t *num_read )
-{
-    return KFileRead ( self -> file, pos, buffer, bsize, num_read );
-}
-
-
-/* Write
- */
-static
-rc_t CC KMD5FileBadWrite ( KMD5File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    * num_writ = 0;
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcFS, rcFile, rcWriting, rcBuffer, rcNull );
-
-    return RC ( rcFS, rcFile, rcReading, rcFile, rcReadonly );
-}
-
-static
-rc_t CC KMD5FileWrite ( KMD5File *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-
-    if ( pos != self -> position )
-        return RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-
-    rc = KFileWrite ( self -> file, pos, buffer, size, num_writ );
-    if ( rc == 0 && * num_writ != 0 )
-    {
-        self -> position += * num_writ;
-        if ( self -> position > self -> u . wr . max_position )
-            self -> u . wr . max_position = self -> position;
-        MD5StateAppend ( & self -> md5, buffer, * num_writ );
-    }
-
-    return rc;
-}
-
-
-/* ToKFile
- *  an MD5 file is a subclass of KFile
- *  this is an explicit cast operator
- */
-LIB_EXPORT KFile* CC KMD5FileToKFile ( KMD5File *self )
-{
-    if ( self != NULL )
-        return & self -> dad;
-    return NULL;
-}
-
-LIB_EXPORT const KFile* CC KMD5FileToKFileConst ( const KMD5File *self )
-{
-    if ( self != NULL )
-        return & self -> dad;
-    return NULL;
-}
-
-
-/* BeginTransaction
- *  preserve current MD5 state and file marker
- *  in preparation for rollback
- */
-LIB_EXPORT rc_t CC KMD5FileBeginTransaction ( KMD5File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcFreezing, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcFreezing, rcFile, rcReadonly );
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcFreezing, rcFile, rcBusy );
-
-    self -> u . wr . topen = true;
-    self -> u . wr . tposition = self -> position;
-    self -> u . wr . tmd5 = self -> md5;
-
-    return 0;
-}
-
-
-/* Commit
- *  accept current MD5 state as correct
- */
-LIB_EXPORT rc_t CC KMD5FileCommit ( KMD5File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcCommitting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcCommitting, rcFile, rcReadonly );
-
-    self -> u . wr . topen = false;
-
-    return 0;
-}
-
-
-/* Revert
- *  revert state to previous transaction boundary conditions
- */
-LIB_EXPORT rc_t CC KMD5FileRevert ( KMD5File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcReverting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcReverting, rcFile, rcReadonly );
-    if ( ! self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcReverting, rcFile, rcInconsistent );
-
-    self -> position = self -> u . wr . tposition;
-    self -> md5 = self -> u . wr . tmd5;
-    self -> u . wr . topen = false;
-
-    return 0;
-}
-
-/* Reset
- *  reset state to that of an empty file
- *  aborts any open transaction
- */
-LIB_EXPORT rc_t CC KMD5FileReset ( KMD5File *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcResetting, rcSelf, rcNull );
-    if ( ! self -> dad . write_enabled )
-        return RC ( rcFS, rcFile, rcResetting, rcFile, rcReadonly );
-#if 1
-    self -> u . wr . topen = false;
-#else
-    if ( self -> u . wr . topen )
-        return RC ( rcFS, rcFile, rcResetting, rcFile, rcBusy );
-#endif
-
-    self -> position = 0;
-    MD5StateInit ( & self -> md5 );
-
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * MD5File factories
- */
-
-
-/* MakeMD5Read
- *  creates an adapter to check MD5 checksum for a source file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "src" [ IN ] - source file with read permission
- *
- *  "digest" [ IN ] - MD5 checksum to match
- *
- * NB - creates a read-only file that does NOT support random access
- *  i.e. must be consumed serially starting from offset 0
- */
-static KFile_vt_v1 KMD5FileRead_vt =
-{
-    1, 1,
-
-    /* 1.0 */
-    KMD5FileWhackRead,
-    KMD5FileGetSysFile,
-    KMD5FileRandomAccessRead,
-    KMD5FileSize,
-    KMD5FileSetSizeRead,
-    KMD5FileRead,
-    KMD5FileBadWrite,
-
-    /* 1.1 */
-    KMD5FileType
-};
-
-LIB_EXPORT rc_t CC KFileMakeMD5Read ( const KFile **fp,
-    const KFile *src, const uint8_t digest [ 16 ] )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( src == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! src -> read_enabled )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else if ( digest == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-        else
-        {
-            KMD5File *f = malloc ( sizeof * f - sizeof f -> u + sizeof f -> u . rd );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-				     ( const KFile_vt* ) & KMD5FileRead_vt, "KMD5File", "no-name", true, false );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    MD5StateInit ( & f -> md5 );
-                    f -> file = ( KFile* ) src;
-                    f -> fmt = NULL;
-                    f -> type = KMD5FileTypeRead;
-                    f -> u . rd . rc = 0;
-                    f -> u . rd . eof = 0;
-                    memcpy ( f -> u . rd . digest, digest, sizeof f -> u . rd . digest );
-
-                    * fp = & f -> dad;
-                    return 0;
-                }
-            }
-
-            free ( f );
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* MakeWrite
- *  creates an adapter to create MD5 checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "md5" [ IN ] - md5 checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "md5".
- *
- *  "path" [ IN ] - md5 checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from offset 0
- */
-static KFile_vt_v1 sKMD5FileWrite_vt =
-{
-    1, 0,
-
-    KMD5FileWhackWrite,
-    KMD5FileGetSysFile,
-    KMD5FileRandomAccessWrite,
-    KMD5FileSize,
-    KMD5FileSetSizeWrite,
-    KMD5FileFwdRead,
-    KMD5FileWrite
-};
-
-LIB_EXPORT rc_t CC KMD5FileMakeWrite ( KMD5File **fp,
-    KFile *out, KMD5SumFmt *md5, const char *path )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else if ( md5 == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( md5 -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            KMD5File *f = malloc ( sizeof * f - sizeof f -> u +
-                sizeof f -> u . wr + strlen ( path ) );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKMD5FileWrite_vt, "KMD5File", path, out -> read_enabled, true );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    MD5StateInit ( & f -> md5 );
-                    f -> file = out;
-                    f -> fmt = md5;
-		    f -> type = KMD5FileTypeWrite;
-
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    strcpy ( f -> u . wr . path, path );
-
-                    rc = KFileSize ( out, & f -> u . wr . max_position );
-                    if (rc)
-                    {
-                        if (GetRCState (rc) == rcUnsupported)
-                        {
-                            f -> u . wr . max_position  = 0;
-                            rc = 0;
-                        }
-                    }    
-                    if ( rc == 0 )
-                        rc = KMD5SumFmtAddRef ( md5 );
-                    if ( rc == 0 )
-                    {
-                        * fp = f;
-                        return 0;
-                    }
-                }
-
-                free ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-/* MakeAppend
- *  creates an adapter to create MD5 checksum for a file
- *
- *  "f" [ OUT ] - return parameter for file with md5 check
- *
- *  "out" [ IN ] - output file with write permission
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- *
- *  "md5" [ IN ] - md5 checksum output formatter.
- *  since this may be used for multiple checksums, "f" will
- *  attach its own reference to "md5".
- *
- *  "path" [ IN ] - md5 checksum output file path, used to
- *  create standard md5sum file entry.
- *
- * NB - creates a write-only file that does NOT suppport random access
- *  i.e. must be written serially from current EOF (minus the stored MD5 context)
- */
-static KFile_vt_v1 sKMD5FileAppend_vt =
-{
-    1, 0,
-
-    KMD5FileWhackAppend,
-    KMD5FileGetSysFile,
-    KMD5FileRandomAccessWrite,
-    KMD5FileSizeAppend,
-    KMD5FileSetSizeWrite,
-    KMD5FileFwdRead,
-    KMD5FileWrite
-};
-
-LIB_EXPORT rc_t CC KMD5FileMakeAppend ( KMD5File **fp, KFile *out, KMD5SumFmt *md5, const char *path )
-{
-    rc_t rc;
-    KLogLevel lvl = klogInt;
-    
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( out == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! out -> write_enabled )
-        {
-            if ( out -> read_enabled )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-            else
-                rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        }
-        else if ( md5 == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( md5 -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            KMD5File *f = malloc ( sizeof * f - sizeof f -> u +
-                sizeof f -> u . wr + strlen ( path ) );
-            if ( f == NULL )
-            {
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-                lvl = klogSys;
-            }
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKMD5FileAppend_vt, "KMD5File", path, out -> read_enabled, true );
-                if ( rc == 0 )
-                {
-                    MD5StateInit ( & f -> md5 );
-                    f -> file = out;
-                    f -> fmt = md5;
-		    f -> type = KMD5FileTypeWrite;
-
-                    rc = KMD5SumFmtAddRef ( md5 );
-                    if ( rc != 0 )
-                    {
-                        free ( f );
-                        * fp = NULL;
-                        return rc;
-                    }
-
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    strcpy ( f -> u . wr . path, path );
-
-                    lvl = klogSys;
-                    rc = KFileSize ( out, & f -> position );
-                    if ( rc == 0 )
-                    {
-                        uint8_t buffer [ sizeof MD5TAG + sizeof ENDIANTAG + sizeof f -> md5 ];
-
-                        /* an empty file is fine */
-                        if ( f -> position == 0 )
-                        {
-                            * fp = f;
-                            return 0;
-                        }
-
-                        /* set max */
-                        f -> u . wr . max_position = f -> position;
-
-                        /* a file without a trailing MD5 state is incorrect or corrupt */
-                        if ( f -> position < sizeof buffer )
-                        {
-                            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcIncorrect );
-                            lvl = klogErr;
-                        }
-                        else
-                        {
-                            /* try to read MD5 state */
-                            size_t num_read;
-                            rc = KFileRead ( out, f -> position - sizeof buffer, buffer, sizeof buffer, & num_read );
-                            if ( rc == 0 )
-                            {
-                                if ( num_read != sizeof buffer )
-                                    rc = RC ( rcFS, rcFile, rcConstructing, rcTransfer, rcIncomplete );
-                                else
-                                {
-                                    /* errors from here are usage errors */
-                                    lvl = klogErr;
-                                    
-                                    if ( memcmp ( buffer, MD5TAG, sizeof MD5TAG ) != 0 )
-                                        rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcIncorrect );
-                                    else
-                                    {
-                                        /* forget about the MD5 state */
-                                        f -> position -= sizeof buffer;
-                                        memcpy ( & f -> md5, & buffer [ sizeof MD5TAG + sizeof ENDIANTAG ], sizeof f -> md5 );
-                                        
-                                        /* check for proper byte order */
-                                        if ( memcmp ( & buffer [ sizeof MD5TAG ], ENDIANTAG, sizeof ENDIANTAG ) == 0 )
-                                        {
-                                            * fp = f;
-                                            return 0;
-                                        }
-
-                                        /* probably swapped, but confirm */
-                                        if ( memcmp ( & buffer [ sizeof MD5TAG ], ENDIANSWAPTAG, sizeof ENDIANSWAPTAG ) == 0 )
-                                        {
-                                            int i;
-
-                                            for ( i = 0; i < sizeof f -> md5 . count / sizeof f -> md5 . count [ 0 ]; ++ i )
-                                                f -> md5 . count [ i ] = bswap_32 ( f -> md5 . count [ i ] );
-                                            for ( i = 0; i < sizeof f -> md5 . abcd / sizeof f -> md5 . abcd [ 0 ]; ++ i )
-                                                f -> md5 . abcd [ i ] = bswap_32 ( f -> md5 . abcd [ i ] );
-
-                                            * fp = f;
-                                            return 0;
-                                        }
-                                        
-                                        /* garbage */
-                                        rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcCorrupt );
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    
-                    KMD5SumFmtRelease ( md5 );
-                }
-                
-                free ( f );
-            }
-        }
-        
-        * fp = NULL;
-    }
-    
-    LOGERR ( lvl, rc, "append-mode MD5 file" );
-    
-    return rc;
-}
-
-static KFile_vt_v1 sKMD5FileReadCreate_vt =
-{
-    1, 1,
-
-    KMD5FileWhackCreate,
-    KMD5FileGetSysFile,
-    KMD5FileRandomAccessRead,
-    KMD5FileSize,
-    KMD5FileSetSizeRead,
-    KMD5FileRead,
-    KMD5FileBadWrite,
-
-    /* 1.1 */
-    KMD5FileType
-};
-
-/* MakeReadNew
- *  creates an adapter to create MD5 checksum for a file
- *
- *  "in" [ IN ] - input file 
- *  since this file is being wrapped by "f", ownership of
- *  the provided reference is transferred to "f"
- */
-LIB_EXPORT rc_t CC KFileMakeNewMD5Read ( const KFile **fp,
-    const struct KFile *in, KMD5SumFmt *md5, const char *path )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( in == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! in -> read_enabled )
-	    rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else if ( md5 == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( md5 -> read_only )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-        else if ( path == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            size_t path_size = string_size ( path );
-            KMD5File *f = malloc ( sizeof * f + path_size );
-            if ( f == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( & f -> dad,
-                    ( const KFile_vt* ) & sKMD5FileReadCreate_vt, "KMD5File", path, in -> read_enabled, false );
-                if ( rc == 0 )
-                {
-                    f -> position = 0;
-                    MD5StateInit ( & f -> md5 );
-                    f -> file = (KFile*)in;
-                    f -> fmt = md5;
-		    f -> type = KMD5FileTypeWrite;
-                    memset ( & f -> u . wr, 0, sizeof f -> u . wr );
-                    string_copy ( f -> u . wr . path, path_size + 1, path, path_size );
-#if 0
-/* KFileSize can't always be used */
-                    rc = KFileSize ( in, & f -> u . wr . max_position );
-#else
-		    f->u.wr.max_position = 0;
-#endif
-                    if ( rc == 0 )
-                        rc = KMD5SumFmtAddRef ( md5 );
-                    if ( rc == 0 )
-                    {
-                        * fp = &f->dad;
-                        return 0;
-                    }
-                }
-
-                free ( f );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* end of file */
diff --git a/libs/kfs/mmap-priv.h b/libs/kfs/mmap-priv.h
deleted file mode 100644
index e9a44b7..0000000
--- a/libs/kfs/mmap-priv.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_mmap_priv_
-#define _h_mmap_priv_
-
-#ifndef _h_kfs_mmap_
-#include <kfs/mmap.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-#if 0
-/* minimal structure */
-struct KMMap
-{
-    uint64_t off;
-    uint64_t pos;
-    size_t size;
-    char *addr;
-
-    struct KFile *f;
-    size_t pg_size;
-
-    uint32_t addr_adj;
-    uint32_t size_adj;
-
-    KRefcount refcount;
-
-    bool read_only;
-    bool sys_mmap;
-    bool dirty;
-};
-#endif
-
-
-/* Make
- *  make an open OS-specific KMMap structure
- *  common code will initialize common parts such as KFile*
- */
-rc_t KMMapMake ( KMMap **mmp );
-
-
-/* RWSys
- *  map the region of mapped file into memory for read & write
- *  using system memory mapping function
- *
- *  the values for "pos" and "size" can be trusted
- *  as correct for page alignment
- */
-rc_t KMMapRWSys ( KMMap *self, uint64_t pos, size_t size );
-
-
-/* ROSys
- *  map the region of mapped file into memory for read only
- *  using system memory mapping function
- *
- *  the values for "pos" and "size" can be trusted
- *  as correct for page alignment
- */
-rc_t KMMapROSys ( KMMap *self, uint64_t pos, size_t size );
-
-
-/* Unmap
- *  removes a memory map
- */
-rc_t KMMapUnmap ( KMMap *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_mmap_priv_ */
diff --git a/libs/kfs/mmap.c b/libs/kfs/mmap.c
deleted file mode 100644
index 69391d7..0000000
--- a/libs/kfs/mmap.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include "mmap-priv.h"
-#include "sysmmap-priv.h"
-#include "sysfile-priv.h"
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-
-#define USE_MALLOC_MMAP 1
-
-#if USE_MALLOC_MMAP
-
-#ifndef FORCE_MALLOC_MMAP
-#define FORCE_MALLOC_MMAP 0
-#endif
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-
-
-/* Unmap
- */
-static
-rc_t KMMapUnmapRgn ( KMMap *self )
-{
-    rc_t rc;
-
-    if ( self -> sys_mmap )
-        rc = KMMapUnmap ( self );
-    else
-    {
-        rc = 0;
-
-        if ( self -> dirty )
-        {
-            size_t num_writ, total;
-            for (  total = 0; total < self -> size; total += num_writ )
-            {
-                rc = KFileWrite ( self -> f, self -> pos + total,
-                    & self -> addr [ total ], self -> size - total, & num_writ );
-                if ( rc != 0 || num_writ == 0 )
-                    break;
-            }
-
-            if ( rc == 0 && total < self -> size )
-                rc = RC ( rcFS, rcMemMap, rcDestroying, rcTransfer, rcIncomplete );
-        }
-
-        if ( rc == 0 )
-            free ( self -> addr );
-    }
-
-    if ( rc == 0 )
-    {
-        self -> off = self -> pos = 0;
-        self -> addr = NULL;
-        self -> size = 0;
-        self -> sys_mmap = self -> dirty = false;
-    }
-
-    return rc;
-}
-
-/* Whack
- */
-static
-rc_t KMMapWhack ( KMMap *self )
-{
-    rc_t rc = KMMapUnmapRgn ( self );
-    if ( rc != 0 )
-    {
-        KRefcountAdd ( & self -> refcount, "KMMap" );
-        return rc;
-    }
-
-    /* now goes the file */
-    KFileRelease ( self -> f );
-    free ( self );
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KMMapAddRef ( const KMMap *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KMMap" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcMemMap, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMMapRelease ( const KMMap *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KMMap" ) )
-        {
-        case krefWhack:
-            return KMMapWhack ( ( KMMap* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcMemMap, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Size
- *  returns size of memory region
- *
- *  "size" [ OUT ] - return parameter for region size
- */
-LIB_EXPORT rc_t CC KMMapSize ( const KMMap *self, size_t *size )
-{
-    if ( size == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcParam, rcNull );
-
-    if ( self != NULL )
-    {
-        * size = self -> size;
-        return 0;
-    }
-
-    * size = 0;
-    return RC ( rcFS, rcMemMap, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* Position
- *  returns region starting offset into mapped file
- *
- *  "pos" [ OUT ] - return parameter for file offset
- */
-LIB_EXPORT rc_t CC KMMapPosition ( const KMMap *self, uint64_t *pos )
-{
-    if ( pos == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcParam, rcNull );
-
-    if ( self != NULL )
-    {
-        * pos = self -> pos;
-        return 0;
-    }
-
-    * pos = 0;
-    return RC ( rcFS, rcMemMap, rcAccessing, rcSelf, rcNull );
-}
-
-
-/* Addr
- *  returns starting address of memory region
- *
- *  "addr" [ OUT ] - return parameter for memory address
- */
-LIB_EXPORT rc_t CC KMMapAddrRead ( const KMMap *self, const void **addr )
-{
-    if ( addr == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcParam, rcNull );
-
-    if ( self != NULL )
-    {
-        if ( self -> addr == NULL )
-            return RC ( rcFS, rcMemMap, rcAccessing, rcMemMap, rcInvalid );
-
-        * addr = ( const void* ) self -> addr;
-        return 0;
-    }
-
-    * addr = NULL;
-    return RC ( rcFS, rcMemMap, rcAccessing, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC KMMapAddrUpdate ( KMMap *self, void **addr )
-{
-    if ( addr == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcParam, rcNull );
-
-    * addr = NULL;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcSelf, rcNull );
-
-    if ( self -> read_only )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcMemMap, rcReadonly );
-
-    if (  self -> addr == NULL )
-        return RC ( rcFS, rcMemMap, rcAccessing, rcMemMap, rcInvalid );
-
-    if ( ! self -> sys_mmap )
-        self -> dirty = true;
-
-    * addr = self -> addr;
-    return 0;
-}
-
-
-/* MallocRgn
- */
-#if USE_MALLOC_MMAP
-static
-rc_t KMMapMallocRgn ( KMMap *self, uint64_t pos, size_t size, bool read_only )
-{
-    rc_t rc;
-    uint64_t eof;
-
-    self -> off = 0;
-    self -> read_only = read_only;
-    self -> sys_mmap = self -> dirty = false;
-
-    /* try to crop size to actual file size */
-    rc = KFileSize ( self -> f, & eof );
-    if ( rc == 0 )
-    {
-        /* mapping beyond end of file */
-        if ( pos >= eof )
-        {
-            if ( read_only )
-            {
-                self -> pos = pos;
-                self -> addr = NULL;
-                self -> size = 0;
-                return 0;
-            }
-
-            /* allocate real memory */
-            self -> addr = calloc ( 1, size );
-            if ( self -> addr == NULL )
-                return RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-
-            self -> pos = pos;
-            self -> size = size;
-            self -> dirty = true;
-            return 0;
-        }
-
-        /* crop for readonly case */
-        if ( read_only && (( size == 0 ) || ( pos + size > eof )))
-            size = ( size_t ) ( eof - pos );
-    }
-
-    /* now allocate memory */
-    self -> addr = malloc ( size );
-    if ( self -> addr == NULL )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        size_t num_read, total;
-        for ( rc = 0, total = 0; total < size; total += num_read )
-        {
-            rc = KFileRead ( self -> f, pos + total,
-                & self -> addr [ total ], size - total, & num_read );
-            if ( rc != 0 || num_read == 0 )
-                break;
-        }
-
-        if ( total != 0 )
-            rc = 0;
-
-        if ( total != size )
-            memset ( & self -> addr [ total ], 0, size - total );
-
-        self -> pos = pos;
-        self -> size = total;
-    }
-
-    return rc;
-}
-#endif
-
-
-/* RWRgn
- */
-static
-rc_t KMMapRWRgn ( KMMap *self, uint64_t pos, size_t size )
-{
-    rc_t rc;
-    KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-
-    if ( ! self -> f -> read_enabled || ! self -> f -> write_enabled )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-
-    else if ( sf == NULL )
-    {
-#if USE_MALLOC_MMAP
-        rc = KMMapMallocRgn ( self, pos, size, false );
-#else
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-#endif
-    }
-
-    else if ( self -> off != 0 )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-
-    else
-    {
-        uint64_t eof;
-        rc = KFileSize ( self -> f, & eof );
-        if ( rc == 0 )
-        {
-            size_t bytes;
-            uint64_t pg_mask, left, right, range;
-
-            if ( size == 0 )
-            {
-                size = ( size_t ) eof;
-                if ( ( uint64_t ) size != eof )
-                    return RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcExcessive );
-            }
-
-            pg_mask = self -> pg_size - 1;
-            left = pos & ~ pg_mask;
-            right = ( pos + size + pg_mask ) & ~ pg_mask;
-            range = right - left;
-
-            bytes = ( size_t ) range;
-            if ( ( uint64_t ) bytes != range )
-                return RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcExcessive );
-
-            /* extend right edge if necessary */
-            if ( eof < right )
-            {
-                rc = KFileSetSize ( self -> f, right );
-                if ( rc != 0 )
-                    return ResetRCContext ( rc, rcFS, rcMemMap, rcConstructing );
-            }
-
-            if ( bytes == 0 )
-            {
-                self -> addr = NULL;
-                self -> addr_adj = 0;
-                self -> size_adj = 0;
-                self -> size = 0;
-            }
-            else
-            {
-#if FORCE_MALLOC_MMAP
-                rc = -1;
-#else
-                rc = KMMapRWSys ( self, left, bytes );
-#endif
-                if ( rc != 0 )
-                {
-                    self -> addr_adj = self -> size_adj = 0;
-                    self -> size = 0;
-
-                    if ( eof < right )
-                        KFileSetSize ( self -> f, eof );
-#if USE_MALLOC_MMAP
-                    rc = KMMapMallocRgn ( self, pos, size, false );
-#endif
-                    return rc;
-                }
-
-                self -> addr += pos - left;
-                self -> addr_adj = ( uint32_t ) ( pos - left );
-                self -> size_adj = ( uint32_t ) ( bytes - size );
-                self -> size = size;
-                self -> sys_mmap = true;
-            }
-
-            self -> pos = pos;
-            self -> read_only = false;
-        }
-    }
-
-    return rc;
-}
-
-
-/* RORgn
- */
-static
-rc_t KMMapRORgn ( KMMap *self, uint64_t pos, size_t size )
-{
-    rc_t rc;
-
-    if ( ! self -> f -> read_enabled )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-    else
-    {
-        uint64_t eof;
-
-        /* pos is relative to a virtual file; s_pos is relative to a system file */
-        uint64_t s_pos = pos;
-
-        KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-        if ( sf == NULL )
-        {
-#if USE_MALLOC_MMAP
-            return KMMapMallocRgn ( self, pos, size, true );
-#else
-            return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-#endif
-        }
-
-        rc = KFileSize ( self -> f, & eof );
-
-        /* if file has known size */
-        if ( rc == 0 )
-        {
-            size_t bytes;
-            uint64_t pg_mask, left, right, range;
-
-            if ( size == 0 )
-            {
-                size = ( size_t ) eof;
-                if ( ( uint64_t ) size != eof )
-                    return RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcExcessive );
-            }
-
-            if ( pos + size > eof )
-            {
-                if ( pos >= eof )
-                    return RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcInvalid );
-                size = ( size_t ) ( eof - pos );
-            }
-
-            if ( self -> off != 0 )
-            {
-                s_pos = pos + self -> off;
-                rc = KFileSize ( & sf -> dad, & eof ); /* eof is now for the sysfile */
-                if ( rc != 0 )
-                    return ResetRCContext ( rc, rcFS, rcMemMap, rcConstructing );
-            }
-
-            pg_mask = self -> pg_size - 1;
-            left = s_pos & ~ pg_mask;
-            right = ( s_pos + size + pg_mask ) & ~ pg_mask;
-
-            if ( eof < right )
-                right = eof;
-
-            range = right - left;
-            bytes = ( size_t ) range;
-            if ( ( uint64_t ) bytes != range )
-                return RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcExcessive );
-
-            if ( bytes == 0 )
-            {
-                size = 0;
-                self -> addr = NULL;
-                self -> addr_adj = 0;
-                self -> size_adj = 0;
-            }
-            else
-            {
-#if FORCE_MALLOC_MMAP
-                rc = -1;
-#else
-                rc = KMMapROSys ( self, left, bytes );
-#endif
-                if ( rc != 0 )
-                {
-                    self -> addr_adj = self -> size_adj = 0;
-                    self -> size = 0;
-#if USE_MALLOC_MMAP
-                    rc = KMMapMallocRgn ( self, pos, size, true );
-#endif
-                    return rc;
-                }
-            
-                self -> addr += s_pos - left;
-                self -> addr_adj = ( uint32_t ) ( s_pos - left );
-                self -> size_adj = ( uint32_t ) ( bytes - size );
-                self -> sys_mmap = true;
-            }
-        }
-
-        self -> pos = pos;
-        self -> size = size;
-        self -> read_only = true;
-    }
-
-    return rc;
-}
-
-
-/* MakeRgn
- *  maps a portion of a file
- *
- *  "f" [ IN ] - file to map
- *  a new reference will be attached
- *
- *  "pos" [ IN ] - starting offset into file
- *
- *  "size" [ IN, DEFAULT ZERO ] - size of resulting region. if 0,
- *  the size will be interpreted as meaning size of "f" - "pos".
- */
-static
-rc_t KMMapMakeRgn ( KMMap **mmp, const KFile *f )
-{
-    KMMap *mm;
-    rc_t rc = KMMapMake ( & mm );
-    if ( rc == 0 )
-    {
-        rc = KFileAddRef ( f );
-        if ( rc == 0 )
-        {
-            mm -> f = ( KFile* ) f;
-            mm -> off = mm -> pos = 0;
-            mm -> size = 0;
-            mm -> addr = NULL;
-            mm -> addr_adj = mm -> size_adj = 0;
-            KRefcountInit ( & mm -> refcount, 1, "KMMap", "make", "mmap" );
-            mm -> sys_mmap = false;
-            mm -> read_only = false;
-            mm -> dirty = false;
-    
-            * mmp = mm;
-            return 0;
-        }
-
-        KMMapWhack ( mm );
-    }
-
-    * mmp = NULL;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMMapMakeRgnRead ( const KMMap **mmp,
-    const KFile *f, uint64_t pos, size_t size )
-{
-    rc_t rc;
-    if ( mmp == NULL )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( f == NULL )
-            rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNull );
-        else if ( ! f -> read_enabled )
-            rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KMMap *mm;
-            rc = KMMapMakeRgn ( & mm, f );
-            if ( rc == 0 )
-            {
-                rc = KMMapRORgn ( mm, pos, size );
-                if ( rc == 0 )
-                {
-                    * mmp = mm;
-                    return 0;
-                }
-
-                KMMapWhack ( mm );
-            }
-        }
-
-        * mmp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KMMapMakeRgnUpdate ( KMMap **mmp,
-    KFile *f, uint64_t pos, size_t size )
-{
-    rc_t rc;
-    if ( mmp == NULL )
-        rc = RC ( rcFS, rcMemMap, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( f == NULL )
-            rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNull );
-        else if ( ! f -> read_enabled || ! f -> write_enabled )
-            rc = RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KMMap *mm;
-            rc = KMMapMakeRgn ( & mm, f );
-            if ( rc == 0 )
-            {
-                rc = KMMapRWRgn ( mm, pos, size );
-                if ( rc == 0 )
-                {
-                    * mmp = mm;
-                    return 0;
-                }
-
-                KMMapWhack ( mm );
-            }
-        }
-
-        * mmp = NULL;
-    }
-    return rc;
-}
-
-/* Make
- *  maps entire file
- *
- *  "f" [ IN ] - file to map.
- *  a new reference will be attached
- */
-LIB_EXPORT rc_t CC KMMapMakeRead ( const KMMap **mm, const KFile *f )
-{
-    return KMMapMakeRgnRead ( mm, f, 0, 0 );
-}
-
-LIB_EXPORT rc_t CC KMMapMakeUpdate ( KMMap **mm, KFile *f )
-{
-    return KMMapMakeRgnUpdate ( mm, f, 0, 0 );
-}
-
-
-/* MakeMax
- *  maps as much of a file as possible
- *
- *  "f" [ IN ] - file to map.
- *  a new reference will be added
- */
-LIB_EXPORT rc_t CC KMMapMakeMaxRead ( const KMMap **mm, const KFile *f )
-{
-    /* 32-bit architecture */
-    if ( sizeof mm == 4 )
-        return KMMapMakeRgnRead ( mm, f, 0, 1500 * 1024 * 1024 );
-
-    /* 64-bit or beyond */
-    return KMMapMakeRgnRead ( mm, f, 0,  ( ( size_t ) 48 ) * 1024 * 1024 * 1024 );
-}
-
-LIB_EXPORT rc_t CC KMMapMakeMaxUpdate ( KMMap **mm, KFile *f )
-{
-    uint64_t eof;
-    rc_t rc = KFileSize ( f, & eof );
-    if ( rc == 0 )
-    {
-        /* 32-bit architecture */
-        if ( sizeof mm == 4 && eof > 1500 * 1024 * 1024 )
-            eof = 1500 * 1024 * 1024;
-
-        /* 64-bit or beyond */
-        if ( sizeof mm == 8 && eof > ( ( size_t ) 48 ) * 1024 * 1024 * 1024 )
-            eof = ( ( size_t ) 48 ) * 1024 * 1024 * 1024;
-
-        rc = KMMapMakeRgnUpdate ( mm, f, 0, ( size_t ) eof );
-    }
-    return rc;
-}
-
-
-/* Reposition
- *  shift region to a new position
- *  may change region size
- *
- *  "pos" [ IN ] - new starting position for region
- *
- *  "size" [ OUT, NULL OKAY ] - optional return parameter
- *  for resultant region size
- */
-LIB_EXPORT rc_t CC KMMapReposition ( const KMMap *cself, uint64_t pos, size_t *size )
-{
-    KMMap *self;
-    size_t ignore;
-    if ( size == NULL )
-        size = & ignore;
-
-    * size = 0;
-
-    self = ( KMMap* ) cself;
-    if ( cself != NULL )
-    {
-        rc_t rc;
-        size_t rgn_size = self -> size;
-        uint64_t pg_mask, left, right;
-
-        /* regardless of condition, if no change
-           in position is requested, we're done */
-        if ( pos == self -> pos )
-        {
-            * size = rgn_size;
-            return 0;
-        }
-
-        /* detect multiple owners */
-        if ( atomic32_read ( & self -> refcount ) > 1 )
-            return RC ( rcFS, rcMemMap, rcPositioning, rcMemMap, rcBusy );
-
-        pg_mask = self -> pg_size - 1;
-        left = self -> pos & ~ pg_mask;
-        right = left + rgn_size + self -> size_adj;
-
-        /* we're modifiable, so see if position
-           is within first page of current map */
-        if ( ( pos & ~ pg_mask ) == left )
-        {
-            self -> addr -= self -> addr_adj;
-            self -> addr_adj = self -> size_adj = ( uint32_t ) ( pos - left );
-            self -> addr += pos - left;
-            self -> pos = pos;
-            * size = self -> size = ( size_t ) ( right - pos );
-            return 0;
-        }
-
-        if ( rgn_size != 0 || self -> size_adj != 0 )
-        {
-            rc = KMMapUnmapRgn ( self );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        self -> addr_adj = self -> size_adj = 0;
-
-        rc = ( self -> read_only ? KMMapRORgn : KMMapRWRgn ) ( self, pos, rgn_size );
-
-        if ( rc == 0 )
-            * size = self -> size;
-        return rc;
-    }
-
-    return RC ( rcFS, rcMemMap, rcPositioning, rcSelf, rcNull );
-}
diff --git a/libs/kfs/nullfile.c b/libs/kfs/nullfile.c
deleted file mode 100644
index 22eab36..0000000
--- a/libs/kfs/nullfile.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <sysalloc.h>
-#include <kfs/nullfile.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-/* ======================================================================
- * KNullFile
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KFILE_IMPL struct KNullFile
-#include <kfs/impl.h>
-
-static rc_t CC KNullFileDestroy (KNullFile *self);
-static struct KSysFile *CC KNullFileGetSysFile (const KNullFile *self,
-					     uint64_t *offset);
-static rc_t CC KNullFileRandomAccess (const KNullFile *self);
-static uint32_t CC KNullFileType (const KNullFile *self);
-static rc_t CC KNullFileSize (const KNullFile *self, uint64_t *size);
-static rc_t CC KNullFileSetSize (KNullFile *self, uint64_t size);
-static rc_t CC KNullFileRead (const KNullFile *self, uint64_t pos,
-			   void *buffer, size_t bsize, size_t *num_read);
-static rc_t CC KNullFileWrite (KNullFile *self, uint64_t pos, const void *buffer,
-			    size_t size, size_t *num_writ);
-
-
-static const KFile_vt_v1 vtKNullFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KNullFileDestroy,
-    KNullFileGetSysFile,
-    KNullFileRandomAccess,
-    KNullFileSize,
-    KNullFileSetSize,
-    KNullFileRead,
-    KNullFileWrite,
-
-    /* 1.1 */
-    KNullFileType
-};
-
-/*-----------------------------------------------------------------------
- * KNullFile
- *  an archive file including tar and sra
- */
-struct KNullFile
-{
-    KFile	dad;
-};
-
-/* ----------------------------------------------------------------------
- * KNullFileMake
- *  create a new file object
- */
-static
-rc_t KNullFileMake (KNullFile ** self, bool write_allowed)
-{
-    rc_t	rc;
-    KNullFile *	pF;
-
-    /* -----
-     */
-    assert (self != NULL);
-
-    /* -----
-     * get space for the object
-     */
-    pF = malloc (sizeof (KNullFile));
-    if (pF == NULL)	/* allocation failed */
-    {
-	/* fail */
-	rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-	rc = KFileInit (&pF->dad,			/* initialize base class */
-			(const KFile_vt*)&vtKNullFile, 	/* VTable for KNullFile */
-            "KNullFile", "no-name",
-			true,				/* read allowed */
-			write_allowed);
-	if (rc == 0)
-	{
-	    *self = pF;
-	    return 0;
-	}
-	/* fail */
-	free (pF);
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KFileMakeNullRead ( const KFile ** self )
-{
-    return KNullFileMake ((KNullFile **)self, false);
-}
-
-LIB_EXPORT rc_t CC KFileMakeNullUpdate ( KFile ** self )
-{
-    return KNullFileMake ((KNullFile **)self, true);
-}
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KNullFileDestroy (KNullFile *self)
-{
-    free (self);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We cant allow memory mapping a tee file as the read?writes ar needed
- * to trigger the writes to the copy KFile
- */
-
-static
-struct KSysFile *CC KNullFileGetSysFile (const KNullFile *self, uint64_t *offset)
-{
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    /* not implmenting at this time */
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- *
- * Update needs to be able to seek both original and copy while read
- * only needs to be able to seek the original.
- */
-static
-rc_t CC KNullFileRandomAccess (const KNullFile *self)
-{
-    assert (self != NULL);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KNullFileType (const KNullFile *self)
-{
-    return kfdNull;
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KNullFileSize (const KNullFile *self, uint64_t *size)
-{
-    assert (self != NULL);
-    assert (size != NULL);
-
-    *size = 0;
-    return 0;;
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KNullFileSetSize (KNullFile *self, uint64_t size)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KNullFileRead	(const KNullFile *self,
-			 uint64_t pos,
-			 void *buffer,
-			 size_t bsize,
-			 size_t *num_read)
-{
-    *num_read = 0;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KNullFileWrite (KNullFile *self, uint64_t pos,
-		       const void *buffer, size_t bsize,
-		       size_t *num_writ)
-{
-    *num_writ = bsize;
-    return 0;
-}
-
-/* end of file nullfile.c */
-
diff --git a/libs/kfs/pagefile.c b/libs/kfs/pagefile.c
deleted file mode 100644
index bf0f05f..0000000
--- a/libs/kfs/pagefile.c
+++ /dev/null
@@ -1,1283 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/pagefile.h>
-#include <kfs/impl.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <atomic.h>
-#include <sysalloc.h>
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#define REQUIRE_RANDOM_ACCESS 0
-
-/*--------------------------------------------------------------------------
- * KPageMem
- *  the raw page memory
- */
-
-/* must be kept in sync with kdb/btree.c */
-#define PGBITS 15
-#define PGSIZE ( 1U << PGBITS )
-
-static
-rc_t KPageMemNew ( void **ppage )
-{
-    void *page = calloc ( PGSIZE, 1 );
-    if ( page == NULL )
-        return RC ( rcFS, rcBlob, rcAllocating, rcMemory, rcExhausted );
-
-    * ppage = page;
-    return 0;
-}
-
-static
-rc_t KPageMemMake ( void **ppage )
-{
-    void *page = malloc ( PGSIZE );
-    if ( page == NULL )
-        return RC ( rcFS, rcBlob, rcAllocating, rcMemory, rcExhausted );
-
-    * ppage = page;
-    return 0;
-}
-
-static
-void KPageMemWhack ( void *page )
-{
-    free ( page );
-}
-
-
-/*--------------------------------------------------------------------------
- * KPageBacking
- *  a reference KFile wrapper
- */
-typedef struct KPageBacking KPageBacking;
-struct KPageBacking
-{
-    uint64_t eof;
-    KFile *backing;
-    KRefcount refcount;
-    bool write_through;
-    bool have_eof;
-};
-
-/* Whack
- */
-static
-void KPageBackingWhack ( KPageBacking *self )
-{
-    if(self -> backing) KFileRelease ( self -> backing );
-    free ( self );
-}
-
-/* Attach
- */
-static
-KPageBacking *KPageBackingAttach ( const KPageBacking *self )
-{
-    if ( self != NULL ) switch ( KRefcountAddDep ( & self -> refcount, "KPageBacking" ) )
-    {
-    case krefOkay:
-        return ( KPageBacking* ) self;
-    }
-
-    return NULL;
-}
-
-/* Sever
- */
-static
-void KPageBackingSever ( const KPageBacking *self )
-{
-    if ( self != NULL ) switch ( KRefcountDropDep ( & self -> refcount, "KPageBacking" ) )
-    {
-    case krefWhack:
-        KPageBackingWhack ( ( KPageBacking* ) self );
-        break;
-    }
-}
-
-/* Release
- */
-static
-void KPageBackingRelease ( const KPageBacking *self )
-{
-    if ( self != NULL ) switch ( KRefcountDrop ( & self -> refcount, "KPageBacking" ) )
-    {
-    case krefWhack:
-        KPageBackingWhack ( ( KPageBacking* ) self );
-        break;
-    }
-}
-
-/* Drop
- *  drop backing file
- */
-static
-rc_t KPageBackingDrop ( KPageBacking *self )
-{
-    KFile *backing;
-
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcDetaching, rcSelf, rcNull );
-
-    backing = self -> backing;
-    if ( backing != NULL && atomic_test_and_set_ptr ( ( void* volatile* ) & self -> backing, NULL, backing ) == backing )
-        KFileRelease ( backing );
-
-    self -> write_through = false;
-
-    return 0;
-}
-
-/* SetSize
- *  sets size of backing store
- */
-#define BACKING_FILE_GROWTH 1024 /** number of pages to grow at a time**/
-#define BACKING_FILE_MASK ( BACKING_FILE_GROWTH - 1 )
-static
-rc_t KPageBackingSetSize ( KPageBacking *self, uint32_t pg_count )
-{
-    uint64_t new_eof;
-
-    if ( pg_count > BACKING_FILE_GROWTH )
-		pg_count = ( pg_count + BACKING_FILE_MASK ) & ~ BACKING_FILE_MASK;
-
-    new_eof =  ( uint64_t ) pg_count << PGBITS;
-    if ( new_eof == self -> eof )
-        return 0;
-
-    self -> eof = new_eof;
-    return KFileSetSize ( self -> backing, self -> eof );
-}
-
-/* Read
- *  read a page from backing
- */
-#if 0
-static
-rc_t KFileReadAll ( const KFile *self, uint64_t pos, uint8_t *buff, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    size_t total, partial;
-
-    for ( rc = 0, total = 0; total < bsize; total += partial )
-    {
-        rc = KFileRead ( self, pos + total, & buff [ total ], bsize - total, & partial );
-        if ( rc != 0 )
-            break;
-        if ( partial == 0 )
-            break;
-    }
-
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-
-    * num_read = 0;
-    return rc;
-}
-#endif
-
-static
-rc_t KPageBackingRead ( const KPageBacking *self, void **ppage, uint32_t pg_id )
-{
-    rc_t rc;
-    uint64_t pos;
-
-    /* can't read if backing isn't there */
-    if ( self -> backing == NULL )
-    {
-        * ppage = NULL;
-        return RC ( rcFS, rcFile, rcReading, rcBlob, rcNotFound );
-    }
-
-    /* the offset to the first byte after requested page */
-    pos = ( uint64_t ) pg_id << PGBITS;
-
-    /* allocate a page */
-    rc = KPageMemMake ( ppage );
-    if ( rc == 0 )
-    {
-        /* retrieve memory */
-        void *page = * ppage;
-
-        /* read page from file */
-        size_t num_read;
-        rc = KFileReadAll ( self -> backing, pos -= PGSIZE, page, PGSIZE, & num_read );
-        if ( rc == 0 )
-        {
-            if ( num_read != 0 )
-            {
-                /* keep track of eof */
-                pos += num_read;
-                if ( self -> eof < pos )
-                    ( ( KPageBacking* ) self ) -> eof = pos;
-
-                /* detect a partial page */
-                if ( num_read < PGSIZE )
-                    memset ( & ( ( uint8_t* ) page ) [ num_read ], 0, PGSIZE - num_read );
-
-                /* return page */
-                * ppage = page;
-                return 0;
-            }
-
-            rc = RC ( rcFS, rcFile, rcReading, rcBlob, rcNotFound );
-        }
-
-        KPageMemWhack ( page );
-    }
-
-    * ppage = NULL;
-    return rc;
-}
-
-
-/* Write
- *  write a page to backing store
- */
-#if 0
-static
-rc_t KFileWriteAll ( KFile *self, uint64_t pos, const uint8_t *buff, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    size_t total, partial;
-
-    for ( rc = 0, total = 0; total < size; total += partial )
-    {
-        rc = KFileWrite ( self, pos + total, & buff [ total ], size - total, & partial );
-        if ( rc != 0 )
-            break;
-        if ( partial == 0 )
-        {
-            rc = RC ( rcFS, rcBlob, rcWriting, rcTransfer, rcIncomplete );
-            break;
-        }
-    }
-
-    if ( total != 0 )
-    {
-        * num_writ = total;
-        return 0;
-    }
-
-    * num_writ = 0;
-    return rc;
-}
-#endif
-
-static
-rc_t KPageBackingWrite ( KPageBacking *self, const void *page, uint32_t pg_id )
-{
-    rc_t rc;
-    uint64_t pos;
-    size_t num_writ;
-
-    /* allow backing to be removed */
-    if ( self -> backing == NULL )
-    {
-        self -> write_through = false;
-        return 0;
-    }
-
-    /* the offset to the first byte after requested page */
-    pos = ( uint64_t ) pg_id << PGBITS;
-
-    /* write the page */
-    rc = KFileWriteAll ( self -> backing, pos -= PGSIZE, page, PGSIZE, & num_writ );
-    if ( rc == 0 )
-    {
-        pos += num_writ;
-        if ( self -> eof < pos )
-            self -> eof = pos;
-
-        if ( num_writ == PGSIZE )
-            return 0;
-
-        /* technically it is permissible for the file to deny us a complete page
-           but for this test, the file should accept whole pages.
-        */
-        rc = RC ( rcFS, rcBlob, rcWriting, rcTransfer, rcIncomplete );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KPage
- *  a reference counted page
- *  meant to be held within a BSTree and DLList
- */
-struct KPage
-{
-    /* head for LRU cache */
-    DLNode ln;
-
-    /* backing file */
-    KPageBacking *backing;
-
-    /* raw memory */
-    void *page;
-
-    KRefcount refcount;
-
-    uint32_t page_id;
-    bool read_only;
-    bool dirty;
-};
-
-
-
-/* Whack
- */
-static
-rc_t KPageWhack ( KPage *self )
-{
-    if ( self -> backing ) {
-	if ( self -> dirty )
-	    KPageBackingWrite ( self -> backing, self -> page, self -> page_id );
-	KPageBackingSever ( self -> backing );
-    }
-    KPageMemWhack ( self -> page );
-    free ( self );
-    return 0;
-}
-
-
-/* New
- *  make a new page
- */
-static
-rc_t KPageNew ( KPage **ppage, KPageBacking *backing, uint32_t page_id )
-{
-    rc_t rc;
-    KPage *page = malloc ( sizeof * page );
-    if ( page == NULL )
-        rc = RC ( rcFS, rcBlob, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KPageMemNew ( & page -> page );
-        if ( rc == 0 )
-        {
-            if(backing)page -> backing = KPageBackingAttach ( backing );
-	    else page -> backing=NULL;
-            KRefcountInit ( & page -> refcount, 1, "KPage", "new", "page" );
-            page -> page_id = page_id;
-            page -> read_only = false;
-            page -> dirty = false;
-
-            * ppage = page;
-            return 0;
-        }
-
-        free ( page );
-    }
-
-    * ppage = NULL;
-    return rc;
-}
-
-
-/* Make
- *  make a page from backing
- */
-static
-rc_t KPageMake ( KPage **ppage, KPageBacking *backing, uint32_t page_id )
-{
-    rc_t rc;
-    KPage *page = malloc ( sizeof * page );
-    if ( page == NULL )
-        rc = RC ( rcFS, rcBlob, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KPageBackingRead ( backing, & page -> page, page_id );
-        if ( rc == 0 )
-        {
-            page -> backing = KPageBackingAttach ( backing );
-            KRefcountInit ( & page -> refcount, 1, "KPage", "make", "page" );
-            page -> page_id = page_id;
-            page -> read_only = false;
-            page -> dirty = false;
-
-            * ppage = page;
-            return 0;
-        }
-
-        free ( page );
-    }
-
-    * ppage = NULL;
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KPageAddRef ( const KPage *self )
-{
-    if ( self != NULL ) switch ( KRefcountAdd ( & self -> refcount, "KPage" ) )
-    {
-    case krefOkay:
-        break;
-    default:
-        return RC ( rcFS, rcBlob, rcAttaching, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KPageRelease ( const KPage *self )
-{
-    if ( self != NULL ) switch ( KRefcountDrop ( & self -> refcount, "KPage" ) )
-    {
-    case krefOkay:
-        if ( self -> dirty && self -> backing && self -> backing -> write_through )
-        {
-            rc_t rc = KPageBackingWrite ( self -> backing, self -> page, self -> page_id );
-            if ( rc != 0 )
-                return rc;
-
-            ( ( KPage* ) self ) -> dirty = false;
-        }
-        break;
-    case krefWhack:
-        return KPageWhack ( ( KPage* ) self );
-    default:
-        return RC ( rcFS, rcBlob, rcReleasing, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-
-/* Attach
- * Sever
- *  ignores NULL references
- */
-static
-void KPageAttach ( const KPage *self )
-{
-    if ( self != NULL )
-        KRefcountAddDep ( & self -> refcount, "KPage" );
-}
-
-static
-rc_t KPageSever ( const KPage *self )
-{
-    if ( self != NULL ) switch ( KRefcountDropDep ( & self -> refcount, "KPage" ) )
-    {
-    case krefOkay:
-        break;
-    case krefWhack:
-        return KPageWhack ( ( KPage* ) self );
-    default:
-        return RC ( rcFS, rcBlob, rcReleasing, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-
-
-/* Id
- *  returns page id
- *
- *  "page_id" [ OUT ] - return parameter for page id
- */
-LIB_EXPORT rc_t CC KPageId ( const KPage *self, uint32_t *page_id )
-{
-    rc_t rc;
-
-    if ( page_id == NULL )
-        rc = RC ( rcFS, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcBlob, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * page_id = self -> page_id;
-            return 0;
-        }
-
-        * page_id = 0;
-    }
-
-    return rc;
-}
-
-
-/* ConstSize
- *  returns constant page size
- */
-LIB_EXPORT size_t CC KPageConstSize ( void )
-{
-    return PGSIZE;
-}
-
-
-/* AccessRead
- * AccessUpdate
- *  gain access to page memory
- *  update access marks page as modified
- */
-LIB_EXPORT rc_t CC KPageAccessRead ( const KPage *self, const void **mem, size_t *bytes )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( bytes == NULL )
-        bytes = & dummy;
-
-    if ( mem == NULL )
-        rc = RC ( rcFS, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcBlob, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            assert ( self -> page != NULL );
-            * mem = self -> page;
-            * bytes = PGSIZE;
-            return 0;
-        }
-
-        * mem = NULL;
-    }
-
-    * bytes = 0;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KPageAccessUpdate ( KPage *self, void **mem, size_t *bytes )
-{
-    rc_t rc;
-
-    size_t dummy;
-    if ( bytes == NULL )
-        bytes = & dummy;
-
-    if ( mem == NULL )
-        rc = RC ( rcFS, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcBlob, rcAccessing, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcFS, rcBlob, rcAccessing, rcBlob, rcReadonly );
-        else
-        {
-            assert ( self -> page != NULL );
-            self -> dirty = true;
-            * mem = self -> page;
-            * bytes = PGSIZE;
-            return 0;
-        }
-
-        * mem = NULL;
-    }
-
-    * bytes = 0;
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KPageFile
- *  presents some level of page management on top of a random-access KFile
- */
-struct KPageFile
-{
-    void   **page_idx;
-    uint8_t  page_idx_depth;
-    DLList by_access;
-    KPageBacking *backing;
-    KRefcount refcount;
-    uint32_t count;
-    uint32_t ccount;
-    uint32_t climit;
-    bool read_only;
-};
-
-
-static
-void* KPageFile_whack_recursive(void **idx,uint8_t depth,uint32_t count,DLList *mru,uint32_t *ccount)
-{
-	if(idx){
-		if(depth == 0){
-			rc_t rc;
-			KPage *page=(KPage*)idx;
-			DLListUnlink(mru,&page->ln);
-			rc=KPageSever(page);
-			if(ccount) ccount[0]--;
-			assert(rc==0);
-		} else {
-			int i;
-			uint8_t offset;
-			depth--;
-			offset=(count >>(8*depth))&0xff;
-			idx[offset]=KPageFile_whack_recursive((void**)idx[offset],depth,count,mru,ccount);
-			for(i=(int)offset+1;i<256;i++){
-				if(idx[i]){
-					idx[i]=KPageFile_whack_recursive((void**)idx[i],depth,0,mru,ccount);
-				}
-			}	
-			if(depth == 0){
-				if(offset == 0){
-					free(idx);
-					return NULL;
-				} else {
-					return idx;
-				}
-			} else if(offset == 0 || (offset == 1 && idx[1]==NULL)){
-				void *tmp=idx[0];
-				free(idx);
-				return tmp;
-			} else {
-				return idx;
-			}
-		}
-	}
-	return NULL;
-}
-#define PAGE_IDX_DEPTH(A) ((A)>(1<<24)?4:((A)>(1<<16)?3:((A)>256?2:((A)>0?1:0))))
-static
-rc_t KPageFileSetPageCount(KPageFile *self,uint32_t count)
-{
-	void **tmp;	
-	uint8_t new_depth=PAGE_IDX_DEPTH(count);
-/******* Adjust depth and change structure of the index if needed ****/
-	if(new_depth > self->page_idx_depth){
-		if(self->page_idx == NULL){
-			self->page_idx_depth = new_depth;
-		} else while(self->page_idx_depth < new_depth){
-			tmp=malloc(256*sizeof(*tmp));
-			memset(tmp,0,256*sizeof(*tmp));
-			tmp[0]=self->page_idx;
-			self->page_idx=tmp;
-			self->page_idx_depth++;
-		}
-	}
-	if(count < self->count){
-		self->page_idx=KPageFile_whack_recursive(self->page_idx,self->page_idx_depth,count,&self->by_access,&self->ccount);
-		self->page_idx_depth = new_depth;
-	}
-	self->count=count;
-	if( self -> read_only) return 0;
-	if( self -> backing ) return KPageBackingSetSize ( self -> backing, count );
-	else if ( self->count > self->climit ){
-                return RC ( rcFS, rcFile, rcProcessing, rcBuffer, rcExhausted );
-	}
-	return 0;
-}
-/* Whack
- */
-
-static
-rc_t KPageFileWhack ( KPageFile *self )
-{
-    /* first, visit each cached page in flush order */
-    self->page_idx=KPageFile_whack_recursive(self->page_idx,self->page_idx_depth,0,&self->by_access,&self->ccount);
-    /* release the backing file */
-    if(self -> backing) KPageBackingRelease ( self -> backing );
-    /* delete the object */
-    free ( self );
-    return 0;
-}
-
-/* Make
- *  creates a page file
- *
- *  "pf" [ OUT ] - return parameter for page file
- *
- *  "backing" [ IN ] - backing file
- *   NB - attaches a new reference to file
- *        does not take ownership
- *
- *  "climit" [ IN ] - cache size limit
- */
-#define MIN_CACHE_PAGE 2
-LIB_EXPORT rc_t CC KPageFileMakeRead ( const KPageFile **pf,
-    const KFile *backing, size_t climit )
-{
-    rc_t rc;
-
-    if ( pf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( backing == NULL )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNull );
-        else if ( ! backing -> read_enabled )
-            rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KPageBacking *bf = calloc ( 1, sizeof * bf );
-            if ( bf == NULL )
-                rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                KPageFile *f = malloc ( sizeof * f );
-                if ( f == NULL )
-                    rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-                else
-                {
-                    rc = KFileAddRef ( backing );
-                    if ( rc == 0 )
-                    {
-			f->page_idx=NULL;
-			f->page_idx_depth=0;
-                        DLListInit ( & f -> by_access );
-                        KRefcountInit ( & f -> refcount, 1, "KPageFile", "make", "pgfile" );
-                        f -> count = 0;
-                        f -> ccount = 0;
-                        f -> climit = ( uint32_t ) ( climit >>  PGBITS );
-			if(f -> climit < MIN_CACHE_PAGE) f -> climit = MIN_CACHE_PAGE;
-                        f -> read_only = true;
-
-                        /* finish the backing file */
-                        KRefcountInit ( & bf -> refcount, 1, "KPageBacking", "make", "backing" );
-                        f -> backing = bf;
-                        bf -> write_through = false;
-
-                        /* attached reference */
-                        bf -> backing = ( KFile* ) backing;
-
-                        /* if backing is random access, get its size */
-                        rc = KFileSize ( backing, & bf -> eof );
-                        if ( rc == 0 )
-                        {
-                            bf -> have_eof = true;
-			    rc=KPageFileSetPageCount(f,( uint32_t ) ( ( bf -> eof + PGSIZE - 1 ) >> PGBITS ));
-			    if(rc!=0) return rc;
-                        }
-
-                        * pf = f;
-                        return 0;
-                    }
-
-                    free ( f );
-                }
-
-                free ( bf );
-            }
-        }
-
-        * pf = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KPageFileMakeUpdate ( KPageFile **pf,
-    KFile *backing, size_t climit, bool write_through )
-{
-    rc_t rc=0;
-
-    if ( pf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( backing != NULL ){
-        	if ( ! backing -> read_enabled )
-		{
-		    if ( backing -> write_enabled )
-			rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcWriteonly );
-		    else
-			rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcNoPerm );
-		}
-		else if ( ! backing -> write_enabled )
-		    rc = RC ( rcFS, rcFile, rcConstructing, rcFile, rcReadonly );
-	}
-        if(rc == 0)
-        {
-	    KPageFile *f = malloc ( sizeof * f );
-	    if ( f == NULL )
-                    rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else 
-	    {
-		f->page_idx=NULL;
-		f->page_idx_depth=0;
-		DLListInit ( & f -> by_access );
-		KRefcountInit ( & f -> refcount, 1, "KPageFile", "make", "pgfile" );
-		f -> count = 0;
-		f -> ccount = 0;
-		f -> climit = ( uint32_t ) ( climit >>  PGBITS );
-		if(f -> climit < MIN_CACHE_PAGE) f -> climit = MIN_CACHE_PAGE;
-		f -> read_only = false;
-		f -> backing = NULL; /** for now **/
-	    }
-	    if(rc == 0 && backing)
-            {
-		KPageBacking *bf = calloc ( 1, sizeof * bf );
-		if ( bf == NULL )
-			rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-                else
-                {
-                    rc = KFileAddRef ( backing );
-		    if(rc == 0)
-		     {
-                        /* finish the backing file */
-                        KRefcountInit ( & bf -> refcount, 1, "KPageBacking", "make", "backing" );
-                        bf -> write_through = write_through;
-                        /* attached reference */
-                        bf -> backing = backing;
-
-                        /* see if file is random access */
-                        rc = KFileSize ( backing, & bf -> eof );
-                        if ( rc == 0 )
-                        {
-                            bf -> have_eof = true;
-                        }
-                    }
-                }
-		if (rc == 0){
-			f -> backing = bf;
-			rc=KPageFileSetPageCount(f,( uint32_t ) ( ( bf -> eof + PGSIZE - 1 ) >> PGBITS ));
-		} else if ( bf ){
-			free ( bf );
-		}
-            }
-	    if(rc == 0){
-		* pf = f;
-	    } else if (f) {
-		free(f);
-	    }
-        }
-	if(rc != 0) *pf = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KPageFileAddRef ( const KPageFile *self )
-{
-    if ( self != NULL ) switch ( KRefcountAdd ( & self -> refcount, "KPageFile" ) )
-    {
-    case krefOkay:
-        break;
-    default:
-        return RC ( rcFS, rcFile, rcAttaching, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KPageFileRelease ( const KPageFile *self )
-{
-    if ( self != NULL ) switch ( KRefcountDrop ( & self -> refcount, "KPageFile" ) )
-    {
-    case krefOkay:
-        break;
-    case krefWhack:
-        return KPageFileWhack ( ( KPageFile* ) self );
-    default:
-        return RC ( rcFS, rcFile, rcReleasing, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-
-/* Size
- *  returns size in bytes of file and cache
- *
- *  "lsize" [ OUT, NULL OKAY ] - return parameter for logical size
- *
- *  "fsize" [ OUT, NULL OKAY ] - return parameter for file size
- *
- *  "csize" [ OUT, NULL OKAY ] - return parameter for cache size
- */
-LIB_EXPORT rc_t CC KPageFileSize ( const KPageFile *self,
-    uint64_t *lsize, uint64_t *fsize, size_t *csize )
-{
-    rc_t rc = 0;
-
-    size_t dummysz;
-    uint64_t dummy64;
-
-    if ( lsize == NULL )
-        lsize = & dummy64;
-    if ( fsize == NULL )
-        fsize = & dummy64;
-    if ( csize == NULL )
-        csize = & dummysz;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        if ( self -> backing == NULL || self -> backing -> backing == NULL )
-            * fsize = 0;
-        else if ( ! self -> backing -> have_eof )
-            * fsize = self -> backing -> eof;
-        else
-            rc = KFileSize ( self -> backing -> backing, fsize );
-
-        if ( rc == 0 )
-        {
-            * lsize = ( uint64_t ) self -> count << PGBITS;
-            * csize = ( uint64_t ) self -> ccount << PGBITS;
-            return 0;
-        }
-    }
-
-    * lsize = 0;
-    * fsize = 0;
-    * csize = 0;
-
-    return rc;
-}
-
-/* SetSize
- *  extends or truncates underlying file
- *  may affect cache contents
- *
- *  "size" [ IN ] - logical size
- */
-LIB_EXPORT rc_t CC KPageFileSetSize ( KPageFile *self, uint64_t size )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcFile, rcUpdating, rcSelf, rcNull );
-    else
-    {
-        uint32_t new_count = ( uint32_t ) ( ( size + PGSIZE - 1 ) >> PGBITS );
-	rc=KPageFileSetPageCount(self,new_count);
-	if(rc) return rc;
-	assert(self->count == new_count);
-    }
-    return rc;
-}
-static
-rc_t KPageFileIndexInsert(KPageFile *self, KPage *page)
-{
-	void    	**tmp;
-	uint8_t		depth;
-	uint32_t	page_id=page->page_id;
-	uint8_t		offset;
-
-	assert(page->page_id > 0);
-	if(page->page_id > self->count){/**** This is an autogrowth ***/
-		rc_t rc= KPageFileSetPageCount(self,page->page_id);
-		if(rc) return rc;
-	}
-	if(self->page_idx == NULL){
-		self->page_idx = malloc(256*sizeof(*tmp));
-		if(self->page_idx==0)
-			return RC(rcFS, rcIndex, rcInserting, rcMemory, rcInsufficient);
-		memset(self->page_idx,0,256*sizeof(void*));
-	}
-	tmp=self->page_idx;
-	depth=self->page_idx_depth;
-	assert(PAGE_IDX_DEPTH(page_id) <= depth);
-	while(depth > 1){
-		offset = ((page_id-1) >> (depth-1)*8)&0xff;
-		if(tmp[offset]==0){
-			tmp[offset]=malloc(256*sizeof(*tmp));
-			if(tmp[offset]==0)
-				return RC(rcFS, rcIndex, rcInserting, rcMemory, rcInsufficient);
-			memset(tmp[offset],0,256*sizeof(void*));
-		}
-		assert(tmp[offset]);
-		tmp=(void**)tmp[offset];
-		depth--;
-	}
-	assert(depth==1);
-	offset=(page_id-1) & 0xff;
-	if(tmp[offset] && tmp[offset]!=page) return RC(rcFS, rcIndex, rcInserting,rcId,rcDuplicate);
-	tmp[offset]=page;
-	return 0;
-}
-static
-rc_t KPageFileIndexDelete(KPageFile *self, uint32_t page_id)
-{
-	void            **tmp=self->page_idx;
-	uint8_t         depth=self->page_idx_depth;
-        uint8_t         offset;
-	assert(page_id > 0);
-        assert(PAGE_IDX_DEPTH(page_id) <= depth);
-	while(depth > 1){
-                offset = ((page_id-1) >> (depth-1)*8)&0xff;
-		if(tmp[offset]==0){
-			return RC(rcFS, rcIndex, rcRemoving,rcId,rcInconsistent);
-		}
-		assert(tmp[offset]);
-		tmp=(void**)tmp[offset];
-		depth--;
-	}
-	offset=(page_id-1) & 0xff;
-	if(tmp[offset]==0){
-		return RC(rcFS, rcIndex, rcRemoving,rcId,rcInconsistent);
-	}
-	tmp[offset]=0;
-	return 0;
-}
-static
-KPage* KPageFileIndexFind(KPageFile *self, uint32_t page_id)
-{
-        void            **tmp=self->page_idx;
-        uint8_t         depth=self->page_idx_depth;
-        uint8_t         offset;
-	assert(page_id > 0);
-        if(PAGE_IDX_DEPTH(page_id) > depth) return NULL;
-
-	if(tmp==NULL) return NULL;
-	while(depth > 1){
-                offset = ((page_id-1) >> (depth-1)*8)&0xff;
-                if(tmp[offset]==0){
-                        return NULL;
-                }
-                assert(tmp[offset]);
-                tmp=(void**)tmp[offset];
-                depth--;
-        }
-	offset=(page_id-1) & 0xff;
-	assert(tmp[offset]==0 || ((KPage*)tmp[offset])->page_id == page_id);
-	return (KPage*)tmp[offset];
-}
-
-	
-/* CachePage
- *  insert a page into cache
- */
-static
-rc_t KPageFileCachePage ( KPageFile *self, KPage *page )
-{
-    rc_t rc;
-
-    /* perform insert */
-    rc=KPageFileIndexInsert(self,page);
-    if(rc != 0) return rc;	
-    DLListPushHead ( & self -> by_access, & page -> ln );
-
-    /* attach reference to page */
-    KPageAttach ( page );
-
-    /* check limit */
-    if ( ++ self -> ccount <= self -> climit )
-        return 0;
-
-    do
-    {
-        DLNode *last = DLListPopTail ( & self -> by_access );
-        KPage *doomed = ( KPage* ) last;
-	rc=KPageFileIndexDelete(self,doomed->page_id);
-	if(rc==0) rc = KPageSever ( doomed );
-    }
-    while ( -- self -> ccount > self -> climit && rc == 0 );
-
-    return rc;
-}
-
-
-/* Alloc
- *  allocates a new page
- *  the page will be zeroed and initially unmodified
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "page_id" [ OUT, NULL OKAY ] - optional return parameter for page id
- */
-LIB_EXPORT rc_t CC KPageFileAlloc ( KPageFile *self, KPage **ppage, uint32_t *page_id )
-{
-    rc_t rc;
-
-    uint32_t dummy;
-    if ( page_id == NULL )
-        page_id = & dummy;
-
-    if ( ppage == NULL )
-        rc = RC ( rcFS, rcFile, rcAllocating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcAllocating, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcFS, rcBlob, rcAllocating, rcFile, rcReadonly );
-        else
-        {
-            /* create new page */
-            rc = KPageNew ( ppage, self -> backing, self -> count + 1 );
-            if ( rc == 0 )
-            {
-                /* insert into cache */
-                rc = KPageFileCachePage ( self, * ppage );
-                if ( rc == 0 )
-                {
-                    * page_id = self -> count;
-                    return 0;
-                }
-
-                KPageRelease ( * ppage );
-            }
-        }
-
-        * ppage = NULL;
-    }
-
-    * page_id = 0;
-
-    return rc;
-}
-
-
-/* Get
- *  returns an existing page
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "page_id" [ IN ] - id of page to retrieve
- */
-LIB_EXPORT rc_t CC KPageFileGet ( KPageFile *self, KPage **ppage, uint32_t page_id )
-{
-    rc_t rc;
-
-    if ( ppage == NULL )
-        rc = RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-        else if ( page_id == 0 )
-            rc = RC ( rcFS, rcFile, rcReading, rcId, rcNull );
-        else
-        {
-	    KPage *page = KPageFileIndexFind(self,page_id);/** try to see if MRU pages work **/
-            if ( page != NULL )
-            {
-                rc = KPageAddRef ( * ppage = page );
-                if ( rc == 0 )
-                {
-                    /* put page at head of list if not already there */
-                    if ( DLListHead ( & self -> by_access ) != & page -> ln )
-                    {
-                        DLListUnlink ( & self -> by_access, & page -> ln );
-                        DLListPushHead ( & self -> by_access, & page -> ln );
-                    }
-                    return 0;
-                }
-
-                * ppage = NULL;
-                return rc;
-            }
-
-            rc = KPageMake ( ppage, self -> backing, page_id );
-            if ( rc == 0 )
-            {
-                /* insert into cache */
-                rc = KPageFileCachePage ( self, * ppage );
-                if ( rc == 0 )
-                    return 0;
-
-                KPageRelease ( * ppage );
-            }
-        }
-
-        * ppage = NULL;
-    }
-
-    return rc;
-}
-
-
-/* PosGet
- *  returns a page corresponding to position
- *
- *  "page" [ OUT ] - return parameter for page object
- *
- *  "offset" [ IN ] - offset to a byte within file
- */
-LIB_EXPORT rc_t CC KPageFilePosGet ( KPageFile *self, KPage **page, uint64_t offset )
-{
-    rc_t rc;
-
-    if ( page == NULL )
-        rc = RC ( rcFS, rcFile, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcFile, rcReading, rcSelf, rcNull );
-        else
-        {
-            uint32_t aid, count = self -> count;
-            uint32_t zpgid = ( uint32_t ) ( offset >> PGBITS );
-
-            if ( self -> read_only || zpgid < count )
-                return KPageFileGet ( self, page, zpgid + 1 );
-
-            /* potentially extend count so that
-               the oid assigned will be zpgid + 1 */
-            self -> count = zpgid;
-            rc = KPageFileAlloc ( self, page, & aid );
-            if ( rc == 0 )
-            {
-                assert ( zpgid + 1 == aid );
-                return 0;
-            }
-
-            self -> count = count;
-        }
-
-        * page = NULL;
-    }
-
-    return rc;
-}
-
-
-/* DropBacking
- *  used immediately prior to releasing
- *  prevents modified pages from being flushed to disk
- */
-LIB_EXPORT rc_t CC KPageFileDropBacking ( KPageFile *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcFile, rcDetaching, rcSelf, rcNull );
-
-    return self -> backing?KPageBackingDrop ( self -> backing ):0;
-}
diff --git a/libs/kfs/pmem.c b/libs/kfs/pmem.c
deleted file mode 100644
index c78cba9..0000000
--- a/libs/kfs/pmem.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/pmem.h>
-#include <kfs/pagefile.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KMemBlock
- * KExtMemBlock
- *  bad for random access, but reasonable for the application
- *  blocks are stored as linked lists
- */
-typedef struct KMemBlock KMemBlock;
-struct KMemBlock
-{
-    uint64_t next;
-    uint64_t size;
-    uint8_t data [ 48 ];
-};
-
-typedef struct KExtMemBlock KExtMemBlock;
-struct KExtMemBlock
-{
-    uint64_t next;
-    uint8_t data [ 56 ];
-};
-
-#define MEMBLOCK_DATASIZE( block, block_size ) \
-    ( ( block_size ) - sizeof * ( block ) + sizeof ( block ) -> data )
-
-#define MEMBLOCK_RDATA( block, block_size, offset ) \
-    & ( block ) -> data [ MEMBLOCK_DATASIZE ( block, block_size ) - ( offset ) ]
-
-#define eByteOrderTag 0x05031988
-#define eByteOrderReverse 0x88190305
-
-typedef struct KHdrMemBlock KHdrMemBlock;
-struct KHdrMemBlock
-{
-    /* standard header */
-    uint32_t endian;
-    uint32_t version;
-    union
-    {
-        /* v1 layout */
-        struct
-        {
-            /* number of bytes allocated */
-            uint64_t used;
-
-            /* head of free list */
-            uint64_t free_list;
-
-            /* size of each block: <= page size */
-            uint32_t block_size;
-
-            /* free-list fragentation information */
-            uint16_t free_count;
-            uint16_t frag_count;
-
-        } v1;
-
-    } u;
-};
-
-
-/*--------------------------------------------------------------------------
- * KMemPage
- *  local cache for page during access
- *  remembers KPage and the pgid to avoid having to call to get it
- *  allows for accessing by block
- */
-typedef struct KMemPage KMemPage;
-struct KMemPage
-{
-    KPage *pg;
-    uint32_t pgid;
-};
-
-static
-rc_t KMemPageWhack ( KMemPage *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return 0;
-
-    rc = KPageRelease ( self -> pg );
-    if ( rc == 0 )
-        memset ( self, 0, sizeof * self );
-
-    return rc;
-}
-
-static
-rc_t KMemPageInit ( KMemPage *mp, KPage *pg0 )
-{
-    rc_t rc = KPageAddRef ( pg0 );
-    if ( rc != 0 )
-    {
-        memset ( mp, 0, sizeof * mp );
-        return rc;
-    }
-
-    mp -> pg = pg0;
-    mp -> pgid = 1;
-    return 0;
-}
-
-static
-rc_t KMemPageAlloc ( KMemPage *self, KPageFile *pf )
-{
-    rc_t rc = KPageRelease ( self -> pg );
-    if ( rc == 0 )
-    {
-        rc = KPageFileAlloc ( pf, & self -> pg, & self -> pgid );
-        if ( rc != 0 )
-            memset ( self, 0, sizeof * self );
-    }
-    return rc;
-}
-
-static
-rc_t KMemPageGet ( KMemPage *self, KPageFile *pf, uint32_t pgid )
-{
-    rc_t rc = KPageRelease ( self -> pg );
-    if ( rc == 0 )
-    {
-        rc = KPageFileGet ( pf, & self -> pg, self -> pgid = pgid );
-        if ( rc != 0 )
-            memset ( self, 0, sizeof * self );
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KMemBank
- *  manages simple blocks of memory
- *  optionally backed by a persistent page file
- *
- *  stores accounting information in block 0
- *
- *  accounting information includes block size and linkage
- *
- *  block links are maintained in a table
- */
-struct KMemBank
-{
-    uint64_t limit;
-
-    KPageFile *pf;
-
-    KPage *pg0;
-    KHdrMemBlock *hdr;
-
-    /* the difference between page bits and block bits
-       used to go between page id and block id */
-    uint32_t pb_bits;
-
-    /* for converting a block id to byte offset */
-    uint32_t blk_bits;
-
-    /* for masking off block index within page */
-    uint32_t blk_mask;
-
-    KRefcount refcount;
-    bool read_only;
-};
-
-
-/* Whack
- */
-static
-rc_t KMemBankWhack ( KMemBank *self )
-{
-    rc_t rc = KPageRelease ( self -> pg0 );
-    if ( rc != 0 )
-        return rc;
-
-    rc = KPageFileDropBacking ( self -> pf );
-    /* TBD - can report errors */
-
-    rc  = KPageFileRelease ( self -> pf );
-    /* TBD - can report errors */
-
-    free ( self );
-
-    return 0;
-}
-
-
-/* Make
- *  make a memory bank with a fixed block size
- *  the total amount of memory may be limited
- *  the memory may be drawn from an externally supplied page file
- *
- *  "block_size" [ IN ] - must be an even multiple of 2, minimum 64
- *
- *  "limit" [ IN, DFLT ZERO ] - the maximum number of bytes
- *  to be allocated zero for unlimited
- *
- *  "backing" [ IN, NULL OKAY ] - a page source for allocator.
- *  a new reference will be added if not null.
- */
-LIB_EXPORT rc_t CC KMemBankMake ( KMemBank **bankp,
-    size_t block_size, uint64_t limit, KPageFile *backing )
-{
-    rc_t rc;
-
-    if ( bankp == NULL )
-        rc = RC ( rcFS, rcMemory, rcConstructing, rcParam, rcNull );
-    else
-    {
-        size_t page_size = KPageConstSize ();
-
-        if ( page_size < sizeof ( KHdrMemBlock ) )
-            rc = RC ( rcFS, rcMemory, rcConstructing, rcBlob, rcInsufficient );
-        else if ( ( block_size & ( block_size - 1 ) ) != 0 )
-            rc = RC ( rcFS, rcMemory, rcConstructing, rcParam, rcInvalid );
-        else if ( block_size < 64 )
-            rc = RC ( rcFS, rcMemory, rcConstructing, rcParam, rcInsufficient );
-        else if ( block_size > page_size )
-            rc = RC ( rcFS, rcMemory, rcConstructing, rcParam, rcExcessive );
-        else
-        {
-            if ( backing != NULL )
-                rc = KPageFileAddRef ( backing );
-            else
-            {
-                size_t climit = ( size_t ) limit;
-                if ( ( uint64_t ) climit != limit )
-                    rc = RC ( rcFS, rcMemory, rcConstructing, rcParam, rcExcessive );
-                else
-                {
-                    if ( climit == 0 )
-                        climit = 256 * 1024 * 1024;
-                    rc = KPageFileMakeUpdate ( & backing, NULL, climit, false );
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                KMemBank *bank = malloc ( sizeof * bank );
-                if ( bank == NULL )
-                    rc = RC ( rcFS, rcMemory, rcConstructing, rcMemory, rcExhausted );
-                else
-                {
-                    bank -> pf = backing;
-                    rc = KPageFilePosGet ( backing, & bank -> pg0, 0 );
-                    if ( rc == 0 )
-                    {
-                        rc = KPageAccessUpdate ( bank -> pg0, ( void** ) & bank -> hdr, & page_size );
-                        if ( rc == 0 )
-                            bank -> read_only = false;
-                        else
-                        {
-                            rc_t rc2 = KPageAccessRead ( bank -> pg0, ( const void** ) & bank -> hdr, & page_size );
-                            if ( rc2 == 0 )
-                            {
-                                bank -> read_only = true;
-                                rc = 0;
-                            }
-                        }
-                        if ( rc == 0 )
-                        {
-                            KHdrMemBlock *hdr = bank -> hdr;
-
-                            /* turn block size into shift bits */
-                            for ( bank -> blk_bits = 6; block_size > ( 1U << bank -> blk_bits ); ++ bank -> blk_bits )
-                                ( void ) 0;
-
-                            /* turn page size into shift bits */
-                            for ( bank -> pb_bits = 6; page_size > ( 1U << bank -> pb_bits ); ++ bank -> pb_bits )
-                                ( void ) 0;
-
-                            /* conversion bits between page and block */
-                            assert ( bank -> pb_bits >= bank -> blk_bits );
-                            bank -> pb_bits -= bank -> blk_bits;
-                            bank -> blk_mask = ( 1U << bank -> pb_bits ) - 1;
-
-                            /* initialize the header if new */
-                            if ( hdr -> endian == 0 )
-                            {
-                                if ( bank -> read_only )
-                                    rc = RC ( rcFS, rcMemory, rcConstructing, rcFile, rcCorrupt );
-                                else
-                                {
-                                    size_t offset;
-                                    uint8_t *pgmem = ( uint8_t* ) hdr;
-
-                                    hdr -> endian = eByteOrderTag;
-                                    hdr -> version = 1;
-                                    hdr -> u . v1 . used = 0;
-                                    hdr -> u . v1 . free_list = 0;
-                                    hdr -> u . v1 . block_size = ( uint32_t ) block_size;
-                                    hdr -> u . v1 . free_count = 0;
-                                    hdr -> u . v1 . frag_count = 0;
-
-                                    /* place remainder of page 0 on free list */
-                                    for ( offset = block_size; offset < sizeof * hdr; offset += block_size )
-                                        ( void ) 0;
-                                    if ( offset < page_size )
-                                    {
-                                        KExtMemBlock *blk;
-                                        uint64_t next = hdr -> u . v1 . free_list = offset / block_size + 1;
-                                        do
-                                        {
-                                            blk = ( KExtMemBlock* ) & pgmem [ offset ];
-                                            blk -> next = ++ next;
-                                            ++ hdr -> u . v1 . free_count;
-                                        }
-                                        while ( ( offset += block_size ) < page_size );
-                                        assert ( offset == page_size );
-                                        blk -> next = 0;
-                                    }
-                                }
-                            }
-                            else if ( hdr -> endian != eByteOrderTag )
-                            {
-                                if ( hdr -> endian == eByteOrderReverse )
-                                    rc = RC ( rcFS, rcMemory, rcConstructing, rcByteOrder, rcIncorrect );
-                                else
-                                    rc = RC ( rcFS, rcMemory, rcConstructing, rcFile, rcCorrupt );
-                            }
-                            else if ( hdr -> version != 1 )
-                            {
-                                rc = RC ( rcFS, rcMemory, rcConstructing, rcFile, rcBadVersion );
-                            }
-
-                            if ( rc == 0 )
-                            {
-                                /* record our happy limit */
-                                bank -> limit = limit;
-
-                                /* initialize the reference counter */
-                                KRefcountInit ( & bank -> refcount, 1, "KMemBank", "make", "bank" );
-
-                                * bankp = bank;
-                                return 0;
-                            }
-                        }
-
-                        KPageRelease ( bank -> pg0 );
-                    }
-
-                    free ( bank );
-                }
-
-                KPageFileRelease ( backing );
-            }
-        }
-
-        * bankp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KMemBankAddRef ( const KMemBank *self )
-{
-    if ( self != NULL ) switch ( KRefcountAdd ( & self -> refcount, "KMemBank" ) )
-    {
-    case krefOkay:
-        break;
-    default:
-        return RC ( rcFS, rcMemory, rcAttaching, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KMemBankRelease ( const KMemBank *self )
-{
-    if ( self != NULL ) switch ( KRefcountDrop ( & self -> refcount, "KMemBank" ) )
-    {
-    case krefOkay:
-        break;
-    case krefWhack:
-        return KMemBankWhack ( ( KMemBank* ) self );
-    default:
-        return RC ( rcFS, rcMemory, rcReleasing, rcConstraint, rcViolated );
-    }
-
-    return 0;
-}
-
-
-/* AccessBlock
- */
-static
-rc_t KMemBankAccessBlockRead ( const KMemBank *self,
-    uint64_t id, KMemPage *mp, const KExtMemBlock **blkp )
-{
-    rc_t rc;
-    size_t bytes;
-    const uint8_t *pgmem;
-
-    /* get the proper page */
-    uint32_t pgid = ( uint32_t ) ( ( id - 1 ) >> self -> pb_bits ) + 1;
-    if ( pgid != mp -> pgid )
-    {
-        rc = KMemPageGet ( mp, self -> pf, pgid );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* get pointer to page */
-    rc = KPageAccessRead ( mp -> pg, ( const void** ) & pgmem, & bytes );
-    if ( rc == 0 )
-        * blkp = ( const KExtMemBlock* ) & pgmem [ ( ( id - 1 ) & self -> blk_mask ) << self -> blk_bits ];
-
-    return rc;
-}
-
-static
-rc_t KMemBankAccessBlockUpdate ( const KMemBank *self,
-    uint64_t id, KMemPage *mp, KExtMemBlock **blkp )
-{
-    rc_t rc;
-    size_t bytes;
-    uint8_t *pgmem;
-
-    /* get the proper page */
-    uint32_t pgid = ( uint32_t ) ( ( id - 1 ) >> self -> pb_bits ) + 1;
-    if ( pgid != mp -> pgid )
-    {
-        rc = KMemPageGet ( mp, self -> pf, pgid );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* get pointer to page */
-    rc = KPageAccessUpdate ( mp -> pg, ( void** ) & pgmem, & bytes );
-    if ( rc == 0 )
-        * blkp = ( KExtMemBlock* ) & pgmem [ ( ( id - 1 ) & self -> blk_mask ) << self -> blk_bits ];
-
-    return rc;
-}
-
-
-/* AllocBlock
- */
-static
-rc_t KMemBankAllocBlock ( KMemBank *self, uint64_t *id,
-    KMemPage *mp, KExtMemBlock **blkp, bool clear )
-{
-    rc_t rc;
-    uint8_t *pgmem;
-    KExtMemBlock *blk = NULL;
-
-    KHdrMemBlock *hdr = self -> hdr;
-
-    /* look for free block */
-    if ( hdr -> u . v1 . free_list == 0 )
-    {
-        uint64_t next;
-        size_t bsz, total, bytes;
-
-        /* allocate a page-worth of blocks */
-        rc = KMemPageAlloc ( mp, self -> pf );
-        if ( rc != 0 )
-            return rc;
-
-        /* access the page in update mode */
-        rc = KPageAccessUpdate ( mp -> pg, ( void** ) & pgmem, & bytes );
-        if ( rc != 0 )
-            return rc;
-
-        /* stitch the blocks together into linked list of free blocks */
-        bsz = hdr -> u . v1 . block_size;
-        next = ( uint64_t ) ( mp -> pgid - 1 ) << self -> pb_bits;
-        hdr -> u . v1 . free_list = ++ next;
-
-        for ( total = 0; total < bytes; total += bsz )
-        {
-            blk = ( KExtMemBlock* ) & pgmem [ total ];
-            blk -> next = ++ next;
-            ++ hdr -> u . v1 . free_count;
-        }
-        blk -> next = 0;
-    }
-
-    rc = KMemBankAccessBlockUpdate ( self, * id = hdr -> u . v1 . free_list, mp, blkp );
-    if ( rc == 0 )
-    {
-        blk = * blkp;
-        hdr -> u . v1 . free_list = blk -> next;
-        -- hdr -> u . v1 . free_count;
-        blk -> next = 0;
-
-        if ( clear )
-            memset ( blk, 0, hdr -> u . v1 . block_size );
-    }
-
-    return rc;
-}
-
-
-/* Alloc
- *  allocate memory
- *
- *  "id" [ OUT ] - return parameter for memory allocation id
- *
- *  "bytes" [ IN ] - the number of bytes to allocate
- *
- *  "clear" [ IN ] - if true, initialize the memory to zero
- */
-LIB_EXPORT rc_t CC KMemBankAlloc ( KMemBank *self,
-    uint64_t *id, uint64_t bytes, bool clear )
-{
-    rc_t rc;
-
-    if ( id == NULL )
-        rc = RC ( rcFS, rcMemory, rcAllocating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcMemory, rcAllocating, rcSelf, rcNull );
-        else if ( bytes == 0 )
-            rc = 0;
-        else
-        {
-            KExtMemBlock *block;
-
-            KMemPage mp;
-            KMemPageInit ( & mp, self -> pg0 );
-
-            rc = KMemBankAllocBlock ( self, id, & mp, & block, clear );
-            if ( rc == 0 )
-            {
-                KMemBlock *head = ( KMemBlock* ) block;
-                uint64_t total, block_size = self -> hdr -> u . v1 . block_size;
-
-                /* record size in first block */
-                head -> size = bytes;
-
-                for ( total = MEMBLOCK_DATASIZE ( head, block_size );
-                      total < bytes;
-                      total += MEMBLOCK_DATASIZE ( block, block_size ) )
-                {
-                    rc = KMemBankAllocBlock ( self, & block -> next, & mp, & block, clear );
-                    if ( rc != 0 )
-                        break;
-                }
-
-                if ( rc == 0 )
-                {
-                    KMemPageWhack ( & mp );
-                    return 0;
-                }
-
-                KMemBankFree ( self, * id );
-            }
-
-            KMemPageWhack ( & mp );
-        }
-
-        * id = 0;
-    }
-
-    return rc;
-}
-
-
-/* Free
- *  free memory
- *
- *  "id" [ IN, ZERO OKAY ] - id of the allocation to be freed
- */
-LIB_EXPORT rc_t CC KMemBankFree ( KMemBank *self, uint64_t id )
-{
-    rc_t rc;
-
-    if ( id == 0 )
-        return 0;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcMemory, rcReleasing, rcSelf, rcNull );
-    else
-    {
-        uint32_t count;
-        uint64_t free_list;
-        const KExtMemBlock *cblock;
-
-        KMemPage mp;
-        KMemPageInit ( & mp, self -> pg0 );
-
-        /* find tail of allocation and count blocks to be freed */
-        rc = KMemBankAccessBlockRead ( self, free_list = id, & mp, & cblock );
-        for ( count = 1; rc == 0 && cblock -> next != 0; ++ count )
-            rc = KMemBankAccessBlockRead ( self, free_list = cblock -> next, & mp, & cblock );
-        if ( rc == 0 )
-        {
-            KExtMemBlock *block;
-            rc = KMemBankAccessBlockUpdate ( self, free_list, & mp, & block );
-            if ( rc == 0 )
-            {
-                block -> next = self -> hdr -> u . v1 . free_list;
-                self -> hdr -> u . v1 . free_list = id;
-                self -> hdr -> u . v1 . free_count += ( uint16_t ) count;
-            }
-        }
-
-        KMemPageWhack ( & mp );
-    }
-
-    return rc;
-}
-
-
-/* Size
- *  returns the allocated capacity of the memory object
- *
- *  "id" [ IN ] - id of the allocation
- *
- *  "size" [ OUT ] - return parameter
- */
-LIB_EXPORT rc_t CC KMemBankSize ( const KMemBank *self, uint64_t id, uint64_t *size )
-{
-    rc_t rc;
-
-    if ( size == NULL )
-        rc = RC ( rcFS, rcMemory, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * size = 0;
-
-        if ( id == 0 )
-            rc = 0;
-        else if ( self == NULL )
-            rc = RC ( rcFS, rcMemory, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const KMemBlock *block;
-            
-            KMemPage mp;
-            KMemPageInit ( & mp, self -> pg0 );
-
-            rc = KMemBankAccessBlockRead ( self, id, & mp, ( const KExtMemBlock** ) & block );
-            if ( rc == 0 )
-                * size = block -> size;
-
-            KMemPageWhack ( & mp );
-        }
-    }
-
-    return rc;
-}
-
-
-/* SetSize
- *  performs a reallocation of memory object
- *
- *  "id" [ IN ] - id of the allocation being resized
- *
- *  "bytes" [ IN ] - new capacity
- */
-LIB_EXPORT rc_t CC KMemBankSetSize ( KMemBank *self, uint64_t id, uint64_t bytes )
-{
-    rc_t rc;
-
-    if ( id == 0 )
-        rc = RC ( rcFS, rcMemory, rcResizing, rcId, rcNull );
-    else if ( self == NULL )
-        rc = RC ( rcFS, rcMemory, rcResizing, rcSelf, rcNull );
-    else
-    {
-        const KMemBlock *chead;
-            
-        KMemPage mp;
-        KMemPageInit ( & mp, self -> pg0 );
-
-        /* get head block */
-        rc = KMemBankAccessBlockRead ( self, id, & mp, ( const KExtMemBlock** ) & chead );
-        if ( rc == 0 && chead -> size != bytes )
-        {
-            uint64_t cur = id;
-            uint64_t total, size = chead -> size;
-            uint64_t block_size = self -> hdr -> u . v1 . block_size;
-            const KExtMemBlock *cblock = ( const KExtMemBlock* ) chead;
-
-            /* while total < new size && more blocks, walk forward */
-            for ( total = MEMBLOCK_DATASIZE ( chead, block_size );
-                  total < size && total < bytes;
-                  total += MEMBLOCK_DATASIZE ( cblock, block_size ) )
-            {
-                rc = KMemBankAccessBlockRead ( self, cur = cblock -> next, & mp, & cblock );
-                if ( rc != 0 )
-                    break;
-            }
-            if ( rc == 0 )
-            {
-                KExtMemBlock *block;
-                rc = KMemBankAccessBlockUpdate ( self, cur, & mp, & block );
-                if ( rc == 0 )
-                {
-                    KMemBlock *head = ( KMemBlock* ) block;
-
-                    /* truncation */
-                    if ( bytes < size )
-                    {
-                        /* free any remaining blocks */
-                        rc = KMemBankFree ( self, block -> next );
-                        if ( rc == 0 )
-                        {
-                            block -> next = 0;
-                            if ( bytes < total )
-                            {
-                                if ( size > total )
-                                    size = total;
-                                if ( cur == id )
-                                    memset ( MEMBLOCK_RDATA ( head, block_size, total - bytes ), 0, size - bytes );
-                                else
-                                    memset ( MEMBLOCK_RDATA ( block, block_size, total - bytes ), 0, size - bytes );
-                            }
-                        }
-                    }
-                    /* extension */
-                    else
-                    {
-                        /* zero out to either new size or end of block */
-                        if ( size < total )
-                        {
-                            uint64_t end = bytes;
-                            if ( bytes > total )
-                                end = total;
-                            if ( cur == id )
-                                memset ( MEMBLOCK_RDATA ( head, block_size, total - size ), 0, end - size );
-                            else
-                                memset ( MEMBLOCK_RDATA ( block, block_size, total - size ), 0, end - size );
-                        }
-
-                        /* allocate more blocks as necessary */
-                        for ( ; total < bytes; total += MEMBLOCK_DATASIZE ( block, block_size ) )
-                        {
-                            rc = KMemBankAllocBlock ( self, & block -> next, & mp, & block, true );
-                            if ( rc != 0 )
-                                break;
-                        }
-                    }
-                    if ( rc == 0 )
-                    {
-                        /* set the new size */
-                        rc = KMemBankAccessBlockUpdate ( self, id, & mp, ( KExtMemBlock** ) & head );
-                        if ( rc == 0 )
-                            head -> size = bytes;
-                    }
-                }
-            }
-        }
-
-        KMemPageWhack ( & mp );
-    }
-
-    return rc;
-}
-
-
-/* Read
- *  linearly access memory
- *
- *  "id" [ IN ] - id of the allocation being read
- *
- *  "pos" [ IN ] - starting offset into allocation
- *
- *  "buffer" [ IN ] and "bsize" [ IN ] - buffer for returned data
- *
- *  "num_read" [ OUT ] - return parameter for the number of bytes read
- */
-LIB_EXPORT rc_t CC KMemBankRead ( const KMemBank *self, uint64_t id,
-   uint64_t pos, void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-
-    if ( num_read == NULL )
-        rc = RC ( rcFS, rcMemory, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( id == 0 )
-            rc = RC ( rcFS, rcMemory, rcReading, rcId, rcNull );
-        else if ( self == NULL )
-            rc = RC ( rcFS, rcMemory, rcReading, rcSelf, rcNull );
-        else
-        {
-            const KMemBlock *head;
-            
-            KMemPage mp;
-            KMemPageInit ( & mp, self -> pg0 );
-
-            /* get head block */
-            rc = KMemBankAccessBlockRead ( self, id, & mp, ( const KExtMemBlock** ) & head );
-            if ( rc == 0 && bsize != 0 && pos < head -> size )
-            {
-                if ( buffer == NULL )
-                    rc = RC ( rcFS, rcMemory, rcReading, rcBuffer, rcNull );
-                else
-                {
-                    const KExtMemBlock *block = ( const KExtMemBlock* ) head;
-                    uint64_t end, block_size = self -> hdr -> u . v1 . block_size;
-
-                    size_t to_read = bsize;
-                    if ( pos + bsize > head -> size )
-                        to_read = ( size_t ) ( head -> size - pos );
-
-                    /* scan ahead to pos */
-                    for ( end = MEMBLOCK_DATASIZE ( head, block_size );
-                          end < pos;
-                          end += MEMBLOCK_DATASIZE ( block, block_size ) )
-                    {
-                        rc = KMemBankAccessBlockRead ( self, block -> next, & mp, & block );
-                        if ( rc != 0 )
-                            break;
-                    }
-                    if ( rc == 0 )
-                    {
-                        uint8_t *dst = buffer;
-
-                        /* the number of bytes from pos to end of block */
-                        size_t remaining = ( size_t ) ( end - pos );
-
-                        /* the number to copy will be <= the remaining bytes */
-                        size_t to_copy, total = ( remaining > to_read ) ? to_read : remaining;
-
-                        /* initial copy may be partial or complete */
-                        memcpy ( dst, MEMBLOCK_RDATA ( block, block_size, remaining ), total );
-
-                        for ( ; total < to_read; total += to_copy )
-                        {
-                            rc = KMemBankAccessBlockRead ( self, block -> next, & mp, & block );
-                            if ( rc != 0 )
-                                break;
-
-                            to_copy = MEMBLOCK_DATASIZE ( block, block_size );
-                            if ( total + to_copy > to_read )
-                                to_copy = to_read - total;
-
-                            memcpy ( & dst [ total ], block -> data, to_copy );
-                        }
-
-                        if ( total != 0 )
-                        {
-                            * num_read = total;
-                            KMemPageWhack ( & mp );
-                            return 0;
-                        }
-                    }
-                }
-            }
-
-            KMemPageWhack ( & mp );
-        }
-
-        * num_read = 0;
-    }
-
-    return rc;
-}
-
-
-/* Write
- *  linearly update memory
- *  will resize as required
- *
- *  "id" [ IN ] - id of the allocation being writ
- *
- *  "pos" [ IN ] - starting offset into allocation
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to write
- *
- *  "num_writ" [ OUT ] - return parameter for the number of bytes written
- */
-LIB_EXPORT rc_t CC KMemBankWrite ( KMemBank *self, uint64_t id,
-    uint64_t pos, const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-
-    if ( num_writ == NULL )
-        rc = RC ( rcFS, rcMemory, rcWriting, rcParam, rcNull );
-    else
-    {
-        if ( id == 0 )
-            rc = RC ( rcFS, rcMemory, rcWriting, rcId, rcNull );
-        else if ( self == NULL )
-            rc = RC ( rcFS, rcMemory, rcWriting, rcSelf, rcNull );
-        else
-        {
-            const KMemBlock *chead;
-            
-            KMemPage mp;
-            KMemPageInit ( & mp, self -> pg0 );
-
-            /* get head block */
-            rc = KMemBankAccessBlockRead ( self, id, & mp, ( const KExtMemBlock** ) & chead );
-            if ( rc == 0 && size != 0 )
-            {
-                if ( buffer == NULL )
-                    rc = RC ( rcFS, rcMemory, rcWriting, rcBuffer, rcNull );
-                else
-                {
-                    uint64_t cur = id;
-                    uint64_t eof = chead -> size;
-                    const KExtMemBlock *cblock = ( const KExtMemBlock* ) chead;
-                    uint64_t end, block_size = self -> hdr -> u . v1 . block_size;
-
-                    /* scan ahead to pos */
-                    for ( end = MEMBLOCK_DATASIZE ( chead, block_size );
-                          end < eof && end < pos;
-                          end += MEMBLOCK_DATASIZE ( cblock, block_size ) )
-                    {
-                        rc = KMemBankAccessBlockRead ( self, cur = cblock -> next, & mp, & cblock );
-                        if ( rc != 0 )
-                            break;
-                    }
-                    if ( rc == 0 )
-                    {
-                        KExtMemBlock *block;
-                        rc = KMemBankAccessBlockUpdate ( self, cur, & mp, & block );
-                        if ( rc == 0 )
-                        {
-                            size_t to_copy;
-                            KMemBlock *head = ( KMemBlock* ) block;
-
-                            /* detect write position beyond eof */
-                            if ( eof < pos )
-                            {
-                                /* need to zero ahead to either pos or end of block */
-                                uint64_t stop = pos;
-                                if ( pos > end )
-                                    stop = end;
-
-                                /* bytes to zero */
-                                to_copy = ( size_t ) ( stop - eof );
-
-                                /* zero from starting offset */
-                                if ( cur == id )
-                                    memset ( MEMBLOCK_RDATA ( head, block_size, end - eof ), 0, to_copy );
-                                else
-                                    memset ( MEMBLOCK_RDATA ( block, block_size, end - eof ), 0, to_copy );
-
-                                /* allocate more blocks as necessary */
-                                for ( ; end < pos; end += MEMBLOCK_DATASIZE ( block, block_size ) )
-                                {
-                                    rc = KMemBankAllocBlock ( self, & block -> next, & mp, & block, true );
-                                    if ( rc != 0 )
-                                        break;
-                                    cur = block -> next;
-                                }
-                            }
-                            if ( rc == 0 )
-                            {
-                                size_t total;
-                                const uint8_t *src = buffer;
-
-                                /* copy in bytes - alloc as needed */
-                                for ( total = 0; ; end += MEMBLOCK_DATASIZE ( block, block_size ) )
-                                {
-                                    to_copy = ( size_t ) ( end - pos );
-                                    if ( total + to_copy > size )
-                                        to_copy = size - total;
-
-                                    if ( cur == id )
-                                        memcpy ( MEMBLOCK_RDATA ( head, block_size, end - pos ), & src [ total ], to_copy );
-                                    else
-                                        memcpy ( MEMBLOCK_RDATA ( block, block_size, end - pos ), & src [ total ], to_copy );
-
-                                    pos += to_copy;
-                                    if ( ( total += to_copy ) == size )
-                                        break;
-
-                                    if ( block -> next == 0 )
-                                        rc = KMemBankAllocBlock ( self, & block -> next, & mp, & block, false );
-                                    else
-                                        rc = KMemBankAccessBlockUpdate ( self, block -> next, & mp, & block );
-                                    if ( rc != 0 )
-                                        break;
-
-                                    cur = block -> next;
-                                }
-
-                                /* update head -> size */
-                                if ( total != 0 )
-                                {
-                                    rc = 0;
-                                    if ( pos > eof )
-                                    {
-                                        rc = KMemBankAccessBlockUpdate ( self, block -> next, & mp, ( KExtMemBlock** ) & head );
-                                        if ( rc == 0 )
-                                            head -> size = pos;
-                                    }
-                                    if ( rc == 0 )
-                                    {
-                                        KMemPageWhack ( & mp );
-                                        * num_writ = total;
-                                        return 0;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            KMemPageWhack ( & mp );
-        }
-
-        * num_writ = 0;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/quickmount.c b/libs/kfs/quickmount.c
deleted file mode 100644
index 83e2297..0000000
--- a/libs/kfs/quickmount.c
+++ /dev/null
@@ -1,967 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <kfs/quickmount.h>
-#include <kfs/directory.h>
-
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-#include <sysalloc.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/* ----------------------------------------------------------------------
- * 
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KDIR_IMPL struct KQuickMountDir
-#define KNAMELIST_IMPL   struct KQuickMountListing
-#include <kfs/impl.h>
-
-/* ======================================================================
- */
-/*--------------------------------------------------------------------------
- * KQuickMountDir
- *  a directory inside an archive (tar or SRA for example)
- *
- * This type is being engineered to mimic KQuickMountDir.
- */
-struct KQuickMountDir
-{
-    KDirectory   dad;
-    int          root;
-    const KFile* file;
-    char *       mount;
-    char         path[1];
-    /* actual allocation is based on actual string length */
-};
-
-
-
-/* KQuickMountDirCanonPath
- */
-static
-rc_t KQuickMountDirCanonPath ( const KQuickMountDir *self, enum RCContext ctx, char *path, size_t psize )
-{
-    char *low, *dst, *last, *end = path + psize;
-    low = dst = last = path + self -> root;
-
-    while ( 1 )
-    {
-        char *src = strchr ( last + 1, '/' );
-        if ( src == NULL )
-            src = end;
-
-        /* detect special sequences */
-        switch ( src - last )
-        {
-        case 2:
-            if ( last [ 1 ] == '.' )
-            {
-                /* skip over */
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-
-        case 3:
-            if ( last [ 1 ] == '.' && last [ 2 ] == '.' )
-            {
-                /* remove previous leaf in path */
-                dst [ 0 ] = 0;
-                dst = strrchr ( path, '/' );
-                if ( dst == NULL || dst < low )
-                    return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-        }
-
-        /* if rewriting, copy leaf */
-        assert ( src >= last );
-
-        if ( dst != last )
-            memmove ( dst, last, src - last );
-
-        /* move destination ahead */
-        dst += src - last;
-        
-        /* if we're done, go */
-        if ( src == end )
-                break;
-
-        /* find next separator */
-        last = src;
-    }
-
-    /* NUL terminate if modified */
-    if ( dst != end )
-        * dst = 0;
-
-    return 0;
-}
-
-/* KQuickMountDirRelativePath
- *  makes "path" relative to "root"
- *  both "root" and "path" MUST be absolute
- *  both "root" and "path" MUST be canonical, i.e. have no "./" or "../" sequences
- */
-static
-rc_t KQuickMountDirRelativePath (const KQuickMountDir *self, enum RCContext ctx,
-                                 const char *root, char *path, size_t path_max)
-{
-    int backup;
-    size_t bsize, psize;
-
-    const char *r = root + self -> root;
-    const char *p = path + self -> root;
-
-    assert ( r != NULL && r [ 0 ] == '/' );
-    assert ( p != NULL && p [ 0 ] == '/' );
-
-    for ( ; * r == * p; ++ r, ++ p )
-    {
-        /* disallow identical paths */
-        if ( * r == 0 )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-    }
-
-    /* paths are identical up to "r","p"
-       if "r" is within a leaf name, then no backup is needed
-       by counting every '/' from "r" to end, obtain backup count */
-    for ( backup = 0; * r != 0; ++ r )
-    {
-        if ( * r == '/' )
-            ++ backup;
-    }
-
-    /* the number of bytes to be inserted */
-    bsize = backup * 3;
-
-    /* align "p" to last directory separator */
-    while ( p [ -1 ] != '/' ) -- p;
-
-    /* the size of the remaining relative path */
-    psize = strlen ( p );
-
-    /* open up space if needed */
-    if ( p - path < bsize )
-    {
-        /* prevent overflow */
-        if ( bsize + psize >= path_max )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        memmove ( path + bsize, p, psize + 1 /* 1 for '\0'*/ );
-    }
-
-    /* insert backup sequences */
-    for ( bsize = 0; backup > 0; bsize += 3, -- backup )
-        memcpy ( & path [ bsize ], "../", 3 );
-
-    /* close gap */
-    if ( p - path > bsize )
-        memmove ( & path [ bsize ], p, strlen ( p ) + 1 );
-
-    return 0;
-}
-
-
-
-static __inline__
-rc_t KQuickMountDirVMakePath (const KQuickMountDir * self, enum RCContext ctx, 
-                              bool canon, char * buffer, size_t path_max,
-                              const char * path, va_list args)
-{
-    size_t psize;
-    size_t bsize;
-    rc_t rc;
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-    if ( args != NULL && path [ 0 ] == '%' )
-    {
-        rc = string_vprintf (buffer, path_max, &psize, path, args);
-
-        if (psize > path_max)
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        if (rc)
-            return rc;
-        if ( buffer [ 0 ] != '/' )
-        {
-            bsize = (self->mount - self->path) - 1;
-            if ( bsize + psize >= path_max )
-                return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-            memmove ( buffer + bsize, buffer, psize + 1 );
-            assert ( self -> path [ bsize - 1 ] == '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-        else if ( ( bsize = self -> root ) != 0 )
-        {
-            if ( bsize + psize >= path_max )
-                return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-            memmove ( buffer + bsize, buffer, psize + 1 );
-            assert ( self -> path [ bsize - 1 ] != '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-    }
-    else
-    {
-        if ( path [ 0 ] != '/' )
-        {
-/*             assert ( self -> path [ self -> size - 1 ] == '/' ); */
-            memcpy ( buffer, self -> path, bsize = (self->mount - self->path) - 1 );
-        }
-        else if ( ( bsize = self -> root ) != 0 )
-        {
-            assert ( self -> path [ bsize - 1 ] != '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-
-
-        rc = string_vprintf ( buffer + bsize, path_max - bsize, &psize, path, args );
-        if (bsize + psize >= path_max)
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        if (rc)
-            return rc;
-    }
-
-    if ( buffer [ bsize + psize ] == '/' )
-        buffer [ bsize + -- psize ] = 0;
-
-    if ( psize > 0 && ( canon || self -> root != 0 ) )
-        return KQuickMountDirCanonPath ( self, ctx, buffer, bsize + psize );
-
-    return 0;
-}
-
-
-static __inline__
-rc_t KQuickMountDirMakePath (const KQuickMountDir * self, enum RCContext ctx, 
-                             bool canon, char * buffer, size_t path_max,
-                             const char * path, ...)
-{
-    va_list args;
-    rc_t rc;
-
-    va_start (args, path);
-    rc = KQuickMountDirVMakePath (self, ctx, canon, buffer,
-                                  path_max, path, args);
-    va_end (args);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirDestroy
- */
-static rc_t CC KQuickMountDirDestroy (KQuickMountDir *self)
-{
-    rc_t rc;
-
-    rc = KFileRelease (self->file);
-
-    free (self);
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirList
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "."
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]	 const KQuickMountDir *	self		Object oriented C; KQuickMountDir object for this method
- * [OUT] KNamelist **		listp,
- * [IN]  bool (* 		f	)(const KDirectory*,const char *, void *)
- * [IN]  void *			data
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static
-rc_t CC KQuickMountDirList (const KQuickMountDir *self,
-                       KNamelist **listp,
-                       bool (CC* f) (const KDirectory *dir, const char *name, void *data),
-                       void *data,
-                       const char *path,
-                       va_list args)
-{
-    return RC (rcFS, rcDirectory, rcAccessing, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirVisit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry, where each path is also given the leaf name
- *  for convenience. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-static 
-rc_t CC KQuickMountDirVisit (const KQuickMountDir *self, 
-                      bool recurse,
-                      rc_t (CC* f) (const KDirectory *, uint32_t, const char *, void *), 
-                      void *data,
-                      const char *path,
-                      va_list args)
-{
-    return RC (rcFS, rcDirectory, rcAccessing, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirVisitUpdate
- */
-static rc_t CC KQuickMountDirVisitUpdate (KQuickMountDir *self,
-                                   bool recurse,
-                                   rc_t (CC*f) (KDirectory *,uint32_t,const char *,void *),
-                                   void *data,
-                                   const char *path,
-                                   va_list args)
-{
-    return RC (rcFS, rcDirectory, rcUpdating, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirPathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- *
- * [RET] uint32_t
- * [IN]  const KQuickMountDir *	self		Object oriented C; KQuickMountDir object for this method
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static uint32_t CC KQuickMountDirPathType (const KQuickMountDir *self, const char *path, va_list args)
-{
-    char buff [8192];
-    rc_t rc;
-
-    rc = KQuickMountDirVMakePath (self, rcAccessing, true, buff, sizeof buff, path, args);
-    if (rc)
-        return kptBadPath;
-
-    if (strcmp (buff, self->path) == 0)
-        return kptFile;
-
-    return kptNotFound;
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirResolvePath
- *
- *  resolves path to an absolute or directory-relative path
- *
- * [IN]  const KQuickMountDir *self		Objected oriented self
- * [IN]	 bool 		absolute	if non-zero, always give a path starting
- *  					with '/'. NB - if the directory is 
- *					chroot'd, the absolute path
- *					will still be relative to directory root.
- * [OUT] char *		resolved	buffer for NUL terminated result path in 
- *					directory-native character set
- * [IN]	 size_t		rsize		limiting size of resolved buffer
- * [IN]  const char *	path		NUL terminated string in directory-native
- *					character set denoting target path. 
- *					NB - need not exist.
- *
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KQuickMountDirResolvePath (const KQuickMountDir *self,
-                                          bool absolute,
-                                          char *resolved,
-                                          size_t rsize,
-                                          const char *path,
-                                          va_list args)
-{
-    char full [ 8192 ];
-    rc_t rc = KQuickMountDirVMakePath ( self, rcResolving, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        uint32_t path_size = strlen ( full );
-
-        if ( absolute )
-        {
-            /* test buffer capacity */
-            if ( path_size - self -> root >= rsize )
-                return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-
-            /* ready to go */
-            strcpy ( resolved, & full [ self -> root ] );
-/*             assert ( resolved [ 0 ] == '/' ); */
-        }
-        else
-        {
-            rc = KQuickMountDirRelativePath ( self, rcResolving, self -> path, full, sizeof full /*path_size*/ );
-            if ( rc == 0 )
-            {
-                path_size = strlen ( full );
-                if ( path_size >= rsize )
-                    return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-                strcpy ( resolved, full );
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KQuickMountDirResolveAlias (const KQuickMountDir * self, 
-				 bool absolute,
-				 char * resolved,
-				 size_t rsize,
-				 const char *alias,
-				 va_list args)
-{
-    return RC (rcFS, rcDirectory, rcAccessing, rcFunction, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirRename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-static
-rc_t CC KQuickMountDirRename (KQuickMountDir *self, bool force, const char *from, const char *to)
-{
-    assert (self != NULL);
-    assert (from != NULL);
-    assert (to != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirRemove
- *  remove an accessible object from its directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- */
-static
-rc_t CC KQuickMountDirRemove (KQuickMountDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirClearDir
- *  remove all directory contents
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- */
-static
-rc_t CC KQuickMountDirClearDir (KQuickMountDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirAccess
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KQuickMountDirVAccess (const KQuickMountDir *self,
-			    uint32_t *access,
-			    const char *path,
-			    va_list args)
-{
-    return RC (rcFS, rcDirectory, rcAccessing, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirSetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static rc_t CC KQuickMountDirSetAccess (KQuickMountDir *self,
-			      bool recurse,
-			      uint32_t access,
-			      uint32_t mask,
-			      const char *path,
-			      va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirCreateAlias
- *  creates a path alias according to create mode
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KQuickMountDirCreateAlias (KQuickMountDir *self,
-			 uint32_t access,
-			 KCreateMode mode,
-			 const char *targ,
-			 const char *alias)
-{
-    assert (self != NULL);
-    assert (targ != NULL);
-    assert (alias != NULL);
-
-    return RC (rcFS, rcDirectory, rcCreating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirOpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KQuickMountDirOpenFileRead	(const KQuickMountDir *self,
-					 const KFile **f,
-					 const char *path,
-					 va_list args)
-{
-    return RC (rcFS, rcDirectory, rcOpening, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirOpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- */
-static
-rc_t CC KQuickMountDirOpenFileWrite	(KQuickMountDir *self,
-					 KFile **f,
-					 bool update,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcCreating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirCreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KQuickMountDirCreateFile	(KQuickMountDir *self,
-					 KFile **f,
-					 bool update,
-					 uint32_t access,
-					 KCreateMode cmode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcCreating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KQuickMountDirFileSize		(const KQuickMountDir *self,
-					 uint64_t *size,
-					 const char *path,
-					 va_list args)
-{
-    return RC (rcFS, rcDirectory, rcCreating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirSetFileSize
- *  sets size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KQuickMountDirSetFileSize	(KQuickMountDir *self,
-					 uint64_t size,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcWriting, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirOpenDirRead
- *
- *  opens a sub-directory
- *
- * [IN]  const KQuickMountDir *	self	Object Oriented C KQuickMountDir self
- * [OUT] const KDirectory **	subp	Where to put the new KDirectory/KQuickMountDir
- * [IN]  bool			chroot	Create a chroot cage for this new subdirectory
- * [IN]  const char *		path	Path to the directory to open
- * [IN]  va_list		args	So far the only use of args is possible additions to path
- */
-static 
-rc_t CC KQuickMountDirOpenDirRead	(const KQuickMountDir *self,
-					 const KDirectory **subp,
-					 bool chroot,
-					 const char *path,
-					 va_list args)
-{
-    return RC (rcFS, rcDirectory, rcOpening, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirOpenDirUpdate
- *  opens a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- */
-static
-rc_t CC KQuickMountDirOpenDirUpdate	(KQuickMountDir *self,
-					 KDirectory ** subp, 
-					 bool chroot, 
-					 const char *path, 
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (subp != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirCreateDir
- *  create a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "access" [ IN ] - standard Unix directory permissions
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KQuickMountDirCreateDir	(KQuickMountDir *self,
-					 uint32_t access,
-					 KCreateMode mode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcCreating, rcSelf, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * KQuickMountDirDestroyFile
- */
-#if 0
-static
-rc_t CC KQuickMountDirDestroyFile	(KQuickMountDir *self,
-					 KFile * f)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-
-    return RC (rcFS, rcDirectory, rcDestroying, rcSelf, rcUnsupported);
-}
-
-
-static	rc_t CC KQuickMountDirDate (const KQuickMountDir *self,
-					 KTime_t *date,
-					 const char *path,
-					 va_list args)
-{
-    return RC (rcFS, rcDirectory, rcAccessing, rcSelf, rcUnsupported);
-
-}
-
-
-static	rc_t CC KQuickMountDirSetDate		(KQuickMountDir *self,
-					 bool recurse,
-					 KTime_t date,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-#endif
-
-/* ----------------------------------------------------------------------
- *
- */
-static KDirectory_vt_v1 vtKQuickMountDir =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods*/
-    KQuickMountDirDestroy,
-    KQuickMountDirList,
-    KQuickMountDirVisit,
-    KQuickMountDirVisitUpdate,
-    KQuickMountDirPathType,
-    KQuickMountDirResolvePath,
-    KQuickMountDirResolveAlias,
-    KQuickMountDirRename,
-    KQuickMountDirRemove,
-    KQuickMountDirClearDir,
-    KQuickMountDirVAccess,
-    KQuickMountDirSetAccess,
-    KQuickMountDirCreateAlias,
-    KQuickMountDirOpenFileRead,
-    KQuickMountDirOpenFileWrite,
-    KQuickMountDirCreateFile,
-    KQuickMountDirFileSize,
-    KQuickMountDirSetFileSize,
-    KQuickMountDirOpenDirRead,
-    KQuickMountDirOpenDirUpdate,
-    KQuickMountDirCreateDir,
-    NULL,
-    /* end minor version 0 methods*/
-    /* start minor version 1 methods*/
-    NULL,
-    NULL,
-    NULL,
-    /* end minor version 2 methods*/
-    NULL,
-    /* end minor version 2 methods*/
-    /* end minor version 3 methods*/
-    NULL,
-    NULL
-    /* end minor version 3 methods*/
-};
-
-
-static KQuickMountDir * KQuickMountDirAlloc (size_t path_size, size_t mount_size)
-{
-    return calloc (sizeof (KQuickMountDir) + path_size + mount_size + 1, 1);
-}
-
-
-KFS_EXTERN rc_t KQuickMountDirMake (const KDirectory * self, 
-                                    const KDirectory ** pnewdir,
-                                    const KFile * file,
-                                    const char * path, size_t path_size,
-                                    const char * mount, size_t mount_size)
-{
-    KQuickMountDir * newdir;
-    char * pc;
-    rc_t rc;
-    bool endslash;
-    char tbuff [8193];
-
-    endslash = path[path_size-1] == '/';
-
-    if (sizeof tbuff - 1 < mount_size)
-        return RC (rcFS, rcDirectory, rcCreating, rcBuffer, rcInsufficient);
-
-    memcpy (tbuff, mount, mount_size);
-    tbuff[mount_size] = '\0';
-
-    while ((pc = strpbrk (tbuff, "\"\\/")) != NULL)
-        *pc = '_';
-
-    rc = KFileAddRef (file);
-    if (rc == 0)
-    {
-        newdir = KQuickMountDirAlloc (path_size, mount_size);
-        if (newdir == NULL)
-            rc = RC (rcFS, rcDirectory, rcAllocating, rcMemory, rcExhausted);
-        else
-        {
-            newdir->file = file;
-            newdir->mount = newdir->path + path_size;
-            rc = KQuickMountDirMakePath (newdir, rcCreating, true, newdir->path,
-                                         path_size + 1 + mount_size + 1,
-                                         endslash?"%s%s":"%s/%s", path, tbuff);
-            if (rc == 0)
-            {
-                rc = KDirectoryInit (&newdir->dad, (const KDirectory_vt*) &vtKQuickMountDir,
-                                     "KQuickMountDir", path?path:"(null)", false);
-                if (rc == 0)
-                {
-                    newdir->mount = newdir->path + path_size + 1;
-                    newdir->root = 0;
-                    *pnewdir = &newdir->dad;
-                    return 0;
-                }
-/*             rc = RC (rcFS, rcDirectory, rcInitializing, rcObject, rcInvalid); */
-            }
-            KQuickMountDirDestroy (newdir);
-        }
-        KFileRelease (file);
-    }
-    return rc;
-}
-                         
-
-
-/* end of file quickmount.c */
-
diff --git a/libs/kfs/ramfile.c b/libs/kfs/ramfile.c
deleted file mode 100644
index 93f6995..0000000
--- a/libs/kfs/ramfile.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <sysalloc.h>
-#include <kfs/ramfile.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* ======================================================================
- * KRamFile
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KFILE_IMPL struct KRamFile
-#include <kfs/impl.h>
-
-/*-----------------------------------------------------------------------
- * KRamFile
- *  A KFile that puts reads and writes into a buffer. The buffer is passed
- *  in so the creator will know where the buffer is.
- */
-struct KRamFile
-{
-    KFile	dad;
-
-    uint64_t pos;
-    uint64_t max_pos;
-    size_t   bsize;
-    size_t   max;
-    char *   buffer;
-};
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KRamFileDestroy (KRamFile *self)
-{
-    free (self);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or RAM if
- *  no such file is available.
- *
- * We cant allow memory mapping a tee file as the read?writes ar needed
- * to trigger the writes to the copy KFile
- */
-
-static
-struct KSysFile *CC KRamFileGetSysFile (const KRamFile *self, uint64_t *offset)
-{
-    /* parameters must be non-RAM */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- *
- * Update needs to be able to seek both original and copy while read
- * only needs to be able to seek the original.
- */
-static
-rc_t CC KRamFileRandomAccess (const KRamFile *self)
-{
-    assert (self != NULL);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KRamFileType (const KRamFile *self)
-{
-    return kfdNull;
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KRamFileSize (const KRamFile *self, uint64_t *size)
-{
-    assert (self != NULL);
-    assert (size != NULL);
-
-/*     return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported ); */
-    *size = self->max_pos;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KRamFileSetSize (KRamFile *self, uint64_t size)
-{
-/*     return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported); */
-    self->max_pos = size;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, RAM OKAY ] - optional return parameter
- *  giving number of bytes actually read
- *
- * NOTE: Can not seek;
- *
- */
-static
-rc_t CC KRamFileRead	(const KRamFile *self,
-			 uint64_t pos,
-			 void *buffer,
-			 size_t bsize,
-			 size_t *num_read)
-{
-    assert (self);
-    assert (buffer);
-    assert (num_read);
-    /* no restrictions on pos or bsize */
-
-    if (pos >= self->max_pos)
-    {
-        *num_read = 0;
-        return 0;
-    }
-
-    if (pos + bsize > self->max_pos)
-        bsize = self->max_pos - pos;
-
-    /* if we are trying to read outside the current window */
-    if (self->pos > pos)
-    {
-        /* get some zeros */
-        size_t left_zeroes;
-
-        left_zeroes = self->pos - pos;
-
-        if (left_zeroes >= bsize)
-            left_zeroes = bsize;
-
-        memset (buffer, 0, bsize);
-    }
-    else if (self->pos + self->bsize < pos)
-        memset (buffer, 0, bsize);
-
-    /* so we are inside the current window */
-    else
-    {
-        /* are we trying to go past the window? */
-        if (pos + bsize > self->pos + self->bsize)
-            bsize = (self->pos + self->bsize) - pos;
-
-        memcpy (buffer, self->buffer + (pos - self->pos), bsize);
-    }
-    *num_read = bsize;
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, RAM OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Always accepts writes and can seek.
- */
-static
-rc_t CC KRamFileWrite (KRamFile *self, uint64_t pos,
-		       const void *buffer, size_t bsize,
-		       size_t *num_writ)
-{
-    char * to;
-
-    /* can't really fail */
-
-    assert (self);
-    assert (buffer);
-    assert (num_writ);
-
-    /* does the write fill the buffer? */
-    if (bsize >= self->max)
-    {
-        /* we can never allow a write larger than the internal buffer */
-        self->pos = pos;
-        self->bsize = bsize = self->max;
-        to = self->buffer;
-        if (self->max_pos < pos + bsize)
-            self->max_pos = pos + bsize;
-    }
-
-    /* else are we seeking forward or backward to completely new or completely
-     * over writing what is there */
-    else if ((self->bsize == 0) ||                     /* currently no buffer */
-             (pos >= (self->pos + self->max)) || /* past current */
-             (pos + self->max <= self->pos) ||   /* behind current */
-             ((pos <= self->pos) && (pos + bsize >= self->pos + self->bsize)))
-    {
-        /* reset the buffer parameters */
-        self->pos = pos;
-        self->bsize = bsize;
-        if (self->max_pos < pos + bsize)
-            self->max_pos = pos + bsize;
-
-        to = self->buffer;
-        /* clear any unused portion of the buffer */
-        if (self->max > bsize)
-            memset (self->buffer + bsize, 0, self->max - bsize);
-    }
-    else if (pos >= self->pos) 
-    {
-        /* if we are reading something at or after what we have now
-         * where the right edge was doesn't matter since we zero fill
-         * in the previous condition and at construction */
-        /* how far into the buffer will we start */
-        size_t poff = pos - self->pos;
-
-        /* do we have to slide the window? This is not optimized */
-        if ((poff != 0) && (poff + bsize > self->max))
-        {
-            size_t m = poff + bsize - self->max;
-            if (self->bsize < self->max)
-                memset (self->buffer + bsize, 0, self->max = self->bsize);
-            /* must use memmove not memcpy */
-            memmove (self->buffer, self->buffer + poff, self->max - pos);
-
-            poff -= m;
-            self->pos -= m;
-        }
-
-        /* check for a new self->bsize */
-        if (poff + bsize > self->bsize)
-            self->bsize = poff + bsize;
-
-        /* check for a new max position */
-        if (self->max_pos < self->pos + self->bsize)
-            self->max_pos = self->pos + self->bsize;
-
-        to = self->buffer + poff;
-    }
-    else
-    {
-        size_t poff = self->pos - pos;
-
-        /* non optimized slide */
-        memmove (self->buffer + poff, self->buffer, self->max - poff);
-        self->pos = pos;
-        self->bsize += poff;
-        if (self->bsize > self->max)
-            self->bsize = self->max;
-        to = self->buffer;
-    }
-    memcpy (to, buffer, bsize);
-    *num_writ = bsize;
-
-    return 0;
-}
-
-
-static const KFile_vt_v1 vtKRamFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KRamFileDestroy,
-    KRamFileGetSysFile,
-    KRamFileRandomAccess,
-    KRamFileSize,
-    KRamFileSetSize,
-    KRamFileRead,
-    KRamFileWrite,
-
-    /* 1.1 */
-    KRamFileType
-};
-
-/* ----------------------------------------------------------------------
- * KRamFileMake
- *  create a new file object
- */
-static
-rc_t KRamFileMake (KRamFile ** pself, char * buffer, size_t buffer_size, bool r, bool w)
-{
-    rc_t	rc;
-    KRamFile *	self;
-
-    /* -----
-     */
-    if (pself == NULL)
-        return RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-
-    if (buffer == NULL)
-        return RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-
-    /* we only deny size 0 buffer just to avoid the too weird corner cases */
-    if (buffer_size == 0)
-        return RC (rcFS, rcFile, rcConstructing, rcParam, rcTooShort);
-
-    if (((r != true) && (r != false)) || ((w != true) && (w != false)))
-        return RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-
-    /* -----
-     * get space for the object
-     */
-    self = malloc (sizeof (*self));
-    if (self == NULL)	/* allocation failed */
-    {
-	/* fail */
-	rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-	rc = KFileInit (&self->dad,			/* initialize base class */
-			(const KFile_vt*)&vtKRamFile, 	/* VTable for KRamFile */
-            "KRamFile", "ram",
-                        r,w);
-	if (rc == 0)
-	{
-            self->pos = self->max_pos = 0;
-            self->max = buffer_size;
-            self->bsize = 0;
-            self->buffer = buffer;
-	    *pself = self;
-	    return 0;
-	}
-	/* fail */
-	free (self);
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KRamFileMakeRead (const KFile ** selfp,char * buffer, size_t buffer_size)
-{
-    KRamFile *self;
-    rc_t rc = KRamFileMake ( & self, buffer, buffer_size, true, false);
-    if ( rc == 0 )
-    {
-        self -> max_pos = buffer_size;
-        self -> bsize = buffer_size;
-        * selfp = & self -> dad;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KRamFileMakeWrite (KFile ** self, char * buffer, size_t buffer_size)
-{
-    return KRamFileMake ((KRamFile **)self, buffer, buffer_size, false, true);
-}
-
-LIB_EXPORT rc_t CC KRamFileMakeUpdate (KFile ** self, char * buffer, size_t buffer_size)
-{
-    return KRamFileMake ((KRamFile **)self, buffer, buffer_size, true, true);
-}
-
-
-/* end of file ramfile.c */
-
diff --git a/libs/kfs/readheadfile.c b/libs/kfs/readheadfile.c
deleted file mode 100644
index 59ab0a5..0000000
--- a/libs/kfs/readheadfile.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/readheadfile.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-/* ======================================================================
- * KReadHeadFile
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-struct KReadHeadFile;
-#define KFILE_IMPL struct KReadHeadFile
-#include <kfs/impl.h>
-
-
-/*-----------------------------------------------------------------------
- * KReadHeadFile
- */
-typedef struct KReadHeadFile
-{
-    KFile	  dad;
-    uint64_t	  max_position;
-    const KFile * original;
-    size_t        buffer_size;
-    uint8_t       buffer [1];
-} KReadHeadFile;
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KReadHeadFileDestroy (KReadHeadFile *self)
-{
-    rc_t rc;
-
-    rc = KFileRelease (self->original);
-
-    free (self);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * bytes could not be counted if memory mapped so this is disallowed
- */
-
-static
-struct KSysFile *CC KReadHeadFileGetSysFile (const KReadHeadFile *self, uint64_t *offset)
-{
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    return KFileGetSysFile (self->original, offset);
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KReadHeadFileRandomAccess (const KReadHeadFile *self)
-{
-    return KFileRandomAccess (self->original);
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KReadHeadFileType (const KReadHeadFile *self)
-{
-    return KFileType (self->original);
-}
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KReadHeadFileSize (const KReadHeadFile *self, uint64_t *size)
-{
-    return KFileSize (self->original, size);
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KReadHeadFileSetSize (KReadHeadFile *self, uint64_t size)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KReadHeadFileRead	(const KReadHeadFile *cself,
-				 uint64_t pos,
-				 void *buffer,
-				 size_t bsize,
-				 size_t *num_read)
-{
-    rc_t rc;
-    size_t valid = 0;
-    size_t this_read;
-    KReadHeadFile *self = (KReadHeadFile *)cself;
-    *num_read = 0;
-
-    /* are we re-reading? */
-    if (pos < self->max_position)
-    {
-        size_t valid = self->max_position - pos;
-
-        if (bsize <= valid)
-        {
-            memmove (buffer, self->buffer + pos, bsize);
-            return 0;
-        }
-
-        memmove (buffer, self->buffer + pos, valid);
-    }
-    rc = KFileRead (self->original, pos + valid, (char *)buffer + valid,
-                    bsize - valid, &this_read);
-
-    *num_read = (rc) ? 0 : valid + this_read;
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KReadHeadFileWrite (KReadHeadFile *self, uint64_t pos,
-			   const void *buffer, size_t bsize,
-			   size_t *num_writ)
-{
-    assert ( self != NULL );
-    return RC (rcFS, rcFile, rcWriting, rcFunction, rcUnsupported);
-}
-
-static const KFile_vt_v1 vtKReadHeadFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KReadHeadFileDestroy,
-    KReadHeadFileGetSysFile,
-    KReadHeadFileRandomAccess,
-    KReadHeadFileSize,
-    KReadHeadFileSetSize,
-    KReadHeadFileRead,
-    KReadHeadFileWrite,
-
-    /* 1.1 */
-    KReadHeadFileType
-};
-
-
-
-/* ----------------------------------------------------------------------
- * KReadHeadFileMake
- *  create a new file object
- */
-
-LIB_EXPORT rc_t CC KFileMakeReadHead (const KFile ** pself,
-                                      const KFile * original,
-                                      size_t buffer_size)
-{
-    rc_t rc;
-
-    if (pself == NULL)
-        return RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-
-    *pself = NULL;
-
-    if (original == NULL)
-        return RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-
-    rc = KFileAddRef (original);
-    if (rc)
-        return rc;
-
-    rc = KFileRandomAccess (original);
-
-    /* buffering not needed as existing file is random access */
-    if (rc == 0)
-    {
-        *pself = original;
-        return 0;
-    }
-
-    /* some other failure we'll have to bail on */
-    else if (GetRCState(rc) != rcUnsupported)
-        return rc;
-
-    else
-    {
-        KReadHeadFile * self;
-
-        self = malloc (sizeof (*self) + buffer_size); /* really too much but too hard to tune down accurately */
-        if (self == NULL)
-            return RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-
-	rc = KFileInit (&self->dad,			/* initialize base class */
-			(const KFile_vt*)&vtKReadHeadFile,/* VTable for KReadHeadFile */
-            "KReadHeadFile", "no-name",
-			original->read_enabled,
-			false);
-	if (rc == 0)
-	{
-            self->max_position = 0;
-            self->original = original;
-            self->buffer_size = buffer_size;
-            *pself = &self->dad;
-            return 0;
-	}
-	/* fail */
-	free (self);
-    }
-    return rc;
-}
-
-/* end of file countfile.c */
-
diff --git a/libs/kfs/report.c b/libs/kfs/report.c
deleted file mode 100644
index 94c6600..0000000
--- a/libs/kfs/report.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-
-#include <klib/klib-priv.h>
-#include <klib/out.h> /* KOutHandlerSet */
-#include <klib/rc.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h> /* KFileWrite */
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h> /* calloc */
-#include <string.h> /* memset */
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-/*
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-#define report ( * f -> report )
-#define reportData ( * f -> reportData )
-#define reportData1 ( * f -> reportData1 )
-#define reportOpen ( * f -> reportOpen )
-#define reportOpen1 ( * f -> reportOpen1 )
-#define reportClose ( * f -> reportClose )
-#define reportClose1 ( * f -> reportClose1 )
-#define reportError ( * f -> reportError )
-#define reportErrorStr ( * f -> reportErrorStr )
-#define reportErrorStrImpl ( * f -> reportErrorStrImpl )
-#define reportErrorStrInt ( * f -> reportErrorStrInt )
-#define reportError3Str ( * f -> reportError3Str )
-
-#define MAGIC 0x6521
-
-typedef struct SFile {
-    uint64_t magic;
-    KFile* f;
-    uint64_t pos;
-} SFile;
-
-static rc_t CC fileWriter
-(void* data, const char* buffer, size_t bytes, size_t* num_writ)
-{
-    rc_t rc = 0;
-
-    SFile* self = (SFile*)data;
-    size_t dummy;
-    if (num_writ == NULL)
-    {   num_writ = &dummy; }
-    *num_writ = 0;
-
-    assert(self);
-    if (self->magic != MAGIC) {
-        return rc;
-    }
-
-    rc = KFileWrite(self->f, self->pos, buffer, bytes, num_writ);
-    self->pos += *num_writ;
-
-    return rc;
-}
-
-rc_t CC ReportRedirect
-( KWrtHandler* handler, const char* filename, bool* to_file, bool finalize )
-{
-    rc_t rc = 0;
-    if (!finalize) {
-        if (handler) {
-            handler->writer = KOutWriterGet();
-            handler->data = KOutDataGet();
-        }
-        if (filename) {
-            KDirectory* dir = NULL;
-            SFile* data = calloc(1, sizeof *data);
-            if (data == NULL) {
-                return RC(rcFS, rcMemory, rcAllocating, rcMemory, rcExhausted);
-            }
-            data->magic = MAGIC;
-            rc = KDirectoryNativeDir(&dir);
-            if (rc == 0) {
-                rc = KDirectoryCreateFile
-                    (dir, &data->f, false, 0664, kcmInit, filename);
-            }
-            if (rc == 0) {
-                rc = KOutHandlerSet(fileWriter, data);
-            }
-            RELEASE(KDirectory, dir);
-        }
-        if (rc != 0 || filename == NULL) {
-            KOutHandlerSetStdErr();
-            if (to_file)
-            {   *to_file = false; }
-        }
-        else if (to_file)
-        {   *to_file = true; }
-
-    }
-    else {
-        void* data = KOutDataGet();
-        SFile* self = (SFile*)data;
-        if (self) {
-            if (self->magic == MAGIC) {
-                RELEASE(KFile, self->f);;
-            }
-            memset(self, 0, sizeof *self);
-            free(self);
-        }
-        if (handler) {
-            KOutHandlerSet(handler->writer, handler->data);
-        }
-    }
-    return rc;
-}
-
-rc_t CC ReportCWD ( const ReportFuncs *f, uint32_t indent )
-{
-    KDirectory *wd;
-    rc_t rc = KDirectoryNativeDir ( & wd );
-    if ( rc != 0 )
-        reportError(indent, rc, "KDirectoryNativeDir");
-    else
-    {
-        char cwd [ PATH_MAX + 1 ];
-        rc = KDirectoryResolvePath ( wd, true, cwd, sizeof cwd, "." );
-        KDirectoryRelease ( wd );
-
-        if ( rc != 0 )
-            reportError(indent, rc, "KDirectoryResolvePath");
-        else
-            reportData(indent, "Cwd", cwd, 0);
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/sra.c b/libs/kfs/sra.c
deleted file mode 100644
index f237505..0000000
--- a/libs/kfs/sra.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <kfs/extern.h>
-
-#include <klib/defs.h>
-#include <byteswap.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/sra.h>
-/* #include <kfs/toc.h> */
-#include <klib/log.h>
-#include "toc-priv.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <sysalloc.h>
-
-
-struct KToc;
-struct KDirectory;
-
-
-
-static
-const KSraHeader ksraheader_v1 =
-{
-    { 'N', 'C','B', 'I' },
-    { '.', 's','r', 'a' },
-    eSraByteOrderTag,
-    1
-};
-
-LIB_EXPORT size_t CC SraHeaderSize ( const KSraHeader * self )
-{
-    /* self can be NULL */
-    return sizeof ( KSraHeader );
-}
-
-static
-uint64_t add_filler (uint64_t z, KSRAFileAlignment a)
-{
-    if (a > 1)
-    {
-        uint64_t m = (uint64_t)a - 1;
-        return (z + m) & ~ m;
-    }
-    return z;
-}
-
-static void	SraHeaderInit (KSraHeader * self, size_t treesize, KSRAFileAlignment alignment)
-{
-    memcpy (self, &ksraheader_v1, sizeof ksraheader_v1);
-    self->u.v1.file_offset = add_filler (sizeof * self + treesize, alignment);
-}
-
-rc_t SraHeaderMake (KSraHeader ** pself, size_t treesize, KSRAFileAlignment alignment)
-{
-    KSraHeader * self = malloc (sizeof (KSraHeader));
-    if (self == NULL)
-	return RC ( rcFS, rcToc, rcConstructing, rcMemory, rcExhausted );
-    SraHeaderInit (self, treesize, alignment);
-    *pself = self;
-    return 0;
-}
-
-
-static rc_t  SraHeaderValidate ( const KSraHeader * self, bool * reverse, uint32_t * _version, size_t bytes_available )
-{
-    uint64_t offset;
-    rc_t rc;
-    uint32_t version;
-    bool rev;
-
-    if (reverse != NULL)
-	*reverse = false;
-    if (_version != NULL)
-	*_version = 0;
-
-    if (bytes_available < 8)
-        return RC (rcFS, rcArc, rcParsing, rcHeader, rcInsufficient);
-
-    if (memcmp ((void*)self, &ksraheader_v1,
-		sizeof (ksraheader_v1.ncbi) + sizeof (ksraheader_v1.sra)) != 0)
-	return RC (rcFS, rcArc, rcParsing, rcHeader, rcInvalid);
-
-    if (bytes_available < 12)
-        return 0;
-
-    switch (self->byte_order)
-    {
-    default:
-	return RC (rcFS, rcArc, rcParsing, rcHeader, rcCorrupt);
-    case eSraByteOrderTag:
-	rev = false;
-	break;
-    case eSraByteOrderReverse:
-	rev = true;
-	break;
-    }
-    rc = 0;
-
-    if (bytes_available < 16)
-        return 0;
-
-    version = rev ? bswap_32 (self->version) : self->version;
-    offset = rev ? bswap_64 (self->u.v1.file_offset) : self->u.v1.file_offset;
-
-    if (version > FS_SRA_CUR_VERSION)
-	rc =  RC (rcFS, rcArc, rcParsing, rcHeader, rcUnsupported);
-
-    /* 4 is minimum size for a TOC */
-    else if (offset < (sizeof ksraheader_v1 + 4))
-	return RC (rcFS, rcArc, rcParsing, rcHeader, rcCorrupt);
-
-    if (reverse != NULL)
-	*reverse = rev;
-    if (_version != NULL)
-	*_version = version;
-
-    return rc;
-}
-
-LIB_EXPORT uint64_t CC SraHeaderGetFileOffset ( const KSraHeader * self )
-{
-    if ( self -> byte_order == eSraByteOrderReverse )
-        return bswap_64 ( self->u.v1.file_offset );
-    return self->u.v1.file_offset;
-}
-
-static
-rc_t KTocParseRead (const KFile * f, uint64_t p, void * b, size_t z, size_t * n)
-{
-    rc_t rc;
-    size_t a;
-    size_t t;
-
-    rc = 0;
-    for (a = 0; a < z; a += t)
-    {
-	rc = KFileRead (f, p + a, (uint8_t*)b + a, z - a, &t);
-	if (rc != 0)
-	    return rc;
-	if (t == 0)
-	    break;
-    }
-    if (a < z)
-	rc = RC (rcFS, rcToc, rcParsing, rcFile, rcTooShort);
-    *n = a;
-    return rc;
-}
-
-
-static
-rc_t KTocParseReadPBSTree (struct KToc * self, const KFile * file, uint64_t endpos, void ** header)
-{
-    rc_t rc;
-    uint64_t toc_pos;
-    uint64_t end_pos;
-    size_t num_read;
-    size_t tree_size;
-
-    rc = 0;
-    toc_pos = SraHeaderSize(NULL);
-    end_pos = endpos;
-
-    if (end_pos <= toc_pos)
-    {
-        /* 	rc = RC (rcFS, rcToc, rc */
-    }
-    tree_size = (size_t)(end_pos - toc_pos);
-
-    *header = malloc (tree_size);
-    if (*header == NULL)
-    {
-        rc = RC (rcFS, rcToc, rcParsing, rcMemory, rcExhausted);
-    }
-    else
-    {
-        rc = KTocParseRead (file, toc_pos, *header, tree_size, &num_read);
-        if (rc == 0)
-        {
-            return 0;
-        }
-        free (*header);
-        *header = NULL;
-    }
-    return rc;
-}
-
-static
-rc_t CC KArcParseSRAInt ( struct KToc * self,
-                          const void * kvoid,
-                          bool ( CC * ignored ) ( const struct KDirectory *,  const char *, void * ),
-                          void * ignored_data, 
-                          bool unbounded,
-                          bool silent )
-{
-    uint64_t arcsize;
-    rc_t rc;
-    bool reverse;
-    uint32_t version;
-    KSraHeader header;
-    size_t num_read;
-    size_t all_read;
-    const KFile * file;
-    void * pbstreeBuffer;
-    /*     uint64_t toc_offset; */
-    /*     uint64_t file_offset; */
-
-    rc = 0;
-    if ( kvoid == NULL )
-    {
-        rc = RC ( rcFS, rcToc, rcParsing, rcParam, rcNull );
-        if ( !silent )
-            LOGERR ( klogErr, rc, "File parameter null for parsing .sra" );
-        return rc;
-    }
-    file = kvoid;
-
-    rc = KFileSize ( file, &arcsize );
-    if (rc)
-    {
-        if ( unbounded )
-            arcsize = ( (uint64_t)0 ) - 1;
-        else
-        {
-            rc = RC ( rcFS, rcToc, rcParsing, rcFile, rcIncorrect );
-            if ( !silent )
-                LOGERR ( klogErr, rc, "Can't determine archive file size" );
-            return rc;
-        }
-    }
-
-    for ( num_read = all_read = 0; all_read < sizeof (header); all_read += num_read )
-    {
-        rc = KTocParseRead ( file, 0, &header, sizeof (header), &num_read );
-        if ( num_read == 0 )
-        {
-            rc = RC ( rcFS, rcToc, rcParsing, rcFile, rcTooShort );
-            break;
-        }
-    }
-    if ( rc != 0 )
-    {
-        if ( !silent )
-            LOGERR ( klogErr, rc, "error reading file to parse .sra" );
-        return rc;
-    }
-
-    /* version is ignored at this point as there is only one version */
-    rc = SraHeaderValidate ( &header, &reverse, &version, sizeof header );
-    if ( rc != 0 )
-    {
-        if ( !silent )
-            LOGERR ( klogErr, rc, "File header invalid for .sra header" );
-        return rc;
-    }
-
-    switch ( version )
-    {
-    default:
-        rc = RC ( rcFS, rcToc, rcParsing, rcFileFormat, rcBadVersion );
-        if ( !silent )
-            LOGERR ( klogInt, rc, "Incompatible file version" );
-        break;
-    case 1:
-        rc = KTocParseReadPBSTree ( self, file, SraHeaderGetFileOffset (&header),
-                                   &pbstreeBuffer );
-        if ( rc != 0 )
-        {
-            if ( !silent )
-                LOGERR ( klogErr, rc, "File TOC not read for .sra header" );
-            break;
-        }
-        else
-        {
-            uint64_t offset;
-            offset = SraHeaderGetFileOffset (&header);
-            rc = KTocInflatePBSTree ( self, arcsize, pbstreeBuffer, 
-                                     (uint32_t)(offset - sizeof (header)),
-                                     offset,
-                                     reverse, "" );
-            free ( pbstreeBuffer );
-            if ( rc != 0 && !silent )
-            {
-                LOGERR (klogErr, rc, "File TOC not valid for .sra");
-            }
-            /* 	    else */
-            /* 	    { */
-            /* 		rc = KTocParseSraDirectory (self, bst, ""); */
-            /* 		if (rc == 0) */
-            /* 		    return 0; */
-            /* 	    } */
-        }
-        break;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KArcParseSRA ( struct KToc * self,
-                                  const void * kvoid,
-                                  bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                  void *ignored_data )
-{
-    return KArcParseSRAInt ( self, kvoid, ignored, ignored_data, false, false );
-}
-
-
-LIB_EXPORT rc_t CC KArcParseSRA_silent ( struct KToc * self,
-                                  const void * kvoid,
-                                  bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                  void *ignored_data )
-{
-    return KArcParseSRAInt ( self, kvoid, ignored, ignored_data, false, true );
-}
-
-LIB_EXPORT rc_t CC KArcParseSRAUnbounded ( struct KToc * self,
-                                  const void * kvoid,
-                                  bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                  void *ignored_data )
-{
-    return KArcParseSRAInt ( self, kvoid, ignored, ignored_data, true, false );
-}
-
-LIB_EXPORT rc_t CC KArcParseSRAUnbounded_silent ( struct KToc * self,
-                                  const void * kvoid,
-                                  bool (CC*ignored) (const struct KDirectory*,  const char*, void*),
-                                  void *ignored_data )
-{
-    return KArcParseSRAInt ( self, kvoid, ignored, ignored_data, true, false );
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryVOpenSraArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args )
-{
-    /* respond properly to va_list */
-    char full [ 4096 ];
-    int len = vsnprintf ( full, sizeof full, path, args );
-    if ( len < 0 )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcExcessive );
-
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead (self, sra_dir, chroot, full, tocKFile,
-                                     KArcParseSRA, NULL, NULL);
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryOpenSraArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenSraArchiveRead ( self, sra_dir, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryVOpenSraArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args )
-{
-    /* respond properly to va_list */
-    char full [ 4096 ];
-    int len = vsnprintf ( full, sizeof full, path, args );
-    if ( len < 0 )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcExcessive );
-
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead_silent ( self, sra_dir, false, full, tocKFile,
-                                     KArcParseSRA_silent, NULL, NULL );
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryOpenSraArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenSraArchiveRead_silent ( self, sra_dir, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryVOpenSraArchiveReadUnbounded_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, va_list args )
-{
-    /* respond properly to va_list */
-    char full [ 4096 ];
-    int len = vsnprintf ( full, sizeof full, path, args );
-    if ( len < 0 || len >= sizeof full )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcExcessive );
-
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead_silent_preopened ( self, sra_dir, false, full, tocKFile,
-        ( void* ) f, KArcParseSRAUnbounded_silent, NULL, NULL );
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryOpenSraArchiveReadUnbounded_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const struct KFile * f, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenSraArchiveReadUnbounded_silent_preopened ( self, sra_dir, chroot, f, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryVOpenSraArchiveReadUnbounded ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, va_list args )
-{
-    /* respond properly to va_list */
-    char full [ 4096 ];
-    int len = vsnprintf ( full, sizeof full, path, args );
-    if ( len < 0 )
-        return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcExcessive );
-
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead (self, sra_dir, false, full, tocKFile,
-                                     KArcParseSRAUnbounded, NULL, NULL);
-}
-
-
-LIB_EXPORT rc_t CC KDirectoryOpenSraArchiveReadUnbounded ( struct KDirectory const *self,
-    struct KDirectory const **sra_dir, int chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenSraArchiveReadUnbounded (self, sra_dir, chroot, path, args);
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KFileIsSRA (const char * b, size_t z)
-{
-    const KSraHeader * h = (const KSraHeader *)b;
-
-    if (SraHeaderValidate (h, NULL, NULL, z) == 0)
-        return 0;
-    
-    return RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcWrongType);
-}
-
-/* end of file */
diff --git a/libs/kfs/subfile.c b/libs/kfs/subfile.c
deleted file mode 100644
index 4a3525d..0000000
--- a/libs/kfs/subfile.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/subfile.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-/* ======================================================================
- * KSubFile
- *  a file inside an archive
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KFILE_IMPL struct KSubFile
-#include <kfs/impl.h>
-
-static rc_t CC KSubFileDestroy (KSubFile *self);
-static struct KSysFile *CC KSubFileGetSysFile (const KSubFile *self,
-					    uint64_t *offset);
-static rc_t CC KSubFileRandomAccess (const KSubFile *self);
-static uint32_t CC KSubFileType (const KSubFile *self);
-static rc_t CC KSubFileSize (const KSubFile *self, uint64_t *size);
-static rc_t CC KSubFileSetSize (KSubFile *self, uint64_t size);
-static rc_t CC KSubFileRead (const KSubFile *self, uint64_t pos,
-			  void *buffer, size_t bsize, size_t *num_read);
-static rc_t CC KSubFileWrite (KSubFile *self, uint64_t pos, const void *buffer,
-			   size_t size, size_t *num_writ);
-
-
-static const KFile_vt_v1 vtKSubFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KSubFileDestroy,
-    KSubFileGetSysFile,
-    KSubFileRandomAccess,
-    KSubFileSize,
-    KSubFileSetSize,
-    KSubFileRead,
-    KSubFileWrite,
-
-    /* 1.1 */
-    KSubFileType
-};
-
-/*-----------------------------------------------------------------------
- * KSubFile
- *  an archive file including tar and sra
- */
-struct KSubFile
-{
-    KFile	dad;
-    uint64_t	start;
-    uint64_t	size;
-    KFile *	original;
-};
-
-/* ----------------------------------------------------------------------
- * KSubFileMake
- *  create a new file object
- */
-
-static
-rc_t KSubFileMake (KSubFile ** self,
-		   KFile * original,
-		   uint64_t start,
-		   uint64_t size,
-		   bool read_enabled,
-		   bool write_enabled)
-{
-    rc_t	rc;
-    KSubFile *	pF;
-
-    /* -----
-     */
-    assert (self != NULL);
-    assert (original != NULL);
-/*     assert (start >= size); */
-
-    /* -----
-     * the enables should be true or false
-     */
-    assert ((read_enabled == true)||(read_enabled == false));
-    assert ((write_enabled == true)||(write_enabled == false));
-
-    /* -----
-     * get space for the object
-     */
-    pF = malloc (sizeof (KSubFile));
-    if (pF == NULL)	/* allocation failed */
-    {
-        /* fail */
-        rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-        rc = KFileInit (&pF->dad,			/* initialize base class */
-            (const KFile_vt*)&vtKSubFile, 	/* VTable for KSubFile */
-            "KSubFile", "no-name",
-                        read_enabled,		/* read allowed */
-                        write_enabled);		/* write disallowed */
-	if (rc == 0)
-	{
-	    KFileAddRef (original);
-	    /* succeed */
-	    pF->original = original;
-	    pF->start = start;
-	    pF->size = size;
-	    *self = pF;
-	    return 0;
-	}
-	/* fail */
-	free (pF);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KFileMakeSubRead (const KFile ** self, const KFile * original, uint64_t start, uint64_t size)
-{
-    return KSubFileMake ((KSubFile **)self, (KFile*)original, start, size,
-			 true, false);
-}
-
-LIB_EXPORT rc_t CC KFileMakeSubUpdate (KFile ** self, KFile * original, uint64_t start, uint64_t size)
-{
-    return KSubFileMake ((KSubFile **)self, original, start, size,
-			 true, true);
-}
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KSubFileDestroy (KSubFile *self)
-{
-    assert (self != NULL);
-    KFileRelease (self->original);
-    free (self);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We cant allow memory mapping a tee file as the read?writes ar needed
- * to trigger the writes to the copy KFile
- */
-
-static
-struct KSysFile *CC KSubFileGetSysFile (const KSubFile *self, uint64_t *offset)
-{
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    /* not implmenting at this time */
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- *
- * Update needs to be able to seek both original and copy while read
- * only needs to be able to seek the original.
- */
-static
-rc_t CC KSubFileRandomAccess (const KSubFile *self)
-{
-    assert (self != NULL);
-    return KFileRandomAccess (self->original);
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KSubFileType (const KSubFile *self)
-{
-    return KFileType (self->original);
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KSubFileSize (const KSubFile *self, uint64_t *size)
-{
-    assert (self != NULL);
-    assert (size != NULL);
-
-    *size = self->size;
-
-    return 0;;
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KSubFileSetSize (KSubFile *self, uint64_t size)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KSubFileRead	(const KSubFile *self,
-			 uint64_t pos,
-			 void *buffer,
-			 size_t bsize,
-			 size_t *num_read)
-{
-    size_t	request;
-    rc_t	rc;
-
-
-    /* -----
-     * self and buffer were validated as not NULL before calling here
-     *
-     * So get the KTTOCNode type: chunked files and contiguous files 
-     * are read differently.
-     */
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-
-    *num_read = 0;
-    if (pos >= self->size)
-    {
-	return 0;
-    }
-    if ((pos + bsize) <= self->size)
-	request = bsize;
-    else
-	request = (size_t)(self->size - pos);
-
-    rc = KFileRead (self->original, self->start + pos, buffer, request, num_read);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KSubFileWrite (KSubFile *self, uint64_t pos,
-		       const void *buffer, size_t bsize,
-		       size_t *num_writ)
-{
-    size_t to_write;
-
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_writ != NULL);
-
-    *num_writ = 0;
-    if (pos >= ( uint64_t ) self->size)
-        return 0;
-
-    to_write = bsize;
-    if ((pos + bsize) > self->size)
-        to_write = ( uint64_t ) self -> size - pos;
-
-    return KFileWrite (self->original, self->start + pos, buffer, to_write, num_writ);
-}
-
-/* end of file subfile.c */
-
diff --git a/libs/kfs/tar.c b/libs/kfs/tar.c
deleted file mode 100644
index a13da1e..0000000
--- a/libs/kfs/tar.c
+++ /dev/null
@@ -1,2639 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#define HANDLING_EXTENDED_HEADERS 0
-
-#include <kfs/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <kfs/arc.h>
-#include <kfs/toc.h>
-#include <kfs/tar.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-
-#include "toc-priv.h"
-#include <os-native.h>
-#include <sysalloc.h>
-#include <strtol.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h> /* temporary for development */
-
-#include <limits.h>
-/* #include <sys/types.h> */
-
-#ifdef _DEBUGGING
-#define FUNC_ENTRY() DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TARENTRY), ("Enter: %s\n", __func__))
-#define TAR_DEBUG(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TAR), msg)
-#else
-#define FUNC_ENTRY()
-#define TAR_DEBUG(msg)
-#endif
-
-/* -----
- * offset of is the count of bytes between the base of a structure and 
- * a particular member of that structure
- */
-#ifndef OFFSET_OF
-#define	OFFSET_OF(structure,member) ((size_t)((&(((structure*)0)->member))-(0)))
-#endif
-
-/* -----
- * Hide any definition of sun that might have come from sun compilers
- * or the like
- */
-#undef sun
-#undef SUN
-
-
-#define PASTE_2(a,b)   a##b
-#define PASTE_3(a,b,c) a##b##c
-#define STRINGIFY(a)   #a
-
-
-/* ======================================================================
- * return an ASCII string that describes a header type
- *
- * Needs to match tar_header_type_enum.
- */
-#if _DEBUGGING
-static const char * get_bool_string (bool b)
-{
-    switch (b)
-    {
-    case true:
-	return "true";
-    case false:
-	return "false";
-    default:
-	return "not-false";
-    }
-}
-#endif
-
-
-/* ======================================================================
- * Header format structures
- *
- * Tar (tape archiver) started possibly as a unix utility in BSD rivalling
- * the cpio from the AT&T System III.  The exact derivation is unimportant
- * and some names might be slightly misleading based on historical 
- * inaccuracies but successful implmentation is not dependant on such 
- * accuracy in historical trivia but rather on accuracy in technical details.
- *
- * Posix attempted to standardize the growingly divergent variants of tar
- * but it has led to only slightly more standardized variants with vaguely
- * compatible extensions.
- *
- * For the purposes of this implmentation we will refer to the known to the
- * author versions of tar and include the tar like aspects of the posix pax 
- * replacement for tar.
- *
- * Cpio support could be added if desired with only some difficulty.
- *
- * Supported known variants for this implmentation will be:
- * 	V7 	- the oldest known common base defitions for a tar header
- *		   block ( possibly from Unix V7?)
- *    	POSIX	- Posix.1-1988 initial restandardization of a header block
- *		  This versio introduced the ustar name for a tar header
- *		  and includes that term as a "magic" constant.
- *	PAX	- Posix.1.2001 headers for pax a tar derivative that us a
- *		  peaceful attempt to unify the tar and cpio formats apparently.
- *		  It isn't different than POSIX in the ustar block but instead
- *		  is an introduction of two new values of a link field in the
- *		  tar header that defines what comes next (see headers defined
- *		  below).
- *	SUN	- an extension to the POSIX tar header format from SunOS 5
- *	STAR 85	- pre-POSIX extensions to tar from Heorg Schilling (ask him its
- *		  the bestest most greatest tar until STAR94)
- *	STAR 94	- A redo of star based on the POSIX ustar tar header.  A less
- *		  broken than most implmentation of a POSIX/ustar tar header
- *		  based tar. Schilling says its the only real implmentation of
- *		  a ustar based tar but it isn't fully compliant by design.
- *	GNU 89	- a selected variant of tar from FSF/GNU that is a broken 
- *		  implementation of a POSIX/ustar header based tar.
- *	GNU 01	- A slight redo of the FSF/GNU tar format.  There are actually
- *		  evolving variants all of which are still somewhat broken
- *		  implementations of a ustar based tar header format.
- *
- * Along with these variants of a tar/ustar semi-standard tar header there are
- * other header blocks and other significant blocks that are also tracked in
- * this implmentation of a tar reader.
- *	ZERO BLOCK - a block of 512 zero bytes that is supposed to be padding at
- *		  the end of a tar file to meet some super blocksize.  Based on
- *		  where it fits in it would be found when looking for a header
- *		  for the next file included in a tar archive.
- *	RAW	- a convention to mean a header block of a type that has not been 
- *		  determined.
- */
-#define TYPES() \
-    type_(UNDEFINED) type_(ZERO_BLOCK) type_(CPIO) type_(V7) type_(POSIX) \
-        type_(SUN) type_(STAR_85) type_(STAR_94)  type_(GNU_89) type_(SPARSE)
-
-
-#define type_(e) PASTE_2(TAR_,e),
-
-typedef enum tar_header_type
-{
-    TYPES()
-    TAR_TYPE_COUNT
-} tar_header_type;
-
-#undef type_
-#define type_(e) STRINGIFY(e),
-static const char *	get_type_string(tar_header_type t)
-{
-    static const char * type_error = "Error";
-    static const char * type_strings[] = 
-        {
-            TYPES()
-        };
-    if ((t < 0) || (t >= TAR_TYPE_COUNT))
-	return type_error;
-    return type_strings[t];
-}
-#undef type_
-#undef TYPES
-
-
-/* =============================================================================
- * Tar headers are almost ASCII based but definitely byte/octet based so all
- * elements are best defined as arrays of char and use casts to signed and unsigned
- * where appropriate in interpretation..
- * 
- * All Tar files or streams are divided into blocks of 512 bytes
- * This is significant in the file data in that the last block 
- * of a file is supposed to be padded with NUL to fill out a block
- * and then be followed by two blocks of all NUL bytes.
- * headers are also 512 bytes with various but fairly consistent 
- * interpretations of what is where with in that block
- *
- * Most tar utilities further define super blocks consisting of a number of blocks
- * typically 10 of them for a length of 5120 bytes.  This is irrelevant for this
- * implmentation.  By definition a tar file ends with two "zero blocks" and enough
- * more after that to fill one of these super blocks.  We ignore all aspects of 
- * this.
- */
-#define TAR_BLOCK_SIZE		(512)
-typedef char tar_raw_block [TAR_BLOCK_SIZE];
-#define BLOCKS_FOR_BYTES(byte_count)	((byte_count+TAR_BLOCK_SIZE-1)/TAR_BLOCK_SIZE)
-
-/* --------------------------------------------------------------------------------
- * lengths of various tar header fields
- */
-
-/* --------------------
- * Tar file names are always 100 bytes long and include preceding 
- * path names.  The utilities do not precluded paths that put the 
- * files outside of the "base" where the tar file was created.
- *
- * To handle tar files made by older tar utilities if the last 
- * character is '/' then the file should be assumed to be a directory.
- *
- * This 'type' is used for both the name of the object being archived
- * and the link target if it is a hard or soft link.
- */
-#define	TAR_NAME_LEN		(100)
-typedef char	tar_file_name	[TAR_NAME_LEN];
-
-/* --------------------
- * Tar mode strings are always 8 bytes long.
- *
- * 9 file access permissions bits and three execution mode bits.
- *
- * Zero '0' not NUL pre-fill unused bytes.  a user permision of 0644 would be stored as
- * "0000644" with a NUL terminator.
- *
- * The format is 7 octal ASCII bytes with only the last 4 being 
- * significant.  That is the first three are always '0'.  The 8th 
- * byte is NUL.
- *
- * Older utilities might put preceding ' ' characters or
- * instead of pre-fill have post fill ' ' or NUL.
- */
-#define TAR_MODE_LEN		(8)
-typedef char	tar_file_mode	[TAR_MODE_LEN];
-/* -----
- * These are the bits if the mode is in binary (octal defines for ease of interpretation)
- * they match the st_mode field from the stat()/fstat() struct stat.
- *
- * GNU tar puts the file type bits from the stat structure in the mode of the tar file.
- * Other tar implmentations might as well though no where is this dktefined as required or
- * recommended or even supported.
- */
-#define	TAR_SUID_BIT	(04000)	/* set UID on execution */
-#define	TAR_GUID_BIT	(02000)	/* set GID on execution */
-#define	TAR_STICKY_BIT	(01000)	/* save text / sticky bit */
-/* file permissions */
-#define	TAR_MODE_OREAD	(00400)	/* read by owner */
-#define	TAR_MODE_OWRITE	(00200)	/* write by owner */
-#define	TAR_MODE_OEXEC	(00100)	/* execute by owner */
-#define	TAR_MODE_GREAD	(00040)	/* read by group */
-#define	TAR_MODE_GWRITE	(00020)	/* write by group */
-#define	TAR_MODE_GEXEC	(00010)	/* execute by group */
-#define	TAR_MODE_WREAD	(00004)	/* read by other */
-#define	TAR_MODE_WWRITE	(00002)	/* write by other */
-#define	TAR_MODE_WEXEC	(00001)	/* execute by other */
-
-/* -----
- * These are the bits once converted into ASCII
- * with in an ASCII byte these bits are actually usable so no conversion needed
- * '0' = 0x30 / 060
- * '1' = 0x31 / 061
- * '2' = 0x32 / 062
- * '3' = 0x33 / 063
- * '4' = 0x34 / 064
- * '5' = 0x35 / 065
- * '6' = 0x36 / 066
- * '7' = 0x37 / 067
- */
-#define	TAR_MODE_READ		(0x01)
-#define	TAR_MODE_WRITE		(0x02)
-#define	TAR_MODE_EXEC		(0x04)
-#define TAR_MODE_STICKY		(0x01)
-#define TAR_MODE_GUID		(0x02)
-#define TAR_MODE_SUID		(0x04)
-#define	TAR_MODE_OWNER_BYTE	(6)
-#define	TAR_MODE_GROUP_BYTE	(5)
-#define	TAR_MODE_WORLD_BYTE	(4)
-#define	TAR_MODE_USER_BYTE	(3)
-#define	TAR_MODE_EXEC_BYTE	(2)
-
-/* --------------------
- * Tar user (and group) numeric IDs are put into 8 bytes.
- *
- * There is a '0' prefill and as terminating NUL.
- *
- * Older utilities might put preceding ' ' characters or
- * instead of pre-fill have post fill ' ' or NUL.
- */
-#define TAR_ID_LEN		(8)
-typedef	char	tar_id		[TAR_ID_LEN];
-
-/* --------------------
- * Tar file size elements are 12 bytes long with 11 used
- * for octal characters making the maximum size of a file
- * for pure classic or Posix tar limited to 8 GBytes.  
- * Various tar utilities handle longer files in different
- * ways if at all.
- *
- * A length of 100 bytes would be stored as "00000000144".
- *
- * Links and some other special values are archived with a
- * length of zero and thus no data blocks.
- *
- * There is a '0' prefill and as terminating NUL.
- *
- * Older utilities might put preceding ' ' characters or
- * instead of pre-fill have post fill ' ' or NUL.
- *
- * GNU tar implmentations use alternative intrpretatopms of
- * this and possibly other fields using mime base 64 or
- * base 256 (big endian nonstandard sized binary)
- */
-#define	TAR_SIZE_LEN		(12)
-typedef char	tar_size	[TAR_SIZE_LEN];
-#define MAX_TAR_FILE_SIZE	(077777777777)
-
-/* --------------------
- * Tar file modification/access/creation times are 12 bytes
- * long.  This holds 11 octal ASCII digits representing the
- * number of seconds since 01/01/1970 00:00 UTC.
- *
- * There is a '0' prefill and as terminating NUL.
- *
- * Older utilities might put preceding ' ' characters or
- * instead of pre-fill have post fill ' ' or NUL.
- */
-#define TAR_TIME_LEN		(12)
-typedef	char	tar_time	[TAR_TIME_LEN];
-
-/* --------------------
- * Tar has a weak checksum protection of part of the tar header
- * that is 8 bytes long and again uses 7 ASCII octal digits.
- *
- * There is a '0' prefill and as terminating NUL.
- *
- * Older utilities might put preceding ' ' characters or
- * instead of pre-fill have post fill ' ' or NUL.
- */
-#define TAR_CSUM_LEN		(8)
-typedef	char	tar_csum	[TAR_CSUM_LEN];
-#define	csum_blanks		("       ")
-
-/* --------------------
- * The tar link is a single byte that expresses the type of file
- * or special value represented by this entry.
- */
-typedef	char	tar_link;
-
-#define LINKS()                   \
-    link_('\0',OLDNORMAL_FILE)    \
-    link_('0',NORMAL_FILE)        \
-    link_('1',HARD_LINK)          \
-    link_('2',SYMBOLIC_LINK)      \
-    link_('3',CHARACTER_SPECIAL)  \
-    link_('4',BLOCK_SPECIAL)      \
-    link_('5',DIRECTORY)          \
-    link_('6',FIFO)               \
-    link_('7',CONTIGUOUS_FILE)    \
-    link_('A',SOLARIS_ACL)        \
-    link_('D',GNU_DUMPDIR)        \
-    link_('E',SOLARIS_ACL_FILE)   \
-    link_('I',INODE_METADATA)     \
-    link_('K',NEXT_LONG_LINK)     \
-    link_('L',NEXT_LONG_NAME)     \
-    link_('M',MULTI_VOLUME)       \
-    link_('N',GNU1989_LONG_NAMES) \
-    link_('S',SPARSE)             \
-    link_('V',VOLUME_NAME)        \
-    link_('X',SUN_XHDR)           \
-    link_('g',PAX_GLOBAL_XHDR)    \
-    link_('x',PAX_XHDR)
-
-#define link_(v,n)      PASTE_2(LINK_,n) = v,
-
-/* LINK_COUNT is a count not a mac value */
-enum e_tar_link
-{
-    LINKS()
-    LINK_COUNT
-};
-#undef link_
-
-#if _DEBUGGING
-#define link_(v,n) {STRINGIFY(n), v},
-struct nv_pair
-{
-    const char * name;
-    tar_link  link;
-};
-static const char * get_link_string(tar_link l)
-{
-    static const struct nv_pair pairs[] = 
-        {
-            LINKS()
-            {NULL, 0}
-        };
-    unsigned int ix;
-
-    for (ix = 0; pairs[ix].name != NULL; ++ix)
-        if (pairs[ix].link == l)
-            return pairs[ix].name;
-    return "UNDEFINED";
-}
-#undef link_
-#endif
-#undef LINKS
-
-
-/* --------------------
- * The tar magic string is 6 bytes long.
- */
-#define	TAR_MAGIC_LEN		(6)
-typedef char	tar_magic	[TAR_MAGIC_LEN];
-#define	POSIX_MAGIC_CONST	"ustar"		/* includes terminating NUL */
-
-/* --------------------
- * The tar version string is two bytes long and uses both bytes
- */
-#define	TAR_VERSION_LEN		(2)
-typedef	char	tar_version	[TAR_VERSION_LEN];
-#define	POSIX_VERSION_CONST	"00"		/* does not include terminating NUL */
-
-/* --------------------
- * The Posix strong user/group name is 32 bytes long
- */
-#define TAR_STRNAME_LEN		(32)
-typedef	char	tar_strname	[TAR_STRNAME_LEN];
-
-/* --------------------
- * The dev? strings are 8 bytes long
- */
-#define	TAR_DEV_LEN		(8)
-typedef	char	tar_dev		[TAR_DEV_LEN];
-
-/* --------------------
- * Posix prefix is 155 bytes that can be put before the name to give a path of
- * 255 bytes instad of the smaller limit of 99.
- */
-#define	TAR_PREFIX_LEN		(155)
-typedef	char	tar_prefix	[TAR_PREFIX_LEN];
-
-/*
- * Sun extensions
- */
-
-/* --------------------
- */
-typedef	char sun_extnum;
-#define	SUN_FULLSIZE_LEN	(10)
-typedef	char	sun_fullsize	[SUN_FULLSIZE_LEN];
-
-/* --------------------
- * star extensions
- *
- * star85 is old star from 1985
- */
-typedef	char	star85_version;
-#define	STAR85_FILETYPE_LEN	(8)
-typedef char	star85_filetype	[STAR85_FILETYPE_LEN];
-#define	STAR85_TYPE_LEN		(12)
-typedef	char	star85_type	[STAR85_TYPE_LEN];
-#define	STAR85_RDEV_LEN		(12)
-typedef	char	star85_rdev	[STAR85_RDEV_LEN];
-/* ignoring the 11 byte rdev with minor bits */
-#define	STAR85_UNAME_LEN	(16)
-typedef	char	star85_uname	[STAR85_UNAME_LEN];
-#define	STAR85_GNAME_LEN	(15)
-typedef	char	star85_gname	[STAR85_GNAME_LEN];
-#define	STAR_XMAGIC_LEN		(4)
-typedef	char	star_magic	[STAR_XMAGIC_LEN];
-#define	STAR_MAGIC_CONST	("tar")
-#define	NSTAR_PREFIX_LEN	(1)
-typedef	char	nstar_prefix	[NSTAR_PREFIX_LEN];
-
-/* --------------------
- * gnu extensions
- */
-#define	GNU89_MAGIC_LEN		(8)
-typedef	char	gnu89_magic	[GNU89_MAGIC_LEN];
-#define	GNU_89_MAGIC_CONST	"ustar  "		/* includes terminating NUL */
-#define	GNU_89_GNUMAGIC_CONST	"GNUtar "		/* includes terminating NUL */
-#define GNU89_LONGNAMES_LEN	(4)
-typedef char	gnu89_longnames	[GNU89_LONGNAMES_LEN];
-
-
-/* --------------------
- * shared between the feuding star and gnu tar
- */
-typedef	char	tar_isextended ;
-typedef struct	tar_sparse
-{
-    tar_size	offset;
-    tar_size	num_bytes;
-} tar_sparse;
-#define	GNU_SPARSES_IN_EXTRA_HEADER		(16)
-#define	GNU_SPARSES_IN_OLD_HEADER		(4)
-#define	GNU_SPARSES_IN_SPARSE_HEADER		(21)
-#define	STAR_SPARSES_IN_HEADER			(4)
-#define	STAR_SPARSES_IN_EXT_HEADER		(21)
-
-
-/* ----------------------------------------
- * The various tar header formats
- *
- * Note that in all the tar, posix and pax formats the first 257 bytes are
- * the same.  In all posix ad almost compliant formats the first
- * 345 bytes are the same (except GNU 89).  It is abuse of the 155
- * bytes of the prefix that make star and gnu truly not posix compliant
- * Sun used the 12 bytes after the prefix so is still psox compliant.
- */
-typedef	struct	tar_v7_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    /* end of header					// 257 */
-} tar_v7_header;
-
-typedef struct tar_posix_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    tar_magic		magic;				/* 257 */
-    tar_version		version;			/* 263 */
-    tar_strname		uname;				/* 265 */
-    tar_strname		gname;				/* 297 */
-    tar_dev		devmajor;			/* 329 */
-    tar_dev		devminor;			/* 337 */
-    tar_prefix		prefix;				/* 345 */
-    /* end of header					// 500 */
-} tar_posix_header, tar_pax_header;
-
-typedef struct tar_sun_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    tar_magic		magic;				/* 257 */
-    tar_version		version;			/* 263 */
-    tar_strname		uname;				/* 265 */
-    tar_strname		gname;				/* 297 */
-    tar_dev		devmajor;			/* 329 */
-    tar_dev		devminor;			/* 337 */
-    tar_prefix		prefix;				/* 345 */
-    sun_extnum		extnum;				/* 500 non-conformant */
-    sun_extnum		extcount;			/* 501 non-conformant */
-    sun_fullsize	fullsize;			/* 502 non-conformant */
-    /* end of header					// 512 non-conformant */
-} tar_sun_header;
-
-typedef struct tar_star_85_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    star85_version	starversion;			/* 257 non-conformant */
-    star85_filetype	starfiletype;			/* 258 internal type of file? non-conformant */
-    star85_type		startype;			/* 266 type of file (UNIX)? non-conformant */
-    star85_rdev		rdev;				/* 278 non-conformant */
-    tar_time		atime;				/* 290 non-conformant */
-    tar_time		ctime;				/* 302 non-conformant */
-    star85_uname	uname;				/* 314 non-conformant */
-    star85_gname	gname;				/* 330 non-conformant */
-    tar_prefix		prefix;				/* 345 non-conformant */
-    char		___fill0[8];			/* 500 non-conformant */
-    star_magic		xmagic;				/* 508 non-conformant */
-    /* end of header					// 512 non-conformant */
-} tar_star_85_header;
-typedef struct tar_star_94_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    tar_magic		magic;				/* 257 */
-    tar_version		version;			/* 263 */
-    tar_strname		uname;				/* 265 */
-    tar_strname		gname;				/* 297 */
-    tar_dev		devmajor;			/* 329 */
-    tar_dev		devminor;			/* 337 */
-    nstar_prefix	prefix;				/* 345 */
-    char		___fill0;			/* 346 */
-    char		___fill1[8];			/* 347 */
-    tar_isextended	isextended;			/* 355 non-conformant */
-    tar_sparse 		sparse[STAR_SPARSES_IN_HEADER];	/* 356 non-conformant */
-    tar_size		realsize;			/* 452 non-conformant */
-    tar_size		offset;				/* 464 non-conformant */
-    tar_time		atime;				/* 476 non-conformant */
-    tar_time		ctime;				/* 488 non-conformant */
-    char		___fill2[8];			/* 500 */
-    star_magic		xmagic;				/* 508 non-conformant */
-    /* end of header					// 512 */
-} tar_star_94_header;
-
-typedef struct tar_gnu_89_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    gnu89_magic		magic;				/* 257 non-conformant */
-    tar_strname		uname;				/* 265 */
-    tar_strname		gname;				/* 297 */
-    tar_dev		devmajor;			/* 329 */
-    tar_dev		devminor;			/* 337 */
-    tar_time		atime;				/* 345 non-conformant */
-    tar_time		ctime;				/* 357 non-conformant */
-    tar_size		offset;				/* 369 non-conformant */
-    gnu89_longnames	longnames;			/* 381 non-conformant */
-    char		___fill0[1];			/* 385 */
-    tar_sparse		sparse	[GNU_SPARSES_IN_OLD_HEADER];/* 386 optional sparse */
-    tar_isextended	isextended;			/* 482 non-conformant */
-    tar_size		realsize;			/* 483 non-conformant */
-    /* end of header					// 495 */
-} tar_gnu_89_header;
-
-typedef struct tar_gnu_99_header
-{
-    /* type		member name			 and offset */
-    tar_file_name	name;				/*   0 */
-    tar_file_mode	mode;				/* 100 */
-    tar_id		uid;				/* 108 */
-    tar_id		gid;				/* 116 */
-    tar_size		size;				/* 124 */
-    tar_time		mtime;				/* 136 */
-    tar_csum		csum;				/* 148 */
-    tar_link		link;				/* 156 */
-    tar_file_name	linkname;			/* 157 */
-    gnu89_magic		magic;				/* 257 non-conformant */
-    tar_strname		uname;				/* 265 */
-    tar_strname		gname;				/* 297 */
-    tar_dev		devmajor;			/* 329 */
-    tar_dev		devminor;			/* 337 */
-    tar_time		atime;				/* 345 non-conformant */
-    tar_time		ctime;				/* 357 non-conformant */
-    tar_size		offset;				/* 369 non-conformant */
-    gnu89_longnames	longnames;			/* 381 non-conformant */
-    char		___fill0[1];			/* 385 */
-    tar_sparse		sparse	[GNU_SPARSES_IN_OLD_HEADER];/* 386 non-conformant optional sparse */
-    tar_isextended	isextended;			/* 482 non-conformant */
-    tar_size		realsize;			/* 483 non-conformant */
-    /* end of header					// 495 */
-} tar_gnu_99_header;
-
-typedef struct tar_sparse_header
-{
-    /* type		member name			 and offset */
-    tar_sparse		sparse	[STAR_SPARSES_IN_EXT_HEADER];/* 0 */
-    tar_isextended	isextended;			/* 504 */
-} tar_sparse_header;					/* 505 end of header */
-
-typedef struct tar_cpio_header
-{
-    /* type		member name			 and offset */
-    char		magic		[6];		/*   0	must be "070707" */
-#define	TAR_CPIO_MAGIC_CONST ("070707")
-    char		dev		[6];		/*   6  (dev,ino) is unique for each file in archive */
-    char		ino		[6];		/*  12  see dev */
-    char		mode		[6];		/*  18 */
-    char		uid		[6];		/*  24 */
-    char		gif		[6];		/*  30 */
-    char		nlink		[6];		/*  36 */
-    char		rdev		[6];		/*  42 */
-    char		mtime		[11];		/*  48 */
-    char		namesize	[6];		/*  59 */
-    char		filesize	[6];		/*  65 */
-    char		buff		[1];		/*  71  name and file data */
-} tar_cpio_header;
-
-typedef union tar_header
-{
-    /* ----------
-     * The TAR header is to be zero filled by definition but some tar
-     * programs use ' ' instead.
-     *
-     * accept zeros ('0'), spaces (' ') or NULs (0x00) as equivalent where reasonable
-     *
-     * This name refers to the entire header as a single undifferentiated
-     * sequence of bytes.
-     */
-    tar_raw_block	raw;		/* tar block as an array of bytes: used for 0 blocks here */
-    tar_cpio_header	cpio;		/* cpio not really tar */
-    tar_v7_header	tar;		/* classic header back to the beginnings of memory */
-    tar_posix_header	posix;		/* ustar or Posix 1003.1 header */
-    tar_sun_header	suntar;		/* Sun Microsystems tar header */
-    tar_star_85_header	star_85;	/* star header from 1985 (pre-Posix) */
-    tar_star_94_header	star_94;	/* star header from 1994 (post-Posix) */
-    tar_gnu_89_header	gnu_89;		/* gnu header from circa 1989 (post-posix but broken) */
-    tar_gnu_99_header	gnu_99;         /* gnu header from ???? */
-    tar_sparse_header	sparse;		/* star / gnu extended sparses header */
-} tar_header;
-
-
-/* ======================================================================
- * local module-wide function like macros
- */
-/* -----
- * offset of is the count of bytes between the base of a structure and 
- * a particular member of that structure
- */
-#define	OFFSET_OF(structure,member) ((size_t)((&(((structure*)0)->member))-(0)))
-
-
-/* ======================================================================
- * compilation unit local functions
- */
-
-/* ======================================================================
- * return the RFC 2045 base 64 value for a byte character 
- * -1 for any out of range
- *
- * base 64 uses A-Z as 0-25, a-z as 26-51, 0-9 as 52-61, + as 62 and / as 63
- */
-static int64_t decode_base64char (uint8_t byte)
-{
-    /* 
-     * trade off of space for table versus time to upsize the return
-     * and reupsize where it is used
-     */
-    static const int8_t table[] = 
-	{
-	    /*
-	     * 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
-	     */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20 */
-	    52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30 */
-	    -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40 */
-	    15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50 */
-	    -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60 */
-	    41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0 */
-	    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1  /* F0 */
-	};
-    return table[byte];
-}
-
-
-/* ======================================================================
- * return the RFC 2045 base 64 value of a string at <str> of length <len>
- *
- * Interpreted the specification to mean that you simply ignore any out
- * of range characters.  They are not treated as bytes of 0 as that would
- * mean a shift of earlier bytes.
- *
- * Each character is 6 bits of the final value.
- */
-static int64_t decode_base64string (const uint8_t* str, size_t len)
-{
-    int64_t 	result = 0;
-    int64_t 	temp = 0;
-    size_t 	ix;
-
-    for (ix = 0; ix < len; ++ix)
-    {
-	if ((temp = decode_base64char(str[ix])) >= 0)
-	{
-	    result <<= 6; /* result *= 64 */
-	    result += temp;
-	}
-    }
-    return result;
-}
-
-
-/* ======================================================================
- * tar_strtoll
- *
- * This function will convert a string in a tar header into a 64 signed
- * integer.
- *
- * The original tar header used just octal numbers in ascii in fixed length
- * fields.  As normal in the computer software world these "obviously plenty
- * big" fields became way too small.
- *
- * GNU tar invented two approaches to make these numeric fields "bigger" but
- * only prolonged the pain by squeezing the new numbers into the same fields.
- *
- * In the tar v7 and ustar based tar headers the fields are:
- *	Name	Size	Octal Range	Interpretation
- *	mode	8	0-2097151 	bit flags
- *	uid	8	0-2097151
- *	gid	8	0-2097151
- *	size	12	0-8589934591	up to 8 Giga-Byte files
- *	mtime	12	0-8589934591 	1970/01/01 00:00:00 GMT-2242/03/16 12:56:31 GMT
- *	
- *	atime	12	0-8589934591 	1970/01/01 00:00:00 GMT-2242/03/16 12:56:31 GMT
- *	ctime	12	0-8589934591 	1970/01/01 00:00:00 GMT-2242/03/16 12:56:31 GMT
- *
- * GNU's first and already obsolete approach was to put Mime base-64 numbers
- * With these the first byte is '+' or '-' to signal it isn't octal ASCII.
- *
- * GNU's second approach is base-256 which is a big endian binary string of lengths other
- * than the 1, 2, 4 or 8 bytes of the standard integer types.  In this approach the first
- * byte is either 0x80 for a positive number or 0xFF for a negative number.
- */
-
-static int64_t tar_strtoll (const uint8_t * str, size_t len)
-{
-    int64_t	result = 0;
-    bool negative = false;
-    uint8_t temp_buff[24];	/* long enough to hold all octal bytes for 64 bit numbers */
-
-    /* -----
-     * force a NUL in case the source doesn't have one; this is for
-     * strtoll() on ASCII Octal
-     */
-    if ( len >= sizeof temp_buff )
-        len = sizeof temp_buff - 1;
-    memcpy (temp_buff, str, len);
-    temp_buff[ len ] = 0x00;
-
-    /* -----
-     * Most are going to be simple ASCII octal using '0'-'7' with NUL terminator
-     * leading 0 is not required but of course is accepted to match tar 
-     * header specifications
-     */
-    if (((temp_buff[0] >= '0')&&(temp_buff[0] <= '7'))||(temp_buff[0] == ' '))
-    {
-        /* use stdlib strtoll - longest expected goes a few bits into the upper longword */
-        result = strtoi64((char*)temp_buff,NULL,8);
-    }
-    /* -----
-     * "base-256" well that is "binary" big endian of some length
-     *
-     * For fields longer than eight bytes upper bytes will shift out of 
-     * significance into the bit bucket.
-     */
-    else if ((temp_buff[0] == 0x80)||(temp_buff[0] == 0xFF)) /* from GNU tar */
-    {
-        unsigned int ix;
-        negative = (bool)((temp_buff[0] == 0xFF) ? true : false);
-        result = temp_buff[0] & 0x7F; /* toss first flag bit */
-        for (ix = 1; ix < len; ++ix)
-        {
-            result <<= 8; /* result *= 256; */
-            result += temp_buff[ix];
-        }
-        if (negative)
-            result = -result;
-    }
-    /* -----
-     * "base-64" an already dumped idea from GNU tar
-     */
-    else if ((temp_buff[0] == '+')||(temp_buff[0] == '-')) /* from GNU tar */
-    {
-        int64_t temp;
-        negative = (bool)((temp_buff[0] == '-') ? true : false);
-        temp = decode_base64string(temp_buff+1,len-1);
-        /* potential overflow */
-        result = negative ? -temp : temp;
-    }
-
-    /* -----
-     * look for an empty field of all NUL
-     */
-    else if (temp_buff[0] == 0x00)
-    {
-        unsigned int ix;
-        for (ix = 1; ix < len; ++ix)
-        {
-            if (temp_buff[ix] != 0x00)
-                goto fail;
-        }
-    }
-    /* -----
-     * no idea what it is then
-     */
-    else
-    {
-    fail:
-        result = 0; /* as good a guess as any */
-        TAR_DEBUG (("%s: unknown integer storage type %c%c%c%c%c%c%c%c\n",
-                    temp_buff[0],temp_buff[1],temp_buff[2],temp_buff[3],
-                    temp_buff[4],temp_buff[5],temp_buff[6],temp_buff[7]));
-        PLOGMSG (klogErr, (klogErr, "unknown integer storage type $(B0)$(B1)$(B2)$(B3)$(B4)$(B5)$(B6)$(B7)",
-                           "B0=%c,B1=%c,B2=%c,B3=%c,B4=%c,B5=%c,B6=%c,B7=%c",
-                           temp_buff[0],temp_buff[1],temp_buff[2],temp_buff[3],
-                           temp_buff[4],temp_buff[5],temp_buff[6],temp_buff[7]));
-    }
-    return result;
-}
-
-
-
-/* ======================================================================
- * tar_header_type
- * determine most probable tar header block type
- */
-static tar_header_type	what_header_type(const tar_header* header)
-{
-    /* -----
-     * we'll assume its bad until we find a better guess
-     */
-    tar_header_type type = TAR_UNDEFINED;
-
-    /* -----
-     * look for a cpio header though we aren't expecting to support it quite yet
-     */
-    if (strncmp(header->cpio.magic, TAR_CPIO_MAGIC_CONST, sizeof(header->cpio.magic)) == 0)
-    {
-	type = TAR_CPIO;
-    }
-    /* -----
-     * look for extended headers of some type
-     *
-     * look for posix based extensions as hopefully most likely
-     */
-    else if (strcmp(header->posix.magic, POSIX_MAGIC_CONST) == 0)
-    {
-	/* -----
-	 * we have a post posix standard tar header but we aren't done yet
-	 *
-	 * First we look for star extensions to the header
-	 */
-	if (strcmp(header->star_94.xmagic, STAR_MAGIC_CONST) == 0)
-	{
-
-	    /* -----
-	     * we have either an old or new star archive
-	     */
-	    if (strcmp(header->star_94.magic, POSIX_MAGIC_CONST) == 0)
-	    {
-		/* -----
-		 * we have a new star type archive
-		 */
-		type = TAR_STAR_94;
-	    }
-	    else
-	    {
-		/* -----
-		 * we have a old star type archive
-		 */
-		type = TAR_STAR_85;
-	    }
-	}
-	/* -----
-	 * Next we look for SunOS5 extensions to the header
-	 */
-	else if (header->suntar.extnum &&
-		 header->suntar.extcount &&
-		 header->suntar.fullsize)
-	{
-	    type = TAR_SUN;
-	}
-	/* -----
-	 * Else it seems to be the generic Posix tar header
-	 */
-	else
-	{
-	    type = TAR_POSIX;
-	}
-    }
-    /* -----
-     * Not a proper magic for a POSIX ustar header so look for the improper magic of GNU's tar
-     */
-    else if (strcmp(header->star_94.magic, GNU_89_MAGIC_CONST) == 0)
-    {
-	/* we have an old GNU not really posix compliant archive type */
-	type = TAR_GNU_89;
-    }
-    /* -----
-     * If there is anything else there we don't know what to do with it
-     */
-    else if (header->posix.magic[0] != 0)
-    {
-	/* -----
-	 * Log an anomaly showing what we found in the magic field
-	 */
-	char temp_str	[9];
-	memset(temp_str,0,sizeof(temp_str));
-	string_copy(temp_str, sizeof(temp_str), header->posix.magic, 8);
-        TAR_DEBUG(("%s: unknown header type magic [%s]\n",
-                   __func__, temp_str));
-	type = TAR_UNDEFINED;
-    }
-    /* -----
-     * not knowing what we have lets see if it is a block of all zeroes
-     * knowing we can ignore it
-     */
-    else
-    {
-	/* -----
-	 * If this were a legitimate V7 (well just old style)
-	 * tar header the first character would be non-NUL
-	 * and the link would be on eof the old types
-	 */
-	if ((header->raw[0]>= ' ')&&(header->raw[0] <= '~'))
-	{
-	    switch (header->tar.link)
-	    {
-	    case LINK_OLDNORMAL_FILE:
-	    case LINK_NORMAL_FILE:
-	    case LINK_HARD_LINK:
-	    case LINK_SYMBOLIC_LINK:
-	    case LINK_CHARACTER_SPECIAL:
-	    case LINK_BLOCK_SPECIAL:
-	    case LINK_DIRECTORY:
-	    case LINK_FIFO:
-	    case LINK_CONTIGUOUS_FILE:
-		/* GNU TAR will do this to us */
-	    case LINK_NEXT_LONG_LINK:
-	    case LINK_NEXT_LONG_NAME:
-	    case LINK_GNU1989_LONG_NAMES:
-		type = TAR_V7;
-		break;
-	    default:
-		break;
-	    }
-	}
-	else
-	{
-	    /* -----
-	     * look for anything not zero
-	     */
-	    unsigned int ix;
-
-	    for (ix = 0; ix < sizeof(tar_header); ++ix)
-	    {
-		if (header->raw[ix])
-		{
-		    /* -----
-		     * non-zero so quit looking
-		     */
-		    break;
-		}
-	    }
-	    /* -----
-	     * if we got to the end we know they are all zero so say so
-	     */
-	    if (ix == sizeof(tar_header))
-	    {
-		type = TAR_ZERO_BLOCK;
-	    }
-	}
-    }
-    TAR_DEBUG (("%s: %s(%d)\n", __func__, get_type_string(type), type));
-    return type;
-}
-
-
-typedef struct sparse_data
-{
-    struct sparse_data*	next;
-    uint64_t		offset;
-    uint64_t		size;
-} sparse_data;
-/* ======================================================================
- */
-
-static rc_t	sparse_data_make (sparse_data ** new_item, uint64_t offset, uint64_t size)
-{
-    sparse_data * p;
-
-    p = malloc (sizeof (sparse_data));
-    if (p != NULL)
-    {
-	p->offset = offset;
-	p->size = size;
-	p->next = NULL;
-	*new_item = p;
-	return 0;
-    }
-    else
-	return -1;
-}
-
-static rc_t	sparse_data_push(sparse_data ** q, uint64_t offset, uint64_t size)
-{
-    if (q == NULL)
-    {
-	return -1;
-    }
-    else if (*q == NULL)
-    {
-	return sparse_data_make (q, offset, size);
-    }
-    else 
-    {
-	return sparse_data_push (&((*q)->next), offset, size);
-    }
-}
-
-static rc_t	sparse_data_pop (sparse_data ** q, sparse_data **item)
-{
-    if ((q == NULL) || (item == NULL))
-    {
-	return -1;
-    }
-    else
-    {
-	*item = *q;
-	*q = (*item)->next;
-	(*item)->next = NULL;
-	return 0;
-    }
-}
-
-static rc_t	sparse_data_kill (sparse_data ** q)
-{
-    if (q == NULL)
-    {
-	return -1;
-    }
-    if (*q == NULL)
-    {
-	return 0;
-    }
-    if ((*q)->next != NULL)
-    {
-	return sparse_data_kill(&(*q)->next);
-    }
-    free (*q);
-    *q = NULL;
-    return 0;
-}
-
-/* ======================================================================
- * local module-wide variables (reduction in parameter pushing)
- *
- * Module shared variables; kinda like C++ class elements
- */
-typedef struct KTarState
-{
-    /* TODO: optimize chunk/sparse lists by counting as pushed */
-    const KFile *	kfile;		/* KFS reference to the specific file being parsed */
-    const KMMap *	kmmap;		/* KFS memory mapping for a portion of that file */
-    const void *	map;		/* where the tar file got put by mmap */
-    sparse_data * 	sparse_q;
-    KTocChunk *		chunks;		/* table of chunks: logical_position, source_position, size */
-    KToc *		toc;		/* the Table of Contents we are building */
-    size_t		tar_length;	/* how long is the tar file */
-    size_t		buffer_length;	/* how long is the window into the buffer */
-    uint64_t		buffer_start;	/* how far into the tar file is the buffer start */
-    uint64_t		buffer_limit;	/* how far into the tar file is the buffer end */
-    uint32_t		num_chunks;
-    /* -----
-     * zero blocks are only supposed to pad out the end of a tar file to
-     * match a larger block size.  If we find something after a zero block
-     * it is a file error of some type
-     */
-    bool		found_zero_block;
-    bool		found_second_zero_block;
-} KTarState;
-
-static rc_t make_chunk_list(KTarState * self, uint64_t file_offset)
-{
-    uint64_t		count = self->num_chunks;
-    uint64_t		source_position = file_offset;
-    uint64_t		ix;
-    sparse_data * 	psd;
-    rc_t		ret;
-
-    if (self->chunks)
-	free (self->chunks); /* shouldn't happen */
-    self->chunks = malloc( (size_t)( count * sizeof(KTocChunk) ) );
-    if (self->chunks == NULL)
-	return -1;
-
-
-    for (ix = 0; ix < count; ++ix)
-    {
-	ret = sparse_data_pop (&self->sparse_q, &psd);
-	if (ret != 0)
-	    return ret;
-	self->chunks[ix].logical_position = psd->offset;
-	self->chunks[ix].source_position = source_position;
-	self->chunks[ix].size = psd->size;
-	source_position += psd->size;
-	sparse_data_kill(&psd);
-    }
-    return 0;
-}
-
-static void whack_chunk_list(KTarState * self)
-{
-    free (self->chunks);
-    self->chunks = NULL;
-    self->num_chunks = 0;
-}
-
-#if HANDLING_EXTENDED_HEADERS
-/* ======================================================================
- * mini class for handling pax/posix/ustar 
- * extended headers and global extended headers
- *
- * Many of the values are included to get past range limits imposed by the ustar format
- * particular for string length and charcter set or shortish integral values.  <ekyword>
- * and <value> below are UTF-8.
- *
- * values in the header are string values written as with a 'printf' using the form
- *	printf("%d %s=%s\n",<length>,<keyword>,<value>)
- *
- * <length> is described ambiguously as 
- *	"The <length> field shall be the decimal length of the extended header record in octets,
- *	 including the trailing <newline>."
- * So does that include the length of <length>? or not?
- *
- * The field <keyword> is allowed in a pax Extended Header include but are not limited to
- *	atime		time_t but with fractional seconds maybe
- *	charset		enumeration list
- *	comment		human readable comments
- *	gid		integer gid allowing numbers greater than ustar limit of 2097151 (07777777)
- *	gname		over rides xhdr gid and ustar gname and gid
- *	linkpath
- *	mtime		time_t but with franctional seconds maybe
- *	path
- *	realtime.<ANY>
- *	security.<ANY>
- *	size
- *	uid		integer uid allowing numbers greater than ustar limit of 2097151 (07777777)
- *	uname
- * Any other keywords desired can be included but might not be meaningful to many applications.
- * Keyword can have pretty much any character in it except '='.
- *
- * <value> is a UTF-8 string that ends with the '\n'.
- * 
- *
- * charset is limited to (omit the quotation marks)
- *      <value>			  Formal Standard
- * "ISO-IR 646 1990"		ISO/IEC 646:1990
- * "ISO-IR 8859 1 1998"		ISO/IEC 8859-1:1998
- * "ISO-IR 8859 2 1999"		ISO/IEC 8859-2:1999
- * "ISO-IR 8859 3 1999"		ISO/IEC 8859-3:1999
- * "ISO-IR 8859 4 1998"		ISO/IEC 8859-4:1998
- * "ISO-IR 8859 5 1999"		ISO/IEC 8859-5:1999
- * "ISO-IR 8859 6 1999"		ISO/IEC 8859-6:1999
- * "ISO-IR 8859 7 1987"		ISO/IEC 8859-7:1987
- * "ISO-IR 8859 8 1999"		ISO/IEC 8859-8:1999
- * "ISO-IR 8859 9 1999"		ISO/IEC 8859-9:1999
- * "ISO-IR 8859 10 1998"	ISO/IEC 8859-10:1998
- * "ISO-IR 8859 13 1998"	ISO/IEC 8859-13:1998
- * "ISO-IR 8859 14 1998"	ISO/IEC 8859-14:1998
- * "ISO-IR 8859 15 1999"	ISO/IEC 8859-15:1999
- * "ISO-IR 10646 2000"		ISO/IEC 10646:2000
- * "ISO-IR 10646 2000 UTF-8"	ISO/IEC 10646, UTF-8 encoding
- * "BINARY"			None.
- */
-typedef enum pax_charset
-{
-    PAX_CS_NOT_SPECIFIED,
-    PAX_CS_ISO_IR_646_1990,
-    PAX_CS_ISO_IR_8859_1_1998,
-    PAX_CS_ISO_IR_8859_2_1999,
-    PAX_CS_ISO_IR_8859_3_1999,
-    PAX_CS_ISO_IR_8859_4_1998,
-    PAX_CS_ISO_IR_8859_5_1999,
-    PAX_CS_ISO_IR_8859_6_1999,
-    PAX_CS_PAX_CS_ISO_IR_8859_7_1997,
-    PAX_CS_ISO_IR_8859_8_1999,
-    PAX_CS_ISO_IR_8859_9_1999,
-    PAX_CS_ISO_IR_8859_10_1998,
-    PAX_CS_ISO_IR_8859_13_1998,
-    PAX_CS_ISO_IR_8859_14_1998,
-    PAX_CS_ISO_IR_8859_15_1998,
-    PAX_CS_ISO_IR_1064_2000,
-    PAX_CS_ISO_IR_1064_2000_UTF_8,
-    PAX_CS_BINARY
-} pax_charset;
-
-static const char * pax_charset_strings[] = 
-{
-    "Not Specified",
-    "ISO-IR 646 1990",
-    "ISO-IR 8859 1 1998",
-    "ISO-IR 8859 2 1999",
-    "ISO-IR 8859 3 1999",
-    "ISO-IR 8859 4 1998",
-    "ISO-IR 8859 5 1999",
-    "ISO-IR 8859 6 1999",
-    "ISO-IR 8859 7 1987",
-    "ISO-IR 8859 8 1999",
-    "ISO-IR 8859 9 1999",
-    "ISO-IR 8859 10 1998",
-    "ISO-IR 8859 13 1998",
-    "ISO-IR 8859 14 1998",
-    "ISO-IR 8859 15 1999",
-    "ISO-IR 10646 2000",
-    "ISO-IR 10646 2000 UTF-8",
-    "BINARY",
-    NULL
-};
-
-static pax_charset pax_xhdr_parse_charset_string(char*string)
-{
-    int ix;		/* index */
-    const char * ps;	/* pointer to string */
-
-    for (ps = pax_charset_strings[ix= 0]; ps; ps = pax_charset_strings[++ix])
-	if (strcmp(ps,string) == 0)
-	    return ix;
-    return PAX_CS_NOT_SPECIFIED;	/* matched none so set it to not specified */
-}
-
-typedef struct pax_xheader pax_xheader;
-struct pax_xheader
-{
-    char *	path;		/* supercedes .posix.name */
-    char *	linkpath;	/* supercedes .posix.linkname */
-    char *	uname;		/* user name supercedes .posix.uname uid and .posix.uid */
-    char *	gname;		/* group name supercedes .posix.gname gid and .posix.gid */
-    time_t	atime;		/* supercedes .posix.atime */
-    time_t	mtime;		/* supercedes .posix.mtime */
-    uid_t	uid;		/* supercedes .posix.uid */
-    uint32_t	gid;		/* supercedes .posix.gname */
-    uint64_t	size;		/* supercedes .posix.size */
-    pax_charset	charset;	/* not supported by us? */
-};
-
-static pax_xheader *	pax_xhdr_create (void)
-{
-    pax_xheader * pxv = malloc (sizeof(pax_xheader));
-    memset (pxv,0,sizeof(pax_xheader));
-    return pxv;
-}
-
-static void	pax_xhdr_delete(pax_xheader * self)
-{
-    if (self->path)
-	free (self->path);
-    if (self->linkpath)
-	free (self->linkpath);
-    if (self->uname)
-	free (self->uname);
-    if (self->gname)
-	free (self->gname);
-    free (self);
-}
-
-static rc_t  pax_xhdr_set_general_string (char ** str, const char * val)
-{
-    size_t	len;	/* how much memory */
-    char      *	nl;	/* point to any new line in source */
-    rc_t	rc = 0;	/* return code; assume success */
-
-    if (*str)		/* if already set, free the old value */
-	free (*str);
-    nl = strchr (val, '\n');
-    if (nl)
-    {
-	len = nl - val + 1; /* +1 for NUL */
-    }
-    else
-    {
-        size_t size;
-        len = string_measure(val, &size) + 1;
-    }
-    *str = malloc (len);
-    if (*str)
-    {
-        string_copy(*str, len, val, len-1);
-        (*str)[len-1] = '\0'; /* if it was a '\n' terminated value this is needed not worth the check if needed */
-    }
-    else
-    {
-	rc = RC(rcFS/*?*/,rcAllocating,0/*?*/,rcNoObj/*?*/,rcNull); /* well its not 0 */
-    }
-    return rc;
-}
-
-/* ----------
- * new_path points to a string that ends with either a '\n' or a NUL
- */
-LIB_EXPORT rc_t CC pax_xhdr_set_path(pax_xheader * self, char * new_path)
-{
-    return pax_xhdr_set_general_string(&(self->path),new_path);
-}
-
-/* ----------
- * new_path points to a string that ends with either a '\n' or a NUL
- */
-LIB_EXPORT rc_t CC pax_xhdr_set_linkpath(pax_xheader * self, char * new_path)
-{
-    return pax_xhdr_set_general_string(&(self->linkpath),new_path);
-}
-
-/* ----------
- * new_name points to a string that ends with either a '\n' or a NUL
- */
-LIB_EXPORT rc_t CC pax_xhdr_set_uname(pax_xheader * self, char * new_name)
-{
-    return pax_xhdr_set_general_string(&(self->uname),new_name);
-}
-
-/* ----------
- * new_name points to a string that ends with either a '\n' or a NUL
- */
-LIB_EXPORT rc_t CC pax_xhdr_set_gname(pax_xheader * self, char * new_name)
-{
-    return pax_xhdr_set_general_string(&(self->gname),new_name);
-}
-
-LIB_EXPORT bool CC pax_xhdr_get_general_string (char**src, char**dst, size_t max)
-{
-    size_t size;
-    if (string_measure(*src, &size) > max-1)	/* fail if too big for target */
-    {
-        return false;
-    }
-    string_copy(*dst, max, *src, size);
-    return true;
-}
-
-LIB_EXPORT rc_t CC pax_xhdr_get_path(pax_xheader * self, char ** path, size_t max)
-{
-    return (pax_xhdr_get_general_string(&self->path,path,max))? 0 : ~0;
-}
-
-LIB_EXPORT rc_t CC pax_xhdr_get_linkpath(pax_xheader * self, char ** path, size_t max)
-{
-    return (pax_xhdr_get_general_string(&self->linkpath,path,max))? 0 : ~0;
-}
-
-LIB_EXPORT rc_t CC pax_xhdr_get_uname(pax_xheader * self, char ** name, size_t max)
-{
-    return (pax_xhdr_get_general_string(&self->uname,name,max))? 0 : ~0;
-}
-
-LIB_EXPORT rc_t CC pax_xhdr_get_gname(pax_xheader * self, char ** name, size_t max)
-{
-    return (pax_xhdr_get_general_string(&self->gname,name,max))? 0 : ~0;
-}
-
-/* ----------
- * The mtime and atime <value> is defined as
- *	The pax utility shall write an mtime record for each file in write
- *	or copy modes if the file's modification time cannot be represented
- *	exactly in the ustar header logical record described in ustar
- *	Interchange Format. This can occur if the time is out of ustar range,
- *	or if the file system of the underlying implementation supports
- *	non-integer time granularities and the time is not an integer. All of
- *	these time records shall be formatted as a decimal representation of
- *	the time in seconds since the Epoch. If a period ( '.' ) decimal
- *	point character is present, the digits to the right of the point shall
- *	represent the units of a subsecond timing granularity, where the first
- *	digit is tenths of a second and each subsequent digit is a tenth of
- *	the previous digit. In read or copy mode, the pax utility shall
- *	truncate the time of a file to the greatest value that is not greater
- *	than the input header file time. In write or copy mode, the pax
- *	utility shall output a time exactly if it can be represented exactly
- *	as a decimal number, and otherwise shall generate only enough digits
- *	so that the same time shall be recovered if the file is extracted on a
- *	system whose underlying implementation supports the same time
- *	granularity.
- *
- * So...
- * Looks like for our purposes we ignore anything after a possible decimal
- * point and just use the integer part of whatever is there and just not be
- * to worried about it since we aren't creating any of this, just reading ie.
- */
-static rc_t	pax_xhdr_set_general_time (const char * ts, time_t * tt)
-{
-    uint64_t temp = strtou64(ts,NULL,10); /* tosses decimal part for us */
-
-    if (temp)
-        *tt = (time_t)temp;
-    return temp ? 0 : ~0;
-}
-
-/* ======================================================================
- * This is the data accumulated for each entry in a tar file.
- */
-static struct	tar_entry_data
-{
-    /* -----
-     * We are not using linux (or other O/S specific) type here because the ranges
-     * for the system creating the archive might have larger types than the system
-     * we are running on.  We'll leave it to the outside caller of this program to
-     * "make it fit".
-     */
-
-    
-    entry_type	type;
-
-    char *	path;
-    char *	link;
-
-    uint64_t	size;
-    uint64_t	offset;
-
-    mode_t	mode;
-
-    char *	uname;
-    uid_t	uid;
-
-    char *	gname;
-    uint32_t	gid;
-
-    time_t	mtime;
-    time_t	atime;
-    time_t	ctime;
-
-} tar_entry_data;
-#endif
-/* ======================================================================
- * Mapping a memory region
- *
- * This will have two versions:
- *	initially for development it will make raw Linux O/S calls
- *	quickly it will be ported to use KFS structures instead
- */
-/* -----
- * Use a map window size of a gigabyte
- * Life would be really bad if a single header was with in pagesize of that gigabyte
- * This assumes that a gigabyte is a multiple of system pagesize - a very safe bet.
- */
-#define	MAP_WINDOW_SIZE	(1024*1024*1024)
-
-/* ----------
- * map_tar_file
- *
- * This function uses existing members of the ktar state structure and a single parameter
- * to decide what part of a file to map.
- *
- * IN: offset: 	an uint64_t type of where the starting point with in the file the memory mapped region
- *		should start
- * SIDE:	side effects are a freeing of any existing memory mapped region of a file and
- *		if successful mappinga region it will have mapped that region and put real
- *		parameters describing that region in the private memory block
- */
-static
-rc_t map_tar_file (KTarState * self, uint64_t requested_offset)
-{
-    rc_t  ret = 0;
-
-    /* -----
-     * If we are mapping for the first time
-     */
-    if (self->kmmap == NULL)
-    {
-	ret = KMMapMakeMaxRead(&self->kmmap,self->kfile);
-	if (ret)
-	    return ret;
-	ret = KMMapSize(self->kmmap, &self->buffer_length);
-	if (ret)
-	    return ret;
-    }
-    /* -----
-     * if we are remapping the region
-     */
-    else
-    {
-	ret = KMMapReposition(self->kmmap, requested_offset, &self->buffer_length);
-	if (ret)
-	    return ret;
-    }
-    ret = KMMapAddrRead(self->kmmap, &self->map);
-    if (ret)
-	return ret;
-    ret = KMMapPosition(self->kmmap, &self->buffer_start);
-    if (ret)
-	return ret;
-    ret = KMMapSize(self->kmmap, &self->buffer_length);
-    if (ret)
-	return ret;
-    self->buffer_limit = self->buffer_start + self->buffer_length;
-
-    return ret;
-}
-
-static
-rc_t release_map (KTarState * self)
-{
-    KMMapRelease (self->kmmap);
-    self->kmmap = NULL;
-    return 0;
-}
-
-/* ======================================================================
- *
- * offset is the byte position within the tar file
- * hard_limit is the byte position with in the tar file that is not mapped
- *
- * This is the ugliest function/method in the whole module.  The extensions
- * to the tar header are not done in a consistent manner so convolutions
- * have to be made to support all manner of extensions.
- */
-static
-uint64_t process_one_entry (KTarState * self, uint64_t offset, uint64_t hard_limit, bool silent)
-{
-    /* -----
-     * full_path will store the full path of an element which can be longer than 
-     * will fit in the standard tar header.  This will also usually be an output
-     * to the consumer.
-     */
-    char		full_path	[4096];
-
-    /* -----
-     * full_path will store the full link (if any) of an element which can be longer than 
-     * will fit in the standard tar header.  This will also usually be an output
-     * to the consumer.
-     */
-    char		full_link	[4096];
-
-    /* -----
-     * data_offset will index into the tar file where the data portion for the current header
-     * lies. (Usually at the address of the header + 512)  This will also usually be an output
-     * to the consumer.
-     */
-    uint64_t data_offset = 0;
-
-    /* -----
-     * data_size will hold the size of the data portion for the current header.  This will also
-     * usually be an output to the consumer.
-     */
-    uint64_t data_size = 0;
-
-    /* -----
-     * virtual_data_size will hold the virtual size of a sparse file.  This will also
-     * usually be an output to the consumer.
-     */
-    uint64_t virtual_data_size = 0;
-    /* -----
-     * type is an enumerated type that described the format of the tar header.  Its initialized
-     * to an invalid header type.
-     */
-    tar_header_type	type = TAR_UNDEFINED;
-
-    /* -----
-     * link is an enumerated type that described the contents of this element.
-     */
-    tar_link		link = LINK_OLDNORMAL_FILE;
-#if _DEBUGGING && 0
-/* We are not using these components of the tar header block at this point 
- * but with a debug build it doesn't hurt to verify we fully understand the
- * header.
- */
-    uid_t  uid = 0;
-    uint32_t gid = 0;
-#endif
-    time_t mtime = 0;
-    mode_t mode = 0;
-
-    /* -----
-     * current_offset is the offset of the current header which might be a different header 
-     * than the one we started with.
-     */
-    uint64_t current_offset = offset;
-
-    /* -----
-     * we can access the header either as a sequence of bytes or as a
-     * header structure.  That header can further be accessed as one of
-     * several more specific types of header.
-     */
-    union
-    {
-        const uint8_t *    b;
-        const tar_header * h;
-    } current_header;
-
-    /* -----
-     * done is a flag as to when we are finished processing a tar element
-     * that might have multiple headers and other elements
-     */
-    bool done = false;
-
-    /* -----
-     * gnu_sparse is a flag that we are currently inside a sparse file
-     * with in the TAR and have more sparse header elements to parse
-     */
-    bool gnu_sparse = false;
-
-    FUNC_ENTRY();
-
-    /* -----
-     * check right away to make sure we are still in our memory mapped window
-     */
-    if (offset > self->buffer_limit)
-    {
-        /* -----
-         * if not bail and say we couldn't consume any bytes
-         */
-        return 0;
-    }
-
-    /* -----
-     * clear the full name and link name entries
-     */
-    memset (full_path, 0, sizeof(full_path));
-    memset (full_link, 0, sizeof(full_link));
-
-    /* -----
-     * set the header at the current TAR block.
-     * That is the map starts at offset buffer_start and we are at 
-     * current_offset into the file so we take the map as a pointer
-     * and add to it the difference between our current offset and the map's
-     * initial offset (first header is at map + 0 - 0)
-     */
-    current_header.b = (const uint8_t *)self->map + current_offset - self->buffer_start;
-    /* -----
-     * start processing
-     */
-    do
-    {
-        TAR_DEBUG (( "Processing one block at (%lu), it is sparse? %s\n",
-                     current_offset, get_bool_string(gnu_sparse)));
-
-	/* -----
-	 * what we will do depends upon the type of this block
-	 */
-	type = gnu_sparse ? TAR_SPARSE : what_header_type(current_header.h);
-	if (self->found_zero_block)
-	{
-	    if (self->found_second_zero_block == true)
-	    {
-		type = TAR_ZERO_BLOCK; /* skip anyway */
-	    }
-	    else if (type == TAR_ZERO_BLOCK)
-	    {
-		self->found_second_zero_block = true;
-	    }
-	    else
-	    {
-		PLOGMSG(klogErr,(klogErr,
-			 "Found Extra Header after a block of zeros $(O)",
-			 PLOG_U64(O), offset));
-		return -1;
-	    }
-	}
-	switch (type)
-	{
-	case TAR_ZERO_BLOCK:
-	{
-	    self->found_zero_block = true;
-	    done = true;
-	    break;
-	}
-	case TAR_SPARSE:
-	{
-	    /* -----
-	     * If there is an extension header we'll have different work to do
-	     */
-/* 	    if (current_header.h->sparse.isextended) */
-/* 	    { */
-/* 		LOGMSG (klogDebug3,"isextended true"); */
-/* 	    } */
-/* 	    else */
-/* 	    { */
-/* 		LOGMSG (klogDebug3,"isextended false"); */
-/* 	    } */
-	    {
-		int64_t  ix;
-		uint64_t of;
-		uint64_t sz;
-
-		for (ix = 0; ix< GNU_SPARSES_IN_EXTRA_HEADER; ++ix)
-		{
-		    rc_t ret;
-		    of = tar_strtoll((const uint8_t*)current_header.h->sparse.sparse[ix].offset,
-				     TAR_SIZE_LEN);
-		    sz = tar_strtoll((const uint8_t*)current_header.h->sparse.sparse[ix].num_bytes,
-				     TAR_SIZE_LEN);
-		    if (sz == 0)
-		    {
-			break;
-		    }
-/* 		    PLOGMSG ((klogDebug4,  */
-/* 			      "SPARSE ext: $(count): $(offset) $(size)", */
-/* 			      PLOG_3(PLOG_I64(count),PLOG_X64(offset),PLOG_X64(size)), */
-/* 			      ix, */
-/* 			      of, */
-/* 			      sz)); */
-
-		    ret = sparse_data_push (&self->sparse_q, of, sz);
-		    if (ret)
-		    {
-			sparse_data_kill(&self->sparse_q);
-			return -1;
-		    }
-		    ++self->num_chunks;
-		}
-	    }
-	}
-	break;
-
-/* Same as the default case */	    
-/* 	case TAR_CPIO: */
-/* 	    PLOGMSG ((klogErr, */
-/* 		      "unsupported header type $(type) $(string)", */
-/* 		      "type=%d,string=%s", */
-/* 		      type, get_type_string(type))); */
-/* 	    done = true; */
-/* 	    break; */
-
-	default:
-            if ( ! silent )
-                PLOGMSG (klogErr,(klogErr,
-                                  "unsupported header type $(type) $(string)",
-                                  "type=%d,string=%s",
-                                  type, get_type_string(type)));
-	    done = true;
-	    break;
-
-	case TAR_GNU_89:
-	case TAR_V7:
-	case TAR_POSIX:
-	    /* -----
-	     * almost anything we do will depend upon the size of the data for this block
-	     *
-	     * this will be wrong if we ever support cpio...
-	     */
-	    data_size = (uint64_t)(tar_strtoll((uint8_t*)current_header.h->tar.size,TAR_SIZE_LEN));
-#if _DEBUGGING && 0
-            uid =  (tar_strtoll((uint8_t*)current_header.h->tar.uid,TAR_ID_LEN));
-            gid =  (tar_strtoll((uint8_t*)current_header.h->tar.gid,TAR_ID_LEN));
-#endif
-            mtime = (tar_strtoll((uint8_t*)current_header.h->tar.mtime,TAR_TIME_LEN));
-	    mode = (uint32_t)(tar_strtoll((uint8_t*)current_header.h->tar.mode,TAR_MODE_LEN));
-	}
-	/* -----
-	 * Sometimes we are done just by identifying the header type.
-	 * If so we break the loop here.
-	 */
-	if (done)
-	{
-	    /* -----
-	     * point at the next header block
-	     * Add the size of the header itself plus enough block sizes of data to cover
-	     * any associated data.
-	     */
-	    size_t header_plus_data_block_size = (1+BLOCKS_FOR_BYTES(data_size))*TAR_BLOCK_SIZE;
-	    current_offset += (uint64_t)header_plus_data_block_size;
- 	    current_header.b += header_plus_data_block_size;
-	    break;
-	}
-
-	/* -----
-	 * several extensions to USTAR/TAR format headers involve
-	 * prepending another header type to give a name longer 
-	 * than will fit in tthe header itself.  If we had one of
-	 * those use that name.  But if the full path has not been
-	 * set use the path from this header.
-	 */
-	if (full_path[0] == 0) /* if full_path wasn't filled in by an 'L' long name */
-	{
-            size_t len, size;
-	    /* -----
-	     * if there is a prefix (POSIX style) use it
-	     * copy the prefix and then concatenate the name field
-	     */
-	    if (current_header.h->posix.prefix[0])
-	    {
-/* 		PLOGMSG ((klogDebug1, */
-/* 			  "used a posix prefix $(prefix)", */
-/* 			  "prefix=%s", */
-/* 			  current_header.h->posix.prefix)); */
-		/* -----
-		 * copy in the prefix, force a NUL just in case. then add a directory divider 
-		 */
-            string_copy(full_path, sizeof(full_path), current_header.h->posix.prefix, TAR_PREFIX_LEN);
-		full_path[TAR_PREFIX_LEN] = 0x00;
-		strcat(full_path,"/");
-	    }
-	    strncat(full_path,current_header.h->tar.name,TAR_NAME_LEN);
-            len = string_measure(full_path, &size);
-            while (len > 1)
-            {
-                if (full_path[len-1] == '/')
-                    len--;
-                else
-                    break;
-            }
-            full_path[len] = '\0';
-	}
-	link = current_header.h->tar.link;
-        TAR_DEBUG(("link = %s(%c)\n",get_link_string(link),link));
-	switch (link)
-	{
-	case LINK_SPARSE:
-	    /* -----
-	     * If there is an extension header we'll have different work to do
-	     */
-	    if (current_header.h->gnu_89.isextended)
-	    {
-		/* -----
-		 * If we have an extended header following make sure there is room
-		 */
-		if ( (uint64_t)( offset + 2 * sizeof(tar_header) ) > hard_limit )
-		    return 0;
-		done = false;
-		gnu_sparse = true;	/* next block will be part of the header and not data */
-		data_offset = offset + 2 * sizeof(tar_header);
-	    }
-	    else
-	    {
-		done = true;
-		gnu_sparse = false;
-		data_offset = offset + sizeof(tar_header);
-	    }
-
-	    done = (bool)! current_header.h->gnu_89.isextended;
-	    {
-		int32_t ix;
-		rc_t	ret;
-
-		virtual_data_size = (uint64_t)(tar_strtoll((uint8_t*)current_header.h->gnu_89.realsize,TAR_SIZE_LEN));
-
-		for (ix = 0; ix< GNU_SPARSES_IN_OLD_HEADER; ++ix)
-		{
-		    uint64_t soffset = tar_strtoll((const uint8_t*)current_header.h->gnu_89.sparse[ix].offset,
-						  TAR_SIZE_LEN);
-		    uint64_t ssize = tar_strtoll((const uint8_t*)current_header.h->gnu_89.sparse[ix].num_bytes,
-						TAR_SIZE_LEN);
-		    if (ssize == 0)
-		    {
-			break;
-		    }
-
-		    ret = sparse_data_push (&self->sparse_q, soffset, ssize);
-		    if (ret) 
-		    {
-			sparse_data_kill(&self->sparse_q);
-			return -1;
-		    }
-		    ++self->num_chunks;
-		}
-	    }
-	    data_offset = current_offset + sizeof(tar_header);
-	    break;
-
-	case LINK_OLDNORMAL_FILE:		/* deprecated normal file */
-	    /* -----
-	     * this should only happen with LINK_OLDNORMAL_FILE
-	     *
-	     * If the type is file but the last character in the path is "/"
-	     * treat it as a directory instead
-	     */
-        {
-            size_t size;
-            if (full_path[string_measure(full_path, &size)-1] == '/')
-            {
-                link = LINK_DIRECTORY;
-            }
-        }
-	    /* fall through */
-	case LINK_NORMAL_FILE:
-	case LINK_CONTIGUOUS_FILE:
-	case LINK_DIRECTORY:
-	    data_offset = current_offset + sizeof(tar_header);
-	    done = true;
-	    break;
-
-            /* since we do not extract for tar files, a symlink and a hardlink
-             * are the same to us */
-	case LINK_HARD_LINK:
-	case LINK_SYMBOLIC_LINK:
-	    if (full_link[0] == 0)
-	    {
-            string_copy(full_link, sizeof(full_link), current_header.h->tar.linkname, TAR_NAME_LEN);
-	    }
-	    done = true;
-	    break;
-
-	    /* ----------
-	     * These types we ignore and they are defined to not have a data size
-	     */
-	case LINK_CHARACTER_SPECIAL:
-	case LINK_BLOCK_SPECIAL:
-	case LINK_FIFO:
-	case LINK_INODE_METADATA:
-	    /* -----
-	     * Nothing to be done
-	     */
-            TAR_DEBUG (("%s: ignored block link type %s(%c) @ %lu\n",
-                        __func__,
-                        get_link_string(current_header.h->tar.link),
-                        get_link_string(current_header.h->tar.link),
-                        (uint64_t)(current_offset)+(uint64_t)(OFFSET_OF(tar_v7_header,link)))); 
-            data_size = 0; /* data size is specifically to be ignored */
-	    done = true;
-	    break;
-
-	    /* ----------
-	     * These types we ignore as a final block or a block unto themselves and are
-             * not part of a series of blocks and they are defined to have a data size
-	     */
-	case LINK_PAX_GLOBAL_XHDR:
-	case LINK_GNU_DUMPDIR: /* we are just gonna ignore this and not treat it like LINK_DIRECTORY */
-	case LINK_SOLARIS_ACL_FILE:
-	case LINK_VOLUME_NAME:
-	case LINK_MULTI_VOLUME:
-            TAR_DEBUG (("%s: ignored block link type %s(%c) %lu @ %lu\n",
-                        __func__,
-                        get_link_string(current_header.h->tar.link),
-                        get_link_string(current_header.h->tar.link),
-                        data_size,
-                        (uint64_t)(current_offset)+(uint64_t)(OFFSET_OF(tar_v7_header,link)))); 
-            done = true;
-            break;
-
-	    /* ----------
-	     * These types we ignore as a block with in a series of blocks
-             * and they are defined to have a data size
-             *
-	     * Nothing to be done
-	     */
-	case LINK_SOLARIS_ACL:
-	case LINK_PAX_XHDR:	/* posix extended */
-	    /* -----
-	     */
-            TAR_DEBUG (("%s: ignored block link type %s(%c) @ %lu\n",
-                        __func__,
-                        get_link_string(current_header.h->tar.link),
-                        get_link_string(current_header.h->tar.link),
-                        (uint64_t)(current_offset)+(uint64_t)(OFFSET_OF(tar_v7_header,link)))); 
-	    break;
-
-            /* some link types we ignore this block */
-	default:
-            TAR_DEBUG (("%s: Ignoring block with link %s(%c/%02.2x) @ %lu\n",
-                        __func__, 
-                        get_link_string(current_header.h->tar.link),
-                        current_header.h->tar.link,
-                        (unsigned)(current_header.h->tar.link),
-                        (uint64_t)(current_offset)+(uint64_t)(OFFSET_OF(tar_v7_header,link))));
-	    break;
-
-	case LINK_NEXT_LONG_LINK:	/* long link name */
-	    /* -----
-	     * Long link name needs access now to its full set of data blocks, request a window shift 
-	     * if it is not currently accessible
-	     */
-	    if ( (uint64_t)( offset + sizeof( tar_header ) + data_size ) > hard_limit )
-		return 0;
-
-	    string_copy(full_link, sizeof(full_link), (char*)(current_header.b + sizeof(tar_header)), data_size);
-	    break;
-	case LINK_NEXT_LONG_NAME:	/* long path name */
-	    /* -----
-	     * Long path name needs access now to its full set of data blocks, request a window shift 
-	     * if it is not currently accessible
-	     */
-	    if ( (uint64_t)( offset + sizeof( tar_header ) + data_size ) > hard_limit )
-	    {
-		return 0;
-	    }
-
-	    string_copy(full_path, sizeof(full_path), (char*)(current_header.b + sizeof(tar_header)), data_size);
-	    break;
-	}
-	
-	/* -----
-	 * move the current header offset to past the data blocks
-	 */
-	if (link == LINK_SPARSE)
-	{
-	    current_offset += sizeof (tar_header);
-	    current_header.b += sizeof(tar_header);
-	}
-	else
-	{
-	    current_offset += sizeof (tar_header)+ ((data_size+TAR_BLOCK_SIZE-1)/TAR_BLOCK_SIZE)*TAR_BLOCK_SIZE;
-	    current_header.b += sizeof(tar_header) + ((data_size+TAR_BLOCK_SIZE-1)/TAR_BLOCK_SIZE)*TAR_BLOCK_SIZE;
-	}
-	/* -----
-	 * if that is past the currently available
-	 * quit the parse of this entry asn ask for a window shift, yeah, we'll redo work
-	 * but its far simpler code to just start over than track being in the middle
-	 */
-	if ((!done) && (current_offset >= hard_limit))
-	{
-	    return 0;
-	}
-
-    } while (! done);
-
-    /* -----
-     * generate output for this entry
-     */
-    switch (type)
-    {
-    default:
-        if ( ! silent )
-        {
-            PLOGMSG (klogErr,(klogErr,"Unhandled Header Block Type $(type):$(typeint)","type=%c,typeint=%d",type ? type : '0',type));
-        }
-	return RC (rcFS, rcArc, rcParsing, rcData, rcUnsupported);
-    case TAR_ZERO_BLOCK:
-/* 	LOGMSG (klogDebug1, "Zero Block"); */
-	/* ignored */
-	break;
-
-    case TAR_CPIO:
-    case TAR_V7:
-    case TAR_POSIX:
-	/* case TAR_PAX: */
-    case TAR_SUN:
-    case TAR_STAR_85:
-    case TAR_STAR_94:
-    case TAR_GNU_89:
-	/*case TAR_GNU_01: */
-    case TAR_SPARSE:
-	/* -----
-	 * TODO:
-	 *	implement a header checksum routine call it here, and return -1 if the check sum fails
-	 */
-	if (gnu_sparse)
-	{
-/* 	    PLOGMSG ((klogDebug3, */
-/* 		      "Need to create a file but gnu_sparse is true $(l)", */
-/* 		      PLOG_U8(l), */
-/* 		      link */
-/* 			 )); */
-	    link = LINK_SPARSE;	/* faking it for the next section */
-	}
-	switch (link)
-	{
-	case LINK_OLDNORMAL_FILE:
-	case LINK_NORMAL_FILE:
-	case LINK_CONTIGUOUS_FILE:
-/* 	    LOGMSG (klogDebug3, "KTocCreateFile"); */
-            TAR_DEBUG (("%s call KTocCreateFile '%c':%hhd\n", __func__, link, link));
-	    KTocCreateFile (self->toc,
-                            data_size?data_offset:0,
-                            data_size,
-                            mtime,
-                            mode,
-                            (KCreateMode)(kcmInit|kcmParents),
-                            full_path);
-	    /* -----
-	     * TODO:
-	     *	print something if extraneous fields found
-	     */
-	    break;
-	case LINK_HARD_LINK:
-            TAR_DEBUG (("%s call KTocCreateHardLink\n", __func__));
-	    KTocCreateHardLink (self->toc, mtime, mode,
-				   (KCreateMode)(kcmInit|kcmParents),
-				   full_link, full_path);
-	    /* -----
-	     * TODO:
-	     *	print something if extraneous fields found
-	     */
-	    break;
-	case LINK_SYMBOLIC_LINK:
-            TAR_DEBUG (("%s call KTocCreateSoftLink\n", __func__));
-	    KTocCreateSoftLink (self->toc, mtime, mode,
-				   (KCreateMode)(kcmInit|kcmParents),
-				   full_link, full_path);
-	    /* -----
-	     * TODO:
-	     *	print something if extraneous fields found
-	     */
-	    break;
-
-	case LINK_SPARSE:
-            TAR_DEBUG (("%s LINK_SPARSE current_offset %jx: data_offset %jx: data_size %jx\n",
-                        __func__, current_offset, data_offset, data_size));
-	    make_chunk_list(self, data_offset);
-	    KTocCreateChunkedFile (self->toc,
-				      virtual_data_size,
-				      mtime, mode,
-				      self->num_chunks,
-				      self->chunks,
-				      (KCreateMode)(kcmInit|kcmParents), 
-				      full_path);
-	    whack_chunk_list (self);
-	    break;
-	case LINK_CHARACTER_SPECIAL:
-	case LINK_BLOCK_SPECIAL:
-	case LINK_FIFO:
-	case LINK_VOLUME_NAME:
-	case LINK_SOLARIS_ACL:
-        case LINK_GNU_DUMPDIR:
-	case LINK_SUN_XHDR:
-	case LINK_INODE_METADATA:
-            TAR_DEBUG ( ( "%s ignored entry type %s linktype name  %s\n",
-                        __func__, get_link_string( link ), full_path ) );
-	    /* ignore */
-	    break;
-	case LINK_DIRECTORY:
-            TAR_DEBUG (("%s call KTocCreateDir\n", __func__));
-	    KTocCreateDir (self->toc, mtime, mode, (KCreateMode)(kcmOpen|kcmParents), full_path);
-	    /* -----
-	     * TODO:
-	     *	print something if extraneous fields found?
-	     */
-	    break;
-	default:
-	    PLOGMSG(klogErr,(klogErr,
-		     " type ($(type)) name ($(name() link ($(link)) size ($(size)) offset ($(offset))",
-		     "type=%s,name=%s,link=%s,size=%lld,offset=%lld",
-		     get_type_string(type),
-		     full_path,
-		     full_link,
-		     data_size,
-		     data_offset));
-	    break;
-	}
-	break;
-    }
-    return current_offset - offset;
-}
-
-
-static
-rc_t KArcParseTAR_intern ( KToc * self, 
-                           const void * kvoid,
-                           bool silent )
-{
-    KTarState state;
-    /* -----
-     * offset is the running index into the file of where the first tar header
-     *          for the next element should start
-     */
-    uint64_t offset;
-    /* -----
-     * used is the count of bytes used for headers, storage and padding of the last
-     *          examined element
-     */
-    uint64_t used;
-    uint64_t filesize;
-    const KFile * kfile = kvoid;
-    rc_t rc;
-
-    FUNC_ENTRY();
-
-    /* -----
-     * save the KFS File and TOC references
-     */
-
-    if ( kfile == NULL )
-    {
-        if ( !silent )
-            LOGMSG ( klogFatal, "Called with a bad KFile parameter" );
-        return RC (rcFS, rcArc, rcParsing, rcParam, rcNull );
-    }
-    else if ( self == NULL )
-    {
-        if ( !silent )
-            LOGMSG (klogFatal, "Called with a bad KToc parameter");
-        return RC (rcFS, rcArc, rcParsing, rcSelf, rcNull );
-    }
-
-    memset (&state, 0, sizeof (state));
-    state.kfile = kfile;
-    state.toc = self;
-
-    if ( ( rc = KFileSize ( state.kfile, &filesize ) ) != 0 )
-    {
-        if ( !silent )
-            LOGERR ( klogFatal, rc, "Failed to get file size of tarfile" );
-    }
-    else if ( filesize == 0 )
-    {
-        rc = RC ( rcFS, rcArc, rcAccessing, rcArc, rcEmpty );
-        if ( !silent )
-            LOGERR( klogFatal, rc, "Empty file" );
-    }
-    else if ( ( rc = map_tar_file ( &state, 0 ) ) != 0 )
-    {
-        if ( !silent )
-            PLOGMSG( klogFatal, 
-                    ( klogFatal, "Failed to $(operation) of size $(size)",
-                      "operation=%s,size=%lu", "mmap", filesize ) );
-        return rc;
-    }
-    else
-    {
-        int stalled = 0;
-
-        for ( offset = 0; offset < filesize; )
-        {
-            /* -----
-             * evaluate the tar file header at the current offset into the file
-             *
-             * the return is a positive number of bytes used
-             * OR a negative on a file parse error
-             * OR zero for a file that would exceed the current window
-             */
-            used = process_one_entry ( &state, offset, state.buffer_limit, silent );
-
-            if ( used == 0 )
-                stalled ++;
-            else
-                stalled = 0;
-
-            /* kill any left over sparse data - safely handles an empty queue */
-            sparse_data_kill ( &state.sparse_q );
-
-            if ( state.found_second_zero_block )
-            {
-                break;
-            }
-            if ( used > 0 )
-            {
-                offset += used;
-            }
-            else if ( used == 0 )   /* if the validate returns 0 we need more buffer */
-            {
-                if ( stalled == 5 ) /* sure why not 5 tries */
-                {
-                    rc = RC ( rcFS, rcArc, rcParsing, rcArc, rcIncomplete );
-                    break;
-                }
-                map_tar_file ( &state, offset ); /* slide the window up to current location */
-                /* -----
-                 * TODO:
-                 *	Handle a repeated call from the same location as a failure in file format
-                 * (truncation) of the tar file
-                 */
-            }
-            else /*if (used < 0)*/		/* if it is negative it means abort the tar file */
-            {
-                rc = RC ( rcFS, rcArc, rcParsing, rcArc, rcUnexpected );
-                break;
-            }
-        }
-        if ( offset > filesize )
-        {
-            rc = RC ( rcFS, rcArc, rcParsing, rcToc, rcIncomplete );
-            TAR_DEBUG (( "%s %R File offset %ju exceeds filesize %ju\n",
-                         __func__, rc, offset, filesize ));
-        }
-        release_map ( &state );
-    }
-    return rc;
-}
-
-/* ======================================================================
- * validating a tar file is listing the files, links and directories
- * in that archive.
- *
- * partial results are not to be accepted in the end but it is the responsibility
- * of the caller to clear them.
- *
- * returns 0 for good archive and -1 for bad archive
- */
-LIB_EXPORT rc_t CC KArcParseTAR ( KToc * self, 
-              const void * kvoid,
-              bool ( CC * ignored )( const KDirectory *, const char *, void * ),
-              void *also_ignored )
-{
-    return KArcParseTAR_intern ( self, kvoid, false );
-}
-
-
-LIB_EXPORT rc_t CC KArcParseTAR_silent ( KToc * self, 
-              const void * kvoid,
-              bool ( CC * ignored )( const KDirectory *, const char *, void * ),
-              void *also_ignored )
-{
-    return KArcParseTAR_intern ( self, kvoid, true );
-}
-
-
-LIB_EXPORT int CC KDirectoryVOpenTarArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, va_list args )
-{
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead ( self, tar_dir, false, path, tocKFile,
-                                      KArcParseTAR, NULL, NULL );
-}
-
-LIB_EXPORT int CC KDirectoryVOpenTarArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, va_list args )
-{
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead_silent ( self, tar_dir, false, path, tocKFile,
-                                      KArcParseTAR_silent, NULL, NULL );
-}
-
-
-LIB_EXPORT int CC KDirectoryVOpenTarArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const struct KFile * f, const char *path, va_list args )
-{
-    /* putting off parameter validation into this call */
-    return KDirectoryOpenArcDirRead_silent_preopened ( self, tar_dir, false, path, tocKFile, 
-                                      (void*)f, KArcParseTAR_silent, NULL, NULL );
-}
-
-
-LIB_EXPORT int CC KDirectoryOpenTarArchiveRead ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenTarArchiveRead ( self, tar_dir, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT int CC KDirectoryOpenTarArchiveRead_silent ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenTarArchiveRead_silent ( self, tar_dir, chroot, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT int CC KDirectoryOpenTarArchiveRead_silent_preopened ( struct KDirectory const *self,
-    struct KDirectory const **tar_dir, int chroot, const KFile * f, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDirectoryVOpenTarArchiveRead_silent_preopened ( self, tar_dir, chroot, f, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ----------
- * Validate that the compiler packed all the character arrays into the correct sizes
- * to use the header.
- *
- * a bunch of magic numbers are in the function because we are making sure that
- * they are reached by using the structure members.  They are listed in comments
- * within comments in the tar_header.h file.
- *
- * No return value
- */
-LIB_EXPORT bool CC validate_header_offsets( void )
-{
-    bool pass_fail = true; /* assume pass */
-#if _DEBUGGING
-    /* -----
-     * checking the size entails making sure the compiler made the structure
-     * the right length to match the series of octents in the file
-     */
-#define	check_size(T,V)     if( sizeof(T) != (size_t)V) { pass_fail = false; printf ("*** BAD_SIZE: %s is %u not %u\n", #T, (unsigned)sizeof(T), (unsigned)V);}
-    /* -----
-     * checking the offset entails making sure the compiler put the field at the
-     * right absolute location within a structure
-     */
-#define	check_offset(T,M,V) if( OFFSET_OF(T,M) != (size_t)V ) { pass_fail = false; printf ("*** BAD_OFFSET: %s.%s is %u not %d\n", #T, #M, (unsigned)OFFSET_OF(T,M), V);}
-
-    check_size(tar_raw_block,512);
-    check_size(tar_v7_header,257);
-    check_size(tar_posix_header,500);
-    check_size(tar_sun_header,512);
-    check_size(tar_star_85_header,512);
-    check_size(tar_star_94_header,512);
-    check_size(tar_gnu_89_header,495);
-    /*check_size(tar_new_gnu_header,512); */
-    check_size(tar_sparse_header,505);
-  
-
-    /* tar_header union */
-    check_offset(tar_header,raw,0);
-    check_offset(tar_header,tar,0);
-    check_offset(tar_header,posix,0);
-    check_offset(tar_header,suntar,0);
-    check_offset(tar_header,star_85,0);
-    check_offset(tar_header,star_94,0);
-    check_offset(tar_header,gnu_89,0);
-    /*check_offset(tar_header,new_gnu,0); */
-    check_offset(tar_header,sparse,0);
-
-    /* tar_v7_header */
-    check_offset(tar_v7_header,name,0);
-    check_offset(tar_v7_header,mode,100);
-    check_offset(tar_v7_header,uid,108);
-    check_offset(tar_v7_header,gid,116);
-    check_offset(tar_v7_header,size,124);
-    check_offset(tar_v7_header,mtime,136);
-    check_offset(tar_v7_header,csum,148);
-    check_offset(tar_v7_header,link,156);
-    check_offset(tar_v7_header,linkname,157);
-
-    /* tar_posix_header */
-    check_offset(tar_posix_header,name,0);
-    check_offset(tar_posix_header,mode,100);
-    check_offset(tar_posix_header,uid,108);
-    check_offset(tar_posix_header,gid,116);
-    check_offset(tar_posix_header,size,124);
-    check_offset(tar_posix_header,mtime,136);
-    check_offset(tar_posix_header,csum,148);
-    check_offset(tar_posix_header,link,156);
-    check_offset(tar_posix_header,linkname,157);
-    check_offset(tar_posix_header,magic,257);
-    check_offset(tar_posix_header,version,263);
-    check_offset(tar_posix_header,uname,265);
-    check_offset(tar_posix_header,gname,297);
-    check_offset(tar_posix_header,devmajor,329);
-    check_offset(tar_posix_header,devminor,337);
-    check_offset(tar_posix_header,prefix,345);
-
-    /* tar_sun_header */
-    check_offset(tar_sun_header,name,0);
-    check_offset(tar_sun_header,mode,100);
-    check_offset(tar_sun_header,uid,108);
-    check_offset(tar_sun_header,gid,116);
-    check_offset(tar_sun_header,size,124);
-    check_offset(tar_sun_header,mtime,136);
-    check_offset(tar_sun_header,csum,148);
-    check_offset(tar_sun_header,link,156);
-    check_offset(tar_sun_header,linkname,157);
-    check_offset(tar_sun_header,magic,257);
-    check_offset(tar_sun_header,version,263);
-    check_offset(tar_sun_header,uname,265);
-    check_offset(tar_sun_header,gname,297);
-    check_offset(tar_sun_header,devmajor,329);
-    check_offset(tar_sun_header,devminor,337);
-    check_offset(tar_sun_header,prefix,345);
-    check_offset(tar_sun_header,extnum,500);
-    check_offset(tar_sun_header,extcount,501);
-    check_offset(tar_sun_header,fullsize,502);
-
-    /* tar_star_85_header */
-    check_offset(tar_star_85_header,name,0);
-    check_offset(tar_star_85_header,mode,100);
-    check_offset(tar_star_85_header,uid,108);
-    check_offset(tar_star_85_header,gid,116);
-    check_offset(tar_star_85_header,size,124);
-    check_offset(tar_star_85_header,mtime,136);
-    check_offset(tar_star_85_header,csum,148);
-    check_offset(tar_star_85_header,link,156);
-    check_offset(tar_star_85_header,linkname,157);
-    check_offset(tar_star_85_header,starversion,257);
-    check_offset(tar_star_85_header,starfiletype,258);
-    check_offset(tar_star_85_header,startype,266);
-    check_offset(tar_star_85_header,rdev,278);
-    check_offset(tar_star_85_header,atime,290);
-    check_offset(tar_star_85_header,ctime,302);
-    check_offset(tar_star_85_header,uname,314);
-    check_offset(tar_star_85_header,gname,330);
-    check_offset(tar_star_85_header,prefix,345);
-    check_offset(tar_star_85_header,xmagic,508);
-
-    /* tar_star_94_header */
-    check_offset(tar_star_94_header,name,0);
-    check_offset(tar_star_94_header,mode,100);
-    check_offset(tar_star_94_header,uid,108);
-    check_offset(tar_star_94_header,gid,116);
-    check_offset(tar_star_94_header,size,124);
-    check_offset(tar_star_94_header,mtime,136);
-    check_offset(tar_star_94_header,csum,148);
-    check_offset(tar_star_94_header,link,156);
-    check_offset(tar_star_94_header,linkname,157);
-    check_offset(tar_star_94_header,magic,257);
-    check_offset(tar_star_94_header,version,263);
-    check_offset(tar_star_94_header,uname,265);
-    check_offset(tar_star_94_header,gname,297);
-    check_offset(tar_star_94_header,devmajor,329);
-    check_offset(tar_star_94_header,devminor,337);
-    check_offset(tar_star_94_header,prefix,345);
-    check_offset(tar_star_94_header,isextended,355);
-    check_offset(tar_star_94_header,sparse,356);
-    check_offset(tar_star_94_header,realsize,452);
-    check_offset(tar_star_94_header,offset,464);
-    check_offset(tar_star_94_header,atime,476);
-    check_offset(tar_star_94_header,ctime,488);
-    check_offset(tar_star_94_header,xmagic,508);
-
-    /* tar_gnu_89_header */
-    check_offset(tar_gnu_89_header,name,0);
-    check_offset(tar_gnu_89_header,mode,100);
-    check_offset(tar_gnu_89_header,uid,108);
-    check_offset(tar_gnu_89_header,gid,116);
-    check_offset(tar_gnu_89_header,size,124);
-    check_offset(tar_gnu_89_header,mtime,136);
-    check_offset(tar_gnu_89_header,csum,148);
-    check_offset(tar_gnu_89_header,link,156);
-    check_offset(tar_gnu_89_header,linkname,157);
-    check_offset(tar_gnu_89_header,magic,257);
-    check_offset(tar_gnu_89_header,uname,265);
-    check_offset(tar_gnu_89_header,gname,297);
-    check_offset(tar_gnu_89_header,atime,345);
-    check_offset(tar_gnu_89_header,ctime,357);
-    check_offset(tar_gnu_89_header,offset,369);
-    check_offset(tar_gnu_89_header,longnames,381);
-    check_offset(tar_gnu_89_header,sparse,386);
-    check_offset(tar_gnu_89_header,isextended,482);
-
-    /* tar_extended_header */
-    check_offset(tar_sparse_header,sparse,0);
-    check_offset(tar_sparse_header,isextended,504);
-#endif
-    return pass_fail;
-}
-
-/* end of file */
diff --git a/libs/kfs/teefile.c b/libs/kfs/teefile.c
deleted file mode 100644
index 17f9d2a..0000000
--- a/libs/kfs/teefile.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-/* #include <klib/container.h> */
-/* #include <klib/vector.h> */
-/* #include <klib/pbstree.h> */
-/* #include <klib/text.h> */
-/* #include <kfs/file.h> */
-/* #include <assert.h> */
-/* #include <limits.h> */
-/* #include <stdio.h> */
-/* #include <stdlib.h> */
-/* #include <string.h> */
-
-/* #include <klib/container.h> */
-/* #include <klib/vector.h> */
-/* #include <klib/pbstree.h> */
-/* #include <klib/text.h> */
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/teefile.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-/* #include <limits.h> */
-/* #include <stdio.h> */
-#include <stdlib.h>
-/* #include <string.h> */
-
-/* ======================================================================
- * KTeeFile
- *  a file inside an archive
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-#define KFILE_IMPL struct KTeeFile
-#include <kfs/impl.h>
-
-static rc_t CC KTeeFileDestroy (KTeeFile *self);
-static struct KSysFile *CC KTeeFileGetSysFile (const KTeeFile *self,
-					    uint64_t *offset);
-static rc_t CC KTeeFileRandomAccessRead (const KTeeFile *self);
-static rc_t CC KTeeFileRandomAccessUpdate (const KTeeFile *self);
-static uint32_t CC KTeeFileType (const KTeeFile *self);
-static rc_t CC KTeeFileSize (const KTeeFile *self, uint64_t *size);
-static rc_t CC KTeeFileSetSizeRead (KTeeFile *self, uint64_t size);
-static rc_t CC KTeeFileSetSizeUpdate (KTeeFile *self, uint64_t size);
-static rc_t CC KTeeFileRead (const KTeeFile *self, uint64_t pos,
-			  void *buffer, size_t bsize, size_t *num_read);
-static rc_t CC KTeeFileWriteRead (KTeeFile *self, uint64_t pos, const void *buffer,
-			       size_t size, size_t *num_writ);
-static rc_t CC KTeeFileWriteUpdate (KTeeFile *self, uint64_t pos, const void *buffer,
-				 size_t size, size_t *num_writ);
-
-
-static const KFile_vt_v1 vtKTeeFileRead =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KTeeFileDestroy,
-    KTeeFileGetSysFile,
-    KTeeFileRandomAccessRead,
-    KTeeFileSize,
-    KTeeFileSetSizeRead,
-    KTeeFileRead,
-    KTeeFileWriteRead,
-
-    /* 1.1 */
-    KTeeFileType
-};
-static const KFile_vt_v1 vtKTeeFileUpdate =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KTeeFileDestroy,
-    KTeeFileGetSysFile,
-    KTeeFileRandomAccessUpdate,
-    KTeeFileSize,
-    KTeeFileSetSizeUpdate,
-    KTeeFileRead,
-    KTeeFileWriteUpdate,
-
-    /* 1.1 */
-    KTeeFileType
-};
-
-
-/*-----------------------------------------------------------------------
- * KTeeFile
- *  an archive file including tar and sra
- */
-struct KTeeFile
-{
-    KFile	dad;
-    uint64_t	maxposition;
-    KFile *	original;
-    KFile *	copy;
-};
-
-static
-rc_t KTeeFileSeek (const KTeeFile *cself, uint64_t pos)
-{
-    KTeeFile * self;
-    rc_t rc = 0;
-    size_t num_read;
-    uint8_t buff [ 32 * 1024 ];
-
-    self = (KTeeFile *)cself;
-    /* seek to "pos" */
-    while (self->maxposition < pos)
-    {
-        /* maximum to read in this buffer */
-        size_t to_read = sizeof buff;
-        if (self->maxposition + sizeof buff > pos )
-            to_read = (size_t) (pos - self->maxposition);
-
-        /* read bytes */
-        rc = KFileRead (&self->dad, self->maxposition, buff, to_read, &num_read );
-        if ( rc != 0 )
-            break;
-
-        /* detect EOF */
-        if (num_read == 0)
-        {
-            break;
-        }
-    }
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KTeeFileMake
- *  create a new file object
- */
-
-static
-rc_t KTeeFileMake (KTeeFile ** self,
-		   KFile * original,
-		   KFile * copy,
-		   const KFile_vt * vt,
-		   bool read_enabled,
-		   bool write_enabled)
-{
-    rc_t	rc;
-    KTeeFile *	pF;
-
-    /* -----
-     * we can not accept any of the three pointer parameters as NULL
-     */
-    assert (self != NULL);
-    assert (original != NULL);
-    assert (copy != NULL);
-
-    /* -----
-     * the enables should be true or false
-     */
-    assert ((read_enabled == true)||(read_enabled == false));
-    assert ((write_enabled == true)||(write_enabled == false));
-
-    /* -----
-     * get space for the object
-     */
-    pF = malloc (sizeof (KTeeFile));
-    if (pF == NULL)	/* allocation failed */
-    {
-	/* fail */
-	rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    }
-    else
-    {
-	rc = KFileInit (&pF->dad,			/* initialize base class */
-			vt,			 	/* VTable for KTeeFile */
-            "KTeeFile", "no-name",
-			read_enabled,			/* read allowed */
-			write_enabled);			/* write disallowed */
-	if (rc == 0)
-	{
-/* take over the existing KFile Reference for original and copy*/
-	    /* succeed */
-	    pF->original = original;
-	    pF->copy = copy;
-	    pF->maxposition = 0;
-	    *self = pF;
-	    return 0;
-	}
-	/* fail */
-	free (pF);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KFileMakeTeeRead (const KFile ** self, const KFile * original, KFile * copy)
-{
-    return KTeeFileMake ((KTeeFile **)self, (KFile*)original, copy,
-			 (const KFile_vt*)&vtKTeeFileRead, true, false);
-}
-
-LIB_EXPORT rc_t CC KFileMakeTeeUpdate (KFile ** self, KFile * original, KFile * copy)
-{
-    return KTeeFileMake ((KTeeFile **)self, original, copy,
-			 (const KFile_vt*)&vtKTeeFileUpdate, true, true);
-}
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KTeeFileDestroy (KTeeFile *self)
-{
-    rc_t rc;
-    uint64_t last_max;
-
-    assert (self != NULL);
-
-    do
-    {
-        last_max = self->maxposition;
-
-        /* keep seeking ahead by a Gigabyte until we read no more */
-	rc = KTeeFileSeek (self, last_max + 1024*1024*1024);
-	if (rc != 0)
-	    return rc;
-
-    } while (last_max < self->maxposition);
-
-    rc = KFileRelease (self->original);
-    if ( rc == 0 )
-    {
-        KFileRelease (self->copy);
-        free (self);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We cant allow memory mapping a tee file as the read?writes ar needed
- * to trigger the writes to the copy KFile
- */
-
-static
-struct KSysFile *CC KTeeFileGetSysFile (const KTeeFile *self, uint64_t *offset)
-{
-    /* parameters must be non-NULL */
-    assert (self != NULL);
-    assert (offset != NULL);
-
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- *
- * Update needs to be able to seek both original and copy while read
- * only needs to be able to seek the original.
- */
-static
-rc_t CC KTeeFileRandomAccessUpdate (const KTeeFile *self)
-{
-    rc_t rc;
-    assert (self != NULL);
-    rc = KFileRandomAccess (self->original);
-    if (rc == 0)
-	rc = KFileRandomAccess (self->copy);
-    return rc;
-}
-static
-rc_t CC KTeeFileRandomAccessRead (const KTeeFile *self)
-{
-    rc_t rc;
-    assert (self != NULL);
-    rc = KFileRandomAccess (self->original);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KTeeFileType (const KTeeFile *self)
-{
-    return KFileType (self->original);
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KTeeFileSize (const KTeeFile *self, uint64_t *size)
-{
-    rc_t	rc;
-    uint64_t	fsize;
-
-    assert (self != NULL);
-    assert (size != NULL);
-
-    rc = KFileSize (self->original, &fsize);
-
-    if (rc == 0)
-    {
-	/* success */
-	*size = fsize;
-    }
-    /* pass along RC value */
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KTeeFileSetSizeUpdate (KTeeFile *self, uint64_t size)
-{
-    rc_t rc;
-
-    rc = KFileSetSize (self->original, size);
-    if (rc == 0)
-	rc = KFileSetSize (self->copy, size);
-    return rc;
-}
-static
-rc_t CC KTeeFileSetSizeRead (KTeeFile *self, uint64_t size)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KTeeFileRead	(const KTeeFile *cself,
-			 uint64_t pos,
-			 void *buffer,
-			 size_t bsize,
-			 size_t *num_read)
-{
-    KTeeFile * 	self;
-    uint64_t	maxposition;
-    size_t	read;
-    size_t	written;
-    size_t	sofar;
-    rc_t	rc;
-
-
-    /* -----
-     * self and buffer were validated as not NULL before calling here
-     *
-     * So get the KTTOCNode type: chunked files and contiguous files 
-     * are read differently.
-     */
-    assert (cself != NULL);
-    assert (buffer != NULL);
-    assert (num_read != NULL);
-    assert (bsize != 0);
-
-    rc = 0;
-    read = 0;
-    self = (KTeeFile*)cself;
-    maxposition = self->maxposition;
-    if (pos > maxposition)
-	rc = KTeeFileSeek (self, pos);
-    if (rc == 0)
-    {
-	rc = KFileRead (self->original, pos, buffer, bsize, &read);
-	if (rc == 0)
-	{
-	    if (pos + read > maxposition)
-	    {
-		for ( sofar = (size_t)( maxposition - pos );
-			  sofar < read;
-		      sofar += written)
-		{
-		    rc = KFileWrite (self->copy, pos + sofar, (uint8_t*)buffer + sofar,
-				     read - sofar, &written);
-		    if (rc != 0)
-			break;
-		    if (written == 0)
-		    {
-			LOGERR (klogErr, rc, "Failure to write to copy in KTeeFileRead");
-			rc = RC (rcFS, rcFile, rcReading, rcFile, rcIncomplete);
-		    break;
-		    }
-		}
-		maxposition = pos + sofar;
-		if (maxposition > self->maxposition)
-		    self->maxposition = maxposition;
-	    }
-	}
-    }
-    *num_read = read;
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KTeeFileWriteUpdate (KTeeFile *self, uint64_t pos,
-		       const void *buffer, size_t bsize,
-		       size_t *num_writ)
-{
-    uint64_t	max_position;
-    size_t	writ;
-    size_t	written;
-    size_t	sofar;
-    rc_t	rc;
-
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_writ != NULL);
-    assert (bsize != 0);
-
-    writ = 0;
-    rc = 0;
-    if (pos > self->maxposition)
-	rc = KTeeFileSeek (self, pos);
-    if (rc == 0)
-    {
-	rc = KFileWrite (self->original, pos, buffer, bsize, &writ);
-	if (rc == 0)
-	{
-	    for ( sofar = written = 0; sofar < writ; sofar += written)
-	    {
-		rc = KFileWrite (self->copy, pos + sofar, (uint8_t*)buffer + sofar,
-			     writ - sofar, &written);
-		if (rc != 0)
-		    break;
-		if (written == 0)
-		{
-		    rc = RC (rcFS, rcFile, rcReading, rcFile, rcIncomplete);
-		    LOGERR (klogErr, rc, "Failure to write to copy in KTeeFileWrite");
-		    break;
-		}
-	    }
-	    max_position = pos + sofar;
-	    if (max_position > self->maxposition)
-		self->maxposition = max_position;
-	}
-    }
-    *num_writ = writ;
-    return rc;
-}
-static
-rc_t CC KTeeFileWriteRead (KTeeFile *self, uint64_t pos,
-			   const void *buffer, size_t bsize,
-			   size_t *num_writ)
-{
-    assert (self != NULL);
-    assert (buffer != NULL);
-    assert (num_writ != NULL);
-    assert (bsize != 0);
-
-    *num_writ = 0;
-    return RC (rcFS, rcFile, rcWriting, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * 
- */
-
-
-/* end of file teefile.c */
-
diff --git a/libs/kfs/toc-priv.h b/libs/kfs/toc-priv.h
deleted file mode 100644
index c37ca9c..0000000
--- a/libs/kfs/toc-priv.h
+++ /dev/null
@@ -1,841 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_toc_priv_h_
-#define _h_kfs_toc_priv_h_
-
-#include <klib/container.h>
-#include <klib/text.h>
-#include <kfs/arc.h>
-#include <kfs/toc.h>
-#include <atomic.h>
-
-#ifdef _DEBUGGING
-#define TOC_FUNC_ENTRY() DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TOCENTRY), ("Enter: %s\n", __func__))
-#define TOC_SORT(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_SRASORT), msg)
-#define TOC_DEBUG(msg) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TOC), msg)
-#else
-#define TOC_FUNC_ENTRY()
-#define TOC_SORT(msg)
-#define TOC_DEBUG(msg)
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * KTocEntry
- */
-typedef struct KTocEntry KTocEntry;
-typedef enum KTocEntryType
-{
-    ktocentrytype_unknown = -1,
-    ktocentrytype_notfound,
-    ktocentrytype_dir,
-    ktocentrytype_file,
-    ktocentrytype_chunked,
-    ktocentrytype_softlink,
-    ktocentrytype_hardlink,
-    ktocentrytype_emptyfile,
-    ktocentrytype_zombiefile /* zombie in the sense that it is somewhere between live and dead */
-} KTocEntryType;
-
-/* arbitrary number that was originially set much much higher than expected needs. */
-#define	KARC_LINK_RESOLVE_LOOPMAX		(16)
-
-typedef struct KTocPageChunk
-{
-    uint64_t file_offset;
-    uint32_t page_id;
-    uint32_t page_offset;
-} KTocPageChunk;
-
-
-
-struct KTocEntry
-{
-    /* -----
-     * In C putting this first allows a weak form of polymorphism for
-     * a entry class.  A pointer to a BSTNode can be an alias to a pointer to 
-     * this form of node.
-     */
-    BSTNode		node;
-
-    /* -----
-     * The name of the directory/file/link that this Entry represents.  It is not
-     * the full path which must be assembled going up the tree.
-     *
-     * Be careful what String functions you try as some want to reallocate memory.
-     */
-    String		name;
-
-    /* -----
-     * Unix style file modification time (same as a 64-bit time_t)
-     */
-    KTime_t		mtime;
-
-    /* -----
-     * Unix style file access
-     */
-    uint32_t		access;
-
-    /* -----
-     * what type of entry is this?
-     */
-    KTocEntryType	type;
-
-    union KTocEntryUnion
-    {
-	struct KTocEntryDir
-	{
-	    /* -----
-	     * Tree of directories, files and links below this directory
-	     */
-            BSTree      tree;
-	} dir;
-	struct KTocEntryFile
-	{
-	    /*
-	     * how long is this file?
-	     */
-	    uint64_t	file_size;
-	    /* 
-	     * location within the archive where this file's data starts
-	     */
-	    uint64_t	archive_offset;
-	} contiguous_file;
-	struct KTocEntryZombieFile
-	{
-/* KEEP the first two fields here match the first two fields above
- * file_size and archive_offset so the chunked is sort of a derived type */
-	    /*
-	     * how long is this file supposed to be?
-	     */
-	    uint64_t	file_size;
-	    /* 
-	     * location within the archive where this file's data would have started
-	     */
-	    uint64_t	archive_offset;
-	} zombie_file;
-	struct KTocEntryChunkFile
-	{
-/* KEEP the first two fields here match the first two fields above
- * file_size and archive_offset so the chunked is sort of a derived type */
-	    /*
-	     * Size of the whole file including all chunks and any zero byte holes
-	     * between chunks
-	     */
-	    uint64_t	file_size;
-	    /* 
-	     * location within the archive where this file's data starts if viewws
-	     * as a virtual "*.sra"
-	     */
-	    uint64_t	archive_offset;
-
-	    KTocChunk *	chunks;			/* this will piggy back in the same allocation */
-	    uint32_t	num_chunks;	    
-	} chunked_file;
-        struct KTocEntryPagedChunkFile
-        {
-            uint64_t file_size;
-        } paged_chunk_file;
-	struct KTocEntrySoftLink
-	{
-	    String	link_path;
-	} symbolic_link;
-	struct KTocEntryHardLink
-	{
-	    const struct KTocEntry * ref;
-	    /* -----
-	     * This approach can lead to failures if the target of the link is deleted and this
-	     * reference is left dangling.
-	     */
-	} hard_link;
-    } u;
-};
-
-typedef struct KTocEntryIndex KTocEntryIndex;
-struct KTocEntryIndex
-{
-    BSTNode	node;
-    KTocEntry *	entry;
-    String	fullpath;
-};
-
-
-/* ----------------------------------------------------------------------
- * KTocEntryParam
- *
- * An internal structure used only with in this compilation unit / module
- */
-/* ----------------------------------------------------------------------
- * NOTE: This oddness of specific to general to specific can probably be 
- * refactored into specific functions (the published API) that uses common
- * functions instead of a common target function.
- */
-typedef struct KTocEntryParam	KTocEntryParam;
-struct KTocEntryParam
-{
-    KTocEntryType	type;
-    KTime_t		mtime;
-    uint32_t		access;
-    union
-    {
-	struct
-	{
-	    uint64_t		size;
-	    uint64_t		source_position;
-	} file;
-	struct
-	{
-	    uint64_t		size;
-	    uint32_t		num_chunks;
-	    const KTocChunk *	chunks;
-	} chunked;
-	struct
-	{
-            const KTocEntry *   ref;
-	} hardlink;
-	struct
-	{
-	    const char *	targ;
-	} softlink;
-    } u;
-};
-
-/* ----------------------------------------------------------------------
- * KArcTOCNodeWhack
- * [IN] BSTNode * 		n	
- * [IN] void *    		data	
- *
- * This function matches the signature for a function pointer in a 
- * call to BSTreeWhack().  It ignores the data pointer second parameter
- * which can safely be called with NULL. 
- */
-void	CC KTocEntryWhack	(BSTNode * n, void * data);
-int	CC KTocEntryCmpVoid (const void * item, const BSTNode * node);
-rc_t	KTocEntryDelete	(KTocEntry * self);
-int	CC KTocEntryCmp2 (const BSTNode * n, const BSTNode * p);
-rc_t	KTocEntryNewDirectory	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access);
-rc_t		KTocEntryNewFile	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 uint64_t offset,
-					 uint64_t size);
-rc_t		KTocEntryNewChunked	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 uint64_t size,
-					 const KTocChunk * chunks,
-					 uint32_t num_chunks);
-rc_t		KTocEntryNewSoft	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 const char * link,
-					 size_t link_size);
-rc_t		KTocEntryNewHard	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-                                         const KTocEntry * targ);
-rc_t		KTocEntryNewZombieFile	(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 uint64_t offset,
-					 uint64_t size);
-
-
-typedef struct	KTocEntryStack 	KTocEntryStack;
-rc_t KTocEntryStackNew(KTocEntryStack ** self);
-rc_t KTocEntryStackDel(KTocEntryStack * self);
-rc_t KTocEntryStackDepth(KTocEntryStack * self, int * depth);
-rc_t KTocEntryStackPush(KTocEntryStack * self, KTocEntry * pathaddr);
-rc_t KTocEntryStackPop(KTocEntryStack * self, KTocEntry ** pathaddr);
-
-const char * KTocEntryTypeGetString(KTocEntryType t);
-const char * get_mode_string (KCreateMode mode);
-
-typedef struct KTocEntryPersistWriteFuncData
-{
-    uint8_t *	buffptr;
-    uint8_t *	limit;
-} KTocEntryPersistWriteFuncData;
-KFS_EXTERN rc_t CC KTocEntryPersistWriteFunc (void * param, const void * buffer, size_t size,
-				size_t * num_writ);
-
-rc_t KTocEntryPersistNodeDir (void *param, const KTocEntry * n,
-			      size_t * num_writ, 
-			      PTWriteFunc write, void * write_param);
-
-/* ======================================================================
- * KToc struct
- */
-struct KArcDir;
-
-struct KToc
-{
-    KArcFSType	arctype;
-    KSRAFileAlignment alignment;
-    /* -----
-     * File containing the archive: details of its type hidden behind KFile.
-     * We should be able to do an archive in an archive by having this KFile
-     * point to a KArcFile with no problems.
-     */
-    union
-    {
-	const void *		v;
-	struct KFile const *f;
-	const KDirectory * 	d;
-    } archive;
-
-    /* -----
-     * KArcDir that implements the KDirectory interface for the contents of 
-     * the file opened as archive.  This link is needed to get to the 
-     * KDirectory interface from a KFile symbolic link.
-     *
-     * This reference is not counted in refcount as it is a link back to the
-     * tracked reference from the KArcDir to the KARcTOC.
-     */
-/*     const struct KArcDir *	karchive; */
-
-    /* -----
-     * count of references to this opened archive
-     */
-    atomic32_t		refcount;
-
-    /* -----
-     * A entry outside of a tree: instantiated as a special KTocEntry that is part of
-     * no BSTree with type set to ktocentrytype_dir (directory).
-     * Does not use the base dir BSTNode but makes processing easier to have a 
-     *"entry" type...
-     */
-    KTocEntry		entry;
-
-    /* -----
-     * These next two are used only in the KFile interface on top of a KToc
-     * on a KDirectory.  This needs to be rewritten as an interface so these
-     * don't exist in all KToc implmentations.
-     *
-     * Index  The main tree in 'entry' is sorted by names with in directories.
-     * This index is a directory less tree sorted by offset with in the archive.
-     *
-     * This is not currently used in tar file versions of the TOC archive.
-     *
-     * Each entry is of type KTocEntryIndex;
-     */
-    BSTree		offset_index;
-    KSraHeader *	header;
-
-
-    /* -----
-     * This is the full path of the archive file as used to open it as a KFile.
-     */
-    String		path;
-
-};
-
-/* four fields are common to all entries.*/
-
-
-/* GetName
- *
- *  [RET] rc_t                  0 for success; anything else for a failure
- *                       see itf/klib/rc.h for general details
- *  [IN]     const KTocEntry *  self        object oriented object reference
- *  [OUT] const char **         name        where to put a reference to the name
- */
-rc_t KTocEntryGetName(const KTocEntry *self,
-                     const char ** name);
-
-/* GetTime
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] KTime_t *      mtime       where to put unix/posix style permission flags
- */
-rc_t KTocEntryGetTime(const KTocEntry *self,
-                     KTime_t *mtime);
-
-/* GetAccess
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                             see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint32_t       access      where to put unix/posix style permission flags
- */
-rc_t KTocEntryGetAccess(const KTocEntry * self, uint32_t * access);
-
-
-/* GetType
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] KTocEntryType *    type        where to put the type specific node type (differs
- *                      from KDirectory type)
- */
-rc_t KTocEntryGetType(const KTocEntry *self,
-                     KTocEntryType * type);
-/* the type retrieved by GetType will permit several more fields specialized by type */
-/* for a directory the only specialzied field is the "BSTree" */
-
-#if 0
-const char * KTocEntryGetTypeString(KTocEntryType type);
-#endif
-
-/* GetBSTree
- *
- * Get a reference to the BSTree of a TocEntry that represents a directory.
- * This will fail for all ites taht are not directories.
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] const BSTree **    ptree       where to put a reference to the kcont/BSTree of a
- *                      directory node
- */
-rc_t KTocEntryGetBSTree( const KTocEntry * self,
-                         struct BSTree const ** ptree);
-
-/* for a file there are two fields: a container offset and a file size */
-
-
-/* GetFileLocator (works for contiguous or chunked files)
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint64 *       locator        where to put the locator of a referenced node
- */
-rc_t KTocEntryGetFileLocator( const KTocEntry * self,
-                              uint64_t * locator);
-
-
-/* GetFileSize (works for contiguous or chunked files)
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint64 *       size        where to put the size of a referenced node
- */
-rc_t KTocEntryGetFileSize( const KTocEntry * self,
-                     uint64_t * size);
-
-
-/* GetFilePhysicalSize (works for contiguous or chunked files)
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint64 *       size        where to put the size of a referenced node
- */
-rc_t KTocEntryGetFilePhysicalSize( const KTocEntry * self,
-                                   uint64_t * size);
-
-
-/* GetFileContiguous (works for contiguous or chunked files)
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint64 *       size        where to put the size of a referenced node
- */
-rc_t KTocEntryGetFileContiguous( const KTocEntry * self,
-                                 bool * contiguous);
-
-
-/* GetFileOffset
- *
- * For normal contiguous file nodes 'offset' gets the offset to the start of the file.
- * For all other nodes, 'offset' gets 0 with an appropriate rc_t return.
- *
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] uint64 *       offset      where to put the offset of a referenced node
- */
-rc_t KTocEntryGetFileOffset( const KTocEntry * self,
-                     uint64_t * offset);
-
-
-/* GetHardTarget
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] const KTocEntry ** target      where to put a reference from a hard link node
- */
-rc_t KTocEntryGetHardTarget( const KTocEntry *self,
-                     const KTocEntry ** target);
-
-/* there are two specialzied fields for chunked files - both retrieved with the saem method */
-
-
-/* GetChunks
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] const KTocChunk *  chunks      where to put the size of a referenced node
- */
-rc_t KTocEntryGetChunks (const KTocEntry * self,
-                     uint32_t * num_chunks,
-                     const KTocChunk ** chunks);
-
-/* GetSoftTarget
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KTocEntry *  self        object oriented object reference
- * [OUT] const char **      target      where to put a reference from a hard link node
- */
-rc_t KTocEntryGetSoftTarget (const KTocEntry *self,
-                     const char ** target);
-
-
-/*--------------------------------------------------------------------------
- * KToc
- *  archive table of contents
- *
- *  the "CreateXXX" series of methodss take a KCreateMode ( see kfs/directory.h ).
- *  when mode == kcmOpen, create if needed, overwrite if exists.
- *  when mode == kcmInit, create if needed, clear if exists.
- *  when mode == kcmCreate, fail if exists, create otherwise.
- *  if mode has kcmParents set, fill in missing parents on create.
- *
- * These is the only open API into a TOC with in the archive package of classes.
- * Functions to parse archives (Tar was the first format but is not expected to 
- * be the only format) use these methods to add entries to the TOC.  New parsers
- * should fit the signature of 
- *
- *  rc_t PARSER (KToc * <TOC>, const KFile * <ARCHIVE>)
- *
- * "PARSER" [IN] is the parsing function
- *
- * "TOC" [OUT] is a opaque class that is never exposed other than to these create
- * entry methods
- *
- * "FILE" [IN] is an archive opaquely opened as a KFile and then given to a
- * KDirectory and should not be accessed from outside this parsing function.
- *
- * An Archive is opened via a call to friend function.  It has by design been
- * made to mimic the signature of KDirectoryOpenDirRead with only a change in
- * parameters after path.  No "..." or va_list is supported.  To use that
- * functionality one would have to call KDirectoryResolvePath and use the
- * new path generated by that call as the path parameter for this function.
- *
- * rc_t KDirectoryOpenArcDirRead (const KDirectory * dir, 
- *                    KDirectory ** pdir,
- *                    bool chroot,
- *                    const char * path,
- *                    rc_t (CC* parse )(KToc *,const KFile*));
- *
- * "dir" [IN] is an existing KDirectory in which to find the archive file.
- *
- * "pdir" [OUT] is a pointer which will after the function is called point to the new
- * KDirectory that is the archive opened as a directory with the same name as
- * its containing file.
- *
- * "chroot" [IN] is false(1)/true(1 [or any non zero]) as to whether the archive will
- * treat its contents as a virtual root directory ('/') or not.
- *
- * "path" [IN] is the address with in directory of the archive.
- *
- * "parse" [IN] is the function that will create TOC entries for that archive.
- *
- * No member element or function of an object of class TOC will be exposed
- * other than these create entry methods.
- */
-typedef struct KToc KToc;
-
-/* Init
- *  construct a TOC tied to a KFile with a given path
- * At this point, this method has been made private and will only be called by 
- * KDirectoryOpenArcDirRead().
- */
-
-rc_t KTocInit( KToc**self, struct String const * path, KArcFSType arctype,
-        const void * archive, KSRAFileAlignment alignment);
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-rc_t KTocAddRef( const KToc *self );
-rc_t KTocRelease( const KToc *self );
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- * At this point, these methods have been made private and will only be called by 
- * with in the archive package.  References to the TOC will be handled within 
- * the constructors and destructors for KDirectorys and KFiles created by
- * KDirectory OpenArcDirRead() and then any KDirectory OpenFileRead() and 
- * KDirectory OpenDirRead() with in that initial KDirectory().  At this point
- * archives are read only so OpenFileWrite() OpenDirWrite() CreateDir() CreateFile()
- * and other such methods are not supported for archives.
- */
-rc_t KTocAddRef ( const KToc *self );
-rc_t KTocRelease ( const KToc *self );
-
-
-/* ResolvePathNode
- *
- *
- * [RET] rc_t                   0 for success; anything else for a failure
- *                      see itf/klib/rc.h for general details
- * [IN]  const KToc *   self        TOC self reference: object oriented in C
- * [IN]  const char *       path        the path to be parsed - it will start at the root 
- *                      of the TOC's address
- * [OUT] const KTocEntry **     pnode       the address of the final node traversed is put here
- * [OUT] uint32_t *         type        the type of node for the final node
- * [OUT] char **        unusedpath  This will point to any part of the path not used up
- *                      in parsing against the TOC.
- *                      NULL if the leaf node was found
- *                      the start of a node that could not be parsed
- *                      the start of the node after a softlink (or NULL)
- */
-rc_t KTocResolvePathTocEntry( const KToc *self,
-                         const KTocEntry ** pnode,
-                         const char *path,
-                         size_t path_len,
-                         KTocEntryType * ptype,
-                         const char ** unusedpath);
-
-/*--------------------------------------------------------------------------
- * Constructors/factories
- */
-
-/* CreateDir
- *  create a sub-directory
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-rc_t KTocCreateDir ( KToc *self, KTime_t mtime, uint32_t access, 
-        KCreateMode mode, const char *path, ... );
-rc_t KTocVCreateDir ( KToc *self, KTime_t mtime, uint32_t access,
-        KCreateMode mode, const char *path, va_list args );
-
-/* CreateFile
- *  create an entry for a contiguous file
- *
- *  "source_position" [ IN ] and "size" [ IN ] - description of the contiguous
- *  region of the archive file occupied by the file
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- * This is used also to create an empty file.  When size is zero the underlying 
- * library might create a special zero length entry type.
- */
-rc_t KTocCreateFile ( KToc *self, uint64_t source_position, uint64_t size,
-              KTime_t mtime, uint32_t access, KCreateMode mode,
-              const char *path, ... );
-rc_t KTocVCreateFile ( KToc *self, uint64_t source_position, uint64_t size,
-               KTime_t mtime, uint32_t access, KCreateMode mode,
-               const char *path, va_list args );
-rc_t KTocCreateZombieFile ( KToc *self, uint64_t source_position, uint64_t size,
-              KTime_t mtime, uint32_t access, KCreateMode mode,
-              const char *path, ... );
-rc_t KTocVCreateZombieFile ( KToc *self, uint64_t source_position, uint64_t size,
-               KTime_t mtime, uint32_t access, KCreateMode mode,
-               const char *path, va_list args );
-
-/* CreateChunkedFile
- *  create an entry for a chunked file
- *
- *  a chunked file consists of 0 or more possibly discontiguous chunks
- *  positioned within the logical file
- *
- *  "size" [ IN ] - the size of the logical file
- *
- *  "num_chunks" [ IN ] - the number of chunks in "chunks"
- *
- *  "chunks" [ IN ] - an array of chunk descriptors, where each chunk
- *  contains valid data that are mapped to form file
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-rc_t KTocCreateChunkedFile ( KToc *self, uint64_t size, KTime_t mtime,
-                 uint32_t access, uint32_t num_chunks,
-                 const KTocChunk chunks [], KCreateMode mode,
-                 const char *path, ... );
-rc_t KTocVCreateChunkedFile ( KToc *self, uint64_t size, KTime_t mtime,
-                  uint32_t access, uint32_t num_chunks,
-                  const KTocChunk chunks [], KCreateMode mode,
-                  const char *path, va_list args );
-
-/* CreateHardLink
- *  creates a hard link to an existing file within TOC
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "link" [ IN ] - NUL terminated string in directory-native
- *  character set denoting alias
- */
-rc_t KTocCreateHardLink ( KToc *self, KTime_t mtime, uint32_t access,
-              KCreateMode mode, const char *targ,
-              const char *link, ... );
-rc_t KTocVCreateHardLink ( KToc *self, KTime_t mtime, uint32_t access,
-               KCreateMode mode, const char *targ,
-               const char *link, va_list args );
-
-/* CreateSoftLink
- *  creates a soft link to any file or directory
- *  that is interpreted upon acces.
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- */
-rc_t KTocCreateSoftLink ( KToc * self, KTime_t mtime, uint32_t access,
-              KCreateMode mode, const char * targ,
-              const char * alias, ... );
-rc_t KTocVCreateSoftLink ( KToc * self, KTime_t mtime, uint32_t access,
-               KCreateMode mode, const char * targ,
-               const char * alias, va_list args );
-
-/* OpenArcDirRead
- *  Open an archive file as a KDirectory derived type: made to match 
- *  KDirectoryOpenDirRead() where parse could be the first element of arg
- *
- * [IN]  dir    A KDirectory (of any derived type) to reach the archive file
- * [OUT] pdir   The KDirectory (of type KArcDir) that will be created
- * [IN]  chroot if non-zero, the new directory becomes chroot'd and interprets paths
- *      stating with '/'
- * [IN]  path   The path to the archive - this will become the directory path
- * [IN]  parse  A pointer to the function needed to build a TOC by parsing the file
- *
- * parameters to parse
- * REQUIRED:    KToc *
- * REQUIRED:    void *  KFile* | KDirectory* | ???
- * OPTIONAL:    bool (*)(const char*)           Filter: include or skip this path
- * OPTIONAL:    rc_t (*)(???)               Sort: reorder name list
- */
-
-KFS_EXTERN
-rc_t CC KDirectoryOpenArcDirRead (const KDirectory * dir, 
-            const KDirectory ** pdir,
-            bool chroot,
-            const char * path,
-            KArcFSType baseType,
-            rc_t (CC*parse)(KToc*,const void *,
-                bool(CC*)(const KDirectory*,const char *, void*),
-                void *),
-                bool (CC* filter )(const KDirectory*, const char *, void *),
-            void * filterparam );
-
-
-#if 0
-rc_t KTocResolvePathTocEntry( const KToc *self,
-                 const KTocEntry ** pnode,
-                 const char *path,  /* must be entirely in the TOC */
-                 size_t path_len,
-                 KTocEntryType * ptype,
-                 const char ** unusedpath);
-#endif
-
-
-
-const KTocEntry* KTocGetRoot( const KToc * self );
-
-#if 0
-const char * KTocGetRootPath( const KToc * self, size_t * len );
-#endif
-
-rc_t KTocGetPath( const KToc * self, struct String const ** path );
-rc_t KTocResolvePathFromOffset( const KToc *self,
-                const char ** path,
-                uint64_t * ppos,
-                uint64_t offset );
-
-KSRAFileAlignment KTocAlignmentGet( KToc * self );
-rc_t KTocAlignmentSet( KToc * self,KSRAFileAlignment align );
-
-const void * KTocGetArchive( const KToc * self );
-
-KFS_EXTERN rc_t KTocPersist( const KToc * self,
-                             void ** buffer, size_t * buffer_size,
-                             uint64_t * virtual_file_size,
-                             struct Vector const * files );
-
-KFS_EXTERN rc_t CC KTocEntryPersist( void *param, const void * node,
-                                     size_t * num_writ, 
-                                     PTWriteFunc write, void * write_param );
-
-rc_t KTocInflatePBSTree (KToc * self, uint64_t arcsize, const void * treestart,
-                         uint32_t maxsize, uint64_t offset,
-                         bool rev, const char * path);
-
-rc_t KArcDirPersistHeader	(const KArcDir * self,
-    void ** buffer, size_t * buffer_size, uint64_t * file_sile, uint32_t align,
-    rc_t ( CC *sort )(const struct KDirectory*, struct Vector*) );
-
-
-/* ----------------------------------------------------------------------
- * KArcDirGetTOC
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const KArcDir *	self		Object oriented C; KArcDir object for this method
- * [OUT] const KToc **		toc
- */
-rc_t  KArcDirGetTOC (const struct KArcDir * self, const struct KToc ** toc);
-
-
-
-#endif /* #ifndef _h_kfs_toc_priv_h_ */
-/* end of file */
diff --git a/libs/kfs/toc.c b/libs/kfs/toc.c
deleted file mode 100644
index aeaea37..0000000
--- a/libs/kfs/toc.c
+++ /dev/null
@@ -1,1738 +0,0 @@
-/*===========================================================================
- *
- *                            Public DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <atomic32.h>
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/pbstree.h>
-#include <klib/text.h>
-#include <kfs/arc.h>
-#include <kfs/sra.h>
-#include <kfs/toc.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "toc-priv.h"
-
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/* ======================================================================
- * Defines relevant to the whole compilation unit.
- */
-
-/* !!!!!!!! WHY ISN'T THIS IN A COMMON PRIVATE HEADER FILE? !!!!!!! */
-rc_t SraHeaderMake (KSraHeader ** pself, size_t treesize, KSRAFileAlignment alignment);
-
-/* ======================================================================
- * KTocEntryStack
- *
- * A private class used to keep track of directories passed through while adding
- * entries to the TOC.
- *
- * private little class for handling a stack of pointers to TOC entrys
- */
-struct KTocEntryStack
-{
-    unsigned		count;
-    unsigned		allocated;
-    KTocEntry **	stack;
-};
-
-/* ----------------------------------------------------------------------
- * KTocEntryStackNew
- * [OUT] KTocEntryStack ** 	pself		object oriented object reference where
- * construct a Entry Stack at where the pointer to pointer so self points
- *						to put the reference to the new object
- */
-rc_t KTocEntryStackNew( KTocEntryStack ** self )
-{
-#define ARBITRARY_STACK_SIZE	(16)
-    if (self == NULL)
-	return RC (rcFS, rcToc, rcConstructing, rcParam, rcNull);
-
-    *self = malloc (sizeof (KTocEntryStack));
-    (*self)->count = 0;
-    (*self)->allocated = ARBITRARY_STACK_SIZE;
-    (*self)->stack = malloc ((*self)->allocated * sizeof (KTocEntry*));
-    if ((*self)->stack == NULL)
-	return RC (rcFS, rcToc, rcAllocating, rcMemory, rcInsufficient);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryStackDel
- *
- * destruct a Entry Stack
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KTocEntryStack *	self		object oriented object reference what to destroy
- */
-rc_t KTocEntryStackDel( KTocEntryStack * self )
-{
-
-    /* empty stack there so just return ok for now */
-    if (self == NULL)
-	return 0;
-
-    if (self->stack != NULL)
-	free (self->stack);
-
-    free (self);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryStackDepth
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  KTocEntryStack * 	self		object oriented object reference
- * [OUT] int			depth		return the current depth/length of the stack
- *						(int allows compiler flexibilty to use
- *						efficient type)
- */
-rc_t KTocEntryStackDepth( KTocEntryStack * self, int * depth )
-{
-    *depth = self->count;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryStackPush
- *
- * adds a reference to KTocEntry to the stack
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KTocEntryStack *	self		object oriented object reference what to destroy
- * [IN] KTocEntry * 		pathaddr	the entry to add
- */
-rc_t KTocEntryStackPush( KTocEntryStack * self, KTocEntry * pathaddr )
-{
-#define ARBITRARY_INCREMENT_SIZE	(8)
-
-    if (self == NULL)
-	return RC (rcFS, rcToc, rcInserting, rcSelf, rcNull);
-
-    if (self->count >= self->allocated)
-    {
-	KTocEntry **	stack;
-	int	new_allocated = self->allocated + ARBITRARY_INCREMENT_SIZE;
-	stack = realloc (self->stack, self->allocated * sizeof (KTocEntry*));
-	if (stack == NULL)
-	{
-	    return RC (rcFS, rcToc, rcAllocating, rcMemory, rcInsufficient);
-	}
-	self->allocated = new_allocated;
-	self->stack = stack;
-    }
-    self->stack[self->count++] = pathaddr;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryStackPop
- *
- * removess a reference to KTocEntry to the stack (not C++STLish but more normal stack operation)
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  KTocEntryStack * 	self		object oriented object reference what to destroy
- * [OUT] KTocEntry ** 	pathaddr	where to put the reference to the entry removed
- */
-rc_t KTocEntryStackPop( KTocEntryStack * self, KTocEntry ** pathaddr )
-{
-    if (self == NULL)
-	return RC (rcFS, rcToc, rcReading, rcSelf, rcNull);
-
-    if (pathaddr == NULL)
-	return RC (rcFS, rcToc, rcReading, rcParam, rcNull);
-
-    if (self->count == 0)
-    {
-	/* -----
-	 * this means empty stack and is not considered an error
-	 * though it should be looked for by the caller
-	 */
-	*pathaddr = NULL;
-    }
-    else
-    {
-	*pathaddr = self->stack[--(self->count)];
-    }
-    return 0;
-}
-
-
-static
-int CC KTocEntryIndexCmp2 (const BSTNode * n, const BSTNode * p)
-{
-    uint64_t nos;
-    uint64_t noe;
-    uint64_t pos;
-    uint64_t poe;
-
-    assert (n != NULL);
-    assert (p != NULL);
-    {
-	const KTocEntryIndex * ne = (const KTocEntryIndex*)n;
-	nos = ne->entry->u.contiguous_file.archive_offset;
-	noe = nos + ne->entry->u.contiguous_file.file_size;
-    }
-    {
-	const KTocEntryIndex * pe = (const KTocEntryIndex*)p;
-	pos = pe->entry->u.contiguous_file.archive_offset;
-	poe = pos + pe->entry->u.contiguous_file.file_size;
-    }
-    if ((nos == pos)&&(noe == poe))
-	return 0;
-    if (noe <= pos)
-	return -1;
-    return 1;
-}
-
-static
-uint64_t add_filler (uint64_t z, KSRAFileAlignment a)
-{
-    if (a > 1)
-    {
-        uint64_t m = (uint64_t)a - 1;
-        return (z + m) & ~ m;
-    }
-    return z;
-}
-
-static
-rc_t KTocCreateEntryIndex (KToc * self, const char * path, uint64_t * file_offset)
-{
-    rc_t rc;
-    size_t len;
-    union idx
-    {
-	void * v;
-	KTocEntryIndex * i;
-	char * b;
-    } idx;
-    KTocEntryType type;
-/*     const KTocEntry * entry; */
-    const char * left;
-
-    TOC_FUNC_ENTRY();
-
-    assert (self != NULL);
-    assert (path != NULL);
-
-    rc = 0;
-
-    len = strlen (path);
-    idx.v = malloc (sizeof (*idx.i) + len + 1);
-    if (idx.v == NULL)
-    {
-	rc = RC (rcFS, rcToc, rcReindexing, rcMemory, rcExhausted);
-	LOGERR( klogErr, rc, "Out of memory creating new path");
-    }
-    else
-    {
-	char * tmp;
-
-        type = ktocentrytype_unknown;
-	tmp = idx.b + sizeof (*idx.i);
-	strcpy (tmp, path);
-	StringInitCString (&idx.i->fullpath, tmp);
-	rc = KTocResolvePathTocEntry (self, (const KTocEntry**)&idx.i->entry, path, len, &type, &left);
-	if (rc != 0)
-	    LOGERR( klogErr, rc, "Unable to resolve path");
-	else
-	{
-/* 	    if (left != 0) */
-/* 		rc = RC (rcFS, rcToc, rcAccessing, rcPath, rcNotFound); */
-/* 	    else */
-	    {
-                uint64_t offset;
-                uint64_t new_offset;
-		switch (type)
-		{
-		case ktocentrytype_dir:
-		case ktocentrytype_softlink:
-		case ktocentrytype_hardlink:
-		case ktocentrytype_emptyfile:
-		    goto no_entry;
-		case ktocentrytype_file:
-                    offset = add_filler (*file_offset, self->alignment);
-                    idx.i->entry->u.contiguous_file.archive_offset = offset;
-                    new_offset = offset + idx.i->entry->u.contiguous_file.file_size;
-		    break;
-		case ktocentrytype_chunked:
-                    offset = add_filler (*file_offset, self->alignment);
-		    idx.i->entry->u.chunked_file.archive_offset = offset;
-		    new_offset = offset + idx.i->entry->u.chunked_file.file_size;
-		    break;
-		case ktocentrytype_unknown:
-		    rc = RC (rcFS, rcToc, rcReindexing, rcTocEntry, rcUnknown);
-		    break;
-		case ktocentrytype_notfound:
-		    rc = RC (rcFS, rcToc, rcReindexing, rcTocEntry, rcNotFound);
-		    break;
-		default:
-		    rc = RC (rcFS, rcToc, rcReindexing, rcTocEntry, rcInvalid);
-		    break;
-		}
-		if (rc != 0)
-		    LOGERR( klogErr, rc, "Unable to handle path");
-		else
-		{
-		    rc = BSTreeInsert (&self->offset_index, &idx.i->node, KTocEntryIndexCmp2);
-		    if (rc == 0)
-		    {
-			*file_offset = new_offset;
-			return 0;
-		    }
-		}
-	    }
-	}
-    no_entry:
-	free (idx.v);
-    }
-    return rc;
-}
-
-static
-void CC KTocEntryIndexWhack (BSTNode * n, void * data)
-{
-    free (n);
-}
-
-struct ugliness
-{
-    const KToc * toc;
-    uint64_t     offset;
-    uint64_t     foffset;
-};
-
-static
-int CC KTocEntryIndexCmpOffset (const void * item /* offset */, const BSTNode * n)
-{
-    struct ugliness * ugly;
-    uint64_t nos;
-    uint64_t noe;
-    uint64_t po;
-    assert (item != NULL);
-    assert (n != NULL);
-    ugly = (struct ugliness*)item;
-    {
-	const KTocEntryIndex * ne = (const KTocEntryIndex*)n;
-	nos = ne->entry->u.contiguous_file.archive_offset;
-	noe = add_filler (nos + ne->entry->u.contiguous_file.file_size, ugly->toc->alignment);
-    }
-    po = ugly->offset;
-
-    TOC_DEBUG (("%s: %lu %lu %lu\n", __func__, po, nos, noe));
-
-    ugly->foffset = 0;
-    if (po < nos)
-	return -1;
-    else if (po < noe)
-    {
-        ugly->foffset = po - nos;
-	return 0;
-    }
-    else
-	return 1;
-}
-
-/* -----
- * We use MAX_PATH if it is available but not religiously.  We handle most
- * buffer over-runs with in the module only truncating paths at the border
- * of the module where KDirectory doesn't handle path's longer than MAX_PATH
- */
-#ifdef MAX_PATH
-#define	KARC_DEFAULT_PATH_ALLOC			(MAX_PATH)
-#else
-#define	KARC_DEFAULT_PATH_ALLOC			(4096)
-#endif
-
-/* ======================================================================
- * KToc method prototypes and defines
- */
-
-/*--------------------------------------------------------------------------
- * KToc
- *  archive table of contents
- *
- *  the "CreateXXX" series of messages take a KCreateMode (see kfs/directory.h).
- *  when mode == kcmOpen, create if needed, overwrite if exists.
- *  when mode == kcmInit, create if needed, clear if exists.
- *  when mode == kcmCreate, fail if exists, create otherwise.
- *  if mode has kcmParents set, fill in missing parents on create.
- */
-
-
-/* ======================================================================
- * KToc method bodies
- */
-
-/* ----------------------------------------------------------------------
- * KToc
- *  archive table of contents
- *
- *  the "CreateXXX" series of messages take a KCreateMode (see kfs/directory.h).
- *  when mode == kcmOpen, create if needed, overwrite if exists.
- *  when mode == kcmInit, create if needed, clear if exists.
- *  when mode == kcmCreate, fail if exists, create otherwise.
- *  if mode has kcmParents set, fill in missing parents on create.
- */
-
-rc_t KTocInit ( KToc ** self,
-                const String * path,
-                KArcFSType arctype,
-                const void * archive,
-                KSRAFileAlignment alignment )
-{
-    char * str_data;
-    rc_t rc;
-
-    /* -----
-     * expected failure mode is NULL references for needed initializers
-     */
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcConstructing, rcSelf, rcNull);
-    }
-    if ((path == NULL)||(archive == NULL))
-    {
-	return RC (rcFS, rcToc, rcConstructing, rcParam, rcNull);
-    }
-
-    /* -----
-     * get memory for the TOC and for its path
-     */
-    *self = malloc (sizeof(KToc) + StringSize(path) + 1);
-
-    /* -----
-     * expected failure mode is memory allocation failure
-     */
-    if (*self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAllocating, rcMemory, rcInsufficient);
-    }
-
-    /* -----
-     * point past the KToc structure in the allocated memory for the
-     * string path of this TOC
-     */
-    str_data = (char *)*self + sizeof (KToc);
-
-    /* -----
-     * reference the existing KFile
-     */
-    switch ((*self)->arctype = arctype)
-    {
-    default:
-	free (self);
-	return RC (rcFS, rcToc, rcConstructing, rcParam, rcInvalid);
-    case tocKFile:
-	KFileAddRef ((*self)->archive.v = archive);
-	break;
-    case tocKDirectory:
-	KDirectoryAddRef ((*self)->archive.v = archive);
-	break;
-    }
-
-/* need to set back pointer karchive */
-
-    /* -----
-     * We added here by default
-     */
-    atomic32_set (&(*self)->refcount, 1);
-
-    /* -----
-     * a tad clunky
-     */
-    string_copy (str_data, 1 + StringSize(path), path->addr, StringSize(path));
-    StringInit (&((*self)->path), str_data, StringSize(path), StringLength(path));
-    rc = (KTocAlignmentSet (*self, alignment));
-    if (rc == 0)
-    /* -----
-     * Build the "root directory" structure for the TOC initialized to empty
-     */
-    {
-	KTocEntry * pentry = &(*self)->entry;
-	const char *  pchar = strrchr ((*self)->path.addr, '/') + 1;
-	size_t	      size = (*self)->path.size - (pchar - (*self)->path.addr);
-
-	if (pchar == NULL)
-	    pchar = (*self)->path.addr;
-
-	StringInit ( &pentry->name, pchar, size, (uint32_t)size );
-	pentry->type = ktocentrytype_dir;
-	BSTreeInit(&pentry->u.dir.tree);
-        BSTreeInit(&(*self)->offset_index);
-        (*self)->header = NULL;
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * AddRef
- *  ignores NULL references
- */
-rc_t KTocAddRef ( const KToc *self )
-{
-    KToc *	mutable_self = (KToc*)self; /* strip const protection for mutable field */
-
-    if (mutable_self != NULL)
-	atomic32_inc (&mutable_self->refcount);
-
-    return 0;
-}
-/* ----------------------------------------------------------------------
- * AddRef
- * Release
- *  ignores NULL references
- */
-rc_t KTocRelease ( const KToc *self )
-{
-    KToc *	mutable_self = (KToc*)self; /* strip const protection for mutable field */
-    rc_t	rc = 0;
-
-    if (mutable_self == NULL)
-    {
-	return RC (rcFS, rcToc, rcReleasing, rcSelf, rcNull);
-    }
-
-    if (atomic32_dec_and_test (&mutable_self->refcount))
-    {
-        switch (self->arctype)
-        {
-        case tocUnknown:
-        case tocKVirtual:
-            free((void*)self->archive.v);
-            break;
-
-        case tocKFile:
-            KFileRelease (self->archive.f);
-            break;
-        case tocKDirectory:
-            KDirectoryRelease (self->archive.d);
-            break;
-        }
-	BSTreeWhack (&mutable_self->entry.u.dir.tree, KTocEntryWhack, &rc);
-	BSTreeWhack (&mutable_self->offset_index, KTocEntryIndexWhack, &rc);
-	free (mutable_self);
-    }
-/*     else */
-/*     { */
-/*     } */
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KTocCreateSubdirs
- *
- * This is a constructor/parse helper method (the p starting the name is meant to 
- * imply a c++/Java private situation)
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT]KToc * 		self		TOC self reference: object oriented in C
- * [IN]   const char * 		_path		start of directory path
- * [IN]   const char * 		end		end of directory path
- * [IN]   KCreateMode  		mode		whether or not to document the existing?
- * [INOUT]KTocEntryStack * 	pathstack	created outside this function but this is
- *						where it is primarily filled in.  This is
- *						created for use in KTocResolveHardLink
- */
-static
-rc_t	KTocCreateSubdirs (KToc *    self,	   /* TOC self reference: object oriented in C */
-			   const char * _path,   /* start of directory path */
-			   const char * end, 	   /* end of directory path */
-			  KTime_t mtime,
-			   uint32_t access,
-			   KCreateMode  mode,    /* whether or not to document the existing? */
-			   KTocEntryStack * pathstack)
-{
-    const
-	char * 	path = _path;		/* pointer to head of remaining path to parse: starts at the beginning of course */
-    const
-	char *  slash;			/* pointer to the next '/' (or NUL) past the next facet of the path */
-    BSTree *	tree = &self->entry.u.dir.tree;	/* current directory tree we are in */
-    rc_t	rc = 0;		/* general purpose rc_t for calls and our own return */
-    BSTNode *   exists = NULL;		/* is there already a entry with our name? this will be it */
-    bool	success = true;		/*  */
-
-    /* -----
-     * special case of absolute position being turned into relative
-     * skip past initial "/" or "//" in a path
-     */
-    while (*path == '/')
-    {
-	PLOGMSG (klogWarn, (klogWarn,
-                            "skipping initial '/' in $(path)",
-                            PLOG_S(path),
-                            path));
-	++path;
-    }
-
-    /* -----
-     * Now continue on with each facet of the path one at a time
-     */
-    for (;path < end; path = slash+1)
-    {
-	KTocEntry * newentry;			/* new entry for the new name entry: might be a duplicate */
-	bool	      do_insert = false;	/* do we insert a new entry? short cut for later */
-
-	/* -----
-	 * find the next (first) '/' in the remaining path
-	 */
-	slash = strchr (path, '/');
-
-	/* -----
-	 * we've got the last directory in the path if there are no
-	 * more '/' characters or if the next '/' is the last character in the
-	 * path (we don't do white space checks!)
-	 */
-	if (slash == NULL)
-	{
-	    slash = end;
-	}
-
-	/* -----
-	 * first we'll compare our new path against the special '.' and '..'
-	 * special directory pointers
-	 */
-	if ((path[0] == '.')&&(path+1 == slash))	/* . */
-	{
-	    /* -----
-	     * just ignore "here" directory references
-	     */
-	    continue;
-	}
-	else if ((path[0] == '.')&&(path[1] == '.')&&(path+2 == slash))	/* .. */
-	{
-	    /* -----
-	     * for up to parent directory references we try to change to that directory
-	     */
-	    int depth;
-
-	    rc = KTocEntryStackDepth (pathstack, &depth);
-	    if (depth <= 0)
-	    {
-		/* FAILURE */
-		rc = RC (rcFS, rcToc, rcConstructing, rcLink, rcViolated);
-		success = false;
-		break;
-	    }
-	    else
-	    {
-		rc = KTocEntryStackPop (pathstack, &newentry);
-	    }
-	}
-	else
-	{
-	    /* -----
-	     * Create a new directory entry
-	     *
-	     * access isn't really implemented yet so make a directory
-	     * default to read + execute for anyone
-	     *
-	     * we might only be using this directory entry for comparisons <shrug>
-	     */
-	    rc = KTocEntryNewDirectory (&newentry, path, slash - path, mtime, access);
-
-	    /* -----
-	     * pass along failures - no need to change any parts at this point
-	     * but that time may come
-	     */
-	    if (rc != 0)
-	    {
-		LOGMSG (klogErr, "failed to construct a directory entry: memory allocation");
-		return rc;
-	    }
-
-	    exists = BSTreeFind (tree, newentry, KTocEntryCmpVoid);
-
-	    /* -----
-	     * the expected is to insert the entry if it wasn't there but will check
-	     * special circumstances
-	     *
-	     * so plan to insert or not based on whether it is there and expect
-	     * all to be well.
-	     *
-	     * never insert if it already exists
-	     */
-	    do_insert = (bool)((exists == NULL) ?  true : false);
-	    rc = 0;
-
-	    /* -----
-	     * Open/init/create with no make parents:
-	     */
-	    if ((exists == NULL)&& !(mode & kcmParents))
-	    {
-		/* parent did not exist so we will fail */
-		rc = RC (rcFS, rcToc, rcCreating, rcSelf, rcInconsistent);
-		do_insert = false;
-		success = false;
-	    }
-
-	    /* -----
-	     * if rc is set, we had a problem and will fail
-	     */
-	    if (rc != 0)
-	    {
-		LOGERR	(klogErr, rc,
-                                   "directory parse/creation failed");
-		(void)KTocEntryDelete(newentry);
-		break;
-	    }
-
-	    if (do_insert)
-	    {
-		rc = BSTreeInsert (tree, &newentry->node, KTocEntryCmp2);
-		if (rc)
-		{
-		    LOGMSG (klogErr, "directory parse/creation failed 2");
-		    (void)KTocEntryDelete(newentry);
-		    break;
-		}
-                TOC_DEBUG (("%s: inserted new directory into TOC %S\n", __func__, newentry->name));
-	    }
-	    else
-	    {
-		(void)KTocEntryDelete(newentry);
-		newentry = (KTocEntry*)exists;
-	    }
-
-	    /* -----
-	     * move into the subdirectory for the next directory in the path
-	     */
-	    if ((rc = KTocEntryStackPush (pathstack, newentry)) != 0)
-	    {
-		success = false;
-		break;
-	    }
-
-	    tree = &newentry->u.dir.tree;
-	}
-    }
-    return success ? 0 : rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KTocCreate
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] KToc *		self		TOC self reference: object oriented in C
- * [IN] KCreateMode 		mode		KDirectory defines that define what to so with
- *						"files" that already existed or did not including
- *						missing subdirectories in the path
- * [IN] const char *		ppath		the path name for the new entry relative to the
- *						base of the TOC
- * [IN] const KTocEntryParam*	pparams		specific parameters for this type of entry - the
- *						type of entry is included in this structure
- */
-static rc_t KTocCreate (KToc *self,
-			KCreateMode mode,
-			const char *ppath,
-			const KTocEntryParam * pparams)
-{
-    rc_t		rc;
-    char *		pend;
-    size_t		name_size;
-    BSTree *		ptree;
-    KTocEntry * 	pnewentry = NULL;	/* init to kill a warning */
-    KTocEntry * 	pexistingentry;
-    KTocEntry * 	pwd = NULL;
-    KTocEntryStack *	pdirstack;
-
-    assert (self != NULL);
-    assert (ppath != NULL);
-    assert (pparams != NULL);
-
-    ptree = &self->entry.u.dir.tree;
-
-    if ((rc = KTocEntryStackNew (&pdirstack)) != 0)
-    {
-	return rc;
-    }
-    /* -----
-     * look for a '/' that isn't the last character in the path
-     */
-    pend = string_rchr (ppath, strlen(ppath)-1, '/');
-    if (pend != NULL)
-    {
-
-	rc = KTocCreateSubdirs (self, ppath, pend, pparams->mtime,
-				pparams->access, mode, pdirstack);
-
-	rc = KTocEntryStackPop (pdirstack, &pwd);
-	if (pwd)
-	{
-	    ptree = &(pwd->u.dir.tree);
-	}
-
-	ppath = pend+1;
-    }
-
-    name_size = strlen(ppath);
-    switch (pparams->type)
-    {
-    default:
-	break;
-    case ktocentrytype_dir:
-	rc = KTocEntryNewDirectory (&pnewentry,
-				    ppath,
-				    name_size,
-				    pparams->mtime,
-				    pparams->access);
-	break;
-    case ktocentrytype_file:
-	rc = KTocEntryNewFile (&pnewentry,
-			       ppath,
-			       name_size,
-			       pparams->mtime,
-			       pparams->access,
-			       pparams->u.file.source_position,
-			       pparams->u.file.size);
-	break;
-    case ktocentrytype_zombiefile:
-	rc = KTocEntryNewZombieFile (&pnewentry,
-                                     ppath,
-                                     name_size,
-                                     pparams->mtime,
-                                     pparams->access,
-                                     pparams->u.file.source_position,
-                                     pparams->u.file.size);
-	break;
-    case ktocentrytype_chunked:
-	rc = KTocEntryNewChunked (&pnewentry, 
-				  ppath,
-				  name_size,
-				  pparams->mtime,
-				  pparams->access,
-				  pparams->u.chunked.size,
-				  pparams->u.chunked.chunks,
-				  pparams->u.chunked.num_chunks);
-	break;
-    case ktocentrytype_softlink:
-	rc = KTocEntryNewSoft (&pnewentry, 
-			       ppath,
-			       name_size,
-			       pparams->mtime,
-			       pparams->access,
-			       pparams->u.softlink.targ,
-			       strlen (pparams->u.softlink.targ));
-	break;
-    case ktocentrytype_hardlink:
-	rc = KTocEntryNewHard (&pnewentry, 
-			       ppath,
-			       name_size,
-			       pparams->mtime,
-			       pparams->access,
-                               pparams->u.hardlink.ref);
-	break;
-    }
-/*     if (rc != 0) */
-/* 	; */
-
-    pexistingentry = (KTocEntry*)BSTreeFind (ptree, pnewentry, KTocEntryCmpVoid);
-
-    if (pexistingentry != NULL)
-    {
-	switch (mode & kcmValueMask)
-	{
-	default:
-            LOGMSG (klogInt, "invalis create mode flag for Toc Entry");
-        case kcmOpen:	/* use existing entry if it exists */
-	    KTocEntryDelete (pnewentry);
-	    break;
-
-	case kcmInit:
-	    BSTreeUnlink (ptree, &pexistingentry->node); /*?*/
-	    KTocEntryDelete (pexistingentry);
-            goto insert;
-	    break;
-
-	case kcmCreate:
-	    KTocEntryDelete (pnewentry);
-	    rc = RC (rcFS, rcToc, rcInserting, rcDirEntry, rcDuplicate);
-	    break;
-	}
-    }
-    else
-    {
-    insert:
-	rc = BSTreeInsert (ptree, &pnewentry->node, KTocEntryCmp2);
-        TOC_DEBUG (("%s: inserted new %s into TOC %s\n", __func__,
-		  KTocEntryTypeGetString(pparams->type),
-		  pnewentry->name.addr));
-    }
-#if 0
-    if (pparams->type == ktocentrytype_hardlink)
-    {
-
-	/* -----
-	 * Now the ugly specific part of a hard link - resolve the link
-	 */
-	rc = KTocResolveHardLink (self, pparams->u.hardlink.targ, pdirstack, pwd, &(pnewentry->u.hard_link.ref));
-	if (rc  != 0)
-	{
-	    /* kill off node */
-	    BSTreeUnlink (ptree, &pnewentry->node);
-	    rc = RC (rcFS, rcToc, rcAliasing, rcArcHardLink, rcNotFound);
-	}
-    }
-#endif
-    KTocEntryStackDel (pdirstack);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Constructors/factories
- */
-static
-rc_t createPath (char ** newpath, const char * path, va_list args)
-{
-    rc_t rc;
-    char * p;
-    char * pp;
-    size_t l;
-    int i;
-
-    rc = 0;
-    p = NULL;
-    l = 4096;
-    *newpath = p;
-
-    /* not trusting C99 version of vsnprintf is in place rather than SUSv2 */
-    for (;;)
-    {
-	pp = realloc (p,l);
-	if (pp == NULL)
-	{
-	    rc = RC (rcFS, rcToc, rcConstructing, rcMemory, rcExhausted);
-	    return rc;
-	}
-	if (args == NULL)
-	{
-	    i = (int)strlen ( path );
-	    if ( i < (int)l )
-		strcpy ( pp, path );
-	}
-	else
-	    i = vsnprintf (pp, l, path, args);
-	if (i < 0)
-	{
-	    rc = RC (rcFS, rcToc, rcConstructing, rcFormat, rcInvalid);
-	    free (pp);
-	    return rc;
-	}
-	p = pp;
-	if ( i < (int)l )
-	    break;
-	l = i + 1;
-    } 
-
-    *newpath = pp;
-
-    return rc;
-}
-
-
-
-/* ---------
- * CreateDir
- *  create a sub-directory
- *
- *  "mode" [ IN ] - a creation mode (see explanation in kfs/directory.h).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- */
-rc_t KTocCreateDir ( KToc *self,KTime_t mtime, uint32_t access,
-		    KCreateMode mode, const char *path, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, path);
-    rc = KTocVCreateDir (self, mtime, access, mode, path, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateDir ( KToc *self,KTime_t mtime, uint32_t access,
-		     KCreateMode mode, const char *path, va_list args )
-{
-    KTocEntryParam	params;
-    char * npath;
-    rc_t rc;
-
-    TOC_DEBUG (("%s: Name: %s Mode: %s\n", __func__,
-	     path, get_mode_string(mode)));
-
-    rc = createPath (&npath, path, args);
-    if (rc)
-	return rc;
-
-    params.type = ktocentrytype_dir;
-    params.mtime = mtime;
-    params.access = access;
-
-    rc = KTocCreate (self, mode, npath, &params);
-    free (npath);
-    return rc;
-}
-
-/* ----------
- * CreateFile
- *  create an entry for a contiguous file
- *
- *  "source_position" [ IN ] and "size" [ IN ] - description of the contiguous
- *  region of the archive file occupied by the file
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-rc_t KTocCreateFile ( KToc *self,
-		     uint64_t source_position, uint64_t size,
-		    KTime_t mtime, uint32_t access, 
-		     KCreateMode mode, const char *path, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, path);
-    rc = KTocVCreateFile (self, source_position, size,
-			  mtime, access, mode, path, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateFile ( KToc *self,
-                       uint64_t source_position, uint64_t size,
-                       KTime_t mtime, uint32_t access, 
-                       KCreateMode mode, const char *path, va_list args )
-{
-    KTocEntryParam	params;
-    char * npath;
-    rc_t rc;
-
-    TOC_DEBUG (("%s: Name: %s Mode: %sn Time: %lu\n", __func__,
-                path, get_mode_string(mode), mtime));
-
-
-    rc = createPath (&npath, path, args);
-    if (rc)
-	return rc;
-
-    params.type = ktocentrytype_file;
-    params.mtime = mtime;
-    params.access = access;
-    params.u.file.size = size;
-    params.u.file.source_position = source_position;
-
-    rc = KTocCreate (self, mode, npath, &params);
-    free (npath);
-    return rc;
-}
-
-rc_t KTocCreateZombieFile ( KToc *self,
-                            uint64_t source_position, uint64_t size,
-                            KTime_t mtime, uint32_t access, 
-                            KCreateMode mode, const char *path, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, path);
-    rc = KTocVCreateZombieFile (self, source_position, size,
-                                mtime, access, mode, path, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateZombieFile ( KToc *self,
-                             uint64_t source_position, uint64_t size,
-                             KTime_t mtime, uint32_t access, 
-                             KCreateMode mode, const char *path, va_list args )
-{
-    KTocEntryParam	params;
-    char * npath;
-    rc_t rc;
-
-    TOC_DEBUG (("%s: Name: %s Mode: %sn Time: %lu\n", __func__,
-                path, get_mode_string(mode), mtime));
-
-
-    rc = createPath (&npath, path, args);
-    if (rc)
-	return rc;
-
-    params.type = ktocentrytype_zombiefile;
-    params.mtime = mtime;
-    params.access = access;
-    params.u.file.size = size;
-    params.u.file.source_position = source_position;
-
-    rc = KTocCreate (self, mode, npath, &params);
-    free (npath);
-    return rc;
-}
-
-/* ---------
- * CreateChunkedFile
- */
-rc_t KTocCreateChunkedFile ( KToc *self, uint64_t size,KTime_t mtime,
-                             uint32_t access, uint32_t num_chunks,
-                             const KTocChunk chunks [], KCreateMode mode,
-                             const char *path, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, path);
-    rc = KTocVCreateChunkedFile (self, size, mtime, access, num_chunks,
-				 chunks, mode, path, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateChunkedFile ( KToc *self, uint64_t size,KTime_t mtime,
-                              uint32_t access, uint32_t num_chunks,
-                              const KTocChunk chunks [], KCreateMode mode,
-                              const char *path, va_list args )
-{
-    KTocEntryParam	params;
-    unsigned int	ix;
-    rc_t		rc;
-    char * 		npath;
-
-    TOC_DEBUG (("KToc Create Chunked File:: Name: %s Size: %ju Chunk count: %u Mode %s\n",
-                path, size, num_chunks, get_mode_string(mode)));
-
-    for (ix = 0; ix < num_chunks; ++ix)
-    {
-        TOC_DEBUG (( "KToc Create Chunk %u: 0x%jx 0x%jx %ju\n",
-                     ix,
-                     chunks[ix].logical_position,
-                     chunks[ix].source_position,
-                     chunks[ix].size));
-    }
-
-    rc = createPath (&npath, path, args);
-    if (rc)
-	return rc;
-
-    params.type = ktocentrytype_chunked;
-    params.u.chunked.size = size;
-    params.u.chunked.chunks = chunks;
-    params.u.chunked.num_chunks = num_chunks;
-
-    rc = KTocCreate (self, mode, npath, &params);
-    free (npath);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * CreateHardLink
- */
-rc_t KTocCreateHardLink ( KToc *self,KTime_t mtime, uint32_t access,
-                          KCreateMode mode, const char *targ,
-                          const char *link, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, link);
-    rc = KTocVCreateHardLink(self, mtime, access, mode, targ,
-			     link, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateHardLink ( KToc *self,KTime_t mtime, uint32_t access,
-			  KCreateMode mode, const char *targ,
-			  const char *link, va_list args )
-{
-#if 0
-    KTocEntryParam	params;
-    char * npath;
-    rc_t rc;
-
-
-
-    return rc;
-#else
-    KTocEntryParam	params;
-    char * npath;
-    const char * excess_path;
-    const KTocEntry * targ_entry;
-    KTocEntryType targ_type;
-    rc_t rc;
-
-    TOC_DEBUG (("Hard link:: Name: %s Link: %s Mode: %s\n",
-                link, targ, get_mode_string(mode)));
-
-    /* figure out where we are supposed to point */
-    rc = KTocResolvePathTocEntry (self, &targ_entry, targ, string_size (targ),
-                                  &targ_type, &excess_path);
-    if (rc == 0)
-    {
-        /* hard links to directories are kept as hard links
-         * while other types become true unix style links */
-        switch (targ_type)
-        {
-        case ktocentrytype_dir:
-            rc = createPath (&npath, link, args);
-            if (rc)
-                return rc;
-            params.type = ktocentrytype_hardlink;
-            params.mtime = mtime;
-            params.access = access;
-            params.u.hardlink.ref = targ_entry;
-            rc = KTocCreate (self, mode, npath, &params);
-            free (npath);
-            return rc;
-
-            /* resolve by one indirection */
-        case ktocentrytype_hardlink:
-            rc = createPath (&npath, link, args);
-            if (rc)
-                return rc;
-            params.type = ktocentrytype_hardlink;
-            params.mtime = mtime;
-            params.access = access;
-            params.u.hardlink.ref = targ_entry->u.hard_link.ref;
-            rc = KTocCreate (self, mode, npath, &params);
-            free (npath);
-            return rc;
-
-        case ktocentrytype_file:
-        case ktocentrytype_zombiefile:
-            return KTocCreateFile (self, targ_entry->u.contiguous_file.archive_offset,
-                                   targ_entry->u.contiguous_file.file_size,
-                                   mtime, access, mode, link);
-
-        case ktocentrytype_emptyfile:
-            return KTocCreateFile (self, 0, 0, mtime, access, mode, link);
-
-        case ktocentrytype_chunked:
-            return KTocCreateChunkedFile (self, targ_entry->u.chunked_file.file_size, mtime,
-                                          access, targ_entry->u.chunked_file.num_chunks,
-                                          targ_entry->u.chunked_file.chunks, mode, link);
-
-        case ktocentrytype_softlink:
-            return KTocCreateSoftLink (self, mtime, access, mode, link,
-                                       targ_entry->u.symbolic_link.link_path.addr);
-
-        default:
-        case ktocentrytype_notfound:
-            /* silent ignore? */
-            break;
-        }
-    }
-    return rc;
-#endif
-}
-
-/* ----------------------------------------------------------------------
- * CreateSoftLink
- */
-rc_t KTocCreateSoftLink ( KToc *self,KTime_t mtime, uint32_t access,
-			 KCreateMode mode, const char *targ,
-			 const char *alias, ... )
-{
-    va_list 	args;
-    rc_t	rc;
-
-    va_start (args, alias);
-    rc = KTocVCreateSoftLink (self, mtime, access, mode,
-			      targ, alias, args);
-    va_end (args);
-    return rc;
-}
-
-rc_t KTocVCreateSoftLink ( KToc *self,KTime_t mtime, uint32_t access,
-			  KCreateMode mode, const char *targ,
-			  const char *alias, va_list args )
-{
-    KTocEntryParam	params;
-    char * npath;
-    rc_t rc;
-
-    TOC_DEBUG (("Soft link:: Name: %s Link: %s Mode: %s\n",
-                alias, targ, get_mode_string(mode)));
-
-    rc = createPath (&npath, alias, args);
-    if (rc)
-	return rc;
-
-    params.type = ktocentrytype_softlink;
-    params.mtime = mtime;
-    params.access = access;
-    params.u.softlink.targ = targ;
-
-    rc = KTocCreate (self, mode, npath, &params);
-    free (npath);
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-const KTocEntry * KTocGetRoot	(const KToc * self)
-{
-    if (self == NULL)
-	return NULL;
-
-    return &self->entry;
-}
-
-rc_t KTocGetPath ( const KToc * self, const String ** ppath )
-{
-    assert (self != NULL);
-    *ppath = &self->path;
-    return 0;
-}
-
-KSRAFileAlignment KTocAlignmentGet( KToc * self )
-{
-    return self->alignment;
-}
-
-rc_t KTocAlignmentSet( KToc * self,KSRAFileAlignment align )
-{
-    if ((align != 0) && (align == ((align)&~(align-1))))
-    {
-        self->alignment = align;
-        return 0;
-    }
-    return RC (rcFS, rcToc, rcConverting, rcParam, rcInvalid);
-}
-
-
-/* const char * KTocGetRootPath (const KToc * self, size_t * len) */
-/* { */
-/*     if (self == NULL) */
-/* 	return NULL; */
-/*     *len = self->path.len; */
-/*     return &self->path.addr;; */
-/* } */
-/*****
- ***** CURRENTLY DOES NOT SUPPORT any form of crossing of
- ***** KDirectory type paths
- *****/
-rc_t KTocResolvePathTocEntry ( const KToc *self,
-                               const KTocEntry ** pentry,
-                               const char *path,	/* must be entirely in the TOC */
-                               size_t path_len,
-                               KTocEntryType * ptype,
-                               const char ** unusedpath )
-{
-    const char *  	slash;		/* points to the / following the current facet */
-    const char *  	next_facet;	/* points to the start of the current facet */
-    const char *	end;		/* points to the character after the path */
-    const KTocEntry * dentry;		/* the current entry we are at during the walk through */
-    KTocEntry * 	tentry;		/* points to a Temporary ENTRY built for comparisons */
-    union
-    {
-	const BSTNode     * b;		/* access to the BSTree Node starting the KToc entry */
-	const KTocEntry * k;		/* access to the whole of the entry */
-    }		  	fentry;		/* Found ENTRY: two ways to access to skip casts */
-    rc_t	  	rc;		/* temporary storage for the return from many calls */
-    size_t	  	facet_size;	/* length of a single facet (part of a path dir or file) */
-    size_t		path_size;	/* temporary size (shrinks as we go through the path */	
-    int		  	loopcount;	/* counter for loop limiting hardlink resolution */
-    KTocEntryType 	type = ktocentrytype_unknown;	/* type of a entry found for a facet (init to kill a warning */
-    bool		is_last_facet = false;
-    bool		is_facet_dir = false; /* if the path ends in / we know the last facet is a dir */
-    int                 outer_loopcount;
-    /* -----
-     * point to one character past the path - usually it will be a NUL but we
-     * are not making that a requirement here
-     */
-    next_facet = path;
-    path_size = path_len;
-    end = next_facet + path_size;
-    dentry = &self->entry;
-
-    /* -----
-     * look first for here references:
-     * either no path (not NULL but "") or just "."
-     */
-    if ((path_len == 0) || ((path_len == 1) && (path[0] == '.')))
-    {
-	*pentry = dentry;
-	*ptype = ktocentrytype_dir;
-	*unusedpath = end;
-	return 0;
-    }
-
-
-    /* -----
-     * now start wending our way down through subdirectories
-     */
-    for (outer_loopcount = 0; next_facet < end; ++ outer_loopcount)
-    {
-        TOC_DEBUG (("%s: stepping through subs (%d) (%s)\n", __func__, outer_loopcount, next_facet));
-
-	/* -----
-	 * look for the end of the next facet in the path
-	 */
-	slash = strchr (next_facet, '/');
-
-	/* -----
-	 * if there was no '/' found then point to the end as that is the end of the facet
-	 * but also mark that we know this is the last one (be it a directory, link or file)
-	 */
-	if (slash == NULL)			
-	{
-	    slash = end;
-	    is_last_facet = true;
-	}
-	/* -----
-	 * handle the special case of a path ending in / which also makes the last facet
-	 * known to be a directory
-	 */
-	else if (slash + 1 == end)
-	{
-	    slash = end;
-	    is_last_facet = true;
-	    is_facet_dir = true;
-	}
-	facet_size = slash - next_facet;	/* how many characters in this facet */
-
-	/* -----
-	 * build a temporary entry for comparisons
-	 */
-	rc = KTocEntryNewDirectory (&tentry, next_facet, facet_size, 0, 0555);
-	if (rc != 0)
-	{
-	    *pentry = NULL;		/* if we couldn't make then fail */
-	    return rc;
-	}
-	fentry.b = BSTreeFind (&dentry->u.dir.tree, tentry, KTocEntryCmpVoid);
-	KTocEntryDelete(tentry);	/* clean up the temporary entry */
-
-	if (fentry.b == NULL)
-	{
-	    /* -----
-	     * we failed to find this facet.
-	     */
-	    *pentry = NULL;		/* if we couldn't make it fail */
-	    *unusedpath = next_facet;	/* the name we couldn't find */
-	    *ptype = ktocentrytype_notfound;
-
-            TOC_DEBUG (("%s: couldn't find (%s)\n", __func__, next_facet));
-
-	    return RC (rcFS, rcArc, rcResolving, rcParam, rcNotFound);
-	}
-
-	loopcount = 0;
-
-	/* check the type to see if we're okay with it */
-	if ((rc = KTocEntryGetType (fentry.k, &type)) != 0)
-	{
-	    if (type == ktocentrytype_notfound)
-	    {
-		*ptype = type;
-	    }
-	    else
-	    {
-		*ptype = ktocentrytype_unknown;
-	    }
-	    *pentry = NULL;		/* if we couldn't then fail */
-	    *unusedpath = next_facet;	/* the name we couldn't find */
-	    return rc;
-	}
-	*ptype = type;
-	switch (type)
-	{
-	    /* -----
-	     * resolve a hardlink immediately 
-	     * re-resolve until we've gone too many hops or the
-	     * resolution is to something that isn't another hardlink
-	     *
-	     * re-enter this switch with the type of the resolved entry
-	     */
-	case ktocentrytype_hardlink:
-	    if (is_last_facet)
-	    {
-		*pentry = fentry.k->u.hard_link.ref;
-		*unusedpath = end;
-		/* successful arrival at the end at a directory */
-		return 0;
-	    }
-	    else
-	    {
-		/* -----
-		 * this is the only path that continues through the loop
-		 */
-		next_facet = slash + 1;	 /* point past the slash */
-		dentry = fentry.k->u.hard_link.ref; /* make the found entry our current entry */
-	    }
-	    continue;	/* back to for(;;) */
-
-	case ktocentrytype_dir:
-	    if (is_last_facet)
-	    {
-		*pentry = fentry.k;
-		*unusedpath = end;
-		/* successful arrival at the end at a directory */
-		return 0;
-	    }
-	    else
-	    {
-		/* -----
-		 * this is the only path that continues through the loop
-		 */
-		next_facet = slash + 1;	/* point past the slash */
-		dentry = fentry.k;	/* make the found entry our current entry */
-	    }
-	    continue;	/* back to for(;;) */
-
-	default:
-	    *pentry = fentry.k;
-	    *ptype = ktocentrytype_unknown;
-	    *unusedpath = next_facet;
-	    /* failure return */
-	    return RC (rcFS, rcToc, rcResolving, rcParam, rcInvalid);
-
-	case ktocentrytype_emptyfile:
-	case ktocentrytype_file:
-	case ktocentrytype_chunked:
-        case ktocentrytype_zombiefile:
-	    *pentry = fentry.k;
-
-	    /* -----
-	     * success if we are on the last facet that wasn't supposed to be a directory
-	     * failure if we are not
-	     */
-	    if (is_last_facet && (! is_facet_dir))
-	    {
-		*unusedpath = end;
-		return 0;
-	    }
-	    else
-	    {
-		*unusedpath = next_facet;
-		return RC (rcFS, rcToc, rcResolving, rcParam, rcInvalid);
-	    }
-
-	case ktocentrytype_softlink:
-	    /* -----
-	     * We got a softlink entry in the path.
-	     */
-	    *pentry = fentry.k;
-	    *unusedpath = slash;
-	    return 0;	/* This is a bit clunky but is a valid incomplete return */
-	}
-    }
-    /* should never get here */
-    return RC (rcFS, rcToc, rcResolving, rcParam, rcUnexpected);
-}
-
-/* SRA tocfile only not tar or other archives only */
-rc_t KTocResolvePathFromOffset ( const KToc *self,
-                                 const char ** path,
-                                 uint64_t * ppos,
-                                 uint64_t _offset )
-{
-    rc_t rc;
-    union u
-    {
-	const BSTNode * n;
-	const KTocEntryIndex * i;
-    } u;
-    uint64_t offset;
-    struct ugliness thisIsReallyUgly;
-
-    rc = 0;
-    offset = _offset - SraHeaderGetFileOffset (self->header);
-
-    TOC_DEBUG(("KTocResolvePathFromOffset _offset %ju offset %ju\n",
-               _offset, offset));
-
-    *path = NULL;
-    *ppos = 0;
-    thisIsReallyUgly.toc = self;
-    thisIsReallyUgly.offset = offset;
-
-    u.n =  BSTreeFind (&self->offset_index, &thisIsReallyUgly, KTocEntryIndexCmpOffset);
-    if (u.n != NULL)
-    {
-	*path = u.i->fullpath.addr;
-	*ppos = thisIsReallyUgly.foffset;
-    }
-    return rc;
-}
-
-const void * KTocGetArchive( const KToc * self )
-{
-    if (self == NULL)
-	return NULL;
-    return self->archive.v;
-}
-				
-
-
-
-typedef struct KDBHdr KDBHdr;
-
-typedef
-struct PersistFilesIndexData
-{
-    uint64_t offset;
-    const KToc * toc;
-    rc_t rc;
-} PersistFilesIndexData;
-
-LIB_EXPORT void CC PersistFilesIndex ( void * vitem, void * vdata )
-{
-    PersistFilesIndexData * data;
-    const char * path;
-
-    TOC_FUNC_ENTRY();
-
-    data = vdata;
-    if (data->rc != 0)
-    {
-        TOC_DEBUG(("PersistFilesIndex leave early %R\n", data->rc));
-	return;
-    }
-    path = (char*)vitem;
-
-    TOC_DEBUG(("PersistFilesIndex %s\n", path));
-
-    data->rc = KTocCreateEntryIndex ((KToc*)data->toc, path, &data->offset);
-}
-
-rc_t KTocPersist ( const KToc * self,
-                   void ** buffer, size_t * buffer_size,
-                   uint64_t * virtual_file_size,
-                   const Vector * files )
-{
-    rc_t rc;
-    size_t treesize;
-    KSraHeader * header;
-    uint8_t * bbuffer;
-    uint64_t filesize;
-
-    TOC_FUNC_ENTRY();
-
-    rc = 0;
-    treesize = 0;
-    bbuffer = NULL;
-    *buffer = NULL;
-    *buffer_size = 0;
-    *virtual_file_size = 0;
-
-    rc = KTocEntryPersistNodeDir (NULL, &self->entry, &treesize, NULL, NULL);
-    if (rc != 0)
-    {
-	LOGMSG (klogErr, "Failure to Persist Toc Root Entry");
-    }
-    else
-    {
-	rc = SraHeaderMake (&header, treesize, self->alignment);
-	if (header == NULL)
-	{
-	    rc = RC (rcFS, rcToc, rcPersisting, rcMemory, rcExhausted);
-	    LOGERR (klogErr, rc, "Failure to allocate buffer for header");
-	}
-	else
-	{
-            TOC_DEBUG (("KTocPersist: treesize %ju\n", treesize));
-
-	    bbuffer = realloc ( header, (size_t)SraHeaderGetFileOffset( header ) );
-	    if (bbuffer == NULL)
-	    {
-		free (header);
-		rc = RC (rcFS, rcToc, rcPersisting, rcMemory, rcExhausted);
-		LOGERR (klogErr, rc, "Failure to allocate buffer for persisted header");
-	    }
-	    else
-	    {
-		PersistFilesIndexData data; 
-
-		header = (KSraHeader*)bbuffer;
-		data.offset = 0;
-		data.toc = self;
-		data.rc = 0;
-
-		VectorForEach (files, false, PersistFilesIndex, &data);
-		filesize = SraHeaderGetFileOffset(header) + data.offset;
-		rc = data.rc;
-		if (rc == 0)
-		{
-                    KTocEntryPersistWriteFuncData wdata;
-                    wdata.buffptr = bbuffer + SraHeaderSize(NULL);
-                    wdata.limit = bbuffer + SraHeaderGetFileOffset(header);
-                    rc = KTocEntryPersistNodeDir (NULL, &self->entry, &treesize,
-                                                  KTocEntryPersistWriteFunc, 
-                                                  &wdata);
-		}
-	    }
-	}
-    }
-    if (rc == 0)
-    {
-	((KToc*)self)->header = (KSraHeader *)bbuffer;
-	*buffer = bbuffer;
-	*buffer_size = treesize + SraHeaderSize(NULL);
-	*virtual_file_size = filesize;
-	return 0;
-    }
-    else if (bbuffer != NULL)
-    {
-        TOC_DEBUG (("Free called in KTocPersist\n"));
-	free (bbuffer);
-    }
-    return rc;
-}
-
-
-/* end of file toc.c */
diff --git a/libs/kfs/tocdir.c b/libs/kfs/tocdir.c
deleted file mode 100644
index 70e2f06..0000000
--- a/libs/kfs/tocdir.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
- 
-#include <kfs/extern.h>
-#include "toc-priv.h"
-#include <klib/rc.h>
-#include <klib/defs.h>
-#include <klib/namelist.h>
-#include <kfs/directory.h>
-#include <kfs/toc.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-
-static
-rc_t KTocProcessOneNameCommonAtt (const KDirectory * dir,
-				  const char * path,
-				  KTime_t * mtime,
-				  uint32_t * access)
-{
-    rc_t rc;
-
-    *mtime = 0;
-    *access = 0;
-    rc = KDirectoryVDate (dir, mtime, path, NULL);
-    if (rc != 0)
-    {
-	PLOGERR (klogErr, (klogErr, rc, "Failure getting mtime of $(p)", PLOG_S(p), path));
-    }
-    else
-    {
-	rc = KDirectoryVAccess (dir, access, path, NULL);
-	if (rc != 0)
-	{
-	    PLOGERR (klogErr, (klogErr, rc, "Failure getting access of $(p)", PLOG_S(p), path));
-	}
-    }
-    TOC_DEBUG (("%s path %s ktime_t %lu access %o\n", __func__, path, *mtime, *access));
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KTocParseKDirRecurOnePath
- *
- * take a single path name and add it to the TOC
- *
- * KToc *			self	read/write	the TOC being built
- * const KDirectory *		dir	read		the directory owning the path
- * bool (*)(const KDirectory*,
- *          const char *,
- *          void *)		filter	read/execute	a filtering function for path inclusion
- * void *			data	read		passed in as third parameter to filter
- * const char *			name	read		the path to be added
- *
- * filter and data can be NULL
- */
-static
-rc_t KTocParseKDirRecur	(KToc * self,
-			 const KDirectory * dir,
-			 const char * path,
-			 bool (CC* filter )(const KDirectory *,const char *, void*),
-			 void *  data);
-             
-static
-rc_t KTocParseKDirRecurOnePath (KToc * self,
-				   const KDirectory * dir,
-				   const char * path,
-				   bool (CC* filter )(const KDirectory *,const char *, void*),
-				   void *  data)
-{
-    rc_t rc;
-    KPathType type;
-    KTime_t mtime;
-    uint32_t access;
-    uint64_t size;
-
-    assert (self != NULL);
-    assert (dir != NULL);
-    assert (path != NULL);
-
-    TOC_DEBUG (("%s: recur path for %s\n", __func__, path));
-
-    type = (KPathType)KDirectoryPathType (dir, path);
-
-    if (type & kptAlias)
-    {
-	size = 0;
-	rc = KTocProcessOneNameCommonAtt (dir, path, &mtime, &access);
-	if (rc == 0)
-	{
-	    char * res;
-	    char * tres;
-	    size_t res_sz;
-
-	    res = NULL;
-	    rc = RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-	    for (res_sz = 128; 
-		 rc == RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-		 res_sz <<= 1)
-	    {
-		tres = realloc (res, res_sz);
-		if (tres == NULL)
-		{
-		    if (res != NULL)
-			free (res);
-		    return RC (rcFS, rcToc, rcParsing, rcMemory, rcExhausted);
-		}
-		res = tres;
-    		rc = KDirectoryVResolveAlias (dir, false, res, res_sz, path, NULL);
-	    }
-	    if (rc != 0)
-	    {
-		PLOGERR (klogWarn, (klogWarn, rc, "Failure getting alias target of $(p)", PLOG_S(p), path));
-	    }
-	    else
-	    {
-		rc = KTocCreateSoftLink (self, mtime, access, kcmCreate, res, path);
-	    }
-	    if (res != NULL)
-		free (res);
-	}
-    }
-    else
-    {
-	switch (type)
-	{
-	default:
-	    /* -----
-	     * fail on anything we don't understand
-	     */
-	    rc = RC (rcFS, rcToc, rcConstructing, rcToc, rcUnexpected);
-	    PLOGERR (klogInt, (klogInt, rc, "Failure getting type for $(p)", PLOG_S(p), path));
-	    break;
-	case kptCharDev:
-	case kptBlockDev:
-	case kptFIFO:
-	    /* -----
-	     * silently drop all devices and fifo/queues
-	     */
-	    rc = 0;
-	    break;
-	case kptFile:
-		/* TBD: add support here for chunked files and for hard links
-		 *
-		 * use lstat (not stat) to see if there are more than one link.  
-		 * if so then this inode will end up in a bstree of possible doubly
-		 * linked files.  first time we find it put in in the toc as a file,
-		 * while on subsequent times put it in as a hardlink
-		 *
-		 * Don't know how to detect sparse files yet (other than this from wikipedia)
-		 *
-		 * http://en.wikipedia.org/wiki/Sparse_files#Detecting_sparse_files_in_Unix
-		 * Sparse files have different apparent and actual file sizes. This can be
-		 * detected by comparing the output of:
-		 *
-		 *	du -s -B1 --apparent-size sparse-file
-		 *
-		 * and:
-		 *
-		 *	du -s -B1 sparse-file
-		 *
-		 */
-	    rc = KDirectoryVFileSize (dir, &size, path, NULL);
-	    if (rc != 0)
-	    {
-		PLOGERR (klogErr, (klogErr, rc, "Failure getting size of $(p)", PLOG_S(p), path));
-	    }
-	    else
-	    {
-		rc = KTocProcessOneNameCommonAtt (dir, path, &mtime, &access);
-		if (rc == 0)
-		{
-/* eventually we can choose to check for a compression */
-		    rc = KTocCreateFile (self, 0/*place holder*/, size, mtime, 
-                                          access, kcmCreate, path);
-		}
-	    }
-	    break;
-	case kptDir:
-	    size = 0;
-	    rc = KTocProcessOneNameCommonAtt (dir, path, &mtime, &access);
-	    if (rc == 0)
-	    {
-		rc = KTocCreateDir (self, mtime, access, kcmCreate, path);
-		if (rc == 0)
-		{
-		    rc = KTocParseKDirRecur (self, dir, path, filter, data);
-		}
-	    }
-	    break;
-	} /* switch (type) */
-    } /* if (type & kptAlias) ... else ... */
-    return rc;
-}
-
-
-static
-rc_t KTocParseKDirRecur	(KToc * self,
-			 const KDirectory * dir,
-			 const char * path,
-			 bool (CC* filter )(const KDirectory *,const char *, void*),
-			 void *  data)
-{
-    rc_t rc;
-    KNamelist * names;
-
-    assert (self != NULL);
-    assert (dir != NULL);
-    assert (path != NULL);
-
-    TOC_DEBUG (("%s: recur path for %s\n", __func__, path));
-
-    /* -----
-     * get a list of files in this directory
-     */
-    rc = KDirectoryVList (dir, &names, NULL, NULL, path, NULL);
-    if (rc != 0)
-    {
-	LOGERR (klogErr, rc, "Failure to build a name list");
-    }
-    else
-    {
-	/* -----
-	 * get the length of the list
-	 */
-	uint32_t limit;
-
-	rc = KNamelistCount (names, &limit);
-	if (rc != 0)
-	{
-	    LOGERR (klogErr, rc, "Failure to count elements of a name list");
-	}
-	else
-	{
-	    /* -----
-	     * loop through the list
-	     */
-	    uint32_t idx;
-	    size_t pathlen;
-
-            TOC_DEBUG (("%s KNamelistCount counted %u\n", __func__, limit));
-	    pathlen = strlen (path);
-
-	    for (idx = 0; idx < limit; ++idx)
-	    {
-		/* -----
-		 * get the nth path name from the list
-		 */
-		const char * name;
-
-		rc = KNamelistGet (names, idx, &name);
-		if (rc != 0)
-		{
-		    LOGERR (klogErr, rc, "Failure to pull name from name list");
-		}
-		else
-		{
-		    char * new_path;
-		    size_t namelen;
-		    size_t new_pathlen;
-
-                    TOC_DEBUG(("%s KNamelistCount  %s\n", __func__, name));
-            
-		    namelen = strlen (name);
-		    /* length of previous path + '/' + length of name */
-		    new_pathlen = pathlen + 1 + namelen;
-		    new_path = malloc (new_pathlen + 1);  /* + NUL */
-
-		    if (new_path == NULL)
-		    {
-			rc = RC (rcFS, rcToc, rcConstructing, rcMemory, rcExhausted);
-			LOGERR (klogErr, rc, "out of memory building paths for TOC");
-		    }
-		    else
-		    {
-			bool use_name;
-			char * recur_path;
-                        size_t recur_path_z;
-
-			memcpy (new_path, path, pathlen);
-			new_path[pathlen] = '/';
-			memcpy (new_path + pathlen + 1, name, namelen);
-			new_path[pathlen+1+namelen] = '\0';
-
-#if 1
-                        recur_path_z = pathlen + 1 + namelen + 1;
-#else
-                        recur_path_z = 4096;
-#endif
- 			recur_path = malloc (recur_path_z);
-			if (recur_path == NULL)
-			{
-			    rc = RC (rcFS, rcToc, rcConstructing, rcMemory, rcExhausted);
-			    LOGERR (klogErr, rc, "out of memory building paths for TOC");
-			}
-			else
-			{
-			    rc = KDirectoryResolvePath (dir, false, recur_path, recur_path_z,
-							 new_path);
-                            TOC_DEBUG (("%s: resolved path %s for %s\n", __func__, recur_path, new_path));
-                            TOC_DEBUG (("%s: filter %p\n", __func__, filter));
-			    if (rc == 0)
-			    {
-				if (filter != NULL)
-				{
-				    use_name = filter (dir, recur_path, data);
-				}
-				else
-				    use_name = true;
-
-				if (use_name)
-				{
-                                    TOC_DEBUG (("%s: use_name true for %s\n", __func__, recur_path));
-				    rc = KTocParseKDirRecurOnePath (self, dir, recur_path, filter, data);
-				    if (rc != 0)
-				    {
-					PLOGERR (klogErr, (klogErr, rc, "Failure to process name from name list $(p)",
-                                                           PLOG_S(p), name));
-				    }
-				}
-			    }
-			    free (recur_path);
-			}
-			free (new_path);
-		    }
-		}
-		if (rc != 0)
-		    break;
-	    } /* for (idx = 0; idx < limit; ++idx) */
-	}
-	KNamelistRelease (names);
-    }
-    return rc;
-}
-
-/* ======================================================================
- * KTocParseKDir
- *
- * This matches the standard signature for creating a KToc with a
- * KDirectory (any implementation including another KArcDir) as the
- * source to parse.
- *
- * Filter is a reference to a function that given a directory, a path
- * as a char ASCIZ string and a pointer to some form of data probably 
- * a struct will return 0 for do not include and 1 for include that
- * path in the TOC.
- *
- * Filter can be NULL and no filtering function will be called.
- * Data can be NULL is there is no Filter that expects it to b non-null.
- */
-LIB_EXPORT rc_t CC KArcParseKDir ( KToc * self,
-                                   const void * kvoid,
-                                   bool(CC*filter)(const KDirectory*,const char *, void*),
-                                   void * data )
-{
-    const KDirectory * kdir;
-    rc_t rc;
-
-    kdir = kvoid;
-    rc = 0;
-
-    if (self == NULL)
-    {
-	rc = RC (rcFS, rcArc, rcParsing, rcSelf, rcNull);;
-	LOGERR (klogErr, rc, "KTocParseKDir: self was NULL");
-    }
-    else if (kdir == NULL)
-    {
-	rc = RC (rcFS, rcArc, rcParsing, rcParam, rcNull);;
-	LOGERR (klogErr, rc, "KTocParseKDir: kdir was NULL");
-    }
-    else
-    {
-        TOC_DEBUG (("Start Parse\n"));
-	rc = KTocParseKDirRecur (self, kdir, ".", filter, data);
-    }
-    return rc;
-}
-
-/* end of file */
diff --git a/libs/kfs/tocentry.c b/libs/kfs/tocentry.c
deleted file mode 100644
index b2de16b..0000000
--- a/libs/kfs/tocentry.c
+++ /dev/null
@@ -1,1748 +0,0 @@
-/*===========================================================================
- *
- *                            Public DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <atomic32.h>
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/pbstree.h>
-#include <klib/text.h>
-#include <kfs/arc.h>
-#include <kfs/toc.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/sort.h>
-#include <sysalloc.h>
-
-#include "toc-priv.h"
-
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <byteswap.h>
-
-
-/* ======================================================================
- * KTocEntry
- *
- * A private class used to keep track of a single entry (
- */
-
-
-/* ======================================================================
- * KTocEntry method
- *
- * This class is not set up with a vtable at this point.  This API exposes
- * (due to the nature of using a c struct as a class) much of it's opaque 
- * elements by providing accessor functions to most of them.  Since they 
- * are static in this file they are expected to be used only by a class 
- * that is like a C++ friend class by being implemented in the same 
- * compilation unit.
- */
-
-/* NOTE data is not used but required to match the signature for a pointer to function */
-void CC KTocEntryWhack ( BSTNode * n, void * data )
-{
-    KTocEntry * p = (KTocEntry*)n;
-    /**(rc_t*)data = */ KTocEntryDelete (p);
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryDelete
- * [INOUT] self the entry to delete
- */
-rc_t KTocEntryDelete ( KTocEntry * self )
-{
-    /* defensive programming ensure minimally valid pointer */
-    if (self == NULL)
-    {
-        return 0;
-/* 	return RC (rcFS, rcToc, rcConstructing, rcSelf, rcNull); */
-    }
-
-    switch (self->type)
-    {
-    case ktocentrytype_unknown:
-    case ktocentrytype_file:
-    case ktocentrytype_chunked:
-    case ktocentrytype_softlink:
-    case ktocentrytype_hardlink:
-    case ktocentrytype_zombiefile:
-    default:
-	/* -----
-	 * at this point in the implementation there is nothing we need to
-	 * do with these entry types except free their "self" allocated memory.
-	 *
-	 * Used a switch in case we did for one or more of these.
-	 */
-	break;
-    case ktocentrytype_dir:
-	/* -----
-	 * directories have a BSTree below them that need to be 
-	 * deleted first
-	 */
-	BSTreeWhack (&self->u.dir.tree, KTocEntryWhack, NULL);
-	break;
-    }
-    free (self);
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryCmp2
- *
- * [RET] int					>0: if n > p
- *						0:  if n == p
- *						<0: if n < p
- * [IN]  const BSTNode * 	n		where the pointer to a node matching the key is put
- * [IN]  const BSTNode * 	p		where the pointer to a node matching the key is put
- * This function fits the function signature needed for BSTreeInsert
- *
- * can not inline or make into a macro as it is referenced via a pointer
- */
-int CC KTocEntryCmp2 ( const BSTNode * n, const BSTNode * p )
-{
-
-    KTocEntry * nn;
-    KTocEntry * pp;
-    int		  ii;
-
-    nn = (KTocEntry *)n;
-    pp =  (KTocEntry *)p;
-    ii = StringCompare (&nn->name, &pp->name);
-    return ii;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryCmpVoid
- *
- * [RET] int					>0: if n > p
- *						0:  if n == p
- *						<0: if n < p
- * [IN]  const void * 		item		'key' to find a matching bject in the BSTree
- * [OUT] const BSTNode *	node		where the pointer to a node matching the key is put
- * This function fits the function signature needed for BSTreeFind
- *
- * can not inline or make into a macro as it is referenced via a pointer
- */
-int CC KTocEntryCmpVoid ( const void * item, const BSTNode * node )
-{
-    const BSTNode * _item = item;
-    return KTocEntryCmp2 (_item, node);
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNew
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry ** 	new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char * 		name		name of the entry (file, link, directory...)
- *						(not assumed to be ASCIZ)
- * [IN]  size_t			name_size	length of name
- * [IN]  uint32_t 		access		unix/posix style permission flags
- * [IN]  size_t 		entry_specific	specific initialyers by entry type
- */
-static
-rc_t		KTocEntryNew		(KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 size_t entry_specific)
-{
-    KTocEntry * entry;
-    size_t	  nsize;
-    char *	  namep;
-
-    nsize = entry_specific + name_size + 1; /* we want a NUL at end of name */
-
-    entry = malloc (nsize);
-    if (entry == NULL)
-    {
-	LOGMSG (klogErr,
-		"Failed to allocate for a TOC File entry");
-	return RC (rcFS, rcToc, rcAllocating, rcMemory, rcInsufficient);
-    }
-
-    /* entry->entry is fine left as undefined */
-    namep =(char*)entry + entry_specific;
-    string_copy (namep, name_size+1, name, name_size);
-    StringInit (&(entry->name), namep, name_size, (uint32_t)name_size);
-
-    entry->mtime = mtime;
-    entry->access = access;
-
-    *new_entry = entry;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewFile
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry **		new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char *		name		name of the file (not path) (not assumed to be ASCIZ)
- * [IN]  size_t 		name_size	length of name
- * [IN]  uint32_t 		access		unix/posix style permission flags
- * [IN]  uint64_t		offset		starting offset within the archive file of this file
- * [IN]  uint64_t 		size		number of bytes in the file
- */
-rc_t KTocEntryNewFile ( KTocEntry ** new_entry,
-                        const char * name,
-                        size_t name_size,
-                        KTime_t mtime,
-                        uint32_t access,
-                        uint64_t offset,
-                        uint64_t size )
-{
-    rc_t	rc;
-
-    TOC_SORT (("%s: %s %lu %u\n", __func__, name, mtime, access));
-
-    rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-		       sizeof(KTocEntry) 
-		       - sizeof(union KTocEntryUnion)
-		       + sizeof(struct KTocEntryFile));
-
-    if (rc)
-	return rc;
-
-    if (size == 0)
-        (*new_entry)->type = ktocentrytype_emptyfile;
-
-    else
-    {
-        (*new_entry)->type = ktocentrytype_file;
-
-        (*new_entry)->u.contiguous_file.archive_offset = offset;
-        (*new_entry)->u.contiguous_file.file_size = size;
-    }
-
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewZombieFile
- *
- * A zombie file is a file whose directory is in the archive but whose 
- * storage is not
- *
- * [RET] rc_t					0 for success; anything else
- *						for a failure
- *                                              see itf/klib/rc.h for general
- *                                              details
- * [OUT] KTocEntry **		new_entry	where to put a pointer to the
- *                                              new TOC Entry
- * [IN]  const char *		name		name of the file (not path)
- *                                              (not assumed to be ASCIZ)
- * [IN]  size_t 		name_size	length of name
- * [IN]  uint32_t 		access		unix/posix style permission
- *                                              flags
- * [IN]  uint64_t		offset		starting offset within the
- *                                              archive file of this file
- * [IN]  uint64_t 		size		number of bytes in the file
- */
-rc_t KTocEntryNewZombieFile ( KTocEntry ** new_entry,
-                              const char * name,
-                              size_t name_size,
-                              KTime_t mtime,
-                              uint32_t access,
-                              uint64_t offset,
-                              uint64_t size )
-{
-    rc_t	rc;
-    
-/*     TOC_DEBUG (("%s: %s %lu\n", __func__, name, mtime)); */
-
-    rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-		       sizeof(KTocEntry) 
-		       - sizeof(union KTocEntryUnion)
-		       + sizeof(struct KTocEntryFile));
-
-    if (rc)
-	return rc;
-
-    if (size == 0)
-        (*new_entry)->type = ktocentrytype_emptyfile;
-
-    else
-    {
-        (*new_entry)->type = ktocentrytype_zombiefile;
-
-        (*new_entry)->u.contiguous_file.archive_offset = offset;
-        (*new_entry)->u.contiguous_file.file_size = size;
-    }
-
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewChunked
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry **		new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char *		name		name of the file (not path) (not assumed to be ASCIZ)
- * [IN]  size_t			name_size	length of name
- * [IN]  uint32_t		access		unix/posix style permission flags
- * [IN]  uint64_t 		size		virtual number of bytes in the file: not actual
- *						number of stored bytes
- * [IN]  const KTocChunk * 	chunks		pointer to an array of chunk structures	
- * [IN]  uint32_t 		num_chunks	number of chunks in the array above
- */
-static
-int CC chunkcmp (const void * a, const void * b, void * ignored)
-{
-    const KTocChunk *A = a;
-    const KTocChunk *B = b;
-    /* -----
-     * We can't rely on a cast down to int not getting messed up 
-     * by overflow nor even on uint64_t - uint64_t not overflowing int64_t
-     */
-    if (A->logical_position == B->logical_position)
-	return 0;
-    else if (A->logical_position > B->logical_position)
-	return 1;
-    else
-	return -1;
-}
-
-rc_t KTocEntryNewChunked ( KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 uint64_t size,
-					 const KTocChunk * chunks,
-					 uint32_t num_chunks )
-{
-    rc_t	rc;
-    KTocChunk * chunkp;
-    size_t	nsize;
-    size_t	csize;
-
-    /* -----
-     * This is a bit ugly...
-     *
-     * first (Compile time optimizations does much of the heavy lifting) figure out how
-     * much is the extra malloc amount
-     *
-     * Take size of a generic entry - the size of the union part but add back the size of
-     * the chunked file part
-     *
-     * Add to that the size of a 64 bit integer.  This is 8 bytes extra from what is
-     * needed by the header alone.
-     * 
-     * Mask that against the binary bit inverse of 1 less tha the size of a 64 bit integer.
-     *
-     * Now you have the size of the header plus the number of bytes needed to get to a 8
-     * byte address 0.  This is possibly more than is needed as 8 byte quantities could be
-     * read from 4 byte boundaries in many cases.
-     *
-     * Then add to that the size in bytes of the chunked data (all 64 bit numbers).
-     */
-    nsize = ~( ( size_t ) sizeof(uint64_t)-1) & 
-	(sizeof(KTocEntry)
-	 - sizeof(union KTocEntryUnion)
-	 + sizeof(struct KTocEntryChunkFile)
-	 + sizeof(uint64_t));
-    csize = sizeof(KTocChunk) * num_chunks;
-
-    if ((rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-			    nsize + csize))
-	!= 0)
-    {
-	return rc;
-    }
-
-    chunkp = (KTocChunk*)((char*)*new_entry + nsize);
-    (*new_entry)->type = ktocentrytype_chunked;
-    (*new_entry)->u.chunked_file.file_size = size;
-    (*new_entry)->u.chunked_file.chunks = chunkp;
-    (*new_entry)->u.chunked_file.num_chunks = num_chunks;
-    memcpy(chunkp, chunks, csize);
-    ksort (chunkp, num_chunks, sizeof(KTocChunk), chunkcmp, NULL);
-    /* -----
-     * TODO: We currently do no validation of the chunks.
-     * We accept that after the sort (which is probably superfluous)
-     * that for each chunk 
-     *
-     *	chunkp[N].logical_position + chunkp[N].size <= chunkp[N+1].logical_position
-     *
-     * We should probably verify this.
-     */
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewSoft
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry **		new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char * 		name		name of the file (not path) (not assumed to be ASCIZ)
- * [IN]  size_t 		name_size	length of name
- * [IN]  uint32_t		access		unix/posix style permission flags
- * [IN]  const char * 		link		character array (string) holding the name of the
- *						links target (not assumed to be ASCIZ)
- * [IN]  size_t 		link_size	length of the target string
- * Link is run time resolved
- */
-rc_t KTocEntryNewSoft ( KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access,
-					 const char * link,
-					 size_t link_size )
-{
-    rc_t	rc;
-    char *	linkp;
-
-    rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-		       (sizeof(KTocEntry)
-			- sizeof(union KTocEntryUnion))
-		       + sizeof(struct KTocEntrySoftLink) + link_size + 1);
-    if (rc != 0)
-    {
-	return rc;
-    }
-    (*new_entry)->type = ktocentrytype_softlink;
-    linkp =(char*)(*new_entry) + sizeof(KTocEntry) - sizeof(union KTocEntryUnion)
-	+ sizeof(struct KTocEntrySoftLink);
-    string_copy (linkp, link_size+1, link, link_size);
-    StringInit ( &((*new_entry)->u.symbolic_link.link_path), linkp, link_size, (uint32_t)link_size );
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewHard
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry ** 	new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char * 		name		name of the file (not path) (not assumed to be ASCIZ)
- * [IN]  size_t			name_size	length of name
- * [IN]  uint32_t		access		unix/posix style permission flags
- * Resolution of the link is not set up in this function
- */
-rc_t KTocEntryNewHard ( KTocEntry ** new_entry,
-                        const char * name,
-                        size_t name_size,
-                        KTime_t mtime,
-                        uint32_t access,
-                        const KTocEntry * targ )
-{
-    rc_t	rc;
-
-    if ((rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-			    sizeof(KTocEntry)
-			    - sizeof(union KTocEntryUnion)
-			    + sizeof(struct KTocEntryHardLink)))
-	!= 0)
-    {
-	return rc;
-    }
-    (*new_entry)->type = ktocentrytype_hardlink;
-    (*new_entry)->u.hard_link.ref = targ;
-
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * KTocEntryNewDirectory
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [OUT] KTocEntry **		new_entry	where to put a pointer to the new TOC Entry
- * [IN]  const char *		name		name of the directory (not assumed to be ASCIZ)
- * [IN]  size_t			name_size	length of name
- * [IN]  uint32_t		access		unix/posix style permission flags
- */
-rc_t KTocEntryNewDirectory ( KTocEntry ** new_entry,
-					 const char * name,
-					 size_t name_size,
-					 KTime_t mtime,
-					 uint32_t access )
-{
-    rc_t	rc;
-
-    /* -----
-     * get rid of trailing '/' characters in a file name
-     */
-    while (name[name_size-1] == '/')
-	--name_size;
-
-    if ((rc = KTocEntryNew (new_entry, name, name_size, mtime, access, 
-			    sizeof(KTocEntry)
-			    - sizeof(union KTocEntryUnion)
-			    + sizeof(struct KTocEntryDir)))
-	!= 0)
-    {
-	return rc;
-    }
-    (*new_entry)->type = ktocentrytype_dir;
-    BSTreeInit(&(*new_entry)->u.dir.tree);	/* start with an empty tree */
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetTime ( const KTocEntry *self, KTime_t *mtime )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    *mtime = self->mtime;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetAccess ( const KTocEntry *self, uint32_t *access )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    *access = self->access;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetType ( const KTocEntry *self, KTocEntryType* type )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    *type = self->type;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetFileSize ( const KTocEntry * self, uint64_t * size )
-{
-    int	loopcount;
-    const KTocEntry * target;
-
-    assert (self != NULL);
-    assert (size != NULL);
-
-    *size = 0;
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-	switch (self->type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-
-	case ktocentrytype_dir:
-	    return RC (rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect);
-
-	case ktocentrytype_file:
-	    *size = self->u.contiguous_file.file_size;
-	    return 0;
-
-	case ktocentrytype_chunked:
-	    *size = self->u.chunked_file.file_size;
-	    return 0;
-
-	case ktocentrytype_zombiefile:
-	    *size = self->u.zombie_file.file_size;
-	    return 0;
-
-	case ktocentrytype_softlink:
-	    /* architect called for KArcDir to handle symbolic link resolution */
-	    return RC (rcFS, rcFile, rcAliasing, rcLink, rcNoErr);
-
-	case ktocentrytype_hardlink:
-	    if (KTocEntryGetHardTarget(self, &target) != 0)
-		return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-	    /* this breaks "object oriented rules" but lets us loop instead of recur */
-	    self = target; /* catch bad returns at reiteration of switch */
-	    /* only non-terminal path within the loop */
-	    break;
-
-        case ktocentrytype_emptyfile:
-	    *size = 0;
-	    return 0;
-
-	}
-    }
-    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-}
-
-rc_t KTocEntryGetFilePhysicalSize ( const KTocEntry * self, uint64_t * size )
-{
-    int	loopcount;
-    const KTocEntry * target;
-
-    assert (self != NULL);
-    assert (size != NULL);
-
-    *size = 0;
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-	switch (self->type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-
-	case ktocentrytype_dir:
-	    return RC (rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect);
-
-	case ktocentrytype_file:
-	    *size = self->u.contiguous_file.file_size;
-	    return 0;
-
-	case ktocentrytype_chunked:
-        {
-            uint64_t size_;
-            uint32_t ix;
-            for (size_ = 0, ix = 0; ix < self->u.chunked_file.num_chunks; ++ix)
-                size_ += self->u.chunked_file.chunks[ix].size;
-            *size = size_;
-	    return 0;
-        }
-	case ktocentrytype_zombiefile:
-	    *size = self->u.zombie_file.file_size;
-	    return 0;
-
-	case ktocentrytype_softlink:
-	    /* architect called for KArcDir to handle symbolic link resolution */
-	    return RC (rcFS, rcFile, rcAliasing, rcLink, rcNoErr);
-
-	case ktocentrytype_hardlink:
-	    if (KTocEntryGetHardTarget(self, &target) != 0)
-		return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-	    /* this breaks "object oriented rules" but lets us loop instead of recur */
-	    self = target; /* catch bad returns at reiteration of switch */
-	    /* only non-terminal path within the loop */
-	    break;
-
-        case ktocentrytype_emptyfile:
-	    *size = 0;
-	    return 0;
-
-	}
-    }
-    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetFileLocator ( const KTocEntry * self, uint64_t * locator )
-{
-    int	loopcount;
-    const KTocEntry * target;
-
-    assert (self != NULL);
-    assert (locator != NULL);
-
-    *locator = 0;
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-	switch (self->type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-
-	case ktocentrytype_dir:
-	    return RC (rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect);
-
-	case ktocentrytype_file:
-	case ktocentrytype_zombiefile:
-	    *locator = self->u.contiguous_file.archive_offset;
-	    return 0;
-	case ktocentrytype_chunked:
-        {
-            /* find lowest offset chunk */
-            if (self->u.chunked_file.num_chunks > 0)
-            {
-                uint64_t loc;
-                int ix;
-
-                *locator = self->u.chunked_file.chunks[0].source_position;
-                for (ix = 1; ix < self->u.chunked_file.num_chunks; ++ix)
-                {
-                    loc = self->u.chunked_file.chunks[ix].source_position;
-                    if (loc < *locator)
-                        *locator = loc;
-                }
-            }
-            else
-                *locator = 0;
-
-	    return 0;
-        }
-	case ktocentrytype_softlink:
-	    /* architect called for KArcDir to handle symbolic link resolution */
-	    return RC (rcFS, rcFile, rcAliasing, rcLink, rcNoErr);
-
-	case ktocentrytype_hardlink:
-	    if (KTocEntryGetHardTarget(self, &target) != 0)
-		return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-	    /* this breaks "object oriented rules" but lets us loop instead of recur */
-	    self = target; /* catch bad returns at reiteration of switch */
-	    /* only non-terminal path within the loop */
-	    break;
-
-        case ktocentrytype_emptyfile:
-	    *locator = 0;
-	    return 0;
-
-	}
-    }
-    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetChunks ( const KTocEntry * self,
-                          uint32_t * num_chunks,
-                          const KTocChunk ** chunks )
-{
-    int	loopcount;
-    const KTocEntry * target;
-
-    *chunks = NULL;
-    *num_chunks = 0;
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-	switch (self->type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-
-	case ktocentrytype_dir:
-	case ktocentrytype_file:
-	    return RC (rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect);
-
-	case ktocentrytype_chunked:
-	    *chunks = self->u.chunked_file.chunks;
-	    *num_chunks = self->u.chunked_file.num_chunks;
-	    return 0;
-
-	case ktocentrytype_softlink:
-	    /* architect called for KArcDir to handle symbolic link resolution */
-	    return RC (rcFS, rcFile, rcAliasing, rcLink, rcNoErr);
-
-	case ktocentrytype_hardlink:
-	    if (KTocEntryGetHardTarget(self, &target) != 0)
-		return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-	    /* this breaks "object oriented rules" but lets us loop instead of recur */
-	    self = target; /* catch bad returns at reiteration of switch */
-	    /* only non-terminal path within the loop */
-	    break;
-	}
-    }
-    return RC (rcFS, rcFile, rcAccessing, rcFile, rcInvalid);
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetFileOffset ( const KTocEntry * self, uint64_t * offset )
-{
-    int			loopcount;
-    const KTocEntry * target;
-
-    *offset = 0;
-
-    for (loopcount = 0; loopcount < KARC_LINK_RESOLVE_LOOPMAX; ++loopcount)
-    {
-	switch (self->type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    return RC (rcFS, rcTocEntry, rcAccessing, rcFile, rcUnknown);
-
-	case ktocentrytype_dir:
-	case ktocentrytype_chunked:
-	    return RC (rcFS, rcTocEntry, rcAccessing, rcSelf, rcUnsupported);
-
-	case ktocentrytype_file:
-	    *offset = self->u.contiguous_file.archive_offset;
-	    return 0;
-
-        case ktocentrytype_emptyfile:
-	    *offset = 0;
-	    return 0;
-
-	case ktocentrytype_softlink:
-	    /* architect called for KArcDir to handle symbolic link resolution */
-	    return RC (rcFS, rcTocEntry, rcAliasing, rcLink, rcNoErr);
-
-	case ktocentrytype_hardlink:
-	    if (KTocEntryGetHardTarget(self, &target) != 0)
-		return RC (rcFS, rcTocEntry, rcAccessing, rcSelf, rcInvalid);
-
-	    /* this breaks "object oriented rules" but lets us loop instead of recur */
-	    self = target; /* catch bad returns at reiteration of switch */
-	    /* only non-terminal path within the loop */
-	    break;
-	}
-    }
-    return RC (rcFS, rcToc, rcAccessing, rcSelf, rcInvalid);	/* loop fail - too many hard links */
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetBSTree ( const KTocEntry * self,const BSTree ** ptree )
-{
-    KTocEntryType	type;
-
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    if (KTocEntryGetType(self,&type) != 0)
-    {
-	return RC  (rcFS, rcToc, rcAccessing, rcParam, rcInvalid);
-    }
-    if (type != ktocentrytype_dir)
-    {
-	return RC  (rcFS, rcToc, rcAccessing, rcParam, rcInvalid);
-    }
-    *ptree = &self->u.dir.tree;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetHardTarget ( const KTocEntry *self, const KTocEntry ** target )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    if (target == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcParam, rcNull);
-    }
-    *target = (self->type == ktocentrytype_hardlink) ? self->u.hard_link.ref : NULL;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetSoftTarget ( const KTocEntry *self,
-				const char ** target )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    if (self->type != ktocentrytype_softlink)
-    {
-	return RC  (rcFS, rcToc, rcAccessing, rcSelf, rcInvalid);
-    }
-    *target = self->u.symbolic_link.link_path.addr;
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- *
- */
-rc_t KTocEntryGetName ( const KTocEntry *self,
-			  const char ** name )
-{
-    if (self == NULL)
-    {
-	return RC (rcFS, rcToc, rcAccessing, rcSelf, rcNull);
-    }
-    *name = self->name.addr;
-    return 0;
-}
-
-/* ======================================================================
- */
-const char * KTocEntryTypeGetString(KTocEntryType t)
-{
-    static const char * entryTypeString[] = 
-	{
-	    "ktocentrytype_unknown",
-	    "ktocentrytype_notfound",
-	    "ktocentrytype_dir",
-	    "ktocentrytype_file",
-	    "ktocentrytype_chunked",
-	    "ktocentrytype_softlink",
-	    "ktocentrytype_hardlink",
-	    "ktocentrytype_emptyfile" 
-	};
-
-    switch (t)
-    {
-    case ktocentrytype_unknown:
-    case ktocentrytype_dir:
-    case ktocentrytype_file:
-    case ktocentrytype_chunked:
-    case ktocentrytype_softlink:
-    case ktocentrytype_hardlink:
-    case ktocentrytype_emptyfile:
-	return entryTypeString[t+1];
-    default:
-	return "ktocentrytype_error";
-    }
-}
-
-/*
- * preferred behavior of this needs to be determined
- */
-LIB_EXPORT rc_t CC KTocEntryPersistWriteFunc ( void * param,
-                                               const void * buffer,
-                                               size_t size,
-                                               size_t * num_writ )
-{
-    KTocEntryPersistWriteFuncData * data;
-    rc_t rc;
-    size_t to_write;
-
-    assert (param != NULL);
-    assert (buffer != NULL);
-    assert (num_writ != NULL);
-
-    rc = 0;
-    *num_writ = 0;
-    data = param;
-    if (size != 0)
-    {
-	if ((data->buffptr + size) > data->limit)
-	{
-	    to_write = data->limit - data->buffptr;
-	    rc = RC (rcFS, rcTocEntry, rcPersisting, rcBuffer, rcTooShort);
-	}
-	else
-	    to_write = size;
-	memcpy (data->buffptr, buffer, to_write);
-	data->buffptr += to_write;
-	*num_writ = to_write;
-#if 0
-	{
-	    size_t ix;
-
-	    for (ix = 0; ix < to_write; ix ++)
-	    {
-/* please do not delete commented out code */
-/* 		if ((ix & 0xF) == 0x0) */
-/* 		    printf ("%.08x : ", ix); */
-/* 		printf( "%.02x ", ((uint8_t*)buffer)[ix]); */
-
-/* 		if ((ix & 0xF) == 0xF) */
-/* 		    printf ("\n"); */
-	    }
-/*  	    printf ("\n"); */
-	}
-#endif
-    }
-    return rc;
-}
-
-
-static
-rc_t KTocEntryPersistNodeCommon (void * param, const KTocEntry * n,
-				 size_t * num_writ, PTWriteFunc write,
-				 void * write_param)
-{
-    size_t all_written;
-    size_t written;
-    uint16_t nsize;
-    const char * name;
-    rc_t rc;
-    KTocEntryType t;
-    uint8_t b;
-    KTime_t mtime;
-    uint32_t access;
-
-    rc = KTocEntryGetName (n, &name);
-    if (rc != 0)
-	return rc;
-    TOC_DEBUG (("%s %s\n", __func__, name));
-    if (write)
-    {
-
-/* please do not delete commented out code */
-/* 	printf ("----------\n"); */
-	nsize = (uint16_t)strlen(name);
-	rc = KTocEntryGetTime (n, &mtime);
-	if (rc != 0)
-	    return rc;
-	rc = KTocEntryGetAccess (n, &access);
-	if (rc != 0)
-	    return rc;
-	rc = KTocEntryGetType (n, &t);
-	if (rc != 0)
-	    return rc;
-	b = (uint8_t)t;
-/* 	printf ("name size\t"); */
-	rc = (*write) (write_param, &nsize, sizeof nsize, &all_written);
-	if (rc == 0)
-	{
-/* 	    printf("name %s\t", name); */
-	    rc = (*write) (write_param, name, nsize, &written);
-	    all_written += written;
-	    if (rc == 0)
-	    {
-/* 		printf("mtime\t"); */
-		rc = (*write) (write_param, &mtime, sizeof mtime, &written);
-		all_written += written;
-		if (rc == 0)
-		{
-/* 		    printf("access\t"); */
-		    rc = (*write) (write_param, &access, sizeof access, &written);
-		    all_written += written;
-		    if (rc == 0)
-		    {
-/* 			printf("type\t"); */
-			rc = (*write) (write_param, &b, sizeof b, &written);
-			all_written += written;
-		    }
-		}
-	    }
-	}
-	*num_writ = all_written;
-	return rc;
-    }
-    else
-    {
-	*num_writ = (sizeof (nsize) + strlen (name) + sizeof (mtime) +
-		     sizeof (access) + sizeof (b));
-	return 0;
-    }
-}
-
-rc_t KTocEntryPersistNodeDir ( void *param, const KTocEntry * n,
-			      size_t * num_writ, 
-			      PTWriteFunc write, void * write_param )
-{
-    rc_t rc;
-
-/*     size_t	start,end; */
-
-    TOC_FUNC_ENTRY();
-
-
-/*     start = *num_writ; */
-
-    rc = BSTreePersist (&n->u.dir.tree,
-			num_writ,
-			write,
-			write_param,
-			KTocEntryPersist,
-			NULL);
-    if (rc != 0)
-    {
-        TOC_DEBUG (("KTocEntryPersistNodeDir: failure return from BSTreePersist"));
-    }
-
-/*     end = *num_writ; */
-    return rc;
-}
-
-static
-rc_t KTocEntryPersistNodeFile (void *param, const KTocEntry * n,
-			       size_t * num_writ, 
-			       PTWriteFunc write, void * write_param)
-{
-    TOC_FUNC_ENTRY();
-
-    if (write)
-    {
-	rc_t rc;
-	size_t all_written;
-	size_t written;
-
-/* please do not delete commented out code */
-/* 	printf("file offset\t"); */
-	rc = (*write) (write_param, &n->u.contiguous_file.archive_offset,
-		       sizeof n->u.contiguous_file.archive_offset, &all_written);
-	if (rc == 0)
-	{
-/* 	    printf("file size\t"); */
-	    rc = (*write) (write_param, &n->u.contiguous_file.file_size,
-			   sizeof n->u.contiguous_file.file_size, &written);
-            all_written += written;
-	}
-	*num_writ = all_written;
-	return rc;
-    }
-    else
-    {
-	*num_writ = (sizeof n->u.contiguous_file.archive_offset +
-		     sizeof n->u.contiguous_file.file_size);
-	return 0;
-    }
-}
-
-static
-rc_t KTocEntryPersistNodeChunked (void *param, const KTocEntry * n,
-				  size_t * num_writ, 
-				  PTWriteFunc write, void * write_param)
-{
-    KTocChunk * chunks;
-    uint32_t count;
-
-    count = n->u.chunked_file.num_chunks; /* used with write and no write */
-    chunks = n->u.chunked_file.chunks;
-    if (write)
-    {
-	rc_t rc;
-	size_t all_written;
-	size_t written;
-
-/* please do not delete commented out code */
-/* 	printf("file size\t"); */
-	rc = (*write) (write_param, &n->u.chunked_file.file_size,
-		       sizeof n->u.chunked_file.file_size, &all_written);
-	if (rc == 0)
-	{
-/* 	    printf("chunk count\t"); */
-	    rc = (*write) (write_param, &count, sizeof count, &written);
-	    all_written += written;
-	    if (rc == 0)
-	    {
-		for ( ; count--; chunks++)
-		{
-/* 		    printf("chunk l position\t"); */
- 		    rc = (*write) (write_param, &chunks->logical_position,
- 				   sizeof chunks->logical_position, &written);
-		    all_written += written;
-		    if (rc != 0)
-			break;
-/* 		    printf("chunk s position\t"); */
-		    rc = (*write) (write_param, &chunks->source_position,
-				   sizeof chunks->source_position, &all_written);
-		    all_written += written;
-		    if (rc != 0)
-			break;
-/* 		    printf("chunk size\t"); */
-		    rc = (*write) (write_param, &chunks->size,
-				   sizeof chunks->size, &written);
-		    all_written += written;
-		    if (rc != 0)
-			break;
-		}
-	    }
-	}
-	*num_writ = all_written;
-	return rc;
-    }
-    else
-    {
-	*num_writ = (sizeof n->u.chunked_file.file_size + sizeof count +
-		     count * (sizeof chunks->logical_position +
-			      sizeof chunks->source_position +
-			      sizeof chunks->size));
-	return 0;
-    }
-}
-
-static
-rc_t KTocEntryPersistNodeSym (void *param, const KTocEntry * n,
-			      size_t * num_writ, PTWriteFunc write,
-			      void * write_param)
-{
-    uint16_t nsize;
-
-    nsize = (uint16_t)n->u.symbolic_link.link_path.size;
-    if (write)
-    {
-	rc_t rc;
-	size_t all_written;
-	size_t written;
-
-	rc = (*write) (write_param, &nsize, sizeof nsize, &all_written);
-	if (rc == 0)
-	{
-	    rc = (*write) (write_param, 
-			   n->u.symbolic_link.link_path.addr,
-			   nsize,
-			   &written);
-	    all_written += written;
-	}
-	*num_writ = all_written;
-	return rc;
-    }
-    else
-    {
-	*num_writ = (sizeof (nsize) + nsize);
-	return 0;
-    }
-}
-
-static
-rc_t KTocEntryPersistNodeLink (void *param, const KTocEntry * n,
-			       size_t * num_writ, 
-			       PTWriteFunc write, void * write_param)
-{
-    uint16_t nsize;
-
-    nsize = (uint16_t)n->u.hard_link.ref->name.size;
-    if (write)
-    {
-	rc_t rc;
-	size_t all_written;
-	size_t written;
-
-	rc = (*write) (write_param, &nsize, sizeof nsize, &all_written);
-	if (rc == 0)
-	{
-	    rc = (*write) (write_param, 
-			   n->u.hard_link.ref->name.addr,
-			   nsize,
-			   &written);
-	    all_written += written;
-	}
-	*num_writ = all_written;
-	return rc;
-    }
-    else
-    {
-	*num_writ = (sizeof (nsize) + nsize);
-	return 0;
-    }
-}
-
-LIB_EXPORT rc_t CC KTocEntryPersist ( void *param, const void * node,
-                                      size_t * num_writ, 
-                                      PTWriteFunc write, void * write_param )
-{
-    rc_t rc;
-    size_t all_written;
-    size_t written;
-    const KTocEntry * n;
-
-    TOC_FUNC_ENTRY();
-
-    all_written = 0;
-    n = (const KTocEntry *)node;
-    rc = KTocEntryPersistNodeCommon (param, n, &all_written, write, write_param);
-    if (rc == 0)
-    {
-	written = 0;
-	switch (n->type)
-	{
-	default:
-	    rc = RC (rcFS, rcTocEntry, rcPersisting, rcTocEntry, rcInvalid );
-	    LOGERR (klogInt, rc, "malformed node with bad type");
-	    break;
-
- 	case ktocentrytype_notfound:
-	    rc = RC (rcFS, rcTocEntry, rcPersisting, rcTocEntry, rcCorrupt );
-	    LOGERR (klogInt, rc, "malformed tree node not found ");
- 	    break;
-
-	case ktocentrytype_dir:
-	    /* recur */
-/* please do not delete commented out code */
-/* 	    printf("KTocEntryPersist Directory\n"); */
-	    rc = KTocEntryPersistNodeDir (param, n, &written, write, write_param);
-	    break;
-
-	case ktocentrytype_file:
-/* 	    printf("KTocEntryPersist File\n"); */
-	    rc = KTocEntryPersistNodeFile (param, n, &written, write, write_param);
-	    break;
-
-	case ktocentrytype_emptyfile:
-/* 	    printf("KTocEntryPersist Empty File\n"); */
-	    break;
-
-	case ktocentrytype_chunked:
-/* 	    printf("KTocEntryPersist chunked File\n"); */
-	    rc = KTocEntryPersistNodeChunked (param, n, &written, write, write_param);
-	    break;
-
-	case ktocentrytype_softlink:
-/* 	    printf("KTocEntryPersist soft link\n"); */
-	    rc = KTocEntryPersistNodeSym (param, n, &written, write, write_param);
-	    break;
-
-	case ktocentrytype_hardlink:
-/* 	    printf("KTocEntryPersist hard link\n"); */
-	    rc = KTocEntryPersistNodeLink (param, n, &written, write, write_param);
-	    break;
-	}
-	all_written += written;
-    }
-    *num_writ = all_written;
-    return rc;
-}
-
-typedef
-struct KTocEntryInflateData
-{
-    KToc * toc;
-    const char * path;
-    uint64_t arcsize;
-    uint64_t offset;
-    rc_t rc;
-    bool rev;
-} KTocEntryInflateData;
-
-typedef
-struct KTocEntryInflateCommon
-{
-    char * name;
-    KTime_t mtime;
-    uint32_t access;
-    KTocEntryType type;
-} KTocEntryInflateCommon;
-/* TBD: replace the list of parameters in the inflatenode functions
-typedef
-struct KTocEntryInflateNodeData
-{
-    KToc * toc;
-    const void * ptr;
-    const void * limit;
-    char * name;
-    KTime_t mtime;
-    uint32_t access;
-    KTocEntryType type;
-    bool rev;
-} KTocEntryInflateNodeData;
-*/
-
-static
-bool check_limit (const void * ptr, const void * limit, size_t size)
-{
-    const uint8_t * p = ptr;
-    const uint8_t * l = limit;
-    return ((p + size) > l);
-}
-
-#define read_scalar(N,T,S)	     \
-    static rc_t N (const void ** _ptr, const void * limit, bool rev, T * pout) \
-    {									\
-	const T * ptr;							\
-									\
-	if (check_limit (*_ptr, limit, sizeof (T)))			\
-	    return RC (rcFS, rcTocEntry, rcParsing, rcBuffer, rcTooShort); \
-	    								\
-	ptr = *_ptr;							\
-									\
-	if (rev)							\
-	{								\
-	    T t;							\
-	    memcpy (&t, ptr, sizeof (T));				\
-	    *pout = S (t);						\
-	}								\
-	else								\
-	    memcpy (pout, ptr, sizeof (T));                             \
-	*_ptr = ++ptr;							\
-	return 0;							\
-    }
-
-read_scalar (read_u16,uint16_t,bswap_16)
-read_scalar (read_u32,uint32_t,bswap_32)
-read_scalar (read_u64,uint64_t,bswap_64)
-read_scalar (read_i64,int64_t,bswap_64)
-
-static
-rc_t read_u8 (const void ** _ptr, const void * limit, uint8_t * pout)
-{
-    const uint8_t * ptr;
-
-    if (check_limit (*_ptr, limit, sizeof (uint8_t)))
-	return RC (rcFS, rcTocEntry, rcParsing, rcBuffer, rcTooShort);
-
-    ptr = *_ptr;
-    *pout = *ptr++;
-    *_ptr = ptr;
-    return 0;
-}
-
-static
-rc_t KTocEntryInflateNodeCommon (const void ** ptr,
-				 const void * limit,
-				 KTocEntryInflateCommon * common,
-				 const char * path,
-				 bool rev)
-{
-    rc_t rc;
-    uint16_t plen;
-    uint16_t nlen;
-
-    rc = read_u16 (ptr, limit, rev, &nlen);
-    if (rc)
-	return rc;
-
-    if (check_limit (*ptr, limit, nlen))
-	return RC (rcFS, rcTocEntry, rcParsing, rcBuffer, rcTooShort);;
-
-    plen = (uint16_t)strlen (path);
-    if (plen == 0)
-    {
-	common->name = malloc (nlen+1);
-	if (common->name == NULL)
-	{
-	    return RC (rcFS, rcTocEntry, rcInflating, rcMemory, rcExhausted);
-	}
-	memcpy (common->name, *ptr, nlen);
-	common->name[nlen] = '\0';
-    }
-    else
-    {
-	common->name = malloc (plen + 1 + nlen+1);
-	if (common->name == NULL)
-	{
-	    return RC (rcFS, rcTocEntry, rcInflating, rcMemory, rcExhausted);
-	}
-	memcpy (common->name, path, plen);
-	common->name[plen] = '/';
-	memcpy (common->name+plen+1, *ptr, nlen);
-	common->name[plen + nlen + 1] = '\0';
-    }
-
-    *ptr = ((uint8_t*)*ptr) + nlen;
-
-    rc = read_i64 (ptr, limit, rev, &common->mtime);
-    if (rc == 0)
-    {
-	rc =read_u32 (ptr, limit, rev, &common->access);
-	if (rc == 0)
-	{
-	    uint8_t type;
-	    rc = read_u8 (ptr, limit, &type);
-	    if (rc == 0)
-	    {
-		common->type = type;
-		return 0;
-	    }
-	}
-    }
-    free (common->name);
-    common->name = NULL;
-    common->mtime = 0;
-    common->access = 0;
-    common->type = ktocentrytype_unknown;
-    return rc;
-}
-
-
-static
-rc_t KTocEntryInflateNodeDir (KToc * toc, KTocEntryInflateCommon * common, 
-			      const void ** ptr, uint64_t offset, uint64_t arcsize, const void * limit, bool rev)
-{
-    rc_t rc;
-
-    rc = KTocCreateDir (toc,
-			common->mtime,
-			common->access,
-			(KCreateMode)(kcmInit|kcmParents),
-			common->name);
-    if (rc == 0)
-    {
-	rc = KTocInflatePBSTree (toc, arcsize, *ptr, (uint32_t)( (uint8_t*)limit - (uint8_t*)*ptr ),
-                                 offset, rev, common->name);
-    }
-    return rc;
-}
-
-static
-rc_t KTocEntryInflateNodeFile (KToc * toc, const KTocEntryInflateCommon * common, 
-			       const void ** ptr, uint64_t offset, uint64_t arcsize, const void * limit, bool rev)
-{
-    rc_t rc;
-    uint64_t size;
-    uint64_t foffset;
-
-    rc = read_u64 (ptr, limit, rev, &foffset);
-    if (rc == 0)
-    {
-	rc = read_u64 (ptr, limit, rev, &size);
-	if (rc == 0)
-	{
-/*             KOutMsg ("%s %s %lu %lu %lu\n", __func__, common->name, size, offset + foffset, arcsize); */
-            if (arcsize >= offset + foffset + size )
-
-                rc = KTocCreateFile (toc,
-                                 offset + foffset,
-                                 size,
-                                 common->mtime,
-                                 common->access,
-                                 (KCreateMode)(kcmInit|kcmParents),
-                                 common->name);
-            else
-/*                 KOutMsg ("ZOMBIE: %s\n", common->name), */
-
-                rc = KTocCreateZombieFile (toc,
-                                           offset + foffset,
-                                           size,
-                                           common->mtime,
-                                           common->access,
-                                           (KCreateMode)(kcmInit|kcmParents),
-                                           common->name);
-	}
-    }
-    return rc;
-}
-
-static
-rc_t KTocEntryInflateNodeEmptyFile (KToc * toc, const KTocEntryInflateCommon * common, 
-                                    const void ** ptr, uint64_t offset, const void * limit, bool rev)
-{
-    rc_t rc;
-
-    rc = KTocCreateFile (toc,
-                         0,
-                         0,
-                         common->mtime,
-                         common->access,
-                         (KCreateMode)(kcmInit|kcmParents),
-                         common->name);
-    return rc;
-}
-
-static
-rc_t KTocEntryInflateNodeChunked (KToc * toc, const KTocEntryInflateCommon * common, 
-				  const void ** ptr, uint64_t offset, const void * limit, bool rev)
-{
-    rc_t rc;
-    uint64_t size;
-    uint32_t count;
-    KTocChunk * chunks;
-
-    rc = read_u64 (ptr, limit, rev, &size);
-    if (rc == 0)
-    {
-	rc = read_u32 (ptr, limit, rev, &count);
-	if (rc == 0)
-	{
-	    chunks = malloc (sizeof (KTocChunk) * count);
-	    if (chunks == NULL)
-		rc = RC (rcFS, rcTocEntry, rcParsing, rcMemory, rcExhausted);
-	    else
-	    {
-		uint32_t ix;
-		for (ix = 0; (rc == 0) && (ix < count); ++ix)
-		{
-		    if (rc == 0)
-			rc = read_u64 (ptr, limit, rev, &chunks[ix].logical_position);
-		    if (rc == 0)
-		    {
-			rc = read_u64 (ptr, limit, rev, &chunks[ix].source_position);
-			chunks[ix].source_position += offset;
-		    }
-		    if (rc == 0)
-			rc = read_u64 (ptr, limit, rev, &chunks[ix].size);
-		}
-		if (rc == 0)
-		    rc = KTocCreateChunkedFile (toc,
-						size,
-						common->mtime,
-						common->access,
-						count,
-						chunks,
-						(KCreateMode)(kcmInit|kcmParents),
-						common->name);
-		free (chunks);
-	    }
-	}
-    }
-    return rc;
-}
-
-static
-rc_t KTocEntryInflateNodeHardLink (KToc * toc, const KTocEntryInflateCommon * common, 
-				   const void ** ptr, uint64_t offset, const void * limit, bool rev)
-{
-    rc_t rc;
-    uint16_t llen;
-    char * link;
-
-    rc = read_u16 (ptr, limit, rev, &llen);
-    if (rc)
-	return rc;
-
-    if (check_limit (*ptr, limit, llen))
-	return RC (rcFS, rcTocEntry, rcParsing, rcBuffer, rcTooShort);;
-
-    link = malloc (llen + 1);
-    if (link == NULL)
-	return RC (rcFS, rcTocEntry, rcParsing, rcMemory, rcExhausted);
-
-    memcpy (link, ptr, llen);
-    link[llen] = '\0';
-
-    rc = KTocCreateHardLink (toc, 
-			     common->mtime,
-			     common->access,
-			     (KCreateMode)(kcmInit|kcmParents),
-			     link,
-			     common->name);
-    
-    free (link);
-    return rc;
-}
-
-static
-rc_t KTocEntryInflateNodeSoftLink (KToc * toc, const KTocEntryInflateCommon * common, 
-				  const void ** ptr, uint64_t offset, const void * limit, bool rev)
-{
-    rc_t rc;
-    uint16_t llen;
-    char * link;
-
-    rc = read_u16 (ptr, limit, rev, &llen);
-    if (rc)
-	return rc;
-
-    if (check_limit (*ptr, limit, llen))
-	return RC (rcFS, rcTocEntry, rcParsing, rcBuffer, rcTooShort);;
-
-    link = malloc (llen + 1);
-    if (link == NULL)
-	return RC (rcFS, rcTocEntry, rcParsing, rcMemory, rcExhausted);
-
-    memcpy (link, *ptr, llen);
-    link[llen] = '\0';
-
-    rc = KTocCreateSoftLink (toc, 
-			     common->mtime,
-			     common->access,
-			     (KCreateMode)(kcmInit|kcmParents),
-			     link,
-			     common->name);
-    
-    free (link);
-    return rc;
-}
-
-static
-void CC KTocEntryInflate (PBSTNode * n, void * _data)
-{
-    KTocEntryInflateData * data;
-    const void * ptr;
-    const void * limit;
-    KTocEntryInflateCommon common;
-    rc_t rc;
-
-    data = _data;
-    if (data->rc != 0)
-	return;
-    ptr = n->data.addr;
-    limit = (uint8_t*)ptr + n->data.size;
-    rc = KTocEntryInflateNodeCommon (&ptr, limit, &common, data->path, data->rev);
-    if (rc == 0)
-    {
-	switch (common.type)
-	{
-	default:
-	case ktocentrytype_unknown:
-	case ktocentrytype_notfound:
-	    rc = RC (rcFS, rcTocEntry, rcParsing, rcFile, rcCorrupt);
-	    break;
-	case ktocentrytype_dir:
-	    rc = KTocEntryInflateNodeDir (data->toc, &common, &ptr, data->offset,
-                                          data->arcsize, limit, data->rev);
-	    break;
-	case ktocentrytype_file:
-            rc = KTocEntryInflateNodeFile (data->toc, &common, &ptr, data->offset,
-                                           data->arcsize, limit, data->rev);
-	    break;
-	case ktocentrytype_emptyfile:
-	    rc = KTocEntryInflateNodeEmptyFile (data->toc, &common, &ptr, data->offset,
-                                                limit, data->rev);
-	    break;
-	case ktocentrytype_chunked:
-	    rc = KTocEntryInflateNodeChunked (data->toc, &common, &ptr, data->offset, limit, data->rev);
-	    break;
-	case ktocentrytype_softlink:
-	    rc = KTocEntryInflateNodeSoftLink (data->toc, &common, &ptr, data->offset, limit, data->rev);
-	    break;
-	case ktocentrytype_hardlink:
-	    rc = KTocEntryInflateNodeHardLink (data->toc, &common, &ptr, data->offset, limit, data->rev);
-	    break;
-	}
-	free (common.name);
-    }    
-    data->rc = rc; /* return */
-}
-
-rc_t KTocInflatePBSTree ( KToc * self, uint64_t arcsize, const void * treestart, uint32_t maxsize,
-			 uint64_t offset, bool rev, const char * path )
-{
-    rc_t rc;
-    PBSTree * pbst;
-
-    rc = PBSTreeMake (&pbst, treestart, maxsize, rev);
-    if (rc == 0)
-    {
-        KTocEntryInflateData data;
-
-        data.toc = self;
-        data.path = path;
-        data.arcsize = arcsize;
-        data.rc = 0;
-        data.rev = rev;
-        data.offset = offset;
-        
-        PBSTreeForEach (pbst, false, KTocEntryInflate, &data);
-
-        rc = data.rc;
-
-        PBSTreeWhack (pbst);
-    }
-    return rc;
-}
-
-
-/* end of file tocentry.c */
-
diff --git a/libs/kfs/tocfile.c b/libs/kfs/tocfile.c
deleted file mode 100644
index 66cbcda..0000000
--- a/libs/kfs/tocfile.c
+++ /dev/null
@@ -1,636 +0,0 @@
-/*===========================================================================
- *
- *                            Public DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <kfs/extern.h>
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <kfs/arc.h>
-#include <kfs/toc.h>
-#include <kfs/sra.h>
-#include <kfs/directory.h>
-#include <klib/defs.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <sysalloc.h>
-
-#include "toc-priv.h"
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct KTocFile;
-#define KFILE_IMPL struct KTocFile
-#include <kfs/impl.h>
-
-#define OPEN_FILE_CACHE_MAX 1
-
-
-/*--------------------------------------------------------------------------
- * FileCacheNode
- */
-typedef struct FileCacheNode FileCacheNode;
-
-struct FileCacheNode
-{
-    BSTNode n;
-    const char *path;
-    const KFile *file;
-    struct FileCacheNode * newer;
-};
-
-static
-int CC FileCacheNodeCmp ( const void *item, const BSTNode *n )
-{
-    const char *a = item;
-    const FileCacheNode *b = ( const FileCacheNode* ) n;
-
-    if ( a < b -> path )
-        return -1;
-    return a > b -> path;
-}
-
-static
-int CC FileCacheNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-    const FileCacheNode *a = ( const FileCacheNode* ) item;
-    const FileCacheNode *b = ( const FileCacheNode* ) n;
-
-    if ( a -> path < b -> path )
-        return -1;
-    return a -> path > b -> path;
-}
-
-static
-void CC FileCacheNodeWhack ( BSTNode *n, void *ignore )
-{
-    FileCacheNode *self = ( FileCacheNode* ) n;
-    KFileRelease ( self -> file );
-    free ( self );
-}
-
-static
-rc_t FileCacheNodeMake ( FileCacheNode **fcnp, const char *path, const KFile *file )
-{
-    FileCacheNode *fcn = malloc ( sizeof *fcn );
-    if ( fcn == NULL )
-        return RC ( rcFS, rcFile, rcReading, rcMemory, rcExhausted );
-
-    fcn -> path = path;
-    fcn -> file = file;
-
-    * fcnp = fcn;
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * KTocFile
- */
-
-typedef struct KTocFile
-{
-    KFile dad;
-    const KToc * toc;
-    const KDirectory * dir;
-    uint8_t * header;
-/* these three below fields are mutable */
-    BSTree open_file_cache;     /* opened files by name */
-    FileCacheNode * head;       /* least recently opened */
-    FileCacheNode * tail;       /* most recently opened */
-/* these three above fields are mutable */
-    uint64_t file_size;
-    size_t header_size;
-/* the below field s mutable */
-    uint32_t cache_count;
-/* the above field is mutable */
-} KTocFile;
-
-/* Destroy
- */
-static
-rc_t CC KTocFileDestroy (KTocFile *self)
-{
-    BSTreeWhack ( & self -> open_file_cache, FileCacheNodeWhack, NULL );
-    KTocRelease (self->toc);
-    KDirectoryRelease (self->dir);
-    free (self->header);
-    free (self);
-    return 0;
-}
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * Since this file does not have a system file underlaying the header
- * nor does it have a single file underlaying the various "subfiles"
- * it must return NULL;
- */
-static struct
-KSysFile *CC KTocFileGetSysFile ( const KTocFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return NULL;
-}
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *  certain file types ( notably compressors ) will refuse random access
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KTocFileRandomAccess ( const KTocFile *self )
-{
-    assert (self != NULL);
-    return 0;
-}
-
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KTocFileType ( const KTocFile *self )
-{
-    return kfdFile;
-}
-
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KTocFileSize ( const KTocFile *self, uint64_t *size )
-{
-    assert (self != NULL);
-    assert (size != NULL);
-
-    *size = self->file_size;
-    return 0;
-}
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KTocFileSetSize ( KTocFile *self, uint64_t size )
-{
-    return RC (rcFS, rcFile, rcUpdating, rcToc, rcUnsupported);
-}
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-size_t get_filler (const KTocFile *self, size_t z)
-{
-    size_t align = KTocAlignmentGet((KToc *)self->toc); /* type convert mutable field */
-    if (align > 1)
-    {
-        size_t mask = (size_t)align - 1;    /* get significant bits */
-        return (align - (z & mask)) & mask;
-    }
-    return 0;
-}
-
-static
-rc_t CC KTocFileRead ( const KTocFile *self, uint64_t _pos,
-    void *_buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    uint64_t pos;
-    uint8_t * buffer;
-    size_t filler;
-
-    assert (self != NULL);
-    assert (_buffer != NULL);
-
-    TOC_DEBUG (("%s: off %ju siz %zu ------\n", __func__, _pos, bsize));
-    TOC_DEBUG (("%s: self->file_size %lu\n", __func__, self->file_size));
-    rc = 0;
-    pos = _pos;
-    buffer = _buffer;
-
-    *num_read = 0;
-
-    /* go ahead and trim from read attempts anything beyond EOF
-     * return as EOF if we are asked to read beyond virtual file size
-     */
-    if (pos > self->file_size)  /* fully past EOF quit now */
-    {
-        TOC_DEBUG (("KTocFileRead read 0 past EOF"));
-	return 0;
-    }
-
-    if ((pos + bsize) > self->file_size)        /* partially past EOF quit at EOF */
-    {
-	bsize = (size_t)( self->file_size - pos );
-        TOC_DEBUG (("KTocFileRead trimmed read to %zu\n",bsize));
-    }
-
-    filler = get_filler (self, self->header_size);
-
-    /* get portion of read from header */
-    if (pos < (uint64_t) (self->header_size + filler))
-    {
-	size_t to_read = 0;
-
-        TOC_DEBUG (("%s size of header %zu filler after header %zu\n",
-                    __func__, self->header_size, filler));
-
-        /* header proper */
-        if (pos < self->header_size)
-        {
-            to_read = self->header_size - (size_t)pos;
-            if (to_read > bsize)
-                to_read = bsize;
-            memcpy (buffer, self->header + pos, to_read);
-
-            pos += to_read;
-            bsize -= to_read;
-        }
-        /* filler after header */
-        if (pos != self->header_size)    /* didn't reach end of header */
-            filler = 0;
-        else
-        {
-            if (filler > bsize)
-                filler = bsize;
-            if (filler)
-            {
-                memset (buffer + to_read, 0, filler);
-            }
-        }
-
-	/* exit on partial read */
-	*num_read = to_read + filler;
-        TOC_DEBUG (("%s hdr read %zu", __func__, *num_read));
-	return 0;
-    }
-    else
-        /* start in on files */
-    {
-        uint64_t fpos;
-        uint64_t fsize;
-        const char * path;
-        const KDirectory * dir;
-        size_t to_read;
-        size_t this_read;
-        size_t all_read;
-        size_t filler;
-
-        *num_read = all_read = to_read = 0;
-
-        dir = KTocGetArchive (self->toc);
-        rc = KTocResolvePathFromOffset (self->toc, &path, &fpos, pos);
-        if (path != NULL)
-        {
-            if (rc != 0)
-            {
-                TOC_DEBUG (("%s can't resolve offset $(O) %R\n", __func__, pos, rc));
-                return rc;
-            }
-            TOC_DEBUG (("%s reading \"%s\" at offset %ju\n", __func__, path, pos));
-            rc = KDirectoryVFileSize (dir, &fsize, path, NULL);
-            if (rc != 0)
-            {
-                TOC_DEBUG (("%s can't  determine sub file size  %s %R\n", __func__, path, rc));
-                return rc;
-            }
-            TOC_DEBUG (("%s size %ju\n", __func__, fsize));
-
-            if ((fpos + bsize) <= fsize)
-            {
-                filler = 0;
-                to_read = bsize;
-            }
-            else
-            {
-                filler = get_filler ( self, (size_t)fsize );
-                if ( bsize > ( fsize + filler ) )
-                    bsize = (size_t)( fsize + filler );
-
-                if (fpos < fsize)
-                {
-                    to_read = (size_t)( fsize - fpos );
-                    if (bsize <  (to_read + filler))
-                        filler = bsize - to_read;
-                }
-                else
-                {
-                    to_read = 0;
-                    if (filler > bsize)
-                        filler = bsize;
-                }
-            }
-
-            if (to_read)
-            {
-                KTocFile *mself = (KTocFile *)self;        /* to access mutable fields within self */
-                FileCacheNode *n;
-
-                TOC_DEBUG (("%s subfile %s\n", __func__, path));
-
-                /* look in cache */
-                n = ( FileCacheNode* ) BSTreeFind ( & mself -> open_file_cache,
-                                                    path, FileCacheNodeCmp );
-                if ( n != NULL )
-                {
-                    FileCacheNode * this_one;
-                    TOC_DEBUG (("%s cache hit for subfile %s\n", __func__, path));
-
-                    for (this_one = mself->head; this_one != n; this_one = this_one->newer)
-                    {
-                        if (this_one == NULL)
-                            return RC (rcFS, rcFile, rcOpening, rcToc, rcCorrupt);
-                    }
-                    if (mself->tail != mself->head) /* nothing to do if only one in queue */
-                    {
-                        if (this_one == mself->head)
-                        {
-                            mself->head = n->newer;
-                            n->newer = NULL;
-                            this_one = mself->tail;
-                            /* race condition possible: bad if next pair of assigns is not atomic and multi-threading */
-                            mself->tail = this_one->newer = n;
-                        }
-                    }
-                }
-                else
-                {
-                    const KFile * file;
-
-                    for (;;)
-                    {
-                        /* if we don't have too many files open, try to close something in the cache */
-                        if (mself->cache_count <= OPEN_FILE_CACHE_MAX)
-                        {
-                            TOC_DEBUG (("%s open subfile %s\n", __func__, path));
-                            /* open file on demand */
-                            rc = KDirectoryVOpenFileRead (KTocGetArchive(self->toc), &file, path, NULL);
-                            if (rc == 0)
-                                break;
-                        }
-                        
-                        /* if we've run out of file descriptors try clearing the cache a bit */
-                        if ((rc == 0) ||
-                            ((GetRCObject(rc) == rcFileDesc) &&
-                             (GetRCState(rc) == rcExhausted)))
-                        {
-                            TOC_DEBUG (("%s no more file descriptors\n", __func__));
-
-                            if (mself->cache_count != 0)
-                            {
-                                FileCacheNode * pn;
-
-                                rc = 0;
-                                pn = mself->head;
-                                TOC_DEBUG (("%s cache closing %s\n", __func__, pn->path));
-                                BSTreeUnlink (&mself->open_file_cache, &pn->n);
-                                mself->cache_count--;
-                                mself->head = pn->newer;
-                                (void)FileCacheNodeWhack (&pn->n, NULL);
-                                continue;
-                            }
-                        }
-                        return rc;
-                    }
-
-                    /* create a new cache node */
-                    rc = FileCacheNodeMake ( & n, path, file );
-                    if ( rc != 0 )
-                    {
-                        TOC_DEBUG (("%s %R  can't cache sub file %s\n", __func__, rc, path));
-                        KFileRelease ( file );
-                        return rc;
-                    }
-
-                    /* insert into cache */
-                    BSTreeInsert ( & mself -> open_file_cache, & n -> n, FileCacheNodeSort );
-                    mself->cache_count++;
-                    if (mself->head == NULL)
-                        mself->head = mself->tail = n;
-                    else
-                    {
-                        mself->tail->newer = n;
-                        mself->tail = n;
-                    }
-                }
-
-                rc = KFileRead (n ->file, fpos, buffer, to_read, &this_read);
-                if ( rc != 0)
-                {
-                    TOC_DEBUG (("%s %R error reading sub file %s\n", __func__, rc, path));
-                    return rc;
-                }
-            }
-            if (filler)
-                memset (buffer+to_read, 0, filler);
-
-            *num_read = to_read + filler;
-            TOC_DEBUG (("%s file %s read %zu\n", __func__, path, *num_read));
-        }
-    }
-    return rc;
-}
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t CC KTocFileWrite ( KTocFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    assert ( self != NULL );
-    return RC (rcFS, rcFile, rcWriting, rcToc, rcUnsupported);
-}
-
-
-static const KFile_vt_v1 vtKTocFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KTocFileDestroy,
-    KTocFileGetSysFile,
-    KTocFileRandomAccess,
-    KTocFileSize,
-    KTocFileSetSize,
-    KTocFileRead,
-    KTocFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KTocFileType
-    /* end minor version == 1 */
-};
-
-LIB_EXPORT rc_t CC KTocFileMake ( const KFile ** pself,
-		   const KToc * toc,
-		   const KDirectory * dir,
-		   void * header,
-		   uint64_t file_size,
-		   size_t header_size )
-{
-    KTocFile * self;
-    rc_t rc;
-
-    rc = 0;
-    self = malloc (sizeof (*self));
-    if (self == NULL)
-    {
-	rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-	LOGERR (klogErr, rc, "Out of memory in KTocFileMake");
-    }
-    else
-    {
-	rc = KFileInit (&self->dad, (const KFile_vt*)&vtKTocFile, "KTocFile", "no-name", true, false);
-	if (rc != 0)
-	{
-	    LOGERR (klogErr, rc, "Init failure in KTocFileMake");
-	}
-	else
-	{
-	    self->toc = toc;
-	    self->dir = dir;
-	    self->header = header;
-            BSTreeInit ( & self -> open_file_cache );
-            self->head = self->tail = NULL;
-            self->cache_count = 0;
-	    self->file_size = file_size;
-	    self->header_size = header_size;
-            TOC_DEBUG (("%s: file_size %lu header_size %u\n", __func__, file_size, header_size));
-	    KTocAddRef (toc);
-	    KDirectoryAddRef (dir);
-	    *pself = &self->dad;
-	    return 0;
-	}
-	free (self);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDirectoryOpenTocFileRead ( const KDirectory * self,
-				const KFile ** pfile,
-                                KSRAFileAlignment align,
-				bool ( CC * filter ) ( const KDirectory*, const char*, void* ),
-				void * filter_param,
-				rc_t ( CC * usort ) ( const KDirectory*, struct Vector* ) )
-{
-    rc_t rc;
-
-    TOC_DEBUG (("%s: enter\n",__func__));
-
-    rc = 0;
-    if (self == NULL)
-    {
-	rc = RC (rcFS, rcDirectory, rcConstructing, rcSelf, rcNull);
-	LOGERR (klogErr, rc, "Directory NULL in constructing a TocFile");
-	return rc;
-    }
-    if (pfile == NULL)
-    {
-	rc = RC (rcFS, rcDirectory, rcConstructing, rcParam, rcNull);
-	LOGERR (klogErr, rc, "file pointer parameter NULL in constructing a TocFile");
-	return rc;
-    }
-    if (rc == 0)
-    {
-	const KDirectory * dir;
-
-	rc = KDirectoryOpenArcDirRead (self, &dir, true, ".", tocKDirectory,
-				       KArcParseKDir, filter, filter_param);
-	if (rc != 0)
-	{
-	    LOGERR (klogErr, rc, "Failure to parse directory to TOC");
-	}
-	else
-	{
-	    void * header;
-	    uint64_t file_size;
-	    size_t header_size;
-
-            TOC_DEBUG (("%s: Persisting header\n", __func__));
-	    rc = KArcDirPersistHeader ((KArcDir*)dir, &header, &header_size, &file_size, align, usort);
-	    if (rc == 0)
-	    {
-		const KToc * toc;
-
-                TOC_DEBUG (("%s: Get TOC\n", __func__));
-		rc = KArcDirGetTOC ((const KArcDir*)dir, &toc); /* does not addref() */
-		if (rc != 0)
-		{
-		    LOGERR (klogErr, rc, "Failure to parse directory to TOC");
-		}
-		else
-		{
-		    const KFile * file;
-
-                    TOC_DEBUG (("%s: call KTocFileMake file_size %lu \n", __func__, file_size));
-
-		    rc = KTocFileMake (&file, toc, self, header, file_size, header_size);
-		    if (rc != 0)
-		    {
-			LOGERR (klogErr, rc, "Failure to make KTocFile");
-		    }
-		    else
-		    {
-			*pfile = file;
-		    }
-		}
-	    }
-            KDirectoryRelease (dir);
-	}
-    }
-    return rc;
-}
-						
-
-/* end of file dirfile.c */
diff --git a/libs/kfs/unix/sysdir-priv.h b/libs/kfs/unix/sysdir-priv.h
deleted file mode 100644
index ceebc8e..0000000
--- a/libs/kfs/unix/sysdir-priv.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysdir_priv_
-#define _h_sysdir_priv_
-
-#ifndef _h_kfs_impl_
-#include <kfs/impl.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KSysDir
- *  a Unix directory
- */
-typedef struct KSysDir KSysDir;
-
-/* MakePath
- *  create a full path from partial
- *
- *  "ctx" [ IN ] - a prepared context for returning non-zero rc_t
- *
- *  "canon" [ IN ] - if true, rewrite path in canonical form. usually
- *  not required when passing a path to the system, as the OS performs
- *  its own processing.
- *
- *  "bufer" [ OUT ] and "path_max" [ IN ] - return buffer for processed path
- *
- *  "path" [ IN ] and "args" [ IN, NULL OKAY ] - input path to be resolved
- */
-rc_t KSysDirMakePath ( struct KSysDir const *self, enum RCContext ctx, bool canon,
-    char *buffer, size_t path_max, const char *path, va_list args );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sysdir_priv_ */
diff --git a/libs/kfs/unix/sysdir.c b/libs/kfs/unix/sysdir.c
deleted file mode 100644
index fb450fa..0000000
--- a/libs/kfs/unix/sysdir.c
+++ /dev/null
@@ -1,2408 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSysDir;
-struct KSysDirListing;
-
-#define KDIR_IMPL struct KSysDir
-#define KNAMELIST_IMPL struct KSysDirListing
-
-#include <kfs/extern.h>
-#include "sysdir-priv.h"
-#include "sysfile-priv.h"
-#include <klib/sort.h>
-#include <klib/impl.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/klib-priv.h>
-#include <sysalloc.h>
-
-#include "os-native.h"
-
-#ifndef __USE_UNIX98
-#define __USE_UNIX98 1
-#endif
-#include <unistd.h>
-
-/* old Sun includes won't define PATH_MAX */
-#ifndef __XOPEN_OR_POSIX
-#define __XOPEN_OR_POSIX 1
-#endif
-
-#include <limits.h>
-
-/* now they won't define lstat */
-#undef __XOPEN_OR_POSIX
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <utime.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KSysDirEnum
- *  a Unix directory enumerator
- */
-typedef struct KSysDirEnum KSysDirEnum;
-struct KSysDirEnum
-{
-    DIR *dir;
-};
-
-/* Whack
- */
-static
-void KSysDirEnumWhack ( KSysDirEnum *self )
-{
-    closedir ( self -> dir );
-}
-
-/* Init
- */
-static
-rc_t KSysDirEnumInit ( KSysDirEnum *self, const char *path )
-{
-    self -> dir = opendir ( path );
-    if ( self -> dir != NULL )
-        return 0;
-
-    switch ( errno )
-    {
-    case EACCES:
-        return RC ( rcFS, rcDirectory, rcListing, rcDirectory, rcUnauthorized );
-    case EMFILE:
-    case ENFILE:
-        return RC ( rcFS, rcDirectory, rcListing, rcFileDesc, rcExhausted );
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcListing, rcPath, rcNotFound );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-    case ENOTDIR:
-        return RC ( rcFS, rcDirectory, rcListing, rcPath, rcIncorrect );
-    }
-
-    return RC ( rcFS, rcDirectory, rcListing, rcNoObj, rcUnknown );
-}
-
-/* Next
- */
-static
-const char *KSysDirEnumNext ( const KSysDirEnum *self )
-{
-    while ( 1 )
-    {
-        struct dirent *e = readdir ( self -> dir );
-        if ( e == NULL )
-            break;
-
-        if ( e -> d_name [ 0 ] == '.' )
-        {
-            switch ( e -> d_name [ 1 ] )
-            {
-            case 0:
-                continue;
-            case '.':
-                if ( e -> d_name [ 2 ] == 0 )
-                    continue;
-                break; 
-            }
-        }
-
-        return e -> d_name;
-    }
-
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * KSysDirListing
- *  a Unix directory listing
- */
-typedef struct KSysDirListing KSysDirListing;
-struct KSysDirListing
-{
-    KNamelist dad;
-    const char **namelist;
-    int cnt;
-};
-
-/* Whack
- */
-static
-rc_t KSysDirListingWhack ( const KSysDirListing *self )
-{
-    int i;
-    for ( i = 0; i < self -> cnt; ++ i )
-        free ( ( void* ) self -> namelist [ i ] );
-    free ( self -> namelist );
-    return 0;
-}
-
-static
-rc_t KSysDirListingDestroy ( KSysDirListing *self )
-{
-    rc_t rc = KSysDirListingWhack ( self );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Count
- */
-static
-rc_t KSysDirListingCount ( const KSysDirListing *self, uint32_t *count )
-{
-    * count = self -> cnt;
-    return 0;
-}
-
-/* Get
- */
-static
-rc_t KSysDirListingGet ( const KSysDirListing *self, uint32_t idx, const char **name )
-{
-    if ( idx >= ( uint32_t ) self -> cnt )
-        return RC ( rcFS, rcNamelist, rcAccessing, rcParam, rcExcessive );
-    * name = self -> namelist [ idx ];
-    return 0;
-}
-
-/* Init
- */
-static KNamelist_vt_v1 vtKSysDirListing =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KSysDirListingDestroy,
-    KSysDirListingCount,
-    KSysDirListingGet
-    /* end minor version 0 methods */
-};
-
-static
-int KSysDirListingSort ( const void *a, const void *b, void * ignored )
-{
-    return strcmp ( * ( const char** ) a, * ( const char** ) b );
-}
-
-static
-rc_t KSysDirListingInit ( KSysDirListing *self, const char *path, const KDirectory *dir,
-    bool ( * f ) ( const KDirectory*, const char*, void* ), void *data )
-{
-    rc_t rc;
-
-    self -> namelist = NULL;
-    self -> cnt = 0;
-
-    rc = KNamelistInit ( & self -> dad,
-        ( const KNamelist_vt* ) & vtKSysDirListing );
-    if ( rc == 0 )
-    {
-        KSysDirEnum list;
-        rc = KSysDirEnumInit ( & list, path );
-        if ( rc == 0 )
-        {
-            uint32_t len = 512;
-            self -> namelist = malloc ( len * sizeof self -> namelist [ 0 ] );
-            if ( self -> namelist == NULL )
-                rc = RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-            else
-            {
-                void *r;
-                const char *name;
-                while ( ( name = KSysDirEnumNext ( & list ) ) != NULL )
-                {
-                    if ( f != NULL )
-                    {
-                        if ( ! ( * f ) ( dir, name, data ) )
-                            continue;
-                    }
-                    
-                    if ( self -> cnt == len )
-                    {
-                        len += len;
-                        r = realloc ( self -> namelist,
-                            len * sizeof self -> namelist [ 0 ] );
-                        if ( r == NULL )
-                        {
-                            rc = RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-                            break;
-                        }
-                        self -> namelist = r;
-                    }
-
-                    self -> namelist [ self -> cnt ] = malloc ( strlen ( name ) + 1 );
-                    if ( self -> namelist [ self -> cnt ] == NULL )
-                    {
-                        rc = RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-                        break;
-                    }
-                    strcpy ( ( char* ) self -> namelist [ self -> cnt ], name );
-                    ++ self -> cnt;
-                }
-
-                if ( rc == 0 )
-                {
-                    r = realloc ( self -> namelist,
-                        self -> cnt * sizeof self -> namelist [ 0 ] );
-                    if ( r != NULL )
-                    {
-                        self -> namelist = r;
-                        ksort ( r, self -> cnt, sizeof self -> namelist [ 0 ], KSysDirListingSort, NULL );
-                    }
-                    else if ( self -> cnt != 0 )
-                    {
-                        rc = RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-                    }
-                    else
-                    {
-                        self -> namelist = r;
-                    }
-                }
-
-                if ( rc != 0 )
-                {
-                    KSysDirListingWhack ( self );
-                    self -> namelist = NULL;
-                    self -> cnt = 0;
-                }
-            }
-
-            KSysDirEnumWhack ( & list );
-        }
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * KSysDir
- *  a Unix directory
- */
-struct KSysDir
-{
-    KDirectory dad;
-    uint32_t root;
-    uint32_t size;
-    char path [ PATH_MAX ];
-};
-
-/* KSysDirMake
- *  allocate an uninialized object
- */
-static
-KSysDir *KSysDirMake ( size_t path_size )
-{
-    KSysDir *dir = malloc ( ( sizeof * dir - sizeof dir -> path + 2 ) + path_size );
-    return dir;
-}
-
-/* KSysDirDestroy
- */
-static
-rc_t KSysDirDestroy ( KSysDir *self )
-{
-    free ( self );
-    return 0;
-}
-
-/* KSysDirInit
- */
-static
-rc_t KSysDirInit ( KSysDir *self, enum RCContext ctx, uint32_t dad_root,
-    const char *path, uint32_t path_size, bool update, bool chroot );
-
-
-/* KSysDirCanonPath
- */
-static
-rc_t KSysDirCanonPath ( const KSysDir *self, enum RCContext ctx, char *path, size_t psize )
-{
-    char *low, *dst, *last, *end = path + psize;
-    low = dst = last = path + self -> root;
-
-    while ( 1 )
-    {
-        char *src = strchr ( last + 1, '/' );
-        if ( src == NULL )
-            src = end;
-
-        /* detect special sequences */
-        switch ( src - last )
-        {
-        case 2:
-            if ( last [ 1 ] == '.' )
-            {
-                /* skip over */
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-
-        case 3:
-            if ( last [ 1 ] == '.' && last [ 2 ] == '.' )
-            {
-                /* remove previous leaf in path */
-                dst [ 0 ] = 0;
-                dst = strrchr ( path, '/' );
-                if ( dst == NULL || dst < low )
-                    return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-        }
-
-        /* if rewriting, copy leaf */
-        assert ( src >= last );
-
-        if ( dst != last )
-            memmove ( dst, last, src - last );
-
-        /* move destination ahead */
-        dst += src - last;
-        
-        /* if we're done, go */
-        if ( src == end )
-                break;
-
-        /* find next separator */
-        last = src;
-    }
-
-    /* NUL terminate if modified */
-    if ( dst != end )
-        * dst = 0;
-
-    return 0;
-}
-
-/* KSysDirMakePath
- *  creates a full path from partial
- */
-rc_t KSysDirMakePath ( const KSysDir *self, enum RCContext ctx, bool canon,
-    char *buffer, size_t path_max, const char *path, va_list args )
-{
-    int psize;
-    size_t bsize;
-
-    if ( path == NULL )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-    if ( args != NULL && path [ 0 ] == '%' )
-    {
-        psize = vsnprintf ( buffer, path_max, path, args );
-        if ( psize < 0 || psize >= path_max )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        if ( buffer [ 0 ] != '/' )
-        {
-            bsize = self -> size;
-            if ( bsize + psize >= path_max )
-                return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-            memmove ( buffer + bsize, buffer, psize + 1 );
-            assert ( self -> path [ bsize - 1 ] == '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-        else if ( ( bsize = self -> root ) != 0 )
-        {
-            if ( bsize + psize >= path_max )
-                return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-            memmove ( buffer + bsize, buffer, psize + 1 );
-            assert ( self -> path [ bsize - 1 ] != '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-    }
-    else
-    {
-        if ( path [ 0 ] != '/' )
-        {
-            assert ( self -> path [ self -> size - 1 ] == '/' );
-            memcpy ( buffer, self -> path, bsize = self -> size );
-        }
-        else if ( ( bsize = self -> root ) != 0 )
-        {
-            assert ( self -> path [ bsize - 1 ] != '/' );
-            memcpy ( buffer, self -> path, bsize );
-        }
-
-        if ( args == NULL )
-            psize = snprintf ( buffer + bsize, path_max - bsize, "%s", path );
-        else
-            psize = vsnprintf ( buffer + bsize, path_max - bsize, path, args );
-
-        if ( psize < 0 || bsize + psize >= path_max )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-    }
-
-    /* remove trailing slashes; keep the leading slash */
-    while ( bsize + psize > 1 && buffer [ bsize + psize - 1] == '/' )
-        buffer [ bsize + -- psize ] = 0;
-
-    if ( psize > 0 && ( canon || self -> root != 0 ) )
-        return KSysDirCanonPath ( self, ctx, buffer, bsize + psize );
-
-    return 0;
-}
-
-
-/* RealPath
- *  returns a real OS path
- */
-rc_t KSysDirVRealPath ( const KSysDir *self,
-    char *real, size_t bsize, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcLoading, false,
-        full, sizeof full, path, args );
-    assert ( bsize >= PATH_MAX );
-    if ( rc == 0 && realpath ( full, real ) == NULL )
-    {
-        switch ( errno )
-        {
-        case EACCES:
-            return RC ( rcFS, rcDylib, rcLoading, rcDirectory, rcUnauthorized );
-        case ENOTDIR:
-        case EINVAL:
-        case ELOOP:
-            return RC ( rcFS, rcDylib, rcLoading, rcPath, rcInvalid );
-        case EIO:
-            return RC ( rcFS, rcDylib, rcLoading, rcTransfer, rcUnknown );
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDylib, rcLoading, rcPath, rcExcessive );
-        case ENOENT:
-            return RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-        default:
-            return RC ( rcFS, rcDylib, rcLoading, rcNoObj, rcUnknown );
-        }
-    }
-
-    return rc;
-}
-
-rc_t KSysDirRealPath ( const KSysDir *self,
-    char *real, size_t bsize, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KSysDirVRealPath ( self, real, bsize, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* KSysDirList
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "."
- */
-static
-rc_t KSysDirList ( const KSysDir *self, KNamelist **listp,
-    bool ( * f ) ( const KDirectory *dir, const char *name, void *data ), void *data,
-    const char *path, va_list args )
-{
-    KSysDir full;
-    rc_t rc = KSysDirMakePath ( self, rcListing, true,
-        full . path, sizeof full . path, path, args );
-    if ( rc == 0 )
-    {
-        rc = KSysDirInit ( & full, rcListing, self -> root,
-            NULL, strlen ( full . path ), 0, 0 );
-        if ( rc == 0 )
-        {
-            KSysDirListing *list = malloc ( sizeof * list );
-            if ( list == NULL )
-                rc = RC ( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KSysDirListingInit ( list,
-                    full . path, & full . dad, f, data );
-                if ( rc != 0 )
-                    free ( list );
-                else
-                    * listp = & list -> dad;
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* KSysDirPathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-static
-uint32_t KSysDirFullPathType ( const char *path )
-{
-    struct stat st;
-    int type, alias;
-
-    if ( lstat ( path, & st ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return kptNotFound;
-    default:
-        return kptBadPath;
-    }
-
-    alias = 0;
-
-    if ( S_ISLNK ( st . st_mode ) )
-    {
-        alias = kptAlias;
-
-        if ( stat ( path, & st ) != 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return kptNotFound | alias;
-        default:
-            return kptBadPath | alias;
-        } 
-    }
-
-    /* not a bad assumption */
-    type = kptFile;
-
-    /* overrides */
-    if ( S_ISDIR ( st . st_mode ) )
-        type = kptDir;
-    else if ( S_ISCHR ( st . st_mode ) )
-        type = kptCharDev;
-    else if ( S_ISBLK ( st . st_mode ) )
-        type = kptBlockDev;
-    else if ( S_ISFIFO ( st . st_mode ) )
-        type = kptFIFO;
-    else if ( S_ISSOCK ( st . st_mode ) )
-        type = kptFIFO;
-
-    /* add in alias bit */
-    return type | alias;
-}
-
-static
-uint32_t KSysDirPathType ( const KSysDir *self, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-        return KSysDirFullPathType ( full );
-    return kptBadPath;
-}
-
-/* KSysDirVisit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry, where each path is also given the leaf name
- *  for convenience. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-typedef struct KSysDirVisitData KSysDirVisitData;
-struct KSysDirVisitData
-{
-    rc_t ( * f ) ( KDirectory*, uint32_t, const char*, void* );
-    void *data;
-    KSysDir dir;
-    bool recurse;
-};
-
-static
-rc_t KSysDirVisitDir ( KSysDirVisitData *pb )
-{
-    /* get a directory listing */
-    KSysDirEnum listing;
-    rc_t rc = KSysDirEnumInit ( & listing, pb -> dir . path );
-    if ( rc == 0 )
-    {
-        const char *name;
-        uint32_t size = pb -> dir . size;
-
-        /* complete directory path */
-        pb -> dir . path [ size ] = '/';
-        if ( ++ size >= sizeof pb -> dir . path )
-            rc = RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcExcessive );
-        else for ( pb -> dir . size = size, name = KSysDirEnumNext ( & listing );
-                   name != NULL; name = KSysDirEnumNext ( & listing ) )
-        {
-            uint32_t type, len = strlen ( name );
-            if ( size + len >= sizeof pb -> dir . path )
-            {
-                rc = RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcExcessive );
-                break;
-            }
-            strcpy ( & pb -> dir . path [ size ], name );
-
-            type = KSysDirFullPathType ( pb -> dir . path );
-            if ( type == kptBadPath )
-            {
-                rc = RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcInvalid );
-                break;
-            }
-
-            rc = ( * pb -> f ) ( & pb -> dir . dad, type, name, pb -> data );
-            if ( rc != 0 )
-                break;
-
-            if ( pb -> recurse && ( type & ( kptAlias - 1 ) ) == kptDir )
-            {
-                pb -> dir . size += len;
-                rc = KSysDirVisitDir ( pb );
-                pb -> dir . size = size;
-                if ( rc != 0 )
-                    break;
-            }
-        }
-
-        
-        KSysDirEnumWhack ( & listing );
-    }
-    return rc;
-}
-
-static
-rc_t KSysDirVisit ( const KSysDir *self, bool recurse,
-    rc_t ( * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ), void *data,
-    const char *path, va_list args )
-{
-    KSysDirVisitData pb;
-    rc_t rc = KSysDirMakePath ( self, rcVisiting, true,
-        pb . dir . path, sizeof pb . dir . path, path, args );
-    if ( rc == 0 )
-    {
-        uint32_t path_size;
-
-        switch ( KSysDirFullPathType ( pb . dir . path ) & ( kptAlias - 1 ) )
-        {
-        case kptNotFound:
-            return RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcInvalid );
-        case kptDir:
-            break;
-        default:
-            return RC ( rcFS, rcDirectory, rcVisiting, rcPath, rcIncorrect );
-        }
-
-        path_size = strlen ( pb . dir . path );
-        while ( path_size > 1 && path_size > self -> root && pb . dir . path [ path_size - 1 ] == '/' )
-            -- path_size;
-
-        rc = KSysDirInit ( & pb . dir, rcVisiting, self -> root,
-            NULL, path_size, self -> dad . read_only ? 0 : 1, 0 );
-        if ( rc == 0 )
-        {
-            pb . f = f;
-            pb . data = data;
-            pb . recurse = recurse;
-            pb . dir . path [ -- pb . dir . size ] = 0;
-            rc = KSysDirVisitDir ( & pb );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirRelativePath
- *  makes "path" relative to "root"
- *  both "root" and "path" MUST be absolute
- *  both "root" and "path" MUST be canonical, i.e. have no "./" or "../" sequences
- */
-static
-rc_t KSysDirRelativePath ( const KSysDir *self, enum RCContext ctx,
-    const char *root, char *path, size_t path_max )
-{
-    int backup;
-    size_t bsize, psize;
-
-    const char *r = root + self -> root;
-    const char *p = path + self -> root;
-
-    assert ( r != NULL && r [ 0 ] == '/' );
-    assert ( p != NULL && p [ 0 ] == '/' );
-
-    for ( ; * r == * p; ++ r, ++ p )
-    {
-        /* disallow identical paths */
-        if ( * r == 0 )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-    }
-
-    /* paths are identical up to "r","p"
-       if "r" is within a leaf name, then no backup is needed
-       by counting every '/' from "r" to end, obtain backup count */
-    for ( backup = 0; * r != 0; ++ r )
-    {
-        if ( * r == '/' )
-            ++ backup;
-    }
-
-    /* the number of bytes to be inserted */
-    bsize = backup * 3;
-
-    /* align "p" to last directory separator */
-    while ( p [ -1 ] != '/' ) -- p;
-
-    /* the size of the remaining relative path */
-    psize = strlen ( p );
-
-    /* open up space if needed */
-    if ( p - path < bsize )
-    {
-        /* prevent overflow */
-        if ( bsize + psize >= path_max )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        memmove ( path + bsize, p, psize + 1 /* 1 for '\0'*/ );
-    }
-
-    /* insert backup sequences */
-    for ( bsize = 0; backup > 0; bsize += 3, -- backup )
-        memcpy ( & path [ bsize ], "../", 3 );
-
-    /* close gap */
-    if ( p - path > bsize )
-        memmove ( & path [ bsize ], p, strlen ( p ) + 1 );
-
-    return 0;
-}
-
-/* KSysDirResolvePath
- *  resolves path to an absolute or directory-relative path
- *
- *  "absolute" [ IN ] - if non-zero, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *  the resolved path will be directory relative
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target path. NB - need not exist.
- */
-static
-rc_t KSysDirResolvePath ( const KSysDir *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcResolving, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        uint32_t path_size = strlen ( full );
-
-        if ( absolute )
-        {
-            /* test buffer capacity */
-            if ( path_size - self -> root >= rsize )
-                return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-
-            /* ready to go */
-            strcpy ( resolved, & full [ self -> root ] );
-/*             assert ( resolved [ 0 ] == '/' ); */
-        }
-        else
-        {
-            rc = KSysDirRelativePath ( self, rcResolving, self -> path, full, sizeof full /*path_size*/ );
-            if ( rc == 0 )
-            {
-                path_size = strlen ( full );
-                if ( path_size >= rsize )
-                    return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-                strcpy ( resolved, full );
-            }
-        }
-    }
-    return rc;
-}
-
-/* KSysDirResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- */
-static
-rc_t KSysDirResolveAlias ( const KSysDir *self, bool absolute,
-    char *resolved, size_t rsize, const char *alias, va_list args )
-{
-    KSysDir full;
-    rc_t rc = KSysDirMakePath ( self, rcResolving, true,
-        full . path, sizeof full . path, alias, args );
-    if ( rc == 0 )
-    {
-        char link [ PATH_MAX ];
-        int len = readlink ( full . path, link, sizeof link );
-        if ( len < 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcNotFound );
-        case ENOTDIR:
-            return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcIncorrect );
-        case ENAMETOOLONG:
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcResolving, rcPath, rcInvalid );
-        case EACCES:
-            return RC ( rcFS, rcDirectory, rcResolving, rcDirectory, rcUnauthorized );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcResolving, rcMemory, rcExhausted );
-        case EIO:
-            return RC ( rcFS, rcDirectory, rcResolving, rcTransfer, rcUnknown );
-        default:
-            return RC ( rcFS, rcDirectory, rcResolving, rcNoObj, rcUnknown );
-        }
-
-        if ( ( size_t ) len == sizeof link )
-            return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        link [ len ] = 0;
-
-        if ( link [ 0 ] == '/' )
-        {
-            full . size = 1;
-            strcpy ( full . path, link );
-        }
-        else
-        {
-            char *f = strrchr ( full . path, '/' );
-            assert ( f != NULL );
-            full . size = ++f - full . path;
-            if ( full . size + len >= sizeof full . path )
-                return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-            strcpy ( f, link );
-        }
-
-        full . root = 0;
-
-/*         rc = KSysDirCanonPath ( & full, rcResolving, full . path, len ); */
-        rc = KSysDirCanonPath ( & full, rcResolving, full . path, full . size + len);
-        if ( rc == 0 )
-        {
-            /* the path in full is an absolute path
-               if outside of chroot, it's a bad link */
-            if ( memcmp ( full . path, self -> path, self -> root + 1 ) != 0 )
-                return RC ( rcFS, rcDirectory, rcResolving, rcLink, rcInvalid );
-
-            /* this is the absolute path length */
-            len = strlen ( & full . path [ self -> root ] );
-
-            /* if not requesting absolute, make self relative */
-            if ( ! absolute )
-            {
-                rc = KSysDirRelativePath ( self, rcResolving, self -> path, full . path, sizeof full.path/*len*/ );
-                if ( rc != 0 )
-                    return rc;
-                len = strlen ( full . path );
-            }
-
-            if ( ( size_t ) len >= rsize )
-                return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-
-            strcpy ( resolved, & full . path [ self -> root ] );
-        }
-    }
-    return rc;
-}
-
-
-/* KSysDirRename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-static rc_t KSysDirVAccess ( const KSysDir *self, uint32_t *access, const char *path,
-                             va_list args );
-static rc_t KSysDirSetAccess ( KSysDir *self, bool recurse, uint32_t access, uint32_t mask,
-                               const char *path, va_list args );
-
-static
-rc_t KSysDirRename ( KSysDir *self, bool force, const char *from, const char *to )
-{
-    char ffrom [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcRenaming, false, ffrom, sizeof ffrom, from, NULL );
-    if ( rc == 0 )
-    {
-        char fto [ PATH_MAX ];
-        rc = KSysDirMakePath ( self, rcRenaming, false, fto, sizeof fto, to, NULL );
-        if ( rc == 0 )
-        {
-            if ( rename ( ffrom, fto ) != 0 ) switch ( errno )
-            {
-            case EISDIR:
-            case EXDEV:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcIncorrect );
-                break;
-            case ENOTEMPTY:
-            case EEXIST:
-            case EBUSY:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcBusy );
-                break;
-            case EINVAL:
-            case ENOTDIR:
-            case ENAMETOOLONG:
-            case ELOOP:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcInvalid );
-                break;
-            case EACCES:
-            case EPERM:
-            case EROFS:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcDirectory, rcUnauthorized );
-                break;
-            case ENOSPC:
-                rc= RC ( rcFS, rcDirectory, rcRenaming, rcStorage, rcExhausted );
-                break;
-            case ENOMEM:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcMemory, rcExhausted );
-                break;
-            case ENOENT:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcPath, rcNotFound );
-                break;
-            default:
-                rc = RC ( rcFS, rcDirectory, rcRenaming, rcNoObj, rcUnknown );
-                break;
-            }
-        }
-        if (force)
-        {
-            if (GetRCState(rc) == rcUnauthorized)
-            {
-                uint32_t faccess = 0;
-                uint32_t taccess = 0;
-                bool fchanged = false;
-                bool tchanged = false;
-
-                rc = KSysDirVAccess (self, &taccess, to, NULL);
-                if (rc == 0)
-                {
-                    rc = KSysDirSetAccess (self, false, 0222, 0222, to, NULL);
-                    tchanged = true;
-                }
-                else if(GetRCState(rc) ==  rcNotFound)
-                {
-                    rc = 0;
-                }
-
-                if (rc == 0)
-                {
-                    rc = KSysDirVAccess (self, &faccess, from, NULL);
-                    if (rc == 0)
-                    {
-                        rc = KSysDirSetAccess (self, false, 0222, 0222, from, NULL);
-                        if (rc == 0)
-                        {
-                            fchanged = true;
-                            rc = KSysDirRename (self, false, from, to);
-                        }
-                    }
-                    if (rc == 0)
-                    {
-                        /* set access on the new name to the access from the old name */
-                        KSysDirSetAccess (self, false, faccess, 0222, to, NULL);
-                    }
-                    else
-                    {
-                        /* since something falied, try to restore changed access bits */
-                        if (fchanged)
-                            KSysDirSetAccess (self, false, faccess, 0222, from, NULL);
-                        if (tchanged)
-                            KSysDirSetAccess (self, false, taccess, 0222, to, NULL);
-                    }
-                        
-                }
-
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* KSysDirClearDir
- *  remove all directory contents
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- */
-static
-rc_t KSysDirRemoveEntry ( char *path, size_t path_max, bool force );
-
-static
-rc_t KSysDirEmptyDir ( char *path, size_t path_max, bool force )
-{
-    KSysDirEnum list;
-    rc_t rc = KSysDirEnumInit ( & list, path );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcFS, rcDirectory, rcClearing );
-    else
-    {
-        size_t path_size = strlen ( path );
-        path [ path_size ] = '/';
-        if ( ++ path_size == path_max )
-            rc = RC ( rcFS, rcDirectory, rcClearing, rcPath, rcExcessive );
-        else
-        {
-            const char *leaf;
-            while ( ( leaf = KSysDirEnumNext ( & list ) ) != NULL )
-            {
-                size_t leaf_size = strlen ( leaf );
-                if ( path_size + leaf_size >= path_max )
-                {
-                    rc = RC ( rcFS, rcDirectory, rcClearing, rcPath, rcExcessive );
-                    break;
-                }
-
-                strcpy ( & path [ path_size ], leaf );
-                rc = KSysDirRemoveEntry ( path, path_max, force );
-                if ( rc != 0 )
-                {
-                    rc = ResetRCContext ( rc, rcFS, rcDirectory, rcClearing );
-                    break;
-                }
-            }
-
-            path [ path_size - 1 ] = 0;
-        }
-
-        KSysDirEnumWhack ( & list );
-    }
-    return rc;
-}
-
-static
-rc_t KSysDirClearDir ( KSysDir *self, bool force, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcClearing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-        rc = KSysDirEmptyDir ( full, sizeof full, force );
-    return rc;
-}
-
-/* KSysDirRemove
- *  remove an accessible object from its directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- */
-static
-rc_t KSysDirRemoveEntry ( char *path, size_t path_max, bool force )
-{
-    if ( unlink ( path ) != 0 )
-    {
-        switch ( errno )
-        {
-        case ENOENT:
-            return 0;
-        case EPERM:
-        case EISDIR:
-            break;
-        case EACCES:
-        case EROFS:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-        case EBUSY:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcBusy );
-        case ENAMETOOLONG:
-        case ENOTDIR:
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcInvalid );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcMemory, rcExhausted );
-        case EIO:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcTransfer, rcUnknown );
-        default:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcNoObj, rcUnknown );
-        }
-
-        while ( rmdir ( path ) != 0 ) switch ( errno )
-        {
-        case EEXIST:
-        case ENOTEMPTY:
-            if ( force )
-            {
-                rc_t rc = KSysDirEmptyDir ( path, path_max, force );
-                if ( rc != 0 )
-                    return rc;
-                force = false;
-                break;
-            }
-        case EBUSY:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcPath, rcBusy );
-        case EPERM:
-        case EACCES:
-        case EROFS:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcMemory, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcRemoving, rcNoObj, rcUnknown );
-        }
-    }
-
-    return 0;
-}
-
-static
-rc_t KSysDirRemove ( KSysDir *self, bool force, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcRemoving, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-        rc = KSysDirRemoveEntry ( full, sizeof full, force );
-    return rc;
-}
-
-/* KSysDirAccess
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-static
-rc_t KSysDirVAccess ( const KSysDir *self,
-    uint32_t *access, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        struct stat st;
-        if ( stat ( full, & st ) != 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNotFound );
-        case ENOTDIR:
-        case ELOOP:
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-        case EACCES:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcMemory, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcNoObj, rcUnknown );
-        }
-
-        * access = st . st_mode & 07777;
-    }
-    return rc;
-}
-
-/* KSysDirSetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static
-rc_t KSysDirChangeAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, bool recurse );
-
-static
-rc_t KSysDirChangeDirAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask )
-{
-    KSysDirEnum list;
-    rc_t rc = KSysDirEnumInit ( & list, path );
-    if ( rc == 0 )
-    {
-        bool eperm = false;
-        size_t path_size = strlen ( path );
-        path [ path_size ] = '/';
-        if ( ++ path_size == path_max )
-            rc = RC ( rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            const char *leaf;
-            while ( ( leaf = KSysDirEnumNext ( & list ) ) != NULL )
-            {
-                size_t leaf_size = strlen ( leaf );
-                if ( path_size + leaf_size >= path_max )
-                {
-                    rc = RC ( rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-                    break;
-                }
-
-                strcpy ( & path [ path_size ], leaf );
-                rc = KSysDirChangeAccess ( path, path_max, access, mask, 1 );
-                if ( rc != 0 )
-                {
-                    if ( GetRCState ( rc ) != rcUnauthorized )
-                        break;
-                    eperm = true;
-                    rc = 0;
-                }
-            }
-
-            path [ path_size - 1 ] = 0;
-        }
-
-        KSysDirEnumWhack ( & list );
-
-        if ( rc == 0 && eperm )
-            rc = RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    }
-    return rc;
-}
-
-static
-rc_t KSysDirChangeEntryAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, uint32_t st_mode )
-{
-    /* keep old bits */
-    access &= mask;
-    access |= st_mode & ~ mask;
-
-    if ( chmod ( path, access & 07777 ) != 0 ) switch ( errno )
-    {
-    case EPERM:
-    case EACCES:
-    case EROFS:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-static
-rc_t KSysDirChangeAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, bool recurse )
-{
-    struct stat st;
-    if ( stat ( path, & st ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case EACCES:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-
-    if ( recurse && S_ISDIR ( st . st_mode ) )
-    {
-        rc_t rc;
-        uint32_t enable = access & mask;
-        if ( enable != 0 )
-        {
-            rc = KSysDirChangeEntryAccess ( path, path_max,
-                access, enable, st . st_mode );
-            if ( rc != 0 )
-                return rc;
-        }
-
-       rc = KSysDirChangeDirAccess ( path, path_max, access, mask );
-        if ( rc == 0 )
-        {
-            uint32_t disable = ~ access & mask;
-            if ( disable != 0 )
-            {
-                rc = KSysDirChangeEntryAccess ( path, path_max,
-                    access, disable, st . st_mode | enable );
-            }
-        }
-        return rc;
-    }
-
-    return KSysDirChangeEntryAccess ( path, path_max,
-         access, mask, st . st_mode );
-}
-
-static
-rc_t KSysDirSetAccess ( KSysDir *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        if ( mask == 0 )
-            mask = 07777;
-
-        rc = KSysDirChangeAccess ( full, sizeof full,
-            access, mask & 07777, recurse );
-    }
-    return rc;
-}
-
-/* KSysDirDate
- *  get access to object
- *
- *  "date" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-static
-rc_t KSysDirVDate ( const KSysDir *self,
-    KTime_t * date, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        struct stat st;
-        if ( stat ( full, & st ) != 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNotFound );
-        case ENOTDIR:
-        case ELOOP:
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-        case EACCES:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcMemory, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcNoObj, rcUnknown );
-        }
-
-        * date = ( KTime_t ) st . st_mtime;
-    }
-    return rc;
-}
-
-/* KSysDirSetDate
- *  set date to object a la Unix "touch"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "date" [ IN ]  - new mtime
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static
-rc_t KSysDirChangeDate ( char *path, size_t path_max,
-			 KTime_t date, bool recurse );
-
-static
-rc_t KSysDirChangeDirDate ( char *path, size_t path_max,
-			      KTime_t date )
-{
-    KSysDirEnum list;
-    rc_t rc = KSysDirEnumInit ( & list, path );
-    if ( rc == 0 )
-    {
-        bool eperm = false;
-        size_t path_size = strlen ( path );
-        path [ path_size ] = '/';
-        if ( ++ path_size == path_max )
-            rc = RC ( rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            const char *leaf;
-            while ( ( leaf = KSysDirEnumNext ( & list ) ) != NULL )
-            {
-                size_t leaf_size = strlen ( leaf );
-                if ( path_size + leaf_size >= path_max )
-                {
-                    rc = RC ( rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-                    break;
-                }
-
-                strcpy ( & path [ path_size ], leaf );
-                rc = KSysDirChangeDate ( path, path_max, date, 1 );
-                if ( rc != 0 )
-                {
-                    if ( GetRCState ( rc ) != rcUnauthorized )
-                        break;
-                    eperm = true;
-                    rc = 0;
-                }
-            }
-
-            path [ path_size - 1 ] = 0;
-        }
-
-        KSysDirEnumWhack ( & list );
-
-        if ( rc == 0 && eperm )
-            rc = RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    }
-    return rc;
-}
-
-static
-rc_t KSysDirChangeEntryDate ( char *path, size_t path_max,
-			      struct utimbuf * tb)
-{
-    if ( utime ( path, tb ) != 0 ) switch ( errno )
-    {
-    case EPERM:
-    case EACCES:
-    case EROFS:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-static
-rc_t KSysDirChangeDate ( char *path, size_t path_max,
-			 KTime_t date, bool recurse )
-{
-    struct stat st;
-    struct utimbuf u;
-
-    if ( stat ( path, & st ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case EACCES:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-    u . actime = u . modtime = date;
-
-    if ( recurse && S_ISDIR ( st . st_mode ) )
-    {
-        rc_t rc;
-
-	rc = KSysDirChangeEntryDate ( path, path_max, & u );
-	if ( rc != 0 )
-	    return rc;
-
-	rc = KSysDirChangeDirDate ( path, path_max, date );
-        if ( rc == 0 )
-        {
-	    rc = KSysDirChangeEntryDate ( path, path_max, & u  );
-        }
-        return rc;
-    }
-
-    return  KSysDirChangeEntryDate ( path, path_max, & u );
-}
-
-static
-rc_t KSysDirVSetDate ( KSysDir * self, bool recurse,
-	KTime_t date, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        rc = KSysDirChangeDate ( full, sizeof full,
-            date, recurse );
-    }
-    return rc;
-}
-
-static
-KSysDir *KSysDirGetSysdir ( const KSysDir *cself )
-{
-    return ( KSysDir* ) cself;
-}
-
-/* KSysDirCreateParents
- *  creates missing parent directories
- */
-static
-rc_t make_dir ( const char *path, uint32_t access )
-{
-    if ( mkdir ( path, ( int ) access ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNotFound );
-    case EEXIST:
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExists );
-    case EPERM:
-    case EACCES:
-    case EROFS:
-        return RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcUnauthorized );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcCreating, rcMemory, rcExhausted );
-    case ENOSPC:
-        return RC ( rcFS, rcDirectory, rcCreating, rcStorage, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcCreating, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-static
-rc_t KSysDirCreateParents ( const KSysDir *self,
-    char *path, uint32_t access, bool strip )
-{
-    rc_t rc;
-    char *p, *par = path + self -> root + 1;
-    size_t size = strlen ( par );
-
-    if ( ! strip )
-        p = par + size;
-    else
-    {
-        p = strrchr ( par, '/' );
-        if ( p == NULL )
-            return 0;
-        size = p - par;
-    }
-
-    while ( 1 )
-    {
-        /* crop string */
-        p [ 0 ] = 0;
-
-        /* try to create directory */
-        rc = make_dir ( path, access );
-        if ( GetRCState ( rc ) != rcNotFound )
-            break;
-
-        /* back up some more */
-        p = strrchr ( par, '/' );
-        if ( p == NULL )
-        {
-            p = par + strlen ( par );
-            break;
-        }
-    }
-
-    par += size;
-    assert ( p != NULL );
-
-    /* create directories from here */
-    if ( rc == 0 ) while ( p < par )
-    {
-        p [ 0 ] = '/';
-        rc = make_dir ( path, access );
-        if ( rc != 0 || ++ p >= par )
-            break;
-        p += strlen ( p );
-    }
-
-    /* fix up remaining path */
-    while ( p < par )
-    {
-        p [ 0 ] = '/';
-        if ( ++ p >= par )
-            break;
-        p += strlen ( p );
-    }
-
-    /* repair stripped path */
-    if ( strip )
-        par [ 0 ] = '/';
-
-    return rc;
-}
-
-/* CreateAlias
- *  creates a path alias according to create mode
- *  such that "alias" => "targ"
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object, i.e. the object which
- *  is designated by symlink "alias".
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias, i.e. the symlink that
- *  designates a target "targ".
- */
-static
-rc_t KSysDirCreateAlias ( KSysDir *self,
-    uint32_t access, KCreateMode mode,
-    const char *targ, const char *alias )
-{
-    /* create full path to symlink */
-    char falias [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcCreating, true, falias, sizeof falias, alias, NULL );
-    if ( rc == 0 )
-    {
-        /* the full path to target RELATIVE TO self */
-        char ftarg [ PATH_MAX ];
-        rc = KSysDirMakePath ( self, rcCreating, true, ftarg, sizeof ftarg, targ, NULL );
-        if ( rc == 0 )
-        {
-            /* if "targ" is relative or "self" is chroot'd,
-               "ftarg" must be made relative */
-            if ( targ [ 0 ] != '/' || self -> root != 0 )
-            {
-                /* take path to alias as root.
-                   generate a path RELATIVE TO alias */
-                rc = KSysDirRelativePath ( self, rcCreating, falias,
-                    ftarg, sizeof ftarg /*strlen ( ftarg )*/ );
-                if ( rc != 0 )
-                    return rc;
-            }
-
-            if ( symlink ( ftarg, falias ) == 0 )
-                return 0;
-
-            switch ( errno )
-            {
-            case EEXIST:
-                /* alias already exists. unless mode is
-                   create-only, force creation by removing old */
-                if ( ( mode & kcmValueMask ) != kcmCreate )
-                {
-                    /* refuse to drop if not an alias */
-                    if ( ( KSysDirFullPathType ( falias ) & kptAlias ) == 0 )
-                        return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcIncorrect );
-
-                    /* drop existing alias */
-                    rc = KSysDirRemoveEntry ( falias, sizeof falias, false );
-                    if ( rc == 0 )
-                        break;
-                }
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExists );
-
-            case ENOENT:
-                /* a part of the alias path doesn't exist */
-                if ( ( mode & kcmParents ) != 0 )
-                {
-                    KSysDirCreateParents ( self, falias, access, true );
-                    break;
-                }
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNotFound );
-
-            case EPERM:
-            case EACCES:
-            case EROFS:
-                return RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcUnauthorized );
-            case ENAMETOOLONG:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExcessive );
-            case ENOTDIR:
-            case ELOOP:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-            case ENOMEM:
-                return RC ( rcFS, rcDirectory, rcCreating, rcMemory, rcExhausted );
-            case ENOSPC:
-                return RC ( rcFS, rcDirectory, rcCreating, rcStorage, rcExhausted );
-            case EIO:
-                return RC ( rcFS, rcDirectory, rcCreating, rcTransfer, rcUnknown );
-            default:
-                return RC ( rcFS, rcDirectory, rcCreating, rcNoObj, rcUnknown );
-            }
-
-            /* try again either with existing guy removed
-               or missing directories created */
-            if ( symlink ( ftarg, falias ) != 0 ) switch ( errno )
-            {
-            case EEXIST:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExists );
-            case ENOENT:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNotFound );
-            default:
-                return RC ( rcFS, rcDirectory, rcCreating, rcNoObj, rcUnknown );
-            }
-
-            assert ( rc == 0 );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirOpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-static
-rc_t KSysDirOpenFileRead ( const KSysDir *self,
-    const KFile **f, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcOpening, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        int fd = open ( full, O_RDONLY );
-        if ( fd < 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNotFound );
-        case EACCES:
-            return RC ( rcFS, rcDirectory, rcOpening, rcDirectory, rcUnauthorized );
-        case EISDIR:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect );
-        case ENOTDIR:
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcInvalid );
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcExcessive );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        case EMFILE:
-        case ENFILE:
-            return RC ( rcFS, rcDirectory, rcOpening, rcFileDesc, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcOpening, rcNoObj, rcUnknown );
-        }
-
-        rc = KSysFileMake ( ( KSysFile** ) f, fd, full, true, false );
-        if ( rc != 0 )
-            close ( fd );
-    }
-    return rc;
-}
-
-/* KSysDirOpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- */
-static
-rc_t KSysDirOpenFileWrite ( KSysDir *self,
-    KFile **f, bool update, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcOpening, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        int fd = open ( full, update ? O_RDWR : O_WRONLY );
-        if ( fd < 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNotFound );
-        case EACCES:
-        case EROFS:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-        case EISDIR:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcIncorrect );
-        case ENOTDIR:
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcExcessive );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        case EMFILE:
-        case ENFILE:
-            return RC ( rcFS, rcDirectory, rcOpening, rcFileDesc, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcOpening, rcNoObj, rcUnknown );
-        }
-
-        rc = KSysFileMake ( ( KSysFile** ) f, fd, full, update, 1 );
-        if ( rc != 0 )
-            close ( fd );
-    }
-    return rc;
-}
-
-/* KSysDirCreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- */
-static
-rc_t KSysDirCreateFile ( KSysDir *self, KFile **f, bool update,
-    uint32_t access, KCreateMode cmode, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcCreating, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        int fd, mode = update ? O_RDWR | O_CREAT : O_WRONLY | O_CREAT;
-        switch ( cmode & kcmValueMask )
-        {
-        case kcmOpen:
-            break;
-        case kcmInit:
-            mode |= O_TRUNC;
-            break;
-        case kcmCreate:
-            mode |= O_EXCL;
-            break;
-        }
-
-        fd = open ( full, mode, ( int ) access );
-        while ( fd < 0 )
-        {
-            /* a common creation error is missing parents */
-            if ( ( cmode & kcmParents ) != 0 && errno == ENOENT )
-            {
-                /* force directory mode to have execute
-                   wherever there is read or write on file */
-                uint32_t dir_access = access |
-                    ( ( access & 0444 ) >> 2 ) | ( ( access & 0222 ) >> 1 );
-                /* NEW 2/15/2013 - also force read */
-                dir_access |= ( dir_access & 0111 ) << 2;
-                KSysDirCreateParents ( self, full, dir_access, true );
-
-                /* try again */
-                fd = open ( full, mode, ( int ) access );
-                if ( fd >= 0 )
-                    break;
-            }
-
-            /* when simply "touching" a file, the request for
-               write access may fail if created without write access */
-            if ( ( access & 0200 ) == 0 && errno == EACCES )
-            {
-                mode = O_CREAT;
-                if ( ( access & 0400 ) != 0 )
-                    mode |= O_RDONLY;
-                fd = open ( full, mode, ( int ) access );
-                if ( fd >= 0 )
-                    break;
-            }
-
-            switch ( errno )
-            {
-            case ENOENT:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcNotFound );
-                break;
-            case EEXIST:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExists );
-                break;
-            case EACCES:
-            case EROFS:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcUnauthorized );
-                break;
-            case EISDIR:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcIncorrect );
-                break;
-            case ENOTDIR:
-            case ELOOP:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-                break;
-            case ENAMETOOLONG:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExcessive );
-                break;
-            case ENOSPC:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcStorage, rcExhausted );
-                break;
-            case ENOMEM:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcMemory, rcExhausted );
-                break;
-            case EMFILE:
-            case ENFILE:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcFileDesc, rcExhausted );
-                break;
-            default:
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcNoObj, rcUnknown );
-                break;
-            }
-            
-            /* disabled 12/12/2012 : it prints an error message, if vdb tries to open
-               the same reference-object twice via http. The lock-file for the 2nd try
-               does already exist. This is not an error, just a condition. */
-
-            /* PLOGERR (klogErr, (klogErr, rc, "failed to create '$(F)'", "F=%s", full)); */
-            return rc;
-        }
-
-        rc = KSysFileMake ( ( KSysFile** ) f, fd, full, update, true );
-        if ( rc != 0 )
-            close ( fd );
-    }
-    return rc;
-}
-
-/* KSysDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t KSysDirFileSize ( const KSysDir *self,
-    uint64_t *size, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        struct stat st;
-        if ( stat ( full, & st ) != 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcNotFound );
-        case ENOTDIR:
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcInvalid );
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcExcessive );
-        case EACCES:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-        case ENOMEM:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcMemory, rcExhausted );
-        default:
-            return RC ( rcFS, rcDirectory, rcAccessing, rcNoObj, rcUnknown );
-        }
-
-        if ( S_ISDIR ( st . st_mode ) )
-            return RC ( rcFS, rcDirectory, rcAccessing, rcPath, rcIncorrect );
-
-        * size = st . st_size;
-    }
-    return rc;
-}
-
-/* KSysDirSetFileSize
- *  sets size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t KSysDirSetFileSize ( KSysDir *self,
-    uint64_t size, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        if ( truncate ( full, size ) != 0 ) switch ( errno )
-        {
-        case ENOENT:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-        case EACCES:
-        case EROFS:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-        case EFBIG:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcParam, rcExcessive );
-        case EINTR:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcFunction, rcIncomplete );
-        case EINVAL:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcParam, rcInvalid );
-        case EIO:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcTransfer, rcUnknown );
-        case EISDIR:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcIncorrect );
-        case ELOOP:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-        case ENAMETOOLONG:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-        default:
-            return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirOpenDirRead
- * KSysDirOpenDirUpdate
- *  opens a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- */
-static
-rc_t KSysDirOpenDirRead ( const KSysDir *self,
-     const KDirectory **subp, bool chroot, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc; 
-
-    rc = KSysDirMakePath ( self, rcOpening, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        KSysDir *sub;
-
-        size_t path_size = strlen ( full );
-        while ( path_size > 1 && full [ path_size - 1 ] == '/' )
-            full [ -- path_size ] = 0;
-            
-        {
-            int t = KSysDirFullPathType ( full ) & ( kptAlias - 1 );
-            if ( t == kptNotFound )
-                return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNotFound );
-            if ( t != kptDir )
-                return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect );
-        }
-        
-        sub = KSysDirMake ( path_size );
-        if ( sub == NULL )
-            rc = RC ( rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSysDirInit ( sub, rcOpening, self -> root, full, path_size, false, chroot );
-            if ( rc == 0 )
-            {
-                * subp = & sub -> dad;
-                return 0;
-            }
-
-            free ( sub );
-        }
-    }
-    return rc;
-}
-
-static
-rc_t KSysDirOpenDirUpdate ( KSysDir *self,
-    KDirectory **subp, bool chroot, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc;
-
-    rc = KSysDirMakePath ( self, rcOpening, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        KSysDir *sub;
-
-        size_t path_size = strlen ( full );
-        while ( path_size > 1 && full [ path_size - 1 ] == '/' )
-            full [ -- path_size ] = 0;
-
-        switch ( KSysDirFullPathType ( full ) )
-        {
-        case kptNotFound:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcInvalid );
-        case kptDir:
-        case kptDir | kptAlias:
-            break;
-        default:
-            return RC ( rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect );
-        }
-
-        sub = KSysDirMake ( path_size );
-        if ( sub == NULL )
-            rc = RC ( rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSysDirInit ( sub, rcOpening, self -> root, full, path_size, true, chroot );
-            if ( rc == 0 )
-            {
-                * subp = & sub -> dad;
-                return 0;
-            }
-
-            free ( sub );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirCreateDir
- *  create a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "access" [ IN ] - standard Unix directory permissions
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- */
-static
-rc_t KSysDirCreateDir ( KSysDir *self,
-    uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    char full [ PATH_MAX ];
-    rc_t rc = KSysDirMakePath ( self, rcCreating, true, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        if ( ( mode & kcmValueMask ) == kcmCreate )
-        {
-            switch ( KSysDirFullPathType ( full ) )
-            {
-            case kptNotFound:
-                break;
-            case kptBadPath:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-            case kptDir:
-                return RC ( rcFS, rcDirectory, rcCreating, rcDirectory, rcExists );
-            default:
-                return RC ( rcFS, rcDirectory, rcCreating, rcPath, rcIncorrect );
-            }
-        }
-
-        rc = make_dir ( full, access );
-        if ( rc != 0 ) switch ( GetRCState ( rc ) )
-        {
-        case rcExists:
-            rc = 0;
-            if ( ( mode & kcmValueMask ) == kcmInit )
-                rc = KSysDirEmptyDir ( full, sizeof full, 1 );
-            break;
-        case rcNotFound:
-            if ( ( mode & kcmParents ) != 0 )
-                rc = KSysDirCreateParents ( self, full, access, false );
-            break;
-        default:
-            break;
-        }
-    }
-    return rc;
-}
-
-/* KDirectoryNativeDir
- *  returns a native file-system directory node reference
- *  the directory root will be "/" and set to the native
- *  idea of current working directory
- *
- *  NB - the returned reference will be non-const, allowing
- *  modification operations to be attempted. these operations
- *  may still fail if the underlying FS disallows them.
- *
- *  "dir" [ OUT ] - return parameter for native directory
- */
-
-static KDirectory_vt_v1 vtKSysDir =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods*/
-    KSysDirDestroy,
-    KSysDirList,
-
-    /* the following two messages map to the same method, requiring type casting */
-    ( rc_t ( * )  ( const KSysDir*, bool,
-        rc_t ( * ) ( const KDirectory*, uint32_t, const char*, void* ), void*,
-       const char*, va_list ) ) KSysDirVisit,
-    ( rc_t ( * )  ( KSysDir*, bool,
-        rc_t ( * ) ( KDirectory*, uint32_t, const char*, void* ), void*,
-       const char*, va_list ) ) KSysDirVisit,
-
-    KSysDirPathType,
-    KSysDirResolvePath,
-    KSysDirResolveAlias,
-    KSysDirRename,
-    KSysDirRemove,
-    KSysDirClearDir,
-    KSysDirVAccess,
-    KSysDirSetAccess,
-    KSysDirCreateAlias,
-    KSysDirOpenFileRead,
-    KSysDirOpenFileWrite,
-    KSysDirCreateFile,
-    KSysDirFileSize,
-    KSysDirSetFileSize,
-    KSysDirOpenDirRead,
-    KSysDirOpenDirUpdate,
-    KSysDirCreateDir,
-    NULL, /* we don't track files*/
-    /* end minor version 0 methods*/
-
-    /* start minor version 1 methods*/
-    KSysDirVDate,
-    KSysDirVSetDate,
-    KSysDirGetSysdir
-    /* end minor version 1 methods*/
-};
-
-/* KSysDirInit
- */
-static
-rc_t KSysDirInit ( KSysDir *self, enum RCContext ctx, uint32_t dad_root,
-    const char *path, uint32_t path_size, bool update, bool chroot )
-{
-    rc_t rc;
-
-    rc = KDirectoryInit ( & self -> dad, ( const KDirectory_vt* ) & vtKSysDir,
-                          "KSysDir", path?path:"(null)", update );
-    if ( rc != 0 )
-        return ResetRCContext ( rc, rcFS, rcDirectory, ctx );
-
-    if ( path != NULL )
-        memcpy ( self -> path, path, path_size );
-    self -> root = chroot ? path_size : dad_root;
-    self -> size = path_size + 1;
-    self -> path [ path_size ] = '/';
-    self -> path [ path_size + 1 ] = 0;
-
-    return 0;
-}
-
-extern rc_t CC ReportCWD ( const ReportFuncs *f, uint32_t indent );
-extern rc_t CC ReportRedirect ( KWrtHandler* handler,
-    const char* filename, bool* to_file, bool finalize );
-
-LIB_EXPORT rc_t CC KDirectoryNativeDir ( KDirectory **dirp )
-{
-    rc_t rc;
-    KSysDir *dir;
-    uint32_t size;
-    char wd [ PATH_MAX ];
-
-    static bool latch;
-    if ( ! latch )
-    {
-        ReportInitKFS ( ReportCWD, ReportRedirect );
-        latch = true;
-    }
-
-    if ( dirp == NULL )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-
-    * dirp = NULL;
-
-    if ( realpath ( ".", wd ) == NULL ) switch ( errno )
-    {
-    case EACCES:
-        return RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-    case EIO:
-        return RC ( rcFS, rcDirectory, rcAccessing, rcTransfer, rcUnknown );
-    default:
-        return RC ( rcFS, rcDirectory, rcAccessing, rcNoObj, rcUnknown );
-    }
-
-    size = strlen ( wd );
-    if ( size + 2 > sizeof wd )
-        return RC ( rcFS, rcDirectory, rcAccessing, rcBuffer, rcInsufficient );
-
-    /* trim trailing slash */
-    if ( size > 0 && wd [ size - 1 ] == '/' )
-        wd [ -- size ] = 0;
-
-    dir = KSysDirMake ( size );
-    if ( dir == NULL )
-        rc = RC ( rcFS, rcDirectory, rcAccessing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KSysDirInit ( dir, rcAccessing, 0, wd, size, true, false );
-        if ( rc == 0 )
-        {
-            * dirp = & dir -> dad;
-            return 0;
-        }
-
-        free ( dir );
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/unix/sysdll.c b/libs/kfs/unix/sysdll.c
deleted file mode 100644
index 4ae62bf..0000000
--- a/libs/kfs/unix/sysdll.c
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include "va_copy.h"
-#include "sysdir-priv.h"
-
-#include <kfs/extern.h>
-#include <kfs/dyload.h>
-#include <kfs/directory.h>
-#include <klib/refcount.h>
-#include <klib/vector.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "os-native.h"
-
-/* old Sun includes won't define PATH_MAX */
-
-#ifndef __XOPEN_OR_POSIX
-#define __XOPEN_OR_POSIX 1
-#endif
-
-#include <limits.h>
-
-#undef __XOPEN_OR_POSIX
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#include <dlfcn.h>
-
-
-#if _DEBUGGING
-#define DLOPEN_MODE RTLD_NOW
-#else
-#define DLOPEN_MODE RTLD_LAZY
-#endif
-
-#if _STATIC
-#define ALWAYS_ADD_EXE 1
-#endif
-
-/* PATH_MAX is not really universal even on Linux/Unix */
-#ifndef PATH_MAX
-#define PATH_MAX        4096
-#endif
-
-/*--------------------------------------------------------------------------
- * KDirectory
- */
-static
-void KDirRefRelease ( void *item, void *ignore )
-{
-    KDirectoryRelease ( ( const void* ) item );
-}
-
-/*--------------------------------------------------------------------------
- * KDyld
- *  dynamic library loader
- *
- *  maintains cache of libraries it has opened while they remain open
- *  such that subsequent requests for an open library will return a
- *  new reference to the existing library.
- */
-struct KDyld
-{
-    Vector search;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDyldWhack ( KDyld *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDyld" );
-
-    VectorWhack ( & self -> search, KDirRefRelease, NULL );
-    free ( self );
-
-    return 0;
-}
-
-
-/* Make
- *  create a dynamic loader object
- *
- *  "dl" [ OUT ] - return parameter for loader
- */
-LIB_EXPORT rc_t CC KDyldMake ( KDyld **dlp )
-{
-    rc_t rc;
-
-    if ( dlp == NULL )
-        rc = RC ( rcFS, rcDylib, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KDyld *dl = malloc ( sizeof * dl );
-        if ( dl == NULL )
-            rc = RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            VectorInit ( & dl -> search, 1, 8 );
-            KRefcountInit ( & dl -> refcount, 1, "KDyld", "make", "dl" );
-
-            * dlp = dl;
-            return 0;
-        }
-
-        * dlp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDyldAddRef ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDyld" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDyldRelease ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDyld" ) )
-        {
-        case krefWhack:
-            return KDyldWhack ( ( KDyld* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Attach
- * Sever
- */
-static
-KDyld *KDyldAttach ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDyld" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDyld* ) self;
-}
-
-static
-rc_t KDyldSever ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDyld" ) )
-        {
-        case krefWhack:
-            return KDyldWhack ( ( KDyld* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddSearchPath
- *  add a search path to loader for locating library files
- */
-LIB_EXPORT rc_t CC KDyldVAddSearchPath ( KDyld *self, const char *path, va_list args )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC ( rcFS, rcDylib, rcUpdating, rcSelf, rcNull );
-    else
-    {
-        KDirectory *wd;
-        rc = KDirectoryNativeDir ( & wd );
-        if ( rc == 0 )
-        {
-            const KDirectory *dir;
-            rc = KDirectoryVOpenDirRead ( wd, & dir, false, path, args );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( & self -> search, NULL, dir );
-                if ( rc != 0 )
-                    KDirectoryRelease ( dir );
-            }
-
-            KDirectoryRelease ( wd );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldAddSearchPath ( KDyld *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDyldVAddSearchPath ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-static
-void KDyldForEach ( const KDyld *self,
-    void ( * f ) ( const KDirectory *dir, void *data ), void *data )
-{
-    VectorForEach ( & self -> search, false,
-        ( void ( * ) ( void*, void* ) ) f, data );
-}
-
-
-/* HomeDirectory
- *  returns a KDirectory where the binary for a given function is located
- *
- *  "dir" [ OUT ] - return parameter for home directory ( read-only ), if found
- *
- *  "func" [ IN ] - function pointer within binary to be located
- */
-LIB_EXPORT rc_t CC KDyldHomeDirectory ( const KDyld *self, const KDirectory **dir, fptr_t func )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcFS, rcDylib, rcSearching, rcParam, rcNull );
-    else
-    {
-        * dir = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSearching, rcSelf, rcNull );
-        else if ( func == NULL )
-            rc = RC ( rcFS, rcDylib, rcSearching, rcFunction, rcNull );
-        else
-        {
-            Dl_info info;
-            memset ( & info, 0, sizeof info );
-            if ( dladdr ( ( void* ) func, & info ) == 0 )
-                rc = RC ( rcFS, rcDylib, rcSearching, rcFunction, rcNotFound );
-            else
-            {
-                KDirectory *wd;
-                rc = KDirectoryNativeDir ( & wd );
-                if ( rc == 0 )
-                {
-                    /* turn this into a real path */
-                    const KSysDir *sdir = KDirectoryGetSysDir ( wd );
-                    if ( sdir == NULL )
-                        rc = RC ( rcFS, rcDylib, rcSearching, rcDirectory, rcIncorrect );
-                    else
-                    {
-                        /* "dladdr" will return a simple name rather than a path
-                           when the address is within the application itself and
-                           the application was found using PATH. this is brilliant
-                           design at its best. */
-                        char thanks_for_brilliant_APIs [ PATH_MAX ];
-                        const char *dli_fname = info . dli_fname;
-
-                        /* check for a path rather than a name */
-                        const char *last_slash = strrchr ( info . dli_fname, '/' );
-                        if ( last_slash == NULL )
-                        {
-                            /* simple name - get PATH */
-                            const char *PATH = getenv ( "PATH" );
-                            rc = RC ( rcFS, rcDylib, rcSearching, rcPath, rcNotFound );
-                            if ( PATH != NULL )
-                            {
-                                /* loop over PATH */
-                                const char *path_start, *path_end;
-                                for ( path_start = PATH;; path_start = path_end + 1 )
-                                {
-                                    /* look for non-empty directory */
-                                    path_end = strchr ( path_start, ':' );
-                                    if ( path_start != path_end && path_start [ 0 ] != 0 )
-                                    {
-                                        rc_t rc2;
-                                        uint32_t path_type;
-
-                                        /* handle last element in list */
-                                        if ( path_end == NULL )
-                                            last_slash = path_start + strlen ( path_start );
-                                        else for ( last_slash = path_end; last_slash > path_start; -- last_slash )
-                                        {
-                                            if ( last_slash [ -1 ] != '/' )
-                                                break;
-                                        }
-
-                                        /* create possible path, using up to ':' */
-                                        rc2 = string_printf ( thanks_for_brilliant_APIs, sizeof thanks_for_brilliant_APIs, NULL,
-                                                              "%.*s/%s", ( int ) ( last_slash - path_start ), path_start, dli_fname );
-
-                                        /* if failed to create path string */
-                                        if ( rc2 != 0 )
-                                            break;
-
-                                        /* check path against working directory */
-                                        path_type = KDirectoryPathType ( wd, thanks_for_brilliant_APIs );
-                                        if ( ( path_type & ~ kptAlias ) == kptFile )
-                                        {
-                                            uint32_t access = 0;
-                                            rc = KDirectoryAccess ( wd, & access, thanks_for_brilliant_APIs );
-                                            if ( rc != 0 )
-                                                break;
-
-                                            /* try to do a quick check that the file can be executed.
-                                               but it could fail to do the right guess. */
-                                            if ( access & 0100 || access & 0010 || access & 0001 ) {
-                                                /* this is a file, which can be assumed to be an executable */
-                                                dli_fname = thanks_for_brilliant_APIs;
-                                                last_slash
-                                                    = & thanks_for_brilliant_APIs [ last_slash - path_start ];
-                                                rc = 0;
-                                                break;
-                                            }
-                                        }
-                                    }
-
-                                    /* exit if no more paths */
-                                    if ( path_end == NULL )
-                                        break;
-                                }
-                            }
-                        }
-
-                        if ( rc == 0 )
-                        {
-                            char real [ PATH_MAX ];
-                            rc = KSysDirRealPath ( sdir, real, sizeof real, "%.*s"
-                                , ( int ) ( last_slash - dli_fname ), dli_fname );
-
-                            if ( rc == 0 )
-                                rc = KDirectoryOpenDirRead ( wd, dir, false, real );
-
-                            DBGMSG(DBG_KFS, DBG_FLAG(DBG_KFS_DIR), ("%s: %R path is '%s'\n", __func__, rc, real));
-                        }
-                    }
-
-                    KDirectoryRelease ( wd );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDylib
- *  Unix dynamic library
- */
-struct KDylib
-{
-    void *handle;
-    String path;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDylibWhack ( KDylib *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDylib" );
-
-
-/* Darwin, especially before 10.5 doesn't/didn't do this well */
-#if ! MAC
-    /* try to close library */
-    if ( dlclose ( self -> handle ) )
-    {
-        /* report error */
-        const char *msg = dlerror ();
-        rc_t rc = RC ( rcFS, rcDylib, rcClosing, rcNoObj, rcUnknown );
-        LOGERR ( klogInt, rc, msg );
-        ( void ) msg;
-
-        return rc;
-    }
-#endif
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KDylibMake ( KDylib **libp, const String *path )
-{
-    KDylib *lib = malloc ( sizeof * lib + path -> size + 1 );
-    if ( lib == NULL )
-        return RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-
-    lib -> handle = NULL;
-    string_copy ( ( char* ) ( lib + 1 ), path -> size + 1, path -> addr, path -> size );
-    StringInit ( & lib -> path, ( char* ) ( lib + 1 ), path -> size, path -> len );
-    KRefcountInit ( & lib -> refcount, 1, "KDylib", "make", lib -> path . addr );
-
-    * libp = lib;
-    return 0;
-}
-
-
-/* SetLogging
- */
-static
-rc_t KDylibSetLogging ( const KDylib *self )
-{
-    rc_t ( CC * set_formatter ) ( KFmtWriter writer, KLogFmtFlags flags, void *data );
-    rc_t ( CC * set_writer ) ( KWrtWriter writer, void *data );
-    rc_t ( CC * set_level ) ( KLogLevel lvl );
-
-    /* set the current logging level */
-    set_level = ( rc_t ( * ) ( KLogLevel ) ) dlsym ( self -> handle, "KLogLevelSet" );
-    if ( set_level != NULL )
-    {
-        KLogLevel lvl = KLogLevelGet ();
-        ( * set_level ) ( lvl );
-    }
-
-    /* determine current library logging */
-    set_writer = ( rc_t ( * ) ( KWrtWriter, void* ) ) dlsym ( self -> handle, "KOutHandlerSet" );
-    if ( set_writer != NULL ) {
-        const KWrtHandler* handler = KOutHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-
-    set_formatter = ( rc_t ( * ) ( KFmtWriter, KLogFmtFlags, void* ) ) dlsym ( self -> handle, "KLogLibFmtHandlerSet" );
-    if ( set_formatter != NULL ) {
-        KLogFmtFlags flags = KLogLibFmtFlagsGet ();
-        const KFmtHandler* fmt_handler = KLogFmtHandlerGet ();
-        ( * set_formatter ) ( fmt_handler -> formatter, flags, fmt_handler -> data );
-    }
-    set_writer = ( rc_t ( * ) ( KWrtWriter, void* ) ) dlsym ( self -> handle, "KLogLibHandlerSet" );
-    if ( set_writer != NULL ) {
-        const KWrtHandler* handler = KLogLibHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-
-    set_formatter = ( rc_t ( * ) ( KFmtWriter, KLogFmtFlags, void* ) ) dlsym ( self -> handle, "KStsLibFmtHandlerSet" );
-    if ( set_formatter != NULL ) {
-        KStsFmtFlags flags = KStsLibFmtFlagsGet ();
-        const KFmtHandler* fmt_handler = KStsFmtHandlerGet ();
-        ( * set_formatter ) ( fmt_handler -> formatter, flags, fmt_handler -> data );
-    }
-    set_writer = ( rc_t ( * ) ( KWrtWriter, void* ) ) dlsym ( self -> handle, "KStsLibHandlerSet" );
-    if ( set_writer != NULL ) {
-        const KWrtHandler* handler = KStsLibHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-#if _DEBUGGING
-    set_writer = ( rc_t ( * ) ( KWrtWriter, void* ) ) dlsym ( self -> handle, "KDbgHandlerSet" );
-    if ( set_writer != NULL ) {
-        const KWrtHandler* handler = KDbgHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-#endif
-    return 0;
-}
-
-/* LoadLib
- *  load a dynamic library
- *
- *  "lib" [ OUT ] - return parameter for loaded library
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target library
- */
-static
-rc_t KDyldLoad ( KDyld *self, KDylib *lib, const char *path )
-{
-    rc_t rc;
-    const char *msg;
-    size_t msg_len;
-
-    lib -> handle = dlopen ( path, path == NULL ? RTLD_LAZY : DLOPEN_MODE );
-    if ( lib -> handle != NULL )
-        return KDylibSetLogging ( lib );
-
-    msg = dlerror ();
-    rc = RC ( rcFS, rcDylib, rcLoading, rcNoObj, rcUnknown );
-
-    msg_len = strlen(msg);
-    if ( msg_len > lib -> path . size + 2 )
-    {
-        const char *cmp = & msg [ lib -> path . size + 2 ];
-        if ( strcmp ( cmp, "cannot open shared object file: No such file or directory" ) == 0 )
-            rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-        else if ( strncmp ( cmp, "undefined symbol: ", sizeof "undefined symbol: " - 1 ) == 0 )
-            rc = RC ( rcFS, rcDylib, rcLoading, rcDylib, rcIncomplete );
-    }
-    if (GetRCState(rc) == rcUnknown) {
-        static const char imageNotFound[] = " image not found";
-        const char *cmp1 = strstr(msg, imageNotFound);
-        const char *cmp2 = msg + msg_len - (sizeof(imageNotFound) - 1);
-        if (cmp1 == cmp2)
-            rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-    }
-    
-    DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_DLL), ("%s: %R %s\n", __func__, rc, msg));
-    if (GetRCState(rc) == rcUnknown) {
-        (void)LOGMSG(klogWarn, (msg));
-    }
-    
-    return rc;
-}
-
-static
-rc_t KDyldVTryLoadLib ( KDyld *self, KDylib **lib,
-    const KDirectory *dir, const char *path, va_list args )
-{
-    rc_t rc;
-
-    const KSysDir *sdir = KDirectoryGetSysDir ( dir );
-    if ( sdir == NULL )
-        rc = RC ( rcFS, rcDylib, rcLoading, rcDirectory, rcIncorrect );
-    else
-    {
-        char real [ PATH_MAX ];
-        rc = KSysDirVRealPath ( sdir, real, sizeof real, path, args );
-        if ( rc == 0 )
-        {
-            String pstr;
-            StringInitCString ( & pstr, real );
-
-            rc = KDylibMake ( lib, & pstr );
-            if ( rc == 0 )
-            {
-                rc = KDyldLoad ( self, * lib, real );
-                if ( rc == 0 )
-                    return 0;
-
-                free ( * lib );
-            }
-        }
-    }
-
-    * lib = NULL;
-
-    return rc;
-}
-
-static
-rc_t KDyldTryLoadLib ( KDyld *self, KDylib **lib,
-    const KDirectory *dir, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, path );
-    rc = KDyldVTryLoadLib ( self, lib, dir, path, args );
-    va_end ( args );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldVLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( lib == NULL )
-        rc = RC ( rcFS, rcDylib, rcLoading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcLoading, rcSelf, rcNull );
-        else if ( path == NULL || path [ 0 ] == 0 )
-        {
-            String pstr;
-            CONST_STRING ( & pstr, "" );
-
-            rc = KDylibMake ( lib, & pstr );
-            if ( rc == 0 )
-            {
-                rc = KDyldLoad ( self, * lib, NULL );
-                if ( rc == 0 )
-                    return 0;
-            
-                free ( * lib );
-            }
-        }
-        else
-        {
-            uint32_t i = VectorStart ( & self -> search );
-            uint32_t end = i + VectorLength ( & self -> search );
-
-            if ( i == end )
-            {
-                char name [ 4096 ];
-                int len = vsnprintf ( name, sizeof name, path, args );
-                if ( len < 0 || len >= sizeof name )
-                    rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcExcessive );
-                else
-                {
-                    String pstr;
-                    StringInit ( & pstr, name, len, string_len ( name, len ) );
-
-                    rc = KDylibMake ( lib, & pstr );
-                    if ( rc == 0 )
-                    {
-                        rc = KDyldLoad ( self, * lib, name );
-                        if ( rc == 0 )
-                            return 0;
-                    
-                        free ( * lib );
-                    }
-                }
-            }
-            else
-            {
-                for ( * lib = NULL; i < end; ++ i )
-                {
-                    const KDirectory *dir;
-
-                    va_list cpy;
-                    va_copy ( cpy, args );
-
-                    dir = ( const void* ) VectorGet ( & self -> search, i );
-                    rc = KDyldVTryLoadLib ( self, lib, dir, path, cpy );
-
-                    va_end ( cpy );
-
-                    if ( rc == 0 || GetRCState ( rc ) != rcNotFound )
-                        return rc;
-                }
-
-                rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-            }
-        }
-
-        * lib = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDyldVLoadLib ( self, lib, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDylibAddRef ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDylib" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDylibRelease ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDylib" ) )
-        {
-        case krefWhack:
-            return KDylibWhack ( ( KDylib* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-static
-void KDylibVectRelease ( void *item, void *ignore )
-{
-    KDylib *self = item;
-    KDylibRelease ( self );
-}
-
-
-/* Attach
- * Sever
- */
-static
-KDylib *KDylibAttach ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDylib" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDylib* ) self;
-}
-
-static
-rc_t KDylibSever ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDylib" ) )
-        {
-        case krefWhack:
-            return KDylibWhack ( ( KDylib* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Sort
- */
-static
-int KDylibSort ( const void *item, const void *n )
-{
-    const KDylib *a = item;
-    const KDylib *b = n;
-    return StringOrderNoNullCheck ( & a -> path, & b -> path );
-}
-
-
-/* FullPath
- *  return full path to library
- */
-LIB_EXPORT rc_t CC KDylibFullPath ( const KDylib *self, char *path, size_t psize )
-{
-    rc_t rc;
-
-    if ( psize == 0 )
-        rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcInsufficient );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            size_t bytes = string_copy ( path, psize,
-                self -> path . addr, self -> path . size );
-            if ( bytes < psize )
-                return 0;
-
-            rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcInsufficient );
-        }
-
-        path [ 0 ] = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDlset
- *  ordered set of dynamic libraries
- *  contained libraries remain resident until set is released
- */
-struct KDlset
-{
-    KDyld *dl;
-    Vector name, ord;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDlsetWhack ( KDlset *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDlset" );
-
-    VectorWhack ( & self -> name, NULL, NULL );
-    VectorWhack ( & self -> ord, KDylibVectRelease, NULL );
-    KDyldSever ( self -> dl );
-    free ( self );
-
-    return 0;
-}
-
-#define STRINGIZE(s) #s
-#define LIBNAME(pref, name, suff) STRINGIZE(pref) name STRINGIZE(suff)
-/* MakeSet
- *  load a dynamic library
- *
- *  "set" [ OUT ] - return parameter for lib set
- */
-LIB_EXPORT rc_t CC KDyldMakeSet ( const KDyld *self, KDlset **setp )
-{
-    rc_t rc = 0;
-
-    if ( setp == NULL )
-        rc = RC ( rcFS, rcDylib, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcConstructing, rcSelf, rcNull );
-        else
-        {
-            KDlset *set = malloc ( sizeof * set );
-            if ( set == NULL )
-                rc = RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                set -> dl = KDyldAttach ( self );
-                VectorInit ( & set -> name, 0, 16 );
-                VectorInit ( & set -> ord, 0, 16 );
-                KRefcountInit ( & set -> refcount, 1, "KDlset", "make", "dlset" );
-#if ! ALWAYS_ADD_EXE
-                {   
-                    KDylib *jni;
-                    const char* libname = LIBNAME(LIBPREFIX, "vdb_jni.", SHLIBEXT);
-                    if ( KDyldLoadLib ( ( KDyld* ) self, & jni, libname ) == 0 )
-                    {
-                        rc = KDlsetAddLib ( set, jni );
-                        KDylibRelease ( jni );
-                    }
-                    if (rc == 0)
-                    {
-                        * setp = set;
-                        return 0;
-                    }
-                }
-#else
-                {
-                    KDylib *exe;
-                    rc = KDyldLoadLib ( ( KDyld* ) self, & exe, NULL );
-                    if ( rc == 0 )
-                    {
-                        rc = KDlsetAddLib ( set, exe );
-                        KDylibRelease ( exe );
-                        if ( rc == 0 )
-                        {
-                            * setp = set;
-                            return 0;
-                        }
-                    }
-                }
-#endif
-                KDlsetRelease ( set );
-            }
-        }
-
-        * setp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDlsetAddRef ( const KDlset *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDlset" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDlsetRelease ( const KDlset *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDlset" ) )
-        {
-        case krefWhack:
-            return KDlsetWhack ( ( KDlset* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddLib
- *  adds a dynamic library to end of ordered set
- *
- *  "lib" [ IN ] - library returned from KDyldLoadLib
- */
-static
-rc_t KDlsetAddLibInt ( KDlset *self, KDylib *lib )
-{
-    uint32_t idx;
-    rc_t rc = VectorAppend ( & self -> ord, & idx, lib );
-    if ( rc == 0 )
-    {
-        void *ignore;
-
-        rc = VectorInsertUnique ( & self -> name,
-            lib, NULL, KDylibSort );
-        if ( rc == 0 )
-            return 0;
-
-        VectorSwap ( & self -> ord, idx, NULL, & ignore );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDlsetAddLib ( KDlset *self, KDylib *lib )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcDylib, rcInserting, rcSelf, rcNull );
-    else if ( lib == NULL )
-        rc = RC ( rcFS, rcDylib, rcInserting, rcDylib, rcNull );
-    else
-    {
-        rc = KDylibAddRef ( lib );
-        if ( rc == 0 )
-        {
-            rc = KDlsetAddLibInt ( self, lib );
-            if ( rc == 0 )
-                return 0;
-
-            KDylibRelease ( lib );
-        }
-    }
-
-    return rc;
-}
-
-
-/* AddAll
- *  adds all dynamic libraries found in dl search path
- */
-static
-rc_t KDlsetTryLib ( const KDirectory *dir,
-    uint32_t type, const char *name, void *data )
-{
-    KDlset *self = data;
-
-    if ( ( type & ~ kptAlias ) == kptFile )
-    {
-        rc_t rc;
-        KDylib *lib;
-#ifdef SHLX
-        /* force simple shared library extension */
-        if ( sizeof SHLX >= 2 )
-        {
-            /* SHLX has at least 1 character plus NUL byte */
-            uint32_t len = strlen ( name );
-            /* name must be at least 1 character larger */
-            if ( len <= ( sizeof SHLX - 1 ) )
-                return 0;
-            /* name must end with shared library extension */
-            if ( memcmp ( & name [ len - ( sizeof SHLX - 1 ) ], SHLX, sizeof SHLX - 1 ) != 0 )
-                return 0;
-        }
-#endif
-        rc = KDyldTryLoadLib ( self -> dl, & lib, dir, name );
-        if ( rc == 0 )
-        {
-            rc = KDlsetAddLibInt ( self, lib );
-            if ( rc == 0 )
-                return 0;
-
-            KDylibRelease ( lib );
-        }
-    }
-
-    return 0;
-}
-
-static
-void KDlsetVisitDir ( const KDirectory *dir, void *data )
-{
-    KDirectoryVisit ( dir, false, KDlsetTryLib, data, "." );
-}
-
-LIB_EXPORT rc_t CC KDlsetAddAll ( KDlset *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDylib, rcInserting, rcSelf, rcNull );
-    KDyldForEach ( self -> dl, KDlsetVisitDir, self );
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KSymAddr
- *  symbol address within a dynamic library
- */
-struct KSymAddr
-{
-    KDylib *lib;
-    void *addr;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KSymAddrWhack ( KSymAddr *self )
-{
-    KRefcountWhack ( & self -> refcount, "KSymAddr" );
-
-    KDylibSever ( self -> lib );
-    free ( self );
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KSymAddrAddRef ( const KSymAddr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KSymAddr" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSymAddrRelease ( const KSymAddr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KSymAddr" ) )
-        {
-        case krefWhack:
-            return KSymAddrWhack ( ( KSymAddr* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KSymAddrMake ( KSymAddr **symp,
-    const KDylib *lib, const char *name )
-{
-    void *addr = dlsym ( lib -> handle, name );
-    const char *estr = dlerror();
-    
-    if ( addr != NULL || estr == NULL )
-    {
-        KSymAddr *sym = malloc ( sizeof * sym );
-        if ( sym == NULL )
-            return RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-
-        sym -> lib = KDylibAttach ( lib );
-        sym -> addr = addr;
-        KRefcountInit ( & sym -> refcount, 1, "KSymAddr", "make", name );
-        * symp = sym;
-        return 0;
-    }
-
-    * symp = NULL;
-    return RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-}
-
-
-/* Symbol
- *  find a symbol within dynamic library
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- */
-LIB_EXPORT rc_t CC KDylibSymbol ( const KDylib *self, KSymAddr **sym, const char *name )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else
-        {
-            return KSymAddrMake ( sym, self, name );
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-typedef struct KDlsetTrySymData KDlsetTrySymData;
-struct KDlsetTrySymData
-{
-    const KDlset *self;
-    const char *name;
-
-    bool ( CC * test ) ( const KSymAddr *sym, void *data );
-    void *data;
-
-    KSymAddr *sym;
-    rc_t rc;
-    bool first;
-};
-
-static
-bool KDlsetTrySymbol ( void *item, void *data )
-{
-    KSymAddr *sym;
-    KDlsetTrySymData *pb = data;
-    pb -> rc = KDylibSymbol ( item, & sym, pb -> name );
-    if ( pb -> rc == 0 )
-    {
-        /* simple case */
-        if ( pb -> test == NULL )
-        {
-            pb -> sym = sym;
-            return true;
-        }
-
-        /* apply filter function */
-        if ( ( * pb -> test ) ( sym, pb -> data ) )
-        {
-            KSymAddrRelease ( pb -> sym );
-            pb -> sym = sym;
-            return pb -> first;
-        }
-
-        KSymAddrRelease ( sym );
-    }
-    return false;
-}
-
-LIB_EXPORT rc_t CC KDlsetSymbol ( const KDlset *self, KSymAddr **sym, const char *name )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-
-            if ( VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb ) )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-
-/* FirstSymbol
- * LastSymbol
- *  find a symbol within dynamic library set matching criteria
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- *
- *  "test" [ IN ] and "data" [ IN, OPAQUE ] - callback filter function
- *  return true if symbol matches criteria
- */
-LIB_EXPORT rc_t CC KDlsetFirstSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else if ( test == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcFunction, rcNull );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . test = test;
-            pb . data = data;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-            pb . first = true;
-
-            if ( VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb ) )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDlsetLastSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else if ( test == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcFunction, rcNull );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . test = test;
-            pb . data = data;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-
-            VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb );
-            if ( pb . sym != NULL )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-
-/* List - PRIVATE
- *  list the paths to the libraries in the set
- */
-typedef struct list_dylib_param list_dylib_param;
-struct list_dylib_param
-{
-    VNamelist *list;
-    rc_t rc;
-};
-
-static
-bool CC list_dylib ( void *item, void *data )
-{
-    list_dylib_param *pb = data;
-    const KDylib *lib = ( const void* ) item;
-
-    /* "lib" was created with KDylibMake
-       which creates a NUL terminated path.
-       of course, this could seg-fault if bad... */
-    assert ( lib -> path . addr [ lib -> path . size ] == 0 );
-
-    pb -> rc = VNamelistAppend ( pb -> list, lib -> path . addr );
-    return pb -> rc != 0;
-}
-
-LIB_EXPORT rc_t CC KDlsetList ( const KDlset *self, KNamelist **listp )
-{
-    list_dylib_param pb;
-
-    assert ( listp != NULL );
-
-    if ( self == NULL )
-        pb . rc = RC ( rcFS, rcDylib, rcListing, rcSelf, rcNull );
-    else
-    {
-        pb . rc = VNamelistMake ( & pb . list, VectorLength ( & self -> name ) );
-        if ( pb . rc == 0 )
-        {
-            bool fail = VectorDoUntil ( & self -> name, false, list_dylib, & pb );
-            if ( ! fail )
-                pb . rc = VNamelistToNamelist ( pb . list, listp );
-
-            VNamelistRelease ( pb . list );
-        }
-    }
-
-    return pb . rc;
-}
-
-
-/* AsObj
- * AsFunc
- *  retrieve symbol address as pointer to object
- */
-LIB_EXPORT void * CC KSymAddrAsObj ( const KSymAddr *self )
-{
-    if ( self != NULL )
-        return self -> addr;
-    return NULL;
-}
-
-LIB_EXPORT void CC KSymAddrAsFunc ( const KSymAddr *self, fptr_t *fp )
-{
-    if ( self != NULL && fp != NULL )
-        * fp = ( fptr_t ) self -> addr;
-}
-
-
diff --git a/libs/kfs/unix/sysfile-priv.h b/libs/kfs/unix/sysfile-priv.h
deleted file mode 100644
index 34d2a40..0000000
--- a/libs/kfs/unix/sysfile-priv.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef USE_TIMEOUT
-#define USE_TIMEOUT false
-#endif
-
-#ifndef USE_NO_TIMEOUT_TTY
-#define USE_NO_TIMEOUT_TTY false
-#endif
-
-#ifndef _h_sysfile_priv_
-#define _h_sysfile_priv_
-
-#ifndef _h_kfs_impl_
-#include <kfs/impl.h>
-#endif
-
-#include <sys/select.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KSysFile
- *  a Unix file
- */
-typedef struct KSysFile KSysFile;
-struct KSysFile
-{
-    KFile dad;
-    int fd;
-#if USE_TIMEOUT
-    fd_set fds;
-    struct timeval to;
-    bool use_to;
-#endif
-};
-
-/* KSysFileMake
- *  create a new file object
- *  from file descriptor
- */
-rc_t KSysFileMake ( KSysFile **fp, int fd, const char *path, bool read_enabled, bool write_enabled );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sysfile_priv_ */
diff --git a/libs/kfs/unix/sysfile.c b/libs/kfs/unix/sysfile.c
deleted file mode 100644
index 5b98275..0000000
--- a/libs/kfs/unix/sysfile.c
+++ /dev/null
@@ -1,1057 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSysFile;
-#define KFILE_IMPL struct KSysFile
-
-#include <kfs/extern.h>
-#include "sysfile-priv.h"
-#include <kfs/kfs-priv.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-
-
-#ifndef __USE_UNIX98
-#define __USE_UNIX98 1
-#endif
-#include <unistd.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <assert.h>
-#include <string.h>
-
-#ifdef _DEBUGGING
-#define SYSDEBUG(msg) DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_SYS),msg)
-#else
-#define SYSDEBUG(msg)
-#endif
-
-/*--------------------------------------------------------------------------
- * KSysFile
- *  a Unix file
- */
-
-
-#if USE_TIMEOUT
-/* default timeout amount 3 seconds is 10,000 milliseconds */
-#define TIMEOUT_MSECS (3 * 1000)
-
-int32_t KSysFileTimeout = TIMEOUT_MSECS;
-
-enum
-{
-    select_read = 1,
-    select_write = 2,
-    select_exception = 4
-} select_operations;
-
-static
-rc_t KSysFileSelect (const KSysFile * self, uint32_t operations)
-{
-    rc_t rc = 0;
-
-    SYSDEBUG(( "%s: Enter (%p, %x)\n", __func__, self, operations));
-
-
-    if (self->use_to)
-    {
-        fd_set fdsread;
-        fd_set fdswrite;
-        fd_set fdsexcept;
-        struct timeval to;
-        int selected;
-
-        fdsread = self->fds;
-        fdswrite = self->fds;
-        fdsexcept = self->fds;
-
-        to = self->to;
-
-        for (rc = 0; rc == 0; ) 
-        {
-            SYSDEBUG(( "%s: call select\n", __func__));
-
-            selected = select (self->fd + 1, 
-                               (operations & select_read) ? &fdsread : NULL,
-                               (operations & select_write) ? &fdswrite : NULL,
-                               (operations & select_exception) ? &fdsexcept : NULL,
-                               &to);
-            SYSDEBUG(( "%s: select returned '%d' \n", __func__, selected));
-
-            if (selected == 0)
-            {
-
-                rc = RC (rcFS, rcFile, rcSelecting, rcTimeout, rcDone);
-            }
-            else if (selected < 0)
-            {
-                int lerrno = errno;
-
-                switch (lerrno)
-                {
-                case EINVAL:
-                    rc = RC (rcFS, rcFile, rcSelecting, rcTimeout, rcInvalid);
-                    LOGERR (klogInt, rc, "coding error bad timeout or negative nfds");
-                    break;
-
-                case EBADF:
-                    rc = RC ( rcFS, rcFile, rcSelecting, rcFileDesc, rcInvalid );
-                    PLOGERR (klogErr,
-                             (klogErr, rc, "system bad file descriptor error fd='$(E)'",
-                              "E=%d", self->fd));
-                    break;
-
-                case EINTR:/*  A signal was caught. */
-                    continue;
-
-                case ENOMEM:
-                    rc = RC (rcFS, rcFile, rcSelecting, rcMemory, rcExhausted);
-                    LOGERR (klogErr, rc, "out of memory setting up read timeout");
-                    break;
-                }
-                /* function documentation seems to show that unless EINTR was 
-                 * set we can now do our read
-                 */
-            }
-            else
-            {
-                assert (FD_ISSET (self->fd, &fdsread) ||
-                        FD_ISSET (self->fd, &fdswrite) ||
-                        FD_ISSET (self->fd, &fdsexcept));
-
-                return 0;
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-
-/* Destroy
- */
-static
-rc_t KSysFileDestroy ( KSysFile *self )
-{
-    rc_t rc = 0;
-    int lerrno;
-
-    if ( close ( self -> fd ) != 0 ) switch ( lerrno = errno )
-    {
-    case EBADF:
-        rc = RC ( rcFS, rcFile, rcDestroying, rcFunction, rcIncomplete );
-        PLOGERR (klogInt,
-                 (klogInt, rc, "system bad file descriptor error '$(F)'",
-                  "F=%d", self->fd));
-        break;
-
-    case EINTR:
-        rc = RC ( rcFS, rcFile, rcDestroying, rcFunction, rcIncomplete );
-        LOGERR (klogErr, rc, "system interrupted function error");
-        return rc;
-
-    default:
-        rc = RC ( rcFS, rcFile, rcDestroying, rcNoObj, rcUnknown );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(S)($(E))'",
-                 "S=%!,E=%d", lerrno, lerrno));
-        return rc;
-    }
-
-    free ( self );
-    return 0;
-}
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-static
-KSysFile *KSysFileGetSysFile ( const KSysFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return ( KSysFile* ) self;
-}
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *  certain file types ( notably compressors ) will refuse random access
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t KSysFileRandomAccess ( const KSysFile *self )
-{
-    struct stat st;
-    rc_t rc = 0;
-    int lerrno;
-    if ( fstat ( self -> fd, & st ) != 0 ) switch ( lerrno = errno )
-    {
-    case EBADF:
-        rc = RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "system bad file descriptor error fd='$(F)'",
-                  "F=%d", self->fd));
-        return rc;
-
-    default:
-        rc = RC ( rcFS, rcFile, rcAccessing, rcNoObj, rcUnknown );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(F)($(E))'",
-                  "F=%!,E=%d", lerrno, lerrno));
-        return rc;
-    }
-
-    if ( ! S_ISREG ( st . st_mode ) )
-    {
-        rc = RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-        /* not a deadly error so don't log now         
-        LOGERR (klogErr, (klogErr, rc, ""));
-        */
-        return rc;
-    }
-    return 0;
-}
-
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t KSysFileType ( const KSysFile *self )
-{
-    struct stat st;
-
-    if ( fstat ( self -> fd, & st ) != 0 )
-        return kfdInvalid;
-
-    if ( ! S_ISREG ( st . st_mode ) )
-    {
-        if ( S_ISCHR ( st . st_mode ) )
-            return kfdCharDev;
-        if ( S_ISBLK ( st . st_mode ) )
-            return kfdBlockDev;
-        if ( S_ISFIFO ( st . st_mode ) )
-            return kfdFIFO;
-        if ( S_ISSOCK ( st . st_mode ) )
-            return kfdSocket;
-    }
-
-    return kfdFile;
-}
-
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t KSysFileSize ( const KSysFile *self, uint64_t *size )
-{
-    struct stat st;
-    rc_t rc = 0;
-    int lerrno;
-
-    if ( fstat ( self -> fd, & st ) != 0 ) switch ( lerrno = errno )
-    {
-    case EBADF:
-        rc = RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-        PLOGERR (klogInt,
-                 (klogInt, rc, "system bad file descriptor error fd='$(F)'",
-                  "F=%d", self->fd));
-        return rc;
-    default:
-        rc = RC ( rcFS, rcFile, rcAccessing, rcNoObj, rcUnknown );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(F)($(E))'",
-                  "F=%!,E=%d", lerrno, lerrno));
-        return rc;
-    }
-
-    if ( S_ISDIR ( st . st_mode ) )
-/*         return RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect ); */
-        return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-
-    * size = st . st_size;
-
-    return 0;
-}
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t KSysFileSetSize ( KSysFile *self, uint64_t size )
-{
-    rc_t rc;
-    int lerrno;
-
-    if ( ftruncate ( self -> fd, size ) != 0 ) switch ( lerrno = errno )
-    {
-    case EBADF:
-        rc = RC ( rcFS, rcFile, rcUpdating, rcFileDesc, rcInvalid );
-        PLOGERR (klogInt,
-                (klogInt, rc, "system bad file descriptor error fd='$(E)'",
-                 "E=%d", self->fd));
-        return rc;
-    default:
-        rc = RC ( rcFS, rcFile, rcUpdating, rcNoObj, rcUnknown );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(S)($(E))'",
-                  "S=%!,E=%d", lerrno, lerrno));
-        return rc;
-    }
-
-    return 0;
-}
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t KSysFileRead ( const KSysFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-    assert (num_read != NULL);
-
-    *num_read = 0;
-
-    while ( 1 )
-    {
-        ssize_t count;
-        int lerrno;
-
-#if USE_TIMEOUT
-        rc = KSysFileSelect (self, select_read | select_exception);
-        if (rc)
-            return rc;
-#endif
-
-        count = pread ( self -> fd, buffer, bsize, pos );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case EINTR:
-            continue;
-        case EIO:
-            rc = RC ( rcFS, rcFile, rcReading, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error - likely broken pipe");
-            return rc;
-
-        case EBADF:
-            rc = RC ( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "system bad file descriptor error fd='$(E)'",
-                      "E=%d", self->fd));
-            return rc;
-
-        case EISDIR:
-            rc = RC ( rcFS, rcFile, rcReading, rcFileDesc, rcIncorrect );
-            LOGERR (klogErr, rc, "system misuse of a directory error");
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcFS, rcFile, rcReading, rcParam, rcInvalid );
-            LOGERR (klogErr, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcFS, rcFile, rcReading, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error '$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_read != NULL );
-        * num_read = count;
-        break;
-    }
-
-    return 0;
-}
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t KSysFileWrite ( KSysFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    assert ( self != NULL );
-    while ( 1 )
-    {
-        rc_t rc;
-        int lerrno;
-        ssize_t count;
-
-#if USE_TIMEOUT
-        rc = KSysFileSelect (self, select_write | select_exception);
-        if (rc)
-            return rc;
-#endif
-
-        count = pwrite ( self -> fd, buffer, size, pos );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case ENOSPC:
-            rc = RC ( rcFS, rcFile, rcWriting, rcStorage, rcExhausted );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "system bad file descriptor error fd='$(E)'",
-                      "E=%d", self->fd));
-            return rc;
-
-        case EINTR:
-            continue;
-
-        case EFBIG:
-            rc = RC ( rcFS, rcFile, rcWriting, rcFile, rcExcessive );
-            LOGERR (klogErr, rc, "system file too large error");
-            return rc;
-
-        case EIO:
-            rc = RC ( rcFS, rcFile, rcWriting, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error");
-            return rc;
-
-        case EBADF:
-            rc = RC ( rcFS, rcFile, rcWriting, rcFileDesc, rcInvalid );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "system bad file descriptor error fd='$(E)'",
-                      "E=%d", self->fd));
-            return rc;
-
-        case EISDIR:
-            rc = RC ( rcFS, rcFile, rcWriting, rcFileDesc, rcIncorrect );
-            LOGERR (klogErr, rc, "system misuse of a directory error");
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-            LOGERR (klogErr, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcFS, rcFile, rcWriting, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error errno='$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_writ != NULL );
-        * num_writ = count;
-        break;
-    }
-
-    return 0;
-}
-
-
-/* Make
- *  create a new file object
- *  from file descriptor
- */
-static KFile_vt_v1 vtKSysFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KSysFileDestroy,
-    KSysFileGetSysFile,
-    KSysFileRandomAccess,
-    KSysFileSize,
-    KSysFileSetSize,
-    KSysFileRead,
-    KSysFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-
-static
-rc_t KSysFileMakeVT ( KSysFile **fp, int fd, const KFile_vt *vt,
-    const char *path, bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-    KSysFile *f;
-
-    if ( fd < 0 )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        PLOGERR (klogInt,
-                 (klogInt, rc, "invalid file descriptor $(F)",
-                  "F=%d", fd));
-        return rc;
-    }
-
-    f = calloc ( sizeof * f, 1 );
-    if ( f == NULL )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        LOGERR (klogErr, rc, "out of memory");
-        return rc;
-    }
-    else
-    {
-#if USE_TIMEOUT
-        if (KSysFileTimeout >= 0)
-        {
-            f->to.tv_sec = KSysFileTimeout / 1000;
-            f->to.tv_usec = (KSysFileTimeout % 1000) * 1000;
-            f->use_to = true;
-            FD_ZERO (&f->fds);
-            FD_SET (fd, &f->fds);
-        }
-#endif
-
-        rc = KFileInit ( & f -> dad, vt, "KSysFile", path, read_enabled, write_enabled );
-        if ( rc == 0 )
-        {
-            f -> fd = fd;
-            * fp = f;
-            return 0;
-        }
-
-        free ( f );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KSysFileMake ( KSysFile **fp, int fd, const char *path, bool read_enabled, bool write_enabled )
-{
-    return KSysFileMakeVT ( fp, fd, ( const KFile_vt* ) & vtKSysFile,
-        path, read_enabled, write_enabled );
-}
-
-/*--------------------------------------------------------------------------
- * KFile
- *  Unix-specific standard i/o interfaces
- */
-
-typedef struct KStdIOFile KStdIOFile;
-struct KStdIOFile
-{
-    KSysFile dad;
-    uint64_t pos;
-};
-
-
-/* Destroy
- *  does not close fd
- */
-static
-rc_t KStdIOFileDestroy ( KSysFile *self )
-{
-    free ( self );
-    return 0;
-}
-
-static KFile_vt_v1 vtKStdIOFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KStdIOFileDestroy,
-    KSysFileGetSysFile,
-    KSysFileRandomAccess,
-    KSysFileSize,
-    KSysFileSetSize,
-    KSysFileRead,
-    KSysFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-
-/* RandomAccess
- */
-static
-rc_t KStdIOFileRandomAccess ( const KSysFile *self )
-{
-/*     return RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect ); */
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* Size
- */
-static
-rc_t KStdIOFileSize ( const KSysFile *self, uint64_t *size )
-{
-    * size = 0;
-
-/*     return RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect ); */
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-/* SetSize
- */
-static
-rc_t KStdIOFileSetSize ( KSysFile *self, uint64_t size )
-{
-/*     return RC ( rcFS, rcFile, rcUpdating, rcFileDesc, rcIncorrect ); */
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t KStdIOFileRead ( const KSysFile *dad, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-
-    KStdIOFile *self = ( KStdIOFile* ) dad;
-    assert ( self != NULL );
-
-    if ( self -> pos != pos )
-    {
-        rc = RC ( rcFS, rcFile, rcReading, rcParam, rcInvalid );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Bad position for STDIO read $(P) instead of $(O)",
-                  "P=%lu,O=%lu", pos, self->pos));
-        return rc;
-    }
-
-    while ( 1 )
-    {
-        ssize_t count;
-        int lerrno;
-
-#if USE_TIMEOUT
-        rc = KSysFileSelect (&self->dad, select_read | select_exception);
-        if (rc)
-            return rc;
-#endif
-
-        count = read ( self -> dad . fd, buffer, bsize );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case EINTR:
-            continue;
-
-        case EIO:
-            rc = RC ( rcFS, rcFile, rcReading, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error - broken pipe");
-            return rc;
-
-        case EBADF:
-            rc = RC ( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-            PLOGERR (klogInt,
-                     (klogInt, rc, "system bad file descriptor fd='$(E)'",
-                      "E=%d", self->dad.fd));
-            return rc;
-
-        case EISDIR:
-            rc = RC ( rcFS, rcFile, rcReading, rcFileDesc, rcIncorrect );
-            LOGERR (klogInt, rc, "system misuse of a directory error");
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcFS, rcFile, rcReading, rcParam, rcInvalid );
-            LOGERR (klogErr, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcFS, rcFile, rcReading, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error '$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_read != NULL );
-        * num_read = count;
-        self -> pos += count;
-        break;
-    }
-
-    return 0;
-}
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t KStdIOFileWrite ( KSysFile *dad, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    rc_t rc;
-    KStdIOFile *self = ( KStdIOFile* ) dad;
-    assert ( self != NULL );
-
-    if ( self -> pos != pos )
-    {
-        rc = RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Bad position for STDIO write $(P) instead of $(O)",
-                  "P=%lu,O=%lu", pos, self->pos));
-        return rc;
-    }
-
-    while ( 1 )
-    {
-        int lerrno;
-        ssize_t count;
-
-#if USE_TIMEOUT
-        rc = KSysFileSelect (&self->dad, select_read | select_exception);
-        if (rc)
-            return rc;
-#endif
-
-        count = write ( self -> dad . fd, buffer, size );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case ENOSPC:
-            rc = RC ( rcFS, rcFile, rcWriting, rcStorage, rcExhausted );
-            LOGERR (klogErr, rc, "system device full error");
-            return rc;
-
-        case EINTR:
-            continue;
-
-        case EFBIG:
-            rc = RC ( rcFS, rcFile, rcWriting, rcFile, rcExcessive );
-            LOGERR (klogErr, rc, "system file too big error");
-            return rc;
-
-        case EIO:
-            rc = RC ( rcFS, rcFile, rcWriting, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error - broken pipe");
-            return rc;
-            
-        case EBADF:
-            rc = RC ( rcFS, rcFile, rcWriting, rcFileDesc, rcInvalid );
-            PLOGERR (klogInt,
-                     (klogInt, rc, "system bad file descriptor error fd=$(F)",
-                      "F=%d", lerrno, self->dad.fd));
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcFS, rcFile, rcWriting, rcParam, rcInvalid );
-            LOGERR (klogInt, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcFS, rcFile, rcWriting, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error '$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_writ != NULL );
-        * num_writ = count;
-        self -> pos += count;
-        break;
-    }
-
-    return 0;
-}
-
-static KFile_vt_v1 vtKStdIOStream =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KStdIOFileDestroy,
-    KSysFileGetSysFile,
-    KStdIOFileRandomAccess,
-    KStdIOFileSize,
-    KStdIOFileSetSize,
-    KStdIOFileRead,
-    KStdIOFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-
-static
-rc_t KStdIOFileTest ( KFile **rp, int fd, bool *seekable, bool *readable, bool *writable )
-{
-    struct stat st;
-    int lerrno;
-    rc_t rc = 0;
-
-    if ( rp == NULL )
-        return RC ( rcFS, rcFile, rcCreating, rcParam, rcNull );
-
-    * rp = NULL;
-
-    if ( fstat ( fd, & st ) == 0 )
-    {
-        int fl;
-
-        if ( S_ISREG ( st . st_mode ) )
-            * seekable = true;
-        else
-            * seekable = false;
-
-        fl = fcntl ( fd, F_GETFL ) & O_ACCMODE;
-        switch (fl)
-        {
-        case O_RDONLY:
-            *readable = true;
-            *writable = false;
-            break;
-        case O_WRONLY:
-            *readable = false;
-            *writable = true;
-            break;
-        case O_RDWR:
-            *readable = true;
-            *writable = true;
-            break;
-        }
-    }
-    else switch (lerrno = errno)
-    {
-    case EBADF:
-        rc = RC ( rcFS, rcFile, rcCreating, rcFileDesc, rcInvalid );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "system error bad file descriptor '$(F)'",
-                  "F=%d", fd));
-        break;
-    default:
-        rc = RC ( rcFS, rcFile, rcCreating, rcNoObj, rcUnknown );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(F) ($(E))'",
-                  "F=%!,E=%d", lerrno, lerrno));
-        break;
-    }
-
-    return rc;
-}
-
-static
-rc_t KStdIOFileMake ( KFile **fp, int fd,
-    bool seekable, bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-    KStdIOFile *f;
-
-    if ( seekable )
-    {
-        return KSysFileMakeVT ( ( KSysFile** ) fp, fd,
-            ( const KFile_vt* ) & vtKStdIOFile, "stdio-file", read_enabled, write_enabled );
-    }
-
-    if ( fd < 0 )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        PLOGERR (klogInt,
-                 (klogInt, rc, "invalid file descriptor $(F)",
-                  "F=%d", fd));
-        return rc;
-    }
-    else
-    {
-        f = calloc ( sizeof *f, 1 );
-        if ( f == NULL )
-        {
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            LOGERR (klogErr, rc, "out of memory");
-        }
-        else
-        {
-#if USE_TIMEOUT
-            if ((KSysFileTimeout >= 0)
-#if USE_NO_TIMEOUT_TTY
-                && (! isatty (fd)
-#endif
-                    )
-            {
-                KSysFile * ff = &f->dad;
-
-                ff->to.tv_sec = KSysFileTimeout / 1000;
-                ff->to.tv_usec = (KSysFileTimeout % 1000) * 1000;
-                ff->use_to = true;
-                FD_ZERO (&ff->fds);
-                FD_SET (fd, &ff->fds);
-            }
-#endif
-            rc = KFileInit ( &f->dad.dad, (const KFile_vt*) &vtKStdIOStream,
-                             "KStdIOFile", "fd", read_enabled, write_enabled );
-            if ( rc == 0 )
-            {
-                f -> dad . fd = fd;
-                f -> pos = 0;
-                * fp = & f -> dad . dad;
-                return 0;
-            }
-
-            free ( f );
-        }
-    }
-    return rc;
-}
-
-/* MakeStdIn
- *  creates a read-only file on stdin
- */
-LIB_EXPORT rc_t CC KFileMakeStdIn ( const KFile **std_in )
-{
-    bool seekable;
-    bool readable;
-    bool writable;
-    rc_t rc = KStdIOFileTest ( ( KFile** ) std_in, 0, & seekable, & readable, & writable );
-    if ( rc != 0 )
-        return rc;
-    if ( ! readable )
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcWriteonly );
-
-    return KStdIOFileMake ( ( KFile** ) std_in, 0, seekable, true, false );
-}
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only file on stdout or stderr
- */
-LIB_EXPORT rc_t CC KFileMakeStdOut ( KFile **std_out )
-{
-    bool seekable;
-    bool readable;
-    bool writable;
-    rc_t rc = KStdIOFileTest ( std_out, 1, & seekable, & readable, & writable );
-    if ( rc != 0 )
-        return rc;
-    if ( ! writable )
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcReadonly );
-
-    return KStdIOFileMake ( std_out, 1, seekable, false, true );
-}
-
-LIB_EXPORT rc_t CC KFileMakeStdErr ( KFile **std_err )
-{
-    bool seekable;
-    bool readable;
-    bool writable;
-    rc_t rc = KStdIOFileTest ( std_err, 2, & seekable, & readable, & writable );
-    if ( rc != 0 )
-        return rc;
-    if ( ! writable )
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcReadonly );
-
-    return KStdIOFileMake ( std_err, 2, seekable, false, true );
-}
-
-/* MakeFDFile
- *  creates a file from a file-descriptor
- *  not supported under Windows
- */
-LIB_EXPORT rc_t CC KFileMakeFDFileRead ( const KFile **f, int fd )
-{
-    bool seekable;
-    bool readable;
-    bool writable;
-    rc_t rc = KStdIOFileTest ( ( KFile** ) f, fd, & seekable, & readable, & writable );
-    if ( rc != 0 )
-        return rc;
-    if ( ! readable )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcWriteonly );
-        LOGERR (klogErr, rc, "error constructing read file from write only file descriptor");
-        return rc;
-    }
-    return KStdIOFileMake ( ( KFile** ) f, fd, seekable, true, false );
-}
-
-LIB_EXPORT rc_t CC KFileMakeFDFileWrite ( KFile **f, bool update, int fd )
-{
-    bool seekable;
-    bool readable;
-    bool writable;
-    rc_t rc = KStdIOFileTest ( f, fd, & seekable, & readable, & writable );
-    if ( rc != 0 )
-        return rc;
-    if ( update && ! readable )
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcWriteonly );
-    if ( ! writable )
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcReadonly );
-
-    return KStdIOFileMake ( f, fd, seekable, update, true );
-}
diff --git a/libs/kfs/unix/syslockfile.c b/libs/kfs/unix/syslockfile.c
deleted file mode 100644
index 57aaa4c..0000000
--- a/libs/kfs/unix/syslockfile.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-typedef struct KExclAccessFile KExclAccessFile;
-#define KFILE_IMPL KExclAccessFile
-
-#include <kfs/extern.h>
-#include <kfs/lockfile.h>
-#include <kfs/impl.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * KExclAccessFile
- */
-struct KExclAccessFile
-{
-    KFile dad;
-    KLockFile *lock;
-    KFile *f;
-};
-
-static
-rc_t KExclAccessFileDestroy ( KExclAccessFile *self )
-{
-    rc_t rc = KFileRelease ( self -> f );
-    if ( rc == 0 )
-    {
-        KLockFileRelease ( self -> lock );
-        free ( self );
-    }
-    return rc;
-}
-
-static
-struct KSysFile *KExclAccessFileGetSysFile ( const KExclAccessFile *self, uint64_t *offset )
-{
-    return KFileGetSysFile ( self -> f, offset );
-}
-
-static
-rc_t KExclAccessFileRandomAccess ( const KExclAccessFile *self )
-{
-    return KFileRandomAccess ( self -> f );
-}
-
-static
-rc_t KExclAccessFileSize ( const KExclAccessFile *self, uint64_t *size )
-{
-    return KFileSize ( self -> f, size );
-}
-
-static
-rc_t KExclAccessFileSetSize ( KExclAccessFile *self, uint64_t size )
-{
-    return KFileSetSize ( self -> f, size );
-}
-
-static
-rc_t KExclAccessFileRead ( const KExclAccessFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    return KFileRead ( self -> f, pos, buffer, bsize, num_read );
-}
-
-static
-rc_t KExclAccessFileWrite ( KExclAccessFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return KFileWrite ( self -> f, pos, buffer, size, num_writ );
-}
-
-static
-uint32_t KExclAccessFileType ( const KExclAccessFile * self )
-{
-    return KFileType ( self -> f );
-}
-
-static KFile_vt_v1 KExclAccessFile_vt =
-{
-    1, 1,
-
-    KExclAccessFileDestroy,
-    KExclAccessFileGetSysFile,
-    KExclAccessFileRandomAccess,
-    KExclAccessFileSize,
-    KExclAccessFileSetSize,
-    KExclAccessFileRead,
-    KExclAccessFileWrite,
-    KExclAccessFileType
-};
-
-static
-rc_t KExclAccessFileMake ( KExclAccessFile **fp, KLockFile *lock, KFile *f )
-{
-    rc_t rc;
-    KExclAccessFile *xf = malloc ( sizeof * xf );
-    if ( xf == NULL )
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KFileInit ( & xf -> dad, ( const KFile_vt* ) & KExclAccessFile_vt,
-            "KExclAccessFile", "no-name", f -> read_enabled, f -> write_enabled );
-        if ( rc == 0 )
-        {
-            xf -> lock = lock;
-            xf -> f = f;
-            * fp = xf;
-            return 0;
-        }
-
-        free ( xf );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  interface extensions
- */
-
-
-/* CreateExclusiveAccessFile
- *  opens a file with exclusive write access
- *
- *  "fp" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryVCreateExclusiveAccessFile ( KDirectory *self, KFile **fp,
-    bool update, uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( fp == NULL )
-        rc = RC ( rcFS, rcFile, rcLocking, rcParam, rcNull );
-    else
-    {
-        /* create the path */
-        char full [ 4096 ];
-        rc = KDirectoryVResolvePath ( self, true, full, sizeof full, path, args );
-        if ( rc == 0 )
-        {
-            KLockFile *lock;
-
-            /* acquire the lock */
-            rc = KDirectoryCreateLockFile ( self, & lock, "%s.lock", full );
-            if ( rc == 0 )
-            {
-                KFile *f;
-
-                /* create the file */
-                rc = KDirectoryCreateFile ( self, & f, update, access, mode, full );
-                if ( rc == 0 )
-                {
-                    KExclAccessFile *xf;
-
-                    /* wrap the file */
-                    rc = KExclAccessFileMake ( & xf, lock, f );
-                    if ( rc == 0 )
-                    {
-                        * fp = & xf -> dad;
-                        return 0;
-                    }
-
-                    KFileRelease ( f );
-                }
-
-                KLockFileRelease ( lock );
-            }
-        }
-
-        * fp = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kfs/unix/sysmmap-priv.h b/libs/kfs/unix/sysmmap-priv.h
deleted file mode 100644
index 6740eb1..0000000
--- a/libs/kfs/unix/sysmmap-priv.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysmmap_priv_
-#define _h_sysmmap_priv_
-
-#ifndef _h_mmap_priv_
-#include "../mmap-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-struct KMMap
-{
-    uint64_t off;
-    uint64_t pos;
-    size_t size;
-    char *addr;
-
-    struct KFile *f;
-    size_t pg_size;
-
-    uint32_t addr_adj;
-    uint32_t size_adj;
-
-    KRefcount refcount;
-
-    bool read_only;
-    bool sys_mmap;
-    bool dirty;
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sysmmap_priv_ */
diff --git a/libs/kfs/unix/sysmmap.c b/libs/kfs/unix/sysmmap.c
deleted file mode 100644
index 21bb985..0000000
--- a/libs/kfs/unix/sysmmap.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "sysmmap-priv.h"
-#include "sysfile-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-
-/* Make
- */
-rc_t KMMapMake ( KMMap **mmp )
-{
-    KMMap *mm = calloc ( 1, sizeof * mm );
-    if ( mm == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-    
-    mm -> pg_size = sysconf ( _SC_PAGE_SIZE );
-
-    * mmp = mm;
-
-    return 0;
-}
-
-
-/* RWSys
- */
-rc_t KMMapRWSys ( KMMap *self, uint64_t pos, size_t size )
-{
-    KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-    if ( sf == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-
-    self -> addr = mmap ( 0, size,
-        PROT_READ | PROT_WRITE, MAP_SHARED, sf -> fd, pos );
-    if ( self -> addr != ( char* ) MAP_FAILED )
-        return 0;
-
-    switch ( errno )
-    {
-    case EBADF:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFileDesc, rcInvalid );
-    case EACCES:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-    case ETXTBSY:
-    case ENODEV:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcInvalid );
-    case EAGAIN:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFunction, rcIncomplete );
-    case ENOMEM:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    return RC ( rcFS, rcMemMap, rcConstructing, rcNoObj, rcUnknown );
-}
-
-
-/* ROSys
- */
-rc_t KMMapROSys ( KMMap *self, uint64_t pos, size_t size )
-{
-    KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-    if ( sf == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-
-    self -> addr = mmap ( 0, size,
-        PROT_READ, MAP_SHARED, sf -> fd, pos );
-    if ( self -> addr != ( char* ) MAP_FAILED )
-        return 0;
-
-    switch ( errno )
-    {
-    case EBADF:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFileDesc, rcInvalid );
-    case EACCES:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcNoPerm );
-    case ETXTBSY:
-    case ENODEV:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcInvalid );
-    case EAGAIN:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFunction, rcIncomplete );
-    case ENOMEM:
-        return RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-    }
-
-    return RC ( rcFS, rcMemMap, rcConstructing, rcNoObj, rcUnknown );
-}
-
-
-/* Unmap
- *  removes a memory map
- */
-rc_t KMMapUnmap ( KMMap *self )
-{
-    if ( self -> size != 0 )
-    {
-        if ( munmap ( self -> addr - self -> addr_adj,
-                 self -> size + self -> size_adj ) )
-        {
-            if ( errno != EINVAL )
-                return RC ( rcFS, rcMemMap, rcDestroying, rcNoObj, rcUnknown );
-        }
-
-        self -> addr = NULL;
-        self -> size = 0;
-    }
-
-    return 0;
-}
diff --git a/libs/kfs/win/lnk_tools.c b/libs/kfs/win/lnk_tools.c
deleted file mode 100644
index 853d441..0000000
--- a/libs/kfs/win/lnk_tools.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sysalloc.h>
-
-#include <Shlobj.h>
-
-#define LNK_RES_ERROR 0
-#define LNK_RES_FILE 1
-#define LNK_RES_DIR 2
-
-#define LNK_FLAG_HasLinkTargetIDList 0x1
-#define LNK_FLAG_HasLinkInfo 0x2
-#define LNK_FLAG_HasName 0x4
-#define LNK_FLAG_HasRelativePath 0x8
-#define LNK_FLAG_HasWorkingDir 0x10
-#define LNK_FLAG_HasArguments 0x20
-#define LNK_FLAG_HasIconLocation 0x40
-#define LNK_FLAG_IsUniCode 0x80
-#define LNK_FLAG_ForceNoLinkInfo 0x100
-#define LNK_FLAG_HasExpString 0x200
-#define LNK_FLAG_RunInSeparateProcess 0x400
-#define LNK_FLAG_Unused1 0x800
-#define LNK_FLAG_HasDarwinID 0x1000
-#define LNK_FLAG_RunAsUser 0x2000
-#define LNK_FLAG_HasExpIcon 0x4000
-#define LNK_FLAG_NoPidIAlias 0x8000
-#define LNK_FLAG_Unused2 0x10000
-#define LNK_FLAG_RunWithShimLayer 0x20000
-#define LNK_FLAG_ForceNoLinkTrack 0x40000
-#define LNK_FLAG_EnableTargetMatdata 0x80000
-#define LNK_FLAG_DisableLinkPathTracking 0x100000
-#define LNK_FLAG_DisableKnowFolderTracking 0x200000
-#define LNK_FLAG_DisableKnowFolderAlias 0x400000
-#define LNK_FLAG_AllowLinkToLink 0x800000
-#define LNK_FLAG_UnaliasOnSave 0x1000000
-
-
-#define LNK_ATTR_FILE_ATTRIBUTE_READONLY 0x1
-#define LNK_ATTR_FILE_ATTRIBUTE_HIDDEN 0x2
-#define LNK_ATTR_FILE_ATTRIBUTE_SYSTEM 0x4
-#define LNK_ATTR_Reserved1 0x8
-#define LNK_ATTR_FILE_ATTRIBUTE_DIRECTORY 0x10
-#define LNK_ATTR_FILE_ATTRIBUTE_ARCHIVE 0x20
-#define LNK_ATTR_Reserved2 0x40
-#define LNK_ATTR_FILE_ATTRIBUTE_NORMAL 0x80
-#define LNK_ATTR_FILE_ATTRIBUTE_TEMPORARY 0x100
-#define LNK_ATTR_FILE_ATTRIBUTE_SPARSE_FILE 0x200
-#define LNK_ATTR_FILE_ATTRIBUTE_REPARSE_POINT 0x400
-#define LNK_ATTR_FILE_ATTRIBUTE_COMPRESSED 0x800
-#define LNK_ATTR_FILE_ATTRIBUTE_OFFLINE 0x1000
-#define LNK_ATTR_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x2000
-#define LNK_ATTR_FILE_ATTRIBUTE_ENCRYPTED 0x4000
-
-/* the first 20 "magic" bytes of a MS-lnk-file
-   ( 4 bytes header-size and 16 bytes LinkCLSID ) */
-const unsigned char lnk_ref[ 20 ] =
-{
-    0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x46
-};
-
-
-static bool has_lnk_extension( const wchar_t *path )
-{
-    size_t len = wcslen( path );
-
-    if ( len < 5 ) return false;
-    if ( path[ len - 4 ] != '.' ) return false;
-    if ( path[ len - 3 ] != 'l' && path[ len - 3 ] != 'L' ) return false;
-    if ( path[ len - 2 ] != 'n' && path[ len - 2 ] == 'N' ) return false;
-    if ( path[ len - 1 ] != 'k' && path[ len - 1 ] == 'K' ) return false;
-    return true;
-}
-
-
-static bool add_lnk_extension( wchar_t *path, const size_t path_size )
-{
-    size_t len = wcslen( path );
-    if ( len + 5 >= path_size )
-        return false;
-    path[ len + 0 ] = '.';
-    path[ len + 1 ] = 'l';
-    path[ len + 2 ] = 'n';
-    path[ len + 3 ] = 'k';
-    path[ len + 5 ] = 0;
-    return true;
-}
-
-
-static HANDLE lnk_file_open( const wchar_t *path, DWORD * filesize )
-{
-    HANDLE hfile = CreateFileW( path,           // file to open
-                         GENERIC_READ,          // open for reading
-                         FILE_SHARE_READ,       // share for reading
-                         NULL,                  // default security
-                         OPEN_EXISTING,         // existing file only
-                         FILE_ATTRIBUTE_NORMAL, // normal file
-                         NULL );                // no attr. template
-    if ( hfile != INVALID_HANDLE_VALUE )
-    {
-        if ( filesize != NULL )
-            *filesize = GetFileSize( hfile, NULL );
-    }
-    return hfile;
-}
-
-
-static bool lnk_file_exists( const wchar_t *path )
-{
-    HANDLE hFile = lnk_file_open( path, NULL );
-    if ( hFile != INVALID_HANDLE_VALUE )
-    {
-        CloseHandle( hFile );
-        return true;
-    }
-    else
-        return false;
-}
-
-
-static unsigned char * lnk_file_read( HANDLE hfile, const size_t n_bytes, DWORD * read )
-{
-    unsigned char * res;
-
-    if ( read != NULL ) *read = 0;
-    res = (unsigned char *)malloc( n_bytes );
-    if ( res != NULL )
-    {
-        DWORD dwBytesRead;
-        if ( FALSE == ReadFile( hfile, res, n_bytes, &dwBytesRead, NULL ) )
-        {
-            free( res );
-            res = NULL;
-        }
-        else
-        {
-            if ( read != NULL )
-                *read = dwBytesRead;
-        }
-    }
-    return res;
-}
-
-
-static DWORD lnk_file_get_DWORD( const unsigned char * buffer, const int idx )
-{
-    DWORD res = 0;
-    memcpy( &res, &(buffer[ idx ]), sizeof( res ) );
-    return res;
-}
-
-static WORD lnk_file_get_WORD( const unsigned char * buffer, const int idx )
-{
-    WORD res = 0;
-    memcpy( &res, &(buffer[ idx ]), sizeof( res ) );
-    return res;
-}
-
-
-static bool lnk_file_validate_buffer( const unsigned char * buffer, const size_t buffsize )
-{
-    bool res = ( buffsize >= sizeof lnk_ref );
-    if ( res )
-        res = ( 0 == memcmp ( buffer, lnk_ref, sizeof lnk_ref ) );
-    return res;
-}
-
-
-/* the path is given in windows-native notation and wide-char */
-static bool lnk_file_validate( const wchar_t *path )
-{
-    HANDLE hfile;
-    bool res;
-
-    hfile = lnk_file_open( path, NULL );
-    res = ( hfile != INVALID_HANDLE_VALUE );
-    if ( res )
-    {
-        DWORD dwBytesRead;
-        unsigned char * buffer = lnk_file_read( hfile, 32, &dwBytesRead );
-        CloseHandle( hfile );
-        res = ( buffer != NULL );
-        if ( res )
-        {
-            res = lnk_file_validate_buffer( buffer, dwBytesRead );
-            free( buffer );
-        }
-    }
-    return res;
-}
-
-/*  resolves a lnk file, after it's content was loaded into a buffer
-    buffer   ...    IN  points to the file-content
-    buffsize ...    IN  also the size of the lnk-file
-    resolved ...    OUT resolved path as wchar_t in windows-native form
-
-    return-value    0 ... resolving failed
-                    1 ... resolved path is a file
-                    2 ... resolved path is a directory
-*/
-static int lnk_file_resolve_buffer( const unsigned char * buffer, const size_t buffsize,
-                                    wchar_t ** resolved )
-{
-    char * base_path = NULL;
-    int res = LNK_RES_ERROR;
-    if ( lnk_file_validate_buffer( buffer, buffsize ) )
-    {
-        int idx = 0x4C;
-        DWORD flags = lnk_file_get_DWORD( buffer, 0x14 );
-        DWORD attr  = lnk_file_get_DWORD( buffer, 0x18 );
-
-        /* we have to handle the TargetIDList even if it is of no relevance
-        to resolving the link, just to get the correct index for the next
-        section */
-        if ( flags & LNK_FLAG_HasLinkTargetIDList )
-            idx += ( lnk_file_get_WORD( buffer, idx ) + 2 );
-        if ( flags & LNK_FLAG_HasLinkInfo )
-        {
-            DWORD base_path_ofs = lnk_file_get_DWORD( buffer, idx + 16 );
-            if ( base_path_ofs > 0 )
-            {
-                const char * src = (const char *)&( buffer[ idx + base_path_ofs ]);
-                if ( *src != 0 )
-                {
-                    size_t required;
-                    errno_t e = mbstowcs_s( &required, NULL, 0, src, 0 );
-                    if ( required > 0 )
-                    {
-                        *resolved = (wchar_t *) malloc( ( required + 1 ) * 2 );
-                        if ( *resolved )
-                        {
-                            size_t converted;
-                            mbstowcs_s( &converted, *resolved, required + 1, src, required + 1 );
-                            if ( attr & LNK_ATTR_FILE_ATTRIBUTE_DIRECTORY )
-                                res = LNK_RES_DIR;
-                            else
-                                res = LNK_RES_FILE;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return res;
-}
-
-
-/* translate a given lnk-file (full path) 'c:\somewhere\alink.lnk' 
-   into the path the lnk-file contains: 
-   'c:\somewhere\subpath\file.txt'
-   or 
-   'c:\anotherpath\sub\sub\file.txt' 
-   */
-static int lnk_file_resolve( const wchar_t *lnk_file, wchar_t ** resolved )
-{
-    HANDLE hfile;
-    DWORD dwFileSize;
-    int res = LNK_RES_ERROR;
-
-    if ( resolved != NULL )
-    {
-        *resolved = NULL;
-        hfile = lnk_file_open( lnk_file, &dwFileSize );
-        if ( hfile != INVALID_HANDLE_VALUE )
-        {
-            unsigned char * buffer = lnk_file_read( hfile, (size_t)dwFileSize, NULL );
-            if ( buffer != NULL )
-            {
-                res = lnk_file_resolve_buffer( buffer, dwFileSize, resolved );
-                free( buffer );
-            }
-        }
-    }
-    return res;
-}
-
-
-static bool win_path_exists( const wchar_t * path )
-{
-    bool res = false;
-    if ( path != NULL )
-    {
-        HANDLE hfile = CreateFileW( path, 
-                                0, /* do not ask for RD or WR, that prevents access-denied-err */
-                                FILE_SHARE_READ, /* needed to get a handle to obj's that are shared */
-                                NULL,
-                                OPEN_EXISTING,
-                                FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
-                                NULL );
-        if ( hfile != INVALID_HANDLE_VALUE )
-        {
-            res = true;
-            CloseHandle( hfile );
-        }
-#if _DEBUGGING
-        else
-        {
-            DWORD status = GetLastError ();
-            switch ( status )
-            {
-            case ERROR_FILE_NOT_FOUND:
-            case ERROR_PATH_NOT_FOUND:
-                break;
-            default:
-                DBGMSG ( DBG_KFS, DBG_FLAG_ANY, ( "win_path_exists: WARNING - unrecognized error code - %u.", status ) );
-            }
-        }
-#endif
-    }
-    return res;
-}
-
-static
-wchar_t * less_brain_dead_wcsdup ( const wchar_t * path )
-{
-    if ( path != NULL )
-    {
-        size_t len = wcslen ( path ) + 3;
-        wchar_t *cpy = malloc ( len * sizeof * cpy );
-        if ( cpy != NULL )
-            return wcscpy ( cpy, path );
-    }
-    return NULL;
-}
-
-static size_t win_existing_path( const wchar_t *path )
-{
-    size_t res = 0;
-    wchar_t * temp = less_brain_dead_wcsdup( path );
-    if ( temp != NULL )
-    {
-        wchar_t * part = wcsrchr( temp, L'\\' );
-        while ( part != NULL && res == 0 )
-        {
-            *part = 0;
-            if ( win_path_exists( temp ) )
-                res = ( part - temp );
-            else
-                part = wcsrchr( temp, L'\\' );
-        }
-        free( temp );
-    }
-    return res;
-}
-
-
-static wchar_t * win_assemble_lnk( const wchar_t *path, const size_t exists, size_t * remaining )
-{
-    wchar_t * res = NULL;
-    if ( path != NULL && remaining != NULL )
-    {
-        size_t path_len, buff_len;
-
-        *remaining = 0;
-        path_len = wcslen( path );
-        #define ExtraChars 5
-        buff_len = ( path_len + ExtraChars ) * sizeof( * path );
-        res = (wchar_t *)malloc( buff_len );
-        if ( res != NULL )
-        {
-            size_t term;
-            const wchar_t * from = ( path + exists + 1 );
-            const wchar_t * next_bs = wcschr( from, L'\\' );
-            if ( next_bs == NULL )
-                term = path_len;
-            else
-            {
-                term = ( next_bs - path );
-                *remaining = term;
-            }
-            /* if the string to be copied does not fit into the buffer 
-               wcsncpy_s will terminate the application instead of returning
-               an error !!! */
-            wcsncpy_s( res, path_len + ExtraChars, path, term ); /* 2nd argument is in elements, not bytes */
-            res[ term + 0 ] = L'.';
-            res[ term + 1 ] = L'l';
-            res[ term + 2 ] = L'n';
-            res[ term + 3 ] = L'k';
-            res[ term + 4 ] = 0;
-        }
-        #undef ExtraChars
-    }
-    return res;
-}
-
-
-static wchar_t * win_assemble_path( const wchar_t *part1, const wchar_t *part2 )
-{
-    wchar_t *res = NULL;
-    if ( part1 != NULL && part2 != NULL )
-    {
-        size_t len1 = wcslen( part1 );
-        size_t len2 = wcslen( part2 );
-        res = (wchar_t *)malloc( ( len1 + len2 + 1 ) * sizeof( * part1 ) );
-        if ( res != NULL )
-        {
-            /* if the string to be copied does not fit into the buffer 
-               wcsncpy_s will terminate the application instead of returning
-               an error !!! */
-            wcsncpy_s( res, len1+1, part1, len1 );
-            wcsncpy_s( res+len1, len2+1, part2, len2 );
-            res[ len1 + len2 ] = 0;
-        }
-    }
-    return res;
-}
-
-
-static bool win_resolve_path( const wchar_t *path, wchar_t ** resolved, const int depth )
-{
-    bool res = false;
-
-    if ( depth > 10 )
-        return res;
-    if ( resolved != NULL )
-    {
-        *resolved = NULL;
-        res = win_path_exists( path );
-        if ( res )
-            /* the given path exists, no need to resolve links... */
-            *resolved = less_brain_dead_wcsdup( path );
-        else
-        {
-            /* detect the part of the path that does exist
-            exists points at the backslash behind the existing path */
-            size_t exists = win_existing_path( path );
-            if ( exists > 0 )
-            {
-                size_t remaining;
-                wchar_t * possible_lnk = win_assemble_lnk( path, exists, &remaining );
-                if ( possible_lnk != NULL )
-                {
-                    wchar_t * lnk_resolved = NULL;
-                    int status = lnk_file_resolve( possible_lnk, &lnk_resolved );
-                    if ( status != LNK_RES_ERROR )
-                    {
-                        if ( remaining > 0 )
-                        {
-                            wchar_t * new_path = win_assemble_path( lnk_resolved, path + remaining );
-                            free( lnk_resolved );
-                            if ( new_path != NULL )
-                            {
-                                res = win_resolve_path( new_path, resolved, depth + 1 );
-                                free( new_path );
-                            }
-                        }
-                        else
-                        {
-                            *resolved = lnk_resolved;
-                            res = true;
-                        }
-                    }
-                    free( possible_lnk );
-                }
-            }
-        }
-    }
-    return res;
-}
-
-
-bool win_CreateLink( const wchar_t * target, const wchar_t * lnk_file, const wchar_t * desc )
-{ 
-    bool res = false;
-    HRESULT hres;
-    IShellLink * psl; 
-
-    // Get a pointer to the IShellLink interface. 
-    hres = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, 
-                             &IID_IShellLink, (LPVOID*)&psl ); 
-    if ( SUCCEEDED( hres ) ) 
-    { 
-        IPersistFile* ppf; 
- 
-        // Set the path to the shortcut target and add the description. 
-        psl -> lpVtbl -> SetPath( psl, target );
-        if ( desc != NULL )
-            psl -> lpVtbl -> SetDescription( psl, desc ); 
- 
-        // Query IShellLink for the IPersistFile interface for saving the 
-        // shortcut in persistent storage. 
-        hres = psl -> lpVtbl -> QueryInterface( psl, &IID_IPersistFile, (LPVOID*)&ppf ); 
-        if ( SUCCEEDED( hres ) ) 
-        { 
-            // Save the link by calling IPersistFile::Save. 
-            hres = ppf -> lpVtbl -> Save( ppf, lnk_file, TRUE );
-            res = SUCCEEDED( hres );
-            ppf -> lpVtbl -> Release( ppf );
-        } 
-        psl -> lpVtbl -> Release( psl );
-    } 
-    return res; 
-}
diff --git a/libs/kfs/win/sysdir-priv.h b/libs/kfs/win/sysdir-priv.h
deleted file mode 100644
index 1ae8cc7..0000000
--- a/libs/kfs/win/sysdir-priv.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysdir_priv_
-#define _h_sysdir_priv_
-
-#ifndef _h_kfs_impl_
-#include <kfs/impl.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  a Windows extension
- */
-
-
-/* MakeFromRealPath
- *  creates a KDirectory from a Windows path
- */
-rc_t KDirectoryMakeFromRealPath ( KDirectory **dirp,
-    const wchar_t *real, bool update, bool chroot );
-
-
-/*--------------------------------------------------------------------------
- * KSysDir
- *  a Windows directory
- */
-typedef struct KSysDir KSysDir;
-
-
-#if 0
-/* MakePath
- *  create a full path from partial
- *
- *  "ctx" [ IN ] - a prepared context for returning non-zero rc_t
- *
- *  "canon" [ IN ] - if true, rewrite path in canonical form. usually
- *  not required when passing a path to the system, as the OS performs
- *  its own processing.
- *
- *  "bufer" [ OUT ] and "path_max" [ IN ] - return buffer for processed path
- *
- *  "path" [ IN ] and "args" [ IN, NULL OKAY ] - input path to be resolved
- */
-rc_t KSysDirMakePath ( const KSysDir* self, enum RCContext ctx, bool canon,
-	wchar_t *buffer, size_t path_max, const char *path, va_list args );
-#endif
-
-
-/* OSPath
- *  returns a real OS path
- */
-rc_t KSysDirOSPath ( const KSysDir *self,
-    wchar_t *real, size_t bsize, const char *path, va_list args );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sysdir_priv_ */
diff --git a/libs/kfs/win/sysdir.c b/libs/kfs/win/sysdir.c
deleted file mode 100644
index 2aa89cb..0000000
--- a/libs/kfs/win/sysdir.c
+++ /dev/null
@@ -1,2954 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSysDir;
-
-#define UNICODE 1
-#define _UNICODE 1
-
-#define KDIR_IMPL struct KSysDir
-
-#include "sysfile-priv.h"
-#include <klib/namelist.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/klib-priv.h>
-
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <wchar.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <WINDOWS.H>
-#include <WINNT.H>
-
-#include "lnk_tools.c"
-
-#ifndef IO_REPARSE_TAG_SYMLINK
-#define IO_REPARSE_TAG_SYMLINK 0xA000000C
-#endif
-
-
-/* Missing functions from our text library
- * size is bytes; max_chars is number of elements
- */
-
-/* utf16_utf32
- *  converts UTF16 text to a single UTF32 character
- *  returns the number of UTF16 words consumed, such that:
- *    return > 0 means success
- *    return == 0 means insufficient input
- *    return < 0 means bad input or bad argument
- */
-static
-int utf16_utf32 ( uint32_t *dst, const wchar_t *begin, const wchar_t *end )
-{
-    uint32_t ch;
-    const wchar_t *src, *stop;
-
-    if ( dst == NULL || begin == NULL || end == NULL )
-        return -1;
-
-    if ( begin == end )
-        return 0;
-
-    /* windows utf16 */
-
-    ch = (uint32_t)(begin [0]);
-
-    if ((ch < 0xD800) || (ch <= 0xE000))
-    {
-        *dst = ch;
-        return 1;
-    }
-    else
-    {
-        uint32_t ch;
-
-        /* need at least 2 words */
-        if (begin >= end)
-            return -1;
-
-        /* extreme checks */
-        if (((begin[0] & 0xFC00) != 0xD8) ||
-            ((begin[1] & 0xFC00) != 0xDC))
-            return -1;
-
-        ch = (begin[0] & 0x03FF) << 10 |
-            (begin[1] & 0x03FF);
-        return 2;
-    }
-}
-
-
-/* utf32_utf16
- *  converts a single UTF32 character to UTF16 text
- *  returns the number of UTF16 words generated, such that:
- *    return > 0 means success
- *    return == 0 means insufficient output
- *    return < 0 means bad character or bad argument
- */
-static 
-int utf32_utf16 ( wchar_t *begin, wchar_t *end, uint32_t ch )
-{
-    if (ch < 0x10000)
-    {
-        if ((ch <= 0xDFFF) && (ch >= 0xD800))
-            return -1;
-
-        begin[0] = (uint16_t)ch;
-        return 1;
-    }
-    else if ((ch >= 0x10FFFF) || (end <= begin))
-        return -1;
-    else
-    {
-        uint32_t cch;
-
-        cch = ch - 0x10000;
-        /* cch <= 0xFFFFF since ch < 0x10FFFF */
-
-        begin[0] = 0xD800 | (cch >> 10); /* upper 10 bits */
-        begin[1] = 0xDC00 | (cch & 0x3FF); /* lower 10 bita */
-        return 2;
-    }
-}
-
-
-static int wstrcase_cmp (const wchar_t * a, size_t asize,
-                         const wchar_t * b, size_t bsize,
-                         uint32_t max_chars)
-{
-    uint32_t num_chars;
-    const wchar_t *aend, *bend;
-
-    assert ( a != NULL && b != NULL );
-
-    /* set up end limit triggers */
-    aend = a + asize;
-    bend = b + bsize;
-
-    num_chars = 0;
-
-    while ( a < aend && b < bend )
-    {
-        uint32_t ach, bch;
-
-        /* read a character from a */
-        int len = utf16_utf32 ( & ach, a, aend );
-        if ( len <= 0 )
-        {
-            asize -= ( size_t ) ( aend - a );
-            break;
-        }
-        a += len;
-
-        /* read a character from b */
-        len = utf16_utf32 ( & bch, b, bend );
-        if ( len <= 0 )
-        {
-            bsize -= ( size_t ) ( bend - b );
-            break;
-        }
-        b += len;
-
-        /* compare characters with case */
-        if ( ach != bch )
-        {
-            /* only go lower case if they differ */
-            ach = towlower ( ( wint_t ) ach );
-            bch = towlower ( ( wint_t ) bch );
-
-            if ( ach != bch )
-            {
-                if ( ach < bch )
-                    return -1;
-                return 1;
-            }
-        }
-
-        /* if char count is sufficient, we're done */
-        if ( ++ num_chars == max_chars )
-            return 0;
-    }
-
-    /* one or both reached end < max_chars */
-    if (asize < bsize)
-        return -1;
-    return asize > bsize;
-}
-
-/*--------------------------------------------------------------------------
- * KSysDirEnum
- *  a Windows directory enumerator
- */
-typedef struct KSysDirEnum KSysDirEnum;
-struct KSysDirEnum
-{
-    HANDLE handle;
-    WIN32_FIND_DATAW fd;
-    int found;
-    bool first;
-};
-
-/* Whack
- */
-static
-void KSysDirEnumWhack ( KSysDirEnum *self )
-{
-    FindClose( self->handle );
-}
-
-/* Init
- */
-static
-rc_t KSysDirEnumInit ( KSysDirEnum *self, const wchar_t *path )
-{
-    uint32_t err;
-    rc_t rc;
-
-    self -> first = true;
-    self -> handle = FindFirstFileW ( path, & self -> fd );
-    if ( self -> handle != INVALID_HANDLE_VALUE )
-    {
-        self -> found = 1;
-        return 0;
-    }
-
-    self -> found = 0;
-    err = GetLastError ();
-    switch ( err )
-    {
-    case ERROR_FILE_NOT_FOUND:
-    case ERROR_PATH_NOT_FOUND:
-        rc = RC ( rcFS, rcDirectory, rcListing, rcPath, rcNotFound );
-        break;
-    default :
-        rc = RC ( rcFS, rcDirectory, rcListing, rcNoObj, rcUnknown );
-    }
-
-    PLOGERR ( klogInfo,
-             ( klogInfo, rc, "error FindFirstFileW - $(E) - $(C)",
-              "E=%!,C=%u", err, err ) ); 
-
-    return rc;
-}
-
-
-static
-rc_t KSysDirEnumInitAll ( KSysDirEnum *self, wchar_t *path, uint32_t path_length )
-{
-    /* prepare the path for KSysDirEnumInit() */
-    path [ path_length + 0 ] = '\\';
-    path [ path_length + 1 ] = '*';
-    path [ path_length + 2 ] = '.';
-    path [ path_length + 3 ] = '*';
-    path [ path_length + 4 ] = 0;
-
-    return KSysDirEnumInit ( self, path );
-}
-
-/* Next
- */
-static
-const wchar_t *KSysDirEnumNext ( const KSysDirEnum *cself )
-{
-    KSysDirEnum* self = (KSysDirEnum*)cself;
-
-    while( self->found )
-    {
-        if ( self -> first )
-            self -> first = false;
-        else
-            self->found = FindNextFileW( self->handle, &self->fd );
-
-        if ( self->found )
-        {
-            /* filter out the '.' and '..' entries */
-            if ( self ->fd.cFileName[ 0 ] == '.' )
-            {
-                switch ( self->fd.cFileName[ 1 ] )
-                {
-                case 0:
-                    continue;
-                case '.':
-                    if ( self->fd.cFileName[ 2 ] == 0 )
-                        continue;
-                    break; 
-                }
-            }
-            return self->fd.cFileName;
-        }
-    }
-
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * KSysDirListing
- *  a Windows directory listing
- */
-typedef VNamelist KSysDirListing;
-
-static
-int KSysDirListingSort ( const void *a, const void *b )
-{
-    size_t A,B,M;
-    A = wchar_string_size (a);
-    B = wchar_string_size (b);
-    /* close enough for max chars? */
-    M = (A>B) ? A : B;
-
-    return wstrcase_cmp (a, A, b, B, M);
-}
-
-static
-rc_t KSysDirListingInit ( KSysDirListing *self, const wchar_t *path, const KDirectory *dir,
-    bool ( CC * f ) ( const KDirectory*, const char*, void* ), void *data )
-{
-    KSysDirEnum list;
-    rc_t rc = KSysDirEnumInit ( & list, path );
-    if ( rc == 0 )
-    {
-        const wchar_t *name;
-        char utf8_name[ MAX_PATH ];
-        size_t utf8_size, utf16_size;
-
-        while ( ( name = KSysDirEnumNext ( & list ) ) != NULL )
-        {
-            utf16_size = wchar_string_size ( name );
-            utf8_size = wchar_cvt_string_copy ( utf8_name, sizeof( utf8_name ), name, utf16_size );
-            if ( utf8_size >= sizeof( utf8_name ) )
-            {
-                rc = RC(rcFS, rcDirectory, rcListing, rcName, rcExcessive );
-                break;
-            }
-
-            if ( f != NULL )
-            {
-                if ( ! ( * f ) ( dir, utf8_name, data ) )
-                    continue;
-            }
-            
-            rc = VNamelistAppend( self, utf8_name );
-            if ( rc != 0 )
-            {
-                break;
-            }
-
-        }
-
-        KSysDirEnumWhack ( & list );
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * KSysDir
- *  a Windows directory
- */
-typedef struct KSysDir KSysDir;
-struct KSysDir
-{
-    KDirectory dad;
-    uint32_t root;
-    uint32_t length;
-    wchar_t path [ MAX_PATH ];
-};
-
-
-/* helper function to translate a windows-error-code into rc-code */
-static
-rc_t translate_file_error( DWORD error, enum RCContext ctx )
-{
-    switch ( error )
-    {
-    case ERROR_FILE_NOT_FOUND :
-    case ERROR_PATH_NOT_FOUND :
-    case ERROR_INVALID_DRIVE :
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcNotFound );
-
-    case ERROR_ALREADY_EXISTS:
-    case ERROR_FILE_EXISTS :
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcExists );
-
-/*    case ERROR_PATH_NOT_FOUND : */
-    case ERROR_INVALID_NAME :
-    case ERROR_BAD_PATHNAME :
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-    case ERROR_ACCESS_DENIED :
-    case ERROR_INVALID_ACCESS :
-    case ERROR_SHARING_VIOLATION :
-    case ERROR_LOCK_VIOLATION :
-    case ERROR_PATH_BUSY :
-    case ERROR_WRITE_PROTECT :
-    case ERROR_DELETE_PENDING :
-        return RC ( rcFS, rcDirectory, ctx, rcDirectory, rcUnauthorized );
-
-    case ERROR_NOT_ENOUGH_MEMORY :
-    case ERROR_OUTOFMEMORY :
-        return RC ( rcFS, rcDirectory, ctx, rcMemory, rcExhausted );
-
-    case ERROR_TOO_MANY_OPEN_FILES :
-        return RC ( rcFS, rcDirectory, ctx, rcFileDesc, rcExhausted );
-
-    case ERROR_HANDLE_DISK_FULL :
-        return RC ( rcFS, rcDirectory, ctx, rcStorage, rcExhausted );
-
-    case ERROR_BUFFER_OVERFLOW :
-    case ERROR_FILENAME_EXCED_RANGE :
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-    }
-    return RC ( rcFS, rcDirectory, ctx, rcNoObj, rcUnknown );
-}
-
-
-/* helper */
-
-static rc_t print_error_for( const wchar_t * path, const char * function, enum RCContext ctx, KLogLevel level )
-{
-    DWORD error = GetLastError();
-    rc_t rc = translate_file_error( error, ctx );
-#if _DEBUGGING
-    char buffer[ 4096 ];
-    size_t src_size, dst_size, len;
-    wchar_cvt_string_measure ( path, &src_size, &dst_size );
-    len = wchar_cvt_string_copy ( buffer, sizeof buffer, path, src_size );
-    buffer[ len ] = 0;
-    PLOGERR ( level,
-              ( level, rc, "error $(F) - $(E) - $(C) for $(D)",
-                "F=%s,E=%!,C=%u,D=%s", function, error, error, buffer ) ); 
-#endif
-    return rc;
-}
-
-
-static void wchar_2_char( const wchar_t * path, char * buffer, size_t buflen )
-{
-    size_t src_size, dst_size, len;
-    wchar_cvt_string_measure ( path, &src_size, &dst_size );
-    len = wchar_cvt_string_copy ( buffer, buflen, path, src_size );
-    buffer[ len ] = 0;
-}
-
-
-static
-uint32_t KSysDirPathTypeFromFindData ( WIN32_FIND_DATA *find_data, 
-                                       const wchar_t * path,
-                                       const uint32_t type )
-{
-    uint32_t res = type;
-
-    if( ( find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) != 0 )
-    {
-        res = kptDir;
-    }
-    else if ( ( find_data->dwFileAttributes & FILE_ATTRIBUTE_DEVICE ) != 0 )
-    {
-        res = kptCharDev;
-    }
-
-    /* add in alias bit */
-    if ( ( find_data->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ) != 0 )
-    {
-        if ( ( find_data->dwReserved0 & IO_REPARSE_TAG_SYMLINK ) != 0 )
-            res |= kptAlias;
-    }
-    else
-    {
-        if ( has_lnk_extension( path ) ) /* lnk_tools.c */
-            if ( lnk_file_validate( path ) ) /* lnk_tools.c */
-                res |= kptAlias;
-    }
-    return res;
-}
-
-static
-uint32_t KSysDirResolvePathAndDetectPathType ( const wchar_t *path )
-{
-    uint32_t res = kptNotFound;
-    wchar_t *resolved;
-    if ( win_resolve_path( path, &resolved, 1 ) ) /* lnk_tools.c */
-    {
-        WIN32_FIND_DATA find_data;
-        HANDLE f_findfile = FindFirstFileW( resolved, &find_data );
-        if ( f_findfile != INVALID_HANDLE_VALUE )
-        {
-            FindClose( f_findfile );
-            res = KSysDirPathTypeFromFindData ( &find_data, resolved, kptFile );
-        }
-        else
-        {
-            uint32_t err = GetLastError();
-            switch( err )
-            {
-            case ERROR_BAD_NETPATH:
-            case ERROR_BAD_NET_NAME:
-                /* see if the netpath is a server
-                   NB - our special wcsdup allocated extra space for this */
-                wcscat ( resolved, L"\\*" );
-                f_findfile = FindFirstFileW( resolved, &find_data );
-                if ( f_findfile != INVALID_HANDLE_VALUE )
-                {
-                    FindClose ( f_findfile );
-                    res = kptDir;
-                    break;
-                }
-                /* no break */
-            case ERROR_FILE_NOT_FOUND:
-            case ERROR_PATH_NOT_FOUND:
-                res = kptNotFound;
-                break;
-
-            default:
-                res = kptBadPath;
-            }
-        }
-        free( resolved );
-    }
-    return res;
-}
-
-/* KSysDirPathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-static
-uint32_t KSysDirFullPathType ( const wchar_t *path )
-{
-    WIN32_FIND_DATA find_data;
-    HANDLE f_findfile = FindFirstFileW( path, &find_data );
-    if ( f_findfile == INVALID_HANDLE_VALUE )
-    {
-        DWORD status = GetLastError ();
-        switch( status )
-        {
-        case ERROR_FILE_NOT_FOUND:
-        case ERROR_PATH_NOT_FOUND:
-        case ERROR_BAD_NETPATH:
-        case ERROR_BAD_NET_NAME:
-            /* try to follow the path, section by section
-               if a section cannot be found try to resolve it as
-               MS-shell-link ( .lnk file ) */
-            return KSysDirResolvePathAndDetectPathType ( path );
-        default:
-            DBGMSG ( DBG_KFS, DBG_FLAG_ANY, ( "FindFirstFileW: WARNING - unrecognized return code - %u.\n", status ) );
-            print_error_for( path, "FindFirstFileW", rcResolving, klogErr );
-            return kptBadPath;
-        }
-    }
-    FindClose( f_findfile );
-    return KSysDirPathTypeFromFindData ( &find_data, path, kptFile );
-}
-
-
-/* KSysDirMake
- *  allocate an uninialized object
- */
-static
-KSysDir *KSysDirMake ( size_t path_size )
-{
-    KSysDir *dir = malloc ( sizeof *dir - sizeof dir->path +
-        4 * sizeof dir -> path [ 0 ] + path_size );
-    return dir;
-}
-
-
-/* KSysDirDestroy
- */
-static
-rc_t CC KSysDirDestroy ( KSysDir *self )
-{
-    free ( self );
-    return 0;
-}
-
-/* KSysDirCanonPath
- */
-static
-rc_t KSysDirCanonPath ( const KSysDir *self, enum RCContext ctx, wchar_t *path, uint32_t path_length )
-{
-    wchar_t *low, *dst, *last, *end = path + path_length;
-
-    if ( self -> root != 0 )
-        low = path + self -> root;
-    else if ( path [ 1 ] == ':' )
-        low = path + 2;
-    else
-        low = path;
-    dst = last = low;
-
-    while( 1 )
-    {
-        wchar_t *src = wcschr ( last + 1, '\\' );
-        if ( src == NULL )
-            src = end;
-
-        /* detect special sequences */
-        switch ( src - last )
-        {
-        case 2:
-            if ( last [ 1 ] == '.' )
-            {
-                /* skip over */
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-
-        case 3:
-            if ( last [ 1 ] == '.' && last [ 2 ] == '.' )
-            {
-                /* remove previous leaf in path */
-                dst [ 0 ] = 0;
-                dst = wcsrchr ( path, '\\' );
-                if ( dst == NULL || dst < low )
-                    return RC( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-                last = src;
-                if ( src != end )
-                    continue;
-            }
-            break;
-        }
-
-        /* if rewriting, copy leaf */
-        assert ( src >= last );
-
-        /* if rewriting, copy leaf */
-        if ( dst != last )
-            memmove ( dst, last, ( src - last ) * sizeof * dst );
-
-        /* move destination ahead */
-        dst += src - last;
-        
-        /* if we're done, go */
-        if ( src == end )
-            break;
-
-        /* find next separator */
-        last = src;
-    }
-
-    /* NUL terminate if modified */
-    if ( dst != end )
-        *dst = 0;
-
-    return 0;
-}
-
-/* KSysDirMakePath
- *  creates a full path from partial
-
- self ....... has the first (base) part of the path in wchar_t !!!
- canon ...... if true the assembled path will be "canonilized" as last step
- buffer ..... into this buffer the full-path will be assembled ( wchar_t !!! )
- path_max ... the size of the buffer in bytes
- path ....... the partial path in utf8, can contain string-subst-elements !!!
- args ....... arguments to construct the partial path in utf8 ( can be NULL )
- */
-static
-rc_t KSysDirMakePath ( const KSysDir* self, enum RCContext ctx, bool canon,
-    wchar_t *buffer, size_t path_max, const char *path, va_list args )
-{
-    int temp_size_in_bytes;
-    uint32_t i, temp_length_in_utf8_chars;
-    uint32_t buffer_length_in_wchars;
-    char temp_utf8_buffer [ MAX_PATH ];
-
-    /* check if the given partial path is not NULL and not empty */
-    if( path == NULL )
-        return RC( rcFS, rcDirectory, ctx, rcPath, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-    /* We construct in temp_utf8_buffer the relative path the user has given:
-    If there are no args we copy with _snprintf else we use vsnprintf,
-    !!! the args are always utf8, the given path is in utf8 !!!
-    that is the reason for the temporary utf8-buffer */
-    temp_size_in_bytes = ( args == NULL ) ?
-        _snprintf ( temp_utf8_buffer, sizeof temp_utf8_buffer, "%s", path ):
-        vsnprintf( temp_utf8_buffer, sizeof temp_utf8_buffer, path, args );
-
-    /* we check if _snprnitf/vsnprintf was sucessful */
-    if ( temp_size_in_bytes < 0 || temp_size_in_bytes >= sizeof temp_utf8_buffer )
-        return RC( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-
-    /* we measure the number of utf8-chars we have in our temp-buffer
-        only for international chars in the temp-buffer there will be
-        path_length_in_utf8_chars != path_size_in_bytes */
-    temp_length_in_utf8_chars = string_len ( temp_utf8_buffer, temp_size_in_bytes );
-
-    if ( isalpha ( temp_utf8_buffer [ 0 ] ) && temp_utf8_buffer [ 1 ] == ':' )
-    {
-    /* in the case the path is a absolute path for windows (starting with "C:" for instance)
-        we completely ignore the path in self and use the given path only.
-        !!! except we are chrooted, in this case the given path is invalid 
-        ( no abs. path for chrooted dir's ) */
-        if ( self -> root != 0 )
-            return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-        buffer_length_in_wchars = 0;
-    }
-    /* decide on the number of characters to copy from self */
-    else if ( temp_utf8_buffer [ 0 ] != '/' )
-    {
-        buffer_length_in_wchars = self -> length;
-    }
-    else
-    {
-        /* get chroot'd path length */
-        buffer_length_in_wchars = self -> root;
-
-        /* if the full path includes a drive letter */
-        if ( isalpha ( temp_utf8_buffer [ 1 ] ) && temp_utf8_buffer [ 2 ] == '/' )
-        {
-            /* fail if chroot'd */
-            if ( self -> root != 0 )
-                return RC ( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-
-            /* rewrite drive letter */
-            temp_utf8_buffer [ 0 ] = tolower ( temp_utf8_buffer [ 1 ] );
-            temp_utf8_buffer [ 1 ] = ':';
-        }
-    }
-
-    /* check for buffer overrun */
-    if ( buffer_length_in_wchars + temp_length_in_utf8_chars >= path_max / sizeof * buffer )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-
-    /* prepend UTF-16 directory path */
-    if ( buffer_length_in_wchars != 0 )
-    {
-        memcpy ( buffer, self -> path, buffer_length_in_wchars * sizeof * buffer );
-
-        /* if path is relative, expect trailing '\\'
-            if path is full, expect NO trailing '\\' */
-        assert ( ( buffer_length_in_wchars == self ->length &&
-                    buffer [ buffer_length_in_wchars - 1 ] == '\\' ) ||
-                 ( buffer_length_in_wchars == self ->root &&
-                   buffer [ buffer_length_in_wchars - 1 ] != '\\' ) );
-    }
-
-    /* append the temp_utf8_buffer to the  user-supplied relative path */
-    buffer_length_in_wchars += (uint32_t)string_cvt_wchar_copy ( & buffer [ buffer_length_in_wchars ],
-        path_max - buffer_length_in_wchars * sizeof buffer [ 0 ],
-        temp_utf8_buffer, temp_size_in_bytes );
-    /* the job of the temp_utf8_buffer is done now... */
-
-    /* detect exhausted buffer */
-    if ( buffer_length_in_wchars >= path_max / sizeof * buffer )
-        return RC ( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-
-    assert ( buffer_length_in_wchars > 0 );
-    assert ( buffer[ buffer_length_in_wchars ] == 0 );
-
-    /* remove any trailing slash added by caller */
-    if ( buffer [ buffer_length_in_wchars - 1 ] == '/' )
-        buffer [ -- buffer_length_in_wchars ] = 0;
-
-    /* convert forward to backward slashes */
-    for ( i = 0; i < buffer_length_in_wchars; ++ i )
-    {
-        if ( buffer [ i ] == '/' )
-            buffer [ i ] = '\\';
-    }
-
-    /* if there are any characters to work with
-       and if caller wants canonical representation
-       or I'm chrooted, rewrite */
-    if ( buffer_length_in_wchars >= 2 && ( canon || self -> root > 2 ) )
-    {
-        return KSysDirCanonPath ( self, ctx, buffer, buffer_length_in_wchars );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t KSysDirOSPath ( const KSysDir *self,
-    wchar_t *real, size_t real_size, const char *path, va_list args )
-{
-    return KSysDirMakePath ( self, rcLoading, true, real, real_size, path, args );
-}
-
-/* KSysDirInit - forward declaration
- */
-static
-rc_t KSysDirInit ( KSysDir *self, enum RCContext ctx, uint32_t dad_root,
-                   const wchar_t *path, size_t path_size, uint32_t path_length, 
-                   bool update, bool chroot );
-
-/* KSysDirList
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "."
- */
-static
-rc_t CC KSysDirList ( const KSysDir *self, KNamelist **listp,
-    bool ( CC * f ) ( const KDirectory *dir, const char *name, void *data ), void *data,
-                   const char *path, va_list args )
-{
-    KSysDir full;
-    rc_t rc = KSysDirMakePath ( self, rcListing, true, full.path, sizeof full.path, path, args );
-    if ( rc == 0 )
-    {
-        size_t size_in_bytes;
-        uint32_t len_in_chars = utf16_string_measure( full.path, &size_in_bytes );
-
-        /* require space for a '\\*.*' and NUL */
-        if ( len_in_chars + 5 > sizeof full.path / sizeof full . path [ 0 ] )
-            rc = RC ( rcFS, rcDirectory, rcListing, rcPath, rcExcessive );
-        else
-        {
-            rc = KSysDirInit( &full, rcListing, self->root, NULL, size_in_bytes, len_in_chars, 0, 0 );
-            if ( rc == 0 )
-            {
-                KSysDirListing *list;
-
-                len_in_chars = full.length;
-                full . path [ len_in_chars + 0 ] = '*';
-                full . path [ len_in_chars + 1 ] = '.';
-                full . path [ len_in_chars + 2 ] = '*';
-                full . path [ len_in_chars + 3 ] = 0;
-
-                rc = VNamelistMake ( &list, 5 ); 
-                if ( rc == 0 )
-                {
-                    rc = KSysDirListingInit( list, full.path, & full.dad, f, data );
-                    if ( rc != 0 )
-                    {
-                        VNamelistRelease ( list );
-                    }
-                    else
-                    {
-                        rc = VNamelistToNamelist ( list, listp );
-                        VNamelistRelease ( list );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-uint32_t CC KSysDirPathType ( const KSysDir *self, const char *path, va_list args )
-{
-    wchar_t full[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        return KSysDirFullPathType( full );
-    }
-    return kptBadPath;
-}
-
-/* KSysDirVisit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry, where each path is also given the leaf name
- *  for convenience. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-typedef struct KSysDirVisitData KSysDirVisitData;
-struct KSysDirVisitData
-{
-    rc_t ( CC * f ) ( KDirectory*, uint32_t, const char*, void* );
-    void *data;
-    KSysDir dir;
-    bool recurse;
-};
-
-static
-rc_t KSysDirVisitDir ( KSysDirVisitData *pb )
-{
-    /* get a directory listing */
-    rc_t rc;
-    KSysDirEnum listing;
-    uint32_t path_length;
-    size_t path_size;
-
-    /* measure length and size of the given path, we will need both... */
-    path_length = wchar_string_measure ( pb->dir.path, &path_size );
-
-    /* add a trailing backslash (windows!) if it is not there... */
-    if ( pb->dir.path[ path_length - 1 ] != '\\' )
-    {
-        /* check if there is space for 4 more bytes */
-        if ( ( path_size + 4 ) >= sizeof pb->dir.path )
-        {
-            return RC( rcFS, rcDirectory, rcVisiting, rcPath, rcExcessive );
-        }
-        pb->dir.path[ path_length + 0 ] = '\\';
-        pb->dir.path[ path_length + 1 ] = 0;
-        path_length = utf16_string_measure( pb->dir.path, &path_size );
-        pb->dir.length = path_length;
-    }
-
-    /* check if there is space for 8 more bytes ( '*.*0' ) */
-    if ( ( path_size + 8 ) >= sizeof pb->dir.path )
-    {
-        return RC( rcFS, rcDirectory, rcVisiting, rcPath, rcExcessive );
-    } 
-    /* append '*.*' to make KSysDirEnumInit work under Windows! */
-    pb -> dir . path [ path_length + 0 ] = '*';
-    pb -> dir . path [ path_length + 1 ] = '.';
-    pb -> dir . path [ path_length + 2 ] = '*';
-    pb -> dir . path [ path_length + 3 ] = 0;
-
-    rc = KSysDirEnumInit ( &listing, pb->dir.path );
-    if( rc == 0 )
-    {
-        const wchar_t *name;
-
-        /* truncate the appended '*.*' to visit the entries */
-        pb -> dir . path [ path_length ] = 0;
-
-        for ( name = KSysDirEnumNext( &listing ); 
-              name != NULL; 
-              name = KSysDirEnumNext( &listing ) )
-        {
-            uint32_t type, name_length;
-            size_t name_size;
-            char temp_utf8_buffer [ MAX_PATH ];
-
-            /* measure length and size of the element-name, we will need both... */
-            name_length = wchar_string_measure ( name, &name_size );
-            /* check if we have enought space for path and element-name */
-            if ( path_size + name_size >= sizeof pb->dir.path )
-            {
-                rc = RC( rcFS, rcDirectory, rcVisiting, rcPath, rcExcessive );
-                break;
-            }
-
-            /* append the element-name to the path */
-            wcscpy ( &pb->dir.path[ path_length ], name );
-            type = KSysDirFullPathType( pb->dir.path );
-            if( type == kptBadPath )
-            {
-                rc = RC( rcFS, rcDirectory, rcVisiting, rcPath, rcInvalid );
-                break;
-            }
-
-            /* the callback-function expects the name as utf8 !!! */
-            wchar_cvt_string_copy ( temp_utf8_buffer, sizeof temp_utf8_buffer, 
-                                    name, name_size );
-            rc = (*pb->f)( &pb->dir.dad, type, temp_utf8_buffer, pb->data );
-            if ( rc != 0 )
-                break;
-
-            /* if recursive visiting is requested and the element is a directory */
-            if ( pb->recurse && ( type & ( kptAlias - 1 ) ) == kptDir )
-            {
-                /* append the element-name-length temporary to the length of the path */
-                pb->dir.length += name_length;
-                /* call this function recursive */
-                rc = KSysDirVisitDir( pb );
-                /* restore the original path-length (for the caller function) */
-                pb->dir.length = path_length;
-                if ( rc != 0 )
-                    break;
-            }
-
-        } /* for () */
-
-        KSysDirEnumWhack( &listing );
-    }
-    return rc;
-}
-
-static
-rc_t CC KSysDirVisit ( const KSysDir *self, bool recurse,
-    rc_t ( CC * f ) ( KDirectory *dir, uint32_t type, const char *name, void *data ), void *data,
-    const char *path, va_list args )
-{
-    rc_t rc;
-    KSysDirVisitData pb;
-
-    rc = KSysDirMakePath( self, rcVisiting, true, pb.dir.path, sizeof pb.dir.path, path, args );
-    if ( rc == 0 )
-    {
-        size_t path_size;
-        uint32_t path_length;
-
-        switch( KSysDirFullPathType( pb.dir.path ) & ( kptAlias - 1 ) )
-        {
-            case kptNotFound:
-                return RC( rcFS, rcDirectory, rcVisiting, rcPath, rcNotFound );
-            case kptBadPath:
-                return RC( rcFS, rcDirectory, rcVisiting, rcPath, rcInvalid );
-            case kptDir:
-                break;
-            default:
-                return RC( rcFS, rcDirectory, rcVisiting, rcPath, rcIncorrect );
-        }
-
-        path_length = utf16_string_measure( pb.dir.path, &path_size );
-        rc = KSysDirInit ( & pb . dir, rcVisiting, self -> root,
-                           NULL, path_size, path_length,
-                           self -> dad . read_only ? 0 : 1, 0 );
-        if ( rc == 0 )
-        {
-            pb . f = f;
-            pb . data = data;
-            pb . recurse = recurse;
-            rc = KSysDirVisitDir ( & pb );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirRelativePath
- *  makes "path" relative to "root"
- *  both "root" and "path" MUST be absolute
- *  both "root" and "path" MUST be canonical, i.e. have no "./" or "../" sequences
- *  both root and path are in windows-native format!
- */
-static
-rc_t KSysDirRelativePath ( const KSysDir *self, enum RCContext ctx,
-    const wchar_t *root, wchar_t *path, size_t path_max )
-{
-    size_t psize;
-    uint32_t backup, blength_in_chars, dst, diff_from_here;
-
-    const wchar_t *r = root + self->root;
-    const wchar_t *p = path + self->root;
-
-    /* stop gap fix..  not actually comparing the utf16 values correctly */
-    for ( ; towlower (*r) == towlower (*p); ++ r, ++ p )
-    {
-        /* disallow identical paths */
-        if ( * r == 0 )
-            return RC( rcFS, rcDirectory, ctx, rcPath, rcInvalid );
-    }
-
-    /* paths are identical up to "r","p"
-       if "r" is within a leaf name, then no backup is needed
-       by counting every '\\' from "r" to end, obtain backup count */
-    for ( backup = 0; * r != 0; ++ r )
-    {
-        if ( * r == '\\' )
-            ++ backup;
-    }
-
-    /* the number of characters to be inserted */
-    blength_in_chars = backup * 3;
-
-    /* align "p" to last directory separator */
-    if ( p > path ) {
-        while ( p [ -1 ] != '\\' ) -- p;
-    }
-
-    /* the size of the remaining relative path */
-    psize = wcslen ( p );
-    diff_from_here = ( uint32_t )( p - path );
-
-    /* open up space if needed */
-    if ( diff_from_here < blength_in_chars )
-    {
-        /* prevent overflow */
-        if ( ( blength_in_chars + psize ) * sizeof( *path ) >= path_max )
-            return RC( rcFS, rcDirectory, ctx, rcPath, rcExcessive );
-        memmove ( & path[ blength_in_chars ], p, psize * ( sizeof *p ) );
-    }
-
-    /* insert backup sequences */
-    for ( dst = 0; backup > 0; -- backup )
-    {
-        path [ dst++ ] = '.';
-        path [ dst++ ] = '.';
-        path [ dst++ ] = '\\';
-    }
-
-    /* close gap */
-    if ( diff_from_here > blength_in_chars )
-        wcscpy ( & path [ blength_in_chars ], p );
-    path[ blength_in_chars + psize ] = 0;
-
-    return 0;
-}
-
-/* KSysDirResolvePath
- *  resolves path to an absolute or directory-relative path
- *
- *  "absolute" [ IN ] - if non-zero, always give a path starting
- *  with '/'. NB - if the directory is chroot'd, the absolute path
- *  will still be relative to directory root.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character sets
- *  the resolved path will be directory relative
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target path. NB - need not exist.
- */
-static
-rc_t CC KSysDirResolvePath ( const KSysDir *self, bool absolute,
-    char *resolved, size_t rsize, const char *path, va_list args )
-{
-    wchar_t temp [ MAX_PATH ];
-    size_t temp_size;
-    uint32_t temp_length;
-
-    /* convert the utf8-input-parameter path into wchar_t */
-    rc_t rc = KSysDirMakePath ( self, rcResolving, true, temp, sizeof temp, path, args );
-    if ( rc != 0 )
-        return rc;
-
-    temp[ 0 ] = tolower( temp[ 0 ] ); /* this is important:
-                                         otherwise the comparison for is_on_same_drive_letter fails
-                                         AND
-                                         KSysDirRelativePath() fails too! */
-
-    temp_length = wchar_string_measure ( temp, &temp_size );
-    if ( absolute )
-    {
-        /* test buffer capacity */
-        if ( temp_length - self->root >= rsize )
-            return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-    }
-    else
-    {
-        /* we are on windows, only if the path has a drive letter and it is the same
-           one as in KSysDir itself, we should try to create a relative path */
-        wchar_t colon = ':';
-        bool is_on_same_drive_letter = ( iswascii ( temp[ 0 ] ) && iswascii ( self->path[ 0 ] ) &&
-                                         ( temp[ 1 ] == colon ) && ( self->path[ 1 ] == colon ) &&
-                                         ( towlower ( temp[ 0 ] ) == towlower ( self->path[ 0 ] ) ) );
-        if ( is_on_same_drive_letter )
-        {
-            rc = KSysDirRelativePath( self, rcResolving, self->path, temp, sizeof temp );
-            if ( rc == 0 )
-            {
-                uint32_t temp_length = wchar_string_measure ( temp, &temp_size );
-                if ( temp_length >= rsize )
-                    return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-            }
-        }
-        else
-        {
-            /* treat it as if absolute were requested ( see above ) */
-            if ( temp_length - self->root >= rsize )
-                return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        uint32_t i;    
-        /* convert it back to utf8 */
-        utf16_cvt_string_copy ( resolved, rsize, temp, temp_size );
-
-        /* convert it back to POSIX */
-        if ( isalpha ( resolved[ 0 ] ) && resolved[ 1 ] == ':' )
-        {
-            /* rewrite drive letter */
-            resolved[ 1 ] = tolower ( resolved [ 0 ] );
-            resolved[ 0 ] = '/';
-        }
-        
-        /* convert backward to forward slashes */
-        for ( i = 0; resolved[ i ]; ++ i )
-        {
-            if ( resolved[ i ] == '\\' )
-                resolved[ i ] = '/';
-        }
-    }
-
-    return rc;
-}
-
-/* KSysDirResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- */
-static
-rc_t CC KSysDirResolveAlias ( const KSysDir *self, bool absolute,
-                              char *resolved, size_t rsize,
-                              const char *alias, va_list args )
-{
-    KSysDir temp;
-    size_t temp_size;
-    uint32_t temp_length, path_type;
-    wchar_t * w_resolved;
-
-    rc_t rc = KSysDirMakePath( self, rcResolving, true, temp.path, sizeof temp.path, alias, args );
-    if ( rc != 0 )
-        return rc;
-
-    temp_length = wchar_string_measure ( temp.path, &temp_size );
-    path_type = KSysDirFullPathType ( temp.path );
-    if ( path_type == kptFile || path_type == kptDir )
-    {
-        /* if the path points to a file or a dir, then there is no alias involved at all */
-        if ( temp_size >= rsize )
-        {
-            return RC ( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        }
-        /* we have to convert temp.path back from wchar_t to char ! */
-        wchar_cvt_string_copy ( resolved, rsize, temp.path, temp_size );
-        return 0;
-    }
-
-
-    /* trying to attach a .lnk to the path, if it resolves it is a link... */
-    if ( temp_size + 10 >= rsize )
-    {
-        return RC( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-    }
-    temp.path[ temp_length + 0 ] = '.';
-    temp.path[ temp_length + 1 ] = 'l';
-    temp.path[ temp_length + 2 ] = 'n';
-    temp.path[ temp_length + 3 ] = 'k';
-    temp.path[ temp_length + 4 ] = 0;
-
-    if ( lnk_file_resolve( temp.path, &w_resolved ) != LNK_RES_ERROR )
-    {
-        size_t w_size;
-        uint32_t w_len;
-
-        /* we have to copy the resolved path into temp to use KSysDirCanonPath() */
-        w_len = wchar_string_measure ( w_resolved, &w_size );
-        if ( w_size > sizeof temp.path )
-        {
-            free( w_resolved );
-            return RC( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        }
-        wcscpy( temp.path, w_resolved );
-        free( w_resolved );
-
-        rc = KSysDirCanonPath( &temp, rcResolving, temp.path, w_len );
-        if ( rc == 0 )
-        {
-            /* the path in full is an absolute path
-               if outside of chroot, it's a bad link */
-            if (wstrcase_cmp (temp.path, self->root + 1,
-                              self->path, self->root + 1,self->root + 1) != 0)
-                return RC( rcFS, rcDirectory, rcResolving, rcLink, rcInvalid );
-
-            /* this is the absolute path length */
-            w_len = wchar_string_measure ( temp.path, &w_size );
-
-            /* if not requesting absolute, make self relative */
-            if( !absolute )
-            {
-                rc = KSysDirRelativePath( self, rcResolving, self->path, 
-                                          temp.path, w_len );
-                if ( rc != 0 )
-                    return rc;
-                w_len = wchar_string_measure ( temp.path, &w_size );
-            }
-            if ( ( size_t ) w_len >= rsize )
-                return RC(rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-
-            w_len = wchar_string_measure ( &(temp.path[ self -> root ]), &w_size );
-            wchar_cvt_string_copy ( resolved, rsize, &(temp.path[ self -> root ]), w_size );
-        }
-    }
-
-
-#if 0
-    /* NEXT - attach ".lnk" to the path and see if it resolves
-       if not, the supplied path simply does not exist */
-        if ( ( wcslen( full.path ) + 5 ) >= rsize )
-        {
-            return RC( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-        }
-        wcscpy( resolved, full.path );
-        wcscat( resolved, L".lnk" );
-        refnum = FindFirstFile( resolved, &info );
-        if ( refnum == INVALID_HANDLE_VALUE )
-        {
-            wcscpy( resolved, L"\0" );
-            return RC( rcFS, rcDirectory, rcResolving, rcPath, rcNotFound );
-        }
-        FindClose( refnum );
-
-        {
-
-            /* get a COM reference to the Explorer. we should be
-               able to do this in C with no problem */
-            HRESULT rslt = ERROR_INSUFFICIENT_BUFFER;
-            IShellLink *shellLink;
-            rslt = CoCreateInstance( &IID_IShellLink, 0, CLSCTX_INPROC_SERVER, &IID_IShellLink, &shellLink );
-            if( !rslt )
-            {
-                /* get a file interface that isn't attached to anything */
-                IPersistFile *persistFile;
-                rslt = shellLink->lpVtbl->QueryInterface( shellLink, &IID_IPersistFile, (void**)&persistFile );
-                if( !rslt )
-                {
-                    /* now try to do the thing
-                       the link name needs to be in Unicode */
-                    rslt = persistFile->lpVtbl->Load(persistFile, resolved, STGM_READ );
-                    if( !rslt )
-                    {
-                        /* Unicode is no longer necessary */
-                        rslt = shellLink->lpVtbl->Resolve( shellLink, 0, SLR_NO_UI + SLR_ANY_MATCH );
-                        if ( !rslt )
-                        {
-                            /* read what the path is, i.e. read the shortcut file */
-                            rslt = shellLink->lpVtbl->GetPath( shellLink, resolved, rsize, &info, 0 );
-                            if( rslt )
-                            {
-                                wcscpy( resolved, L"\0" );
-                            }
-                        }
-                    }
-                    persistFile->lpVtbl->Release( persistFile );
-                }
-                shellLink->lpVtbl->Release( shellLink );
-            }
-            if ( wcslen( resolved ) == 0 )
-            {
-                return RC( rcFS, rcDirectory, rcResolving, rcPath, rcInvalid );
-            }
-
-        }
-
-        len = wcslen( resolved );
-        if( resolved[0] == '/' )
-        {
-            full.size = 1;
-            wcscpy( full.path, resolved );
-        }
-        else
-        {
-            wchar_t *f = wcsrchr( full.path, '/' );
-            full.size = f - full.path + 1;
-            if ( full.size + len >= sizeof full.path )
-            {
-                return RC( rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-            }
-            wcscpy( f, resolved );
-        }
-        full.root = 0;
-
-        rc = KSysDirCanonPath( &full, rcResolving, full.path, len );
-        if ( rc == 0 )
-        {
-            size_t f, s;
-
-            f = wchar_string_size (full.path);
-            s = wchar_string_size (self->path);
-            /* the path in full is an absolute path
-               if outside of chroot, it's a bad link */
-            if ( wstrcase_cmp (full.path, f, self->path, s, self->root + 1 ) != 0 )
-            {
-                return RC( rcFS, rcDirectory, rcResolving, rcLink, rcInvalid );
-            }
-
-            /* this is the absolute path length */
-            len = wchar_string_size( &full.path[self->root] );
-
-            /* if not requesting absolute, make self relative */
-            if( !absolute )
-            {
-            rc = KSysDirRelativePath( self, rcResolving, self->path, full.path, sizeof full.path /*len*/ );
-                if ( rc != 0 )
-                    return rc;
-                len = wchar_string_size(full.path);
-            }
-            if ( ( size_t ) len >= rsize )
-                return RC(rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient );
-
-            wcscpy ( resolved, & full . path [ self -> root ] );
-        }
-#endif
-    return rc;
-}
-
-/* KSysDirRename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-static
-rc_t CC KSysDirRename ( KSysDir *self, bool force, const char *from, const char *to )
-{
-    wchar_t current_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcRenaming, false, current_name, sizeof current_name, from, NULL );
-    if ( rc == 0 )
-    {
-
-        wchar_t new_name[ MAX_PATH ];
-        rc = KSysDirMakePath ( self, rcRenaming, false, new_name, sizeof new_name, to, NULL );
-        if ( rc == 0 )
-        {
-            DWORD err = 0;
-            uint32_t try = 0;
-
-            do
-            {
-                BOOL success = false;
-                if ( force ) {
-                    DWORD dwFlags = MOVEFILE_REPLACE_EXISTING;
-                    success = MoveFileEx ( current_name, new_name, dwFlags );
-                }
-                else {
-                    success = MoveFileW ( current_name, new_name );
-                }
-                if ( success )
-                {
-                    rc = 0;
-                }
-                else
-                {
-                    err = GetLastError();
-                    switch( err )
-                    {
-                        case ERROR_FILE_NOT_FOUND:
-                        case ERROR_PATH_NOT_FOUND:
-                        case ERROR_INVALID_DRIVE:
-                            return RC ( rcFS, rcDirectory, rcRenaming, rcFile, rcNotFound );
-                        case ERROR_ACCESS_DENIED:
-                            try++;
-                            Sleep( 500 ); /* sleep for a half a second */
-                            rc = RC ( rcFS, rcDirectory, rcRenaming, rcFile, rcUnauthorized );
-                            break;
-                       case ERROR_SHARING_VIOLATION:
-                           return RC ( rcFS, rcDirectory, rcRenaming, rcFile, rcBusy );
-                        default:
-                            return RC ( rcFS, rcDirectory, rcRenaming, rcNoObj, rcUnknown );
-                    }
-                }
-            } while ( err == ERROR_ACCESS_DENIED && try < 30 );
-        }
-    }
-    return rc;
-}
-
-
-/* helper function for KSysDirCreateParents() */
-static
-rc_t directory_exists( const wchar_t *path, bool *exists )
-{
-    /* try it with CreateFileW() */
-    *exists = win_path_exists( path );
-    return 0;
-#if 0
-    wchar_t temp[ MAX_PATH ];
-    WIN32_FIND_DATA find_data;
-    HANDLE h_find;
-    size_t path_size;
-    uint32_t path_length = utf16_string_measure( path, &path_size );
-
-    *exists = false;
-
-    if ( ( path_size + 10 ) > sizeof temp )
-        return RC( rcFS, rcDirectory, rcCreating, rcMemory, rcExhausted );
-
-    wcscpy( temp, path );
-    if ( temp[ path_length - 1 ] != '\\' )
-        temp[ path_length++ ] = '\\';
-    temp[ path_length + 0 ] = '*';
-    temp[ path_length + 1 ] = '.';
-    temp[ path_length + 2 ] = '*';
-    temp[ path_length + 3 ] = 0;
-
-    h_find = FindFirstFileW( temp, &find_data );
-    if ( h_find != INVALID_HANDLE_VALUE )
-    {
-        *exists = true;
-        FindClose( h_find );
-    }
-
-    return 0;
-#endif
-}
-
-
-static
-rc_t KSysDirRemoveEntry ( wchar_t *path, size_t path_max, bool force );
-
-
-static
-rc_t KSysDirEmptyDir ( wchar_t *path, size_t path_max, bool force )
-{
-    rc_t rc;
-    KSysDirEnum list;
-    size_t path_size;
-    uint32_t path_length = wchar_string_measure ( path, &path_size );
-
-    if ( ( path_size + 10 ) > path_max )
-        return RC( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-
-    rc = KSysDirEnumInitAll ( & list, path, path_length );
-    if ( rc != 0 )
-    {
-        rc = ResetRCContext ( rc, rcFS, rcDirectory, rcClearing );
-    }
-    else
-    {
-        const wchar_t *leaf;
-
-        /* we keep only the appended '\\' for the loop... */
-        path_length++;
-        path_size += sizeof *path;
-
-        for ( leaf = KSysDirEnumNext( &list ); 
-              leaf != NULL; 
-              leaf = KSysDirEnumNext( &list ) )
-        {
-            size_t leaf_size;
-            uint32_t leaf_length = wchar_string_measure ( leaf, &leaf_size );
-            if ( path_size + leaf_size >= path_max )
-            {
-                rc = RC ( rcFS, rcDirectory, rcClearing, rcPath, rcExcessive );
-                break;
-            }
-
-            /* wcscpy adds termination, so wprintf is safe to call */
-            wcscpy ( & path [ path_length ], leaf );
-
-            rc = KSysDirRemoveEntry ( path, path_max, force );
-            if ( rc != 0 )
-            {
-                rc = ResetRCContext ( rc, rcFS, rcDirectory, rcClearing );
-                break;
-            }
-        }
-        KSysDirEnumWhack ( & list );
-        /* restore the original path... */
-        path [ path_length - 1 ] = 0;
-    }
-    return rc;
-}
-
-
-/* KSysDirClearDir
- *  remove all directory contents
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- */
-static
-rc_t CC KSysDirClearDir ( KSysDir *self, bool force, const char *path, va_list args )
-{
-    wchar_t dir_name [ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcClearing, false, dir_name, sizeof dir_name, path, args );
-    if ( rc == 0 )
-        rc = KSysDirEmptyDir ( dir_name, sizeof dir_name, force );
-    return rc;
-}
-
-
-/* KSysDirRemove
- *  remove an accessible object from its directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- */
-static
-rc_t KSysDirRemoveEntry ( wchar_t *path, size_t path_max, bool force )
-{
-    if ( !DeleteFileW( path ) )
-    {
-        DWORD error = GetLastError();
-
-        switch ( error )
-        {
-        case ERROR_PATH_NOT_FOUND :
-            return 0;
-/*
-        case ERROR_ACCESS_DENIED :
-            !!! Do not use this error code here, it occurs if path is not a file, but
-            a directory instead. Handling it here would prevent the remaining code
-            from beeing executed !!!
-            return RC( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-*/
-
-        default :
-#if _DEBUGGING && 0
-    OUTMSG (( "DeleteFileW returned '%#X'\n", error ));
-#endif
-            break;
-        }
-
-        /* we have not been able to delete it as a file,
-           we try to delete it as a directory... */
-        if ( !RemoveDirectoryW( path ) )
-        {
-            rc_t rc;
-            error = GetLastError();
-
-            /* find out if the reason is that it is not empty and force = true --->
-               in this case delete all files and directories in it 
-               and then try again... */
-            switch ( error )
-            {
-            case ERROR_DIR_NOT_EMPTY :
-                if ( force )
-                {
-                    rc = KSysDirEmptyDir ( path, path_max, force );
-                    if ( rc == 0 )
-                    {
-                        if ( !RemoveDirectoryW( path ) )
-                        {
-                            rc = RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-                            print_error_for( path, "RemoveDirectoryW", rcRemoving, klogErr );
-                        }
-                    }
-                    return rc;
-                }
-                else
-                    rc = RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-
-            case ERROR_ACCESS_DENIED :
-                rc = RC ( rcFS, rcDirectory, rcRemoving, rcDirectory, rcUnauthorized );
-
-            default :
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcNoObj, rcUnknown );
-            }
-
-            print_error_for( path, "RemoveDirectoryW", rcRemoving, klogInfo);
-            return rc;
-        }
-    }
-    return 0;
-}
-
-
-static
-rc_t CC KSysDirRemove ( KSysDir *self, bool force, const char *path, va_list args )
-{
-    wchar_t dir_name [ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcRemoving, false, dir_name, sizeof dir_name, path, args );
-    if ( rc == 0 )
-        rc = KSysDirRemoveEntry ( dir_name, sizeof dir_name, force );
-    return rc;
-}
-
-/* KSysDirAccess
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-
-#define DEFAULT_WIN_ACCESS   0555
-#define DEFAULT_WRITE_ACCESS 0222
-
-
-/* FromMSDN */
-#define UNIX_EPOCH_IN_WIN       116444736000000000
-#define UINX_TIME_UNITS_IN_WIN  10000000
-static __inline__
-void KTimeToWinTime ( KTime_t unix, LPFILETIME win )
-{
-    uint64_t ll = ( ( unix * UINX_TIME_UNITS_IN_WIN ) + UNIX_EPOCH_IN_WIN );
-    win->dwLowDateTime = (DWORD)ll;
-    win->dwHighDateTime = ll >> 32;
-}
-
-
-static __inline__
-KTime_t WinTimeToKTime ( LPFILETIME win )
-{
-    uint64_t ll = (uint64_t)win->dwLowDateTime + ((int64_t)win->dwHighDateTime << 32);
-
-/*     DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_DIR),("%s %x %x %lx %lx\n", */
-/*                                           __func__,win->dwLowDateTime,win->dwHighDateTime, */
-/*                                           ll,( ll - UNIX_EPOCH_IN_WIN ) / 10000000)); */
-
-    /* if its negative, so be it */
-    return ( ll - UNIX_EPOCH_IN_WIN ) / UINX_TIME_UNITS_IN_WIN;
-}
-
-
-static __inline
-rc_t get_attributes ( const wchar_t * wpath, uint32_t * access, KTime_t * date )
-{
-    WIN32_FIND_DATA fd;
-    DWORD error;
-    rc_t rc;
-
-    if ( FindFirstFile ( wpath, &fd ))
-    {
-        if ( access != NULL )
-        {
-/* TBD - track user's main group and group Everyone */
-            *access = DEFAULT_WIN_ACCESS |
-                (((fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY)
-                 ? 0 : DEFAULT_WRITE_ACCESS);
-        }
-        if ( date != NULL )
-        {
-            *date = WinTimeToKTime ( &fd.ftLastWriteTime );
-        }
-        return 0;
-    }
-/* TBD check values in error */
-    if ( access != NULL )
-        *access = 0;
-    if ( date != NULL )
-        *date = 0;
-
-    rc = print_error_for( wpath, "FindFirstFile", rcAccessing, klogErr );
-    return rc;
-}
-
-
-static
-rc_t CC KSysDirVAccess ( const KSysDir *self,
-    uint32_t *access, const char *path, va_list args )
-{
-    wchar_t winpath [ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, winpath, sizeof winpath, path, args );
-    if ( rc == 0 )
-        rc = get_attributes ( winpath, access, NULL );
-    return rc;
-}
-
-/* KSysDirSetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static
-rc_t KSysDirChangeAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, bool recurse );
-
-    
-static
-rc_t KSysDirChangeDirAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask )
-{
-    /*
-    KSysDirEnum list;
-    rc_t rc = KSysDirEnumInit ( & list, path );
-    if ( rc == 0 )
-    {
-        bool eperm = false;
-        size_t path_size = strlen ( path );
-        path [ path_size ] = '/';
-        if ( ++ path_size == path_max )
-            rc = RC(rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            const char *leaf;
-            while ( ( leaf = KSysDirEnumNext ( & list ) ) != NULL )
-            {
-                size_t leaf_size = strlen ( leaf );
-                if ( path_size + leaf_size >= path_max )
-                {
-                    rc = RC(rcFS, rcDirectory, rcUpdating, rcBuffer, rcInsufficient );
-                    break;
-                }
-
-                strcpy ( & path [ path_size ], leaf );
-                rc = KSysDirChangeAccess ( path, path_max, access, mask, 1 );
-                if ( rc != 0 )
-                {
-                    if ( GetRCState ( rc ) != rcUnauthorized )
-                        break;
-                    eperm = true;
-                    rc = 0;
-                }
-            }
-
-            path [ path_size - 1 ] = 0;
-        }
-
-        KSysDirEnumWhack ( & list );
-
-        if ( rc == 0 && eperm )
-            rc = RC(rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    }
-    return rc;
-    */
-    return 0;
-}
-
-
-static
-rc_t KSysDirChangeEntryAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, uint32_t st_mode )
-{
-#if 0
-    /* keep old bits
-       we have no chmod in Windows - leave it blank... */
-    access &= mask;
-    access |= st_mode & ~ mask;
-
-    if ( chmod ( path, access & 07777 ) != 0 )
-        switch ( errno )
-        {
-        case EPERM:
-        case EACCES:
-        case EROFS:
-            return RC(rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-        case ENOTDIR:
-        case ELOOP:
-            return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-        case ENAMETOOLONG:
-            return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-        case ENOENT:
-            return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-        case ENOMEM:
-            return RC(rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-        default:
-            return RC(rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-        }
-#endif
-    return 0;
-}
-
-
-static
-rc_t KSysDirChangeAccess ( char *path, size_t path_max,
-    uint32_t access, uint32_t mask, bool recurse )
-{
-    /*
-    struct stat st;
-    if ( stat ( path, & st ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOTDIR:
-    case ELOOP:
-        return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC(rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case EACCES:
-        return RC(rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOMEM:
-        return RC(rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC(rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-
-    if ( recurse && S_ISDIR ( st . st_mode ) )
-    {
-        rc_t rc;
-        uint32_t enable = access & mask;
-        if ( enable != 0 )
-        {
-            rc = KSysDirChangeEntryAccess ( path, path_max,
-                access, enable, st . st_mode );
-            if ( rc != 0 )
-                return rc;
-        }
-
-       rc = KSysDirChangeDirAccess ( path, path_max, access, mask );
-        if ( rc == 0 )
-        {
-            uint32_t disable = ~ access & mask;
-            if ( disable != 0 )
-            {
-                rc = KSysDirChangeEntryAccess ( path, path_max,
-                    access, disable, st . st_mode | enable );
-            }
-        }
-        return rc;
-    }
-
-    return KSysDirChangeEntryAccess ( path, path_max,
-         access, mask, st . st_mode );
-    */
-    return 0;
-}
-
-
-static
-rc_t CC KSysDirSetAccess ( KSysDir *self, bool recurse,
-    uint32_t access, uint32_t mask, const char *path, va_list args )
-{
-    rc_t rc = 0;
-    /*
-    char full[MAX_PATH];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        if ( mask == 0 )
-            mask = 07777;
-
-        rc = KSysDirChangeAccess ( full, sizeof full,
-            access, mask & 07777, recurse );
-    }
-    */
-    return rc;
-}
-
-
-/* make_dir()
- *  helper function that encapsulates the OS-specific call
- *  to create a directory - the return codes are used by the
- *  caller-functions to decide what to do in case of a error...
- *  the callers are: KSysDirCreateParents() and KSysDirCreateDir()
- *  special on windows: path is wchar_t and we ignore access !!!
- *  TBD: translate access into a windows security descriptor...
- *       find out the other possible ERROR_* 's produced 
- */
-static
-rc_t make_dir ( const wchar_t *path, uint32_t access )
-{
-    rc_t rc = 0;
-    /* try to create the directory */
-    if ( !CreateDirectoryW ( path, NULL ) )
-    {
-        DWORD error = GetLastError();
-        rc = translate_file_error( error, rcCreating );
-/*
-        Do not print an error code here, it is valid that this can happen!
-        rc = print_error_for( path, "CreateDirectoryW", rcCreating, klogErr );
-*/
-    }
-    return rc;
-}
-
-
-#if OLD_CREATE_PARENTS
-static
-rc_t check_and_make( wchar_t *path, uint32_t access )
-{
-    bool exists;
-    rc_t rc = directory_exists( path, &exists );
-    if ( rc == 0 && !exists )
-    {
-        rc = make_dir ( path, access );
-    }
-    return rc;
-}
-#endif
-
-
-/* KSysDirCreateParents
- *  creates missing parent directories
- *  Windows special: path is wide-char, separator is back-slash, 
- *  starts with drive-letter...
- */
-static
-rc_t KSysDirCreateParents ( const KSysDir *self, wchar_t *path, uint32_t access, bool strip )
-{
-#if ! OLD_CREATE_PARENTS
-    rc_t rc;
-    uint32_t len;
-    wchar_t *p, *par = path;
-
-    /* if directory is chroot'd, skip past root and slash */
-    if ( self -> root != 0 )
-        par += self -> root + 1;
-    else
-    {
-        /* skip drive letter */
-        if ( path [ 1 ] == ':' )
-            par += 2;
-    /* skip slashes, network or otherwise */
-        while ( par [ 0 ] == '\\' )
-            ++ par;
-    }
-
-    len = wcslen ( par );
-
-    if ( ! strip )
-        p = par + len;
-    else
-    {
-        p = wcsrchr ( par, '\\' );
-        if ( p == NULL )
-            return 0;
-        len = p - par;
-    }
-
-    while ( 1 )
-    {
-        /* crop string */
-        p [ 0 ] = 0;
-
-        /* try to create directory */
-        rc = make_dir ( path, access );
-        if ( GetRCState ( rc ) != rcNotFound )
-            break;
-
-        /* back up some more */
-        p = wcsrchr ( par, '\\' );
-        if ( p == NULL )
-        {
-            p = par + wcslen ( par );
-            break;
-        }
-    }
-
-    par += len;
-    assert ( p != NULL );
-
-    /* create directories from here */
-    if ( rc == 0 ) while ( p < par )
-    {
-        p [ 0 ] = '\\';
-        rc = make_dir ( path, access );
-        if ( rc != 0 || ++ p >= par )
-            break;
-        p += wcslen ( p );
-    }
-
-    /* repair stripped path */
-    if ( strip )
-        par [ 0 ] = '\\';
-
-    return rc;
-
-#else
-
-    rc_t rc;
-    wchar_t *separator = path;
-    bool finished;
-
-    do
-    {
-        /* find the next separator */
-        separator = wcschr( separator + 1, '\\' );
-
-        /* we are finished, if not found */
-        finished = (bool)( separator == NULL );
-        if ( !finished )
-        {
-            /* temporary terminate at the separator */
-            *separator = 0;
-            rc = check_and_make( path, access );
-            finished = (bool)( rc != 0 );
-            /* put the terminator back in place... */
-            *separator = '\\';
-        }
-    } while ( !finished );
-
-    /* finally test and make the whole path... */
-    rc = check_and_make( path, access );
-
-    return rc;
-#endif
-}
-
-/* KSysDirCreateAlias
- *  creates a path alias according to create mode
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- */
-static
-rc_t CC KSysDirCreateAlias ( KSysDir *self, uint32_t access, KCreateMode mode,
-                             const char *targ, const char *alias )
-{
-    wchar_t w_target[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcCreating, true, w_target, sizeof w_target, targ, NULL );
-    if ( rc == 0 )
-    {
-        wchar_t w_alias[ MAX_PATH ];
-        rc = KSysDirMakePath ( self, rcCreating, true, w_alias, sizeof w_alias, alias, NULL );
-        if ( rc == 0 )
-        {
-            bool alias_ok = true;
-            if ( ! has_lnk_extension( w_alias ) ) /* lnk_tools.c */
-                alias_ok = add_lnk_extension( w_alias, sizeof w_alias ); /* lnk_tools.c */
-
-            if ( lnk_file_exists( w_alias ) )
-            {
-                DeleteFileW( w_alias );
-                alias_ok = ( ! lnk_file_exists( w_alias ) );
-            }
-
-            if ( alias_ok )
-            {
-                /* if "alias" is relative or "self" is chroot'd,
-                   "w_alias" must be made relative */
-                if ( alias [ 0 ] != '/' || self -> root != 0 )
-                {
-                    rc = KSysDirRelativePath ( self, rcCreating, w_alias, w_target, sizeof w_target );
-                    if ( rc != 0 )
-                        return rc;
-                }
-                if ( win_CreateLink( w_target, w_alias, NULL ) ) /* lnk_tools.c */
-                    rc = 0;
-                else
-                    rc = translate_file_error( GetLastError (), rcCreating );
-            }
-            else
-                rc = RC ( rcFS, rcDirectory, rcCreating, rcMemory, rcExhausted ); 
-        }
-    }
-    return rc;
-}
-
-
-/* KSysDirOpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-static
-rc_t CC KSysDirOpenFileRead ( const KSysDir *self,
-    const KFile **f, const char *path, va_list args )
-{
-    wchar_t file_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath( self, rcOpening, false, file_name, sizeof file_name, path, args );
-    if ( rc == 0 )
-    {
-        HANDLE file_handle = CreateFileW( file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 
-                                OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
-        if ( file_handle == INVALID_HANDLE_VALUE )
-        {
-            rc = print_error_for( file_name, "CreateFileW", rcOpening, klogInfo );
-        }
-        else
-        {
-            char buffer[ MAX_PATH ];
-            wchar_2_char( file_name, buffer, sizeof buffer );
-            rc = KSysFileMake ( ( KSysFile** ) f, file_handle, buffer, true, false );
-            if ( rc != 0 )
-                CloseHandle ( file_handle );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirOpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- */
-static
-rc_t CC KSysDirOpenFileWrite ( KSysDir *self,
-    KFile **f, bool update, const char *path, va_list args )
-{
-    wchar_t file_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcOpening, false, file_name, sizeof file_name, path, args );
-    if ( rc == 0 )
-    {
-        DWORD dwDesiredAccess = update ? GENERIC_READ | GENERIC_WRITE : GENERIC_WRITE;
-        HANDLE file_handle = CreateFileW( file_name, dwDesiredAccess, FILE_SHARE_READ, NULL, 
-                                OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
-
-        if ( file_handle == INVALID_HANDLE_VALUE )
-        {
-            rc = print_error_for( file_name, "CreateFileW", rcAccessing, klogErr );
-
-        }
-        else
-        {
-            char buffer[ MAX_PATH ];
-            wchar_2_char( file_name, buffer, sizeof buffer );
-            rc = KSysFileMake ( ( KSysFile** ) f, file_handle, buffer, update, true );
-            if ( rc != 0 )
-                CloseHandle ( file_handle );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirCreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- */
-static
-rc_t CC KSysDirCreateFile ( KSysDir *self, KFile **f, bool update,
-    uint32_t access, KCreateMode cmode, const char *path, va_list args )
-{
-    wchar_t file_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath( self, rcCreating, true, file_name, sizeof file_name, path, args );
-    if ( rc == 0 )
-    {
-        HANDLE file_handle;
-        DWORD dwDesiredAccess = update ? GENERIC_READ | GENERIC_WRITE : GENERIC_WRITE;
-        DWORD dwCreationDisposition = CREATE_ALWAYS;
-
-        switch ( cmode & kcmValueMask )
-        {
-        case kcmOpen : /* open if it exists, create if it does not exist */
-            dwCreationDisposition = OPEN_ALWAYS;
-            break;
-
-        case kcmInit : /* always create, if it already exists truncate to zero */
-            dwCreationDisposition = CREATE_ALWAYS;
-            break;
-
-        case kcmCreate : /* create and open only if does not already exist */
-            dwCreationDisposition = CREATE_NEW;
-            break;
-        }
-
-        file_handle = CreateFileW ( file_name, dwDesiredAccess, FILE_SHARE_READ,
-            NULL, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL );
-        while ( file_handle == INVALID_HANDLE_VALUE )
-        {
-            DWORD error;
-
-            if ( ( cmode & kcmParents ) != 0 )
-            {
-                /* maybe there were missing parent directories */
-                uint32_t dir_access = access |
-                    ( ( access & 0444 ) >> 2 ) | ( ( access & 0222 ) >> 1 );
-                KSysDirCreateParents ( self, file_name, dir_access, true );
-
-                /* try creating the file again */
-                file_handle = CreateFileW ( file_name, dwDesiredAccess, FILE_SHARE_READ,
-                    NULL, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL );
-                if ( file_handle != INVALID_HANDLE_VALUE )
-                    break;
-            }
-
-            error = GetLastError();
-            rc = translate_file_error( error, rcCreating );
-
-            /* disabled 12/12/2012 : it prints an error message, if vdb tries to open
-               the same reference-object twice via http. The lock-file for the 2nd try
-               does already exist. This is not an error, just a condition. */
-
-            /*
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "error CreateFileW - $(E) - $(C)",
-                        "E=%!,C=%u", error, error ) ); 
-            */
-
-            /* Unix code has a special case when creating an empty file, which is
-               to say, creating a directory entry without needing to write to file */
-            return rc;
-        }
-
-        {
-            char buffer[ MAX_PATH ];
-            wchar_2_char( file_name, buffer, sizeof buffer );
-            rc = KSysFileMake ( ( KSysFile** ) f, file_handle, path, update, true );
-            if ( rc != 0 )
-                CloseHandle ( file_handle );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KSysDirFileSize ( const KSysDir *self,
-    uint64_t *size, const char *path, va_list args )
-{
-    wchar_t file_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath( self, rcAccessing, false, file_name, sizeof file_name, path, args );
-    if ( rc == 0 )
-    {
-        WIN32_FILE_ATTRIBUTE_DATA file_data;
-        if ( GetFileAttributesEx ( file_name, GetFileExInfoStandard, &file_data ) )
-        {
-            *size = file_data.nFileSizeHigh;
-            *size <<= 32;
-            *size |= file_data.nFileSizeLow;
-        }
-        else
-        {
-            rc = print_error_for( file_name, "GetFileAttributesEx", rcAccessing, klogErr );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirSetFileSize
- *  sets size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KSysDirSetFileSize ( KSysDir *self,
-    uint64_t size, const char *path, va_list args )
-{
-    wchar_t file_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, file_name, sizeof file_name, path, args );
-    if ( rc == 0 )
-    {
-        HANDLE file_handle = CreateFileW( file_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
-                                OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
-        if ( file_handle != INVALID_HANDLE_VALUE )
-        {
-            DWORD file_pos_low, file_pos_high, file_set_res;
-
-            file_pos_low = (DWORD)( size & 0xFFFFFFFF );
-            size >>= 32;
-            file_pos_high = (DWORD)( size & 0xFFFFFFFF );
-            file_set_res = SetFilePointer ( file_handle, file_pos_low, (PLONG)&file_pos_high, FILE_BEGIN );
-            if ( file_set_res != INVALID_SET_FILE_POINTER )
-            {
-                if ( SetEndOfFile ( file_handle ) )
-                    rc = 0; /* success !!! */
-                else
-                    rc = translate_file_error( GetLastError(), rcUpdating );
-            }
-            CloseHandle ( file_handle );
-        }
-        else
-        {
-            rc = print_error_for( file_name, "CreateFileW", rcUpdating, klogErr );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirOpenDirRead
- * KSysDirOpenDirUpdate
- *  opens a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- */
-static
-rc_t CC KSysDirOpenDirRead ( const KSysDir *self,
-     const KDirectory **subp, bool chroot, const char *path, va_list args )
-{
-    wchar_t dir_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcOpening, true, dir_name, sizeof dir_name, path, args );
-    if ( rc == 0 )
-    {
-        KSysDir *sub;
-
-        size_t dir_size;
-        uint32_t dir_length = utf16_string_measure( dir_name, &dir_size );
-        uint32_t length_org = dir_length;
-        while ( dir_length > 0 && dir_name [ dir_length - 1 ] == '/' )
-            dir_name [ -- dir_length ] = 0;
-        if ( dir_length != length_org )
-            dir_length = utf16_string_measure( dir_name, &dir_size );
-
-        if ( ( KSysDirFullPathType ( dir_name ) & ( kptAlias - 1 ) ) != kptDir )
-            return RC(rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect );
-
-        sub = KSysDirMake ( dir_size );
-        if ( sub == NULL )
-            rc = RC(rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSysDirInit ( sub, rcOpening, self -> root, dir_name, 
-                               dir_size, dir_length, false, chroot );
-            if ( rc == 0 )
-            {
-                * subp = & sub -> dad;
-                return 0;
-            }
-
-            free ( sub );
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC KSysDirOpenDirUpdate ( KSysDir *self,
-    KDirectory **subp, bool chroot, const char *path, va_list args )
-{
-    wchar_t dir_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcOpening, true, dir_name, sizeof dir_name, path, args );
-    if ( rc == 0 )
-    {
-        KSysDir *sub;
-
-        size_t dir_size;
-        uint32_t dir_length = utf16_string_measure( dir_name, &dir_size );
-        uint32_t length_org = dir_length;
-        while ( dir_length > 0 && dir_name [ dir_length - 1 ] == '/' )
-            dir_name [ -- dir_length ] = 0;
-        if ( dir_length != length_org )
-            dir_length = utf16_string_measure( dir_name, &dir_size );
-
-        switch ( KSysDirFullPathType ( dir_name ) )
-        {
-        case kptNotFound:
-            return RC( rcFS, rcDirectory, rcOpening, rcPath, rcNotFound );
-        case kptBadPath:
-            return RC( rcFS, rcDirectory, rcOpening, rcPath, rcInvalid );
-        case kptDir:
-        case kptDir | kptAlias:
-            break;
-        default:
-            return RC( rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect );
-        }
-
-        sub = KSysDirMake ( dir_size );
-        if ( sub == NULL )
-            rc = RC( rcFS, rcDirectory, rcOpening, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSysDirInit ( sub, rcOpening, self -> root, dir_name, 
-                               dir_size, dir_length, true, chroot );
-            if ( rc == 0 )
-            {
-                * subp = & sub -> dad;
-                return 0;
-            }
-
-            free ( sub );
-        }
-    }
-    return rc;
-}
-
-/* KSysDirCreateDir
- *  create a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "access" [ IN ] - standard Unix directory permissions
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- */
-static
-rc_t CC KSysDirCreateDir ( KSysDir *self,
-    uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    wchar_t dir_name[ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcCreating, true, dir_name, sizeof dir_name, path, args );
-    if ( rc == 0 )
-    {
-        if ( ( mode & kcmValueMask ) == kcmCreate )
-        {
-            switch ( KSysDirFullPathType ( dir_name ) )
-            {
-            case kptNotFound:
-                break;
-            case kptBadPath:
-                return RC(rcFS, rcDirectory, rcCreating, rcPath, rcInvalid );
-            case kptDir:
-                return RC(rcFS, rcDirectory, rcCreating, rcDirectory, rcExists );
-            default:
-                return RC(rcFS, rcDirectory, rcCreating, rcPath, rcIncorrect );
-            }
-        }
-        rc = make_dir ( dir_name, access );
-        if ( rc != 0 )
-        {
-            switch ( GetRCState ( rc ) )
-            {
-            case rcExists:
-                rc = 0;
-                if ( ( mode & kcmValueMask ) == kcmInit )
-                    rc = KSysDirEmptyDir ( dir_name, sizeof dir_name, 1 );
-                break;
-            case rcNotFound:
-                if ( ( mode & kcmParents ) != 0 )
-                    rc = KSysDirCreateParents ( self, dir_name, access, false );
-                break;
-            }
-        }
-    }
-    return rc;
-}
-
-/* KSysDirDate
- *  get access to object
- *
- *  "date" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-static
-rc_t CC KSysDirVDate ( const KSysDir *self,
-    KTime_t * date, const char *path, va_list args )
-{
-    wchar_t full [ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcAccessing, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        rc = get_attributes ( full, NULL, date );
-    }
-    return rc;
-}
-
-
-static
-rc_t change_item_date( wchar_t *path, LPFILETIME win_time, bool dir_flag )
-{
-    rc_t rc;
-    HANDLE file_handle;
-
-    if ( dir_flag )
-        file_handle = CreateFileW( path, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
-                                   OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL );
-    else
-        file_handle = CreateFileW( path, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
-                                   OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
-    if ( file_handle == INVALID_HANDLE_VALUE )
-    {
-        rc = print_error_for( path, "CreateFileW", rcUpdating, klogErr );
-    }
-    else
-    {
-        if ( SetFileTime ( file_handle, NULL, NULL, win_time ) )
-        {
-            rc = 0;
-        }
-        else
-        {
-            rc = print_error_for( path, "SetFileTime", rcUpdating, klogErr );
-        }
-        CloseHandle ( file_handle );
-    }
-
-    return rc;
-}
-
-
-static
-rc_t change_dir_date( wchar_t *path, size_t path_max, LPFILETIME win_time, bool recurse )
-{
-    KSysDirEnum list;
-    const wchar_t *leaf;
-    size_t path_size;
-    uint32_t path_length;
-
-    rc_t rc = change_item_date( path, win_time, true );
-    if ( rc != 0 || !recurse )
-        return rc;
-
-    path_length = wchar_string_measure ( path, &path_size );
-    if ( ( path_size + 10 ) > path_max )
-        return RC( rcFS, rcDirectory, rcListing, rcMemory, rcExhausted );
-
-    rc = KSysDirEnumInitAll ( & list, path, path_length );
-    if ( rc != 0 )
-        return ResetRCContext ( rc, rcFS, rcDirectory, rcUpdating );
-
-    /* we keep only the appended '\\' for the loop... */
-    path_length++;
-    path_size += sizeof *path;
-
-    for ( leaf = KSysDirEnumNext( &list ); 
-          leaf != NULL && rc == 0; 
-          leaf = KSysDirEnumNext( &list ) )
-    {
-        size_t leaf_size;
-        int32_t path_type;
-        uint32_t leaf_length = wchar_string_measure ( leaf, &leaf_size );
-        if ( path_size + leaf_size >= path_max )
-            rc = RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-        else
-        {
-
-            /* wcscpy adds termination, so wprintf is safe to call */
-            wcscpy ( & path [ path_length ], leaf );
-
-            path_type = KSysDirFullPathType ( path );
-            switch( path_type )
-            {
-            case kptFile : rc = change_item_date( path, win_time, false );
-                           break;
-            case kptDir  : rc = change_dir_date( path, path_max, win_time, true );
-                           break;
-            }
-        }
-    }
-
-    KSysDirEnumWhack ( & list );
-    /* restore the original path... */
-    path [ path_length - 1 ] = 0;
-
-    return rc;
-}
-
-
-static
-rc_t KSysDirChangeDate ( wchar_t *path, size_t path_max,
-            KTime_t date, bool recurse )
-{
-    FILETIME win_time;
-    int32_t path_type;
-    rc_t rc;
-
-    KTimeToWinTime ( date, &win_time );
-    path_type = KSysDirFullPathType ( path );
-    switch( path_type )
-    {
-    case kptFile : rc = change_item_date( path, &win_time, false );
-                   break;
-
-    case kptDir  : rc = change_dir_date( path, path_max, &win_time, recurse );
-                   break;
-
-    default      : rc = RC( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnsupported );
-                   break;
-    }
-    return rc;
-}    
-
-
-/*
-    struct stat st;
-    struct utimbuf u;
-
-    if ( stat ( path, & st ) != 0 ) switch ( errno )
-    {
-    case ENOENT:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcNotFound );
-    case ENOTDIR:
-    case ELOOP:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcInvalid );
-    case ENAMETOOLONG:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcPath, rcExcessive );
-    case EACCES:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcDirectory, rcUnauthorized );
-    case ENOMEM:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcMemory, rcExhausted );
-    default:
-        return RC ( rcFS, rcDirectory, rcUpdating, rcNoObj, rcUnknown );
-    }
-    u . actime = u . modtime = date;
-
-    if ( recurse && S_ISDIR ( st . st_mode ) )
-    {
-        rc_t rc;
-
-    rc = KSysDirChangeEntryDate ( path, path_max, & u );
-    if ( rc != 0 )
-        return rc;
-
-    rc = KSysDirChangeDirDate ( path, path_max, date );
-        if ( rc == 0 )
-        {
-        rc = KSysDirChangeEntryDate ( path, path_max, & u  );
-        }
-        return rc;
-    }
-
-    return  KSysDirChangeEntryDate ( path, path_max, & u );
-*/
-
-static
-rc_t CC KSysDirVSetDate ( KSysDir * self, bool recurse,
-    KTime_t date, const char *path, va_list args )
-{
-    wchar_t full [ MAX_PATH ];
-    rc_t rc = KSysDirMakePath ( self, rcUpdating, false, full, sizeof full, path, args );
-    if ( rc == 0 )
-    {
-        rc = KSysDirChangeDate ( full, sizeof full, date, recurse );
-    }
-    return rc;
-}
-
-static
-KSysDir *CC KSysDirGetSysdir ( const KSysDir *cself )
-{
-    return ( KSysDir* ) cself;
-}
-
-static KDirectory_vt_v1 vtKSysDir =
-{
-    /* version 1.0 */
-    1, 1,
-
-    /* start minor version 0 methods*/
-    KSysDirDestroy,
-    KSysDirList,
-
-    /* the following two messages map to the same method, requiring type casting */
-    ( rc_t ( CC * )  ( const KSysDir*, bool,
-        rc_t ( CC * ) ( const KDirectory*, uint32_t, const char*, void* ), void*,
-        const char*, va_list ) ) KSysDirVisit,
-    ( rc_t ( CC * )  ( KSysDir*, bool,
-        rc_t ( CC * ) ( KDirectory*, uint32_t, const char*, void* ), void*,
-        const char*, va_list ) ) KSysDirVisit,
-
-    KSysDirPathType,
-    KSysDirResolvePath,
-    KSysDirResolveAlias,
-    KSysDirRename,
-    KSysDirRemove,
-    KSysDirClearDir,
-    KSysDirVAccess,
-    KSysDirSetAccess,
-    KSysDirCreateAlias,
-    KSysDirOpenFileRead,
-    KSysDirOpenFileWrite,
-    KSysDirCreateFile,
-    KSysDirFileSize,
-    KSysDirSetFileSize,
-    KSysDirOpenDirRead,
-    KSysDirOpenDirUpdate,
-    KSysDirCreateDir,
-    NULL, /* we don't track files*/
-    /* end minor version 0 methods*/
-
-    /* start minor version 1 methods*/
-    KSysDirVDate,
-    KSysDirVSetDate,
-    KSysDirGetSysdir
-    /* end minor version 1 methods*/
-};
-
-/* KSysDirInit
- */
-#if TRACK_REFERENCES
-static
-const char *convert_wide_path ( const wchar_t *path, const size_t path_size )
-{
-    /* copy wide string to static */
-    static char static_path [ MAX_PATH ];
-    wchar_cvt_string_copy ( static_path, sizeof static_path, path, path_size );
-
-    return static_path;
-}
-#else
-#define convert_wide_path( path, path_size ) "ignore"
-#endif
-
-static
-rc_t KSysDirInit ( KSysDir *self, enum RCContext ctx, uint32_t dad_root,
-                   const wchar_t *path, size_t path_size, uint32_t path_length, 
-                   bool update, bool chroot )
-{
-    rc_t rc;
-    if ( path == NULL )
-    {
-        rc = KDirectoryInit( &self->dad, (const KDirectory_vt*)&vtKSysDir, 
-                            "KSysDir", NULL, update );
-    }
-    else
-    {
-        rc = KDirectoryInit( &self->dad, (const KDirectory_vt*)&vtKSysDir, 
-                             "KSysDir", convert_wide_path ( path, path_size ), update );
-    }
-
-    if ( rc != 0 )
-    {
-        return ResetRCContext ( rc, rcFS, rcDirectory, ctx );
-    }
-
-    if ( path != NULL )
-    {
-        memcpy( self->path, path, path_size );
-    }
-
-    self->root = chroot ? path_length : dad_root;
-    self->length = path_length + 1;
-    self->path[ path_length ] = '\\';
-    self->path[ path_length + 1 ] = 0;
-    return 0;
-}
-
-
-/* MakeFromRealPath
- *  creates a KDirectory from a Windows path
- */
-rc_t KDirectoryMakeFromRealPath ( KDirectory **dirp, const wchar_t *real, bool update, bool chroot )
-{
-    rc_t rc;
-    size_t size;
-    uint32_t length = wchar_string_measure ( real, & size );
-    if ( length + 4 > MAX_PATH )
-        rc = RC ( rcFS, rcDirectory, rcCreating, rcPath, rcExcessive );
-    else
-    {
-        KSysDir *dir = KSysDirMake ( size );
-        if ( dir == NULL )
-            rc = RC ( rcFS, rcDirectory, rcAccessing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSysDirInit ( dir, rcAccessing, 0, real, size, length, update, chroot );
-            if ( rc == 0 )
-            {
-                * dirp = & dir -> dad;
-                return 0;
-            }
-            KSysDirDestroy ( dir );
-        }
-    }
-
-    * dirp = NULL;
-    return rc;
-}
-
-/* KDirectoryNativeDir
- *  returns a native file-system directory node reference
- *  the directory root will be "/" and set to the native
- *  idea of current working directory
- *
- *  NB - the returned reference will be non-const, allowing
- *  modification operations to be attempted. these operations
- *  may still fail if the underlying FS disallows them.
- *
- *  "dir" [ OUT ] - return parameter for native directory
- */
-extern rc_t CC ReportCWD ( const ReportFuncs *f, uint32_t indent );
-extern rc_t CC ReportRedirect ( KWrtHandler* handler,
-    const char* filename, bool* to_file, bool finalize );
-
-LIB_EXPORT rc_t CC KDirectoryNativeDir ( KDirectory **dirp )
-{
-    rc_t rc;
-
-    static bool latch;
-    if ( ! latch )
-    {
-        ReportInitKFS ( ReportCWD, ReportRedirect );
-        latch = true;
-    }
-
-    if ( dirp == NULL )
-        rc = RC ( rcFS, rcDirectory, rcAccessing, rcParam, rcNull );
-    else
-    {
-        wchar_t wd [ MAX_PATH ];
-        DWORD error;
-        DWORD wd_len = GetCurrentDirectoryW ( sizeof wd / sizeof wd [ 0 ], wd );
-        if ( wd_len != 0 )
-            return KDirectoryMakeFromRealPath ( dirp, wd, true, false );
-
-        error = GetLastError();
-        switch ( error )
-        {
-        case ERROR_ACCESS_DENIED:
-            rc = RC ( rcFS, rcDirectory, rcAccessing, rcDirectory, rcUnauthorized );
-            break;
-        default:
-            rc = RC ( rcFS, rcDirectory, rcAccessing, rcNoObj, rcUnknown );
-        }
-        PLOGERR ( klogErr,
-                  ( klogErr, rc, "error GetCurrentDirectoryW - $(E) - $(C)",
-                    "E=%!,C=%u", error, error ) ); 
-
-        * dirp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* RealPath
- *  exposes functionality of system directory
- */
-LIB_EXPORT rc_t CC KSysDirRealPath ( struct KSysDir const *self,
-    char *real, size_t bsize, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KSysDirVRealPath ( self, real, bsize, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KSysDirVRealPath ( struct KSysDir const *self,
-    char *real, size_t bsize, const char *path, va_list args )
-{
-    /* Windows is ... challenged when it comes to answering
-       this question. What is needed is to 1) convert the path
-       to a Windows-style wchar path, then 2) resolve each of
-       its components, etc. to come up with a real path, then
-       3) rewrite the path as a UTF-8 POSIX path */
-    return KSysDirResolvePath ( self, true, real, bsize, path, args );
-}
diff --git a/libs/kfs/win/sysdll.c b/libs/kfs/win/sysdll.c
deleted file mode 100644
index 3ccf125..0000000
--- a/libs/kfs/win/sysdll.c
+++ /dev/null
@@ -1,1410 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _WIN32_WINNT /* This file requires OS newer than Windows 2000 */
-# define _WIN32_WINNT 0x0501
-#endif
-
-#include <kfs/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "va_copy.h"
-#include "sysdir-priv.h"
-
-#include <kfs/dyload.h>
-#include <kfs/directory.h>
-#include <kfs/kfs-priv.h>
-#include <klib/refcount.h>
-#include <klib/vector.h>
-#include <klib/text.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#include <WINDOWS.H>
-
-#if _STATIC
-#define ALWAYS_ADD_EXE 1
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * WString
- */
-typedef struct WString WString;
-struct WString
-{
-    const wchar_t *addr;
-    size_t size;
-    uint32_t len;
-};
-
-#define WStringInit( s, val, sz, length ) \
-    StringInit ( s, val, sz, length )
-
-#define WStringInitCString( s, cstr ) \
-    ( void ) ( ( s ) -> len = ( uint32_t )( wcslen ( ( s ) -> addr = ( cstr ) ) ), \
-               ( s ) -> size = ( ( size_t ) ( s ) -> len * sizeof ( wchar_t ) ) )
-
-#define CONST_WSTRING( s, val ) \
-    WStringInitCString ( s, L ## val )
-
-static
-int WStringCaseCompare ( const WString *a, const WString *b )
-{
-    int diff;
-
-    uint32_t min_len = a -> len;
-    if ( a -> len > b -> len )
-        min_len = b -> len;
-
-    diff = _wcsnicmp ( a -> addr, b -> addr, min_len );
-    if ( diff == 0 )
-        diff = ( int ) a -> len - ( int ) b -> len;
-
-    return diff;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- */
-static
-void CC KDirRefRelease ( void *item, void *ignore )
-{
-    KDirectoryRelease ( ( const void* ) item );
-}
-
-/*--------------------------------------------------------------------------
- * KDyld
- *  dynamic library loader
- *
- *  maintains cache of libraries it has opened while they remain open
- *  such that subsequent requests for an open library will return a
- *  new reference to the existing library.
- */
-struct KDyld
-{
-    Vector search;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDyldWhack ( KDyld *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDyld" );
-
-    VectorWhack ( & self -> search, KDirRefRelease, NULL );
-    free ( self );
-
-    return 0;
-}
-
-
-/* Make
- *  create a dynamic loader object
- *
- *  "dl" [ OUT ] - return parameter for loader
- */
-LIB_EXPORT rc_t CC KDyldMake ( KDyld **dlp )
-{
-    rc_t rc;
-
-    if ( dlp == NULL )
-        rc = RC ( rcFS, rcDylib, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KDyld *dl = malloc ( sizeof * dl );
-        if ( dl == NULL )
-            rc = RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            VectorInit ( & dl -> search, 1, 8 );
-            KRefcountInit ( & dl -> refcount, 1, "KDyld", "make", "dl" );
-
-            * dlp = dl;
-            return 0;
-        }
-
-        * dlp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDyldAddRef ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDyld" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDyldRelease ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDyld" ) )
-        {
-        case krefWhack:
-            return KDyldWhack ( ( KDyld* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Attach
- * Sever
- */
-static
-KDyld *KDyldAttach ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDyld" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDyld* ) self;
-}
-
-static
-rc_t KDyldSever ( const KDyld *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDyld" ) )
-        {
-        case krefWhack:
-            return KDyldWhack ( ( KDyld* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddSearchPath
- *  add a search path to loader for locating library files
- */
-LIB_EXPORT rc_t CC KDyldVAddSearchPath ( KDyld *self, const char *path, va_list args )
-{
-    rc_t rc;
-    if ( self == NULL )
-        rc = RC ( rcFS, rcDylib, rcUpdating, rcSelf, rcNull );
-    else
-    {
-        KDirectory *wd;
-        rc = KDirectoryNativeDir ( & wd );
-        if ( rc == 0 )
-        {
-            const KDirectory *dir;
-            rc = KDirectoryVOpenDirRead ( wd, & dir, false, path, args );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( & self -> search, NULL, dir );
-                if ( rc != 0 )
-                    KDirectoryRelease ( dir );
-            }
-
-            KDirectoryRelease ( wd );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldAddSearchPath ( KDyld *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDyldVAddSearchPath ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-static
-void KDyldForEach ( const KDyld *self,
-    void ( CC * f ) ( const KDirectory *dir, void *data ), void *data )
-{
-    VectorForEach ( & self -> search, false,
-        ( void ( CC * ) ( void*, void* ) ) f, data );
-}
-
-
-/* HomeDirectory
- *  returns a KDirectory where the binary for a given function is located
- *
- *  "dir" [ OUT ] - return paraeter for home directory, if found
- *
- *  "func" [ IN ] - function pointer within binary to be located
- */
-LIB_EXPORT rc_t CC KDyldHomeDirectory ( const KDyld *self, const KDirectory **dir, fptr_t func )
-{
-    rc_t rc;
-
-    if ( dir == NULL )
-        rc = RC ( rcFS, rcDylib, rcSearching, rcParam, rcNull );
-    else
-    {
-        * dir = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSearching, rcSelf, rcNull );
-        else if ( func == NULL )
-            rc = RC ( rcFS, rcDylib, rcSearching, rcFunction, rcNull );
-        else
-        {
-            HMODULE h;
-            /* casting a function pointer to a string pointer because the Windows API
-             * allows a name or an address within to be passed in but doesn't provide
-             * a type safe way to do this */
-            BOOL success = GetModuleHandleEx ( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
-                                               | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
-                                               ( const TCHAR * )func, & h );
-            if ( success )
-            {
-                wchar_t fname [ MAX_PATH ];
-                DWORD name_len = GetModuleFileNameW ( h, fname, ( DWORD ) sizeof fname / sizeof fname [ 0 ] );
-                if ( name_len >= sizeof fname / sizeof fname [ 0 ] )
-                    rc = RC ( rcFS, rcDylib, rcSearching, rcPath, rcExcessive );
-                else
-                {
-                    /* trim off module name */
-                    while ( name_len > 0 )
-                    {
-                        if ( fname [ -- name_len ] == '\\' )
-                        {
-                            fname [ name_len ] = 0;
-                            break;
-                        }
-                    }
-
-                    /* now use directory path */
-                    rc = KDirectoryMakeFromRealPath ( ( KDirectory** ) dir, fname, false, false );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDylib
- *  Windows dynamic library
- */
-struct KDylib
-{
-    HMODULE handle;
-    WString path;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDylibWhack ( KDylib *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDylib" );
-
-    /* try to close library */
-	if ( !FreeLibrary( self -> handle ) )
-    {
-        /* report error */
-/*        const char *msg = dlerror (); */
-        rc_t rc = RC ( rcFS, rcDylib, rcClosing, rcNoObj, rcUnknown );
-/*        LOGERR ( klogInt, rc, msg );
-        ( void ) msg; */
-        return rc;
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KDylibMake ( KDylib **libp, const WString *path )
-{
-    wchar_t *cpy;
-    KDylib *lib = malloc ( sizeof * lib + path -> size + 4 );
-    if ( lib == NULL )
-        return RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-
-    cpy = ( wchar_t* ) ( lib + 1 );
-    lib -> handle = NULL;
-
-    memcpy ( cpy, path -> addr, path -> size );
-    cpy [ path -> len ] = 0;
-
-    WStringInit ( & lib -> path, cpy, path -> size, path -> len );
-
-    KRefcountInit ( & lib -> refcount, 1, "KDylib", "make", "WinDLL" );
-
-    * libp = lib;
-    return 0;
-}
-
-/* SetLogging
- */
-static
-rc_t KDylibSetLogging ( const KDylib *self )
-{
-    rc_t ( CC * set_formatter ) ( KFmtWriter writer, KLogFmtFlags flags, void *data );
-    rc_t ( CC * set_writer ) ( KWrtWriter writer, void *data );
-
-    /* set the current logging level */
-    rc_t ( CC * set_level ) ( KLogLevel lvl ) = ( void* ) GetProcAddress ( self -> handle, "KLogLevelSet" );
-    if ( set_level != NULL )
-    {
-        KLogLevel lvl = KLogLevelGet ();
-        ( * set_level ) ( lvl );
-    }
-
-    /* determine current library logging */
-    set_writer = ( void* ) GetProcAddress ( self -> handle, "KOutHandlerSet" );
-    if ( set_writer != NULL )
-    {
-        const KWrtHandler* handler = KOutHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-
-    set_formatter = ( void* ) GetProcAddress ( self -> handle, "KLogLibFmtHandlerSet" );
-    if ( set_formatter != NULL )
-    {
-        KLogFmtFlags flags = KLogLibFmtFlagsGet ();
-        const KFmtHandler* fmt_handler = KLogFmtHandlerGet ();
-        ( * set_formatter ) ( fmt_handler -> formatter, flags, fmt_handler -> data );
-    }
-    set_writer = ( void* ) GetProcAddress ( self -> handle, "KLogLibHandlerSet" );
-    if ( set_writer != NULL )
-    {
-        const KWrtHandler* handler = KLogLibHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-
-    set_formatter = ( void* ) GetProcAddress ( self -> handle, "KStsLibFmtHandlerSet" );
-    if ( set_formatter != NULL )
-    {
-        KStsFmtFlags flags = KStsLibFmtFlagsGet ();
-        const KFmtHandler* fmt_handler = KStsFmtHandlerGet ();
-        ( * set_formatter ) ( fmt_handler -> formatter, flags, fmt_handler -> data );
-    }
-    set_writer = ( void* ) GetProcAddress ( self -> handle, "KStsLibHandlerSet" );
-    if ( set_writer != NULL )
-    {
-        const KWrtHandler* handler = KStsLibHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-#if _DEBUGGING
-    set_writer = ( void* ) GetProcAddress ( self -> handle, "KDbgHandlerSet" );
-    if ( set_writer != NULL )
-    {
-        const KWrtHandler* handler = KDbgHandlerGet ();
-        ( * set_writer ) ( handler -> writer, handler -> data );
-    }
-#endif
-    return 0;
-}
-
-/* LoadLib
- *  load a dynamic library
- *
- *  "lib" [ OUT ] - return parameter for loaded library
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target library
- */
-static
-rc_t KDyldLoad ( KDyld *self, KDylib *lib, const wchar_t *path )
-{
-    DWORD err;
-#if WE_WERE_BUILDING_FOR_WINDOWS_7_ALONE
-    UINT errMode = GetErrorMode();
-#endif
-
-	if ( path == NULL )
-	{
-		if ( GetModuleHandleExW( 0, NULL, &( lib -> handle ) ) )
-			return 0;
-
-        return RC ( rcFS, rcDylib, rcLoading, rcNoObj, rcUnknown );
-	}
-
-    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); /* suppress the message box in case of an error */
-    lib -> handle = LoadLibraryW ( path );
-#if WE_WERE_BUILDING_FOR_WINDOWS_7_ALONE
-    SetErrorMode(errMode);
-#endif
-    if ( lib -> handle != NULL )
-        return KDylibSetLogging ( lib );
-
-    err = GetLastError ();
-    switch ( err )
-    {
-    case ERROR_MOD_NOT_FOUND :
-        return RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-    case ERROR_BAD_EXE_FORMAT :
-        return RC ( rcFS, rcDylib, rcLoading, rcFormat, rcInvalid );
-    }
-
-    return RC ( rcFS, rcDylib, rcLoading, rcNoObj, rcUnknown );
-}
-
-static
-rc_t KDyldVTryLoadLib ( KDyld *self, KDylib **lib,
-    const KDirectory *dir, const char *path, va_list args )
-{
-    rc_t rc;
-
-    const KSysDir *sdir = KDirectoryGetSysDir ( dir );
-    if ( sdir == NULL )
-        rc = RC ( rcFS, rcDylib, rcLoading, rcDirectory, rcIncorrect );
-    else
-    {
-        wchar_t real [ MAX_PATH ];
-
-		rc = KSysDirOSPath ( sdir, real, sizeof real, path, args );
-		if ( rc == 0 )
-		{
-			WString pstr;
-			WStringInitCString ( & pstr, real );
-
-			rc = KDylibMake ( lib, & pstr );
-			if ( rc == 0 )
-			{
-				rc = KDyldLoad ( self, * lib, real );
-				if ( rc == 0 )
-					return 0;
-				free ( * lib );
-			}
-        }
-    }
-
-    * lib = NULL;
-
-    return rc;
-}
-
-static
-rc_t KDyldTryLoadLib ( KDyld *self, KDylib **lib,
-    const KDirectory *dir, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, path );
-    rc = KDyldVTryLoadLib ( self, lib, dir, path, args );
-    va_end ( args );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldVLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( lib == NULL )
-        rc = RC ( rcFS, rcDylib, rcLoading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcLoading, rcSelf, rcNull );
-        else if ( path == NULL || path [ 0 ] == 0 )
-        {
-            WString pstr;
-            CONST_WSTRING ( & pstr, "" );
-
-            rc = KDylibMake ( lib, & pstr );
-            if ( rc == 0 )
-            {
-                rc = KDyldLoad ( self, * lib, NULL );
-                if ( rc == 0 )
-                    return 0;
-            
-                free ( * lib );
-            }
-        }
-        else
-        {
-            uint32_t i = VectorStart ( & self -> search );
-            uint32_t end = i + VectorLength ( & self -> search );
-
-            if ( i == end )
-            {
-                char name [ 4096 ];
-                int len = vsnprintf ( name, sizeof name, path, args );
-                if ( len < 0 || len >= sizeof name )
-                    rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcExcessive );
-                else
-                {
-                    WString pstr;
-                    wchar_t wname [ 4096 ];
-                    size_t wsize = string_cvt_wchar_copy ( wname, sizeof wname, name, len );
-                    WStringInit ( & pstr, wname, wsize * sizeof wname [ 0 ], string_len ( name, len ) );
-
-                    rc = KDylibMake ( lib, & pstr );
-                    if ( rc == 0 )
-                    {
-                        rc = KDyldLoad ( self, * lib, wname );
-                        if ( rc == 0 )
-                            return 0;
-                    
-                        free ( * lib );
-                    }
-                }
-            }
-            else
-            {
-                for ( * lib = NULL; i < end; ++ i )
-                {
-                    const KDirectory *dir;
-
-                    va_list cpy;
-                    va_copy ( cpy, args );
-
-                    dir = ( const void* ) VectorGet ( & self -> search, i );
-                    rc = KDyldVTryLoadLib ( self, lib, dir, path, cpy );
-
-                    va_end ( cpy );
-
-                    if ( rc == 0 || GetRCState ( rc ) != rcNotFound )
-                        return rc;
-                }
-
-                rc = RC ( rcFS, rcDylib, rcLoading, rcPath, rcNotFound );
-            }
-        }
-
-        * lib = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDyldLoadLib ( KDyld *self,
-    KDylib **lib, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = KDyldVLoadLib ( self, lib, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDylibAddRef ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDylib" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDylibRelease ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDylib" ) )
-        {
-        case krefWhack:
-            return KDylibWhack ( ( KDylib* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-static
-void CC KDylibVectRelease ( void *item, void *ignore )
-{
-    KDylib *self = item;
-    KDylibRelease ( self );
-}
-
-
-/* Attach
- * Sever
- */
-static
-KDylib *KDylibAttach ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "KDylib" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( KDylib* ) self;
-}
-
-static
-rc_t KDylibSever ( const KDylib *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "KDylib" ) )
-        {
-        case krefWhack:
-            return KDylibWhack ( ( KDylib* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Sort
- */
-static
-int CC KDylibSort ( const void *item, const void *n )
-{
-    const KDylib *a = item;
-    const KDylib *b = n;
-    return WStringCaseCompare ( & a -> path, & b -> path );
-}
-
-
-/* FullPath
- *  return full path to library
- */
-LIB_EXPORT rc_t CC KDylibFullPath ( const KDylib *self, char *path, size_t psize )
-{
-    rc_t rc;
-
-    if ( psize == 0 )
-        rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcInsufficient );
-    else if ( path == NULL )
-        rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            size_t i, bytes = wchar_cvt_string_copy ( path, psize,
-                self -> path . addr, self -> path . size );
-            if ( bytes < psize )
-            {
-                if ( isalpha ( path [ 0 ] ) && path [ 1 ] == ':' )
-                {
-                    path [ 1 ] = path [ 0 ];
-                    path [ 0 ] = '/';
-                }
-                for ( i = 0; i < bytes; ++ i )
-                {
-                    if ( path [ i ] == '\\' )
-                        path [ i ] = '/';
-                }
-
-                return 0;
-            }
-
-            rc = RC ( rcFS, rcDylib, rcAccessing, rcBuffer, rcInsufficient );
-        }
-
-        path [ 0 ] = 0;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * KDlset
- *  ordered set of dynamic libraries
- *  contained libraries remain resident until set is released
- */
-struct KDlset
-{
-    KDyld *dl;
-    Vector name, ord;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KDlsetWhack ( KDlset *self )
-{
-    KRefcountWhack ( & self -> refcount, "KDlset" );
-
-    VectorWhack ( & self -> name, NULL, NULL );
-    VectorWhack ( & self -> ord, KDylibVectRelease, NULL );
-    KDyldSever ( self -> dl );
-    free ( self );
-
-    return 0;
-}
-
-#define STRINGIZE(s) #s
-#define LIBNAME(pref, name, suff) STRINGIZE(pref) name STRINGIZE(suff)
-/* MakeSet
- *  load a dynamic library
- *
- *  "set" [ OUT ] - return parameter for lib set
- */
-LIB_EXPORT rc_t CC KDyldMakeSet ( const KDyld *self, KDlset **setp )
-{
-    rc_t rc = 0;
-    
-    if ( setp == NULL )
-        rc = RC ( rcFS, rcDylib, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcConstructing, rcSelf, rcNull );
-        else
-        {
-            KDlset *set = malloc ( sizeof * set );
-            if ( set == NULL )
-                rc = RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                set -> dl = KDyldAttach ( self );
-                VectorInit ( & set -> name, 0, 16 );
-                VectorInit ( & set -> ord, 0, 16 );
-                KRefcountInit ( & set -> refcount, 1, "KDlset", "make", "dlset" );
-#if ! ALWAYS_ADD_EXE
-                {   
-                    KDylib *jni;
-                    const char* libname = "vdb_jni.dll";
-                    rc = KDyldLoadLib ( ( KDyld* ) self, & jni, libname );
-                    if ( rc == 0 )
-                    {
-                        rc = KDlsetAddLib ( set, jni );
-                        KDylibRelease ( jni );
-                    }
-                    /*if (rc == 0)*/ /* if JNI code is not there, C tools should not suffer */
-                    {
-                        * setp = set;
-                        return 0;
-                    }
-                }
-#else
-                {
-                    KDylib *exe;
-                    rc = KDyldLoadLib ( ( KDyld* ) self, & exe, NULL );
-                    if ( rc == 0 )
-                    {
-                        rc = KDlsetAddLib ( set, exe );
-                        KDylibRelease ( exe );
-                        if ( rc == 0 )
-                        {
-                            * setp = set;
-                            return 0;
-                        }
-                    }
-                }
-
-                KDlsetRelease ( set );
-#endif
-            }
-        }
-
-        * setp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KDlsetAddRef ( const KDlset *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KDlset" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDlsetRelease ( const KDlset *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KDlset" ) )
-        {
-        case krefWhack:
-            return KDlsetWhack ( ( KDlset* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddLib
- *  adds a dynamic library to end of ordered set
- *
- *  "lib" [ IN ] - library returned from KDyldLoadLib
- */
-static
-rc_t KDlsetAddLibInt ( KDlset *self, KDylib *lib )
-{
-    uint32_t idx;
-    rc_t rc = VectorAppend ( & self -> ord, & idx, lib );
-    if ( rc == 0 )
-    {
-        void *ignore;
-        
-        rc = VectorInsertUnique ( & self -> name,
-            lib, NULL, KDylibSort );
-        if ( rc == 0 )
-            return 0;
-
-        VectorSwap ( & self -> ord, idx, NULL, & ignore );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDlsetAddLib ( KDlset *self, KDylib *lib )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcFS, rcDylib, rcInserting, rcSelf, rcNull );
-    else if ( lib == NULL )
-        rc = RC ( rcFS, rcDylib, rcInserting, rcDylib, rcNull );
-    else
-    {
-        rc = KDylibAddRef ( lib );
-        if ( rc == 0 )
-        {
-            rc = KDlsetAddLibInt ( self, lib );
-            if ( rc == 0 )
-                return 0;
-
-            KDylibRelease ( lib );
-        }
-    }
-
-    return rc;
-}
-
-
-/* AddAll
- *  adds all dynamic libraries found in dl search path
- */
-static
-rc_t CC KDlsetTryLib ( const KDirectory *dir,
-    uint32_t type, const char *name, void *data )
-{
-    KDlset *self = data;
-
-    if ( ( type & ~ kptAlias ) == kptFile )
-    {
-        rc_t rc;
-        KDylib *lib;
-#ifdef SHLX
-        /* force simple shared library extension */
-        if ( sizeof SHLX >= 2 )
-        {
-            /* SHLX has at least 1 character plus NUL byte */
-            uint32_t len = strlen ( name );
-            /* name must be at least 1 character larger */
-            if ( len <= ( sizeof SHLX - 1 ) )
-                return 0;
-            /* name must end with shared library extension */
-            if ( memcmp ( & name [ len - ( sizeof SHLX - 1 ) ], SHLX, sizeof SHLX - 1 ) != 0 )
-                return 0;
-        }
-#endif
-        rc = KDyldTryLoadLib ( self -> dl, & lib, dir, name );
-        if ( rc == 0 )
-        {
-            rc = KDlsetAddLibInt ( self, lib );
-            if ( rc == 0 )
-                return 0;
-
-            KDylibRelease ( lib );
-        }
-    }
-
-    return 0;
-}
-
-static
-void CC KDlsetVisitDir ( const KDirectory *dir, void *data )
-{
-    KDirectoryVisit ( dir, false, KDlsetTryLib, data, "." );
-}
-
-LIB_EXPORT rc_t CC KDlsetAddAll ( KDlset *self )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcDylib, rcInserting, rcSelf, rcNull );
-    KDyldForEach ( self -> dl, KDlsetVisitDir, self );
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KSymAddr
- *  symbol address within a dynamic library
- */
-struct KSymAddr
-{
-    KDylib *lib;
-    void *addr;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KSymAddrWhack ( KSymAddr *self )
-{
-    KRefcountWhack ( & self -> refcount, "KSymAddr" );
-
-    KDylibSever ( self -> lib );
-    free ( self );
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KSymAddrAddRef ( const KSymAddr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KSymAddr" ) )
-        {
-        case krefLimit:
-            return RC ( rcFS, rcDylib, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSymAddrRelease ( const KSymAddr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KSymAddr" ) )
-        {
-        case krefWhack:
-            return KSymAddrWhack ( ( KSymAddr* ) self );
-        case krefNegative:
-            return RC ( rcFS, rcDylib, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t KSymAddrMake ( KSymAddr **symp,
-    const KDylib *lib, const char *name )
-{
-    FARPROC addr = GetProcAddress ( lib -> handle, name );
-    if ( addr != NULL )
-    {
-        KSymAddr *sym = malloc ( sizeof * sym );
-        if ( sym == NULL )
-            return RC ( rcFS, rcDylib, rcConstructing, rcMemory, rcExhausted );
-
-        sym -> lib = KDylibAttach ( lib );
-        sym -> addr = (void *)addr;
-        KRefcountInit ( & sym -> refcount, 1, "KSymAddr", "make", name );
-        * symp = sym;
-        return 0;
-    }
-
-    * symp = NULL;
-    return RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-}
-
-
-/* Symbol
- *  find a symbol within dynamic library
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- */
-LIB_EXPORT rc_t CC KDylibSymbol ( const KDylib *self, KSymAddr **sym, const char *name )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else
-        {
-            return KSymAddrMake ( sym, self, name );
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-typedef struct KDlsetTrySymData KDlsetTrySymData;
-struct KDlsetTrySymData
-{
-    const KDlset *self;
-    const char *name;
-
-    bool ( CC * test ) ( const KSymAddr *sym, void *data );
-    void *data;
-
-    KSymAddr *sym;
-    rc_t rc;
-    bool first;
-};
-
-static
-bool CC KDlsetTrySymbol ( void *item, void *data )
-{
-    KSymAddr *sym;
-    KDlsetTrySymData *pb = data;
-    pb -> rc = KDylibSymbol ( item, & sym, pb -> name );
-    if ( pb -> rc == 0 )
-    {
-        /* simple case */
-        if ( pb -> test == NULL )
-        {
-            pb -> sym = sym;
-            return true;
-        }
-
-        /* apply filter function */
-        if ( ( * pb -> test ) ( sym, pb -> data ) )
-        {
-            KSymAddrRelease ( pb -> sym );
-            pb -> sym = sym;
-            return pb -> first;
-        }
-
-        KSymAddrRelease ( sym );
-    }
-    return false;
-}
-
-LIB_EXPORT rc_t CC KDlsetSymbol ( const KDlset *self, KSymAddr **sym, const char *name )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-
-            if ( VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb ) )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-
-/* FirstSymbol
- * LastSymbol
- *  find a symbol within dynamic library set matching criteria
- *
- *  "sym" [ OUT ] - return parameter for exported symbol address
- *
- *  "name" [ IN ] - NUL terminated symbol name in
- *  library-native character set
- *
- *  "test" [ IN ] and "data" [ IN, OPAQUE ] - callback filter function
- *  return true if symbol matches criteria
- */
-LIB_EXPORT rc_t CC KDlsetFirstSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data )
-{
-    rc_t rc;
-
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else if ( test == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcFunction, rcNull );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . test = test;
-            pb . data = data;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-            pb . first = true;
-
-            if ( VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb ) )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDlsetLastSymbol ( const KDlset *self, KSymAddr **sym, const char *name,
-    bool ( CC * test ) ( const KSymAddr *sym, void *data ), void *data )
-{
-    rc_t rc;
-    
-    if ( sym == NULL )
-        rc = RC ( rcFS, rcDylib, rcSelecting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcEmpty );
-        else if ( test == NULL )
-            rc = RC ( rcFS, rcDylib, rcSelecting, rcFunction, rcNull );
-        else
-        {
-            KDlsetTrySymData pb;
-            memset ( & pb, 0, sizeof pb );
-            pb . self = self;
-            pb . name = name;
-            pb . test = test;
-            pb . data = data;
-            pb . rc = RC ( rcFS, rcDylib, rcSelecting, rcName, rcNotFound );
-
-            VectorDoUntil ( & self -> ord, false, KDlsetTrySymbol, & pb );
-            if ( pb . sym != NULL )
-            {
-                * sym = pb . sym;
-                return 0;
-            }
-
-            rc = pb . rc;
-        }
-
-        * sym = NULL;
-    }
-
-    return rc;
-}
-
-
-/* List - PRIVATE
- *  list the paths to the libraries in the set
- */
-typedef struct list_dylib_param list_dylib_param;
-struct list_dylib_param
-{
-    VNamelist *list;
-    rc_t rc;
-};
-
-static
-bool CC list_dylib ( void *item, void *data )
-{
-    size_t bytes;
-    char utf8 [ 4096 ], *p;
-
-    list_dylib_param *pb = data;
-    const KDylib *lib = ( const void* ) item;
-
-    /* "lib" was created with KDylibMake
-       which creates a NUL terminated path.
-       of course, this could seg-fault if bad... */
-    assert ( lib -> path . addr [ lib -> path . len ] == 0 );
-
-    /* convert wide-character to UTF-8 */
-    bytes = wchar_cvt_string_copy ( utf8, sizeof utf8, lib -> path . addr, lib -> path . size );
-    if ( bytes < sizeof utf8 )
-    {
-        pb -> rc = VNamelistAppend ( pb -> list, utf8 );
-        return pb -> rc != 0;
-    }
-
-    p = malloc ( 16 * 1024 );
-    if ( p == NULL )
-    {
-        pb -> rc = RC ( rcFS, rcDylib, rcListing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    bytes = wchar_cvt_string_copy ( p, 16 * 1024, lib -> path . addr, lib -> path . size );
-    if ( bytes >= 16 * 1024 )
-        pb -> rc = RC ( rcFS, rcDylib, rcListing, rcPath, rcTooLong );
-    else
-        pb -> rc = VNamelistAppend ( pb -> list, p );
-
-    free ( p );
-    return pb -> rc != 0;
-}
-
-LIB_EXPORT rc_t CC KDlsetList ( const KDlset *self, KNamelist **listp )
-{
-    list_dylib_param pb;
-
-    assert ( listp != NULL );
-
-    if ( self == NULL )
-        pb . rc = RC ( rcFS, rcDylib, rcListing, rcSelf, rcNull );
-    else
-    {
-        pb . rc = VNamelistMake ( & pb . list, VectorLength ( & self -> name ) );
-        if ( pb . rc == 0 )
-        {
-            bool fail = VectorDoUntil ( & self -> name, false, list_dylib, & pb );
-            if ( ! fail )
-                pb . rc = VNamelistToNamelist ( pb . list, listp );
-
-            VNamelistRelease ( pb . list );
-        }
-    }
-
-    return pb . rc;
-}
-
-
-/* AsObj
- * AsFunc
- *  retrieve symbol address as pointer to object
- */
-LIB_EXPORT void * CC KSymAddrAsObj ( const KSymAddr *self )
-{
-    if ( self != NULL )
-        return self -> addr;
-    return NULL;
-}
-
-LIB_EXPORT void CC KSymAddrAsFunc ( const KSymAddr *self, fptr_t *fp )
-{
-    if ( self != NULL && fp != NULL )
-        * fp = ( fptr_t ) self -> addr;
-}
-
-
diff --git a/libs/kfs/win/sysfile-priv.h b/libs/kfs/win/sysfile-priv.h
deleted file mode 100644
index f0d4ebe..0000000
--- a/libs/kfs/win/sysfile-priv.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysfile_priv_
-#define _h_sysfile_priv_
-
-#ifndef _h_os_native_
-#include <os-native.h>
-#endif
-
-#ifndef _h_kfs_impl_
-#include <kfs/impl.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KSysFile
- *  a Windows file
- */
-typedef struct KSysFile KSysFile;
-struct KSysFile
-{
-    KFile dad;
-    HANDLE handle;
-    uint64_t pos;
-    bool failed_set_sparse;
-    bool is_sparse; /* throws off size dang it */
-    
-};
-
-/* KSysFileMake
- *  create a new file object
- *  from file descriptor
- */
-rc_t KSysFileMake ( KSysFile **fp, HANDLE fd, const char *path, bool read_enabled, bool write_enabled );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_sysfile_priv_ */
diff --git a/libs/kfs/win/sysfile.c b/libs/kfs/win/sysfile.c
deleted file mode 100644
index 681b0cc..0000000
--- a/libs/kfs/win/sysfile.c
+++ /dev/null
@@ -1,1018 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSysFile;
-#define KFILE_IMPL struct KSysFile
-
-#include "sysfile-priv.h"
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-
-/* temporary */
-/* #include <klib/out.h> */
-
-
-
-#include <Windows.h>
-/* #include <WinIoCtl.h> nested include in Windows.h? */
-
-/*--------------------------------------------------------------------------
- * KSysFile
- *  a Windows file
- */
-
-/* minimum set size or write beyond size difference to trigger setting sparse */
-/* tune this if too many or too few sparse files */
-#define MIN_SET_SPARSE_DIFF   (16*1024)
-#define MIN_SPARSE_BLOCK_DIFF  (4*1024)
-
-
-/* ----------
- * Some functions to isolate the calls to Windows functions as I feel dirty
- * just using them.
- * really its to isolate some calls the very different style of parmaters
- * for the calls from the usualy project approach.
- *
- * if the compiler inlines them it's all good.
- */
-
-/*
- * Get file size 
- */
-static rc_t get_file_size (const KSysFile * self, uint64_t * size)
-{
-    LARGE_INTEGER sz;
-
-    if ( GetFileSizeEx ( self -> handle, & sz ) == 0 )
-    {
-        rc_t rc;
-        DWORD last_error;
-
-        last_error = GetLastError ();
-        switch ( last_error )
-        {
-        case ERROR_INVALID_HANDLE:
-            rc = RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-            break;
-        default:
-            rc = RC ( rcFS, rcFile, rcAccessing, rcNoObj, rcUnknown );
-            break;
-        }
-        PLOGERR (klogErr,
-                 (klogErr, rc, "error accessing file system status - $(E)($(C))",
-                  "E=%!,C=%u", last_error, last_error)); 
-        return rc;
-    }
-    *size = sz.QuadPart;
-
-    return 0;
-}
-
-
-/* returns (and side effect sets in structure)
- * if the file is already a sparse file
- */
-static bool check_if_sparse (KSysFile * self)
-{
-    BY_HANDLE_FILE_INFORMATION info;
-    BOOL worked;
-
-    if (self->is_sparse)
-        return true;
-
-    /*
-     * we don't use the GetFileInformationBy HandleEx as we don't want to 
-     * exclude Win XP yet.
-     */
-    worked = GetFileInformationByHandle (self->handle, &info);
-
-    self->is_sparse = 
-        ((info.dwFileAttributes & FILE_ATTRIBUTE_SPARSE_FILE)
-         == FILE_ATTRIBUTE_SPARSE_FILE);
-
-    return self->is_sparse;
-}
-
-/*
- * make a file sparse set_it == true
- * return is like Windows funcs with true being good
- *
- * we can't set if the Windows Volume doesn't allow it
- * but we'll let the function fail rather than try to get the value at 
- * CREATE (open) time because we'd be then checking at all file CREATE
- * whether we'd ever make it sparse or not
- */
-static
-bool set_sparse (KSysFile * self)
-{
-    FILE_SET_SPARSE_BUFFER b = { true };
-    DWORD ret;
-    BOOL worked;
-    bool rreett = false;
-
-    /* don't duplicate effort */
-    if (self->is_sparse)
-        rreett =  true;
-
-    else if (self->failed_set_sparse)
-        rreett = false;
-
-    else
-    {
-        worked = DeviceIoControl (self->handle, FSCTL_SET_SPARSE, &b, sizeof b,
-                              NULL, 0, &ret, NULL);
-/*         KOutMsg ("%s: %u\n",__func__,worked); */
-
-        /* not trusting bool is BOOL cause I don't trust Microsoft */
-        self->failed_set_sparse = (worked == 0);
-        self->is_sparse = !self->failed_set_sparse;
-        rreett =  self->is_sparse;
-    }
-/*     KOutMsg ("%s: %d\n",__func__,rreett); */
-    return rreett;
-}
-
-
-static bool set_not_sparse (KSysFile * self)
-{
-    FILE_SET_SPARSE_BUFFER b = { false };
-    DWORD ret;
-    BOOL worked;
-
-    /* don't duplicate effort */
-    if (!check_if_sparse (self))
-        return true;
-
-    if (self->failed_set_sparse)
-        return false;
-
-    worked = DeviceIoControl (self->handle, FSCTL_SET_SPARSE, &b, sizeof b,
-                              NULL, 0, &ret, NULL);
-
-    /* not trusting bool is BOOL cause I don't trust Microsoft */
-    self->failed_set_sparse = (worked == 0);
-    self->is_sparse = self->failed_set_sparse;
-    return ! self->is_sparse;
-}
-
-/*
- * this one works for non-sparse files too but what evs.
- */
-static rc_t set_zero_region (KSysFile * self, uint64_t start, uint64_t size)
-{
-    FILE_ZERO_DATA_INFORMATION b = { start, start + size };
-    DWORD ret;
-    BOOL worked;
-
-    worked = DeviceIoControl (self->handle, FSCTL_SET_ZERO_DATA,
-                            &b, sizeof b,
-                            NULL, 0,
-                            &ret, NULL);
-
-    /* TODO: check error codes with GetLastError and better rc values */
-    return (worked != 0) ? 0 : RC (rcFS, rcFile, rcWriting, rcBuffer, rcUnexpected);
-}
-
-
-/*
- * returns true if we can convert this file into a non-sparse file
- *
- * We went simple and fast.  We ask about zero regions.
- * if we specifically get back that there are none we say true
- * otherwise we say false.
- *
- * self can be modified so it can not be const
- */
-static bool can_be_made_not_sparse (KSysFile * self     )
-{
-#if 1
-    return false;
-#else
-    /* this is backwards - the list of os non-zero regions not zero regions */
-    LARGE_INTEGER fo;
-    LARGE_INTEGER l;
-    uint64_t size;
-    FILE_ALLOCATED_RANGE_BUFFER i;
-    FILE_ALLOCATED_RANGE_BUFFER o [16]; /* some none 0 number */
-    uint64_t count;
-    DWORD ret;
-    BOOL worked;
-    rc_t rc;
-
-    /* if is isn't sparse we can't make it not sparse */
-    /* first might be not yet set */
-    if (!check_if_sparse (self))
-        return true;
-
-    /* we can't scan for zero regions if we can't get a size */
-    rc = get_file_size (self, &size);
-    if (rc)
-        return false;
-
-    /* Microsoft APIs can be fairly odd */
-    fo.QuadPart = 0;
-    l.QuadPart = size;
-    i.FileOffset = fo;
-    i.Length = l;
-
-    worked = DeviceIoControl (self->handle, FSCTL_QUERY_ALLOCATED_RANGES,
-                              &i, sizeof i, o, sizeof o, & ret, NULL);
-    /* we can't change to non-sparse if we can't scan for zero regions */
-    if (worked == 0)
-        return false;
-
-    return (ret == 0);
-#endif
-}
-
-
-/* Destroy
- */
-static
-rc_t CC KSysFileDestroy ( KSysFile *self )
-{
-    rc_t rc = 0;
-
-    if ( CloseHandle (self -> handle ) == 0 )
-    {
-        DWORD last_error;
-
-        last_error = GetLastError();
-        switch ( last_error )
-        {
-        case ERROR_INVALID_HANDLE:
-            break;
-        default:
-            rc = RC (rcFS, rcFile, rcDestroying, rcNoObj, rcUnknown);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "error closing system file - $(E)$($(C))",
-                      "E=%!,C=%u", last_error, last_error)); 
-        }
-    }
-
-    free ( self );
-    return rc;
-}
-
-
-static
-rc_t CC KSysStdIOFileDestroy ( KSysFile *self )
-{
-    free ( self );
-    return 0;
-}
-
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-static
-KSysFile *CC KSysFileGetSysFile ( const KSysFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return ( KSysFile* ) self;
-}
-
-/* RandomAccess
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KSysDiskFileRandomAccess ( const KSysFile *self )
-{
-    return 0;
-}
-static
-rc_t CC KSysFileRandomAccess ( const KSysFile *self )
-{
-/*     return RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect ); */
-        return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KSysFileType ( const KSysFile *self )
-{
-    switch ( GetFileType ( self -> handle ) )
-    {
-    case FILE_TYPE_DISK:
-        return kfdFile;
-    case FILE_TYPE_CHAR:
-        return kfdCharDev;
-    case FILE_TYPE_PIPE:
-        return kfdSocket;
-    }
-
-    return kfdInvalid;
-}
-
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KSysDiskFileSize ( const KSysFile *self, uint64_t *size )
-{
-#if 1
-/*     KOutMsg ("%s:\n",__func__); */
-    return get_file_size (self, size);
-#else
-
-    LARGE_INTEGER sz;
-
-    if ( GetFileSizeEx ( self -> handle, & sz ) == 0 )
-    {
-        rc_t rc;
-        DWORD last_error;
-
-        last_error = GetLastError ();
-        switch ( last_error )
-        {
-        case ERROR_INVALID_HANDLE:
-            rc = RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-            break;
-        default:
-            rc = RC ( rcFS, rcFile, rcAccessing, rcNoObj, rcUnknown );
-            break;
-        }
-        PLOGERR (klogErr,
-                 (klogErr, rc, "error accessing file system status - $(E)($(C))",
-                  "E=%!,C=%u", last_error, last_error)); 
-        return rc;
-    }
-
-    *size = sz . QuadPart;
-    return 0;
-#endif
-}
-
-
-static
-rc_t CC KSysFileSize ( const KSysFile *self, uint64_t *size )
-{
-    *size = 0;
-/*     return RC ( rcFS, rcFile, rcAccessing, rcFileDesc, rcIncorrect ); */
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KSysDiskFileSetSize ( KSysFile *self, uint64_t size )
-{
-    rc_t rc = 1;
-    LARGE_INTEGER p;
-    uint64_t prev_size;
-
-/*     KOutMsg ("%s:\n",__func__); */
-    /* get previous size for setting or clearing sparse */
-    rc = get_file_size ( self, &prev_size);
-    if (rc)
-        return rc;
-/*     KOutMsg ("%s: %lu\n",__func__, prev_size); */
-
-    p . QuadPart = size;
-
-    if ( SetFilePointerEx ( self -> handle, p, & p, FILE_BEGIN ) )
-    {
-        self -> pos = size;
-        if ( SetEndOfFile( self -> handle ) )
-        {
-            rc = 0;
-        }
-    }
-
-    /* failure to set size*/
-    if ( rc != 0 )
-    {
-        DWORD last_error;
-
-        last_error = GetLastError ();
-        switch ( last_error  )
-        {
-        case ERROR_INVALID_HANDLE:
-            rc = RC ( rcFS, rcFile, rcUpdating, rcFileDesc, rcInvalid );
-        default:
-            rc = RC ( rcFS, rcFile, rcUpdating, rcNoObj, rcUnknown );
-        }
-        PLOGERR ( klogErr,
-                 ( klogErr, rc, "error setting filesize - $(E) - $(C) to $(D)",
-                   "E=%!,C=%u,D=%lu", last_error, last_error, size ) ); 
-    }
-
-    /* check for wanting to be sparse file */
-    if (size > prev_size)
-    {
-        uint64_t diff;
-
-/*         KOutMsg ("%s: size(%lu) larger than prev_size(%lu)\n",__func__, size, prev_size); */
-
-        diff = size - prev_size;
-
-        /* if block size if big enough we'll try to make it a sparse block */
-        if (diff >= MIN_SPARSE_BLOCK_DIFF)
-        {
-/*             KOutMsg ("%s: diff(%lu) larger than block constant(%lu)\n",__func__, diff, MIN_SPARSE_BLOCK_DIFF); */
-            /* set sparse? */
-            if (!check_if_sparse(self)) /* isn't sparse now */
-            {
-                if (diff >= MIN_SET_SPARSE_DIFF)
-                {
-/*                     KOutMsg ("%s: diff(%lu) larger than sparse constant(%lu)\n",__func__, diff, MIN_SET_SPARSE_DIFF); */
-                    (void)set_sparse (self);
-                }
-            }
-            /* ordered to try to set before looking to set the zero region */
-            if (self->is_sparse)
-            {
-                /* set sparse region at end */
-                set_zero_region (self, prev_size, diff);
-            }
-        }
-    }
-    else if (can_be_made_not_sparse (self))
-        (void)set_not_sparse (self);
-
-    return rc;
-}
-
-
-static
-rc_t CC KSysFileSetSize ( KSysFile *self, uint64_t size )
-{
-/*     return RC ( rcFS, rcFile, rcUpdating, rcFileDesc, rcIncorrect ); */
-        return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t KSysFileReadCommon ( const KSysFile *cself,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    DWORD to_read, bytes_read;
-    KSysFile *self = ( KSysFile* ) cself;
-
-    to_read = ( DWORD ) bsize;
-    if ( sizeof bsize > sizeof to_read && ( size_t ) to_read != bsize )
-        to_read = ~ 0U;
-
-    for (;;)
-    {
-        bytes_read = 0;
-        if ( ReadFile ( self -> handle, buffer, to_read, & bytes_read, NULL ) == 0 )
-        {
-            rc_t rc;
-            DWORD last_error;
-
-            switch ( last_error = GetLastError () )
-            {
-            case ERROR_HANDLE_EOF:
-                break;
-            case ERROR_IO_PENDING:
-                continue; 
-           }
-        }
-        
-        self -> pos += bytes_read;
-        * num_read = bytes_read;
-        break;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC KSysDiskFileRead ( const KSysFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    DWORD to_read, bytes_read;
-    KSysFile *self = ( KSysFile* ) cself;
-
-    if ( self -> pos != pos )
-    {
-        LARGE_INTEGER p;
-
-        if ( !GetFileSizeEx( self -> handle, &p ) )
-        {
-            rc_t rc;
-            DWORD last_error;
-
-            last_error = GetLastError ();
-            switch ( last_error )
-            {
-            case ERROR_INVALID_HANDLE:
-                rc = RC ( rcFS, rcFile, rcPositioning, rcFileDesc, rcInvalid );
-                break;
-            default:
-                rc = RC ( rcFS, rcFile, rcPositioning, rcNoObj, rcUnknown );
-                break;
-            }
-            PLOGERR ( klogErr,
-                     ( klogErr, rc, "error positioning system file - $(E)($(C)) to $(D)",
-                       "E=%!,C=%u,D=%u", last_error, last_error, pos ) ); 
-            return rc;
-        }
-
-        /* if we try to read beyond the end of the file... */
-        if ( pos >= p . QuadPart )
-        {   /* We've defined reading beyond EOF as return RC of 0 but bytes read as 0 */
-            /*return RC ( rcFS, rcFile, rcPositioning, rcFileDesc, rcInvalid );*/
-            return 0;
-        }
-
-        p . QuadPart = pos;
-        if ( !SetFilePointerEx ( self -> handle, p, & p, FILE_BEGIN ) )
-        {
-            rc_t rc;
-            DWORD last_error;
-
-            last_error = GetLastError ();
-            switch ( last_error )
-            {
-            case ERROR_INVALID_HANDLE:
-                rc = RC ( rcFS, rcFile, rcPositioning, rcFileDesc, rcInvalid );
-                PLOGERR (klogErr,
-                         (klogErr, rc, "invalid system file handle - $(E)($(C))",
-                          "E=%!,C=%u", last_error, last_error)); 
-                return rc;
-            default:
-                rc = RC ( rcFS, rcFile, rcPositioning, rcNoObj, rcUnknown );
-                PLOGERR ( klogErr,
-                          ( klogErr, rc, "error positioning system file - $(E)($(C)) to $(D)",
-                            "E=%!,C=%u,D=%lu", last_error, last_error, pos ) ); 
-                return rc;
-            }
-        }
-
-        self -> pos = p . QuadPart;
-        if ( pos != p . QuadPart )
-        {
-            if ( pos > (uint64_t)( p . QuadPart ) )
-            {
-                * num_read = 0;
-                return 0;
-            }
-
-            return RC ( rcFS, rcFile, rcPositioning, rcNoObj, rcUnknown );
-        }
-    }
-
-    return KSysFileReadCommon ( cself, buffer, bsize, num_read );
-}
-
-static
-rc_t CC KSysFileRead ( const KSysFile *cself, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    DWORD to_read, bytes_read;
-    KSysFile *self = ( KSysFile* ) cself;
-
-    if ( self -> pos != pos )
-    {
-        *num_read = 0;
-        return RC ( rcFS, rcFile, rcPositioning, rcFileDesc, rcIncorrect );
-    }
-
-    return KSysFileReadCommon ( cself, buffer, bsize, num_read );
-}
-
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-
-#define WINDOWS_HEAP_LIMIT (32*1024)
-
-static
-rc_t KSysFileWriteCommon ( KSysFile *self, 
-    const void *_buffer, size_t size, size_t *num_writ)
-{
-    DWORD to_write;
-    DWORD bytes_writ;
-    DWORD iter_writ;
-    const char * buffer = _buffer;
-
-    to_write = (DWORD) size;
-
-    if (sizeof size > sizeof to_write && ( size_t ) to_write != size )
-        to_write = ~ 0U;
-
-    for ( bytes_writ = 0; to_write > 0; )
-    {
-        DWORD iter_to_write = 
-            (to_write > WINDOWS_HEAP_LIMIT)? WINDOWS_HEAP_LIMIT : to_write;
-
-        
-        for (iter_writ = 0;
-             ! WriteFile ( self -> handle, buffer, iter_to_write, &iter_writ, NULL);
-             iter_writ = 0)
-        {
-            rc_t rc;
-            DWORD last_error;
-            const char * fmt;
-
-            last_error = GetLastError ();
-            switch ( last_error )
-            {
-            case ERROR_IO_PENDING:
-                Sleep (100); /* sure let's give it a chance to settle */
-                if (iter_writ)
-                {
-                    buffer += iter_writ;
-                    iter_to_write -= iter_writ;
-                    to_write -= iter_writ;
-                    bytes_writ += iter_writ;
-                }
-                continue; /* back to while() */
- 
-            case ERROR_INVALID_HANDLE:
-                rc = RC ( rcFS, rcFile, rcWriting, rcFileDesc, rcInvalid );
-                fmt = "invalid system file handle - $(E)($(C))";
-                break;
-
-            case ERROR_NOT_ENOUGH_MEMORY:
-                rc = RC (rcFS, rcFile, rcWriting, rcMemory, rcExhausted);
-                fmt = "error out of memory for WindowsWriteFile - $(E)($(C))";
-                break;
-
-            default:
-                rc = RC ( rcFS, rcFile, rcWriting, rcNoObj, rcUnknown );
-                fmt = "error writing system file - $(E)($(C))";
-                break;
-            }
-
-            PLOGERR (klogErr,
-                     (klogErr, rc, fmt, "E=%!,C=%u", last_error, last_error)); 
-            return rc;
-        }
-        buffer += iter_writ;
-        to_write -= iter_writ;
-        bytes_writ += iter_writ;
-    }
-
-    self -> pos += bytes_writ;
-
-    if (num_writ != NULL)
-        * num_writ = (size_t)bytes_writ;
-
-    return 0;
-}
-static
-rc_t CC KSysDiskFileWrite ( KSysFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    rc_t rc;
-    if ( self -> pos != pos )
-    {
-        LARGE_INTEGER p;
-        uint64_t curr_size;
-
-        rc = get_file_size ( self, &curr_size );
-        if ( rc != 0 )
-            return rc;
-
-        if ( curr_size < pos )
-        {
-            rc = KSysDiskFileSetSize (self, pos);
-            if (rc)
-                return rc;
-        }
-
-
-        p . QuadPart = pos;
-
-        if ( SetFilePointerEx ( self -> handle, p, & p, FILE_BEGIN ) == 0 )
-        {
-            DWORD last_error;
-
-            last_error = GetLastError ();
-            switch ( last_error )
-            {
-            case ERROR_INVALID_HANDLE:
-                rc = RC ( rcFS, rcFile, rcWriting, rcFileDesc, rcInvalid );
-                PLOGERR (klogErr,
-                         (klogErr, rc, "invalid system file handle - $(E)($(C))",
-                          "E=%!,C=%u", last_error, last_error)); 
-                break;
-            default:
-                rc = RC ( rcFS, rcFile, rcWriting, rcNoObj, rcUnknown );
-                PLOGERR (klogErr,
-                         (klogErr, rc, "error writing system file - $(E)($(C))",
-                          "E=%!,C=%u", last_error, last_error)); 
-                break;
-            }
-            return rc;
-        }
-
-        self -> pos = p . QuadPart;
-        if ( pos != p . QuadPart )
-        {
-            return RC ( rcFS, rcFile, rcPositioning, rcNoObj, rcUnknown );
-        }
-    }
-
-    return KSysFileWriteCommon ( self, buffer, size, num_writ );
-}
-static
-rc_t CC KSysFileWrite ( KSysFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    if ( self -> pos != pos )
-    {
-        *num_writ = 0;
-        return RC ( rcFS, rcFile, rcPositioning, rcFileDesc, rcIncorrect );
-    }
-
-    return KSysFileWriteCommon ( self, buffer, size, num_writ );
-}
-
-
-/* Make
- *  create a new file object
- *  from file descriptor
- */
-static const KFile_vt_v1 vtKSysDiskFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KSysFileDestroy,
-    KSysFileGetSysFile,
-    KSysDiskFileRandomAccess,
-    KSysDiskFileSize,
-    KSysDiskFileSetSize,
-    KSysDiskFileRead,
-    KSysDiskFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-static const KFile_vt_v1 vtKSysOtherFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KSysFileDestroy,
-    KSysFileGetSysFile,
-    KSysFileRandomAccess,
-    KSysFileSize,
-    KSysFileSetSize,
-    KSysFileRead,
-    KSysFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-static const KFile_vt_v1 vtKSysStdIODiskFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KSysStdIOFileDestroy,
-    KSysFileGetSysFile,
-    KSysDiskFileRandomAccess,
-    KSysDiskFileSize,
-    KSysDiskFileSetSize,
-    KSysDiskFileRead,
-    KSysDiskFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-static const KFile_vt_v1 vtKSysStdIOOtherFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KSysStdIOFileDestroy,
-    KSysFileGetSysFile,
-    KSysFileRandomAccess,
-    KSysFileSize,
-    KSysFileSetSize,
-    KSysFileRead,
-    KSysFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KSysFileType
-    /* end minor version == 1 */
-};
-
-
-static
-rc_t KSysFileMakeVT ( KSysFile **fp, HANDLE fd, const KFile_vt *vt, const char *path,
-    uint64_t initial_pos, bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-    KSysFile *f;
-
-    if( fd == INVALID_HANDLE_VALUE ) /* ? */
-        return RC ( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-
-    f = malloc ( sizeof *f );
-    if ( f == NULL )
-        rc = RC(rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        rc = KFileInit ( & f -> dad, vt, "KSysFile", path, read_enabled, write_enabled );
-        if ( rc == 0 )
-        {
-            f -> handle = fd;
-            f -> pos = initial_pos;
-            f -> failed_set_sparse = f->is_sparse = false;
-            check_if_sparse (f);
-            *fp = f;
-            return 0;
-        }
-
-        free ( f );
-    }
-    return rc;
-}
-
-/* bit flags */
-#define ISDISK  1
-#define ISSTDIO 2
-
-static
-rc_t KSysFileMakeInt ( KSysFile **fp, HANDLE fd, const char *path, bool read_enabled, bool write_enabled, unsigned flags )
-{
-    DWORD ret;
-    const KFile_vt * vt;
-    uint64_t initial_pos;
-
-    if (fp == NULL)
-        return RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-
-    *fp = NULL; /* pre-fail */
-
-    ret = GetFileType (fd);
-
-    switch (ret)
-    {
-    case FILE_TYPE_DISK:
-        flags |= ISDISK;
-        initial_pos = -1;
-        break;
-
-    case FILE_TYPE_UNKNOWN:
-        ret = GetLastError();
-        switch (ret)
-        {
-        default:
-            return RC (rcFS, rcFile, rcConstructing, rcFileDesc, rcUnknown);
-
-            /* specific errors can be added here */
-
-        case NO_ERROR:
-            break;
-        }
-
-        initial_pos = 0;
-        flags &= ~ISDISK;
-        break;
-
-    default:
-        initial_pos = 0;
-        flags &= ~ISDISK;
-        break;
-    }
-
-    switch (flags & (ISDISK|ISSTDIO))
-    {
-    case 0:
-        vt = (const KFile_vt*)&vtKSysOtherFile;
-        break;
-
-    case ISDISK:
-        vt = (const KFile_vt*)&vtKSysDiskFile;
-        break;
-
-    case ISSTDIO:
-        vt = (const KFile_vt*)&vtKSysStdIOOtherFile;
-        break;
-
-    case ISDISK|ISSTDIO:
-        vt = (const KFile_vt*)&vtKSysStdIODiskFile;
-        break;
-    }
-
-    return KSysFileMakeVT ( fp, fd, vt, path, initial_pos, read_enabled, write_enabled );
-}
-
-/* extern, but internal to libkfs */
-rc_t KSysFileMake ( KSysFile **fp, HANDLE fd, const char *path, bool read_enabled, bool write_enabled )
-{
-    return KSysFileMakeInt ( fp, fd, path, read_enabled, write_enabled, 0 );
-}
-
-
-/* MakeStdIn
- *  creates a read-only file on stdin
- */
-LIB_EXPORT rc_t CC KFileMakeStdIn ( const KFile **fp )
-{
-    HANDLE fd = GetStdHandle ( STD_INPUT_HANDLE );
-    return KSysFileMakeInt ( (KSysFile**)fp, fd, "stdin", true, false, ISSTDIO );
-}
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only file on stdout or stderr
- */
-LIB_EXPORT rc_t CC KFileMakeStdOut ( KFile **fp )
-{
-    HANDLE fd = GetStdHandle ( STD_OUTPUT_HANDLE );
-    return KSysFileMakeInt ( (KSysFile**)fp, fd, "stdout", false, true, ISSTDIO );
-}
-
-LIB_EXPORT rc_t CC KFileMakeStdErr ( KFile **fp )
-{
-    HANDLE fd = GetStdHandle ( STD_ERROR_HANDLE );
-    return KSysFileMakeInt ( (KSysFile**)fp, fd, "stderr", false, true, ISSTDIO );
-}
-
-/* MakeFDFile
- *  creates a file from a file-descriptor
- *  not supported under Windows
- */
-LIB_EXPORT rc_t CC KFileMakeFDFileRead ( const KFile **f, int fd )
-{
-    return RC (rcFS, rcFile, rcConstructing, rcFunction, rcUnsupported);
-}
-
-LIB_EXPORT rc_t CC KFileMakeFDFileWrite ( KFile **f, bool update, int fd )
-{
-    return RC (rcFS, rcFile, rcConstructing, rcFunction, rcUnsupported);
-}
diff --git a/libs/kfs/win/syslockfile.c b/libs/kfs/win/syslockfile.c
deleted file mode 100644
index 9b09f8d..0000000
--- a/libs/kfs/win/syslockfile.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include <kfs/lockfile.h>
-#include <kfs/directory.h>
-#include <klib/rc.h>
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- *  interface extensions
- */
-
-
-/* CreateExclusiveAccessFile
- *  opens a file with exclusive write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC KDirectoryVCreateExclusiveAccessFile ( KDirectory *self, struct KFile **f,
-    bool update, uint32_t access, KCreateMode mode, const char *path, va_list args )
-{
-    /* Windows should naturally behave as we want here... */
-    rc_t rc = KDirectoryVCreateFile ( self, f, update, access, mode, path, args );
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) == rcExists )
-            rc = RC ( rcFS, rcFile, rcLocking, rcLocking, rcBusy );
-        else
-            rc = ResetRCContext ( rc, rcFS, rcFile, rcLocking );
-    }
-    return rc;
-}
diff --git a/libs/kfs/win/sysmmap-priv.h b/libs/kfs/win/sysmmap-priv.h
deleted file mode 100644
index 71dbdf9..0000000
--- a/libs/kfs/win/sysmmap-priv.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sysmmap_priv_
-#define _h_sysmmap_priv_
-
-#ifndef _h_mmap_priv_
-#include "../mmap-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-struct KMMap
-{
-    uint64_t off;
-    uint64_t pos;
-    size_t size;
-    char *addr;
-
-    struct KFile *f;
-    size_t pg_size;
-
-    /* file mapping handle */
-    HANDLE handle;
-
-    uint32_t addr_adj;
-    uint32_t size_adj;
-
-    KRefcount refcount;
-
-    bool read_only;
-    bool sys_mmap;
-    bool dirty;
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_sysmmap_priv_ */
diff --git a/libs/kfs/win/sysmmap.c b/libs/kfs/win/sysmmap.c
deleted file mode 100644
index 28c9873..0000000
--- a/libs/kfs/win/sysmmap.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-#include "sysmmap-priv.h"
-#include "sysfile-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <WINDOWS.H>
-
-
-/*--------------------------------------------------------------------------
- * KMMap
- *  a memory mapped region
- */
-
-/* Make
- */
-rc_t KMMapMake ( KMMap **mmp )
-{
-    SYSTEM_INFO sinfo;
-
-    KMMap *mm = calloc ( 1, sizeof * mm );
-    if ( mm == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcMemory, rcExhausted );
-
-    GetSystemInfo ( & sinfo );
-    mm -> pg_size = sinfo . dwAllocationGranularity;
-
-    * mmp = mm;
-
-    return 0;
-}
-
-
-/* RWSys
- */
-rc_t KMMapRWSys ( KMMap *self, uint64_t pos, size_t size )
-{
-    DWORD status;
-
-    KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-    if ( sf == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-
-    self -> handle = CreateFileMapping ( sf -> handle, NULL, PAGE_READWRITE, 0, 0, NULL );
-    if ( self -> handle != NULL )
-    {
-        self -> addr = MapViewOfFile ( self -> handle, FILE_MAP_ALL_ACCESS, 
-            ( DWORD ) ( pos >> 32 ), ( DWORD ) pos, size );
-        if ( self -> addr != NULL )
-            return 0;
-    }
-
-    switch ( status = GetLastError () )
-    {
-    /* NEED ERROR CODES - THANKS, REDMOND!! */
-    default:
-        break;
-    }
-
-    return RC ( rcFS, rcMemMap, rcConstructing, rcNoObj, rcUnknown );
-}
-
-
-/* ROSys
- */
-rc_t KMMapROSys ( KMMap *self, uint64_t pos, size_t size )
-{
-    DWORD status;
-
-    KSysFile *sf = KFileGetSysFile ( self -> f, & self -> off );
-    if ( sf == NULL )
-        return RC ( rcFS, rcMemMap, rcConstructing, rcFile, rcIncorrect );
-
-    self -> handle = CreateFileMapping ( sf -> handle, NULL, PAGE_READONLY, 0, 0, NULL );
-    if ( self -> handle != NULL )
-    {
-        self -> addr = MapViewOfFile ( self -> handle, FILE_MAP_READ, 
-            ( DWORD ) ( pos >> 32 ), ( DWORD ) pos, size );
-        if ( self -> addr != NULL )
-            return 0;
-    }
-
-    switch ( status = GetLastError () )
-    {
-    /* NEED ERROR CODES - THANKS, REDMOND!! */
-    default:
-        break;
-    }
-
-    return RC ( rcFS, rcMemMap, rcConstructing, rcNoObj, rcUnknown );
-}
-
-
-/* Unmap
- *  removes a memory map
- */
-rc_t KMMapUnmap ( KMMap *self )
-{
-    if ( self -> handle != NULL )
-    {
-        if ( ! CloseHandle ( self -> handle ) )
-            return RC ( rcFS, rcMemMap, rcDestroying, rcNoObj, rcUnknown );
-        if ( ! UnmapViewOfFile( self -> addr ) )
-            return RC ( rcFS, rcMemMap, rcDestroying, rcNoObj, rcUnknown );
-
-        self -> addr = NULL;
-        self -> size = 0;
-        self -> handle = NULL;
-    }
-
-    return 0;
-}
diff --git a/libs/klib/Judy.h b/libs/klib/Judy.h
deleted file mode 100644
index 0b2c518..0000000
--- a/libs/klib/Judy.h
+++ /dev/null
@@ -1,629 +0,0 @@
-#ifndef _JUDY_INCLUDED
-#define _JUDY_INCLUDED
-/*
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-//
-// HEADER FILE FOR EXPORTED FEATURES IN JUDY LIBRARY, libJudy.*
-//
-// See the manual entries for details.
-//
-// Note:  This header file uses old-style comments on #-directive lines and
-// avoids "()" on macro names in comments for compatibility with older cc -Aa
-// and some tools on some platforms.
-
-
-// PLATFORM-SPECIFIC
-*/
-
-#if ! JUST_DEFINE_YOUR_STUFF
-
-#ifdef JU_WIN /* =============================================== */
-
-typedef __int8           int8_t;
-typedef __int16          int16_t;
-typedef __int32          int32_t;
-typedef __int64          int64_t;
-
-typedef unsigned __int8  uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-
-#else /* ================ ! JU_WIN ============================= */
-
-/* ISO C99: 7.8 Format conversion of integer types <inttypes.h> */
-/*#include <inttypes.h>   if this FAILS, try #include <stdint.h> */ 
-
-/* ISO C99: 7.18 Integer types uint*_t */
-#include <stdint.h> 
-
-#endif /* ================ ! JU_WIN ============================= */
-
-/* ISO C99 Standard: 7.20 General utilities */
-#include <stdlib.h>  
-
-/* ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */
-#include <limits.h>
-
-#endif /* JUST_DEFINE_YOUR_STUFF */
-
-#ifdef __cplusplus      /* support use by C++ code */
-extern "C" {
-#endif
-
-
-/* ****************************************************************************
-// DECLARE SOME BASE TYPES IN CASE THEY ARE MISSING:
-//
-// These base types include "const" where appropriate, but only where of
-// interest to the caller.  For example, a caller cares that a variable passed
-// by reference will not be modified, such as, "const void * Pindex", but not
-// that the called function internally does not modify the pointer itself, such
-// as, "void * const Pindex".
-//
-// Note that its OK to pass a Pvoid_t to a Pcvoid_t; the latter is the same,
-// only constant.  Callers need to do this so they can also pass & Pvoid_t to
-// PPvoid_t (non-constant).
-*/
-
-#ifndef _PCVOID_T
-#define _PCVOID_T
-typedef const void * Pcvoid_t;
-#endif
-
-#ifndef _PVOID_T
-#define _PVOID_T
-typedef void *   Pvoid_t;
-typedef void ** PPvoid_t;
-#endif
-
-#ifndef _WORD_T
-#define _WORD_T
-    typedef  size_t  Word_t, * PWord_t;  /* expect 32-bit or 64-bit words. */
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-
-/* ****************************************************************************
-// SUPPORT FOR ERROR HANDLING:
-//
-// Judy error numbers:
-//
-// Note:  These are an enum so theres a related typedef, but the numbers are
-// spelled out so you can map a number back to its name.
-*/
-typedef enum            /* uint8_t -- but C does not support this type of enum.
-                                   -- nor does it support // comments!!         */
-{
-
-/* Note:  JU_ERRNO_NONE and JU_ERRNO_FULL are not real errors.  They specify
-// conditions which are otherwise impossible return values from 32-bit
-// Judy1Count, which has 2^32 + 1 valid returns (0..2^32) plus one error
-// return.  These pseudo-errors support the return values that cannot otherwise
-// be unambiguously represented in a 32-bit word, and will never occur on a
-// 64-bit system. */
-
-        JU_ERRNO_NONE           = 0,
-        JU_ERRNO_FULL           = 1,
-        JU_ERRNO_NFMAX          = JU_ERRNO_FULL,
-
-/* JU_ERRNO_NOMEM comes from malloc(3C) when Judy cannot obtain needed memory.
-// The system errno value is also set to ENOMEM.  This error can be recoverable
-// if the calling application frees other memory.
-//
-// TBD:  Currently there is no guarantee the Judy array has no memory leaks
-// upon JU_ERRNO_NOMEM. */
-
-        JU_ERRNO_NOMEM          = 2,
-
-/* Problems with parameters from the calling program:
-//
-// JU_ERRNO_NULLPPARRAY means PPArray was null; perhaps PArray was passed where
-// &PArray was intended.  Similarly, JU_ERRNO_NULLPINDEX means PIndex was null;
-// perhaps &Index was intended.  Also, JU_ERRNO_NONNULLPARRAY,
-// JU_ERRNO_NULLPVALUE, and JU_ERRNO_UNSORTED, all added later (hence with
-// higher numbers), mean:  A non-null array was passed in where a null pointer
-// was required; PValue was null; and unsorted indexes were detected. */
-
-        JU_ERRNO_NULLPPARRAY    = 3,    /* see above.                       */
-        JU_ERRNO_NONNULLPARRAY  = 10,   /* see above.                       */
-        JU_ERRNO_NULLPINDEX     = 4,    /* see above.                       */
-        JU_ERRNO_NULLPVALUE     = 11,   /* see above.                       */
-        JU_ERRNO_NOTJUDY1       = 5,    /* PArray is not to a Judy1 array.  */
-        JU_ERRNO_NOTJUDYL       = 6,    /* PArray is not to a JudyL array.  */
-        JU_ERRNO_NOTJUDYSL      = 7,    /* PArray is not to a JudySL array. */
-        JU_ERRNO_UNSORTED       = 12,   /* see above.                       */
-
-/* Errors below this point are not recoverable; further tries to access the
-// Judy array might result in EFAULT and a core dump:
-//
-// JU_ERRNO_OVERRUN occurs when Judy detects, upon reallocation, that a block
-// of memory in its own freelist was modified since being freed. */
-
-        JU_ERRNO_OVERRUN        = 8,
-
-/* JU_ERRNO_CORRUPT occurs when Judy detects an impossible value in a Judy data
-// structure:
-//
-// Note:  The Judy data structure contains some redundant elements that support
-// this type of checking. */
-
-        JU_ERRNO_CORRUPT        = 9
-
-/* Warning:  At least some C or C++ compilers do not tolerate a trailing comma
-// above here.  At least we know of one case, in aCC; see JAGad58928. */
-
-} JU_Errno_t;
-
-
-/* Judy errno structure:
-//
-// WARNING:  For compatibility with possible future changes, the fields of this
-// struct should not be referenced directly.  Instead use the macros supplied
-// below.
-
-// This structure should be declared on the stack in a threaded process. */
-
-typedef struct J_UDY_ERROR_STRUCT
-{
-    JU_Errno_t je_Errno;            /* one of the enums above.               */
-    int        je_ErrID;            /* often an internal source line number. */
-    Word_t     je_reserved[4];      /* for future backward compatibility.    */
-
-} JError_t, * PJError_t;
-
-
-/* Related macros:
-//
-// Fields from error struct: */
-
-#define JU_ERRNO(PJError)  ((PJError)->je_Errno)
-#define JU_ERRID(PJError)  ((PJError)->je_ErrID)
-
-/* For checking return values from various Judy functions:
-//
-// Note:  Define JERR as -1, not as the seemingly more portable (Word_t)
-// (~0UL), to avoid a compiler "overflow in implicit constant conversion"
-// warning. */
-
-#define   JERR (-1)                     /* functions returning int or Word_t */
-#define  PJERR ((Pvoid_t)  (~0UL))      /* mainly for use here, see below    */
-#define PPJERR ((PPvoid_t) (~0UL))      /* functions that return PPvoid_t    */
-
-/* Convenience macro for when detailed error information (PJError_t) is not
-// desired by the caller; a purposely short name: */
-
-#define PJE0  ((PJError_t) NULL)
-
-
-/* ****************************************************************************
-// JUDY FUNCTIONS:
-//
-// P_JE is a shorthand for use below:
-*/
-#define P_JE  PJError_t PJError
-
-/* ****************************************************************************
-// JUDY1 FUNCTIONS:
-*/
-extern int      Judy1Test(       Pcvoid_t  PArray, Word_t   Index,   P_JE);
-extern int      Judy1Set(        PPvoid_t PPArray, Word_t   Index,   P_JE);
-extern int      Judy1SetArray(   PPvoid_t PPArray, Word_t   Count,
-                                             const Word_t * const PIndex,
-                                                                     P_JE);
-extern int      Judy1Unset(      PPvoid_t PPArray, Word_t   Index,   P_JE);
-extern Word_t   Judy1Count(      Pcvoid_t  PArray, Word_t   Index1,
-                                                   Word_t   Index2,  P_JE);
-extern int      Judy1ByCount(    Pcvoid_t  PArray, Word_t   Count,
-                                                   Word_t * PIndex,  P_JE);
-extern Word_t   Judy1FreeArray(  PPvoid_t PPArray,                   P_JE);
-extern Word_t   Judy1MemUsed(    Pcvoid_t  PArray);
-extern Word_t   Judy1MemActive(  Pcvoid_t  PArray);
-extern int      Judy1First(      Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1Next(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1Last(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1Prev(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1FirstEmpty( Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1NextEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1LastEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      Judy1PrevEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-
-/* ****************************************************************************
-// JUDYL FUNCTIONS:
-*/
-extern PPvoid_t JudyLGet(        Pcvoid_t  PArray, Word_t    Index,  P_JE);
-extern PPvoid_t JudyLIns(        PPvoid_t PPArray, Word_t    Index,  P_JE);
-extern int      JudyLInsArray(   PPvoid_t PPArray, Word_t    Count,
-                                             const Word_t * const PIndex,
-                                             const Word_t * const PValue,
-                                                                     P_JE);
-
-extern int      JudyLDel(        PPvoid_t PPArray, Word_t    Index,  P_JE);
-extern Word_t   JudyLCount(      Pcvoid_t  PArray, Word_t    Index1,
-                                                   Word_t    Index2, P_JE);
-extern PPvoid_t JudyLByCount(    Pcvoid_t  PArray, Word_t    Count,
-                                                   Word_t *  PIndex, P_JE);
-extern Word_t   JudyLFreeArray(  PPvoid_t PPArray,                   P_JE);
-extern Word_t   JudyLMemUsed(    Pcvoid_t  PArray);
-extern Word_t   JudyLMemActive(  Pcvoid_t  PArray);
-extern PPvoid_t JudyLFirst(      Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern PPvoid_t JudyLNext(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern PPvoid_t JudyLLast(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern PPvoid_t JudyLPrev(       Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      JudyLFirstEmpty( Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      JudyLNextEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      JudyLLastEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-extern int      JudyLPrevEmpty(  Pcvoid_t  PArray, Word_t * PIndex,  P_JE);
-
-/* ****************************************************************************
-// JUDYSL FUNCTIONS:
-*/
-extern PPvoid_t JudySLGet(       Pcvoid_t, const uint8_t * Index, P_JE);
-extern PPvoid_t JudySLIns(       PPvoid_t, const uint8_t * Index, P_JE);
-extern int      JudySLDel(       PPvoid_t, const uint8_t * Index, P_JE);
-extern Word_t   JudySLFreeArray( PPvoid_t,                        P_JE);
-extern PPvoid_t JudySLFirst(     Pcvoid_t,       uint8_t * Index, P_JE);
-extern PPvoid_t JudySLNext(      Pcvoid_t,       uint8_t * Index, P_JE);
-extern PPvoid_t JudySLLast(      Pcvoid_t,       uint8_t * Index, P_JE);
-extern PPvoid_t JudySLPrev(      Pcvoid_t,       uint8_t * Index, P_JE);
-
-/* ****************************************************************************
-// JUDYHSL FUNCTIONS:
-*/
-extern PPvoid_t JudyHSGet(       Pcvoid_t,  void *, Word_t);
-extern PPvoid_t JudyHSIns(       PPvoid_t,  void *, Word_t, P_JE);
-extern int      JudyHSDel(       PPvoid_t,  void *, Word_t, P_JE);
-extern Word_t   JudyHSFreeArray( PPvoid_t,                  P_JE);
-
-extern const char *Judy1MallocSizes;
-extern const char *JudyLMallocSizes;
-
-/* ****************************************************************************
-// JUDY memory interface to malloc() FUNCTIONS:
-*/
-extern Word_t JudyMalloc(Word_t);               /* words reqd => words allocd. */
-extern Word_t JudyMallocVirtual(Word_t);        /* words reqd => words allocd. */
-extern void   JudyFree(Pvoid_t, Word_t);        /* free, size in words.        */
-extern void   JudyFreeVirtual(Pvoid_t, Word_t); /* free, size in words.        */
-
-#define JLAP_INVALID    0x1     /* flag to mark pointer "not a Judy array" */
-
-/* ****************************************************************************
-// MACRO EQUIVALENTS FOR JUDY FUNCTIONS:
-//
-// The following macros, such as J1T, are shorthands for calling Judy functions
-// with parameter address-of and detailed error checking included.  Since they
-// are macros, the error checking code is replicated each time the macro is
-// used, but it runs fast in the normal case of no error.
-//
-// If the caller does not like the way the default JUDYERROR macro handles
-// errors (such as an exit(1) call when out of memory), they may define their
-// own before the "#include <Judy.h>".  A routine such as HandleJudyError
-// could do checking on specific error numbers and print a different message
-// dependent on the error.  The following is one example:
-//
-// Note: the back-slashes are removed because some compilers will not accept
-// them in comments.
-//
-// void HandleJudyError(uint8_t *, int, uint8_t *, int, int);
-// #define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID)
-// {
-//    HandleJudyError(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID);
-// }
-//
-// The routine HandleJudyError could do checking on specific error numbers and
-// print a different message dependent on the error.
-//
-// The macro receives five parameters that are:
-//
-// 1.  CallerFile:  Source filename where a Judy call returned a serious error.
-// 2.  CallerLine:  Line number in that source file.
-// 3.  JudyFunc:    Name of Judy function reporting the error.
-// 4.  JudyErrno:   One of the JU_ERRNO* values enumerated above.
-// 5.  JudyErrID:   The je_ErrID field described above.
-*/
-#ifndef JUDYERROR_NOTEST
-#ifndef JUDYERROR       /* supply a default error macro */
-#include <stdio.h>
-
-#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \
-    {                                                                     \
-        (void) fprintf(stderr, "File '%s', line %d: %s(), "               \
-           "JU_ERRNO_* == %d, ID == %d\n",                                \
-           CallerFile, CallerLine,                                        \
-           JudyFunc, JudyErrno, JudyErrID);                               \
-        exit(1);                                                          \
-    }
-
-#endif /* JUDYERROR */
-#endif /* JUDYERROR_NOTEST */
-
-/* If the JUDYERROR macro is not desired at all, then the following eliminates
-// it.  However, the return code from each Judy function (that is, the first
-// parameter of each macro) must be checked by the caller to assure that an
-// error did not occur.
-//
-// Example:
-//
-//   #define JUDYERROR_NOTEST 1
-//   #include <Judy.h>
-//
-// or use this cc option at compile time:
-//
-//   cc -DJUDYERROR_NOTEST ...
-//
-// Example code:
-//
-//   J1S(Rc, PArray, Index);
-//   if (Rc == JERR) goto ...error
-//
-// or:
-//
-//   JLI(PValue, PArray, Index);
-//   if (PValue == PJERR) goto ...error
-
-
-// Internal shorthand macros for writing the J1S, etc. macros:
-*/
-#ifdef JUDYERROR_NOTEST /* ============================================ */
-
-/* "Judy Set Error": */
-
-#define J_SE(FuncName,Errno)  ((void) 0)
-
-/* Note:  In each J_*() case below, the digit is the number of key parameters
-// to the Judy*() call.  Just assign the Func result to the callers Rc value
-// without a cast because none is required, and this keeps the API simpler.
-// However, a family of different J_*() macros is needed to support the
-// different numbers of key parameters (0,1,2) and the Func return type.
-//
-// In the names below, "I" = integer result; "P" = pointer result.  Note, the
-// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible,
-// error-free assignment, and then compare to PJERR.
-*/
-#define J_0I(Rc,PArray,Func,FuncName) \
-        { (Rc) = Func(PArray, PJE0); }
-
-#define J_1I(Rc,PArray,Index,Func,FuncName) \
-        { (Rc) = Func(PArray, Index, PJE0); }
-
-#define J_1P(PV,PArray,Index,Func,FuncName) \
-        { (PV) = (Pvoid_t) Func(PArray, Index, PJE0); }
-
-#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName) \
-        { (Rc) = Func(PArray, Index, Arg2, PJE0); }
-
-#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName) \
-        { (Rc) = Func(PArray, Index1, Index2, PJE0); }
-
-#define J_2P(PV,PArray,Index,Arg2,Func,FuncName) \
-        { (PV) = (Pvoid_t) Func(PArray, Index, Arg2, PJE0); }
-
-/* Variations for Judy*Set/InsArray functions: */
-
-#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName) \
-        { (Rc) = Func(PArray, Count, PIndex, PJE0); }
-#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName) \
-        { (Rc) = Func(PArray, Count, PIndex, PValue, PJE0); }
-
-#else /* ================ ! JUDYERROR_NOTEST ============================= */
-
-#define J_E(FuncName,PJE) \
-        JUDYERROR(__FILE__, __LINE__, FuncName, JU_ERRNO(PJE), JU_ERRID(PJE))
-
-#define J_SE(FuncName,Errno)                                            \
-        {                                                               \
-            JError_t J_Error;                                           \
-            JU_ERRNO(&J_Error) = (Errno);                               \
-            JU_ERRID(&J_Error) = __LINE__;                              \
-            J_E(FuncName, &J_Error);                                    \
-        }
-
-/* Note:  In each J_*() case below, the digit is the number of key parameters
-// to the Judy*() call.  Just assign the Func result to the callers Rc value
-// without a cast because none is required, and this keeps the API simpler.
-// However, a family of different J_*() macros is needed to support the
-// different numbers of key parameters (0,1,2) and the Func return type.
-//
-// In the names below, "I" = integer result; "P" = pointer result.  Note, the
-// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible,
-// error-free assignment, and then compare to PJERR.
-*/
-#define J_0I(Rc,PArray,Func,FuncName)                                   \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = Func(PArray, &J_Error)) == JERR)                \
-                J_E(FuncName, &J_Error);                                \
-        }
-
-#define J_1I(Rc,PArray,Index,Func,FuncName)                             \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = Func(PArray, Index, &J_Error)) == JERR)         \
-                J_E(FuncName, &J_Error);                                \
-        }
-
-#define J_1P(Rc,PArray,Index,Func,FuncName)                             \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = (Pvoid_t) Func(PArray, Index, &J_Error)) == PJERR) \
-                J_E(FuncName, &J_Error);                                \
-        }
-
-#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName)                        \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = Func(PArray, Index, Arg2, &J_Error)) == JERR)   \
-                J_E(FuncName, &J_Error);                                \
-        }
-
-/* Variation for Judy*Count functions, which return 0, not JERR, for error (and
-// also for other non-error cases):
-//
-// Note:  JU_ERRNO_NFMAX should only apply to 32-bit Judy1, but this header
-// file lacks the necessary ifdefs to make it go away otherwise, so always
-// check against it.
-*/
-#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName)                     \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if ((((Rc) = Func(PArray, Index1, Index2, &J_Error)) == 0)  \
-             && (JU_ERRNO(&J_Error) > JU_ERRNO_NFMAX))                  \
-            {                                                           \
-                J_E(FuncName, &J_Error);                                \
-            }                                                           \
-        }
-
-#define J_2P(PV,PArray,Index,Arg2,Func,FuncName)                        \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((PV) = (Pvoid_t) Func(PArray, Index, Arg2, &J_Error))  \
-                == PJERR) J_E(FuncName, &J_Error);                      \
-        }
-
-/* Variations for Judy*Set/InsArray functions: */
-
-#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName)                     \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = Func(PArray, Count, PIndex, &J_Error)) == JERR) \
-                J_E(FuncName, &J_Error);                                \
-        }
-
-#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName)              \
-        {                                                               \
-            JError_t J_Error;                                           \
-            if (((Rc) = Func(PArray, Count, PIndex, PValue, &J_Error))  \
-                == JERR) J_E(FuncName, &J_Error);                       \
-        }
-
-#endif /* ================ ! JUDYERROR_NOTEST ============================= */
-
-/* Some of the macros are special cases that use inlined shortcuts for speed
-// with root-level leaves:
-
-// This is a slower version with current processors, but in the future...
-*/
-#define J1T(Rc,PArray,Index)                                            \
-    (Rc) = Judy1Test((Pvoid_t)(PArray), Index, PJE0)
-
-#define J1S( Rc,    PArray,   Index) \
-        J_1I(Rc, (&(PArray)), Index,  Judy1Set,   "Judy1Set")
-#define J1SA(Rc,    PArray,   Count, PIndex) \
-        J_2AI(Rc,(&(PArray)), Count, PIndex, Judy1SetArray, "Judy1SetArray")
-#define J1U( Rc,    PArray,   Index) \
-        J_1I(Rc, (&(PArray)), Index,  Judy1Unset, "Judy1Unset")
-#define J1F( Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1First, "Judy1First")
-#define J1N( Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1Next,  "Judy1Next")
-#define J1L( Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1Last,  "Judy1Last")
-#define J1P( Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1Prev,  "Judy1Prev")
-#define J1FE(Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1FirstEmpty, "Judy1FirstEmpty")
-#define J1NE(Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1NextEmpty,  "Judy1NextEmpty")
-#define J1LE(Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1LastEmpty,  "Judy1LastEmpty")
-#define J1PE(Rc,    PArray,   Index) \
-        J_1I(Rc,    PArray, &(Index), Judy1PrevEmpty,  "Judy1PrevEmpty")
-#define J1C( Rc,    PArray,   Index1,  Index2) \
-        J_2C(Rc,    PArray,   Index1,  Index2, Judy1Count,   "Judy1Count")
-#define J1BC(Rc,    PArray,   Count,   Index) \
-        J_2I(Rc,    PArray,   Count, &(Index), Judy1ByCount, "Judy1ByCount")
-#define J1FA(Rc,    PArray) \
-        J_0I(Rc, (&(PArray)), Judy1FreeArray, "Judy1FreeArray")
-#define J1MU(Rc,    PArray) \
-        (Rc) = Judy1MemUsed(PArray)
-
-#define JLG(PV,PArray,Index)                                            \
-    (PV) = (Pvoid_t)JudyLGet((Pvoid_t)PArray, Index, PJE0)
-
-#define JLI( PV,    PArray,   Index)                                    \
-        J_1P(PV, (&(PArray)), Index,  JudyLIns,   "JudyLIns")
-
-#define JLIA(Rc,    PArray,   Count, PIndex, PValue)                    \
-        J_3AI(Rc,(&(PArray)), Count, PIndex, PValue, JudyLInsArray,     \
-                                                  "JudyLInsArray")
-#define JLD( Rc,    PArray,   Index)                                    \
-        J_1I(Rc, (&(PArray)), Index,  JudyLDel,   "JudyLDel")
-
-#define JLF( PV,    PArray,   Index)                                    \
-        J_1P(PV,    PArray, &(Index), JudyLFirst, "JudyLFirst")
-
-#define JLN( PV,    PArray,   Index)                                    \
-        J_1P(PV,    PArray, &(Index), JudyLNext, "JudyLNext")
-
-#define JLL( PV,    PArray,   Index)                                    \
-        J_1P(PV,    PArray, &(Index), JudyLLast,  "JudyLLast")
-#define JLP( PV,    PArray,   Index)                                    \
-        J_1P(PV,    PArray, &(Index), JudyLPrev,  "JudyLPrev")
-#define JLFE(Rc,    PArray,   Index)                                    \
-        J_1I(Rc,    PArray, &(Index), JudyLFirstEmpty, "JudyLFirstEmpty")
-#define JLNE(Rc,    PArray,   Index)                                    \
-        J_1I(Rc,    PArray, &(Index), JudyLNextEmpty,  "JudyLNextEmpty")
-#define JLLE(Rc,    PArray,   Index)                                    \
-        J_1I(Rc,    PArray, &(Index), JudyLLastEmpty,  "JudyLLastEmpty")
-#define JLPE(Rc,    PArray,   Index)                                    \
-        J_1I(Rc,    PArray, &(Index), JudyLPrevEmpty,  "JudyLPrevEmpty")
-#define JLC( Rc,    PArray,   Index1,  Index2)                          \
-        J_2C(Rc,    PArray,   Index1,  Index2, JudyLCount,   "JudyLCount")
-#define JLBC(PV,    PArray,   Count,   Index)                           \
-        J_2P(PV,    PArray,   Count, &(Index), JudyLByCount, "JudyLByCount")
-#define JLFA(Rc,    PArray)                                             \
-        J_0I(Rc, (&(PArray)), JudyLFreeArray, "JudyLFreeArray")
-#define JLMU(Rc,    PArray)                                             \
-        (Rc) = JudyLMemUsed(PArray)
-
-#define JHSI(PV,    PArray,   PIndex,   Count)                          \
-        J_2P(PV, (&(PArray)), PIndex,   Count, JudyHSIns, "JudyHSIns")
-#define JHSG(PV,    PArray,   PIndex,   Count)                          \
-        (PV) = (Pvoid_t) JudyHSGet(PArray, PIndex, Count)
-#define JHSD(Rc,    PArray,   PIndex,   Count)                          \
-        J_2I(Rc, (&(PArray)), PIndex, Count, JudyHSDel, "JudyHSDel")
-#define JHSFA(Rc,    PArray)                                            \
-        J_0I(Rc, (&(PArray)), JudyHSFreeArray, "JudyHSFreeArray")
-
-#define JSLG( PV,    PArray,   Index)                                   \
-        J_1P( PV,    PArray,   Index, JudySLGet,   "JudySLGet")
-#define JSLI( PV,    PArray,   Index)                                   \
-        J_1P( PV, (&(PArray)), Index, JudySLIns,   "JudySLIns")
-#define JSLD( Rc,    PArray,   Index)                                   \
-        J_1I( Rc, (&(PArray)), Index, JudySLDel,   "JudySLDel")
-#define JSLF( PV,    PArray,   Index)                                   \
-        J_1P( PV,    PArray,   Index, JudySLFirst, "JudySLFirst")
-#define JSLN( PV,    PArray,   Index)                                   \
-        J_1P( PV,    PArray,   Index, JudySLNext,  "JudySLNext")
-#define JSLL( PV,    PArray,   Index)                                   \
-        J_1P( PV,    PArray,   Index, JudySLLast,  "JudySLLast")
-#define JSLP( PV,    PArray,   Index)                                   \
-        J_1P( PV,    PArray,   Index, JudySLPrev,  "JudySLPrev")
-#define JSLFA(Rc,    PArray)                                            \
-        J_0I( Rc, (&(PArray)), JudySLFreeArray, "JudySLFreeArray")
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* ! _JUDY_INCLUDED */
diff --git a/libs/klib/Makefile b/libs/klib/Makefile
deleted file mode 100644
index 21f2b1d..0000000
--- a/libs/klib/Makefile
+++ /dev/null
@@ -1,140 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/klib
-
-INT_LIBS = \
-	libklib
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all: makedirs
-	@ $(MAKE) -C $(SRCDIR)/judy all
-	@ $(MAKE_CMD) $(TARGDIR)/all
-
-std: makedirs
-	@ $(MAKE) -C $(SRCDIR)/judy std
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE) -C $(SRCDIR)/judy std
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# all, std
-#
-$(TARGDIR)/all $(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ $(MAKE) -C $(SRCDIR)/judy clean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# klib
-#
-$(ILIBDIR)/libklib: $(addprefix $(ILIBDIR)/libklib.,$(ILIBEXT))
-
-KLIB_SRC = \
-	text \
-	utf8 \
-	iso8859 \
-	iso8859-1 \
-	cp1252 \
-	token \
-	symtab \
-	container \
-	vector \
-	namelist \
-	vector_namelist \
-	trie \
-	pbstree \
-	pbstree-impl.nopt \
-	pbstree-impl.swap.nopt \
-	bstpersist.nopt \
-	ptrie.nopt \
-	ptpersist.nopt \
-	crc32 \
-	md5 \
-	SHA-32bit \
-	SHA-64bit \
-	qsort \
-	ksort \
-	bsearch \
-	pack \
-	unpack \
-	vlen-encode \
-	data-buffer \
-	refcount \
-	printf \
-	status-rc-strings \
-	status-rc \
-	syserrcode \
-	syswriter \
-	out \
-	status \
-	log \
-	writer \
-	syslog \
-	systime \
-	rc-tbl \
-	rc-idx-tbl \
-	judy-vector \
-	report
-
-ifeq (win,$(OS))
-	KLIB_SRC += sysalloc
-endif
-
-ifeq (dbg,$(BUILD))
-	KLIB_SRC += debug
-endif
-
-KLIB_OBJ = \
-	$(addsuffix .$(LOBX),$(KLIB_SRC))
-
-KLIB_LIB = \
-	-sjudy \
-	-lm
-
-$(ILIBDIR)/libklib.$(LIBX): $(KLIB_OBJ)
-	$(LD) --slib -o $@ $^ $(KLIB_LIB)
diff --git a/libs/klib/SHA-32bit.c b/libs/klib/SHA-32bit.c
deleted file mode 100644
index 3b4bbfc..0000000
--- a/libs/klib/SHA-32bit.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/checksum.h>
-
-#include <endian.h>
-#include <byteswap.h>
-
-#include <stdint.h>
-#include <string.h>
-
-static const uint32_t H0_1[5] =
-{
-    0x67452301U,
-    0xefcdab89U,
-    0x98badcfeU,
-    0x10325476U,
-    0xc3d2e1f0U,
-};
-
-static const uint32_t K_1[4] =
-{
-    0x5a827999U,
-    0x6ed9eba1U,
-    0x8f1bbcdcU,
-    0xca62c1d6U
-};
-
-static const uint32_t H0_2[8] =
-{
-    0x6a09e667U,
-    0xbb67ae85U,
-    0x3c6ef372U,
-    0xa54ff53aU,
-    0x510e527fU,
-    0x9b05688cU,
-    0x1f83d9abU,
-    0x5be0cd19U,
-};
-
-static const uint32_t K_2[] =
-{
-    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 
-    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U, 
-    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U, 
-    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U, 
-    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU, 
-    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU, 
-    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, 
-    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U, 
-    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U, 
-    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, 
-    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U, 
-    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U, 
-    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 
-    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U, 
-    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U, 
-    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U, 
-};
-
-#define ROL(X, N) (((X) << (N)) | ((X) >> (32 - (N))))
-#define ROR(X, N) ROL(X, 32-N)
-#define SHR(X, N) ((X) >> (N))
-
-#define Ch(X, Y, Z) (((X) & (Y))^((~(X))&(Z)))
-#define Maj(X, Y, Z) (((X)&(Y))^((X)&(Z))^((Y)&(Z)))
-#define Parity(X, Y, Z) ((X)^(Y)^(Z))
-#define Sigma0(X) (ROR((X),  2)^ROR((X), 13)^ROR((X), 22))
-#define Sigma1(X) (ROR((X),  6)^ROR((X), 11)^ROR((X), 25))
-#define sigma0(X) (ROR((X),  7)^ROR((X), 18)^SHR((X),  3))
-#define sigma1(X) (ROR((X), 17)^ROR((X), 19)^SHR((X), 10))
-
-static void SHA1_stage(uint32_t Ho[8], const uint32_t Hi[8], uint32_t W[16])
-{
-    uint32_t a = Hi[0];
-    uint32_t b = Hi[1];
-    uint32_t c = Hi[2];
-    uint32_t d = Hi[3];
-    uint32_t e = Hi[4];
-    unsigned t;
-    
-    for (t = 0; t != 16; ++t) {
-        const uint32_t T = ROL(a, 5) + Ch(b, c, d) + e + K_1[0] + W[t];
-        
-        e = d; d = c; c = ROL(b, 30); b = a; a = T;
-    }
-    for ( ; t != 20; ++t) {
-        const uint32_t T = ROL(a, 5) + Ch(b, c, d) + e + K_1[0] +
-            (W[t%16] = ROL(W[(t-3)%16] ^ W[(t-8)%16] ^ W[(t-14)%16] ^ W[(t-16)%16], 1));
-        
-        e = d; d = c; c = ROL(b, 30); b = a; a = T;
-    }
-    for ( ; t != 40; ++t) {
-        const uint32_t T = ROL(a, 5) + Parity(b, c, d) + e + K_1[1] +
-            (W[t%16] = ROL(W[(t-3)%16] ^ W[(t-8)%16] ^ W[(t-14)%16] ^ W[(t-16)%16], 1));
-        
-        e = d; d = c; c = ROL(b, 30); b = a; a = T;
-    }
-    for ( ; t != 60; ++t) {
-        const uint32_t T = ROL(a, 5) + Maj(b, c, d) + e + K_1[2] +
-            (W[t%16] = ROL(W[(t-3)%16] ^ W[(t-8)%16] ^ W[(t-14)%16] ^ W[(t-16)%16], 1));
-        
-        e = d; d = c; c = ROL(b, 30); b = a; a = T;
-    }
-    for ( ; t != 80; ++t) {
-        const uint32_t T = ROL(a, 5) + Parity(b, c, d) + e + K_1[3] +
-            (W[t%16] = ROL(W[(t-3)%16] ^ W[(t-8)%16] ^ W[(t-14)%16] ^ W[(t-16)%16], 1));
-        
-        e = d; d = c; c = ROL(b, 30); b = a; a = T;
-    }
-    Ho[0] = Hi[0] + a;
-    Ho[1] = Hi[1] + b;
-    Ho[2] = Hi[2] + c;
-    Ho[3] = Hi[3] + d;
-    Ho[4] = Hi[4] + e;
-}
-
-static void SHA2_stage(uint32_t Ho[8], const uint32_t Hi[8], uint32_t W[16])
-{
-    uint32_t a = Hi[0];
-    uint32_t b = Hi[1];
-    uint32_t c = Hi[2];
-    uint32_t d = Hi[3];
-    uint32_t e = Hi[4];
-    uint32_t f = Hi[5];
-    uint32_t g = Hi[6];
-    uint32_t h = Hi[7];
-    unsigned t;
-    
-    for (t = 0; t != 16; ++t) {
-        const uint32_t T1 = h + Sigma1(e) + Ch(e, f, g) + K_2[t] + W[t];
-        const uint32_t T2 = Sigma0(a) + Maj(a, b, c);
-        
-        h = g; g = f; f = e; e = d + T1;
-        d = c; c = b; b = a; a = T1 + T2;
-    }
-    for ( ; t != 64; ++t) {
-        const uint32_t T1 = h + Sigma1(e) + Ch(e, f, g) + K_2[t] +
-            (W[t%16] = sigma1(W[(t-2)%16])+W[(t-7)%16]+sigma0(W[(t-15)%16])+W[(t-16)%16]);
-        const uint32_t T2 = Sigma0(a) + Maj(a, b, c);
-        
-        h = g; g = f; f = e; e = d + T1;
-        d = c; c = b; b = a; a = T1 + T2;
-    }
-    Ho[0] = Hi[0] + a;
-    Ho[1] = Hi[1] + b;
-    Ho[2] = Hi[2] + c;
-    Ho[3] = Hi[3] + d;
-    Ho[4] = Hi[4] + e;
-    Ho[5] = Hi[5] + f;
-    Ho[6] = Hi[6] + g;
-    Ho[7] = Hi[7] + h;
-}
-
-static __inline__ void SHA_32b_Init(struct SHA32bitState *ctx, int which)
-{
-    if (which == 0)
-        memcpy(ctx->H, H0_1, sizeof(H0_1));
-    else
-        memcpy(ctx->H, H0_2, sizeof(H0_2));
-    ctx->len = 0;
-    ctx->cur = 0;
-}
-
-static __inline__ void SHA_32b_Append(struct SHA32bitState *ctx, int which, const uint8_t data[], size_t length)
-{
-    unsigned i;
-    unsigned j;
-    unsigned n;
-    
-    ctx->len += length;
-    for (i = 0; i != length; i += n) {
-        n = length - i > 64 ? 64 : (unsigned)(length - i);
-        if (ctx->cur + n > 64)
-            n = 64 - ctx->cur;
-        memcpy(&ctx->W[ctx->cur], &data[i], n);
-        ctx->cur += n;
-        if (ctx->cur == 64) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            uint32_t W[16];
-            
-            for (j = 0; j != 16; ++j)
-                W[j] = bswap_32(((const uint32_t *)ctx->W)[j]);
-            
-            (which ? SHA2_stage : SHA1_stage)(ctx->H, ctx->H, W);
-#else
-            (which ? SHA2_stage : SHA1_stage)(ctx->H, ctx->H, ctx->W);
-#endif
-            ctx->cur = 0;
-        }
-    }
-}
-
-static __inline__ void SHA_32b_Finish(const struct SHA32bitState *ctx, int which, uint32_t rslt[8])
-{
-    unsigned j;
-    unsigned const n = (ctx->cur + 3) >> 2;
-    uint32_t W[32];
-    
-    memset(W, 0, sizeof(W));
-    for (j = 0; j != n; ++j) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        W[j] = bswap_32(((const uint32_t *)ctx->W)[j]);
-#else
-        W[j] = ((const uint32_t *)ctx->W)[j];
-#endif
-    }
-    if (ctx->cur & 3) {
-        --j;
-        W[j] &= (~((uint32_t)0)) << ((4 - (ctx->cur & 3)) * 8);
-        W[j] |= ((uint32_t)0x80U) << ((3 - (ctx->cur & 3)) * 8);
-    }
-    else
-        W[j] = ((uint32_t)0x80U) << 24;
-    if (j < 14) {
-        W[14] = (uint32_t)(ctx->len >> 29);
-        W[15] = (uint32_t)(ctx->len <<  3);
-        (which ? SHA2_stage : SHA1_stage)(rslt, ctx->H, W);
-    }
-    else {
-        W[30] = (uint32_t)(ctx->len >> 29);
-        W[31] = (uint32_t)(ctx->len <<  3);
-        (which ? SHA2_stage : SHA1_stage)(rslt, ctx->H, W);
-        (which ? SHA2_stage : SHA1_stage)(rslt, rslt, W + 16);
-    }
-}
-
-void CC SHA1StateInit(SHA1State *ctx)
-{
-    SHA_32b_Init(ctx, 0);
-}
-
-void CC SHA1StateAppend(SHA1State *ctx, const void *data, size_t length)
-{
-    SHA_32b_Append(ctx, 0, data, length);
-}
-
-void CC SHA1StateFinish(SHA1State *ctx, uint8_t hash[20])
-{
-    uint32_t H[8];
-
-    SHA_32b_Finish(ctx, 0, H);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    {
-        H[0] = bswap_32(H[0]);
-        H[1] = bswap_32(H[1]);
-        H[2] = bswap_32(H[2]);
-        H[3] = bswap_32(H[3]);
-        H[4] = bswap_32(H[4]);
-    }
-#endif
-    memcpy(hash, H, 20);
-}
-
-void CC SHA256StateInit(SHA256State *ctx)
-{
-    SHA_32b_Init(ctx, 1);
-}
-
-void CC SHA256StateAppend(SHA256State *ctx, const void *data, size_t length)
-{
-    SHA_32b_Append(ctx, 1, data, length);
-}
-
-void CC SHA256StateFinish(SHA256State *ctx, uint8_t hash[32])
-{
-    uint32_t H[8];
-
-    SHA_32b_Finish(ctx, 1, H);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    {
-        H[0] = bswap_32(H[0]);
-        H[1] = bswap_32(H[1]);
-        H[2] = bswap_32(H[2]);
-        H[3] = bswap_32(H[3]);
-        H[4] = bswap_32(H[4]);
-        H[5] = bswap_32(H[5]);
-        H[6] = bswap_32(H[6]);
-        H[7] = bswap_32(H[7]);
-    }
-#endif
-    memcpy(hash, H, 32);
-}
diff --git a/libs/klib/SHA-64bit.c b/libs/klib/SHA-64bit.c
deleted file mode 100644
index 1fc1914..0000000
--- a/libs/klib/SHA-64bit.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/checksum.h>
-
-#include <endian.h>
-#include <byteswap.h>
-
-#include <stdint.h>
-#include <string.h>
-
-#if _ARCH_BITS == 32
-#define UL( x ) x ## ULL
-#else
-#define UL( x ) x ## UL
-#endif
-
-static const uint64_t H0_384[8] =
-{
-    UL(0xcbbb9d5dc1059ed8),
-    UL(0x629a292a367cd507),
-    UL(0x9159015a3070dd17),
-    UL(0x152fecd8f70e5939),
-    UL(0x67332667ffc00b31),
-    UL(0x8eb44a8768581511),
-    UL(0xdb0c2e0d64f98fa7),
-    UL(0x47b5481dbefa4fa4),
-};
-
-static const uint64_t H0_512[8] =
-{
-    UL(0x6a09e667f3bcc908),
-    UL(0xbb67ae8584caa73b),
-    UL(0x3c6ef372fe94f82b),
-    UL(0xa54ff53a5f1d36f1),
-    UL(0x510e527fade682d1),
-    UL(0x9b05688c2b3e6c1f),
-    UL(0x1f83d9abfb41bd6b),
-    UL(0x5be0cd19137e2179),
-};
-
-static const uint64_t K[] =
-{
-    UL(0x428a2f98d728ae22), UL(0x7137449123ef65cd), UL(0xb5c0fbcfec4d3b2f), UL(0xe9b5dba58189dbbc), 
-    UL(0x3956c25bf348b538), UL(0x59f111f1b605d019), UL(0x923f82a4af194f9b), UL(0xab1c5ed5da6d8118), 
-    UL(0xd807aa98a3030242), UL(0x12835b0145706fbe), UL(0x243185be4ee4b28c), UL(0x550c7dc3d5ffb4e2), 
-    UL(0x72be5d74f27b896f), UL(0x80deb1fe3b1696b1), UL(0x9bdc06a725c71235), UL(0xc19bf174cf692694), 
-    UL(0xe49b69c19ef14ad2), UL(0xefbe4786384f25e3), UL(0x0fc19dc68b8cd5b5), UL(0x240ca1cc77ac9c65), 
-    UL(0x2de92c6f592b0275), UL(0x4a7484aa6ea6e483), UL(0x5cb0a9dcbd41fbd4), UL(0x76f988da831153b5), 
-    UL(0x983e5152ee66dfab), UL(0xa831c66d2db43210), UL(0xb00327c898fb213f), UL(0xbf597fc7beef0ee4), 
-    UL(0xc6e00bf33da88fc2), UL(0xd5a79147930aa725), UL(0x06ca6351e003826f), UL(0x142929670a0e6e70), 
-    UL(0x27b70a8546d22ffc), UL(0x2e1b21385c26c926), UL(0x4d2c6dfc5ac42aed), UL(0x53380d139d95b3df), 
-    UL(0x650a73548baf63de), UL(0x766a0abb3c77b2a8), UL(0x81c2c92e47edaee6), UL(0x92722c851482353b), 
-    UL(0xa2bfe8a14cf10364), UL(0xa81a664bbc423001), UL(0xc24b8b70d0f89791), UL(0xc76c51a30654be30), 
-    UL(0xd192e819d6ef5218), UL(0xd69906245565a910), UL(0xf40e35855771202a), UL(0x106aa07032bbd1b8), 
-    UL(0x19a4c116b8d2d0c8), UL(0x1e376c085141ab53), UL(0x2748774cdf8eeb99), UL(0x34b0bcb5e19b48a8), 
-    UL(0x391c0cb3c5c95a63), UL(0x4ed8aa4ae3418acb), UL(0x5b9cca4f7763e373), UL(0x682e6ff3d6b2b8a3), 
-    UL(0x748f82ee5defb2fc), UL(0x78a5636f43172f60), UL(0x84c87814a1f0ab72), UL(0x8cc702081a6439ec), 
-    UL(0x90befffa23631e28), UL(0xa4506cebde82bde9), UL(0xbef9a3f7b2c67915), UL(0xc67178f2e372532b), 
-    UL(0xca273eceea26619c), UL(0xd186b8c721c0c207), UL(0xeada7dd6cde0eb1e), UL(0xf57d4f7fee6ed178), 
-    UL(0x06f067aa72176fba), UL(0x0a637dc5a2c898a6), UL(0x113f9804bef90dae), UL(0x1b710b35131c471b), 
-    UL(0x28db77f523047d84), UL(0x32caab7b40c72493), UL(0x3c9ebe0a15c9bebc), UL(0x431d67c49c100d4c), 
-    UL(0x4cc5d4becb3e42b6), UL(0x597f299cfc657e2a), UL(0x5fcb6fab3ad6faec), UL(0x6c44198c4a475817), 
-};
-
-#undef UL
-
-#define ROL(X, N) (((X) << (N)) | ((X) >> (64 - (N))))
-#define ROR(X, N) ROL(X, 64-N)
-#define SHR(X, N) ((X) >> (N))
-
-#define Ch(X, Y, Z) (((X) & (Y))^((~(X))&(Z)))
-#define Maj(X, Y, Z) (((X)&(Y))^((X)&(Z))^((Y)&(Z)))
-#define Parity(X, Y, Z) ((X)^(Y)^(Z))
-#define Sigma0(X) (ROR((X), 28)^ROR((X), 34)^ROR((X), 39))
-#define Sigma1(X) (ROR((X), 14)^ROR((X), 18)^ROR((X), 41))
-#define sigma0(X) (ROR((X),  1)^ROR((X),  8)^SHR((X), 7))
-#define sigma1(X) (ROR((X), 19)^ROR((X), 61)^SHR((X), 6))
-
-static void SHA_stage(uint64_t Ho[8], const uint64_t Hi[8], uint64_t W[16])
-{
-    uint64_t a = Hi[0];
-    uint64_t b = Hi[1];
-    uint64_t c = Hi[2];
-    uint64_t d = Hi[3];
-    uint64_t e = Hi[4];
-    uint64_t f = Hi[5];
-    uint64_t g = Hi[6];
-    uint64_t h = Hi[7];
-    unsigned t;
-    
-    for (t = 0; t != 16; ++t) {
-        const uint64_t T1 = h + Sigma1(e) + Ch(e, f, g) + K[t] + W[t];
-        const uint64_t T2 = Sigma0(a) + Maj(a, b, c);
-        
-        h = g; g = f; f = e; e = d + T1;
-        d = c; c = b; b = a; a = T1 + T2;
-    }
-    for ( ; t != 80; ++t) {
-        const uint64_t T1 = h + Sigma1(e) + Ch(e, f, g) + K[t] +
-            (W[t%16] = sigma1(W[(t-2)%16])+W[(t-7)%16]+sigma0(W[(t-15)%16])+W[(t-16)%16]);
-        const uint64_t T2 = Sigma0(a) + Maj(a, b, c);
-        
-        h = g; g = f; f = e; e = d + T1;
-        d = c; c = b; b = a; a = T1 + T2;
-    }
-    Ho[0] = Hi[0] + a;
-    Ho[1] = Hi[1] + b;
-    Ho[2] = Hi[2] + c;
-    Ho[3] = Hi[3] + d;
-    Ho[4] = Hi[4] + e;
-    Ho[5] = Hi[5] + f;
-    Ho[6] = Hi[6] + g;
-    Ho[7] = Hi[7] + h;
-}
-
-static __inline__ void SHA_64b_Init(struct SHA64bitState *ctx, int which)
-{
-    if (which == 0)
-        memcpy(ctx->H, H0_384, sizeof(H0_384));
-    else
-        memcpy(ctx->H, H0_512, sizeof(H0_512));
-    ctx->len = 0;
-    ctx->cur = 0;
-}
-
-static __inline__ void SHA_64b_Append(struct SHA64bitState *ctx, const uint8_t data[], size_t length)
-{
-    unsigned i;
-    unsigned j;
-    unsigned n;
-    
-    ctx->len += length;
-    for (i = 0; i != length; i += n) {
-        n = length - i > 128 ? 128 : (unsigned)(length - i);
-        if (ctx->cur + n > 128)
-            n = 128 - ctx->cur;
-        memcpy(&ctx->W[ctx->cur], &data[i], n);
-        ctx->cur += n;
-        if (ctx->cur == 128) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            uint64_t W[16];
-            
-            for (j = 0; j != 16; ++j)
-                W[j] = bswap_64(((const uint64_t *)ctx->W)[j]);
-            SHA_stage(ctx->H, ctx->H, W);
-#else
-            SHA_stage(ctx->H, ctx->H, ctx->W);
-#endif
-            ctx->cur = 0;
-        }
-    }
-}
-
-
-static __inline__ void SHA_64b_Finish(const struct SHA64bitState *ctx, uint64_t rslt[8])
-{
-    unsigned j;
-    unsigned const n = (ctx->cur + 7) >> 3;
-    uint64_t W[32];
-    
-    memset(W, 0, sizeof(W));
-    for (j = 0; j != n; ++j) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        W[j] = bswap_64(((const uint64_t *)ctx->W)[j]);
-#else
-        W[j] = ((const uint64_t *)ctx->W)[j];
-#endif
-    }
-    if (ctx->cur & 7) {
-        --j;
-        W[j] &= (~((uint64_t)0)) << ((8 - (ctx->cur & 7)) * 8);
-        W[j] |= ((uint64_t)0x80U) << ((7 - (ctx->cur & 7)) * 8);
-    }
-    else
-        W[j] = ((uint64_t)0x80U) << 56;
-    if (j < 14) {
-        W[14] = ctx->len >> 61;
-        W[15] = ctx->len <<  3;
-        SHA_stage(rslt, ctx->H, W);
-    }
-    else {
-        W[30] = ctx->len >> 61;
-        W[31] = ctx->len <<  3;
-        SHA_stage(rslt, ctx->H, W);
-        SHA_stage(rslt, rslt, W + 16);
-    }
-}
-
-void CC SHA384StateInit(SHA384State *ctx)
-{
-    SHA_64b_Init(ctx, 0);
-}
-
-void CC SHA384StateAppend(SHA384State *ctx, const void *data, size_t length)
-{
-    SHA_64b_Append(ctx, data, length);
-}
-
-void CC SHA384StateFinish(SHA384State *ctx, uint8_t hash[48])
-{
-    uint64_t H[8];
-
-    SHA_64b_Finish(ctx, H);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    {
-        H[0] = bswap_64(H[0]);
-        H[1] = bswap_64(H[1]);
-        H[2] = bswap_64(H[2]);
-        H[3] = bswap_64(H[3]);
-        H[4] = bswap_64(H[4]);
-        H[5] = bswap_64(H[5]);
-    }
-#endif
-    memcpy(hash, H, 48);
-}
-
-void CC SHA512StateInit(SHA512State *ctx)
-{
-    SHA_64b_Init(ctx, 1);
-}
-
-void CC SHA512StateAppend(SHA512State *ctx, const void *data, size_t length)
-{
-    SHA_64b_Append(ctx, data, length);
-}
-
-void CC SHA512StateFinish(SHA512State *ctx, uint8_t hash[64])
-{
-    uint64_t H[8];
-
-    SHA_64b_Finish(ctx, H);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    {
-        H[0] = bswap_64(H[0]);
-        H[1] = bswap_64(H[1]);
-        H[2] = bswap_64(H[2]);
-        H[3] = bswap_64(H[3]);
-        H[4] = bswap_64(H[4]);
-        H[5] = bswap_64(H[5]);
-        H[6] = bswap_64(H[6]);
-        H[7] = bswap_64(H[7]);
-    }
-#endif
-    memcpy(hash, H, 64);
-}
diff --git a/libs/klib/bsearch.c b/libs/klib/bsearch.c
deleted file mode 100644
index 69fd613..0000000
--- a/libs/klib/bsearch.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/sort.h>
-#include <sysalloc.h>
-
-/* Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <stdlib.h>
-
-
-/* Perform a binary search for KEY in BASE which has NMEMB elements
-   of SIZE bytes each.  The comparisons are done by (*COMPAR)().  */
-LIB_EXPORT void* CC kbsearch ( const void *key, const void *base, size_t nmemb, size_t size,
-    int ( CC * compar ) ( const void *, const void *, void *data ), void *data )
-{
-    size_t l, u, idx;
-    const void *p;
-    int comparison;
-
-    l = 0;
-    u = nmemb;
-    while (l < u)
-    {
-        idx = (l + u) / 2;
-        p = (void *) (((const char *) base) + (idx * size));
-        comparison = (*compar) (key, p, data);
-        if (comparison < 0)
-            u = idx;
-        else if (comparison > 0)
-            l = idx + 1;
-        else
-            return (void *) p;
-    }
-
-    return NULL;
-}
diff --git a/libs/klib/bstpersist.c b/libs/klib/bstpersist.c
deleted file mode 100644
index 58eeb52..0000000
--- a/libs/klib/bstpersist.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "trie-priv.h"
-#include "pbstree-priv.h"
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * PBSTree
- * PBSTreeData
- */
-
-typedef struct PBSTreeData PBSTreeData;
-struct PBSTreeData
-{
-    PTWriteFunc write;
-    void *write_param;
-
-    PTAuxFunc aux;
-    void *aux_param;
-
-    P_BSTree *pt;
-    void ( CC * record ) ( P_BSTree*, unsigned int, size_t );
-
-    size_t num_writ;
-    size_t data_size;
-    uint32_t num_nodes;
-
-    rc_t rc;
-};
-
-static
-bool CC PBSTreeGatherInfo ( BSTNode *n, void *data )
-{
-    PBSTreeData *pb = data;
-
-    size_t node_size;
-    pb -> rc = ( * pb -> aux ) ( pb -> aux_param, n, & node_size, NULL, NULL );
-    if ( pb -> rc != 0 )
-        return true;
-
-    if ( pb -> pt != NULL )
-        ( * pb -> record ) ( pb -> pt, pb -> num_nodes, pb -> data_size );
-
-    pb -> data_size += node_size;
-    ++ pb -> num_nodes;
-
-    return false;
-}
-
-static
-void CC PBSTreeRecordU8 ( P_BSTree *pt, unsigned int idx, size_t offset )
-{
-    pt -> data_idx . v8 [ idx ] = ( uint8_t ) offset;
-}
-
-static
-void CC PBSTreeRecordU16 ( P_BSTree *pt, unsigned int idx, size_t offset )
-{
-    pt -> data_idx . v16 [ idx ] = ( uint16_t ) offset;
-}
-
-static
-void CC PBSTreeRecordU32 ( P_BSTree *pt, unsigned int idx, size_t offset )
-{
-    pt -> data_idx . v32 [ idx ] = ( uint32_t ) offset;
-}
-
-static
-bool CC PBSTreeWriteNodes ( BSTNode *n, void *data )
-{
-    PBSTreeData *pb = data;
-
-    size_t node_size;
-    pb -> rc = ( * pb -> aux ) ( pb -> aux_param,
-        n, & node_size, pb -> write, pb -> write_param );
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> num_writ += node_size;
-    return false;
-}
-
-/*--------------------------------------------------------------------------
- * BSTree
- */
-
-/* BSTreePersist
- *  write a b-tree to some storage location
- *
- *  the b-tree is persisted by making between one and three passes
- *  over its nodes, see description of "write" parameter.
- *
- *  the first pass examines internal tree structure and invokes
- *  a user-supplied function to determine overall size.
- *
- *  the second pass persists the internal structure in a packed
- *  format, using the user-supplied generic "write" function.
- *
- *  the third pass invokes another user-supplied function to write
- *  auxiliary node data to output.
- *
- *  "num_writ" returns the number of bytes written as a result of
- *  persisting the b-tree. this will be the actual bytes written
- *  regardless of return status.
- *
- *  "write" is a generic output streaming function used for all
- *  operations. if NULL, then the function will exit after its
- *  first pass with the number of bytes required in "num_writ".
- *
- *  "aux" is a specialized function for streaming auxiliary node
- *  data to output using the supplied "write" function. it is invoked
- *  during the first pass with a NULL write function for gathering
- *  size data, and during the third pass with a non-NULL write function.
- */
-KLIB_EXTERN rc_t CC BSTreePersist ( const BSTree *bt, size_t *num_writ,
-    PTWriteFunc write, void *write_param, PTAuxFunc aux, void *aux_param )
-{
-    PBSTreeData pb;
-
-    if ( num_writ != NULL )
-        * num_writ = 0;
-
-    if ( bt == NULL )
-        return RC ( rcCont, rcTree, rcPersisting, rcSelf, rcNull );
-    if ( aux == NULL )
-        return RC ( rcCont, rcTree, rcPersisting, rcFunction, rcNull );
-
-    pb . num_writ = 0;
-
-    /* handle the trivial case */
-    if ( bt -> root == NULL )
-    {
-        P_BSTree pt;
-        if ( write == NULL )
-        {
-            pb . num_writ = sizeof pt . num_nodes;
-            pb . rc = 0;
-        }
-        else
-        {
-            pt . num_nodes = 0;
-            pb . rc = ( * write ) ( write_param,
-                & pt, sizeof pt . num_nodes, & pb . num_writ );
-        }
-    }
-    else
-    {
-        /* initialize callback param block */
-        pb . write = write;
-        pb . write_param = write_param;
-        pb . aux = aux;
-        pb . aux_param = aux_param;
-        pb . rc = 0;
-
-        /* count nodes and tally data size */
-        pb . pt = NULL;
-        pb . data_size = 0;
-        pb . num_nodes = 0;
-        BSTreeDoUntil ( bt, 0, PBSTreeGatherInfo, & pb );
-        if ( pb . rc == 0 )
-        {
-            size_t pt_size;
-
-            /* determine object size */
-            if ( pb . data_size <= 256 )
-            {
-                pt_size = 1;
-                pb . record = PBSTreeRecordU8;
-            }
-            else if ( pb . data_size <= 65536 )
-            {
-                pt_size = 2;
-                pb . record = PBSTreeRecordU16;
-            }
-            else
-            {
-                pt_size = 4;
-                pb . record = PBSTreeRecordU32;
-            }
-
-            pt_size = sizeof * pb . pt - sizeof pb . pt -> data_idx +
-                pb . num_nodes * pt_size;
-
-            if ( write == NULL )
-                pb . num_writ = pt_size + pb . data_size;
-
-            else
-            {
-                pb . pt = malloc ( pt_size );
-                if ( pb . pt != NULL )
-                {
-                    pb . pt -> num_nodes = pb . num_nodes;
-                    pb . pt -> data_size = ( uint32_t ) pb . data_size;
-                    
-                    /* record node offsets */
-                    pb . data_size = 0;
-                    pb . num_nodes = 0;
-                    BSTreeDoUntil ( bt, 0, PBSTreeGatherInfo, & pb );
-                    if ( pb . rc != 0 )
-                        free ( pb . pt );
-                    else
-                    {
-                        pb . rc = ( write ) ( write_param,
-                            pb . pt, pt_size, & pb . num_writ );
-                        free ( pb . pt );
-                        
-                        if ( pb . rc == 0 )
-                            BSTreeDoUntil ( bt, 0, PBSTreeWriteNodes, & pb );
-                    }
-                }
-            }
-        }
-    }
-
-    if ( num_writ != NULL )
-        * num_writ = pb . num_writ;
-
-    return pb . rc;
-}
diff --git a/libs/klib/container.c b/libs/klib/container.c
deleted file mode 100644
index 0840eaa..0000000
--- a/libs/klib/container.c
+++ /dev/null
@@ -1,1646 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SLNode
- *  singly linked node
- */
-
-#if 0
-/* SLNodeFindNext
- *  find next element satisfying criteria
- */
-LIB_EXPORT SLNode* CC SLNodeFindNext ( const SLNode *p, bool ( CC * f ) ( const SLNode *n ) )
-{
-    if ( p != NULL )
-    {
-        SLNode *n = p -> next;
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = n -> next;
-        }
-    }
-    return NULL;
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SLList
- *  singly linked list
- */
-
-/* SLListPushTail
- *  push a single node onto tail of list
- */
-LIB_EXPORT void CC SLListPushTail ( SLList *sl, SLNode *n )
-{
-    if ( sl != NULL && n != NULL )
-    {
-        if ( sl -> tail == NULL )
-            sl -> head = sl -> tail = n;
-        else
-        {
-            sl -> tail -> next = n;
-            sl -> tail = n;
-        }
-        n -> next = NULL;
-    }
-}
-
-/* SLListPopHead
- *  pop a single node from head of list
- */
-LIB_EXPORT SLNode* CC SLListPopHead ( SLList *sl )
-{
-    if ( sl != NULL )
-    {
-        SLNode *n = sl -> head;
-        if ( n != NULL )
-        {
-            sl -> head = n -> next;
-            if ( n -> next == NULL )
-                sl -> tail = NULL;
-        }
-        return n;
-    }
-    return NULL;
-}
-
-/* SLListPopTail
- *  pop a single node from tail of list
- */
-LIB_EXPORT SLNode* CC SLListPopTail ( SLList *sl )
-{
-    if ( sl != NULL )
-    {
-        SLNode *n = sl -> head;
-        if ( n != NULL )
-        {
-            SLNode *tail = sl -> tail;
-            if ( n == tail )
-            {
-                sl -> head = sl -> tail = NULL;
-                return n;
-            }
-            while ( n -> next != tail )
-                n = n -> next;
-            sl -> tail = n;
-            n -> next = NULL;
-            return tail;
-        }
-    }
-    return NULL;
-}
-
-/* SLListUnlink
- *  removes a designated node from list
- */
-LIB_EXPORT void CC SLListUnlink ( SLList *sl, SLNode *n )
-{
-    if ( sl != NULL && n != NULL )
-    {
-        SLNode *p = sl -> head;
-        if ( p == n )
-        {
-            sl -> head = p -> next;
-            if ( p -> next == NULL )
-                sl -> tail = NULL;
-        }
-        else while ( p != NULL )
-        {
-            if ( p -> next == n )
-            {
-                p -> next = n -> next;
-                if ( n -> next == NULL )
-                    sl -> tail = p;
-                break;
-            }
-            p = p -> next;
-        }
-    }
-}
-
-/* SLListForEach
- *  executes a function on each list element
- */
-LIB_EXPORT void CC SLListForEach ( const SLList *sl,
-    void ( CC * f ) ( SLNode *n, void *data ), void *data )
-{
-    if ( sl != NULL )
-    {
-        SLNode *n = sl -> head;
-        while ( n != NULL )
-        {
-            SLNode *next = n -> next;
-            ( * f ) ( n, data );
-            n = next;
-        }
-    }
-}
-
-/* SLListDoUntil
- *  executes a function on each element
- *  until the function returns true
- */
-LIB_EXPORT bool CC SLListDoUntil ( const SLList *sl,
-    bool ( CC * f ) ( SLNode *n, void *data ), void *data )
-{
-    if ( sl )
-    {
-        SLNode *n = sl -> head;
-        while ( n != NULL )
-        {
-            SLNode *next = n -> next;
-            if ( ( * f ) ( n, data ) )
-                return true;
-            n = next;
-        }
-    }
-
-    return false;
-}
-
-/* SLListFindFirst
- *  find first element satisfying criteria
- */
-LIB_EXPORT SLNode* CC SLListFindFirst ( const SLList *sl,
-    bool ( CC * f ) ( const SLNode *n ) )
-{
-    if ( sl != NULL )
-    {
-        SLNode *n = sl -> head;
-        while ( n != NULL )
-        {
-            SLNode *next = n -> next;
-            if ( ( * f ) ( n ) )
-                return n;
-            n = next;
-        }
-    }
-    return NULL;
-}
-
-/* SLListWhack
- *  pops elements from list and
- *  executes a user provided destructor
- */
-LIB_EXPORT void CC SLListWhack ( SLList *sl, 
-    void ( CC * whack ) ( SLNode *n, void *data ), void *data )
-{
-    if ( sl != NULL )
-    {
-        SLNode *n = sl -> head;
-        sl -> head = sl -> tail = NULL;
-
-        if ( whack != NULL )
-        {
-            while ( n != NULL )
-            {
-                SLNode *next = n -> next;
-                ( * whack ) ( n, data );
-                n = next;
-            }
-        }
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * DLNode
- *  doubly linked node
- */
-
-#if 0
-/* DLNodeFindNext
- *  find next element satisfying criteria
- */
-LIB_EXPORT DLNode* CC DLNodeFindNext ( const DLNode *p, 
-    bool ( CC * f ) ( const DLNode *n ) )
-{
-    if ( p != NULL )
-    {
-        DLNode *n = p -> next;
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = n -> next;
-        }
-    }
-    return NULL;
-}
-
-/* DLNodeFindPrev
- *  find previous element satisfying criteria
- */
-LIB_EXPORT DLNode* CC DLNodeFindPrev ( const DLNode *p,
-    bool ( CC * f ) ( const DLNode *n ) )
-{
-    if ( p != NULL )
-    {
-        DLNode *n = p -> prev;
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = n -> prev;
-        }
-    }
-    return NULL;
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * DLList
- *  doubly linked list
- */
-
-/* DLListPushHead
- *  push a single node onto the head of list
- */
-LIB_EXPORT void CC DLListPushHead ( DLList *dl, DLNode *n )
-{
-    if ( dl != NULL && n != NULL )
-    {
-        n -> prev = NULL;
-        n -> next = dl -> head;
-        if ( dl -> head == NULL )
-            dl -> head = dl -> tail = n;
-        else
-        {
-            dl -> head -> prev = n;
-            dl -> head = n;
-        }
-    }
-}
-
-/* DLListPushTail
- *  push a single node onto the tail of list
- */
-LIB_EXPORT void CC DLListPushTail ( DLList *dl, DLNode *n )
-{
-    if ( dl != NULL && n != NULL )
-    {
-        n -> next = NULL;
-        n -> prev = dl -> tail;
-        if ( dl -> tail == NULL )
-            dl -> tail = dl -> head = n;
-        else
-        {
-            dl -> tail -> next = n;
-            dl -> tail = n;
-        }
-    }
-}
-
-/* DLListPopHead
- *  pop a single node from head of list
- */
-LIB_EXPORT DLNode* CC DLListPopHead ( DLList *dl )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n = dl -> head;
-        if ( dl -> head != NULL )
-        {
-            dl -> head = n -> next;
-            if ( n -> next == NULL )
-                dl -> tail = NULL;
-            else
-                n -> next -> prev = NULL;
-        }
-        return n;
-    }
-    return NULL;
-}
-
-/* DLListPopTail
- *  pop a single node from tail of list
- */
-LIB_EXPORT DLNode* CC DLListPopTail ( DLList *dl )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n = dl -> tail;
-        if ( dl -> tail != NULL )
-        {
-            dl -> tail = n -> prev;
-            if ( n -> prev == NULL )
-                dl -> head = NULL;
-            else
-                n -> prev -> next = NULL;
-        }
-        return n;
-    }
-    return NULL;
-}
-
-/* DLListPrependList
- *  pushes list contents onto the head of target
- */
-LIB_EXPORT void CC DLListPrependList ( DLList *dl, DLList *l )
-{
-    if ( dl != NULL && l != NULL && l -> head != NULL )
-    {
-        if ( dl -> tail == NULL )
-            * dl = * l;
-        else
-        {
-            dl -> head -> prev = l -> tail;
-            l -> tail -> next = dl -> head;
-            dl -> head = l -> head;
-        }
-
-        l -> head = l -> tail = NULL;
-    }
-}
-
-/* DLListAppendList
- *  pushes list contents onto the tail of target
- */
-LIB_EXPORT void CC DLListAppendList ( DLList *dl, DLList *l )
-{
-    if ( dl != NULL && l != NULL && l -> head != NULL )
-    {
-        if ( dl -> tail == NULL )
-            * dl = * l;
-        else
-        {
-            dl -> tail -> next = l -> head;
-            l -> head -> prev = dl -> tail;
-            dl -> tail = l -> tail;
-        }
-
-        l -> head = l -> tail = NULL;
-    }
-}
-
-/* DLListInsertNodeBefore
- *  inserts node "n" before "which" within list
- */
-LIB_EXPORT void CC DLListInsertNodeBefore ( DLList *dl, DLNode *which, DLNode *n )
-{
-    if ( which != NULL && n != NULL )
-    {
-        /* take care of "n" */
-        n -> next = which;
-        n -> prev = which -> prev;
-
-        /* link "which"'s prev to "n" */
-        if ( which -> prev != NULL )
-            which -> prev -> next = n;
-
-        /* or if none, then perhaps head of list */
-        else if ( dl != NULL && dl -> head == which )
-            dl -> head = n;
-
-        /* link "which" to "n" */
-        which -> prev = n;
-    }
-}
-
-/* DLListInsertNodeAfter
- *  inserts node "n" after "which" within list
- */
-LIB_EXPORT void CC DLListInsertNodeAfter ( DLList *dl, DLNode *which, DLNode *n )
-{
-    if ( which != NULL && n != NULL )
-    {
-        /* take care of "n" */
-        n -> prev = which;
-        n -> next = which -> next;
-
-        /* link "which"'s next to "n" */
-        if ( which -> next != NULL )
-            which -> next -> prev = n;
-
-        /* or if none, then perhaps tail of list */
-        else if ( dl != NULL && dl -> tail == which )
-            dl -> tail = n;
-
-        /* link "which" to "n" */
-        which -> next = n;
-    }
-}
-
-/* DLListInsertListBefore
- *  inserts list "l" before "which" within list "dl"
- */
-LIB_EXPORT void CC DLListInsertListBefore ( DLList *dl, DLNode *which, DLList *l )
-{
-    if ( which != NULL && l != NULL && l -> head != NULL )
-    {
-        /* take care of inserting list */
-        l -> tail -> next = which;
-        l -> head -> prev = which -> prev;
-
-        /* link "which"'s prev to "l -> head" */
-        if ( which -> prev != NULL )
-            which -> prev -> next = l -> head;
-
-        /* or if none, then perhaps head of list */
-        else if ( dl != NULL && dl -> head == which )
-            dl -> head = l -> head;
-
-        /* link "which" to "l -> tail" */
-        which -> prev = l -> tail;
-
-        /* remove items from "l" */
-        l -> head = l -> tail = NULL;
-    }
-}
-
-/* DLListInsertListAfter
- *  inserts list "l" after "which" within list "dl"
- */
-LIB_EXPORT void CC DLListInsertListAfter ( DLList *dl, DLNode *which, DLList *l )
-{
-    if ( which != NULL && l != NULL && l -> head != NULL )
-    {
-        /* take care of inserting list */
-        l -> head -> prev = which;
-        l -> tail -> next = which -> next;
-
-        /* link "which"'s next to "l -> tail" */
-        if ( which -> next != NULL )
-            which -> next -> prev = l -> tail;
-
-        /* or if none, then perhaps tail of list */
-        else if ( dl != NULL && dl -> tail == which )
-            dl -> head = l -> tail;
-
-        /* link "which" to "l -> head" */
-        which -> next = l -> head;
-
-        /* remove items from "l" */
-        l -> head = l -> tail = NULL;
-    }
-}
-
-/* DLListUnlink
- *  removes a designated node from list
- */
-LIB_EXPORT void CC DLListUnlink ( DLList *dl, DLNode *n )
-{
-    if ( n != NULL )
-    {
-        if ( n -> next == NULL )
-        {
-            if ( dl != NULL && dl -> tail == n )
-            {
-                if ( n -> prev == NULL )
-                    dl -> head = dl -> tail = NULL;
-                else
-                {
-                    n -> prev -> next = NULL;
-                    dl -> tail = n -> prev;
-                }
-            }
-            else
-            {
-                if ( n -> prev != NULL )
-                    n -> prev -> next = NULL;
-            }
-        }
-        else if ( n -> prev == NULL )
-        {
-            n -> next -> prev = NULL;
-            if ( dl != NULL && dl -> head == n )
-                dl -> head = n -> next;
-        }
-        else
-        {
-            n -> next -> prev = n -> prev;
-            n -> prev -> next = n -> next;
-        }
-    }
-}
-
-/* DLListForEach
- *  executes a function on each list element
- */
-LIB_EXPORT void CC DLListForEach ( const DLList *dl, bool reverse,
-    void ( CC * f ) ( DLNode *n, void *data ), void *data )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n, *next;
-        if ( reverse )
-        {
-            n = dl -> tail;
-            while ( n != NULL )
-            {
-                next = n -> prev;
-                ( * f ) ( n, data );
-                n = next;
-            }
-        }
-        else
-        {
-            n = dl -> head;
-            while ( n != NULL )
-            {
-                next = n -> next;
-                ( * f ) ( n, data );
-                n = next;
-            }
-        }
-    }
-}
-
-/* DLListDoUntil
- *  executes a function on each element
- *  until the function returns 1
- */
-LIB_EXPORT bool CC DLListDoUntil ( const DLList *dl, bool reverse,
-    bool ( CC * f ) ( DLNode *n, void *data ), void *data )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n, *next;
-        if ( reverse )
-        {
-            n = dl -> tail;
-            while ( n != NULL )
-            {
-                next = n -> prev;
-                if ( ( * f ) ( n, data ) )
-                    return true;
-                n = next;
-            }
-        }
-        else
-        {
-            n = dl -> head;
-            while ( n != NULL )
-            {
-                next = n -> next;
-                if ( ( * f ) ( n, data ) )
-                    return true;
-                n = next;
-            }
-        }
-    }
-    return false;
-}
-
-/* DLListFindFirst
- *  find first element satisfying criteria
- */
-LIB_EXPORT DLNode* CC DLListFindFirst ( const DLList *dl,
-    bool ( CC * f ) ( const DLNode *n ) )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n = dl -> head;
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = n -> next;
-        }
-    }
-    return NULL;
-}
-
-/* DLListFindLast
- *  find last element satisfying criteria
- */
-LIB_EXPORT DLNode* CC DLListFindLast ( const DLList *dl,
-    bool ( CC * f ) ( const DLNode *n ) )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n = dl -> tail;
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = n -> prev;
-        }
-    }
-    return NULL;
-}
-
-/* DLListWhack
- *  pops elements from list and
- *  executes a user provided destructor
- */
-LIB_EXPORT void CC DLListWhack ( DLList *dl,
-    void ( CC * whack ) ( DLNode *n, void *data ), void *data )
-{
-    if ( dl != NULL )
-    {
-        DLNode *n = dl -> head;
-        dl -> head = dl -> tail = NULL;
-
-        if ( whack != NULL )
-        {
-            while ( n != NULL )
-            {
-                DLNode *next = n -> next;
-                ( * whack ) ( n, data );
-                n = next;
-            }
-        }
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * BSTNode
- *  b-tree node
- */
-
-#define LEFT 1
-#define RIGHT 2
-
-#define BALANCE( node ) \
-    ( ( size_t ) ( node ) -> par & 3 )
-#define ZERO_BALANCE( node ) \
-    ( * ( size_t* ) & ( node ) -> par &= ~ ( size_t ) 3 )
-#define CLR_BALANCE( node, bal ) \
-    ( * ( size_t* ) & ( node ) -> par ^= ( bal ) )
-#define SET_BALANCE( node, bal ) \
-    ( * ( size_t* ) & ( node ) -> par |= ( bal ) )
-#define LEFT_HEAVY( node ) \
-    ( ( ( size_t ) ( node ) -> par & LEFT ) != 0 )
-#define RIGHT_HEAVY( node ) \
-    ( ( ( size_t ) ( node ) -> par & RIGHT ) != 0 )
-
-#define PMASK 3
-#define BBITS( node, bal ) ( bal )
-
-#define PBITS( node ) \
-    ( ( size_t ) ( node ) -> par & PMASK )
-#define PARENT( node ) \
-    ( BSTNode* ) ( ( size_t ) ( node ) -> par & ~ ( size_t ) PMASK )
-#define SET_PARENT( node, p ) \
-    ( ( node ) -> par = ( BSTNode* ) ( ( size_t ) ( p ) | PBITS ( node ) ) )
-#define SET_PARBAL( node, p, bal ) \
-    ( ( node ) -> par = ( BSTNode* ) ( ( size_t ) ( p ) | BBITS ( node, bal ) ) )
-
-
-/* LeftMost
- *  returns the left-most child
- */
-static
-BSTNode* CC LeftMost ( BSTNode *q )
-{
-    if ( q != NULL )
-    {
-        BSTNode *p = q -> child [ 0 ];
-        while ( p != NULL )
-        {
-            q = p;
-            p = p -> child [ 0 ];
-        }
-    }
-    return q;
-}
-
-/* RightMost
- *  returns the right-most child
- */
-static
-BSTNode* CC RightMost ( BSTNode *q )
-{
-    if ( q != NULL )
-    {
-        BSTNode *p = q -> child [ 1 ];
-        while ( p != NULL )
-        {
-            q = p;
-            p = p -> child [ 1 ];
-        }
-    }
-    return q;
-}
-
-/* FirstNode
- *  the left-most node in tree
- */
-#define FirstNode( bt ) \
-    LeftMost ( ( bt ) -> root )
-
-/* LastNode
- *  the right-most node in tree
- */
-#define LastNode( bt ) \
-    RightMost ( ( bt ) -> root )
-
-/* BSTNodeNext
- *  returns next node
- */
-LIB_EXPORT BSTNode* CC BSTNodeNext ( const BSTNode *n )
-{
-    BSTNode *p;
-
-    if ( n == NULL )
-        return NULL;
-
-    p = n -> child [ 1 ];
-    if ( p == 0 )
-    {
-        BSTNode *q = ( BSTNode* ) n;
-        while ( 1 )
-        {
-            p = PARENT ( q );
-            if ( p == NULL )
-                return NULL;
-            if ( p -> child [ 0 ] == q )
-                return p;
-            q = p;
-        }
-    }
-    return LeftMost ( p );
-}
-
-/* BSTNodePrev
- *  returns prev node
- */
-LIB_EXPORT BSTNode* CC BSTNodePrev ( const BSTNode *n )
-{
-    BSTNode *p = n -> child [ 0 ];
-    if ( p == 0 )
-    {
-        BSTNode *q = ( BSTNode* ) n;
-        while ( 1 )
-        {
-            p = PARENT ( q );
-            if ( p == NULL )
-                return NULL;
-            if ( p -> child [ 1 ] == q )
-                return p;
-            q = p;
-        }
-    }
-    return RightMost ( p );
-}
-
-/* BSTNodeParent
- *  returns a parent node if there, NULL otherwise
- */
-LIB_EXPORT BSTNode* CC BSTNodeParent ( const BSTNode *n )
-{
-    if ( n != NULL )
-        return PARENT ( n );
-    return NULL;
-}
-
-/* BSTNodeFindNext
- *  find next element satisfying criteria
- */
-LIB_EXPORT BSTNode* CC BSTNodeFindNext ( const BSTNode *p,
-    bool ( CC * f ) ( const BSTNode *n ) )
-{
-    if ( p != NULL )
-    {
-        BSTNode *n = BSTNodeNext ( p );
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = BSTNodeNext ( n );
-        }
-    }
-    return NULL;
-}
-
-/* BSTNodeFindPrev
- *  find previous element satisfying criteria
- */
-LIB_EXPORT BSTNode* CC BSTNodeFindPrev ( const BSTNode *p,
-    bool ( CC * f ) ( const BSTNode *n ) )
-{
-    if ( p != NULL )
-    {
-        BSTNode *n = BSTNodePrev ( p );
-        while ( n != NULL )
-        {
-            if ( ( * f ) ( n ) )
-                return n;
-            n = BSTNodePrev ( n );
-        }
-    }
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * BSTree
- *  b-tree
- */
-
-/* BSTreeDepth
- *  returns number of layers in b-tree
- *
- *  if "exact" is 1, then the maximum
- *  depth is returned. otherwise, the depth of
- *  an arbitrary leaf node is returned
- */
-LIB_EXPORT uint32_t CC BSTreeDepth ( const BSTree *bt, bool exact )
-{
-    BSTNode *p;
-    uint32_t depth;
-
-    if ( bt == NULL || bt -> root == NULL )
-        return 0;
-
-    depth = 1;
-
-    if ( exact )
-    {
-        for ( p = FirstNode ( bt ); p != NULL; p = BSTNodeNext ( p ) )
-        {
-            BSTNode *q;
-            unsigned int ndepth;
-
-            if ( p -> child [ 0 ] != NULL || p -> child [ 1 ] != NULL )
-                continue;
-
-            for ( ndepth = 1, q = PARENT ( p ); q != NULL; q = PARENT ( q ) )
-                ++ ndepth;
-
-            if ( ndepth > depth )
-                depth = ndepth;
-        }
-    }
-    else
-    {
-        for ( p = bt -> root;; ++ depth )
-        {
-            if ( p -> child [ 0 ] != NULL )
-                p = p -> child [ 0 ];
-            else if ( p -> child [ 1 ] != NULL )
-                p = p -> child [ 1 ];
-            else
-                break;
-        }
-    }
-
-    return depth;
-}
-
-/* BSTreeFirst
- *  returns first node
- */
-LIB_EXPORT BSTNode* CC BSTreeFirst ( const BSTree *bt )
-{
-    if ( bt == NULL )
-        return NULL;
-    return FirstNode ( bt );
-}
-
-/* BSTreeLast
- *  returns last node
- */
-LIB_EXPORT BSTNode* CC BSTreeLast ( const BSTree *bt )
-{
-    if ( bt == NULL )
-        return NULL;
-    return LastNode ( bt );
-}
-
-/* BSTreeFind
- *  find an object within tree
- *  "cmp" function returns equivalent of "item" - "n"
- */
-LIB_EXPORT BSTNode* CC BSTreeFind ( const BSTree *bt, const void *item,
-    int ( CC * cmp ) ( const void *item, const BSTNode *n ) )
-{
-    if ( bt != NULL )
-    {
-        BSTNode *n = bt -> root;
-        while ( n != NULL )
-        {
-            int diff = ( * cmp ) ( item, n );
-            if ( diff == 0 )
-                return n;
-            n = n -> child [ diff > 0 ];
-        }
-    }
-    return NULL;
-}
-
-/* BSTreeInsert
- *  insert an object within tree, even if duplicate
- *  "sort" function returns equivalent of "item" - "n"
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- */
-static
-BSTNode* CC RotateRightAtY ( BSTNode *y, BSTNode *x )
-{
-    BSTNode *w = x;
-    BSTNode *z = x -> child [ 1 ];
-    y -> child [ 0 ] = z;
-    x -> child [ 1 ] = y;
-    x -> par = PARENT ( y );
-    y -> par = x;
-
-    /* patch parent link */
-    if ( z != 0 )
-        SET_PARENT ( z, y );
-
-    return w;
-}
-
-static
-BSTNode* CC RotateLeftAtY ( BSTNode *y, BSTNode *x )
-{
-    BSTNode *w = x;
-    BSTNode *z = x -> child [ 0 ];
-    y -> child [ 1 ] = z;
-    x -> child [ 0 ] = y;
-    x -> par = PARENT ( y );
-    y -> par = x;
-
-    /* patch parent link */
-    if ( z != 0 )
-        SET_PARENT ( z, y );
-
-    return w;
-}
-
-static
-BSTNode* CC RotateLeftAtXRightAtY ( BSTNode *y, BSTNode *x )
-{
-    BSTNode *w = x -> child [ 1 ];
-    BSTNode *z = w -> child [ 0 ];
-    x -> child [ 1 ] = z;
-    if ( z != 0 )
-        SET_PARENT ( z, x );
-    z = w -> child [ 1 ];
-    w -> child [ 0 ] = x;
-    y -> child [ 0 ] = z;
-    w -> child [ 1 ] = y;
-        
-    switch ( BALANCE ( w ) )
-    {
-    case 0:
-        w -> par = PARENT ( y );
-        x -> par = w;
-        y -> par = w;
-        break;
-    case LEFT:
-        w -> par = PARENT ( y );
-        x -> par = w;
-        SET_PARBAL ( y, w, RIGHT );
-        break;
-    case RIGHT:
-        w -> par = PARENT ( y );
-        SET_PARBAL ( x, w, LEFT );
-        y -> par = w;
-        break;
-    }
-
-    /* patch parent link */
-    if ( z != 0 )
-        SET_PARENT ( z, y );
-
-    return w;
-}
-
-static
-BSTNode* CC RotateRightAtXLeftAtY ( BSTNode *y, BSTNode *x )
-{
-    BSTNode *w = x -> child [ 0 ];
-    BSTNode *z = w -> child [ 1 ];
-    x -> child [ 0 ] = z;
-    if ( z != 0 )
-        SET_PARENT ( z, x );
-    z = w -> child [ 0 ];
-    w -> child [ 1 ] = x;
-    y -> child [ 1 ] = z;
-    w -> child [ 0 ] = y;
-        
-    switch ( BALANCE ( w ) )
-    {
-    case 0:
-        w -> par = PARENT ( y );
-        x -> par = w;
-        y -> par = w;
-        break;
-    case LEFT:
-        w -> par = PARENT ( y );
-        SET_PARBAL ( x, w, RIGHT );
-        y -> par = w;
-        break;
-    case RIGHT:
-        w -> par = PARENT ( y );
-        x -> par = w;
-        SET_PARBAL ( y, w, LEFT );
-        break;
-    }
-
-    /* patch parent link */
-    if ( z != 0 )
-        SET_PARENT ( z, y );
-
-    return w;
-}
-
-static
-BSTNode* CC RebalanceLeft ( BSTNode *y, BSTNode *x )
-{
-    /* detect child balance */
-    if ( LEFT_HEAVY ( x ) )
-        return RotateRightAtY ( y, x );
-
-    /* child is right heavy */
-    return RotateLeftAtXRightAtY ( y, x );
-}
-
-static
-BSTNode* CC RebalanceRight ( BSTNode *y, BSTNode *x )
-{
-    /* detect child balance */
-    if ( RIGHT_HEAVY ( x ) )
-        return RotateLeftAtY ( y, x );
-
-    /* left heavy */
-    return RotateRightAtXLeftAtY ( y, x );
-}
-
-
-static
-void CC RebalanceAfterInsert ( BSTNode **root, BSTNode *y, BSTNode *x )
-{
-    BSTNode *w, *z;
-
-    /* detect left insertion */
-    if ( y -> child [ 0 ] == x )
-    {
-        /* if y was right-heavy, done */
-        if ( RIGHT_HEAVY ( y ) )
-        {
-            CLR_BALANCE ( y, RIGHT );
-            return;
-        }
-
-        /* rebalance left insertion */
-        w = RebalanceLeft ( y, x );
-    }
-
-    /* right insertion */
-    else
-    {
-        /* if y was left-heavy, done */
-        if ( LEFT_HEAVY ( y ) )
-        {
-            CLR_BALANCE ( y, LEFT );
-            return;
-        }
-
-        /* rebalance right insertion */
-        w = RebalanceRight ( y, x );
-    }
-
-    /* fix parent to child */
-    assert ( BALANCE ( w ) == 0 );
-    z = w -> par;
-    if ( z == 0 )
-        * root = w;
-    else
-        z -> child [ z -> child [ 1 ] == y ] = w;
-}
-
-LIB_EXPORT rc_t CC BSTreeInsert ( BSTree *bt, BSTNode *n,
-    int ( CC * sort ) ( const BSTNode *n, const BSTNode *p ) )
-{
-    if ( bt != NULL && n != NULL )
-    {
-        int diff;
-
-        BSTNode *p = bt -> root;
-        BSTNode *q = NULL;
-        BSTNode *y = NULL;
-
-        while ( p != NULL )
-        {
-            diff = ( * sort ) ( n, p );
-            q = p;
-            if ( BALANCE ( p ) != 0 )
-                y = p;
-            p = p -> child [ diff > 0 ];
-        }
-
-        n -> par = q;
-        n -> child [ 0 ] = n -> child [ 1 ] = NULL;
-
-        if ( q == NULL )
-            bt -> root = n;
-        else
-        {
-            q -> child [ diff > 0 ] = n;
-
-            /* run a trace-back */
-            for ( p = n; q != y; )
-            {
-                /* this is safe because q has 0 balance */
-                BSTNode *z = q -> par;
-                if ( q -> child [ 0 ] == p )
-                    SET_BALANCE ( q, LEFT );
-                else
-                    SET_BALANCE ( q, RIGHT );
-
-                p = q;
-                q = z;
-            }
-
-            /* rebalance */
-            if ( q != NULL )
-                RebalanceAfterInsert ( & bt -> root, q, p );
-        }
-    }
-
-    /* never fails in this implementation */
-    return 0;
-}
-
-/* BSTreeInsertUnique
- *  insert an object within tree, but only if unique
- *  "sort" function returns equivalent of "item" - "n"
- *  returns non-NULL "n" upon match or NULL on success
- */
-LIB_EXPORT rc_t CC BSTreeInsertUnique ( BSTree *bt, BSTNode *n, BSTNode **exist,
-    int ( CC * sort ) ( const BSTNode *n, const BSTNode *p ) )
-{
-    if ( bt != NULL && n != NULL )
-    {
-        int diff;
-
-        BSTNode *p = bt -> root;
-        BSTNode *q = NULL;
-        BSTNode *y = NULL;
-
-        while ( p != NULL )
-        {
-            diff = ( * sort ) ( n, p );
-
-            if ( diff == 0 )
-            {
-                /* fail to insert */
-                if ( exist != NULL )
-                    * exist = p;
-                return RC ( rcCont, rcTree, rcInserting, rcNode, rcExists );
-            }
-
-            q = p;
-            if ( BALANCE ( p ) != 0 )
-                y = p;
-            p = p -> child [ diff > 0 ];
-        }
-
-        n -> par = q;
-        n -> child [ 0 ] = n -> child [ 1 ] = NULL;
-
-        if ( q == NULL )
-            bt -> root = n;
-        else
-        {
-            q -> child [ diff > 0 ] = n;
-
-            /* run a trace-back */
-            for ( p = n; q != y; )
-            {
-                /* this is safe because q has 0 balance */
-                BSTNode *z = q -> par;
-                if ( q -> child [ 0 ] == p )
-                    SET_BALANCE ( q, LEFT );
-                else
-                    SET_BALANCE ( q, RIGHT );
-
-                p = q;
-                q = z;
-            }
-
-            /* rebalance */
-            if ( q != NULL )
-                RebalanceAfterInsert ( & bt -> root, q, p );
-        }
-    }
-
-    /* only fails on existing item in this implementation */
-    return 0;
-}
-
-/* BSTreeResort
- *  an optimized removal and re-insertion of
- *  all contained elements using another function
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- */
-LIB_EXPORT void CC BSTreeResort ( BSTree *bt,
-    int ( CC * resort ) ( const BSTNode *item, const BSTNode *n ) )
-{
-    if ( bt != NULL )
-    {
-        BSTNode *p = bt -> root;
-        bt -> root = NULL;
-
-        while ( p != NULL )
-        {
-            BSTNode *q = p -> child [ 0 ];
-            if ( q == 0 )
-            {
-                q = p -> child [ 1 ];
-                BSTreeInsert ( bt, p, resort );
-            }
-            else
-            {
-                p -> child [ 0 ] = q -> child [ 1 ];
-                q -> child [ 1 ] = p;
-            }
-            p = q;
-        }
-    }
-}
-
-/* BSTreeUnlink
- *  removes a node from tree
- */
-static
-void CC RebalanceAfterUnlink ( BSTNode **root, BSTNode *q, int dir )
-{
-    while ( q != 0 )
-    {
-        BSTNode *w, *x, *y = q;
-        q = PARENT ( q );
-
-        if ( ! dir )
-        {
-            if ( q && q -> child [ 1 ] == y )
-                dir = 1;
-
-            /* simulate an increment of balance */
-            switch ( BALANCE ( y ) )
-            {
-            case 0:
-                SET_BALANCE ( y, RIGHT );
-                return;
-            case LEFT:
-                CLR_BALANCE ( y, LEFT );
-                break;
-            case RIGHT:
-                /* y has just become ++ */
-                x = y -> child [ 1 ];
-                if ( LEFT_HEAVY ( x ) )
-                {
-                    w = RotateRightAtXLeftAtY ( y, x );
-                    if ( q == 0 )
-                        * root = w;
-                    else
-                        q -> child [ dir ] = w;
-                }
-                else
-                {
-                    w = y -> child [ 1 ] = x -> child [ 0 ];
-                    x -> child [ 0 ] = y;
-                    SET_PARENT ( x, q );
-                    SET_PARENT ( y, x );
-                    if ( w != 0 )
-                        SET_PARENT ( w, y );
-                    if ( q == 0 )
-                        * root = x;
-                    else
-                        q -> child [ dir ] = x;
-                    if ( BALANCE ( x ) == 0 )
-                    {
-                        SET_BALANCE ( x, LEFT );
-                        SET_PARBAL ( y, x, RIGHT );
-                        return;
-                    }
-                    ZERO_BALANCE ( x );
-                    ZERO_BALANCE ( y );
-                    /* y = x; */
-                }
-                break;
-            }
-        }
-
-        /* symmetric case */
-        else
-        {
-            if ( q && q -> child [ 0 ] == y )
-                dir = 0;
-
-            switch ( BALANCE ( y ) )
-            {
-            case 0:
-                SET_BALANCE ( y, LEFT );
-                return;
-            case LEFT:
-                /* y has just become -- */
-                x = y -> child [ 0 ];
-                if ( RIGHT_HEAVY ( x ) )
-                {
-                    w = RotateLeftAtXRightAtY ( y, x );
-                    if ( q == 0 )
-                        * root = w;
-                    else
-                        q -> child [ dir ] = w;
-                }
-                else
-                {
-                    w = x -> child [ 1 ];
-                    y -> child [ 0 ] = w;
-                    x -> child [ 1 ] = y;
-                    SET_PARENT ( x, q );
-                    SET_PARENT ( y, x );
-                    if ( w != 0 )
-                        SET_PARENT ( w, y );
-                    if ( q == 0 )
-                        * root = x;
-                    else
-                        q -> child [ dir ] = x;
-                    if ( BALANCE ( x ) == 0 )
-                    {
-                        SET_BALANCE ( x, RIGHT );
-                        SET_PARBAL ( y, x, LEFT );
-                        return;
-                    }
-                    ZERO_BALANCE ( x );
-                    ZERO_BALANCE ( y );
-                    /* y = x; */
-                }
-                break;
-            case RIGHT:
-                CLR_BALANCE ( y, RIGHT );
-                break;
-            }
-        }
-    }
-}
-
-static
-void CC BTUnlink ( BSTNode **root, BSTNode *p, int dir )
-{
-    BSTNode *q = PARENT ( p );
-    BSTNode *l, *r = p -> child [ 1 ];
-    if ( r == 0 )
-    {
-      /* no right child - simple unlink */
-        l = p -> child [ 0 ];
-        if ( q == 0 )
-            * root = l;
-        else
-            q -> child [ dir ] = l;
-        if ( l != 0 )
-            SET_PARENT ( l, q );
-    }
-    else
-    {
-      /* have a right child - check its left */
-        l = r -> child [ 0 ];
-        if ( l == 0 )
-        {
-            l = p -> child [ 0 ];
-            r -> child [ 0 ] = l;
-
-            /* take not only p's parent ( q )
-            // but its balance as well */
-            r -> par = p -> par;
-
-            if ( q == 0 )
-                * root = r;
-            else
-                q -> child [ dir ] = r;
-
-            if ( l != 0 )
-                SET_PARENT ( l, r );
-
-            /* artificially reset for following */
-            q = r;
-            dir = 1;
-        }
-
-        /* involves some work */
-        else
-        {
-	  /* find smallest subsequent item */
-            r = l -> child [ 0 ];
-            while ( r != 0 )
-            {
-                l = r;
-                r = l -> child [ 0 ];
-            }
-
-            /* unlink it */
-            r = PARENT ( l );
-            r -> child [ 0 ] = l -> child [ 1 ];
-
-            /* take over doomed node */
-            l -> child [ 0 ] = p -> child [ 0 ];
-            l -> child [ 1 ] = p -> child [ 1 ];
-
-            /* take not only p's parent ( q )
-            // but its balance as well */
-            l -> par = p -> par;
-
-            /* new king pin */
-            if ( q == 0 )
-                * root = l;
-            else
-                q -> child [ dir ] = l;
-
-            /* update parent links */
-            q = l -> child [ 0 ];
-            if ( q != 0 )
-                SET_PARENT ( q, l );
-            q = l -> child [ 1 ];
-            SET_PARENT ( q, l );
-            q = r -> child [ 0 ];
-            if ( q != 0 )
-                SET_PARENT ( q, r );
-
-            q = r;
-            dir = 0;
-        }
-    }
-
-    /* now - rebalance what we've undone */
-    if ( q != 0 )
-        RebalanceAfterUnlink ( root, q, dir );
-}
-
-static
-bool CC BSTreeContains ( const BSTNode *root, const BSTNode *n )
-{
-    while ( n != NULL )
-    {
-        if ( n == root )
-            return true;
-        n = PARENT ( n );
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC BSTreeUnlink ( BSTree *bt, BSTNode *n )
-{
-    if ( bt != NULL && BSTreeContains ( bt -> root, n ) )
-    {
-        int dir = 0;
-        BSTNode *q = PARENT ( n );
-        if ( q != 0 )
-        {
-            assert ( q -> child [ 0 ] == n || q -> child [ 1 ] == n );
-            dir = q -> child [ 1 ] == n;
-        }
-        BTUnlink ( & bt -> root, n, ( int ) dir );
-        return true;
-    }
-    return false;
-}
-
-/* BSTreeForEach
- *  executes a function on each tree element
- */
-LIB_EXPORT void CC BSTreeForEach ( const BSTree *bt, bool reverse,
-    void ( CC * f ) ( BSTNode *n, void *data ), void *data )
-{
-    if ( bt != NULL )
-    {
-        BSTNode *n, *next;
-        if ( reverse )
-        {
-            n = LastNode ( bt );
-            while ( n != NULL )
-            {
-                next = BSTNodePrev ( n );
-                ( * f ) ( n, data );
-                n = next;
-            }
-        }
-        else
-        {
-            n = FirstNode ( bt );
-            while ( n != NULL )
-            {
-                next = BSTNodeNext ( n );
-                ( * f ) ( n, data );
-                n = next;
-            }
-        }
-    }
-}
-
-/* BSTreeDoUntil
- *  executes a function on each element
- *  until the function returns 1
- */
-LIB_EXPORT bool CC BSTreeDoUntil ( const BSTree *bt, bool reverse,
-    bool ( CC * f ) ( BSTNode *n, void *data ), void *data )
-{
-    if ( bt != NULL )
-    {
-        BSTNode *n, *next;
-        if ( reverse )
-        {
-            n = LastNode ( bt );
-            while ( n != NULL )
-            {
-                next = BSTNodePrev ( n );
-                if ( ( * f ) ( n, data ) )
-                    return true;
-                n = next;
-            }
-        }
-        else
-        {
-            n = FirstNode ( bt );
-            while ( n != NULL )
-            {
-                next = BSTNodeNext ( n );
-                if ( ( * f ) ( n, data ) )
-                    return true;
-                n = next;
-            }
-        }
-    }
-    return false;
-}
-
-/* BSTreeWhack
- *  removes nodes from tree and
- *  executes a user provided destructor
- */
-LIB_EXPORT void CC BSTreeWhack ( BSTree *bt,
-    void ( CC * whack ) ( BSTNode *n, void *data ), void *data )
-{
-    if ( bt != NULL )
-    {
-        BSTNode *p = bt -> root;
-        bt -> root = NULL;
-
-        if ( whack != NULL )
-        {
-            while ( p != NULL )
-            {
-                BSTNode *q = p -> child [ 0 ];
-                if ( q == 0 )
-                {
-                    q = p -> child [ 1 ];
-                    ( * whack ) ( p, data );
-                }
-                else
-                {
-                    p -> child [ 0 ] = q -> child [ 1 ];
-                    q -> child [ 1 ] = p;
-                }
-                p = q;
-            }
-        }
-    }
-}
diff --git a/libs/klib/cp1252.c b/libs/klib/cp1252.c
deleted file mode 100644
index 21734d9..0000000
--- a/libs/klib/cp1252.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <sysalloc.h>
-#include <stdint.h>
-
-LIB_EXPORT const uint32_t cp1252 [ 128 ] =
-{
-    /*0x80   0x81   0x82   0x83   0x84   0x85   0x86   0x87*/
-    0x20AC,0x0000,0x201A,0x0192,0x201E,0x201E,0x201E,0x201E,
-    /*0x88   0x89   0x8A   0x8B   0x8C   0x8D   0x8E   0x8F*/
-    0x201E,0x201E,0x201E,0x201E,0x201E,0x0000,0x201E,0x0000,
-    /*0x90   0x91   0x92   0x93   0x94   0x95   0x96   0x97*/
-    0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
-    /*0x98   0x99   0x9A   0x9B   0x9C   0x9D   0x9E   0x9F*/
-    0x02DC,0x2122,0x0161,0x203A,0x0153,0x0000,0x017E,0x0178,
-    /*0xA0   0xA1   0xA2   0xA3   0xA4   0xA5   0xA6   0xA7*/
-    0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
-    /*0xA8   0xA9   0xAA   0xAB   0xAC   0xAD   0xAE   0xAF*/
-    0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
-    /*0xB0   0xB1   0xB2   0xB3   0xB4   0xB5   0xB6   0xB7*/
-    0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
-    /*0xB8   0xB9   0xBA   0xBB   0xBC   0xBD   0xBE   0xBF*/
-    0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
-    /*0xC0   0xC1   0xC2   0xC3   0xC4   0xC5   0xC6   0xC7*/
-    0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
-    /*0xC8   0xC9   0xCA   0xCB   0xCC   0xCD   0xCE   0xCF*/
-    0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
-    /*0xD0   0xD1   0xD2   0xD3   0xD4   0xD5   0xD6   0xD7*/
-    0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
-    /*0xD8   0xD9   0xDA   0xDB   0xDC   0xDD   0xDE   0xDF*/
-    0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
-    /*0xE0   0xE1   0xE2   0xE3   0xE4   0xE5   0xE6   0xE7*/
-    0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
-    /*0xE8   0xE9   0xEA   0xEB   0xEC   0xED   0xEE   0xEF*/
-    0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
-    /*0xF0   0xF1   0xF2   0xF3   0xF4   0xF5   0xF6   0xF7*/
-    0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
-    /*0xF8   0xF9   0xFA   0xFB   0xFC   0xFD   0xFE   0xFF*/
-    0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
-};
diff --git a/libs/klib/crc32.c b/libs/klib/crc32.c
deleted file mode 100644
index 8a06596..0000000
--- a/libs/klib/crc32.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/checksum.h>
-#include <sysalloc.h>
-
-/*--------------------------------------------------------------------------
- * CRC32
- */
-static
-uint32_t sCRC32_tbl [ 256 ];
-
-/* CRC32Init
- *  initializes table
- *  IDEMPOTENT
- */
-LIB_EXPORT void CC CRC32Init ( void )
-{
-    static int beenHere = 0;
-    if ( ! beenHere )
-    {
-        int i, j;
-        int32_t kPoly32 = 0x04C11DB7;
-        
-        for ( i = 0; i < 256; ++ i )
-        {
-            int32_t byteCRC = i << 24;
-            for ( j = 0; j < 8; ++ j )
-            {
-                if ( byteCRC < 0 )
-                    byteCRC = ( byteCRC << 1 ) ^ kPoly32;
-                else
-                    byteCRC <<= 1;
-            }
-            sCRC32_tbl [ i ] = byteCRC;
-        }
-
-        beenHere = 1;
-    }
-}
-
-/* CRC32
- *  runs checksum on arbitrary data, returning result
- *  initial checksum to be passed in is 0
- *  subsequent checksums should be return from prior invocation
- */
-LIB_EXPORT uint32_t CC CRC32 ( uint32_t checksum, const void *data, size_t size )
-{
-    size_t j;
-
-#define str ( ( const unsigned char* ) data )
-
-    if ( sCRC32_tbl [ 0 ] == sCRC32_tbl [ 1 ] )
-        CRC32Init();
-
-    for ( j = 0; j < size; ++ j )
-    {
-        uint32_t i = ( checksum >> 24 ) ^ str [ j ];
-        checksum <<= 8;
-        checksum ^= sCRC32_tbl [ i ];
-    }
-    return checksum;
-    
-#undef str
-}
diff --git a/libs/klib/data-buffer.c b/libs/klib/data-buffer.c
deleted file mode 100644
index fb4d21d..0000000
--- a/libs/klib/data-buffer.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <atomic32.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#if _DEBUGGING
-#define DEBUG_MALLOC_FREE 1
-#include <stdio.h>
-#endif
-
-/*--------------------------------------------------------------------------
- * KDataBufferImpl
- */
-typedef struct buffer_impl_t buffer_impl_t;
-struct buffer_impl_t {
-    size_t allocated;
-    atomic32_t refcount;
-#if DEBUG_MALLOC_FREE
-    uint32_t foo;
-#endif
-};
-
-static size_t roundup(size_t value, unsigned bits)
-{
-    size_t const mask = (((size_t)1u) << bits) - 1;
-    return (value + mask) & (~mask);
-}
-
-static
-rc_t allocate(buffer_impl_t **target, size_t capacity) {
-    buffer_impl_t *y = malloc(capacity + sizeof(*y));
-
-    if (y == NULL)
-        return RC(rcRuntime, rcBuffer, rcAllocating, rcMemory, rcExhausted);
-
-    y->allocated = capacity;
-    atomic32_set(&y->refcount, 1);
-    
-#if DEBUG_MALLOC_FREE
-    y->foo = 0;
-#endif
-
-    *target = y;
-    return 0;
-}
-
-static buffer_impl_t *add_ref(buffer_impl_t *self) {
-    atomic32_inc(&self->refcount);
-    return self;
-}
-
-static buffer_impl_t *test_add_ref(buffer_impl_t *self) {
-    if (self) add_ref(self);
-    return self;
-}
-
-static void release(buffer_impl_t *self) {
-    int32_t refcount = atomic32_read_and_add(&self->refcount, -1);
-    
-    if (refcount == 1) {
-#if DEBUG_MALLOC_FREE
-        if (self->foo != 0) {
-            fprintf(stderr, "DIE DIE\n");
-        }
-        self->foo = 55;
-#endif
-        free(self);
-    }
-#if DEBUG_MALLOC_FREE
-    else if (refcount < 1) {
-        fprintf(stderr, "ALREADY DEAD\n");
-    }
-#endif
-}
-
-/* always returns object (new or original) with refcount == 1 */
-static rc_t reallocate(buffer_impl_t **target, size_t capacity) {
-    buffer_impl_t *temp;
-    buffer_impl_t *self = *target;
-
-    if (capacity <= self->allocated)
-        return 0;
-
-    /* check reference count for copies */
-    if (atomic32_read(&self->refcount) <= 1)
-    {
-        temp = realloc(self, capacity + sizeof(*temp));
-        if (temp == NULL)
-            return RC(rcRuntime, rcBuffer, rcResizing, rcMemory, rcExhausted);
-    }
-    else
-    {
-        temp = malloc(capacity + sizeof(*temp));
-        if (temp == NULL)
-            return RC(rcRuntime, rcBuffer, rcResizing, rcMemory, rcExhausted);
-        memcpy(temp, self, self->allocated + sizeof(*temp));
-        release(self);
-    }
-    self = temp;
-    self->allocated = capacity;
-    atomic32_set(&self->refcount, 1);
-    *target = self;
-
-    return 0;
-}
-
-static rc_t shrink(buffer_impl_t **target, size_t capacity)
-{
-    buffer_impl_t *self = *target;
-    
-    if (capacity < self->allocated && atomic32_read(&self->refcount) == 1) {
-        buffer_impl_t *temp = realloc(self, capacity + sizeof(*temp));
-        
-        if (temp == NULL)
-            return RC(rcRuntime, rcBuffer, rcResizing, rcMemory, rcExhausted);
-
-        temp->allocated = capacity;
-        *target = temp;
-    }
-    return 0;
-}
-
-/*
- either returns original with refcount == 2
- or returns new copy with refcount == 1
- */
-static buffer_impl_t* make_copy(buffer_impl_t *self) {
-    if (atomic32_read_and_add_eq(&self->refcount, 1, 1)==1)
-        return self;
-    else {
-        buffer_impl_t *copy = malloc(self->allocated + sizeof(*self));
-        if (copy) {
-            memcpy(copy, self, self->allocated + sizeof(*copy));
-            atomic32_set(&copy->refcount, 1);
-        }
-        return copy;
-    }
-}
-
-static void const *get_data(buffer_impl_t const *self)
-{
-    return &self[1];
-}
-
-static void const *get_data_endp(buffer_impl_t const *self)
-{
-    return (uint8_t const *)get_data(self) + self->allocated;
-}
-
-static
-rc_t buffer_impl_check_integrity (buffer_impl_t const *self, uint8_t const *base, size_t offset, size_t size)
-{
-    void const *const endp = &base[size+offset];
-
-    if (self == NULL)
-        return 0;
-
-    /* refcount is of major importance */
-    if (atomic32_read (& self->refcount) <= 0)
-        return RC (rcRuntime, rcBuffer, rcValidating, rcBuffer, rcDestroyed);
-
-#if DEBUG_MALLOC_FREE
-    if (self->foo != 0)
-        return RC (rcRuntime, rcBuffer, rcValidating, rcBuffer, rcDestroyed);
-#endif
-
-    if ((void const *)base < get_data(self) || get_data_endp(self) < endp)
-        return RC (rcRuntime, rcBuffer, rcValidating, rcData, rcCorrupt);
-
-    return 0;
-}
-
-/* Make
- *  create a new empty buffer
- *
- *  "buffer" [ OUT ] - pointer to structure to initialize
- *
- *  "capacity" [ IN ] - the number of bytes to be allocated
- */
-LIB_EXPORT rc_t CC KDataBufferMake(KDataBuffer *target, uint64_t elem_bits, uint64_t elem_count) {
-    rc_t rc;
-    size_t bytes;
-    buffer_impl_t **impp;
-    
-    if (target == NULL)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcNull);
-
-    impp = (buffer_impl_t **)&target->ignore;
-    
-    bytes = roundup((elem_bits * elem_count + 7) / 8, 12);
-    if (8 * (uint64_t)bytes < elem_bits * elem_count)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcTooBig);
-    
-    memset (target, 0, sizeof(*target));
-
-    rc = allocate(impp, bytes);
-    if (rc == 0) {
-        target->base = (void *)get_data(*impp);
-        target->elem_bits = elem_bits;
-        target->elem_count = elem_count;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDataBufferResize(KDataBuffer *self, uint64_t new_count) {
-    rc_t rc;
-    buffer_impl_t *imp;
-    buffer_impl_t *new_imp;
-    size_t new_size;
-    uint64_t bits;
-    const uint8_t *new_end;
-    const uint8_t *cur_end;
-    
-    if (self == NULL)
-    	return RC(rcRuntime, rcBuffer, rcResizing, rcParam, rcNull);
-
-    if (new_count == 0) {
-        self->elem_count = 0;
-        return 0; /*** no change for empty data ***/
-    }
-
-    bits = self->elem_bits * new_count;
-    if (((bits + 7) >> 35) != 0)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcTooBig);
-    
-    imp = (buffer_impl_t *)self->ignore;
-    if (imp == NULL) {
-        /* new buffer */
-        rc = allocate(&imp, roundup((bits + 7) / 8, 12));
-        if (rc == 0) {
-            self->ignore = imp;
-            self->base = (void *)get_data(imp);
-            self->elem_count = new_count;
-        }
-        return rc;
-    }
-
-    cur_end = &((const uint8_t *)imp)[imp->allocated + sizeof *imp];
-    new_end = &((const uint8_t *)self->base)[(bits + self->bit_offset + 7) >> 3];
-    if (cur_end >= new_end) {
-        /* requested end-of-buffer is within current allocation; realloc not required */
-        self->elem_count = new_count;
-        return 0;
-    }
-
-    if (!KDataBufferWritable(self))
-        return RC(rcRuntime, rcBuffer, rcResizing, rcSelf, rcReadonly);
-    
-    new_size = roundup((bits + 7) / 8, 12);
-    if (self->base == get_data(imp) && self->bit_offset == 0) {
-        rc = reallocate(&imp, new_size);
-        if (rc == 0) {
-            self->ignore = imp;
-            self->base = (void *)get_data(imp);
-            self->elem_count = new_count;
-        }
-        return rc;
-    }
-
-    /* is sub-buffer but is sole reference */
-    rc = allocate(&new_imp, roundup(new_size, 12));
-    if (rc == 0) {
-        memcpy((void *)get_data(new_imp), self->base, new_size);
-        release(imp);
-        self->base = (void *)get_data(new_imp);
-        self->ignore = new_imp;
-        self->elem_count = new_count;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDataBufferSub (const KDataBuffer *self,
-    KDataBuffer *target, uint64_t start, uint64_t count)
-{
-    if (self == NULL || target == NULL)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcNull);
-    
-    if (self->ignore == NULL) {
-        if (start > 0 || count < UINT64_MAX)
-            return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcNull);
-        *target = *self;
-        return 0;
-    }
-    if ((const KDataBuffer *)target != self) {
-        *target = *self;
-        target->ignore = add_ref((buffer_impl_t *)self->ignore);
-    }
-    {
-        buffer_impl_t *imp = (buffer_impl_t *)self->ignore;
-        bitsz_t offset = self->bit_offset + (((bitsz_t)((uint8_t const *)self->base - (uint8_t const *)get_data(imp))) << 3);
-        
-        if (start > self->elem_count){
-            start = self->elem_count;
-            count = 0;
-        }
-        else if (count > self->elem_count) {
-            count = self->elem_count;
-        }
-        if (start + count > self->elem_count) {
-            count = self->elem_count - start;
-        }
-        target->elem_count = count;
-        offset += (bitsz_t)start * self->elem_bits;
-        target->base = &((uint8_t *)get_data(imp))[offset >> 3];
-        target->bit_offset = (uint8_t)offset & 0x07;
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDataBufferCast(const KDataBuffer *self, KDataBuffer *target, uint64_t new_elem_bits, bool can_shrink) {
-    bitsz_t bits;
-    size_t new_elem_count;
-    bitsz_t new_bits;
-
-    if (self == NULL)
-        return RC (rcRuntime, rcBuffer, rcCasting, rcSelf, rcNull);
-    if (target == NULL)
-    	return RC (rcRuntime, rcBuffer, rcCasting, rcParam, rcNull);
-    if (new_elem_bits == 0)
-    	return RC (rcRuntime, rcBuffer, rcCasting, rcParam, rcInvalid);
-    
-    bits = KDataBufferBits(self);
-    new_elem_count = bits / new_elem_bits;
-    new_bits = new_elem_bits * new_elem_count;
-    
-    if (new_bits == bits || (can_shrink && new_bits < bits)) {
-        if ((const KDataBuffer *)target != self) {
-            *target = *self;
-            target->ignore = test_add_ref((buffer_impl_t *)self->ignore);
-        }
-        target->elem_count = new_elem_count;
-        target->elem_bits = new_elem_bits;
-        return 0;
-    }
-    return RC(rcRuntime, rcBuffer, rcCasting, rcParam, rcInvalid);
-}
-
-LIB_EXPORT rc_t CC KDataBufferMakeWritable (const KDataBuffer *cself, KDataBuffer *target)
-{
-    if (cself == NULL)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcNull);
-    
-    if (target == NULL)
-    	return RC(rcRuntime, rcBuffer, rcConstructing, rcParam, rcNull);
-
-    if ((KDataBuffer const *)target != cself)
-        memset(target, 0, sizeof(*target));
-    
-    if (cself->ignore == NULL)
-        return KDataBufferMake(target, cself->elem_bits, cself->elem_count);
-    else {
-        buffer_impl_t *self = (buffer_impl_t *)cself->ignore;
-        buffer_impl_t *copy;
-        
-        if (cself->base == get_data(self) && cself->bit_offset == 0) {
-            /* not a sub-buffer */
-            copy = make_copy(self);
-            if (copy) {
-                if ((KDataBuffer const *)target == cself)
-                    release(self);
-                else 
-                    *target = *cself;
-                target->ignore = copy;
-                target->base = (uint8_t *)get_data(copy);
-                
-                return 0;
-            }
-            return RC(rcRuntime, rcBuffer, rcAllocating, rcMemory, rcExhausted);
-        }
-        else if (atomic32_read(&self->refcount) == 1) {
-            /* sub-buffer but is only reference so let it be */
-            if ((KDataBuffer const *)target != cself) {
-                *target = *cself;
-                atomic32_set(&self->refcount, 2);
-            }
-            return 0;
-        }
-        else {
-            /* sub-buffer so make new and copy */
-            rc_t rc;
-            
-            rc = allocate(&copy, roundup(KDataBufferBytes(cself), 12));
-            if (rc == 0) {
-                if (cself->bit_offset == 0)
-                    memcpy((void *)get_data(copy), cself->base, KDataBufferBytes(cself));
-                else
-                    bitcpy((void *)get_data(copy), 0, cself->base, cself->bit_offset, KDataBufferBits(cself));
-
-                if ((const KDataBuffer *)target == cself)
-                    release(self);
-                else 
-                    *target = *cself;
-                target->ignore = copy;
-                target->base = (uint8_t *)get_data(copy);
-                target->bit_offset = 0;
-                return 0;
-            }
-            return rc;
-        }
-    }
-}
-
-LIB_EXPORT rc_t CC KDataBufferWhack (KDataBuffer *self)
-{
-    if (self)
-    {
-        if (self->ignore)
-            release((buffer_impl_t *)self->ignore);
-
-        memset(self, 0, sizeof(*self));
-    }
-    return 0;
-}
-
-LIB_EXPORT bool CC KDataBufferWritable(const KDataBuffer *cself)
-{
-    return (cself != NULL && cself->ignore != NULL &&
-            atomic32_read(&((buffer_impl_t *)cself->ignore)->refcount) == 1) ? true : false;
-}
-
-LIB_EXPORT rc_t CC KDataBufferShrink(KDataBuffer *self)
-{
-    if (self && self->ignore) {
-        return shrink((buffer_impl_t **)&self->ignore,
-            (self->elem_bits * self->elem_count + self->bit_offset + 7) / 8);
-    }
-    return 0;
-}
-
-LIB_EXPORT size_t CC KDataBufferMemorySize(KDataBuffer const *self)
-{
-    if (self && self->ignore) {
-        return ((buffer_impl_t const *)self->ignore)->allocated + sizeof(buffer_impl_t);
-    }
-    return 0;
-}
-
-/* CheckIntegrity
- *  performs some level of integrity checking on buffer structure
- */
-LIB_EXPORT rc_t CC KDataBufferCheckIntegrity (const KDataBuffer *self)
-{
-    /* whether NULL is allowed is determined by caller */
-    if (self == NULL)
-        return RC (rcRuntime, rcBuffer, rcValidating, rcSelf, rcNull);
-
-    /* elem-bits must not be 0, unless there is no allocation */
-    if (self->elem_bits == 0)
-    {
-        if (self->elem_count == 0 && self->bit_offset == 0 && self->ignore == NULL) {
-            /* no allocation */
-            return 0;
-        }
-	    return RC (rcRuntime, rcBuffer, rcValidating, rcSelf, rcCorrupt);
-    }
-
-    /* if there is no allocation, check self */
-    if (self->ignore == NULL)
-    {
-        if (self->elem_count != 0 || self->bit_offset != 0)
-	    return RC (rcRuntime, rcBuffer, rcValidating, rcSelf, rcCorrupt);
-    }
-
-    /* test self against allocated buffer */
-    return buffer_impl_check_integrity (self->ignore, (const void*) self->base,
-        self->bit_offset / self->elem_bits, KDataBufferBytes (self));
-}
-
-/* 0x101e9b000 */
diff --git a/libs/klib/debug.c b/libs/klib/debug.c
deleted file mode 100644
index 64ccea7..0000000
--- a/libs/klib/debug.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#if _DEBUGGING
-
-#include <klib/extern.h>
-#include <klib/debug.h>
-#include "writer-priv.h"
-#include <sysalloc.h>
-
-/* PUT THIS IN A CORRECT PLACE */
-#define _module(mod) \
-    KDbgFlag DBG_PASTE_3(DBG_,mod,_ANY) = ( DBG_PASTE_2(mod,_CONDITIONS()) 0);
-#define _condition(mod,flag) \
-    (((KDbgFlag)1)<<DBG_PASTE_4(DBG_,mod,_,flag)) |
-
-MODULE_NAMES()
-
-#undef _module
-#undef _condition
-
-#define _module(mod)                            \
-    dbg_s_flag DBG_PASTE_2(dbg_s_flag_,mod) [] = \
-    {                                            \
-        DBG_PASTE_2(mod,_CONDITIONS())           \
-        { NULL, DBG_FLAG_NONE }                      \
-    };
-
-#define _condition(mod,flag)                                           \
-    { DBG_STRING(flag), ((KDbgFlag)1)<<DBG_PASTE_4(DBG_,mod,_,flag) },
-
-MODULE_NAMES()
-
-#undef _module
-#undef _condition
-
-#define _module(mod)                           \
-    {                                           \
-        DBG_STRING(mod),                         \
-        DBG_PASTE_2(dbg_s_flag_,mod),        \
-        0                                       \
-    },
-
-dbg_s_mod dbg_flag_mod [] = 
-{
-    MODULE_NAMES()
-    { NULL, NULL }
-};
-#undef _module
-
-#define _module(mod) 
-
-#include <klib/rc.h>
-#include <stdio.h>
-#include <string.h>
-
-KWrtHandler G_dbg_handler;
-
-/*
- * Init()
- * Initialize the debug messages module to a known state
- */
-LIB_EXPORT rc_t CC KDbgInit( void )
-{
-    KDbgHandlerSetStdErr();
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KDbgMsg ( const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    if( (rc = vkfprintf(KDbgHandlerGet (), NULL, fmt, args)) != 0 ) {
-        kfprintf(KDbgHandlerGet(), NULL, "dbgmsg failure: %R in '%s'\n", rc, fmt);
-    }
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT KDbgFlag CC KDbgCondToFlag( KDbgCond cond )
-{
-    return (((KDbgFlag)1)<<cond);
-}
-
-/*
- * For module 'mod' turn on or off the specific flags in
- * mask flags
- *
- * bits in mask are effected.
- * return previous 
- */
-LIB_EXPORT KDbgMask CC KDbgSetModConds( KDbgMod mod, KDbgMask mask, KDbgMask flags )
-{
-    KDbgMask previous;
-
-    if ((mod < 0) || (mod >= DBG_MOD_COUNT))
-    {
-        /* unmaskable debug message */
-        KDbgMsg ("%s: Undefined module: (%u)\n", __func__, mod);
-        return DBG_FLAG_NONE;
-    }
-    previous = dbg_flag_mod[mod].flags;
-
-    dbg_flag_mod[mod].flags = (flags & mask) | (previous & ~mask);
-
-    return previous;
-}
-
-
-LIB_EXPORT bool CC KDbgTestModConds( KDbgMod mod, KDbgMask flags )
-{
-    if (mod >= DBG_MOD_COUNT)
-    {
-        /* unmaskable debug message */
-        KDbgMsg ("%s: Undefined module: (%u)\n", __func__, mod);
-        return false;
-    }
-    return DBG_FLAG_NONE != (KDbgGetModFlags (mod) & flags);
-}
-
-
-/*
- * Get the KDbgMod associated with a name.
- */
-LIB_EXPORT rc_t CC KDbgGetModId( KDbgMod * mod, 
-                   const char * mod_name, size_t mod_size )
-{
-    KDbgMod idx;
-
-    for (idx = 0; idx < DBG_MOD_COUNT; ++idx)
-    {
-        if (strncmp (dbg_flag_mod[idx].name, mod_name, mod_size) == 0)
-        {
-            *mod = idx;
-            return 0;
-        }
-    }
-    *mod = DBG_MOD_NOT_FOUND;
-    return RC (rcRuntime, rcLog, rcAccessing, rcParam, rcNotFound);
-}
-
-
-/*
- * Get the KDbgCond associated with a name.
- */
-LIB_EXPORT rc_t CC KDbgGetCndFlag( KDbgMod mod, KDbgFlag * flag,
-                      const char * cnd_name, size_t cnd_size )
-{
-    const dbg_s_flag * cnd;
-
-    for (cnd = dbg_flag_mod[mod].conds; cnd->name != NULL; ++cnd)
-    {
-        if (strncmp (cnd_name, cnd->name, cnd_size) == 0)
-            break;
-    }
-    if (cnd->name == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcUndefined);
-
-    *flag = cnd->flag;
-    return 0;
-}
-
-LIB_EXPORT KDbgMask CC KDbgGetModFlags( KDbgMod mod )
-{
-    if ((mod < 0) || (mod >= DBG_MOD_COUNT))
-    {
-        /* unmaskable debug message */
-        KDbgMsg ("%s: Undefined module: (%u)\n", __func__, mod);
-        return DBG_FLAG_NONE;
-    }
-    return dbg_flag_mod[mod].flags;
-}
-
-/* 
- * param is coming in as utf-8/ASCII with NUL terminator or we fail
- * we also assume no more than 127 significant characters
- *
- * These strings can be utf-8 or ASCII even if we are using 
- * clib strXXX functions.
- */
-LIB_EXPORT rc_t CC KDbgSetString( const char * string )
-{
-    const char * mod_s;
-    const char * flag_s;
-    size_t mod_z;
-
-    KDbgMod mod;
-
-    rc_t rc;
-
-    mod_s = string;
-
-    if (mod_s == NULL)
-        return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcNull);
-    if (*mod_s == '\0')
-        return 0;
-
-    flag_s = strchr (mod_s, '-');
-    if (flag_s)
-    {
-        mod_z = (size_t)(flag_s - mod_s);
-
-        if (*(++flag_s) == '\0')
-            flag_s = NULL;
-    }
-    else
-        mod_z = strlen (mod_s);
-
-    rc = KDbgGetModId (&mod, mod_s, mod_z);
-    if (rc)
-        return rc;
-
-    /* now we have a id for the module so we need to figure out the flag */
-
-    if (flag_s == NULL)
-    {
-        dbg_flag_mod[mod].flags = ~(KDbgMask)0;
-        rc = 0;
-    }
-    else
-    {
-        const dbg_s_flag * cnd;
-
-        for (cnd = dbg_flag_mod[mod].conds; cnd->name != NULL; ++cnd)
-        {
-            if (strcmp (flag_s, cnd->name) == 0)
-                break;
-        }
-        if (cnd->name == NULL)
-            return RC (rcRuntime, rcArgv, rcAccessing, rcParam, rcUndefined);
-
-        dbg_flag_mod[mod].flags |= cnd->flag;
-
-    }
-    return 0;
-}
-
-/* -----
- * Handlers for application and library writers.
- */
-
-#undef KDbgHandlerSetStdOut
-LIB_EXPORT rc_t CC KDbgHandlerSetStdOut( void )
-{
-    return KDbgHandlerSet( KWrt_DefaultWriter,KWrt_DefaultWriterDataStdOut );
-}
-
-
-#undef KDbgHandlerSetStdErr
-LIB_EXPORT rc_t CC KDbgHandlerSetStdErr( void )
-{
-    return KDbgHandlerSet( KWrt_DefaultWriter,KWrt_DefaultWriterDataStdErr );
-}
-
-
-#undef KDbgHandlerSet
-LIB_EXPORT rc_t CC KDbgHandlerSet( KWrtWriter writer, void * writer_data )
-{
-    G_dbg_handler.writer = writer;
-    G_dbg_handler.data = writer_data;
-    return 0;
-}
-
-#undef KDbgWriterDataGet
-LIB_EXPORT void * CC KDbgWriterDataGet( void )
-{
-    return ( KDbgHandlerGet()->data );
-}
-
-
-#undef KDbgWriterGet
-LIB_EXPORT KWrtWriter CC KDbgWriterGet( void )
-{
-    return ( KDbgHandlerGet()->writer );
-}
-
-
-#undef KDbgHandlerGet
-LIB_EXPORT KWrtHandler * CC KDbgHandlerGet( void )
-{
-    return ( &G_dbg_handler );
-}
-
-#endif /* _DEBUGGING */
diff --git a/libs/klib/iso8859-1.c b/libs/klib/iso8859-1.c
deleted file mode 100644
index e62cdc9..0000000
--- a/libs/klib/iso8859-1.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <sysalloc.h>
-#include <stdint.h>
-
-LIB_EXPORT const uint32_t iso8859_1 [ 128 ] =
-{
-    /*  +       0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 */
-    /* 128 */   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-    /* 144 */   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-    /* 160 */ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
-    /* 176 */ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
-    /* 192 */ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
-    /* 208 */ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
-    /* 224 */ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
-    /* 240 */ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
-};
diff --git a/libs/klib/iso8859.c b/libs/klib/iso8859.c
deleted file mode 100644
index 0973624..0000000
--- a/libs/klib/iso8859.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-#include <assert.h>
-
-/* iso8859_utf32
- *  converts 8-bit text to a single UTF32 character
- *  returns the number of 8-bit bytes consumed, such that:
- *    return > 0 means success
- *    return == 0 means insufficient input
- *    return < 0 means bad input
- */
-LIB_EXPORT int CC iso8859_utf32 ( const uint32_t map [ 128 ],
-    uint32_t *cp, const char *begin, const char *end )
-{
-    uint32_t ch;
-
-    if ( begin == NULL || end == NULL )
-        return -1;
-    if ( begin >= end )
-        return 0;
-
-    ch = begin [ 0 ];
-    if ( begin [ 0 ] < 0 )
-    {
-        ch = map [ ch & 0x7F ];
-        if ( ch == 0 )
-            return -1;
-    }
-
-    * cp = ch;
-    return 1;
-}
-
-/* iso8859_string_size/len/measure
- *  measures UTF-16 strings
- */
-LIB_EXPORT size_t CC iso8859_string_size ( const uint32_t map [ 128 ],
-    const char *str )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0; ch = str [ ++ i ] )
-    {
-        if ( ( int ) ch < 0 && map [ ch & 0x7F ] == 0 )
-            break;
-    }
-
-    return ( size_t ) i;
-}
-
-LIB_EXPORT uint32_t CC iso8859_string_len ( const uint32_t map [ 128 ],
-    const char *str, size_t size )
-{
-    uint32_t i;
-
-    for ( i = 0; i < ( uint32_t ) size; ++ i )
-    {
-        uint32_t ch = str [ i ];
-        if ( str [ i ] < 0 && map [ ch & 0x7F ] == 0 )
-            break;
-    }
-
-    return i;
-}
-
-LIB_EXPORT uint32_t CC iso8859_string_measure ( const uint32_t map [ 128 ],
-    const char *str, size_t *size )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0; ch = str [ ++ i ] )
-    {
-        if ( ( int ) ch < 0 && map [ ch & 0x7F ] == 0 )
-            break;
-    }
-
-    * size = i;
-    return i;
-}
-
-/* conversion from ISO-8859-x to internal standard */
-LIB_EXPORT uint32_t CC iso8859_cvt_string_len ( const uint32_t map [ 128 ],
-    const char *src, size_t src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i;
-
-    for ( i = 0, size = 0; i < ( uint32_t ) src_size; ++ i )
-    {
-        uint32_t ch = src [ i ];
-        if ( src [ i ] < 0 )
-        {
-            int ch_len;
-            char ignore [ 8 ];
-
-            ch = map [ ch & 0x7F ];
-            if ( ch == 0 )
-                break;
-
-            ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-            if ( ch_len <= 0 )
-                break;
-
-            size += ch_len;
-        }
-        else
-        {
-            ++ size;
-        }
-    }
-
-    * dst_size = size;
-
-    return i;
-}
-
-LIB_EXPORT uint32_t CC iso8859_cvt_string_measure ( const uint32_t map [ 128 ],
-    const char *src, size_t *src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, ch;
-
-    for ( ch = src [ i = 0 ], size = 0; ch != 0; ch = src [ ++ i ] )
-    {
-        if ( ( int ) ch < 0 )
-        {
-            int ch_len;
-            char ignore [ 8 ];
-
-            ch = map [ ch & 0x7F ];
-            if ( ch == 0 )
-                break;
-
-            ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-            if ( ch_len <= 0 )
-                break;
-
-            size += ch_len;
-        }
-        else
-        {
-            ++ size;
-        }
-    }
-
-    * src_size = ( size_t ) i;
-    * dst_size = size;
-
-    return i;
-}
-
-LIB_EXPORT size_t CC iso8859_cvt_string_copy ( const uint32_t map [ 128 ],
-    char *dst, size_t dst_size, const char *src, size_t src_size )
-{
-    char *begin = dst;
-    char *dend = dst + dst_size;
-    const char *send = src + src_size;
-
-    while ( dst < dend && src < send )
-    {
-        int ch_len;
-        uint32_t ch = * src ++;
-        if ( ( int ) ch < 0 )
-        {
-            ch = map [ ch & 0x7F ];
-            if ( ch == 0 )
-                break;
-        }
-        ch_len = utf32_utf8 ( dst, dend, ch );
-        if ( ch_len <= 0 )
-            break;
-        dst += ch_len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-    return ( size_t ) ( dst - begin );
-}
diff --git a/libs/klib/judy-vector.c b/libs/klib/judy-vector.c
deleted file mode 100644
index 3030d8e..0000000
--- a/libs/klib/judy-vector.c
+++ /dev/null
@@ -1,892 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/vector.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#define JUST_DEFINE_YOUR_STUFF 1
-#include "Judy.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KVector
- *  encapsulated vector interface
- *
- *  a vector obeys a particular set of messages
- *  it may be implemented as an array, but not necessarily.
- *
- *  the principal property of a vector is that it acts as a map
- *  between an integer key and a value of some type. in this case,
- *  we only accept unsigned integers as keys.
- */
-struct KVector
-{
-    void *nancy;
-    KRefcount refcount;
-    uint32_t fixed_size;
-    bool nancy_bool;
-};
-
-
-/* Make
- *  create an empty vector
- */
-LIB_EXPORT rc_t CC KVectorMake ( KVector **vp )
-{
-    rc_t rc;
-
-    if ( vp == NULL )
-        rc = RC ( rcCont, rcVector, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KVector *v = calloc ( 1, sizeof * v );
-        if ( v == NULL )
-            rc = RC ( rcCont, rcVector, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            KRefcountInit ( & v -> refcount, 1, "KVector", "make", "v" );
-            * vp = v;
-            return 0;
-        }
-
-        * vp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Whack
- */
-static
-rc_t KVectorWhack ( KVector *self )
-{
-    if ( self -> nancy != NULL )
-    {
-        JError_t err;
-        Word_t whee =
-            ( self -> nancy_bool ? Judy1FreeArray : JudyLFreeArray )
-            ( & self -> nancy, & err );
-        ( void ) whee;
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KVectorAddRef ( const KVector *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KVector" ) )
-        {
-        case krefOkay:
-            break;
-        case krefLimit:
-            return RC ( rcCont, rcVector, rcAttaching, rcRange, rcExcessive );
-        default:
-            return RC ( rcCont, rcVector, rcAttaching, rcRefcount, rcDestroyed );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KVectorRelease ( const KVector *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KVector" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-        case krefZero:
-            return KVectorWhack ( ( KVector* ) self );
-        default:
-            return RC ( rcCont, rcVector, rcReleasing, rcRefcount, rcDestroyed );
-        }
-    }
-    return 0;
-}
-
-
-/* NancyError
- *  translate a JError_t to an rc_t
- */
-static
-rc_t NancyError ( const JError_t *err, enum RCContext ctx )
-{
-    switch ( JU_ERRNO ( err ) )
-    {
-    case JU_ERRNO_NONE:
-        break;
-    case JU_ERRNO_FULL:
-        return RC ( rcCont, rcVector, ctx, rcRange, rcExcessive );
-    case JU_ERRNO_NOMEM:
-        return RC ( rcCont, rcVector, ctx, rcMemory, rcExhausted );
-    case JU_ERRNO_NULLPPARRAY:
-    case JU_ERRNO_NULLPINDEX:
-        return RC ( rcCont, rcVector, ctx, rcParam, rcNull );
-    case JU_ERRNO_NOTJUDY1:
-    case JU_ERRNO_NOTJUDYL:
-    case JU_ERRNO_NOTJUDYSL:
-        return RC ( rcCont, rcVector, ctx, rcType, rcIncorrect );
-    case JU_ERRNO_OVERRUN:
-    case JU_ERRNO_CORRUPT:
-        return RC ( rcCont, rcVector, ctx, rcVector, rcCorrupt );
-    case JU_ERRNO_NONNULLPARRAY:
-    case JU_ERRNO_NULLPVALUE:
-    case JU_ERRNO_UNSORTED:
-        return RC ( rcCont, rcVector, ctx, rcParam, rcInvalid );
-    }
-
-    return 0;
-}
-
-
-/* Get
- *  get an untyped value
- *  returns rc_t state of rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for value
- *
- *  "bytes" [ OUT ] - return parameter for bytes in value
- *
- * NB - if rc_t state is rcInsufficient, "bytes" will contain
- *  the number of bytes required to access the indexed value
- */
-static
-rc_t Nancy1Test ( const void *nancy, uint64_t idx, bool *value )
-{
-    JError_t err;
-    int data = Judy1Test ( nancy, ( Word_t ) idx, & err );
-    if ( data == JERR )
-        return NancyError ( & err, rcAccessing );
-    * value = data != 0;
-    return 0;
-}
-
-static
-rc_t NancyLGet ( const void *nancy, uint64_t idx, Word_t *value )
-{
-    JError_t err;
-    PPvoid_t datap = JudyLGet ( nancy, ( Word_t ) idx, & err );
-    if ( datap == NULL )
-        return RC ( rcCont, rcVector, rcAccessing, rcItem, rcNotFound );
-    if ( datap == PPJERR )
-        return NancyError ( & err, rcAccessing );
-
-    * value = * ( const Word_t* ) datap;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KVectorGet ( const KVector *self, uint64_t key,
-    void *buffer, size_t bsize, size_t *bytes )
-{
-    rc_t rc;
-
-    if ( bytes == NULL )
-        rc = RC ( rcCont, rcVector, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcCont, rcVector, rcAccessing, rcSelf, rcNull );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcCont, rcVector, rcAccessing, rcParam, rcNull );
-        else if ( sizeof key > sizeof ( Word_t ) && ( key >> 32 ) != 0 )
-            rc = RC ( rcCont, rcVector, rcAccessing, rcRange, rcExcessive );
-        else
-        {
-            if ( self -> nancy_bool )
-            {
-                bool data;
-                rc = Nancy1Test ( self -> nancy, key, & data );
-                if ( rc == 0 )
-                {
-                    * bytes = sizeof data;
-                    if ( bsize < sizeof data )
-                        rc = RC ( rcCont, rcVector, rcAccessing, rcBuffer, rcInsufficient );
-                    else
-                        * ( bool* ) buffer = data;
-                    return rc;
-                }
-            }
-            else
-            {
-                Word_t data;
-                rc = NancyLGet ( self -> nancy, key, & data );
-                if ( rc == 0 )
-                {
-                    if ( self -> fixed_size == 0 )
-                        rc = RC ( rcCont, rcVector, rcAccessing, rcFunction, rcUnsupported );
-                    else
-                    {
-                        * bytes = self -> fixed_size;
-                        if ( bsize < self -> fixed_size )
-                            rc = RC ( rcCont, rcVector, rcAccessing, rcBuffer, rcInsufficient );
-                        else switch ( self -> fixed_size )
-                        {
-                        case 1:
-                            if ( data >= 0x100 )
-                                rc = RC ( rcCont, rcVector, rcAccessing, rcData, rcCorrupt );
-                            * ( uint8_t* ) buffer = ( uint8_t ) data;
-                            break;
-                        case 2:
-                            if ( data >= 0x10000 )
-                                rc = RC ( rcCont, rcVector, rcAccessing, rcData, rcCorrupt );
-                            * ( uint16_t* ) buffer = ( uint16_t ) data;
-                            break;
-                        case 4:
-                            if ( sizeof data > 4 && ( data >> 32 ) != 0 )
-                                rc = RC ( rcCont, rcVector, rcAccessing, rcData, rcCorrupt );
-                            * ( uint32_t* ) buffer = ( uint32_t ) data;
-                            break;
-                        case 8:
-                            * ( uint64_t* ) buffer = ( uint64_t ) data;
-                            break;
-                        default:
-                            rc = RC ( rcCont, rcVector, rcAccessing, rcType, rcUnsupported );
-                        }
-                        return rc;
-                    }
-                }
-            }
-        }
-
-        * bytes = 0;
-    }
-
-    return rc;
-}
-
-/* Get
- *  get typed values
- *  returns rc_t state of rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- *
- *  "data" [ OUT ] - return parameter for value
- */
-LIB_EXPORT rc_t CC KVectorGetBool ( const KVector *self, uint64_t key, bool *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetI8 ( const KVector *self, uint64_t key, int8_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetI16 ( const KVector *self, uint64_t key, int16_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetI32 ( const KVector *self, uint64_t key, int32_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetI64 ( const KVector *self, uint64_t key, int64_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetU8 ( const KVector *self, uint64_t key, uint8_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetU16 ( const KVector *self, uint64_t key, uint16_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetU32 ( const KVector *self, uint64_t key, uint32_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetU64 ( const KVector *self, uint64_t key, uint64_t *data )
-{
-    size_t bytes;
-    return KVectorGet ( self, key, data, sizeof * data, & bytes );
-}
-
-LIB_EXPORT rc_t CC KVectorGetF32 ( const KVector *self, uint64_t key, float *data )
-{
-    size_t bytes;
-    rc_t rc = KVectorGet ( self, key, data, sizeof * data, & bytes );
-    if ( rc == 0 && bytes != sizeof * data )
-        rc = RC ( rcCont, rcVector, rcAccessing, rcType, rcUnsupported );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KVectorGetF64 ( const KVector *self, uint64_t key, double *data )
-{
-    size_t bytes;
-    rc_t rc = KVectorGet ( self, key, data, sizeof * data, & bytes );
-    if ( rc == 0 && bytes != sizeof * data )
-        rc = RC ( rcCont, rcVector, rcAccessing, rcType, rcUnsupported );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KVectorGetPtr ( const KVector *self, uint64_t key, void **data )
-{
-    size_t bytes;
-    rc_t rc = KVectorGet ( self, key, data, sizeof * data, & bytes );
-    if ( rc == 0 && bytes != sizeof * data )
-        rc = RC ( rcCont, rcVector, rcAccessing, rcType, rcUnsupported );
-    return rc;
-}
-
-
-/* Set
- *  set an untyped value
- *
- *  "key" [ IN ] - vector index
- *
- *  "data" [ IN ] and "bytes" [ IN ] - value buffer
- */
-static
-rc_t Nancy1Set ( void **nancy, uint64_t idx, bool value )
-{
-    JError_t err;
-    int status = ( value ? Judy1Set : Judy1Unset ) ( nancy, ( Word_t ) idx, & err );
-    if ( status == JERR )
-        return NancyError ( & err, rcWriting );
-    return 0;
-}
-
-static
-rc_t NancyLSet ( void **nancy, uint64_t idx, Word_t value )
-{
-    JError_t err;
-    PPvoid_t datap = JudyLIns ( nancy, ( Word_t ) idx, & err );
-    if ( datap == NULL )
-        return RC ( rcCont, rcVector, rcWriting, rcMemory, rcExhausted );
-    if ( datap == PPJERR )
-        return NancyError ( & err, rcWriting );
-    * ( Word_t* ) datap = value;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KVectorSet ( KVector *self, uint64_t key,
-    const void *data, size_t bytes )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcVector, rcWriting, rcSelf, rcNull );
-    else if ( data == NULL )
-        rc = RC ( rcCont, rcVector, rcWriting, rcParam, rcNull );
-    else if ( bytes == 0 )
-        rc = RC ( rcCont, rcVector, rcWriting, rcParam, rcEmpty );
-    else
-    {
-        Word_t value;
-
-        /* detect first set */
-        if ( self -> nancy == NULL )
-        {
-            switch ( bytes )
-            {
-            case 1:
-            case 2:
-            case 4:
-                break;
-            case 8:
-                if ( sizeof value < 8 )
-                    return RC ( rcCont, rcVector, rcWriting, rcParam, rcExcessive );
-            }
-
-            self -> fixed_size = ( uint32_t ) bytes;
-        }
-        else if ( bytes != ( size_t ) self -> fixed_size )
-        {
-            return RC ( rcCont, rcVector, rcWriting, rcParam, rcInconsistent );
-        }
-        else if ( self -> nancy_bool )
-        {
-            switch ( * ( const bool* ) data )
-            {
-            case 0:
-            case 1:
-                break;
-            default:
-                return RC ( rcCont, rcVector, rcWriting, rcParam, rcInvalid );
-            }
-            return Nancy1Set ( & self -> nancy, key, * ( const bool* ) data );
-        }
-
-        switch ( bytes )
-        {
-        case 1:
-            value = * ( const uint8_t* ) data;
-            break;
-        case 2:
-            value = * ( const uint16_t* ) data;
-            break;
-        case 4:
-            value = * ( const uint32_t* ) data;
-            break;
-        case 8:
-            value = * ( const uint64_t* ) data;
-            break;
-        }
-
-        rc = NancyLSet ( & self -> nancy, key, value );
-    }
-
-    return rc;
-}
-
-/* Set
- *  set typed values
- *
- *  "key" [ IN ] - vector index
- *
- *  "data" [ IN ] - value
- */
-LIB_EXPORT rc_t CC KVectorSetBool ( KVector *self, uint64_t key, bool data )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcVector, rcWriting, rcSelf, rcNull );
-    else
-    {
-        /* detect first set */
-        if ( self -> nancy == NULL )
-        {
-            self -> fixed_size = sizeof data;
-            self -> nancy_bool = true;
-        }
-        else if ( ! self -> nancy_bool )
-        {
-            return RC ( rcCont, rcVector, rcWriting, rcParam, rcInvalid );
-        }
-
-        rc = Nancy1Set ( & self -> nancy, key, data );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KVectorSetI8 ( KVector *self, uint64_t key, int8_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetI16 ( KVector *self, uint64_t key, int16_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetI32 ( KVector *self, uint64_t key, int32_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetI64 ( KVector *self, uint64_t key, int64_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetU8 ( KVector *self, uint64_t key, uint8_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetU16 ( KVector *self, uint64_t key, uint16_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetU32 ( KVector *self, uint64_t key, uint32_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetU64 ( KVector *self, uint64_t key, uint64_t value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetF32 ( KVector *self, uint64_t key, float value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetF64 ( KVector *self, uint64_t key, double value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-LIB_EXPORT rc_t CC KVectorSetPtr ( KVector *self, uint64_t key, const void *value )
-{
-    return KVectorSet ( self, key, & value, sizeof value );
-}
-
-
-/* Unset
- *  unset an entry
- *  returns rc_t state rcNull if index is not set
- *
- *  "key" [ IN ] - vector index
- */
-LIB_EXPORT rc_t CC KVectorUnset ( KVector *self, uint64_t key )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcVector, rcRemoving, rcSelf, rcNull );
-    else
-    {
-        int status;
-        JError_t err;
-
-        if ( self -> nancy_bool )
-            return Nancy1Set ( & self -> nancy, key, false );
-
-        status = JudyLDel ( & self -> nancy, key, & err );
-        if ( status == JERR )
-            return NancyError ( & err, rcRemoving );
-
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* Visit
- *  executes a function on each key/value pair
- *  returns early if "f" returns non-zero rc_t
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "user_data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element or until the function
- *  returns true.
- */
-LIB_EXPORT rc_t CC KVectorVisit ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, const void *value, size_t bytes, void *user_data ),
-    void *user_data )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcVector, rcVisiting, rcSelf, rcNull );
-    else if ( f == NULL )
-        rc = RC ( rcCont, rcVector, rcVisiting, rcFunction, rcNull );
-    else
-    {
-        rc = 0;
-
-        if ( self -> nancy != NULL )
-        {
-            JError_t err;
-            Word_t first, last, idx;
-
-	    /** Judy1First searches for first value higher then first**/ 
-            first = 0;
-	    /** Judy1Last searches for first value lower then last **/
-            last = (Word_t)-1;
-
-            if ( self -> nancy_bool )
-            {
-                bool value = true;
-                int status = Judy1First ( self -> nancy, & first, & err );
-                if ( status != JERR )
-                    status = Judy1Last ( self -> nancy, & last, & err );
-                if ( status == JERR )
-                    rc = NancyError ( & err, rcVisiting );
-                else if ( reverse )
-                {
-                    for ( idx = last; ; )
-                    {
-                        rc = ( * f ) ( idx, & value, sizeof value, user_data );
-                        if ( rc != 0 )
-                            break;
-                        if ( idx == first )
-                            break;
-                        status = Judy1Prev ( self -> nancy, & idx, & err );
-                        if ( status == JERR )
-                        {
-                            rc = NancyError ( & err, rcVisiting );
-                            break;
-                        }
-                    }
-                }
-                else
-                {
-                    for ( idx = first; ; )
-                    {
-                        rc = ( * f ) ( idx, & value, sizeof value, user_data );
-                        if ( rc != 0 )
-                            break;
-                        if ( idx == last )
-                            break;
-                        status = Judy1Next ( self -> nancy, & idx, & err );
-                        if ( status == JERR )
-                        {
-                            rc = NancyError ( & err, rcVisiting );
-                            break;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                Word_t value;
-                PPvoid_t lastp, datap = JudyLFirst ( self -> nancy, & first, & err );
-                if ( datap != PPJERR )
-                    lastp = JudyLLast ( self -> nancy, & last, & err );
-                if ( datap == PPJERR || lastp == PPJERR )
-                    rc = NancyError ( & err, rcVisiting );
-                else if ( reverse )
-                {
-                    for ( rc = 0, idx = last, datap = lastp; ; )
-                    {
-                        if ( datap == NULL )
-                            break;
-                        value = * ( const Word_t* ) datap;
-                        rc = ( * f ) ( idx, & value, sizeof value, user_data );
-                        if ( rc != 0 )
-                            break;
-                        if ( idx == first )
-                            break;
-                        datap = JudyLPrev ( self -> nancy, & idx, & err );
-                        if ( datap == PPJERR )
-                        {
-                            rc = NancyError ( & err, rcVisiting );
-                            break;
-                        }
-                    }
-                }
-                else
-                {
-                    for ( rc = 0, idx = first; ; )
-                    {
-                        if ( datap == NULL )
-                            break;
-                        value = * ( const Word_t* ) datap;
-                        rc = ( * f ) ( idx, & value, sizeof value, user_data );
-                        if ( rc != 0 )
-                            break;
-                        if ( idx == last )
-                            break;
-                        datap = JudyLNext ( self -> nancy, & idx, & err );
-                        if ( datap == PPJERR )
-                        {
-                            rc = NancyError ( & err, rcVisiting );
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Visit
- *  visit typed values
- *  returns early if "f" returns non-zero rc_t
- *
- *  "reverse" [ IN ] - if true, execute in reverse order
- *
- *  "f" [ IN ] and "user_data" [ IN, OPAQUE ] - function to be
- *  executed on each vector element or until the function
- *  returns true.
- */
-typedef struct KVectorVisitTypedData KVectorVisitTypedData;
-struct KVectorVisitTypedData
-{
-    union
-    {
-        rc_t ( CC * b ) ( uint64_t key, bool value, void *user_data );
-        rc_t ( CC * i ) ( uint64_t key, int64_t value, void *user_data );
-        rc_t ( CC * u ) ( uint64_t key, uint64_t value, void *user_data );
-        rc_t ( CC * f ) ( uint64_t key, double value, void *user_data );
-        rc_t ( CC * p ) ( uint64_t key, const void *value, void *user_data );
-    } f;
-    void *user_data;
-};
-
-static
-rc_t CC KVectorVisitBoolFunc ( uint64_t key, const void *ptr, size_t bytes, void *user_data )
-{
-    rc_t rc;
-    bool value;
-    if ( bytes != sizeof value )
-        rc = RC ( rcCont, rcVector, rcVisiting, rcType, rcInvalid );
-    else if ( * ( const uint8_t* ) ptr > 1 )
-        rc = RC ( rcCont, rcVector, rcVisiting, rcData, rcInvalid );
-    else
-    {
-        KVectorVisitTypedData *pb = user_data;
-        rc = ( * pb -> f . b ) ( key,  * ( const bool* ) ptr, pb -> user_data );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KVectorVisitBool ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, bool value, void *user_data ),
-    void *user_data )
-{
-    KVectorVisitTypedData pb;
-    pb . f . b = f;
-    pb . user_data = user_data;
-
-    return KVectorVisit ( self, reverse, KVectorVisitBoolFunc, & pb );
-}
-
-static
-rc_t CC KVectorVisitI64Func ( uint64_t key, const void *ptr, size_t bytes, void *user_data )
-{
-    int64_t value;
-    KVectorVisitTypedData *pb = user_data;
-
-    switch ( bytes )
-    {
-    case 1:
-        value = ( int8_t ) * ( const Word_t* ) ptr;
-        break;
-    case 2:
-        value = ( int16_t ) * ( const Word_t* ) ptr;
-        break;
-    case 4:
-        value = ( int32_t ) * ( const Word_t* ) ptr;
-        break;
-    default:
-        value = ( int64_t ) * ( const Word_t* ) ptr;
-    }
-
-    return ( * pb -> f . i ) ( key, value, pb -> user_data );
-}
-
-LIB_EXPORT rc_t CC KVectorVisitI64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, int64_t value, void *user_data ),
-    void *user_data )
-{
-    KVectorVisitTypedData pb;
-    pb . f . i = f;
-    pb . user_data = user_data;
-
-    return KVectorVisit ( self, reverse, KVectorVisitI64Func, & pb );
-}
-
-static
-rc_t CC KVectorVisitU64Func ( uint64_t key, const void *ptr, size_t bytes, void *user_data )
-{
-    KVectorVisitTypedData *pb = user_data;
-    return ( * pb -> f . u ) ( key, * ( const Word_t* ) ptr, pb -> user_data );
-}
-
-LIB_EXPORT rc_t CC KVectorVisitU64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, uint64_t value, void *user_data ),
-    void *user_data )
-{
-    KVectorVisitTypedData pb;
-    pb . f . u = f;
-    pb . user_data = user_data;
-
-    return KVectorVisit ( self, reverse, KVectorVisitU64Func, & pb );
-}
-
-static
-rc_t CC KVectorVisitF64Func ( uint64_t key, const void *ptr, size_t bytes, void *user_data )
-{
-    uint32_t u32;
-    double value;
-    KVectorVisitTypedData *pb = user_data;
-
-    switch ( bytes )
-    {
-    case 4:
-        u32 = ( uint32_t ) * ( const Word_t* ) ptr;
-        value = * ( const float* ) & u32;
-        break;
-    default:
-        value = * ( const double* ) ptr;
-    }
-
-    return ( * pb -> f . f ) ( key, value, pb -> user_data );
-}
-
-LIB_EXPORT rc_t CC KVectorVisitF64 ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, double value, void *user_data ),
-    void *user_data )
-{
-    KVectorVisitTypedData pb;
-    pb . f . f = f;
-    pb . user_data = user_data;
-
-    return KVectorVisit ( self, reverse, KVectorVisitF64Func, & pb );
-}
-
-static
-rc_t CC KVectorVisitPtrFunc ( uint64_t key, const void *ptr, size_t bytes, void *user_data )
-{
-    KVectorVisitTypedData *pb = user_data;
-    return ( * pb -> f . p ) ( key, * ( const void** ) ptr, pb -> user_data );
-}
-
-LIB_EXPORT rc_t CC KVectorVisitPtr ( const KVector *self, bool reverse,
-    rc_t ( CC * f ) ( uint64_t key, const void *value, void *user_data ),
-    void *user_data )
-{
-    KVectorVisitTypedData pb;
-    pb . f . p = f;
-    pb . user_data = user_data;
-
-    return KVectorVisit ( self, reverse, KVectorVisitPtrFunc, & pb );
-}
diff --git a/libs/klib/judy/Judy1.h b/libs/klib/judy/Judy1.h
deleted file mode 100644
index 5eeb6fd..0000000
--- a/libs/klib/judy/Judy1.h
+++ /dev/null
@@ -1,549 +0,0 @@
-#ifndef _JUDY1_INCLUDED
-#define _JUDY1_INCLUDED
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// ****************************************************************************
-//          JUDY1 -- SMALL/LARGE AND/OR CLUSTERED/SPARSE BIT ARRAYS
-//
-//                                    -by-
-//
-//                             Douglas L. Baskins
-//                             doug at sourcejudy.com
-//
-// Judy arrays are designed to be used instead of arrays.  The performance
-// suggests the reason why Judy arrays are thought of as arrays, instead of
-// trees.  They are remarkably memory efficient at all populations.
-// Implemented as a hybrid digital tree (but really a state machine, see
-// below), Judy arrays feature fast insert/retrievals, fast near neighbor
-// searching, and contain a population tree for extremely fast ordinal related
-// retrievals.
-//
-// CONVENTIONS:
-//
-// - The comments here refer to 32-bit [64-bit] systems.
-//
-// - BranchL, LeafL refer to linear branches and leaves (small populations),
-//   except LeafL does not actually appear as such; rather, Leaf1..3 [Leaf1..7]
-//   is used to represent leaf Index sizes, and LeafW refers to a Leaf with
-//   full (long) word Indexes, which is also a type of linear leaf.  Note that
-//   root-level LeafW (Leaf4 [Leaf8]) leaves are also called LEAFW.
-//
-// - BranchB, LeafB1 refer to bitmap branches and leaves (intermediate
-//   populations).
-//
-// - BranchU refers to uncompressed branches.  An uncompressed branch has 256
-//   JPs, some of which could be null.  Note:  All leaves are compressed (and
-//   sorted), or else an expanse is full (FullPopu), so there is no LeafU
-//   equivalent to BranchU.
-//
-// - "Popu" is short for "Population".
-// - "Pop1" refers to actual population (base 1).
-// - "Pop0" refers to Pop1 - 1 (base 0), the way populations are stored in data
-//   structures.
-//
-// - Branches and Leaves are both named by the number of bytes in their Pop0
-//   field.  In the case of Leaves, the same number applies to the Index sizes.
-//
-// - The representation of many numbers as hex is a relatively safe and
-//   portable way to get desired bitpatterns as unsigned longs.
-//
-// - Some preprocessors cant handle single apostrophe characters within
-//   #ifndef code, so here, use delete all instead.
-
-#include "JudyPrivate.h"        // includes Judy.h in turn.
-#include "JudyPrivateBranch.h"
-
-
-// ****************************************************************************
-// JUDY1 ROOT POINTER (JRP) AND JUDY1 POINTER (JP) TYPE FIELDS
-// ****************************************************************************
-//
-// The following enum lists all possible JP Type fields. 
-
-typedef enum            // uint8_t -- but C does not support this type of enum.
-{
-
-// JP NULL TYPES:
-//
-// There is a series of cJ1_JPNULL* Types because each one pre-records a
-// different Index Size for when the first Index is inserted in the previously
-// null JP.  They must start >= 8 (three bits).
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJ1_JPNULL1 = 1,
-                                // Index Size 1[1] byte  when 1 Index inserted.
-        cJ1_JPNULL2,            // Index Size 2[2] bytes when 1 Index inserted.
-        cJ1_JPNULL3,            // Index Size 3[3] bytes when 1 Index inserted.
-
-#ifndef JU_64BIT
-#define cJ1_JPNULLMAX cJ1_JPNULL3
-#else
-        cJ1_JPNULL4,            // Index Size 4[4] bytes when 1 Index inserted.
-        cJ1_JPNULL5,            // Index Size 5[5] bytes when 1 Index inserted.
-        cJ1_JPNULL6,            // Index Size 6[6] bytes when 1 Index inserted.
-        cJ1_JPNULL7,            // Index Size 7[7] bytes when 1 Index inserted.
-#define cJ1_JPNULLMAX cJ1_JPNULL7
-#endif
-
-
-// JP BRANCH TYPES:
-//
-// Note:  There are no state-1 branches; only leaves reside at state 1.
-
-// Linear branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJ1_JPBRANCH_L2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJ1_JPBRANCH_L3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJ1_JPBRANCH_L4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJ1_JPBRANCH_L5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJ1_JPBRANCH_L6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJ1_JPBRANCH_L7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJ1_JPBRANCH_L,         // note:  DcdPopO field not used.
-
-// Bitmap branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJ1_JPBRANCH_B2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJ1_JPBRANCH_B3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJ1_JPBRANCH_B4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJ1_JPBRANCH_B5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJ1_JPBRANCH_B6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJ1_JPBRANCH_B7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJ1_JPBRANCH_B,         // note:  DcdPopO field not used.
-
-// Uncompressed branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJ1_JPBRANCH_U2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJ1_JPBRANCH_U3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJ1_JPBRANCH_U4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJ1_JPBRANCH_U5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJ1_JPBRANCH_U6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJ1_JPBRANCH_U7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJ1_JPBRANCH_U,         // note:  DcdPopO field not used.
-
-
-// JP LEAF TYPES:
-
-// Linear leaves:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-//
-// Note:  There is no cJ1_JPLEAF1 for 64-bit for a subtle reason.  An immediate
-// JP can hold 15 1-byte Indexes, and a bitmap leaf would be used for 17
-// Indexes, so rather than support a linear leaf for only the case of exactly
-// 16 Indexes, a bitmap leaf is used in that case.  See also below regarding
-// cJ1_LEAF1_MAXPOP1 on 64-bit systems.
-//
-// Note:  There is no full-word (4-byte [8-byte]) Index leaf under a JP because
-// non-root-state leaves only occur under branches that decode at least one
-// byte.  Full-word, root-state leaves are under a JRP, not a JP.  However, in
-// the code a "fake" JP can be created temporarily above a root-state leaf.
-
-#ifndef JU_64BIT // 32-bit only; see above.
-        cJ1_JPLEAF1,            // 1    byte  Pop0, 2    bytes Dcd.
-#endif
-
-        cJ1_JPLEAF2,            // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJ1_JPLEAF3,            // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJ1_JPLEAF4,            //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJ1_JPLEAF5,            //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJ1_JPLEAF6,            //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJ1_JPLEAF7,            //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-// Bitmap leaf; Index Size == 1:
-//
-// Note:  These are currently only supported at state 1.  At other states the
-// bitmap would grow from 256 to 256^2, 256^3, ... bits, which would not be
-// efficient..
-
-        cJ1_JPLEAF_B1,          // 1[1] byte Pop0, 2[6] bytes Dcd.
-
-
-// Full population; Index Size == 1 virtual leaf:
-//
-// Note:  These are currently only supported at state 1.  At other states they
-// could be used, but they would be rare and the savings are dubious.
-
-        cJ1_JPFULLPOPU1,        // 1[1] byte Pop0, 2[6] bytes Dcd.
-
-#ifdef notdef  // for future enhancements
-        cJ1_JPFULLPOPU1m1,      // Full Population - 1 
-        cJ1_JPFULLPOPU1m2,      // Full Population - 2 
-        cJ1_JPFULLPOPU1m3,      // Full Population - 3 
-        cJ1_JPFULLPOPU1m4,      // Full Population - 4 
-        cJ1_JPFULLPOPU1m5,      // Full Population - 5 
-        cJ1_JPFULLPOPU1m6,      // Full Population - 6 
-        cJ1_JPFULLPOPU1m7,      // Full Population - 7 
-
-#ifdef JU_64BIT
-        cJ1_JPFULLPOPU1m8,      // Full Population - 8 
-        cJ1_JPFULLPOPU1m9,      // Full Population - 9 
-        cJ1_JPFULLPOPU1m10,     // Full Population - 10 
-        cJ1_JPFULLPOPU1m11,     // Full Population - 11
-        cJ1_JPFULLPOPU1m12,     // Full Population - 12
-        cJ1_JPFULLPOPU1m13,     // Full Population - 13
-        cJ1_JPFULLPOPU1m14,     // Full Population - 14
-        cJ1_JPFULLPOPU1m15,     // Full Population - 15
-#endif
-#endif // notdef -- for future enhancements
-
-
-// JP IMMEDIATES; leaves (Indexes) stored inside a JP:
-//
-// The second numeric suffix is the Pop1 for each type.  As the Index Size
-// increases, the maximum possible population decreases.
-//
-// Note:  These Types must be in sequential order in each group (Index Size),
-// and the groups in correct order too, for doing relative calculations between
-// them.  For example, since these Types enumerate the Pop1 values (unlike
-// other JP Types where there is a Pop0 value in the JP), the maximum Pop1 for
-// each Index Size is computable.
-
-        cJ1_JPIMMED_1_01,       // Index Size = 1, Pop1 = 1.
-        cJ1_JPIMMED_2_01,       // Index Size = 2, Pop1 = 1.
-        cJ1_JPIMMED_3_01,       // Index Size = 3, Pop1 = 1.
-#ifdef JU_64BIT
-        cJ1_JPIMMED_4_01,       // Index Size = 4, Pop1 = 1.
-        cJ1_JPIMMED_5_01,       // Index Size = 5, Pop1 = 1.
-        cJ1_JPIMMED_6_01,       // Index Size = 6, Pop1 = 1.
-        cJ1_JPIMMED_7_01,       // Index Size = 7, Pop1 = 1.
-#endif
-
-        cJ1_JPIMMED_1_02,       // Index Size = 1, Pop1 = 2.
-        cJ1_JPIMMED_1_03,       // Index Size = 1, Pop1 = 3.
-        cJ1_JPIMMED_1_04,       // Index Size = 1, Pop1 = 4.
-        cJ1_JPIMMED_1_05,       // Index Size = 1, Pop1 = 5.
-        cJ1_JPIMMED_1_06,       // Index Size = 1, Pop1 = 6.
-        cJ1_JPIMMED_1_07,       // Index Size = 1, Pop1 = 7.
-
-#ifdef JU_64BIT
-        cJ1_JPIMMED_1_08,       // Index Size = 1, Pop1 = 8.
-        cJ1_JPIMMED_1_09,       // Index Size = 1, Pop1 = 9.
-        cJ1_JPIMMED_1_10,       // Index Size = 1, Pop1 = 10.
-        cJ1_JPIMMED_1_11,       // Index Size = 1, Pop1 = 11.
-        cJ1_JPIMMED_1_12,       // Index Size = 1, Pop1 = 12.
-        cJ1_JPIMMED_1_13,       // Index Size = 1, Pop1 = 13.
-        cJ1_JPIMMED_1_14,       // Index Size = 1, Pop1 = 14.
-        cJ1_JPIMMED_1_15,       // Index Size = 1, Pop1 = 15.
-#endif
-
-        cJ1_JPIMMED_2_02,       // Index Size = 2, Pop1 = 2.
-        cJ1_JPIMMED_2_03,       // Index Size = 2, Pop1 = 3.
-
-#ifdef JU_64BIT
-        cJ1_JPIMMED_2_04,       // Index Size = 2, Pop1 = 4.
-        cJ1_JPIMMED_2_05,       // Index Size = 2, Pop1 = 5.
-        cJ1_JPIMMED_2_06,       // Index Size = 2, Pop1 = 6.
-        cJ1_JPIMMED_2_07,       // Index Size = 2, Pop1 = 7.
-#endif
-
-        cJ1_JPIMMED_3_02,       // Index Size = 3, Pop1 = 2.
-
-#ifdef JU_64BIT
-        cJ1_JPIMMED_3_03,       // Index Size = 3, Pop1 = 3.
-        cJ1_JPIMMED_3_04,       // Index Size = 3, Pop1 = 4.
-        cJ1_JPIMMED_3_05,       // Index Size = 3, Pop1 = 5.
-
-        cJ1_JPIMMED_4_02,       // Index Size = 4, Pop1 = 2.
-        cJ1_JPIMMED_4_03,       // Index Size = 4, Pop1 = 3.
-
-        cJ1_JPIMMED_5_02,       // Index Size = 5, Pop1 = 2.
-        cJ1_JPIMMED_5_03,       // Index Size = 3, Pop1 = 3.
-
-        cJ1_JPIMMED_6_02,       // Index Size = 6, Pop1 = 2.
-
-        cJ1_JPIMMED_7_02,       // Index Size = 7, Pop1 = 2.
-#endif
-
-// This special Type is merely a sentinel for doing relative calculations.
-// This value should not be used in switch statements (to avoid allocating code
-// for it), which is also why it appears at the end of the enum list.
-
-        cJ1_JPIMMED_CAP
-
-} jp1_Type_t;
-
-
-// RELATED VALUES:
-//
-// Index Size (state) for leaf JP, and JP type based on Index Size (state):
-
-#ifndef JU_64BIT // 32-bit
-#define J1_LEAFINDEXSIZE(jpType) ((jpType)    - cJ1_JPLEAF1 + 1)
-#define J1_LEAFTYPE(IndexSize)   ((IndexSize) + cJ1_JPLEAF1 - 1)
-#else
-#define J1_LEAFINDEXSIZE(jpType) ((jpType)    - cJ1_JPLEAF2 + 2)
-#define J1_LEAFTYPE(IndexSize)   ((IndexSize) + cJ1_JPLEAF2 - 2)
-#endif
-
-
-// ****************************************************************************
-// JUDY1 POINTER (JP) -- RELATED MACROS AND CONSTANTS
-// ****************************************************************************
-
-// MAXIMUM POPULATIONS OF LINEAR LEAVES:
-//
-// Allow up to 2 cache lines per leaf, with N bytes per index.
-//
-// J_1_MAXB is the maximum number of bytes (sort of) to allocate per leaf.
-// ALLOCSIZES is defined here, not there, for single-point control of these key
-// definitions.  See JudyTables.c for "TERMINATOR".
-
-#define J_1_MAXB   (sizeof(Word_t) * 32)
-#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words.
-#define cJ1_LEAF1_MAXWORDS  5           // Leaf1 max alloc size in words.
-
-// Under JRP (root-state leaves):
-//
-// Includes a count (Population) word.
-//
-// Under JP (non-root-state leaves), which have no count (Population) words:
-//
-// When a 1-byte index leaf grows above cJ1_LEAF1_MAXPOP1 Indexes (bytes),
-// the memory chunk required grows to a size where a bitmap is just as
-// efficient, so use a bitmap instead for all greater Populations, on both
-// 32-bit and 64-bit systems.  However, on a 32-bit system this occurs upon
-// going from 6 to 8 words (24 to 32 bytes) in the memory chunk, but on a
-// 64-bit system this occurs upon going from 2 to 4 words (16 to 32 bytes).  It
-// would be silly to go from a 15-Index Immediate JP to a 16-Index linear leaf
-// to a 17-Index bitmap leaf, so just use a bitmap leaf for 16+ Indexes, which
-// means set cJ1_LEAF1_MAXPOP1 to cJ1_IMMED1_MAXPOP1 (15) to cause the
-// transition at that point.
-//
-// Note:  cJ1_LEAF1_MAXPOP1 is not used on 64-bit systems.
-
-#ifndef JU_64BIT // 32-bit
-
-#define cJ1_LEAF1_MAXPOP1    (cJ1_LEAF1_MAXWORDS * cJU_BYTESPERWORD)
-#define cJ1_LEAF2_MAXPOP1    (J_1_MAXB / 2)
-#define cJ1_LEAF3_MAXPOP1    (J_1_MAXB / 3)
-#define cJ1_LEAFW_MAXPOP1    ((J_1_MAXB - cJU_BYTESPERWORD) / cJU_BYTESPERWORD)
-
-#else // 64-bit
-
-// #define cJ1_LEAF1_MAXPOP1                    // no LEAF1 in 64-bit.
-#define cJ1_LEAF2_MAXPOP1    (J_1_MAXB / 2)
-#define cJ1_LEAF3_MAXPOP1    (J_1_MAXB / 3)
-#define cJ1_LEAF4_MAXPOP1    (J_1_MAXB / 4)
-#define cJ1_LEAF5_MAXPOP1    (J_1_MAXB / 5)
-#define cJ1_LEAF6_MAXPOP1    (J_1_MAXB / 6)
-#define cJ1_LEAF7_MAXPOP1    (J_1_MAXB / 7)
-#define cJ1_LEAFW_MAXPOP1    ((J_1_MAXB - cJU_BYTESPERWORD) / cJU_BYTESPERWORD)
-
-#endif
-
-
-// MAXIMUM POPULATIONS OF IMMEDIATE JPs:
-//
-// These specify the maximum Population of immediate JPs with various Index
-// Sizes (== sizes of remaining undecoded Index bits).
-
-#define cJ1_IMMED1_MAXPOP1  ((sizeof(jp_t) - 1) / 1)    // 7 [15].
-#define cJ1_IMMED2_MAXPOP1  ((sizeof(jp_t) - 1) / 2)    // 3  [7].
-#define cJ1_IMMED3_MAXPOP1  ((sizeof(jp_t) - 1) / 3)    // 2  [5].
-
-#ifdef JU_64BIT
-#define cJ1_IMMED4_MAXPOP1  ((sizeof(jp_t) - 1) / 4)    //    [3].
-#define cJ1_IMMED5_MAXPOP1  ((sizeof(jp_t) - 1) / 5)    //    [3].
-#define cJ1_IMMED6_MAXPOP1  ((sizeof(jp_t) - 1) / 6)    //    [2].
-#define cJ1_IMMED7_MAXPOP1  ((sizeof(jp_t) - 1) / 7)    //    [2].
-#endif
-
-
-// ****************************************************************************
-// JUDY1 BITMAP LEAF (J1LB) SUPPORT
-// ****************************************************************************
-
-#define J1_JLB_BITMAP(Pjlb,Subexp)  ((Pjlb)->j1lb_Bitmap[Subexp])
-
-typedef struct J__UDY1_BITMAP_LEAF
-{
-        BITMAPL_t j1lb_Bitmap[cJU_NUMSUBEXPL];
-
-} j1lb_t, * Pj1lb_t;
-
-
-// ****************************************************************************
-// MEMORY ALLOCATION SUPPORT
-// ****************************************************************************
-
-// ARRAY-GLOBAL INFORMATION:
-//
-// At the cost of an occasional additional cache fill, this object, which is
-// pointed at by a JRP and in turn points to a JP_BRANCH*, carries array-global
-// information about a Judy1 array that has sufficient population to amortize
-// the cost.  The jpm_Pop0 field prevents having to add up the total population
-// for the array in insert, delete, and count code.  The jpm_JP field prevents
-// having to build a fake JP for entry to a state machine; however, the
-// jp_DcdPopO field in jpm_JP, being one byte too small, is not used.
-//
-// Note:  Struct fields are ordered to keep "hot" data in the first 8 words
-// (see left-margin comments) for machines with 8-word cache lines, and to keep
-// sub-word fields together for efficient packing.
-
-typedef struct J_UDY1_POPULATION_AND_MEMORY
-{
-/* 1 */ Word_t     jpm_Pop0;            // total population-1 in array.
-/* 2 */ jp_t       jpm_JP;              // JP to first branch; see above.
-/* 4 */ Word_t     jpm_LastUPop0;       // last jpm_Pop0 when convert to BranchU
-// Note:  Field names match PJError_t for convenience in macros:
-/* 7 */ char       je_Errno;            // one of the enums in Judy.h.
-/* 7/8 */ int      je_ErrID;            // often an internal source line number.
-/* 8/9 */ Word_t   jpm_TotalMemWords;   // words allocated in array.
-} j1pm_t, *Pj1pm_t;
-
-
-// TABLES FOR DETERMINING IF LEAVES HAVE ROOM TO GROW:
-//
-// These tables indicate if a given memory chunk can support growth of a given
-// object into wasted (rounded-up) memory in the chunk.  This violates the
-// hiddenness of the JudyMalloc code.
-//
-// Also define macros to hide the details in the code using these tables.
-
-#ifndef JU_64BIT
-extern const uint8_t j__1_Leaf1PopToWords[cJ1_LEAF1_MAXPOP1 + 1];
-#endif
-extern const uint8_t j__1_Leaf2PopToWords[cJ1_LEAF2_MAXPOP1 + 1];
-extern const uint8_t j__1_Leaf3PopToWords[cJ1_LEAF3_MAXPOP1 + 1];
-#ifdef JU_64BIT
-extern const uint8_t j__1_Leaf4PopToWords[cJ1_LEAF4_MAXPOP1 + 1];
-extern const uint8_t j__1_Leaf5PopToWords[cJ1_LEAF5_MAXPOP1 + 1];
-extern const uint8_t j__1_Leaf6PopToWords[cJ1_LEAF6_MAXPOP1 + 1];
-extern const uint8_t j__1_Leaf7PopToWords[cJ1_LEAF7_MAXPOP1 + 1];
-#endif
-extern const uint8_t j__1_LeafWPopToWords[cJ1_LEAFW_MAXPOP1 + 1];
-
-// Check if increase of population will fit in same leaf:
-
-#ifndef JU_64BIT
-#define J1_LEAF1GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF1_MAXPOP1, j__1_Leaf1PopToWords)
-#endif
-#define J1_LEAF2GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF2_MAXPOP1, j__1_Leaf2PopToWords)
-#define J1_LEAF3GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF3_MAXPOP1, j__1_Leaf3PopToWords)
-#ifdef JU_64BIT
-#define J1_LEAF4GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF4_MAXPOP1, j__1_Leaf4PopToWords)
-#define J1_LEAF5GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF5_MAXPOP1, j__1_Leaf5PopToWords)
-#define J1_LEAF6GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF6_MAXPOP1, j__1_Leaf6PopToWords)
-#define J1_LEAF7GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAF7_MAXPOP1, j__1_Leaf7PopToWords)
-#endif
-#define J1_LEAFWGROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJ1_LEAFW_MAXPOP1, j__1_LeafWPopToWords)
-
-#ifndef JU_64BIT
-#define J1_LEAF1POPTOWORDS(Pop1)  (j__1_Leaf1PopToWords[Pop1])
-#endif
-#define J1_LEAF2POPTOWORDS(Pop1)  (j__1_Leaf2PopToWords[Pop1])
-#define J1_LEAF3POPTOWORDS(Pop1)  (j__1_Leaf3PopToWords[Pop1])
-#ifdef JU_64BIT
-#define J1_LEAF4POPTOWORDS(Pop1)  (j__1_Leaf4PopToWords[Pop1])
-#define J1_LEAF5POPTOWORDS(Pop1)  (j__1_Leaf5PopToWords[Pop1])
-#define J1_LEAF6POPTOWORDS(Pop1)  (j__1_Leaf6PopToWords[Pop1])
-#define J1_LEAF7POPTOWORDS(Pop1)  (j__1_Leaf7PopToWords[Pop1])
-#endif
-#define J1_LEAFWPOPTOWORDS(Pop1)  (j__1_LeafWPopToWords[Pop1])
-
-
-// FUNCTIONS TO ALLOCATE OBJECTS:
-
-Pj1pm_t j__udy1AllocJ1PM(void);                         // constant size.
-
-Pjbl_t  j__udy1AllocJBL(          Pj1pm_t);             // constant size.
-Pjbb_t  j__udy1AllocJBB(          Pj1pm_t);             // constant size.
-Pjp_t   j__udy1AllocJBBJP(Word_t, Pj1pm_t);
-Pjbu_t  j__udy1AllocJBU(          Pj1pm_t);             // constant size.
-
-#ifndef JU_64BIT
-Pjll_t  j__udy1AllocJLL1( Word_t, Pj1pm_t);
-#endif
-Pjll_t  j__udy1AllocJLL2( Word_t, Pj1pm_t);
-Pjll_t  j__udy1AllocJLL3( Word_t, Pj1pm_t);
-
-#ifdef JU_64BIT
-Pjll_t  j__udy1AllocJLL4( Word_t, Pj1pm_t);
-Pjll_t  j__udy1AllocJLL5( Word_t, Pj1pm_t);
-Pjll_t  j__udy1AllocJLL6( Word_t, Pj1pm_t);
-Pjll_t  j__udy1AllocJLL7( Word_t, Pj1pm_t);
-#endif
-
-Pjlw_t  j__udy1AllocJLW(  Word_t         );             // no Pj1pm needed.
-Pj1lb_t j__udy1AllocJLB1(         Pj1pm_t);             // constant size.
-
-
-// FUNCTIONS TO FREE OBJECTS:
-
-void    j__udy1FreeJ1PM( Pj1pm_t,        Pj1pm_t);      // constant size.
-
-void    j__udy1FreeJBL(  Pjbl_t,         Pj1pm_t);      // constant size.
-void    j__udy1FreeJBB(  Pjbb_t,         Pj1pm_t);      // constant size.
-void    j__udy1FreeJBBJP(Pjp_t,  Word_t, Pj1pm_t);
-void    j__udy1FreeJBU(  Pjbu_t,         Pj1pm_t);      // constant size.
-
-#ifndef JU_64BIT
-void    j__udy1FreeJLL1( Pjll_t, Word_t, Pj1pm_t);
-#endif
-void    j__udy1FreeJLL2( Pjll_t, Word_t, Pj1pm_t);
-void    j__udy1FreeJLL3( Pjll_t, Word_t, Pj1pm_t);
-
-#ifdef JU_64BIT
-void    j__udy1FreeJLL4( Pjll_t, Word_t, Pj1pm_t);
-void    j__udy1FreeJLL5( Pjll_t, Word_t, Pj1pm_t);
-void    j__udy1FreeJLL6( Pjll_t, Word_t, Pj1pm_t);
-void    j__udy1FreeJLL7( Pjll_t, Word_t, Pj1pm_t);
-#endif
-
-void    j__udy1FreeJLW(  Pjlw_t, Word_t, Pj1pm_t);
-void    j__udy1FreeJLB1( Pj1lb_t,        Pj1pm_t);      // constant size.
-void    j__udy1FreeSM(   Pjp_t,          Pj1pm_t);      // everything below Pjp.
-
-#endif // ! _JUDY1_INCLUDED
diff --git a/libs/klib/judy/JudyByCount.c b/libs/klib/judy/JudyByCount.c
deleted file mode 100644
index f6efea0..0000000
--- a/libs/klib/judy/JudyByCount.c
+++ /dev/null
@@ -1,952 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy*ByCount() function for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a
-// version with cache line optimizations deleted, for testing.
-//
-// Judy*ByCount() is a conceptual although not literal inverse of Judy*Count().
-// Judy*Count() takes a pair of Indexes, and allows finding the ordinal of a
-// given Index (that is, its position in the list of valid indexes from the
-// beginning) as a degenerate case, because in general the count between two
-// Indexes, inclusive, is not always just the difference in their ordinals.
-// However, it suffices for Judy*ByCount() to simply be an ordinal-to-Index
-// mapper.
-//
-// Note:  Like Judy*Count(), this code must "count sideways" in branches, which
-// can result in a lot of cache line fills.  However, unlike Judy*Count(), this
-// code does not receive a specific Index, hence digit, where to start in each
-// branch, so it cant accurately calculate cache line fills required in each
-// direction.  The best it can do is an approximation based on the total
-// population of the expanse (pop1 from Pjp) and the ordinal of the target
-// Index (see SETOFFSET()) within the expanse.
-//
-// Compile with -DSMARTMETRICS to obtain global variables containing smart
-// cache line metrics.  Note:  Dont turn this on simultaneously for this file
-// and JudyCount.c because they export the same globals.
-// ****************************************************************************
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-// These are imported from JudyCount.c:
-//
-// TBD:  Should this be in common code?  Exported from a header file?
-
-#ifdef JUDY1
-extern	Word_t j__udy1JPPop1(const Pjp_t Pjp);
-#define	j__udyJPPop1 j__udy1JPPop1
-#else
-extern	Word_t j__udyLJPPop1(const Pjp_t Pjp);
-#define	j__udyJPPop1 j__udyLJPPop1
-#endif
-
-// Avoid duplicate symbols since this file is multi-compiled:
-
-#ifdef SMARTMETRICS
-#ifdef JUDY1
-Word_t	jbb_upward   = 0;	// counts of directions taken:
-Word_t	jbb_downward = 0;
-Word_t	jbu_upward   = 0;
-Word_t	jbu_downward = 0;
-Word_t	jlb_upward   = 0;
-Word_t	jlb_downward = 0;
-#else
-extern Word_t jbb_upward;
-extern Word_t jbb_downward;
-extern Word_t jbu_upward;
-extern Word_t jbu_downward;
-extern Word_t jlb_upward;
-extern Word_t jlb_downward;
-#endif
-#endif
-
-
-// ****************************************************************************
-// J U D Y   1   B Y   C O U N T
-// J U D Y   L   B Y   C O U N T
-//
-// See the manual entry.
-
-#ifdef JUDY1
-FUNCTION int Judy1ByCount
-#else
-FUNCTION PPvoid_t JudyLByCount
-#endif
-        (
-	Pcvoid_t  PArray,	// root pointer to first branch/leaf in SM.
-	Word_t	  Count,	// ordinal of Index to find, 1..MAX.
-	Word_t *  PIndex,	// to return found Index.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-	Word_t	  Count0;	// Count, base-0, to match pop0.
-	Word_t	  state;	// current state in SM.
-	Word_t	  pop1;		// of current branch or leaf, or of expanse.
-	Word_t	  pop1lower;	// pop1 of expanses (JPs) below that for Count.
-	Word_t	  digit;	// current word in branch.
-	Word_t	  jpcount;	// JPs in a BranchB subexpanse.
-	long	  jpnum;	// JP number in a branch (base 0).
-	long	  subexp;	// for stepping through layer 1 (subexpanses).
-	int	  offset;	// index ordinal within a leaf, base 0.
-
-	Pjp_t	  Pjp;		// current JP in branch.
-	Pjll_t	  Pjll;		// current Judy linear leaf.
-
-
-// CHECK FOR EMPTY ARRAY OR NULL PINDEX:
-
-	if (PArray == (Pvoid_t) NULL) JU_RET_NOTFOUND;
-
-	if (PIndex == (PWord_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-	}
-
-// Convert Count to Count0; assume special case of Count = 0 maps to ~0, as
-// desired, to represent the last index in a full array:
-//
-// Note:  Think of Count0 as a reliable "number of Indexes below the target."
-
-	Count0 = Count - 1;
-	assert((Count || Count0 == ~0));  // ensure CPU is sane about 0 - 1.
-	pop1lower = 0;
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw = P_JLW(PArray);		// first word of leaf.
-
-	    if (Count0 > Pjlw[0]) JU_RET_NOTFOUND;	// too high.
-
-	    *PIndex = Pjlw[Count];			// Index, base 1.
-
-	    JU_RET_FOUND_LEAFW(Pjlw, Pjlw[0] + 1, Count0);
-	}
-	else
-	{
-	    Pjpm_t Pjpm = P_JPM(PArray);
-
-	    if (Count0 > (Pjpm->jpm_Pop0)) JU_RET_NOTFOUND;	// too high.
-
-	    Pjp  = &(Pjpm->jpm_JP);
-	    pop1 =  (Pjpm->jpm_Pop0) + 1;
-
-//	    goto SMByCount;
-	}
-
-// COMMON CODE:
-//
-// Prepare to handle a root-level or lower-level branch:  Save the current
-// state, obtain the total population for the branch in a state-dependent way,
-// and then branch to common code for multiple cases.
-//
-// For root-level branches, the state is always cJU_ROOTSTATE, and the array
-// population must already be set in pop1; it is not available in jp_DcdPopO.
-//
-// Note:  The total population is only needed in cases where the common code
-// "counts down" instead of up to minimize cache line fills.  However, its
-// available cheaply, and its better to do it with a constant shift (constant
-// state value) instead of a variable shift later "when needed".
-
-#define	PREPB_ROOT(Next)	\
-	state = cJU_ROOTSTATE;	\
-	goto Next
-
-// Use PREPB_DCD() to first copy the Dcd bytes to *PIndex if there are any
-// (only if state < cJU_ROOTSTATE - 1):
-
-#define	PREPB_DCD(Pjp,cState,Next)			\
-	JU_SETDCD(*PIndex, Pjp, cState);	        \
-	PREPB((Pjp), cState, Next)
-
-#define	PREPB(Pjp,cState,Next)	\
-	state = (cState);	\
-	pop1  = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \
-	goto Next
-
-// Calculate whether the ordinal of an Index within a given expanse falls in
-// the lower or upper half of the expanses population, taking care with
-// unsigned math and boundary conditions:
-//
-// Note:  Assume the ordinal falls within the expanses population, that is,
-// 0 < (Count - Pop1lower) <= Pop1exp (assuming infinite math).
-//
-// Note:  If the ordinal is the middle element, it doesnt matter whether
-// LOWERHALF() is TRUE or FALSE.
-
-#define	LOWERHALF(Count0,Pop1lower,Pop1exp) \
-	(((Count0) - (Pop1lower)) < ((Pop1exp) / 2))
-
-// Calculate the (signed) offset within a leaf to the desired ordinal (Count -
-// Pop1lower; offset is one less), and optionally ensure its in range:
-
-#define	SETOFFSET(Offset,Count0,Pop1lower,Pjp)	\
-	(Offset) = (Count0) - (Pop1lower);	\
-	assert((Offset) >= 0);			\
-	assert((Offset) <= JU_JPLEAF_POP0(Pjp))
-
-// Variations for immediate indexes, with and without pop1-specific assertions:
-
-#define	SETOFFSET_IMM_CK(Offset,Count0,Pop1lower,cPop1)	\
-	(Offset) = (Count0) - (Pop1lower);		\
-	assert((Offset) >= 0);				\
-	assert((Offset) <  (cPop1))
-
-#define	SETOFFSET_IMM(Offset,Count0,Pop1lower) \
-	(Offset) = (Count0) - (Pop1lower)
-
-
-// STATE MACHINE -- TRAVERSE TREE:
-//
-// In branches, look for the expanse (digit), if any, where the total pop1
-// below or at that expanse would meet or exceed Count, meaning the Index must
-// be in this expanse.
-
-SMByCount:			// return here for next branch/leaf.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH; count populations in JPs in the JBL upwards until finding the
-// expanse (digit) containing Count, and "recurse".
-//
-// Note:  There are no null JPs in a JBL; watch out for pop1 == 0.
-//
-// Note:  A JBL should always fit in one cache line => no need to count up
-// versus down to save cache line fills.
-//
-// TBD:  The previous is no longer true.  Consider enhancing this code to count
-// up/down, but it can wait for a later tuning phase.  In the meantime, PREPB()
-// sets pop1 for the whole array, but that value is not used here.  001215:
-// Maybe its true again?
-
-	case cJU_JPBRANCH_L2:  PREPB_DCD(Pjp, 2, BranchL);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_L3:  PREPB(	 Pjp, 3, BranchL);
-#else
-	case cJU_JPBRANCH_L3:  PREPB_DCD(Pjp, 3, BranchL);
-	case cJU_JPBRANCH_L4:  PREPB_DCD(Pjp, 4, BranchL);
-	case cJU_JPBRANCH_L5:  PREPB_DCD(Pjp, 5, BranchL);
-	case cJU_JPBRANCH_L6:  PREPB_DCD(Pjp, 6, BranchL);
-	case cJU_JPBRANCH_L7:  PREPB(	 Pjp, 7, BranchL);
-#endif
-	case cJU_JPBRANCH_L:   PREPB_ROOT(	 BranchL);
-	{
-	    Pjbl_t Pjbl;
-
-// Common code (state-independent) for all cases of linear branches:
-
-BranchL:
-	    Pjbl = P_JBL(Pjp->jp_Addr);
-
-	    for (jpnum = 0; jpnum < (Pjbl->jbl_NumJPs); ++jpnum)
-	    {
-	        if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum))
-		 == cJU_ALLONES)
-	        {
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-	        }
-	        assert(pop1 != 0);
-
-// Warning:  pop1lower and pop1 are unsigned, so do not subtract 1 and compare
-// >=, but instead use the following expression:
-
-	        if (pop1lower + pop1 > Count0)	 // Index is in this expanse.
-	        {
-		    JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[jpnum], state);
-		    Pjp = (Pjbl->jbl_jp) + jpnum;
-		    goto SMByCount;			// look under this expanse.
-	        }
-
-	        pop1lower += pop1;			// add this JPs pop1.
-	    }
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // should never get here.
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-	} // case cJU_JPBRANCH_L
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH; count populations in JPs in the JBB upwards or downwards
-// until finding the expanse (digit) containing Count, and "recurse".
-//
-// Note:  There are no null JPs in a JBB; watch out for pop1 == 0.
-
-	case cJU_JPBRANCH_B2:  PREPB_DCD(Pjp, 2, BranchB);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_B3:  PREPB(	 Pjp, 3, BranchB);
-#else
-	case cJU_JPBRANCH_B3:  PREPB_DCD(Pjp, 3, BranchB);
-	case cJU_JPBRANCH_B4:  PREPB_DCD(Pjp, 4, BranchB);
-	case cJU_JPBRANCH_B5:  PREPB_DCD(Pjp, 5, BranchB);
-	case cJU_JPBRANCH_B6:  PREPB_DCD(Pjp, 6, BranchB);
-	case cJU_JPBRANCH_B7:  PREPB(	 Pjp, 7, BranchB);
-#endif
-	case cJU_JPBRANCH_B:   PREPB_ROOT(	 BranchB);
-	{
-	    Pjbb_t Pjbb;
-
-// Common code (state-independent) for all cases of bitmap branches:
-
-BranchB:
-	    Pjbb = P_JBB(Pjp->jp_Addr);
-
-// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch:
-//
-// Note: BMPJP0 exists separately to support assertions.
-
-#define	BMPJP0(Subexp)	     (P_JP(JU_JBB_PJP(Pjbb, Subexp)))
-#define	BMPJP(Subexp,JPnum)  (BMPJP0(Subexp) + (JPnum))
-
-
-// Common code for descending through a JP:
-//
-// Determine the digit for the expanse and save it in *PIndex; then "recurse".
-
-#define	JBB_FOUNDEXPANSE			\
-	{					\
-	    JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb,subexp), jpnum); \
-	    JU_SETDIGIT(*PIndex, digit, state);	\
-	    Pjp = BMPJP(subexp, jpnum);		\
-	    goto SMByCount;			\
-	}
-
-
-#ifndef NOSMARTJBB  // enable to turn off smart code for comparison purposes.
-
-// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s
-// in JPs upwards, or subtracting the pop1s in JPs downwards:
-//
-// See header comments about limitations of this for Judy*ByCount().
-
-#endif
-
-// COUNT UPWARD, adding each "below" JPs pop1:
-
-#ifndef NOSMARTJBB  // enable to turn off smart code for comparison purposes.
-
-	    if (LOWERHALF(Count0, pop1lower, pop1))
-	    {
-#endif
-#ifdef SMARTMETRICS
-		++jbb_upward;
-#endif
-		for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-		{
-		    if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb,subexp)))
-		     && (BMPJP0(subexp) == (Pjp_t) NULL))
-		    {
-			JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // null ptr.
-			JUDY1CODE(return(JERRI );)
-			JUDYLCODE(return(PPJERR);)
-		    }
-
-// Note:  An empty subexpanse (jpcount == 0) is handled "for free":
-
-		    for (jpnum = 0; jpnum < jpcount; ++jpnum)
-		    {
-			if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum)))
-			  == cJU_ALLONES)
-			{
-			    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-			    JUDY1CODE(return(JERRI );)
-			    JUDYLCODE(return(PPJERR);)
-			}
-			assert(pop1 != 0);
-
-// Warning:  pop1lower and pop1 are unsigned, see earlier comment:
-
-			if (pop1lower + pop1 > Count0)
-			    JBB_FOUNDEXPANSE;	// Index is in this expanse.
-
-			pop1lower += pop1;	// add this JPs pop1.
-		    }
-		}
-#ifndef NOSMARTJBB  // enable to turn off smart code for comparison purposes.
-	    }
-
-
-// COUNT DOWNWARD, subtracting each "above" JPs pop1 from the whole expanses
-// pop1:
-
-	    else
-	    {
-#ifdef SMARTMETRICS
-		++jbb_downward;
-#endif
-		pop1lower += pop1;		// add whole branch to start.
-
-		for (subexp = cJU_NUMSUBEXPB - 1; subexp >= 0; --subexp)
-		{
-		    if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)))
-		     && (BMPJP0(subexp) == (Pjp_t) NULL))
-		    {
-			JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // null ptr.
-			JUDY1CODE(return(JERRI );)
-			JUDYLCODE(return(PPJERR);)
-		    }
-
-// Note:  An empty subexpanse (jpcount == 0) is handled "for free":
-
-		    for (jpnum = jpcount - 1; jpnum >= 0; --jpnum)
-		    {
-			if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum)))
-			  == cJU_ALLONES)
-			{
-			    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-			    JUDY1CODE(return(JERRI );)
-			    JUDYLCODE(return(PPJERR);)
-			}
-			assert(pop1 != 0);
-
-// Warning:  pop1lower and pop1 are unsigned, see earlier comment:
-
-			pop1lower -= pop1;
-
-// Beware unsigned math problems:
-
-			if ((pop1lower == 0) || (pop1lower - 1 < Count0))
-			    JBB_FOUNDEXPANSE;	// Index is in this expanse.
-		    }
-		}
-	    }
-#endif // NOSMARTJBB
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // should never get here.
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-	} // case cJU_JPBRANCH_B
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH; count populations in JPs in the JBU upwards or
-// downwards until finding the expanse (digit) containing Count, and "recurse".
-
-	case cJU_JPBRANCH_U2:  PREPB_DCD(Pjp, 2, BranchU);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_U3:  PREPB(	 Pjp, 3, BranchU);
-#else
-	case cJU_JPBRANCH_U3:  PREPB_DCD(Pjp, 3, BranchU);
-	case cJU_JPBRANCH_U4:  PREPB_DCD(Pjp, 4, BranchU);
-	case cJU_JPBRANCH_U5:  PREPB_DCD(Pjp, 5, BranchU);
-	case cJU_JPBRANCH_U6:  PREPB_DCD(Pjp, 6, BranchU);
-	case cJU_JPBRANCH_U7:  PREPB(	 Pjp, 7, BranchU);
-#endif
-	case cJU_JPBRANCH_U:   PREPB_ROOT(	 BranchU);
-	{
-	    Pjbu_t Pjbu;
-
-// Common code (state-independent) for all cases of uncompressed branches:
-
-BranchU:
-	    Pjbu = P_JBU(Pjp->jp_Addr);
-
-// Common code for descending through a JP:
-//
-// Save the digit for the expanse in *PIndex, then "recurse".
-
-#define	JBU_FOUNDEXPANSE			\
-	{					\
-	    JU_SETDIGIT(*PIndex, jpnum, state);	\
-	    Pjp = (Pjbu->jbu_jp) + jpnum;	\
-	    goto SMByCount;			\
-	}
-
-
-#ifndef NOSMARTJBU  // enable to turn off smart code for comparison purposes.
-
-// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s
-// in JPs upwards, or subtracting the pop1s in JPs downwards:
-//
-// See header comments about limitations of this for Judy*ByCount().
-
-#endif
-
-// COUNT UPWARD, simply adding the pop1 of each JP:
-
-#ifndef NOSMARTJBU  // enable to turn off smart code for comparison purposes.
-
-	    if (LOWERHALF(Count0, pop1lower, pop1))
-	    {
-#endif
-#ifdef SMARTMETRICS
-		++jbu_upward;
-#endif
-
-		for (jpnum = 0; jpnum < cJU_BRANCHUNUMJPS; ++jpnum)
-		{
-		    // shortcut, save a function call:
-
-		    if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX)
-			continue;
-
-		    if ((pop1 = j__udyJPPop1((Pjbu->jbu_jp) + jpnum))
-		     == cJU_ALLONES)
-		    {
-			JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-			JUDY1CODE(return(JERRI );)
-			JUDYLCODE(return(PPJERR);)
-		    }
-		    assert(pop1 != 0);
-
-// Warning:  pop1lower and pop1 are unsigned, see earlier comment:
-
-		    if (pop1lower + pop1 > Count0)
-			JBU_FOUNDEXPANSE;	// Index is in this expanse.
-
-		    pop1lower += pop1;		// add this JPs pop1.
-		}
-#ifndef NOSMARTJBU  // enable to turn off smart code for comparison purposes.
-	    }
-
-
-// COUNT DOWNWARD, subtracting the pop1 of each JP above from the whole
-// expanses pop1:
-
-	    else
-	    {
-#ifdef SMARTMETRICS
-		++jbu_downward;
-#endif
-		pop1lower += pop1;		// add whole branch to start.
-
-		for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum >= 0; --jpnum)
-		{
-		    // shortcut, save a function call:
-
-		    if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX)
-			continue;
-
-		    if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum))
-		     == cJU_ALLONES)
-		    {
-			JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-			JUDY1CODE(return(JERRI );)
-			JUDYLCODE(return(PPJERR);)
-		    }
-		    assert(pop1 != 0);
-
-// Warning:  pop1lower and pop1 are unsigned, see earlier comment:
-
-		    pop1lower -= pop1;
-
-// Beware unsigned math problems:
-
-		    if ((pop1lower == 0) || (pop1lower - 1 < Count0))
-			JBU_FOUNDEXPANSE;	// Index is in this expanse.
-		}
-	    }
-#endif // NOSMARTJBU
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // should never get here.
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-	} // case cJU_JPBRANCH_U
-
-// ----------------------------------------------------------------------------
-// LINEAR LEAF:
-//
-// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf.  First
-// copy Dcd bytes, if there are any (only if state < cJU_ROOTSTATE - 1), to
-// *PIndex.
-//
-// Note:  The preceding branch traversal code MIGHT set pop1 for this expanse
-// (linear leaf) as a side-effect, but dont depend on that (for JUDYL, which
-// is the only cases that need it anyway).
-
-#define	PREPL_DCD(cState)				\
-	JU_SETDCD(*PIndex, Pjp, cState);	        \
-	PREPL
-
-#ifdef JUDY1
-#define	PREPL_SETPOP1			// not needed in any cases.
-#else
-#define	PREPL_SETPOP1  pop1 = JU_JPLEAF_POP0(Pjp) + 1
-#endif
-
-#define	PREPL				\
-	Pjll = P_JLL(Pjp->jp_Addr);	\
-	PREPL_SETPOP1;			\
-	SETOFFSET(offset, Count0, pop1lower, Pjp)
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:
-
-	    PREPL_DCD(1);
-	    JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]);
-	    JU_RET_FOUND_LEAF1(Pjll, pop1, offset);
-#endif
-
-	case cJU_JPLEAF2:
-
-	    PREPL_DCD(2);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-		    | ((uint16_t *) Pjll)[offset];
-	    JU_RET_FOUND_LEAF2(Pjll, pop1, offset);
-
-#ifndef JU_64BIT
-	case cJU_JPLEAF3:
-	{
-	    Word_t lsb;
-	    PREPL;
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-	}
-
-#else
-	case cJU_JPLEAF3:
-	{
-	    Word_t lsb;
-	    PREPL_DCD(3);
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF4:
-
-	    PREPL_DCD(4);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-		    | ((uint32_t *) Pjll)[offset];
-	    JU_RET_FOUND_LEAF4(Pjll, pop1, offset);
-
-	case cJU_JPLEAF5:
-	{
-	    Word_t lsb;
-	    PREPL_DCD(5);
-	    JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-	    JU_RET_FOUND_LEAF5(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF6:
-	{
-	    Word_t lsb;
-	    PREPL_DCD(6);
-	    JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-	    JU_RET_FOUND_LEAF6(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF7:
-	{
-	    Word_t lsb;
-	    PREPL;
-	    JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-	    JU_RET_FOUND_LEAF7(Pjll, pop1, offset);
-	}
-#endif
-
-
-// ----------------------------------------------------------------------------
-// BITMAP LEAF:
-//
-// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf by
-// counting bits.  First copy Dcd bytes (always present since state 1 <
-// cJU_ROOTSTATE) to *PIndex.
-//
-// Note:  The preceding branch traversal code MIGHT set pop1 for this expanse
-// (bitmap leaf) as a side-effect, but dont depend on that.
-
-	case cJU_JPLEAF_B1:
-	{
-	    Pjlb_t Pjlb;
-
-	    JU_SETDCD(*PIndex, Pjp, 1);
-	    Pjlb = P_JLB(Pjp->jp_Addr);
-	    pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-
-// COUNT UPWARD, adding the pop1 of each subexpanse:
-//
-// The entire bitmap should fit in one cache line, but still try to save some
-// CPU time by counting the fewest possible number of subexpanses from the
-// bitmap.
-//
-// See header comments about limitations of this for Judy*ByCount().
-
-#ifndef NOSMARTJLB  // enable to turn off smart code for comparison purposes.
-
-	    if (LOWERHALF(Count0, pop1lower, pop1))
-	    {
-#endif
-#ifdef SMARTMETRICS
-		++jlb_upward;
-#endif
-		for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp)
-		{
-		    pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp));
-
-// Warning:  pop1lower and pop1 are unsigned, see earlier comment:
-
-		    if (pop1lower + pop1 > Count0)
-			goto LeafB1;		// Index is in this subexpanse.
-
-		    pop1lower += pop1;		// add this subexpanses pop1.
-		}
-#ifndef NOSMARTJLB  // enable to turn off smart code for comparison purposes.
-	    }
-
-
-// COUNT DOWNWARD, subtracting each "above" subexpanses pop1 from the whole
-// expanses pop1:
-
-	    else
-	    {
-#ifdef SMARTMETRICS
-		++jlb_downward;
-#endif
-		pop1lower += pop1;		// add whole leaf to start.
-
-		for (subexp = cJU_NUMSUBEXPL - 1; subexp >= 0; --subexp)
-		{
-		    pop1lower -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp));
-
-// Beware unsigned math problems:
-
-		    if ((pop1lower == 0) || (pop1lower - 1 < Count0))
-			goto LeafB1;		// Index is in this subexpanse.
-		}
-	    }
-#endif // NOSMARTJLB
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // should never get here.
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-
-// RETURN INDEX FOUND:
-//
-// Come here with subexp set to the correct subexpanse, and pop1lower set to
-// the sum for all lower expanses and subexpanses in the Judy tree.  Calculate
-// and save in *PIndex the digit corresponding to the ordinal in this
-// subexpanse.
-
-LeafB1:
-	    SETOFFSET(offset, Count0, pop1lower, Pjp);
-	    JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset);
-	    JU_SETDIGIT1(*PIndex, digit);
-	    JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset);
-//	    == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + offset))
-
-	} // case cJU_JPLEAF_B1
-
-
-#ifdef JUDY1
-// ----------------------------------------------------------------------------
-// FULL POPULATION:
-//
-// Copy Dcd bytes (always present since state 1 < cJU_ROOTSTATE) to *PIndex,
-// then set the appropriate digit for the ordinal (see SETOFFSET()) in the leaf
-// as the LSB in *PIndex.
-
-	case cJ1_JPFULLPOPU1:
-
-	    JU_SETDCD(*PIndex, Pjp, 1);
-	    SETOFFSET(offset, Count0, pop1lower, Pjp);
-	    assert(offset >= 0);
-	    assert(offset <= cJU_JPFULLPOPU1_POP0);
-	    JU_SETDIGIT1(*PIndex, offset);
-	    JU_RET_FOUND_FULLPOPU1;
-#endif
-
-
-// ----------------------------------------------------------------------------
-// IMMEDIATE:
-//
-// Locate the Index with the proper ordinal (see SETOFFSET()) in the Immediate,
-// depending on leaf Index Size and pop1.  Note:  There are no Dcd bytes in an
-// Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the least bytes
-// of the immediate Index.
-
-#define	SET_01(cState)  JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState)
-
-	case cJU_JPIMMED_1_01: SET_01(1); goto Imm_01;
-	case cJU_JPIMMED_2_01: SET_01(2); goto Imm_01;
-	case cJU_JPIMMED_3_01: SET_01(3); goto Imm_01;
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01: SET_01(4); goto Imm_01;
-	case cJU_JPIMMED_5_01: SET_01(5); goto Imm_01;
-	case cJU_JPIMMED_6_01: SET_01(6); goto Imm_01;
-	case cJU_JPIMMED_7_01: SET_01(7); goto Imm_01;
-#endif
-
-Imm_01:
-
-	    DBGCODE(SETOFFSET_IMM_CK(offset, Count0, pop1lower, 1);)
-	    JU_RET_FOUND_IMM_01(Pjp);
-
-// Shorthand for where to find start of Index bytes array:
-
-#ifdef JUDY1
-#define	PJI (Pjp->jp_1Index)
-#else
-#define	PJI (Pjp->jp_LIndex)
-#endif
-
-// Optional code to check the remaining ordinal (see SETOFFSET_IMM()) against
-// the Index Size of the Immediate:
-
-#ifndef DEBUG				// simple placeholder:
-#define	IMM(cPop1,Next) \
-	goto Next
-#else					// extra pop1-specific checking:
-#define	IMM(cPop1,Next)						\
-	SETOFFSET_IMM_CK(offset, Count0, pop1lower, cPop1);	\
-	goto Next
-#endif
-
-	case cJU_JPIMMED_1_02: IMM( 2, Imm1);
-	case cJU_JPIMMED_1_03: IMM( 3, Imm1);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04: IMM( 4, Imm1);
-	case cJU_JPIMMED_1_05: IMM( 5, Imm1);
-	case cJU_JPIMMED_1_06: IMM( 6, Imm1);
-	case cJU_JPIMMED_1_07: IMM( 7, Imm1);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08: IMM( 8, Imm1);
-	case cJ1_JPIMMED_1_09: IMM( 9, Imm1);
-	case cJ1_JPIMMED_1_10: IMM(10, Imm1);
-	case cJ1_JPIMMED_1_11: IMM(11, Imm1);
-	case cJ1_JPIMMED_1_12: IMM(12, Imm1);
-	case cJ1_JPIMMED_1_13: IMM(13, Imm1);
-	case cJ1_JPIMMED_1_14: IMM(14, Imm1);
-	case cJ1_JPIMMED_1_15: IMM(15, Imm1);
-#endif
-
-Imm1:	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]);
-	    JU_RET_FOUND_IMM(Pjp, offset);
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02: IMM(2, Imm2);
-	case cJU_JPIMMED_2_03: IMM(3, Imm2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04: IMM(4, Imm2);
-	case cJ1_JPIMMED_2_05: IMM(5, Imm2);
-	case cJ1_JPIMMED_2_06: IMM(6, Imm2);
-	case cJ1_JPIMMED_2_07: IMM(7, Imm2);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-Imm2:	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-		    | ((uint16_t *) PJI)[offset];
-	    JU_RET_FOUND_IMM(Pjp, offset);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02: IMM(2, Imm3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03: IMM(3, Imm3);
-	case cJ1_JPIMMED_3_04: IMM(4, Imm3);
-	case cJ1_JPIMMED_3_05: IMM(5, Imm3);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-Imm3:
-	{
-	    Word_t lsb;
-	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_4_02: IMM(2, Imm4);
-	case cJ1_JPIMMED_4_03: IMM(3, Imm4);
-
-Imm4:	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-		    | ((uint32_t *) PJI)[offset];
-	    JU_RET_FOUND_IMM(Pjp, offset);
-
-	case cJ1_JPIMMED_5_02: IMM(2, Imm5);
-	case cJ1_JPIMMED_5_03: IMM(3, Imm5);
-
-Imm5:
-	{
-	    Word_t lsb;
-	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-
-	case cJ1_JPIMMED_6_02: IMM(2, Imm6);
-
-Imm6:
-	{
-	    Word_t lsb;
-	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-
-	case cJ1_JPIMMED_7_02: IMM(2, Imm7);
-
-Imm7:
-	{
-	    Word_t lsb;
-	    SETOFFSET_IMM(offset, Count0, pop1lower);
-	    JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-#endif // (JUDY1 && JU_64BIT)
-
-
-// ----------------------------------------------------------------------------
-// UNEXPECTED JP TYPES:
-
-	default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		 JUDY1CODE(return(JERRI );)
-		 JUDYLCODE(return(PPJERR);)
-
-	} // SMByCount switch.
-
-	/*NOTREACHED*/
-
-} // Judy1ByCount() / JudyLByCount()
diff --git a/libs/klib/judy/JudyByCountWithDefs.c b/libs/klib/judy/JudyByCountWithDefs.c
deleted file mode 100644
index b4ad243..0000000
--- a/libs/klib/judy/JudyByCountWithDefs.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define NOSMARTJBB 1
-#define NOSMARTJBU 1
-#define NOSMARTJLB 1
-#include "JudyByCount.c"
diff --git a/libs/klib/judy/JudyCascade.c b/libs/klib/judy/JudyCascade.c
deleted file mode 100644
index fccb747..0000000
--- a/libs/klib/judy/JudyCascade.c
+++ /dev/null
@@ -1,1940 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t);
-extern int j__udyCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t);
-
-DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);)
-
-static const jbb_t StageJBBZero;	// zeroed versions of namesake struct.
-
-// TBD:  There are multiple copies of (some of) these CopyWto3, Copy3toW,
-// CopyWto7 and Copy7toW functions in Judy1Cascade.c, JudyLCascade.c, and
-// JudyDecascade.c.  These static functions should probably be moved to a
-// common place, made macros, or something to avoid having four copies.
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   X   T O   W
-
-
-FUNCTION static void j__udyCopy3toW(
-	PWord_t	  PDest,
-	uint8_t * PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc);
-		PSrc	+= 3;
-		PDest	+= 1;
-
-	} while(--LeafIndexes);
-
-} //j__udyCopy3toW()
-
-
-#ifdef JU_64BIT
-
-FUNCTION static void j__udyCopy4toW(
-	PWord_t	   PDest,
-	uint32_t * PSrc,
-	Word_t	   LeafIndexes)
-{
-	do { *PDest++ = *PSrc++;
-	} while(--LeafIndexes);
-
-} // j__udyCopy4toW()
-
-
-FUNCTION static void j__udyCopy5toW(
-	PWord_t	  PDest,
-	uint8_t	* PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY5_PINDEX_TO_LONG(*PDest, PSrc);
-		PSrc	+= 5;
-		PDest	+= 1;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopy5toW()
-
-
-FUNCTION static void j__udyCopy6toW(
-	PWord_t	  PDest,
-	uint8_t	* PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY6_PINDEX_TO_LONG(*PDest, PSrc);
-		PSrc	+= 6;
-		PDest	+= 1;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopy6toW()
-
-
-FUNCTION static void j__udyCopy7toW(
-	PWord_t	  PDest,
-	uint8_t	* PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc);
-		PSrc	+= 7;
-		PDest	+= 1;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopy7toW()
-
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   W   T O   X
-
-
-FUNCTION static void j__udyCopyWto3(
-	uint8_t	* PDest,
-	PWord_t	  PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY3_LONG_TO_PINDEX(PDest, *PSrc);
-		PSrc	+= 1;
-		PDest	+= 3;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopyWto3()
-
-
-#ifdef JU_64BIT
-
-FUNCTION static void j__udyCopyWto4(
-	uint8_t	* PDest,
-	PWord_t	  PSrc,
-	Word_t	  LeafIndexes)
-{
-	uint32_t *PDest32 = (uint32_t *)PDest;
-
-	do
-	{
-		*PDest32 = *PSrc;
-		PSrc	+= 1;
-		PDest32	+= 1;
-	} while(--LeafIndexes);
-
-} // j__udyCopyWto4()
-
-
-FUNCTION static void j__udyCopyWto5(
-	uint8_t	* PDest,
-	PWord_t	  PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY5_LONG_TO_PINDEX(PDest, *PSrc);
-		PSrc	+= 1;
-		PDest	+= 5;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopyWto5()
-
-
-FUNCTION static void j__udyCopyWto6(
-	uint8_t	* PDest,
-	PWord_t	  PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY6_LONG_TO_PINDEX(PDest, *PSrc);
-		PSrc	+= 1;
-		PDest	+= 6;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopyWto6()
-
-
-FUNCTION static void j__udyCopyWto7(
-	uint8_t	* PDest,
-	PWord_t	  PSrc,
-	Word_t	  LeafIndexes)
-{
-	do
-	{
-		JU_COPY7_LONG_TO_PINDEX(PDest, *PSrc);
-		PSrc	+= 1;
-		PDest	+= 7;
-
-	} while(--LeafIndexes);
-
-} // j__udyCopyWto7()
-
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// COMMON CODE (MACROS):
-//
-// Free objects in an array of valid JPs, StageJP[ExpCnt] == last one may
-// include Immeds, which are ignored.
-
-#define FREEALLEXIT(ExpCnt,StageJP,Pjpm)				\
-	{								\
-	    Word_t _expct = (ExpCnt);					\
-	    while (_expct--) j__udyFreeSM(&((StageJP)[_expct]), Pjpm);  \
-	    return(-1);                                                 \
-	}
-
-// Clear the array that keeps track of the number of JPs in a subexpanse:
-
-#define ZEROJP(SubJPCount)                                              \
-	{								\
-		int ii;							\
-		for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) (SubJPCount[ii]) = 0; \
-	}
-
-// ****************************************************************************
-// __ J U D Y   S T A G E   J B B   T O   J B B
-//
-// Create a mallocd BranchB (jbb_t) from a staged BranchB while "splaying" a
-// single old leaf.  Return -1 if out of memory, otherwise 1.
-
-static int j__udyStageJBBtoJBB(
-	Pjp_t     PjpLeaf,	// JP of leaf being splayed.
-	Pjbb_t    PStageJBB,	// temp jbb_t on stack.
-	Pjp_t     PjpArray,	// array of JPs to splayed new leaves.
-	uint8_t * PSubCount,	// count of JPs for each subexpanse.
-	Pjpm_t    Pjpm)		// the jpm_t for JudyAlloc*().
-{
-	Pjbb_t    PjbbRaw;	// pointer to new bitmap branch.
-	Pjbb_t    Pjbb;
-	Word_t    subexp;
-
-// Get memory for new BranchB:
-
-	if ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL) return(-1);
-	Pjbb = P_JBB(PjbbRaw);
-
-// Copy staged BranchB into just-allocated BranchB:
-
-	*Pjbb = *PStageJBB;
-
-// Allocate the JP subarrays (BJP) for the new BranchB:
-
-	for (subexp = 0; subexp < cJU_NUMSUBEXPB; subexp++)
-	{
-	    Pjp_t  PjpRaw;
-	    Pjp_t  Pjp;
-	    Word_t NumJP;       // number of JPs in each subexpanse.
-
-	    if ((NumJP = PSubCount[subexp]) == 0) continue;	// empty.
-
-// Out of memory, back out previous allocations:
-
-	    if ((PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm)) == (Pjp_t) NULL)
-	    {
-		while(subexp--)
-		{
-		    if ((NumJP = PSubCount[subexp]) == 0) continue;
-
-		    PjpRaw = JU_JBB_PJP(Pjbb, subexp);
-		    j__udyFreeJBBJP(PjpRaw, NumJP, Pjpm);
-		}
-		j__udyFreeJBB(PjbbRaw, Pjpm);
-		return(-1);	// out of memory.
-	    }
-	    Pjp = P_JP(PjpRaw);
-
-// Place the JP subarray pointer in the new BranchB, copy subarray JPs, and
-// advance to the next subexpanse:
-
-	    JU_JBB_PJP(Pjbb, subexp) = PjpRaw;
-	    JU_COPYMEM(Pjp, PjpArray, NumJP);
-	    PjpArray += NumJP;
-
-	} // for each subexpanse.
-
-// Change the PjpLeaf from Leaf to BranchB:
-
-	PjpLeaf->jp_Addr  = (Word_t) PjbbRaw;
-	PjpLeaf->jp_Type += cJU_JPBRANCH_B2 - cJU_JPLEAF2;  // Leaf to BranchB.
-
-	return(1);
-
-} // j__udyStageJBBtoJBB()
-
-
-// ****************************************************************************
-// __ J U D Y   J L L 2   T O   J L B 1
-//
-// Create a LeafB1 (jlb_t = JLB1) from a Leaf2 (2-byte Indexes and for JudyL,
-// Word_t Values).  Return NULL if out of memory, else a pointer to the new
-// LeafB1.
-//
-// NOTE:  Caller must release the Leaf2 that was passed in.
-
-FUNCTION static Pjlb_t j__udyJLL2toJLB1(
-	uint16_t * Pjll,	// array of 16-bit indexes.
-#ifdef JUDYL
-	Pjv_t      Pjv,		// array of associated values.
-#endif
-	Word_t     LeafPop1,	// number of indexes/values.
-	Pvoid_t    Pjpm)	// jpm_t for JudyAlloc*()/JudyFree*().
-{
-	Pjlb_t     PjlbRaw;
-	Pjlb_t     Pjlb;
-	int	   offset;
-JUDYLCODE(int	   subexp;)
-
-// Allocate the LeafB1:
-
-	if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL)
-	    return((Pjlb_t) NULL);
-	Pjlb = P_JLB(PjlbRaw);
-
-// Copy Leaf2 indexes to LeafB1:
-
-	for (offset = 0; offset < LeafPop1; ++offset)
-	    JU_BITMAPSETL(Pjlb, Pjll[offset]);
-
-#ifdef JUDYL
-
-// Build LeafVs from bitmap:
-
-	for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp)
-	{
-	    struct _POINTER_VALUES
-	    {
-		Word_t pv_Pop1;		// size of value area.
-		Pjv_t  pv_Pjv;		// raw pointer to value area.
-	    } pv[cJU_NUMSUBEXPL];
-
-// Get the population of the subexpanse, and if any, allocate a LeafV:
-
-	    pv[subexp].pv_Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp));
-
-	    if (pv[subexp].pv_Pop1)
-	    {
-		Pjv_t Pjvnew;
-
-// TBD:  There is an opportunity to put pop == 1 value in pointer:
-
-		pv[subexp].pv_Pjv = j__udyLAllocJV(pv[subexp].pv_Pop1, Pjpm);
-
-// Upon out of memory, free all previously allocated:
-
-		if (pv[subexp].pv_Pjv == (Pjv_t) NULL)
-		{
-		    while(subexp--)
-		    {
-			if (pv[subexp].pv_Pop1)
-			{
-			    j__udyLFreeJV(pv[subexp].pv_Pjv, pv[subexp].pv_Pop1,
-					  Pjpm);
-			}
-		    }
-		    j__udyFreeJLB1(PjlbRaw, Pjpm);
-		    return((Pjlb_t) NULL);
-		}
-
-		Pjvnew = P_JV(pv[subexp].pv_Pjv);
-		JU_COPYMEM(Pjvnew, Pjv, pv[subexp].pv_Pop1);
-		Pjv += pv[subexp].pv_Pop1;	// advance value pointer.
-
-// Place raw pointer to value array in bitmap subexpanse:
-
-		JL_JLB_PVALUE(Pjlb, subexp) = pv[subexp].pv_Pjv;
-
-	    } // populated subexpanse.
-	} // each subexpanse.
-
-#endif // JUDYL
-
-	return(PjlbRaw);	// pointer to LeafB1.
-
-} // j__udyJLL2toJLB1()
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 1
-//
-// Create bitmap leaf from 1-byte Indexes and Word_t Values.
-//
-// TBD:  There must be a better way.
-//
-// Only for JudyL 32 bit:  (note, unifdef disallows comment on next line)
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-FUNCTION int j__udyCascade1(
-	Pjp_t	   Pjp,
-	Pvoid_t    Pjpm)
-{
-        Word_t     DcdP0;
-	uint8_t	 * PLeaf;
-	Pjlb_t	   PjlbRaw;
-	Pjlb_t	   Pjlb;
-	Word_t     Pop1;
-	Word_t     ii;		// temp for loop counter
-JUDYLCODE(Pjv_t	   Pjv;)
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF1);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFF) == (cJU_LEAF1_MAXPOP1-1));
-
-	PjlbRaw = j__udyAllocJLB1(Pjpm);
-	if (PjlbRaw == (Pjlb_t) NULL) return(-1);
-
-	Pjlb  = P_JLB(PjlbRaw);
-	PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr);
-	Pop1  = JU_JPLEAF_POP0(Pjp) + 1;
-
-	JUDYLCODE(Pjv = JL_LEAF1VALUEAREA(PLeaf, Pop1);)
-
-//	Copy 1 byte index Leaf to bitmap Leaf
-	for (ii = 0; ii < Pop1; ii++) JU_BITMAPSETL(Pjlb, PLeaf[ii]);
-
-#ifdef JUDYL
-//	Build 8 subexpanse Value leaves from bitmap
-	for (ii = 0; ii < cJU_NUMSUBEXPL; ii++)
-	{
-//	    Get number of Indexes in subexpanse
-	    if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii))))
-	    {
-		Pjv_t PjvnewRaw;	// value area of new leaf.
-		Pjv_t Pjvnew;
-
-		PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm);
-		if (PjvnewRaw == (Pjv_t) NULL)	// out of memory.
-		{
-//                  Free prevously allocated LeafVs:
-		    while(ii--)
-		    {
-			if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii))))
-			{
-			    PjvnewRaw = JL_JLB_PVALUE(Pjlb, ii);
-			    j__udyLFreeJV(PjvnewRaw, Pop1, Pjpm);
-			}
-		    }
-//                  Free the bitmap leaf
-		    j__udyLFreeJLB1(PjlbRaw,Pjpm);
-		    return(-1);
-		}
-		Pjvnew    = P_JV(PjvnewRaw);
-		JU_COPYMEM(Pjvnew, Pjv, Pop1);
-
-		Pjv += Pop1;
-		JL_JLB_PVALUE(Pjlb, ii) = PjvnewRaw;
-	    }
-	}
-#endif // JUDYL
-
-	DcdP0 = JU_JPDCDPOP0(Pjp) | (PLeaf[0] & cJU_DCDMASK(1));
-        JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1);
-
-	return(1);	// return success
-
-} // j__udyCascade1()
-
-#endif // (!(JUDY1 && JU_64BIT))
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 2
-//
-// Entry PLeaf of size LeafPop1 is either compressed or splayed with pointer
-// returned in Pjp.  Entry Levels sizeof(Word_t) down to level 2.
-//
-// Splay or compress the 2-byte Index Leaf that Pjp point to.  Return *Pjp as a
-// (compressed) cJU_LEAFB1 or a cJU_BRANCH_*2
-
-FUNCTION int j__udyCascade2(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint16_t * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF2_MAXPOP1];  // JPs of new leaves
-	uint8_t	   StageExp  [cJU_LEAF2_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF2);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFFFF) == (cJU_LEAF2_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint16_t *) P_JLL(Pjp->jp_Addr);
-
-//	And its Value area
-	JUDYLCODE(Pjv = JL_LEAF2VALUEAREA(PLeaf, cJU_LEAF2_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it to a Bitmap Leaf
-
-	CIndex = PLeaf[0];
-	if (!JU_DIGITATSTATE(CIndex ^ PLeaf[cJU_LEAF2_MAXPOP1-1], 2))
-	{
-//	cJU_JPLEAF_B1
-                Word_t DcdP0;
-		Pjlb_t PjlbRaw;
-		PjlbRaw = j__udyJLL2toJLB1(PLeaf,
-#ifdef JUDYL
-				     Pjv,
-#endif
-				     cJU_LEAF2_MAXPOP1, Pjpm);
-		if (PjlbRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-//		Merge in another Dcd byte because compressing
-		DcdP0 = (CIndex & cJU_DCDMASK(1)) | JU_JPDCDPOP0(Pjp);
-                JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1);
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 2 byte index Leaf to 1 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF2_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ PLeaf[End], 2))
-		   )
-		{
-//			Build a leaf below the previous expanse
-//
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 2);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 2);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_1_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(1)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_1_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, 
-                                cJL_JPIMMED_1_01);
-#endif  // JUDYL
-			}
-			else if (Pop1 <= cJU_IMMED1_MAXPOP1) // bigger
-			{
-//		cJL_JPIMMED_1_02..3:  JudyL 32
-//		cJ1_JPIMMED_1_02..7:  Judy1 32
-//		cJL_JPIMMED_1_02..7:  JudyL 64
-//		cJ1_JPIMMED_1_02..15: Judy1 64
-#ifdef JUDYL
-				Pjv_t  PjvnewRaw;	// value area of leaf.
-				Pjv_t  Pjvnew;
-
-//				Allocate Value area for Immediate Leaf
-				PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm);
-				if (PjvnewRaw == (Pjv_t) NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjvnew = P_JV(PjvnewRaw);
-
-//				Copy to Values to Value Leaf
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-				PjpJP->jp_Addr = (Word_t) PjvnewRaw;
-
-//				Copy to JP as an immediate Leaf
-				JU_COPYMEM(PjpJP->jp_LIndex, PLeaf + Start,
-					   Pop1);
-#else
-				JU_COPYMEM(PjpJP->jp_1Index, PLeaf + Start,
-					   Pop1);
-#endif
-//				Set Type, Population and Index size
-				PjpJP->jp_Type = cJU_JPIMMED_1_02 + Pop1 - 2;
-			}
-
-// 64Bit Judy1 does not have Leaf1:  (note, unifdef disallows comment on next
-// line)
-
-#if (! (defined(JUDY1) && defined(JU_64BIT)))
-			else if (Pop1 <= cJU_LEAF1_MAXPOP1) // still bigger
-			{
-//		cJU_JPLEAF1
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//				Get a new Leaf
-				PjllRaw = j__udyAllocJLL1(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjll = P_JLL(PjllRaw);
-#ifdef JUDYL
-//				Copy to Values to new Leaf
-				Pjvnew = JL_LEAF1VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-//				Copy Indexes to new Leaf
-				JU_COPYMEM((uint8_t *)Pjll, PLeaf+Start, Pop1);
-
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 1);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(2-1))
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF1);
-			}
-#endif //  (!(JUDY1 && JU_64BIT)) // Not 64Bit Judy1
-
-			else				// biggest
-			{
-//		cJU_JPLEAF_B1
-                                Word_t  DcdP0;
-				Pjlb_t PjlbRaw;
-				PjlbRaw = j__udyJLL2toJLB1(
-						PLeaf + Start,
-#ifdef JUDYL
-						Pjv + Start,
-#endif
-						Pop1, Pjpm);
-				if (PjlbRaw == (Pjlb_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(2-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjlbRaw, DcdP0,
-                                        cJU_JPLEAF_B1);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF2_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = PLeaf[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L2;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-} // j__udyCascade2()
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 3
-//
-// Return *Pjp as a (compressed) cJU_LEAF2, cJU_BRANCH_L3, cJU_BRANCH_B3.
-
-FUNCTION int j__udyCascade3(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint8_t  * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF3_MAXPOP1];  // JPs of new leaves
-	Word_t	   StageA    [cJU_LEAF3_MAXPOP1];
-	uint8_t	   StageExp  [cJU_LEAF3_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF3);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFF) == (cJU_LEAF3_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-//	Extract leaf to Word_t and insert-sort Index into it
-	j__udyCopy3toW(StageA, PLeaf, cJU_LEAF3_MAXPOP1);
-
-//	Get the address of the Leaf and Value area
-	JUDYLCODE(Pjv = JL_LEAF3VALUEAREA(PLeaf, cJU_LEAF3_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index)
-
-	CIndex = StageA[0];
-	if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF3_MAXPOP1-1], 3))
-	{
-                Word_t DcdP0;
-		Pjll_t PjllRaw;	 // pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//		Alloc a 2 byte Index Leaf
-		PjllRaw	= j__udyAllocJLL2(cJU_LEAF3_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy just 2 bytes Indexes to new Leaf
-//		j__udyCopyWto2((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1);
-		JU_COPYMEM    ((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1);
-#ifdef JUDYL
-//		Copy Value area into new Leaf
-		Pjvnew = JL_LEAF2VALUEAREA(Pjll, cJU_LEAF3_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF3_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF3_MAXPOP1, 2);)
-
-//		Form new JP, Pop0 field is unchanged
-//		Add in another Dcd byte because compressing
-                DcdP0 = (CIndex & cJU_DCDMASK(2)) | JU_JPDCDPOP0(Pjp);
-
-                JU_JPSETADT(Pjp, (Word_t) PjllRaw, DcdP0, cJU_JPLEAF2);
-
-		return(1); // Success
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 3 byte index Leaf to 2 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF3_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ StageA[End], 3))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 3);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 3);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_2_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_2_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, 
-                                cJL_JPIMMED_2_01);
-#endif  // JUDYL
-			}
-#if (defined(JUDY1) || defined(JU_64BIT))
-			else if (Pop1 <= cJU_IMMED2_MAXPOP1)
-			{
-//		cJ1_JPIMMED_2_02..3:  Judy1 32
-//		cJL_JPIMMED_2_02..3:  JudyL 64
-//		cJ1_JPIMMED_2_02..7:  Judy1 64
-#ifdef JUDYL
-//				Alloc is 1st in case of malloc fail
-				Pjv_t PjvnewRaw;  // value area of new leaf.
-				Pjv_t Pjvnew;
-
-//				Allocate Value area for Immediate Leaf
-				PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm);
-				if (PjvnewRaw == (Pjv_t) NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjvnew = P_JV(PjvnewRaw);
-
-//				Copy to Values to Value Leaf
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-
-				PjpJP->jp_Addr = (Word_t) PjvnewRaw;
-
-//				Copy to Index to JP as an immediate Leaf
-				JU_COPYMEM((uint16_t *) (PjpJP->jp_LIndex),
-					   StageA + Start, Pop1);
-#else // JUDY1
-				JU_COPYMEM((uint16_t *) (PjpJP->jp_1Index),
-					   StageA + Start, Pop1);
-#endif // JUDY1
-//				Set Type, Population and Index size
-				PjpJP->jp_Type = cJU_JPIMMED_2_02 + Pop1 - 2;
-			}
-#endif // (JUDY1 || JU_64BIT)
-
-			else	// Make a linear leaf2
-			{
-//		cJU_JPLEAF2
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-				PjllRaw = j__udyAllocJLL2(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t) NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjll = P_JLL(PjllRaw);
-#ifdef JUDYL
-//				Copy to Values to new Leaf
-				Pjvnew = JL_LEAF2VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-//				Copy least 2 bytes per Index of Leaf to new Leaf
-				JU_COPYMEM((uint16_t *) Pjll, StageA+Start,
-					   Pop1);
-
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 2);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(3-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF2);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF3_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = StageA[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L3;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-} // j__udyCascade3()
-
-
-#ifdef JU_64BIT   // JudyCascade[4567]
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 4
-//
-// Cascade from a cJU_JPLEAF4 to one of the following:
-//  1. if leaf is in 1 expanse:
-//        compress it into a JPLEAF3
-//  2. if leaf contains multiple expanses:
-//        create linear or bitmap branch containing
-//        each new expanse is either a:
-//               JPIMMED_3_01  branch
-//               JPIMMED_3_02  branch
-//               JPLEAF3
-
-FUNCTION int j__udyCascade4(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint32_t * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF4_MAXPOP1];  // JPs of new leaves
-	Word_t	   StageA    [cJU_LEAF4_MAXPOP1];
-	uint8_t	   StageExp  [cJU_LEAF4_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF4);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFF) == (cJU_LEAF4_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint32_t *) P_JLL(Pjp->jp_Addr);
-
-//	Extract 4 byte index Leaf to Word_t
-	j__udyCopy4toW(StageA, PLeaf, cJU_LEAF4_MAXPOP1);
-
-//	Get the address of the Leaf and Value area
-	JUDYLCODE(Pjv = JL_LEAF4VALUEAREA(PLeaf, cJU_LEAF4_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index)
-
-	CIndex = StageA[0];
-	if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF4_MAXPOP1-1], 4))
-	{
-                Word_t DcdP0;
-		Pjll_t PjllRaw;	 // pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new Leaf.
-
-//		Alloc a 3 byte Index Leaf
-		PjllRaw = j__udyAllocJLL3(cJU_LEAF4_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy Index area into new Leaf
-		j__udyCopyWto3((uint8_t *) Pjll, StageA, cJU_LEAF4_MAXPOP1);
-#ifdef JUDYL
-//		Copy Value area into new Leaf
-		Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAF4_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF4_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF4_MAXPOP1, 3);)
-
-	        DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(3));
-                JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF3);
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 4 byte index Leaf to 3 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF4_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ StageA[End], 4))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 4);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 4);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_3_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_3_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0,
-                                cJL_JPIMMED_3_01);
-#endif  // JUDYL
-			}
-			else if (Pop1 <= cJU_IMMED3_MAXPOP1)
-			{
-//		cJ1_JPIMMED_3_02   :  Judy1 32
-//		cJL_JPIMMED_3_02   :  JudyL 64
-//		cJ1_JPIMMED_3_02..5:  Judy1 64
-
-#ifdef JUDYL
-//				Alloc is 1st in case of malloc fail
-				Pjv_t PjvnewRaw;  // value area of new leaf.
-				Pjv_t Pjvnew;
-
-//				Allocate Value area for Immediate Leaf
-				PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm);
-				if (PjvnewRaw == (Pjv_t) NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjvnew = P_JV(PjvnewRaw);
-
-//				Copy to Values to Value Leaf
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-				PjpJP->jp_Addr = (Word_t) PjvnewRaw;
-
-//				Copy to Index to JP as an immediate Leaf
-				j__udyCopyWto3(PjpJP->jp_LIndex,
-					       StageA + Start, Pop1);
-#else
-				j__udyCopyWto3(PjpJP->jp_1Index,
-					       StageA + Start, Pop1);
-#endif
-//				Set type, population and Index size
-				PjpJP->jp_Type = cJU_JPIMMED_3_02 + Pop1 - 2;
-			}
-			else
-			{
-//		cJU_JPLEAF3
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-				PjllRaw = j__udyAllocJLL3(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjll = P_JLL(PjllRaw);
-
-//				Copy Indexes to new Leaf
-				j__udyCopyWto3((uint8_t *) Pjll, StageA + Start,
-					       Pop1);
-#ifdef JUDYL
-//				Copy to Values to new Leaf
-				Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(4-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF3);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF4_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = StageA[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L4;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-}  // j__udyCascade4()
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 5
-//
-// Cascade from a cJU_JPLEAF5 to one of the following:
-//  1. if leaf is in 1 expanse:
-//        compress it into a JPLEAF4
-//  2. if leaf contains multiple expanses:
-//        create linear or bitmap branch containing
-//        each new expanse is either a:
-//               JPIMMED_4_01  branch
-//               JPLEAF4
-
-FUNCTION int j__udyCascade5(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint8_t  * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF5_MAXPOP1];  // JPs of new leaves
-	Word_t	   StageA    [cJU_LEAF5_MAXPOP1];
-	uint8_t	   StageExp  [cJU_LEAF5_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF5);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFF) == (cJU_LEAF5_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-//	Extract 5 byte index Leaf to Word_t
-	j__udyCopy5toW(StageA, PLeaf, cJU_LEAF5_MAXPOP1);
-
-//	Get the address of the Leaf and Value area
-	JUDYLCODE(Pjv = JL_LEAF5VALUEAREA(PLeaf, cJU_LEAF5_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index)
-
-	CIndex = StageA[0];
-	if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF5_MAXPOP1-1], 5))
-	{
-                Word_t DcdP0;
-		Pjll_t PjllRaw;	 // pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//		Alloc a 4 byte Index Leaf
-		PjllRaw = j__udyAllocJLL4(cJU_LEAF5_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy Index area into new Leaf
-		j__udyCopyWto4((uint8_t *) Pjll, StageA, cJU_LEAF5_MAXPOP1);
-#ifdef JUDYL
-//		Copy Value area into new Leaf
-		Pjvnew = JL_LEAF4VALUEAREA(Pjll, cJU_LEAF5_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF5_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF5_MAXPOP1, 4);)
-
-	        DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(4));
-                JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF4);
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 5 byte index Leaf to 4 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF5_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ StageA[End], 5))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 5);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 5);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_4_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_4_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0,
-                                cJL_JPIMMED_4_01);
-#endif  // JUDYL
-			}
-#ifdef JUDY1
-			else if (Pop1 <= cJ1_IMMED4_MAXPOP1)
-			{
-//		cJ1_JPIMMED_4_02..3: Judy1 64
-
-//                              Copy to Index to JP as an immediate Leaf
-				j__udyCopyWto4(PjpJP->jp_1Index,
-					       StageA + Start, Pop1);
-
-//                              Set pointer, type, population and Index size
-				PjpJP->jp_Type = cJ1_JPIMMED_4_02 + Pop1 - 2;
-			}
-#endif
-			else
-			{
-//		cJU_JPLEAF4
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//				Get a new Leaf
-				PjllRaw = j__udyAllocJLL4(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjll = P_JLL(PjllRaw);
-
-//				Copy Indexes to new Leaf
-				j__udyCopyWto4((uint8_t *) Pjll, StageA + Start,
-					       Pop1);
-#ifdef JUDYL
-//				Copy to Values to new Leaf
-				Pjvnew = JL_LEAF4VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 4);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(5-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF4);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF5_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = StageA[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L5;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-}  // j__udyCascade5()
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 6
-//
-// Cascade from a cJU_JPLEAF6 to one of the following:
-//  1. if leaf is in 1 expanse:
-//        compress it into a JPLEAF5
-//  2. if leaf contains multiple expanses:
-//        create linear or bitmap branch containing
-//        each new expanse is either a:
-//               JPIMMED_5_01 ... JPIMMED_5_03  branch
-//               JPIMMED_5_01  branch
-//               JPLEAF5
-
-FUNCTION int j__udyCascade6(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint8_t  * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF6_MAXPOP1];  // JPs of new leaves
-	Word_t	   StageA    [cJU_LEAF6_MAXPOP1];
-	uint8_t	   StageExp  [cJU_LEAF6_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF6);
-	assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFFFF) == (cJU_LEAF6_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-//	Extract 6 byte index Leaf to Word_t
-	j__udyCopy6toW(StageA, PLeaf, cJU_LEAF6_MAXPOP1);
-
-//	Get the address of the Leaf and Value area
-	JUDYLCODE(Pjv = JL_LEAF6VALUEAREA(PLeaf, cJU_LEAF6_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index)
-
-	CIndex = StageA[0];
-	if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF6_MAXPOP1-1], 6))
-	{
-                Word_t DcdP0;
-		Pjll_t PjllRaw;	 // pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//		Alloc a 5 byte Index Leaf
-		PjllRaw = j__udyAllocJLL5(cJU_LEAF6_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy Index area into new Leaf
-		j__udyCopyWto5((uint8_t *) Pjll, StageA, cJU_LEAF6_MAXPOP1);
-#ifdef JUDYL
-//		Copy Value area into new Leaf
-		Pjvnew = JL_LEAF5VALUEAREA(Pjll, cJU_LEAF6_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF6_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF6_MAXPOP1, 5);)
-
-	        DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(5));
-                JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF5);
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 6 byte index Leaf to 5 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF6_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ StageA[End], 6))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 6);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 6);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_5_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_5_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0,
-                                cJL_JPIMMED_5_01);
-#endif  // JUDYL
-			}
-#ifdef JUDY1
-			else if (Pop1 <= cJ1_IMMED5_MAXPOP1)
-			{
-//		cJ1_JPIMMED_5_02..3: Judy1 64
-
-//                              Copy to Index to JP as an immediate Leaf
-				j__udyCopyWto5(PjpJP->jp_1Index,
-					       StageA + Start, Pop1);
-
-//                              Set pointer, type, population and Index size
-				PjpJP->jp_Type = cJ1_JPIMMED_5_02 + Pop1 - 2;
-			}
-#endif
-			else
-			{
-//		cJU_JPLEAF5
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//				Get a new Leaf
-				PjllRaw = j__udyAllocJLL5(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-				Pjll = P_JLL(PjllRaw);
-
-//				Copy Indexes to new Leaf
-				j__udyCopyWto5((uint8_t *) Pjll, StageA + Start,
-					       Pop1);
-
-//				Copy to Values to new Leaf
-#ifdef JUDYL
-				Pjvnew = JL_LEAF5VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 5);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(6-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF5);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF6_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = StageA[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L6;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-}  // j__udyCascade6()
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E 7
-//
-// Cascade from a cJU_JPLEAF7 to one of the following:
-//  1. if leaf is in 1 expanse:
-//        compress it into a JPLEAF6
-//  2. if leaf contains multiple expanses:
-//        create linear or bitmap branch containing
-//        each new expanse is either a:
-//               JPIMMED_6_01 ... JPIMMED_6_02  branch
-//               JPIMMED_6_01  branch
-//               JPLEAF6
-
-FUNCTION int j__udyCascade7(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	uint8_t  * PLeaf;	// pointer to leaf, explicit type.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t     CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	   StageJP   [cJU_LEAF7_MAXPOP1];  // JPs of new leaves
-	Word_t	   StageA    [cJU_LEAF7_MAXPOP1];
-	uint8_t	   StageExp  [cJU_LEAF7_MAXPOP1];  // Expanses of new leaves
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF7);
-	assert(JU_JPDCDPOP0(Pjp) == (cJU_LEAF7_MAXPOP1-1));
-
-//	Get the address of the Leaf
-	PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-//	Extract 7 byte index Leaf to Word_t
-	j__udyCopy7toW(StageA, PLeaf, cJU_LEAF7_MAXPOP1);
-
-//	Get the address of the Leaf and Value area
-	JUDYLCODE(Pjv = JL_LEAF7VALUEAREA(PLeaf, cJU_LEAF7_MAXPOP1);)
-
-//  If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index)
-
-	CIndex = StageA[0];
-	if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF7_MAXPOP1-1], 7))
-	{
-                Word_t DcdP0;
-		Pjll_t PjllRaw;	 // pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//		Alloc a 6 byte Index Leaf
-		PjllRaw = j__udyAllocJLL6(cJU_LEAF7_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy Index area into new Leaf
-		j__udyCopyWto6((uint8_t *) Pjll, StageA, cJU_LEAF7_MAXPOP1);
-#ifdef JUDYL
-//		Copy Value area into new Leaf
-		Pjvnew = JL_LEAF6VALUEAREA(Pjll, cJU_LEAF7_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF7_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF7_MAXPOP1, 6);)
-
-	        DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(6));
-                JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF6);
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 7 byte index Leaf to 6 byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAF7_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ StageA[End], 7))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, 7);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 7);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_6_01
-			{
-	                    Word_t DcdP0;
-	                    DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) |
-                                CIndex;
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_6_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], DcdP0,
-                                cJL_JPIMMED_6_01);
-#endif  // JUDYL
-			}
-#ifdef JUDY1
-			else if (Pop1 == cJ1_IMMED6_MAXPOP1)
-			{
-//		cJ1_JPIMMED_6_02:    Judy1 64
-
-//                              Copy to Index to JP as an immediate Leaf
-				j__udyCopyWto6(PjpJP->jp_1Index,
-					       StageA + Start, 2);
-
-//                              Set pointer, type, population and Index size
-				PjpJP->jp_Type = cJ1_JPIMMED_6_02;
-			}
-#endif
-			else
-			{
-//		cJU_JPLEAF6
-                                Word_t  DcdP0;
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-
-//				Get a new Leaf
-				PjllRaw = j__udyAllocJLL6(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t)NULL)
-					FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-				Pjll = P_JLL(PjllRaw);
-
-//				Copy Indexes to new Leaf
-				j__udyCopyWto6((uint8_t *) Pjll, StageA + Start,
-					       Pop1);
-#ifdef JUDYL
-//				Copy to Values to new Leaf
-				Pjvnew = JL_LEAF6VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 6);)
-
-                                DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(7)) 
-                                                |
-                                        (CIndex & cJU_DCDMASK(7-1)) 
-                                                |
-                                        (Pop1 - 1);
-
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0,
-                                        cJU_JPLEAF6);
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAF7_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = StageA[End];
-			Start  = End;
-		}
-	}
-
-//      Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L7;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-	}
-	return(1);
-
-}  // j__udyCascade7()
-
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// __ J U D Y   C A S C A D E   L
-//
-// (Compressed) cJU_LEAF3[7], cJ1_JPBRANCH_L.
-//
-// Cascade from a LEAFW (under Pjp) to one of the following:
-//  1. if LEAFW is in 1 expanse:
-//        create linear branch with a JPLEAF3[7] under it
-//  2. LEAFW contains multiple expanses:
-//        create linear or bitmap branch containing new expanses
-//        each new expanse is either a: 32   64
-//               JPIMMED_3_01  branch    Y    N
-//               JPIMMED_7_01  branch    N    Y
-//               JPLEAF3                 Y    N
-//               JPLEAF7                 N    Y
-
-FUNCTION int j__udyCascadeL(
-	Pjp_t	   Pjp,
-	Pvoid_t	   Pjpm)
-{
-	Pjlw_t	   Pjlw;	// leaf to work on.
-	Word_t	   End, Start;	// temporaries.
-	Word_t	   ExpCnt;	// count of expanses of splay.
-	Word_t	   CIndex;	// current Index word.
-JUDYLCODE(Pjv_t	   Pjv;)	// value area of leaf.
-
-//	Temp staging for parts(Leaves) of newly splayed leaf
-	jp_t	StageJP [cJU_LEAFW_MAXPOP1];
-	uint8_t	StageExp[cJU_LEAFW_MAXPOP1];
-	uint8_t	   SubJPCount[cJU_NUMSUBEXPB];     // JPs in each subexpanse
-	jbb_t      StageJBB;                       // staged bitmap branch
-
-//	Get the address of the Leaf
-	Pjlw = P_JLW(Pjp->jp_Addr);
-
-	assert(Pjlw[0] == (cJU_LEAFW_MAXPOP1 - 1));
-
-//	Get pointer to Value area of old Leaf
-	JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, cJU_LEAFW_MAXPOP1);)
-
-	Pjlw++;		// Now point to Index area
-
-// If Leaf is in 1 expanse -- first compress it (compare 1st, last & Index):
-
-	CIndex = Pjlw[0];	// also used far below
-	if (!JU_DIGITATSTATE(CIndex ^ Pjlw[cJU_LEAFW_MAXPOP1 - 1],
-			     cJU_ROOTSTATE))
-	{
-		Pjll_t PjllRaw;		// pointer to new leaf.
-		Pjll_t Pjll;
-      JUDYLCODE(Pjv_t  Pjvnew;)		// value area of new leaf.
-
-//		Get the common expanse to all elements in Leaf
-		StageExp[0] = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE);
-
-//		Alloc a 3[7] byte Index Leaf
-#ifdef JU_64BIT
-		PjllRaw	= j__udyAllocJLL7(cJU_LEAFW_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjlb_t)NULL) return(-1);  // out of memory
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy LEAFW to a cJU_JPLEAF7
-		j__udyCopyWto7((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1);
-#ifdef JUDYL
-//		Get the Value area of new Leaf
-		Pjvnew = JL_LEAF7VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 7);)
-#else // 32 Bit
-		PjllRaw	= j__udyAllocJLL3(cJU_LEAFW_MAXPOP1, Pjpm);
-		if (PjllRaw == (Pjll_t) NULL) return(-1);
-
-		Pjll = P_JLL(PjllRaw);
-
-//		Copy LEAFW to a cJU_JPLEAF3
-		j__udyCopyWto3((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1);
-#ifdef JUDYL
-//		Get the Value area of new Leaf
-		Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1);
-		JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1);
-#endif
-		DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 3);)
-#endif  // 32 Bit
-
-//		Following not needed because cJU_DCDMASK(3[7]) is == 0
-//////		StageJP[0].jp_DcdPopO	|= (CIndex & cJU_DCDMASK(3[7]));
-#ifdef JU_64BIT
-                JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1,
-                                cJU_JPLEAF7);
-#else   // 32BIT
-                JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1,
-                                cJU_JPLEAF3);
-#endif  // 32BIT
-//		Create a 1 element Linear branch
-		if (j__udyCreateBranchL(Pjp, StageJP, StageExp, 1, Pjpm) == -1)
-		    return(-1);
-
-//		Change the type of callers JP
-		Pjp->jp_Type = cJU_JPBRANCH_L;
-
-		return(1);
-	}
-
-//  Else in 2+ expanses, splay Leaf into smaller leaves at higher compression
-
-	StageJBB = StageJBBZero;       // zero staged bitmap branch
-	ZEROJP(SubJPCount);
-
-//	Splay the 4[8] byte Index Leaf to 3[7] byte Index Leaves
-	for (ExpCnt = Start = 0, End = 1; ; End++)
-	{
-//		Check if new expanse or last one
-		if (	(End == cJU_LEAFW_MAXPOP1)
-				||
-			(JU_DIGITATSTATE(CIndex ^ Pjlw[End], cJU_ROOTSTATE))
-		   )
-		{
-//			Build a leaf below the previous expanse
-
-			Pjp_t  PjpJP	= StageJP + ExpCnt;
-			Word_t Pop1	= End - Start;
-			Word_t expanse = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE);
-			Word_t subexp  = expanse / cJU_BITSPERSUBEXPB;
-//
-//                      set the bit that is the current expanse
-			JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse);
-#ifdef SUBEXPCOUNTS
-			StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse
-#endif
-//                      count number of expanses in each subexpanse
-			SubJPCount[subexp]++;
-
-//			Save byte expanse of leaf
-			StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex,
-							   cJU_ROOTSTATE);
-
-			if (Pop1 == 1)	// cJU_JPIMMED_3[7]_01
-			{
-#ifdef  JU_64BIT
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_7_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], CIndex,
-                                cJL_JPIMMED_7_01);
-#endif  // JUDYL
-
-#else   // JU_32BIT
-#ifdef JUDY1
-                            JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_3_01);
-#else   // JUDYL
-                            JU_JPSETADT(PjpJP, Pjv[Start], CIndex,
-                                cJL_JPIMMED_3_01);
-#endif  // JUDYL
-#endif  // JU_32BIT
-			}
-#ifdef JUDY1
-#ifdef  JU_64BIT
-			else if (Pop1 <= cJ1_IMMED7_MAXPOP1)
-#else
-			else if (Pop1 <= cJ1_IMMED3_MAXPOP1)
-#endif
-			{
-//		cJ1_JPIMMED_3_02   :  Judy1 32
-//		cJ1_JPIMMED_7_02   :  Judy1 64
-//                              Copy to JP as an immediate Leaf
-#ifdef  JU_64BIT
-				j__udyCopyWto7(PjpJP->jp_1Index, Pjlw+Start, 2);
-				PjpJP->jp_Type = cJ1_JPIMMED_7_02;
-#else
-				j__udyCopyWto3(PjpJP->jp_1Index, Pjlw+Start, 2);
-				PjpJP->jp_Type = cJ1_JPIMMED_3_02;
-#endif // 32 Bit
-			}
-#endif // JUDY1
-			else // Linear Leaf JPLEAF3[7]
-			{
-//		cJU_JPLEAF3[7]
-				Pjll_t PjllRaw;	 // pointer to new leaf.
-				Pjll_t Pjll;
-		      JUDYLCODE(Pjv_t  Pjvnew;)	 // value area of new leaf.
-#ifdef JU_64BIT
-				PjllRaw = j__udyAllocJLL7(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t) NULL) return(-1);
-				Pjll = P_JLL(PjllRaw);
-
-				j__udyCopyWto7((uint8_t *) Pjll, Pjlw + Start,
-					       Pop1);
-#ifdef JUDYL
-				Pjvnew = JL_LEAF7VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif // JUDYL
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 7);)
-#else // JU_64BIT - 32 Bit
-				PjllRaw = j__udyAllocJLL3(Pop1, Pjpm);
-				if (PjllRaw == (Pjll_t) NULL) return(-1);
-				Pjll = P_JLL(PjllRaw);
-
-				j__udyCopyWto3((uint8_t *) Pjll, Pjlw + Start,
-					       Pop1);
-#ifdef JUDYL
-				Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1);
-				JU_COPYMEM(Pjvnew, Pjv + Start, Pop1);
-#endif // JUDYL
-				DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);)
-#endif // 32 Bit
-
-#ifdef JU_64BIT
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1,
-                                        cJU_JPLEAF7);
-#else // JU_64BIT - 32 Bit
-                                JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1,
-                                        cJU_JPLEAF3);
-#endif // 32 Bit
-			}
-			ExpCnt++;
-//                      Done?
-			if (End == cJU_LEAFW_MAXPOP1) break;
-
-//			New Expanse, Start and Count
-			CIndex = Pjlw[End];
-			Start  = End;
-		}
-	}
-
-// Now put all the Leaves below a BranchL or BranchB:
-	if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL
-	{
-	    if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt,
-			Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_L;
-	}
-	else
-	{
-	    if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm)
-		== -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm);
-
-	    Pjp->jp_Type = cJU_JPBRANCH_B;  // cJU_LEAFW is out of sequence
-	}
-	return(1);
-
-} // j__udyCascadeL()
diff --git a/libs/klib/judy/JudyCount.c b/libs/klib/judy/JudyCount.c
deleted file mode 100644
index a8a6eb1..0000000
--- a/libs/klib/judy/JudyCount.c
+++ /dev/null
@@ -1,1193 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy*Count() function for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a
-// version with cache line optimizations deleted, for testing.
-//
-// Compile with -DSMARTMETRICS to obtain global variables containing smart
-// cache line metrics.  Note:  Dont turn this on simultaneously for this file
-// and JudyByCount.c because they export the same globals.
-//
-// Judy*Count() returns the "count of Indexes" (inclusive) between the two
-// specified limits (Indexes).  This code is remarkably fast.  It traverses the
-// "Judy array" data structure.
-//
-// This count code is the GENERIC untuned version (minimum code size).  It
-// might be possible to tuned to a specific architecture to be faster.
-// However, in real applications, with a modern machine, it is expected that
-// the instruction times will be swamped by cache line fills.
-// ****************************************************************************
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-
-// define a phoney that is for sure
-
-#define cJU_LEAFW       cJU_JPIMMED_CAP
-
-// Avoid duplicate symbols since this file is multi-compiled:
-
-#ifdef SMARTMETRICS
-#ifdef JUDY1
-Word_t jbb_upward   = 0;	// counts of directions taken:
-Word_t jbb_downward = 0;
-Word_t jbu_upward   = 0;
-Word_t jbu_downward = 0;
-Word_t jlb_upward   = 0;
-Word_t jlb_downward = 0;
-#else
-extern Word_t jbb_upward;
-extern Word_t jbb_downward;
-extern Word_t jbu_upward;
-extern Word_t jbu_downward;
-extern Word_t jlb_upward;
-extern Word_t jlb_downward;
-#endif
-#endif
-
-
-// FORWARD DECLARATIONS (prototypes):
-
-static	Word_t j__udy1LCountSM(const Pjp_t Pjp, const Word_t Index,
-			       const Pjpm_t Pjpm);
-
-// Each of Judy1 and JudyL get their own private (static) version of this
-// function:
-
-static	int j__udyCountLeafB1(const Pjll_t Pjll, const Word_t Pop1,
-			      const Word_t Index);
-
-// These functions are not static because they are exported to Judy*ByCount():
-//
-// TBD:  Should be made static for performance reasons?  And thus duplicated?
-//
-// Note:  There really are two different functions, but for convenience they
-// are referred to here with a generic name.
-
-#ifdef JUDY1
-#define	j__udyJPPop1 j__udy1JPPop1
-#else
-#define	j__udyJPPop1 j__udyLJPPop1
-#endif
-
-Word_t j__udyJPPop1(const Pjp_t Pjp);
-
-
-// LOCAL ERROR HANDLING:
-//
-// The Judy*Count() functions are unusual because they return 0 instead of JERR
-// for an error.  In this source file, define C_JERR for clarity.
-
-#define	C_JERR 0
-
-
-// ****************************************************************************
-// J U D Y   1   C O U N T
-// J U D Y   L   C O U N T
-//
-// See the manual entry for details.
-//
-// This code is written recursively, at least at first, because thats much
-// simpler; hope its fast enough.
-
-#ifdef JUDY1
-FUNCTION Word_t Judy1Count
-#else
-FUNCTION Word_t JudyLCount
-#endif
-        (
-	Pcvoid_t  PArray,	// JRP to first branch/leaf in SM.
-	Word_t	  Index1,	// starting Index.
-	Word_t	  Index2,	// ending Index.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-	jpm_t	  fakejpm;	// local temporary for small arrays.
-	Pjpm_t	  Pjpm;		// top JPM or local temporary for error info.
-	jp_t	  fakejp;	// constructed for calling j__udy1LCountSM().
-	Pjp_t	  Pjp;		// JP to pass to j__udy1LCountSM().
-	Word_t	  pop1;		// total for the array.
-	Word_t	  pop1above1;	// indexes at or above Index1, inclusive.
-	Word_t	  pop1above2;	// indexes at or above Index2, exclusive.
-	int	  retcode;	// from Judy*First() calls.
-JUDYLCODE(PPvoid_t PPvalue);	// from JudyLFirst() calls.
-
-
-// CHECK FOR SHORTCUTS:
-//
-// As documented, return C_JERR if the Judy array is empty or Index1 > Index2.
-
-	if ((PArray == (Pvoid_t) NULL) || (Index1 > Index2))
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NONE);
-	    return(C_JERR);
-	}
-
-// If Index1 == Index2, simply check if the specified Index is set; pass
-// through the return value from Judy1Test() or JudyLGet() with appropriate
-// translations.
-
-	if (Index1 == Index2)
-	{
-#ifdef JUDY1
-	    retcode = Judy1Test(PArray, Index1, PJError);
-
-	    if (retcode == JERRI) return(C_JERR);	// pass through error.
-
-	    if (retcode == 0)
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_NONE);
-		return(C_JERR);
-	    }
-#else
-	    PPvalue = JudyLGet(PArray, Index1, PJError);
-
-	    if (PPvalue == PPJERR) return(C_JERR);	// pass through error.
-
-	    if (PPvalue == (PPvoid_t) NULL)		// Index is not set.
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_NONE);
-		return(C_JERR);
-	    }
-#endif
-	    return(1);					// single index is set.
-	}
-
-
-// CHECK JRP TYPE:
-//
-// Use an if/then for speed rather than a switch, and put the most common cases
-// first.
-//
-// Note:  Since even cJU_LEAFW types require counting between two Indexes,
-// prepare them here for common code below that calls j__udy1LCountSM(), rather
-// than handling them even more specially here.
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw	   = P_JLW(PArray);	// first word of leaf.
-	    Pjpm	   = & fakejpm;
-	    Pjp		   = & fakejp;
-	    Pjp->jp_Addr   = (Word_t) Pjlw;
-	    Pjp->jp_Type   = cJU_LEAFW;
-	    Pjpm->jpm_Pop0 = Pjlw[0];		// from first word of leaf.
-	    pop1	   = Pjpm->jpm_Pop0 + 1;
-	}
-	else
-	{
-	    Pjpm = P_JPM(PArray);
-	    Pjp	 = &(Pjpm->jpm_JP);
-	    pop1 = (Pjpm->jpm_Pop0) + 1;	// note: can roll over to 0.
-
-#if (defined(JUDY1) && (! defined(JU_64BIT)))
-	    if (pop1 == 0)		// rare special case of full array:
-	    {
-		Word_t count = Index2 - Index1 + 1;	// can roll over again.
-
-		if (count == 0)
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_FULL);
-		    return(C_JERR);
-		}
-		return(count);
-	    }
-#else
-	    assert(pop1);	// JudyL or 64-bit cannot create a full array!
-#endif
-	}
-
-
-// COUNT POP1 ABOVE INDEX1, INCLUSIVE:
-
-	assert(pop1);		// just to be safe.
-
-	if (Index1 == 0)	// shortcut, pop1above1 is entire population:
-	{
-	    pop1above1 = pop1;
-	}
-	else			// find first valid Index above Index1, if any:
-	{
-#ifdef JUDY1
-	    if ((retcode = Judy1First(PArray, & Index1, PJError)) == JERRI)
-		return(C_JERR);			// pass through error.
-#else
-	    if ((PPvalue = JudyLFirst(PArray, & Index1, PJError)) == PPJERR)
-		return(C_JERR);			// pass through error.
-
-	    retcode = (PPvalue != (PPvoid_t) NULL);	// found a next Index.
-#endif
-
-// If theres no Index at or above Index1, just return C_JERR (early exit):
-
-	    if (retcode == 0)
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_NONE);
-		return(C_JERR);
-	    }
-
-// If a first/next Index was found, call the counting motor starting with that
-// known valid Index, meaning the return should be positive, not C_JERR except
-// in case of a real error:
-
-	    if ((pop1above1 = j__udy1LCountSM(Pjp, Index1, Pjpm)) == C_JERR)
-	    {
-		JU_COPY_ERRNO(PJError, Pjpm);	// pass through error.
-		return(C_JERR);
-	    }
-	}
-
-
-// COUNT POP1 ABOVE INDEX2, EXCLUSIVE, AND RETURN THE DIFFERENCE:
-//
-// In principle, calculate the ordinal of each Index and take the difference,
-// with caution about off-by-one errors due to the specified Indexes being set
-// or unset.  In practice:
-//
-// - The ordinals computed here are inverse ordinals, that is, the populations
-//   ABOVE the specified Indexes (Index1 inclusive, Index2 exclusive), so
-//   subtract pop1above2 from pop1above1, rather than vice-versa.
-//
-// - Index1s result already includes a count for Index1 and/or Index2 if
-//   either is set, so calculate pop1above2 exclusive of Index2.
-//
-// TBD:  If Index1 and Index2 fall in the same expanse in the top-state
-// branch(es), would it be faster to walk the SM only once, to their divergence
-// point, before calling j__udy1LCountSM() or equivalent?  Possibly a non-issue
-// if a top-state pop1 becomes stored with each Judy1 array.  Also, consider
-// whether the first call of j__udy1LCountSM() fills the cache, for common tree
-// branches, for the second call.
-//
-// As for pop1above1, look for shortcuts for special cases when pop1above2 is
-// zero.  Otherwise call the counting "motor".
-
-	    assert(pop1above1);		// just to be safe.
-
-	    if (Index2++ == cJU_ALLONES) return(pop1above1); // Index2 at limit.
-
-#ifdef JUDY1
-	    if ((retcode = Judy1First(PArray, & Index2, PJError)) == JERRI)
-		return(C_JERR);
-#else
-	    if ((PPvalue = JudyLFirst(PArray, & Index2, PJError)) == PPJERR)
-		return(C_JERR);
-
-	    retcode = (PPvalue != (PPvoid_t) NULL);	// found a next Index.
-#endif
-	    if (retcode == 0) return(pop1above1);  // no Index above Index2.
-
-// Just as for Index1, j__udy1LCountSM() cannot return 0 (locally == C_JERR)
-// except in case of a real error:
-
-	    if ((pop1above2 = j__udy1LCountSM(Pjp, Index2, Pjpm)) == C_JERR)
-	    {
-		JU_COPY_ERRNO(PJError, Pjpm);		// pass through error.
-		return(C_JERR);
-	    }
-
-	    if (pop1above1 == pop1above2)
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_NONE);
-		return(C_JERR);
-	    }
-
-	    return(pop1above1 - pop1above2);
-
-} // Judy1Count() / JudyLCount()
-
-
-// ****************************************************************************
-// __ J U D Y 1 L   C O U N T   S M
-//
-// Given a pointer to a JP (with invalid jp_DcdPopO at cJU_ROOTSTATE), a known
-// valid Index, and a Pjpm for returning error info, recursively visit a Judy
-// array state machine (SM) and return the count of Indexes, including Index,
-// through the end of the Judy array at this state or below.  In case of error
-// or a count of 0 (should never happen), return C_JERR with appropriate
-// JU_ERRNO in the Pjpm.
-//
-// Note:  This function is not told the current state because its encoded in
-// the JP Type.
-//
-// Method:  To minimize cache line fills, while studying each branch, if Index
-// resides above the midpoint of the branch (which often consists of multiple
-// cache lines), ADD the populations at or above Index; otherwise, SUBTRACT
-// from the population of the WHOLE branch (available from the JP) the
-// populations at or above Index.  This is especially tricky for bitmap
-// branches.
-//
-// Note:  Unlike, say, the Ins and Del walk routines, this function returns the
-// same type of returns as Judy*Count(), so it can use *_SET_ERRNO*() macros
-// the same way.
-
-FUNCTION static Word_t j__udy1LCountSM(
-const	Pjp_t	Pjp,		// top of Judy (sub)SM.
-const	Word_t	Index,		// count at or above this Index.
-const	Pjpm_t	Pjpm)		// for returning error info.
-{
-	Pjbl_t	Pjbl;		// Pjp->jp_Addr masked and cast to types:
-	Pjbb_t	Pjbb;
-	Pjbu_t	Pjbu;
-	Pjll_t	Pjll;		// a Judy lower-level linear leaf.
-
-	Word_t	digit;		// next digit to decode from Index.
-	long	jpnum;		// JP number in a branch (base 0).
-	int	offset;		// index ordinal within a leaf, base 0.
-	Word_t	pop1;		// total population of an expanse.
-	Word_t	pop1above;	// to return.
-
-// Common code to check Decode bits in a JP against the equivalent portion of
-// Index; XOR together, then mask bits of interest; must be all 0:
-//
-// Note:  Why does this code only assert() compliance rather than actively
-// checking for outliers?  Its because Index is supposed to be valid, hence
-// always match any Dcd bits traversed.
-//
-// Note:  This assertion turns out to be always true for cState = 3 on 32-bit
-// and 7 on 64-bit, but its harmless, probably removed by the compiler.
-
-#define	CHECKDCD(Pjp,cState) \
-	assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cState))
-
-// Common code to prepare to handle a root-level or lower-level branch:
-// Extract a state-dependent digit from Index in a "constant" way, obtain the
-// total population for the branch in a state-dependent way, and then branch to
-// common code for multiple cases:
-//
-// For root-level branches, the state is always cJU_ROOTSTATE, and the
-// population is received in Pjpm->jpm_Pop0.
-//
-// Note:  The total population is only needed in cases where the common code
-// "counts up" instead of down to minimize cache line fills.  However, its
-// available cheaply, and its better to do it with a constant shift (constant
-// state value) instead of a variable shift later "when needed".
-
-#define	PREPB_ROOT(Pjp,Next)				\
-	digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);	\
-	pop1  = (Pjpm->jpm_Pop0) + 1;			\
-	goto Next
-
-#define	PREPB(Pjp,cState,Next)				\
-	digit = JU_DIGITATSTATE(Index, cState);		\
-	pop1  = JU_JPBRANCH_POP0(Pjp, (cState)) + 1;    \
-	goto Next
-
-
-// SWITCH ON JP TYPE:
-//
-// WARNING:  For run-time efficiency the following cases replicate code with
-// varying constants, rather than using common code with variable values!
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// ----------------------------------------------------------------------------
-// ROOT-STATE LEAF that starts with a Pop0 word; just count within the leaf:
-
-	case cJU_LEAFW:
-	{
-	    Pjlw_t Pjlw = P_JLW(Pjp->jp_Addr);		// first word of leaf.
-
-	    assert((Pjpm->jpm_Pop0) + 1 == Pjlw[0] + 1);  // sent correctly.
-	    offset = j__udySearchLeafW(Pjlw + 1, Pjpm->jpm_Pop0 + 1, Index);
-	    assert(offset >= 0);			// Index must exist.
-	    assert(offset < (Pjpm->jpm_Pop0) + 1);	// Index be in range.
-	    return((Pjpm->jpm_Pop0) + 1 - offset);	// INCLUSIVE of Index.
-	}
-
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH; count populations in JPs in the JBL ABOVE the next digit in
-// Index, and recurse for the next digit in Index:
-//
-// Note:  There are no null JPs in a JBL; watch out for pop1 == 0.
-//
-// Note:  A JBL should always fit in one cache line => no need to count up
-// versus down to save cache line fills.  (PREPB() sets pop1 for no reason.)
-
-	case cJU_JPBRANCH_L2:  CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchL);
-	case cJU_JPBRANCH_L3:  CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchL);
-
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4:  CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchL);
-	case cJU_JPBRANCH_L5:  CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchL);
-	case cJU_JPBRANCH_L6:  CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchL);
-	case cJU_JPBRANCH_L7:  CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchL);
-#endif
-	case cJU_JPBRANCH_L:   PREPB_ROOT(Pjp, BranchL);
-
-// Common code (state-independent) for all cases of linear branches:
-
-BranchL:
-
-	Pjbl      = P_JBL(Pjp->jp_Addr);
-	jpnum     = Pjbl->jbl_NumJPs;			// above last JP.
-	pop1above = 0;
-
-	while (digit < (Pjbl->jbl_Expanse[--jpnum]))	 // still ABOVE digit.
-	{
-	    if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) == cJU_ALLONES)
-	    {
-		JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-		return(C_JERR);
-	    }
-
-	    pop1above += pop1;
-	    assert(jpnum > 0);				// should find digit.
-	}
-
-	assert(digit == (Pjbl->jbl_Expanse[jpnum]));	// should find digit.
-
-	pop1 = j__udy1LCountSM((Pjbl->jbl_jp) + jpnum, Index, Pjpm);
-	if (pop1 == C_JERR) return(C_JERR);		// pass error up.
-
-	assert(pop1above + pop1);
-	return(pop1above + pop1);
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH; count populations in JPs in the JBB ABOVE the next digit in
-// Index, and recurse for the next digit in Index:
-//
-// Note:  There are no null JPs in a JBB; watch out for pop1 == 0.
-
-	case cJU_JPBRANCH_B2:  CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchB);
-	case cJU_JPBRANCH_B3:  CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchB);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4:  CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchB);
-	case cJU_JPBRANCH_B5:  CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchB);
-	case cJU_JPBRANCH_B6:  CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchB);
-	case cJU_JPBRANCH_B7:  CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchB);
-#endif
-	case cJU_JPBRANCH_B:   PREPB_ROOT(Pjp, BranchB);
-
-// Common code (state-independent) for all cases of bitmap branches:
-
-BranchB:
-	{
-	    long   subexp;	// for stepping through layer 1 (subexpanses).
-	    long   findsub;	// subexpanse containing   Index (digit).
-	    Word_t findbit;	// bit	      representing Index (digit).
-	    Word_t lowermask;	// bits for indexes at or below Index.
-	    Word_t jpcount;	// JPs in a subexpanse.
-	    Word_t clbelow;	// cache lines below digits cache line.
-	    Word_t clabove;	// cache lines above digits cache line.
-
-	    Pjbb      = P_JBB(Pjp->jp_Addr);
-	    findsub   = digit / cJU_BITSPERSUBEXPB;
-	    findbit   = digit % cJU_BITSPERSUBEXPB;
-	    lowermask = JU_MASKLOWERINC(JU_BITPOSMASKB(findbit));
-	    clbelow   = clabove = 0;	// initial/default => always downward.
-
-	    assert(JU_BITMAPTESTB(Pjbb, digit)); // digit must have a JP.
-	    assert(findsub < cJU_NUMSUBEXPB);	 // falls in expected range.
-
-// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch:
-//
-// Note: BMPJP0 exists separately to support assertions.
-
-#define	BMPJP0(Subexp)       (P_JP(JU_JBB_PJP(Pjbb, Subexp)))
-#define	BMPJP(Subexp,JPnum)  (BMPJP0(Subexp) + (JPnum))
-
-#ifndef NOSMARTJBB  // enable to turn off smart code for comparison purposes.
-
-// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s
-// in JPs above Indexs JP, or subtracting the pop1s in JPs below Indexs JP.
-//
-// This is tricky because, while each set bit in the bitmap represents a JP,
-// the JPs are scattered over cJU_NUMSUBEXPB subexpanses, each of which can
-// contain JPs packed into multiple cache lines, and this code must visit every
-// JP either BELOW or ABOVE the JP for Index.
-//
-// Number of cache lines required to hold a linear list of the given number of
-// JPs, assuming the first JP is at the start of a cache line or the JPs in
-// jpcount fit wholly within a single cache line, which is ensured by
-// JudyMalloc():
-
-#define	CLPERJPS(jpcount) \
-	((((jpcount) * cJU_WORDSPERJP) + cJU_WORDSPERCL - 1) / cJU_WORDSPERCL)
-
-// Count cache lines below/above for each subexpanse:
-
-	    for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-	    {
-		jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));
-
-// When at the subexpanse containing Index (digit), add cache lines
-// below/above appropriately, excluding the cache line containing the JP for
-// Index itself:
-
-		if	(subexp <  findsub)  clbelow += CLPERJPS(jpcount);
-		else if (subexp >  findsub)  clabove += CLPERJPS(jpcount);
-		else // (subexp == findsub)
-		{
-		    Word_t clfind;	// cache line containing Index (digit).
-
-		    clfind = CLPERJPS(j__udyCountBitsB(
-				    JU_JBB_BITMAP(Pjbb, subexp) & lowermask));
-
-		    assert(clfind > 0);	 // digit itself should have 1 CL.
-		    clbelow += clfind - 1;
-		    clabove += CLPERJPS(jpcount) - clfind;
-		}
-	    }
-#endif // ! NOSMARTJBB
-
-// Note:  Its impossible to get through the following "if" without setting
-// jpnum -- see some of the assertions below -- but gcc -Wall doesnt know
-// this, so preset jpnum to make it happy:
-
-	    jpnum = 0;
-
-
-// COUNT POPULATION FOR A BITMAP BRANCH, in whichever direction should result
-// in fewer cache line fills:
-//
-// Note:  If the remainder of Index is zero, pop1above is the pop1 of the
-// entire expanse and theres no point in recursing to lower levels; but this
-// should be so rare that its not worth checking for;
-// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all
-// bytes).
-
-
-// COUNT UPWARD, subtracting each "below or at" JPs pop1 from the whole
-// expanses pop1:
-//
-// Note:  If this causes clbelow + 1 cache line fills including JPs cache
-// line, thats OK; at worst this is the same as clabove.
-
-	    if (clbelow < clabove)
-	    {
-#ifdef SMARTMETRICS
-		++jbb_upward;
-#endif
-		pop1above = pop1;		// subtract JPs at/below Index.
-
-// Count JPs for which to accrue pop1s in this subexpanse:
-//
-// TBD:  If JU_JBB_BITMAP is cJU_FULLBITMAPB, dont bother counting.
-
-		for (subexp = 0; subexp <= findsub; ++subexp)
-		{
-		    jpcount = j__udyCountBitsB((subexp < findsub) ?
-				      JU_JBB_BITMAP(Pjbb, subexp) :
-				      JU_JBB_BITMAP(Pjbb, subexp) & lowermask);
-
-		    // should always find findbit:
-		    assert((subexp < findsub) || jpcount);
-
-// Subtract pop1s from JPs BELOW OR AT Index (digit):
-//
-// Note:  The pop1 for Indexs JP itself is partially added back later at a
-// lower state.
-//
-// Note:  An empty subexpanse (jpcount == 0) is handled "for free".
-//
-// Note:  Must be null JP subexp pointer in empty subexpanse and non-empty in
-// non-empty subexpanse:
-
-		    assert(   jpcount  || (BMPJP0(subexp) == (Pjp_t) NULL));
-		    assert((! jpcount) || (BMPJP0(subexp) != (Pjp_t) NULL));
-
-		    for (jpnum = 0; jpnum < jpcount; ++jpnum)
-		    {
-			if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum)))
-			    == cJU_ALLONES)
-			{
-			    JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-			    return(C_JERR);
-			}
-
-			pop1above -= pop1;
-		    }
-
-		    jpnum = jpcount - 1;	// make correct for digit.
-		}
-	    }
-
-// COUNT DOWNWARD, adding each "above" JPs pop1:
-
-	    else
-	    {
-		long jpcountbf;			// below findbit, inclusive.
-#ifdef SMARTMETRICS
-		++jbb_downward;
-#endif
-		pop1above = 0;			// add JPs above Index.
-		jpcountbf = 0;			// until subexp == findsub.
-
-// Count JPs for which to accrue pop1s in this subexpanse:
-//
-// This is more complicated than counting upward because the scan of digits
-// subexpanse must count ALL JPs, to know where to START counting down, and
-// ALSO note the offset of digits JP to know where to STOP counting down.
-
-		for (subexp = cJU_NUMSUBEXPB - 1; subexp >= findsub; --subexp)
-		{
-		    jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));
-
-		    // should always find findbit:
-		    assert((subexp > findsub) || jpcount);
-
-		    if (! jpcount) continue;	// empty subexpanse, save time.
-
-// Count JPs below digit, inclusive:
-
-		    if (subexp == findsub)
-		    {
-			jpcountbf = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)
-						  & lowermask);
-		    }
-
-		    // should always find findbit:
-		    assert((subexp > findsub) || jpcountbf);
-		    assert(jpcount >= jpcountbf);	// proper relationship.
-
-// Add pop1s from JPs ABOVE Index (digit):
-
-		    // no null JP subexp pointers:
-		    assert(BMPJP0(subexp) != (Pjp_t) NULL);
-
-		    for (jpnum = jpcount - 1; jpnum >= jpcountbf; --jpnum)
-		    {
-			if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum)))
-			    == cJU_ALLONES)
-			{
-			    JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-			    return(C_JERR);
-			}
-
-			pop1above += pop1;
-		    }
-		    // jpnum is now correct for digit.
-		}
-	    } // else.
-
-// Return the net population ABOVE the digits JP at this state (in this JBB)
-// plus the population AT OR ABOVE Index in the SM under the digits JP:
-
-	    pop1 = j__udy1LCountSM(BMPJP(findsub, jpnum), Index, Pjpm);
-	    if (pop1 == C_JERR) return(C_JERR);		// pass error up.
-
-	    assert(pop1above + pop1);
-	    return(pop1above + pop1);
-
-	} // case.
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH; count populations in JPs in the JBU ABOVE the next
-// digit in Index, and recurse for the next digit in Index:
-//
-// Note:  If the remainder of Index is zero, pop1above is the pop1 of the
-// entire expanse and theres no point in recursing to lower levels; but this
-// should be so rare that its not worth checking for;
-// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all
-// bytes).
-
-	case cJU_JPBRANCH_U2:  CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchU);
-	case cJU_JPBRANCH_U3:  CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchU);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4:  CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchU);
-	case cJU_JPBRANCH_U5:  CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchU);
-	case cJU_JPBRANCH_U6:  CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchU);
-	case cJU_JPBRANCH_U7:  CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchU);
-#endif
-	case cJU_JPBRANCH_U:   PREPB_ROOT(Pjp, BranchU);
-
-// Common code (state-independent) for all cases of uncompressed branches:
-
-BranchU:
-	    Pjbu = P_JBU(Pjp->jp_Addr);
-
-#ifndef NOSMARTJBU  // enable to turn off smart code for comparison purposes.
-
-// FIGURE OUT WHICH WAY CAUSES FEWER CACHE LINE FILLS; adding the JPs above
-// Indexs JP, or subtracting the JPs below Indexs JP.
-//
-// COUNT UPWARD, subtracting the pop1 of each JP BELOW OR AT Index, from the
-// whole expanses pop1:
-
-	    if (digit < (cJU_BRANCHUNUMJPS / 2))
-	    {
-		pop1above = pop1;		// subtract JPs below Index.
-#ifdef SMARTMETRICS
-		++jbu_upward;
-#endif
-		for (jpnum = 0; jpnum <= digit; ++jpnum)
-		{
-		    if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX)
-			continue;	// shortcut, save a function call.
-
-		    if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum))
-		     == cJU_ALLONES)
-		    {
-			JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-			return(C_JERR);
-		    }
-
-		    pop1above -= pop1;
-		}
-	    }
-
-// COUNT DOWNWARD, simply adding the pop1 of each JP ABOVE Index:
-
-	    else
-#endif // NOSMARTJBU
-	    {
-		assert(digit < cJU_BRANCHUNUMJPS);
-#ifdef SMARTMETRICS
-		++jbu_downward;
-#endif
-		pop1above = 0;			// add JPs above Index.
-
-		for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum > digit; --jpnum)
-		{
-		    if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX)
-			continue;	// shortcut, save a function call.
-
-		    if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum))
-		     == cJU_ALLONES)
-		    {
-			JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-			return(C_JERR);
-		    }
-
-		    pop1above += pop1;
-		}
-	    }
-
-	    if ((pop1 = j__udy1LCountSM(Pjbu->jbu_jp + digit, Index, Pjpm))
-	     == C_JERR) return(C_JERR);		// pass error up.
-
-	    assert(pop1above + pop1);
-	    return(pop1above + pop1);
-
-
-// ----------------------------------------------------------------------------
-// LEAF COUNT MACROS:
-//
-// LEAF*ABOVE() are common code for different JP types (linear leaves, bitmap
-// leaves, and immediates) and different leaf Index Sizes, which result in
-// calling different leaf search functions.  Linear leaves get the leaf address
-// from jp_Addr and the Population from jp_DcdPopO, while immediates use Pjp
-// itself as the leaf address and get Population from jp_Type.
-
-#define	LEAFLABOVE(Func)				\
-	Pjll = P_JLL(Pjp->jp_Addr);			\
-	pop1 = JU_JPLEAF_POP0(Pjp) + 1;	                \
-	LEAFABOVE(Func, Pjll, pop1)
-
-#define	LEAFB1ABOVE(Func) LEAFLABOVE(Func)  // different Func, otherwise same.
-
-#ifdef JUDY1
-#define	IMMABOVE(Func,Pop1)	\
-	Pjll = (Pjll_t) Pjp;	\
-	LEAFABOVE(Func, Pjll, Pop1)
-#else
-// Note:  For JudyL immediates with >= 2 Indexes, the index bytes are in a
-// different place than for Judy1:
-
-#define	IMMABOVE(Func,Pop1) \
-	LEAFABOVE(Func, (Pjll_t) (Pjp->jp_LIndex), Pop1)
-#endif
-
-// For all leaf types, the population AT OR ABOVE is the total pop1 less the
-// offset of Index; and Index should always be found:
-
-#define	LEAFABOVE(Func,Pjll,Pop1)		\
-	offset = Func(Pjll, Pop1, Index);	\
-	assert(offset >= 0);			\
-	assert(offset < (Pop1));		\
-	return((Pop1) - offset)
-
-// IMMABOVE_01 handles the special case of an immediate JP with 1 index, which
-// the search functions arent used for anyway:
-//
-// The target Index should be the one in this Immediate, in which case the
-// count above (inclusive) is always 1.
-
-#define	IMMABOVE_01						\
-	assert((JU_JPDCDPOP0(Pjp)) == JU_TRIMTODCDSIZE(Index));	\
-	return(1)
-
-
-// ----------------------------------------------------------------------------
-// LINEAR LEAF; search the leaf for Index; size is computed from jp_Type:
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:  LEAFLABOVE(j__udySearchLeaf1);
-#endif
-	case cJU_JPLEAF2:  LEAFLABOVE(j__udySearchLeaf2);
-	case cJU_JPLEAF3:  LEAFLABOVE(j__udySearchLeaf3);
-
-#ifdef JU_64BIT
-	case cJU_JPLEAF4:  LEAFLABOVE(j__udySearchLeaf4);
-	case cJU_JPLEAF5:  LEAFLABOVE(j__udySearchLeaf5);
-	case cJU_JPLEAF6:  LEAFLABOVE(j__udySearchLeaf6);
-	case cJU_JPLEAF7:  LEAFLABOVE(j__udySearchLeaf7);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// BITMAP LEAF; search the leaf for Index:
-//
-// Since the bitmap describes Indexes digitally rather than linearly, this is
-// not really a search, but just a count.
-
-	case cJU_JPLEAF_B1:  LEAFB1ABOVE(j__udyCountLeafB1);
-
-
-#ifdef JUDY1
-// ----------------------------------------------------------------------------
-// FULL POPULATION:
-//
-// Return the count of Indexes AT OR ABOVE Index, which is the total population
-// of the expanse (a constant) less the value of the undecoded digit remaining
-// in Index (its base-0 offset in the expanse), which yields an inclusive count
-// above.
-//
-// TBD:  This only supports a 1-byte full expanse.  Should this extract a
-// stored value for pop0 and possibly more LSBs of Index, to handle larger full
-// expanses?
-
-	case cJ1_JPFULLPOPU1:
-	    return(cJU_JPFULLPOPU1_POP0 + 1 - JU_DIGITATSTATE(Index, 1));
-#endif
-
-
-// ----------------------------------------------------------------------------
-// IMMEDIATE:
-
-	case cJU_JPIMMED_1_01:  IMMABOVE_01;
-	case cJU_JPIMMED_2_01:  IMMABOVE_01;
-	case cJU_JPIMMED_3_01:  IMMABOVE_01;
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01:  IMMABOVE_01;
-	case cJU_JPIMMED_5_01:  IMMABOVE_01;
-	case cJU_JPIMMED_6_01:  IMMABOVE_01;
-	case cJU_JPIMMED_7_01:  IMMABOVE_01;
-#endif
-
-	case cJU_JPIMMED_1_02:  IMMABOVE(j__udySearchLeaf1,  2);
-	case cJU_JPIMMED_1_03:  IMMABOVE(j__udySearchLeaf1,  3);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:  IMMABOVE(j__udySearchLeaf1,  4);
-	case cJU_JPIMMED_1_05:  IMMABOVE(j__udySearchLeaf1,  5);
-	case cJU_JPIMMED_1_06:  IMMABOVE(j__udySearchLeaf1,  6);
-	case cJU_JPIMMED_1_07:  IMMABOVE(j__udySearchLeaf1,  7);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:  IMMABOVE(j__udySearchLeaf1,  8);
-	case cJ1_JPIMMED_1_09:  IMMABOVE(j__udySearchLeaf1,  9);
-	case cJ1_JPIMMED_1_10:  IMMABOVE(j__udySearchLeaf1, 10);
-	case cJ1_JPIMMED_1_11:  IMMABOVE(j__udySearchLeaf1, 11);
-	case cJ1_JPIMMED_1_12:  IMMABOVE(j__udySearchLeaf1, 12);
-	case cJ1_JPIMMED_1_13:  IMMABOVE(j__udySearchLeaf1, 13);
-	case cJ1_JPIMMED_1_14:  IMMABOVE(j__udySearchLeaf1, 14);
-	case cJ1_JPIMMED_1_15:  IMMABOVE(j__udySearchLeaf1, 15);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:  IMMABOVE(j__udySearchLeaf2,  2);
-	case cJU_JPIMMED_2_03:  IMMABOVE(j__udySearchLeaf2,  3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:  IMMABOVE(j__udySearchLeaf2,  4);
-	case cJ1_JPIMMED_2_05:  IMMABOVE(j__udySearchLeaf2,  5);
-	case cJ1_JPIMMED_2_06:  IMMABOVE(j__udySearchLeaf2,  6);
-	case cJ1_JPIMMED_2_07:  IMMABOVE(j__udySearchLeaf2,  7);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02:  IMMABOVE(j__udySearchLeaf3,  2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03:  IMMABOVE(j__udySearchLeaf3,  3);
-	case cJ1_JPIMMED_3_04:  IMMABOVE(j__udySearchLeaf3,  4);
-	case cJ1_JPIMMED_3_05:  IMMABOVE(j__udySearchLeaf3,  5);
-
-	case cJ1_JPIMMED_4_02:  IMMABOVE(j__udySearchLeaf4,  2);
-	case cJ1_JPIMMED_4_03:  IMMABOVE(j__udySearchLeaf4,  3);
-
-	case cJ1_JPIMMED_5_02:  IMMABOVE(j__udySearchLeaf5,  2);
-	case cJ1_JPIMMED_5_03:  IMMABOVE(j__udySearchLeaf5,  3);
-
-	case cJ1_JPIMMED_6_02:  IMMABOVE(j__udySearchLeaf6,  2);
-
-	case cJ1_JPIMMED_7_02:  IMMABOVE(j__udySearchLeaf7,  2);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// OTHER CASES:
-
-	default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(C_JERR);
-
-	} // switch on JP type
-
-	/*NOTREACHED*/
-
-} // j__udy1LCountSM()
-
-
-// ****************************************************************************
-// J U D Y   C O U N T   L E A F   B 1
-//
-// This is a private analog of the j__udySearchLeaf*() functions for counting
-// in bitmap 1-byte leaves.  Since a bitmap leaf describes Indexes digitally
-// rather than linearly, this is not really a search, but just a count of the
-// valid Indexes == set bits below or including Index, which should be valid.
-// Return the "offset" (really the ordinal), 0 .. Pop1 - 1, of Index in Pjll;
-// if Indexs bit is not set (which should never happen, so this is DEBUG-mode
-// only), return the 1s-complement equivalent (== negative offset minus 1).
-//
-// Note:  The source code for this function looks identical for both Judy1 and
-// JudyL, but the JU_JLB_BITMAP macro varies.
-//
-// Note:  For simpler calling, the first arg is of type Pjll_t but then cast to
-// Pjlb_t.
-
-FUNCTION static int j__udyCountLeafB1(
-const	Pjll_t	Pjll,		// bitmap leaf, as Pjll_t for consistency.
-const	Word_t	Pop1,		// Population of whole leaf.
-const	Word_t	Index)		// to which to count.
-{
-	Pjlb_t	Pjlb	= (Pjlb_t) Pjll;	// to proper type.
-	Word_t	digit   = Index & cJU_MASKATSTATE(1);
-	Word_t	findsub = digit / cJU_BITSPERSUBEXPL;
-	Word_t	findbit = digit % cJU_BITSPERSUBEXPL;
-	int	count;		// in leaf through Index.
-	long	subexp;		// for stepping through subexpanses.
-
-
-// COUNT UPWARD:
-//
-// The entire bitmap should fit in one cache line, but still try to save some
-// CPU time by counting the fewest possible number of subexpanses from the
-// bitmap.
-
-#ifndef NOSMARTJLB  // enable to turn off smart code for comparison purposes.
-
-	if (findsub < (cJU_NUMSUBEXPL / 2))
-	{
-#ifdef SMARTMETRICS
-	    ++jlb_upward;
-#endif
-	    count = 0;
-
-	    for (subexp = 0; subexp < findsub; ++subexp)
-	    {
-		count += ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ?
-			  cJU_BITSPERSUBEXPL :
-			  j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)));
-	    }
-
-// This count includes findbit, which should be set, resulting in a base-1
-// offset:
-
-	    count += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub)
-				& JU_MASKLOWERINC(JU_BITPOSMASKL(findbit)));
-
-	    DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);)
-	    assert(count >= 1);
-	    return(count - 1);		// convert to base-0 offset.
-	}
-#endif // NOSMARTJLB
-
-
-// COUNT DOWNWARD:
-//
-// Count the valid Indexes above or at Index, and subtract from Pop1.
-
-#ifdef SMARTMETRICS
-	++jlb_downward;
-#endif
-	count = Pop1;			// base-1 for now.
-
-	for (subexp = cJU_NUMSUBEXPL - 1; subexp > findsub; --subexp)
-	{
-	    count -= ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ?
-		      cJU_BITSPERSUBEXPL :
-		      j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)));
-	}
-
-// This count includes findbit, which should be set, resulting in a base-0
-// offset:
-
-	count -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub)
-				& JU_MASKHIGHERINC(JU_BITPOSMASKL(findbit)));
-
-	DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);)
-	assert(count >= 0);		// should find Index itself.
-	return(count);			// is already a base-0 offset.
-
-} // j__udyCountLeafB1()
-
-
-// ****************************************************************************
-// J U D Y   J P   P O P 1
-//
-// This function takes any type of JP other than a root-level JP (cJU_LEAFW* or
-// cJU_JPBRANCH* with no number suffix) and extracts the Pop1 from it.  In some
-// sense this is a wrapper around the JU_JP*_POP0 macros.  Why write it as a
-// function instead of a complex macro containing a trinary?  (See version
-// Judy1.h version 4.17.)  We think its cheaper to call a function containing
-// a switch statement with "constant" cases than to do the variable
-// calculations in a trinary.
-//
-// For invalid JP Types return cJU_ALLONES.  Note that this is an impossibly
-// high Pop1 for any JP below a top level branch.
-
-FUNCTION Word_t j__udyJPPop1(
-const	Pjp_t Pjp)		// JP to count.
-{
-	switch (JU_JPTYPE(Pjp))
-	{
-#ifdef notdef // caller should shortcut and not even call with these:
-
-	case cJU_JPNULL1:
-	case cJU_JPNULL2:
-	case cJU_JPNULL3:  return(0);
-#ifdef JU_64BIT
-	case cJU_JPNULL4:
-	case cJU_JPNULL5:
-	case cJU_JPNULL6:
-	case cJU_JPNULL7:  return(0);
-#endif
-#endif // notdef
-
-	case cJU_JPBRANCH_L2:
-	case cJU_JPBRANCH_B2:
-	case cJU_JPBRANCH_U2: return(JU_JPBRANCH_POP0(Pjp,2) + 1);
-
-	case cJU_JPBRANCH_L3:
-	case cJU_JPBRANCH_B3:
-	case cJU_JPBRANCH_U3: return(JU_JPBRANCH_POP0(Pjp,3) + 1);
-
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4:
-	case cJU_JPBRANCH_B4:
-	case cJU_JPBRANCH_U4: return(JU_JPBRANCH_POP0(Pjp,4) + 1);
-
-	case cJU_JPBRANCH_L5:
-	case cJU_JPBRANCH_B5:
-	case cJU_JPBRANCH_U5: return(JU_JPBRANCH_POP0(Pjp,5) + 1);
-
-	case cJU_JPBRANCH_L6:
-	case cJU_JPBRANCH_B6:
-	case cJU_JPBRANCH_U6: return(JU_JPBRANCH_POP0(Pjp,6) + 1);
-
-	case cJU_JPBRANCH_L7:
-	case cJU_JPBRANCH_B7:
-	case cJU_JPBRANCH_U7: return(JU_JPBRANCH_POP0(Pjp,7) + 1);
-#endif
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:
-#endif
-	case cJU_JPLEAF2:
-	case cJU_JPLEAF3:
-#ifdef JU_64BIT
-	case cJU_JPLEAF4:
-	case cJU_JPLEAF5:
-	case cJU_JPLEAF6:
-	case cJU_JPLEAF7:
-#endif
-	case cJU_JPLEAF_B1:	return(JU_JPLEAF_POP0(Pjp) + 1);
-
-#ifdef JUDY1
-	case cJ1_JPFULLPOPU1:	return(cJU_JPFULLPOPU1_POP0 + 1);
-#endif
-
-	case cJU_JPIMMED_1_01:
-	case cJU_JPIMMED_2_01:
-	case cJU_JPIMMED_3_01:	return(1);
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01:
-	case cJU_JPIMMED_5_01:
-	case cJU_JPIMMED_6_01:
-	case cJU_JPIMMED_7_01:	return(1);
-#endif
-
-	case cJU_JPIMMED_1_02:	return(2);
-	case cJU_JPIMMED_1_03:	return(3);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:	return(4);
-	case cJU_JPIMMED_1_05:	return(5);
-	case cJU_JPIMMED_1_06:	return(6);
-	case cJU_JPIMMED_1_07:	return(7);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:	return(8);
-	case cJ1_JPIMMED_1_09:	return(9);
-	case cJ1_JPIMMED_1_10:	return(10);
-	case cJ1_JPIMMED_1_11:	return(11);
-	case cJ1_JPIMMED_1_12:	return(12);
-	case cJ1_JPIMMED_1_13:	return(13);
-	case cJ1_JPIMMED_1_14:	return(14);
-	case cJ1_JPIMMED_1_15:	return(15);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:	return(2);
-	case cJU_JPIMMED_2_03:	return(3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:	return(4);
-	case cJ1_JPIMMED_2_05:	return(5);
-	case cJ1_JPIMMED_2_06:	return(6);
-	case cJ1_JPIMMED_2_07:	return(7);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02:	return(2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03:	return(3);
-	case cJ1_JPIMMED_3_04:	return(4);
-	case cJ1_JPIMMED_3_05:	return(5);
-
-	case cJ1_JPIMMED_4_02:	return(2);
-	case cJ1_JPIMMED_4_03:	return(3);
-
-	case cJ1_JPIMMED_5_02:	return(2);
-	case cJ1_JPIMMED_5_03:	return(3);
-
-	case cJ1_JPIMMED_6_02:	return(2);
-
-	case cJ1_JPIMMED_7_02:	return(2);
-#endif
-
-	default:		return(cJU_ALLONES);
-	}
-
-	/*NOTREACHED*/
-
-} // j__udyJPPop1()
diff --git a/libs/klib/judy/JudyCreateBranch.c b/libs/klib/judy/JudyCreateBranch.c
deleted file mode 100644
index 1234c31..0000000
--- a/libs/klib/judy/JudyCreateBranch.c
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Branch creation functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-
-// ****************************************************************************
-// J U D Y   C R E A T E   B R A N C H   L
-//
-// Build a BranchL from an array of JPs and associated 1 byte digits
-// (expanses).  Return with Pjp pointing to the BranchL.  Caller must
-// deallocate passed arrays, if necessary.
-//
-// We have no idea what kind of BranchL it is, so caller must set the jp_Type.
-//
-// Return -1 if error (details in Pjpm), otherwise return 1.
-
-FUNCTION int j__udyCreateBranchL(
-	Pjp_t	Pjp,		// Build JPs from this place
-	Pjp_t	PJPs,		// Array of JPs to put into Bitmap branch
-	uint8_t Exp[],		// Array of expanses to put into bitmap
-	Word_t  ExpCnt,		// Number of above JPs and Expanses
-	Pvoid_t	Pjpm)
-{
-	Pjbl_t	PjblRaw;	// pointer to linear branch.
-	Pjbl_t	Pjbl;
-
-	assert(ExpCnt <= cJU_BRANCHLMAXJPS);
-
-	PjblRaw	= j__udyAllocJBL(Pjpm);
-	if (PjblRaw == (Pjbl_t) NULL) return(-1);
-        Pjbl    = P_JBL(PjblRaw);
-
-//	Build a Linear Branch
-	Pjbl->jbl_NumJPs = ExpCnt;
-
-//	Copy from the Linear branch from splayed leaves
-	JU_COPYMEM(Pjbl->jbl_Expanse, Exp,  ExpCnt);
-	JU_COPYMEM(Pjbl->jbl_jp,      PJPs, ExpCnt);
-
-//	Pass back new pointer to the Linear branch in JP
-	Pjp->jp_Addr = (Word_t) PjblRaw;
-
-	return(1);
-
-} // j__udyCreateBranchL()
-
-
-// ****************************************************************************
-// J U D Y   C R E A T E   B R A N C H   B
-//
-// Build a BranchB from an array of JPs and associated 1 byte digits
-// (expanses).  Return with Pjp pointing to the BranchB.  Caller must
-// deallocate passed arrays, if necessary.
-//
-// We have no idea what kind of BranchB it is, so caller must set the jp_Type.
-//
-// Return -1 if error (details in Pjpm), otherwise return 1.
-
-FUNCTION int j__udyCreateBranchB(
-	Pjp_t	Pjp,		// Build JPs from this place
-	Pjp_t	PJPs,		// Array of JPs to put into Bitmap branch
-	uint8_t Exp[],		// Array of expanses to put into bitmap
-	Word_t  ExpCnt,		// Number of above JPs and Expanses
-	Pvoid_t	Pjpm)
-{
-	Pjbb_t	PjbbRaw;	// pointer to bitmap branch.
-	Pjbb_t	Pjbb;
-	Word_t  ii, jj;		// Temps
-	uint8_t CurrSubExp;	// Current sub expanse for BM
-
-// This assertion says the number of populated subexpanses is not too large.
-// This function is only called when a BranchL overflows to a BranchB or when a
-// cascade occurs, meaning a leaf overflows.  Either way ExpCnt cant be very
-// large, in fact a lot smaller than cJU_BRANCHBMAXJPS.  (Otherwise a BranchU
-// would be used.)  Popping this assertion means something (unspecified) has
-// gone very wrong, or else Judys design criteria have changed, although in
-// fact there should be no HARM in creating a BranchB with higher actual
-// fanout.
-
-	assert(ExpCnt <= cJU_BRANCHBMAXJPS);
-
-//	Get memory for a Bitmap branch
-	PjbbRaw	= j__udyAllocJBB(Pjpm);
-	if (PjbbRaw == (Pjbb_t) NULL) return(-1);
-	Pjbb = P_JBB(PjbbRaw);
-
-//	Get 1st "sub" expanse (0..7) of bitmap branch
-	CurrSubExp = Exp[0] / cJU_BITSPERSUBEXPB;
-
-// Index thru all 1 byte sized expanses:
-
-	for (jj = ii = 0; ii <= ExpCnt; ii++)
-	{
-		Word_t SubExp;	// Cannot be a uint8_t
-
-//		Make sure we cover the last one
-		if (ii == ExpCnt)
-		{
-			SubExp = cJU_ALLONES;	// Force last one
-		}
-		else
-		{
-//			Calculate the "sub" expanse of the byte expanse
-			SubExp = Exp[ii] / cJU_BITSPERSUBEXPB;  // Bits 5..7.
-
-//			Set the bit that represents the expanse in Exp[]
-			JU_JBB_BITMAP(Pjbb, SubExp) |= JU_BITPOSMASKB(Exp[ii]);
-		}
-//		Check if a new "sub" expanse range needed
-		if (SubExp != CurrSubExp)
-		{
-//			Get number of JPs in this sub expanse
-			Word_t NumJP = ii - jj;
-			Pjp_t  PjpRaw;
-			Pjp_t  Pjp;
-
-			PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm);
-                        Pjp    = P_JP(PjpRaw);
-
-			if (PjpRaw == (Pjp_t) NULL)	// out of memory.
-			{
-
-// Free any previous allocations:
-
-			    while(CurrSubExp--)
-			    {
-				NumJP = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb,
-								  CurrSubExp));
-				if (NumJP)
-				{
-				    j__udyFreeJBBJP(JU_JBB_PJP(Pjbb,
-						    CurrSubExp), NumJP, Pjpm);
-				}
-			    }
-			    j__udyFreeJBB(PjbbRaw, Pjpm);
-			    return(-1);
-			}
-
-// Place the array of JPs in bitmap branch:
-
-			JU_JBB_PJP(Pjbb, CurrSubExp) = PjpRaw;
-
-// Copy the JPs to new leaf:
-
-			JU_COPYMEM(Pjp, PJPs + jj, NumJP);
-
-// On to the next bitmap branch "sub" expanse:
-
-			jj	   = ii;
-			CurrSubExp = SubExp;
-		}
-	} // for each 1-byte expanse
-
-// Pass back some of the JP to the new Bitmap branch:
-
-	Pjp->jp_Addr = (Word_t) PjbbRaw;
-
-	return(1);
-
-} // j__udyCreateBranchB()
-
-
-// ****************************************************************************
-// J U D Y   C R E A T E   B R A N C H   U
-//
-// Build a BranchU from a BranchB.  Return with Pjp pointing to the BranchU.
-// Free the BranchB and its JP subarrays.
-//
-// Return -1 if error (details in Pjpm), otherwise return 1.
-
-FUNCTION int j__udyCreateBranchU(
-	Pjp_t	  Pjp,
-	Pvoid_t	  Pjpm)
-{
-	jp_t	  JPNull;
-        Pjbu_t    PjbuRaw;
-        Pjbu_t    Pjbu;
-	Pjbb_t	  PjbbRaw;
-	Pjbb_t	  Pjbb;
-	Word_t	  ii, jj;
-	BITMAPB_t BitMap;
-	Pjp_t	  PDstJP;
-#ifdef JU_STAGED_EXP
-	jbu_t	  BranchU;	// Staged uncompressed branch
-#else
-
-// Allocate memory for a BranchU:
-
-	PjbuRaw = j__udyAllocJBU(Pjpm);
-	if (PjbuRaw == (Pjbu_t) NULL) return(-1);
-        Pjbu = P_JBU(PjbuRaw);
-#endif
-        JU_JPSETADT(&JPNull, 0, 0, JU_JPTYPE(Pjp) - cJU_JPBRANCH_B2 + cJU_JPNULL1);
-
-// Get the pointer to the BranchB:
-
-	PjbbRaw	= (Pjbb_t) (Pjp->jp_Addr);
-	Pjbb	= P_JBB(PjbbRaw);
-
-//	Set the pointer to the Uncompressed branch
-#ifdef JU_STAGED_EXP
-	PDstJP = BranchU.jbu_jp;
-#else
-        PDstJP = Pjbu->jbu_jp;
-#endif
-	for (ii = 0; ii < cJU_NUMSUBEXPB; ii++)
-	{
-		Pjp_t	PjpA;
-		Pjp_t	PjpB;
-
-		PjpB = PjpA = P_JP(JU_JBB_PJP(Pjbb, ii));
-
-//		Get the bitmap for this subexpanse
-		BitMap	= JU_JBB_BITMAP(Pjbb, ii);
-
-//		NULL empty subexpanses
-		if (BitMap == 0)
-		{
-//			But, fill with NULLs
-			for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++)
-			{
-				PDstJP[jj] = JPNull;
-			}
-			PDstJP += cJU_BITSPERSUBEXPB;
-			continue;
-		}
-//		Check if Uncompressed subexpanse
-		if (BitMap == cJU_FULLBITMAPB)
-		{
-//			Copy subexpanse to the Uncompressed branch intact
-			JU_COPYMEM(PDstJP, PjpA, cJU_BITSPERSUBEXPB);
-
-//			Bump to next subexpanse
-			PDstJP += cJU_BITSPERSUBEXPB;
-
-//			Set length of subexpanse
-			jj = cJU_BITSPERSUBEXPB;
-		}
-		else
-		{
-			for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++)
-			{
-//				Copy JP or NULLJP depending on bit
-				if (BitMap & 1) { *PDstJP = *PjpA++; }
-				else		{ *PDstJP = JPNull; }
-
-				PDstJP++;	// advance to next JP
-				BitMap >>= 1;
-			}
-			jj = PjpA - PjpB;
-		}
-
-// Free the subexpanse:
-
-		j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, ii), jj, Pjpm);
-
-	} // for each JP in BranchU
-
-#ifdef JU_STAGED_EXP
-
-// Allocate memory for a BranchU:
-
-	PjbuRaw = j__udyAllocJBU(Pjpm);
-	if (PjbuRaw == (Pjbu_t) NULL) return(-1);
-        Pjbu = P_JBU(PjbuRaw);
-
-// Copy staged branch to newly allocated branch:
-//
-// TBD:  I think this code is broken.
-
-	*Pjbu = BranchU;
-
-#endif // JU_STAGED_EXP
-
-// Finally free the BranchB and put the BranchU in its place:
-
-	j__udyFreeJBB(PjbbRaw, Pjpm);
-
-	Pjp->jp_Addr  = (Word_t) PjbuRaw;
-	Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_B;
-
-	return(1);
-
-} // j__udyCreateBranchU()
diff --git a/libs/klib/judy/JudyDecascade.c b/libs/klib/judy/JudyDecascade.c
deleted file mode 100644
index da625bc..0000000
--- a/libs/klib/judy/JudyDecascade.c
+++ /dev/null
@@ -1,1204 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// "Decascade" support functions for JudyDel.c:  These functions convert
-// smaller-index-size leaves to larger-index-size leaves, and also, bitmap
-// leaves (LeafB1s) to Leaf1s, and some types of branches to smaller branches
-// at the same index size.  Some "decascading" occurs explicitly in JudyDel.c,
-// but rare or large subroutines appear as functions here, and the overhead to
-// call them is negligible.
-//
-// Compile with one of -DJUDY1 or -DJUDYL.  Note:  Function names are converted
-// to Judy1 or JudyL specific values by external #defines.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#endif
-#ifdef JUDYL
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);)
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   2   T O   3
-//
-// Copy one or more 2-byte Indexes to a series of 3-byte Indexes.
-
-FUNCTION static void j__udyCopy2to3(
-	uint8_t *  PDest,	// to where to copy 3-byte Indexes.
-	uint16_t * PSrc,	// from where to copy 2-byte indexes.
-	Word_t     Pop1,	// number of Indexes to copy.
-	Word_t     MSByte)	// most-significant byte, prefix to each Index.
-{
-	Word_t	   Temp;	// for building 3-byte Index.
-
-	assert(Pop1);
-
-        do {
-	    Temp = MSByte | *PSrc++;
-	    JU_COPY3_LONG_TO_PINDEX(PDest, Temp);
-	    PDest += 3;
-        } while (--Pop1);
-
-} // j__udyCopy2to3()
-
-
-#ifdef JU_64BIT
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   3   T O   4
-//
-// Copy one or more 3-byte Indexes to a series of 4-byte Indexes.
-
-FUNCTION static void j__udyCopy3to4(
-	uint32_t * PDest,	// to where to copy 4-byte Indexes.
-	uint8_t *  PSrc,	// from where to copy 3-byte indexes.
-	Word_t     Pop1,	// number of Indexes to copy.
-	Word_t     MSByte)	// most-significant byte, prefix to each Index.
-{
-	Word_t	   Temp;	// for building 4-byte Index.
-
-	assert(Pop1);
-
-        do {
-	    JU_COPY3_PINDEX_TO_LONG(Temp, PSrc);
-	    Temp |= MSByte;
-	    PSrc += 3;
-	    *PDest++ = Temp;		// truncates to uint32_t.
-        } while (--Pop1);
-
-} // j__udyCopy3to4()
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   4   T O   5
-//
-// Copy one or more 4-byte Indexes to a series of 5-byte Indexes.
-
-FUNCTION static void j__udyCopy4to5(
-	uint8_t *  PDest,	// to where to copy 4-byte Indexes.
-	uint32_t * PSrc,	// from where to copy 4-byte indexes.
-	Word_t     Pop1,	// number of Indexes to copy.
-	Word_t     MSByte)	// most-significant byte, prefix to each Index.
-{
-	Word_t	   Temp;	// for building 5-byte Index.
-
-	assert(Pop1);
-
-        do {
-	    Temp = MSByte | *PSrc++;
-	    JU_COPY5_LONG_TO_PINDEX(PDest, Temp);
-	    PDest += 5;
-        } while (--Pop1);
-
-} // j__udyCopy4to5()
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   5   T O   6
-//
-// Copy one or more 5-byte Indexes to a series of 6-byte Indexes.
-
-FUNCTION static void j__udyCopy5to6(
-	uint8_t * PDest,	// to where to copy 6-byte Indexes.
-	uint8_t * PSrc,		// from where to copy 5-byte indexes.
-	Word_t    Pop1,		// number of Indexes to copy.
-	Word_t    MSByte)	// most-significant byte, prefix to each Index.
-{
-	Word_t	  Temp;		// for building 6-byte Index.
-
-	assert(Pop1);
-
-        do {
-	    JU_COPY5_PINDEX_TO_LONG(Temp, PSrc);
-	    Temp |= MSByte;
-	    JU_COPY6_LONG_TO_PINDEX(PDest, Temp);
-	    PSrc  += 5;
-	    PDest += 6;
-        } while (--Pop1);
-
-} // j__udyCopy5to6()
-
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   6   T O   7
-//
-// Copy one or more 6-byte Indexes to a series of 7-byte Indexes.
-
-FUNCTION static void j__udyCopy6to7(
-	uint8_t * PDest,	// to where to copy 6-byte Indexes.
-	uint8_t * PSrc,		// from where to copy 5-byte indexes.
-	Word_t    Pop1,		// number of Indexes to copy.
-	Word_t    MSByte)	// most-significant byte, prefix to each Index.
-{
-	Word_t	  Temp;		// for building 6-byte Index.
-
-	assert(Pop1);
-
-        do {
-	    JU_COPY6_PINDEX_TO_LONG(Temp, PSrc);
-	    Temp |= MSByte;
-	    JU_COPY7_LONG_TO_PINDEX(PDest, Temp);
-	    PSrc  += 6;
-	    PDest += 7;
-        } while (--Pop1);
-
-} // j__udyCopy6to7()
-
-#endif // JU_64BIT
-
-
-#ifndef JU_64BIT // 32-bit
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   3   T O   W
-//
-// Copy one or more 3-byte Indexes to a series of longs (words, always 4-byte).
-
-FUNCTION static void j__udyCopy3toW(
-	PWord_t   PDest,	// to where to copy full-word Indexes.
-	uint8_t * PSrc,		// from where to copy 3-byte indexes.
-	Word_t    Pop1,		// number of Indexes to copy.
-	Word_t    MSByte)	// most-significant byte, prefix to each Index.
-{
-	assert(Pop1);
-
-        do {
-	    JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc);
-	    *PDest++ |= MSByte;
-	    PSrc     += 3;
-        } while (--Pop1);
-
-} // j__udyCopy3toW()
-
-
-#else // JU_64BIT
-
-// ****************************************************************************
-// __ J U D Y   C O P Y   7   T O   W
-//
-// Copy one or more 7-byte Indexes to a series of longs (words, always 8-byte).
-
-FUNCTION static void j__udyCopy7toW(
-	PWord_t   PDest,	// to where to copy full-word Indexes.
-	uint8_t * PSrc,		// from where to copy 7-byte indexes.
-	Word_t    Pop1,		// number of Indexes to copy.
-	Word_t    MSByte)	// most-significant byte, prefix to each Index.
-{
-	assert(Pop1);
-
-        do {
-	    JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc);
-	    *PDest++ |= MSByte;
-	    PSrc     += 7;
-        } while (--Pop1);
-
-} // j__udyCopy7toW()
-
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// __ J U D Y   B R A N C H   B   T O   B R A N C H   L
-//
-// When a BranchB shrinks to have few enough JPs, call this function to convert
-// it to a BranchL.  Return 1 for success, or -1 for failure (with details in
-// Pjpm).
-
-FUNCTION int j__udyBranchBToBranchL(
-	Pjp_t	Pjp,		// points to BranchB to shrink.
-	Pvoid_t	Pjpm)		// for global accounting.
-{
-	Pjbb_t	PjbbRaw;	// old BranchB to shrink.
-	Pjbb_t	Pjbb;
-	Pjbl_t	PjblRaw;	// new BranchL to create.
-	Pjbl_t	Pjbl;
-	Word_t	Digit;		// in BranchB.
-	Word_t  NumJPs;		// non-null JPs in BranchB.
-	uint8_t Expanse[cJU_BRANCHLMAXJPS];	// for building jbl_Expanse[].
-	Pjp_t	Pjpjbl;		// current JP in BranchL.
-	Word_t  SubExp;		// in BranchB.
-
-	assert(JU_JPTYPE(Pjp) >= cJU_JPBRANCH_B2);
-	assert(JU_JPTYPE(Pjp) <= cJU_JPBRANCH_B);
-
-	PjbbRaw	= (Pjbb_t) (Pjp->jp_Addr);
-	Pjbb	= P_JBB(PjbbRaw);
-
-// Copy 1-byte subexpanse digits from BranchB to temporary buffer for BranchL,
-// for each bit set in the BranchB:
-//
-// TBD:  The following supports variable-sized linear branches, but they are no
-// longer variable; this could be simplified to save the copying.
-//
-// TBD:  Since cJU_BRANCHLMAXJP == 7 now, and cJU_BRANCHUNUMJPS == 256, the
-// following might be inefficient; is there a faster way to do it?  At least
-// skip wholly empty subexpanses?
-
-	for (NumJPs = Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit)
-	{
-	    if (JU_BITMAPTESTB(Pjbb, Digit))
-	    {
-		Expanse[NumJPs++] = Digit;
-		assert(NumJPs <= cJU_BRANCHLMAXJPS);	// required of caller.
-	    }
-	}
-
-// Allocate and populate the BranchL:
-
-	if ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL) return(-1);
-	Pjbl = P_JBL(PjblRaw);
-
-	JU_COPYMEM(Pjbl->jbl_Expanse, Expanse, NumJPs);
-
-	Pjbl->jbl_NumJPs = NumJPs;
-	DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), NumJPs, 1);)
-
-// Copy JPs from each BranchB subexpanse subarray:
-
-	Pjpjbl = P_JP(Pjbl->jbl_jp);	// start at first JP in array.
-
-	for (SubExp = 0; SubExp < cJU_NUMSUBEXPB; ++SubExp)
-	{
-	    Pjp_t PjpRaw = JU_JBB_PJP(Pjbb, SubExp);	// current Pjp.
-	    Pjp_t Pjp;
-
-	    if (PjpRaw == (Pjp_t) NULL) continue;  // skip empty subexpanse.
-	    Pjp = P_JP(PjpRaw);
-
-	    NumJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, SubExp));
-	    assert(NumJPs);
-	    JU_COPYMEM(Pjpjbl, Pjp, NumJPs);	 // one subarray at a time.
-
-	    Pjpjbl += NumJPs;
-	    j__udyFreeJBBJP(PjpRaw, NumJPs, Pjpm);	// subarray.
-	}
-	j__udyFreeJBB(PjbbRaw, Pjpm);		// BranchB itself.
-
-// Finish up:  Calculate new JP type (same index size = level in new class),
-// and tie new BranchB into parent JP:
-
-	Pjp->jp_Type += cJU_JPBRANCH_L - cJU_JPBRANCH_B;
-	Pjp->jp_Addr  = (Word_t) PjblRaw;
-
-	return(1);
-
-} // j__udyBranchBToBranchL()
-
-
-#ifdef notdef
-
-// ****************************************************************************
-// __ J U D Y   B R A N C H   U   T O   B R A N C H   B
-//
-// When a BranchU shrinks to need little enough memory, call this function to
-// convert it to a BranchB to save memory (at the cost of some speed).  Return
-// 1 for success, or -1 for failure (with details in Pjpm).
-//
-// TBD:  Fill out if/when needed.  Not currently used in JudyDel.c for reasons
-// explained there.
-
-FUNCTION int j__udyBranchUToBranchB(
-	Pjp_t	Pjp,		// points to BranchU to shrink.
-	Pvoid_t	Pjpm)		// for global accounting.
-{
-	assert(FALSE);
-	return(1);
-}
-#endif // notdef
-
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-// ****************************************************************************
-// __ J U D Y   L E A F   B 1   T O   L E A F   1
-//
-// Shrink a bitmap leaf (cJU_LEAFB1) to linear leaf (cJU_JPLEAF1).
-// Return 1 for success, or -1 for failure (with details in Pjpm).
-//
-// Note:  This function is different than the other JudyLeaf*ToLeaf*()
-// functions because it receives a Pjp, not just a leaf, and handles its own
-// allocation and free, in order to allow the caller to continue with a LeafB1
-// if allocation fails.
-
-FUNCTION int j__udyLeafB1ToLeaf1(
-	Pjp_t	  Pjp,		// points to LeafB1 to shrink.
-	Pvoid_t	  Pjpm)		// for global accounting.
-{
-	Pjlb_t    PjlbRaw;	// bitmap in old leaf.
-	Pjlb_t    Pjlb;
-	Pjll_t	  PjllRaw;	// new Leaf1.
-	uint8_t	* Pleaf1;	// Leaf1 pointer type.
-	Word_t    Digit;	// in LeafB1 bitmap.
-#ifdef JUDYL
-	Pjv_t	  PjvNew;	// value area in new Leaf1.
-	Word_t    Pop1;
-	Word_t    SubExp;
-#endif
-
-	assert(JU_JPTYPE(Pjp) == cJU_JPLEAF_B1);
-	assert(((JU_JPDCDPOP0(Pjp) & 0xFF) + 1) == cJU_LEAF1_MAXPOP1);
-
-// Allocate JPLEAF1 and prepare pointers:
-
-	if ((PjllRaw = j__udyAllocJLL1(cJU_LEAF1_MAXPOP1, Pjpm)) == 0)
-	    return(-1);
-
-	Pleaf1	= (uint8_t *) P_JLL(PjllRaw);
-	PjlbRaw	= (Pjlb_t) (Pjp->jp_Addr);
-	Pjlb	= P_JLB(PjlbRaw);
-	JUDYLCODE(PjvNew = JL_LEAF1VALUEAREA(Pleaf1, cJL_LEAF1_MAXPOP1);)
-
-// Copy 1-byte indexes from old LeafB1 to new Leaf1:
-
-	for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit)
-	    if (JU_BITMAPTESTL(Pjlb, Digit))
-		*Pleaf1++ = Digit;
-
-#ifdef JUDYL
-
-// Copy all old-LeafB1 value areas from value subarrays to new Leaf1:
-
-	for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp)
-	{
-	    Pjv_t PjvRaw = JL_JLB_PVALUE(Pjlb, SubExp);
-	    Pjv_t Pjv    = P_JV(PjvRaw);
-
-	    if (Pjv == (Pjv_t) NULL) continue;	// skip empty subarray.
-
-	    Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp));  // subarray.
-	    assert(Pop1);
-
-	    JU_COPYMEM(PjvNew, Pjv, Pop1);		// copy value areas.
-	    j__udyLFreeJV(PjvRaw, Pop1, Pjpm);
-	    PjvNew += Pop1;				// advance through new.
-	}
-
-	assert((((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw))
-	    == (PjvNew - JL_LEAF1VALUEAREA(P_JLL(PjllRaw), cJL_LEAF1_MAXPOP1)));
-#endif // JUDYL
-
-	DBGCODE(JudyCheckSorted((Pjll_t) P_JLL(PjllRaw),
-			    (((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)), 1);)
-
-// Finish up:  Free the old LeafB1 and plug the new Leaf1 into the JP:
-//
-// Note:  jp_DcdPopO does not change here.
-
-	j__udyFreeJLB1(PjlbRaw, Pjpm);
-
-	Pjp->jp_Addr = (Word_t) PjllRaw;
-	Pjp->jp_Type = cJU_JPLEAF1;
-
-	return(1);
-
-} // j__udyLeafB1ToLeaf1()
-
-#endif // (JUDYL || (! JU_64BIT))
-
-
-// ****************************************************************************
-// __ J U D Y   L E A F   1   T O   L E A F   2
-//
-// Copy 1-byte Indexes from a LeafB1 or Leaf1 to 2-byte Indexes in a Leaf2.
-// Pjp MUST be one of:  cJU_JPLEAF_B1, cJU_JPLEAF1, or cJU_JPIMMED_1_*.
-// Return number of Indexes copied.
-//
-// TBD:  In this and all following functions, the caller should already be able
-// to compute the Pop1 return value, so why return it?
-
-FUNCTION Word_t  j__udyLeaf1ToLeaf2(
-	uint16_t * PLeaf2,	// destination uint16_t * Index portion of leaf.
-#ifdef JUDYL
-	Pjv_t	   Pjv2,	// destination value part of leaf.
-#endif
-	Pjp_t	   Pjp,		// 1-byte-index object from which to copy.
-	Word_t     MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	   Pjpm)	// for global accounting.
-{
-	Word_t	   Pop1;	// Indexes in leaf.
-	Word_t	   Offset;	// in linear leaf list.
-JUDYLCODE(Pjv_t	   Pjv1Raw;)	// source object value area.
-JUDYLCODE(Pjv_t	   Pjv1;)
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF_B1:
-
-	case cJU_JPLEAF_B1:
-	{
-	    Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr);
-	    Word_t Digit;	// in LeafB1 bitmap.
-  JUDYLCODE(Word_t SubExp;)	// in LeafB1.
-
-	    Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1);
-
-// Copy 1-byte indexes from old LeafB1 to new Leaf2, including splicing in
-// the missing MSByte needed in the Leaf2:
-
-	    for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit)
-		if (JU_BITMAPTESTL(Pjlb, Digit))
-		    *PLeaf2++ = MSByte | Digit;
-
-#ifdef JUDYL
-
-// Copy all old-LeafB1 value areas from value subarrays to new Leaf2:
-
-	    for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp)
-	    {
-		Word_t SubExpPop1;
-
-		Pjv1Raw = JL_JLB_PVALUE(Pjlb, SubExp);
-		if (Pjv1Raw == (Pjv_t) NULL) continue;	// skip empty.
-		Pjv1 = P_JV(Pjv1Raw);
-
-		SubExpPop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp));
-		assert(SubExpPop1);
-
-		JU_COPYMEM(Pjv2, Pjv1, SubExpPop1);	// copy value areas.
-		j__udyLFreeJV(Pjv1Raw, SubExpPop1, Pjpm);
-		Pjv2 += SubExpPop1;			// advance through new.
-	    }
-#endif // JUDYL
-
-	    j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm);  // LeafB1 itself.
-	    return(Pop1);
-
-	} // case cJU_JPLEAF_B1
-
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-// JPLEAF1:
-
-	case cJU_JPLEAF1:
-	{
-	    uint8_t * PLeaf1 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1);
-	    JUDYLCODE(Pjv1 = JL_LEAF1VALUEAREA(PLeaf1, Pop1);)
-
-// Copy all Index bytes including splicing in missing MSByte needed in Leaf2
-// (plus, for JudyL, value areas):
-
-	    for (Offset = 0; Offset < Pop1; ++Offset)
-	    {
-		PLeaf2[Offset] = MSByte | PLeaf1[Offset];
-		JUDYLCODE(Pjv2[Offset] = Pjv1[Offset];)
-	    }
-	    j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-#endif // (JUDYL || (! JU_64BIT))
-
-
-// JPIMMED_1_01:
-//
-// Note:  jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte),
-// so the assignment to PLeaf2[] truncates and MSByte is not needed.
-
-	case cJU_JPIMMED_1_01:
-	{
-	    PLeaf2[0] = JU_JPDCDPOP0(Pjp);	// see above.
-	    JUDYLCODE(Pjv2[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-// JPIMMED_1_0[2+]:
-
-	case cJU_JPIMMED_1_02:
-	case cJU_JPIMMED_1_03:
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:
-	case cJU_JPIMMED_1_05:
-	case cJU_JPIMMED_1_06:
-	case cJU_JPIMMED_1_07:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:
-	case cJ1_JPIMMED_1_09:
-	case cJ1_JPIMMED_1_10:
-	case cJ1_JPIMMED_1_11:
-	case cJ1_JPIMMED_1_12:
-	case cJ1_JPIMMED_1_13:
-	case cJ1_JPIMMED_1_14:
-	case cJ1_JPIMMED_1_15:
-#endif
-	{
-	    Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; assert(Pop1);
-	    JUDYLCODE(Pjv1Raw = (Pjv_t) (Pjp->jp_Addr);)
-	    JUDYLCODE(Pjv1    = P_JV(Pjv1Raw);)
-
-	    for (Offset = 0; Offset < Pop1; ++Offset)
-	    {
-#ifdef JUDY1
-		PLeaf2[Offset] = MSByte | Pjp->jp_1Index[Offset];
-#else
-		PLeaf2[Offset] = MSByte | Pjp->jp_LIndex[Offset];
-		Pjv2  [Offset] = Pjv1[Offset];
-#endif
-	    }
-	    JUDYLCODE(j__udyLFreeJV(Pjv1Raw, Pop1, Pjpm);)
-	    return(Pop1);
-	}
-
-
-// UNEXPECTED CASES, including JPNULL1, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf1ToLeaf2()
-
-
-// *****************************************************************************
-// __ J U D Y   L E A F   2   T O   L E A F   3
-//
-// Copy 2-byte Indexes from a Leaf2 to 3-byte Indexes in a Leaf3.
-// Pjp MUST be one of:  cJU_JPLEAF2 or cJU_JPIMMED_2_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-3 branch to a
-// Leaf3, the branch has no narrow pointers under it, meaning only level-2
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf2ToLeaf3(
-	uint8_t * PLeaf3,	// destination "uint24_t *" Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	  Pjv3,		// destination value part of leaf.
-#endif
-	Pjp_t	  Pjp,		// 2-byte-index object from which to copy.
-	Word_t    MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	  Pjpm)		// for global accounting.
-{
-	Word_t	  Pop1;		// Indexes in leaf.
-#if (defined(JUDYL) && defined(JU_64BIT))
-	Pjv_t	  Pjv2Raw;	// source object value area.
-#endif
-JUDYLCODE(Pjv_t	  Pjv2;)
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF2:
-
-	case cJU_JPLEAF2:
-	{
-	    uint16_t * PLeaf2 = (uint16_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1);
-	    j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv2 = JL_LEAF2VALUEAREA(PLeaf2, Pop1);
-	    JU_COPYMEM(Pjv3, Pjv2, Pop1);
-#endif
-	    j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_2_01:
-//
-// Note:  jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte),
-// so the "assignment" to PLeaf3[] is exact [truncates] and MSByte is not
-// needed.
-
-	case cJU_JPIMMED_2_01:
-	{
-	    JU_COPY3_LONG_TO_PINDEX(PLeaf3, JU_JPDCDPOP0(Pjp));	// see above.
-	    JUDYLCODE(Pjv3[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-// JPIMMED_2_0[2+]:
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:
-	case cJU_JPIMMED_2_03:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:
-	case cJ1_JPIMMED_2_05:
-	case cJ1_JPIMMED_2_06:
-	case cJ1_JPIMMED_2_07:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-	{
-	    JUDY1CODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_1Index);)
-	    JUDYLCODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_LIndex);)
-
-	    Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; assert(Pop1);
-	    j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv2Raw = (Pjv_t) (Pjp->jp_Addr);
-	    Pjv2    = P_JV(Pjv2Raw);
-	    JU_COPYMEM(Pjv3, Pjv2, Pop1);
-	    j__udyLFreeJV(Pjv2Raw, Pop1, Pjpm);
-#endif
-	    return(Pop1);
-	}
-#endif // (JUDY1 || JU_64BIT)
-
-
-// UNEXPECTED CASES, including JPNULL2, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf2ToLeaf3()
-
-
-#ifdef JU_64BIT
-
-// ****************************************************************************
-// __ J U D Y   L E A F   3   T O   L E A F   4
-//
-// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a Leaf4.
-// Pjp MUST be one of:  cJU_JPLEAF3 or cJU_JPIMMED_3_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-4 branch to a
-// Leaf4, the branch has no narrow pointers under it, meaning only level-3
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf3ToLeaf4(
-	uint32_t * PLeaf4,	// destination uint32_t * Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	   Pjv4,	// destination value part of leaf.
-#endif
-	Pjp_t	   Pjp,		// 3-byte-index object from which to copy.
-	Word_t     MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	   Pjpm)	// for global accounting.
-{
-	Word_t	   Pop1;	// Indexes in leaf.
-JUDYLCODE(Pjv_t	   Pjv3Raw;)	// source object value area.
-JUDYLCODE(Pjv_t	   Pjv3;)
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF3:
-
-	case cJU_JPLEAF3:
-	{
-	    uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1);
-	    j__udyCopy3to4(PLeaf4, (uint8_t *) PLeaf3, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1);
-	    JU_COPYMEM(Pjv4, Pjv3, Pop1);
-#endif
-	    j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_3_01:
-//
-// Note:  jp_DcdPopO has 7 bytes of Index (all but most significant byte), so
-// the assignment to PLeaf4[] truncates and MSByte is not needed.
-
-	case cJU_JPIMMED_3_01:
-	{
-	    PLeaf4[0] = JU_JPDCDPOP0(Pjp);	// see above.
-	    JUDYLCODE(Pjv4[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-// JPIMMED_3_0[2+]:
-
-	case cJU_JPIMMED_3_02:
-#ifdef JUDY1
-	case cJ1_JPIMMED_3_03:
-	case cJ1_JPIMMED_3_04:
-	case cJ1_JPIMMED_3_05:
-#endif
-	{
-	    JUDY1CODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index);)
-	    JUDYLCODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_LIndex);)
-
-	    JUDY1CODE(Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_3_02 + 2;)
-	    JUDYLCODE(Pop1 = 2;)
-
-	    j__udyCopy3to4(PLeaf4, PLeaf3, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv3Raw = (Pjv_t) (Pjp->jp_Addr);
-	    Pjv3    = P_JV(Pjv3Raw);
-	    JU_COPYMEM(Pjv4, Pjv3, Pop1);
-	    j__udyLFreeJV(Pjv3Raw, Pop1, Pjpm);
-#endif
-	    return(Pop1);
-	}
-
-
-// UNEXPECTED CASES, including JPNULL3, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf3ToLeaf4()
-
-
-// Note:  In all following j__udyLeaf*ToLeaf*() functions, JPIMMED_*_0[2+]
-// cases exist for Judy1 (&& 64-bit) only.  JudyL has no equivalent Immeds.
-
-
-// *****************************************************************************
-// __ J U D Y   L E A F   4   T O   L E A F   5
-//
-// Copy 4-byte Indexes from a Leaf4 to 5-byte Indexes in a Leaf5.
-// Pjp MUST be one of:  cJU_JPLEAF4 or cJU_JPIMMED_4_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-5 branch to a
-// Leaf5, the branch has no narrow pointers under it, meaning only level-4
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf4ToLeaf5(
-	uint8_t * PLeaf5,	// destination "uint40_t *" Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	  Pjv5,		// destination value part of leaf.
-#endif
-	Pjp_t	  Pjp,		// 4-byte-index object from which to copy.
-	Word_t    MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	  Pjpm)		// for global accounting.
-{
-	Word_t	  Pop1;		// Indexes in leaf.
-JUDYLCODE(Pjv_t	  Pjv4;)	// source object value area.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF4:
-
-	case cJU_JPLEAF4:
-	{
-	    uint32_t * PLeaf4 = (uint32_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1);
-	    j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv4 = JL_LEAF4VALUEAREA(PLeaf4, Pop1);
-	    JU_COPYMEM(Pjv5, Pjv4, Pop1);
-#endif
-	    j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_4_01:
-//
-// Note:  jp_DcdPopO has 7 bytes of Index (all but most significant byte), so
-// the assignment to PLeaf5[] truncates and MSByte is not needed.
-
-	case cJU_JPIMMED_4_01:
-	{
-	    JU_COPY5_LONG_TO_PINDEX(PLeaf5, JU_JPDCDPOP0(Pjp));	// see above.
-	    JUDYLCODE(Pjv5[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-#ifdef JUDY1
-
-// JPIMMED_4_0[4+]:
-
-	case cJ1_JPIMMED_4_02:
-	case cJ1_JPIMMED_4_03:
-	{
-	    uint32_t * PLeaf4 = (uint32_t *) (Pjp->jp_1Index);
-
-	    Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_4_02 + 2;
-	    j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte);
-	    return(Pop1);
-	}
-#endif // JUDY1
-
-
-// UNEXPECTED CASES, including JPNULL4, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf4ToLeaf5()
-
-
-// ****************************************************************************
-// __ J U D Y   L E A F   5   T O   L E A F   6
-//
-// Copy 5-byte Indexes from a Leaf5 to 6-byte Indexes in a Leaf6.
-// Pjp MUST be one of:  cJU_JPLEAF5 or cJU_JPIMMED_5_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-6 branch to a
-// Leaf6, the branch has no narrow pointers under it, meaning only level-5
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf5ToLeaf6(
-	uint8_t * PLeaf6,	// destination uint8_t * Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	  Pjv6,		// destination value part of leaf.
-#endif
-	Pjp_t	  Pjp,		// 5-byte-index object from which to copy.
-	Word_t    MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	  Pjpm)		// for global accounting.
-{
-	Word_t	  Pop1;		// Indexes in leaf.
-JUDYLCODE(Pjv_t	  Pjv5;)	// source object value area.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF5:
-
-	case cJU_JPLEAF5:
-	{
-	    uint8_t * PLeaf5 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1);
-	    j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv5 = JL_LEAF5VALUEAREA(PLeaf5, Pop1);
-	    JU_COPYMEM(Pjv6, Pjv5, Pop1);
-#endif
-	    j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_5_01:
-//
-// Note:  jp_DcdPopO has 7 bytes of Index (all but most significant byte), so
-// the assignment to PLeaf6[] truncates and MSByte is not needed.
-
-	case cJU_JPIMMED_5_01:
-	{
-	    JU_COPY6_LONG_TO_PINDEX(PLeaf6, JU_JPDCDPOP0(Pjp));	// see above.
-	    JUDYLCODE(Pjv6[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-#ifdef JUDY1
-
-// JPIMMED_5_0[2+]:
-
-	case cJ1_JPIMMED_5_02:
-	case cJ1_JPIMMED_5_03:
-	{
-	    uint8_t * PLeaf5 = (uint8_t *) (Pjp->jp_1Index);
-
-	    Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_5_02 + 2;
-	    j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte);
-	    return(Pop1);
-	}
-#endif // JUDY1
-
-
-// UNEXPECTED CASES, including JPNULL5, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf5ToLeaf6()
-
-
-// *****************************************************************************
-// __ J U D Y   L E A F   6   T O   L E A F   7
-//
-// Copy 6-byte Indexes from a Leaf2 to 7-byte Indexes in a Leaf7.
-// Pjp MUST be one of:  cJU_JPLEAF6 or cJU_JPIMMED_6_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-7 branch to a
-// Leaf7, the branch has no narrow pointers under it, meaning only level-6
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf6ToLeaf7(
-	uint8_t * PLeaf7,	// destination "uint24_t *" Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	  Pjv7,		// destination value part of leaf.
-#endif
-	Pjp_t	  Pjp,		// 6-byte-index object from which to copy.
-	Word_t    MSByte,	// most-significant byte, prefix to each Index.
-	Pvoid_t	  Pjpm)		// for global accounting.
-{
-	Word_t	  Pop1;		// Indexes in leaf.
-JUDYLCODE(Pjv_t	  Pjv6;)	// source object value area.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF6:
-
-	case cJU_JPLEAF6:
-	{
-	    uint8_t * PLeaf6 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyCopy6to7(PLeaf7, PLeaf6, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv6 = JL_LEAF6VALUEAREA(PLeaf6, Pop1);
-	    JU_COPYMEM(Pjv7, Pjv6, Pop1);
-#endif
-	    j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_6_01:
-//
-// Note:  jp_DcdPopO has 7 bytes of Index (all but most significant byte), so
-// the "assignment" to PLeaf7[] is exact and MSByte is not needed.
-
-	case cJU_JPIMMED_6_01:
-	{
-	    JU_COPY7_LONG_TO_PINDEX(PLeaf7, JU_JPDCDPOP0(Pjp));	// see above.
-	    JUDYLCODE(Pjv7[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-#ifdef JUDY1
-
-// JPIMMED_6_02:
-
-	case cJ1_JPIMMED_6_02:
-	{
-	    uint8_t * PLeaf6 = (uint8_t *) (Pjp->jp_1Index);
-
-	    j__udyCopy6to7(PLeaf7, PLeaf6, /* Pop1 = */ 2, MSByte);
-	    return(2);
-	}
-#endif // JUDY1
-
-
-// UNEXPECTED CASES, including JPNULL6, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf6ToLeaf7()
-
-#endif // JU_64BIT
-
-
-#ifndef JU_64BIT // 32-bit version first
-
-// ****************************************************************************
-// __ J U D Y   L E A F   3   T O   L E A F   W
-//
-// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a LeafW.  Pjp MUST be
-// one of:  cJU_JPLEAF3 or cJU_JPIMMED_3_*.  Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-L branch to a
-// LeafW, the branch has no narrow pointers under it, meaning only level-3
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf3ToLeafW(
-	Pjlw_t	Pjlw,		// destination Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	PjvW,		// destination value part of leaf.
-#endif
-	Pjp_t	Pjp,		// 3-byte-index object from which to copy.
-	Word_t	MSByte,		// most-significant byte, prefix to each Index.
-	Pvoid_t	Pjpm)		// for global accounting.
-{
-	Word_t	Pop1;		// Indexes in leaf.
-JUDYLCODE(Pjv_t Pjv3;)		// source object value area.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF3:
-
-	case cJU_JPLEAF3:
-	{
-	    uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1);
-	    JU_COPYMEM(PjvW, Pjv3, Pop1);
-#endif
-	    j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_3_01:
-//
-// Note:  jp_DcdPopO has 3 bytes of Index (all but most significant byte), and
-// MSByte must be ord in.
-
-	case cJU_JPIMMED_3_01:
-	{
-	    Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp);		// see above.
-	    JUDYLCODE(PjvW[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-#ifdef JUDY1
-
-// JPIMMED_3_02:
-
-	case cJU_JPIMMED_3_02:
-	{
-	    uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index);
-
-	    j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, /* Pop1 = */ 2, MSByte);
-	    return(2);
-	}
-#endif // JUDY1
-
-
-// UNEXPECTED CASES, including JPNULL3, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf3ToLeafW()
-
-
-#else // JU_64BIT
-
-
-// ****************************************************************************
-// __ J U D Y   L E A F   7   T O   L E A F   W
-//
-// Copy 7-byte Indexes from a Leaf7 to 8-byte Indexes in a LeafW.
-// Pjp MUST be one of:  cJU_JPLEAF7 or cJU_JPIMMED_7_*.
-// Return number of Indexes copied.
-//
-// Note:  By the time this function is called to compress a level-L branch to a
-// LeafW, the branch has no narrow pointers under it, meaning only level-7
-// objects are below it and must be handled here.
-
-FUNCTION Word_t  j__udyLeaf7ToLeafW(
-	Pjlw_t	Pjlw,		// destination Index part of leaf.
-#ifdef JUDYL
-	Pjv_t	PjvW,		// destination value part of leaf.
-#endif
-	Pjp_t	Pjp,		// 7-byte-index object from which to copy.
-	Word_t	MSByte,		// most-significant byte, prefix to each Index.
-	Pvoid_t	Pjpm)		// for global accounting.
-{
-	Word_t	Pop1;		// Indexes in leaf.
-JUDYLCODE(Pjv_t	Pjv7;)		// source object value area.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// JPLEAF7:
-
-	case cJU_JPLEAF7:
-	{
-	    uint8_t * PLeaf7 = (uint8_t *) P_JLL(Pjp->jp_Addr);
-
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, Pop1, MSByte);
-#ifdef JUDYL
-	    Pjv7 = JL_LEAF7VALUEAREA(PLeaf7, Pop1);
-	    JU_COPYMEM(PjvW, Pjv7, Pop1);
-#endif
-	    j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    return(Pop1);
-	}
-
-
-// JPIMMED_7_01:
-//
-// Note:  jp_DcdPopO has 7 bytes of Index (all but most significant byte), and
-// MSByte must be ord in.
-
-	case cJU_JPIMMED_7_01:
-	{
-	    Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp);		// see above.
-	    JUDYLCODE(PjvW[0] = Pjp->jp_Addr;)
-	    return(1);
-	}
-
-
-#ifdef JUDY1
-
-// JPIMMED_7_02:
-
-	case cJ1_JPIMMED_7_02:
-	{
-	    uint8_t * PLeaf7 = (uint8_t *) (Pjp->jp_1Index);
-
-	    j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, /* Pop1 = */ 2, MSByte);
-	    return(2);
-	}
-#endif
-
-
-// UNEXPECTED CASES, including JPNULL7, should be handled by caller:
-
-	default: assert(FALSE); break;
-
-	} // switch
-
-	return(0);
-
-} // j__udyLeaf7ToLeafW()
-
-#endif // JU_64BIT
diff --git a/libs/klib/judy/JudyDel.c b/libs/klib/judy/JudyDel.c
deleted file mode 100644
index 4291da6..0000000
--- a/libs/klib/judy/JudyDel.c
+++ /dev/null
@@ -1,2144 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy1Unset() and JudyLDel() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// About HYSTERESIS:  In the Judy code, hysteresis means leaving around a
-// nominally suboptimal (not maximally compressed) data structure after a
-// deletion.  As a result, the shape of the tree for two identical index sets
-// can differ depending on the insert/delete path taken to arrive at the index
-// sets.  The purpose is to minimize worst-case behavior (thrashing) that could
-// result from a series of intermixed insertions and deletions.  It also makes
-// for MUCH simpler code, because instead of performing, "delete and then
-// compress," it can say, "compress and then delete," where due to hysteresis,
-// compression is not even attempted until the object IS compressible.
-//
-// In some cases the code has no choice and it must "ungrow" a data structure
-// across a "phase transition" boundary without hysteresis.  In other cases the
-// amount (such as "hysteresis = 1") is indicated by the number of JP deletions
-// (in branches) or index deletions (in leaves) that can occur in succession
-// before compressing the data structure.  (It appears that hysteresis <= 1 in
-// all cases.)
-//
-// In general no hysteresis occurs when the data structure type remains the
-// same but the allocated memory chunk for the node must shrink, because the
-// relationship is hardwired and theres no way to know how much memory is
-// allocated to a given data structure.  Hysteresis = 0 in all these cases.
-//
-// TBD:  Could this code be faster if memory chunk hysteresis were supported
-// somehow along with data structure type hysteresis?
-//
-// TBD:  Should some of the assertions here be converted to product code that
-// returns JU_ERRNO_CORRUPT?
-//
-// TBD:  Dougs code had an odd mix of function-wide and limited-scope
-// variables.  Should some of the function-wide variables appear only in
-// limited scopes, or more likely, vice-versa?
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);)
-DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);)
-
-#ifdef TRACEJP
-#include "JudyPrintJP.c"
-#endif
-
-// These are defined to generic values in JudyCommon/JudyPrivateTypes.h:
-//
-// TBD:  These should be exported from a header file, but perhaps not, as they
-// are only used here, and exported from JudyDecascade.c, which is a separate
-// file for profiling reasons (to prevent inlining), but which potentially
-// could be merged with this file, either in SoftCM or at compile-time:
-
-#ifdef JUDY1
-
-extern int      j__udy1BranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm);
-#ifndef JU_64BIT
-extern int      j__udy1LeafB1ToLeaf1(Pjp_t, Pvoid_t);
-#endif
-extern Word_t   j__udy1Leaf1ToLeaf2(uint16_t *, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udy1Leaf2ToLeaf3(uint8_t  *, Pjp_t, Word_t, Pvoid_t);
-#ifndef JU_64BIT
-extern Word_t   j__udy1Leaf3ToLeafW(Pjlw_t,     Pjp_t, Word_t, Pvoid_t);
-#else
-extern Word_t   j__udy1Leaf3ToLeaf4(uint32_t *, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udy1Leaf4ToLeaf5(uint8_t  *, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udy1Leaf5ToLeaf6(uint8_t  *, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udy1Leaf6ToLeaf7(uint8_t  *, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udy1Leaf7ToLeafW(Pjlw_t,     Pjp_t, Word_t, Pvoid_t);
-#endif
-
-#else // JUDYL
-
-extern int      j__udyLBranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm);
-extern int      j__udyLLeafB1ToLeaf1(Pjp_t, Pvoid_t);
-extern Word_t   j__udyLLeaf1ToLeaf2(uint16_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udyLLeaf2ToLeaf3(uint8_t  *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-#ifndef JU_64BIT
-extern Word_t   j__udyLLeaf3ToLeafW(Pjlw_t,     Pjv_t, Pjp_t, Word_t, Pvoid_t);
-#else
-extern Word_t   j__udyLLeaf3ToLeaf4(uint32_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udyLLeaf4ToLeaf5(uint8_t  *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udyLLeaf5ToLeaf6(uint8_t  *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udyLLeaf6ToLeaf7(uint8_t  *, Pjv_t, Pjp_t, Word_t, Pvoid_t);
-extern Word_t   j__udyLLeaf7ToLeafW(Pjlw_t,     Pjv_t, Pjp_t, Word_t, Pvoid_t);
-#endif
-
-#endif // JUDYL
-
-// For convenience in the calling code; "M1" means "minus one":
-
-#ifndef JU_64BIT
-#define j__udyLeafM1ToLeafW j__udyLeaf3ToLeafW
-#else
-#define j__udyLeafM1ToLeafW j__udyLeaf7ToLeafW
-#endif
-
-
-// ****************************************************************************
-// __ J U D Y   D E L   W A L K
-//
-// Given a pointer to a JP, an Index known to be valid, the number of bytes
-// left to decode (== level in the tree), and a pointer to a global JPM, walk a
-// Judy (sub)tree to do an unset/delete of that index, and possibly modify the
-// JPM.  This function is only called internally, and recursively.  Unlike
-// Judy1Test() and JudyLGet(), the extra time required for recursion should be
-// negligible compared with the total.
-//
-// Return values:
-//
-// -1 error; details in JPM
-//
-//  0 Index already deleted (should never happen, Index is known to be valid)
-//
-//  1 previously valid Index deleted
-//
-//  2 same as 1, but in addition the JP now points to a BranchL containing a
-//    single JP, which should be compressed into the parent branch (if there
-//    is one, which is not the case for a top-level branch under a JPM)
-
-DBGCODE(uint8_t parentJPtype;)          // parent branch JP type.
-
-FUNCTION static int j__udyDelWalk(
-        Pjp_t   Pjp,            // current JP under which to delete.
-        Word_t  Index,          // to delete.
-        Word_t  ParentLevel,    // of parent branch.
-        Pjpm_t  Pjpm)           // for returning info to top level.
-{
-        Word_t  pop1;           // of a leaf.
-        Word_t  level;          // of a leaf.
-        uint8_t digit;          // from Index, in current branch.
-        Pjll_t  PjllnewRaw;     // address of newly allocated leaf.
-        Pjll_t  Pjllnew;
-        int     offset;         // within a branch.
-        int     retcode;        // return code: -1, 0, 1, 2.
-JUDYLCODE(Pjv_t PjvRaw;)        // value area.
-JUDYLCODE(Pjv_t Pjv;)
-
-        DBGCODE(level = 0;)
-
-ContinueDelWalk:                // for modifying state without recursing.
-
-#ifdef TRACEJP
-        JudyPrintJP(Pjp, "d", __LINE__);
-#endif
-
-        switch (JU_JPTYPE(Pjp)) // entry:  Pjp, Index.
-        {
-
-
-// ****************************************************************************
-// LINEAR BRANCH:
-//
-// MACROS FOR COMMON CODE:
-//
-// Check for population too high to compress a branch to a leaf, meaning just
-// descend through the branch, with a purposeful off-by-one error that
-// constitutes hysteresis = 1.  In other words, do not compress until the
-// branchs CURRENT population fits in the leaf, even BEFORE deleting one
-// index.
-//
-// Next is a label for branch-type-specific common code.  Variables pop1,
-// level, digit, and Index are in the context.
-
-#define JU_BRANCH_KEEP(cLevel,MaxPop1,Next)             \
-        if (pop1 > (MaxPop1))   /* hysteresis = 1 */    \
-        {                                               \
-            assert((cLevel) >= 2);                      \
-            level = (cLevel);                           \
-            digit = JU_DIGITATSTATE(Index, cLevel);     \
-            goto Next;                                  \
-        }
-
-// Support for generic calling of JudyLeaf*ToLeaf*() functions:
-//
-// Note:  Cannot use JUDYLCODE() because this contains a comma.
-
-#ifdef JUDY1
-#define JU_PVALUEPASS  // null.
-#else
-#define JU_PVALUEPASS  Pjv,
-#endif
-
-// During compression to a leaf, check if a JP contains nothing but a
-// cJU_JPIMMED_*_01, in which case shortcut calling j__udyLeaf*ToLeaf*():
-//
-// Copy the index bytes from the jp_DcdPopO field (with possible truncation),
-// and continue the branch-JP-walk loop.  Variables Pjp and Pleaf are in the
-// context.
-
-#define JU_BRANCH_COPY_IMMED_EVEN(cLevel,Pjp,ignore)            \
-        if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2)  \
-        {                                                       \
-            *Pleaf++ = JU_JPDCDPOP0(Pjp);                       \
-  JUDYLCODE(*Pjv++   = (Pjp)->jp_Addr;)                         \
-            continue;   /* for-loop */                          \
-        }
-
-#define JU_BRANCH_COPY_IMMED_ODD(cLevel,Pjp,CopyIndex)          \
-        if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2)  \
-        {                                                       \
-            CopyIndex(Pleaf, (Word_t) (JU_JPDCDPOP0(Pjp)));     \
-            Pleaf += (cLevel);  /* index size = level */        \
-  JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;)                           \
-            continue;   /* for-loop */                          \
-        }
-
-// Compress a BranchL into a leaf one index size larger:
-//
-// Allocate a new leaf, walk the JPs in the old BranchL and pack their contents
-// into the new leaf (of type NewJPType), free the old BranchL, and finally
-// restart the switch to delete Index from the new leaf.  (Note that all
-// BranchLs are the same size.)  Variables Pjp, Pjpm, Pleaf, digit, and pop1
-// are in the context.
-
-#define JU_BRANCHL_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType,          \
-                            LeafToLeaf,Alloc,ValueArea,                 \
-                            CopyImmed,CopyIndex)                        \
-        {                                                               \
-            LeafType Pleaf;                                             \
-            Pjbl_t   PjblRaw;                                           \
-            Pjbl_t   Pjbl;                                              \
-            Word_t   numJPs;                                            \
-                                                                        \
-            if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1);   \
-            Pjllnew = P_JLL(PjllnewRaw);                                \
-            Pleaf   = (LeafType) Pjllnew;                               \
-  JUDYLCODE(Pjv     = ValueArea(Pleaf, MaxPop1);)                       \
-                                                                        \
-            PjblRaw = (Pjbl_t) (Pjp->jp_Addr);                          \
-            Pjbl    = P_JBL(PjblRaw);                                   \
-            numJPs  = Pjbl->jbl_NumJPs;                                 \
-                                                                        \
-            for (offset = 0; offset < numJPs; ++offset)                 \
-            {                                                           \
-                CopyImmed(cLevel, (Pjbl->jbl_jp) + offset, CopyIndex);  \
-                                                                        \
-                pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS                  \
-                          (Pjbl->jbl_jp) + offset,                      \
-                          JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset],    \
-                          cLevel), (Pvoid_t) Pjpm);                     \
-                Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \
-      JUDYLCODE(Pjv  += pop1;)                                          \
-            }                                                           \
-            assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \
-  JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));)  \
-            DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);)         \
-                                                                        \
-            j__udyFreeJBL(PjblRaw, Pjpm);                               \
-                                                                        \
-            Pjp->jp_Type = (NewJPType);                                 \
-            Pjp->jp_Addr = (Word_t) PjllnewRaw;                         \
-            goto ContinueDelWalk;       /* delete from new leaf */      \
-        }
-
-// Overall common code for initial BranchL deletion handling:
-//
-// Assert that Index is in the branch, then see if the BranchL should be kept
-// or else compressed to a leaf.  Variables Index, Pjp, and pop1 are in the
-// context.
-
-#define JU_BRANCHL(cLevel,MaxPop1,LeafType,NewJPType,                   \
-                   LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex)      \
-                                                                        \
-        assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel));              \
-        assert(ParentLevel > (cLevel));                                 \
-                                                                        \
-        pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1;                       \
-        JU_BRANCH_KEEP(cLevel, MaxPop1, BranchLKeep);                   \
-        assert(pop1 == (MaxPop1));                                      \
-                                                                        \
-        JU_BRANCHL_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType,       \
-                            LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex)
-
-
-// END OF MACROS, START OF CASES:
-
-        case cJU_JPBRANCH_L2:
-
-            JU_BRANCHL(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2,
-                       j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_L3:
-
-            JU_BRANCHL(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3,
-                       j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX);
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_L4:
-
-            JU_BRANCHL(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4,
-                       j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_L5:
-
-            JU_BRANCHL(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5,
-                       j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_L6:
-
-            JU_BRANCHL(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6,
-                       j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_L7:
-
-            JU_BRANCHL(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7,
-                       j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX);
-#endif // JU_64BIT
-
-// A top-level BranchL is different and cannot use JU_BRANCHL():  Dont try to
-// compress to a (LEAFW) leaf yet, but leave this for a later deletion
-// (hysteresis > 0); and the next JP type depends on the system word size; so
-// dont use JU_BRANCH_KEEP():
-
-        case cJU_JPBRANCH_L:
-        {
-            Pjbl_t Pjbl;
-            Word_t numJPs;
-
-            level = cJU_ROOTSTATE;
-            digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-
-            // fall through:
-
-
-// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHL:
-//
-// Come here with level and digit set.
-
-BranchLKeep:
-            Pjbl   = P_JBL(Pjp->jp_Addr);
-            numJPs = Pjbl->jbl_NumJPs;
-            assert(numJPs > 0);
-            DBGCODE(parentJPtype = JU_JPTYPE(Pjp);)
-
-// Search for a match to the digit (valid Index => must find digit):
-
-            for (offset = 0; (Pjbl->jbl_Expanse[offset]) != digit; ++offset)
-                assert(offset < numJPs - 1);
-
-            Pjp = (Pjbl->jbl_jp) + offset;
-
-// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through
-// the BranchL):
-
-            assert(level >= 2);
-            if ((JU_JPTYPE(Pjp)) != cJU_JPIMMED_1_01 + level - 2) break;
-
-// At JPIMMED_*_01:  Ensure the index is in the right expanse, then delete the
-// Immed from the BranchL:
-//
-// Note:  A BranchL has a fixed size and format regardless of numJPs.
-
-            assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index));
-
-            JU_DELETEINPLACE(Pjbl->jbl_Expanse, numJPs, offset, ignore);
-            JU_DELETEINPLACE(Pjbl->jbl_jp,      numJPs, offset, ignore);
-
-            DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse),
-                                    numJPs - 1, 1);)
-
-// If only one index left in the BranchL, indicate this to the caller:
-
-            return ((--(Pjbl->jbl_NumJPs) <= 1) ? 2 : 1);
-
-        } // case cJU_JPBRANCH_L.
-
-
-// ****************************************************************************
-// BITMAP BRANCH:
-//
-// MACROS FOR COMMON CODE:
-//
-// Note the reuse of common macros here, defined earlier:  JU_BRANCH_KEEP(),
-// JU_PVALUE*.
-//
-// Compress a BranchB into a leaf one index size larger:
-//
-// Allocate a new leaf, walk the JPs in the old BranchB (one bitmap subexpanse
-// at a time) and pack their contents into the new leaf (of type NewJPType),
-// free the old BranchB, and finally restart the switch to delete Index from
-// the new leaf.  Variables Pjp, Pjpm, Pleaf, digit, and pop1 are in the
-// context.
-//
-// Note:  Its no accident that the interface to JU_BRANCHB_COMPRESS() is
-// identical to JU_BRANCHL_COMPRESS().  Only the details differ in how to
-// traverse the branchs JPs.
-
-#define JU_BRANCHB_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType,          \
-                            LeafToLeaf,Alloc,ValueArea,                 \
-                            CopyImmed,CopyIndex)                        \
-        {                                                               \
-            LeafType  Pleaf;                                            \
-            Pjbb_t    PjbbRaw;  /* BranchB to compress */               \
-            Pjbb_t    Pjbb;                                             \
-            Word_t    subexp;   /* current subexpanse number    */      \
-            BITMAPB_t bitmap;   /* portion for this subexpanse  */      \
-            Pjp_t     Pjp2Raw;  /* one subexpanses subarray     */      \
-            Pjp_t     Pjp2;                                             \
-                                                                        \
-            if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1);   \
-            Pjllnew = P_JLL(PjllnewRaw);                                \
-            Pleaf   = (LeafType) Pjllnew;                               \
-  JUDYLCODE(Pjv     = ValueArea(Pleaf, MaxPop1);)                       \
-                                                                        \
-            PjbbRaw = (Pjbb_t) (Pjp->jp_Addr);                          \
-            Pjbb    = P_JBB(PjbbRaw);                                   \
-                                                                        \
-            for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)         \
-            {                                                           \
-                if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0)        \
-                    continue;           /* empty subexpanse */          \
-                                                                        \
-                digit   = subexp * cJU_BITSPERSUBEXPB;                  \
-                Pjp2Raw = JU_JBB_PJP(Pjbb, subexp);                     \
-                Pjp2    = P_JP(Pjp2Raw);                                \
-                assert(Pjp2 != (Pjp_t) NULL);                           \
-                                                                        \
-                for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit)    \
-                {                                                       \
-                    if (! (bitmap & 1))                                 \
-                        continue;       /* empty sub-subexpanse */      \
-                                                                        \
-                    ++offset;           /* before any continue */       \
-                                                                        \
-                    CopyImmed(cLevel, Pjp2 + offset - 1, CopyIndex);    \
-                                                                        \
-                    pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS              \
-                                      Pjp2 + offset - 1,                \
-                                      JU_DIGITTOSTATE(digit, cLevel),   \
-                                      (Pvoid_t) Pjpm);                  \
-                    Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \
-          JUDYLCODE(Pjv  += pop1;)                                      \
-                }                                                       \
-                j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm);    \
-            }                                                           \
-            assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \
-  JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));)  \
-            DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);)         \
-                                                                        \
-            j__udyFreeJBB(PjbbRaw, Pjpm);                               \
-                                                                        \
-            Pjp->jp_Type = (NewJPType);                                 \
-            Pjp->jp_Addr = (Word_t) PjllnewRaw;                         \
-            goto ContinueDelWalk;       /* delete from new leaf */      \
-        }
-
-// Overall common code for initial BranchB deletion handling:
-//
-// Assert that Index is in the branch, then see if the BranchB should be kept
-// or else compressed to a leaf.  Variables Index, Pjp, and pop1 are in the
-// context.
-
-#define JU_BRANCHB(cLevel,MaxPop1,LeafType,NewJPType,                   \
-                   LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex)      \
-                                                                        \
-        assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel));              \
-        assert(ParentLevel > (cLevel));                                 \
-                                                                        \
-        pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1;                       \
-        JU_BRANCH_KEEP(cLevel, MaxPop1, BranchBKeep);                   \
-        assert(pop1 == (MaxPop1));                                      \
-                                                                        \
-        JU_BRANCHB_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType,       \
-                            LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex)
-
-
-// END OF MACROS, START OF CASES:
-//
-// Note:  Its no accident that the macro calls for these cases is nearly
-// identical to the code for BranchLs.
-
-        case cJU_JPBRANCH_B2:
-
-            JU_BRANCHB(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2,
-                       j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_B3:
-
-            JU_BRANCHB(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3,
-                       j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX);
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_B4:
-
-            JU_BRANCHB(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4,
-                       j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_B5:
-
-            JU_BRANCHB(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5,
-                       j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_B6:
-
-            JU_BRANCHB(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6,
-                       j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_B7:
-
-            JU_BRANCHB(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7,
-                       j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX);
-#endif // JU_64BIT
-
-// A top-level BranchB is different and cannot use JU_BRANCHB():  Dont try to
-// compress to a (LEAFW) leaf yet, but leave this for a later deletion
-// (hysteresis > 0); and the next JP type depends on the system word size; so
-// dont use JU_BRANCH_KEEP():
-
-        case cJU_JPBRANCH_B:
-        {
-            Pjbb_t    Pjbb;             // BranchB to modify.
-            Word_t    subexp;           // current subexpanse number.
-            Word_t    subexp2;          // in second-level loop.
-            BITMAPB_t bitmap;           // portion for this subexpanse.
-            BITMAPB_t bitmask;          // with digits bit set.
-            Pjp_t     Pjp2Raw;          // one subexpanses subarray.
-            Pjp_t     Pjp2;
-            Word_t    numJPs;           // in one subexpanse.
-
-            level = cJU_ROOTSTATE;
-            digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-
-            // fall through:
-
-
-// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHB:
-//
-// Come here with level and digit set.
-
-BranchBKeep:
-            Pjbb    = P_JBB(Pjp->jp_Addr);
-            subexp  = digit / cJU_BITSPERSUBEXPB;
-            bitmap  = JU_JBB_BITMAP(Pjbb, subexp);
-            bitmask = JU_BITPOSMASKB(digit);
-            assert(bitmap & bitmask);   // Index valid => digits bit is set.
-            DBGCODE(parentJPtype = JU_JPTYPE(Pjp);)
-
-// Compute digits offset into the bitmap, with a fast method if all bits are
-// set:
-
-            offset = ((bitmap == (cJU_FULLBITMAPB)) ?
-                      digit % cJU_BITSPERSUBEXPB :
-                      j__udyCountBitsB(bitmap & JU_MASKLOWEREXC(bitmask)));
-
-            Pjp2Raw = JU_JBB_PJP(Pjbb, subexp);
-            Pjp2    = P_JP(Pjp2Raw);
-            assert(Pjp2 != (Pjp_t) NULL);       // valid subexpanse pointer.
-
-// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through
-// the BranchB):
-
-            if (JU_JPTYPE(Pjp2 + offset) != cJU_JPIMMED_1_01 + level - 2)
-            {
-                Pjp = Pjp2 + offset;
-                break;
-            }
-
-// At JPIMMED_*_01:  Ensure the index is in the right expanse, then delete the
-// Immed from the BranchB:
-
-            assert(JU_JPDCDPOP0(Pjp2 + offset)
-                   == JU_TRIMTODCDSIZE(Index));
-
-// If only one index is left in the subexpanse, free the JP array:
-
-            if ((numJPs = j__udyCountBitsB(bitmap)) == 1)
-            {
-                j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ 1, Pjpm);
-                JU_JBB_PJP(Pjbb, subexp) = (Pjp_t) NULL;
-            }
-
-// Shrink JP array in-place:
-
-            else if (JU_BRANCHBJPGROWINPLACE(numJPs - 1))
-            {
-                assert(numJPs > 0);
-                JU_DELETEINPLACE(Pjp2, numJPs, offset, ignore);
-            }
-
-// JP array would end up too large; compress it to a smaller one:
-
-            else
-            {
-                Pjp_t PjpnewRaw;
-                Pjp_t Pjpnew;
-
-                if ((PjpnewRaw = j__udyAllocJBBJP(numJPs - 1, Pjpm))
-                 == (Pjp_t) NULL) return(-1);
-                Pjpnew = P_JP(PjpnewRaw);
-
-                JU_DELETECOPY(Pjpnew, Pjp2, numJPs, offset, ignore);
-                j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm);         // old.
-
-                JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw;
-            }
-
-// Clear digits bit in the bitmap:
-
-            JU_JBB_BITMAP(Pjbb, subexp) ^= bitmask;
-
-// If the current subexpanse alone is still too large for a BranchL (with
-// hysteresis = 1), the delete is all done:
-
-            if (numJPs > cJU_BRANCHLMAXJPS) return(1);
-
-// Consider shrinking the current BranchB to a BranchL:
-//
-// Check the numbers of JPs in other subexpanses in the BranchL.  Upon reaching
-// the critical number of numJPs (which could be right at the start; again,
-// with hysteresis = 1), its faster to just watch for any non-empty subexpanse
-// than to count bits in each subexpanse.  Upon finding too many JPs, give up
-// on shrinking the BranchB.
-
-            for (subexp2 = 0; subexp2 < cJU_NUMSUBEXPB; ++subexp2)
-            {
-                if (subexp2 == subexp) continue;  // skip current subexpanse.
-
-                if ((numJPs == cJU_BRANCHLMAXJPS) ?
-                    JU_JBB_BITMAP(Pjbb, subexp2) :
-                    ((numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp2)))
-                     > cJU_BRANCHLMAXJPS))
-                {
-                    return(1);          // too many JPs, cannot shrink.
-                }
-            }
-
-// Shrink current BranchB to a BranchL:
-//
-// Note:  In this rare case, ignore the return value, do not pass it to the
-// caller, because the deletion is already successfully completed and the
-// caller(s) must decrement population counts.  The only errors expected from
-// this call are JU_ERRNO_NOMEM and JU_ERRNO_OVERRUN, neither of which is worth
-// forwarding from this point.  See also 4.1, 4.8, and 4.15 of this file.
-
-            (void) j__udyBranchBToBranchL(Pjp, Pjpm);
-            return(1);
-
-        } // case.
-
-
-// ****************************************************************************
-// UNCOMPRESSED BRANCH:
-//
-// MACROS FOR COMMON CODE:
-//
-// Note the reuse of common macros here, defined earlier:  JU_PVALUE*.
-//
-// Compress a BranchU into a leaf one index size larger:
-//
-// Allocate a new leaf, walk the JPs in the old BranchU and pack their contents
-// into the new leaf (of type NewJPType), free the old BranchU, and finally
-// restart the switch to delete Index from the new leaf.  Variables Pjp, Pjpm,
-// digit, and pop1 are in the context.
-//
-// Note:  Its no accident that the interface to JU_BRANCHU_COMPRESS() is
-// nearly identical to JU_BRANCHL_COMPRESS(); just NullJPType is added.  The
-// details differ in how to traverse the branchs JPs --
-//
-// -- and also, what to do upon encountering a cJU_JPIMMED_*_01 JP.  In
-// BranchLs and BranchBs the JP must be deleted, but in a BranchU its merely
-// converted to a null JP, and this is done by other switch cases, so the "keep
-// branch" situation is simpler here and JU_BRANCH_KEEP() is not used.  Also,
-// theres no code to convert a BranchU to a BranchB since counting the JPs in
-// a BranchU is (at least presently) expensive, and besides, keeping around a
-// BranchU is form of hysteresis.
-
-#define JU_BRANCHU_COMPRESS(cLevel,LeafType,MaxPop1,NullJPType,NewJPType,   \
-                            LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \
-        {                                                               \
-            LeafType Pleaf;                                             \
-            Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr);                   \
-            Pjp_t  Pjp2    = JU_JBU_PJP0(Pjp);                          \
-            Word_t ldigit;      /* larger than uint8_t */               \
-                                                                        \
-            if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1);   \
-            Pjllnew = P_JLL(PjllnewRaw);                                \
-            Pleaf   = (LeafType) Pjllnew;                               \
-  JUDYLCODE(Pjv     = ValueArea(Pleaf, MaxPop1);)                       \
-                                                                        \
-            for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit, ++Pjp2) \
-            {                                                           \
-                /* fast-process common types: */                        \
-                if (JU_JPTYPE(Pjp2) == (NullJPType)) continue;          \
-                CopyImmed(cLevel, Pjp2, CopyIndex);                     \
-                                                                        \
-                pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS Pjp2,            \
-                                  JU_DIGITTOSTATE(ldigit, cLevel),      \
-                                  (Pvoid_t) Pjpm);                      \
-                Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \
-      JUDYLCODE(Pjv  += pop1;)                                          \
-            }                                                           \
-            assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \
-  JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));)  \
-            DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);)         \
-                                                                        \
-            j__udyFreeJBU(PjbuRaw, Pjpm);                               \
-                                                                        \
-            Pjp->jp_Type = (NewJPType);                                 \
-            Pjp->jp_Addr = (Word_t) PjllnewRaw;                         \
-            goto ContinueDelWalk;       /* delete from new leaf */      \
-        }
-
-// Overall common code for initial BranchU deletion handling:
-//
-// Assert that Index is in the branch, then see if a BranchU should be kept or
-// else compressed to a leaf.  Variables level, Index, Pjp, and pop1 are in the
-// context.
-//
-// Note:  BranchU handling differs from BranchL and BranchB as described above.
-
-#define JU_BRANCHU(cLevel,MaxPop1,LeafType,NullJPType,NewJPType,        \
-                   LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex)      \
-                                                                        \
-        assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel));              \
-        assert(ParentLevel > (cLevel));                                 \
-        DBGCODE(parentJPtype = JU_JPTYPE(Pjp);)                         \
-                                                                        \
-        pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1;                       \
-                                                                        \
-        if (pop1 > (MaxPop1))   /* hysteresis = 1 */                    \
-        {                                                               \
-            level = (cLevel);                                           \
-            Pjp   = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cLevel);\
-            break;              /* descend to next level */             \
-        }                                                               \
-        assert(pop1 == (MaxPop1));                                      \
-                                                                        \
-        JU_BRANCHU_COMPRESS(cLevel, LeafType, MaxPop1, NullJPType, NewJPType, \
-                            LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex)
-
-
-// END OF MACROS, START OF CASES:
-//
-// Note:  Its no accident that the macro calls for these cases is nearly
-// identical to the code for BranchLs, with the addition of cJU_JPNULL*
-// parameters only needed for BranchUs.
-
-        case cJU_JPBRANCH_U2:
-
-            JU_BRANCHU(2, cJU_LEAF2_MAXPOP1, uint16_t *,
-                       cJU_JPNULL1, cJU_JPLEAF2,
-                       j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_U3:
-
-            JU_BRANCHU(3, cJU_LEAF3_MAXPOP1, uint8_t *,
-                       cJU_JPNULL2, cJU_JPLEAF3,
-                       j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX);
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_U4:
-
-            JU_BRANCHU(4, cJU_LEAF4_MAXPOP1, uint32_t *,
-                       cJU_JPNULL3, cJU_JPLEAF4,
-                       j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_EVEN, ignore);
-
-        case cJU_JPBRANCH_U5:
-
-            JU_BRANCHU(5, cJU_LEAF5_MAXPOP1, uint8_t *,
-                       cJU_JPNULL4, cJU_JPLEAF5,
-                       j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_U6:
-
-            JU_BRANCHU(6, cJU_LEAF6_MAXPOP1, uint8_t *,
-                       cJU_JPNULL5, cJU_JPLEAF6,
-                       j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX);
-
-        case cJU_JPBRANCH_U7:
-
-            JU_BRANCHU(7, cJU_LEAF7_MAXPOP1, uint8_t *,
-                       cJU_JPNULL6, cJU_JPLEAF7,
-                       j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA,
-                       JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX);
-#endif // JU_64BIT
-
-// A top-level BranchU is different and cannot use JU_BRANCHU():  Dont try to
-// compress to a (LEAFW) leaf yet, but leave this for a later deletion
-// (hysteresis > 0); just descend through the BranchU:
-
-        case cJU_JPBRANCH_U:
-
-            DBGCODE(parentJPtype = JU_JPTYPE(Pjp);)
-
-            level = cJU_ROOTSTATE;
-            Pjp   = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-            break;
-
-
-// ****************************************************************************
-// LINEAR LEAF:
-//
-// State transitions while deleting an Index, the inverse of the similar table
-// that appears in JudyIns.c:
-//
-// Note:  In JudyIns.c this table is not needed and does not appear until the
-// Immed handling code; because once a Leaf is reached upon growing the tree,
-// the situation remains simpler, but for deleting indexes, the complexity
-// arises when leaves must compress to Immeds.
-//
-// Note:  There are other transitions possible too, not shown here, such as to
-// a leaf one level higher.
-//
-// (Yes, this is very terse...  Study it and it will make sense.)
-// (Note, parts of this diagram are repeated below for quick reference.)
-//
-//                      reformat JP here for Judy1 only, from word-1 to word-2
-//                                                                     |
-//           JUDY1 && JU_64BIT   JUDY1 || JU_64BIT                     |
-//                                                                     V
-// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01
-//     Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02        ]                 => 2_01
-//     Leaf3 [[ => 3_05..03 ] => 3_02                ]                 => 3_01
-// JU_64BIT only:
-//     Leaf4 [[ => 4_03..02 ]]                                         => 4_01
-//     Leaf5 [[ => 5_03..02 ]]                                         => 5_01
-//     Leaf6 [[ => 6_02     ]]                                         => 6_01
-//     Leaf7 [[ => 7_02     ]]                                         => 7_01
-//
-// (*) For Judy1 & 64-bit, go directly from a LeafB1 to cJU_JPIMMED_1_15; skip
-//     Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1.
-//
-// MACROS FOR COMMON CODE:
-//
-// (De)compress a LeafX into a LeafY one index size (cIS) larger (X+1 = Y):
-//
-// This is only possible when the current leaf is under a narrow pointer
-// ((ParentLevel - 1) > cIS) and its population fits in a higher-level leaf.
-// Variables ParentLevel, pop1, PjllnewRaw, Pjllnew, Pjpm, and Index are in the
-// context.
-//
-// Note:  Doing an "uplevel" doesnt occur until the old leaf can be compressed
-// up one level BEFORE deleting an index; that is, hysteresis = 1.
-//
-// Note:  LeafType, MaxPop1, NewJPType, and Alloc refer to the up-level leaf,
-// not the current leaf.
-//
-// Note:  010327:  Fixed bug where the jp_DcdPopO next-uplevel digit (byte)
-// above the current Pop0 value was not being cleared.  When upleveling, one
-// digit in jp_DcdPopO "moves" from being part of the Dcd subfield to the Pop0
-// subfield, but since a leaf maxpop1 is known to be <= 1 byte in size, the new
-// Pop0 byte should always be zero.  This is easy to overlook because
-// JU_JPLEAF_POP0() "knows" to only use the LSB of Pop0 (for efficiency) and
-// ignore the other bytes...  Until someone uses cJU_POP0MASK() instead of
-// JU_JPLEAF_POP0(), such as in JudyInsertBranch.c.
-//
-// TBD:  Should JudyInsertBranch.c use JU_JPLEAF_POP0() rather than
-// cJU_POP0MASK(), for efficiency?  Does it know for sure its a narrow pointer
-// under the leaf?  Not necessarily.
-
-#define JU_LEAF_UPLEVEL(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf,      \
-                        Alloc,ValueArea)                                \
-                                                                        \
-        assert(((ParentLevel - 1) == (cIS)) || (pop1 >= (MaxPop1)));    \
-                                                                        \
-        if (((ParentLevel - 1) > (cIS))  /* under narrow pointer */     \
-         && (pop1 == (MaxPop1)))         /* hysteresis = 1       */     \
-        {                                                               \
-            Word_t D_cdP0;                                              \
-            if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1);   \
-            Pjllnew = P_JLL(PjllnewRaw);                                \
-  JUDYLCODE(Pjv     = ValueArea((LeafType) Pjllnew, MaxPop1);)          \
-                                                                        \
-            (void) LeafToLeaf((LeafType) Pjllnew, JU_PVALUEPASS Pjp,    \
-                              Index & cJU_DCDMASK(cIS), /* TBD, Doug says */ \
-                              (Pvoid_t) Pjpm);                          \
-            DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cIS + 1);)        \
-                                                                        \
-            D_cdP0 = (~cJU_MASKATSTATE((cIS) + 1)) & JU_JPDCDPOP0(Pjp); \
-            JU_JPSETADT(Pjp, (Word_t)PjllnewRaw, D_cdP0, NewJPType);    \
-            goto ContinueDelWalk;       /* delete from new leaf */      \
-        }
-
-
-// For Leaf3, only support JU_LEAF_UPLEVEL on a 64-bit system, and for Leaf7,
-// there is no JU_LEAF_UPLEVEL:
-//
-// Note:  Theres no way here to go from Leaf3 [Leaf7] to LEAFW on a 32-bit
-// [64-bit] system.  Thats handled in the main code, because its different in
-// that a JPM is involved.
-
-#ifndef JU_64BIT // 32-bit.
-#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf,    \
-                          Alloc,ValueArea)              // null.
-#else
-#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf,    \
-                          Alloc,ValueArea)                              \
-        JU_LEAF_UPLEVEL  (cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf,    \
-                          Alloc,ValueArea)
-#define JU_LEAF_UPLEVEL_NONE(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \
-                          Alloc,ValueArea)              // null.
-#endif
-
-// Compress a Leaf* with pop1 = 2, or a JPIMMED_*_02, into a JPIMMED_*_01:
-//
-// Copy whichever Index is NOT being deleted (and assert that the other one is
-// found; Index must be valid).  This requires special handling of the Index
-// bytes (and value area).  Variables Pjp, Index, offset, and Pleaf are in the
-// context, offset is modified to the undeleted Index, and Pjp is modified
-// including jp_Addr.
-
-
-#define JU_TOIMMED_01_EVEN(cIS,ignore1,ignore2)                         \
-{                                                                       \
-        Word_t  D_cdP0;                                                 \
-        Word_t  A_ddr = 0;                                              \
-        uint8_t T_ype = JU_JPTYPE(Pjp);                                 \
-        offset = (Pleaf[0] == JU_LEASTBYTES(Index, cIS)); /* undeleted Ind */ \
-        assert(Pleaf[offset ? 0 : 1] == JU_LEASTBYTES(Index, cIS));     \
-        D_cdP0 = (Index & cJU_DCDMASK(cIS)) | Pleaf[offset];            \
-JUDYLCODE(A_ddr = Pjv[offset];)                                         \
-        JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype);                         \
-}
-
-#define JU_TOIMMED_01_ODD(cIS,SearchLeaf,CopyPIndex)                    \
-        {                                                               \
-            Word_t  D_cdP0;                                             \
-            Word_t  A_ddr = 0;                                          \
-            uint8_t T_ype = JU_JPTYPE(Pjp);                             \
-                                                                        \
-            offset = SearchLeaf(Pleaf, 2, Index);                       \
-            assert(offset >= 0);        /* Index must be valid */       \
-            CopyPIndex(D_cdP0, & (Pleaf[offset ? 0 : cIS]));            \
-            D_cdP0 |= Index & cJU_DCDMASK(cIS);                         \
-  JUDYLCODE(A_ddr = Pjv[offset ? 0 : 1];)                               \
-            JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype);                     \
-        }
-
-
-// Compress a Leaf* into a JPIMMED_*_0[2+]:
-//
-// This occurs as soon as its possible, with hysteresis = 0.  Variables pop1,
-// Pleaf, offset, and Pjpm are in the context.
-//
-// TBD:  Explain why hysteresis = 0 here, rather than > 0.  Probably because
-// the insert code assumes if the population is small enough, an Immed is used,
-// not a leaf.
-//
-// The differences between Judy1 and JudyL with respect to value area handling
-// are just too large for completely common code between them...  Oh well, some
-// big ifdefs follow.
-
-#ifdef JUDY1
-
-#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\
-                        ignore2,ignore3,ignore4,                \
-                        DeleteCopy,FreeLeaf)                    \
-                                                                \
-        assert(pop1 > (MaxPop1));                               \
-                                                                \
-        if ((pop1 - 1) == (MaxPop1))    /* hysteresis = 0 */    \
-        {                                                       \
-            Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr);           \
-            DeleteCopy((LeafType) (Pjp->jp_1Index), Pleaf, pop1, offset, cIS); \
-            DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index),  pop1-1, cIS);) \
-            Pjp->jp_Type = (BaseJPType) - 1 + (MaxPop1) - 1;    \
-            FreeLeaf(PjllRaw, pop1, Pjpm);                      \
-            return(1);                                          \
-        }
-
-#else // JUDYL
-
-// Pjv is also in the context.
-
-#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\
-                        ignore2,ignore3,ignore4,                \
-                        DeleteCopy,FreeLeaf)                    \
-                                                                \
-        assert(pop1 > (MaxPop1));                               \
-                                                                \
-        if ((pop1 - 1) == (MaxPop1))    /* hysteresis = 0 */    \
-        {                                                       \
-            Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr);           \
-            Pjv_t  PjvnewRaw;                                   \
-            Pjv_t  Pjvnew;                                      \
-                                                                \
-            if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm))    \
-                == (Pjv_t) NULL) return(-1);                    \
-   JUDYLCODE(Pjvnew = P_JV(PjvnewRaw);)                         \
-                                                                \
-            DeleteCopy((LeafType) (Pjp->jp_LIndex), Pleaf, pop1, offset, cIS); \
-            JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS);      \
-            DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_LIndex),  pop1-1, cIS);) \
-            FreeLeaf(PjllRaw, pop1, Pjpm);                      \
-            Pjp->jp_Addr = (Word_t) PjvnewRaw;                  \
-            Pjp->jp_Type = (BaseJPType) - 2 + (MaxPop1);        \
-            return(1);                                          \
-        }
-
-// A complicating factor for JudyL & 32-bit is that Leaf2..3, and for JudyL &
-// 64-bit Leaf 4..7, go directly to an Immed*_01, where the value is stored in
-// jp_Addr and not in a separate LeafV.  For efficiency, use the following
-// macro in cases where it can apply; it is rigged to do the right thing.
-// Unfortunately, this requires the calling code to "know" the transition table
-// and call the right macro.
-//
-// This variant compresses a Leaf* with pop1 = 2 into a JPIMMED_*_01:
-
-#define JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType,   \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)                         \
-                                                                        \
-        assert(pop1 > (MaxPop1));                                       \
-                                                                        \
-        if ((pop1 - 1) == (MaxPop1))    /* hysteresis = 0 */            \
-        {                                                               \
-            Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr);                   \
-            ToImmed(cIS, SearchLeaf, CopyPIndex);                       \
-            FreeLeaf(PjllRaw, pop1, Pjpm);                              \
-            Pjp->jp_Type = (Immed01JPType);                             \
-            return(1);                                                  \
-        }
-#endif // JUDYL
-
-// See comments above about these:
-//
-// Note:  Here "23" means index size 2 or 3, and "47" means 4..7.
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)                         \
-        JU_LEAF_TOIMMED(   cIS,LeafType,MaxPop1,BaseJPType,ignore1,     \
-                           ignore2,ignore3,ignore4,                     \
-                           DeleteCopy,FreeLeaf)
-#else // JUDYL && 32-bit
-#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)                         \
-        JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType,   \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)
-#endif
-
-#ifdef JU_64BIT
-#ifdef JUDY1
-#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)                         \
-        JU_LEAF_TOIMMED(   cIS,LeafType,MaxPop1,BaseJPType,ignore1,     \
-                           ignore2,ignore3,ignore4,                     \
-                           DeleteCopy,FreeLeaf)
-#else // JUDYL && 64-bit
-#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)                         \
-        JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType,   \
-                           ToImmed,SearchLeaf,CopyPIndex,               \
-                           DeleteCopy,FreeLeaf)
-#endif // JUDYL
-#endif // JU_64BIT
-
-// Compress a Leaf* in place:
-//
-// Here hysteresis = 0 (no memory is wasted).  Variables pop1, Pleaf, and
-// offset, and for JudyL, Pjv, are in the context.
-
-#ifdef JUDY1
-#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace)          \
-        if (GrowInPlace(pop1 - 1))      /* hysteresis = 0 */    \
-        {                                                       \
-            DeleteInPlace(Pleaf, pop1, offset, cIS);            \
-            DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);)     \
-            return(1);                                          \
-        }
-#else
-#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace)          \
-        if (GrowInPlace(pop1 - 1))      /* hysteresis = 0 */    \
-        {                                                       \
-            DeleteInPlace(Pleaf, pop1, offset, cIS);            \
-/**/        JU_DELETEINPLACE(Pjv, pop1, offset, ignore);        \
-            DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);)     \
-            return(1);                                          \
-        }
-#endif
-
-// Compress a Leaf* into a smaller memory object of the same JP type:
-//
-// Variables PjllnewRaw, Pjllnew, Pleafpop1, Pjpm, PleafRaw, Pleaf, and offset
-// are in the context.
-
-#ifdef JUDY1
-
-#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \
-        if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1);       \
-        Pjllnew = P_JLL(PjllnewRaw);                                     \
-        DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS);        \
-        DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);)                \
-        FreeLeaf(PleafRaw, pop1, Pjpm);                                  \
-        Pjp->jp_Addr = (Word_t) PjllnewRaw;                              \
-        return(1)
-
-#else // JUDYL
-
-#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \
-        {                                                               \
-/**/        Pjv_t Pjvnew;                                               \
-                                                                        \
-            if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1);  \
-            Pjllnew = P_JLL(PjllnewRaw);                                \
-/**/        Pjvnew  = ValueArea(Pjllnew, pop1 - 1);                     \
-            DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS);   \
-/**/        JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS);              \
-            DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);)           \
-            FreeLeaf(PleafRaw, pop1, Pjpm);                             \
-            Pjp->jp_Addr = (Word_t) PjllnewRaw;                         \
-            return(1);                                                  \
-        }
-#endif // JUDYL
-
-// Overall common code for Leaf* deletion handling:
-//
-// See if the leaf can be:
-// - (de)compressed to one a level higher (JU_LEAF_UPLEVEL()), or if not,
-// - compressed to an Immediate JP (JU_LEAF_TOIMMED()), or if not,
-// - shrunk in place (JU_LEAF_INPLACE()), or if none of those, then
-// - shrink the leaf to a smaller chunk of memory (JU_LEAF_SHRINK()).
-//
-// Variables Pjp, pop1, Index, and offset are in the context.
-// The *Up parameters refer to a leaf one level up, if there is any.
-
-#define JU_LEAF(cIS,                                                    \
-                UpLevel,                                                \
-                  LeafTypeUp,MaxPop1Up,LeafJPTypeUp,LeafToLeaf,         \
-                  AllocUp,ValueAreaUp,                                  \
-                LeafToImmed,ToImmed,CopyPIndex,                         \
-                  LeafType,ImmedMaxPop1,ImmedBaseJPType,Immed01JPType,  \
-                  SearchLeaf,GrowInPlace,DeleteInPlace,DeleteCopy,      \
-                  Alloc,FreeLeaf,ValueArea)                             \
-        {                                                               \
-            Pjll_t   PleafRaw;                                          \
-            LeafType Pleaf;                                             \
-                                                                        \
-            assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cIS));             \
-            assert(ParentLevel > (cIS));                                \
-                                                                        \
-            PleafRaw = (Pjll_t) (Pjp->jp_Addr);                         \
-            Pleaf    = (LeafType) P_JLL(PleafRaw);                      \
-            pop1     = JU_JPLEAF_POP0(Pjp) + 1;                         \
-                                                                        \
-            UpLevel(cIS, LeafTypeUp, MaxPop1Up, LeafJPTypeUp,           \
-                    LeafToLeaf, AllocUp, ValueAreaUp);                  \
-                                                                        \
-            offset = SearchLeaf(Pleaf, pop1, Index);                    \
-            assert(offset >= 0);        /* Index must be valid */       \
-  JUDYLCODE(Pjv = ValueArea(Pleaf, pop1);)                              \
-                                                                        \
-            LeafToImmed(cIS, LeafType, ImmedMaxPop1,                    \
-                        ImmedBaseJPType, Immed01JPType,                 \
-                        ToImmed, SearchLeaf, CopyPIndex,                \
-                        DeleteCopy, FreeLeaf);                          \
-                                                                        \
-            JU_LEAF_INPLACE(cIS, GrowInPlace, DeleteInPlace);           \
-                                                                        \
-            JU_LEAF_SHRINK(cIS, LeafType, DeleteCopy, Alloc, FreeLeaf,  \
-                           ValueArea);                                  \
-        }
-
-// END OF MACROS, START OF CASES:
-//
-// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-        case cJU_JPLEAF1:
-
-            JU_LEAF(1,
-                    JU_LEAF_UPLEVEL, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2,
-                      j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA,
-                    JU_LEAF_TOIMMED, ignore, ignore,
-                      uint8_t *, cJU_IMMED1_MAXPOP1,
-                      cJU_JPIMMED_1_02, cJU_JPIMMED_1_01, j__udySearchLeaf1,
-                      JU_LEAF1GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY,
-                      j__udyAllocJLL1, j__udyFreeJLL1, JL_LEAF1VALUEAREA);
-#endif
-
-// A complicating factor is that for JudyL & 32-bit, a Leaf2 must go directly
-// to an Immed 2_01 and a Leaf3 must go directly to an Immed 3_01:
-//
-// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01
-// Leaf3 [[ => 3_05..03 ] => 3_02         ] => 3_01
-//
-// Hence use JU_LEAF_TOIMMED_23 instead of JU_LEAF_TOIMMED in the cases below,
-// and also the parameters ToImmed and, for odd index sizes, CopyPIndex, are
-// required.
-
-        case cJU_JPLEAF2:
-
-            JU_LEAF(2,
-                    JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF3_MAXPOP1, cJU_JPLEAF3,
-                      j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA,
-                    JU_LEAF_TOIMMED_23, JU_TOIMMED_01_EVEN, ignore,
-                      uint16_t *, cJU_IMMED2_MAXPOP1,
-                      cJU_JPIMMED_2_02, cJU_JPIMMED_2_01, j__udySearchLeaf2,
-                      JU_LEAF2GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY,
-                      j__udyAllocJLL2, j__udyFreeJLL2, JL_LEAF2VALUEAREA);
-
-// On 32-bit there is no transition to "uplevel" for a Leaf3, so use
-// JU_LEAF_UPLEVEL64 instead of JU_LEAF_UPLEVEL:
-
-        case cJU_JPLEAF3:
-
-            JU_LEAF(3,
-                    JU_LEAF_UPLEVEL64, uint32_t *, cJU_LEAF4_MAXPOP1,
-                      cJU_JPLEAF4,
-                      j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA,
-                    JU_LEAF_TOIMMED_23,
-                      JU_TOIMMED_01_ODD, JU_COPY3_PINDEX_TO_LONG,
-                      uint8_t *, cJU_IMMED3_MAXPOP1,
-                      cJU_JPIMMED_3_02, cJU_JPIMMED_3_01, j__udySearchLeaf3,
-                      JU_LEAF3GROWINPLACE, JU_DELETEINPLACE_ODD,
-                                           JU_DELETECOPY_ODD,
-                      j__udyAllocJLL3, j__udyFreeJLL3, JL_LEAF3VALUEAREA);
-
-#ifdef JU_64BIT
-
-// A complicating factor is that for JudyL & 64-bit, a Leaf[4-7] must go
-// directly to an Immed [4-7]_01:
-//
-// Leaf4 [[ => 4_03..02 ]] => 4_01
-// Leaf5 [[ => 5_03..02 ]] => 5_01
-// Leaf6 [[ => 6_02     ]] => 6_01
-// Leaf7 [[ => 7_02     ]] => 7_01
-//
-// Hence use JU_LEAF_TOIMMED_47 instead of JU_LEAF_TOIMMED in the cases below.
-
-        case cJU_JPLEAF4:
-
-            JU_LEAF(4,
-                    JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF5_MAXPOP1, cJU_JPLEAF5,
-                      j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA,
-                    JU_LEAF_TOIMMED_47, JU_TOIMMED_01_EVEN, ignore,
-                      uint32_t *, cJU_IMMED4_MAXPOP1,
-                      cJ1_JPIMMED_4_02, cJU_JPIMMED_4_01, j__udySearchLeaf4,
-                      JU_LEAF4GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY,
-                      j__udyAllocJLL4, j__udyFreeJLL4, JL_LEAF4VALUEAREA);
-
-        case cJU_JPLEAF5:
-
-            JU_LEAF(5,
-                    JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF6_MAXPOP1, cJU_JPLEAF6,
-                      j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA,
-                    JU_LEAF_TOIMMED_47,
-                      JU_TOIMMED_01_ODD, JU_COPY5_PINDEX_TO_LONG,
-                      uint8_t *, cJU_IMMED5_MAXPOP1,
-                      cJ1_JPIMMED_5_02, cJU_JPIMMED_5_01, j__udySearchLeaf5,
-                      JU_LEAF5GROWINPLACE, JU_DELETEINPLACE_ODD,
-                                           JU_DELETECOPY_ODD,
-                      j__udyAllocJLL5, j__udyFreeJLL5, JL_LEAF5VALUEAREA);
-
-        case cJU_JPLEAF6:
-
-            JU_LEAF(6,
-                    JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF7_MAXPOP1, cJU_JPLEAF7,
-                      j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA,
-                    JU_LEAF_TOIMMED_47,
-                      JU_TOIMMED_01_ODD, JU_COPY6_PINDEX_TO_LONG,
-                      uint8_t *, cJU_IMMED6_MAXPOP1,
-                      cJ1_JPIMMED_6_02, cJU_JPIMMED_6_01, j__udySearchLeaf6,
-                      JU_LEAF6GROWINPLACE, JU_DELETEINPLACE_ODD,
-                                           JU_DELETECOPY_ODD,
-                      j__udyAllocJLL6, j__udyFreeJLL6, JL_LEAF6VALUEAREA);
-
-// There is no transition to "uplevel" for a Leaf7, so use JU_LEAF_UPLEVEL_NONE
-// instead of JU_LEAF_UPLEVEL, and ignore all of the parameters to that macro:
-
-        case cJU_JPLEAF7:
-
-            JU_LEAF(7,
-                    JU_LEAF_UPLEVEL_NONE, ignore1, ignore2, ignore3, ignore4,
-                      ignore5, ignore6,
-                    JU_LEAF_TOIMMED_47,
-                      JU_TOIMMED_01_ODD, JU_COPY7_PINDEX_TO_LONG,
-                      uint8_t *, cJU_IMMED7_MAXPOP1,
-                      cJ1_JPIMMED_7_02, cJU_JPIMMED_7_01, j__udySearchLeaf7,
-                      JU_LEAF7GROWINPLACE, JU_DELETEINPLACE_ODD,
-                                           JU_DELETECOPY_ODD,
-                      j__udyAllocJLL7, j__udyFreeJLL7, JL_LEAF7VALUEAREA);
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// BITMAP LEAF:
-
-        case cJU_JPLEAF_B1:
-        {
-#ifdef JUDYL
-            Pjv_t     PjvnewRaw;        // new value area.
-            Pjv_t     Pjvnew;
-            Word_t    subexp;           // 1 of 8 subexpanses in bitmap.
-            Pjlb_t    Pjlb;             // pointer to bitmap part of the leaf.
-            BITMAPL_t bitmap;           // for one subexpanse.
-            BITMAPL_t bitmask;          // bit set for Indexs digit.
-#endif
-            assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 1));
-            assert(ParentLevel > 1);
-            // valid Index:
-            assert(JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index));
-
-            pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-
-// Like a Leaf1, see if its under a narrow pointer and can become a Leaf2
-// (hysteresis = 1):
-
-            JU_LEAF_UPLEVEL(1, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2,
-                            j__udyLeaf1ToLeaf2, j__udyAllocJLL2,
-                            JL_LEAF2VALUEAREA);
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-
-// Handle the unusual special case, on Judy1 64-bit only, where a LeafB1 goes
-// directly to a JPIMMED_1_15; as described in comments in Judy1.h and
-// JudyIns.c.  Copy 1-byte indexes from old LeafB1 to the Immed:
-
-            if ((pop1 - 1) == cJU_IMMED1_MAXPOP1)       // hysteresis = 0.
-            {
-                Pjlb_t    PjlbRaw;      // bitmap in old leaf.
-                Pjlb_t    Pjlb;
-                uint8_t * Pleafnew;     // JPIMMED as a pointer.
-                Word_t    ldigit;       // larger than uint8_t.
-
-                PjlbRaw  = (Pjlb_t) (Pjp->jp_Addr);
-                Pjlb     = P_JLB(PjlbRaw);
-                Pleafnew = Pjp->jp_1Index;
-
-                JU_BITMAPCLEARL(Pjlb, Index);   // unset Indexs bit.
-
-// TBD:  This is very slow, there must be a better way:
-
-                for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit)
-                {
-                    if (JU_BITMAPTESTL(Pjlb, ldigit))
-                    {
-                        *Pleafnew++ = ldigit;
-                        assert(Pleafnew - (Pjp->jp_1Index)
-                            <= cJU_IMMED1_MAXPOP1);
-                    }
-                }
-
-                DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index),
-                                        cJU_IMMED1_MAXPOP1, 1);)
-                j__udyFreeJLB1(PjlbRaw, Pjpm);
-
-                Pjp->jp_Type = cJ1_JPIMMED_1_15;
-                return(1);
-            }
-
-#else // (JUDYL || (! JU_64BIT))
-
-// Compress LeafB1 to a Leaf1:
-//
-// Note:  4.37 of this file contained alternate code for Judy1 only that simply
-// cleared the bit and allowed the LeafB1 to go below cJU_LEAF1_MAXPOP1.  This
-// was the ONLY case where a malloc failure was not fatal; however, it violated
-// the critical assumption that the tree is always kept in least-compressed
-// form.
-
-            if (pop1 == cJU_LEAF1_MAXPOP1)      // hysteresis = 1.
-            {
-                if (j__udyLeafB1ToLeaf1(Pjp, Pjpm) == -1) return(-1);
-                goto ContinueDelWalk;   // delete Index in new Leaf1.
-            }
-#endif // (JUDYL || (! JU_64BIT))
-
-#ifdef JUDY1
-            // unset Indexs bit:
-
-            JU_BITMAPCLEARL(P_JLB(Pjp->jp_Addr), Index);
-#else // JUDYL
-
-// This is very different from Judy1 because of the need to manage the value
-// area:
-//
-// Get last byte to decode from Index, and pointer to bitmap leaf:
-
-            digit = JU_DIGITATSTATE(Index, 1);
-            Pjlb = P_JLB(Pjp->jp_Addr);
-
-// Prepare additional values:
-
-            subexp  = digit / cJU_BITSPERSUBEXPL;       // which subexpanse.
-            bitmap  = JU_JLB_BITMAP(Pjlb, subexp);      // subexps 32-bit map.
-            PjvRaw  = JL_JLB_PVALUE(Pjlb, subexp);      // corresponding values.
-            Pjv     = P_JV(PjvRaw);
-            bitmask = JU_BITPOSMASKL(digit);            // mask for Index.
-
-            assert(bitmap & bitmask);                   // Index must be valid.
-
-            if (bitmap == cJU_FULLBITMAPL)      // full bitmap, take shortcut:
-            {
-                pop1   = cJU_BITSPERSUBEXPL;
-                offset = digit % cJU_BITSPERSUBEXPL;
-            }
-            else        // compute subexpanse pop1 and value area offset:
-            {
-                pop1   = j__udyCountBitsL(bitmap);
-                offset = j__udyCountBitsL(bitmap & (bitmask - 1));
-            }
-
-// Handle solitary Index remaining in subexpanse:
-
-            if (pop1 == 1)
-            {
-                j__udyLFreeJV(PjvRaw, 1, Pjpm);
-
-                JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) NULL;
-                JU_JLB_BITMAP(Pjlb, subexp) = 0;
-
-                return(1);
-            }
-
-// Shrink value area in place or move to a smaller value area:
-
-            if (JL_LEAFVGROWINPLACE(pop1 - 1))          // hysteresis = 0.
-            {
-                JU_DELETEINPLACE(Pjv, pop1, offset, ignore);
-            }
-            else
-            {
-                if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm))
-                    == (Pjv_t) NULL) return(-1);
-                Pjvnew = P_JV(PjvnewRaw);
-
-                JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore);
-                j__udyLFreeJV(PjvRaw, pop1, Pjpm);
-                JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) PjvnewRaw;
-            }
-
-            JU_JLB_BITMAP(Pjlb, subexp) ^= bitmask;     // clear Indexs bit.
-
-#endif // JUDYL
-
-            return(1);
-
-        } // case.
-
-
-#ifdef JUDY1
-
-// ****************************************************************************
-// FULL POPULATION LEAF:
-//
-// Convert to a LeafB1 and delete the index.  Hysteresis = 0; none is possible.
-//
-// Note:  Earlier the second assertion below said, "== 2", but in fact the
-// parent could be at a higher level if a fullpop is under a narrow pointer.
-
-        case cJ1_JPFULLPOPU1:
-        {
-            Pjlb_t PjlbRaw;
-            Pjlb_t Pjlb;
-            Word_t subexp;
-
-            assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 2));
-            assert(ParentLevel > 1);    // see above.
-
-            if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL)
-                return(-1);
-            Pjlb = P_JLB(PjlbRaw);
-
-// Fully populate the leaf, then unset Indexs bit:
-
-            for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp)
-                JU_JLB_BITMAP(Pjlb, subexp) = cJU_FULLBITMAPL;
-
-            JU_BITMAPCLEARL(Pjlb, Index);
-
-            Pjp->jp_Addr = (Word_t) PjlbRaw;
-            Pjp->jp_Type = cJU_JPLEAF_B1;
-
-            return(1);
-        }
-#endif // JUDY1
-
-
-// ****************************************************************************
-// IMMEDIATE JP:
-//
-// If theres just the one Index in the Immed, convert the JP to a JPNULL*
-// (should only happen in a BranchU); otherwise delete the Index from the
-// Immed.  See the state transitions table elsewhere in this file for a summary
-// of which Immed types must be handled.  Hysteresis = 0; none is possible with
-// Immeds.
-//
-// MACROS FOR COMMON CODE:
-//
-// Single Index remains in cJU_JPIMMED_*_01; convert JP to null:
-//
-// Variables Pjp and parentJPtype are in the context.
-//
-// Note:  cJU_JPIMMED_*_01 should only be encountered in BranchUs, not in
-// BranchLs or BranchBs (where its improper to merely modify the JP to be a
-// null JP); that is, BranchL and BranchB code should have already handled
-// any cJU_JPIMMED_*_01 by different means.
-
-#define JU_IMMED_01(NewJPType,ParentJPType)                             \
-                                                                        \
-            assert(parentJPtype == (ParentJPType));                     \
-            assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index));       \
-            JU_JPSETADT(Pjp, 0, 0, NewJPType);                          \
-            return(1)
-
-// Convert cJ*_JPIMMED_*_02 to cJU_JPIMMED_*_01:
-//
-// Move the undeleted Index, whichever does not match the least bytes of Index,
-// from undecoded-bytes-only (in jp_1Index or jp_LIndex as appropriate) to
-// jp_DcdPopO (full-field).  Pjp, Index, and offset are in the context.
-
-#define JU_IMMED_02(cIS,LeafType,NewJPType)             \
-        {                                               \
-            LeafType Pleaf;                             \
-                                                        \
-            assert((ParentLevel - 1) == (cIS));         \
-  JUDY1CODE(Pleaf  = (LeafType) (Pjp->jp_1Index);)      \
-  JUDYLCODE(Pleaf  = (LeafType) (Pjp->jp_LIndex);)      \
-  JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);)           \
-  JUDYLCODE(Pjv    = P_JV(PjvRaw);)                     \
-            JU_TOIMMED_01_EVEN(cIS, ignore, ignore);    \
-  JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);)            \
-            Pjp->jp_Type = (NewJPType);                 \
-            return(1);                                  \
-        }
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-
-// Variation for "odd" cJ*_JPIMMED_*_02 JP types, which are very different from
-// "even" types because they use leaf search code and odd-copy macros:
-//
-// Note:  JudyL 32-bit has no "odd" JPIMMED_*_02 types.
-
-#define JU_IMMED_02_ODD(cIS,NewJPType,SearchLeaf,CopyPIndex)    \
-        {                                                       \
-            uint8_t * Pleaf;                                    \
-                                                                \
-            assert((ParentLevel - 1) == (cIS));                 \
-  JUDY1CODE(Pleaf  = (uint8_t *) (Pjp->jp_1Index);)             \
-  JUDYLCODE(Pleaf  = (uint8_t *) (Pjp->jp_LIndex);)             \
-  JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);)                   \
-  JUDYLCODE(Pjv    = P_JV(PjvRaw);)                             \
-            JU_TOIMMED_01_ODD(cIS, SearchLeaf, CopyPIndex);     \
-  JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);)                    \
-            Pjp->jp_Type = (NewJPType);                         \
-            return(1);                                          \
-        }
-#endif // (JUDY1 || JU_64BIT)
-
-// Core code for deleting one Index (and for JudyL, its value area) from a
-// larger Immed:
-//
-// Variables Pleaf, pop1, and offset are in the context.
-
-#ifdef JUDY1
-#define JU_IMMED_DEL(cIS,DeleteInPlace)                 \
-        DeleteInPlace(Pleaf, pop1, offset, cIS);        \
-        DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);)
-
-#else // JUDYL
-
-// For JudyL the value area might need to be shrunk:
-
-#define JU_IMMED_DEL(cIS,DeleteInPlace)                         \
-                                                                \
-        if (JL_LEAFVGROWINPLACE(pop1 - 1)) /* hysteresis = 0 */ \
-        {                                                       \
-            DeleteInPlace(   Pleaf,  pop1, offset, cIS);        \
-            JU_DELETEINPLACE(Pjv, pop1, offset, ignore);        \
-            DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);)     \
-        }                                                       \
-        else                                                    \
-        {                                                       \
-            Pjv_t PjvnewRaw;                                    \
-            Pjv_t Pjvnew;                                       \
-                                                                \
-            if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm))    \
-                == (Pjv_t) NULL) return(-1);                    \
-            Pjvnew = P_JV(PjvnewRaw);                           \
-                                                                \
-            DeleteInPlace(Pleaf, pop1, offset, cIS);            \
-            JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore);   \
-            DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);)     \
-            j__udyLFreeJV(PjvRaw, pop1, Pjpm);                  \
-                                                                \
-            (Pjp->jp_Addr) = (Word_t) PjvnewRaw;                \
-        }
-#endif // JUDYL
-
-// Delete one Index from a larger Immed where no restructuring is required:
-//
-// Variables pop1, Pjp, offset, and Index are in the context.
-
-#define JU_IMMED(cIS,LeafType,BaseJPType,SearchLeaf,DeleteInPlace)      \
-        {                                                               \
-            LeafType Pleaf;                                             \
-                                                                        \
-            assert((ParentLevel - 1) == (cIS));                         \
-  JUDY1CODE(Pleaf  = (LeafType) (Pjp->jp_1Index);)                      \
-  JUDYLCODE(Pleaf  = (LeafType) (Pjp->jp_LIndex);)                      \
-  JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);)                           \
-  JUDYLCODE(Pjv    = P_JV(PjvRaw);)                                     \
-            pop1   = (JU_JPTYPE(Pjp)) - (BaseJPType) + 2;               \
-            offset = SearchLeaf(Pleaf, pop1, Index);                    \
-            assert(offset >= 0);        /* Index must be valid */       \
-                                                                        \
-            JU_IMMED_DEL(cIS, DeleteInPlace);                           \
-            --(Pjp->jp_Type);                                           \
-            return(1);                                                  \
-        }
-
-
-// END OF MACROS, START OF CASES:
-
-// Single Index remains in Immed; convert JP to null:
-
-        case cJU_JPIMMED_1_01: JU_IMMED_01(cJU_JPNULL1, cJU_JPBRANCH_U2);
-        case cJU_JPIMMED_2_01: JU_IMMED_01(cJU_JPNULL2, cJU_JPBRANCH_U3);
-#ifndef JU_64BIT
-        case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U);
-#else
-        case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U4);
-        case cJU_JPIMMED_4_01: JU_IMMED_01(cJU_JPNULL4, cJU_JPBRANCH_U5);
-        case cJU_JPIMMED_5_01: JU_IMMED_01(cJU_JPNULL5, cJU_JPBRANCH_U6);
-        case cJU_JPIMMED_6_01: JU_IMMED_01(cJU_JPNULL6, cJU_JPBRANCH_U7);
-        case cJU_JPIMMED_7_01: JU_IMMED_01(cJU_JPNULL7, cJU_JPBRANCH_U);
-#endif
-
-// Multiple Indexes remain in the Immed JP; delete the specified Index:
-
-        case cJU_JPIMMED_1_02:
-
-            JU_IMMED_02(1, uint8_t *, cJU_JPIMMED_1_01);
-
-        case cJU_JPIMMED_1_03:
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_1_04:
-        case cJU_JPIMMED_1_05:
-        case cJU_JPIMMED_1_06:
-        case cJU_JPIMMED_1_07:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_1_08:
-        case cJ1_JPIMMED_1_09:
-        case cJ1_JPIMMED_1_10:
-        case cJ1_JPIMMED_1_11:
-        case cJ1_JPIMMED_1_12:
-        case cJ1_JPIMMED_1_13:
-        case cJ1_JPIMMED_1_14:
-        case cJ1_JPIMMED_1_15:
-#endif
-            JU_IMMED(1, uint8_t *, cJU_JPIMMED_1_02,
-                     j__udySearchLeaf1, JU_DELETEINPLACE);
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_2_02:
-
-            JU_IMMED_02(2, uint16_t *, cJU_JPIMMED_2_01);
-
-        case cJU_JPIMMED_2_03:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_2_04:
-        case cJ1_JPIMMED_2_05:
-        case cJ1_JPIMMED_2_06:
-        case cJ1_JPIMMED_2_07:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-            JU_IMMED(2, uint16_t *, cJU_JPIMMED_2_02,
-                     j__udySearchLeaf2, JU_DELETEINPLACE);
-
-        case cJU_JPIMMED_3_02:
-
-            JU_IMMED_02_ODD(3, cJU_JPIMMED_3_01,
-                            j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG);
-
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_3_03:
-        case cJ1_JPIMMED_3_04:
-        case cJ1_JPIMMED_3_05:
-
-            JU_IMMED(3, uint8_t *, cJU_JPIMMED_3_02,
-                     j__udySearchLeaf3, JU_DELETEINPLACE_ODD);
-
-        case cJ1_JPIMMED_4_02:
-
-            JU_IMMED_02(4, uint32_t *, cJU_JPIMMED_4_01);
-
-        case cJ1_JPIMMED_4_03:
-
-            JU_IMMED(4, uint32_t *, cJ1_JPIMMED_4_02,
-                     j__udySearchLeaf4, JU_DELETEINPLACE);
-
-        case cJ1_JPIMMED_5_02:
-
-            JU_IMMED_02_ODD(5, cJU_JPIMMED_5_01,
-                            j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG);
-
-        case cJ1_JPIMMED_5_03:
-
-            JU_IMMED(5, uint8_t *, cJ1_JPIMMED_5_02,
-                     j__udySearchLeaf5, JU_DELETEINPLACE_ODD);
-
-        case cJ1_JPIMMED_6_02:
-
-            JU_IMMED_02_ODD(6, cJU_JPIMMED_6_01,
-                            j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG);
-
-        case cJ1_JPIMMED_7_02:
-
-            JU_IMMED_02_ODD(7, cJU_JPIMMED_7_01,
-                            j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG);
-
-#endif // (JUDY1 && JU_64BIT)
-
-
-// ****************************************************************************
-// INVALID JP TYPE:
-
-        default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1);
-
-        } // switch
-
-
-// PROCESS JP -- RECURSIVELY:
-//
-// For non-Immed JP types, if successful, post-decrement the population count
-// at this level, or collapse a BranchL if necessary by copying the remaining
-// JP in the BranchL to the parent (hysteresis = 0), which implicitly creates a
-// narrow pointer if there was not already one in the hierarchy.
-
-        assert(level);
-        retcode =  j__udyDelWalk(Pjp, Index, level, Pjpm);
-        assert(retcode != 0);           // should never happen.
-
-        if ((JU_JPTYPE(Pjp)) < cJU_JPIMMED_1_01)                // not an Immed.
-        {
-            switch (retcode)
-            {
-            case 1: 
-            {
-                jp_t JP = *Pjp;
-                Word_t DcdP0;
-
-                DcdP0 = JU_JPDCDPOP0(Pjp) - 1;          // decrement count.
-                JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); 
-                break;
-            }
-            case 2:     // collapse BranchL to single JP; see above:
-                {
-                    Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr);
-                    Pjbl_t Pjbl    = P_JBL(PjblRaw);
-
-                    *Pjp = Pjbl->jbl_jp[0];
-                    j__udyFreeJBL(PjblRaw, Pjpm);
-                    retcode = 1;
-                }
-            }
-        }
-
-        return(retcode);
-
-} // j__udyDelWalk()
-
-
-// ****************************************************************************
-// J U D Y   1   U N S E T
-// J U D Y   L   D E L
-//
-// Main entry point.  See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int Judy1Unset 
-#else
-FUNCTION int JudyLDel
-#endif
-        (
-        PPvoid_t  PPArray,      // in which to delete.
-        Word_t    Index,        // to delete.
-        PJError_t PJError       // optional, for returning error info.
-        )
-{
-        Word_t    pop1;         // population of leaf.
-        int       offset;       // at which to delete Index.
-    JUDY1CODE(int retcode;)     // return code from Judy1Test().
-JUDYLCODE(PPvoid_t PPvalue;)  // pointer from JudyLGet().
-
-
-// CHECK FOR NULL ARRAY POINTER (error by caller):
-
-        if (PPArray == (PPvoid_t) NULL)
-        {
-            JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-            return(JERRI);
-        }
-
-
-// CHECK IF INDEX IS INVALID:
-//
-// If so, theres nothing to do.  This saves a lot of time.  Pass through
-// PJError, if any, from the "get" function.
-
-#ifdef JUDY1
-        if ((retcode = Judy1Test(*PPArray, Index, PJError)) == JERRI)
-            return (JERRI);
-
-        if (retcode == 0) return(0);
-#else
-        if ((PPvalue = JudyLGet(*PPArray, Index, PJError)) == PPJERR)
-            return (JERRI);
-
-        if (PPvalue == (PPvoid_t) NULL) return(0);
-#endif
-
-
-// ****************************************************************************
-// PROCESS TOP LEVEL (LEAFW) BRANCHES AND LEAVES:
-
-// ****************************************************************************
-// LEAFW LEAF, OTHER SIZE:
-//
-// Shrink or convert the leaf as necessary.  Hysteresis = 0; none is possible.
-
-        if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-        {
-  JUDYLCODE(Pjv_t  Pjv;)                        // current value area.
-  JUDYLCODE(Pjv_t  Pjvnew;)                     // value area in new leaf.
-            Pjlw_t Pjlw = P_JLW(*PPArray);      // first word of leaf.
-            Pjlw_t Pjlwnew;                     // replacement leaf.
-            pop1 = Pjlw[0] + 1;                 // first word of leaf is pop0.
-
-// Delete single (last) Index from array:
-
-            if (pop1 == 1)
-            {
-                j__udyFreeJLW(Pjlw, /* pop1 = */ 1, (Pjpm_t) NULL);
-                *PPArray = (Pvoid_t) NULL;
-                return(1);
-            }
-
-// Locate Index in compressible leaf:
-
-            offset = j__udySearchLeafW(Pjlw + 1, pop1, Index);
-            assert(offset >= 0);                // Index must be valid.
-
-  JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1);)
-
-// Delete Index in-place:
-//
-// Note:  "Grow in place from pop1 - 1" is the logical inverse of, "shrink in
-// place from pop1."  Also, Pjlw points to the count word, so skip that for
-// doing the deletion.
-
-            if (JU_LEAFWGROWINPLACE(pop1 - 1))
-            {
-                JU_DELETEINPLACE(Pjlw + 1, pop1, offset, ignore);
-#ifdef JUDYL // also delete from value area:
-                JU_DELETEINPLACE(Pjv,      pop1, offset, ignore);
-#endif
-                DBGCODE(JudyCheckSorted((Pjll_t) (Pjlw + 1), pop1 - 1,
-                                        cJU_ROOTSTATE);)
-                --(Pjlw[0]);                    // decrement population.
-                DBGCODE(JudyCheckPop(*PPArray);)
-                return(1);
-            }
-
-// Allocate new leaf for use in either case below:
-
-            Pjlwnew = j__udyAllocJLW(pop1 - 1);
-            JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI);
-
-// Shrink to smaller LEAFW:
-//
-// Note:  Skip the first word = pop0 in each leaf.
-
-            Pjlwnew[0] = (pop1 - 1) - 1;
-            JU_DELETECOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, ignore);
-
-#ifdef JUDYL // also delete from value area:
-            Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 - 1);
-            JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore);
-#endif
-            DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 - 1, cJU_ROOTSTATE);)
-
-            j__udyFreeJLW(Pjlw, pop1, (Pjpm_t) NULL);
-
-////        *PPArray = (Pvoid_t)  Pjlwnew | cJU_LEAFW);
-            *PPArray = (Pvoid_t)  Pjlwnew; 
-            DBGCODE(JudyCheckPop(*PPArray);)
-            return(1);
-
-        }
-        else
-
-
-// ****************************************************************************
-// JRP BRANCH:
-//
-// Traverse through the JPM to do the deletion unless the population is small
-// enough to convert immediately to a LEAFW.
-
-        {
-            Pjpm_t Pjpm;
-            Pjp_t  Pjp;         // top-level JP to process.
-            Word_t digit;       // in a branch.
-  JUDYLCODE(Pjv_t  Pjv;)        // to value area.
-            Pjlw_t Pjlwnew;                     // replacement leaf.
-    DBGCODE(Pjlw_t Pjlwnew_orig;)
-
-            Pjpm = P_JPM(*PPArray);     // top object in array (tree).
-            Pjp  = &(Pjpm->jpm_JP);     // next object (first branch or leaf).
-
-            assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L)
-                || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B)
-                || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U));
-
-// WALK THE TREE 
-//
-// Note:  Recursive code in j__udyDelWalk() knows how to collapse a lower-level
-// BranchL containing a single JP into the parent JP as a narrow pointer, but
-// the code here cant do that for a top-level BranchL.  The result can be
-// PArray -> JPM -> BranchL containing a single JP.  This situation is
-// unavoidable because a JPM cannot contain a narrow pointer; the BranchL is
-// required in order to hold the top digit decoded, and it does not collapse to
-// a LEAFW until the population is low enough.
-//
-// TBD:  Should we add a topdigit field to JPMs so they can hold narrow
-// pointers?
-
-            if (j__udyDelWalk(Pjp, Index, cJU_ROOTSTATE, Pjpm) == -1)
-            {
-                JU_COPY_ERRNO(PJError, Pjpm);
-                return(JERRI);
-            }
-
-            --(Pjpm->jpm_Pop0); // success; decrement total population.
-
-            if ((Pjpm->jpm_Pop0 + 1) != cJU_LEAFW_MAXPOP1)
-            {
-                DBGCODE(JudyCheckPop(*PPArray);)
-                return(1);
-            }
-
-// COMPRESS A BRANCH[LBU] TO A LEAFW:
-//
-            Pjlwnew = j__udyAllocJLW(cJU_LEAFW_MAXPOP1);
-            JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI);
-
-// Plug leaf into root pointer and set population count:
-
-////        *PPArray  = (Pvoid_t) ((Word_t) Pjlwnew | cJU_LEAFW);
-            *PPArray  = (Pvoid_t) Pjlwnew;
-#ifdef JUDYL // prepare value area:
-            Pjv = JL_LEAFWVALUEAREA(Pjlwnew, cJU_LEAFW_MAXPOP1);
-#endif
-            *Pjlwnew++ = cJU_LEAFW_MAXPOP1 - 1; // set pop0.
-            DBGCODE(Pjlwnew_orig = Pjlwnew;)
-
-            switch (JU_JPTYPE(Pjp))
-            {
-
-// JPBRANCH_L:  Copy each JPs indexes to the new LEAFW and free the old
-// branch:
-
-            case cJU_JPBRANCH_L:
-            {
-                Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr);
-                Pjbl_t Pjbl    = P_JBL(PjblRaw);
-
-                for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset)
-                {
-                    pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS
-                             (Pjbl->jbl_jp) + offset,
-                             JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset],
-                                             cJU_BYTESPERWORD),
-                             (Pvoid_t) Pjpm);
-                    Pjlwnew += pop1;            // advance through indexes.
-          JUDYLCODE(Pjv     += pop1;)           // advance through values.
-                }
-                j__udyFreeJBL(PjblRaw, Pjpm);
-
-                assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1);
-                break;                  // delete Index from new LEAFW.
-            }
-
-// JPBRANCH_B:  Copy each JPs indexes to the new LEAFW and free the old
-// branch, including each JP subarray:
-
-            case cJU_JPBRANCH_B:
-            {
-                Pjbb_t    PjbbRaw = (Pjbb_t) (Pjp->jp_Addr);
-                Pjbb_t    Pjbb    = P_JBB(PjbbRaw);
-                Word_t    subexp;       // current subexpanse number.
-                BITMAPB_t bitmap;       // portion for this subexpanse.
-                Pjp_t     Pjp2Raw;      // one subexpanses subarray.
-                Pjp_t     Pjp2;
-
-                for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-                {
-                    if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0)
-                        continue;               // skip empty subexpanse.
-
-                    digit   = subexp * cJU_BITSPERSUBEXPB;
-                    Pjp2Raw = JU_JBB_PJP(Pjbb, subexp);
-                    Pjp2    = P_JP(Pjp2Raw);
-                    assert(Pjp2 != (Pjp_t) NULL);
-
-// Walk through bits for all possible sub-subexpanses (digits); increment
-// offset for each populated subexpanse; until no more set bits:
-
-                    for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit)
-                    {
-                        if (! (bitmap & 1))     // skip empty sub-subexpanse.
-                            continue;
-
-                        pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS
-                                 Pjp2 + offset,
-                                 JU_DIGITTOSTATE(digit, cJU_BYTESPERWORD),
-                                 (Pvoid_t) Pjpm);
-                        Pjlwnew += pop1;         // advance through indexes.
-              JUDYLCODE(Pjv     += pop1;)        // advance through values.
-                        ++offset;
-                    }
-                    j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm);
-                }
-                j__udyFreeJBB(PjbbRaw, Pjpm);
-
-                assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1);
-                break;                  // delete Index from new LEAFW.
-
-            } // case cJU_JPBRANCH_B.
-
-
-// JPBRANCH_U:  Copy each JPs indexes to the new LEAFW and free the old
-// branch:
-
-            case cJU_JPBRANCH_U:
-            {
-                Pjbu_t  PjbuRaw = (Pjbu_t) (Pjp->jp_Addr);
-                Pjbu_t  Pjbu    = P_JBU(PjbuRaw);
-                Word_t  ldigit;         // larger than uint8_t.
-
-                for (Pjp = Pjbu->jbu_jp, ldigit = 0;
-                     ldigit < cJU_BRANCHUNUMJPS;
-                     ++Pjp, ++ldigit)
-                {
-
-// Shortcuts, to save a little time for possibly big branches:
-
-                    if ((JU_JPTYPE(Pjp)) == cJU_JPNULLMAX)  // skip null JP.
-                        continue;
-
-// TBD:  Should the following shortcut also be used in BranchL and BranchB
-// code?
-
-#ifndef JU_64BIT
-                    if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_3_01)
-#else
-                    if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_7_01)
-#endif
-                    {                                   // single Immed:
-                        *Pjlwnew++ = JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD)
-                                   | JU_JPDCDPOP0(Pjp); // rebuild Index.
-#ifdef JUDYL
-                        *Pjv++ = Pjp->jp_Addr;  // copy value area.
-#endif
-                        continue;
-                    }
-
-                    pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS
-                             Pjp, JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD),
-                             (Pvoid_t) Pjpm);
-                    Pjlwnew += pop1;            // advance through indexes.
-          JUDYLCODE(Pjv     += pop1;)           // advance through values.
-                }
-                j__udyFreeJBU(PjbuRaw, Pjpm);
-
-                assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1);
-                break;                  // delete Index from new LEAFW.
-
-            } // case cJU_JPBRANCH_U.
-
-
-// INVALID JP TYPE in jpm_t struct
-
-            default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-                     return(JERRI);
-
-            } // end switch on sub-JP type.
-
-            DBGCODE(JudyCheckSorted((Pjll_t) Pjlwnew_orig, cJU_LEAFW_MAXPOP1,
-                                    cJU_ROOTSTATE);)
-
-// FREE JPM (no longer needed):
-
-            j__udyFreeJPM(Pjpm, (Pjpm_t) NULL);
-            DBGCODE(JudyCheckPop(*PPArray);)
-            return(1);
-
-        } 
-        /*NOTREACHED*/
-
-} // Judy1Unset() / JudyLDel()
diff --git a/libs/klib/judy/JudyFirst.c b/libs/klib/judy/JudyFirst.c
deleted file mode 100644
index 91533a9..0000000
--- a/libs/klib/judy/JudyFirst.c
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy*First[Empty]() and Judy*Last[Empty]() routines for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// These are inclusive versions of Judy*Next[Empty]() and Judy*Prev[Empty]().
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-
-// ****************************************************************************
-// J U D Y   1   F I R S T
-// J U D Y   L   F I R S T
-//
-// See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int	  Judy1First
-#else
-FUNCTION PPvoid_t JudyLFirst
-#endif
-        (
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-        if (PIndex == (PWord_t) NULL)		// caller error:
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-	}
-
-#ifdef JUDY1
-	switch (Judy1Test(PArray, *PIndex, PJError))
-	{
-	case 1:	 return(1);			// found *PIndex itself.
-	case 0:  return(Judy1Next(PArray, PIndex, PJError));
-	default: return(JERRI);
-	}
-#else
-	{
-	    PPvoid_t PValue;
-
-	    if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR)
-		return(PPJERR);
-
-	    if (PValue != (PPvoid_t) NULL) return(PValue);  // found *PIndex.
-
-	    return(JudyLNext(PArray, PIndex, PJError));
-	}
-#endif
-
-} // Judy1First() / JudyLFirst()
-
-
-// ****************************************************************************
-// J U D Y   1   L A S T
-// J U D Y   L   L A S T
-//
-// See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int	  Judy1Last(
-#else
-FUNCTION PPvoid_t JudyLLast(
-#endif
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError)	// optional, for returning error info.
-{
-        if (PIndex == (PWord_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);	 // caller error.
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-	}
-
-#ifdef JUDY1
-	switch (Judy1Test(PArray, *PIndex, PJError))
-	{
-	case 1:	 return(1);			// found *PIndex itself.
-	case 0:  return(Judy1Prev(PArray, PIndex, PJError));
-	default: return(JERRI);
-	}
-#else
-	{
-	    PPvoid_t PValue;
-
-	    if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR)
-		return(PPJERR);
-
-	    if (PValue != (PPvoid_t) NULL) return(PValue);  // found *PIndex.
-
-	    return(JudyLPrev(PArray, PIndex, PJError));
-	}
-#endif
-
-} // Judy1Last() / JudyLLast()
-
-
-// ****************************************************************************
-// J U D Y   1   F I R S T   E M P T Y
-// J U D Y   L   F I R S T   E M P T Y
-//
-// See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int Judy1FirstEmpty(
-#else
-FUNCTION int JudyLFirstEmpty(
-#endif
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError)	// optional, for returning error info.
-{
-        if (PIndex == (PWord_t) NULL)		// caller error:
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-	    return(JERRI);
-	}
-
-#ifdef JUDY1
-	switch (Judy1Test(PArray, *PIndex, PJError))
-	{
-	case 0:	 return(1);			// found *PIndex itself.
-	case 1:  return(Judy1NextEmpty(PArray, PIndex, PJError));
-	default: return(JERRI);
-	}
-#else
-	{
-	    PPvoid_t PValue;
-
-	    if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR)
-		return(JERRI);
-
-	    if (PValue == (PPvoid_t) NULL) return(1);	// found *PIndex.
-
-	    return(JudyLNextEmpty(PArray, PIndex, PJError));
-	}
-#endif
-
-} // Judy1FirstEmpty() / JudyLFirstEmpty()
-
-
-// ****************************************************************************
-// J U D Y   1   L A S T   E M P T Y
-// J U D Y   L   L A S T   E M P T Y
-//
-// See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int Judy1LastEmpty(
-#else
-FUNCTION int JudyLLastEmpty(
-#endif
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError)	// optional, for returning error info.
-{
-        if (PIndex == (PWord_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);	 // caller error.
-	    return(JERRI);
-	}
-
-#ifdef JUDY1
-	switch (Judy1Test(PArray, *PIndex, PJError))
-	{
-	case 0:	 return(1);			// found *PIndex itself.
-	case 1:  return(Judy1PrevEmpty(PArray, PIndex, PJError));
-	default: return(JERRI);
-	}
-#else
-	{
-	    PPvoid_t PValue;
-
-	    if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR)
-		return(JERRI);
-
-	    if (PValue == (PPvoid_t) NULL) return(1);	// found *PIndex.
-
-	    return(JudyLPrevEmpty(PArray, PIndex, PJError));
-	}
-#endif
-
-} // Judy1LastEmpty() / JudyLLastEmpty()
diff --git a/libs/klib/judy/JudyFreeArray.c b/libs/klib/judy/JudyFreeArray.c
deleted file mode 100644
index 0145479..0000000
--- a/libs/klib/judy/JudyFreeArray.c
+++ /dev/null
@@ -1,361 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy1FreeArray() and JudyLFreeArray() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-// Return the number of bytes freed from the array.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);)
-
-
-// ****************************************************************************
-// J U D Y   1   F R E E   A R R A Y
-// J U D Y   L   F R E E   A R R A Y
-//
-// See the Judy*(3C) manual entry for details.
-//
-// This code is written recursively, at least at first, because thats much
-// simpler.  Hope its fast enough.
-
-#ifdef JUDY1
-FUNCTION Word_t Judy1FreeArray
-#else
-FUNCTION Word_t JudyLFreeArray
-#endif
-        (
-	PPvoid_t  PPArray,	// array to free.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-	jpm_t	  jpm;		// local to accumulate free statistics.
-
-// CHECK FOR NULL POINTER (error by caller):
-
-	if (PPArray == (PPvoid_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-	    return(JERR);
-	}
-
-	DBGCODE(JudyCheckPop(*PPArray);)
-
-// Zero jpm.jpm_Pop0 (meaning the array will be empty in a moment) for accurate
-// logging in TRACEMI2.
-
-	jpm.jpm_Pop0	      = 0;		// see above.
-	jpm.jpm_TotalMemWords = 0;		// initialize memory freed.
-
-// 	Empty array:
-
-	if (P_JLW(*PPArray) == (Pjlw_t) NULL) return(0);
-
-// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAF:
-
-	if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw = P_JLW(*PPArray);	// first word of leaf.
-
-	    j__udyFreeJLW(Pjlw, Pjlw[0] + 1, &jpm);
-	    *PPArray = (Pvoid_t) NULL;		// make an empty array.
-	    return (-(jpm.jpm_TotalMemWords * cJU_BYTESPERWORD));  // see above.
-	}
-	else
-
-// Rootstate leaves:  just free the leaf:
-
-// Common code for returning the amount of memory freed.
-//
-// Note:  In a an ordinary LEAFW, pop0 = *PPArray[0].
-//
-// Accumulate (negative) words freed, while freeing objects.
-// Return the positive bytes freed.
-
-	{
-	    Pjpm_t Pjpm	    = P_JPM(*PPArray);
-	    Word_t TotalMem = Pjpm->jpm_TotalMemWords;
-
-	    j__udyFreeSM(&(Pjpm->jpm_JP), &jpm);  // recurse through tree.
-	    j__udyFreeJPM(Pjpm, &jpm);
-
-// Verify the array was not corrupt.  This means that amount of memory freed
-// (which is negative) is equal to the initial amount:
-
-	    if (TotalMem + jpm.jpm_TotalMemWords)
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		return(JERR);
-	    }
-
-	    *PPArray = (Pvoid_t) NULL;		// make an empty array.
-	    return (TotalMem * cJU_BYTESPERWORD);
-	}
-
-} // Judy1FreeArray() / JudyLFreeArray()
-
-
-// ****************************************************************************
-// __ J U D Y   F R E E   S M
-//
-// Given a pointer to a JP, recursively visit and free (depth first) all nodes
-// in a Judy array BELOW the JP, but not the JP itself.  Accumulate in *Pjpm
-// the total words freed (as a negative value).  "SM" = State Machine.
-//
-// Note:  Corruption is not detected at this level because during a FreeArray,
-// if the code hasnt already core dumped, its better to remain silent, even
-// if some memory has not been freed, than to bother the caller about the
-// corruption.  TBD:  Is this true?  If not, must list all legitimate JPNULL
-// and JPIMMED above first, and revert to returning bool_t (see 4.34).
-
-FUNCTION void j__udyFreeSM(
-	Pjp_t	Pjp,		// top of Judy (top-state).
-	Pjpm_t	Pjpm)		// to return words freed.
-{
-	Word_t	Pop1;
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-#ifdef JUDY1
-
-// FULL EXPANSE -- nothing to free  for this jp_Type.
-
-	case cJ1_JPFULLPOPU1:
-	    break;
-#endif
-
-// JUDY BRANCH -- free the sub-tree depth first:
-
-// LINEAR BRANCH -- visit each JP in the JBLs list, then free the JBL:
-//
-// Note:  There are no null JPs in a JBL.
-
-	case cJU_JPBRANCH_L:
-	case cJU_JPBRANCH_L2:
-	case cJU_JPBRANCH_L3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4:
-	case cJU_JPBRANCH_L5:
-	case cJU_JPBRANCH_L6:
-	case cJU_JPBRANCH_L7:
-#endif // JU_64BIT
-	{
-	    Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr);
-	    Word_t offset;
-
-	    for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset)
-	        j__udyFreeSM((Pjbl->jbl_jp) + offset, Pjpm);
-
-	    j__udyFreeJBL((Pjbl_t) (Pjp->jp_Addr), Pjpm);
-	    break;
-	}
-
-
-// BITMAP BRANCH -- visit each JP in the JBBs list based on the bitmap, also
-//
-// Note:  There are no null JPs in a JBB.
-
-	case cJU_JPBRANCH_B:
-	case cJU_JPBRANCH_B2:
-	case cJU_JPBRANCH_B3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4:
-	case cJU_JPBRANCH_B5:
-	case cJU_JPBRANCH_B6:
-	case cJU_JPBRANCH_B7:
-#endif // JU_64BIT
-	{
-	    Word_t subexp;
-	    Word_t offset;
-	    Word_t jpcount;
-
-	    Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr);
-
-	    for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-	    {
-	        jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));
-
-	        if (jpcount)
-	        {
-		    for (offset = 0; offset < jpcount; ++offset)
-		    {
-		       j__udyFreeSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) + offset,
-				    Pjpm);
-		    }
-		    j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, subexp), jpcount, Pjpm);
-	        }
-	    }
-	    j__udyFreeJBB((Pjbb_t) (Pjp->jp_Addr), Pjpm);
-
-	    break;
-	}
-
-
-// UNCOMPRESSED BRANCH -- visit each JP in the JBU array, then free the JBU
-// itself:
-//
-// Note:  Null JPs are handled during recursion at a lower state.
-
-	case cJU_JPBRANCH_U:
-	case cJU_JPBRANCH_U2:
-	case cJU_JPBRANCH_U3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4:
-	case cJU_JPBRANCH_U5:
-	case cJU_JPBRANCH_U6:
-	case cJU_JPBRANCH_U7:
-#endif // JU_64BIT
-	{
-	    Word_t offset;
-	    Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr);
-
-	    for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset)
-	        j__udyFreeSM((Pjbu->jbu_jp) + offset, Pjpm);
-
-	    j__udyFreeJBU((Pjbu_t) (Pjp->jp_Addr), Pjpm);
-	    break;
-	}
-
-
-// -- Cases below here terminate and do not recurse. --
-
-
-// LINEAR LEAF -- just free the leaf; size is computed from jp_Type:
-//
-// Note:  cJU_JPLEAF1 is a special case, see discussion in ../Judy1/Judy1.h
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-#endif
-
-	case cJU_JPLEAF2:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-	case cJU_JPLEAF3:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-#ifdef JU_64BIT
-	case cJU_JPLEAF4:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-	case cJU_JPLEAF5:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-	case cJU_JPLEAF6:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-	case cJU_JPLEAF7:
-	    Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-	    j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-#endif // JU_64BIT
-
-
-// BITMAP LEAF -- free sub-expanse arrays of JPs, then free the JBB.
-
-	case cJU_JPLEAF_B1:
-	{
-#ifdef JUDYL
-	    Word_t subexp;
-	    Word_t jpcount;
-	    Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr);
-
-// Free the value areas in the bitmap leaf:
-
-	    for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp)
-	    {
-	        jpcount = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp));
-
-	        if (jpcount)
-		    j__udyLFreeJV(JL_JLB_PVALUE(Pjlb, subexp), jpcount, Pjpm);
-	    }
-#endif // JUDYL
-
-	    j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm);
-	    break;
-
-	} // case cJU_JPLEAF_B1
-
-#ifdef JUDYL
-
-
-// IMMED*:
-//
-// For JUDYL, all non JPIMMED_*_01s have a LeafV which must be freed:
-
-	case cJU_JPIMMED_1_02:
-	case cJU_JPIMMED_1_03:
-#ifdef JU_64BIT
-	case cJU_JPIMMED_1_04:
-	case cJU_JPIMMED_1_05:
-	case cJU_JPIMMED_1_06:
-	case cJU_JPIMMED_1_07:
-#endif
-	    Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2;
-	    j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-#ifdef JU_64BIT
-	case cJU_JPIMMED_2_02:
-	case cJU_JPIMMED_2_03:
-
-	    Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2;
-	    j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm);
-	    break;
-
-	case cJU_JPIMMED_3_02:
-	    j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), 2, Pjpm);
-	    break;
-
-#endif // JU_64BIT
-#endif // JUDYL
-
-
-// OTHER JPNULL, JPIMMED, OR UNEXPECTED TYPE -- nothing to free for this type:
-//
-// Note:  Lump together no-op and invalid JP types; see function header
-// comments.
-
-	default: break;
-
-	} // switch (JU_JPTYPE(Pjp))
-
-} // j__udyFreeSM()
diff --git a/libs/klib/judy/JudyGet.c b/libs/klib/judy/JudyGet.c
deleted file mode 100644
index 5071a3f..0000000
--- a/libs/klib/judy/JudyGet.c
+++ /dev/null
@@ -1,1092 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy1Test() and JudyLGet() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-#ifdef TRACEJPR                 // different macro name, for "retrieval" only.
-#include "JudyPrintJP.c"
-#endif
-
-
-// ****************************************************************************
-// J U D Y   1   T E S T
-// J U D Y   L   G E T
-//
-// See the manual entry for details.  Note support for "shortcut" entries to
-// trees known to start with a JPM.
-
-#ifdef JUDY1
-
-#ifdef JUDYGETINLINE
-FUNCTION int j__udy1Test
-#else
-FUNCTION int Judy1Test
-#endif
-
-#else  // JUDYL
-
-#ifdef JUDYGETINLINE
-FUNCTION PPvoid_t j__udyLGet
-#else
-FUNCTION PPvoid_t JudyLGet
-#endif
-
-#endif // JUDYL
-        (
-#ifdef JUDYGETINLINE
-        Pvoid_t   PArray,       // from which to retrieve.
-        Word_t    Index         // to retrieve.
-#else
-        Pcvoid_t  PArray,       // from which to retrieve.
-        Word_t    Index,        // to retrieve.
-        PJError_t PJError       // optional, for returning error info.
-#endif
-        )
-{
-        Pjp_t     Pjp;          // current JP while walking the tree.
-        Pjpm_t    Pjpm;         // for global accounting.
-        uint8_t   Digit;        // byte just decoded from Index.
-        Word_t    Pop1;         // leaf population (number of indexes).
-        Pjll_t    Pjll;         // pointer to LeafL.
-        DBGCODE(uint8_t ParentJPType;)
-
-#ifndef JUDYGETINLINE
-
-        if (PArray == (Pcvoid_t) NULL)  // empty array.
-        {
-  JUDY1CODE(return(0);)
-  JUDYLCODE(return((PPvoid_t) NULL);)
-        }
-
-// ****************************************************************************
-// PROCESS TOP LEVEL BRANCHES AND LEAF:
-
-        if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-        {
-            Pjlw_t Pjlw = P_JLW(PArray);        // first word of leaf.
-            int    posidx;                      // signed offset in leaf.
-
-            Pop1   = Pjlw[0] + 1;
-            posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index);
-
-            if (posidx >= 0)
-            {
-      JUDY1CODE(return(1);)
-      JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));)
-            }
-  JUDY1CODE(return(0);)
-  JUDYLCODE(return((PPvoid_t) NULL);)
-        }
-
-#endif // ! JUDYGETINLINE
-
-        Pjpm = P_JPM(PArray);
-        Pjp = &(Pjpm->jpm_JP);  // top branch is below JPM.
-
-// ****************************************************************************
-// WALK THE JUDY TREE USING A STATE MACHINE:
-
-ContinueWalk:           // for going down one level; come here with Pjp set.
-
-#ifdef TRACEJPR
-        JudyPrintJP(Pjp, "g", __LINE__);
-#endif
-        switch (JU_JPTYPE(Pjp))
-        {
-
-// Ensure the switch table starts at 0 for speed; otherwise more code is
-// executed:
-
-        case 0: goto ReturnCorrupt;     // save a little code.
-
-
-// ****************************************************************************
-// JPNULL*:
-//
-// Note:  These are legitimate in a BranchU (only) and do not constitute a
-// fault.
-
-        case cJU_JPNULL1:
-        case cJU_JPNULL2:
-        case cJU_JPNULL3:
-#ifdef JU_64BIT
-        case cJU_JPNULL4:
-        case cJU_JPNULL5:
-        case cJU_JPNULL6:
-        case cJU_JPNULL7:
-#endif
-            assert(ParentJPType >= cJU_JPBRANCH_U2);
-            assert(ParentJPType <= cJU_JPBRANCH_U);
-      JUDY1CODE(return(0);)
-      JUDYLCODE(return((PPvoid_t) NULL);)
-
-
-// ****************************************************************************
-// JPBRANCH_L*:
-//
-// Note:  The use of JU_DCDNOTMATCHINDEX() in branches is not strictly
-// required,since this can be done at leaf level, but it costs nothing to do it
-// sooner, and it aborts an unnecessary traversal sooner.
-
-        case cJU_JPBRANCH_L2:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break;
-            Digit = JU_DIGITATSTATE(Index, 2);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L3:
-
-#ifdef JU_64BIT // otherwise its a no-op:
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break;
-#endif
-            Digit = JU_DIGITATSTATE(Index, 3);
-            goto JudyBranchL;
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_L4:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break;
-            Digit = JU_DIGITATSTATE(Index, 4);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L5:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break;
-            Digit = JU_DIGITATSTATE(Index, 5);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L6:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break;
-            Digit = JU_DIGITATSTATE(Index, 6);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L7:
-
-            // JU_DCDNOTMATCHINDEX() would be a no-op.
-            Digit = JU_DIGITATSTATE(Index, 7);
-            goto JudyBranchL;
-
-#endif // JU_64BIT
-
-        case cJU_JPBRANCH_L:
-        {
-            Pjbl_t Pjbl;
-            int    posidx;
-
-            Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-
-// Common code for all BranchLs; come here with Digit set:
-
-JudyBranchL:
-            Pjbl = P_JBL(Pjp->jp_Addr);
-
-            posidx = 0;
-
-            do {
-                if (Pjbl->jbl_Expanse[posidx] == Digit)
-                {                       // found Digit; continue traversal:
-                    DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-                    Pjp = Pjbl->jbl_jp + posidx;
-                    goto ContinueWalk;
-                }
-            } while (++posidx != Pjbl->jbl_NumJPs);
-
-            break;
-        }
-
-
-// ****************************************************************************
-// JPBRANCH_B*:
-
-        case cJU_JPBRANCH_B2:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break;
-            Digit = JU_DIGITATSTATE(Index, 2);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B3:
-
-#ifdef JU_64BIT // otherwise its a no-op:
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break;
-#endif
-            Digit = JU_DIGITATSTATE(Index, 3);
-            goto JudyBranchB;
-
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_B4:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break;
-            Digit = JU_DIGITATSTATE(Index, 4);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B5:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break;
-            Digit = JU_DIGITATSTATE(Index, 5);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B6:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break;
-            Digit = JU_DIGITATSTATE(Index, 6);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B7:
-
-            // JU_DCDNOTMATCHINDEX() would be a no-op.
-            Digit = JU_DIGITATSTATE(Index, 7);
-            goto JudyBranchB;
-
-#endif // JU_64BIT
-
-        case cJU_JPBRANCH_B:
-        {
-            Pjbb_t    Pjbb;
-            Word_t    subexp;   // in bitmap, 0..7.
-            BITMAPB_t BitMap;   // for one subexpanse.
-            BITMAPB_t BitMask;  // bit in BitMap for Indexs Digit.
-
-            Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-
-// Common code for all BranchBs; come here with Digit set:
-
-JudyBranchB:
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjbb   = P_JBB(Pjp->jp_Addr);
-            subexp = Digit / cJU_BITSPERSUBEXPB;
-
-            BitMap = JU_JBB_BITMAP(Pjbb, subexp);
-            Pjp    = P_JP(JU_JBB_PJP(Pjbb, subexp));
-
-            BitMask = JU_BITPOSMASKB(Digit);
-
-// No JP in subexpanse for Index => Index not found:
-
-            if (! (BitMap & BitMask)) break;
-
-// Count JPs in the subexpanse below the one for Index:
-
-            Pjp += j__udyCountBitsB(BitMap & (BitMask - 1));
-
-            goto ContinueWalk;
-
-        } // case cJU_JPBRANCH_B*
-
-
-// ****************************************************************************
-// JPBRANCH_U*:
-//
-// Notice the reverse order of the cases, and falling through to the next case,
-// for performance.
-
-        case cJU_JPBRANCH_U:
-
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE);
-
-// If not a BranchU, traverse; otherwise fall into the next case, which makes
-// this very fast code for a large Judy array (mainly BranchUs), especially
-// when branches are already in the cache, such as for prev/next:
-
-#ifndef JU_64BIT
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk;
-#else
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk;
-#endif
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_U7:
-
-            // JU_DCDNOTMATCHINDEX() would be a no-op.
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 7);
-
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk;
-            // and fall through.
-
-        case cJU_JPBRANCH_U6:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break;
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 6);
-
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk;
-            // and fall through.
-
-        case cJU_JPBRANCH_U5:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break;
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 5);
-
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk;
-            // and fall through.
-
-        case cJU_JPBRANCH_U4:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break;
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 4);
-
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk;
-            // and fall through.
-
-#endif // JU_64BIT
-
-        case cJU_JPBRANCH_U3:
-
-#ifdef JU_64BIT // otherwise its a no-op:
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break;
-#endif
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 3);
-
-            if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk;
-            // and fall through.
-
-        case cJU_JPBRANCH_U2:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break;
-            DBGCODE(ParentJPType = JU_JPTYPE(Pjp);)
-            Pjp = JU_JBU_PJP(Pjp, Index, 2);
-
-// Note:  BranchU2 is a special case that must continue traversal to a leaf,
-// immed, full, or null type:
-
-            goto ContinueWalk;
-
-
-// ****************************************************************************
-// JPLEAF*:
-//
-// Note:  Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check
-// whether Index is out of the expanse of a narrow pointer.
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-        case cJU_JPLEAF1:
-        {
-            int posidx;         // signed offset in leaf.
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break;
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-
-#endif // (JUDYL || (! JU_64BIT))
-
-        case cJU_JPLEAF2:
-        {
-            int posidx;         // signed offset in leaf.
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break;
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-        case cJU_JPLEAF3:
-        {
-            int posidx;         // signed offset in leaf.
-
-#ifdef JU_64BIT // otherwise its a no-op:
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break;
-#endif
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-#ifdef JU_64BIT
-        case cJU_JPLEAF4:
-        {
-            int posidx;         // signed offset in leaf.
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break;
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-        case cJU_JPLEAF5:
-        {
-            int posidx;         // signed offset in leaf.
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break;
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-
-        case cJU_JPLEAF6:
-        {
-            int posidx;         // signed offset in leaf.
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break;
-
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-        case cJU_JPLEAF7:
-        {
-            int posidx;         // signed offset in leaf.
-
-            // JU_DCDNOTMATCHINDEX() would be a no-op.
-            Pop1 = JU_JPLEAF_POP0(Pjp) + 1;
-            Pjll = P_JLL(Pjp->jp_Addr);
-
-            if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));)
-        }
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// JPLEAF_B1:
-
-        case cJU_JPLEAF_B1:
-        {
-            Pjlb_t    Pjlb;
-#ifdef JUDYL
-            int       posidx;
-            Word_t    subexp;   // in bitmap, 0..7.
-            BITMAPL_t BitMap;   // for one subexpanse.
-            BITMAPL_t BitMask;  // bit in BitMap for Indexs Digit.
-            Pjv_t     Pjv;
-#endif
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break;
-
-            Pjlb = P_JLB(Pjp->jp_Addr);
-
-#ifdef JUDY1
-
-// Simply check if Indexs bit is set in the bitmap:
-
-            if (JU_BITMAPTESTL(Pjlb, Index)) return(1);
-            break;
-
-#else // JUDYL
-
-// JudyL is much more complicated because of value area subarrays:
-
-            Digit   = JU_DIGITATSTATE(Index, 1);
-            subexp  = Digit / cJU_BITSPERSUBEXPL;
-            BitMap  = JU_JLB_BITMAP(Pjlb, subexp);
-            BitMask = JU_BITPOSMASKL(Digit);
-
-// No value in subexpanse for Index => Index not found:
-
-            if (! (BitMap & BitMask)) break;
-
-// Count value areas in the subexpanse below the one for Index:
-
-            Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp));
-            assert(Pjv != (Pjv_t) NULL);
-            posidx = j__udyCountBitsL(BitMap & (BitMask - 1));
-
-            return((PPvoid_t) (Pjv + posidx));
-
-#endif // JUDYL
-
-        } // case cJU_JPLEAF_B1
-
-#ifdef JUDY1
-
-// ****************************************************************************
-// JPFULLPOPU1:
-//
-// If the Index is in the expanse, it is necessarily valid (found).
-
-        case cJ1_JPFULLPOPU1:
-
-            if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break;
-            return(1);
-
-#ifdef notdef // for future enhancements
-#ifdef JU_64BIT
-
-// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break;
-
-        case cJ1_JPFULLPOPU1m15:
-            if (Pjp->jp_1Index[14] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m14:
-            if (Pjp->jp_1Index[13] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m13:
-            if (Pjp->jp_1Index[12] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m12:
-            if (Pjp->jp_1Index[11] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m11:
-            if (Pjp->jp_1Index[10] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m10:
-            if (Pjp->jp_1Index[9] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m9:
-            if (Pjp->jp_1Index[8] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m8:
-            if (Pjp->jp_1Index[7] == (uint8_t)Index) break;
-#endif
-        case cJ1_JPFULLPOPU1m7:
-            if (Pjp->jp_1Index[6] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m6:
-            if (Pjp->jp_1Index[5] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m5:
-            if (Pjp->jp_1Index[4] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m4:
-            if (Pjp->jp_1Index[3] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m3:
-            if (Pjp->jp_1Index[2] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m2:
-            if (Pjp->jp_1Index[1] == (uint8_t)Index) break;
-        case cJ1_JPFULLPOPU1m1:
-            if (Pjp->jp_1Index[0] == (uint8_t)Index) break;
-
-            return(1);  // found, not in exclusion list
-
-#endif // JUDY1
-#endif //  notdef
-
-// ****************************************************************************
-// JPIMMED*:
-//
-// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01:
-
-        case cJU_JPIMMED_1_01:
-        case cJU_JPIMMED_2_01:
-        case cJU_JPIMMED_3_01:
-#ifdef JU_64BIT
-        case cJU_JPIMMED_4_01:
-        case cJU_JPIMMED_5_01:
-        case cJU_JPIMMED_6_01:
-        case cJU_JPIMMED_7_01:
-#endif
-            if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break;
-
-  JUDY1CODE(return(1);)
-  JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));)  // immediate value area.
-
-
-//   Macros to make code more readable and avoid dup errors
-
-#ifdef JUDY1
-
-#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX)                       \
-if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX))       \
-    return(1)
-
-#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY)                   \
-{                                                                       \
-    Word_t   i_ndex;                                                    \
-    uint8_t *a_ddr;                                                     \
-    a_ddr  = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS));                \
-    COPY(i_ndex, a_ddr);                                                \
-    if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS)))                      \
-        return(1);                                                      \
-}
-#endif
-
-#ifdef JUDYL
-
-#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX)                       \
-if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX))       \
-        return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1))
-
-#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY)                   \
-{                                                                       \
-    Word_t   i_ndex;                                                    \
-    uint8_t *a_ddr;                                                     \
-    a_ddr  = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS));                \
-    COPY(i_ndex, a_ddr);                                                \
-    if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS)))                      \
-        return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1));           \
-}
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index);
-        case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index);
-        case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index);
-        case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index);
-        case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index);
-        case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index);
-        case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp,  9, Index);
-        case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp,  8, Index);
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp,  7, Index);
-        case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp,  6, Index);
-        case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp,  5, Index);
-        case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp,  4, Index);
-#endif
-        case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp,  3, Index);
-        case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp,  2, Index);
-                               CHECKINDEXNATIVE(uint8_t, Pjp,  1, Index);
-        break;
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index);
-        case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index);
-        case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index);
-        case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index);
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index);
-        case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index);
-                               CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index);
-        break;
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_3_05: 
-            CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG);
-        case cJ1_JPIMMED_3_04:
-            CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG);
-        case cJ1_JPIMMED_3_03:
-            CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG);
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_3_02:
-            CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG);
-            CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG);
-            break;
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-
-        case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index);
-        case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index);
-                               CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index);
-            break;
-
-        case cJ1_JPIMMED_5_03:
-            CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG);
-        case cJ1_JPIMMED_5_02:
-            CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG);
-            CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG);
-            break;
-
-        case cJ1_JPIMMED_6_02:
-            CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG);
-            CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG);
-            break;
-
-        case cJ1_JPIMMED_7_02:
-            CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG);
-            CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG);
-            break;
-
-#endif // (JUDY1 && JU_64BIT)
-
-
-// ****************************************************************************
-// INVALID JP TYPE:
-
-        default:
-
-ReturnCorrupt:
-
-#ifdef JUDYGETINLINE    // Pjpm is known to be non-null:
-            JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-#else
-            JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-#endif
-            JUDY1CODE(return(JERRI );)
-            JUDYLCODE(return(PPJERR);)
-
-        } // switch on JP type
-
-JUDY1CODE(return(0);)
-JUDYLCODE(return((PPvoid_t) NULL);)
-
-} // Judy1Test() / JudyLGet()
-
-
-#ifndef JUDYGETINLINE   // only compile the following function once:
-#ifdef DEBUG
-
-// ****************************************************************************
-// J U D Y   C H E C K   P O P
-//
-// Given a pointer to a Judy array, traverse the entire array to ensure
-// population counts add up correctly.  This can catch various coding errors.
-//
-// Since walking the entire tree is probably time-consuming, enable this
-// function by setting env parameter $CHECKPOP to first call at which to start
-// checking.  Note:  This function is called both from insert and delete code.
-//
-// Note:  Even though this function does nothing useful for LEAFW leaves, its
-// good practice to call it anyway, and cheap too.
-//
-// TBD:  This is a debug-only check function similar to JudyCheckSorted(), but
-// since it walks the tree it is Judy1/JudyL-specific and must live in a source
-// file that is built both ways.
-//
-// TBD:  As feared, enabling this code for every insert/delete makes Judy
-// deathly slow, even for a small tree (10K indexes).  Its not so bad if
-// present but disabled (<1% slowdown measured).  Still, should it be ifdefd
-// other than DEBUG and/or called less often?
-//
-// TBD:  Should this "population checker" be expanded to a comprehensive tree
-// checker?  It currently detects invalid LEAFW/JP types as well as inconsistent
-// pop1s.  Other possible checks, all based on essentially redundant data in
-// the Judy tree, include:
-//
-// - Zero LS bits in jp_Addr field.
-//
-// - Correct Dcd bits.
-//
-// - Consistent JP types (always descending down the tree).
-//
-// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but
-//   ideally that function is already called wherever appropriate after any
-//   linear list is modified).
-//
-// - Any others possible?
-
-#include <stdlib.h>             // for getenv() and atol().
-
-static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1);
-
-FUNCTION void JudyCheckPop(
-        Pvoid_t PArray)
-{
-static  bool_t  checked = FALSE;        // already checked env parameter.
-static  bool_t  enabled = FALSE;        // env parameter set.
-static  bool_t  active  = FALSE;        // calls >= callsmin.
-static  Word_t  callsmin;               // start point from $CHECKPOP.
-static  Word_t  calls = 0;              // times called so far.
-
-
-// CHECK FOR EXTERNAL ENABLING:
-
-        if (! checked)                  // only check once.
-        {
-            char * value;               // for getenv().
-
-            checked = TRUE;
-
-            if ((value = getenv("CHECKPOP")) == (char *) NULL)
-            {
-#ifdef notdef
-// Take this out because nightly tests want to be flavor-independent; its not
-// OK to emit special non-error output from the debug flavor:
-
-                (void) puts("JudyCheckPop() present but not enabled by "
-                            "$CHECKPOP env parameter; set it to the number of "
-                            "calls at which to begin checking");
-#endif
-                return;
-            }
-
-            callsmin = atol(value);     // note: non-number evaluates to 0.
-            enabled  = TRUE;
-
-            (void) printf("JudyCheckPop() present and enabled; callsmin = "
-                          "%lu\n", callsmin);
-        }
-        else if (! enabled) return;
-
-// Previously or just now enabled; check if non-active or newly active:
-
-        if (! active)
-        {
-            if (++calls < callsmin) return;
-
-            (void) printf("JudyCheckPop() activated at call %lu\n", calls);
-            active = TRUE;
-        }
-
-// IGNORE LEAFW AT TOP OF TREE:
-
-        if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-                return;
-
-// Check JPM pop0 against tree, recursively:
-//
-// Note:  The traversal code in JudyCheckPopSM() is simplest when the case
-// statement for each JP type compares the pop1 for that JP to its subtree (if
-// any) after traversing the subtree (thats the hard part) and adding up
-// actual pop1s.  A top branchs JP in the JPM does not have room for a
-// full-word pop1, so pass it in as a special case.
-
-        {
-            Pjpm_t Pjpm = P_JPM(PArray);
-            (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1);
-            return;
-        }
-
-} // JudyCheckPop()
-
-
-// ****************************************************************************
-// J U D Y   C H E C K   P O P   S M
-//
-// Recursive state machine (subroutine) for JudyCheckPop():  Given a Pjp (other
-// than JPNULL*; caller should shortcut) and the root population for top-level
-// branches, check the subtrees actual pop1 against its nominal value, and
-// return the total pop1 for the subtree.
-//
-// Note:  Expect RootPop1 to be ignored at lower levels, so pass down 0, which
-// should pop an assertion if this expectation is violated.
-
-FUNCTION static Word_t JudyCheckPopSM(
-        Pjp_t  Pjp,             // top of subtree.
-        Word_t RootPop1)        // whole array, for top-level branches only.
-{
-        Word_t pop1_jp;         // nominal population from the JP.
-        Word_t pop1 = 0;        // actual population at this level.
-        Word_t offset;          // in a branch.
-
-#define PREPBRANCH(cPopBytes,Next) \
-        pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next
-
-assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3);
-        switch (JU_JPTYPE(Pjp))
-        {
-
-        case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL);
-        case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL);
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL);
-        case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL);
-        case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL);
-        case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL);
-#endif
-        case cJU_JPBRANCH_L:  pop1_jp = RootPop1;
-        {
-            Pjbl_t Pjbl;
-BranchL:
-            Pjbl = P_JBL(Pjp->jp_Addr);
-
-            for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset)
-                pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0);
-
-            assert(pop1_jp == pop1);
-            return(pop1);
-        }
-
-        case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB);
-        case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB);
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB);
-        case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB);
-        case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB);
-        case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB);
-#endif
-        case cJU_JPBRANCH_B:  pop1_jp = RootPop1;
-        {
-            Word_t subexp;
-            Word_t jpcount;
-            Pjbb_t Pjbb;
-BranchB:
-            Pjbb = P_JBB(Pjp->jp_Addr);
-
-            for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-            {
-                jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));
-
-                for (offset = 0; offset < jpcount; ++offset)
-                {
-                    pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp))
-                                         + offset, 0);
-                }
-            }
-
-            assert(pop1_jp == pop1);
-            return(pop1);
-        }
-
-        case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU);
-        case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU);
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU);
-        case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU);
-        case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU);
-        case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU);
-#endif
-        case cJU_JPBRANCH_U:  pop1_jp = RootPop1;
-        {
-            Pjbu_t Pjbu;
-BranchU:
-            Pjbu = P_JBU(Pjp->jp_Addr);
-
-            for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset)
-            {
-                if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1)
-                 && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX))
-                {
-                    continue;           // skip null JP to save time.
-                }
-
-                pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0);
-            }
-
-            assert(pop1_jp == pop1);
-            return(pop1);
-        }
-
-
-// -- Cases below here terminate and do not recurse. --
-//
-// For all of these cases except JPLEAF_B1, there is no way to check the JPs
-// pop1 against the object itself; just return the pop1; but for linear leaves,
-// a bounds check is possible.
-
-#define CHECKLEAF(MaxPop1)                              \
-        pop1 = JU_JPLEAF_POP0(Pjp) + 1;                 \
-        assert(pop1 >= 1);                              \
-        assert(pop1 <= (MaxPop1));                      \
-        return(pop1)
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-        case cJU_JPLEAF1:  CHECKLEAF(cJU_LEAF1_MAXPOP1);
-#endif
-        case cJU_JPLEAF2:  CHECKLEAF(cJU_LEAF2_MAXPOP1);
-        case cJU_JPLEAF3:  CHECKLEAF(cJU_LEAF3_MAXPOP1);
-#ifdef JU_64BIT
-        case cJU_JPLEAF4:  CHECKLEAF(cJU_LEAF4_MAXPOP1);
-        case cJU_JPLEAF5:  CHECKLEAF(cJU_LEAF5_MAXPOP1);
-        case cJU_JPLEAF6:  CHECKLEAF(cJU_LEAF6_MAXPOP1);
-        case cJU_JPLEAF7:  CHECKLEAF(cJU_LEAF7_MAXPOP1);
-#endif
-
-        case cJU_JPLEAF_B1:
-        {
-            Word_t subexp;
-            Pjlb_t Pjlb;
-
-            pop1_jp = JU_JPLEAF_POP0(Pjp) + 1;
-
-            Pjlb = P_JLB(Pjp->jp_Addr);
-
-            for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp)
-                pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp));
-
-            assert(pop1_jp == pop1);
-            return(pop1);
-        }
-
-        JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);)
-
-        case cJU_JPIMMED_1_01:  return(1);
-        case cJU_JPIMMED_2_01:  return(1);
-        case cJU_JPIMMED_3_01:  return(1);
-#ifdef JU_64BIT
-        case cJU_JPIMMED_4_01:  return(1);
-        case cJU_JPIMMED_5_01:  return(1);
-        case cJU_JPIMMED_6_01:  return(1);
-        case cJU_JPIMMED_7_01:  return(1);
-#endif
-
-        case cJU_JPIMMED_1_02:  return(2);
-        case cJU_JPIMMED_1_03:  return(3);
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_1_04:  return(4);
-        case cJU_JPIMMED_1_05:  return(5);
-        case cJU_JPIMMED_1_06:  return(6);
-        case cJU_JPIMMED_1_07:  return(7);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_1_08:  return(8);
-        case cJ1_JPIMMED_1_09:  return(9);
-        case cJ1_JPIMMED_1_10:  return(10);
-        case cJ1_JPIMMED_1_11:  return(11);
-        case cJ1_JPIMMED_1_12:  return(12);
-        case cJ1_JPIMMED_1_13:  return(13);
-        case cJ1_JPIMMED_1_14:  return(14);
-        case cJ1_JPIMMED_1_15:  return(15);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_2_02:  return(2);
-        case cJU_JPIMMED_2_03:  return(3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_2_04:  return(4);
-        case cJ1_JPIMMED_2_05:  return(5);
-        case cJ1_JPIMMED_2_06:  return(6);
-        case cJ1_JPIMMED_2_07:  return(7);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_3_02:  return(2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_3_03:  return(3);
-        case cJ1_JPIMMED_3_04:  return(4);
-        case cJ1_JPIMMED_3_05:  return(5);
-
-        case cJ1_JPIMMED_4_02:  return(2);
-        case cJ1_JPIMMED_4_03:  return(3);
-        case cJ1_JPIMMED_5_02:  return(2);
-        case cJ1_JPIMMED_5_03:  return(3);
-        case cJ1_JPIMMED_6_02:  return(2);
-        case cJ1_JPIMMED_7_02:  return(2);
-#endif
-
-        } // switch (JU_JPTYPE(Pjp))
-
-        assert(FALSE);          // unrecognized JP type => corruption.
-        return(0);              // to make some compilers happy.
-
-} // JudyCheckPopSM()
-
-#endif // DEBUG
-#endif // ! JUDYGETINLINE
diff --git a/libs/klib/judy/JudyHS.c b/libs/klib/judy/JudyHS.c
deleted file mode 100644
index aa9fbfa..0000000
--- a/libs/klib/judy/JudyHS.c
+++ /dev/null
@@ -1,770 +0,0 @@
-//=======================================================================
-//   Author Douglas L. Baskins, Dec 2003.
-//   Permission to use this code is freely granted, provided that this
-//   statement is retained.
-//   email - doug at sourcejudy.com -or- dougbaskins at yahoo.com
-//=======================================================================
-
-#include <string.h>                     // for memcmp(), memcpy()
-
-#include <Judy.h>                       // for JudyL* routines/macros
-
-/*
-   This routine is a very fast "string" version of an ADT that stores
-   (JudyHSIns()), retrieves (JudyHSGet()), deletes (JudyHSDel()) and
-   frees the entire ADT (JudyHSFreeArray()) strings.  It uses the "Judy
-   arrays" JudyL() API as the main workhorse.  The length of the string
-   is included in the calling parameters so that strings with embedded
-   \0s can be used.  The string lengths can be from 0 bytes to whatever
-   malloc() can handle (~2GB).
-
-   Compile:
-  
-      cc -O JudyHS.c -c         needs to link with -lJudy (libJudy.a)
-  
-      Note: in gcc version 3.3.1, -O2 generates faster code than -O
-      Note: in gcc version 3.3.2, -O3 generates faster code than -O2
-
-   NOTES:
-
-1) There may be some performance issues with 64 bit machines, because I
-   have not characterized that it yet.
-
-2) It appears that a modern CPU (>2Ghz) that the instruction times are
-   much faster that a RAM access, so building up a word from bytes takes
-   no longer that a whole word access.  I am taking advantage of this to
-   make this code endian neutral.  A side effect of this is strings do
-   not need to be aligned, nor tested to be on to a word boundry.  In
-   older and in slow (RISC) machines, this may be a performance issue.
-   I have given up trying to optimize for machines that have very slow
-   mpy, mod, variable shifts and call returns.
-
-3) JudyHS is very scalable from 1 string to billions (with enough RAM).
-   The memory usage is also scales with population.  I have attempted to
-   combine the best characteristics of JudyL arrays with Hashing methods
-   and well designed modern processors (such as the 1.3Ghz Intel
-   Centrino this is being written on).
-
-   HOW JudyHS WORKS: ( 4[8] means 4 bytes in 32 bit machine and 8 in 64)
-
-   A) A JudyL array is used to separate strings of equal lengths into
-   their own structures (a different hash table is used for each length
-   of string).  The additional time overhead is very near zero because
-   of the CPU cache.  The space efficiency is improved because the
-   length need not be stored with the string (ls_t).  The "JLHash" ADT
-   in the test program "StringCompare" is verification of both these
-   assumptions.
-
-   B) A 32 bit hash value is produced from the string.  Many thanks to
-   the Internet and the author (Bob Jenkins) for coming up with a very
-   good and fast universal string hash.  Next the 32 bit hash number is
-   used as an Index to another JudyL array.  Notice that one (1) JudyL
-   array is used as a hash table per each string length.  If there are
-   no hash collisions (normally) then the string is copied to a
-   structure (ls_t) along with room for storing a Value.  A flag is
-   added to the pointer to note it is pointing to a ls_t structure.
-   Since the lengths of the strings are the same, there is no need to
-   stored length of string in the ls_t structure.  This saves about a
-   word per string of memory.
-
-   C) When there is a hashing collision (very rare), a JudyL array is
-   used to decode the next 4[8] bytes of the string.  That is, the next
-   4[8] bytes of the string are used as the Index.  This process is
-   repeated until the remaining string is unique.  The remaining string
-   (if any) is stored in a (now smaller) ls_t structure.  If the
-   remaining string is less or equal to 4[8] bytes, then the ls_t
-   structure is not needed and the Value area in the JudyL array is
-   used.  A compile option -DDONOTUSEHASH is available to test this
-   structure without using hashing (only the JudyL tree is used).  This
-   is equivalent to having all strings hashed to the same bucket.  The
-   speed is still better than all other tree based ADTs I have tested.
-   An added benefit of this is a very fast "hash collision" resolving.
-   It could foil hackers that exploit the slow synonym (linked-list)
-   collision handling property used with most hashing algorithms.  If
-   this is not a necessary property, then a simpler ADT "JLHash" that is
-   documented the the test program "StringCompare.c" may be used with a
-   little loss of memory efficiency (because it includes the string
-   length with the ls_t structure).  JudyHS was written to be the
-   fastest, very scalable, memory efficient, general purpose string ADT
-   possible.  (However, I would like to eat those words someday). (dlb)
-
-*/
-
-#ifdef EXAMPLE_CODE
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <Judy.h>
-
-//#include "JudyHS.h"                   // for Judy.h without JudyHS*()
-
-// By Doug Baskins Apr 2004 - for JudyHS man page
-
-#define MAXLINE 1000000                 /* max length of line */
-char      Index[MAXLINE];               // string to check
-
-int     // Usage:  CheckDupLines < file
-main()
-{
-    Pvoid_t   PJArray = (PWord_t)NULL;  // Judy array.
-    PWord_t   PValue;                   // ^ Judy array element.
-    Word_t    Bytes;                    // size of JudyHS array.
-    Word_t    LineNumb = 0;             // current line number
-    Word_t    Dups = 0;                 // number of duplicate lines
-
-    while (fgets(Index, MAXLINE, stdin) != (char *)NULL)
-    {
-        LineNumb++;                     // line number
-
-//      store string into array
-        JHSI(PValue, PJArray, Index, strlen(Index)); 
-        if (*PValue)                    // check if duplicate
-        {
-            Dups++;                     // count duplicates
-            printf("Duplicate lines %lu:%lu:%s", *PValue, LineNumb, Index);
-        }
-        else
-        {
-            *PValue = LineNumb;         // store Line number
-        }
-    }
-    printf("%lu Duplicates, free JudyHS array of %lu Lines\n", 
-                    Dups, LineNumb - Dups);
-    JHSFA(Bytes, PJArray);              // free array
-    printf("The JudyHS array allocated %lu bytes of memory\n", Bytes);
-    return (0);
-}
-#endif // EXAMPLE_CODE
-
-// Note:  Use JLAP_INVALID, which is non-zero, to mark pointers to a ls_t
-// This makes it compatable with previous versions of JudyL()
-
-#define IS_PLS(PLS)     (((Word_t) (PLS)) & JLAP_INVALID)
-#define CLEAR_PLS(PLS)  (((Word_t) (PLS)) & (~JLAP_INVALID))
-#define SET_PLS(PLS)    (((Word_t) (PLS)) | JLAP_INVALID)
-
-#define WORDSIZE     (sizeof(Word_t))
-
-// this is the struct used for "leaf" strings.  Note that
-// the Value is followed by a "variable" length ls_String array.
-//
-typedef struct L_EAFSTRING
-{
-    Word_t    ls_Value;                 // Value area (cannot change size)
-    uint8_t   ls_String[WORDSIZE];      // to fill out to a Word_t size
-} ls_t     , *Pls_t;
-
-#define LS_STRUCTOVD     (sizeof(ls_t) - WORDSIZE)
-
-// Calculate size of ls_t including the string of length of LEN.
-//
-#define LS_WORDLEN(LEN)  (((LEN) + LS_STRUCTOVD + WORDSIZE - 1) / WORDSIZE)
-
-// Copy from 0..4[8] bytes from string to a Word_t
-// NOTE: the copy in in little-endian order to take advantage of improved 
-// memory efficiency of JudyLIns() with smaller numbers
-//
-#define        COPYSTRING4toWORD(WORD,STR,LEN)          \
-{                                                       \
-    WORD = 0;                                           \
-    switch(LEN)                                         \
-    {                                                   \
-    default:    /* four and greater */                  \
-    case 4:                                             \
-        WORD += (Word_t)(((uint8_t *)(STR))[3] << 24);  \
-    case 3:                                             \
-        WORD += (Word_t)(((uint8_t *)(STR))[2] << 16);  \
-    case 2:                                             \
-        WORD += (Word_t)(((uint8_t *)(STR))[1] <<  8);  \
-    case 1:                                             \
-        WORD += (Word_t)(((uint8_t *)(STR))[0]);        \
-    case 0: break;                                      \
-    }                                                   \
-}
-
-#ifdef JU_64BIT
-
-// copy from 0..8 bytes from string to Word_t
-//
-#define        COPYSTRING8toWORD(WORD,STR,LEN)          \
-{                                                       \
-    WORD = 0UL;                                         \
-    switch(LEN)                                         \
-    {                                                   \
-    default:    /* eight and greater */                 \
-    case 8:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[7] << 56);  \
-    case 7:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[6] << 48);  \
-    case 6:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[5] << 40);  \
-    case 5:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[4] << 32);  \
-    case 4:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[3] << 24);  \
-    case 3:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[2] << 16);  \
-    case 2:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[1] <<  8);  \
-    case 1:                                             \
-        WORD += ((Word_t)((uint8_t *)(STR))[0]);        \
-    case 0: break;                                      \
-    }                                                   \
-}
-
-#define COPYSTRINGtoWORD COPYSTRING8toWORD
-
-#else  // JU_32BIT
-
-#define COPYSTRINGtoWORD COPYSTRING4toWORD
-
-#endif // JU_32BIT
-
-// set JError_t locally
-
-#define JU_SET_ERRNO(PJERROR, JERRNO)           \
-{                                               \
-    if (PJERROR != (PJError_t) NULL)            \
-    {                                           \
-        if (JERRNO)                             \
-            JU_ERRNO(PJError) = (JERRNO);       \
-        JU_ERRID(PJERROR) = __LINE__;           \
-    }                                           \
-}
-
-//=======================================================================
-// This routine must hash string to 24..32 bits.  The "goodness" of
-// the hash is not as important as its speed.
-//=======================================================================
-
-// hash to no more than 32 bits
-
-// extern Word_t gHmask; for hash bits experiments
-
-#define JUDYHASHSTR(HVALUE,STRING,LENGTH)       \
-{                                               \
-    uint8_t *p_ = (uint8_t *)(STRING);          \
-    uint8_t *q_ = p_ + (LENGTH);                \
-    uint32_t c_ = 0;                            \
-    for (; p_ != q_; ++p_)                      \
-    {                                           \
-        c_ = (c_ * 31) + *p_;                   \
-    }                                           \
-/*  c_ &= gHmask;   see above   */              \
-    (HVALUE) = c_;                              \
-}
-
-// Find String of Len in JudyHS structure, return pointer to associated Value
-
-PPvoid_t
-JudyHSGet(Pcvoid_t PArray,              // pointer (^) to structure
-           void * Str,                  // pointer to string
-           Word_t Len                   // length of string
-    )
-{
-    uint8_t  *String = (uint8_t *)Str;
-    PPvoid_t  PPValue;                  // pointer to Value
-    Word_t    Index;                    // 4[8] bytes of String
-
-    JLG(PPValue, PArray, Len);          // find hash table for strings of Len
-    if (PPValue == (PPvoid_t) NULL)
-        return ((PPvoid_t) NULL);       // no strings of this Len
-
-//  check for caller error (null pointer)
-//
-    if ((String == (void *) NULL) && (Len != 0))
-        return ((PPvoid_t) NULL);       // avoid null-pointer dereference
-
-#ifndef DONOTUSEHASH
-    if (Len > WORDSIZE)                 // Hash table not necessary with short
-    {
-        uint32_t  HValue;               // hash of input string
-        JUDYHASHSTR(HValue, String, Len);       // hash to no more than 32 bits
-        JLG(PPValue, *PPValue, (Word_t)HValue); // get ^ to hash bucket
-        if (PPValue == (PPvoid_t) NULL)
-            return ((PPvoid_t) NULL);   // no entry in Hash table
-    }
-#endif // DONOTUSEHASH
-
-/*
-  Each JudyL array decodes 4[8] bytes of the string.  Since the hash
-  collisions occur very infrequently, the performance is not important.
-  However, even if the Hash code is not used this method still is
-  significantly faster than common tree methods (AVL, Red-Black, Splay,
-  b-tree, etc..).  You can compare it yourself with #define DONOTUSEHASH
-  1 or putting -DDONOTUSEHASH in the cc line.  Use the "StringCompare.c"
-  code to compare (9Dec2003 dlb).
-*/
-    while (Len > WORDSIZE)              // traverse tree of JudyL arrays
-    {
-        if (IS_PLS(*PPValue))           // ^ to JudyL array or ls_t struct?
-        {
-            Pls_t     Pls;              // ls_t struct, termination of tree
-            Pls = (Pls_t) CLEAR_PLS(*PPValue);  // remove flag from ^
-
-//          if remaining string matches, return ^ to Value, else NULL
-
-            if (memcmp(String, Pls->ls_String, Len) == 0)
-                return ((PPvoid_t) (&(Pls->ls_Value)));
-            else
-                return ((PPvoid_t) NULL);       // string does not match
-        }
-        else
-        {
-            COPYSTRINGtoWORD(Index, String, WORDSIZE);
-
-            JLG(PPValue, *PPValue, Index);      // decode next 4[8] bytes
-            if (PPValue == (PPvoid_t) NULL)     // if NULL array, bail out
-                return ((PPvoid_t) NULL);       // string does not match
-
-            String += WORDSIZE;                 // advance
-            Len -= WORDSIZE;
-        }
-    }
-
-//  Get remaining 1..4[8] bytes left in string
-
-    COPYSTRINGtoWORD(Index, String, Len);
-    JLG(PPValue, *PPValue, Index);      // decode last 1-4[8] bytes
-    return (PPValue);
-}
-
-// Add string to a tree of JudyL arrays (all lengths must be same)
-
-static PPvoid_t
-insStrJudyLTree(uint8_t * String,      // string to add to tree of JudyL arrays
-                 Word_t Len,            // length of string
-                 PPvoid_t PPValue,      // pointer to root pointer
-                 PJError_t PJError      // for returning error info
-    )
-{
-    Word_t    Index;                    // next 4[8] bytes of String
-
-    while (Len > WORDSIZE)              // add to JudyL tree
-    {
-//      CASE 1, pointer is to a NULL, make a new ls_t leaf
-
-        if (*PPValue == (Pvoid_t)NULL)
-        {
-            Pls_t     Pls;              // memory for a ls_t
-            Pls = (Pls_t) JudyMalloc(LS_WORDLEN(Len));
-            if (Pls == NULL)
-            {
-                JU_SET_ERRNO(PJError, JU_ERRNO_NOMEM);
-                return (PPJERR);
-            }
-            Pls->ls_Value = 0;                          // clear Value word
-            memcpy(Pls->ls_String, String, Len);        // copy to new struct
-            *PPValue = (Pvoid_t)SET_PLS(Pls);           // mark pointer
-            return ((PPvoid_t) (&Pls->ls_Value));       // return ^ to Value
-        }                                               // no exit here
-//      CASE 2: is a ls_t, free (and shorten), then decode into JudyL tree
-
-        if (IS_PLS(*PPValue))                   // pointer to a ls_t? (leaf)
-        {
-            Pls_t     Pls;                      // ^ to ls_t
-            uint8_t  *String0;                  // ^ to string in ls_t
-            Word_t    Index0;                   // 4[8] bytes in string
-            Word_t    FreeLen;                  // length of ls_t
-            PPvoid_t  PPsplit;
-
-            FreeLen = LS_WORDLEN(Len);          // length of ls_t
-
-            Pls = (Pls_t) CLEAR_PLS(*PPValue);  // demangle ^ to ls_t
-            String0 = Pls->ls_String;
-            if (memcmp(String, String0, Len) == 0)      // check if match?
-            {
-                return ((PPvoid_t) (&Pls->ls_Value));   // yes, duplicate
-            }
-
-            *PPValue = NULL;            // clear ^ to ls_t and make JudyL
-
-//          This do loop is technically not required, saves multiple JudyFree()
-//          when storing already sorted strings into structure
-
-            do                          // decode next 4[8] bytes of string
-            {                           // with a JudyL array
-//              Note: string0 is always aligned
-
-                COPYSTRINGtoWORD(Index0, String0, WORDSIZE);
-                String0 += WORDSIZE;
-                COPYSTRINGtoWORD(Index, String, WORDSIZE);
-                String += WORDSIZE;
-                Len -= WORDSIZE;
-                PPsplit = PPValue;      // save for split below
-                PPValue = JudyLIns(PPValue, Index0, PJError);
-                if (PPValue == PPJERR)
-                {
-                    JU_SET_ERRNO(PJError, 0);
-                    return (PPJERR);
-                }
-
-            } while ((Index0 == Index) && (Len > WORDSIZE));
-
-//          finish storing remainder of string that was in the ls_t
-
-            PPValue = insStrJudyLTree(String0, Len, PPValue, PJError);
-            if (PPValue == PPJERR)
-            {
-                return (PPJERR);
-            }
-//          copy old Value to Value in new struct
-
-            *(PWord_t)PPValue = Pls->ls_Value;
-
-//          free the string buffer (ls_t)
-
-            JudyFree((Pvoid_t)Pls, FreeLen);
-            PPValue = JudyLIns(PPsplit, Index, PJError);
-            if (PPValue == PPJERR)
-            {
-                JU_SET_ERRNO(PJError, 0);
-                return (PPValue);
-            }
-
-//          finish remainder of newly inserted string
-
-            PPValue = insStrJudyLTree(String, Len, PPValue, PJError);
-            return (PPValue);
-        }                               // no exit here
-//      CASE 3, more JudyL arrays, decode to next tree
-
-        COPYSTRINGtoWORD(Index, String, WORDSIZE);
-        Len -= WORDSIZE;
-        String += WORDSIZE;
-
-        PPValue = JudyLIns(PPValue, Index, PJError);    // next 4[8] bytes
-        if (PPValue == PPJERR)
-        {
-            JU_SET_ERRNO(PJError, 0);
-            return (PPValue);
-        }
-    }
-//  this is done outside of loop so "Len" can be an unsigned number
-
-    COPYSTRINGtoWORD(Index, String, Len);
-    PPValue = JudyLIns(PPValue, Index, PJError);    // remaining 4[8] bytes
-
-    return (PPValue);
-}
-
-
-// Insert string to JudyHS structure, return pointer to associated Value
-
-PPvoid_t
-JudyHSIns(PPvoid_t PPArray,             // ^ to JudyHashArray name
-           void * Str,                  // pointer to string
-           Word_t Len,                  // length of string
-           PJError_t PJError            // optional, for returning error info
-    )
-{
-    uint8_t * String = (uint8_t *)Str;
-    PPvoid_t  PPValue;
-
-//  string can only be NULL if Len is 0.
-
-    if ((String == (uint8_t *) NULL) && (Len != 0UL))
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-    JLG(PPValue, *PPArray, Len);        // JudyL hash table for strings of Len
-    if (PPValue == (PPvoid_t) NULL)     // make new if missing, (very rare)
-    {
-        PPValue = JudyLIns(PPArray, Len, PJError);
-        if (PPValue == PPJERR)
-        {
-            JU_SET_ERRNO(PJError, 0);
-            return (PPJERR);
-        }
-    }
-#ifndef DONOTUSEHASH
-    if (Len > WORDSIZE)
-    {
-        uint32_t  HValue;                       // hash of input string
-        JUDYHASHSTR(HValue, String, Len);       // hash to no more than 32 bits
-        PPValue = JudyLIns(PPValue, (Word_t)HValue, PJError);
-        if (PPValue == PPJERR)
-        {
-            JU_SET_ERRNO(PJError, 0);
-            return (PPJERR);
-        }
-    }
-#endif // DONOTUSEHASH
-
-    PPValue = insStrJudyLTree(String, Len, PPValue, PJError); // add string 
-    return (PPValue);                   //  ^  to Value
-}
-
-// Delete string from tree of JudyL arrays (all Lens must be same)
-
-static int
-delStrJudyLTree(uint8_t * String,      // delete from tree of JudyL arrays
-                 Word_t Len,            // length of string
-                 PPvoid_t PPValue,      // ^ to hash bucket
-                 PJError_t PJError      // for returning error info
-    )
-{
-    PPvoid_t  PPValueN;                 // next pointer
-    Word_t    Index;
-    int       Ret;                      // -1=failed, 1=success, 2=quit del
-
-    if (IS_PLS(*PPValue))               // is pointer to ls_t?
-    {
-        Pls_t     Pls;
-        Pls = (Pls_t) CLEAR_PLS(*PPValue);      // demangle pointer
-        JudyFree((Pvoid_t)Pls, LS_WORDLEN(Len));        // free the ls_t
-
-        *PPValue = (Pvoid_t)NULL;       // clean pointer
-        return (1);                     // successfully deleted
-    }
-
-    if (Len > WORDSIZE)                 // delete from JudyL tree, not leaf
-    {
-        COPYSTRINGtoWORD(Index, String, WORDSIZE);      // get Index
-        JLG(PPValueN, *PPValue, Index); // get pointer to next JudyL array
-
-        String += WORDSIZE;             // advance to next 4[8] bytes
-        Len -= WORDSIZE;
-
-        Ret = delStrJudyLTree(String, Len, PPValueN, PJError);
-        if (Ret != 1) return(Ret);
-
-        if (*PPValueN == (PPvoid_t) NULL)
-        {
-//          delete JudyL element from tree
-
-            Ret = JudyLDel(PPValue, Index, PJError);
-        }
-    }
-    else
-    {
-        COPYSTRINGtoWORD(Index, String, Len);   // get leaf element
-
-//      delete last 1-4[8] bytes from leaf element
-
-        Ret = JudyLDel(PPValue, Index, PJError); 
-    }
-    return (Ret);
-}
-
-// Delete string from JHS structure
-
-int
-JudyHSDel(PPvoid_t PPArray,             // ^ to JudyHashArray struct
-           void * Str,                  // pointer to string
-           Word_t Len,                  // length of string
-           PJError_t PJError            // optional, for returning error info
-    )
-{
-    uint8_t * String = (uint8_t *)Str;
-    PPvoid_t  PPBucket, PPHtble;
-    int       Ret;                      // return bool from Delete routine
-#ifndef DONOTUSEHASH
-    uint32_t  HValue = 0;               // hash value of input string
-#endif // DONOTUSEHASH
-
-    if (PPArray == NULL)
-        return (0);                     // no pointer, return not found
-
-//  This is a little slower than optimum method, but not much in new CPU
-//  Verify that string is in the structure -- simplifies future assumptions
-
-    if (JudyHSGet(*PPArray, String, Len) == (PPvoid_t) NULL)
-        return (0);                     // string not found, return
-
-//  string is in structure, so testing for absence is not necessary
-
-    JLG(PPHtble, *PPArray, Len);        // JudyL hash table for strings of Len
-
-#ifdef DONOTUSEHASH
-    PPBucket = PPHtble;                 // simulate below code
-#else  // USEHASH
-    if (Len > WORDSIZE)
-    {
-        JUDYHASHSTR(HValue, String, Len);       // hash to no more than 32 bits
-
-//  get pointer to hash bucket
-
-        JLG(PPBucket, *PPHtble, (Word_t)HValue);
-    }
-    else
-    {
-        PPBucket = PPHtble;             // no bucket to JLGet
-    }
-#endif // USEHASH
-
-// delete from JudyL tree
-//
-    Ret = delStrJudyLTree(String, Len, PPBucket, PJError);
-    if (Ret != 1)
-    {
-        JU_SET_ERRNO(PJError, 0);
-        return(-1);
-    }
-//  handle case of missing JudyL array from hash table and length table
-
-    if (*PPBucket == (Pvoid_t)NULL)     // if JudyL tree gone
-    {
-#ifndef DONOTUSEHASH
-        if (Len > WORDSIZE)
-        {
-//          delete entry in Hash table
-
-            Ret = JudyLDel(PPHtble, (Word_t)HValue, PJError); 
-            if (Ret != 1)
-            {
-                JU_SET_ERRNO(PJError, 0);
-                return(-1);
-            }
-        }
-#endif // USEHASH
-        if (*PPHtble == (PPvoid_t) NULL)        // if Hash table gone
-        {
-//          delete entry from the String length table
-
-            Ret = JudyLDel(PPArray, Len, PJError); 
-            if (Ret != 1)
-            {
-                JU_SET_ERRNO(PJError, 0);
-                return(-1);
-            }
-        }
-    }
-    return (1);                         // success
-}
-
-static Word_t
-delJudyLTree(PPvoid_t PPValue,                 // ^ to JudyL root pointer
-              Word_t Len,                       // length of string
-              PJError_t PJError)                // for returning error info
-{
-    Word_t    bytes_freed = 0;                  // bytes freed at point
-    Word_t    bytes_total = 0;                  // accumulated bytes freed
-    PPvoid_t  PPValueN;
-
-//  Pointer is to another tree of JudyL arrays or ls_t struct
-
-    if (Len > WORDSIZE)                         // more depth to tree
-    {
-        Word_t NEntry;
-
-//      Pointer is to a ls_t struct
-
-        if (IS_PLS(*PPValue)) 
-        {
-            Pls_t   Pls;
-            Word_t  freewords;
-
-            freewords = LS_WORDLEN(Len);        // calculate length
-            Pls = (Pls_t)CLEAR_PLS(*PPValue);   // demangle pointer
-
-//        *PPValue = (Pvoid_t)NULL;               // clean pointer
-           JudyFree((Pvoid_t)Pls, freewords);   // free the ls_t
-
-            return(freewords * WORDSIZE);
-        }
-//      else
-//      Walk all the entrys in the JudyL array
-
-        NEntry = 0;                             // start at beginning
-        for (PPValueN = JudyLFirst(*PPValue, &NEntry, PJError);
-            (PPValueN != (PPvoid_t) NULL) && (PPValueN != PPJERR);
-             PPValueN = JudyLNext(*PPValue, &NEntry, PJError))
-        {
-//          recurse to the next level in the tree of arrays
-
-            bytes_freed = delJudyLTree(PPValueN, Len - WORDSIZE, PJError);
-            if (bytes_freed == JERR) return(JERR);
-            bytes_total += bytes_freed;
-        }
-        if (PPValueN == PPJERR) return(JERR);
-
-//      now free this JudyL array
-
-        bytes_freed = JudyLFreeArray(PPValue, PJError);
-        if (bytes_freed == JERR) return(JERR);
-        bytes_total += bytes_freed;
-
-        return(bytes_total);  // return amount freed
-    }
-//  else
-
-//  Pointer to simple JudyL array
-
-    bytes_freed = JudyLFreeArray(PPValue, PJError);
-
-    return(bytes_freed);
-}
-
-
-Word_t                                  // bytes freed
-JudyHSFreeArray(PPvoid_t PPArray,       // ^ to JudyHashArray struct
-           PJError_t PJError            // optional, for returning error info
-    )
-{
-    Word_t    Len;                      // start at beginning
-    Word_t    bytes_freed;              // bytes freed at this level.
-    Word_t    bytes_total;              // bytes total at all levels.
-    PPvoid_t  PPHtble;
-
-    if (PPArray == NULL) 
-        return (0);                     // no pointer, return none
-
-//  Walk the string length table for subsidary hash structs
-//  NOTE: This is necessary to determine the depth of the tree
-
-    bytes_freed = 0; 
-    bytes_total = 0;
-    Len = 0;                            // walk to length table
-
-    for (PPHtble  = JudyLFirst(*PPArray, &Len, PJError);
-        (PPHtble != (PPvoid_t) NULL) && (PPHtble != PPJERR);
-         PPHtble  = JudyLNext(*PPArray, &Len, PJError))
-    {
-        PPvoid_t PPValueH;
-
-#ifndef DONOTUSEHASH
-        if (Len > WORDSIZE)
-        {
-            Word_t HEntry = 0;              // walk the hash tables
-
-            for (PPValueH  = JudyLFirst(*PPHtble, &HEntry, PJError);
-                (PPValueH != (PPvoid_t) NULL) && (PPValueH != PPJERR);
-                 PPValueH  = JudyLNext(*PPHtble, &HEntry, PJError))
-            {
-                bytes_freed = delJudyLTree(PPValueH, Len, PJError);
-                if (bytes_freed == JERR) return(JERR);
-                bytes_total += bytes_freed;
-            }
-
-            if (PPValueH == PPJERR) return(JERR);
-
-//          free the Hash table for this length of string
-
-            bytes_freed = JudyLFreeArray(PPHtble, PJError);
-            if (bytes_freed == JERR) return(JERR);
-            bytes_total += bytes_freed;
-        }
-        else
-#endif // DONOTUSEHASH
-        {
-                PPValueH = PPHtble;     // simulate hash table
-
-                bytes_freed = delJudyLTree(PPValueH, Len, PJError);
-                if (bytes_freed == JERR) return(JERR);
-                bytes_total += bytes_freed;
-        }
-    }
-    if (PPHtble == PPJERR) return(JERR);
-
-//  free the length table
-
-    bytes_freed = JudyLFreeArray(PPArray, PJError);
-    if (bytes_freed == JERR) return(JERR);
-
-    bytes_total += bytes_freed;
-
-    return(bytes_total);                // return bytes freed
-}
diff --git a/libs/klib/judy/JudyHS.h b/libs/klib/judy/JudyHS.h
deleted file mode 100644
index b403501..0000000
--- a/libs/klib/judy/JudyHS.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// ****************************************************************************
-// Quick and dirty header file for use with old Judy.h without JudyHS defs
-// May 2004 (dlb) - No copyright or license -- it is free period.
-
-#include <stdint.h>
-
-// ****************************************************************************
-// JUDYHSL MACROS:
-
-#define JHSI(PV,    PArray,   PIndex,   Count)                          \
-        J_2P(PV, (&(PArray)), PIndex,   Count, JudyHSIns, "JudyHSIns")
-#define JHSG(PV,    PArray,   PIndex,   Count)                          \
-        (PV) = (Pvoid_t) JudyHSGet(PArray, PIndex, Count)
-#define JHSD(Rc,    PArray,   PIndex,   Count)                          \
-        J_2I(Rc, (&(PArray)), PIndex, Count, JudyHSDel, "JudyHSDel")
-#define JHSFA(Rc,    PArray)                                            \
-        J_0I(Rc, (&(PArray)), JudyHSFreeArray, "JudyHSFreeArray")
-
-// ****************************************************************************
-// JUDY memory interface to malloc() FUNCTIONS:
-
-extern Word_t JudyMalloc(Word_t);               // words reqd => words allocd.
-extern Word_t JudyMallocVirtual(Word_t);        // words reqd => words allocd.
-extern void   JudyFree(Pvoid_t, Word_t);        // block to free and its size in words.
-extern void   JudyFreeVirtual(Pvoid_t, Word_t); // block to free and its size in words.
-
-// ****************************************************************************
-// JUDYHS FUNCTIONS:
-
-extern PPvoid_t JudyHSGet(       Pcvoid_t,  void *, Word_t);
-extern PPvoid_t JudyHSIns(       PPvoid_t,  void *, Word_t, P_JE);
-extern int      JudyHSDel(       PPvoid_t,  void *, Word_t, P_JE);
-extern Word_t   JudyHSFreeArray( PPvoid_t,                  P_JE);
-
-extern uint32_t JudyHashStr(                void *, Word_t);
diff --git a/libs/klib/judy/JudyIns.c b/libs/klib/judy/JudyIns.c
deleted file mode 100644
index d90820b..0000000
--- a/libs/klib/judy/JudyIns.c
+++ /dev/null
@@ -1,1871 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy1Set() and JudyLIns() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// TBD:  Should some of the assertions here be converted to product code that
-// returns JU_ERRNO_CORRUPT?
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-// Note:  Call JudyCheckPop() even before "already inserted" returns, to catch
-// population errors; see fix in 4.84:
-
-DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);)
-DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);)
-
-#ifdef TRACEJP
-#include "JudyPrintJP.c"
-#endif
-
-
-// These are defined to generic values in JudyCommon/JudyPrivateTypes.h:
-//
-// TBD:  These should be exported from a header file, but perhaps not, as they
-// are only used here, and exported from Judy*Decascade, which is a separate
-// file for profiling reasons (to prevent inlining), but which potentially
-// could be merged with this file, either in SoftCM or at compile-time.
-
-#ifdef JUDY1
-extern int j__udy1CreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t);
-extern int j__udy1CreateBranchU(Pjp_t, Pvoid_t);
-
-#ifndef JU_64BIT
-extern int j__udy1Cascade1(Pjp_t, Pvoid_t);
-#endif
-extern int j__udy1Cascade2(Pjp_t, Pvoid_t);
-extern int j__udy1Cascade3(Pjp_t, Pvoid_t);
-#ifdef JU_64BIT
-extern int j__udy1Cascade4(Pjp_t, Pvoid_t);
-extern int j__udy1Cascade5(Pjp_t, Pvoid_t);
-extern int j__udy1Cascade6(Pjp_t, Pvoid_t);
-extern int j__udy1Cascade7(Pjp_t, Pvoid_t);
-#endif
-extern int j__udy1CascadeL(Pjp_t, Pvoid_t);
-
-extern int j__udy1InsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t);
-
-#else // JUDYL
-
-extern int j__udyLCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t);
-extern int j__udyLCreateBranchU(Pjp_t, Pvoid_t);
-
-extern int j__udyLCascade1(Pjp_t, Pvoid_t);
-extern int j__udyLCascade2(Pjp_t, Pvoid_t);
-extern int j__udyLCascade3(Pjp_t, Pvoid_t);
-#ifdef JU_64BIT
-extern int j__udyLCascade4(Pjp_t, Pvoid_t);
-extern int j__udyLCascade5(Pjp_t, Pvoid_t);
-extern int j__udyLCascade6(Pjp_t, Pvoid_t);
-extern int j__udyLCascade7(Pjp_t, Pvoid_t);
-#endif
-extern int j__udyLCascadeL(Pjp_t, Pvoid_t);
-
-extern int j__udyLInsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t);
-#endif
-
-
-// ****************************************************************************
-// MACROS FOR COMMON CODE:
-//
-// Check if Index is an outlier to (that is, not a member of) this expanse:
-//
-// An outlier is an Index in-the-expanse of the slot containing the pointer,
-// but not-in-the-expanse of the "narrow" pointer in that slot.  (This means
-// the Dcd part of the Index differs from the equivalent part of jp_DcdPopO.)
-// Therefore, the remedy is to put a cJU_JPBRANCH_L* between the narrow pointer
-// and the object to which it points, and add the outlier Index as an Immediate
-// in the cJU_JPBRANCH_L*.  The "trick" is placing the cJU_JPBRANCH_L* at a
-// Level that is as low as possible.  This is determined by counting the digits
-// in the existing narrow pointer that are the same as the digits in the new
-// Index (see j__udyInsertBranch()).
-//
-// Note:  At some high Levels, cJU_DCDMASK() is all zeros => dead code; assume
-// the compiler optimizes this out.
-
-#define JU_CHECK_IF_OUTLIER(Pjp, Index, cLevel, Pjpm)                   \
-        if (JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel))                    \
-            return(j__udyInsertBranch(Pjp, Index, cLevel, Pjpm))
-
-// Check if an Index is already in a leaf or immediate, after calling
-// j__udySearchLeaf*() to set Offset:
-//
-// A non-negative Offset means the Index already exists, so return 0; otherwise
-// complement Offset to proceed.
-
-#ifdef JUDY1
-#define Pjv ignore                                      // placeholder.
-#define JU_CHECK_IF_EXISTS(Offset,ignore,Pjpm)  \
-        {                                       \
-            if ((Offset) >= 0) return(0);       \
-            (Offset) = ~(Offset);               \
-        }
-#else
-// For JudyL, also set the value area pointer in the Pjpm:
-
-#define JU_CHECK_IF_EXISTS(Offset,Pjv,Pjpm)             \
-        {                                               \
-            if ((Offset) >= 0)                          \
-            {                                           \
-                (Pjpm)->jpm_PValue = (Pjv) + (Offset);  \
-                return(0);                              \
-            }                                           \
-            (Offset) = ~(Offset);                       \
-        }
-#endif
-
-
-// ****************************************************************************
-// __ J U D Y   I N S   W A L K
-//
-// Walk the Judy tree to do a set/insert.  This is only called internally, and
-// recursively.  Unlike Judy1Test() and JudyLGet(), the extra time required for
-// recursion should be negligible compared with the total.
-//
-// Return -1 for error (details in JPM), 0 for Index already inserted, 1 for
-// new Index inserted.
-
-FUNCTION static int j__udyInsWalk(
-        Pjp_t   Pjp,            // current JP to descend.
-        Word_t  Index,          // to insert.
-        Pjpm_t  Pjpm)           // for returning info to top Level.
-{
-        uint8_t digit;          // from Index, current offset into a branch.
-        jp_t    newJP;          // for creating a new Immed JP.
-        Word_t  exppop1;        // expanse (leaf) population.
-        int     retcode;        // return codes:  -1, 0, 1.
-
-#ifdef SUBEXPCOUNTS
-// Pointer to BranchB/U subexpanse counter:
-//
-// Note:  Very important for performance reasons (avoids cache fills).
-
-        PWord_t PSubExp = (PWord_t) NULL;
-#endif
-
-ContinueInsWalk:                // for modifying state without recursing.
-
-#ifdef TRACEJP
-        JudyPrintJP(Pjp, "i", __LINE__);
-#endif
-
-        switch (JU_JPTYPE(Pjp)) // entry:  Pjp, Index.
-        {
-
-
-// ****************************************************************************
-// JPNULL*:
-//
-// Convert JP in place from current null type to cJU_JPIMMED_*_01 by
-// calculating new JP type.
-
-        case cJU_JPNULL1:
-        case cJU_JPNULL2:
-        case cJU_JPNULL3:
-#ifdef JU_64BIT
-        case cJU_JPNULL4:
-        case cJU_JPNULL5:
-        case cJU_JPNULL6:
-        case cJU_JPNULL7:
-#endif
-            assert((Pjp->jp_Addr) == 0);
-            JU_JPSETADT(Pjp, 0, Index, JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01 - cJU_JPNULL1);
-#ifdef JUDYL
-            // value area is first word of new Immed_01 JP:
-            Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr));
-#endif
-            return(1);
-
-
-// ****************************************************************************
-// JPBRANCH_L*:
-//
-// If the new Index is not an outlier to the branchs expanse, and the branch
-// should not be converted to uncompressed, extract the digit and record the
-// Immediate type to create for a new Immed JP, before going to common code.
-//
-// Note:  JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit.
-
-#define JU_BRANCH_OUTLIER(DIGIT,POP1,cLEVEL,PJP,INDEX,PJPM)  \
-        JU_CHECK_IF_OUTLIER(PJP, INDEX, cLEVEL, PJPM);       \
-        (DIGIT) = JU_DIGITATSTATE(INDEX, cLEVEL);            \
-        (POP1)  = JU_JPBRANCH_POP0(PJP, cLEVEL)
-
-        case cJU_JPBRANCH_L2:
-            JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L3:
-            JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_L4:
-            JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L5:
-            JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L6:
-            JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-
-        case cJU_JPBRANCH_L7:
-            JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm);
-            goto JudyBranchL;
-#endif
-
-// Similar to common code above, but no outlier check is needed, and the Immed
-// type depends on the word size:
-
-        case cJU_JPBRANCH_L:
-        {
-            Pjbl_t PjblRaw;     // pointer to old linear branch.
-            Pjbl_t Pjbl;
-            Pjbu_t PjbuRaw;     // pointer to new uncompressed branch.
-            Pjbu_t Pjbu;
-            Word_t numJPs;      // number of JPs = populated expanses.
-            int    offset;      // in branch.
-
-            digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-            exppop1 = Pjpm->jpm_Pop0;
-
-            // fall through:
-
-// COMMON CODE FOR LINEAR BRANCHES:
-//
-// Come here with digit and exppop1 already set.
-
-JudyBranchL:
-            PjblRaw = (Pjbl_t) (Pjp->jp_Addr);
-            Pjbl    = P_JBL(PjblRaw);
-
-// If population under this branch greater than:
-
-            if (exppop1 > JU_BRANCHL_MAX_POP)
-                goto ConvertBranchLtoU;
-
-            numJPs = Pjbl->jbl_NumJPs;
-
-            if ((numJPs == 0) || (numJPs > cJU_BRANCHLMAXJPS))
-            {
-                JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT);
-                return(-1);
-            }
-
-// Search for a match to the digit:
-
-            offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), numJPs,
-                                       digit);
-
-// If Index is found, offset is into an array of 1..cJU_BRANCHLMAXJPS JPs:
-
-            if (offset >= 0)
-            {
-                Pjp = (Pjbl->jbl_jp) + offset;  // address of next JP.
-                break;                          // continue walk.
-            }
-
-// Expanse is missing (not populated) for the passed Index, so insert an Immed
-// -- if theres room:
-
-            if (numJPs < cJU_BRANCHLMAXJPS)
-            {
-                offset = ~offset;       // insertion offset.
-
-                JU_JPSETADT(&newJP, 0, Index,
-                        JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_L2);
-
-                JU_INSERTINPLACE(Pjbl->jbl_Expanse, numJPs, offset, digit);
-                JU_INSERTINPLACE(Pjbl->jbl_jp,      numJPs, offset, newJP);
-
-                DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse),
-                                        numJPs + 1, /* IndexSize = */ 1);)
-                ++(Pjbl->jbl_NumJPs);
-#ifdef JUDYL
-                // value area is first word of new Immed 01 JP:
-                Pjpm->jpm_PValue = (Pjv_t) ((Pjbl->jbl_jp) + offset);
-#endif
-                return(1);
-            }
-
-
-// MAXED OUT LINEAR BRANCH, CONVERT TO A BITMAP BRANCH, THEN INSERT:
-//
-// Copy the linear branch to a bitmap branch.
-//
-// TBD:  Consider renaming j__udyCreateBranchB() to j__udyConvertBranchLtoB().
-
-            assert((numJPs) <= cJU_BRANCHLMAXJPS);
-
-            if (j__udyCreateBranchB(Pjp, Pjbl->jbl_jp, Pjbl->jbl_Expanse,
-                                    numJPs, Pjpm) == -1)
-            {
-                return(-1);
-            }
-
-// Convert jp_Type from linear branch to equivalent bitmap branch:
-
-            Pjp->jp_Type += cJU_JPBRANCH_B - cJU_JPBRANCH_L;
-
-            j__udyFreeJBL(PjblRaw, Pjpm);       // free old BranchL.
-
-// Having changed branch types, now do the insert in the new branch type:
-
-            goto ContinueInsWalk;
-
-
-// OPPORTUNISTICALLY CONVERT FROM BRANCHL TO BRANCHU:
-//
-// Memory efficiency is no object because the branchs pop1 is large enough, so
-// speed up array access.  Come here with PjblRaw set.  Note:  This is goto
-// code because the previous block used to fall through into it as well, but no
-// longer.
-
-ConvertBranchLtoU:
-
-// Allocate memory for an uncompressed branch:
-
-            if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL)
-                return(-1);
-            Pjbu = P_JBU(PjbuRaw);
-
-// Set the proper NULL type for most of the uncompressed branchs JPs:
-
-            JU_JPSETADT(&newJP, 0, 0, 
-                    JU_JPTYPE(Pjp) - cJU_JPBRANCH_L2 + cJU_JPNULL1);
-
-// Initialize:  Pre-set uncompressed branch to mostly JPNULL*s:
-
-            for (numJPs = 0; numJPs < cJU_BRANCHUNUMJPS; ++numJPs)
-                Pjbu->jbu_jp[numJPs] = newJP;
-
-// Copy JPs from linear branch to uncompressed branch:
-
-            {
-#ifdef SUBEXPCOUNTS
-                Word_t popmask = cJU_POP0MASK(JU_JPTYPE(Pjp))
-                                             - cJU_JPBRANCH_L2 - 2;
-
-                for (numJPs = 0; numJPs < cJU_NUMSUBEXPU; ++numJPs)
-                    Pjbu->jbu_subPop1[numJPs] = 0;
-#endif
-                for (numJPs = 0; numJPs < Pjbl->jbl_NumJPs; ++numJPs)
-                {
-                    Pjp_t Pjp1           = &(Pjbl->jbl_jp[numJPs]);
-                    offset               = Pjbl->jbl_Expanse[numJPs];
-                    Pjbu->jbu_jp[offset] = *Pjp1;
-#ifdef SUBEXPCOUNTS
-                    Pjbu->jbu_subPop1[offset/cJU_NUMSUBEXPU] +=
-                        JU_JPDCDPOP0(Pjp1) & popmask + 1;
-#endif
-                }
-            }
-            j__udyFreeJBL(PjblRaw, Pjpm);               // free old BranchL.
-
-// Plug new values into parent JP:
-
-            Pjp->jp_Addr  = (Word_t) PjbuRaw;
-            Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_L;    // to BranchU.
-
-// Save global population of last BranchU conversion:
-
-            Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0;
-            goto ContinueInsWalk;
-
-        } // case cJU_JPBRANCH_L.
-
-
-// ****************************************************************************
-// JPBRANCH_B*:
-//
-// If the new Index is not an outlier to the branchs expanse, extract the
-// digit and record the Immediate type to create for a new Immed JP, before
-// going to common code.
-//
-// Note:  JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit.
-
-        case cJU_JPBRANCH_B2:
-            JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B3:
-            JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_B4:
-            JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B5:
-            JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B6:
-            JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-
-        case cJU_JPBRANCH_B7:
-            JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm);
-            goto JudyBranchB;
-#endif
-
-        case cJU_JPBRANCH_B:
-        {
-            Pjbb_t    Pjbb;             // pointer to bitmap branch.
-            Pjbb_t    PjbbRaw;          // pointer to bitmap branch.
-            Pjp_t     Pjp2Raw;          // 1 of N arrays of JPs.
-            Pjp_t     Pjp2;             // 1 of N arrays of JPs.
-            Word_t    subexp;           // 1 of N subexpanses in bitmap.
-            BITMAPB_t bitmap;           // for one subexpanse.
-            BITMAPB_t bitmask;          // bit set for Indexs digit.
-            Word_t    numJPs;           // number of JPs = populated expanses.
-            int       offset;           // in bitmap branch.
-
-// Similar to common code above, but no outlier check is needed, and the Immed
-// type depends on the word size:
-
-            digit   = JU_DIGITATSTATE(Index, cJU_ROOTSTATE);
-            exppop1 = Pjpm->jpm_Pop0;
-
-            // fall through:
-
-
-// COMMON CODE FOR BITMAP BRANCHES:
-//
-// Come here with digit and exppop1 already set.
-
-JudyBranchB:
-
-// If population increment is greater than..  (300):
-
-            if ((Pjpm->jpm_Pop0 - Pjpm->jpm_LastUPop0) > JU_BTOU_POP_INCREMENT)
-            {
-
-// If total population of array is greater than..  (750):
-
-                if (Pjpm->jpm_Pop0 > JU_BRANCHB_MAX_POP)
-                {
-
-// If population under the branch is greater than..  (135):
-
-                    if (exppop1 > JU_BRANCHB_MIN_POP)
-                    {
-                        if (j__udyCreateBranchU(Pjp, Pjpm) == -1) return(-1);
-
-// Save global population of last BranchU conversion:
-
-                        Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0;
-
-                        goto ContinueInsWalk;
-                    }
-                }
-            }
-
-// CONTINUE TO USE BRANCHB:
-//
-// Get pointer to bitmap branch (JBB):
-
-            PjbbRaw = (Pjbb_t) (Pjp->jp_Addr);
-            Pjbb    = P_JBB(PjbbRaw);
-
-// Form the Int32 offset, and Bit offset values:
-//
-// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
-//              |SubExpanse |    Bit offset     |
-//
-// Get the 1 of 8 expanses from digit, Bits 5..7 = 1 of 8, and get the 32-bit
-// word that may have a bit set:
-
-            subexp = digit / cJU_BITSPERSUBEXPB;
-            bitmap = JU_JBB_BITMAP(Pjbb, subexp);
-
-            Pjp2Raw = JU_JBB_PJP(Pjbb, subexp);
-            Pjp2    = P_JP(Pjp2Raw);
-
-// Get the bit position that represents the desired expanse, and get the offset
-// into the array of JPs for the JP that matches the bit.
-
-            bitmask = JU_BITPOSMASKB(digit);
-            offset  = j__udyCountBitsB(bitmap & (bitmask - 1));
-
-// If JP is already in this expanse, get Pjp and continue the walk:
-
-            if (bitmap & bitmask)
-            {
-#ifdef SUBEXPCOUNTS
-                PSubExp = &(Pjbb->jbb_Counts[subexp]);  // ptr to subexp counts.
-#endif
-                Pjp =  Pjp2 + offset;
-                break;                                  // continue walk.
-            }
-
-
-// ADD NEW EXPANSE FOR NEW INDEX:
-//
-// The new expanse always an cJU_JPIMMED_*_01 containing just the new Index, so
-// finish setting up an Immed JP.
-
-            JU_JPSETADT(&newJP, 0, Index, 
-                JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_B2);
-
-// Get 1 of the 8 JP arrays and calculate number of JPs in subexpanse array:
-
-            Pjp2Raw = JU_JBB_PJP(Pjbb, subexp);
-            Pjp2    = P_JP(Pjp2Raw);
-            numJPs  = j__udyCountBitsB(bitmap);
-
-// Expand branch JP subarray in-place:
-
-            if (JU_BRANCHBJPGROWINPLACE(numJPs))
-            {
-                assert(numJPs > 0);
-                JU_INSERTINPLACE(Pjp2, numJPs, offset, newJP);
-#ifdef JUDYL
-                // value area is first word of new Immed 01 JP:
-                Pjpm->jpm_PValue = (Pjv_t) (Pjp2 + offset);
-#endif
-            }
-
-// No room, allocate a bigger bitmap branch JP subarray:
-
-            else
-            {
-                Pjp_t PjpnewRaw;
-                Pjp_t Pjpnew;
-
-                if ((PjpnewRaw = j__udyAllocJBBJP(numJPs + 1, Pjpm)) == 0)
-                    return(-1);
-                Pjpnew = P_JP(PjpnewRaw);
-
-// If there was an old JP array, then copy it, insert the new Immed JP, and
-// free the old array:
-
-                if (numJPs)
-                {
-                    JU_INSERTCOPY(Pjpnew, Pjp2, numJPs, offset, newJP);
-                    j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm);
-#ifdef JUDYL
-                    // value area is first word of new Immed 01 JP:
-                    Pjpm->jpm_PValue = (Pjv_t) (Pjpnew + offset);
-#endif
-                }
-
-// New JP subarray; point to cJU_JPIMMED_*_01 and place it:
-
-                else
-                {
-                    assert(JU_JBB_PJP(Pjbb, subexp) == (Pjp_t) NULL);
-                     Pjp = Pjpnew;
-                    *Pjp = newJP;               // copy to new memory.
-#ifdef JUDYL
-                    // value area is first word of new Immed 01 JP:
-                    Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr));
-#endif
-                }
-
-// Place new JP subarray in BranchB:
-
-                JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw;
-
-            } // else
-
-// Set the new Indexs bit:
-
-            JU_JBB_BITMAP(Pjbb, subexp) |= bitmask;
-
-            return(1);
-
-        } // case
-
-
-// ****************************************************************************
-// JPBRANCH_U*:
-//
-// Just drop through the JP for the correct digit.  If the JP turns out to be a
-// JPNULL*, thats OK, the memory is already allocated, and the next walk
-// simply places an Immed in it.
-//
-#ifdef SUBEXPCOUNTS
-#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) \
-        (PSubExp) = &((Pjbu)->jbu_subPop1[(Digit) / cJU_NUMSUBEXPU])
-#else
-#define JU_GETSUBEXP(PSubExp,Pjbu,Digit)  // null.
-#endif
-
-#define JU_JBU_PJP_SUBEXP(Pjp,PSubExp,Index,Level)              \
-        {                                                       \
-            uint8_t digit = JU_DIGITATSTATE(Index, Level);      \
-            Pjbu_t  P_jbu  = P_JBU((Pjp)->jp_Addr);             \
-            (Pjp) = &(P_jbu->jbu_jp[digit]);                    \
-            JU_GETSUBEXP(PSubExp, P_jbu, digit);                \
-        }
-
-        case cJU_JPBRANCH_U2:
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 2, Pjpm);
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 2);
-            break;
-
-#ifdef JU_64BIT
-        case cJU_JPBRANCH_U3:
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 3, Pjpm);
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3);
-            break;
-
-        case cJU_JPBRANCH_U4:
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 4, Pjpm);
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 4);
-            break;
-
-        case cJU_JPBRANCH_U5:
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 5, Pjpm);
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 5);
-            break;
-
-        case cJU_JPBRANCH_U6:
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 6, Pjpm);
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 6);
-            break;
-
-        case cJU_JPBRANCH_U7:
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 7);
-#else
-        case cJU_JPBRANCH_U3:
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3);
-#endif
-            break;
-
-        case cJU_JPBRANCH_U:
-            JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, cJU_ROOTSTATE);
-            break;
-
-
-// ****************************************************************************
-// JPLEAF*:
-//
-// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW:
-//
-// These are necessary to support performance by function and loop unrolling
-// while avoiding huge amounts of nearly identical code.
-//
-// Prepare to handle a linear leaf:  Check for an outlier; set pop1 and pointer
-// to leaf:
-
-#ifdef JUDY1
-#define JU_LEAFVALUE(Pjv)                       // null.
-#define JU_LEAFPREPVALUE(Pjv, ValueArea)        // null.
-#else
-#define JU_LEAFVALUE(Pjv)                Pjv_t Pjv
-#define JU_LEAFPREPVALUE(Pjv, ValueArea) (Pjv) = ValueArea(Pleaf, exppop1)
-#endif
-
-#define JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea)         \
-        Pjll_t  PjllRaw;                                \
-        Type    Pleaf;  /* specific type */             \
-        int     offset;                                 \
-        JU_LEAFVALUE(Pjv);                              \
-                                                        \
-        JU_CHECK_IF_OUTLIER(Pjp, Index, cIS, Pjpm);     \
-                                                        \
-        exppop1 = JU_JPLEAF_POP0(Pjp) + 1;              \
-        assert(exppop1 <= (MaxPop1));                   \
-        PjllRaw = (Pjll_t) (Pjp->jp_Addr);              \
-        Pleaf   = (Type) P_JLL(PjllRaw);                \
-        JU_LEAFPREPVALUE(Pjv, ValueArea)
-
-// Add to, or grow, a linear leaf:  Find Index position; if the Index is
-// absent, if theres room in the leaf, insert the Index [and value of 0] in
-// place, otherwise grow the leaf:
-//
-// Note:  These insertions always take place with whole words, using
-// JU_INSERTINPLACE() or JU_INSERTCOPY().
-
-#ifdef JUDY1
-#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset)  // null.
-#else
-#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset)         \
-        JU_INSERTINPLACE(Pjv, ExpPop1, Offset, 0);      \
-        Pjpm->jpm_PValue = (Pjv) + (Offset)
-#endif
-
-#ifdef JUDY1
-#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset)  // null.
-#else
-#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset)               \
-        {                                                               \
-            Pjv_t Pjvnew = ValueArea(Pleafnew, (ExpPop1) + 1);          \
-            JU_INSERTCOPY(Pjvnew, Pjv, ExpPop1, Offset, 0);             \
-            Pjpm->jpm_PValue = (Pjvnew) + (Offset);                     \
-        }
-#endif
-
-#define JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace,      \
-                    InsertInPlace,InsertCopy,Alloc,Free)                \
-                                                                        \
-        offset = Search(Pleaf, exppop1, Index);                         \
-        JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm);                          \
-                                                                        \
-        if (GrowInPlace(exppop1))       /* add to current leaf */       \
-        {                                                               \
-            InsertInPlace(Pleaf, exppop1, offset, Index);               \
-            JU_LEAFGROWVALUEADD(Pjv, exppop1, offset);                  \
-            DBGCODE(JudyCheckSorted((Pjll_t) Pleaf, exppop1 + 1, cIS);) \
-            return(1);                                                  \
-        }                                                               \
-                                                                        \
-        if (exppop1 < (MaxPop1))        /* grow to new leaf */          \
-        {                                                               \
-            Pjll_t PjllnewRaw;                                          \
-            Type   Pleafnew;                                            \
-            if ((PjllnewRaw = Alloc(exppop1 + 1, Pjpm)) == 0) return(-1); \
-            Pleafnew = (Type) P_JLL(PjllnewRaw);                        \
-            InsertCopy(Pleafnew, Pleaf, exppop1, offset, Index);        \
-            JU_LEAFGROWVALUENEW(ValueArea, Pjv, exppop1, offset);       \
-            DBGCODE(JudyCheckSorted((Pjll_t) Pleafnew, exppop1 + 1, cIS);) \
-            Free(PjllRaw, exppop1, Pjpm);                               \
-            (Pjp->jp_Addr) = (Word_t) PjllnewRaw;                       \
-            return(1);                                                  \
-        }                                                               \
-        assert(exppop1 == (MaxPop1))
-
-// Handle linear leaf overflow (cascade):  Splay or compress into smaller
-// leaves:
-
-#define JU_LEAFCASCADE(MaxPop1,Cascade,Free)            \
-        if (Cascade(Pjp, Pjpm) == -1) return(-1);       \
-        Free(PjllRaw, MaxPop1, Pjpm);                   \
-        goto ContinueInsWalk
-
-// Wrapper around all of the above:
-
-#define JU_LEAFSET(cIS,Type,MaxPop1,Search,GrowInPlace,InsertInPlace,   \
-                   InsertCopy,Cascade,Alloc,Free,ValueArea)             \
-        {                                                               \
-            JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea);                    \
-            JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace,  \
-                        InsertInPlace,InsertCopy,Alloc,Free);           \
-            JU_LEAFCASCADE(MaxPop1,Cascade,Free);                       \
-        }
-
-// END OF MACROS; LEAFL CASES START HERE:
-//
-// 64-bit Judy1 does not have 1-byte leaves:
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-        case cJU_JPLEAF1:
-
-            JU_LEAFSET(1, uint8_t *, cJU_LEAF1_MAXPOP1, j__udySearchLeaf1,
-                       JU_LEAF1GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY,
-                       j__udyCascade1, j__udyAllocJLL1, j__udyFreeJLL1,
-                       JL_LEAF1VALUEAREA);
-
-#endif // (JUDYL || ! JU_64BIT)
-
-        case cJU_JPLEAF2:
-
-            JU_LEAFSET(2, uint16_t *, cJU_LEAF2_MAXPOP1, j__udySearchLeaf2,
-                       JU_LEAF2GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY,
-                       j__udyCascade2, j__udyAllocJLL2, j__udyFreeJLL2,
-                       JL_LEAF2VALUEAREA);
-
-        case cJU_JPLEAF3:
-
-            JU_LEAFSET(3, uint8_t *, cJU_LEAF3_MAXPOP1, j__udySearchLeaf3,
-                       JU_LEAF3GROWINPLACE, JU_INSERTINPLACE3, JU_INSERTCOPY3,
-                       j__udyCascade3, j__udyAllocJLL3, j__udyFreeJLL3,
-                       JL_LEAF3VALUEAREA);
-
-#ifdef JU_64BIT
-        case cJU_JPLEAF4:
-
-            JU_LEAFSET(4, uint32_t *, cJU_LEAF4_MAXPOP1, j__udySearchLeaf4,
-                       JU_LEAF4GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY,
-                       j__udyCascade4, j__udyAllocJLL4, j__udyFreeJLL4,
-                       JL_LEAF4VALUEAREA);
-
-        case cJU_JPLEAF5:
-
-            JU_LEAFSET(5, uint8_t *, cJU_LEAF5_MAXPOP1, j__udySearchLeaf5,
-                       JU_LEAF5GROWINPLACE, JU_INSERTINPLACE5, JU_INSERTCOPY5,
-                       j__udyCascade5, j__udyAllocJLL5, j__udyFreeJLL5,
-                       JL_LEAF5VALUEAREA);
-
-        case cJU_JPLEAF6:
-
-            JU_LEAFSET(6, uint8_t *, cJU_LEAF6_MAXPOP1, j__udySearchLeaf6,
-                       JU_LEAF6GROWINPLACE, JU_INSERTINPLACE6, JU_INSERTCOPY6,
-                       j__udyCascade6, j__udyAllocJLL6, j__udyFreeJLL6,
-                       JL_LEAF6VALUEAREA);
-
-        case cJU_JPLEAF7:
-
-            JU_LEAFSET(7, uint8_t *, cJU_LEAF7_MAXPOP1, j__udySearchLeaf7,
-                       JU_LEAF7GROWINPLACE, JU_INSERTINPLACE7, JU_INSERTCOPY7,
-                       j__udyCascade7, j__udyAllocJLL7, j__udyFreeJLL7,
-                       JL_LEAF7VALUEAREA);
-#endif // JU_64BIT
-
-
-// ****************************************************************************
-// JPLEAF_B1:
-//
-// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
-//              |SubExpanse |    Bit offset     |
-//
-// Note:  For JudyL, values are stored in 8 subexpanses, each a linear word
-// array of up to 32 values each.
-
-        case cJU_JPLEAF_B1:
-        {
-#ifdef JUDYL
-            Pjv_t     PjvRaw;           // pointer to value part of the leaf.
-            Pjv_t     Pjv;              // pointer to value part of the leaf.
-            Pjv_t     PjvnewRaw;        // new value area.
-            Pjv_t     Pjvnew;           // new value area.
-            Word_t    subexp;           // 1 of 8 subexpanses in bitmap.
-            Pjlb_t    Pjlb;             // pointer to bitmap part of the leaf.
-            BITMAPL_t bitmap;           // for one subexpanse.
-            BITMAPL_t bitmask;          // bit set for Indexs digit.
-            int       offset;           // of index in value area.
-#endif
-
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm);
-
-#ifdef JUDY1
-
-// If Index (bit) is already set, return now:
-
-            if (JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)) return(0);
-
-// If bitmap is not full, set the new Indexs bit; otherwise convert to a Full:
-
-            if ((exppop1 = JU_JPLEAF_POP0(Pjp) + 1)
-              < cJU_JPFULLPOPU1_POP0)
-            {
-                JU_BITMAPSETL(P_JLB(Pjp->jp_Addr), Index);
-            }
-            else
-            {
-                j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm);  // free LeafB1.
-                Pjp->jp_Type = cJ1_JPFULLPOPU1;
-                Pjp->jp_Addr = 0;
-            }
-
-#else // JUDYL
-
-// This is very different from Judy1 because of the need to return a value area
-// even for an existing Index, or manage the value area for a new Index, and
-// because JudyL has no Full type:
-
-// Get last byte to decode from Index, and pointer to bitmap leaf:
-
-            digit = JU_DIGITATSTATE(Index, 1);
-            Pjlb  = P_JLB(Pjp->jp_Addr);
-
-// Prepare additional values:
-
-            subexp  = digit / cJU_BITSPERSUBEXPL;       // which subexpanse.
-            bitmap  = JU_JLB_BITMAP(Pjlb, subexp);      // subexps 32-bit map.
-            PjvRaw  = JL_JLB_PVALUE(Pjlb, subexp);      // corresponding values.
-            Pjv     = P_JV(PjvRaw);                     // corresponding values.
-            bitmask = JU_BITPOSMASKL(digit);            // mask for Index.
-            offset  = j__udyCountBitsL(bitmap & (bitmask - 1)); // of Index.
-
-// If Index already exists, get value pointer and exit:
-
-            if (bitmap & bitmask)
-            {
-                assert(Pjv);
-                Pjpm->jpm_PValue = Pjv + offset;        // existing value.
-                return(0);
-            }
-
-// Get the total bits set = expanse population of Value area:
-
-            exppop1 = j__udyCountBitsL(bitmap);
-
-// If the value area can grow in place, do it:
-
-            if (JL_LEAFVGROWINPLACE(exppop1))
-            {
-                JU_INSERTINPLACE(Pjv, exppop1, offset, 0);
-                JU_JLB_BITMAP(Pjlb, subexp) |= bitmask;  // set Indexs bit.
-                Pjpm->jpm_PValue = Pjv + offset;          // new value area.
-                return(1);
-            }
-
-// Increase size of value area:
-
-            if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm))
-             == (Pjv_t) NULL) return(-1);
-            Pjvnew = P_JV(PjvnewRaw);
-
-            if (exppop1)                // have existing value area.
-            {
-                assert(Pjv);
-                JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0);
-                Pjpm->jpm_PValue = Pjvnew + offset;
-                j__udyLFreeJV(PjvRaw, exppop1, Pjpm);   // free old values.
-            }
-            else                        // first index, new value area:
-            {
-                 Pjpm->jpm_PValue   = Pjvnew;
-                *(Pjpm->jpm_PValue) = 0;
-            }
-
-// Set bit for new Index and place new leaf value area in bitmap:
-
-            JU_JLB_BITMAP(Pjlb, subexp) |= bitmask;
-            JL_JLB_PVALUE(Pjlb, subexp)  = PjvnewRaw;
-
-#endif // JUDYL
-
-            return(1);
-
-        } // case
-
-
-#ifdef JUDY1
-// ****************************************************************************
-// JPFULLPOPU1:
-//
-// If Index is not an outlier, then by definition its already set.
-
-        case cJ1_JPFULLPOPU1:
-
-            JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm);
-            return(0);
-#endif
-
-
-// ****************************************************************************
-// JPIMMED*:
-//
-// This is some of the most complex code in Judy considering Judy1 versus JudyL
-// and 32-bit versus 64-bit variations.  The following comments attempt to make
-// this clearer.
-//
-// Of the 2 words in a JP, for immediate indexes Judy1 can use 2 words - 1 byte
-// = 7 [15] bytes, but JudyL can only use 1 word - 1 byte = 3 [7] bytes because
-// the other word is needed for a value area or a pointer to a value area.
-//
-// For both Judy1 and JudyL, cJU_JPIMMED_*_01 indexes are in word 2; otherwise
-// for Judy1 only, a list of 2 or more indexes starts in word 1.  JudyL keeps
-// the list in word 2 because word 1 is a pointer (to a LeafV, that is, a leaf
-// containing only values).  Furthermore, cJU_JPIMMED_*_01 indexes are stored
-// all-but-first-byte in jp_DcdPopO, not just the Index Sizes bytes.
-//
-// TBD:  This can be confusing because Doug didnt use data structures for it.
-// Instead he often directly accesses Pjp for the first word and jp_DcdPopO for
-// the second word.  It would be nice to use data structs, starting with
-// jp_1Index and jp_LIndex where possible.
-//
-// Maximum Immed JP types for Judy1/JudyL, depending on Index Size (cIS):
-//
-//          32-bit  64-bit
-//
-//    bytes:  7/ 3   15/ 7   (Judy1/JudyL)
-//
-//    cIS
-//    1_     07/03   15/07   (as in: cJ1_JPIMMED_1_07)
-//    2_     03/01   07/03
-//    3_     02/01   05/02
-//    4_             03/01
-//    5_             03/01
-//    6_             02/01
-//    7_             02/01
-//
-// State transitions while inserting an Index, matching the above table:
-// (Yes, this is very terse...  Study it and it will make sense.)
-// (Note, parts of this diagram are repeated below for quick reference.)
-//
-//      +-- reformat JP here for Judy1 only, from word-2 to word-1
-//      |
-//      |                  JUDY1 || JU_64BIT        JUDY1 && JU_64BIT
-//      V
-// 1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] Leaf1 (*)
-// 2_01 =>                 [ 2_02 => 2_03 =>        [ 2_04..07 => ]] Leaf2
-// 3_01 =>                 [ 3_02 =>                [ 3_03..05 => ]] Leaf3
-// JU_64BIT only:
-// 4_01 =>                                         [[ 4_02..03 => ]] Leaf4
-// 5_01 =>                                         [[ 5_02..03 => ]] Leaf5
-// 6_01 =>                                         [[ 6_02     => ]] Leaf6
-// 7_01 =>                                         [[ 7_02     => ]] Leaf7
-//
-// (*) For Judy1 & 64-bit, go directly from cJU_JPIMMED_1_15 to a LeafB1; skip
-//     Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1.
-
-
-// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW:
-//
-// These are necessary to support performance by function and loop unrolling
-// while avoiding huge amounts of nearly identical code.
-//
-// The differences between Judy1 and JudyL with respect to value area handling
-// are just too large for completely common code between them...  Oh well, some
-// big ifdefs follow.  However, even in the following ifdefd code, use cJU_*,
-// JU_*, and Judy*() instead of cJ1_* / cJL_*, J1_* / JL_*, and
-// Judy1*()/JudyL*(), for minimum diffs.
-//
-// Handle growth of cJU_JPIMMED_*_01 to cJU_JPIMMED_*_02, for an even or odd
-// Index Size (cIS), given oldIndex, Index, and Pjll in the context:
-//
-// Put oldIndex and Index in their proper order.  For odd indexes, must copy
-// bytes.
-
-#ifdef JUDY1
-
-#define JU_IMMSET_01_COPY_EVEN(ignore1,ignore2) \
-        if (oldIndex < Index) { Pjll[0] = oldIndex; Pjll[1] = Index;    } \
-        else                  { Pjll[0] = Index;    Pjll[1] = oldIndex; }
-
-#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord)     \
-        if (oldIndex < Index)                   \
-        {                                       \
-            CopyWord(Pjll + 0,     oldIndex);   \
-            CopyWord(Pjll + (cIS), Index);      \
-        }                                       \
-        else                                    \
-        {                                       \
-            CopyWord(Pjll + 0,    Index);       \
-            CopyWord(Pjll + (cIS), oldIndex);   \
-        }
-
-// The "real" *_01 Copy macro:
-//
-// Trim the high byte off Index, look for a match with the old Index, and if
-// none, insert the new Index in the leaf in the correct place, given Pjp and
-// Index in the context.
-//
-// Note:  A single immediate index lives in the jp_DcdPopO field, but two or
-// more reside starting at Pjp->jp_1Index.
-
-#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \
-        {                                                       \
-            LeafType Pjll;                                      \
-            Word_t   oldIndex = JU_JPDCDPOP0(Pjp);              \
-                                                                \
-            Index = JU_TRIMTODCDSIZE(Index);                    \
-            if (oldIndex == Index) return(0);                   \
-                                                                \
-            Pjll = (LeafType) (Pjp->jp_1Index);                 \
-            Copy(cIS,CopyWord);                                 \
-            DBGCODE(JudyCheckSorted(Pjll, 2, cIS);)             \
-                                                                \
-            Pjp->jp_Type = (NewJPType);                         \
-            return(1);                                          \
-        }
-
-#else // JUDYL
-
-// Variations to also handle value areas; see comments above:
-//
-// For JudyL, Pjv (start of value area) and oldValue are also in the context;
-// leave Pjv set to the value area for Index.
-
-#define JU_IMMSET_01_COPY_EVEN(cIS,CopyWord)    \
-        if (oldIndex < Index)                   \
-        {                                       \
-            Pjll[0] = oldIndex;                 \
-            Pjv [0] = oldValue;                 \
-            Pjll[1] = Index;                    \
-            ++Pjv;                              \
-        }                                       \
-        else                                    \
-        {                                       \
-            Pjll[0] = Index;                    \
-            Pjll[1] = oldIndex;                 \
-            Pjv [1] = oldValue;                 \
-        }
-
-#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord)     \
-        if (oldIndex < Index)                   \
-        {                                       \
-            CopyWord(Pjll + 0,     oldIndex);   \
-            CopyWord(Pjll + (cIS), Index);      \
-            Pjv[0] = oldValue;                  \
-            ++Pjv;                              \
-        }                                       \
-        else                                    \
-        {                                       \
-            CopyWord(Pjll + 0,    Index);       \
-            CopyWord(Pjll + (cIS), oldIndex);   \
-            Pjv[1] = oldValue;                  \
-        }
-
-// The old value area is in the first word (*Pjp), and Pjv and Pjpm are also in
-// the context.  Also, unlike Judy1, indexes remain in word 2 (jp_LIndex),
-// meaning insert-in-place rather than copy.
-//
-// Return jpm_PValue pointing to Indexs value area.  If Index is new, allocate
-// a 2-value-leaf and attach it to the JP.
-
-#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \
-        {                                                       \
-            LeafType Pjll;                                      \
-            Word_t   oldIndex = JU_JPDCDPOP0(Pjp);              \
-            Word_t   oldValue;                                  \
-            Pjv_t    PjvRaw;                                    \
-            Pjv_t    Pjv;                                       \
-                                                                \
-            Index = JU_TRIMTODCDSIZE(Index);                    \
-                                                                \
-            if (oldIndex == Index)                              \
-            {                                                   \
-                Pjpm->jpm_PValue = (Pjv_t) Pjp;                 \
-                return(0);                                      \
-            }                                                   \
-                                                                \
-            if ((PjvRaw = j__udyLAllocJV(2, Pjpm)) == (Pjv_t) NULL) \
-                return(-1);                                     \
-            Pjv = P_JV(PjvRaw);                                 \
-                                                                \
-            oldValue       = Pjp->jp_Addr;                      \
-            (Pjp->jp_Addr) = (Word_t) PjvRaw;                   \
-            Pjll           = (LeafType) (Pjp->jp_LIndex);       \
-                                                                \
-            Copy(cIS,CopyWord);                                 \
-            DBGCODE(JudyCheckSorted(Pjll, 2, cIS);)             \
-                                                                \
-            Pjp->jp_Type   = (NewJPType);                       \
-            *Pjv             = 0;                               \
-            Pjpm->jpm_PValue = Pjv;                             \
-            return(1);                                          \
-        }
-
-// The following is a unique mix of JU_IMMSET_01() and JU_IMMSETCASCADE() for
-// going from cJU_JPIMMED_*_01 directly to a cJU_JPLEAF* for JudyL:
-//
-// If Index is not already set, allocate a leaf, copy the old and new indexes
-// into it, clear and return the new value area, and modify the current JP.
-// Note that jp_DcdPop is set to a pop0 of 0 for now, and incremented later.
-
-
-#define JU_IMMSET_01_CASCADE(cIS,LeafType,NewJPType,ValueArea,  \
-                             Copy,CopyWord,Alloc)               \
-        {                                                       \
-            Word_t   D_P0;                                      \
-            LeafType PjllRaw;                                   \
-            LeafType Pjll;                                      \
-            Word_t   oldIndex = JU_JPDCDPOP0(Pjp);              \
-            Word_t   oldValue;                                  \
-            Pjv_t    Pjv;                                       \
-                                                                \
-            Index = JU_TRIMTODCDSIZE(Index);                    \
-                                                                \
-            if (oldIndex == Index)                              \
-            {                                                   \
-                Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr));   \
-                return(0);                                      \
-            }                                                   \
-                                                                \
-            if ((PjllRaw = (LeafType) Alloc(2, Pjpm)) == (LeafType) NULL) \
-                return(-1);                                     \
-            Pjll = (LeafType) P_JLL(PjllRaw);                   \
-            Pjv  = ValueArea(Pjll, 2);                          \
-                                                                \
-            oldValue = Pjp->jp_Addr;                            \
-                                                                \
-            Copy(cIS,CopyWord);                                 \
-            DBGCODE(JudyCheckSorted(Pjll, 2, cIS);)             \
-                                                                \
-            *Pjv = 0;                                           \
-            Pjpm->jpm_PValue  = Pjv;                            \
-            D_P0 = Index & cJU_DCDMASK(cIS); /* pop0 = 0 */     \
-            JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \
-                                                                \
-            return(1);                                          \
-        }
-
-#endif // JUDYL
-
-// Handle growth of cJU_JPIMMED_*_[02..15]:
-
-#ifdef JUDY1
-
-// Insert an Index into an immediate JP that has room for more, if the Index is
-// not already present; given Pjp, Index, exppop1, Pjv, and Pjpm in the
-// context:
-//
-// Note:  Use this only when the JP format doesnt change, that is, going from
-// cJU_JPIMMED_X_0Y to cJU_JPIMMED_X_0Z, where X >= 2 and Y+1 = Z.
-//
-// Note:  Incrementing jp_Type is how to increase the Index population.
-
-#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \
-        {                                                               \
-            LeafType Pjll;                                              \
-            int      offset;                                            \
-                                                                        \
-            exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2;             \
-            offset  = Search((Pjll_t) (Pjp->jp_1Index), exppop1, Index); \
-                                                                        \
-            JU_CHECK_IF_EXISTS(offset, ignore, Pjpm);                   \
-                                                                        \
-            Pjll = (LeafType) (Pjp->jp_1Index);                         \
-            InsertInPlace(Pjll, exppop1, offset, Index);                \
-            DBGCODE(JudyCheckSorted(Pjll, exppop1 + 1, cIS);)           \
-            ++(Pjp->jp_Type);                                           \
-            return(1);                                                  \
-        }
-
-// Insert an Index into an immediate JP that has no room for more:
-//
-// If the Index is not already present, do a cascade (to a leaf); given Pjp,
-// Index, Pjv, and Pjpm in the context.
-
-
-#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType,                \
-                         ignore,Search,InsertCopy,Alloc)                \
-        {                                                               \
-            Word_t   D_P0;                                              \
-            Pjll_t PjllRaw;                                             \
-            Pjll_t Pjll;                                                \
-            int    offset;                                              \
-                                                                        \
-            offset = Search((Pjll_t) (Pjp->jp_1Index), (OldPop1), Index); \
-            JU_CHECK_IF_EXISTS(offset, ignore, Pjpm);                   \
-                                                                        \
-            if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) return(-1); \
-            Pjll = P_JLL(PjllRaw);                                      \
-                                                                        \
-            InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_1Index),    \
-                       OldPop1, offset, Index);                         \
-            DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);)         \
-                                                                        \
-            D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1;          \
-            JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType);         \
-            return(1);                                                  \
-        }
-
-#else // JUDYL
-
-// Variations to also handle value areas; see comments above:
-//
-// For JudyL, Pjv (start of value area) is also in the context.
-//
-// TBD:  This code makes a true but weak assumption that a JudyL 32-bit 2-index
-// value area must be copied to a new 3-index value area.  AND it doesnt know
-// anything about JudyL 64-bit cases (cJU_JPIMMED_1_0[3-7] only) where the
-// value area can grow in place!  However, this should not break it, just slow
-// it down.
-
-#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \
-        {                                                                 \
-            LeafType Pleaf;                                               \
-            int      offset;                                              \
-            Pjv_t    PjvRaw;                                              \
-            Pjv_t    Pjv;                                                 \
-            Pjv_t    PjvnewRaw;                                           \
-            Pjv_t    Pjvnew;                                              \
-                                                                          \
-            exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2;               \
-            offset  = Search((Pjll_t) (Pjp->jp_LIndex), exppop1, Index);  \
-            PjvRaw  = (Pjv_t) (Pjp->jp_Addr);                             \
-            Pjv     = P_JV(PjvRaw);                                       \
-                                                                          \
-            JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm);                        \
-                                                                          \
-            if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm))           \
-             == (Pjv_t) NULL) return(-1);                                 \
-            Pjvnew = P_JV(PjvnewRaw);                                     \
-                                                                          \
-            Pleaf = (LeafType) (Pjp->jp_LIndex);                          \
-                                                                          \
-            InsertInPlace(Pleaf, exppop1, offset, Index);                 \
-            /* see TBD above about this: */                               \
-            JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0);               \
-            DBGCODE(JudyCheckSorted(Pleaf, exppop1 + 1, cIS);)            \
-            j__udyLFreeJV(PjvRaw, exppop1, Pjpm);                         \
-            Pjp->jp_Addr     = (Word_t) PjvnewRaw;                        \
-            Pjpm->jpm_PValue = Pjvnew + offset;                           \
-                                                                          \
-            ++(Pjp->jp_Type);                                             \
-            return(1);                                                    \
-        }
-
-#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType,                \
-                         ValueArea,Search,InsertCopy,Alloc)             \
-        {                                                               \
-            Word_t   D_P0;                                      \
-            Pjll_t PjllRaw;                                             \
-            Pjll_t Pjll;                                                \
-            int    offset;                                              \
-            Pjv_t  PjvRaw;                                              \
-            Pjv_t  Pjv;                                                 \
-            Pjv_t  Pjvnew;                                              \
-                                                                        \
-            PjvRaw = (Pjv_t) (Pjp->jp_Addr);                            \
-            Pjv    = P_JV(PjvRaw);                                      \
-            offset = Search((Pjll_t) (Pjp->jp_LIndex), (OldPop1), Index); \
-            JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm);                      \
-                                                                        \
-            if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0)            \
-                return(-1);                                             \
-            Pjll = P_JLL(PjllRaw);                                      \
-            InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_LIndex),    \
-                       OldPop1, offset, Index);                         \
-            DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);)         \
-                                                                        \
-            Pjvnew = ValueArea(Pjll, (OldPop1) + 1);                    \
-            JU_INSERTCOPY(Pjvnew, Pjv, OldPop1, offset, 0);             \
-            j__udyLFreeJV(PjvRaw, (OldPop1), Pjpm);                     \
-            Pjpm->jpm_PValue = Pjvnew + offset;                         \
-                                                                        \
-            D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1;          \
-            JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType);         \
-            return(1);                                                  \
-        }
-
-#endif // JUDYL
-
-// Common convenience/shorthand wrappers around JU_IMMSET_01_COPY() for
-// even/odd index sizes:
-
-#define JU_IMMSET_01(     cIS, LeafType, NewJPType) \
-        JU_IMMSET_01_COPY(cIS, LeafType, NewJPType, JU_IMMSET_01_COPY_EVEN, \
-                          ignore)
-
-#define JU_IMMSET_01_ODD( cIS,            NewJPType, CopyWord) \
-        JU_IMMSET_01_COPY(cIS, uint8_t *, NewJPType, JU_IMMSET_01_COPY_ODD, \
-                          CopyWord)
-
-
-// END OF MACROS; IMMED CASES START HERE:
-
-// cJU_JPIMMED_*_01 cases:
-//
-// 1_01 always leads to 1_02:
-//
-// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL)
-
-        case cJU_JPIMMED_1_01: JU_IMMSET_01(1, uint8_t *, cJU_JPIMMED_1_02);
-
-// 2_01 leads to 2_02, and 3_01 leads to 3_02, except for JudyL 32-bit, where
-// they lead to a leaf:
-//
-// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL)
-// (3_01 => [ 3_02 =>         [ 3_03..05 => ]] LeafL)
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_2_01: JU_IMMSET_01(2, uint16_t *, cJU_JPIMMED_2_02);
-        case cJU_JPIMMED_3_01: JU_IMMSET_01_ODD (3, cJU_JPIMMED_3_02,
-                                                 JU_COPY3_LONG_TO_PINDEX);
-#else
-        case cJU_JPIMMED_2_01:
-            JU_IMMSET_01_CASCADE(2, uint16_t *, cJU_JPLEAF2, JL_LEAF2VALUEAREA,
-                                 JU_IMMSET_01_COPY_EVEN, ignore,
-                                 j__udyAllocJLL2);
-        case cJU_JPIMMED_3_01:
-            JU_IMMSET_01_CASCADE(3, uint8_t *,  cJU_JPLEAF3, JL_LEAF3VALUEAREA,
-                                 JU_IMMSET_01_COPY_ODD,
-                                 JU_COPY3_LONG_TO_PINDEX, j__udyAllocJLL3);
-#endif
-
-#ifdef JU_64BIT
-
-// [4-7]_01 lead to [4-7]_02 for Judy1, and to leaves for JudyL:
-//
-// (4_01 => [[ 4_02..03 => ]] LeafL)
-// (5_01 => [[ 5_02..03 => ]] LeafL)
-// (6_01 => [[ 6_02 =>     ]] LeafL)
-// (7_01 => [[ 7_02 =>     ]] LeafL)
-
-#ifdef JUDY1
-        case cJU_JPIMMED_4_01: JU_IMMSET_01(4, uint32_t *, cJ1_JPIMMED_4_02);
-        case cJU_JPIMMED_5_01: JU_IMMSET_01_ODD(5, cJ1_JPIMMED_5_02,
-                                                JU_COPY5_LONG_TO_PINDEX);
-        case cJU_JPIMMED_6_01: JU_IMMSET_01_ODD(6, cJ1_JPIMMED_6_02,
-                                                JU_COPY6_LONG_TO_PINDEX);
-        case cJU_JPIMMED_7_01: JU_IMMSET_01_ODD(7, cJ1_JPIMMED_7_02,
-                                                JU_COPY7_LONG_TO_PINDEX);
-#else // JUDYL
-        case cJU_JPIMMED_4_01:
-            JU_IMMSET_01_CASCADE(4, uint32_t *, cJU_JPLEAF4, JL_LEAF4VALUEAREA,
-                                 JU_IMMSET_01_COPY_EVEN, ignore,
-                                 j__udyAllocJLL4);
-        case cJU_JPIMMED_5_01:
-            JU_IMMSET_01_CASCADE(5, uint8_t *, cJU_JPLEAF5, JL_LEAF5VALUEAREA,
-                                 JU_IMMSET_01_COPY_ODD,
-                                 JU_COPY5_LONG_TO_PINDEX, j__udyAllocJLL5);
-        case cJU_JPIMMED_6_01:
-            JU_IMMSET_01_CASCADE(6, uint8_t *, cJU_JPLEAF6, JL_LEAF6VALUEAREA,
-                                 JU_IMMSET_01_COPY_ODD,
-                                 JU_COPY6_LONG_TO_PINDEX, j__udyAllocJLL6);
-        case cJU_JPIMMED_7_01:
-            JU_IMMSET_01_CASCADE(7, uint8_t *, cJU_JPLEAF7, JL_LEAF7VALUEAREA,
-                                 JU_IMMSET_01_COPY_ODD,
-                                 JU_COPY7_LONG_TO_PINDEX, j__udyAllocJLL7);
-#endif // JUDYL
-#endif // JU_64BIT
-
-// cJU_JPIMMED_1_* cases that can grow in place:
-//
-// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL)
-
-        case cJU_JPIMMED_1_02:
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_1_03:
-        case cJU_JPIMMED_1_04:
-        case cJU_JPIMMED_1_05:
-        case cJU_JPIMMED_1_06:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJU_JPIMMED_1_07:
-        case cJ1_JPIMMED_1_08:
-        case cJ1_JPIMMED_1_09:
-        case cJ1_JPIMMED_1_10:
-        case cJ1_JPIMMED_1_11:
-        case cJ1_JPIMMED_1_12:
-        case cJ1_JPIMMED_1_13:
-        case cJ1_JPIMMED_1_14:
-#endif
-            JU_IMMSETINPLACE(1, uint8_t *, cJU_JPIMMED_1_02, j__udySearchLeaf1,
-                             JU_INSERTINPLACE);
-
-// cJU_JPIMMED_1_* cases that must cascade:
-//
-// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL)
-
-#if (defined(JUDYL) && (! defined(JU_64BIT)))
-        case cJU_JPIMMED_1_03:
-            JU_IMMSETCASCADE(1, 3, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA,
-                             j__udySearchLeaf1, JU_INSERTCOPY,
-                             j__udyAllocJLL1);
-#endif
-#if (defined(JUDY1) && (! defined(JU_64BIT)))
-        case cJU_JPIMMED_1_07:
-            JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, ignore,
-                             j__udySearchLeaf1, JU_INSERTCOPY,
-                             j__udyAllocJLL1);
-
-#endif
-#if (defined(JUDYL) && defined(JU_64BIT))
-        case cJU_JPIMMED_1_07:
-            JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA,
-                             j__udySearchLeaf1, JU_INSERTCOPY,
-                             j__udyAllocJLL1);
-
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-// Special case, as described above, go directly from Immed to LeafB1:
-
-        case cJ1_JPIMMED_1_15:
-        {
-            Word_t DcdP0;
-            int    offset;
-            Pjlb_t PjlbRaw;
-            Pjlb_t Pjlb;
-
-            offset = j__udySearchLeaf1((Pjll_t) Pjp->jp_1Index, 15, Index);
-
-            JU_CHECK_IF_EXISTS(offset, ignore, Pjpm);
-
-// Create a bitmap leaf (special case for Judy1 64-bit only, see usage):  Set
-// new Index in bitmap, copy an Immed1_15 to the bitmap, and set the parent JP
-// EXCEPT jp_DcdPopO, leaving any followup to the caller:
-
-            if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL)
-                return(-1);
-            Pjlb = P_JLB(PjlbRaw);
-
-            JU_BITMAPSETL(Pjlb, Index);
-
-            for (offset = 0; offset < 15; ++offset)
-                JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]);
-
-//          Set jp_DcdPopO including the current pop0; incremented later:
-            DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1;
-            JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1);
-
-            return(1);
-        }
-#endif
-
-// cJU_JPIMMED_[2..7]_[02..15] cases that grow in place or cascade:
-//
-// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL)
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-        case cJU_JPIMMED_2_02:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJU_JPIMMED_2_03:
-        case cJ1_JPIMMED_2_04:
-        case cJ1_JPIMMED_2_05:
-        case cJ1_JPIMMED_2_06:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-            JU_IMMSETINPLACE(2, uint16_t *, cJU_JPIMMED_2_02, j__udySearchLeaf2,
-                             JU_INSERTINPLACE);
-#endif
-
-#undef OLDPOP1
-#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT)))
-        case cJU_JPIMMED_2_03:
-#define OLDPOP1 3
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_2_07:
-#define OLDPOP1 7
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-            JU_IMMSETCASCADE(2, OLDPOP1, uint16_t *, cJU_JPLEAF2,
-                             JL_LEAF2VALUEAREA, j__udySearchLeaf2,
-                             JU_INSERTCOPY, j__udyAllocJLL2);
-#endif
-
-// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL)
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJU_JPIMMED_3_02:
-        case cJ1_JPIMMED_3_03:
-        case cJ1_JPIMMED_3_04:
-
-            JU_IMMSETINPLACE(3, uint8_t *, cJU_JPIMMED_3_02, j__udySearchLeaf3,
-                             JU_INSERTINPLACE3);
-#endif
-
-#undef OLDPOP1
-#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT)))
-        case cJU_JPIMMED_3_02:
-#define OLDPOP1 2
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-        case cJ1_JPIMMED_3_05:
-#define OLDPOP1 5
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-            JU_IMMSETCASCADE(3, OLDPOP1, uint8_t *, cJU_JPLEAF3,
-                             JL_LEAF3VALUEAREA, j__udySearchLeaf3,
-                             JU_INSERTCOPY3, j__udyAllocJLL3);
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-
-// (4_01 => [[ 4_02..03 => ]] LeafL)
-
-        case cJ1_JPIMMED_4_02:
-
-            JU_IMMSETINPLACE(4, uint32_t *, cJ1_JPIMMED_4_02, j__udySearchLeaf4,
-                             JU_INSERTINPLACE);
-
-        case cJ1_JPIMMED_4_03:
-
-            JU_IMMSETCASCADE(4, 3, uint32_t *, cJU_JPLEAF4, ignore,
-                             j__udySearchLeaf4, JU_INSERTCOPY,
-                             j__udyAllocJLL4);
-
-// (5_01 => [[ 5_02..03 => ]] LeafL)
-
-        case cJ1_JPIMMED_5_02:
-
-            JU_IMMSETINPLACE(5, uint8_t *, cJ1_JPIMMED_5_02, j__udySearchLeaf5,
-                             JU_INSERTINPLACE5);
-
-        case cJ1_JPIMMED_5_03:
-
-            JU_IMMSETCASCADE(5, 3, uint8_t *, cJU_JPLEAF5, ignore,
-                             j__udySearchLeaf5, JU_INSERTCOPY5,
-                             j__udyAllocJLL5);
-
-// (6_01 => [[ 6_02 => ]] LeafL)
-
-        case cJ1_JPIMMED_6_02:
-
-            JU_IMMSETCASCADE(6, 2, uint8_t *, cJU_JPLEAF6, ignore,
-                             j__udySearchLeaf6, JU_INSERTCOPY6,
-                             j__udyAllocJLL6);
-
-// (7_01 => [[ 7_02 => ]] LeafL)
-
-        case cJ1_JPIMMED_7_02:
-
-            JU_IMMSETCASCADE(7, 2, uint8_t *, cJU_JPLEAF7, ignore,
-                             j__udySearchLeaf7, JU_INSERTCOPY7,
-                             j__udyAllocJLL7);
-
-#endif // (JUDY1 && JU_64BIT)
-
-
-// ****************************************************************************
-// INVALID JP TYPE:
-
-        default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1);
-
-        } // switch on JP type
-
-        {
-
-#ifdef SUBEXPCOUNTS
-
-// This code might seem strange here.  However it saves some memory read time
-// during insert (~70nS) because a pipelined processor does not need to "stall"
-// waiting for the memory read to complete.  Hope the compiler is not too smart
-// or dumb and moves the code down to where it looks like it belongs (below a
-// few lines).
-
-            Word_t SubExpCount = 0;     // current subexpanse counter.
-
-            if (PSubExp != (PWord_t) NULL)      // only if BranchB/U.
-                SubExpCount = PSubExp[0];
-#endif
-
-// PROCESS JP -- RECURSIVELY:
-//
-// For non-Immed JP types, if successful, post-increment the population count
-// at this Level.
-
-            retcode = j__udyInsWalk(Pjp, Index, Pjpm);
-
-// Successful insert, increment JP and subexpanse count:
-
-            if ((JU_JPTYPE(Pjp) < cJU_JPIMMED_1_01) && (retcode == 1))
-            {
-                jp_t   JP;
-                Word_t DcdP0;
-#ifdef SUBEXPCOUNTS
-
-// Note:  Pjp must be a pointer to a BranchB/U:
-
-                if (PSubExp != (PWord_t) NULL) PSubExp[0] = SubExpCount + 1;
-#endif
-
-                JP = *Pjp;
-                DcdP0 = JU_JPDCDPOP0(Pjp) + 1;
-                JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP));
-            }
-        }
-        return(retcode);
-
-} // j__udyInsWalk()
-
-
-// ****************************************************************************
-// J U D Y   1   S E T
-// J U D Y   L   I N S
-//
-// Main entry point.  See the manual entry for details.
-
-#ifdef JUDY1
-FUNCTION int Judy1Set
-#else
-FUNCTION PPvoid_t JudyLIns
-#endif
-        (
-        PPvoid_t  PPArray,      // in which to insert.
-        Word_t    Index,        // to insert.
-        PJError_t PJError       // optional, for returning error info.
-        )
-{
-#ifdef JUDY1
-#define Pjv       ignore        // placeholders for macros.
-#define Pjvnew    ignore
-#else
-        Pjv_t     Pjv;          // value area in old leaf.
-        Pjv_t     Pjvnew;       // value area in new leaf.
-#endif
-        Pjpm_t    Pjpm;         // array-global info.
-        int       offset;       // position in which to store new Index.
-        Pjlw_t    Pjlw;
-
-
-// CHECK FOR NULL POINTER (error by caller):
-
-        if (PPArray == (PPvoid_t) NULL)
-        {
-            JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-            JUDY1CODE(return(JERRI );)
-            JUDYLCODE(return(PPJERR);)
-        }
-
-        Pjlw = P_JLW(*PPArray); // first word of leaf.
-
-// ****************************************************************************
-// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAVES:
-
-// ****************************************************************************
-// JRPNULL (EMPTY ARRAY):  BUILD A LEAFW WITH ONE INDEX:
-
-// if a valid empty array (null pointer), so create an array of population == 1:
-
-        if (Pjlw == (Pjlw_t)NULL)
-        {
-            Pjlw_t Pjlwnew;
-
-            Pjlwnew = j__udyAllocJLW(1);
-            JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );)
-            JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);)
-
-            Pjlwnew[0] = 1 - 1;         // pop0 = 0.
-            Pjlwnew[1] = Index;
-
-            *PPArray = (Pvoid_t) Pjlwnew;
-            DBGCODE(JudyCheckPop(*PPArray);)
-
-  JUDY1CODE(return(1); )
-  JUDYLCODE(Pjlwnew[2] = 0; )           // value area.
-  JUDYLCODE(return((PPvoid_t) (Pjlwnew + 2)); )
-
-        }  // NULL JRP
-
-// ****************************************************************************
-// LEAFW, OTHER SIZE:
-
-        if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-        {
-            Pjlw_t Pjlwnew;
-            Word_t pop1;
-
-            Pjlw = P_JLW(*PPArray);             // first word of leaf.
-            pop1 = Pjlw[0] + 1;
-
-#ifdef JUDYL
-            Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1);
-#endif
-            offset = j__udySearchLeafW(Pjlw + 1, pop1, Index);
-
-            if (offset >= 0)            // index is already valid:
-            {
-                DBGCODE(JudyCheckPop(*PPArray);)
-                JUDY1CODE(return(0); )
-                JUDYLCODE(return((PPvoid_t) (Pjv + offset)); )
-            }
-
-            offset = ~offset;
-
-// Insert index in cases where no new memory is needed:
-
-            if (JU_LEAFWGROWINPLACE(pop1))
-            {
-                ++Pjlw[0];                      // increase population.
-
-                JU_INSERTINPLACE(Pjlw + 1, pop1, offset, Index);
-#ifdef JUDYL
-                JU_INSERTINPLACE(Pjv, pop1, offset, 0);
-#endif
-                DBGCODE(JudyCheckPop(*PPArray);)
-                DBGCODE(JudyCheckSorted(Pjlw + 1, pop1 + 1, cJU_ROOTSTATE);)
-
-      JUDY1CODE(return(1); )
-      JUDYLCODE(return((PPvoid_t) (Pjv + offset)); )
-            }
-
-// Insert index into a new, larger leaf:
-
-            if (pop1 < cJU_LEAFW_MAXPOP1)       // can grow to a larger leaf.
-            {
-                Pjlwnew = j__udyAllocJLW(pop1 + 1);
-                JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );)
-                JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);)
-
-                Pjlwnew[0] = pop1;              // set pop0 in new leaf.
-
-                JU_INSERTCOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, Index);
-#ifdef JUDYL
-                Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 + 1);
-                JU_INSERTCOPY(Pjvnew, Pjv, pop1, offset, 0);
-#endif
-                DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 + 1, cJU_ROOTSTATE);)
-
-                j__udyFreeJLW(Pjlw, pop1, NULL);
-
-                *PPArray = (Pvoid_t) Pjlwnew;
-                DBGCODE(JudyCheckPop(*PPArray);)
-
-      JUDY1CODE(return(1); )
-      JUDYLCODE(return((PPvoid_t) (Pjvnew + offset)); )
-            }
-
-            assert(pop1 == cJU_LEAFW_MAXPOP1);
-
-// Leaf at max size => cannot insert new index, so cascade instead:
-//
-// Upon cascading from a LEAFW leaf to the first branch, must allocate and
-// initialize a JPM.
-
-            Pjpm = j__udyAllocJPM();
-            JUDY1CODE(JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI );)
-            JUDYLCODE(JU_CHECKALLOC(Pjpm_t, Pjpm, PPJERR);)
-
-            (Pjpm->jpm_Pop0)       = cJU_LEAFW_MAXPOP1 - 1;
-            (Pjpm->jpm_JP.jp_Addr) = (Word_t) Pjlw;
-
-            if (j__udyCascadeL(&(Pjpm->jpm_JP), Pjpm) == -1)
-            {
-                JU_COPY_ERRNO(PJError, Pjpm);
-                JUDY1CODE(return(JERRI );)
-                JUDYLCODE(return(PPJERR);)
-            }
-
-// Note:  No need to pass Pjpm for memory decrement; LEAFW memory is never
-// counted in a JPM at all:
-
-            j__udyFreeJLW(Pjlw, cJU_LEAFW_MAXPOP1, NULL);
-            *PPArray = (Pvoid_t) Pjpm;
-
-        } // JU_LEAFW
-
-// ****************************************************************************
-// BRANCH:
-
-        {
-            int retcode;  // really only needed for Judy1, but free for JudyL.
-
-            Pjpm = P_JPM(*PPArray);
-            retcode = j__udyInsWalk(&(Pjpm->jpm_JP), Index, Pjpm);
-
-            if (retcode == -1)
-            {
-                JU_COPY_ERRNO(PJError, Pjpm);
-                JUDY1CODE(return(JERRI );)
-                JUDYLCODE(return(PPJERR);)
-            }
-
-            if (retcode ==  1) ++(Pjpm->jpm_Pop0);  // incr total array popu.
-
-            assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L)
-                || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B)
-                || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U));
-            DBGCODE(JudyCheckPop(*PPArray);)
-
-#ifdef JUDY1
-            assert((retcode == 0) || (retcode == 1));
-            return(retcode);            // == JU_RET_*_JPM().
-#else
-            assert(Pjpm->jpm_PValue != (Pjv_t) NULL);
-            return((PPvoid_t) Pjpm->jpm_PValue);
-#endif
-        }
-        /*NOTREACHED*/
-
-} // Judy1Set() / JudyLIns()
diff --git a/libs/klib/judy/JudyInsArray.c b/libs/klib/judy/JudyInsArray.c
deleted file mode 100644
index c647ea5..0000000
--- a/libs/klib/judy/JudyInsArray.c
+++ /dev/null
@@ -1,1176 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// TBD:  It would probably be faster for the caller if the JudyL version took
-// PIndex as an interleaved array of indexes and values rather than just
-// indexes with a separate values array (PValue), especially considering
-// indexes and values are copied here with for-loops anyway and not the
-// equivalent of memcpy().  All code could be revised to simply count by two
-// words for JudyL?  Supports "streaming" the data to/from disk better later?
-// In which case get rid of JU_ERRNO_NULLPVALUE, no longer needed, and simplify
-// the API to this code.
-// _________________
-
-// Judy1SetArray() and JudyLInsArray() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);)
-
-
-// IMMED AND LEAF SIZE AND BRANCH TYPE ARRAYS:
-//
-// These support fast and easy lookup by level.
-
-static uint8_t immed_maxpop1[] = {
-    0,
-    cJU_IMMED1_MAXPOP1,
-    cJU_IMMED2_MAXPOP1,
-    cJU_IMMED3_MAXPOP1,
-#ifdef JU_64BIT
-    cJU_IMMED4_MAXPOP1,
-    cJU_IMMED5_MAXPOP1,
-    cJU_IMMED6_MAXPOP1,
-    cJU_IMMED7_MAXPOP1,
-#endif
-    // note:  There are no IMMEDs for whole words.
-};
-
-static uint8_t leaf_maxpop1[] = {
-    0,
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-    cJU_LEAF1_MAXPOP1,
-#else
-    0,                                  // 64-bit Judy1 has no Leaf1.
-#endif
-    cJU_LEAF2_MAXPOP1,
-    cJU_LEAF3_MAXPOP1,
-#ifdef JU_64BIT
-    cJU_LEAF4_MAXPOP1,
-    cJU_LEAF5_MAXPOP1,
-    cJU_LEAF6_MAXPOP1,
-    cJU_LEAF7_MAXPOP1,
-#endif
-    // note:  Root-level leaves are handled differently.
-};
-
-static uint8_t branchL_JPtype[] = {
-    0,
-    0,
-    cJU_JPBRANCH_L2,
-    cJU_JPBRANCH_L3,
-#ifdef JU_64BIT
-    cJU_JPBRANCH_L4,
-    cJU_JPBRANCH_L5,
-    cJU_JPBRANCH_L6,
-    cJU_JPBRANCH_L7,
-#endif
-    cJU_JPBRANCH_L,
-};
-
-static uint8_t branchB_JPtype[] = {
-    0,
-    0,
-    cJU_JPBRANCH_B2,
-    cJU_JPBRANCH_B3,
-#ifdef JU_64BIT
-    cJU_JPBRANCH_B4,
-    cJU_JPBRANCH_B5,
-    cJU_JPBRANCH_B6,
-    cJU_JPBRANCH_B7,
-#endif
-    cJU_JPBRANCH_B,
-};
-
-static uint8_t branchU_JPtype[] = {
-    0,
-    0,
-    cJU_JPBRANCH_U2,
-    cJU_JPBRANCH_U3,
-#ifdef JU_64BIT
-    cJU_JPBRANCH_U4,
-    cJU_JPBRANCH_U5,
-    cJU_JPBRANCH_U6,
-    cJU_JPBRANCH_U7,
-#endif
-    cJU_JPBRANCH_U,
-};
-
-// Subexpanse masks are similer to JU_DCDMASK() but without the need to clear
-// the first digits bits.  Avoid doing variable shifts by precomputing a
-// lookup array.
-
-static Word_t subexp_mask[] = {
-    0,
-    ~cJU_POP0MASK(1),
-    ~cJU_POP0MASK(2),
-    ~cJU_POP0MASK(3),
-#ifdef JU_64BIT
-    ~cJU_POP0MASK(4),
-    ~cJU_POP0MASK(5),
-    ~cJU_POP0MASK(6),
-    ~cJU_POP0MASK(7),
-#endif
-};
-
-
-// FUNCTION PROTOTYPES:
-
-static bool_t j__udyInsArray(Pjp_t PjpParent, int Level, PWord_t PPop1,
-                             PWord_t PIndex,
-#ifdef JUDYL
-                             Pjv_t   PValue,
-#endif
-                             Pjpm_t  Pjpm);
-
-
-// ****************************************************************************
-// J U D Y   1   S E T   A R R A Y
-// J U D Y   L   I N S   A R R A Y
-//
-// Main entry point.  See the manual entry for external overview.
-//
-// TBD:  Until thats written, note that the function returns 1 for success or
-// JERRI for serious error, including insufficient memory to build whole array;
-// use Judy*Count() to see how many were stored, the first N of the total
-// Count.  Also, since it takes Count == Pop1, it cannot handle a full array.
-// Also, "sorted" means ascending without duplicates, otherwise you get the
-// "unsorted" error.
-//
-// The purpose of these functions is to allow rapid construction of a large
-// Judy array given a sorted list of indexes (and for JudyL, corresponding
-// values).  At least one customer saw this as useful, and probably it would
-// also be useful as a sufficient workaround for fast(er) unload/reload to/from
-// disk.
-//
-// This code is written recursively for simplicity, until/unless someone
-// decides to make it faster and more complex.  Hopefully recursion is fast
-// enough simply because the function is so much faster than a series of
-// Set/Ins calls.
-
-#ifdef JUDY1
-FUNCTION int Judy1SetArray
-#else
-FUNCTION int JudyLInsArray
-#endif
-        (
-        PPvoid_t  PPArray,      // in which to insert, initially empty.
-        Word_t    Count,        // number of indexes (and values) to insert.
-const   Word_t *  const PIndex, // list of indexes to insert.
-#ifdef JUDYL
-const   Word_t *  const PValue, // list of corresponding values.
-#endif
-        PJError_t PJError       // optional, for returning error info.
-        )
-{
-        Pjlw_t    Pjlw;         // new root-level leaf.
-        Pjlw_t    Pjlwindex;    // first index in root-level leaf.
-        int       offset;       // in PIndex.
-
-
-// CHECK FOR NULL OR NON-NULL POINTER (error by caller):
-
-        if (PPArray == (PPvoid_t) NULL)
-        { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);   return(JERRI); }
-
-        if (*PPArray != (Pvoid_t) NULL)
-        { JU_SET_ERRNO(PJError, JU_ERRNO_NONNULLPARRAY); return(JERRI); }
-
-        if (PIndex == (PWord_t) NULL)
-        { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);    return(JERRI); }
-
-#ifdef JUDYL
-        if (PValue == (PWord_t) NULL)
-        { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPVALUE);    return(JERRI); }
-#endif
-
-
-// HANDLE LARGE COUNT (= POP1) (typical case):
-//
-// Allocate and initialize a JPM, set the root pointer to point to it, and then
-// build the tree underneath it.
-
-// Common code for unusual error handling when no JPM available:
-
-        if (Count > cJU_LEAFW_MAXPOP1)  // too big for root-level leaf.
-        {
-            Pjpm_t Pjpm;                        // new, to allocate.
-
-// Allocate JPM:
-
-            Pjpm = j__udyAllocJPM();
-            JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI);
-            *PPArray = (Pvoid_t) Pjpm;
-
-// Set some JPM fields:
-
-            (Pjpm->jpm_Pop0) = Count - 1;
-            // note: (Pjpm->jpm_TotalMemWords) is now initialized.
-
-// Build Judy tree:
-//
-// In case of error save the final Count, possibly modified, unless modified to
-// 0, in which case free the JPM itself:
-
-            if (! j__udyInsArray(&(Pjpm->jpm_JP), cJU_ROOTSTATE, &Count,
-                                 (PWord_t) PIndex,
-#ifdef JUDYL
-                                 (Pjv_t) PValue,
-#endif
-                                 Pjpm))
-            {
-                JU_COPY_ERRNO(PJError, Pjpm);
-
-                if (Count)              // partial success, adjust pop0:
-                {
-                    (Pjpm->jpm_Pop0) = Count - 1;
-                }
-                else                    // total failure, free JPM:
-                {
-                    j__udyFreeJPM(Pjpm, (Pjpm_t) NULL);
-                    *PPArray = (Pvoid_t) NULL;
-                }
-
-                DBGCODE(JudyCheckPop(*PPArray);)
-                return(JERRI);
-            }
-
-            DBGCODE(JudyCheckPop(*PPArray);)
-            return(1);
-
-        } // large count
-
-
-// HANDLE SMALL COUNT (= POP1):
-//
-// First ensure indexes are in sorted order:
-
-        for (offset = 1; offset < Count; ++offset)
-        {
-            if (PIndex[offset - 1] >= PIndex[offset])
-            { JU_SET_ERRNO(PJError, JU_ERRNO_UNSORTED); return(JERRI); }
-        }
-
-        if (Count == 0) return(1);              // *PPArray remains null.
-
-        {
-            Pjlw      = j__udyAllocJLW(Count + 1);
-                        JU_CHECKALLOC(Pjlw_t, Pjlw, JERRI);
-            *PPArray  = (Pvoid_t) Pjlw;
-            Pjlw[0]   = Count - 1;              // set pop0.
-            Pjlwindex = Pjlw + 1;
-        }
-
-// Copy whole-word indexes (and values) to the root-level leaf:
-
-          JU_COPYMEM(Pjlwindex,                      PIndex, Count);
-JUDYLCODE(JU_COPYMEM(JL_LEAFWVALUEAREA(Pjlw, Count), PValue, Count));
-
-        DBGCODE(JudyCheckPop(*PPArray);)
-        return(1);
-
-} // Judy1SetArray() / JudyLInsArray()
-
-
-// ****************************************************************************
-// __ J U D Y   I N S   A R R A Y
-//
-// Given:
-//
-// - a pointer to a JP
-//
-// - the JPs level in the tree, that is, the number of digits left to decode
-//   in the indexes under the JP (one less than the level of the JPM or branch
-//   in which the JP resides); cJU_ROOTSTATE on first entry (when JP is the one
-//   in the JPM), down to 1 for a Leaf1, LeafB1, or FullPop
-//
-// - a pointer to the number of indexes (and corresponding values) to store in
-//   this subtree, to modify in case of partial success
-//
-// - a list of indexes (and for JudyL, corresponding values) to store in this
-//   subtree
-//
-// - a JPM for tracking memory usage and returning errors
-//
-// Recursively build a subtree (immediate indexes, leaf, or branch with
-// subtrees) and modify the JP accordingly.  On the way down, build a BranchU
-// (only) for any expanse with *PPop1 too high for a leaf; on the way out,
-// convert the BranchU to a BranchL or BranchB if appropriate.  Keep memory
-// statistics in the JPM.
-//
-// Return TRUE for success, or FALSE with error information set in the JPM in
-// case of error, in which case leave a partially constructed but healthy tree,
-// and modify parent population counts on the way out.
-//
-// Note:  Each call of this function makes all modifications to the PjpParent
-// it receives; neither the parent nor child calls do this.
-
-FUNCTION static bool_t j__udyInsArray(
-        Pjp_t   PjpParent,              // parent JP in/under which to store.
-        int     Level,                  // initial digits remaining to decode.
-        PWord_t PPop1,                  // number of indexes to store.
-        PWord_t PIndex,                 // list of indexes to store.
-#ifdef JUDYL
-        Pjv_t   PValue,                 // list of corresponding values.
-#endif
-        Pjpm_t  Pjpm)                   // for memory and errors.
-{
-        Pjp_t   Pjp;                    // lower-level JP.
-        Word_t  Pjbany;                 // any type of branch.
-        int     levelsub;               // actual, of Pjps node, <= Level.
-        Word_t  pop1 = *PPop1;          // fast local value.
-        Word_t  pop1sub;                // population of one subexpanse.
-        uint8_t JPtype;                 // current JP type.
-        uint8_t JPtype_null;            // precomputed value for new branch.
-        jp_t    JPnull;                 // precomputed for speed.
-        Pjbu_t  PjbuRaw;                // constructed BranchU.
-        Pjbu_t  Pjbu;
-        int     digit;                  // in BranchU.
-        Word_t  digitmask;              // for a digit in a BranchU.
-        Word_t  digitshifted;           // shifted to correct offset.
-        Word_t  digitshincr;            // increment for digitshifted.
-        int     offset;                 // in PIndex, or a bitmap subexpanse.
-        int     numJPs;                 // number non-null in a BranchU.
-        bool_t  retval;                 // to return from this func.
-JUDYLCODE(Pjv_t PjvRaw);                // destination value area.
-JUDYLCODE(Pjv_t Pjv);
-
-
-// MACROS FOR COMMON CODE:
-//
-// Note:  These use function and local parameters from the context.
-// Note:  Assume newly allocated memory is zeroed.
-
-// Indicate whether a sorted list of indexes in PIndex, based on the first and
-// last indexes in the list using pop1, are in the same subexpanse between
-// Level and L_evel:
-//
-// This can be confusing!  Note that SAMESUBEXP(L) == TRUE means the indexes
-// are the same through level L + 1, and it says nothing about level L and
-// lower; they might be the same or they might differ.
-//
-// Note:  In principle SAMESUBEXP needs a mask for the digits from Level,
-// inclusive, to L_evel, exclusive.  But in practice, since the indexes are all
-// known to be identical above Level, it just uses a mask for the digits
-// through L_evel + 1; see subexp_mask[].
-
-#define SAMESUBEXP(L_evel) \
-        (! ((PIndex[0] ^ PIndex[pop1 - 1]) & subexp_mask[L_evel]))
-
-// Set PjpParent to a null JP appropriate for the level of the node to which it
-// points, which is 1 less than the level of the node in which the JP resides,
-// which is by definition Level:
-//
-// Note:  This can set the JPMs JP to an invalid jp_Type, but it doesnt
-// matter because the JPM is deleted by the caller.
-
-#define SETJPNULL_PARENT \
-            JU_JPSETADT(PjpParent, 0, 0, cJU_JPNULL1 + Level - 1);
-
-// Variation to set a specified JP (in a branch being built) to a precomputed
-// null JP:
-
-#define SETJPNULL(Pjp) *(Pjp) = JPnull
-
-// Handle complete (as opposed to partial) memory allocation failure:  Set the
-// parent JP to an appropriate null type (to leave a consistent tree), zero the
-// callers population count, and return FALSE:
-//
-// Note:  At Level == cJU_ROOTSTATE this sets the JPMs JPs jp_Type to a bogus
-// value, but it doesnt matter because the JPM should be deleted by the
-// caller.
-
-#define NOMEM { SETJPNULL_PARENT; *PPop1 = 0; return(FALSE); }
-
-// Allocate a Leaf1-N and save the address in Pjll; in case of failure, NOMEM:
-
-#define ALLOCLEAF(AllocLeaf) \
-        if ((PjllRaw = AllocLeaf(pop1, Pjpm)) == (Pjll_t) NULL) NOMEM; \
-        Pjll = P_JLL(PjllRaw);
-
-// Copy indexes smaller than words (and values which are whole words) from
-// given arrays to immediate indexes or a leaf:
-//
-// TBD:  These macros overlap with some of the code in JudyCascade.c; do some
-// merging?  That file has functions while these are macros.
-
-#define COPYTOLEAF_EVEN_SUB(Pjll,LeafType)              \
-        {                                               \
-            LeafType * P_leaf  = (LeafType *) (Pjll);   \
-            Word_t     p_op1   = pop1;                  \
-            PWord_t    P_Index = PIndex;                \
-                                                        \
-            assert(pop1 > 0);                           \
-                                                        \
-            do { *P_leaf++ = *P_Index++; /* truncates */\
-            } while (--(p_op1));                        \
-        }
-
-#define COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy)            \
-        {                                               \
-            uint8_t * P_leaf  = (uint8_t *) (Pjll);     \
-            Word_t    p_op1   = pop1;                   \
-            PWord_t   P_Index = PIndex;                 \
-                                                        \
-            assert(pop1 > 0);                           \
-                                                        \
-            do {                                        \
-                Copy(P_leaf, *P_Index);                 \
-                P_leaf += (cLevel); ++P_Index;          \
-            } while (--(p_op1));                        \
-        }
-
-#ifdef JUDY1
-
-#define COPYTOLEAF_EVEN(Pjll,LeafType)   COPYTOLEAF_EVEN_SUB(Pjll,LeafType)
-#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy)
-
-#else // JUDYL adds copying of values:
-
-#define COPYTOLEAF_EVEN(Pjll,LeafType)                  \
-        {                                               \
-            COPYTOLEAF_EVEN_SUB(Pjll,LeafType)          \
-            JU_COPYMEM(Pjv, PValue, pop1);              \
-        }
-
-#define COPYTOLEAF_ODD(cLevel,Pjll,Copy)                \
-        {                                               \
-            COPYTOLEAF_ODD_SUB( cLevel,Pjll,Copy)       \
-            JU_COPYMEM(Pjv, PValue, pop1);              \
-        }
-
-#endif
-
-// Set the JP type for an immediate index, where BaseJPType is JPIMMED_*_02:
-
-#define SETIMMTYPE(BaseJPType)  (PjpParent->jp_Type) = (BaseJPType) + pop1 - 2
-
-// Allocate and populate a Leaf1-N:
-//
-// Build MAKELEAF_EVEN() and MAKELEAF_ODD() using macros for common code.
-
-#define MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType)                     \
-        ALLOCLEAF(AllocLeaf);                                           \
-        JUDYLCODE(Pjv = ValueArea(Pjll, pop1))
-
-
-#define MAKELEAF_SUB2(cLevel,JPType)                                    \
-{                                                                       \
-        Word_t D_cdP0;                                                  \
-        assert(pop1 - 1 <= cJU_POP0MASK(cLevel));                       \
-        D_cdP0 = (*PIndex & cJU_DCDMASK(cLevel)) | (pop1 - 1);          \
-        JU_JPSETADT(PjpParent, (Word_t)PjllRaw, D_cdP0, JPType);        \
-}
-
-
-#define MAKELEAF_EVEN(cLevel,JPType,AllocLeaf,ValueArea,LeafType)       \
-        MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType);                    \
-        COPYTOLEAF_EVEN(Pjll, LeafType);                                \
-        MAKELEAF_SUB2(cLevel, JPType)
-
-#define MAKELEAF_ODD(cLevel,JPType,AllocLeaf,ValueArea,Copy)            \
-        MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType);                    \
-        COPYTOLEAF_ODD(cLevel, Pjll, Copy);                             \
-        MAKELEAF_SUB2(cLevel, JPType)
-
-// Ensure that the indexes to be stored in immediate indexes or a leaf are
-// sorted:
-//
-// This check is pure overhead, but required in order to protect the Judy array
-// against caller error, to avoid a later corruption or core dump from a
-// seemingly valid Judy array.  Do this check piecemeal at the leaf level while
-// the indexes are already in the cache.  Higher-level order-checking occurs
-// while building branches.
-//
-// Note:  Any sorting error in the expanse of a single immediate indexes JP or
-// a leaf => save no indexes in that expanse.
-
-#define CHECKLEAFORDER                                                  \
-        {                                                               \
-            for (offset = 1; offset < pop1; ++offset)                   \
-            {                                                           \
-                if (PIndex[offset - 1] >= PIndex[offset])               \
-                {                                                       \
-                    SETJPNULL_PARENT;                                   \
-                    *PPop1 = 0;                                         \
-                    JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED);      \
-                    return(FALSE);                                      \
-                }                                                       \
-            }                                                           \
-        }
-
-
-// ------ START OF CODE ------
-
-        assert( Level >= 1);
-        assert( Level <= cJU_ROOTSTATE);
-        assert((Level <  cJU_ROOTSTATE) || (pop1 > cJU_LEAFW_MAXPOP1));
-
-
-// CHECK FOR TOP LEVEL:
-//
-// Special case:  If at the top level (PjpParent is in the JPM), a top-level
-// branch must be created, even if its a BranchL with just one JP.  (The JPM
-// cannot point to a leaf because the leaf would have to be a lower-level,
-// higher-capacity leaf under a narrow pointer (otherwise a root-level leaf
-// would suffice), and the JPMs JP cant handle a narrow pointer because the
-// jp_DcdPopO field isnt big enough.)  Otherwise continue to check for a pop1
-// small enough to support immediate indexes or a leaf before giving up and
-// making a lower-level branch.
-
-        if (Level == cJU_ROOTSTATE)
-        {
-            levelsub = cJU_ROOTSTATE;
-            goto BuildBranch2;
-        }
-        assert(Level < cJU_ROOTSTATE);
-
-
-// SKIP JPIMMED_*_01:
-//
-// Immeds with pop1 == 1 should be handled in-line during branch construction.
-
-        assert(pop1 > 1);
-
-
-// BUILD JPIMMED_*_02+:
-//
-// The starting address of the indexes depends on Judy1 or JudyL; also, JudyL
-// includes a pointer to a values-only leaf.
-
-        if (pop1 <= immed_maxpop1[Level])      // note: always < root level.
-        {
-            JUDY1CODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_1Index);)
-            JUDYLCODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_LIndex);)
-
-            CHECKLEAFORDER;             // indexes to be stored are sorted.
-
-#ifdef JUDYL
-            if ((PjvRaw = j__udyLAllocJV(pop1, Pjpm)) == (Pjv_t) NULL)
-                NOMEM;
-            (PjpParent->jp_Addr) = (Word_t) PjvRaw;
-            Pjv = P_JV(PjvRaw);
-#endif
-
-            switch (Level)
-            {
-            case 1: COPYTOLEAF_EVEN(Pjll, uint8_t);
-                    SETIMMTYPE(cJU_JPIMMED_1_02);
-                    break;
-#if (defined(JUDY1) || defined(JU_64BIT))
-            case 2: COPYTOLEAF_EVEN(Pjll, uint16_t);
-                    SETIMMTYPE(cJU_JPIMMED_2_02);
-                    break;
-            case 3: COPYTOLEAF_ODD(3, Pjll, JU_COPY3_LONG_TO_PINDEX);
-                    SETIMMTYPE(cJU_JPIMMED_3_02);
-                    break;
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-            case 4: COPYTOLEAF_EVEN(Pjll, uint32_t);
-                    SETIMMTYPE(cJ1_JPIMMED_4_02);
-                    break;
-            case 5: COPYTOLEAF_ODD(5, Pjll, JU_COPY5_LONG_TO_PINDEX);
-                    SETIMMTYPE(cJ1_JPIMMED_5_02);
-                    break;
-            case 6: COPYTOLEAF_ODD(6, Pjll, JU_COPY6_LONG_TO_PINDEX);
-                    SETIMMTYPE(cJ1_JPIMMED_6_02);
-                    break;
-            case 7: COPYTOLEAF_ODD(7, Pjll, JU_COPY7_LONG_TO_PINDEX);
-                    SETIMMTYPE(cJ1_JPIMMED_7_02);
-                    break;
-#endif
-            default: assert(FALSE);     // should be impossible.
-            }
-
-            return(TRUE);               // note: no children => no *PPop1 mods.
-
-        } // JPIMMED_*_02+
-
-
-// BUILD JPLEAF*:
-//
-// This code is a little tricky.  The method is:  For each level starting at
-// the present Level down through levelsub = 1, and then as a special case for
-// LeafB1 and FullPop (which are also at levelsub = 1 but have different
-// capacity, see later), check if pop1 fits in a leaf (using leaf_maxpop1[])
-// at that level.  If so, except for Level == levelsub, check if all of the
-// current indexes to be stored are in the same (narrow) subexpanse, that is,
-// the digits from Level to levelsub + 1, inclusive, are identical between the
-// first and last index in the (sorted) list (in PIndex).  If this condition is
-// satisfied at any level, build a leaf at that level (under a narrow pointer
-// if Level > levelsub).
-//
-// Note:  Doing the search in this order results in storing the indexes in
-// "least compressed form."
-
-        for (levelsub = Level; levelsub >= 1; --levelsub)
-        {
-            Pjll_t PjllRaw;
-            Pjll_t Pjll;
-
-// Check if pop1 is too large to fit in a leaf at levelsub; if so, try the next
-// lower level:
-
-            if (pop1 > leaf_maxpop1[levelsub]) continue;
-
-// If pop1 fits in a leaf at levelsub, but levelsub is lower than Level, must
-// also check whether all the indexes in the expanse to store can in fact be
-// placed under a narrow pointer; if not, a leaf cannot be used, at this or any
-// lower level (levelsub):
-
-            if ((levelsub < Level) && (! SAMESUBEXP(levelsub)))
-                goto BuildBranch;       // cant use a narrow, need a branch.
-
-// Ensure valid pop1 and all indexes are in fact common through Level:
-
-            assert(pop1 <= cJU_POP0MASK(Level) + 1);
-            assert(! ((PIndex[0] ^ PIndex[pop1 - 1]) & cJU_DCDMASK(Level)));
-
-            CHECKLEAFORDER;             // indexes to be stored are sorted.
-
-// Build correct type of leaf:
-//
-// Note:  The jp_DcdPopO and jp_Type assignments in MAKELEAF_* happen correctly
-// for the levelsub (not Level) of the new leaf, even if its under a narrow
-// pointer.
-
-            switch (levelsub)
-            {
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-            case 1: MAKELEAF_EVEN(1, cJU_JPLEAF1, j__udyAllocJLL1,
-                                  JL_LEAF1VALUEAREA, uint8_t);
-                    break;
-#endif
-            case 2: MAKELEAF_EVEN(2, cJU_JPLEAF2, j__udyAllocJLL2,
-                                  JL_LEAF2VALUEAREA, uint16_t);
-                    break;
-            case 3: MAKELEAF_ODD( 3, cJU_JPLEAF3, j__udyAllocJLL3,
-                                  JL_LEAF3VALUEAREA, JU_COPY3_LONG_TO_PINDEX);
-                    break;
-#ifdef JU_64BIT
-            case 4: MAKELEAF_EVEN(4, cJU_JPLEAF4, j__udyAllocJLL4,
-                                  JL_LEAF4VALUEAREA, uint32_t);
-                    break;
-            case 5: MAKELEAF_ODD( 5, cJU_JPLEAF5, j__udyAllocJLL5,
-                                  JL_LEAF5VALUEAREA, JU_COPY5_LONG_TO_PINDEX);
-                    break;
-            case 6: MAKELEAF_ODD( 6, cJU_JPLEAF6, j__udyAllocJLL6,
-                                  JL_LEAF6VALUEAREA, JU_COPY6_LONG_TO_PINDEX);
-                    break;
-            case 7: MAKELEAF_ODD( 7, cJU_JPLEAF7, j__udyAllocJLL7,
-                                  JL_LEAF7VALUEAREA, JU_COPY7_LONG_TO_PINDEX);
-                    break;
-#endif
-            default: assert(FALSE);     // should be impossible.
-            }
-
-            return(TRUE);               // note: no children => no *PPop1 mods.
-
-        } // JPLEAF*
-
-
-// BUILD JPLEAF_B1 OR JPFULLPOPU1:
-//
-// See above about JPLEAF*.  If pop1 doesnt fit in any level of linear leaf,
-// it might still fit in a LeafB1 or FullPop, perhaps under a narrow pointer.
-
-        if ((Level == 1) || SAMESUBEXP(1))      // same until last digit.
-        {
-            Pjlb_t PjlbRaw;                     // for bitmap leaf.
-            Pjlb_t Pjlb;
-
-            assert(pop1 <= cJU_JPFULLPOPU1_POP0 + 1);
-            CHECKLEAFORDER;             // indexes to be stored are sorted.
-
-#ifdef JUDY1
-
-// JPFULLPOPU1:
-
-            if (pop1 == cJU_JPFULLPOPU1_POP0 + 1)
-            {
-                Word_t  Addr  = PjpParent->jp_Addr;
-                Word_t  DcdP0 = (*PIndex & cJU_DCDMASK(1))
-                                        | cJU_JPFULLPOPU1_POP0;
-                JU_JPSETADT(PjpParent, Addr, DcdP0, cJ1_JPFULLPOPU1);
-
-                return(TRUE);
-            }
-#endif
-
-// JPLEAF_B1:
-
-            if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL)
-                NOMEM;
-            Pjlb = P_JLB(PjlbRaw);
-
-            for (offset = 0; offset < pop1; ++offset)
-                JU_BITMAPSETL(Pjlb, PIndex[offset]);
-
-            retval = TRUE;              // default.
-
-#ifdef JUDYL
-
-// Build subexpanse values-only leaves (LeafVs) under LeafB1:
-
-            for (offset = 0; offset < cJU_NUMSUBEXPL; ++offset)
-            {
-                if (! (pop1sub = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset))))
-                    continue;           // skip empty subexpanse.
-
-// Allocate one LeafV = JP subarray; if out of memory, clear bitmaps for higher
-// subexpanses and adjust *PPop1:
-
-                if ((PjvRaw = j__udyLAllocJV(pop1sub, Pjpm))
-                 == (Pjv_t) NULL)
-                {
-                    for (/* null */; offset < cJU_NUMSUBEXPL; ++offset)
-                    {
-                        *PPop1 -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset));
-                        JU_JLB_BITMAP(Pjlb, offset) = 0;
-                    }
-
-                    retval = FALSE;
-                    break;
-                }
-
-// Populate values-only leaf and save the pointer to it:
-
-                Pjv = P_JV(PjvRaw);
-                JU_COPYMEM(Pjv, PValue, pop1sub);
-                JL_JLB_PVALUE(Pjlb, offset) = PjvRaw;   // first-tier pointer.
-                PValue += pop1sub;
-
-            } // for each subexpanse
-
-#endif // JUDYL
-
-// Attach new LeafB1 to parent JP; note use of *PPop1 possibly < pop1:
-
-            JU_JPSETADT(PjpParent, (Word_t) PjlbRaw, 
-                    (*PIndex & cJU_DCDMASK(1)) | (*PPop1 - 1), cJU_JPLEAF_B1);
-
-            return(retval);
-
-        } // JPLEAF_B1 or JPFULLPOPU1
-
-
-// BUILD JPBRANCH_U*:
-//
-// Arriving at BuildBranch means Level < top level but the pop1 is too large
-// for immediate indexes or a leaf, even under a narrow pointer, including a
-// LeafB1 or FullPop at level 1.  This implies SAMESUBEXP(1) == FALSE, that is,
-// the indexes to be stored "branch" at level 2 or higher.
-
-BuildBranch:    // come here directly if a leaf wont work.
-
-        assert(Level >= 2);
-        assert(Level < cJU_ROOTSTATE);
-        assert(! SAMESUBEXP(1));                // sanity check, see above.
-
-// Determine the appropriate level for a new branch node; see if a narrow
-// pointer can be used:
-//
-// This can be confusing.  The branch is required at the lowest level L where
-// the indexes to store are not in the same subexpanse at level L-1.  Work down
-// from Level to tree level 3, which is 1 above the lowest tree level = 2 at
-// which a branch can be used.  Theres no need to check SAMESUBEXP at level 2
-// because its known to be false at level 2-1 = 1.
-//
-// Note:  Unlike for a leaf node, a narrow pointer is always used for a branch
-// if possible, that is, maximum compression is always used, except at the top
-// level of the tree, where a JPM cannot support a narrow pointer, meaning a
-// top BranchL can have a single JP (fanout = 1); but that case jumps directly
-// to BuildBranch2.
-//
-// Note:  For 32-bit systems the only usable values for a narrow pointer are
-// Level = 3 and levelsub = 2; 64-bit systems have many more choices; but
-// hopefully this for-loop is fast enough even on a 32-bit system.
-//
-// TBD:  If not fast enough, #ifdef JU_64BIT and handle the 32-bit case faster.
-
-        for (levelsub = Level; levelsub >= 3; --levelsub)  // see above.
-            if (! SAMESUBEXP(levelsub - 1))     // at limit of narrow pointer.
-                break;                          // put branch at levelsub.
-
-BuildBranch2:   // come here directly for Level = levelsub = cJU_ROOTSTATE.
-
-        assert(levelsub >= 2);
-        assert(levelsub <= Level);
-
-// Initially build a BranchU:
-//
-// Always start with a BranchU because the number of populated subexpanses is
-// not yet known.  Use digitmask, digitshifted, and digitshincr to avoid
-// expensive variable shifts within JU_DIGITATSTATE within the loop.
-//
-// TBD:  The use of digitmask, etc. results in more increment operations per
-// loop, is there an even faster way?
-//
-// TBD:  Would it pay to pre-count the populated JPs (subexpanses) and
-// pre-compress the branch, that is, build a BranchL or BranchB immediately,
-// also taking account of opportunistic uncompression rules?  Probably not
-// because at high levels of the tree there might be huge numbers of indexes
-// (hence cache lines) to scan in the PIndex array to determine the fanout
-// (number of JPs) needed.
-
-        if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) NOMEM;
-        Pjbu = P_JBU(PjbuRaw);
-
-        JPtype_null       = cJU_JPNULL1 + levelsub - 2;  // in new BranchU.
-        JU_JPSETADT(&JPnull, 0, 0, JPtype_null);
-
-        Pjp               = Pjbu->jbu_jp;           // for convenience in loop.
-        numJPs            = 0;                      // non-null in the BranchU.
-        digitmask         = cJU_MASKATSTATE(levelsub);   // see above.
-        digitshincr       = 1UL << (cJU_BITSPERBYTE * (levelsub - 1));
-        retval            = TRUE;
-
-// Scan and populate JPs (subexpanses):
-//
-// Look for all indexes matching each digit in the BranchU (at the correct
-// levelsub), and meanwhile notice any sorting error.  Increment PIndex (and
-// PValue) and reduce pop1 for each subexpanse handled successfully.
-
-        for (digit = digitshifted = 0;
-             digit < cJU_BRANCHUNUMJPS;
-             ++digit, digitshifted += digitshincr, ++Pjp)
-        {
-            DBGCODE(Word_t pop1subprev;)
-            assert(pop1 != 0);          // end of indexes is handled elsewhere.
-
-// Count indexes in digits subexpanse:
-
-            for (pop1sub = 0; pop1sub < pop1; ++pop1sub)
-                if (digitshifted != (PIndex[pop1sub] & digitmask)) break;
-
-// Empty subexpanse (typical, performance path) or sorting error (rare):
-
-            if (pop1sub == 0)
-            {
-                if (digitshifted < (PIndex[0] & digitmask))
-                { SETJPNULL(Pjp); continue; }           // empty subexpanse.
-
-                assert(pop1 < *PPop1);  // did save >= 1 index and decr pop1.
-                JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED);
-                goto AbandonBranch;
-            }
-
-// Non-empty subexpanse:
-//
-// First shortcut by handling pop1sub == 1 (JPIMMED_*_01) inline locally.
-
-            if (pop1sub == 1)                   // note: can be at root level.
-            {
-                Word_t Addr = 0;
-      JUDYLCODE(Addr    = (Word_t) (*PValue++);)
-                JU_JPSETADT(Pjp, Addr, *PIndex, cJU_JPIMMED_1_01 + levelsub -2);
-
-                ++numJPs;
-
-                if (--pop1) { ++PIndex; continue; }  // more indexes to store.
-
-                ++digit; ++Pjp;                 // skip JP just saved.
-                goto ClearBranch;               // save time.
-            }
-
-// Recurse to populate one digits (subexpanses) JP; if successful, skip
-// indexes (and values) just stored (performance path), except when expanse is
-// completely stored:
-
-            DBGCODE(pop1subprev = pop1sub;)
-
-            if (j__udyInsArray(Pjp, levelsub - 1, &pop1sub, (PWord_t) PIndex,
-#ifdef JUDYL
-                               (Pjv_t) PValue,
-#endif
-                               Pjpm))
-            {                                   // complete success.
-                ++numJPs;
-                assert(pop1subprev == pop1sub);
-                assert(pop1 >= pop1sub);
-
-                if ((pop1 -= pop1sub) != 0)     // more indexes to store:
-                {
-                    PIndex += pop1sub;          // skip indexes just stored.
-          JUDYLCODE(PValue += pop1sub;)
-                    continue;
-                }
-                // else leave PIndex in BranchUs expanse.
-
-// No more indexes to store in BranchUs expanse:
-
-                ++digit; ++Pjp;                 // skip JP just saved.
-                goto ClearBranch;               // save time.
-            }
-
-// Handle any error at a lower level of recursion:
-//
-// In case of partial success, pop1sub != 0, but it was reduced from the value
-// passed to j__udyInsArray(); skip this JP later during ClearBranch.
-
-            assert(pop1subprev > pop1sub);      // check j__udyInsArray().
-            assert(pop1        > pop1sub);      // check j__udyInsArray().
-
-            if (pop1sub)                        // partial success.
-            { ++digit; ++Pjp; ++numJPs; }       // skip JP just saved.
-
-            pop1 -= pop1sub;                    // deduct saved indexes if any.
-
-// Same-level sorting error, or any lower-level error; abandon the rest of the
-// branch:
-//
-// Arrive here with pop1 = remaining unsaved indexes (always non-zero).  Adjust
-// the *PPop1 value to record and return, modify retval, and use ClearBranch to
-// finish up.
-
-AbandonBranch:
-            assert(pop1 != 0);                  // more to store, see above.
-            assert(pop1 <= *PPop1);             // sanity check.
-
-            *PPop1 -= pop1;                     // deduct unsaved indexes.
-            pop1    = 0;                        // to avoid error later.
-            retval  = FALSE;
-
-// Error (rare), or end of indexes while traversing new BranchU (performance
-// path); either way, mark the remaining JPs, if any, in the BranchU as nulls
-// and exit the loop:
-//
-// Arrive here with digit and Pjp set to the first JP to set to null.
-
-ClearBranch:
-            for (/* null */; digit < cJU_BRANCHUNUMJPS; ++digit, ++Pjp)
-                SETJPNULL(Pjp);
-            break;                              // saves one more compare.
-
-        } // for each digit
-
-
-// FINISH JPBRANCH_U*:
-//
-// Arrive here with a BranchU built under Pjbu, numJPs set, and either:  retval
-// == TRUE and *PPop1 unmodified, or else retval == FALSE, *PPop1 set to the
-// actual number of indexes saved (possibly 0 for complete failure at a lower
-// level upon the first call of j__udyInsArray()), and the Judy error set in
-// Pjpm.  Either way, PIndex points to an index within the expanse just
-// handled.
-
-        Pjbany = (Word_t) PjbuRaw;              // default = use this BranchU.
-        JPtype = branchU_JPtype[levelsub];
-
-// Check for complete failure above:
-
-        assert((! retval) || *PPop1);           // sanity check.
-
-        if ((! retval) && (*PPop1 == 0))        // nothing stored, full failure.
-        {
-            j__udyFreeJBU(PjbuRaw, Pjpm);
-            SETJPNULL_PARENT;
-            return(FALSE);
-        }
-
-// Complete or partial success so far; watch for sorting error after the
-// maximum digit (255) in the BranchU, which is indicated by having more
-// indexes to store in the BranchUs expanse:
-//
-// For example, if an index to store has a digit of 255 at levelsub, followed
-// by an index with a digit of 254, the for-loop above runs out of digits
-// without reducing pop1 to 0.
-
-        if (pop1 != 0)
-        {
-            JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED);
-            *PPop1 -= pop1;             // deduct unsaved indexes.
-            retval  = FALSE;
-        }
-        assert(*PPop1 != 0);            // branch (still) cannot be empty.
-
-
-// OPTIONALLY COMPRESS JPBRANCH_U*:
-//
-// See if the BranchU should be compressed to a BranchL or BranchB; if so, do
-// that and free the BranchU; otherwise just use the existing BranchU.  Follow
-// the same rules as in JudyIns.c (version 4.95):  Only check local population
-// (cJU_OPP_UNCOMP_POP0) for BranchL, and only check global memory efficiency
-// (JU_OPP_UNCOMPRESS) for BranchB.  TBD:  Have the rules changed?
-//
-// Note:  Because of differing order of operations, the latter compression
-// might not result in the same set of branch nodes as a series of sequential
-// insertions.
-//
-// Note:  Allocating a BranchU only to sometimes convert it to a BranchL or
-// BranchB is unfortunate, but attempting to work with a temporary BranchU on
-// the stack and then allocate and keep it as a BranchU in many cases is worse
-// in terms of error handling.
-
-
-// COMPRESS JPBRANCH_U* TO JPBRANCH_L*:
-
-        if (numJPs <= cJU_BRANCHLMAXJPS)        // JPs fit in a BranchL.
-        {
-            Pjbl_t PjblRaw = (Pjbl_t) NULL;     // new BranchL; init for cc.
-            Pjbl_t Pjbl;
-
-            if ((*PPop1 > JU_BRANCHL_MAX_POP)   // pop too high.
-             || ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL))
-            {                                   // cant alloc BranchL.
-                goto SetParent;                 // just keep BranchU.
-            }
-
-            Pjbl = P_JBL(PjblRaw);
-
-// Copy BranchU JPs to BranchL:
-
-            (Pjbl->jbl_NumJPs) = numJPs;
-            offset = 0;
-
-            for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit)
-            {
-                if ((((Pjbu->jbu_jp) + digit)->jp_Type) == JPtype_null)
-                    continue;
-
-                (Pjbl->jbl_Expanse[offset  ]) = digit;
-                (Pjbl->jbl_jp     [offset++]) = Pjbu->jbu_jp[digit];
-            }
-            assert(offset == numJPs);           // found same number.
-
-// Free the BranchU and prepare to use the new BranchL instead:
-
-            j__udyFreeJBU(PjbuRaw, Pjpm);
-
-            Pjbany = (Word_t) PjblRaw;
-            JPtype = branchL_JPtype[levelsub];
-
-        } // compress to BranchL
-
-
-// COMPRESS JPBRANCH_U* TO JPBRANCH_B*:
-//
-// If unable to allocate the BranchB or any JP subarray, free all related
-// memory and just keep the BranchU.
-//
-// Note:  This use of JU_OPP_UNCOMPRESS is a bit conservative because the
-// BranchU is already allocated while the (presumably smaller) BranchB is not,
-// the opposite of how its used in single-insert code.
-
-        else
-        {
-            Pjbb_t PjbbRaw = (Pjbb_t) NULL;     // new BranchB; init for cc.
-            Pjbb_t Pjbb;
-            Pjp_t  Pjp2;                        // in BranchU.
-
-            if ((*PPop1 > JU_BRANCHB_MAX_POP)   // pop too high.
-             || ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL))
-            {                                   // cant alloc BranchB.
-                goto SetParent;                 // just keep BranchU.
-            }
-
-            Pjbb = P_JBB(PjbbRaw);
-
-// Set bits in bitmap for populated subexpanses:
-
-            Pjp2 = Pjbu->jbu_jp;
-
-            for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit)
-                if ((((Pjbu->jbu_jp) + digit)->jp_Type) != JPtype_null)
-                    JU_BITMAPSETB(Pjbb, digit);
-
-// Copy non-null JPs to BranchB JP subarrays:
-
-            for (offset = 0; offset < cJU_NUMSUBEXPB; ++offset)
-            {
-                Pjp_t PjparrayRaw;
-                Pjp_t Pjparray;
-
-                if (! (numJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset))))
-                    continue;                   // skip empty subexpanse.
-
-// If unable to allocate a JP subarray, free all BranchB memory so far and
-// continue to use the BranchU:
-
-                if ((PjparrayRaw = j__udyAllocJBBJP(numJPs, Pjpm))
-                    == (Pjp_t) NULL)
-                {
-                    while (offset-- > 0)
-                    {
-                        if (JU_JBB_PJP(Pjbb, offset) == (Pjp_t) NULL) continue;
-
-                        j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, offset),
-                                 j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)),
-                                        Pjpm);
-                    }
-                    j__udyFreeJBB(PjbbRaw, Pjpm);
-                    goto SetParent;             // keep BranchU.
-                }
-
-// Set one JP subarray pointer and copy the subexpanses JPs to the subarray:
-//
-// Scan the BranchU for non-null JPs until numJPs JPs are copied.
-
-                JU_JBB_PJP(Pjbb, offset) = PjparrayRaw;
-                Pjparray = P_JP(PjparrayRaw);
-
-                while (numJPs-- > 0)
-                {
-                    while ((Pjp2->jp_Type) == JPtype_null)
-                    {
-                        ++Pjp2;
-                        assert(Pjp2 < (Pjbu->jbu_jp) + cJU_BRANCHUNUMJPS);
-                    }
-                    *Pjparray++ = *Pjp2++;
-                }
-            } // for each subexpanse
-
-// Free the BranchU and prepare to use the new BranchB instead:
-
-            j__udyFreeJBU(PjbuRaw, Pjpm);
-
-            Pjbany = (Word_t) PjbbRaw;
-            JPtype = branchB_JPtype[levelsub];
-
-        } // compress to BranchB
-
-
-// COMPLETE OR PARTIAL SUCCESS:
-//
-// Attach new branch (under Pjp, with JPtype) to parent JP; note use of *PPop1,
-// possibly reduced due to partial failure.
-
-SetParent:
-        (PjpParent->jp_Addr) = Pjbany;
-        (PjpParent->jp_Type) = JPtype;
-
-        if (Level < cJU_ROOTSTATE)              // PjpParent not in JPM:
-        {
-            Word_t DcdP0 = (*PIndex & cJU_DCDMASK(levelsub)) | (*PPop1 - 1);
-
-            JU_JPSETADT(PjpParent ,Pjbany, DcdP0, JPtype);
-        }
-
-        return(retval);
-
-} // j__udyInsArray()
diff --git a/libs/klib/judy/JudyInsertBranch.c b/libs/klib/judy/JudyInsertBranch.c
deleted file mode 100644
index 307285c..0000000
--- a/libs/klib/judy/JudyInsertBranch.c
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// BranchL insertion functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t);
-
-
-// ****************************************************************************
-// __ J U D Y   I N S E R T   B R A N C H
-//
-// Insert 2-element BranchL in between Pjp and Pjp->jp_Addr.
-//
-// Return -1 if out of memory, otherwise return 1.
-
-FUNCTION int j__udyInsertBranch(
-	Pjp_t	Pjp,		// JP containing narrow pointer.
-	Word_t	Index,		// outlier to Pjp.
-	Word_t	BranchLevel,	// of what JP points to, mapped from JP type.
-	Pjpm_t	Pjpm)		// for global accounting.
-{
-	jp_t	JP2 [2];
-	jp_t	JP;
-	Pjp_t	PjpNull;
-	Word_t	XorExp;
-	Word_t	Inew, Iold;
-	Word_t  DCDMask;	// initially for original BranchLevel.
-	int	Ret;
-	uint8_t	Exp2[2];
-	uint8_t	DecodeByteN, DecodeByteO;
-
-//	Get the current mask for the DCD digits:
-
-	DCDMask = cJU_DCDMASK(BranchLevel);
-
-//	Obtain Dcd bits that differ between Index and JP, shifted so the
-//	digit for BranchLevel is the LSB:
-
-	XorExp = ((Index ^ JU_JPDCDPOP0(Pjp)) & (cJU_ALLONES >> cJU_BITSPERBYTE))
-	       >> (BranchLevel * cJU_BITSPERBYTE);
-	assert(XorExp);		// Index must be an outlier.
-
-//	Count levels between object under narrow pointer and the level at which
-//	the outlier diverges from it, which is always at least initial
-//	BranchLevel + 1, to end up with the level (JP type) at which to insert
-//	the new intervening BranchL:
-
-	do { ++BranchLevel; } while ((XorExp >>= cJU_BITSPERBYTE));
-	assert((BranchLevel > 1) && (BranchLevel < cJU_ROOTSTATE));
-
-//	Get the MSB (highest digit) that differs between the old expanse and
-//	the new Index to insert:
-
-	DecodeByteO = JU_DIGITATSTATE(JU_JPDCDPOP0(Pjp), BranchLevel);
-	DecodeByteN = JU_DIGITATSTATE(Index,	         BranchLevel);
-
-	assert(DecodeByteO != DecodeByteN);
-
-//	Determine sorted order for old expanse and new Index digits:
-
-	if (DecodeByteN > DecodeByteO)	{ Iold = 0; Inew = 1; }
-	else				{ Iold = 1; Inew = 0; }
-
-//	Copy old JP into staging area for new Branch
-	JP2 [Iold] = *Pjp;
-	Exp2[Iold] = DecodeByteO;
-	Exp2[Inew] = DecodeByteN;
-
-//	Create a 2 Expanse Linear branch
-//
-//	Note: Pjp->jp_Addr is set by j__udyCreateBranchL()
-
-	Ret = j__udyCreateBranchL(Pjp, JP2, Exp2, 2, Pjpm);
-	if (Ret == -1) return(-1);
-
-//	Get Pjp to the NULL of where to do insert
-	PjpNull	= ((P_JBL(Pjp->jp_Addr))->jbl_jp) + Inew;
-
-//	Convert to a cJU_JPIMMED_*_01 at the correct level:
-//	Build JP and set type below to: cJU_JPIMMED_X_01
-        JU_JPSETADT(PjpNull, 0, Index, cJU_JPIMMED_1_01 - 2 + BranchLevel);
-
-//	Return pointer to Value area in cJU_JPIMMED_X_01
-	JUDYLCODE(Pjpm->jpm_PValue = (Pjv_t) PjpNull;)
-
-//	The old JP now points to a BranchL that is at higher level.  Therefore
-//	it contains excess DCD bits (in the least significant position) that
-//	must be removed (zeroed); that is, they become part of the Pop0
-//	subfield.  Note that the remaining (lower) bytes in the Pop0 field do
-//	not change.
-//
-//	Take from the old DCDMask, which went "down" to a lower BranchLevel,
-//	and zero any high bits that are still in the mask at the new, higher
-//	BranchLevel; then use this mask to zero the bits in jp_DcdPopO:
-
-//	Set old JP to a BranchL at correct level
-
-	Pjp->jp_Type = cJU_JPBRANCH_L2 - 2 + BranchLevel;
-	DCDMask		^= cJU_DCDMASK(BranchLevel);
-	DCDMask		 = ~DCDMask & JU_JPDCDPOP0(Pjp);
-        JP = *Pjp;
-        JU_JPSETADT(Pjp, JP.jp_Addr, DCDMask, JP.jp_Type);
-
-	return(1);
-
-} // j__udyInsertBranch()
diff --git a/libs/klib/judy/JudyL.h b/libs/klib/judy/JudyL.h
deleted file mode 100644
index 13c7d66..0000000
--- a/libs/klib/judy/JudyL.h
+++ /dev/null
@@ -1,503 +0,0 @@
-#ifndef _JUDYL_INCLUDED
-#define _JUDYL_INCLUDED
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// ****************************************************************************
-//          JUDYL -- SMALL/LARGE AND/OR CLUSTERED/SPARSE ARRAYS
-//
-//                                    -by-
-//
-//                             Douglas L. Baskins
-//                             doug at sourcejudy.com
-//
-// Judy arrays are designed to be used instead of arrays.  The performance
-// suggests the reason why Judy arrays are thought of as arrays, instead of
-// trees.  They are remarkably memory efficient at all populations.
-// Implemented as a hybrid digital tree (but really a state machine, see
-// below), Judy arrays feature fast insert/retrievals, fast near neighbor
-// searching, and contain a population tree for extremely fast ordinal related
-// retrievals.
-//
-// CONVENTIONS:
-//
-// - The comments here refer to 32-bit [64-bit] systems.
-//
-// - BranchL, LeafL refer to linear branches and leaves (small populations),
-//   except LeafL does not actually appear as such; rather, Leaf1..3 [Leaf1..7]
-//   is used to represent leaf Index sizes, and LeafW refers to a Leaf with
-//   full (Long) word Indexes, which is also a type of linear leaf.  Note that
-//   root-level LeafW (Leaf4 [Leaf8]) leaves are called LEAFW.
-//
-// - BranchB, LeafB1 refer to bitmap branches and leaves (intermediate
-//   populations).
-//
-// - BranchU refers to uncompressed branches.  An uncompressed branch has 256
-//   JPs, some of which could be null.  Note:  All leaves are compressed (and
-//   sorted), or else an expanse is full (FullPopu), so there is no LeafU
-//   equivalent to BranchU.
-//
-// - "Popu" is short for "Population".
-// - "Pop1" refers to actual population (base 1).
-// - "Pop0" refers to Pop1 - 1 (base 0), the way populations are stored in data
-//   structures.
-//
-// - Branches and Leaves are both named by the number of bytes in their Pop0
-//   field.  In the case of Leaves, the same number applies to the Index sizes.
-//
-// - The representation of many numbers as hex is a relatively safe and
-//   portable way to get desired bitpatterns as unsigned longs.
-//
-// - Some preprocessors cant handle single apostrophe characters within
-//   #ifndef code, so here, delete all instead.
-
-
-#include "JudyPrivate.h"        // includes Judy.h in turn.
-#include "JudyPrivateBranch.h"  // support for branches.
-
-
-// ****************************************************************************
-// JUDYL ROOT POINTER (JRP) AND JUDYL POINTER (JP) TYPE FIELDS
-// ****************************************************************************
-
-typedef enum            // uint8_t -- but C does not support this type of enum.
-{
-
-// JP NULL TYPES:
-//
-// There is a series of cJL_JPNULL* Types because each one pre-records a
-// different Index Size for when the first Index is inserted in the previously
-// null JP.  They must start >= 8 (three bits).
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJL_JPNULL1 = 1,
-                                // Index Size 1[1] byte  when 1 Index inserted.
-        cJL_JPNULL2,            // Index Size 2[2] bytes when 1 Index inserted.
-        cJL_JPNULL3,            // Index Size 3[3] bytes when 1 Index inserted.
-
-#ifndef JU_64BIT
-#define cJL_JPNULLMAX cJL_JPNULL3
-#else
-        cJL_JPNULL4,            // Index Size 4[4] bytes when 1 Index inserted.
-        cJL_JPNULL5,            // Index Size 5[5] bytes when 1 Index inserted.
-        cJL_JPNULL6,            // Index Size 6[6] bytes when 1 Index inserted.
-        cJL_JPNULL7,            // Index Size 7[7] bytes when 1 Index inserted.
-#define cJL_JPNULLMAX cJL_JPNULL7
-#endif
-
-
-// JP BRANCH TYPES:
-//
-// Note:  There are no state-1 branches; only leaves reside at state 1.
-
-// Linear branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJL_JPBRANCH_L2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJL_JPBRANCH_L3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJL_JPBRANCH_L4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJL_JPBRANCH_L5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJL_JPBRANCH_L6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJL_JPBRANCH_L7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJL_JPBRANCH_L,         // note:  DcdPopO field not used.
-
-// Bitmap branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJL_JPBRANCH_B2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJL_JPBRANCH_B3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJL_JPBRANCH_B4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJL_JPBRANCH_B5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJL_JPBRANCH_B6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJL_JPBRANCH_B7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJL_JPBRANCH_B,         // note:  DcdPopO field not used.
-
-// Uncompressed branches:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-
-        cJL_JPBRANCH_U2,        // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJL_JPBRANCH_U3,        // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJL_JPBRANCH_U4,        //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJL_JPBRANCH_U5,        //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJL_JPBRANCH_U6,        //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJL_JPBRANCH_U7,        //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-        cJL_JPBRANCH_U,         // note:  DcdPopO field not used.
-
-
-// JP LEAF TYPES:
-
-// Linear leaves:
-//
-// Note:  These Types must be in sequential order for doing relative
-// calculations between them.
-//
-// Note:  There is no full-word (4-byte [8-byte]) Index leaf under a JP because
-// non-root-state leaves only occur under branches that decode at least one
-// byte.  Full-word, root-state leaves are under a JRP, not a JP.  However, in
-// the code a "fake" JP can be created temporarily above a root-state leaf.
-
-        cJL_JPLEAF1,            // 1[1] byte  Pop0, 2    bytes Dcd.
-        cJL_JPLEAF2,            // 2[2] bytes Pop0, 1[5] bytes Dcd.
-        cJL_JPLEAF3,            // 3[3] bytes Pop0, 0[4] bytes Dcd.
-
-#ifdef JU_64BIT
-        cJL_JPLEAF4,            //  [4] bytes Pop0,  [3] bytes Dcd.
-        cJL_JPLEAF5,            //  [5] bytes Pop0,  [2] bytes Dcd.
-        cJL_JPLEAF6,            //  [6] bytes Pop0,  [1] byte  Dcd.
-        cJL_JPLEAF7,            //  [7] bytes Pop0,  [0] bytes Dcd.
-#endif
-
-// Bitmap leaf; Index Size == 1:
-//
-// Note:  These are currently only supported at state 1.  At other states the
-// bitmap would grow from 256 to 256^2, 256^3, ... bits, which would not be
-// efficient..
-
-        cJL_JPLEAF_B1,          // 1[1] byte Pop0, 2[6] bytes Dcd.
-
-// Full population; Index Size == 1 virtual leaf:
-//
-// Note:  JudyL has no cJL_JPFULLPOPU1 equivalent to cJ1_JPFULLPOPU1, because
-// in the JudyL case this could result in a values-only leaf of up to 256 words
-// (value areas) that would be slow to insert/delete.
-
-
-// JP IMMEDIATES; leaves (Indexes) stored inside a JP:
-//
-// The second numeric suffix is the Pop1 for each type.  As the Index Size
-// increases, the maximum possible population decreases.
-//
-// Note:  These Types must be in sequential order in each group (Index Size),
-// and the groups in correct order too, for doing relative calculations between
-// them.  For example, since these Types enumerate the Pop1 values (unlike
-// other JP Types where there is a Pop0 value in the JP), the maximum Pop1 for
-// each Index Size is computable.
-//
-// All enums equal or above this point are cJL_JPIMMEDs.
-
-        cJL_JPIMMED_1_01,       // Index Size = 1, Pop1 = 1.
-        cJL_JPIMMED_2_01,       // Index Size = 2, Pop1 = 1.
-        cJL_JPIMMED_3_01,       // Index Size = 3, Pop1 = 1.
-
-#ifdef JU_64BIT
-        cJL_JPIMMED_4_01,       // Index Size = 4, Pop1 = 1.
-        cJL_JPIMMED_5_01,       // Index Size = 5, Pop1 = 1.
-        cJL_JPIMMED_6_01,       // Index Size = 6, Pop1 = 1.
-        cJL_JPIMMED_7_01,       // Index Size = 7, Pop1 = 1.
-#endif
-
-        cJL_JPIMMED_1_02,       // Index Size = 1, Pop1 = 2.
-        cJL_JPIMMED_1_03,       // Index Size = 1, Pop1 = 3.
-
-#ifdef JU_64BIT
-        cJL_JPIMMED_1_04,       // Index Size = 1, Pop1 = 4.
-        cJL_JPIMMED_1_05,       // Index Size = 1, Pop1 = 5.
-        cJL_JPIMMED_1_06,       // Index Size = 1, Pop1 = 6.
-        cJL_JPIMMED_1_07,       // Index Size = 1, Pop1 = 7.
-
-        cJL_JPIMMED_2_02,       // Index Size = 2, Pop1 = 2.
-        cJL_JPIMMED_2_03,       // Index Size = 2, Pop1 = 3.
-
-        cJL_JPIMMED_3_02,       // Index Size = 3, Pop1 = 2.
-#endif
-
-// This special Type is merely a sentinel for doing relative calculations.
-// This value should not be used in switch statements (to avoid allocating code
-// for it), which is also why it appears at the end of the enum list.
-
-        cJL_JPIMMED_CAP
-
-} jpL_Type_t;
-
-
-// RELATED VALUES:
-
-// Index Size (state) for leaf JP, and JP type based on Index Size (state):
-
-#define JL_LEAFINDEXSIZE(jpType) ((jpType)    - cJL_JPLEAF1 + 1)
-#define JL_LEAFTYPE(IndexSize)   ((IndexSize) + cJL_JPLEAF1 - 1)
-
-
-// MAXIMUM POPULATIONS OF LINEAR LEAVES:
-
-#ifndef JU_64BIT // 32-bit
-
-#define J_L_MAXB                (sizeof(Word_t) * 64)
-#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words.
-#define cJL_LEAF1_MAXWORDS               (32)   // max Leaf1 size in words.
-
-// Note:  cJL_LEAF1_MAXPOP1 is chosen such that the index portion is less than
-// 32 bytes -- the number of bytes the index takes in a bitmap leaf.
-
-#define cJL_LEAF1_MAXPOP1 \
-   ((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD))
-#define cJL_LEAF2_MAXPOP1       (J_L_MAXB / (2 + cJU_BYTESPERWORD))
-#define cJL_LEAF3_MAXPOP1       (J_L_MAXB / (3 + cJU_BYTESPERWORD))
-#define cJL_LEAFW_MAXPOP1 \
-           ((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD))
-
-#else // 64-bit
-
-#define J_L_MAXB                (sizeof(Word_t) * 64)
-#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words.
-#define cJL_LEAF1_MAXWORDS       (15)   // max Leaf1 size in words.
-
-#define cJL_LEAF1_MAXPOP1 \
-   ((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD))
-#define cJL_LEAF2_MAXPOP1       (J_L_MAXB / (2 + cJU_BYTESPERWORD))
-#define cJL_LEAF3_MAXPOP1       (J_L_MAXB / (3 + cJU_BYTESPERWORD))
-#define cJL_LEAF4_MAXPOP1       (J_L_MAXB / (4 + cJU_BYTESPERWORD))
-#define cJL_LEAF5_MAXPOP1       (J_L_MAXB / (5 + cJU_BYTESPERWORD))
-#define cJL_LEAF6_MAXPOP1       (J_L_MAXB / (6 + cJU_BYTESPERWORD))
-#define cJL_LEAF7_MAXPOP1       (J_L_MAXB / (7 + cJU_BYTESPERWORD))
-#define cJL_LEAFW_MAXPOP1 \
-           ((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD))
-
-#endif // 64-bit
-
-
-// MAXIMUM POPULATIONS OF IMMEDIATE JPs:
-//
-// These specify the maximum Population of immediate JPs with various Index
-// Sizes (== sizes of remaining undecoded Index bits).  Since the JP Types enum
-// already lists all the immediates in order by state and size, calculate these
-// values from it to avoid redundancy.
-
-#define cJL_IMMED1_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 1)        // 3 [7].
-#define cJL_IMMED2_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 2)        // 1 [3].
-#define cJL_IMMED3_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 3)        // 1 [2].
-
-#ifdef JU_64BIT
-#define cJL_IMMED4_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 4)        //   [1].
-#define cJL_IMMED5_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 5)        //   [1].
-#define cJL_IMMED6_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 6)        //   [1].
-#define cJL_IMMED7_MAXPOP1  ((cJU_BYTESPERWORD - 1) / 7)        //   [1].
-#endif
-
-
-// ****************************************************************************
-// JUDYL LEAF BITMAP (JLLB) SUPPORT
-// ****************************************************************************
-//
-// Assemble bitmap leaves out of smaller units that put bitmap subexpanses
-// close to their associated pointers.  Why not just use a bitmap followed by a
-// series of pointers?  (See 4.27.)  Turns out this wastes a cache fill on
-// systems with smaller cache lines than the assumed value cJU_WORDSPERCL.
-
-#define JL_JLB_BITMAP(Pjlb, Subexp)  ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_Bitmap)
-#define JL_JLB_PVALUE(Pjlb, Subexp)  ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_PValue)
-
-typedef struct J__UDYL_LEAF_BITMAP_SUBEXPANSE
-{
-        BITMAPL_t jLlbs_Bitmap;
-        Pjv_t     jLlbs_PValue;
-
-} jLlbs_t;
-
-typedef struct J__UDYL_LEAF_BITMAP
-{
-        jLlbs_t jLlb_jLlbs[cJU_NUMSUBEXPL];
-
-} jLlb_t, * PjLlb_t;
-
-// Words per bitmap leaf:
-
-#define cJL_WORDSPERLEAFB1  (sizeof(jLlb_t) / cJU_BYTESPERWORD)
-
-
-// ****************************************************************************
-// MEMORY ALLOCATION SUPPORT
-// ****************************************************************************
-
-// ARRAY-GLOBAL INFORMATION:
-//
-// At the cost of an occasional additional cache fill, this object, which is
-// pointed at by a JRP and in turn points to a JP_BRANCH*, carries array-global
-// information about a JudyL array that has sufficient population to amortize
-// the cost.  The jpm_Pop0 field prevents having to add up the total population
-// for the array in insert, delete, and count code.  The jpm_JP field prevents
-// having to build a fake JP for entry to a state machine; however, the
-// jp_DcdPopO field in jpm_JP, being one byte too small, is not used.
-//
-// Note:  Struct fields are ordered to keep "hot" data in the first 8 words
-// (see left-margin comments) for machines with 8-word cache lines, and to keep
-// sub-word fields together for efficient packing.
-
-typedef struct J_UDYL_POPULATION_AND_MEMORY
-{
-/* 1 */ Word_t     jpm_Pop0;            // total population-1 in array.
-/* 2 */ jp_t       jpm_JP;              // JP to first branch; see above.
-/* 4 */ Word_t     jpm_LastUPop0;       // last jpm_Pop0 when convert to BranchU
-/* 7 */ Pjv_t      jpm_PValue;          // pointer to value to return.
-// Note:  Field names match PJError_t for convenience in macros:
-/* 8 */ char       je_Errno;            // one of the enums in Judy.h.
-/* 8/9  */ int     je_ErrID;            // often an internal source line number.
-/* 9/10 */ Word_t  jpm_TotalMemWords;   // words allocated in array.
-} jLpm_t, *PjLpm_t;
-
-
-// TABLES FOR DETERMINING IF LEAVES HAVE ROOM TO GROW:
-//
-// These tables indicate if a given memory chunk can support growth of a given
-// object into wasted (rounded-up) memory in the chunk.  Note:  This violates
-// the hiddenness of the JudyMalloc code.
-
-extern const uint8_t j__L_Leaf1PopToWords[cJL_LEAF1_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf2PopToWords[cJL_LEAF2_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf3PopToWords[cJL_LEAF3_MAXPOP1 + 1];
-#ifdef JU_64BIT
-extern const uint8_t j__L_Leaf4PopToWords[cJL_LEAF4_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf5PopToWords[cJL_LEAF5_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf6PopToWords[cJL_LEAF6_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf7PopToWords[cJL_LEAF7_MAXPOP1 + 1];
-#endif
-extern const uint8_t j__L_LeafWPopToWords[cJL_LEAFW_MAXPOP1 + 1];
-extern const uint8_t j__L_LeafVPopToWords[];
-
-// These tables indicate where value areas start:
-
-extern const uint8_t j__L_Leaf1Offset    [cJL_LEAF1_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf2Offset    [cJL_LEAF2_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf3Offset    [cJL_LEAF3_MAXPOP1 + 1];
-#ifdef JU_64BIT
-extern const uint8_t j__L_Leaf4Offset    [cJL_LEAF4_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf5Offset    [cJL_LEAF5_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf6Offset    [cJL_LEAF6_MAXPOP1 + 1];
-extern const uint8_t j__L_Leaf7Offset    [cJL_LEAF7_MAXPOP1 + 1];
-#endif
-extern const uint8_t j__L_LeafWOffset    [cJL_LEAFW_MAXPOP1 + 1];
-
-// Also define macros to hide the details in the code using these tables.
-
-#define JL_LEAF1GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF1_MAXPOP1, j__L_Leaf1PopToWords)
-#define JL_LEAF2GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF2_MAXPOP1, j__L_Leaf2PopToWords)
-#define JL_LEAF3GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF3_MAXPOP1, j__L_Leaf3PopToWords)
-#ifdef JU_64BIT
-#define JL_LEAF4GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF4_MAXPOP1, j__L_Leaf4PopToWords)
-#define JL_LEAF5GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF5_MAXPOP1, j__L_Leaf5PopToWords)
-#define JL_LEAF6GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF6_MAXPOP1, j__L_Leaf6PopToWords)
-#define JL_LEAF7GROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAF7_MAXPOP1, j__L_Leaf7PopToWords)
-#endif
-#define JL_LEAFWGROWINPLACE(Pop1) \
-        J__U_GROWCK(Pop1, cJL_LEAFW_MAXPOP1, j__L_LeafWPopToWords)
-#define JL_LEAFVGROWINPLACE(Pop1)  \
-        J__U_GROWCK(Pop1, cJU_BITSPERSUBEXPL,  j__L_LeafVPopToWords)
-
-#define JL_LEAF1VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf1Offset[Pop1])
-#define JL_LEAF2VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf2Offset[Pop1])
-#define JL_LEAF3VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf3Offset[Pop1])
-#ifdef JU_64BIT
-#define JL_LEAF4VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf4Offset[Pop1])
-#define JL_LEAF5VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf5Offset[Pop1])
-#define JL_LEAF6VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf6Offset[Pop1])
-#define JL_LEAF7VALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_Leaf7Offset[Pop1])
-#endif
-#define JL_LEAFWVALUEAREA(Pjv,Pop1)  (((PWord_t)(Pjv)) + j__L_LeafWOffset[Pop1])
-
-#define JL_LEAF1POPTOWORDS(Pop1)        (j__L_Leaf1PopToWords[Pop1])
-#define JL_LEAF2POPTOWORDS(Pop1)        (j__L_Leaf2PopToWords[Pop1])
-#define JL_LEAF3POPTOWORDS(Pop1)        (j__L_Leaf3PopToWords[Pop1])
-#ifdef JU_64BIT
-#define JL_LEAF4POPTOWORDS(Pop1)        (j__L_Leaf4PopToWords[Pop1])
-#define JL_LEAF5POPTOWORDS(Pop1)        (j__L_Leaf5PopToWords[Pop1])
-#define JL_LEAF6POPTOWORDS(Pop1)        (j__L_Leaf6PopToWords[Pop1])
-#define JL_LEAF7POPTOWORDS(Pop1)        (j__L_Leaf7PopToWords[Pop1])
-#endif
-#define JL_LEAFWPOPTOWORDS(Pop1)        (j__L_LeafWPopToWords[Pop1])
-#define JL_LEAFVPOPTOWORDS(Pop1)        (j__L_LeafVPopToWords[Pop1])
-
-
-// FUNCTIONS TO ALLOCATE OBJECTS:
-
-PjLpm_t j__udyLAllocJLPM(void);                         // constant size.
-
-Pjbl_t  j__udyLAllocJBL(          PjLpm_t);             // constant size.
-Pjbb_t  j__udyLAllocJBB(          PjLpm_t);             // constant size.
-Pjp_t   j__udyLAllocJBBJP(Word_t, PjLpm_t);
-Pjbu_t  j__udyLAllocJBU(          PjLpm_t);             // constant size.
-
-Pjll_t  j__udyLAllocJLL1( Word_t, PjLpm_t);
-Pjll_t  j__udyLAllocJLL2( Word_t, PjLpm_t);
-Pjll_t  j__udyLAllocJLL3( Word_t, PjLpm_t);
-
-#ifdef JU_64BIT
-Pjll_t  j__udyLAllocJLL4( Word_t, PjLpm_t);
-Pjll_t  j__udyLAllocJLL5( Word_t, PjLpm_t);
-Pjll_t  j__udyLAllocJLL6( Word_t, PjLpm_t);
-Pjll_t  j__udyLAllocJLL7( Word_t, PjLpm_t);
-#endif
-
-Pjlw_t  j__udyLAllocJLW(  Word_t         );             // no PjLpm_t needed.
-PjLlb_t j__udyLAllocJLB1(         PjLpm_t);             // constant size.
-Pjv_t   j__udyLAllocJV(   Word_t, PjLpm_t);
-
-
-// FUNCTIONS TO FREE OBJECTS:
-
-void    j__udyLFreeJLPM( PjLpm_t,        PjLpm_t);      // constant size.
-
-void    j__udyLFreeJBL(  Pjbl_t,         PjLpm_t);      // constant size.
-void    j__udyLFreeJBB(  Pjbb_t,         PjLpm_t);      // constant size.
-void    j__udyLFreeJBBJP(Pjp_t,  Word_t, PjLpm_t);
-void    j__udyLFreeJBU(  Pjbu_t,         PjLpm_t);      // constant size.
-
-void    j__udyLFreeJLL1( Pjll_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLL2( Pjll_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLL3( Pjll_t, Word_t, PjLpm_t);
-
-#ifdef JU_64BIT
-void    j__udyLFreeJLL4( Pjll_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLL5( Pjll_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLL6( Pjll_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLL7( Pjll_t, Word_t, PjLpm_t);
-#endif
-
-void    j__udyLFreeJLW(  Pjlw_t, Word_t, PjLpm_t);
-void    j__udyLFreeJLB1( PjLlb_t,        PjLpm_t);      // constant size.
-void    j__udyLFreeJV(   Pjv_t,  Word_t, PjLpm_t);
-void    j__udyLFreeSM(   Pjp_t,          PjLpm_t);      // everything below Pjp.
-
-#endif // ! _JUDYL_INCLUDED
diff --git a/libs/klib/judy/JudyMalloc.c b/libs/klib/judy/JudyMalloc.c
deleted file mode 100644
index 165521f..0000000
--- a/libs/klib/judy/JudyMalloc.c
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// ************************************************************************ //
-//                    JUDY - Memory Allocater                             //
-//                              -by-					  //
-//		         Douglas L. Baskins				  //
-//			  Hewlett Packard				  //
-//                        Fort Collins, Co				  //
-//                         (970) 229-2027				  //
-//									  //
-// ************************************************************************ //
-
-// JUDY INCLUDE FILES
-#include "Judy.h"
-
-// ****************************************************************************
-// J U D Y   M A L L O C
-//
-// Allocate RAM.  This is the single location in Judy code that calls
-// malloc(3C).  Note:  JPM accounting occurs at a higher level.
-
-Word_t JudyMalloc(
-	Word_t Words)
-{
-	Word_t Addr;
-
-	Addr = (Word_t) malloc(Words * sizeof(Word_t));
-	return(Addr);
-
-} // JudyMalloc()
-
-
-// ****************************************************************************
-// J U D Y   F R E E
-
-void JudyFree(
-	void * PWord,
-	Word_t Words)
-{
-	(void) Words;
-	free(PWord);
-
-} // JudyFree()
-
-
-// ****************************************************************************
-// J U D Y   M A L L O C
-//
-// Higher-level "wrapper" for allocating objects that need not be in RAM,
-// although at this time they are in fact only in RAM.  Later we hope that some
-// entire subtrees (at a JPM or branch) can be "virtual", so their allocations
-// and frees should go through this level.
-
-Word_t JudyMallocVirtual(
-	Word_t Words)
-{
-	return(JudyMalloc(Words));
-
-} // JudyMallocVirtual()
-
-
-// ****************************************************************************
-// J U D Y   F R E E
-
-void JudyFreeVirtual(
-	void * PWord,
-	Word_t Words)
-{
-        JudyFree(PWord, Words);
-
-} // JudyFreeVirtual()
diff --git a/libs/klib/judy/JudyMallocIF.c b/libs/klib/judy/JudyMallocIF.c
deleted file mode 100644
index fa91d80..0000000
--- a/libs/klib/judy/JudyMallocIF.c
+++ /dev/null
@@ -1,780 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy malloc/free interface functions for Judy1 and JudyL.
-//
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// Compile with -DTRACEMI (Malloc Interface) to turn on tracing of malloc/free
-// calls at the interface level.  (See also TRACEMF in lower-level code.)
-// Use -DTRACEMI2 for a terser format suitable for trace analysis.
-//
-// There can be malloc namespace bits in the LSBs of "raw" addresses from most,
-// but not all, of the j__udy*Alloc*() functions; see also JudyPrivate.h.  To
-// test the Judy code, compile this file with -DMALLOCBITS and use debug flavor
-// only (for assertions).  This test ensures that (a) all callers properly mask
-// the namespace bits out before dereferencing a pointer (or else a core dump
-// occurs), and (b) all callers send "raw" (unmasked) addresses to
-// j__udy*Free*() calls.
-//
-// Note:  Currently -DDEBUG turns on MALLOCBITS automatically.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-// Set "hidden" global j__uMaxWords to the maximum number of words to allocate
-// to any one array (large enough to have a JPM, otherwise j__uMaxWords is
-// ignored), to trigger a fake malloc error when the number is exceeded.  Note,
-// this code is always executed, not #ifdefd, because its virtually free.
-//
-// Note:  To keep the MALLOC macro faster and simpler, set j__uMaxWords to
-// MAXINT, not zero, by default.
-
-Word_t j__uMaxWords = ~0UL;
-
-// This macro hides the faking of a malloc failure:
-//
-// Note:  To keep this fast, just compare WordsPrev to j__uMaxWords without the
-// complexity of first adding WordsNow, meaning the trigger point is not
-// exactly where you might assume, but it shouldnt matter.
-
-#define MALLOC(MallocFunc,WordsPrev,WordsNow) \
-        (((WordsPrev) > j__uMaxWords) ? 0UL : MallocFunc(WordsNow))
-
-// Clear words starting at address:
-//
-// Note:  Only use this for objects that care; in other cases, it doesnt
-// matter if the objects memory is pre-zeroed.
-
-#define ZEROWORDS(Addr,Words)                   \
-        {                                       \
-            Word_t  Words__ = (Words);          \
-            PWord_t Addr__  = (PWord_t) (Addr); \
-            while (Words__--) *Addr__++ = 0UL;  \
-        }
-
-#ifdef TRACEMI
-
-// TRACING SUPPORT:
-//
-// Note:  For TRACEMI, use a format for address printing compatible with other
-// tracing facilities; in particular, %x not %lx, to truncate the "noisy" high
-// part on 64-bit systems.
-//
-// TBD: The trace macros need fixing for alternate address types.
-//
-// Note:  TRACEMI2 supports trace analysis no matter the underlying malloc/free
-// engine used.
-
-#include <stdio.h>
-
-static Word_t j__udyMemSequence = 0L;   // event sequence number.
-
-#define TRACE_ALLOC5(a,b,c,d,e)   (void) printf(a, (b), c, d)
-#define TRACE_FREE5( a,b,c,d,e)   (void) printf(a, (b), c, d)
-#define TRACE_ALLOC6(a,b,c,d,e,f) (void) printf(a, (b), c, d, e)
-#define TRACE_FREE6( a,b,c,d,e,f) (void) printf(a, (b), c, d, e)
-
-#else
-
-#ifdef TRACEMI2
-
-#include <stdio.h>
-
-#define b_pw cJU_BYTESPERWORD
-
-#define TRACE_ALLOC5(a,b,c,d,e)   \
-            (void) printf("a %lx %lx %lx\n", (b), (d) * b_pw, e)
-#define TRACE_FREE5( a,b,c,d,e)   \
-            (void) printf("f %lx %lx %lx\n", (b), (d) * b_pw, e)
-#define TRACE_ALLOC6(a,b,c,d,e,f)         \
-            (void) printf("a %lx %lx %lx\n", (b), (e) * b_pw, f)
-#define TRACE_FREE6( a,b,c,d,e,f)         \
-            (void) printf("f %lx %lx %lx\n", (b), (e) * b_pw, f)
-
-static Word_t j__udyMemSequence = 0L;   // event sequence number.
-
-#else
-
-#define TRACE_ALLOC5(a,b,c,d,e)   // null.
-#define TRACE_FREE5( a,b,c,d,e)   // null.
-#define TRACE_ALLOC6(a,b,c,d,e,f) // null.
-#define TRACE_FREE6( a,b,c,d,e,f) // null.
-
-#endif // ! TRACEMI2
-#endif // ! TRACEMI
-
-
-// MALLOC NAMESPACE SUPPORT:
-
-#if (defined(DEBUG) && (! defined(MALLOCBITS))) // for now, DEBUG => MALLOCBITS:
-#define MALLOCBITS 1
-#endif
-
-#ifdef MALLOCBITS
-#define MALLOCBITS_VALUE 0x3    // bit pattern to use.
-#define MALLOCBITS_MASK  0x7    // note: matches mask__ in JudyPrivate.h.
-
-#define MALLOCBITS_SET( Type,Addr) \
-        ((Addr) = (Type) ((Word_t) (Addr) |  MALLOCBITS_VALUE))
-#define MALLOCBITS_TEST(Type,Addr) \
-        assert((((Word_t) (Addr)) & MALLOCBITS_MASK) == MALLOCBITS_VALUE); \
-        ((Addr) = (Type) ((Word_t) (Addr) & ~MALLOCBITS_VALUE))
-#else
-#define MALLOCBITS_SET( Type,Addr)  // null.
-#define MALLOCBITS_TEST(Type,Addr)  // null.
-#endif
-
-
-// SAVE ERROR INFORMATION IN A Pjpm:
-//
-// "Small" (invalid) Addr values are used to distinguish overrun and no-mem
-// errors.  (TBD, non-zero invalid values are no longer returned from
-// lower-level functions, that is, JU_ERRNO_OVERRUN is no longer detected.)
-
-#define J__UDYSETALLOCERROR(Addr)                                       \
-        {                                                               \
-            JU_ERRID(Pjpm) = __LINE__;                                  \
-            if ((Word_t) (Addr) > 0) JU_ERRNO(Pjpm) = JU_ERRNO_OVERRUN; \
-            else                     JU_ERRNO(Pjpm) = JU_ERRNO_NOMEM;   \
-            return(0);                                                  \
-        }
-
-
-// ****************************************************************************
-// ALLOCATION FUNCTIONS:
-//
-// To help the compiler catch coding errors, each function returns a specific
-// object type.
-//
-// Note:  Only j__udyAllocJPM() and j__udyAllocJLW() return multiple values <=
-// sizeof(Word_t) to indicate the type of memory allocation failure.  Other
-// allocation functions convert this failure to a JU_ERRNO.
-
-
-// Note:  Unlike other j__udyAlloc*() functions, Pjpms are returned non-raw,
-// that is, without malloc namespace or root pointer type bits:
-
-FUNCTION Pjpm_t j__udyAllocJPM(void)
-{
-        Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD;
-        Pjpm_t Pjpm  = (Pjpm_t) MALLOC(JudyMalloc, Words, Words);
-
-        assert((Words * cJU_BYTESPERWORD) == sizeof(jpm_t));
-
-        if ((Word_t) Pjpm > sizeof(Word_t))
-        {
-            ZEROWORDS(Pjpm, Words);
-            Pjpm->jpm_TotalMemWords = Words;
-        }
-
-        TRACE_ALLOC5("0x%x %8lu = j__udyAllocJPM(), Words = %lu\n",
-                     Pjpm, j__udyMemSequence++, Words, cJU_LEAFW_MAXPOP1 + 1);
-        // MALLOCBITS_SET(Pjpm_t, Pjpm);  // see above.
-        return(Pjpm);
-
-} // j__udyAllocJPM()
-
-
-FUNCTION Pjbl_t j__udyAllocJBL(Pjpm_t Pjpm)
-{
-        Word_t Words   = sizeof(jbl_t) / cJU_BYTESPERWORD;
-        Pjbl_t PjblRaw = (Pjbl_t) MALLOC(JudyMallocVirtual,
-                                         Pjpm->jpm_TotalMemWords, Words);
-
-        assert((Words * cJU_BYTESPERWORD) == sizeof(jbl_t));
-
-        if ((Word_t) PjblRaw > sizeof(Word_t))
-        {
-            ZEROWORDS(P_JBL(PjblRaw), Words);
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjblRaw); }
-
-        TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBL(), Words = %lu\n", PjblRaw,
-                     j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjbl_t, PjblRaw);
-        return(PjblRaw);
-
-} // j__udyAllocJBL()
-
-
-FUNCTION Pjbb_t j__udyAllocJBB(Pjpm_t Pjpm)
-{
-        Word_t Words   = sizeof(jbb_t) / cJU_BYTESPERWORD;
-        Pjbb_t PjbbRaw = (Pjbb_t) MALLOC(JudyMallocVirtual,
-                                         Pjpm->jpm_TotalMemWords, Words);
-
-        assert((Words * cJU_BYTESPERWORD) == sizeof(jbb_t));
-
-        if ((Word_t) PjbbRaw > sizeof(Word_t))
-        {
-            ZEROWORDS(P_JBB(PjbbRaw), Words);
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjbbRaw); }
-
-        TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBB(), Words = %lu\n", PjbbRaw,
-                     j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjbb_t, PjbbRaw);
-        return(PjbbRaw);
-
-} // j__udyAllocJBB()
-
-
-FUNCTION Pjp_t j__udyAllocJBBJP(Word_t NumJPs, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs);
-        Pjp_t  PjpRaw;
-
-        PjpRaw = (Pjp_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjpRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjpRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJBBJP(%lu), Words = %lu\n", PjpRaw,
-                     j__udyMemSequence++, NumJPs, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjp_t, PjpRaw);
-        return(PjpRaw);
-
-} // j__udyAllocJBBJP()
-
-
-FUNCTION Pjbu_t j__udyAllocJBU(Pjpm_t Pjpm)
-{
-        Word_t Words   = sizeof(jbu_t) / cJU_BYTESPERWORD;
-        Pjbu_t PjbuRaw = (Pjbu_t) MALLOC(JudyMallocVirtual,
-                                         Pjpm->jpm_TotalMemWords, Words);
-
-        assert((Words * cJU_BYTESPERWORD) == sizeof(jbu_t));
-
-        if ((Word_t) PjbuRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjbuRaw); }
-
-        TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBU(), Words = %lu\n", PjbuRaw,
-                     j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjbu_t, PjbuRaw);
-        return(PjbuRaw);
-
-} // j__udyAllocJBU()
-
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-FUNCTION Pjll_t j__udyAllocJLL1(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF1POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL1(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL1()
-
-#endif // (JUDYL || (! JU_64BIT))
-
-
-FUNCTION Pjll_t j__udyAllocJLL2(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF2POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL2(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL2()
-
-
-FUNCTION Pjll_t j__udyAllocJLL3(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF3POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL3(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL3()
-
-
-#ifdef JU_64BIT
-
-FUNCTION Pjll_t j__udyAllocJLL4(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF4POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL4(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL4()
-
-
-FUNCTION Pjll_t j__udyAllocJLL5(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF5POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL5(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL5()
-
-
-FUNCTION Pjll_t j__udyAllocJLL6(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF6POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL6(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL6()
-
-
-FUNCTION Pjll_t j__udyAllocJLL7(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF7POPTOWORDS(Pop1);
-        Pjll_t PjllRaw;
-
-        PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjllRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjllRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL7(%lu), Words = %lu\n", PjllRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjll_t, PjllRaw);
-        return(PjllRaw);
-
-} // j__udyAllocJLL7()
-
-#endif // JU_64BIT
-
-
-// Note:  Root-level leaf addresses are always whole words (Pjlw_t), and unlike
-// other j__udyAlloc*() functions, they are returned non-raw, that is, without
-// malloc namespace or root pointer type bits (the latter are added later by
-// the caller):
-
-FUNCTION Pjlw_t j__udyAllocJLW(Word_t Pop1)
-{
-        Word_t Words = JU_LEAFWPOPTOWORDS(Pop1);
-        Pjlw_t Pjlw  = (Pjlw_t) MALLOC(JudyMalloc, Words, Words);
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLW(%lu), Words = %lu\n", Pjlw,
-                     j__udyMemSequence++, Pop1, Words, Pop1);
-        // MALLOCBITS_SET(Pjlw_t, Pjlw);  // see above.
-        return(Pjlw);
-
-} // j__udyAllocJLW()
-
-
-FUNCTION Pjlb_t j__udyAllocJLB1(Pjpm_t Pjpm)
-{
-        Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD;
-        Pjlb_t PjlbRaw;
-
-        PjlbRaw = (Pjlb_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        assert((Words * cJU_BYTESPERWORD) == sizeof(jlb_t));
-
-        if ((Word_t) PjlbRaw > sizeof(Word_t))
-        {
-            ZEROWORDS(P_JLB(PjlbRaw), Words);
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjlbRaw); }
-
-        TRACE_ALLOC5("0x%x %8lu = j__udyAllocJLB1(), Words = %lu\n", PjlbRaw,
-                     j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjlb_t, PjlbRaw);
-        return(PjlbRaw);
-
-} // j__udyAllocJLB1()
-
-
-#ifdef JUDYL
-
-FUNCTION Pjv_t j__udyLAllocJV(Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JL_LEAFVPOPTOWORDS(Pop1);
-        Pjv_t  PjvRaw;
-
-        PjvRaw = (Pjv_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words);
-
-        if ((Word_t) PjvRaw > sizeof(Word_t))
-        {
-            Pjpm->jpm_TotalMemWords += Words;
-        }
-        else { J__UDYSETALLOCERROR(PjvRaw); }
-
-        TRACE_ALLOC6("0x%x %8lu = j__udyLAllocJV(%lu), Words = %lu\n", PjvRaw,
-                     j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2);
-        MALLOCBITS_SET(Pjv_t, PjvRaw);
-        return(PjvRaw);
-
-} // j__udyLAllocJV()
-
-#endif // JUDYL
-
-
-// ****************************************************************************
-// FREE FUNCTIONS:
-//
-// To help the compiler catch coding errors, each function takes a specific
-// object type to free.
-
-
-// Note:  j__udyFreeJPM() receives a root pointer with NO root pointer type
-// bits present, that is, they must be stripped by the caller using P_JPM():
-
-FUNCTION void j__udyFreeJPM(Pjpm_t PjpmFree, Pjpm_t PjpmStats)
-{
-        Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD;
-
-        // MALLOCBITS_TEST(Pjpm_t, PjpmFree);   // see above.
-        JudyFree((Pvoid_t) PjpmFree, Words);
-
-        if (PjpmStats != (Pjpm_t) NULL) PjpmStats->jpm_TotalMemWords -= Words;
-
-// Note:  Log PjpmFree->jpm_Pop0, similar to other j__udyFree*() functions, not
-// an assumed value of cJU_LEAFW_MAXPOP1, for when the caller is
-// Judy*FreeArray(), jpm_Pop0 is set to 0, and the population after the free
-// really will be 0, not cJU_LEAFW_MAXPOP1.
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJPM(%lu), Words = %lu\n", PjpmFree,
-                    j__udyMemSequence++, Words, Words, PjpmFree->jpm_Pop0);
-
-
-} // j__udyFreeJPM()
-
-
-FUNCTION void j__udyFreeJBL(Pjbl_t Pjbl, Pjpm_t Pjpm)
-{
-        Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD;
-
-        MALLOCBITS_TEST(Pjbl_t, Pjbl);
-        JudyFreeVirtual((Pvoid_t) Pjbl, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE5("0x%x %8lu =  j__udyFreeJBL(), Words = %lu\n", Pjbl,
-                    j__udyMemSequence++, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJBL()
-
-
-FUNCTION void j__udyFreeJBB(Pjbb_t Pjbb, Pjpm_t Pjpm)
-{
-        Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD;
-
-        MALLOCBITS_TEST(Pjbb_t, Pjbb);
-        JudyFreeVirtual((Pvoid_t) Pjbb, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE5("0x%x %8lu =  j__udyFreeJBB(), Words = %lu\n", Pjbb,
-                    j__udyMemSequence++, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJBB()
-
-
-FUNCTION void j__udyFreeJBBJP(Pjp_t Pjp, Word_t NumJPs, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs);
-
-        MALLOCBITS_TEST(Pjp_t, Pjp);
-        JudyFree((Pvoid_t) Pjp, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJBBJP(%lu), Words = %lu\n", Pjp,
-                    j__udyMemSequence++, NumJPs, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJBBJP()
-
-
-FUNCTION void j__udyFreeJBU(Pjbu_t Pjbu, Pjpm_t Pjpm)
-{
-        Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD;
-
-        MALLOCBITS_TEST(Pjbu_t, Pjbu);
-        JudyFreeVirtual((Pvoid_t) Pjbu, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE5("0x%x %8lu =  j__udyFreeJBU(), Words = %lu\n", Pjbu,
-                    j__udyMemSequence++, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJBU()
-
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-
-FUNCTION void j__udyFreeJLL1(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF1POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL1(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL1()
-
-#endif // (JUDYL || (! JU_64BIT))
-
-
-FUNCTION void j__udyFreeJLL2(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF2POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL2(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL2()
-
-
-FUNCTION void j__udyFreeJLL3(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF3POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL3(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL3()
-
-
-#ifdef JU_64BIT
-
-FUNCTION void j__udyFreeJLL4(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF4POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL4(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL4()
-
-
-FUNCTION void j__udyFreeJLL5(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF5POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL5(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL5()
-
-
-FUNCTION void j__udyFreeJLL6(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF6POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL6(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL6()
-
-
-FUNCTION void j__udyFreeJLL7(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAF7POPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjll_t, Pjll);
-        JudyFree((Pvoid_t) Pjll, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLL7(%lu), Words = %lu\n", Pjll,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLL7()
-
-#endif // JU_64BIT
-
-
-// Note:  j__udyFreeJLW() receives a root pointer with NO root pointer type
-// bits present, that is, they are stripped by P_JLW():
-
-FUNCTION void j__udyFreeJLW(Pjlw_t Pjlw, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JU_LEAFWPOPTOWORDS(Pop1);
-
-        // MALLOCBITS_TEST(Pjlw_t, Pjlw);       // see above.
-        JudyFree((Pvoid_t) Pjlw, Words);
-
-        if (Pjpm) Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu =  j__udyFreeJLW(%lu), Words = %lu\n", Pjlw,
-                    j__udyMemSequence++, Pop1, Words, Pop1 - 1);
-
-
-} // j__udyFreeJLW()
-
-
-FUNCTION void j__udyFreeJLB1(Pjlb_t Pjlb, Pjpm_t Pjpm)
-{
-        Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD;
-
-        MALLOCBITS_TEST(Pjlb_t, Pjlb);
-        JudyFree((Pvoid_t) Pjlb, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE5("0x%x %8lu =  j__udyFreeJLB1(), Words = %lu\n", Pjlb,
-                    j__udyMemSequence++, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyFreeJLB1()
-
-
-#ifdef JUDYL
-
-FUNCTION void j__udyLFreeJV(Pjv_t Pjv, Word_t Pop1, Pjpm_t Pjpm)
-{
-        Word_t Words = JL_LEAFVPOPTOWORDS(Pop1);
-
-        MALLOCBITS_TEST(Pjv_t, Pjv);
-        JudyFree((Pvoid_t) Pjv, Words);
-
-        Pjpm->jpm_TotalMemWords -= Words;
-
-        TRACE_FREE6("0x%x %8lu = j__udyLFreeJV(%lu), Words = %lu\n", Pjv,
-                    j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0);
-
-
-} // j__udyLFreeJV()
-
-#endif // JUDYL
diff --git a/libs/klib/judy/JudyMemActive.c b/libs/klib/judy/JudyMemActive.c
deleted file mode 100644
index d95a134..0000000
--- a/libs/klib/judy/JudyMemActive.c
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Return number of bytes of memory used to support a Judy1/L array.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-FUNCTION static Word_t j__udyGetMemActive(Pjp_t);
-
-
-// ****************************************************************************
-// J U D Y   1   M E M   A C T I V E
-// J U D Y   L   M E M   A C T I V E
-
-#ifdef JUDY1
-FUNCTION Word_t Judy1MemActive
-#else
-FUNCTION Word_t JudyLMemActive
-#endif
-        (
-	Pcvoid_t PArray	        // from which to retrieve.
-        )
-{
-	if (PArray == (Pcvoid_t)NULL) return(0);
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-        {
-	    Pjlw_t Pjlw = P_JLW(PArray);	// first word of leaf.
-            Word_t Words = Pjlw[0] + 1;		// population.
-#ifdef JUDY1
-            return((Words + 1) * sizeof(Word_t));
-#else
-            return(((Words * 2) + 1) * sizeof(Word_t));
-#endif
-        }
-	else
-	{
-	    Pjpm_t Pjpm = P_JPM(PArray);
-	    return(j__udyGetMemActive(&Pjpm->jpm_JP) + sizeof(jpm_t));
-	}
-
-} // JudyMemActive()
-
-
-// ****************************************************************************
-// __ J U D Y   G E T   M E M   A C T I V E
-
-FUNCTION static Word_t j__udyGetMemActive(
-	Pjp_t  Pjp)		// top of subtree.
-{
-	Word_t offset;		// in a branch.
-	Word_t Bytes = 0;	// actual bytes used at this level.
-	Word_t IdxSz;		// bytes per index in leaves
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-	case cJU_JPBRANCH_L2:
-	case cJU_JPBRANCH_L3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4:
-	case cJU_JPBRANCH_L5:
-	case cJU_JPBRANCH_L6:
-	case cJU_JPBRANCH_L7:
-#endif
-	case cJU_JPBRANCH_L:
-	{
-	    Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr);
-
-	    for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset)
-	        Bytes += j__udyGetMemActive((Pjbl->jbl_jp) + offset);
-
-	    return(Bytes + sizeof(jbl_t));
-	}
-
-	case cJU_JPBRANCH_B2:
-	case cJU_JPBRANCH_B3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4:
-	case cJU_JPBRANCH_B5:
-	case cJU_JPBRANCH_B6:
-	case cJU_JPBRANCH_B7:
-#endif
-	case cJU_JPBRANCH_B:
-	{
-	    Word_t subexp;
-	    Word_t jpcount;
-	    Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr);
-
-	    for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)
-	    {
-	        jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));
-                Bytes  += jpcount * sizeof(jp_t);
-
-		for (offset = 0; offset < jpcount; ++offset)
-		{
-		    Bytes += j__udyGetMemActive(P_JP(JU_JBB_PJP(Pjbb, subexp))
-			   + offset);
-		}
-	    }
-
-	    return(Bytes + sizeof(jbb_t));
-	}
-
-	case cJU_JPBRANCH_U2:
-	case cJU_JPBRANCH_U3:
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4:
-	case cJU_JPBRANCH_U5:
-	case cJU_JPBRANCH_U6:
-	case cJU_JPBRANCH_U7:
-#endif
-	case cJU_JPBRANCH_U:
-        {
-	    Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr);
-
-            for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset)
-	    {
-		if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1)
-		 && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX))
-		{
-		    continue;		// skip null JP to save time.
-		}
-
-	        Bytes += j__udyGetMemActive(Pjbu->jbu_jp + offset);
-	    }
-
-	    return(Bytes + sizeof(jbu_t));
-        }
-
-
-// -- Cases below here terminate and do not recurse. --
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-        case cJU_JPLEAF1: IdxSz = 1; goto LeafWords;
-#endif
-	case cJU_JPLEAF2: IdxSz = 2; goto LeafWords;
-	case cJU_JPLEAF3: IdxSz = 3; goto LeafWords;
-#ifdef JU_64BIT
-	case cJU_JPLEAF4: IdxSz = 4; goto LeafWords;
-	case cJU_JPLEAF5: IdxSz = 5; goto LeafWords;
-	case cJU_JPLEAF6: IdxSz = 6; goto LeafWords;
-	case cJU_JPLEAF7: IdxSz = 7; goto LeafWords;
-#endif
-LeafWords:
-
-#ifdef JUDY1
-            return(IdxSz * (JU_JPLEAF_POP0(Pjp) + 1));
-#else
-            return((IdxSz + sizeof(Word_t))
-		 * (JU_JPLEAF_POP0(Pjp) + 1));
-#endif
-	case cJU_JPLEAF_B1:
-	{
-#ifdef JUDY1
-            return(sizeof(jlb_t));
-#else
-            Bytes = (JU_JPLEAF_POP0(Pjp) + 1) * sizeof(Word_t);
-
-	    return(Bytes + sizeof(jlb_t));
-#endif
-	}
-
-	JUDY1CODE(case cJ1_JPFULLPOPU1: return(0);)
-
-#ifdef JUDY1
-#define J__Mpy 0
-#else
-#define J__Mpy sizeof(Word_t)
-#endif
-
-	case cJU_JPIMMED_1_01:	return(0);
-	case cJU_JPIMMED_2_01:	return(0);
-	case cJU_JPIMMED_3_01:	return(0);
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01:	return(0);
-	case cJU_JPIMMED_5_01:	return(0);
-	case cJU_JPIMMED_6_01:	return(0);
-	case cJU_JPIMMED_7_01:	return(0);
-#endif
-
-	case cJU_JPIMMED_1_02:	return(J__Mpy * 2);
-	case cJU_JPIMMED_1_03:	return(J__Mpy * 3);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:	return(J__Mpy * 4);
-	case cJU_JPIMMED_1_05:	return(J__Mpy * 5);
-	case cJU_JPIMMED_1_06:	return(J__Mpy * 6);
-	case cJU_JPIMMED_1_07:	return(J__Mpy * 7);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:	return(0);
-	case cJ1_JPIMMED_1_09:	return(0);
-	case cJ1_JPIMMED_1_10:	return(0);
-	case cJ1_JPIMMED_1_11:	return(0);
-	case cJ1_JPIMMED_1_12:	return(0);
-	case cJ1_JPIMMED_1_13:	return(0);
-	case cJ1_JPIMMED_1_14:	return(0);
-	case cJ1_JPIMMED_1_15:	return(0);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:	return(J__Mpy * 2);
-	case cJU_JPIMMED_2_03:	return(J__Mpy * 3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:	return(0);
-	case cJ1_JPIMMED_2_05:	return(0);
-	case cJ1_JPIMMED_2_06:	return(0);
-	case cJ1_JPIMMED_2_07:	return(0);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02:	return(J__Mpy * 2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03:	return(0);
-	case cJ1_JPIMMED_3_04:	return(0);
-	case cJ1_JPIMMED_3_05:	return(0);
-
-	case cJ1_JPIMMED_4_02:	return(0);
-	case cJ1_JPIMMED_4_03:	return(0);
-	case cJ1_JPIMMED_5_02:	return(0);
-	case cJ1_JPIMMED_5_03:	return(0);
-	case cJ1_JPIMMED_6_02:	return(0);
-	case cJ1_JPIMMED_7_02:	return(0);
-#endif
-
-	} // switch (JU_JPTYPE(Pjp))
-
-	return(0);			// to make some compilers happy.
-
-} // j__udyGetMemActive()
diff --git a/libs/klib/judy/JudyMemUsed.c b/libs/klib/judy/JudyMemUsed.c
deleted file mode 100644
index e25f65b..0000000
--- a/libs/klib/judy/JudyMemUsed.c
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Return number of bytes of memory used to support a Judy1/L array.
-// Compile with one of -DJUDY1 or -DJUDYL.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-#ifdef JUDY1
-FUNCTION Word_t Judy1MemUsed
-#else  // JUDYL
-FUNCTION Word_t JudyLMemUsed
-#endif
-        (
-	Pcvoid_t PArray 	// from which to retrieve.
-        )
-{
-	Word_t	 Words = 0;
-
-        if (PArray == (Pcvoid_t) NULL) return(0);
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw = P_JLW(PArray);		// first word of leaf.
-	    Words = JU_LEAFWPOPTOWORDS(Pjlw[0] + 1);	// based on pop1.
-	}
-	else
-	{
-	    Pjpm_t Pjpm = P_JPM(PArray);
-	    Words = Pjpm->jpm_TotalMemWords;
-	}
-
-	return(Words * sizeof(Word_t));		// convert to bytes.
-
-} // Judy1MemUsed() / JudyLMemUsed()
diff --git a/libs/klib/judy/JudyNext.c b/libs/klib/judy/JudyNext.c
deleted file mode 100644
index 4af06e2..0000000
--- a/libs/klib/judy/JudyNext.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define JUDYNEXT 1
-#include "JudyPrevNext.c"
diff --git a/libs/klib/judy/JudyNextEmpty.c b/libs/klib/judy/JudyNextEmpty.c
deleted file mode 100644
index 73b0926..0000000
--- a/libs/klib/judy/JudyNextEmpty.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define JUDYNEXT 1
-#include "JudyPrevNextEmpty.c"
diff --git a/libs/klib/judy/JudyPrev.c b/libs/klib/judy/JudyPrev.c
deleted file mode 100644
index 3d9f484..0000000
--- a/libs/klib/judy/JudyPrev.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define JUDYPREV 1
-#include "JudyPrevNext.c"
diff --git a/libs/klib/judy/JudyPrevEmpty.c b/libs/klib/judy/JudyPrevEmpty.c
deleted file mode 100644
index f9a182b..0000000
--- a/libs/klib/judy/JudyPrevEmpty.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define JUDYPREV 1
-#include "JudyPrevNextEmpty.c"
diff --git a/libs/klib/judy/JudyPrevNext.c b/libs/klib/judy/JudyPrevNext.c
deleted file mode 100644
index 1131eef..0000000
--- a/libs/klib/judy/JudyPrevNext.c
+++ /dev/null
@@ -1,1888 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to
-// Judy*Prev().
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifndef JUDYNEXT
-#ifndef JUDYPREV
-#define	JUDYPREV 1		// neither set => use default.
-#endif
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-
-// ****************************************************************************
-// J U D Y   1   P R E V
-// J U D Y   1   N E X T
-// J U D Y   L   P R E V
-// J U D Y   L   N E X T
-//
-// See the manual entry for the API.
-//
-// OVERVIEW OF Judy*Prev():
-//
-// Use a reentrant switch statement (state machine, SM1 = "get") to decode the
-// callers *PIndex-1, starting with the (PArray), through branches, if
-// any, down to an immediate or a leaf.  Look for *PIndex-1 in that leaf, and
-// if found, return it.
-//
-// A dead end is either a branch that does not contain a JP for the appropriate
-// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of
-// *PIndex-1.  Upon reaching a dead end, backtrack through the leaf/branches
-// that were just traversed, using a list (history) of parent JPs that is built
-// while going forward in SM1Get.  Start with the current leaf or branch.  In a
-// backtracked leaf, look for an Index less than *PIndex-1.  In each
-// backtracked branch, look "sideways" for the next JP, if any, lower than the
-// one for the digit (from *PIndex-1) that was previously decoded.  While
-// backtracking, if a leaf has no previous Index or a branch has no lower JP,
-// go to its parent branch in turn.  Upon reaching the JRP, return failure, "no
-// previous Index".  The backtrack process is sufficiently different from
-// SM1Get to merit its own separate reentrant switch statement (SM2 =
-// "backtrack").
-//
-// While backtracking, upon finding a lower JP in a branch, there is certain to
-// be a "prev" Index under that JP (unless the Judy array is corrupt).
-// Traverse forward again, this time taking the last (highest, right-most) JP
-// in each branch, and the last (highest) Index upon reaching an immediate or a
-// leaf.  This traversal is sufficiently different from SM1Get and SM2Backtrack
-// to merit its own separate reentrant switch statement (SM3 = "findlimit").
-//
-// "Decode" bytes in JPs complicate this process a little.  In SM1Get, when a
-// JP is a narrow pointer, that is, when states are skipped (so the skipped
-// digits are stored in jp_DcdPopO), compare the relevant digits to the same
-// digits in *PIndex-1.  If they are EQUAL, proceed in SM1Get as before.  If
-// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in
-// SM2Backtrack.  If jp_DcdPopOs digits are LESS, treat the JP as if it had
-// just been found during a backtrack and proceed directly in SM3Findlimit.
-//
-// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter.
-// Also note that in practice the Decode bytes are routinely compared with
-// *PIndex-1 because thats simpler and no slower than first testing for
-// narrowness.
-//
-// Decode bytes also make it unnecessary to construct the Index to return (the
-// revised *PIndex) during the search.  This step is deferred until finding an
-// Index during backtrack or findlimit, before returning it.  The first digit
-// of *PIndex is derived (saved) based on which JP is used in a JRP branch.
-// The remaining digits are obtained from the jp_DcdPopO field in the JP (if
-// any) above the immediate or leaf containing the found (prev) Index, plus the
-// remaining digit(s) in the immediate or leaf itself.  In the case of a LEAFW,
-// the Index to return is found directly in the leaf.
-//
-// Note:  Theoretically, as described above, upon reaching a dead end, SM1Get
-// passes control to SM2Backtrack to look sideways, even in a leaf.  Actually
-// its a little more efficient for the SM1Get leaf cases to shortcut this and
-// take care of the sideways searches themselves.  Hence the history list only
-// contains branch JPs, and SM2Backtrack only handles branches.  In fact, even
-// the branch handling cases in SM1Get do some shortcutting (sideways
-// searching) to avoid pushing history and calling SM2Backtrack unnecessarily.
-//
-// Upon reaching an Index to return after backtracking, *PIndex must be
-// modified to the found Index.  In principle this could be done by building
-// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from
-// the parent JP plus the appropriate Index bytes from the leaf.  However,
-// Immediates are difficult because their parent JPs lack one (last) digit.  So
-// instead just build the *PIndex to return "top down" while backtracking and
-// findlimiting.
-//
-// This function is written iteratively for speed, rather than recursively.
-//
-// CAVEATS:
-//
-// Why use a backtrack list (history stack), since it has finite size?  The
-// size is small for Judy on both 32-bit and 64-bit systems, and a list (really
-// just an array) is fast to maintain and use.  Other alternatives include
-// doing a lookahead (lookaside) in each branch while traversing forward
-// (decoding), and restarting from the top upon a dead end.
-//
-// A lookahead means noting the last branch traversed which contained a
-// non-null JP lower than the one specified by a digit in *PIndex-1, and
-// returning to that point for SM3Findlimit.  This seems like a good idea, and
-// should be pretty cheap for linear and bitmap branches, but it could result
-// in up to 31 unnecessary additional cache line fills (in extreme cases) for
-// every uncompressed branch traversed.  We have considered means of attaching
-// to or hiding within an uncompressed branch (in null JPs) a "cache line map"
-// or other structure, such as an offset to the next non-null JP, that would
-// speed this up, but it seems unnecessary merely to avoid having a
-// finite-length list (array).  (If JudySL is ever made "native", the finite
-// list length will be an issue.)
-//
-// Restarting at the top of the Judy array after a dead end requires a careful
-// modification of *PIndex-1 to decrement the digit for the parent branch and
-// set the remaining lower digits to all 1s.  This must be repeated each time a
-// parent branch contains another dead end, so even though it should all happen
-// in cache, the CPU time can be excessive.  (For JudySL or an equivalent
-// "infinitely deep" Judy array, consider a hybrid of a large, finite,
-// "circular" list and a restart-at-top when the list is backtracked to
-// exhaustion.)
-//
-// Why search for *PIndex-1 instead of *PIndex during SM1Get?  In rare
-// instances this prevents an unnecessary decode down the wrong path followed
-// by a backtrack; its pretty cheap to set up initially; and it means the
-// SM1Get machine can simply return if/when it finds that Index.
-//
-// TBD:  Wed like to enhance this function to make successive searches faster.
-// This would require saving some previous state, including the previous Index
-// returned, and in which leaf it was found.  If the next call is for the same
-// Index and the array has not been modified, start at the same leaf.  This
-// should be much easier to implement since this is iterative rather than
-// recursive code.
-//
-// VARIATIONS FOR Judy*Next():
-//
-// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code.
-// See the Judy*Prev() overview comments, and mentally switch the following:
-//
-// - "*PIndex-1"  => "*PIndex+1"
-// - "less than"  => "greater than"
-// - "lower"      => "higher"
-// - "lowest"     => "highest"
-// - "next-left"  => "next-right"
-// - "right-most" => "left-most"
-//
-// Note:  SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name
-// for both Prev and Next means many fewer ifdefs in this code.
-//
-// TBD:  Currently this code traverses a JP whether its expanse is partially or
-// completely full (populated).  For Judy1 (only), since there is no value area
-// needed, consider shortcutting to a "success" return upon encountering a full
-// JP in SM1Get (or even SM3Findlimit?)  A full JP looks like this:
-//
-//	(((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0)
-
-#ifdef JUDY1
-#ifdef JUDYPREV
-FUNCTION int Judy1Prev
-#else
-FUNCTION int Judy1Next
-#endif
-#else
-#ifdef JUDYPREV
-FUNCTION PPvoid_t JudyLPrev
-#else
-FUNCTION PPvoid_t JudyLNext
-#endif
-#endif
-        (
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-	Pjp_t	  Pjp, Pjp2;	// current JPs.
-	Pjbl_t	  Pjbl;		// Pjp->jp_Addr masked and cast to types:
-	Pjbb_t	  Pjbb;
-	Pjbu_t	  Pjbu;
-
-// Note:  The following initialization is not strictly required but it makes
-// gcc -Wall happy because there is an "impossible" path from Immed handling to
-// SM1LeafLImm code that looks like Pjll might be used before set:
-
-	Pjll_t	  Pjll = (Pjll_t) NULL;
-	Word_t	  state;	// current state in SM.
-	Word_t	  digit;	// next digit to decode from Index.
-
-// Note:  The following initialization is not strictly required but it makes
-// gcc -Wall happy because there is an "impossible" path from Immed handling to
-// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be
-// used before set:
-
-#if (defined(JUDYL) && defined(JUDYPREV))
-	Word_t	  pop1 = 0;	// in a leaf.
-#else
-	Word_t	  pop1;		// in a leaf.
-#endif
-	int	  offset;	// linear branch/leaf, from j__udySearchLeaf*().
-	int	  subexp;	// subexpanse in a bitmap branch.
-	Word_t	  bitposmask;	// bit in bitmap for Index.
-
-// History for SM2Backtrack:
-//
-// For a given histnum, APjphist[histnum] is a parent JP that points to a
-// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to
-// which the parent JP points.  The meaning of Aoffhist[histnum] depends on the
-// type of branch to which the parent JP points:
-//
-// Linear:  Offset of the next JP in the JP list.
-//
-// Bitmap:  Which subexpanse, plus the offset of the next JP in the
-// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(),
-// hidden one byte to the left, which digit, because Judy*Next() also needs
-// this.
-//
-// Uncompressed:  Digit, which is actually the offset of the JP in the branch.
-//
-// Note:  Only branch JPs are stored in APjphist[] because, as explained
-// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches
-// in some cases), so SM2Backtrack only handles branches.
-
-#define	HISTNUMMAX cJU_ROOTSTATE	// maximum branches traversable.
-	Pjp_t	APjphist[HISTNUMMAX];	// list of branch JPs traversed.
-	int	Aoffhist[HISTNUMMAX];	// list of next JP offsets; see above.
-	int	histnum = 0;		// number of JPs now in list.
-
-
-// ----------------------------------------------------------------------------
-// M A C R O S
-//
-// These are intended to make the code a bit more readable and less redundant.
-
-
-// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS:
-//
-// Note:  Ensure a corrupt Judy array does not overflow *hist[].  Meanwhile,
-// underflowing *hist[] simply means theres no more room to backtrack =>
-// "no previous/next Index".
-
-#define	HISTPUSH(Pjp,Offset)			\
-	APjphist[histnum] = (Pjp);		\
-	Aoffhist[histnum] = (Offset);		\
-						\
-	if (++histnum >= HISTNUMMAX)		\
-	{					\
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \
-	    JUDY1CODE(return(JERRI );)		\
-	    JUDYLCODE(return(PPJERR);)		\
-	}
-
-#define	HISTPOP(Pjp,Offset)			\
-	if ((histnum--) < 1) JU_RET_NOTFOUND;	\
-	(Pjp)	 = APjphist[histnum];		\
-	(Offset) = Aoffhist[histnum]
-
-// How to pack/unpack Aoffhist[] values for bitmap branches:
-
-#ifdef JUDYPREV
-
-#define	HISTPUSHBOFF(Subexp,Offset,Digit)	  \
-	(((Subexp) * cJU_BITSPERSUBEXPB) | (Offset))
-
-#define	HISTPOPBOFF(Subexp,Offset,Digit)	  \
-	(Subexp)  = (Offset) / cJU_BITSPERSUBEXPB; \
-	(Offset) %= cJU_BITSPERSUBEXPB
-#else
-
-#define	HISTPUSHBOFF(Subexp,Offset,Digit)	 \
-	 (((Digit) << cJU_BITSPERBYTE)		 \
-	| ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset))
-
-#define	HISTPOPBOFF(Subexp,Offset,Digit)	 \
-	(Digit)   = (Offset) >> cJU_BITSPERBYTE; \
-	(Subexp)  = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \
-	(Offset) %= cJU_BITSPERSUBEXPB
-#endif
-
-
-// CHECK FOR NULL JP:
-
-#define	JPNULL(Type)  (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX))
-
-
-// SEARCH A BITMAP:
-//
-// This is a weak analog of j__udySearchLeaf*() for bitmaps.  Return the actual
-// or next-left position, base 0, of Digit in the single uint32_t bitmap, also
-// given a Bitposmask for Digit.
-//
-// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if
-// Digits bit is unset, because the caller can check the bitmap themselves to
-// determine that.  Also, if Digits bit is unset, the returned offset is to
-// the next-left JP (including -1), not to the "ideal" position for the Index =
-// next-right JP.
-//
-// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which
-// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset.
-//
-// TBD for Judy*Next():  Should this return next-right instead of next-left?
-// That is, +1 from current value?  Maybe not, if Digits bit IS set, +1 would
-// be wrong.
-
-#define	SEARCHBITMAPB(Bitmap,Digit,Bitposmask)				\
-	(((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) :	\
-	 j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1)
-
-#define	SEARCHBITMAPL(Bitmap,Digit,Bitposmask)				\
-	(((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) :	\
-	 j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1)
-
-#ifdef JUDYPREV
-// Equivalent to search for the highest offset in Bitmap:
-
-#define	SEARCHBITMAPMAXB(Bitmap)				  \
-	(((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \
-	 j__udyCountBitsB(Bitmap) - 1)
-
-#define	SEARCHBITMAPMAXL(Bitmap)				  \
-	(((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \
-	 j__udyCountBitsL(Bitmap) - 1)
-#endif
-
-
-// CHECK DECODE BYTES:
-//
-// Check Decode bytes in a JP against the equivalent portion of *PIndex.  If
-// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a
-// dead end (the same as if it had been absent in a linear or bitmap branch or
-// null in an uncompressed branch), enter SM2Backtrack; otherwise enter
-// SM3Findlimit to find the highest/lowest Index under this JP, as if the code
-// had already backtracked to this JP.
-
-#ifdef JUDYPREV
-#define	CDcmp__ <
-#else
-#define	CDcmp__ >
-#endif
-
-#define	CHECKDCD(cState)						\
-	if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState))	                \
-	{								\
-	    if ((*PIndex		& cJU_DCDMASK(cState))		\
-	      CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState)))		\
-	    {								\
-		goto SM2Backtrack;					\
-	    }								\
-	    goto SM3Findlimit;						\
-	}
-
-
-// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1:
-//
-// Extract a state-dependent digit from Index in a "constant" way, then jump to
-// common code for multiple cases.
-
-#define	SM1PREPB(cState,Next)				\
-	state = (cState);				\
-	digit = JU_DIGITATSTATE(*PIndex, cState);	\
-	goto Next
-
-
-// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3:
-//
-// Optionally save Dcd bytes into *PIndex, then save state and jump to common
-// code for multiple cases.
-
-#define	SM3PREPB_DCD(cState,Next)			\
-	JU_SETDCD(*PIndex, Pjp, cState);	        \
-	SM3PREPB(cState,Next)
-
-#define	SM3PREPB(cState,Next)  state = (cState); goto Next
-
-
-// ----------------------------------------------------------------------------
-// CHECK FOR SHORTCUTS:
-//
-// Error out if PIndex is null.  Execute JU_RET_NOTFOUND if the Judy array is
-// empty or *PIndex is already the minimum/maximum Index possible.
-//
-// Note:  As documented, in case of failure *PIndex may be modified.
-
-	if (PIndex == (PWord_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-	}
-
-#ifdef JUDYPREV
-	if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0))
-#else
-	if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES))
-#endif
-	    JU_RET_NOTFOUND;
-
-
-// HANDLE JRP:
-//
-// Before even entering SM1Get, check the JRP type.  For JRP branches, traverse
-// the JPM; handle LEAFW leaves directly; but look for the most common cases
-// first.
-
-// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf:
-//
-// If *PIndex is in the leaf, return it; otherwise return the Index, if any,
-// below where it would belong.
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw = P_JLW(PArray);	// first word of leaf.
-	    pop1 = Pjlw[0] + 1;
-
-	    if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex))
-		>= 0)				// Index is present.
-	    {
-		assert(offset < pop1);			  // in expected range.
-		JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set.
-	    }
-
-#ifdef JUDYPREV
-	    if ((offset = ~offset) == 0)	// no next-left Index.
-#else
-	    if ((offset = ~offset) >= pop1)	// no next-right Index.
-#endif
-		JU_RET_NOTFOUND;
-
-	    assert(offset <= pop1);		// valid result.
-
-#ifdef JUDYPREV
-	    *PIndex = Pjlw[offset--];		// next-left Index, base 1.
-#else
-	    *PIndex = Pjlw[offset + 1];		// next-right Index, base 1.
-#endif
-	    JU_RET_FOUND_LEAFW(Pjlw, pop1, offset);	// base 0.
-
-	}
-	else	// JRP BRANCH
-	{
-	    Pjpm_t Pjpm = P_JPM(PArray);
-	    Pjp = &(Pjpm->jpm_JP);
-
-//	    goto SM1Get;
-	}
-
-// ============================================================================
-// STATE MACHINE 1 -- GET INDEX:
-//
-// Search for *PIndex (already decremented/incremented so as to be inclusive).
-// If found, return it.  Otherwise in theory hand off to SM2Backtrack or
-// SM3Findlimit, but in practice "shortcut" by first sideways searching the
-// current branch or leaf upon hitting a dead end.  During sideways search,
-// modify *PIndex to a new path taken.
-//
-// ENTRY:  Pjp points to next JP to interpret, whose Decode bytes have not yet
-// been checked.  This JP is not yet listed in history.
-//
-// Note:  Check Decode bytes at the start of each loop, not after looking up a
-// new JP, so its easy to do constant shifts/masks, although this requires
-// cautious handling of Pjp, offset, and *hist[] for correct entry to
-// SM2Backtrack.
-//
-// EXIT:  Return, or branch to SM2Backtrack or SM3Findlimit with correct
-// interface, as described elsewhere.
-//
-// WARNING:  For run-time efficiency the following cases replicate code with
-// varying constants, rather than using common code with variable values!
-
-SM1Get:				// return here for next branch/leaf.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then search for a JP for the
-// next digit in *PIndex.
-
-	case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL);
-	case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL);
-	case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL);
-	case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL);
-	case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL);
-#endif
-	case cJU_JPBRANCH_L:		   SM1PREPB(cJU_ROOTSTATE, SM1BranchL);
-
-// Common code (state-independent) for all cases of linear branches:
-
-SM1BranchL:
-	    Pjbl = P_JBL(Pjp->jp_Addr);
-
-// Found JP matching current digit in *PIndex; record parent JP and the next
-// JPs offset, and iterate to the next JP:
-
-	    if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse),
-					     Pjbl->jbl_NumJPs, digit)) >= 0)
-	    {
-		HISTPUSH(Pjp, offset);
-		Pjp = (Pjbl->jbl_jp) + offset;
-		goto SM1Get;
-	    }
-
-// Dead end, no JP in BranchL for next digit in *PIndex:
-//
-// Get the ideal location of digits JP, and if theres no next-left/right JP
-// in the BranchL, shortcut and start backtracking one level up; ignore the
-// current Pjp because it points to a BranchL with no next-left/right JP.
-
-#ifdef JUDYPREV
-	    if ((offset = (~offset) - 1) < 0)	// no next-left JP in BranchL.
-#else
-	    if ((offset = (~offset)) >= Pjbl->jbl_NumJPs)  // no next-right.
-#endif
-		goto SM2Backtrack;
-
-// Theres a next-left/right JP in the current BranchL; save its digit in
-// *PIndex and shortcut to SM3Findlimit:
-
-	    JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state);
-	    Pjp = (Pjbl->jbl_jp) + offset;
-	    goto SM3Findlimit;
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then look for a JP for the
-// next digit in *PIndex.
-
-	case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB);
-	case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB);
-	case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB);
-	case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB);
-	case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB);
-#endif
-	case cJU_JPBRANCH_B:		   SM1PREPB(cJU_ROOTSTATE, SM1BranchB);
-
-// Common code (state-independent) for all cases of bitmap branches:
-
-SM1BranchB:
-	    Pjbb = P_JBB(Pjp->jp_Addr);
-
-// Locate the digits JP in the subexpanse list, if present, otherwise the
-// offset of the next-left JP, if any:
-
-	    subexp     = digit / cJU_BITSPERSUBEXPB;
-	    assert(subexp < cJU_NUMSUBEXPB);	// falls in expected range.
-	    bitposmask = JU_BITPOSMASKB(digit);
-	    offset     = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit,
-				       bitposmask);
-	    // right range:
-	    assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB));
-
-// Found JP matching current digit in *PIndex:
-//
-// Record the parent JP and the next JPs offset; and iterate to the next JP.
-
-//	    if (JU_BITMAPTESTB(Pjbb, digit))			// slower.
-	    if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask)	// faster.
-	    {
-		// not negative since at least one bit is set:
-		assert(offset >= 0);
-
-		HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit));
-
-		if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL)
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-
-		Pjp += offset;
-		goto SM1Get;		// iterate to next JP.
-	    }
-
-// Dead end, no JP in BranchB for next digit in *PIndex:
-//
-// If theres a next-left/right JP in the current BranchB, shortcut to
-// SM3Findlimit.  Note:  offset is already set to the correct value for the
-// next-left/right JP.
-
-#ifdef JUDYPREV
-	    if (offset >= 0)		// next-left JP is in this subexpanse.
-		goto SM1BranchBFindlimit;
-
-	    while (--subexp >= 0)		// search next-left subexpanses.
-#else
-	    if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask))
-	    {
-		++offset;			// next-left => next-right.
-		goto SM1BranchBFindlimit;
-	    }
-
-	    while (++subexp < cJU_NUMSUBEXPB)	// search next-right subexps.
-#endif
-	    {
-		if (! JU_JBB_PJP(Pjbb, subexp)) continue;  // empty subexpanse.
-
-#ifdef JUDYPREV
-		offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp));
-		// expected range:
-		assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB));
-#else
-		offset = 0;
-#endif
-
-// Save the next-left/right JPs digit in *PIndex:
-
-SM1BranchBFindlimit:
-		JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp),
-				offset);
-		JU_SETDIGIT(*PIndex, digit, state);
-
-		if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL)
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-
-		Pjp += offset;
-		goto SM3Findlimit;
-	    }
-
-// Theres no next-left/right JP in the BranchB:
-//
-// Shortcut and start backtracking one level up; ignore the current Pjp because
-// it points to a BranchB with no next-left/right JP.
-
-	    goto SM2Backtrack;
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then look for a JP for the
-// next digit in *PIndex.
-
-	case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU);
-	case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU);
-	case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU);
-	case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU);
-	case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU);
-#endif
-	case cJU_JPBRANCH_U:		   SM1PREPB(cJU_ROOTSTATE, SM1BranchU);
-
-// Common code (state-independent) for all cases of uncompressed branches:
-
-SM1BranchU:
-	    Pjbu = P_JBU(Pjp->jp_Addr);
-	    Pjp2 = (Pjbu->jbu_jp) + digit;
-
-// Found JP matching current digit in *PIndex:
-//
-// Record the parent JP and the next JPs digit, and iterate to the next JP.
-//
-// TBD:  Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the
-// SM1Get state machine?  Then backtrack?  However, it means you cant detect
-// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and
-// return JU_RET_CORRUPT.
-
-	    if (! JPNULL(JU_JPTYPE(Pjp2)))	// digit has a JP.
-	    {
-		HISTPUSH(Pjp, digit);
-		Pjp = Pjp2;
-		goto SM1Get;
-	    }
-
-// Dead end, no JP in BranchU for next digit in *PIndex:
-//
-// Search for a next-left/right JP in the current BranchU, and if one is found,
-// save its digit in *PIndex and shortcut to SM3Findlimit:
-
-#ifdef JUDYPREV
-	    while (digit >= 1)
-	    {
-		Pjp = (Pjbu->jbu_jp) + (--digit);
-#else
-	    while (digit < cJU_BRANCHUNUMJPS - 1)
-	    {
-		Pjp = (Pjbu->jbu_jp) + (++digit);
-#endif
-		if (JPNULL(JU_JPTYPE(Pjp))) continue;
-
-		JU_SETDIGIT(*PIndex, digit, state);
-		goto SM3Findlimit;
-	    }
-
-// Theres no next-left/right JP in the BranchU:
-//
-// Shortcut and start backtracking one level up; ignore the current Pjp because
-// it points to a BranchU with no next-left/right JP.
-
-	    goto SM2Backtrack;
-
-
-// ----------------------------------------------------------------------------
-// LINEAR LEAF:
-//
-// Check Decode bytes, if any, in the current JP, then search the leaf for
-// *PIndex.
-
-#define	SM1LEAFL(Func)					\
-	Pjll   = P_JLL(Pjp->jp_Addr);			\
-	pop1   = JU_JPLEAF_POP0(Pjp) + 1;	        \
-	offset = Func(Pjll, pop1, *PIndex);		\
-	goto SM1LeafLImm
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:  CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1);
-#endif
-	case cJU_JPLEAF2:  CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2);
-	case cJU_JPLEAF3:  CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3);
-
-#ifdef JU_64BIT
-	case cJU_JPLEAF4:  CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4);
-	case cJU_JPLEAF5:  CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5);
-	case cJU_JPLEAF6:  CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6);
-	case cJU_JPLEAF7:  CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7);
-#endif
-
-// Common code (state-independent) for all cases of linear leaves and
-// immediates:
-
-SM1LeafLImm:
-	    if (offset >= 0)		// *PIndex is in LeafL / Immed.
-#ifdef JUDY1
-		JU_RET_FOUND;
-#else
-	    {				// JudyL is trickier...
-		switch (JU_JPTYPE(Pjp))
-		{
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-		case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset);
-#endif
-		case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset);
-		case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-#ifdef JU_64BIT
-		case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset);
-		case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset);
-		case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset);
-		case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset);
-#endif
-
-		case cJU_JPIMMED_1_01:
-		case cJU_JPIMMED_2_01:
-		case cJU_JPIMMED_3_01:
-#ifdef JU_64BIT
-		case cJU_JPIMMED_4_01:
-		case cJU_JPIMMED_5_01:
-		case cJU_JPIMMED_6_01:
-		case cJU_JPIMMED_7_01:
-#endif
-		    JU_RET_FOUND_IMM_01(Pjp);
-
-		case cJU_JPIMMED_1_02:
-		case cJU_JPIMMED_1_03:
-#ifdef JU_64BIT
-		case cJU_JPIMMED_1_04:
-		case cJU_JPIMMED_1_05:
-		case cJU_JPIMMED_1_06:
-		case cJU_JPIMMED_1_07:
-		case cJU_JPIMMED_2_02:
-		case cJU_JPIMMED_2_03:
-		case cJU_JPIMMED_3_02:
-#endif
-		    JU_RET_FOUND_IMM(Pjp, offset);
-		}
-
-		JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);  // impossible?
-		JUDY1CODE(return(JERRI );)
-		JUDYLCODE(return(PPJERR);)
-
-	    } // found *PIndex
-
-#endif // JUDYL
-
-// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex:
-//
-// Get the ideal location of Index, and if theres no next-left/right Index in
-// the LeafL / Immed, shortcut and start backtracking one level up; ignore the
-// current Pjp because it points to a LeafL / Immed with no next-left/right
-// Index.
-
-#ifdef JUDYPREV
-	    if ((offset = (~offset) - 1) < 0)	// no next-left Index.
-#else
-	    if ((offset = (~offset)) >= pop1)	// no next-right Index.
-#endif
-		goto SM2Backtrack;
-
-// Theres a next-left/right Index in the current LeafL / Immed; shortcut by
-// copying its digit(s) to *PIndex and returning it.
-//
-// Unfortunately this is pretty hairy, especially avoiding endian issues.
-//
-// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases
-// for *_02 and above, but must return differently, at least for JudyL, so
-// spell them out separately here at the cost of a little redundant code for
-// Judy1.
-
-	    switch (JU_JPTYPE(Pjp))
-	    {
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	    case cJU_JPLEAF1:
-
-		JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]);
-		JU_RET_FOUND_LEAF1(Pjll, pop1, offset);
-#endif
-
-	    case cJU_JPLEAF2:
-
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-			| ((uint16_t *) Pjll)[offset];
-		JU_RET_FOUND_LEAF2(Pjll, pop1, offset);
-
-	    case cJU_JPLEAF3:
-	    {
-		Word_t lsb;
-		JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-		JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-	    }
-
-#ifdef JU_64BIT
-	    case cJU_JPLEAF4:
-
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-			| ((uint32_t *) Pjll)[offset];
-		JU_RET_FOUND_LEAF4(Pjll, pop1, offset);
-
-	    case cJU_JPLEAF5:
-	    {
-		Word_t lsb;
-		JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-		JU_RET_FOUND_LEAF5(Pjll, pop1, offset);
-	    }
-
-	    case cJU_JPLEAF6:
-	    {
-		Word_t lsb;
-		JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-		JU_RET_FOUND_LEAF6(Pjll, pop1, offset);
-	    }
-
-	    case cJU_JPLEAF7:
-	    {
-		Word_t lsb;
-		JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-		JU_RET_FOUND_LEAF7(Pjll, pop1, offset);
-	    }
-
-#endif // JU_64BIT
-
-#define	SET_01(cState)  JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState)
-
-	    case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01;
-	    case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01;
-	    case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01;
-#ifdef JU_64BIT
-	    case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01;
-	    case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01;
-	    case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01;
-	    case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01;
-#endif
-SM1Imm_01:	JU_RET_FOUND_IMM_01(Pjp);
-
-// Shorthand for where to find start of Index bytes array:
-
-#ifdef JUDY1
-#define	PJI (Pjp->jp_1Index)
-#else
-#define	PJI (Pjp->jp_LIndex)
-#endif
-
-	    case cJU_JPIMMED_1_02:
-	    case cJU_JPIMMED_1_03:
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    case cJU_JPIMMED_1_04:
-	    case cJU_JPIMMED_1_05:
-	    case cJU_JPIMMED_1_06:
-	    case cJU_JPIMMED_1_07:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	    case cJ1_JPIMMED_1_08:
-	    case cJ1_JPIMMED_1_09:
-	    case cJ1_JPIMMED_1_10:
-	    case cJ1_JPIMMED_1_11:
-	    case cJ1_JPIMMED_1_12:
-	    case cJ1_JPIMMED_1_13:
-	    case cJ1_JPIMMED_1_14:
-	    case cJ1_JPIMMED_1_15:
-#endif
-		JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]);
-		JU_RET_FOUND_IMM(Pjp, offset);
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    case cJU_JPIMMED_2_02:
-	    case cJU_JPIMMED_2_03:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	    case cJ1_JPIMMED_2_04:
-	    case cJ1_JPIMMED_2_05:
-	    case cJ1_JPIMMED_2_06:
-	    case cJ1_JPIMMED_2_07:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-			| ((uint16_t *) PJI)[offset];
-		JU_RET_FOUND_IMM(Pjp, offset);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    case cJU_JPIMMED_3_02:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	    case cJ1_JPIMMED_3_03:
-	    case cJ1_JPIMMED_3_04:
-	    case cJ1_JPIMMED_3_05:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    {
-		Word_t lsb;
-		JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-		JU_RET_FOUND_IMM(Pjp, offset);
-	    }
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-	    case cJ1_JPIMMED_4_02:
-	    case cJ1_JPIMMED_4_03:
-
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-			| ((uint32_t *) PJI)[offset];
-		JU_RET_FOUND_IMM(Pjp, offset);
-
-	    case cJ1_JPIMMED_5_02:
-	    case cJ1_JPIMMED_5_03:
-	    {
-		Word_t lsb;
-		JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-		JU_RET_FOUND_IMM(Pjp, offset);
-	    }
-
-	    case cJ1_JPIMMED_6_02:
-	    {
-		Word_t lsb;
-		JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-		JU_RET_FOUND_IMM(Pjp, offset);
-	    }
-
-	    case cJ1_JPIMMED_7_02:
-	    {
-		Word_t lsb;
-		JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset));
-		*PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-		JU_RET_FOUND_IMM(Pjp, offset);
-	    }
-
-#endif // (JUDY1 && JU_64BIT)
-
-	    } // switch for not-found *PIndex
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);	// impossible?
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-
-// ----------------------------------------------------------------------------
-// BITMAP LEAF:
-//
-// Check Decode bytes, if any, in the current JP, then look in the leaf for
-// *PIndex.
-
-	case cJU_JPLEAF_B1:
-	{
-	    Pjlb_t Pjlb;
-	    CHECKDCD(1);
-
-	    Pjlb	= P_JLB(Pjp->jp_Addr);
-	    digit       = JU_DIGITATSTATE(*PIndex, 1);
-	    subexp      = JU_SUBEXPL(digit);
-	    bitposmask  = JU_BITPOSMASKL(digit);
-	    assert(subexp < cJU_NUMSUBEXPL);	// falls in expected range.
-
-// *PIndex exists in LeafB1:
-
-//	    if (JU_BITMAPTESTL(Pjlb, digit))			// slower.
-	    if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask)	// faster.
-	    {
-#ifdef JUDYL				// needs offset at this point:
-		offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask);
-#endif
-		JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset);
-//	== return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset)));
-	    }
-
-// Dead end, no Index in LeafB1 for remaining digit in *PIndex:
-//
-// If theres a next-left/right Index in the current LeafB1, which for
-// Judy*Next() is true if any bits are set for higher Indexes, shortcut by
-// returning it.  Note:  For Judy*Prev(), offset is set here to the correct
-// value for the next-left JP.
-
-	    offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit,
-				   bitposmask);
-	    // right range:
-	    assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL));
-
-#ifdef JUDYPREV
-	    if (offset >= 0)		// next-left JP is in this subexpanse.
-		goto SM1LeafB1Findlimit;
-
-	    while (--subexp >= 0)		// search next-left subexpanses.
-#else
-	    if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask))
-	    {
-		++offset;			// next-left => next-right.
-		goto SM1LeafB1Findlimit;
-	    }
-
-	    while (++subexp < cJU_NUMSUBEXPL)	// search next-right subexps.
-#endif
-	    {
-		if (! JU_JLB_BITMAP(Pjlb, subexp)) continue;  // empty subexp.
-
-#ifdef JUDYPREV
-		offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp));
-		// expected range:
-		assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL));
-#else
-		offset = 0;
-#endif
-
-// Save the next-left/right Indexess digit in *PIndex:
-
-SM1LeafB1Findlimit:
-		JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset);
-		JU_SETDIGIT1(*PIndex, digit);
-		JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset);
-//	== return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset)));
-	    }
-
-// Theres no next-left/right Index in the LeafB1:
-//
-// Shortcut and start backtracking one level up; ignore the current Pjp because
-// it points to a LeafB1 with no next-left/right Index.
-
-	    goto SM2Backtrack;
-
-	} // case cJU_JPLEAF_B1
-
-#ifdef JUDY1
-// ----------------------------------------------------------------------------
-// FULL POPULATION:
-//
-// If the Decode bytes match, *PIndex is found (without modification).
-
-	case cJ1_JPFULLPOPU1:
-
-	    CHECKDCD(1);
-	    JU_RET_FOUND_FULLPOPU1;
-#endif
-
-
-// ----------------------------------------------------------------------------
-// IMMEDIATE:
-
-#ifdef JUDYPREV
-#define	SM1IMM_SETPOP1(cPop1)
-#else
-#define SM1IMM_SETPOP1(cPop1)  pop1 = (cPop1)
-#endif
-
-#define	SM1IMM(Func,cPop1)				\
-	SM1IMM_SETPOP1(cPop1);				\
-	offset = Func((Pjll_t) (PJI), cPop1, *PIndex);	\
-	goto SM1LeafLImm
-
-// Special case for Pop1 = 1 Immediate JPs:
-//
-// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the
-// offset where it belongs, 0 or 1, same as from the search functions.
-
-#ifdef JUDYPREV
-#define	SM1IMM_01_SETPOP1
-#else
-#define SM1IMM_01_SETPOP1  pop1 = 1
-#endif
-
-#define	SM1IMM_01							  \
-	SM1IMM_01_SETPOP1;						  \
-	offset = ((JU_JPDCDPOP0(Pjp) <  JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \
-		  (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ?  0 : \
-								     ~0); \
-	goto SM1LeafLImm
-
-	case cJU_JPIMMED_1_01:
-	case cJU_JPIMMED_2_01:
-	case cJU_JPIMMED_3_01:
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01:
-	case cJU_JPIMMED_5_01:
-	case cJU_JPIMMED_6_01:
-	case cJU_JPIMMED_7_01:
-#endif
-	    SM1IMM_01;
-
-// TBD:  Doug says it would be OK to have fewer calls and calculate arg 2, here
-// and in Judy*Count() also.
-
-	case cJU_JPIMMED_1_02:  SM1IMM(j__udySearchLeaf1,  2);
-	case cJU_JPIMMED_1_03:  SM1IMM(j__udySearchLeaf1,  3);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:  SM1IMM(j__udySearchLeaf1,  4);
-	case cJU_JPIMMED_1_05:  SM1IMM(j__udySearchLeaf1,  5);
-	case cJU_JPIMMED_1_06:  SM1IMM(j__udySearchLeaf1,  6);
-	case cJU_JPIMMED_1_07:  SM1IMM(j__udySearchLeaf1,  7);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:  SM1IMM(j__udySearchLeaf1,  8);
-	case cJ1_JPIMMED_1_09:  SM1IMM(j__udySearchLeaf1,  9);
-	case cJ1_JPIMMED_1_10:  SM1IMM(j__udySearchLeaf1, 10);
-	case cJ1_JPIMMED_1_11:  SM1IMM(j__udySearchLeaf1, 11);
-	case cJ1_JPIMMED_1_12:  SM1IMM(j__udySearchLeaf1, 12);
-	case cJ1_JPIMMED_1_13:  SM1IMM(j__udySearchLeaf1, 13);
-	case cJ1_JPIMMED_1_14:  SM1IMM(j__udySearchLeaf1, 14);
-	case cJ1_JPIMMED_1_15:  SM1IMM(j__udySearchLeaf1, 15);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:  SM1IMM(j__udySearchLeaf2,  2);
-	case cJU_JPIMMED_2_03:  SM1IMM(j__udySearchLeaf2,  3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:  SM1IMM(j__udySearchLeaf2,  4);
-	case cJ1_JPIMMED_2_05:  SM1IMM(j__udySearchLeaf2,  5);
-	case cJ1_JPIMMED_2_06:  SM1IMM(j__udySearchLeaf2,  6);
-	case cJ1_JPIMMED_2_07:  SM1IMM(j__udySearchLeaf2,  7);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02:  SM1IMM(j__udySearchLeaf3,  2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03:  SM1IMM(j__udySearchLeaf3,  3);
-	case cJ1_JPIMMED_3_04:  SM1IMM(j__udySearchLeaf3,  4);
-	case cJ1_JPIMMED_3_05:  SM1IMM(j__udySearchLeaf3,  5);
-
-	case cJ1_JPIMMED_4_02:  SM1IMM(j__udySearchLeaf4,  2);
-	case cJ1_JPIMMED_4_03:  SM1IMM(j__udySearchLeaf4,  3);
-
-	case cJ1_JPIMMED_5_02:  SM1IMM(j__udySearchLeaf5,  2);
-	case cJ1_JPIMMED_5_03:  SM1IMM(j__udySearchLeaf5,  3);
-
-	case cJ1_JPIMMED_6_02:  SM1IMM(j__udySearchLeaf6,  2);
-
-	case cJ1_JPIMMED_7_02:  SM1IMM(j__udySearchLeaf7,  2);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// INVALID JP TYPE:
-
-	default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		 JUDY1CODE(return(JERRI );)
-		 JUDYLCODE(return(PPJERR);)
-
-	} // SM1Get switch.
-
-	/*NOTREACHED*/
-
-
-// ============================================================================
-// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP:
-//
-// Look for the next-left/right JP in a branch, backing up the history list as
-// necessary.  Upon finding a next-left/right JP, modify the corresponding
-// digit in *PIndex before passing control to SM3Findlimit.
-//
-// Note:  As described earlier, only branch JPs are expected here; other types
-// fall into the default case.
-//
-// Note:  If a found JP contains needed Dcd bytes, thats OK, theyre copied to
-// *PIndex in SM3Findlimit.
-//
-// TBD:  This code has a lot in common with similar code in the shortcut cases
-// in SM1Get.  Can combine this code somehow?
-//
-// ENTRY:  List, possibly empty, of JPs and offsets in APjphist[] and
-// Aoffhist[]; see earlier comments.
-//
-// EXIT:  Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to
-// SM3Findlimit to resume a new but different downward search.
-
-SM2Backtrack:		// come or return here for first/next sideways search.
-
-	HISTPOP(Pjp, offset);
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH:
-
-	case cJU_JPBRANCH_L2: state = 2;	     goto SM2BranchL;
-	case cJU_JPBRANCH_L3: state = 3;	     goto SM2BranchL;
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4: state = 4;	     goto SM2BranchL;
-	case cJU_JPBRANCH_L5: state = 5;	     goto SM2BranchL;
-	case cJU_JPBRANCH_L6: state = 6;	     goto SM2BranchL;
-	case cJU_JPBRANCH_L7: state = 7;	     goto SM2BranchL;
-#endif
-	case cJU_JPBRANCH_L:  state = cJU_ROOTSTATE; goto SM2BranchL;
-
-SM2BranchL:
-#ifdef JUDYPREV
-	    if (--offset < 0) goto SM2Backtrack;  // no next-left JP in BranchL.
-#endif
-	    Pjbl = P_JBL(Pjp->jp_Addr);
-#ifdef JUDYNEXT
-	    if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack;
-						// no next-right JP in BranchL.
-#endif
-
-// Theres a next-left/right JP in the current BranchL; save its digit in
-// *PIndex and continue with SM3Findlimit:
-
-	    JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state);
-	    Pjp = (Pjbl->jbl_jp) + offset;
-	    goto SM3Findlimit;
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH:
-
-	case cJU_JPBRANCH_B2: state = 2;	     goto SM2BranchB;
-	case cJU_JPBRANCH_B3: state = 3;	     goto SM2BranchB;
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4: state = 4;	     goto SM2BranchB;
-	case cJU_JPBRANCH_B5: state = 5;	     goto SM2BranchB;
-	case cJU_JPBRANCH_B6: state = 6;	     goto SM2BranchB;
-	case cJU_JPBRANCH_B7: state = 7;	     goto SM2BranchB;
-#endif
-	case cJU_JPBRANCH_B:  state = cJU_ROOTSTATE; goto SM2BranchB;
-
-SM2BranchB:
-	    Pjbb = P_JBB(Pjp->jp_Addr);
-	    HISTPOPBOFF(subexp, offset, digit);		// unpack values.
-
-// If theres a next-left/right JP in the current BranchB, which for
-// Judy*Next() is true if any bits are set for higher Indexes, continue to
-// SM3Findlimit:
-//
-// Note:  offset is set to the JP previously traversed; go one to the
-// left/right.
-
-#ifdef JUDYPREV
-	    if (offset > 0)		// next-left JP is in this subexpanse.
-	    {
-		--offset;
-		goto SM2BranchBFindlimit;
-	    }
-
-	    while (--subexp >= 0)		// search next-left subexpanses.
-#else
-	    if (JU_JBB_BITMAP(Pjbb, subexp)
-	      & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit)))
-	    {
-		++offset;			// next-left => next-right.
-		goto SM2BranchBFindlimit;
-	    }
-
-	    while (++subexp < cJU_NUMSUBEXPB)	// search next-right subexps.
-#endif
-	    {
-		if (! JU_JBB_PJP(Pjbb, subexp)) continue;  // empty subexpanse.
-
-#ifdef JUDYPREV
-		offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp));
-		// expected range:
-		assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB));
-#else
-		offset = 0;
-#endif
-
-// Save the next-left/right JPs digit in *PIndex:
-
-SM2BranchBFindlimit:
-		JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp),
-				offset);
-		JU_SETDIGIT(*PIndex, digit, state);
-
-		if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL)
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-
-		Pjp += offset;
-		goto SM3Findlimit;
-	    }
-
-// Theres no next-left/right JP in the BranchB:
-
-	    goto SM2Backtrack;
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH:
-
-	case cJU_JPBRANCH_U2: state = 2;	     goto SM2BranchU;
-	case cJU_JPBRANCH_U3: state = 3;	     goto SM2BranchU;
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4: state = 4;	     goto SM2BranchU;
-	case cJU_JPBRANCH_U5: state = 5;	     goto SM2BranchU;
-	case cJU_JPBRANCH_U6: state = 6;	     goto SM2BranchU;
-	case cJU_JPBRANCH_U7: state = 7;	     goto SM2BranchU;
-#endif
-	case cJU_JPBRANCH_U:  state = cJU_ROOTSTATE; goto SM2BranchU;
-
-SM2BranchU:
-
-// Search for a next-left/right JP in the current BranchU, and if one is found,
-// save its digit in *PIndex and continue to SM3Findlimit:
-
-	    Pjbu  = P_JBU(Pjp->jp_Addr);
-	    digit = offset;
-
-#ifdef JUDYPREV
-	    while (digit >= 1)
-	    {
-		Pjp = (Pjbu->jbu_jp) + (--digit);
-#else
-	    while (digit < cJU_BRANCHUNUMJPS - 1)
-	    {
-		Pjp = (Pjbu->jbu_jp) + (++digit);
-#endif
-		if (JPNULL(JU_JPTYPE(Pjp))) continue;
-
-		JU_SETDIGIT(*PIndex, digit, state);
-		goto SM3Findlimit;
-	    }
-
-// Theres no next-left/right JP in the BranchU:
-
-	    goto SM2Backtrack;
-
-
-// ----------------------------------------------------------------------------
-// INVALID JP TYPE:
-
-	default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		 JUDY1CODE(return(JERRI );)
-		 JUDYLCODE(return(PPJERR);)
-
-	} // SM2Backtrack switch.
-
-	/*NOTREACHED*/
-
-
-// ============================================================================
-// STATE MACHINE 3 -- FIND LIMIT JP/INDEX:
-//
-// Look for the highest/lowest (right/left-most) JP in each branch and the
-// highest/lowest Index in a leaf or immediate, and return it.  While
-// traversing, modify appropriate digit(s) in *PIndex to reflect the path
-// taken, including Dcd bytes in each JP (which could hold critical missing
-// digits for skipped branches).
-//
-// ENTRY:  Pjp set to a JP under which to find max/min JPs (if a branch JP) or
-// a max/min Index and return (if a leaf or immediate JP).
-//
-// EXIT:  Execute JU_RET_FOUND* upon reaching a leaf or immediate.  Should be
-// impossible to fail, unless the Judy array is corrupt.
-
-SM3Findlimit:		// come or return here for first/next branch/leaf.
-
-	switch (JU_JPTYPE(Pjp))
-	{
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH:
-//
-// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first
-// copy the Dcd bytes to *PIndex if there are any (only if state <
-// cJU_ROOTSTATE - 1).
-
-	case cJU_JPBRANCH_L2:  SM3PREPB_DCD(2, SM3BranchL);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_L3:  SM3PREPB(    3, SM3BranchL);
-#else
-	case cJU_JPBRANCH_L3:  SM3PREPB_DCD(3, SM3BranchL);
-	case cJU_JPBRANCH_L4:  SM3PREPB_DCD(4, SM3BranchL);
-	case cJU_JPBRANCH_L5:  SM3PREPB_DCD(5, SM3BranchL);
-	case cJU_JPBRANCH_L6:  SM3PREPB_DCD(6, SM3BranchL);
-	case cJU_JPBRANCH_L7:  SM3PREPB(    7, SM3BranchL);
-#endif
-	case cJU_JPBRANCH_L:   SM3PREPB(    cJU_ROOTSTATE, SM3BranchL);
-
-SM3BranchL:
-	    Pjbl = P_JBL(Pjp->jp_Addr);
-
-#ifdef JUDYPREV
-	    if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0)
-#else
-	    offset = 0; if ((Pjbl->jbl_NumJPs) == 0)
-#endif
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		JUDY1CODE(return(JERRI );)
-		JUDYLCODE(return(PPJERR);)
-	    }
-
-	    JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state);
-	    Pjp = (Pjbl->jbl_jp) + offset;
-	    goto SM3Findlimit;
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH:
-//
-// Look for the highest/lowest (right/left-most) non-null subexpanse, then use
-// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there
-// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex.
-
-	case cJU_JPBRANCH_B2:  SM3PREPB_DCD(2, SM3BranchB);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_B3:  SM3PREPB(    3, SM3BranchB);
-#else
-	case cJU_JPBRANCH_B3:  SM3PREPB_DCD(3, SM3BranchB);
-	case cJU_JPBRANCH_B4:  SM3PREPB_DCD(4, SM3BranchB);
-	case cJU_JPBRANCH_B5:  SM3PREPB_DCD(5, SM3BranchB);
-	case cJU_JPBRANCH_B6:  SM3PREPB_DCD(6, SM3BranchB);
-	case cJU_JPBRANCH_B7:  SM3PREPB(    7, SM3BranchB);
-#endif
-	case cJU_JPBRANCH_B:   SM3PREPB(    cJU_ROOTSTATE, SM3BranchB);
-
-SM3BranchB:
-	    Pjbb   = P_JBB(Pjp->jp_Addr);
-#ifdef JUDYPREV
-	    subexp = cJU_NUMSUBEXPB;
-
-	    while (! (JU_JBB_BITMAP(Pjbb, --subexp)))  // find non-empty subexp.
-	    {
-		if (subexp <= 0)		    // wholly empty bitmap.
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-	    }
-
-	    offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp));
-	    // expected range:
-	    assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB));
-#else
-	    subexp = -1;
-
-	    while (! (JU_JBB_BITMAP(Pjbb, ++subexp)))  // find non-empty subexp.
-	    {
-		if (subexp >= cJU_NUMSUBEXPB - 1)      // didnt find one.
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-	    }
-
-	    offset = 0;
-#endif
-
-	    JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset);
-	    JU_SETDIGIT(*PIndex, digit, state);
-
-	    if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL)
-	    {
-		JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		JUDY1CODE(return(JERRI );)
-		JUDYLCODE(return(PPJERR);)
-	    }
-
-	    Pjp += offset;
-	    goto SM3Findlimit;
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH:
-//
-// Look for the highest/lowest (right/left-most) non-null JP, and use it, but
-// first copy Dcd bytes to *PIndex if there are any (only if state <
-// cJU_ROOTSTATE - 1).
-
-	case cJU_JPBRANCH_U2:  SM3PREPB_DCD(2, SM3BranchU);
-#ifndef JU_64BIT
-	case cJU_JPBRANCH_U3:  SM3PREPB(    3, SM3BranchU);
-#else
-	case cJU_JPBRANCH_U3:  SM3PREPB_DCD(3, SM3BranchU);
-	case cJU_JPBRANCH_U4:  SM3PREPB_DCD(4, SM3BranchU);
-	case cJU_JPBRANCH_U5:  SM3PREPB_DCD(5, SM3BranchU);
-	case cJU_JPBRANCH_U6:  SM3PREPB_DCD(6, SM3BranchU);
-	case cJU_JPBRANCH_U7:  SM3PREPB(    7, SM3BranchU);
-#endif
-	case cJU_JPBRANCH_U:   SM3PREPB(    cJU_ROOTSTATE, SM3BranchU);
-
-SM3BranchU:
-	    Pjbu  = P_JBU(Pjp->jp_Addr);
-#ifdef JUDYPREV
-	    digit = cJU_BRANCHUNUMJPS;
-
-	    while (digit >= 1)
-	    {
-		Pjp = (Pjbu->jbu_jp) + (--digit);
-#else
-
-	    for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit)
-	    {
-		Pjp = (Pjbu->jbu_jp) + digit;
-#endif
-		if (JPNULL(JU_JPTYPE(Pjp))) continue;
-
-		JU_SETDIGIT(*PIndex, digit, state);
-		goto SM3Findlimit;
-	    }
-
-// No non-null JPs in BranchU:
-
-	    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-	    JUDY1CODE(return(JERRI );)
-	    JUDYLCODE(return(PPJERR);)
-
-
-// ----------------------------------------------------------------------------
-// LINEAR LEAF:
-//
-// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the
-// details vary depending on leaf Index Size.  First copy Dcd bytes, if there
-// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex.
-
-#define	SM3LEAFLDCD(cState)				\
-	JU_SETDCD(*PIndex, Pjp, cState);	        \
-	SM3LEAFLNODCD
-
-#ifdef JUDY1
-#define	SM3LEAFL_SETPOP1		// not needed in any cases.
-#else
-#define	SM3LEAFL_SETPOP1  pop1 = JU_JPLEAF_POP0(Pjp) + 1
-#endif
-
-#ifdef JUDYPREV
-#define	SM3LEAFLNODCD			\
-	Pjll = P_JLL(Pjp->jp_Addr);	\
-	SM3LEAFL_SETPOP1;		\
-	offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0)
-#else
-#define	SM3LEAFLNODCD			\
-	Pjll = P_JLL(Pjp->jp_Addr);	\
-	SM3LEAFL_SETPOP1;		\
-	offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0);
-#endif
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:
-
-	    SM3LEAFLDCD(1);
-	    JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]);
-	    JU_RET_FOUND_LEAF1(Pjll, pop1, offset);
-#endif
-
-	case cJU_JPLEAF2:
-
-	    SM3LEAFLDCD(2);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-		    | ((uint16_t *) Pjll)[offset];
-	    JU_RET_FOUND_LEAF2(Pjll, pop1, offset);
-
-#ifndef JU_64BIT
-	case cJU_JPLEAF3:
-	{
-	    Word_t lsb;
-	    SM3LEAFLNODCD;
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-	}
-
-#else
-	case cJU_JPLEAF3:
-	{
-	    Word_t lsb;
-	    SM3LEAFLDCD(3);
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_LEAF3(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF4:
-
-	    SM3LEAFLDCD(4);
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-		    | ((uint32_t *) Pjll)[offset];
-	    JU_RET_FOUND_LEAF4(Pjll, pop1, offset);
-
-	case cJU_JPLEAF5:
-	{
-	    Word_t lsb;
-	    SM3LEAFLDCD(5);
-	    JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-	    JU_RET_FOUND_LEAF5(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF6:
-	{
-	    Word_t lsb;
-	    SM3LEAFLDCD(6);
-	    JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-	    JU_RET_FOUND_LEAF6(Pjll, pop1, offset);
-	}
-
-	case cJU_JPLEAF7:
-	{
-	    Word_t lsb;
-	    SM3LEAFLNODCD;
-	    JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-	    JU_RET_FOUND_LEAF7(Pjll, pop1, offset);
-	}
-#endif
-
-
-// ----------------------------------------------------------------------------
-// BITMAP LEAF:
-//
-// Look for the highest/lowest (right/left-most) non-null subexpanse, then use
-// the highest/lowest Index in that subexpanse, but first copy Dcd bytes
-// (always present since state 1 < cJU_ROOTSTATE) to *PIndex.
-
-	case cJU_JPLEAF_B1:
-	{
-	    Pjlb_t Pjlb;
-
-	    JU_SETDCD(*PIndex, Pjp, 1);
-
-	    Pjlb   = P_JLB(Pjp->jp_Addr);
-#ifdef JUDYPREV
-	    subexp = cJU_NUMSUBEXPL;
-
-	    while (! JU_JLB_BITMAP(Pjlb, --subexp))  // find non-empty subexp.
-	    {
-		if (subexp <= 0)		// wholly empty bitmap.
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-	    }
-
-// TBD:  Might it be faster to just use a variant of BITMAPDIGIT*() that yields
-// the digit for the right-most Index with a bit set?
-
-	    offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp));
-	    // expected range:
-	    assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL));
-#else
-	    subexp = -1;
-
-	    while (! JU_JLB_BITMAP(Pjlb, ++subexp))  // find non-empty subexp.
-	    {
-		if (subexp >= cJU_NUMSUBEXPL - 1)    // didnt find one.
-		{
-		    JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		    JUDY1CODE(return(JERRI );)
-		    JUDYLCODE(return(PPJERR);)
-		}
-	    }
-
-	    offset = 0;
-#endif
-
-	    JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset);
-	    JU_SETDIGIT1(*PIndex, digit);
-	    JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset);
-//	== return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset)));
-
-	} // case cJU_JPLEAF_B1
-
-#ifdef JUDY1
-// ----------------------------------------------------------------------------
-// FULL POPULATION:
-//
-// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE),
-// then set the highest/lowest possible digit as the LSB in *PIndex.
-
-	case cJ1_JPFULLPOPU1:
-
-	    JU_SETDCD(   *PIndex, Pjp, 1);
-#ifdef JUDYPREV
-	    JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1);
-#else
-	    JU_SETDIGIT1(*PIndex, 0);
-#endif
-	    JU_RET_FOUND_FULLPOPU1;
-#endif // JUDY1
-
-
-// ----------------------------------------------------------------------------
-// IMMEDIATE:
-//
-// Simply use the highest/lowest (right/left-most) Index in the Imm, but the
-// details vary depending on leaf Index Size and pop1.  Note:  There are no Dcd
-// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the
-// least bytes of the immediate Index.
-
-	case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01;
-	case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01;
-	case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01;
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01;
-	case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01;
-	case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01;
-	case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01;
-#endif
-SM3Imm_01:	JU_RET_FOUND_IMM_01(Pjp);
-
-#ifdef JUDYPREV
-#define	SM3IMM_OFFSET(cPop1)  (cPop1) - 1	// highest.
-#else
-#define	SM3IMM_OFFSET(cPop1)  0			// lowest.
-#endif
-
-#define	SM3IMM(cPop1,Next)		\
-	offset = SM3IMM_OFFSET(cPop1);	\
-	goto Next
-
-	case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1);
-	case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1);
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1);
-	case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1);
-	case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1);
-	case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1);
-	case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1);
-	case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1);
-	case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1);
-	case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1);
-	case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1);
-	case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1);
-	case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1);
-#endif
-
-SM3Imm1:    JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]);
-	    JU_RET_FOUND_IMM(Pjp, offset);
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2);
-	case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2);
-	case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2);
-	case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2);
-	case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-SM3Imm2:    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2)))
-		    | ((uint16_t *) PJI)[offset];
-	    JU_RET_FOUND_IMM(Pjp, offset);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3);
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3);
-	case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3);
-	case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-SM3Imm3:
-	{
-	    Word_t lsb;
-	    JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4);
-	case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4);
-
-SM3Imm4:    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4)))
-		    | ((uint32_t *) PJI)[offset];
-	    JU_RET_FOUND_IMM(Pjp, offset);
-
-	case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5);
-	case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5);
-
-SM3Imm5:
-	{
-	    Word_t lsb;
-	    JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-
-	case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6);
-
-SM3Imm6:
-	{
-	    Word_t lsb;
-	    JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-
-	case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7);
-
-SM3Imm7:
-	{
-	    Word_t lsb;
-	    JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset));
-	    *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb;
-	    JU_RET_FOUND_IMM(Pjp, offset);
-	}
-#endif // (JUDY1 && JU_64BIT)
-
-
-// ----------------------------------------------------------------------------
-// OTHER CASES:
-
-	default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT);
-		 JUDY1CODE(return(JERRI );)
-		 JUDYLCODE(return(PPJERR);)
-
-	} // SM3Findlimit switch.
-
-	/*NOTREACHED*/
-
-} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext()
diff --git a/libs/klib/judy/JudyPrevNextEmpty.c b/libs/klib/judy/JudyPrevNextEmpty.c
deleted file mode 100644
index 7eef40d..0000000
--- a/libs/klib/judy/JudyPrevNextEmpty.c
+++ /dev/null
@@ -1,1388 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL.
-// Compile with one of -DJUDY1 or -DJUDYL.
-//
-// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise
-// defaults to Judy*PrevEmpty().
-//
-// Compile with -DTRACEJPSE to trace JP traversals.
-//
-// This file is separate from JudyPrevNext.c because it differs too greatly for
-// ifdefs.  This might be a bit surprising, but there are two reasons:
-//
-// - First, down in the details, searching for an empty index (SearchEmpty) is
-//   remarkably asymmetric with searching for a valid index (SearchValid),
-//   mainly with respect to:  No return of a value area for JudyL; partially-
-//   full versus totally-full JPs; and handling of narrow pointers.
-//
-// - Second, we chose to implement SearchEmpty without a backtrack stack or
-//   backtrack engine, partly as an experiment, and partly because we think
-//   restarting from the top of the tree is less likely for SearchEmpty than
-//   for SearchValid, because empty indexes are more likely than valid indexes.
-//
-// A word about naming:  A prior version of this feature (see 4.13) was named
-// Judy*Free(), but there were concerns about that being read as a verb rather
-// than an adjective.  After prolonged debate and based on user input, we
-// changed "Free" to "Empty".
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#ifndef JUDYNEXT
-#ifndef JUDYPREV
-#define	JUDYPREV 1		// neither set => use default.
-#endif
-#endif
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-
-#include "JudyPrivate1L.h"
-
-#ifdef TRACEJPSE
-#include "JudyPrintJP.c"
-#endif
-
-
-// ****************************************************************************
-// J U D Y   1   P R E V   E M P T Y
-// J U D Y   1   N E X T   E M P T Y
-// J U D Y   L   P R E V   E M P T Y
-// J U D Y   L   N E X T   E M P T Y
-//
-// See the manual entry for the API.
-//
-// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty():
-//
-// See also for comparison the equivalent comments in JudyPrevNext.c.
-//
-// Take the callers *PIndex and subtract/add 1, but watch out for
-// underflow/overflow, which means "no previous/next empty index found."  Use a
-// reentrant switch statement (state machine, see SMGetRestart and
-// SMGetContinue) to decode Index, starting with the JRP (PArray), through a
-// JPM and branches, if any, down to an immediate or a leaf.  Look for Index in
-// that immediate or leaf, and if not found (invalid index), return success
-// (Index is empty).
-//
-// This search can result in a dead end where taking a different path is
-// required.  There are four kinds of dead ends:
-//
-// BRANCH PRIMARY dead end:  Encountering a fully-populated JP for the
-// appropriate digit in Index.  Search sideways in the branch for the
-// previous/next absent/null/non-full JP, and if one is found, set Index to the
-// highest/lowest index possible in that JPs expanse.  Then if the JP is an
-// absent or null JP, return success; otherwise for a non-full JP, traverse
-// through the partially populated JP.
-//
-// BRANCH SECONDARY dead end:  Reaching the end of a branch during a sideways
-// search after a branch primary dead end.  Set Index to the lowest/highest
-// index possible in the whole branchs expanse (one higher/lower than the
-// previous/next branchs expanse), then restart at the top of the tree, which
-// includes pre-decrementing/incrementing Index (again) and watching for
-// underflow/overflow (again).
-//
-// LEAF PRIMARY dead end:  Finding a valid (non-empty) index in an immediate or
-// leaf matching Index.  Search sideways in the immediate/leaf for the
-// previous/next empty index; if found, set *PIndex to match and return success.
-//
-// LEAF SECONDARY dead end:  Reaching the end of an immediate or leaf during a
-// sideways search after a leaf primary dead end.  Just as for a branch
-// secondary dead end, restart at the top of the tree with Index set to the
-// lowest/highest index possible in the whole immediate/leafs expanse.
-// TBD:  If leaf secondary dead end occurs, could shortcut and treat it as a
-// branch primary dead end; but this would require remembering the parent
-// branchs type and offset (a "one-deep stack"), and also wrestling with
-// narrow pointers, at least for leaves (but not for immediates).
-//
-// Note some ASYMMETRIES between SearchValid and SearchEmpty:
-//
-// - The SearchValid code, upon descending through a narrow pointer, if Index
-//   is outside the expanse of the subsidiary node (effectively a secondary
-//   dead end), must decide whether to backtrack or findlimit.  But the
-//   SearchEmpty code simply returns success (Index is empty).
-//
-// - Similarly, the SearchValid code, upon finding no previous/next index in
-//   the expanse of a narrow pointer (again, a secondary dead end), can simply
-//   start to backtrack at the parent JP.  But the SearchEmpty code would have
-//   to first determine whether or not the parent JPs narrow expanse contains
-//   a previous/next empty index outside the subexpanse.  Rather than keeping a
-//   parent state stack and backtracking this way, upon a secondary dead end,
-//   the SearchEmpty code simply restarts at the top of the tree, whether or
-//   not a narrow pointer is involved.  Again, see the equivalent comments in
-//   JudyPrevNext.c for comparison.
-//
-// This function is written iteratively for speed, rather than recursively.
-//
-// TBD:  Wed like to enhance this function to make successive searches faster.
-// This would require saving some previous state, including the previous Index
-// returned, and in which leaf it was found.  If the next call is for the same
-// Index and the array has not been modified, start at the same leaf.  This
-// should be much easier to implement since this is iterative rather than
-// recursive code.
-
-#ifdef JUDY1
-#ifdef JUDYPREV
-FUNCTION int Judy1PrevEmpty
-#else
-FUNCTION int Judy1NextEmpty
-#endif
-#else
-#ifdef JUDYPREV
-FUNCTION int JudyLPrevEmpty
-#else
-FUNCTION int JudyLNextEmpty
-#endif
-#endif
-        (
-	Pcvoid_t  PArray,	// Judy array to search.
-	Word_t *  PIndex,	// starting point and result.
-	PJError_t PJError	// optional, for returning error info.
-        )
-{
-	Word_t	  Index;	// fast copy, in a register.
-	Pjp_t	  Pjp;		// current JP.
-	Pjbl_t	  Pjbl;		// Pjp->jp_Addr masked and cast to types:
-	Pjbb_t	  Pjbb;
-	Pjbu_t	  Pjbu;
-	Pjlb_t	  Pjlb;
-	PWord_t	  Pword;	// alternate name for use by GET* macros.
-
-	Word_t	  digit;	// next digit to decode from Index.
-	Word_t	  digits;	// current state in SM = digits left to decode.
-	Word_t	  pop0;		// in a leaf.
-	Word_t	  pop0mask;	// precalculated to avoid variable shifts.
-	long	  offset;	// within a branch or leaf (can be large).
-	int	  subexp;	// subexpanse in a bitmap branch.
-	BITMAPB_t bitposmaskB;	// bit in bitmap for bitmap branch.
-	BITMAPL_t bitposmaskL;	// bit in bitmap for bitmap leaf.
-	Word_t	  possfullJP1;	// JP types for possibly full subexpanses:
-	Word_t	  possfullJP2;
-	Word_t	  possfullJP3;
-
-
-// ----------------------------------------------------------------------------
-// M A C R O S
-//
-// These are intended to make the code a bit more readable and less redundant.
-
-
-// CHECK FOR NULL JP:
-//
-// TBD:  In principle this can be reduced (here and in other *.c files) to just
-// the latter clause since no Type should ever be below cJU_JPNULL1, but in
-// fact some root pointer types can be lower, so for safety do both checks.
-
-#define	JPNULL(Type)  (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX))
-
-
-// CHECK FOR A FULL JP:
-//
-// Given a JP, indicate if it is fully populated.  Use digits, pop0mask, and
-// possfullJP1..3 in the context.
-//
-// This is a difficult problem because it requires checking the Pop0 bits for
-// all-ones, but the number of bytes depends on the JP type, which is not
-// directly related to the parent branchs type or level -- the JPs child
-// could be under a narrow pointer (hence not full).  The simple answer
-// requires switching on or otherwise calculating the JP type, which could be
-// slow.  Instead, in SMPREPB* precalculate pop0mask and also record in
-// possfullJP1..3 the child JP (branch) types that could possibly be full (one
-// level down), and use them here.  For level-2 branches (with digits == 2),
-// the test for a full child depends on Judy1/JudyL.
-//
-// Note:  This cannot be applied to the JP in a JPM because it doesnt have
-// enough pop0 digits.
-//
-// TBD:  JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither
-// of those can ever be full as it turns out.  Could just check for a BranchU
-// at the right level.  Also, pop0mask might be overkill, its not used much,
-// so perhaps just call cJU_POP0MASK(digits - 1) here?
-//
-// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a
-// branch, that is, a JP in a branch at level 3 or higher:
-
-#define	JPFULL_BRANCH(Pjp)						\
-	  ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0)	\
-	&& ((JU_JPTYPE(Pjp) == possfullJP1)				\
-	 || (JU_JPTYPE(Pjp) == possfullJP2)				\
-	 || (JU_JPTYPE(Pjp) == possfullJP3)))
-
-#ifdef JUDY1
-#define	JPFULL(Pjp)							\
-	((digits == 2) ?						\
-	 (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp))
-#else
-#define	JPFULL(Pjp)							\
-	((digits == 2) ?						\
-	   (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1)				\
-	 && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \
-	 JPFULL_BRANCH(Pjp))
-#endif
-
-
-// RETURN SUCCESS:
-//
-// This hides the need to set *PIndex back to the local value of Index -- use a
-// local value for faster operation.  Note that the callers *PIndex is ALWAYS
-// modified upon success, at least decremented/incremented.
-
-#define	RET_SUCCESS { *PIndex = Index; return(1); }
-
-
-// RETURN A CORRUPTION:
-
-#define	RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); }
-
-
-// SEARCH A BITMAP BRANCH:
-//
-// This is a weak analog of j__udySearchLeaf*() for bitmap branches.  Return
-// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap
-// (subexpanse of a full bitmap), also given a Bitposmask for Digit.  The
-// position is the offset within the set bits.
-//
-// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if
-// Digits bit is unset, because the caller can check the bitmap themselves to
-// determine that.  Also, if Digits bit is unset, the returned offset is to
-// the next-left JP or index (including -1), not to the "ideal" position for
-// the index = next-right JP or index.
-//
-// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which
-// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset.
-
-#define	SEARCHBITMAPB(Bitmap,Digit,Bitposmask)				\
-	(((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) :	\
-	 j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1)
-
-#ifdef JUDYPREV
-// Equivalent to search for the highest offset in Bitmap, that is, one less
-// than the number of bits set:
-
-#define	SEARCHBITMAPMAXB(Bitmap)					\
-	(((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 :	\
-	 j__udyCountBitsB(Bitmap) - 1)
-#endif
-
-
-// CHECK DECODE BYTES:
-//
-// Check Decode bytes in a JP against the equivalent portion of Index.  If they
-// dont match, Index is outside the subexpanse of a narrow pointer, hence is
-// empty.
-
-#define	CHECKDCD(cDigits) \
-	if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS
-
-
-// REVISE REMAINDER OF INDEX:
-//
-// Put one digit in place in Index and clear/set the lower digits, if any, so
-// the resulting Index is at the start/end of an expanse, or just clear/set the
-// least digits.
-//
-// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least
-// digits of Index including the digit to be overridden, then set the value of
-// that one digit.  If Digits == 1 the first operation is redundant, but either
-// very fast or even removed by the optimizer.
-
-#define	CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits)
-#define	SETLEASTDIGITS(  Digits) Index |=  JU_LEASTBYTESMASK(Digits)
-
-#define	CLEARLEASTDIGITS_D(Digit,Digits)	\
-	{					\
-	    CLEARLEASTDIGITS(Digits);		\
-	    JU_SETDIGIT(Index, Digit, Digits);	\
-	}
-
-#define	SETLEASTDIGITS_D(Digit,Digits)		\
-	{					\
-	    SETLEASTDIGITS(Digits);		\
-	    JU_SETDIGIT(Index, Digit, Digits);	\
-	}
-
-
-// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE:
-
-#define	SET_AND_RETURN(OpLeastDigits,Digit,Digits)	\
-	{						\
-	    OpLeastDigits(Digit, Digits);		\
-	    RET_SUCCESS;				\
-	}
-
-#define	SET_AND_CONTINUE(OpLeastDigits,Digit,Digits)	\
-	{						\
-	    OpLeastDigits(Digit, Digits);		\
-	    goto SMGetContinue;				\
-	}
-
-
-// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE:
-//
-// Extract a state-dependent digit from Index in a "constant" way, then jump to
-// common code for multiple cases.
-//
-// TBD:  Should this macro do more, such as preparing variable-shift masks for
-// use in CLEARLEASTDIGITS and SETLEASTDIGITS?
-
-#define	SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3)	\
-	digits	 = (cDigits);						\
-	digit	 = JU_DIGITATSTATE(Index, cDigits);			\
-	pop0mask = cJU_POP0MASK((cDigits) - 1);	 /* for branchs JPs */	\
-	possfullJP1 = (PossFullJP1);					\
-	possfullJP2 = (PossFullJP2);					\
-	possfullJP3 = (PossFullJP3);					\
-	goto Next
-
-// Variations for specific-level branches and for shorthands:
-//
-// Note:  SMPREPB2 need not initialize possfullJP* because JPFULL does not use
-// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so
-// waste a bit of time and space to get rid of the warning:
-
-#define	SMPREPB2(Next)				\
-	digits	 = 2;				\
-	digit	 = JU_DIGITATSTATE(Index, 2);	\
-	pop0mask = cJU_POP0MASK(1);  /* for branchs JPs */ \
-	possfullJP1 = possfullJP2 = possfullJP3 = 0;	    \
-	goto Next
-
-#define	SMPREPB3(Next) SMPREPB(3,	      Next, cJU_JPBRANCH_L2, \
-						    cJU_JPBRANCH_B2, \
-						    cJU_JPBRANCH_U2)
-#ifndef JU_64BIT
-#define	SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \
-						    cJU_JPBRANCH_B3, \
-						    cJU_JPBRANCH_U3)
-#else
-#define	SMPREPB4(Next) SMPREPB(4,	      Next, cJU_JPBRANCH_L3, \
-						    cJU_JPBRANCH_B3, \
-						    cJU_JPBRANCH_U3)
-#define	SMPREPB5(Next) SMPREPB(5,	      Next, cJU_JPBRANCH_L4, \
-						    cJU_JPBRANCH_B4, \
-						    cJU_JPBRANCH_U4)
-#define	SMPREPB6(Next) SMPREPB(6,	      Next, cJU_JPBRANCH_L5, \
-						    cJU_JPBRANCH_B5, \
-						    cJU_JPBRANCH_U5)
-#define	SMPREPB7(Next) SMPREPB(7,	      Next, cJU_JPBRANCH_L6, \
-						    cJU_JPBRANCH_B6, \
-						    cJU_JPBRANCH_U6)
-#define	SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \
-						    cJU_JPBRANCH_B7, \
-						    cJU_JPBRANCH_U7)
-#endif
-
-
-// RESTART AFTER SECONDARY DEAD END:
-//
-// Set Index to the first/last index in the branch or leaf subexpanse and start
-// over at the top of the tree.
-
-#ifdef JUDYPREV
-#define	SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; }
-#else
-#define	SMRESTART(Digits) { SETLEASTDIGITS(  Digits); goto SMGetRestart; }
-#endif
-
-
-// CHECK EDGE OF LEAFS EXPANSE:
-//
-// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently
-// in an immediate JP), the level (index size) of the leaf, and the full index
-// to return (as Index in the context) already set to the full index matching
-// the lowest/highest one, determine if there is an empty index in the leafs
-// expanse below/above the lowest/highest index, which is true if the
-// lowest/highest index is not at the "edge" of the leafs expanse based on its
-// LSBs.  If so, return Index decremented/incremented; otherwise restart at the
-// top of the tree.
-//
-// Note:  In many cases Index is already at the right spot and calling
-// SMRESTART instead of just going directly to SMGetRestart is a bit of
-// overkill.
-//
-// Note:  Variable shift occurs if Digits is not a constant.
-
-#ifdef JUDYPREV
-#define	LEAF_EDGE(MinIndex,Digits)			\
-	{						\
-	    if (MinIndex) { --Index; RET_SUCCESS; }	\
-	    SMRESTART(Digits);				\
-	}
-#else
-#define	LEAF_EDGE(MaxIndex,Digits)			\
-	{						\
-	    if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \
-	    { ++Index; RET_SUCCESS; }			\
-	    SMRESTART(Digits);				\
-	}
-#endif
-
-// Same as above except Index is not already set to match the lowest/highest
-// index, so do that before decrementing/incrementing it:
-
-#ifdef JUDYPREV
-#define	LEAF_EDGE_SET(MinIndex,Digits)	\
-	{				\
-	    if (MinIndex)		\
-	    { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \
-	    SMRESTART(Digits);		\
-	}
-#else
-#define	LEAF_EDGE_SET(MaxIndex,Digits)	\
-	{				\
-	    if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits))	    \
-	    { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \
-	    SMRESTART(Digits);		\
-	}
-#endif
-
-
-// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF:
-//
-// Given an index location in a leaf (or equivalently an immediate JP) known to
-// contain a usable hole (an empty index less/greater than Index), and the LSBs
-// of a minimum/maximum index to locate, find the previous/next empty index and
-// return it.
-//
-// Note:  "Even" index sizes (1,2,4[,8] bytes) have corresponding native C
-// types; "odd" index sizes dont, but they are not represented here because
-// they are handled completely differently; see elsewhere.
-
-#ifdef JUDYPREV
-
-#define	LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB)				\
-	{								\
-	    while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */	\
-	    if (*(Pjll) < (IndexLSB)) RET_SUCCESS  /* Index is empty */	\
-	    while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\
-	    JU_SETDIGITS(Index, IndexLSB, cDigits);			\
-	    RET_SUCCESS;						\
-	}
-#else
-#define	LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB)				\
-	{								\
-	    while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */	\
-	    if (*(Pjll) > (IndexLSB)) RET_SUCCESS  /* Index is empty */	\
-	    while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\
-	    JU_SETDIGITS(Index, IndexLSB, cDigits);			\
-	    RET_SUCCESS;						\
-	}
-#endif
-
-
-// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF:
-//
-// Given a pointer to the first index in a leaf (or equivalently an immediate
-// JP), the population of the leaf, and a first empty Index to find (inclusive,
-// as Index in the context), where Index is known to fall within the expanse of
-// the leaf to search, efficiently find the previous/next empty index in the
-// leaf, if any.  For simplicity the following overview is stated in terms of
-// Judy*NextEmpty() only, but the same concepts apply symmetrically for
-// Judy*PrevEmpty().  Also, in each case the comparisons are for the LSBs of
-// Index and leaf indexes, according to the leafs level.
-//
-// 1.  If Index is GREATER than the last (highest) index in the leaf
-//     (maxindex), return success, Index is empty.  (Remember, Index is known
-//     to be in the leafs expanse.)
-//
-// 2.  If Index is EQUAL to maxindex:  If maxindex is not at the edge of the
-//     leafs expanse, increment Index and return success, there is an empty
-//     Index one higher than any in the leaf; otherwise restart with Index
-//     reset to the upper edge of the leafs expanse.  Note:  This might cause
-//     an extra cache line fill, but this is OK for repeatedly-called search
-//     code, and it saves CPU time.
-//
-// 3.  If Index is LESS than maxindex, check for "dense to end of leaf":
-//     Subtract Index from maxindex, and back up that many slots in the leaf.
-//     If the resulting offset is not before the start of the leaf then compare
-//     the index at this offset (baseindex) with Index:
-//
-// 3a.  If GREATER, the leaf must be corrupt, since indexes are sorted and
-//      there are no duplicates.
-//
-// 3b.  If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is
-//      no reason to search it.  "Slide right" to the high end of the leaf
-//      (modify Index to maxindex) and continue with step 2 above.
-//
-// 3c.  If LESS, continue with step 4.
-//
-// 4.  If the offset based on maxindex minus Index falls BEFORE the start of
-//     the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is
-//     guaranteed "not dense to the end" and a usable empty Index must exist.
-//     This supports a more efficient search loop.  Start at the FIRST index in
-//     the leaf, or one BEYOND baseindex, respectively, and search the leaf as
-//     follows, comparing each current index (currindex) with Index:
-//
-// 4a.  If LESS, keep going to next index.  Note:  This is certain to terminate
-//      because maxindex is known to be greater than Index, hence the loop can
-//      be small and fast.
-//
-// 4b.  If EQUAL, loop and increment Index until finding currindex greater than
-//      Index, and return success with the modified Index.
-//
-// 4c.  If GREATER, return success, Index (unmodified) is empty.
-//
-// Note:  These are macros rather than functions for speed.
-
-#ifdef JUDYPREV
-
-#define	JSLE_EVEN(Addr,Pop0,cDigits,LeafType)				\
-	{								\
-	    LeafType * PjllLSB  = (LeafType *) (Addr);			\
-	    LeafType   IndexLSB = Index;	/* auto-masking */	\
-									\
-	/* Index before or at start of leaf: */				\
-									\
-	    if (*PjllLSB >= IndexLSB)		/* no need to search */	\
-	    {								\
-		if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */	\
-		LEAF_EDGE(*PjllLSB, cDigits);				\
-	    }								\
-									\
-	/* Index in or after leaf: */					\
-									\
-	    offset = IndexLSB - *PjllLSB;	/* tentative offset  */	\
-	    if (offset <= (Pop0))		/* can check density */	\
-	    {								\
-		PjllLSB += offset;		/* move to slot */	\
-									\
-		if (*PjllLSB <= IndexLSB)	/* dense or corrupt */	\
-		{							\
-		    if (*PjllLSB == IndexLSB)	/* dense, check edge */	\
-			LEAF_EDGE_SET(PjllLSB[-offset], cDigits);	\
-		    RET_CORRUPT;					\
-		}							\
-		--PjllLSB;	/* not dense, start at previous */	\
-	    }								\
-	    else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \
-									\
-	    LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB);			\
-	}
-
-// JSLE_ODD is completely different from JSLE_EVEN because its important to
-// minimize copying odd indexes to compare them (see 4.14).  Furthermore, a
-// very complex version (4.17, but abandoned before fully debugged) that
-// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still
-// half as fast as SearchValid.  Doug suggested that to minimize complexity and
-// share common code we should use j__udySearchLeaf*() for the initial search
-// to establish if Index is empty, which should be common.  If Index is valid
-// in a leaf or immediate indexes, odds are good that an empty Index is nearby,
-// so for simplicity just use a *COPY* function to linearly search the
-// remainder.
-//
-// TBD:  Pathological case?  Average performance should be good, but worst-case
-// might suffer.  When Search says the initial Index is valid, so a linear
-// copy-and-compare is begun, if the caller builds fairly large leaves with
-// dense clusters AND frequently does a SearchEmpty at one end of such a
-// cluster, performance wont be very good.  Might a dense-check help?  This
-// means checking offset against the index at offset, and then against the
-// first/last index in the leaf.  We doubt the pathological case will appear
-// much in real applications because they will probably alternate SearchValid
-// and SearchEmpty calls.
-
-#define	JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy)				\
-	{								\
-	    Word_t IndexLSB;		/* least bytes only */		\
-	    Word_t IndexFound;		/* in leaf	    */		\
-									\
-	    if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0)		\
-		RET_SUCCESS;		/* Index is empty */		\
-									\
-	    IndexLSB = JU_LEASTBYTES(Index, cDigits);			\
-	    offset  *= (cDigits);					\
-									\
-	    while ((offset -= (cDigits)) >= 0)				\
-	    {				/* skip until empty or start */	\
-		Copy(IndexFound, ((uint8_t *) (Pjll)) + offset);	\
-		if (IndexFound != (--IndexLSB))	/* found an empty */	\
-		{ JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\
-	    }								\
-	    LEAF_EDGE_SET(IndexLSB, cDigits);				\
-	}
-
-#else // JUDYNEXT
-
-#define	JSLE_EVEN(Addr,Pop0,cDigits,LeafType)				\
-	{								\
-	    LeafType * PjllLSB   = ((LeafType *) (Addr)) + (Pop0);	\
-	    LeafType   IndexLSB = Index;	/* auto-masking */	\
-									\
-	/* Index at or after end of leaf: */				\
-									\
-	    if (*PjllLSB <= IndexLSB)		/* no need to search */	\
-	    {								\
-		if (*PjllLSB < IndexLSB) RET_SUCCESS;  /* Index empty */\
-		LEAF_EDGE(*PjllLSB, cDigits);				\
-	    }								\
-									\
-	/* Index before or in leaf: */					\
-									\
-	    offset = *PjllLSB - IndexLSB;	/* tentative offset  */	\
-	    if (offset <= (Pop0))		/* can check density */	\
-	    {								\
-		PjllLSB -= offset;		/* move to slot */	\
-									\
-		if (*PjllLSB >= IndexLSB)	/* dense or corrupt */	\
-		{							\
-		    if (*PjllLSB == IndexLSB)	/* dense, check edge */	\
-			LEAF_EDGE_SET(PjllLSB[offset], cDigits);	\
-		    RET_CORRUPT;					\
-		}							\
-		++PjllLSB;		/* not dense, start at next */	\
-	    }								\
-	    else PjllLSB = (LeafType *) (Addr);	/* start at minimum */	\
-									\
-	    LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB);			\
-	}
-
-#define	JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy)				\
-	{								\
-	    Word_t IndexLSB;		/* least bytes only */		\
-	    Word_t IndexFound;		/* in leaf	    */		\
-	    int	   offsetmax;		/* in bytes	    */		\
-									\
-	    if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0)		\
-		RET_SUCCESS;			/* Index is empty */	\
-									\
-	    IndexLSB  = JU_LEASTBYTES(Index, cDigits);			\
-	    offset   *= (cDigits);					\
-	    offsetmax = (Pop0) * (cDigits);	/* single multiply */	\
-									\
-	    while ((offset += (cDigits)) <= offsetmax)			\
-	    {				/* skip until empty or end */	\
-		Copy(IndexFound, ((uint8_t *) (Pjll)) + offset);	\
-		if (IndexFound != (++IndexLSB))	/* found an empty */	\
-		{ JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \
-	    }								\
-	    LEAF_EDGE_SET(IndexLSB, cDigits);				\
-	}
-
-#endif // JUDYNEXT
-
-// Note:  Immediate indexes never fill a single index group, so for odd index
-// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD.
-
-#define	j__udySearchLeafEmpty1(Addr,Pop0) \
-	JSLE_EVEN(Addr, Pop0, 1, uint8_t)
-
-#define	j__udySearchLeafEmpty2(Addr,Pop0) \
-	JSLE_EVEN(Addr, Pop0, 2, uint16_t)
-
-#define	j__udySearchLeafEmpty3(Addr,Pop0) \
-	JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG)
-
-#ifndef JU_64BIT
-
-#define	j__udySearchLeafEmptyL(Addr,Pop0) \
-	JSLE_EVEN(Addr, Pop0, 4, Word_t)
-
-#else
-
-#define	j__udySearchLeafEmpty4(Addr,Pop0) \
-	JSLE_EVEN(Addr, Pop0, 4, uint32_t)
-
-#define	j__udySearchLeafEmpty5(Addr,Pop0) \
-	JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG)
-
-#define	j__udySearchLeafEmpty6(Addr,Pop0) \
-	JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG)
-
-#define	j__udySearchLeafEmpty7(Addr,Pop0) \
-	JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG)
-
-#define	j__udySearchLeafEmptyL(Addr,Pop0) \
-	JSLE_EVEN(Addr, Pop0, 8, Word_t)
-
-#endif // JU_64BIT
-
-
-// ----------------------------------------------------------------------------
-// START OF CODE:
-//
-// CHECK FOR SHORTCUTS:
-//
-// Error out if PIndex is null.
-
-	if (PIndex == (PWord_t) NULL)
-	{
-	    JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-	    return(JERRI);
-	}
-
-	Index = *PIndex;			// fast local copy.
-
-// Set and pre-decrement/increment Index, watching for underflow/overflow:
-//
-// An out-of-bounds Index means failure:  No previous/next empty index.
-
-SMGetRestart:		// return here with revised Index.
-
-#ifdef JUDYPREV
-	if (Index-- == 0) return(0);
-#else
-	if (++Index == 0) return(0);
-#endif
-
-// An empty array with an in-bounds (not underflowed/overflowed) Index means
-// success:
-//
-// Note:  This check is redundant after restarting at SMGetRestart, but should
-// take insignificant time.
-
-	if (PArray == (Pvoid_t) NULL) RET_SUCCESS;
-
-// ----------------------------------------------------------------------------
-// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf:
-//
-// If Index is not in the leaf, return success; otherwise return the first
-// empty Index, if any, below/above where it would belong.
-
-	if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW
-	{
-	    Pjlw_t Pjlw = P_JLW(PArray);	// first word of leaf.
-	    pop0 = Pjlw[0];
-
-#ifdef	JUDY1
-	    if (pop0 == 0)			// special case.
-	    {
-#ifdef JUDYPREV
-		if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS;
-#else
-		if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS;
-#endif
-		return(0);		// no previous/next empty index.
-	    }
-#endif // JUDY1
-
-	    j__udySearchLeafEmptyL(Pjlw + 1, pop0);
-
-//  No return -- thanks ALAN
-
-	}
-	else
-
-// ----------------------------------------------------------------------------
-// HANDLE JRP Branch:
-//
-// For JRP branches, traverse the JPM; handle LEAFW
-// directly; but look for the most common cases first.
-
-	{
-	    Pjpm_t Pjpm = P_JPM(PArray);
-	    Pjp = &(Pjpm->jpm_JP);
-
-//	    goto SMGetContinue;
-	}
-
-
-// ============================================================================
-// STATE MACHINE -- GET INDEX:
-//
-// Search for Index (already decremented/incremented so as to be an inclusive
-// search).  If not found (empty index), return success.  Otherwise do a
-// previous/next search, and if successful modify Index to the empty index
-// found.  See function header comments.
-//
-// ENTRY:  Pjp points to next JP to interpret, whose Decode bytes have not yet
-// been checked.
-//
-// Note:  Check Decode bytes at the start of each loop, not after looking up a
-// new JP, so its easy to do constant shifts/masks.
-//
-// EXIT:  Return, or branch to SMGetRestart with modified Index, or branch to
-// SMGetContinue with a modified Pjp, as described elsewhere.
-//
-// WARNING:  For run-time efficiency the following cases replicate code with
-// varying constants, rather than using common code with variable values!
-
-SMGetContinue:			// return here for next branch/leaf.
-
-#ifdef TRACEJPSE
-	JudyPrintJP(Pjp, "sf", __LINE__);
-#endif
-
-	switch (JU_JPTYPE(Pjp))
-	{
-
-
-// ----------------------------------------------------------------------------
-// LINEAR BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then search for a JP for the
-// next digit in Index.
-
-	case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL);
-	case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL);
-	case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL);
-	case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL);
-	case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL);
-#endif
-	case cJU_JPBRANCH_L:		   SMPREPBL(SMBranchL);
-
-// Common code (state-independent) for all cases of linear branches:
-
-SMBranchL:
-	    Pjbl = P_JBL(Pjp->jp_Addr);
-
-// First, check if Indexs expanse (digit) is below/above the first/last
-// populated expanse in the BranchL, in which case Index is empty; otherwise
-// find the offset of the lowest/highest populated expanse at or above/below
-// digit, if any:
-//
-// Note:  The for-loop is guaranteed to exit eventually because the first/last
-// expanse is known to be a terminator.
-//
-// Note:  Cannot use j__udySearchLeaf*Empty1() here because it only applies to
-// leaves and does not know about partial versus full JPs, unlike the use of
-// j__udySearchLeaf1() for BranchLs in SearchValid code.  Also, since linear
-// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(),
-// just scan the expanse list.
-
-#ifdef JUDYPREV
-	    if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS;
-
-	    for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset)
-#else
-	    if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit)
-		RET_SUCCESS;
-
-	    for (offset = 0; /* null */; ++offset)
-#endif
-	    {
-
-// Too low/high, keep going; or too high/low, meaning the loop passed a hole
-// and the initial Index is empty:
-
-#ifdef JUDYPREV
-		if ((Pjbl->jbl_Expanse[offset]) > digit) continue;
-		if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS;
-#else
-		if ((Pjbl->jbl_Expanse[offset]) < digit) continue;
-		if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS;
-#endif
-
-// Found expanse matching digit; if its not full, traverse through it:
-
-		if (! JPFULL((Pjbl->jbl_jp) + offset))
-		{
-		    Pjp = (Pjbl->jbl_jp) + offset;
-		    goto SMGetContinue;
-		}
-
-// Common code:  While searching for a lower/higher hole or a non-full JP, upon
-// finding a lower/higher hole, adjust Index using the revised digit and
-// return; or upon finding a consecutive lower/higher expanse, if the expanses
-// JP is non-full, modify Index and traverse through the JP:
-
-#define	BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits)	\
-	{							\
-	    if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit)	\
-		SET_AND_RETURN(OpLeastDigits, Digit, Digits);	\
-								\
-	    if (! JPFULL((Pjbl->jbl_jp) + offset))		\
-	    {							\
-		Pjp = (Pjbl->jbl_jp) + offset;			\
-		SET_AND_CONTINUE(OpLeastDigits, Digit, Digits);	\
-	    }							\
-	}
-
-// BranchL primary dead end:  Expanse matching Index/digit is full (rare except
-// for dense/sequential indexes):
-//
-// Search for a lower/higher hole, a non-full JP, or the end of the expanse
-// list, while decrementing/incrementing digit.
-
-#ifdef JUDYPREV
-		while (--offset >= 0)
-		    BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits)
-#else
-		while (++offset < Pjbl->jbl_NumJPs)
-		    BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits)
-#endif
-
-// Passed end of BranchL expanse list after finding a matching but full
-// expanse:
-//
-// Digit now matches the lowest/highest expanse, which is a full expanse; if
-// digit is at the end of BranchLs expanse (no hole before/after), break out
-// of the loop; otherwise modify Index to the next lower/higher digit and
-// return success:
-
-#ifdef JUDYPREV
-		if (digit == 0) break;
-		--digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits);
-#else
-		if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break;
-		++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits);
-#endif
-	    } // for-loop
-
-// BranchL secondary dead end, no non-full previous/next JP:
-
-	    SMRESTART(digits);
-
-
-// ----------------------------------------------------------------------------
-// BITMAP BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then search for a JP for the
-// next digit in Index.
-
-	case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB);
-	case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB);
-	case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB);
-	case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB);
-	case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB);
-#endif
-	case cJU_JPBRANCH_B:		   SMPREPBL(SMBranchB);
-
-// Common code (state-independent) for all cases of bitmap branches:
-
-SMBranchB:
-	    Pjbb = P_JBB(Pjp->jp_Addr);
-
-// Locate the digits JP in the subexpanse list, if present:
-
-	    subexp     = digit / cJU_BITSPERSUBEXPB;
-	    assert(subexp < cJU_NUMSUBEXPB);	// falls in expected range.
-	    bitposmaskB = JU_BITPOSMASKB(digit);
-
-// Absent JP = no JP matches current digit in Index:
-
-//	    if (! JU_BITMAPTESTB(Pjbb, digit))			// slower.
-	    if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB))	// faster.
-		RET_SUCCESS;
-
-// Non-full JP matches current digit in Index:
-//
-// Iterate to the subsidiary non-full JP.
-
-	    offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit,
-				   bitposmaskB);
-	    // not negative since at least one bit is set:
-	    assert(offset >= 0);
-	    assert(offset < (int) cJU_BITSPERSUBEXPB);
-
-// Watch for null JP subarray pointer with non-null bitmap (a corruption):
-
-	    if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)))
-	     == (Pjp_t) NULL) RET_CORRUPT;
-
-	    Pjp += offset;
-	    if (! JPFULL(Pjp)) goto SMGetContinue;
-
-// BranchB primary dead end:
-//
-// Upon hitting a full JP in a BranchB for the next digit in Index, search
-// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit
-// with non-full JP); first in the current bitmap subexpanse, then in
-// lower/higher subexpanses.  Upon entry, Pjp points to a known-unusable JP,
-// ready to decrement/increment.
-//
-// Note:  The preceding code is separate from this loop because Index does not
-// need revising (see SET_AND_*()) if the initial index is an empty index.
-//
-// TBD:  For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or
-// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should
-// be encapsulated in a header file.
-
-#define	BRANCHB_CHECKBIT(OpLeastDigits)					\
-    if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB))  /* absent JP */	\
-	SET_AND_RETURN(OpLeastDigits, digit, digits)
-
-#define	BRANCHB_CHECKJPFULL(OpLeastDigits)				\
-    if (! JPFULL(Pjp))							\
-	SET_AND_CONTINUE(OpLeastDigits, digit, digits)
-
-#define	BRANCHB_STARTSUBEXP(OpLeastDigits)				\
-    if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \
-	SET_AND_RETURN(OpLeastDigits, digit, digits)			\
-    if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT
-
-#ifdef JUDYPREV
-
-	    --digit;				// skip initial digit.
-	    bitposmaskB >>= 1;			// see TBD above.
-
-BranchBNextSubexp:	// return here to check next bitmap subexpanse.
-
-	    while (bitposmaskB)			// more bits to check in subexp.
-	    {
-		BRANCHB_CHECKBIT(SETLEASTDIGITS_D);
-		--Pjp;				// previous in subarray.
-		BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D);
-		assert(digit >= 0);
-		--digit;
-		bitposmaskB >>= 1;
-	    }
-
-	    if (subexp-- > 0)			// more subexpanses.
-	    {
-		BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D);
-		Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1;
-		bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1));
-		goto BranchBNextSubexp;
-	    }
-
-#else // JUDYNEXT
-
-	    ++digit;				// skip initial digit.
-	    bitposmaskB <<= 1;			// note:  BITMAPB_t.
-
-BranchBNextSubexp:	// return here to check next bitmap subexpanse.
-
-	    while (bitposmaskB)			// more bits to check in subexp.
-	    {
-		BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D);
-		++Pjp;				// previous in subarray.
-		BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D);
-		assert(digit < cJU_SUBEXPPERSTATE);
-		++digit;
-		bitposmaskB <<= 1;		// note:  BITMAPB_t.
-	    }
-
-	    if (++subexp < cJU_NUMSUBEXPB)	// more subexpanses.
-	    {
-		BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D);
-		--Pjp;				// pre-decrement.
-		bitposmaskB = 1;
-		goto BranchBNextSubexp;
-	    }
-
-#endif // JUDYNEXT
-
-// BranchB secondary dead end, no non-full previous/next JP:
-
-	    SMRESTART(digits);
-
-
-// ----------------------------------------------------------------------------
-// UNCOMPRESSED BRANCH:
-//
-// Check Decode bytes, if any, in the current JP, then search for a JP for the
-// next digit in Index.
-
-	case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU);
-	case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU);
-#ifdef JU_64BIT
-	case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU);
-	case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU);
-	case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU);
-	case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU);
-#endif
-	case cJU_JPBRANCH_U:		   SMPREPBL(SMBranchU);
-
-// Common code (state-independent) for all cases of uncompressed branches:
-
-SMBranchU:
-	    Pjbu = P_JBU(Pjp->jp_Addr);
-	    Pjp	 = (Pjbu->jbu_jp) + digit;
-
-// Absent JP = null JP for current digit in Index:
-
-	    if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS;
-
-// Non-full JP matches current digit in Index:
-//
-// Iterate to the subsidiary JP.
-
-	    if (! JPFULL(Pjp)) goto SMGetContinue;
-
-// BranchU primary dead end:
-//
-// Upon hitting a full JP in a BranchU for the next digit in Index, search
-// sideways for a previous/next null or non-full JP.  BRANCHU_CHECKJP() is
-// shorthand for common code.
-//
-// Note:  The preceding code is separate from this loop because Index does not
-// need revising (see SET_AND_*()) if the initial index is an empty index.
-
-#define	BRANCHU_CHECKJP(OpIncDec,OpLeastDigits)			\
-	{							\
-	    OpIncDec Pjp;					\
-								\
-	    if (JPNULL(JU_JPTYPE(Pjp)))				\
-		SET_AND_RETURN(OpLeastDigits, digit, digits)	\
-								\
-	    if (! JPFULL(Pjp))					\
-		SET_AND_CONTINUE(OpLeastDigits, digit, digits)	\
-	}
-
-#ifdef JUDYPREV
-	    while (digit-- > 0)
-		BRANCHU_CHECKJP(--, SETLEASTDIGITS_D);
-#else
-	    while (++digit < cJU_BRANCHUNUMJPS)
-		BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D);
-#endif
-
-// BranchU secondary dead end, no non-full previous/next JP:
-
-	    SMRESTART(digits);
-
-
-// ----------------------------------------------------------------------------
-// LINEAR LEAF:
-//
-// Check Decode bytes, if any, in the current JP, then search the leaf for the
-// previous/next empty index starting at Index.  Primary leaf dead end is
-// hidden within j__udySearchLeaf*Empty*().  In case of secondary leaf dead
-// end, restart at the top of the tree.
-//
-// Note:  Pword is the name known to GET*; think of it as Pjlw.
-
-#define	SMLEAFL(cDigits,Func)                   \
-	Pword = (PWord_t) P_JLW(Pjp->jp_Addr);  \
-	pop0  = JU_JPLEAF_POP0(Pjp);            \
-	Func(Pword, pop0)
-
-#if (defined(JUDYL) || (! defined(JU_64BIT)))
-	case cJU_JPLEAF1:  CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1);
-#endif
-	case cJU_JPLEAF2:  CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2);
-	case cJU_JPLEAF3:  CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3);
-
-#ifdef JU_64BIT
-	case cJU_JPLEAF4:  CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4);
-	case cJU_JPLEAF5:  CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5);
-	case cJU_JPLEAF6:  CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6);
-	case cJU_JPLEAF7:  CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// BITMAP LEAF:
-//
-// Check Decode bytes, if any, in the current JP, then search the leaf for the
-// previous/next empty index starting at Index.
-
-	case cJU_JPLEAF_B1:
-
-	    CHECKDCD(1);
-
-	    Pjlb	= P_JLB(Pjp->jp_Addr);
-	    digit	= JU_DIGITATSTATE(Index, 1);
-	    subexp	= digit / cJU_BITSPERSUBEXPL;
-	    bitposmaskL	= JU_BITPOSMASKL(digit);
-	    assert(subexp < cJU_NUMSUBEXPL);	// falls in expected range.
-
-// Absent index = no index matches current digit in Index:
-
-//	    if (! JU_BITMAPTESTL(Pjlb, digit))			// slower.
-	    if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL))	// faster.
-		RET_SUCCESS;
-
-// LeafB1 primary dead end:
-//
-// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in
-// Index, search sideways for a previous/next absent index, first in the
-// current bitmap subexpanse, then in lower/higher subexpanses.
-// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one
-// bitmap subexpanse.
-//
-// Note:  The preceding code is separate from this loop because Index does not
-// need revising (see SET_AND_*()) if the initial index is an empty index.
-//
-// TBD:  For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or
-// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should
-// be encapsulated in a header file.
-
-#define	LEAFB1_CHECKBIT(OpLeastDigits)				\
-	if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL))	\
-	    SET_AND_RETURN(OpLeastDigits, digit, 1)
-
-#define	LEAFB1_STARTSUBEXP(OpLeastDigits)			\
-	if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */	\
-	    SET_AND_RETURN(OpLeastDigits, digit, 1)
-
-#ifdef JUDYPREV
-
-	    --digit;				// skip initial digit.
-	    bitposmaskL >>= 1;			// see TBD above.
-
-LeafB1NextSubexp:	// return here to check next bitmap subexpanse.
-
-	    while (bitposmaskL)			// more bits to check in subexp.
-	    {
-		LEAFB1_CHECKBIT(SETLEASTDIGITS_D);
-		assert(digit >= 0);
-		--digit;
-		bitposmaskL >>= 1;
-	    }
-
-	    if (subexp-- > 0)		// more subexpanses.
-	    {
-		LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D);
-		bitposmaskL = ((Word_t)1U << (cJU_BITSPERSUBEXPL - 1));
-		goto LeafB1NextSubexp;
-	    }
-
-#else // JUDYNEXT
-
-	    ++digit;				// skip initial digit.
-	    bitposmaskL <<= 1;			// note:  BITMAPL_t.
-
-LeafB1NextSubexp:	// return here to check next bitmap subexpanse.
-
-	    while (bitposmaskL)			// more bits to check in subexp.
-	    {
-		LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D);
-		assert(digit < cJU_SUBEXPPERSTATE);
-		++digit;
-		bitposmaskL <<= 1;		// note:  BITMAPL_t.
-	    }
-
-	    if (++subexp < cJU_NUMSUBEXPL)	// more subexpanses.
-	    {
-		LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D);
-		bitposmaskL = 1;
-		goto LeafB1NextSubexp;
-	    }
-
-#endif // JUDYNEXT
-
-// LeafB1 secondary dead end, no empty index:
-
-	    SMRESTART(1);
-
-
-#ifdef JUDY1
-// ----------------------------------------------------------------------------
-// FULL POPULATION:
-//
-// If the Decode bytes do not match, Index is empty (without modification);
-// otherwise restart.
-
-	case cJ1_JPFULLPOPU1:
-
-	    CHECKDCD(1);
-	    SMRESTART(1);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// IMMEDIATE:
-//
-// Pop1 = 1 Immediate JPs:
-//
-// If Index is not in the immediate JP, return success; otherwise check if
-// there is an empty index below/above the immediate JPs index, and if so,
-// return success with modified Index, else restart.
-//
-// Note:  Doug says its fast enough to calculate the index size (digits) in
-// the following; no need to set it separately for each case.
-
-	case cJU_JPIMMED_1_01:
-	case cJU_JPIMMED_2_01:
-	case cJU_JPIMMED_3_01:
-#ifdef JU_64BIT
-	case cJU_JPIMMED_4_01:
-	case cJU_JPIMMED_5_01:
-	case cJU_JPIMMED_6_01:
-	case cJU_JPIMMED_7_01:
-#endif
-	    if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS;
-	    digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1;
-	    LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits);
-
-// Immediate JPs with Pop1 > 1:
-
-#define	IMM_MULTI(Func,BaseJPType)			\
-	JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);)	\
-	JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);)	\
-	Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1)
-
-	case cJU_JPIMMED_1_02:
-	case cJU_JPIMMED_1_03:
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_1_04:
-	case cJU_JPIMMED_1_05:
-	case cJU_JPIMMED_1_06:
-	case cJU_JPIMMED_1_07:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_1_08:
-	case cJ1_JPIMMED_1_09:
-	case cJ1_JPIMMED_1_10:
-	case cJ1_JPIMMED_1_11:
-	case cJ1_JPIMMED_1_12:
-	case cJ1_JPIMMED_1_13:
-	case cJ1_JPIMMED_1_14:
-	case cJ1_JPIMMED_1_15:
-#endif
-	    IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02);
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_2_02:
-	case cJU_JPIMMED_2_03:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_2_04:
-	case cJ1_JPIMMED_2_05:
-	case cJ1_JPIMMED_2_06:
-	case cJ1_JPIMMED_2_07:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02);
-#endif
-
-#if (defined(JUDY1) || defined(JU_64BIT))
-	case cJU_JPIMMED_3_02:
-#endif
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_3_03:
-	case cJ1_JPIMMED_3_04:
-	case cJ1_JPIMMED_3_05:
-#endif
-#if (defined(JUDY1) || defined(JU_64BIT))
-	    IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02);
-#endif
-
-#if (defined(JUDY1) && defined(JU_64BIT))
-	case cJ1_JPIMMED_4_02:
-	case cJ1_JPIMMED_4_03:
-	    IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02);
-
-	case cJ1_JPIMMED_5_02:
-	case cJ1_JPIMMED_5_03:
-	    IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02);
-
-	case cJ1_JPIMMED_6_02:
-	    IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02);
-
-	case cJ1_JPIMMED_7_02:
-	    IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02);
-#endif
-
-
-// ----------------------------------------------------------------------------
-// INVALID JP TYPE:
-
-	default: RET_CORRUPT;
-
-	} // SMGet switch.
-
-} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty()
diff --git a/libs/klib/judy/JudyPrintJP.c b/libs/klib/judy/JudyPrintJP.c
deleted file mode 100644
index 3764da1..0000000
--- a/libs/klib/judy/JudyPrintJP.c
+++ /dev/null
@@ -1,399 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// JudyPrintJP() debugging/tracing function for Judy1 or JudyL code.
-// The caller should #include this file, with its static function (replicated
-// in each compilation unit), in another *.c file, and compile with one of
-// -DJUDY1 or -DJUDYL.
-//
-// The caller can set j__udyIndex and/or j__udyPopulation non-zero to have
-// those values reported, and also to control trace-enabling (see below).
-//
-// Tracing is disabled by default unless one or both of two env parameters is
-// set (regardless of value).  If either value is set but null or evaluates to
-// zero, tracing is immediately enabled.  To disable tracing until a particular
-// j__udy*Index value is seen, set STARTINDEX=<hex-index> in the env.  To
-// disable it until a particular j__udy*Population value is seen, set
-// STARTPOP=<decimal-population> in the env.  Once either condition is met,
-// tracing "latches on".
-//
-// Example:
-//
-//      STARTPOP=0              // immediate tracing.
-//      STARTINDEX=f35430a8     // not until one of these is met.
-//      STARTPOP=1000000
-//
-// Note:  Trace-enabling does nothing unless the caller sets the appropriate
-// global variable non-zero.
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#include <stdlib.h>             // for getenv() and strtoul().
-
-
-// GLOBALS FROM CALLER:
-//
-// Note:  This storage is declared once in each compilation unit that includes
-// this file, but the linker should merge all cases into single locations, but
-// ONLY if these are uninitialized, so ASSUME they are 0 to start.
-
-Word_t j__udyIndex;             // current Index itself, optional from caller.
-Word_t j__udyPopulation;        // Indexes in array, optional from caller.
-
-// Other globals:
-
-static Word_t startindex = 0;           // see usage below.
-static Word_t startpop   = 0;
-static bool_t enabled    = FALSE;       // by default, unless env params set.
-
-// Shorthand for announcing JP addresses, Desc (in context), and JP types:
-//
-// Note:  Width is at least one blank wider than any JP type name, and the line
-// is left unfinished.
-//
-// Note:  Use a format for address printing compatible with other tracing
-// facilities; in particular, %x not %lx, to truncate the "noisy" high part on
-// 64-bit systems.
-
-#define JPTYPE(Type)  printf("0x%lx %s %-17s", (Word_t) Pjp, Desc, Type)
-
-// Shorthands for announcing expanse populations from DcdPopO fields:
-
-#define POP0 printf("Pop1 = 0 ")
-#define POP1 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &            0xff) + 1))
-#define POP2 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &          0xffff) + 1))
-#define POP3 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &        0xffffff) + 1))
-#ifdef JU_64BIT
-#define POP4 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &       0xffffffff) + 1))
-#define POP5 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &     0xffffffffff) + 1))
-#define POP6 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) &   0xffffffffffff) + 1))
-#define POP7 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffffffffffff) + 1))
-#endif
-
-// Shorthands for announcing populations of Immeds:
-//
-// Note:  Line up the small populations that often occur together, but beyond
-// that, dont worry about it because populations can get arbitrarily large.
-
-#define POP_1   printf("Pop1 =  1 ")
-#define POP_2   printf("Pop1 =  2 ")
-#define POP_3   printf("Pop1 =  3 ")
-#define POP_4   printf("Pop1 =  4 ")
-#define POP_5   printf("Pop1 =  5 ")
-#define POP_6   printf("Pop1 =  6 ")
-#define POP_7   printf("Pop1 =  7 ")
-#define POP_8   printf("Pop1 =  8 ")
-#define POP_9   printf("Pop1 =  8 ")
-#define POP_10  printf("Pop1 = 10 ")
-#define POP_11  printf("Pop1 = 11 ")
-#define POP_12  printf("Pop1 = 12 ")
-#define POP_13  printf("Pop1 = 13 ")
-#define POP_14  printf("Pop1 = 14 ")
-#define POP_15  printf("Pop1 = 15 ")
-
-// Shorthands for other announcements:
-
-#define NUMJPSL printf("NumJPs = %d ", P_JBL(Pjp->jp_Addr)->jbl_NumJPs)
-#define OOPS    printf("-- OOPS, invalid Type\n"); exit(1)
-
-// This is harder to compute:
-
-#define NUMJPSB                                                         \
-        {                                                               \
-            Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr);                          \
-            Word_t subexp;                                              \
-            int    numJPs = 0;                                          \
-                                                                        \
-            for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp)         \
-                numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));\
-                                                                        \
-            printf("NumJPs = %d ", numJPs);                             \
-        }
-
-
-// ****************************************************************************
-// J U D Y   P R I N T   J P
-//
-// Dump information about a JP, at least its address, type, population, and
-// number of JPs, as appropriate.  Error out upon any unexpected JP type.
-//
-// TBD:  Dump more detailed information about the JP?
-
-FUNCTION static void JudyPrintJP(
-        Pjp_t  Pjp,             // JP to describe.
-        char * Desc,            // brief description of caller, such as "i".
-        int    Line)            // callers source line number.
-{
-static  bool_t checked = FALSE; // set upon first entry and check for params.
-        char * value;           // for getenv().
-
-
-// CHECK FOR EXTERNAL ENABLING:
-//
-// If a parameter is set, report the value, even if it is null or otherwise
-// evaluates to zero, in which case enable tracing immediately; otherwise wait
-// for the value to be hit.
-
-#define GETENV(Name,Value,Base)                                 \
-        if ((value = getenv (Name)) != (char *) NULL)           \
-        {                                                       \
-            (Value) = strtoul (value, (char **) NULL, Base);    \
-            enabled |= ((Value) == 0);  /* see above */         \
-                                                                \
-            (void) printf ("JudyPrintJP(\"%s\"): $%s = %lu\n",  \
-                           Desc, Name, Value);                  \
-        }
-
-        if (! checked)  // only check once.
-        {
-            checked = TRUE;
-
-            GETENV ("STARTINDEX", startindex, 16);
-            GETENV ("STARTPOP",   startpop,   10);
-
-            (void) printf ("JudyPrintJP(\"%s\"): Tracing present %s\n", Desc,
-                           enabled ? "and immediately enabled" :
-                           (startindex || startpop) ?
-                           "but disabled until start condition met" :
-                           "but not enabled by env parameter");
-        }
-
-        if (! enabled)  // check repeatedly until latched enabled:
-        {
-            if (startindex && (startindex == j__udyIndex))
-            {
-                 (void) printf ("=== TRACING ENABLED (\"%s\"), "
-                                "startindex = 0x%lx\n", Desc, startindex);
-                 enabled = TRUE;
-            }
-            else if (startpop && (startpop == j__udyPopulation))
-            {
-                 (void) printf ("=== TRACING ENABLED (\"%s\"), "
-                                "startpop = %lu\n", Desc, startpop);
-                 enabled = TRUE;
-            }
-            else
-            {
-                return;         // print nothing this time.
-            }
-        }
-
-
-// SWITCH ON JP TYPE:
-
-        switch (JU_JPTYPE(Pjp))
-        {
-
-// Note:  The following COULD be merged more tightly between Judy1 and JudyL,
-// but we decided that the output should say cJ1*/cJL*, not cJU*, to be more
-// specific.
-
-#ifdef JUDY1
-        case cJ1_JPNULL1:       JPTYPE("cJ1_JPNULL1"); POP0;            break;
-        case cJ1_JPNULL2:       JPTYPE("cJ1_JPNULL2"); POP0;            break;
-        case cJ1_JPNULL3:       JPTYPE("cJ1_JPNULL3"); POP0;            break;
-#ifdef JU_64BIT
-        case cJ1_JPNULL4:       JPTYPE("cJ1_JPNULL4"); POP0;            break;
-        case cJ1_JPNULL5:       JPTYPE("cJ1_JPNULL5"); POP0;            break;
-        case cJ1_JPNULL6:       JPTYPE("cJ1_JPNULL6"); POP0;            break;
-        case cJ1_JPNULL7:       JPTYPE("cJ1_JPNULL7"); POP0;            break;
-#endif
-
-        case cJ1_JPBRANCH_L2:   JPTYPE("cJ1_JPBRANCH_L2"); POP2;NUMJPSL;break;
-        case cJ1_JPBRANCH_L3:   JPTYPE("cJ1_JPBRANCH_L3"); POP3;NUMJPSL;break;
-#ifdef JU_64BIT
-        case cJ1_JPBRANCH_L4:   JPTYPE("cJ1_JPBRANCH_L4"); POP4;NUMJPSL;break;
-        case cJ1_JPBRANCH_L5:   JPTYPE("cJ1_JPBRANCH_L5"); POP5;NUMJPSL;break;
-        case cJ1_JPBRANCH_L6:   JPTYPE("cJ1_JPBRANCH_L6"); POP6;NUMJPSL;break;
-        case cJ1_JPBRANCH_L7:   JPTYPE("cJ1_JPBRANCH_L7"); POP7;NUMJPSL;break;
-#endif
-        case cJ1_JPBRANCH_L:    JPTYPE("cJ1_JPBRANCH_L");       NUMJPSL;break;
-
-        case cJ1_JPBRANCH_B2:   JPTYPE("cJ1_JPBRANCH_B2"); POP2;NUMJPSB;break;
-        case cJ1_JPBRANCH_B3:   JPTYPE("cJ1_JPBRANCH_B3"); POP3;NUMJPSB;break;
-#ifdef JU_64BIT
-        case cJ1_JPBRANCH_B4:   JPTYPE("cJ1_JPBRANCH_B4"); POP4;NUMJPSB;break;
-        case cJ1_JPBRANCH_B5:   JPTYPE("cJ1_JPBRANCH_B5"); POP5;NUMJPSB;break;
-        case cJ1_JPBRANCH_B6:   JPTYPE("cJ1_JPBRANCH_B6"); POP6;NUMJPSB;break;
-        case cJ1_JPBRANCH_B7:   JPTYPE("cJ1_JPBRANCH_B7"); POP7;NUMJPSB;break;
-#endif
-        case cJ1_JPBRANCH_B:    JPTYPE("cJ1_JPBRANCH_B");       NUMJPSB;break;
-
-        case cJ1_JPBRANCH_U2:   JPTYPE("cJ1_JPBRANCH_U2"); POP2;        break;
-        case cJ1_JPBRANCH_U3:   JPTYPE("cJ1_JPBRANCH_U3"); POP3;        break;
-#ifdef JU_64BIT
-        case cJ1_JPBRANCH_U4:   JPTYPE("cJ1_JPBRANCH_U4"); POP4;        break;
-        case cJ1_JPBRANCH_U5:   JPTYPE("cJ1_JPBRANCH_U5"); POP5;        break;
-        case cJ1_JPBRANCH_U6:   JPTYPE("cJ1_JPBRANCH_U6"); POP6;        break;
-        case cJ1_JPBRANCH_U7:   JPTYPE("cJ1_JPBRANCH_U7"); POP7;        break;
-#endif
-        case cJ1_JPBRANCH_U:    JPTYPE("cJ1_JPBRANCH_U");               break;
-
-#ifndef JU_64BIT
-        case cJ1_JPLEAF1:       JPTYPE("cJ1_JPLEAF1"); POP1;            break;
-#endif
-        case cJ1_JPLEAF2:       JPTYPE("cJ1_JPLEAF2"); POP2;            break;
-        case cJ1_JPLEAF3:       JPTYPE("cJ1_JPLEAF3"); POP3;            break;
-#ifdef JU_64BIT
-        case cJ1_JPLEAF4:       JPTYPE("cJ1_JPLEAF4"); POP4;            break;
-        case cJ1_JPLEAF5:       JPTYPE("cJ1_JPLEAF5"); POP5;            break;
-        case cJ1_JPLEAF6:       JPTYPE("cJ1_JPLEAF6"); POP6;            break;
-        case cJ1_JPLEAF7:       JPTYPE("cJ1_JPLEAF7"); POP7;            break;
-#endif
-
-        case cJ1_JPLEAF_B1:     JPTYPE("cJ1_JPLEAF_B1");    POP1;       break;
-        case cJ1_JPFULLPOPU1:   JPTYPE("cJ1_JPFULLPOPU1");  POP1;       break;
-
-        case cJ1_JPIMMED_1_01:  JPTYPE("cJ1_JPIMMED_1_01"); POP_1;      break;
-        case cJ1_JPIMMED_2_01:  JPTYPE("cJ1_JPIMMED_2_01"); POP_1;      break;
-        case cJ1_JPIMMED_3_01:  JPTYPE("cJ1_JPIMMED_3_01"); POP_1;      break;
-#ifdef JU_64BIT
-        case cJ1_JPIMMED_4_01:  JPTYPE("cJ1_JPIMMED_4_01"); POP_1;      break;
-        case cJ1_JPIMMED_5_01:  JPTYPE("cJ1_JPIMMED_5_01"); POP_1;      break;
-        case cJ1_JPIMMED_6_01:  JPTYPE("cJ1_JPIMMED_6_01"); POP_1;      break;
-        case cJ1_JPIMMED_7_01:  JPTYPE("cJ1_JPIMMED_7_01"); POP_1;      break;
-#endif
-
-        case cJ1_JPIMMED_1_02:  JPTYPE("cJ1_JPIMMED_1_02"); POP_2;      break;
-        case cJ1_JPIMMED_1_03:  JPTYPE("cJ1_JPIMMED_1_03"); POP_3;      break;
-        case cJ1_JPIMMED_1_04:  JPTYPE("cJ1_JPIMMED_1_04"); POP_4;      break;
-        case cJ1_JPIMMED_1_05:  JPTYPE("cJ1_JPIMMED_1_05"); POP_5;      break;
-        case cJ1_JPIMMED_1_06:  JPTYPE("cJ1_JPIMMED_1_06"); POP_6;      break;
-        case cJ1_JPIMMED_1_07:  JPTYPE("cJ1_JPIMMED_1_07"); POP_7;      break;
-#ifdef JU_64BIT
-        case cJ1_JPIMMED_1_08:  JPTYPE("cJ1_JPIMMED_1_08"); POP_8;      break;
-        case cJ1_JPIMMED_1_09:  JPTYPE("cJ1_JPIMMED_1_09"); POP_9;      break;
-        case cJ1_JPIMMED_1_10:  JPTYPE("cJ1_JPIMMED_1_10"); POP_10;     break;
-        case cJ1_JPIMMED_1_11:  JPTYPE("cJ1_JPIMMED_1_11"); POP_11;     break;
-        case cJ1_JPIMMED_1_12:  JPTYPE("cJ1_JPIMMED_1_12"); POP_12;     break;
-        case cJ1_JPIMMED_1_13:  JPTYPE("cJ1_JPIMMED_1_13"); POP_13;     break;
-        case cJ1_JPIMMED_1_14:  JPTYPE("cJ1_JPIMMED_1_14"); POP_14;     break;
-        case cJ1_JPIMMED_1_15:  JPTYPE("cJ1_JPIMMED_1_15"); POP_15;     break;
-#endif
-        case cJ1_JPIMMED_2_02:  JPTYPE("cJ1_JPIMMED_2_02"); POP_2;      break;
-        case cJ1_JPIMMED_2_03:  JPTYPE("cJ1_JPIMMED_2_03"); POP_3;      break;
-#ifdef JU_64BIT
-        case cJ1_JPIMMED_2_04:  JPTYPE("cJ1_JPIMMED_2_04"); POP_4;      break;
-        case cJ1_JPIMMED_2_05:  JPTYPE("cJ1_JPIMMED_2_05"); POP_5;      break;
-        case cJ1_JPIMMED_2_06:  JPTYPE("cJ1_JPIMMED_2_06"); POP_6;      break;
-        case cJ1_JPIMMED_2_07:  JPTYPE("cJ1_JPIMMED_2_07"); POP_7;      break;
-#endif
-
-        case cJ1_JPIMMED_3_02:  JPTYPE("cJ1_JPIMMED_3_02"); POP_2;      break;
-#ifdef JU_64BIT
-        case cJ1_JPIMMED_3_03:  JPTYPE("cJ1_JPIMMED_3_03"); POP_3;      break;
-        case cJ1_JPIMMED_3_04:  JPTYPE("cJ1_JPIMMED_3_04"); POP_4;      break;
-        case cJ1_JPIMMED_3_05:  JPTYPE("cJ1_JPIMMED_3_05"); POP_5;      break;
-        case cJ1_JPIMMED_4_02:  JPTYPE("cJ1_JPIMMED_4_02"); POP_2;      break;
-        case cJ1_JPIMMED_4_03:  JPTYPE("cJ1_JPIMMED_4_03"); POP_3;      break;
-        case cJ1_JPIMMED_5_02:  JPTYPE("cJ1_JPIMMED_5_02"); POP_2;      break;
-        case cJ1_JPIMMED_5_03:  JPTYPE("cJ1_JPIMMED_5_03"); POP_3;      break;
-        case cJ1_JPIMMED_6_02:  JPTYPE("cJ1_JPIMMED_6_02"); POP_2;      break;
-        case cJ1_JPIMMED_7_02:  JPTYPE("cJ1_JPIMMED_7_02"); POP_2;      break;
-#endif
-        case cJ1_JPIMMED_CAP:   JPTYPE("cJ1_JPIMMED_CAP");              OOPS;
-
-#else // JUDYL ===============================================================
-
-        case cJL_JPNULL1:       JPTYPE("cJL_JPNULL1"); POP0;            break;
-        case cJL_JPNULL2:       JPTYPE("cJL_JPNULL2"); POP0;            break;
-        case cJL_JPNULL3:       JPTYPE("cJL_JPNULL3"); POP0;            break;
-#ifdef JU_64BIT
-        case cJL_JPNULL4:       JPTYPE("cJL_JPNULL4"); POP0;            break;
-        case cJL_JPNULL5:       JPTYPE("cJL_JPNULL5"); POP0;            break;
-        case cJL_JPNULL6:       JPTYPE("cJL_JPNULL6"); POP0;            break;
-        case cJL_JPNULL7:       JPTYPE("cJL_JPNULL7"); POP0;            break;
-#endif
-
-        case cJL_JPBRANCH_L2:   JPTYPE("cJL_JPBRANCH_L2"); POP2;NUMJPSL;break;
-        case cJL_JPBRANCH_L3:   JPTYPE("cJL_JPBRANCH_L3"); POP3;NUMJPSL;break;
-#ifdef JU_64BIT
-        case cJL_JPBRANCH_L4:   JPTYPE("cJL_JPBRANCH_L4"); POP4;NUMJPSL;break;
-        case cJL_JPBRANCH_L5:   JPTYPE("cJL_JPBRANCH_L5"); POP5;NUMJPSL;break;
-        case cJL_JPBRANCH_L6:   JPTYPE("cJL_JPBRANCH_L6"); POP6;NUMJPSL;break;
-        case cJL_JPBRANCH_L7:   JPTYPE("cJL_JPBRANCH_L7"); POP7;NUMJPSL;break;
-#endif
-        case cJL_JPBRANCH_L:    JPTYPE("cJL_JPBRANCH_L");       NUMJPSL;break;
-
-        case cJL_JPBRANCH_B2:   JPTYPE("cJL_JPBRANCH_B2"); POP2;NUMJPSB;break;
-        case cJL_JPBRANCH_B3:   JPTYPE("cJL_JPBRANCH_B3"); POP3;NUMJPSB;break;
-#ifdef JU_64BIT
-        case cJL_JPBRANCH_B4:   JPTYPE("cJL_JPBRANCH_B4"); POP4;NUMJPSB;break;
-        case cJL_JPBRANCH_B5:   JPTYPE("cJL_JPBRANCH_B5"); POP5;NUMJPSB;break;
-        case cJL_JPBRANCH_B6:   JPTYPE("cJL_JPBRANCH_B6"); POP6;NUMJPSB;break;
-        case cJL_JPBRANCH_B7:   JPTYPE("cJL_JPBRANCH_B7"); POP7;NUMJPSB;break;
-#endif
-        case cJL_JPBRANCH_B:    JPTYPE("cJL_JPBRANCH_B");       NUMJPSB;break;
-
-        case cJL_JPBRANCH_U2:   JPTYPE("cJL_JPBRANCH_U2"); POP2;        break;
-        case cJL_JPBRANCH_U3:   JPTYPE("cJL_JPBRANCH_U3"); POP3;        break;
-#ifdef JU_64BIT
-        case cJL_JPBRANCH_U4:   JPTYPE("cJL_JPBRANCH_U4"); POP4;        break;
-        case cJL_JPBRANCH_U5:   JPTYPE("cJL_JPBRANCH_U5"); POP5;        break;
-        case cJL_JPBRANCH_U6:   JPTYPE("cJL_JPBRANCH_U6"); POP6;        break;
-        case cJL_JPBRANCH_U7:   JPTYPE("cJL_JPBRANCH_U7"); POP7;        break;
-#endif
-        case cJL_JPBRANCH_U:    JPTYPE("cJL_JPBRANCH_U");               break;
-
-        case cJL_JPLEAF1:       JPTYPE("cJL_JPLEAF1"); POP1;            break;
-        case cJL_JPLEAF2:       JPTYPE("cJL_JPLEAF2"); POP2;            break;
-        case cJL_JPLEAF3:       JPTYPE("cJL_JPLEAF3"); POP3;            break;
-#ifdef JU_64BIT
-        case cJL_JPLEAF4:       JPTYPE("cJL_JPLEAF4"); POP4;            break;
-        case cJL_JPLEAF5:       JPTYPE("cJL_JPLEAF5"); POP5;            break;
-        case cJL_JPLEAF6:       JPTYPE("cJL_JPLEAF6"); POP6;            break;
-        case cJL_JPLEAF7:       JPTYPE("cJL_JPLEAF7"); POP7;            break;
-#endif
-
-        case cJL_JPLEAF_B1:     JPTYPE("cJL_JPLEAF_B1"); POP1;  break;
-
-        case cJL_JPIMMED_1_01:  JPTYPE("cJL_JPIMMED_1_01"); POP_1;      break;
-        case cJL_JPIMMED_2_01:  JPTYPE("cJL_JPIMMED_2_01"); POP_1;      break;
-        case cJL_JPIMMED_3_01:  JPTYPE("cJL_JPIMMED_3_01"); POP_1;      break;
-#ifdef JU_64BIT
-        case cJL_JPIMMED_4_01:  JPTYPE("cJL_JPIMMED_4_01"); POP_1;      break;
-        case cJL_JPIMMED_5_01:  JPTYPE("cJL_JPIMMED_5_01"); POP_1;      break;
-        case cJL_JPIMMED_6_01:  JPTYPE("cJL_JPIMMED_6_01"); POP_1;      break;
-        case cJL_JPIMMED_7_01:  JPTYPE("cJL_JPIMMED_7_01"); POP_1;      break;
-#endif
-
-        case cJL_JPIMMED_1_02:  JPTYPE("cJL_JPIMMED_1_02"); POP_2;      break;
-        case cJL_JPIMMED_1_03:  JPTYPE("cJL_JPIMMED_1_03"); POP_3;      break;
-#ifdef JU_64BIT
-        case cJL_JPIMMED_1_04:  JPTYPE("cJL_JPIMMED_1_04"); POP_4;      break;
-        case cJL_JPIMMED_1_05:  JPTYPE("cJL_JPIMMED_1_05"); POP_5;      break;
-        case cJL_JPIMMED_1_06:  JPTYPE("cJL_JPIMMED_1_06"); POP_6;      break;
-        case cJL_JPIMMED_1_07:  JPTYPE("cJL_JPIMMED_1_07"); POP_7;      break;
-        case cJL_JPIMMED_2_02:  JPTYPE("cJL_JPIMMED_2_02"); POP_2;      break;
-        case cJL_JPIMMED_2_03:  JPTYPE("cJL_JPIMMED_2_03"); POP_3;      break;
-        case cJL_JPIMMED_3_02:  JPTYPE("cJL_JPIMMED_3_02"); POP_2;      break;
-#endif
-        case cJL_JPIMMED_CAP:   JPTYPE("cJL_JPIMMED_CAP");      OOPS;
-
-#endif // JUDYL
-
-        default:  printf("Unknown Type = %d", JU_JPTYPE(Pjp));          OOPS;
-        }
-
-        if (j__udyIndex)        printf("Index = 0x%lx", j__udyIndex);
-        if (j__udyPopulation)   printf("Pop = %lu",     j__udyPopulation);
-
-        printf("line = %d\n", Line);
-
-} // JudyPrintJP()
diff --git a/libs/klib/judy/JudyPrivate.h b/libs/klib/judy/JudyPrivate.h
deleted file mode 100644
index 0d0c5f3..0000000
--- a/libs/klib/judy/JudyPrivate.h
+++ /dev/null
@@ -1,1610 +0,0 @@
-#ifndef _JUDYPRIVATE_INCLUDED
-#define _JUDYPRIVATE_INCLUDED
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Header file for all Judy sources, for global but private (non-exported)
-// declarations.
-
-#include "Judy.h"
-
-// ****************************************************************************
-// A VERY BRIEF EXPLANATION OF A JUDY ARRAY
-//
-// A Judy array is, effectively, a digital tree (or Trie) with 256 element
-// branches (nodes), and with "compression tricks" applied to low-population
-// branches or leaves to save a lot of memory at the cost of relatively little
-// CPU time or cache fills.
-//
-// In the actual implementation, a Judy array is level-less, and traversing the
-// "tree" actually means following the states in a state machine (SM) as
-// directed by the Index.  A Judy array is referred to here as an "SM", rather
-// than as a "tree"; having "states", rather than "levels".
-//
-// Each branch or leaf in the SM decodes a portion ("digit") of the original
-// Index; with 256-way branches there are 8 bits per digit.  There are 3 kinds
-// of branches, called:  Linear, Bitmap and Uncompressed, of which the first 2
-// are compressed to contain no NULL entries.
-//
-// An Uncompressed branch has a 1.0 cache line fill cost to decode 8 bits of
-// (digit, part of an Index), but it might contain many NULL entries, and is
-// therefore inefficient with memory if lightly populated.
-//
-// A Linear branch has a ~1.75 cache line fill cost when at maximum population.
-// A Bitmap branch has ~2.0 cache line fills.  Linear and Bitmap branches are
-// converted to Uncompressed branches when the additional memory can be
-// amortized with larger populations.  Higher-state branches have higher
-// priority to be converted.
-//
-// Linear branches can hold 28 elements (based on detailed analysis) -- thus 28
-// expanses.  A Linear branch is converted to a Bitmap branch when the 29th
-// expanse is required.
-//
-// A Bitmap branch could hold 256 expanses, but is forced to convert to an
-// Uncompressed branch when 185 expanses are required.  Hopefully, it is
-// converted before that because of population growth (again, based on detailed
-// analysis and heuristics in the code).
-//
-// A path through the SM terminates to a leaf when the Index (or key)
-// population in the expanse below a pointer will fit into 1 or 2 cache lines
-// (~31..255 Indexes).  A maximum-population Leaf has ~1.5 cache line fill
-// cost.
-//
-// Leaves are sorted arrays of Indexes, where the Index Sizes (IS) are:  0, 1,
-// 8, 16, 24, 32, [40, 48, 56, 64] bits.  The IS depends on the "density"
-// (population/expanse) of the values in the Leaf.  Zero bits are possible if
-// population == expanse in the SM (that is, a full small expanse).
-//
-// Elements of a branches are called Judy Pointers (JPs).  Each JP object
-// points to the next object in the SM, plus, a JP can decode an additional
-// 2[6] bytes of an Index, but at the cost of "narrowing" the expanse
-// represented by the next object in the SM.  A "narrow" JP (one which has
-// decode bytes/digits) is a way of skipping states in the SM.
-//
-// Although counterintuitive, we think a Judy SM is optimal when the Leaves are
-// stored at MINIMUM compression (narrowing, or use of Decode bytes).  If more
-// aggressive compression was used, decompression of a leaf be required to
-// insert an index.  Additional compression would save a little memory but not
-// help performance significantly.
-
-
-#ifdef A_PICTURE_IS_WORTH_1000_WORDS
-*******************************************************************************
-
-JUDY 32-BIT STATE MACHINE (SM) EXAMPLE, FOR INDEX = 0x02040103
-
-The Index used in this example is purposely chosen to allow small, simple
-examples below; each 1-byte "digit" from the Index has a small numeric value
-that fits in one column.  In the drawing below:
-
-   JRP  == Judy Root Pointer;
-
-    C   == 1 byte of a 1..3 byte Population (count of Indexes) below this
-           pointer.  Since this is shared with the Decode field, the combined
-           sizes must be 3[7], that is, 1 word less 1 byte for the JP Type.
-
-   The 1-byte field jp_Type is represented as:
-
-   1..3 == Number of bytes in the population (Pop0) word of the Branch or Leaf
-           below the pointer (note:  1..7 on 64-bit); indicates:
-           - number of bytes in Decode field == 3 - this number;
-           - number of bytes remaining to decode.
-           Note:  The maximum is 3, not 4, because the 1st byte of the Index is
-           always decoded digitally in the top branch.
-   -B-  == JP points to a Branch (there are many kinds of Branches).
-   -L-  == JP points to a Leaf (there are many kinds of Leaves).
-
-   (2)  == Digit of Index decoded by position offset in branch (really
-           0..0xff).
-
-    4*  == Digit of Index necessary for decoding a "narrow" pointer, in a
-           Decode field; replaces 1 missing branch (really 0..0xff).
-
-    4+  == Digit of Index NOT necessary for decoding a "narrow" pointer, but
-           used for fast traversal of the SM by Judy1Test() and JudyLGet()
-           (see the code) (really 0..0xff).
-
-    0   == Byte in a JPs Pop0 field that is always ignored, because a leaf
-           can never contain more than 256 Indexes (Pop0 <= 255).
-
-    +-----  == A Branch or Leaf; drawn open-ended to remind you that it could
-    |          have up to 256 columns.
-    +-----
-
-    |
-    |   == Pointer to next Branch or Leaf.
-    V
-
-    |
-    O   == A state is skipped by using a "narrow" pointer.
-    |
-
-    < 1 > == Digit (Index) shown as an example is not necessarily in the
-             position shown; is sorted in order with neighbor Indexes.
-             (Really 0..0xff.)
-
-Note that this example shows every possibly topology to reach a leaf in a
-32-bit Judy SM, although this is a very subtle point!
-
-                                                                          STATE or`
-                                                                          LEVEL
-     +---+    +---+    +---+    +---+    +---+    +---+    +---+    +---+
-     |RJP|    |RJP|    |RJP|    |RJP|    |RJP|    |RJP|    |RJP|    |RJP|
-     L---+    B---+    B---+    B---+    B---+    B---+    B---+    B---+
-     |        |        |        |        |        |        |        |
-     |        |        |        |        |        |        |        |
-     V        V (2)    V (2)    V (2)    V (2)    V (2)    V (2)    V (2)
-     +------  +------  +------  +------  +------  +------  +------  +------
-Four |< 2 >   |  0     |  4*    |  C     |  4*    |  4*    |  C     |  C
-byte |< 4 >   |  0     |  0     |  C     |  1*    |  C     |  C     |  C     4
-Index|< 1 >   |  C     |  C     |  C     |  C     |  C     |  C     |  C
-Leaf |< 3 >   |  3     |  2     |  3     |  1     |  2     |  3     |  3
-     +------  +--L---  +--L---  +--B---  +--L---  +--B---  +--B---  +--B---
-                 |        |        |        |        |        |        |
-                /         |       /         |        |       /        /
-               /          |      /          |        |      /        /
-              |           |     |           |        |     |        |
-              V           |     V   (4)     |        |     V   (4)  V   (4)
-              +------     |     +------     |        |     +------  +------
-    Three     |< 4 >      |     |    4+     |        |     |    4+  |    4+
-    byte Index|< 1 >      O     |    0      O        O     |    1*  |    C   3
-    Leaf      |< 3 >      |     |    C      |        |     |    C   |    C
-              +------     |     |    2      |        |     |    1   |    2
-                         /      +----L-     |        |     +----L-  +----B-
-                        /            |      |        |          |        |
-                       |            /       |       /          /        /
-                       |           /        |      /          /        /
-                       |          /         |     |          /        /
-                       |         /          |     |         /        /
-                       |        |           |     |        |        |
-                       V        V           |     V(1)     |        V(1)
-                       +------  +------     |     +------  |        +------
-          Two byte     |< 1 >   |< 1 >      |     | 4+     |        | 4+
-          Index Leaf   |< 3 >   |< 3 >      O     | 1+     O        | 1+     2
-                       +------  +------    /      | C      |        | C
-                                          /       | 1      |        | 1
-                                         |        +-L----  |        +-L----
-                                         |          |      |          |
-                                         |         /       |         /
-                                         |        |        |        |
-                                         V        V        V        V
-                                         +------  +------  +------  +------
-                    One byte Index Leaf  |< 3 >   |< 3 >   |< 3 >   |< 3 >   1
-                                         +------  +------  +------  +------
-
-
-#endif // A_PICTURE_IS_WORTH_1000_WORDS
-
-
-// ****************************************************************************
-// MISCELLANEOUS GLOBALS:
-//
-// PLATFORM-SPECIFIC CONVENIENCE MACROS:
-//
-// These are derived from context (set by cc or in system header files) or
-// based on JU_<PLATFORM> macros from make_includes/platform.*.mk.  We decided
-// on 011018 that any macro reliably derivable from context (cc or headers) for
-// ALL platforms supported by Judy is based on that derivation, but ANY
-// exception means to stop using the external macro completely and derive from
-// JU_<PLATFORM> instead.
-
-// Other miscellaneous stuff:
-
-#ifndef _BOOL_T
-#define _BOOL_T
-typedef int bool_t;
-#endif
-
-#define FUNCTION                // null; easy to find functions.
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifdef TRACE            // turn on all other tracing in the code:
-#define TRACEJP  1      // JP traversals in JudyIns.c and JudyDel.c.
-#define TRACEJPR 1      // JP traversals in retrieval code, JudyGet.c.
-#define TRACECF  1      // cache fills in JudyGet.c.
-#define TRACEMI  1      // malloc calls in JudyMallocIF.c.
-#define TRACEMF  1      // malloc calls at a lower level in JudyMalloc.c.
-#endif
-
-#ifndef inline
-    #define inline __inline__
-#endif
-
-// SUPPORT FOR DEBUG-ONLY CODE:
-//
-// By convention, use -DDEBUG to enable both debug-only code AND assertions in
-// the Judy sources.
-//
-// Invert the sense of assertions, so they are off unless explicitly requested,
-// in a uniform way.
-//
-// Note:  It is NOT appropriate to put this in Judy.h; it would mess up
-// application code.
-
-#ifndef DEBUG
-#define NDEBUG 1                // must be 1 for "#if".
-#endif
-
-// Shorthand notations to avoid #ifdefs for single-line conditional statements:
-//
-// Warning:  These cannot be used around compiler directives, such as
-// "#include", nor in the case where Code contains a comma other than nested
-// within parentheses or quotes.
-
-#define DBGCODE(Code)  /* nothing */
-
-#ifdef JUDY1
-#define JUDY1CODE(Code) Code
-#define JUDYLCODE(Code) // null.
-#endif
-
-#ifdef JUDYL
-#define JUDYLCODE(Code) Code
-#define JUDY1CODE(Code) // null.
-#endif
-
-#include <assert.h>
-
-// ****************************************************************************
-// FUNDAMENTAL CONSTANTS FOR MACHINE
-// ****************************************************************************
-
-// Machine (CPU) cache line size:
-//
-// NOTE:  A leaf size of 2 cache lines maximum is the target (optimal) for
-// Judy.  Its hard to obtain a machines cache line size at compile time, but
-// if the machine has an unexpected cache line size, its not devastating if
-// the following constants end up causing leaves that are 1 cache line in size,
-// or even 4 cache lines in size.  The assumed 32-bit system has 16-word =
-// 64-byte cache lines, and the assumed 64-bit system has 16-word = 128-byte
-// cache lines.
-
-#ifdef JU_64BIT
-#define cJU_BYTESPERCL 128              // cache line size in bytes.
-#else
-#define cJU_BYTESPERCL  64              // cache line size in bytes.
-#endif
-
-// Bits Per Byte:
-
-#define cJU_BITSPERBYTE 0x8
-
-// Bytes Per Word and Bits Per Word, latter assuming sizeof(byte) is 8 bits:
-//
-// Expect 32 [64] bits per word.
-
-#define cJU_BYTESPERWORD (sizeof(Word_t))
-#define cJU_BITSPERWORD  (sizeof(Word_t) * cJU_BITSPERBYTE)
-
-#define JU_BYTESTOWORDS(BYTES) \
-        (((BYTES) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD)
-
-// A word that is all-ones, normally equal to -1UL, but safer with ~0:
-
-#define cJU_ALLONES  (~ ( Word_t ) 0UL)
-
-// Note, these are forward references, but thats OK:
-
-#define cJU_FULLBITMAPB ((BITMAPB_t) cJU_ALLONES)
-#define cJU_FULLBITMAPL ((BITMAPL_t) cJU_ALLONES)
-
-
-// ****************************************************************************
-// MISCELLANEOUS JUDY-SPECIFIC DECLARATIONS
-// ****************************************************************************
-
-// ROOT STATE:
-//
-// State at the start of the Judy SM, based on 1 byte decoded per state; equal
-// to the number of bytes per Index to decode.
-
-#define cJU_ROOTSTATE (sizeof(Word_t))
-
-
-// SUBEXPANSES PER STATE:
-//
-// Number of subexpanses per state traversed, which is the number of JPs in a
-// branch (actual or theoretical) and the number of bits in a bitmap.
-
-#define cJU_SUBEXPPERSTATE  256
-
-
-// LEAF AND VALUE POINTERS:
-//
-// Some other basic object types are in declared in JudyPrivateBranch.h
-// (Pjbl_t, Pjbb_t, Pjbu_t, Pjp_t) or are Judy1/L-specific (Pjlb_t).  The
-// few remaining types are declared below.
-//
-// Note:  Leaf pointers are cast to different-sized objects depending on the
-// leafs level, but are at least addresses (not just numbers), so use void *
-// (Pvoid_t), not PWord_t or Word_t for them, except use Pjlw_t for whole-word
-// (top-level, root-level) leaves.  Value areas, however, are always whole
-// words.
-//
-// Furthermore, use Pjll_t only for generic leaf pointers (for various size
-// LeafLs).  Use Pjlw_t for LeafWs.  Use Pleaf (with type uint8_t *, uint16_t
-// *, etc) when the leaf index size is known.
-
-typedef PWord_t Pjlw_t;  // pointer to root-level leaf (whole-word indexes).
-typedef Pvoid_t Pjll_t;  // pointer to lower-level linear leaf.
-
-#ifdef JUDYL
-typedef PWord_t Pjv_t;   // pointer to JudyL value area.
-#endif
-
-
-// POINTER PREPARATION MACROS:
-//
-// These macros are used to strip malloc-namespace-type bits from a pointer +
-// malloc-type word (which references any Judy mallocd object that might be
-// obtained from other than a direct call of malloc()), prior to dereferencing
-// the pointer as an address.  The malloc-type bits allow Judy mallocd objects
-// to come from different "malloc() namespaces".
-//
-//    (root pointer)    (JRP, see above)
-//    jp.jp_Addr        generic pointer to next-level node, except when used
-//                      as a JudyL Immed01 value area
-//    JU_JBB_PJP        macro hides jbbs_Pjp (pointer to JP subarray)
-//    JL_JLB_PVALUE     macro hides jLlbs_PValue (pointer to value subarray)
-//
-// When setting one of these fields or passing an address to j__udyFree*(), the
-// "raw" memory address is used; otherwise the memory address must be passed
-// through one of the macros below before its dereferenced.
-//
-// Note:  After much study, the typecasts below appear in the macros rather
-// than at the point of use, which is both simpler and allows the compiler to
-// do type-checking.
-
-
-#define P_JLW(  ADDR) ((Pjlw_t) (ADDR))  // root leaf.
-#define P_JPM(  ADDR) ((Pjpm_t) (ADDR))  // root JPM.
-#define P_JBL(  ADDR) ((Pjbl_t) (ADDR))  // BranchL.
-#define P_JBB(  ADDR) ((Pjbb_t) (ADDR))  // BranchB.
-#define P_JBU(  ADDR) ((Pjbu_t) (ADDR))  // BranchU.
-#define P_JLL(  ADDR) ((Pjll_t) (ADDR))  // LeafL.
-#define P_JLB(  ADDR) ((Pjlb_t) (ADDR))  // LeafB1.
-#define P_JP(   ADDR) ((Pjp_t)  (ADDR))  // JP.
-
-#ifdef JUDYL
-#define P_JV(   ADDR) ((Pjv_t)  (ADDR))  // &value.
-#endif
-
-
-// LEAST BYTES:
-//
-// Mask for least bytes of a word, and a macro to perform this mask on an
-// Index.
-//
-// Note:  This macro has been problematic in the past to get right and to make
-// portable.  Its not OK on all systems to shift by the full word size.  This
-// macro should allow shifting by 1..N bytes, where N is the word size, but
-// should produce a compiler warning if the macro is called with Bytes == 0.
-//
-// Warning:  JU_LEASTBYTESMASK() is not a constant macro unless Bytes is a
-// constant; otherwise it is a variable shift, which is expensive on some
-// processors.
-
-#define JU_LEASTBYTESMASK(BYTES) \
-        (((Word_t)0x100 << (cJU_BITSPERBYTE * ((BYTES) - 1))) - 1)
-
-#define JU_LEASTBYTES(INDEX,BYTES)  ((INDEX) & JU_LEASTBYTESMASK(BYTES))
-
-
-// BITS IN EACH BITMAP SUBEXPANSE FOR BITMAP BRANCH AND LEAF:
-//
-// The bits per bitmap subexpanse times the number of subexpanses equals a
-// constant (cJU_SUBEXPPERSTATE).  You can also think of this as a compile-time
-// choice of "aspect ratio" for bitmap branches and leaves (which can be set
-// independently for each).
-//
-// A default aspect ratio is hardwired here if not overridden at compile time,
-// such as by "EXTCCOPTS=-DBITMAP_BRANCH16x16 make".
-
-#if (! (defined(BITMAP_BRANCH8x32) || defined(BITMAP_BRANCH16x16) || defined(BITMAP_BRANCH32x8)))
-#define BITMAP_BRANCH32x8 1     // 32 bits per subexpanse, 8 subexpanses.
-#endif
-
-#ifdef BITMAP_BRANCH8x32
-#define BITMAPB_t uint8_t
-#endif
-
-#ifdef BITMAP_BRANCH16x16
-#define BITMAPB_t uint16_t
-#endif
-
-#ifdef BITMAP_BRANCH32x8
-#define BITMAPB_t uint32_t
-#endif
-
-// Note:  For bitmap leaves, BITMAP_LEAF64x4 is only valid for 64 bit:
-//
-// Note:  Choice of aspect ratio mostly matters for JudyL bitmap leaves.  For
-// Judy1 the choice doesnt matter much -- the code generated for different
-// BITMAP_LEAF* values choices varies, but correctness and performance are the
-// same.
-
-#ifndef JU_64BIT
-
-#if (! (defined(BITMAP_LEAF8x32) || defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8)))
-#define BITMAP_LEAF32x8         // 32 bits per subexpanse, 8 subexpanses.
-#endif
-
-#else // 32BIT
-
-#if (! (defined(BITMAP_LEAF8x32) || defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4)))
-#define BITMAP_LEAF64x4         // 64 bits per subexpanse, 4 subexpanses.
-
-#endif
-#endif // JU_64BIT
-
-#ifdef BITMAP_LEAF8x32
-#define BITMAPL_t uint8_t
-#endif
-
-#ifdef BITMAP_LEAF16x16
-#define BITMAPL_t uint16_t
-#endif
-
-#ifdef BITMAP_LEAF32x8
-#define BITMAPL_t uint32_t
-#endif
-
-#ifdef BITMAP_LEAF64x4
-#define BITMAPL_t uint64_t
-#endif
-
-
-// EXPORTED DATA AND FUNCTIONS:
-
-#ifdef JUDY1
-extern const uint8_t j__1_BranchBJPPopToWords[];
-#endif
-
-#ifdef JUDYL
-extern const uint8_t j__L_BranchBJPPopToWords[];
-#endif
-
-// Fast LeafL search routine used for inlined code:
-
-#if (! defined(SEARCH_BINARY)) || (! defined(SEARCH_LINEAR))
-// default a binary search leaf method
-#define SEARCH_BINARY 1
-//#define SEARCH_LINEAR 1
-#endif
-
-#ifdef SEARCH_LINEAR
-
-#define SEARCHLEAFNATIVE(LEAFTYPE,ADDR,POP1,INDEX)              \
-    LEAFTYPE *P_leaf = (LEAFTYPE *)(ADDR);                      \
-    LEAFTYPE  I_ndex = (INDEX); /* with masking */              \
-    if (I_ndex > P_leaf[(POP1) - 1]) return(~(POP1));           \
-    while(I_ndex > *P_leaf) P_leaf++;                           \
-    if (I_ndex == *P_leaf) return(P_leaf - (LEAFTYPE *)(ADDR)); \
-    return(~(P_leaf - (LEAFTYPE *)(ADDR)));
-
-
-#define SEARCHLEAFNONNAT(ADDR,POP1,INDEX,LFBTS,COPYINDEX)       \
-{                                                               \
-    uint8_t *P_leaf, *P_leafEnd;                                \
-    Word_t   i_ndex;                                            \
-    Word_t   I_ndex = JU_LEASTBYTES((INDEX), (LFBTS));          \
-    Word_t   p_op1;                                             \
-                                                                \
-    P_leaf    = (uint8_t *)(ADDR);                              \
-    P_leafEnd = P_leaf + ((POP1) * (LFBTS));                    \
-                                                                \
-    do {                                                        \
-        JU_COPY3_PINDEX_TO_LONG(i_ndex, P_leaf);                \
-        if (I_ndex <= i_ndex) break;                            \
-        P_leaf += (LFBTS);                                      \
-    } while (P_leaf < P_leafEnd);                               \
-                                                                \
-    p_op1 = (P_leaf - (uint8_t *) (ADDR)) / (LFBTS);            \
-    if (I_ndex == i_ndex) return(p_op1);                        \
-    return(~p_op1);                                             \
-}
-#endif // SEARCH_LINEAR
-
-#ifdef SEARCH_BINARY
-
-#define SEARCHLEAFNATIVE(LEAFTYPE,ADDR,POP1,INDEX)              \
-    LEAFTYPE *P_leaf = (LEAFTYPE *)(ADDR);                      \
-    LEAFTYPE I_ndex = (LEAFTYPE)INDEX; /* truncate hi bits */   \
-    Word_t   l_ow   = cJU_ALLONES;                              \
-    Word_t   m_id;                                              \
-    Word_t   h_igh  = POP1;                                     \
-                                                                \
-    while ((h_igh - l_ow) > 1UL)                                \
-    {                                                           \
-        m_id = (h_igh + l_ow) / 2;                              \
-        if (P_leaf[m_id] > I_ndex)                              \
-            h_igh = m_id;                                       \
-        else                                                    \
-            l_ow = m_id;                                        \
-    }                                                           \
-    if (l_ow == cJU_ALLONES || P_leaf[l_ow] != I_ndex)          \
-        return(~h_igh);                                         \
-    return(l_ow)
-
-
-#define SEARCHLEAFNONNAT(ADDR,POP1,INDEX,LFBTS,COPYINDEX)       \
-    uint8_t *P_leaf = (uint8_t *)(ADDR);                        \
-    Word_t   l_ow   = cJU_ALLONES;                              \
-    Word_t   m_id;                                              \
-    Word_t   h_igh  = POP1;                                     \
-    Word_t   I_ndex = JU_LEASTBYTES((INDEX), (LFBTS));          \
-    Word_t   i_ndex;                                            \
-                                                                \
-    I_ndex = JU_LEASTBYTES((INDEX), (LFBTS));                   \
-                                                                \
-    while ((h_igh - l_ow) > 1UL)                                \
-    {                                                           \
-        m_id = (h_igh + l_ow) / 2;                              \
-        COPYINDEX(i_ndex, &P_leaf[m_id * (LFBTS)]);             \
-        if (i_ndex > I_ndex)                                    \
-            h_igh = m_id;                                       \
-        else                                                    \
-            l_ow = m_id;                                        \
-    }                                                           \
-    if (l_ow == cJU_ALLONES) return(~h_igh);                    \
-                                                                \
-    COPYINDEX(i_ndex, &P_leaf[l_ow * (LFBTS)]);                 \
-    if (i_ndex != I_ndex) return(~h_igh);                       \
-    return(l_ow)
-
-#endif // SEARCH_BINARY
-
-// Fast way to count bits set in 8..32[64]-bit int:
-//
-// For performance, j__udyCountBits*() are written to take advantage of
-// platform-specific features where available.
-//
-
-#ifdef JU_NOINLINE
-
-extern BITMAPB_t j__udyCountBitsB(BITMAPB_t word);
-extern BITMAPL_t j__udyCountBitsL(BITMAPL_t word);
-
-// Compiler supports inline
-
-#elif  defined(JU_HPUX_IPF)
-
-#define j__udyCountBitsB(WORD)  _Asm_popcnt(WORD)
-#define j__udyCountBitsL(WORD)  _Asm_popcnt(WORD)
-
-#elif defined(JU_LINUX_IPF)
-
-static inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word)
-{
-        BITMAPB_t result;
-        __asm__ ("popcnt %0=%1" : "=r" (result) : "r" (word));
-        return(result);
-}
-
-static inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word)
-{
-        BITMAPL_t result;
-        __asm__ ("popcnt %0=%1" : "=r" (result) : "r" (word));
-        return(result);
-}
-
-
-#else // No instructions available, use inline code
-
-// ****************************************************************************
-// __ J U D Y   C O U N T   B I T S   B
-//
-// Return the number of bits set in "Word", for a bitmap branch.
-//
-// Note:  Bitmap branches have maximum bitmap size = 32 bits.
-
-#ifdef JU_WIN
-static __inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word)
-#else
-static inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word)
-#endif 
-{
-        word = (word & 0x55555555) + ((word & 0xAAAAAAAA) >>  1);
-        word = (word & 0x33333333) + ((word & 0xCCCCCCCC) >>  2);
-        word = (word & 0x0F0F0F0F) + ((word & 0xF0F0F0F0) >>  4); // >= 8 bits.
-#if defined(BITMAP_BRANCH16x16) || defined(BITMAP_BRANCH32x8)
-        word = (word & 0x00FF00FF) + ((word & 0xFF00FF00) >>  8); // >= 16 bits.
-#endif
-
-#ifdef BITMAP_BRANCH32x8
-        word = (word & 0x0000FFFF) + ((word & 0xFFFF0000) >> 16); // >= 32 bits.
-#endif
-        return(word);
-
-} // j__udyCountBitsB()
-
-
-// ****************************************************************************
-// __ J U D Y   C O U N T   B I T S   L
-//
-// Return the number of bits set in "Word", for a bitmap leaf.
-//
-// Note:  Bitmap branches have maximum bitmap size = 32 bits.
-
-// Note:  Need both 32-bit and 64-bit versions of j__udyCountBitsL() because
-// bitmap leaves can have 64-bit bitmaps.
-
-#ifdef JU_WIN
-static __inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word)
-#else
-static inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word)
-#endif
-{
-#ifndef JU_64BIT
-
-        word = (word & 0x55555555) + ((word & 0xAAAAAAAA) >>  1);
-        word = (word & 0x33333333) + ((word & 0xCCCCCCCC) >>  2);
-        word = (word & 0x0F0F0F0F) + ((word & 0xF0F0F0F0) >>  4); // >= 8 bits.
-#if defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8)
-        word = (word & 0x00FF00FF) + ((word & 0xFF00FF00) >>  8); // >= 16 bits.
-#endif
-#ifdef BITMAP_LEAF32x8
-        word = (word & 0x0000FFFF) + ((word & 0xFFFF0000) >> 16); // >= 32 bits.
-#endif
-
-#else // JU_64BIT
-
-        word = (word & 0x5555555555555555) + ((word & 0xAAAAAAAAAAAAAAAA) >> 1);
-        word = (word & 0x3333333333333333) + ((word & 0xCCCCCCCCCCCCCCCC) >> 2);
-        word = (word & 0x0F0F0F0F0F0F0F0F) + ((word & 0xF0F0F0F0F0F0F0F0) >> 4);
-#if defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4)
-        word = (word & 0x00FF00FF00FF00FF) + ((word & 0xFF00FF00FF00FF00) >> 8);
-#endif
-#if defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4)
-        word = (word & 0x0000FFFF0000FFFF) + ((word & 0xFFFF0000FFFF0000) >>16);
-#endif
-#ifdef BITMAP_LEAF64x4
-        word = (word & 0x00000000FFFFFFFF) + ((word & 0xFFFFFFFF00000000) >>32);
-#endif
-#endif // JU_64BIT
-
-        return(word);
-
-} // j__udyCountBitsL()
-
-#endif // Compiler supports inline
-
-// GET POP0:
-//
-// Get from jp_DcdPopO the Pop0 for various JP Types.
-//
-// Notes:
-//
-// - Different macros require different parameters...
-//
-// - There are no simple macros for cJU_BRANCH* Types because their
-//   populations must be added up and dont reside in an already-calculated
-//   place.  (TBD:  This is no longer true, now its in the JPM.)
-//
-// - cJU_JPIMM_POP0() is not defined because it would be redundant because the
-//   Pop1 is already encoded in each enum name.
-//
-// - A linear or bitmap leaf Pop0 cannot exceed cJU_SUBEXPPERSTATE - 1 (Pop0 =
-//   0..255), so use a simpler, faster macro for it than for other JP Types.
-//
-// - Avoid any complex calculations that would slow down the compiled code.
-//   Assume these macros are only called for the appropriate JP Types.
-//   Unfortunately theres no way to trigger an assertion here if the JP type
-//   is incorrect for the macro, because these are merely expressions, not
-//   statements.
-
-#define  JU_LEAFW_POP0(JRP)                  (*P_JLW(JRP))
-#define cJU_JPFULLPOPU1_POP0                 (cJU_SUBEXPPERSTATE - 1)
-
-// GET JP Type:
-// Since bit fields greater than 32 bits are not supported in some compilers
-// the jp_DcdPopO field is expanded to include the jp_Type in the high 8 bits
-// of the Word_t.
-// First the read macro:
-
-#define JU_JPTYPE(PJP)          ((PJP)->jp_Type)
-
-#define JU_JPLEAF_POP0(PJP)     ((PJP)->jp_DcdP0[sizeof(Word_t) - 2])
-
-#ifdef JU_64BIT
-
-#define JU_JPDCDPOP0(PJP)               \
-    ((Word_t)(PJP)->jp_DcdP0[0] << 48 | \
-     (Word_t)(PJP)->jp_DcdP0[1] << 40 | \
-     (Word_t)(PJP)->jp_DcdP0[2] << 32 | \
-     (Word_t)(PJP)->jp_DcdP0[3] << 24 | \
-     (Word_t)(PJP)->jp_DcdP0[4] << 16 | \
-     (Word_t)(PJP)->jp_DcdP0[5] <<  8 | \
-     (Word_t)(PJP)->jp_DcdP0[6])
-
-
-#define JU_JPSETADT(PJP,ADDR,DCDPOP0,TYPE)                      \
-{                                                               \
-    (PJP)->jp_Addr     = (ADDR);                                \
-    (PJP)->jp_DcdP0[0] = (uint8_t)((Word_t)(DCDPOP0) >> 48);    \
-    (PJP)->jp_DcdP0[1] = (uint8_t)((Word_t)(DCDPOP0) >> 40);    \
-    (PJP)->jp_DcdP0[2] = (uint8_t)((Word_t)(DCDPOP0) >> 32);    \
-    (PJP)->jp_DcdP0[3] = (uint8_t)((Word_t)(DCDPOP0) >> 24);    \
-    (PJP)->jp_DcdP0[4] = (uint8_t)((Word_t)(DCDPOP0) >> 16);    \
-    (PJP)->jp_DcdP0[5] = (uint8_t)((Word_t)(DCDPOP0) >>  8);    \
-    (PJP)->jp_DcdP0[6] = (uint8_t)((Word_t)(DCDPOP0));          \
-    (PJP)->jp_Type     = (TYPE);                                \
-}
-
-#else   // 32 Bit
-
-#define JU_JPDCDPOP0(PJP)               \
-    ((Word_t)(PJP)->jp_DcdP0[0] << 16 | \
-     (Word_t)(PJP)->jp_DcdP0[1] <<  8 | \
-     (Word_t)(PJP)->jp_DcdP0[2])
-
-
-#define JU_JPSETADT(PJP,ADDR,DCDPOP0,TYPE)                      \
-{                                                               \
-    (PJP)->jp_Addr     = (ADDR);                                \
-    (PJP)->jp_DcdP0[0] = (uint8_t)((Word_t)(DCDPOP0) >> 16);    \
-    (PJP)->jp_DcdP0[1] = (uint8_t)((Word_t)(DCDPOP0) >>  8);    \
-    (PJP)->jp_DcdP0[2] = (uint8_t)((Word_t)(DCDPOP0));          \
-    (PJP)->jp_Type     = (TYPE);                                \
-}
-
-#endif  // 32 Bit
-
-// NUMBER OF BITS IN A BRANCH OR LEAF BITMAP AND SUBEXPANSE:
-//
-// Note:  cJU_BITSPERBITMAP must be the same as the number of JPs in a branch.
-
-#define cJU_BITSPERBITMAP cJU_SUBEXPPERSTATE
-
-// Bitmaps are accessed in units of "subexpanses":
-
-#define cJU_BITSPERSUBEXPB  (sizeof(BITMAPB_t) * cJU_BITSPERBYTE)
-#define cJU_NUMSUBEXPB      (cJU_BITSPERBITMAP / cJU_BITSPERSUBEXPB)
-
-#define cJU_BITSPERSUBEXPL  (sizeof(BITMAPL_t) * cJU_BITSPERBYTE)
-#define cJU_NUMSUBEXPL      (cJU_BITSPERBITMAP / cJU_BITSPERSUBEXPL)
-
-
-// MASK FOR A SPECIFIED BIT IN A BITMAP:
-//
-// Warning:  If BitNum is a variable, this results in a variable shift that is
-// expensive, at least on some processors.  Use with caution.
-//
-// Warning:  BitNum must be less than cJU_BITSPERWORD, that is, 0 ..
-// cJU_BITSPERWORD - 1, to avoid a truncated shift on some machines.
-//
-// TBD:  Perhaps use an array[32] of masks instead of calculating them.
-
-#define JU_BITPOSMASKB(BITNUM) ((Word_t)1 << ((BITNUM) % cJU_BITSPERSUBEXPB))
-#define JU_BITPOSMASKL(BITNUM) ((Word_t)1 << ((BITNUM) % cJU_BITSPERSUBEXPL))
-
-
-// TEST/SET/CLEAR A BIT IN A BITMAP LEAF:
-//
-// Test if a byte-sized Digit (portion of Index) has a corresponding bit set in
-// a bitmap, or set a byte-sized Digits bit into a bitmap, by looking up the
-// correct subexpanse and then checking/setting the correct bit.
-//
-// Note:  Mask higher bits, if any, for the convenience of the user of this
-// macro, in case they pass a full Index, not just a digit.  If the caller has
-// a true 8-bit digit, make it of type uint8_t and the compiler should skip the
-// unnecessary mask step.
-
-#define JU_SUBEXPL(DIGIT) (((DIGIT) / cJU_BITSPERSUBEXPL) & (cJU_NUMSUBEXPL-1))
-
-#define JU_BITMAPTESTL(PJLB, INDEX)  \
-    (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) &  JU_BITPOSMASKL(INDEX))
-
-#define JU_BITMAPSETL(PJLB, INDEX)   \
-    (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) |= JU_BITPOSMASKL(INDEX))
-
-#define JU_BITMAPCLEARL(PJLB, INDEX) \
-    (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) ^= JU_BITPOSMASKL(INDEX))
-
-
-// MAP BITMAP BIT OFFSET TO DIGIT:
-//
-// Given a digit variable to set, a bitmap branch or leaf subexpanse (base 0),
-// the bitmap (BITMAP*_t) for that subexpanse, and an offset (Nth set bit in
-// the bitmap, base 0), compute the digit (also base 0) corresponding to the
-// subexpanse and offset by counting all bits in the bitmap until offset+1 set
-// bits are seen.  Avoid expensive variable shifts.  Offset should be less than
-// the number of set bits in the bitmap; assert this.
-//
-// If theres a better way to do this, I dont know what it is.
-
-#define JU_BITMAPDIGITB(DIGIT,SUBEXP,BITMAP,OFFSET)             \
-        {                                                       \
-            BITMAPB_t bitmap = (BITMAP); int remain = (OFFSET); \
-            (DIGIT) = (SUBEXP) * cJU_BITSPERSUBEXPB;            \
-                                                                \
-            while ((remain -= (bitmap & 1)) >= 0)               \
-            {                                                   \
-                bitmap >>= 1; ++(DIGIT);                        \
-                assert((DIGIT) < ((SUBEXP) + 1) * cJU_BITSPERSUBEXPB); \
-            }                                                   \
-        }
-
-#define JU_BITMAPDIGITL(DIGIT,SUBEXP,BITMAP,OFFSET)             \
-        {                                                       \
-            BITMAPL_t bitmap = (BITMAP); int remain = (OFFSET); \
-            (DIGIT) = (SUBEXP) * cJU_BITSPERSUBEXPL;            \
-                                                                \
-            while ((remain -= (bitmap & 1)) >= 0)               \
-            {                                                   \
-                bitmap >>= 1; ++(DIGIT);                        \
-                assert((DIGIT) < ((SUBEXP) + 1) * cJU_BITSPERSUBEXPL); \
-            }                                                   \
-        }
-
-
-// MASKS FOR PORTIONS OF 32-BIT WORDS:
-//
-// These are useful for bitmap subexpanses.
-//
-// "LOWER"/"HIGHER" means bits representing lower/higher-valued Indexes.  The
-// exact order of bits in the word is explicit here but is hidden from the
-// caller.
-//
-// "EXC" means exclusive of the specified bit; "INC" means inclusive.
-//
-// In each case, BitPos is either "JU_BITPOSMASK*(BitNum)", or a variable saved
-// from an earlier call of that macro; either way, it must be a 32-bit word
-// with a single bit set.  In the first case, assume the compiler is smart
-// enough to optimize out common subexpressions.
-//
-// The expressions depend on unsigned decimal math that should be universal.
-
-#define JU_MASKLOWEREXC( BITPOS)  ((BITPOS) - 1)
-#define JU_MASKLOWERINC( BITPOS)  (JU_MASKLOWEREXC(BITPOS) | (BITPOS))
-#define JU_MASKHIGHERINC(BITPOS)  (-(BITPOS))
-#define JU_MASKHIGHEREXC(BITPOS)  (JU_MASKHIGHERINC(BITPOS) ^ (BITPOS))
-
-
-// ****************************************************************************
-// SUPPORT FOR NATIVE INDEX SIZES
-// ****************************************************************************
-//
-// Copy a series of generic objects (uint8_t, uint16_t, uint32_t, Word_t) from
-// one place to another.
-
-#define JU_COPYMEM(PDST,PSRC,POP1)                      \
-    {                                                   \
-        Word_t i_ndex = 0;                              \
-        assert((POP1) > 0);                             \
-        do { (PDST)[i_ndex] = (PSRC)[i_ndex]; } \
-        while (++i_ndex < (POP1));                      \
-    }
-
-
-// ****************************************************************************
-// SUPPORT FOR NON-NATIVE INDEX SIZES
-// ****************************************************************************
-//
-// Copy a 3-byte Index pointed by a uint8_t * to a Word_t:
-//
-#define JU_COPY3_PINDEX_TO_LONG(DESTLONG,PINDEX)        \
-    DESTLONG  = (Word_t)(PINDEX)[0] << 16;              \
-    DESTLONG += (Word_t)(PINDEX)[1] <<  8;              \
-    DESTLONG += (Word_t)(PINDEX)[2]
-
-// Copy a Word_t to a 3-byte Index pointed at by a uint8_t *:
-
-#define JU_COPY3_LONG_TO_PINDEX(PINDEX,SOURCELONG)      \
-    (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 16);        \
-    (PINDEX)[1] = (uint8_t)((SOURCELONG) >>  8);        \
-    (PINDEX)[2] = (uint8_t)((SOURCELONG))
-
-#ifdef JU_64BIT
-
-// Copy a 5-byte Index pointed by a uint8_t * to a Word_t:
-//
-#define JU_COPY5_PINDEX_TO_LONG(DESTLONG,PINDEX)        \
-    DESTLONG  = (Word_t)(PINDEX)[0] << 32;              \
-    DESTLONG += (Word_t)(PINDEX)[1] << 24;              \
-    DESTLONG += (Word_t)(PINDEX)[2] << 16;              \
-    DESTLONG += (Word_t)(PINDEX)[3] <<  8;              \
-    DESTLONG += (Word_t)(PINDEX)[4]
-
-// Copy a Word_t to a 5-byte Index pointed at by a uint8_t *:
-
-#define JU_COPY5_LONG_TO_PINDEX(PINDEX,SOURCELONG)      \
-    (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 32);        \
-    (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 24);        \
-    (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 16);        \
-    (PINDEX)[3] = (uint8_t)((SOURCELONG) >>  8);        \
-    (PINDEX)[4] = (uint8_t)((SOURCELONG))
-
-// Copy a 6-byte Index pointed by a uint8_t * to a Word_t:
-//
-#define JU_COPY6_PINDEX_TO_LONG(DESTLONG,PINDEX)        \
-    DESTLONG  = (Word_t)(PINDEX)[0] << 40;              \
-    DESTLONG += (Word_t)(PINDEX)[1] << 32;              \
-    DESTLONG += (Word_t)(PINDEX)[2] << 24;              \
-    DESTLONG += (Word_t)(PINDEX)[3] << 16;              \
-    DESTLONG += (Word_t)(PINDEX)[4] <<  8;              \
-    DESTLONG += (Word_t)(PINDEX)[5]
-
-// Copy a Word_t to a 6-byte Index pointed at by a uint8_t *:
-
-#define JU_COPY6_LONG_TO_PINDEX(PINDEX,SOURCELONG)      \
-    (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 40);        \
-    (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 32);        \
-    (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 24);        \
-    (PINDEX)[3] = (uint8_t)((SOURCELONG) >> 16);        \
-    (PINDEX)[4] = (uint8_t)((SOURCELONG) >>  8);        \
-    (PINDEX)[5] = (uint8_t)((SOURCELONG))
-
-// Copy a 7-byte Index pointed by a uint8_t * to a Word_t:
-//
-#define JU_COPY7_PINDEX_TO_LONG(DESTLONG,PINDEX)        \
-    DESTLONG  = (Word_t)(PINDEX)[0] << 48;              \
-    DESTLONG += (Word_t)(PINDEX)[1] << 40;              \
-    DESTLONG += (Word_t)(PINDEX)[2] << 32;              \
-    DESTLONG += (Word_t)(PINDEX)[3] << 24;              \
-    DESTLONG += (Word_t)(PINDEX)[4] << 16;              \
-    DESTLONG += (Word_t)(PINDEX)[5] <<  8;              \
-    DESTLONG += (Word_t)(PINDEX)[6]
-
-// Copy a Word_t to a 7-byte Index pointed at by a uint8_t *:
-
-#define JU_COPY7_LONG_TO_PINDEX(PINDEX,SOURCELONG)      \
-    (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 48);        \
-    (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 40);        \
-    (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 32);        \
-    (PINDEX)[3] = (uint8_t)((SOURCELONG) >> 24);        \
-    (PINDEX)[4] = (uint8_t)((SOURCELONG) >> 16);        \
-    (PINDEX)[5] = (uint8_t)((SOURCELONG) >>  8);        \
-    (PINDEX)[6] = (uint8_t)((SOURCELONG))
-
-#endif // JU_64BIT
-
-// ****************************************************************************
-// COMMON CODE FRAGMENTS (MACROS)
-// ****************************************************************************
-//
-// These code chunks are shared between various source files.
-
-
-// SET (REPLACE) ONE DIGIT IN AN INDEX:
-//
-// To avoid endian issues, use masking and ORing, which operates in a
-// big-endian register, rather than treating the Index as an array of bytes,
-// though that would be simpler, but would operate in endian-specific memory.
-//
-// TBD:  This contains two variable shifts, is that bad?
-
-#define JU_SETDIGIT(INDEX,DIGIT,STATE)                  \
-        (INDEX) = ((INDEX) & (~cJU_MASKATSTATE(STATE))) \
-                           | (((Word_t) (DIGIT))        \
-                              << (((STATE) - 1) * cJU_BITSPERBYTE))
-
-// Fast version for single LSB:
-
-#define JU_SETDIGIT1(INDEX,DIGIT) (INDEX) = ((INDEX) & ~0xff) | (DIGIT)
-
-
-// SET (REPLACE) "N" LEAST DIGITS IN AN INDEX:
-
-#define JU_SETDIGITS(INDEX,INDEX2,cSTATE) \
-        (INDEX) = ((INDEX ) & (~JU_LEASTBYTESMASK(cSTATE))) \
-                | ((INDEX2) & ( JU_LEASTBYTESMASK(cSTATE)))
-
-// COPY DECODE BYTES FROM JP TO INDEX:
-//
-// Modify Index digit(s) to match the bytes in jp_DcdPopO in case one or more
-// branches are skipped and the digits are significant.  Its probably faster
-// to just do this unconditionally than to check if its necessary.
-//
-// To avoid endian issues, use masking and ORing, which operates in a
-// big-endian register, rather than treating the Index as an array of bytes,
-// though that would be simpler, but would operate in endian-specific memory.
-//
-// WARNING:  Must not call JU_LEASTBYTESMASK (via cJU_DCDMASK) with Bytes =
-// cJU_ROOTSTATE or a bad mask is generated, but there are no Dcd bytes to copy
-// in this case anyway.  In fact there are no Dcd bytes unless State <
-// cJU_ROOTSTATE - 1, so dont call this macro except in those cases.
-//
-// TBD:  It would be nice to validate jp_DcdPopO against known digits to ensure
-// no corruption, but this is non-trivial.
-
-#define JU_SETDCD(INDEX,PJP,cSTATE)                             \
-    (INDEX) = ((INDEX) & ~cJU_DCDMASK(cSTATE))                  \
-                | (JU_JPDCDPOP0(PJP) & cJU_DCDMASK(cSTATE))
-
-// INSERT/DELETE AN INDEX IN-PLACE IN MEMORY:
-//
-// Given a pointer to an array of "even" (native), same-sized objects
-// (indexes), the current population of the array, an offset in the array, and
-// a new Index to insert, "shift up" the array elements (Indexes) above the
-// insertion point and insert the new Index.  Assume there is sufficient memory
-// to do this.
-//
-// In these macros, "i_offset" is an index offset, and "b_off" is a byte
-// offset for odd Index sizes.
-//
-// Note:  Endian issues only arise fro insertion, not deletion, and even for
-// insertion, they are transparent when native (even) objects are used, and
-// handled explicitly for odd (non-native) Index sizes.
-//
-// Note:  The following macros are tricky enough that there is some test code
-// for them appended to this file.
-
-#define JU_INSERTINPLACE(PARRAY,POP1,OFFSET,INDEX)              \
-        assert((long) (POP1) > 0);                              \
-        assert((Word_t) (OFFSET) <= (Word_t) (POP1));           \
-        {                                                       \
-            Word_t i_offset = (POP1);                           \
-                                                                \
-            while (i_offset-- > (OFFSET))                       \
-                (PARRAY)[i_offset + 1] = (PARRAY)[i_offset];    \
-                                                                \
-            (PARRAY)[OFFSET] = (INDEX);                         \
-        }
-
-
-// Variation for non-native Indexes, where cIS = Index Size
-// and PByte must point to a uint8_t (byte); shift byte-by-byte:
-//
-
-#define JU_INSERTINPLACE3(PBYTE,POP1,OFFSET,INDEX)              \
-{                                                               \
-    Word_t i_off = POP1;                                        \
-                                                                \
-    while (i_off-- > (OFFSET))                                  \
-    {                                                           \
-        Word_t  i_dx = i_off * 3;                               \
-        (PBYTE)[i_dx + 0 + 3] = (PBYTE)[i_dx + 0];              \
-        (PBYTE)[i_dx + 1 + 3] = (PBYTE)[i_dx + 1];              \
-        (PBYTE)[i_dx + 2 + 3] = (PBYTE)[i_dx + 2];              \
-    }                                                           \
-    JU_COPY3_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 3]), INDEX);   \
-}
-
-#ifdef JU_64BIT
-
-#define JU_INSERTINPLACE5(PBYTE,POP1,OFFSET,INDEX)              \
-{                                                               \
-    Word_t i_off = POP1;                                        \
-                                                                \
-    while (i_off-- > (OFFSET))                                  \
-    {                                                           \
-        Word_t  i_dx = i_off * 5;                               \
-        (PBYTE)[i_dx + 0 + 5] = (PBYTE)[i_dx + 0];              \
-        (PBYTE)[i_dx + 1 + 5] = (PBYTE)[i_dx + 1];              \
-        (PBYTE)[i_dx + 2 + 5] = (PBYTE)[i_dx + 2];              \
-        (PBYTE)[i_dx + 3 + 5] = (PBYTE)[i_dx + 3];              \
-        (PBYTE)[i_dx + 4 + 5] = (PBYTE)[i_dx + 4];              \
-    }                                                           \
-    JU_COPY5_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 5]), INDEX);   \
-}
-
-#define JU_INSERTINPLACE6(PBYTE,POP1,OFFSET,INDEX)              \
-{                                                               \
-    Word_t i_off = POP1;                                        \
-                                                                \
-    while (i_off-- > (OFFSET))                                  \
-    {                                                           \
-        Word_t  i_dx = i_off * 6;                               \
-        (PBYTE)[i_dx + 0 + 6] = (PBYTE)[i_dx + 0];              \
-        (PBYTE)[i_dx + 1 + 6] = (PBYTE)[i_dx + 1];              \
-        (PBYTE)[i_dx + 2 + 6] = (PBYTE)[i_dx + 2];              \
-        (PBYTE)[i_dx + 3 + 6] = (PBYTE)[i_dx + 3];              \
-        (PBYTE)[i_dx + 4 + 6] = (PBYTE)[i_dx + 4];              \
-        (PBYTE)[i_dx + 5 + 6] = (PBYTE)[i_dx + 5];              \
-    }                                                           \
-    JU_COPY6_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 6]), INDEX);   \
-}
-
-#define JU_INSERTINPLACE7(PBYTE,POP1,OFFSET,INDEX)              \
-{                                                               \
-    Word_t i_off = POP1;                                        \
-                                                                \
-    while (i_off-- > (OFFSET))                                  \
-    {                                                           \
-        Word_t  i_dx = i_off * 7;                               \
-        (PBYTE)[i_dx + 0 + 7] = (PBYTE)[i_dx + 0];              \
-        (PBYTE)[i_dx + 1 + 7] = (PBYTE)[i_dx + 1];              \
-        (PBYTE)[i_dx + 2 + 7] = (PBYTE)[i_dx + 2];              \
-        (PBYTE)[i_dx + 3 + 7] = (PBYTE)[i_dx + 3];              \
-        (PBYTE)[i_dx + 4 + 7] = (PBYTE)[i_dx + 4];              \
-        (PBYTE)[i_dx + 5 + 7] = (PBYTE)[i_dx + 5];              \
-        (PBYTE)[i_dx + 6 + 7] = (PBYTE)[i_dx + 6];              \
-    }                                                           \
-    JU_COPY7_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 7]), INDEX);   \
-}
-#endif // JU_64BIT
-
-// Counterparts to the above for deleting an Index:
-//
-// "Shift down" the array elements starting at the Index to be deleted.
-
-#define JU_DELETEINPLACE(PARRAY,POP1,OFFSET,IGNORE)             \
-        assert((long) (POP1) > 0);                              \
-        assert((Word_t) (OFFSET) < (Word_t) (POP1));            \
-        {                                                       \
-            Word_t i_offset = (OFFSET);                         \
-                                                                \
-            while (++i_offset < (POP1))                         \
-                (PARRAY)[i_offset - 1] = (PARRAY)[i_offset];    \
-        }
-
-// Variation for odd-byte-sized (non-native) Indexes, where cIS = Index Size
-// and PByte must point to a uint8_t (byte); copy byte-by-byte:
-//
-// Note:  If cIS == 1, JU_DELETEINPLACE_ODD == JU_DELETEINPLACE.
-//
-// Note:  There are no endian issues here because bytes are just shifted as-is,
-// not converted to/from an Index.
-
-#define JU_DELETEINPLACE_ODD(PBYTE,POP1,OFFSET,cIS)             \
-        assert((long) (POP1) > 0);                              \
-        assert((Word_t) (OFFSET) < (Word_t) (POP1));            \
-        {                                                       \
-            Word_t b_off = (((OFFSET) + 1) * (cIS)) - 1;        \
-                                                                \
-            while (++b_off < ((POP1) * (cIS)))                  \
-                (PBYTE)[b_off - (cIS)] = (PBYTE)[b_off];        \
-        }
-
-
-// INSERT/DELETE AN INDEX WHILE COPYING OTHERS:
-//
-// Copy PSource[] to PDest[], where PSource[] has Pop1 elements (Indexes),
-// inserting Index at PDest[Offset].  Unlike JU_*INPLACE*() above, these macros
-// are used when moving Indexes from one memory object to another.
-
-#define JU_INSERTCOPY(PDEST,PSOURCE,POP1,OFFSET,INDEX)          \
-        assert((long) (POP1) > 0);                              \
-        assert((Word_t) (OFFSET) <= (Word_t) (POP1));           \
-        {                                                       \
-            Word_t i_offset;                                    \
-                                                                \
-            for (i_offset = 0; i_offset < (OFFSET); ++i_offset) \
-                (PDEST)[i_offset] = (PSOURCE)[i_offset];        \
-                                                                \
-            (PDEST)[i_offset] = (INDEX);                        \
-                                                                \
-            for (/* null */; i_offset < (POP1); ++i_offset)     \
-                (PDEST)[i_offset + 1] = (PSOURCE)[i_offset];    \
-        }
-
-#define JU_INSERTCOPY3(PDEST,PSOURCE,POP1,OFFSET,INDEX)         \
-assert((long) (POP1) > 0);                                      \
-assert((Word_t) (OFFSET) <= (Word_t) (POP1));                   \
-{                                                               \
-    Word_t o_ff;                                                \
-                                                                \
-    for (o_ff = 0; o_ff < (OFFSET); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 3;                                \
-        (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0];                \
-        (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1];                \
-        (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2];                \
-    }                                                           \
-    JU_COPY3_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 3]), INDEX);   \
-                                                                \
-    for (/* null */; o_ff < (POP1); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 3;                                \
-        (PDEST)[i_dx + 0 + 3] = (PSOURCE)[i_dx + 0];            \
-        (PDEST)[i_dx + 1 + 3] = (PSOURCE)[i_dx + 1];            \
-        (PDEST)[i_dx + 2 + 3] = (PSOURCE)[i_dx + 2];            \
-    }                                                           \
-}
-
-#ifdef JU_64BIT
-
-#define JU_INSERTCOPY5(PDEST,PSOURCE,POP1,OFFSET,INDEX)         \
-assert((long) (POP1) > 0);                                      \
-assert((Word_t) (OFFSET) <= (Word_t) (POP1));                   \
-{                                                               \
-    Word_t o_ff;                                                \
-                                                                \
-    for (o_ff = 0; o_ff < (OFFSET); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 5;                                \
-        (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0];                \
-        (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1];                \
-        (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2];                \
-        (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3];                \
-        (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4];                \
-    }                                                           \
-    JU_COPY5_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 5]), INDEX);   \
-                                                                \
-    for (/* null */; o_ff < (POP1); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 5;                                \
-        (PDEST)[i_dx + 0 + 5] = (PSOURCE)[i_dx + 0];            \
-        (PDEST)[i_dx + 1 + 5] = (PSOURCE)[i_dx + 1];            \
-        (PDEST)[i_dx + 2 + 5] = (PSOURCE)[i_dx + 2];            \
-        (PDEST)[i_dx + 3 + 5] = (PSOURCE)[i_dx + 3];            \
-        (PDEST)[i_dx + 4 + 5] = (PSOURCE)[i_dx + 4];            \
-    }                                                           \
-}
-
-#define JU_INSERTCOPY6(PDEST,PSOURCE,POP1,OFFSET,INDEX)         \
-assert((long) (POP1) > 0);                                      \
-assert((Word_t) (OFFSET) <= (Word_t) (POP1));                   \
-{                                                               \
-    Word_t o_ff;                                                \
-                                                                \
-    for (o_ff = 0; o_ff < (OFFSET); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 6;                                \
-        (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0];                \
-        (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1];                \
-        (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2];                \
-        (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3];                \
-        (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4];                \
-        (PDEST)[i_dx + 5] = (PSOURCE)[i_dx + 5];                \
-    }                                                           \
-    JU_COPY6_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 6]), INDEX);   \
-                                                                \
-    for (/* null */; o_ff < (POP1); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 6;                                \
-        (PDEST)[i_dx + 0 + 6] = (PSOURCE)[i_dx + 0];            \
-        (PDEST)[i_dx + 1 + 6] = (PSOURCE)[i_dx + 1];            \
-        (PDEST)[i_dx + 2 + 6] = (PSOURCE)[i_dx + 2];            \
-        (PDEST)[i_dx + 3 + 6] = (PSOURCE)[i_dx + 3];            \
-        (PDEST)[i_dx + 4 + 6] = (PSOURCE)[i_dx + 4];            \
-        (PDEST)[i_dx + 5 + 6] = (PSOURCE)[i_dx + 5];            \
-    }                                                           \
-}
-
-#define JU_INSERTCOPY7(PDEST,PSOURCE,POP1,OFFSET,INDEX)         \
-assert((long) (POP1) > 0);                                      \
-assert((Word_t) (OFFSET) <= (Word_t) (POP1));                   \
-{                                                               \
-    Word_t o_ff;                                                \
-                                                                \
-    for (o_ff = 0; o_ff < (OFFSET); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 7;                                \
-        (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0];                \
-        (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1];                \
-        (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2];                \
-        (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3];                \
-        (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4];                \
-        (PDEST)[i_dx + 5] = (PSOURCE)[i_dx + 5];                \
-        (PDEST)[i_dx + 6] = (PSOURCE)[i_dx + 6];                \
-    }                                                           \
-    JU_COPY7_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 7]), INDEX);   \
-                                                                \
-    for (/* null */; o_ff < (POP1); o_ff++)                     \
-    {                                                           \
-        Word_t  i_dx = o_ff * 7;                                \
-        (PDEST)[i_dx + 0 + 7] = (PSOURCE)[i_dx + 0];            \
-        (PDEST)[i_dx + 1 + 7] = (PSOURCE)[i_dx + 1];            \
-        (PDEST)[i_dx + 2 + 7] = (PSOURCE)[i_dx + 2];            \
-        (PDEST)[i_dx + 3 + 7] = (PSOURCE)[i_dx + 3];            \
-        (PDEST)[i_dx + 4 + 7] = (PSOURCE)[i_dx + 4];            \
-        (PDEST)[i_dx + 5 + 7] = (PSOURCE)[i_dx + 5];            \
-        (PDEST)[i_dx + 6 + 7] = (PSOURCE)[i_dx + 6];            \
-    }                                                           \
-}
-
-#endif // JU_64BIT
-
-// Counterparts to the above for deleting an Index:
-
-#define JU_DELETECOPY(PDEST,PSOURCE,POP1,OFFSET,IGNORE)         \
-        assert((long) (POP1) > 0);                              \
-        assert((Word_t) (OFFSET) < (Word_t) (POP1));            \
-        {                                                       \
-            Word_t i_offset;                                    \
-                                                                \
-            for (i_offset = 0; i_offset < (OFFSET); ++i_offset) \
-                (PDEST)[i_offset] = (PSOURCE)[i_offset];        \
-                                                                \
-            for (++i_offset; i_offset < (POP1); ++i_offset)     \
-                (PDEST)[i_offset - 1] = (PSOURCE)[i_offset];    \
-        }
-
-// Variation for odd-byte-sized (non-native) Indexes, where cIS = Index Size;
-// copy byte-by-byte:
-//
-// Note:  There are no endian issues here because bytes are just shifted as-is,
-// not converted to/from an Index.
-//
-// Note:  If cIS == 1, JU_DELETECOPY_ODD == JU_DELETECOPY, at least in concept.
-
-#define JU_DELETECOPY_ODD(PDEST,PSOURCE,POP1,OFFSET,cIS)                \
-        assert((long) (POP1) > 0);                                      \
-        assert((Word_t) (OFFSET) < (Word_t) (POP1));                    \
-        {                                                               \
-            uint8_t *_Pdest   = (uint8_t *) (PDEST);                    \
-            uint8_t *_Psource = (uint8_t *) (PSOURCE);                  \
-            Word_t   b_off;                                             \
-                                                                        \
-            for (b_off = 0; b_off < ((OFFSET) * (cIS)); ++b_off)        \
-                *_Pdest++ = *_Psource++;                                \
-                                                                        \
-            _Psource += (cIS);                                          \
-                                                                        \
-            for (b_off += (cIS); b_off < ((POP1) * (cIS)); ++b_off)     \
-                *_Pdest++ = *_Psource++;                                \
-        }
-
-
-// GENERIC RETURN CODE HANDLING FOR JUDY1 (NO VALUE AREAS) AND JUDYL (VALUE
-// AREAS):
-//
-// This common code hides Judy1 versus JudyL details of how to return various
-// conditions, including a pointer to a value area for JudyL.
-//
-// First, define an internal variation of JERR called JERRI (I = int) to make
-// lint happy.  We accidentally shipped to 11.11 OEUR with all functions that
-// return int or Word_t using JERR, which is type Word_t, for errors.  Lint
-// complains about this for functions that return int.  So, internally use
-// JERRI for error returns from the int functions.  Experiments show that
-// callers which compare int Foo() to (Word_t) JERR (~0UL) are OK, since JERRI
-// sign-extends to match JERR.
-
-#define JERRI ((int) ~0)                // see above.
-
-#ifdef JUDY1
-
-#define JU_RET_FOUND    return(1)
-#define JU_RET_NOTFOUND return(0)
-
-// For Judy1, these all "fall through" to simply JU_RET_FOUND, since there is no
-// value area pointer to return:
-
-#define JU_RET_FOUND_LEAFW(PJLW,POP1,OFFSET)    JU_RET_FOUND
-
-#define JU_RET_FOUND_JPM(Pjpm)                  JU_RET_FOUND
-#define JU_RET_FOUND_PVALUE(Pjv,OFFSET)         JU_RET_FOUND
-#ifndef JU_64BIT
-#define JU_RET_FOUND_LEAF1(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#endif
-#define JU_RET_FOUND_LEAF2(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#define JU_RET_FOUND_LEAF3(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#ifdef JU_64BIT
-#define JU_RET_FOUND_LEAF4(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#define JU_RET_FOUND_LEAF5(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#define JU_RET_FOUND_LEAF6(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#define JU_RET_FOUND_LEAF7(Pjll,POP1,OFFSET)    JU_RET_FOUND
-#endif
-#define JU_RET_FOUND_IMM_01(Pjp)                JU_RET_FOUND
-#define JU_RET_FOUND_IMM(Pjp,OFFSET)            JU_RET_FOUND
-
-// Note:  No JudyL equivalent:
-
-#define JU_RET_FOUND_FULLPOPU1                   JU_RET_FOUND
-#define JU_RET_FOUND_LEAF_B1(PJLB,SUBEXP,OFFSET) JU_RET_FOUND
-
-#else // JUDYL
-
-//      JU_RET_FOUND            // see below; must NOT be defined for JudyL.
-#define JU_RET_NOTFOUND return((PPvoid_t) NULL)
-
-// For JudyL, the location of the value area depends on the JP type and other
-// factors:
-//
-// TBD:  The value areas should be accessed via data structures, here and in
-// Dougs code, not by hard-coded address calculations.
-//
-// This is useful in insert/delete code when the value area is returned from
-// lower levels in the JPM:
-
-#define JU_RET_FOUND_JPM(Pjpm)  return((PPvoid_t) ((Pjpm)->jpm_PValue))
-
-// This is useful in insert/delete code when the value area location is already
-// computed:
-
-#define JU_RET_FOUND_PVALUE(Pjv,OFFSET) return((PPvoid_t) ((Pjv) + OFFSET))
-
-#define JU_RET_FOUND_LEAFW(PJLW,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAFWVALUEAREA(PJLW, POP1) + (OFFSET)))
-
-#define JU_RET_FOUND_LEAF1(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, POP1) + (OFFSET)))
-#define JU_RET_FOUND_LEAF2(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, POP1) + (OFFSET)))
-#define JU_RET_FOUND_LEAF3(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, POP1) + (OFFSET)))
-#ifdef JU_64BIT
-#define JU_RET_FOUND_LEAF4(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, POP1) + (OFFSET)))
-#define JU_RET_FOUND_LEAF5(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, POP1) + (OFFSET)))
-#define JU_RET_FOUND_LEAF6(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, POP1) + (OFFSET)))
-#define JU_RET_FOUND_LEAF7(Pjll,POP1,OFFSET) \
-                return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, POP1) + (OFFSET)))
-#endif
-
-// Note:  Here jp_Addr is a value area itself and not an address, so P_JV() is
-// not needed:
-
-#define JU_RET_FOUND_IMM_01(PJP)  return((PPvoid_t) (&((PJP)->jp_Addr)))
-
-// Note:  Here jp_Addr is a pointer to a separately-mallocd value area, so
-// P_JV() is required; likewise for JL_JLB_PVALUE:
-
-#define JU_RET_FOUND_IMM(PJP,OFFSET) \
-            return((PPvoid_t) (P_JV((PJP)->jp_Addr) + (OFFSET)))
-
-#define JU_RET_FOUND_LEAF_B1(PJLB,SUBEXP,OFFSET) \
-            return((PPvoid_t) (P_JV(JL_JLB_PVALUE(PJLB, SUBEXP)) + (OFFSET)))
-
-#endif // JUDYL
-
-
-// GENERIC ERROR HANDLING:
-//
-// This is complicated by variations in the needs of the callers of these
-// macros.  Only use JU_SET_ERRNO() for PJError, because it can be null; use
-// JU_SET_ERRNO_NONNULL() for Pjpm, which is never null, and also in other
-// cases where the pointer is known not to be null (to save dead branches).
-//
-// Note:  Most cases of JU_ERRNO_OVERRUN or JU_ERRNO_CORRUPT should result in
-// an assertion failure in debug code, so they are more likely to be caught, so
-// do that here in each macro.
-
-#define JU_SET_ERRNO(PJError, JErrno)                   \
-        {                                               \
-            assert((JErrno) != JU_ERRNO_OVERRUN);       \
-            assert((JErrno) != JU_ERRNO_CORRUPT);       \
-                                                        \
-            if (PJError != (PJError_t) NULL)            \
-            {                                           \
-                JU_ERRNO(PJError) = (JErrno);           \
-                JU_ERRID(PJError) = __LINE__;           \
-            }                                           \
-        }
-
-// Variation for callers who know already that PJError is non-null; and, it can
-// also be Pjpm (both PJError_t and Pjpm_t have je_* fields), so only assert it
-// for null, not cast to any specific pointer type:
-
-#define JU_SET_ERRNO_NONNULL(PJError, JErrno)           \
-        {                                               \
-            assert((JErrno) != JU_ERRNO_OVERRUN);       \
-            assert((JErrno) != JU_ERRNO_CORRUPT);       \
-            assert(PJError);                            \
-                                                        \
-            JU_ERRNO(PJError) = (JErrno);               \
-            JU_ERRID(PJError) = __LINE__;               \
-        }
-
-// Variation to copy error info from a (required) JPM to an (optional)
-// PJError_t:
-//
-// Note:  The assertions above about JU_ERRNO_OVERRUN and JU_ERRNO_CORRUPT
-// should have already popped, so they are not needed here.
-
-#define JU_COPY_ERRNO(PJError, Pjpm)                            \
-        {                                                       \
-            if (PJError)                                        \
-            {                                                   \
-                JU_ERRNO(PJError) = (uint8_t)JU_ERRNO(Pjpm);    \
-                JU_ERRID(PJError) = JU_ERRID(Pjpm);             \
-            }                                                   \
-        }
-
-// For JErrno parameter to previous macros upon return from Judy*Alloc*():
-//
-// The memory allocator returns an address of 0 for out of memory,
-// 1..sizeof(Word_t)-1 for corruption (an invalid pointer), otherwise a valid
-// pointer.
-
-#define JU_ALLOC_ERRNO(ADDR) \
-        (((void *) (ADDR) != (void *) NULL) ? JU_ERRNO_OVERRUN : JU_ERRNO_NOMEM)
-
-#define JU_CHECKALLOC(Type,Ptr,Retval)                  \
-        if ((Ptr) < (Type) sizeof(Word_t))              \
-        {                                               \
-            JU_SET_ERRNO(PJError, JU_ALLOC_ERRNO(Ptr)); \
-            return(Retval);                             \
-        }
-
-// Leaf search routines
-
-#ifdef JU_NOINLINE
-
-int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-
-#ifdef JU_64BIT
-
-int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index);
-
-#endif // JU_64BIT
-
-int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index);
-
-#else  // complier support for inline
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNATIVE(uint8_t,  Pjll, LeafPop1, Index); }
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNATIVE(uint16_t, Pjll, LeafPop1, Index); }
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 3, JU_COPY3_PINDEX_TO_LONG); }
-
-#ifdef JU_64BIT
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNATIVE(uint32_t, Pjll, LeafPop1, Index); }
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 5, JU_COPY5_PINDEX_TO_LONG); }
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 6, JU_COPY6_PINDEX_TO_LONG); }
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 7, JU_COPY7_PINDEX_TO_LONG); }
-
-#endif // JU_64BIT
-
-#ifdef JU_WIN
-static __inline int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index)
-#else
-static inline int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index)
-#endif
-{ SEARCHLEAFNATIVE(Word_t, Pjlw, LeafPop1, Index); }
-
-#endif // compiler support for inline
-
-#endif // ! _JUDYPRIVATE_INCLUDED
diff --git a/libs/klib/judy/JudyPrivate1L.h b/libs/klib/judy/JudyPrivate1L.h
deleted file mode 100644
index 5b9591f..0000000
--- a/libs/klib/judy/JudyPrivate1L.h
+++ /dev/null
@@ -1,483 +0,0 @@
-#ifndef _JUDYPRIVATE1L_INCLUDED
-#define	_JUDYPRIVATE1L_INCLUDED
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// ****************************************************************************
-// Declare common cJU_* names for JP Types that occur in both Judy1 and JudyL,
-// for use by code that ifdefs JUDY1 and JUDYL.  Only JP Types common to both
-// Judy1 and JudyL are #defined here with equivalent cJU_* names.  JP Types
-// unique to only Judy1 or JudyL are listed in comments, so the type lists
-// match the Judy1.h and JudyL.h files.
-//
-// This file also defines cJU_* for other JP-related constants and functions
-// that some shared JUDY1/JUDYL code finds handy.
-//
-// At least in principle this file should be included AFTER Judy1.h or JudyL.h.
-//
-// WARNING:  This file must be kept consistent with the enums in Judy1.h and
-// JudyL.h.
-//
-// TBD:  You might think, why not define common cJU_* enums in, say,
-// JudyPrivate.h, and then inherit them into superset enums in Judy1.h and
-// JudyL.h?  The problem is that the enum lists for each class (cJ1_* and
-// cJL_*) must be numerically "packed" into the correct order, for two reasons:
-// (1) allow the compiler to generate "tight" switch statements with no wasted
-// slots (although this is not very big), and (2) allow calculations using the
-// enum values, although this is also not an issue if the calculations are only
-// within each cJ*_JPIMMED_*_* class and the members are packed within the
-// class.
-
-#ifdef JUDY1
-
-#define	cJU_JRPNULL		cJ1_JRPNULL
-#define	cJU_JPNULL1		cJ1_JPNULL1
-#define	cJU_JPNULL2		cJ1_JPNULL2
-#define	cJU_JPNULL3		cJ1_JPNULL3
-#ifdef JU_64BIT
-#define	cJU_JPNULL4		cJ1_JPNULL4
-#define	cJU_JPNULL5		cJ1_JPNULL5
-#define	cJU_JPNULL6		cJ1_JPNULL6
-#define	cJU_JPNULL7		cJ1_JPNULL7
-#endif
-#define	cJU_JPNULLMAX		cJ1_JPNULLMAX
-#define	cJU_JPBRANCH_L2		cJ1_JPBRANCH_L2
-#define	cJU_JPBRANCH_L3		cJ1_JPBRANCH_L3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_L4		cJ1_JPBRANCH_L4
-#define	cJU_JPBRANCH_L5		cJ1_JPBRANCH_L5
-#define	cJU_JPBRANCH_L6		cJ1_JPBRANCH_L6
-#define	cJU_JPBRANCH_L7		cJ1_JPBRANCH_L7
-#endif
-#define	cJU_JPBRANCH_L		cJ1_JPBRANCH_L
-#define	j__U_BranchBJPPopToWords j__1_BranchBJPPopToWords
-#define	cJU_JPBRANCH_B2		cJ1_JPBRANCH_B2
-#define	cJU_JPBRANCH_B3		cJ1_JPBRANCH_B3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_B4		cJ1_JPBRANCH_B4
-#define	cJU_JPBRANCH_B5		cJ1_JPBRANCH_B5
-#define	cJU_JPBRANCH_B6		cJ1_JPBRANCH_B6
-#define	cJU_JPBRANCH_B7		cJ1_JPBRANCH_B7
-#endif
-#define	cJU_JPBRANCH_B		cJ1_JPBRANCH_B
-#define	cJU_JPBRANCH_U2		cJ1_JPBRANCH_U2
-#define	cJU_JPBRANCH_U3		cJ1_JPBRANCH_U3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_U4		cJ1_JPBRANCH_U4
-#define	cJU_JPBRANCH_U5		cJ1_JPBRANCH_U5
-#define	cJU_JPBRANCH_U6		cJ1_JPBRANCH_U6
-#define	cJU_JPBRANCH_U7		cJ1_JPBRANCH_U7
-#endif
-#define	cJU_JPBRANCH_U		cJ1_JPBRANCH_U
-#ifndef JU_64BIT
-#define	cJU_JPLEAF1		cJ1_JPLEAF1
-#endif
-#define	cJU_JPLEAF2		cJ1_JPLEAF2
-#define	cJU_JPLEAF3		cJ1_JPLEAF3
-#ifdef JU_64BIT
-#define	cJU_JPLEAF4		cJ1_JPLEAF4
-#define	cJU_JPLEAF5		cJ1_JPLEAF5
-#define	cJU_JPLEAF6		cJ1_JPLEAF6
-#define	cJU_JPLEAF7		cJ1_JPLEAF7
-#endif
-#define	cJU_JPLEAF_B1		cJ1_JPLEAF_B1
-//				cJ1_JPFULLPOPU1
-#define	cJU_JPIMMED_1_01	cJ1_JPIMMED_1_01
-#define	cJU_JPIMMED_2_01	cJ1_JPIMMED_2_01
-#define	cJU_JPIMMED_3_01	cJ1_JPIMMED_3_01
-#ifdef JU_64BIT
-#define	cJU_JPIMMED_4_01	cJ1_JPIMMED_4_01
-#define	cJU_JPIMMED_5_01	cJ1_JPIMMED_5_01
-#define	cJU_JPIMMED_6_01	cJ1_JPIMMED_6_01
-#define	cJU_JPIMMED_7_01	cJ1_JPIMMED_7_01
-#endif
-#define	cJU_JPIMMED_1_02	cJ1_JPIMMED_1_02
-#define	cJU_JPIMMED_1_03	cJ1_JPIMMED_1_03
-#define	cJU_JPIMMED_1_04	cJ1_JPIMMED_1_04
-#define	cJU_JPIMMED_1_05	cJ1_JPIMMED_1_05
-#define	cJU_JPIMMED_1_06	cJ1_JPIMMED_1_06
-#define	cJU_JPIMMED_1_07	cJ1_JPIMMED_1_07
-#ifdef JU_64BIT
-//				cJ1_JPIMMED_1_08
-//				cJ1_JPIMMED_1_09
-//				cJ1_JPIMMED_1_10
-//				cJ1_JPIMMED_1_11
-//				cJ1_JPIMMED_1_12
-//				cJ1_JPIMMED_1_13
-//				cJ1_JPIMMED_1_14
-//				cJ1_JPIMMED_1_15
-#endif
-#define	cJU_JPIMMED_2_02	cJ1_JPIMMED_2_02
-#define	cJU_JPIMMED_2_03	cJ1_JPIMMED_2_03
-#ifdef JU_64BIT
-//				cJ1_JPIMMED_2_04
-//				cJ1_JPIMMED_2_05
-//				cJ1_JPIMMED_2_06
-//				cJ1_JPIMMED_2_07
-#endif
-#define	cJU_JPIMMED_3_02	cJ1_JPIMMED_3_02
-#ifdef JU_64BIT
-//				cJ1_JPIMMED_3_03
-//				cJ1_JPIMMED_3_04
-//				cJ1_JPIMMED_3_05
-//				cJ1_JPIMMED_4_02
-//				cJ1_JPIMMED_4_03
-//				cJ1_JPIMMED_5_02
-//				cJ1_JPIMMED_5_03
-//				cJ1_JPIMMED_6_02
-//				cJ1_JPIMMED_7_02
-#endif
-#define	cJU_JPIMMED_CAP		cJ1_JPIMMED_CAP
-
-#else // JUDYL ****************************************************************
-
-#define	cJU_JRPNULL		cJL_JRPNULL
-#define	cJU_JPNULL1		cJL_JPNULL1
-#define	cJU_JPNULL2		cJL_JPNULL2
-#define	cJU_JPNULL3		cJL_JPNULL3
-#ifdef JU_64BIT
-#define	cJU_JPNULL4		cJL_JPNULL4
-#define	cJU_JPNULL5		cJL_JPNULL5
-#define	cJU_JPNULL6		cJL_JPNULL6
-#define	cJU_JPNULL7		cJL_JPNULL7
-#endif
-#define	cJU_JPNULLMAX		cJL_JPNULLMAX
-#define	cJU_JPBRANCH_L2		cJL_JPBRANCH_L2
-#define	cJU_JPBRANCH_L3		cJL_JPBRANCH_L3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_L4		cJL_JPBRANCH_L4
-#define	cJU_JPBRANCH_L5		cJL_JPBRANCH_L5
-#define	cJU_JPBRANCH_L6		cJL_JPBRANCH_L6
-#define	cJU_JPBRANCH_L7		cJL_JPBRANCH_L7
-#endif
-#define	cJU_JPBRANCH_L		cJL_JPBRANCH_L
-#define	j__U_BranchBJPPopToWords j__L_BranchBJPPopToWords
-#define	cJU_JPBRANCH_B2		cJL_JPBRANCH_B2
-#define	cJU_JPBRANCH_B3		cJL_JPBRANCH_B3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_B4		cJL_JPBRANCH_B4
-#define	cJU_JPBRANCH_B5		cJL_JPBRANCH_B5
-#define	cJU_JPBRANCH_B6		cJL_JPBRANCH_B6
-#define	cJU_JPBRANCH_B7		cJL_JPBRANCH_B7
-#endif
-#define	cJU_JPBRANCH_B		cJL_JPBRANCH_B
-#define	cJU_JPBRANCH_U2		cJL_JPBRANCH_U2
-#define	cJU_JPBRANCH_U3		cJL_JPBRANCH_U3
-#ifdef JU_64BIT
-#define	cJU_JPBRANCH_U4		cJL_JPBRANCH_U4
-#define	cJU_JPBRANCH_U5		cJL_JPBRANCH_U5
-#define	cJU_JPBRANCH_U6		cJL_JPBRANCH_U6
-#define	cJU_JPBRANCH_U7		cJL_JPBRANCH_U7
-#endif
-#define	cJU_JPBRANCH_U		cJL_JPBRANCH_U
-#define	cJU_JPLEAF1		cJL_JPLEAF1
-#define	cJU_JPLEAF2		cJL_JPLEAF2
-#define	cJU_JPLEAF3		cJL_JPLEAF3
-#ifdef JU_64BIT
-#define	cJU_JPLEAF4		cJL_JPLEAF4
-#define	cJU_JPLEAF5		cJL_JPLEAF5
-#define	cJU_JPLEAF6		cJL_JPLEAF6
-#define	cJU_JPLEAF7		cJL_JPLEAF7
-#endif
-#define	cJU_JPLEAF_B1		cJL_JPLEAF_B1
-#define	cJU_JPIMMED_1_01	cJL_JPIMMED_1_01
-#define	cJU_JPIMMED_2_01	cJL_JPIMMED_2_01
-#define	cJU_JPIMMED_3_01	cJL_JPIMMED_3_01
-#ifdef JU_64BIT
-#define	cJU_JPIMMED_4_01	cJL_JPIMMED_4_01
-#define	cJU_JPIMMED_5_01	cJL_JPIMMED_5_01
-#define	cJU_JPIMMED_6_01	cJL_JPIMMED_6_01
-#define	cJU_JPIMMED_7_01	cJL_JPIMMED_7_01
-#endif
-#define	cJU_JPIMMED_1_02	cJL_JPIMMED_1_02
-#define	cJU_JPIMMED_1_03	cJL_JPIMMED_1_03
-#ifdef JU_64BIT
-#define	cJU_JPIMMED_1_04	cJL_JPIMMED_1_04
-#define	cJU_JPIMMED_1_05	cJL_JPIMMED_1_05
-#define	cJU_JPIMMED_1_06	cJL_JPIMMED_1_06
-#define	cJU_JPIMMED_1_07	cJL_JPIMMED_1_07
-#define	cJU_JPIMMED_2_02	cJL_JPIMMED_2_02
-#define	cJU_JPIMMED_2_03	cJL_JPIMMED_2_03
-#define	cJU_JPIMMED_3_02	cJL_JPIMMED_3_02
-#endif
-#define	cJU_JPIMMED_CAP		cJL_JPIMMED_CAP
-
-#endif // JUDYL
-
-
-// ****************************************************************************
-// cJU*_ other than JP types:
-
-#ifdef JUDY1
-
-#define	cJU_LEAFW_MAXPOP1	cJ1_LEAFW_MAXPOP1
-#ifndef JU_64BIT
-#define	cJU_LEAF1_MAXPOP1	cJ1_LEAF1_MAXPOP1
-#endif
-#define	cJU_LEAF2_MAXPOP1	cJ1_LEAF2_MAXPOP1
-#define	cJU_LEAF3_MAXPOP1	cJ1_LEAF3_MAXPOP1
-#ifdef JU_64BIT
-#define	cJU_LEAF4_MAXPOP1	cJ1_LEAF4_MAXPOP1
-#define	cJU_LEAF5_MAXPOP1	cJ1_LEAF5_MAXPOP1
-#define	cJU_LEAF6_MAXPOP1	cJ1_LEAF6_MAXPOP1
-#define	cJU_LEAF7_MAXPOP1	cJ1_LEAF7_MAXPOP1
-#endif
-#define	cJU_IMMED1_MAXPOP1	cJ1_IMMED1_MAXPOP1
-#define	cJU_IMMED2_MAXPOP1	cJ1_IMMED2_MAXPOP1
-#define	cJU_IMMED3_MAXPOP1	cJ1_IMMED3_MAXPOP1
-#ifdef JU_64BIT
-#define	cJU_IMMED4_MAXPOP1	cJ1_IMMED4_MAXPOP1
-#define	cJU_IMMED5_MAXPOP1	cJ1_IMMED5_MAXPOP1
-#define	cJU_IMMED6_MAXPOP1	cJ1_IMMED6_MAXPOP1
-#define	cJU_IMMED7_MAXPOP1	cJ1_IMMED7_MAXPOP1
-#endif
-
-#define	JU_LEAF1POPTOWORDS(Pop1)	J1_LEAF1POPTOWORDS(Pop1)
-#define	JU_LEAF2POPTOWORDS(Pop1)	J1_LEAF2POPTOWORDS(Pop1)
-#define	JU_LEAF3POPTOWORDS(Pop1)	J1_LEAF3POPTOWORDS(Pop1)
-#ifdef JU_64BIT
-#define	JU_LEAF4POPTOWORDS(Pop1)	J1_LEAF4POPTOWORDS(Pop1)
-#define	JU_LEAF5POPTOWORDS(Pop1)	J1_LEAF5POPTOWORDS(Pop1)
-#define	JU_LEAF6POPTOWORDS(Pop1)	J1_LEAF6POPTOWORDS(Pop1)
-#define	JU_LEAF7POPTOWORDS(Pop1)	J1_LEAF7POPTOWORDS(Pop1)
-#endif
-#define	JU_LEAFWPOPTOWORDS(Pop1)	J1_LEAFWPOPTOWORDS(Pop1)
-
-#ifndef JU_64BIT
-#define	JU_LEAF1GROWINPLACE(Pop1)	J1_LEAF1GROWINPLACE(Pop1)
-#endif
-#define	JU_LEAF2GROWINPLACE(Pop1)	J1_LEAF2GROWINPLACE(Pop1)
-#define	JU_LEAF3GROWINPLACE(Pop1)	J1_LEAF3GROWINPLACE(Pop1)
-#ifdef JU_64BIT
-#define	JU_LEAF4GROWINPLACE(Pop1)	J1_LEAF4GROWINPLACE(Pop1)
-#define	JU_LEAF5GROWINPLACE(Pop1)	J1_LEAF5GROWINPLACE(Pop1)
-#define	JU_LEAF6GROWINPLACE(Pop1)	J1_LEAF6GROWINPLACE(Pop1)
-#define	JU_LEAF7GROWINPLACE(Pop1)	J1_LEAF7GROWINPLACE(Pop1)
-#endif
-#define	JU_LEAFWGROWINPLACE(Pop1)	J1_LEAFWGROWINPLACE(Pop1)
-
-#define	j__udyCreateBranchL	j__udy1CreateBranchL
-#define	j__udyCreateBranchB	j__udy1CreateBranchB
-#define	j__udyCreateBranchU	j__udy1CreateBranchU
-#define	j__udyCascade1		j__udy1Cascade1
-#define	j__udyCascade2		j__udy1Cascade2
-#define	j__udyCascade3		j__udy1Cascade3
-#ifdef JU_64BIT
-#define	j__udyCascade4		j__udy1Cascade4
-#define	j__udyCascade5		j__udy1Cascade5
-#define	j__udyCascade6		j__udy1Cascade6
-#define	j__udyCascade7		j__udy1Cascade7
-#endif
-#define	j__udyCascadeL		j__udy1CascadeL
-#define	j__udyInsertBranch	j__udy1InsertBranch
-
-#define	j__udyBranchBToBranchL	j__udy1BranchBToBranchL
-#ifndef JU_64BIT
-#define	j__udyLeafB1ToLeaf1	j__udy1LeafB1ToLeaf1
-#endif
-#define	j__udyLeaf1ToLeaf2	j__udy1Leaf1ToLeaf2
-#define	j__udyLeaf2ToLeaf3	j__udy1Leaf2ToLeaf3
-#ifndef JU_64BIT
-#define	j__udyLeaf3ToLeafW	j__udy1Leaf3ToLeafW
-#else
-#define	j__udyLeaf3ToLeaf4	j__udy1Leaf3ToLeaf4
-#define	j__udyLeaf4ToLeaf5	j__udy1Leaf4ToLeaf5
-#define	j__udyLeaf5ToLeaf6	j__udy1Leaf5ToLeaf6
-#define	j__udyLeaf6ToLeaf7	j__udy1Leaf6ToLeaf7
-#define	j__udyLeaf7ToLeafW	j__udy1Leaf7ToLeafW
-#endif
-
-#define	jpm_t			j1pm_t
-#define	Pjpm_t			Pj1pm_t
-
-#define	jlb_t			j1lb_t
-#define	Pjlb_t			Pj1lb_t
-
-#define	JU_JLB_BITMAP		J1_JLB_BITMAP
-
-#define	j__udyAllocJPM		j__udy1AllocJ1PM
-#define	j__udyAllocJBL		j__udy1AllocJBL
-#define	j__udyAllocJBB		j__udy1AllocJBB
-#define	j__udyAllocJBBJP	j__udy1AllocJBBJP
-#define	j__udyAllocJBU		j__udy1AllocJBU
-#ifndef JU_64BIT
-#define	j__udyAllocJLL1		j__udy1AllocJLL1
-#endif
-#define	j__udyAllocJLL2		j__udy1AllocJLL2
-#define	j__udyAllocJLL3		j__udy1AllocJLL3
-#ifdef JU_64BIT
-#define	j__udyAllocJLL4		j__udy1AllocJLL4
-#define	j__udyAllocJLL5		j__udy1AllocJLL5
-#define	j__udyAllocJLL6		j__udy1AllocJLL6
-#define	j__udyAllocJLL7		j__udy1AllocJLL7
-#endif
-#define	j__udyAllocJLW		j__udy1AllocJLW
-#define	j__udyAllocJLB1		j__udy1AllocJLB1
-#define	j__udyFreeJPM		j__udy1FreeJ1PM
-#define	j__udyFreeJBL		j__udy1FreeJBL
-#define	j__udyFreeJBB		j__udy1FreeJBB
-#define	j__udyFreeJBBJP		j__udy1FreeJBBJP
-#define	j__udyFreeJBU		j__udy1FreeJBU
-#ifndef JU_64BIT
-#define	j__udyFreeJLL1		j__udy1FreeJLL1
-#endif
-#define	j__udyFreeJLL2		j__udy1FreeJLL2
-#define	j__udyFreeJLL3		j__udy1FreeJLL3
-#ifdef JU_64BIT
-#define	j__udyFreeJLL4		j__udy1FreeJLL4
-#define	j__udyFreeJLL5		j__udy1FreeJLL5
-#define	j__udyFreeJLL6		j__udy1FreeJLL6
-#define	j__udyFreeJLL7		j__udy1FreeJLL7
-#endif
-#define	j__udyFreeJLW		j__udy1FreeJLW
-#define	j__udyFreeJLB1		j__udy1FreeJLB1
-#define	j__udyFreeSM		j__udy1FreeSM
-
-#define	j__uMaxWords		j__u1MaxWords
-
-#ifdef DEBUG
-#define	JudyCheckPop		Judy1CheckPop
-#endif
-
-#else // JUDYL ****************************************************************
-
-#define	cJU_LEAFW_MAXPOP1	cJL_LEAFW_MAXPOP1
-#define	cJU_LEAF1_MAXPOP1	cJL_LEAF1_MAXPOP1
-#define	cJU_LEAF2_MAXPOP1	cJL_LEAF2_MAXPOP1
-#define	cJU_LEAF3_MAXPOP1	cJL_LEAF3_MAXPOP1
-#ifdef JU_64BIT
-#define	cJU_LEAF4_MAXPOP1	cJL_LEAF4_MAXPOP1
-#define	cJU_LEAF5_MAXPOP1	cJL_LEAF5_MAXPOP1
-#define	cJU_LEAF6_MAXPOP1	cJL_LEAF6_MAXPOP1
-#define	cJU_LEAF7_MAXPOP1	cJL_LEAF7_MAXPOP1
-#endif
-#define	cJU_IMMED1_MAXPOP1	cJL_IMMED1_MAXPOP1
-#define	cJU_IMMED2_MAXPOP1	cJL_IMMED2_MAXPOP1
-#define	cJU_IMMED3_MAXPOP1	cJL_IMMED3_MAXPOP1
-#ifdef JU_64BIT
-#define	cJU_IMMED4_MAXPOP1	cJL_IMMED4_MAXPOP1
-#define	cJU_IMMED5_MAXPOP1	cJL_IMMED5_MAXPOP1
-#define	cJU_IMMED6_MAXPOP1	cJL_IMMED6_MAXPOP1
-#define	cJU_IMMED7_MAXPOP1	cJL_IMMED7_MAXPOP1
-#endif
-
-#define	JU_LEAF1POPTOWORDS(Pop1)	JL_LEAF1POPTOWORDS(Pop1)
-#define	JU_LEAF2POPTOWORDS(Pop1)	JL_LEAF2POPTOWORDS(Pop1)
-#define	JU_LEAF3POPTOWORDS(Pop1)	JL_LEAF3POPTOWORDS(Pop1)
-#ifdef JU_64BIT
-#define	JU_LEAF4POPTOWORDS(Pop1)	JL_LEAF4POPTOWORDS(Pop1)
-#define	JU_LEAF5POPTOWORDS(Pop1)	JL_LEAF5POPTOWORDS(Pop1)
-#define	JU_LEAF6POPTOWORDS(Pop1)	JL_LEAF6POPTOWORDS(Pop1)
-#define	JU_LEAF7POPTOWORDS(Pop1)	JL_LEAF7POPTOWORDS(Pop1)
-#endif
-#define	JU_LEAFWPOPTOWORDS(Pop1)	JL_LEAFWPOPTOWORDS(Pop1)
-
-#define	JU_LEAF1GROWINPLACE(Pop1)	JL_LEAF1GROWINPLACE(Pop1)
-#define	JU_LEAF2GROWINPLACE(Pop1)	JL_LEAF2GROWINPLACE(Pop1)
-#define	JU_LEAF3GROWINPLACE(Pop1)	JL_LEAF3GROWINPLACE(Pop1)
-#ifdef JU_64BIT
-#define	JU_LEAF4GROWINPLACE(Pop1)	JL_LEAF4GROWINPLACE(Pop1)
-#define	JU_LEAF5GROWINPLACE(Pop1)	JL_LEAF5GROWINPLACE(Pop1)
-#define	JU_LEAF6GROWINPLACE(Pop1)	JL_LEAF6GROWINPLACE(Pop1)
-#define	JU_LEAF7GROWINPLACE(Pop1)	JL_LEAF7GROWINPLACE(Pop1)
-#endif
-#define	JU_LEAFWGROWINPLACE(Pop1)	JL_LEAFWGROWINPLACE(Pop1)
-
-#define	j__udyCreateBranchL	j__udyLCreateBranchL
-#define	j__udyCreateBranchB	j__udyLCreateBranchB
-#define	j__udyCreateBranchU	j__udyLCreateBranchU
-#define	j__udyCascade1		j__udyLCascade1
-#define	j__udyCascade2		j__udyLCascade2
-#define	j__udyCascade3		j__udyLCascade3
-#ifdef JU_64BIT
-#define	j__udyCascade4		j__udyLCascade4
-#define	j__udyCascade5		j__udyLCascade5
-#define	j__udyCascade6		j__udyLCascade6
-#define	j__udyCascade7		j__udyLCascade7
-#endif
-#define	j__udyCascadeL		j__udyLCascadeL
-#define	j__udyInsertBranch	j__udyLInsertBranch
-
-#define	j__udyBranchBToBranchL	j__udyLBranchBToBranchL
-#define	j__udyLeafB1ToLeaf1	j__udyLLeafB1ToLeaf1
-#define	j__udyLeaf1ToLeaf2	j__udyLLeaf1ToLeaf2
-#define	j__udyLeaf2ToLeaf3	j__udyLLeaf2ToLeaf3
-#ifndef JU_64BIT
-#define	j__udyLeaf3ToLeafW	j__udyLLeaf3ToLeafW
-#else
-#define	j__udyLeaf3ToLeaf4	j__udyLLeaf3ToLeaf4
-#define	j__udyLeaf4ToLeaf5	j__udyLLeaf4ToLeaf5
-#define	j__udyLeaf5ToLeaf6	j__udyLLeaf5ToLeaf6
-#define	j__udyLeaf6ToLeaf7	j__udyLLeaf6ToLeaf7
-#define	j__udyLeaf7ToLeafW	j__udyLLeaf7ToLeafW
-#endif
-
-#define	jpm_t			jLpm_t
-#define	Pjpm_t			PjLpm_t
-
-#define	jlb_t			jLlb_t
-#define	Pjlb_t			PjLlb_t
-
-#define	JU_JLB_BITMAP		JL_JLB_BITMAP
-
-#define	j__udyAllocJPM		j__udyLAllocJLPM
-#define	j__udyAllocJBL		j__udyLAllocJBL
-#define	j__udyAllocJBB		j__udyLAllocJBB
-#define	j__udyAllocJBBJP	j__udyLAllocJBBJP
-#define	j__udyAllocJBU		j__udyLAllocJBU
-#define	j__udyAllocJLL1		j__udyLAllocJLL1
-#define	j__udyAllocJLL2		j__udyLAllocJLL2
-#define	j__udyAllocJLL3		j__udyLAllocJLL3
-#ifdef JU_64BIT
-#define	j__udyAllocJLL4		j__udyLAllocJLL4
-#define	j__udyAllocJLL5		j__udyLAllocJLL5
-#define	j__udyAllocJLL6		j__udyLAllocJLL6
-#define	j__udyAllocJLL7		j__udyLAllocJLL7
-#endif
-#define	j__udyAllocJLW		j__udyLAllocJLW
-#define	j__udyAllocJLB1		j__udyLAllocJLB1
-//				j__udyLAllocJV
-#define	j__udyFreeJPM		j__udyLFreeJLPM
-#define	j__udyFreeJBL		j__udyLFreeJBL
-#define	j__udyFreeJBB		j__udyLFreeJBB
-#define	j__udyFreeJBBJP		j__udyLFreeJBBJP
-#define	j__udyFreeJBU		j__udyLFreeJBU
-#define	j__udyFreeJLL1		j__udyLFreeJLL1
-#define	j__udyFreeJLL2		j__udyLFreeJLL2
-#define	j__udyFreeJLL3		j__udyLFreeJLL3
-#ifdef JU_64BIT
-#define	j__udyFreeJLL4		j__udyLFreeJLL4
-#define	j__udyFreeJLL5		j__udyLFreeJLL5
-#define	j__udyFreeJLL6		j__udyLFreeJLL6
-#define	j__udyFreeJLL7		j__udyLFreeJLL7
-#endif
-#define	j__udyFreeJLW		j__udyLFreeJLW
-#define	j__udyFreeJLB1		j__udyLFreeJLB1
-#define	j__udyFreeSM		j__udyLFreeSM
-//				j__udyLFreeJV
-
-#define	j__uMaxWords		j__uLMaxWords
-
-#ifdef DEBUG
-#define	JudyCheckPop		JudyLCheckPop
-#endif
-
-#endif // JUDYL
-
-#endif // _JUDYPRIVATE1L_INCLUDED
diff --git a/libs/klib/judy/JudyPrivateBranch.h b/libs/klib/judy/JudyPrivateBranch.h
deleted file mode 100644
index 4e0dda4..0000000
--- a/libs/klib/judy/JudyPrivateBranch.h
+++ /dev/null
@@ -1,777 +0,0 @@
-#ifndef _JUDY_PRIVATE_BRANCH_INCLUDED
-#define _JUDY_PRIVATE_BRANCH_INCLUDED
-// _________________
-//
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// Header file for all Judy sources, for global but private (non-exported)
-// declarations specific to branch support.
-//
-// See also the "Judy Shop Manual" (try judy/doc/int/JudyShopManual.*).
-
-
-// ****************************************************************************
-// JUDY POINTER (JP) SUPPORT
-// ****************************************************************************
-//
-// This "rich pointer" object is pivotal to Judy execution.
-//
-// JP CONTAINING OTHER THAN IMMEDIATE INDEXES:
-//
-// If the JP points to a linear or bitmap leaf, jp_DcdPopO contains the
-// Population-1 in LSbs and Decode (Dcd) bytes in the MSBs.  (In practice the
-// Decode bits are masked off while accessing the Pop0 bits.)
-//
-// The Decode Size, the number of Dcd bytes available, is encoded in jpo_Type.
-// It can also be thought of as the number of states "skipped" in the SM, where
-// each state decodes 8 bits = 1 byte.
-//
-// TBD:  Dont need two structures, except possibly to force jp_Type to highest
-// address!
-//
-// Note:  The jpo_u union is not required by HP-UX or Linux but Win32 because
-// the cl.exe compiler otherwise refuses to pack a bitfield (DcdPopO) with
-// anything else, even with the -Zp option.  This is pretty ugly, but
-// fortunately portable, and its all hide-able by macros (see below).
-
-typedef struct J_UDY_POINTER_OTHERS      // JPO.
-        {
-            Word_t      j_po_Addr;       // first word:  Pjp_t, Word_t, etc.
-            union {
-//              Word_t  j_po_DcdPop0:cJU_BITSPERWORD-cJU_BITSPERBYTE;
-                uint8_t j_po_DcdP0[sizeof(Word_t) - 1];
-                uint8_t j_po_Bytes[sizeof(Word_t)];     // last byte = jp_Type.
-            } jpo_u;
-        } jpo_t;
-
-
-// JP CONTAINING IMMEDIATE INDEXES:
-//
-// j_pi_1Index[] plus j_pi_LIndex[] together hold as many N-byte (1..3-byte
-// [1..7-byte]) Indexes as will fit in sizeof(jpi_t) less 1 byte for j_pi_Type
-// (that is, 7..1 [15..1] Indexes).
-//
-// For Judy1, j_pi_1Index[] is used and j_pi_LIndex[] is not used.
-// For JudyL, j_pi_LIndex[] is used and j_pi_1Index[] is not used.
-//
-// Note:  Actually when Pop1 = 1, jpi_t is not used, and the least bytes of the
-// single Index are stored in j_po_DcdPopO, for both Judy1 and JudyL, so for
-// JudyL the j_po_Addr field can hold the target value.
-//
-// TBD:  Revise this structure to not overload j_po_DcdPopO this way?  The
-// current arrangement works, its just confusing.
-
-typedef struct _JUDY_POINTER_IMMED      // JPI.
-        {
-            uint8_t j_pi_1Index[sizeof(Word_t)];        // see above.
-            uint8_t j_pi_LIndex[sizeof(Word_t) - 1];    // see above.
-            uint8_t j_pi_Type;                  // JP type, 1 of cJ*_JPIMMED*.
-        } jpi_t;
-
-
-// UNION OF JP TYPES:
-//
-// A branch is an array of cJU_BRANCHUNUMJPS (256) of this object, or an
-// alternate data type such as:  A linear branch which is a list of 2..7 JPs,
-// or a bitmap branch which contains 8 lists of 0..32 JPs.  JPs reside only in
-// branches of a Judy SM.
-
-typedef union J_UDY_POINTER             // JP.
-        {
-            jpo_t j_po;                 // other than immediate indexes.
-            jpi_t j_pi;                 // immediate indexes.
-        } jp_t, *Pjp_t;
-
-// For coding convenience:
-//
-// Note, jp_Type has the same bits in jpo_t and jpi_t.
-
-#define jp_1Index  j_pi.j_pi_1Index     // for storing Indexes in first  word.
-#define jp_LIndex  j_pi.j_pi_LIndex     // for storing Indexes in second word.
-#define jp_Addr    j_po.j_po_Addr
-//#define       jp_DcdPop0 j_po.jpo_u.j_po_DcdPop0
-#define jp_Type    j_po.jpo_u.j_po_Bytes[sizeof(Word_t) - 1]
-#define jp_DcdP0   j_po.jpo_u.j_po_DcdP0
-
-
-// ****************************************************************************
-// JUDY POINTER (JP) -- RELATED MACROS AND CONSTANTS
-// ****************************************************************************
-
-// EXTRACT VALUES FROM JP:
-//
-// Masks for the bytes in the Dcd and Pop0 parts of jp_DcdPopO:
-//
-// cJU_DCDMASK() consists of a mask that excludes the (LSb) Pop0 bytes and
-// also, just to be safe, the top byte of the word, since jp_DcdPopO is 1 byte
-// less than a full word.
-//
-// Note:  These are constant macros (cJU) because cPopBytes should be a
-// constant.  Also note cPopBytes == state in the SM.
-
-#define cJU_POP0MASK(cPopBytes) JU_LEASTBYTESMASK(cPopBytes)
-
-#define cJU_DCDMASK(cPopBytes) \
-        ((cJU_ALLONES >> cJU_BITSPERBYTE) & (~cJU_POP0MASK(cPopBytes)))
-
-// Mask off the high byte from INDEX to it can be compared to DcdPopO:
-
-#define JU_TRIMTODCDSIZE(INDEX) ((cJU_ALLONES >> cJU_BITSPERBYTE) & (INDEX))
-
-// Get from jp_DcdPopO the Pop0 for various branch JP Types:
-//
-// Note:  There are no simple macros for cJU_BRANCH* Types because their
-// populations must be added up and dont reside in an already-calculated
-// place.
-
-#define JU_JPBRANCH_POP0(PJP,cPopBytes) \
-        (JU_JPDCDPOP0(PJP) & cJU_POP0MASK(cPopBytes))
-
-// METHOD FOR DETERMINING IF OBJECTS HAVE ROOM TO GROW:
-//
-// J__U_GROWCK() is a generic method to determine if an object can grow in
-// place, based on whether the next population size (one more) would use the
-// same space.
-
-#define J__U_GROWCK(POP1,MAXPOP1,POPTOWORDS) \
-        (((POP1) != (MAXPOP1)) && (POPTOWORDS[POP1] == POPTOWORDS[(POP1) + 1]))
-
-#define JU_BRANCHBJPGROWINPLACE(NumJPs) \
-        J__U_GROWCK(NumJPs, cJU_BITSPERSUBEXPB, j__U_BranchBJPPopToWords)
-
-
-// DETERMINE IF AN INDEX IS (NOT) IN A JPS EXPANSE:
-
-#define JU_DCDNOTMATCHINDEX(INDEX,PJP,POP0BYTES) \
-        (((INDEX) ^ JU_JPDCDPOP0(PJP)) & cJU_DCDMASK(POP0BYTES))
-
-
-// NUMBER OF JPs IN AN UNCOMPRESSED BRANCH:
-//
-// An uncompressed branch is simply an array of 256 Judy Pointers (JPs).  It is
-// a minimum cacheline fill object.  Define it here before its first needed.
-
-#define cJU_BRANCHUNUMJPS  cJU_SUBEXPPERSTATE
-
-
-// ****************************************************************************
-// JUDY BRANCH LINEAR (JBL) SUPPORT
-// ****************************************************************************
-//
-// A linear branch is a way of compressing empty expanses (null JPs) out of an
-// uncompressed 256-way branch, when the number of populated expanses is so
-// small that even a bitmap branch is excessive.
-//
-// The maximum number of JPs in a Judy linear branch:
-//
-// Note:  This number results in a 1-cacheline sized structure.  Previous
-// versions had a larger struct so a linear branch didnt become a bitmap
-// branch until the memory consumed was even, but for speed, its better to
-// switch "sooner" and keep a linear branch fast.
-
-#define cJU_BRANCHLMAXJPS 7
-
-
-// LINEAR BRANCH STRUCT:
-//
-// 1-byte count, followed by array of byte-sized expanses, followed by JPs.
-
-typedef struct J__UDY_BRANCH_LINEAR
-        {
-            uint8_t jbl_NumJPs;                     // num of JPs (Pjp_t), 1..N.
-            uint8_t jbl_Expanse[cJU_BRANCHLMAXJPS]; // 1..7 MSbs of pop exps.
-            jp_t    jbl_jp     [cJU_BRANCHLMAXJPS]; // JPs for populated exps.
-        } jbl_t, * Pjbl_t;
-
-
-// ****************************************************************************
-// JUDY BRANCH BITMAP (JBB) SUPPORT
-// ****************************************************************************
-//
-// A bitmap branch is a way of compressing empty expanses (null JPs) out of
-// uncompressed 256-way branch.  This costs 1 additional cache line fill, but
-// can save a lot of memory when it matters most, near the leaves, and
-// typically there will be only one at most in the path to any Index (leaf).
-//
-// The bitmap indicates which of the cJU_BRANCHUNUMJPS (256) JPs in the branch
-// are NOT null, that is, their expanses are populated.  The jbb_t also
-// contains N pointers to "mini" Judy branches ("subexpanses") of up to M JPs
-// each (see BITMAP_BRANCHMxN, for example, BITMAP_BRANCH32x8), where M x N =
-// cJU_BRANCHUNUMJPS.  These are dynamically allocated and never contain
-// cJ*_JPNULL* jp_Types.  An empty subexpanse is represented by no bit sets in
-// the corresponding subexpanse bitmap, in which case the corresponding
-// jbbs_Pjp pointers value is unused.
-//
-// Note that the number of valid JPs in each 1-of-N subexpanses is determined
-// by POPULATION rather than by EXPANSE -- the desired outcome to save memory
-// when near the leaves.  Note that the memory required for 185 JPs is about as
-// much as an uncompressed 256-way branch, therefore 184 is set as the maximum.
-// However, it is expected that a conversion to an uncompressed 256-way branch
-// will normally take place before this limit is reached for other reasons,
-// such as improving performance when the "wasted" memory is well amortized by
-// the population under the branch, preserving an acceptable overall
-// bytes/Index in the Judy array.
-//
-// The number of pointers to arrays of JPs in the Judy bitmap branch:
-//
-// Note:  The numbers below are the same in both 32 and 64 bit systems.
-
-#define cJU_BRANCHBMAXJPS  184          // maximum JPs for bitmap branches.
-
-// Convenience wrappers for referencing BranchB bitmaps or JP subarray
-// pointers:
-//
-// Note:  JU_JBB_PJP produces a "raw" memory address that must pass through
-// P_JP before use, except when freeing memory:
-
-#define JU_JBB_BITMAP(Pjbb, SubExp)  ((Pjbb)->jbb_jbbs[SubExp].jbbs_Bitmap)
-#define JU_JBB_PJP(   Pjbb, SubExp)  ((Pjbb)->jbb_jbbs[SubExp].jbbs_Pjp)
-
-#define JU_SUBEXPB(Digit) (((Digit) / cJU_BITSPERSUBEXPB) & (cJU_NUMSUBEXPB-1))
-
-#define JU_BITMAPTESTB(Pjbb, Index) \
-        (JU_JBB_BITMAP(Pjbb, JU_SUBEXPB(Index)) &  JU_BITPOSMASKB(Index))
-
-#define JU_BITMAPSETB(Pjbb, Index)  \
-        (JU_JBB_BITMAP(Pjbb, JU_SUBEXPB(Index)) |= JU_BITPOSMASKB(Index))
-
-// Note:  JU_BITMAPCLEARB is not defined because the code does it a faster way.
-
-typedef struct J__UDY_BRANCH_BITMAP_SUBEXPANSE
-        {
-            BITMAPB_t jbbs_Bitmap;
-            Pjp_t     jbbs_Pjp;
-
-        } jbbs_t;
-
-typedef struct J__UDY_BRANCH_BITMAP
-        {
-            jbbs_t jbb_jbbs   [cJU_NUMSUBEXPB];
-#ifdef SUBEXPCOUNTS
-            Word_t jbb_subPop1[cJU_NUMSUBEXPB];
-#endif
-        } jbb_t, * Pjbb_t;
-
-#define JU_BRANCHJP_NUMJPSTOWORDS(NumJPs) (j__U_BranchBJPPopToWords[NumJPs])
-
-#ifdef SUBEXPCOUNTS
-#define cJU_NUMSUBEXPU  16      // number of subexpanse counts.
-#endif
-
-
-// ****************************************************************************
-// JUDY BRANCH UNCOMPRESSED (JBU) SUPPORT
-// ****************************************************************************
-
-// Convenience wrapper for referencing BranchU JPs:
-//
-// Note:  This produces a non-"raw" address already passed through P_JBU().
-
-#define JU_JBU_PJP(Pjp,Index,Level) \
-        (&((P_JBU((Pjp)->jp_Addr))->jbu_jp[JU_DIGITATSTATE(Index, Level)]))
-#define JU_JBU_PJP0(Pjp) \
-        (&((P_JBU((Pjp)->jp_Addr))->jbu_jp[0]))
-
-typedef struct J__UDY_BRANCH_UNCOMPRESSED
-        {
-            jp_t   jbu_jp     [cJU_BRANCHUNUMJPS];  // JPs for populated exp.
-#ifdef SUBEXPCOUNTS
-            Word_t jbu_subPop1[cJU_NUMSUBEXPU];
-#endif
-        } jbu_t, * Pjbu_t;
-
-
-// ****************************************************************************
-// OTHER SUPPORT FOR JUDY STATE MACHINES (SMs)
-// ****************************************************************************
-
-// OBJECT SIZES IN WORDS:
-//
-// Word_ts per various JudyL structures that have constant sizes.
-// cJU_WORDSPERJP should always be 2; this is fundamental to the Judy
-// structures.
-
-#define cJU_WORDSPERJP (sizeof(jp_t)   / cJU_BYTESPERWORD)
-#define cJU_WORDSPERCL (cJU_BYTESPERCL / cJU_BYTESPERWORD)
-
-
-// OPPORTUNISTIC UNCOMPRESSION:
-//
-// Define populations at which a BranchL or BranchB must convert to BranchU.
-// Earlier conversion is possible with good memory efficiency -- see below.
-
-#ifndef NO_BRANCHU
-
-// Max population below BranchL, then convert to BranchU:
-
-#define JU_BRANCHL_MAX_POP      1000
-
-// Minimum global population increment before next conversion of a BranchB to a
-// BranchU:
-//
-// This is was done to allow malloc() to coalesce memory before the next big
-// (~512 words) allocation.
-
-#define JU_BTOU_POP_INCREMENT    300
-
-// Min/max population below BranchB, then convert to BranchU:
-
-#define JU_BRANCHB_MIN_POP       135
-#define JU_BRANCHB_MAX_POP       750
-
-#else // NO_BRANCHU
-
-// These are set up to have conservative conversion schedules to BranchU:
-
-#define JU_BRANCHL_MAX_POP      (-1UL)
-#define JU_BTOU_POP_INCREMENT      300
-#define JU_BRANCHB_MIN_POP        1000
-#define JU_BRANCHB_MAX_POP      (-1UL)
-
-#endif // NO_BRANCHU
-
-
-// MISCELLANEOUS MACROS:
-
-// Get N most significant bits from the shifted Index word:
-//
-// As Index words are decoded, they are shifted left so only relevant,
-// undecoded Index bits remain.
-
-#define JU_BITSFROMSFTIDX(SFTIDX, N)  ((SFTIDX) >> (cJU_BITSPERWORD - (N)))
-
-// TBD:  I have my doubts about the necessity of these macros (dlb):
-
-// Produce 1-digit mask at specified state:
-
-#define cJU_MASKATSTATE(State)  ((Word_t)0xff << (((State) - 1) * cJU_BITSPERBYTE))
-
-// Get byte (digit) from Index at the specified state, right justified:
-//
-// Note:  State must be 1..cJU_ROOTSTATE, and Digits must be 1..(cJU_ROOTSTATE
-// - 1), but theres no way to assert these within an expression.
-
-#define JU_DIGITATSTATE(Index,cState) \
-         ((uint8_t)((Index) >> (((cState) - 1) * cJU_BITSPERBYTE)))
-
-// Similarly, place byte (digit) at correct position for the specified state:
-//
-// Note:  Cast digit to a Word_t first so there are no complaints or problems
-// about shifting it more than 32 bits on a 64-bit system, say, when it is a
-// uint8_t from jbl_Expanse[].  (Believe it or not, the C standard says to
-// promote an unsigned char to a signed int; -Ac does not do this, but -Ae
-// does.)
-//
-// Also, to make lint happy, cast the whole result again because apparently
-// shifting a Word_t does not result in a Word_t!
-
-#define JU_DIGITTOSTATE(Digit,cState) \
-        ((Word_t) (((Word_t) (Digit)) << (((cState) - 1) * cJU_BITSPERBYTE)))
-
-#endif // ! _JUDY_PRIVATE_BRANCH_INCLUDED
-
-
-#ifdef TEST_INSDEL
-
-// ****************************************************************************
-// TEST CODE FOR INSERT/DELETE MACROS
-// ****************************************************************************
-//
-// To use this, compile a temporary *.c file containing:
-//
-//      #define DEBUG
-//      #define JUDY_ASSERT
-//      #define TEST_INSDEL
-//      #include "JudyPrivate.h"
-//      #include "JudyPrivateBranch.h"
-//
-// Use a command like this:  cc -Ae +DD64 -I. -I JudyCommon -o t t.c
-// For best results, include +DD64 on a 64-bit system.
-//
-// This test code exercises some tricky macros, but the output must be studied
-// manually to verify it.  Assume that for even-index testing, whole words
-// (Word_t) suffices.
-
-#include <stdio.h>
-
-#define INDEXES 3               // in each array.
-
-
-// ****************************************************************************
-// I N I T
-//
-// Set up variables for next test.  See usage.
-
-FUNCTION void Init (
-        int       base,
-        PWord_t   PeIndex,
-        PWord_t   PoIndex,
-        PWord_t   Peleaf,       // always whole words.
-#ifndef JU_64BIT
-        uint8_t * Poleaf3)
-#else
-        uint8_t * Poleaf3,
-        uint8_t * Poleaf5,
-        uint8_t * Poleaf6,
-        uint8_t * Poleaf7)
-#endif
-{
-        int offset;
-
-        *PeIndex = 99;
-
-        for (offset = 0; offset <= INDEXES; ++offset)
-            Peleaf[offset] = base + offset;
-
-        for (offset = 0; offset < (INDEXES + 1) * 3; ++offset)
-            Poleaf3[offset] = base + offset;
-
-#ifndef JU_64BIT
-        *PoIndex = (91 << 24) | (92 << 16) | (93 << 8) | 94;
-#else
-
-        *PoIndex = (91L << 56) | (92L << 48) | (93L << 40) | (94L << 32)
-                 | (95L << 24) | (96L << 16) | (97L <<  8) |  98L;
-
-        for (offset = 0; offset < (INDEXES + 1) * 5; ++offset)
-            Poleaf5[offset] = base + offset;
-
-        for (offset = 0; offset < (INDEXES + 1) * 6; ++offset)
-            Poleaf6[offset] = base + offset;
-
-        for (offset = 0; offset < (INDEXES + 1) * 7; ++offset)
-            Poleaf7[offset] = base + offset;
-#endif
-
-} // Init()
-
-
-// ****************************************************************************
-// P R I N T   L E A F
-//
-// Print the byte values in a leaf.
-
-FUNCTION void PrintLeaf (
-        char *    Label,        // for output.
-        int       IOffset,      // insertion offset in array.
-        int       Indsize,      // index size in bytes.
-        uint8_t * PLeaf)        // array of Index bytes.
-{
-        int       offset;       // in PLeaf.
-        int       byte;         // in one word.
-
-        (void) printf("%s %u: ", Label, IOffset);
-
-        for (offset = 0; offset <= INDEXES; ++offset)
-        {
-            for (byte = 0; byte < Indsize; ++byte)
-                (void) printf("%2d", PLeaf[(offset * Indsize) + byte]);
-
-            (void) printf(" ");
-        }
-
-        (void) printf("\n");
-
-} // PrintLeaf()
-
-
-// ****************************************************************************
-// M A I N
-//
-// Test program.
-
-FUNCTION main()
-{
-        Word_t  eIndex;                         // even, to insert.
-        Word_t  oIndex;                         // odd,  to insert.
-        Word_t  eleaf [ INDEXES + 1];           // even leaf, index size 4.
-        uint8_t oleaf3[(INDEXES + 1) * 3];      // odd leaf,  index size 3.
-#ifdef JU_64BIT
-        uint8_t oleaf5[(INDEXES + 1) * 5];      // odd leaf,  index size 5.
-        uint8_t oleaf6[(INDEXES + 1) * 6];      // odd leaf,  index size 6.
-        uint8_t oleaf7[(INDEXES + 1) * 7];      // odd leaf,  index size 7.
-#endif
-        Word_t  eleaf_2 [ INDEXES + 1];         // same, but second arrays:
-        uint8_t oleaf3_2[(INDEXES + 1) * 3];
-#ifdef JU_64BIT
-        uint8_t oleaf5_2[(INDEXES + 1) * 5];
-        uint8_t oleaf6_2[(INDEXES + 1) * 6];
-        uint8_t oleaf7_2[(INDEXES + 1) * 7];
-#endif
-        int     ioffset;                // index insertion offset.
-
-#ifndef JU_64BIT
-#define INIT        Init( 0, & eIndex, & oIndex, eleaf,   oleaf3)
-#define INIT2 INIT; Init(50, & eIndex, & oIndex, eleaf_2, oleaf3_2)
-#else
-#define INIT        Init( 0, & eIndex, & oIndex, eleaf,   oleaf3, \
-                         oleaf5,   oleaf6,   oleaf7)
-#define INIT2 INIT; Init(50, & eIndex, & oIndex, eleaf_2, oleaf3_2, \
-                         oleaf5_2, oleaf6_2, oleaf7_2)
-#endif
-
-#define WSIZE sizeof (Word_t)           // shorthand.
-
-#ifdef PRINTALL                 // to turn on "noisy" printouts.
-#define PRINTLEAF(Label,IOffset,Indsize,PLeaf) \
-        PrintLeaf(Label,IOffset,Indsize,PLeaf)
-#else
-#define PRINTLEAF(Label,IOffset,Indsize,PLeaf)  \
-        if (ioffset == 0)                       \
-        PrintLeaf(Label,IOffset,Indsize,PLeaf)
-#endif
-
-        (void) printf(
-"In each case, tests operate on an initial array of %d indexes.  Even-index\n"
-"tests set index values to 0,1,2...; odd-index tests set byte values to\n"
-"0,1,2...  Inserted indexes have a value of 99 or else byte values 91,92,...\n",
-                        INDEXES);
-
-        (void) puts("\nJU_INSERTINPLACE():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, WSIZE, (uint8_t *) eleaf);
-            JU_INSERTINPLACE(eleaf, INDEXES, ioffset, eIndex);
-            PrintLeaf("After ", ioffset, WSIZE, (uint8_t *) eleaf);
-        }
-
-        (void) puts("\nJU_INSERTINPLACE3():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 3, oleaf3);
-            JU_INSERTINPLACE3(oleaf3, INDEXES, ioffset, oIndex);
-            PrintLeaf("After ", ioffset, 3, oleaf3);
-        }
-
-#ifdef JU_64BIT
-        (void) puts("\nJU_INSERTINPLACE5():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 5, oleaf5);
-            JU_INSERTINPLACE5(oleaf5, INDEXES, ioffset, oIndex);
-            PrintLeaf("After ", ioffset, 5, oleaf5);
-        }
-
-        (void) puts("\nJU_INSERTINPLACE6():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 6, oleaf6);
-            JU_INSERTINPLACE6(oleaf6, INDEXES, ioffset, oIndex);
-            PrintLeaf("After ", ioffset, 6, oleaf6);
-        }
-
-        (void) puts("\nJU_INSERTINPLACE7():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 7, oleaf7);
-            JU_INSERTINPLACE7(oleaf7, INDEXES, ioffset, oIndex);
-            PrintLeaf("After ", ioffset, 7, oleaf7);
-        }
-#endif // JU_64BIT
-
-        (void) puts("\nJU_DELETEINPLACE():");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, WSIZE, (uint8_t *) eleaf);
-            JU_DELETEINPLACE(eleaf, INDEXES, ioffset);
-            PrintLeaf("After ", ioffset, WSIZE, (uint8_t *) eleaf);
-        }
-
-        (void) puts("\nJU_DELETEINPLACE_ODD(3):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 3, oleaf3);
-            JU_DELETEINPLACE_ODD(oleaf3, INDEXES, ioffset, 3);
-            PrintLeaf("After ", ioffset, 3, oleaf3);
-        }
-
-#ifdef JU_64BIT
-        (void) puts("\nJU_DELETEINPLACE_ODD(5):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 5, oleaf5);
-            JU_DELETEINPLACE_ODD(oleaf5, INDEXES, ioffset, 5);
-            PrintLeaf("After ", ioffset, 5, oleaf5);
-        }
-
-        (void) puts("\nJU_DELETEINPLACE_ODD(6):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 6, oleaf6);
-            JU_DELETEINPLACE_ODD(oleaf6, INDEXES, ioffset, 6);
-            PrintLeaf("After ", ioffset, 6, oleaf6);
-        }
-
-        (void) puts("\nJU_DELETEINPLACE_ODD(7):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT;
-            PRINTLEAF("Before", ioffset, 7, oleaf7);
-            JU_DELETEINPLACE_ODD(oleaf7, INDEXES, ioffset, 7);
-            PrintLeaf("After ", ioffset, 7, oleaf7);
-        }
-#endif // JU_64BIT
-
-        (void) puts("\nJU_INSERTCOPY():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, WSIZE, (uint8_t *) eleaf);
-            PRINTLEAF("Before, dest", ioffset, WSIZE, (uint8_t *) eleaf_2);
-            JU_INSERTCOPY(eleaf_2, eleaf, INDEXES, ioffset, eIndex);
-            PRINTLEAF("After,  src ", ioffset, WSIZE, (uint8_t *) eleaf);
-            PrintLeaf("After,  dest", ioffset, WSIZE, (uint8_t *) eleaf_2);
-        }
-
-        (void) puts("\nJU_INSERTCOPY3():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 3, oleaf3);
-            PRINTLEAF("Before, dest", ioffset, 3, oleaf3_2);
-            JU_INSERTCOPY3(oleaf3_2, oleaf3, INDEXES, ioffset, oIndex);
-            PRINTLEAF("After,  src ", ioffset, 3, oleaf3);
-            PrintLeaf("After,  dest", ioffset, 3, oleaf3_2);
-        }
-
-#ifdef JU_64BIT
-        (void) puts("\nJU_INSERTCOPY5():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 5, oleaf5);
-            PRINTLEAF("Before, dest", ioffset, 5, oleaf5_2);
-            JU_INSERTCOPY5(oleaf5_2, oleaf5, INDEXES, ioffset, oIndex);
-            PRINTLEAF("After,  src ", ioffset, 5, oleaf5);
-            PrintLeaf("After,  dest", ioffset, 5, oleaf5_2);
-        }
-
-        (void) puts("\nJU_INSERTCOPY6():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 6, oleaf6);
-            PRINTLEAF("Before, dest", ioffset, 6, oleaf6_2);
-            JU_INSERTCOPY6(oleaf6_2, oleaf6, INDEXES, ioffset, oIndex);
-            PRINTLEAF("After,  src ", ioffset, 6, oleaf6);
-            PrintLeaf("After,  dest", ioffset, 6, oleaf6_2);
-        }
-
-        (void) puts("\nJU_INSERTCOPY7():");
-
-        for (ioffset = 0; ioffset <= INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 7, oleaf7);
-            PRINTLEAF("Before, dest", ioffset, 7, oleaf7_2);
-            JU_INSERTCOPY7(oleaf7_2, oleaf7, INDEXES, ioffset, oIndex);
-            PRINTLEAF("After,  src ", ioffset, 7, oleaf7);
-            PrintLeaf("After,  dest", ioffset, 7, oleaf7_2);
-        }
-#endif // JU_64BIT
-
-        (void) puts("\nJU_DELETECOPY():");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, WSIZE, (uint8_t *) eleaf);
-            PRINTLEAF("Before, dest", ioffset, WSIZE, (uint8_t *) eleaf_2);
-            JU_DELETECOPY(eleaf_2, eleaf, INDEXES, ioffset, ignore);
-            PRINTLEAF("After,  src ", ioffset, WSIZE, (uint8_t *) eleaf);
-            PrintLeaf("After,  dest", ioffset, WSIZE, (uint8_t *) eleaf_2);
-        }
-
-        (void) puts("\nJU_DELETECOPY_ODD(3):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 3, oleaf3);
-            PRINTLEAF("Before, dest", ioffset, 3, oleaf3_2);
-            JU_DELETECOPY_ODD(oleaf3_2, oleaf3, INDEXES, ioffset, 3);
-            PRINTLEAF("After,  src ", ioffset, 3, oleaf3);
-            PrintLeaf("After,  dest", ioffset, 3, oleaf3_2);
-        }
-
-#ifdef JU_64BIT
-        (void) puts("\nJU_DELETECOPY_ODD(5):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 5, oleaf5);
-            PRINTLEAF("Before, dest", ioffset, 5, oleaf5_2);
-            JU_DELETECOPY_ODD(oleaf5_2, oleaf5, INDEXES, ioffset, 5);
-            PRINTLEAF("After,  src ", ioffset, 5, oleaf5);
-            PrintLeaf("After,  dest", ioffset, 5, oleaf5_2);
-        }
-
-        (void) puts("\nJU_DELETECOPY_ODD(6):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 6, oleaf6);
-            PRINTLEAF("Before, dest", ioffset, 6, oleaf6_2);
-            JU_DELETECOPY_ODD(oleaf6_2, oleaf6, INDEXES, ioffset, 6);
-            PRINTLEAF("After,  src ", ioffset, 6, oleaf6);
-            PrintLeaf("After,  dest", ioffset, 6, oleaf6_2);
-        }
-
-        (void) puts("\nJU_DELETECOPY_ODD(7):");
-
-        for (ioffset = 0; ioffset < INDEXES; ++ioffset)
-        {
-            INIT2;
-            PRINTLEAF("Before, src ", ioffset, 7, oleaf7);
-            PRINTLEAF("Before, dest", ioffset, 7, oleaf7_2);
-            JU_DELETECOPY_ODD(oleaf7_2, oleaf7, INDEXES, ioffset, 7);
-            PRINTLEAF("After,  src ", ioffset, 7, oleaf7);
-            PrintLeaf("After,  dest", ioffset, 7, oleaf7_2);
-        }
-#endif // JU_64BIT
-
-        return(0);
-
-} // main()
-
-#endif // TEST_INSDEL
diff --git a/libs/klib/judy/JudySL.c b/libs/klib/judy/JudySL.c
deleted file mode 100644
index 637782d..0000000
--- a/libs/klib/judy/JudySL.c
+++ /dev/null
@@ -1,1125 +0,0 @@
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-// JUDY FUNCTIONS FOR STRING INDEXES, where associated values are longs.  One
-// JudySL*() corresponds to each JudyL*() function (with exceptions).
-//
-// See the manual entry for details.
-//
-// METHOD:  Break up each null-terminated Index (string) into chunks of W
-// bytes, where W is the machines word size, with null-padding in the last
-// word if necessary.  Store strings as a tree of JudyL arrays, that is, array
-// of array of array...  where each level consumes W bytes (one word) as an
-// index to the JudyL array at that level.  Since strings can begin on
-// arbitrary byte boundaries, copy each chunk of W bytes from Index into a
-// word-aligned object before using it as a Judy index.
-//
-// The JudySL tree also supports "single-index shortcut leaves".  A simple
-// JudySL array (tree of JudyL arrays) would go as many levels deep as the
-// Index (string) is long, which wastes time and memory when an Index is unique
-// beyond a certain point.  When theres just one Index under a pointer, given
-// a reliable way to tell that the pointer is not a root pointer to another
-// JudyL array, it should save a lot of time to instead point to a "leaf"
-// object, similar to leaves in JudyL arrays.
-//
-// TBD:  Multi-index leaves, like those in JudyL, are also worth considering,
-// but their payback for JudySL is less certain.  Likewise, shortcut branches
-// are worth considering too.
-//
-// This code uses the Judy.h definitions and Doug Baskins convention of a "P"
-// prefix for pointers, except no "P" for the first level of char * (strings).
-
-// IMPORTS:
-
-#include <string.h>                     // for strcmp(), strlen(), strcpy()
-#include <Judy.h>
-
-#ifndef NDEDUG
-#define NDEBUG 1
-#endif
-#include <assert.h>
-
-//=======================================================================
-// Compile:
-//
-//    cc -O JudyHS.c -c
-//
-//    Notes:
-//    1) use -DJU_64BIT for 64 bit compiles (HP, Sun, IPF, Motorola/IBM? etc..)
-//    2) In gcc version 3.3.1 for a Centrino, -O2 is faster than -O
-//    3) In gcc version 3.3.2 for a Centrino, -O3 is faster than -O2
-//=======================================================================
-
-#define JU_SET_ERRNO(PJERROR, JERRNO)           \
-{                                               \
-    if (PJERROR != (PJError_t)NULL)             \
-    {                                           \
-        JU_ERRNO(PJERROR) = (JERRNO);           \
-        JU_ERRID(PJERROR) = __LINE__;           \
-    }                                           \
-}
-
-#define JU_SET_ERRNO_NONNULL(PJERROR, JERRNO)   \
-{                                               \
-    JU_ERRNO(PJERROR) = (JERRNO);               \
-    JU_ERRID(PJERROR) = __LINE__;               \
-}
-
-// SUPPORT FOR HANDLING WORDS:
-
-#define WORDSIZE     (sizeof (Word_t))  // bytes in word = JudyL index.
-#define WORDS(BYTES) (((BYTES) + WORDSIZE - 1) / WORDSIZE)      // round up.
-
-// To mark a pointer is to a "short cut leaf", set least bit
-
-#define IS_PSCL(PSCL)     (((Word_t) (PSCL)) & JLAP_INVALID)
-#define CLEAR_PSCL(PSCL)  ((Pscl_t)(((Word_t) (PSCL)) & (~JLAP_INVALID)))
-#define SET_PSCL(PSCL)    (((Word_t) (PSCL)) | JLAP_INVALID)
-
-// MISCELLANEOUS GLOBALS:
-
-// Get the Index (string) length in bytes, including the trailing \0, which
-// is an integral part of the string:
-
-// A string is "in the last word" if a previously-set byte count is at or below
-// the system word size, or in some cases if the last byte in the (null-padded)
-// word is null (assume big-endian, including in a register on a little-endian
-// machine):
-
-#define LASTWORD_BY_VALUE(WORD) (! ((WORD) & 0xffL))
-
-#ifdef JU_64BIT
-
-// copy from 1..7 bytes from string to Word_t and test if \0 bytes
-//
-#define        COPYSTRINGtoWORD(WORD,STR)               \
-{                                                       \
-    do                                                  \
-    {                                                   \
-        uint8_t chr;                                    \
-        WORD =      (Word_t)(STR)[0] << 56;             \
-        if (!(WORD)) break;                             \
-        if (!(chr  = (STR)[1])) break;                  \
-        WORD += ((Word_t)(chr) << 48);                  \
-        if (!(chr  = (STR)[2])) break;                  \
-        WORD += ((Word_t)(chr) << 40);                  \
-        if (!(chr  = (STR)[3])) break;                  \
-        WORD += ((Word_t)(chr) << 32);                  \
-        if (!(chr  = (STR)[4])) break;                  \
-        WORD += ((Word_t)(chr) << 24);                  \
-        if (!(chr  = (STR)[5])) break;                  \
-        WORD += ((Word_t)(chr) << 16);                  \
-        if (!(chr  = (STR)[6])) break;                  \
-        WORD += ((Word_t)(chr) << 8) + (STR)[7];        \
-    } while(0);                                         \
-}
-
-// copy Word_t from 1..8 bytes to string and test of \0 bytes
-//
-#define         COPYWORDtoSTRING(STR,WORD)                      \
-{                                                               \
-    do                                                          \
-    {                                                           \
-        if (!((STR)[0] = (uint8_t)((WORD) >> 56))) break;       \
-        if (!((STR)[1] = (uint8_t)((WORD) >> 48))) break;       \
-        if (!((STR)[2] = (uint8_t)((WORD) >> 40))) break;       \
-        if (!((STR)[3] = (uint8_t)((WORD) >> 32))) break;       \
-        if (!((STR)[4] = (uint8_t)((WORD) >> 24))) break;       \
-        if (!((STR)[5] = (uint8_t)((WORD) >> 16))) break;       \
-        if (!((STR)[6] = (uint8_t)((WORD) >>  8))) break;       \
-        (STR)[7]       = (uint8_t)(WORD);                       \
-    } while(0);                                                 \
-}
-
-#else  // JU_32BIT
-
-// copy from 1..4 bytes from string to Word_t and test if \0 bytes
-
-#define        COPYSTRINGtoWORD(WORD,STR)               \
-{                                                       \
-    do                                                  \
-    {                                                   \
-        uint8_t chr;                                    \
-        WORD =       (STR)[0] << 24;                    \
-        if (WORD == 0) break;                           \
-        if (!(chr  = (STR)[1])) break;                  \
-        WORD += (Word_t)(chr << 16);                    \
-        if (!(chr  = (STR)[2])) break;                  \
-        WORD += (Word_t)(chr << 8) + (STR)[3];          \
-    } while(0);                                         \
-}
-
-// copy Word_t from 1..4 bytes to string and test of \0 bytes
-
-#define        COPYWORDtoSTRING(STR,WORD)                       \
-{                                                               \
-    do                                                          \
-    {                                                           \
-        if (!((STR)[0] = (uint8_t)((WORD) >> 24))) break;       \
-        if (!((STR)[1] = (uint8_t)((WORD) >> 16))) break;       \
-        if (!((STR)[2] = (uint8_t)((WORD) >>  8))) break;       \
-        (STR)[3]       = (uint8_t)(WORD);                       \
-    } while(0);                                                 \
-}
-#endif // JU_32BIT
-
-
-// SUPPORT FOR SINGLE-INDEX SHORTCUT LEAVES:
-
-typedef struct SHORCUTLEAF
-{
-    Pvoid_t   scl_Pvalue;               // callers value area.
-    uint8_t   scl_Index[WORDSIZE];      // base Index string.
-} scl_t  , *Pscl_t;
-
-// overhead of the scl_Pvalue only, the scl_Index is calculate elsewhere
-
-#define STRUCTOVD       (sizeof(scl_t) - WORDSIZE)
-
-// How big to malloc a shortcut leaf; stringlen should already include the
-// trailing null char:
-
-#define SCLSIZE(LEN)  (((LEN) + STRUCTOVD + WORDSIZE - 1) / WORDSIZE)
-
-// string routines, may replace with your own
-//
-#define STRCMP(S1,S2)   strcmp((void *)(S1), (void *)(S2))
-#define STRCPY(S1,S2)   strcpy((void *)(S1), (void *)(S2))
-#define STRLEN(S1)      (strlen((void *)(S1)) + 1)
-
-
-// Index and value area for a shortcut leaf, depending on how it matches the
-// undecoded remainder of the Index, given a Pscl_t that includes type bits
-// that must be cleared:
-//
-// PSCLINDEX() and PSCLVALUE() are also useful when Pscl contains uncleared
-// TYPE bits.
-//
-// Note:  SCLCMP() cannot take advantage of knowing the Index length because
-// the scl_Index length is not pre-known when these macros are used.
-
-#define PSCLINDEX(PSCL)  ((CLEAR_PSCL(PSCL))->scl_Index)
-#define PSCLVALUE(PSCL)  ((CLEAR_PSCL(PSCL))->scl_Pvalue)
-
-#define SCLCMP(INDEX,PSCL) STRCMP(INDEX, PSCLINDEX(PSCL))
-
-#define PPSCLVALUE_EQ(INDEX,PSCL)                                       \
-    ((SCLCMP(INDEX, PSCL) == 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL)
-
-#define PPSCLVALUE_LT(INDEX,PSCL)                                       \
-    ((SCLCMP(INDEX, PSCL) < 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL)
-
-#define PPSCLVALUE_GT(INDEX,PSCL)                                       \
-    ((SCLCMP(INDEX, PSCL) > 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL)
-
-// Common in-lined code to append or free a shortcut leaf:
-//
-// See header comments about premature return().  Note that malloc() does not
-// pre-zero the memory, so ensure scl_Pvalue is zeroed, just like a value area
-// in a JudyL array.  Hope strcpy() is fast enough in this context.
-
-#define APPEND_SCL(PSCL,PPARRAY,INDEX,LEN,PJERROR)                      \
-{                                                                       \
-    if (((PSCL) = (Pscl_t) JudyMalloc(SCLSIZE(LEN))) == (Pscl_t)NULL)   \
-    {                                                                   \
-        JU_SET_ERRNO(PJERROR, JU_ERRNO_NOMEM);                          \
-        return (PPJERR);                                                \
-    }                                                                   \
-    *(PPARRAY) = (Pvoid_t)SET_PSCL(PSCL);                               \
-    ((PSCL)->scl_Pvalue) = (Pvoid_t)NULL;                               \
-    (void)STRCPY((PSCL)->scl_Index, INDEX);                             \
-}
-
-// "FORWARD" DECLARATIONS:
-
-static void JudySLModifyErrno(PJError_t PJError,
-                              Pcvoid_t PArray, Pcvoid_t PArrayOrig);
-static int JudySLDelSub(PPvoid_t PPArray, PPvoid_t PPArrayOrig,
-                        const uint8_t * Index, Word_t len, PJError_t PJError);
-static PPvoid_t JudySLPrevSub(Pcvoid_t PArray, uint8_t * Index, int orig,
-                              Word_t len, PJError_t PJError);
-static PPvoid_t JudySLNextSub(Pcvoid_t PArray, uint8_t * Index, int orig,
-                              Word_t len, PJError_t PJError);
-
-// ****************************************************************************
-// J U D Y   S L   M O D I F Y   E R R N O
-//
-// Common code for error translation:  When a caller passes an invalid JAP
-// ("not a JudyL pointer"), OR if the JudySL array is corrupted at a lower
-// level, various JudyL*() calls return JU_ERRNO_NOTJUDYL.  If the caller wants
-// detailed error info, convert this particular error to JU_ERRNO_NOTJUDYSL if
-// at the top of the tree, otherwise convert it to JU_ERRNO_CORRUPT, meaning
-// there was a corruption (the only one even detectable outside JudyL) in the
-// JudySL tree; but pass through any other errors unaltered.
-
-static void
-JudySLModifyErrno(PJError_t PJError,    // to modify if non-null.
-                  Pcvoid_t PArray,      // current JudyL array.
-                  Pcvoid_t PArrayOrig   // top-of-tree JudyL array.
-    )
-{                                       //  map this Judy errno.
-    if ((PJError != PJE0) && (JU_ERRNO(PJError) == JU_ERRNO_NOTJUDYL))
-    {
-        if (PArray == PArrayOrig)       // callers fault.
-        {
-            JU_SET_ERRNO_NONNULL(PJError, JU_ERRNO_NOTJUDYSL);
-        }
-        else                            // lower level.
-        {
-            JU_SET_ERRNO_NONNULL(PJError, JU_ERRNO_CORRUPT);
-        }
-    }
-}                                       // JudySLModifyErrno()
-
-// ****************************************************************************
-// J U D Y   S L   G E T
-//
-// See comments in file header and below.
-
-PPvoid_t
-JudySLGet(Pcvoid_t PArray, const uint8_t * Index, PJError_t PJError)
-{
-    const uint8_t *pos = Index;         // place in Index.
-    Word_t    indexword;                // buffer for aligned copy.
-    PPvoid_t  PPValue;                  // from JudyL array.
-
-// CHECK FOR CALLER ERROR (NULL POINTER):
-
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-// SEARCH NEXT LEVEL JUDYL ARRAY IN TREE:
-//
-// Use or copy each word from the Index string and check for it in the next
-// level JudyL array in the array tree, but first watch for shortcut leaves.
-// Upon invalid Index or end of Index (string) in current word, return.
-
-    do                                  // until return.
-    {
-        if (IS_PSCL(PArray))            // a shortcut leaf.
-            return (PPSCLVALUE_EQ(pos, PArray));
-
-        COPYSTRINGtoWORD(indexword, pos);       // copy next 4[8] bytes.
-
-        JLG(PPValue, PArray, indexword);
-
-        if ((PPValue == (PPvoid_t) NULL) || LASTWORD_BY_VALUE(indexword))
-            return (PPValue);
-
-// CONTINUE TO NEXT LEVEL DOWN JUDYL ARRAY TREE:
-//
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated here as a dead-end (not a core
-// dump or assertion; see version 1.25).
-
-        pos += WORDSIZE;
-        PArray = *PPValue;              // each value -> next array.
-    } while(1);                         // forever
-//  NOTREACHED JudySLGet()
-}
-
-// ****************************************************************************
-// J U D Y   S L   I N S
-//
-// See also the comments in JudySLGet(), which is somewhat similar, though
-// simpler.
-//
-// Theory of operation:
-//
-// Upon encountering a null pointer in the tree of JudyL arrays, insert a
-// shortcut leaf -- including directly under a null root pointer for the first
-// Index in the JudySL array.
-//
-// Upon encountering a pre-existing shortcut leaf, if the old Index is equal to
-// the new one, return the old value area.  Otherwise, "carry down" the old
-// Index until the old and new Indexes diverge, at which point each Index
-// either terminates in the last JudyL array or a new shortcut leaf is inserted
-// under it for the Indexs remainder.
-//
-// TBD:  Running out of memory below the starting point causes a premature
-// return below (in several places) and leaves a dead-end in the JudySL tree.
-// Ideally the code here would back this out rather than wasting a little
-// memory, but in lieu of that, the get, delete, and search functions
-// understand dead-ends and handle them appropriately.
-
-PPvoid_t
-JudySLIns(PPvoid_t PPArray, const uint8_t * Index, PJError_t PJError)
-{
-    PPvoid_t  PPArrayOrig = PPArray;    // for error reporting.
-    const uint8_t *pos = Index;         // place in Index.
-    const uint8_t *pos2 = (uint8_t *) NULL;     // old Index (SCL being moved).
-    Word_t    len;                      // bytes remaining.
-
-// Note:  len2 is set when needed and only used when valid, but this is not
-// clear to gcc -Wall, so initialize it here to avoid a warning:
-
-    Word_t    len2 = 0;                 // for old Index (SCL being moved).
-    Word_t    scl2 = 0;                 // size in words of SCL
-    Word_t    indexword;                // buffer for aligned copy.
-    Word_t    indexword2;               // for old Index (SCL being moved).
-    PPvoid_t  PPValue;                  // from JudyL array.
-    PPvoid_t  PPValue2;                 // for old Index (SCL being moved).
-    Pscl_t    Pscl = (Pscl_t) NULL;     // shortcut leaf.
-    Pscl_t    Pscl2;                    // for old Index (SCL being moved).
-
-// CHECK FOR CALLER ERROR (NULL POINTERS):
-
-    if (PPArray == (PPvoid_t) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-        return (PPJERR);
-    }
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-    len = STRLEN(Index);        // bytes remaining.
-
-// APPEND SHORTCUT LEAF:
-//
-// If PPArray, which is the root pointer to the first or next JudyL array in
-// the tree, points to null (no next JudyL array), AND there is no shortcut
-// leaf being carried down, append a shortcut leaf here for the new Index, no
-// matter how much of the Index string remains (one or more bytes, including
-// the trailing \0).
-
-    while (1)                           // until return.
-    {
-        if (*PPArray == (Pvoid_t)NULL)  // no next JudyL array.
-        {
-            if (Pscl == (Pscl_t) NULL)  // no SCL being carried down.
-            {
-                APPEND_SCL(Pscl, PPArray, pos, len, PJError);   // returns if error.
-                return (&(Pscl->scl_Pvalue));
-            }
-            // else do nothing here; see below.
-        }
-
-// CARRY DOWN PRE-EXISTING SHORTCUT LEAF:
-//
-// When PPArray points to a pre-existing shortcut leaf, if its Index is equal
-// to the Index to be inserted, meaning no insertion is required, return its
-// value area; otherwise, "move it aside" and "carry it down" -- replace it
-// (see below) with one or more levels of JudyL arrays.  Moving it aside
-// initially just means setting Pscl non-null, both as a flag and for later
-// use, and clearing the pointer to the SCL in the JudyL array.
-
-        else if (IS_PSCL(*PPArray))
-        {
-            assert(Pscl == (Pscl_t) NULL);      // no nested SCLs.
-
-            Pscl = CLEAR_PSCL(*PPArray);
-
-            pos2 = Pscl->scl_Index;     // note: pos2 is always word-aligned.
-            len2 = STRLEN(pos2);        // bytes remaining.
-
-//          first check if string is already inserted
-
-            if ((len == len2) && (STRCMP(pos, pos2) == 0))
-                return (&(Pscl->scl_Pvalue));
-
-            *PPArray = (Pvoid_t)NULL;   // disconnect SCL.
-
-            scl2 = SCLSIZE(len2);       // save for JudyFree
-
-            // continue with *PPArray now clear, and Pscl, pos2, len2 set.
-        }
-
-// CHECK IF OLD AND NEW INDEXES DIVERGE IN THE CURRENT INDEX WORD:
-//
-// If a shortcut leaf is being carried down and its remaining Index chars now
-// diverge from the remaining chars of the Index being inserted, that is, if
-// the next words of each Index differ, "plug in" the old Index here, in a new
-// JudyL array, before proceeding.
-//
-// Note:  Call JudyLIns() for the SCL Index word before calling it for the new
-// Index word, so PPValue remains correct for the latter.  (JudyLIns() return
-// values are not stable across multiple calls.)
-//
-// Note:  Although pos2 is word-aligned, and a Pscl_t is a whole number of
-// words in size, pos2 is not certain to be null-padded through a whole word,
-// so copy it first to an index word for later use.
-//
-// See header comments about premature return().
-
-        COPYSTRINGtoWORD(indexword, pos);       // copy next 4[8] bytes.
-
-        if (Pscl != (Pscl_t) NULL)
-        {
-            COPYSTRINGtoWORD(indexword2, pos2); // copy next 4[8] bytes.
-
-            if (indexword != indexword2)        // SCL and new Indexes diverge.
-            {
-                assert(*PPArray == (Pvoid_t)NULL);      // should be new JudyL array.
-
-// Note:  If JudyLIns() returns JU_ERRNO_NOTJUDYL here, *PPArray should not be
-// modified, so JudySLModifyErrno() can do the right thing.
-
-                if ((PPValue2 = JudyLIns(PPArray, indexword2, PJError))
-                    == PPJERR)
-                {
-                    JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-                    return (PPJERR);
-                }
-
-                assert(PPValue2 != (PPvoid_t) NULL);
-
-// If the old (SCL) Index terminates here, copy its value directly into the
-// JudyL value area; otherwise create a new shortcut leaf for it, under
-// *PPValue2 (skipping the word just inserted), and copy its value to the new
-// SCL:
-
-                if (len2 <= WORDSIZE)
-                {
-                    *((PWord_t)PPValue2) = (Word_t)(Pscl->scl_Pvalue);
-                }
-                else
-                {
-                    APPEND_SCL(Pscl2, PPValue2, pos2 + WORDSIZE,
-                               len2 - WORDSIZE, PJError);
-                    (Pscl2->scl_Pvalue) = Pscl->scl_Pvalue;
-                }
-//              old SCL no longer needed.
-
-                JudyFree((void *)Pscl, scl2);
-
-                Pscl = (Pscl_t) NULL;
-            }
-        }
-
-// APPEND NEXT LEVEL JUDYL ARRAY TO TREE:
-//
-// If a shortcut leaf was carried down and diverged at this level, the code
-// above already appended the new JudyL array, but the next word of the new
-// Index still must be inserted in it.
-//
-// See header comments about premature return().
-//
-// Note:  If JudyLIns() returns JU_ERRNO_NOTJUDYL here, *PPArray should not be
-// modified, so JudySLModifyErrno() can do the right thing.
-
-        if ((PPValue = JudyLIns(PPArray, indexword, PJError)) == PPJERR)
-        {
-            JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-            return (PPJERR);
-        }
-
-        assert(PPValue != (PPvoid_t) NULL);
-
-// CHECK IF NEW INDEX TERMINATES:
-//
-// Note that if it does, and an old SCL was being carried down, it must have
-// diverged by this point, and is already handled.
-
-        if (len <= WORDSIZE)
-        {
-            assert(Pscl == (Pscl_t) NULL);
-            return (PPValue);           // is value for whole Index string.
-        }
-
-        pos += WORDSIZE;
-        len -= WORDSIZE;
-        pos2 += WORDSIZE;               // useless unless Pscl is set.
-        len2 -= WORDSIZE;
-
-        PPArray = PPValue;              // each value -> next array.
-    }                                   // while.
-}                                       // NOTREACHED, JudySLIns()
-
-// ****************************************************************************
-// J U D Y   S L   D E L
-//
-// See the comments in JudySLGet(), which is somewhat similar.
-//
-// Unlike JudySLGet() and JudySLIns(), recurse downward through the tree of
-// JudyL arrays to find and delete the given Index, if present, and then on the
-// way back up, any of its parent arrays which ends up empty.
-//
-// TECHNICAL NOTES:
-//
-// Recursion seems bad, but this allows for an arbitrary-length Index.  Also, a
-// more clever iterative solution that used JudyLCount() (see below) would
-// still require a function call per tree level, so why not just recurse?
-//
-// An earlier version (1.20) used a fixed-size stack, which limited the Index
-// size.  We were going to replace this with using JudyLCount(), in order to
-// note and return to (read this carefully) the highest level JudyL array with
-// a count of 1, all of whose descendant JudyL arrays also have a count of 1,
-// and delete from that point downwards.  This solution would traverse the
-// array tree downward looking to see if the given Index is in the tree, then
-// if so, delete layers downwards starting below the last one that contains
-// other Indexes than the one being deleted.
-//
-// TBD:  To save time coding, and to very likely save time overall during
-// execution, this function does "lazy deletions", or putting it more nicely,
-// it allows "hysteresis" in the JudySL tree, when shortcut leafs are present.
-// It only removes the specified Index, and recursively any empty JudyL arrays
-// above it, without fully reversing the effects of JudySLIns().  This is
-// probably OK because any application that calls JudySLDel() is likely to call
-// JudySLIns() again with the same or a neighbor Index.
-
-int
-JudySLDel(PPvoid_t PPArray, const uint8_t * Index, PJError_t PJError)   // optional, for returning error info.
-{
-
-// Check for caller error (null pointer):
-
-    if (PPArray == (PPvoid_t) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-        return (JERR);
-    }
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (JERR);
-    }
-
-// Do the deletion:
-
-    return (JudySLDelSub(PPArray, PPArray, Index, STRLEN(Index), PJError));
-
-}                                       // JudySLDel()
-
-// ****************************************************************************
-// J U D Y   S L   D E L   S U B
-//
-// This is the "engine" for JudySLDel() that expects aligned and len to already
-// be computed (only once).  See the header comments for JudySLDel().
-
-static int
-JudySLDelSub(PPvoid_t PPArray,          // in which to delete.
-             PPvoid_t PPArrayOrig,      // for error reporting.
-             const uint8_t * Index,     // to delete.
-             Word_t len,                // bytes remaining.
-             PJError_t PJError)         // optional, for returning error info.
-{
-    Word_t    indexword;                // next word to find.
-    PPvoid_t  PPValue;                  // from JudyL array.
-    int       retcode;                  // from lower-level call.
-
-    assert(PPArray != (PPvoid_t) NULL);
-    assert(Index != (uint8_t *) NULL);
-
-// DELETE SHORTCUT LEAF:
-//
-// As described above, this can leave an empty JudyL array, or one containing
-// only a single other Index word -- which could be, but is not, condensed into
-// a higher-level shortcut leaf.  More precisely, at this level it leaves a
-// temporary "dead end" in the JudySL tree, similar to when running out of
-// memory during JudySLIns(), and this is somewhat cleaned up by higher
-// recursions of the same function (see below); but remaining shortcut leaves
-// for other Indexes are not coalesced.
-
-    if (IS_PSCL(*PPArray))
-    {
-        Pscl_t    Pscll = CLEAR_PSCL(*PPArray);
-        Word_t    words;
-
-        if (STRCMP(Index, Pscll->scl_Index))
-            return (0);                 // incorrect index.
-
-        words = SCLSIZE(STRLEN(Pscll->scl_Index));
-        JudyFree((void *)Pscll, words);
-
-        *PPArray = (Pvoid_t)NULL;
-        return (1);                     // correct index deleted.
-    }
-
-// DELETE LAST INDEX WORD, FROM CURRENT JUDYL ARRAY:
-//
-// When at the end of the full Index, delete the last word, if present, from
-// the current JudyL array, and return the result all the way up.
-
-    COPYSTRINGtoWORD(indexword, Index); // copy next 4[8] bytes.
-
-    if (len <= WORDSIZE)
-    {
-        if ((retcode = JudyLDel(PPArray, indexword, PJError)) == JERR)
-        {
-            JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-            return (JERR);
-        }
-        return (retcode);
-    }
-
-// DELETE BELOW NON-LAST INDEX WORD IN CURRENT JUDYL ARRAY:
-//
-// If a word before the end of the full Index is present in the current JudyL
-// array, recurse through its value, which must be a pointer to another JudyL
-// array, to continue the deletion at the next level.  Return the JudyLGet()
-// return if the Indexs current word is not in the JudyL array, or if no
-// delete occurs below this level, both of which mean the whole Index is not
-// currently valid.
-//
-
-    JLG(PPValue, *PPArray, indexword);
-    if (PPValue == (PPvoid_t) NULL)
-        return (0);                     // Index not in JudySL array.
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25).
-    if ((retcode =
-         JudySLDelSub(PPValue, PPArrayOrig, Index + WORDSIZE,
-                      len - WORDSIZE, PJError)) != 1)
-    {
-        return (retcode);               // no lower-level delete, or error.
-    }
-
-// DELETE EMPTY JUDYL ARRAY:
-//
-// A delete occurred below in the tree.  If the child JudyL array became empty,
-// delete the current Index word from the current JudyL array, which could
-// empty the current array and null out *PPArray in turn (or pass through an
-// error).  Otherwise simply indicate that a deletion did occur.
-
-    if (*PPValue == (Pvoid_t)NULL)
-    {
-        if ((retcode = JudyLDel(PPArray, indexword, PJError)) == JERR)
-        {
-            JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-            return (JERR);
-        }
-
-        return (retcode);
-    }
-
-    return (1);
-}                                       // JudySLDelSub()
-
-// ****************************************************************************
-// J U D Y   S L   P R E V
-//
-// Recursively traverse the JudySL tree downward using JudyLGet() to look for
-// each successive index word from Index in the JudyL array at each level.  At
-// the last level for the Index (LASTWORD_BY_LEN()), use JudyLPrev() instead of
-// JudyLGet(), to exclude the initial Index.  If this doesnt result in finding
-// a previous Index, work back up the tree using JudyLPrev() at each higher
-// level to search for a previous index word.  Upon finding a previous index
-// word, descend again if/as necessary, this time inclusively, to find and
-// return the full previous Index.
-//
-// Also support shortcut leaves.
-//
-// Since this function is recursive and it also needs to know if its still
-// looking for the original Index (to exclude it at the LASTWORD_BY_LEN()
-// level) or for the remaining words of the previous Index (inclusive),
-// actually call a subroutine that takes an additional parameter.
-//
-// See also the technical notes in JudySLDel() regarding the use of recursion
-// rather than iteration.
-
-PPvoid_t
-JudySLPrev(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info.
-{
-// Check for caller error (null pointer), or empty JudySL array:
-
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-    if (PArray == (Pvoid_t)NULL)
-        return ((PPvoid_t) NULL);
-// Do the search:
-    return (JudySLPrevSub(PArray, Index, /* original = */ 1,
-                          STRLEN(Index), PJError));
-}                                       // JudySLPrev()
-
-// ****************************************************************************
-// J U D Y   S L   P R E V   S U B
-//
-// This is the "engine" for JudySLPrev() that knows whether its still looking
-// for the original Index (exclusive) or a neighbor index (inclusive), and that
-// expects aligned and len to already be computed (only once).  See the header
-// comments for JudySLPrev().
-
-static    PPvoid_t
-JudySLPrevSub(Pcvoid_t PArray, uint8_t * Index, int orig,
-              Word_t len,               // bytes remaining.
-              PJError_t PJError)        // optional, for returning error info.
-{
-    Word_t    indexword;                // next word to find.
-    PPvoid_t  PPValue;                  // from JudyL array.
-// ORIGINAL SEARCH:
-//
-// When at a shortcut leaf, copy its remaining Index (string) chars into Index
-// and return its value area if the current Index is after (greater than) the
-// SCLs index; otherwise return null.
-    if (orig)
-    {
-        if (IS_PSCL(PArray))
-        {
-            if ((PPValue = PPSCLVALUE_GT(Index, PArray)) != (PPvoid_t) NULL)
-                (void)STRCPY(Index, PSCLINDEX(PArray));
-            return (PPValue);
-        }
-
-// If the current Index word:
-// - is not the last word in Index (end of string),
-// - exists in the current JudyL array, and,
-// - a previous Index is found below it, return that Indexs value area.
-
-        COPYSTRINGtoWORD(indexword, Index);     // copy next 4[8] bytes.
-        if (len > WORDSIZE)             // not at end of Index.
-        {
-            JLG(PPValue, PArray, indexword);
-            if (PPValue != (PPvoid_t) NULL)
-            {
-
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-
-                PPValue = JudySLPrevSub(*PPValue, Index + WORDSIZE,
-                                        /* original = */ 1,
-                                        len - WORDSIZE, PJError);
-                if (PPValue == PPJERR)
-                    return (PPJERR);    // propagate error.
-                if (PPValue != (PPvoid_t) NULL)
-                    return (PPValue);   // see above.
-            }
-        }
-
-// Search for previous index word:
-//
-// One of the above conditions is false.  Search the current JudyL array for
-// the Index word, if any, prior to the current index word.  If none is found,
-// return null; otherwise fall through to common later code.
-
-        if ((PPValue = JudyLPrev(PArray, &indexword, PJError)) == PPJERR)
-        {
-            JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL);
-            return (PPJERR);
-        }
-
-        if (PPValue == (PPvoid_t) NULL)
-            return ((PPvoid_t) NULL);   // no previous index word.
-    }                                   // if.
-
-// SUBSEQUENT SEARCH:
-//
-// A higher level search already excluded the initial Index, then found a
-// previous index word, and is now traversing down to determine the rest of the
-// Index and to obtain its value area.  If at a shortcut leaf, return its value
-// area.  Otherwise search the current JudyL array backward from the upper
-// limit for its last index word.  If no index word is found, return null --
-// should never happen unless the JudySL tree is corrupt; otherwise fall
-// through to common later code.
-
-    else
-    {
-        if (IS_PSCL(PArray))            // at shortcut leaf.
-        {
-            (void)STRCPY(Index, PSCLINDEX(PArray));
-            return (&PSCLVALUE(PArray));
-        }
-
-        indexword = ~0UL;
-        if ((PPValue = JudyLLast(PArray, &indexword, PJError)) == PPJERR)
-        {
-            JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL);
-            return (PPJERR);
-        }
-
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-
-        if (PPValue == (PPvoid_t) NULL)
-            return ((PPvoid_t) NULL);   // no previous index word.
-    }
-
-// FOUND PREVIOUS INDEX WORD:
-//
-// A previous (if original) or last (if subsequent) index word was located in
-// the current JudyL array.  Store it into the callers Index (string).  Then
-// if the found (previous) Index ends here, return its value area; otherwise do
-// a subsequent search below this point, which should never fail unless the
-// JudySL tree is corrupt, but this is detected at a lower level by the above
-// assertion.
-//
-// Note:  Treat Index as unaligned, even if it is aligned, to avoid writing
-// past the end of allocated memory (in case its less than a whole number of
-// words).
-
-    COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes.
-    if (LASTWORD_BY_VALUE(indexword))
-        return (PPValue);
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-    return (JudySLPrevSub(*PPValue, Index + WORDSIZE, /* original = */ 0,
-                          len - WORDSIZE, PJError));
-}                                       // JudySLPrevSub()
-
-// ****************************************************************************
-// J U D Y   S L   N E X T
-//
-// See the comments in JudySLPrev(), which is very similar.
-//
-// TBD:  Could the two functions call a common engine function with various
-// subfunctions and other constants specified?
-
-PPvoid_t
-JudySLNext(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info.
-{
-// Check for caller error (null pointer), or empty JudySL array:
-
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-    if (PArray == (Pvoid_t)NULL)
-        return ((PPvoid_t) NULL);
-// Do the search:
-    return (JudySLNextSub(PArray, Index, /* original = */ 1,
-                          STRLEN(Index), PJError));
-}                                       // JudySLNext()
-
-// ****************************************************************************
-// J U D Y   S L   N E X T   S U B
-//
-// See the comments in JudySLPrevSub(), which is very similar.
-
-static    PPvoid_t
-JudySLNextSub(Pcvoid_t PArray, uint8_t * Index, int orig,
-              Word_t len,               // bytes remaining.
-              PJError_t PJError)        // optional, for returning error info.
-{
-    Word_t    indexword;                // next word to find.
-    PPvoid_t  PPValue;                  // from JudyL array.
-    if (orig)
-    {
-        if (IS_PSCL(PArray))
-        {
-            if ((PPValue = PPSCLVALUE_LT(Index, PArray)) != (PPvoid_t) NULL)
-                (void)STRCPY(Index, PSCLINDEX(PArray));
-            return (PPValue);
-        }
-
-        COPYSTRINGtoWORD(indexword, Index);     // copy next 4[8] bytes.
-
-        if (len > WORDSIZE)             // not at end of Index.
-        {
-            JLG(PPValue, PArray, indexword);
-            if (PPValue != (PPvoid_t) NULL)
-            {
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-
-                PPValue = JudySLNextSub(*PPValue, Index + WORDSIZE,
-                                        /* original = */ 1,
-                                        len - WORDSIZE, PJError);
-                if (PPValue == PPJERR)
-                    return (PPJERR);    // propagate error.
-                if (PPValue != (PPvoid_t) NULL)
-                    return (PPValue);   // see above.
-            }
-        }
-
-        if ((PPValue = JudyLNext(PArray, &indexword, PJError)) == PPJERR)
-        {
-            JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL);
-            return (PPJERR);
-        }
-
-        if (PPValue == (PPvoid_t) NULL)
-            return ((PPvoid_t) NULL);   // no next index word.
-    }
-    else
-    {
-        if (IS_PSCL(PArray))            // at shortcut leaf.
-        {
-            (void)STRCPY(Index, PSCLINDEX(PArray));
-            return (&PSCLVALUE(PArray));
-        }
-
-        indexword = 0;
-        if ((PPValue = JudyLFirst(PArray, &indexword, PJError)) == PPJERR)
-        {
-            JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL);
-            return (PPJERR);
-        }
-
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-
-        if (PPValue == (PPvoid_t) NULL)
-            return ((PPvoid_t) NULL);   // no next index word.
-    }
-
-    COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes
-    if (LASTWORD_BY_VALUE(indexword))
-        return (PPValue);
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue; this is automatically treated as a dead-end (not a core dump
-// or assertion; see version 1.25):
-    return (JudySLNextSub(*PPValue, Index + WORDSIZE, /* original = */ 0,
-                          len - WORDSIZE, PJError));
-}                                       // JudySLNextSub()
-
-// ****************************************************************************
-// J U D Y   S L   F I R S T
-//
-// Like JudyLFirst(), do a JudySLGet(), then if necessary a JudySLNext().
-
-PPvoid_t
-JudySLFirst(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError)        // optional, for returning error info.
-{
-    PPvoid_t  PPValue;                  // from JudyL array.
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-    if ((PPValue = JudySLGet(PArray, Index, PJError)) == PPJERR)
-        return (PPJERR);                // propagate serious error.
-    if ((PPValue == (PPvoid_t) NULL)    // first try failed.
-        && ((PPValue = JudySLNext(PArray, Index, PJError)) == PPJERR))
-    {
-        return (PPJERR);                // propagate serious error.
-    }
-
-    return (PPValue);
-}                                       // JudySLFirst()
-
-// ****************************************************************************
-// J U D Y   S L   L A S T
-//
-// Like JudyLLast(), do a JudySLGet(), then if necessary a JudySLPrev().
-
-PPvoid_t
-JudySLLast(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info.
-{
-    PPvoid_t  PPValue;                  // from JudyL array.
-    if (Index == (uint8_t *) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
-        return (PPJERR);
-    }
-
-    if ((PPValue = JudySLGet(PArray, Index, PJError)) == PPJERR)
-        return (PPJERR);                // propagate serious error.
-    if ((PPValue == (PPvoid_t) NULL)    // first try failed.
-        && ((PPValue = JudySLPrev(PArray, Index, PJError)) == PPJERR))
-    {
-        return (PPJERR);                // propagate serious error.
-    }
-
-    return (PPValue);
-}                                       // JudySLLast()
-
-// ****************************************************************************
-// J U D Y   S L   F R E E   A R R A Y
-//
-// Walk the JudySL tree of JudyL arrays to free each JudyL array, depth-first.
-// During the walk, ignore indexes (strings) that end in the current JudyL
-// array to be freed.  Just recurse through those indexes which do not end,
-// that is, those whose associated value areas point to subsidiary JudyL
-// arrays, except for those which point to shortcut leaves.  Return the total
-// bytes freed in all of the JudyL arrays at or below the current level.
-//
-// Like the JudyLFreeArray() and Judy1FreeArray() code, this is written
-// recursively, which is probably fast enough, to allow indexes (strings) of
-// arbitrary size.  If recursion turns out to be a problem, consider instead
-// doing some large, fixed number of iterative descents (like 100) using a
-// fixed-size "stack" (array), then recursing upon overflow (relatively
-// rarely).
-
-Word_t
-JudySLFreeArray(PPvoid_t PPArray, PJError_t PJError)    // optional, for returning error info.
-{
-    PPvoid_t  PPArrayOrig = PPArray;    // for error reporting.
-    Word_t    indexword = 0;            // word just found.
-    PPvoid_t  PPValue;                  // from Judy array.
-    Word_t    bytes_freed = 0;          // bytes freed at this level.
-    Word_t    bytes_total = 0;          // bytes freed at all levels.
-    if (PPArray == (PPvoid_t) NULL)
-    {
-        JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY);
-        return (JERR);
-    }
-
-// FREE SHORTCUT LEAF:
-
-    if (IS_PSCL(*PPArray))
-    {
-        Word_t    freewords;
-        Pscl_t    Pscl;
-
-        Pscl = CLEAR_PSCL(*PPArray);
-
-        freewords = SCLSIZE(STRLEN(Pscl->scl_Index));
-
-        JudyFree((void *)Pscl, freewords);
-
-        *PPArray = (Pvoid_t)NULL;
-
-        return (freewords * WORDSIZE);
-    }
-
-// FREE EACH SUB-ARRAY (DEPTH-FIRST):
-//
-// If a previous JudySLIns() ran out of memory partway down the tree, it left a
-// null *PPValue.  This is automatically treated correctly here as a dead-end.
-//
-// An Index (string) ends in the current word iff the last byte of the
-// (null-padded) word is null.
-
-    for (PPValue = JudyLFirst(*PPArray, &indexword, PJError);
-         (PPValue != (PPvoid_t) NULL) && (PPValue != PPJERR);
-         PPValue = JudyLNext(*PPArray, &indexword, PJError))
-    {
-        if (!LASTWORD_BY_VALUE(indexword))
-        {
-            if ((bytes_freed = JudySLFreeArray(PPValue, PJError)) == JERR)
-                return (JERR);          // propagate serious error.
-            bytes_total += bytes_freed;
-        }
-    }
-
-// Check for a serious error in a JudyL*() call:
-
-    if (PPValue == PPJERR)
-    {
-        JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-        return (JERR);
-    }
-
-// Now free the current array, which also nulls the pointer:
-//
-// Note:  *PPArray can be null here for a totally null JudySL array =>
-// JudyLFreeArray() returns zero.
-
-    if ((bytes_freed = JudyLFreeArray(PPArray, PJError)) == JERR)
-    {
-        JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig);
-        return (JERR);
-    }
-    return (bytes_total + bytes_freed);
-}                                       // JudySLFreeArray()
diff --git a/libs/klib/judy/JudyTablesGen.c b/libs/klib/judy/JudyTablesGen.c
deleted file mode 100644
index a5fcb85..0000000
--- a/libs/klib/judy/JudyTablesGen.c
+++ /dev/null
@@ -1,294 +0,0 @@
-// Copyright (C) 2000 - 2002 Hewlett-Packard Company
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the term of the GNU Lesser 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 Lesser General Public License
-// for more details.
-//
-// You should have received a copy of the GNU Lesser 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
-// _________________
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#if (! (defined(JUDY1) || defined(JUDYL)))
-#error:  One of -DJUDY1 or -DJUDYL must be specified.
-#endif
-
-#define	TERMINATOR 999		// terminator for Alloc tables
-
-#define BPW sizeof(Word_t)	// define bytes per word
-
-#ifdef JUDY1
-#include "Judy1.h"
-#else
-#include "JudyL.h"
-#endif
-    
-FILE *fd;
-
-// Definitions come from header files Judy1.h and JudyL.h:
-
-int AllocSizes[] = ALLOCSIZES;
-
-#define	ROUNDUP(BYTES,BPW,OFFSETW) \
-	((((BYTES) + (BPW) - 1) / (BPW)) + (OFFSETW))
-
-
-// ****************************************************************************
-// G E N   T A B L E
-//
-// Note:  "const" is required for newer compilers.
-
-FUNCTION void GenTable(
-    const char * TableName,	// name of table string
-    const char * TableSize,	// dimentioned size string
-    int		 IndexBytes,	// bytes per Index
-    int		 LeafSize,	// number elements in object
-    int		 ValueBytes,	// bytes per Value
-    int		 OffsetWords)	// 1 for LEAFW
-{
-    int *	 PAllocSizes = AllocSizes;
-    int		 OWord;
-    int		 CurWord;
-    int		 IWord;
-    int		 ii;
-    int		 BytesOfIndex;
-    int		 BytesOfObject;
-    int		 Index;
-    int		 LastWords;
-    int		 Words [1000] = { 0 };
-    int		 Offset[1000] = { 0 };
-    int		 MaxWords;
-
-    MaxWords  =	ROUNDUP((IndexBytes + ValueBytes) * LeafSize, BPW, OffsetWords);
-    Words[0]  = 0;
-    Offset[0] = 0;
-    CurWord   = TERMINATOR;
-
-// Walk through all number of Indexes in table:
-
-    for (Index = 1; /* null */; ++Index)
-    {
-
-// Calculate byte required for next size:
-
-	BytesOfIndex  = IndexBytes * Index;
-	BytesOfObject = (IndexBytes + ValueBytes) * Index;
-
-// Round up and calculate words required for next size:
-
-        OWord =	ROUNDUP(BytesOfObject, BPW, OffsetWords);
-        IWord =	ROUNDUP(BytesOfIndex,  BPW, OffsetWords);
-
-// Root-level leaves of population of 1 and 2 do not have the 1 word offset:
-
-// Save minimum value of offset:
-
-        Offset[Index] = IWord;
-
-// Round up to next available size of words:
-
-	while (OWord > *PAllocSizes) PAllocSizes++;
-
-        if (Index == LeafSize)
-        {
-	    CurWord = Words[Index] = OWord;
-            break;
-        }
-//      end of available sizes ?
-
-	if (*PAllocSizes == TERMINATOR)
-        {
-            fprintf(stderr, "BUG, in %sPopToWords, sizes not big enough for object\n", TableName);
-	    exit(1);
-        }
-
-// Save words required and last word:
-
-        if (*PAllocSizes < MaxWords) { CurWord = Words[Index] = *PAllocSizes; }
-        else                         { CurWord = Words[Index] = MaxWords; }
-
-    } // for each index
-
-    LastWords = TERMINATOR;
-
-// Round up to largest size in each group of malloc sizes:
-
-    for (ii = LeafSize; ii > 0; ii--)
-    {
-        if (LastWords > (Words[ii] - ii)) LastWords = Offset[ii];
-        else                              Offset[ii] = LastWords;
-    }
-
-// Print the PopToWords[] table:
-
-    fprintf(fd,"\n//\tobject uses %d words\n", CurWord);
-    fprintf(fd,"//\t%s = %d\n", TableSize, LeafSize);
-
-    fprintf(fd,"const uint8_t\n");
-    fprintf(fd,"%sPopToWords[%s + 1] =\n", TableName, TableSize);
-    fprintf(fd,"{\n\t 0,");
-
-    for (ii = 1; ii <= LeafSize; ii++)
-    {
-
-// 8 columns per line, starting with 1:
-
-	if ((ii % 8) == 1) fprintf(fd,"\n\t");
-
-	fprintf(fd,"%2d", Words[ii]);
-
-// If not last number place comma:
-
-	if (ii != LeafSize) fprintf(fd,", ");
-    }
-    fprintf(fd,"\n};\n");
-
-// Print the Offset table if needed:
-
-    if (! ValueBytes) return;
-
-    fprintf(fd,"const uint8_t\n");
-    fprintf(fd,"%sOffset[%s + 1] =\n", TableName, TableSize);
-    fprintf(fd,"{\n");
-    fprintf(fd,"\t 0,");
-
-    for (ii = 1; ii <= LeafSize; ii++)
-    {
-        if ((ii % 8) == 1) fprintf(fd,"\n\t");
-
-	fprintf(fd,"%2d", Offset[ii]);
-
-	if (ii != LeafSize) fprintf(fd,", ");
-    }
-    fprintf(fd,"\n};\n");
-
-} // GenTable()
-
-
-// ****************************************************************************
-// M A I N
-
-#ifdef JU_WMAIN
-FUNCTION int wmain()
-#else
-FUNCTION int main()
-#endif
-{
-    int ii;
-
-#ifdef JUDY1
-    char *fname = "Judy1Tables.c";
-#else
-    char *fname = "JudyLTables.c";
-#endif
-
-    if ((fd = fopen(fname, "w")) == NULL){
-	perror("FATAL ERROR: could not write to Judy[1L]Tables.c file\n");
-	return (-1);
-    }
-
-
-    fprintf(fd,"// @(#) From generation tool: JudyTablesGen.c\n");
-    fprintf(fd,"//\n\n");
-
-
-// ================================ Judy1 =================================
-#ifdef JUDY1
-
-    fprintf(fd,"#include \"Judy1.h\"\n");
-
-    fprintf(fd,"// Leave the malloc() sizes readable in the binary (via "
-	   "strings(1)):\n");
-    fprintf(fd,"const char * Judy1MallocSizes = \"Judy1MallocSizes =");
-
-    for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++)
-	fprintf(fd," %d,", AllocSizes[ii]);
-
-#ifndef JU_64BIT
-    fprintf(fd," Leaf1 = %d\";\n\n", cJ1_LEAF1_MAXPOP1);
-#else
-    fprintf(fd,"\";\n\n");			// no Leaf1 in this case.
-#endif
-
-// ================================ 32 bit ================================
-#ifndef JU_64BIT
-
-    GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB,0,0);
-
-    GenTable("j__1_Leaf1", "cJ1_LEAF1_MAXPOP1", 1, cJ1_LEAF1_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0);
-    GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 4, cJ1_LEAFW_MAXPOP1, 0, 1);
-
-#endif
-
-// ================================ 64 bit ================================
-#ifdef JU_64BIT
-    GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB,0,0);
-
-    GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf4", "cJ1_LEAF4_MAXPOP1", 4, cJ1_LEAF4_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf5", "cJ1_LEAF5_MAXPOP1", 5, cJ1_LEAF5_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf6", "cJ1_LEAF6_MAXPOP1", 6, cJ1_LEAF6_MAXPOP1, 0, 0);
-    GenTable("j__1_Leaf7", "cJ1_LEAF7_MAXPOP1", 7, cJ1_LEAF7_MAXPOP1, 0, 0);
-    GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 8, cJ1_LEAFW_MAXPOP1, 0, 1);
-#endif
-#endif // JUDY1
-
-
-// ================================ JudyL =================================
-#ifdef JUDYL
-
-    fprintf(fd,"#include \"JudyL.h\"\n");
-
-    fprintf(fd,"// Leave the malloc() sizes readable in the binary (via "
-	   "strings(1)):\n");
-    fprintf(fd,"const char * JudyLMallocSizes = \"JudyLMallocSizes =");
-
-    for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++)
-	fprintf(fd," %d,", AllocSizes[ii]);
-
-    fprintf(fd," Leaf1 = %ld\";\n\n", (Word_t)cJL_LEAF1_MAXPOP1);
-
-#ifndef JU_64BIT
-// ================================ 32 bit ================================
-    GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB, 0,0);
-
-    GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1",  1, cJL_LEAF1_MAXPOP1, BPW,0);
-    GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1",  2, cJL_LEAF2_MAXPOP1, BPW,0);
-    GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1",  3, cJL_LEAF3_MAXPOP1, BPW,0);
-    GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1",  4, cJL_LEAFW_MAXPOP1, BPW,1);
-    GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 4, cJU_BITSPERSUBEXPL,  0,0);
-#endif // 32 BIT
-
-#ifdef JU_64BIT
-// ================================ 64 bit ================================
-    GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB, 0,0);
-
-    GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1",  1, cJL_LEAF1_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1",  2, cJL_LEAF2_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1",  3, cJL_LEAF3_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf4", "cJL_LEAF4_MAXPOP1",  4, cJL_LEAF4_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf5", "cJL_LEAF5_MAXPOP1",  5, cJL_LEAF5_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf6", "cJL_LEAF6_MAXPOP1",  6, cJL_LEAF6_MAXPOP1,  BPW,0);
-    GenTable("j__L_Leaf7", "cJL_LEAF7_MAXPOP1",  7, cJL_LEAF7_MAXPOP1,  BPW,0);
-    GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1",  8, cJL_LEAFW_MAXPOP1,  BPW,1);
-    GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 8, cJU_BITSPERSUBEXPL, 0,0);
-#endif // 64 BIT
-
-#endif // JUDYL
-    fclose(fd);
-
-    return(0);
-
-} // main()
diff --git a/libs/klib/judy/Makefile b/libs/klib/judy/Makefile
deleted file mode 100644
index 91dbf9e..0000000
--- a/libs/klib/judy/Makefile
+++ /dev/null
@@ -1,190 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: all
-
-TOP ?= $(shell ../../../build/abspath.sh ../../..)
-MODULE = libs/klib/judy
-
-INT_LIBS = \
-	libjudy
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-
-#-------------------------------------------------------------------------------
-# special rules
-#  for some reason these guys use the same source and load it up with
-#  ifdefs, so we have general rules to produce two sets of object files
-#  from a single set of sources
-#
-%.n.32.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJU_32BIT $<
-%.n.64.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJU_64BIT $<
-%.n.32.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJU_32BIT $<
-%.n.64.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJU_64BIT $<
-
-%.b.32.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJUDY1 -DJU_32BIT $<
-%.b.64.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJUDY1 -DJU_64BIT $<
-%.b.32.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJUDY1 -DJU_32BIT $<
-%.b.64.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJUDY1 -DJU_64BIT $<
-
-%.w.32.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJUDYL -DJU_32BIT $<
-%.w.64.$(OBJX): %.c
-	$(CC) -o $@ $(OPT) $(CFLAGS) -DJUDYL -DJU_64BIT $<
-%.w.32.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJUDYL -DJU_32BIT $<
-%.w.64.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) $(CFLAGS) -DJUDYL -DJU_64BIT $<
-
-ifeq (win,$(OS))
-#JUDY_WIN = -DJU_WIN
-JUDY_WIN = -DJU_WMAIN -I$(TOP)/interfaces/cc/vc++
-endif
-
-#ifeq (dbg, $(BUILD))
-#DEBUG := -DDEBUG
-#endif
-
-CFLAGS = $(DEBUG) $(NO_ARRAY_BOUNDS_WARNING) $(DBG) $(CARCH) $(PROF) $(JUDY_WIN) -I$(SRCDIR) -I$(SRCDIR)/..
-
-VPATH += $(OBJDIR)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS)) \
-	$(addprefix $(LIBDIR)/,$(EXT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-
-#-------------------------------------------------------------------------------
-# judy tables - whee!
-#
-JUDY_TABLES_SRC = \
-	JudyTablesGen
-
-JUDY_TABLES_BOBJ = \
-	$(addsuffix .b.$(BITS).$(OBJX),$(JUDY_TABLES_SRC))
-
-JUDY_TABLES_WOBJ = \
-	$(addsuffix .w.$(BITS).$(OBJX),$(JUDY_TABLES_SRC))
-
-$(OBJDIR)/Judy1TablesGen: $(JUDY_TABLES_BOBJ)
-	$(LD) --exe -o $@ $^
-
-$(OBJDIR)/JudyLTablesGen: $(JUDY_TABLES_WOBJ)
-	$(LD) --exe -o $@ $^
-
-$(OBJDIR)/Judy1Tables.c: $(OBJDIR)/Judy1TablesGen
-	$(RUN_REMOTELY) $^
-
-$(OBJDIR)/JudyLTables.c: $(OBJDIR)/JudyLTablesGen
-	$(RUN_REMOTELY) $^
-
-$(ILIBDIR)/judy-tables: \
-	$(OBJDIR)/JudyLTables.c \
-	$(OBJDIR)/Judy1Tables.c
-
-#-------------------------------------------------------------------------------
-# judy whee!
-#
-
-$(ILIBDIR)/libjudy: $(addprefix $(ILIBDIR)/libjudy.,$(LIBX))
-
-JUDY_NEUTRAL = \
-	JudyMalloc \
-	JudySL \
-	JudyHS
-
-JUDY_CMN = \
-	JudyGet \
-	JudyIns \
-	JudyInsArray \
-	JudyDel \
-	JudyCascade \
-	JudyCount \
-	JudyCreateBranch \
-	JudyDecascade \
-	JudyFirst \
-	JudyFreeArray \
-	JudyInsertBranch \
-	JudyMallocIF \
-	JudyMemActive \
-	JudyMemUsed \
-	JudyNext \
-	JudyNextEmpty \
-	JudyPrev \
-	JudyPrevEmpty \
-	JudyByCountWithDefs \
-	j__udyGet
-
-JUDY_WORD = \
-	JudyLTables
-
-JUDY_BIT = \
-	Judy1Tables
-
-JUDY_SRC = \
-	$(addsuffix .n,$(JUDY_NEUTRAL)) \
-	$(addsuffix .w,$(JUDY_CMN) $(JUDY_WORD)) \
-	$(addsuffix .b,$(JUDY_CMN) $(JUDY_BIT))
-
-JUDY_OBJ = \
-	$(addsuffix .$(BITS).$(LOBX),$(JUDY_SRC))
-
-$(ILIBDIR)/libjudy.$(LIBX): $(JUDY_OBJ)
-	$(LD) --slib -o $@ $^
diff --git a/libs/klib/judy/j__udyGet.c b/libs/klib/judy/j__udyGet.c
deleted file mode 100644
index 478c0f1..0000000
--- a/libs/klib/judy/j__udyGet.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define JUDYGETINLINE 1
-#include "JudyGet.c"
diff --git a/libs/klib/ksort.c b/libs/klib/ksort.c
deleted file mode 100644
index 88ff088..0000000
--- a/libs/klib/ksort.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/sort.h>
-
-
-/*--------------------------------------------------------------------------
- * ksort
- *  qsort with a function data pointer
- */
-
-#define TSWAP( T, a, b )                                      \
-    do                                                        \
-    {                                                         \
-        T tmp = * ( const T* ) ( a );                         \
-        * ( T* ) ( a ) = * ( const T* ) ( b );                \
-        * ( T* ) ( b ) = tmp;                                 \
-    }                                                         \
-    while ( 0 )
-
-#define TCMP( T, a, b )                                       \
-    ( ( * ( const T* ) ( a ) < * ( const T* ) ( b ) ) ? -1 :  \
-      ( * ( const T* ) ( a ) > * ( const T* ) ( b ) ) )
-
-
-/* various custom ksort operations
- *  structures will generally want their own functions
- *  these fundamental types can be standardized
- */
-LIB_EXPORT void CC ksort_int32_t ( int32_t *pbase, size_t total_elems )
-{
-#define SWAP( a, b, off, size )  TSWAP ( int32_t, a, b )
-#define CMP( a, b )                                             \
-    ( * ( const int32_t* ) ( a ) - * ( const int32_t* ) ( b ) )
-
-    KSORT ( pbase, total_elems, sizeof * pbase, 0, sizeof * pbase );
-
-#undef SWAP
-#undef CMP
-}
-
-LIB_EXPORT void CC ksort_uint32_t ( uint32_t *pbase, size_t total_elems )
-{
-#define SWAP( a, b, off, size )  TSWAP ( uint32_t, a, b )
-#define CMP( a, b ) TCMP ( uint32_t, a, b )
-
-    KSORT ( pbase, total_elems, sizeof * pbase, 0, sizeof * pbase );
-
-#undef SWAP
-#undef CMP
-}
-
-LIB_EXPORT void CC ksort_int64_t ( int64_t *pbase, size_t total_elems )
-{
-#define SWAP( a, b, off, size )  TSWAP ( int64_t, a, b )
-#define CMP( a, b ) TCMP ( int64_t, a, b )
-
-    KSORT ( pbase, total_elems, sizeof * pbase, 0, sizeof * pbase );
-
-#undef SWAP
-#undef CMP
-}
-
-LIB_EXPORT void CC ksort_uint64_t ( uint64_t *pbase, size_t total_elems )
-{
-#define SWAP( a, b, off, size )  TSWAP ( uint64_t, a, b )
-#define CMP( a, b ) TCMP ( uint64_t, a, b )
-
-    KSORT ( pbase, total_elems, sizeof * pbase, 0, sizeof * pbase );
-
-#undef SWAP
-#undef CMP
-}
diff --git a/libs/klib/libkascii.vers b/libs/klib/libkascii.vers
deleted file mode 100644
index 7dea76e..0000000
--- a/libs/klib/libkascii.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.1
diff --git a/libs/klib/libklib.vers b/libs/klib/libklib.vers
deleted file mode 100644
index 0b1f1ed..0000000
--- a/libs/klib/libklib.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.2.13
diff --git a/libs/klib/libktlog.vers b/libs/klib/libktlog.vers
deleted file mode 100644
index 7dea76e..0000000
--- a/libs/klib/libktlog.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.1
diff --git a/libs/klib/libkutf8.vers b/libs/klib/libkutf8.vers
deleted file mode 100644
index 7dea76e..0000000
--- a/libs/klib/libkutf8.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.1
diff --git a/libs/klib/log-priv.h b/libs/klib/log-priv.h
deleted file mode 100644
index 042eb44..0000000
--- a/libs/klib/log-priv.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_log_priv_
-#define _h_log_priv_
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* some defaults */
-
-/*--------------------------------------------------------------------------
- * Log
- *  global logging
- */
-
-/* GetRCModuleText
- */
-const char *GetRCModuleText ( enum RCModule mod );
-
-/* GetRCTargetText
- */
-const char *GetRCTargetText ( enum RCTarget targ );
-
-/* GetRCContextText
- */
-const char *GetRCContextText ( enum RCContext ctx );
-
-/* GetRCObjectText
- *  obj can be RCTarget or RCObject
- */
-const char *GetRCObjectText ( int obj );
-
-/* GetRCStateText
- */
-const char *GetRCStateText ( enum RCState state );
-
-
-/* GetRCModuleIdxText
- */
-const char *GetRCModuleIdxText ( enum RCModule mod );
-
-/* GetRCTargetIdxText
- */
-const char *GetRCTargetIdxText ( enum RCTarget targ );
-
-/* GetRCContextIdxText
- */
-const char *GetRCContextIdxText ( enum RCContext ctx );
-
-/* GetRCObjectIdxText
- *  obj can be RCTarget or RCObject
- */
-const char *GetRCObjectIdxText ( int obj );
-
-/* GetRCStateIdxText
- */
-const char *GetRCStateIdxText ( enum RCState state );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_log_priv_ */
diff --git a/libs/klib/log.c b/libs/klib/log.c
deleted file mode 100644
index 28aa7ea..0000000
--- a/libs/klib/log.c
+++ /dev/null
@@ -1,984 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/extern.h>
-#include "log-priv.h"
-#include "writer-priv.h"
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <os-native.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * LogLevel
- * defaults to the error level which is the lowest error level filtering
- * warning and informational messages
- */
-static KLogLevel G_log_level = klogErr;
-static rc_t G_log_last_rc = 0;
-
-static KWrtHandler G_log_writer;
-static KWrtHandler G_log_lib_writer;
-
-static KFmtHandler G_log_formatter;
-static KLogFmtFlags G_log_formatter_flags;
-static KFmtHandler G_log_lib_formatter;
-static KLogFmtFlags G_log_lib_formatter_flags;
-
-/* LogLevelAdjust
- *  adjust process-global log level by an offset from current
- */
-LIB_EXPORT void CC KLogLevelAdjust( int32_t adjust )
-{
-    int32_t lvl = KLogLevelGet();
-
-    lvl += adjust;
-    if( lvl < klogLevelMin ) {
-        lvl = klogLevelMin;
-    } else if( lvl > klogLevelMax ) {
-        lvl = klogLevelMax;
-    }
-    G_log_level = lvl;
-}
-
-/* Get
- *  retrieve current process-global log level
- */
-LIB_EXPORT KLogLevel CC KLogLevelGet(void)
-{
-    return G_log_level;
-}
-
-/* Set
- *  set process-global log level
- */
-LIB_EXPORT rc_t CC KLogLevelSet(KLogLevel lvl)
-{
-    /* Don't allow an out of range set */
-    if( (lvl < klogLevelMin) || (lvl > klogLevelMax) ) {
-        return RC(rcRuntime, rcLog, rcUpdating, rcRange, rcInvalid);
-    }
-    G_log_level = lvl;
-    return 0;
-}
-
-/*
- * These need to be kept in sync with type LogLevel
- */
-static const char * logLevelParamStrings [] = 
-{
-    "fatal",
-    "sys",
-    "int",
-    "err",
-    "warn",
-    "info"
-};
-
-LIB_EXPORT const char ** CC KLogGetParamStrings ( void )
-{
-    return logLevelParamStrings;
-}
-
-
-/* LogLevelExplain
- *  inserts level description
- */
-LIB_EXPORT rc_t CC KLogLevelExplain ( KLogLevel lvl, char *buffer, size_t bsize, size_t *num_writ )
-{
-    static const char undefined[] = "undefined";
-    size_t size;
-    uint32_t len;
-    const char *t;
-
-    /* catch unaccounted for or bad changes in log.h
-     * if the asserts fail then the table above and the rest
-     * of the function will fail */
-    assert (klogLevelMin == 0);
-    assert (klogLevelMin == klogFatal);
-    assert ((klogFatal + 1) == klogSys);
-    assert ((klogSys + 1) == klogInt);
-    assert ((klogInt + 1) == klogErr);
-    assert ((klogErr + 1) == klogWarn);
-    assert ((klogWarn + 1) == klogInfo);
-    assert ((klogInfo) == klogLevelMax);
-
-    if ((lvl < klogLevelMin) || (lvl > klogLevelMax)) {
-        t = undefined;
-    } else {
-        t = logLevelParamStrings[lvl];
-    }
-
-    len = string_measure (t, &size);
-    if(len > bsize) {
-        if (num_writ) {
-            *num_writ = 0;
-        }
-        return RC ( rcRuntime, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-    if(num_writ) {
-        *num_writ = len;
-    }
-    string_copy (buffer, bsize, t, len);
-    return 0;
-}
-
-rc_t CC KLogDefaultFormatter( void* self, KWrtHandler* writer,
-                              size_t argc, const wrt_nvp_t args[],
-                              size_t envc, const wrt_nvp_t envs[] )
-{
-    rc_t rc = 0;
-    size_t num_writ, nsize, msize;
-    uint32_t mlen;
-    char buffer[8192], *nbuffer;
-    const char* msg, *rc_msg;
-
-    /* if writer is null than silence */
-    if( writer == NULL || writer->writer == NULL ) {
-        return rc;
-    }
-    msg = wrt_nvp_find_value(envc, envs, "message");
-    rc_msg = wrt_nvp_find_value(envc, envs, "reason");
-    if( msg != NULL ) {
-        const char* mend = msg + string_measure(msg, &msize);
-        /* strip trailing newlines */
-        while( mend != msg && (*mend == '\n' || *mend == '\r') ) {
-            --mend;
-        }
-        mlen = mend - msg;
-    } else {
-        mlen = 0;
-    }
-
-    nbuffer = buffer;
-    nsize = sizeof(buffer);
-    do {
-        rc = string_printf(nbuffer, nsize, & num_writ, "%s %s.%s %s: %s%s%.*s\n",
-                                 wrt_nvp_find_value(envc, envs, "timestamp"),
-                                 wrt_nvp_find_value(envc, envs, "app"),
-                                 wrt_nvp_find_value(envc, envs, "version"),
-                                 wrt_nvp_find_value(envc, envs, "severity"),
-                                 rc_msg ? rc_msg : "", rc_msg ? " - " : "",
-                                 ( uint32_t ) mlen, msg);
-        if( num_writ > nsize )
-        {
-            assert ( nbuffer == buffer );
-            nbuffer = malloc(nsize = num_writ + 2);
-            if( nbuffer == NULL ) {
-                rc = RC(rcRuntime, rcLog, rcLogging, rcMemory, rcExhausted);
-                break;
-            }
-            continue;
-        }
-        /* replace newlines with spaces, excluding last one */
-        for(nsize = 0; nsize < num_writ - 1; nsize++) {
-            if( nbuffer[nsize] == '\n' || nbuffer[nsize] == '\r' ) {
-                nbuffer[nsize] = ' ';
-            }
-        }
-        break;
-    } while(true);
-    if( rc == 0 ) {
-        rc = LogFlush(writer, nbuffer, num_writ);
-    }
-    if( nbuffer != buffer ) {
-        free(nbuffer);
-    }
-    return rc;
-}
-
-
-/* Init
- *  initialize the logging module with executable identity and version,
- *  plus logging level. actual behavior is determined by the logging
- *  implementation.
- *
- *  "ident" [ IN ] - identity of executable
- *
- *  "vers" [ IN ] - 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- *
- *  "lvl" [ IN ] - a LogLevel specifying cutoff point for logs, such
- *  that any log generated with a level above "lvl" will be ignored.
- */
-LIB_EXPORT rc_t CC KLogInit ( void )
-{
-    rc_t rc;
-
-    G_log_level = klogWarn;
-    G_log_last_rc = 0;
-
-    rc = KLogHandlerSetStdErr();
-
-    if (rc == 0)
-        rc = KLogLibHandlerSet (NULL, NULL);
-
-    if (rc == 0)
-        rc = KLogFmtHandlerSetDefault();
-
-    if (rc == 0)
-        rc = KLogLibFmtHandlerSetDefault();
-
-    return rc;
-}
-
-
-/* LastErrorCode
- * LastErrorCodeReset
- *  return or clear the last reported rc_t with log level LogErr or above
- */
-LIB_EXPORT rc_t CC KLogLastErrorCode ( void )
-{
-    return G_log_last_rc;
-}
-
-LIB_EXPORT void CC KLogLastErrorCodeReset ( void )
-{
-    G_log_last_rc = 0;
-}
-
-/* LastErrorCodeSet
- *  set the last reported rc_t with log level LogErr or above
- */
-LIB_EXPORT void CC KLogLastErrorCodeSet ( KLogLevel lvl, rc_t rc )
-{
-    if ( lvl <= klogErr )
-        G_log_last_rc = rc;
-}
-
-/* pLogMsg
- *  creates an info node with parameters
- *  <info time="" message="" ... />
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "msg" [ IN ] - NUL terminated string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-LIB_EXPORT rc_t CC pLogMsg ( KLogLevel lvl, const char *msg, const char *fmt, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    va_start ( args, fmt );
-    rc = vLogMsg ( lvl, msg, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC pLogLibMsg ( KLogLevel lvl, const char *msg, const char *fmt, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    va_start ( args, fmt );
-    rc = vLogLibMsg ( lvl, msg, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* logsubstituteparams
- *  perform param substitution by name
- */
-static
-rc_t logsubstituteparams ( const char* msg, uint32_t argc, const wrt_nvp_t argv[],
-                           uint32_t envc, const wrt_nvp_t envs[],
-                           char* buffer, size_t bsize, size_t* num_writ )
-{
-    rc_t rc;
-    size_t i, sz;
-    for ( rc = 0, i = 0, sz = 0; msg [ i ] != 0; ++ sz, ++ i )
-    {
-        /* copy msg character */
-        if ( sz < bsize )
-            buffer [ sz ] = msg [ i ];
-
-        /* detect substitution param */
-        if ( msg [ i ] == '$' && msg [ i + 1 ] == '(' )
-        {
-            const char *value;
-            size_t size;
-
-            /* find param by name */
-            const wrt_nvp_t *arg = wrt_nvp_find(argc, argv, &msg[ i + 2 ]);
-            if( arg == NULL ) {
-                arg = wrt_nvp_find(envc, envs, &msg[ i + 2 ]);
-                if( arg == NULL ) {
-                    rc = RC ( rcRuntime, rcLog, rcInserting, rcParam, rcNotFound );
-                    break;
-                }
-            }
-            /* substitute param value */
-            for(value = arg->value; *value != 0; value++, sz++) {
-                if( sz < bsize ) {
-                    buffer[sz] = *value;
-                }
-            }
-            /* compensate for outer loop's increment */
-            --sz;
-            /* advance past param token */
-            i += string_measure(arg->name, &size) + 2;
-            assert( msg[i] == ')' );
-        }
-    }
-
-    * num_writ = sz;
-
-    if ( rc != 0 )
-        return rc;
-
-    if ( sz >= bsize )
-        return RC ( rcRuntime, rcLog, rcInserting, rcBuffer, rcInsufficient );
-
-    buffer [ sz ] = 0;
-    return 0;
-}
-
-
-/* logappendpmsg
- *  appends a message and parameters
- */
-static
-int logmatchname ( const char *fmt, char *pdata )
-{
-    int i;
-    for ( i = 0; fmt [ i ] == pdata [ i ]; ++ i )
-    {
-        switch ( fmt [ i ] )
-        {
-        case '=':
-            if ( i > 0 )
-            {
-                pdata [ i ] = 0;
-                return i;
-            }
-        case 0:
-        case ',':
-            return -1;
-        }
-    }
-    return 0;
-}
-
-static
-rc_t logtokenizeparams ( const char* fmt, char* pdata,
-                         uint32_t* argcp, wrt_nvp_t argv[], uint32_t arg_max )
-{
-    /* now split into parameters */
-    uint32_t argc;
-    int len = logmatchname ( fmt, pdata );
-    if ( len ++ <= 0 )
-        return RC ( rcRuntime, rcLog, rcTokenizing, rcParam, rcInvalid );
-
-    argv [ 0 ] . name = pdata;
-    argv [ 0 ] . value = & pdata [ len ];
-    for ( argc = 1, fmt += len; ; ++ argc )
-    {
-        /* find end of formal param fmt */
-        char *end = strchr ( fmt, ',' );
-        if ( end == NULL )
-            break;
-        fmt = end + 1;
-
-        /* find end of param value by
-           finding beginning of next name */
-        end = strchr ( argv [ argc - 1 ] . value, ',' );
-        while ( end != NULL )
-        {
-            len = logmatchname ( fmt, end + 1 );
-            if ( len > 0 )
-                break;
-            if ( len < 0 )
-                return RC ( rcRuntime, rcLog, rcTokenizing, rcParam, rcInvalid );
-            end = strchr ( end + 1, ',' );
-        }
-
-        /* detect badly formed parameter value or va_list */
-        if ( end ++ == NULL )
-            return RC ( rcRuntime, rcLog, rcTokenizing, rcParam, rcInvalid );
-
-        /* detect too many parameters */
-        if ( argc == arg_max )
-            return RC ( rcRuntime, rcLog, rcTokenizing, rcRange, rcExcessive );
-
-        /* account for NUL */
-        ++ len;
-
-        /* NUL terminate value */
-        end [ -1 ] = 0;
-
-        /* record param name and value addresses */
-        argv [ argc ] . name = end;
-        argv [ argc ] . value = end + len;
-
-        /* advance over formal param name */
-        fmt += len;
-    }
-
-    /* if multiple parameters, order by name */
-    wrt_nvp_sort(argc, argv);
-    * argcp = argc;
-    return 0;
-}
-
-static
-rc_t prep_v_args( uint32_t* argc, wrt_nvp_t argv[], size_t max_argc,
-                  char* pbuffer, size_t pbsize, const char* fmt, va_list args )
-{
-    rc_t rc = string_vprintf ( pbuffer, pbsize, NULL, fmt, args );
-    if ( rc == 0 )
-    {
-        /* tokenize the parameters into name/value pairs */
-        rc = logtokenizeparams(fmt, pbuffer, argc, argv, max_argc);
-    }
-    return rc;
-}
-
-static
-rc_t log_print( KFmtHandler* formatter, const KLogFmtFlags flags, KWrtHandler* writer,
-                KLogLevel lvl, bool use_rc, rc_t status, 
-                const char* msg, const char* fmt, va_list args )
-{
-    rc_t rc = 0;
-    char* nbuffer;
-    size_t num_writ, remaining;
-
-    uint32_t envc = 0;
-    wrt_nvp_t envs[20];
-    char ebuffer[2048];
-    uint32_t argc = 0;
-    wrt_nvp_t argv[32];
-    char pbuffer[4096];
-    char abuffer[4096];
-    KFmtWriter fmtwrt;
-    
-    assert(formatter != NULL);
-    assert(writer != NULL);
-
-    fmtwrt = formatter->formatter;
-    if( fmtwrt == NULL ) {
-        fmtwrt = KLogDefaultFormatter;
-    }
-    if( fmtwrt == KLogDefaultFormatter && writer->writer == NULL ) {
-        /* default formatting with NULL writer -> silence */
-        return rc;
-    }
-    nbuffer = (char*)ebuffer;
-    remaining = sizeof(ebuffer);
-    do {
-#define FIX_UP() if(rc){break;} remaining -= num_writ; nbuffer += num_writ
-        if( flags & (klogFmtTimestamp | klogFmtLocalTimestamp) ) {
-            if( flags & klogFmtLocalTimestamp ) {
-                rc = LogSimpleTimestamp(nbuffer, remaining, &num_writ);
-            } else {
-                rc = LogTimestamp(nbuffer, remaining, &num_writ);
-            }
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "timestamp";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & klogFmtSeverity ) {
-            rc = KLogLevelExplain(lvl, nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "severity";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & klogFmtPid ) {
-            rc = LogPID(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "pid";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & klogFmtAppName ) {
-            rc = LogAppName(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "app";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & klogFmtAppVersion ) {
-            rc = LogAppVersion(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "version";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( use_rc ) {
-            if( flags & klogFmtReason ) {
-                rc = RCExplain(status, nbuffer, remaining, &num_writ);
-                nbuffer[num_writ++] = '\0';
-                envs[envc].name = "reason";
-                envs[envc++].value = nbuffer;
-                FIX_UP();
-            }
-            if( flags & klogFmtReasonShort ) {
-                rc = RCExplain2(status, nbuffer, remaining, &num_writ, eRCExOpt_ObjAndStateOnlyIfError);
-                nbuffer[num_writ++] = '\0';
-                envs[envc].name = "reason_short";
-                envs[envc++].value = nbuffer;
-                FIX_UP();
-            }
-            if( flags & klogFmtRC ) {
-                rc = string_printf(nbuffer, remaining, & num_writ, "%R", status);
-                envs[envc].name = "rc";
-                envs[envc++].value = nbuffer;
-                FIX_UP();
-            }
-            if( flags & klogFmtModule ) {
-                envs[envc].name = "module";
-                envs[envc++].value = GetRCModuleIdxText(GetRCModule(status));
-            }
-            if( flags & klogFmtTarget ) {
-                envs[envc].name = "target";
-                envs[envc++].value = GetRCTargetIdxText(GetRCTarget(status));
-            }
-            if( flags & klogFmtContext ) {
-                envs[envc].name = "context";
-                envs[envc++].value = GetRCContextIdxText(GetRCContext(status));
-            }
-            if( flags & klogFmtObject ) {
-                envs[envc].name = "object";
-                envs[envc++].value = GetRCObjectIdxText(GetRCObject(status));
-            }
-            if( flags & klogFmtState ) {
-                envs[envc].name = "state";
-                envs[envc++].value = GetRCStateIdxText(GetRCState(status));
-            }
-            if( flags & klogFmtModuleText ) {
-                envs[envc].name = "module-text";
-                envs[envc++].value = GetRCModuleText(GetRCModule(status));
-            }
-            if( flags & klogFmtTargetText ) {
-                envs[envc].name = "target-text";
-                envs[envc++].value = GetRCTargetText(GetRCTarget(status));
-            }
-            if( flags & klogFmtContextText ) {
-                envs[envc].name = "context-text";
-                envs[envc++].value = GetRCContextText(GetRCContext(status));
-            }
-            if( flags & klogFmtObjectText ) {
-                envs[envc].name = "object-text";
-                envs[envc++].value = GetRCObjectText(GetRCObject(status));
-            }
-            if( flags & klogFmtStateText ) {
-                envs[envc].name = "state-text";
-                envs[envc++].value = GetRCStateText(GetRCState(status));
-            }
-        }
-#undef FIX_UP
-    } while(false);
-    /* env must have one spare element for message added text below */
-    if( rc == 0 && envc >= (sizeof(envs)/sizeof(envs[0])) ) {
-        rc = RC(rcRuntime, rcLog, rcLogging, rcTable, rcInsufficient);
-    }
-    nbuffer = (char*)abuffer;
-    remaining = sizeof(abuffer);
-    if( rc == 0 ) {
-        if( fmt != NULL ) {
-            rc = prep_v_args(&argc, argv, sizeof(argv)/sizeof(argv[0]) - 1, pbuffer, sizeof(pbuffer), fmt, args);
-        }
-        if( rc == 0 && (flags & klogFmtMessage) ) {
-            if( msg == NULL || msg[0] == '\0' ) {
-                msg = "empty log message";
-            }
-            do {
-                /* substitute parameters into message */
-                wrt_nvp_sort(envc, envs);
-                rc = logsubstituteparams(msg, argc, argv, envc, envs, nbuffer, remaining - 1, &num_writ);
-                if( GetRCState(rc) == rcInsufficient ) {
-                    if(nbuffer != abuffer) {
-                        free(nbuffer);
-                    }
-                    remaining += num_writ > remaining ? num_writ : remaining;
-                    nbuffer = malloc(remaining);
-                    if( nbuffer == NULL ) {
-                        rc = RC(rcRuntime, rcLog, rcLogging, rcMemory, rcExhausted);
-                    }
-                } else {
-                    if( rc == 0 ) {
-                        nbuffer[num_writ] = '\0';
-                        envs[envc].name = "message";
-                        envs[envc++].value = nbuffer;
-                    }
-                    break;
-                }
-            } while(rc == 0);
-        }
-    }
-    if( rc != 0 ) {
-        /* print reason for failure */
-        string_printf((char*)abuffer, sizeof(abuffer), &num_writ, "log failure: %R in '%s'", rc, msg);
-        envs[envc].name = "message";
-        envs[envc++].value = abuffer;
-    }
-
-    wrt_nvp_sort(envc, envs);
-
-    {
-        rc_t rc2 = fmtwrt(formatter->data, writer, argc, argv, envc, envs);
-        if( (rc2 == 0) && use_rc ) {
-            KLogLastErrorCodeSet(lvl, status);
-        }
-        if(nbuffer != abuffer) {
-            free(nbuffer);
-        }
-        return rc != 0 ? rc : rc2;
-    }
-}
-
-/* LogMsg
- *  makes an entry to the log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "msg" [ IN ] - NUL terminated string
- */
-
-LIB_EXPORT rc_t CC LogMsg ( KLogLevel lvl, const char *msg )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogFmtHandlerGet(), G_log_formatter_flags,
-                     KLogHandlerGet(), lvl, false, 0, msg, NULL, NULL );
-}
-
-LIB_EXPORT rc_t CC LogLibMsg ( KLogLevel lvl, const char *msg )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogLibFmtHandlerGet(), G_log_lib_formatter_flags, 
-                     KLogLibHandlerGet(), lvl, false, 0, msg, NULL, NULL );
-}
-
-
-/* LogErr
- *  reports an error to log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "status" [ IN ] - return code to be decoded
- *
- *  "msg" [ IN, NULL OKAY ] - optional NUL terminated message string
- */
-LIB_EXPORT rc_t CC LogErr ( KLogLevel lvl, rc_t status, const char *msg )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogFmtHandlerGet(), G_log_formatter_flags,
-                     KLogHandlerGet(), lvl, true, status, msg, NULL, NULL );
-}
-
-LIB_EXPORT rc_t CC LogLibErr ( KLogLevel lvl, rc_t status, const char *msg )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogLibFmtHandlerGet(), G_log_lib_formatter_flags,
-                     KLogLibHandlerGet(), lvl, true, status, msg, NULL, NULL );
-}
-
-/* vLogMsg
- *  makes a parameterized entry to the log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "msg" [ IN ] - NUL terminated string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-LIB_EXPORT rc_t CC vLogMsg ( KLogLevel lvl, const char *msg, const char *fmt, va_list args )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogFmtHandlerGet(), G_log_formatter_flags,
-                     KLogHandlerGet(), lvl, false, 0, msg, fmt, args );
-}
-
-LIB_EXPORT rc_t CC vLogLibMsg ( KLogLevel lvl, const char *msg, const char *fmt, va_list args )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogLibFmtHandlerGet(), G_log_lib_formatter_flags,
-                     KLogLibHandlerGet(), lvl, false, 0, msg, fmt, args );
-}
-
-/* vLogErr
- *  reports an error to log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "status" [ IN ] - return code to be decoded
- *
- *  "msg" [ IN ] - NUL terminated message string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-LIB_EXPORT rc_t CC vLogErr ( KLogLevel lvl, rc_t status, const char *msg, const char *fmt, va_list args )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    return log_print(KLogFmtHandlerGet(), G_log_formatter_flags,
-                     KLogHandlerGet(), lvl, true, status, msg, fmt, args );
-}
-
-LIB_EXPORT rc_t CC vLogLibErr ( KLogLevel lvl, rc_t status, const char *msg, const char *fmt, va_list args )
-{
-    if ( lvl > KLogLevelGet() )
-        return 0;
-    return log_print(KLogLibFmtHandlerGet(), G_log_lib_formatter_flags,
-                     KLogLibHandlerGet(), lvl, true, status, msg, fmt, args );
-}
-
-/* pLogErr
- *  reports an error to log file
- *
- *  "lvl" [ IN ] - severity of message
- *
- *  "status" [ IN ] - return code to be decoded
- *
- *  "msg" [ IN ] - NUL terminated message string with named parameters
- *
- *  "fmt" [ IN ] - NUL terminated format string, behaves according
- *  to standard printf-style formatting
- */
-LIB_EXPORT rc_t CC pLogErr ( KLogLevel lvl, rc_t status, const char *msg, const char *fmt, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    va_start ( args, fmt );
-    rc = vLogErr ( lvl, status, msg, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC pLogLibErr ( KLogLevel lvl, rc_t status, const char *msg, const char *fmt, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    if ( lvl > KLogLevelGet() )
-        return 0;
-
-    va_start ( args, fmt );
-    rc = vLogLibErr ( lvl, status, msg, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLogHandlerSetStdOut ( void )
-{
-    return KLogHandlerSet(KWrt_DefaultWriter, KWrt_DefaultWriterDataStdOut);
-}
-
-LIB_EXPORT rc_t CC KLogLibHandlerSetStdOut ( void )
-{
-    return KLogLibHandlerSet(KWrt_DefaultWriter, KWrt_DefaultWriterDataStdOut);
-}
-
-LIB_EXPORT rc_t CC KLogHandlerSetStdErr ( void )
-{
-    return KLogHandlerSet(KWrt_DefaultWriter, KWrt_DefaultWriterDataStdErr);
-}
-
-LIB_EXPORT rc_t CC KLogLibHandlerSetStdErr ( void )
-{
-    return KLogLibHandlerSet(KWrt_DefaultWriter, KWrt_DefaultWriterDataStdErr);
-}
-
-LIB_EXPORT rc_t CC KLogHandlerSet ( KWrtWriter writer, void * data )
-{
-    G_log_writer.writer = writer;
-    G_log_writer.data = data;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLogLibHandlerSet ( KWrtWriter writer, void * data )
-{
-    G_log_lib_writer.writer = writer;
-    G_log_lib_writer.data = data;
-    return 0;
-}
-
-LIB_EXPORT void * CC KLogDataGet ( void )
-{
-    return ( KLogHandlerGet()->data );
-}
-
-LIB_EXPORT void * CC KLogLibDataGet ( void )
-{
-    return ( KLogLibHandlerGet()->data );
-}
-
-LIB_EXPORT KWrtWriter CC KLogWriterGet ( void )
-{
-    return ( KLogHandlerGet()->writer );
-}
-
-LIB_EXPORT KWrtWriter CC KLogLibWriterGet ( void )
-{
-    return ( KLogLibHandlerGet()->writer );
-}
-
-LIB_EXPORT KWrtHandler * CC KLogHandlerGet ( void )
-{
-    return ( &G_log_writer );
-}
-
-LIB_EXPORT KWrtHandler * CC KLogLibHandlerGet ( void )
-{
-    return ( &G_log_lib_writer );
-}
-
-static const uint32_t log_dflt_opt = klogFmtTimestamp | klogFmtSeverity | klogFmtPid |
-                klogFmtMessage | klogFmtAppName | klogFmtAppVersion | klogFmtReason;
-
-LIB_EXPORT rc_t CC KLogFmtHandlerSetDefault ( void )
-{
-    rc_t rc = KLogFmtHandlerSet(KLogDefaultFormatter, 0, NULL);
-    if( rc == 0 ) {
-        G_log_formatter_flags = log_dflt_opt;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLogLibFmtHandlerSetDefault ( void )
-{
-    rc_t rc = KLogLibFmtHandlerSet(KLogDefaultFormatter, 0, NULL);
-    if( rc == 0 ) {
-        G_log_lib_formatter_flags = log_dflt_opt;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KLogFmtFlagsSet ( KLogFmtFlags flags )
-{
-    G_log_formatter_flags |= flags;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLogLibFmtFlagsSet ( KLogFmtFlags flags )
-{
-    G_log_lib_formatter_flags |= flags;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLogFmtHandlerSet ( KFmtWriter formatter, KLogFmtFlags flags, void* data )
-{
-    if( formatter == NULL ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcFunction, rcNull);
-    }
-    G_log_formatter.formatter = formatter;
-    G_log_formatter.data = data;
-    KLogFmtFlagsSet(flags);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLogLibFmtHandlerSet ( KFmtWriter formatter, KLogFmtFlags flags, void* data )
-{
-    if( formatter == NULL ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcFunction, rcNull);
-    }
-    G_log_lib_formatter.formatter = formatter;
-    G_log_lib_formatter.data = data;
-    KLogLibFmtFlagsSet(flags);
-    return 0;
-}
-
-LIB_EXPORT void * CC KLogFmtDataGet ( void )
-{
-    return ( KLogFmtHandlerGet()->data );
-}
-
-LIB_EXPORT void * CC KLogLibFmtDataGet ( void )
-{
-    return ( KLogFmtHandlerGet()->data );
-}
-
-LIB_EXPORT KFmtWriter CC KLogFmtWriterGet ( void )
-{
-    return ( KLogFmtHandlerGet()->formatter ? KLogFmtHandlerGet()->formatter : KLogDefaultFormatter );
-}
-
-LIB_EXPORT KFmtWriter CC KLogLibFmtWriterGet ( void )
-{
-    return ( KLogLibFmtHandlerGet()->formatter ? KLogLibFmtHandlerGet()->formatter : KLogDefaultFormatter );
-}
-
-LIB_EXPORT KFmtHandler * CC KLogFmtHandlerGet ( void )
-{
-    return ( &G_log_formatter );
-}
-
-LIB_EXPORT KFmtHandler * CC KLogLibFmtHandlerGet ( void )
-{
-    return ( &G_log_lib_formatter );
-}
-
-LIB_EXPORT KLogFmtFlags CC KLogFmtFlagsGet ( void )
-{
-    return G_log_formatter_flags;
-}
-
-LIB_EXPORT KLogFmtFlags CC KLogLibFmtFlagsGet ( void )
-{
-    return G_log_lib_formatter_flags;
-}
diff --git a/libs/klib/maybeswap.h b/libs/klib/maybeswap.h
deleted file mode 100644
index a6ba8d1..0000000
--- a/libs/klib/maybeswap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_maybeswap_
-#define _h_maybeswap_
-
-#if SWAP_PERSISTED
-
-#include <byteswap.h>
-
-#define GET16( x ) bswap_16 ( x )
-#define GET32( x ) bswap_32 ( x )
-#define GET64( x ) bswap_64 ( x )
-
-#else
-
-#define GET16( x ) ( * ( const uint16_t* ) & ( x ) ) 
-#define GET32( x ) ( * ( const uint32_t* ) & ( x ) ) 
-#define GET64( x ) ( * ( const uint64_t* ) & ( x ) ) 
-
-#endif
-
-#endif /* _h_maybeswap_ */
-
diff --git a/libs/klib/md5.c b/libs/klib/md5.c
deleted file mode 100644
index 4a717c6..0000000
--- a/libs/klib/md5.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
-  Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost at aladdin.com
-
-*/
-/*
-  Independent implementation of MD5 (RFC 1321).
-
-  This code implements the MD5 Algorithm defined in RFC 1321.
-  It is derived directly from the text of the RFC and not from the
-  reference implementation.
-
-  The original and principal author of md5.c is L. Peter Deutsch
-  <ghost at aladdin.com>.  Other authors are noted in the change history
-  that follows (in reverse chronological order):
-
-  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
-  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
-  1999-05-03 lpd Original version.
-*/
-
-/*
-  This software is derived from original work by Peter Deutsch.
-  It has been incorporated into a body of PUBLIC DOMAIN software
-  distributed by the National Center for Biotechnology Information.
-
-  Although all reasonable efforts have been taken to ensure the accuracy
-  and reliability of the software and data, the NLM and the U.S.
-  Government do not and cannot warrant the performance or results that
-  may be obtained by using this software or data. The NLM and the U.S.
-  Government disclaim all warranties, express or implied, including
-  warranties of performance, merchantability or fitness for any particular
-  purpose.
-*/
-
-#include <klib/extern.h>
-#include <klib/checksum.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#if ! defined __BYTE_ORDER || ! defined __LITTLE_ENDIAN
-#error "missing byte order definitions"
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * MD5
- *  taken from Peter Deutsch's sources due to simplicity
- */
-#define T_MASK ( ( uint32_t ) ~ 0 )
-
-/* MD5StateInit
- *  initialize the algorithm and state block
- */
-LIB_EXPORT void CC MD5StateInit ( MD5State *md5 )
-{
-    if ( md5 != NULL )
-    {
-        md5 -> count [ 0 ] = md5 -> count [ 1 ] = 0;
-        md5 -> abcd [ 0 ] = 0x67452301;
-        md5 -> abcd [ 1 ] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
-        md5 -> abcd [ 2 ] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
-        md5 -> abcd [ 3 ] = 0x10325476;
-        memset(md5->buf,0,sizeof(md5->buf));
-    }
-}
-
-/* MDStateProcess
- *  input is taken in blocks of little-endian 32 bit words
- *
- *  for big endian machines, this means data are copied
- *  and rearranged.
- *
- *  for little endian, data are copied if not properly aligned
- */
-#define T1 /* 0xd76aa478 */ ( T_MASK ^ 0x28955b87 )
-#define T2 /* 0xe8c7b756 */ ( T_MASK ^ 0x173848a9 )
-#define T3    0x242070db
-#define T4 /* 0xc1bdceee */ ( T_MASK ^ 0x3e423111 )
-#define T5 /* 0xf57c0faf */ ( T_MASK ^ 0x0a83f050 )
-#define T6    0x4787c62a
-#define T7 /* 0xa8304613 */ ( T_MASK ^ 0x57cfb9ec )
-#define T8 /* 0xfd469501 */ ( T_MASK ^ 0x02b96afe )
-#define T9    0x698098d8
-#define T10 /* 0x8b44f7af */ ( T_MASK ^ 0x74bb0850 )
-#define T11 /* 0xffff5bb1 */ ( T_MASK ^ 0x0000a44e )
-#define T12 /* 0x895cd7be */ ( T_MASK ^ 0x76a32841 )
-#define T13    0x6b901122
-#define T14 /* 0xfd987193 */ ( T_MASK ^ 0x02678e6c )
-#define T15 /* 0xa679438e */ ( T_MASK ^ 0x5986bc71 )
-#define T16    0x49b40821
-#define T17 /* 0xf61e2562 */ ( T_MASK ^ 0x09e1da9d )
-#define T18 /* 0xc040b340 */ ( T_MASK ^ 0x3fbf4cbf )
-#define T19    0x265e5a51
-#define T20 /* 0xe9b6c7aa */ ( T_MASK ^ 0x16493855 )
-#define T21 /* 0xd62f105d */ ( T_MASK ^ 0x29d0efa2 )
-#define T22    0x02441453
-#define T23 /* 0xd8a1e681 */ ( T_MASK ^ 0x275e197e )
-#define T24 /* 0xe7d3fbc8 */ ( T_MASK ^ 0x182c0437 )
-#define T25    0x21e1cde6
-#define T26 /* 0xc33707d6 */ ( T_MASK ^ 0x3cc8f829 )
-#define T27 /* 0xf4d50d87 */ ( T_MASK ^ 0x0b2af278 )
-#define T28    0x455a14ed
-#define T29 /* 0xa9e3e905 */ ( T_MASK ^ 0x561c16fa )
-#define T30 /* 0xfcefa3f8 */ ( T_MASK ^ 0x03105c07 )
-#define T31    0x676f02d9
-#define T32 /* 0x8d2a4c8a */ ( T_MASK ^ 0x72d5b375 )
-#define T33 /* 0xfffa3942 */ ( T_MASK ^ 0x0005c6bd )
-#define T34 /* 0x8771f681 */ ( T_MASK ^ 0x788e097e )
-#define T35    0x6d9d6122
-#define T36 /* 0xfde5380c */ ( T_MASK ^ 0x021ac7f3 )
-#define T37 /* 0xa4beea44 */ ( T_MASK ^ 0x5b4115bb )
-#define T38    0x4bdecfa9
-#define T39 /* 0xf6bb4b60 */ ( T_MASK ^ 0x0944b49f )
-#define T40 /* 0xbebfbc70 */ ( T_MASK ^ 0x4140438f )
-#define T41    0x289b7ec6
-#define T42 /* 0xeaa127fa */ ( T_MASK ^ 0x155ed805 )
-#define T43 /* 0xd4ef3085 */ ( T_MASK ^ 0x2b10cf7a )
-#define T44    0x04881d05
-#define T45 /* 0xd9d4d039 */ ( T_MASK ^ 0x262b2fc6 )
-#define T46 /* 0xe6db99e5 */ ( T_MASK ^ 0x1924661a )
-#define T47    0x1fa27cf8
-#define T48 /* 0xc4ac5665 */ ( T_MASK ^ 0x3b53a99a )
-#define T49 /* 0xf4292244 */ ( T_MASK ^ 0x0bd6ddbb )
-#define T50    0x432aff97
-#define T51 /* 0xab9423a7 */ ( T_MASK ^ 0x546bdc58 )
-#define T52 /* 0xfc93a039 */ ( T_MASK ^ 0x036c5fc6 )
-#define T53    0x655b59c3
-#define T54 /* 0x8f0ccc92 */ ( T_MASK ^ 0x70f3336d )
-#define T55 /* 0xffeff47d */ ( T_MASK ^ 0x00100b82 )
-#define T56 /* 0x85845dd1 */ ( T_MASK ^ 0x7a7ba22e )
-#define T57    0x6fa87e4f
-#define T58 /* 0xfe2ce6e0 */ ( T_MASK ^ 0x01d3191f )
-#define T59 /* 0xa3014314 */ ( T_MASK ^ 0x5cfebceb )
-#define T60    0x4e0811a1
-#define T61 /* 0xf7537e82 */ ( T_MASK ^ 0x08ac817d )
-#define T62 /* 0xbd3af235 */ ( T_MASK ^ 0x42c50dca )
-#define T63    0x2ad7d2bb
-#define T64 /* 0xeb86d391 */ ( T_MASK ^ 0x14792c6e )
-
-static
-void MD5StateProcess ( MD5State *md5, const uint8_t *data /* [ 64 ] */ ) 
-{
-    uint32_t t;
-
-    uint32_t a = md5 -> abcd [ 0 ];
-    uint32_t b = md5 -> abcd [ 1 ];
-    uint32_t c = md5 -> abcd [ 2 ];
-    uint32_t d = md5 -> abcd [ 3 ];
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-    uint32_t xbuf [ 16 ];
-
-    /* assume proper alignment */
-    const uint32_t *X = ( const uint32_t* ) data;
-
-    /* check alignment */
-    if ( ( ( size_t ) X & 3 ) != 0 )
-    {
-        /* use buffer instead */
-        X = xbuf;
-        memcpy ( xbuf, data, 64 );
-    }
-
-#elif __BYTE_ORDER == __BIG_ENDIAN
-
-    int i;
-    uint32_t X [ 16 ];
-    if ( ( ( size_t ) data & 3 ) == 0 )
-    {
-        const uint32_t *xp = ( const uint32_t* ) data;
-        for ( i = 0; i < 16; ++ i )
-            X [ i ] = bswap_32 ( xp [ i ] );
-    }
-
-    else
-    {
-        const uint8_t *xp = data;
-        for ( i = 0; i < 16; xp += 4, ++ i ) 
-            X [ i ] = xp [ 0 ] + ( xp [ 1 ] << 8 ) + ( xp [ 2 ] << 16 ) + ( xp [ 3 ] << 24 );
-    }
-
-#else
-#error "only big or little endian is supported"
-#endif
-
-#define ROTATE_LEFT( x, n ) \
-    ( ( ( x ) << ( n ) ) | ( ( x ) >> ( 32 - ( n ) ) ) ) 
-
-    /* Round 1. */
-    /* Let  [ abcd k s i ] denote the operation
-       a = b + ( ( a + F ( b,c,d ) + X [ k ] + T [ i ] ) <<< s ) . */
-#define F( x, y, z ) \
-    ( ( ( x ) & ( y ) ) | ( ~ ( x ) & ( z ) ) ) 
-#define SET( a, b, c, d, k, s, Ti ) \
-    t = a + F ( b,c,d ) + X [ k ] + Ti;\
-    a = ROTATE_LEFT ( t, s ) + b
-
-    /* Do the following 16 operations. */
-    SET ( a, b, c, d,  0,  7,  T1 );
-    SET ( d, a, b, c,  1, 12,  T2 );
-    SET ( c, d, a, b,  2, 17,  T3 );
-    SET ( b, c, d, a,  3, 22,  T4 );
-    SET ( a, b, c, d,  4,  7,  T5 );
-    SET ( d, a, b, c,  5, 12,  T6 );
-    SET ( c, d, a, b,  6, 17,  T7 );
-    SET ( b, c, d, a,  7, 22,  T8 );
-    SET ( a, b, c, d,  8,  7,  T9 );
-    SET ( d, a, b, c,  9, 12, T10 );
-    SET ( c, d, a, b, 10, 17, T11 );
-    SET ( b, c, d, a, 11, 22, T12 );
-    SET ( a, b, c, d, 12,  7, T13 );
-    SET ( d, a, b, c, 13, 12, T14 );
-    SET ( c, d, a, b, 14, 17, T15 );
-    SET ( b, c, d, a, 15, 22, T16 );
-#undef SET
-#undef F
-
-    /* Round 2. */
-    /* Let  [ abcd k s i ] denote the operation
-       a = b + ( ( a + G ( b,c,d ) + X [ k ] + T [ i ] ) <<< s ) . */
-#define G( x, y, z ) \
-    ( ( ( x ) & ( z ) ) | ( ( y ) & ~ ( z ) ) ) 
-#define SET( a, b, c, d, k, s, Ti ) \
-    t = a + G ( b,c,d ) + X [ k ] + Ti;\
-    a = ROTATE_LEFT ( t, s ) + b
-
-    /* Do the following 16 operations. */
-    SET ( a, b, c, d,  1,  5, T17 );
-    SET ( d, a, b, c,  6,  9, T18 );
-    SET ( c, d, a, b, 11, 14, T19 );
-    SET ( b, c, d, a,  0, 20, T20 );
-    SET ( a, b, c, d,  5,  5, T21 );
-    SET ( d, a, b, c, 10,  9, T22 );
-    SET ( c, d, a, b, 15, 14, T23 );
-    SET ( b, c, d, a,  4, 20, T24 );
-    SET ( a, b, c, d,  9,  5, T25 );
-    SET ( d, a, b, c, 14,  9, T26 );
-    SET ( c, d, a, b,  3, 14, T27 );
-    SET ( b, c, d, a,  8, 20, T28 );
-    SET ( a, b, c, d, 13,  5, T29 );
-    SET ( d, a, b, c,  2,  9, T30 );
-    SET ( c, d, a, b,  7, 14, T31 );
-    SET ( b, c, d, a, 12, 20, T32 );
-#undef SET
-#undef G
-
-    /* Round 3. */
-    /* Let  [ abcd k s t ] denote the operation
-       a = b + ( ( a + H ( b,c,d ) + X [ k ] + T [ i ] ) <<< s ) . */
-#define H( x, y, z ) \
-    ( ( x ) ^ ( y ) ^ ( z ) ) 
-#define SET( a, b, c, d, k, s, Ti ) \
-    t = a + H ( b,c,d ) + X [ k ] + Ti;\
-    a = ROTATE_LEFT ( t, s ) + b
-    
-    /* Do the following 16 operations. */
-    SET ( a, b, c, d,  5,  4, T33 );
-    SET ( d, a, b, c,  8, 11, T34 );
-    SET ( c, d, a, b, 11, 16, T35 );
-    SET ( b, c, d, a, 14, 23, T36 );
-    SET ( a, b, c, d,  1,  4, T37 );
-    SET ( d, a, b, c,  4, 11, T38 );
-    SET ( c, d, a, b,  7, 16, T39 );
-    SET ( b, c, d, a, 10, 23, T40 );
-    SET ( a, b, c, d, 13,  4, T41 );
-    SET ( d, a, b, c,  0, 11, T42 );
-    SET ( c, d, a, b,  3, 16, T43 );
-    SET ( b, c, d, a,  6, 23, T44 );
-    SET ( a, b, c, d,  9,  4, T45 );
-    SET ( d, a, b, c, 12, 11, T46 );
-    SET ( c, d, a, b, 15, 16, T47 );
-    SET ( b, c, d, a,  2, 23, T48 );
-#undef SET
-#undef H
-
-    /* Round 4. */
-    /* Let  [ abcd k s t ] denote the operation
-       a = b + ( ( a + I ( b,c,d ) + X [ k ] + T [ i ] ) <<< s ) . */
-#define I( x, y, z )                            \
-    ( ( y ) ^ ( ( x ) | ~ ( z ) ) ) 
-#define SET( a, b, c, d, k, s, Ti ) \
-    t = a + I ( b,c,d ) + X [ k ] + Ti;\
-    a = ROTATE_LEFT ( t, s ) + b
-
-    /* Do the following 16 operations. */
-    SET ( a, b, c, d,  0,  6, T49 );
-    SET ( d, a, b, c,  7, 10, T50 );
-    SET ( c, d, a, b, 14, 15, T51 );
-    SET ( b, c, d, a,  5, 21, T52 );
-    SET ( a, b, c, d, 12,  6, T53 );
-    SET ( d, a, b, c,  3, 10, T54 );
-    SET ( c, d, a, b, 10, 15, T55 );
-    SET ( b, c, d, a,  1, 21, T56 );
-    SET ( a, b, c, d,  8,  6, T57 );
-    SET ( d, a, b, c, 15, 10, T58 );
-    SET ( c, d, a, b,  6, 15, T59 );
-    SET ( b, c, d, a, 13, 21, T60 );
-    SET ( a, b, c, d,  4,  6, T61 );
-    SET ( d, a, b, c, 11, 10, T62 );
-    SET ( c, d, a, b,  2, 15, T63 );
-    SET ( b, c, d, a,  9, 21, T64 );
-#undef SET
-#undef I
-
-    /* Then perform the following additions. ( That is increment each
-       of the four registers by the value it had before this block
-       was started. ) */
-    md5 -> abcd [ 0 ] += a;
-    md5 -> abcd [ 1 ] += b;
-    md5 -> abcd [ 2 ] += c;
-    md5 -> abcd [ 3 ] += d;
-}
-
-
-/* MD5StateAppend
- *  run MD5 on data block
- *  accumulate results into "md5"
- *  processes data in chunks
- */
-LIB_EXPORT void CC MD5StateAppend ( MD5State *md5, const void *data, size_t size  ) 
-{
-    if ( md5 != NULL && data != NULL && size > 0 )
-    {
-        const uint8_t *p = data;
-        size_t left = size;
-        size_t offset = ( md5 -> count [ 0 ] >> 3 ) & 63;
-        uint32_t nbits = ( uint32_t ) ( size << 3 );
-
-        /* update the message length. */
-        md5 -> count [ 1 ] += ( uint32_t ) size >> 29;
-        md5 -> count [ 0 ] += nbits;
-
-        /* detect roll-over */
-        if ( md5 -> count [ 0 ] < nbits ) 
-            ++ md5 -> count [ 1 ];
-
-        /* process an initial partial block. */
-        if ( offset )
-        {
-            /* bytes to copy from input data are from offset up to 64 */
-            size_t copy = ( offset + size > 64 ? 64 - offset : size );
-            memcpy ( md5 -> buf + offset, p, copy );
-
-            /* don't process a tiny partial block */
-            if ( offset + copy < 64 ) 
-                return;
-
-            /* trim off initial bytes */
-            p += copy;
-            left -= copy;
-
-            /* process full state buffer */
-            MD5StateProcess ( md5, md5 -> buf );
-        }
-
-        /* continue processing blocks directly from input */
-        for ( ; left >= 64; p += 64, left -= 64 ) 
-            MD5StateProcess ( md5, p );
-
-        /* buffer any remainder */
-        if ( left ) 
-            memcpy ( md5 -> buf, p, left );
-    }
-}
-
-/* MD5StateFinish
- *  processes any remaining data in "md5"
- *  returns 16 bytes of digest
- */
-LIB_EXPORT void CC MD5StateFinish ( MD5State *md5, uint8_t digest  [ 16 ] ) 
-{
-    if ( md5 != NULL )
-    {
-        int i;
-        uint8_t data [ 8 ];
-        static const uint8_t pad [ 64 ] = {
-            0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-        };
-
-        /* save the length before padding in little-endian order */
-        for ( i = 0; i < 8; ++ i ) 
-            data [ i ] = ( uint8_t ) ( md5 -> count [ i >> 2 ] >> ( ( i & 3 ) << 3 ) );
-
-        /* Pad to 56 bytes mod 64. */
-        MD5StateAppend ( md5, pad, ( ( 55 - ( md5 -> count [ 0 ] >> 3 ) ) & 63 ) + 1 );
-
-        /* Append the length. */
-        MD5StateAppend ( md5, data, 8 );
-
-        /* create digest */
-        for ( i = 0; i < 16; ++ i ) 
-            digest [ i ] = ( uint8_t ) ( md5 -> abcd [ i >> 2 ] >> ( ( i & 3 ) << 3 ) );
-    }
-}
diff --git a/libs/klib/namelist.c b/libs/klib/namelist.c
deleted file mode 100644
index 4806d4c..0000000
--- a/libs/klib/namelist.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/rc.h>
-#include <klib/impl.h>
-#include <sysalloc.h>
-
-#define KNAMELIST_LATEST 1
-
-/*--------------------------------------------------------------------------
- * KNamelist
- *  a simple array of entry names
- */
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KNamelistAddRef ( const KNamelist *self )
-{
-    if ( self != NULL )
-        atomic_inc ( & ( ( KNamelist* ) self ) -> refcount );
-    return 0;
-}
-
-/* Release
- *  discard reference to list
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KNamelistRelease ( const KNamelist *cself )
-{
-    KNamelist *self = ( KNamelist* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic_dec_and_test ( & self -> refcount ) )
-        {
-            rc_t status;
-            switch ( self -> vt -> v1 . maj )
-            {
-            case 1:
-                status = ( * self -> vt -> v1 . destroy ) ( self );
-                break;
-            default:
-                status = RC ( rcCont, rcNamelist, rcReleasing, rcInterface, rcBadVersion );
-            }
-
-            if ( status != 0 )
-                atomic_set ( & self -> refcount, 1 );
-
-            return status;
-        }
-    }
-    return 0;
-}
-
-/* Count
- *  returns the number of entries
- *
- *  "count" [ OUT ] - return parameter for entry count
- */
-LIB_EXPORT rc_t CC KNamelistCount ( const KNamelist *self, uint32_t *count )
-{
-    if ( count == NULL )
-        return RC ( rcCont, rcNamelist, rcAccessing, rcParam, rcNull );
-
-    * count = 0;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcNamelist, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . count ) ( self, count );
-    }
-
-    return RC ( rcCont, rcNamelist, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* Get
- *  get an indexed name
- *
- *  "idx" [ IN ] - a zero-based name index
- *
- *  "name" [ OUT ] - return parameter for NUL terminated name
- */
-LIB_EXPORT rc_t CC KNamelistGet ( const KNamelist *self,
-    uint32_t idx, const char **name )
-{
-    if ( name == NULL )
-        return RC ( rcCont, rcNamelist, rcAccessing, rcParam, rcNull );
-
-    * name = NULL;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcNamelist, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . get ) ( self, idx, name );
-    }
-
-    return RC ( rcCont, rcNamelist, rcAccessing, rcInterface, rcBadVersion );
-}
-
-/* Init
- *  polymorphic parent constructor
- */
-LIB_EXPORT rc_t CC KNamelistInit ( KNamelist *self, const KNamelist_vt *vt )
-{
-    if ( self == NULL || vt == NULL )
-        return RC ( rcCont, rcNamelist, rcConstructing, rcSelf, rcNull );
-
-    if ( vt -> v1 . maj == 0 )
-        return RC ( rcCont, rcNamelist, rcConstructing, rcInterface, rcInvalid );
-
-    if ( vt -> v1 . maj > KNAMELIST_LATEST )
-        return RC ( rcCont, rcNamelist, rcConstructing, rcInterface, rcBadVersion );
-
-    self -> vt = vt;
-    atomic_set ( & self -> refcount, 1 );
-
-    return 0;
-}
diff --git a/libs/klib/out.c b/libs/klib/out.c
deleted file mode 100644
index 4e1b0de..0000000
--- a/libs/klib/out.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include <klib/extern.h>
-#include <klib/out.h>
-#include "writer-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdarg.h>
-
-LIB_EXPORT KWrtHandler G_out_handler;
-
-LIB_EXPORT rc_t CC KOutInit ( void )
-{
-    rc_t rc;
-
-    rc = KOutHandlerSetStdOut();
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KOutMsg ( const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    if( (rc = vkfprintf(KOutHandlerGet(), NULL, fmt, args)) != 0 ) {
-        kfprintf(KOutHandlerGet(), NULL, "outmsg failure: %R in '%s'\n", rc, fmt);
-    }
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* kprintf
- *  performs a printf to our output writer
- *  much like KOutMsg, but returns a size_t
- */
-LIB_EXPORT rc_t CC kprintf ( size_t *num_writ, const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = vkfprintf ( KOutHandlerGet (), num_writ, fmt, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC vkprintf ( size_t *num_writ, const char * fmt, va_list args )
-{
-    return vkfprintf ( KOutHandlerGet (), num_writ, fmt, args );
-}
-
-
-#undef KOutHandlerSetStdOut
-LIB_EXPORT rc_t CC KOutHandlerSetStdOut ( void )
-{
-    return KOutHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdOut );
-}
-
-
-#undef KOutHandlerSetStdErr
-LIB_EXPORT rc_t CC KOutHandlerSetStdErr ( void )
-{
-    return KOutHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdErr );
-}
-
-
-#undef KOutHandlerSet
-LIB_EXPORT rc_t CC KOutHandlerSet ( KWrtWriter writer, void * writer_data )
-{
-    G_out_handler.writer = writer;
-    G_out_handler.data = writer_data;
-    return 0;
-}
-
-
-#undef KOutDataGet
-LIB_EXPORT void * CC KOutDataGet ( void )
-{
-    return ( KOutHandlerGet()->data );
-}
-
-
-#undef KOutWriterGet
-LIB_EXPORT KWrtWriter CC KOutWriterGet ( void )
-{
-    return ( KOutHandlerGet()->writer );
-}
-
-
-#undef KOutHandlerGet
-LIB_EXPORT KWrtHandler * CC KOutHandlerGet ( void )
-{
-    return ( &G_out_handler );
-}
diff --git a/libs/klib/pack.c b/libs/klib/pack.c
deleted file mode 100644
index 0b8285a..0000000
--- a/libs/klib/pack.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/pack.h>
-#include <klib/rc.h>
-#include <arch-impl.h>
-#include <sysalloc.h>
-
-#include <endian.h>
-#include <byteswap.h>
-#include <string.h>
-#include <assert.h>
-
-#if ! defined __LITTLE_ENDIAN && ! defined __BIG_ENDIAN
-#error "only little and big endian architectures are supported"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * pack
- */
-#define MASK_SRC 0
-
-/* READ_UNPACKED
- *  macro to read source elements into register
- *  casts source pointer to appropriate type
- *  performs byte swap if necessary to ensure that
- *    elements are in reverse order
- */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define READ_UNPACKED8( src, idx ) \
-    ( ( const uint32_t* ) ( src ) ) [ idx ]
-#else
-#define READ_UNPACKED8( src, idx ) \
-    bswap_32 ( ( ( const uint32_t* ) ( src ) ) [ idx ] )
-#endif
-
-#define READ_UNPACKED16( src, idx ) \
-    ( ( const uint16_t* ) ( src ) ) [ idx ]
-
-#define READ_UNPACKED32( src, idx ) \
-    ( ( const uint32_t* ) ( src ) ) [ idx ]
-
-#define READ_UNPACKED64( src, idx ) \
-    ( ( const uint64_t* ) ( src ) ) [ idx ]
-
-/* MASK
- *  macro to mask off portion of source register
- */
-#if MASK_SRC
-
-#define MASK8( in ) \
-    ( in ) & src_mask
-#define MASK16( in ) \
-    ( in ) & src_mask
-#define MASK32( in ) \
-    ( in ) & src_mask
-#define MASK64( in ) \
-    ( in ) & src_mask
-
-#else
-
-#define MASK8( in ) \
-    ( uint8_t ) ( in )
-#define MASK16( in ) \
-    ( uint16_t ) ( in )
-#define MASK32( in ) \
-    ( uint32_t ) ( in )
-#define MASK64( in ) \
-    ( uint64_t ) ( in )
-
-#endif
-
-
-/* WRITE_PACKED
- *  macro to write dest elements from accumulator
- *  casts dest pointer to appropriate type
- *  performs byte swap if necessary to ensure that
- *    elements are in stream order
- */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define WRITE_PACKED32( acc, dst, idx ) \
-    ( ( uint32_t* ) ( dst ) ) [ idx ] = bswap_32 ( ( uint32_t ) ( acc ) )
-#define WRITE_PACKED64( acc, dst, idx ) \
-    ( ( uint64_t* ) ( dst ) ) [ idx ] = bswap_64 ( ( uint64_t ) ( acc ) )
-#else
-#define WRITE_PACKED32( acc, dst, idx ) \
-    ( ( uint32_t* ) ( dst ) ) [ idx ] = ( uint32_t ) ( acc )
-#define WRITE_PACKED64( acc, dst, idx ) \
-    ( ( uint64_t* ) ( dst ) ) [ idx ] = ( uint64_t ) ( acc )
-#endif
-
-/* Pack8
- */
-static
-void Pack8 ( uint32_t packed, void *dst, const void *src, uint32_t count )
-{
-    /* accumulator */
-    uint64_t acc;
-    uint32_t abits;
-
-    /* loop indices */
-    uint32_t s, d, cnt;
-
-#if MASK_SRC
-    uint32_t src_mask = ( 1 << packed ) - 1;
-#endif
-
-    for ( acc = 0, abits = s = d = 0, cnt = count >> 2; s < cnt; ++ s )
-    {
-        /* get 4 bytes in reverse order, i.e.
-           bits 0-7 are src[0], bits 8-15 are src[1], etc. */
-        uint32_t in = READ_UNPACKED8 ( src, s );
-
-        /* pack the bytes into our accumulator */
-        acc <<= packed;
-        acc |= MASK8 ( in );
-
-        /* account for activity */
-        abits += packed;
-        in >>= 8;
-
-        /* detect need to dump accumulator */
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-
-        /* repeat for remaining 3 source bytes */
-        acc <<= packed;
-        acc |= MASK8 ( in );
-        abits += packed;
-        in >>= 8;
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-
-        acc <<= packed;
-        acc |= MASK8 ( in );
-        abits += packed;
-        in >>= 8;
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-
-        acc <<= packed;
-        acc |= MASK8 ( in );
-        abits += packed;
-        in >>= 8;
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-    }
-
-    /* handle remaining src bytes */
-    for ( s <<= 2; s < count; ++ s )
-    {
-        acc <<= packed;
-        acc |= MASK8 ( ( ( const uint8_t* ) src ) [ s ] );
-        abits += packed;
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-    }
-
-    /* handle remaining accumulator bits */
-    if ( abits != 0 )
-    {
-        uint32_t out = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-        abits = ( abits + 7 ) >> 3;
-        for ( d <<= 2; abits != 0; -- abits, out >>= 8, ++ d )
-            ( ( uint8_t* ) dst ) [ d ] = ( uint8_t ) out;
-    }
-}
-
-/* Pack16
- */
-static
-void Pack16 ( uint32_t packed, void *dst, const void *src, uint32_t count )
-{
-    /* accumulator */
-    uint64_t acc;
-    uint32_t abits;
-
-    /* loop indices */
-    uint32_t s, d;
-
-#if MASK_SRC
-    uint32_t src_mask = ( 1 << packed ) - 1;
-#endif
-
-    for ( acc = 0, abits = d = s = 0; s < count; ++ s )
-    {
-        /* get 2 bytes in native order */
-        uint32_t in = READ_UNPACKED16 ( src, s );
-
-        /* pack the bytes into our accumulator */
-        acc <<= packed;
-        acc |= MASK16 ( in );
-
-        /* account for activity */
-        abits += packed;
-
-        /* detect need to dump accumulator */
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-    }
-
-    /* handle remaining accumulator bits */
-    if ( abits != 0 )
-    {
-        uint32_t out = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-        abits = ( abits + 7 ) >> 3;
-        for ( d <<= 2; abits != 0; -- abits, out >>= 8, ++ d )
-            ( ( uint8_t* ) dst ) [ d ] = ( uint8_t ) out;
-    }
-}
-
-/* Pack32
- */
-static
-void Pack32 ( uint32_t packed, void *dst, const void *src, uint32_t count )
-{
-    /* accumulator */
-    uint64_t acc;
-    uint32_t abits;
-
-    /* loop indices */
-    uint32_t s, d;
-
-#if MASK_SRC
-    uint32_t src_mask = ( 1 << packed ) - 1;
-#endif
-
-    for ( acc = 0, abits = d = s = 0; s < count; ++ s )
-    {
-        /* get 4 bytes in native order */
-        uint32_t in = READ_UNPACKED32 ( src, s );
-
-        /* pack the bytes into our accumulator */
-        acc <<= packed;
-        acc |= MASK32 ( in );
-
-        /* account for activity */
-        abits += packed;
-
-        /* detect need to dump accumulator */
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-    }
-
-    /* handle remaining accumulator bits */
-    if ( abits != 0 )
-    {
-        uint32_t out = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-        abits = ( abits + 7 ) >> 3;
-        for ( d <<= 2; abits != 0; -- abits, out >>= 8, ++ d )
-            ( ( uint8_t* ) dst ) [ d ] = ( uint8_t ) out;
-    }
-}
-
-/* Pack64a
- *  source is 64 bits, packed <= 32 bits
- */
-static
-void Pack64a ( uint32_t packed, void *dst, const void *src, uint32_t count )
-{
-    /* accumulator */
-    uint64_t acc;
-    uint32_t abits;
-
-    /* loop indices */
-    uint32_t s, d;
-
-#if MASK_SRC
-    uint64_t src_mask = ( 1 << packed ) - 1;
-#endif
-
-    for ( acc = 0, abits = d = s = 0; s < count; ++ s )
-    {
-        /* get 8 bytes in native order */
-        uint64_t in = READ_UNPACKED64 ( src, s );
-
-        /* pack the bytes into our accumulator */
-        acc <<= packed;
-        acc |= MASK32 ( in );
-
-        /* account for activity */
-        abits += packed;
-
-        /* detect need to dump accumulator */
-        if ( abits >= 32 )
-        {
-            abits -= 32;
-            WRITE_PACKED32 ( acc >> abits, dst, d ++ );
-        }
-    }
-
-    /* handle remaining accumulator bits */
-    if ( abits != 0 )
-    {
-        uint32_t out = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-        abits = ( abits + 7 ) >> 3;
-        for ( d <<= 2; abits != 0; -- abits, out >>= 8, ++ d )
-            ( ( uint8_t* ) dst ) [ d ] = ( uint8_t ) out;
-    }
-}
-
-/* Pack64b
- *  source is 64 bits, packed > 32 bits
- */
-static
-void Pack64b ( uint32_t packed, void *dst, const void *src, uint32_t count )
-{
-    /* accumulator */
-    uint128_t acc;
-    uint32_t abits;
-
-    /* loop indices */
-    uint32_t s, d;
-
-#if MASK_SRC
-    uint64_t src_mask = ( ( uint64_t ) 1U << packed ) - 1;
-#endif
-
-    for ( abits = d = s = 0; s < count; ++ s )
-    {
-        /* get 8 bytes in native order */
-        uint64_t in = READ_UNPACKED64 ( src, s );
-
-        /* pack the bytes into our accumulator */
-        uint128_shl ( & acc, packed );
-        uint128_orlo ( & acc, MASK64 ( in ) );
-
-        /* account for activity */
-        abits += packed;
-
-        /* detect need to dump accumulator */
-        if ( abits >= 64 )
-        {
-            uint64_t save = uint128_lo ( & acc );
-            abits -= 64;
-            uint128_shr ( & acc, abits );
-            WRITE_PACKED64 ( uint128_lo ( & acc ), dst, d ++ );
-            uint128_setlo ( & acc, save );
-        }
-    }
-
-    /* handle remaining accumulator bits */
-    if ( abits != 0 )
-    {
-        uint64_t out;
-        uint128_shl ( & acc, 64 - abits );
-        out = bswap_64 ( uint128_lo ( & acc ) );
-        abits = ( abits + 7 ) & ~ 7;
-        for ( d <<= 3, out >>= 64 - abits; abits != 0; abits -= 8, out >>= 8, ++ d )
-            ( ( uint8_t* ) dst ) [ d ] = ( uint8_t ) out;
-    }
-}
-
-/* Pack
- *  accepts a series of unpacked source bits
- *  produces a series of packed destination bits by eliminating MSB
- *
- *  "unpacked" [ IN ] - original element size in bits
- *  must be in 2^^[3..6], i.e. { 8, 16, 32, 64 }
- *
- *  "packed" [ IN ] - packed element size in bits
- *  must be <= "unpacked"
- *
- *  "src" [ IN ] and "ssize" [ IN ] - source buffer
- *  with size given in bytes
- *
- *  "consumed" [ OUT, NULL OKAY ] - number of source bytes
- *  consumed. if NULL, then all source bytes MUST be consumed
- *  or an error will be generated.
- *
- *  "dst" [ OUT ] and "dst_off" [ IN ] - destination
- *  buffer bit address
- *
- *  "dsize" [ IN ] - size of "dst" in bits, not including "dst_off"
- *
- *  "psize" [ OUT ] - resultant packed size in bits
- *
- * NB - the implementation may allow packing in place
- */
-LIB_EXPORT rc_t CC Pack ( uint32_t unpacked, uint32_t packed,
-    const void *src, size_t ssize, size_t *consumed,
-    void *dst, bitsz_t dst_off, bitsz_t dsize, bitsz_t *psize )
-{
-    /* prepare for failure */
-    if ( consumed != NULL )
-        * consumed = 0;
-
-    /* validate output param */
-    if ( psize == NULL )
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcNull );
-    * psize = 0;
-
-    /* require power of 2 with value between 8 and 64 */
-    if ( ( ( unpacked - 1 ) & unpacked ) != 0 ||
-         unpacked < 8 || unpacked > 64 )
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcInvalid );
-
-    /* validate remaining params */
-    if ( unpacked < packed )
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcInvalid );
-
-    if ( packed == 0 )
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcInvalid );
-
-    if ( ssize == 0 )
-        return 0;
-
-    if ( src == NULL )
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcNull );
-
-    /* detect a byte size so large it can't be converted to bits */
-    if ( ( ssize & ( ( size_t ) 7 << ( sizeof ssize * 8 - 3 ) ) ) != 0 )
-        return RC ( rcXF, rcBuffer, rcPacking, rcBuffer, rcExcessive );
-
-    /* required destination buffer size */
-    * psize = ( ( ssize << 3 ) / unpacked ) * packed;
-
-    if ( dsize < * psize )
-    {
-        if ( consumed == NULL )
-            return RC ( rcXF, rcBuffer, rcPacking, rcBuffer, rcInsufficient );
-
-        ssize = ( dsize / packed ) * ( unpacked >> 3 );
-        * psize = ( ( ssize << 3 ) / unpacked ) * packed;
-    }
-
-    if ( dst == NULL )
-    {
-        * psize = 0;
-        return RC ( rcXF, rcBuffer, rcPacking, rcParam, rcNull );
-    }
-
-    /* all parameters are validated */
-    dst = & ( ( char* ) dst ) [ dst_off >> 3 ];
-    dst_off &= 7;
-
-    if ( consumed != NULL )
-        * consumed = ssize;
-
-    if ( unpacked == 8 && packed == 8 && dst_off == 0 )
-    {
-        if ( ( const void* ) dst != src )
-            memcpy ( dst, src, ssize );
-        return 0;
-    }
-
-    /* TBD - enable packing into existing buffers */
-    if ( dst_off != 0 )
-        return RC ( rcXF, rcBuffer, rcPacking, rcOffset, rcUnsupported );
-
-    switch ( unpacked )
-    {
-    case 8:
-        Pack8 ( packed, dst, src, ( uint32_t ) ssize );
-        break;
-    case 16:
-        Pack16 ( packed, dst, src, ( uint32_t ) ( ssize >> 1 ) );
-        break;
-    case 32:
-        Pack32 ( packed, dst, src, ( uint32_t ) ( ssize >> 2 ) );
-        break;
-    case 64:
-        if ( packed > 32 )
-            Pack64b ( packed, dst, src, ( uint32_t ) ( ssize >> 3 ) );
-        else
-            Pack64a ( packed, dst, src, ( uint32_t ) ( ssize >> 3 ) );
-        break;
-    }
-
-    return 0;
-}
diff --git a/libs/klib/pbstree-impl.c b/libs/klib/pbstree-impl.c
deleted file mode 100644
index c6ebf19..0000000
--- a/libs/klib/pbstree-impl.c
+++ /dev/null
@@ -1,813 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "pbstree-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include "maybeswap.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * PBSTreeImpl
- *  a flattened b-tree
- */
-
-/* Count
- *  returns number of elements in b-tree
- */
-static
-uint32_t CC PBSTreeImplCount ( const PBSTree *self )
-{
-    return GET32 ( self -> pt -> num_nodes );
-}
-
-/* Depth
- *  returns number of layers in b-tree
- */
-static
-uint32_t CC PBSTreeImplDepth ( const PBSTree *self )
-{
-    uint32_t depth, num_nodes;
-
-    num_nodes = GET32 ( self -> pt -> num_nodes );
-
-    for ( depth = 0; num_nodes != 0; ++ depth )
-        num_nodes >>= 1;
-
-    return depth;
-}
-
-/* Size
- *  returns the size in bytes
- *  of the PBSTree image
- */
-static
-size_t CC PBSTreeImplSize ( const PBSTree *oself )
-{
-    size_t bytes;
-    const P_BSTree *self = oself -> pt;
-
-    bytes = GET32( self -> num_nodes );
-    if (bytes == 0) /* empty tree */
-        return sizeof self -> num_nodes;
-
-    if ( GET32( self -> data_size ) > 256 )
-    {
-        if ( GET32( self -> data_size ) <= 65536 )
-            bytes += bytes;
-        else
-            bytes <<= 2;
-    }
-
-    return sizeof * self - sizeof self -> data_idx +
-        bytes + GET32( self -> data_size );
-}
-
-/* GetNodeData
- *  finds node data boundaries
- */
-static
-rc_t CC PBSTreeImplGetNodeData8 ( const PBSTree *oself,
-    const void **addr, size_t *size, uint32_t id )
-{
-    const P_BSTree *self = oself -> pt;
-
-    uint32_t num_nodes;
-    const uint8_t *data_start;
-    uint32_t off, end;
-
-    num_nodes = GET32( self -> num_nodes );
-    end = GET32 ( self -> data_size );
-
-    if ( id == 0 )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNull );
-    if ( id > num_nodes )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNotFound );
-
-    data_start = ( const uint8_t* )
-      & self -> data_idx . v8 [ num_nodes ];
-    off = self -> data_idx . v8 [ id - 1 ];
-    if ( id != num_nodes )
-      end = self -> data_idx . v8 [ id ];
-
-    * addr = & data_start [ off ];
-    * size = end - off;
-    return 0;
-}
-
-static
-rc_t CC PBSTreeImplGetNodeData16 ( const PBSTree *oself,
-    const void **addr, size_t *size, uint32_t id )
-{
-    const P_BSTree *self = oself -> pt;
-
-    uint32_t num_nodes;
-    const uint8_t *data_start;
-    uint32_t off, end;
-
-    num_nodes = GET32( self -> num_nodes );
-    end = GET32 ( self -> data_size );
-
-    if ( id == 0 )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNull );
-    if ( id > num_nodes )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNotFound );
-
-    data_start = ( const uint8_t* )
-      & self -> data_idx . v16 [ num_nodes ];
-    off = GET16( self -> data_idx . v16 [ id - 1 ] );
-    if ( id != num_nodes )
-      end = GET16( self -> data_idx . v16 [ id ] );
-
-    * addr = & data_start [ off ];
-    * size = end - off;
-    return 0;
-}
-
-static
-rc_t CC PBSTreeImplGetNodeData32 ( const PBSTree *oself,
-    const void **addr, size_t *size, uint32_t id )
-{
-    const P_BSTree *self = oself -> pt;
-
-    uint32_t num_nodes;
-    const uint8_t *data_start;
-    uint32_t off, end;
-
-    num_nodes = GET32( self -> num_nodes );
-    end = GET32 ( self -> data_size );
-
-    if ( id == 0 )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNull );
-    if ( id > num_nodes )
-        return RC ( rcCont, rcTree, rcAccessing, rcId, rcNotFound );
-
-    data_start = ( const uint8_t* )
-      & self -> data_idx . v32 [ num_nodes ];
-    off = GET32( self -> data_idx . v32 [ id - 1 ] );
-    if ( id != num_nodes )
-      end = GET32( self -> data_idx . v32 [ id ] );
-
-    * addr = & data_start [ off ];
-    * size = end - off;
-    return 0;
-}
-
-/* Find
- *  find an object within tree
- *  "cmp" function returns equivalent of "item" - "n"
- */
-static
-uint32_t CC PBSTreeImplFind8 ( const PBSTree *self, PBSTNode *n, const void *item,
-    int ( CC * cmp ) ( const void *item, const PBSTNode *n, void * data ), void * data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t right = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        int diff;
-        const uint8_t *data_start;
-        uint32_t off, end = GET32( pt -> data_size );
-        uint32_t id, left = 1;
-        uint32_t max_right = right;
-
-	data_start = & pt -> data_idx . v8 [ right ];
-	
-	do
-	  {
-	    id = ( left + right ) >> 1;
-	    off = pt -> data_idx . v8 [ id - 1 ];
-	    n -> id = id;
-	    n -> data . addr = & data_start [ off ];
-	    if ( id == max_right )
-	      n -> data . size = end - off;
-	    else
-	      n -> data . size = pt -> data_idx . v8 [ id ] - off;
-	    diff = ( * cmp ) ( item, n, data );
-	    if ( diff == 0 )
-	      return id;
-	    if ( diff < 0 )
-	      right = id - 1;
-	    else
-	      left = id + 1;
-	  }
-	while ( left <= right );
-    }
-
-    n -> data . addr = NULL;
-    n -> data . size = 0;
-    return n -> id = 0;
-}
-
-static
-uint32_t CC PBSTreeImplFind16 ( const PBSTree *self, PBSTNode *n, const void *item,
-    int ( CC * cmp ) ( const void *item, const PBSTNode *n, void * data ), void * data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t right = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        int diff;
-        const uint8_t *data_start;
-        uint32_t off, end = GET32( pt -> data_size );
-        uint32_t id, left = 1;
-        uint32_t max_right = right;
-
-	data_start = ( const uint8_t* )
-	  & pt -> data_idx . v16 [ right ];
-	
-	do
-	  {
-	    id = ( left + right ) >> 1;
-	    off = GET16( pt -> data_idx . v16 [ id - 1 ] );
-	    n -> id = id;
-	    n -> data . addr = & data_start [ off ];
-	    if ( id == max_right )
-	      n -> data . size = end - off;
-	    else
-	      n -> data . size = GET16( pt -> data_idx . v16 [ id ] ) - off;
-	    diff = ( * cmp ) ( item, n, data );
-	    if ( diff == 0 )
-	      return id;
-	    if ( diff < 0 )
-	      right = id - 1;
-	    else
-	      left = id + 1;
-	  }
-	while ( left <= right );
-    }
-
-    n -> data . addr = NULL;
-    n -> data . size = 0;
-    return n -> id = 0;
-}
-
-static
-uint32_t CC PBSTreeImplFind32 ( const PBSTree *self, PBSTNode *n, const void *item,
-    int ( CC * cmp ) ( const void *item, const PBSTNode *n, void * data ), void * data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t right = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        int diff;
-        const uint8_t *data_start;
-        uint32_t off, end = GET32( pt -> data_size );
-        uint32_t id, left = 1;
-        uint32_t max_right = right;
-
-	data_start = ( const uint8_t* )
-	  & pt -> data_idx . v32 [ right ];
-	
-	do
-	  {
-	    id = ( left + right ) >> 1;
-	    off = GET32( pt -> data_idx . v32 [ id - 1 ] );
-	    n -> id = id;
-	    n -> data . addr = & data_start [ off ];
-	    if ( id == max_right )
-	      n -> data . size = end - off;
-	    else
-	      n -> data . size = GET32( pt -> data_idx . v32 [ id ] ) - off;
-	    diff = ( * cmp ) ( item, n, data );
-	    if ( diff == 0 )
-	      return id;
-	    if ( diff < 0 )
-	      right = id - 1;
-	    else
-	      left = id + 1;
-	  }
-	while ( left <= right );
-    }
-
-    n -> data . addr = NULL;
-    n -> data . size = 0;
-    return n -> id = 0;
-}
-
-/* ForEach
- *  executes a function on each tree element
- */
-static
-void CC PBSTreeImplForEach8 ( const PBSTree *self, bool reverse,
-    void ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-	data_start = & pt -> data_idx . v8 [ num_nodes ];
-	
-	if ( ! reverse )
-	  {
-	    for ( off = pt -> data_idx . v8 [ 0 ],
-		    id = 1; id < num_nodes; off = end, ++ id )
-	      {
-		end = pt -> data_idx . v8 [ id ];
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-	    
-	    end = GET32( pt -> data_size );
-	  }
-	
-	off = pt -> data_idx . v8 [ num_nodes - 1 ];
-	n . internal = pt;
-	n . id = num_nodes;
-	n . data . addr = & data_start [ off ];
-	n . data . size = end - off;
-	( * f ) ( & n, data );
-	
-	if ( reverse )
-	  {
-	    for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-	      {
-		off = pt -> data_idx . v8 [ id - 1 ];
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-	  }
-    }
-}
-
-static
-void CC PBSTreeImplForEach16 ( const PBSTree *self, bool reverse,
-    void ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-	data_start = ( const uint8_t* )
-	  & pt -> data_idx . v16 [ num_nodes ];
-	
-	if ( ! reverse )
-	  {
-	    for ( off = GET16( pt -> data_idx . v16 [ 0 ] ),
-		    id = 1; id < num_nodes; off = end, ++ id )
-	      {
-		end = GET16( pt -> data_idx . v16 [ id ] );
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-	    
-	    end = GET32( pt -> data_size );
-	  }
-	
-	off = GET16( pt -> data_idx . v16 [ num_nodes - 1 ] );
-	n . internal = pt;
-	n . id = num_nodes;
-	n . data . addr = & data_start [ off ];
-	n . data . size = end - off;
-	( * f ) ( & n, data );
-        
-	if ( reverse )
-	  {
-	    for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-	      {
-		off = GET16( pt -> data_idx . v16 [ id - 1 ] );
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-	  }
-    }
-}
-
-static
-void CC PBSTreeImplForEach32 ( const PBSTree *self, bool reverse,
-    void ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-	data_start = ( const uint8_t* )
-	  & pt -> data_idx . v32 [ num_nodes ];
-	
-	if ( ! reverse )
-	  {
-	    for ( off = GET32( pt -> data_idx . v32 [ 0 ] ),
-		    id = 1; id < num_nodes; off = end, ++ id )
-	      {
-		end =GET32( pt -> data_idx . v32 [ id ] );
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-                
-	    end = GET32( pt -> data_size );
-	  }
-
-	off = GET32( pt -> data_idx . v32 [ num_nodes - 1 ] );
-	n . internal = pt;
-	n . id = num_nodes;
-	n . data . addr = & data_start [ off ];
-	n . data . size = end - off;
-	( * f ) ( & n, data );
-
-	if ( reverse )
-	  {
-	    for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-	      {
-		off = GET32( pt -> data_idx . v32 [ id - 1 ] );
-		n . internal = pt;
-		n . id = id;
-		n . data . addr = & data_start [ off ];
-		n . data . size = end - off;
-		( * f ) ( & n, data );
-	      }
-	  }
-    }
-}
-
-/* DoUntil
- *  executes a function on each element
- *  until the function returns true
- */
-static
-bool CC PBSTreeImplDoUntil8 ( const PBSTree *self, bool reverse,
-    bool ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-        data_start = & pt -> data_idx . v8 [ num_nodes ];
-	
-        if ( ! reverse )
-        {
-            for ( off = pt -> data_idx . v8 [ 0 ],
-                  id = 1; id < num_nodes; off = end, ++ id )
-            {
-                end = pt -> data_idx . v8 [ id ];
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-	    
-            end = GET32( pt -> data_size );
-        }
-
-        off = pt -> data_idx . v8 [ num_nodes - 1 ];
-        n . internal = pt;
-        n . id = num_nodes;
-        n . data . addr = & data_start [ off ];
-        n . data . size = end - off;
-        if ( ( * f ) ( & n, data ) )
-            return true;
-
-        if ( reverse )
-        {
-            for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-            {
-                off = pt -> data_idx . v8 [ id - 1 ];
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static
-bool CC PBSTreeImplDoUntil16 ( const PBSTree *self, bool reverse,
-    bool ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-        data_start = ( const uint8_t* )
-            & pt -> data_idx . v16 [ num_nodes ];
-            
-        if ( ! reverse )
-        {
-            for ( off = GET16( pt -> data_idx . v16 [ 0 ] ),
-                  id = 1; id < num_nodes; off = end, ++ id )
-            {
-                end = GET16( pt -> data_idx . v16 [ id ] );
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-                
-            end = GET32( pt -> data_size );
-        }
-
-        off = GET16( pt -> data_idx . v16 [ num_nodes - 1 ] );
-        n . internal = pt;
-        n . id = num_nodes;
-        n . data . addr = & data_start [ off ];
-        n . data . size = end - off;
-        if ( ( * f ) ( & n, data ) )
-            return true;
-            
-        if ( reverse )
-        {
-            for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-            {
-                off = GET16( pt -> data_idx . v16 [ id - 1 ] );
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-        }
-    }
-    return 0;
-}
-
-static
-bool CC PBSTreeImplDoUntil32 ( const PBSTree *self, bool reverse,
-    bool ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    const P_BSTree *pt = self -> pt;
-    uint32_t num_nodes = GET32( pt -> num_nodes );
-    if ( pt -> num_nodes != 0 )
-    {
-        PBSTNode n;
-        uint32_t id;
-        uint32_t off, end;
-        const uint8_t *data_start;
-
-        end = GET32( pt -> data_size );
-
-        data_start = ( const uint8_t* )
-            & pt -> data_idx . v32 [ num_nodes ];
-            
-        if ( ! reverse )
-        {
-            for ( off = GET32( pt -> data_idx . v32 [ 0 ] ),
-                  id = 1; id < num_nodes; off = end, ++ id )
-            {
-                end = GET32( pt -> data_idx . v32 [ id ] );
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-                
-            end = GET32( pt -> data_size );
-        }
-            
-        off = GET32( pt -> data_idx . v32 [ num_nodes - 1 ] );
-        n . internal = pt;
-        n . id = num_nodes;
-        n . data . addr = & data_start [ off ];
-        n . data . size = end - off;
-        if ( ( * f ) ( & n, data ) )
-            return true;
-            
-        if ( reverse )
-        {
-            for ( end = off, id = num_nodes - 1; id > 0; end = off, -- id )
-            {
-                off = GET32( pt -> data_idx . v32 [ id - 1 ] );
-                n . internal = pt;
-                n . id = id;
-                n . data . addr = & data_start [ off ];
-                n . data . size = end - off;
-                if ( ( * f ) ( & n, data ) )
-                    return true;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/* Whack
- *  whacks PBSTree object
- *  does not free memory reference
- */
-static
-void CC PBSTreeImplWhack ( PBSTree *self )
-{
-    free ( self );
-}
-
-
-static PBSTree_vt_v1 vtPBSTreeImpl8 =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* required methods */
-    PBSTreeImplWhack,
-    PBSTreeImplCount,
-    PBSTreeImplDepth,
-    PBSTreeImplSize,
-    PBSTreeImplGetNodeData8,
-    PBSTreeImplFind8,
-    PBSTreeImplForEach8,
-    PBSTreeImplDoUntil8
-};
-
-static PBSTree_vt_v1 vtPBSTreeImpl16 =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* required methods */
-    PBSTreeImplWhack,
-    PBSTreeImplCount,
-    PBSTreeImplDepth,
-    PBSTreeImplSize,
-    PBSTreeImplGetNodeData16,
-    PBSTreeImplFind16,
-    PBSTreeImplForEach16,
-    PBSTreeImplDoUntil16
-};
-
-static PBSTree_vt_v1 vtPBSTreeImpl32 =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* required methods */
-    PBSTreeImplWhack,
-    PBSTreeImplCount,
-    PBSTreeImplDepth,
-    PBSTreeImplSize,
-    PBSTreeImplGetNodeData32,
-    PBSTreeImplFind32,
-    PBSTreeImplForEach32,
-    PBSTreeImplDoUntil32
-};
-
-
-/* GetVTable
- */
-static
-PBSTree_vt * CC PBSTreeImplGetVTable ( const P_BSTree *pt )
-{
-    uint32_t data_size = GET32 ( pt -> data_size );
-    if ( data_size <= 256 )
-      return (PBSTree_vt *) & vtPBSTreeImpl8;
-    if ( data_size <= 65536 )
-      return (PBSTree_vt *) & vtPBSTreeImpl16;
-    return (PBSTree_vt *) & vtPBSTreeImpl32;
-}
-
-
-/* CheckPersisted
- *  check persisted image for apparent correctness
- */
-static
-rc_t CC PBSTreeImplCheckPersisted ( const P_BSTree *pt, size_t size )
-{
-    uint32_t num_nodes;
-
-    if ( pt == NULL)
-        return RC ( rcCont, rcTree, rcConstructing, rcParam, rcNull );
-    if ( size == 0 )
-        return 0;
-    if ( size < sizeof pt -> num_nodes )
-        return RC ( rcCont, rcTree, rcConstructing, rcData, rcInvalid );
-
-    num_nodes = GET32( pt -> num_nodes );
-    if ( num_nodes > 0 )
-    {
-        uint32_t data_size;
-        const uint8_t *end, *data_start;
-
-        /* no need to byteswap a value of 0 */	
-        if ( size < sizeof * pt || pt -> data_size == 0 )
-            return RC ( rcCont, rcTree, rcConstructing, rcData, rcIncomplete );
-
-        end = ( const uint8_t* ) pt + size;
-
-        data_size = GET32 ( pt -> data_size );
-        if ( data_size <= 256 )
-            data_start = & pt -> data_idx . v8 [ num_nodes ];
-        else  if ( data_size <= 65536 )
-        {
-            data_start = ( const uint8_t* )
-                & pt -> data_idx . v16 [ num_nodes ];
-        }
-        else
-        {
-            data_start = ( const uint8_t* )
-                & pt -> data_idx . v32 [ num_nodes ];
-        }
-        
-        if ( & data_start [ data_size ] > end )
-            return RC ( rcCont, rcTree, rcConstructing, rcData, rcCorrupt );
-    }
-    
-    return 0;
-}
-
-/* PBSTreeMake
- *  make a PBSTree structure
- *  the memory reference passed in is borrowed
- */
-#if SWAP_PERSISTED
-#define PBSTREEMAKE PBSTreeMakeSwapped
-#else
-#define PBSTREEMAKE PBSTreeMakeNative
-#endif
-
-rc_t PBSTREEMAKE ( PBSTree *pt, const void *addr, size_t size )
-{
-    rc_t rc = PBSTreeImplCheckPersisted ( addr, size );
-    if ( rc == 0 )
-    {
-        PBSTree_vt *vt = PBSTreeImplGetVTable ( addr );
-        rc = PBSTreeInit ( pt, vt, addr );
-    }
-    return rc;
-}
diff --git a/libs/klib/pbstree-native.c b/libs/klib/pbstree-native.c
deleted file mode 100644
index 9eb937e..0000000
--- a/libs/klib/pbstree-native.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#undef SWAP_PERSISTED
-#define SWAP_PERSISTED 0
-#include "pbstree-impl.c"
-#undef SWAP_PERSISTED
diff --git a/libs/klib/pbstree-priv.h b/libs/klib/pbstree-priv.h
deleted file mode 100644
index e81058b..0000000
--- a/libs/klib/pbstree-priv.h
+++ /dev/null
@@ -1,664 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_pbstree_priv_
-#define _h_pbstree_priv_
-
-#ifndef _h_klib_pbstree_
-#include <klib/pbstree.h>
-#endif
-
-#ifndef _h_klib_ptrie_
-#include <klib/ptrie.h>
-#endif
-
-#include <endian.h>
-
-
-#define RECORD_HDR_IDX 1
-#define RECORD_HDR_DEPTH 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * P_BSTree
- *  persisted binary search tree
- *
- *  in memory, the tree is built from nodes with 3 pointers. this
- *  arrangement allows parent identification, left & right child
- *  identification, as well as leaf node indication.
- *
- *  when persisted, the tree nodes are identified by index integer.
- *  this integer may be 8, 16 or 32 bits as determined by the node count.
- */
-typedef struct P_BSTree P_BSTree;
-struct P_BSTree
-{
-    /* a node count - if zero, then the structure ends */
-    uint32_t num_nodes;
-
-    /* the total size of auxiliary data */
-    uint32_t data_size;
-
-    /* offsets relative to & data_idx [ num_nodes ] */
-    union
-    {
-        uint8_t v8 [ 4 ];
-        uint16_t v16 [ 2 ];
-        uint32_t v32 [ 1 ];
-    } data_idx;
-
-#if 0
-    uint8_t data [ data_size ];
-#endif
-};
-
-
-/*--------------------------------------------------------------------------
- * PBSTree_vt
- *  versioned message dispatch table
- */
-#ifndef PBSTREE_IMPL
-#define PBSTREE_IMPL PBSTree
-#endif
-
-typedef struct PBSTree_vt_v1 PBSTree_vt_v1;
-struct PBSTree_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    void ( CC * destroy ) ( PBSTREE_IMPL *self );
-    uint32_t ( CC * count ) ( const PBSTREE_IMPL *self );
-    uint32_t ( CC * depth ) ( const PBSTREE_IMPL *self );
-    size_t ( CC * size ) ( const PBSTREE_IMPL *self );
-    rc_t ( CC * get_node_data ) ( const PBSTREE_IMPL *self,
-        const void **addr, size_t *size, uint32_t id );
-    uint32_t ( CC * find ) (  const PBSTREE_IMPL *self, PBSTNode *rtn,
-        const void *item, int ( CC * cmp ) ( const void*, const PBSTNode* , void* ), void *data );
-    void ( CC * for_each ) ( const PBSTREE_IMPL *self, bool reverse,
-        void ( CC * f ) ( PBSTNode*, void* ), void *data );
-    bool ( CC * do_until ) ( const PBSTREE_IMPL *self, bool reverse,
-        bool ( CC * f ) ( PBSTNode*, void* ), void *data );
-    /* end minor version == 0 */
-};
-
-/* latest major version */
-#define PBSTREE_LATEST 1
-
-typedef union PBSTree_vt PBSTree_vt;
-union PBSTree_vt
-{
-    PBSTree_vt_v1 v1;
-};
-
-/*--------------------------------------------------------------------------
- * PBSTree
- *  handle to persisted binary search tree
- */
-struct PBSTree
-{
-    const PBSTree_vt *vt;
-    const P_BSTree *pt;
-};
-
-
-/* Make
- *  swapped and native versions
- *  take a pre-allocated but uninitialized PBSTree structure
- */
-rc_t PBSTreeMakeNative ( PBSTree *pt, const void *addr, size_t size );
-rc_t PBSTreeMakeSwapped ( PBSTree *pt, const void *addr, size_t size );
-
-
-/* Init
- *  initialize the parent class
- */
-rc_t PBSTreeInit ( PBSTree *self, const PBSTree_vt *vt, const P_BSTree *pt );
-
-
-/* PBSTreeGetNodeData
- *  finds node data boundaries
- */
-rc_t PBSTreeGetNodeData ( const PBSTree *self,
-    const void **addr, size_t *size, uint32_t id );
-
-/* PBSTreeDump
- *  dumps a persisted binary search tree
- *
- *  "name" [ IN, NULL OKAY ] - optional tree name
- *
- *  "stdio_file" [ IN ] - an output FILE* opaquely typed to avoid
- *  requiring an include of stdio.h
- *
- *  "indent_level" [ IN ] - the indent tabbing amount for output
- *  the implementation uses a tab setting of 2 spaces
- *
- *  "dump_node" [ IN, NULL OKAY ] and "data" [ IN ] - an optional
- *  node dumping function and associated data
- */
-void PBSTreeDump ( const PBSTree *self, const char *name,
-    void *stdio_file, uint32_t indent_level,
-    void ( CC * dump_node ) ( const void *addr, size_t size, void *stdio_file,
-        uint32_t indent_level, void *data ), void *data );
-
-/* GetIndentString
- *  returns a string of spaces for indentation
- */
-const char *GetIndentString ( uint32_t indent_level, uint32_t indent_tab );
-
-
-/*--------------------------------------------------------------------------
- * P_TTrans
- * PTTrans
- *  the index is represented as a min-sized uint32_t,
- *  the child transitions are represented by two parallel
- *  sequences described below, and data values have an in-line
- *  PTBTree.
- */
-enum
-{
-#if RECORD_HDR_IDX
-    /* transition index from parent to here */
-    pttHdrIdx,
-#endif
-#if RECORD_HDR_DEPTH
-    /* tree depth of node, i.e. transitions from root */
-    pttHdrDepth,
-#endif
-    /* tcnt from TTrans, meaning the number of non-terminals */
-    pttHdrTransCnt,
-
-    /* zero if child array was NULL, or
-       the number of indicies in "idx" array
-       beyond the header values */
-    pttHdrIdxCnt,
-
-    /* the end of "idx" if cnt is zero */
-    pttHdrNullEnd,
-
-    /* the number of sequence entries in "idx",
-       where an entry is either a single index
-       or an index range, as indicated by "child_seq_type" */
-    pttHdrSeqLen = pttHdrNullEnd,
-
-    /* the number of entries in "child" array */
-    pttHdrChildCnt,
-
-    /* index of the last header */
-    pttLastHdr = pttHdrChildCnt,
-
-    /* index of the first entry in "idx" */
-    pttFirstIdx
-};
-
-typedef struct P_TTrans P_TTrans;
-struct P_TTrans
-{
-    /* the variant selected for idx depends upon the recorded
-       character set size, and is typically 8 bit.
-
-       idx [ pttHdrIdx ]      => transition index from parent,
-                                 i.e. character code
-       idx [ pttHdrDepth ]    => node depth
-       idx [ pttHdrTransCnt ] => transition count
-       idx [ pttIdxCnt ]      => index count, meaning the
-                                 dimension of "idx".
-
-       if idx . variant [ pttIdxCnt ] is zero, then the P_TTrans
-       child transition information is skipped, i.e. there is nothing
-       corresponding to the "child" array in a TTrans.
-
-       idx [ pttHdrSeqLen ]   => sequence length
-
-       if the child array exists, the index sequence starts
-       at offset pttFirstIdx into idx, due to the header information. */
-
-    union
-    {
-        uint8_t v8 [ 4 ];
-        uint16_t v16 [ 2 ];
-        uint32_t v32 [ 1 ];
-
-    } idx;
-
-    /* from this point forward, the structure members have calculated offsets */
-#if 0
-
-    /* transition array sequence type bits
-       indexed as: bits [ i / 8 ] & ( 1 << ( i % 8 ) )
-
-       a "0" indicates a simple { idx, trans } pair, while
-       a "1" indicates an index range { lower, upper } and
-       a trans [] corresponding to the range. the index range
-       is fully closed, i.e. upper is inclusive. */
-
-    uint8_t child_seq_type [ ( idx [ pttHdrSeqLen ] + 7 ) / 8 ];
-
-    /* alignment padding - when finding the location of the
-       "child" array ( if it exists ), it is forced to be aligned
-       to the size of its variant */
-
-    if ( offsetof align1 % sizeof child [ 0 ] != 0 )
-        uint8_t align1 [ sizeof child [ 0 ] - offsetof align1 % sizeof child [ 0 ] ];
-
-    /* if keys are embedded within tree, then record a backtrace
-       link from this P_TTrans to its parent */
-    if ( tt -> ext_keys == false )
-    {
-        union
-        {
-            uint8_t v8;
-            uint16_t v16;
-            uint32_t v32;
-
-        } dad;
-    }
-
-    /* transition ids. the variant selected depends upon
-       the number of transition nodes in the tree */
-
-    if ( idx [ pttHdrIdxCnt ] != 0 )
-    {
-        union
-        {
-            uint8_t v8 [ idx [ pttHdrChildCnt ] ];
-            uint16_t v16 [ idx [ pttHdrChildCnt ] ];
-            uint32_t v32 [ idx [ pttHdrChildCnt ] ];
-            
-        } child;
-    }
-    
-    /* alignment padding */
-    if ( offsetof align2 % sizeof uint32_t != 0 )
-    {
-        /* true or false as to whether to expect vals PBSTree */
-        uint8_t has_vals;
-
-        /* padding */
-        uint8_t align2 [ sizeof uint32_t - 1 - offsetof align2 % sizeof uint32_t ];
-    }
-
-    /* a persisted tree */
-    if ( offsetof align2 % sizeof uint32_t == 0 || has_vals != false )
-        PBSTree vals;
-
-    /* final alignment */
-    if ( offsetof align3 % 4 != 0 )
-        uint8_t align3 [ 4 - offsetof align3 % 4 ];
-#endif
-};
-
-typedef struct PTTrans PTTrans;
-struct PTTrans
-{
-    const PTTrans *back;
-
-    union
-    {
-        const uint8_t *v8;
-        const uint16_t *v16;
-        const uint32_t *v32;
-    } idx;
-
-    const uint8_t *child_seq_type;
-
-    union
-    {
-        const uint8_t *v8;
-        const uint16_t *v16;
-        const uint32_t *v32;
-    } dad;
-
-    union
-    {
-        const uint8_t *v8;
-        const uint16_t *v16;
-        const uint32_t *v32;
-    } child;
-
-    PBSTree _val;
-    const PBSTree *vals;
-
-    uint32_t tid;
-#if ! RECORD_HDR_IDX
-    uint32_t tidx;
-#endif
-#if ! RECORD_HDR_DEPTH
-    uint32_t depth;
-#endif
-    uint32_t tcnt;
-    uint32_t icnt;
-    uint32_t slen;
-    int32_t refcount;
-};
-
-/* PTTransGetIdx
- */
-#define PTTransGetIdx( self, tt, zidx ) \
-    ( * ( tt ) -> get_idx ) ( self, zidx )
-
-/* PTTransGetIdxAddr
- */
-#define PTTransGetIdxAddr( self, tt, zidx ) \
-    ( * ( tt ) -> get_idx_addr ) ( self, zidx )
-
-/* PTTransGetDad
- */
-#define PTTransGetDad( self, tt ) \
-    ( * ( tt ) -> get_dad ) ( self )
-
-/* PTTransAlignDadAddr
- */
-#define PTTransAlignDadAddr( self, tt ) \
-    ( * ( tt ) -> align_dad_addr ) ( self, ( tt ) -> backtrace )
-
-/* PTTransGetChild
- */
-#define PTTransGetChild( self, tt, zidx ) \
-    ( * ( tt ) -> get_child ) ( self, zidx )
-
-/* PTTransGetChildAddr
- */
-#define PTTransGetChildAddr( self, tt, zidx ) \
-    ( * ( tt ) -> get_child_addr ) ( self, zidx )
-
-/* PTTransGetTransCharCode
- *  get char code of parent to self transition
- */
-#if RECORD_HDR_IDX
-#define PTTransGetTransCharCode( self, tt ) \
-    PTTransGetIdx ( self, tt, pttHdrIdx )
-#else
-#define PTTransGetTransCharCode( self, tt ) \
-    ( self ) -> tidx
-#endif
-
-/* PTTransGetDepth
- *  get transition depth
- */
-#if RECORD_HDR_DEPTH
-#define PTTransGetDepth( self, tt ) \
-    PTTransGetIdx ( self, tt, pttHdrDepth )
-#else
-#define PTTransGetDepth( self, tt ) \
-    ( self ) -> depth
-#endif
-
-/* PTTransForEach
- */
-void PTTransForEach ( const PTTrans *self, const PTrie *tt,
-    void ( * f ) ( const PTTrans *trans, const PTrie *tt, void *data ), void * data );
-
-/* PTTransDoUntil
- */
-bool PTTransDoUntil ( const PTTrans *self, const PTrie *tt,
-    bool ( * f ) ( const PTTrans *trans, const PTrie *tt, void *data ), void * data );
-
-/* PTTransWhack
- */
-void PTTransWhack ( PTTrans *trans );
-
-/* PTTransDump
- *  takes a FILE* as argument
- *
- *  "tt" [ IN ] - the owning PTrie
- *
- *  "stdio_file" [ IN ] - an output FILE* opaquely typed to avoid
- *  requiring an include of stdio.h
- *
- *  "indent_level" [ IN ] - the indent tabbing amount for output
- *  the implementation uses a tab setting of 2 spaces
- */
-void PTTransDump ( const PTTrans *self , const PTrie *tt,
-    void *stdio_file, uint32_t indent_level,
-    void ( CC * dump_node ) ( const void *addr, size_t size, void *stdio_file,
-        uint32_t indent_level, void *data ), void *data );
-
-
-/*--------------------------------------------------------------------------
- * P_Trie
- * PTrie
- *  persisted TTree
- */
-typedef struct P_Trie P_Trie;
-struct P_Trie
-{
-    /* the number of transition nodes */
-    uint32_t num_trans;
-
-    /* the number of value nodes */
-    uint32_t num_nodes;
-
-    /* size of all P_TTrans data */
-    uint32_t data_size;
-
-    /* storage characteristics */
-#if 0
-    /* keys are like this, built always as little-endian, first fields lowest */
-    uint16_t ext_keys  : 1;
-    uint16_t backtrace : 1;
-    uint16_t id_coding : 3;
-    uint16_t unused    : 11;
-#else
-    uint16_t keys;
-#endif  
-
-    /* character set in indexed order
-       N.B. a character value of 0 means
-       unmapped, and is unlikely but possible */
-    uint16_t width;
-    uint32_t rmap [ 1 ];
-
-#if 0
-    /* P_TTrans index - consists of 4-byte
-       offsets relative to "data" member,
-       i.e. an index of 2 means 8 byte offset */
-    union
-    {
-        uint8_t v8 [ num_trans ];
-        uint16_t v16 [ num_trans ];
-        uint32_t v32 [ num_trans ];
-
-    } trans_idx;
-
-    /* an alignment to keep "data" on 4-byte boundary */
-    if ( ( offsetof align1 & 3 ) != 0 )
-        uint8_t align1 [ 4 - ( offsetof align1 & 3 ) ];
-
-    /* P_TTrans objects */
-    uint32_t data [ ( data_size + 3 ) / 4 ];
-#endif
-};
-
-
-/* P_TrieExtKeys
- */
-#define P_TrieExtKeys( keys ) \
-    ( ( keys ) & 1 )
-
-/* P_TrieBacktrace
- */
-#define P_TrieBacktrace( keys ) \
-    ( ( keys ) & 2 )
-
-/* P_TrieIdCoding
- */
-#define P_TrieIdCoding( keys ) \
-    ( ( keys >> 2 ) & 7 )
-
-/* P_TrieSetExtKeys
- */
-#define P_TrieSetExtKeys( keys, val ) \
-    ( void ) ( ( val ) ? ( ( keys ) |= 1 ) : ( ( keys ) &= ~ 1 ) )
-
-/* P_TrieSetBacktrace
- */
-#define P_TrieSetBacktrace( keys, val ) \
-    ( void ) ( ( val ) ? ( ( keys ) |= 2 ) : ( ( keys ) &= ~ 2 ) )
-
-/* P_TrieSetIdCoding
- */
-#define P_TrieSetIdCoding( keys, val ) \
-    ( void ) ( ( keys ) = ( ( keys ) & ~ ( 7 << 2 ) ) | ( ( ( val ) & 7 ) << 2 ) )
-
-
-struct PTrie
-{
-    /* virtual functions on PTTrans */
-    uint32_t ( * get_idx ) ( const PTTrans*, uint32_t idx );
-    const void* ( * get_idx_addr ) ( const PTTrans*, uint32_t idx );
-    uint32_t ( * get_dad ) ( const PTTrans* );
-    const void* ( * align_dad_addr ) ( PTTrans*, bool backtrace );
-    uint32_t ( * get_child ) ( const PTTrans*, uint32_t idx );
-    const void* ( * get_child_addr ) ( const PTTrans*, uint32_t tcnt );
-
-    /* virtual functions on PTrie */
-    uint32_t ( * get_node_off ) ( const PTrie*, uint32_t idx );
-    uint32_t ( * encode_node_id ) ( const PTrie*,
-        uint32_t tid, uint32_t btid );
-    rc_t ( * decode_node_id ) ( const PTrie*, uint32_t id,
-        uint32_t *tid, uint32_t *btid );
-    uint32_t ( * decode_char_id ) ( const PTrie*, uint32_t id );
-
-    /* P_TTrans index to character map */
-    const uint32_t *_rmap;
-
-    /* P_TTrans offsets */
-    union
-    {
-        const uint8_t *v8;
-        const uint16_t *v16;
-        const uint32_t *v32;
-    } trans_off;
-
-    /* P_TTrans PTrans objects */
-    const uint32_t *data;
-
-    /* the number of transition nodes */
-    uint32_t num_trans;
-
-    /* the number of value nodes */
-    uint32_t num_nodes;
-
-    /* size of all P_TTrans data */
-    uint32_t data_size;
-
-    /* storage characteristics */
-    uint8_t ext_keys;
-    uint8_t backtrace;
-    uint8_t id_coding;
-    uint8_t byteswap;
-
-    /* width of character map & trans array */
-    uint16_t width;
-
-    /* range of UTF-32 input characters */
-    uint32_t first_char;
-    uint32_t last_char;
-
-    /* index of an unmapped character */
-    uint16_t unmapped_idx;
-
-    /* character to index map */
-    uint16_t map [ 1 ];
-};
-
-
-
-/* PTrieGetNodeOff
- */
-#define PTrieGetNodeOff( self, zidx ) \
-    ( * ( self ) -> get_node_off ) ( self, zidx )
-
-/* PTrieEncodeNodeId
- */
-#define PTrieEncodeNodeId( self, tid, btid ) \
-    ( * ( self ) -> encode_node_id ) ( self, tid, btid )
-
-/* PTrieDecodeNodeId
- */
-#define PTrieDecodeNodeId( self, id, tid, btid ) \
-    ( * ( self ) -> decode_node_id ) ( self, id, tid, btid )
-
-/* PTrieDecodeCharId
- */
-#define PTrieDecodeCharId( self, idx ) \
-    ( * ( self ) -> decode_char_id ) ( self, idx )
-
-
-/* PTrieInitNode
- *  takes a one-based index
- */
-rc_t PTrieInitNode ( const PTrie *self, PTTrans *trans, uint32_t idx );
-
-/* PTrieMakeNode
- *  takes a one-based index
- */
-rc_t PTrieMakeNode ( const PTrie *self, PTTrans **transp, uint32_t idx );
-
-/* PTrieDump
- *  takes a FILE* as argument
- *
- *  "name" [ IN, NULL OKAY ] - optional ttree name
- *
- *  "stdio_file" [ IN ] - an output FILE* opaquely typed to avoid
- *  requiring an include of stdio.h
- *
- *  "indent_level" [ IN ] - the indent tabbing amount for output
- *  the implementation uses a tab setting of 2 spaces
- *
- *  "dump_node" [ IN, NULL OKAY ] and "data" [ IN ] - an optional
- *  node dumping function and associated data
- */
-void PTrieDump ( const PTrie *self, const char *name,
-    void *stdio_file, uint32_t indent_level,
-    void ( * dump_node ) ( const void *addr, size_t size, void *stdio_file,
-        uint32_t indent_level, void *data ), void *data );
-
-/* PTrieDumpTrans
- *  takes a FILE* as argument
- *
- *  the indent level is used for hierarchy.
- *  2 spaces are emitted at the left margin for each level.
- */
-void PTrieDumpTrans ( const PTrie *self , uint32_t id,
-    void *stdio_file, uint32_t indent_level,
-    void ( * dump_node ) ( const void *addr, size_t size, void *stdio_file,
-        uint32_t indent_level, void *data ), void *data );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_pbstree_priv_ */
diff --git a/libs/klib/pbstree-swapped.c b/libs/klib/pbstree-swapped.c
deleted file mode 100644
index f9a9160..0000000
--- a/libs/klib/pbstree-swapped.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#undef SWAP_PERSISTED
-#define SWAP_PERSISTED 1
-#include "pbstree-impl.c"
-#undef SWAP_PERSISTED
diff --git a/libs/klib/pbstree.c b/libs/klib/pbstree.c
deleted file mode 100644
index 09f8b9c..0000000
--- a/libs/klib/pbstree.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "pbstree-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * PBSTree
- *  a flattened b-tree
- */
-
-/* Make
- *  make a PBSTree structure
- *  the memory reference passed in is borrowed
- */
-LIB_EXPORT rc_t CC PBSTreeMake ( PBSTree **ptp, const void *addr, size_t size, bool byteswap )
-{
-    rc_t rc;
-
-    if ( ptp == NULL )
-        rc = RC ( rcCont, rcTree, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( size == 0 )
-            rc = RC ( rcCont, rcTree, rcConstructing, rcData, rcInvalid );
-        else if ( addr == NULL )
-            rc = RC ( rcCont, rcTree, rcConstructing, rcData, rcNull );
-        else
-        {
-            PBSTree *pt = malloc ( sizeof * pt );
-            if ( pt == NULL )
-                rc = RC ( rcCont, rcTree, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = byteswap ?
-                    PBSTreeMakeSwapped ( pt, addr, size ):
-                    PBSTreeMakeNative ( pt, addr, size );
-                if ( rc == 0 )
-                {
-                    * ptp = pt;
-                    return 0;
-                }
-
-                free ( pt );
-            }
-        }
-
-        * ptp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Init - PROTECTED
- *  initialize the parent class
- */
-rc_t PBSTreeInit ( PBSTree *self, const PBSTree_vt *vt, const P_BSTree *pt )
-{
-    if ( self == NULL )
-        return RC ( rcCont, rcTree, rcConstructing, rcSelf, rcNull );
-
-    if ( vt == NULL )
-        return RC ( rcCont, rcTree, rcConstructing, rcInterface, rcNull );
-    if ( vt -> v1 . maj == 0 )
-        return RC ( rcCont, rcTree, rcConstructing, rcInterface, rcInvalid );
-    if ( vt -> v1 . maj > PBSTREE_LATEST )
-        return RC ( rcFS, rcFile, rcConstructing, rcInterface, rcBadVersion );
-
-    if ( pt == NULL )
-        return RC ( rcCont, rcTree, rcConstructing, rcParam, rcNull );
-
-#if _DEBUGGING
-    if ( vt -> v1 . maj == 1 )
-    {
-        /* check v1.1 methods */
-        if ( vt -> v1 . destroy == NULL ||
-             vt -> v1 . count == NULL ||
-             vt -> v1 . depth == NULL ||
-             vt -> v1 . size == NULL ||
-             vt -> v1 . get_node_data == NULL ||
-             vt -> v1 . find == NULL ||
-             vt -> v1 . for_each == NULL ||
-             vt -> v1 . do_until == NULL )
-        return RC ( rcCont, rcTree, rcConstructing, rcInterface, rcNull );
-    }
-#endif
-
-    /* everything is okay */
-    self -> vt = vt;
-    self -> pt = pt;
-    return 0;
-}
-
-
-/* Count
- *  returns number of elements in b-tree
- */
-LIB_EXPORT uint32_t CC PBSTreeCount ( const PBSTree *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            return ( * self -> vt -> v1 . count ) ( self );
-        }
-    }
-    return 0;
-}
-
-/* Depth
- *  returns number of layers in b-tree
- */
-LIB_EXPORT uint32_t CC PBSTreeDepth ( const PBSTree *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            return ( * self -> vt -> v1 . depth ) ( self );
-        }
-    }
-
-    return 0;
-}
-
-/* Size
- *  returns the size in bytes
- *  of the PBSTree image
- */
-LIB_EXPORT size_t CC PBSTreeSize ( const PBSTree *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            return ( * self -> vt -> v1 . size ) ( self );
-        }
-    }
-
-    return 0;
-}
-
-
-/* GetNodeData - INTERNAL
- *  finds node data boundaries
- */
-rc_t PBSTreeGetNodeData ( const PBSTree *self,
-    const void **addr, size_t *size, uint32_t id )
-{
-    assert ( self != NULL );
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . get_node_data ) ( self, addr, size, id );
-    }
-
-    return RC ( rcCont, rcTree, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* GetNode
- *  gets a PBSTNode from an id
- *
- *  "node" [ OUT ] - return parameter for node
- *
- *  "id" [ IN ] - a 1-based integer node id
- *
- *  return values:
- *    EINVAL => an invalid parameter was passed
- *    ENOENT => id out of range
- */
-LIB_EXPORT rc_t CC PBSTreeGetNode ( const PBSTree *self, PBSTNode *node, uint32_t id )
-{
-    rc_t rc;
-    if ( node == NULL )
-        rc = RC ( rcCont, rcTree, rcAccessing, rcNode, rcNull );
-    else
-    {
-        if ( self == NULL)
-            rc = RC ( rcCont, rcTree, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = PBSTreeGetNodeData ( self,
-                & node -> data . addr, & node -> data . size, id );
-            if ( rc == 0 )
-            {
-                node -> internal = self;
-                node -> id = id;
-                return 0;
-            }
-        }
-
-        node -> data . addr = node -> internal = NULL;
-        node -> data . size = 0;
-        node -> id = 0;
-    }
-    return rc;
-}
-
-/* PBSTreeFind
- *  find an object within tree
- *  "cmp" function returns equivalent of "item" - "n"
- */
-LIB_EXPORT uint32_t CC PBSTreeFind ( const PBSTree *self, PBSTNode *n, const void *item,
-    int ( CC * cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data )
-{
-    PBSTNode buffer;
-
-    if ( n == NULL )
-        n = & buffer;
-
-    n -> internal = self;
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            return ( * self -> vt -> v1 . find ) ( self, n, item, cmp, data );
-        }
-    }
-
-    n -> data . addr = NULL;
-    n -> data . size = 0;
-    return n -> id = 0;
-}
-
-/* PBSTreeForEach
- *  executes a function on each tree element
- */
-LIB_EXPORT void CC PBSTreeForEach ( const PBSTree *self, bool reverse,
-    void ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    if ( self != NULL && f != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            ( * self -> vt -> v1 . for_each ) ( self, reverse, f, data );
-            break;
-        }
-    }
-}
-
-/* PBSTreeDoUntil
- *  executes a function on each element
- *  until the function returns true
- */
-LIB_EXPORT bool CC PBSTreeDoUntil ( const PBSTree *self, bool reverse,
-    bool ( CC * f ) ( PBSTNode *n, void *data ), void *data )
-{
-    if ( self != NULL && f != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            return ( * self -> vt -> v1 . do_until ) ( self, reverse, f, data );
-        }
-    }
-
-    return false;
-}
-
-/* PBSTreeWhack
- *  whacks PBSTree object
- *  does not free memory reference
- */
-LIB_EXPORT void CC PBSTreeWhack ( PBSTree *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-            ( * self -> vt -> v1 . destroy ) ( self );
-            break;
-        }
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * PBSTNode
- *  identifies a node within persisted b-tree
- */
-
-/* Next
- *  returns next node id
- */
-LIB_EXPORT uint32_t CC PBSTNodeNext ( PBSTNode *n )
-{
-    if ( n == NULL )
-        return 0;
-
-    if ( PBSTreeGetNodeData ( n -> internal,
-             & n -> data . addr, & n -> data . size, n -> id + 1 ) )
-        return 0;
-
-    return ++ n -> id;
-}
-
-/* Prev
- *  returns prev node id
- */
-LIB_EXPORT uint32_t CC PBSTNodePrev ( PBSTNode *n )
-{
-    if ( n == NULL )
-        return 0;
-
-    if ( PBSTreeGetNodeData ( n -> internal,
-             & n -> data . addr, & n -> data . size, n -> id - 1 ) )
-        return 0;
-
-    return -- n -> id;
-}
-
-/* FindNext
- *  find next element satisfying criteria
- */
-LIB_EXPORT uint32_t CC PBSTNodeFindNext ( PBSTNode *n,
-    bool ( CC * f ) ( const PBSTNode *n ) )
-{
-    PBSTNode save;
-
-    if ( n == NULL || f == NULL )
-        return 0;
-
-    save = * n;
-
-    while ( PBSTNodeNext ( n ) )
-    {
-        if ( ( * f ) ( n ) )
-            return n -> id;
-    }
-
-    * n = save;
-    return 0;
-}
-
-/* FindPrev
- *  find previous element satisfying criteria
- */
-LIB_EXPORT uint32_t CC PBSTNodeFindPrev ( PBSTNode *n, 
-    bool ( CC * f ) ( const PBSTNode *n ) )
-{
-    PBSTNode save;
-
-    if ( n == NULL || f == NULL )
-        return 0;
-
-    save = * n;
-
-    while ( PBSTNodePrev ( n ) )
-    {
-        if ( ( * f ) ( n ) )
-            return n -> id;
-    }
-
-    * n = save;
-    return 0;
-}
diff --git a/libs/klib/printf.c b/libs/klib/printf.c
deleted file mode 100644
index 2907575..0000000
--- a/libs/klib/printf.c
+++ /dev/null
@@ -1,3540 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/writer.h>
-#include <klib/symbol.h>
-#include <klib/time.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-
-#include "writer-priv.h"
-
-#include <os-native.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <assert.h>
-#include <va_copy.h>
-
-/* the number of PrintFmt, PrintArg and String
-   elements to allocate in function-local storage */
-#define LOCAL_FMT_COUNT 64
-
-
-/* for testing purposes - temporarily define this guy */
-#define STDC_COMPATIBILITY 1
-
-/***********************************
- * OLD PRINTF CODE IS NOW INACTIVE *
- ***********************************/
-#define USE_OLD_PRINTF 0
-
-/***********************************
- * OUR OLD BUDDY                   *
- ***********************************/
-#if WINDOWS
-#undef snprintf
-#define snprintf _snprintf
-#endif
-
-/**************************************
- * NAMING TRICKS TO HAVE BOTH ON HAND *
- **************************************/
-#if USE_OLD_PRINTF
-#define old_string_vprintf string_vprintf
-#define old_string_printf string_printf
-#define old_vkfprintf vkfprintf
-#define old_kfprintf kfprintf
-#else
-#define new_string_vprintf string_vprintf
-#define new_string_printf string_printf
-#define new_vkfprintf vkfprintf
-#define new_kfprintf kfprintf
-#endif
-
-/************************************
- * BEHAVIORS SENSITIVE TO STDC MODE *
- ************************************/
-#if STDC_COMPATIBILITY
-#define NULL_STRING_TEXT "(null)"
-#else
-#define NULL_STRING_TEXT "NULL"
-#endif
-#define DOUSE_NUM_PREFIX_IF_ZERO              STDC_COMPATIBILITY
-#define KEEP_OCT_PREFIX_IF_ZERO               STDC_COMPATIBILITY
-#define OCTAL_PREFIX_COUNTS_TOWARD_PRECISION  STDC_COMPATIBILITY
-#define HEX_PREFIX_FOLLOWS_CASE               STDC_COMPATIBILITY
-/* Present in 2.3.3 (from SLES 9.3), absent in 2.5 (from CentOS 5.6) */
-#define EMULATE_SMALLINT_EXTENSION_BUG      ( STDC_COMPATIBILITY && defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 5) ) )
-#define ZERO_PAD_ONLY_NUMBERS               ( !STDC_COMPATIBILITY || defined(__GLIBC__) )
-
-#define USE_LIB_FLOAT 1
-
-static
-size_t string_flush ( char *dst, size_t bsize, const KWrtHandler *flush, rc_t *rc, size_t *total )
-{
-    size_t num_writ, flushed;
-    for ( flushed = 0; flushed < bsize; flushed += num_writ )
-    {
-        * rc = ( * flush -> writer ) ( flush -> data, dst, bsize, & num_writ );
-        if ( * rc != 0 )
-            break;
-        if ( num_writ == 0 )
-            break;
-    }
-
-    if ( * rc == 0 )
-    {
-        * total += flushed;
-        if ( flushed < bsize )
-            memmove ( dst, dst + flushed, bsize - flushed );
-    }
-
-    return bsize - flushed;
-}
-
-static
-rc_t CC string_flush_printf ( char *dst, size_t bsize,
-    const KWrtHandler *flush, size_t *num_writ, const char *fmt, ... );
-
-static
-rc_t string_flush_vprintf ( char *dst, size_t bsize, const KWrtHandler *flush,
-    size_t *num_writ, const char *fmt, va_list args )
-{
-    rc_t rc;
-    size_t sidx, didx, total, sz;
-
-    uint32_t *np;
-    uint32_t u32;
-    int64_t i64;
-    uint64_t u64;
-    double f64;
-#if ! USE_LIB_FLOAT
-    uint64_t frac;
-    double ftmp;
-    uint32_t exponent;
-#endif
-    const char *cp, *end;
-    const String *str;
-    const KSymbol *sym;
-    const KTime *tm;
-
-    char buff [ 256 ];
-    char use_sign, padding;
-    const char *hex_digits;
-    uint32_t i, j, len, digits, min_field_width, max_field_width, precision;
-    bool left_align, comma_separate, have_precision, byte_size, half_size, long_size;
-    bool alternate, trim_trailing_zeros, date_time_zone;
-
-    if ( fmt == NULL )
-    {
-        rc = RC ( rcText, rcString, rcFormatting, rcParam, rcNull );
-        if ( num_writ != NULL )
-            * num_writ = 0;
-        return rc;
-    }
-
-    if ( fmt [ 0 ] == 0 )
-    {
-        rc = RC ( rcText, rcString, rcFormatting, rcParam, rcEmpty );
-        if ( num_writ != NULL )
-            * num_writ = 0;
-        return rc;
-    }
-
-    if ( dst == NULL )
-    {
-        flush = NULL;
-        bsize = 0;
-    }
-
-    for ( rc = 0, sidx = didx = total = 0; fmt [ sidx ] != 0 && rc == 0; ++ sidx )
-    {
-        /* flush buffer */
-        if ( didx == bsize && flush != NULL )
-        {
-            didx = string_flush ( dst, didx, flush, & rc, & total );
-            if ( rc != 0 )
-                break;
-        }
-
-        /* copy until ending NUL or '%' */
-        if ( fmt [ sidx ] != '%' )
-        {
-            if ( didx < bsize )
-                dst [ didx ] = fmt [ sidx ];
-            ++ didx;
-            continue;
-        }
-
-        /* process escaped '%' */
-        if ( fmt [ ++ sidx ] == '%' )
-        {
-            if ( didx < bsize )
-                dst [ didx ] = '%';
-            ++ didx;
-            continue;
-        }
-
-        digits = 0;
-
-        /* process flags */
-        use_sign = 0;
-        left_align = comma_separate = alternate = false;
-        padding = ' ';
-
-        while ( 1 )
-        {
-            switch ( fmt [ sidx ] )
-            {
-            case '-':
-                left_align = true;
-                padding = ' ';
-                ++ sidx;
-                continue;
-            case '+':
-                use_sign = '+';
-                ++ sidx;
-                continue;
-            case ' ':
-                if ( use_sign != '+' )
-                    use_sign = ' ';
-                ++ sidx;
-                continue;
-            case '0':
-                if ( ! left_align )
-                    padding = '0';
-                ++ sidx;
-                continue;
-            case ',':
-            case '\'':
-                comma_separate = true;
-                ++ sidx;
-                continue;
-            case '#':
-                alternate = true;
-                ++ sidx;
-                continue;
-            }
-
-            break;
-        }
-
-        /* field width */
-        min_field_width = 0;
-        if ( fmt [ sidx ] == '*' )
-        {
-            min_field_width = va_arg ( args, unsigned int );
-            ++ sidx;
-        }
-        else while ( isdigit ( fmt [ sidx ] ) )
-        {
-            min_field_width *= 10;
-            min_field_width += fmt [ sidx ++ ] - '0';
-        }
-
-        /* precision */
-        precision = 0;
-        have_precision = false;
-        if ( fmt [ sidx ] == '.' )
-        {
-            padding = ' ';
-            have_precision = true;
-            if ( fmt [ ++ sidx ] == '*' ) {
-                precision = va_arg ( args, unsigned int );
-                sidx++;
-            } else for ( ; isdigit ( fmt [ sidx ] ); ++ sidx )
-            {
-                precision *= 10;
-                precision += fmt [ sidx ] - '0';
-            }
-        }
-
-        /* storage size */
-        byte_size = half_size = long_size = date_time_zone = false;
-        switch ( fmt [ sidx ] )
-        {
-        case 't':
-            byte_size = true;
-            ++ sidx;
-            break;
-        case 'h':
-            /* this should not be necessary */
-            if ( fmt [  ++ sidx ] != 'h' )
-                half_size = true;
-            else
-            {
-                byte_size = true;
-                ++ sidx;
-            }
-            break;
-        case 'l':
-            long_size = true;
-            ++ sidx;
-            break;
-        case 'z':
-            date_time_zone = true;
-            if ( sizeof ( size_t ) == sizeof ( uint64_t ) )
-                long_size = true;
-            ++ sidx;
-            break;
-        }
-
-        /* format */
-        trim_trailing_zeros = false;
-        switch ( fmt [  sidx  ] )
-        {
-        case 'd':
-        case 'i':
-
-            /* retrieve argument as signed integer */
-            if ( byte_size )
-                i64 = ( int8_t ) va_arg ( args, int );
-            else if ( half_size )
-                i64 = ( int16_t ) va_arg ( args, int );
-            else if ( long_size )
-                i64 = va_arg ( args, int64_t );
-            else
-                i64 = va_arg ( args, int32_t );
-
-#if ! STDC_COMPATIBILITY
-            /* detect zero */
-            if ( i64 == 0 )
-                use_sign = 0;
-            else
-#endif
-            /* detect negative */
-            if ( i64 < 0 )
-            {
-                use_sign = '-';
-                i64 = - i64;
-            }
-
-            i = sizeof buff;
-
-#if ! USE_LIB_FLOAT
-        make_signed_integer:
-#endif
-            /* convert to numeral */
-            if ( comma_separate ) for ( -- i, j = 0; ; -- i, ++ j )
-            {
-                if ( j == 3 )
-                {
-                    buff [ -- i ] = ',';
-                    j = 0;
-                }
-                buff [ i ] =  ( i64 % 10 ) + '0';
-                ++ digits;
-                if ( ( i64 /= 10 ) == 0 )
-                    break;
-            }
-            else for ( -- i, digits = 0; ; -- i )
-            {
-                buff [ i ] =  ( i64 % 10 ) + '0';
-                ++ digits;
-                if ( ( i64 /= 10 ) == 0 )
-                    break;
-            }
-
-        insert_integer:
-
-            /* the actual length */
-            len = sizeof buff - i;
-
-            /* test for buffer flush */
-            if ( flush != NULL && didx < bsize )
-            {
-                max_field_width = len;
-                if ( len < precision )
-                    max_field_width = precision;
-                max_field_width += ( use_sign != 0 );
-                if ( max_field_width < min_field_width )
-                    max_field_width = min_field_width;
-                if ( didx + max_field_width > bsize )
-                {
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-                    if ( rc != 0 )
-                        break;
-                }
-            }
-
-            /* insert left-aligned */
-            if ( left_align )
-            {
-                /* sign */
-                if ( use_sign != 0 )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = use_sign;
-                    ++ didx;
-                    ++ len;
-                }
-
-                /* precision */
-                for ( ; digits < precision; ++ didx, ++ len, ++ digits )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = '0';
-                }
-
-                /* value */
-                for ( ; i < sizeof buff; ++ didx, ++ i )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = buff [ i ];
-                }
-
-                /* padding */
-                for ( ; len < min_field_width; ++ didx, ++ len )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = ' ';
-                }
-            }
-            /* insert right-aligned */
-            else
-            {
-                /* remove sign from field width */
-                if ( use_sign != 0 && min_field_width != 0 )
-                    -- min_field_width;
-
-                /* zero padding means issue sign first */
-                if ( use_sign != 0 && padding == '0' )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = use_sign;
-                    ++ didx;
-                    use_sign = 0;
-                }
-
-                /* adjust length for precision */
-                if ( precision > digits )
-                    len += precision - digits;
-
-                /* apply padding */
-                for ( ; len < min_field_width; ++ didx, -- min_field_width )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = padding;
-                }
-
-                /* sign */
-                if ( use_sign != 0 )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = use_sign;
-                    ++ didx;
-                }
-
-                /* precision */
-                for ( ; digits < precision; ++ didx, ++ digits )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = '0';
-                }
-
-                /* value */
-                for ( ; i < sizeof buff; ++ didx, ++ i )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = buff [ i ];
-                }
-            }
-
-            break;
-
-        case 'u':
-
-            /* retrieve argument as unsigned integer */
-            if ( byte_size )
-                u64 = ( uint8_t ) va_arg ( args, int );
-            else if ( half_size )
-                u64 = ( uint16_t ) va_arg ( args, int );
-            else if ( long_size )
-                u64 = va_arg ( args, uint64_t );
-            else
-                u64 = va_arg ( args, uint32_t );
-
-            /* no sign */
-            use_sign = 0;
-
-            i = sizeof buff - 1;
-
-            /* convert to numeral */
-            if ( comma_separate ) for ( j = digits = 0; ; -- i, ++ j )
-            {
-                if ( j == 3 )
-                {
-                    buff [ -- i ] = ',';
-                    j = 0;
-                }
-                buff [ i ] =  ( u64 % 10 ) + '0';
-                ++ digits;
-                if ( ( u64 /= 10 ) == 0 )
-                    break;
-            }
-            else for ( digits = 0; ; -- i )
-            {
-                buff [ i ] =  ( u64 % 10 ) + '0';
-                ++ digits;
-                if ( ( u64 /= 10 ) == 0 )
-                    break;
-            }
-
-            goto insert_integer;
-
-        case 'p':
-
-            /* retrieve argument as unsigned integer */
-            if ( sizeof ( void* ) == sizeof ( uint32_t ) )
-                u64 = va_arg ( args, uint32_t );
-            else
-                u64 = va_arg ( args, uint64_t );
-
-            goto make_hex_integer;
-
-        case 'x':
-        case 'X':
-
-            /* retrieve argument as unsigned integer */
-            if ( byte_size )
-                u64 = ( uint8_t ) va_arg ( args, int );
-            else if ( half_size )
-                u64 = ( uint16_t ) va_arg ( args, int );
-            else if ( long_size )
-                u64 = va_arg ( args, uint64_t );
-            else
-                u64 = va_arg ( args, uint32_t );
-
-        make_hex_integer:
-
-            /* choose numeric case */
-            hex_digits = ( fmt [ sidx ] == 'x' ) ?
-                "0123456789abcdefx" : "0123456789ABCDEFX";
-
-            /* no sign */
-            use_sign = 0;
-
-            i = sizeof buff - 1;
-
-            /* convert to numeral */
-            if ( comma_separate ) for ( j = digits = 0; ; -- i, ++ j )
-            {
-                if ( j == 3 )
-                {
-                    buff [ -- i ] = ',';
-                    j = 0;
-                }
-                buff [ i ] =  hex_digits [ u64 & 15 ];
-                ++ digits;
-                if ( ( u64 >>= 4 ) == 0 )
-                    break;
-            }
-            else for ( digits = 0; ; -- i )
-            {
-                buff [ i ] =  hex_digits [ u64 & 15 ];
-                ++ digits;
-                if ( ( u64 >>= 4 ) == 0 )
-                    break;
-            }
-
-            if ( alternate )
-            {
-                buff [ -- i ] = hex_digits [ 16 ];
-                buff [ -- i ] = '0';
-            }
-
-            goto insert_integer;
-
-        case 'o':
-
-            /* retrieve argument as unsigned integer */
-            if ( byte_size )
-                u64 = ( uint8_t ) va_arg ( args, int );
-            else if ( half_size )
-                u64 = ( uint16_t ) va_arg ( args, int );
-            else if ( long_size )
-                u64 = va_arg ( args, uint64_t );
-            else
-                u64 = va_arg ( args, uint32_t );
-
-            /* no sign */
-            use_sign = 0;
-
-            i = sizeof buff - 1;
-
-            /* convert to numeral */
-            if ( comma_separate ) for ( j = digits = 0; ; -- i, ++ j )
-            {
-                if ( j == 3 )
-                {
-                    buff [ -- i ] = ',';
-                    j = 0;
-                }
-                buff [ i ] =  ( u64 & 7 ) + '0';
-                ++ digits;
-                if ( ( u64 >>= 3 ) == 0 )
-                    break;
-            }
-            else for ( digits = 0; ; -- i )
-            {
-                buff [ i ] =  ( u64 & 7 ) + '0';
-                ++ digits;
-                if ( ( u64 >>= 3 ) == 0 )
-                    break;
-            }
-
-            if ( alternate )
-            {
-                buff [ -- i ] = '0';
-#if STDC_COMPATIBILITY
-                ++ digits;
-#endif
-            }
-
-            goto insert_integer;
-
-        case 'b':
-
-            /* retrieve argument as unsigned integer */
-            if ( byte_size )
-                u64 = ( uint8_t ) va_arg ( args, int );
-            else if ( half_size )
-                u64 = ( uint16_t ) va_arg ( args, int );
-            else if ( long_size )
-                u64 = va_arg ( args, uint64_t );
-            else
-                u64 = va_arg ( args, uint32_t );
-
-            /* no sign */
-            use_sign = 0;
-
-            i = sizeof buff - 1;
-
-            /* convert to numeral */
-            if ( comma_separate ) for ( j = digits = 0; ; -- i, ++ j )
-            {
-                if ( j == 3 )
-                {
-                    buff [ -- i ] = ',';
-                    j = 0;
-                }
-                buff [ i ] =  ( u64 & 1 ) + '0';
-                ++ digits;
-                if ( ( u64 >>= 1 ) == 0 )
-                    break;
-            }
-            else for ( i = sizeof buff - 1; ; -- i )
-            {
-                buff [ i ] =  ( u64 & 1 ) + '0';
-                ++ digits;
-                if ( ( u64 >>= 1 ) == 0 )
-                    break;
-            }
-
-            if ( alternate )
-            {
-                buff [ -- i ] = 'b';
-                buff [ -- i ] = '0';
-            }
-
-            goto insert_integer;
-
-#if USE_LIB_FLOAT
-        case 'g':
-        case 'e':
-        case 'f':
-        {
-            char subfmt [ 16 ];
-            char * psubfmt = subfmt;
-
-            *psubfmt++ = '%';
-
-            if (alternate)
-                *psubfmt++ = '#';
-
-            if (use_sign)
-                *psubfmt++ = use_sign;
-
-            if (left_align)
-                *psubfmt++ = '-';
-            else if (padding == '0')
-                *psubfmt++ = '0';
-
-            *psubfmt++ = '*';
-            *psubfmt++ = '.';
-            *psubfmt++ = '*';
-            *psubfmt++ = fmt [  sidx  ];
-            *psubfmt = '\0';
-            
-            /* retrieve argument as double or long double */
-        
-            if ( long_size )
-                f64 = ( double ) va_arg ( args, long double );
-            else
-                f64 = va_arg ( args, double );
-
-            if ( ! have_precision )
-                precision = 6;
-            else if ( precision > 20 )
-                precision = 20;
-
-            i = snprintf (buff, sizeof buff, subfmt, min_field_width, precision, f64);
-
-            if ( i >= sizeof buff )
-            {
-                i = sizeof buff - 1;
-                buff [ i ] = '\0';
-            }
-            min_field_width = 0;
-            have_precision = false;
-
-            cp = buff;
-            goto make_nul_term_string;
-        }
-#else
-        case 'g':
-            trim_trailing_zeros = true;
-        case 'e':
-
-#define HANDLE_NAN() \
-            switch (fpclassify (f64))                   \
-            {                                           \
-            case FP_NAN:                                \
-                cp = "nan";                             \
-                goto make_nul_term_string;              \
-            case FP_INFINITE:                           \
-                cp = (f64 < 0) ? "-inf" : "inf";        \
-                goto make_nul_term_string;              \
-            }
-
-
-            /* retrieve argument as double or long double */
-        
-            if ( long_size )
-                f64 = ( double ) va_arg ( args, long double );
-            else
-                f64 = va_arg ( args, double );
-
-            HANDLE_NAN();
-
-            if ( f64 < 0 )
-            {
-                use_sign = '-';
-                f64 = - f64;
-            }
-
-            exponent = 0;
-            buff [ sizeof buff - 3 ] = '+';
-            buff [ sizeof buff - 4 ] = 'e';
-
-            i = len = sizeof buff;
-
-            ftmp = f64;
-
-            if ( f64 >= 10.0 )
-            {
-                for ( ftmp = f64 / 10, exponent = 1; ftmp >= 10.0; ++ exponent )
-                    ftmp /= 10;
-
-                if ( exponent < precision && fmt [ sidx ] == 'g' )
-                    goto make_normal_float;
-            }
-            else if ( f64 < 1.0 && f64 > 0.0 )
-            {
-                buff [ sizeof buff - 3 ] = '-';
-                for ( ftmp = f64 * 10, exponent = 1; ftmp < 1.0; ++ exponent )
-                    ftmp *= 10;
-
-                if ( exponent <= 4 && fmt [ sidx ] == 'g' )
-                    goto make_normal_float;
-            }
-            else if ( fmt [ sidx ] == 'g' )
-            {
-                goto make_normal_float;
-            }
-
-            /* just for safety */
-            exponent %= 100;
-
-            trim_trailing_zeros = false;
-
-            f64 = ftmp;
-
-            buff [ sizeof buff - 1 ] = ( exponent % 10 ) + '0';
-            buff [ sizeof buff - 2 ] = ( exponent / 10 ) + '0';
-
-            i = len = sizeof buff - 4;
-            goto make_normal_float;
-
-        case 'f':
-
-            /* retrieve argument as double or long double */
-            if ( long_size )
-                f64 = ( double ) va_arg ( args, long double );
-            else
-                f64 = va_arg ( args, double );
-
-            HANDLE_NAN();
-
-            if ( f64 < 0 )
-            {
-                use_sign = '-';
-                f64 = - f64;
-            }
-
-            i = len = sizeof buff;
-
-        make_normal_float:
-
-            if ( ! have_precision )
-                precision = 6;
-            else if ( precision > 20 )
-                precision = 20;
-
-            ftemp = 0.5;
-            for (j = 0; j < precision ; ++j)
-                ftemp /= 10;
-
-            f64 += ftemp;
-
-
-            /* save off integral portion */
-            i64 = ( int64_t ) f64;
-
-            /* convert to fraction */
-            f64 = f64 - i64;
-
-            /* promote by precision */
-            for ( j = 0; j < precision; ++ j )
-                f64 *= 10;
-
-            for ( frac = ( uint64_t ) f64; i + precision > len; frac /= 10 )
-                buff [ -- i ] = frac % 10 + '0';
-
-            if ( trim_trailing_zeros )
-            {
-                for ( j = len; -- j >= i; -- precision )
-                {
-                    if ( buff [ j ] != '0' )
-                        break;
-                }
-
-                memmove ( & buff [ len - precision ], & buff [ i ], precision );
-                i = len - precision;
-            }
-
-            if ( precision != 0 || alternate )
-                buff [ -- i ] = '.';
-
-            goto make_signed_integer;
-#endif
-        case 'c':
-
-            /* retrieve as an int */
-            u32 = va_arg ( args, unsigned int );
-            if ( u32 < 128 )
-                buff [ i = sizeof buff - 1 ] = ( char ) u32;
-            else
-            {
-                int dbytes = utf32_utf8 ( buff, & buff [ sizeof buff ], u32 );
-                if ( dbytes <= 0 )
-                    buff [ i = sizeof buff - 1 ] = '?';
-                else
-                    memmove ( & buff [ i = sizeof buff - dbytes ], buff, dbytes );
-            }
-
-            /* precision makes no sense, but no error */
-            precision = 0;
-
-            /* sign makes no sense */
-            use_sign = 0;
-
-#if ZERO_PAD_ONLY_NUMBERS
-            /* padding is always with spaces */
-            padding = ' ';
-#endif
-
-            /* other than that, we can treat it as an integer */
-            goto insert_integer;
-
-        case 's':
-
-            /* retrieve as a NUL terminated ( or precision limited ) string */
-            cp = va_arg ( args, const char* );
-            if ( cp == NULL )
-                cp = "NULL";
-
-        make_nul_term_string:
-
-            /* in our case, no precision field means unlimited */
-            if ( ! have_precision )
-                precision = -1;
-
-#if ZERO_PAD_ONLY_NUMBERS
-            /* padding is always with spaces */
-            padding = ' ';
-#endif
-            /* test for buffer flush */
-            if ( flush != NULL && didx < bsize )
-            {
-                max_field_width = 0;
-                if ( have_precision )
-                    max_field_width = precision;
-                if ( max_field_width < min_field_width )
-                    max_field_width = min_field_width;
-                if ( didx + max_field_width > bsize )
-                {
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-                    if ( rc != 0 )
-                        break;
-                }
-            }
-
-            /* if right aligning with a minimum field width, measure string */
-            if ( ! left_align && min_field_width != 0 )
-            {
-                for ( len = 0; cp [ len ] != 0 && len < precision; ++ len )
-                    ( void ) 0;
-
-                for ( ; len < min_field_width; ++ didx, ++ len )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = padding;
-                }
-            }
-
-            /* copy string */
-            for ( i = 0; i < precision && cp [ i ] != 0; ++ didx, ++ i )
-            {
-                if ( flush != NULL && didx == bsize )
-                {
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-                    if ( rc != 0 )
-                        break;
-                }
-
-                if ( didx < bsize )
-                    dst [ didx ] = cp [ i ];
-            }
-
-            if ( rc != 0 )
-                break;
-
-            /* apply right padding */
-            if ( left_align ) for ( ; i < min_field_width; ++ didx, ++ i )
-            {
-                if ( flush != NULL && didx == bsize )
-                {
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-                    if ( rc != 0 )
-                        break;
-                }
-
-                if ( didx < bsize )
-                    dst [ didx ] = ' ';
-            }
-            break;
-
-            /* String object */
-        case 'S':
-
-            /* retrieve as a NUL terminated ( or precision limited ) string */
-            str = va_arg ( args, const String* );
-            if ( str == NULL )
-            {
-                cp = "NULL";
-                goto make_nul_term_string;
-            }
-
-        make_String:
-
-            /* in our case, no precision field means unlimited */
-            if ( ! have_precision )
-                precision = -1;
-
-            /* test for buffer flush */
-            if ( flush != NULL && didx < bsize )
-            {
-                /* buffer is measured in bytes, while printing
-                   widths are measured in characters... */
-                max_field_width = ( uint32_t ) str -> size;
-                if ( str -> len < min_field_width )
-                    max_field_width += min_field_width - str -> len;
-                if ( didx + max_field_width > bsize )
-                {
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-                    if ( rc != 0 )
-                        break;
-                }
-            }
-
-            /* if right aligning with a minimum field width, measure string */
-            if ( ! left_align && min_field_width != 0 )
-            {
-                len = str -> len;
-                if ( len > precision )
-                    len = precision;
-
-                for ( ; len < min_field_width; ++ didx, ++ len )
-                {
-                    if ( didx < bsize )
-                        dst [ didx ] = ' ';
-                }
-            }
-
-            cp = str -> addr;
-            end = cp + str -> size;
-
-            /* copy string */
-            for ( i = 0; i < str -> len && i < precision; ++ i )
-            {
-                uint32_t ch;
-                int sbytes = utf8_utf32 ( & ch, cp, end );
-                if ( sbytes <= 0 )
-                {
-                    if ( sbytes == 0 )
-                        rc = RC ( rcText, rcString, rcFormatting, rcData, rcInsufficient );
-                    else
-                        rc = RC ( rcText, rcString, rcFormatting, rcData, rcCorrupt );
-                    break;
-                }
-                cp += sbytes;
-
-                if ( didx < bsize )
-                {
-                    int dbytes = utf32_utf8 ( dst + didx, dst + bsize, ch );
-                    if ( dbytes > 0 )
-                    {
-                        didx += dbytes;
-                        continue;
-                    }
-                    if ( dbytes < 0 )
-                    {
-                        rc = RC ( rcText, rcString, rcFormatting, rcData, rcCorrupt );
-                        break;
-                    }
-                }
-
-                didx += sbytes;
-            }
-
-            /* apply right padding */
-            if ( left_align ) for ( ; i < min_field_width; ++ didx, ++ i )
-            {
-                if ( didx < bsize )
-                    dst [ didx ] = ' ';
-            }
-            break;
-
-            /* version number */
-        case 'V':
-
-            u32 = va_arg ( args, uint32_t );
-
-            if ( ! have_precision )
-            {
-                if ( ( u32 & 0xFFFF ) != 0 )
-                    precision = 3;
-                else if ( ( u32 & 0xFF0000 ) != 0 )
-                    precision = 2;
-                else
-                    precision = 1;
-            }
-
-            switch ( precision )
-            {
-            case 0:
-                cp = ""; break;
-            case 1:
-                cp ="%u"; break;
-            case 2:
-                cp ="%u.%u"; break;
-            default:
-                cp ="%u.%u.%u";
-            }
-
-            have_precision = false;
-            precision = 0;
-
-            rc = string_printf ( buff, sizeof buff, & sz,
-                                 cp,
-                                 VersionGetMajor ( u32 ),
-                                 VersionGetMinor ( u32 ),
-                                 VersionGetRelease ( u32 ) );
-            if ( rc != 0 )
-                break;
-
-            use_sign = 0;
-            padding = ' ';
-            memmove ( & buff [ i = ( uint32_t ) ( sizeof buff - sz ) ], buff, sz );
-            goto insert_integer;
-
-        case 'R':
-
-            rc = va_arg ( args, rc_t );
-            sz = KWrtFmt_rc_t ( buff, sizeof buff, alternate ? "#" : "", rc );
-            rc = 0; /* reset back to ok */
-            assert ( sz < sizeof buff );
-
-            use_sign = 0;
-            padding = ' ';
-            memmove ( & buff [ i = ( uint32_t ) ( sizeof buff - sz ) ], buff, sz );
-            goto insert_integer;
-
-        case 'N':
-
-            /* THIS IS WRONG - FIELD WIDTH AND FRIENDS WILL NOT BE USED */
-            sym = va_arg ( args, const KSymbol* );
-
-            if ( sym -> dad != NULL )
-            {
-                if ( flush != NULL )
-                    didx = string_flush ( dst, didx, flush, & rc, & total );
-
-                sz = 0;
-                rc = string_flush_printf ( & dst [ didx ], bsize - didx, flush, & sz, "%N:", sym -> dad );
-                if ( rc != 0 )
-                    break;
-
-                didx += ( uint32_t ) sz;
-                if ( flush != NULL )
-                    didx = 0;
-            }
-
-            str = & sym -> name;
-            goto make_String;
-
-        case 'T': /* KTime */
-
-            tm = va_arg ( args, const KTime* );
-
-            sz = 0;
-
-            /* LEGEND
-             *  modifier 'h' means do date only
-             *  modifier 'l' means date and time
-             *  modifier 'z' means date, time and timezone
-             *  no modifier means time
-             *  precision affects time
-             *  leading zero affects time
-             */
-            if ( date_time_zone || long_size || half_size )
-            {
-                static char const *months [ 12 ] =
-                    { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-                static char const *weekdays [ 7 ] =
-                    { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-                rc = string_printf ( buff, sizeof buff, & sz, "%s %s %u %u"
-                                     , weekdays [ tm -> weekday ]
-                                     , months [ tm -> month ]
-                                     , tm -> day + 1
-                                     , tm -> year
-                    );
-                if ( rc != 0 )
-                    break;
-            }
-
-            if ( ! half_size )
-            {
-                if ( sz != 0 )
-                    buff [ sz ++ ] = ' ';
-
-                u64 = sz;
-
-                rc = string_printf ( & buff [ sz ], sizeof buff - sz, & sz,
-                                     padding == '0' ? "%02u:%02u:%02u %cM" : "%u:%02u:%02u %cM"
-                                     , ( tm -> hour + 11 ) % 12 + 1
-                                     , tm -> minute
-                                     , tm -> second
-                                     , ( tm -> hour < 12 ) ? 'A' : 'P'
-                    );
-                if ( rc != 0 )
-                    break;
-
-                u64 += sz;
-
-                if ( date_time_zone )
-                {
-                    rc = string_printf ( & buff [ u64 ], sizeof buff - ( size_t ) u64, & sz,
-                                         " %+02d", tm -> tzoff / 60 );
-                    if ( rc != 0 )
-                        break;
-
-                    u64 += sz;
-                }
-
-                sz = ( size_t ) u64;
-            }
-
-            padding = ' ';
-            memmove ( & buff [ i = ( uint32_t ) ( sizeof buff - sz ) ], buff, sz );
-            cp = buff;
-            goto make_nul_term_string;
-
-        case '!': /* operating system error code: e.g. errno or GetLastError() */
-            u32 = va_arg ( args, uint32_t ); /* fetching it unsigned but it can be signed */
-
-            sz = KWrtFmt_error_code ( buff, sizeof buff - 1, u32 );
-            assert ( sz < sizeof buff );
-            buff [ sz ] = '\0';
-
-            padding  = ' ';
-            memmove ( & buff [ i = ( uint32_t ) ( sizeof buff - sz ) ], buff, sz );
-            cp = buff;
-            goto make_nul_term_string;
-
-        case 'n':
-
-            np = va_arg ( args, uint32_t* );
-            if ( np != NULL )
-                * np = ( uint32_t ) ( total + didx );
-            break;
-
-        case 0:
-            -- sidx;
-            break;
-
-        default:
-            rc = RC ( rcText, rcString, rcFormatting, rcFormat, rcUnrecognized );
-        }
-    }
-
-    if ( num_writ != NULL )
-        * num_writ = total + didx;
-
-    if ( flush != NULL )
-    {
-        if ( rc == 0 && didx != 0 )
-        {
-            didx = string_flush ( dst, didx, flush, & rc, & total );
-            if ( rc == 0 && didx != 0 )
-                rc = RC ( rcRuntime, rcString, rcFormatting, rcTransfer, rcIncomplete );
-        }
-    }
-    else if ( didx < bsize )
-        dst [ didx ] = 0;
-    else if ( rc == 0 )
-        rc = RC ( rcText, rcString, rcFormatting, rcBuffer, rcInsufficient );
-
-    return rc;
-}
-
-static
-rc_t CC string_flush_printf ( char *dst, size_t bsize,
-    const KWrtHandler *flush, size_t *num_writ, const char *fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = string_flush_vprintf ( dst, bsize, flush, num_writ, fmt, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC old_string_vprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, va_list args )
-{
-    return string_flush_vprintf ( dst, bsize, NULL, num_writ, fmt, args );
-}
-
-LIB_EXPORT rc_t CC old_string_printf ( char *dst, size_t bsize, size_t *num_writ, const char *fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = string_flush_vprintf ( dst, bsize, NULL, num_writ, fmt, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC old_vkfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char * fmt, va_list args )
-{
-    rc_t rc;
-
-    if ( out == NULL )
-    {
-        rc = RC ( rcRuntime, rcString, rcFormatting, rcFile, rcNull );
-        if ( num_writ != NULL )
-            * num_writ = 0;
-    }
-    else
-    {
-        char buff [ 4096 ];
-        rc = string_flush_vprintf ( buff, sizeof buff, out, num_writ, fmt, args );
-        if ( rc != 0 )
-            rc = ResetRCContext ( rc, rcRuntime, rcString, rcFormatting );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC old_kfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = old_vkfprintf ( out, num_writ, fmt, args );
-        
-    va_end ( args );
-
-    return rc;
-}
-
-/****************************
- * NEW PRINTF IS NOW ACTIVE *
- ****************************/
-
-/* create_overflow
- *  create a buffer so large that it cannot overflow again
- *  copy in existing structures
- *  map self-referential pointers
- */
-static
-rc_t create_overflow ( KDataBuffer *overflow, const char *fmt_str,
-    String **strp, PrintFmt **fmtp, PrintArg **argp,
-    uint32_t str_idx, uint32_t fmt_idx, uint32_t arg_idx )
-{
-    /* measure the format string and infer that
-       we can never have more format items than
-       characters in the string... */
-    size_t fmt_str_size = strlen ( fmt_str );
-
-    /* our size will create a format and argument
-       for every byte. this should be a total overkill. */
-    size_t buff_size = ( sizeof ** strp + sizeof ** fmtp + sizeof **argp ) * fmt_str_size;
-
-    /* make the buffer */
-    rc_t rc = KDataBufferMakeBytes ( overflow, buff_size );
-    if ( rc == 0 )
-    {
-        /* capture pointers to stack structures */
-        const String *str = * strp;
-        const PrintFmt *fmt = * fmtp;
-        const PrintArg *args = * argp;
-
-        /* destination pointers */
-        String *dstr = overflow -> base;
-        PrintFmt *dfmt = ( void* ) ( dstr + fmt_str_size );
-        PrintArg *dargs = ( void* ) ( dfmt + fmt_str_size );
-
-        /* copy existing data */
-        memcpy ( dstr, str, str_idx * sizeof * dstr );
-        memcpy ( dfmt, fmt, fmt_idx * sizeof * dfmt );
-        memcpy ( dargs, args, arg_idx * sizeof * dargs );
-
-        /* if there are any pointers into "str", relocate them */
-        if ( str_idx != 0 )
-        {
-            uint32_t i, j;
-            for ( i = j = 0; i < fmt_idx && j < str_idx; ++ i )
-            {
-                switch ( dfmt [ i ] . type )
-                {
-                case sptString:
-                case sptUCS2String:
-                case sptUTF32String:
-                    if ( dargs [ i ] . S == & str [ j ] )
-                        dargs [ i ] . S = & dstr [ j ++ ];
-                    break;
-                }
-            }
-        }
-
-        /* replace pointers */
-        * strp = dstr;
-        * fmtp = dfmt;
-        * argp = dargs;
-   }
-
-    return rc;
-}
-
-
-/* parse_format_string
- *  parse format string and args into structured format
- */
-static
-rc_t parse_format_string ( const char *fmt_str, va_list vargs,
-    String **strp, PrintFmt **fmtp, PrintArg **argp, KDataBuffer *overflow )
-{
-    rc_t rc;
-    uint32_t i, str_idx, fmt_idx, arg_idx;
-
-    String *str = * strp;
-    PrintFmt *fmt = * fmtp;
-    PrintArg *args = * argp;
-
-    /* loop over format string */
-    for ( rc = 0, i = str_idx = fmt_idx = arg_idx = 0; fmt_str [ i ] != 0; ++ i )
-    {
-        bool alternate, numeric;
-        char size_modifier, time_modifier;
-        bool has_width, has_precision;
-        bool has_index, infinite_first;
-
-        /* loop to gather literal portions */
-        uint32_t start;
-        for ( start = i; ; ++ i )
-        {
-            /* run until we hit start of substitution token
-               or until we hit end of format string */
-            if ( fmt_str [ i ] != 0 && fmt_str [ i ] != '%' )
-                continue;
-
-            /* detect a literal string */
-            if ( i != start )
-            {
-                /* expand into overflow */
-                if ( fmt_idx == LOCAL_FMT_COUNT )
-                {
-                    rc = create_overflow ( overflow, fmt_str,
-                        strp, fmtp, argp, str_idx, fmt_idx, arg_idx );
-                    if ( rc != 0 )
-                        return rc;
-
-                    str = * strp;
-                    fmt = * fmtp;
-                    args = * argp;
-                }
-
-                /* create a text-literal format */
-                memset ( & fmt [ fmt_idx ], 0, sizeof fmt [ 0 ] );
-                fmt [ fmt_idx ] . u . l . text = & fmt_str [ start ];
-                fmt [ fmt_idx ] . u . l . size = i - start;
-                fmt [ fmt_idx ] . fmt = spfText;
-                fmt [ fmt_idx ] . type = sptLiteral;
-
-                /* increment counter */
-                ++ fmt_idx;
-            }
-
-            /* detect escape sequence */
-            if ( fmt_str [ i ] == 0 || fmt_str [ i + 1 ] != '%' )
-                break;
-
-            /* skip over escape */
-            start = ++ i;
-        }
-
-        /* done when NUL byte is seen */
-        if ( fmt_str [ i ] == 0 )
-            break;
-
-        /* detect overflow */
-        if ( fmt_idx == LOCAL_FMT_COUNT )
-        {
-            rc = create_overflow ( overflow, fmt_str,
-                strp, fmtp, argp, str_idx, fmt_idx, arg_idx );
-            if ( rc != 0 )
-                return rc;
-
-            str = * strp;
-            fmt = * fmtp;
-            args = * argp;
-        }
-
-        /* initial format
-         *  thousands_separate    = false
-         *  add_prefix            = false
-         *  force_decimal_point   = false
-         *  leave_trailing_zeros  = false
-         *  print_time            = false
-         *  print_date            = false
-         *  print_weekday         = false
-         *  print_timezone        = false
-         *  hour_24               = false
-         *  sign                  = 0
-         *  left_fill             = space
-         */
-        memset ( & fmt [ fmt_idx ], 0, sizeof fmt [ 0 ] );
-        fmt [ fmt_idx ] . left_fill = ' ';
-
-        /* scan flags */
-        alternate = false;
-        while ( 1 )
-        {
-            switch ( fmt_str [ ++ i ] )
-            {
-                /* plus and space modify application of sign
-                   to signed integer and floating point conversions.
-                   plus overrides space. */
-            case ' ':
-                if ( fmt [ fmt_idx ] . sign == 0 )
-            case '+':
-                    fmt [ fmt_idx ] . sign = fmt_str [ i ];
-                continue;
-
-                /* dash indicates left-alignment. indicate this
-                   by setting "left_fill" to NUL. */
-            case '-':
-                fmt [ fmt_idx ] . left_fill = 0;
-                continue;
-
-                /* zero indicates an alternate left-fill for
-                   numeric conversions. the zero is inserted before
-                   any sign character in { '+', '-' or ' ' }.
-                   since "left_fill" is also used to indicate
-                   alignment, only store when right aligning. */
-            case '0':
-                if ( fmt [ fmt_idx ] . left_fill != 0 )
-                    fmt [ fmt_idx ] . left_fill = '0';
-                continue;
-
-                /* hash indicates that the formatter should use an
-                   "alternate" approach. that approach is specific
-                   to the format. */
-            case '#':
-                alternate = true;
-                continue;
-
-                /* comma ( or apostrophe outside of US ) indicates
-                   that the integer portion of a numeral should use
-                   a comma as a thousands separator for legibility. */
-            case ',':
-            case '\'':
-                fmt [ fmt_idx ] . thousands_separate = 1;
-                continue;
-            }
-
-            /* we've hit a non-flag character */
-            break;
-        }
-
-        /* minimum field width */
-        has_width = false;
-        if ( isdigit ( fmt_str [ i ] ) )
-        {
-            /* literal */
-            has_width = true;
-            fmt [ fmt_idx ] . u . f . min_field_width = fmt_str [ i ] - '0';
-            while ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                fmt [ fmt_idx ] . u . f . min_field_width *= 10;
-                fmt [ fmt_idx ] . u . f . min_field_width += fmt_str [ i ] - '0';
-            }
-        }
-        else if ( fmt_str [ i ] == '*' )
-        {
-            /* external - we populate the structure directly
-               rather than marking the value as external */
-            has_width = true;
-            fmt [ fmt_idx ] . u . f . min_field_width = va_arg ( vargs, uint32_t );
-            ++ i;
-        }
-
-        /* precision */
-        has_precision = false;
-        if ( fmt_str [ i ] == '.' )
-        {
-            /* a single dot implies a precision value of 0 */
-            has_precision = true;
-
-            if ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                /* a literal precision */
-                fmt [ fmt_idx ] . u . f . precision = fmt_str [ i ] - '0';
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    fmt [ fmt_idx ] . u . f . precision *= 10;
-                    fmt [ fmt_idx ] . u . f . precision += fmt_str [ i ] - '0';
-                }
-            }
-            else if ( fmt_str [ i ] == '*' )
-            {
-                /* external - again populate directly */
-                fmt [ fmt_idx ] . u . f . precision = va_arg ( vargs, uint32_t );
-                ++ i;
-            }
-            else if ( fmt_str [ i ] == '-' )
-            {
-                /* eat a negative precision - treat as 0 */
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                    ( void ) 0;
-            }
-        }
-
-        /* index - given when parameter is a vector */
-        has_index = infinite_first = false;
-        if ( fmt_str [ i ] == ':' )
-        {
-            bool has_start, has_len, has_end, end_is_stop;
-            has_start = has_len = has_end = end_is_stop = false;
-
-            /* parameter is taken as a vector,
-               with a default index starting at 0 */
-            has_index = true;
-
-            if ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                /* literal index */
-                fmt [ fmt_idx ] . u . f . start_idx = fmt_str [ i ] - '0';
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    fmt [ fmt_idx ] . u . f . start_idx *= 10;
-                    fmt [ fmt_idx ] . u . f . start_idx += fmt_str [ i ] - '0';
-                }
-                has_start = true;
-            }
-            else switch ( fmt_str [ i ] )
-            {
-            case '*':
-                /* external index, captured directly */
-                fmt [ fmt_idx ] . u . f . start_idx = va_arg ( vargs, uint32_t );
-                ++ i;
-                has_start = true;
-                break;
-            case '$':
-                ++ i;
-                has_start = infinite_first = true;
-                break;
-            }
-
-            /* detect range */
-            switch ( fmt_str [ i ] )
-            {
-                /* given as start-stop */
-            case '-':
-                end_is_stop = true;
-
-                /* given as start/len */
-            case '/':
-
-                has_len = true;
-
-                if ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    /* literal selection length or end */
-                    fmt [ fmt_idx ] . u . f . select_len = fmt_str [ i ] - '0';
-                    while ( isdigit ( fmt_str [ ++ i ] ) )
-                    {
-                        fmt [ fmt_idx ] . u . f . select_len *= 10;
-                        fmt [ fmt_idx ] . u . f . select_len += fmt_str [ i ] - '0';
-                    }
-                    has_end = true;
-                }
-                else switch ( fmt_str [ i ] )
-                {
-                case '*':
-                    /* external selection length or end */
-                    fmt [ fmt_idx ] . u . f . select_len = va_arg ( vargs, uint32_t );
-                    ++ i;
-                    has_end = true;
-                    break;
-                case '$':
-                    ++ i;
-                    end_is_stop = false;
-                    break;
-                case '-':
-                    /* negatives are garbage */
-                    while ( isdigit ( fmt_str [ ++ i ] ) )
-                        ( void ) 0;
-                    break;
-                default:
-                    end_is_stop = false;
-                }
-                break;
-            }
-
-            /* massage values */
-            if ( infinite_first )
-            {
-                /* having an infinite first forces length of 1 */
-                fmt [ fmt_idx ] . u . f . select_len = 1;
-            }
-            else if ( has_len )
-            {
-                /* if either a number or an external value was given */
-                if ( has_end && end_is_stop )
-                {
-                    /* end <= start is translated to length 1 */
-                    if ( fmt [ fmt_idx ] . u . f . select_len <= fmt [ fmt_idx ] . u . f . start_idx )
-                        fmt [ fmt_idx ] . u . f . select_len = 1;
-
-                    /* end > start is translated to stated length */
-                    else
-                        fmt [ fmt_idx ] . u . f . select_len -= fmt [ fmt_idx ] . u . f . start_idx - 1;
-                }
-            }
-            else if ( has_start )
-            {
-                /* with no end specified, selection length is 1 */
-                fmt [ fmt_idx ] . u . f . select_len = 1;
-            }
-        }
-
-        /* size - one of the greatest leg-irons in the C legacy,
-           guess at the parameter size so that va_arg can extract
-           it properly. rather than using predictable parameter sizes,
-           they are fuzzy. we have ( mostly ) kept them for tradition...
-           if no modifier is given, 32-bit is assumed for integer and
-           64-bit for floating point. */
-        size_modifier = time_modifier = 0;
-        switch ( fmt_str [ i ] )
-        {
-            /* "Tiny" modifier - like "hh" in C format */
-        case 't':
-            /* "Half" modifier - same as C format */
-        case 'h':
-            /* "Long" modifier - means 64-bit for integers, otherwise like C */
-        case 'l':
-            size_modifier = time_modifier = fmt_str [ i ++ ];
-            break;
-            /* "siZe" modifier - whatever the size of size_t is */
-        case 'z':
-            ++ i;
-            time_modifier = 'z';
-            if ( sizeof ( size_t ) == sizeof ( uint64_t ) )
-                size_modifier = 'l';
-            break;
-        }
-
-        /* output format
-           describes the formatting to apply on output
-           if precision has not been set, give it a default value */
-        numeric = false;
-        fmt [ fmt_idx ] . pointer_arg = has_index;
-        switch ( fmt_str [ i ] )
-        {
-            /* decimal signed integer */
-        case 'd':
-        case 'i':
-            fmt [ fmt_idx ] . radix = 10;
-            fmt [ fmt_idx ] . fmt = spfSignedInt;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 1;
-            else if ( fmt [ fmt_idx ] . left_fill == '0' )
-                fmt [ fmt_idx ] . left_fill = ' ';
-            break;
-
-            /* decimal unsigned integer */
-        case 'u':
-            fmt [ fmt_idx ] . radix = 10;
-        unsigned_int:
-            fmt [ fmt_idx ] . fmt = spfUnsigned;
-            fmt [ fmt_idx ] . sign = 0;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 1;
-            else if ( fmt [ fmt_idx ] . left_fill == '0' )
-                fmt [ fmt_idx ] . left_fill = ' ';
-            break;
-
-            /* hex unsigned integer */
-        case 'x':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 16;
-            goto unsigned_int;
-
-            /* upper-case hex unsigned integer or pointer value */
-        case 'X':
-        case 'p':
-            fmt [ fmt_idx ] . upper_case_num = 1;
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 16;
-            goto unsigned_int;
-
-            /* octal unsigned integer */
-        case 'o':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 8;
-            goto unsigned_int;
-
-            /* binary unsigned integer */
-        case 'b':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 2;
-            goto unsigned_int;
-
-            /* decimal signed floating point */
-        case 'f':
-            fmt [ fmt_idx ] . fmt = spfStdFloat;
-        fmt_float:
-            fmt [ fmt_idx ] . radix = 10;
-            fmt [ fmt_idx ] . force_decimal_point = alternate;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 6;
-            break;
-
-            /* scientific notation floating point */
-        case 'e':
-            fmt [ fmt_idx ] . fmt = spfSciFloat;
-            goto fmt_float;
-
-            /* "general" floating point */
-        case 'g':
-            fmt [ fmt_idx ] . leave_trailing_zeros = alternate;
-            fmt [ fmt_idx ] . fmt = spfGenFloat;
-            goto fmt_float;
-
-            /* character data */
-        case 's':
-        case 'S':
-            fmt [ fmt_idx ] . pointer_arg = 1;
-            if ( ! has_precision )
-            /* no break */
-        case 'c':
-                fmt [ fmt_idx ] . u . f . precision = -1;
-            fmt [ fmt_idx ] . fmt = spfText;
-            break;
-            
-            /* KSymbol* */
-        case 'N':
-            fmt [ fmt_idx ] . pointer_arg = 1;
-            fmt [ fmt_idx ] . fmt = spfSymbol;
-            break;
-
-            /* ver_t */
-        case 'V':
-            size_modifier = ( sizeof ( ver_t ) == sizeof ( uint32_t ) ) ? 0 : 'l';
-            fmt [ fmt_idx ] . min_vers_components = ! has_precision;
-            fmt [ fmt_idx ] . fmt = spfVersion;
-            break;
-
-            /* rc_t */
-        case 'R':
-            size_modifier = ( sizeof ( rc_t ) == sizeof ( uint32_t ) ) ? 0 : 'l';
-            fmt [ fmt_idx ] . explain_rc = alternate;
-            fmt [ fmt_idx ] . fmt = spfRC;
-            break;
-
-            /* KTime* */
-        case 'T':
-            fmt [ fmt_idx ] . pointer_arg = 1;
-            fmt [ fmt_idx ] . fmt = spfTime;
-            numeric = true;
-
-            /* here, the "size" modifier is interpreted
-               as a selector for the output format. perhaps
-               it could have been a precision thing, but... */
-            switch ( time_modifier )
-            {
-                /* by itself, 'T' implies print the time */
-            case 0:
-                fmt [ fmt_idx ] . print_time = 1;
-                break;
-
-                /* "half" 'T' means the date */
-            case 'h':
-                fmt [ fmt_idx ] . print_date = 1;
-                break;
-
-                /* "zone" 'T' means long date with time zone */
-            case 'z':
-                fmt [ fmt_idx ] . print_timezone = 1;
-                /* no break */
-
-                /* "long" 'T' means date and time */
-            case 'l':
-                fmt [ fmt_idx ] . print_time = 1;
-                fmt [ fmt_idx ] . print_date = 1;
-                fmt [ fmt_idx ] . print_weekday = 1;
-                break;
-            }
-            break;
-
-            /* OS-specific error code:
-               int on Unix-like systems
-               DWORD on Windows */
-        case '!':
-            size_modifier = 0;
-            fmt [ fmt_idx ] . fmt = spfOSErr;
-            break;
-
-#if SUPPORT_PERCENT_N
-            /* awful out parameter giving characters printed so far */
-        case 'n':
-            fmt [ fmt_idx ] . fmt = spfNone;
-            break;
-#endif
-        default:
-            return RC ( rcText, rcString, rcFormatting, rcFormat, rcUnrecognized );
-        }
-
-#if ZERO_PAD_ONLY_NUMBERS
-        /* handle zero padding for non-numeric cases */
-        if ( ! numeric && fmt [ fmt_idx ] . left_fill == '0' )
-            fmt [ fmt_idx ] . left_fill = ' ';
-#endif
-
-        /* argument format */
-        if ( has_index )
-        {
-            /* all arguments MUST be vectors. */
-            args [ arg_idx ] . p = va_arg ( vargs, const void* );
-
-            /* discriminate on vector type */
-            switch ( fmt_str [ i ] )
-            {
-                /* signed integer */
-            case 'd':
-            case 'i':
-            case '!':
-
-                if ( infinite_first )
-                    return RC ( rcText, rcString, rcFormatting, rcIndex, rcIncorrect );
-
-                /* select from 4 possibilities */
-                switch ( size_modifier )
-                {
-                case 0:
-                    fmt [ fmt_idx ] . type = sptSignedInt32Vect;
-                    break;
-                case 'l':
-                    fmt [ fmt_idx ] . type = sptSignedInt64Vect;
-                    break;
-                case 'h':
-                    fmt [ fmt_idx ] . type = sptSignedInt16Vect;
-                    break;
-                case 't':
-                    fmt [ fmt_idx ] . type = sptSignedInt8Vect;
-                    break;
-                }
-                break;
-
-                /* pointer value - cast to 32 or 64-bit unsigned integer */
-            case 'p':
-                size_modifier = ( sizeof ( void* ) == sizeof ( uint64_t ) ) ? 'l' : 0;
-                /* no break */
-
-                /* unsigned integer */
-            case 'u':
-            case 'x':
-            case 'X':
-            case 'o':
-            case 'b':
-            case 'V':
-            case 'R':
-
-                if ( infinite_first )
-                    return RC ( rcText, rcString, rcFormatting, rcIndex, rcIncorrect );
-
-                switch ( size_modifier )
-                {
-                case 0:
-                    fmt [ fmt_idx ] . type = sptUnsignedInt32Vect;
-                    break;
-                case 'l':
-                    fmt [ fmt_idx ] . type = sptUnsignedInt64Vect;
-                    break;
-                case 'h':
-                    fmt [ fmt_idx ] . type = sptUnsignedInt16Vect;
-                    break;
-                case 't':
-                    fmt [ fmt_idx ] . type = sptUnsignedInt8Vect;
-                    break;
-                }
-                break;
-
-                /* floating point */
-            case 'e':
-            case 'f':
-            case 'g':
-
-                if ( infinite_first )
-                    return RC ( rcText, rcString, rcFormatting, rcIndex, rcIncorrect );
-
-                switch ( size_modifier )
-                {
-                case 0:
-                    fmt [ fmt_idx ] . type = sptFloat64Vect;
-                    break;
-                case 'h':
-                    fmt [ fmt_idx ] . type = sptFloat32Vect;
-                    break;
-                case 'l':
-                    fmt [ fmt_idx ] . type = sptFloatLongVect;
-                    break;
-                }
-                break;
-
-                /* character array */
-            case 'c':
-
-                /* can't determine last */
-                if ( infinite_first )
-                    return RC ( rcText, rcString, rcFormatting, rcIndex, rcIncorrect );
-
-                /* length must be bounded */
-                if ( fmt [ fmt_idx ] . u . f . select_len == 0 )
-                    fmt [ fmt_idx ] . u . f . select_len = 1;
-
-                fmt [ fmt_idx ] . type = sptNulTermString;
-                break;
-
-            case 's':
-#if STDC_COMPATIBILITY
-                if ( args [ arg_idx ] . p == NULL ) {
-                    args [ arg_idx ] . p = NULL_STRING_TEXT;
-                }
-#endif
-                /* NUL-terminated string issues */
-                if ( args [ arg_idx ] . p != NULL && infinite_first )
-                {
-                    const char *cp = args [ arg_idx ] . p;
-
-                    /* handle selection of last element */
-                    size_t len = strlen ( cp );
-                    if ( len != 0 )
-                    {
-                        fmt [ fmt_idx ] . u . f . start_idx = len - 1;
-                        fmt [ fmt_idx ] . u . f . select_len = 1;
-                    }
-                }
-
-                fmt [ fmt_idx ] . type = sptNulTermString;
-                break;
-
-                /* character string */
-            case 'S':
-
-                /* if the index starts with last element */
-                if ( args [ arg_idx ] . p != NULL && infinite_first )
-                {
-                    const String *s = args [ arg_idx ] . p;
-                    if ( s -> size != 0 )
-                    {
-                        fmt [ fmt_idx ] . u . f . start_idx = s -> size - 1;
-                        fmt [ fmt_idx ] . u . f . select_len = 1;
-                    }
-                }
-
-                fmt [ fmt_idx ] . type = sptString;
-                break;
-
-                /* no other type supports vectors */
-            default:
-                return RC ( rcText, rcString, rcFormatting, rcFormat, rcIncorrect );
-            }
-        }
-        else
-        {
-            /* scalar or string arguments */
-            switch ( fmt_str [ i ] )
-            {
-                /* signed integer */
-            case 'd':
-            case 'i':
-            case '!':
-                fmt [ fmt_idx ] . type = sptSignedInt;
-                switch ( size_modifier )
-                {
-                case 0:
-                    args [ arg_idx ] . d = va_arg ( vargs, int32_t );
-                    break;
-                case 'l':
-                    args [ arg_idx ] . d = va_arg ( vargs, int64_t );
-                    break;
-#if EMULATE_SMALLINT_EXTENSION_BUG
-                case 'h':
-                case 't':
-                    args [ arg_idx ] . d = va_arg ( vargs, int );
-                    break;
-#else
-                case 'h':
-                    args [ arg_idx ] . d = ( int16_t ) va_arg ( vargs, int );
-                    break;
-                case 't':
-                    args [ arg_idx ] . d = ( int8_t ) va_arg ( vargs, int );
-                    break;
-#endif
-                }
-                break;
-
-                /* pointer cast to uint64_t */
-            case 'p':
-                size_modifier = ( sizeof ( void* ) == sizeof ( uint64_t ) ) ? 'l' : 0;
-                /* no break */
-
-                /* unsigned integer */
-            case 'u':
-            case 'x':
-            case 'X':
-            case 'o':
-            case 'b':
-            case 'V':
-            case 'R':
-                fmt [ fmt_idx ] . type = sptUnsignedInt;
-                switch ( size_modifier )
-                {
-                case 0:
-                    args [ arg_idx ] . u = va_arg ( vargs, uint32_t );
-                    break;
-                case 'l':
-                    args [ arg_idx ] . u = va_arg ( vargs, uint64_t );
-                    break;
-                case 'h':
-                    args [ arg_idx ] . u = ( uint16_t ) va_arg ( vargs, unsigned int );
-                    break;
-                case 't':
-                    args [ arg_idx ] . u = ( uint8_t ) va_arg ( vargs, unsigned int );
-                    break;
-                }
-                break;
-
-                /* floating point */
-            case 'e':
-            case 'f':
-            case 'g':
-                fmt [ fmt_idx ] . type = sptFloat;
-                switch ( size_modifier )
-                {
-                case 0:
-                case 'h':
-                    args [ arg_idx ] . f = va_arg ( vargs, double );
-                    break;
-                case 'l':
-                    args [ arg_idx ] . f = ( double ) va_arg ( vargs, long double );
-                    break;
-                default:
-                    return RC ( rcText, rcString, rcFormatting, rcFormat, rcIncorrect );
-                }
-                break;
-
-                /* single character */
-            case 'c':
-                fmt [ fmt_idx ] . type = sptChar;
-                args [ arg_idx ] . c = va_arg ( vargs, uint32_t );
-                break;
-
-                /* NUL-terminated string */
-            case 's':
-                fmt [ fmt_idx ] . type = sptNulTermString;
-                args [ arg_idx ] . s = va_arg ( vargs, const char* );
-                break;
-
-                /* String object */
-            case 'S':
-                fmt [ fmt_idx ] . type = sptString;
-                args [ arg_idx ] . S = va_arg ( vargs, const String* );
-                break;
-
-                /* KSymbol or KTime object */
-            case 'N':
-            case 'T':
-                fmt [ fmt_idx ] . type = sptPointer;
-                args [ arg_idx ] . p = va_arg ( vargs, const void* );
-                break;
-
-#if SUPPORT_PERCENT_N
-            case 'n':
-                fmt [ fmt_idx ] . type = sptBytesPrinted;
-                args [ arg_idx ] . n = va_arg ( vargs, uint32_t* );
-                break;
-#endif
-            }
-        }
-
-        /* account for format and argument */
-        ++ fmt_idx;
-        ++ arg_idx;
-    }
-
-    /* record final fmt */
-    if ( rc == 0 )
-    {
-        if ( fmt_idx == LOCAL_FMT_COUNT )
-        {
-            rc = create_overflow ( overflow, fmt_str,
-                strp, fmtp, argp, str_idx, fmt_idx, arg_idx );
-            if ( rc != 0 )
-                return rc;
-
-            fmt = * fmtp;
-        }
-
-        memset ( & fmt [ fmt_idx ], 0, sizeof fmt [ 0 ] );
-    }
-
-    return rc;
-}
-
-
-/* KBufferedWrtHandler
- *  combines buffer and possibly NULL handler
- *  handles flushing, counting, etc.
- */
-typedef struct KBufferedWrtHandler KBufferedWrtHandler;
-struct KBufferedWrtHandler
-{
-    const KWrtHandler *handler;
-    char *buff;
-    size_t bsize;
-    size_t cur;
-    size_t flushed;
-    bool overflow;
-};
-
-
-/* flush_buffer
- *  writes data to handler
- *  or NUL-terminates buffer
- */
-static
-rc_t flush_buffer ( KBufferedWrtHandler *out )
-{
-    const KWrtHandler *flush = out -> handler;
-    if ( out -> handler != NULL )
-    {
-        rc_t rc = 0;
-        size_t num_writ, flushed;
-
-/*        assert ( out -> cur != 0 ); */
-
-        for ( flushed = 0; flushed < out -> cur; flushed += num_writ )
-        {
-            rc = ( * flush -> writer ) ( flush -> data,
-                & out -> buff [ flushed ], out -> cur - flushed, & num_writ );
-            if ( rc != 0 )
-                break;
-            if ( num_writ == 0 )
-                break;
-        }
-
-        if ( flushed == 0 )
-            return rc;
-
-        out -> flushed += flushed;
-        if ( flushed < out -> cur )
-            memmove ( out -> buff, & out -> buff [ flushed ], out -> cur - flushed );
-        out -> cur -= flushed;
-
-        return 0;
-    }
-
-    /* NB - header file states that space for NUL byte
-       is REQUIRED, so this test will declare overflow
-       whenever there is not space for the NUL termination */
-    if ( out -> cur >= out -> bsize )
-        out -> overflow = true;
-    else
-        out -> buff [ out -> cur ] = 0;
-
-    return 0;
-}
-
-static
-rc_t write_buffer ( KBufferedWrtHandler *out, const char *data, size_t bytes )
-{
-    size_t total, num_writ;
-    for ( total = 0; total < bytes; out -> cur += num_writ, total += num_writ )
-    {
-        if ( ! out -> overflow && out -> cur == out -> bsize )
-        {
-            rc_t rc = flush_buffer ( out );
-            if ( rc != 0 )
-                return rc;
-        }
-        if ( out -> overflow )
-            num_writ = bytes - total;
-        else
-        {
-            num_writ = out -> bsize - out -> cur;
-            if ( total + num_writ > bytes )
-                num_writ = bytes - total;
-            memcpy ( & out -> buff [ out -> cur ], & data [ total ], num_writ );
-        }
-    }
-    return 0;
-}
-
-
-/* print_padding
- *  issue padding characters
- */
-static
-rc_t print_padding ( KBufferedWrtHandler *out, size_t count, char pad_char )
-{
-    size_t total, num_writ;
-    for ( total = 0; total < count; out -> cur += num_writ, total += num_writ )
-    {
-        if ( ! out -> overflow && out -> cur == out -> bsize )
-        {
-            rc_t rc = flush_buffer ( out );
-            if ( rc != 0 )
-                return rc;
-        }
-        if ( out -> overflow )
-            num_writ = count - total;
-        else
-        {
-            uint32_t i = out -> cur;
-            uint32_t lim = out -> cur + count - total;
-            if ( lim > out -> bsize )
-                lim = out -> bsize;
-            for ( num_writ = lim - i; i < lim; ++ i )
-                out -> buff [ i ] = pad_char;
-        }
-    }
-    return 0;
-}
-
-/* print_nul_term_string
- */
-static
-rc_t print_nul_term_string ( KBufferedWrtHandler *out, String *S, size_t precision )
-{
-    size_t total, num_writ;
-    const char *s = S -> addr;
-
-    for ( S -> len = 0, total = 0; total < precision && s [ 0 ] != 0;
-          s += num_writ, out -> cur += num_writ, total += num_writ )
-    {
-        char *buff;
-        size_t lim;
-
-        if ( ! out -> overflow && out -> cur == out -> bsize )
-        {
-            rc_t rc = flush_buffer ( out );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        if ( out -> overflow )
-        {
-            lim = precision - total;
-
-            for ( num_writ = 0; num_writ < lim; ++ num_writ )
-            {
-                if ( s [ num_writ ] == 0 )
-                    break;
-
-                /* count characters as well as bytes */
-                if ( ( s [ num_writ ] & 0xC0 ) != 0x80 )
-                    ++ S -> len;
-            }
-        }
-        else
-        {
-            buff = out -> buff + out -> cur;
-            lim = out -> bsize - out -> cur;
-
-            if ( total + lim > precision )
-                lim = precision - total;
-
-            for ( num_writ = 0; num_writ < lim; ++ num_writ )
-            {
-                if ( s [ num_writ ] == 0 )
-                    break;
-
-                /* count characters as well as bytes */
-                if ( ( ( buff [ num_writ ] = s [ num_writ ] ) & 0xC0 ) != 0x80 )
-                    ++ S -> len;
-            }
-        }
-    }
-
-    S -> size = total;
-
-    return 0;
-}
-
-/* print_string
- */
-static
-rc_t print_string ( KBufferedWrtHandler *out, const String *s, size_t precision )
-{
-    /* TBD - this is only correct for ASCII */
-    if ( s -> size < precision )
-        precision = s -> size;
-
-    return write_buffer ( out, s -> addr, precision );
-}
-
-static
-rc_t print_symbol ( KBufferedWrtHandler *out, const KSymbol *sym )
-{
-    if ( sym -> dad != NULL )
-    {
-        rc_t rc = print_symbol ( out, sym -> dad );
-        if ( rc == 0 )
-            rc = print_padding ( out, 1, ':' );
-        if ( rc != 0 )
-            return rc;
-    }
-    return print_string ( out, & sym -> name, sym -> name . size );
-}
-
-static
-rc_t print_literal ( KBufferedWrtHandler *out, const char *text, size_t size )
-{
-    return write_buffer ( out, text, size );
-}
-
-
-/* structured_print_engine
- *  prints into a buffer
- *  if an output handler is provided, the buffer will be flushed to it as needed
- *  returns the number of BYTES written, but not the number of characters.
- */
-static const char* alnum_set [ 2 ] [ 2 ] =
-{
-    /* "normal" alpha-numeric ordering for rendering numerals */
-    {
-        "0123456789abcdefghijklmnopqrstuvwxyz",
-        "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-    },
-    /* "abnormal" alpha-numeric ordering used by SFF format */
-    {
-        "abcdefghijklmnopqrstuvwxyz0123456789",
-        "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-    }
-};
-
-static
-rc_t structured_print_engine ( KBufferedWrtHandler *out,
-    const PrintFmt *fmt, const PrintArg *args )
-{
-    rc_t rc;
-    uint32_t fmt_idx, arg_idx;
-
-    /* declare these here to stifle the compiler
-       they should most naturally be declared within the loop,
-       but since they are conditionally initialized by the switch,
-       the compiler warns they may be used before initialization.
-       rather than quiet the complaint within the loop, they have
-       been manually hoisted outside and initialized once. */
-    uint32_t i = 0;
-    int64_t i64 = 0;
-    uint64_t u64 = 0;
-    double f64 = 0;
-    const void *p = NULL;
-
-    /* most of the arguments are going to be pulled into "S" */
-    String S;
-    StringInit ( & S, NULL, 0, 0 );
-
-    /* mark no overflow */
-    out -> overflow = false;
-
-    /* loop across all format structures */
-    for ( rc = 0, out -> cur = out -> flushed = 0, fmt_idx = arg_idx = 0;
-          fmt [ fmt_idx ] . type != sptTerm; ++ fmt_idx )
-    {
-        /* copy entry - we're going to modify it */
-        PrintFmt f = fmt [ fmt_idx ];
-
-        /* ENGINE PARAMETERS */
-
-        /* padding to left side of field */
-        uint32_t left_pad;
-
-        /* sign character if not NUL */
-        char sign_char;
-
-        /* prefix for unsigned int */
-        char prefix [ 4 ];
-        uint32_t prefix_len;
-
-        /* true if performing comma separation */
-        bool comma_sep;
-
-        /* zero-fill, from either integer precision or min-field-width */
-        uint32_t zero_fill;
-
-        /* length of integer portion of numeral, prefix contribution */
-        uint32_t int_len = 0, prefix_contribution;
-
-        /* string index, from index and text precision */
-        bool text_index;
-        uint64_t text_start, text_lim;
-
-        /* END ENGINE PARAMETERS */
-
-        int cvt_len;
-        uint32_t c, *n;
-
-        const KTime *tm;
-        const KSymbol *N;
-
-        char text [ 1024 ];
-        uint32_t dst_len;
-
-        char ffmt [ 16 ];
-        const char *to_numeral, *cfmt;
-
-        /* detect literal */
-        if ( f . type == sptLiteral )
-        {
-            rc = print_literal ( out, f . u . l . text, f . u . l . size );
-            if ( rc != 0 )
-                break;
-
-            continue;
-        }
-
-        /* gather external parameters */
-        if ( f . ext_field_width )
-             f . u . f . min_field_width = args [ arg_idx ++ ] . u;
-        if ( f . ext_precision )
-            f . u . f . precision = args [ arg_idx ++ ] . u;
-        if ( f . ext_start_index )
-            f . u . f . start_idx = args [ arg_idx ++ ] . u;
-        if ( f . ext_select_len )
-            f . u . f . select_len = args [ arg_idx ++ ] . u;
-        else if ( f . ext_stop_index )
-        {
-            f . u . f . select_len = args [ arg_idx ++ ] . u;
-            if ( f . u . f . select_len <= f . u . f . start_idx )
-                f . u . f . select_len = 1;
-            else
-                f . u . f . select_len -= f . u . f . start_idx - 1;
-        }
-
-        /* early initialization */
-        text_index = false;
-        text_start = 0;
-        text_lim = -1;
-
-        /* vector parameters may have NULL pointers under certain
-           circumstances, e.g. pre-calculated format with out-of-bounds
-           index coordinates, when this is detectable. */
-        if ( f . pointer_arg && args [ arg_idx ] . p == NULL )
-        {
-            if ( f . fmt == spfText )
-            {
-                CONST_STRING ( & S, NULL_STRING_TEXT );
-                f . type_cast = 0;
-                f . type = sptString;
-                if ( f . u . f . precision < S . len )
-#if STDC_COMPATIBILITY  &&  !defined(__GLIBC__)
-                    S . size = S . len = f . u . f . precision;
-#else
-                    StringInit ( & S, "", 0, 0 );
-#endif                    
-            }
-            else
-            {
-                memset ( & f, 0, sizeof f );
-                f . u . f . precision = 1;
-                f . radix = 10;
-                f . fmt = spfUnsigned;
-                f . type = sptUnsignedInt;
-                u64 = 0;
-            }
-        }
-
-        /* get source */
-        else switch ( f . type )
-        {
-            /* scalar or vector signed integer */
-        case sptSignedInt:
-            i64 = args [ arg_idx ] . d;
-            break;
-        case sptSignedInt8Vect:
-            i64 = args [ arg_idx ] . d8 [ f . u . f . start_idx ];
-            break;
-        case sptSignedInt16Vect:
-            i64 = args [ arg_idx ] . d16 [ f . u . f . start_idx ];
-            break;
-        case sptSignedInt32Vect:
-            i64 = args [ arg_idx ] . d32 [ f . u . f . start_idx ];
-            break;
-        case sptSignedInt64Vect:
-            i64 = args [ arg_idx ] . d64 [ f . u . f . start_idx ];
-            break;
-
-            /* scalar or vector unsigned integer */
-        case sptUnsignedInt:
-            u64 = args [ arg_idx ] . u;
-            break;
-        case sptUnsignedInt8Vect:
-            u64 = args [ arg_idx ] . u8 [ f . u . f . start_idx ];
-            break;
-        case sptUnsignedInt16Vect:
-            u64 = args [ arg_idx ] . u16 [ f . u . f . start_idx ];
-            break;
-        case sptUnsignedInt32Vect:
-            u64 = args [ arg_idx ] . u32 [ f . u . f . start_idx ];
-            break;
-        case sptUnsignedInt64Vect:
-            u64 = args [ arg_idx ] . u64 [ f . u . f . start_idx ];
-            break;
-
-            /* scalar or vector float */
-        case sptFloat:
-            f64 = args [ arg_idx ] . f;
-            break;
-        case sptFloat32Vect:
-            f64 = args [ arg_idx ] . f32 [ f . u . f . start_idx ];
-            break;
-        case sptFloat64Vect:
-            f64 = args [ arg_idx ] . f64 [ f . u . f . start_idx ];
-            break;
-        case sptFloatLongVect:
-            f64 = ( double ) args [ arg_idx ] . flong [ f . u . f . start_idx ];
-            break;
-
-            /* utf-8 character */
-        case sptChar:
-            c = args [ arg_idx ] . c;
-            cvt_len = utf32_utf8 ( text, & text [ sizeof text ], c );
-            if ( cvt_len < 0 )
-            {
-                text [ 0 ] = '?';
-                cvt_len = 1;
-            }
-            StringInit ( & S, text, cvt_len, 1 );
-            break;
-
-            /* NUL-terminated string */
-        case sptNulTermString:
-
-            /* special initialization to flag size/length unknown */
-            StringInit ( & S, args [ arg_idx ] . s, 0, -1 );
-
-            /* IF THE STRING IS INDEXED OR MAY NEED LEFT ALIGNMENT */
-            if ( f . u . f . start_idx != 0 || f . u . f . select_len != 0 ||
-                 ( f . u . f . min_field_width != 0 && f . left_fill ) )
-            {
-                /* precision limits upper bounds
-                   if the index range is more restrictive than precision,
-                   take this as precision for text case */
-                if ( f . u . f . select_len != 0 && f . u . f . select_len < f . u . f . precision )
-                    f . u . f . precision = f . u . f . select_len;
-
-                /* scan to start location */
-                for ( S . len = 0; S . len < f . u . f . start_idx; ++ S . size )
-                {
-                    /* if end of NUL-terminated string is reached before start,
-                       then create EMPTY string */
-                    if ( S . addr [ S . size ] == 0 )
-                    {
-                        f . u . f . start_idx = 0;
-                        f . u . f . select_len = 0;
-                        f . u . f . precision = 0;
-                        break;
-                    }
-                    /* walk across utf-8 multi-byte character */
-                    if ( ( S . addr [ S . size ] & 0xC0 ) != 0x80 )
-                        ++ S . len;
-                }
-
-                /* create sub-string
-                   limit scan to required precision for efficiency */
-                for ( S . addr += S . size, S . size = 0, S . len = 0;
-                      S . len < f . u . f . precision; ++ S . size )
-                {
-                    if ( S . addr [ S . size ] == 0 )
-                        break;
-                    if ( ( S . addr [ S . size ] & 0xC0 ) != 0x80 )
-                        ++ S . len;
-                }
-            }
-
-            /* precision limits text length */
-            if ( text_lim > f . u . f . precision )
-                text_lim = f . u . f . precision;
-
-            break;
-
-            /* String object */
-        case sptString:
-
-            /* the String may be indexed */
-            if ( f . u . f . start_idx != 0 || f . u . f . select_len != 0 )
-            {
-                text_index = true;
-                text_start = f . u . f . start_idx;
-                if ( f . u . f . select_len != 0 )
-                    text_lim = f . u . f . select_len;
-            }
-
-            /* precision limits text length */
-            if ( text_lim > f . u . f . precision )
-                text_lim = f . u . f . precision;
-
-            S = * args [ arg_idx ] . S;
-            if ( S . addr == NULL && S . size == 0 && S . len == 0 )
-                S . addr = "";
-            break;
-
-            /* UCS-2 or UTF-32 String object */
-        case sptUCS2String:
-        case sptUTF32String:
-            return RC ( rcText, rcString, rcConverting, rcType, rcUnsupported );
-
-            /* an object pointer */
-        case sptPointer:
-            p = args [ arg_idx ] . p;
-            break;
-
-        case sptRowId:
-            i64 = args [ arg_idx ] . d;
-            break;
-        case sptRowLen:
-            u64 = args [ arg_idx ] . u;
-            break;
-
-#if SUPPORT_PERCENT_N
-        case sptBytesPrinted:
-            n = args [ arg_idx ] . n;
-            if ( n != NULL )
-                * n = out -> cur + out -> flushed;
-            ++ arg_idx;
-            continue;
-#endif
-        default:
-            return RC ( rcText, rcString, rcConverting, rcType, rcUnrecognized );
-        }
-
-        if ( f . type_cast ) switch ( f . type )
-        {
-        case sptSignedInt:
-        case sptSignedInt8Vect:
-        case sptSignedInt16Vect:
-        case sptSignedInt32Vect:
-        case sptSignedInt64Vect:
-            f64 = i64;
-            break;
-
-        case sptUnsignedInt:
-        case sptUnsignedInt8Vect:
-        case sptUnsignedInt16Vect:
-        case sptUnsignedInt32Vect:
-        case sptUnsignedInt64Vect:
-            f64 = u64;
-            break;
-
-        case sptFloat:
-        case sptFloat32Vect:
-        case sptFloat64Vect:
-        case sptFloatLongVect:
-            i64 = f64;
-            break;
-
-        case sptChar:
-        case sptNulTermString:
-        case sptString:
-            break;
-
-            /* UCS-2 or UTF-32 String object */
-        case sptUCS2String:
-        case sptUTF32String:
-        case sptPointer:
-            return RC ( rcText, rcString, rcConverting, rcType, rcUnsupported );
-
-        case sptRowId:
-            f64 = i64;
-            break;
-        case sptRowLen:
-            f64 = u64;
-            break;
-
-#if SUPPORT_PERCENT_N
-        case sptBytesPrinted:
-            break;
-#endif
-        default:
-            return RC ( rcText, rcString, rcConverting, rcType, rcUnrecognized );
-        }
-
-        /* advance arg count */
-        ++ arg_idx;
-
-        /* initialize engine params */
-        sign_char = 0;
-        comma_sep = false;
-        left_pad = prefix_len = prefix_contribution = zero_fill = 0;
-
-        /* format */
-        switch ( f . fmt )
-        {
-        case spfNone:
-        case spfText:
-            break;
-
-        case spfSignedInt:
-            if ( i64 < 0 )
-            {
-                sign_char = '-';
-                u64 = - i64;
-            }
-            else
-            {
-                sign_char = f . sign;
-                u64 = i64;
-            }
-            f . add_prefix = 0;
-            /* no break */
-        case spfUnsigned:
-            to_numeral = alnum_set [ f . reverse_alnum ] [ f . upper_case_num ];
-
-            if ( f . radix > 36 )
-                f . radix = 10;
-
-            i = sizeof text;
-#if _DEBUGGING
-            text [ -- i ] = 0;
-#endif
-            /* record if we are comma separating below */
-            comma_sep = f . thousands_separate;
-
-#if DOUSE_NUM_PREFIX_IF_ZERO
-            if ( u64 == 0 && f . add_prefix )
-            {
-#if KEEP_OCT_PREFIX_IF_ZERO
-                if ( f . u . f . precision == 0 && f . radix == 8 )
-                    f . u . f . precision = 1;
-#endif
-                f . add_prefix = 0;
-            }
-#endif
-            /* special case for value 0 and precision 0 */
-            if ( u64 != 0 || f . u . f . precision != 0 )
-            {
-                /* convert numeral */
-                do
-                    text [ -- i ] = to_numeral [ u64 % f . radix ];
-                while ( ( u64 /= f . radix ) != 0 );
-
-                /* add prefix to unsigned numeral */
-                if ( f . add_prefix )
-                {
-                    switch ( f . radix )
-                    {
-                    case 2:
-                        memcpy ( prefix, "0b", prefix_len = 2 );
-                        break;
-                    case 8:
-                        memcpy ( prefix, "0", prefix_len = prefix_contribution = 1 );
-#if OCTAL_PREFIX_COUNTS_TOWARD_PRECISION
-                        if ( f . add_prefix && f . u . f . precision != 0 )
-                            -- f . u . f . precision;
-#endif
-                        break;
-                    case 16:
-#if HEX_PREFIX_FOLLOWS_CASE
-                        if ( to_numeral [ 10 ] == 'A' )
-                            memcpy ( prefix, "0X", prefix_len = 2 );
-                        else
-#endif
-                            memcpy ( prefix, "0x", prefix_len = 2 );
-                        break;
-                    }
-                }
-            }
-
-            /* determine length in characters, also size in bytes */
-#if _DEBUGGING
-            int_len = sizeof text - i - 1;
-#else
-            int_len = sizeof text - i;
-#endif
-            /* create text string */
-            StringInit ( & S, & text [ i ], int_len, int_len );
-
-            /* zero-fill amount */
-            if ( f . u . f . precision > ( uint64_t ) int_len )
-                zero_fill = ( uint32_t ) ( f . u . f . precision - ( uint64_t ) int_len );
-            else if ( f . left_fill == '0' )
-            {
-                /* the known characters associated with integer */
-                dst_len = int_len + prefix_len + ( sign_char != 0 );
-                if ( comma_sep && int_len != 0 )
-                    dst_len += ( int_len + prefix_contribution - 1 ) / 3;
-                if ( ( uint64_t ) dst_len < f . u . f . min_field_width )
-                {
-                    /* determine the numeric width, including zero padding */
-                    dst_len = ( uint32_t ) f . u . f . min_field_width -
-                        prefix_len + prefix_contribution - ( sign_char != 0 );
-                    if ( comma_sep && int_len != 0 )
-                    {
-                        /* desired numeric-only portion of field is "dst_len"
-                           it will be extended not only by some number of '0's,
-                           but will be sprinkled with commas.
-
-                           if "x" were our number of numerals, then:
-                             x + ( x - 1 ) / 3 = dst_len
-                           with allowances for integer math. solving for x:
-                             x = ( 3 * dst_len + 3 ) / 4
-
-                           for example: given int_len = 1, value = 0:
-                             dst_len =  1 : x =  1
-                             dst_len =  2 : x =  2
-                             dst_len =  3 : x =  3
-                             dst_len =  4 : x =  3 [ requires special compensation ]
-                             dst_len =  5 : x =  4
-                             dst_len =  6 : x =  5
-                             dst_len =  7 : x =  6
-                             dst_len =  8 : x =  6 [ requires special compensation ]
-                                . . .
-                             dst_len = 19 : x = 15
-                             dst_len = 20 : x = 15
-                             dst_len = 21 : x = 16
-                             dst_len = 22 : x = 17
-                        */
-
-                        /* apply compensation for impossible width */
-                        if ( ( dst_len & 3 ) == 0 )
-                            ++ left_pad;
-
-                        /* dst_len now becomes the number of numerals */
-                        dst_len = ( dst_len * 3 + 3 ) >> 2;
-                    }
-
-                    /* number of zeros to add */
-                    zero_fill = dst_len - int_len;
-                    prefix_len -= prefix_contribution;
-                }
-            }
-
-            break;
-
-            /* TEMPORARY - cheat by calling through to runtime sprintf
-               this needs to be implemented to handle thousands separation */
-        case spfStdFloat:
-            c = 'f';
-        fmt_float:
-            sign_char = f . sign;
-            if ( f64 < 0 )
-            {
-                sign_char = '-';
-                f64 = - f64;
-            }
-
-            ffmt [ i = 0 ] = '%';
-            if ( f . force_decimal_point )
-                ffmt [ ++ i ] = '#';
-            if ( f . u . f . precision > 20 )
-                f . u . f . precision = 20;
-            sprintf ( & ffmt [ ++ i ], ".%u%c"
-                      , ( uint32_t ) f . u . f . precision
-                      , ( char ) c );
-            cvt_len = snprintf ( text, sizeof text, ffmt, f64 );
-            assert ( cvt_len >= 0 && ( size_t ) cvt_len < sizeof text );
-            StringInit ( & S, text, cvt_len, cvt_len );
-
-            /* record if we are comma separating below and capture length of integer portion */
-            int_len = 0;
-            comma_sep = f . thousands_separate;
-            /* if ( comma_sep ) */
-            {
-                for ( ; isdigit ( text [ int_len ] ); ++ int_len )
-                    ( void ) 0;
-            }
-
-            /* zero-fill amount */
-            if ( f . left_fill == '0' )
-            {
-                /* the known characters associated with numeral */
-                dst_len = cvt_len + ( sign_char != 0 );
-                if ( comma_sep && int_len != 0 )
-                    dst_len += ( int_len - 1 ) / 3;
-                if ( ( uint64_t ) dst_len < f . u . f . min_field_width )
-                {
-                    /* determine the integer width, including zero padding */
-                    dst_len = ( uint32_t ) f . u . f . min_field_width -
-                        cvt_len + int_len - ( sign_char != 0 );
-                    if ( comma_sep && int_len != 0 )
-                    {
-                        /* SEE COMMENTS IN INTEGER SECTION */
-
-                        /* apply compensation for impossible width */
-                        if ( ( dst_len & 3 ) == 0 )
-                            ++ left_pad;
-
-                        /* dst_len now becomes the number of numerals */
-                        dst_len = ( dst_len * 3 + 3 ) >> 2;
-                    }
-
-                    /* number of zeros to add */
-                    zero_fill = dst_len - int_len;
-                }
-            }
-            break;
-
-        case spfGenFloat:
-            c = 'g';
-            goto fmt_float;
-
-        case spfSciFloat:
-            c = 'e';
-            goto fmt_float;
-
-            /* version */
-        case spfVersion:
-
-            if ( f . min_vers_components )
-            {
-                if ( ( u64 & 0xFFFF ) != 0 )
-                    f . u . f . precision = 3;
-                else if ( ( u64 & 0xFF0000 ) != 0 )
-                    f . u . f . precision = 2;
-                else
-                    f . u . f . precision = 1;
-            }
-
-            switch ( f . u . f . precision )
-            {
-            case 0:
-                cfmt = "";
-                break;
-            case 1:
-                cfmt = "%u";
-                break;
-            case 2:
-                cfmt = "%u.%u";
-                break;
-            default:
-                cfmt = "%u.%u.%u";
-            }
-
-            dst_len = sprintf ( text, cfmt
-                                , VersionGetMajor ( ( uint32_t ) u64 )
-                                , VersionGetMinor ( ( uint32_t ) u64 )
-                                , VersionGetRelease ( ( uint32_t ) u64 )
-                );
-            StringInit ( & S, text, dst_len, dst_len );
-            f . u . f . precision = dst_len;
-            break;
-
-        case spfSymbol:
-
-            /* calculate total size of symbol */
-            for ( N = p, S = N -> name, N = N -> dad; N != NULL; N = N -> dad )
-            {
-                S . len += N -> name . len + 1;
-                S . size += N -> name . size + 1;
-            }
-
-            /* mark need to recheck format */
-            S . addr = NULL;
-            break;
-
-
-        case spfTime:
-
-            tm = p;
-
-            dst_len = 0;
-            if ( f . print_date )
-            {
-                static char const *months [ 12 ] =
-                    { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-                if ( f . print_weekday )
-                {
-                    static char const *weekdays [ 7 ] =
-                        { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-                    dst_len = sprintf ( text, "%s %s %u %u"
-                                        , weekdays [ tm -> weekday ]
-                                        , months [ tm -> month ]
-                                        , tm -> day + 1
-                                        , tm -> year
-                        );
-                }
-                else
-                {
-                    dst_len = sprintf ( text, "%s %u %u"
-                                        , months [ tm -> month ]
-                                        , tm -> day + 1
-                                        , tm -> year
-                        );
-                }
-            }
-
-            if ( f . print_time )
-            {
-                if ( dst_len != 0 )
-                    text [ dst_len ++ ] = ' ';
-
-                if ( f . hour_24 )
-                {
-                    dst_len += sprintf ( & text [ dst_len ]
-                                         , f . left_fill == '0' ? "%02u:%02u:%02u" : "%u:%02u:%02u"
-                                         , tm -> hour
-                                         , tm -> minute
-                                         , tm -> second
-                        );
-                }
-                else
-                {
-                    dst_len += sprintf ( & text [ dst_len ]
-                                         , f . left_fill == '0' ? "%02u:%02u:%02u %cM" : "%u:%02u:%02u %cM"
-                                         , ( tm -> hour + 11 ) % 12 + 1
-                                         , tm -> minute
-                                         , tm -> second
-                                         , ( tm -> hour < 12 ) ? 'A' : 'P'
-                        );
-                }
-
-                if ( f . print_timezone )
-                {
-                    dst_len += sprintf ( & text [ dst_len ]
-                                         , " %+02d"
-                                         , tm -> tzoff / 60
-                        );
-                }
-            }
-
-            StringInit ( & S, text, dst_len, dst_len );
-            break;
-
-        case spfRC:
-            dst_len = KWrtFmt_rc_t ( text, sizeof text, f . explain_rc ? "#" : "", ( rc_t ) u64 );
-            StringInit ( & S, text, dst_len, dst_len );
-            break;
-
-        case spfOSErr:
-            dst_len = KWrtFmt_error_code ( text, sizeof text, ( int ) i64 );
-            StringInit ( & S, text, dst_len, dst_len );
-            break;
-
-        default:
-            return RC ( rcText, rcString, rcConverting, rcFormat, rcUnrecognized );
-        }
-
-        /* at this point, we have text in "S".
-           if the text pointer is NULL, it will need to be further processed.
-           if the text size is 0 but the length is not, then we may need to measure string.
-        */
-
-        /* apply index limitation */
-        if ( text_index )
-        {
-            assert ( S . addr != NULL );
-            assert ( S . size != 0 || S . len == 0 );
-            if ( StringSubstr ( & S, & S, text_start, text_lim ) == NULL )
-                StringInit ( & S, "", 0, 0 );
-        }
-
-        /* determine overall width of substitution so far */
-        dst_len = left_pad + ( sign_char != 0 ) + prefix_len + zero_fill + S . len;
-
-        /* if there are comma insertions, get those, too */
-        if ( comma_sep && ( int_len != 0 || zero_fill != 0 ) )
-            dst_len += ( int_len + zero_fill - 1 ) / 3;
-
-        /* calculate remaining left padding */
-        if ( f . left_fill != 0 && f . u . f . min_field_width > dst_len )
-        {
-            assert ( S . size != 0 || S . len == 0 );
-            left_pad += f . u . f . min_field_width - dst_len;
-            dst_len = ( uint32_t ) f . u . f . min_field_width;
-        }
-
-        /* left padding */
-        if ( left_pad != 0 )
-        {
-            rc = print_padding ( out, left_pad, f . left_fill );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* output sign or prefix */
-        if ( sign_char != 0 )
-        {
-            rc = print_padding ( out, 1, sign_char );
-            if ( rc != 0 )
-                return rc;
-        }
-        else if ( prefix_len != 0 )
-        {
-            rc = write_buffer ( out, prefix, prefix_len );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* output comma-separated numeral */
-        if ( comma_sep && ( zero_fill != 0 || int_len != 0 ) )
-        {
-            uint32_t pos = zero_fill + int_len;
-            uint32_t chunk = ( pos - 1 ) % 3 + 1;
-
-            for ( i = 0, pos -= chunk; chunk > 0; -- chunk )
-            {
-                if ( zero_fill != 0 )
-                {
-                    rc = print_padding ( out, 1, '0' );
-                    -- zero_fill;
-                }
-                else
-                {
-                    rc = print_padding ( out, 1, S . addr [ i ] );
-                    ++ i;
-                }
-                if ( rc != 0 )
-                    return rc;
-            }
-
-            assert ( pos % 3 == 0 );
-            for ( pos /= 3; pos != 0; -- pos )
-            {
-                rc = print_padding ( out, 1, ',' );
-                if ( rc != 0 )
-                    return rc;
-
-                if ( zero_fill != 0 )
-                {
-                    if ( zero_fill >= 3 )
-                    {
-                        rc = print_padding ( out, 3, '0' );
-                        zero_fill -= 3;
-                    }
-                    else
-                    {
-                        rc = print_padding ( out, zero_fill, '0' );
-                        if ( rc == 0 )
-                            rc = write_buffer ( out, S . addr, 3 - zero_fill );
-                        i += 3 - zero_fill;
-                        zero_fill = 0;
-                    }
-                }
-                else
-                {
-                    rc = write_buffer ( out, & S . addr [ i ], 3 );
-                    i += 3;
-                }
-
-                if ( rc != 0 )
-                    return rc;
-            }
-
-            rc = write_buffer ( out, & S . addr [ i ], S . len - i );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* output numeral with zero fill */
-        else if ( zero_fill != 0 )
-        {
-            rc = print_padding ( out, zero_fill, '0' );
-            if ( rc == 0 )
-                rc = print_string ( out, & S, text_lim );
-        }
-
-        /* output NUL-terminated string */
-        else if ( S . size == 0 && S . len != 0 )
-        {
-            assert ( f . left_fill == 0 || f . u . f . min_field_width == 0 );
-            rc = print_nul_term_string ( out, & S, text_lim );
-            dst_len = S . len;
-        }
-
-        /* output KSymbol */
-        else if ( S . addr == NULL )
-        {
-            rc = print_symbol ( out, p );
-        }
-
-        /* output anything else in a String */
-        else
-        {
-            rc = print_string ( out, & S, text_lim );
-        }
-
-        /* recover from error */
-        if ( rc != 0 )
-            return rc;
-
-        /* apply right padding */
-        if ( f . u . f . min_field_width > dst_len )
-        {
-            rc = print_padding ( out, f . u . f . min_field_width - dst_len, ' ' );
-            if ( rc != 0 )
-                return rc;
-        }
-    }
-
-    rc = flush_buffer ( out );
-
-    if ( rc == 0 && out -> overflow )
-        rc = RC ( rcText, rcString, rcConverting, rcBuffer, rcInsufficient );
-
-    return rc;
-}
-
-
-/* structured_printf
- *  uses constant format descriptors and argument block
- *  prints to "out" handler
- */
-LIB_EXPORT rc_t CC structured_printf ( const KWrtHandler *handler,
-    size_t *num_writ, const PrintFmt *fmt, const PrintArg *args )
-{
-    if ( handler != NULL )
-    {
-        rc_t rc;
-        char buff [ 4096 ];
-
-        KBufferedWrtHandler out;
-        out . handler = handler;
-        out . buff = buff;
-        out . bsize = sizeof buff;
-
-        rc = structured_print_engine ( & out, fmt, args );
-
-        if ( num_writ != NULL )
-            * num_writ = out . cur + out . flushed;
-
-        return rc;
-    }
-
-    if ( num_writ != NULL )
-        * num_writ = 0;
-
-    return RC ( rcRuntime, rcString, rcConverting, rcFile, rcNull );
-}
-
-
-/* structured_sprintf
- *  uses constant format descriptors and argument block
- *  prints to UTF-8 character buffer "dst"
- */
-LIB_EXPORT rc_t CC structured_sprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const PrintFmt *fmt, const PrintArg *args )
-{
-    if ( dst != NULL || bsize == 0 )
-    {
-        rc_t rc;
-
-        KBufferedWrtHandler out;
-        out . handler = NULL;
-        out . buff = dst;
-        out . bsize = bsize;
-
-        rc = structured_print_engine ( & out, fmt, args );
-
-        if ( num_writ != NULL )
-            * num_writ = out . cur + out . flushed;
-
-        return rc;
-    }
-
-    if ( num_writ != NULL )
-        * num_writ = 0;
-
-    return RC ( rcRuntime, rcString, rcConverting, rcBuffer, rcNull );
-}
-
-
-/* string_printf
- *  provides a facility similar to snprintf
- *
- *  "dst" [ OUT ] and "bsize" [ IN ] - output buffer for string
- *  will be NUL-terminated if possible
- *
- *  "num_writ" [ OUT, NULL OKAY ] - returns the number of non-NUL bytes
- *  written to "dst" or the required "bsize" to complete successfully,
- *  not including the NUL termination.
- *
- *  "fmt" [ IN ] and "args" [ IN, OPTIONAL ] - data to write
- *
- *  returns 0 if all bytes were successfully written and a NUL-byte was
- *  written into the buffer.
- *
- *  returns rcBuffer, rcInsufficient if the buffer was too small. in this
- *  case, it is possible that the only missing byte would be the NUL
- *  termination, and the output string may still be usable since "num_writ"
- *  indicates the actual number of text bytes.
- */
-LIB_EXPORT rc_t CC new_string_vprintf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt_str, va_list vargs )
-{
-    rc_t rc;
-
-    String str [ 64 ], * strp = str;
-    PrintFmt fmt [ 64 ], * fmtp = fmt;
-    PrintArg args [ 64 ], * argp = args;
-
-    KDataBuffer overflow;
-
-    size_t dummy;
-    if ( num_writ == NULL )
-        num_writ = & dummy;
-
-    * num_writ = 0;
-
-    rc = parse_format_string ( fmt_str, vargs,
-        & strp, & fmtp, & argp, & overflow );
-
-    if ( rc == 0 )
-        rc = structured_sprintf ( dst, bsize, num_writ, fmtp, argp );
-
-    if ( strp != str )
-        KDataBufferWhack ( & overflow );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC new_string_printf ( char *dst, size_t bsize,
-    size_t *num_writ, const char *fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = new_string_vprintf ( dst, bsize, num_writ, fmt, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC new_vkfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char *fmt_str, va_list vargs )
-{
-    rc_t rc;
-
-    String str [ 64 ], * strp = str;
-    PrintFmt fmt [ 64 ], * fmtp = fmt;
-    PrintArg args [ 64 ], * argp = args;
-
-    KDataBuffer overflow;
-
-    size_t dummy;
-    if ( num_writ == NULL )
-        num_writ = & dummy;
-
-    * num_writ = 0;
-
-    rc = parse_format_string ( fmt_str, vargs,
-        & strp, & fmtp, & argp, & overflow );
-
-    if ( rc == 0 )
-        rc = structured_printf ( out, num_writ, fmtp, argp );
-
-    if ( strp != str )
-        KDataBufferWhack ( & overflow );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC new_kfprintf ( const KWrtHandler *out,
-    size_t *num_writ, const char *fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = new_vkfprintf ( out, num_writ, fmt, args );
-        
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KDataBufferVPrintf ( KDataBuffer * buf, const char * fmt, va_list args )
-{
-    rc_t rc;
-
-    if ( buf == NULL )
-        rc = RC ( rcText, rcString, rcFormatting, rcBuffer, rcNull );
-    else if ( fmt == NULL )
-        rc = RC ( rcText, rcString, rcFormatting, rcParam, rcNull );
-    else if ( fmt [ 0 ] == 0 )
-        rc = RC ( rcText, rcString, rcFormatting, rcParam, rcEmpty );
-    else
-    {
-        size_t bsize;
-        char *buffer;
-        size_t content;
-        size_t num_writ;
-
-        /* the C library ruins a va_list upon use
-           in case we ever need to use it a second time,
-           make a copy first */
-        va_list args_copy;
-        va_copy ( args_copy, args );
-
-        /* begin to calculate content and bsize */
-        content = ( size_t ) buf -> elem_count;
-
-        /* check for an empty buffer */
-        if ( content == 0 )
-        {
-            /* detect buffers initialized by memset */
-            if ( buf -> elem_bits == 0 )
-                buf -> elem_bits = 8;
-
-            rc = KDataBufferResize ( buf, bsize = 4096 );
-            if ( rc != 0 )
-                return rc;
-        }
-        else
-        {
-            /* generate even multiple of 4K */
-            bsize = ( content + 4095 ) & ~ ( size_t ) 4095;
-
-            /* discount NUL byte */
-            content -= 1;
-        }
-            
-        /* convert the 2-part url into a flat string */
-        buffer = buf -> base;
-        rc = string_vprintf ( &buffer [ content ], bsize - content, & num_writ, fmt, args );
-        /* Make sure there is enough room to store data including NUL */
-        if ( rc != 0 || ( content + num_writ ) == bsize )
-        {
-            bsize = ( content + num_writ + 4095 + 1 ) & ~ ( size_t ) 4095;
-            rc = KDataBufferResize ( buf, bsize );
-            if ( rc == 0 )
-            {
-                /* try again with the newly sized buffer */
-                rc = string_vprintf ( &buffer [ content ], bsize - content, & num_writ, fmt, args_copy );
-            }
-        }
-        va_end ( args_copy );
-    
-        /* size down to bsize + NUL */
-        if ( rc == 0 )
-            KDataBufferResize ( buf, content + num_writ + 1 );
-    }
-
-    return rc;
-}
-
-/* forward to KDataBufferVPrintf */
-LIB_EXPORT rc_t CC KDataBufferPrintf ( KDataBuffer * buf, const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-    rc = KDataBufferVPrintf ( buf, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
diff --git a/libs/klib/ptpersist.c b/libs/klib/ptpersist.c
deleted file mode 100644
index 927732a..0000000
--- a/libs/klib/ptpersist.c
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "trie-priv.h"
-#include "pbstree-priv.h"
-#include <klib/container.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#if _DEBUGGING
-#define DEBUGPRINT 0
-#endif
-
-/*--------------------------------------------------------------------------
- * private declarations
- */
-typedef struct IdxMap IdxMap;
-struct IdxMap
-{
-    uint32_t freq;
-    uint32_t idx;
-    uint32_t ch;
-};
-
-static
-int CC IdxMapSort ( const void *left, const void *right, void *ignore )
-{
-#define a ( ( const IdxMap* ) left )
-#define b ( ( const IdxMap* ) right )
-
-    if ( b -> freq != a -> freq )
-        return ( int ) b -> freq - ( int ) a -> freq;
-    return ( int ) a -> idx - ( int ) b -> idx;
-
-#undef a
-#undef b
-}
-
-typedef struct PTChildNode PTChildNode;
-struct PTChildNode
-{
-    SLNode n;
-    const TTrans *trans;
-    uint32_t dad;
-    uint16_t idx;
-};
-
-static
-void CC PTChildNodeWhack ( SLNode *n, void *ignore )
-{
-    free ( n );
-}
-
-typedef struct PTriePersistData PTriePersistData;
-struct PTriePersistData
-{
-    PTWriteFunc write;
-    void *write_param;
-
-    PTAuxFunc aux;
-    void *aux_param;
-
-    PTAuxFunc null_write;
-    PTAuxFunc live_write;
-
-    IdxMap *idx_map;
-    size_t *trans_map;
-
-    void ( CC * record_idx ) ( void*, uint32_t, uint32_t );
-    void ( CC * record_trans ) ( void*, uint32_t, uint32_t );
-
-    union
-    {
-        uint8_t *v8;
-        uint16_t *v16;
-        uint32_t *v32;
-
-    } idx_seq;
-
-    uint8_t *child_seq_type;
-
-    union
-    {
-        uint8_t *v8;
-        uint16_t *v16;
-        uint32_t *v32;
-
-    } backtrace;
-
-    union
-    {
-        uint8_t *v8;
-        uint16_t *v16;
-        uint32_t *v32;
-
-    } trans_seq;
-
-    size_t data_size;
-
-    uint32_t num_nodes;
-    uint32_t max_nodes;
-
-    uint32_t num_trans;
-    uint32_t trans_id;
-    uint32_t child_id;
-
-    uint32_t min_width;
-    uint32_t depth;
-
-    rc_t rc;
-
-    uint8_t idx_size;
-    uint8_t trans_size;
-    uint8_t off_size;
-};
-
-static
-rc_t CC PTAlign ( PTriePersistData *pb, size_t *offset,
-    uint32_t size, uint32_t first_byte )
-{
-    rc_t rc;
-
-    union
-    {
-        uint8_t u8 [ 4 ];
-        uint32_t u32;
-    } u;
-    size_t to_write, num_writ;
-
-    int align = (int)( offset [ 0 ] & ( size - 1 ) );
-    if ( align == 0 )
-        return 0;
-
-#if DEBUGPRINT
-    fprintf(stderr, "PTAlign called.\n");
-#endif
-
-
-    to_write = size - align;
-
-    u . u32 = 0;
-    u . u8 [ 0 ] = ( uint8_t ) first_byte;
-
-    num_writ = 0;
-    rc = ( * pb -> write ) ( pb -> write_param, u . u8, to_write, & num_writ );
-
-    * offset += num_writ;
-
-    if ( rc != 0 )
-        return rc;
-    if ( num_writ != to_write )
-        return RC ( rcCont, rcTrie, rcPersisting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-static
-rc_t CC TNodeDataSize ( void *param, const void *n, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    PTriePersistData *pb = param;
-    rc_t rc = ( * pb -> aux ) ( pb -> aux_param, n, num_writ, write, write_param );
-    if ( rc == 0 )
-    {
-        String str;
-        const TNode *keynode = n;
-        if ( StringSubstr ( & keynode -> key, & str, pb -> depth, 0 ) == NULL )
-            * num_writ += 1;
-        else
-            * num_writ += str . size + 1;
-    }
-    return rc;
-}
-
-static
-rc_t CC TNodeWrite ( void *param, const void *n, size_t *num_writ,
-    PTWriteFunc write, void *write_param )
-{
-    PTriePersistData *pb = param;
-    const TNode *keynode = n;
-
-    rc_t rc;
-    String str;
-
-#if DEBUGPRINT
-    fprintf(stderr, "TNodeWrite called.\n");
-#endif
-
-
-    if ( write == NULL )
-        return TNodeDataSize ( param, n, num_writ, write, write_param );
-
-    /* TBD - find out why string is written with pb->write and NUL is written with write
-       they should be the same, and so the entire NUL terminated string should be done at once */
-    if ( StringSubstr ( & keynode -> key, & str, pb -> depth, 0 ) != NULL )
-        rc = ( * pb -> write ) ( pb -> write_param, str . addr, str . size, num_writ );
-    else
-    {
-        rc = 0;
-        * num_writ = 0;
-    }
-    if ( rc == 0 )
-    {
-        size_t writ;
-        char term [ 1 ];
-
-        term [ 0 ] = 0;
-        rc = ( * write ) ( write_param, term, 1, & writ );
-        if ( rc == 0 )
-        {
-            * num_writ += writ;
-            if ( writ != 1 )
-                return -1; /*AK: TODO is it correct?*/
-
-            writ = 0;
-            rc = ( * pb -> aux ) ( pb -> aux_param, n, & writ, write, write_param );
-            * num_writ += writ;
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC NullWrite ( void *param, const void *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = bytes;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * TTrans
- */
-static
-void CC TTransCountNodes ( BSTNode *n, void *data )
-{
-    /* count node */
-    ++ ( * ( uint32_t* ) data );
-}
-
-static
-void CC TTransCountTrans ( const TTransBacktrace *bt, uint32_t width, void *data )
-{
-    PTriePersistData *pb = data;
-    const TTrans *trans = bt -> trans;
-
-    /* count transition node */
-    ++ pb -> num_trans;
-
-    /* count value nodes */
-    if ( trans -> vals . root != NULL )
-    {
-        uint32_t num_nodes = 0;
-        BSTreeForEach ( & trans -> vals, 0, TTransCountNodes, & num_nodes );
-
-        /* accumulate into overall counter */
-        pb -> num_nodes += num_nodes;
-
-        /* record max */
-        if ( num_nodes > pb -> max_nodes )
-            pb -> max_nodes = num_nodes;
-    }
-
-    /* analyze child transition array and character set */
-    if ( trans -> child != NULL )
-    {
-        uint32_t i;
-        for ( i = 0; i < width; ++ i )
-        {
-            if ( trans -> child [ i ] != NULL )
-                ++ pb -> idx_map [ i ] . freq;
-        }
-    }
-}
-
-static
-void CC TTransRecordU8 ( void *buffer, uint32_t idx, uint32_t val )
-{
-    ( ( uint8_t* ) buffer ) [ idx ] = ( uint8_t ) val;
-}
-
-static
-void CC TTransRecordU16 ( void *buffer, uint32_t idx, uint32_t val )
-{
-    ( ( uint16_t* ) buffer ) [ idx ] = ( uint16_t ) val;
-}
-
-static
-void CC TTransRecordU32 ( void *buffer, uint32_t idx, uint32_t val )
-{
-    ( ( uint32_t* ) buffer ) [ idx ] = ( uint32_t ) val;
-}
-
-static
-bool CC TTransPersist1 ( const TTrans *trans, PTriePersistData *pb,
-    uint32_t tid, uint32_t dad, uint16_t idx, SLList *sl,
-    uint32_t *icntp, uint32_t *slenp, uint32_t *tcntp )
-{
-    uint32_t icnt, slen, tcnt;
-
-    void ( CC * record_idx ) ( void*, uint32_t, uint32_t ) = pb -> record_idx;
-    void ( CC * record_trans ) ( void*, uint32_t, uint32_t ) = pb -> record_trans;
-
-#if DEBUGPRINT
-    fprintf(stderr, "TTransPersist1 called.\n");
-#endif
-
-
-    /* set up header */
-#if RECORD_HDR_IDX
-#if DEBUGPRINT
-    fprintf(stderr, "Recording header index %d, %d\n", pttHdrIdx, idx);
-#endif
-    /* zero-based character code of transition */
-    ( * record_idx ) ( pb -> idx_seq . v8, pttHdrIdx, idx );
-#endif
-#if RECORD_HDR_DEPTH
-#if DEBUGPRINT
-    fprintf(stderr, "Recording header depth %d, %d\n", pttHdrDepth, trans->depth);
-#endif
-    /* node depth */
-    ( * record_idx ) ( pb -> idx_seq . v8, pttHdrDepth, trans -> depth );
-#endif
-    /* the number of transitions; in child array or in vals btree */
-    ( * record_idx ) ( pb -> idx_seq . v8, pttHdrTransCnt, trans -> tcnt );
-
-    /* record one-based parent backtrace */
-    if ( pb -> backtrace . v8 != NULL )
-        ( * record_trans ) ( pb -> backtrace . v8, 0, dad );
-
-    /* record child transition table */
-    if ( trans -> child == NULL )
-    {
-        /* no sequence or indices beyond header */
-        icnt = slen = tcnt = 0;
-        ( * record_idx ) ( pb -> idx_seq . v8, pttHdrIdxCnt, 0 );
-    }
-    else
-    {
-        uint32_t i;
-
-        /* set all index entries to simple type
-           the working array is large enough to hold
-           one bit per character code */
-        memset ( pb -> child_seq_type, 0, ( pb -> min_width + 7 ) >> 3 );
-
-        /* walk child array:
-           i    => zero-based character code and
-                   indirect index into trans.child
-           tcnt => persisted child index and counter
-           icnt => idx index and counter
-           slen => child_seq_type index and counter */
-        for ( tcnt = icnt = slen = i = 0; i < pb -> min_width; ++ i )
-        {
-            PTChildNode *n;
-
-            /* look only at valid transitions
-               notice that i, which represents the new character code,
-               is first mapped to an old character code */
-            if ( trans -> child [ pb -> idx_map [ i ] . idx ] != NULL )
-            {
-                /* record trans into child slot and allocate id */
-                ( * record_trans ) ( pb -> trans_seq . v8, tcnt ++, ++ pb -> child_id );
-
-                /* record index, either single or lower part of pair
-                   index value is the new character code for transition */
-                ( * record_idx ) ( pb -> idx_seq . v8, ++ icnt + pttLastHdr, i );
-
-                /* create a node for next trans to visit */
-                n = malloc ( sizeof * n );
-                if ( n == NULL )
-                    return true;
-                n -> trans = trans -> child [ pb -> idx_map [ i ] . idx ];
-                n -> dad = tid;
-                n -> idx = i;
-                SLListPushTail ( sl, & n -> n );
-
-                /* determine type
-                   notice that "i" is incremented, even though it will be
-                   incremented by for loop. the effect of doing so, as well
-                   as the effect of the following compound statement, is to
-                   leave "i" such that child [ i ] is NULL, in which case
-                   we're going to skip it anyway */
-                if ( ++ i < pb -> min_width &&
-                     trans -> child [ pb -> idx_map [ i ] . idx ] != NULL )
-                {
-                    /* it's a range */
-                    pb -> child_seq_type [ slen >> 3 ] |=
-                        ( uint8_t ) ( 1U << ( slen & 7 ) );
-
-                    /* record each trans, allocating a new child id */
-                    ( * record_trans ) ( pb -> trans_seq . v8, tcnt ++, ++ pb -> child_id );
-                    n = malloc ( sizeof * n );
-                    if ( n == NULL )
-                        return true;
-                    n -> trans = trans -> child [ pb -> idx_map [ i ] . idx ];
-                    n -> dad = tid;
-                    n -> idx = i;
-                    SLListPushTail ( sl, & n -> n );
-
-                    /* continue until end */
-                    for ( ++ i; i < pb -> min_width; ++ i )
-                    {
-                        /* detect end of range */
-                        if ( trans -> child [ pb -> idx_map [ i ] . idx ] == NULL )
-                            break;
-                        ( * record_trans ) ( pb -> trans_seq . v8, tcnt ++, ++ pb -> child_id );
-                        n = malloc ( sizeof * n );
-                        if ( n == NULL )
-                            return true;
-                        n -> trans = trans -> child [ pb -> idx_map [ i ] . idx ];
-                        n -> dad = tid;
-                        n -> idx = i;
-                        SLListPushTail ( sl, & n -> n );
-                    }
-
-                    /* i is one beyond end of index range, but
-                       we store the range as fully closed */
-                    ( * record_idx ) ( pb -> idx_seq . v8, ++ icnt + pttLastHdr, i - 1 );
-                }
-
-                /* count the index sequence bit */
-                ++ slen;
-            }
-        }
-
-        /* complete the header for the case where child array was present */
-        ( * record_idx ) ( pb -> idx_seq . v8, pttHdrIdxCnt, icnt );
-        ( * record_idx ) ( pb -> idx_seq . v8, pttHdrSeqLen, slen );
-        ( * record_idx ) ( pb -> idx_seq . v8, pttHdrChildCnt, tcnt );
-    }
-
-    * icntp = icnt;
-    * slenp = slen;
-    * tcntp = tcnt;
-
-    return false;
-}
-
-static
-bool CC TTransPersist ( const TTrans *trans, PTriePersistData *pb,
-     uint32_t dad, uint16_t idx, SLList *sl )
-{
-    uint32_t ztid;
-    uint32_t icnt, slen, tcnt;
-    size_t to_write, num_writ, entry_size;
-
-#if DEBUGPRINT
-    fprintf(stderr, "TTransPersist called.\n");
-#endif
-
-
-    /* grab my zero-based trans id */
-    ztid = pb -> trans_id ++;
-    assert ( ztid < pb -> num_trans );
-
-    /* grab entry size */
-    entry_size = pb -> data_size;
-
-    /* assign initial size as zero */
-    pb -> trans_map [ ztid ] = 0;
-
-    /* populate tables and record child iteration nodes */
-    if ( TTransPersist1 ( trans, pb, ztid + 1, dad, idx, sl, & icnt, & slen, & tcnt ) )
-        return true;
-
-    /* write TTrans header data */
-    if ( icnt == 0 )
-    {
-        /* simple header for TTrans with no child array */
-        to_write = pttHdrNullEnd * pb -> idx_size;
-        pb -> rc = ( * pb -> write ) ( pb -> write_param,
-            pb -> idx_seq . v8, to_write, & num_writ );
-
-        /* write parent backtrace if needed */
-        if ( pb -> backtrace . v8 != NULL && pb -> rc == 0 && num_writ == to_write )
-        {
-            pb -> data_size += num_writ;
-            pb -> rc = PTAlign ( pb, & pb -> data_size, pb -> trans_size, 0 );
-            if ( pb -> rc == 0 )
-            {
-                to_write = pb -> trans_size;
-                pb -> rc = ( * pb -> write ) ( pb -> write_param,
-                    pb -> backtrace . v8, to_write, & num_writ );
-            }
-        }
-    }
-    else
-    {
-        /* write index array */
-        to_write = ( icnt + pttFirstIdx ) * pb -> idx_size;
-        pb -> rc = ( * pb -> write ) ( pb -> write_param,
-            pb -> idx_seq . v8, to_write, & num_writ );
-
-        /* proceed if no error and completely written
-           the incomplete write will be detected below */
-        if ( pb -> rc == 0 && num_writ == to_write )
-        {
-            pb -> data_size += num_writ;
-
-            /* write index type array */
-            assert ( slen != 0 );
-            to_write = ( slen + 7 ) >> 3;
-            pb -> rc = ( * pb -> write ) ( pb -> write_param,
-                pb -> child_seq_type, to_write, & num_writ );
-            if ( pb -> rc == 0 && num_writ == to_write )
-            {
-                /* align for transition size */
-                pb -> data_size += num_writ;
-                pb -> rc = PTAlign ( pb, & pb -> data_size, pb -> trans_size, 0 );
-                if ( pb -> rc == 0 )
-                {
-                    /* write parent backtrace if needed */
-                    if ( pb -> backtrace . v8 != NULL )
-                    {
-                        to_write = pb -> trans_size;
-                        pb -> rc = ( * pb -> write ) ( pb -> write_param,
-                            pb -> backtrace . v8, to_write, & num_writ );
-                        if ( pb -> rc != 0 )
-                            return true;
-                        if ( num_writ != to_write )
-                        {
-                            pb -> rc = RC ( rcCont, rcTrie, rcPersisting, rcTransfer, rcIncomplete );
-                            return true;
-                        }
-
-                        pb -> data_size += num_writ;
-                    }
-
-                    /* write transition array */
-                    to_write = tcnt * pb -> trans_size;
-                    pb -> rc = ( * pb -> write ) ( pb -> write_param,
-                        pb -> trans_seq . v8, to_write, & num_writ );
-                }
-            }
-        }
-    }
-
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> data_size += num_writ;
-    if ( num_writ != to_write )
-    {
-        pb -> rc = RC ( rcCont, rcTrie, rcPersisting, rcTransfer, rcIncomplete );
-        return true;
-    }
-
-    /* record trans' depth for internal key storage */
-    pb -> depth = trans -> depth;
-
-    /* detect need to align for data */
-    if ( ( pb -> data_size & 3 ) != 0 )
-    {
-        /* may be able to bail before writing b-tree */
-        if ( trans -> vals . root == NULL )
-        {
-            pb -> rc = PTAlign ( pb, & pb -> data_size, 4, 0 );
-            if ( pb -> rc != 0 )
-                return true;
-
-            /* record the size */
-            pb -> trans_map [ ztid ] = pb -> data_size - entry_size;
-            return false;
-        }
-
-        /* perform alignment */
-        pb -> rc = PTAlign ( pb, & pb -> data_size, 4, 1 );
-        if ( pb -> rc != 0 )
-            return true;
-    }
-
-    /* detect fake pass */
-    if ( pb -> write == NullWrite )
-    {
-        /* gather sizes */
-        pb -> rc = BSTreePersist ( & trans -> vals, & num_writ,
-            NULL, NULL, pb -> null_write, pb );
-    }
-    else
-    {
-        /* write BSTree for values */
-        pb -> rc = BSTreePersist ( & trans -> vals, & num_writ,
-            pb -> write, pb -> write_param, pb -> live_write, pb );
-    }
-
-    pb -> data_size += num_writ;
-
-    /* align3 */
-    if ( pb -> rc == 0 )
-        pb -> rc = PTAlign ( pb, & pb -> data_size, 4, 0 );
-
-    if ( pb -> rc != 0 )
-        return true;
-
-    pb -> trans_map [ ztid ] = pb -> data_size - entry_size;
-    return false;
-}
-
-/* TTransPIterate
- *  walks TTrans nodes in a predictive order
- *  using a queue
- */
-static
-bool CC TTransPIterate ( const TTrans *self, PTriePersistData *pb )
-{
-    PTChildNode *n;
-
-    SLList sl;
-    SLListInit ( & sl );
-
-#if DEBUGPRINT
-    fprintf(stderr, "TTransPIterate called.\n");
-#endif
-
-
-    pb -> trans_id = pb -> child_id = 0;
-
-    /* prime list with root node */
-    n = malloc ( sizeof * n );
-    if ( n == NULL )
-        return true;
-
-    n -> trans = self;
-    n -> dad = 0;
-    n -> idx = 0;
-
-    /* now walk the list */
-    for ( ; n != NULL; n = ( PTChildNode* ) SLListPopHead ( & sl ) )
-    {
-        const TTrans *trans = n -> trans;
-        uint32_t dad = n -> dad;
-        uint16_t idx = n -> idx;
-
-        free ( n );
-
-        if ( TTransPersist ( trans, pb, dad, idx, & sl ) )
-        {
-            SLListWhack ( & sl, PTChildNodeWhack, NULL );
-            return true;
-        }
-    }
-
-    return false;
-}
-
-
-/*--------------------------------------------------------------------------
- * Trie
- */
-
-/* TriePersist
- *  much like BSTreePersist but operates on a Trie
- *
- *  "num_writ" [ OUT, NULL OKAY ] -  returns parameter for the number
- *  of bytes written as a result of persisting the b-tree. this will
- *  be the actual bytes written regardless of return status.
- *
- *  "ext_keys" [ IN ] - if true, does not store key data internally.
- *  key text gets encoded into the tree structure in all cases. when
- *  stored internally, any key text not represented by the tree will
- *  be explicitly written by this function. otherwise, the caller will
- *  be expected to store the text as desired. while internal storage
- *  will probably be more efficient, it will cause this function to
- *  fail if the Trie was built with ambiguous key transitions, i.e.
- *  if initialized with "cs_expand" false and keys were added having
- *  characters not included within the "accept" character set. this
- *  is because the tree channels all unrecognized characters through
- *  a single code, making their recovery impossible without being
- *  stored externally.
- *
- *  "write" [ IN, NULL OKAY ] and "write_param" [ IN ] -  a generic
- *  output streaming function used for all operations. if NULL, then
- *  the function will exit after its first pass with the number of
- *  bytes required in "num_writ".
- *
- *  "aux" [ IN ] and "aux_param" [ IN ] - a specialized function for
- *  streaming auxiliary node data to output using the supplied "write"
- *  function. it is invoked during the first pass with a NULL write
- *  function for gathering size data, and during the third pass with
- *  a non-NULL write function.
- */
-static
-rc_t CC TriePersist0 ( size_t *num_writ, int ext_keys,
-   PTWriteFunc write, void *write_param )
-{
-    rc_t rc;
-    P_Trie ptt;
-
-    assert ( num_writ != NULL );
-
-#if DEBUGPRINT
-    fprintf( stderr, "TriePersist0 called.\n" );
-#endif
-
-    ptt . num_trans = 0;
-    ptt . num_nodes = 0;
-    ptt . data_size = 0;
-    ptt . keys = 0;
-    ptt . width = 0;
-
-    P_TrieSetExtKeys ( ptt . keys, ext_keys );
-    P_TrieSetBacktrace ( ptt . keys, ! ext_keys );
-
-    rc = ( * write ) ( write_param, & ptt, 16, num_writ );
-    if ( rc == 0 && * num_writ != 16 )
-        return RC ( rcCont, rcTrie, rcPersisting, rcTransfer, rcIncomplete );
-    return rc;
-}
-
-static
-void CC TriePersist1 ( const Trie *tt, PTriePersistData *pb )
-{
-    uint16_t i;
-
-    assert ( tt != NULL );
-    assert ( pb != NULL );
-    assert ( tt -> root != NULL );
-    assert ( pb -> idx_map != NULL );
-
-#if DEBUGPRINT
-    fprintf(stderr, "TriePersist1 called.\n");
-#endif
-
-    /* initialize statistics */
-    for ( i = 0; i < tt -> width; ++ i )
-    {
-        pb -> idx_map [ i ] . freq = 0;
-        pb -> idx_map [ i ] . idx = i;
-        pb -> idx_map [ i ] . ch = tt -> rmap [ i ];
-    }
-
-    /* count nodes and transition frequencies */
-    pb -> num_trans = 0;
-    pb -> num_nodes = 0;
-    pb -> max_nodes = 0;
-    TTransForEach ( tt -> root, tt -> width, TTransCountTrans, pb );
-
-    /* rearrange the indices by frequency */
-    ksort ( pb -> idx_map, tt -> width, sizeof pb -> idx_map [ 0 ], IdxMapSort, NULL );
-
-    /* determine real charset width by searching for
-       the first slot with zero transitions */
-    for ( i = 0; i < tt -> width; ++ i )
-    {
-        if ( pb -> idx_map [ i ] . freq == 0 )
-            break;
-    }
-    pb -> min_width = i;
-
-    /* translate character set width and node count */
-    if ( pb -> min_width <= 256 )
-    {
-        pb -> record_idx = TTransRecordU8;
-        pb -> idx_size = 1;
-    }
-    else if ( pb -> min_width <= 65536 )
-    {
-        pb -> record_idx = TTransRecordU16;
-        pb -> idx_size = 2;
-    }
-    else
-    {
-        pb -> record_idx = TTransRecordU32;
-        pb -> idx_size = 4;
-    }
-
-    if ( pb -> num_trans <= 256 )
-    {
-        pb -> record_trans = TTransRecordU8;
-        pb -> trans_size = 1;
-    }
-    else if ( pb -> num_trans <= 65536 )
-    {
-        pb -> record_trans = TTransRecordU16;
-        pb -> trans_size = 2;
-    }
-    else
-    {
-        pb -> record_trans = TTransRecordU32;
-        pb -> trans_size = 4;
-    }
-}
-
-static
-rc_t CC TriePersist2 ( const Trie *tt, PTriePersistData *pb )
-{
-    assert ( tt != NULL );
-    assert ( pb != NULL );
-    assert ( pb -> write == NullWrite );
-
-#if DEBUGPRINT
-    fprintf(stderr, "TriePersist2 called.\n");
-#endif
-
-    pb -> trans_id = 0;
-    pb -> data_size = 0;
-    TTransPIterate ( tt -> root, pb );
-    if ( pb -> rc == 0 )
-    {
-        /* we should have visited every TTrans node */
-        assert ( pb -> trans_id == pb -> num_trans );
-
-        /* size of trans offset array slot
-           since the persisted TTrans objects
-           are 4-byte aligned, we may be able to
-           get some savings */
-        if ( pb -> data_size <= 256 * 4 )
-            pb -> off_size = 1;
-        else if ( pb -> data_size <= 65536 * 4 )
-            pb -> off_size = 2;
-        else
-            pb -> off_size = 4;
-    }
-
-    return pb -> rc;
-}
-
-static
-rc_t CC TriePersist3 ( const Trie *tt, PTriePersistData *pb, int ext_keys,
-    PTWriteFunc write, void *write_param, size_t *num_writ )
-{
-    P_Trie *pt;
-    size_t trans_offset;
-
-#if DEBUGPRINT
-    fprintf(stderr, "TriePersist3 called.\n");
-#endif
-
-    assert ( tt != NULL );
-    assert ( pb != NULL );
-    assert ( write != NULL );
-    assert ( num_writ != NULL );
-
-    /* figure trans_offset up to trans member */
-    trans_offset = sizeof * pt - sizeof pt -> rmap +
-        pb -> min_width * sizeof pt -> rmap [ 0 ];
-
-    /* create the real deal */
-    pt = malloc ( trans_offset + pb -> num_trans * pb -> off_size );
-    if ( pt == NULL )
-        pb -> rc = RC ( rcCont, rcTrie, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        uint32_t i;
-        size_t data_offset;
-
-        /* initialize header */
-        pt -> num_trans = pb -> num_trans;
-        pt -> num_nodes = pb -> num_nodes;
-        pt -> data_size = (uint32_t)pb -> data_size;
-        pt -> keys = 0;
-        P_TrieSetExtKeys ( pt -> keys, ext_keys );
-        P_TrieSetBacktrace ( pt -> keys, ! ext_keys );
-        pt -> width = pb -> min_width;
-
-        /* decide upon id encoding type:
-           0 => 24 : 8, i.e. 24 bits for trans id, 8 bits for local btree id
-           1 => 22 : 10
-           2 => 20 : 12
-           3 => 18 : 14
-           4 => 16 : 16
-           5 => 14 : 18
-           6 => 12 : 20
-           7 => by offset into data section
-        */
-#define VALID_IDCODE( pb, trans, bt ) \
-    ( ( pb ) -> num_trans <= ( 1U << ( trans ) ) && \
-      ( pb ) -> max_nodes <= ( 1U << ( bt ) ) )
-
-        if ( VALID_IDCODE ( pb, 24, 8 ) )
-            P_TrieSetIdCoding ( pt -> keys, 0 );
-        else if ( VALID_IDCODE ( pb, 22, 10 ) )
-            P_TrieSetIdCoding ( pt -> keys, 1 );
-        else if ( VALID_IDCODE ( pb, 20, 12 ) )
-            P_TrieSetIdCoding ( pt -> keys, 2 );
-        else if ( VALID_IDCODE ( pb, 18, 14 ) )
-            P_TrieSetIdCoding ( pt -> keys, 3 );
-        else if ( VALID_IDCODE ( pb, 16, 16 ) )
-            P_TrieSetIdCoding ( pt -> keys, 4 );
-        else if ( VALID_IDCODE ( pb, 14, 18 ) )
-            P_TrieSetIdCoding ( pt -> keys, 5 );
-        else if ( VALID_IDCODE ( pb, 12, 20 ) )
-            P_TrieSetIdCoding ( pt -> keys, 6 );
-        else
-            P_TrieSetIdCoding ( pt -> keys, 7 );
-
-#undef VALID_IDCODE
-
-        /* fill out rmap */
-        for ( i = 0; i < ( uint32_t ) pb -> min_width; ++ i )
-            pt -> rmap [ i ] = pb -> idx_map [ i ] . ch;
-
-        /* fill out transition offset table */
-        if ( pb -> off_size == 1 )
-        {
-            uint8_t *trans = ( void* ) ( ( char* ) pt + trans_offset );
-            data_offset = trans_offset + pb -> num_trans;
-
-            for ( trans_offset = 0, i = 0; i < pb -> num_trans; ++ i )
-            {
-                assert ( ( trans_offset & 3 ) == 0 );
-                trans [ i ] = ( uint8_t ) ( trans_offset >> 2 );
-                trans_offset += pb -> trans_map [ i ];
-            }
-        }
-        else if ( pb -> off_size == 2 )
-        {
-            uint16_t *trans = ( void* ) ( ( char* ) pt + trans_offset );
-            data_offset = trans_offset + ( pb -> num_trans << 1 );
-
-            for ( trans_offset = 0, i = 0; i < pb -> num_trans; ++ i )
-            {
-                assert ( ( trans_offset & 3 ) == 0 );
-                trans [ i ] = ( uint16_t ) ( trans_offset >> 2 );
-                trans_offset += pb -> trans_map [ i ];
-            }
-        }
-        else
-        {
-            uint32_t *trans = ( void* ) ( ( char* ) pt + trans_offset );
-            data_offset = trans_offset + ( pb -> num_trans << 2 );
-
-            for ( trans_offset = 0, i = 0; i < pb -> num_trans; ++ i )
-            {
-                assert ( ( trans_offset & 3 ) == 0 );
-                trans [ i ] = ( uint32_t ) ( trans_offset >> 2 );
-                trans_offset += pb -> trans_map [ i ];
-            }
-        }
-
-        /* the last offset should equal total data bytes */
-        assert ( trans_offset == ( size_t ) pt -> data_size );
-
-        /* write the tree header */
-        pb -> rc = ( * write ) ( write_param, pt, data_offset, num_writ );
-        if ( pb -> rc == 0 && * num_writ != data_offset )
-            pb -> rc = RC ( rcCont, rcTrie, rcPersisting, rcTransfer, rcIncomplete );
-
-        free ( pt );
-    }
-
-    return pb -> rc;
-}
-
-LIB_EXPORT rc_t CC TriePersist ( const Trie *tt, size_t *num_writ, bool ext_keys,
-    PTWriteFunc write, void *write_param, PTAuxFunc aux, void *aux_param )
-{
-    PTriePersistData pb;
-    size_t num_writ_buffer;
-
-#if DEBUGPRINT
-    fprintf(stderr, "TriePersist called\n");
-#endif
-
-    if ( num_writ == NULL )
-        num_writ = & num_writ_buffer;
-
-    if ( write == NULL )
-    {
-        write = NullWrite;
-        write_param = NULL;
-    }
-
-    * num_writ = 0;
-
-    if ( tt == NULL )
-        return RC ( rcCont, rcTrie, rcPersisting, rcSelf, rcNull );
-    if ( aux == NULL )
-        return RC ( rcCont, rcTrie, rcPersisting, rcFunction, rcNull );
-
-    /* handle empty tree */
-    if ( tt -> root == NULL )
-        return TriePersist0 ( num_writ, ext_keys, write, write_param );
-
-    pb . write = NullWrite;
-    pb . write_param = NULL;
-    pb . aux = aux;
-    pb . aux_param = aux_param;
-    pb . rc = 0;
-
-    if ( ext_keys )
-    {
-        pb . null_write = aux;
-        pb . live_write = aux;
-    }
-    else
-    {
-        pb . null_write = TNodeDataSize;
-        pb . live_write = TNodeWrite;
-    }
-
-    /* prepare a statistical array for character transition analysis */
-    pb . idx_map = malloc ( tt -> width * sizeof pb . idx_map [ 0 ] );
-    if ( pb . idx_map == NULL )
-        pb . rc = RC ( rcCont, rcTrie, rcPersisting, rcMemory, rcExhausted );
-    else
-    {
-        /* analyze table dimensions based upon counts */
-        TriePersist1 ( tt, & pb );
-
-        /* time to allocate some memory
-           allocate trans_map based upon the number of TTrans objects
-           and idx_seq for persisting a single child array */
-        pb . trans_map = malloc (
-            /* the TTrans node size/offset array */
-            pb . num_trans * sizeof pb . trans_map [ 0 ] +
-            /* maximum space for all indices, all transitions */
-            ( pb . idx_size + pb . trans_size ) * pb . min_width +
-            /* space for parent backtrace transition */
-            pb . trans_size +
-            /* maximum space for sequence entry type bits */
-            ( ( pb . min_width + 7 ) >> 3 ) +
-            /* space for header entries in index array */
-            ( pb . idx_size * pttFirstIdx ) +
-            /* ample space for align1 */
-            pb . trans_size );
-        if ( pb . trans_map == NULL )
-            pb . rc = RC ( rcCont, rcTrie, rcPersisting, rcMemory, rcExhausted );
-        else
-        {
-            /* set up idx_seq from trans_map */
-            pb . idx_seq . v8 = ( uint8_t* ) pb . trans_map +
-                pb . num_trans * sizeof pb . trans_map [ 0 ];
-
-            /* assign pointers to parts */
-            pb . child_seq_type =
-                & pb . idx_seq . v8 [ pb . idx_size * ( pttFirstIdx + pb . min_width ) ];
-            pb . backtrace . v8 = NULL;
-            pb . trans_seq . v8 =
-                pb . child_seq_type + ( ( pb . min_width + 7 ) >> 3 );
-            if ( ! ext_keys )
-            {
-                pb . backtrace . v8 = pb . trans_seq . v8;
-                pb . trans_seq . v8 += pb . trans_size;
-            }
-
-            /* perform a dry-run to obtain overall size */
-            if ( TriePersist2 ( tt, & pb ) == 0 )
-            {
-                /* create, initialize and write the P_Trie structure */
-                if ( TriePersist3 ( tt, & pb, ext_keys, write, write_param, num_writ ) == 0 )
-                {
-                    /* use the real write function */
-                    pb . write = write;
-                    pb . write_param = write_param;
-
-                    /* align to 4 byte boundary */
-                    pb . rc = PTAlign ( & pb, num_writ, 4, 0 );
-                    if ( pb . rc == 0 )
-                    {
-                        /* write the nodes and data */
-                        pb . trans_id = 0;
-                        pb . data_size = 0;
-                        TTransPIterate ( tt -> root, & pb );
-                        * num_writ += pb . data_size;
-                    }
-                }
-            }
-
-            free ( pb . trans_map );
-        }
-
-        free ( pb . idx_map );
-    }
-
-    return pb . rc;
-}
diff --git a/libs/klib/ptrie.c b/libs/klib/ptrie.c
deleted file mode 100644
index ba97111..0000000
--- a/libs/klib/ptrie.c
+++ /dev/null
@@ -1,1956 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "pbstree-priv.h"
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <byteswap.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * PTNode
- *  a node within text tree
- *
- *  a TTree will contain TTNodes, which themselves are intrusive but
- *  irrelevant internal tree links plus a key string plus an externally
- *  defined data structure, representing a value, and supporting multiple
- *  nodes per key. the internal links permit navigation from node
- *  to node that is not possible with the PTNode. furthermore, they
- *  provide direct access to the key string that is not normally stored
- *  verbatim within a persisted image.
- *
- *  a PTrie does not contain structured nodes, but stores linkage
- *  and ordering information separately from the externally defined
- *  data, and rather than using pointers, assigns integer ids to the
- *  nodes themselves. navigation by pointers would require allocations,
- *  which are unnecessary and expensive when traversing a read-only
- *  persisted image. navigation is therefore intrusive on an externally
- *  allocated node structure.
- */
-
-/* PTNodeMakeKey
- *  tries to may a key string from node
- *  will fail if key text was not embedded into image when created
- *
- *  "key" [ OUT ] - return parameter for a key string allocation
- *  that must be whacked with StringWhack when no longer needed.
- *
- *  return status codes:
- *    EINVAL => invalid parameter
- *    ENOENT => no key data were written to tree image
- *    ENOMEM => memory failure
- */
-LIB_EXPORT rc_t CC PTNodeMakeKey ( const PTNode *self, const String **keyp )
-{
-    rc_t rc;
-    if ( keyp == NULL )
-        rc = RC ( rcCont, rcNode, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * keyp = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcCont, rcNode, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const PTrie *tt = self -> internal;
-            if ( tt->ext_keys || ! tt->backtrace )
-                rc = RC ( rcCont, rcNode, rcAccessing, rcString, rcNotFound );
-            else
-            {
-                uint32_t tid, btid;
-
-                /* decode the node id into trans and btnode ids */
-                rc = PTrieDecodeNodeId ( tt, self -> id, & tid, & btid );
-                if ( rc == 0 )
-                {
-                    /* recover the trans node */
-                    PTTrans trans;
-                    rc = PTrieInitNode ( tt, & trans, tid );
-                    if ( rc == 0 )
-                    {
-                        size_t size;
-                        const void *addr;
-
-                        assert ( trans . vals != NULL );
-                        assert ( PBSTreeCount ( trans . vals ) >= btid );
-
-                        /* recover the value node */
-                        rc = PBSTreeGetNodeData ( trans . vals, & addr, & size, btid );
-                        if ( rc == 0 )
-                        {
-                            /* the depth of this transition is
-                               the length of the key string up to node */
-                            uint32_t depth = PTTransGetDepth ( & trans, tt );
-
-                            /* get an adequate UTF-32 buffer */
-                            uint32_t tbbuff [ 64 ], *traceback = tbbuff;
-                            if ( depth > sizeof tbbuff / sizeof tbbuff [ 0 ] )
-                                traceback = malloc ( depth * sizeof traceback [ 0 ] );
-
-                            /* complete the work */
-                            if ( traceback != NULL )
-                            {
-                                String *key;
-                                uint32_t nlen;
-                                size_t tbsize, nsize;
-
-                                uint32_t i;
-                                for ( i = depth; i > 0; )
-                                {
-                                    uint32_t zidx = PTTransGetTransCharCode ( & trans, tt );
-                                    traceback [ -- i ] =
-                                        ( zidx + 1 == tt -> unmapped_idx ) ?
-                                        ( uint32_t ) '?' : PTrieDecodeCharId ( tt, zidx );
-                                    tid = PTTransGetDad ( & trans, tt );
-                                    assert ( tid != 0 || i == 0 );
-                                    rc = PTrieInitNode ( tt, & trans, tid );
-                                    assert ( rc == 0 );
-                                }
-
-                                /* determine the size of traceback string */
-                                i = utf32_cvt_string_len ( traceback,
-                                    depth * sizeof traceback [ 0 ], & tbsize );
-                                assert ( i == depth );
-
-                                /* determine the size and length of node string */
-                                nlen = string_measure ( addr, & nsize );
-                                assert ( nsize < size );
-
-                                /* create the string object */
-                                key = malloc ( sizeof * key + tbsize + nsize + 1 );
-                                if ( key == NULL )
-                                    rc = RC ( rcCont, rcNode, rcAccessing, rcMemory, rcExhausted );
-                                else
-                                {
-                                    /* home free */
-                                    char *text = ( char* ) ( key + 1 );
-                                    tbsize = utf32_cvt_string_copy ( text, tbsize + 1,
-                                        traceback, depth * sizeof traceback [ 0 ] );
-                                    memcpy ( & text [ tbsize ], addr, nsize + 1 );
-                                    StringInit ( key, text, tbsize + nsize, depth + nlen );
-                                    * keyp = key;
-                                }
-
-                                if ( traceback != tbbuff )
-                                    free ( traceback );
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * PTTrans
- */
-
-/* Whack
- */
-void PTTransWhack ( PTTrans *trans )
-{
-    if ( trans != NULL ) while ( 1 )
-    {
-        PTTrans *doomed = trans;
-        trans = ( PTTrans* ) trans -> back;
-        if ( doomed -> vals != & doomed -> _val )
-            PBSTreeWhack ( ( PBSTree* ) doomed -> vals );
-        free ( doomed );
-        if ( trans == NULL )
-            break;
-        if ( -- trans -> refcount > 0 )
-            break;
-    }
-}
-
-/* GetDepth
- */
-#if ! RECORD_HDR_DEPTH
-LIB_EXPORT uint32_t CC PTTransGetDepth ( const PTTrans *self, const PTrie *tt )
-{
-    PTTrans trans;
-    uint32_t dad, depth;
-
-    assert ( self != NULL );
-    if ( self -> depth != 0 )
-        return self -> depth;
-
-    for ( depth = 0, dad = PTTransGetDad ( self, tt ); dad != 0;
-          ++ depth, dad = PTTransGetDad ( & trans, tt ) )
-    {
-        int status = PTrieInitNode ( tt, & trans, dad );
-        assert ( status == 0 );
-    }
-
-    return depth;
-}
-#endif
-
-/* GetChildChildIdx
- */
-static
-uint32_t PTTransGetChildChildIdx ( const PTTrans *self,
-    const PTrie *tt, uint32_t zidx )
-{
-    const uint8_t *child_seq_type = self -> child_seq_type;
-    if ( self -> child_seq_type != NULL )
-    {
-        uint32_t i, j, k;
-
-        /* terse variable name explanation:
-           "i" will be the index into "child_seq_type" bit array
-           "j" is a 1-based index into child trans array
-           "k" is an index into the index array */
-        for ( i = 0, j = 1, k = pttFirstIdx; i < self -> slen; ++ k, ++ j, ++ i )
-        {
-            /* get the single char code or
-               the left edge of char code range */
-            uint32_t left = PTTransGetIdx ( self, tt, k );
-
-            /* detect terminal condition */
-            if ( left >= zidx )
-            {
-                /* if single or range left is too high, there's no transition */
-                if ( left > zidx )
-                    break;
-
-                /* the single or range left is an exact match
-                   "j" is the 1-based index into child array */
-                return j;
-            }
-
-            /* check entry type: if 0, then the index was a single
-               value. if 1, then it's a range */
-            if ( ( child_seq_type [ i >> 3 ] & ( 1U << ( i & 7 ) ) ) != 0 )
-            {
-                /* check for inclusion within the range
-                   N.B. ensure that the increment of "k"
-                   does not get evaluated more than once */
-                uint32_t right = PTTransGetIdx ( self, tt, ++ k );
-                if ( right >= zidx )
-                {
-                    /* found the range - calculate 1-based index */
-                    return zidx - left + j;
-                }
-
-                /* advance "j" by range width - 1 */
-                j += right - left;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/* 8 bit index */
-static
-uint32_t PTTransGetIdx8 ( const PTTrans *self, uint32_t zidx )
-{
-    return self -> idx . v8 [ zidx ];
-}
-
-static
-const void * PTTransGetIdxAddr8 ( const PTTrans *self, uint32_t zidx )
-{
-    return & self -> idx . v8 [ zidx ];
-}
-
-/* 16 bit index */
-static
-uint32_t PTTransGetIdx16 ( const PTTrans *self, uint32_t zidx )
-{ 
-    return self -> idx . v16 [ zidx ];
-}
-
-static
-uint32_t PTTransSwapIdx16 ( const PTTrans *self, uint32_t zidx )
-{
-    return bswap_16 ( self -> idx . v16 [ zidx ] );
-}
-
-static
-const void * PTTransGetIdxAddr16 ( const PTTrans *self, uint32_t zidx )
-{
-    return & self -> idx . v16 [ zidx ];
-}
-
-/* NULL dad access */
-static
-uint32_t PTTransGetDadNULL ( const PTTrans *self )
-{
-    return 0; 
-}
-
-/* 8 bit trans id */
-static
-uint32_t PTTransGetDad8 ( const PTTrans *self )
-{
-    return self -> dad . v8 [ 0 ];
-}
-
-static
-const void * PTTransAlignDadAddr8 ( PTTrans *self, bool backtrace )
-{
-    return & self -> dad . v8 [ backtrace ];
-}
-
-static
-uint32_t PTTransGetChild8 ( const PTTrans *self, uint32_t zidx )
-{
-    return self -> child . v8 [ zidx ];
-}
-
-static
-const void * PTTransGetChildAddr8 ( const PTTrans *self, uint32_t zidx )
-{
-    return & self -> child . v8 [ zidx ];
-}
-
-/* 16 bit trans id */
-static
-uint32_t PTTransGetDad16 ( const PTTrans *self )
-{
-    return self -> dad . v16 [ 0 ];
-}
-
-static
-uint32_t PTTransSwapDad16 ( const PTTrans *self )
-{
-    return bswap_16 ( self -> dad . v16 [ 0 ] );
-}
-
-static
-const void * PTTransAlignDadAddr16 ( PTTrans *self, bool backtrace )
-{
-    /* align dad first */
-    size_t i = ( size_t ) self -> dad . v16;
-    i = ( i + 1 ) & ~ ( size_t ) 1;
-    self -> dad . v16 = ( const uint16_t* ) i;
-    if ( backtrace )
-        return ( const void* ) ( i + 2 );
-    return ( const void* ) i;
-}
-
-static
-uint32_t PTTransGetChild16 ( const PTTrans *self, uint32_t zidx )
-{
-    return self -> child . v16 [ zidx ];
-}
-
-static
-uint32_t PTTransSwapChild16 ( const PTTrans *self, uint32_t zidx )
-{
-    return bswap_16 ( self -> child . v16 [ zidx ] );
-}
-
-static
-const void * PTTransGetChildAddr16 ( const PTTrans *self, uint32_t zidx )
-{
-    return & self -> child . v16 [ zidx ];
-}
-
-/* 32 bit trans id */
-static
-uint32_t PTTransGetDad32 ( const PTTrans *self )
-{
-    return self -> dad . v32 [ 0 ];
-}
-
-static
-uint32_t PTTransSwapDad32 ( const PTTrans *self )
-{
-    return bswap_32 ( self -> dad . v32 [ 0 ] );
-}
-
-static
-const void * PTTransAlignDadAddr32 ( PTTrans *self, bool backtrace )
-{
-    /* align dad first */
-    size_t i = ( size_t ) self -> dad . v32;
-    i = ( i + 3 ) & ~ ( size_t ) 3;
-    self -> dad . v32 = ( const uint32_t* ) i;
-    if ( backtrace )
-        return ( const void* ) ( i + 4 );
-    return ( const void* ) i;
-}
-
-static
-uint32_t PTTransGetChild32 ( const PTTrans *self, uint32_t zidx )
-{
-    return self -> child . v32 [ zidx ];
-}
-
-static
-uint32_t PTTransSwapChild32 ( const PTTrans *self, uint32_t zidx )
-{
-    return bswap_32 ( self -> child . v32 [ zidx ] );
-}
-
-static
-const void * PTTransGetChildAddr32 ( const PTTrans *self, uint32_t zidx )
-{
-    return & self -> child . v32 [ zidx ];
-}
-
-/* ForEach
- */
-void PTTransForEach ( const PTTrans *self, const PTrie *tt,
-    void ( * f ) ( const PTTrans *trans, const PTrie *tt, void *data ), void * data )
-{
-    const uint8_t *child_seq_type;
-
-    assert ( f != NULL );
-    ( * f ) ( self, tt, data );
-
-    child_seq_type = self -> child_seq_type;
-    if ( self -> child_seq_type != NULL )
-    {
-        PTTrans *trans = malloc ( sizeof * trans );
-        if ( trans != NULL )
-        {
-            uint32_t i, j, k;
-
-            /* see explanations in PTTransGetChildChildIdx */
-            for ( i = j = 0, k = pttFirstIdx; i < self -> slen; ++ k, ++ i )
-            {
-                uint32_t left, right;
-
-                /* get the single char code or
-                   the left edge of char code range */
-                left = right = PTTransGetIdx ( self, tt, k );
-
-                /* check entry type: if 0, then the index was a single
-                   value. if 1, then it's a range */
-                if ( ( child_seq_type [ i >> 3 ] & ( 1U << ( i & 7 ) ) ) != 0 )
-                    right = PTTransGetIdx ( self, tt, ++ k );
-
-                /* get child node id */
-                for ( ; left <= right; ++ j, ++ left )
-                {
-                    uint32_t tid = PTTransGetChild ( self, tt, j ) + 1;
-                    int status = PTrieInitNode ( tt, trans, tid );
-                    if ( status == 0 )
-                    {
-                        trans -> back = self;
-#if ! RECORD_HDR_IDX
-                        trans -> tidx = left;
-#endif
-#if ! RECORD_HDR_DEPTH
-                        trans -> depth = self -> depth + 1;
-#endif
-                        PTTransForEach ( trans, tt, f, data );
-                    }
-                }
-            }
-
-            free ( trans );
-        }
-    }
-}
-
-/* DoUntil
- */
-bool PTTransDoUntil ( const PTTrans *self, const PTrie *tt,
-    bool ( * f ) ( const PTTrans *trans, const PTrie *tt, void *data ), void * data )
-{
-    const uint8_t *child_seq_type;
-
-    assert ( f != NULL );
-    if ( ( * f ) ( self, tt, data ) )
-        return true;
-
-    child_seq_type = self -> child_seq_type;
-    if ( self -> child_seq_type != NULL )
-    {
-        PTTrans *trans = malloc ( sizeof * trans );
-        if ( trans != NULL )
-        {
-            uint32_t i, j, k;
-
-            /* see explanations in PTTransGetChildChildIdx */
-            for ( i = j = 0, k = pttFirstIdx; i < self -> slen; ++ k, ++ i )
-            {
-                uint32_t left, right;
-
-                /* get the single char code or
-                   the left edge of char code range */
-                left = right = PTTransGetIdx ( self, tt, k );
-
-                /* check entry type: if 0, then the index was a single
-                   value. if 1, then it's a range */
-                if ( ( child_seq_type [ i >> 3 ] & ( 1U << ( i & 7 ) ) ) != 0 )
-                    right = PTTransGetIdx ( self, tt, ++ k );
-
-                /* get child node id */
-                for ( ; left <= right; ++ j, ++ left )
-                {
-                    uint32_t tid = PTTransGetChild ( self, tt, j ) + 1;
-                    rc_t rc = PTrieInitNode ( tt, trans, tid );
-                    if ( rc == 0 )
-                    {
-                        trans -> back = self;
-#if ! RECORD_HDR_IDX
-                        trans -> tidx = left;
-#endif
-#if ! RECORD_HDR_DEPTH
-                        trans -> depth = self -> depth + 1;
-#endif
-                        if ( PTTransDoUntil ( trans, tt, f, data ) )
-                        {
-                            free ( trans );
-                            return true;
-                        }
-                    }
-                }
-            }
-
-            free ( trans );
-        }
-    }
-    return false;
-}
-
-
-/*--------------------------------------------------------------------------
- * PTrie
- *  a persisted tree of text nodes
- *
- *  this is a collection of { key, value } pairs, where a many-value
- *  to one key paradigm is naturally supported, as in the b-tree.
- *
- *  the desired retrieval operations are:
- *   a) key -> id : value
- *   b) key -> { id : value, ... }
- *   c) RE -> id : value
- *   d) RE -> { id : value, ... }
- *   e) iteration across { id : value, ... }
- *   f) id : value -> key
- *
- *  the reverse retrieval operation is:
- *   a) id -> value
- *
- *  indexing of the id is performed externally, and should not be interpreted
- *  as a serial, integer value. it may be a byte offset or a combination of
- *  two integer values, as well as anything else.
- */
-
-/* GetNodeOff
- *  takes a 1-based index
- *  returns an offset into data array
- */
-static
-uint32_t PTrieGetNodeOff8 ( const PTrie *self, uint32_t zidx )
-{
-    return self -> trans_off . v8 [ zidx ];
-}
-
-static
-uint32_t PTrieGetNodeOff16 ( const PTrie *self, uint32_t zidx )
-{
-    return self -> trans_off . v16 [ zidx ];
-}
-
-static
-uint32_t PTrieSwapNodeOff16 ( const PTrie *self, uint32_t zidx )
-{
-    return bswap_16 ( self -> trans_off . v16 [ zidx ] );
-}
-
-static
-uint32_t PTrieGetNodeOff32 ( const PTrie *self, uint32_t zidx )
-{
-    return self -> trans_off . v32 [ zidx ];
-}
-
-static
-uint32_t PTrieSwapNodeOff32 ( const PTrie *self, uint32_t zidx )
-{
-    return bswap_32 ( self -> trans_off . v32 [ zidx ] );
-}
-
-
-/* EncodeNodeId
- * PTrieDecodeNodeId
- */
-static
-uint32_t PTrieOrigEncodeNodeId0 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 8 ) | btid; 
-}
-
-static
-uint32_t PTrieEncodeNodeId0 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 8 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeTestTrieNodeId ( const PTrie *self, uint32_t *tid, uint32_t *btid, uint32_t count )
-{
-    uint32_t which = 0;
-
-    PTTrans trans;
-    rc_t rc = PTrieInitNode ( self, & trans, * tid & ~ 1U );
-    if ( rc == 0 )
-    {
-        assert ( trans . vals != NULL );
-        if ( PBSTreeCount ( trans . vals ) == count )
-            which |= 1;
-    }
-    rc = PTrieInitNode ( self, & trans, * tid | 1U );
-    if ( rc == 0 )
-    {
-        assert ( trans . vals != NULL );
-        if ( PBSTreeCount ( trans . vals ) == count )
-            which |= 2;
-    }
-
-    switch ( which )
-    {
-    case 0:
-        return RC ( rcCont, rcTrie, rcAccessing, rcId, rcCorrupt );
-    case 1:
-        * tid &= ~ 1U;
-        * btid = count;
-        break;
-    case 2:
-        * tid |= 1U;
-        * btid = count;
-        break;
-    case 3:
-        * btid = count;
-        return RC ( rcCont, rcTrie, rcAccessing, rcId, rcAmbiguous );
-    }
-
-    return 0;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId0 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    /* unpack 1-based ids */
-    * tid = id >> 8;
-    * btid = id & 0xFF;
-
-    /* detect no-overflow cases */
-    if ( * btid != 0 )
-        return 0;
-
-    /* handle overflow */
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x100 );
-}
-
-static
-rc_t PTrieDecodeNodeId0 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 8 ) + 1;
-    * btid = ( id & 0xFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId1 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 10 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId1 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 10 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId1 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 10;
-    * btid = id & 0x3FF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x400 );
-}
-
-static
-rc_t PTrieDecodeNodeId1 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 10 ) + 1;
-    * btid = ( id & 0x3FF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId2 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 12 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId2 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 12 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId2 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 12;
-    * btid = id & 0xFFF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x1000 );
-}
-
-static
-rc_t PTrieDecodeNodeId2 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 12 ) + 1;
-    * btid = ( id & 0xFFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId3 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 14 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId3 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 14 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId3 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 14;
-    * btid = id & 0x3FFF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x4000 );
-}
-
-static
-rc_t PTrieDecodeNodeId3 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 14 ) + 1;
-    * btid = ( id & 0x3FFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId4 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 16 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId4 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 16 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId4 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 16;
-    * btid = id & 0xFFFF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x10000 );
-}
-
-static
-rc_t PTrieDecodeNodeId4 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 16 ) + 1;
-    * btid = ( id & 0xFFFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId5 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 18 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId5 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 18 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId5 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 18;
-    * btid = id & 0x3FFFF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x40000 );
-}
-
-static
-rc_t PTrieDecodeNodeId5 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 18 ) + 1;
-    * btid = ( id & 0x3FFFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieOrigEncodeNodeId6 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( tid << 20 ) | btid;
-}
-
-static
-uint32_t PTrieEncodeNodeId6 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    return ( ( ( tid - 1 ) << 20 ) + ( btid - 1 ) ) + 1;
-}
-
-static
-rc_t PTrieOrigDecodeNodeId6 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    * tid = id >> 20;
-    * btid = id & 0xFFFFF;
-    if ( * btid != 0 )
-        return 0;
-    return PTrieOrigDecodeTestTrieNodeId ( self, tid, btid, 0x100000 );
-}
-
-static
-rc_t PTrieDecodeNodeId6 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    -- id;
-    * tid = ( id >> 20 ) + 1;
-    * btid = ( id & 0xFFFFF ) + 1;
-    return 0;
-}
-
-static
-uint32_t PTrieEncodeNodeId7 ( const PTrie *self,
-    uint32_t tid, uint32_t btid )
-{
-    /* first get the byte offset to trans */
-    uint32_t id = PTrieGetNodeOff ( self, tid - 1 );
-
-    /* the trans node is supposed to have at least btid
-       nodes underneath, taking > 1 byte each, so by adding
-       the count to a trans offset, we get something that
-       can be recovered later, and we insist that this
-       offset will be somewhere within the trans */
-
-    /* NB - conversion from tid to offset gives a
-       zero-based index into an array of uint32_t,
-       which is converted to a zero-based byte offset
-       and then added to a one-based node id, resulting
-       in a one-based composite node id */
-    return ( id << 2 ) + btid;
-}
-
-static
-rc_t PTrieDecodeNodeId7 ( const PTrie *self, uint32_t id,
-    uint32_t *tid, uint32_t *btid )
-{
-    uint32_t left = 0;
-    uint32_t right = self -> num_nodes;
-    while ( left < right )
-    {
-        uint32_t i = ( left + right ) >> 1;
-        uint32_t off = PTrieGetNodeOff ( self, i ) << 2;
-        if ( off > id )
-            right = i;
-        else
-        {
-            uint32_t end;
-
-            /* should never be equal, because ids are 1-based */
-            assert ( off != id );
-
-            /* get offset of next or end of data */
-            if ( i + 1 == self -> num_nodes )
-                end = self -> data_size;
-            else
-                end = PTrieGetNodeOff ( self, i + 1 ) << 2;
-
-            if ( end > id )
-            {
-                /* found it */
-                * tid = i + 1;
-                * btid = id - off;
-                return 0;
-            }
-
-            left = i;
-        }
-    }
-
-    return RC ( rcCont, rcTrie, rcSelecting, rcId, rcNotFound );
-}
-
-
-/* DecodeCharId
- */
-static
-uint32_t PTrieGetRMap ( const PTrie *self, uint32_t idx )
-{ 
-    return self -> _rmap [ idx ];
-}
-
-static
-uint32_t PTrieSwapRMap ( const PTrie *self, uint32_t idx )
-{
-    return bswap_32 ( self -> _rmap [ idx ] );
-}
-
-
-/* MakeInt
- *  make a persisted tree structure
- *  includes code to handle original composite node encoding
- *
- *  "addr" [ IN ] and "size" [ IN ] - constant memory image of
- *  persisted text tree with a lifetime exceeding that of the
- *  PTrie itself
- *
- *  "byteswap" [ IN ] - true if persisted image must be byteswapped
- *
- *  "orig" [ IN ] - true if persisted node ids must be reprocessed
- *   for overflow. In the original implementation, the composite
- *   node ids were formed from one-based trie and bstree node ids,
- *   but the bits allotted for them were calculated from zero-based
- *   ids, causing an overflow when either node reached its maximum.
- *
- *   e.g.: tid_max <= 0x1000000, btid_max <= 0x100: 24:8 packing
- *   when ( one-based ) btid == 256, it requires 9 bits, whereas
- *   zero-based btid == 255, requiring the expected 8 bits.
- */
-static int16_t _get_16 ( uint16_t i ) { return ( int16_t ) i; }
-static int16_t _swap_16 ( uint16_t i ) { return ( int16_t ) bswap_16 ( i ); }
-static int32_t _get_32 ( uint32_t i ) { return ( int32_t ) i; }
-static int32_t _swap_32 ( uint32_t i ) { return ( int32_t ) bswap_32 ( i ); }
-
-static
-rc_t PTrieMakeInt ( PTrie **ttp, const void *addr, size_t size, bool byteswap, bool orig )
-{
-    rc_t rc;
-
-    if ( ttp == NULL )
-        rc = RC ( rcCont, rcTrie, rcAllocating, rcParam, rcNull );
-    else
-    {
-        if ( addr == NULL )
-            rc = RC ( rcCont, rcTrie, rcAllocating, rcParam, rcNull );
-        else if ( size == 0 )
-            rc = RC ( rcCont, rcTrie, rcAllocating, rcData, rcInvalid );
-        else
-        {
-            const P_Trie *ptt;
-
-            if ( size < ( sizeof * ptt - sizeof ptt -> rmap ) )
-                rc = RC ( rcCont, rcTrie, rcAllocating, rcData, rcCorrupt );
-            else
-            {
-                size_t min_size;
-
-                /* accessor functions */
-                int16_t ( * get_16 ) ( uint16_t ) = byteswap ? _swap_16 : _get_16;
-                int32_t ( * get_32 ) ( uint32_t ) = byteswap ? _swap_32 : _get_32;
-
-                /* everything looks good */
-                rc = 0;
-
-                /* structured pointer into const memory image */
-                ptt = addr;
-
-                /* minimum known size of the memory image
-                   will be adjusted as image is scanned */
-                min_size = sizeof * ptt - sizeof ptt -> rmap +
-                    get_16 ( ptt -> width ) * sizeof ptt -> rmap [ 0 ] +
-                    get_32 ( ptt -> data_size );
-                if ( size >= min_size )
-                {
-                    PTrie *tt;
-                    uint16_t i, unmapped;
-                    uint32_t ch, first, last;
-
-                    /* the accept character set is recovered from the
-                       reverse character map where the special character
-                       value NUL represents a wildcard.
-
-                       the forward map will be built using one-based
-                       character codes, where code 0 means unmapped.
-
-                       first determine the range of accept characters
-                       while at the same time capturing the one-based
-                       character code of wildcards */
-                    for ( last = 0, first = ~ 0, unmapped = i = 0;
-                          i < get_16 ( ptt -> width ); ++ i )
-                    {
-                        ch = get_32 ( ptt -> rmap [ i ] );
-                        if ( ch == 0 )
-                            unmapped = i + 1;
-                        else
-                        {
-                            if ( ch < first )
-                                first = ch;
-                            if ( ch > last )
-                                last = ch;
-                        }
-                    }
-
-                    /* this case occurs when all values are on the root node */
-                    if ( last < first )
-                        first = 1;
-                    
-                    /* allocated block with mapped sections */
-                    tt = malloc ( sizeof * tt - sizeof tt -> map +
-                        ( last - first + 1 ) * sizeof tt -> map [ 0 ] );
-                    if ( tt == NULL )
-                        rc = RC ( rcCont, rcTrie, rcAllocating, rcMemory, rcExhausted );
-                    else
-                    {
-                        uint16_t ptt_width = get_16 ( ptt -> width );
-
-                        /* fill character to index map with wildcard index
-                           usually NULL or unmapped */
-                        for ( ch = first; ch <= last; ++ ch )
-                            tt -> map [ ch - first ] = unmapped;
-
-                        /* now overwrite mapped characters with one-based char codes */
-                        for ( i = 0; i < ptt_width; ++ i )
-                        {
-                            ch = get_32 ( ptt -> rmap [ i ] );
-                            if ( ch != 0 )
-                                tt -> map [ ch - first ] = i + 1;
-                        }
-
-                        /* fill out the virtual functions */
-                        do
-                        {
-                            uint32_t trans_off_len;
-                            uint16_t ptt_keys = get_16 ( ptt -> keys );
-
-                            /* reverse character lookup */
-                            tt -> decode_char_id = byteswap ?
-                                PTrieSwapRMap : PTrieGetRMap;
-
-                            /* index encoding scheme */
-                            if ( orig ) switch ( P_TrieIdCoding ( ptt_keys ) )
-                            {
-                            case 0:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId0;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId0;
-                                break;
-                            case 1:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId1;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId1;
-                                break;
-                            case 2:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId2;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId2;
-                                break;
-                            case 3:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId3;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId3;
-                                break;
-                            case 4:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId4;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId4;
-                                break;
-                            case 5:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId5;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId5;
-                                break;
-                            case 6:
-                                tt -> encode_node_id = PTrieOrigEncodeNodeId6;
-                                tt -> decode_node_id = PTrieOrigDecodeNodeId6;
-                                break;
-                            default:
-                                tt -> encode_node_id = PTrieEncodeNodeId7;
-                                tt -> decode_node_id = PTrieDecodeNodeId7;
-                            }
-                            else switch ( P_TrieIdCoding ( ptt_keys ) )
-                            {
-                            case 0:
-                                tt -> encode_node_id = PTrieEncodeNodeId0;
-                                tt -> decode_node_id = PTrieDecodeNodeId0;
-                                break;
-                            case 1:
-                                tt -> encode_node_id = PTrieEncodeNodeId1;
-                                tt -> decode_node_id = PTrieDecodeNodeId1;
-                                break;
-                            case 2:
-                                tt -> encode_node_id = PTrieEncodeNodeId2;
-                                tt -> decode_node_id = PTrieDecodeNodeId2;
-                                break;
-                            case 3:
-                                tt -> encode_node_id = PTrieEncodeNodeId3;
-                                tt -> decode_node_id = PTrieDecodeNodeId3;
-                                break;
-                            case 4:
-                                tt -> encode_node_id = PTrieEncodeNodeId4;
-                                tt -> decode_node_id = PTrieDecodeNodeId4;
-                                break;
-                            case 5:
-                                tt -> encode_node_id = PTrieEncodeNodeId5;
-                                tt -> decode_node_id = PTrieDecodeNodeId5;
-                                break;
-                            case 6:
-                                tt -> encode_node_id = PTrieEncodeNodeId6;
-                                tt -> decode_node_id = PTrieDecodeNodeId6;
-                                break;
-                            default:
-                                tt -> encode_node_id = PTrieEncodeNodeId7;
-                                tt -> decode_node_id = PTrieDecodeNodeId7;
-                            }
-
-                            /* PTTrans index access based on the
-                               minimum allowed char code width
-                               where the 0 <= code < width */
-                            if ( ptt_width <= 256 )
-                            {
-                                tt -> get_idx = PTTransGetIdx8;
-                                tt -> get_idx_addr = PTTransGetIdxAddr8;
-                            }
-                            else
-                            {
-                                tt -> get_idx = byteswap ? PTTransSwapIdx16 : PTTransGetIdx16;
-                                tt -> get_idx_addr = PTTransGetIdxAddr16;
-                            }
-
-                            /* PTTrans child and parent access based
-                               ont the minimum allowed trans id width */
-                            if ( get_32 ( ptt -> num_trans ) <= 256 )
-                            {
-                                tt -> get_dad = PTTransGetDad8;
-                                tt -> align_dad_addr = PTTransAlignDadAddr8;
-                                tt -> get_child = PTTransGetChild8;
-                                tt -> get_child_addr = PTTransGetChildAddr8;
-                            }
-                            else if ( get_32 ( ptt -> num_trans ) <= 65536 )
-                            {
-                                if ( byteswap )
-                                {
-                                    tt -> get_dad = PTTransSwapDad16;
-                                    tt -> get_child = PTTransSwapChild16;
-                                }
-                                else
-                                {
-                                    tt -> get_dad = PTTransGetDad16;
-                                    tt -> get_child = PTTransGetChild16;
-                                }
-                                tt -> align_dad_addr = PTTransAlignDadAddr16;
-                                tt -> get_child_addr = PTTransGetChildAddr16;
-                            }
-                            else
-                            {
-                                if ( byteswap )
-                                {
-                                    tt -> get_dad = PTTransSwapDad32;
-                                    tt -> get_child = PTTransSwapChild32;
-                                }
-                                else
-                                {
-                                    tt -> get_dad = PTTransGetDad32;
-                                    tt -> get_child = PTTransGetChild32;
-                                }
-                                tt -> align_dad_addr = PTTransAlignDadAddr32;
-                                tt -> get_child_addr = PTTransGetChildAddr32;
-                            }
-
-                            /* wipe out the backtrace function */
-                            if ( ! P_TrieBacktrace ( ptt_keys ) )
-                                tt -> get_dad = PTTransGetDadNULL;
-
-                            /* the trans offset access is based upon the
-                               total data size to be represented in nodes.
-                               all entries are 4-byte aligned, making it
-                               possible to represent their offsets with
-                               the byte value / 4 */
-                            if ( get_32 ( ptt -> data_size ) <= 256 * 4 )
-                            {
-                                tt -> get_node_off = PTrieGetNodeOff8;
-                                trans_off_len = ( get_32 ( ptt -> num_trans ) + 3 ) >> 2;
-                            }
-                            else if ( get_32 ( ptt -> data_size ) <= 65536 * 4 )
-                            {
-                                tt -> get_node_off = byteswap ? PTrieSwapNodeOff16 : PTrieGetNodeOff16;
-                                trans_off_len = ( get_32 ( ptt -> num_trans ) + 1 ) >> 1;
-                            }
-                            else
-                            {
-                                tt -> get_node_off = byteswap ? PTrieSwapNodeOff32 : PTrieGetNodeOff32;
-                                trans_off_len = get_32 ( ptt -> num_trans );
-                            }
-
-                            /* the minimum size of this image */
-                            min_size += trans_off_len << 2;
-
-                            /* initialize a few members -
-                               could be here or inside following if
-                               placed here only for pipelining */
-                            tt -> _rmap = ptt -> rmap;
-                            tt -> trans_off . v32 = & ptt -> rmap [ ptt_width ];
-
-                            /* require image size to pass test */
-                            if ( min_size <= size )
-                            {
-                                tt -> data = & tt -> trans_off . v32 [ trans_off_len ];
-                                tt -> num_trans = get_32 ( ptt -> num_trans );
-                                tt -> num_nodes = get_32 ( ptt -> num_nodes );
-                                tt -> data_size = get_32 ( ptt -> data_size );
-                                tt -> ext_keys = P_TrieExtKeys ( ptt_keys ) != 0;
-                                tt -> backtrace = P_TrieBacktrace ( ptt_keys ) != 0;
-                                tt -> id_coding = P_TrieIdCoding ( ptt_keys );
-                                tt -> byteswap = byteswap;
-                                tt -> width = ptt_width;
-                                tt -> first_char = first;
-                                tt -> last_char = last;
-                                tt -> unmapped_idx = unmapped;
-
-                                * ttp = tt;
-                                return 0;
-                            }
-                        }
-                        while ( 0 );
-
-                        free ( tt );
-                    }
-                }
-            }
-        }
-
-        * ttp = NULL;
-    }
-    return rc;
-}
-
-/* Make
- *  make a persisted tree structure
- *
- *  "addr" [ IN ] and "size" [ IN ] - constant memory image of
- *  persisted text tree with a lifetime exceeding that of the
- *  PTrie itself
- *
- *  "byteswap" [ IN ] - true if persisted image must be byteswapped
- */
-LIB_EXPORT rc_t CC PTrieMake ( PTrie **tt, const void *addr, size_t size, bool byteswap )
-{
-    return PTrieMakeInt ( tt, addr, size, byteswap, false );
-}
-
-/* MakeOrig - DEPRECATED
- *  make a persisted tree structure
- *  includes code to handle original composite node encoding
- *
- *  "addr" [ IN ] and "size" [ IN ] - constant memory image of
- *  persisted text tree with a lifetime exceeding that of the
- *  PTrie itself
- *
- *  "byteswap" [ IN ] - true if persisted image must be byteswapped
- */
-LIB_EXPORT rc_t CC PTrieMakeOrig ( PTrie **tt, const void *addr, size_t size, bool byteswap )
-{
-    return PTrieMakeInt ( tt, addr, size, byteswap, true );
-}
-
-/* Count
- *  returns number of { id : value } pairs in text tree
- *  not included within the TTree interface itself, but
- *  was included here due to the fact that it is constant
- *
- *  return value:
- *    integer value >= 0
- */
-LIB_EXPORT uint32_t CC PTrieCount ( const PTrie *self )
-{
-    if ( self != NULL )
-      return self -> num_nodes;
-    return 0;
-}
-
-/* Size
- *  returns the size in bytes
- *  of the PTrie image
- */
-LIB_EXPORT size_t CC PTrieSize ( const PTrie *self )
-{
-    const P_Trie *ptt;
-
-    if ( self == NULL )
-        return 0;
-
-    /* the original image has some standard set of headers
-       plus a bunch of table data from "rmap" to "data", followed
-       by "data_size" bytes of data. */
-    return ( const char* ) self -> data - ( const char* ) self -> _rmap +
-      self -> data_size + sizeof * ptt - sizeof ptt -> rmap;
-}
-
-/* GetNode
- *  gets a PTNode from an id
- *
- *  "node" [ OUT ] - return parameter for node
- *
- *  "id" [ IN ] - a 1-based integer node id
- *
- *  return values:
- *    EINVAL => an invalid parameter was passed
- *    ENOENT => id out of range
- */
-LIB_EXPORT rc_t CC PTrieGetNode ( const PTrie *self, PTNode *node, uint32_t id )
-{
-    rc_t rc;
-    if ( node == NULL )
-        rc = RC ( rcCont, rcTrie, rcAccessing, rcNode, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcCont, rcTrie, rcAccessing, rcSelf, rcNull );
-        else if ( id == 0 )
-            rc = RC ( rcCont, rcTrie, rcAccessing, rcId, rcNull );
-        else
-        {
-            uint32_t tid, btid;
-            rc = PTrieDecodeNodeId ( self, id, & tid, & btid );
-            if ( rc == 0 )
-            {
-                PTTrans trans;
-                rc = PTrieInitNode ( self, & trans, tid );
-                if ( rc == 0 )
-                {
-                    const PBSTree *pbt = trans . vals;
-                    if ( pbt == NULL )
-                        rc = RC ( rcCont, rcTrie, rcAccessing, rcId, rcNotFound );
-                    else
-                    {
-                        rc = PBSTreeGetNodeData ( pbt,
-                            & node -> data . addr, & node -> data . size, btid );
-                        if ( rc == 0 )
-                        {
-                            node -> internal = self;
-                            node -> id = id;
-
-                            if ( ! self -> ext_keys )
-                            {
-                                size_t sz = strlen ( node -> data . addr ) + 1;
-                                assert ( sz <= node -> data . size );
-                                node -> data . addr =
-                                    ( const char* ) node -> data . addr + sz;
-                                node -> data . size -= sz;
-                            }
-
-                            return 0;
-                        }
-                    }
-                }
-            }
-        }
-
-        node -> data . addr = node -> internal = NULL;
-        node -> data . size = 0;
-        node -> id = 0;
-    }
-    return rc;
-}
-
-/* InitNode
- */
-rc_t PTrieInitNode ( const PTrie *self, PTTrans *trans, uint32_t idx )
-{
-    rc_t rc;
-    uint32_t tcnt;
-    const uint8_t *align2;
-
-    assert ( self != NULL );
-    assert ( trans != NULL );
-
-    if ( idx == 0 )
-        return RC ( rcCont, rcNode, rcConstructing, rcId, rcNull );
-    if ( idx > self -> num_trans )
-        return RC ( rcCont, rcNode, rcConstructing, rcId, rcNotFound );
-
-    /* record node id */
-    trans -> tid = idx;
-
-    /* no backtrace link yet assigned */
-    trans -> back = NULL;
-
-    /* nobody is linked to us yet */
-    trans -> refcount = 0;
-
-    /* initialize the trans' index member */
-    trans -> idx . v32 =
-        & self -> data [ PTrieGetNodeOff ( self, idx - 1 ) ];
-    assert ( ( ( size_t ) trans -> idx . v8 & 3 ) == 0 );
-
-    /* can now access header values within index */
-    trans -> tcnt = PTTransGetIdx ( trans, self, pttHdrTransCnt );
-    trans -> icnt = PTTransGetIdx ( trans, self, pttHdrIdxCnt );
-
-    /* if the icnt is zero, the original child array was NULL */
-    if ( trans -> icnt == 0 )
-    {
-        trans -> slen = tcnt = 0;
-        trans -> child_seq_type = NULL;
-
-        /* get unaligned dad pointer */
-        trans -> dad . v8 =
-            PTTransGetIdxAddr ( trans, self, pttHdrNullEnd );
-   }
-    else
-    {
-        tcnt = PTTransGetIdx ( trans, self, pttHdrChildCnt );
-        trans -> slen = PTTransGetIdx ( trans, self, pttHdrSeqLen );
-
-        /* sequence type */
-        trans -> child_seq_type =
-            PTTransGetIdxAddr ( trans, self, pttFirstIdx + trans -> icnt );
-
-        /* unaligned dad pointer */
-        trans -> dad . v8 = & trans -> child_seq_type [ ( trans -> slen + 7 ) >> 3 ];
-    }
-
-    /* align dad and get child pointer */
-    trans -> child . v8 = PTTransAlignDadAddr ( trans, self );
-
-    /* location of align2 */
-    align2 = PTTransGetChildAddr ( trans, self, tcnt );
-
-    /* NULL out dad pointer if no backtrace */
-    if ( ! self -> backtrace )
-        trans -> dad . v8 = NULL;
-
-    /* NULL out child pointer if no transitions */
-    if ( trans -> icnt == 0 )
-        trans -> child . v8 = NULL;
-
-    /* finally, look at align for boolean */
-    if ( ( ( size_t ) align2 & 3 ) != 0 )
-    {
-        if ( align2 [ 0 ] == 0 )
-        {
-            trans -> vals = NULL;
-            return 0;
-        }
-
-        * ( size_t* ) & align2 |= 3;
-        ++ align2;
-    }
-
-    /* to avoid an allocation, mimic the older behavior
-       that used persisted data directly as a PBSTree
-       and had no allocation. we introduced a wrapper
-       object in order to have a vtable for byte-swapping,
-       and this disturbs the older code. */
-    trans -> vals = & trans -> _val;
-
-    rc = self -> byteswap ?
-        PBSTreeMakeSwapped ( & trans -> _val, align2, 0 ):
-        PBSTreeMakeNative ( & trans -> _val, align2, 0 );
-    if ( rc == 0 )
-    {
-        if ( PBSTreeCount ( trans -> vals ) == 0 )
-        {
-            trans -> vals = NULL;
-        }
-    }
-    return rc;
-}
-
-/* MakeNode
- */
-rc_t PTrieMakeNode ( const PTrie *self, PTTrans **transp, uint32_t idx )
-{
-    rc_t rc;
-
-    PTTrans *trans = malloc ( sizeof * trans );
-    if ( trans == NULL )
-        return RC ( rcCont, rcNode, rcAllocating, rcMemory, rcExhausted );
-
-    assert ( transp != NULL );
-    rc = PTrieInitNode ( self, * transp = trans, idx );
-    if ( rc != 0 )
-        free ( trans );
-
-    return rc;
-}
-
-/* MapChar
- *  maps a character to a one-based character code
- */
-static
-uint32_t PTrieMapChar ( const PTrie *tt, uint32_t ch )
-{
-  if ( ch >= tt -> first_char && ch <= tt -> last_char )
-    return tt -> map [ ch - tt -> first_char ];
-    return tt -> unmapped_idx;
-}
-
-/* NextIdx
- *  pops a character from key string
- *  maps it to an index
- */
-static
-rc_t PTrieNextIdx ( const PTrie *tt, String *key, uint32_t *idx )
-{
-    uint32_t ch;
-    rc_t rc = StringPopHead ( key, & ch );
-    if ( rc == 0 )
-        * idx = PTrieMapChar ( tt, ch );
-    return rc;
-}
-
-/* FindTrans
- */
-static
-rc_t PTrieFindTrans ( const PTrie *self, String *key, PTTrans **transp )
-{
-    rc_t rc;
-
-    PTTrans *dad;
-    uint32_t tid;
-    uint32_t key_idx;
-
-    for ( dad = NULL, key_idx = 0, rc = PTrieMakeNode ( self, transp, 1 );
-          rc == 0; rc = PTrieMakeNode ( self, transp, tid ) )
-    {
-        PTTrans *trans = * transp;
-
-        /* link in dad */
-        trans -> back = dad;
-#if ! RECORD_HDR_IDX
-        trans -> tidx = key_idx;
-#endif
-        if ( dad != NULL )
-        {
-#if ! RECORD_HDR_DEPTH
-            trans -> depth = dad -> depth + 1;
-#endif
-            ++ dad -> refcount;
-        }
-#if ! RECORD_HDR_DEPTH
-        else
-        {
-            trans -> depth = 0;
-        }
-#endif
-
-        /* if there are no child transitions,
-           this must be the node */
-        if ( trans -> icnt == 0 )
-            return 0;
-
-        /* capture dad for next loop
-           or for failure cleanup */
-        dad = trans;
-
-        /* get transition index for character */
-        rc = PTrieNextIdx ( self, key, & key_idx );
-        if ( rc != 0 )
-        {
-            /* end of string */
-            if ( GetRCState ( rc ) == rcEmpty )
-                return 0;
-
-            /* invalid input */
-            break;
-        }
-
-        /* either an unrecognized character or
-           a NULL transition mean NOT FOUND */
-        rc = RC ( rcCont, rcTrie, rcSelecting, rcString, rcNotFound );
-
-        /* check for inability to take transition */
-        if ( key_idx == 0 )
-            break;
-
-        /* try to take transition */
-        tid = PTTransGetChildChildIdx ( trans, self, -- key_idx );
-        if ( tid == 0 )
-            break;
-
-        /* convert the child transition index into a trans id */
-        tid = PTTransGetChild ( trans, self, tid - 1 ) + 1;
-    }
-
-    PTTransWhack ( dad );
-    return rc;
-}
-
-/* Find
- * PTrieFindRE
- *  find a single { id, value } pair  within tree
- *
- *  "item" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  "rtn" [ OUT ] - return parameter for node if found.
- *  its value is undefined unless the function returns success.
- *
- *  return value:
- *    0    => not found
- *    1..n => id of found pair
- */
-static
-int CC PTNodeFindExact ( const void *ignore, const PBSTNode *n , void * data)
-{
-    assert ( n -> data . addr != NULL );
-    assert ( n -> data . size > 0 );
-
-    if ( ( ( const char* ) n -> data . addr ) [ 0 ] == 0 )
-        return 0;
-    return -1;
-}
-
-static
-int CC PTNodeFindRem ( const void *item, const PBSTNode *n, void * data )
-{
-    /* compare the remainder of the key */
-    const String *rem = item;
-    int diff = string_cmp ( rem -> addr, rem -> size,
-        n -> data . addr, n -> data . size, rem -> len );
-
-    /* if they differed within the key length, it could
-       be that the node is shorter or that there was a
-       character mismatch */
-    if ( diff != 0 )
-        return diff;
-
-    /* the only thing to ascertain now
-       is that the lengths are equal */
-    if ( ( ( const char* ) n -> data . addr ) [ rem -> size ] == 0 )
-        return 0;
-
-    /* the key is shorter */
-    return -1;
-}
-
-LIB_EXPORT uint32_t CC PTrieFind ( const PTrie *self, const String *item, PTNode *rtn,
-        int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data )
-{
-
-    if ( rtn == NULL )
-        return 0;
-
-    rtn -> data . addr = rtn -> internal = NULL;
-    rtn -> data . size = 0;
-    rtn -> id = 0;
-
-    if ( self != NULL && item != NULL && self -> num_trans != 0 && item -> len != 0 )
-    {
-        String key = * item;
-
-        PTTrans *trans;
-        rc_t rc = PTrieFindTrans ( self, & key, & trans );
-
-        if ( rc == 0 )
-        {
-            /* any values in b-tree? */
-            if ( trans -> vals != NULL )
-            {
-                int ( CC * cmp ) ( const void *item, const PBSTNode *n, void *data );
-                
-                if ( custom_cmp != NULL)
-                    cmp = custom_cmp;
-                else if ( self -> ext_keys )
-                    cmp = NULL;
-                /* for exact match on node */
-                else if ( key . len == 0 )
-                    cmp = PTNodeFindExact;
-                /* for remainder */
-                else
-                    cmp = PTNodeFindRem;
-
-                /* try to find the node */
-                if ( cmp != NULL )
-                {
-                    PBSTNode btnode;
-                    uint32_t btid = PBSTreeFind ( trans -> vals, & btnode, & key, cmp, data );
-                    if ( btid != 0 )
-                    {
-                        /* grab the data */
-                        rtn -> data . addr = btnode . data . addr;
-                        rtn -> data . size = btnode . data . size;
-
-                        /* record reference to self */
-                        rtn -> internal = self;
-
-                        /* set an id */
-                        rtn -> id = PTrieEncodeNodeId ( self,
-                            trans -> tid, btid );
-
-                        /* adjust the data block for internal keys */
-                        if ( ! self -> ext_keys )
-                        {
-                            const char *ptr = ( const char* ) rtn -> data . addr;
-                            for ( ; rtn -> data . size > 1 && * ptr != '\0'; ++ ptr, -- rtn -> data . size )
-                                ( void ) 0;
-                            rtn -> data . addr = ptr + 1; /* skip terminating NUL byte */
-                            -- rtn -> data.size;
-                        }
-                    }
-                }
-            }
-
-            PTTransWhack ( trans );
-        }
-    }
-
-    return rtn -> id;
-}
-
-LIB_EXPORT uint32_t CC PTrieFindRE ( const PTrie *self, const String *re, PTNode *rtn );
-
-/* FindAll
- * PTrieFindAllRE
- *  find multiple objects within tree
- *
- *  "key" [ IN ] - an exact match text string
- *
- *  "re" [ IN ] - a regular expression string
- *
- *  "buffer" [ OUT ] and "capacity" [ IN ] - a user-supplied
- *  array of PTNode with a capacity of "capacity" elements.
- *  if successful, the entire found set will be returned unordered within.
- *
- *  "num_found" [ OUT ] - indicates the size of the found set,
- *  regardless of return value, such that if the supplied
- *  buffer were to be too small, the required size is returned.
- *
- *  returns status codes:
- *    EINVAL  => an invalid parameter
- *    ENOENT  => the found set was empty
- *    ENOBUFS => the found set was too large
- */
-LIB_EXPORT rc_t CC PTrieFindAll ( const PTrie *self, struct String const *key,
-    PTNode buffer [], uint32_t capacity, uint32_t *num_found,
-    int ( CC * custom_cmp ) ( const void *item, const PBSTNode *n, void *data ), void *data );
-
-LIB_EXPORT rc_t CC PTrieFindAllRE ( const PTrie *self, const String *re,
-    PTNode buffer [], uint32_t capacity, uint32_t *num_found );
-
-/* ForEach
- *  executes a function on each tree element
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TTNode in the tree
- */
-typedef struct PTrieForEachData PTrieForEachData;
-struct PTrieForEachData
-{
-    const PTrie *tt;
-    void ( CC * f ) ( PTNode *n, void *data );
-    void *data;
-    uint32_t tid;
-};
-
-static
-void CC PTrieRunForEachVal ( PBSTNode *btn, void *data )
-{
-    PTNode ttn;
-    PTrieForEachData *pb = data;
-
-    ttn . data . addr = btn -> data . addr;
-    ttn . data . size = btn -> data . size;
-    ttn . internal = pb -> tt;
-    ttn . id = PTrieEncodeNodeId ( pb -> tt, pb -> tid, btn -> id );
-
-    if ( ! pb -> tt -> ext_keys )
-    {
-        size_t sz = strlen ( ttn . data . addr ) + 1;
-        assert ( sz <= ttn . data . size );
-        ttn . data . addr =
-            ( const char* ) ttn . data . addr + sz;
-        ttn . data . size -= sz;
-    }
-
-    ( * pb -> f ) ( & ttn, pb -> data );
-}
-
-static
-void PTrieRunForEachTrans ( const PTTrans *trans, const PTrie *tt, void *data )
-{
-    if ( trans -> vals != NULL )
-    {
-        PTrieForEachData *pb = data;
-        pb -> tid = trans -> tid;
-        PBSTreeForEach ( trans -> vals, 0, PTrieRunForEachVal, pb );
-    }
-}
-
-LIB_EXPORT void CC PTrieForEach ( const PTrie *self,
-    void ( CC * f ) ( PTNode *n, void *data ), void *data )
-{
-  if ( self != NULL && f != NULL && self -> num_trans != 0 )
-    {
-        PTTrans trans;
-        int status = PTrieInitNode ( self, & trans, 1 );
-        if ( status == 0 )
-        {
-            PTrieForEachData pb;
-            pb . tt = self;
-            pb . f = f;
-            pb . data = data;
-
-            PTTransForEach ( & trans, self, PTrieRunForEachTrans, & pb );
-        }
-    }
-}
-
-/* DoUntil
- *  executes a function on each tree element
- *  until the function returns true
- *
- *  "f" [ IN ] and "data" [ IN ] - iteration callback function for
- *  examining each TTNode in the tree. the function returns "true"
- *  to halt iteration.
- *
- *  return values:
- *    the last value returned by "f" or false if never invoked
- */
-typedef struct PTrieDoUntilData PTrieDoUntilData;
-struct PTrieDoUntilData
-{
-    const PTrie *tt;
-    bool ( CC * f ) ( PTNode *n, void *data );
-    void *data;
-    uint32_t tid;
-};
-
-static
-bool CC PTrieRunDoUntilVal ( PBSTNode *btn, void *data )
-{
-    PTNode ttn;
-    PTrieDoUntilData *pb = data;
-
-    ttn . data . addr = btn -> data . addr;
-    ttn . data . size = btn -> data . size;
-    ttn . internal = pb -> tt;
-    ttn . id = PTrieEncodeNodeId ( pb -> tt, pb -> tid, btn -> id );
-
-    if ( ! pb -> tt -> ext_keys )
-    {
-        size_t sz = strlen ( ttn . data . addr ) + 1;
-        assert ( sz <= ttn . data . size );
-        ttn . data . addr =
-            ( const char* ) ttn . data . addr + sz;
-        ttn . data . size -= sz;
-    }
-
-    return ( * pb -> f ) ( & ttn, pb -> data );
-}
-
-static
-bool PTrieRunDoUntilTrans ( const PTTrans *trans, const PTrie *tt, void *data )
-{
-    if ( trans -> vals != NULL )
-    {
-        PTrieDoUntilData *pb = data;
-        pb -> tid = trans -> tid;
-        return PBSTreeDoUntil ( trans -> vals, 0, PTrieRunDoUntilVal, pb );
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC PTrieDoUntil ( const PTrie *self,
-    bool ( CC * f ) ( PTNode *n, void *data ), void *data )
-{
-  if ( self != NULL && f != NULL && self -> num_trans != 0 )
-    {
-        PTTrans trans;
-        rc_t rc = PTrieInitNode ( self, & trans, 1 );
-        if ( rc == 0 )
-        {
-            PTrieDoUntilData pb;
-            pb . tt = self;
-            pb . f = f;
-            pb . data = data;
-
-            return PTTransDoUntil ( & trans, self, PTrieRunDoUntilTrans, & pb );
-        }
-    }
-    return false;
-}
-
-/* Whack
- *  tears down internal structure
- */
-LIB_EXPORT void CC PTrieWhack ( PTrie *self )
-{
-    if ( self != NULL )
-        free ( self );
-}
diff --git a/libs/klib/qsort.c b/libs/klib/qsort.c
deleted file mode 100644
index 2945818..0000000
--- a/libs/klib/qsort.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/sort.h>
-#include <sysalloc.h>
-
-/* Copyright (C) 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Written by Douglas C. Schmidt (schmidt at ics.uci.edu).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* If you consider tuning this algorithm, you should consult first:
-   Engineering a sort function; Jon Bentley and M. Douglas McIlroy;
-   Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993.  */
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Byte-wise swap two items of size SIZE. */
-#define SWAP(a, b, size)                        \
-    do                                          \
-    {                                           \
-        register size_t __size = (size);        \
-        register char *__a = (a), *__b = (b);   \
-        do                                      \
-        {                                       \
-            char __tmp = *__a;                  \
-            *__a++ = *__b;                      \
-            *__b++ = __tmp;                     \
-        } while (--__size > 0);                 \
-    } while (0)
-
-/* Discontinue quicksort algorithm when partition gets below this size.
-   This particular magic number was chosen to work best on a Sun 4/260. */
-#define MAX_THRESH 4
-
-/* Stack node declarations used to store unfulfilled partition obligations. */
-typedef struct
-{
-    char *lo;
-    char *hi;
-} stack_node;
-
-/* The next 4 #defines implement a very fast in-line stack abstraction. */
-/* The stack needs log (total_elements) entries (we could even subtract
-   log(MAX_THRESH)).  Since total_elements has type size_t, we get as
-   upper bound for log (total_elements):
-   bits per byte (CHAR_BIT) * sizeof(size_t).  */
-#define STACK_SIZE	(CHAR_BIT * sizeof(size_t))
-#define PUSH(low, high)	((void) ((top->lo = (low)), (top->hi = (high)), ++top))
-#define	POP(low, high)	((void) (--top, (low = top->lo), (high = top->hi)))
-#define	STACK_NOT_EMPTY	(stack < top)
-
-
-/* Order size using quicksort.  This implementation incorporates
-   four optimizations discussed in Sedgewick:
-
-   1. Non-recursive, using an explicit stack of pointer that store the
-   next array partition to sort.  To save time, this maximum amount
-   of space required to store an array of SIZE_MAX is allocated on the
-   stack.  Assuming a 32-bit (64 bit) integer for size_t, this needs
-   only 32 * sizeof(stack_node) == 256 bytes (for 64 bit: 1024 bytes).
-   Pretty cheap, actually.
-
-   2. Chose the pivot element using a median-of-three decision tree.
-   This reduces the probability of selecting a bad pivot value and
-   eliminates certain extraneous comparisons.
-
-   3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving
-   insertion sort to order the MAX_THRESH items within each partition.
-   This is a big win, since insertion sort is faster for small, mostly
-   sorted array segments.
-
-   4. The larger of the two sub-partitions is always pushed onto the
-   stack first, with the algorithm then concentrating on the
-   smaller partition.  This *guarantees* no more than log (total_elems)
-   stack size is needed (actually O(1) in this case)!  */
-
-LIB_EXPORT void CC ksort ( void *pbase, size_t total_elems, size_t size,
-    int ( CC * cmp ) ( const void*, const void*, void *data ), void *data )
-{
-    register char *base_ptr = (char *) pbase;
-
-    const size_t max_thresh = MAX_THRESH * size;
-
-    /* NEW - NCBI ... avoid sorting a single element */
-    if (total_elems < 2)
-        /* Avoid lossage with unsigned arithmetic below.  */
-        return;
-
-    if (total_elems > MAX_THRESH)
-    {
-        char *lo = base_ptr;
-        char *hi = &lo[size * (total_elems - 1)];
-        stack_node stack[STACK_SIZE];
-        stack_node *top = stack;
-
-        PUSH (NULL, NULL);
-
-        while (STACK_NOT_EMPTY)
-        {
-            char *left_ptr;
-            char *right_ptr;
-
-            /* Select median value from among LO, MID, and HI. Rearrange
-               LO and HI so the three values are sorted. This lowers the
-               probability of picking a pathological pivot value and
-               skips a comparison for both the LEFT_PTR and RIGHT_PTR in
-               the while loops. */
-
-            char *mid = lo + size * ((hi - lo) / size >> 1);
-
-            if ((*cmp) ((void *) mid, (void *) lo, data) < 0)
-                SWAP (mid, lo, size);
-            if ((*cmp) ((void *) hi, (void *) mid, data) < 0)
-                SWAP (mid, hi, size);
-            else
-                goto jump_over;
-            if ((*cmp) ((void *) mid, (void *) lo, data) < 0)
-                SWAP (mid, lo, size);
-        jump_over:;
-
-            left_ptr  = lo + size;
-            right_ptr = hi - size;
-
-            /* Here's the famous ``collapse the walls'' section of quicksort.
-               Gotta like those tight inner loops!  They are the main reason
-               that this algorithm runs much faster than others. */
-            do
-            {
-                while ((*cmp) ((void *) left_ptr, (void *) mid, data) < 0)
-                    left_ptr += size;
-
-                while ((*cmp) ((void *) mid, (void *) right_ptr, data) < 0)
-                    right_ptr -= size;
-
-                if (left_ptr < right_ptr)
-                {
-                    SWAP (left_ptr, right_ptr, size);
-                    if (mid == left_ptr)
-                        mid = right_ptr;
-                    else if (mid == right_ptr)
-                        mid = left_ptr;
-                    left_ptr += size;
-                    right_ptr -= size;
-                }
-                else if (left_ptr == right_ptr)
-                {
-                    left_ptr += size;
-                    right_ptr -= size;
-                    break;
-                }
-            }
-            while (left_ptr <= right_ptr);
-
-            /* Set up pointers for next iteration.  First determine whether
-               left and right partitions are below the threshold size.  If so,
-               ignore one or both.  Otherwise, push the larger partition's
-               bounds on the stack and continue sorting the smaller one. */
-
-            if ((size_t) (right_ptr - lo) <= max_thresh)
-            {
-                if ((size_t) (hi - left_ptr) <= max_thresh)
-                    /* Ignore both small partitions. */
-                    POP (lo, hi);
-                else
-                    /* Ignore small left partition. */
-                    lo = left_ptr;
-            }
-            else if ((size_t) (hi - left_ptr) <= max_thresh)
-                /* Ignore small right partition. */
-                hi = right_ptr;
-            else if ((right_ptr - lo) > (hi - left_ptr))
-            {
-                /* Push larger left partition indices. */
-                PUSH (lo, right_ptr);
-                lo = left_ptr;
-            }
-            else
-            {
-                /* Push larger right partition indices. */
-                PUSH (left_ptr, hi);
-                hi = right_ptr;
-            }
-        }
-    }
-
-    /* Once the BASE_PTR array is partially sorted by quicksort the rest
-       is completely sorted using insertion sort, since this is efficient
-       for partitions below MAX_THRESH size. BASE_PTR points to the beginning
-       of the array to sort, and END_PTR points at the very last element in
-       the array (*not* one beyond it!). */
-
-#undef min
-#define min(x, y) ((x) < (y) ? (x) : (y))
-
-    {
-        char *const end_ptr = &base_ptr[size * (total_elems - 1)];
-        char *tmp_ptr = base_ptr;
-        char *thresh = min(end_ptr, base_ptr + max_thresh);
-        register char *run_ptr;
-
-        /* Find smallest element in first threshold and place it at the
-           array's beginning.  This is the smallest array element,
-           and the operation speeds up insertion sort's inner loop. */
-
-        for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size)
-            if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, data) < 0)
-                tmp_ptr = run_ptr;
-
-        if (tmp_ptr != base_ptr)
-            SWAP (tmp_ptr, base_ptr, size);
-
-        /* Insertion sort, running from left-hand-side up to right-hand-side.  */
-
-#if 1
-        /* NEW - NCBI */
-        tmp_ptr = base_ptr + size;
-        for ( run_ptr = base_ptr + size + size; run_ptr <= end_ptr; tmp_ptr = run_ptr, run_ptr += size )
-        {
-            for ( ; tmp_ptr >= base_ptr; tmp_ptr -= size )
-            {
-                if ( ( * cmp ) ( run_ptr, tmp_ptr, data ) >= 0 )
-                    break;
-            }
-
-            tmp_ptr += size;
-            if ( tmp_ptr != run_ptr )
-            {
-                char *trav;
-
-                trav = run_ptr + size;
-                while (--trav >= run_ptr)
-                {
-                    char c = *trav;
-                    char *hi, *lo;
-
-                    for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo)
-                        *hi = *lo;
-                    *hi = c;
-                }
-            }
-        }
-
-#else
-        run_ptr = base_ptr + size;
-        while ((run_ptr += size) <= end_ptr)
-        {
-            tmp_ptr = run_ptr - size;
-            while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, data) < 0)
-                tmp_ptr -= size;
-
-            tmp_ptr += size;
-            if (tmp_ptr != run_ptr)
-            {
-                char *trav;
-
-                trav = run_ptr + size;
-                while (--trav >= run_ptr)
-                {
-                    char c = *trav;
-                    char *hi, *lo;
-
-                    for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo)
-                        *hi = *lo;
-                    *hi = c;
-                }
-            }
-        }
-#endif
-    }
-}
diff --git a/libs/klib/rc-idx-tbl.c b/libs/klib/rc-idx-tbl.c
deleted file mode 100644
index a851807..0000000
--- a/libs/klib/rc-idx-tbl.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-* Is used in XML logging to generate RC-derived attributes
-*/
-
-#define RC_ENUM( type ) \
-    const char *g ## type ##Idx_str [] =
-
-#define RC_ENTRY( id, txt ) # id ,
-
-#define RC_VLAST( id )
-
-#define RC_LAST( id ) NULL
-
-#include <klib/rc.h>
-
-/* EOF */
diff --git a/libs/klib/rc-tbl.c b/libs/klib/rc-tbl.c
deleted file mode 100644
index e09543f..0000000
--- a/libs/klib/rc-tbl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define RC_ENUM( type ) \
-    const char *g ## type ##_str [] =
-
-#define RC_ENTRY( id, txt ) txt,
-
-#define RC_VLAST( id )
-
-#define RC_LAST( id ) NULL
-
-#include <klib/rc.h>
diff --git a/libs/klib/refcount.c b/libs/klib/refcount.c
deleted file mode 100644
index 55590d9..0000000
--- a/libs/klib/refcount.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <sysalloc.h>
-
-#ifndef TRACK_REFERENCES
-#define TRACK_REFERENCES 1
-#endif
-
-#undef INLINE_REFCOUNT
-/* #define INLINE_REFCOUNT 1 */
-
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <atomic32.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-
-/* the simple atomic32_dec_and_test interface does not detect
-   crossing to negative. better said, it internally detects the
-   event but does not pay for setting a tri-state return value
-   on exit, opting instead to only detect the zero crossing. */
-#ifndef DETECT_ZERO_STATE
-#define DETECT_ZERO_STATE 1
-#endif
-
-/* the simple atomic32_inc interface does not detect rollover */
-#ifndef DETECT_LIMIT_VIOLATION
-#define DETECT_LIMIT_VIOLATION 1
-#endif
-
-/* this is in here to detect if the refcount is above a certain value 
-   introduced to debug heap corruption in the windows-build */
-#define MAX_REFCOUNT_VALUE 1000
-#ifndef DETECT_MAX_REFCOUNT_VIOLATION
-#define DETECT_MAX_REFCOUNT_VIOLATION 1
-#endif
-
-
-#define DUAL_OWN_BITS 16
-#define DUAL_DEP_BITS ( 32 - DUAL_OWN_BITS )
-#define DUAL_OWN_VAL ( 1 << DUAL_DEP_BITS )
-#define DUAL_DEP_VAL 1
-#define DUAL_OWN_MAX ( ( 1 << ( DUAL_OWN_BITS - 1 ) ) - 1 )
-#define DUAL_DEP_MAX ( ( 1 << ( DUAL_DEP_BITS - 1 ) ) - 1 )
-#define DUAL_OWN_LIM ( DUAL_OWN_MAX << DUAL_DEP_BITS )
-#define DUAL_DEP_LIM DUAL_DEP_MAX
-#define DUAL_OWN_MASK ( ( 1 << DUAL_OWN_BITS ) - 1 )
-#define DUAL_DEP_MASK ( ( 1 << DUAL_DEP_BITS ) - 1 )
-
-/*--------------------------------------------------------------------------
- * KRefcount
- *  signed 32-bit reference counter
- * KDualRef
- *  dual signed/unsigned 16-bit reference counter
- */
-
-
-/* Init
- *  initialize a refcount object
- *
- *  "refcount" [ IN/OUT ] - pointer to object being initialized
- *
- *  "value" [ IN ] - initial refcount value
- *    -OR-
- *  "owned" [ IN ] and "dep" [ IN ] - owned and dependent counts
- *  function will return krefLimit if counts exceed limits
- *
- *  "clsname" [ IN ] - NUL-terminated string stating classname
- *  of object instance being initialized.
- *
- *  "op" [ IN ] - NUL-terminated string stating construction operation
- *
- *  "name" [ IN ] - NUL-terminated name of instance
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT void CC KRefcountInit ( KRefcount *refcount, int value,
-    const char *clsname, const char *op, const char *name )
-{
-    REFNEW ( clsname, op, name, refcount, value );
-    atomic32_set ( refcount, value );
-}
-#endif
-
-LIB_EXPORT int CC KDualRefInit ( KDualRef *refcount, int owned, int dep,
-    const char *clsname, const char *op, const char *name )
-{
-    int value = owned << DUAL_DEP_BITS | dep;
-
-#if DETECT_LIMIT_VIOLATION
-    if ( owned < 0 || owned > DUAL_OWN_MAX ||
-         dep < 0 || dep > DUAL_DEP_MAX )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED TO CREATE %s, operation %s, name '%s', instance $0x%p: initial refcounts 0x%x, 0x%x",
-                   clsname, op, name, refcount, owned, dep ) );
-        return krefLimit;
-    }
-#endif
-
-    REFNEW ( clsname, op, name, refcount, value );
-    atomic32_set ( refcount, value );
-    return krefOkay;
-}
-
-
-/* Whack
- *  tear down whatever was built up in object
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT void CC KRefcountWhack ( KRefcount *self, const char *clsname )
-{
-    REFMSG ( clsname, "whack", self );
-}
-#endif
-
-LIB_EXPORT void CC KDualRefWhack ( KDualRef *self, const char *clsname )
-{
-    REFMSG ( clsname, "whack", self );
-}
-
-
-/* Add
- *  add an owned reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation always returns krefOkay.
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully added
- *    krefZero     : reference was added, but prior value was zero
- *    krefLimit    : reference was NOT added, too many references
- *    krefNegative : reference was NOT added, prior value was negative
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT int CC KRefcountAdd ( const KRefcount *self, const char *clsname )
-{
-#if DETECT_ZERO_STATE
-    int prior = atomic32_read_and_add_ge ( ( KRefcount* ) self, 1, 0 );
-    if ( prior < 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to addref %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-    if ( prior == 0 )
-    {
-#if 0 /*** disabling this warning since code is noe initializing refcount to zero in several places ***/
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "about to addref %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-#endif
-        return krefZero;
-    }
-
-#if DETECT_LIMIT_VIOLATION
-    if ( prior == INT_MAX )
-    {
-        atomic32_dec ( ( KRefcount* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to addref %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-#endif
-
-    CNTMSG ( clsname, "addref", self, prior );
-
-#elif DETECT_LIMIT_VIOLATION
-    unsigned int prior = atomic32_read_and_add_lt ( ( KRefcount* ) self, 1, INT_MAX );
-    if ( prior >= INT_MAX )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to addref %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-    CNTMSG ( clsname, "addref", self, prior );
-#else
-    REFMSG ( clsname, "addref", self );
-    atomic32_inc ( ( KRefcount* ) ( self ) );
-#endif
-
-    return krefOkay;
-}
-#endif
-
-LIB_EXPORT int CC KDualRefAdd ( const KDualRef *self, const char *clsname )
-{
-#if DETECT_LIMIT_VIOLATION
-    unsigned int prior = atomic32_read_and_add_lt ( ( KDualRef* ) self, DUAL_OWN_VAL, DUAL_OWN_LIM );
-#if DETECT_ZERO_STATE
-    unsigned int owned = prior >> DUAL_DEP_BITS;
-    if ( owned > DUAL_OWN_MAX )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER, 
-                  ( "FAILED to addref %s instance 0x%p: prior refcount = 0x%x",
-                    clsname, self, prior ));
-        return krefNegative;
-    }
-    if ( prior == 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER, 
-                 ( "about to addref %s instance 0x%p: prior refcount = 0x%x",
-                    clsname, self, prior ) );
-        return krefZero;
-    }
-#endif
-    if ( prior >= DUAL_OWN_LIM )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER, 
-                  ( "FAILED to addref %s instance 0x%p: prior refcount = 0x0%x",
-                    clsname, self, prior ));
-        return krefLimit;
-    }
-    CNTMSG ( clsname, "addref", self, prior );
-#elif DETECT_ZERO_STATE
-    unsigned int prior = atomic32_read_and_add ( ( KDualRef* ) self, DUAL_OWN_VAL );
-    unsigned int owned = prior >> DUAL_DEP_BITS;
-    if ( owned > DUAL_OWN_MAX )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                  ( "FAILED to addref %s instance %0x%p: prior refcount = 0x%x",
-                    clsname, self, prior ));
-        return krefNegative;
-    }
-    if ( prior == 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                  ( "about to addref %s instance %0x%p: prior refcount = 0x%x",
-                    clsname, self, prior ));
-        return krefZero;
-    }
-    CNTMSG ( clsname, "addref", self, prior );
-#else
-    REFMSG ( clsname, "addref", self );
-    atomic32_add ( ( KDualRef* ) ( self ), DUAL_OWN_VAL );
-#endif
-    return krefOkay;
-}
-
-
-/* Drop
- *  drop an owned reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation returns:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *    krefZero     : reference was dropped, and no further owned refernces exist
- *    krefNegative : reference was NOT dropped, as resultant count would be negative
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT int CC KRefcountDrop ( const KRefcount *self, const char *clsname )
-{
-#if DETECT_ZERO_STATE
-    int prior = atomic32_read_and_add ( ( KRefcount* ) self, -1 );
-    if ( prior <= 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to release %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-    CNTMSG ( clsname, "release", self, prior );
-    if ( prior == 1 )
-        return krefWhack;
-#else
-    REFMSG ( clsname, "release", self );
-    if ( atomic32_dec_and_test ( ( KRefcount* ) ( self ) ) )
-        return krefWhack;
-#endif
-    return krefOkay;
-}
-#endif
-
-LIB_EXPORT int CC KDualRefDrop ( const KDualRef *self, const char *clsname )
-{
-    int prior = atomic32_read_and_add_ge ( ( KDualRef* ) self, - DUAL_OWN_VAL, DUAL_OWN_VAL );
-#if DETECT_ZERO_STATE
-    if ( prior < DUAL_OWN_VAL )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to release %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-#endif
-    CNTMSG ( clsname, "release", self, prior );
-    if ( prior == DUAL_OWN_VAL )
-        return krefWhack;
-    if ( ( prior >> DUAL_DEP_BITS ) == 0 )
-        return krefZero;
-    return krefOkay;
-}
-
-
-/* AddDep
- *  adds a dependency reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation always returns krefOkay.
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully added
- *    krefZero     : reference was added, but prior value was zero
- *    krefNegative : reference was NOT added, prior value was negative
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT int CC KRefcountAddDep ( const KRefcount *self, const char *clsname )
-{
-#if DETECT_ZERO_STATE
-    int prior = atomic32_read_and_add ( ( KRefcount* ) self, 1 );
-    if ( prior < 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-    if ( prior == 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "about to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefZero;
-    }
-#if DETECT_LIMIT_VIOLATION
-    if ( prior == INT_MAX )
-    {
-        atomic32_dec ( ( KRefcount* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-#endif
-    CNTMSG ( clsname, "attach", self, prior );
-#elif DETECT_LIMIT_VIOLATION
-    unsigned int prior = atomic32_read_and_add_lt ( ( KRefcount* ) self, 1, INT_MAX );
-    if ( prior >= INT_MAX )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-    CNTMSG ( clsname, "attach", self, prior );
-#else
-    REFMSG ( clsname, "attach", self );
-    atomic32_inc ( ( KRefcount* ) ( self ) );
-#endif
-    return krefOkay;
-}
-#endif
-
-LIB_EXPORT int CC KDualRefAddDep ( const KDualRef *self, const char *clsname )
-{
-#if DETECT_ZERO_STATE
-    int prior = atomic32_read_and_add_ge ( ( KDualRef* ) self, 1, 0 );
-    int dep = prior & DUAL_DEP_MASK;
-    if ( prior < 0 || dep > DUAL_DEP_MAX )
-    {
-        if ( prior >= 0 )
-            atomic32_dec ( ( KDualRef* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-    if ( prior == 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "about to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefZero;
-    }
-#if DETECT_LIMIT_VIOLATION
-    if ( dep == DUAL_DEP_MAX )
-    {
-        atomic32_dec ( ( KDualRef* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-#endif
-    CNTMSG ( clsname, "attach", self, prior );
-#elif DETECT_LIMIT_VIOLATION
-    int prior = atomic32_read_and_inc ( ( KDualRef* ) self );
-    if ( ( prior & DUAL_DEP_MASK ) >= DUAL_DEP_MAX )
-    {
-        atomic32_dec ( ( KDualRef* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to attach %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefLimit;
-    }
-    CNTMSG ( clsname, "attach", self, prior );
-#else
-    REFMSG ( clsname, "attach", self );
-    atomic32_inc ( ( KDualRef* ) ( self ) );
-#endif
-    return krefOkay;
-}
-
-
-/* DropDep
- *  drop a dependency reference
- *  returns enum value indicating action to be taken
- *
- *  inline implementation returns:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *
- *  linked-in implementation may return any of the following
- *  codes, depending upon how it was compiled:
- *    krefOkay     : reference was successfully dropped
- *    krefWhack    : all references are gone and object can be collected
- *    krefZero     : reference was dropped, and no further dependent refernces exist
- *    krefNegative : reference was NOT dropped, as resultant count would be negative
- */
-#if INLINE_REFCOUNT
-#else
-LIB_EXPORT int CC KRefcountDropDep ( const KRefcount *self, const char *clsname )
-{
-#if DETECT_ZERO_STATE
-    int prior = atomic32_read_and_add ( ( KRefcount* ) self, -1 );
-    if ( prior <= 0 )
-    {
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to sever %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-    CNTMSG ( clsname, "sever", self, prior );
-    if ( prior == 1 )
-        return krefWhack;
-#else
-    REFMSG ( clsname, "sever", self );
-    if ( atomic32_dec_and_test ( ( KRefcount* ) ( self ) ) )
-        return krefWhack;
-#endif
-    return krefOkay;
-}
-#endif
-
-LIB_EXPORT int CC KDualRefDropDep ( const KDualRef *self, const char *clsname )
-{
-    int prior = atomic32_read_and_add ( ( KDualRef* ) self, -1 );
-#if DETECT_ZERO_STATE
-    if ( prior <= 0 )
-    {
-        atomic32_inc ( ( KDualRef* ) self );
-        DBGMSG ( DBG_REF, DBG_REF_PLACEHOLDER,
-                 ( "FAILED to sever %s instance 0x%p: prior refcount = 0x%x",
-                   clsname, self, prior ) );
-        return krefNegative;
-    }
-#endif
-    CNTMSG ( clsname, "sever", self, prior );
-    if ( prior == 1 )
-        return krefWhack;
-    if ( ( prior & DUAL_DEP_MASK ) == 1 )
-        return krefZero;
-    return krefOkay;
-}
diff --git a/libs/klib/report.c b/libs/klib/report.c
deleted file mode 100644
index 94d6078..0000000
--- a/libs/klib/report.c
+++ /dev/null
@@ -1,816 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h> /* MUST BE FIRST */
-
-#include <kapp/args.h> /* OPTION_REPORT */
-
-#include <kfs/directory.h> /* KDirectoryNativeDir */
-
-#include <klib/report.h> /* ReportInit */
-#include <klib/namelist.h> /* KNamelistRelease */
-#include <klib/time.h> /* KTime */
-#include <klib/text.h> /* string_printf */
-#include <klib/printf.h> /* string_printf */
-#include <klib/log.h> /* LOGERR */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/rc.h>
-#include <klib/klib-priv.h>
-#include <atomic.h> /* atomic_test_and_set_ptr */
-
-#include <stdarg.h> /* va_start */
-#include <stdio.h> /* sprintf */
-#include <stdlib.h> /* malloc */
-#include <string.h> /* memset */
-#include <limits.h> /* PATH_MAX */
-#include <assert.h>
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-/*
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-static
-rc_t XMLLogger_Encode(const char* src, char *dst,
-    size_t dst_sz, size_t *num_writ)
-{
-    rc_t rc = 0;
-    if( src == NULL || dst == NULL || num_writ == NULL ) {
-        rc = RC(rcApp, rcArgv, rcParsing, rcParam, rcNull);
-    } else {
-        *num_writ = 0;
-        do {
-            size_t bytes;
-            const char* p;
-            switch(*src) {
-                case '\'':
-                    bytes = 6;
-                    p = "'";
-                    break;
-                case '"':
-                    bytes = 6;
-                    p = """;
-                    break;
-                case '&':
-                    bytes = 5;
-                    p = "&";
-                    break;
-                case '<':
-                    bytes = 4;
-                    p = "<";
-                    break;
-                case '>':
-                    bytes = 4;
-                    p = ">";
-                    break;
-                default:
-                    bytes = 1;
-                    p = src;
-                    break;
-            }
-            if( (*num_writ + bytes) > dst_sz ) {
-                rc = RC(rcApp, rcLog, rcEncoding, rcBuffer, rcInsufficient);
-                break;
-            } else {
-                memcpy(dst, p, bytes);
-                *num_writ = *num_writ + bytes;
-                dst += bytes;
-            }
-        } while(*src++ != '\0');
-        *num_writ = *num_writ - 1;
-    }
-    return rc;
-}
-
-typedef rc_t (CC ReportObj)(const ReportFuncs *f, uint32_t indent,
-                              const char *path, bool *wasDbOrTableSet);
-typedef rc_t (CC ReportSoftware)(const ReportFuncs *f, uint32_t indent,
-                          const char *argv_0, const char *date, ver_t tool_ver);
-typedef rc_t (CC Whack )(void);
-typedef struct Report {
-    rc_t ( CC * report_redirect ) ( KWrtHandler* handler,
-        const char* filename, bool* to_file, bool finalize );
-    rc_t ( CC * report_cwd ) ( const ReportFuncs *f, uint32_t indent );
-    rc_t ( CC * report_config ) ( const ReportFuncs *f, uint32_t indent );
-    ReportObj *report_vdb;
-    ReportSoftware *report_software;
-    Whack *whack_vdb;
-    char* volatile object; /* path: to free */
-    const char* date;
-    char** argv;
-    int argc;
-    KTime_t start;
-    ver_t tool_ver;
-    bool hasZombies;
-    bool silence;
-} Report;
-
-static rc_t ReportReplaceObjectPtr(Report* self, const char* path) {
-    char *copy, *prev_ptr, *cur_ptr;
-
-    assert(self);
-
-    copy = string_dup_measure(path, NULL);
-    if (copy == NULL)
-        return RC(rcExe, rcMemory, rcAllocating, rcMemory, rcExhausted);
-
-    cur_ptr = self -> object;
-    do
-    {
-        prev_ptr = cur_ptr;
-        cur_ptr = atomic_test_and_set_ptr ( ( void* volatile* ) & self -> object, copy, prev_ptr );
-    }
-    while ( cur_ptr != prev_ptr );
-
-    if ( cur_ptr != NULL )
-        free ( cur_ptr );
-
-    return 0;
-}
-
-static rc_t ReportFreeObject(Report* self) {
-    rc_t rc = 0;
-    char *prev_ptr, *cur_ptr;
-
-    assert(self);
-
-    cur_ptr = self -> object;
-    do
-    {
-        prev_ptr = cur_ptr;
-        cur_ptr = atomic_test_and_set_ptr ( ( void* volatile* ) & self -> object, NULL, prev_ptr );
-    }
-    while ( cur_ptr != prev_ptr );
-
-    if ( cur_ptr != NULL )
-        free(cur_ptr);
-
-    return rc;
-}
-
-static Report * volatile report_singleton;
-
-static rc_t ReportGet(Report** self)
-{
-    if ( report_singleton == NULL )
-        return RC ( rcRuntime, rcStorage, rcAccessing, rcSelf, rcNull );
-
-    * self = ( Report* ) report_singleton;
-    return 0;
-}
-static rc_t ReportRelease(void)
-{
-    rc_t rc = 0;
-    Report *prev_report, *cur_report;
-
-    cur_report = report_singleton;
-    do
-    {
-        prev_report = cur_report;
-        cur_report = atomic_test_and_set_ptr ( ( void* volatile* ) & report_singleton, NULL, prev_report );
-    }
-    while ( cur_report != prev_report );
-
-    if ( cur_report != NULL )
-    {
-
-        /* cleanup */
-        ReportFreeObject( cur_report );
-        if ( cur_report -> whack_vdb != NULL )
-            rc = ( * cur_report -> whack_vdb ) ();
-
-        if ( cur_report -> argv != NULL )
-        {
-            int i;
-            for ( i = 0; i < cur_report -> argc; ++ i )
-                free ( cur_report -> argv [ i ] );
-            free ( cur_report -> argv );
-            cur_report -> argv = NULL;
-        }
-
-        memset ( cur_report, 0, sizeof * cur_report );
-    }
-
-    return rc;
-}
-
-static void reportOpen1(uint32_t indent, const char* name) {
-    OUTMSG(("%*c%s>", indent + 1, '<', name));
-}
-
-static rc_t reportData1(const char* data) {
-    rc_t rc = 0;
-
-    char dummy[PATH_MAX * 2 + 1] = "";
-    const char* p = data;
-
-    assert(data);
-
-    if (data[0] == 0) {
-        return rc;
-    }
-
-    if (strpbrk(data, "'\"&<>")) {
-        size_t num_writ = 0;
-        rc = XMLLogger_Encode(data, dummy, sizeof dummy, &num_writ);
-        if (rc == 0)
-        {   p = dummy; }
-    }
-
-    OUTMSG(("%s", p));
-
-    return rc;
-}
-
-static void reportClose1(const char* name) { OUTMSG(("</%s>\n", name)); }
-
-static rc_t reportImpl(int indent, bool open, bool close, bool eol,
-    const char* name, const char* data, int count, va_list args)
-{
-    rc_t rc = 0;
-    int i = 0;
-
-    if (count < 0) {
-        eol = false;
-        count = -count;
-    }
-
-    OUTMSG(("%*c", eol ? ( indent + 1 ) : 1, '<'));
-    OUTMSG(("%s%s", ( ! open && close ) ? "/" : "", name));
-
-    for (i = 0; i < count; ++i) {
-        const char* name = va_arg(args, const char*);
-        int format = va_arg(args, int);
-        union {
-            const char* s;
-            int i;
-            int64_t i64;
-            KTime* t;
-            rc_t rc;
-            const uint8_t* digest;
-            uint64_t u64;
-            ver_t vers;
-        } u;
-        OUTMSG((" %s=\"", name));
-        u.i64 = 0;
-        switch(format) {
-            case 'M':
-                u.digest = va_arg(args, const uint8_t*);
-                {
-                    int i = 0;
-                    for (i = 0; i < 16; ++i)
-                    {  OUTMSG(("%02x", *(u.digest + i))); }
-                }
-                break;
-            case 'l':
-                u.i64 = va_arg(args, int64_t);
-                OUTMSG(("%ld", u.i64));
-                break;
-            case 'u':
-                u.u64 = va_arg(args, uint64_t);
-                OUTMSG(("%lu", u.u64));
-                break;
-            case 'R':
-                u.rc = va_arg(args, rc_t);
-                OUTMSG(("%R", u.rc));
-                break;
-            case 'T':
-                u.t = va_arg(args, KTime*);
-                OUTMSG(("%lT", u.t));
-                break;
-            case 's':
-                u.s = va_arg(args, const char*);
-                OUTMSG(("%s", u.s));
-                break;
-            case 'V':
-                u.vers = va_arg(args, ver_t);
-                OUTMSG(("%V", u.vers));
-                break;
-            case 'd':
-            default:
-                u.i = va_arg(args, int);
-                OUTMSG(("%d", u.i));
-                break;
-        }
-        OUTMSG(("\""));
-    }
-
-    if (data) {
-        OUTMSG((">"));
-        rc = reportData1(data);
-        if (close)
-        {   OUTMSG(("</%s", name)); }
-    }
-    else if (open && close)
-    {   OUTMSG(("/")); }
-
-    OUTMSG((">"));
-    if (eol)
-    {   OUTMSG(("\n")); }
-
-    return rc;
-}
-
-static void CC report(uint32_t indent, const char* name, uint32_t count, ...) {
-     va_list args;
-     va_start(args, count);
-     reportImpl(indent, true, true, true, name, NULL, count, args);
-     va_end(args);
-}
-
-static
-void CC reportData(uint32_t indent, const char* name, const char* data, uint32_t count, ...)
-{
-    va_list args;
-    va_start(args, count);
-    reportImpl(indent, true, true, true, name, data, count, args);
-    va_end(args);
-}
-
-static void CC reportOpen(uint32_t indent, const char* name, uint32_t count, ...) {
-    va_list args;
-    va_start(args, count);
-    reportImpl(indent, true, false, true, name, NULL, count, args);
-    va_end(args);
-}
-
-static void CC reportClose(uint32_t indent, const char* name)
-{   reportImpl(indent, false, true, true, name, NULL, 0, NULL); }
-
-static void CC reportError(uint32_t indent, rc_t rc, const char* function) {
-    report(indent, "Error", 2,
-         "rc"      , 'R', rc,
-         "function", 's', function);
-}
-
-static void CC reportErrorStrImpl(uint32_t indent, rc_t rc,
-    const char* function, const char* name, const char* val, bool eol)
-{
-    int sign = eol ? 1 : -1;
-    if (rc || function) {
-        report(indent, "Error", sign * 3,
-            "rc", 'R', rc,
-            "function", 's', function,
-            name, 's', val);
-    }
-    else {
-        report(indent, "Error", sign,
-            name, 's', val);
-    }
-}
-
-static void CC reportErrorStr(uint32_t indent, rc_t rc, const char* function,
-    const char* name, const char* val)
-{   reportErrorStrImpl(indent, rc, function, name, val, true); }
-
-static void CC reportErrorStrInt(uint32_t indent, rc_t rc, const char* function,
-    const char* names, const char* vals, const char* namei, uint32_t vali)
-{
-    report(indent, "Error", 4,
-        "rc"      , 'd', rc,
-        "function", 's', function,
-        names     , 's', vals,
-        namei     , 'd', vali);
-}
-
-static void CC reportError3Str(uint32_t indent, rc_t rc, const char* function,
-    const char* name, const char* v1, const char* v2, const char* v3,
-    bool eol)
-{
-    char* buffer = malloc(strlen(v1) + strlen(v2) + strlen(v3) + 1);
-    if (buffer) {
-        sprintf(buffer, "%s%s%s", v1, v2, v3);
-        reportErrorStrImpl(indent, rc, function, name, buffer, eol);
-        free(buffer);
-    }
-}
-
-static ReportFuncs report_funcs =
-{
-    report,
-    reportData,
-    reportData1,
-    reportOpen,
-    reportOpen1,
-    reportClose,
-    reportClose1,
-    reportError,
-    reportErrorStr,
-    reportErrorStrImpl,
-    reportErrorStrInt,
-    reportError3Str
-};
-
-static rc_t ReportRun(int indent, rc_t rc_in) {
-    rc_t rc = 0;
-
-    const char tag[] = "Run";
-
-    Report* self = NULL;
-    ReportGet(&self);
-    if (self == NULL) {
-        return rc;
-    }
-
-    reportOpen(indent, tag, 0);
-
-    {
-        KTime kt;
-        const char tag[] = "Date";
-        reportOpen(indent + 1, tag, 0);
-        KTimeLocal(&kt, self->start);
-        report(indent + 2, "Start", 1, "value", 'T', &kt);
-        KTimeLocal(&kt, KTimeStamp());
-        report(indent + 2, "End"  , 1, "value", 'T', &kt);
-        reportClose(indent + 1, tag);
-    }
-
-    {
-        const char* name = "HOME";
-        const char* val = getenv(name);
-        if (val == NULL) {
-            name = "USERPROFILE";
-            val = getenv(name);
-        }
-        if (val == NULL)
-        {   name = val = "not found"; }
-        report(indent + 1, "Home", 2, "name", 's', name, "value", 's', val);
-    }
-
-    if ( self -> report_cwd != NULL )
-        rc = ( * self -> report_cwd ) ( & report_funcs, indent + 1 );
-
-    {
-        const char tag[] = "CommandLine";
-        int i = 0;
-        reportOpen(indent + 1, tag, 1, "argc", 'd', self->argc);
-        for (i = 0; i < self->argc; ++i) {
-            if (self->argv && self->argv[i]) {
-                report(indent + 2, "Arg", 2, "index", 'd', i,
-                    "value", 's', self->argv[i]);
-            }
-        }
-        reportClose(indent + 1, tag);
-    }
-
-    report(indent + 1, "Result", 1, "rc", 'R', rc_in);
-
-    reportClose(indent, tag);
-
-    return rc;
-}
-
-
-/* Silence
- *  tell report to be silent at exit
- *  useful especially in response to ^C
- */
-LIB_EXPORT void CC ReportSilence ( void )
-{
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-        self -> silence = true;
-}
-
-static rc_t reportToFileSet(const Report* self,
-    KWrtHandler* old_handler, const char* name, bool* to_file)
-{
-    rc_t rc = 0;
-    assert(self && to_file);
-    if (self->report_redirect) {
-        rc = (*self->report_redirect)(old_handler, name, to_file, false);
-    }
-    return rc;
-}
-
-static rc_t reportToStdErrSet(const Report* self, KWrtHandler* old_handler) {
-    rc_t rc = 0;
-    assert(self);
-    if (self->report_redirect) {
-        rc = (*self->report_redirect)(old_handler, NULL, NULL, false);
-    }
-    return rc;
-}
-
-/* Finalize:
- * If (rc_in != 0) then report environment information.
- * Then clean itself.
- */
-LIB_EXPORT rc_t CC ReportFinalize(rc_t rc_in) {
-    rc_t rc = 0;
-
-    const char* report_arg = NULL;
-
-    bool force =  rc_in != 0;
-
-    Report* self = NULL;
-    ReportGet(&self);
-
-    if (self == NULL) {
-        return rc;
-    }
-
-    if (GetRCTarget(rc_in) == rcArgv) {
-        force = false;
-    }
-    else {
-        bool wasDbOrTableSet = true;
-        if (self->report_vdb != NULL) {
-            (*self->report_vdb)(&report_funcs, 0, NULL, &wasDbOrTableSet);
-            if (!wasDbOrTableSet) {
-                force = false;
-            }
-        }
-    }
-
-    if (self->argv) {
-        int i = 0;
-        for (i = 1; i < self->argc; ++i) {
-            if (strcmp("--" OPTION_REPORT, self->argv[i]) == 0) {
-                if (i + 1 < self->argc) {
-                    report_arg = self->argv[i + 1];
-                }
-                break;
-            }
-        }
-    }
-
-    if (report_arg && strcmp("always", report_arg) == 0) {
-        force = true;
-        self -> silence = false;
-    }
-
-    if (!self -> silence) {
-        if (force) { 
-            if (report_arg && strcmp("never", report_arg) == 0) {
-                force = false;
-            }
-        }
-/*                              PLOGERR(klogErr, (klogErr,
-                               RC(rcApp, rcArgv, rcParsing, rcRange, rcInvalid),
-                               "report type '$(type)' is unrecognized",
-                               "type=%s", self->argv[i + 1]));*/
-
-        if (force) {
-            if (self->hasZombies) {
-                KOutHandlerSetStdErr();
-                if (self->object != NULL) {
-                    OUTMSG(("\nThe archive '%s' may be truncated: "
-                        "Please download it again.\n", self->object));
-                }
-                else {
-                    OUTMSG(("\nThe archive may be truncated: "
-                        "Please download it again.\n"));
-                }
-            }
-            else {
-                int indent = 0;
-                const char tag[] = "Report";
-
-                char path[PATH_MAX + 1] = "";
-                bool to_file = false;
-                KWrtHandler old_handler;
-                if (rc_in == 0) {
-                    reportToStdErrSet(self, &old_handler);
-                }
-                else {
-                    rc_t rc2 = 0;
-                    const char name[] = "ncbi_error_report.xml";
-                    const char* home = getenv("HOME");
-                    if (home == NULL) {
-                        home = getenv("USERPROFILE");
-                    }
-                    if (home) {
-                        size_t num_writ = 0;
-                        rc2 = string_printf
-                            (path, sizeof path, &num_writ, "%s/%s", home, name);
-                        assert(num_writ < sizeof path);
-                    }
-                    if (rc2 != 0 || home == NULL) {
-                        size_t num_writ = 0;
-                        rc2 = string_printf
-                            (path, sizeof path, &num_writ, "%s", name);
-                        assert(num_writ < sizeof path);
-                        assert(rc2 == 0);
-                    }
-                    reportToFileSet(self, &old_handler, path, &to_file);
-                }
-                if (!to_file && rc_in) {
-                    OUTMSG((
-"\n"
-"=============================================================\n"
-"An error occurred during processing.\n"
-"If the problem persists, you may consider sending the following XML document\n"
-"to 'sra at ncbi.nlm.nih.gov' for assistance.\n"
-"=============================================================\n\n"));
-                }
-
-                reportOpen(indent, tag, 0);
-
-                {
-                    rc_t rc2 = ReportRun(indent + 1, rc_in);
-                    if (rc == 0 && rc2 != 0)
-                    {   rc = rc2; }
-                }
-
-                if ( self -> report_config != NULL )
-                {
-                    rc_t rc2 = ( * self -> report_config ) ( & report_funcs, indent + 1);
-                    if (rc == 0 && rc2 != 0)
-                    {   rc = rc2; }
-                }
-
-                if (self -> report_vdb != NULL) {
-                    rc_t rc2 = (*self->report_vdb)
-                        (&report_funcs, indent + 1, self -> object, NULL);
-                    if (rc == 0 && rc2 != 0) {
-                        rc = rc2;
-                    }
-                }
-
-                if ( self -> report_software != NULL )
-                {
-                    const char *argv_0 = self -> argv ? self -> argv [ 0 ] : "";
-                    rc_t rc2 = ( * self -> report_software ) ( & report_funcs, indent + 1, argv_0, self -> date, self -> tool_ver );
-                    if (rc == 0 && rc2 != 0)
-                    {   rc = rc2; }
-                }
-
-                reportClose(indent, tag);
-                reportData1("\n");
-
-                if (to_file) {
-                    KOutHandlerSetStdErr();
-                    OUTMSG((
-"\n"
-"=============================================================\n"
-"An error occurred during processing.\n"
-"A report was generated into the file '%s'.\n"
-"If the problem persists, you may consider sending the file\n"
-"to 'sra at ncbi.nlm.nih.gov' for assistance.\n"
-"=============================================================\n\n", path));
-                }
-            }
-        }
-    }
-
-    ReportRelease();
-
-    return rc;
-}
-
-static
-char **copy_argv ( int argc, char **argv )
-{
-    char **argv2 = calloc ( argc, sizeof * argv2 );
-    if (argv2 != NULL) {
-        int i = 0;
-        for (i = 0; i < argc; ++i) {
-            argv2[i] = string_dup_measure(argv[i], NULL);
-        }
-    }
-    return argv2;
-}
-
-/* Init: initialize with common information */
-LIB_EXPORT void CC ReportInit(int argc, char* argv[], ver_t tool_version)
-{
-    static bool latch;
-    if ( ! latch )
-    {
-        /* comes pre-zeroed by runtime */
-        static Report self;
-
-        /* initialize with non-zero parameters */
-        self.start = KTimeStamp();
-        self.argc = argc;
-        self.argv = copy_argv ( argc, argv );
-        self.date = __DATE__;
-        self.tool_ver = tool_version;
-        self.silence = false;
-
-        /* export to the remainder of the source */
-        report_singleton = & self;
-
-        latch = true;
-    }
-}
-
-
-/* BuildDate
- *  set the build date of the tool
- *
- *  "date" [ IN ] - pre-processor __DATE__
- */
-LIB_EXPORT void CC ReportBuildDate ( const char *date )
-{
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-        self -> date = date;
-}
-
-
-/* InitCWD
- */
-LIB_EXPORT void CC ReportInitKFS (
-    rc_t ( CC * report_cwd ) ( const ReportFuncs *f, uint32_t indent ),
-    rc_t ( CC * report_redirect ) ( KWrtHandler* handler,
-        const char* filename, bool* to_file, bool finalize ) )
-{
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL ) {
-        self -> report_redirect = report_redirect;
-        self -> report_cwd = report_cwd;
-    }
-}
-
-
-/* InitConfig
- */
-LIB_EXPORT const char* CC ReportInitConfig ( rc_t ( CC * report ) ( const ReportFuncs *f, uint32_t indent ) )
-{
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-    {
-        self -> report_config = report;
-        return self -> argv [ 0 ];
-    }
-    return NULL;
-}
-
-/* InitVDB
- */
-LIB_EXPORT rc_t CC ReportInitVDB(
-    ReportObj *report_obj, ReportSoftware *report_software, Whack *whack)
-{
-    Report* self = NULL;
-    rc_t rc = ReportGet(&self);
-    if ( rc == 0 && self)
-    {
-        self -> report_vdb = report_obj;
-        self -> report_software = report_software;
-        self -> whack_vdb = whack;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC ReportResetObject(const char* path)
-{
-    Report* self = NULL;
-
-    if ( path == NULL )
-        path = "NULL";
-    else if ( path [ 0 ] == 0 )
-        path = "EMPTY";
-
-    ReportGet(&self);
-    if (self == NULL) {
-        return 0;
-    }
-
-    return ReportReplaceObjectPtr(self, path);
-}
-
-LIB_EXPORT void CC ReportRecordZombieFile(void)
-{
-    Report* self = NULL;
-    ReportGet(&self);
-    if (self == NULL)
-    {   return; }
-    self->hasZombies = true;
-}
diff --git a/libs/klib/status-rc-strings.c b/libs/klib/status-rc-strings.c
deleted file mode 100644
index f890b0d..0000000
--- a/libs/klib/status-rc-strings.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sysalloc.h>
-
-#define PASTE2(a,b) a##b
-#define STRINGIFY(a) #a
-#define RC_ENUM(type) const char * PASTE2(type,Strings)[] =
-#define RC_ENTRY(a,b) STRINGIFY(a),
-#define RC_VLAST(a)
-#define RC_LAST(a) "INVALID"
-
-#define RC_EMIT 0
-
-#include <klib/rc.h>
-
diff --git a/libs/klib/status-rc.c b/libs/klib/status-rc.c
deleted file mode 100644
index 73f7730..0000000
--- a/libs/klib/status-rc.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "writer-priv.h"
-#include <klib/writer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <os-native.h> /* for strchrnul on non-linux */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-
-size_t KWrtFmt_rc_t ( char * pout, size_t max, const char * fmt, rc_t rc_in )
-{
-    rc_t rc;
-    const char * str;
-    const char * mod_str;
-    const char * targ_str;
-    const char * ctx_str;
-    const char * obj_str;
-    const char * state_str;
-    size_t needed;
-    size_t mod_size;
-    size_t targ_size;
-    size_t ctx_size;
-    size_t obj_size;
-    size_t state_size;
-    enum RCModule mod;
-    enum RCTarget targ;
-    enum RCContext ctx;
-    int obj;
-    enum RCState state;
-
-    assert (pout);
-    assert (fmt);
-
-    if (*fmt == '#')
-        rc = RCExplain (rc_in, pout, max, &needed);
-
-    else if (rc_in != 0)
-    {
-        mod = GetRCModule (rc_in);
-        targ = GetRCTarget (rc_in);
-        ctx = GetRCContext (rc_in);
-        obj = GetRCObject (rc_in);
-        state = GetRCState (rc_in);
-
-        if ((mod < 0) || (mod > rcLastModule_v1_1))
-            mod = rcLastModule_v1_1;
-
-        if ((targ < 0) || (targ > rcLastTarget_v1_1))
-            targ = rcLastTarget_v1_1;
-
-        if ((ctx < 0) || (ctx > rcLastContext_v1_1))
-            ctx = rcLastContext_v1_1;
-
-        if ((obj < 0) || (obj > rcLastObject_v1_1))
-            obj = rcLastObject_v1_1;
-
-        if ((state < 0) || (state > rcLastState_v1_1))
-            state = rcLastState_v1_1;
-
-        mod_str = RCModuleStrings[mod];
-        str = strchrnul(mod_str, ' ');
-        mod_size = str - mod_str;
-
-        targ_str = RCTargetStrings[targ];
-        str = strchrnul(targ_str, ' ');
-        targ_size = str - targ_str;
-
-        ctx_str = RCContextStrings[ctx];
-        str = strchrnul(ctx_str, ' ');
-        ctx_size = str - ctx_str;
-
-/* object is tricky because it overlaps target */
-        if (obj == 0)
-        {
-            obj_str = RCObjectStrings[obj];
-            str = strchrnul(obj_str, ' ');
-            obj_size = str - obj_str;
-        }
-        else if (obj < rcLastTarget_v1_1)
-        {
-            obj_str = RCTargetStrings[obj];
-            str = strchrnul(obj_str, ' ');
-            obj_size = str - obj_str;
-        }
-        else
-        {
-            obj -= (rcLastTarget_v1_1-1);
-            obj_str = RCObjectStrings[obj];
-            str = strchrnul(obj_str, ' ');
-            obj_size = str - obj_str;
-        }
-
-        state_str = RCStateStrings[state];
-        str = strchrnul(state_str, ' ');
-        state_size = str - state_str;
-
-#if _DEBUGGING
-        rc = string_printf (pout, max, & needed, "RC(%s:%u:%s %*s,%*s,%*s,%*s,%*s)", 
-                            GetRCFilename(), GetRCLineno(), GetRCFunction(),
-                           (uint32_t)mod_size, mod_str,
-                           (uint32_t)targ_size, targ_str,
-                           (uint32_t)ctx_size, ctx_str,
-                           (uint32_t)obj_size, obj_str,
-                           (uint32_t)state_size, state_str);
-#else
-        rc = string_printf (pout, max, & needed, "RC(%*s,%*s,%*s,%*s,%*s)", 
-                           (uint32_t)mod_size, mod_str,
-                           (uint32_t)targ_size, targ_str,
-                           (uint32_t)ctx_size, ctx_str,
-                           (uint32_t)obj_size, obj_str,
-                           (uint32_t)state_size, state_str);
-#endif
-    }
-    else
-    {
-        state = GetRCState (rc_in);
-        state_str = RCStateStrings[state];
-        str = strchrnul(state_str, ' ');
-        state_size = str - state_str;
-        rc = string_printf (pout, max, & needed, "RC(%*s)",
-                           (uint32_t)state_size, state_str);
-    }
-
-    return rc != 0 ? 0 : needed;
-}
diff --git a/libs/klib/status.c b/libs/klib/status.c
deleted file mode 100644
index e54b6b9..0000000
--- a/libs/klib/status.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include <klib/extern.h>
-#include <klib/status.h>
-#include "writer-priv.h"
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <va_copy.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-static KStsLevel G_sts_level = 0;
-
-static KWrtHandler G_sts_handler;
-static KWrtHandler G_sts_lib_handler;
-
-static KFmtHandler G_sts_formatter;
-static KStsFmtFlags G_sts_formatter_flags;
-static KFmtHandler G_sts_lib_formatter;
-static KStsFmtFlags G_sts_lib_formatter_flags;
-
-static
-rc_t CC KStsDefaultFormatter( void* self, KWrtHandler* writer,
-                              size_t argc, const wrt_nvp_t args[],
-                              size_t envc, const wrt_nvp_t envs[] )
-{
-    rc_t rc = 0;
-    size_t num_writ, nsize;
-    uint32_t mlen;
-    char buffer[8192], *nbuffer;
-    const char* msg, *mend;
-
-    /* if writer is null than silence */
-    if( writer == NULL || writer->writer == NULL ) {
-        return rc;
-    }
-    msg = wrt_nvp_find_value(envc, envs, "message");
-    if( msg != NULL ) {
-        mend = msg + strlen(msg);
-        /* strip trailing newlines */
-        while( mend != msg && (*mend == '\n' || *mend == '\r') ) {
-            --mend;
-        }
-        mlen = ( uint32_t ) ( mend - msg );
-    } else {
-        mlen = 0;
-    }
-
-    nbuffer = buffer;
-    nsize = sizeof(buffer);
-    do {
-        rc = string_printf(nbuffer, nsize, & num_writ, "%s %s.%s: %.*s\n",
-                                 wrt_nvp_find_value(envc, envs, "timestamp"),
-                                 wrt_nvp_find_value(envc, envs, "app"),
-                                 wrt_nvp_find_value(envc, envs, "version"),
-                                 ( uint32_t ) mlen, msg);
-        if( num_writ > nsize ) {
-            assert ( nbuffer == buffer );
-            nbuffer = malloc(nsize = num_writ + 2);
-            if( nbuffer == NULL ) {
-                rc = RC(rcRuntime, rcLog, rcLogging, rcMemory, rcExhausted);
-                break;
-            }
-            continue;
-        }
-        /* replace newlines with spaces, excluding last one */
-        for(nsize = 0; nsize < num_writ - 1; nsize++) {
-            if( nbuffer[nsize] == '\n' || nbuffer[nsize] == '\r' ) {
-                nbuffer[nsize] = ' ';
-            }
-        }
-        break;
-    } while(true);
-    if( rc == 0 ) {
-        rc = LogFlush(writer, nbuffer, num_writ);
-    }
-    if( nbuffer != buffer ) {
-        free(nbuffer);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KStsInit ( void )
-{
-    rc_t rc;
-    
-    G_sts_level = 0;
-    rc = KStsHandlerSetStdOut();
-
-    if (rc == 0)
-        rc = KStsLibHandlerSet(NULL, NULL);
-
-    if (rc == 0)
-        rc = KStsFmtHandlerSetDefault();
-
-    if (rc == 0)
-        rc = KStsLibFmtHandlerSetDefault();
-
-    return rc;
-}
-
-static
-rc_t CC sts_print(KFmtHandler* formatter, const KStsFmtFlags flags, KWrtHandler* writer, const char* msg, va_list args)
-{
-    rc_t rc = 0;
-    char* nbuffer;
-    size_t num_writ, remaining;
-
-    uint32_t envc = 0;
-    wrt_nvp_t envs[5];
-    char ebuffer[2048];
-    char mbuffer[2048];
-    KFmtWriter fmtwrt;
-
-    assert(formatter != NULL);
-    assert(writer != NULL);
-
-    fmtwrt = formatter->formatter;
-    if( fmtwrt == NULL ) {
-        fmtwrt = KStsDefaultFormatter;
-    }
-    if( fmtwrt == KStsDefaultFormatter && writer->writer == NULL ) {
-        /* default formatting with NULL writer -> silence */
-        return rc;
-    }
-    nbuffer = (char*)ebuffer;
-    remaining = sizeof(ebuffer);
-    do {
-#define FIX_UP() if(rc){break;} remaining -= num_writ; nbuffer += num_writ
-        if( flags & (kstsFmtTimestamp | kstsFmtLocalTimestamp) ) {
-            if( flags & kstsFmtLocalTimestamp ) {
-                rc = LogSimpleTimestamp(nbuffer, remaining, &num_writ);
-            } else {
-                rc = LogTimestamp(nbuffer, remaining, &num_writ);
-            }
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "timestamp";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & kstsFmtPid ) {
-            rc = LogPID(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "pid";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & kstsFmtAppName ) {
-            rc = LogAppName(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "app";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-        if( flags & kstsFmtAppVersion ) {
-            rc = LogAppVersion(nbuffer, remaining, &num_writ);
-            nbuffer[num_writ++] = '\0';
-            envs[envc].name = "version";
-            envs[envc++].value = nbuffer;
-            FIX_UP();
-        }
-#undef FIX_UP
-    } while(false);
-    /* env must have one spare element for message added text below */
-    if( rc == 0 && envc >= (sizeof(envs)/sizeof(envs[0])) ) {
-        rc = RC(rcRuntime, rcLog, rcLogging, rcTable, rcInsufficient);
-    }
-    nbuffer = (char*)mbuffer;
-    remaining = sizeof(mbuffer);
-
-    if( rc == 0 ) {
-        if( flags & kstsFmtMessage ) {
-            if( msg == NULL || msg[0] == '\0' ) {
-                msg = "empty status message";
-            }
-            do {
-                va_list args_copy;
-                va_copy(args_copy, args);
-                rc = string_vprintf(nbuffer, remaining, &num_writ, msg, args_copy);
-                va_end(args_copy);
-                if( num_writ > remaining ) {
-                    if(nbuffer != mbuffer) {
-                        free(nbuffer);
-                    }
-                    nbuffer = malloc(remaining = num_writ);
-                    if( nbuffer == NULL ) {
-                        rc = RC(rcRuntime, rcLog, rcLogging, rcMemory, rcExhausted);
-                    }
-                } else {
-                    if( rc == 0 ) {
-                        envs[envc].name = "message";
-                        envs[envc++].value = nbuffer;
-                    }
-                    break;
-                }
-            } while( rc == 0 );
-        }
-    }
-    if( rc != 0 ) {
-        /* print reason for failure */
-        rc = string_printf((char*)mbuffer, sizeof(mbuffer), NULL, "status failure: %R in '%s'", rc, msg);
-        envs[envc].name = "message";
-        envs[envc++].value = mbuffer;
-    }
-    wrt_nvp_sort(envc, envs);
-    rc = fmtwrt(formatter->data, writer, 0, NULL, envc, envs);
-    if(nbuffer != mbuffer) {
-        free(nbuffer);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KStsMsg(const char* msg, ...)
-{
-    rc_t rc;
-    va_list args;
-
-    va_start(args, msg);
-    rc = sts_print(KStsFmtHandlerGet(), G_sts_formatter_flags, KStsHandlerGet(), msg, args);
-    va_end(args);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KStsLibMsg(const char* msg, ...)
-{
-    rc_t rc;
-    va_list args;
-
-    va_start(args, msg);
-    rc = sts_print(KStsLibFmtHandlerGet(), G_sts_lib_formatter_flags, KStsLibHandlerGet(), msg, args);
-    va_end(args);
-    return rc;
-}
-
-LIB_EXPORT KStsLevel CC KStsLevelGet(void)
-{
-    return G_sts_level;
-}
-
-LIB_EXPORT void CC KStsLevelSet(KStsLevel lvl)
-{
-    G_sts_level = lvl;
-}
-
-LIB_EXPORT void CC KStsLevelAdjust(int32_t adjust)
-{
-    int32_t l = KStsLevelGet();
-    l += adjust;
-    KStsLevelSet( l < 0 ? 0 : l);
-}
-
-LIB_EXPORT rc_t CC KStsHandlerSetStdOut ( void )
-{
-    return KStsHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdOut );
-}
-
-LIB_EXPORT rc_t CC KStsLibHandlerSetStdOut ( void )
-{
-    return KStsLibHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdOut );
-}
-
-LIB_EXPORT rc_t CC KStsHandlerSetStdErr ( void )
-{
-    return KStsHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdErr );
-}
-
-LIB_EXPORT rc_t CC KStsLibHandlerSetStdErr ( void )
-{
-    return KStsLibHandlerSet( KWrt_DefaultWriter, KWrt_DefaultWriterDataStdErr );
-}
-
-LIB_EXPORT rc_t CC KStsHandlerSet ( KWrtWriter writer, void * writer_data )
-{
-    G_sts_handler.writer = writer;
-    G_sts_handler.data = writer_data;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KStsLibHandlerSet ( KWrtWriter writer, void * writer_data )
-{
-    G_sts_lib_handler.writer = writer;
-    G_sts_lib_handler.data = writer_data;
-    return 0;
-}
-
-LIB_EXPORT void * CC KStsDataGet ( void )
-{
-    return ( KStsHandlerGet()->data );
-}
-
-LIB_EXPORT void * CC KStsLibDataGet ( void )
-{
-    return ( KStsLibHandlerGet()->data );
-}
-
-LIB_EXPORT KWrtWriter CC KStsWriterGet ( void )
-{
-    return ( KStsHandlerGet()->writer );
-}
-
-LIB_EXPORT KWrtWriter CC KStsLibWriterGet ( void )
-{
-    return ( KStsLibHandlerGet()->writer );
-}
-
-LIB_EXPORT KWrtHandler * CC KStsHandlerGet ( void )
-{
-    return ( &G_sts_handler );
-}
-
-LIB_EXPORT KWrtHandler * CC KStsLibHandlerGet ( void )
-{
-    return ( &G_sts_lib_handler );
-}
-
-static const uint32_t sts_dflt_opt = kstsFmtTimestamp | kstsFmtPid |
-                                     kstsFmtMessage | kstsFmtAppName | kstsFmtAppVersion;
-
-LIB_EXPORT rc_t CC KStsFmtHandlerSetDefault ( void )
-{
-    rc_t rc = KStsFmtHandlerSet(KStsDefaultFormatter, 0, NULL);
-    if( rc == 0 ) {
-        G_sts_formatter_flags = sts_dflt_opt;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KStsLibFmtHandlerSetDefault ( void )
-{
-    rc_t rc = KStsLibFmtHandlerSet(KStsDefaultFormatter, 0, NULL);
-    if( rc == 0 ) {
-        G_sts_lib_formatter_flags = sts_dflt_opt;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KStsFmtFlagsSet ( KStsFmtFlags flags )
-{
-    G_sts_formatter_flags |= flags;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KStsLibFmtFlagsSet ( KStsFmtFlags flags )
-{
-    G_sts_lib_formatter_flags |= flags;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KStsFmtHandlerSet ( KFmtWriter formatter, KStsFmtFlags flags, void* data )
-{
-    if( formatter == NULL ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcFunction, rcNull);
-    }
-    G_sts_formatter.formatter = formatter;
-    G_sts_formatter.data = data;
-    KStsFmtFlagsSet(flags);
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KStsLibFmtHandlerSet ( KFmtWriter formatter, KStsFmtFlags flags, void* data )
-{
-    if( formatter == NULL ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcFunction, rcNull);
-    }
-    G_sts_lib_formatter.formatter = formatter;
-    G_sts_lib_formatter.data = data;
-    KStsLibFmtFlagsSet(flags);
-    return 0;
-}
-
-LIB_EXPORT void * CC KStsFmtDataGet ( void )
-{
-    return ( KStsFmtHandlerGet()->data );
-}
-
-LIB_EXPORT void * CC KStsLibFmtDataGet ( void )
-{
-    return ( KStsFmtHandlerGet()->data );
-}
-
-LIB_EXPORT KFmtWriter CC KStsFmtWriterGet ( void )
-{
-    return ( KStsFmtHandlerGet()->formatter ? KStsFmtHandlerGet()->formatter : KStsDefaultFormatter);
-}
-
-LIB_EXPORT KFmtWriter CC KStsLibFmtWriterGet ( void )
-{
-    return ( KStsLibFmtHandlerGet()->formatter ? KStsLibFmtHandlerGet()->formatter : KStsDefaultFormatter);
-}
-
-LIB_EXPORT KFmtHandler * CC KStsFmtHandlerGet ( void )
-{
-    return ( &G_sts_formatter );
-}
-
-LIB_EXPORT KFmtHandler * CC KStsLibFmtHandlerGet ( void )
-{
-    return ( &G_sts_lib_formatter );
-}
-
-LIB_EXPORT KStsFmtFlags CC KStsFmtFlagsGet ( void )
-{
-    return G_sts_formatter_flags;
-}
-
-LIB_EXPORT KStsFmtFlags CC KStsLibFmtFlagsGet ( void )
-{
-    return G_sts_lib_formatter_flags;
-}
diff --git a/libs/klib/symtab.c b/libs/klib/symtab.c
deleted file mode 100644
index d30df64..0000000
--- a/libs/klib/symtab.c
+++ /dev/null
@@ -1,736 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/symtab.h>
-#include <klib/symbol.h>
-#include <klib/token.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KSymbol
- *  a name to object mapping
- */
-
-
-/* Init
- *  initialize a symbol without allocating space
- *
- *  "self" [ IN ] - where to initialize
- *
- *  "name" [ IN ] - symbol name
- *
- *  "type" [ IN ] - symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - optional object mapping
- *
- */
-KLIB_EXTERN rc_t CC KSymbolInit ( KSymbol * self, 
-    const String * name, uint32_t type, const void * obj)
-{
-    rc_t rc;
-
-    if ( name == NULL )
-        rc = RC ( rcText, rcString, rcConstructing, rcName, rcNull );
-    else if ( name -> len == 0 )
-        rc = RC ( rcText, rcString, rcConstructing, rcName, rcEmpty );
-    else
-    {
-        string_copy ( ( char* ) ( self + 1 ), name -> size + 1, name -> addr, name -> size );
-        StringInit ( & self -> name, ( char* ) ( self + 1 ), name -> size, name -> len );
-        self -> u . obj = obj;
-        self -> dad = NULL;
-        self -> type = type;
-
-        return 0;
-    }
-    return rc;
-}
-
-/* Make
- *  create a symbol
- *
- *  "sym" [ OUT ] - return parameter for symbol
- *
- *  "name" [ IN ] - symbol name
- *
- *  "type" [ IN ] - symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - optional object mapping
- */
-LIB_EXPORT rc_t CC KSymbolMake ( KSymbol **symp,
-    const String *name, uint32_t type, const void *obj )
-{
-    rc_t rc;
-    if ( symp == NULL )
-        rc = RC ( rcText, rcString, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KSymbol *sym = malloc ( sizeof *sym + name -> size + 1 );
-        if ( sym == NULL )
-            rc = RC ( rcText, rcString, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSymbolInit (sym, name, type, obj);
-            if (rc == 0)
-            {
-                * symp = sym;
-                return 0;
-            }
-            free (sym);
-        }
-        * symp = NULL;
-    }
-    return rc;
-}
-
-/* Whack
- */
-LIB_EXPORT void CC KSymbolWhack ( BSTNode *n, void *ignore )
-{
-    KSymbol *self = ( KSymbol* ) n;
-
-    if ( self -> type == eNamespace )
-        BSTreeWhack ( & self -> u . scope, KSymbolWhack, ignore );
-
-    free ( self );
-}
-
-/* Cmp
- */
-LIB_EXPORT int CC KSymbolCmp ( const void *item, const BSTNode *n )
-{
-    const String *a = item;
-    const KSymbol *b = ( const KSymbol* ) n;
-
-    return StringOrderNoNullCheck ( a, & b -> name );
-}
-
-/* Sort
- */
-LIB_EXPORT int CC KSymbolSort ( const BSTNode *item, const BSTNode *n )
-{
-    const KSymbol *a = ( const KSymbol* ) item;
-    const KSymbol *b = ( const KSymbol* ) n;
-
-    return StringOrderNoNullCheck ( & a -> name, & b -> name );
-}
-
-
-
-/*--------------------------------------------------------------------------
- * KSymTable
- *  scoped stack of BSTree
- */
-
-
-/* Init
- *  create an empty symbol table
- *
- *  "intrinsic" [ IN ] - intrinsic scope
- */
-LIB_EXPORT rc_t CC KSymTableInit ( KSymTable *self, const BSTree *intrinsic )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcText, rcTree, rcConstructing, rcSelf, rcNull );
-    else
-    {
-        self -> ns = NULL;
-        VectorInit ( & self -> stack, 0, 16 );
-
-        if ( intrinsic == NULL )
-        {
-            self -> intrinsic = 0;
-            return 0;
-        }
-
-        self -> intrinsic = 1;
-        rc = VectorAppend ( & self -> stack, NULL, intrinsic );
-    }
-
-    return rc;
-}
-
-/* Whack
- *  must be called to clean up stack
- */
-#ifndef KSymTableWhack
-LIB_EXPORT void CC KSymTableWhack ( KSymTable *self )
-{
-    if ( self != NULL )
-        VectorWhack ( & self -> stack, NULL, NULL );
-}
-#endif
-
-
-/* PushScope
- *  pushes a tree onto stack
- *  fails if count == depth
- *  otherwise, pushes scope into top of stack
- *
- *  "scope" [ IN ] - current top scope
- */
-LIB_EXPORT rc_t CC KSymTablePushScope ( const KSymTable *cself, BSTree *scope )
-{
-    KSymTable *self = ( KSymTable* ) cself;
-    assert ( self != NULL );
-    assert ( scope != NULL );
-    return VectorAppend ( & self -> stack, NULL, scope );
-}
-
-
-/* PopScope
- *  removes a tree from stack
- *  noop if count < self->intrinsic,
- *  because stack bottom will be intrinsic scope
- */
-LIB_EXPORT void CC KSymTablePopScope ( const KSymTable *cself )
-{
-    if ( cself != NULL && cself -> stack . len > cself -> intrinsic )
-        -- ( ( KSymTable* ) cself ) -> stack . len;
-}
-
-
-/* PushNamespace
- *  pushes a namespace scope onto stack
- */
-LIB_EXPORT rc_t CC KSymTablePushNamespace ( const KSymTable *cself, KSymbol *ns )
-{
-    rc_t rc;
-    KSymTable *self = ( KSymTable* ) cself;
-    assert ( ns != NULL && ns -> type == eNamespace );
-    rc = KSymTablePushScope ( self, & ns -> u . scope );
-    if ( rc == 0 )
-        self -> ns = ns;
-    return rc;
-}
-
-
-/* PopNamespace
- */
-LIB_EXPORT void CC KSymTablePopNamespace ( const KSymTable *cself )
-{
-    KSymTable *self = ( KSymTable* ) cself;
-    assert ( self != NULL );
-    if ( self -> ns != NULL )
-    {
-        KSymTablePopScope ( self );
-        self -> ns = self -> ns -> dad;
-    }
-}
-
-
-/* CreateNamespace
- *  given a name, make it into a namespace,
- *
- *  "name" [ IN ] - name of namespace. if being created within
- *  another namespace, it will be linked to the parent.
- */
-LIB_EXPORT rc_t CC KSymTableCreateNamespace ( KSymTable *self, KSymbol **nsp, const String *name )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-    assert ( nsp != NULL );
-    assert ( name != NULL );
-
-    if ( name -> len == 0 )
-        rc = RC ( rcText, rcTree, rcInserting, rcString, rcEmpty );
-    else if ( VectorLength ( & self -> stack ) <= self -> intrinsic )
-        rc = RC ( rcText, rcTree, rcInserting, rcTree, rcReadonly );
-    else
-    {
-        uint32_t len = VectorLength ( & self -> stack );
-        BSTree *scope = VectorGet ( & self -> stack, len - 1 );
-        KSymbol *ns = ( KSymbol* ) BSTreeFind ( scope, name, KSymbolCmp );
-        if ( ns != NULL )
-        {
-            if ( ns -> type == eNamespace )
-            {
-                * nsp = ns;
-                return 0;
-            }
-
-            rc = RC ( rcText, rcTree, rcInserting, rcName, rcExists );
-        }
-        else
-        {
-            ns = malloc ( sizeof *ns + name -> size + 1 );
-            if ( ns == NULL )
-                rc = RC ( rcText, rcTree, rcInserting, rcMemory, rcExhausted );
-            else
-            {
-                /* initialize namespace */
-                string_copy ( ( char* ) ( ns + 1 ), name -> size + 1, name -> addr, name -> size );
-                StringInit ( & ns -> name, ( char* ) ( ns + 1 ), name -> size, name -> len );
-                BSTreeInit ( & ns -> u . scope );
-                ns -> dad = self -> ns;
-                ns -> type = eNamespace;
-
-                /* now insert into parent scope */
-                assert ( scope != NULL );
-                BSTreeInsert ( scope, & ns -> n, KSymbolSort );
-
-                /* done */
-                * nsp = ns;
-                return 0;
-            }
-        }
-    }
-
-    * nsp = NULL;
-
-    return rc;
-}
-
-
-/* CreateSymbol
- *  given a name, create an object reference
- *
- *  "symp" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly created symbol, which is entered into the top scope
- *  and only returned for convenience.
- *
- *  "name" [ IN ] - symbol name. if being created within a
- *  namespace, the symbol will be linked to the parent.
- *
- *  "id" [ IN ] - if the symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - if the object has been created
- *  at the point of symbol definition, it may be provided.
- */
-LIB_EXPORT rc_t CC KSymTableCreateSymbol ( KSymTable *self, KSymbol **symp,
-    const String *name, uint32_t id, const void *obj )
-{
-    rc_t rc;
-    KSymbol *sym = NULL;
-
-    if ( self == NULL )
-        rc = RC ( rcText, rcTree, rcInserting, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcText, rcTree, rcInserting, rcString, rcNull );
-    else if ( name -> len == 0 )
-        rc = RC ( rcText, rcTree, rcInserting, rcString, rcEmpty );
-    else if ( VectorLength ( & self -> stack ) <= self -> intrinsic )
-        rc = RC ( rcText, rcTree, rcInserting, rcTree, rcReadonly );
-    else
-    {
-        sym = malloc ( sizeof *sym + name -> size + 1 );
-        if ( sym == NULL )
-            rc = RC ( rcText, rcTree, rcInserting, rcMemory, rcExhausted );
-        else
-        {
-            KSymbol *exists;
-            uint32_t len = VectorLength ( & self -> stack );
-            BSTree *scope = VectorGet ( & self -> stack, len - 1 );
-
-            /* initialize symbol */
-            string_copy ( ( char* ) ( sym + 1 ), name -> size + 1, name -> addr, name -> size );
-            StringInit ( & sym -> name, ( char* ) ( sym + 1 ), name -> size, name -> len );
-            sym -> u . obj = obj;
-            sym -> dad = self -> ns;
-            sym -> type = id;
-
-            assert ( scope != NULL );
-            rc = BSTreeInsertUnique ( scope, & sym -> n, ( BSTNode** ) & exists, KSymbolSort );
-            if ( rc != 0 )
-            {
-                free ( sym );
-                sym = NULL;
-            }
-        }
-    }
-
-    if ( symp != NULL )
-        * symp = sym;
-
-    return rc;
-}
-
-
-/* DupSymbol
- *  given a symbol, create a duplicate
- *
- *  "dup" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly created symbol, which is entered into the top scope
- *  and only returned for convenience.
- *
- *  "sym" [ IN ] - symbol to copy.
- *
- *  "id" [ IN ] - if the symbol type
- *
- *  "obj" [ IN, NULL OKAY ] - if the object has been created
- *  at the point of symbol definition, it may be provided.
- */
-static
-rc_t CC KSymTableDupNamespaces ( KSymTable *self, const KSymbol *ns )
-{
-    rc_t rc;
-
-    if ( ns == NULL )
-        return 0;
-
-    rc = KSymTableDupNamespaces ( self, ns -> dad );
-    if ( rc == 0 )
-    {
-        KSymbol *dup;
-        rc = KSymTableCreateNamespace ( self, & dup, & ns -> name );
-        if ( rc == 0 )
-            rc = KSymTablePushNamespace ( self, dup );
-    }
-
-    return rc;
-}
-
-static
-void CC KSymTablePopDupNamespaces ( KSymTable *self, const KSymbol *ns )
-{
-    for ( ; ns != NULL; ns = ns -> dad )
-        KSymTablePopNamespace ( self );
-}
-
-LIB_EXPORT rc_t CC KSymTableDupSymbol ( KSymTable *self, struct KSymbol **dupp,
-    const KSymbol *sym, uint32_t id, const void *obj )
-{
-    rc_t rc;
-    KSymbol *dup = NULL;
-
-    if ( self == NULL )
-        rc = RC ( rcText, rcTree, rcInserting, rcSelf, rcNull );
-    else if ( sym == NULL )
-        rc = RC ( rcText, rcTree, rcInserting, rcString, rcNull );
-    else if ( VectorLength ( & self -> stack ) <= self -> intrinsic )
-        rc = RC ( rcText, rcTree, rcInserting, rcTree, rcReadonly );
-    else
-    {
-        KSymbol *old = self -> ns;
-        rc = KSymTableDupNamespaces ( self, sym -> dad );
-        if ( rc == 0 )
-        {
-            rc = KSymTableCreateSymbol ( self, & dup, & sym -> name, id, obj );
-            KSymTablePopDupNamespaces ( self, dup -> dad );
-        }
-        self -> ns = old;
-    }
-
-    if ( dupp != NULL )
-        * dupp = dup;
-
-    return rc;
-}
-
-
-/* RemoveSymbol
- *  removes symbol from table
- *
- *  "sym" [ IN ] - symbol to be removed
- */
-LIB_EXPORT rc_t CC KSymTableRemoveSymbol ( KSymTable *self, const KSymbol *sym )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcText, rcTree, rcRemoving, rcSelf, rcNull );
-    else if ( sym == NULL )
-        rc = RC ( rcText, rcTree, rcRemoving, rcParam, rcNull );
-    else
-    {
-        uint32_t i;
-        BSTree *scope;
-
-        /* if the symbol lives within a namespace,
-           it won't be found directly. */
-        if ( sym -> dad != NULL )
-        {
-            KSymbol *ns = sym -> dad;
-            if ( ! BSTreeUnlink ( & ns -> u . scope, ( BSTNode* ) & sym -> n ) )
-                return RC ( rcText, rcTree, rcRemoving, rcNode, rcCorrupt );
-
-            /* if the namespace is not now empty, we're done */
-            if ( ns -> u . scope . root != NULL )
-                return 0;
-
-            /* remove and delete the namespace */
-            rc = KSymTableRemoveSymbol ( self, ns );
-            if ( rc == 0 )
-                KSymbolWhack ( & ns -> n, NULL );
-            return rc;
-        }
-
-        /* walk the stack trying to find owning scope */
-        for ( i = VectorLength ( & self -> stack ); i > self -> intrinsic; )
-        {
-            scope = VectorGet ( & self -> stack, -- i );
-            if ( BSTreeUnlink ( scope, ( BSTNode* ) & sym -> n ) )
-                return 0;
-        }
-
-        /* can't remove it from intrinsic table,
-           so see if it wasn't found or if it's intrinsic */
-        scope = VectorGet ( & self -> stack, 0 );
-        if ( scope != NULL && BSTreeFind ( scope, & sym -> name, KSymbolCmp ) != NULL )
-            rc = RC ( rcText, rcTree, rcRemoving, rcTree, rcReadonly );
-        else
-            rc = RC ( rcText, rcTree, rcRemoving, rcNode, rcNotFound );
-    }
-
-    return rc;
-}
-
-
-/* Find
- *  finds a symbol within the scope stack
- */
-LIB_EXPORT KSymbol * CC KSymTableFind ( const KSymTable *self, const String *name )
-{
-    if ( self != NULL && name != NULL && name -> len != 0 )
-    {
-        uint32_t i;
-
-        /* this is a pretty bad way to do things, but
-           we're a fairly low frequency symbol table... */
-        for ( i = VectorLength ( & self -> stack ); i > 0; )
-        {
-            BSTree *scope = VectorGet ( & self -> stack, -- i );
-            KSymbol *sym = ( KSymbol* )
-                BSTreeFind ( scope, name, KSymbolCmp );
-            if ( sym != NULL )
-                return sym;
-        }
-    }
-
-    return NULL;
-}
-
-static
-KSymbol * CC KSymTableDeepFindSymbol ( const KSymTable *self, const KSymbol *sym, uint32_t *level )
-{
-    uint32_t i;
-    KSymbol *found;
-
-    if ( sym -> dad != NULL )
-    {
-        found = KSymTableDeepFindSymbol ( self, sym -> dad, level );
-        if ( found == NULL || found -> type != eNamespace )
-            return NULL;
-        return ( KSymbol* ) BSTreeFind ( & found -> u . scope,
-            & sym -> name, KSymbolCmp );
-    }
-
-    for ( i = * level; i > 0; )
-    {
-        BSTree *scope = VectorGet ( & self -> stack, -- i );
-        found = ( KSymbol* ) BSTreeFind ( scope, & sym -> name, KSymbolCmp );
-        if ( found != NULL )
-        {
-            * level = i;
-            return found;
-        }
-    }
-
-    * level = 0;
-    return NULL;
-}
-
-LIB_EXPORT KSymbol * CC KSymTableFindSymbol ( const KSymTable *self, const KSymbol *sym )
-{
-    if ( self != NULL && sym != NULL )
-    {
-        uint32_t i;
-
-        /* the simple symbols are easy */
-        if ( sym -> dad == NULL )
-            return KSymTableFind ( self, & sym -> name );
-
-        /* namespaces are harder...
-
-           we're going to use recursion to find the root namespace
-           ( although it's unlikely to go beyond a practical limit )
-           and once the root name symbol is found, we need to step
-           backwards through the symtab scopes until we find the root.
-
-           the problem is that if that root doesn't produce a hit for
-           the requested symbol, we still have to keep looking through
-           other scopes
-        */
-
-        for ( i = VectorLength ( & self -> stack ); i > 0; )
-        {
-            KSymbol *found = KSymTableDeepFindSymbol ( self, sym, & i );
-            if ( found != NULL )
-                return found;
-        }
-    }
-
-    return NULL;
-}
-
-
-/* FindIntrinsic
- *  find an intrinsic symbol
- */
-LIB_EXPORT KSymbol * CC KSymTableFindIntrinsic ( const KSymTable *self, const String *name )
-{
-    KSymbol *sym = NULL;
-
-    if ( self != NULL && name != NULL && name -> len != 0 )
-    {
-        uint32_t i;
-
-        for ( i = self -> intrinsic; i > 0; )
-        {
-            BSTree *scope = VectorGet ( & self -> stack, -- i );
-            if ( scope != NULL )
-            {
-                KSymbol *sym_ = ( KSymbol* )
-                    BSTreeFind ( scope, name, KSymbolCmp );
-                if ( sym_ != NULL )
-                    return sym_;
-            }
-        }
-    }
-
-    return sym;
-}
-
-
-/* FindGlobal
- *  find a symbol at global scope
- */
-LIB_EXPORT KSymbol * CC KSymTableFindGlobal ( const KSymTable *self, const String *name )
-{
-    KSymbol *sym = NULL;
-
-    if ( self != NULL && name != NULL && name -> len != 0 )
-    {
-        uint32_t i;
-
-        for ( i = self -> intrinsic + 1; i > 0; )
-        {
-            BSTree *scope = VectorGet ( & self -> stack, -- i );
-            if ( scope != NULL )
-            {
-                KSymbol *sym_ = ( KSymbol* )
-                    BSTreeFind ( scope, name, KSymbolCmp );
-                if ( sym_ != NULL )
-                    return sym_;
-            }
-        }
-    }
-
-    return sym;
-}
-
-
-/* FindShallow
- *  find a symbol in top scope
- */
-LIB_EXPORT KSymbol * CC KSymTableFindShallow ( const KSymTable *self, const String *name )
-{
-    KSymbol *sym = NULL;
-
-    if ( self != NULL && name != NULL && name -> len != 0 )
-    {
-        uint32_t len = VectorLength ( & self -> stack );
-        if ( len > 0 )
-        {
-            BSTree *scope = VectorGet ( & self -> stack, len - 1 );
-            if ( scope != NULL )
-            {
-                sym = ( KSymbol* )
-                    BSTreeFind ( scope, name, KSymbolCmp );
-            }
-        }
-    }
-
-    return sym;
-}
-
-
-/* FindNext
- *  given a symbol that was found in nearest scope
- *  find next symbol of the same simple name in
- *  farther scopes
- */
-LIB_EXPORT KSymbol * CC KSymTableFindNext ( const KSymTable *self, const KSymbol *sym, uint32_t *id )
-{
-    KSymbol *next = NULL;
-
-    uint32_t i = 0;
-    if ( id != NULL )
-    {
-        i = * id;
-        * id = 0;
-    }
-
-    if ( self != NULL && sym != NULL )
-    {
-        BSTree *scope;
-        uint32_t len = VectorLength ( & self -> stack );
-
-        /* if the previous scope was not given */
-        if ( i == 0 || i > len )
-        {
-            for ( i = len; i > 0; )
-            {
-                scope = VectorGet ( & self -> stack, -- i );
-                next = ( KSymbol* ) BSTreeFind ( scope, & sym -> name, KSymbolCmp );
-                if ( next == sym )
-                {
-                    ++ i;
-                    break;
-                }
-            }
-
-            /* bail if not found */
-            if ( i == 0 )
-                return NULL;
-        }
-
-        /* continue the search */
-        for ( -- i ; i > 0; )
-        {
-            scope = VectorGet ( & self -> stack, -- i );
-            next = ( KSymbol* ) BSTreeFind ( scope, & sym -> name, KSymbolCmp );
-            if ( next != NULL )
-            {
-                if ( id != NULL )
-                    * id = i + 1;
-                break;
-            }
-        }
-    }
-
-    return next;
-}
diff --git a/libs/klib/text.c b/libs/klib/text.c
deleted file mode 100644
index b811c45..0000000
--- a/libs/klib/text.c
+++ /dev/null
@@ -1,841 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <va_copy.h>
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * String
- *  pseudo-intrinsic string
- */
-
-/* StringCopy
- *  allocates a copy of a string
- */
-LIB_EXPORT rc_t CC StringCopy ( const String **cpy, const String *str )
-{
-    if ( cpy != NULL )
-    {
-        if ( str != NULL )
-        {
-            size_t size = str -> size;
-            String *s = malloc ( sizeof * s + str -> size + 1 );
-            if ( s != NULL )
-            {
-                char *addr = ( char* ) ( s + 1 );
-                StringInit ( s, addr, size, str -> len );
-                memcpy ( addr, str -> addr, size );
-                addr [ size ] = 0;
-                * cpy = s;
-                return 0;
-            }
-
-            * cpy = NULL;
-            return RC ( rcText, rcString, rcCopying, rcMemory, rcInsufficient );
-        }
-
-        * cpy = NULL;
-    }
-    return RC ( rcText, rcString, rcCopying, rcParam, rcNull );
-}
-
-/* StringConcat
- *  concatenate one string onto another
- */
-LIB_EXPORT rc_t CC StringConcat ( const String **cat, const String *a, const String *b )
-{
-    if ( cat != NULL )
-    {
-        if ( a != NULL && b != NULL )
-        {
-            size_t size = a -> size + b -> size;
-            String *s = malloc ( sizeof * s + size + 1 );
-            if ( s != NULL )
-            {
-                char *addr = ( char* ) ( s + 1 );
-                StringInit ( s, addr, size, a -> len + b -> len );
-                memcpy ( addr, a -> addr, a -> size );
-                memcpy ( & addr [ a -> size ], b -> addr, b -> size );
-                addr [ size ] = 0;
-                * cat = s;
-                return 0;
-            }
-
-            * cat = NULL;
-            return RC ( rcText, rcString, rcConcatenating, rcMemory, rcInsufficient );
-        }
-
-        * cat = NULL;
-    }
-    return RC ( rcText, rcString, rcConcatenating, rcParam, rcNull );
-}
-
-/* StringSubstr
- *  creates a substring of an existing one
- *  note that the substring is always a non-allocated copy
- *  and is dependent upon the lifetime of its source
- *
- *  returns "sub" if "idx" was valid
- *  or NULL otherwise
- *
- *  "len" may be 0 to indicate infinite length
- *  or may extend beyond end of source string.
- */
-LIB_EXPORT String * CC StringSubstr ( const String *str, String *sub,
-    uint32_t idx, uint32_t len )
-{
-    if ( str != NULL && sub != NULL && idx < str -> len )
-    {
-        const char *addr = string_idx ( str -> addr, str -> size, idx );
-        if ( addr != NULL )
-        {
-            sub -> size = str -> size - ( size_t ) ( addr - str -> addr );
-            sub -> len = str -> len - idx;
-            sub -> addr = addr;
-            if ( len > 0 && len < sub -> len )
-            {
-                const char *end = string_idx ( sub -> addr, sub -> size, len );
-                if ( end != NULL )
-                {
-                    sub -> size = ( size_t ) ( end - sub -> addr );
-                    sub -> len = len;
-                }
-            }
-            return sub;
-        }
-    }
-    return NULL;
-}
-
-/* StringHead
- *  access the first character
- *
- *  this is an efficient enough function to be included.
- *  the generic functions of accessing characters by index
- *  are apt to be extremely inefficient with UTF-8, and
- *  as such are not included.
- *
- *  returns EINVAL if the character is bad,
- *  or ENODATA if the string is empty
- */
-LIB_EXPORT rc_t CC StringHead ( const String *str, uint32_t *ch )
-{
-    rc_t rc;
-    if ( ch == NULL )
-        rc = RC ( rcText, rcString, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( str == NULL )
-            rc = RC ( rcText, rcString, rcAccessing, rcParam, rcNull );
-        else
-        {
-            if ( str -> len == 0 )
-                rc = RC ( rcText, rcString, rcAccessing, rcString, rcEmpty );
-            else
-            {
-                int ch_len = utf8_utf32 ( ch, str -> addr, str -> addr + str -> size );
-                if ( ch_len > 0 )
-                    return 0;
-
-                rc = RC ( rcText, rcString, rcAccessing, rcChar, rcInvalid );
-            }
-        }
-
-        * ch = 0;
-    }
-
-    return rc;
-}
-
-/* StringPopHead
- *  remove and return the first character
- *
- *  returns EINVAL if the character is bad,
- *  or ENODATA if the string is empty
- */
-LIB_EXPORT rc_t CC StringPopHead ( String *str, uint32_t *ch )
-{
-    rc_t rc;
-    if ( ch == NULL )
-        rc = RC ( rcText, rcChar, rcRemoving, rcParam, rcNull );
-    else
-    {
-        if ( str == NULL )
-            rc = RC ( rcText, rcChar, rcRemoving, rcParam, rcNull );
-        else
-        {
-            if ( str -> len == 0 )
-                rc = RC ( rcText, rcChar, rcRemoving, rcString, rcEmpty );
-            else
-            {
-                int ch_len = utf8_utf32 ( ch, str -> addr, str -> addr + str -> size );
-                if ( ch_len > 0 )
-                {
-                    str -> addr += ch_len;
-                    str -> size -= ch_len;
-                    str -> len -= 1;
-                    return 0;
-                }
-
-                rc = RC ( rcText, rcChar, rcRemoving, rcChar, rcInvalid );
-            }
-        }
-
-        * ch = 0;
-    }
-
-    return rc;
-}
-
-/* StringCompare
- *  compare strings for relative ordering
- */
-LIB_EXPORT int CC StringCompare ( const String *a, const String *b )
-{
-    int diff;
-    uint32_t len;
-
-    if ( a == b )
-        return 0;
-    if ( a == NULL )
-        return -1;
-    if ( b == NULL )
-        return 1;
-
-    len = a -> len;
-    if ( b -> len < len )
-        len = b -> len;
-
-    diff = string_cmp ( a -> addr, a -> size, b -> addr, b -> size, len );
-    if ( diff == 0 )
-        diff = ( int ) a -> len - ( int ) b -> len;
-    return diff;
-}
-
-/* StringCaseEqual
- *  compare strings for case-insensitive equality
- */
-LIB_EXPORT bool CC StringCaseEqual ( const String *a, const String *b )
-{
-    uint32_t len;
-
-    if ( a == b )
-        return true;
-    if ( a == NULL || b == NULL )
-        return false;
-
-    len = a -> len;
-    if ( b -> len != len )
-        return false;
-
-    return strcase_cmp ( a -> addr, a -> size, b -> addr, b -> size, len ) == 0;
-}
-
-/* StringCaseCompare
- *  compare strings for relative case-insensitive ordering
- */
-LIB_EXPORT int CC StringCaseCompare ( const String *a, const String *b )
-{
-    int diff;
-    uint32_t len;
-
-    if ( a == b )
-        return 0;
-    if ( a == NULL )
-        return -1;
-    if ( b == NULL )
-        return 1;
-
-    len = a -> len;
-    if ( b -> len < len )
-        len = b -> len;
-
-    diff = strcase_cmp ( a -> addr, a -> size, b -> addr, b -> size, len );
-    if ( diff == 0 )
-        diff = ( int ) a -> len - ( int ) b -> len;
-    return diff;
-}
-
-/* StringOrder
- *  compares strings as quickly as possible for
- *  deterministic ordering: first by length, then
- *  by binary (byte-wise) content.
- *
- *  performs more quickly than StringCompare for cases
- *  where only deterministic ordering is needed ( e.g. symbol table ).
- */
-LIB_EXPORT int CC StringOrder ( const String *a, const String *b )
-{
-    if ( a == b )
-        return 0;
-    if ( a == NULL )
-        return -1;
-    if ( b == NULL )
-        return 1;
-
-    if ( a -> size < b -> size )
-        return -1;
-    if ( a -> size > b -> size )
-        return 1;
-    return memcmp ( a -> addr, b -> addr, a -> size );
-}
-
-/* StringOrderNoNullCheck
- *  avoids tests for NULL strings
- */
-LIB_EXPORT int CC StringOrderNoNullCheck ( const String *a, const String *b )
-{
-    if ( a -> size < b -> size )
-        return -1;
-    if ( a -> size > b -> size )
-        return 1;
-    return memcmp ( a -> addr, b -> addr, a -> size );
-}
-
-/* StringMatch
- *  creates a substring of "a" in "match"
- *  for all of the sequential matching characters between "a" and "b"
- *  starting from character [ 0 ].
- *
- *  returns the number of characters that match.
- */
-LIB_EXPORT uint32_t CC StringMatch ( String *match, const String *a, const String *b )
-{
-    if ( a == NULL || b == NULL )
-    {
-        CONST_STRING ( match, "" );
-        return 0;
-    }
-
-    if ( a == b )
-    {
-        * match = * a;
-        return a -> len;
-    }
-
-    if ( match == NULL )
-    {
-        return string_match ( a -> addr, a -> size,
-            b -> addr, b -> size, (uint32_t)b -> size, NULL );
-    }
-
-    match -> addr = a -> addr;
-    return match -> len = string_match ( a -> addr, a -> size,
-        b -> addr, b -> size, (uint32_t)b -> size, & match -> size );
-}
-
-/* StringMatchExtend
- *  extends a substring of "a" in "match"
- *  for all of the sequential matching characters between "a" and "b"
- *  starting from character [ match -> len ].
- *
- *  returns the number of matching characters that were extended.
- */
-LIB_EXPORT uint32_t CC StringMatchExtend ( String *match, const String *a, const String *b )
-{
-    size_t msize;
-    uint32_t len;
-
-    assert ( match != NULL );
-    if ( match -> len == 0 )
-        return StringMatch ( match, a, b );
-
-    assert ( a != NULL );
-    assert ( match -> addr == a -> addr );
-    assert ( match -> len <= a -> len );
-
-    if ( b == NULL || match -> len == a -> len || match -> len >= b -> len )
-        return 0;
-
-    msize = match -> size;
-    len = string_match ( a -> addr + msize, a -> size - msize,
-        b -> addr + msize, b -> size - msize, (uint32_t)b -> size, & msize );
-
-    match -> len += len;
-    match -> size += msize;
-    return len;
-}
-
-/* StringCopyUTF...
- *  creates a String from UTF16 or UTF32 UNICODE input
- *  wchar_t is one or the other, depending upon OS and compiler.
- */
-LIB_EXPORT rc_t CC StringCopyUTF16 ( const String **cpy, const uint16_t *text, size_t bytes )
-{
-    if ( cpy != NULL )
-    {
-        if ( text != NULL || bytes == 0 )
-        {
-            size_t size;
-            uint32_t len = utf16_cvt_string_len ( text, bytes, & size );
-            String *str = ( String* ) malloc ( sizeof * str + 1 + size );
-            if ( ( * cpy = str ) == NULL )
-                return RC ( rcText, rcString, rcCopying, rcMemory, rcInsufficient );
-            StringInit ( str, ( char* ) ( str + 1 ), size, len );
-            str -> size = utf16_cvt_string_copy ( ( char* ) str -> addr, size, text, bytes );
-            return 0;
-        }
-
-        * cpy = NULL;
-    }
-    return RC ( rcText, rcString, rcCopying, rcParam, rcNull );
-}
-
-LIB_EXPORT rc_t CC StringCopyUTF32 ( const String **cpy, const uint32_t *text, size_t bytes )
-{
-    if ( cpy != NULL )
-    {
-        if ( text != NULL || bytes == 0 )
-        {
-            size_t size;
-            uint32_t len = utf32_cvt_string_len ( text, bytes, & size );
-            String *str = ( String* ) malloc ( sizeof * str + 1 + size );
-            if ( ( * cpy = str ) == NULL )
-                return RC ( rcText, rcString, rcCopying, rcMemory, rcInsufficient );
-            StringInit ( str, ( char* ) ( str + 1 ), size, len );
-            str -> size = utf32_cvt_string_copy ( ( char* ) str -> addr, size, text, bytes );
-            return 0;
-        }
-
-        * cpy = NULL;
-    }
-    return RC ( rcText, rcString, rcCopying, rcParam, rcNull );
-}
-
-/* StringWhack
- *  deallocates a string
- *  ignores strings not allocated by this library
- */
-LIB_EXPORT void CC StringWhack ( const String* self )
-{
-    free ( ( void* ) self );
-}
-
-
-/*--------------------------------------------------------------------------
- * raw text strings
- */
-
-/* string_size
- *  length of string in bytes
- */
-LIB_EXPORT size_t CC string_size ( const char *str )
-{
-    if ( str == NULL )
-        return 0;
-    return strlen ( str );
-}
-
-/* string_dup
- *  replaces the broken C library strndup
- *  creates a NUL-terminated malloc'd string
- */
-LIB_EXPORT char * CC string_dup ( const char *str, size_t size )
-{
-    char *dst;
-    if ( str == NULL )
-        dst = NULL;
-    else
-    {
-        dst = malloc ( size + 1 );
-        if ( dst != NULL )
-            string_copy ( dst, size + 1, str, size );
-    }
-    return dst;
-}
-
-/* string_dup_measure
- *  replaces the broken C library strdup
- *  creates a NUL-terminated malloc'd string
- *  returns size of string unless "size" is NULL
- */
-LIB_EXPORT char * CC string_dup_measure ( const char *str, size_t *size )
-{
-    size_t bytes = string_size ( str );
-    if ( size != NULL )
-        * size = bytes;
-    return string_dup ( str, bytes );
-}
-
-/* string_hash
- *  hashes a string
- */
-LIB_EXPORT uint32_t CC string_hash ( const char *str, size_t size )
-{
-    size_t i;
-    uint32_t hash;
-
-    assert ( str != NULL );
-
-    if ( str == NULL )
-        return 0;
-
-    for ( hash = 0, i = 0; i < size; ++ i )
-    {
-        uint32_t ch = ( ( const unsigned char* )  str ) [ i ];
-        hash = ( ( hash << 1 ) - ( hash >> 16 ) ) ^ ch;
-    }
-    return hash ^ ( hash >> 16 );
-}
-
-/* utf8_utf32
- *  converts UTF8 text to a single UTF32 character
- *  returns the number of UTF8 bytes consumed, such that:
- *    return > 0 means success
- *    return == 0 means insufficient input
- *    return < 0 means bad input or bad argument
- */
-LIB_EXPORT int CC utf8_utf32 ( uint32_t *dst, const char *begin, const char *end )
-{
-    int c;
-    uint32_t ch;
-    const char *src, *stop;
-
-    if ( dst == NULL || begin == NULL || end == NULL )
-        return -1;
-
-    if ( begin == end )
-        return 0;
-
-    /* non-negative bytes are ASCII-7 */
-    c = begin [ 0 ];
-    if ( begin [ 0 ] >= 0 )
-    {
-        dst [ 0 ] = c;
-        return 1;
-    }
-	
-    /* the leftmost 24 bits are set
-       the rightmost 8 can look like:
-       110xxxxx == 2 byte character
-       1110xxxx == 3 byte character
-       11110xxx == 4 byte character
-       111110xx == 5 byte character
-       1111110x == 6 byte character
-    */
-	
-    src = begin;
-	
-    /* invert bits to look at range */
-    ch = c;
-    c = ~ c;
-	
-    /* illegal range */
-    if ( c >= 0x40 )
-        return -1;
-	
-    /* 2 byte */
-    else if ( c >= 0x20 )
-    {
-        ch &= 0x1F;
-        stop = src + 2;
-    }
-	
-    /* 3 byte */
-    else if ( c >= 0x10 )
-    {
-        ch &= 0xF;
-        stop = src + 3;
-    }
-	
-    /* 4 byte */
-    else if ( c >= 8 )
-    {
-        ch &= 7;
-        stop = src + 4;
-    }
-	
-    /* 5 byte */
-    else if ( c >= 4 )
-    {
-        ch &= 3;
-        stop = src + 5;
-    }
-	
-    /* illegal */
-    else if ( c < 2 )
-        return -1;
-    
-    /* 6 byte */
-    else
-    {
-        ch &= 1;
-        stop = src + 6;
-    }
-    
-    /* must have sufficient input */
-    if ( stop > end )
-        return 0;
-	
-    /* complete the character */
-    while ( ++ src != stop )
-    {
-        c = src [ 0 ] & 0x7F;
-        if ( src [ 0 ] >= 0 || c >= 0x40 )
-            return -1;
-        ch = ( ch << 6 ) | c;
-    }
-	
-    /* record the character */
-    dst [ 0 ] = ch;
-	
-    /* return the bytes consumed */
-    return ( int ) ( src - begin );
-}
-
-/* utf32_utf8
- *  converts a single UTF32 character to UTF8 text
- *  returns the number of UTF8 bytes generated, such that:
- *    return > 0 means success
- *    return == 0 means insufficient output
- *    return < 0 means bad character or bad argument
- */
-LIB_EXPORT int CC utf32_utf8 ( char *begin, char *end, uint32_t ch )
-{
-    int len;
-    char *dst;
-    uint32_t mask;
-
-    if ( begin == NULL || end == NULL )
-        return -1;
-    if ( begin >= end )
-        return 0;
-
-    if ( ch < 128 )
-    {
-        begin [ 0 ] = ( char ) ch;
-        return 1;
-    }
-
-    /* 2 byte */
-    if ( ch < 0x00000800 )
-    {
-        /* 110xxxxx */
-        mask = 0xC0U;
-        len = 2;
-    }
-	
-    /* 3 byte */
-    else if ( ch < 0x00010000 )
-    {
-        /* 1110xxxx */
-        mask = 0xE0U;
-        len = 3;
-    }
-
-    /* 4 byte */
-    else if ( ch < 0x00200000 )
-    {
-        /* 11110xxx */
-        mask = 0xF0U;
-        len = 4;
-    }
-	
-    /* 5 byte */
-    else if ( ch < 0x04000000 )
-    {
-        /* 111110xx */
-        mask = 0xF8U;
-        len = 5;
-    }
-	
-    /* 6 byte */
-    else
-    {
-        /* 1111110x */
-        mask = 0xFCU;
-        len = 6;
-    }
-	
-    dst = begin + len;
-    if ( dst > end )
-        return 0;
-    
-    while ( -- dst > begin )
-    {
-        /* 10xxxxxx */ /* too many casts to suit different compilers */
-        dst [ 0 ] = ( char ) (( char ) 0x80 | ( ( char ) ch & ( char ) 0x3F ));
-        ch >>= 6;
-    }
-    
-    dst [ 0 ] = ( char ) ( mask | ch );
-
-    return len;
-}
-
-/* utf16_string_size/len/measure
- *  measures UTF-16 strings
- */
-LIB_EXPORT size_t CC utf16_string_size ( const uint16_t *str )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i * sizeof * str;
-}
-
-LIB_EXPORT uint32_t CC utf16_string_len ( const uint16_t *str, size_t size )
-{
-    uint32_t i, str_len = ( uint32_t ) ( size >> 1 );
-
-    for ( i = 0; i < str_len; ++ i )
-    {
-        char ignore [ 8 ];
-        uint32_t ch = str [ i ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i;
-}
-
-LIB_EXPORT uint32_t CC utf16_string_measure ( const uint16_t *str, size_t *size )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    * size = i * sizeof * str;
-
-    return i;
-}
-
-/* utf32_string_size/len/measure
- */
-LIB_EXPORT size_t CC utf32_string_size ( const uint32_t *str )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i * sizeof * str;
-}
-
-LIB_EXPORT uint32_t CC utf32_string_len ( const uint32_t *str, size_t size )
-{
-    uint32_t i, str_len = ( uint32_t ) ( size >> 2 );
-
-    for ( i = 0; i < str_len; ++ i )
-    {
-        char ignore [ 8 ];
-        uint32_t ch = str [ i ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i;
-}
-
-LIB_EXPORT uint32_t CC utf32_string_measure ( const uint32_t *str, size_t *size )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    * size = i * sizeof * str;
-
-    return i;
-}
-
-/* whcar_string_size/len/measure
- *  measures whcar_t strings
- */
-LIB_EXPORT size_t CC wchar_string_size ( const wchar_t *str )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i * sizeof * str;
-}
-
-LIB_EXPORT uint32_t CC wchar_string_len ( const wchar_t *str, size_t size )
-{
-    uint32_t i, str_len = ( uint32_t ) ( size / sizeof * str );
-
-    for ( i = 0; i < str_len; ++ i )
-    {
-        char ignore [ 8 ];
-        uint32_t ch = str [ i ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    return i;
-}
-
-LIB_EXPORT uint32_t CC wchar_string_measure ( const wchar_t *str, size_t *size )
-{
-    uint32_t i, ch;
-
-    for ( ch = str [ i = 0 ]; ch != 0 ; ch = str [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        if ( utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch ) <= 0 )
-            break;
-    }
-
-    * size = i * sizeof * str;
-
-    return i;
-}
diff --git a/libs/klib/token.c b/libs/klib/token.c
deleted file mode 100644
index 9e4f0f5..0000000
--- a/libs/klib/token.c
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/token.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* for parser simplicity before the days of expressions,
-   signed numerals were recognized as single tokens, i.e.
-   (+/-)NUM with no separating white space was a single token */
-#define SUPPORT_SIGNED_NUMERALS 0
-
-/*--------------------------------------------------------------------------
- * KToken
- *  a string with an id and source information
- */
-
-/* hex_to_int
- *  where 'c' is known to be hex
- */
-static
-unsigned int CC hex_to_int ( char c )
-{
-    int i = c - '0';
-    if ( c > '9' )
-    {
-        if ( c < 'a' )
-            i = c - 'A' + 10;
-        else
-            i = c - 'a' + 10;
-    }
-
-    assert ( i >= 0 && i < 16 );
-    return i;
-}
-
-static
-rc_t CC StringConvertHex ( const String *self, uint64_t *ip, int bits )
-{
-    uint32_t i;
-    uint64_t i64 = hex_to_int ( self -> addr [ 2 ] );
-    for ( i = 3; i < self -> len; ++ i )
-    {
-        i64 <<= 4;
-        i64 += hex_to_int ( self -> addr [ i ] );
-    }
-
-    if ( bits < 64 && ( i64 >> bits ) != 0 )
-        return RC ( rcVDB, rcToken, rcConverting, rcRange, rcExcessive );
-
-    * ip = i64;
-    return 0;
-}
-
-static
-rc_t CC StringConvertOctal ( const String *self, uint64_t *ip, int bits )
-{
-    uint32_t i;
-    uint64_t i64 = 0;
-    for ( i = 1; i < self -> len; ++ i )
-    {
-        i64 <<= 3;
-        i64 += self -> addr [ i ] - '0';
-    }
-
-    if ( bits < 64 && ( i64 >> bits ) != 0 )
-        return RC ( rcVDB, rcToken, rcConverting, rcRange, rcExcessive );
-
-    * ip = i64;
-    return 0;
-}
-
-static
-rc_t CC StringConvertDecimal ( const String *self, uint64_t *ip, int bits )
-{
-    uint32_t i;
-    uint64_t i64;
-
-    if ( bits > 32 )
-    {
-        i64 = self -> addr [ 0 ] - '0';
-        for ( i = 1; i < self -> len; ++ i )
-        {
-            i64 *= 10;
-            i64 += self -> addr [ i ] - '0';
-        }
-    }
-    else
-    {
-        uint32_t i32 = self -> addr [ 0 ] - '0';
-        for ( i = 1; i < self -> len; ++ i )
-        {
-            i32 *= 10;
-            i32 += self -> addr [ i ] - '0';
-        }
-        i64 = i32;
-    }
-
-    if ( bits < 64 && ( i64 >> bits ) != 0 )
-        return RC ( rcVDB, rcToken, rcConverting, rcRange, rcExcessive );
-
-    * ip = i64;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTokenToI32 ( const KToken *self, int32_t *i )
-{
-    rc_t rc;
-    int64_t i64;
-
-    switch ( self -> id )
-    {
-    case eDecimal:
-        rc = StringConvertDecimal ( & self -> str, ( uint64_t* ) & i64, 31 );
-        break;
-    case eHex:
-        rc = StringConvertHex ( & self -> str, ( uint64_t* ) & i64, 31 );
-        break;
-    case eOctal:
-        rc = StringConvertOctal ( & self -> str, ( uint64_t* ) & i64, 31 );
-        break;
-    default:
-        return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-    }
-
-    if ( rc == 0 )
-        * i = ( int32_t ) i64;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTokenToU32 ( const KToken *self, uint32_t *i )
-{
-    rc_t rc;
-    uint64_t i64;
-
-    switch ( self -> id )
-    {
-    case eDecimal:
-        rc = StringConvertDecimal ( & self -> str, & i64, 32 );
-        break;
-    case eHex:
-        rc = StringConvertHex ( & self -> str, & i64, 32 );
-        break;
-    case eOctal:
-        rc = StringConvertOctal ( & self -> str, & i64, 32 );
-        break;
-    default:
-        return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-    }
-
-    if ( rc == 0 )
-        * i = ( uint32_t ) i64;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTokenToI64 ( const KToken *self, int64_t *i )
-{
-    switch ( self -> id )
-    {
-    case eDecimal:
-        return StringConvertDecimal ( & self -> str, ( uint64_t* ) i, 63 );
-    case eHex:
-        return StringConvertHex ( & self -> str, ( uint64_t* ) i, 63 );
-    case eOctal:
-        return StringConvertOctal ( & self -> str, ( uint64_t* ) i, 63 );
-    }
-
-    return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-}
-
-LIB_EXPORT rc_t CC KTokenToU64 ( const KToken *self, uint64_t *i )
-{
-    switch ( self -> id )
-    {
-    case eDecimal:
-        return StringConvertDecimal ( & self -> str, i, 64 );
-    case eHex:
-        return StringConvertHex ( & self -> str, i, 64 );
-    case eOctal:
-        return StringConvertOctal ( & self -> str, i, 64 );
-    }
-
-    return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-}
-
-LIB_EXPORT rc_t CC KTokenToF64 ( const KToken *self, double *d )
-{
-    char buffer [ 256 ], *end;
-
-    switch ( self -> id )
-    {
-    case eDecimal:
-    case eFloat:
-    case eExpFloat:
-        break;
-    case eOctal:
-        if ( self -> str . len == 1 )
-            break;
-    default:
-        return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-    }
-
-    if ( string_copy ( buffer, sizeof buffer,
-             self -> str . addr, self -> str . size ) == sizeof buffer )
-    {
-        return RC ( rcVDB, rcToken, rcConverting, rcToken, rcExcessive );
-    }
-
-    * d = strtod ( buffer, & end );
-    if ( ( end - buffer ) != self -> str . size )
-        return RC ( rcVDB, rcToken, rcConverting, rcToken, rcInvalid );
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTokenToVersion ( const KToken *self, uint32_t *vp )
-{
-    rc_t rc;
-    String str;
-    uint64_t i;
-    uint32_t v = 0;
-
-    const char *dot;
-    const char *start = self -> str . addr;
-    const char *end = start + self -> str . size;
-
-    switch ( self -> id )
-    {
-        /* three-part versions */
-    case eMajMinRel:
-        dot = string_rchr ( start, end - start, '.' ) + 1;
-        assert ( dot > start && dot < end );
-        StringInit ( & str, dot, (size_t)( end - dot ), (uint32_t)( end - dot ) );
-        rc = StringConvertDecimal ( & str, & i, 16 );
-        if ( rc != 0 )
-            break;
-
-        v = ( uint32_t ) i;
-        end = dot - 1;
-
-        /* two-part versions */
-    case eFloat:
-        dot = string_rchr ( start, end - start, '.' );
-        if ( dot == start )
-            return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-        if ( ++ dot == end )
-            return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-        StringInit ( & str, dot, (size_t)( end - dot ), (uint32_t)( end - dot ) );
-        rc = StringConvertDecimal ( & str, & i, 8 );
-        if ( rc != 0 )
-            break;
-
-        v |= ( uint32_t ) ( i << 16 );
-        end = dot - 1;
-
-        /* single-part versions */
-    case eOctal:
-    case eDecimal:
-        StringInit ( & str, start, (size_t)( end - start ), (uint32_t)( end - start ) );
-        rc = StringConvertDecimal ( & str, & i, 8 );
-        if ( rc != 0 )
-            break;
-
-        v |= ( uint32_t ) ( i << 24 );
-        break;
-
-    default:
-        return RC ( rcVDB, rcToken, rcConverting, rcType, rcIncorrect );
-    }
-
-    if ( rc == 0 )
-        * vp = v;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KTokenToString ( const KToken *self, char *buffer, size_t bsize, size_t *size )
-{
-    size_t i, j, sz = self -> str . size;
-
-    switch ( self -> id )
-    {
-    case eEndOfInput:
-        * size = 0;
-        return 0;
-
-    case eString:
-        -- sz;
-    case eUntermString:
-        * size = sz - 1;
-
-        if ( sz >= bsize )
-            return RC ( rcVDB, rcToken, rcConverting, rcBuffer, rcInsufficient );
-
-        string_copy ( buffer, bsize, self -> str . addr + 1, sz - 1 );
-        return 0;
-
-    case eEscapedString:
-        -- sz;
-    case eUntermEscapedString:
-        /* leave initial quote at str[0] in count */
-        break;
-
-    default:
-        * size = sz;
-
-        if ( sz + 1 >= bsize )
-            return RC ( rcVDB, rcToken, rcConverting, rcBuffer, rcInsufficient );
-
-        string_copy ( buffer, bsize, self -> str . addr, sz );
-        return 0;
-    }
-
-    /* walk across string starting at offset 1
-       to skip initial quote that was left in "sz" */
-    for ( i = 1, j = 0, -- bsize; i < sz; ++ i )
-    {
-        if ( j == bsize )
-            return RC ( rcVDB, rcToken, rcConverting, rcBuffer, rcInsufficient );
-
-        if ( ( buffer [ j ] = self -> str . addr [ i ] ) == '\\' )
-        {
-            if ( ++ i == sz )
-                break;
-            switch ( self -> str . addr [ i ] )
-            {
-                /* control characters */
-            case 'n':
-                buffer [ j ] = '\n';
-                break;
-            case 't':
-                buffer [ j ] = '\t';
-                break;
-            case 'r':
-                buffer [ j ] = '\r';
-                break;
-            case '0':
-                buffer [ j ] = '\0';
-                break;
-
-            case 'a':
-                buffer [ j ] = '\a';
-                break;
-            case 'b':
-                buffer [ j ] = '\b';
-                break;
-            case 'v':
-                buffer [ j ] = '\v';
-                break;
-            case 'f':
-                buffer [ j ] = '\f';
-                break;
-
-            case 'x': case 'X':
-                /* expect 2 additional hex characters */
-                if ( ( i + 2 ) < sz &&
-                     isxdigit ( self -> str . addr [ i + 1 ] ) &&
-                     isxdigit ( self -> str . addr [ i + 2 ] ) )
-                {
-                    /* go ahead and convert */
-                    buffer [ j ] = ( char )
-                        ( ( hex_to_int ( self -> str . addr [ i + 1 ] ) << 4 ) |
-                          hex_to_int ( self -> str . addr [ i + 2 ] ) );
-                    i += 2;
-                    break;
-                }
-                /* no break */
-
-                /* just quote self */
-            default:
-                buffer [ j ] = self -> str . addr [ i ];
-            }
-        }
-
-        ++ j;
-    }
-
-    * size = j;
-    return 0;
-}
-
-static
-rc_t CC utf8_utf32_cvt_string_copy ( uint32_t *dst, uint32_t blen, uint32_t *dlen, const char *src, size_t ssize )
-{
-    int rslt, len;
-    const char *end = src + ssize;
-
-    for ( len = 0; src < end; ++ len, src += rslt )
-    {
-        if ( len == blen )
-            return RC ( rcVDB, rcToken, rcConverting, rcBuffer, rcInsufficient );
-
-        rslt = utf8_utf32 ( & dst [ len ], src, end );
-        if ( rslt <= 0 )
-        {
-            if ( rslt == 0 )
-                return RC ( rcVDB, rcToken, rcConverting, rcString, rcInsufficient );
-
-            return RC ( rcVDB, rcToken, rcConverting, rcString, rcCorrupt );
-        }
-    }
-
-    * dlen = len;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTokenToWideString ( const KToken *self, uint32_t *buffer, uint32_t blen, uint32_t *len )
-{
-    int rslt;
-    const char *start, *end;
-    size_t i, sz = self -> str . size;
-
-    switch ( self -> id )
-    {
-    case eEndOfInput:
-        * len = 0;
-        return 0;
-
-    case eString:
-        -- sz;
-    case eUntermString:
-        return utf8_utf32_cvt_string_copy ( buffer, blen, len, self -> str . addr + 1, sz - 1 );
-
-    case eEscapedString:
-        -- sz;
-    case eUntermEscapedString:
-        -- sz;
-        break;
-
-    default:
-        return utf8_utf32_cvt_string_copy ( buffer, blen, len, self -> str . addr, sz );
-    }
-
-    /* get start and end pointers for utf8 string */
-    start = self -> str . addr + 1;
-    end = start + sz;
-
-    for ( i = 0; start < end; ++ i, start += rslt )
-    {
-        if ( i == blen )
-            return RC ( rcVDB, rcToken, rcConverting, rcBuffer, rcInsufficient );
-
-        rslt = utf8_utf32 ( & buffer [ i ], start, end );
-        if ( rslt <= 0 )
-        {
-            if ( rslt == 0 )
-                return RC ( rcVDB, rcToken, rcConverting, rcString, rcInsufficient );
-
-            return RC ( rcVDB, rcToken, rcConverting, rcString, rcCorrupt );
-        }
-
-        if ( buffer [ i ] == ( uint32_t ) '\\' )
-        {
-            rslt = utf8_utf32 ( & buffer [ i ], start += rslt, end );
-            if ( rslt <= 0 )
-            {
-                if ( rslt == 0 )
-                    return RC ( rcVDB, rcToken, rcConverting, rcString, rcInsufficient );
-
-                return RC ( rcVDB, rcToken, rcConverting, rcString, rcCorrupt );
-            }
-
-            if ( rslt == 1 ) switch ( ( char ) buffer [ i ] )
-            {
-                /* control characters */
-            case 'r':
-                buffer [ i ] = '\r';
-                break;
-            case 'n':
-                buffer [ i ] = '\n';
-                break;
-            case 't':
-                buffer [ i ] = '\t';
-                break;
-            case '0':
-                buffer [ i ] = '\0';
-                break;
-
-            case 'a':
-                buffer [ i ] = '\a';
-                break;
-            case 'b':
-                buffer [ i ] = '\b';
-                break;
-            case 'v':
-                buffer [ i ] = '\v';
-                break;
-            case 'f':
-                buffer [ i ] = '\f';
-                break;
-
-            case 'x': case 'X':
-                /* expect 2 additional hex characters */
-                if ( ( start + 2 ) < end &&
-                     isxdigit ( start [ 1 ] ) &&
-                     isxdigit ( start [ 2 ] ) )
-                {
-                    /* go ahead and convert */
-                    buffer [ i ] =
-                        ( ( hex_to_int ( start [ 1 ] ) << 4 ) |
-                            hex_to_int ( start [ 2 ] ) );
-                    start += 2;
-                }
-                break;
-
-            case 'u': case 'U':
-                /* expect 4 additional hex characters */
-                if ( ( start + 4 ) < end &&
-                     isxdigit ( start [ 1 ] ) &&
-                     isxdigit ( start [ 2 ] ) &&
-                     isxdigit ( start [ 3 ] ) &&
-                     isxdigit ( start [ 4 ] ) )
-                {
-                    /* go ahead and convert */
-                    buffer [ i ] =
-                        ( ( hex_to_int ( start [ 1 ] ) << 12 ) |
-                          ( hex_to_int ( start [ 2 ] ) << 8 ) |
-                          ( hex_to_int ( start [ 3 ] ) << 4 ) |
-                            hex_to_int ( start [ 4 ] ) );
-                    start += 4;
-                }
-                break;
-            }
-        }
-    }
-
-    * len = (uint32_t)i;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KTokenSource
- */
-
-
-/* Return
- *  returns token to source
- */
-LIB_EXPORT void CC KTokenSourceReturn ( KTokenSource *self, const KToken *t )
-{
-    if ( self != NULL && t != NULL )
-    {
-        if ( t -> str . addr + t -> str . size == self -> str . addr )
-        {
-            self -> str . addr = t -> str . addr;
-            self -> str . size += t -> str . size;
-            self -> str . len += t -> str . len;
-        }
-    }
-}
-
-
-/* Consume
- *  consumes all remaining data
- */
-LIB_EXPORT void CC KTokenSourceConsume ( KTokenSource *self )
-{
-    if ( self != NULL )
-    {
-        self -> str . addr += self -> str . size;
-        self -> str . len = 0;
-        self -> str . size = 0;
-    }
-}
-
-
-/* Extend
- *  try to make more data available
- */
-static
-rc_t CC KTokenSourceExtend ( KTokenSource *src )
-{
-    KTokenText *tt = ( KTokenText* ) src -> txt;
-    if ( tt -> read != NULL )
-    {
-        rc_t rc = ( * tt -> read ) ( tt -> data, tt, src -> str . size );
-        if ( rc != 0 )
-            return rc;
-        src -> str = tt -> str;
-    }
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KTokenizer
- *  an encapsulation of the tokenizer code
- */
-
-/* Next
- *  get next token
- */
-#if CHECK_TOKENIZER
-static KToken * CC KTokenizerNextInt
-#else
-LIB_EXPORT KToken * CC KTokenizerNext
-#endif
- ( const KTokenizer *self, KTokenSource *src, KToken *t )
-{
-    int id;
-    const unsigned char *start, *stop;
-    bool return_eoln, allow_slash_slash, allow_hash_cmt, try_extend, path_ident;
-
-#define ispathident(c) ( isalnum (c) || (c) == '.' || (c) == '-' || (c) == '_' )
-
-    if ( t == NULL || src == NULL )
-        return NULL;
-
-    start = ( const unsigned char* ) src -> str . addr;
-    stop = start + src -> str . size;
-
-    /* glue token to text */
-    t -> txt = src -> txt;
-
-    /* no symbol */
-    t -> sym = NULL;
-
-    /* detect returning eoln */
-    return_eoln = ( self == kLineTokenizer );
-
-    /* the POSIX tokenizer doesn't want // comments */
-    allow_slash_slash = ( self != kPOSIXPathTokenizer );
-    allow_hash_cmt = ( self == kPOSIXPathTokenizer );
-    path_ident =  ( self == kPOSIXPathTokenizer );
-
-restart:
-
-    /* skip over blanks */
-    while ( start < stop && isspace ( * start ) )
-    {
-        switch ( * start )
-        {
-        case '\r':
-            t -> str . addr = ( const char* ) start;
-            if ( start + 1 < stop && start [ 1 ] == '\n' )
-                ++ start;
-            if ( ! return_eoln )
-            {
-                ++ src -> lineno;
-                break;
-            }
-            else
-            {
-        case '\n':
-                t -> str . addr = ( const char* ) start;
-                if ( start + 1 < stop && start [ 1 ] == '\r' )
-                    ++ start;
-                if ( ! return_eoln )
-                {
-                    ++ src -> lineno;
-                    break;
-                }
-            }
-
-            t -> str . len = (uint32_t)( start - ( const unsigned char* ) t -> str . addr );
-            t -> str . size = t -> str . len;
-            t -> lineno = src -> lineno ++;
-            t -> id = eEndOfLine;
-
-            src -> str . size -= start - ( const unsigned char* ) src -> str . addr;
-            src -> str . len -= (uint32_t)( start - ( const unsigned char* ) src -> str . addr );
-            src -> str . addr = ( const char* ) start;
-
-            return t;
-        }
-
-        ++ start;
-    }
-
-    /* detect end */
-    if ( start == stop )
-    {
-        src -> str . addr = ( const char* ) start;
-        src -> str . size = 0;
-        src -> str . len = 0;
-
-        KTokenSourceExtend ( src );
-        start = ( const unsigned char* ) src -> str . addr;
-        stop = start + src -> str . size;
-        if ( start != stop )
-            goto restart;
-
-        t -> str = src -> str;
-        t -> lineno = src -> lineno;
-        t -> id = eEndOfInput;
-        return t;
-    }
-
-    /* record start of token */
-    t -> str . addr = ( const char* ) start;
-    t -> lineno = src -> lineno;
-
-    /* many symbols do not need extend */
-    try_extend = false;
-
-    /* tokenize */
-    if ( isdigit ( * start ) )
-    {
-        try_extend = true;
-
-        /* assume numeral */
-        if ( * start != '0' )
-        {
-            id = eDecimal;
-#if SUPPORT_SIGNED_NUMERALS
-tokenize_decimal:
-#endif
-            while ( ++ start < stop )
-            {
-                if ( ! isdigit ( * start ) )
-                {
-                    if ( isalpha ( * start ) || * start == '_' )
-                    {
-                        if ( id != eDecimal )
-                            break;
-                        id = eName;
-                        goto tokenize_name;
-                    }
-                    if ( * start == '.' )
-                        goto tokenize_float;
-                    break;
-                }
-            }
-        }
-        else
-        {
-            if ( ( stop - start ) >= 3 &&
-                 ( start [ 1 ] == 'x' || start [ 1 ] == 'X' ) &&
-                 isxdigit ( start [ 2 ] ) )
-            {
-                id = eHex;
-                for ( start += 3; start < stop; ++ start )
-                {
-                    if ( ! isxdigit ( * start ) )
-                    {
-                        if ( isalpha ( * start ) || * start == '_' )
-                        {
-                            id = eName;
-                            goto tokenize_name;
-                        }
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                id = eOctal;
-                while ( ++ start < stop )
-                {
-                    if ( ! isdigit ( * start ) )
-                    {
-                        if ( isalpha ( * start ) || * start == '_' )
-                        {
-                            id = eName;
-                            goto tokenize_name;
-                        }
-                        if ( * start == '.' )
-                            goto tokenize_float;
-                        break;
-                    }
-
-                    if ( * start > '7' )
-                        id = eDecimal;
-                }
-            }
-        }
-    }
-    else if ( isalpha ( * start ) )
-    {
-tokenize_ident:
-        try_extend = true;
-
-        id = eIdent;
-
-tokenize_name:
-        while ( ++ start < stop )
-        {
-            if ( path_ident && ( *start  == '.' || *start == '-' ) )
-                continue;
-
-            if ( ! isalnum ( * start ) && * start != '_' )
-                break;
-        }
-    }
-    else switch ( * start ++ )
-    {
-    case '_':
-        -- start;
-        goto tokenize_ident;
-    case '\'':
-        try_extend = true;
-        for ( id = eUntermString; start < stop; ++ start )
-        {
-            if ( * start == '\'' )
-            {
-                ++ id;
-                start += 1;
-                break;
-            }
-
-            if ( * start == '\\' )
-            {
-                id = eUntermEscapedString;
-                if ( ++ start == stop )
-                    break;
-            }
-        }
-        break;
-
-    case '"':
-        try_extend = true;
-        for ( id = eUntermString; start < stop; ++ start )
-        {
-            if ( * start == '"' )
-            {
-                ++ id;
-                start += 1;
-                break;
-            }
-
-            if ( * start == '\\' )
-            {
-                id = eUntermEscapedString;
-                if ( ++ start == stop )
-                    break;
-            }
-        }
-        break;
-
-    case '.':
-        if ( path_ident ) /* posix path parsing enabled */
-        {
-            /* find special identifier ".." by finding two periods not followed by 
-             * another identifier character
-             */
-            if ( start [ 0 ] == '.' && ! ispathident ( start [ 1 ]))
-            {
-                id = eDblPeriod;
-                break;
-            }
-            if ( isalnum ( * start ) || * start == '.' || * start == '_' || * start == '-' )
-            {
-                id = eName;
-                goto tokenize_name;
-            }
-        }
-        if ( stop > start && isdigit ( * start ) )
-        {
-tokenize_float:
-            try_extend = true;
-            id = eFloat;
-            while ( ++ start < stop )
-            {
-                if ( ! isdigit ( * start ) )
-                {
-                    if ( id != eFloat )
-                        break;
-                    if ( ( stop - start ) < 2 || ! isdigit ( start [ 1 ] ) )
-                        break;
-                    if ( * start == '.' )
-                        id = eMajMinRel;
-                    else if ( * start == 'e' || * start == 'E' )
-                        id = eExpFloat;
-                    else
-                    {
-                        break;
-                    }
-                    ++ start;
-                }
-            }
-            break;
-        }
-
-        if ( ( stop - start ) < 2 )
-            try_extend = true;
-        else if ( start [ 0 ] == '.' && start [ 1 ] == '.'  )
-        {
-            id = eEllipsis;
-            start += 2;
-            break;
-        }
-
-        id = ePeriod;
-        break;
-
-    case ',':
-        id = eComma;
-        break;
-    case ':':
-        id = eColon;
-        if ( start == stop )
-            try_extend = true;
-        else
-        {
-            switch ( start [ 0 ] )
-            {
-            case ':':
-                id = eDblColon;
-                start += 1;
-                break;
-            case '=':
-                id = eColonAssign;
-                start += 1;
-                break;
-            }
-        }
-        break;
-    case ';':
-        id = eSemiColon;
-        break;
-    case '?':
-        id = eQuestion;
-        break;
-    case '~':
-        id = eTilde;
-        break;
-    case '!':
-        id = eExclam;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '=' )
-        {
-            id = eNotEqual;
-            start += 1;
-        }
-        break;
-    case '@':
-        id = eAtSign;
-        break;
-    case '#':
-        if ( allow_hash_cmt )
-            goto line_cmt;
-        id = eHash;
-        break;
-    case '$':
-        id = eDollar;
-        break;
-    case '%':
-        id = ePercent;
-        break;
-    case '^':
-        id = eCaret;
-        break;
-    case '&':
-        id = eAmpersand;
-        if ( start == stop )
-            try_extend = true;
-        if ( start [ 0 ] == '&' )
-        {
-            id = eLogAnd;
-            start += 1;
-        }
-        break;
-    case '*':
-        id = eAsterisk;
-        break;
-    case '+':
-#if SUPPORT_SIGNED_NUMERALS
-        if ( start == stop )
-            try_extend = true;
-        else
-        {
-            if ( isdigit ( * start ) )
-            {
-                id = eSignedDec;
-                try_extend = true;
-                goto tokenize_decimal;
-            }
-            if ( start [ 0 ] == '=' )
-            {
-                id = ePlusAssign;
-                start += 1;
-                break;
-            }
-        }
-#endif
-        id = ePlus;
-        break;
-    case '-':
-#if SUPPORT_SIGNED_NUMERALS
-        if ( start == stop )
-            try_extend = true;
-        else
-        {
-            if ( isdigit ( * start ) )
-            {
-                id = eSignedDec;
-                try_extend = true;
-                goto tokenize_decimal;
-            }
-            if ( * start == '>' )
-            {
-                id = eOverArrow;
-                start += 1;
-                break;
-            }
-        }
-#endif
-        id = eMinus;
-        break;
-    case '=':
-        id = eAssign;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '=' )
-        {
-            id = eEqual;
-            start += 1;
-        }
-        break;
-    case '/':
-        id = eFwdSlash;
-        if ( start == stop )
-            try_extend = true;
-        else switch ( start [ 0 ] )
-        {
-        case '/':
-            if ( ! allow_slash_slash )
-                break;
-            ++ start;
-line_cmt:
-            try_extend = true;
-            for ( ; start < stop; ++ start )
-            {
-                switch ( start [ 0 ] )
-                {
-                case '\r':
-                case '\n':
-                    goto comment_restart;
-                }
-            }
-comment_restart:
-            src -> str . len -= string_len ( src -> str . addr, ( const char* ) start - src -> str . addr );
-            src -> str . size -= ( const char* ) start - src -> str . addr;
-            src -> str . addr = ( const char* ) start;
-            goto restart;
-
-        case '*':
-            try_extend = true;
-            id = eUntermComment;
-            if ( ++ start < stop ) switch ( start [ 0 ] )
-            {
-            case '\r':
-                if ( start + 1 < stop && start [ 1 ] == '\n' )
-                    ++ start;
-                ++ src -> lineno;
-                break;
-            case '\n':
-                if ( start + 1 < stop && start [ 1 ] == '\r' )
-                    ++ start;
-                ++ src -> lineno;
-                break;
-            }
-            for ( ++ start; start < stop; ++ start )
-            {
-                switch ( start [ 0 ] )
-                {
-                case '/':
-                    if ( start [ -1 ] == '*' )
-                    {
-                        ++ start;
-                        goto comment_restart;
-                    }
-                    break;
-                case '\r':
-                    if ( start + 1 < stop && start [ 1 ] == '\n' )
-                        ++ start;
-                    ++ src -> lineno;
-                    break;
-                case '\n':
-                    if ( start + 1 < stop && start [ 1 ] == '\r' )
-                        ++ start;
-                    ++ src -> lineno;
-                    break;
-                }
-            }
-            break;
-        }
-        break;
-    case '\\':
-        id = eBackSlash;
-        break;
-    case '|':
-        id = ePipe;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '|' )
-        {
-            id = eLogOr;
-            start += 1;
-        }
-        break;
-    case '(':
-        id = eLeftParen;
-        break;
-    case ')':
-        id = eRightParen;
-        break;
-    case '{':
-        id = eLeftCurly;
-        break;
-    case '}':
-        id = eRightCurly;
-        break;
-    case '<':
-        id = eLeftAngle;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '<' )
-        {
-            id = eDblLeftAngle;
-            start += 1;
-        }
-        break;
-    case '>':
-        id = eRightAngle;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '>' )
-        {
-            id = eDblRightAngle;
-            start += 1;
-        }
-        break;
-    case '[':
-        id = eLeftSquare;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == '[' )
-        {
-            id = eDblLeftSquare;
-            start += 1;
-        }
-        break;
-    case ']':
-        id = eRightSquare;
-        if ( start == stop )
-            try_extend = true;
-        else if ( start [ 0 ] == ']' )
-        {
-            id = eDblRightSquare;
-            start += 1;
-        }
-        break;
-    default:
-        /* skip over single UTF-8 character */
-        if ( ( ( const char* ) start ) [ -1 ] < 0 )
-        {
-            while ( start < stop )
-            {
-                if ( ( * start & 0xC0 ) != 0x80 )
-                    break;
-                ++ start;
-            }
-        }
-
-        t -> str . len = 1;
-        t -> str . size = start - ( const unsigned char* ) t -> str . addr;
-
-        src -> str . addr = ( const char* ) start;
-        src -> str . len -= 1;
-        src -> str . size -= t -> str . size;
-
-        t -> id = eUnrecognized;
-        return t;
-    }
-
-    t -> str . len = (uint32_t)( start - ( const unsigned char* ) t -> str . addr );
-    t -> str . size = t -> str . len;
-    t -> id = id;
-
-    if ( ! try_extend || start < stop )
-    {
-        src -> str . size -= start - ( const unsigned char* ) src -> str . addr;
-        src -> str . len -= (uint32_t)( start - ( const unsigned char* ) src -> str . addr );
-        src -> str . addr = ( const char* ) start;
-    }
-    else
-    {
-        /* state that the amount left in source
-           is exactly what was tokenized */
-        src -> str = t -> str;
-
-        /* try to extend, which is successful
-           only if src ends up with more data */
-        KTokenSourceExtend ( src );
-        if ( src -> str . size > t -> str . size )
-        {
-            start = ( const unsigned char* ) src -> str . addr;
-            stop = start + src -> str . size;
-            goto restart;
-        }
-
-        /* out of data on source */
-        src -> str . addr = ( const char* ) stop;
-        src -> str . size = 0;
-        src -> str . len = 0;
-    }
-
-    return t;
-}
-
-#if CHECK_TOKENIZER
-#include <stdio.h>
-static
-void CC examine_src ( const KTokenSource *src, bool before )
-{
-    const KTokenText *tt = src -> txt;
-    const char *stage = before ? "before" : "after";
-
-    /* first test - are src addr and size correct */
-    if ( src -> str . addr + src -> str . size !=
-         tt -> str . addr + tt -> str . size )
-    {
-        /* in the case of console input before tokenization, this is allowed */
-        if ( before && src -> str . size == 0 && tt -> read != NULL )
-            return;
-
-        /* check for src addr being within text */
-        if ( src -> str . addr < tt -> str . addr ||
-             src -> str . addr >= tt -> str . addr + tt -> str . size )
-        {
-            fprintf ( stderr, "KTokenizerNext: bad src address %s scan\n", stage );
-        }
-        else
-        {
-            fprintf ( stderr, "KTokenizerNext: bad src size ( %lu ) %s scan "
-                      "at file \"%.*s\" offset %lu\n"
-                      , ( long unsigned ) src -> str . size
-                      , stage
-                      , ( int ) tt -> path . size, tt -> path . addr
-                      , ( long unsigned ) ( src -> str . addr - tt -> str . addr ) );
-        }
-    }
-
-    /* test number of characters */
-    else
-    {
-        uint32_t len = string_len ( src -> str . addr, src -> str . size );
-        if ( len != src -> str . len )
-        {
-            fprintf ( stderr, "KTokenizerNext: bad src character count "
-                      "( %u measured, %u stated ) %s scan\n", len, src -> str . len, stage );
-        }
-    }
-}
-
-LIB_EXPORT KToken * CC KTokenizerNext ( const KTokenizer *self, KTokenSource *src, KToken *t )
-{
-    KToken *rt;
-    examine_src ( src, true );
-    rt = KTokenizerNextInt ( self, src, t );
-    examine_src ( src, false );
-    return rt;
-}
-#endif
diff --git a/libs/klib/trie-priv.h b/libs/klib/trie-priv.h
deleted file mode 100644
index 3796ef7..0000000
--- a/libs/klib/trie-priv.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_trie_priv_
-#define _h_trie_priv_
-
-#ifndef _h_klib_trie_
-#include <klib/trie.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * TTrans
- *  a text transition node
- */
-typedef struct TTrans TTrans;
-struct TTrans
-{
-    /* child nodes */
-    TTrans **child;
-
-    /* values associated with the node */
-    BSTree vals;
-
-    /* the depth occupied within tree */
-    uint32_t depth;
-
-    /* number of transitions in array */
-    uint16_t tcnt;
-
-    /* number of values in b-tree */
-    uint16_t vcnt;
-};
-
-/* TTransBacktrace
- *  describes a TTrans
- *  with backtrace pointer to parent and transition index from parent
- */
-typedef struct TTransBacktrace TTransBacktrace;
-struct TTransBacktrace
-{
-    const TTransBacktrace *par;
-    const TTrans *trans;
-    uint32_t idx;
-};
-
-/* TTransForEach
- * TTransForEachBT
- */
-void TTransForEach ( const TTrans *trans, uint32_t width,
-    void ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data );
-void TTransForEachBT ( const TTransBacktrace *bt, uint32_t width,
-    void ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data );
-
-/* TTransDoUntil
- * TTransDoUntilBT
- */
-bool TTransDoUntil ( const TTrans *trans, uint32_t width,
-    bool ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data );
-bool TTransDoUntilBT ( const TTransBacktrace *bt, uint32_t width,
-    bool ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data );
-
-/* TTransValidate
- *  recursively checks structure
- */
-int TTransValidate ( const TTrans *trans, const Trie *tt );
-
-
-/*--------------------------------------------------------------------------
- * TTSearchNode
- *  this is a complicated guy.
- *
- *  if the only values allowed in a TTrans were terminal values,
- *  then the natural structure would imply a TTrans node for every
- *  path and a child array to hold children. the tree would be
- *  simple to navigate; searching would return TTrans nodes.
- *
- *  however, the structure abandons child arrays when the count
- *  is low enough, and allows non-terminal values in the value
- *  tree. a string may still terminate on a TTrans, but necessarily
- *  there will be strings that terminate in space.
- *
- *  to handle this, as well as to address non-intrusive list
- *  functionality, this search node is able to do too many things.
- *
- *  1) it allows a poor version of a child array to be added
- *     to an existing TTrans.
- *
- *  2) it defines a fake TTrans object with its own depth
- *     and value list.
- *
- *  3) the fake TTrans can itself be exploded to contain
- *     further fake TTrans objects
- *
- *  4) it functions as a non-intrusive reference to a TTNode
- *     for inclusion into temporary child lists.
- */
-enum
-{
-    snTrans,
-    snKeynode,
-    snTransEx,
-    snFakeTrans,
-    snFakeTransEx
-};
-
-typedef struct TTSearchNode TTSearchNode;
-struct TTSearchNode
-{
-    union
-    {
-        /* snTrans, snTransEx */
-        struct
-        {
-            const TTrans *ref;
-            DLList vals;
-            DLList child;
-
-        } trans;
-
-        /* snKeynode */
-        struct
-        {
-            DLNode n;
-            const TNode *ref;
-
-        } keynode;
-
-        /* snFakeTrans, snFakeTransEx */
-        struct
-        {
-            DLNode n;
-            DLList vals;
-            DLList child;
-            uint32_t depth;
-            uint32_t idx;
-
-        } fake;
-
-    } u;
-
-    uint32_t refcount;
-    uint32_t variant;
-};
-
-/* TTSearchNodeMakeTrans
- *  creates a reference node
- */
-rc_t TTSearchNodeMakeTrans ( TTSearchNode **s, const TTrans *trans );
-
-/* TTSearchNodeExplodeTrans
- *  explodes a simple TTrans to split values into term and non-term
- *  may create fake trans objects within "child"
- */
-rc_t TTSearchNodeExplodeTrans ( TTSearchNode *s, const Trie *tt );
-
-/* TTSearchNodeExplodeFakeTrans
- *  explodes a fake trans to split values into term and non-term
- *  may create fake trans objects within "child"
- */
-rc_t TTSearchNodeExplodeFakeTrans ( TTSearchNode *s, const Trie *tt );
-
-/* TTSearchNodeRelease
- *  releases a reference, and potentially the object
- */
-void TTSearchNodeRelease ( TTSearchNode *s );
-
-/* TTSearchNodeReuseTrans
- *  if a node has no other references,
- *  destructs and re-initializes the node for reuse.
- *
- *  otherwise, a new node is created.
- */
-rc_t TTSearchNodeReuseTrans ( TTSearchNode **s, const TTrans *trans );
-
-
-/*--------------------------------------------------------------------------
- * TTSearchNodeRef
- */
-typedef struct TTSearchNodeRef TTSearchNodeRef;
-struct TTSearchNodeRef
-{
-    DLNode n;
-    TTSearchNode *s;
-};
-
-/* TTSearchNodeRefMake
- */
-rc_t TTSearchNodeRefMake ( TTSearchNodeRef **ref, TTSearchNode *s );
-
-/* TTSearchNodeRefWhack
- * TTSearchNodeRefWhackAll
- */
-void TTSearchNodeRefWhack ( TTSearchNodeRef *p );
-void TTSearchNodeRefWhackAll ( DLNode *n, void *ignore );
-
-
-/*--------------------------------------------------------------------------
- * Trie
- */
-
-/* TrieMapChar
- *  maps a character to an index
- */
-uint32_t TrieMapChar ( const Trie *tt, uint32_t ch );
-
-/* TrieNextIdx
- *  pops a character from key string
- *  maps it to an index
- */
-rc_t TrieNextIdx ( const Trie *tt, String *key, uint32_t *idx );
-
-
-#endif /* _h_trie_priv_ */
diff --git a/libs/klib/trie.c b/libs/klib/trie.c
deleted file mode 100644
index b98386b..0000000
--- a/libs/klib/trie.c
+++ /dev/null
@@ -1,1486 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "trie-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <wctype.h>
-#include <errno.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * TNode
- *  a node within text tree
- */
-
-/* TNodeMake
- *  creates a TNode of variable size
- *
- *  "n" will contain the returned node
- *
- *  "size" must be at least the size of a TNode
- */
-LIB_EXPORT rc_t CC TNodeMake ( TNode **np, size_t size )
-{
-    TNode *n;
-
-    if ( np == NULL )
-        return RC ( rcCont, rcNode, rcAllocating, rcParam, rcNull );
-
-    if ( size < sizeof * n )
-        return RC ( rcCont, rcNode, rcAllocating, rcParam, rcInvalid );
-
-    n = malloc ( size );
-    if ( n == NULL )
-        return RC ( rcCont, rcNode, rcAllocating, rcMemory, rcExhausted );
-
-    * np = n;
-    return 0;
-}
-
-/* TNodeWhack
- *  performs final whacking of node
- */
-LIB_EXPORT void CC TNodeWhack ( TNode *n )
-{
-    free ( n );
-}
-
-/* TNodeCmp
- */
-static
-int CC TNodeCmp ( const void *item, const void *n )
-{
-#define a ( ( const String* ) item )
-#define b ( ( const TNode* ) n )
-
-    return StringCompare ( a, & b -> key );
-
-#undef a
-#undef b
-}
-
-/* TNodeSort
- */
-static
-int CC TNodeSort ( const BSTNode *item, const BSTNode *n )
-{
-#define a ( ( const TNode* ) item )
-#define b ( ( const TNode* ) n )
-
-    return StringCompare ( & a -> key, & b -> key );
-
-#undef a
-#undef b
-}
-
-/*--------------------------------------------------------------------------
- * TTrans
- *  a text transition node
- *
- *  transitions to child nodes occur only if "tcnt" != 0 ( "child" != NULL )
- *  and are taken on the query string's character [ key . len ]
- */
-
-/* TTransMake
- */
-static
-rc_t CC TTransMake ( TTrans **tp, uint32_t depth )
-{
-    TTrans *trans = malloc ( sizeof * trans );
-    if ( trans == NULL )
-        return RC ( rcCont, rcNode, rcAllocating, rcMemory, rcExhausted );
-
-    trans -> child = NULL;
-    trans -> tcnt = trans -> vcnt = 0;
-    BSTreeInit ( & trans -> vals );
-    trans -> depth = depth;
-
-    * tp = trans;
-    return 0;
-}
-
-/* TTransForEach
- */
-void TTransForEach ( const TTrans *trans, uint32_t width,
-    void ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data )
-{
-    TTransBacktrace bt;
-    bt . par = NULL;
-    bt . trans = trans;
-    bt . idx = 0;
-
-    TTransForEachBT ( & bt, width, f, data );
-}
-
-void TTransForEachBT ( const TTransBacktrace *bt, uint32_t width,
-    void ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data )
-{
-    const TTrans *trans = bt -> trans;
-
-    if ( f != NULL )
-        ( * f ) ( bt, width, data );
-
-    assert ( trans != NULL );
-    if ( trans -> child != NULL )
-    {
-        uint32_t i;
-        TTransBacktrace child;
-        for ( child . par = bt, i = 0; i < width; ++ i )
-        {
-            if ( ( child . trans = trans -> child [ i ] ) != NULL )
-            {
-                child . idx = ( uint32_t ) i;
-                TTransForEachBT ( & child, width, f, data );
-            }
-        }
-    }
-}
-
-/* TTransDoUntil
- */
-bool TTransDoUntil ( const TTrans *trans, uint32_t width,
-    bool ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data )
-{
-    TTransBacktrace bt;
-    bt . par = NULL;
-    bt . trans = trans;
-    bt . idx = 0;
-
-    return TTransDoUntilBT ( & bt, width, f, data );
-}
-
-bool TTransDoUntilBT ( const TTransBacktrace *bt, uint32_t width,
-    bool ( CC * f ) ( const TTransBacktrace *bt, uint32_t width, void *data ), void *data )
-{
-    const TTrans *trans = bt -> trans;
-
-    if ( f != NULL )
-    {
-        if ( ( * f ) ( bt, width, data ) )
-            return true;
-    }
-
-    assert ( trans != NULL );
-    if ( trans -> child != NULL )
-    {
-        uint32_t i;
-        TTransBacktrace child;
-        for ( child . par = bt, i = 0; i < width; ++ i )
-        {
-            if ( ( child . trans = trans -> child [ i ] ) != NULL )
-            {
-                child . idx = ( uint32_t ) i;
-                if ( TTransDoUntilBT ( & child, width, f, data ) )
-                    return true;
-            }
-        }
-    }
-
-    return false;
-}
-
-/* TTransWhack
- */
-static
-void TTransWhack ( TTrans *trans, uint32_t width,
-    void ( CC * whack ) ( TNode *n, void *data ), void *data )
-{
-    if ( trans != NULL )
-    {
-        if ( trans -> child != NULL )
-        {
-            uint32_t i;
-            for ( i = 0; i < width; ++ i )
-            {
-                TTrans *child = trans -> child [ i ];
-                if ( child != NULL )
-                    TTransWhack ( child, width, whack, data );
-            }
-
-            free ( trans -> child );
-        }
-
-        BSTreeWhack ( & trans -> vals,
-            ( void ( CC * ) ( BSTNode*, void* ) ) whack, data );
-
-        free ( trans );
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * Trie
- *  a tree of text nodes
- */
-
-/* TrieInit
- *  initialize a text-tree structure
- *
- *  "accept" is a character-set string where each character
- *  represents itself. the only exception is the '-' character,
- *  which - when sandwiched between two other characters - is
- *  interpreted en tot as a range expression. an example would be
- *  "-0-9" is identical to "-0123456789"
- *
- *  "limit" sets the number of values to be accumulated in any
- *  container. if this limit would be exceeded by any insertion,
- *  the node is expanded and its values are re-distributed among
- *  its children.
- *
- *  if "cs_expand" is 1, then any valid characters observed
- *  during insertions are automatically added to the accept
- *  character set. doing so will ensure that there are no
- *  ambiguous transitions.
- *
- *  returns status codes:
- *    0      => success
- *    EINVAL => an invalid parameter
- *    ENOMEM => failed to allocate internal structures
- *    EDOM   => either the limit was too high or the accept string too wide
- */
-LIB_EXPORT rc_t CC TrieInit ( Trie *tt, const char *accept,
-    uint32_t limit, bool cs_expand )
-{
-    int ch_len;
-    const char *src, *end;
-
-    uint32_t ch, ch2;
-    uint32_t first, last, width;
-
-    uint16_t *map;
-    uint32_t *rmap;
-
-    if ( tt == NULL )
-        return RC ( rcCont, rcTrie, rcConstructing, rcSelf, rcNull );
-
-    if ( accept == NULL )
-        return RC ( rcCont, rcTrie, rcConstructing, rcString, rcNull );
-
-    if ( accept [ 0 ] == 0 )
-        return RC ( rcCont, rcTrie, rcConstructing, rcString, rcEmpty );
-
-    if ( ( limit >> 16 ) != 0 )
-        return RC ( rcCont, rcTrie, rcConstructing, rcParam, rcExcessive );
-
-    memset ( tt, 0, sizeof * tt );
-    tt -> limit = ( uint16_t ) limit;
-    tt -> cs_expand = cs_expand;
-
-    /* determine width of accept string
-       N.B. we don't detect overlaps at this point */
-    src = accept;
-    end = src + strlen ( accept );
-
-    for ( last = 0, first = ~ 0; src < end; )
-    {
-        /* get a character */
-        ch_len = utf8_utf32 ( & ch, src, end );
-        if ( ch_len <= 0 )
-            return RC ( rcCont, rcTrie, rcConstructing, rcChar, rcInvalid );
-        src += ch_len;
-
-        /* this character represents itself */
-        if ( ch < first )
-            first = ch;
-        if ( ch > last )
-            last = ch;
-
-        /* check for a range expression */
-        if ( src < end && src [ 0 ] == '-' )
-        {
-            ch_len = utf8_utf32 ( & ch2, ++ src, end );
-            if ( ch_len <= 0 )
-                return RC ( rcCont, rcTrie, rcConstructing, rcChar, rcInvalid );
-            src += ch_len;
-
-            /* this character represents
-               hopefully a reasonable range */
-            if ( ch2 < ch )
-                return RC ( rcCont, rcTrie, rcConstructing, rcChar, rcInvalid );
-            if ( ch2 > last )
-                last = ch2;
-        }
-    }
-
-    /* must have had something */
-    if ( last < first )
-        return RC ( rcCont, rcTrie, rcConstructing, rcString, rcInvalid );
-
-    tt -> first_char = first;
-    tt -> last_char = last;
-
-    /* create a character map of pure unknown index */
-    map = calloc ( last - first + 1, sizeof map [ 0 ] );
-    if ( map == NULL )
-        return RC ( rcCont, rcTrie, rcConstructing, rcMemory, rcExhausted );
-    tt -> map = map;
-
-    /* mark the character map */
-    for ( src = accept; src < end; )
-    {
-        /* get a character */
-        ch_len = utf8_utf32 ( & ch, src, end );
-        src += ch_len;
-
-        /* mark character */
-#if REJECT_ACCEPT_OVERLAP
-        if ( map [ ch - first ] != 0 )
-        {
-            free ( map );
-            return RC ( rcCont, rcTrie, rcConstructing, rcChar, rcInvalid );
-        }
-#endif
-        map [ ch - first ] = 1;
-
-        /* check for a range expression */
-        if ( src < end && src [ 0 ] == '-' )
-        {
-            ch_len = utf8_utf32 ( & ch2, ++ src, end );
-            src += ch_len;
-
-            /* mark range */
-            for ( ++ ch; ch <= ch2; ++ ch )
-            {
-#if REJECT_ACCEPT_OVERLAP
-                if ( map [ ch - first ] != 0 )
-                {
-                    free ( map );
-                    return RC ( rcCont, rcTrie, rcConstructing, rcChar, rcInvalid );
-                }
-#endif
-                map [ ch - first ] = 1;
-            }
-        }
-    }
-
-    /* fill in the character map and determine width */
-    for ( width = 0, ch = first; ch <= last; ++ ch )
-    {
-        if ( map [ ch - first ] != 0 )
-            map [ ch - first ] = ++ width;
-    }
-
-    /* enforce maximum width */
-    assert ( width > 0 );
-    if ( ( ++ width >> 16 ) != 0 )
-    {
-        free ( map );
-        return RC ( rcCont, rcTrie, rcConstructing, rcRange, rcExcessive );
-    }
-
-    /* record trans width accounting for unmapped slot */
-    tt -> width = ( uint16_t ) width;
-
-    /* now create a reverse map to produce characters
-       from an index */
-#if _DEBUGGING
-    rmap = calloc ( width, sizeof rmap [ 0 ] );
-#else
-    rmap = malloc ( width * sizeof rmap [ 0 ] );
-#endif
-    if ( rmap == NULL )
-    {
-        free ( map );
-        return RC ( rcCont, rcTrie, rcConstructing, rcMemory, rcExhausted );
-    }
-    tt -> rmap = rmap;
-
-    for ( rmap [ 0 ] = 0, ch = first; ch <= last; ++ ch )
-    {
-        uint32_t idx = map [ ch - first ];
-        if ( idx != 0 )
-            rmap [ idx ] = ch;
-    }
-
-    return 0;
-}
-
-/* TrieMapChar
- *  maps a character to an index
- */
-uint32_t TrieMapChar ( const Trie *tt, uint32_t ch )
-{
-    if ( ch >= tt -> first_char && ch <= tt -> last_char )
-        return tt -> map [ ch - tt -> first_char ];
-    return 0;
-}
-
-/* TrieNextIdx
- *  pops a character from key string
- *  maps it to an index
- */
-rc_t TrieNextIdx ( const Trie *tt, String *key, uint32_t *idx )
-{
-    uint32_t ch;
-    rc_t rc = StringPopHead ( key, & ch );
-    if ( rc == 0 )
-        * idx = TrieMapChar ( tt, ch );
-    return rc;
-}
-
-/* TrieAutoExpand
- *  incorporates a new character into the accept charset
- *
- *    1. extends all existing "child" arrays
- *    2. reallocs "map" if necessary, invalidating new space
- *    3. reallocs "rmap"
- *    4. installs character <-> index into map
- *    5. increments width
- *
- *  the order of execution is designed to be benign if
- *  failures occur, due only to memory exhaustion.
- */
-typedef struct AutoExpandData AutoExpandData;
-struct AutoExpandData
-{
-    rc_t rc;
-};
-
-static
-bool CC TTransAutoExpand ( const TTransBacktrace *bt, uint32_t width, void *data )
-{
-    TTrans **child, *trans = ( TTrans* ) bt -> trans;
-
-    assert ( trans != NULL );
-    if ( trans -> child == NULL )
-        return false;
-
-    child = realloc ( trans -> child, ( width + 1 ) * sizeof * child );
-    if ( child == NULL )
-    {
-        ( ( AutoExpandData* ) data ) -> rc =
-            RC ( rcCont, rcTrie, rcInserting, rcMemory, rcExhausted );
-        return true;
-    }
-
-    child [ width ] = NULL;
-    trans -> child = child;
-    return false;
-}
-
-static
-rc_t CC TrieAutoExpand ( Trie *tt, uint32_t ch )
-{
-    AutoExpandData pb;
-    pb . rc = 0;
-
-    /* extend node child arrays */
-    TTransDoUntil ( tt -> root, tt -> width, TTransAutoExpand, & pb );
-    if ( pb . rc == 0 )
-    {
-        uint16_t *map = ( uint16_t* ) tt -> map;
-        uint32_t *rmap = ( uint32_t* ) tt -> rmap;
-
-        /* realloc charset to index map if necessary */
-        if ( ch < tt -> first_char )
-        {
-            map = malloc ( ( tt -> last_char - ch + 1 ) * sizeof * map );
-            if ( map == NULL )
-                return RC ( rcCont, rcTrie, rcInserting, rcMemory, rcExhausted );
-            memset ( map, 0, ( tt -> first_char - ch ) * sizeof * map );
-            memcpy ( & map [ tt -> first_char - ch ], tt -> map,
-                ( tt -> last_char - tt -> first_char + 1 ) * sizeof * map );
-            free ( ( void* ) tt -> map );
-            tt -> first_char = ch;
-        }
-        else if ( ch > tt -> last_char )
-        {
-            map = realloc ( map, ( ch - tt -> first_char + 1 ) * sizeof * map );
-            if ( map == NULL )
-                return RC ( rcCont, rcTrie, rcInserting, rcMemory, rcExhausted );
-            memset ( & map [ tt -> last_char - tt -> first_char + 1 ], 0, ( ch - tt -> last_char ) * sizeof * map );
-            tt -> last_char = ch;
-        }
-
-        /* record any change */
-        tt -> map = map;
-
-        /* extend index to charset map */
-        rmap = realloc ( rmap, ( tt -> width + 1 ) * sizeof * rmap );
-        if ( rmap == NULL )
-            return RC ( rcCont, rcTrie, rcInserting, rcMemory, rcExhausted );
-
-        tt -> rmap = rmap;
-
-        /* it is done */
-        rmap [ tt -> width ] = ch;
-        map [ ch - tt -> first_char ] = tt -> width ++;
-    }
-
-    return pb . rc;
-}
-
-/* TrieValidateRemainder
- *  ensures that all characters remaining in key
- *  are valid and, in the case of expanding the char set,
- *  are in the character set.
- */
-static
-rc_t CC TrieValidateRemainder ( Trie *tt, const String *key )
-{
-    rc_t rc;
-    String rem = * key;
-
-    while ( 1 )
-    {
-        uint32_t ch;
-        rc = StringPopHead ( & rem, & ch );
-        if ( GetRCState ( rc ) == rcEmpty )
-            return 0;
-
-        if ( tt -> cs_expand )
-        {
-            uint32_t idx = TrieMapChar ( tt, ch );
-            if ( idx == 0 )
-            {
-                /* get the new width */
-                uint16_t width = tt -> width + 1;
-                
-                /* get a new value for idx */
-                idx = tt -> width;
-                
-                /* make sure the expansion would not exceed
-                   the 16 bit limit on array width */
-                if ( width == 0 )
-                {
-                    rc = RC ( rcCont, rcTrie, rcInserting, rcRange, rcExcessive );
-                    break;
-                }
-                
-                /* incorporate the character */
-                rc = TrieAutoExpand ( tt, ch );
-                if ( rc != 0 )
-                    break;
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* TrieExplodeTrans
- *  a TTrans has exceeded its limit of TNode values
- */
-typedef struct ExplodeTransData ExplodeTransData;
-struct ExplodeTransData
-{
-    const Trie *tt;
-    TTrans *trans;
-    size_t tsize;
-    uint32_t tcnt;
-    uint32_t cnt;
-    rc_t rc;
-    bool over;
-};
-
-static
-bool CC CreateKids ( BSTNode *n, void *data )
-{
-    ExplodeTransData *pb = data;
-    TNode *item = ( TNode* ) n;
-    const TTrans *trans = pb -> trans;
-
-    if ( item -> key . len > trans -> depth )
-    {
-        uint32_t idx;
-        String key = item -> key;
-        const Trie *tt = pb -> tt;
-
-        /* perform a sub-string based upon
-           knowledge that the entry key matches
-           the first "trans->depth" characters */
-        key . addr += pb -> tsize;
-        key . len -= trans -> depth;
-        key . size -= pb -> tsize;
-
-        /* get the next transition index */
-        pb -> rc = TrieNextIdx ( tt, & key, & idx );
-        if ( pb -> rc != 0 )
-            return true;
-
-        /* test the transition */
-        assert ( trans -> child != NULL );
-        if ( trans -> child [ idx ] == NULL )
-        {
-            /* create the transition */
-            pb -> rc = TTransMake ( & trans -> child [ idx ], trans -> depth + 1 );
-            if ( pb -> rc != 0 )
-                return false;
-
-            ++ pb -> tcnt;
-        }
-
-#if _DEBUGGING
-        /* accounting for non-terminal key */
-        ++ pb -> cnt;
-#else
-        /* early exit */
-        if ( ++ pb -> cnt == trans -> tcnt )
-            return true;
-#endif
-    }
-
-    return false;
-}
-
-static
-bool CC WhackKids ( BSTNode *n, void *data )
-{
-    ExplodeTransData *pb = data;
-    TNode *item = ( TNode* ) n;
-    const TTrans *trans = pb -> trans;
-
-    if ( item -> key . len > trans -> depth )
-    {
-        TTrans *child;
-        uint32_t idx;
-        String key = item -> key;
-        const Trie *tt = pb -> tt;
-
-        /* perform a sub-string based upon
-           knowledge that the entry key matches
-           the first "trans->depth" characters */
-        key . addr += pb -> tsize;
-        key . len -= trans -> depth;
-        key . size -= pb -> tsize;
-
-        /* get the next transition character */
-        pb -> rc = TrieNextIdx ( tt, & key, & idx );
-        if ( pb -> rc != 0 )
-            return false;
-
-        /* test the transition - due to early
-           exit on error from child creation,
-           as well as from this function, we can
-           assert that this transition is not NULL */
-        assert ( trans -> child != NULL );
-        assert ( trans -> child [ idx ] != NULL );
-        child = trans -> child [ idx ];
-
-        /* if the child is totally empty, it was just
-           created and should be doused */
-        if ( child -> tcnt + child -> vcnt == 0 )
-        {
-            free ( child );
-            trans -> child [ idx ] = NULL;
-
-#if _DEBUGGING
-            /* not strictly required, because no changes
-               have been committed yet */
-            -- pb -> tcnt;
-#else
-            /* early exit when there could be no further work */
-            if ( -- pb -> tcnt == 0 )
-                return true;
-#endif
-        }
-
-        /* mandatory early exit when we detect limit */
-        if ( -- pb -> cnt == 0 )
-            return true;
-    }
-
-    return false;
-}
-
-static
-bool CC MoveKids ( BSTNode *n, void *data )
-{
-    ExplodeTransData *pb = data;
-    TNode *item = ( TNode* ) n;
-    TTrans *trans = pb -> trans;
-
-    if ( item -> key . len > trans -> depth )
-    {
-        TTrans *child;
-        uint32_t idx;
-        String key = item -> key;
-        const Trie *tt = pb -> tt;
-
-        /* perform a sub-string based upon
-           knowledge that the entry key matches
-           the first "trans->depth" characters */
-        key . addr += pb -> tsize;
-        key . len -= trans -> depth;
-        key . size -= pb -> tsize;
-
-        /* get the next transition character */
-        pb -> rc = TrieNextIdx ( tt, & key, & idx );
-        assert ( pb -> rc == 0 );
-
-        /* test the transition */
-        assert ( trans -> child != NULL );
-        assert ( trans -> child [ idx ] != NULL );
-        child = trans -> child [ idx ];
-
-        /* pop this guy from its current location */
-        BSTreeUnlink ( & trans -> vals, & item -> n );
-
-        /* insert into its new location */
-        pb -> rc = BSTreeInsert ( & child -> vals, & item -> n, TNodeSort );
-        assert ( pb -> rc == 0 );
-
-        if ( item -> key . len == child -> depth )
-            ++ child -> vcnt;
-        else
-            ++ child -> tcnt;
-
-        /* detect an over-limit child */
-        assert ( child -> child == NULL );
-        if ( child -> tcnt != 0 && ( child -> tcnt + child -> vcnt > tt -> limit ) )
-            pb -> over = true;
-
-#if _DEBUGGING
-        ++ pb -> cnt;
-#else
-        /* early exit */
-        if ( ++ pb -> cnt == trans -> tcnt )
-            return true;
-#endif
-    }
-
-    return false;
-}
-
-static
-rc_t CC TrieExplodeTrans ( const Trie *tt, TTrans *trans, size_t tsize )
-{
-    rc_t rc;
-    ExplodeTransData pb;
-
-    /* create a child array */
-    assert ( trans -> child == NULL );
-    trans -> child = calloc ( tt -> width, sizeof trans -> child [ 0 ] );
-    if ( trans -> child == NULL )
-        return RC ( rcCont, rcTrie, rcInserting, rcMemory, rcExhausted );
-
-    /* loop data structure */
-    pb . tt = tt;
-    pb . trans = trans;
-    pb . tsize = tsize;
-    pb . tcnt = 0;
-    pb . cnt = 0;
-    pb . rc = 0;
-
-    /* create new child nodes */
-    BSTreeDoUntil ( & trans -> vals, 0, CreateKids, & pb );
-    assert ( pb . tcnt <= tt -> width );
-    rc = pb . rc;
-
-    /* roll-back changes on error */
-    if ( rc != 0 && pb . cnt != trans -> tcnt )
-    {
-        if ( pb . tcnt != 0 )
-        {
-            BSTreeDoUntil ( & trans -> vals, 0, WhackKids, & pb );
-            assert ( pb . tcnt == 0 );
-        }
-
-        free ( trans -> child );
-        trans -> child = NULL;
-
-        return rc;
-    }
-
-    /* commit changes */
-    pb . cnt = 0;
-    pb . over = false;
-
-    BSTreeDoUntil ( & trans -> vals, 0, MoveKids, & pb );
-    assert ( pb . rc == 0 );
-    assert ( pb . cnt == trans -> tcnt );
-
-    assert ( pb . tcnt <= tt -> width );
-    trans -> tcnt = pb . tcnt;
-
-    /* handle over-limit kids */
-    if ( pb . over )
-    {
-        uint32_t i;
-        for ( i = 0; i < tt -> width; ++ i )
-        {
-            TTrans *child = trans -> child [ i ];
-            if ( trans -> child [ i ] != NULL )
-            {
-                assert ( child -> child == NULL );
-                if ( child -> tcnt != 0 && ( child -> tcnt + child -> vcnt > tt -> limit ) )
-                {
-                    /* re-calculate transition key string size */
-                    uint32_t ch;
-                    const TNode *item = ( const TNode* ) child -> vals . root;
-                    String key = item -> key;
-
-                    key . addr += tsize;
-                    key . len -= trans -> tcnt;
-                    key . size -= tsize;
-
-                    rc = StringPopHead ( & key, & ch );
-                    assert ( rc == 0 );
-
-                    rc = TrieExplodeTrans ( tt, child, item -> key . size - key . size );
-                    if ( rc != 0 )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* TrieInsertEngine
- *  inserts an item into tree
- *
- *  "item" is a TNode with an embedded key string.
- *
- *  "exist" is an optional return parameter for prior nodes
- *  and indicates whether to insert unique or not
- *
- *  returns status codes:
- *    0      => success
- *    EINVAL => an invalid parameter
- *    ENOMEM => failed to allocate internal structures
- */
-static
-rc_t CC TrieInsertEngine ( Trie *tt, TNode *item, TNode **exist )
-{
-    rc_t rc;
-    String key;
-    TTrans *trans;
-
-    /* quick parameter check */
-    if ( tt == NULL )
-        return RC ( rcCont, rcTrie, rcInserting, rcSelf, rcNull );
-    if ( item == NULL )
-        return RC ( rcCont, rcTrie, rcInserting, rcParam, rcNull );
-    if ( item -> key . len == 0 )
-        return RC ( rcCont, rcTrie, rcInserting, rcString, rcEmpty );
-
-    /* starting key */
-    key = item -> key;
-
-    /* get the root TTrans */
-    if ( tt -> root == NULL )
-    {
-        rc = TTransMake ( & tt -> root, 0 );
-        if ( rc != 0 )
-            return rc;
-    }
-    trans = tt -> root;
-
-    while ( 1 )
-    {
-        /* if there is a child array and the key is non-terminal */
-        if ( trans -> child != NULL && trans -> depth < item -> key . len )
-        {
-            /* get transition character and index */
-            uint32_t ch, idx;
-            rc = StringPopHead ( & key, & ch );
-            if ( rc != 0 )
-                break;
-            idx = TrieMapChar ( tt, ch );
-
-            /* check for auto-expand on unmapped character */
-            if ( idx == 0 && tt -> cs_expand )
-            {
-                /* get the new width */
-                uint16_t width = tt -> width + 1;
-
-                /* get a new value for idx */
-                idx = tt -> width;
-
-                /* make sure the expansion would not exceed
-                   the 16 bit limit on array width */
-                if ( width == 0 )
-                {
-                    rc = RC ( rcCont, rcTrie, rcInserting, rcRange, rcExcessive );
-                    break;
-                }
-                rc = TrieAutoExpand ( tt, ch );
-                if ( rc != 0 )
-                    break;
-            }
-
-            /* take transition if there */
-            if ( trans -> child [ idx ] != NULL )
-            {
-                trans = trans -> child [ idx ];
-                continue;
-            }
-
-            /* create new transition */
-            rc = TTransMake ( & trans -> child [ idx ], trans -> depth + 1 );
-            if ( rc != 0 )
-                break;
-
-            /* account for and take the new transition */
-            ++ trans -> tcnt;
-            trans = trans -> child [ idx ];
-        }
-
-        /* item should never be shorter than node */
-        assert ( trans -> depth <= item -> key . len );
-        if ( trans -> depth < item -> key . len )
-        {
-            rc = TrieValidateRemainder ( tt, & key );
-            if ( rc != 0 )
-                break;
-        }
-
-        /* going to install into value tree */
-        if ( exist == NULL )
-            rc = BSTreeInsert ( & trans -> vals, & item -> n, TNodeSort );
-        else
-        {
-            rc = BSTreeInsertUnique ( & trans -> vals,
-                & item -> n, ( BSTNode** ) exist, TNodeSort );
-        }
-        if ( rc == 0 )
-        {
-            /* account for type of insert */
-            if ( trans -> depth == item -> key . len )
-                ++ trans -> vcnt;
-            else
-                ++ trans -> tcnt;
-
-            /* now test for overflow */
-            if ( trans -> child == NULL && trans -> tcnt != 0 )
-            {
-                if ( trans -> vcnt + trans -> tcnt > tt -> limit )
-                {
-                    /* it's time to convert to a full transition node */
-                    TrieExplodeTrans ( tt, trans, item -> key . size - key . size );
-                }
-            }
-        }
-        break;
-    }
-
-#if _DEBUGGING && 0
-    if ( rc == 0 && tt -> validate )
-        rc = TTransValidate ( tt -> root, tt );
-#endif
-
-    return rc;
-}
-
-/* TrieInsert
- *  inserts an item into tree
- *
- *  "item" is a TNode with an embedded key string.
- *
- *  returns status codes:
- *    0      => success
- *    EINVAL => an invalid parameter
- *    ENOMEM => failed to allocate internal structures
- */
-LIB_EXPORT rc_t CC TrieInsert ( Trie *tt, TNode *item )
-{
-    return TrieInsertEngine ( tt, item, NULL );
-}
-
-/* TrieInsertUnique
- *  behaves like TrieInsert and returns 0 if insert succeeded
- *
- *  if insert failed with a return value of EEXIST, the existing
- *  object is returned in "exist".
- */
-LIB_EXPORT rc_t CC TrieInsertUnique ( Trie *tt, TNode *item, TNode **exist )
-{
-    TNode *dummy;
-    if ( exist == NULL )
-        exist = & dummy;
-
-    return TrieInsertEngine ( tt, item, exist );
-}
-
-/* TrieFindTrans
- */
-static
-rc_t CC TrieFindTrans ( const Trie *tt, TTrans *trans, const String *item, TTrans **buffer )
-{
-    String key = * item;
-
-    while ( trans -> child != NULL )
-    {
-        rc_t rc;
-        uint32_t idx;
-
-        assert ( trans -> tcnt != 0 );
-
-        rc = TrieNextIdx ( tt, & key, & idx );
-	/* This might actually happen if the trie has more internal
-	   nodes than one might think, and the string is short 
-	   (i.e. it terminates in an "internal" node */
-	/* This needs to know the reconstructed RC for better readability */
-	if (rc == RC( rcText, rcChar, rcRemoving, rcString, rcEmpty ) ) {
-	  *buffer = trans;
-	  return 0;
-	}
-        if ( rc != 0 )
-	  return rc;
-
-        if ( trans -> child [ idx ] == NULL )
-            break;
-
-        trans = trans -> child [ idx ];
-    }
-
-    * buffer = trans;
-    return 0;
-}
-
-/* TrieFindTransChain
- *  finds chain of TTrans objects having single transitions
- *
- *  explanation and justification:
- *
- *  - when TrieUnlink removes the last bucket from a value BSTree,
- *    the containing TTrans node may become empty and should be
- *    collected.
- *
- *  - to collect a TTrans object, a backlink to its parent or a
- *    forward list from parent(s) to node are required, in order
- *    to remove the parents' outgoing transition to the dead node.
- *
- *  - backlinks have been excluded from the design for many reasons,
- *    among them the expense of 64 bit pointers. a list of forward
- *    transitions only requires a head and tail, since the internal
- *    transitions are found with the key and may be recovered with
- *    the same key.
- *
- *  - this chain is defined as the head and tail of a list having
- *    a single line of transitions eminating from a remaining parent,
- *    such that "head" will be the deepest parent in the chain having
- *    a vcnt + tcnt > 1, or NULL if none are found. all subsequent nodes
- *    will be subject to collection.
- */
-static
-rc_t CC TrieFindTransChain ( const Trie *tt, TTrans *trans,
-    const String *item, TTrans **head, TTrans **tail )
-{
-    String key = * item;
-
-    * head = NULL;
-
-    while ( trans -> child != NULL )
-    {
-        rc_t rc;
-        uint32_t idx;
-
-        assert ( trans -> tcnt != 0 );
-
-        rc = TrieNextIdx ( tt, & key, & idx );
-        if ( rc != 0 )
-            return rc;
-
-        /* detect end of line */
-        if ( trans -> child [ idx ] == NULL )
-            break;
-
-        /* record new head */
-        if ( trans -> tcnt + trans -> vcnt > 1 )
-            * head = trans;
-
-        /* take transition */
-        trans = trans -> child [ idx ];
-    }
-
-    * tail = trans;
-    return 0;
-}
-
-/* TrieUnlink
- *  remove an object from the tree
- *
- *  returns "true" if node was actually removed from tree
- */
-LIB_EXPORT bool CC TrieUnlink ( Trie *tt, TNode *item )
-{
-    if ( tt != NULL && item != NULL && tt -> root != NULL )
-    {
-        TTrans *head, *tail;
-        rc_t rc = TrieFindTransChain ( tt, tt -> root, & item -> key, & head, & tail );
-        if ( rc == 0 && BSTreeUnlink ( & tail -> vals, & item -> n ) )
-        {
-            assert ( item -> key . len >= tail -> depth );
-            if ( item -> key . len == tail -> depth )
-            {
-                assert ( tail -> vcnt > 0 );
-                -- tail -> vcnt;
-            }
-            else
-            {
-                assert ( tail -> tcnt > 0 );
-                -- tail -> tcnt;
-            }
-
-            /* check for need to whack TTrans */
-            if ( tail -> vcnt + tail -> tcnt == 0 )
-            {
-                String key;
-                TTrans *trans;
-                uint32_t idx;
-
-                if ( head == NULL )
-                {
-                    /* going to whack everything */
-                    key = item -> key;
-                    trans = tt -> root;
-                }
-                else
-                {
-                    /* remove the leading characters of the key */
-                    StringSubstr ( & item -> key, & key, head -> depth, 0 );
-                    rc = TrieNextIdx ( tt, & key, & idx );
-                    assert ( rc == 0 );
-                    assert ( head -> child != NULL );
-                    trans = head -> child [ idx ];
-
-                    /* sever the transition */
-                    assert ( trans != NULL );
-                    head -> child [ idx ] = NULL;
-                    assert ( head -> vcnt > 0 );
-                    -- head -> vcnt;
-                }
-
-                /* whack all of the trans nodes down to tail */
-                while ( 1 )
-                {
-                    TTrans *next;
-
-                    /* get the next character index */
-                    rc = TrieNextIdx ( tt, & key, & idx );
-                    assert ( rc == 0 );
-
-                    /* get the next node */
-                    assert ( trans -> child != NULL );
-                    next = trans -> child [ idx ];
-                    assert ( next != NULL );
-
-                    /* whack the current node */
-                    assert ( trans -> vcnt + trans -> tcnt == 0 );
-                    assert ( trans -> vals . root == NULL );
-                    free ( trans -> child );
-                    free ( trans );
-
-                    /* get out if this was the tail */
-                    if ( trans == tail )
-                        break;
-
-                    /* take the next transition */
-                    trans = next;
-                }
-            }
-
-            return true;
-        }
-    }
-
-    return false;
-}
-
-/* TrieFind
- *  find a single object within tree
- *
- *  "item" is an exact match text string
- *
- *  returns an arbitrarily selected TNode* from matching set
- *  or NULL if none found.
- */
-LIB_EXPORT TNode * CC TrieFind ( const Trie *tt, const String *item )
-{
-    if ( tt != NULL && item != NULL && tt -> root != NULL && item -> len != 0 )
-    {
-        TTrans *trans;
-        rc_t rc = TrieFindTrans ( tt, tt -> root, item, & trans );
-	if (rc == 0)
-        {
-	    return ( TNode* ) BSTreeFind ( & trans -> vals, item,
-                ( int ( CC * ) ( const void*, const BSTNode* ) ) TNodeCmp );
-	}
-    }
-
-    return NULL;
-}
-
-/* TrieFindAll
- *  find multiple objects within tree
- *
- *  "item" is an exact match text string
- *
- *  "buffer" is a user-supplied array of TNode* with a
- *  capacity of "capacity" elements. if successful, the
- *  entire found set will be returned unordered within.
- *
- *  "num_found" ( out ) indicates the size of the found set,
- *  regardless of return value, such that if the supplied
- *  buffer were to be too small, the required size is returned.
- *
- *  returns status codes:
- *    0       => success
- *    EINVAL  => an invalid parameter
- *    ENOENT  => the found set was empty
- *    ENOBUFS => the found set was too large
- */
-LIB_EXPORT rc_t CC TrieFindAll ( const Trie *tt, const String *item,
-    TNode *buffer [], uint32_t capacity,
-    uint32_t *num_found )
-{
-    rc_t rc;
-    TTrans *trans;
-    uint32_t count;
-
-    if ( tt == NULL )
-        return RC ( rcCont, rcTrie, rcSelecting, rcSelf, rcNull );
-    if ( item == NULL )
-        return RC ( rcCont, rcTrie, rcSelecting, rcString, rcNull );
-    if ( item -> len == 0 )
-        return RC ( rcCont, rcTrie, rcSelecting, rcString, rcEmpty );
-
-    if ( buffer == NULL && capacity != 0 )
-        return RC ( rcCont, rcTrie, rcSelecting, rcBuffer, rcNull );
-
-    count = 0;
-
-    rc = TrieFindTrans ( tt, tt -> root, item, & trans );
-    if ( rc == 0 )
-    {
-        TNode *node = ( TNode* ) BSTreeFind ( & trans -> vals, item,
-            ( int ( CC * ) ( const void*, const BSTNode* ) ) TNodeCmp );
-        if ( node == NULL )
-            rc = RC ( rcCont, rcTrie, rcSelecting, rcString, rcNotFound );
-        else
-        {
-            TNode *nbr;
-
-            /* back up as far as we can */
-            for ( nbr = ( TNode* ) BSTNodePrev ( & node -> n );
-                  nbr != NULL && StringEqual ( & nbr -> key, item );
-                  nbr = ( TNode* ) BSTNodePrev ( & node -> n ) )
-            {
-                ++ count;
-                node = nbr;
-            }
-
-            /* recover to original point */
-            if ( count != 0 )
-            {
-                uint32_t i;
-                for ( i = 0; i < count; ++ i )
-                {
-                    if ( i < capacity )
-                        buffer [ i ] = node;
-                    node = ( TNode* ) BSTNodeNext ( & node -> n );
-                }
-            }
-
-            /* count the original */
-            if ( count < capacity )
-                buffer [ count ] = node;
-
-            /* now continue forward */
-            for ( ++ count, node = ( TNode* ) BSTNodeNext ( & node -> n );
-                  node != NULL && StringEqual ( & node -> key, item );
-                  ++ count, node = ( TNode* ) BSTNodeNext ( & node -> n ) )
-            {
-                if ( count < capacity )
-                    buffer [ count ] = node;
-            }
-
-            /* detect no buffer space */
-            if ( count > capacity )
-                rc = RC ( rcCont, rcTrie, rcSelecting, rcBuffer, rcInsufficient );
-        }
-    }
-
-    if ( num_found != NULL )
-        * num_found = count;
-
-    return rc;
-}
-
-/* TrieForEach
- *  executes a function on each tree element
- */
-typedef struct TrieForEachData TrieForEachData;
-struct TrieForEachData
-{
-    void ( CC * f ) ( TNode*, void* );
-    void *data;
-};
-
-static
-void CC TrieForEachElem ( const TTransBacktrace *bt, uint32_t width, void *data )
-{
-    const TTrans *trans = bt -> trans;
-    TrieForEachData *pb = data;
-    if ( trans -> vals . root != NULL )
-    {
-        BSTreeForEach ( & trans -> vals, 0,
-            ( void ( CC * ) ( BSTNode*, void* ) ) pb -> f, pb -> data );
-    }
-}
-
-LIB_EXPORT void CC TrieForEach ( const Trie *tt,
-    void ( CC * f ) ( TNode *n, void *data ), void *data )
-{
-    if ( tt != NULL && tt -> root != NULL )
-    {
-        TrieForEachData pb;
-        pb . f = f;
-        pb . data = data;
-        TTransForEach ( tt -> root, tt -> width, TrieForEachElem, & pb );
-    }
-}
-
-/* TrieDoUntil
- *  executes a function on each tree element
- *  until the function returns true
- */
-typedef struct TrieDoUntilData TrieDoUntilData;
-struct TrieDoUntilData
-{
-    bool ( CC * f ) ( TNode*, void* );
-    void *data;
-};
-
-static
-bool CC TrieDoUntilElem ( const TTransBacktrace *bt, uint32_t width, void *data )
-{
-    const TTrans *trans = bt -> trans;
-    TrieDoUntilData *pb = data;
-    if ( trans -> vals . root != NULL )
-    {
-        return BSTreeDoUntil ( & trans -> vals, 0,
-            ( bool ( CC * ) ( BSTNode*, void* ) ) pb -> f, pb -> data );
-    }
-    return false;
-}
-
-LIB_EXPORT bool CC TrieDoUntil ( const Trie *tt,
-    bool ( CC * f ) ( TNode *n, void *data ), void *data )
-{
-    if ( tt != NULL && tt -> root != NULL )
-    {
-        TrieDoUntilData pb;
-        pb . f = f;
-        pb . data = data;
-        return TTransDoUntil ( tt -> root, tt -> width, TrieDoUntilElem, & pb );
-    }
-    return false;
-}
-
-/* TrieExplore
- *  executes a function on each element in the path of the key
- *  from furthest node to closest node
- *  until the function returns true or end of chain
- */
-typedef struct TrieExploreData_struct {
-    bool ( CC * f ) ( TNode*, void* );
-    void *data;
-    const String* item;
-} TrieExploreData;
-
-static
-bool CC TrieExploreBSTree( BSTNode *n, void *data )
-{
-    TrieExploreData* pb = data;
-    TNode* node = (TNode*)n;
-    String sub = *pb->item;
-    sub.len = node->key.len;
-
-    if( StringCompare(&node->key, &sub) == 0 ) {
-        if( pb->f(node, pb->data) ) {
-            return true;
-        }
-    }
-    return false;
-}
-
-static
-bool CC TrieExploreTrans( const Trie *tt, TTrans *trans, String *key, TrieExploreData* data)
-{
-    /* first dive deeper if possible */
-    while( trans->child != NULL ) {
-        uint32_t idx;
-        if( TrieNextIdx(tt, key, &idx) != 0 ) {
-            break;
-        }
-        if( trans->child[idx] != NULL ) {
-            /* do not recur if current trans has no values */
-            if( trans->vcnt > 0 ) {
-                if( TrieExploreTrans(tt, trans->child[idx], key, data) ) {
-                    return true;
-                }
-                break;
-            } else {
-                trans = trans->child[idx];
-            }
-        }
-    }
-    /* than search local BSTree on the way out */
-    return BSTreeDoUntil(&trans->vals, true, TrieExploreBSTree, data);
-}
-
-LIB_EXPORT bool CC TrieExplore( const Trie *tt, const String *item, 
-    bool ( CC * f ) ( TNode *n, void *data ), void *data )
-{
-    if ( tt != NULL && item != NULL && tt->root != NULL && item->len != 0 ) {
-        TrieExploreData pb;
-        String key = *item;
-        pb.f = f;
-        pb.data = data;
-        pb.item = item;
-        return TrieExploreTrans(tt, tt->root, &key, &pb);
-    }
-    return false;
-}
-
-/* TrieWhack
- *  tears down internal structure
- *
- *  any parameter, including"tt," may be NULL
- */
-LIB_EXPORT void CC TrieWhack ( Trie *tt,
-    void ( CC * whack ) ( TNode *n, void *data ), void *data )
-{
-    if ( tt != NULL )
-    {
-        if ( tt -> root != NULL )
-            TTransWhack ( tt -> root, tt -> width, whack, data );
-
-        free ( ( void* ) tt -> map );
-        free ( ( void* ) tt -> rmap );
-    }
-}
diff --git a/libs/klib/trieval.c b/libs/klib/trieval.c
deleted file mode 100644
index 539a70d..0000000
--- a/libs/klib/trieval.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "trie-priv.h"
-#include <klib/log.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <wctype.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * TTrans
- *  a text transition node
- *
- *  transitions to child nodes occur only if "tcnt" != 0 ( "child" != NULL )
- *  and are taken on the query string's character [ key . len ]
- */
-
-/* TTransValidate
- */
-typedef struct TTValNodeCntData TTValNodeCntData;
-struct TTValNodeCntData
-{
-    unsigned int depth;
-    unsigned int vcnt;
-    unsigned int tcnt;
-};
-
-static
-void CC TTransCountTNodes ( BSTNode *n, void *data )
-{
-    TTValNodeCntData *pb = data;
-    const TNode *node = ( const TNode* ) n;
-
-    if ( strlen ( node -> key . addr ) == pb -> depth )
-        ++ pb -> vcnt;
-    else
-        ++ pb -> tcnt;
-}
-
-/* TTransValidate
- *  recursively checks structure
- */
-LIB_EXPORT int CC TTransValidate ( const TTrans *trans, const Trie *tt )
-{
-    int status = 0;
-
-    TTValNodeCntData pb;
-    unsigned int i, width;
-
-    width = tt -> width;
-
-    pb . depth = trans -> depth;
-    pb . vcnt = pb . tcnt = 0;
-
-    /* count transition array */
-    if ( trans -> child != NULL )
-    {
-        for ( i = 0; i < width; ++ i )
-        {
-            if ( trans -> child [ i ] != NULL )
-                ++ pb . tcnt;
-        }
-    }
-
-    /* count value tree */
-    BSTreeForEach ( & trans -> vals, 0, TTransCountTNodes, & pb );
-
-    /* check validity */
-    if ( pb . tcnt != trans -> tcnt )
-    {
-        LOGERR ( status = EINVAL, "bad trans -> tcnt => %u, should be %u",
-                 trans -> tcnt, pb . tcnt );
-    }
-
-    /* should have a non-zero tcnt if has child array */
-    else if ( pb . tcnt == 0 && trans -> child != NULL )
-    {
-        LOGERR ( status = EINVAL, "empty trans -> child", NULL ); /* 3rd parameter is wrong so far... */
-    }
-
-    if ( pb . vcnt != trans -> vcnt )
-    {
-        LOGERR ( status = EINVAL, "bad trans -> vcnt => %u, should be %u",
-                 trans -> vcnt, pb . vcnt );
-    }
-
-    if ( trans -> child == NULL && pb . tcnt != 0 )
-    {
-        if ( pb . tcnt + pb . vcnt > tt -> limit )
-        {
-            /*
-            LOGMSG ( "WARNING: over-limit actual value count => %u, should be %u\n",
-                 pb . tcnt + pb . vcnt, tt -> limit );
-           */
-            LOGMSG ( status = EINVAL, "WARNING: over-limit actual value count => %u, should be %u\n" );
-        }
-    }
-
-    if ( status == 0 && trans -> child != NULL )
-    {
-        for ( i = 0; i < width; ++ i )
-        {
-            const TTrans *child = trans -> child [ i ];
-            if ( child != NULL )
-            {
-                if ( child -> depth != trans -> depth + 1 )
-                {
-                    LOGERR ( status = EINVAL, "bad trans -> depth => %u, should be %u",
-                             child -> depth, trans -> depth + 1 );
-                }
-                else
-                {
-                    int err = TTransValidate ( child, tt );
-                    if ( status == 0 )
-                        status = err;
-                }
-            }
-        }
-    }
-
-    return status;
-}
-
-/*--------------------------------------------------------------------------
- * Trie
- *  a tree of text nodes
- */
-
-/* TrieValidate
- *  run validation check on tree structure
- */
-LIB_EXPORT int CC TrieValidate ( const Trie *tt )
-{
-    if ( tt == NULL )
-        return EINVAL;
-    if ( tt -> root == NULL )
-        return 0;
-    return TTransValidate ( tt -> root, tt );
-}
diff --git a/libs/klib/unix/syserrcode.c b/libs/klib/unix/syserrcode.c
deleted file mode 100644
index df2ab60..0000000
--- a/libs/klib/unix/syserrcode.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "writer-priv.h"
-#include <klib/writer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <os-native.h> /* for strchrnul on non-linux */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-
-size_t KWrtFmt_error_code ( char * buffer, size_t buffer_size, uint32_t error_code )
-{
-    /* this either returns char * or int - we don't really care
-     * if it fails as slong as it put something into the buffer */
-    strerror_r ((int)error_code, buffer, buffer_size);
-    return string_size (buffer);
-}
diff --git a/libs/klib/unix/syslog.c b/libs/klib/unix/syslog.c
deleted file mode 100644
index 16aa4ad..0000000
--- a/libs/klib/unix/syslog.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "log-priv.h"
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-
-/* LogTimestamp
- *  generates a timestamp string
- */
-
-LIB_EXPORT rc_t CC LogTimestamp ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    int len;
-    static time_t last_time = 0;
-    static struct tm cal;
-    
-    /* get current time */
-    time_t t = time ( 0 );
-    
-    /* initialize time on first run */
-    if ( ! last_time )
-    {
-        last_time = t;
-        gmtime_r ( & last_time, & cal );
-    }
-    
-    /* or update if time has passed */
-    else if ( t != last_time )
-    {
-        /* update every 5 minutes or so */
-        time_t dt = t - last_time;
-        last_time = t;
-        if ( dt >= 300 )
-            gmtime_r ( & last_time, & cal );
-	
-        /* otherwise, just update the struct manually */
-        else
-        {
-            /* advance seconds */
-            dt += cal . tm_sec;
-            cal . tm_sec = ( int ) ( dt % 60 );
-	    
-            /* detect a rolled-over minute */
-            if ( ( dt /= 60 ) != 0 )
-            {
-                /* advance minutes */
-                dt += cal . tm_min;
-                cal . tm_min = ( int ) ( dt % 60 );
-		
-                /* detect a rolled-over hour */
-                if ( ( dt /= 60 ) != 0 )
-                {
-                    /* roll-over of an hour - refetch */
-                    gmtime_r ( & last_time, & cal );
-                }
-            }
-        }
-    }
-    
-    /* make the timestamp */
-    len = snprintf ( buffer, bsize,
-                     "%04d-%02d-%02dT%02d:%02d:%02d"
-                     , cal . tm_year + 1900
-                     , cal . tm_mon + 1
-                     , cal . tm_mday
-                     , cal . tm_hour
-                     , cal . tm_min
-                     , cal . tm_sec
-        );
-
-    if ( num_writ != NULL )
-        * num_writ = len;
-
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 && num_writ != NULL )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-
-    return 0;
-}
-
-/* LogSimpleTimestamp
- *  generates a local timestamp string without time zone
- */
-LIB_EXPORT rc_t CC LogSimpleTimestamp ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    int len;
-    static time_t last_time = 0;
-    static struct tm cal;
-    
-    /* get current time */
-    time_t t = time ( 0 );
-    
-    /* initialize time on first run */
-    if ( ! last_time )
-    {
-        last_time = t;
-        localtime_r ( & last_time, & cal );
-    }
-    
-    /* or update if time has passed */
-    else if ( t != last_time )
-    {
-        /* update every 5 minutes or so */
-        time_t dt = t - last_time;
-        last_time = t;
-        if ( dt >= 300 )
-            localtime_r ( & last_time, & cal );
-
-        /* otherwise, just update the struct manually */
-        else
-        {
-            /* advance seconds */
-            dt += cal . tm_sec;
-            cal . tm_sec = ( int ) ( dt % 60 );
-
-            /* detect a rolled-over minute */
-            if ( ( dt /= 60 ) != 0 )
-            {
-                /* advance minutes */
-                dt += cal . tm_min;
-                cal . tm_min = ( int ) ( dt % 60 );
-
-                /* detect a rolled-over hour */
-                if ( ( dt /= 60 ) != 0 )
-                {
-                    /* roll-over of an hour - refetch */
-                    localtime_r ( & last_time, & cal );
-                }
-            }
-        }
-    }
-    
-    /* make the timestamp */
-    len = snprintf ( buffer, bsize,
-                     "%04d-%02d-%02dT%02d:%02d:%02d"
-                     , cal . tm_year + 1900
-                     , cal . tm_mon + 1
-                     , cal . tm_mday
-                     , cal . tm_hour
-                     , cal . tm_min
-                     , cal . tm_sec
-        );
-    if ( num_writ != NULL )
-        * num_writ = len;
-
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 && num_writ != NULL )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-
-    return 0;
-}
-
-/* LogPID
- *  generates a process id
- */
-LIB_EXPORT rc_t CC LogPID ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    /* pid_t is signed not unsigned int */
-    int len = snprintf ( buffer, bsize, "%d", getpid () );
-    * num_writ = len;
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-    return 0;
-}
-
diff --git a/libs/klib/unix/systime.c b/libs/klib/unix/systime.c
deleted file mode 100644
index 09b9b90..0000000
--- a/libs/klib/unix/systime.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/time.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <time.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KTime_t
- *  64 bit time_t
- */
-
-
-/* Stamp
- *  current timestamp
- */
-LIB_EXPORT KTime_t CC KTimeStamp ( void )
-{
-    return time ( NULL );
-}
-
-
-/*--------------------------------------------------------------------------
- * KTime
- *  simple time structure
- */
-
-
-/* Make
- *  make KTime from struct tm
- */
-static
-void KTimeMake ( KTime *kt, struct tm const *t )
-{
-    kt -> year = t -> tm_year + 1900;
-    kt -> month = t -> tm_mon;
-    kt -> day = t -> tm_mday - 1;
-    kt -> weekday = t -> tm_wday;
-#if !defined(__SunOS)  &&  !defined(__sun__)
-    kt -> tzoff = ( int16_t ) ( t -> tm_gmtoff / 60 );
-#endif
-    kt -> hour = ( uint8_t ) t -> tm_hour;
-    kt -> minute = ( uint8_t ) t -> tm_min;
-    kt -> second = ( uint8_t ) t -> tm_sec;
-    kt -> dst = t -> tm_isdst != 0;
-}
-
-
-/* Local
- *  populate "kt" from "ts" in local time zone
- */
-LIB_EXPORT const KTime* CC KTimeLocal ( KTime *kt, KTime_t ts )
-{
-    if ( kt != NULL )
-    {
-        struct tm t;
-        time_t unix_time = ( time_t ) ts;
-        localtime_r ( & unix_time, & t );
-        KTimeMake ( kt, & t );
-    }
-    return kt;
-}
-
-
-/* Global
- *  populate "kt" from "ts" in GMT
- */
-LIB_EXPORT const KTime* CC KTimeGlobal ( KTime *kt, KTime_t ts )
-{
-    if ( kt != NULL )
-    {
-        struct tm t;
-        time_t unix_time = ( time_t ) ts;
-        gmtime_r ( & unix_time, & t );
-        KTimeMake ( kt, & t );
-    }
-    return kt;
-}
diff --git a/libs/klib/unix/syswriter.c b/libs/klib/unix/syswriter.c
deleted file mode 100644
index 93df60c..0000000
--- a/libs/klib/unix/syswriter.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include "writer-priv.h"
-#include <klib/text.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-static int unix_stdout = 1;
-static int unix_stderr = 2;
-
-rc_t KWrtSysInit(void** h_stdout, void** h_stderr)
-{
-    if( h_stdout ) {
-        *h_stdout = &unix_stdout;
-    }
-    if( h_stderr ) {
-        *h_stderr = &unix_stderr;
-    }
-    return 0;
-}
-
-/* ----
- * write 'count' bytes starting at 'buf'  to a "stream/file" identified by 'fd'
- */
-rc_t CC KWrt_DefaultWriter ( void * self, const char * buffer, size_t bufsize, size_t * num_writ )
-{
-    size_t total;
-    size_t remaining;
-    ssize_t num_written;
-    const char * pbyte;
-    int handle;
-    rc_t rc;
-
-    handle = *(int*)self;
-    pbyte = buffer;
-    rc = 0;
-
-    total = 0;
-    for (remaining = bufsize; remaining > 0; remaining -= num_written)
-    {
-        num_written = write (handle, pbyte, remaining);
-        if (num_written < 0)
-        {
-            switch (errno)
-            {
-            case ENOSPC:
-                rc = RC ( rcApp, rcLog, rcWriting, rcStorage, rcExhausted );
-                break;
-            case EINTR:
-                num_written = 0;
-                break;
-            case EFBIG:
-                rc = RC ( rcApp, rcLog, rcWriting, rcFile, rcExcessive );
-                break;
-            case EIO:
-                rc = RC ( rcApp, rcLog, rcWriting, rcTransfer, rcUnknown );
-                break;
-            case EBADF:
-                rc = RC ( rcApp, rcLog, rcWriting, rcFileDesc, rcInvalid );
-                break;
-            case EINVAL:
-                rc = RC ( rcApp, rcLog, rcWriting, rcParam, rcInvalid );
-                break;
-            default:
-                rc = RC ( rcApp, rcLog, rcWriting, rcNoObj, rcUnknown );
-                break;
-            }
-            if (rc)
-                break;
-        }
-        else
-            total += num_written;
-    }
-    *num_writ = total;
-    return rc;
-}
-
-void print_int_fixup ( char * fmt, size_t * len, size_t max )
-{
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     * In windows we can't just return like this but instead:
-     *    save fmt[len-1]
-     *    replace 'j' with I64
-     *    replace 'z' or 't',  with 'I'
-     *    replace 'hh' with 'h'
-     *    append saved fmt[len-1] to its new place.
-     *
-     */
-    if (*len > 3)
-    {
-        if ((fmt[*len-3] == 'l') &&
-            (fmt[*len-2] == 'l'))
-        {
-            --*len;
-            fmt[*len-2] = 'j';
-            fmt[*len-1] = fmt[*len];
-            fmt[*len] = '\0';
-        }
-    }
-    else if (*len > 2)
-    {
-        /* -----
-         * replace an 'l' with a 'j'
-         * on 32 bit l is 32 bits and j is 64 bits
-         * on 64 bit l is 64 bits and j is 64 bits
-         * so we want the one that is the same on both
-         * we are not otherwise "fixing" the format for bad specifications
-         * just this ambiguous specification.
-         */
-        if (fmt[*len-2] == 'l')
-            fmt[*len-2] = 'j';
-    }
-    return;
-}
-
-void print_float_fixup ( char * fmt, size_t * len, size_t max )
-{
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     */
-    return;
-}
-
-void print_char_fixup ( char * fmt, size_t * len, size_t max )
-{
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     */
-    return;
-}
diff --git a/libs/klib/unpack.c b/libs/klib/unpack.c
deleted file mode 100644
index 73b343b..0000000
--- a/libs/klib/unpack.c
+++ /dev/null
@@ -1,833 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/pack.h>
-#include <klib/rc.h>
-#include <arch-impl.h>
-#include <sysalloc.h>
-
-#include <endian.h>
-#include <byteswap.h>
-#include <string.h>
-#include <assert.h>
-
-#if ! defined __LITTLE_ENDIAN && ! defined __BIG_ENDIAN
-#error "only little and big endian architectures are supported"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * unpack
- */
-
-/* READ_PACKED
- *  macro to read source elements into register
- *  casts source pointer to appropriate type
- *  performs byte swap if necessary to ensure that
- *    elements are in reverse order
- */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define READ_PACKED32( src, idx ) \
-    bswap_32 ( ( ( const uint32_t* ) ( src ) ) [ idx ] )
-#define READ_PACKED64( src, idx ) \
-    bswap_64 ( ( ( const uint64_t* ) ( src ) ) [ idx ] )
-#else
-#define READ_PACKED32( src, idx ) \
-    ( ( const uint32_t* ) ( src ) ) [ idx ]
-#define READ_PACKED64( src, idx ) \
-    ( ( const uint64_t* ) ( src ) ) [ idx ]
-#endif
-
-/* WRITE_UNPACKED
- *  macro to write destination elements from register
- *  casts destination pointer to appropriate type
- *  performs byte swap if necessary to ensure that
- *    elements are in original stream order
- */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define WRITE_UNPACKED8( out, dst, idx ) \
-    ( ( uint64_t* ) ( dst ) ) [ idx ] = ( out )
-#else
-#define WRITE_UNPACKED8( out, dst, idx ) \
-    ( ( uint64_t* ) ( dst ) ) [ idx ] = bswap_64 ( out )
-#endif
-uint8_t unpack_8_from_2_arr[256][4]={
-{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,0,3},
-{0,0,1,0},{0,0,1,1},{0,0,1,2},{0,0,1,3},
-{0,0,2,0},{0,0,2,1},{0,0,2,2},{0,0,2,3},
-{0,0,3,0},{0,0,3,1},{0,0,3,2},{0,0,3,3},
-{0,1,0,0},{0,1,0,1},{0,1,0,2},{0,1,0,3},
-{0,1,1,0},{0,1,1,1},{0,1,1,2},{0,1,1,3},
-{0,1,2,0},{0,1,2,1},{0,1,2,2},{0,1,2,3},
-{0,1,3,0},{0,1,3,1},{0,1,3,2},{0,1,3,3},
-{0,2,0,0},{0,2,0,1},{0,2,0,2},{0,2,0,3},
-{0,2,1,0},{0,2,1,1},{0,2,1,2},{0,2,1,3},
-{0,2,2,0},{0,2,2,1},{0,2,2,2},{0,2,2,3},
-{0,2,3,0},{0,2,3,1},{0,2,3,2},{0,2,3,3},
-{0,3,0,0},{0,3,0,1},{0,3,0,2},{0,3,0,3},
-{0,3,1,0},{0,3,1,1},{0,3,1,2},{0,3,1,3},
-{0,3,2,0},{0,3,2,1},{0,3,2,2},{0,3,2,3},
-{0,3,3,0},{0,3,3,1},{0,3,3,2},{0,3,3,3},
-{1,0,0,0},{1,0,0,1},{1,0,0,2},{1,0,0,3},
-{1,0,1,0},{1,0,1,1},{1,0,1,2},{1,0,1,3},
-{1,0,2,0},{1,0,2,1},{1,0,2,2},{1,0,2,3},
-{1,0,3,0},{1,0,3,1},{1,0,3,2},{1,0,3,3},
-{1,1,0,0},{1,1,0,1},{1,1,0,2},{1,1,0,3},
-{1,1,1,0},{1,1,1,1},{1,1,1,2},{1,1,1,3},
-{1,1,2,0},{1,1,2,1},{1,1,2,2},{1,1,2,3},
-{1,1,3,0},{1,1,3,1},{1,1,3,2},{1,1,3,3},
-{1,2,0,0},{1,2,0,1},{1,2,0,2},{1,2,0,3},
-{1,2,1,0},{1,2,1,1},{1,2,1,2},{1,2,1,3},
-{1,2,2,0},{1,2,2,1},{1,2,2,2},{1,2,2,3},
-{1,2,3,0},{1,2,3,1},{1,2,3,2},{1,2,3,3},
-{1,3,0,0},{1,3,0,1},{1,3,0,2},{1,3,0,3},
-{1,3,1,0},{1,3,1,1},{1,3,1,2},{1,3,1,3},
-{1,3,2,0},{1,3,2,1},{1,3,2,2},{1,3,2,3},
-{1,3,3,0},{1,3,3,1},{1,3,3,2},{1,3,3,3},
-{2,0,0,0},{2,0,0,1},{2,0,0,2},{2,0,0,3},
-{2,0,1,0},{2,0,1,1},{2,0,1,2},{2,0,1,3},
-{2,0,2,0},{2,0,2,1},{2,0,2,2},{2,0,2,3},
-{2,0,3,0},{2,0,3,1},{2,0,3,2},{2,0,3,3},
-{2,1,0,0},{2,1,0,1},{2,1,0,2},{2,1,0,3},
-{2,1,1,0},{2,1,1,1},{2,1,1,2},{2,1,1,3},
-{2,1,2,0},{2,1,2,1},{2,1,2,2},{2,1,2,3},
-{2,1,3,0},{2,1,3,1},{2,1,3,2},{2,1,3,3},
-{2,2,0,0},{2,2,0,1},{2,2,0,2},{2,2,0,3},
-{2,2,1,0},{2,2,1,1},{2,2,1,2},{2,2,1,3},
-{2,2,2,0},{2,2,2,1},{2,2,2,2},{2,2,2,3},
-{2,2,3,0},{2,2,3,1},{2,2,3,2},{2,2,3,3},
-{2,3,0,0},{2,3,0,1},{2,3,0,2},{2,3,0,3},
-{2,3,1,0},{2,3,1,1},{2,3,1,2},{2,3,1,3},
-{2,3,2,0},{2,3,2,1},{2,3,2,2},{2,3,2,3},
-{2,3,3,0},{2,3,3,1},{2,3,3,2},{2,3,3,3},
-{3,0,0,0},{3,0,0,1},{3,0,0,2},{3,0,0,3},
-{3,0,1,0},{3,0,1,1},{3,0,1,2},{3,0,1,3},
-{3,0,2,0},{3,0,2,1},{3,0,2,2},{3,0,2,3},
-{3,0,3,0},{3,0,3,1},{3,0,3,2},{3,0,3,3},
-{3,1,0,0},{3,1,0,1},{3,1,0,2},{3,1,0,3},
-{3,1,1,0},{3,1,1,1},{3,1,1,2},{3,1,1,3},
-{3,1,2,0},{3,1,2,1},{3,1,2,2},{3,1,2,3},
-{3,1,3,0},{3,1,3,1},{3,1,3,2},{3,1,3,3},
-{3,2,0,0},{3,2,0,1},{3,2,0,2},{3,2,0,3},
-{3,2,1,0},{3,2,1,1},{3,2,1,2},{3,2,1,3},
-{3,2,2,0},{3,2,2,1},{3,2,2,2},{3,2,2,3},
-{3,2,3,0},{3,2,3,1},{3,2,3,2},{3,2,3,3},
-{3,3,0,0},{3,3,0,1},{3,3,0,2},{3,3,0,3},
-{3,3,1,0},{3,3,1,1},{3,3,1,2},{3,3,1,3},
-{3,3,2,0},{3,3,2,1},{3,3,2,2},{3,3,2,3},
-{3,3,3,0},{3,3,3,1},{3,3,3,2},{3,3,3,3},
-};
-uint8_t unpack_8_from_1_arr[256][8]={
-{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,1},{0,0,0,0,0,0,1,0},{0,0,0,0,0,0,1,1},
-{0,0,0,0,0,1,0,0},{0,0,0,0,0,1,0,1},{0,0,0,0,0,1,1,0},{0,0,0,0,0,1,1,1},
-{0,0,0,0,1,0,0,0},{0,0,0,0,1,0,0,1},{0,0,0,0,1,0,1,0},{0,0,0,0,1,0,1,1},
-{0,0,0,0,1,1,0,0},{0,0,0,0,1,1,0,1},{0,0,0,0,1,1,1,0},{0,0,0,0,1,1,1,1},
-{0,0,0,1,0,0,0,0},{0,0,0,1,0,0,0,1},{0,0,0,1,0,0,1,0},{0,0,0,1,0,0,1,1},
-{0,0,0,1,0,1,0,0},{0,0,0,1,0,1,0,1},{0,0,0,1,0,1,1,0},{0,0,0,1,0,1,1,1},
-{0,0,0,1,1,0,0,0},{0,0,0,1,1,0,0,1},{0,0,0,1,1,0,1,0},{0,0,0,1,1,0,1,1},
-{0,0,0,1,1,1,0,0},{0,0,0,1,1,1,0,1},{0,0,0,1,1,1,1,0},{0,0,0,1,1,1,1,1},
-{0,0,1,0,0,0,0,0},{0,0,1,0,0,0,0,1},{0,0,1,0,0,0,1,0},{0,0,1,0,0,0,1,1},
-{0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,1},{0,0,1,0,0,1,1,0},{0,0,1,0,0,1,1,1},
-{0,0,1,0,1,0,0,0},{0,0,1,0,1,0,0,1},{0,0,1,0,1,0,1,0},{0,0,1,0,1,0,1,1},
-{0,0,1,0,1,1,0,0},{0,0,1,0,1,1,0,1},{0,0,1,0,1,1,1,0},{0,0,1,0,1,1,1,1},
-{0,0,1,1,0,0,0,0},{0,0,1,1,0,0,0,1},{0,0,1,1,0,0,1,0},{0,0,1,1,0,0,1,1},
-{0,0,1,1,0,1,0,0},{0,0,1,1,0,1,0,1},{0,0,1,1,0,1,1,0},{0,0,1,1,0,1,1,1},
-{0,0,1,1,1,0,0,0},{0,0,1,1,1,0,0,1},{0,0,1,1,1,0,1,0},{0,0,1,1,1,0,1,1},
-{0,0,1,1,1,1,0,0},{0,0,1,1,1,1,0,1},{0,0,1,1,1,1,1,0},{0,0,1,1,1,1,1,1},
-{0,1,0,0,0,0,0,0},{0,1,0,0,0,0,0,1},{0,1,0,0,0,0,1,0},{0,1,0,0,0,0,1,1},
-{0,1,0,0,0,1,0,0},{0,1,0,0,0,1,0,1},{0,1,0,0,0,1,1,0},{0,1,0,0,0,1,1,1},
-{0,1,0,0,1,0,0,0},{0,1,0,0,1,0,0,1},{0,1,0,0,1,0,1,0},{0,1,0,0,1,0,1,1},
-{0,1,0,0,1,1,0,0},{0,1,0,0,1,1,0,1},{0,1,0,0,1,1,1,0},{0,1,0,0,1,1,1,1},
-{0,1,0,1,0,0,0,0},{0,1,0,1,0,0,0,1},{0,1,0,1,0,0,1,0},{0,1,0,1,0,0,1,1},
-{0,1,0,1,0,1,0,0},{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,1,0},{0,1,0,1,0,1,1,1},
-{0,1,0,1,1,0,0,0},{0,1,0,1,1,0,0,1},{0,1,0,1,1,0,1,0},{0,1,0,1,1,0,1,1},
-{0,1,0,1,1,1,0,0},{0,1,0,1,1,1,0,1},{0,1,0,1,1,1,1,0},{0,1,0,1,1,1,1,1},
-{0,1,1,0,0,0,0,0},{0,1,1,0,0,0,0,1},{0,1,1,0,0,0,1,0},{0,1,1,0,0,0,1,1},
-{0,1,1,0,0,1,0,0},{0,1,1,0,0,1,0,1},{0,1,1,0,0,1,1,0},{0,1,1,0,0,1,1,1},
-{0,1,1,0,1,0,0,0},{0,1,1,0,1,0,0,1},{0,1,1,0,1,0,1,0},{0,1,1,0,1,0,1,1},
-{0,1,1,0,1,1,0,0},{0,1,1,0,1,1,0,1},{0,1,1,0,1,1,1,0},{0,1,1,0,1,1,1,1},
-{0,1,1,1,0,0,0,0},{0,1,1,1,0,0,0,1},{0,1,1,1,0,0,1,0},{0,1,1,1,0,0,1,1},
-{0,1,1,1,0,1,0,0},{0,1,1,1,0,1,0,1},{0,1,1,1,0,1,1,0},{0,1,1,1,0,1,1,1},
-{0,1,1,1,1,0,0,0},{0,1,1,1,1,0,0,1},{0,1,1,1,1,0,1,0},{0,1,1,1,1,0,1,1},
-{0,1,1,1,1,1,0,0},{0,1,1,1,1,1,0,1},{0,1,1,1,1,1,1,0},{0,1,1,1,1,1,1,1},
-{1,0,0,0,0,0,0,0},{1,0,0,0,0,0,0,1},{1,0,0,0,0,0,1,0},{1,0,0,0,0,0,1,1},
-{1,0,0,0,0,1,0,0},{1,0,0,0,0,1,0,1},{1,0,0,0,0,1,1,0},{1,0,0,0,0,1,1,1},
-{1,0,0,0,1,0,0,0},{1,0,0,0,1,0,0,1},{1,0,0,0,1,0,1,0},{1,0,0,0,1,0,1,1},
-{1,0,0,0,1,1,0,0},{1,0,0,0,1,1,0,1},{1,0,0,0,1,1,1,0},{1,0,0,0,1,1,1,1},
-{1,0,0,1,0,0,0,0},{1,0,0,1,0,0,0,1},{1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,1},
-{1,0,0,1,0,1,0,0},{1,0,0,1,0,1,0,1},{1,0,0,1,0,1,1,0},{1,0,0,1,0,1,1,1},
-{1,0,0,1,1,0,0,0},{1,0,0,1,1,0,0,1},{1,0,0,1,1,0,1,0},{1,0,0,1,1,0,1,1},
-{1,0,0,1,1,1,0,0},{1,0,0,1,1,1,0,1},{1,0,0,1,1,1,1,0},{1,0,0,1,1,1,1,1},
-{1,0,1,0,0,0,0,0},{1,0,1,0,0,0,0,1},{1,0,1,0,0,0,1,0},{1,0,1,0,0,0,1,1},
-{1,0,1,0,0,1,0,0},{1,0,1,0,0,1,0,1},{1,0,1,0,0,1,1,0},{1,0,1,0,0,1,1,1},
-{1,0,1,0,1,0,0,0},{1,0,1,0,1,0,0,1},{1,0,1,0,1,0,1,0},{1,0,1,0,1,0,1,1},
-{1,0,1,0,1,1,0,0},{1,0,1,0,1,1,0,1},{1,0,1,0,1,1,1,0},{1,0,1,0,1,1,1,1},
-{1,0,1,1,0,0,0,0},{1,0,1,1,0,0,0,1},{1,0,1,1,0,0,1,0},{1,0,1,1,0,0,1,1},
-{1,0,1,1,0,1,0,0},{1,0,1,1,0,1,0,1},{1,0,1,1,0,1,1,0},{1,0,1,1,0,1,1,1},
-{1,0,1,1,1,0,0,0},{1,0,1,1,1,0,0,1},{1,0,1,1,1,0,1,0},{1,0,1,1,1,0,1,1},
-{1,0,1,1,1,1,0,0},{1,0,1,1,1,1,0,1},{1,0,1,1,1,1,1,0},{1,0,1,1,1,1,1,1},
-{1,1,0,0,0,0,0,0},{1,1,0,0,0,0,0,1},{1,1,0,0,0,0,1,0},{1,1,0,0,0,0,1,1},
-{1,1,0,0,0,1,0,0},{1,1,0,0,0,1,0,1},{1,1,0,0,0,1,1,0},{1,1,0,0,0,1,1,1},
-{1,1,0,0,1,0,0,0},{1,1,0,0,1,0,0,1},{1,1,0,0,1,0,1,0},{1,1,0,0,1,0,1,1},
-{1,1,0,0,1,1,0,0},{1,1,0,0,1,1,0,1},{1,1,0,0,1,1,1,0},{1,1,0,0,1,1,1,1},
-{1,1,0,1,0,0,0,0},{1,1,0,1,0,0,0,1},{1,1,0,1,0,0,1,0},{1,1,0,1,0,0,1,1},
-{1,1,0,1,0,1,0,0},{1,1,0,1,0,1,0,1},{1,1,0,1,0,1,1,0},{1,1,0,1,0,1,1,1},
-{1,1,0,1,1,0,0,0},{1,1,0,1,1,0,0,1},{1,1,0,1,1,0,1,0},{1,1,0,1,1,0,1,1},
-{1,1,0,1,1,1,0,0},{1,1,0,1,1,1,0,1},{1,1,0,1,1,1,1,0},{1,1,0,1,1,1,1,1},
-{1,1,1,0,0,0,0,0},{1,1,1,0,0,0,0,1},{1,1,1,0,0,0,1,0},{1,1,1,0,0,0,1,1},
-{1,1,1,0,0,1,0,0},{1,1,1,0,0,1,0,1},{1,1,1,0,0,1,1,0},{1,1,1,0,0,1,1,1},
-{1,1,1,0,1,0,0,0},{1,1,1,0,1,0,0,1},{1,1,1,0,1,0,1,0},{1,1,1,0,1,0,1,1},
-{1,1,1,0,1,1,0,0},{1,1,1,0,1,1,0,1},{1,1,1,0,1,1,1,0},{1,1,1,0,1,1,1,1},
-{1,1,1,1,0,0,0,0},{1,1,1,1,0,0,0,1},{1,1,1,1,0,0,1,0},{1,1,1,1,0,0,1,1},
-{1,1,1,1,0,1,0,0},{1,1,1,1,0,1,0,1},{1,1,1,1,0,1,1,0},{1,1,1,1,0,1,1,1},
-{1,1,1,1,1,0,0,0},{1,1,1,1,1,0,0,1},{1,1,1,1,1,0,1,0},{1,1,1,1,1,0,1,1},
-{1,1,1,1,1,1,0,0},{1,1,1,1,1,1,0,1},{1,1,1,1,1,1,1,0},{1,1,1,1,1,1,1,1},
-};
-
-static
-void CC Unpack8From2(uint8_t *dst,const uint8_t *src,int32_t count)
-{
-	if(count > 0){
-		int i;
-		for(i=0;i<count/4;i++,dst+=4,src++){
-			memcpy(dst,unpack_8_from_2_arr[*src],4);
-		}
-		for(i=0;i< (count&3);i++){
-			dst[i] = unpack_8_from_2_arr[*src][i];
-		}
-	}
-}
-static
-void CC Unpack8From1(uint8_t *dst,const uint8_t *src,int32_t count)
-{
-	if(count > 0){
-		int i;
-		for(i=0;i<count/8;i++,dst+=8,src++){
-			memcpy(dst,unpack_8_from_1_arr[*src],8);
-		}
-		for(i=0;i< (count&7);i++){
-			dst[i] = unpack_8_from_1_arr[*src][i];
-		}
-	}
-}
-
-
-
-
-/* Unpack8
- */
-static
-void CC Unpack8 ( uint32_t packed, uint32_t count, void *dst,
-    const void *src, bitsz_t src_off, bitsz_t ssize )
-{
-    uint64_t acc;
-    uint64_t out;
-    uint32_t abits;
-    uint64_t src_mask;
-    /* keep track of trailing bits */
-    uint32_t discard = (uint32_t)( ( 0 - ( ssize += src_off ) ) & 7 );
-
-
-    if(src_off == 0){
-	switch(packed){
-	 case 1:
-		Unpack8From1(dst,src,count);
-		return;
-	 case 2:
-		Unpack8From2(dst,src,count);
-		return;
-	}
-    }
-	
-
-
-    /* convert to bytes */
-    ssize = ( ssize + 7 ) >> 3;
-
-    /* first, get any stray source bytes */
-    for ( abits = 0, acc = 0; ( ssize & 3 ) != 0; abits += 8 )
-    {
-        acc <<= 8;
-        acc |= ( ( const uint8_t* ) src ) [ -- ssize ];
-    }
-
-    /* only reading 4 bytes at a time now */
-    ssize >>= 2;
-
-    /* if source size was even multiple of 4 bytes */
-    if ( abits == 0 )
-    {
-        assert ( ssize != 0 );
-        acc = READ_PACKED32 ( src, -- ssize );
-        abits = 32;
-    }
-    /* bytes were accumulated in backward order */
-    else if ( abits != 8 )
-    {
-        acc = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-    }
-
-    /* discard alignment bits */
-    if ( discard != 0 )
-    {
-        acc >>= discard;
-        abits -= discard;
-    }
-
-    /* create source mask */
-    src_mask = ( 1 << packed ) - 1;
-
-    /* write stray output bytes */
-    for ( ; ( count & 7 ) != 0; abits -= packed, acc >>= packed )
-    {
-        /* make sure there are enough source bits */
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-
-        /* write directly to destination */
-        ( ( uint8_t* ) dst ) [ -- count ] = ( uint8_t ) ( acc & src_mask );
-    }
-
-    /* accumulate into unpack register */
-    for ( count >>= 3; count != 0; abits -= packed, acc >>= packed )
-    {
-        /* bring in enough source bits */
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-
-        /* get byte in reverse order */
-        out = acc & src_mask;
-
-        /* drop packed bits */
-        abits -= packed;
-        acc >>= packed;
-
-        /* same for remaining output bytes */
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-        abits -= packed;
-        acc >>= packed;
-
-        out <<= 8;
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-        out |= acc & src_mask;
-
-        /* write output */
-        WRITE_UNPACKED8 ( out, dst, -- count );
-    }
-
-    /* should have written everything */
-    assert ( abits == 0 );
-    assert ( ssize == 0 );
-}
-
-
-/* Unpack16
- */
-static
-void CC Unpack16 ( uint32_t packed, uint32_t count, void *dst,
-    const void *src, bitsz_t src_off, bitsz_t ssize )
-{
-    uint64_t acc;
-    uint32_t abits;
-
-    uint64_t src_mask;
-    uint32_t discard = (uint32_t)( ( 0 - ( ssize += src_off ) ) & 7 );
-
-    /* convert to bytes */
-    ssize = ( ssize + 7 ) >> 3;
-
-    /* first, get any stray source bytes */
-    for ( abits = 0, acc = 0; ( ssize & 3 ) != 0; abits += 8 )
-    {
-        acc <<= 8;
-        acc |= ( ( const uint8_t* ) src ) [ -- ssize ];
-    }
-
-    /* only reading 4 bytes at a time now */
-    ssize >>= 2;
-
-    /* if source size was even multiple of 4 bytes */
-    if ( abits == 0 )
-    {
-        assert ( ssize != 0 );
-        acc = READ_PACKED32 ( src, -- ssize );
-        abits = 32;
-    }
-    /* bytes were accumulated in backward order */
-    else if ( abits != 8 )
-    {
-        acc = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-    }
-
-
-    /* discard alignment bits */
-    if ( discard != 0 )
-    {
-        assert ( discard < 8 );
-        acc >>= discard;
-        abits -= discard;
-    }
-
-    /* create write mask */
-    src_mask = ( 1 << packed ) - 1;
-
-    /* write output */
-    for ( ; count != 0; abits -= packed, acc >>= packed )
-    {
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-
-        ( ( uint16_t* ) dst ) [ -- count ] = ( uint16_t ) ( acc & src_mask );
-    }
-
-    /* should have written everything */
-    assert ( abits == 0 );
-    assert ( ssize == 0 );
-}
-
-
-/* Unpack32
- */
-static
-void CC Unpack32 ( uint32_t packed, uint32_t count, void *dst,
-    const void *src, bitsz_t src_off, bitsz_t ssize )
-{
-    uint64_t acc;
-    uint32_t abits;
-
-    uint64_t src_mask;
-    uint32_t discard = (uint32_t)( ( 0 - ( ssize += src_off ) ) & 7 );
-
-    /* convert to bytes */
-    ssize = ( ssize + 7 ) >> 3;
-
-    /* first, get any stray source bytes */
-    for ( abits = 0, acc = 0; ( ssize & 3 ) != 0; abits += 8 )
-    {
-        acc <<= 8;
-        acc |= ( ( const uint8_t* ) src ) [ -- ssize ];
-    }
-
-    /* only reading 4 bytes at a time now */
-    ssize >>= 2;
-
-    /* if source size was even multiple of 4 bytes */
-    if ( abits == 0 )
-    {
-        assert ( ssize != 0 );
-        acc = READ_PACKED32 ( src, -- ssize );
-        abits = 32;
-    }
-    /* bytes were accumulated in backward order */
-    else if ( abits != 8 )
-    {
-        acc = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-    }
-
-    /* discard alignment bits */
-    if ( discard != 0 )
-    {
-        assert ( discard < 8 );
-        acc >>= discard;
-        abits -= discard;
-    }
-
-    /* create write mask */
-    src_mask = ( 1 << packed ) - 1;
-
-    /* write output */
-    for ( ; count != 0; abits -= packed, acc >>= packed )
-    {
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-
-        ( ( uint32_t* ) dst ) [ -- count ] = ( uint32_t ) ( acc & src_mask );
-    }
-
-    /* should have written everything */
-    assert ( abits == 0 );
-    assert ( ssize == 0 );
-}
-
-
-/* Unpack64a
- *  packed size <= 32
- */
-static
-void CC Unpack64a ( uint32_t packed, uint32_t count, void *dst,
-    const void *src, bitsz_t src_off, bitsz_t ssize )
-{
-    uint64_t acc;
-    uint32_t abits;
-
-    uint64_t src_mask;
-    uint32_t discard = (uint32_t)( ( 0 - ( ssize += src_off ) ) & 7 );
-
-    /* convert to bytes */
-    ssize = ( ssize + 7 ) >> 3;
-
-    /* first, get any stray source bytes */
-    for ( abits = 0, acc = 0; ( ssize & 3 ) != 0; abits += 8 )
-    {
-        acc <<= 8;
-        acc |= ( ( const uint8_t* ) src ) [ -- ssize ];
-    }
-
-    /* only reading 4 bytes at a time now */
-    ssize >>= 2;
-
-    /* if source size was even multiple of 4 bytes */
-    if ( abits == 0 )
-    {
-        assert ( ssize != 0 );
-        acc = READ_PACKED32 ( src, -- ssize );
-        abits = 32;
-    }
-    /* bytes were accumulated in backward order */
-    else if ( abits != 8 )
-    {
-        acc = bswap_32 ( ( uint32_t ) ( acc << ( 32 - abits ) ) );
-    }
-
-    /* discard alignment bits */
-    if ( discard != 0 )
-    {
-        assert ( discard < 8 );
-        acc >>= discard;
-        abits -= discard;
-    }
-
-    /* create write mask */
-    src_mask = ( 1 << packed ) - 1;
-
-    /* write output */
-    for ( ; count != 0; abits -= packed, acc >>= packed )
-    {
-        if ( abits < packed )
-        {
-            assert ( ssize != 0 );
-            acc |= ( uint64_t ) READ_PACKED32 ( src, -- ssize ) << abits;
-            abits += 32;
-            assert ( abits >= packed );
-        }
-
-        ( ( uint64_t* ) dst ) [ -- count ] = acc & src_mask;
-    }
-
-    /* should have written everything */
-    assert ( abits == 0 );
-    assert ( ssize == 0 );
-}
-
-
-/* Unpack64b
- *  packed size > 32
- */
-static
-void CC Unpack64b ( uint32_t packed, uint32_t count, void *dst,
-    const void *src, bitsz_t src_off, bitsz_t ssize )
-{
-    uint128_t acc;
-    uint32_t abits;
-
-    uint64_t src_mask;
-    uint32_t discard = (uint32_t)( ( 0 - ( ssize += src_off ) ) & 7 );
-
-    /* convert to bytes */
-    ssize = ( ssize + 7 ) >> 3;
-
-    /* probably still don't support native 128 bit */
-    uint128_sethi ( & acc, 0 );
-    uint128_setlo ( & acc, 0 );
-
-    /* first, get any stray source bytes */
-    for ( abits = 0; ( ssize & 7 ) != 0; abits += 8 )
-    {
-        uint128_shl ( & acc, 8 );
-        uint128_orlo ( & acc, ( ( const uint8_t* ) src ) [ -- ssize ] );
-    }
-
-    /* only reading 8 bytes at a time now */
-    ssize >>= 3;
-
-    /* if source size was even multiple of 4 bytes */
-    if ( abits == 0 )
-    {
-        assert ( ssize != 0 );
-        uint128_setlo ( & acc, READ_PACKED64 ( src, -- ssize ) );
-        abits = 64;
-    }
-    /* bytes were accumulated in backward order */
-    else if ( abits != 8 )
-    {
-        uint128_setlo ( & acc, bswap_64 ( uint128_lo ( & acc ) << ( 64 - abits ) ) );
-    }
-
-    /* discard alignment bits */
-    if ( discard != 0 )
-    {
-        assert ( discard < 8 );
-        uint128_shr ( & acc, discard );
-        abits -= discard;
-    }
-
-    /* create write mask */
-    src_mask = ( ( uint64_t ) 1U << packed ) - 1;
-
-    /* write output */
-    for ( ; count != 0; abits -= packed, uint128_shr ( & acc, packed ) )
-    {
-        if ( abits < packed )
-        {
-            uint128_t in;
-            assert ( ssize != 0 );
-            uint128_sethi ( & in, 0 );
-            uint128_setlo ( & in, READ_PACKED64 ( src, -- ssize ) );
-            uint128_shl ( & in, abits );
-            uint128_or ( & acc, & in );
-            abits += 64;
-            assert ( abits >= packed );
-        }
-
-        ( ( uint64_t* ) dst ) [ -- count ] = uint128_lo ( & acc ) & src_mask;
-    }
-
-    /* should have written everything */
-    assert ( abits == 0 );
-    assert ( ssize == 0 );
-}
-
-
-/* Unpack
- *  accepts a series of packed source bits
- *  produces a series of unpacked destination bits by left-padding zeros
- *
- *  "packed" [ IN ] - packed element size in bits
- *
- *  "unpacked [ IN ] - original element size in bits
- *  must be >= "packed" and
- *  must be in 2^^[3..6], i.e. { 8, 16, 32, 64 }
- *
- *  "src" [ IN ] and "src_off" [ IN ] - source buffer
- *  bit address
- *
- *  "ssize" [ IN ] - number of bits in "src", not including "src_off"
- *
- *  "consumed" [ OUT, NULL OKAY ] - number of source bits
- *  consumed. if NULL, then all source bits MUST be consumed
- *  or an error will be generated.
- *
- *  "dst" [ OUT ] and "dsize" [ IN ] - destination buffer
- *  where size is given in bytes
- *
- *  "usize" [ OUT ] - resultant unpacked size in bytes
- *
- * NB - "src" and "dst" may have same address since
- *  the implementation unpacks from right to left, smaller to larger
- */
-LIB_EXPORT rc_t CC Unpack ( uint32_t packed, uint32_t unpacked,
-    const void *src, bitsz_t src_off, bitsz_t ssize, bitsz_t *consumed,
-    void *dst, size_t dsize, size_t *usize )
-{
-    uint32_t count;
-
-    /* prepare for failure */
-    if ( consumed != NULL )
-        * consumed = 0;
-
-    /* validate output param */
-    if ( usize == NULL )
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcParam, rcNull );
-    * usize = 0;
-
-    /* require power of 2 with value between 8 and 64 */
-    if ( ( ( unpacked - 1 ) & unpacked ) != 0 ||
-         unpacked < 8 || unpacked > 64 )
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcParam, rcInvalid );
-
-    /* validate remaining params */
-    if ( unpacked < packed || packed == 0 )
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcParam, rcInvalid );
-
-    if ( ssize == 0 )
-        return 0;
-
-    if ( src == NULL )
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcParam, rcNull );
-
-    src = & ( ( const char* ) src ) [ src_off >> 3 ];
-    src_off &= 7;
-
-    /* required destination buffer size */
-    count = ( uint32_t ) ( ssize / packed );
-    if ( count == 0 )
-        return 0;
-    * usize = ( (size_t)count * unpacked ) >> 3;
-
-    if ( dsize < * usize )
-    {
-        if ( consumed == NULL )
-            return RC ( rcXF, rcBuffer, rcUnpacking, rcBuffer, rcInsufficient );
-
-        count = (uint32_t)( dsize / ( unpacked >> 3 ) );
-        ssize = (size_t)count * packed;
-        * usize = ( (size_t)count * unpacked ) >> 3;
-    }
-
-    if ( dst == NULL )
-    {
-        * usize = 0;
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcParam, rcNull );
-    }
-
-    /* all parameters are validated */
-    if ( unpacked == 8 && packed == 8 && src_off == 0 )
-    {
-        if ( ( const void* ) dst != src )
-            memcpy ( dst, src, ssize >> 3 );
-        return 0;
-    }
-
-    /* TBD - enable unpacking from offsets */
-    if ( src_off != 0 )
-        return RC ( rcXF, rcBuffer, rcUnpacking, rcOffset, rcUnsupported );
-
-    switch ( unpacked )
-    {
-    case 8:
-        Unpack8 ( packed, count, dst, src, src_off, ssize );
-        break;
-    case 16:
-        Unpack16 ( packed, count, dst, src, src_off, ssize );
-        break;
-    case 32:
-        Unpack32 ( packed, count, dst, src, src_off, ssize );
-        break;
-    case 64:
-        if ( packed > 32 )
-            Unpack64b ( packed, count, dst, src, src_off, ssize );
-        else
-            Unpack64a ( packed, count, dst, src, src_off, ssize );
-        break;
-    }
-
-    return 0;
-}
diff --git a/libs/klib/utf8.c b/libs/klib/utf8.c
deleted file mode 100644
index 656a50b..0000000
--- a/libs/klib/utf8.c
+++ /dev/null
@@ -1,836 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <wctype.h>
-
-/*--------------------------------------------------------------------------
- * raw text strings
- */
-
-/* string_len
- *  length of string in characters
- */
-LIB_EXPORT uint32_t CC string_len ( const char *str, size_t size )
-{
-    const char *end;
-    uint32_t len = 0;
-
-    assert ( str != NULL );
-    end = str + size;
-
-    while ( str < end )
-    {
-        int c;
-
-        while ( str [ 0 ] > 0 )
-        {
-            ++ len;
-            if ( ++ str == end )
-                return len;
-        }
-
-        c = str [ 0 ];
-        if ( str [ 0 ] == 0 )
-            break;
-	
-        c = ~ c;
-        if ( c >= 0x40 )
-            break;
-	
-        if ( c >= 0x20 )
-            str += 2;
-        else if ( c >= 0x10 )
-            str += 3;
-        else if ( c >= 0x08 )
-            str += 4;
-        else if ( c >= 0x04 )
-            str += 5;
-        else if ( c >= 0x02 )
-            str += 6;
-        else
-            break;
-	
-        ++ len;
-    }
-    return len;
-}
-
-/* string_measure
- *  measures length of string in both characters and bytes
- */
-LIB_EXPORT uint32_t CC string_measure ( const char *str, size_t *size )
-{
-    const char *begin;
-    uint32_t len = 0;
-
-    assert ( str != NULL );
-
-    begin = str;
-
-    while ( 1 )
-    {
-        int c;
-
-        while ( str [ 0 ] > 0 )
-        {
-            ++ len;
-            ++ str;
-        }
-
-        c = str [ 0 ];
-        if ( str [ 0 ] == 0 )
-            break;
-	
-        c = ~ c;
-        if ( c >= 0x40 )
-            break;
-	
-        if ( c >= 0x20 )
-            str += 2;
-        else if ( c >= 0x10 )
-            str += 3;
-        else if ( c >= 0x08 )
-            str += 4;
-        else if ( c >= 0x04 )
-            str += 5;
-        else if ( c >= 0x02 )
-            str += 6;
-        else
-            break;
-	
-        ++ len;
-    }
-
-    if ( size != NULL )
-        * size = ( size_t ) ( str - begin );
-    return len;
-}
-
-/* string_copy
- *  copies whole character text into a buffer
- *  terminates with null byte if possible
- *  returns the number of bytes copied
- */
-LIB_EXPORT size_t CC string_copy ( char *dst, size_t dst_size, const char *src, size_t src_size )
-{
-    const char *send;
-    char *dend, *begin;
-
-    assert ( dst != NULL && src != NULL );
-
-    if ( dst_size < src_size )
-        src_size = dst_size;
-
-    begin = dst;
-    dend = dst + dst_size;
-    send = src + src_size;
-
-    while ( src < send )
-    {
-        uint32_t ch;
-
-        /* get a complete source character */
-        int len = utf8_utf32 ( & ch, src, send );
-        if ( len <= 0 )
-            break;
-        src += len;
-
-        /* write it to the destination */
-        len = utf32_utf8 ( dst, dend, ch );
-        if ( len <= 0 )
-            break;
-        dst += len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-
-    return ( size_t ) ( dst - begin );
-}
-
-/* string_copy_measure
- *  copies whole character text into a buffer
- *  terminates with null byte if possible
- *  returns the number of bytes copied
- */
-LIB_EXPORT size_t CC string_copy_measure ( char *dst, size_t dst_size, const char *src )
-{
-    char *dend, *begin;
-
-    assert ( dst != NULL && src != NULL );
-
-    begin = dst;
-    dend = dst + dst_size;
-
-    while ( dst < dend && src [ 0 ] != 0 )
-    {
-        uint32_t ch;
-
-        /* get a complete source character */
-        int len = utf8_utf32 ( & ch, src, src + 6 );
-        if ( len <= 0 )
-            break;
-        src += len;
-
-        /* write it to the destination */
-        len = utf32_utf8 ( dst, dend, ch );
-        if ( len <= 0 )
-            break;
-        dst += len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-
-    return ( size_t ) ( dst - begin );
-}
-
-/* tolower_copy
- *  copies whole character text in lower-case
- *  terminates with null byte if possible
- *  returns the number of bytes copied
- */
-LIB_EXPORT size_t CC tolower_copy ( char *dst, size_t dst_size, const char *src, size_t src_size )
-{
-    const char *send;
-    char *dend, *begin;
-
-    assert ( dst != NULL && src != NULL );
-
-    if ( dst_size < src_size )
-        src_size = dst_size;
-
-    begin = dst;
-    dend = dst + dst_size;
-    send = src + src_size;
-
-    while ( src < send )
-    {
-        uint32_t ch;
-
-        /* get a complete source character */
-        int len = utf8_utf32 ( & ch, src, send );
-        if ( len <= 0 )
-            break;
-        src += len;
-
-        /* lower case it */
-        ch = towlower ( ( wint_t ) ch );
-
-        /* write it to the destination */
-        len = utf32_utf8 ( dst, dend, ch );
-        if ( len <= 0 )
-            break;
-        dst += len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-
-    return ( size_t ) ( dst - begin );
-}
-
-
-/* toupper_copy
- *  copies whole character text in upper-case
- *  terminates with null byte if possible
- *  returns the number of bytes copied
- */
-LIB_EXPORT size_t CC toupper_copy ( char *dst, size_t dst_size, const char *src, size_t src_size )
-{
-    const char *send;
-    char *dend, *begin;
-
-    assert ( dst != NULL && src != NULL );
-
-    if ( dst_size < src_size )
-        src_size = dst_size;
-
-    begin = dst;
-    dend = dst + dst_size;
-    send = src + src_size;
-
-    while ( src < send )
-    {
-        uint32_t ch;
-
-        /* get a complete source character */
-        int len = utf8_utf32 ( & ch, src, send );
-        if ( len <= 0 )
-            break;
-        src += len;
-
-        /* upper case it */
-        ch = towupper ( ( wint_t ) ch );
-
-        /* write it to the destination */
-        len = utf32_utf8 ( dst, dend, ch );
-        if ( len <= 0 )
-            break;
-        dst += len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-
-    return ( size_t ) ( dst - begin );
-}
-
-/* string_cmp
- *  performs a safe strncmp
- *
- *  "max_chars" limits the extent of the comparison
- *  to not exceed supplied value, i.e. the number of
- *  characters actually compared will be the minimum
- *  of asize, bsize and max_chars.
- *
- *  if either string size ( or both ) < max_chars and
- *  all compared characters match, then the result will
- *  be a comparison of asize against bsize.
- */
-LIB_EXPORT int CC string_cmp ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars )
-{
-    uint32_t num_chars;
-    const char *aend, *bend;
-
-    assert ( a != NULL && b != NULL );
-
-    if ( max_chars == 0 )
-        return 0;
-
-    aend = a + asize;
-    bend = b + bsize;
-    num_chars = 0;
-
-    while ( a < aend && b < bend )
-    {
-        uint32_t ach, bch;
-
-        /* read a character from a */
-        int len = utf8_utf32 ( & ach, a, aend );
-        if ( len <= 0 )
-        {
-            asize -= ( size_t ) ( aend - a );
-            break;
-        }
-        a += len;
-
-        /* read a character from b */
-        len = utf8_utf32 ( & bch, b, bend );
-        if ( len <= 0 )
-        {
-            bsize -= ( size_t ) ( bend - b );
-            break;
-        }
-        b += len;
-
-        /* compare characters */
-        if ( ach != bch )
-        {
-            if ( ach < bch )
-                return -1;
-            return 1;
-        }
-
-        /* if char count is sufficient, we're done */
-        if ( ++ num_chars == max_chars )
-            return 0;
-    }
-
-    /* one or both reached end < max_chars */
-    if ( asize < bsize )
-        return -1;
-    return asize > bsize;
-}
-
-/* strcase_cmp
- *  like string_cmp except case insensitive
- */
-LIB_EXPORT int CC strcase_cmp ( const char *a, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars )
-{
-    uint32_t num_chars;
-    const char *aend, *bend;
-
-    assert ( a != NULL && b != NULL );
-
-    if ( max_chars == 0 )
-        return 0;
-
-    aend = a + asize;
-    bend = b + bsize;
-    num_chars = 0;
-
-    while ( a < aend && b < bend )
-    {
-        uint32_t ach, bch;
-
-        /* read a character from a */
-        int len = utf8_utf32 ( & ach, a, aend );
-        if ( len <= 0 )
-        {
-            asize -= ( size_t ) ( aend - a );
-            break;
-        }
-        a += len;
-
-        /* read a character from b */
-        len = utf8_utf32 ( & bch, b, bend );
-        if ( len <= 0 )
-        {
-            bsize -= ( size_t ) ( bend - b );
-            break;
-        }
-        b += len;
-
-        /* compare characters with case */
-        if ( ach != bch )
-        {
-            /* only go lower case if they differ */
-            ach = towlower ( ( wint_t ) ach );
-            bch = towlower ( ( wint_t ) bch );
-
-            if ( ach != bch )
-            {
-                if ( ach < bch )
-                    return -1;
-                return 1;
-            }
-        }
-
-        /* if char count is sufficient, we're done */
-        if ( ++ num_chars == max_chars )
-            return 0;
-    }
-
-    /* one or both reached end < max_chars */
-    if ( asize < bsize )
-        return -1;
-    return asize > bsize;
-}
-
-/* string_match
- *  returns the number of matching characters
- *
- *  "max_chars" limits the extent of the comparison
- *  to not exceed supplied value, i.e. the number of
- *  characters actually compared will be the minimum
- *  of asize, bsize and max_chars.
- *
- *  "msize" will be set to the size of the matched string
- *  if not NULL
- */
-LIB_EXPORT uint32_t CC string_match ( const char *a_orig, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars, size_t *msize )
-{
-    uint32_t i;
-    const char *a, *aend, *bend;
-
-    assert ( a_orig != NULL && b != NULL );
-
-    a = a_orig;
-    aend = a_orig + asize;
-    bend = b + bsize;
-
-    for ( i = 0; i < max_chars && a < aend && b < bend; ++ i )
-    {
-        int lena, lenb;
-        uint32_t ach, bch;
-
-        /* read a character from a */
-        lena = utf8_utf32 ( & ach, a, aend );
-        if ( lena <= 0 )
-            break;
-
-        /* read a character from b */
-        lenb = utf8_utf32 ( & bch, b, bend );
-        if ( lenb <= 0 )
-            break;
-
-        /* compare characters */
-        if ( ach != bch )
-            break;
-
-        a += lena;
-        b += lenb;
-    }
-
-    if ( msize != NULL )
-        * msize = ( size_t ) ( a - a_orig );
-    return i;
-}
-
-/* strcase_match
- *  like string_match except case insensitive
- */
-LIB_EXPORT uint32_t CC strcase_match ( const char *a_orig, size_t asize,
-    const char *b, size_t bsize, uint32_t max_chars, size_t *msize )
-{
-    uint32_t i;
-    const char *a, *aend, *bend;
-
-    assert ( a_orig != NULL && b != NULL );
-
-    a = a_orig;
-    aend = a_orig + asize;
-    bend = b + bsize;
-
-    for ( i = 0; i < max_chars && a < aend && b < bend; ++ i )
-    {
-        int lena, lenb;
-        uint32_t ach, bch;
-
-        /* read a character from a */
-        lena = utf8_utf32 ( & ach, a, aend );
-        if ( lena <= 0 )
-            break;
-
-        /* read a character from b */
-        lenb = utf8_utf32 ( & bch, b, bend );
-        if ( lenb <= 0 )
-            break;
-
-        /* compare characters */
-        if ( ach != bch )
-        {
-            /* only go lower case if they differ */
-            ach = towlower ( ( wint_t ) ach );
-            bch = towlower ( ( wint_t ) bch );
-
-            if ( ach != bch )
-                break;
-        }
-
-        a += lena;
-        b += lenb;
-    }
-
-    if ( msize != NULL )
-        * msize = ( size_t ) ( a - a_orig );
-    return i;
-}
-
-/* string_chr
- *  performs a safe strchr
- *  "ch" is in UTF32
- */
-LIB_EXPORT char * CC string_chr ( const char *str, size_t size, uint32_t ch )
-{
-    const char *end;
-
-    if ( str == NULL )
-        return NULL;
-
-    end = str + size;
-    while ( str < end )
-    {
-        uint32_t c;
-        int len = utf8_utf32 ( & c, str, end );
-        if ( len <= 0 )
-            break;
-        if ( c == ch )
-            return ( char* ) str;
-        str += len;
-    }
-    return NULL;
-}
-
-/* string_rchr
- *  performs a safe strrchr
- */
-LIB_EXPORT char * CC string_rchr ( const char *str, size_t size, uint32_t ch )
-{
-    const char *end;
-
-    if ( str == NULL )
-        return NULL;
-
-    end = str + size;
-    while ( end > str )
-    {
-        int len;
-        uint32_t c;
-        const char *p = end - 1;
-
-        /* back up to find beginning of character */
-        while ( p > str && ( * p & 0xC0 ) == 0x80 )
-            -- p;
-
-        len = utf8_utf32 ( & c, p, end );
-        if ( len <= 0 )
-            break;
-        if ( c == ch )
-            return ( char* ) p;
-        end = p;
-    }
-    return NULL;
-}
-
-/* string_idx
- *  seek an indexed character
- */
-LIB_EXPORT char * CC string_idx ( const char *str, size_t size, uint32_t idx )
-{
-    uint32_t i;
-    const char *end;
-
-    if ( str == NULL )
-        return NULL;
-
-    end = str + size;
-    for ( i = 0; str < end; ++ i )
-    {
-        uint32_t c;
-        int len = utf8_utf32 ( & c, str, end );
-        if ( len <= 0 )
-            break;
-        if ( i == idx )
-            return ( char* ) str;
-        str += len;
-    }
-    return NULL;
-}
-
-/* conversion from UTF-16 to internal standard */
-LIB_EXPORT uint32_t CC utf16_cvt_string_len ( const uint16_t *src,
-    size_t src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, src_len = ( uint32_t ) ( src_size >> 1 );
-
-    for ( size = 0, i = 0; i < src_len; ++ i )
-    {
-        uint32_t ch = src [ i ];
-
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT uint32_t CC utf16_cvt_string_measure ( const uint16_t *src,
-    size_t *src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, ch;
-
-    for ( size = 0, ch = src [ i = 0 ]; ch != 0; ch = src [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * src_size = i * sizeof * src;
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT size_t CC utf16_cvt_string_copy ( char *dst, size_t dst_size,
-    const uint16_t *src, size_t src_size )
-{
-    char *begin = dst;
-    char *dend = dst + dst_size;
-    const uint16_t *send = ( const uint16_t* ) ( ( const char* ) src + src_size );
-
-    while ( dst < dend && src < send )
-    {
-        uint32_t ch = * src ++;
-        int ch_len = utf32_utf8 ( dst, dend, ch );
-        if ( ch_len <= 0 )
-            break;
-        dst += ch_len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-    return ( size_t ) ( dst - begin );
-}
-
-/* conversion from UTF-32 to internal standard */
-LIB_EXPORT uint32_t CC utf32_cvt_string_len ( const uint32_t *src,
-    size_t src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, src_len = ( uint32_t ) ( src_size >> 2 );
-
-    for ( size = 0, i = 0; i < src_len; ++ i )
-    {
-        uint32_t ch = src [ i ];
-
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT uint32_t CC utf32_cvt_string_measure ( const uint32_t *src,
-    size_t *src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, ch;
-
-    for ( size = 0, ch = src [ i = 0 ]; ch != 0; ch = src [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * src_size = i * sizeof * src;
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT size_t CC utf32_cvt_string_copy ( char *dst, size_t dst_size,
-    const uint32_t *src, size_t src_size )
-{
-    char *begin = dst;
-    char *dend = dst + dst_size;
-    const uint32_t *send = ( const uint32_t* ) ( ( const char* ) src + src_size );
-
-    while ( dst < dend && src < send )
-    {
-        uint32_t ch = * src ++;
-        int ch_len = utf32_utf8 ( dst, dend, ch );
-        if ( ch_len <= 0 )
-            break;
-        dst += ch_len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-    return ( size_t ) ( dst - begin );
-}
-
-/* conversion from wchar_t to internal standard */
-LIB_EXPORT uint32_t CC wchar_cvt_string_len ( const wchar_t *src,
-    size_t src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, src_len = ( uint32_t ) ( src_size / sizeof * src );
-
-    for ( size = 0, i = 0; i < src_len; ++ i )
-    {
-        uint32_t ch = src [ i ];
-
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT uint32_t CC wchar_cvt_string_measure ( const wchar_t *src,
-    size_t *src_size, size_t *dst_size )
-{
-    size_t size;
-    uint32_t i, ch;
-
-    for ( size = 0, ch = src [ i = 0 ]; ch != 0; ch = src [ ++ i ] )
-    {
-        char ignore [ 8 ];
-        int ch_len = utf32_utf8 ( ignore, & ignore [ sizeof ignore ], ch );
-        if ( ch_len <= 0 )
-            break;
-        size += ch_len;
-    }
-
-    * src_size = i * sizeof * src;
-    * dst_size = size;
-    return i;
-}
-
-LIB_EXPORT size_t CC wchar_cvt_string_copy ( char *dst, size_t dst_size,
-    const wchar_t *src, size_t src_size )
-{
-    char *begin = dst;
-    char *dend = dst + dst_size;
-    const wchar_t *send = ( const wchar_t* ) ( ( const char* ) src + src_size );
-
-    while ( dst < dend && src < send )
-    {
-        uint32_t ch = * src ++;
-        int ch_len = utf32_utf8 ( dst, dend, ch );
-        if ( ch_len <= 0 )
-            break;
-        dst += ch_len;
-    }
-
-    if ( dst < dend )
-        * dst = 0;
-
-    return ( size_t ) ( dst - begin );
-}
-
-LIB_EXPORT size_t CC string_cvt_wchar_copy ( wchar_t *dst, size_t dst_size,
-    const char *src, size_t src_size )
-{
-    uint32_t len, blen = ( uint32_t ) ( dst_size / sizeof *dst );
-    const char *send = ( const char* ) src + src_size;
-
-    for ( len = 0; len < blen && src < send; ++ len )
-    {
-        uint32_t ch;
-        int consumed = utf8_utf32 ( &ch, src, send );
-        if ( consumed <= 0 )
-            break;
-        dst [ len ] = ( wchar_t ) ch;
-        src += consumed;
-    }
-
-    if ( len < blen )
-        dst [ len ] = 0;
-
-    return ( size_t ) ( len );
-}
diff --git a/libs/klib/vector.c b/libs/klib/vector.c
deleted file mode 100644
index d60d6d5..0000000
--- a/libs/klib/vector.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/vector.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * Vector
- *  simple vector of void*
- */
-
-
-/* Init
- *  initialize vector
- *
- *  "block" [ IN ] - selects the number of elements in
- *  a vector block; used for allocating and extending
- */
-LIB_EXPORT void CC VectorInit ( Vector *self, uint32_t start, uint32_t block )
-{
-    if ( self != NULL )
-    {
-        self -> v = NULL;
-        self -> start = start;
-        self -> len = 0;
-
-        if ( block == 0 )
-            block = 64;
-
-        if ( ( ( block - 1 ) & block ) != 0 )
-        {
-            uint32_t blk;
-            for ( blk = 1; blk < block; blk <<= 1 )
-                ( void ) 0;
-            block = blk;
-        }
-
-        /* force a minimum of two */
-        self -> mask = ( block - 1 ) | 1;
-    }
-}
-
-
-/* Copy
- *  initialize a new vector from an existing one
- *  performs a shallow copy
- */
-LIB_EXPORT rc_t CC VectorCopy ( const Vector *self, Vector *copy )
-{
-    uint32_t cap;
-
-    if ( copy == NULL )
-        return RC ( rcCont, rcVector, rcCopying, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcCont, rcVector, rcCopying, rcSelf, rcNull );
-
-    VectorInit ( copy, self -> start, self -> mask + 1 );
-    cap = ( self -> len + self -> mask ) & ~ self -> mask;
-    copy -> v = malloc ( sizeof copy -> v [ 0 ] * cap );
-    if ( copy -> v == NULL )
-        return RC ( rcCont, rcVector, rcCopying, rcMemory, rcExhausted );
-
-    memcpy ( copy -> v, self -> v, self -> len * sizeof copy -> v [ 0 ] );
-    copy -> len = self -> len;
-
-    return 0;
-}
-
-
-/* Get
- *  retrieve an indexed element
- */
-LIB_EXPORT  void* CC VectorGet ( const Vector *self, uint32_t idx )
-{
-    if ( self != NULL && idx >= self -> start )
-    {
-        idx -= self -> start;
-        if ( idx < self -> len )
-            return self -> v [ idx ];
-    }
-    return NULL;
-}
-
-
-/* Set
- *  sets an indexed element
- *  extends vector as required
- *
- *  "idx" [ IN ] - item index
- *
- *  "item" [ IN, OPAQUE ] - item to be appended to vector
- *
- *  returns rcExists if element is not NULL
- */
-LIB_EXPORT rc_t CC VectorSet ( Vector *self, uint32_t idx, const void *item )
-{
-    uint32_t curcap, newcap;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcSelf, rcNull );
-    if ( idx < self -> start )
-        return RC ( rcCont, rcVector, rcInserting, rcParam, rcInvalid );
-    if ( ( idx -= self -> start ) < self -> len )
-    {
-        if ( self -> v [ idx ] != NULL )
-            return RC ( rcCont, rcVector, rcInserting, rcItem, rcExists );
-        self -> v [ idx ] = ( void* ) item;
-        return 0;
-    }
-
-    curcap = ( self -> len + self -> mask ) & ~ self -> mask;
-    newcap = ( idx + self -> mask + 1 ) & ~ self -> mask;
-    if ( newcap > curcap )
-    {
-        void **v = realloc ( self -> v, newcap * sizeof * v );
-        if ( v == NULL )
-            return RC ( rcCont, rcVector, rcInserting, rcMemory, rcExhausted );
-        self -> v = v;
-    }
-
-    if ( idx > self -> len )
-        memset ( & self -> v [ self -> len ], 0, ( idx - self -> len ) * sizeof self -> v [ 0 ] );
-
-    self -> v [ idx ] = ( void* ) item;
-    self -> len = idx + 1;
-
-    return 0;
-}
-
-
-/* Swap
- *  swaps value of an indexed element
- *  behaves like Set except that it allows overwrite
- *
- *  "idx" [ IN ] - item index
- *
- *  "item" [ IN, OPAQUE ] - new element value
- *
- *  "prior" [ OUT ] - prior element value
- */
-LIB_EXPORT rc_t CC VectorSwap ( Vector *self, uint32_t idx,
-    const void *item, void **prior )
-{
-    rc_t rc;
-
-    if ( prior == NULL )
-        rc = RC ( rcCont, rcVector, rcInserting, rcParam, rcNull );
-    else
-    {
-        rc = VectorSet ( self, idx, item );
-        if ( GetRCState ( rc ) == rcExists )
-        {
-            idx -= self -> start;
-            * prior = self -> v [ idx ];
-
-            /* if swapping NULL for the last item
-               just drop the count */
-            if ( item == NULL && ( idx + 1 ) == self -> len )
-                -- self -> len;
-            else
-                self -> v [ idx ] = ( void* ) item;
-
-            return 0;
-        }
-
-        * prior = NULL;
-    }
-    return rc;
-}
-
-
-/* Append
- *  appends item to end of vector
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "item" [ IN, OPAQUE ] - item to be appended to vector
- */
-LIB_EXPORT rc_t CC VectorAppend ( Vector *self, uint32_t *idx, const void *item )
-{
-    if ( self == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcSelf, rcNull );
-
-    if ( ( self -> len & self -> mask ) == 0 )
-    {
-        void **v = realloc ( self -> v, ( self -> len + self -> mask + 1 ) * sizeof * v );
-        if ( v == NULL )
-            return RC ( rcCont, rcVector, rcInserting, rcMemory, rcExhausted );
-        self -> v = v;
-    }
-
-    self -> v [ self -> len ] = ( void* ) item;
-
-    if ( idx != NULL )
-        * idx = self -> len + self -> start;
-
-    ++ self -> len;
-
-    return 0;
-}
-
-
-/* First
- * Last
- *  get item at either end of vector
- */
-LIB_EXPORT void* CC VectorFirst ( const Vector *self )
-{
-    if ( self != NULL && self -> len != 0 )
-        return self -> v [ 0 ];
-    return NULL;
-}
-
-LIB_EXPORT  void* CC VectorLast ( const Vector *self )
-{
-    if ( self != NULL && self -> len != 0 )
-        return self -> v [ self -> len - 1 ];
-    return NULL;
-}
-
-
-/* Find
- *  find an object within ordered vector
- *
- *  "key" [ IN ] - find criteria
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "cmp" [ IN ] - comparison function that returns
- *  equivalent of "key" - "n"
- */
-LIB_EXPORT void* CC VectorFind ( const Vector *self, const void *key, uint32_t *idx,
-    int ( CC * cmp ) ( const void *key, const void *n ) )
-{
-    if ( self != NULL && cmp != NULL )
-    {
-        uint32_t left, right;
-
-        for ( left = 0, right = self -> len; left < right; )
-        {
-            uint32_t i, mid = ( left + right ) >> 1;
-            void *n = self -> v [ i = mid ];
-            while ( n == NULL && i > left )
-                n = self -> v [ -- i ];
-            if ( n == NULL )
-                left = mid + 1;
-            else
-            {
-                int diff = ( * cmp ) ( key, n );
-                if ( diff == 0 )
-                {
-                    if ( idx != NULL )
-                        * idx = i + self -> start;
-                    return n;
-                }
-                if ( diff < 0 )
-                    right = mid;
-                else
-                    left = mid + 1;
-            }
-        }
-    }
-
-    return NULL;
-}
-
-
-/* Insert
- *  insert an object to vector, even if duplicate
- *
- *  "item" [ IN ] - object to insert
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for item index
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- *
- *  the treatment of order for items reported as identical
- *  i.e. sort function returns zero when they are compared,
- *  is undefined.
- *
- *  the current implementation treats '<=' as '<' such
- *  that all inserts are converted to a '<' or '>' comparison,
- *  but this should not be relied upon.
- */
-LIB_EXPORT rc_t CC VectorInsert ( Vector *self, const void *item, uint32_t *idx,
-    int ( CC * sort ) ( const void *item, const void *n ) )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcSelf, rcNull );
-    if ( sort == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcFunction, rcNull );
-
-    /* let append handle vector expansion */
-    rc = VectorAppend ( self, NULL, item );
-    if ( rc == 0 )
-    {
-        uint32_t left, right;
-
-        for ( left = 0, right = ( int ) self -> len - 1; left < right; )
-        {
-            uint32_t i, mid = ( left + right ) >> 1;
-            void *n = self -> v [ i = mid ];
-            while ( n == NULL && i > left )
-                n = self -> v [ -- i ];
-            if ( n == NULL )
-                left = mid + 1;
-            else
-            {
-                int diff = ( * sort ) ( item, n );
-                if ( diff <= 0 )
-                    right = mid;
-                else
-                    left = mid + 1;
-            }
-        }
-
-        if ( self -> len > ++ right )
-        {
-            memmove ( & self -> v [ right ], & self -> v [ left ],
-                ( self -> len - right ) * sizeof self -> v [ 0 ] );
-            self -> v [ left ] = ( void* ) item;
-        }
-
-        if ( idx != NULL )
-            * idx = left + self -> start;
-    }
-
-    return rc;
-}
-
-
-/* InsertUnique
- *  insert an object to vector, but only if unique.
- *
- *  "item" [ IN ] - object to insert
- *
- *  "idx" [ OUT, NULL OKAY ] - optional return parameter for
- *  item index. when return code state is rcExists, this value
- *  will be that of the existing item.
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- */
-LIB_EXPORT rc_t CC VectorInsertUnique ( Vector *self, const void *item, uint32_t *idx,
-    int ( CC * sort ) ( const void *item, const void *n ) )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcSelf, rcNull );
-    if ( sort == NULL )
-        return RC ( rcCont, rcVector, rcInserting, rcFunction, rcNull );
-
-    rc = VectorAppend ( self, NULL, item );
-    if ( rc == 0 )
-    {
-        uint32_t left, right;
-
-        for ( left = 0, right = ( int ) self -> len - 1; left < right; )
-        {
-            uint32_t i, mid = ( left + right ) >> 1;
-            void *n = self -> v [ i = mid ];
-            while ( n == NULL && i > left )
-                n = self -> v [ -- i ];
-            if ( n == NULL )
-                left = mid + 1;
-            else
-            {
-                int diff = ( * sort ) ( item, n );
-                if ( diff == 0 )
-                {
-                    -- self -> len;
-                    if ( idx != NULL )
-                        * idx = i + self -> start;
-                    return RC ( rcCont, rcVector, rcInserting, rcNode, rcExists );
-                }
-                if ( diff < 0 )
-                    right = mid;
-                else
-                    left = mid + 1;
-            }
-        }
-
-        if ( self -> len > ++ right )
-        {
-            memmove ( & self -> v [ right ], & self -> v [ left ],
-                ( self -> len - right ) * sizeof self -> v [ 0 ] );
-            self -> v [ left ] = ( void* ) item;
-        }
-
-        if ( idx != NULL )
-            * idx = left + self -> start;
-    }
-
-    return rc;
-}
-
-
-/* Merge
- *  merge a sorted vector into an existing, sorted vector
- *
- *  "unique" [ IN ] - eliminate duplicates if true
- *
- *  "v" [ IN ] - sorted vector of elements to merge
- *
- *  "sort" [ IN ] - comparison function that returns
- *  equivalent of "item" - "n"
- */
-LIB_EXPORT rc_t CC VectorMerge ( Vector *self, bool unique, const Vector *v,
-    int ( CC * sort ) ( const void *item, const void *n ) )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcVector, rcInserting, rcSelf, rcNull );
-    else if ( v == NULL )
-        rc = RC ( rcCont, rcVector, rcInserting, rcParam, rcNull );
-    else if ( sort == NULL )
-        rc = RC ( rcCont, rcVector, rcInserting, rcFunction, rcNull );
-    else
-    {
-        void **out = malloc ( ( self -> len + v -> len ) * sizeof out [ 0 ] );
-        if ( out == NULL )
-            rc = RC ( rcCont, rcVector, rcInserting, rcMemory, rcExhausted );
-        else
-        {
-            uint32_t i, a, b;
-            for ( rc = 0, i = a = b = 0; a < self -> len && b < v -> len; ++ i )
-            {
-                int diff = ( * sort ) ( self -> v [ a ], v -> v [ b ] );
-                if ( diff == 0 )
-                {
-                    out [ i ] = self -> v [ a ++ ];
-                    if ( ! unique )
-                        out [ ++ i ] = v -> v [ b ];
-                    ++ b;
-                }
-                else if ( diff < 0 )
-                    out [ i ] = self -> v [ a ++ ];
-                else
-                    out [ i ] = v -> v [ b ++ ];
-            }
-            for ( ; a < self -> len; ++ i, ++ a )
-                out [ i ] = self -> v [ a ];
-            for ( ; b < v -> len; ++ i, ++ b )
-                out [ i ] = v -> v [ b ];
-
-            self -> len = i;
-            free ( self -> v );
-            self -> v = out;
-        }
-    }
-
-    return rc;
-}
-
-
-/* Remove
- *  retrieves value at given index
- *  shifts all elements to right of index toward start,
- *  preserving order and decrements length by 1
- *  return removed item
- *
- *  "idx" [ IN ] - item index
- *
- *  "removed" [ OUT ] - removed element value
- */
-LIB_EXPORT rc_t CC VectorRemove ( Vector *self, uint32_t idx, void **removed )
-{
-    rc_t rc;
-    if ( removed == NULL )
-        rc = RC ( rcCont, rcVector, rcRemoving, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcCont, rcVector, rcRemoving, rcSelf, rcNull );
-        else if ( idx < self -> start )
-            rc = RC ( rcCont, rcVector, rcRemoving, rcParam, rcInvalid );
-        else if ( ( idx -= self -> start ) >= self -> len )
-            rc = RC ( rcCont, rcVector, rcRemoving, rcParam, rcInvalid );
-        else
-        {
-            * removed = self -> v [ idx ];
-            if ( -- self -> len > idx )
-            {
-                memmove ( & self -> v [ idx ], & self -> v [ idx + 1 ],
-                    ( self -> len - idx ) * sizeof self -> v [ 0 ] );
-            }
-            return 0;
-        }
-
-        * removed = NULL;
-    }
-    return rc;
-}
-
-
-/* Reorder
- *  execute qsort on vector with provided function
- *  not particularly well formed ( i.e. doesn't have a function param ),
- *  but works within a limited context
- */
-LIB_EXPORT void CC VectorReorder ( Vector *self,
-    int ( CC * f ) ( const void**, const void**, void* ), void *data )
-{
-    if ( self != NULL && f != NULL && self -> len != 0 )
-    {
-        assert ( self -> v != NULL );
-        ksort ( self -> v, self -> len, sizeof self -> v [ 0 ],
-            ( int ( CC * ) ( const void*, const void*, void* ) ) f, data );
-    }
-}
-
-
-/* ForEach
- *  executes a function on each vector element
- */
-LIB_EXPORT void CC VectorForEach ( const Vector *self, bool reverse,
-    void ( CC * f ) ( void *item, void *data ), void *data )
-{
-    if ( self != NULL && f != NULL )
-    {
-        uint32_t i;
-
-        assert ( self -> len == 0 || self -> v != NULL );
-
-        if ( reverse ) for ( i = self -> len; i > 0; )
-        {
-            ( * f ) ( self -> v [ -- i ], data );
-        }
-        else for ( i = 0; i < self -> len; ++ i )
-        {
-            ( * f ) ( self -> v [ i ], data );
-        }
-    }
-}
-
-
-/* DoUntil
- *  executes a function on each element
- *  until the function returns true
- *
- *  return values:
- *    false unless the function returns true
- */
-LIB_EXPORT bool CC VectorDoUntil ( const Vector *self, bool reverse,
-    bool ( CC * f ) ( void *item, void *data ), void *data )
-{
-    if ( self != NULL && f != NULL )
-    {
-        uint32_t i;
-
-        assert ( self -> len == 0 || self -> v != NULL );
-
-        if ( reverse ) for ( i = self -> len; i > 0; )
-        {
-            if ( ( * f ) ( self -> v [ -- i ], data ) )
-                return true;
-        }
-        else for ( i = 0; i < self -> len; ++ i )
-        {
-            if ( ( * f ) ( self -> v [ i ], data ) )
-                return true;
-        }
-    }
-
-    return false;
-}
-
-
-/* Whack
- *  removes entries from vector and
- *  executes a user provided destructor
- */
-LIB_EXPORT void CC VectorWhack ( Vector *self, 
-    void ( CC * whack ) ( void *item, void *data ), void *data )
-{
-    if ( self != NULL )
-    {
-        uint32_t i;
-
-        assert ( self -> len == 0 || self -> v != NULL );
-
-        if ( whack != NULL ) for ( i = 0; i < self -> len; ++ i )
-            ( * whack ) ( self -> v [ i ], data );
-
-        free ( self -> v );
-
-        self -> v = NULL;
-        self -> len = 0;
-    }
-}
diff --git a/libs/klib/vector_namelist.c b/libs/klib/vector_namelist.c
deleted file mode 100644
index 072e529..0000000
--- a/libs/klib/vector_namelist.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-
-/*typedef struct VNamelist VNamelist;*/
-#define KNAMELIST_IMPL VNamelist
-
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/vector.h>
-#include <klib/impl.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * KVectorNamelist ... a generic Namelist based on a Vector
- */
-struct VNamelist
-{
-    KNamelist dad;
-    Vector name_vector;
-};
-
-
-static
-void CC VNameListDestroyNode( void* node, void* data )
-{
-    if ( node != NULL ) free( node );
-}
-
-static
-rc_t CC VNameListDestroy ( VNamelist *self )
-{
-    VectorWhack ( &(self->name_vector), VNameListDestroyNode, NULL );
-    free ( self );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VNameListCount ( const VNamelist *self, uint32_t *count )
-{
-    * count = VectorLength ( &(self->name_vector) );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VNameListGet ( const VNamelist *self, uint32_t idx, const char **name )
-{
-    if ( idx >= VectorLength ( &(self->name_vector) ) )
-        return RC ( rcCont, rcNamelist, rcAccessing, rcParam, rcExcessive );
-    * name = VectorGet ( &(self->name_vector), idx );
-    return 0;
-}
-
-static KNamelist_vt_v1 sVNameList_vt =
-{
-    1, 0,
-    VNameListDestroy,
-    VNameListCount,
-    VNameListGet
-};
-
-LIB_EXPORT rc_t CC VNamelistMake( VNamelist **names, const uint32_t alloc_blocksize  )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcCont, rcNamelist, rcConstructing, rcParam, rcNull );
-    else
-    {
-        (*names)=malloc( sizeof(**names) );
-        if (*names != NULL )
-        {
-            rc = KNamelistInit( &(*names)->dad, (const KNamelist_vt*) &sVNameList_vt );
-            if ( rc == 0 )
-            {
-                VectorInit ( & (*names)->name_vector, 0, alloc_blocksize );
-            }
-            else
-            {
-                free( *names );
-                *names = NULL;
-            }
-        }
-        else
-        {
-            rc = RC( rcCont, rcNamelist, rcListing, rcParam, rcNull );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VNamelistRelease( const VNamelist *self )
-{
-    rc_t rc = 0;
-    if ( self != NULL )
-    {
-        rc = KNamelistRelease( &(self->dad) );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VNamelistToNamelist( VNamelist *self, KNamelist **cast )
-{
-    rc_t rc;
-    if ( cast == NULL )
-        rc = RC ( rcCont, rcNamelist, rcCasting, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcCont, rcNamelist, rcCasting, rcSelf, rcNull );
-        else
-        {
-            rc = KNamelistAddRef ( & self -> dad );
-            if ( rc == 0 )
-            {
-                * cast = & self -> dad;
-                return 0;
-            }
-        }
-
-        * cast = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VNamelistToConstNamelist( const VNamelist *self, const KNamelist **cast )
-{
-    return VNamelistToNamelist ( ( VNamelist* ) self, ( KNamelist** ) cast );
-}
-
-LIB_EXPORT rc_t CC VNamelistAppend( VNamelist *self, const char* src )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcNamelist, rcInserting, rcSelf, rcNull );
-    else
-    {
-        if ( src == NULL )
-            rc = RC( rcCont, rcNamelist, rcInserting, rcString, rcNull );
-        else if ( src[0] == 0 )
-            rc = RC( rcCont, rcNamelist, rcInserting, rcString, rcEmpty );
-        else
-        {
-            char* my_copy = string_dup( src, string_size( src ) );
-            if ( my_copy == NULL )
-                rc = RC( rcCont, rcNamelist, rcInserting, rcMemory, rcExhausted );
-            else
-            {
-                rc = VectorAppend( &(self->name_vector), NULL, my_copy );
-                if ( rc != 0 )
-                    free ( my_copy );
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VNamelistAppendString( VNamelist *self, const String * src )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcNamelist, rcInserting, rcSelf, rcNull );
-    else
-    {
-        if ( src == NULL )
-            rc = RC( rcCont, rcNamelist, rcInserting, rcString, rcNull );
-        else if ( src->addr == NULL || src->len == 0 )
-            rc = RC( rcCont, rcNamelist, rcInserting, rcString, rcEmpty );
-        else
-        {
-            char* my_copy = string_dup ( src->addr, src->len );
-            if ( my_copy == NULL )
-                rc = RC( rcCont, rcNamelist, rcInserting, rcMemory, rcExhausted );
-            else
-            {
-                rc = VectorAppend( &(self->name_vector), NULL, my_copy );
-                if ( rc != 0 )
-                    free ( my_copy );
-            }
-        }
-    }
-    return rc;
-}
-
-
-
-LIB_EXPORT rc_t CC VNamelistIndexOf( VNamelist *self, const char* s, uint32_t *found )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcCont, rcNamelist, rcSearching, rcSelf, rcNull );
-    else
-    {
-        if ( s == NULL )
-            rc = RC( rcCont, rcNamelist, rcSearching, rcString, rcNull );
-        else if ( s[0] == 0 )
-            rc = RC( rcCont, rcNamelist, rcSearching, rcString, rcEmpty );
-        else if ( found == NULL )
-            rc = RC( rcCont, rcNamelist, rcSearching, rcParam, rcNull );
-        else
-        {
-            uint32_t count;
-            rc = VNameListCount ( self, &count );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                size_t n1 = string_size ( s );
-                for ( idx = 0; idx < count; ++idx )
-                {
-                    const char * name;
-                    rc = VNameListGet ( self, idx, &name );
-                    if ( rc == 0 )
-                    {
-                        size_t n2 = string_size ( name );
-                        if ( string_cmp ( s, n1, name, n2, (uint32_t) ( ( n1 < n2 ) ? n2 : n1 ) ) == 0 )
-                        {
-                            *found = idx;
-                            return 0;
-                        }
-                    }
-                }
-                rc = RC( rcCont, rcNamelist, rcSearching, rcString, rcNotFound );
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VNamelistRemove( VNamelist *self, const char* s )
-{
-    uint32_t idx;
-
-    rc_t rc = VNamelistIndexOf( self, s, &idx );
-    if ( rc == 0 )
-    {
-        char *removed;
-        rc = VectorRemove ( &(self->name_vector), idx, (void **)&removed );
-        if ( rc == 0 )
-            free( removed );
-    }
-    return rc;
-}
-
-
-
-/* Reorder
- *  sort the names according to case sensitivity
- *  and UNICODE character code ordering
- *
- *  "case_insensitive" [ IN ] - when true, perform "tolower" on
- *   each character before compare
- */
-static
-int CC vect_string_cmp ( const void **a, const void **b, void *ignore )
-{
-    return strcmp ( * a, * b );
-}
-
-static
-int CC vect_string_cmp_case ( const void **a, const void **b, void *ignore )
-{
-    uint32_t i;
-
-    const char *ap = * a;
-    const char *bp = * b;
-
-    if ( ap == NULL )
-        return bp != NULL;
-    if ( bp == NULL )
-        return -1;
-
-    for ( i = 0; ; ++ i )
-    {
-        if ( ap [ i ] != bp [ i ] )
-        {
-            /* TBD - this should perform UTF-8 to UNICODE conversion
-               but for that, create a function in text module */
-            int diff = tolower ( ap [ i ] ) - tolower ( bp [ i ] );
-            if ( diff == 0 )
-                continue;
-
-            return diff;
-        }
-
-        if ( ap [ i ] == 0 )
-            break;
-    }
-
-    return 0;
-}
-
-LIB_EXPORT void CC VNamelistReorder ( VNamelist *self, bool case_insensitive )
-{
-    if ( self != NULL )
-    {
-        VectorReorder ( & self -> name_vector, case_insensitive ? vect_string_cmp_case : vect_string_cmp, NULL );
-    }
-}
diff --git a/libs/klib/vlen-encode.c b/libs/klib/vlen-encode.c
deleted file mode 100644
index f8e4349..0000000
--- a/libs/klib/vlen-encode.c
+++ /dev/null
@@ -1,773 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/extern.h>
-#include <klib/vlen-encode.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <byteswap.h>
-#include <endian.h>
-#include <string.h>
-
-LIB_EXPORT rc_t CC vlen_encode1(void *Dst, uint64_t dsize, uint64_t *psize, int64_t X) {
-    int sgn = 0;
-    uint64_t x;
-    uint8_t *dst = Dst;
-    
-    if (dst == NULL)
-        dsize = 0;
-    
-    if (X < 0) {
-        sgn = 0x40;
-        x = -X;
-    }
-    else
-        x = X;
-    /* 6 -> 8 */
-    if (x < 0x40) {
-        if (psize)
-            *psize = 1;
-        if (dsize < 1)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = (uint8_t)sgn | ( (uint8_t)x & 0x3F );
-        return 0;
-    }
-    /* 13 -> 16 */
-    if (x < 0x2000) {
-        if (psize)
-            *psize = 2;
-        if (dsize < 2)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 7 ) & 0x3F );
-        dst[1] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 20 -> 24 */
-    if (x < 0x100000) {
-        if (psize)
-            *psize = 3;
-        if (dsize < 3)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 14 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[2] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 27 -> 32 */
-    if (x < 0x8000000) {
-        if (psize)
-            *psize = 4;
-        if (dsize < 4)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 21 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[3] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 34 -> 40 */
-    if (x < ( ( uint64_t ) 0x4 << 32 ) ) {
-        if (psize)
-            *psize = 5;
-        if (dsize < 5)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 28 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[4] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 41 -> 48 */
-    if (x < ( ( uint64_t ) 0x200 << 32 ) ) {
-        if (psize)
-            *psize = 6;
-        if (dsize < 6)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 35 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[5] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 48 -> 56 */
-    if (x < ( ( uint64_t ) 0x10000 << 32 ) ) {
-        if (psize)
-            *psize = 7;
-        if (dsize < 7)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 42 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[6] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 55 -> 64 */
-    if (x < ( ( uint64_t ) 0x800000 << 32 ) ) {
-        if (psize)
-            *psize = 8;
-        if (dsize < 8)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 49 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[6] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[7] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 62 -> 72 */
-    if (x < ( ( uint64_t ) 0x40000000 << 32 ) ) {
-        if (psize)
-            *psize = 9;
-        if (dsize < 9)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 56 ) & 0x3F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 49 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[6] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[7] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[8] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 64 -> 80 */
-    if (psize)
-        *psize = 10;
-    if (dsize < 10)
-        return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    dst[0] = 0x80 | (uint8_t)sgn | ( (uint8_t)( x >> 63 ) & 0x3F );
-    dst[1] = 0x80 | ( (uint8_t)( x >> 56 ) & 0x7F );
-    dst[2] = 0x80 | ( (uint8_t)( x >> 49 ) & 0x7F );
-    dst[3] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-    dst[4] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-    dst[5] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-    dst[6] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-    dst[7] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-    dst[8] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-    dst[9] = ( (uint8_t)x & 0x7F );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC vlen_decode1 ( int64_t *dst, const void *Src, uint64_t ssize, uint64_t *consumed ) {
-    const uint8_t *src = Src;
-    int x;
-    int i;
-    int sgn;
-    int64_t y;
-
-    if (dst == NULL || src == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcNull);
-    if (ssize == 0)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-    if (ssize > 10)
-        ssize = 10;
-    
-    x = src[0];
-    sgn = x & 0x40;
-    y = x & 0x3F;
-    i = 1;
-    if ((x & 0x80) != 0) {
-        if (i == ssize)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        x = src[i];
-        y = (y << 7) | (x & 0x7F);
-        ++i;
-        if ((x & 0x80) != 0) {
-            if (i == ssize)
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-            x = src[i];
-            y = (y << 7) | (x & 0x7F);
-            ++i;
-            if ((x & 0x80) != 0) {
-                if (i == ssize)
-                    return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                x = src[i];
-                y = (y << 7) | (x & 0x7F);
-                ++i;
-                if ((x & 0x80) != 0) {
-                    if (i == ssize)
-                        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                    x = src[i];
-                    y = (y << 7) | (x & 0x7F);
-                    ++i;
-                    if ((x & 0x80) != 0) {
-                        if (i == ssize)
-                            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                        x = src[i];
-                        y = (y << 7) | (x & 0x7F);
-                        ++i;
-                        if ((x & 0x80) != 0) {
-                            if (i == ssize)
-                                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                            x = src[i];
-                            y = (y << 7) | (x & 0x7F);
-                            ++i;
-                            if ((x & 0x80) != 0) {
-                                if (i == ssize)
-                                    return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                                x = src[i];
-                                y = (y << 7) | (x & 0x7F);
-                                ++i;
-                                if ((x & 0x80) != 0) {
-                                    if (i == ssize)
-                                        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                                    x = src[i];
-                                    y = (y << 7) | (x & 0x7F);
-                                    ++i;
-                                    if ((x & 0x80) != 0) {
-                                        if (i == ssize)
-                                            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                                        x = src[i];
-                                        y = (y << 7) | (x & 0x7F);
-                                        ++i;
-                                        if ((x & 0x80) != 0)
-                                            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    *dst = sgn ? -y : y;
-    if (consumed)
-        *consumed = i;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC vlen_encode ( void *Dst, uint64_t dsize, uint64_t *act_size,
-    const int64_t x[], uint32_t xcount ) {
-    uint32_t i;
-    uint64_t n;
-    uint64_t m = 0;
-    rc_t rc = 0;
-    uint8_t *dst = Dst;
-    
-    if (dst != NULL) {
-        for (i = 0, rc = 0; rc == 0 && i != xcount; ++i) {
-            rc = vlen_encode1(dst, dsize, &n, x[i]);
-            dst += n;
-            dsize -= n;
-            m += n;
-        }
-        if (rc == 0)
-            goto DONE;
-    }
-    else
-        i = 0;
-    for (; i != xcount; ++i) {
-        vlen_encode1(0, 0, &n, x[i]);
-        m += n;
-    }
-DONE:
-    if (act_size)
-        *act_size = m;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC vlen_decode ( int64_t *Y, uint64_t ycount, 
-    const void *Src, uint64_t ssize, uint64_t *consumed ) {
-    const uint8_t *src = Src;
-    uint64_t i, j;
-    
-    if (Y == NULL || Src == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcNull);
-    if (ssize == 0)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-    if (ssize < ycount)
-        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-    
-    for (i = 0, j = 0; j != ycount && i + 10 < ssize; ++j) {
-        int64_t y;
-        int sgn;
-#define XTYPE_SIZE 64
-#if XTYPE_SIZE == 64
-#define XTYPE uint64_t
-#elif XTYPE_SIZE == 32
-#define XTYPE uint32_t
-#else
-#endif
-        XTYPE x;
-        
-        memcpy (& x, src + i, sizeof x); /* may be misaligned */        
-#if __BYTE_ORDER == __BIG_ENDIAN
-#if XTYPE_SIZE == 32
-        x = bswap_32(x);
-#elif XTYPE_SIZE == 64
-        x = bswap_64(x);
-#endif
-#endif
-        sgn = (int)x & 0x40;
-        y = x & 0x3F;
-        ++i;
-        if ((x & 0x80) != 0) {
-            x >>= 8;
-            y = (y << 7) | (x & 0x7F);
-            ++i;
-            if ((x & 0x80) != 0) {
-                x >>= 8;
-                y = (y << 7) | (x & 0x7F);
-                ++i;
-                if ((x & 0x80) != 0) {
-                    x >>= 8;
-                    y = (y << 7) | (x & 0x7F);
-                    ++i;
-                    if ((x & 0x80) != 0) {
-#if XTYPE_SIZE == 32
-                        x = *(const XTYPE *)(src + i);
-#if __BYTE_ORDER == __BIG_ENDIAN
-                        x = bswap_32(x);
-#endif
-#elif XTYPE_SIZE == 64
-                        x >>= 8;
-#endif
-                        y = (y << 7) | (x & 0x7F);
-                        ++i;
-                        if ((x & 0x80) != 0) {
-                            x >>= 8;
-                            y = (y << 7) | (x & 0x7F);
-                            ++i;
-                            if ((x & 0x80) != 0) {
-                                x >>= 8;
-                                y = (y << 7) | (x & 0x7F);
-                                ++i;
-                                if ((x & 0x80) != 0) {
-                                    x >>= 8;
-                                    y = (y << 7) | (x & 0x7F);
-                                    ++i;
-                                    if ((x & 0x80) != 0) {
-                                        x = src[i];
-                                        y = (y << 7) | (x & 0x7F);
-                                        ++i;
-                                        if ((x & 0x80) != 0) {
-                                            x = src[i];
-                                            y = (y << 7) | (x & 0x7F);
-                                            ++i;
-                                            if ((x & 0x80) != 0)
-                                                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        Y[j] = sgn ? -y : y;
-    }
-    for ( ; j != ycount; ++j) {
-        uint64_t n;
-        rc_t rc = vlen_decode1(Y + j, src + i, ssize - i, &n);
-        if (rc)
-            return rc;
-        i += n;
-    }
-    if (consumed)
-        *consumed = i;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC vlen_encodeU1 ( void *Dst, uint64_t dsize,
-    uint64_t *psize, uint64_t X ) {
-    uint64_t x = X;
-    uint8_t *dst = Dst;
-    
-    if (dst == NULL)
-        dsize = 0;
-    
-    /* 7 -> 8 */
-    if (x < 0x80) {
-        if (psize)
-            *psize = 1;
-        if (dsize < 1)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = (uint8_t)x & 0x7F;
-        return 0;
-    }
-    /* 14 -> 16 */
-    if (x < 0x4000) {
-        if (psize)
-            *psize = 2;
-        if (dsize < 2)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F);
-        dst[1] = (uint8_t)x & 0x7F;
-        return 0;
-    }
-    /* 21 -> 24 */
-    if (x < 0x200000) {
-        if (psize)
-            *psize = 3;
-        if (dsize < 3)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[2] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 28 -> 32 */
-    if (x < 0x10000000) {
-        if (psize)
-            *psize = 4;
-        if (dsize < 4)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[3] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 35 -> 40 */
-    if (x < ( ( uint64_t ) 0x8 << 32 ) ) {
-        if (psize)
-            *psize = 5;
-        if (dsize < 5)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[4] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 42 -> 48 */
-    if (x < ( ( uint64_t ) 0x400 << 32 ) ) {
-        if (psize)
-            *psize = 6;
-        if (dsize < 6)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[5] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 49 -> 56 */
-    if (x < ( ( uint64_t ) 0x20000 << 32 ) ) {
-        if (psize)
-            *psize = 7;
-        if (dsize < 7)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[6] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 56 -> 64 */
-    if (x < ( ( uint64_t ) 0x1000000 << 32 ) ) {
-        if (psize)
-            *psize = 8;
-        if (dsize < 8)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 49 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[6] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[7] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 63 -> 72 */
-    if (x < ( ( uint64_t ) 0x80000000 << 32 ) ) {
-        if (psize)
-            *psize = 9;
-        if (dsize < 9)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        dst[0] = 0x80 | ( (uint8_t)( x >> 56 ) & 0x7F );
-        dst[1] = 0x80 | ( (uint8_t)( x >> 49 ) & 0x7F );
-        dst[2] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-        dst[3] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-        dst[4] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-        dst[5] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-        dst[6] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-        dst[7] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-        dst[8] = ( (uint8_t)x & 0x7F );
-        return 0;
-    }
-    /* 64 -> 80 */
-    if (psize)
-        *psize = 10;
-    if (dsize < 10)
-        return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    dst[0] = 0x80 | ( (uint8_t)( x >> 63 ) & 0x7F );
-    dst[1] = 0x80 | ( (uint8_t)( x >> 56 ) & 0x7F );
-    dst[2] = 0x80 | ( (uint8_t)( x >> 49 ) & 0x7F );
-    dst[3] = 0x80 | ( (uint8_t)( x >> 42 ) & 0x7F );
-    dst[4] = 0x80 | ( (uint8_t)( x >> 35 ) & 0x7F );
-    dst[5] = 0x80 | ( (uint8_t)( x >> 28 ) & 0x7F );
-    dst[6] = 0x80 | ( (uint8_t)( x >> 21 ) & 0x7F );
-    dst[7] = 0x80 | ( (uint8_t)( x >> 14 ) & 0x7F );
-    dst[8] = 0x80 | ( (uint8_t)( x >> 7 ) & 0x7F );
-    dst[9] = ( (uint8_t)x & 0x7F );
-    return 0;
-}
-
-static
-rc_t vlen_decodeU1_imp ( uint64_t *dst, const void *Src,
-    uint64_t ssize, uint64_t *consumed ) {
-    const uint8_t *src = Src;
-    uint64_t y;
-    int c;
-    
-    if (ssize > 10)
-        ssize = 10;
-    
-	c = src[0];
-	if ((c & 0x80) == 0) {
-		*dst = c;
-		*consumed = 1;
-		return 0;
-	}
-	if (ssize != 1) {
-		y = c & 0x7F;
-        c = src[1];
-        if ((c & 0x80) == 0) {
-            *dst = (y << 7) | c;
-            *consumed = 2;
-            return 0;
-        }
-        if (ssize != 2) {
-            y = (y << 7) | (c & 0x7F);
-            c = src[2];
-            if ((c & 0x80) == 0) {
-                *dst = (y << 7) | c;
-                *consumed = 3;
-                return 0;
-            }
-            if (ssize != 3) {
-                y = (y << 7) | (c & 0x7F);
-                c = src[3];
-                if ((c & 0x80) == 0) {
-                    *dst = (y << 7) | c;
-                    *consumed = 4;
-                    return 0;
-                }
-                if (ssize != 4) {
-                    y = (y << 7) | (c & 0x7F);
-                    c = src[4];
-                    if ((c & 0x80) == 0) {
-                        *dst = (y << 7) | c;
-                        *consumed = 5;
-                        return 0;
-                    }
-                    if (ssize != 5) {
-                        y = (y << 7) | (c & 0x7F);
-                        c = src[5];
-                        if ((c & 0x80) == 0) {
-                            *dst = (y << 7) | c;
-                            *consumed = 6;
-                            return 0;
-                        }
-                        if (ssize != 6) {
-                            y = (y << 7) | (c & 0x7F);
-                            c = src[6];
-                            if ((c & 0x80) == 0) {
-                                *dst = (y << 7) | c;
-                                *consumed = 7;
-                                return 0;
-                            }
-                            if (ssize != 7) {
-                                y = (y << 7) | (c & 0x7F);
-                                c = src[7];
-                                if ((c & 0x80) == 0) {
-                                    *dst = (y << 7) | c;
-                                    *consumed = 8;
-                                    return 0;
-                                }
-                                if (ssize != 8) {
-                                    y = (y << 7) | (c & 0x7F);
-                                    c = src[8];
-                                    if ((c & 0x80) == 0) {
-                                        *dst = (y << 7) | c;
-                                        *consumed = 9;
-                                        return 0;
-                                    }
-                                    if (ssize != 9) {
-                                        y = (y << 7) | (c & 0x7F);
-                                        c = src[9];
-                                        if ((c & 0x80) == 0) {
-                                            *dst = (y << 7) | c;
-                                            *consumed = 10;
-                                            return 0;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-                                            
-    return RC(rcRuntime, rcFunction, rcExecuting, rcData, rcInvalid);
-}
-
-LIB_EXPORT rc_t CC vlen_decodeU1( uint64_t *dst, const void *Src,
-    uint64_t ssize, uint64_t *consumed ) {
-    if (dst == NULL || Src == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcNull);
-    if (ssize == 0)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-    
-    return vlen_decodeU1_imp(dst, Src, ssize, consumed);
-}
-
-LIB_EXPORT rc_t CC vlen_encodeU( void *Dst, uint64_t dsize,
-    uint64_t *act_size, const uint64_t x[], uint32_t xcount ) {
-    uint32_t i;
-    uint64_t n;
-    uint64_t m = 0;
-    rc_t rc = 0;
-    uint8_t *dst = Dst;
-    
-    if (dst != NULL) {
-        for (i = 0, rc = 0; rc == 0 && i != xcount; ++i) {
-            rc = vlen_encodeU1(dst, dsize, &n, x[i]);
-            dst += n;
-            dsize -= n;
-            m += n;
-        }
-        if (rc == 0)
-            goto DONE;
-    }
-    else
-        i = 0;
-    for (; i != xcount; ++i) {
-        vlen_encodeU1(0, 0, &n, x[i]);
-        m += n;
-    }
-DONE:
-    if (act_size)
-        *act_size = m;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC vlen_decodeU ( uint64_t Y[], uint64_t ycount,
-    const void *Src, uint64_t ssize, uint64_t *consumed ) {
-    const uint8_t *src = Src;
-    uint64_t i, j;
-    
-    if (Y == NULL || Src == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcNull);
-    if (ssize == 0)
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-    if (ssize < ycount)
-        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-    
-    for (j = i = 0; j != ycount; ++j) {
-        uint64_t n;
-        rc_t rc = vlen_decodeU1_imp(Y + j, src + i, ssize - i, &n);
-        if (rc)
-            return rc;
-        i += n;
-    }
-    if (consumed)
-        *consumed = i;
-    return 0;
-}
-
-#if 0
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-
-static void print ( const unsigned char *buf, int n ) {
-    int i;
-    for (i = 0; i != n; ++i)
-        printf("%02X ", buf[i]);
-    puts("");
-}
-
-#define N 128
-void test( void ) {
-    unsigned char buf[N * 10];
-    uint32_t i;
-    uint64_t y[N], x[N];
-    unsigned s[8];
-    uint64_t bsz;
-    uint64_t temp;
-    uint32_t total;
-    uint64_t min = 640;
-    uint64_t max = 0;
-    int j;
-    
-    for (i = 0; i != 8; ++i) {
-        sranddev();
-        s[i] = random();
-    }
-    for (j = 0, total = 0; j != 1024 * 1024; ++j) {
-        for (i = 0; i != N; ++i)
-            x[i] = random();
-        vlen_encodeU(buf, 1024, &bsz, x, N);
-        total += bsz;
-        if (max < bsz)
-            max = bsz;
-        if (min > bsz)
-            min = bsz;
-        vlen_decodeU(y, N, buf, bsz, &temp);
-        assert(temp == bsz);
-        assert(memcmp(y, x, sizeof(y)) == 0);
-    }
-    for (j = 0, total = 0; j != 1024 * 1024; ++j) {
-        for (i = 0; i != N; ++i)
-            x[i] = random();
-        vlen_encode(buf, 1024, &bsz, x, N);
-        total += bsz;
-        if (max < bsz)
-            max = bsz;
-        if (min > bsz)
-            min = bsz;
-        vlen_decode(y, N, buf, bsz, &temp);
-        assert(temp == bsz);
-        assert(memcmp(y, x, sizeof(y)) == 0);
-    }
-    printf("min: %u\tmax: %u\tavg: %f\n", (int)min, (int)max, ((float)total) / j);
-}
-#endif
diff --git a/libs/klib/win/sysalloc.c b/libs/klib/win/sysalloc.c
deleted file mode 100644
index 7dfc73a..0000000
--- a/libs/klib/win/sysalloc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#define _c_sysalloc_
-#include <sysalloc.h>
-
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-
-#if _DEBUGGING
-#define _CRTDBG_MAP_ALLOC 1
-#include <crtdbg.h>
-#endif
-
-/* malloc
- */
-LIB_EXPORT void * CC klib_malloc ( size_t bytes )
-{
-    return malloc ( bytes );
-}
-
-/* calloc
- */
-LIB_EXPORT void * CC klib_calloc ( size_t count, size_t size )
-{
-    return calloc ( count, size );
-}
-
-/* realloc
- */
-LIB_EXPORT void * CC klib_realloc ( void *obj, size_t bytes )
-{
-    return realloc ( obj, bytes );
-}
-
-
-/* free
- */
-LIB_EXPORT void CC klib_free ( void *obj )
-{
-    free ( obj );
-}
diff --git a/libs/klib/win/syserrcode.c b/libs/klib/win/syserrcode.c
deleted file mode 100644
index 9176d92..0000000
--- a/libs/klib/win/syserrcode.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "writer-priv.h"
-#include <klib/writer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <os-native.h>
-#include <Windows.h>
-
-#include <stdio.h>
-
-size_t KWrtFmt_error_code ( char * buffer, size_t buffer_size, uint32_t error_code )
-{
-    char  * tbuffer;
-    char * pc;
-    DWORD tbuffer_size;
-    size_t z;
-
-    tbuffer_size = FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-                                   FORMAT_MESSAGE_FROM_SYSTEM | 
-                                   FORMAT_MESSAGE_IGNORE_INSERTS, /* dwFlags */
-                                   NULL, /* lpSource */
-                                   error_code, /* dwMessageId */
-                                   0, /* dwLanguageId - we're lazy on language right now */
-                                   (LPSTR)&tbuffer,
-                                   0, /* nSize */
-                                   NULL);/* Arguments */
-    if (tbuffer_size == 0)
-    {
-        rc_t rc;
-
-        rc = string_printf (buffer, buffer_size, &z,
-                            "Undefined error: %u", error_code);
-        if (rc == 0)
-            return z;
-        else
-        {
-            static const char failed[] = "Failure to get Windows error string";
-            return string_copy (buffer, buffer_size, failed, sizeof failed);
-        }
-    }
-    else
-    {
-        for (pc = tbuffer; *pc ; ++pc)
-        {
-            if (*pc == '\r')
-            {
-                tbuffer_size = pc - tbuffer;
-                break;
-            }
-        }
-        z = string_copy (buffer, buffer_size, tbuffer, tbuffer_size);
-
-        LocalFree (tbuffer);
-    }
-    return z;
-}
diff --git a/libs/klib/win/syslog.c b/libs/klib/win/syslog.c
deleted file mode 100644
index 68d586b..0000000
--- a/libs/klib/win/syslog.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include "../log-priv.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <WINDOWS.H>
-#include <stdio.h>
-#include <stdlib.h>
-#include <os-native.h>
-
-/* LogTimestamp
- *  generates a timestamp-string in GMT-format
- */
-LIB_EXPORT rc_t CC LogTimestamp ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    int len;
-    SYSTEMTIME my_time;
-    
-    GetSystemTime( &my_time );
-
-    /* make the timestamp */
-    len = snprintf ( buffer, bsize,
-                     "%04d-%02d-%02dT%02d:%02d:%02d",
-                     my_time.wYear,
-                     my_time.wMonth,
-                     my_time.wDay,
-                     my_time.wHour,
-                     my_time.wMinute,
-                     my_time.wSecond );
-    if ( num_writ != NULL )
-    {
-        * num_writ = len;
-    }
-
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 && num_writ != NULL )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-
-    return 0;
-}
-
-/* LogSimpleTimestamp
- *  generates a local timestamp string without time zone
- */
-LIB_EXPORT rc_t CC LogSimpleTimestamp ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    int len;
-    SYSTEMTIME my_time;
-
-    GetLocalTime( &my_time );
-
-    /* make the timestamp */
-    len = snprintf ( buffer, bsize,
-                     "%04d-%02d-%02dT%02d:%02d:%02d",
-                     my_time.wYear,
-                     my_time.wMonth,
-                     my_time.wDay,
-                     my_time.wHour,
-                     my_time.wMinute,
-                     my_time.wSecond );
-    if ( num_writ != NULL )
-    {
-        * num_writ = len;
-    }
-
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 && num_writ != NULL )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-
-    return 0;
-}
-
-/* LogPID
- *  generates a process id
- */
-LIB_EXPORT rc_t CC LogPID ( char *buffer, size_t bsize, size_t *num_writ )
-{
-    DWORD my_process_id = GetCurrentProcessId();
-    int len = snprintf ( buffer, bsize, "%u", my_process_id );
-    * num_writ = len;
-    if ( len < 0 || ( size_t ) len >= bsize )
-    {
-        if ( len < 0 )
-            * num_writ = 0;
-        return RC ( rcApp, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-    return 0;
-}
diff --git a/libs/klib/win/systime.c b/libs/klib/win/systime.c
deleted file mode 100644
index 30b7fc7..0000000
--- a/libs/klib/win/systime.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/time.h>
-
-#include <WINDOWS.H>
-#include <os-native.h>
-
-
-/*--------------------------------------------------------------------------
- * KTime_t
- *  64 bit time_t
- */
-
-#if _ARCH_BITS == 32
-#define UNIX_EPOCH_IN_WIN       116444736000000000ULL
-#else
-#define UNIX_EPOCH_IN_WIN       116444736000000000UL
-#endif
-#define UNIX_TIME_UNITS_IN_WIN  10000000
-
-
-/* KTime2FILETIME
- *  convert from Unix to Windows
- */
-static
-const FILETIME *KTime2FILETIME ( KTime_t ts, FILETIME *ft )
-{
-    uint64_t win_time = ( ts * UNIX_TIME_UNITS_IN_WIN ) + UNIX_EPOCH_IN_WIN;
-    ft -> dwLowDateTime = ( DWORD ) win_time;
-    ft -> dwHighDateTime = win_time >> 32;
-    return ft;
-}
-
-/* FILETIME2KTime
- */
-static
-KTime_t FILETIME2KTime ( const FILETIME *ft )
-{
-    uint64_t win_time = ft -> dwLowDateTime + ( ( int64_t ) ft -> dwHighDateTime << 32 );
-    return ( KTime_t ) ( win_time - UNIX_EPOCH_IN_WIN ) / UNIX_TIME_UNITS_IN_WIN;
-}
-
-
-/* Stamp
- *  current timestamp
- */
-LIB_EXPORT KTime_t CC KTimeStamp ( void )
-{
-    FILETIME ft;
-    GetSystemTimeAsFileTime ( & ft );
-    return FILETIME2KTime ( & ft );
-}
-
-
-/*--------------------------------------------------------------------------
- * SYSTEMTIME
- */
-
-static
-int SYSTEMTIME_compare ( const SYSTEMTIME *a, const SYSTEMTIME *b )
-{
-    int diff = a -> wMonth - b -> wMonth;
-    if ( diff == 0 )
-    {
-        diff = a -> wDay - b -> wDay;
-        if ( diff == 0 )
-        {
-            diff = a -> wHour - b -> wHour;
-            if ( diff == 0 )
-            {
-                diff = a -> wMinute - b -> wMinute;
-                if ( diff == 0 )
-                    diff = a -> wSecond - b -> wSecond;
-            }
-        }
-    }
-    return diff;
-}
-
-static
-void SYSTEMTIME_from_half_baked_SYSTEMTIME ( const SYSTEMTIME *half_baked, SYSTEMTIME *proper, WORD year )
-{
-    int i;
-    FILETIME ft;
-
-    * proper = * half_baked;
-
-    /* fix some stuff */
-    proper -> wYear = year;
-    proper -> wMonth = half_baked -> wMonth;
-    proper -> wDayOfWeek = 0; /* ignored */
-    proper -> wDay = 1;
-    proper -> wHour = half_baked -> wHour;
-    proper -> wMinute = 0;
-    proper -> wSecond = 0;
-    proper -> wMilliseconds = 0;
-
-    /* convert it to FILETIME and back, just to get the proper day of week
-       if there's a better way to do it, go ahead.
-       by now, my lunch is too difficult to keep down... */
-    SystemTimeToFileTime ( proper, & ft );
-    FileTimeToSystemTime ( & ft, proper );
-
-    /* now, move ahead to the day of week */
-    proper -> wDay += half_baked -> wDayOfWeek - proper -> wDayOfWeek;
-    if ( half_baked -> wDayOfWeek < proper -> wDayOfWeek )
-        proper -> wDay += 7;
-    proper -> wDayOfWeek = half_baked -> wDayOfWeek;
-
-    /* now find the occurrence of the weekday */
-    if ( half_baked -> wDay > 1 )
-        proper -> wDay += ( half_baked -> wDay - 1 ) * 7;
-}
-
-/*--------------------------------------------------------------------------
- * KTime
- *  simple time structure
- */
-
-
-/* Make
- *  make KTime from struct tm
- */
-static
-void KTimeMake ( KTime *kt, const SYSTEMTIME *st )
-{
-    kt -> year = st -> wYear;
-    kt -> month = st -> wMonth - 1;
-    kt -> day = st -> wDay - 1;
-    kt -> weekday = st -> wDayOfWeek;
-    kt -> hour = ( uint8_t ) st -> wHour;
-    kt -> minute = ( uint8_t ) st -> wMinute;
-    kt -> second = ( uint8_t ) st -> wSecond;
-}
-
-
-/* Local
- *  populate "kt" from "ts" in local time zone
- */
-LIB_EXPORT const KTime* CC KTimeLocal ( KTime *kt, KTime_t ts )
-{
-    if ( kt != NULL )
-    {
-        DWORD tz_id;
-        FILETIME ft;
-        SYSTEMTIME gst, lst;
-        TIME_ZONE_INFORMATION tz;
-
-        /* generate windows time in 100nS units */
-        KTime2FILETIME ( ts, & ft );
-
-        /* generate a system time - almost what we need,
-           except it's GMT and has no associated time zone */
-        FileTimeToSystemTime ( & ft, & gst );
-
-        /* assume we're NOT in DST */
-        kt -> dst = false;
-
-        /* get local timezone information */
-        tz_id = GetTimeZoneInformation ( & tz );
-        switch ( tz_id )
-        {
-        case TIME_ZONE_ID_STANDARD:
-        case TIME_ZONE_ID_DAYLIGHT:
-
-            /* convert GMT time to local time with tz info */
-            SystemTimeToTzSpecificLocalTime ( & tz, & gst, & lst );
-            KTimeMake ( kt, & lst );
-
-            /* our gentle brothers and sisters in Redmond never
-               cease to amaze... it's very nice - handy, even -
-               to know that the system is "currently" operating
-               in one mode or another, but that tells us nothing
-               about the timestamp we're trying to interpret.
-
-               to discover whether the timestamp we're converting
-               is within daylight savings time, we can compare against
-               the two railpost SYSTEMTIME entries, but then there's
-               no telling whether we're in or out since the calendar
-               is circular! aside from having to perform a multi-part
-               comparison, we'll come to different conclusions depending
-               upon whether the hemisphere is northern or southern!
-
-               to disambiguate, we can use tz_id to detect hemisphere,
-               and then know what's going on. Wow.
-
-               also, it's not clear to the author whether the returned
-               structures in tz will be proper or hacked, since the
-               MSDN descriptions only describe how to hack them for
-               input, but not how they will look on output. */
-
-            if ( tz . StandardDate . wMonth == 0 || tz . DaylightDate . wMonth == 0 )
-                kt -> tzoff = - ( int16_t ) tz . Bias;
-            else
-            {
-                bool south = tz_id == TIME_ZONE_ID_DAYLIGHT;
-
-                SYSTEMTIME cst, dst, std;
-                GetSystemTime ( & cst );
-
-                /* fill out proper structures, since those in tz are bad... */
-                SYSTEMTIME_from_half_baked_SYSTEMTIME ( & tz . DaylightDate, & dst, cst . wYear );
-                SYSTEMTIME_from_half_baked_SYSTEMTIME ( & tz . StandardDate, & std, cst . wYear );
-
-                /* perform northern test for DST */
-                if ( SYSTEMTIME_compare ( & lst, & dst ) >= 0 && SYSTEMTIME_compare ( & lst, & std ) < 0 )
-                    kt -> dst = true;
-
-                /* test to see which hemisphere */
-                south ^= ( SYSTEMTIME_compare ( & cst, & dst ) >= 0 && SYSTEMTIME_compare ( & cst, & std ) < 0 );
-
-                /* correct for southern hemisphere */
-                kt -> dst ^= south;
-
-                /* set the timezone offset */
-                kt -> tzoff = - ( int16_t ) ( tz . Bias +
-                    kt -> dst ? tz . DaylightBias : tz . StandardBias );
-            }
-            break;
-
-        default:
-
-            /* failed - use GMT instead */
-            KTimeMake ( kt, & gst );
-            kt -> tzoff = 0;
-        }
-    }
-    return kt;
-}
-
-
-/* Global
- *  populate "kt" from "ts" in GMT
- */
-LIB_EXPORT const KTime* CC KTimeGlobal ( KTime *kt, KTime_t ts )
-{
-    if ( kt != NULL )
-    {
-        FILETIME ft;
-        SYSTEMTIME gst;
-
-        /* generate windows time in 100nS units */
-        KTime2FILETIME ( ts, & ft );
-
-        /* generate a system time */
-        FileTimeToSystemTime ( & ft, & gst );
-
-	/* fill out GMT time structure */
-        KTimeMake ( kt, & gst );
-        kt -> tzoff = 0;
-        kt -> dst = false;
-    }
-    return kt;
-}
diff --git a/libs/klib/win/syswriter.c b/libs/klib/win/syswriter.c
deleted file mode 100644
index b204afc..0000000
--- a/libs/klib/win/syswriter.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <sysalloc.h>
-#include <windows.h>
-#include <klib/writer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include "writer-priv.h"
-#include <stdio.h>
-#include <errno.h>
-#include <stdarg.h>
-
-static HANDLE win_stdout;
-static HANDLE win_stderr;
-
-rc_t KWrtSysInit(void** h_stdout, void** h_stderr)
-{
-    win_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
-    win_stderr = GetStdHandle(STD_ERROR_HANDLE);
-
-    if( h_stdout ) {
-        *h_stdout = &win_stdout;
-    }
-    if( h_stderr ) {
-        *h_stderr = &win_stderr;
-    }
-    return 0;
-}
-
-LIB_EXPORT int CC snprintf ( char * buffer, size_t bufsize, const char * format, ... )
-{
-    int ret;
-    size_t size;
-    rc_t rc;
-    va_list args;
-
-    va_start (args, format);
-    rc = string_vprintf ( buffer, bufsize, &size, format, args );
-    if ( rc == 0 )
-    {
-        ret = size;
-    }
-    else
-    {
-        if ( ( GetRCState( rc ) == rcInsufficient )&&( GetRCObject( rc ) == rcBuffer ) )
-            ret = size;
-        else
-            ret = -1;
-    }
-/*    ret = _vsnprintf (buffer, bufsize, format, args); */
-    va_end (args);
-    return ret;
-}
-
-/* ----
- * write 'count' bytes starting at 'buf'  to a "stream/file" identified by 'fd'
- */
-rc_t CC KWrt_DefaultWriter( void * self, const char * buffer, size_t bufsize, size_t * num_writ )
-{
-    size_t total;
-    DWORD remaining;
-    int num_written;
-    const char * pbyte;
-    HANDLE handle;
-    rc_t rc;
-
-    handle = *(HANDLE *)self;
-    pbyte = buffer;
-    rc = 0;
-
-    total = 0;
-    for (remaining = bufsize; remaining > 0; remaining -= num_written)
-    {
-        if (WriteFile (handle, pbyte, remaining, &num_written, NULL) == 0)
-        {       
-            rc = RC ( rcApp, rcLog, rcWriting, rcTransfer, rcUnknown );
-            break;
-        }
-        else
-            total += num_written;
-    }
-    *num_writ = total;
-    return rc;
-}
-
-void print_int_fixup ( char * fmt, size_t * len, size_t max )
-{
-    char type;
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     * In windows we can't just return like this but instead:
-     *    save fmt[len-1]
-     *    replace 'j' with I64
-     *    replace 'z' or 't',  with 'I'
-     *    replace 'hh' with 'h'
-     *    append saved fmt[len-1] to its new place.
-     *
-     */
-    if (*len > 2)
-    {
-        if ((fmt [*len-3] == 'l') && (fmt [*len-2] == 'l'))
-        {
-            fmt [*len-2] = fmt [*len-1];
-            fmt [*len-1] = '\0';
-            --*len;
-        }
-    }
-    if (*len > 2)
-    {
-        switch (fmt[*len-2])
-        {
-        case 'h':
-            if (fmt[*len-3] == 'h')
-            {
-                fmt [*len-2] = fmt [*len-1];
-                fmt [*len-1] = '\0';
-                *len --;
-            }
-            break;
-
-        case 'z': /* 32-bit specific */
-        case 't':
-            fmt[*len-2] = 'l';
-            break;
-        case 'j':
-        case 'l':
-            type = fmt[*len-1];
-            fmt[*len-2] = 'I';
-            fmt[*len-1] = '6';
-            fmt[*len]   = '4';
-            fmt[*len+1] = type;
-            fmt[*len+2] = '\0';
-            *len += 2;
-            break;
-        }
-    }
-    return;
-}
-
-void print_float_fixup ( char * fmt, size_t * len, size_t max )
-{
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     */
-    return;
-}
-
-void print_char_fixup ( char * fmt, size_t * len, size_t max )
-{
-    /* all the Unix flavors support a real printf
-     * Only Windows does it "wrong".
-     */
-    return;
-}
diff --git a/libs/klib/writer-priv.h b/libs/klib/writer-priv.h
deleted file mode 100644
index 9a1c190..0000000
--- a/libs/klib/writer-priv.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_writer_priv_
-#define _h_writer_priv_
-
-#include <klib/writer.h>
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-rc_t KWrtSysInit(void** h_stdout, void** h_stderr);
-
-size_t KWrtFmt_rc_t  (char * buffer, size_t bufsize, const char * fmt, rc_t rc_in);
-size_t KWrtFmt_KTime_t (char * buffer, size_t bufsize, const char * fmt_ignored, KTime_t time_in);
-
-
-/* -----
- * write into the buffer a textual string describing the system specific
- * error code represented by the third parameter.  Will be NUL terminated.
- * expected to be used within string_printf and associated functions only.
- */
-size_t KWrtFmt_error_code (char * buffer, size_t bufsize, uint32_t error_code);
-
-/* -----
- * We have a default writer is the part that will possibly vary by O/S type
- */
-rc_t CC KWrt_DefaultWriter (void* data, const char * buffer, size_t bufsize, size_t * num_writ);
-
-/* -----
- * The default writer uses this data type object.
- * The actual definition might vary to work on non-Unix operating systems.  The port to Windows
- * might well force the full definition to a system file.
- */
-typedef struct KWrt_DefaultWriterData DefaultWriterData;
-
-/*
- * Windows or other O/S port might have to move this struct definition to a system specific file
- */
-struct KWrt_DefaultWriterData
-{
-    int sysfile_handle;
-};
-
-/*
- * We will have two common default writer data objects for the C library expected stdout and stderr
- *
- * These are the normal data stream and error data stream that will have to be set up for
- * windows console I/O
- */
-extern void *KWrt_DefaultWriterDataStdOut;
-extern void *KWrt_DefaultWriterDataStdErr;
-
-/* fix up windows printf shortcomings for integer types 
- * current format is len long at fmt with max max size for the format
- * len is updated to new length if fmt is changed
- */
-void print_int_fixup   (char * fmt, size_t * len, size_t max);
-void print_float_fixup (char * fmt, size_t * len, size_t max);
-void print_char_fixup  (char * fmt, size_t * len, size_t max);
-
-extern const char *gRCModule_str [];
-extern const char *gRCTarget_str [];
-extern const char *gRCContext_str [];
-extern const char *gRCObject_str [];
-extern const char *gRCState_str [];
-
-extern const char *gRCModuleIdx_str [];
-extern const char *gRCTargetIdx_str [];
-extern const char *gRCContextIdx_str [];
-extern const char *gRCObjectIdx_str [];
-extern const char *gRCStateIdx_str [];
-
-/* GetRCModuleText
- */
-const char *GetRCModuleText ( enum RCModule mod );
-
-/* GetRCTargetText
- */
-const char *GetRCTargetText ( enum RCTarget targ );
-
-/* GetRCContextText
- */
-const char *GetRCContextText ( enum RCContext ctx );
-
-/* GetRCObjectText
- *  obj can be RCTarget or RCObject
- */
-const char *GetRCObjectText ( int obj );
-
-/* GetRCStateText
- */
-const char *GetRCStateText ( enum RCState state );
-
-
-/* GetRCModuleIdxText
- */
-const char *GetRCModuleIdxText ( enum RCModule mod );
-
-/* GetRCTargetIdxText
- */
-const char *GetRCTargetIdxText ( enum RCTarget targ );
-
-/* GetRCContextIdxText
- */
-const char *GetRCContextIdxText ( enum RCContext ctx );
-
-/* GetRCObjectIdxText
- *  obj can be RCTarget or RCObject
- */
-const char *GetRCObjectIdxText ( int obj );
-
-/* GetRCStateIdxText
- */
-const char *GetRCStateIdxText ( enum RCState state );
-
-
-extern const char * RCModuleStrings[];
-extern const char * RCTargetStrings[];
-extern const char * RCContextStrings[];
-extern const char * RCObjectStrings[];
-extern const char * RCStateStrings[];
-
-enum ERCExplain2Options
-{
-    eRCExOpt_NoMessageIfNoError,
-    eRCExOpt_ObjAndStateOnlyIfError,
-    eRCExOpt_CompleteMsg
-};
-
-KLIB_EXTERN rc_t CC RCExplain2 ( rc_t rc, char *buffer, size_t bsize, size_t *num_writ, enum ERCExplain2Options options );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_writer_priv_ */
diff --git a/libs/klib/writer.c b/libs/klib/writer.c
deleted file mode 100644
index ebd6f66..0000000
--- a/libs/klib/writer.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/extern.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/sort.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include "writer-priv.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include <os-native.h>
-
-static char wrt_app[32];
-static size_t wrt_app_length;
-static char wrt_vers[16];
-static size_t wrt_vers_length;
-
-void* KWrt_DefaultWriterDataStdOut = NULL;
-void* KWrt_DefaultWriterDataStdErr = NULL;
-
-typedef struct RCCreateLoc RCCreateLoc;
-struct RCCreateLoc
-{
-    const char *filename;
-    const char *function;
-    uint32_t lineno;
-    rc_t rc;
-};
-
-static RCCreateLoc RC_loc_queue [ 4096 ];
-static atomic32_t RC_loc_reserve, RC_loc_written, RC_loc_read;
-#define RC_LOC_QUEUE_SIZE ( sizeof RC_loc_queue / sizeof RC_loc_queue [ 0 ] )
-#define RC_LOC_QUEUE_MASK ( RC_LOC_QUEUE_SIZE - 1 )
-
-/*
- *  "appname" [ IN ] - identity of executable, usually argv[0]
- *
- *  "vers" [ IN ] - 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-LIB_EXPORT rc_t CC KWrtInit( const char* appname, uint32_t vers )
-{
-    rc_t rc;
-
-    if ( appname == NULL )
-        return RC ( rcRuntime, rcLog, rcConstructing, rcString, rcNull );
-    if ( appname [ 0 ] == 0 )
-        return RC ( rcRuntime, rcLog, rcConstructing, rcString, rcEmpty );
-
-    do
-    {
-        const char* progname;
-        const char* ext;
-        size_t progname_z;
-
-        /* find whichever is last \ or / */
-        string_measure(appname, &progname_z);
-        progname = string_rchr(appname, progname_z, '/');
-        if( progname == NULL ) {
-            progname = appname;
-        } else {
-            progname++;
-            string_measure(progname, &progname_z);
-        }
-        appname = string_rchr(progname, progname_z, '\\');
-        if( appname == NULL ) {
-            appname = progname;
-        } else {
-            appname++;
-        }
-        string_measure(appname, &progname_z);
-
-        ext = string_chr(appname, progname_z, '.');
-
-        if( ext != NULL ) {
-            wrt_app_length = ext - appname;
-        } else {
-            wrt_app_length = progname_z;
-        }
-        if ( wrt_app_length >= sizeof(wrt_app) ) {
-            wrt_app_length = sizeof(wrt_app) - 1;
-        }
-        memcpy(wrt_app, appname, wrt_app_length);
-        wrt_app[wrt_app_length] = '\0';
-
-        rc = string_printf ( wrt_vers, sizeof wrt_vers, & wrt_vers_length, "%V", vers );
-        assert ( rc == 0 );
-
-        rc = KWrtSysInit(&KWrt_DefaultWriterDataStdOut, &KWrt_DefaultWriterDataStdErr);
-        if (rc) break;
-
-        rc = KOutInit();
-        if (rc) break;
-
-        rc = KLogInit();
-        if (rc) break;
-
-        rc = KStsInit();
-        if (rc) break;
-
-        rc = KDbgInit();
-    } while (0);
-
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * nvp - name/value pair
- */
-static
-int CC wrt_nvp_cmp_func(const void *a, const void *b, void * ignored)
-{
-    int i = 0;
-    const char *key = a;
-    const char *name = ( ( const wrt_nvp_t* ) b ) -> name;
-
-    while(key[i] == name[i]) {
-        if( key[i] == '\0' || name[i] == '\0' ) {
-            break;
-        }
-        i++;
-    }
-    /* treat \0 or right-paren as key terminator */
-    if( key[i] != 0 && key[i] != ')' ) {
-        return key[i] - name[i];
-    }
-    return 0 - name[i];
-}
-
-static
-int CC wrt_nvp_sort_func(const void *a, const void *b, void * ignored)
-{
-    const wrt_nvp_t *left = a;
-    const wrt_nvp_t *right = b;
-    return strcmp ( left -> name, right -> name );
-}
-
-LIB_EXPORT void CC wrt_nvp_sort( size_t argc, wrt_nvp_t argv[])
-{
-    if( argc > 1 ) {
-        ksort(argv, argc, sizeof(argv[0]), wrt_nvp_sort_func, NULL);
-    }
-}
-
-LIB_EXPORT const wrt_nvp_t* CC wrt_nvp_find( size_t argc, const wrt_nvp_t argv[], const char* key )
-{
-    if( argc > 0 ) {
-        return kbsearch(key, argv, argc, sizeof(argv[0]), wrt_nvp_cmp_func, NULL);
-    }
-    return NULL;
-}
-
-LIB_EXPORT const char* CC wrt_nvp_find_value( size_t argc, const wrt_nvp_t argv[], const char* key )
-{
-    if( argc > 0 ) {
-        const wrt_nvp_t* n = (const wrt_nvp_t*)kbsearch(key, argv, argc, sizeof(argv[0]), wrt_nvp_cmp_func, NULL);
-        if( n != NULL ) {
-            return n->value;
-        }
-    }
-    return NULL;
-}
-
-static
-rc_t RCLiteral ( rc_t self, char *buffer, size_t bsize, size_t *num_writ )
-{
-#if ! _DEBUGGING && RECORD_RC_FILE_LINE
-    ( void ) GetRCLineno ();
-#endif
-    return string_printf ( buffer, bsize, num_writ
-#if _DEBUGGING
-        , "rc = %s:%u:$s:%u.%u.%u.%u.%u"
-        , GetRCFilename(), GetRCLineno (), GetRCFunction ()
-#else
-        , "rc = %u.%u.%u.%u.%u"
-#endif
-        , ( uint32_t ) GetRCModule ( self )
-        , ( uint32_t ) GetRCTarget ( self )
-        , ( uint32_t ) GetRCContext ( self )
-        , ( uint32_t ) GetRCObject ( self )
-        , ( uint32_t ) GetRCState ( self )
-    );
-}
-
-LIB_EXPORT rc_t CC RCExplain ( rc_t rc, char *buffer, size_t bsize, size_t *num_writ )
-{
-    return RCExplain2
-        ( rc, buffer, bsize, num_writ, eRCExOpt_CompleteMsg );
-}
-
-LIB_EXPORT rc_t CC RCExplain2 ( rc_t rc, char *buffer, size_t bsize, size_t *num_writ,
-                                enum ERCExplain2Options options )
-{
-    bool noMessageIfNoError =
-        (options == eRCExOpt_NoMessageIfNoError || 
-         options == eRCExOpt_ObjAndStateOnlyIfError);
-    int len;
-    size_t total = 0;
-
-    const char *mod = GetRCModuleText ( GetRCModule ( rc ) );
-    const char *targ = GetRCTargetText ( GetRCTarget ( rc ) );
-    const char *ctx = GetRCContextText ( GetRCContext ( rc ) );
-    const char *obj = GetRCObjectText ( GetRCObject ( rc ) );
-    const char *state = GetRCStateText ( GetRCState ( rc ) );
-
-    assert( buffer && num_writ );
-
-    *num_writ = 0;
-    if( rc == 0 && noMessageIfNoError ) {
-        buffer[0] = '\0';
-        return 0;
-    }
-
-    /* English'ish formatting */
-#if _DEBUGGING
-    {
-        const char *function = GetRCFunction ();
-        if ( function != NULL )
-        {
-            len = snprintf(buffer + total, bsize - total, "%s:%u:%s: ", GetRCFilename(), GetRCLineno (), function );
-            if( len < 0 || ( total + len ) >= bsize ) {
-                return RCLiteral ( rc, buffer, bsize, num_writ );
-            }
-            total += len;
-        }
-    }
-#elif RECORD_RC_FILE_LINE
-    ( void ) GetRCLineno ();
-#endif
-    if( obj != NULL ) {
-        len = snprintf(buffer + total, bsize - total, "%s", obj);
-        if( len < 0 || ( total + len ) >= bsize ) {
-            return RCLiteral ( rc, buffer, bsize, num_writ );
-        }
-        total += len;
-    }
-    if( state != NULL ) {
-        len = snprintf(buffer + total, bsize - total, "%s%s", total ? " " : "", state);
-        if( len < 0 || ( total + len ) >= bsize ) {
-            return RCLiteral ( rc, buffer, bsize, num_writ );
-        }
-        total += len;
-    }
-    if( rc != 0 && options == eRCExOpt_CompleteMsg ) {
-        if( ctx != NULL ) {
-            len = snprintf ( buffer + total, bsize - total, "%swhile %s", total ? " " : "", ctx );
-            if ( len < 0 || ( total + len ) >= bsize ) {
-                return RCLiteral ( rc, buffer, bsize, num_writ );
-            }
-            total += len;
-            if( targ != NULL ) {
-                len = snprintf ( buffer + total, bsize - total, "%s%s", total ? " " : "", targ );
-                if( len < 0 || ( total + len ) >= bsize ) {
-                    return RCLiteral ( rc, buffer, bsize, num_writ );
-                }
-                total += len;
-            }
-        } else if( targ != NULL ) {
-            len = snprintf ( buffer + total,
-                bsize - total, "%swhile acting upon %s", total ? " " : "", targ );
-            if( len < 0 || ( total + len ) >= bsize ) {
-                return RCLiteral ( rc, buffer, bsize, num_writ );
-            }
-            total += len;
-        }
-    }
-    if( mod != NULL && options == eRCExOpt_CompleteMsg ) {
-        len = snprintf(buffer + total, bsize - total, "%swithin %s module", total ? " " : "", mod);
-        if( len < 0 || ( total + len ) >= bsize ) {
-            return RCLiteral ( rc, buffer, bsize, num_writ );
-        }
-        total += len;
-    }
-    *num_writ = total;
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * RC
- */
-
-
-/* GetRCModuleText
- */
-const char *GetRCModuleText ( enum RCModule mod )
-{
-    if ( ( int ) mod < 0 || ( int ) mod >= ( int ) rcLastModule_v1_1 )
-        return "<INVALID-MODULE>";
-    return gRCModule_str [ ( int ) mod ];
-}
-
-/* GetRCModuleIdxText
- */
-const char *GetRCModuleIdxText ( enum RCModule mod )
-{
-    if ( ( int ) mod < 0 || ( int ) mod >= ( int ) rcLastModule_v1_1 )
-        return "<INVALID-MODULE>";
-    return gRCModuleIdx_str [ ( int ) mod ];
-}
-
-/* GetRCTargetText
- */
-const char *GetRCTargetText ( enum RCTarget targ )
-{
-    if ( ( int ) targ < 0 || ( int ) targ >= ( int ) rcLastTarget_v1_1 )
-        return "<INVALID-TARGET>";
-    return gRCTarget_str [ ( int ) targ ];
-}
-
-/* GetRCTargetIdxText
- */
-const char *GetRCTargetIdxText ( enum RCTarget targ )
-{
-    if ( ( int ) targ < 0 || ( int ) targ >= ( int ) rcLastTarget_v1_1 )
-        return "<INVALID-TARGET>";
-    return gRCTargetIdx_str [ ( int ) targ ];
-}
-
-/* GetRCContextText
- */
-const char *GetRCContextText ( enum RCContext ctx )
-{
-    if ( ( int ) ctx < 0 || ( int ) ctx >= ( int ) rcLastContext_v1_1 )
-        return "<INVALID-CONTEXT>";
-    return gRCContext_str [ ( int ) ctx ];
-}
-
-/* GetRCContextIdxText
- */
-const char *GetRCContextIdxText ( enum RCContext ctx )
-{
-    if ( ( int ) ctx < 0 || ( int ) ctx >= ( int ) rcLastContext_v1_1 )
-        return "<INVALID-CONTEXT>";
-    return gRCContextIdx_str [ ( int ) ctx ];
-}
-
-/* GetRCObjectText
- */
-const char *GetRCObjectText ( int obj )
-{
-    if ( ( int ) obj < 0 || ( int ) obj >= ( int ) rcLastObject_v1_1 )
-        return "<INVALID-OBJECT>";
-    if ( ( int ) obj < ( int ) rcLastTarget_v1_1 )
-        return gRCTarget_str [ ( int ) obj ];
-    return gRCObject_str [ ( int ) obj - ( int ) ( rcLastTarget_v1_1 - 1 ) ];
-}
-
-/* GetRCObjectIdxText
- */
-const char *GetRCObjectIdxText ( int obj )
-{
-    if ( ( int ) obj < 0 || ( int ) obj >= ( int ) rcLastObject_v1_1 )
-        return "<INVALID-OBJECT>";
-    if ( ( int ) obj < ( int ) rcLastTarget_v1_1 )
-        return gRCTargetIdx_str [ ( int ) obj ];
-    return gRCObjectIdx_str [ ( int ) obj - ( int ) ( rcLastTarget_v1_1 - 1 ) ];
-}
-
-/* GetRCStateText
- */
-const char *GetRCStateText ( enum RCState state )
-{
-    if ( ( int ) state < 0 || ( int ) state >= ( int ) rcLastState_v1_1 )
-        return "<INVALID-STATE>";
-    return gRCState_str [ ( int ) state ];
-}
-
-/* GetRCStateIdxText
- */
-const char *GetRCStateIdxText ( enum RCState state )
-{
-    if ( ( int ) state < 0 || ( int ) state >= ( int ) rcLastState_v1_1 )
-        return "<INVALID-STATE>";
-    return gRCStateIdx_str [ ( int ) state ];
-}
-
-static
-uint32_t read_rc_loc_head ( void )
-{
-    int32_t idx = atomic32_read ( & RC_loc_written );
-    atomic32_set ( & RC_loc_read, idx );
-    return idx;
-}
-
-static
-const char *get_rc_filename ( uint32_t idx )
-{
-    const char *p = RC_loc_queue [ idx & RC_LOC_QUEUE_MASK ] . filename;
-    if( p != NULL )
-    {
-        int i;
-        const char *sep;
-        const char *RC_filename = p;
-#if WINDOWS
-        static char win_rc_filename [ 4096 ];
-        size_t w, len = string_copy_measure ( win_rc_filename, sizeof win_rc_filename - 1, p );
-        if ( len >= 2 && isalpha ( win_rc_filename [ 0 ] ) && win_rc_filename [ 1 ] == ':' )
-        {
-            win_rc_filename [ 1 ] = win_rc_filename [ 0 ];
-            win_rc_filename [ 0 ] = '/';
-        }
-        for ( w = 0; w < len; ++ w )
-        {
-            if ( win_rc_filename [ w ] == '\\' )
-                win_rc_filename [ w ] = '/';
-        }
-        p = RC_filename = win_rc_filename;
-#endif
-        if ( (p = strstr(RC_filename, "/interfaces/")) != NULL ||
-             (p = strstr(RC_filename, "/libs/")) != NULL ||
-             (p = strstr(RC_filename, "/services/")) != NULL ||
-             (p = strstr(RC_filename, "/tools/")) != NULL ||
-             (p = strstr(RC_filename, "/asm-trace/")) != NULL )
-        {
-            return p + 1;
-        }
-
-        for ( i = 0, sep = strrchr ( p = RC_filename, '/' ); sep != NULL && i < 3; ++ i )
-        {
-            p = sep + 1;
-            sep = string_rchr ( RC_filename, sep - RC_filename, '/' );
-        }
-    }
-
-    return p;
-}
-
-LIB_EXPORT const char * CC GetRCFilename ( void )
-{
-    return get_rc_filename ( read_rc_loc_head () );
-}
-
-/* InsertSpace
- *  inserts a division after current text
- *
- *  "spacer" [ IN, NULL OKAY ] - optional characters to insert
- */
-LIB_EXPORT rc_t CC LogInsertSpace(const char *spacer, char *buffer, size_t bsize, size_t *num_writ)
-{
-    int len;
-
-    if ( spacer == NULL )
-    {
-        if ( bsize < 2 )
-            return RC ( rcRuntime, rcLog, rcLogging, rcBuffer, rcInsufficient );
-        buffer [ 0 ] = ' ';
-        buffer [ 1 ] = 0;
-        * num_writ = 1;
-        return 0;
-    }
-
-    len = snprintf ( buffer, bsize, "%s", spacer );
-
-    * num_writ = len;
-
-    if ( len < 0 || (size_t)len >= bsize )
-    {
-        if ( len < 0 )
-            * num_writ = 0;
-        return RC ( rcRuntime, rcLog, rcLogging, rcBuffer, rcInsufficient );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC LogAppName(char *buffer, size_t bsize, size_t *num_writ)
-{
-    if( wrt_app_length > bsize ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcBuffer, rcInsufficient);
-    }
-    memcpy(buffer, wrt_app, wrt_app_length);
-    *num_writ = wrt_app_length;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC LogAppVersion(char *buffer, size_t bsize, size_t *num_writ)
-{
-    if( wrt_vers_length > bsize ) {
-        return RC(rcRuntime, rcLog, rcLogging, rcBuffer, rcInsufficient);
-    }
-    memcpy(buffer, wrt_vers, wrt_vers_length);
-    *num_writ = wrt_vers_length;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC LogFlush ( const KWrtHandler* handler, const char *buffer, const size_t bsize)
-{
-    rc_t rc = 0;
-    size_t num_written;
-    size_t remaining;
-
-    assert(handler != NULL);
-    assert(buffer != NULL);
-
-    for(remaining = bsize; rc == 0 && remaining > 0; remaining -= num_written, buffer += num_written) {
-        rc = handler->writer(handler->data, buffer, remaining, &num_written);
-    }
-    return rc;
-}
-
-static
-const char *get_rc_function ( uint32_t idx )
-{
-    return RC_loc_queue [ idx & RC_LOC_QUEUE_MASK ] . function;
-}
-
-LIB_EXPORT const char * CC GetRCFunction ( void )
-{
-    return get_rc_function ( read_rc_loc_head () );
-}
-
-static
-uint32_t get_rc_lineno ( uint32_t idx )
-{
-    return RC_loc_queue [ idx & RC_LOC_QUEUE_MASK ] . lineno;
-}
-
-LIB_EXPORT uint32_t CC GetRCLineno ( void )
-{
-    return get_rc_lineno ( read_rc_loc_head () );
-}
-
-static
-rc_t get_rc_code ( uint32_t idx )
-{
-    return RC_loc_queue [ idx & RC_LOC_QUEUE_MASK ] . rc;
-}
-
-LIB_EXPORT rc_t CC SetRCFileFuncLine ( rc_t rc, const char *filename, const char *funcname, uint32_t lineno )
-{
-    /* the limit based upon last guy successfully written */
-    int32_t lim = atomic32_read ( & RC_loc_written ) + RC_LOC_QUEUE_SIZE;
-
-    /* try to reserve a slot for writing */
-    int32_t rsrv = atomic32_read_and_add_lt ( & RC_loc_reserve, 1, lim ) + 1;
-
-    /* see if we got the reservation */
-    if ( rsrv <= lim )
-    {
-        uint32_t idx = rsrv & RC_LOC_QUEUE_MASK;
-        RC_loc_queue [ idx ] . filename = filename;
-        RC_loc_queue [ idx ] . function = funcname;
-        RC_loc_queue [ idx ] . lineno = lineno;
-        RC_loc_queue [ idx ] . rc = rc;
-        /* TBD - proper release sequence */
-        atomic32_set ( & RC_loc_written, rsrv );
-    }
-
-    return rc;
-}
-
-/* GetUnreadRCInfo
- *  expected to be called after all threads are quiet
- */
-LIB_EXPORT bool CC GetUnreadRCInfo ( rc_t *rc, const char **filename, const char **funcname, uint32_t *lineno )
-{
-    /* these are not atomic, but the ordering is important */
-    int32_t last_writ = atomic32_read ( & RC_loc_written );
-    if ( last_writ > 0 )
-    {
-        /* this arrangement attempts to make the access to
-           RC_loc_read dependent upon access to RC_loc_written */
-        int32_t last_read = atomic32_read ( & RC_loc_read );
-        if ( last_read < last_writ )
-        {
-            /* check reserved slots */
-            int32_t rsrv = atomic32_read ( & RC_loc_reserve );
-
-            /* adjust last read */
-            if ( last_writ - last_read > RC_LOC_QUEUE_SIZE )
-                last_read = last_writ - RC_LOC_QUEUE_SIZE;
-
-            /* any reserved rows must be considered overwritten */
-            last_read += rsrv - last_writ;
-
-            /* these are the rows we can report */
-            if ( last_read < last_writ )
-            {
-                int32_t idx = last_read + 1;
-                atomic32_set ( & RC_loc_read, idx );
-
-                if ( filename != NULL )
-                    * filename = get_rc_filename ( idx );
-                if ( funcname != NULL )
-                    * funcname = get_rc_function ( idx );
-                if ( lineno != NULL )
-                    * lineno = get_rc_lineno ( idx );
-                if ( rc != NULL )
-                    * rc = get_rc_code ( idx );
-
-                return true;
-            }
-        }
-    }
-    return false;
-}
diff --git a/libs/kns/KCurlFile.c b/libs/kns/KCurlFile.c
deleted file mode 100644
index 18ff995..0000000
--- a/libs/kns/KCurlFile.c
+++ /dev/null
@@ -1,716 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/* NOTE: uses VFS not KNS extern.h */
-#include <vfs/extern.h>
-
-struct KCurlFile;
-#define KFILE_IMPL struct KCurlFile
-#include <kfs/impl.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <kns/manager.h>
-
-#include "kns_mgr_priv.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define HTTP_RESPONSE_CODE_0_VALID false
-
-/*--------------------------------------------------------------------------
- * KCurFile
- */
-
-typedef struct KCurlFile
-{
-    KFile dad;
-    uint64_t file_size;
-    struct KNSManager *kns_mgr;
-    CURL *curl_handle;
-    bool file_size_valid;
-    bool verbose;
-    bool is_ftp;
-    char url[ 1 ];
-} KCurlFile;
-
-
-typedef struct ReadContext
-{
-    CURL *curl_handle;
-    uint8_t * buffer;
-    size_t buffer_size;
-    size_t num_read;
-    bool curl_handle_prepared;
-} ReadContext;
-
-static
-const char *curly_errstr ( CURLcode code )
-{
-    switch ( ( int ) code )
-    {
-#define CURL_CASE( c ) \
-        case c: return # c
-#define CURL_CASE2( c, old ) \
-        case old: return # c "(" #old ")"
-
-        CURL_CASE ( CURLE_OK );
-        CURL_CASE ( CURLE_UNSUPPORTED_PROTOCOL );
-        CURL_CASE ( CURLE_FAILED_INIT );
-        CURL_CASE ( CURLE_URL_MALFORMAT );
-        CURL_CASE2 ( CURLE_OBSOLETE4, CURLE_URL_MALFORMAT_USER );
-        CURL_CASE ( CURLE_COULDNT_RESOLVE_PROXY );
-        CURL_CASE ( CURLE_COULDNT_RESOLVE_HOST );
-        CURL_CASE ( CURLE_COULDNT_CONNECT );
-        CURL_CASE ( CURLE_FTP_WEIRD_SERVER_REPLY );
-        CURL_CASE2 ( CURLE_REMOTE_ACCESS_DENIED, CURLE_FTP_ACCESS_DENIED );
-        CURL_CASE2 ( CURLE_OBSOLETE10, CURLE_FTP_USER_PASSWORD_INCORRECT );
-        CURL_CASE ( CURLE_FTP_WEIRD_PASS_REPLY );
-        CURL_CASE2 ( CURLE_OBSOLETE12, CURLE_FTP_WEIRD_USER_REPLY );
-        CURL_CASE ( CURLE_FTP_WEIRD_PASV_REPLY );
-        CURL_CASE ( CURLE_FTP_WEIRD_227_FORMAT );
-        CURL_CASE ( CURLE_FTP_CANT_GET_HOST );
-        CURL_CASE2 ( CURLE_OBSOLETE16, CURLE_FTP_CANT_RECONNECT );
-        CURL_CASE2 ( CURLE_FTP_COULDNT_SET_TYPE, CURLE_FTP_COULDNT_SET_BINARY );
-        CURL_CASE ( CURLE_PARTIAL_FILE );
-        CURL_CASE ( CURLE_FTP_COULDNT_RETR_FILE );
-        CURL_CASE2 ( CURLE_OBSOLETE20, CURLE_FTP_WRITE_ERROR );
-        CURL_CASE2 ( CURLE_QUOTE_ERROR, CURLE_FTP_QUOTE_ERROR );
-        CURL_CASE ( CURLE_HTTP_RETURNED_ERROR );
-        CURL_CASE ( CURLE_WRITE_ERROR );
-        CURL_CASE2 ( CURLE_OBSOLETE24, CURLE_MALFORMAT_USER );
-        CURL_CASE2 ( CURLE_UPLOAD_FAILED, CURLE_FTP_COULDNT_STOR_FILE );
-        CURL_CASE ( CURLE_READ_ERROR );
-        CURL_CASE ( CURLE_OUT_OF_MEMORY );
-        CURL_CASE ( CURLE_OPERATION_TIMEDOUT );
-        CURL_CASE2 ( CURLE_OBSOLETE29, CURLE_FTP_COULDNT_SET_ASCII );
-        CURL_CASE ( CURLE_FTP_PORT_FAILED );
-        CURL_CASE ( CURLE_FTP_COULDNT_USE_REST );
-        CURL_CASE2 ( CURLE_OBSOLETE32, CURLE_FTP_COULDNT_GET_SIZE );
-        CURL_CASE2 ( CURLE_RANGE_ERROR, CURLE_HTTP_RANGE_ERROR );
-        CURL_CASE ( CURLE_HTTP_POST_ERROR );
-        CURL_CASE ( CURLE_SSL_CONNECT_ERROR );
-        CURL_CASE ( CURLE_BAD_DOWNLOAD_RESUME );
-        CURL_CASE ( CURLE_FILE_COULDNT_READ_FILE );
-        CURL_CASE ( CURLE_LDAP_CANNOT_BIND );
-        CURL_CASE ( CURLE_LDAP_SEARCH_FAILED );
-        CURL_CASE2 ( CURLE_OBSOLETE40, CURLE_LIBRARY_NOT_FOUND );
-        CURL_CASE ( CURLE_FUNCTION_NOT_FOUND );
-        CURL_CASE ( CURLE_ABORTED_BY_CALLBACK );
-        CURL_CASE ( CURLE_BAD_FUNCTION_ARGUMENT );
-        CURL_CASE2 ( CURLE_OBSOLETE44, CURLE_BAD_CALLING_ORDER );
-        CURL_CASE ( CURLE_INTERFACE_FAILED );
-        CURL_CASE2 ( CURLE_OBSOLETE46, CURLE_BAD_PASSWORD_ENTERED );
-        CURL_CASE ( CURLE_TOO_MANY_REDIRECTS );
-        CURL_CASE ( CURLE_UNKNOWN_TELNET_OPTION );
-        CURL_CASE ( CURLE_TELNET_OPTION_SYNTAX );
-        CURL_CASE2 ( CURLE_OBSOLETE50, CURLE_OBSOLETE );
-        CURL_CASE2 ( CURLE_PEER_FAILED_VERIFICATION, CURLE_SSL_PEER_CERTIFICATE );
-        CURL_CASE ( CURLE_GOT_NOTHING );
-        CURL_CASE ( CURLE_SSL_ENGINE_NOTFOUND );
-        CURL_CASE ( CURLE_SSL_ENGINE_SETFAILED );
-        CURL_CASE ( CURLE_SEND_ERROR );
-        CURL_CASE ( CURLE_RECV_ERROR );
-        CURL_CASE2 ( CURLE_OBSOLETE57, CURLE_SHARE_IN_USE );
-        CURL_CASE ( CURLE_SSL_CERTPROBLEM );
-        CURL_CASE ( CURLE_SSL_CIPHER );
-        CURL_CASE ( CURLE_SSL_CACERT );
-        CURL_CASE ( CURLE_BAD_CONTENT_ENCODING );
-        CURL_CASE ( CURLE_LDAP_INVALID_URL );
-        CURL_CASE ( CURLE_FILESIZE_EXCEEDED );
-        CURL_CASE2 ( CURLE_USE_SSL_FAILED, CURLE_FTP_SSL_FAILED );
-        CURL_CASE ( CURLE_SEND_FAIL_REWIND );
-        CURL_CASE ( CURLE_SSL_ENGINE_INITFAILED );
-        CURL_CASE ( CURLE_LOGIN_DENIED );
-        CURL_CASE ( CURLE_TFTP_NOTFOUND );
-        CURL_CASE ( CURLE_TFTP_PERM );
-        CURL_CASE2 ( CURLE_REMOTE_DISK_FULL, CURLE_TFTP_DISKFULL );
-        CURL_CASE ( CURLE_TFTP_ILLEGAL );
-        CURL_CASE ( CURLE_TFTP_UNKNOWNID );
-        CURL_CASE2 ( CURLE_REMOTE_FILE_EXISTS, CURLE_TFTP_EXISTS );
-        CURL_CASE ( CURLE_TFTP_NOSUCHUSER );
-        CURL_CASE ( CURLE_CONV_FAILED );
-        CURL_CASE ( CURLE_CONV_REQD );
-        CURL_CASE2 ( CURLE_SSL_CACERT_BADFILE, 77 );
-        CURL_CASE2 ( CURLE_REMOTE_FILE_NOT_FOUND, 78 );
-        CURL_CASE2 ( CURLE_SSH, 79 );        
-        CURL_CASE2 ( CURLE_SSL_SHUTDOWN_FAILED, 80 );
-        CURL_CASE2 ( CURLE_AGAIN, 81 );
-        CURL_CASE ( CURLE_SSL_CRL_BADFILE );
-        CURL_CASE2 ( CURLE_SSL_ISSUER_ERROR, 83 );
-    }
-
-    return "<UNKNOWN>";
-}
-
-
-/* Destroy
- */
-static rc_t CC KCurlFileDestroy( KCurlFile *self )
-{
-    self->kns_mgr->curl_easy_cleanup_fkt( self->curl_handle );
-    KNSManagerRelease( self->kns_mgr );
-    free ( self );
-    return 0;
-}
-
-
-static struct KSysFile* KCurlFileGetSysFile( const KCurlFile *self, uint64_t *offset )
-{
-    * offset = 0;
-    return NULL;
-}
-
-
-static rc_t KCurlFileRandomAccess( const KCurlFile *self )
-{
-    return 0;
-}
-
-
-static size_t CC dummy_callback( void *ptr, size_t size, size_t nmemb, void *data )
-{
-    ( void )ptr;
-    ( void )data;
-    return (size_t)( size * nmemb );
-}
-
-
-static size_t CC KCurlFileCallback( void *ptr, size_t size, size_t nmemb, void *data )
-{
-    size_t given_bytes = size * nmemb; /* calculate the size given in ptr */
-    ReadContext *ctx = ( ReadContext * )data;
-    if ( ctx != NULL && ctx->buffer != NULL && ctx->buffer_size > 0 )
-    {
-        if ( ( ctx->num_read + given_bytes ) > ctx->buffer_size )
-        {
-            /* the caller-provided buffer IS NOT enough... */
-            size_t to_copy = ( ctx->buffer_size - ctx->num_read );
-            if ( to_copy > 0 )
-            {
-                /* the caller-provided buffer can hold a part of it... */
-                if ( ctx->buffer )
-                {
-                    memcpy( &( ctx->buffer[ ctx->num_read ] ), ptr, to_copy );
-                    ctx->num_read += to_copy;
-                }
-            }
-        }
-        else
-        {
-            /* the caller-provided buffer IS enough... */
-            if ( ctx->buffer )
-            {
-                memcpy( &( ctx->buffer[ ctx->num_read ] ), ptr, given_bytes );
-                ctx->num_read += given_bytes;
-            }
-        }
-    }
-    return given_bytes;
-}
-
-
-/* helper to set a curl-option which is a long int */
-static rc_t set_curl_long_option( struct KNSManager *kns_mgr, CURL *curl,
-                                  CURLoption option, long int value, const char *err_txt )
-{
-    rc_t rc = 0;
-    CURLcode rcc = kns_mgr->curl_easy_setopt_fkt( curl, option, value );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, "curl_easy_setopt( $(t), $(v) ) failed with curl-error $(e)", 
-                                  "t=%s,v=%d,e=%d", err_txt, value, rcc ) );
-    }
-    return rc;
-}
-
-
-/* helper to set a curl-option which is a void pointert */
-static rc_t set_curl_void_ptr( struct KNSManager *kns_mgr, CURL *curl,
-                               CURLoption option, void * value, const char *err_txt )
-{
-    rc_t rc = 0;
-    CURLcode rcc = kns_mgr->curl_easy_setopt_fkt( curl, option, value );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, "curl_easy_setopt( $(t) ... void * ptr ) failed with curl-error $(e)",
-                                  "t=%s,e=%d", err_txt, rcc ) );
-    }
-    return rc;
-}
-
-
-static rc_t perform( struct KNSManager *kns_mgr, CURL *curl, const char * action, uint64_t pos, size_t len )
-{
-    rc_t rc = 0;
-    CURLcode rcc = kns_mgr->curl_easy_perform_fkt( curl );
-    if ( rcc != CURLE_OK && rcc != CURLE_PARTIAL_FILE )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, 
-        "curl_easy_perform( $(a), $(b).$(c) ) failed with curl-error '$(d)' ($(e))",
-        "a=%s,b=%lu,c=%zu,d=%s,e=%d", action, pos, len, curly_errstr ( rcc ), rcc ) );
-    }
-    return rc;
-}
-
-
-static rc_t check_response_code( struct KNSManager *kns_mgr, CURL *curl,  const char * action )
-{
-    rc_t rc = 0;
-    long response_code;
-
-    CURLcode rcc = kns_mgr->curl_easy_getinfo_fkt( curl, CURLINFO_RESPONSE_CODE, &response_code );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, 
-        "curl_easy_getinfo( $(a) ) failed with curl-error $(c)",
-        "a=%s,c=%d", action, rcc ) );
-    }
-    else
-    {
-        switch ( response_code )
-        {
-
-            case 0    : if ( !HTTP_RESPONSE_CODE_0_VALID )  /* no response code available */
-                        {
-                            rc = RC( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-                            (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-                        }
-                        break;
-
-            case 200  :          /* OK */
-            case 206  :          /* Partial Content */
-            case 416  : break;   /* Requested Range Not Satisfiable */
-
-            case 404  : rc = RC( rcFS, rcFile, rcAccessing, rcFileDesc, rcNotFound );
-                        break;
-
-            default   : rc = RC( rcFS, rcFile, rcAccessing, rcFileDesc, rcInvalid );
-                        (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t prepare_curl( const KCurlFile *cself, ReadContext *ctx )
-{
-    rc_t rc = 0;
-
-    if ( !ctx->curl_handle_prepared )
-    {
-        ctx->curl_handle = cself->kns_mgr->curl_easy_init_fkt();
-        if ( ctx->curl_handle == NULL )
-        {
-            rc = RC( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-            LOGERR( klogErr, rc, "cannot init curl" );
-        }
-        else
-            ctx->curl_handle_prepared = true;
-    }
-
-    if ( rc == 0 && cself->verbose )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_VERBOSE, 1, "CURLOPT_VERBOSE" );
-
-    if ( rc == 0 )
-    {
-        CURLcode rcc = cself->kns_mgr->curl_easy_setopt_fkt( ctx->curl_handle, CURLOPT_WRITEFUNCTION, KCurlFileCallback );
-        if ( rcc != CURLE_OK )
-        {
-            rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-            (void)PLOGERR( klogErr, ( klogErr, rc, "curl_easy_setopt( $(t) ... ptr ) failed", "t=%s", "CURLOPT_WRITEFUNCTION" ) );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = set_curl_void_ptr( cself->kns_mgr, ctx->curl_handle, CURLOPT_URL, ( void * )cself->url, "CURLOPT_URL" );
-
-    if ( rc == 0 )
-    {
-        ctx->buffer = NULL;
-        ctx->buffer_size = 0;
-        ctx->num_read = 0;
-    }
-    return rc;
-}
-
-
-static rc_t get_content_length( struct KNSManager *kns_mgr, CURL *curl, uint64_t *size )
-{
-    rc_t rc = 0;
-    double double_size;
-    CURLcode rcc = kns_mgr->curl_easy_getinfo_fkt( curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &double_size );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        LOGERR( klogErr, rc, "curl_easy_getinfo( CURLINFO_CONTENT_LENGTH_DOWNLOAD ) failed" );
-    }
-    else
-    {
-        *size = double_size;
-    }
-    return rc;
-}
-
-
-static rc_t DiscoverFileSize_HTTP( const KCurlFile *cself, ReadContext *ctx, uint64_t *size )
-{
-    rc_t rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_HEADER, 1, "CURLOPT_HEADER" );
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_NOBODY, 1, "CURLOPT_NOBODY" );
-
-    if ( rc == 0 )
-        rc = set_curl_void_ptr( cself->kns_mgr, ctx->curl_handle, CURLOPT_WRITEDATA, ctx, "CURLOPT_WRITEDATA" );
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_FOLLOWLOCATION, 1, "CURLOPT_FOLLOWLOCATION" );
-
-    if ( rc == 0 )
-        rc = perform( cself->kns_mgr, ctx->curl_handle, "filesize http", 0, 0 );
-
-    if ( rc == 0 )
-        rc = check_response_code( cself->kns_mgr, ctx->curl_handle, "filesize http" );
-
-    if ( rc == 0 )
-        rc = get_content_length( cself->kns_mgr, ctx->curl_handle, size );
-
-    return rc;
-}
-
-static rc_t DiscoverFileSize_FTP( const KCurlFile *cself, ReadContext *ctx, uint64_t *size )
-{
-    rc_t rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_NOBODY, 1, "CURLOPT_NOBODY" );
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_FILETIME, 1, "CURLOPT_FILETIME" );
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_FOLLOWLOCATION, 1, "CURLOPT_FOLLOWLOCATION" );
-
-    if ( rc == 0 )
-    {
-        CURLcode rcc = cself->kns_mgr->curl_easy_setopt_fkt( ctx->curl_handle, CURLOPT_HEADERFUNCTION, dummy_callback );
-        if ( rcc != CURLE_OK )
-        {
-            rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-            (void)PLOGERR( klogErr, ( klogErr, rc, "curl_easy_setopt( $(t) ... ptr ) failed", "t=%s", "CURLOPT_HEADERFUNCTION" ) );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( cself->kns_mgr, ctx->curl_handle, CURLOPT_HEADER, 0, "CURLOPT_HEADER" );
-
-    if ( rc == 0 )
-        rc = perform( cself->kns_mgr, ctx->curl_handle, "filesize ftp", 0, 0 );
-
-    if ( rc == 0 )
-        rc = get_content_length( cself->kns_mgr, ctx->curl_handle, size );
-
-    return rc;
-}
-
-
-static rc_t KCurlFileDiscoverSize( const KCurlFile *cself, uint64_t *size )
-{
-    ReadContext ctx;
-    rc_t rc;
-
-    memset( &ctx, 0, sizeof ctx );
-    rc = prepare_curl( cself, &ctx );
-    if ( rc == 0 )
-    {
-        if ( cself->is_ftp )
-            rc = DiscoverFileSize_FTP( cself, &ctx, size );
-        else
-            rc = DiscoverFileSize_HTTP( cself, &ctx, size );
-
-        if ( rc == 0 )
-        {
-            KCurlFile *self = ( KCurlFile * )cself;
-
-            self->file_size = *size;
-            self->file_size_valid = true;
-    /*        OUTMSG(( ">>>>>>>>>>>>>> and the file size is: %lu\n", self->file_size )); */
-        }
-
-        if ( ctx.curl_handle_prepared )
-            cself->kns_mgr->curl_easy_cleanup_fkt( ctx.curl_handle );
-    }
-    return rc;
-}
-
-
-static rc_t KCurlFileSize( const KCurlFile *self, uint64_t *size )
-{
-    rc_t rc = 0;
-    if ( self->file_size_valid )
-        *size = self->file_size;
-    else
-        rc = KCurlFileDiscoverSize( self, size );
-    return rc;
-}
-
-
-static rc_t KCurlFileSetSize( KCurlFile *self, uint64_t size )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFile, rcReadonly );
-}
-
-
-static rc_t KCurlFileRead( const KCurlFile *cself, uint64_t pos,
-                           void *buffer, size_t bsize, size_t *num_read )
-{
-    ReadContext ctx;
-    rc_t rc;
-
-    if ( cself->file_size_valid && cself->file_size > 0 )
-    {
-        /* we know the size of the remote file */
-        if ( pos >= cself->file_size )
-        {
-            /* the caller requested to read beyond the end of the file */
-            *num_read = 0;
-            return 0;
-        }
-        else if ( pos + bsize > cself->file_size )
-        {
-            /* the caller requested to start reading inside the file, but bsize reaches beyond the end of the file */
-            bsize = ( cself->file_size - pos );
-        }
-    }
-
-    ctx.curl_handle = cself->curl_handle;
-    ctx.curl_handle_prepared = true;
-    rc = prepare_curl( cself, &ctx );
-    if ( rc == 0 )
-    {
-        char s_range[ 64 ];
-        size_t s_range_writ;
-        uint64_t to = pos;
-        to += bsize;
-        to --;
-
-        /* perform range-read... */
-        rc = string_printf( s_range, sizeof s_range, &s_range_writ, "%lu-%lu", pos, to );
-        if ( rc == 0 )
-        {
-            ReadContext ctx;
-            CURLcode rcc;
-
-            ctx.buffer = buffer;
-            ctx.buffer_size = bsize;
-            ctx.num_read = 0;
-
-            rcc = cself->kns_mgr->curl_easy_setopt_fkt( cself->curl_handle, CURLOPT_WRITEDATA, (void *)&ctx );
-            if ( rcc != CURLE_OK )
-            {
-                rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_WRITEDATA ) failed" );
-            }
-
-            if ( rc == 0 )
-                rc = set_curl_long_option( cself->kns_mgr, cself->curl_handle, CURLOPT_CONNECTTIMEOUT, 10, "CURLOPT_CONNECTTIMEOUT" );
-            if ( rc == 0 )
-                rc = set_curl_long_option( cself->kns_mgr, cself->curl_handle, CURLOPT_TIMEOUT, 10, "CURLOPT_TIMEOUT" );
-            if ( rc == 0 )
-                rc = set_curl_long_option( cself->kns_mgr, cself->curl_handle, CURLOPT_FOLLOWLOCATION, 1, "CURLOPT_FOLLOWLOCATION" );
-
-            if ( rc == 0 )
-            {
-                rcc = cself->kns_mgr->curl_easy_setopt_fkt( cself->curl_handle, CURLOPT_RANGE, (void*)s_range );
-                if ( rcc != CURLE_OK )
-                {
-                    rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                    LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_RANGE ) failed" );
-                }
-            }
-
-            if ( rc == 0 )
-                rc = perform( cself->kns_mgr, cself->curl_handle, "FileRead", pos, bsize );
-
-            if ( rc == 0 )
-            {
-                long response_code;
-                rcc = cself->kns_mgr->curl_easy_getinfo_fkt( cself->curl_handle, CURLINFO_RESPONSE_CODE, &response_code );
-                if ( rcc != CURLE_OK )
-                {
-                    rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                    LOGERR( klogErr, rc, "curl_easy_getinfo( RESPONSE_CODE ) failed" );
-                }
-                else
-                {
-                    if ( cself->is_ftp )
-                    {
-                        switch ( response_code )
-                        {
-                            case 0    : if ( !HTTP_RESPONSE_CODE_0_VALID )  /* no response code available */
-                                        {
-                                            rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                                            (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-                                        }
-                                        break;
-
-                            case 226  :
-                            case 213  :
-                            case 450  :          /* Transfer aborted */
-                            case 451  : break;
-
-                            default : rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                                      (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-                        }
-                    }
-                    else
-                    {
-                        switch ( response_code )
-                        {
-                            case 0    : if ( !HTTP_RESPONSE_CODE_0_VALID )  /* no response code available */
-                                        {
-                                            rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                                            (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-                                        }
-                                        break;
-
-                            case 416 :          /* Requested Range Not Satisfiable */
-                                       ctx.num_read = 0;
-                            case 200 :          /* OK */
-                            case 206 :          /* Partial Content */
-                                       break;
-
-                            case 404 : rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcNotFound );
-                                       break;
-
-                            default : rc = RC( rcFS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                                      (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-                        }
-                    }
-                }
-            }
-            if ( rc == 0 )
-                *num_read = ctx.num_read;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t KCurlFileWrite( KCurlFile *self, uint64_t pos,
-                            const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcInterface, rcUnsupported );
-}
-
-
-static KFile_vt_v1 vtKCurlFile =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KCurlFileDestroy,
-    KCurlFileGetSysFile,
-    KCurlFileRandomAccess,
-    KCurlFileSize,
-    KCurlFileSetSize,
-    KCurlFileRead,
-    KCurlFileWrite
-    /* end minor version 0 methods */
-};
-
-
-LIB_EXPORT rc_t CC KCurlFileMake( const KFile **fp, const char * url, bool verbose )
-{
-    rc_t rc = 0;
-    KCurlFile *f;
-
-    if ( url == NULL || url[ 0 ] == 0 )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        PLOGERR( klogInt, ( klogInt, rc, "invalid url >$(URL)<", "URL=%s", url ) );
-    }
-    else
-    {
-        size_t url_len = string_size( url ) + 1;
-        f = calloc ( ( sizeof *f ) + url_len, 1 );
-        if ( f == NULL )
-        {
-            rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            LOGERR( klogErr, rc, "out of memory" );
-        }
-        else
-        {
-            rc = KNSManagerMake( &f->kns_mgr );
-            if ( rc == 0 )
-            {
-                rc = KNSManagerAvail( f->kns_mgr );
-                if ( rc == 0 )
-                {
-                    rc = KFileInit( &f ->dad, (const union KFile_vt *)&vtKCurlFile, "KCurlFile", url, true, false );
-                    if ( rc == 0 )
-                    {
-                        ReadContext ctx;
-                        uint64_t file_size;
-
-                        memset( &ctx, 0, sizeof( ctx ) ); /* zero-out the content */
-
-                        string_copy( f->url, url_len, url, url_len );
-                        f->verbose = verbose;
-                        f->is_ftp = ( url_len >= 4 ) ? ( strcase_cmp ( f->url, url_len, "ftp:", 4, 4 ) == 0 ) : false;
-
-                        rc = KCurlFileDiscoverSize( f, &file_size );
-
-                        if ( rc == 0 )
-                        {
-                            rc = prepare_curl( f, &ctx );
-                            if ( rc == 0 )
-                            {
-                                f->curl_handle = ctx.curl_handle;
-                                *fp = & f -> dad;
-                                return rc;
-                            }
-                            else
-                            {
-                                KCurlFileDestroy( f );
-                                f = NULL;
-                            }
-                        }
-                    }
-                }
-            }
-            free( f );
-        }
-    }
-    return rc;
-}
diff --git a/libs/kns/KCurlRequest.c b/libs/kns/KCurlRequest.c
deleted file mode 100644
index f75d25c..0000000
--- a/libs/kns/KCurlRequest.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/extern.h>
-
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/data-buffer.h>
-#include <kns/manager.h>
-#include <kns/KCurlRequest.h>
-
-#include "kns_mgr_priv.h"
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-static const char kcurlrequest_classname [] = "KCurlRequest";
-
-
-typedef struct KCurlRequest
-{
-    KRefcount refcount;
-    const struct KNSManager * kns_mgr;
-    CURL * curl_handle;
-    KDataBuffer fields;
-    uint64_t fields_chars;
-} KCurlRequest;
-
-
-static rc_t KCurlRequestSetUrl( struct KCurlRequest *self, const char * url )
-{
-    rc_t rc = 0;
-    CURLcode rcc = self->kns_mgr->curl_easy_setopt_fkt( self->curl_handle, CURLOPT_URL, (void *)url );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_URL ) failed" );
-    }
-    return rc;
-}
-
-
-static rc_t set_curl_long_option( struct KCurlRequest *self, CURLoption option, long int value, const char *err_txt )
-{
-    rc_t rc = 0;
-    CURLcode rcc = self->kns_mgr->curl_easy_setopt_fkt( self->curl_handle, option, value );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, "curl_easy_setopt( $(t), $(v) ) failed with curl-error $(e)", 
-                                  "t=%s,v=%d,e=%d", err_txt, value, rcc ) );
-    }
-    return rc;
-}
-
-
-static rc_t set_verbose( struct KCurlRequest *self )
-{
-    return set_curl_long_option( self, CURLOPT_VERBOSE, 1, "CURLOPT_VERBOSE" );
-}
-
-
-LIB_EXPORT rc_t CC KNSManagerMakeCurlRequest( const struct KNSManager *kns_mgr, struct KCurlRequest **self, const char * url, bool verbose )
-{
-    rc_t rc = 0;
-    struct KCurlRequest *tmp = calloc ( sizeof *tmp, 1 );
-    if ( tmp == NULL )
-    {
-        rc = RC ( rcFS, rcFile, rcConstructing, rcMemory, rcExhausted );
-        LOGERR( klogErr, rc, "out of memory" );
-    }
-    else
-    {
-        rc = KNSManagerAvail( kns_mgr );
-        if ( rc == 0 )
-        {
-            tmp->kns_mgr = kns_mgr;
-            rc = KNSManagerAddRef ( kns_mgr );
-            if ( rc == 0 )
-            {
-                tmp->curl_handle = tmp->kns_mgr->curl_easy_init_fkt();
-                if ( tmp->curl_handle == NULL )
-                {
-                    rc = RC( rcFS, rcFile, rcConstructing, rcParam, rcNull );
-                    LOGERR( klogErr, rc, "cannot init curl" );
-                }
-                else
-                {
-                    rc = KCurlRequestSetUrl( tmp, url );
-                    if ( rc == 0 )
-                    {
-                        if ( verbose )
-                            rc = set_verbose( tmp );
-                        memset( &tmp->fields, 0, sizeof tmp->fields );
-                        tmp->fields.elem_bits = 8;
-                        if ( rc == 0 )
-                        {
-                            KRefcountInit( &tmp->refcount, 1, "KNS", "make", kcurlrequest_classname );
-                            *self = tmp;
-                            return rc;      /* !!!! */
-                        }
-                    }
-                }
-                KNSManagerRelease( kns_mgr );
-            }
-        }
-        free( tmp );
-    }
-    return rc;
-}
-
-
-static rc_t KCurlRequestDestroy( struct KCurlRequest *self )
-{
-    rc_t rc;
-    self->kns_mgr->curl_easy_cleanup_fkt( self->curl_handle );
-    rc = KNSManagerRelease( self->kns_mgr );
-    KDataBufferWhack( &self->fields );
-    free ( self );
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestAddRef ( const struct KCurlRequest *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd( &self->refcount, kcurlrequest_classname ) )
-        {
-        case krefOkay:
-            break;
-        case krefZero:
-            return RC( rcNS, rcFile, rcAttaching, rcRefcount, rcIncorrect);
-        case krefLimit:
-            return RC( rcNS, rcFile, rcAttaching, rcRefcount, rcExhausted);
-        case krefNegative:
-            return RC( rcNS, rcFile, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            return RC( rcNS, rcFile, rcAttaching, rcRefcount, rcUnknown);
-        }
-    }
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestRelease( const struct KCurlRequest *self )
-{
-    rc_t rc = 0;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop( &self->refcount, kcurlrequest_classname ) )
-        {
-        case krefOkay:
-        case krefZero:
-            break;
-        case krefWhack:
-            rc = KCurlRequestDestroy( ( struct KCurlRequest * )self );
-            break;
-        case krefNegative:
-            return RC( rcNS, rcFile, rcAttaching, rcRefcount, rcInvalid );
-        default:
-            rc = RC( rcNS, rcFile, rcAttaching, rcRefcount, rcUnknown );
-            break;            
-        }
-    }
-    return rc;
-}
-
-
-static rc_t perform( const struct KNSManager *kns_mgr, CURL *curl, const char * action )
-{
-    rc_t rc = 0;
-    CURLcode rcc = kns_mgr->curl_easy_perform_fkt( curl );
-    if ( rcc != CURLE_OK && rcc != CURLE_PARTIAL_FILE )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, 
-        "curl_easy_perform( $(a) ) failed with curl-error $(c)",
-        "a=%s,b=%d", action, rcc ) );
-    }
-    return rc;
-}
-
-
-static rc_t check_response_code( const struct KNSManager *kns_mgr, CURL *curl,  const char * action )
-{
-    rc_t rc = 0;
-    long response_code;
-
-    CURLcode rcc = kns_mgr->curl_easy_getinfo_fkt( curl, CURLINFO_RESPONSE_CODE, &response_code );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, 
-        "curl_easy_getinfo( $(a) ) failed with curl-error $(c)",
-        "a=%s,c=%d", action, rcc ) );
-    }
-    else
-    {
-        switch ( response_code )
-        {
-            case 0   :          /* no response code available */
-            case 200 : break;   /* OK */
-
-            case 404 : rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcNotFound );
-                       break;
-
-            default : rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-                      (void)PLOGERR( klogErr, ( klogErr, rc, "invalid response-code $(c)", "c=%d", response_code ) );
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestAddSFields( struct KCurlRequest *self, const String * fields )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcReading, rcSelf, rcNull );
-    if ( fields == NULL || fields->size == 0 )
-        return RC( rcNS, rcFile, rcReading, rcParam, rcNull );
-
-    if ( self->fields_chars == 0 )
-    {
-        rc = KDataBufferResize ( &self->fields, fields->size + 1 );
-        if ( rc == 0 )
-        {
-            memcpy( self->fields.base, fields->addr, fields->size );
-            ( (uint8_t *)self->fields.base)[ fields->size ] = 0;
-            self->fields_chars = fields->size;
-        }
-    }
-    else
-    {
-        rc = KDataBufferResize ( &self->fields, self->fields_chars + fields->size + 1 );
-        if ( rc == 0 )
-        {
-            ( (uint8_t *)self->fields.base)[ self->fields_chars ] = '&';
-            memcpy( &( ( (uint8_t *)self->fields.base)[ self->fields_chars + 1 ] ), fields->addr, fields->size );
-            self->fields_chars += ( fields->size + 1 );
-            ( (uint8_t *)self->fields.base)[ self->fields_chars ] = 0;
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestAddFields( struct KCurlRequest *self, const char * fields )
-{
-    String s;
-
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcReading, rcSelf, rcNull );
-    if ( fields == NULL || fields[ 0 ] == 0 )
-        return RC( rcNS, rcFile, rcReading, rcParam, rcNull );
-
-    StringInitCString( &s, fields );
-    return KCurlRequestAddSFields( self, &s );
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestAddSField( struct KCurlRequest *self, const String * name, const String * value )
-{
-    rc_t rc = 0;
-    size_t needed;
-
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcReading, rcSelf, rcNull );
-    if ( name == NULL || name->size == 0 || value == NULL || value->size == 0 )
-        return RC( rcNS, rcFile, rcReading, rcParam, rcNull );
-
-    needed = ( self->fields_chars + name->size + value->size + 3 );
-    rc = KDataBufferResize ( &self->fields, needed );
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        if ( self->fields_chars == 0 )
-        {
-            rc = string_printf ( ( char * )self->fields.base, needed, &num_writ, 
-                                 "%S=%S", name, value );
-        }
-        else
-        {
-            uint8_t * dst = ( uint8_t * )self->fields.base;
-            rc = string_printf ( ( char * )( &dst[ self->fields_chars ] ), needed - self->fields_chars, &num_writ, 
-                                 "&%S=%S", name, value );
-        }
-        if ( rc == 0 )
-            self->fields_chars += num_writ;
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestAddField( struct KCurlRequest *self, const char * name, const char * value )
-{
-    String s_name, s_value;
-
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcReading, rcSelf, rcNull );
-    if ( name == NULL || name[ 0 ] == 0 || value == NULL || value[ 0 ] == 0 )
-        return RC( rcNS, rcFile, rcReading, rcParam, rcNull );
-
-    StringInitCString( &s_name, name );
-    StringInitCString( &s_value, value );
-    return KCurlRequestAddSField( self, &s_name, &s_value );
-}
-
-
-static rc_t KCurlRequestSetFields( struct KCurlRequest *self )
-{
-    rc_t rc = 0;
-    CURLcode rcc = self->kns_mgr->curl_easy_setopt_fkt( self->curl_handle, CURLOPT_POSTFIELDS, (void *)(self->fields.base) );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_POSTFIELDS ) failed" );
-    }
-    return rc;
-}
-
-
-typedef struct ReadContext
-{
-    KDataBuffer * buffer;
-    size_t num_read;
-} ReadContext;
-
-
-static size_t CC KCurlFileCallback( void *ptr, size_t size, size_t nmemb, void *data )
-{
-    rc_t rc = 0;
-    size_t given_bytes = size * nmemb; /* calculate the size given in ptr */
-    ReadContext *ctx = ( ReadContext * )data;
-    if ( ctx != NULL && ctx->buffer != NULL )
-    {
-        rc = KDataBufferResize ( ctx->buffer, ctx->num_read + given_bytes + 2 );
-        if ( rc == 0 )
-        {
-            memcpy( &( ( (uint8_t *)ctx->buffer->base )[ ctx->num_read ] ), ptr, given_bytes );
-            ctx->num_read += given_bytes;
-        }
-    }
-    return given_bytes;
-}
-
-
-LIB_EXPORT rc_t CC KCurlRequestPerform( struct KCurlRequest *self, KDataBuffer * buffer )
-{
-    CURLcode rcc;
-    ReadContext ctx;
-    rc_t rc = 0;
-
-    if ( buffer == NULL )
-        return RC( rcNS, rcFile, rcReading, rcParam, rcNull );
-
-    memset ( buffer, 0, sizeof * buffer );
-
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcReading, rcSelf, rcNull );
-
-    rc = KDataBufferMakeBytes ( buffer, 0 );
-    if ( rc != 0 )
-        return rc;
-
-    ctx.buffer = buffer;
-    ctx.num_read = 0;
-
-    rcc = self->kns_mgr->curl_easy_setopt_fkt( self->curl_handle, CURLOPT_WRITEDATA, (void *)&ctx );
-    if ( rcc != CURLE_OK )
-    {
-        rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-        LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_WRITEDATA ) failed" );
-    }
-
-    if ( rc == 0 )
-    {
-        CURLcode rcc = self->kns_mgr->curl_easy_setopt_fkt( self->curl_handle, CURLOPT_WRITEFUNCTION, KCurlFileCallback );
-        if ( rcc != CURLE_OK )
-        {
-            rc = RC( rcFS, rcFile, rcConstructing, rcFileDesc, rcInvalid );
-            LOGERR( klogErr, rc, "curl_easy_setopt( CURLOPT_WRITEFUNCTION ) failed" );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = set_curl_long_option( self, CURLOPT_FOLLOWLOCATION, 1, "CURLOPT_FOLLOWLOCATION" );
-
-    if ( rc == 0 )
-        rc = KCurlRequestSetFields( self );
-
-    if ( rc == 0 )
-        rc = perform( self->kns_mgr, self->curl_handle, "POST request" );
-
-    if ( rc == 0 )
-        rc = check_response_code( self->kns_mgr, self->curl_handle, "POST request" );
-
-    if ( rc == 0 )
-    {
-        buffer->elem_count = ctx.num_read;
-        ( ( uint8_t * )buffer->base )[ ctx.num_read ] = 0;
-    }
-
-    return rc;
-}
diff --git a/libs/kns/Makefile b/libs/kns/Makefile
deleted file mode 100644
index 3f21b8c..0000000
--- a/libs/kns/Makefile
+++ /dev/null
@@ -1,127 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kns
-
-INT_LIBS = \
-	libkns \
-	libkurl
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-TEST_TOOLS = \
-
-include $(TOP)/build/Makefile.env
-
-RWORKDIR = $(TOP)/$(MODULE)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-
-# we are building it on all platforms now, because dependency on libcurl is removed
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(TEST_TOOLS): makedirs
-	@ $(MAKE_CMD) $(TEST_BINDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# kns
-#
-$(ILIBDIR)/libkns: $(addprefix $(ILIBDIR)/libkns.,$(ILIBEXT))
-
-KNS_NO_HTTP_SRC = \
-	kns_manager \
-	stream \
-	stream-from-files \
-	stream-from-streams \
-	endpoint \
-	sysendpoint \
-	syssock \
-	sysstream \
-	sysmgr
-
-KNS_SRC = \
-	$(KNS_NO_HTTP_SRC) \
-	http
-
-KNS_OBJ = \
-	$(addsuffix .$(LOBX),$(KNS_SRC))
-
-KNS_LIB = \
-    -lkfs \
-	-dklib
-
-$(ILIBDIR)/libkns.$(LIBX): $(KNS_OBJ)
-	$(LD) --slib -o $@ $^ $(KNS_LIB)
-
-
-#-------------------------------------------------------------------------------
-# kurl
-#
-$(ILIBDIR)/libkurl: $(addprefix $(ILIBDIR)/libkurl.,$(ILIBEXT))
-
-KURL_SRC = \
-	KCurlFile \
-	KCurlRequest \
-	url-fetcher \
-	url-fetcher-curl \
-	entrez-fetcher
-
-KURL_OBJ = \
-	$(addsuffix .$(LOBX),$(KURL_SRC))
-
-KURL_LIB = \
-	-skns \
-	-dkfs \
-	-dklib \
-	-dz
-
-$(ILIBDIR)/libkurl.$(LIBX): $(KURL_OBJ)
-	$(LD) --slib -o $@ $^ $(KURL_LIB)
diff --git a/libs/kns/curlhdr/curl.h b/libs/kns/curlhdr/curl.h
deleted file mode 100644
index 1cfc7fa..0000000
--- a/libs/kns/curlhdr/curl.h
+++ /dev/null
@@ -1,1600 +0,0 @@
-#ifndef __CURL_CURL_H
-#define __CURL_CURL_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel at haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curl.h,v 1.1 2012/11/09 17:54:52 rodarmer Exp $
- ***************************************************************************/
-
-/* If you have problems, all libcurl docs and details are found here:
-   http://curl.haxx.se/libcurl/
-*/
-
-#include "curlver.h" /* the libcurl version defines */
-
-#include <stdio.h>
-#include <limits.h>
-
-/* The include stuff here below is mainly for time_t! */
-#ifdef vms
-# include <types.h>
-# include <time.h>
-#else
-# include <sys/types.h>
-# include <time.h>
-#endif /* defined (vms) */
-
-typedef void CURL;
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/*
- * Decorate exportable functions for Win32 DLL linking.
- * This avoids using a .def file for building libcurl.dll.
- */
-#if (defined(WIN32) || defined(_WIN32)) && !defined(CURL_STATICLIB)
-#if defined(BUILDING_LIBCURL)
-#define CURL_EXTERN  __declspec(dllexport)
-#else
-#define CURL_EXTERN  __declspec(dllimport)
-#endif
-#else
-
-#ifdef CURL_HIDDEN_SYMBOLS
-/*
- * This definition is used to make external definitions visibile in the
- * shared library when symbols are hidden by default.  It makes no
- * difference when compiling applications whether this is set or not,
- * only when compiling the library.
- */
-#define CURL_EXTERN CURL_EXTERN_SYMBOL
-#else
-#define CURL_EXTERN
-#endif
-#endif
-
-/*
- * We want the typedef curl_off_t setup for large file support on all
- * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
- * format strings when outputting a variable of type curl_off_t.
- *
- * Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER!
- */
-
-#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32))
-/* MSVC */
-#ifdef _WIN32_WCE
-  typedef long curl_off_t;
-#define CURL_FORMAT_OFF_T "%ld"
-#else
-  typedef signed __int64 curl_off_t;
-#define CURL_FORMAT_OFF_T "%I64d"
-#endif
-#else /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */
-#if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__)
-/* gcc on windows or Watcom */
-  typedef long long curl_off_t;
-#define CURL_FORMAT_OFF_T "%I64d"
-#else /* GCC or Watcom on Windows  */
-
-/* "normal" POSIX approach, do note that this does not necessarily mean that
-   the type is >32 bits, see the SIZEOF_CURL_OFF_T define for that! */
-  typedef off_t curl_off_t;
-
-/* Check a range of defines to detect large file support. On Linux it seems
-   none of these are set by default, so if you don't explicitly switches on
-   large file support, this define will be made for "small file" support. */
-#ifndef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 0 /* to prevent warnings in the check below */
-#define UNDEF_FILE_OFFSET_BITS
-#endif
-#ifndef FILESIZEBITS
-#define FILESIZEBITS 0 /* to prevent warnings in the check below */
-#define UNDEF_FILESIZEBITS
-#endif
-
-#if defined(_LARGE_FILES) || (_FILE_OFFSET_BITS > 32) || (FILESIZEBITS > 32) \
-   || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE)
-  /* For now, we assume at least one of these to be set for large files to
-     work! */
-#define CURL_FORMAT_OFF_T "%lld"
-#else /* LARGE_FILE support */
-#define CURL_FORMAT_OFF_T "%ld"
-#endif
-#endif /* GCC or Watcom on Windows */
-#endif /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */
-
-#ifdef UNDEF_FILE_OFFSET_BITS
-/* this was defined above for our checks, undefine it again */
-#undef _FILE_OFFSET_BITS
-#endif
-
-#ifdef UNDEF_FILESIZEBITS
-/* this was defined above for our checks, undefine it again */
-#undef FILESIZEBITS
-#endif
-
-struct curl_httppost {
-  struct curl_httppost *next;       /* next entry in the list */
-  char *name;                       /* pointer to allocated name */
-  long namelength;                  /* length of name length */
-  char *contents;                   /* pointer to allocated data contents */
-  long contentslength;              /* length of contents field */
-  char *buffer;                     /* pointer to allocated buffer contents */
-  long bufferlength;                /* length of buffer field */
-  char *contenttype;                /* Content-Type */
-  struct curl_slist* contentheader; /* list of extra headers for this form */
-  struct curl_httppost *more;       /* if one field name has more than one
-                                       file, this link should link to following
-                                       files */
-  long flags;                       /* as defined below */
-#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */
-#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */
-#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer
-                                       do not free in formfree */
-#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
-                                       do not free in formfree */
-#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */
-#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */
-
-  char *showfilename;               /* The file name to show. If not set, the
-                                       actual file name will be used (if this
-                                       is a file part) */
-};
-
-typedef int (*curl_progress_callback)(void *clientp,
-                                      double dltotal,
-                                      double dlnow,
-                                      double ultotal,
-                                      double ulnow);
-
-  /* Tests have proven that 20K is a very bad buffer size for uploads on
-     Windows, while 16K for some odd reason performed a lot better. */
-#define CURL_MAX_WRITE_SIZE 16384
-
-typedef size_t (*curl_write_callback)(char *buffer,
-                                      size_t size,
-                                      size_t nitems,
-                                      void *outstream);
-
-/* This is a return code for the read callback that, when returned, will
-   signal libcurl to immediately abort the current transfer. */
-#define CURL_READFUNC_ABORT 0x10000000
-typedef size_t (*curl_read_callback)(char *buffer,
-                                      size_t size,
-                                      size_t nitems,
-                                      void *instream);
-
-
-#ifndef CURL_NO_OLDIES
-  /* not used since 7.10.8, will be removed in a future release */
-typedef int (*curl_passwd_callback)(void *clientp,
-                                    const char *prompt,
-                                    char *buffer,
-                                    int buflen);
-#endif
-
-typedef enum {
-  CURLIOE_OK,            /* I/O operation successful */
-  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */
-  CURLIOE_FAILRESTART,   /* failed to restart the read */
-  CURLIOE_LAST           /* never use */
-} curlioerr;
-
-typedef enum  {
-  CURLIOCMD_NOP,         /* no operation */
-  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
-  CURLIOCMD_LAST         /* never use */
-} curliocmd;
-
-typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
-                                         int cmd,
-                                         void *clientp);
-
-/*
- * The following typedef's are signatures of malloc, free, realloc, strdup and
- * calloc respectively.  Function pointers of these types can be passed to the
- * curl_global_init_mem() function to set user defined memory management
- * callback routines.
- */
-typedef void *(*curl_malloc_callback)(size_t size);
-typedef void (*curl_free_callback)(void *ptr);
-typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
-typedef char *(*curl_strdup_callback)(const char *str);
-typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
-
-/* the kind of data that is passed to information_callback*/
-typedef enum {
-  CURLINFO_TEXT = 0,
-  CURLINFO_HEADER_IN,    /* 1 */
-  CURLINFO_HEADER_OUT,   /* 2 */
-  CURLINFO_DATA_IN,      /* 3 */
-  CURLINFO_DATA_OUT,     /* 4 */
-  CURLINFO_SSL_DATA_IN,  /* 5 */
-  CURLINFO_SSL_DATA_OUT, /* 6 */
-  CURLINFO_END
-} curl_infotype;
-
-typedef int (*curl_debug_callback)
-       (CURL *handle,      /* the handle/transfer this concerns */
-        curl_infotype type, /* what kind of data */
-        char *data,        /* points to the data */
-        size_t size,       /* size of the data pointed to */
-        void *userptr);    /* whatever the user please */
-
-/* All possible error codes from all sorts of curl functions. Future versions
-   may return other values, stay prepared.
-
-   Always add new return codes last. Never *EVER* remove any. The return
-   codes must remain the same!
- */
-
-typedef enum {
-  CURLE_OK = 0,
-  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
-  CURLE_FAILED_INIT,             /* 2 */
-  CURLE_URL_MALFORMAT,           /* 3 */
-  CURLE_URL_MALFORMAT_USER,      /* 4 - NOT USED */
-  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
-  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
-  CURLE_COULDNT_CONNECT,         /* 7 */
-  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */
-  CURLE_FTP_ACCESS_DENIED,       /* 9 a service was denied by the FTP server
-                                    due to lack of access - when login fails
-                                    this is not returned. */
-  CURLE_FTP_USER_PASSWORD_INCORRECT, /* 10 - NOT USED */
-  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
-  CURLE_FTP_WEIRD_USER_REPLY,    /* 12 */
-  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
-  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
-  CURLE_FTP_CANT_GET_HOST,       /* 15 */
-  CURLE_FTP_CANT_RECONNECT,      /* 16 */
-  CURLE_FTP_COULDNT_SET_BINARY,  /* 17 */
-  CURLE_PARTIAL_FILE,            /* 18 */
-  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
-  CURLE_FTP_WRITE_ERROR,         /* 20 */
-  CURLE_FTP_QUOTE_ERROR,         /* 21 */
-  CURLE_HTTP_RETURNED_ERROR,     /* 22 */
-  CURLE_WRITE_ERROR,             /* 23 */
-  CURLE_MALFORMAT_USER,          /* 24 - NOT USED */
-  CURLE_FTP_COULDNT_STOR_FILE,   /* 25 - failed FTP upload */
-  CURLE_READ_ERROR,              /* 26 - could open/read from file */
-  CURLE_OUT_OF_MEMORY,           /* 27 */
-  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
-           instead of a memory allocation error if CURL_DOES_CONVERSIONS
-           is defined
-  */
-  CURLE_OPERATION_TIMEOUTED,     /* 28 - the timeout time was reached */
-  CURLE_FTP_COULDNT_SET_ASCII,   /* 29 - TYPE A failed */
-  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
-  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
-  CURLE_FTP_COULDNT_GET_SIZE,    /* 32 - the SIZE command failed */
-  CURLE_HTTP_RANGE_ERROR,        /* 33 - RANGE "command" didn't work */
-  CURLE_HTTP_POST_ERROR,         /* 34 */
-  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
-  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
-  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
-  CURLE_LDAP_CANNOT_BIND,        /* 38 */
-  CURLE_LDAP_SEARCH_FAILED,      /* 39 */
-  CURLE_LIBRARY_NOT_FOUND,       /* 40 */
-  CURLE_FUNCTION_NOT_FOUND,      /* 41 */
-  CURLE_ABORTED_BY_CALLBACK,     /* 42 */
-  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
-  CURLE_BAD_CALLING_ORDER,       /* 44 - NOT USED */
-  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
-  CURLE_BAD_PASSWORD_ENTERED,    /* 46 - NOT USED */
-  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */
-  CURLE_UNKNOWN_TELNET_OPTION,   /* 48 - User specified an unknown option */
-  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */
-  CURLE_OBSOLETE,                /* 50 - NOT USED */
-  CURLE_SSL_PEER_CERTIFICATE,    /* 51 - peer's certificate wasn't ok */
-  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
-  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
-  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
-                                    default */
-  CURLE_SEND_ERROR,              /* 55 - failed sending network data */
-  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
-  CURLE_SHARE_IN_USE,            /* 57 - share is in use */
-  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
-  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */
-  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */
-  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized transfer encoding */
-  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */
-  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
-  CURLE_FTP_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
-  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
-                                    that failed */
-  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
-  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
-                                    accepted and we failed to login */
-  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
-  CURLE_TFTP_PERM,               /* 69 - permission problem on server */
-  CURLE_TFTP_DISKFULL,           /* 70 - out of disk space on server */
-  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
-  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
-  CURLE_TFTP_EXISTS,             /* 73 - File already exists */
-  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
-  CURLE_CONV_FAILED,             /* 75 - conversion failed */
-  CURLE_CONV_REQD,               /* 76 - caller must register conversion
-                                    callbacks using curl_easy_setopt options
-                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,
-                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and
-                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */
-  CURLE_SSL_CRL_BADFILE = 82,    /* 82 - could not load CRL file, missing or
-                                    wrong format (Added in 7.19.0) */
-  CURL_LAST /* never use! */
-} CURLcode;
-
-/* This prototype applies to all conversion callbacks */
-typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
-
-typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */
-                                          void *ssl_ctx, /* actually an
-                                                            OpenSSL SSL_CTX */
-                                          void *userptr);
-
-/* Make a spelling correction for the operation timed-out define */
-#define CURLE_OPERATION_TIMEDOUT CURLE_OPERATION_TIMEOUTED
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
-                          the obsolete stuff removed! */
-/* backwards compatibility with older names */
-#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
-#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
-#endif
-
-typedef enum {
-  CURLPROXY_HTTP = 0,
-  CURLPROXY_SOCKS4 = 4,
-  CURLPROXY_SOCKS5 = 5
-} curl_proxytype;
-
-#define CURLAUTH_NONE         0       /* nothing */
-#define CURLAUTH_BASIC        (1<<0)  /* Basic (default) */
-#define CURLAUTH_DIGEST       (1<<1)  /* Digest */
-#define CURLAUTH_GSSNEGOTIATE (1<<2)  /* GSS-Negotiate */
-#define CURLAUTH_NTLM         (1<<3)  /* NTLM */
-#define CURLAUTH_ANY ~0               /* all types set */
-#define CURLAUTH_ANYSAFE (~CURLAUTH_BASIC)
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
-                          the obsolete stuff removed! */
-/* this was the error code 50 in 7.7.3 and a few earlier versions, this
-   is no longer used by libcurl but is instead #defined here only to not
-   make programs break */
-#define CURLE_ALREADY_COMPLETE 99999
-
-/* These are just to make older programs not break: */
-#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
-#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
-#endif
-
-#define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */
-#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
-#define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */
-
-#define CURL_ERROR_SIZE 256
-
-/* parameter for the CURLOPT_FTP_SSL option */
-typedef enum {
-  CURLFTPSSL_NONE,    /* do not attempt to use SSL */
-  CURLFTPSSL_TRY,     /* try using SSL, proceed anyway otherwise */
-  CURLFTPSSL_CONTROL, /* SSL for the control connection or fail */
-  CURLFTPSSL_ALL,     /* SSL for all communication or fail */
-  CURLFTPSSL_LAST     /* not an option, never use */
-} curl_ftpssl;
-
-/* parameter for the CURLOPT_FTPSSLAUTH option */
-typedef enum {
-  CURLFTPAUTH_DEFAULT, /* let libcurl decide */
-  CURLFTPAUTH_SSL,     /* use "AUTH SSL" */
-  CURLFTPAUTH_TLS,     /* use "AUTH TLS" */
-  CURLFTPAUTH_LAST /* not an option, never use */
-} curl_ftpauth;
-
-/* parameter for the CURLOPT_FTP_FILEMETHOD option */
-typedef enum {
-  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */
-  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */
-  CURLFTPMETHOD_NOCWD,     /* no CWD at all */
-  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
-  CURLFTPMETHOD_LAST       /* not an option, never use */
-} curl_ftpmethod;
-
-/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
-#define CURLPROTO_HTTP   (1<<0)
-#define CURLPROTO_HTTPS  (1<<1)
-#define CURLPROTO_FTP    (1<<2)
-#define CURLPROTO_FTPS   (1<<3)
-#define CURLPROTO_TELNET (1<<6)
-#define CURLPROTO_LDAP   (1<<7)
-#define CURLPROTO_LDAPS  (1<<8)
-#define CURLPROTO_DICT   (1<<9)
-#define CURLPROTO_FILE   (1<<10)
-#define CURLPROTO_TFTP   (1<<11)
-#define CURLPROTO_ALL    (~0) /* enable everything */
-
-/* long may be 32 or 64 bits, but we should never depend on anything else
-   but 32 */
-#define CURLOPTTYPE_LONG          0
-#define CURLOPTTYPE_OBJECTPOINT   10000
-#define CURLOPTTYPE_FUNCTIONPOINT 20000
-#define CURLOPTTYPE_OFF_T         30000
-
-/* name is uppercase CURLOPT_<name>,
-   type is one of the defined CURLOPTTYPE_<type>
-   number is unique identifier */
-#ifdef CINIT
-#undef CINIT
-#endif
-/*
- * Figure out if we can use the ## operator, which is supported by ISO/ANSI C
- * and C++. Some compilers support it without setting __STDC__ or __cplusplus
- * so we need to carefully check for them too. We don't use configure-checks
- * for these since we want these headers to remain generic and working for all
- * platforms.
- */
-#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
-  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
-  defined(__POCC__) || defined(__SALFORDC__)
-  /* This compiler is believed to have an ISO compatible preprocessor */
-#define CURL_ISOCPP
-#else
-  /* This compiler is believed NOT to have an ISO compatible preprocessor */
-#undef CURL_ISOCPP
-#endif
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG          CURLOPTTYPE_LONG
-#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T         CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLOPT_/**/name = type + number
-#endif
-
-/*
- * This macro-mania below setups the CURLOPT_[what] enum, to be used with
- * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
- * word.
- */
-
-typedef enum {
-  /* This is the FILE * or void * the regular output should be written to. */
-  CINIT(FILE, OBJECTPOINT, 1),
-
-  /* The full URL to get/put */
-  CINIT(URL,  OBJECTPOINT, 2),
-
-  /* Port number to connect to, if other than default. */
-  CINIT(PORT, LONG, 3),
-
-  /* Name of proxy to use. */
-  CINIT(PROXY, OBJECTPOINT, 4),
-
-  /* "name:password" to use when fetching. */
-  CINIT(USERPWD, OBJECTPOINT, 5),
-
-  /* "name:password" to use with proxy. */
-  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
-
-  /* Range to get, specified as an ASCII string. */
-  CINIT(RANGE, OBJECTPOINT, 7),
-
-  /* not used */
-
-  /* Specified file stream to upload from (use as input): */
-  CINIT(INFILE, OBJECTPOINT, 9),
-
-  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
-   * bytes big. If this is not used, error messages go to stderr instead: */
-  CINIT(ERRORBUFFER, OBJECTPOINT, 10),
-
-  /* Function that will be called to store the output (instead of fwrite). The
-   * parameters will use fwrite() syntax, make sure to follow them. */
-  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
-
-  /* Function that will be called to read the input (instead of fread). The
-   * parameters will use fread() syntax, make sure to follow them. */
-  CINIT(READFUNCTION, FUNCTIONPOINT, 12),
-
-  /* Time-out the read operation after this amount of seconds */
-  CINIT(TIMEOUT, LONG, 13),
-
-  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
-   * how large the file being sent really is. That allows better error
-   * checking and better verifies that the upload was succcessful. -1 means
-   * unknown size.
-   *
-   * For large file support, there is also a _LARGE version of the key
-   * which takes an off_t type, allowing platforms with larger off_t
-   * sizes to handle larger files.  See below for INFILESIZE_LARGE.
-   */
-  CINIT(INFILESIZE, LONG, 14),
-
-  /* POST input fields. */
-  CINIT(POSTFIELDS, OBJECTPOINT, 15),
-
-  /* Set the referer page (needed by some CGIs) */
-  CINIT(REFERER, OBJECTPOINT, 16),
-
-  /* Set the FTP PORT string (interface name, named or numerical IP address)
-     Use i.e '-' to use default address. */
-  CINIT(FTPPORT, OBJECTPOINT, 17),
-
-  /* Set the User-Agent string (examined by some CGIs) */
-  CINIT(USERAGENT, OBJECTPOINT, 18),
-
-  /* If the download receives less than "low speed limit" bytes/second
-   * during "low speed time" seconds, the operations is aborted.
-   * You could i.e if you have a pretty high speed connection, abort if
-   * it is less than 2000 bytes/sec during 20 seconds.
-   */
-
-  /* Set the "low speed limit" */
-  CINIT(LOW_SPEED_LIMIT, LONG , 19),
-
-  /* Set the "low speed time" */
-  CINIT(LOW_SPEED_TIME, LONG, 20),
-
-  /* Set the continuation offset.
-   *
-   * Note there is also a _LARGE version of this key which uses
-   * off_t types, allowing for large file offsets on platforms which
-   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.
-   */
-  CINIT(RESUME_FROM, LONG, 21),
-
-  /* Set cookie in request: */
-  CINIT(COOKIE, OBJECTPOINT, 22),
-
-  /* This points to a linked list of headers, struct curl_slist kind */
-  CINIT(HTTPHEADER, OBJECTPOINT, 23),
-
-  /* This points to a linked list of post entries, struct HttpPost */
-  CINIT(HTTPPOST, OBJECTPOINT, 24),
-
-  /* name of the file keeping your private SSL-certificate */
-  CINIT(SSLCERT, OBJECTPOINT, 25),
-
-  /* password for the SSL-private key, keep this for compatibility */
-  CINIT(SSLCERTPASSWD, OBJECTPOINT, 26),
-  /* password for the SSL private key */
-  CINIT(SSLKEYPASSWD, OBJECTPOINT, 26),
-
-  /* send TYPE parameter? */
-  CINIT(CRLF, LONG, 27),
-
-  /* send linked-list of QUOTE commands */
-  CINIT(QUOTE, OBJECTPOINT, 28),
-
-  /* send FILE * or void * to store headers to, if you use a callback it
-     is simply passed to the callback unmodified */
-  CINIT(WRITEHEADER, OBJECTPOINT, 29),
-
-  /* point to a file to read the initial cookies from, also enables
-     "cookie awareness" */
-  CINIT(COOKIEFILE, OBJECTPOINT, 31),
-
-  /* What version to specifly try to use.
-     See CURL_SSLVERSION defines below. */
-  CINIT(SSLVERSION, LONG, 32),
-
-  /* What kind of HTTP time condition to use, see defines */
-  CINIT(TIMECONDITION, LONG, 33),
-
-  /* Time to use with the above condition. Specified in number of seconds
-     since 1 Jan 1970 */
-  CINIT(TIMEVALUE, LONG, 34),
-
-  /* 35 = OBSOLETE */
-
-  /* Custom request, for customizing the get command like
-     HTTP: DELETE, TRACE and others
-     FTP: to use a different list command
-     */
-  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
-
-  /* HTTP request, for odd commands like DELETE, TRACE and others */
-  CINIT(STDERR, OBJECTPOINT, 37),
-
-  /* 38 is not used */
-
-  /* send linked-list of post-transfer QUOTE commands */
-  CINIT(POSTQUOTE, OBJECTPOINT, 39),
-
-  /* Pass a pointer to string of the output using full variable-replacement
-     as described elsewhere. */
-  CINIT(WRITEINFO, OBJECTPOINT, 40),
-
-  CINIT(VERBOSE, LONG, 41),      /* talk a lot */
-  CINIT(HEADER, LONG, 42),       /* throw the header out too */
-  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */
-  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */
-  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */
-  CINIT(UPLOAD, LONG, 46),       /* this is an upload */
-  CINIT(POST, LONG, 47),         /* HTTP POST method */
-  CINIT(FTPLISTONLY, LONG, 48),  /* Use NLST when listing ftp dir */
-
-  CINIT(FTPAPPEND, LONG, 50),    /* Append instead of overwrite on upload! */
-
-  /* Specify whether to read the user+password from the .netrc or the URL.
-   * This must be one of the CURL_NETRC_* enums below. */
-  CINIT(NETRC, LONG, 51),
-
-  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */
-
-  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
-  CINIT(PUT, LONG, 54),          /* HTTP PUT */
-
-  /* 55 = OBSOLETE */
-
-  /* Function that will be called instead of the internal progress display
-   * function. This function should be defined as the curl_progress_callback
-   * prototype defines. */
-  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
-
-  /* Data passed to the progress callback */
-  CINIT(PROGRESSDATA, OBJECTPOINT, 57),
-
-  /* We want the referer field set automatically when following locations */
-  CINIT(AUTOREFERER, LONG, 58),
-
-  /* Port of the proxy, can be set in the proxy string as well with:
-     "[host]:[port]" */
-  CINIT(PROXYPORT, LONG, 59),
-
-  /* size of the POST input data, if strlen() is not good to use */
-  CINIT(POSTFIELDSIZE, LONG, 60),
-
-  /* tunnel non-http operations through a HTTP proxy */
-  CINIT(HTTPPROXYTUNNEL, LONG, 61),
-
-  /* Set the interface string to use as outgoing network interface */
-  CINIT(INTERFACE, OBJECTPOINT, 62),
-
-  /* Set the krb4 security level, this also enables krb4 awareness.  This is a
-   * string, 'clear', 'safe', 'confidential' or 'private'.  If the string is
-   * set but doesn't match one of these, 'private' will be used.  */
-  CINIT(KRB4LEVEL, OBJECTPOINT, 63),
-
-  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
-  CINIT(SSL_VERIFYPEER, LONG, 64),
-
-  /* The CApath or CAfile used to validate the peer certificate
-     this option is used only if SSL_VERIFYPEER is true */
-  CINIT(CAINFO, OBJECTPOINT, 65),
-
-  /* 66 = OBSOLETE */
-  /* 67 = OBSOLETE */
-
-  /* Maximum number of http redirects to follow */
-  CINIT(MAXREDIRS, LONG, 68),
-
-  /* Pass a long set to 1 to get the date of the requested document (if
-     possible)! Pass a zero to shut it off. */
-  CINIT(FILETIME, LONG, 69),
-
-  /* This points to a linked list of telnet options */
-  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
-
-  /* Max amount of cached alive connections */
-  CINIT(MAXCONNECTS, LONG, 71),
-
-  /* What policy to use when closing connections when the cache is filled
-     up */
-  CINIT(CLOSEPOLICY, LONG, 72),
-
-  /* 73 = OBSOLETE */
-
-  /* Set to explicitly use a new connection for the upcoming transfer.
-     Do not use this unless you're absolutely sure of this, as it makes the
-     operation slower and is less friendly for the network. */
-  CINIT(FRESH_CONNECT, LONG, 74),
-
-  /* Set to explicitly forbid the upcoming transfer's connection to be re-used
-     when done. Do not use this unless you're absolutely sure of this, as it
-     makes the operation slower and is less friendly for the network. */
-  CINIT(FORBID_REUSE, LONG, 75),
-
-  /* Set to a file name that contains random data for libcurl to use to
-     seed the random engine when doing SSL connects. */
-  CINIT(RANDOM_FILE, OBJECTPOINT, 76),
-
-  /* Set to the Entropy Gathering Daemon socket pathname */
-  CINIT(EGDSOCKET, OBJECTPOINT, 77),
-
-  /* Time-out connect operations after this amount of seconds, if connects
-     are OK within this time, then fine... This only aborts the connect
-     phase. [Only works on unix-style/SIGALRM operating systems] */
-  CINIT(CONNECTTIMEOUT, LONG, 78),
-
-  /* Function that will be called to store headers (instead of fwrite). The
-   * parameters will use fwrite() syntax, make sure to follow them. */
-  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
-
-  /* Set this to force the HTTP request to get back to GET. Only really usable
-     if POST, PUT or a custom request have been used first.
-   */
-  CINIT(HTTPGET, LONG, 80),
-
-  /* Set if we should verify the Common name from the peer certificate in ssl
-   * handshake, set 1 to check existence, 2 to ensure that it matches the
-   * provided hostname. */
-  CINIT(SSL_VERIFYHOST, LONG, 81),
-
-  /* Specify which file name to write all known cookies in after completed
-     operation. Set file name to "-" (dash) to make it go to stdout. */
-  CINIT(COOKIEJAR, OBJECTPOINT, 82),
-
-  /* Specify which SSL ciphers to use */
-  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
-
-  /* Specify which HTTP version to use! This must be set to one of the
-     CURL_HTTP_VERSION* enums set below. */
-  CINIT(HTTP_VERSION, LONG, 84),
-
-  /* Specificly switch on or off the FTP engine's use of the EPSV command. By
-     default, that one will always be attempted before the more traditional
-     PASV command. */
-  CINIT(FTP_USE_EPSV, LONG, 85),
-
-  /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
-  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
-
-  /* name of the file keeping your private SSL-key */
-  CINIT(SSLKEY, OBJECTPOINT, 87),
-
-  /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
-  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
-
-  /* crypto engine for the SSL-sub system */
-  CINIT(SSLENGINE, OBJECTPOINT, 89),
-
-  /* set the crypto engine for the SSL-sub system as default
-     the param has no meaning...
-   */
-  CINIT(SSLENGINE_DEFAULT, LONG, 90),
-
-  /* Non-zero value means to use the global dns cache */
-  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To becomeO BSOLETE soon */
-
-  /* DNS cache timeout */
-  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
-
-  /* send linked-list of pre-transfer QUOTE commands (Wesley Laxton)*/
-  CINIT(PREQUOTE, OBJECTPOINT, 93),
-
-  /* set the debug function */
-  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
-
-  /* set the data for the debug function */
-  CINIT(DEBUGDATA, OBJECTPOINT, 95),
-
-  /* mark this as start of a cookie session */
-  CINIT(COOKIESESSION, LONG, 96),
-
-  /* The CApath directory used to validate the peer certificate
-     this option is used only if SSL_VERIFYPEER is true */
-  CINIT(CAPATH, OBJECTPOINT, 97),
-
-  /* Instruct libcurl to use a smaller receive buffer */
-  CINIT(BUFFERSIZE, LONG, 98),
-
-  /* Instruct libcurl to not use any signal/alarm handlers, even when using
-     timeouts. This option is useful for multi-threaded applications.
-     See libcurl-the-guide for more background information. */
-  CINIT(NOSIGNAL, LONG, 99),
-
-  /* Provide a CURLShare for mutexing non-ts data */
-  CINIT(SHARE, OBJECTPOINT, 100),
-
-  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
-     CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */
-  CINIT(PROXYTYPE, LONG, 101),
-
-  /* Set the Accept-Encoding string. Use this to tell a server you would like
-     the response to be compressed. */
-  CINIT(ENCODING, OBJECTPOINT, 102),
-
-  /* Set pointer to private data */
-  CINIT(PRIVATE, OBJECTPOINT, 103),
-
-  /* Set aliases for HTTP 200 in the HTTP Response header */
-  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
-
-  /* Continue to send authentication (user+password) when following locations,
-     even when hostname changed. This can potentionally send off the name
-     and password to whatever host the server decides. */
-  CINIT(UNRESTRICTED_AUTH, LONG, 105),
-
-  /* Specificly switch on or off the FTP engine's use of the EPRT command ( it
-     also disables the LPRT attempt). By default, those ones will always be
-     attempted before the good old traditional PORT command. */
-  CINIT(FTP_USE_EPRT, LONG, 106),
-
-  /* Set this to a bitmask value to enable the particular authentications
-     methods you like. Use this in combination with CURLOPT_USERPWD.
-     Note that setting multiple bits may cause extra network round-trips. */
-  CINIT(HTTPAUTH, LONG, 107),
-
-  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
-     in second argument. The function must be matching the
-     curl_ssl_ctx_callback proto. */
-  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
-
-  /* Set the userdata for the ssl context callback function's third
-     argument */
-  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
-
-  /* FTP Option that causes missing dirs to be created on the remote server */
-  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
-
-  /* Set this to a bitmask value to enable the particular authentications
-     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
-     Note that setting multiple bits may cause extra network round-trips. */
-  CINIT(PROXYAUTH, LONG, 111),
-
-  /* FTP option that changes the timeout, in seconds, associated with
-     getting a response.  This is different from transfer timeout time and
-     essentially places a demand on the FTP server to acknowledge commands
-     in a timely manner. */
-  CINIT(FTP_RESPONSE_TIMEOUT, LONG , 112),
-
-  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
-     tell libcurl to resolve names to those IP versions only. This only has
-     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
-  CINIT(IPRESOLVE, LONG, 113),
-
-  /* Set this option to limit the size of a file that will be downloaded from
-     an HTTP or FTP server.
-
-     Note there is also _LARGE version which adds large file support for
-     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */
-  CINIT(MAXFILESIZE, LONG, 114),
-
-  /* See the comment for INFILESIZE above, but in short, specifies
-   * the size of the file being uploaded.  -1 means unknown.
-   */
-  CINIT(INFILESIZE_LARGE, OFF_T, 115),
-
-  /* Sets the continuation offset.  There is also a LONG version of this;
-   * look above for RESUME_FROM.
-   */
-  CINIT(RESUME_FROM_LARGE, OFF_T, 116),
-
-  /* Sets the maximum size of data that will be downloaded from
-   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.
-   */
-  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
-
-  /* Set this option to the file name of your .netrc file you want libcurl
-     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
-     a poor attempt to find the user's home directory and check for a .netrc
-     file in there. */
-  CINIT(NETRC_FILE, OBJECTPOINT, 118),
-
-  /* Enable SSL/TLS for FTP, pick one of:
-     CURLFTPSSL_TRY     - try using SSL, proceed anyway otherwise
-     CURLFTPSSL_CONTROL - SSL for the control connection or fail
-     CURLFTPSSL_ALL     - SSL for all communication or fail
-  */
-  CINIT(FTP_SSL, LONG, 119),
-
-  /* The _LARGE version of the standard POSTFIELDSIZE option */
-  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
-
-  /* Enable/disable the TCP Nagle algorithm */
-  CINIT(TCP_NODELAY, LONG, 121),
-
-  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-
-  /* When doing 3rd party transfer, set the source user and password with
-     this */
-  CINIT(SOURCE_USERPWD, OBJECTPOINT, 123),
-
-  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
-
-  /* When doing 3rd party transfer, set the source pre-quote linked list
-     of commands with this */
-  CINIT(SOURCE_PREQUOTE, OBJECTPOINT, 127),
-
-  /* When doing 3rd party transfer, set the source post-quote linked list
-     of commands with this */
-  CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
-
-  /* When FTP over SSL/TLS is selected (with CURLOPT_FTP_SSL), this option
-     can be used to change libcurl's default action which is to first try
-     "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
-     response has been received.
-
-     Available parameters are:
-     CURLFTPAUTH_DEFAULT - let libcurl decide
-     CURLFTPAUTH_SSL     - try "AUTH SSL" first, then TLS
-     CURLFTPAUTH_TLS     - try "AUTH TLS" first, then SSL
-  */
-  CINIT(FTPSSLAUTH, LONG, 129),
-
-  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
-  CINIT(IOCTLDATA, OBJECTPOINT, 131),
-
-  /* To make a 3rd party transfer, set the source URL with this */
-  CINIT(SOURCE_URL, OBJECTPOINT, 132),
-
-  /* When doing 3rd party transfer, set the source quote linked list of
-     commands with this */
-  CINIT(SOURCE_QUOTE, OBJECTPOINT, 133),
-
-  /* zero terminated string for pass on to the FTP server when asked for
-     "account" info */
-  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
-
-  /* feed cookies into cookie engine */
-  CINIT(COOKIELIST, OBJECTPOINT, 135),
-
-  /* ignore Content-Length */
-  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
-
-  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
-     response. Typically used for FTP-SSL purposes but is not restricted to
-     that. libcurl will then instead use the same IP address it used for the
-     control connection. */
-  CINIT(FTP_SKIP_PASV_IP, LONG, 137),
-
-  /* Select "file method" to use when doing FTP, see the curl_ftpmethod
-     above. */
-  CINIT(FTP_FILEMETHOD, LONG, 138),
-
-  /* Local port number to bind the socket to */
-  CINIT(LOCALPORT, LONG, 139),
-
-  /* Number of ports to try, including the first one set with LOCALPORT.
-     Thus, setting it to 1 will make no additional attempts but the first.
-  */
-  CINIT(LOCALPORTRANGE, LONG, 140),
-
-  /* no transfer, set up connection and let application use the socket by
-     extracting it with CURLINFO_LASTSOCKET */
-  CINIT(CONNECT_ONLY, LONG, 141),
-
-  /* Function that will be called to convert from the
-     network encoding (instead of using the iconv calls in libcurl) */
-  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
-
-  /* Function that will be called to convert to the
-     network encoding (instead of using the iconv calls in libcurl) */
-  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
-
-  /* Function that will be called to convert from UTF8
-     (instead of using the iconv calls in libcurl)
-     Note that this is used only for SSL certificate processing */
-  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
-
-  /* if the connection proceeds too quickly then need to slow it down */
-  /* limit-rate: maximum number of bytes per second to send or receive */
-  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
-  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
-
-  /* Pointer to command string to send if USER/PASS fails. */
-  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
-
-  /* CRL file */
-  CINIT(CRLFILE, OBJECTPOINT, 169),
-
-  /* set the bitmask for the protocols that are allowed to be used for the
-     transfer, which thus helps the app which takes URLs from users or other
-     external inputs and want to restrict what protocol(s) to deal
-     with. Defaults to CURLPROTO_ALL. */
-  CINIT(PROTOCOLS, LONG, 181),
-
-  /* set the bitmask for the protocols that libcurl is allowed to follow to,
-     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
-     to be set in both bitmasks to be allowed to get redirected to. Defaults
-     to CURLPROTO_ALL & ~CURLPROTO_FILE. */
-  CINIT(REDIR_PROTOCOLS, LONG, 182),
-
-  /* allow GSSAPI credential delegation */
-  CINIT(GSSAPI_DELEGATION, LONG, 210),
-
-  CURLOPT_LASTENTRY /* the last unused */
-} CURLoption;
-
-  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
-     name resolves addresses using more than one IP protocol version, this
-     option might be handy to force libcurl to use a specific IP version. */
-#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
-                                     versions that your system allows */
-#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */
-#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */
-
-  /* three convenient "aliases" that follow the name scheme better */
-#define CURLOPT_WRITEDATA CURLOPT_FILE
-#define CURLOPT_READDATA  CURLOPT_INFILE
-#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
-                          the obsolete stuff removed! */
-#define CURLOPT_HTTPREQUEST    -1
-#define CURLOPT_FTPASCII       CURLOPT_TRANSFERTEXT
-#define CURLOPT_MUTE           -2
-#define CURLOPT_PASSWDFUNCTION -3
-#define CURLOPT_PASSWDDATA     -4
-#define CURLOPT_CLOSEFUNCTION  -5
-
-#define CURLOPT_SOURCE_HOST    -6
-#define CURLOPT_SOURCE_PATH    -7
-#define CURLOPT_SOURCE_PORT    -8
-#define CURLOPT_PASV_HOST      -9
-
-#else
-/* This is set if CURL_NO_OLDIES is defined at compile-time */
-#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
-#endif
-
-
-  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
-enum {
-  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
-                             like the library to choose the best possible
-                             for us! */
-  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */
-  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */
-
-  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
-};
-
-  /* These enums are for use with the CURLOPT_NETRC option. */
-enum CURL_NETRC_OPTION {
-  CURL_NETRC_IGNORED,     /* The .netrc will never be read.
-                           * This is the default. */
-  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred
-                           * to one in the .netrc. */
-  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.
-                           * Unless one is set programmatically, the .netrc
-                           * will be queried. */
-  CURL_NETRC_LAST
-};
-
-enum {
-  CURL_SSLVERSION_DEFAULT,
-  CURL_SSLVERSION_TLSv1,
-  CURL_SSLVERSION_SSLv2,
-  CURL_SSLVERSION_SSLv3,
-
-  CURL_SSLVERSION_LAST /* never use, keep last */
-};
-
-
-typedef enum {
-  CURL_TIMECOND_NONE,
-
-  CURL_TIMECOND_IFMODSINCE,
-  CURL_TIMECOND_IFUNMODSINCE,
-  CURL_TIMECOND_LASTMOD,
-
-  CURL_TIMECOND_LAST
-} curl_TimeCond;
-
-#ifdef __BEOS__
-#include <support/SupportDefs.h>
-#endif
-
-
-/* curl_strequal() and curl_strnequal() are subject for removal in a future
-   libcurl, see lib/README.curlx for details */
-CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
-CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
-
-/* name is uppercase CURLFORM_<name> */
-#ifdef CFINIT
-#undef CFINIT
-#endif
-
-#ifdef CURL_ISOCPP
-#define CFINIT(name) CURLFORM_ ## name
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define CFINIT(name) CURLFORM_/**/name
-#endif
-
-typedef enum {
-  CFINIT(NOTHING),        /********* the first one is unused ************/
-
-  /*  */
-  CFINIT(COPYNAME),
-  CFINIT(PTRNAME),
-  CFINIT(NAMELENGTH),
-  CFINIT(COPYCONTENTS),
-  CFINIT(PTRCONTENTS),
-  CFINIT(CONTENTSLENGTH),
-  CFINIT(FILECONTENT),
-  CFINIT(ARRAY),
-  CFINIT(OBSOLETE),
-  CFINIT(FILE),
-
-  CFINIT(BUFFER),
-  CFINIT(BUFFERPTR),
-  CFINIT(BUFFERLENGTH),
-
-  CFINIT(CONTENTTYPE),
-  CFINIT(CONTENTHEADER),
-  CFINIT(FILENAME),
-  CFINIT(END),
-  CFINIT(OBSOLETE2),
-
-  CURLFORM_LASTENTRY /* the last unusued */
-} CURLformoption;
-
-#undef CFINIT /* done */
-
-/* structure to be used as parameter for CURLFORM_ARRAY */
-struct curl_forms {
-  CURLformoption option;
-  const char     *value;
-};
-
-/* use this for multipart formpost building */
-/* Returns code for curl_formadd()
- *
- * Returns:
- * CURL_FORMADD_OK             on success
- * CURL_FORMADD_MEMORY         if the FormInfo allocation fails
- * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form
- * CURL_FORMADD_NULL           if a null pointer was given for a char
- * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed
- * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
- * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)
- * CURL_FORMADD_MEMORY         if a HttpPost struct cannot be allocated
- * CURL_FORMADD_MEMORY         if some allocation for string copying failed.
- * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array
- *
- ***************************************************************************/
-typedef enum {
-  CURL_FORMADD_OK, /* first, no error */
-
-  CURL_FORMADD_MEMORY,
-  CURL_FORMADD_OPTION_TWICE,
-  CURL_FORMADD_NULL,
-  CURL_FORMADD_UNKNOWN_OPTION,
-  CURL_FORMADD_INCOMPLETE,
-  CURL_FORMADD_ILLEGAL_ARRAY,
-  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
-
-  CURL_FORMADD_LAST /* last */
-} CURLFORMcode;
-
-/*
- * NAME curl_formadd()
- *
- * DESCRIPTION
- *
- * Pretty advanved function for building multi-part formposts. Each invoke
- * adds one part that together construct a full post. Then use
- * CURLOPT_HTTPPOST to send it off to libcurl.
- */
-CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
-                                      struct curl_httppost **last_post,
-                                      ...);
-
-/*
- * callback function for curl_formget()
- * The void *arg pointer will be the one passed as second argument to curl_formget().
- * The character buffer passed to it must not be freed.
- * Should return the buffer length passed to it as the argument "len" on success.
- */
-typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
-
-/*
- * NAME curl_formget()
- *
- * DESCRIPTION
- *
- * Serialize a curl_httppost struct built with curl_formadd().
- * Accepts a void pointer as second argument which will be passed to
- * the curl_formget_callback function.
- * Returns 0 on success.
- */
-CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
-                             curl_formget_callback append);
-/*
- * NAME curl_formfree()
- *
- * DESCRIPTION
- *
- * Free a multipart formpost previously built with curl_formadd().
- */
-CURL_EXTERN void curl_formfree(struct curl_httppost *form);
-
-/*
- * NAME curl_getenv()
- *
- * DESCRIPTION
- *
- * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
- * complete. DEPRECATED - see lib/README.curlx
- */
-CURL_EXTERN char *curl_getenv(const char *variable);
-
-/*
- * NAME curl_version()
- *
- * DESCRIPTION
- *
- * Returns a static ascii string of the libcurl version.
- */
-CURL_EXTERN char *curl_version(void);
-
-/*
- * NAME curl_easy_escape()
- *
- * DESCRIPTION
- *
- * Escapes URL strings (converts all letters consider illegal in URLs to their
- * %XX versions). This function returns a new allocated string or NULL if an
- * error occurred.
- */
-CURL_EXTERN char *curl_easy_escape(CURL *handle,
-                                   const char *string,
-                                   int length);
-
-/* the previous version: */
-CURL_EXTERN char *curl_escape(const char *string,
-                              int length);
-
-
-/*
- * NAME curl_easy_unescape()
- *
- * DESCRIPTION
- *
- * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
- * versions). This function returns a new allocated string or NULL if an error
- * occurred.
- * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
- * converted into the host encoding.
- */
-CURL_EXTERN char *curl_easy_unescape(CURL *handle,
-                                     const char *string,
-                                     int length,
-                                     int *outlength);
-
-/* the previous version */
-CURL_EXTERN char *curl_unescape(const char *string,
-                                int length);
-
-/*
- * NAME curl_free()
- *
- * DESCRIPTION
- *
- * Provided for de-allocation in the same translation unit that did the
- * allocation. Added in libcurl 7.10
- */
-CURL_EXTERN void curl_free(void *p);
-
-/*
- * NAME curl_global_init()
- *
- * DESCRIPTION
- *
- * curl_global_init() should be invoked exactly once for each application that
- * uses libcurl
- */
-CURL_EXTERN CURLcode curl_global_init(long flags);
-
-/*
- * NAME curl_global_init_mem()
- *
- * DESCRIPTION
- *
- * curl_global_init() or curl_global_init_mem() should be invoked exactly once
- * for each application that uses libcurl.  This function can be used to
- * initialize libcurl and set user defined memory management callback
- * functions.  Users can implement memory management routines to check for
- * memory leaks, check for mis-use of the curl library etc.  User registered
- * callback routines with be invoked by this library instead of the system
- * memory management routines like malloc, free etc.
- */
-CURL_EXTERN CURLcode curl_global_init_mem(long flags,
-                                          curl_malloc_callback m,
-                                          curl_free_callback f,
-                                          curl_realloc_callback r,
-                                          curl_strdup_callback s,
-                                          curl_calloc_callback c);
-
-/*
- * NAME curl_global_cleanup()
- *
- * DESCRIPTION
- *
- * curl_global_cleanup() should be invoked exactly once for each application
- * that uses libcurl
- */
-CURL_EXTERN void curl_global_cleanup(void);
-
-/* linked-list structure for the CURLOPT_QUOTE option (and other) */
-struct curl_slist {
-  char *data;
-  struct curl_slist *next;
-};
-
-/*
- * NAME curl_slist_append()
- *
- * DESCRIPTION
- *
- * Appends a string to a linked list. If no list exists, it will be created
- * first. Returns the new list, after appending.
- */
-CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
-                                                 const char *);
-
-/*
- * NAME curl_slist_free_all()
- *
- * DESCRIPTION
- *
- * free a previously built curl_slist.
- */
-CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
-
-/*
- * NAME curl_getdate()
- *
- * DESCRIPTION
- *
- * Returns the time, in seconds since 1 Jan 1970 of the time string given in
- * the first argument. The time argument in the second parameter is unused
- * and should be set to NULL.
- */
-CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
-
-#define CURLINFO_STRING   0x100000
-#define CURLINFO_LONG     0x200000
-#define CURLINFO_DOUBLE   0x300000
-#define CURLINFO_SLIST    0x400000
-#define CURLINFO_MASK     0x0fffff
-#define CURLINFO_TYPEMASK 0xf00000
-
-typedef enum {
-  CURLINFO_NONE, /* first, never use this */
-  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,
-  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,
-  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,
-  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,
-  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,
-  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
-  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,
-  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,
-  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,
-  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,
-  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,
-  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,
-  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,
-  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,
-  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,
-  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,
-  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
-  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,
-  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,
-  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,
-  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
-  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
-  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
-  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
-  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
-  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
-  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
-  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
-  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,
-  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
-  /* Fill in new entries below here! */
-
-  CURLINFO_LASTONE          = 30
-} CURLINFO;
-
-/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
-   CURLINFO_HTTP_CODE */
-#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
-
-typedef enum {
-  CURLCLOSEPOLICY_NONE, /* first, never use this */
-
-  CURLCLOSEPOLICY_OLDEST,
-  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
-  CURLCLOSEPOLICY_LEAST_TRAFFIC,
-  CURLCLOSEPOLICY_SLOWEST,
-  CURLCLOSEPOLICY_CALLBACK,
-
-  CURLCLOSEPOLICY_LAST /* last, never use this */
-} curl_closepolicy;
-
-#define CURL_GLOBAL_SSL (1<<0)
-#define CURL_GLOBAL_WIN32 (1<<1)
-#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
-#define CURL_GLOBAL_NOTHING 0
-#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
-
-
-/*****************************************************************************
- * Setup defines, protos etc for the sharing stuff.
- */
-
-/* Different data locks for a single share */
-typedef enum {
-  CURL_LOCK_DATA_NONE = 0,
-  /*  CURL_LOCK_DATA_SHARE is used internaly to say that
-   *  the locking is just made to change the internal state of the share
-   *  itself.
-   */
-  CURL_LOCK_DATA_SHARE,
-  CURL_LOCK_DATA_COOKIE,
-  CURL_LOCK_DATA_DNS,
-  CURL_LOCK_DATA_SSL_SESSION,
-  CURL_LOCK_DATA_CONNECT,
-  CURL_LOCK_DATA_LAST
-} curl_lock_data;
-
-/* Different lock access types */
-typedef enum {
-  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */
-  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
-  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
-  CURL_LOCK_ACCESS_LAST        /* never use */
-} curl_lock_access;
-
-typedef void (*curl_lock_function)(CURL *handle,
-                                   curl_lock_data data,
-                                   curl_lock_access locktype,
-                                   void *userptr);
-typedef void (*curl_unlock_function)(CURL *handle,
-                                     curl_lock_data data,
-                                     void *userptr);
-
-typedef void CURLSH;
-
-typedef enum {
-  CURLSHE_OK,  /* all is fine */
-  CURLSHE_BAD_OPTION, /* 1 */
-  CURLSHE_IN_USE,     /* 2 */
-  CURLSHE_INVALID,    /* 3 */
-  CURLSHE_NOMEM,      /* out of memory */
-  CURLSHE_LAST /* never use */
-} CURLSHcode;
-
-typedef enum {
-  CURLSHOPT_NONE,  /* don't use */
-  CURLSHOPT_SHARE,   /* specify a data type to share */
-  CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */
-  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
-  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
-  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
-                           callback functions */
-  CURLSHOPT_LAST  /* never use */
-} CURLSHoption;
-
-CURL_EXTERN CURLSH *curl_share_init(void);
-CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
-CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
-
-/****************************************************************************
- * Structures for querying information about the curl library at runtime.
- */
-
-typedef enum {
-  CURLVERSION_FIRST,
-  CURLVERSION_SECOND,
-  CURLVERSION_THIRD,
-  CURLVERSION_LAST /* never actually use this */
-} CURLversion;
-
-/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
-   basicly all programs ever, that want to get version information. It is
-   meant to be a built-in version number for what kind of struct the caller
-   expects. If the struct ever changes, we redefine the NOW to another enum
-   from above. */
-#define CURLVERSION_NOW CURLVERSION_THIRD
-
-typedef struct {
-  CURLversion age;          /* age of the returned struct */
-  const char *version;      /* LIBCURL_VERSION */
-  unsigned int version_num; /* LIBCURL_VERSION_NUM */
-  const char *host;         /* OS/host/cpu/machine when configured */
-  int features;             /* bitmask, see defines below */
-  const char *ssl_version;  /* human readable string */
-  long ssl_version_num;     /* not used anymore, always 0 */
-  const char *libz_version; /* human readable string */
-  /* protocols is terminated by an entry with a NULL protoname */
-  const char * const *protocols;
-
-  /* The fields below this were added in CURLVERSION_SECOND */
-  const char *ares;
-  int ares_num;
-
-  /* This field was added in CURLVERSION_THIRD */
-  const char *libidn;
-
-  /* Same as '_libiconv_version' if built with HAVE_ICONV */
-  int iconv_ver_num;
-} curl_version_info_data;
-
-#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */
-#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */
-#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */
-#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */
-#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */
-#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
-#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */
-#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */
-#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */
-#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */
-#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */
-#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */
-#define CURL_VERSION_CONV      (1<<12) /* character conversions are
-                                          supported */
-
-/*
- * NAME curl_version_info()
- *
- * DESCRIPTION
- *
- * This function returns a pointer to a static copy of the version info
- * struct. See above.
- */
-CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
-
-/*
- * NAME curl_easy_strerror()
- *
- * DESCRIPTION
- *
- * The curl_easy_strerror function may be used to turn a CURLcode value
- * into the equivalent human readable error string.  This is useful
- * for printing meaningful error messages.
- */
-CURL_EXTERN const char *curl_easy_strerror(CURLcode);
-
-/*
- * NAME curl_share_strerror()
- *
- * DESCRIPTION
- *
- * The curl_share_strerror function may be used to turn a CURLSHcode value
- * into the equivalent human readable error string.  This is useful
- * for printing meaningful error messages.
- */
-CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
-
-#ifdef  __cplusplus
-}
-#endif
-
-/* unfortunately, the easy.h and multi.h include files need options and info
-  stuff before they can be included! */
-#include "easy.h" /* nothing in curl is fun without the easy stuff */
-#include "multi.h"
-
-#endif /* __CURL_CURL_H */
diff --git a/libs/kns/curlhdr/curlver.h b/libs/kns/curlhdr/curlver.h
deleted file mode 100644
index 46fc5d8..0000000
--- a/libs/kns/curlhdr/curlver.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef __CURL_CURLVER_H
-#define __CURL_CURLVER_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel at haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curlver.h,v 1.1 2012/11/09 17:54:52 rodarmer Exp $
- ***************************************************************************/
-
-/* This header file contains nothing but libcurl version info, generated by
-   a script at release-time. This was made its own header file in 7.11.2 */
-
-/* This is the version number of the libcurl package from which this header
-   file origins: */
-#define LIBCURL_VERSION "7.15.5"
-
-/* The numeric version number is also available "in parts" by using these
-   defines: */
-#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 15
-#define LIBCURL_VERSION_PATCH 5
-
-/* This is the numeric version of the libcurl version number, meant for easier
-   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
-   always follow this syntax:
-
-         0xXXYYZZ
-
-   Where XX, YY and ZZ are the main version, release and patch numbers in
-   hexadecimal (using 8 bits each). All three numbers are always represented
-   using two digits.  1.2 would appear as "0x010200" while version 9.11.7
-   appears as "0x090b07".
-
-   This 6-digit (24 bits) hexadecimal number does not show pre-release number,
-   and it is always a greater number in a more recent release. It makes
-   comparisons with greater than and less than work.
-*/
-#define LIBCURL_VERSION_NUM 0x070f05
-
-#endif /* __CURL_CURLVER_H */
diff --git a/libs/kns/curlhdr/easy.h b/libs/kns/curlhdr/easy.h
deleted file mode 100644
index 2f96c9a..0000000
--- a/libs/kns/curlhdr/easy.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef __CURL_EASY_H
-#define __CURL_EASY_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel at haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: easy.h,v 1.1 2012/11/09 17:54:52 rodarmer Exp $
- ***************************************************************************/
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-CURL_EXTERN CURL *curl_easy_init(void);
-CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
-CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
-CURL_EXTERN void curl_easy_cleanup(CURL *curl);
-
-/*
- * NAME curl_easy_getinfo()
- *
- * DESCRIPTION
- *
- * Request internal information from the curl session with this function.  The
- * third argument MUST be a pointer to a long, a pointer to a char * or a
- * pointer to a double (as the documentation describes elsewhere).  The data
- * pointed to will be filled in accordingly and can be relied upon only if the
- * function returns CURLE_OK.  This function is intended to get used *AFTER* a
- * performed transfer, all results from this function are undefined until the
- * transfer is completed.
- */
-CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
-
-
-/*
- * NAME curl_easy_duphandle()
- *
- * DESCRIPTION
- *
- * Creates a new curl session handle with the same options set for the handle
- * passed in. Duplicating a handle could only be a matter of cloning data and
- * options, internal state info and things like persistant connections cannot
- * be transfered. It is useful in multithreaded applications when you can run
- * curl_easy_duphandle() for each new thread to avoid a series of identical
- * curl_easy_setopt() invokes in every thread.
- */
-CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
-
-/*
- * NAME curl_easy_reset()
- *
- * DESCRIPTION
- *
- * Re-initializes a CURL handle to the default values. This puts back the
- * handle to the same state as it was in when it was just created.
- *
- * It does keep: live connections, the Session ID cache, the DNS cache and the
- * cookies.
- */
-CURL_EXTERN void curl_easy_reset(CURL *curl);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
diff --git a/libs/kns/curlhdr/multi.h b/libs/kns/curlhdr/multi.h
deleted file mode 100644
index bbddc13..0000000
--- a/libs/kns/curlhdr/multi.h
+++ /dev/null
@@ -1,344 +0,0 @@
-#ifndef __CURL_MULTI_H
-#define __CURL_MULTI_H
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel at haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: multi.h,v 1.1 2012/11/09 17:54:52 rodarmer Exp $
- ***************************************************************************/
-/*
-  This is an "external" header file. Don't give away any internals here!
-
-  GOALS
-
-  o Enable a "pull" interface. The application that uses libcurl decides where
-    and when to ask libcurl to get/send data.
-
-  o Enable multiple simultaneous transfers in the same thread without making it
-    complicated for the application.
-
-  o Enable the application to select() on its own file descriptors and curl's
-    file descriptors simultaneous easily.
-
-*/
-#if defined(_WIN32) && !defined(WIN32)
-/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we
-   make this adjustment to catch this. */
-#define WIN32 1
-#endif
-
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
-  !defined(__CYGWIN__) || defined(__MINGW32__)
-#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
-/* The check above prevents the winsock2 inclusion if winsock.h already was
-   included, since they can't co-exist without problems */
-#include <winsock2.h>
-#endif
-#else
-
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
-   libc5-based Linux systems. Only include it on system that are known to
-   require it! */
-#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(_MINIX)
-#include <sys/select.h>
-#endif
-
-#ifndef _WIN32_WCE
-#include <sys/socket.h>
-#endif
-#include <sys/time.h>
-#include <sys/types.h>
-#endif
-
-/*
- * This header file should not really need to include "curl.h" since curl.h
- * itself includes this file and we expect user applications to do #include
- * <curl/curl.h> without the need for especially including multi.h.
- *
- * For some reason we added this include here at one point, and rather than to
- * break existing (wrongly written) libcurl applications, we leave it as-is
- * but with this warning attached.
- */
-#include "curl.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-typedef void CURLM;
-
-#ifndef curl_socket_typedef
-/* Public socket typedef */
-#ifdef WIN32
-typedef SOCKET curl_socket_t;
-#define CURL_SOCKET_BAD INVALID_SOCKET
-#else
-typedef int curl_socket_t;
-#define CURL_SOCKET_BAD -1
-#endif
-#define curl_socket_typedef
-#endif /* curl_socket_typedef */
-
-typedef enum {
-  CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
-                                    curl_multi_socket*() soon */
-  CURLM_OK,
-  CURLM_BAD_HANDLE,      /* the passed-in handle is not a valid CURLM handle */
-  CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
-  CURLM_OUT_OF_MEMORY,   /* if you ever get this, you're in deep sh*t */
-  CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */
-  CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */
-  CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */
-  CURLM_LAST
-} CURLMcode;
-
-/* just to make code nicer when using curl_multi_socket() you can now check
-   for CURLM_CALL_MULTI_SOCKET too in the same style it works for
-   curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
-#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
-
-typedef enum {
-  CURLMSG_NONE, /* first, not used */
-  CURLMSG_DONE, /* This easy handle has completed. 'result' contains
-                   the CURLcode of the transfer */
-  CURLMSG_LAST /* last, not used */
-} CURLMSG;
-
-struct CURLMsg {
-  CURLMSG msg;       /* what this message means */
-  CURL *easy_handle; /* the handle it concerns */
-  union {
-    void *whatever;    /* message-specific data */
-    CURLcode result;   /* return code for transfer */
-  } data;
-};
-typedef struct CURLMsg CURLMsg;
-
-/*
- * Name:    curl_multi_init()
- *
- * Desc:    inititalize multi-style curl usage
- *
- * Returns: a new CURLM handle to use in all 'curl_multi' functions.
- */
-CURL_EXTERN CURLM *curl_multi_init(void);
-
-/*
- * Name:    curl_multi_add_handle()
- *
- * Desc:    add a standard curl handle to the multi stack
- *
- * Returns: CURLMcode type, general multi error code.
- */
-CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
-                                            CURL *curl_handle);
-
- /*
-  * Name:    curl_multi_remove_handle()
-  *
-  * Desc:    removes a curl handle from the multi stack again
-  *
-  * Returns: CURLMcode type, general multi error code.
-  */
-CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
-                                               CURL *curl_handle);
-
- /*
-  * Name:    curl_multi_fdset()
-  *
-  * Desc:    Ask curl for its fd_set sets. The app can use these to select() or
-  *          poll() on. We want curl_multi_perform() called as soon as one of
-  *          them are ready.
-  *
-  * Returns: CURLMcode type, general multi error code.
-  */
-CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
-                                       fd_set *read_fd_set,
-                                       fd_set *write_fd_set,
-                                       fd_set *exc_fd_set,
-                                       int *max_fd);
-
- /*
-  * Name:    curl_multi_perform()
-  *
-  * Desc:    When the app thinks there's data available for curl it calls this
-  *          function to read/write whatever there is right now. This returns
-  *          as soon as the reads and writes are done. This function does not
-  *          require that there actually is data available for reading or that
-  *          data can be written, it can be called just in case. It returns
-  *          the number of handles that still transfer data in the second
-  *          argument's integer-pointer.
-  *
-  * Returns: CURLMcode type, general multi error code. *NOTE* that this only
-  *          returns errors etc regarding the whole multi stack. There might
-  *          still have occurred problems on invidual transfers even when this
-  *          returns OK.
-  */
-CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
-                                         int *running_handles);
-
- /*
-  * Name:    curl_multi_cleanup()
-  *
-  * Desc:    Cleans up and removes a whole multi stack. It does not free or
-  *          touch any individual easy handles in any way. We need to define
-  *          in what state those handles will be if this function is called
-  *          in the middle of a transfer.
-  *
-  * Returns: CURLMcode type, general multi error code.
-  */
-CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
-
-/*
- * Name:    curl_multi_info_read()
- *
- * Desc:    Ask the multi handle if there's any messages/informationals from
- *          the individual transfers. Messages include informationals such as
- *          error code from the transfer or just the fact that a transfer is
- *          completed. More details on these should be written down as well.
- *
- *          Repeated calls to this function will return a new struct each
- *          time, until a special "end of msgs" struct is returned as a signal
- *          that there is no more to get at this point.
- *
- *          The data the returned pointer points to will not survive calling
- *          curl_multi_cleanup().
- *
- *          The 'CURLMsg' struct is meant to be very simple and only contain
- *          very basic informations. If more involved information is wanted,
- *          we will provide the particular "transfer handle" in that struct
- *          and that should/could/would be used in subsequent
- *          curl_easy_getinfo() calls (or similar). The point being that we
- *          must never expose complex structs to applications, as then we'll
- *          undoubtably get backwards compatibility problems in the future.
- *
- * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
- *          of structs. It also writes the number of messages left in the
- *          queue (after this read) in the integer the second argument points
- *          to.
- */
-CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
-                                          int *msgs_in_queue);
-
-/*
- * Name:    curl_multi_strerror()
- *
- * Desc:    The curl_multi_strerror function may be used to turn a CURLMcode
- *          value into the equivalent human readable error string.  This is
- *          useful for printing meaningful error messages.
- *
- * Returns: A pointer to a zero-terminated error message.
- */
-CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
-
-/*
- * Name:    curl_multi_socket() and
- *          curl_multi_socket_all()
- *
- * Desc:    An alternative version of curl_multi_perform() that allows the
- *          application to pass in one of the file descriptors that have been
- *          detected to have "action" on them and let libcurl perform.
- *          See man page for details.
- */
-#define CURL_POLL_NONE   0
-#define CURL_POLL_IN     1
-#define CURL_POLL_OUT    2
-#define CURL_POLL_INOUT  3
-#define CURL_POLL_REMOVE 4
-
-#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
-
-typedef int (*curl_socket_callback)(CURL *easy,      /* easy handle */
-                                    curl_socket_t s, /* socket */
-                                    int what,        /* see above */
-                                    void *userp,     /* private callback
-                                                        pointer */
-                                    void *socketp);  /* private socket
-                                                        pointer */
-
-CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
-                                        int *running_handles);
-
-CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
-                                            int *running_handles);
-
-/*
- * Name:    curl_multi_timeout()
- *
- * Desc:    Returns the maximum number of milliseconds the app is allowed to
- *          wait before curl_multi_socket() or curl_multi_perform() must be
- *          called (to allow libcurl's timed events to take place).
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
-                                         long *milliseconds);
-
-#undef CINIT /* re-using the same name as in curl.h */
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG          CURLOPTTYPE_LONG
-#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T         CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
-#endif
-
-typedef enum {
-  /* This is the socket callback function pointer */
-  CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
-
-  /* This is the argument passed to the socket callback */
-  CINIT(SOCKETDATA, OBJECTPOINT, 2),
-
-  CURLMOPT_LASTENTRY /* the last unused */
-} CURLMoption;
-
-
-/*
- * Name:    curl_multi_setopt()
- *
- * Desc:    Sets options for the multi handle.
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
-                                        CURLMoption option, ...);
-
-
-/*
- * Name:    curl_multi_assign()
- *
- * Desc:    This function sets an association in the multi handle between the
- *          given socket and a private pointer of the application. This is
- *          (only) useful for curl_multi_socket uses.
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
-                                        curl_socket_t sockfd, void *sockp);
-
-#ifdef __cplusplus
-} /* end of extern "C" */
-#endif
-
-#endif
diff --git a/libs/kns/curlhdr/types.h b/libs/kns/curlhdr/types.h
deleted file mode 100644
index d37d6ae..0000000
--- a/libs/kns/curlhdr/types.h
+++ /dev/null
@@ -1 +0,0 @@
-/* not used */
diff --git a/libs/kns/endpoint.c b/libs/kns/endpoint.c
deleted file mode 100644
index 6cb8e12..0000000
--- a/libs/kns/endpoint.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/impl.h>
-#include <kns/endpoint.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include "stream-priv.h"
-
-#include <string.h>
-#include <assert.h>
-
-#include <sysalloc.h>
-
-
-/* InitIPv4Endpoint
- *  initialize the endpoint with an IPv4 address and port
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "ipv4" [ IN, DEFAULT 0 ] - binary IPv4 address in native integer byte order
- *   i.e. 0x7F000001 represents 127.0.0.1. if the special address 0 is given, it
- *   represents any host-local interface address.
- *
- *  "port" [ IN, DEFAULT 0 ] - binary port number in native integer byte order.
- *   if the special port number 0 is given, it represents any available port.
- */
-LIB_EXPORT 
-rc_t CC KNSManagerInitIPv4Endpoint ( struct KNSManager const *self,
-    KEndPoint *ep, uint32_t ipv4, uint16_t port )
-{
-    rc_t rc;
-
-    if ( ep == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcInitializing, rcParam, rcNull);
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcNull );
-        else
-        {
-            ep -> type = epIPV4;
-            ep -> u . ipv4. addr = ipv4;
-            ep -> u. ipv4 . port = port;
-            return 0;
-        }
-
-        memset ( ep, 0, sizeof * ep );
-    }
-    return rc;
-}
-
-/* InitIPCEndpoint
- *  initialize the endpoint for interprocess communication
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "name" [ IN ] - IPC channel name (a POSIX path to a Unix socket, or a name of a Windows pipe)
- */
-LIB_EXPORT 
-rc_t CC KNSManagerInitIPCEndpoint ( struct KNSManager const *self,
-    KEndPoint *ep, struct String const * name )
-{
-    rc_t rc;
-
-    if ( ep == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcInitializing, rcParam, rcNull);
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcNull );
-        else
-        {
-            size_t copied = string_copy(ep -> u.ipc_name, IPC_NAME_MAX - 1, name->addr, name->len);
-            if (copied != name->len)
-                rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSize, rcExcessive );
-            ep -> u.ipc_name[copied] = 0;
-            ep -> type = epIPC;
-            return 0;
-        }
-
-        memset ( ep, 0, sizeof * ep );
-    }
-    return rc;
-}
diff --git a/libs/kns/entrez-fetcher.c b/libs/kns/entrez-fetcher.c
deleted file mode 100644
index 0108ccd..0000000
--- a/libs/kns/entrez-fetcher.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/refcount.h>
-#include <kns/entrez-fetcher.h>
-#include <kns/url-fetcher.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#define URI_PARAM_LEN 70
-#define ENTREZ_FIRST_LINE_LEN 120
-#define ENTREZ_NEWLINE_DIV 80
-
-struct KEntrezFetcher
-{
-    KRefcount refcount;
-
-    KUrlFetcher * url_fetcher;
-    char * uri;
-};
-
-static const char classname[] = "KSraFetcher";
-
-rc_t KEntrezFetcherAddRef ( const KEntrezFetcher *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, classname ) )
-        {
-        case krefLimit:
-            return RC ( rcApp, rcFunction, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-rc_t KEntrezFetcherRelease ( const KEntrezFetcher *cself )
-{
-    KEntrezFetcher *self = ( KEntrezFetcher* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, classname ) )
-        {
-        case krefWhack:
-            {
-                KUrlFetcherRelease ( self -> url_fetcher );
-                if ( self -> uri ) free( self -> uri );
-                free( self );
-                return 0;
-            }
-        case krefNegative:
-            return RC ( rcApp, rcFunction, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-rc_t KEntrezFetcherSetupUri ( KEntrezFetcher *self, const char * uri )
-{
-    if ( uri == NULL || uri[0] == 0 )
-        return RC ( rcApp, rcFunction, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcSelf, rcNull );
-
-    if ( self -> uri ) free( self -> uri );
-    self -> uri = string_dup_measure ( uri, NULL );
-    return 0;
-}
-
-
-/* composes the internal uri from the parameters and returns an estimated buffersize */
-rc_t KEntrezFetcherSetup ( KEntrezFetcher *self,
-    const char * server, const char * seq_id, 
-    const size_t max_seq_len, const uint64_t row_id, const size_t row_count,
-    size_t * buffsize )
-{
-    rc_t rc;
-    size_t uri_len;
-
-    if ( server == NULL || seq_id == NULL || buffsize == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcSelf, rcNull );
-
-    if ( self -> uri ) free( self -> uri );
-    uri_len = string_size( server ) + string_size( seq_id ) + URI_PARAM_LEN;
-    self -> uri = malloc( uri_len );
-    if ( self -> uri != NULL )
-    {
-        size_t num_written;
-        uint64_t seq_start, seq_stop;
-        
-        seq_start = max_seq_len * ( row_id - 1 ) + 1;
-        seq_stop = max_seq_len * ( row_id + row_count - 1 );
-        
-        if ( seq_stop <= seq_start )
-            return RC ( rcApp, rcFunction, rcAccessing, rcSelf, rcNull );
-            
-        *buffsize = ( seq_stop - seq_start );
-        *buffsize += ( *buffsize / ENTREZ_NEWLINE_DIV );
-        *buffsize += ENTREZ_FIRST_LINE_LEN;
-
-        rc = string_printf ( self->uri, uri_len, &num_written, 
-            "%s?db=nucleotide&id=%s&rettype=fasta&seq_start=%lu&seq_stop=%lu", 
-            server, seq_id, seq_start, seq_stop );
-    }
-    else
-        rc = RC( rcExe, rcString, rcAllocating, rcMemory, rcExhausted );
-    
-    return rc;
-}
-
-
-/* remove the first line, including it's line-feed */
-static void remove_first_line( char * s, size_t * len )
-{
-    char * p = string_chr ( s, *len, '\n' );
-    if ( p )
-    {
-        *len -= ( p - s ) + 1;
-        memmove( s, p + 1, *len );
-    }
-}
-
-
-/* filters out all char's c by using a filtered temp-buffer... */
-static void filter_char( char * s, size_t * len, const char c )
-{
-    size_t src, dst;
-
-    if ( s == NULL || len == NULL || *len == 0 )
-        return;
-
-    dst = 0;
-    for ( src = 0; src < *len; ++src )
-    {
-        char ch = s[ src ];
-        if ( ch != c )
-        {
-            if ( src != dst )
-                s[ dst ] = ch;
-            ++dst;
-        }
-    }
-    *len = dst;
-}
-
-
-rc_t KEntrezFetcherRead ( KEntrezFetcher *self,
-                          void *dst, size_t dst_size, size_t *num_read )
-{
-    rc_t rc;
-    
-    if ( dst == NULL || dst_size == 0 || num_read == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcSelf, rcNull );
-    if ( self -> url_fetcher == NULL || self -> uri == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcParam, rcNull );
-
-    rc = KUrlFetcherRead( self -> url_fetcher, self -> uri, dst, dst_size, num_read );
-    if ( rc == 0 )
-    {
-        remove_first_line( dst, num_read );
-        filter_char( dst, num_read, '\n' );
-    }
-    return rc;
-}
-
-
-rc_t KEntrezFetcherMake ( KEntrezFetcher **fetcher, KUrlFetcher * url_fetcher )
-{
-    rc_t rc;
-
-    if ( fetcher == NULL || url_fetcher == NULL )
-        rc = RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-    else
-    {
-        *fetcher = malloc( sizeof( *fetcher ) );
-        if ( *fetcher != NULL )
-        {
-            (*fetcher) -> url_fetcher = url_fetcher;
-            KUrlFetcherAddRef ( url_fetcher );
-            (*fetcher) -> uri = NULL;
-            rc = 0;
-        }
-        else
-            rc = RC( rcApp, rcFunction, rcListing, rcParam, rcNull );
-    }
-    return rc;
-}
diff --git a/libs/kns/http-priv.h b/libs/kns/http-priv.h
deleted file mode 100644
index 2cd0c44..0000000
--- a/libs/kns/http-priv.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_http_priv_
-#define _h_http_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_data_buffer
-#include <klib/data-buffer.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-    
-struct KFile;
-struct KHttp;
-
-/*--------------------------------------------------------------------------
- * URLBlock
- *  RFC 3986
- */
-typedef struct URLBlock URLBlock;
-struct URLBlock
-{
-    String scheme;
-    String host;
-    String path; /* Path includes any parameter portion */
-    String query;
-    String fragment;
-
-    uint32_t port;
-};
-extern void URLBlockInit ( URLBlock *self );
-extern rc_t ParseUrl ( URLBlock * b, const char * url, size_t url_size );
-
-/*--------------------------------------------------------------------------
- * KHttpHeader
- *  node structure to place http header lines into a BSTree
- */
-typedef struct KHttpHeader KHttpHeader;
-struct KHttpHeader
-{
-    BSTNode dad;
-    String name;
-    String value;
-    KDataBuffer value_storage;
-};
-    
-extern void KHttpHeaderWhack ( BSTNode *n, void *ignore );
-extern rc_t KHttpGetHeaderLine ( struct KHttp *self, BSTree *hdrs, bool *blank );
-extern rc_t KHttpGetStatusLine ( struct KHttp *self, String *msg, uint32_t *status, ver_t *version );
-
-/* exported private functions
-*/
-extern rc_t HttpTest ( const struct KFile *input );
-extern void URLBlockInitTest ( void );
-extern rc_t ParseUrlTest ( void );
-extern rc_t MakeRequestTest ( void );    
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kttp_priv_ */
-
-
diff --git a/libs/kns/http-test.c b/libs/kns/http-test.c
deleted file mode 100644
index 15e949a..0000000
--- a/libs/kns/http-test.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kapp/args.h>
-#include <kapp/main.h>
-
-#include <kns/manager.h>
-#include <kns/endpoint.h>
-#include <kns/socket.h>
-#include <kns/stream.h>
-#include <kns/http.h>
-#include <kns/impl.h>
-#include <kns/adapt.h>
-#include <kfg/config.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <klib/text.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/refcount.h>
-#include <klib/container.h>
-
-#include "stream-priv.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sysalloc.h>
-
-#include "http-priv.h"
-
-
-void URLBlockInitTest ( void )
-{
-    URLBlock b;
-    URLBlockInit ( & b );
-    
-    OUTMSG ( ( "%s - URLBlockInit succeeded.\n"
-               "scheme  : '%S'\n"
-               "host    : '%S'\n"
-               "path    : '%S'\n"
-               "query   : '%S'\n"
-               "fragment: '%S'\n"
-               "port    : '%u'\n\n"
-               , __func__,  & b . scheme, & b . host
-               , & b . path, & b . query, & b . fragment, b . port ) );
-    
-}
-
-
-rc_t ParseUrlTest ( void )
-{
-    rc_t rc;
-    size_t i;
-    
-    static const char *test_urls [] =
-        {
-            /* <scheme>://<host>[:<port>]/<path>[?<query>][#<fragment>]*/
-            /*0*/ "http://www.abc.com/library/index.html?x&y=123&z=test#ignore-me",
-            /*1*/ "http://www.abc.com:123/library/index.html?x&y=123&z=test#ignore-me",
-            /*2*/ "HTTP://www.abc.com:123/library/index.html?x&y=123&z=test#ignore-me",
-            /* <scheme>://<host>[:<port>]/<path>[#<fragment>]*/
-            /*3*/ "http://www.abc.com/library/index.html#ignore-me",
-            /*4*/ "http://www.abc.com:123/library/index.html#ignore-me",
-            /* <scheme>://<host>[:<port>]/<path>[?<query>]*/
-            /*5*/ "http://www.abc.com/library/index.html?x&y=123&z=test",
-            /*6*/ "http://www.abc.com:123/library/index.html?x&y=123&z=test",
-            /* <scheme>://<host>[:<port>]/<path>*/
-            /*7*/ "http://www.abc.com/library/index.html",
-            /*8*/ "http://www.abc.com:80/library/index.html",
-            /* <scheme>://<host>[:<port>]*/
-            /*9*/ "http://www.abc.com",
-            /*10*/ "http://www.abc.com:80",
-            /* /<path>[#fragment]*/
-            /*11*/ "/library/index.html#ignore-me",
-            /* /<path>[?query]*/
-            /*12*/ "/library/index.html?x&y=123&z=test",
-            /*13*/ "///library"
-            
-            
-        };
-    const size_t num_urls = sizeof test_urls / sizeof test_urls [ 0 ];
-    
-    static const char *fail_url [] = 
-        {
-            /*<scheme>:/<path>*/
-            /*0*/ "http:/library/index.html",
-            /*1*/ "http//library/index.html",
-            /*<scheme>:/[#fragment]*/
-            /*2*/ "http:#ignore-me",
-            /*<scheme>:/[#query]*/
-            /*3*/ "http:?x&y=123&z=test",
-            /*<scheme>*/
-            /*4*/ "http",
-            /*5*/ "ftp",
-            /* <host>[:<port>]*/
-            /*6*/ "www.abc.com",
-            /*7*/ "www.abc.com:80",
-            /* <scheme>://<host>[:<port>]*/
-            /*8*/ "ftp://www.abc.com"
-            
-            
-        };
-    const size_t num_fail_urls = sizeof fail_url / sizeof fail_url [ 0 ];
-    
-    for ( i = 0; i < num_urls; ++ i )
-    {
-        URLBlock b;
-        
-        String url;
-        StringInitCString ( & url, test_urls [ i ] );
-        
-        rc  = ParseUrl ( & b, url . addr, url . size );
-        if ( rc == 0 )
-        {
-            /* same as above */
-            OUTMSG ( ( "%s - ParseUrl succeeded -- %d: %s\n"
-                       "scheme  : '%S'\n"
-                       "host    : '%S'\n"
-                       "path    : '%S'\n"
-                       "query   : '%S'\n"
-                       "fragment: '%S'\n"
-                       "port    : '%u'\n\n"
-                       , __func__, i, test_urls [ i ], & b . scheme, & b . host
-                       , & b . path, & b . query, & b . fragment, b . port ) );
-        }
-        else
-        {
-            /* same as above. analyze your code more */
-            OUTMSG (( "%s: ParseUrl failed on iteration: '%d' url: %s\n"
-                      "with rc=%R\n\n", __func__, i, test_urls [ i ], rc ));
-            return rc;
-        }
-    }
-    
-    
-    for ( i = 0; i < num_fail_urls; ++ i )
-    {
-        URLBlock b;
-        
-        String url;
-        StringInitCString ( & url, fail_url [ i ] );
-        
-        rc  = ParseUrl ( & b, url . addr, url . size );
-        if ( rc != 0 )
-        {
-            /* same as above */
-            OUTMSG ( ( "%s - ParseUrl succeeded in catching error-- %d: %s\n"
-                       "scheme  : '%S'\n"
-                       "host    : '%S'\n"
-                       "path    : '%S'\n"
-                       "query   : '%S'\n"
-                       "fragment: '%S'\n"
-                       "port    : '%u'\n\n"
-                       , __func__, i, fail_url [ i ], & b . scheme, & b . host
-                       , & b . path, & b . query, & b . fragment, b . port ) );
-        }
-        else
-        {
-            /* same as above. analyze your code more */
-            OUTMSG (( "%s: ParseUrl failed catching error on iteration: '%d' url: %s\n"
-                      "with rc=%R\n\n", __func__, i, fail_url [ i ], rc ));
-            return rc;
-        }
-    }
-    
-    return rc = 0;
-}
-
-rc_t HttpTest ( const KFile *input )
-{
-
-    KNSManager *mgr;
-
-    rc_t rc = KNSManagerMake ( & mgr );
-    if ( rc == 0 )
-    {
-        KStream *sock;
-        rc = KStreamFromKFilePair ( & sock, input, NULL );
-        if ( rc == 0 )
-        {
-            struct KHttp *http;
-
-            String host;
-            CONST_STRING ( & host, "http://www.ncbi.nlm.nih.gov/" );
-
-            rc = KNSManagerMakeHttp ( mgr, & http, sock, 0x01010000, & host, 80 );
-            if ( rc == 0 )
-            {
-                String msg;
-                ver_t version;
-                uint32_t status;
-
-                rc = KHttpGetStatusLine ( http, &msg, &status, &version );
-                if ( rc != 0 )
-                    OUTMSG (( "%s: KHttpGetStatusLine failed with rc=%R\n", __func__, rc ));
-                else
-                {
-                    bool blank;
-                    BSTree hdrs;
-                    OUTMSG (( "%s: KHttpGetStatusLine returned msg='%S', status=%u, version=%V\n",
-                              __func__, & msg, status, version ));
-
-                    BSTreeInit ( & hdrs );
-
-                    for ( blank = false; ! blank && rc == 0; )
-                        rc = KHttpGetHeaderLine ( http, & hdrs, & blank );
-                    
-                    if ( rc != 0 )
-                        OUTMSG (( "%s: KHttpGetHeaderLine failed with rc=%R\n", __func__, rc ));
-                    else
-                    {
-                        const KHttpHeader * hdr;
-                        
-                        OUTMSG (( "%s: KHttpGetStatusLine listing:\n", __func__ ));
-                        for ( hdr = ( const KHttpHeader * ) BSTreeFirst ( & hdrs ); 
-                              hdr != NULL;
-                              hdr = ( const KHttpHeader * ) BSTNodeNext ( & hdr -> dad ) )
-                        {
-                            OUTMSG (( "    name='%S', value='%S'\n", & hdr -> name, & hdr -> value ));
-                        }
-                    }
-
-                    BSTreeWhack ( & hdrs, KHttpHeaderWhack, NULL );
-
-                }
-
-                KHttpRelease ( http );
-            }
-
-            KStreamRelease ( sock );
-        }
-
-        KNSManagerRelease ( mgr );
-    }
-
-    return rc;
-}
-
-rc_t PreHttpTest ( void )
-{
-    KDirectory *dir;
-    rc_t rc = KDirectoryNativeDir ( &dir );
-    if ( rc == 0 )
-    {
-        const KFile *f;
-        rc = KDirectoryOpenFileRead ( dir, &f, "nih_1_out.txt" );
-        if ( rc == 0 )
-        {
-            rc = HttpTest ( f );
-            KFileRelease ( f );
-        }
-
-        KDirectoryRelease ( dir );
-    }
-    return rc;
-}
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release 
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return 0;
-}
-
-
-/* Usage
- *  This function is called when the command line argument
- *  handling sees -? -h or --help
- */
-rc_t CC UsageSummary ( const char *progname )
-{
-    /*    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s [Options]\n"
-        "\n"
-        "Summary:\n"
-        "  Simple test of printf.\n"
-        , progname );
-    */
-    return 0;
-}
-
-const char UsageDefaultName[] = "time-test";
-
-rc_t CC Usage ( const Args *args )
-{
-    /*
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionsStandard();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-    */
-    return 0;
-}
-
-    
-static
-rc_t run ( const char *progname )
-{
-    rc_t rc = 0;
-
-    URLBlockInitTest ();
-    rc = ParseUrlTest ();
-    rc = PreHttpTest ();      
-
-    return rc;
-}
-
-/* KMain
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args *args;
-    rc_t rc = ArgsMakeAndHandle ( & args, argc, argv, 0 );
-    if ( rc == 0 )
-    {
-        KConfigDisableUserSettings();
-        rc = run ( argv [ 0 ] );
-        ArgsWhack ( args );
-    }
-
-    return rc;
-}
-
diff --git a/libs/kns/http.c b/libs/kns/http.c
deleted file mode 100644
index 1c2a4fd..0000000
--- a/libs/kns/http.c
+++ /dev/null
@@ -1,3002 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kns/extern.h>
-
-#define KSTREAM_IMPL KHttpStream
-typedef struct KHttpStream KHttpStream;
-
-#define KFILE_IMPL KHttpFile
-typedef struct KHttpFile KHttpFile;
-#include <kfs/impl.h>
-
-#include <kns/manager.h>
-#include <kns/http.h>
-#include <kns/adapt.h>
-#include <kns/endpoint.h>
-#include <kns/socket.h>
-#include <kns/stream.h>
-#include <kns/impl.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <klib/text.h>
-#include <klib/container.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <klib/vector.h>
-#include <strtol.h>
-#include <va_copy.h>
-
-#include "stream-priv.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "http-priv.h"
-
-
-static 
-void  KDataBufferClear ( KDataBuffer *buf )
-{
-    memset ( buf, 0, sizeof *buf );
-    buf -> elem_bits = 8;
-}
-
-static
-bool KDataBufferContainsString ( const KDataBuffer *buf, const String *str )
-{
-    return str -> addr >= ( const char* ) buf -> base &&
-        & str -> addr [ str -> size ] <= & ( ( const char* ) buf -> base ) [ buf -> elem_count ];
-}
-
-/*--------------------------------------------------------------------------
- * KDataBufferVPrintf
- *  Populate a KDataBuffer
- *  If buffer is empty - resize it to 4k
- *  Else determine the correct multiple of 4k and add/append data
- */
-
-#if 0
-/* TBD - add to the printf file permanently */
-static
-rc_t KDataBufferVPrintf ( KDataBuffer * buf, const char * fmt, va_list args )
-{
-    rc_t rc;
-    size_t bsize;
-    char *buffer;
-    size_t content;
-    size_t num_writ;
-
-    /* the C library ruins a va_list upon use
-       in case we ever need to use it a second time,
-       make a copy first */
-    va_list args_copy;
-    va_copy ( args_copy, args );
-
-    /* begin to calculate content and bsize */
-    content = ( size_t ) buf -> elem_count;
-
-    /* check for an empty buffer */
-    if ( content == 0 )
-    {
-        rc = KDataBufferResize ( buf, bsize = 4096 );
-        if ( rc != 0 )
-            return rc;
-    }
-    else
-    {
-        /* generate even multiple of 4K */
-        bsize = ( content + 4095 ) & ~ ( size_t ) 4095;
-
-        /* discount NUL byte */
-        content -= 1;
-    }
-            
-    /* convert the 2-part url into a flat string */
-    buffer = buf -> base;
-    rc = string_vprintf ( &buffer [ content ], bsize - content, & num_writ, fmt, args );
-    /* Make sure there is enough room to store data including NUL */
-    if ( rc != 0 || ( content + num_writ ) == bsize )
-    {
-        bsize = ( content + num_writ + 4095 + 1 ) & ~ ( size_t ) 4095;
-        rc = KDataBufferResize ( buf, bsize );
-        if ( rc == 0 )
-        {
-            /* try again with the newly sized buffer */
-            rc = string_vprintf ( &buffer [ content ], bsize - content, & num_writ, fmt, args_copy );
-        }
-    }
-    va_end ( args_copy );
-    
-    /* size down to bsize + NULL */
-    if ( rc == 0 )
-        KDataBufferResize ( buf, content + num_writ + 1 );
-
-    return rc;
-}
-
-/* forward to KDataBufferVPrintf */
-static
-rc_t KDataBufferPrintf ( KDataBuffer * buf, const char * url, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, url );
-    rc = KDataBufferVPrintf ( buf, url, args );
-    va_end ( args );
-
-    return rc;
-}
-#endif
-/*--------------------------------------------------------------------------
- * URLBlock
- *  RFC 3986
- */
-
-/* Init
- *  Initialize to default values in case portions are missing
- */
-void URLBlockInit ( URLBlock *self )
-{
-    CONST_STRING ( & self -> scheme, "http" );
-    CONST_STRING ( & self -> host, "" );
-    CONST_STRING ( & self -> path, "/" );
-    CONST_STRING ( & self -> query, "" );
-    CONST_STRING ( & self -> fragment, "" );
-    self -> port = 0; /* 0 = DEFAULT 80 for http */
-}
-
-/* ParseUrl
- *  accept standard, full http URL:
- *    <scheme>://<host>[:<port>]/<path>[?<query>][#<fragment>]
- *
- *  scheme can be missing, i.e.:
- *    //<host>[:<port>]/<path>[?<query>][#<fragment>]
- *
- *  we can also accept missing path[query][fragment], i.e.:
- *    <scheme>://<host>[:<port>]
- *    //<host>[:<port>]
- *
- *  finally, we can accept path without host, i.e.:
- *    /<path>[?<query>][#<fragment>]
- *
- *  patterns to reject:
- *    <scheme>:/<path>...    # scheme followed by anything other than '//'
- *    <path>...              # no leading '/'
- */
-rc_t ParseUrl ( URLBlock * b, const char * url, size_t url_size ) 
-{
-    rc_t rc;
-    char * sep;
-    const char * buf = url;
-    const char * end = buf + url_size;
-
-    bool have_host, have_scheme;
-
-    URLBlockInit ( b );
-
-    /* scheme default to false because url may be a path */
-    have_scheme = false;
-
-    /* check if url is empty
-       scheme cannot start with a forward slash - detecting an absolute path */
-    if ( buf < end && buf [ 0 ] != '/' )
-    {
-        /* here we identify the scheme by finding the ':' */
-        sep = string_chr ( url, end - buf, ':' );
-        if ( sep != NULL )
-        {
-            String http;
-            CONST_STRING ( & http, "http" );
-
-            /* assign scheme to the url_block */
-            StringInit ( & b -> scheme, buf, sep - buf, ( uint32_t ) ( sep - buf ) );
-
-            /* check to make sure it is 'http' */
-            if ( ! StringCaseEqual ( & b -> scheme, & http ) )
-            {
-                rc = RC ( rcNS, rcUrl, rcEvaluating, rcName, rcIncorrect );
-                PLOGERR ( klogErr ,( klogErr, rc, "Scheme is '$(scheme)'", "scheme=%S", & b -> scheme ) );
-                return rc;
-            }
-
-            /* accept scheme - skip past */
-            buf = sep + 1;
-            have_scheme = true;
-        }
-    }
-    
-    /* discard fragment - not sending to server, but still record it */
-    sep = string_rchr ( buf, end - buf,  '#' );
-    if ( sep != NULL )
-    {
-        /* advance to first character in fragment */
-        const char *frag = sep + 1;
-
-        /* assign fragment to the url_block */
-        StringInit ( & b -> fragment, frag, end - frag, ( uint32_t ) ( end - frag ) );
-
-        /* remove fragment from URL */
-        end = sep;
-    }
-                         
-    /* detect host */
-    have_host = false;
-    
-    /* check for '//' in the first two elements 
-       will fail if no scheme was detected */
-    if ( string_match ( "//", 2, buf, end - buf, 2, NULL ) == 2 )
-    {
-        /* skip ahead to host spec */
-        buf += 2;
-
-        /* if we ran into the end of the string, we dont have a host */
-        if ( buf == end )
-        {
-            rc = RC ( rcNS, rcUrl, rcParsing, rcOffset, rcIncorrect );
-            PLOGERR ( klogErr ,( klogErr, rc, "expected hostspec in url '$(url)'", "url=%.*s", ( uint32_t ) url_size, url ) );
-            return rc;
-        }
-
-        have_host = true;
-    }
-
-    /* if there is a scheme but no host, error */
-    if ( have_scheme && ! have_host )
-    {
-        rc = RC ( rcNS, rcUrl, rcParsing, rcName, rcNotFound );
-        PLOGERR ( klogErr ,( klogErr, rc, "Host is '$(host)'", "host=%s", "NULL" ) );
-        return rc;
-    }
-        
-    /* find dividing line between host and path, which MUST start with '/' */
-    sep = string_chr ( buf, end - buf, '/' );
-
-    /* detect no path */
-    if ( sep == NULL )
-    {
-        /* no path and no host */
-        if ( ! have_host )
-        {
-            rc = RC ( rcNS, rcUrl, rcParsing, rcName, rcNotFound );
-            PLOGERR ( klogErr ,( klogErr, rc, "Path is '$(path)'", "path=%s", "/" ) );
-            return rc;
-        }
-        /* no path but have host 
-           default value for path is already '/' */
-        sep = ( char* ) end;
-    }
-
-    /* capture host ( could be empty - just given a file system path ) */
-    if ( have_host )
-    {
-        /* assign host to url_block */
-        StringInit ( & b -> host, buf, sep - buf, ( uint32_t ) ( sep - buf ) );
-
-        /* advance to path */
-        buf = sep;
-    }
-
-    /* detect relative path 
-       <hostname>/<path> - OK, handled above
-       /<path> - OK
-    */
-    if ( buf != sep )
-    {
-        rc = RC ( rcNS, rcPath, rcParsing, rcOffset, rcIncorrect );
-        PLOGERR ( klogErr ,( klogErr, rc, "Path is '$(path)'", "path=%s", "NULL" ) );
-        return rc;
-    }
-
-    /* if we dont have a host we must have a path
-       if we DO have a host and the path is not empty */
-    if ( ! have_host || buf != end )
-    {
-        /* check for query */
-        sep = string_chr ( buf, end - buf,  '?' );
-        if ( sep != NULL )
-        {
-            const char *query = sep + 1;
-            /* assign query to url_block */
-            StringInit ( & b -> query, query, end - query, ( uint32_t ) ( end - query ) ); 
-
-            /* advance end to sep */
-            end = sep;
-        }
-
-        /* assign path ( could also be empty ) */
-        StringInit ( & b -> path, buf, end - buf, ( uint32_t ) ( end - buf ) );
-    }
-
-    /* if we have a host, split on ':' to check for a port
-       OK if not found */
-    if ( have_host )
-    {
-        buf = b -> host . addr;
-        end = buf + b -> host . size;
-
-        /* check for port */
-        sep = string_chr ( buf, end - buf,  ':' );
-        if ( sep != NULL )
-        {
-            char *term;
-            const char * port = sep + 1;
-            /* assign port to url block converting to 32 bit int 
-             term should point to end */
-            b -> port = strtou32 ( port, & term, 10 );
-
-            /* error if 0 or term isnt at the end of the buffer */
-            if ( b -> port == 0 || ( const char* ) term != end )
-            {
-                rc = RC ( rcNS, rcUrl, rcParsing, rcNoObj, rcIncorrect );
-                PLOGERR ( klogErr ,( klogErr, rc, "Port is '$(port)'", "port=%d", b -> port ) );
-                return rc;
-            }
-
-            /* assign host to url_block */
-            StringInit ( & b -> host, buf, sep - buf, ( uint32_t ) ( sep - buf ) );
-        }
-    }
-    
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * KHttpHeader
- *  node structure to place http header lines into a BSTree
- */
-
-void CC KHttpHeaderWhack ( BSTNode *n, void *ignore )
-{
-    KHttpHeader * self = ( KHttpHeader* ) n;
-    KDataBufferWhack ( & self -> value_storage );
-    free ( self );
-}
-
-static
-int CC KHttpHeaderSort ( const BSTNode *na, const BSTNode *nb )
-{
-    const KHttpHeader *a = ( const KHttpHeader* ) na;
-    const KHttpHeader *b = ( const KHttpHeader* ) nb;
-
-    return StringCaseCompare ( & a -> name, & b -> name );
-}
-
-static
-int CC KHttpHeaderCmp ( const void *item, const BSTNode *n )
-{
-    const String *a = item;
-    const KHttpHeader *b = ( const KHttpHeader * ) n;
-
-    return StringCaseCompare ( a, & b -> name );
-}
-
-/*--------------------------------------------------------------------------
- * KHttp
- *  hyper text transfer protocol 
- *  structure that will act as the 'client' for networking tasks
- */
-struct KHttp
-{
-    const KNSManager *mgr;
-    KStream * sock;
-
-    /* buffer for accumulating response data from "sock" */
-    KDataBuffer block_buffer;
-    size_t block_valid;         /* number of valid response bytes in buffer */
-    size_t block_read;          /* number of bytes read out by line reader or stream */
-
-    KDataBuffer line_buffer; /* data accumulates for reading headers and chunk size */
-    size_t line_valid;
-
-    KDataBuffer hostname_buffer;
-    String hostname; 
-    uint32_t port;
-
-    ver_t vers;
-
-    KRefcount refcount;
-};
-
-
-#define KHttpBlockBufferIsEmpty( self ) \
-    ( ( self ) -> block_read == ( self ) -> block_valid )
-
-#define KHttpBlockBufferReset( self ) \
-    ( ( void ) ( ( self ) -> block_valid = ( self ) -> block_read = 0 ) )
-
-#define KHttpLineBufferReset( self ) \
-    ( ( void ) ( ( self ) -> line_valid = 0 ) )
-
-
-/* used to be in whack function, but we needed the ability
-   to clear out the http object for redirection */
-static
-rc_t KHttpClear ( KHttp *self )
-{
-    KStreamRelease ( self -> sock );
-    self -> sock = NULL;
-
-    KHttpBlockBufferReset ( self );
-    KHttpLineBufferReset ( self );
-
-    KDataBufferWhack ( & self -> hostname_buffer );
-
-    return 0;
-}
-
-static
-rc_t KHttpWhack ( KHttp * self )
-{
-    KHttpClear ( self );
-    
-    KDataBufferWhack ( & self -> block_buffer );
-    KDataBufferWhack ( & self -> line_buffer );
-    KNSManagerRelease ( self -> mgr );
-    KRefcountWhack ( & self -> refcount, "KHttp" );
-    free ( self );
-
-    return 0;
-}
-
-/* Initialize KHttp object */
-static
-rc_t KHttpInit ( KHttp * http, const KDataBuffer *hostname_buffer, KStream * conn, ver_t _vers, const String * _host, uint32_t port )
-{
-    rc_t rc;
-
-    if ( port == 0 )
-        port = 80;
-
-    /* we accept a NULL connection ( from ) */
-    if ( conn != NULL )
-        rc = KStreamAddRef ( conn );
-    else
-    {
-        /* KEndPoint holds an address and port number */
-        KEndPoint to;
-        
-        /* make a KEndPoint using a host name */
-        rc = KNSManagerInitDNSEndpoint ( http -> mgr, &to, _host, port );
-        if ( rc == 0 )
-            /* create the connection using the system default for from */
-            rc = KNSMakeConnection ( &conn, NULL, &to );
-    }
-
-    if ( rc == 0 )
-    {
-        http -> sock = conn;
-        http -> port = port;
-        http -> vers = _vers & 0xFFFF0000; /* safety measure - limit to major.minor */
-
-
-        /* YOU NEED AN assert HERE TO ENSURE _host IS WITHIN hostname_buffer */
-        assert ( KDataBufferContainsString ( hostname_buffer, _host ) );
-
-        /* initialize hostname buffer from external buffer */
-        rc = KDataBufferSub ( hostname_buffer, &http -> hostname_buffer,
-                              ( _host -> addr - ( const char* ) hostname_buffer -> base ),
-                              _host -> size );
-        if ( rc == 0 )
-            /* Its safe to assign pointer because we know
-               that the pointer is within the buffer */
-            http -> hostname = * _host;
-    }
-    
-    return rc;
-} 
-
-
-/* MakeHttp
- *  create an HTTP protocol
- *
- *  "http" [ OUT ] - return parameter for HTTP object
- *
- *  "conn" [ IN ] - previously opened stream for communications.
- *
- *  "vers" [ IN ] - http version
- *   the only legal types are 1.0 ( 0x01000000 ) and 1.1 ( 0x01010000 )
- *
- *  "host" [ IN ] - parameter to give the host dns name for the connection
- *
- *  "port" [ IN, DEFAULT ZERO ] - if zero, defaults to standard for scheme
- *   if non-zero, is taken as explicit port specification
- */
-static
-rc_t KNSManagerMakeHttpInt ( const KNSManager *self, KHttp **_http,
-    const KDataBuffer *hostname_buffer,  KStream *conn, ver_t vers, const String *host, uint32_t port )
-{
-    rc_t rc;
-
-    KHttp * http = calloc ( 1, sizeof * http );
-    if ( http == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcNull );
-    else
-    {
-        rc = KNSManagerAddRef ( self );
-        if ( rc == 0 )
-        {
-            char save, *text;
-
-            http -> mgr = self;
-
-
-            /* Dont use MakeBytes because we dont need to allocate memory
-               and we only need to know that the elem size is 8 bits */
-            KDataBufferClear ( & http -> block_buffer );
-            KDataBufferClear ( & http -> line_buffer );
-
-            /* make sure address of bost is within hostname_buffer */
-            assert ( KDataBufferContainsString ( hostname_buffer, host ) );
-
-            /* SET TEXT TO POINT TO THE HOST NAME AND NUL TERMINATE IT FOR DEBUGGING
-             Its safe to modify the const char array because we allocated the buffer*/ 
-            text = ( char* ) ( host -> addr );
-            save = text [ host -> size ];
-            text [ host -> size ] = 0;
-        
-            /* initialize reference counter on object to 1 - text is now nul-terminated */
-            KRefcountInit ( & http -> refcount, 1, "KHttp", "make", text );
-
-            text [ host -> size ] = save;
-
-            /* init the KHttp object */
-            rc = KHttpInit ( http, hostname_buffer, conn, vers, host, port );
-            if ( rc == 0 )
-            {
-                /* assign to OUT http param */
-                * _http = http;
-                return 0;
-            }
-
-            KNSManagerRelease ( self );
-        }
-                
-        free ( http );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KNSManagerMakeHttp ( const KNSManager *self,
-    KHttp **_http, KStream *conn, ver_t vers, const String *host, uint32_t port )
-{
-    rc_t rc;
-    
-    /* check return parameters */
-    if ( _http == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        /* check input parameters */
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        /* make sure we have one of the two versions supported - 1.0, 1.1 */
-        else if ( vers < 0x01000000 || vers > 0x01010000 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcIncorrect );
-        else if ( host == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        /* make sure there is data in the host name */
-        else if ( host -> size == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-        else
-        {
-            KDataBuffer hostname_buffer;
-
-            /* create storage buffer for hostname */
-            rc = KDataBufferMakeBytes ( & hostname_buffer, host -> size + 1 );
-            if ( rc == 0 )
-            {
-                String _host;
-
-                /* copy hostname with nul termination */
-                string_copy ( hostname_buffer . base, ( size_t ) hostname_buffer . elem_count,
-                              host -> addr, host -> size );
-
-                /* create copy of host that points into new buffer */
-                StringInit ( &_host, hostname_buffer . base, host -> size, host -> len );
-
-                /* initialize http object - will create a new reference to hostname buffer */
-                rc = KNSManagerMakeHttpInt ( self, _http, & hostname_buffer, conn, vers, &_host, port );
-
-                /* release our reference to buffer */
-                KDataBufferWhack ( & hostname_buffer );
-
-                if ( rc == 0 )
-                    return 0;
-            }
-        }
-
-        * _http = NULL;
-    }
-    
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KHttpAddRef ( const KHttp *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KHttp" ) )
-        {
-        case krefLimit:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcRange, rcExcessive );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcSelf, rcInvalid );
-        default:
-            break;
-        }
-    }
-    
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KHttpRelease ( const KHttp *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KHttp" ) )
-        {
-        case krefWhack:
-            return KHttpWhack ( ( KHttp* ) self );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcReleasing, rcRange, rcExcessive );
-        default:
-            break;
-        }
-    }
-    
-    return 0;
-}
-
-/* Communication Methods
- *  Read in the http response and return 1 char at a time
- */
-static
-rc_t KHttpGetCharFromResponse ( KHttp *self, char *ch )
-{
-    rc_t rc;
-    char * buffer = self -> block_buffer . base;
-
-    /* check for data in buffer */
-    if ( KHttpBlockBufferIsEmpty ( self ) )
-    {
-        /* check to see ho many bytes are in the buffer */
-        size_t bsize = KDataBufferBytes ( & self -> block_buffer );
-
-        /* First time around, bsize will be 0 */
-        if ( bsize == 0 )
-        {
-            bsize = 64 * 1024;
-            rc = KDataBufferResize ( & self -> block_buffer, bsize );
-            if ( rc != 0 )
-                return rc;
-
-            /* re-assign new base pointer */
-            buffer = self -> block_buffer . base;
-        }
-
-        /* zero out offsets */
-        KHttpBlockBufferReset ( self );
-
-        /* read from the stream into the buffer, and record the bytes read
-           into block_valid */
-        /* NB - do NOT use KStreamReadAll or it will block with http 1.1 
-           because http/1.1 uses keep alive and the read will block until the server 
-           drops the connection */
-        rc = KStreamRead ( self -> sock, buffer, bsize, & self -> block_valid );
-        if ( rc != 0 )
-            return rc;
-
-        /* if nothing was read, we have reached the end of the stream */
-        if ( self -> block_valid == 0 )
-        {
-            /* return nul char */
-            * ch = 0;
-            return 0;
-        }
-    }
-
-    /* return the next char in the buffer */
-    * ch = buffer [ self -> block_read ++ ];
-    return 0;
-}
-
-/* Read and return entire lines ( until \r\n ) */
-static
-rc_t KHttpGetLine ( KHttp *self )
-{
-    rc_t rc;
-
-    char * buffer = self -> line_buffer . base;
-    size_t bsize = KDataBufferBytes ( & self -> line_buffer );
-
-    /* num_valid bytes read starts at 0 */
-    self -> line_valid = 0;
-    while ( 1 )
-    {
-        char ch;
-
-        /* get char */
-        rc = KHttpGetCharFromResponse ( self, &ch );
-        if ( rc != 0 )
-            break;
-
-        if ( ch == '\n' )
-        {
-            /* check that there are valid bytes read and the previous char is '\r' */
-            if ( self -> line_valid > 0 && buffer [ self -> line_valid - 1 ] == '\r' )
-            {
-                /* decrement number of valid bytes to remove '\r' */
-                -- self -> line_valid;
-            }
-            /* record end of line */
-            ch = 0;
-        }
-
-        /* check if the buffer is full */
-        if ( self -> line_valid == bsize )
-        {
-            /* I assume that the header lines will not be too large
-               so only need to increment  by small chunks */
-            bsize += 256;
-
-            /* TBD - place an upper limit on resize */
-
-            /* resize */
-            rc = KDataBufferResize ( & self -> line_buffer, bsize );
-            if ( rc != 0 )
-                return rc;
-
-            /* assign new base pointer */
-            buffer = self -> line_buffer . base;
-        }
-
-        /* buffer is not full, insert char into the buffer */
-        buffer [ self -> line_valid ] = ch;
-        
-        /* get out of loop if end of line */
-        if ( ch == 0 )
-            break;
-
-        /* not end of line - increase num of valid bytes read */
-        ++ self -> line_valid;
-    }
-
-    return rc;
-}
-
-/* AddHeaderString
- *  performs task of entering a header into BSTree
- *  or updating an existing node
- *
- *  Headers are always made up of a name: value pair
- */
-static
-rc_t KHttpAddHeaderString ( BSTree *hdrs, const String *name, const String *value )
-{
-    rc_t rc = 0;
-
-    /* if there is no name - error */
-    if ( name -> size == 0 )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-    else
-    {
-        /* test for previous existence of node by name */
-        KHttpHeader * node = ( KHttpHeader * ) BSTreeFind ( hdrs, name, KHttpHeaderCmp );
-        if ( node == NULL )
-        {
-            /* node doesnt exist - allocate memory for a new one */
-            node = calloc ( 1, sizeof * node );
-            if ( node == NULL )
-                rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcNull );
-            else
-            {
-                /* size of the KDataBuffer to store string data */
-                size_t bsize = name -> size + value ->  size + 1;
-                rc = KDataBufferMakeBytes ( & node -> value_storage, bsize );
-                if ( rc == 0 )
-                {
-                    /* copy the string data into storage */
-                    rc = string_printf ( node -> value_storage . base, bsize, NULL,
-                                         "%S%S"
-                                         , name
-                                         , value );
-                    if ( rc == 0 )
-                    {
-                        /* initialize the Strings to point into KHttpHeader node */
-                        StringInit ( & node -> name, node -> value_storage . base, name -> size, name -> len );
-                        StringInit ( & node -> value, node -> name . addr + name -> size, value -> size, value -> len );
-                        
-                        /* insert into tree, sorted by alphabetical order */
-                        BSTreeInsert ( hdrs, & node -> dad, KHttpHeaderSort );
-                        
-                        return 0;
-                    }
-                    
-                    KDataBufferWhack ( & node -> value_storage );
-                }
-                
-                free ( node );
-            }
-        }
-        
-        /* node exists
-           check that value param has data */
-        else if ( value -> size != 0 )
-        {
-            /* find the current size of the data in the node */
-            size_t cursize = node -> name . size + node -> value . size;
-            /* resize databuffer to hold the additional value data + comma + nul */
-            rc = KDataBufferResize ( & node -> value_storage, cursize + value -> size + 1 + 1 );
-            if ( rc == 0 )
-            {
-                char *buffer = node -> value_storage . base;
-
-                /* copy string data into buffer */
-                rc = string_printf ( & buffer [ cursize ], value -> size + 2, NULL,
-                                     ",%S"
-                                     , value ); 
-                if ( rc == 0 )
-                {
-                    /* update size and len of value in the node */
-                    node -> value . size += value -> size + 1;
-                    node -> value . len += value -> len + 1;
-                    return 0;
-                }
-                
-                /* In case of almost impossible error
-                   restore values to what they were */
-                KDataBufferResize ( & node -> value_storage, cursize + 1 );
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t KHttpVAddHeader ( BSTree *hdrs, const char *_name, const char *_val, va_list args )
-{
-    rc_t rc;
-
-    size_t bsize;
-    String name, value;
-    char buf [ 4096 ];
-
-    /* initialize name string from param */
-    StringInitCString ( & name, _name );
-
-    /* copy data into buf, using va_list for value format */
-    rc = string_vprintf ( buf, sizeof buf, &bsize, _val, args );
-    if ( rc == 0 )
-    {
-        /* get length of buf */
-        size_t blen = string_len ( buf, bsize );
-
-        /* init value */
-        StringInit ( & value, buf, bsize, blen );
-
-        rc = KHttpAddHeaderString ( hdrs, & name, & value );
-    }
-
-    return rc;
-}
-
-static
-rc_t KHttpAddHeader ( BSTree *hdrs, const char *name, const char *val, ... )
-{
-    rc_t rc;
-    va_list args;
-    va_start ( args, val );
-    rc = KHttpVAddHeader ( hdrs, name, val, args );
-    va_end ( args );
-    return rc;
-}
-
-/* Capture each header line to add to BSTree */
-rc_t KHttpGetHeaderLine ( KHttp *self, BSTree *hdrs, bool *blank )
-{
-    /* Starting from the second line of the response */
-    rc_t rc = KHttpGetLine ( self );
-    if ( rc == 0 )
-    {
-        /* blank = empty line_buffer = separation between headers and body of response */
-        if ( self -> line_valid == 0 )
-            * blank = true;
-        else
-        {
-            char * sep;
-            char * buffer = self -> line_buffer . base;
-            char * end = buffer + self -> line_valid;
-
-            /* find the separation between name: value */
-            sep = string_chr ( buffer, end - buffer, ':' );
-            if ( sep == NULL )
-                rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-            else
-            {
-                String name, value;
-                const char * last = sep;
-                
-                /* trim white space around name */
-                while ( buffer < last && isspace ( buffer [ 0 ] ) )
-                    ++ buffer;
-                while ( buffer < last && isspace ( last [ -1 ] ) )
-                    -- last;
-
-                /* assign the name data into the name string */
-                StringInit ( & name, buffer, last - buffer, ( uint32_t ) ( last - buffer ) );
-                
-                /* move the buffer forward to value */
-                buffer = sep + 1;
-                last = end;
-                
-                /* trim white space around value */
-                while ( buffer < last && isspace ( buffer [ 0 ] ) )
-                    ++ buffer;
-                while ( buffer < last && isspace ( last [ -1 ] ) )
-                    -- last;
-
-                /* assign the value data into the value string */
-                StringInit ( & value, buffer, last - buffer, ( uint32_t ) ( last - buffer ) );
-                
-                rc = KHttpAddHeaderString ( hdrs, & name, & value );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Locate a KhttpHeader obj in BSTree */
-static
-rc_t KHttpFindHeader ( const BSTree *hdrs, const char *_name, char *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-    String name;
-    KHttpHeader * node;
-
-    StringInitCString ( &name, _name );
-
-    /* find the header */
-    node = ( KHttpHeader * ) BSTreeFind ( hdrs, &name, KHttpHeaderCmp );
-    if ( node == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcSearching, rcName, rcNull );
-    else
-    {
-        /* make sure buffer is large enough */
-        if ( bsize < node -> value . size )
-        {
-            /* return the amount needed */
-            * num_read = node -> value . size;
-            
-            return RC ( rcNS, rcNoTarg, rcParsing, rcParam, rcInsufficient );
-        }
-        
-        /* copy data and return the num_read */
-        * num_read = string_copy ( buffer, bsize, node -> value . addr, node -> value . size );
-    }
-    return rc;
-}
-
-rc_t KHttpGetStatusLine ( KHttp *self, String *msg, uint32_t *status, ver_t *version )
-{
-    /* First time reading the response */
-    rc_t rc = KHttpGetLine ( self );
-    if ( rc == 0 )
-    {
-        char * sep;
-        char * buffer = self -> line_buffer . base;
-        char * end = buffer + self -> line_valid;
-
-        /* Detect protocol
-           expect HTTP/1.[01]<sp><digit>+<sp><msg>\r\n */
-        sep = string_chr ( buffer, end - buffer, '/' );
-        if ( sep == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-        else
-        {
-            /* make sure it is http */
-            if ( strcase_cmp ( "http", 4, buffer, sep - buffer, 4 ) != 0 )
-                rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcUnsupported );
-            else
-            {
-                /* move buffer up to version */
-                buffer = sep + 1;
-
-                /* find end of version */
-                sep = string_chr ( buffer, end - buffer, ' ' );
-                if ( sep == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-                else
-                {
-                    /* must be 1.0 or 1.1 */
-                    if ( ( string_cmp ( "1.0", 3, buffer, sep - buffer, 3 ) != 0 ) &&
-                         ( string_cmp ( "1.1", 3, buffer, sep - buffer, 3 ) != 0 ) )
-                        rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcUnsupported );
-                    else
-                    {
-                        /* which one? */
-                        * version = string_cmp ( "1.0", 3, buffer, sep - buffer, -1 ) == 0 ? 0x01000000 : 0x01010000;
-                        
-                        /* move up to status code */
-                        buffer = sep + 1;
-
-                        /* record status as uint32 
-                         sep should point to 1 byte after end of status text */
-                        * status = strtou32 ( buffer, & sep, 10 );
-
-                        /* if at the end of buffer or sep didnt land on a space - error */
-                        if ( sep == buffer || * sep != ' ' )
-                            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-                        else
-                        {
-                            /* move up to status msg */
-                            buffer = sep + 1;
-
-                            /* initialize the msg String with the proper size and length */
-                            StringInit ( msg, buffer, end - buffer, ( uint32_t ) ( end - buffer ) );
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * HttpStream
- *  structure that represents the body of the response
- */
-struct KHttpStream
-{
-    KStream dad;
-    
-    /* content_length is the size of the chunk
-       total_read is the number of read from the chunk */
-    uint64_t content_length;
-    uint64_t total_read;
-
-    KHttp * http;
-
-    uint8_t state; /* keeps track of state for chunked reader */
-    bool size_unknown; /* for HTTP/1.0 dynamic */
-};
-
-enum 
-{
-    end_chunk,
-    new_chunk,
-    within_chunk,
-    end_stream,
-    error_state
-};
-
-static
-rc_t CC KHttpStreamWhack ( KHttpStream *self )
-{
-    KHttpRelease ( self -> http );
-    free ( self );
-    return 0;
-}
-
-/* Read from stream - not chunked or within a chunk */
-static
-rc_t CC KHttpStreamRead ( const KHttpStream *cself,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    KHttpStream *self = ( KHttpStream * ) cself;
-    KHttp *http = self -> http;
-
-    /* minimum of bytes requested and bytes available in stream */
-    uint64_t num_to_read = self -> content_length - self -> total_read;
-
-    /* take the minimum of bytes avail or bytes requested */
-    if ( self -> size_unknown || bsize < num_to_read )
-        num_to_read = bsize;
-
-    /* Should be 0 because nothing has been read. Caller
-       sets its to 0 */
-    assert ( * num_read == 0 );
-    /* exit if there is nothing to read */
-    if ( num_to_read == 0 )
-        return 0;
-
-    /* read directly from stream 
-       check if the buffer is empty */
-    if ( KHttpBlockBufferIsEmpty ( http ) )
-    {
-        /* ReadAll blocks for 1.1. Server will drop the connection */
-        rc =  KStreamRead ( http -> sock, buffer, num_to_read, num_read );
-        if ( rc != 0 )
-        {
-            /* TBD - handle dropped connection - may want to reestablish */
-
-            /* LOOK FOR DROPPED CONNECTION && SIZE UNKNOWN - HTTP/1.0 DYNAMIC CASE */
-            if ( self -> size_unknown )
-                rc = 0;
-        }
-
-        /* if nothing was read - incomplete transfer */
-        else if ( ! self -> size_unknown && * num_read == 0 )
-        {
-            rc = RC ( rcNS, rcNoTarg, rcTransfer, rcNoObj, rcIncomplete);
-        }
-
-    }
-    else
-    {
-        char *buf;
-
-        /* bytes available in buffer */
-        uint64_t bytes_in_buffer = http -> block_valid - http -> block_read;
-
-        /* take the minimum of bytes avail or bytes requested */
-        if ( num_to_read > bytes_in_buffer )
-            num_to_read = bytes_in_buffer;
-
-        /* capture base pointer */
-        buf = http -> block_buffer . base;
-
-        /* copy data into the user buffer from the offset of bytes not yet read */
-        memcpy ( buffer, & buf [ http -> block_read ], num_to_read );
-
-        /* update the amount read */
-        http -> block_read += num_to_read;
-
-        /* return how much was read */
-        * num_read = num_to_read;
-
-        rc = 0;
-    }
-
-    /* update the total from the stream
-       keep track of total bytes read within the chunk */
-    self -> total_read += * num_read;
-
-    return rc;
-}
-
-/* Uses a state machine*/
-static
-rc_t CC KHttpStreamReadChunked ( const KHttpStream *cself,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    char * sep;
-    KHttpStream *self = ( KHttpStream * ) cself;
-    KHttp * http = self -> http;
-
-    assert ( * num_read == 0 );
-
-    switch ( self -> state )
-    {
-    case end_chunk:
-        rc = KHttpGetLine ( http );
-        /* this should be the CRLF following chunk */
-        if ( rc != 0 || http -> line_valid != 0 )
-        {
-            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcIncorrect);
-            self -> state = error_state;
-            break;
-        }
-
-        self -> state = new_chunk;
-
-        /* NO BREAK */
-
-        /* start */
-    case new_chunk:
-
-        /* Get chunk size */
-        rc = KHttpGetLine ( http );
-        if ( rc != 0 )
-        {
-            self -> state = error_state;
-            break;
-        }
-
-        /* convert the hex number containing chunk size to uint64 
-           sep should be pointing at nul byte */
-        self -> content_length = strtou64 ( http -> line_buffer . base, & sep, 16 );
-
-        /* TBD - eat spaces here? */
-        /* check if there was no hex number, or sep isn't pointing to nul byte */
-        if ( sep == http -> line_buffer . base || ( * sep != 0 && * sep != ';' ) )
-        {
-            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcIncorrect);
-            self -> state = error_state;
-            break;
-        }
-
-        /* check for end of stream */
-        if ( self -> content_length == 0 )
-        {
-            self -> state = end_stream;
-            return 0;
-        }
-
-        /* havent read anything - start at 0 */
-        self -> total_read = 0;
-
-        /* now within a chunk */
-        self -> state = within_chunk;
-
-        /* NO BREAK */
-
-    case within_chunk: 
-        /* start reading */
-        rc = KHttpStreamRead ( self, buffer, bsize, num_read );
-        if ( rc != 0 ) /* TBD - handle connection errors */
-            self -> state = error_state;
-        /* incomplete if nothing to read */
-        else if ( * num_read == 0 )
-        {
-            rc = RC ( rcNS, rcNoTarg, rcTransfer, rcNoObj, rcIncomplete);
-            self -> state = error_state;
-        }
-        /* check for end of chunk */
-        else if ( self -> total_read == self -> content_length )
-            self -> state = end_chunk;
-        break;
-
-    case end_stream:
-        return 0;
-
-    case error_state:
-        rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcIncorrect );
-        break;
-
-    default:
-        /* internal error */
-        rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcError );
-    }
-
-    return rc;
-}
-
-/* cannot write - for now */
-static
-rc_t CC KHttpStreamWrite ( KHttpStream *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcNS, rcNoTarg, rcWriting, rcNoObj, rcError );
-}
-
-static KStream_vt_v1 vtKHttpStream = 
-{
-    1, 0,
-    KHttpStreamWhack,
-    KHttpStreamRead,
-    KHttpStreamWrite
-};
-
-static KStream_vt_v1 vtKHttpStreamChunked =
-{
-    1, 0,
-    KHttpStreamWhack,
-    KHttpStreamReadChunked,
-    KHttpStreamWrite
-};
-
-/* Make a KHttpStream object */
-static
-rc_t KHttpStreamMake ( KHttp *self, KStream **sp, const char *strname, size_t content_length, bool size_unknown )
-{
-    rc_t rc;
-    KHttpStream *s = calloc ( 1, sizeof * s );
-    if ( s == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KStreamInit ( & s -> dad, ( const KStream_vt * ) & vtKHttpStream, 
-                           "KHttpStream", strname, true, false );
-        if ( rc == 0 )
-        {                                       
-            rc = KHttpAddRef ( self );
-            if ( rc == 0 )
-            {
-                s -> http = self;
-                s -> content_length = content_length;
-                s -> size_unknown = size_unknown;
-                *sp = & s -> dad;
-                return 0;
-            }
-        }
-        free ( s );
-    }
-    *sp = NULL;
-
-    return rc;
-}
-
-static
-rc_t KHttpStreamMakeChunked ( KHttp *self, KStream **sp, const char *strname )
-{
-    rc_t rc;
-    KHttpStream *s = calloc ( 1, sizeof * s );
-    if ( s == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = KStreamInit ( & s -> dad, ( const KStream_vt * ) & vtKHttpStreamChunked, 
-                           "KHttpStreamChunked", strname, true, false );
-        if ( rc == 0 )
-        {
-            rc = KHttpAddRef ( self );
-            if ( rc == 0 )
-            {
-                s -> http = self;
-
-                /* state should be new_chunk */
-                s -> state = new_chunk;
-
-                *sp = & s -> dad;
-                return 0;
-            }
-        }
-        free ( s );
-    }
-    *sp = NULL;
-
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * KHttpResult
- *  hyper text transfer protocol
- *  Holds all the headers in a BSTree
- *  Records the status msg, status code and version of the response 
- */
-struct KHttpResult
-{
-    KHttp *http;
-    
-    BSTree hdrs;
-    
-    String msg;
-    uint32_t status;
-    ver_t version;
-
-    KRefcount refcount;
-};
-
-static
-rc_t KHttpResultWhack ( KHttpResult * self )
-{
-    BSTreeWhack ( & self -> hdrs, KHttpHeaderWhack, NULL );
-    KHttpRelease ( self -> http );
-    KRefcountWhack ( & self -> refcount, "KHttpResult" );
-    free ( self );
-    return 0;
-}
-
-
-/* Sends the request and receives the response into a KHttpResult obj */
-static 
-rc_t KHttpSendReceiveMsg ( KHttp *self, KHttpResult **rslt,
-    const char *buffer, size_t len, const KDataBuffer *body, const char *url )
-{
-    rc_t rc;
-
-    size_t sent;
-
-
-    /* TBD - may want to assert that there is an empty line in "buffer" */
-
-    /* ALWAYS want to use write all when sending */
-    rc = KStreamWriteAll ( self -> sock, buffer, len, & sent ); 
-    /* check the data was completely sent */
-    if ( rc == 0 && sent != len )
-        rc = RC ( rcNS, rcNoTarg, rcWriting, rcTransfer, rcIncomplete );
-    if ( rc == 0 && body != NULL )
-    {
-        /* "body" contains bytes plus trailing NUL */
-        size_t to_send = ( size_t ) body -> elem_count - 1;
-        rc = KStreamWriteAll ( self -> sock, body -> base, to_send, & sent );
-        if ( rc == 0 && sent != to_send )
-            rc = RC ( rcNS, rcNoTarg, rcWriting, rcTransfer, rcIncomplete );
-    }
-    if ( rc == 0 )
-    {
-        String msg;
-        ver_t version;
-        uint32_t status;
-
-        /* we have now received a response 
-           start reading the header lines */
-        rc = KHttpGetStatusLine ( self, & msg, & status, & version );
-        if ( rc == 0 )
-        {         
-            /* create a result object with enough space for msg string + nul */
-            KHttpResult *result = malloc ( sizeof * result + msg . size + 1 );
-            if ( result == NULL )
-                rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcExhausted );
-            else
-            {
-                /* zero out */
-                memset ( result, 0, sizeof * result );
-                
-                rc = KHttpAddRef ( self );
-                if ( rc == 0 )
-                {
-                    bool blank;
-
-                    /* treat excess allocation memory as text space */
-                    char *text = ( char* ) ( result + 1 );
-
-                    /* copy in the data to the text space */
-                    string_copy ( text, msg . size + 1, msg . addr, msg . size );
-
-                    /* initialize the result members
-                       "hdrs" is initialized via "memset" above
-                     */
-                    result -> http = self;
-                    result -> status = status;
-                    result -> version = version;
-
-                    /* correlate msg string in result to the text space */
-                    StringInit ( & result -> msg, text, msg . size, msg . len );
-
-                    /* TBD - pass in URL as instance identifier */
-                    KRefcountInit ( & result -> refcount, 1, "KHttpResult", "sending-msg", url );
-
-                    /* receive and parse all header lines 
-                       blank = end of headers */
-                    for ( blank = false; ! blank && rc == 0; )
-                        rc = KHttpGetHeaderLine ( self, & result -> hdrs, & blank );
-
-                    if ( rc == 0 )
-                    {
-                        /* assign to OUT result obj */
-                        * rslt = result;
-                        return 0; 
-                    }
-
-                    BSTreeWhack ( & result -> hdrs, KHttpHeaderWhack, NULL );
-                }
-
-                KHttpRelease ( self );
-            }
-
-            free ( result );
-        }
-    }
-    return rc;
-}
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KHttpResultAddRef ( const KHttpResult *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KHttpResult" ) )
-        {
-        case krefLimit:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcRange, rcExcessive );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcSelf, rcInvalid );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KHttpResultRelease ( const KHttpResult *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KHttpResult" ) )
-        {
-        case krefWhack:
-            return KHttpResultWhack ( ( KHttpResult* ) self );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcReleasing, rcRange, rcExcessive );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-
-/* Status
- *  access the response status code
- *  and optionally the message
- *
- *  "code" [ OUT ] - return parameter for status code
- *
- *  "msg_buff" [ IN, NULL OKAY ] and "buff_size" [ IN, ZERO OKAY ] -
- *   buffer for capturing returned message. if "msg_buff" is not
- *   NULL and "buff_size" is insufficient for copying status message,
- *   the message returns rcBuffer, rcInsufficient.
- *
- *  "msg_size" [ OUT, NULL OKAY ] - size of returned message in bytes.
- *   if not NULL, returns the size of status message. if "msg_buff" is
- *   NULL, returns rcBuffer, rcNull.
- */
-LIB_EXPORT rc_t CC KHttpResultStatus ( const KHttpResult *self, uint32_t *code,
-    char *msg_buff, size_t buff_size, size_t *msg_size )
-{
-    rc_t rc;
-
-    /* check OUT parameters */
-    if ( code == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        /* IN parameters */
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-        else
-        {
-            /* capture the status code to OUT param */
-            * code = self -> status;
-            rc = 0;
-
-            /* if asking about msg size */
-            if ( msg_size != NULL )
-            {
-                /* capture the msg size */
-                * msg_size = self -> msg . size;
-
-                /* catch NULL buffer pointer */
-                if ( msg_buff == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcBuffer, rcNull );
-            }
-
-            /* if they apparently want the message */
-            if ( msg_buff != NULL )
-            {
-                /* check for an insufficient buffer size */
-                if ( buff_size < self -> msg . size )
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcBuffer, rcInsufficient );
-                else
-                    /* copy out the message */
-                    string_copy ( msg_buff, buff_size, self -> msg . addr, self -> msg . size );
-            }
-
-            return rc;
-        }
-
-        * code = 0;
-    }
-
-    return rc;
-}
-
-
-/* KeepAlive
- *  retrieves keep-alive property of response
- */
-LIB_EXPORT bool CC KHttpResultKeepAlive ( const KHttpResult *self )
-{
-    rc_t rc;
-
-    if ( self != NULL )
-    {
-        /* we're requiring version 1.1 -
-           some 1.0 servers also supported it... */
-        if ( self -> version == 0x01010000 )
-        {
-            size_t num_writ;
-            char buffer [ 1024 ];
-            size_t bsize = sizeof buffer;
-
-            /* retreive the node that has the keep-alive property */
-            rc = KHttpResultGetHeader ( self, "Connection", buffer, bsize, & num_writ );
-            if ( rc == 0 )
-            {
-                String keep_alive, compare;
-
-                /* init strings */
-                StringInitCString ( & keep_alive, buffer );
-                CONST_STRING ( & compare, "keep-alive" );
-
-                /* compare strings for property value */
-                if ( StringCaseCompare ( & keep_alive, & compare ) == 0 )
-                    return true;
-            }
-        }
-    }
-    return false;
-}
-
-
-/* Range
- *  retrieves position and partial size for partial requests
- *
- *  "pos" [ OUT ] - offset to beginning portion of response
- *
- *  "bytes" [ OUT ] - size of range
- *
- *  HERE WE NEED TO HAVE PASSED THE RANGE REQUEST TO THE RESULT ON CREATION,
- *  AND WE WILL RESPOND TO THE HTTP "PARTIAL RESULT" OR WHATEVER RETURN CODE,
- *  AND BASICALLY UPDATE WHAT THE RANGE WAS.
- */
-static
-rc_t KHttpResultHandleContentRange ( const KHttpResult *self, uint64_t *pos, size_t *bytes )
-{
-    rc_t rc;
-    size_t num_read;
-    char buffer [ 1024 ];
-    const size_t bsize = sizeof buffer;
-
-    /* get Content-Range
-     *  expect: "bytes <first-position>-<last-position>/<total-size>"
-     */
-    rc = KHttpResultGetHeader ( self, "Content-Range", buffer, bsize, & num_read );
-    if ( rc == 0 )
-    {
-        char * sep;
-        char *buf = buffer;
-        const char *end = & buffer [ num_read ];
-
-        /* look for separation of 'bytes' and first position */
-        sep = string_chr ( buf, end - buf, ' ' );
-        if ( sep != NULL )
-            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-        else
-        {
-            uint64_t start_pos;
-                        
-            /* buf now points to value */
-            buf = sep + 1;
-
-            /* capture starting position 
-               sep should land on '-' */
-            start_pos = strtou64 ( buf, & sep, 10 );
-
-            /* check if we didnt read anything or sep didnt land on '-' */
-            if ( sep == buf || * sep != '-' )
-                rc =  RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-            else
-            {
-                uint64_t end_pos;
-
-                buf = sep + 1;
-                end_pos = strtou64 ( buf, & sep, 10 );
-                if ( sep == buf || * sep != '/' )
-                    rc =  RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );                 
-                else
-                {
-                    uint64_t total;
-
-                    buf = sep +1;
-                    total = strtou64 ( buf, &sep, 10 );
-                    if ( sep == buf || * sep != 0 )
-                        rc =  RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );                 
-                    else
-                    {
-                        /* check variables */
-                        if ( total == 0 ||
-                             start_pos > total ||
-                             end_pos < start_pos ||
-                             end_pos > total )
-                        {
-                            rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-                        }
-                        else
-                        {
-                            uint64_t length;
-                                        
-                            /* get content-length to confirm bytes sent */
-                            rc = KHttpResultGetHeader ( self, "Content-Length", buffer, bsize, & num_read );
-                            if ( rc != 0 )
-                            {
-                                            
-                                /* remember that we can have chunked encoding,
-                                   so "Content-Length" may not exist. */
-                                * pos = start_pos;
-                                * bytes = end_pos - start_pos; 
-                                            
-                                return 0;
-                            }
-
-                            buf = buffer;
-                            end = & buffer [ num_read ];
-                                            
-                            /* capture the length */
-                            length  = strtou64 ( buf, & sep, 10 );
-                            if ( sep == buf || * sep != 0 )
-                                rc =  RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-                            else 
-                            {
-                                /* finally check all the acquired information */
-                                if (  length != end_pos - start_pos ||
-                                      length > total )
-                                    rc = RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-                                else
-                                {
-                                    /* assign to OUT params */
-                                    * pos = start_pos;
-                                    * bytes = length; 
-                                                    
-                                    return 0;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KHttpResultRange ( const KHttpResult *self, uint64_t *pos, size_t *bytes )
-{
-    rc_t rc;
-
-    if ( pos ==  NULL || bytes == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-    else
-    {
-        switch ( self -> status )
-        {
-        case 206:
-            /* partial content */
-            rc = KHttpResultHandleContentRange ( self, pos, bytes );
-            if ( rc == 0 )
-                return 0;
-
-        case 416:
-            /* unsatisfiable range */
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcError, rcIncorrect );
-            break;
-
-        default:
-            /* codes not handling right now */
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcError, rcUnsupported );
-        }
-    }
-
-    if ( pos != NULL )
-        * pos = 0;
-    if ( bytes != NULL )
-        * bytes = 0;
-
-    return rc;
-}
-
-
-/* Size
- *  retrieves overall size of entity, if known
- *
- *  "size" [ OUT ] - size in bytes of response
- *   this is the number of bytes that may be expected from the input stream
- *
- */
-LIB_EXPORT bool CC KHttpResultSize ( const KHttpResult *self, uint64_t *size )
-{
-    if ( size != NULL && self != NULL )
-    {
-        rc_t rc;
-        size_t num_read;
-        char buffer [ 1024 ];
-        const size_t bsize = sizeof buffer;
-        
-        /* check for content-length */
-        rc = KHttpResultGetHeader ( self, "Content-Length", buffer, bsize, & num_read );
-        if ( rc == 0 )
-        {
-            char * sep;
-            
-            /* capture length as uint64 */
-            uint64_t length = strtou64 ( buffer, & sep, 10 );
-            if ( sep == buffer || * sep != 0 )
-                rc =  RC ( rcNS, rcNoTarg, rcParsing, rcNoObj, rcNotFound );
-            else
-            {
-                /* assign to OUT param */
-                * size = length;
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-/* AddHeader
- *  allow addition of an arbitrary HTTP header to RESPONSE
- *  this can be used to repair or normalize odd server behavior
- *
- */
-LIB_EXPORT rc_t CC KHttpResultAddHeader ( KHttpResult *self,
-    const char *name, const char *val, ... )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    /* have to test for empty name */
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-    else if ( val == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    /* same for empty value fmt string */
-    else if ( val [ 0 ] == 0 )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-    else
-    {
-        va_list args;
-        va_start ( args, val );
-        
-        rc = KHttpVAddHeader ( & self -> hdrs, name, val, args );
-        
-        va_end ( args );
-    }
-    return rc;
-}
-
-
-/* GetHeader
- *  retrieve named header if present
- *  this cand potentially return a comma separated value list
- */
-LIB_EXPORT rc_t CC KHttpResultGetHeader ( const KHttpResult *self, const char *name,
-    char *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-
-    if ( num_read == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        * num_read = 0;
-
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        else if ( buffer == NULL && bsize != 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        else
-        {
-            rc = KHttpFindHeader ( & self -> hdrs, name, buffer, bsize, num_read );
-        }
-    }
-
-    return rc;
-}
-
-#if _DEBUGGING
-static
-void PrintHeaders ( BSTNode *n, void *ignore )
-{
-    KHttpHeader *node = ( KHttpHeader * ) n;
-
-    KOutMsg ( "%S: %S\n",
-              & node -> name,
-              & node -> value );
-}
-#endif
-
-/* GetInputStream
- *  access the body of response as a stream
- *  only reads are supported
- *
- *  "s" [ OUT ] - return parameter for input stream reference
- *   must be released via KStreamRelease
- */
-LIB_EXPORT rc_t CC KHttpResultGetInputStream ( KHttpResult *self, KStream ** s )
-{
-    rc_t rc;
-    
-    if ( s == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-        else
-        {
-            char buffer [ 512 ];
-            size_t num_read = 0;
-            uint64_t content_length = 0;
-
-            /* find header to check for type of data being received 
-               assign bytes read from value to num_read */
-            rc = KHttpResultGetHeader ( self, "Transfer-Encoding", buffer, sizeof buffer, & num_read );
-            if ( rc == 0 && num_read > 0 )
-            {
-                /* check if chunked encoding */
-                if ( strcase_cmp ( "chunked", sizeof "chunked" - 1,
-                    buffer, num_read, sizeof "chunked" - 1 ) == 0 )
-                {
-                    return KHttpStreamMakeChunked ( self -> http, s, "KHttpStreamChunked" );
-                }
-                /* TBD - print actual value */
-                LOGERR ( klogSys, rc, "Transfer-Encoding does not provide a value" );
-
-            }
-            /* get the content length of the entire stream if known */
-            if ( KHttpResultSize ( self, & content_length ) )
-                return KHttpStreamMake ( self -> http, s, "KHttpStream", content_length, false );
-
-            /* detect pre-HTTP/1.1 dynamic content */
-            if ( self -> version < 0x01010000 )
-                return KHttpStreamMake ( self -> http, s, "KHttpStream", 0, true );
-
-#if _DEBUGGING
-            BSTreeForEach ( & self -> hdrs, false, PrintHeaders, NULL );
-#endif            
-
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcMessage, rcUnsupported );
-            LOGERR ( klogInt, rc, "HTTP response does not give content length" ); 
-
-        }
-    }
-    
-    * s = NULL;
-    
-    return rc;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * KHttpRequest
- *  hyper text transfer protocol
- */
-
-struct KHttpRequest
-{
-    KHttp * http;
-
-    URLBlock url_block;
-    KDataBuffer url_buffer;
-
-    KDataBuffer body;
-    
-    BSTree hdrs;
-
-    KRefcount refcount;
-};
-
-static
-rc_t KHttpRequestClear ( KHttpRequest *self )
-{
-    KDataBufferWhack ( & self -> url_buffer );
-
-    return 0;
-}
-
-static
-rc_t KHttpRequestWhack ( KHttpRequest * self )
-{
-    KHttpRequestClear ( self );
-
-    KHttpRelease ( self -> http );
-    KDataBufferWhack ( & self -> body );
-    
-    BSTreeWhack  ( & self -> hdrs, KHttpHeaderWhack, NULL );
-    KRefcountWhack ( & self -> refcount, "KHttpRequest" );
-    free ( self );
-    return 0;
-}
-
-static 
-rc_t KHttpRequestInit ( KHttpRequest * req,
-    const URLBlock *b, const KDataBuffer *buf )
-{
-    rc_t rc = KDataBufferSub ( buf, & req -> url_buffer, 0, UINT64_MAX );
-    if ( rc == 0 )
-    {
-        /* assign url_block */
-        req -> url_block = * b;
-    }
-    return rc;
-}
-        
-
-/* MakeRequestInt[ernal]
- */
-static
-rc_t KHttpMakeRequestInt ( const KHttp *self,
-    KHttpRequest **_req, const URLBlock *block, const KDataBuffer *buf )
-{
-    rc_t rc;
-
-    /* create the object with empty buffer */
-    KHttpRequest * req = calloc ( 1, sizeof * req );
-    if ( req == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcNull );
-    else
-    {
-        rc = KHttpAddRef ( self );
-        if ( rc == 0 )
-        {
-            /* assign http */
-            req -> http = ( KHttp* ) self; 
-
-            /* initialize body to zero size */
-            KDataBufferClear ( & req -> body );
-                
-            KRefcountInit ( & req -> refcount, 1, "KHttpRequest", "make", buf -> base ); 
-
-            /* fill out url_buffer with URL */
-            rc = KHttpRequestInit ( req, block, buf );
-            if ( rc == 0 )
-            {
-                * _req = req;
-                return 0;
-            }
-
-            KHttpRelease ( self );
-        }
-    }
-    
-    free ( req );
-
-    return rc;
-}
-
-/* MakeRequest
- *  create a request that can be used to contact HTTP server
- *
- *  "req" [ OUT ] - return parameter for HTTP request object
- *
- *  "vers" [ IN ] - http version
- *
- *  "conn" [ IN, NULL OKAY ] - previously opened stream for communications.
- *
- *  "url" [ IN ] - full resource identifier. if "conn" is NULL,
- *   the url is parsed for remote endpoint and is opened by mgr.
- */
-LIB_EXPORT rc_t CC KHttpVMakeRequest ( const KHttp *self,
-    KHttpRequest **_req, const char *url, va_list args )
-{
-    rc_t rc;
-    
-    if ( _req == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        * _req = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-        else if ( url ==  NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        else if ( url [ 0 ] == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-        else
-        {
-            KDataBuffer buf;
-
-            /* make a KDataBuffer and copy in url with the va_lis */
-            /* rc = KDataBufferMakeBytes ( & buf, 4096 );*/
-            KDataBufferClear ( &buf );
-            
-            rc = KDataBufferVPrintf ( &buf, url, args );
-            if ( rc == 0 )
-            {
-                /* parse the URL */
-                URLBlock block;
-                rc = ParseUrl ( & block, buf . base, buf . elem_count - 1 );
-                if ( rc == 0 )
-                    rc = KHttpMakeRequestInt ( self, _req, & block, & buf );
-            }
-
-            KDataBufferWhack ( & buf );
-        }
-    }
-
-    return rc;
-}
-
-/* MakeRequest
- *  create a request that can be used to contact HTTP server
- *
- *  "req" [ OUT ] - return parameter for HTTP request object
- *
- *  "url" [ IN ] - full resource identifier. if "conn" is NULL,
- *   the url is parsed for remote endpoint and is opened by mgr.
- */
-LIB_EXPORT rc_t CC KHttpMakeRequest ( const KHttp *self,
-    KHttpRequest **_req, const char *url, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, url );
-    rc = KHttpVMakeRequest ( self, _req, url, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* MakeRequest
- *  create a request that can be used to contact HTTP server
- *
- *  "req" [ OUT ] - return parameter for HTTP request object
- *
- *  "vers" [ IN ] - http version
- *
- *  "conn" [ IN, NULL OKAY ] - previously opened stream for communications.
- *
- *  "url" [ IN ] - full resource identifier. if "conn" is NULL,
- *   the url is parsed for remote endpoint and is opened by mgr.
- */
-LIB_EXPORT rc_t CC KNSManagerMakeRequest ( const KNSManager *self,
-    KHttpRequest **req, ver_t vers, KStream *conn, const char *url, ... )
-{
-    rc_t rc;
-
-    if ( req == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-        * req = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-        else if ( vers < 0x01000000 || vers > 0x01010000 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcIncorrect );
-        else if ( url == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcString, rcNull );
-        else if ( url [ 0 ] == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcString, rcEmpty );
-        else
-        {
-            va_list args;
-            KDataBuffer buf;
-            
-            KDataBufferClear ( &buf );
-                /* convert var-arg "url" to a full string */
-            va_start ( args, url );
-            rc = KDataBufferVPrintf ( & buf, url, args );
-            va_end ( args );
-            if ( rc == 0 )
-            {
-                /* parse the URL */
-                URLBlock block;
-                rc = ParseUrl ( & block, buf . base, buf . elem_count - 1 );
-                if ( rc == 0 )
-                {
-                    KHttp * http;
-                    
-                    rc = KNSManagerMakeHttpInt ( self, & http, & buf, conn, vers, & block . host, block . port );
-                    if ( rc == 0 )
-                    {
-                        rc = KHttpMakeRequestInt ( http, req, & block, & buf );
-                        KHttpRelease ( http );
-                    }
-                }
-            }
-            KDataBufferWhack ( & buf );
-        }
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KHttpRequestAddRef ( const KHttpRequest *self )
-{
-        if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KHttpRequest" ) )
-        {
-        case krefLimit:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcRange, rcExcessive );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcAttaching, rcSelf, rcInvalid );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KHttpRequestRelease ( const KHttpRequest *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KHttpRequest" ) )
-        {
-        case krefWhack:
-            return KHttpRequestWhack ( ( KHttpRequest* ) self );
-        case krefNegative:
-            return RC ( rcNS, rcNoTarg, rcReleasing, rcRange, rcExcessive );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-
-/* Connection
- *  sets connection management headers
- *
- *  "close" [ IN ] - if "true", inform the server to close the connection
- *   after its response ( default for version 1.0 ). when "false" ( default
- *   for version 1.1 ), ask the server to keep the connection open.
- *
- * NB - the server is not required to honor the request
- */
-LIB_EXPORT rc_t CC KHttpRequestConnection ( KHttpRequest *self, bool close )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-    else
-    {
-        String name, value;
-        
-        CONST_STRING ( & name, "Connection" );
-        /* if version is 1.1 and close is true, add 'close' to Connection header value. */
-        /* if version if 1.1 default is false - no action needed */
-        if ( self -> http -> vers == 0x01010000 && close == true )
-            CONST_STRING ( & value, "close" );
-        else if ( self -> http -> vers == 0x01000000 && close == false )
-            CONST_STRING ( & value, "keep-alive" );
-        else
-            return 0;
-
-        rc = KHttpRequestAddHeader ( self,  name . addr, value . addr );
-            
-    }
-    return rc;
-}
-
-
-/* ByteRange
- *  set requested byte range of response
- *
- *  "pos" [ IN ] - beginning offset within remote entity
- *
- *  "bytes" [ IN ] - the number of bytes being requested
- */
-LIB_EXPORT rc_t CC KHttpRequestByteRange ( KHttpRequest *self, uint64_t pos, size_t bytes )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull);
-    else
-    {
-        char  range [ 256 ];
-        size_t num_writ;
-        String name, value;
-        
-        CONST_STRING ( & name, "Range" );
-        rc = string_printf ( range, sizeof range, & num_writ, "bytes=%u-%u"
-                             , pos
-                             , pos + bytes - 1);
-        if ( rc == 0 )
-        {
-            StringInitCString ( & value, range );
-
-            rc = KHttpRequestAddHeader ( self, name . addr, value . addr );
-        }
-    }
-    return rc;
-}
-
-
-/* AddHeader
- *  allow addition of an arbitrary HTTP header to message
- */
-LIB_EXPORT rc_t CC KHttpRequestAddHeader ( KHttpRequest *self,
-                                           const char *name, const char *val, ... )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull);
-    else
-    {
-        if ( name == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        /* have to test for empty name, too */
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-        else if ( val == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-        /* same for empty value fmt string */
-        else if ( val [ 0 ] == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInsufficient );
-        else
-        {
-            size_t name_size;
-
-            va_list args;
-            va_start ( args, val );
-
-            /* disallow setting of "Host" and other headers */
-            name_size = string_size ( name );
-
-            if ( strcase_cmp ( name, name_size, "Host", sizeof "Host", sizeof "Host" - 1 ) == 0 )
-                rc = RC ( rcNS, rcNoTarg, rcComparing, rcParam, rcUnsupported );
-            if ( strcase_cmp ( name, name_size, "Content-Length", sizeof "Content-Length", sizeof "Content-Length" - 1 ) == 0 )
-                rc = RC ( rcNS, rcNoTarg, rcComparing, rcParam, rcUnsupported );
-            else
-                rc = KHttpVAddHeader ( & self -> hdrs, name, val, args );
-
-            va_end ( args );
-        }
-    }
-    return rc;
-}
-
-/* AddPostParam
- *  adds a parameter for POST
- */
-LIB_EXPORT rc_t CC KHttpRequestVAddPostParam ( KHttpRequest *self, const char *fmt, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcSelf, rcNull );
-    else if ( fmt == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else if ( fmt [ 0 ] == 0 )
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull );
-    else
-    {
-
-        /* TBD - reject embedded newlines */
-        /* TBD - URL-encoding or at least detect need for it */
-
-        /* first param */
-        if ( self -> body . elem_count == 0 )
-            rc = KDataBufferVPrintf ( & self -> body, fmt, args );
-        else
-        {
-            /* additional param - add separator */
-            rc = KDataBufferPrintf ( & self -> body, "&" );
-            if ( rc == 0 )
-                rc = KDataBufferVPrintf ( & self -> body, fmt, args );
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KHttpRequestAddPostParam ( KHttpRequest *self, const char *fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-    rc = KHttpRequestVAddPostParam ( self, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-static
-rc_t KHttpRequestFormatMsg ( const KHttpRequest *self,
-    char *buffer, size_t bsize, const char *method, size_t *len )
-{
-    rc_t rc;
-    size_t total;
-    const KHttpHeader *node;
-    
-    KHttp *http = self -> http;
-
-    /* determine if there is a query */
-    const char *has_query = ( self -> url_block . query . size == 0 ) ? "" : "?";
-
-    /* there are 2 places where the can be a host name stored
-       we give preference to the one attached to the url_block, because
-       it is the most recently determined.
-       If that one is empty, we look at the http object for its
-       host name.
-       Error if both are empty */
-    String hostname = self -> url_block . host;
-    if ( hostname . size == 0 )
-    {
-        hostname = http -> hostname;
-        if ( hostname . size == 0 )
-            return RC ( rcNS, rcNoTarg, rcValidating, rcName, rcEmpty );
-    }
-
-    /* start building the buffer that will be sent 
-       We are inlining the host:port, instead of
-       sending it in its own header */
-
-    /* TBD - should we include the port with the host name? */
-    rc = string_printf ( buffer, bsize, len, 
-                         "%s %S://%S%S%s%S HTTP/%.2V\r\n"
-                         , method
-                         , & self -> url_block . scheme
-                         , & hostname
-                         , & self -> url_block . path
-                         , has_query
-                         , & self -> url_block . query
-                         , http -> vers );
-    
-
-    /* print all headers remaining into buffer */
-    total = * len;
-    for ( node = ( const KHttpHeader* ) BSTreeFirst ( & self -> hdrs );
-          rc == 0 && node != NULL;
-          node = ( const KHttpHeader* ) BSTNodeNext ( & node -> dad ) )
-    {
-        /* add header line */
-        rc = string_printf ( & buffer [ total ], bsize - total, len,
-                             "%S: %S\r\n"
-                             , & node -> name
-                             , & node -> value );
-        total += * len;
-    }
-
-    /* add terminating empty header line */
-    if ( rc == 0 )
-    {
-        rc = string_printf ( & buffer [ total ], bsize - total, len, "\r\n" );
-        * len += total;
-    }
-    
-    return rc;
-}
-
-static
-rc_t KHttpRequestHandleRedirection ( KHttpRequest *self, KHttpResult *rslt )
-{
-    rc_t rc = 0;
-    String Location;
-    KHttpHeader *loc;
-
-    /* find relocation URI */
-    CONST_STRING ( & Location, "Location" );
-    loc = ( KHttpHeader* ) BSTreeFind ( & rslt -> hdrs, & Location, KHttpHeaderCmp );
-    if ( loc == NULL )
-    {
-        LOGERR ( klogSys, rc, "Location header not found on relocate msg" );
-        return RC ( rcNS, rcNoTarg, rcValidating, rcNode, rcNull );
-    }
-
-    /* capture the new URI in loc -> value_storage */
-    if ( loc -> value . size == 0 )
-    {
-        LOGERR ( klogSys, rc, "Location does not provide a value" );
-        rc = RC ( rcNS, rcNoTarg, rcValidating, rcNode, rcIncorrect );
-    }
-    else
-    {
-        URLBlock b;
-        KDataBuffer uri;
-        /* pull out uri */
-        rc = KDataBufferSub ( &loc -> value_storage, &uri, loc -> name . size, loc -> value . size + 1 );
-        if ( rc == 0 )
-        {
-            /* parse the URI into local url_block */
-            rc = ParseUrl ( &b, uri . base, uri . elem_count - 1 );
-            if ( rc == 0 )
-            {
-                KHttp *http = self -> http;
-
-                /* close the open http connection and clear out all data except for the manager */
-                KHttpClear ( http );
-
-                /* reinitialize the http from uri */
-                rc = KHttpInit ( http, &uri, NULL, http -> vers , &b . host, b . port );
-                if ( rc == 0 )
-                {
-                    KHttpRequestClear ( self );
-                    rc = KHttpRequestInit ( self, &b, &uri );
-                    if ( rc == 0 )
-                        KHttpResultRelease ( rslt );
-                }
-            }
-
-            KDataBufferWhack ( & uri );
-        }
-        
-    } 
-
-    return rc;
-}
-
-static
-rc_t KHttpRequestSendReceiveNoBody ( KHttpRequest *self, KHttpResult **_rslt, const char *method )
-{
-    rc_t rc = 0;
-
-    KHttpResult *rslt;
-
-    uint32_t i;
-    const uint32_t max_redirect = 5;
-
-    /* TBD - may want to prevent a Content-Type or other headers here */
-
-    if ( self -> body . elem_count != 0 )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcNoObj, rcIncorrect );
-
-    for ( i = 0; i < max_redirect; ++ i )
-    {
-        size_t len;
-        char buffer [ 4096 ];
-
-        /* create message */
-        rc = KHttpRequestFormatMsg ( self, buffer, sizeof buffer, method, & len );
-        if ( rc != 0 )
-            break;
-
-        /* send the message and create a response */
-        rc = KHttpSendReceiveMsg ( self -> http, _rslt, buffer, len, NULL, self -> url_buffer . base );
-        if ( rc != 0 )
-            break;
-
-        /* look at status code */
-        rslt = * _rslt;
-        switch ( rslt -> status )
-        {
-        case 100:
-            /* Continue
-               The client SHOULD continue with its request. This interim response is used
-               to inform the client that the initial part of the request has been received
-               and has not yet been rejected by the server. The client SHOULD continue by
-               sending the remainder of the request or, if the request has already been completed,
-               ignore this response. The server MUST send a final response after the request
-               has been completed. See section 8.2.3 for detailed discussion of the use and
-               handling of this status code. */
-
-            /* TBD - should not see this, but needs to be handled */
-            return 0;
-
-            /* TBD - need to include RFC rule for handling codes for HEAD and GET */
-        case 301: /* "moved permanently" */
-        case 302: /* "found" - okay to reissue for HEAD and GET, but not for POST */
-        case 307: /* "moved temporarily" */
-            break;
-
-        case 505: /* HTTP Version Not Supported */
-            if ( self -> http -> vers > 0x01000000 )
-            {
-                /* downgrade version requested */
-                self -> http -> vers -= 0x00010000;
-                /* TBD - remove any HTTP/1.1 specific headers */
-                continue;
-            }
-
-            /* NO BREAK */
-
-        default:
-
-            /* TBD - should all status codes be interpreted as rc ? */
-            return 0;
-        }
-
-        /* reset connection, reset request */
-        KOutMsg ( "\nRedirected!!!\n\n" );
-        rc = KHttpRequestHandleRedirection ( self, rslt );
-        if ( rc != 0 )
-            break;
-    }
-    return rc;
-}
-
-/* HEAD
- *  send HEAD message
- */
-LIB_EXPORT rc_t CC KHttpRequestHEAD ( KHttpRequest *self, KHttpResult **rslt )
-{
-    return KHttpRequestSendReceiveNoBody ( self, rslt, "HEAD" );
-} 
-
-/* GET
- *  send GET message
- *  all query AND post parameters are combined in URL
- */
-LIB_EXPORT rc_t CC KHttpRequestGET ( KHttpRequest *self, KHttpResult **rslt )
-{
-    return KHttpRequestSendReceiveNoBody ( self, rslt, "GET" );
-}
-
-/* POST
- *  send POST message
- *  query parameters are sent in URL
- *  post parameters are sent in body
- */
-LIB_EXPORT rc_t CC KHttpRequestPOST ( KHttpRequest *self, KHttpResult **_rslt )
-{
-    rc_t rc = 0;
-
-    KHttpResult *rslt;
-
-    uint32_t i;
-    const uint32_t max_redirect = 5;
-
-    /* TBD comment - add debugging test to ensure "Content-Length" header not present */
-
-    /* fix headers for POST params */
-    if ( self -> body . elem_count > 1 )
-    {
-        /* "body" contains data plus NUL byte */
-        rc = KHttpAddHeader ( & self -> hdrs, "Content-Length", "%lu", self -> body . elem_count - 1 );
-        if ( rc == 0 )
-        {
-            String Content_Type;
-            const KHttpHeader *node;
-
-            CONST_STRING ( & Content_Type, "Content-Type" );
-
-            node = ( const KHttpHeader* ) BSTreeFind ( & self -> hdrs, & Content_Type, KHttpHeaderCmp );
-            if ( node == NULL )
-            {
-                /* add content type for form parameters */
-                /* TBD - before general application, need to perform URL-encoding! */
-                rc = KHttpAddHeader ( & self -> hdrs, "Content-Type", "application/x-www-form-urlencoded" );
-            }
-        }
-    }
-
-    for ( i = 0; i < max_redirect; ++ i )
-    {
-        size_t len;
-        char buffer [ 4096 ];
-
-        /* create message */
-        rc = KHttpRequestFormatMsg ( self, buffer, sizeof buffer, "POST", & len );
-        if ( rc != 0 )
-            break;
-
-        /* send the message and create a response */
-        rc = KHttpSendReceiveMsg ( self -> http, _rslt, buffer, len, & self -> body, self -> url_buffer . base );
-        if ( rc != 0 )
-            break;
-
-        /* look at status code */
-        rslt = * _rslt;
-        switch ( rslt -> status )
-        {
-        case 100:
-            /* Continue
-               The client SHOULD continue with its request. This interim response is used
-               to inform the client that the initial part of the request has been received
-               and has not yet been rejected by the server. The client SHOULD continue by
-               sending the remainder of the request or, if the request has already been completed,
-               ignore this response. The server MUST send a final response after the request
-               has been completed. See section 8.2.3 for detailed discussion of the use and
-               handling of this status code. */
-
-            /* TBD - should not see this, but needs to be handled */
-            return 0;
-
-            /* TBD - Add RFC rules about POST */
-        case 301: /* "moved permanently" */
-        case 307: /* "moved temporarily" */
-            break;
-
-        case 505: /* HTTP Version Not Supported */
-            if ( self -> http -> vers > 0x01000000 )
-            {
-                /* downgrade version requested */
-                self -> http -> vers -= 0x00010000;
-                /* TBD - remove any HTTP/1.1 specific headers */
-                continue;
-            }
-
-            /* NO BREAK */
-
-        default:
-
-            /* TBD - should all status codes be interpreted as rc ? */
-            return 0;
-        }
-
-        /* reset connection, reset request */
-        rc = KHttpRequestHandleRedirection ( self, rslt );
-        if ( rc != 0 )
-            break;
-    }
-    return rc;
-}
-
-/*******************************************************************************************
- * KHttpFile
- */
-
-
-struct KHttpFile
-{
-    KFile dad;
-    
-    uint64_t file_size;
-
-    KHttp *http;
-
-    String url;
-    KDataBuffer url_buffer;
-};
-
-static
-rc_t KHttpFileDestroy ( KHttpFile *self )
-{
-  KHttpWhack ( self -> http );
-  KDataBufferWhack ( & self -> url_buffer );
-  free ( self );
-
-  return 0;
-}
-
-static
-struct KSysFile* KHttpFileGetSysFile ( const KHttpFile *self, uint64_t *offset )
-{
-    *offset = 0;
-    return NULL;
-}
-
-static
-rc_t KHttpFileRandomAccess ( const KHttpFile *self )
-{
-    return 0;
-}
-
-/* KHttpFile must have a file size to be created
-   impossible for this funciton to fail */
-static
-rc_t KHttpFileSize ( const KHttpFile *self, uint64_t *size )
-{
-    *size = self -> file_size;
-    return 0;
-}
-
-static
-rc_t KHttpFileSetSize ( KHttpFile *self, uint64_t size )
-{
-    return RC ( rcNS, rcFile, rcUpdating, rcFile, rcReadonly );
-}
-
-static
-rc_t KHttpFileRead ( const KHttpFile *cself, uint64_t pos,
-     void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    KHttpFile *self = ( KHttpFile * ) cself;
-    KHttp *http = self -> http;
-
-    /* starting position was beyond EOF */
-    if ( pos >= self -> file_size )
-    {
-        *num_read = 0;
-        return 0;
-    }
-    /* starting position was within file but the range fell beyond EOF */
-    else 
-    {
-        KHttpRequest *req;
-
-        if ( pos + bsize > self -> file_size )
-            bsize = self -> file_size - pos;
-        
-        rc = KHttpMakeRequest ( http, &req, self -> url_buffer . base );
-        if ( rc == 0 )
-        {
-            rc = KHttpRequestByteRange ( req, pos, bsize );
-            if ( rc == 0 )
-            {
-                KHttpResult *rslt;
-                
-                rc = KHttpRequestGET ( req, &rslt );
-                if ( rc == 0 )
-                {
-                    uint32_t code;
-                    
-                    /* dont need to know what the response message was */
-                    rc = KHttpResultStatus ( rslt, &code, NULL, 0, NULL );
-                    if ( rc == 0 )
-                    {
-                        switch ( code )
-                        {
-                        case 206:
-                        {
-                            uint64_t start_pos;
-                            size_t result_size;
-
-                            rc = KHttpResultRange ( rslt, &start_pos, &result_size );
-                            if ( rc == 0 && 
-                                 start_pos == pos &&
-                                 result_size == bsize )
-                            {
-                                KStream *response;
-                                
-                                rc = KHttpResultGetInputStream ( rslt, &response );
-                                if ( rc == 0 )
-                                {
-                                    rc = KStreamReadAll ( response, buffer, bsize, num_read );
-                                    if ( rc != 0 || num_read == 0 )
-                                        return rc;
-                                    
-                                    KStreamRelease ( response );
-                                }
-                            }
-                            break;
-                        }
-                        case 416:
-                        default:
-                            rc = RC ( rcNS, rcFile, rcReading, rcFileDesc, rcInvalid );
-                        }
-                    }
-                    KHttpResultRelease ( rslt );
-                }
-            }
-            KHttpRequestRelease ( req );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t KHttpFileWrite ( KHttpFile *self, uint64_t pos, 
-                      const void *buffer, size_t size, size_t *num_writ )
-{
-    return RC ( rcNS, rcFile, rcUpdating, rcInterface, rcUnsupported );
-}
-
-static KFile_vt_v1 vtKHttpFile = 
-{
-    1, 0,
-
-    KHttpFileDestroy,
-    KHttpFileGetSysFile,
-    KHttpFileRandomAccess,
-    KHttpFileSize,
-    KHttpFileSetSize,
-    KHttpFileRead,
-    KHttpFileWrite
-};
-
-LIB_EXPORT rc_t CC KNSManagerVMakeHttpFile ( const KNSManager *self,
-    const KFile **file, KStream *conn, ver_t vers, const char *url, va_list args )
-{
-    rc_t rc;
-
-    if ( file == NULL )
-        rc = RC ( rcNS, rcFile, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC( rcNS, rcNoTarg, rcConstructing, rcParam, rcNull );
-        else if ( url == NULL )
-            rc = RC ( rcNS, rcFile, rcConstructing, rcPath, rcNull );
-        else if ( url [ 0 ] == 0 )
-            rc = RC ( rcNS, rcFile, rcConstructing, rcPath, rcInvalid );
-        else
-        {
-            KHttpFile *f;
-
-            f = calloc ( 1, sizeof *f );
-            if ( f == NULL )
-                rc = RC ( rcNS, rcFile, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KFileInit ( &f -> dad, ( const KFile_vt * ) &vtKHttpFile, "KHttpFile", url, true, false );
-                if ( rc == 0 )
-                {
-                    KDataBuffer *buf = & f -> url_buffer;
-                    buf -> elem_bits = 8;
-                    rc = KDataBufferVPrintf ( buf, url, args );
-                    if ( rc == 0 )
-                    {
-                        URLBlock block;
-                        rc = ParseUrl ( &block, buf -> base, buf -> elem_count - 1 );
-                        if ( rc == 0 )
-                        {
-                            KHttp *http;
-                          
-                            rc = KNSManagerMakeHttpInt ( self, &http, buf, conn, vers, &block . host, block . port );
-                            if ( rc == 0 )
-                            {
-                                KHttpRequest *req;
-
-                                rc = KHttpMakeRequestInt ( http, &req, &block, buf );
-                                if ( rc == 0 )
-                                {
-                                    KHttpResult *rslt;
-                                  
-                                    rc = KHttpRequestHEAD ( req, &rslt );
-                                    KHttpRequestRelease ( req );
-
-                                    if ( rc == 0 )
-                                    {
-                                        uint64_t size;
-
-                                        bool have_size = KHttpResultSize ( rslt, &size );
-                                        KHttpResultRelease ( rslt );
-
-                                        if ( ! have_size )
-                                            rc = RC ( rcNS, rcFile, rcValidating, rcNoObj, rcError );
-                                        else
-                                        {
-                                            f -> file_size = size;
-                                            f -> http = http;
-
-                                            * file = & f -> dad;
-
-                                            return 0;
-                                        }
-                                    }
-                                }
-
-                                KHttpRelease ( http );
-                            }
-                        }
-                    }
-                    KDataBufferWhack ( buf );
-                }
-                free ( f );
-            }
-        }
-
-        * file = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KNSManagerMakeHttpFile ( const KNSManager *self,
-    const KFile **file, KStream *conn, ver_t vers, const char *url, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, url );
-    rc = KNSManagerVMakeHttpFile ( self, file, conn, vers, url, args );
-    va_end ( args );
-
-    return rc;
-}
-
diff --git a/libs/kns/kns_manager.c b/libs/kns/kns_manager.c
deleted file mode 100644
index bfd1493..0000000
--- a/libs/kns/kns_manager.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/extern.h>
-
-#include <klib/refcount.h>
-#include <klib/rc.h>
-#include <kfs/dyload.h>
-#include <kfs/directory.h>
-#include <kfs/impl.h>
-
-#include "kns_mgr_priv.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <sysalloc.h>
-
-static const char knsmanager_classname [] = "KNSManager";
-static struct KNSManager * kns_mgr_singleton = NULL;
-static KDylib *lib_curl_handle = NULL;
-
-
-LIB_EXPORT rc_t CC KNSManagerAddRef ( const struct KNSManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd( &self->refcount, knsmanager_classname ) )
-        {
-        case krefOkay:
-            break;
-        case krefZero:
-            return RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcIncorrect);
-        case krefLimit:
-            return RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcExhausted);
-        case krefNegative:
-            return RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            return RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcUnknown);
-        }
-    }
-    return 0;
-}
-
-
-static rc_t KNSManager_Make_DlCurl( KDyld ** dl )
-{
-    rc_t rc = KDyldMake ( dl );
-#if ! WINDOWS
-    if ( rc == 0 )
-    {
-        const KDirectory * dir;
-        rc = KDyldHomeDirectory ( *dl, &dir, ( fptr_t ) KNSManager_Make_DlCurl );
-        if ( rc == 0 )
-        {
-            struct KSysDir const *sysdir = KDirectoryGetSysDir ( dir );
-            if ( sysdir != NULL )
-            {
-                char int_path[ 4096 ];
-                rc = KSysDirRealPath ( sysdir, int_path, sizeof int_path, "." );
-                if ( rc == 0 )
-                {
-                    KDyldAddSearchPath ( *dl, int_path );
-                }
-            }
-            KDirectoryRelease( dir );
-        }
-        rc = 0;
-    }
-#endif
-    return rc;
-}
-
-static rc_t KNSManagerLoadLib( struct KNSManager *self )
-{
-    KDyld *dl;
-    /* make a dynamic-library loader */
-    rc_t rc = KDyldMake ( &dl );
-    if ( rc == 0 )
-    {
-        /* load the curl-library */
-        rc = KDyldLoadLib( dl, &lib_curl_handle, LPFX "curl" SHLX );
-        if ( rc != 0 )
-        {
-            KDyldRelease ( dl );
-            rc = KNSManager_Make_DlCurl( &dl );
-            if ( rc == 0 )
-            {
-                rc = KDyldLoadLib( dl, &lib_curl_handle, LPFX "curl" SHLX );
-            }
-        }
-        if ( rc == 0 )
-        {
-            KSymAddr *sym;
-
-            /* resolve symbols */
-
-            /* curl_easy_init() */
-            rc = KDylibSymbol( lib_curl_handle, &sym, "curl_easy_init" );
-            if ( rc == 0 )
-            {
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_easy_init_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_easy_cleanup() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_easy_cleanup" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_easy_cleanup_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_easy_setopt() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_easy_setopt" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_easy_setopt_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_easy_perform() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_easy_perform" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_easy_perform_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_easy_getinfo() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_easy_getinfo" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_easy_getinfo_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_slist_append() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_slist_append" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_slist_append_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_version() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_version" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_version_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* curl_slist_free_all() */
-            if ( rc == 0 )
-            {
-                rc = KDylibSymbol( lib_curl_handle, &sym, "curl_slist_free_all" );
-                KSymAddrAsFunc( sym, ( fptr_t* ) &(self->curl_slist_free_all_fkt) );
-                KSymAddrRelease( sym );
-            }
-
-            /* bail on error */
-            if ( rc != 0 )
-            {
-                KDylibRelease ( lib_curl_handle );
-                lib_curl_handle = NULL;
-                self->curl_easy_init_fkt = NULL;
-                self->curl_easy_cleanup_fkt = NULL;
-                self->curl_easy_setopt_fkt = NULL;
-                self->curl_easy_perform_fkt = NULL;
-                self->curl_slist_append_fkt = NULL;
-                self->curl_version_fkt = NULL;
-                self->curl_easy_getinfo_fkt = NULL;
-            }
-        }
-        KDyldRelease ( dl );
-    }
-
-    return rc;
-
-}
-
-
-LIB_EXPORT rc_t CC KNSManagerMake( struct KNSManager **self )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        return RC( rcNS, rcMgr, rcConstructing, rcSelf, rcNull );
-
-    *self = kns_mgr_singleton;
-    if ( kns_mgr_singleton != NULL )
-    {
-        rc = KNSManagerAddRef( kns_mgr_singleton );
-        if ( rc != 0 )
-            *self = NULL;
-    }
-    else
-    {
-        struct KNSManager *tmp;
-        tmp = calloc( 1, sizeof * tmp );
-        if ( tmp == NULL )
-            rc = RC( rcNS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KNSManagerInit ( tmp );
-            if ( rc != 0 )
-            {
-                free ( tmp );
-                tmp = NULL;
-            }
-            else
-            {
-                tmp->create_rc = KNSManagerLoadLib( tmp );
-                KRefcountInit( &tmp->refcount, 1, "KNS", "make", knsmanager_classname );
-            }
-        }
-        *self = tmp;
-        kns_mgr_singleton = tmp;
-    }
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KNSManagerAvail( const struct KNSManager *self )
-{
-    if ( self == NULL )
-        return RC( rcNS, rcMgr, rcReading, rcSelf, rcNull );
-    return self->create_rc;
-}
-
-
-LIB_EXPORT rc_t CC KNSManagerCurlVersion( const struct KNSManager *self, const char ** version_string )
-{
-    if ( self == NULL )
-        return RC( rcNS, rcMgr, rcReading, rcSelf, rcNull );
-    if ( version_string == NULL )
-        return RC( rcNS, rcMgr, rcReading, rcParam, rcNull );
-    if ( self->create_rc != 0 )
-        return self->create_rc;
-    *version_string = self->curl_version_fkt();
-    return 0;
-}
-
-
-static rc_t KNSManagerDestroy( struct KNSManager *self )
-{
-    if ( self == NULL )
-        return RC( rcNS, rcFile, rcDestroying, rcSelf, rcNull );
-
-    KDylibRelease ( lib_curl_handle );
-    lib_curl_handle = NULL;
-
-    KNSManagerCleanup ( self );
-
-    KRefcountWhack( &self->refcount, knsmanager_classname );
-
-    free( self );
-    kns_mgr_singleton = NULL;
-    
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KNSManagerRelease( const struct KNSManager *self )
-{
-    rc_t rc = 0;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop( &self->refcount, knsmanager_classname ) )
-        {
-        case krefOkay:
-        case krefZero:
-            break;
-        case krefWhack:
-            rc = KNSManagerDestroy( ( struct KNSManager * )self );
-            break;
-        case krefNegative:
-            return RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcInvalid );
-        default:
-            rc = RC( rcNS, rcMgr, rcAttaching, rcRefcount, rcUnknown );
-            break;            
-        }
-    }
-    return rc;
-}
diff --git a/libs/kns/kns_mgr_priv.h b/libs/kns/kns_mgr_priv.h
deleted file mode 100644
index d2165f3..0000000
--- a/libs/kns/kns_mgr_priv.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_kns_mgr_priv_
-#define _h_kns_mgr_priv_
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <klib/rc.h>
-
-#include "curlhdr/curl.h"
-#include "curlhdr/easy.h"
-
-/* this is the hidden manager-struct: a refcount with some function-pointer's */
-struct KNSManager
-{
-    KRefcount refcount;
-
-    rc_t create_rc;
-
-    /* curl-easy-function-pointers... */
-    CURL*    ( CC * curl_easy_init_fkt )    ( void );
-    void     ( CC * curl_easy_cleanup_fkt ) ( CURL * handle );
-    CURLcode ( CC * curl_easy_setopt_fkt )  ( CURL *handle, CURLoption option, ... );
-    CURLcode ( CC * curl_easy_perform_fkt ) ( CURL * handle );
-    CURLcode ( CC * curl_easy_getinfo_fkt ) ( CURL *curl, CURLINFO info, ... );
-    char *   ( CC * curl_version_fkt )      ( void );
-    struct curl_slist* ( CC * curl_slist_append_fkt ) ( struct curl_slist * list, const char * string );
-    void ( CC * curl_slist_free_all_fkt ) ( struct curl_slist * list );
-};
-
-    rc_t KNSManagerInit ( struct KNSManager *self );
-    void KNSManagerCleanup ( struct KNSManager *self );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libs/kns/libkns.vers b/libs/kns/libkns.vers
deleted file mode 100644
index 3eefcb9..0000000
--- a/libs/kns/libkns.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.0
diff --git a/libs/kns/libkurl.vers b/libs/kns/libkurl.vers
deleted file mode 100644
index 7ee7020..0000000
--- a/libs/kns/libkurl.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.10
diff --git a/libs/kns/stream-from-files.c b/libs/kns/stream-from-files.c
deleted file mode 100644
index 2ac4e0b..0000000
--- a/libs/kns/stream-from-files.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-typedef struct KStreamFromFiles KStreamFromFiles;
-#define KSTREAM_IMPL KStreamFromFiles
-
-#include <kns/extern.h>
-#include <kns/stream.h>
-#include <kns/impl.h>
-#include <kfs/file.h>
-#include <kfs/impl.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include "stream-priv.h"
-
-
-/* the object structure for THIS implementation */
-struct  KStreamFromFiles
-{
-    /* THIS MUST COME FIRST */
-    KStream dad;
-
-    uint64_t in_pos;
-    uint64_t out_pos;
-
-    const KFile *in;
-    KFile *out;
-};
-
-
-/* the required methods */
-
-static
-rc_t CC KStreamFromFilesWhack ( KStreamFromFiles *self )
-{
-    KFileRelease ( self -> in );
-    KFileRelease ( self -> out );
-    free ( self );
-    return 0;
-}
-
-static
-rc_t CC KStreamFromFilesRead ( const KStreamFromFiles *cself,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = KFileRead ( cself -> in, cself -> in_pos, buffer, bsize, num_read );
-    if ( rc == 0 )
-    {
-        KStreamFromFiles *self = ( KStreamFromFiles* ) cself;
-        self -> in_pos += * num_read;
-    }
-
-    return rc;
-}
-
-static
-rc_t CC KStreamFromFilesWrite ( KStreamFromFiles *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc = KFileWrite ( self -> out, self -> out_pos, buffer, size, num_writ );
-    if ( rc == 0 )
-        self -> out_pos += * num_writ;
-
-    return rc;
-}
-
-/* the vtable */
-static KStream_vt_v1 vtKStreamFromFiles =
-{
-    1, 0,
-    KStreamFromFilesWhack,
-    KStreamFromFilesRead,
-    KStreamFromFilesWrite
-};
-
-
-/* FromKFilePair
- *  create a KStream from a pair of KFiles
- *  maintains a "pos" marker for input and output files
- *
- *  "strm" [ OUT ] - resultant KStream
- *
- *  "read" [ IN, NULL OKAY ] - file to use for stream reading
- *
- *  "write" [ IN, NULL OKAY ] - file to use for stream writing
- *
- * NB - EITHER "read" or "write" may be NULL, but not both.
- */
-LIB_EXPORT rc_t CC KStreamFromKFilePair ( KStream **strm,
-    const KFile *read, KFile *write )
-{
-    rc_t rc;
-
-    if ( strm == NULL )
-        rc = RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-    else
-    {
-        bool can_read = ( read == NULL ) ? false : read -> read_enabled;
-        bool can_write = ( write == NULL ) ? false : write -> write_enabled;
-
-        if ( ! can_read && ! can_write )
-            rc = RC ( rcNS, rcStream, rcConstructing, rcFile, rcNoPerm );
-        else
-        {
-            KStreamFromFiles *sff = calloc ( 1, sizeof *sff );
-            if ( sff == NULL )
-                rc = RC ( rcNS, rcStream, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KStreamInit ( & sff -> dad, ( const KStream_vt* ) & vtKStreamFromFiles, 
-                                   "KStreamFromFilePair", "adapter", can_read, can_write );
-                if ( rc == 0 )
-                {
-                    rc = KFileAddRef ( read );
-                    if ( rc == 0 )
-                    {
-                        rc = KFileAddRef ( write );
-                        if ( rc ==  0 )
-                        {
-                            sff -> in = read;
-                            sff -> out = write;
-                            *strm = & sff -> dad;
-
-                            return 0;
-                        }
-
-                        KFileRelease ( read );
-                    }
-                }
-
-                free ( sff );
-            }
-        }
-
-        *strm = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kns/stream-from-streams.c b/libs/kns/stream-from-streams.c
deleted file mode 100644
index a788403..0000000
--- a/libs/kns/stream-from-streams.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-typedef struct KStreamFromStreams KStreamFromStreams;
-#define KSTREAM_IMPL KStreamFromStreams
-
-#include <kns/extern.h>
-#include <kns/stream.h>
-#include <kns/impl.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include "stream-priv.h"
-
-/* the object structure for THIS implementation */
-struct  KStreamFromStreams
-{
-    /* THIS MUST COME FIRST */
-    KStream dad;
-
-    const KStream *in;
-    KStream *out;
-};
-
-
-/* the required methods */
-
-static
-rc_t CC KStreamFromStreamsWhack ( KStreamFromStreams *self )
-{
-    KStreamRelease ( self -> in );
-    KStreamRelease ( self -> out );
-    free ( self );
-    return 0;
-}
-
-static
-rc_t CC KStreamFromStreamsRead ( const KStreamFromStreams *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    return KStreamRead ( self -> in, buffer, bsize, num_read );
-}
-
-static
-rc_t CC KStreamFromStreamsWrite ( KStreamFromStreams *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    return KStreamWrite ( self -> out, buffer, size, num_writ );
-}
-
-/* the vtable */
-static KStream_vt_v1 vtKStreamFromStreams =
-{
-    1, 0,
-    KStreamFromStreamsWhack,
-    KStreamFromStreamsRead,
-    KStreamFromStreamsWrite
-};
-
-
-/* FromKStreamPair
- *  create a KStream from a pair of KStreams
- *
- *  "strm" [ OUT ] - resultant KStream
- *
- *  "read" [ IN, NULL OKAY ] - stream to use for input
- *
- *  "write" [ IN, NULL OKAY ] - stream to use for output
- *
- * NB - EITHER "read" or "write" may be NULL, but not both.
- */
-LIB_EXPORT rc_t CC KStreamFromKStreamPair ( KStream **strm,
-    const KStream *read, KStream *write )
-{
-    rc_t rc;
-
-    if ( strm == NULL )
-        rc = RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-    else
-    {
-        bool can_read = ( read == NULL ) ? false : read -> read_enabled;
-        bool can_write = ( write == NULL ) ? false : write -> write_enabled;
-
-        if ( ! can_read && ! can_write )
-            rc = RC ( rcNS, rcStream, rcConstructing, rcStream, rcNoPerm );
-        else
-        {
-            KStreamFromStreams *sfs = calloc ( 1, sizeof *sfs );
-            if ( sfs == NULL )
-                rc = RC ( rcNS, rcStream, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KStreamInit ( & sfs -> dad, ( const KStream_vt* ) & vtKStreamFromStreams, 
-                                   "KStreamFromStreamPair", "adapter", can_read, can_write );
-                if ( rc == 0 )
-                {
-                    rc = KStreamAddRef ( read );
-                    if ( rc == 0 )
-                    {
-                        rc = KStreamAddRef ( write );
-                        if ( rc ==  0 )
-                        {
-                            sfs -> in = read;
-                            sfs -> out = write;
-                            *strm = & sfs -> dad;
-
-                            return 0;
-                        }
-
-                        KStreamRelease ( read );
-                    }
-                }
-
-                free ( sfs );
-            }
-        }
-
-        *strm = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/kns/stream-priv.h b/libs/kns/stream-priv.h
deleted file mode 100644
index 6919869..0000000
--- a/libs/kns/stream-priv.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-/* VDB.v2 is end of life, and introducing new object types is
-   dangerous. For our purposes, just call a stream a file */
-#ifndef rcStream
-#define rcStream rcFile
-#endif
-
-#ifndef rcUrl
-#define rcUrl rcPath
-#endif
diff --git a/libs/kns/stream.c b/libs/kns/stream.c
deleted file mode 100644
index b63e267..0000000
--- a/libs/kns/stream.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/extern.h>
-#include <kns/impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "stream-priv.h"
-
-
-/*--------------------------------------------------------------------------
- * KStream
- *  a file
- */
-
-/* Destroy
- *  destroy stream
- */
-static
-rc_t KStreamDestroy ( KStream *self )
-{
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcDestroying, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . destroy ) ( self );
-    }
-
-    return RC ( rcNS, rcStream, rcDestroying, rcInterface, rcBadVersion );
-}
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KStreamAddRef ( const KStream *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KStream" ) )
-        {
-        case krefLimit:
-            return RC ( rcNS, rcStream, rcAttaching, rcRange, rcExcessive );
-        case krefNegative:
-            return RC ( rcNS, rcStream, rcAttaching, rcSelf, rcInvalid );
-        default:
-            break;
-        }
-    }
-    return 0;
-}
-
-/* Release
- *  discard reference to file
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KStreamRelease ( const KStream *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KStream" ) )
-        {
-        case krefWhack:
-            return KStreamDestroy ( ( KStream* ) self );
-        case krefNegative:
-            return RC ( rcNS, rcStream, rcReleasing, rcRange, rcExcessive );
-        default:
-            break;
-        }
-    }
-
-    return 0;
-}
-
-/* Read
- *  read data from stream
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of stream.
- */
-LIB_EXPORT rc_t CC KStreamRead ( const KStream *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    if ( num_read == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcParam, rcNull );
-
-    * num_read = 0;
-
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcNS, rcStream, rcReading, rcStream, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcBuffer, rcNull );
-    if ( bsize == 0 )
-        return RC ( rcNS, rcStream, rcReading, rcBuffer, rcInsufficient );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . read ) ( self, buffer, bsize, num_read );
-    }
-
-    return RC ( rcNS, rcStream, rcReading, rcInterface, rcBadVersion );
-}
-
-/* ReadAll
- *  read from stream until "bsize" bytes have been retrieved
- *  or until end-of-input
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT ] - return parameter giving number of bytes
- *  actually read. when returned value is zero and return code is
- *  also zero, interpreted as end of stream.
- */
-LIB_EXPORT rc_t CC KStreamReadAll ( const KStream *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    uint8_t *b;
-    size_t total, count;
-
-    if ( num_read == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcParam, rcNull );
-
-    * num_read = 0;
-
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcSelf, rcNull );
-
-    if ( ! self -> read_enabled )
-        return RC ( rcNS, rcStream, rcReading, rcStream, rcNoPerm );
-
-    if ( buffer == NULL )
-        return RC ( rcNS, rcStream, rcReading, rcBuffer, rcNull );
-    if ( bsize == 0 )
-        return RC ( rcNS, rcStream, rcReading, rcBuffer, rcInsufficient );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        for ( rc = 0, b = buffer, total = 0; total < bsize; total += count )
-        {
-            count = 0;
-            rc = ( * self -> vt -> v1 . read ) ( self, b + total, bsize - total, & count );
-            if ( rc != 0 )
-                break;
-            if ( count == 0 )
-                break;
-        }
-        break;
-    default:
-        return RC ( rcNS, rcStream, rcReading, rcInterface, rcBadVersion );
-    }
-
-    if ( total != 0 )
-    {
-        * num_read = total;
-        return 0;
-    }
-
-    return rc;
-}
-
-/* Write
- *  send data to stream
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-LIB_EXPORT rc_t CC KStreamWrite ( KStream *self,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    size_t ignore;
-    if ( num_writ == NULL )
-        num_writ = & ignore;
-
-    * num_writ = 0;
-
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcWriting, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcNS, rcStream, rcWriting, rcStream, rcNoPerm );
-
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcNS, rcStream, rcWriting, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . write ) ( self, buffer, size, num_writ );
-    }
-
-    return RC ( rcNS, rcStream, rcWriting, rcInterface, rcBadVersion );
-}
-
-/* WriteAll
- *  write to stream until "size" bytes have been transferred
- *  or until no further progress can be made
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-LIB_EXPORT rc_t CC KStreamWriteAll ( KStream *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    const uint8_t *b;
-    size_t total, count;
-
-    size_t ignore;
-    if ( num_writ == NULL )
-        num_writ = & ignore;
-
-    * num_writ = 0;
-
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcWriting, rcSelf, rcNull );
-
-    if ( ! self -> write_enabled )
-        return RC ( rcNS, rcStream, rcWriting, rcStream, rcNoPerm );
-
-    if ( size == 0 )
-        return 0;
-    if ( buffer == NULL )
-        return RC ( rcNS, rcStream, rcWriting, rcBuffer, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        for ( rc = 0, b = buffer, total = 0; total < size; total += count )
-        {
-            count = 0;
-            rc = ( * self -> vt -> v1 . write ) ( self, b + total, size - total, & count );
-            if ( rc != 0 )
-                break;
-            if ( count == 0 )
-                break;
-        }
-        break;
-    default:
-        return RC ( rcNS, rcStream, rcWriting, rcInterface, rcBadVersion );
-    }
-
-    * num_writ = total;
-    if ( total == size )
-        return 0;
-    if ( rc == 0 )
-        return RC ( rcNS, rcStream, rcWriting, rcTransfer, rcIncomplete );
-    return rc;
-}
-
-
-/* Init
- *  initialize a newly allocated stream object
- */
-LIB_EXPORT rc_t CC KStreamInit ( KStream *self, const KStream_vt *vt,
-    const char *classname, const char *strname,
-    bool read_enabled, bool write_enabled )
-{
-    if ( self == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcSelf, rcNull );
-    if ( vt == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcInterface, rcNull );
-    switch ( vt -> v1 . maj )
-    {
-    case 0:
-        return RC ( rcNS, rcStream, rcConstructing, rcInterface, rcInvalid );
-
-    case 1:
-        switch ( vt -> v1 . min )
-        {
-            /* ADD NEW MINOR VERSION CASES HERE */
-        case 0:
-#if _DEBUGGING
-        if ( vt -> v1 . write == NULL         ||
-             vt -> v1 . read == NULL          ||
-             vt -> v1 . destroy == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcInterface, rcNull );
-#endif
-            break;
-        default:
-            return RC ( rcNS, rcStream, rcConstructing, rcInterface, rcBadVersion );
-        }
-        break;
-
-    default:
-        return RC ( rcNS, rcStream, rcConstructing, rcInterface, rcBadVersion );
-    }
-
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, classname, "init", strname );
-    self -> read_enabled = ( uint8_t ) ( read_enabled != 0 );
-    self -> write_enabled = ( uint8_t ) ( write_enabled != 0 );
-
-    return 0;
-}
diff --git a/libs/kns/unix/sysendpoint.c b/libs/kns/unix/sysendpoint.c
deleted file mode 100644
index 2902cc5..0000000
--- a/libs/kns/unix/sysendpoint.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/impl.h>
-#include <kns/endpoint.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-
-#include "stream-priv.h"
-
-#include <string.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <assert.h>
-
-#include <sysalloc.h>
-
-extern int h_errno;
-
-/* InitDNSEndpoint
- *  initialize the endpoint with a DNS name and a port number
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "dns" [ IN ] - textual DNS address.
- *
- *  "port" [ IN, DEFAULT 0 ] - binary port number in native integer byte order.
- *   if the special port number 0 is given, it represents any available port.
- */
-LIB_EXPORT
-rc_t CC KNSManagerInitDNSEndpoint ( struct KNSManager const *self,
-    KEndPoint *ep, struct String const *dns, uint16_t port )
-{
-    rc_t rc;
-
-    if ( ep == NULL )
-        rc = RC (rcNS, rcNoTarg, rcInitializing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcNull );
-        else if ( dns == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcParam, rcNull );
-        else if ( dns -> size == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcInsufficient );
-        else
-        {
-            size_t size;
-            char hostname [ 4096 ];
-            if ( dns -> size >= sizeof hostname )
-            {
-                KDataBuffer b;
-                rc = KDataBufferMakeBytes ( & b, dns -> size + 1 );
-                if ( rc == 0 )
-                {
-                    struct hostent *remote;
-                    char *host = b . base;
-
-                    rc = string_printf ( host, ( size_t ) b . elem_count, & size, "%S", dns );
-                    assert ( size < ( size_t ) b . elem_count );
-                    assert ( host [ size ] == 0 );
-                    remote = gethostbyname ( host );
-                    if ( remote != NULL )
-                    { 
-						ep -> type = epIPV4;
-                        memcpy ( &ep -> u . ipv4 . addr, remote -> h_addr_list [ 0 ], sizeof ep -> u . ipv4 . addr );
-                        ep -> u . ipv4 . port = ( uint16_t ) port;
-                        KDataBufferWhack ( & b );
-                        return 0;
-                    }
-                    else switch ( h_errno )
-                    {
-                    case HOST_NOT_FOUND: /* The specified host is unknown */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcNotFound );
-                        break;
-                    case NO_ADDRESS: /* The requested names valid but does not have an IP address */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcInconsistent );
-                        break;
-#if ! defined NO_ADDRESS || ! defined NO_DATA || NO_ADDRESS != NO_DATA
-                    case NO_DATA: /* The requested name s valid but does not have an IP address */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcEmpty );
-                        break;
-#endif
-                    case NO_RECOVERY: /* A nonrecoverable name server error occured */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                        break;
-                    case TRY_AGAIN: /* A temporary error occured on an authoritative name server. Try again later */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcBusy );
-                        break;
-                    default :
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                    }
-                        
-                }
-            }
-            else
-            {
-                struct hostent *remote;
-
-                rc = string_printf ( hostname, sizeof hostname, & size, "%S", dns );
-                assert ( size < sizeof hostname );
-                assert ( hostname [ size ] == 0 );
-                remote = gethostbyname ( hostname );
-                if ( remote != NULL )
-                {
-					ep -> type = epIPV4;
-                    memcpy ( &ep -> u . ipv4 . addr, remote -> h_addr_list [ 0 ], sizeof ep -> u . ipv4 . addr );
-                    ep -> u . ipv4 . port = ( uint16_t ) port;
-                    return 0;
-                }
-                else switch ( h_errno )
-                {
-                    case HOST_NOT_FOUND: /* The specified host is unknown */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcNotFound );
-                        break;
-                    case NO_ADDRESS: /* The requested names valid but does not have an IP address */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcInconsistent );
-                        break;
-#if ! defined NO_ADDRESS || ! defined NO_DATA || NO_ADDRESS != NO_DATA
-                    case NO_DATA: /* The requested name s valid but does not have an IP address */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcEmpty );
-                        break;
-#endif
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcEmpty );
-                        break;
-                    case NO_RECOVERY: /* A nonrecoverable name server error occured */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                        break;
-                    case TRY_AGAIN: /* A temporary error occured on an authoritative name server. Try again later */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcBusy );
-                        break;
-                    default :
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                }
-            }
-        }
-
-        memset ( ep, 0, sizeof * ep );        
-    }
-
-    return rc;
-    
-    
-}
diff --git a/libs/kns/unix/sysmgr.c b/libs/kns/unix/sysmgr.c
deleted file mode 100644
index 702675b..0000000
--- a/libs/kns/unix/sysmgr.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "kns_mgr_priv.h"
-
-rc_t KNSManagerInit ( struct KNSManager *self )
-{
-    return 0;
-} 
-
-void KNSManagerCleanup ( struct KNSManager *self )
-{
-}
diff --git a/libs/kns/unix/syssock.c b/libs/kns/unix/syssock.c
deleted file mode 100644
index 9244ba5..0000000
--- a/libs/kns/unix/syssock.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-#define KSTREAM_IMPL KSocket
-typedef struct KSocket KSocket;
-
-#include <kns/extern.h>
-#include <kns/manager.h>
-#include <kns/socket.h>
-#include <kns/impl.h>
-#include <kns/endpoint.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-
-#include "stream-priv.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <unistd.h>
-#include <errno.h>
-#include <pwd.h>
-
-/*--------------------------------------------------------------------------
- * KSocket
- *  a socket IS a stream
- *
- *  in Berkeley socket terminology, a STREAM implies a CONTINUOUS stream,
- *  which is implemented by the TCP connection. A "chunked" or discontiguous
- *  stream would be a datagram stream, implemented usually by UDP.
- *
- *  in VDB terminology, a STREAM is a fluid, moving target that is observed
- *  from a stationary point, whereas a FILE or OBJECT is a static stationary
- *  target observed from a movable window. This means that a STREAM cannot be
- *  addressed randomly, whereas a FILE or OBJECT can.
- */
-struct KSocket
-{
-    KStream dad;
-    int fd;
-    char* path;
-};
-
-LIB_EXPORT rc_t CC KSocketAddRef( struct KSocket *self )
-{
-    return KStreamAddRef(&self->dad);
-}
-
-LIB_EXPORT rc_t CC KSocketRelease( struct KSocket *self )
-{
-    return KStreamRelease(&self->dad);
-}
-
-LIB_EXPORT
-rc_t CC KSocketWhack ( KSocket *self )
-{
-
-    assert ( self != NULL );
-
-    shutdown ( self -> fd, SHUT_WR );
-    
-    while ( 1 ) 
-    {
-        char buffer [ 1024 ];
-        ssize_t result = recv ( self -> fd, buffer, sizeof buffer, 0 );
-        if ( result <= 0 )
-            break;
-    }
-    shutdown ( self ->fd, SHUT_RD );
-
-    close ( self -> fd );
-
-    if (self->path)
-    {
-        unlink(self->path);
-        free(self->path);
-    }
-        
-    free ( self );
-
-    return 0;
-}
-
-static
-rc_t HandleErrno()
-{
-    int lerrno;
-    rc_t rc = 0;
-    
-    switch ( lerrno = errno )
-    {
-    case EACCES: /* write permission denied */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcUnauthorized );            
-        break;
-    case EADDRINUSE: /* address is already in use */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcExists );
-        break;
-    case EADDRNOTAVAIL: /* requested address was not local */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcNotFound );
-        break;
-    case EAGAIN: /* no more free local ports or insufficient rentries in routing cache */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcExhausted );            
-        break;
-    case EAFNOSUPPORT: /* address didnt have correct address family in ss_family field */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcName, rcError );            
-        break;
-    case EALREADY: /* socket is non blocking and a previous connection has not yet completed */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-        break;
-    case EBADF: /* invalid sock fd */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInvalid );
-        break;
-    case ECONNREFUSED: /* remote host refused to allow network connection */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case ECONNRESET: /* connection reset by peer */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case EDESTADDRREQ: /* socket is not connection-mode and no peer address set */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInvalid );
-        break;
-    case EFAULT: /* buffer pointer points outside of process's adress space */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcOutofrange );
-        break;
-    case EINPROGRESS: /* call is in progress */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-        break;
-    case EINTR: /* recv interrupted before any data available */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case EINVAL: /* invalid argument */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcParam, rcInvalid );
-        break;
-    case EISCONN: /* connected already */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcExists );
-        break;
-    case ELOOP: /* too many symbolic links in resolving addr */
-        rc = RC ( rcNS, rcNoTarg, rcResolving, rcLink, rcExcessive );
-        break;
-    case EMFILE: /* process file table overflow */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        break;
-    case EMSGSIZE: /* msg size too big */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMessage, rcExcessive );
-        break;
-    case ENAMETOOLONG: /* addr name is too long */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcName, rcExcessive );
-        break;
-    case ENETUNREACH: /* network is unreachable */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcNotAvailable );
-        break;
-    case ENOBUFS: /* output queue for a network connection was full. 
-                     ( wont typically happen in linux. Packets are just silently dropped */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcInterrupted );
-        break;
-    case ENOENT: /* file does not exist */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcNotFound );
-        break;
-    case ENOMEM: /* Could not allocate memory */
-        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcError );
-        break;
-    case ENOTCONN: /* socket has not been connected */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcInvalid );
-        break;
-    case ENOTDIR: /* component of path is not a directory */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcDirEntry, rcError );
-        break;
-    case ENOTSOCK: /* sock fd does not refer to socket */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInvalid );
-        break;
-    case EOPNOTSUPP: /* bits in flags argument is inappropriate */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcParam, rcInvalid );
-        break;
-    case EPERM:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcUnauthorized );            
-        break;
-    case EPIPE: /* local end has been shut down. Will also receive SIGPIPE or MSG_NOSIGNAL */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case EPROTONOSUPPORT: /* specified protocol is not supported */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        break;
-    case EROFS: /* socket inode on read only file system */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcReadonly );
-        break;
-    case ETIMEDOUT: /* timeout */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcNotAvailable );
-        break;
-#if ! defined EAGAIN || ! defined EWOULDBLOCK || EAGAIN != EWOULDBLOCK
-    case EWOULDBLOCK:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcError );
-        break;
-#endif
-    default:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(S)($(E))'",
-                  "S=%!,E=%d", lerrno, lerrno));
-    }
-
-    return rc;
-}
-
-static
-rc_t CC KSocketRead ( const KSocket *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-    assert ( self != NULL );
-
-    while ( rc == 0 )
-    {
-        ssize_t count = recv ( self -> fd, buffer, bsize, 0 );
-
-        if ( count >= 0 )
-        {
-            assert ( num_read != NULL );
-            * num_read = ( size_t ) count;
-            return 0;
-        }
-        rc = HandleErrno();
-    }
-            
-    return rc;
-}
-
-static
-rc_t CC KSocketWrite ( KSocket *self,
-    const void *buffer, size_t bsize, size_t *num_writ )
-{
-    rc_t rc = 0;
-    assert ( self != NULL );
-
-    while ( rc == 0 )
-    {
-        ssize_t count = send ( self -> fd, buffer, bsize, 0 );
-        if ( count >= 0 )
-        {
-            assert ( num_writ != NULL );
-            * num_writ = count;
-            return 0;
-        }
-        rc = HandleErrno();
-    }
-
-    return rc;
-}
-
-static KStream_vt_v1 vtKSocket =
-{
-    1, 0,
-    KSocketWhack,
-    KSocketRead,
-    KSocketWrite
-};
-
-static
-rc_t MakeSocketPath(const char* name, char* buf, size_t buf_size)
-{
-    size_t num_writ;
-    /*struct passwd* pwd;
-    pwd = getpwuid(geteuid());
-    if (pwd == NULL)
-        return HandleErrno();
-    return string_printf(buf, buf_size, &num_writ, "%s/.ncbi/%s", pwd->pw_dir, name);*/
-    return string_printf(buf, buf_size, &num_writ, "%s/.ncbi/%s", getenv("HOME"), name);
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeConnection ( KStream **out, const KEndPoint *from, const KEndPoint *to )
-{
-    rc_t rc;
-    int fd;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( to == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( (from != NULL && from->type != epIPV4) || to->type != epIPV4 )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-        
-    /* create the OS socket */
-    fd = socket ( AF_INET, SOCK_STREAM, 0 );
-    if ( fd != -1 )
-    {
-        struct sockaddr_in ss;
-        memset ( &ss, 0, sizeof ss );
-        ss . sin_family = AF_INET;
-        if ( from != NULL )
-        {
-            ss . sin_port = htons ( from -> u . ipv4 . port );
-            ss . sin_addr . s_addr = htonl ( from -> u . ipv4 . addr );
-        }
-        if ( bind ( fd, (struct sockaddr *)&ss, sizeof ss ) == 0) 
-        {
-            memset ( & ss, 0, sizeof ss );
-            ss . sin_family = AF_INET;
-            ss . sin_port = htons ( to -> u . ipv4 . port );
-            ss . sin_addr . s_addr = htonl ( to -> u . ipv4 . addr );                   
-            if (connect ( fd, (struct sockaddr *)&ss, sizeof ss ) == 0 )
-            {
-                /* create the KSocket */
-                KSocket *ksock = calloc ( sizeof *ksock, 1 );
-                if ( ksock == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-                else
-                {
-                    /* initialize the KSocket */
-                    rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                       "KSocket", "tcp", true, true );
-                    if ( rc == 0 )
-                    {
-                        ksock -> fd = fd;
-                        *out = & ksock -> dad;
-                        return 0;
-                    }
-                    /* free the KSocket */
-                    free ( ksock );
-                }
-            }
-            else /* connect() failed */
-                rc = HandleErrno();
-        }
-        else /* bind() failed */
-            rc = HandleErrno();
-        close(fd);
-    }
-    else /* socket() failed */
-        rc = HandleErrno();
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeIPCConnection ( KStream **out, const KEndPoint *to, uint8_t max_retries )
-{
-    rc_t rc;
-    uint8_t retry_count = 0;
-    struct sockaddr_un ss;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( to == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( to->type != epIPC )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-
-    memset ( & ss, 0, sizeof ss );
-    ss.sun_family = AF_UNIX;
-    rc = MakeSocketPath(to->u.ipc_name, ss.sun_path, sizeof(ss.sun_path));
-    /* create the OS socket */
-    while (rc == 0)
-    {
-        int fd = socket ( AF_UNIX, SOCK_STREAM, 0 );
-        if ( fd != -1 )
-        {
-            if ( connect ( fd, (struct sockaddr *)&ss, sizeof(ss) ) == 0 )
-            {   /* create the KSocket */
-                KSocket *ksock = calloc ( sizeof *ksock, 1 );
-                if ( ksock == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-                else
-                {   /* initialize the KSocket */
-                    rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                       "KSocket", "tcp", true, true );
-                    if ( rc == 0 )
-                    {
-                        ksock -> fd = fd;
-                        *out = & ksock -> dad;
-                        return 0;
-                    }
-                    free(ksock);
-                }
-            }
-            else
-            {
-                rc = HandleErrno();
-                close(fd);
-                
-                if ( retry_count < max_retries && 
-                    (GetRCState(rc) == rcCanceled || GetRCState(rc) == rcNotFound) )
-                {   
-                    sleep(1);
-                    ++retry_count;
-                    rc = 0;
-                    continue;
-                }
-            }
-        }
-        else /* socket() failed */
-            rc = HandleErrno();
-        break;
-    }
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeListener( struct KSocket** out, struct KEndPoint const * ep )
-{   
-    int fd;
-    rc_t rc;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( ep == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( ep->type != epIPC )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-        
-     /* create the OS socket */
-    fd = socket ( AF_UNIX, SOCK_STREAM, 0 );
-    if ( fd >= 0 )
-    {
-        struct sockaddr_un ss;
-        memset ( & ss, 0, sizeof ss );
-        ss.sun_family = AF_UNIX;
-        rc = MakeSocketPath(ep->u.ipc_name, ss.sun_path, sizeof(ss.sun_path));
-        if (rc == 0)
-        {
-            unlink(ss.sun_path);
-            if ( bind( fd,(struct sockaddr *)&ss, sizeof(ss) ) == 0 )
-            {   /* create the KSocket */
-                KSocket *ksock = calloc ( sizeof *ksock, 1 );
-                if ( ksock == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcExhausted ); 
-                else 
-                {
-                    char* path = string_dup(ss.sun_path, string_measure(ss.sun_path, NULL));
-                    if (path == NULL)
-                        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcMemory, rcExhausted ); 
-                    else
-                    {   /* initialize the KSocket */
-                        rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                           "KSocket", "tcp", true, true );
-                        if ( rc == 0 )
-                        {
-                            ksock -> fd = fd;
-                            ksock -> path = path;
-                            *out = ksock;
-                            return 0;
-                        }
-                        free(path);
-                    }
-                    free(ksock);
-                    return rc;
-                }
-            }
-            else /* bind() failed */
-                rc = HandleErrno();
-        }
-        close(fd);
-    }
-    else /* socket() failed */
-        rc = HandleErrno();
-        
-    return rc;
-}
-
-LIB_EXPORT 
-rc_t CC KNSListen ( struct KSocket *listener, struct KStream **out )
-{
-    rc_t rc;
-    
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( listener == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( listen(listener->fd, 5) == 0)
-    {
-        struct sockaddr_un remote;
-        socklen_t t = sizeof(remote);
-        int fd = accept(listener->fd, (struct sockaddr *)&remote, &t);
-        
-        if ( fd != -1) 
-        {
-            KSocket *ksock = calloc ( sizeof *ksock, 1 );
-            if ( ksock == NULL )
-                rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-            else
-            {
-                rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                   "KSocket", "tcp", true, true );
-                if ( rc == 0 )
-                {
-                    ksock -> fd = fd;
-                    *out = &ksock->dad;
-                    return 0;
-                }
-                free(ksock);
-            }
-            close(fd);
-        }
-        else /* accept() failed */
-            rc = HandleErrno();
-    }
-    else /* listen() failed */
-        rc = HandleErrno();
-    return rc;
-}   
-    
-    
-    
diff --git a/libs/kns/unix/sysstream.c b/libs/kns/unix/sysstream.c
deleted file mode 100644
index de03f29..0000000
--- a/libs/kns/unix/sysstream.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-#define KSTREAM_IMPL KStdIOStream
-typedef struct KStdIOStream KStdIOStream;
-
-#include <kns/extern.h>
-#include <kns/stream.h>
-#include <kns/impl.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-
-#include "stream-priv.h"
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KStdIOStream
- *  a virtual stream
- */
-struct KStdIOStream
-{
-    KStream dad;
-    int fd;
-};
-
-static
-rc_t CC KStdIOStreamWhack ( KStdIOStream *self )
-{
-    /* we don't close self->fd because we did not open it */
-    free ( self );
-    return 0;
-}
-
-static
-rc_t CC KStdIOStreamRead ( const KStdIOStream *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc;
-    assert ( self != NULL );
-
-    while ( 1 )
-    {
-        int lerrno;
-
-        ssize_t count = read ( self -> fd, buffer, bsize );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case ENOSPC:
-            rc = RC ( rcNS, rcStream, rcReading, rcStorage, rcExhausted );
-            LOGERR (klogSys, rc, "system device full error");
-            return rc;
-
-        case EINTR:
-            continue;
-
-        case EFBIG:
-            rc = RC ( rcNS, rcStream, rcReading, rcStream, rcExcessive );
-            LOGERR (klogErr, rc, "system file too big error");
-            return rc;
-
-        case EIO:
-            rc = RC ( rcNS, rcStream, rcReading, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error - broken pipe");
-            return rc;
-            
-        case EBADF:
-            rc = RC ( rcNS, rcStream, rcReading, rcFileDesc, rcInvalid );
-            PLOGERR (klogInt,
-                     (klogInt, rc, "system bad file descriptor error fd=$(F)",
-                      "F=%d", lerrno, self->fd));
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcNS, rcStream, rcReading, rcParam, rcInvalid );
-            LOGERR (klogInt, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcNS, rcStream, rcReading, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error '$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_read != NULL );
-        * num_read = count;
-        break;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC KStdIOStreamWrite ( KStdIOStream *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    rc_t rc;
-    assert ( self != NULL );
-
-    while ( 1 )
-    {
-        int lerrno;
-
-        ssize_t count = write ( self -> fd, buffer, size );
-
-        if ( count < 0 ) switch ( lerrno = errno )
-        {
-        case ENOSPC:
-            rc = RC ( rcNS, rcStream, rcWriting, rcStorage, rcExhausted );
-            LOGERR (klogSys, rc, "system device full error");
-            return rc;
-
-        case EINTR:
-            continue;
-
-        case EFBIG:
-            rc = RC ( rcNS, rcStream, rcWriting, rcStream, rcExcessive );
-            LOGERR (klogErr, rc, "system file too big error");
-            return rc;
-
-        case EIO:
-            rc = RC ( rcNS, rcStream, rcWriting, rcTransfer, rcUnknown );
-            LOGERR (klogErr, rc, "system I/O error - broken pipe");
-            return rc;
-            
-        case EBADF:
-            rc = RC ( rcNS, rcStream, rcWriting, rcFileDesc, rcInvalid );
-            PLOGERR (klogInt,
-                     (klogInt, rc, "system bad file descriptor error fd=$(F)",
-                      "F=%d", lerrno, self->fd));
-            return rc;
-
-        case EINVAL:
-            rc = RC ( rcNS, rcStream, rcWriting, rcParam, rcInvalid );
-            LOGERR (klogInt, rc, "system invalid argument error");
-            return rc;
-
-        default:
-            rc = RC ( rcNS, rcStream, rcWriting, rcNoObj, rcUnknown );
-            PLOGERR (klogErr,
-                     (klogErr, rc, "unknown system error '$(S)($(E))'",
-                      "S=%!,E=%d", lerrno, lerrno));
-            return rc;
-        }
-
-        assert ( num_writ != NULL );
-        * num_writ = count;
-        break;
-    }
-
-    return 0;
-}
-
-static KStream_vt_v1 vtKStdIOStream =
-{
-    1, 0,
-    KStdIOStreamWhack,
-    KStdIOStreamRead,
-    KStdIOStreamWrite
-};
-
-
-static
-rc_t KStdIOStreamMake ( KStream **sp, int fd, const char *strname,
-    bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-
-    if ( sp == NULL )
-        rc = RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KStdIOStream *s = calloc ( sizeof *s, 1 );
-        if ( s == NULL )
-            rc = RC ( rcNS, rcStream, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KStreamInit ( & s -> dad, ( const KStream_vt* ) & vtKStdIOStream,
-                               "KStdIOStream", strname, read_enabled, write_enabled );
-            if ( rc == 0 )
-            {
-                s -> fd = fd;
-                * sp = & s -> dad;
-                return 0;
-            }
-
-            free ( s );
-        }
-
-        * sp = NULL;
-    }
-
-    return rc;
-}
-
-/* MakeStdIn
- *  creates a read-only stream on stdin
- */
-LIB_EXPORT rc_t CC KStreamMakeStdIn ( const KStream **std_in )
-{
-    return KStdIOStreamMake ( ( KStream** ) std_in, 0, "stdin", true, false );
-}
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only stream on stdout or stderr
- */
-LIB_EXPORT rc_t CC KStreamMakeStdOut ( KStream **std_out )
-{
-    return KStdIOStreamMake ( std_out, 1, "stdout", false, true );
-}
-
-LIB_EXPORT rc_t CC KStreamMakeStdErr ( KStream **std_err )
-{
-    return KStdIOStreamMake ( std_err, 2, "stderr", false, true );
-}
diff --git a/libs/kns/url-fetcher-curl.c b/libs/kns/url-fetcher-curl.c
deleted file mode 100644
index 12c7073..0000000
--- a/libs/kns/url-fetcher-curl.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/extern.h>
-#include <klib/rc.h>
-#include <kns/manager.h>
-#include <kns/url-fetcher.h>
-
-/* IMPORTANT define this before including the *-impl.h !!!! */
-#define KURL_FETCHER_IMPL KUrlFetcherCurl
-#include "url-fetcher-impl.h"
-
-#include "kns_mgr_priv.h"
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-/*
-#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
-*/
-
-/*--------------------------------------------------------------------------
- * KVectorNamelist ... a generic Namelist based on a Vector
- */
-struct KUrlFetcherCurl
-{
-    KUrlFetcher dad;
-
-    struct KNSManager *kns_mgr;
-    CURL *curl_handle;
-
-    /* this buffer is passed in from read() to the callback 
-       it is owned by the caller not this class */
-    char *buff;
-    size_t buffsize;
-    size_t in_buff;
-    
-    /* this is the spill-over buffer, used by the callback
-       if the caller-provided buffer is too small */
-    char *spill_over_buff;
-    size_t spill_over_buffsize;
-};
-
-/* implementation of the the virtual KUrlFetcher-Interface for curl */
-
-static
-rc_t CC KUrlFetcherCurlDestroy ( KUrlFetcherCurl *self )
-{
-    self->kns_mgr->curl_easy_cleanup_fkt( self -> curl_handle );
-    KNSManagerRelease( self->kns_mgr );
-
-    if ( self -> spill_over_buff != NULL )
-        free( self -> spill_over_buff );
-    free ( self );
-    return 0;
-}
-
-static
-size_t CC KUrlFetcherCurlCallback( void *ptr, size_t size, size_t nmemb, void *data )
-{
-    size_t given_bytes = size * nmemb; /* calculate the size given in ptr */
-    KUrlFetcherCurl *self = ( KUrlFetcherCurl * )data;
-    if ( self != NULL )
-    {
-        if ( ( self -> in_buff + given_bytes ) > self -> buffsize )
-        {
-            /* the caller-provided buffer IS NOT enough... */
-            size_t to_copy = ( self -> buffsize - self -> in_buff );
-            if ( to_copy > 0 )
-            {
-                /* the caller-provided buffer can hold a part of it... */
-                if ( self -> buff )
-                {
-                    memcpy( &( self -> buff [ self -> in_buff ] ), ptr, given_bytes );
-                    self -> in_buff += given_bytes;
-                }
-            }
-            else
-            {
-                /* the spill-over-buffer has to take care of the rest... */
-                size_t remaining = ( given_bytes - to_copy );
-                if ( self -> spill_over_buff == NULL )
-                    self -> spill_over_buff = malloc( remaining );
-                else
-                    self -> spill_over_buff = realloc( self -> spill_over_buff,
-                                                       self -> spill_over_buffsize + remaining );
-                if ( self -> spill_over_buff != NULL )
-                {
-                    memcpy( &( self -> spill_over_buff [ self -> spill_over_buffsize ] ), ptr, remaining );
-                    self -> spill_over_buffsize += remaining;
-                }
-            }
-        }
-        else
-        {
-            /* the caller-provided buffer IS enough... */
-            if ( self -> buff )
-            {
-                memcpy( &( self -> buff [ self -> in_buff ] ), ptr, given_bytes );
-                self -> in_buff += given_bytes;
-            }
-        }
-    }
-    return given_bytes;
-}
-
-
-static
-rc_t CC KUrlFetcherCurlRead( KUrlFetcherCurl *self, const char * uri,
-                          void *dst, size_t to_read, size_t *num_read )
-{
-    CURLcode rcc;
-
-    /* the virtual interface has already checked that self is not NULL */
-    if ( uri == NULL || dst == NULL || to_read == 0 )
-        return RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-
-    self -> buff = dst;
-    self -> buffsize = to_read;
-    self -> in_buff = 0;
-
-    if ( self -> spill_over_buff != NULL )
-        free( self -> spill_over_buff );
-    self -> spill_over_buff = NULL;
-    self -> spill_over_buffsize = 0;
-
-    if ( self -> curl_handle == NULL )
-        return RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-
-    rcc = self->kns_mgr->curl_easy_setopt_fkt( self -> curl_handle, CURLOPT_URL, uri );
-    if ( rcc != CURLE_OK )
-    {
-        if ( num_read ) *num_read = 0;
-        return RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rcc = self->kns_mgr->curl_easy_perform_fkt( self-> curl_handle );
-        if ( rcc != CURLE_OK )
-        {
-            if ( num_read ) *num_read = 0;
-            return RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-        }
-    }
-    
-    if ( num_read )
-        *num_read = self -> in_buff;
-
-    return 0;
-}
-
-static KUrlFetcher_vt_v1 sKUrlFetcherCurl_vt =
-{
-    1, 0,
-    KUrlFetcherCurlDestroy,
-    KUrlFetcherCurlRead,
-};
-
-LIB_EXPORT rc_t CC KUrlFetcherCurlMake( KUrlFetcher **fetcher, const bool verbose )
-{
-    rc_t rc;
-
-    if ( fetcher == NULL )
-        rc = RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KUrlFetcherCurl * tmp;
-        *fetcher = NULL;
-        tmp = malloc( sizeof( * tmp ) );
-        if ( tmp != NULL )
-        {
-            rc = KUrlFetcherInit ( &(tmp)->dad, (const KUrlFetcher_vt*)&sKUrlFetcherCurl_vt );
-            if ( rc != 0 )
-                free( tmp );
-            else
-            {
-                tmp -> buff = NULL;
-                tmp -> buffsize = 0;
-                tmp -> in_buff = 0;
-
-                tmp -> spill_over_buff = NULL;
-                tmp -> spill_over_buffsize = 0;
-
-                rc = KNSManagerMake( &tmp->kns_mgr );
-                if ( rc == 0 )
-                {
-                    tmp -> curl_handle = tmp -> kns_mgr -> curl_easy_init_fkt();
-                    if ( tmp -> curl_handle == NULL )
-                    {
-                        KNSManagerRelease( tmp->kns_mgr );
-                        free( tmp );
-                        rc = RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-                    }
-                    else
-                    {
-                        CURLcode rcc;
-                        
-                        if ( verbose )
-                            tmp -> kns_mgr -> curl_easy_setopt_fkt( tmp -> curl_handle, CURLOPT_VERBOSE , 1 );
-                        
-                        rcc = tmp -> kns_mgr -> curl_easy_setopt_fkt( tmp -> curl_handle, CURLOPT_WRITEFUNCTION, KUrlFetcherCurlCallback );
-                        if ( rcc != CURLE_OK )
-                        {
-                            KNSManagerRelease( tmp -> kns_mgr );
-                            free( tmp );
-                            rc = RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-                        }
-                        else
-                        {
-                            rcc = tmp -> kns_mgr -> curl_easy_setopt_fkt( tmp -> curl_handle, CURLOPT_WRITEDATA, (void *)tmp );
-                            if ( rcc != CURLE_OK )
-                            {
-                                KNSManagerRelease( tmp -> kns_mgr );
-                                free( tmp );
-                                rc = RC ( rcApp, rcFunction, rcConstructing, rcParam, rcNull );
-                            }
-                            else
-                                *fetcher = & tmp -> dad;
-                        }
-                    }
-                }
-            }
-        }
-        else
-            rc = RC( rcApp, rcFunction, rcListing, rcParam, rcNull );
-    }
-    return rc;
-}
diff --git a/libs/kns/url-fetcher-impl.h b/libs/kns/url-fetcher-impl.h
deleted file mode 100644
index 0965bfa..0000000
--- a/libs/kns/url-fetcher-impl.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*--------------------------------------------------------------------------
- * this file contains the private parts (v-table) of a generic url-fetcher
-    the user has to provide 3 things to the fetcher:
-        (1) the url to fetch via vt->set_url()
-        (2) eventually a context pointer via vt->set_context()
-        (3) a callback function via vt->set_callback()
-    before the user can "start" the fetcher:
-        via vt->fetch()
- */
-
-#ifndef _h_url_fetcher_impl_
-#define _h_url_fetcher_impl_
-
-#ifndef _h_kns_extern_
-#include <kns/extern.h>
-#endif
-
-#ifndef _h_kfs_file_
-#include <kfs/file.h>
-#endif
-
-#ifndef _h_url_fetcher_
-#include <kns/url-fetcher.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-typedef union KUrlFetcher_vt KUrlFetcher_vt;
-
-/*--------------------------------------------------------------------------
- * KUrl_fetcher
- *  a virtual url-fetcher
- */
-struct KUrlFetcher
-{
-    const KUrlFetcher_vt *vt;
-    KRefcount refcount;
-};
-
-
-#ifndef KURL_FETCHER_IMPL
-#define KURL_FETCHER_IMPL KUrlFetcher
-#endif
-
-
-typedef struct KUrlFetcher_vt_v1 KUrlFetcher_vt_v1;
-struct KUrlFetcher_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( CC * destroy ) ( KURL_FETCHER_IMPL *self );
-    rc_t ( CC * read ) ( KURL_FETCHER_IMPL *self, const char * uri,
-                      void *dst, size_t to_read, size_t *num_read );
-    rc_t ( CC * get_size ) ( KURL_FETCHER_IMPL *self, size_t *num_size );
-    /* end minor version == 0 */
-};
-
-union KUrlFetcher_vt
-{
-    KUrlFetcher_vt_v1 v1;
-};
-
-/* Init
- */
-KNS_EXTERN rc_t CC KUrlFetcherInit ( KUrlFetcher *self, const KUrlFetcher_vt *vt );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libs/kns/url-fetcher.c b/libs/kns/url-fetcher.c
deleted file mode 100644
index ff9e16b..0000000
--- a/libs/kns/url-fetcher.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/extern.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include "url-fetcher-impl.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-
-/* to define the latest version of the url-fetcher in the vt */
-#define KURLFETCHER_LATEST 1
-
-static const char classname[] = "KUrlFetcher";
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KUrlFetcherAddRef ( const KUrlFetcher *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, classname ) )
-        {
-        case krefLimit:
-            return RC ( rcApp, rcFunction, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Release
- *  discard reference to list
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KUrlFetcherRelease ( const KUrlFetcher *cself )
-{
-    KUrlFetcher *self = ( KUrlFetcher* ) cself;
-    if ( cself != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, classname ) )
-        {
-        case krefWhack:
-            {
-                rc_t rc;
-                switch ( self -> vt -> v1 . maj )
-                {
-                case 1:
-                    rc = ( * self -> vt -> v1 . destroy ) ( self );
-                    break;
-
-                default:
-                    rc = RC ( rcApp, rcFunction, rcReleasing, rcInterface, rcBadVersion );
-                }
-
-                if ( rc != 0 )
-                    KRefcountInit ( & self -> refcount, 1, classname, "failed-release", "orphan" );
-                return rc;
-            }
-        case krefLimit:
-            return RC ( rcApp, rcFunction, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Read
- *  reads data from the internal buffer ...
- */
-LIB_EXPORT rc_t CC KUrlFetcherRead( KUrlFetcher *self, const char * uri,
-                      void *dst, size_t to_read, size_t *num_read )
-{
-    if ( self == NULL )
-        return RC ( rcApp, rcFunction, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . read ) ( self, uri, dst, to_read, num_read );
-    }
-
-    return RC ( rcApp, rcFunction, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* Init
- *  polymorphic parent constructor
- */
-LIB_EXPORT rc_t CC KUrlFetcherInit ( KUrlFetcher *self, const KUrlFetcher_vt *vt )
-{
-    if ( self == NULL || vt == NULL )
-        return RC ( rcApp, rcFunction, rcConstructing, rcSelf, rcNull );
-
-    if ( vt -> v1 . maj == 0 )
-        return RC ( rcApp, rcFunction, rcConstructing, rcInterface, rcInvalid );
-
-    if ( vt -> v1 . maj > KURLFETCHER_LATEST )
-        return RC ( rcApp, rcFunction, rcConstructing, rcInterface, rcBadVersion );
-
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, classname, "initialized", "regular" );
-    return 0;
-}
diff --git a/libs/kns/win/sysendpoint.c b/libs/kns/win/sysendpoint.c
deleted file mode 100644
index 67935ac..0000000
--- a/libs/kns/win/sysendpoint.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kns/impl.h>
-#include <kns/endpoint.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-
-#include <sysalloc.h>
-
-#include "stream-priv.h"
-
-#include <assert.h>
-
-#include <Windows.H>
-
-/* InitDNSEndpoint
- *  initialize the endpoint with a DNS name and a port number
- *
- *  "ep" [ OUT ] - address of endpoint block to be intialized
- *
- *  "dns" [ IN ] - textual DNS address.
- *
- *  "port" [ IN, DEFAULT 0 ] - binary port number in native integer byte order.
- *   if the special port number 0 is given, it represents any available port.
- */
-LIB_EXPORT
-rc_t CC KNSManagerInitDNSEndpoint ( struct KNSManager const *self,
-    KEndPoint *ep, struct String const *dns, uint16_t port )
-{
-    rc_t rc;
-
-    if ( ep == NULL )
-        rc = RC (rcNS, rcNoTarg, rcInitializing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcNull );
-        else if ( dns == NULL )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcParam, rcNull );
-        else if ( dns -> size == 0 )
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcSelf, rcInsufficient );
-        else
-        {
-            int lerrno;
-            size_t size;
-            char hostname [ 4096 ];
-            if ( dns -> size >= sizeof hostname )
-            {
-                KDataBuffer b;
-                
-                rc = KDataBufferMakeBytes ( & b, dns -> size + 1 );
-                if ( rc == 0 )
-                {
-                    struct hostent *remote;
-                    char *host = b . base;
-
-                    rc = string_printf ( host, ( size_t ) b . elem_count, & size, "%S", dns );
-                    assert ( size < ( size_t ) b . elem_count );
-                    assert ( host [ size ] == 0 );
-                    remote = gethostbyname ( host );
-                    if ( remote != NULL )
-                    {
-						ep -> type = epIPV4;
-                        memcpy ( &ep -> u . ipv4 . addr, remote -> h_addr_list [ 0 ], sizeof ep -> u . ipv4 . addr );
-                        ep -> u . ipv4 . port = ( uint16_t ) port;
-                        KDataBufferWhack ( & b );
-                        return 0;
-                    }
-                    else switch ( lerrno = WSAGetLastError () )
-                    {
-                    case WSANOTINITIALISED: /* Must have WSAStartup call */
-                        rc = RC ( rcNS, rcNoTarg, rcInitializing, rcEnvironment, rcUndefined );
-                        break;
-                    case WSAENETDOWN:/* network subsystem failed */
-                        rc = RC ( rcNS, rcNoTarg, rcInitializing, rcNoObj, rcFailed );
-                        break;
-                    case WSAHOST_NOT_FOUND: /* Answer host not found */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcNotFound );
-                        break;
-                    case WSATRY_AGAIN: /* host not found or server failure */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcBusy );
-                        break;
-                    case WSANO_RECOVERY: /* non-recoverable error */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                        break;
-                    case WSANO_DATA: /* name is valid but no data */
-                        rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcEmpty );
-                        break;
-                    case WSAEINPROGRESS: /* call is in progress */
-                        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-                        break;
-                    case WSAEFAULT: /* name paremeter is not valid part of addr space */
-                        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcOutofrange );
-                        break;
-                    case WSAEINTR: /* socket call was calanceled */
-                        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-                        break;
-                    default:
-                        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-                    }
-                }
-            }
-            else
-            {
-                struct hostent *remote;
-            
-                rc = string_printf ( hostname, sizeof hostname, & size, "%S", dns );
-                assert ( size < sizeof hostname );
-                assert ( hostname [ size ] == 0 );
-                remote = gethostbyname ( hostname );
-                if ( remote != NULL )
-                {
-					ep -> type = epIPV4;
-                    memcpy ( &ep -> u . ipv4 . addr, remote -> h_addr_list [ 0 ], sizeof ep -> u . ipv4 . addr );
-                    ep -> u . ipv4 . port = ( uint16_t ) port;
-                    return 0;
-                }
-                else switch ( lerrno = WSAGetLastError () )
-                {
-                case WSANOTINITIALISED: /* Must have WSAStartup call */
-                    rc = RC ( rcNS, rcNoTarg, rcInitializing, rcEnvironment, rcUndefined );
-                    break;
-                case WSAENETDOWN:/* network subsystem failed */
-                    rc = RC ( rcNS, rcNoTarg, rcInitializing, rcNoObj, rcFailed );
-                    break;
-                case WSAHOST_NOT_FOUND: /* Answer host not found */
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcNotFound );
-                    break;
-                case WSATRY_AGAIN: /* host not found or server failure */
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcBusy );
-                    break;
-                case WSANO_RECOVERY: /* non-recoverable error */
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcError );
-                    break;
-                case WSANO_DATA: /* name is valid but no data */
-                    rc = RC ( rcNS, rcNoTarg, rcValidating, rcConnection, rcEmpty );
-                    break;
-                case WSAEINPROGRESS: /* call is in progress */
-                    rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-                    break;
-                case WSAEFAULT: /* name paremeter is not valid part of addr space */
-                    rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcOutofrange );
-                    break;
-                case WSAEINTR: /* socket call was calanceled */
-                    rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-                    break;
-                default:
-                    rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-                }
-            }
-        }
-
-        memset ( ep, 0, sizeof * ep );        
-    }
-
-    return rc;
-    
-    
-}
diff --git a/libs/kns/win/sysmgr.c b/libs/kns/win/sysmgr.c
deleted file mode 100644
index 7d73945..0000000
--- a/libs/kns/win/sysmgr.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "kns_mgr_priv.h"
-
-#include <klib/rc.h>
-
-#include <WINDOWS.H>
-
-rc_t KNSManagerInit ( struct KNSManager *self )
-{
-    rc_t rc = 0;
-    WSADATA wsaData;
-
-    if ( WSAStartup ( MAKEWORD ( 2, 2 ), &wsaData ) != 0 )
-    {
-        int lerrno;
-        switch ( lerrno = WSAGetLastError () )
-        {
-        case WSASYSNOTREADY:
-        case WSAVERNOTSUPPORTED:
-        case WSAEINPROGRESS:
-        case WSAEPROCLIM:
-        case WSAEFAULT:
-        default:
-            rc = RC ( rcNS, rcNoTarg, rcInitializing, rcNoObj, rcError );
-        }
-    }
-    return rc;
-} 
-
-void KNSManagerCleanup ( struct KNSManager *self )
-{
-    WSACleanup ();
-}
diff --git a/libs/kns/win/syssock.c b/libs/kns/win/syssock.c
deleted file mode 100644
index e09df72..0000000
--- a/libs/kns/win/syssock.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-#define KSTREAM_IMPL KSocket
-typedef struct KSocket KSocket;
-
-#include <kns/extern.h>
-#include <kns/manager.h>
-#include <kns/socket.h>
-#include <kns/impl.h>
-#include <kns/endpoint.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-
-#include "stream-priv.h"
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-#if 0
-#define _WINSOCKAPI_
-#define WIN32_LEAN_AND_MEAN
-
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
-#include <WINDOWS.H>
-
-#include <sysalloc.h>
-
-
-#define SHUT_RD 0
-#define SHUT_WR 1
-typedef int ssize_t;
-
-
-
-/*--------------------------------------------------------------------------
- * KSocket
- *  a socket IS a stream
- *
- *  in Berkeley socket terminology, a STREAM implies a CONTINUOUS stream,
- *  which is implemented by the TCP connection. A "chunked" or discontiguous
- *  stream would be a datagram stream, implemented usually by UDP.
- *
- *  in VDB terminology, a STREAM is a fluid, moving target that is observed
- *  from a stationary point, whereas a FILE or OBJECT is a static stationary
- *  target observed from a movable window. This means that a STREAM cannot be
- *  addressed randomly, whereas a FILE or OBJECT can.
- */
-struct KSocket
-{
-    KStream dad;
-    union {
-        SOCKET fd;
-        char pipename[256];
-        HANDLE pipe;
-    } u;
-    enum {isSocket, isIpcListener, isIpcPipeServer, isIpcPipeClient} type;
-    HANDLE listenerPipe;
-};
-
-static rc_t HandleErrno();
-
-LIB_EXPORT rc_t CC KSocketAddRef( struct KSocket *self )
-{
-    return KStreamAddRef(&self->dad);
-}
-
-LIB_EXPORT rc_t CC KSocketRelease( struct KSocket *self )
-{
-    return KStreamRelease(&self->dad);
-}
-
-static
-rc_t CC KSocketWhack ( KSocket *self )
-{
-    rc_t rc = 0;
-    assert ( self != NULL );
-
-    switch (self->type)
-    {
-    case isSocket:
-        {
-            if (shutdown ( self -> u . fd, SHUT_WR ) != -1)
-            {
-                while ( 1 ) 
-                {
-                    char buffer [ 1024 ];
-                    ssize_t result = recv ( self -> u . fd, buffer, sizeof buffer, 0 );
-                    if ( result <= 0 )
-                        break;
-                }
-                if (shutdown ( self -> u . fd, SHUT_RD ) != -1)
-                {
-                    if ( closesocket ( self ->  u . fd ) == SOCKET_ERROR )
-                        rc = RC ( rcNS, rcNoTarg, rcClosing, rcNoObj, rcError );
-                        /* maybe report */
-                }
-                else
-                    rc = HandleErrno();
-            }
-            else
-                rc = HandleErrno();
-        }
-        break;
-    case isIpcListener: /* an unconnected server-side pipe */
-        if (self->listenerPipe != INVALID_HANDLE_VALUE)
-        {   /* !!! In case there is an active call to ConnectNamedPipe() on some thread, "wake" the synchronous named pipe,
-            otherwise DisconnectNamedPipe/CloseHandle will block forever */
-            HANDLE hPipe = CreateFile(self->u.pipename, 
-                                      GENERIC_READ, 
-                                      FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 
-                                      NULL, 
-                                      OPEN_EXISTING, 
-                                      0, 
-                                      NULL);
-            if (hPipe != INVALID_HANDLE_VALUE)
-                CloseHandle(hPipe);
-
-            /* now, Disconnect/Close the original pipe */
-            if (!DisconnectNamedPipe(self->listenerPipe) && rc == 0)
-                rc = HandleErrno();
-            if (!CloseHandle(self->listenerPipe) && rc == 0)
-                rc = HandleErrno();
-        }
-        break;
-    case isIpcPipeServer:
-        {
-            if (!FlushFileBuffers(self->u.pipe))
-                rc = HandleErrno();
-            if (!DisconnectNamedPipe(self->u.pipe) && rc == 0)
-                rc = HandleErrno();
-            if (!CloseHandle(self->u.pipe) && rc == 0)
-                rc = HandleErrno();
-        }
-        break;
-    case isIpcPipeClient:
-        if (!CloseHandle(self->u.pipe))
-            rc = HandleErrno();
-        break;
-    }
-    
-    free ( self );
-
-    return rc;
-}
-
-static
-rc_t HandleErrno()
-{
-    int lerrno;
-    rc_t rc;
-
-    switch ( lerrno = WSAGetLastError() )
-    {
-    case ERROR_FILE_NOT_FOUND:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcFile, rcNotFound);            
-        break;
-    case ERROR_INVALID_HANDLE:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInvalid);            
-        break;
-    case ERROR_INVALID_PARAMETER:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcParam, rcInvalid);            
-        break;
-    case ERROR_PIPE_BUSY:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case WSAEACCES: /* write permission denied */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcUnauthorized );            
-        break;
-    case WSAEADDRINUSE:/* address is already in use */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcExists );
-        break;
-    case WSAEADDRNOTAVAIL: /* requested address was not local */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcNotFound );
-        break;
-    case WSAEAFNOSUPPORT: /* address didnt have correct address family in ss_family field */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcName, rcError );
-        break;
-    case WSAEALREADY: /* socket is non blocking and a previous connection has not yet completed */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-        break;
-    case WSAECONNABORTED: /* virtual circuit terminated. Application should close socket */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInterrupted );
-        break;
-    case WSAECONNREFUSED: /* remote host refused to allow network connection */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case WSAECONNRESET: /* connection reset by peer */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcCanceled );
-        break;
-    case WSAEFAULT: /* name paremeter is not valid part of addr space */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMemory, rcOutofrange );
-        break;
-    case WSAEHOSTUNREACH: /* remote hoste cannot be reached at this time */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcNotAvailable );
-        break;
-    case WSAEINPROGRESS: /* call is in progress */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUndefined );
-        break;
-    case WSAEINVAL: /* invalid argument */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcParam, rcInvalid );
-        break;
-    case WSAEISCONN: /* connected already */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcExists );
-        break;
-    case WSAEMSGSIZE:  /* msg size too big */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcMessage, rcExcessive );
-        break;
-    case WSAENETDOWN:/* network subsystem failed */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcFailed );
-        break;
-    case WSAENETRESET: /* connection broken due to keep-alive activity that 
-                          detected a failure while in progress */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case WSAENETUNREACH: /* network is unreachable */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcNotAvailable );
-        break;
-    case WSAENOBUFS: /* output queue for a network connection was full. 
-                     ( wont typically happen in linux. Packets are just silently dropped */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcInterrupted );
-        break;
-    case ERROR_PIPE_NOT_CONNECTED:
-    case WSAENOTCONN: /* socket is not connected */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcInvalid );
-        break;
-    case WSANOTINITIALISED: /* Must have WSAStartup call */
-        rc = RC ( rcNS, rcNoTarg, rcInitializing, rcEnvironment, rcUndefined );
-        break;
-    case WSAENOTSOCK: /* sock fd is not a socket */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcInvalid );
-        break;
-    case WSAEOPNOTSUPP: /* socket is not stream-style such as SOCK_STREAM */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUnsupported );
-        break;
-    case WSAEPROTONOSUPPORT: /* specified protocol is not supported */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        break;
-    case WSAEPROTOTYPE: /* wrong type of protol for this socket */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUnsupported );
-        break;
-    case WSAEPROVIDERFAILEDINIT: /* service provider failed to initialize */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        break;
-    case WSAESHUTDOWN: /* socket had been shutdown */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUnsupported );
-        break;
-    case WSAESOCKTNOSUPPORT: /* specifified socket type is not supported */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcUnsupported );
-        break;
-    case WSAETIMEDOUT: /* connection dropped because of network failure */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcConnection, rcCanceled );
-        break;
-    case WSAEWOULDBLOCK: /* socket is marked as non-blocking but the recv operation
-                            would block */
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcId, rcError );
-        break;
-
-    case WSAEINTR: /* call was canceled */
-    case WSAEMFILE: /* no more socket fd available */
-    default:
-        rc = RC ( rcNS, rcNoTarg, rcReading, rcNoObj, rcError );
-        PLOGERR (klogErr,
-                 (klogErr, rc, "unknown system error '$(S)($(E))'",
-                  "S=%!,E=%d", lerrno, lerrno));
-    }
-    return rc;
-}
-
-static
-rc_t CC KSocketRead ( const KSocket *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    rc_t rc = 0;
-    assert ( self != NULL );
-
-    while ( rc == 0 )
-    {
-        ssize_t count;
-        if ( self -> type == isSocket)
-            count = recv ( self -> u . fd, buffer, bsize, 0 );
-        else if (!ReadFile( self->u.pipe, buffer, bsize, &count, NULL))
-            count = -1;
-
-        if ( count >= 0 )
-        {
-            assert ( num_read != NULL );
-            * num_read = ( size_t ) count;
-            return 0;
-        }
-        if (WSAGetLastError() != WSAEINTR)
-            rc = HandleErrno();
-        break;
-    }
-            
-    return rc;
-}
-
-static
-rc_t CC KSocketWrite ( KSocket *self,
-    const void *buffer, size_t bsize, size_t *num_writ )
-{
-    rc_t rc = 0;
-    assert ( self != NULL );
-
-    while ( rc == 0 )
-    {
-        ssize_t count;
-        if ( self -> type == isSocket)
-            count = send ( self -> u . fd, buffer, bsize, 0 );
-        else if (!WriteFile( self->u.pipe, buffer, bsize, &count, NULL))
-            count = -1;
-        
-        if ( count >= 0 )
-        {
-            assert ( num_writ != NULL );
-            * num_writ = count;
-            return 0;
-        }
-        if (WSAGetLastError() != WSAEINTR)
-            rc = HandleErrno();
-
-        break;        
-    }
-
-    return rc;
-}
-
-static KStream_vt_v1 vtKSocket =
-{
-    1, 0,
-    KSocketWhack,
-    KSocketRead,
-    KSocketWrite
-};
-
-static
-rc_t KSocketBind ( KSocket *self, const struct sockaddr *ss, size_t addrlen )
-{
-    rc_t rc = 0;
-    
-    if ( bind ( self -> u.fd, ss, addrlen ) == SOCKET_ERROR )
-        rc = HandleErrno();
-
-    return rc;    
-}
-
-
-static
-rc_t KSocketConnect ( KSocket *self, struct sockaddr *ss, size_t addrlen )
-{
-    rc_t rc = 0;
-
-    if ( connect ( self -> u . fd, ss, addrlen ) == SOCKET_ERROR )
-        rc = HandleErrno();
-
-    return rc;    
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeConnection ( KStream **out, const KEndPoint *from, const KEndPoint *to )
-{
-    rc_t rc;
-    int fd;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( to == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( (from != NULL && from->type != epIPV4) || to->type != epIPV4 )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-
-    fd = socket ( AF_INET, SOCK_STREAM, IPPROTO_TCP );
-    if ( fd != INVALID_SOCKET )
-    {
-        struct sockaddr_in ss;
-        memset ( & ss, 0, sizeof ss );
-        ss . sin_family = AF_INET;
-        if ( from != NULL )
-        {
-            ss . sin_port = htons ( from -> u. ipv4 . port );
-            ss . sin_addr . s_addr = htonl ( from -> u . ipv4 . addr );
-        }
-        if ( bind ( fd, (const struct sockaddr*)&ss, sizeof ss  ) != SOCKET_ERROR ) 
-        {
-            ss . sin_port = htons ( to -> u . ipv4 . port );
-            ss . sin_addr . s_addr = htonl ( to -> u . ipv4 . addr );
-            
-            if ( connect ( fd, (const struct sockaddr*)&ss, sizeof ss ) != SOCKET_ERROR )
-            {   /* create the KSocket */
-                KSocket *ksock = calloc ( sizeof *ksock, 1 );
-                if ( ksock == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-                else
-                {
-                    /* initialize the KSocket */
-                    rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                       "KSocket", "tcp", true, true );
-                    if ( rc == 0 )
-                    {
-                        ksock -> type = isSocket;
-                        ksock -> u . fd = fd;
-                        *out = & ksock -> dad;
-                        return 0;
-                    }
-                    free(ksock);
-                }
-                return rc;
-            }
-            else /* connect () failed */
-                rc = HandleErrno();
-        }
-        else /* bind() failed */
-            rc = HandleErrno();
-        close(fd);
-    }
-    else /* socket() failed */
-        rc = HandleErrno();
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeIPCConnection ( KStream **out, const KEndPoint *to, uint8_t max_retries )
-{
-    uint8_t retry_count = 0;
-    rc_t rc;
-    char pipename[256];
-    size_t num_writ;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( to == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if ( to->type != epIPC )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-
-    /* use named pipes to implement unix domain socket - like behavior */
-    rc = string_printf(pipename, sizeof(pipename), &num_writ, "\\\\.\\pipe\\%s", to->u.ipc_name);
-    while (rc == 0)
-    {
-        HANDLE h = CreateFile(pipename,       /* pipe name */
-                              GENERIC_READ |  /* read and write access */
-                                 GENERIC_WRITE, 
-                              0,              /* no sharing */
-                              NULL,           /* default security attributes */
-                              OPEN_EXISTING,  /* opens existing pipe  */
-                              0,              /* default attributes */
-                              NULL);          /* no template file */
-        if ( h != INVALID_HANDLE_VALUE )
-        {   /* create the KSocket */
-            KSocket* ksock;
-
-            DWORD dwMode = PIPE_READMODE_MESSAGE; 
-            if (SetNamedPipeHandleState( 
-                  h,        /* pipe handle */
-                  &dwMode,  /* new pipe mode */
-                  NULL,     /* don't set maximum bytes */
-                  NULL))    /* don't set maximum time */
-            {
-                ksock = calloc ( sizeof *ksock, 1 );
-                if ( ksock == NULL )
-                    rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-                else
-                {   /* initialize the KSocket */
-                    rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                       "KSocket", "tcp", true, true );
-                    if ( rc == 0 )
-                    {
-                        ksock -> type = isIpcPipeClient;
-                        ksock -> u.pipe = h;
-                        *out = & ksock -> dad;
-                        return 0;
-                    }
-                    free ( ksock );
-                }
-            }
-            else
-                rc = HandleErrno();
-        }
-        else if (GetLastError() == ERROR_PIPE_BUSY)
-        {
-            if (!WaitNamedPipe(pipename, NMPWAIT_USE_DEFAULT_WAIT))
-            {   // timeout, try again
-                if ( retry_count < max_retries )
-                {
-                    Sleep(1000);/*ms*/
-                    ++retry_count;
-                    continue;   
-                }
-                rc = HandleErrno();
-            }
-            else
-                continue;
-        }
-        else /* CreateFile() failed */
-        {
-            rc = HandleErrno();
-            
-            if ( retry_count < max_retries && 
-                (GetRCState(rc) == rcCanceled || GetRCState(rc) == rcNotFound) )
-            {   
-                Sleep(1000);/*ms*/
-                ++retry_count;
-                rc = 0;
-                continue;
-            }
-        }
-        break;
-    }
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KNSMakeListener( struct KSocket** out, struct KEndPoint const * ep )
-{   
-    rc_t rc = 0;
-    KSocket* ksock;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( ep == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-
-    if (ep->type != epIPC)
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-    
-    /* use named pipes to implement unix domain socket - like behavior */
-    ksock = calloc ( sizeof *ksock, 1 );
-    if ( ksock == NULL )
-        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-    else
-    {
-        rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                           "KSocket", "tcp", true, true );
-        if ( rc == 0 )
-        {
-            size_t num_writ;
-            rc = string_printf(ksock->u.pipename, sizeof(ksock->u.pipename), &num_writ, "\\\\.\\pipe\\%s", ep->u.ipc_name);
-            if (rc == 0)
-            {
-                ksock -> type = isIpcListener;
-                ksock -> listenerPipe = INVALID_HANDLE_VALUE;
-                *out = ksock;
-                return 0;
-            }
-            KSocketWhack(ksock);
-        }
-        else
-            free ( ksock );
-    }
-        
-    return rc;
-}
-
-LIB_EXPORT 
-rc_t CC KNSListen ( struct KSocket *listener, struct KStream **out )
-{
-    rc_t rc = 0;
-
-    if ( out == NULL )
-        return RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-
-    * out = NULL;
-
-    if ( listener == NULL )
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcNull);
-        
-    if (listener->type != isIpcListener)
-        return RC ( rcNS, rcNoTarg, rcValidating, rcParam, rcInvalid);
-
-    {
-        listener->listenerPipe = CreateNamedPipe(listener->u.pipename,    /* pipe name */
-                                   PIPE_ACCESS_DUPLEX,      /* read/write access  */
-                                   PIPE_TYPE_MESSAGE |      /* message type pipe  */
-                                   PIPE_READMODE_MESSAGE |  /* message-read mode  */
-                                   PIPE_WAIT,               /* blocking mode  */
-                                   PIPE_UNLIMITED_INSTANCES,/* max. instances   */
-                                   1024,                    /* output buffer size  */
-                                   1024,                    /* input buffer size  */
-                                   0,                       /* client time-out  */
-                                   NULL);                   /* default security attribute  */
-        if ( listener->listenerPipe != INVALID_HANDLE_VALUE )
-        {
-            while (1)
-            {   
-                if ( ConnectNamedPipe(listener->listenerPipe, NULL) || 
-                    GetLastError() == ERROR_PIPE_CONNECTED) /* = a client happened to connect between CreateNamePipe and ConnectNamedPipe, we are good */
-                {
-                    KSocket *ksock = calloc ( sizeof *ksock, 1 );
-                    if ( ksock == NULL )
-                        rc = RC ( rcNS, rcNoTarg, rcAllocating, rcNoObj, rcNull ); 
-                    else
-                    {
-                        rc = KStreamInit ( & ksock -> dad, ( const KStream_vt* ) & vtKSocket,
-                                           "KSocket", "tcp", true, true );
-                        if ( rc == 0 )
-                        {
-                            ksock -> type = isIpcPipeServer;
-                            ksock -> u.pipe = listener->listenerPipe;
-                            listener->listenerPipe = INVALID_HANDLE_VALUE; /* this is only to be used while ConnectNamedPipe() is in progress */
-                            *out = & ksock -> dad;
-                            return 0;
-                        }
-                        free ( ksock );
-                    }
-                }
-                else if (GetLastError() == ERROR_NO_DATA) /* no client */
-                {   /* keep on listening */
-                    Sleep(10); /*ms*/
-                }
-                else
-                    break;
-            }
-        }
-    }
-    return HandleErrno();
-}   
-    
-    
-    
diff --git a/libs/kns/win/sysstream.c b/libs/kns/win/sysstream.c
deleted file mode 100644
index 83bdc30..0000000
--- a/libs/kns/win/sysstream.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-#define KSTREAM_IMPL KStdIOStream
-typedef struct KStdIOStream KStdIOStream;
-
-#include <kns/extern.h>
-#include <kns/stream.h>
-#include <kns/impl.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <sysalloc.h>
-
-#include "stream-priv.h"
-
-#include <assert.h>
-
-#include <Windows.h>
-
-/*--------------------------------------------------------------------------
- * KStdIOStream
- *  a virtual stream
- */
-struct KStdIOStream
-{
-    KStream dad;
-    HANDLE fd;
-};
-
-static
-rc_t CC KStdIOStreamWhack ( KStdIOStream *self )
-{
-    /* we don't close self->fd because we did not open it */
-    free ( self );
-    return 0;
-}
-
-static
-rc_t CC KStdIOStreamRead ( const KStdIOStream *self,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    DWORD to_read;
-
-    assert ( self != NULL );
-
-    to_read = ( DWORD ) bsize;
-    if ( ( size_t ) to_read < bsize )
-        to_read = -1;
-
-    while ( 1 )
-    {
-        rc_t rc;
-        DWORD count, lerrno;
-
-        if ( ReadFile ( self -> fd, buffer, to_read, & count, NULL ) )
-        {
-            * num_read = count;
-            break;
-        }
-
-        lerrno = GetLastError ();
-        switch ( lerrno )
-        {
-        case ERROR_HANDLE_EOF:
-            * num_read = 0;
-            break;
-        case ERROR_IO_PENDING:
-            continue;
-        default:
-            rc = RC ( rcNS, rcStream, rcReading, rcNoObj, rcUnknown );
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "unknown system error '$(S)($(E))'",
-                        "S=%!,E=%d", lerrno, lerrno ) );
-            return rc;
-        }
-        break;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC KStdIOStreamWrite ( KStdIOStream *self,
-    const void *buffer, size_t size, size_t *num_writ )
-{
-    DWORD to_write;
-
-    assert ( self != NULL );
-
-    to_write = ( DWORD ) size;
-    if ( ( size_t ) to_write < size )
-        to_write = -1;
-
-    * num_writ = 0;
-
-    while ( 1 )
-    {
-        rc_t rc;
-        DWORD lerrno, count = 0;
-
-        if ( WriteFile ( self -> fd, buffer, to_write, & count, NULL ) == 0 )
-        {
-            * num_writ += count;
-            break;
-        }
-
-        lerrno = GetLastError ();
-        switch ( lerrno )
-        {
-        case ERROR_IO_PENDING:
-            if ( count != 0 )
-            {
-                buffer = & ( ( const char* ) buffer ) [ count ];
-                to_write -= count;
-                * num_writ += count;
-                if ( to_write == 0 )
-                    break;
-            }
-            Sleep ( 100 );
-            continue;
-
-        case ERROR_NOT_ENOUGH_MEMORY:
-            rc = RC ( rcNS, rcStream, rcWriting, rcStorage, rcExhausted );
-            LOGERR ( klogSys, rc, "system device full error" );
-            return rc;
-
-        default:
-            rc = RC ( rcNS, rcStream, rcWriting, rcNoObj, rcUnknown );
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "unknown system error '$(S)($(E))'",
-                        "S=%!,E=%d", lerrno, lerrno ) );
-            return rc;
-        }
-        break;
-    }
-
-    return 0;
-}
-
-static KStream_vt_v1 vtKStdIOStream =
-{
-    1, 0,
-    KStdIOStreamWhack,
-    KStdIOStreamRead,
-    KStdIOStreamWrite
-};
-
-
-static
-rc_t KStdIOStreamMake ( KStream **sp, HANDLE fd, const char *strname,
-    bool read_enabled, bool write_enabled )
-{
-    rc_t rc;
-
-    if ( sp == NULL )
-        rc = RC ( rcNS, rcStream, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KStdIOStream *s = calloc ( sizeof *s, 1 );
-        if ( s == NULL )
-            rc = RC ( rcNS, rcStream, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KStreamInit ( & s -> dad, ( const KStream_vt* ) & vtKStdIOStream,
-                               "KStdIOStream", strname, read_enabled, write_enabled );
-            if ( rc == 0 )
-            {
-                s -> fd = fd;
-                * sp = & s -> dad;
-                return 0;
-            }
-
-            free ( s );
-        }
-
-        * sp = NULL;
-    }
-
-    return rc;
-}
-
-/* MakeStdIn
- *  creates a read-only stream on stdin
- */
-LIB_EXPORT rc_t CC KStreamMakeStdIn ( const KStream **std_in )
-{
-    HANDLE fd = GetStdHandle ( STD_INPUT_HANDLE );
-    return KStdIOStreamMake ( ( KStream** ) std_in, fd, "stdin", true, false );
-}
-
-/* MakeStdOut
- * MakeStdErr
- *  creates a write-only stream on stdout or stderr
- */
-LIB_EXPORT rc_t CC KStreamMakeStdOut ( KStream **std_out )
-{
-    HANDLE fd = GetStdHandle ( STD_OUTPUT_HANDLE );
-    return KStdIOStreamMake ( std_out, fd, "stdout", false, true );
-}
-
-LIB_EXPORT rc_t CC KStreamMakeStdErr ( KStream **std_err )
-{
-    HANDLE fd = GetStdHandle ( STD_ERROR_HANDLE );
-    return KStdIOStreamMake ( std_err, fd, "stderr", false, true );
-}
diff --git a/libs/kproc/Makefile b/libs/kproc/Makefile
deleted file mode 100644
index 24a2d95..0000000
--- a/libs/kproc/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kproc
-
-include $(TOP)/build/Makefile.env
-
-INT_LIBS = \
-	libksproc \
-	libkproc
-
-ifneq (win,$(OS))
-INT_LIBS += \
-	libkq
-endif
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# multi-threaded process support
-#
-$(ILIBDIR)/libkproc: $(addprefix $(ILIBDIR)/libkproc.,$(ILIBEXT))
-
-PROC_CMN = \
-	task \
-	procmgr
-
-PROC_SRC = \
-	$(PROC_CMN)
-
-ifneq (win,$(OS))
-PROC_SRC += \
-	systimeout \
-	syslock \
-	systhread \
-	syscond \
-	sem
-else
-PROC_SRC += \
-	systimeout \
-	syslock \
-	systhread \
-	syscond
-endif
-
-PROC_OBJ = \
-	$(addsuffix .$(LOBX),$(PROC_SRC))
-
-ifneq (win,$(OS))
-PROC_LIB = \
-	-dpthread
-else
-PROC_LIB = \
-	-dklib
-endif
-
-$(ILIBDIR)/libkproc.$(LIBX): $(PROC_OBJ)
-	$(LD) --slib -o $@ $^ $(PROC_LIB)
-
-
-#-------------------------------------------------------------------------------
-# single-threaded process support
-#
-$(ILIBDIR)/libksproc: $(addprefix $(ILIBDIR)/libksproc.,$(ILIBEXT))
-
-SPROC_SRC = \
-	$(PROC_CMN) \
-	sttimeout \
-	stlock \
-	stcond \
-	stsem \
-	stthread \
-	stbarrier
-
-SPROC_OBJ = \
-	$(addsuffix .$(LOBX),$(SPROC_SRC))
-
-SPROC_LIB = \
-	-dklib
-
-$(ILIBDIR)/libksproc.$(LIBX): $(SPROC_OBJ)
-	$(LD) --slib -o $@ $^ $(SPROC_LIB)
-
-
-#-------------------------------------------------------------------------------
-# cross-thread reference queue
-#
-$(ILIBDIR)/libkq: $(addprefix $(ILIBDIR)/libkq.,$(ILIBEXT))
-
-Q_SRC = \
-	queue
-
-Q_OBJ = \
-	$(addsuffix .$(LOBX),$(Q_SRC))
-
-Q_LIB = \
-	-dkproc \
-	-dklib
-
-$(ILIBDIR)/libkq.$(LIBX): $(Q_OBJ)
-	$(LD) --slib -o $@ $^ $(Q_LIB)
diff --git a/libs/kproc/bsd/syslock-priv.h b/libs/kproc/bsd/syslock-priv.h
deleted file mode 100644
index e7542e5..0000000
--- a/libs/kproc/bsd/syslock-priv.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_syslock_priv_
-#define _h_syslock_priv_
-
-#include <pthread.h>
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_atomic32_
-#include <atomic32.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- *  with some facilities for timed operations
- */
-struct KLock
-{
-    pthread_mutex_t mutex;
-    pthread_mutex_t cond_lock;
-    pthread_cond_t cond;
-    uint32_t waiters;
-    atomic32_t refcount;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_syslock_priv_ */
diff --git a/libs/kproc/bsd/syslock.c b/libs/kproc/bsd/syslock.c
deleted file mode 100644
index 5cfada0..0000000
--- a/libs/kproc/bsd/syslock.c
+++ /dev/null
@@ -1,641 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include "syslock-priv.h"
-#include "syscond-priv.h"
-#include <kproc/timeout.h>
-#include <kproc/lock.h>
-#include <kproc/cond.h>
-#include <os-native.h>
-#include <kproc/lock.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * pthread_mutex
- */
-static
-rc_t pthread_mutex_whack ( pthread_mutex_t *mutex )
-{
-    int status = pthread_mutex_destroy ( mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcDestroying, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-static
-rc_t pthread_mutex_acquire ( pthread_mutex_t *mutex )
-{
-    int status = pthread_mutex_lock ( mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EDEADLK:
-        return RC ( rcPS, rcLock, rcLocking, rcThread, rcDeadlock );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-static
-rc_t pthread_mutex_release ( pthread_mutex_t *mutex )
-{
-    int status = pthread_mutex_unlock ( mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EPERM:
-        return RC ( rcPS, rcLock, rcUnlocking, rcThread, rcIncorrect );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcUnlocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcUnlocking, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * pthread_cond
- */
-static
-rc_t pthread_cond_whack ( pthread_cond_t *cond )
-{
-    int status = pthread_cond_destroy ( cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcLock, rcDestroying, rcCondition, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcDestroying, rcCondition, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcDestroying, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-static
-rc_t pthread_cond_ping ( pthread_cond_t *cond )
-{
-    int status = pthread_cond_signal ( cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcLock, rcSignaling, rcCondition, rcUnknown );
-    }
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-
-/* Destroy
- */
-static
-rc_t KLockDestroy ( KLock *self )
-{
-    rc_t rc = pthread_mutex_whack ( & self -> mutex );
-    if ( rc == 0 )
-    {
-        pthread_mutex_whack ( & self -> cond_lock );
-        pthread_cond_whack ( & self -> cond );
-    }
-    return rc;
-}
-
-/* Whack
- */
-static
-rc_t KLockWhack ( KLock *self )
-{
-    rc_t rc = KLockDestroy ( self );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Init
- */
-static
-rc_t KLockInit ( KLock *self )
-{
-    int status = pthread_mutex_init ( & self -> mutex, NULL );
-    if ( status == 0 )
-    {
-        status = pthread_mutex_init ( & self -> cond_lock, NULL );
-        if ( status == 0 )
-        {
-            status = pthread_cond_init ( & self -> cond, NULL );
-            if ( status == 0 )
-            {
-                self -> waiters = 0;
-                atomic32_set ( & self -> refcount, 1 );
-                return 0;
-            }
-
-            pthread_mutex_destroy ( & self -> cond_lock );
-        }
-
-        pthread_mutex_destroy ( & self -> mutex );
-    }
-
-    switch ( status )
-    {
-    case EAGAIN:
-        return RC ( rcPS, rcLock, rcConstructing, rcResources, rcInsufficient );
-    case ENOMEM:
-        return RC ( rcPS, rcLock, rcConstructing, rcMemory, rcInsufficient );
-    }
-
-    return RC ( rcPS, rcLock, rcConstructing, rcNoObj, rcUnknown );
- }
-
-
-/* Make
- *  make a simple mutex
- */
-LIB_EXPORT rc_t CC KLockMake ( KLock **lockp )
-{
-    rc_t rc;
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KLockInit ( lock );
-            if ( rc == 0 )
-            {
-                * lockp = lock;
-                return 0;
-            }
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KLockAddRef ( const KLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLockRelease ( const KLock *cself )
-{
-    KLock *self = ( KLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Acquire
- *  acquires lock
- */
-LIB_EXPORT rc_t CC KLockAcquire ( KLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    return pthread_mutex_acquire ( & self -> mutex );
-}
-
-LIB_EXPORT rc_t CC KLockTimedAcquire ( KLock *self, timeout_t *tm )
-{
-    rc_t rc;
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_mutex_trylock ( & self -> mutex );
-    switch ( status )
-    {
-    case 0:
-        return 0;
-    case EBUSY:
-        if ( tm != NULL )
-            break;
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    if ( ! tm -> prepared )
-        TimeoutPrepare ( tm );
-
-    rc = pthread_mutex_acquire ( & self -> cond_lock );
-    if ( rc != 0 )
-        return rc;
-
-    ++ self -> waiters;
-
-    while ( 1 )
-    {
-        status = pthread_cond_timedwait ( & self -> cond, & self -> cond_lock, & tm -> ts );
-        if ( status != 0 )
-        {
-            switch ( status )
-            {
-            case ETIMEDOUT:
-                rc = RC ( rcPS, rcLock, rcLocking, rcTimeout, rcExhausted );
-                break;
-            case EINTR:
-                rc = RC ( rcPS, rcLock, rcLocking, rcThread, rcInterrupted );
-                break;
-            default:
-                rc = RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-            }
-            break;
-        }
-
-        status = pthread_mutex_trylock ( & self -> mutex );
-        if ( status != EBUSY )
-        {
-            switch ( status )
-            {
-            case 0:
-                break;
-            case EINVAL:
-                rc = RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-                break;
-            default:
-                rc = RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-            }
-            break;
-        }
-    }
-
-    -- self -> waiters;
-    pthread_mutex_release ( & self -> cond_lock );
-
-    return rc;
-}
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KLockUnlock ( KLock *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcUnlocking, rcSelf, rcNull );
-
-    /* release the guy */
-    rc = pthread_mutex_release ( & self -> mutex );
-    if ( rc != 0 )
-        return rc;
-
-    /* check for and signal any waiters */
-    rc = pthread_mutex_acquire ( & self -> cond_lock );
-    if ( rc == 0 )
-    {
-        if ( self -> waiters != 0 )
-            pthread_cond_ping ( & self -> cond );
-        pthread_mutex_release ( & self -> cond_lock );
-    }
-
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a POSIX-style read/write lock
- */
-struct KRWLock
-{
-    KLock lock;
-    KCondition rcond;
-    KCondition wcond;
-    uint32_t rwait;
-    uint32_t wwait;
-    int32_t count;
-    atomic32_t refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KRWLockWhack ( KRWLock *self )
-{
-    rc_t rc;
-
-    if ( self -> count || self -> rwait || self -> wwait )
-        return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcBusy );
-
-    rc = KLockDestroy ( & self -> lock );
-    if ( rc == 0 )
-    {
-        KConditionDestroy ( & self -> rcond );
-        KConditionDestroy ( & self -> wcond );
-        free ( self );
-    }
-
-    return rc;
-}
-
-
-/* Make
- *  make a simple read/write lock
- */
-LIB_EXPORT rc_t CC KRWLockMake ( KRWLock **lockp )
-{
-    rc_t rc;
-
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcRWLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KRWLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcRWLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KLockInit ( & lock -> lock );
-            if ( rc == 0 )
-            {
-                rc = KConditionInit ( & lock -> rcond );
-                if ( rc == 0 )
-                {
-                    rc = KConditionInit ( & lock -> wcond );
-                    if ( rc == 0 )
-                    {
-                        lock -> rwait = lock -> wwait = 0;
-                        lock -> count = 0;
-                        atomic32_set ( & lock -> refcount, 1 );
-                        * lockp = lock;
-                        return 0;
-                    }
-
-                    KConditionDestroy ( & lock -> rcond );
-                }
-
-                KLockDestroy ( & lock -> lock );
-            }
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRWLockAddRef ( const KRWLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KRWLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockRelease ( const KRWLock *cself )
-{
-    KRWLock *self = ( KRWLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KRWLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* AcquireShared
- *  acquires read ( shared ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireShared ( KRWLock *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    rc = KLockAcquire ( & self -> lock );
-    if ( rc == 0 )
-    {
-        ++ self -> rwait;
-        while ( self -> count < 0 || self -> wwait != 0 )
-        {
-            rc = KConditionWait ( & self -> rcond, & self -> lock );
-            if ( rc != 0 )
-                break;
-        }
-        -- self -> rwait;
-
-        if ( rc == 0 )
-            ++ self -> count;
-
-        KLockUnlock ( & self -> lock );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireShared ( KRWLock *self, timeout_t *tm )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    rc = KLockTimedAcquire ( & self -> lock, tm );
-    if ( rc == 0 )
-    {
-        ++ self -> rwait;
-        while ( self -> count < 0 || self -> wwait != 0 )
-        {
-            rc = KConditionTimedWait ( & self -> rcond, & self -> lock, tm );
-            if ( rc != 0 )
-                break;
-        }
-        -- self -> rwait;
-
-        if ( rc == 0 )
-            ++ self -> count;
-
-        KLockUnlock ( & self -> lock );
-    }
-
-    return rc;
-}
-
-
-/* AcquireExcl
- *  acquires write ( exclusive ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireExcl ( KRWLock *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    rc = KLockAcquire ( & self -> lock );
-    if ( rc == 0 )
-    {
-        ++ self -> wwait;
-        while ( self -> count != 0 )
-        {
-            rc = KConditionWait ( & self -> wcond, & self -> lock );
-            if ( rc != 0 )
-                break;
-        }
-        -- self -> wwait;
-
-        if ( rc == 0 )
-            self -> count = -1;
-
-        KLockUnlock ( & self -> lock );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireExcl ( KRWLock *self, timeout_t *tm )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    rc = KLockTimedAcquire ( & self -> lock, tm );
-    if ( rc == 0 )
-    {
-        ++ self -> wwait;
-        while ( self -> count != 0 )
-        {
-            rc = KConditionTimedWait ( & self -> wcond, & self -> lock, tm );
-            if ( rc != 0 )
-                break;
-        }
-        -- self -> wwait;
-
-        if ( rc == 0 )
-            self -> count = -1;
-
-        KLockUnlock ( & self -> lock );
-    }
-
-    return rc;
-}
-
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KRWLockUnlock ( KRWLock *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcSelf, rcNull );
-
-    rc = KLockAcquire ( & self -> lock );
-    if ( rc == 0 )
-    {
-        /* release the count */
-        if ( self -> count < 0 )
-            self -> count = 0;
-        else if ( self -> count > 0 )
-            -- self -> count;
-
-        /* if there are writers waiting... */
-        if ( self -> wwait != 0 )
-        {
-            /* don't bother unless the lock is free */
-            if ( self -> count == 0 )
-                KConditionSignal ( & self -> wcond );
-        }
-
-        /* if there are readers waiting */
-        else if ( self -> rwait != 0 )
-        {
-            /* any number of readers can come through now */
-            KConditionBroadcast ( & self -> rcond );
-        }
-
-        KLockUnlock ( & self -> lock );
-    }
-
-    return rc;
-}
diff --git a/libs/kproc/libkproc.vers b/libs/kproc/libkproc.vers
deleted file mode 100644
index 66c4c22..0000000
--- a/libs/kproc/libkproc.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.9
diff --git a/libs/kproc/libkq.vers b/libs/kproc/libkq.vers
deleted file mode 100644
index 238d6e8..0000000
--- a/libs/kproc/libkq.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.7
diff --git a/libs/kproc/libksproc.vers b/libs/kproc/libksproc.vers
deleted file mode 100644
index 238d6e8..0000000
--- a/libs/kproc/libksproc.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.7
diff --git a/libs/kproc/linux/sysbarrier.c b/libs/kproc/linux/sysbarrier.c
deleted file mode 100644
index 2b1ccaa..0000000
--- a/libs/kproc/linux/sysbarrier.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include <kproc/barrier.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KBarrier
- *  a thread synchronization device
- *  detains all callers until the required number has been reached
- */
-struct KBarrier
-{
-    pthread_barrier_t barrier;
-    atomic32_t refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KBarrierWhack ( KBarrier *self )
-{
-    int status = pthread_barrier_destroy ( & self -> barrier );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcBarrier, rcDestroying, rcBarrier, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcBarrier, rcDestroying, rcBarrier, rcInvalid );
-    default:
-        return RC ( rcPS, rcBarrier, rcDestroying, rcNoObj, rcUnknown );
-    }
-    return 0;
-}
-
-
-/* Make
- *  create a barrier
- *
- *  "count" [ IN ] - the number of threads to block
- */
-LIB_EXPORT rc_t CC KBarrierMake ( KBarrier **bp, uint32_t count )
-{
-    rc_t rc;
-    if ( bp == NULL )
-        rc = RC ( rcPS, rcBarrier, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KBarrier *b = malloc ( sizeof * b );
-        if ( b == NULL )
-            rc = RC ( rcPS, rcBarrier, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            int status = pthread_barrier_init ( & b -> barrier, NULL, count );
-            if ( status == 0 )
-            {
-                atomic32_set ( & b -> refcount, 1 );
-                * bp = b;
-                return 0;
-            }
-
-            switch ( status )
-            {
-            case EINVAL:
-                rc = RC ( rcPS, rcBarrier, rcConstructing, rcParam, rcInvalid );
-                break;
-            case EBUSY:
-                rc = RC ( rcPS, rcBarrier, rcConstructing, rcBarrier, rcBusy );
-                break;
-            case EAGAIN:
-                rc = RC ( rcPS, rcBarrier, rcConstructing, rcBarrier, rcExhausted );
-                break;
-            case ENOMEM:
-                rc = RC ( rcPS, rcBarrier, rcConstructing, rcMemory, rcExhausted );
-                break;
-            default:
-                rc = RC ( rcPS, rcBarrier, rcConstructing, rcNoObj, rcUnknown );
-            }
-
-            free ( b );
-        }
-
-        * bp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KBarrierAddRef ( const KBarrier *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KBarrier* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KBarrierRelease ( const KBarrier *cself )
-{
-    KBarrier *self = ( KBarrier* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KBarrierWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Wait
- *  block until the required number of callers has been reached
- */
-LIB_EXPORT rc_t CC KBarrierWait ( KBarrier *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcBarrier, rcWaiting, rcSelf, rcNull );
-
-    status = pthread_barrier_wait ( & self -> barrier );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EINVAL:
-        return RC ( rcPS, rcBarrier, rcWaiting, rcBarrier, rcInvalid );
-    default:
-        return RC ( rcPS, rcBarrier, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/linux/syslock-priv.h b/libs/kproc/linux/syslock-priv.h
deleted file mode 100644
index e47d508..0000000
--- a/libs/kproc/linux/syslock-priv.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_syslock_priv_
-#define _h_syslock_priv_
-
-/* BEGIN HACK to get rwlocks defined */
-#include <stdint.h>
-#include <stddef.h>
-
-#undef __USE_UNIX98
-#define __USE_UNIX98 1
-
-#undef __USE_XOPEN2K
-#define __USE_XOPEN2K 1
-/* END HACK */
-
-#include <pthread.h>
-#include <atomic32.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-struct KLock
-{
-    pthread_mutex_t mutex;
-    atomic32_t refcount;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_syslock_priv_ */
diff --git a/libs/kproc/linux/syslock.c b/libs/kproc/linux/syslock.c
deleted file mode 100644
index aa86628..0000000
--- a/libs/kproc/linux/syslock.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include "syslock-priv.h"
-#include <os-native.h>
-#include <kproc/timeout.h>
-#include <kproc/lock.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-
-/* Whack
- */
-static
-rc_t KLockWhack ( KLock *self )
-{
-    int status = pthread_mutex_destroy ( & self -> mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcDestroying, rcNoObj, rcUnknown );
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  make a simple mutex
- */
-LIB_EXPORT rc_t CC KLockMake ( KLock **lockp )
-{
-    rc_t rc;
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            int status = pthread_mutex_init ( & lock -> mutex, NULL );
-            if ( status == 0 )
-            {
-                atomic32_set ( & lock -> refcount, 1 );
-                * lockp = lock;
-                return 0;
-            }
-
-            /* pthread_mutex_init is documented as always returning 0 */
-            rc = RC ( rcPS, rcLock, rcConstructing, rcNoObj, rcUnknown );
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KLockAddRef ( const KLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLockRelease ( const KLock *cself )
-{
-    KLock *self = ( KLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Acquire
- *  acquires lock
- */
-LIB_EXPORT rc_t CC KLockAcquire ( KLock *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_mutex_lock ( & self -> mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EDEADLK:
-        return RC ( rcPS, rcLock, rcLocking, rcThread, rcDeadlock );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLockTimedAcquire ( KLock *self, timeout_t *tm )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_mutex_trylock ( & self -> mutex );
-    switch ( status )
-    {
-    case 0:
-        return 0;
-    case EBUSY:
-        if ( tm != NULL )
-            break;
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    if ( ! tm -> prepared )
-        TimeoutPrepare ( tm );
-
-    status = pthread_mutex_timedlock ( & self -> mutex, & tm -> ts );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ETIMEDOUT:
-        return RC ( rcPS, rcLock, rcLocking, rcTimeout, rcExhausted );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcLocking, rcTimeout, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KLockUnlock ( KLock *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcUnlocking, rcSelf, rcNull );
-
-    status = pthread_mutex_unlock ( & self -> mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EPERM:
-        return RC ( rcPS, rcLock, rcUnlocking, rcThread, rcIncorrect );
-    case EINVAL:
-        return RC ( rcPS, rcLock, rcUnlocking, rcLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcLock, rcUnlocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a POSIX-style read/write lock
- */
-struct KRWLock
-{
-    pthread_rwlock_t lock;
-    atomic32_t refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KRWLockWhack ( KRWLock *self )
-{
-    int status = pthread_rwlock_destroy ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcDestroying, rcNoObj, rcUnknown );
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  make a simple read/write lock
- */
-LIB_EXPORT rc_t CC KRWLockMake ( KRWLock **lockp )
-{
-    rc_t rc;
-
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcRWLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KRWLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcRWLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            int status = pthread_rwlock_init ( & lock -> lock, NULL );
-            if ( status == 0 )
-            {
-                atomic32_set ( & lock -> refcount, 1 );
-                * lockp = lock;
-                return 0;
-            }
-
-            switch ( status )
-            {
-            case EAGAIN:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcRWLock, rcExhausted );
-                break;
-            case ENOMEM:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcMemory, rcExhausted );
-                break;
-            case EPERM:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcProcess, rcUnauthorized );
-                break;
-            case EBUSY:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcRWLock, rcBusy );
-                break;
-            default:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcNoObj, rcUnknown );
-            }
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRWLockAddRef ( const KRWLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KRWLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockRelease ( const KRWLock *cself )
-{
-    KRWLock *self = ( KRWLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KRWLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* AcquireShared
- *  acquires read ( shared ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireShared ( KRWLock *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_rwlock_rdlock ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EDEADLK:
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-    case EAGAIN:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcExhausted );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireShared ( KRWLock *self, timeout_t *tm )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_rwlock_tryrdlock ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        return 0;
-    case EBUSY:
-        if ( tm != NULL )
-            break;
-        return RC ( rcPS, rcLock, rcLocking, rcRWLock, rcBusy );
-    case EAGAIN:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcExhausted );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    if ( ! tm -> prepared )
-        TimeoutPrepare ( tm );
-
-    status = pthread_rwlock_timedrdlock ( & self -> lock, & tm -> ts );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ETIMEDOUT:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    case EAGAIN:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcExhausted );
-    case EDEADLK:
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* AcquireExcl
- *  acquires write ( exclusive ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireExcl ( KRWLock *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_rwlock_wrlock ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EDEADLK:
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireExcl ( KRWLock *self, timeout_t *tm )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    status = pthread_rwlock_trywrlock ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        return 0;
-    case EBUSY:
-        if ( tm != NULL )
-            break;
-        return RC ( rcPS, rcRWLock, rcLocking, rcLock, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    if ( ! tm -> prepared )
-        TimeoutPrepare ( tm );
-
-    status = pthread_rwlock_timedwrlock ( & self -> lock, & tm -> ts );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ETIMEDOUT:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    case EDEADLK:
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KRWLockUnlock ( KRWLock *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcSelf, rcNull );
-
-    status = pthread_rwlock_unlock ( & self -> lock );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EPERM:
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcThread, rcIncorrect );
-    case EINVAL:
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcRWLock, rcInvalid );
-    default:
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/procmgr.c b/libs/kproc/procmgr.c
deleted file mode 100644
index 6f768b3..0000000
--- a/libs/kproc/procmgr.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-
-#include <kproc/procmgr.h>
-#include <kproc/task.h>
-#include <kproc/lock.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-
-#define rcTask rcCmd
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KCleanupTaskQueue
- */
-typedef struct KCleanupTaskQueue KCleanupTaskQueue;
-struct KCleanupTaskQueue
-{
-    uint64_t count;
-    uint64_t capacity;
-    uint64_t start;
-    KTask *q [ 1 ];
-};
-
-
-/*--------------------------------------------------------------------------
- * KProcMgr
- */
-struct KProcMgr
-{
-    KLock *cleanup_lock;
-    KCleanupTaskQueue *cleanup;
-    KRefcount refcount;
-};
-
-static KProcMgr * s_proc_mgr;
-
-
-/* Whack
- *  tear down proc mgr
- *  runs any outstanding cleanup tasks
- *  deletes the singleton object
- *  intended to be called from an "atexit()" or similar task
- */
-LIB_EXPORT rc_t CC KProcMgrWhack ( void )
-{
-    rc_t rc = 0;
-
-    KProcMgr *self = s_proc_mgr;
-    if ( s_proc_mgr != NULL )
-    {
-        s_proc_mgr = NULL;
-
-        rc = KLockAcquire ( self -> cleanup_lock );
-        if ( rc == 0 )
-        {
-            uint64_t i;
-
-            KCleanupTaskQueue *cleanup = self -> cleanup;
-            self -> cleanup = NULL;
-            KLockUnlock ( self -> cleanup_lock );
-
-            if ( cleanup != NULL )
-            {
-                for ( i = 0; i < cleanup -> count; ++ i )
-                {
-                    KTask *task = cleanup -> q [ i ];
-                    if ( task != NULL )
-                    {
-                        rc_t task_rc = KTaskExecute ( task );
-                        if ( rc == 0 )
-                            rc = task_rc;
-
-                        cleanup -> q [ i ] = NULL;
-                        KTaskRelease ( task );
-                    }
-                }
-
-                free ( cleanup );
-            }
-        }
-
-        KLockRelease ( self -> cleanup_lock );
-        free ( self );
-    }
-
-    return rc;
-}
-
-
-/* Init
- *  initialize the proc mgr
- *  creates the singleton object
- */
-LIB_EXPORT rc_t CC KProcMgrInit ( void )
-{
-    rc_t rc = 0;
-
-    if ( s_proc_mgr == NULL )
-    {
-        KProcMgr *mgr = malloc ( sizeof * s_proc_mgr );
-        if ( mgr == NULL )
-            rc = RC ( rcPS, rcMgr, rcInitializing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KLockMake ( & mgr -> cleanup_lock );
-            if ( rc == 0 )
-            {
-                mgr -> cleanup = NULL;
-                KRefcountInit ( & mgr -> refcount, 0, "KProcMgr", "init", "process mgr" );
-
-                s_proc_mgr = mgr;
-                return 0;
-            }
-
-            free ( mgr );
-        }
-    }
-
-    return rc;
-}
-
-
-/* MakeSingleton
- *  make or access singleton process manager
- *  VDB-2 ONLY
- */
-LIB_EXPORT rc_t CC KProcMgrMakeSingleton ( KProcMgr ** mgrp )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcPS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        * mgrp = s_proc_mgr;
-
-        if ( s_proc_mgr == NULL )
-            rc = RC ( rcPS, rcMgr, rcConstructing, rcMgr, rcNull );
-        else
-            rc = KProcMgrAddRef ( s_proc_mgr );
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KProcMgrAddRef ( const KProcMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KProcMgr" ) )
-        {
-        case krefLimit:
-            return RC ( rcPS, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KProcMgrRelease ( const KProcMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KProcMgr" ) )
-        {
-        case krefWhack:
-            return 0;
-        case krefNegative:
-            return RC ( rcPS, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddCleanupTask
- *  add a task to be performed at process exit time
- *
- *  "ticket" [ OUT ] - an id that can be used later to remove task
- *
- *  "task" [ IN ] - task object that will be executed at process
- *   exit, unless previously removed ( see RemoveCleanupTask ).
- *   NB - a new reference to "task" will be created
- */
-LIB_EXPORT rc_t CC KProcMgrAddCleanupTask ( KProcMgr *self, KTaskTicket *ticket, KTask *task )
-{
-    rc_t rc;
-
-    if ( ticket == NULL )
-        rc = RC ( rcPS, rcQueue, rcInserting, rcId, rcNull );
-    else
-    {
-        memset ( ticket, 0, sizeof * ticket );
-
-        if ( self == NULL )
-            rc = RC ( rcPS, rcQueue, rcInserting, rcSelf, rcNull );
-        else if ( self != s_proc_mgr )
-            rc = RC ( rcPS, rcQueue, rcInserting, rcSelf, rcIncorrect );
-        else if ( task == NULL )
-            rc = RC ( rcPS, rcQueue, rcInserting, rcTask, rcNull );
-        else
-        {
-            rc = KTaskAddRef ( task );
-            if ( rc == 0 )
-            {
-                rc = KLockAcquire ( self -> cleanup_lock );
-                if ( rc == 0 )
-                {
-                    const uint64_t extend = 1024;
-                    KCleanupTaskQueue *cleanup = self -> cleanup;
-
-                    /* on first insert, allocate queue */
-                    if ( self -> cleanup == NULL )
-                    {
-                        cleanup = malloc ( sizeof * cleanup - sizeof cleanup -> q
-                            + sizeof cleanup -> q [ 0 ] * extend );
-                        if ( cleanup == NULL )
-                            rc = RC ( rcPS, rcQueue, rcInserting, rcMemory, rcExhausted );
-                        else
-                        {
-                            cleanup -> count = 0;
-                            cleanup -> capacity = extend;
-                            cleanup -> start = 0;
-
-                            self -> cleanup = cleanup;
-                        }
-                    }
-
-                    /* if queue is full */
-                    else if ( cleanup -> count == cleanup -> capacity )
-                    {
-                        uint64_t empty;
-
-                        /* determine number of empty slots at start */
-                        for ( empty = 0; empty < cleanup -> count; ++ empty )
-                        {
-                            if ( cleanup -> q [ empty ] != NULL )
-                                break;
-                        }
-
-                        /* if none are empty, simply reallocate - probably bad... */
-                        if ( empty == 0 )
-                        {
-                            cleanup = realloc ( cleanup, sizeof * cleanup - sizeof cleanup -> q
-                                + sizeof cleanup -> q [ 0 ] * ( cleanup -> capacity + extend ) );
-                            if ( cleanup == NULL )
-                                rc = RC ( rcPS, rcQueue, rcInserting, rcMemory, rcExhausted );
-                            else
-                            {
-                                cleanup -> capacity += extend;
-                                self -> cleanup = cleanup;
-                            }
-                        }
-
-                        /* otherwise, rewrite to remove empty slots */
-                        else
-                        {
-                            uint64_t i;
-                            const KCleanupTaskQueue *orig = cleanup;
-
-                            /* only bother with resize if there are enough to recover */
-                            if ( empty >= 4096 )
-                            {
-                                cleanup = malloc ( sizeof * cleanup - sizeof cleanup -> q
-                                    + sizeof cleanup -> q [ 0 ] * ( orig -> capacity - empty + extend ) );
-                                if ( cleanup == NULL )
-                                    rc = RC ( rcPS, rcQueue, rcInserting, rcMemory, rcExhausted );
-                                else
-                                {
-                                    cleanup -> capacity = orig -> capacity - empty + extend;
-                                }
-                            }
-
-                            /* rewrite count to remove leading NULL entries */
-                            cleanup -> count = orig -> count - empty;
-
-                            /* accumulate NULL entries into the start offset */
-                            cleanup -> start = orig -> start + empty;
-
-                            /* copy the tasks */
-                            for ( i = 0; i < cleanup -> count; ++ i )
-                                cleanup -> q [ i ] = orig -> q [ empty + i ];
-
-                            if ( ( const KCleanupTaskQueue* ) cleanup != orig )
-                            {
-                                self -> cleanup = cleanup;
-                                free ( ( void* ) orig );
-                            }
-                        }
-                    }
-
-                    /* detect valid queue for insertion */
-                    if ( rc == 0 )
-                    {
-                        /* assert that there is space for a task */
-                        assert ( cleanup -> count < cleanup -> capacity );
-
-                        /* record reference to task */
-                        cleanup -> q [ cleanup -> count ] = task;
-
-                        /* fill out the ticket information */
-                        ticket -> info [ 0 ] =  cleanup -> start + cleanup -> count;
-                        ticket -> info [ 1 ] = ( size_t ) task;
-                        ticket -> info [ 0 ] ^= ( size_t ) self;
-                        ticket -> info [ 1 ] ^= ( size_t ) self;
-                        ticket -> info [ 0 ] ^= ( size_t ) task;
-
-                        /* account for insertion */
-                        ++ cleanup -> count;
-                    }
-
-                    KLockUnlock ( self -> cleanup_lock );
-                }
-
-                if ( rc != 0 )
-                    KTaskRelease ( task );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* RemoveCleanupTask
- *  remove a task from exit queue
- *  releases reference to task object
- *  returns an rcNotFound code if task no longer exists
- */
-LIB_EXPORT rc_t CC KProcMgrRemoveCleanupTask ( KProcMgr *self, const KTaskTicket *ticket )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcPS, rcQueue, rcRemoving, rcSelf, rcNull );
-    else if ( self != s_proc_mgr )
-        rc = RC ( rcPS, rcQueue, rcRemoving, rcSelf, rcIncorrect );
-    else if ( ticket == NULL )
-        rc = RC ( rcPS, rcQueue, rcRemoving, rcId, rcNull );
-    else
-    {
-        /* recover task* and idx */
-        KTask *task = ( KTask* ) ( ( size_t ) ticket -> info [ 1 ] ^ ( size_t ) self );
-        uint64_t idx = ticket -> info [ 0 ] ^ ( size_t ) task;
-        idx ^= ( size_t ) self;
-
-        /* go into queue */
-        rc = KLockAcquire ( self -> cleanup_lock );
-        if ( rc == 0 )
-        {
-            KCleanupTaskQueue *cleanup = self -> cleanup;
-            if ( self -> cleanup == NULL )
-                rc = RC ( rcPS, rcQueue, rcRemoving, rcItem, rcNotFound );
-            else if ( idx < cleanup -> start )
-                rc = RC ( rcPS, rcQueue, rcRemoving, rcItem, rcNotFound );
-            else
-            {
-                idx -= cleanup -> start;
-                if ( idx >= cleanup -> count )
-                    rc = RC ( rcPS, rcQueue, rcRemoving, rcItem, rcNotFound );
-                else if ( cleanup -> q [ idx ] != task )
-                    rc = RC ( rcPS, rcQueue, rcRemoving, rcItem, rcNotFound );
-                else
-                {
-                    cleanup -> q [ idx ] = NULL;
-                }
-            }
-
-            KLockUnlock ( self -> cleanup_lock );
-        }
-
-        if ( rc == 0 )
-            KTaskRelease ( task );
-    }
-
-    return rc;
-}
diff --git a/libs/kproc/queue.c b/libs/kproc/queue.c
deleted file mode 100644
index 5b30d2e..0000000
--- a/libs/kproc/queue.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/q-extern.h>
-#include <kproc/queue.h>
-#include <kproc/timeout.h>
-#include <kproc/lock.h>
-#include <kproc/sem.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <atomic32.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-#if _DEBUGGING && 0
-#define QMSG( msg, ... ) \
-    KOutMsg ( msg, __VA_ARGS__ )
-#else
-#define QMSG( msg, ... ) \
-    ( void ) 0
-#endif
-
-/*--------------------------------------------------------------------------
- * KQueue
- *  a simple thread-safe queue structure supporting push/pop operation
- *  makes use of semaphore objects for synchronization
- */
-struct KQueue
-{
-    KSemaphore *rc;
-    KSemaphore *wc;
-
-    KLock *rl;
-    KLock *wl;
-
-    uint32_t capacity;
-    uint32_t bmask, imask;
-    volatile uint32_t read, write;
-    atomic32_t refcount;
-    volatile bool sealed;
-    uint8_t align [ 7 ];
-    void *buffer [ 16 ];
-};
-
-
-/* Whack
- */
-static
-rc_t KQueueWhack ( KQueue *self )
-{
-    rc_t rc;
-    QMSG ( "%s: releasing write semaphore\n", __func__ );
-    rc = KSemaphoreRelease ( self -> wc );
-    if ( rc == 0 )
-    {
-        QMSG ( "%s: releasing read semaphore\n", __func__ );
-        KSemaphoreRelease ( self -> rc );
-        QMSG ( "%s: releasing write lock\n", __func__ );
-        KLockRelease ( self -> wl );
-        QMSG ( "%s: releasing read lock\n", __func__ );
-        KLockRelease ( self -> rl );
-        free ( self );
-        QMSG ( "%s: done\n", __func__ );
-    }
-    return rc;
-}
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KQueueAddRef ( const KQueue *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KQueue* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KQueueRelease ( const KQueue *cself )
-{
-    KQueue *self = ( KQueue* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KQueueWhack ( self );
-    }
-    return 0;
-}
-
-/* Make
- * create an empty queue object
- *
- *  "capacity" [ IN ] - minimum queue length
- *  always expands to a power of 2, i.e. providing
- *  a length of 10 will result in a length of 16.
- */
-LIB_EXPORT rc_t CC KQueueMake ( KQueue **qp, uint32_t capacity )
-{
-    rc_t rc;
-    if ( qp == NULL )
-        rc = RC ( rcCont, rcQueue, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KQueue *q;
-
-        uint32_t cap = 1;
-        while ( cap < capacity )
-            cap += cap;
-
-        q = malloc ( sizeof * q - sizeof q -> buffer + cap * sizeof q -> buffer [ 0 ] );
-        if ( q == NULL )
-            rc = RC ( rcCont, rcQueue, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KSemaphoreMake ( & q -> rc, 0 );
-            if ( rc == 0 )
-            {
-                rc = KSemaphoreMake ( & q -> wc, cap );
-                if ( rc == 0 )
-                {
-                    rc = KLockMake ( & q -> rl );
-                    if ( rc == 0 )
-                    {
-                        rc = KLockMake ( & q -> wl );
-                        if ( rc == 0 )
-                        {
-                            q -> capacity = cap;
-                            q -> bmask = cap - 1;
-                            q -> imask = ( cap + cap ) - 1;
-                            q -> read = q -> write = 0;
-                            atomic32_set ( & q -> refcount, 1 );
-                            q -> sealed = false;
-
-                            QMSG ( "%s: created queue with capacity %u, "
-                                   "bmask %#032b, imask %#032b.\n"
-                                   , __func__, q -> capacity, q -> bmask, q -> imask
-                                );
-
-                            * qp = q;
-                            return 0;
-                        }
-
-                        KLockRelease ( q -> rl );
-                    }
-
-                    KSemaphoreRelease ( q -> wc );
-                }
-
-                KSemaphoreRelease ( q -> rc );
-            }
-            free ( q );
-        }
-        * qp = NULL;
-    }
-    return rc;
-}
-
-/* Push
- *  add an object to the queue
- *
- *  "item" [ IN, OPAQUE ] - pointer to item being queued
- *
- *  "tm" [ IN, NULL OKAY ] - pointer to system specific timeout
- *  structure. if the queue is full, wait for indicated period
- *  of time for space to become available, or return status
- *  code indicating a timeout. when NULL and queue is full,
- *  Push will time out immediately and return status code.
- */
-LIB_EXPORT rc_t CC KQueuePush ( KQueue *self, const void *item, timeout_t *tm )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcCont, rcQueue, rcInserting, rcSelf, rcNull );
-    if ( self -> sealed )
-    {
-        QMSG ( "%s: failed to insert into queue due to seal\n", __func__ );
-        return RC ( rcCont, rcQueue, rcInserting, rcQueue, rcReadonly );
-    }
-    if ( item == NULL )
-        return RC ( rcCont, rcQueue, rcInserting, rcTimeout, rcNull );
-
-    QMSG ( "%s: acquiring write lock ( %p )...\n", __func__, self -> wl );
-    rc = KLockAcquire ( self -> wl );
-    QMSG ( "%s: ...done, rc = %R\n", __func__, rc );
-    if ( rc == 0 )
-    {
-        QMSG ( "%s: waiting on write semaphore...\n", __func__ );
-        rc = KSemaphoreTimedWait ( self -> wc, self -> wl, tm );
-        QMSG ( "%s: ...done, rc = %R. unlocking write lock ( %p ).\n", __func__, rc, self -> wl );
-        KLockUnlock ( self -> wl );
-
-        if ( rc == 0 )
-        {
-            uint32_t w;
-
-            /* re-check the seal */
-            if ( self -> sealed )
-            {
-                QMSG ( "%s: queue has been sealed\n", __func__ );
-
-                /* not a disaster if semaphore not signaled */
-                QMSG ( "%s: acquiring write lock\n", __func__ );
-                if ( ! KLockAcquire ( self -> wl ) )
-                {
-                    QMSG ( "%s: signaling write semaphore\n", __func__ );
-                    KSemaphoreSignal ( self -> wc );
-                    QMSG ( "%s: unlocking write lock\n", __func__ );
-                    KLockUnlock ( self -> wl );
-                }
-
-                QMSG ( "%s: failed to insert into queue due to seal\n", __func__ );
-                return RC ( rcCont, rcQueue, rcInserting, rcQueue, rcReadonly );
-            }
-
-            /* insert item */
-            w = self -> write & self -> imask;
-            QMSG ( "%s: write index is %u, masked against 0x%x\n", __func__, w, self -> imask );
-            self -> buffer [ w & self -> bmask ] = ( void* ) item;
-            QMSG ( "%s: inserted item into buffer [ %u ], using mask 0x%x\n", __func__, w & self -> bmask, self -> bmask );
-            self -> write = w + 1;
-
-            /* let listeners know about item */
-            QMSG ( "%s: acquiring read lock ( %p )\n", __func__, self -> rl );
-            if ( KLockAcquire ( self -> rl ) == 0 )
-            {
-                QMSG ( "%s: signaling read semaphore\n", __func__ );
-                KSemaphoreSignal ( self -> rc );
-                QMSG ( "%s: unlocking read lock ( %p )\n", __func__, self -> rl );
-                KLockUnlock ( self -> rl );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Pop
- *  pop an object from queue
- *
- *  "item" [ OUT, OPAQUE* ] - return parameter for popped item
- *
- *  "tm" [ IN, NULL OKAY ] - pointer to system specific timeout
- *  structure. if the queue is empty, wait for indicated period
- *  of time for an object to become available, or return status
- *  code indicating a timeout. when NULL and queue is empty,
- *  Pop will time out immediately and return status code.
- */
-LIB_EXPORT rc_t CC KQueuePop ( KQueue *self, void **item, timeout_t *tm )
-{
-    rc_t rc;
-
-    if ( item == NULL )
-        rc = RC ( rcCont, rcQueue, rcRemoving, rcParam, rcNull );
-    else
-    {
-        * item = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcCont, rcQueue, rcRemoving, rcSelf, rcNull );
-        else
-        {
-            QMSG ( "%s: acquiring read lock ( %p )\n", __func__, self -> rl );
-            rc = KLockAcquire ( self -> rl );
-            if ( rc == 0 )
-            {
-                QMSG ( "%s: waiting on read semaphore...\n", __func__ );
-                rc = KSemaphoreTimedWait ( self -> rc, self -> rl, self -> sealed ? NULL : tm );
-                QMSG ( "%s: ...done, rc = %R. unlocking read lock. ( %p )\n", __func__, rc, self -> rl );
-                KLockUnlock ( self -> rl );
-
-                if ( rc == 0 )
-                {
-                    uint32_t r, idx;
-
-                    /* got an element */
-                    QMSG ( "%s: asserting  self -> read ( %u ) != self -> write ( %u )\n",
-                           __func__, self -> read, self -> write
-                        );
-                    assert ( self -> read != self -> write );
-
-                    /* read element */
-                    r = self -> read & self -> imask;
-                    QMSG ( "%s: read index is %u, masked against 0x%x\n", __func__, r, self -> imask );
-                    idx = r & self -> bmask;
-                    * item = self -> buffer [ idx ];
-                    QMSG ( "%s: read item from buffer [ %u ], using mask 0x%x\n", __func__, idx, self -> bmask );
-                    self -> buffer [ idx ] = NULL;
-                    self -> read = r + 1;
-
-                    /* let write know there's a free slot available */
-                    QMSG ( "%s: acquiring write lock ( %p )\n", __func__, self -> wl );
-                    if ( KLockAcquire ( self -> wl ) == 0 )
-                    {
-                        QMSG ( "%s: signaling write semaphore\n", __func__ );
-                        KSemaphoreSignal ( self -> wc );
-                        QMSG ( "%s: unlocking write lock ( %p )\n", __func__, self -> wl );
-                        KLockUnlock ( self -> wl );
-                    }
-                }
-                else if ( self -> sealed && GetRCObject ( rc ) == rcTimeout )
-                {
-                    rc = RC ( rcCont, rcQueue, rcRemoving, rcData, rcDone );
-                    QMSG ( "%s: resetting rc to %R\n", __func__, rc );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* Sealed
- *  ask if the queue has been closed off
- *  meaning there will be no further push operations
- *
- *  NB - if "self" is NULL, the return value is "true"
- *  since a NULL queue cannot accept items via push
- */
-LIB_EXPORT bool CC KQueueSealed ( const KQueue *self )
-{
-    QMSG ( "%s called\n", __func__ );
-    if ( self != NULL )
-        return self -> sealed;
-    return false;
-}
-
-
-/* Seal
- *  indicate that the queue has been closed off
- *  meaning there will be no further push operations
- *  if "writes" is true, and no further pop operations
- *  otherwise.
- */
-LIB_EXPORT rc_t CC KQueueSeal ( KQueue *self )
-{
-    rc_t rc = 0;
-
-    QMSG ( "%s called\n", __func__ );
-
-    if ( self == NULL )
-        return RC ( rcCont, rcQueue, rcFreezing, rcSelf, rcNull );
-
-    self -> sealed = true;
-
-#if 0
-    QMSG ( "%s: acquiring write lock ( %p )\n", __func__, self -> wl );
-    rc = KLockAcquire ( self -> wl );
-    if ( rc == 0 )
-    {
-        QMSG ( "%s: canceling write semaphore...\n", __func__ );
-        rc = KSemaphoreCancel ( self -> wc );
-        QMSG ( "%s: ...done, rc = %R.\n", __func__, rc );
-        KLockUnlock ( self -> wl );
-
-        if ( rc == 0 )
-        {
-            QMSG ( "%s: acquiring read lock ( %p )\n", __func__, self -> rl );
-            rc = KLockAcquire ( self -> rl );
-            if ( rc == 0 )
-            {
-                QMSG ( "%s: canceling read semaphore...\n", __func__ );
-                rc = KSemaphoreCancel ( self -> rc );
-                QMSG ( "%s: ...done, rc = %R.\n", __func__, rc );
-                KLockUnlock ( self -> rl );
-            }
-        }
-    }
-#endif
-
-    return rc;
-}
diff --git a/libs/kproc/sem.c b/libs/kproc/sem.c
deleted file mode 100644
index 822f8cb..0000000
--- a/libs/kproc/sem.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "syscond-priv.h"
-#include <kproc/extern.h>
-#include <kproc/sem.h>
-#include <kproc/cond.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-
-#if _DEBUGGING && 0
-#define SMSG( msg, ... ) \
-    KOutMsg ( msg, __VA_ARGS__ )
-#else
-#define SMSG( msg, ... ) \
-    ( void ) 0
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KSemaphore
- *  a metering device
- */
-struct KSemaphore
-{
-    volatile uint64_t avail;
-    volatile uint64_t requested;
-    volatile uint64_t min_requested;
-    KCondition* cond;
-    volatile uint32_t waiting;
-    volatile bool uniform;
-};
-
-
-/* Whack
- */
-static
-rc_t KSemaphoreWhack ( KSemaphore *self )
-{
-    rc_t rc;
-
-    if ( self -> waiting != 0 )
-        return RC ( rcPS, rcSemaphore, rcDestroying, rcSemaphore, rcBusy );
-
-    rc = KConditionRelease ( self -> cond );
-    if ( rc != 0 )
-        return ResetRCContext ( rc, rcPS, rcSemaphore, rcDestroying );
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *
- *  "count" [ IN ] - initial count value
- */
-LIB_EXPORT rc_t CC KSemaphoreMake ( KSemaphore **semp, uint64_t count )
-{
-    rc_t rc;
-    if ( semp == NULL )
-        rc = RC ( rcPS, rcSemaphore, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KSemaphore *sem = malloc ( sizeof * sem );
-        if ( sem == NULL )
-            rc = RC ( rcPS, rcSemaphore, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KConditionMake( & sem -> cond );
-            if ( rc == 0 )
-            {
-                sem -> avail = count;
-                sem -> requested = 0;
-                sem -> min_requested = 0;
-                sem -> waiting = 0;
-                sem -> uniform = false;
-
-                * semp = sem;
-                return 0;
-            }
-
-            free ( sem );
-        }
-
-        * semp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KSemaphoreAddRef ( const KSemaphore *cself )
-{
-    if ( cself != NULL )
-        return KConditionAddRef ( cself -> cond );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSemaphoreRelease ( const KSemaphore *cself )
-{
-    if ( cself != NULL )
-    {
-        if ( KConditionDropRef ( cself -> cond ) )
-            return KSemaphoreWhack ( ( KSemaphore* ) cself );
-    }
-    return 0;
-}
-
-
-/* Wait
- *  block until a count becomes available
- *
- *  "lock" [ IN ] - externally acquired lock
- */
-LIB_EXPORT rc_t CC KSemaphoreWait ( KSemaphore *self, struct KLock *lock )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail == 0 )
-    {
-        if ( ++ self -> waiting == 1 )
-        {
-            self -> requested = self -> min_requested = 1;
-            self -> uniform = true;
-        }
-        else if ( self -> requested != 1 )
-        {
-            self -> min_requested = 1;
-            self -> uniform = false;
-        }
-
-        do
-        {
-            rc_t rc = KConditionWait ( self -> cond, lock );
-            if ( rc != 0 )
-            {
-                -- self -> waiting;
-                return ResetRCContext ( rc, rcPS, rcSemaphore, rcWaiting );
-            }
-        }
-        while ( self -> avail == 0 );
-
-        -- self -> waiting;
-    }
-
-    -- self -> avail;
-    return 0;
-}
-
-/* TimedWait
- *  block until a count becomes available
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "tm" [ IN, NULL OKAY ] - optional timeout where
- *  NULL means timeout value of 0
- */
-LIB_EXPORT rc_t CC KSemaphoreTimedWait ( KSemaphore *self,
-    struct KLock *lock, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail == 0 )
-    {
-        SMSG ( "%s[%p]: avail == 0\n", __func__, self );
-        if ( tm == NULL )
-        {
-            SMSG ( "%s[%p]: non-blocking mode - return timeout exhausted\n", __func__, self );
-            return RC ( rcPS, rcSemaphore, rcWaiting, rcTimeout, rcExhausted );
-        }
-
-        if ( ++ self -> waiting == 1 )
-        {
-            SMSG ( "%s[%p]: first waiter\n", __func__, self );
-            self -> requested = self -> min_requested = 1;
-            self -> uniform = true;
-        }
-        else if ( self -> requested != 1 )
-        {
-            SMSG ( "%s[%p]: multiple waiters ( %u )\n", __func__, self, self -> waiting );
-            self -> min_requested = 1;
-            self -> uniform = false;
-        }
-
-        do
-        {
-            rc_t rc;
-
-            SMSG ( "%s[%p]: wait on condition...\n", __func__, self );
-            rc = KConditionTimedWait ( self -> cond, lock, tm );
-            SMSG ( "%s[%p]:...done, rc = %R\n", __func__, self, rc );
-            if ( rc != 0 )
-            {
-                SMSG ( "%s[%p]: timed out - decrementing wait count\n", __func__, self );
-                -- self -> waiting;
-                return ResetRCContext ( rc, rcPS, rcSemaphore, rcWaiting );
-            }
-
-            SMSG ( "%s[%p]: condition signaled - avail = %lu\n", __func__, self, self -> avail );
-        }
-        while ( self -> avail == 0 );
-
-        SMSG ( "%s[%p]: finished waiting\n", __func__, self );
-        -- self -> waiting;
-    }
-
-    SMSG ( "%s[%p]: decrementing count from %lu\n", __func__, self, self -> avail );
-    -- self -> avail;
-    return 0;
-}
-
-
-/* Cancel
- *  signal that the count will never increase
- */
-LIB_EXPORT rc_t CC KSemaphoreCancel ( KSemaphore *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcSignaling, rcSelf, rcNull );
-
-    if ( self -> waiting != 0 )
-    {
-        SMSG ( "%s[%p]: canceling %u waiters\n", __func__, self, self -> waiting );
-        return KConditionBroadcast ( self -> cond );
-    }
-
-    SMSG ( "%s[%p]: cancel request ( no waiters )\n", __func__, self );
-    return 0;
-}
-
-
-/* Signal
- *  signal that a count has become available
- */
-LIB_EXPORT rc_t CC KSemaphoreSignal ( KSemaphore *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcSignaling, rcSelf, rcNull );
-
-    ++ self -> avail;
-    if ( self -> waiting != 0 && self -> avail >= self -> min_requested )
-    {
-        /* whacky logic
-           - if everyone has requested the same amount
-           - and only one request can be satisfied
-           - then signal. otherwise, broadcast */
-        if ( self -> uniform && self -> avail / self -> min_requested == 1 )
-            return KConditionSignal ( self -> cond );
-        return KConditionBroadcast ( self -> cond );
-    }
-
-    return 0;
-}
-
-
-/* Alloc
- *  allocate a count
- *  used for resource metering
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "count" [ IN ] - the resource count
- */
-LIB_EXPORT rc_t CC KSemaphoreAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail < count )
-    {
-        if ( ++ self -> waiting == 1 )
-        {
-            self -> requested = self -> min_requested = count;
-            self -> uniform = true;
-        }
-        else if ( self -> requested != count )
-        {
-            if ( self -> min_requested > count )
-                self -> min_requested = count;
-            self -> uniform = false;
-        }
-
-        do
-        {
-            rc_t rc = KConditionWait ( self -> cond, lock );
-            if ( rc != 0 )
-            {
-                -- self -> waiting;
-                return ResetRCContext ( rc, rcPS, rcSemaphore, rcWaiting );
-            }
-        }
-        while ( self -> avail < count );
-
-        -- self -> waiting;
-    }
-
-    self -> avail -= count;
-    return 0;
-}
-
-/* TimedAlloc
- *  allocate a count
- *  used for resource metering
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "count" [ IN ] - the resource count
- *
- *  "tm" [ IN, NULL OKAY ] - optional timeout where
- *  NULL means timeout value of 0
- */
-LIB_EXPORT rc_t CC KSemaphoreTimedAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail < count )
-    {
-        if ( tm == NULL )
-            return RC ( rcPS, rcSemaphore, rcWaiting, rcTimeout, rcExhausted );
-
-        if ( ++ self -> waiting == 1 )
-        {
-            self -> requested = self -> min_requested = count;
-            self -> uniform = true;
-        }
-        else if ( self -> requested != count )
-        {
-            if ( self -> min_requested > count )
-                self -> min_requested = count;
-            self -> uniform = false;
-        }
-
-        do
-        {
-            rc_t rc = KConditionTimedWait ( self -> cond, lock, tm );
-            if ( rc != 0 )
-            {
-                -- self -> waiting;
-                return ResetRCContext ( rc, rcPS, rcSemaphore, rcWaiting );
-            }
-        }
-        while ( self -> avail < count );
-
-        -- self -> waiting;
-    }
-
-    self -> avail -= count;
-    return 0;
-}
-
-
-/* Free
- *  signal that resources have become available
- */
-LIB_EXPORT rc_t CC KSemaphoreFree ( KSemaphore *self, uint64_t count )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcSignaling, rcSelf, rcNull );
-
-    self -> avail += count;
-    if ( self -> waiting != 0 && self -> avail >= self -> min_requested )
-    {
-        /* whacky logic
-           - if everyone has requested the same amount
-           - and only one request can be satisfied
-           - then signal. otherwise, broadcast */
-        if ( self -> uniform && self -> avail / self -> min_requested == 1 )
-            return KConditionSignal ( self -> cond );
-        return KConditionBroadcast ( self -> cond );
-    }
-
-    return 0;
-}
-
-
-/* Count
- *  request the current resource usage
- *  valid only within lock
- *
- *  "count" [ OUT ] - return parameter for current count
- */
-LIB_EXPORT rc_t CC KSemaphoreCount ( const KSemaphore *self, uint64_t *count )
-{
-    rc_t rc;
-    if ( count == NULL )
-        rc = RC ( rcPS, rcSemaphore, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcPS, rcSemaphore, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * count = self -> avail;
-            return 0;
-        }
-
-        * count = 0;
-    }
-    return rc;
-}
diff --git a/libs/kproc/stbarrier.c b/libs/kproc/stbarrier.c
deleted file mode 100644
index 56b621b..0000000
--- a/libs/kproc/stbarrier.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include <kproc/barrier.h>
-#include <klib/rc.h>
-#include <atomic32.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-
-/*--------------------------------------------------------------------------
- * KBarrier
- *  a thread synchronization device
- *  detains all callers until the required number has been reached
- */
-struct KBarrier
-{
-    atomic32_t refcount;
-    uint32_t barrier;
-    uint32_t count;
-};
-
-
-/* Whack
- */
-static
-rc_t KBarrierWhack ( KBarrier *self )
-{
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  create a barrier
- *
- *  "count" [ IN ] - the number of threads to block
- */
-LIB_EXPORT rc_t CC KBarrierMake ( KBarrier **bp, uint32_t count )
-{
-    rc_t rc;
-    if ( bp == NULL )
-        rc = RC ( rcPS, rcBarrier, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KBarrier *b = malloc ( sizeof * b );
-        if ( b == NULL )
-            rc = RC ( rcPS, rcBarrier, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            atomic32_set ( & b -> refcount, 1 );
-            b -> barrier = count;
-            b -> count = 0;
-            * bp = b;
-            return 0;
-        }
-
-        * bp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KBarrierAddRef ( const KBarrier *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KBarrier* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KBarrierRelease ( const KBarrier *cself )
-{
-    KBarrier *self = ( KBarrier* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KBarrierWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Wait
- *  block until the required number of callers has been reached
- */
-LIB_EXPORT rc_t CC KBarrierWait ( KBarrier *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcBarrier, rcWaiting, rcSelf, rcNull );
-
-    if ( ++ self -> count < self -> barrier )
-    {
-        -- self -> count;
-        return RC ( rcPS, rcBarrier, rcWaiting, rcThread, rcDeadlock );
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/stcond.c b/libs/kproc/stcond.c
deleted file mode 100644
index 79084bf..0000000
--- a/libs/kproc/stcond.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kproc/extern.h>
-#include <kproc/cond.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- */
-struct KCondition
-{
-    atomic32_t refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KConditionWhack ( KCondition *self )
-{
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  create a condition
- */
-LIB_EXPORT rc_t CC KConditionMake ( KCondition **condp )
-{
-    rc_t rc;
-    if ( condp == NULL )
-        rc = RC ( rcPS, rcCondition, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KCondition *cond = malloc ( sizeof * cond );
-        if ( cond == NULL )
-            rc = RC ( rcPS, rcCondition, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            atomic32_set ( & cond -> refcount, 1 );
-            * condp = cond;
-            return 0;
-        }
-
-        * condp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KConditionAddRef ( const KCondition *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KCondition* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConditionRelease ( const KCondition *cself )
-{
-    KCondition *self = ( KCondition* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KConditionWhack ( self );
-    }
-    return 0;
-}
-
-
-/* Wait
- *  block on external lock until signaled
- */
-LIB_EXPORT rc_t CC KConditionWait ( KCondition *self, struct KLock *lock )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-
-    return RC ( rcPS, rcCondition, rcWaiting, rcThread, rcDeadlock );
-}
-
-LIB_EXPORT rc_t CC KConditionTimedWait ( KCondition *self, struct KLock *lock, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-    if ( tm == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcTimeout, rcNull );
-
-    return RC ( rcPS, rcCondition, rcWaiting, rcThread, rcDeadlock );
-}
-
-
-/* Signal
- *  signal waiting threads
- *  awaken at most a single thread
- */
-LIB_EXPORT rc_t CC KConditionSignal ( KCondition *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    return RC ( rcPS, rcCondition, rcSignaling, rcThread, rcDeadlock );
-}
-
-
-/* Broadcast
- *  signal waiting threads
- *  awaken all waiting thread
- */
-LIB_EXPORT rc_t CC KConditionBroadcast ( KCondition *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    return RC ( rcPS, rcCondition, rcSignaling, rcThread, rcDeadlock );
-}
diff --git a/libs/kproc/stlock.c b/libs/kproc/stlock.c
deleted file mode 100644
index dc5a961..0000000
--- a/libs/kproc/stlock.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kproc/extern.h>
-#include <kproc/lock.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-struct KLock
-{
-    atomic32_t refcount;
-    int32_t count;
-};
-
-
-/* Whack
- */
-static
-rc_t KLockWhack ( KLock *self )
-{
-    if ( self -> count > 0 )
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcBusy );
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  make a simple mutex
- */
-LIB_EXPORT rc_t CC KLockMake ( KLock **lockp )
-{
-    rc_t rc;
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            atomic32_set ( & lock -> refcount, 1 );
-            lock -> count = 0;
-            * lockp = lock;
-            return 0;
-        }
-
-        * lockp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KLockAddRef ( const KLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLockRelease ( const KLock *cself )
-{
-    KLock *self = ( KLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Acquire
- *  acquires lock
- */
-LIB_EXPORT rc_t CC KLockAcquire ( KLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    ++ self -> count;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KLockTimedAcquire ( KLock *self, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    ++ self -> count;
-
-    return 0;
-}
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KLockUnlock ( KLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcUnlocking, rcSelf, rcNull );
-
-    /* pthread_mutex_unlock's man page states that the only
-       unlock error we could see is that another thread tries
-       to release a lock. what if the lock is not locked? */
-    if ( self -> count <= 0 )
-        return RC ( rcPS, rcLock, rcUnlocking, rcThread, rcIncorrect );
-
-    -- self -> count;
-
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a POSIX-style read/write lock
- */
-struct KRWLock
-{
-    atomic32_t refcount;
-    int32_t count;
-};
-
-
-/* Whack
- */
-static
-rc_t KRWLockWhack ( KRWLock *self )
-{
-    if ( self -> count != 0 )
-        return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcBusy );
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  make a simple read/write lock
- */
-LIB_EXPORT rc_t CC KRWLockMake ( KRWLock **lockp )
-{
-    rc_t rc;
-
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcRWLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KRWLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcRWLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            atomic32_set ( & lock -> refcount, 1 );
-            lock -> count = 0;
-            * lockp = lock;
-            return 0;
-        }
-
-        * lockp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRWLockAddRef ( const KRWLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KRWLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockRelease ( const KRWLock *cself )
-{
-    KRWLock *self = ( KRWLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KRWLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* AcquireShared
- *  acquires read ( shared ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireShared ( KRWLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    if ( self -> count < 0 )
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-
-    ++ self -> count;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireShared ( KRWLock *self, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    if ( self -> count < 0 )
-    {
-        if ( tm == NULL )
-            return RC ( rcPS, rcLock, rcLocking, rcRWLock, rcBusy );
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    }
-
-    ++ self -> count;
-    return 0;
-}
-
-
-/* AcquireExcl
- *  acquires write ( exclusive ) lock
- */
-LIB_EXPORT rc_t CC KRWLockAcquireExcl ( KRWLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    if ( self -> count != 0 )
-        return RC ( rcPS, rcRWLock, rcLocking, rcThread, rcDeadlock );
-
-    -- self -> count;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireExcl ( KRWLock *self, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    if ( self -> count != 0 )
-    {
-        if ( tm == NULL )
-            return RC ( rcPS, rcLock, rcLocking, rcRWLock, rcBusy );
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    }
-
-    -- self -> count;
-    return 0;
-}
-
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KRWLockUnlock ( KRWLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcSelf, rcNull );
-
-    if ( self -> count < 0 )
-        self -> count = 0;
-    else if ( self -> count > 0 )
-        -- self -> count;
-    else
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcThread, rcIncorrect );
-
-    return 0;
-}
diff --git a/libs/kproc/stsem.c b/libs/kproc/stsem.c
deleted file mode 100644
index 458c9ce..0000000
--- a/libs/kproc/stsem.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include <kproc/sem.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-
-
-/*--------------------------------------------------------------------------
- * KSemaphore
- *  a metering device
- */
-struct KSemaphore
-{
-    uint64_t avail;
-    atomic32_t refcount;
-};
-
-
-/* Whack
- */
-static
-rc_t KSemaphoreWhack ( KSemaphore *self )
-{
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *
- *  "count" [ IN ] - initial count value
- */
-LIB_EXPORT rc_t CC KSemaphoreMake ( KSemaphore **semp, uint64_t count )
-{
-    rc_t rc;
-    if ( semp == NULL )
-        rc = RC ( rcPS, rcSemaphore, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KSemaphore *sem = malloc ( sizeof * sem );
-        if ( sem == NULL )
-            rc = RC ( rcPS, rcSemaphore, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            sem -> avail = count;
-            atomic32_set ( & sem -> refcount, 1 );
-            * semp = sem;
-            return 0;
-        }
-
-        * semp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KSemaphoreAddRef ( const KSemaphore *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KSemaphore* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSemaphoreRelease ( const KSemaphore *cself )
-{
-    KSemaphore *self = ( KSemaphore* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KSemaphoreWhack ( self );
-    }
-    return 0;
-}
-
-
-/* Wait
- *  block until a count becomes available
- *
- *  "lock" [ IN ] - externally acquired lock
- */
-LIB_EXPORT rc_t CC KSemaphoreWait ( KSemaphore *self, struct KLock *lock )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail == 0 )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcThread, rcDeadlock );
-
-    -- self -> avail;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSemaphoreTimedWait ( KSemaphore *self,
-    struct KLock *lock, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail == 0 )
-    {
-        if ( tm == NULL )
-            return RC ( rcPS, rcSemaphore, rcWaiting, rcTimeout, rcNull );
-
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcThread, rcDeadlock );
-    }
-
-    -- self -> avail;
-    return 0;
-}
-
-
-/* Signal
- *  signal that a count has become available
- */
-LIB_EXPORT rc_t CC KSemaphoreSignal ( KSemaphore *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcSignaling, rcSelf, rcNull );
-
-    ++ self -> avail;
-    return 0;
-}
-
-
-/* Alloc
- *  allocate a count
- *  used for resource metering
- *
- *  "lock" [ IN ] - externally acquired lock
- *
- *  "count" [ IN ] - the resource count
- */
-LIB_EXPORT rc_t CC KSemaphoreAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail < count )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcThread, rcDeadlock );
-
-    self -> avail -= count;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KSemaphoreTimedAlloc ( KSemaphore *self,
-    struct KLock *lock, uint64_t count, struct timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcSelf, rcNull );
-
-    if ( self -> avail < count )
-    {
-        if ( tm == NULL )
-            return RC ( rcPS, rcSemaphore, rcWaiting, rcTimeout, rcNull );
-
-        return RC ( rcPS, rcSemaphore, rcWaiting, rcThread, rcDeadlock );
-    }
-
-    self -> avail -= count;
-    return 0;
-}
-
-
-/* Free
- *  signal that resources have become available
- */
-LIB_EXPORT rc_t CC KSemaphoreFree ( KSemaphore *self, uint64_t count )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcSemaphore, rcSignaling, rcSelf, rcNull );
-
-    self -> avail += count;
-    return 0;
-}
-
-
-/* Count
- *  request the current resource usage
- *  valid only within lock
- *
- *  "count" [ OUT ] - return parameter for current count
- */
-LIB_EXPORT rc_t CC KSemaphoreCount ( const KSemaphore *self, uint64_t *count )
-{
-    rc_t rc;
-    if ( count == NULL )
-        rc = RC ( rcPS, rcSemaphore, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcPS, rcSemaphore, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * count = self -> avail;
-            return 0;
-        }
-
-        * count = 0;
-    }
-    return rc;
-}
diff --git a/libs/kproc/stthread.c b/libs/kproc/stthread.c
deleted file mode 100644
index 982b13b..0000000
--- a/libs/kproc/stthread.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kproc/extern.h>
-#include <kproc/thread.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-
-/*--------------------------------------------------------------------------
- * KThread
- *  a CPU execution thread
- */
-struct KThread
-{
-    atomic32_t refcount;
-    rc_t rc;
-};
-
-
-/* Whack
- */
-static
-rc_t KThreadWhack ( KThread *self )
-{
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  create and run a thread
- *
- *  "run_thread" [ IN ] - thread entrypoint
- *
- *  "data" [ IN, OPAQUE ] - user-supplied thread data
- */
-LIB_EXPORT rc_t CC KThreadMake ( KThread **tp,
-    rc_t ( * run_thread ) ( const KThread*, void* ), void *data )
-{
-    rc_t rc;
-    if ( tp == NULL )
-        rc = RC ( rcPS, rcThread, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( run_thread == NULL )
-            rc = RC ( rcPS, rcThread, rcCreating, rcFunction, rcNull );
-        else
-        {
-            KThread *t = malloc ( sizeof * t );
-            if ( t == NULL )
-                rc = RC ( rcPS, rcThread, rcCreating, rcMemory, rcExhausted );
-            else
-            {
-                /* run function on current thread */
-                atomic32_set ( & t -> refcount, 1 );
-                t -> rc = ( * run_thread ) ( t, data );
-                * tp = t;
-                return 0;
-            }
-        }
-
-        * tp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KThreadAddRef ( const KThread *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KThread* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KThreadRelease ( const KThread *cself )
-{
-    KThread *self = ( KThread* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KThreadWhack ( self );
-    }
-    return 0;
-}
-
-
-/* Cancel
- *  signal the thread to finish
- */
-LIB_EXPORT rc_t CC KThreadCancel ( KThread *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcSignaling, rcSelf, rcNull );
-    return RC ( rcPS, rcThread, rcSignaling, rcThread, rcDestroyed );
-}
-
-
-/* Wait
- *  waits for a thread to exit
- *
- *  "status" [ OUT ] - return parameter for thread's exit code
- */
-LIB_EXPORT rc_t CC KThreadWait ( KThread *self, rc_t *status )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcWaiting, rcSelf, rcNull );
-    if ( status != NULL )
-        * status = self -> rc;
-    return 0;
-}
-
-
-/* Detach
- *  allow thread to run independently of group
- */
-LIB_EXPORT rc_t CC KThreadDetach ( KThread *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcDetaching, rcSelf, rcNull );
-    return RC ( rcPS, rcThread, rcDetaching, rcThread, rcDestroyed );
-}
diff --git a/libs/kproc/sttimeout.c b/libs/kproc/sttimeout.c
deleted file mode 100644
index 47ba6cc..0000000
--- a/libs/kproc/sttimeout.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include <kproc/timeout.h>
-#include <os-native.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-/*--------------------------------------------------------------------------
- * timeout_t
- *  a structure for communicating a timeout
- */
-
-/* Init
- *  initialize a timeout in milliseconds
- */
-LIB_EXPORT rc_t CC TimeoutInit ( timeout_t *tm, uint32_t msec )
-{
-    if ( tm == NULL )
-        return RC ( rcPS, rcTimeout, rcConstructing, rcSelf, rcNull );
-
-    tm -> mS = msec;
-    tm -> prepared = false;
-
-    return 0;
-}
-
-/* Prepare
- *  ensures that a timeout is prepared with an absolute value
-*/
-LIB_EXPORT rc_t CC TimeoutPrepare ( timeout_t *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcTimeout, rcUpdating, rcSelf, rcNull );
-
-    if ( ! self -> prepared )
-        self -> prepared = true;
-
-    return 0;
-}
diff --git a/libs/kproc/task.c b/libs/kproc/task.c
deleted file mode 100644
index 3a7fcc7..0000000
--- a/libs/kproc/task.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-
-#include <kproc/task.h>
-#include <kproc/impl.h>
-#include <klib/rc.h>
-
-#define rcTask rcCmd
-
-
-/*--------------------------------------------------------------------------
- * KTask
- *  a deferred task abstraction
- *  specific task objects are constructed with required parameters
- *  and implement the Execute method to perform their operation
- */
-
-
-/* Whack
- */
-static
-rc_t KTaskWhack ( KTask * self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcTask, rcDestroying, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . destroy ) ( self );
-    }
-
-    return RC ( rcPS, rcTask, rcDestroying, rcInterface, rcBadVersion );
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KTaskAddRef ( const KTask *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KTask" ) )
-        {
-        case krefLimit:
-            return RC ( rcPS, rcTask, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KTaskRelease ( const KTask *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KTask" ) )
-        {
-        case krefWhack:
-            return KTaskWhack ( ( KTask* ) self );
-        case krefNegative:
-            return RC ( rcPS, rcTask, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Execute
- *  perform deferred operation
- */
-LIB_EXPORT rc_t CC KTaskExecute ( KTask *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcTask, rcExecuting, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return ( * self -> vt -> v1 . execute ) ( self );
-    }
-
-    return RC ( rcPS, rcTask, rcExecuting, rcInterface, rcBadVersion );
-}
-
-
-/* Init
- *  initialize a newly allocated task object
- */
-LIB_EXPORT rc_t CC KTaskInit ( KTask *self, const KTask_vt *vt, const char *clsname, const char *name )
-{
-    if ( self == NULL )
-        return RC ( rcFS, rcTask, rcConstructing, rcSelf, rcNull );
-    if ( vt == NULL )
-        return RC ( rcFS, rcTask, rcConstructing, rcInterface, rcNull );
-    switch ( vt -> v1 . maj )
-    {
-    case 1:
-        switch ( vt -> v1 . min )
-        {
-            /* insert new minor versions in reverse order */
-        case 0:
-#if _DEBUGGING
-            if ( vt -> v1 . destroy == NULL ||
-                 vt -> v1 . execute == NULL )
-            return RC ( rcFS, rcTask, rcConstructing, rcInterface, rcNull );
-#endif
-            break;
-        default:
-            return RC ( rcFS, rcTask, rcConstructing, rcInterface, rcInvalid );
-        }
-        break;
-    default:
-        return RC ( rcFS, rcTask, rcConstructing, rcInterface, rcInvalid );
-    }
-
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, clsname, "init", name );
-    return 0;
-}
-
-
-/* Destroy
- *  destroy task
- */
-LIB_EXPORT rc_t CC KTaskDestroy ( KTask *self, const char *clsname )
-{
-    if ( self != NULL )
-        KRefcountWhack ( & self -> refcount, clsname );
-    return 0;
-}
diff --git a/libs/kproc/unix/syscond-priv.h b/libs/kproc/unix/syscond-priv.h
deleted file mode 100644
index ba8ba01..0000000
--- a/libs/kproc/unix/syscond-priv.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_syscond_priv_
-#define _h_syscond_priv_
-
-#include <pthread.h>
-#include <atomic32.h>
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-struct KCondition
-{
-    pthread_cond_t cond;
-    atomic32_t refcount;
-};
-
-/* Init
- *  initialize an inline KCondition
- */
-rc_t KConditionInit ( struct KCondition *self );
-
-/* Destroy
- *  run destructor on inline KCondition
- */
-rc_t KConditionDestroy ( struct KCondition *self );
-
-/* DropRef
- *  manipulates reference counter
- *  returns true if last ref
- */
-int KConditionDropRef ( struct KCondition const *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_syscond_priv_ */
diff --git a/libs/kproc/unix/syscond.c b/libs/kproc/unix/syscond.c
deleted file mode 100644
index cebf31a..0000000
--- a/libs/kproc/unix/syscond.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "syslock-priv.h"
-#include "syscond-priv.h"
-
-#include <kproc/extern.h>
-#include <os-native.h>
-#include <kproc/timeout.h>
-#include <kproc/cond.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#if _DEBUGGING && 0
-#define CMSG( msg, ... ) \
-    KOutMsg ( msg, __VA_ARGS__ )
-#else
-#define CMSG( msg, ... ) \
-    ( void ) 0
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-
-
-/* Destroy
- */
-LIB_EXPORT rc_t CC KConditionDestroy ( KCondition *self )
-{
-    int status = pthread_cond_destroy ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcCondition, rcDestroying, rcCondition, rcBusy );
-    default:
-        return RC ( rcPS, rcCondition, rcDestroying, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Whack
- */
-static
-rc_t KConditionWhack ( KCondition *self )
-{
-    rc_t rc = KConditionDestroy ( self );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Init
- */
-LIB_EXPORT rc_t CC KConditionInit ( KCondition *self )
-{
-    int status;
-
-    assert ( self != NULL );
-    status = pthread_cond_init ( & self -> cond, NULL );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EAGAIN:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcExhausted );
-    case ENOMEM:
-        return RC ( rcPS, rcCondition, rcConstructing, rcMemory, rcExhausted );
-    case EBUSY:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcInvalid );
-    default:
-        return RC ( rcPS, rcCondition, rcConstructing, rcNoObj, rcUnknown );
-    }
-
-    atomic32_set ( & self -> refcount, 1 );
-    return 0;
-}
-
-
-/* Make
- *  create a condition
- */
-LIB_EXPORT rc_t CC KConditionMake ( KCondition **condp )
-{
-    rc_t rc;
-    if ( condp == NULL )
-        rc = RC ( rcPS, rcCondition, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KCondition *cond = malloc ( sizeof * cond );
-        if ( cond == NULL )
-            rc = RC ( rcPS, rcCondition, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KConditionInit ( cond );
-            if ( rc == 0 )
-            {
-                * condp = cond;
-                return 0;
-            }
-            
-            free ( cond );
-        }
-
-        * condp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KConditionAddRef ( const KCondition *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KCondition* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConditionRelease ( const KCondition *cself )
-{
-    KCondition *self = ( KCondition* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_read_and_add ( & self -> refcount, -1 ) <= 1 )
-            return KConditionWhack ( self );
-    }
-    return 0;
-}
-
-/* DropRef
- *  manipulates reference counter
- *  returns true if last ref
- */
-LIB_EXPORT int CC KConditionDropRef ( const KCondition *cself )
-{
-    assert ( cself != NULL );
-    return atomic32_dec_and_test ( & ( ( KCondition* ) cself ) -> refcount );
-}
-
-
-/* Wait
- *  block on external lock until signaled
- */
-LIB_EXPORT rc_t CC KConditionWait ( KCondition *self, struct KLock *lock )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-
-    status = pthread_cond_wait ( & self -> cond, & lock -> mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConditionTimedWait ( KCondition *self, struct KLock *lock, timeout_t *tm )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-    if ( tm == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcTimeout, rcNull );
-
-    CMSG ( "%s[%p]: testing timeout structure\n", __func__, self );
-    if ( ! tm -> prepared )
-    {
-        CMSG ( "%s[%p]: preparing timeout...\n", __func__, self );
-        TimeoutPrepare ( tm );
-        CMSG ( "%s[%p]: ...done preparing timeout\n", __func__, self );
-    }
-
-#if 1
-    CMSG ( "%s[%p]: calling 'pthread_cond_timedwait ( cond = %p, mutex = %p, ts = %p )'...\n"
-           , __func__, self, & self -> cond, & lock -> mutex, & tm -> ts
-        );
-    status = pthread_cond_timedwait ( & self -> cond, & lock -> mutex, & tm -> ts );
-#else
-    CMSG ( "%s[%p]: calling 'pthread_cond_wait ( cond = %p, mutex = %p )'...\n"
-           , __func__, self, & self -> cond, & lock -> mutex, & tm -> ts
-        );
-    status = pthread_cond_wait ( & self -> cond, & lock -> mutex );
-#endif
-    CMSG ( "%s[%p]: ...done, OS status = %!\n", __func__, self, status );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ETIMEDOUT:
-        return RC ( rcPS, rcCondition, rcWaiting, rcTimeout, rcExhausted );
-/*
-  The pthread_cond_timedwait() function shall fail if:
-
-  ETIMEDOUT
-  The time specified by abstime to pthread_cond_timedwait() has passed.
-
-  The pthread_cond_timedwait() and pthread_cond_wait() functions may fail if:
-
-  EINVAL The value specified by cond, mutex, or abstime is invalid.
-
-  EINVAL Different mutexes were supplied for concurrent pthread_cond_timedwait()
-  or pthread_cond_wait() operations on the same condition variable.
-
-  EPERM  The mutex was not owned by the current thread at the time of the call.
-
-  *** These functions shall not return an error code of [EINTR]. ***
-
- */
-    case EINTR:
-        return RC ( rcPS, rcCondition, rcWaiting, rcThread, rcInterrupted );
-    default:
-        return RC ( rcPS, rcCondition, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Signal
- *  signal waiting threads
- *  awaken at most a single thread
- */
-LIB_EXPORT rc_t CC KConditionSignal ( KCondition *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    status = pthread_cond_signal ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcSignaling, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Broadcast
- *  signal waiting threads
- *  awaken all waiting thread
- */
-LIB_EXPORT rc_t CC KConditionBroadcast ( KCondition *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    status = pthread_cond_broadcast ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcSignaling, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/unix/systhread.c b/libs/kproc/unix/systhread.c
deleted file mode 100644
index 5707d41..0000000
--- a/libs/kproc/unix/systhread.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-#include <kproc/thread.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-
-/*--------------------------------------------------------------------------
- * KThread
- *  a CPU execution thread
- */
-struct KThread
-{
-    /* thread entrypoint and data */
-    rc_t ( * run ) ( const KThread*, void* );
-    void *data;
-
-    pthread_t thread;
-    atomic32_t waiting;
-    atomic32_t refcount;
-    rc_t rc;
-    bool join;
-};
-
-
-/* Whack
- */
-static
-rc_t KThreadWhack ( KThread *self )
-{
-    if ( self -> join )
-    {
-        void *td;
-        pthread_join ( self -> thread, & td );
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* Run
- */
-static
-void *KThreadRun ( void *td )
-{
-    KThread *self = td;
-
-    /* run the function */
-    self -> rc = ( * self -> run ) ( self, self -> data );
-
-    /* release thread's reference */
-    if ( atomic32_dec_and_test ( & self -> refcount ) )
-        free ( self );
-
-    return NULL;
-}
-
-
-/* Make
- *  create and run a thread
- *
- *  "run_thread" [ IN ] - thread entrypoint
- *
- *  "data" [ IN, OPAQUE ] - user-supplied thread data
- */
-LIB_EXPORT rc_t CC KThreadMake ( KThread **tp,
-    rc_t ( CC * run_thread ) ( const KThread*, void* ), void *data )
-{
-    rc_t rc;
-    if ( tp == NULL )
-        rc = RC ( rcPS, rcThread, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( run_thread == NULL )
-            rc = RC ( rcPS, rcThread, rcCreating, rcFunction, rcNull );
-        else
-        {
-            KThread *t = malloc ( sizeof * t );
-            if ( t == NULL )
-                rc = RC ( rcPS, rcThread, rcCreating, rcMemory, rcExhausted );
-            else
-            {
-                int status;
-
-                /* finish constructing thread */
-                t -> run = run_thread;
-                t -> data = data;
-                atomic32_set ( & t -> waiting, 0 );
-                atomic32_set ( & t -> refcount, 2 );
-                t -> rc = 0;
-                t -> join = true;
-
-                /* attempt to create thread */
-                status = pthread_create ( & t -> thread, 0, KThreadRun, t );
-                if ( status == 0 )
-                {
-                    * tp = t;
-                    return 0;
-                }
-
-                /* see why we failed */
-                switch ( status )
-                {
-                case EAGAIN:
-                    rc = RC ( rcPS, rcThread, rcCreating, rcThread, rcExhausted );
-                    break;
-                default:
-                    rc = RC ( rcPS, rcThread, rcCreating, rcNoObj, rcUnknown );
-                }
-
-                free ( t );
-            }
-        }
-
-        * tp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KThreadAddRef ( const KThread *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KThread* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KThreadRelease ( const KThread *cself )
-{
-    KThread *self = ( KThread* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KThreadWhack ( self );
-    }
-    return 0;
-}
-
-
-/* Cancel
- *  signal the thread to finish
- */
-LIB_EXPORT rc_t CC KThreadCancel ( KThread *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcSignaling, rcSelf, rcNull );
-
-    status = pthread_cancel ( self -> thread );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ESRCH:
-        self -> join = false;
-        return RC ( rcPS, rcThread, rcSignaling, rcThread, rcDestroyed );
-    default:
-        return RC ( rcPS, rcThread, rcSignaling, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Wait
- *  waits for a thread to exit
- *
- *  "status" [ OUT ] - return parameter for thread's exit code
- */
-LIB_EXPORT rc_t CC KThreadWait ( KThread *self, rc_t *out )
-{
-    void *td;
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcWaiting, rcSelf, rcNull );
-
-    /* prevent multiple waiters */
-    if ( atomic32_test_and_set ( & self -> waiting, 0, 1 ) != 0 )
-        return RC ( rcPS, rcThread, rcWaiting, rcThread, rcBusy );
-
-    status = pthread_join ( self -> thread, & td );
-
-    /* release waiter lock */                                                                                                                                                                                   
-    atomic32_set ( & self -> waiting, 0 );
-
-    switch ( status )
-    {
-    case 0:
-        break;
-    case ESRCH:
-        return RC ( rcPS, rcThread, rcWaiting, rcThread, rcDestroyed );
-    case EINVAL:
-        return RC ( rcPS, rcThread, rcWaiting, rcThread, rcDetached );
-    case EDEADLK:
-        return RC ( rcPS, rcThread, rcWaiting, rcThread, rcDeadlock );
-    default:
-        return RC ( rcPS, rcThread, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    self -> join = false;
-
-    if ( td == PTHREAD_CANCELED )
-        self -> rc = RC ( rcPS, rcThread, rcWaiting, rcThread, rcCanceled );
-
-    if ( out != NULL )
-        * out = self -> rc;
-
-    return 0;
-}
-
-
-/* Detach
- *  allow thread to run independently of group
- */
-LIB_EXPORT rc_t CC KThreadDetach ( KThread *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcThread, rcDetaching, rcSelf, rcNull );
-
-    status = pthread_detach ( self -> thread );
-    switch ( status )
-    {
-    case 0:
-    case EINVAL:
-        break;
-    case ESRCH:
-        return RC ( rcPS, rcThread, rcDetaching, rcThread, rcDestroyed );
-    default:
-        return RC ( rcPS, rcThread, rcDetaching, rcNoObj, rcUnknown );
-    }
-
-    self -> join = false;
-    return 0;
-}
diff --git a/libs/kproc/unix/systimeout.c b/libs/kproc/unix/systimeout.c
deleted file mode 100644
index 9dbb97b..0000000
--- a/libs/kproc/unix/systimeout.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sysalloc.h>
-#include <kproc/timeout.h>
-#include <os-native.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-
-
-/*--------------------------------------------------------------------------
- * timeout_t
- *  a structure for communicating a timeout
- *  which under Unix converts to an absolute time once prepared
- */
-
-
-/* Init
- *  initialize a timeout in milliseconds
- */
-rc_t TimeoutInit ( timeout_t *tm, uint32_t msec )
-{
-    if ( tm == NULL )
-        return RC ( rcPS, rcTimeout, rcConstructing, rcSelf, rcNull );
-
-    tm -> mS = msec;
-    tm -> prepared = false;
-
-    return 0;
-}
-
-/* Prepare
- *  ensures that a timeout is prepared with an absolute value
-*/
-rc_t TimeoutPrepare ( timeout_t *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcTimeout, rcUpdating, rcSelf, rcNull );
-
-    if ( ! self -> prepared )
-    {
-        struct timeval tv;
-        struct timezone tz;
-        int64_t abs_micros;
-
-        /* current time in seconds and uS */
-        gettimeofday ( & tv, & tz );
-    
-        /* convert to uS */
-        abs_micros = tv . tv_sec;
-        abs_micros = abs_micros * 1000 * 1000 + tv . tv_usec;
-    
-        /* add wait period for future timeout */
-        abs_micros += ( uint64_t ) self -> mS * 1000;
-    
-        /* convert to seconds and nS */
-        self -> ts . tv_sec = ( time_t ) ( abs_micros / 1000000 );
-        self -> ts . tv_nsec = ( uint32_t ) ( ( abs_micros % 1000000 ) * 1000 );
-        self -> prepared = true;
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/win/syscond-priv.h b/libs/kproc/win/syscond-priv.h
deleted file mode 100644
index 509a913..0000000
--- a/libs/kproc/win/syscond-priv.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_syscond_priv_
-#define _h_syscond_priv_
-
-#if 0
-#include <pthread.h>
-#endif
-
-#include <atomic32.h>
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-struct KCondition;
-
-
-/* Init
- *  initialize an inline KCondition
- */
-rc_t KConditionInit ( struct KCondition *self );
-
-/* Destroy
- *  run destructor on inline KCondition
- */
-rc_t KConditionDestroy ( struct KCondition *self );
-
-/* DropRef
- *  manipulates reference counter
- *  returns true if last ref
- */
-int KConditionDropRef ( struct KCondition const *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_syscond_priv_ */
diff --git a/libs/kproc/win/syscond.c b/libs/kproc/win/syscond.c
deleted file mode 100644
index 8777f2f..0000000
--- a/libs/kproc/win/syscond.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-
-#include "syslock-priv.h"
-#include "syscond-priv.h"
-
-#include <os-native.h>
-#include <kproc/timeout.h>
-#include <kproc/cond.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#include <time.h> /* struct timespec */
-
-/* #include <stdio.h> */
-
-
-/*
-
-This Windows condition implementation is taken from 
-"Strategies for Implementing POSIX Condition Variables on Win32"
-by Douglas C. Schmidt
-( http://www.cs.wustl.edu/~schmidt/win32-cv-1.html ) :
-
-3.4. The SignalObjectAndWait Solution
-The implementation relies on the Windows NT 4.0 SignalObjectAndWait function,
-thus it is not available in Windows CE, Windows '95, or Windows NT 3.51.
-
-The code was taken from the article.
-
-The C++ source code for POSIX condition variable on Win32
-described in the article is freely available with the ACE framework
-at //www.cs.wustl.edu/~schmidt/ACE.html.
-It is possible that the latter is better.
-
-*/
-
-
-typedef struct
-{
-  int waiters_count_;
-  // Number of waiting threads.
-
-  CRITICAL_SECTION waiters_count_lock_;
-  // Serialize access to <waiters_count_>.
-
-  HANDLE sema_;
-  // Semaphore used to queue up threads waiting for the condition to
-  // become signaled. 
-
-  HANDLE waiters_done_;
-  // An auto-reset event used by the broadcast/signal thread to wait
-  // for all the waiting thread(s) to wake up and be released from the
-  // semaphore. 
-
-  size_t was_broadcast_;
-  // Keeps track of whether we were broadcasting or signaling.  This
-  // allows us to optimize the code if we're just signaling.
-} pthread_cond_t;
-
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-struct KCondition
-{
-    pthread_cond_t cond;
-
-    atomic32_t refcount;
-};
-
-
-typedef HANDLE pthread_mutex_t;
-typedef struct pthread_condattr_t { char dummy; } pthread_condattr_t;
-
-int 
-pthread_cond_init (pthread_cond_t *cv,
-                   const pthread_condattr_t *dummy)
-{
-  cv->waiters_count_ = 0;
-  cv->was_broadcast_ = 0;
-  cv->sema_ = CreateSemaphore (NULL,       // no security
-                                0,          // initially 0
-                                0x7fffffff, // max count
-                                NULL);      // unnamed 
-  InitializeCriticalSection (&cv->waiters_count_lock_);
-  cv->waiters_done_ = CreateEvent (NULL,  // no security
-                                   FALSE, // auto-reset
-                                   FALSE, // non-signaled initially
-                                   NULL); // unnamed
-  return 0;
-}
-
-int pthread_cond_destroy (pthread_cond_t *cv) {
-    CloseHandle(cv->sema_);
-    DeleteCriticalSection(&cv->waiters_count_lock_);
-    CloseHandle(cv->waiters_done_);
-    memset(cv, 0, sizeof *cv);
-    return 0;
-}
-
-#ifndef timespec
-typedef struct timespec
-  {
-    time_t tv_sec;            /* Seconds.  */
-    long int tv_nsec;           /* Nanoseconds.  */
-  } timespec;
-#endif
-
-int pthread_cond_waitImpl (pthread_cond_t *cv, 
-                   pthread_mutex_t *external_mutex,
-                   const struct timespec *abstime,
-                   bool infinite)
-{
-    int last_waiter;
-    DWORD dwMilliseconds = INFINITE;
-
-  // Avoid race conditions.
-  EnterCriticalSection (&cv->waiters_count_lock_);
-  cv->waiters_count_++;
-  LeaveCriticalSection (&cv->waiters_count_lock_);
-
-  // This call atomically releases the mutex and waits on the
-  // semaphore until <pthread_cond_signal> or <pthread_cond_broadcast>
-  // are called by another thread.
-  if (!infinite && abstime != NULL)
-  { dwMilliseconds = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; }
-  SignalObjectAndWait (*external_mutex, cv->sema_, dwMilliseconds, FALSE);
-
-  // Reacquire lock to avoid race conditions.
-  EnterCriticalSection (&cv->waiters_count_lock_);
-
-  // We're no longer waiting...
-  cv->waiters_count_--;
-
-  // Check to see if we're the last waiter after <pthread_cond_broadcast>.
-  last_waiter = cv->was_broadcast_ && cv->waiters_count_ == 0;
-
-  LeaveCriticalSection (&cv->waiters_count_lock_);
-
-  // If we're the last waiter thread during this particular broadcast
-  // then let all the other threads proceed.
-  if (last_waiter)
-    // This call atomically signals the <waiters_done_> event and waits until
-    // it can acquire the <external_mutex>.
-    // This is required to ensure fairness.
-    SignalObjectAndWait (cv->waiters_done_, *external_mutex, INFINITE, FALSE);
-  else {
-    // Always regain the external mutex since that's the guarantee we
-    // give to our callers. 
-/*      fprintf(stderr, "%s: WaitForSingleObject...\n", __func__); */
-    WaitForSingleObject (*external_mutex, INFINITE);
-/*      fprintf(stderr, "... %s: WaitForSingleObject\n", __func__); */
-  }
-
-  return 0;
-}
-
-int pthread_cond_timedwait(pthread_cond_t *cv,
-              pthread_mutex_t *external_mutex,
-              const struct timespec *abstime)
-{
-  return pthread_cond_waitImpl(cv, external_mutex, abstime, false);
-}
-
-int
-pthread_cond_wait (pthread_cond_t *cv, 
-                   pthread_mutex_t *external_mutex)
-{
-  return pthread_cond_waitImpl(cv, external_mutex, NULL, true);
-}
-
-int
-pthread_cond_signal (pthread_cond_t *cv)
-{
-    int have_waiters;
-
-  EnterCriticalSection (&cv->waiters_count_lock_);
-  have_waiters = cv->waiters_count_ > 0;
-  LeaveCriticalSection (&cv->waiters_count_lock_);
-
-  // If there aren't any waiters, then this is a no-op.  
-  if (have_waiters)
-    ReleaseSemaphore (cv->sema_, 1, 0);
-
-  return 0;
-}
-
-int
-pthread_cond_broadcast (pthread_cond_t *cv)
-{
-  int have_waiters = 0;
-
-  // This is needed to ensure that <waiters_count_> and <was_broadcast_> are
-  // consistent relative to each other.
-  EnterCriticalSection (&cv->waiters_count_lock_);
-
-  if (cv->waiters_count_ > 0) {
-    // We are broadcasting, even if there is just one waiter...
-    // Record that we are broadcasting, which helps optimize
-    // <pthread_cond_wait> for the non-broadcast case.
-    cv->was_broadcast_ = 1;
-    have_waiters = 1;
-  }
-
-  if (have_waiters) {
-    // Wake up all the waiters atomically.
-    ReleaseSemaphore (cv->sema_, cv->waiters_count_, 0);
-
-    LeaveCriticalSection (&cv->waiters_count_lock_);
-
-    // Wait for all the awakened threads to acquire the counting
-    // semaphore. 
-    WaitForSingleObject (cv->waiters_done_, INFINITE);
-    // This assignment is okay, even without the <waiters_count_lock_> held 
-    // because no other waiter threads can wake up to access it.
-    cv->was_broadcast_ = 0;
-  }
-  else
-    LeaveCriticalSection (&cv->waiters_count_lock_);
-
-  return 0;
-}
-
-/*--------------------------------------------------------------------------
- * KCondition
- *  a POSIX-style condition object
- *  ( requires an external lock object )
- *
- *  usage: the user first acquires an external lock. then, depending upon
- *  the operation, will either test for a condition or establish it, where
- *  the former involves the potential to wait for a signal and the latter
- *  to generate a signal using the external lock for blocking.
- */
-
-/* Destroy
- */
-rc_t KConditionDestroy ( KCondition *self )
-{
-    int status = pthread_cond_destroy ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EBUSY:
-        return RC ( rcPS, rcCondition, rcDestroying, rcCondition, rcBusy );
-    default:
-        return RC ( rcPS, rcCondition, rcDestroying, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Whack
- */
-static
-rc_t KConditionWhack ( KCondition *self )
-{
-    rc_t rc = KConditionDestroy ( self );
-    if ( rc == 0 )
-        free ( self );
-    return rc;
-}
-
-/* Init
- */
-rc_t KConditionInit ( KCondition *self )
-{
-    int status;
-
-    assert ( self != NULL );
-    status = pthread_cond_init ( & self -> cond, NULL );
-    switch ( status )
-    {
-    case 0:
-        break;
-    case EAGAIN:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcExhausted );
-    case ENOMEM:
-        return RC ( rcPS, rcCondition, rcConstructing, rcMemory, rcExhausted );
-    case EBUSY:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcBusy );
-    case EINVAL:
-        return RC ( rcPS, rcCondition, rcConstructing, rcCondition, rcInvalid );
-    default:
-        return RC ( rcPS, rcCondition, rcConstructing, rcNoObj, rcUnknown );
-    }
-
-    atomic32_set ( & self -> refcount, 1 );
-    return 0;
-}
-
-
-/* Make
- *  create a condition
- */
-LIB_EXPORT rc_t CC KConditionMake ( KCondition **condp )
-{
-    rc_t rc;
-    if ( condp == NULL )
-        rc = RC ( rcPS, rcCondition, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KCondition *cond = malloc ( sizeof * cond );
-        if ( cond == NULL )
-            rc = RC ( rcPS, rcCondition, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KConditionInit ( cond );
-            if ( rc == 0 )
-            {
-                * condp = cond;
-                return 0;
-            }
-            
-            free ( cond );
-        }
-
-        * condp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KConditionAddRef ( const KCondition *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KCondition* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConditionRelease ( const KCondition *cself )
-{
-    KCondition *self = ( KCondition* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-            return KConditionWhack ( self );
-    }
-    return 0;
-}
-
-/* DropRef
- *  manipulates reference counter
- *  returns true if last ref
- */
-int KConditionDropRef ( const KCondition *cself )
-{
-    assert ( cself != NULL );
-    return atomic32_dec_and_test ( & ( ( KCondition* ) cself ) -> refcount );
-}
-
-
-/* Wait
- *  block on external lock until signaled
- */
-LIB_EXPORT rc_t CC KConditionWait ( KCondition *self, struct KLock *lock )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-
-    status = pthread_cond_wait ( & self -> cond, & lock -> mutex );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KConditionTimedWait ( KCondition *self, struct KLock *lock, timeout_t *tm )
-{
-    int status;
-    timespec ts;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcSelf, rcNull );
-    if ( lock == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcLock, rcNull );
-    if ( tm == NULL )
-        return RC ( rcPS, rcCondition, rcWaiting, rcTimeout, rcNull );
-
-    if ( ! tm -> prepared )
-        TimeoutPrepare ( tm );
-
-    memset(&ts, 0, sizeof ts);
-    ts.tv_sec = tm -> mS / 1000;
-    ts.tv_nsec = (tm -> mS - ts.tv_sec * 1000) * 1000000;
-
-    status = pthread_cond_timedwait ( & self -> cond, & lock -> mutex, & ts );
-    switch ( status )
-    {
-    case 0:
-        break;
-/*  case ETIMEDOUT:
-        return RC ( rcPS, rcCondition, rcWaiting, rcTimeout, rcExhausted ); */
-    case EINTR:
-        return RC ( rcPS, rcCondition, rcWaiting, rcThread, rcInterrupted );
-    default:
-        return RC ( rcPS, rcCondition, rcWaiting, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Signal
- *  signal waiting threads
- *  awaken at most a single thread
- */
-LIB_EXPORT rc_t CC KConditionSignal ( KCondition *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    status = pthread_cond_signal ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcSignaling, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
-
-
-/* Broadcast
- *  signal waiting threads
- *  awaken all waiting thread
- */
-LIB_EXPORT rc_t CC KConditionBroadcast ( KCondition *self )
-{
-    int status;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcCondition, rcSignaling, rcSelf, rcNull );
-
-    status = pthread_cond_broadcast ( & self -> cond );
-    switch ( status )
-    {
-    case 0:
-        break;
-    default:
-        return RC ( rcPS, rcCondition, rcSignaling, rcNoObj, rcUnknown );
-    }
-
-    return 0;
-}
diff --git a/libs/kproc/win/syslock-priv.h b/libs/kproc/win/syslock-priv.h
deleted file mode 100644
index ea751af..0000000
--- a/libs/kproc/win/syslock-priv.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_syslock_priv_
-#define _h_syslock_priv_
-
-#ifndef _h_os_native_
-#include <os-native.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a POSIX-style mutual exclusion lock
- */
-struct KLock
-{
-    HANDLE mutex;
-    KRefcount refcount;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_syslock_priv_ */
diff --git a/libs/kproc/win/syslock.c b/libs/kproc/win/syslock.c
deleted file mode 100644
index 5159eef..0000000
--- a/libs/kproc/win/syslock.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kproc/extern.h>
-
-#include "syslock-priv.h"
-#include <kproc/timeout.h>
-#include <kproc/lock.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KLock
- *  a mutual exclusion lock
- */
-
-/* Whack
- */
-static
-rc_t KLockWhack ( KLock *self )
-{
-    if ( CloseHandle ( self -> mutex ) )
-    {
-        free ( self );
-        return 0;
-    }
-
-    switch ( GetLastError () )
-    {
-    case ERROR_INVALID_HANDLE:
-        return RC ( rcPS, rcLock, rcDestroying, rcLock, rcInvalid );
-    }
-
-    return RC ( rcPS, rcLock, rcDestroying, rcNoObj, rcUnknown );
-}
-
-
-/* Make
- *  make a simple mutex
- */
-LIB_EXPORT rc_t CC KLockMake ( KLock **lockp )
-{
-    rc_t rc;
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            lock -> mutex = CreateMutex ( NULL, false, NULL );
-            if ( lock -> mutex != NULL )
-            {
-                atomic32_set ( & lock -> refcount, 1 );
-                * lockp = lock;
-                return 0;
-            }
-
-            switch ( GetLastError () )
-            {
-            default:
-                rc = RC ( rcPS, rcLock, rcConstructing, rcNoObj, rcUnknown );
-            }
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KLockAddRef ( const KLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KLock* ) cself ) -> refcount );
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KLockRelease ( const KLock *cself )
-{
-    KLock *self = ( KLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* Acquire
- *  acquires lock
- */
-LIB_EXPORT rc_t CC KLockAcquire ( KLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    switch ( WaitForSingleObject ( self -> mutex, INFINITE ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        return 0;
-    case WAIT_TIMEOUT:
-        return RC ( rcPS, rcLock, rcLocking, rcTimeout, rcExhausted );
-    }
-
-    switch ( GetLastError () )
-    {
-    case ERROR_INVALID_HANDLE:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    }
-
-    return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-}
-
-
-LIB_EXPORT rc_t CC KLockTimedAcquire ( KLock *self, timeout_t *tm )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcLocking, rcSelf, rcNull );
-
-    switch ( WaitForSingleObject( self -> mutex, tm != NULL ? tm -> mS : 0 ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        return 0;
-    case WAIT_TIMEOUT:
-        if ( tm == NULL )
-            return RC ( rcPS, rcLock, rcLocking, rcLock, rcBusy );
-        return RC ( rcPS, rcLock, rcLocking, rcTimeout, rcExhausted );
-    }
-
-    switch ( GetLastError () )
-    {
-    case ERROR_INVALID_HANDLE:
-        return RC ( rcPS, rcLock, rcLocking, rcLock, rcInvalid );
-    }
-
-    return RC ( rcPS, rcLock, rcLocking, rcNoObj, rcUnknown );
-}
-
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KLockUnlock ( KLock *self )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcLock, rcUnlocking, rcSelf, rcNull );
-
-    if ( ReleaseMutex ( self -> mutex ) )
-        return 0;
-
-    switch ( GetLastError () )
-    {
-    case ERROR_INVALID_HANDLE:
-        return RC ( rcPS, rcLock, rcUnlocking, rcLock, rcInvalid );
-    }
-
-    return RC ( rcPS, rcLock, rcUnlocking, rcNoObj, rcUnknown );
-}
-
-
-/*--------------------------------------------------------------------------
- * KRWLock
- *  a read/write lock
- */
-struct KRWLock
-{
-    HANDLE mutex;
-    HANDLE rcond;
-    HANDLE wcond;
-    HANDLE ack;
-    atomic32_t refcount;
-    uint32_t rwait;
-    uint32_t wwait;
-    int32_t busy;
-};
-
-
-/* Whack
- */
-static
-rc_t KRWLockWhack ( KRWLock *self )
-{
-    switch ( WaitForSingleObject ( self -> mutex, 0 ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        if ( self -> busy != 0 || self -> rwait != 0 || self -> wwait != 0 )
-        {
-            ReleaseMutex ( self -> mutex );
-            return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcBusy );
-        }
-        ReleaseMutex ( self -> mutex );
-        break;
-    case WAIT_TIMEOUT:
-        return RC ( rcPS, rcRWLock, rcDestroying, rcRWLock, rcBusy );
-    }
-
-    CloseHandle ( self -> ack );
-    CloseHandle ( self -> wcond );
-    CloseHandle ( self -> rcond );
-    CloseHandle ( self -> mutex );
-
-    free ( self );
-    return 0;
-}
-
-
-/* Make
- *  make a simple read/write lock
- */
-LIB_EXPORT rc_t CC KRWLockMake ( KRWLock **lockp )
-{
-    rc_t rc;
-
-    if ( lockp == NULL )
-        rc = RC ( rcPS, rcRWLock, rcConstructing, rcParam, rcNull );
-    else
-    {
-        KRWLock *lock = malloc ( sizeof * lock );
-        if ( lock == NULL )
-            rc = RC ( rcPS, rcRWLock, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            DWORD status;
-            lock -> mutex = CreateMutex ( NULL, false, NULL );
-            if ( lock -> mutex == NULL )
-                status = GetLastError ();
-            else
-            {
-                lock -> rcond = CreateEvent ( NULL, true, false, NULL );
-                if ( lock -> rcond == NULL )
-                    status = GetLastError ();
-                else
-                {
-                    lock -> wcond = CreateEvent ( NULL, true, false, NULL );
-                    if ( lock -> wcond == NULL )
-                        status = GetLastError ();
-                    else
-                    {
-                        lock -> ack = CreateEvent ( NULL, true, false, NULL );
-                        if ( lock -> ack != NULL )
-                        {
-                            atomic32_set ( & lock -> refcount, 1 );
-                            lock -> rwait = lock -> wwait = 0;
-                            lock -> busy = 0;
-                            * lockp = lock;
-                            return 0;
-                        }
-
-                        status = GetLastError ();
-                        CloseHandle ( lock -> wcond );
-                    }
-
-                    CloseHandle ( lock -> rcond );
-                }
-
-                CloseHandle ( lock -> mutex );
-            }
-
-            switch ( status )
-            {
-            default:
-                rc = RC ( rcPS, rcRWLock, rcConstructing, rcNoObj, rcUnknown );
-            }
-
-            free ( lock );
-        }
-
-        * lockp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC KRWLockAddRef ( const KRWLock *cself )
-{
-    if ( cself != NULL )
-        atomic32_inc ( & ( ( KRWLock* ) cself ) -> refcount );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockRelease ( const KRWLock *cself )
-{
-    KRWLock *self = ( KRWLock* ) cself;
-    if ( cself != NULL )
-    {
-        if ( atomic32_dec_and_test ( & self -> refcount ) )
-        {
-            atomic32_set ( & self -> refcount, 1 );
-            return KRWLockWhack ( self );
-        }
-    }
-    return 0;
-}
-
-
-/* AcquireShared
- *  acquires read ( shared ) lock
- */
-static
-rc_t KRWLockAcquireSharedInt ( KRWLock *self, DWORD mS )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    /* acquire mutex */
-    switch ( WaitForSingleObject ( self -> mutex, mS ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        break;
-    case WAIT_TIMEOUT:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    /* don't allow readers if writers are waiting */
-    if ( self -> rwait != 0 || self -> wwait != 0 || self -> busy < 0 )
-    {
-        /* indicate a waiting read lock request on our mutex */
-        ++ self -> rwait;
-
-        switch ( SignalObjectAndWait ( self -> mutex, self -> rcond, mS, false ) )
-        {
-        case WAIT_OBJECT_0:
-
-            /* drop wait count under unlock mutex */
-            -- self -> rwait;
-
-            /* release unlock and reacquire */
-            switch ( SignalObjectAndWait ( self -> ack, self -> mutex, INFINITE, false ) )
-            {
-            case WAIT_ABANDONED:
-            case WAIT_OBJECT_0:
-                break;
-            case WAIT_FAILED:
-                switch ( GetLastError () )
-                {
-                case ERROR_INVALID_HANDLE:
-                    return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-                }
-            default:
-                return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-            }
-            break;
-
-        case WAIT_TIMEOUT:
-
-            /* need to drop count, but don't have mutex */
-            switch ( WaitForSingleObject ( self -> mutex, INFINITE ) )
-            {
-            case WAIT_ABANDONED:
-            case WAIT_OBJECT_0:
-                break;
-            case WAIT_FAILED:
-                switch ( GetLastError () )
-                {
-                case ERROR_INVALID_HANDLE:
-                    return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-                }
-            default:
-                return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-            }
-
-            /* drop count and go */
-            -- self -> rwait;
-            ReleaseMutex ( self -> mutex );
-            return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcExhausted );
-
-        case WAIT_FAILED:
-            switch ( GetLastError () )
-            {
-            case ERROR_INVALID_HANDLE:
-                return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-            }
-
-        default:
-            return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-        }
-    }
-
-    assert ( self -> busy >= 0 );
-    ++ self -> busy;
-
-    ReleaseMutex ( self -> mutex );
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockAcquireShared ( KRWLock *self )
-{
-    return KRWLockAcquireSharedInt ( self, INFINITE );
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireShared ( KRWLock *self, timeout_t *tm )
-{
-    return KRWLockAcquireSharedInt ( self, tm != NULL ? tm -> mS : 0 );
-}
-
-
-/* AcquireExcl
- *  acquires write ( exclusive ) lock
- */
-static
-rc_t KRWLockAcquireExclInt ( KRWLock *self, DWORD mS )
-{
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcLocking, rcSelf, rcNull );
-
-    /* acquire mutex */
-    switch ( WaitForSingleObject ( self -> mutex, mS ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        break;
-    case WAIT_TIMEOUT:
-        return RC ( rcPS, rcRWLock, rcLocking, rcTimeout, rcExhausted );
-    default:
-        return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-    }
-
-    if ( self -> wwait != 0 || self -> busy != 0 )
-    {
-        /* indicate a waiting write lock request on our mutex */
-        ++ self -> wwait;
-
-        switch ( SignalObjectAndWait ( self -> mutex, self -> wcond, mS, false ) )
-        {
-        case WAIT_OBJECT_0:
-
-            /* drop wait count under unlock mutex */
-            -- self -> wwait;
-
-            /* release unlock and reacquire */
-            switch ( SignalObjectAndWait ( self -> ack, self -> mutex, INFINITE, false ) )
-            {
-            case WAIT_ABANDONED:
-            case WAIT_OBJECT_0:
-                break;
-            case WAIT_FAILED:
-                switch ( GetLastError () )
-                {
-                case ERROR_INVALID_HANDLE:
-                    return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-                }
-            default:
-                return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-            }
-            break;
-
-        case WAIT_TIMEOUT:
-
-            /* need to drop count, but don't have mutex */
-            switch ( WaitForSingleObject ( self -> mutex, INFINITE ) )
-            {
-            case WAIT_ABANDONED:
-            case WAIT_OBJECT_0:
-                break;
-            case WAIT_FAILED:
-                switch ( GetLastError () )
-                {
-                case ERROR_INVALID_HANDLE:
-                    return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-                }
-            default:
-                return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-            }
-
-            /* drop count and go */
-            -- self -> wwait;
-            ReleaseMutex ( self -> mutex );
-            return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcExhausted );
-
-        case WAIT_FAILED:
-            switch ( GetLastError () )
-            {
-            case ERROR_INVALID_HANDLE:
-                return RC ( rcPS, rcRWLock, rcLocking, rcRWLock, rcInvalid );
-            }
-
-        default:
-            return RC ( rcPS, rcRWLock, rcLocking, rcNoObj, rcUnknown );
-        }
-    }
-
-    assert ( self -> busy == 0 );
-    -- self -> busy;
-
-    ReleaseMutex ( self -> mutex );
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KRWLockAcquireExcl ( KRWLock *self )
-{
-    return KRWLockAcquireExclInt ( self, INFINITE );
-}
-
-LIB_EXPORT rc_t CC KRWLockTimedAcquireExcl ( KRWLock *self, timeout_t *tm )
-{
-    return KRWLockAcquireExclInt ( self, tm != NULL ? tm -> mS : 0 );
-}
-
-
-/* Unlock
- *  releases lock
- */
-LIB_EXPORT rc_t CC KRWLockUnlock ( KRWLock *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcSelf, rcNull );
-
-    /* acquire mutex */
-    switch ( WaitForSingleObject ( self -> mutex, INFINITE ) )
-    {
-    case WAIT_ABANDONED:
-    case WAIT_OBJECT_0:
-        break;
-    case WAIT_TIMEOUT:
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcTimeout, rcExhausted );
-    default:
-        return RC ( rcPS, rcRWLock, rcUnlocking, rcNoObj, rcUnknown );
-    }
-
-    /* adjust busy */
-    if ( self -> busy > 0 )
-        -- self -> busy;
-    else if ( self -> busy < 0 )
-    {
-        ++ self -> busy;
-        assert ( self -> busy == 0 );
-    }
-
-    /* detect a zero crossing and waiters */
-    if ( self -> busy != 0 || ( self -> wwait == 0 && self -> rwait == 0 ) )
-        rc = 0;
-    else
-    {
-        HANDLE cond = self -> wwait != 0 ? self -> wcond : self -> rcond;
-        switch ( SignalObjectAndWait ( cond, self -> ack, INFINITE, false ) )
-        {
-        case WAIT_OBJECT_0:
-            rc = 0;
-            break;
-        case WAIT_FAILED:
-            switch ( GetLastError () )
-            {
-            case ERROR_INVALID_HANDLE:
-                rc = RC ( rcPS, rcRWLock, rcUnlocking, rcRWLock, rcInvalid );
-                break;
-            default:
-                rc = RC ( rcPS, rcRWLock, rcUnlocking, rcNoObj, rcUnknown );
-            }
-            break;
-
-        default:
-            rc = RC ( rcPS, rcRWLock, rcUnlocking, rcNoObj, rcUnknown );
-        }
-    }
-
-    ReleaseMutex ( self -> mutex );
-    return rc;
-}
diff --git a/libs/krypto/Makefile b/libs/krypto/Makefile
deleted file mode 100644
index 4743e6f..0000000
--- a/libs/krypto/Makefile
+++ /dev/null
@@ -1,307 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-USE_GCC_IF_ICC = 1
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/krypto
-
-INT_LIBS = \
-	libkrypto
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-ifeq ($(OS),linux)
-	INT_LIBS += libkryptotest
-endif
-
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-# This differs from other sister Makefiles in needing three other symbols defined
-# VEC_SUPPORTED, VECREG_SUPPORTED and AESNI_SUPPORTED
-# The successive symbols are additive
-# In order they are the compiler supports  the vector 'container' type,
-# the preocessor has supported vector registers
-# the processor supports the Intel AES-NI instruction set
-#
-# The prerequisite call to make compiler-test will have tried to compile objects
-# that show such support if the objec can be made
-all std: makedirs compiler-test
-	@ $(MAKE_CMD) \
-		VEC_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.vec.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		VECREG_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.vecreg.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		AESNI_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.aes-ni.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		$(TARGDIR)/std || \
-	( echo "reattempting without AES-NI instructions"; \
-	  $(MAKE_CMD) \
-		VEC_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.vec.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		VECREG_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.vecreg.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		AESNI_SUPPORTED=false \
-		$(TARGDIR)/std ) || \
-	( echo "reattempting without vector register instructions"; \
-	  $(MAKE_CMD) \
-		VEC_SUPPORTED=$(shell if test -f $(OBJDIR)/compile-test.vec.$(LOBX) ; then echo "true"; else echo "false" ; fi) \
-		VECREG_SUPPORTED=false \
-		AESNI_SUPPORTED=false \
-		$(TARGDIR)/std ) || \
-	( echo "reattempting without vector instructions"; \
-	  $(MAKE_CMD) \
-		VEC_SUPPORTED=false \
-		VECREG_SUPPORTED=false \
-		AESNI_SUPPORTED=false \
-		$(TARGDIR)/std )
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-#	@echo VEC_SUPPORTED $(VEC_SUPPORTED)
-#	@echo VECREG_SUPPORTED $(VECREG_SUPPORTED)
-#	@echo AESNI_SUPPORTED $(AESNI_SUPPORTED)
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# compiler-test
-#
-.PHONY: compiler-test $(TARGDIR)/compiler-test
-
-# Silently try to compile three objects
-compiler-test : makedirs
-	@ $(MAKE_CMD) -i $(TARGDIR)/compiler-test >/dev/null 2>/dev/null
-
-
-COMPILE_TEST_SRC = \
-	compile-test.vec \
-	compile-test.vecreg \
-	compile-test.aes-ni
-
-COMPILE_TEST_OBJ = \
-	$(addsuffix .$(LOBX),$(COMPILE_TEST_SRC))
-
-$(TARGDIR)/compiler-test : $(COMPILE_TEST_OBJ)
-	@echo VEC_SUPPORTED $(VEC_SUPPORTED)
-	@echo VECREG_SUPPORTED $(VECREG_SUPPORTED)
-	@echo AESNI_SUPPORTED $(AESNI_SUPPORTED)
-
-#-------------------------------------------------------------------------------
-# define some additional compiler flags for special object file types
-# currently only gcc is supported and it turns out only with 4.4.0 and up
-# though other compilers could also be supported
-ifeq ($(COMP),gcc)
-CC_LISTING = -Wa,-ahlms=$(<D)/$(@F).list
-_CC_AES_NI  = -funsafe-math-optimizations -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -maes -Wa,-march=generic64+aes $(CC_LISTING)
-_CC_VECREG  = -funsafe-math-optimizations -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -Wa,-march=generic64+sse4 $(CC_LISTING)
-_CC_VEC     = $(CC_LISTING)
-else
-_CC_LISTING =
-_CC_AES_NI  =
-_CC_VECREG  =
-_CC_VEC     =
-endif
-
-ifeq ($(VEC_SUPPORTED),true)
-CC_VEC = $(_CC_VEC)
-else
-CC_VEC =
-endif
-
-ifeq ($(VECREG_SUPPORTED),true)
-CC_VECREG = $(_CC_VECREG)
-else
-CC_VECREG = 
-endif
-
-ifeq ($(AESNI_SUPPORTED),true)
-CC_AES_NI = $(_CC_AES_NI)
-else
-CC_AES_NI = 
-endif
-
-# Rules for making objects using compiler vectors
-compile-test.vec.pic.o : compile-test.c
-	@ echo +++++ Making $@ using its own rule
-	@ echo $@ $(_CC_VEC)
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC $(_CC_VEC) $<
-
-
-%.vec.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC $(CC_VEC) $<
-
-
-# Rules for making objects using vectors in registers
-compile-test.vecreg.pic.o : compile-test.c
-	@ echo +++++ Making $@ using its own rule
-	@ echo $@ $(_CC_VECREG)
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC -DUSEVECREG $(_CC_VECREG) $<
-
-%.vecreg.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC -DUSEVECREG $(CC_VECREG) $<
-
-
-# Rules for making objects using AES-NI extensions vectors in registers
-compile-test.aes-ni.pic.o : compile-test.c
-	@ echo +++++ Making $@ using its own rule
-	@ echo $@ $(_CC_AES_NI)
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC -DUSEVECREG -DUSEAESNI $(_CC_AES_NI) $<
-
-%.aes-ni.$(LOBX): %.c
-	$(CC) -o $@ -fPIC $(OPT) -D_LIBRARY -DUSEVEC -DUSEVECREG -DUSEAESNI $(CC_AES_NI) $<
-
-
-
-#-------------------------------------------------------------------------------
-# krypto
-#
-$(ILIBDIR)/libkrypto: $(addprefix $(ILIBDIR)/libkrypto.,$(ILIBEXT))
-
-ALL_LIB_SRC = \
-	ciphermgr \
-	wgaencrypt \
-	encfile \
-	encfilev2 \
-	cipher \
-	aes_core \
-	aes-byte \
-	cipher-byte \
-	key \
-	reencfile
-
-LIB_SRC = \
-	no-null-ncbi
-
-TEST_LIB_SRC =  \
-	null-ncbi \
-	testcipher
-
-ifeq ($(VEC_SUPPORTED),true)
-ALL_LIB_SRC += \
-	cipher-vec.vec \
-	aes-ncbi.vec
-LIB_SRC += \
-	no-null-ncbi.vec
-TEST_LIB_SRC += \
-	null-ncbi.vec
-else
-ALL_LIB_SRC += \
-	cipher-no-vec.vec
-LIB_SRC += \
-	no-null-ncbi.vec
-TEST_LIB_SRC += \
-	no-null-ncbi.vec
-endif
-
-ifeq ($(VECREG_SUPPORTED),true)
-ALL_LIB_SRC += \
-	cipher-vec.vecreg \
-	aes-ncbi.vecreg
-LIB_SRC += \
-	no-null-ncbi.vecreg
-TEST_LIB_SRC += \
-	null-ncbi.vecreg
-else
-ALL_LIB_SRC += \
-	cipher-no-vec.vecreg
-LIB_SRC += \
-	no-null-ncbi.vecreg
-TEST_LIB_SRC += \
-	no-null-ncbi.vecreg
-endif
-
-ifeq ($(AESNI_SUPPORTED),true)
-ALL_LIB_SRC += \
-	cipher-vec.aes-ni \
-	aes-ncbi.aes-ni
-LIB_SRC += \
-	no-null-ncbi.aes-ni
-TEST_LIB_SRC += \
-	no-null-ncbi.aes-ni
-else
-ALL_LIB_SRC += \
-	cipher-no-vec.aes-ni
-LIB_SRC += \
-	no-null-ncbi.aes-ni
-TEST_LIB_SRC += \
-	no-null-ncbi.aes-ni
-endif
-
-
-KRYPTO_SRC = $(ALL_LIB_SRC) $(LIB_SRC)
-
-KRYPTO_OBJ = \
-	$(addsuffix .$(LOBX),$(KRYPTO_SRC))
-
-KRYPTO_LIB = \
-	-dkfg \
-	-dkfs \
-	-dkproc \
-	-dklib
-
-$(ILIBDIR)/libkrypto.$(LIBX): $(KRYPTO_OBJ)
-	$(LD) --slib -o $@ $^ $(KRYPTO_LIB)
-
-
-#-------------------------------------------------------------------------------
-# kryptotest
-#
-
-$(ILIBDIR)/libkryptotest: $(addprefix $(ILIBDIR)/libkryptotest.,$(ILIBEXT))
-
-KRYPTOTEST_SRC = $(ALL_LIB_SRC)	$(TEST_LIB_SRC)
-
-KRYPTOTEST_OBJ = \
-	$(addsuffix .$(LOBX),$(KRYPTOTEST_SRC))
-
-KRYPTOTEST_LIB = \
-	-dkfg \
-	-dkfs \
-	-dkproc \
-	-dklib
-
-$(ILIBDIR)/libkryptotest.$(LIBX): $(KRYPTOTEST_OBJ)
-	$(LD) --slib -o $@ $^ $(KRYPTOTEST_LIB)
-
-
-
-
diff --git a/libs/krypto/aes-byte.c b/libs/krypto/aes-byte.c
deleted file mode 100644
index 29e104b..0000000
--- a/libs/krypto/aes-byte.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-#include "aes-priv.h"
-#include "cipher-priv.h"
-
-#include <klib/rc.h>
-
-#include <string.h>
-#include <assert.h>
-
-
-/* instantiate for class functions that use the VT */
-#define BLOCKCIPHER_BYTE_IMPL KAESBlockCipherByte
-#include "blockcipher-impl.h"
-
-static const char KAESByteBlockCipherClassName[] = "KAESCipherByte";
-
-static
-void KAESBlockCipherByteDestroy (const KAESBlockCipherByte * self)
-{
-    /* we use a constant object */
-}
-
-
-static
-uint32_t KAESBlockCipherByteBlockSize ()
-{
-    return AES_BLOCK_SIZE;
-}
-
-
-/* ----------------------------------------------------------------------
- * KeySize
- *   How large is the stored key for this cipher?  Not the user key used
- *   to create this key (key schedule)
- *
- *   This is needed by KCipher to know how large the KCipher objecr is at
- *   allocation and to know how much of a buffer each decryption/encryption is
- */
-static
-uint32_t KAESBlockCipherByteKeySize ()
-{
-    return  (uint32_t)sizeof (AES_KEY);
-}
-
-
-/* ----------------------------------------------------------------------
- * SetEncryptKey
- *   The KCipher calls this to have the block cipher build an encryption
- *   key in the KCipher object
- *
- */
-static
-rc_t KAESBlockCipherByteSetEncryptKey (void * encrypt_key,
-                                       const char * user_key,
-                                       uint32_t user_key_size)
-{
-    int iii;
-    rc_t rc;
-
-    assert (encrypt_key);
-    assert (user_key);
-    assert (user_key_size != 0);
-
-    iii = AES_set_encrypt_key((const unsigned char *)user_key,
-                              (int)user_key_size * 8,
-                              encrypt_key);
-    if (iii == 0)
-        rc = 0;
-    else
-    {
-        switch (iii)
-        {
-        default: /* not in the code when this was written */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcEncryptionKey, rcUnknown);
-            break;
-
-        case -1: /* bad parameters */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcParam, rcInvalid);
-            break;
-
-        case -2: /* bad bit count */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcParam, rcIncorrect);
-            break;
-        }
-        memset (encrypt_key, 0, sizeof (AES_KEY));
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetDecryptKey
- *   The KCipher calls this to have the block cipher build an decryption
- *   key in the KCipher object
- *
- */
-static
-rc_t KAESBlockCipherByteSetDecryptKey (void * decrypt_key,
-                                       const char * user_key,
-                                       uint32_t user_key_size)
-{
-    int iii;
-    rc_t rc;
-
-    assert (decrypt_key);
-    assert (user_key);
-    assert (user_key_size != 0);
-
-    iii = AES_set_decrypt_key((const unsigned char *)user_key, (int)user_key_size * 8,
-                              decrypt_key);
-    if (iii == 0)
-        rc = 0;
-    else
-    {
-        switch (iii)
-        {
-        default: /* not in the code when this was written */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcEncryptionKey, rcUnknown);
-            break;
-
-        case -1: /* bad parameters */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcParam, rcInvalid);
-            break;
-
-        case -2: /* bad bit count */
-            rc = RC (rcKrypto, rcCipher, rcUpdating, rcParam, rcIncorrect);
-            break;
-        }
-        memset (decrypt_key, 0, sizeof (AES_KEY));
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Encrypt
- *
- *   Perform an encryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- *
- */
-static
-void KAESBlockCipherByteEncrypt (const CipherBlock in,
-                                 CipherBlock out,
-                                 const void * key)
-{
-    assert (in);
-    assert (out);
-    assert (key);
-
-    AES_encrypt ((const uint8_t*)in, (uint8_t*)out, key);
-}
-
-
-/* ----------------------------------------------------------------------
- * Decrypt
- *
- *   Perform a decryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- *
- */
-static
-void KAESBlockCipherByteDecrypt (const CipherBlock in,
-                                 CipherBlock out,
-                                 const void * key)
-{
-    assert (in);
-    assert (out);
-    assert (key);
-
-    AES_decrypt ((const uint8_t*)in, (uint8_t*)out, key);
-}
-
-
-static const struct
-KBlockCipherByte_vt_v1 aes_vt = 
-{
-    /* .version */
-    { 1, 0 },
-
-    KAESBlockCipherByteDestroy,
-
-    KAESBlockCipherByteBlockSize,
-    KAESBlockCipherByteKeySize,
-
-    KAESBlockCipherByteSetEncryptKey,
-    KAESBlockCipherByteSetDecryptKey,
-
-    KAESBlockCipherByteEncrypt,
-    KAESBlockCipherByteDecrypt
-};
-
-
-rc_t KAESBlockCipherByteMake (KBlockCipherByte ** pobj)
-{
-    rc_t rc;
-
-    if (pobj == NULL)
-        rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-    {
-        rc = 0;
-        *pobj = (KBlockCipherByte*)&aes_vt;
-    }
-    return rc;
-}
-
-/* EOF */
-
diff --git a/libs/krypto/aes-ncbi-priv.h b/libs/krypto/aes-ncbi-priv.h
deleted file mode 100644
index 5738029..0000000
--- a/libs/krypto/aes-ncbi-priv.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_aes_ncbi_priv_libs_
-#define _h_krypto_aes_ncbi_priv_libs_
-
-#include <klib/defs.h>
-#include <v128.h>
-
-#include "ncbi-priv.h"
-#include "cipher-impl.h"
-#include "blockcipher-impl.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-/* ======================================================================
- * FIPS-197 2.1
- */
-#define AES_BLOCK_BITS (128)
-#define AES_BLOCK_BYTES (AES_BLOCK_BITS/8)
-
-
-/* ======================================================================
- * FIPS-197 3,4 - 3.5
- *
- * FIPS-197 defines Nk as number of 32-bit words in the user key
- */
-#define AES_Nk_128 (4)
-#define AES_Nk_192 (6)
-#define AES_Nk_256 (8)
-
-
-/*
- * FIPS-197 defines Nb as number of 32-bit words in the cipher block
- *
- * There is much odd naming in the document from the perspective of a software
- * engineer.
- */
-#define AES_Nb (4)
-#define AES_Nb_128 (AES_Nb)
-#define AES_Nb_192 (AES_Nb)
-#define AES_Nb_256 (AES_Nb)
-
-
-/* 
- * FIPS-197 defines Nr as the number of rounds for a cipher of a given original 
- * user key length.
- *
- * Another odd naming as it is really the zero based highest round offset
- * as 1 first round + Nr-1 middle rounds + 1 last round are performed for
- * each encrypt or decrypt block.  There are thus Nr + 1 round keys needed
- * in the encryption and decryption key schedules
- */
-#define AES_Nr_128 (10)
-#define AES_Nr_192 (12)
-#define AES_Nr_256 (14)
-#define AES_Nr_MAX (15)
-
-/* Most useful for testingg against Appendix A-C of the FIPS-197 document */
-#define DEBUG_OBJECT(msg) DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_OBJECT), msg)
-#define DEBUG_KEYEXP(msg) DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_KEYEXP), msg)
-#define DEBUG_CIPHER(msg) DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_CIPHER), msg)
-#define DEBUG_INVKEYEXP(msg) DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_INVKEYEXP), msg)
-#define DEBUG_INVCIPHER(msg) DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_INVCIPHER), msg)
-
-#define DEBUG_CIPHER_MVECTOR(M,v)                                   \
-    DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_CIPHER),                        \
-           ("%s:\t%0.8x %0.8x %0.8x %0.8x\n",M,                     \
-            v.columns[0],v.columns[1],v.columns[2],v.columns[3]))
-#define DEBUG_INVCIPHER_MVECTOR(M,v)                                \
-    DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_INVCIPHER),                     \
-           ("%s:\t%0.8x %0.8x %0.8x %0.8x\n",M,                     \
-            v.columns[0],v.columns[1],v.columns[2],v.columns[3]))
-
-#if _DEBUGGING
-#if 1
-#define DEBUG_CIPHER_VECTOR(M,V)                        \
-    {                                                   \
-        CipherVec_AES_u v; v.state = V;                 \
-        DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_CIPHER),        \
-               ("%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,    \
-                bswap_32(v.columns[0]),                 \
-                bswap_32(v.columns[1]),                 \
-                bswap_32(v.columns[2]),                 \
-                bswap_32(v.columns[3])));               \
-            }
-#define DEBUG_INVCIPHER_VECTOR(M,V)                     \
-    {                                                   \
-        CipherVec_AES_u v; v.state = V;                 \
-        DBGMSG(DBG_AES,DBG_FLAG(DBG_AES_INVCIPHER),     \
-               ("%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,    \
-                bswap_32(v.columns[0]),                 \
-                bswap_32(v.columns[1]),                 \
-                bswap_32(v.columns[2]),                 \
-                bswap_32(v.columns[3])));               \
-            }
-#else
-#define DEBUG_CIPHER_VECTOR(M,v)                              \
-    KOutMsg ( "%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,            \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[0]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[1]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[2]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[3]))
-#define DEBUG_INVCIPHER_VECTOR(M,v)                           \
-    KOutMsg ( "%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,            \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[0]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[1]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[2]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[3]))
-#endif
-#define DDEBUG_CIPHER_VECTOR(M,v)                             \
-    KOutMsg ( "%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,            \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[0]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[1]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[2]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[3]))
-#define DDEBUG_INVCIPHER_VECTOR(M,v)                          \
-    KOutMsg ( "%s:\t%0.8x %0.8x %0.8x %0.8x\n", M,            \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[0]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[1]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[2]), \
-              bswap_32(((CipherVec_AES_u*)&(v))->columns[3]))
-
-#else
-#define DEBUG_CIPHER_VECTOR(M,V)
-#define DEBUG_INVCIPHER_VECTOR(M,V)
-#endif
-
-/* -----
- * 8 and 32 bit unsigned integers
- */
-typedef uint8_t  AESByte;
-typedef uint32_t AESWord;
-typedef union AESColumn AESColumn;
-union AESColumn
-{
-    AESWord word;
-    AESByte bytes [sizeof(AESWord)];
-};
-
-
-/* -----
- * 128 byte block in various forms
- */
-typedef AESByte AESBlock [AES_Nb*sizeof(AESWord)];
-
-typedef v128_u8_t  CipherVecByte;
-typedef v128_u32_t CipherVecWord;
-
-
-typedef struct AESKeySchedule  AESKeySchedule;
-struct AESKeySchedule
-{
-    CipherVec round_keys [AES_Nr_MAX];
-    uint32_t number_of_rounds;
-};
-
-/* ======================================================================
- * FIPS-197 3,4 - 3.5
- *
- * An AES State is the same size as the cipher block size.
- * They are eaither 4 columns of 32 bits or 16 individual bytes.
- * The columns can be accessed by their individual bytes s0
- * there are 4X32, 4X4X8 or 16X8 bits in a state.
- */
-typedef union
-{
-    CipherVec   state;
-    uint64_t    u64     [AES_Nb/2];
-    AESWord     columns [AES_Nb];
-    AESByte     bytes   [AES_Nb * sizeof (AESWord)];
-    AESByte     grid    [AES_Nb][sizeof (AESWord)];
-} CipherVec_AES_u;
-
-
-typedef union
-{
-    CipherVec   state;
-    v128_u32_t columns;
-} CipherVec_uu __attribute__ ((aligned(16)));
-
-/* 
- * KCipher with 128 bit alignment.
- */
-typedef struct CipherAes CipherAes;
-struct CipherAes
-{
-    KCipher dad;
-    AESKeySchedule e_key;
-    AESKeySchedule d_key;
-    CipherVec    e_ivec;
-    CipherVec    d_ivec;
-};
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_aes_ncbi_priv_libs_ */
-
-
diff --git a/libs/krypto/aes-ncbi.c b/libs/krypto/aes-ncbi.c
deleted file mode 100644
index 4215feb..0000000
--- a/libs/krypto/aes-ncbi.c
+++ /dev/null
@@ -1,2644 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-
-#include <krypto/extern.h>
-
-#include "ncbi-priv.h"
-#include "aes-ncbi-priv.h"
-#include "cipher-priv.h"
-#include "blockcipher-priv.h"
-
-#include <klib/debug.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-
-#include <byteswap.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <sysalloc.h>
-
-#if USE_VEC
-#include <cpuid.h>
-#endif
-
-#if USE_VECREG
-#include <v128.h>
-#endif
-
-/*
- * This implements the AES cipher as defined by FIPS-197 from NIST
- *  
- * Notes on implmentation:
- *
- * NOTE:
- * Byte ordering in AES is not critical but unllike the original implmentation
- * bytes are not re-ordered to a big endian order upon reading them in and this
- * code will expect to run on an Intel/AMD type processor and might have issues
- * on some big endian processors.
- *
- * NOTE:
- * Many functions are written as static inline functions to
- * facilitate GCC type assembly language optimization on various processors
- *
- * NOTE:
- * This implements the Equivalent Inverse Cipher not the Inverse Cipher.  In
- * general functions will match those defined in the FIPS-197 document where they
- * do not get optimized away for Intel/AMD XMM registers and AES-NI instructions.
- *
- * NOTE:
- * C-99 types are used for specific sized types.  An unaddornded unsigned type
- * is used for many index type variables to allow the compiler choice in
- * size where size does not matter very much.  As these index variables do
- * not go above 16 any size would do but the compiler can choose the size most
- * suited for array subscripting.
- */
-
-static const
-CipherVec vec_00 =  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-static const
-CipherVec vec_01 =  { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-                      0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-
-static const
-CipherVec vec_0F =  { 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-                      0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F };
-
-static const
-CipherVec vec_10 =  { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-                      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 };
-
-
-
-/* ======================================================================
- * These functions implment the Advanced Encryption Standard AES as defined
- * in the FIPS (Federal Information Processing Standars Publication 197
- * Of Nevember 26, 2001.
- */
-
-/* ======================================================================
- * FIPS-197 5.1
- */
-
-/*
- * Read a blocks worth of bytes into an CipherVec
- *
- * With vector registers it is a single instruction, without them it
- * is a memmove call
- */
-static __inline__ 
-CipherVec AESBCMEMBER(StateIn) (const void * ain)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(StateIn) (const void * ain)
-{
-#if USE_VEC_REG
-
-    register CipherVec vec;
-    __asm__ (
-        "movdqu (%[a]),%[s]" : [s] "=x" (vec) : [a] "D" (ain)
-        );
-    return vec;
-
-#else
-
-    CipherVec_AES_u u;
-    memmove (&u.bytes, ain, sizeof (u));
-    return u.state;
-
-#endif
-}
-
-
-/*
- * Write a block's worth of bytes out from an CipherVec
- *
- * With vector registers it is a single instruction, without them it
- * is a memmove call
- */
-static __inline__
-void AESBCMEMBER(StateOut) (const CipherVec vec, void * rout)
-    __attribute__ ((always_inline));
-
-static __inline__
-void AESBCMEMBER(StateOut) (const CipherVec vec, void * rout)
-{
-#if USE_VEC_REG
-
-    register CipherVec rvec = vec;
-    __asm__ (
-        "movdqu %[s],(%[a])" : : [s] "x" (rvec), [a] "D" (rout)
-        );
-
-#else
-
-    memmove (rout, &vec, sizeof (vec));
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecXor) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecXor) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 ^ v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] ^= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecAnd) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecAnd) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 & v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] &= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecOr) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecOr) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 | v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] |= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecAdd) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecAdd) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 + v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] += u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSub) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSub) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 - v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] -= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecMul) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecMul) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 * v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] *= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecDiv) (CipherVec v1, CipherVec v2)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecDiv) (CipherVec v1, CipherVec v2)
-{
-#if USE_VEC
-
-    return v1 / v2;
-
-#else
-
-    CipherVec_AES_u u1, u2; /* state and key not countries :) */
-    unsigned ix;
-
-    u1.state = v1;
-    u2.state = v2;
-
-    for (ix = 0; ix < AES_Nb; ++ix)
-        u1.columns[ix] /= u2.columns[ix];
-
-    return u1.state;
-
-#endif
-}
-
-static __inline__ 
-CipherVec AESBCMEMBER(PackShuffleBytes) (CipherVec dest, CipherVec mask)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(PackShuffleBytes) (CipherVec dest, CipherVec mask)
-{
-#if USE_VEC_REG
-
-    return op_PSHUFB128 (dest, mask);
-
-#else
-
-    CipherVec_AES_u out, in, gate;
-    unsigned ix;
-
-    in.state = dest;
-    gate.state = mask;
-
-    for (ix = 0; ix < sizeof dest; ++ix)
-    {
-        if (gate.bytes[ix] & 0x80)
-            out.bytes[ix] = 0;
-        else
-            out.bytes[ix] = in.bytes[gate.bytes[ix] & 0x0F];
-    }
-
-    return out.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSLLBI) (CipherVec v, const int k)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSLLBI) (CipherVec v, const int k)
-{
-#if USE_VEC_REG
-    static const CipherVec sl_mask [9] = 
-        {
-            { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-              0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
-            { 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-              0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE },
-            { 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC,
-              0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC },
-            { 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8,
-              0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8 },
-            { 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
-              0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0 },
-            { 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
-              0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0 },
-            { 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0,
-              0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0 },
-            { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-              0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 },
-            { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
-        };
-    CipherVec vv = v;
-
-    assert (k <= 8);
-    
-
-/*     DEBUG_CIPHER_VECTOR ("mask", sl_mask[k]); */
-/*     DEBUG_CIPHER_VECTOR ("v 1", vv); */
-    vv = op_PSLLDI128 (vv, k);
-/*     DEBUG_CIPHER_VECTOR ("v 2", vv); */
-    vv = AESBCMEMBER(VecAnd) (vv, sl_mask[k]);
-/*     DEBUG_CIPHER_VECTOR ("v 3", vv); */
-    return vv;
-
-#else
-
-    CipherVec_AES_u vv; /* state and key not countries :) */
-    unsigned ix;
-
-    vv.state = v;
-
-    for (ix = 0; ix < sizeof (v); ++ix)
-    {
-        KOutMsg ("SLLBI %d %x ", k, vv.bytes[ix]);
-        vv.bytes[ix] <<= k;
-        KOutMsg ("%x\n", vv.bytes[ix]);
-    }
-    return vv.state;
-
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSRLBI) (CipherVec v, const int k)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(VecSRLBI) (CipherVec v, const int k)
-{
-#if USE_VEC_REG
-    static const CipherVec sr_mask [9] = 
-        {
-            { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-              0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
-            { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
-              0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F },
-            { 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
-              0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F },
-            { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
-              0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F },
-            { 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-              0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F },
-            { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
-              0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 },
-            { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
-              0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 },
-            { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-              0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
-            { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
-        };
-
-    v = op_PSRLDI128 (v, k);
-    v = AESBCMEMBER(VecAnd) (v, sr_mask[(k<8)?k:8]);
-    return v;
-
-#else
-
-    CipherVec_AES_u vv; /* state and key not countries :) */
-    unsigned ix;
-
-    vv.state = v;
-
-    for (ix = 0; ix < sizeof (v); ++ix)
-    {
-        KOutMsg ("SRLBI %d %x ", k, vv.bytes[ix]);
-        vv.bytes[ix] >>= k;
-        KOutMsg ("%x\n", vv.bytes[ix]);
-    }
-    return vv.state;
-
-#endif
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(SetColumn) (CipherVec state, AESWord column, const int which)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(SetColumn) (CipherVec state, AESWord column, const int which)
-{
-#if USE_VEC_REG
-    state = op_PINSRUD (state, column, which);
-#else
-    CipherVec_AES_u u;
-    u.state = state;
-    u.columns [which] = column;
-    state = u.state;
-#endif
-    return state;
-}
-
-
-/* ======================================================================
- * FIPS-197 5.1.4
- *
- * The AddRoundKey transformation is a sinple exclusive or of all 128 bits
- * in the current block against a round key.  This operation is used in all
- * Cipher and EqInvCipher rounds
- *
- * With vector types it is a single operation that with vector registers is
- * a single op-code.
- */
-static __inline__ 
-CipherVec AESBCMEMBER(AddRoundKey) (CipherVec state, CipherVec round_key)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(AddRoundKey) (CipherVec state, CipherVec round_key)
-{
-    return AESBCMEMBER(VecXor) (state, round_key);
-}
-
-
-/* ======================================================================
- * FIPS-197 5.1.2
- *
- * FIPS 197 describes the state in column major format
- * while C and assembly programmers tend to think in row major
- * The byte order is 0,1,2,3,,...F as shown in the first diagram.
- *
- *  ShiftRows() is defined as leaving this state
- * +---+---+---+---+     +---+---+---+---+
- * | 0 | 4 | 8 | C |     | 0 | 4 | 8 | C |
- * +---+---+---+---+     +---+---+---+---+
- * | 1 | 5 | 9 | D |     | 5 | 9 | D | 1 |
- * +---+---+---+---+     +---+---+---+---+
- * | 2 | 6 | A | E |     | A | E | 2 | 6 |
- * +---+---+---+---+     +---+---+---+---+
- * | 3 | 7 | B | F |     | F | 3 | 7 | B |
- * +---+---+---+---+     +---+---+---+---+
- */
-static __inline__
-CipherVec AESBCMEMBER(ShiftRows) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(ShiftRows) (CipherVec state)
-{
-static const
-    CipherVec ShiftRowTable
-    /*   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
-    = {  0,  5, 10, 15,  4,  9, 14,  3,  8, 13,  2,  7, 12,  1,  6, 11 };
-
-    state = AESBCMEMBER(PackShuffleBytes) (state, ShiftRowTable);
-    return state;
-}
-
-
-/* ======================================================================
- * FIPS-197 5.3.1
- *
- * InvShiftRows() is defined as leaving this state
- * +---+---+---+---+     +---+---+---+---+
- * | 0 | 4 | 8 | C |     | 0 | 4 | 8 | C |
- * +---+---+---+---+     +---+---+---+---+
- * | 1 | 5 | 9 | D |     | D | 1 | 5 | 9 |
- * +---+---+---+---+     +---+---+---+---+
- * | 2 | 6 | A | E |     | A | E | 2 | 6 |
- * +---+---+---+---+     +---+---+---+---+
- * | 3 | 7 | B | F |     | 7 | B | F | 3 |
- * +---+---+---+---+     +---+---+---+---+
- */
-static __inline__
-CipherVec AESBCMEMBER(InvShiftRows) (CipherVec state)
-    __attribute__ ((always_inline));
-
-
-static __inline__
-CipherVec AESBCMEMBER(InvShiftRows) (CipherVec state)
-{
-    static const CipherVecByte InvShiftRowTable
-        /*   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
-        = {  0, 13, 10,  7,  4,  1, 14, 11,  8,  5,  2, 15, 12,  9,  6,  3 };
-
-    state = AESBCMEMBER(PackShuffleBytes) (state, InvShiftRowTable);
-    return state;
-}
-
-
-/* ======================================================================
- * +---+---+---+---+     +---+---+---+---+
- * | 0 | 4 | 8 | C |     | 3 | 7 | B | F |
- * +---+---+---+---+     +---+---+---+---+
- * | 1 | 5 | 9 | D |     | 0 | 4 | 8 | C |
- * +---+---+---+---+     +---+---+---+---+
- * | 2 | 6 | A | E |     | 1 | 5 | 9 | D |
- * +---+---+---+---+     +---+---+---+---+
- * | 3 | 7 | B | F |     | 2 | 6 | A | E |
- * +---+---+---+---+     +---+---+---+---+
- */
-static __inline__
-CipherVec AESBCMEMBER(RotBytesRight) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(RotBytesRight) (CipherVec state)
-{
-static const
-    CipherVec ShiftRowTable
-    /*   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
-    = {  3,  0,  1,  2,  7,  4,  5,  6, 11,  8,  9, 10, 15, 12, 13, 14 };
-
-    state = AESBCMEMBER(PackShuffleBytes) (state, ShiftRowTable);
-    return state;
-}
-
-
-/* ======================================================================
- * +---+---+---+---+     +---+---+---+---+
- * | 0 | 4 | 8 | C |     | 1 | 5 | B | D |
- * +---+---+---+---+     +---+---+---+---+
- * | 1 | 5 | 9 | D |     | 2 | 6 | 8 | E |
- * +---+---+---+---+     +---+---+---+---+
- * | 2 | 6 | A | E |     | 3 | 7 | 9 | F |
- * +---+---+---+---+     +---+---+---+---+
- * | 3 | 7 | B | F |     | 0 | 4 | 8 | C |
- * +---+---+---+---+     +---+---+---+---+
- */
-static __inline__
-CipherVec AESBCMEMBER(RotBytesLeft) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(RotBytesLeft) (CipherVec state)
-{
-    static const CipherVec ShiftRowTable
-        /*   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
-        = {  1,  2,  3,  0,  5,  6,  7,  4,  9, 10, 11,  8, 13, 14, 15, 12 };
-
-    state = AESBCMEMBER(PackShuffleBytes) (state, ShiftRowTable);
-    return state;
-}
-
-
-/* ======================================================================
- * FIPS-197 5.1.1
- */
-
-
-/*
- * SubBytes replaces each byte in a state with a specific byte value from
- * A Rijndael Substitution box
- */
-static const 
-AESByte AESBCMEMBER(RijndaelSBox)[256] = 
-{
-/*        -0    -1    -2    -3    -4    -5    -6    -7    -8    -9    -A    -B    -C    -D    -E    -F */
-/* 0- */ 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
-/* 1- */ 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
-/* 2- */ 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
-/* 3- */ 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
-/* 4- */ 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
-/* 5- */ 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
-/* 6- */ 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
-/* 7- */ 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
-/* 8- */ 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
-/* 9- */ 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
-/* A- */ 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
-/* B- */ 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
-/* C- */ 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
-/* D- */ 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
-/* E- */ 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
-/* F- */ 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
-};
-
-
-#if 0
-static __inline__
-CipherVec AESBCMEMBER(SubBytes) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(SubBytes) (CipherVec state)
-{
-    CipherVec_AES_u u;
-    unsigned ix;
-
-    u.state = state;
-
-    for (ix = 0; ix < sizeof (u.bytes); ++ix)
-    {
-        u.bytes[ix] = AESBCMEMBER(RijndaelSBox)[u.bytes[ix]];
-    }
-
-    return u.state;
-}
-#endif
-
-/*
- * SubWord performs the same operation as SubBytes but on
- * the four bytes of a column and not a whole state
- */
-static __inline__
-AESWord AESBCMEMBER(SubWord) (AESWord w)
-    __attribute__ ((always_inline));
-
-static __inline__
-AESWord AESBCMEMBER(SubWord) (AESWord w)
-{
-    AESColumn col;
-    unsigned ix;
-
-    col.word = w;
-    for (ix = 0; ix < sizeof (col); ++ix)
-        col.bytes[ix] = AESBCMEMBER(RijndaelSBox)[(unsigned)col.bytes[ix]];
-    return col.word;
-}
-
-#if 0
-/*
- * InvSubBytes replaces each byte in a state with a specific byte value from
- * an Inversze Rijndael Substitution box.  That is InvSubBytes undoes SubBytes
- */
-static const 
-uint8_t AESBCMEMBER(RijndaelInvSBox)[256] = 
-{
-/*        -0    -1    -2    -3    -4    -5    -6    -7    -8    -9    -A    -B    -C    -D    -E    -F */
-/* 0- */ 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
-/* 1- */ 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
-/* 2- */ 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
-/* 3- */ 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
-/* 4- */ 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
-/* 5- */ 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
-/* 6- */ 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
-/* 7- */ 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
-/* 8- */ 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
-/* 9- */ 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
-/* A- */ 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
-/* B- */ 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
-/* C- */ 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
-/* D- */ 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
-/* E- */ 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
-/* F- */ 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
-};
-
-
-static __inline__
-CipherVec AESBCMEMBER(InvSubBytes) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(InvSubBytes) (CipherVec state)
-{
-    CipherVec_AES_u u;
-    unsigned ix;
-
-    u.state = state;
-    for (ix = 0; ix < sizeof (u.bytes); ++ix)
-        u.bytes[ix] = AESBCMEMBER(RijndaelInvSBox)[u.bytes[ix]];
-
-    return u.state;
-}
-#endif
-
-static const
-CipherVec AESBCMEMBER(RijndaelSBoxV)[16] = 
-{
-/*     -0    -1    -2    -3    -4    -5    -6    -7    -8    -9    -A    -B    -C    -D    -E    -F */
-    { 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76 },
-    { 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0 },
-    { 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15 },
-    { 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75 },
-    { 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84 },
-    { 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF },
-    { 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8 },
-    { 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2 },
-    { 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73 },
-    { 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB },
-    { 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79 },
-    { 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08 },
-    { 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A },
-    { 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E },
-    { 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF },
-    { 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 }
-};
-
-static const
-CipherVec AESBCMEMBER(RijndaelInvSBoxV)[16] = 
-{
-/*     -0    -1    -2    -3    -4    -5    -6    -7    -8    -9    -A    -B    -C    -D    -E    -F */
-    { 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB },
-    { 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB },
-    { 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E },
-    { 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25 },
-    { 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92 },
-    { 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84 },
-    { 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06 },
-    { 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B },
-    { 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73 },
-    { 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E },
-    { 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B },
-    { 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4 },
-    { 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F },
-    { 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF },
-    { 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61 },
-    { 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }
-};
-
-
-static const
-CipherVec lo_filter = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-                        0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-
-static __inline__
-CipherVec AESBCMEMBER(SubBytesInt) (CipherVec state, const CipherVec box [16])
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(SubBytesInt) (CipherVec state, const CipherVec box [16])
-{
-    CipherVec lo, hi, tmp, out;
-    unsigned ix;
-
-    out = vec_00;
-
-/*     DEBUG_CIPHER_VECTOR ("state", state); */
-    lo = AESBCMEMBER(VecAnd) (state, vec_0F);
-/*     DEBUG_CIPHER_VECTOR ("lo", lo); */
-#if USE_VEC_REG
-    hi = op_PSRLDI128 (state, 4);
-/*     DEBUG_CIPHER_VECTOR ("hi", hi); */
-    hi = AESBCMEMBER(VecAnd) (hi, vec_0F);
-/*     DEBUG_CIPHER_VECTOR ("hi", hi); */
-#else
-    hi = AESBCMEMBER(VecDiv) (state, vec_10);
-/*     DEBUG_CIPHER_VECTOR ("hi", hi); */
-#endif
-
-    for (ix = 0; ix < sizeof (state); ++ix)
-    {
-        tmp = AESBCMEMBER(PackShuffleBytes) (lo_filter, hi);
-/*         DEBUG_CIPHER_VECTOR ("tmp", tmp); */
-        tmp = AESBCMEMBER(VecOr) (lo, tmp);
-/*         DEBUG_CIPHER_VECTOR ("tmp", tmp); */
-        tmp = AESBCMEMBER(PackShuffleBytes) (box[ix], tmp);
-/*         DEBUG_CIPHER_VECTOR ("tmp", tmp); */
-        out = AESBCMEMBER(VecOr) (out, tmp);
-/*         DEBUG_CIPHER_VECTOR ("out", out); */
-        hi  = AESBCMEMBER(VecSub) (hi, vec_01);
-/*         DEBUG_CIPHER_VECTOR ("hi", hi); */
-        hi  = AESBCMEMBER(VecAnd) (hi, vec_0F);
-/*         DEBUG_CIPHER_VECTOR ("hi", hi); */
-    }
-/*     DEBUG_CIPHER_VECTOR ("out", out); */
-    return out;
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(SubBytes) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(SubBytes) (CipherVec state)
-{
-    return AESBCMEMBER(SubBytesInt) (state, AESBCMEMBER(RijndaelSBoxV));
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(InvSubBytes) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(InvSubBytes) (CipherVec state)
-{
-    return AESBCMEMBER(SubBytesInt) (state, AESBCMEMBER(RijndaelInvSBoxV));
-}
-
-
-/* ======================================================================
- * FIPS-197 5.1.3
- */
-
-/*
- * there are no psllb or psrlb instructions so shift words not bytes
- * and then cut off bits that would have been zeroed if there were
- * such instructions
- *
- * 
- */
-static const CipherVec FF_tab = 
-{ 0x00, 0x1B, 0x36, 0x2D, 0x6C, 0x77, 0x5A, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul) (register CipherVec state, const int bits)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul) (register CipherVec state, const int bits)
-{
-    CipherVec sl, sr;
-
-    assert (bits <= 8);
-
-    DEBUG_CIPHER_VECTOR ("state", state);
-    sr = AESBCMEMBER(VecSRLBI) (state, 8 - bits);
-    DEBUG_CIPHER_VECTOR ("sr", sr);
-    sl = AESBCMEMBER(VecSLLBI) (state, bits);
-    DEBUG_CIPHER_VECTOR ("sl", sl);
-    sr = AESBCMEMBER(PackShuffleBytes) (FF_tab, sr);
-    return AESBCMEMBER(VecXor)(sl, sr);
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_02) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_02) (register CipherVec state)
-{
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    state =  AESBCMEMBER(FF_mul) (state, 1);
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    return state;
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_04) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_04) (CipherVec state)
-{
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    state =  AESBCMEMBER(FF_mul) (state, 2);
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    return state;
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_08) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(FF_mul_08) (CipherVec state)
-{
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    state =  AESBCMEMBER(FF_mul) (state, 3);
-    DEBUG_CIPHER_VECTOR ("state", state);
-
-    return state;
-}
-
-
-static AESByte AESBCMEMBER(FFtable)[] = { 0x00, 0x1b, 0x36, 0x2d, 0x6c, 0x77, 0x5a, 0x41 };
-
-
-static __inline__ 
-AESByte AESBCMEMBER(FFtab) (uint8_t x)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-AESByte AESBCMEMBER(FFtab) (uint8_t x)
-{
-    return AESBCMEMBER(FFtable)[x];
-}
-
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul02) (AESByte b)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul02) (AESByte b)
-{
-    return (b << 1) ^ AESBCMEMBER(FFtab)(b >> 7);
-}
-
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul04) (AESByte b)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul04) (AESByte b)
-{
-    return (b << 2) ^ AESBCMEMBER(FFtab)(b >> 6);
-}
-
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul08) (AESByte b)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-AESByte AESBCMEMBER(FFmul08) (AESByte b)
-{
-    return (b << 3) ^ AESBCMEMBER(FFtab)(b >> 5);
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(MixColumns) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(MixColumns) (CipherVec state)
-{
-    register CipherVec c0, c1, c2, c3;
-    
-    c1 = AESBCMEMBER(RotBytesLeft) (state);
-    c2 = AESBCMEMBER(RotBytesLeft) (c1);
-    c3 = AESBCMEMBER(RotBytesLeft) (c2);
-    c0 = AESBCMEMBER(VecXor) (state, c1);
-
-
-#if USE_VEC_REG
-    c0 = AESBCMEMBER(FF_mul_02) (c0);
-#else
-    {
-        CipherVec_AES_u tmp;
-        unsigned ix;
-
-        tmp.state = c0;
-    
-        for (ix = 0; ix < sizeof tmp; ++ix)
-            tmp.bytes[ix] = AESBCMEMBER(FFmul02)(tmp.bytes[ix]);
-        c0 = tmp.state;
-    }
-#endif
-    c1 = AESBCMEMBER(VecXor) (c1, c2);
-    c1 = AESBCMEMBER(VecXor) (c1, c3);
-    c1 = AESBCMEMBER(VecXor) (c1, c0);
-
-    return c1;
-/* obsoleted 
-    CipherVec_AES_u in, out;
-    unsigned ix;
-
-    in.state = state;
-
-    for (ix = 0; ix < sizeof (out.bytes); ix += 4)
-    {
-        unsigned const s0 = in.bytes[ix + 0];
-        unsigned const s1 = in.bytes[ix + 1];
-        unsigned const s2 = in.bytes[ix + 2];
-        unsigned const s3 = in.bytes[ix + 3];
-
-        out.bytes[ix + 0] =      s1 ^ s2 ^ s3 ^ AESBCMEMBER(FFmul02)(s0 ^ s1);
-        out.bytes[ix + 1] = s0      ^ s2 ^ s3 ^ AESBCMEMBER(FFmul02)(s1 ^ s2);
-        out.bytes[ix + 2] = s0 ^ s1      ^ s3 ^ AESBCMEMBER(FFmul02)(s2 ^ s3);
-        out.bytes[ix + 3] = s0 ^ s1 ^ s2      ^ AESBCMEMBER(FFmul02)(s3 ^ s0);
-    }
-    return out.state;
-*/
-}
-
-static __inline__
-CipherVec AESBCMEMBER(InvMixColumns) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(InvMixColumns) (CipherVec state)
-{
-#if USE_AES_NI
-    state = op_AESIMC (state);
-#else
-    register CipherVec r1, r2, r3, f2, f4, f8;
-
-    r1 = AESBCMEMBER(RotBytesLeft) (state);
-    r2 = AESBCMEMBER(RotBytesLeft) (r1);
-    r3 = AESBCMEMBER(RotBytesLeft) (r2);        
-
-    f4 = AESBCMEMBER(VecXor) (state, r2);
-    f2 = AESBCMEMBER(VecXor) (state, r1);
-    f8 = AESBCMEMBER(VecXor) (r2, r3);
-    state = AESBCMEMBER(VecXor) (f8, r1);
-    f8 = AESBCMEMBER(VecXor) (f8, f2);
-
-
-#if USE_VEC_REG
-    f2 = AESBCMEMBER(FF_mul) (f2,1);
-    f4 = AESBCMEMBER(FF_mul) (f4,2);
-    f8 = AESBCMEMBER(FF_mul) (f8,3);
-#else
-    {
-        CipherVec_AES_u fu2, fu4, fu8;
-        unsigned ix;
-
-        fu2.state = f2;
-        fu4.state = f4;
-        fu8.state = f8;
-
-        for (ix = 0; ix < sizeof fu2; ++ix)
-        {
-            fu2.bytes[ix] = AESBCMEMBER(FFmul02)(fu2.bytes[ix]);
-            fu4.bytes[ix] = AESBCMEMBER(FFmul04)(fu4.bytes[ix]);
-            fu8.bytes[ix] = AESBCMEMBER(FFmul08)(fu8.bytes[ix]);
-        }
-        f2 = fu2.state;
-        f4 = fu4.state;
-        f8 = fu8.state;
-    }
-#endif
-
-    state = AESBCMEMBER(VecXor) (state, f2);
-    state = AESBCMEMBER(VecXor) (state, f4);
-    state = AESBCMEMBER(VecXor) (state, f8);
-
-#endif
-
-    return state;
-/*
-    CipherVec_AES_u in, out;
-    unsigned ix;
-
-    in.state = state;
-
-    for (ix = 0; ix < sizeof (out.bytes); ix += AES_Nb)
-    {
-        AESWord s0 = in.bytes[ix + 0];
-        AESWord s1 = in.bytes[ix + 1];
-        AESWord s2 = in.bytes[ix + 2];
-        AESWord s3 = in.bytes[ix + 3];
-        AESWord p, q;
-
-        q =     AESBCMEMBER(FFmul08)(s0 ^ s1 ^ s2 ^ s3);
-        p = q ^ AESBCMEMBER(FFmul04)(s0 ^ s2);
-        q = q ^ AESBCMEMBER(FFmul04)(s1 ^ s3);
-
-        out.bytes[ix + 0] =      s1 ^ s2 ^ s3 ^ AESBCMEMBER(FFmul02)(s0 ^ s1) ^ p;
-        out.bytes[ix + 1] = s0      ^ s2 ^ s3 ^ AESBCMEMBER(FFmul02)(s1 ^ s2) ^ q;
-        out.bytes[ix + 2] = s0 ^ s1      ^ s3 ^ AESBCMEMBER(FFmul02)(s2 ^ s3) ^ p;
-        out.bytes[ix + 3] = s0 ^ s1 ^ s2      ^ AESBCMEMBER(FFmul02)(s3 ^ s0) ^ q;
-    }
-
-    return out.state;
-*/
-}
-
-
-/* ======================================================================
- * FIPS-197 5.2
- */
-static const
-AESWord AESBCMEMBER(Rcon)[] = {
-    0x00000001, 0x00000002, 0x00000004, 0x00000008,
-    0x00000010, 0x00000020, 0x00000040, 0x00000080,
-    0x0000001B, 0x00000036
-};
-
-
-static __inline__
-AESWord AESBCMEMBER(RotWord) (AESWord w)
-    __attribute__ ((always_inline));
-
-static __inline__
-AESWord AESBCMEMBER(RotWord) (AESWord w)
-{
-    return (w >> 8) | (w << 24);
-}
-
-
-static __inline__
-AESWord AESBCMEMBER(GetWord) (const AESByte * pointer)
-    __attribute__ ((always_inline));
-
-static __inline__
-AESWord AESBCMEMBER(GetWord) (const AESByte * pointer)
-{
-    /*
-     * not portable to architectures which require aligned multibyte reads
-     * but as this only runs on Intel at this point it is fine for now
-     */
-    return *(AESWord*)pointer;
-}
-
-
-
-static __inline__
-void AESBCMEMBER(KeyExpansion) (CipherVec * r, const AESByte * key, unsigned Nr, unsigned Nk)
-{
-    AESWord * w = (AESWord*)r;
-    const AESWord * pRcon;
-    unsigned ix, limit;
-    AESWord temp;
-
-
-    DEBUG_KEYEXP(("%s (w (%p), key (%p), Nr (%u) Nk (%u))\n", __func__, w, key, Nr, Nk));
-
-    for (ix = 0; ix < Nk; ++ix)
-    {
-        DEBUG_KEYEXP(("i (dec): %u\n", ix));
-        temp = AESBCMEMBER(GetWord) (key+(ix*4));
-        w[ix] = temp;
-        DEBUG_KEYEXP(("kw[%i]: %0.8x\n", ix, temp));
-    }
-
-    limit = AES_Nb * (Nr + 1);
-    pRcon = AESBCMEMBER(Rcon);
-    DEBUG_KEYEXP(("Nk (%u) Nr (%u) limit (%u)\n", Nk, Nr, limit));
-        
-    for (; ix < limit; ++ix)
-    {
-
-        DEBUG_KEYEXP(("i (dec): %u %u\n", ix, limit));
-
-        /* temp should already be set */
-        DEBUG_KEYEXP(("temp: %0.8x\n", temp));
-        if ((ix % Nk) == 0)
-        {
-            temp = AESBCMEMBER(RotWord)(temp);
-            DEBUG_KEYEXP(("after RotWord: %0.8x \n", temp));
-            temp = AESBCMEMBER(SubWord) (temp);
-            DEBUG_KEYEXP(("after SubWord: %0.8x \n", temp));
-            DEBUG_KEYEXP(("Rcon [i/Nk]: %0.8x\n", *pRcon));
-            temp ^= *pRcon++;
-            DEBUG_KEYEXP(("after XOR with Rcon: %0.8x \n", temp));
-        }
-        else if ((Nk > 6) && ((ix % Nk) == 4))
-        {
-            temp = AESBCMEMBER(SubWord) (temp);
-            DEBUG_KEYEXP(("after SubWord: %0.8x \n", temp));
-        }
-        DEBUG_KEYEXP(("w[i-Nk]: %0.8x\n", w[ix-Nk]));
-        temp ^= w [ix - Nk];
-        DEBUG_KEYEXP(("kw[ix]: %0.8x\n", temp));
-        w [ix] = temp;
-    }
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftLeft32) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftLeft32) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    static const CipherVec mask = { 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-    return AESBCMEMBER(PackShuffleBytes) (state, mask);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[3] = temp.columns[2];
-    temp.columns[2] = temp.columns[1];
-    temp.columns[1] = temp.columns[0];
-    temp.columns[0] = 0;
-    return temp.state;
-#endif
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftRight64) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftRight64) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    static const CipherVec mask = { 8, 9, 10, 11, 12, 13, 14, 15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-    return AESBCMEMBER(PackShuffleBytes) (state, mask);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[0] = temp.columns[2];
-    temp.columns[1] = temp.columns[3];
-    temp.columns[2] = 0;
-    temp.columns[3] = 0;
-    return temp.state;
-#endif
-}
-
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftLeft64) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateShiftLeft64) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    static const CipherVec mask = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 1, 2, 3, 4, 5, 6, 7 };
-    return AESBCMEMBER(PackShuffleBytes) (state, mask);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[3] = temp.columns[2];
-    temp.columns[2] = temp.columns[1];
-    temp.columns[1] = temp.columns[0];
-    temp.columns[0] = 0;
-    return temp.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *
- * output vector in words
- *     W3:W3:W3:W3
- */
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn3) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn3) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    return op_PSHUFD128 (state,0xFF);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[2] = temp.columns[3];
-    temp.columns[1] = temp.columns[3];
-    temp.columns[0] = temp.columns[3];
-    return temp.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *
- * output vector in words
- *     W2:W2:W2:W2
- */
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn2) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn2) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    return op_PSHUFD128 (state,0xAA);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[3] = temp.columns[2];
-    temp.columns[1] = temp.columns[2];
-    temp.columns[0] = temp.columns[2];
-    return temp.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *
- * output vector in words
- *     W2:W2:W2:W2
- */
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn1) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn1) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    return op_PSHUFD128 (state,0x55);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[3] = temp.columns[1];
-    temp.columns[2] = temp.columns[1];
-    temp.columns[0] = temp.columns[1];
-    return temp.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *
- * output vector in words
- *     W0:W0:W0:W0
- */
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn0) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateDupColumn0) (CipherVec state)
-{
-#if (USE_VEC_REG)
-    return op_PSHUFD128 (state,0x00);
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-    temp.columns[3] = temp.columns[0];
-    temp.columns[2] = temp.columns[0];
-    temp.columns[1] = temp.columns[0];
-    return temp.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *     X0:X1:X2:X3
- *
- * output vector in words
- *     W0:W1:X0:X1
- */
-static __inline__
-CipherVec AESBCMEMBER(StateMerge1) (CipherVec w, CipherVec x)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateMerge1) (CipherVec w, CipherVec x)
-{
-#if USE_VEC_REG
-    return op_SHUFPD (w, x, 0x00);
-#else
-    CipherVec_AES_u ww;
-    CipherVec_AES_u xx;
-
-    ww.state = w;
-    xx.state = x;
-
-    ww.columns[2] = xx.columns[0];
-    ww.columns[3] = xx.columns[1];
-
-    return ww.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *     X0:X1:X2:X3
- *
- * output vector in words
- *     X2:X3:W0:W1
- */
-static __inline__
-CipherVec AESBCMEMBER(StateMerge2) (CipherVec w, CipherVec x)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateMerge2) (CipherVec w, CipherVec x)
-{
-#if USE_VEC_REG
-    return op_SHUFPD (w, x, 0x01);
-#else
-    CipherVec_AES_u ww;
-    CipherVec_AES_u xx;
-
-    ww.state = w;
-    xx.state = x;
-
-    ww.columns[0] = ww.columns[2];
-    ww.columns[1] = ww.columns[3];
-    ww.columns[2] = xx.columns[0];
-    ww.columns[3] = xx.columns[1];
-
-    return ww.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *     X0:X1:X2:X3
- *
- * output vector in words
- *     X2:X3:W0:W1
- */
-static __inline__
-CipherVec AESBCMEMBER(StateMerge3) (CipherVec v0, CipherVec v1)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(StateMerge3) (CipherVec v0, CipherVec v1)
-{
-#if USE_VEC_REG
-    return op_SHUFPD (v0, v1, 0x02);
-#else
-    CipherVec_AES_u t0;
-    CipherVec_AES_u t1;
-
-    t0.state = v0;
-    t1.state = v1;
-
-    t0.columns[2] = t0.columns[0];
-    t0.columns[3] = t0.columns[1];
-    t0.columns[0] = t1.columns[2];
-    t0.columns[1] = t1.columns[3];
-
-    return t0.state;
-#endif
-}
-
-
-/*
- * incoming vector in words
- *     W0:W1:W2:W3
- *
- * output vector in words
- *     W0:W0^W1:W0^W1^W2:W0^W1^W2^W3
- */
-static __inline__
-CipherVec AESBCMEMBER(ShiftXorColumns) (CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(ShiftXorColumns) (CipherVec state)
-{
-#if USE_VEC
-    register CipherVec shift = state;
-
-    state ^= shift = AESBCMEMBER(StateShiftLeft32) (shift);
-    state ^= shift = AESBCMEMBER(StateShiftLeft32) (shift);
-    state ^= shift = AESBCMEMBER(StateShiftLeft32) (shift);
-
-    return state;
-#else
-    CipherVec_AES_u temp;
-
-    temp.state = state;
-
-    temp.columns[1] ^= temp.columns[0];
-    temp.columns[2] ^= temp.columns[1];
-    temp.columns[3] ^= temp.columns[2];
-
-    return temp.state;
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssist) (register CipherVec state, const int rcon)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssist) (register CipherVec state, const int rcon)
-{
-#if (USE_AES_NI)
-    return op_AESKEYGENASSIST (state, rcon);
-#else
-    CipherVec_AES_u in;
-    CipherVec_AES_u out;
-    AESWord rconw;
-
-    rconw = (AESWord)(AESByte)rcon;
-    in.state = state;
-
-    out.columns[0] = AESBCMEMBER(SubWord)(in.columns[1]);
-    out.columns[1] = AESBCMEMBER(RotWord)(out.columns[0]) ^ rconw;
-    out.columns[2] = AESBCMEMBER(SubWord)(in.columns[3]);
-    out.columns[3] = AESBCMEMBER(RotWord)(out.columns[2]) ^ rconw;
-
-    return out.state;
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn1) (register CipherVec state, const int rcon)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn1) (register CipherVec state, const int rcon)
-{
-#if (USE_AES_NI)
-    register CipherVec tmp = state;
-    tmp = op_AESKEYGENASSIST (tmp, rcon);
-    return  AESBCMEMBER(StateDupColumn1) (tmp);
-#else
-    CipherVec_AES_u u;
-    AESWord rconw;
-    AESWord temp;
-
-    rconw = (AESWord)(AESByte)rcon;
-    u.state = state;
-    temp  = AESBCMEMBER(SubWord)(u.columns[1]);
-    temp  = AESBCMEMBER(RotWord)(temp);
-    temp ^= rconw;
-
-    u.columns [0] = u.columns [1] = u.columns [2] = u.columns [3] = temp;
-    return u.state;
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn2) (register CipherVec state)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn2) (register CipherVec state)
-{
-#if (USE_AES_NI)
-    register CipherVec tmp = state;
-    tmp = op_AESKEYGENASSIST (tmp, 0);
-    return  AESBCMEMBER(StateDupColumn2) (tmp);
-#else
-    CipherVec_AES_u u;
-    AESWord temp;
-
-    u.state = state;
-    temp  = AESBCMEMBER(SubWord)(u.columns[3]);
-
-    u.columns [0] = u.columns [1] = u.columns [2] = u.columns [3] = temp;
-    return u.state;
-#endif
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn3) (register CipherVec state, const int rcon)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(AesKeyGenAssistColumn3) (register CipherVec state, const int rcon)
-{
-#if (USE_AES_NI)
-    register CipherVec tmp = state;
-    tmp = op_AESKEYGENASSIST (tmp, rcon);
-    return  AESBCMEMBER(StateDupColumn3) (tmp);
-
-#else
-    register CipherVec vrcon;
-    register CipherVec tmp;
-
-    vrcon = AESBCMEMBER(SetColumn) (vec_00, (AESWord)rcon, 3);
-    tmp = AESBCMEMBER(SubBytes) (state);
-    DEBUG_CIPHER_VECTOR ("SubBytes", tmp);
-    tmp = AESBCMEMBER(RotBytesLeft) (tmp);
-    DEBUG_CIPHER_VECTOR ("RotBytesLeft", tmp);
-    tmp = AESBCMEMBER(VecXor)(tmp, vrcon);
-    DEBUG_CIPHER_VECTOR ("VecXor", tmp);
-    tmp = AESBCMEMBER(StateDupColumn3) (tmp);
-    DEBUG_CIPHER_VECTOR ("StateDupColumn3", tmp);
-    return tmp;
-
-#endif
-/*
-#elif USE_VEC && 1
-    register CipherVec tmp;
-    CipherVec_AES_u u;
-    
-    u.columns [3] = rcon;
-
-    tmp = AESBCMEMBER(SubBytes) (state);
-    DEBUG_CIPHER_VECTOR ("SubBytes", tmp);
-    tmp = AESBCMEMBER(RotBytesLeft) (tmp);
-    DEBUG_CIPHER_VECTOR ("RotBytesLeft", tmp);
-    tmp = AESBCMEMBER(VecXor)(tmp, u.state);
-    DEBUG_CIPHER_VECTOR ("VecXor", tmp);
-    tmp = AESBCMEMBER(StateDupColumn3) (tmp);
-    DEBUG_CIPHER_VECTOR ("StateDupColumn3", tmp);
-    return tmp;
-
-#else
-    CipherVec_AES_u u;
-    AESWord rconw;
-    AESWord temp;
-
-    rconw = (AESWord)(AESByte)rcon;
-    u.state = state;
-    temp  = AESBCMEMBER(SubWord)(u.columns[3]);
-    temp  = AESBCMEMBER(RotWord)(temp);
-    temp ^= rconw;
-
-    u.columns [0] = u.columns [1] = u.columns [2] = u.columns [3] = temp;
-    return u.state;
-#endif
-*/
-}
-
-
-#if USE_VEC
-static __inline__
-void AESBCMEMBER(KeyExpansion128) (CipherVec * round_keys, const AESByte * key)
-{
-    CipherVec state;
-    CipherVec kgastate;
-
-    state = AESBCMEMBER(StateIn) (key);
-    round_keys[0] = state;
-
-#define KE128(rcon,offset) \
-    kgastate = AESBCMEMBER(AesKeyGenAssistColumn3) (state, rcon); \
-    state = AESBCMEMBER(ShiftXorColumns) (state); \
-    state ^= kgastate; \
-    round_keys[offset] = state
-
-    KE128(0x01,1);
-    KE128(0x02,2);
-    KE128(0x04,3);
-    KE128(0x08,4);
-    KE128(0x10,5);
-    KE128(0x20,6);
-    KE128(0x40,7);
-    KE128(0x80,8);
-    KE128(0x1B,9);
-    KE128(0x36,10);
-}
-#else
-static __inline__
-void AESBCMEMBER(KeyExpansion128) (CipherVec * w, const AESByte * key)
-{
-    OUTMSG(("\n\n\n%s: Not my code\n\n\n",__func__));
-    AESBCMEMBER(KeyExpansion) (w, key, AES_Nr_128, AES_Nk_128);
-}
-#endif
-
-
-#if USE_VEC
-static __inline__
-void AESBCMEMBER(KeyExpansion192) (CipherVec * round_keys, const AESByte * key)
-{
-    /* work on three blocks at a time which is two Nr worth
-     * we'll build it with 6 words in v0:v1 and 6 words in w0:w1
-     * but move them them into v0:v1:v2 before writing them to
-     * the key schedule
-     */
-
-    register CipherVec v0, v1, v2, v3, v4;
-    register CipherVec k;          /* we'll only need one of the key gen assist blocks at a time */
-
-/* pattern 0 */
-    v0  = AESBCMEMBER(StateIn) (key);              /* k0    : k1    : k2     : k3           */
-    v1  = AESBCMEMBER(StateIn) (key+8);            /* k2    : k3    : k4     : k5           */
-    v1  = AESBCMEMBER(StateShiftRight64) (v1);     /* k4    : k5    : 0      : 0            */
-
-    round_keys[0] = v0; /* K0:K1:K2:K3 */
-
-/* pattern 1 */
-/* start the working pattern with 6 ready words in v0:v1 */
-
-    k   = AESBCMEMBER(AesKeyGenAssistColumn1)
-        (k = v1, 0x01);                            /* F(k5) : F(k5) : F(k5)  : F(k5)        */
-    v3  = AESBCMEMBER(ShiftXorColumns) (v0);       /* k0    : k0^k1 :k0^k1^k2:k0^k1^k2^k3   */
-    v3 ^= k;                                       /* k6    : k7    : k8     : k9           */
-    v4  = AESBCMEMBER(ShiftXorColumns) (v1);       /* k4    : k4^k5 : k4^k5  : k4^k5        */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v3);   /* k9    : k9    : k9     : k9           */
-    v4 ^= k;                                       /* k10   : k11   : k10    : k11          */
-    v1  = AESBCMEMBER(StateMerge1) (v1,v3);        /* k4    : k5    : k6     : k7           */
-    round_keys[1] = v1; /* K4:K5:K6:K7 */
-
-    v2  = AESBCMEMBER(StateMerge2) (v3,v4);        /* k8    : k9    : k10    : k11          */
-    round_keys[2] = v2; /* K8:K9:K10:K11 */
-
-/* pattern 2 */
-    v0  = AESBCMEMBER(ShiftXorColumns) (v3);       /* k6    : k6^k7 :k6^k7^k8:k6^k7^k8^k9   */
-    v1  = AESBCMEMBER(ShiftXorColumns) (v4);       /* k10   :k10^k11: k10^k11: k10^k11      */
-    k   = AESBCMEMBER(AesKeyGenAssistColumn3)
-        (k = v2,0x02);                             /* F(k11): F(k11): F(k11) : F(k11)       */
-    v0 ^= k;                                       /* k12   : k13   : k14    : k15          */
-    round_keys[3] = v0; /* K12:K13:K14:K15 */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v0);   /* k15   : k15   : k15    : k15          */
-    v1 ^= k;                                       /* k16   : k17   : k16    : k17          */
-
-
-/* pattern 1 */
-/* start the working pattern with 6 ready words in v0:v1 */
-
-    k   = AESBCMEMBER(AesKeyGenAssistColumn1)
-        (k = v1,0x04);                             /* F(k17): F(k17): F(k17) : F(k17)       */
-    v3  = AESBCMEMBER(ShiftXorColumns) (v0);       /* k12   :k12^k13:k12^k13^k14:k12^k13^k14^k15 */
-    v3 ^= k;                                       /* k18   : k19   : k20    : k21          */
-    v4  = AESBCMEMBER(ShiftXorColumns) (v1);       /* k16   :k16^k17: k17    : 0            */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v3);   /* k21   : k21   : k21    : k21          */
-    v4 ^= k;                                       /* k22   : k23   : x      : x            */
-    v1  = AESBCMEMBER(StateMerge1) (v1,v3);        /* k16   : k17   : k18    : k19          */
-    round_keys[4] = v1; /* K16:K17:K18:K19 */
-
-    v2  = AESBCMEMBER(StateMerge2) (v3,v4);        /* k20   : k21   : k22    : k23          */
-    round_keys[5] = v2; /* K20:K21:K22:K23 */
-
-/* pattern 2 */
-    v0  = AESBCMEMBER(ShiftXorColumns) (v3);       /* k18   :k18^k19:k18^k19^k20:k18^k19^k20^k21 */
-    v1  = AESBCMEMBER(ShiftXorColumns) (v4);       /* k22   :k22^k23: k23    : 0            */
-    k   = AESBCMEMBER(AesKeyGenAssistColumn3)
-        (k = v2,0x08);                             /* F(k23): F(k23): F(k23) : F(k23)       */
-    v0 ^= k;                                       /* k24   : k25   : k26    : k27          */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v0);   /* k27   : k27   : k27    : k27          */
-    v1 ^= k;                                       /* k28   : k29   : x      : x            */
-
-    round_keys[6] = v0; /* K24:K25:K26:K27 */
-
-/* pattern 1 4-15 = 28-39 */
-/* start the working pattern with 6 ready words in v0:v1 */
-
-    k   = AESBCMEMBER(AesKeyGenAssistColumn1)
-        (k = v1,0x10);                             /* F(k29): F(k29): F(k29) : F(k29)       */
-    v3  = AESBCMEMBER(ShiftXorColumns) (v0);       /* k24   :k24^k25:k24^k25^k26:k24^k25^k26^k27 */
-    v3 ^= k;                                       /* k30   : k31   : k32    : k33          */
-    v4  = AESBCMEMBER(ShiftXorColumns) (v1);       /* k26   :k28^k29: k29    : 0            */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v3);   /* k33   : k33   : k33    : k33          */
-    v4 ^= k;                                       /* k34   : k35   : x      : x            */
-    v1  = AESBCMEMBER(StateMerge1) (v1,v3);        /* k28   : k29   : k30    : k31          */
-
-    round_keys[7] = v1; /* K28:K29:K30:K31 */
-
-    v2  = AESBCMEMBER(StateMerge2) (v3,v4);        /* k32   : k33   : k34    : k35          */
-    round_keys[8] = v2; /* K32:K33:K34:K35 */
-/* pattern 2 */
-    v0  = AESBCMEMBER(ShiftXorColumns) (v3);       /* k30   :k30^k31:k30^k31^k32:k30^k31^k32^k33 */
-    v1  = AESBCMEMBER(ShiftXorColumns) (v4);       /* k26   :k26^k27: k27    : 0            */
-    k   = AESBCMEMBER(AesKeyGenAssistColumn3)
-        (k = v2,0x20);                             /* F(k35): F(k35): F(k35) : F(k35)       */
-    v0 ^= k;                                       /* k36   : k37   : k38    : k39          */
-    k   = AESBCMEMBER(StateDupColumn3) (v0);       /* k39   : k39   : k39    : k39          */
-    v1 ^= k;                                       /* k40   : k41   : x      : x            */
-
-    round_keys[9] = v0; /* K36:K37:K38:K39 */
-
-/* pattern 1 4-15 = 40-55 but we only need through 51 so we change from pattern 2 to pattern 3 */
-/* start the working pattern with 6 ready words in v0:v1 */
-
-    k   = AESBCMEMBER(AesKeyGenAssistColumn1)
-        (k = v1,0x40);                             /* F(k41): F(k41): F(k41) : F(k41)       */
-    v3  = AESBCMEMBER(ShiftXorColumns) (v0);       /* k36   :k36^k37:k36^k37^k38:k36^k37^k38^k39 */
-    v4  = AESBCMEMBER(ShiftXorColumns) (v1);       /* k40   :k40^k41: x   5  : x            */
-    v3 ^= k;                                       /* k42   : k43   : k44    : k45          */
-    k   = AESBCMEMBER(StateDupColumn3) (k = v3);   /* k45   : k45   : k45    : k45          */
-    v4 ^= k;                                       /* k46   : k47   : x      : x            */
-    v1  = AESBCMEMBER(StateMerge1) (v1,v3);        /* k40   : k41   : k42    : k43          */
-    round_keys[10] = v1; /* K40:K41:K42:K43 */
-    v2  = AESBCMEMBER(StateMerge2) (v3,v4);        /* k44   : k45   : k46    : k47          */
-    round_keys[11] = v2; /* K44:K45:K46:K47 */
-
-/* pattern 3 */
-    v0  = AESBCMEMBER(ShiftXorColumns) (v3);       /* k42   :k42^k43:k42^k43^k44:k42^k43^k44^k45  */
-    k   = AESBCMEMBER(AesKeyGenAssistColumn3)
-                                       (v2,0x80);  /* F(k47): F(k47): F(k47) : F(k47)       */
-    v0 ^= k;                                       /* k48   : k49   : k50    : k51          */
-    round_keys[12] = v0;                           /* K48:K49:K50:K51 */
-}
-#else
-static __inline__
-void AESBCMEMBER(KeyExpansion192) (CipherVec * w, const AESByte * key)
-{
-    AESBCMEMBER(KeyExpansion) (w, key, AES_Nr_192, AES_Nk_192);
-}
-#endif
-
-
-
-
-/* ----- */
-
-#if USE_VEC || 1
-static __inline__
-void AESBCMEMBER(KeyExpansion256) (CipherVec * round_keys, const AESByte * key)
-{
-    CipherVec v0, v1;
-    CipherVec k;
-
-    v0 = AESBCMEMBER (StateIn) (key);
-    v1 = AESBCMEMBER (StateIn) (key + sizeof v0);
-
-    round_keys[0] = v0; /* k0  : k1  : k2  : k3  */
-    round_keys[1] = v1; /* k4  : k5  : k6  : k7  */
-
-#define KE256_1(offset,rcon)                            \
-    k   = AESBCMEMBER(AesKeyGenAssistColumn3)(v1,rcon); \
-    v0  = AESBCMEMBER(ShiftXorColumns) (v0);            \
-    v0  = AESBCMEMBER(VecXor) (v0, k);                  \
-    round_keys[offset] = v0
-
-#define KE256_2(offset) \
-    k   = AESBCMEMBER(AesKeyGenAssistColumn2)(v0);      \
-    v1  = AESBCMEMBER(ShiftXorColumns) (v1);            \
-    v1  = AESBCMEMBER(VecXor) (v1, k);                  \
-    round_keys[offset] = v1
-
-    KE256_1(2,0x01);    /* k8  : k9  : k10 : k11 */
-    KE256_2(3);         /* k12 : k13 : k14 : k15 */
-    KE256_1(4,0x02);    /* k16 : k17 : k18 : k19 */
-    KE256_2(5);         /* k20 : k21 : k22 : k23 */
-    KE256_1(6,0x04);    /* k24 : k25 : k26 : k27 */
-    KE256_2(7);         /* k28 : k29 : k30 : k31 */
-    KE256_1(8,0x08);    /* k32 : k33 : k34 : k35 */
-    KE256_2(9);         /* k36 : k37 : k38 : k39 */
-    KE256_1(10,0x10);   /* k40 : k41 : k42 : k43 */
-    KE256_2(11);        /* k44 : k45 : k46 : k47 */
-    KE256_1(12,0x20);   /* k48 : k49 : k50 : k51 */
-    KE256_2(13);        /* k52 : k53 : k54 : k55 */
-    KE256_1(14,0x40);   /* k56 : k57 : k58 : k59 */
-}
-#else
-static __inline__
-void AESBCMEMBER(KeyExpansion256) (CipherVec * w, const AESByte * key)
-{
-    AESBCMEMBER(KeyExpansion) (w, key, AES_Nr_256, AES_Nk_256);
-}
-#endif
-
-
-static __inline__
-void AESBCMEMBER(EqInvKeyExpansion) (CipherVec * r, const CipherVec * dr, unsigned Nr)
-{
-    unsigned ix, jx;
-
-    jx = Nr;
-    ix = 0;
-    r[ix++] = dr[jx--];
-    while (jx)
-        r[ix++] = AESBCMEMBER(InvMixColumns)(dr[jx--]);
-    r[ix] = dr[jx];
-}
-
-
-static __inline__
-void AESBCMEMBER(EqInvKeyExpansion128) (CipherVec * w, const CipherVec * kw)
-{
-    AESBCMEMBER(EqInvKeyExpansion) (w, kw, AES_Nr_128);
-}
-
-
-static __inline__
-void AESBCMEMBER(EqInvKeyExpansion192) (CipherVec * w, const CipherVec * kw)
-{
-    AESBCMEMBER(EqInvKeyExpansion) (w, kw, AES_Nr_192);
-}
-
-
-static __inline__
-void AESBCMEMBER(EqInvKeyExpansion256) (CipherVec * w, const CipherVec * kw)
-{
-    AESBCMEMBER(EqInvKeyExpansion) (w, kw, AES_Nr_256);
-}
-
-
-/*
- * Cipher First Round
- */
-static __inline__ 
-CipherVec AESBCMEMBER(FirstRound) (CipherVec state, const CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(FirstRound) (CipherVec state, const CipherVec round_keys)
-{
-    DEBUG_CIPHER_VECTOR("Start of Round", state);
-
-    DEBUG_CIPHER_VECTOR("Round Key", round_keys);
-
-    state = AESBCMEMBER(AddRoundKey) (state, round_keys);
-
-    DEBUG_CIPHER_VECTOR("End 1st Round", state);
-
-    return state;
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(MiddleRound) (register CipherVec state,
-                                    register const CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(MiddleRound) (register CipherVec state,
-                                    register const CipherVec round_keys)
-{
-#if _DEBUGGING
-    CipherVec mstate;
-    CipherVec mround_keys;
-
-    mstate = state;
-    mround_keys = round_keys;
-
-    DEBUG_CIPHER_VECTOR("Start of Round", mstate);
-
-#endif
-
-#if USE_AES_NI
-    state = op_AESENC (state, round_keys);
-#else
-    state = AESBCMEMBER(SubBytes) (state);
-
-    DEBUG_CIPHER_VECTOR("After SubBytes", state);
-
-    state = AESBCMEMBER(ShiftRows) (state);
-
-    DEBUG_CIPHER_VECTOR("After ShiftRow", state);
-
-    state = AESBCMEMBER(MixColumns) (state);
-
-    /* ommited n on purpose */
-    DEBUG_CIPHER_VECTOR("After MixColum", state);
-
-    state = AESBCMEMBER(AddRoundKey) (state, round_keys);
-#endif
-    DEBUG_CIPHER_VECTOR("Round Key", round_keys);
-    DEBUG_CIPHER_VECTOR("End of Round", state);
-
-    return state;
-}
-
-
-static __inline__ 
-CipherVec AESBCMEMBER(LastRound) (register CipherVec state, register CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__ 
-CipherVec AESBCMEMBER(LastRound) (register CipherVec state, register CipherVec round_keys)
-{
-    DEBUG_CIPHER_VECTOR("Start of Round", state);
-
-#if USE_AES_NI
-    state = op_AESENCLAST (state, round_keys);
-#else
-    state = AESBCMEMBER(SubBytes) (state);
-
-    DEBUG_CIPHER_VECTOR("After SubBytes", state);
-
-    state = AESBCMEMBER(ShiftRows) (state);
-
-    DEBUG_CIPHER_VECTOR("After ShiftRow", state);
-
-    state = AESBCMEMBER(AddRoundKey) (state, round_keys);
-#endif
-    DEBUG_CIPHER_VECTOR("Round Key", round_keys);
-    DEBUG_CIPHER_VECTOR("End of Round", state);
-
-    return state;
-}
-
-
-/* ----------------------------------------------------------------------
- * Cipher
- */
-/*
- * 
-This implementation as stated
- * above for simplifaction broke out the three types of rounds into
- * first round, middle rounds, and last round.  This approach was taken
- * for ease of coding for optimization using smaller bytes of code
- * but inlining of the functions for efficiency
- */
-static __inline__ 
-CipherVec AESBCMEMBER(Cipher) (CipherVec state, const CipherVec * key,
-                            unsigned Nr)
-{
-    unsigned ix = 0;
-
-    state = AESBCMEMBER(FirstRound) (state, key[ix++]);
-
-    for ( ; ix < Nr; ++ix)
-        state = AESBCMEMBER(MiddleRound) (state, key[ix] );
-
-    return AESBCMEMBER(LastRound) (state, key[ix]);
-}
-
-
-/* 
- * Section 5.1 of FIPS 197
- *
- *   This set of routines implements our structured wrapping of the 
- *   FIPS-197 Section 5.3.5 Equivalent Inverse Cipher.  In particular
- *   figure 15 Pseudo Code for the Equivalent Inverse Cipher.
- *
- *   The FIPS pseudocode has a single function which we have broken out 
- *   into three kinds of rounds - first round, middle rounds and last
- *   round as we have also done with the cipher rountine.
- *
- *   The EqInvCipher operates on whole cipher blocks so the Byte and Block
- *   code is the same here until subroutines of the round functions are
- *   called.  
- */
-
-/* 
- * First round of equivalent inverse cipher is merely an XOR against the
- * round key.
- */
-static __inline__
-CipherVec AESBCMEMBER(EqInvFirstRound) (CipherVec state, CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(EqInvFirstRound) (CipherVec state, CipherVec round_keys)
-{
-    DEBUG_INVCIPHER_VECTOR("Start of Round", state);
-
-    state =  AESBCMEMBER(AddRoundKey) (state, round_keys);
-
-    DEBUG_INVCIPHER_VECTOR("Round Key", round_keys);
-    DEBUG_INVCIPHER_VECTOR("End of Round", state);
-    return state;
-}
-
-
-/*
- * middle rounds of the equivalent inverse cipher perform four steps
- *   InvSubBytes (inverse substitute bytes
- *   InvShiftRows (inverse shift rows
- *   InvMixColumns (inverse mix columns)
- *   AddRoundKey   (xor against the round key)
- *
- * the AES-NI instruction set from until implments all four steps with 
- * a single instruction
- */
-
-static __inline__
-CipherVec AESBCMEMBER(EqInvMiddleRound) (register CipherVec state,
-                                         register CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(EqInvMiddleRound) (register CipherVec state,
-                                         register CipherVec round_keys)
-{
-#if _DEBUGGING
-    CipherVec mstate;
-    CipherVec mround_keys;
-
-    mstate = state;
-    mround_keys = round_keys;
-#endif
-
-    DEBUG_INVCIPHER_VECTOR("Start of Round", mstate);
-
-    /* 
-     * AES-NI implmentation
-     */
-#if USE_AES_NI
-
-    state = op_AESDEC (state, round_keys);
-
-#else /* #if USE_AES_NI */
-
-    /*
-     * All other implementations
-     */
-    state = AESBCMEMBER(InvSubBytes) (state);
-
-# if _DEBUGGING
-    mstate = state;
-
-    DEBUG_INVCIPHER_VECTOR("After InvSubBy", mstate);
-# endif
-
-    state = AESBCMEMBER(InvShiftRows) (state);
-
-# if _DEBUGGING
-    mstate = state;
-
-    DEBUG_INVCIPHER_VECTOR("After InvShift", mstate);
-# endif
-
-    state = AESBCMEMBER(InvMixColumns) (state);
-
-# if _DEBUGGING
-    mstate = state;
-
-    DEBUG_INVCIPHER_VECTOR("After InvMixCo", mstate);
-# endif
-
-    state = AESBCMEMBER(AddRoundKey) (state, round_keys);
-#endif
-
-#if _DEBUGGING
-    mstate = state;
-
-    DEBUG_INVCIPHER_VECTOR("Round Key", mround_keys);
-
-    DEBUG_INVCIPHER_VECTOR("End of Round", mstate);
-#endif /* #if USE_AES_NI */
-
-    return state;
-}
-
-
-/*
- * The final round of the equivalent inverse cipher is the same as 
- * the middle rounds with the ommission of the InvMixColumns step.
- */
-static __inline__
-CipherVec AESBCMEMBER(EqInvLastRound) (register CipherVec state,
-                                       register CipherVec round_keys)
-    __attribute__ ((always_inline));
-
-static __inline__
-CipherVec AESBCMEMBER(EqInvLastRound) (register CipherVec state,
-                                       register CipherVec round_keys)
-{
-    DEBUG_INVCIPHER_VECTOR("Start of Round", state);
-
-#if USE_AES_NI
-    state = op_AESDECLAST (state, round_keys);
-#else
-
-    state = AESBCMEMBER(InvSubBytes) (state);
-
-    DEBUG_INVCIPHER_VECTOR("After InvSubBy", state);
-
-    state = AESBCMEMBER(InvShiftRows) (state);
-
-    DEBUG_INVCIPHER_VECTOR("After InvShift", state);
-
-    state = AESBCMEMBER(AddRoundKey) (state, round_keys);
-#endif
-    DEBUG_INVCIPHER_VECTOR("Round Key", round_keys);
-    DEBUG_INVCIPHER_VECTOR("End of Round", state);
-
-    return state;
-}
-
-
-/*
- * The EqInvCipher functions (is defined in Figure 15 'Pseudo Code for
- * for the Equivalent Inverse Cipher.  This implementation as stated
- * above for simplifaction broke out the three types of rounds into
- * first round, middle rounds, and last round.  This approach was taken
- * for ease of coding for optimization using smaller bytes of code
- * but inlining of the functions for efficiency
- */
-static /*__inline__*/
-CipherVec AESBCMEMBER(EqInvCipher) (CipherVec state, const CipherVec * key,
-                                    unsigned Nr)
-{
-    unsigned ix = 0;
-
-    state = AESBCMEMBER(EqInvFirstRound) (state, key[ix++]);
-
-    for ( ; ix < Nr; ++ix)
-        state = AESBCMEMBER(EqInvMiddleRound) (state, key[ix] );
-
-    return AESBCMEMBER(EqInvLastRound) (state, key[ix]);
-}
-
-
-/* ======================================================================
- * This section of the file is the use of the cipher defined above within
- * our BlockCipherObject.
- *
- * These are the functions that will be directly referenced in the vector
- * table for the block cipher.  These are not specifically derived from
- * the FIPS-197 document.
- */
-#include "blockcipher-impl.h"
-
-typedef struct AES_CLASS AES_CLASS;
-
-static const char AESBCMEMBER(aes_ncbi_name) [] = CLASS_STRING(AES_CLASS);
-
-
-/* ----------------------------------------------------------------------
- * Destroy
- *   How large is the stored key for this cipher?  Not the user key used
- *   to create this key (key schedule)
- *
- *   This is needed by KCipher to know how large the KCipher objecr is at
- *   allocation and to know how much of a buffer each decryption/encryption is
- */
-static
-void AESBCMEMBER(Destroy) (const BLOCKCIPHER_VEC_IMPL * self)
-{
-    /* we use a constant object so do nothing */
-}
-
-
-/* ----------------------------------------------------------------------
- * BlockSize
- */
-static
-uint32_t AESBCMEMBER(BlockSize) ()
-{
-    return (uint32_t) sizeof (AESBlock);
-}
-
-
-/* ----------------------------------------------------------------------
- * KeySize
- *   How large is the stored key for this cipher?  Not the user key used
- *   to create this key (key schedule)
- *
- *   This is needed by KCipher to know how large the KCipher objecr is at
- *   allocation and to know how much of a buffer each decryption/encryption is
- */
-static
-uint32_t AESBCMEMBER(KeySize) ()
-{
-    return (uint32_t) sizeof (AESKeySchedule);
-}
-
-
-/* ----------------------------------------------------------------------
- * SetEncryptKey
- *   The KCipher calls this to have the block cipher build an encryption
- *   key in the KCipher object
- *
- */
-static
-rc_t AESBCMEMBER(SetEncryptKey) (void * encrypt_key, const char * user_key,
-                                 uint32_t user_key_size)
-{
-    rc_t rc;
-    AESKeySchedule * key;
-
-    rc = 0;
-    key = encrypt_key;
-
-    switch (user_key_size)
-    {
-    case AES_Nk_128 * sizeof (AESWord):
-        key->number_of_rounds = AES_Nr_128;
-        AESBCMEMBER(KeyExpansion128) (key->round_keys, (AESByte*)user_key);
-        break;
-
-    case AES_Nk_192 * sizeof (AESWord):
-        key->number_of_rounds = AES_Nr_192;
-        AESBCMEMBER(KeyExpansion192) (key->round_keys, (AESByte*)user_key);
-        break;
-
-    case AES_Nk_256 * sizeof (AESWord):
-        key->number_of_rounds = AES_Nr_256;
-        AESBCMEMBER(KeyExpansion256) (key->round_keys, (AESByte*)user_key);
-        break;
-
-    default:
-        key->number_of_rounds = 0;
-        memset (key, 0, sizeof (*key));
-        rc = RC (rcKrypto, rcBlockCipher, rcUpdating, rcParam, rcInvalid);
-        break;
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetDecryptKey
- *   The KCipher calls this to have the block cipher build an decryption
- *   key in the KCipher object
- *
- */
-static
-rc_t AESBCMEMBER(SetDecryptKey) (void * decrypt_key,
-                                 const char * user_key,
-                                 uint32_t user_key_size)
-{
-    AESKeySchedule encrypt_key;
-    rc_t rc;
-
-    rc = AESBCMEMBER(SetEncryptKey) (&encrypt_key, user_key, user_key_size);
-    if (rc == 0)
-    {
-        AESKeySchedule * key;
-
-        key = decrypt_key;
-
-        switch (key->number_of_rounds = encrypt_key.number_of_rounds)
-        {
-        case AES_Nr_128:
-            AESBCMEMBER(EqInvKeyExpansion128) (key->round_keys,
-                                               encrypt_key.round_keys);
-            break;
-
-        case AES_Nr_192:
-            AESBCMEMBER(EqInvKeyExpansion192) (key->round_keys,
-                                               encrypt_key.round_keys);
-            break;
-
-        case AES_Nr_256:
-            AESBCMEMBER(EqInvKeyExpansion256) (key->round_keys,
-                                               encrypt_key.round_keys);
-            break;
-        }
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Encrypt
- *
- *   Perform an encryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- *
- */
-static
-CipherVec AESBCMEMBER(Encrypt) (CipherVec state,
-                                const void * encrypt_key)
-{
-    const AESKeySchedule * key = encrypt_key;
-    assert (key);
-
-    switch (key->number_of_rounds)
-    {
-    default:
-        state = vec_00;
-        break;
-
-    case AES_Nr_128:
-        state = AESBCMEMBER(Cipher) (state, key->round_keys, AES_Nr_128);
-        break;
-
-    case AES_Nr_192:
-        state = AESBCMEMBER(Cipher) (state, key->round_keys, AES_Nr_192);
-        break;
-
-    case AES_Nr_256:
-        state = AESBCMEMBER(Cipher) (state, key->round_keys, AES_Nr_256);
-        break;
-    }
-
-    return state;
-}
-
-
-/* ----------------------------------------------------------------------
- * Decrypt
- *
- *   Perform a decryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- */
-static
-CipherVec AESBCMEMBER(Decrypt) (CipherVec state,
-                                const void * decrypt_key)
-{
-    const AESKeySchedule * key = decrypt_key;
-
-    assert (key);
-
-    switch (key->number_of_rounds)
-    {
-    default:
-        state = vec_00; /* for an illegal cipher key schedule just write zeroes */
-        break;
-
-    case AES_Nr_128:
-        state = AESBCMEMBER(EqInvCipher) (state, key->round_keys,
-                                          AES_Nr_128);
-        break;
-
-    case AES_Nr_192:
-        state = AESBCMEMBER(EqInvCipher) (state, key->round_keys,
-                                          AES_Nr_192);
-        break;
-
-    case AES_Nr_256:
-        state = AESBCMEMBER(EqInvCipher) (state, key->round_keys,
-                                          AES_Nr_256);
-        break;
-    }
-
-    return state;
-}
-
-
-/* ----------------------------------------------------------------------
- * MakeProcessorSupport
- *
- * Run-time check for support of this particular AES implmentation by
- * checking the flags given via the cpuid instruction.
- */
-static __inline__
-bool AESBCMEMBER(ProcessorSupport) ()
-{
-    uint32_t level = 1, a, b, c, d;
-    bool ret = true;
-
-    __cpuid (level, a, b, c, d);
-
-    DEBUG_OBJECT(("%s: level %x a %x, b %x c %x d %x\n",__func__, level, a,b,c,d));
-
-#if USE_AES_NI
-    /*
-     * Only one flag tells whether the AES-NI instructions
-     * are implmented in this CPU
-     */
-    if ( ! (c & bit_AES))
-    {
-        DEBUG_OBJECT(("%s: failed no AES\n",__func__));
-        ret = false;
-    } else
-#endif
-
-#if USE_VEC_REG
-    /*
-     * Several flags indicate different levels of SSE
-     * instruction implmentation
-     *
-     * we require SSE4.1
-     *
-     * that dates from 2006 so is most likely good enough
-     */
-        /* if ( ! (c & (bit_SSE4_2))
-    {
-        DEBUG_OBJECT(("%s: failed no SSSE3\n",__func__));
-        ret = false;
-    }
-
-    else */
-        if ( ! (c & bit_SSE4_1))
-    {
-        DEBUG_OBJECT(("%s: failed no SSSE3\n",__func__));
-        ret = false;
-    }
-
-    else if ( ! (c & bit_SSSE3))
-    {
-        DEBUG_OBJECT(("%s: failed no SSSE3\n",__func__));
-        ret = false;
-    }
-
-    else if ( ! (c & bit_SSE3))
-    {
-        DEBUG_OBJECT(("%s: failed no SSE3\n",__func__));
-        ret = false;
-    }
-
-    else if ( ! (d & bit_SSE2))
-    {
-        DEBUG_OBJECT(("%s: failed no SSE2\n",__func__));
-        ret = false;
-    }
-
-    else if ( ! (d & bit_SSE))
-    {
-        DEBUG_OBJECT(("%s: failed no SSE\n",__func__));
-        ret = false;
-    }
-#endif
-    DEBUG_OBJECT(("%s: passed\n",__func__));
-    return ret;
-}
-
-
-/* ----------------------------------------------------------------------
- * Init
- *
- *   Initialize the fields of this object.  The derived class will call this
- *   during it's initialization.
- *
- * self      object to initialze
- * vt        the virtual table of the derived class
- * mgr       the cipher manager that is the construction factory block cipher
- *           objects hold references to the manager while the manager merely
- *           points at the block ciphers when all block ciphers are destroyed
- *           the manager loses its references and it too can be destroyed if not
- *           held elsewhere
- * name      ASCIZ c-string the name of this class
- */
-static const
-KBlockCipherVec_vt_v1 AESBCMEMBER(_vt_) = 
-{
-    { 1, 1 },
-
-    AESBCMEMBER(Destroy),
-    AESBCMEMBER(BlockSize),
-    AESBCMEMBER(KeySize),
-    AESBCMEMBER(SetEncryptKey),
-    AESBCMEMBER(SetDecryptKey),
-    AESBCMEMBER(Encrypt),
-    AESBCMEMBER(Decrypt)
-};
-
-
-/* ----------------------------------------------------------------------
- * Make
- *
- * Create a new AES Block Cipher object.
- * The processor is checked to see if this particular version is supported on
- * this particular CPU.
- */
-rc_t AESBCMEMBER(Make) (KBlockCipher ** new_obj)
-{
-    rc_t rc;
-
-    DEBUG_OBJECT(("%s: %p\n",__func__,new_obj));
-
-    /* Check parameter first */
-    if (new_obj == NULL)
-        rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-    {
-        *new_obj = NULL;
-
-        /* check for processor support of this flavor */
-        if ( ! AESBCMEMBER(ProcessorSupport)())
-            rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcFunction, rcUnsupported);
-
-        else
-        {
-            rc = 0;
-            *new_obj = (KBlockCipher*)&(AESBCMEMBER(_vt_));
-        }
-    }
-    return rc;
-}
-
-/* end of file lib/krypto/aes-ncbi.c */
diff --git a/libs/krypto/aes-priv.h b/libs/krypto/aes-priv.h
deleted file mode 100644
index 4ebdbb0..0000000
--- a/libs/krypto/aes-priv.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_aes_priv_
-#define _h_krypto_aes_priv_
-
-/*
- * This header file was written to integrate the public domain AES code
- * with the SRA project
- */
-
-#define AES_ENCRYPT	1
-#define AES_DECRYPT	0
-
-/* Because array size can't be a const in C, the following two are macros.
-   Both sizes are in bytes. */
-#define AES_MAXNR (14)
-#define AES_BLOCK_SIZE (16)
-
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-typedef uint8_t AES_BYTE;
-typedef uint32_t AES_WORD;
-
-
-
-
-/* typedef int64_t AESState  __attribute__ ((vector_size (AES_BLOCK_SIZE))); */
-
-typedef struct AES_KEY AES_KEY;
-struct AES_KEY
-{
-    uint32_t rd_key [sizeof (AES_WORD) * (AES_MAXNR + 1)];
-    uint32_t rounds;
-};
-
-
-int AES_set_encrypt_key(const uint8_t *userKey, const uint32_t bits,
-                        AES_KEY *key);
-
-int AES_set_decrypt_key(const uint8_t *userKey, const uint32_t bits,
-                        AES_KEY *key);
-
-void AES_encrypt(const uint8_t *in, uint8_t *out,
-                 const AES_KEY *key);
-void AES_decrypt(const uint8_t *in, uint8_t *out,
-                 const AES_KEY *key);
-
-
-int AESx86_set_encrypt_key(const uint8_t *userKey, const uint32_t bits,
-                        AES_KEY *key);
-
-int AESx86_set_decrypt_key(const uint8_t *userKey, const uint32_t bits,
-                        AES_KEY *key);
-
-void AESx86_encrypt(const uint8_t *in, uint8_t *out,
-                 const AES_KEY *key);
-void AES_decrypt(const uint8_t *in, uint8_t *out,
-                 const AES_KEY *key);
-
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_aes_priv_ */
-
-
diff --git a/libs/krypto/aes.c b/libs/krypto/aes.c
deleted file mode 100644
index 328ba6d..0000000
--- a/libs/krypto/aes.c
+++ /dev/null
@@ -1 +0,0 @@
-#error "Obsolete do not use"
diff --git a/libs/krypto/aes_core.c b/libs/krypto/aes_core.c
deleted file mode 100644
index 385f669..0000000
--- a/libs/krypto/aes_core.c
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was modified as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *  Tweaked to match standards of the NCBI SRA project
- * We obatined this file from version 1.0.0e of OpenSSL but we have
- * eliminated the OpenSSL code where it could be identified
- *
- * We created our own header file as there was no public domain
- * header file associated with this public domain C file.
- */
-
-/**
- * rijndael-alg-fst.c
- *
- * @version 3.0 (December 2000)
- *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
- *
- * @author Vincent Rijmen <vincent.rijmen at esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers at esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto at terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-#include "aes-priv.h"
-
-#include <assert.h>
-
-
-#define FULL_UNROLL (true)
-
-# define GETU32(pt) (((uint32_t)(pt)[0] << 24) ^ ((uint32_t)(pt)[1] << 16) ^ ((uint32_t)(pt)[2] <<  8) ^ ((uint32_t)(pt)[3]))
-# define PUTU32(ct, st) (((ct)[0] = (uint8_t)((st) >> 24)), ((ct)[1] = (uint8_t)((st) >> 16)),((ct)[2] = (uint8_t)((st) >>  8)),((ct)[3] = (uint8_t)(st)))
-
-/*
-Te0[x] = S [x].[02, 01, 01, 03];
-Te1[x] = S [x].[03, 02, 01, 01];
-Te2[x] = S [x].[01, 03, 02, 01];
-Te3[x] = S [x].[01, 01, 03, 02];
-
-Td0[x] = Si[x].[0e, 09, 0d, 0b];
-Td1[x] = Si[x].[0b, 0e, 09, 0d];
-Td2[x] = Si[x].[0d, 0b, 0e, 09];
-Td3[x] = Si[x].[09, 0d, 0b, 0e];
-Td4[x] = Si[x].[01];
-*/
-
-static const uint32_t Te0[256] = {
-    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
-    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
-    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
-    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
-    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
-    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
-    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
-    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
-    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
-    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
-    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
-    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
-    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
-    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
-    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
-    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
-    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
-    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
-    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
-    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
-    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
-    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
-    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
-    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
-    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
-    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
-    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
-    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
-    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
-    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
-    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
-    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
-    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
-    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
-    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
-    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
-    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
-    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
-    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
-    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
-    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
-    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
-    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
-    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
-    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
-    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
-    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
-    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
-    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
-    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
-    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
-    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
-    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
-    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
-    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
-    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
-    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
-    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
-    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
-    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
-    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
-    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
-    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
-    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
-};
-static const uint32_t Te1[256] = {
-    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
-    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
-    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
-    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
-    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
-    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
-    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
-    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
-    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
-    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
-    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
-    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
-    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
-    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
-    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
-    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
-    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
-    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
-    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
-    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
-    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
-    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
-    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
-    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
-    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
-    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
-    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
-    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
-    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
-    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
-    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
-    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
-    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
-    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
-    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
-    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
-    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
-    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
-    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
-    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
-    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
-    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
-    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
-    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
-    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
-    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
-    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
-    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
-    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
-    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
-    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
-    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
-    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
-    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
-    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
-    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
-    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
-    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
-    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
-    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
-    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
-    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
-    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
-    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
-};
-static const uint32_t Te2[256] = {
-    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
-    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
-    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
-    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
-    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
-    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
-    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
-    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
-    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
-    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
-    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
-    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
-    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
-    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
-    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
-    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
-    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
-    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
-    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
-    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
-    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
-    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
-    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
-    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
-    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
-    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
-    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
-    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
-    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
-    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
-    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
-    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
-    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
-    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
-    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
-    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
-    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
-    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
-    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
-    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
-    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
-    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
-    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
-    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
-    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
-    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
-    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
-    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
-    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
-    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
-    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
-    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
-    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
-    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
-    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
-    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
-    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
-    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
-    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
-    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
-    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
-    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
-    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
-    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
-};
-static const uint32_t Te3[256] = {
-    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
-    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
-    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
-    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
-    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
-    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
-    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
-    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
-    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
-    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
-    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
-    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
-    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
-    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
-    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
-    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
-    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
-    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
-    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
-    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
-    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
-    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
-    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
-    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
-    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
-    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
-    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
-    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
-    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
-    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
-    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
-    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
-    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
-    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
-    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
-    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
-    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
-    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
-    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
-    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
-    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
-    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
-    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
-    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
-    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
-    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
-    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
-    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
-    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
-    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
-    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
-    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
-    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
-    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
-    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
-    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
-    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
-    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
-    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
-    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
-    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
-    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
-    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
-    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
-};
-
-static const uint32_t Td0[256] = {
-    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
-    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
-    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
-    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
-    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
-    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
-    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
-    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
-    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
-    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
-    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
-    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
-    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
-    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
-    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
-    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
-    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
-    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
-    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
-    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
-    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
-    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
-    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
-    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
-    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
-    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
-    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
-    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
-    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
-    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
-    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
-    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
-    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
-    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
-    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
-    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
-    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
-    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
-    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
-    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
-    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
-    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
-    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
-    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
-    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
-    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
-    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
-    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
-    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
-    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
-    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
-    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
-    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
-    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
-    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
-    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
-    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
-    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
-    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
-    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
-    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
-    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
-    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
-    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
-};
-static const uint32_t Td1[256] = {
-    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
-    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
-    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
-    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
-    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
-    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
-    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
-    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
-    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
-    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
-    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
-    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
-    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
-    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
-    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
-    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
-    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
-    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
-    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
-    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
-    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
-    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
-    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
-    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
-    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
-    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
-    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
-    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
-    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
-    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
-    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
-    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
-    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
-    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
-    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
-    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
-    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
-    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
-    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
-    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
-    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
-    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
-    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
-    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
-    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
-    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
-    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
-    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
-    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
-    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
-    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
-    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
-    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
-    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
-    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
-    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
-    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
-    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
-    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
-    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
-    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
-    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
-    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
-    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
-};
-static const uint32_t Td2[256] = {
-    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
-    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
-    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
-    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
-    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
-    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
-    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
-    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
-    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
-    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
-    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
-    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
-    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
-    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
-    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
-    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
-    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
-    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
-    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
-    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
-    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
-    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
-    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
-    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
-    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
-    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
-    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
-    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
-    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
-    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
-    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
-    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
-    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
-    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
-    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
-    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
-    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
-    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
-    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
-    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
-    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
-    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
-    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
-    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
-    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
-    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
-    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
-    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
-    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
-    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
-    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
-    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
-    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
-    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
-    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
-    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
-    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
-    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
-    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
-    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
-    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
-    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
-    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
-    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
-};
-static const uint32_t Td3[256] = {
-    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
-    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
-    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
-    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
-    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
-    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
-    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
-    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
-    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
-    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
-    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
-    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
-    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
-    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
-    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
-    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
-    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
-    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
-    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
-    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
-    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
-    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
-    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
-    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
-    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
-    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
-    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
-    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
-    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
-    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
-    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
-    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
-    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
-    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
-    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
-    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
-    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
-    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
-    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
-    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
-    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
-    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
-    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
-    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
-    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
-    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
-    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
-    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
-    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
-    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
-    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
-    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
-    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
-    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
-    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
-    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
-    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
-    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
-    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
-    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
-    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
-    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
-    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
-    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
-};
-static const uint8_t Td4[256] = {
-    0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
-    0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
-    0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
-    0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
-    0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
-    0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
-    0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
-    0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
-    0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
-    0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
-    0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
-    0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
-    0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
-    0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
-    0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
-    0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
-    0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
-    0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
-    0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
-    0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
-    0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
-    0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
-    0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
-    0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
-    0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
-    0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
-    0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
-    0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
-    0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
-    0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
-    0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
-    0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
-};
-static const uint32_t rcon[] = {
-	0x01000000, 0x02000000, 0x04000000, 0x08000000,
-	0x10000000, 0x20000000, 0x40000000, 0x80000000,
-	0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
-};
-
-/**
- * Expand the cipher key into the encryption key schedule.
- */
-int AES_set_encrypt_key(const uint8_t *userKey, const uint32_t bits,
-			AES_KEY *key) {
-
-	uint32_t *rk;
-   	int i = 0;
-	uint32_t temp;
-
-	if (!userKey || !key)
-		return -1;
-	if (bits != 128 && bits != 192 && bits != 256)
-		return -2;
-
-	rk = key->rd_key;
-
-	if (bits==128)
-		key->rounds = 10;
-	else if (bits==192)
-		key->rounds = 12;
-	else
-		key->rounds = 14;
-
-	rk[0] = GETU32(userKey     );
-	rk[1] = GETU32(userKey +  4);
-	rk[2] = GETU32(userKey +  8);
-	rk[3] = GETU32(userKey + 12);
-	if (bits == 128) {
-		while (1) {
-			temp  = rk[3];
-			rk[4] = rk[0] ^
-				(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
-				(Te3[(temp >>  8) & 0xff] & 0x00ff0000) ^
-				(Te0[(temp      ) & 0xff] & 0x0000ff00) ^
-				(Te1[(temp >> 24)       ] & 0x000000ff) ^
-				rcon[i];
-			rk[5] = rk[1] ^ rk[4];
-			rk[6] = rk[2] ^ rk[5];
-			rk[7] = rk[3] ^ rk[6];
-			if (++i == 10) {
-				return 0;
-			}
-			rk += 4;
-		}
-	}
-	rk[4] = GETU32(userKey + 16);
-	rk[5] = GETU32(userKey + 20);
-	if (bits == 192) {
-		while (1) {
-			temp = rk[ 5];
-			rk[ 6] = rk[ 0] ^
-				(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
-				(Te3[(temp >>  8) & 0xff] & 0x00ff0000) ^
-				(Te0[(temp      ) & 0xff] & 0x0000ff00) ^
-				(Te1[(temp >> 24)       ] & 0x000000ff) ^
-				rcon[i];
-			rk[ 7] = rk[ 1] ^ rk[ 6];
-			rk[ 8] = rk[ 2] ^ rk[ 7];
-			rk[ 9] = rk[ 3] ^ rk[ 8];
-			if (++i == 8) {
-				return 0;
-			}
-			rk[10] = rk[ 4] ^ rk[ 9];
-			rk[11] = rk[ 5] ^ rk[10];
-			rk += 6;
-		}
-	}
-	rk[6] = GETU32(userKey + 24);
-	rk[7] = GETU32(userKey + 28);
-	if (bits == 256) {
-		while (1) {
-			temp = rk[ 7];
-			rk[ 8] = rk[ 0] ^
-				(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
-				(Te3[(temp >>  8) & 0xff] & 0x00ff0000) ^
-				(Te0[(temp      ) & 0xff] & 0x0000ff00) ^
-				(Te1[(temp >> 24)       ] & 0x000000ff) ^
-				rcon[i];
-			rk[ 9] = rk[ 1] ^ rk[ 8];
-			rk[10] = rk[ 2] ^ rk[ 9];
-			rk[11] = rk[ 3] ^ rk[10];
-			if (++i == 7) {
-				return 0;
-			}
-			temp = rk[11];
-			rk[12] = rk[ 4] ^
-				(Te2[(temp >> 24)       ] & 0xff000000) ^
-				(Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^
-				(Te0[(temp >>  8) & 0xff] & 0x0000ff00) ^
-				(Te1[(temp      ) & 0xff] & 0x000000ff);
-			rk[13] = rk[ 5] ^ rk[12];
-			rk[14] = rk[ 6] ^ rk[13];
-			rk[15] = rk[ 7] ^ rk[14];
-
-			rk += 8;
-        	}
-	}
-	return 0;
-}
-
-/**
- * Expand the cipher key into the decryption key schedule.
- */
-int AES_set_decrypt_key(const uint8_t *userKey, const uint32_t bits,
-                        AES_KEY *key) {
-
-        uint32_t *rk;
-	int i, j, status;
-	uint32_t temp;
-
-	/* first, start with an encryption schedule */
-	status = AES_set_encrypt_key(userKey, bits, key);
-	if (status < 0)
-		return status;
-
-	rk = key->rd_key;
-
-	/* invert the order of the round keys: */
-	for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
-		temp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;
-		temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
-		temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
-		temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
-	}
-	/* apply the inverse MixColumn transform to all round keys but the first and the last: */
-	for (i = 1; i < (key->rounds); i++) {
-		rk += 4;
-		rk[0] =
-			Td0[Te1[(rk[0] >> 24)       ] & 0xff] ^
-			Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^
-			Td2[Te1[(rk[0] >>  8) & 0xff] & 0xff] ^
-			Td3[Te1[(rk[0]      ) & 0xff] & 0xff];
-		rk[1] =
-			Td0[Te1[(rk[1] >> 24)       ] & 0xff] ^
-			Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^
-			Td2[Te1[(rk[1] >>  8) & 0xff] & 0xff] ^
-			Td3[Te1[(rk[1]      ) & 0xff] & 0xff];
-		rk[2] =
-			Td0[Te1[(rk[2] >> 24)       ] & 0xff] ^
-			Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^
-			Td2[Te1[(rk[2] >>  8) & 0xff] & 0xff] ^
-			Td3[Te1[(rk[2]      ) & 0xff] & 0xff];
-		rk[3] =
-			Td0[Te1[(rk[3] >> 24)       ] & 0xff] ^
-			Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^
-			Td2[Te1[(rk[3] >>  8) & 0xff] & 0xff] ^
-			Td3[Te1[(rk[3]      ) & 0xff] & 0xff];
-	}
-	return 0;
-}
-
-/*
- * Encrypt a single block
- * in and out can overlap
- */
-void AES_encrypt(const uint8_t *in, uint8_t *out,
-		 const AES_KEY *key) {
-
-	const uint32_t *rk;
-	uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
-#ifndef FULL_UNROLL
-	int r;
-#endif /* ?FULL_UNROLL */
-
-	assert(in && out && key);
-	rk = key->rd_key;
-
-	/*
-	 * map byte array block to cipher state
-	 * and add initial round key:
-	 */
-	s0 = GETU32(in     ) ^ rk[0];
-	s1 = GETU32(in +  4) ^ rk[1];
-	s2 = GETU32(in +  8) ^ rk[2];
-	s3 = GETU32(in + 12) ^ rk[3];
-#ifdef FULL_UNROLL
-	/* round 1: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];
-   	/* round 2: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
-	/* round 3: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
-   	/* round 4: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
-	/* round 5: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
-   	/* round 6: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
-	/* round 7: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
-   	/* round 8: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
-	/* round 9: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
-    if (key->rounds > 10) {
-        /* round 10: */
-        s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
-        s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
-        s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
-        s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
-        /* round 11: */
-        t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
-        t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
-        t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
-        t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
-        if (key->rounds > 12) {
-            /* round 12: */
-            s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
-            s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
-            s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
-            s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
-            /* round 13: */
-            t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
-            t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
-            t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
-            t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
-        }
-    }
-    rk += key->rounds << 2;
-#else  /* !FULL_UNROLL */
-    /*
-     * Nr - 1 full rounds:
-     */
-    r = key->rounds >> 1;
-    for (;;) {
-        t0 =
-            Te0[(s0 >> 24)       ] ^
-            Te1[(s1 >> 16) & 0xff] ^
-            Te2[(s2 >>  8) & 0xff] ^
-            Te3[(s3      ) & 0xff] ^
-            rk[4];
-        t1 =
-            Te0[(s1 >> 24)       ] ^
-            Te1[(s2 >> 16) & 0xff] ^
-            Te2[(s3 >>  8) & 0xff] ^
-            Te3[(s0      ) & 0xff] ^
-            rk[5];
-        t2 =
-            Te0[(s2 >> 24)       ] ^
-            Te1[(s3 >> 16) & 0xff] ^
-            Te2[(s0 >>  8) & 0xff] ^
-            Te3[(s1      ) & 0xff] ^
-            rk[6];
-        t3 =
-            Te0[(s3 >> 24)       ] ^
-            Te1[(s0 >> 16) & 0xff] ^
-            Te2[(s1 >>  8) & 0xff] ^
-            Te3[(s2      ) & 0xff] ^
-            rk[7];
-
-        rk += 8;
-        if (--r == 0) {
-            break;
-        }
-
-        s0 =
-            Te0[(t0 >> 24)       ] ^
-            Te1[(t1 >> 16) & 0xff] ^
-            Te2[(t2 >>  8) & 0xff] ^
-            Te3[(t3      ) & 0xff] ^
-            rk[0];
-        s1 =
-            Te0[(t1 >> 24)       ] ^
-            Te1[(t2 >> 16) & 0xff] ^
-            Te2[(t3 >>  8) & 0xff] ^
-            Te3[(t0      ) & 0xff] ^
-            rk[1];
-        s2 =
-            Te0[(t2 >> 24)       ] ^
-            Te1[(t3 >> 16) & 0xff] ^
-            Te2[(t0 >>  8) & 0xff] ^
-            Te3[(t1      ) & 0xff] ^
-            rk[2];
-        s3 =
-            Te0[(t3 >> 24)       ] ^
-            Te1[(t0 >> 16) & 0xff] ^
-            Te2[(t1 >>  8) & 0xff] ^
-            Te3[(t2      ) & 0xff] ^
-            rk[3];
-    }
-#endif /* ?FULL_UNROLL */
-    /*
-	 * apply last round and
-	 * map cipher state to byte array block:
-	 */
-	s0 =
-		(Te2[(t0 >> 24)       ] & 0xff000000) ^
-		(Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te0[(t2 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te1[(t3      ) & 0xff] & 0x000000ff) ^
-		rk[0];
-	PUTU32(out     , s0);
-	s1 =
-		(Te2[(t1 >> 24)       ] & 0xff000000) ^
-		(Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te0[(t3 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te1[(t0      ) & 0xff] & 0x000000ff) ^
-		rk[1];
-	PUTU32(out +  4, s1);
-	s2 =
-		(Te2[(t2 >> 24)       ] & 0xff000000) ^
-		(Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te0[(t0 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te1[(t1      ) & 0xff] & 0x000000ff) ^
-		rk[2];
-	PUTU32(out +  8, s2);
-	s3 =
-		(Te2[(t3 >> 24)       ] & 0xff000000) ^
-		(Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te0[(t1 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te1[(t2      ) & 0xff] & 0x000000ff) ^
-		rk[3];
-	PUTU32(out + 12, s3);
-}
-
-/*
- * Decrypt a single block
- * in and out can overlap
- */
-void AES_decrypt(const uint8_t *in, uint8_t *out,
-		 const AES_KEY *key) {
-
-	const uint32_t *rk;
-	uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
-#ifndef FULL_UNROLL
-	int r;
-#endif /* ?FULL_UNROLL */
-
-	assert(in && out && key);
-	rk = key->rd_key;
-
-	/*
-	 * map byte array block to cipher state
-	 * and add initial round key:
-	 */
-    s0 = GETU32(in     ) ^ rk[0];
-    s1 = GETU32(in +  4) ^ rk[1];
-    s2 = GETU32(in +  8) ^ rk[2];
-    s3 = GETU32(in + 12) ^ rk[3];
-#ifdef FULL_UNROLL
-    /* round 1: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];
-    /* round 2: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
-    /* round 3: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
-    /* round 4: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
-    /* round 5: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
-    /* round 6: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
-    /* round 7: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
-    /* round 8: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
-    /* round 9: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
-    if (key->rounds > 10) {
-        /* round 10: */
-        s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
-        s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
-        s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
-        s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
-        /* round 11: */
-        t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
-        t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
-        t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
-        t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
-        if (key->rounds > 12) {
-            /* round 12: */
-            s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
-            s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
-            s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
-            s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
-            /* round 13: */
-            t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
-            t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
-            t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
-            t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
-        }
-    }
-	rk += key->rounds << 2;
-#else  /* !FULL_UNROLL */
-    /*
-     * Nr - 1 full rounds:
-     */
-    r = key->rounds >> 1;
-    for (;;) {
-        t0 =
-            Td0[(s0 >> 24)       ] ^
-            Td1[(s3 >> 16) & 0xff] ^
-            Td2[(s2 >>  8) & 0xff] ^
-            Td3[(s1      ) & 0xff] ^
-            rk[4];
-        t1 =
-            Td0[(s1 >> 24)       ] ^
-            Td1[(s0 >> 16) & 0xff] ^
-            Td2[(s3 >>  8) & 0xff] ^
-            Td3[(s2      ) & 0xff] ^
-            rk[5];
-        t2 =
-            Td0[(s2 >> 24)       ] ^
-            Td1[(s1 >> 16) & 0xff] ^
-            Td2[(s0 >>  8) & 0xff] ^
-            Td3[(s3      ) & 0xff] ^
-            rk[6];
-        t3 =
-            Td0[(s3 >> 24)       ] ^
-            Td1[(s2 >> 16) & 0xff] ^
-            Td2[(s1 >>  8) & 0xff] ^
-            Td3[(s0      ) & 0xff] ^
-            rk[7];
-
-        rk += 8;
-        if (--r == 0) {
-            break;
-        }
-
-        s0 =
-            Td0[(t0 >> 24)       ] ^
-            Td1[(t3 >> 16) & 0xff] ^
-            Td2[(t2 >>  8) & 0xff] ^
-            Td3[(t1      ) & 0xff] ^
-            rk[0];
-        s1 =
-            Td0[(t1 >> 24)       ] ^
-            Td1[(t0 >> 16) & 0xff] ^
-            Td2[(t3 >>  8) & 0xff] ^
-            Td3[(t2      ) & 0xff] ^
-            rk[1];
-        s2 =
-            Td0[(t2 >> 24)       ] ^
-            Td1[(t1 >> 16) & 0xff] ^
-            Td2[(t0 >>  8) & 0xff] ^
-            Td3[(t3      ) & 0xff] ^
-            rk[2];
-        s3 =
-            Td0[(t3 >> 24)       ] ^
-            Td1[(t2 >> 16) & 0xff] ^
-            Td2[(t1 >>  8) & 0xff] ^
-            Td3[(t0      ) & 0xff] ^
-            rk[3];
-    }
-#endif /* ?FULL_UNROLL */
-    /*
-	 * apply last round and
-	 * map cipher state to byte array block:
-	 */
-   	s0 =
-   		(Td4[(t0 >> 24)       ] << 24) ^
-   		(Td4[(t3 >> 16) & 0xff] << 16) ^
-   		(Td4[(t2 >>  8) & 0xff] <<  8) ^
-   		(Td4[(t1      ) & 0xff])       ^
-   		rk[0];
-	PUTU32(out     , s0);
-   	s1 =
-   		(Td4[(t1 >> 24)       ] << 24) ^
-   		(Td4[(t0 >> 16) & 0xff] << 16) ^
-   		(Td4[(t3 >>  8) & 0xff] <<  8) ^
-   		(Td4[(t2      ) & 0xff])       ^
-   		rk[1];
-	PUTU32(out +  4, s1);
-   	s2 =
-   		(Td4[(t2 >> 24)       ] << 24) ^
-   		(Td4[(t1 >> 16) & 0xff] << 16) ^
-   		(Td4[(t0 >>  8) & 0xff] <<  8) ^
-   		(Td4[(t3      ) & 0xff])       ^
-   		rk[2];
-	PUTU32(out +  8, s2);
-   	s3 =
-   		(Td4[(t3 >> 24)       ] << 24) ^
-   		(Td4[(t2 >> 16) & 0xff] << 16) ^
-   		(Td4[(t1 >>  8) & 0xff] <<  8) ^
-   		(Td4[(t0      ) & 0xff])       ^
-   		rk[3];
-	PUTU32(out + 12, s3);
-}
-
diff --git a/libs/krypto/blockcipher-impl.h b/libs/krypto/blockcipher-impl.h
deleted file mode 100644
index 5d7d257..0000000
--- a/libs/krypto/blockcipher-impl.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_krypto_blockcipher_impl_
-#define _h_krypto_blockcipher_impl_
-
-/* 
- * NOTE:  Currently this is being written to support cipher blocks of
- * exactly 128 bits.  It will have to be amended if alternative block
- * sizes are need for other cipher blocks
- */
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-/*
- * we need to know whether we are supporting vectors as 
- * XMM type registers or as structs
- */
-#include "ncbi-priv.h"
-
-
-#ifndef USE_VEC
-#error "USE_VEC most be defined true or false"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CIPHER_BLOCK_MAX (16)
-
-typedef char CipherBlock [CIPHER_BLOCK_MAX];
-
-#if USEVEC
-#include <v128.h>
-typedef v128_u8_t CipherVec;
-#else
-typedef struct CipherVec
-{
-    CipherBlock block;
-} CipherVec;
-#endif
-
-typedef struct KBlockCipher_vt KBlockCipher_vt;
-struct KBlockCipher_vt
-{
-    uint32_t maj;
-    uint32_t min;
-};
-
-typedef uint32_t BlockCipherType;
-enum block_cipher_type
-{
-    blockcipher_type_byte,
-    blockcipher_type_vec
-};
-
-
-typedef struct KBlockCipherByte_vt_v1 KBlockCipherByte_vt_v1;
-typedef union KBlockCipherByte KBlockCipherByte;
-
-#ifndef BLOCKCIPHER_BYTE_IMPL
-#define BLOCKCIPHER_BYTE_IMPL KBlockCipherByte
-#else
-typedef union KBlockCipherByte BLOCKCIPHER_BYTE_IMPL;
-#endif
-
-
-struct KBlockCipherByte_vt_v1
-{
-    KBlockCipher_vt version;
-
-    /* version == 1.x */
-
-    /* start minor version == 0 */
-    void        (* destroy         )(const BLOCKCIPHER_BYTE_IMPL * self);
-
-    uint32_t    (* block_size      )();
-
-    uint32_t    (* key_size        )();
-
-    rc_t        (* set_encrypt_key )(void * encrypt_key,
-                                     const char * user_key,
-                                     uint32_t user_key_bits);
-
-    rc_t        (* set_decrypt_key )(void * decrypt_key,
-                                     const char * user_key,
-                                     uint32_t user_key_bits);
-
-    void        (* encrypt         )(const CipherBlock in,
-                                     CipherBlock out,
-                                     const void * encrypt_key);
-
-    void        (* decrypt         )(const CipherBlock in,
-                                     CipherBlock out,
-                                     const void * encrypt_key);
-
-    /* end minor version == 0 */
-
-};
-
-union KBlockCipherByte
-{
-    KBlockCipher_vt        version;
-    KBlockCipherByte_vt_v1 v1;
-};
-
-
-typedef struct KBlockCipherVec_vt_v1 KBlockCipherVec_vt_v1;
-typedef union KBlockCipherVec KBlockCipherVec;
-
-#ifndef BLOCKCIPHER_VEC_IMPL
-#define BLOCKCIPHER_VEC_IMPL KBlockCipherVec
-#else
-typedef union KBlockCipherVec BLOCKCIPHER_VEC_IMPL;
-#endif
-
-
-struct KBlockCipherVec_vt_v1
-{
-    KBlockCipher_vt version;
-
-    /* version == 1.x */
-
-    /* start minor version == 0 */
-    void        (* destroy         )(const BLOCKCIPHER_VEC_IMPL * self);
-
-    uint32_t    (* block_size      )();
-
-    uint32_t    (* key_size        )();
-
-    rc_t        (* set_encrypt_key )(void * encrypt_key,
-                                     const char * user_key,
-                                     uint32_t user_key_size);
-
-    rc_t        (* set_decrypt_key )(void * decrypt_key,
-                                     const char * user_key,
-                                     uint32_t user_key_size);
-
-    CipherVec   (* encrypt         )(CipherVec block,
-                                     const void * encrypt_key);
-
-    CipherVec   (* decrypt         )(CipherVec block,
-                                     const void * decrypt_key);
-
-    /* end minor version == 0 */
-
-};
-
-union KBlockCipherVec
-{
-    KBlockCipher_vt       version;
-    KBlockCipherVec_vt_v1 v1;
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#endif /* _h_krypto_blockcipher_impl_ */
-
diff --git a/libs/krypto/blockcipher-priv.h b/libs/krypto/blockcipher-priv.h
deleted file mode 100644
index d812f23..0000000
--- a/libs/krypto/blockcipher-priv.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_blockcipher_priv_
-#define _h_krypto_blockcipher_priv_
-
-#include <krypto/extern.h>
-#include "cipher-impl.h"
-
-#include "blockcipher-impl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ======================================================================
- */
-/* typedef struct KBlockCipher KBlockCipher; */
-/*     typedef union KBlockCipher_vt KBlockCipher_vt; */
-
-/* ----------------------------------------------------------------------
- * Init
- *
- *   Initialize the fields of this object.  The derived class will call this
- *   during it's initialization.
- *
- * self      object to initialze
- * vt        the virtual table of the derived class
- * mgr       the cipher manager that is the construction factory block cipher
- *           objects hold references to the manager while the manager merely
- *           points at the block ciphers when all block ciphers are destroyed
- *           the manager loses its references and it too can be destroyed if not
- *           held elsewhere
- * name      ASCIZ c-string the name of this class
- */
-/* rc_t KBlockCipherInit (KBlockCipher * self, */
-/*                        const KBlockCipher_vt * vt, */
-/*                        const char * name); */
-
-
-typedef union KBlockCipher KBlockCipher;
-union KBlockCipher
-{
-    KBlockCipherByte byte;
-    KBlockCipherVec  vec;
-};
-
-
-rc_t KAESBlockCipherVecAesNiMake  (KBlockCipher ** vec_cipher);
-rc_t KAESBlockCipherVecRegMake    (KBlockCipher ** vec_cipher);
-rc_t KAESBlockCipherVecMake       (KBlockCipher ** vec_cipher);
-rc_t KAESBlockCipherByteMake      (KBlockCipher ** byte_cipher);
-
-rc_t KNullBlockCipherVecAesNiMake (KBlockCipher ** vec_cipher);
-rc_t KNullBlockCipherVecRegMake   (KBlockCipher ** vec_cipher);
-rc_t KNullBlockCipherVecMake      (KBlockCipher ** vec_cipher);
-rc_t KNullBlockCipherByteMake     (KBlockCipher ** byte_cipher);
-
-
-/* KRYPTO_EXTERN rc_t CC KBlockCipherAlloc (KBlockCipher ** obj, size_t z); */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_blockcipher_priv_ */
diff --git a/libs/krypto/blockcipher.c b/libs/krypto/blockcipher.c
deleted file mode 100644
index 22539eb..0000000
--- a/libs/krypto/blockcipher.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#error "OBSOLETE do not use"
-
-
diff --git a/libs/krypto/cipher-byte.c b/libs/krypto/cipher-byte.c
deleted file mode 100644
index feb05c2..0000000
--- a/libs/krypto/cipher-byte.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-/*
- * KCipherByte is a byte oriented KCipher that can work on all processors
- * and be built with all compilers
- */
-#include <krypto/extern.h>
-#include <klib/defs.h>
-#include <krypto/cipher.h>
-
-#include "ncbi-priv.h"
-
-#include "blockcipher-impl.h"
-
-#include "cipher-impl.h"
-#include "cipher-priv.h"
-#include "blockcipher-priv.h"
-
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-const char MEMBER(ClassName)[] = CLASS_STRING(CIPHER_IMPL);
-
-/* 
- * KCipher with unaligned data.  Byte alignment.
- */
-struct KCipherByte
-{
-    KCipher dad;
-
-    const KBlockCipherByte * block_cipher;
-};
-
-
-static rc_t MEMBER(Destroy) (KCipherByte * self)
-{
-    rc_t rc = 0;
-
-    if (self)
-    {
-        rc =  KCipherDestroy (&self->dad);
-        free (self);
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(SetEncryptKey) (KCipherByte * self,
-                                   const char * user_key,
-                                   uint32_t user_key_bits)
-{
-    rc_t rc = 0;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcUpdating, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        rc = self->block_cipher->v1.set_encrypt_key (self->dad.encrypt_key, user_key,
-                                                     user_key_bits);
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(SetDecryptKey) (KCipherByte * self,
-                                   const char * user_key,
-                                   uint32_t user_key_bits)
-{
-    rc_t rc = 0;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcDestroying, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        rc = self->block_cipher->v1.set_decrypt_key (self->dad.decrypt_key, user_key,
-                                                     user_key_bits);
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(SetEncryptIvec)(KCipherByte * self,
-                                   const void * ivec)
-{
-    assert (self);
-    assert (ivec);
-
-    memcpy (self->dad.encrypt_ivec, ivec, self->dad.block_size);
-
-    return 0;
-}
-
-
-static rc_t MEMBER(SetDecryptIvec)(KCipherByte * self,
-                                   const void * ivec)
-{
-    assert (self);
-    assert (ivec);
-
-    memcpy (self->dad.decrypt_ivec, ivec, self->dad.block_size);
-
-    return 0;
-}
-
-
-static rc_t MEMBER(SetEncryptCounterFunc)(KCipherByte * self,
-                                          cipher_ctr_func func)
-{
-    assert (self);
-    assert (func);
-
-    self->dad.encrypt_counter_func = func;
-
-    return 0;
-}
-
-
-static rc_t MEMBER(SetDecryptCounterFunc)(KCipherByte * self,
-                                          cipher_ctr_func func)
-{
-    assert (self);
-    assert (func);
-
-    self->dad.decrypt_counter_func = func;
-
-    return 0;
-}
-
-
-static rc_t MEMBER(Encrypt)(const KCipherByte * self,
-                            const void * in, void * out)
-{
-    rc_t rc = 0;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        self->block_cipher->v1.encrypt (in, out, self->dad.encrypt_key);
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(Decrypt)(const KCipherByte * self,
-                            const void * in, void * out)
-{
-    rc_t rc = 0;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        self->block_cipher->v1.decrypt (in, out, self->dad.decrypt_key);
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(EncryptEcb)(const KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    rc_t rc = 0;
-    const char * pin = in;
-    char * pout = out;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        for (; block_count; --block_count)
-        {
-            self->block_cipher->v1.encrypt (pin, pout, self->dad.encrypt_key);
-
-            pin += self->dad.block_size;
-            pout += self->dad.block_size;
-        }
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(DecryptEcb)(const KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    rc_t rc = 0;
-    const char * pin = in;
-    char * pout = out;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        for (; block_count; --block_count)
-        {
-            self->block_cipher->v1.decrypt (pin, pout, self->dad.decrypt_key);
-
-            pin += self->dad.block_size;
-            pout += self->dad.block_size;
-        }
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(EncryptCbc)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    rc_t rc = 0;
-    const char * pin = in;
-    char * pout = out;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        if (block_count)
-        {
-            CipherBlock block;
-            unsigned ix;
-
-            memcpy (block, self->dad.encrypt_ivec, self->dad.block_size);
-
-            do
-            {
-                for (ix = 0; ix < self->dad.block_size; ++ix)
-                    block[ix] ^= pin[ix];
-
-                self->block_cipher->v1.encrypt (block, block,
-                                                self->dad.encrypt_key);
-
-                memcpy (pout, block, self->dad.block_size);
-
-                pin += self->dad.block_size;
-                pout += self->dad.block_size;
-
-            } while (--block_count);
-
-            memcpy (self->dad.encrypt_ivec, block, self->dad.block_size);
-        }
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(DecryptCbc)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    rc_t rc = 0;
-    const char * pin = in;
-    char * pout = out;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        if (block_count)
-        {
-            CipherBlock ivec;
-            CipherBlock block;
-            unsigned ix;
-
-            memcpy (ivec, self->dad.decrypt_ivec, self->dad.block_size);
-
-            do
-            {
-                self->block_cipher->v1.decrypt (pin, block,
-                                                self->dad.decrypt_key);
-
-                for (ix = 0; ix < self->dad.block_size; ++ix)
-                    pout[ix] = block[ix] ^ ivec[ix];
-
-                memcpy (ivec, pin, self->dad.block_size); 
-
-                pin += self->dad.block_size;
-                pout += self->dad.block_size;
-
-            } while (--block_count);
-
-            memcpy (self->dad.decrypt_ivec, ivec, self->dad.block_size);
-        }
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t MEMBER(EncryptPcbc)(KCipherByte * self,
-                                const void * in, void * out,
-                                uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(DecryptPcbc)(KCipherByte * self,
-                                const void * in, void * out,
-                                uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(EncryptCfb)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(DecryptCfb)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(EncryptOfb)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(DecryptOfb)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(EncryptCtr)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static rc_t MEMBER(DecryptCtr)(KCipherByte * self,
-                               const void * in, void * out,
-                               uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static struct KCipher_vt_v1 MEMBER(_vt_v1) =
-{
-    { 1, 0 },
-
-    MEMBER(Destroy),
-    MEMBER(SetEncryptKey),
-    MEMBER(SetDecryptKey),
-    MEMBER(SetEncryptIvec),
-    MEMBER(SetDecryptIvec),
-    MEMBER(SetEncryptCounterFunc),
-    MEMBER(SetDecryptCounterFunc),
-    MEMBER(Encrypt),
-    MEMBER(Decrypt),
-    MEMBER(EncryptEcb),
-    MEMBER(DecryptEcb),
-    MEMBER(EncryptCbc),
-    MEMBER(DecryptCbc),
-    MEMBER(EncryptPcbc),
-    MEMBER(DecryptPcbc),
-    MEMBER(EncryptCfb),
-    MEMBER(DecryptCfb),
-    MEMBER(EncryptOfb),
-    MEMBER(DecryptOfb),
-    MEMBER(EncryptCtr),
-    MEMBER(DecryptCtr)
-};
-
-
-static __inline__ rc_t MEMBER(Alloc)(KCipherByte ** pobj,
-                                     const KBlockCipher * block_cipher)
-{
-    size_t block_size = block_cipher->byte.v1.block_size();
-    size_t key_size = block_cipher->byte.v1.key_size();
-    rc_t rc = 0;
-
-    *pobj = calloc (1, sizeof (**pobj) + 2 * key_size + 2 * block_size);
-    if (*pobj == NULL)
-        rc = RC (rcKrypto, rcCipher, rcConstructing, rcMemory, rcExhausted);
-
-    return rc;
-}
-
-
-static __inline__ rc_t MEMBER(Init)(KCipherByte * self,
-                                    const KBlockCipher * block_cipher)
-{
-    KCipher * dad = &self->dad;
-    size_t block_size = block_cipher->byte.v1.block_size();
-    size_t key_size = block_cipher->byte.v1.key_size();
-
-    KCipherInit (dad, block_size,
-                 (const KCipher_vt*)&MEMBER(_vt_v1),
-                 MEMBER(ClassName));
-
-    dad->encrypt_key = (uint8_t *)(self + 1);
-    dad->decrypt_key = ((uint8_t *)dad->encrypt_key) + key_size;
-    dad->encrypt_ivec = ((uint8_t *)dad->decrypt_key) + key_size;
-    dad->decrypt_ivec = ((uint8_t *)dad->encrypt_ivec) + block_size;
-
-    self->block_cipher = &block_cipher->byte;
-
-    return 0;
-}
-
-
-rc_t MEMBER(Make) (KCipher ** new_obj, kcipher_type type)
-{
-    rc_t rc;
-    KBlockCipher * block_cipher;
-
-    if (new_obj == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    *new_obj = NULL;
-
-    switch (type)
-    {
-    default:
-        return RC (rcKrypto, rcCipher, rcConstructing, rcParam, rcInvalid);
-
-    case kcipher_null:
-        rc = NULLBCMEMBER(Make)(&block_cipher);
-        break;
-
-    case kcipher_AES:
-        rc = AESBCMEMBER(Make)(&block_cipher);
-        break;
-    }
-
-    if (rc == 0)
-    {
-        KCipherByte * obj;
-
-        rc = MEMBER(Alloc)(&obj, block_cipher);
-        if (rc == 0)
-        {
-            rc = MEMBER(Init)(obj, block_cipher);
-            if (rc == 0)
-                *new_obj = &obj->dad;
-            else
-                free (obj);
-        }
-    }
-    return rc;
-}
-
-/* EOF */
diff --git a/libs/krypto/cipher-impl.h b/libs/krypto/cipher-impl.h
deleted file mode 100644
index fbccdb5..0000000
--- a/libs/krypto/cipher-impl.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_krypto_cipher_impl_
-#define _h_krypto_cipher_impl_
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-#include <klib/refcount.h>
-#include <krypto/cipher.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifndef CIPHER_IMPL
-#define CIPHER_IMPL KCipher
-#else
-struct CIPHER_IMPL;
-typedef struct CIPHER_IMPL CIPHER_IMPL;
-#endif
-
-typedef struct KCipher_vt KCipher_vt;
-struct KCipher_vt
-{
-    uint32_t maj;
-    uint32_t min;
-};
-
-
-typedef struct KCipher_vt_v1 KCipher_vt_v1;
-struct KCipher_vt_v1
-{
-    KCipher_vt version;
-
-    /* version == 1.x */
-    /* start minor version == 0 */
-    rc_t ( CC * destroy             )(CIPHER_IMPL * self);
-
-    rc_t ( CC * set_encrypt_key     )(CIPHER_IMPL * self,
-                                      const char * user_key,
-                                      uint32_t user_key_bits);
-
-    rc_t ( CC * set_decrypt_key     )(CIPHER_IMPL * self,
-                                      const char * user_key,
-                                      uint32_t user_key_bits);
-
-    rc_t ( CC * set_encrypt_ivec    )(CIPHER_IMPL * self,
-                                      const void * ivec);
-
-    rc_t ( CC * set_decrypt_ivec    )(CIPHER_IMPL * self,
-                                      const void * ivec);
-
-    rc_t ( CC * set_encrypt_ctr_func)(CIPHER_IMPL * self,
-                                      cipher_ctr_func enc_ctr_func);
-
-    rc_t ( CC * set_decrypt_ctr_func)(CIPHER_IMPL * self,
-                                      cipher_ctr_func enc_ctr_func);
-
-    /* single block encryption */
-    rc_t ( CC * encrypt             )(const CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out);
-    rc_t ( CC * decrypt             )(const CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out);
-
-    /* electronic code book */
-    rc_t ( CC * encrypt_ecb         )(const CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out,
-                                      uint32_t block_count);
-
-    rc_t ( CC * decrypt_ecb         )(const CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out,
-                                      uint32_t block_count);
-
-    /* cipher-block chaining */
-    rc_t ( CC * encrypt_cbc         )(CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out,
-                                      uint32_t block_count);
-    rc_t ( CC * decrypt_cbc         )(CIPHER_IMPL * self,
-                                      const void * in,
-                                      void * out,
-                                      uint32_t block_count);
-
-    /* propagating cipher-block chaining */
-    rc_t ( CC * encrypt_pcbc        )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-    rc_t ( CC * decrypt_pcbc        )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-
-    /* cipher feedback */
-    rc_t ( CC * encrypt_cfb         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-    rc_t ( CC * decrypt_cfb         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-
-    /* output feedback */
-    rc_t ( CC * encrypt_ofb         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-    rc_t ( CC * decrypt_ofb         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-
-    /* Counter */
-    rc_t ( CC * encrypt_ctr         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-    rc_t ( CC * decrypt_ctr         )(CIPHER_IMPL * self, const void * in,
-                                      void * out, uint32_t block_count);
-
-    /* end minor version == 0 */
-
-    /* ANY NEW ENTRIES MUST BE REFLECTED IN libs/krypto/cipher.c
-       BY BOTH THE CORRESPONDING MESSAGE DISPATCH FUNCTION(s) AND
-       VTABLE VALIDITY CHECKS IN CIPHERInit */
-};
-
-typedef union KCipher_ptr KCipher_ptr;
-union KCipher_ptr
-{
-    const KCipher_vt    * version;
-    const KCipher_vt_v1 * v1;
-};
-
-
-struct KCipher
-{
-    KRefcount refcount;
-    uint32_t block_size;
-    KCipher_ptr vt;
-    const char * name;
-    void * encrypt_key;
-    void * decrypt_key;
-    void * encrypt_ivec;
-    void * decrypt_ivec;
-    cipher_ctr_func encrypt_counter_func;
-    cipher_ctr_func decrypt_counter_func;
-};
-
-void KCipherInit (KCipher * self, uint32_t block_size,
-                  const KCipher_vt * vt, const char * name);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_krypto_cipher_impl_ */
diff --git a/libs/krypto/cipher-no-vec.c b/libs/krypto/cipher-no-vec.c
deleted file mode 100644
index 7e0eded..0000000
--- a/libs/krypto/cipher-no-vec.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-
-#include <krypto/ciphermgr.h>
-#include "cipher-priv.h"
-#include "ncbi-priv.h"
-
-struct KCipher;
-
-rc_t CMEMBER(Make) (struct KCipher ** new_obj, kcipher_type type)
-{
-    return RC (rcKrypto, rcCipher, rcConstructing, rcFunction, rcUnsupported);
-}
-
-
-/* EOF */
diff --git a/libs/krypto/cipher-priv.h b/libs/krypto/cipher-priv.h
deleted file mode 100644
index bcc39e5..0000000
--- a/libs/krypto/cipher-priv.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_cipher_priv_
-#define _h_krypto_cipher_priv_
-
-#include <krypto/extern.h>
-#include <krypto/ciphermgr.h>
-#include <krypto/cipher.h>
-
-#include <klib/refcount.h>
-
-/*
- * klib/rc.h ran out of room for new targets so we'll fake it for now
- * with a now unused target that will unfortunately leave some
- * confusing rc to english translations
- */
-#define rcBlockCipher rcRng
-#define rcCipher      rcRng
-
-/*
- * for use within krypto and krypto testing
- */
-
-enum e_aes_type
-{
-    kcipher_AES_core,     /* Rijndael aes_core.c portable */
-    kcipher_AES_ncbi_sim, /* clean AES written for NCBI specifically from the  */
-    kcipher_AES_ncbi_vec, /* xmm vector version version */
-    kcipher_AES_ncbi_ni,  /* 64 bit AES-NI version */
-    kcipher_AES_count
-};
-
-rc_t KCipherMake         (struct KCipher ** new_cipher,
-                          kcipher_type type);
-rc_t KCipherVecAesNiMake (struct KCipher ** new_cipher,
-                          kcipher_type type);
-rc_t KCipherVecRegMake   (struct KCipher ** new_cipher,
-                          kcipher_type type);
-rc_t KCipherVecMake      (struct KCipher ** new_cipher,
-                          kcipher_type type);
-rc_t KCipherByteMake     (struct KCipher ** new_cipher,
-                          kcipher_type type);
-
-/*
- * not for use outside krypto
- */
-rc_t KCipherDestroy (struct KCipher * self);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* #ifndef _h_krypto_cipher_priv_ */
diff --git a/libs/krypto/cipher-vec.c b/libs/krypto/cipher-vec.c
deleted file mode 100644
index 6b61c9e..0000000
--- a/libs/krypto/cipher-vec.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-/* CIPHER_IMPL and BLOCKCIPHER_IMPL are defined in this header */
-#include "ncbi-priv.h"
-/* CIPHER_IMPL is used in this header */
-#include "cipher-impl.h"
-/* BLOCKCIPHER_IMPL is used in this header */
-#include "blockcipher-impl.h"
-
-#include "aes-ncbi-priv.h"
-#include "null-ncbi-priv.h"
-#include "cipher-priv.h"
-#include "blockcipher-priv.h"
-
-#include <krypto/cipher.h>
-#include <krypto/ciphermgr.h>
-
-#include <klib/defs.h>
-#include <klib/refcount.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-const char CMEMBER(ClassName)[] = CLASS_STRING(CIPHER_IMPL);
-
-
-
-struct CIPHER_IMPL
-{
-    KCipher dad;
-    const KBlockCipherVec * block_cipher;
-};
-
-typedef union CipherVec_u
-{
-    CipherVec   vec;
-    CipherBlock block;
-} CipherVec_u;
-
-/*
- * Read a blocks worth of bytes into an AESState
- */
-static __inline__ CipherVec CipherVecIn (const void * cvin)
-{
-#if USE_VEC_REG
-    register CipherVec cv;
-
-    __asm__ (
-        "movdqu (%[a]),%[s]" : [s] "=x" (cv) : [a] "D" (cvin)
-        );
-
-    return cv;
-#else
-    CipherVec_u u;
-
-    memmove (&u.block, cvin, sizeof (u));
-    return u.vec;
-#endif
-}
-
-
-
-/*
- * Write a block's worth of bytes out from an AESState
- */
-static __inline__ void CipherVecOut (const CipherVec cv, void * cvout)
-{
-#if USE_VEC_REG
-    register CipherVec rcv = cv;
-
-    __asm__ (
-        "movdqu %[s],(%[a])" : : [s] "x" (rcv), [a] "D" (cvout)
-        );
-#else
-    CipherVec lcv = cv;
-    memmove (cvout, &lcv, sizeof (lcv));
-#endif
-}
-
-
-static rc_t CMEMBER(Destroy) (CIPHER_IMPL * self)
-{
-    rc_t rc = 0;
-
-    if (self)
-    {
-        rc =  KCipherDestroy (&self->dad);
-        free (self);
-    }
-    return rc;
-}
-
-
-static rc_t CMEMBER(SetEncryptKey)(CIPHER_IMPL * self,
-                                  const char * user_key,
-                                  uint32_t user_key_bits)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (user_key);
-    assert (user_key_bits);
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcUpdating, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        self->block_cipher->v1.set_encrypt_key (self->dad.encrypt_key, user_key,
-                                                user_key_bits);
-        break;
-    }
-    return rc;
-}
-
-
-static rc_t CMEMBER(SetDecryptKey)(CIPHER_IMPL * self,
-                                  const char * user_key,
-                                  uint32_t user_key_bits)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (user_key);
-    assert (user_key_bits);
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcUpdating, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        self->block_cipher->v1.set_decrypt_key (self->dad.decrypt_key, user_key,
-                                                    user_key_bits);
-        break;
-    }
-    return rc;
-}
-
-
-static
-rc_t CMEMBER(SetEncryptIvec) (CIPHER_IMPL * self,
-                             const void * ivec)
-{
-    assert (self);
-    assert (ivec);
-
-    memcpy (self->dad.encrypt_ivec, ivec, self->dad.block_size);
-
-    return 0;
-}
-
-
-static
-rc_t CMEMBER(SetDecryptIvec) (CIPHER_IMPL * self,
-                             const void * ivec)
-{
-    assert (self);
-    assert (ivec);
-
-    memcpy (self->dad.decrypt_ivec, ivec, self->dad.block_size);
-
-    return 0;
-}
-
-
-static
-rc_t CMEMBER(SetEncryptCounterFunc) (CIPHER_IMPL * self,
-                                    cipher_ctr_func func)
-{
-    assert (self);
-    assert (func);
-
-    self->dad.encrypt_counter_func = func;
-
-    return 0;
-}
-
-
-static
-rc_t CMEMBER(SetDecryptCounterFunc) (CIPHER_IMPL * self,
-                                    cipher_ctr_func func)
-{
-    assert (self);
-    assert (func);
-
-    self->dad.decrypt_counter_func = func;
-
-    return 0;
-}
-
-
-static __inline__ CipherVec CMEMBER(EncryptV1)(const CIPHER_IMPL * self,
-                                              register CipherVec cv)
-{
-    return self->block_cipher->v1.encrypt (cv, self->dad.encrypt_key);
-}
-
-
-static __inline__ CipherVec  CMEMBER(DecryptV1)(const CIPHER_IMPL * self,
-                                              register CipherVec cv)
-{
-    return self->block_cipher->v1.decrypt (cv, self->dad.decrypt_key);
-}
-
-
-static __inline__ rc_t CMEMBER(EncryptV1Int)(const CIPHER_IMPL * self,
-                                            const void * in, void * out)
-{
-    CipherVec cv;
-
-    cv = CipherVecIn(in);
-    cv = CMEMBER(EncryptV1)(self, cv);
-    CipherVecOut(cv, out);
-    return 0;
-}
-
-
-static __inline__ rc_t CMEMBER(DecryptV1Int)(const CIPHER_IMPL * self,
-                                            const void * in, void * out)
-{
-    CipherVec cv;
-
-    cv = CipherVecIn(in);
-    cv = CMEMBER(DecryptV1)(self, cv);
-    CipherVecOut(cv, out);
-    return 0;
-}
-
-
-static rc_t CMEMBER(Encrypt) (const CIPHER_IMPL * self, const void * in, void * out)
-{
-    rc_t rc;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        rc = CMEMBER(EncryptV1Int)(self, in, out);
-        break;
-    }
-
-    return rc;
-}
-
-
-static
-rc_t CMEMBER(Decrypt) (const CIPHER_IMPL * self, const void * in, void * out)
-{
-    rc_t rc = 0;
-
-    switch (self->block_cipher->version.maj)
-    {
-    default:
-        rc = RC (rcKrypto, rcCipher, rcEncoding, rcBlockCipher, rcBadVersion);
-        break;
-
-    case 1:
-        rc = CMEMBER(DecryptV1Int)(self, in, out);
-        break;
-    }
-
-    return rc;
-}
-
-
-/* ====================
- * longer runs of multiple blocks.
- *
- * The algorithms are well defined and standard in most cases
- *
- * These aremore or elss equivalent to class functions as they do not depend upon
- * the operation of the cipher and the algorithms are independent of anything about
- * the cipher other than its block size.
- *
- * PT: plain text block
- * CT: cipher text block
- * EK: encryption key
- * DK: decryption key (might be sthe same as EK)
- * ENC: encrypt cipher function on a block using a key
- * DEC: decrypt cipher function on a block using a key
- * IV: initialization vector - used as feedback for chaining
- * N:  number used once (nonce)
- * FB: feedback is the next IV in a chained/feedback mode
- */
-
-
-/* -----
- * NOTE:
- * 'in' can be the same as 'out' but other overlaps are dangers as a block at a
- * time is written. The code does not look for overlaps at this point.
- */
-
-/* ----------
- * Electronic Code Book - simple cipher with no chaining feedback  just iterate
- * simple encrypt/decrypt with the plain, text, cipher text and key/
- *
- * CT = ENC (PT,EK)
- * PT = DEC (CT,DK)
- */
-
-/* -----
- * NOTE: currently an implmentation detail limits us to 8192 bit cipher block
- * size.  Changing MAX_BLOCK_SIZE in cipher.c can up that limit without 
- * causing any other compatibility issues. 
- *
- * Two local byte arrays are defined on the stack of 1024 bytes or 8192 bits.
- */
-static
-rc_t CMEMBER(EncryptEcb) (const CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        CMEMBER(EncryptV1Int)(self, pin, pout);
-    }
-    return 0;
-}
-
-
-static
-rc_t CMEMBER(DecryptEcb) (const CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        CMEMBER(DecryptV1Int)(self, pin, pout);
-    }
-
-    return 0;
-}
-
-
-/* ----------
- * Cipher-Block Chaining
- * CT = (FB = ENC (PT^IV, EK))
- * PT = DEC ((FB = CT), DK)
- */
-static
-rc_t CMEMBER(EncryptCbc) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-#if 0
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-#else
-    ivec = CipherVecIn (self->dad.encrypt_ivec);
-#endif
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        cv = CipherVecIn (pin);
-        cv ^= ivec;
-        ivec = CMEMBER(EncryptV1)(self, cv);
-        CipherVecOut (ivec, pout);
-    }
-
-#if 0
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-#else
-    CipherVecOut (ivec, self->dad.encrypt_ivec);
-#endif
-
-    return 0;
-}    
-
-
-static
-rc_t CMEMBER(DecryptCbc) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = CipherVecIn (self->dad.decrypt_ivec);
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        CipherVec temp;
-
-        cv = CipherVecIn (pin);
-#if 0
-        temp = cv;
-        temp = CMEMBER(DecryptV1)(self, temp);
-#else
-        temp = CMEMBER(DecryptV1)(self, cv);
-#endif
-        temp ^= ivec;
-        CipherVecOut (temp, pout);
-        ivec = cv;
-    }
-
-    *(CipherVec*)self->dad.decrypt_ivec = ivec;
-    return 0;
-}
-
-
-/* ----------
- * Propagating cipher-block chaining
- * FB = PT ^ (CT = ENC ((PT^IV), EK))
- * FB = CT ^ (PT = DEC (CT,DK) ^ IV)
- */
-static
-rc_t CMEMBER(EncryptPcbc) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-#if 1
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        CipherVec temp;
-
-        cv = CipherVecIn (pin);
-        temp = cv ^ ivec;
-        temp = CMEMBER(EncryptV1)(self, temp); 
-        ivec = cv ^ temp;
-        CipherVecOut (temp, pout);
-    }
-
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-
-    return 0;
-#else
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-#endif
-}
-
-
-static
-rc_t CMEMBER(DecryptPcbc) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-#if 1
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        CipherVec temp;
-
-        cv = CipherVecIn (pin);
-        temp = CMEMBER(DecryptV1)(self, cv);
-        ivec ^= temp;
-        CipherVecOut (temp, pout);
-    }
-
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-
-    return 0;
-#else
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-#endif
-}
-
-
-/* ----------
- * Cipher Feedback
- * CT = (FB = PT) ^ ENC (IV, EK))
- * PT = (FB = CT) ^ DEC (IV, DK)
- */
-static
-rc_t CMEMBER(EncryptCfb) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-#if 1
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        ivec = CMEMBER(EncryptV1)(self, ivec); 
-        cv = CipherVecIn (pin);
-        ivec ^= cv;
-        CipherVecOut (ivec, pout);
-    }
-
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-
-    return 0;
-#else
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-#endif
-}
-
-
-static
-rc_t CMEMBER(DecryptCfb) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-#if 1
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        cv = CMEMBER(EncryptV1)(self, ivec); 
-        ivec = CipherVecIn (pin);
-        cv ^= ivec;
-        CipherVecOut (cv, pout);
-    }
-
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-
-    return 0;
-#else
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-#endif
-}
-
-
-/* ----------
- * Output Feedback
- * CT = PT ^ (FB = ENC (IV, EK))
- * PT = CT ^ (FB = DEC (IV, DK))
- */
-static
-rc_t CMEMBER(EncryptOfb) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-#if 1
-    CipherVec cv;
-    CipherVec ivec;
-    const uint8_t * pin;
-    uint8_t * pout;
-
-    ivec = *(const CipherVec*)self->dad.encrypt_ivec;
-
-    for ((pin = in), (pout = out);
-         block_count --; 
-         (pin += self->dad.block_size), (pout += self->dad.block_size))
-    {
-        ivec = CMEMBER(EncryptV1)(self, ivec); 
-        cv = CipherVecIn (pin);
-        cv ^= ivec;
-        CipherVecOut (cv, pout);
-    }
-
-    *(CipherVec*)self->dad.encrypt_ivec = ivec;
-
-    return 0;
-#else
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-#endif
-}
-
-
-static
-rc_t CMEMBER(DecryptOfb) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    return CMEMBER(EncryptOfb)(self, in, out, block_count);
-}
-
-
-/* Counter
- * IV is a nonce and not re-used as FB
- * CT = PT ^ ENC (N, EK)
- * PT = CT ^ ENC (N, DK) 
- * Note decrypt is encrypt.
- * nonce is a function that given an iv generates the next iv
- */
-static
-rc_t CMEMBER(EncryptCtr) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-
-static
-rc_t CMEMBER(DecryptCtr) (CIPHER_IMPL * self, const void * in, void * out, uint32_t block_count)
-{
-    return RC (rcKrypto, rcCipher, rcEncoding, rcFunction, rcUnsupported);
-}
-
-static
-struct KCipher_vt_v1 CMEMBER(_vt_v1) =
-{
-    { 1, 0 },
-
-    CMEMBER(Destroy),
-    CMEMBER(SetEncryptKey),
-    CMEMBER(SetDecryptKey),
-    CMEMBER(SetEncryptIvec),
-    CMEMBER(SetDecryptIvec),
-    CMEMBER(SetEncryptCounterFunc),
-    CMEMBER(SetDecryptCounterFunc),
-    CMEMBER(Encrypt),
-    CMEMBER(Decrypt),
-    CMEMBER(EncryptEcb),
-    CMEMBER(DecryptEcb),
-    CMEMBER(EncryptCbc),
-    CMEMBER(DecryptCbc),
-    CMEMBER(EncryptPcbc),
-    CMEMBER(DecryptPcbc),
-    CMEMBER(EncryptCfb),
-    CMEMBER(DecryptCfb),
-    CMEMBER(EncryptOfb),
-    CMEMBER(DecryptOfb),
-    CMEMBER(EncryptCtr),
-    CMEMBER(DecryptCtr)
-};
-
-
-static __inline__
-rc_t CMEMBER(AllocAes)(CIPHER_IMPL ** pobj,
-                       const KBlockCipher * block_cipher)
-{
-    CipherAes * obj;
-
-    obj = calloc (1, sizeof (*obj));
-    *pobj = (CIPHER_IMPL*)obj;
-
-    return (obj ? 0 : RC (rcKrypto, rcCipher, rcConstructing, rcMemory, rcExhausted));
-}
-
-
-static __inline__
-rc_t CMEMBER(InitAes) (CIPHER_IMPL * self,
-                      const KBlockCipher * block_cipher)
-{
-    KCipher * dad = &self->dad;
-    CipherAes * aes = (struct CipherAes*)self;
-
-    KCipherInit (dad, sizeof (CipherVec),
-                 (const KCipher_vt*)&CMEMBER(_vt_v1),
-                 CMEMBER(ClassName));
-
-    dad->encrypt_key = &aes->e_key;
-    dad->decrypt_key = &aes->d_key;
-    dad->encrypt_ivec = &aes->e_ivec;
-    dad->decrypt_ivec = &aes->d_ivec;
-
-    self->block_cipher = &block_cipher->vec;
-
-    return 0;
-}
-
-
-static __inline__
-rc_t CMEMBER(AllocNull)(CIPHER_IMPL ** pobj,
-                        const KBlockCipher * block_cipher)
-{
-    CipherNull * obj;
-
-    obj = calloc (1, sizeof (*obj));
-    *pobj = (CIPHER_IMPL*)obj;
-
-    return (obj ? 0 : RC (rcKrypto, rcCipher, rcConstructing, rcMemory, rcExhausted));
-}
-
-
-static __inline__
-rc_t CMEMBER(InitNull) (CIPHER_IMPL * self,
-                        const KBlockCipher * block_cipher)
-{
-    KCipher * dad = &self->dad;
-    CipherNull * null = (CipherNull*)self;
-
-    KCipherInit (dad, sizeof (CipherVec),
-                 (const KCipher_vt*)&CMEMBER(_vt_v1),
-                 CMEMBER(ClassName));
-
-    dad->encrypt_key = &null->e_ivec;
-    dad->decrypt_key = &null->d_ivec;
-    dad->encrypt_ivec = &null->e_ivec;
-    dad->decrypt_ivec = &null->d_ivec;
-
-    self->block_cipher = &block_cipher->vec;
-
-    return 0;
-}
-
-
-rc_t CMEMBER(Make) (KCipher ** new_obj, kcipher_type type)
-{
-    rc_t rc;
-    KBlockCipher * block_cipher;
-
-    if (new_obj == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    *new_obj = NULL;
-
-    switch (type)
-    {
-    default:
-        return RC (rcKrypto, rcCipher, rcConstructing, rcParam, rcInvalid);
-
-    case kcipher_null:
-        rc = NULLBCMEMBER(Make)(&block_cipher);
-        break;
-
-    case kcipher_AES:
-        rc = AESBCMEMBER(Make)(&block_cipher);
-        break;
-    }
-
-    if (rc == 0)
-    {
-        CIPHER_IMPL * obj;
-
-        switch (type)
-        {
-        case kcipher_null:
-            rc = CMEMBER(AllocNull) (&obj, block_cipher);
-            if (rc == 0)
-            {
-                rc = CMEMBER(InitNull) (obj, block_cipher);
-                if (rc == 0)
-                    *new_obj = (KCipher*)obj;
-                else
-                    free (obj);
-            }
-            break;
-        case kcipher_AES:
-            rc = CMEMBER(AllocAes) (&obj, block_cipher);
-            if (rc == 0)
-            {
-                rc = CMEMBER(InitAes) (obj, block_cipher);
-                if (rc == 0)
-                    *new_obj = (KCipher*)obj;
-                else
-                    free (obj);
-            }
-        default:
-            /* can't really get here */
-            break;
-        }
-    }
-    return rc;
-}
-
-
-/* EOF */
diff --git a/libs/krypto/cipher.c b/libs/krypto/cipher.c
deleted file mode 100644
index fc6b6c2..0000000
--- a/libs/krypto/cipher.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-#include <krypto/cipher.h>
-#include <krypto/ciphermgr.h>
-#include <krypto/testciphermgr.h>
-#include "cipher-priv.h"
-#include "cipher-impl.h"
-
-#include <klib/rc.h>
-
-
-static const char KCipherClassName[] = "KCipherClassName";
-
-/* ----------------------------------------------------------------------
- * Init
- *
- *   Initialize the fields of this object.  The derived class will call this
- *   during it's initialization.
- *
- * self      object to initialze
- * vt        the virtual table of the derived class
- * mgr       the cipher manager that is the construction factory block cipher
- *           objects hold references to the manager while the manager merely
- *           points at the block ciphers when all block ciphers are destroyed
- *           the manager loses its references and it too can be destroyed if not
- *           held elsewhere
- * name      ASCIZ c-string the name of this class; pointer is expected to remain valid
- *           for the life of the object
- */
-void KCipherInit (KCipher * self,
-                  uint32_t block_size,
-                  const KCipher_vt * vt,
-                  const char * name)
-{
-    KRefcountInit (&self->refcount, 1, KCipherClassName, "init", name);
-    self->block_size = block_size;
-    self->vt.version = vt;
-    self->name = name;
-
-    /* the remaining fields have to be initialized in the derived object init */
-}
-
-
-/* ----------------------------------------------------------------------
- * Destroy
- *   base class destruction called during the derived class destruction
- *
- * self is the cipher object
- *
- * memory release is the repsonsibility of the derived class destructor
- */
-rc_t KCipherDestroy (KCipher * self)
-{
-    if (self)
-    {
-        KRefcountWhack (&self->refcount, self->name);
-    }
-    return 0;
-}
-
-/* ----------------------------------------------------------------------
- * AddRef
- *   add a new owner to this class.  This will mean another instance of 
- *   KCipher used this Block Cipher
- */
-KRYPTO_EXTERN
-rc_t CC KCipherAddRef (const KCipher * self)
-{
-    if (self)
-    {
-        switch (KRefcountAdd (&self->refcount, KCipherClassName))
-        {
-        case krefLimit:
-            return RC (rcKrypto, rcCipher, rcAttaching, rcRange, rcExcessive);
-        }
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Release
- *   
- */
-static __inline__ rc_t KCipherWhack (KCipher * self)
-{
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->destroy (self);
-    }
-    return RC (rcKrypto, rcCipher, rcDestroying, rcInterface, rcBadVersion);
-}
-
-
-KRYPTO_EXTERN
-rc_t CC KCipherRelease (const KCipher * self)
-{
-    if ( self != NULL )
-    {
-        switch (KRefcountDrop ( & self -> refcount, KCipherClassName))
-        {
-        case krefWhack:
-            return KCipherWhack ((KCipher *)self);
-
-        case krefNegative:
-            return RC ( rcKrypto, rcCipher, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Some Cipher Methods are really pass through methods to the block cipher
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherBlockSize (const KCipher * self, size_t * bytes)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if (bytes == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    *bytes = self->block_size;
-
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * 
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherSetEncryptKey (KCipher * self, const void * user_key, size_t user_key_size)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if ((user_key == NULL)||(user_key_size == 0))
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_encrypt_key (self, user_key, user_key_size);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-/* ----------------------------------------------------------------------
- * 
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherSetDecryptKey (KCipher * self, const void * user_key, size_t user_key_size)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if ((user_key == NULL)||(user_key_size == 0))
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_decrypt_key (self, user_key, user_key_size);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-
-/* ----------------------------------------------------------------------
- *  
- *
- * Set the ivec (Initialization vector or feedback) for the cipher
- *
- * the size of ivec  must match KCipherBlockSize
- *
- * the ivec is copied into the cipher not used in place
- */
-KRYPTO_EXTERN rc_t CC KCipherSetEncryptIVec (KCipher * self, const void * ivec)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if (ivec == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_encrypt_ivec (self, ivec);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-/* ----------------------------------------------------------------------
- * 
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherSetDecryptIVec (KCipher * self, const void * ivec)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if (ivec == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_decrypt_ivec (self, ivec);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-/* ----------------------------------------------------------------------
- * 
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherSetEncryptCtrFunc (KCipher * self, cipher_ctr_func func)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if (func == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_encrypt_ctr_func (self, func);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-/* ----------------------------------------------------------------------
- * 
- *   
- */
-KRYPTO_EXTERN rc_t CC KCipherSetDecryptCtrFunc (KCipher * self, cipher_ctr_func func)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcSelf, rcNull);
-
-    if (func == NULL)
-        return RC (rcKrypto, rcCipher, rcAccessing, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->set_decrypt_ctr_func (self, func);
-    }
-    return RC (rcKrypto, rcCipher, rcUpdating, rcInterface, rcBadVersion);
-}
-
-
-KRYPTO_EXTERN rc_t CC KCipherEncrypt (KCipher * self, const void * in, void * out)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcEncoding, rcSelf, rcNull);
-
-    if ((in == NULL) || (out == NULL))
-        return RC (rcKrypto, rcCipher, rcEncoding, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->encrypt (self, in, out);
-    }
-    return RC (rcKrypto, rcCipher, rcAccessing, rcInterface, rcBadVersion);
-}
-
-
-KRYPTO_EXTERN rc_t CC KCipherDecrypt (KCipher * self, const void * in, void * out)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcCipher, rcEncoding, rcSelf, rcNull);
-
-    if ((in == NULL) || (out == NULL))
-        return RC (rcKrypto, rcCipher, rcEncoding, rcParam, rcNull);
-
-    switch (self->vt.version->maj)
-    {
-    case 1:
-        return self->vt.v1->decrypt (self, in, out);
-    }
-    return RC (rcKrypto, rcCipher, rcAccessing, rcInterface, rcBadVersion);
-}
-
-
-/* ====================
- * longer runs of multiple blocks.
- *
- * The algorithms are well defined and standard in most cases
- *
- * These aremore or elss equivalent to class functions as they do not depend upon
- * the operation of the cipher and the algorithms are independent of anything about
- * the cipher other than its block size.
- *
- * PT: plain text block
- * CT: cipher text block
- * EK: encryption key
- * DK: decryption key (might be sthe same as EK)
- * ENC: encrypt cipher function on a block using a key
- * DEC: decrypt cipher function on a block using a key
- * IV: initialization vector - used as feedback for chaining
- * N:  number used once (nonce)
- * FB: feedback is the next IV in a chained/feedback mode
- */
-
-/* -----
- * NOTE:
- * 'in' can be the same as 'out' but other overlaps are dangers as a block at a
- * time is written. The code does not look for overlaps at this point.
- *
- * NOTE: currently an implementation detail limits us to 8192 bit cipher block
- * size.  Changing MAX_BLOCK_SIZE in cipher.c can up that limit without 
- * causing any other compatibility issues. 
- *
- * Two local byte arrays are defined on the stack of 1024 bytes or 8192 bits.
- */
-/*
- * NOTE: if in and out overlap incorrectly this will fail
- */
-#define BLOCK_FUNC_PASTE(A,B) A##B
-#define BLOCK_FUNC(MODE,METHOD) \
-    KRYPTO_EXTERN rc_t CC BLOCK_FUNC_PASTE(KCipher,MODE)                \
-        (KCipher * self, const void * in, void * out,                   \
-         uint32_t block_count)                                          \
-    {                                                                   \
-        rc_t rc;                                                        \
-                                                                        \
-        if (self == NULL)                                               \
-            rc = RC (rcKrypto, rcCipher, rcEncoding, rcSelf, rcNull);   \
-                                                                        \
-        else if (in == NULL)                                            \
-            rc = RC (rcKrypto, rcCipher, rcEncoding, rcParam, rcNull);  \
-                                                                        \
-        else if (out == NULL)                                           \
-            rc = RC (rcKrypto, rcCipher, rcEncoding, rcParam, rcNull);  \
-                                                                        \
-        else if (block_count == 0)                                      \
-            rc = 0;                                                     \
-                                                                        \
-        else                                                            \
-        {                                                               \
-            switch (self->vt.version->maj)                              \
-            {                                                           \
-            case 1:                                                     \
-                return self->vt.v1->METHOD(self, in, out, block_count); \
-            }                                                           \
-            rc = RC (rcKrypto, rcCipher, rcAccessing, rcInterface,      \
-                     rcBadVersion);                                     \
-        }                                                               \
-                                                                        \
-        return rc;                                                      \
-    }
-
-/* ----------
- * Electronic Code Book - simple cipher with no chaining feedback  just iterate
- * simple encrypt/decrypt with the plain, text, cipher text and key/
- *
- * CT = ENC (PT,EK)
- * PT = DEC (CT,DK)
- */
-BLOCK_FUNC(EncryptECB,encrypt_ecb)
-BLOCK_FUNC(DecryptECB,decrypt_ecb)
-
-/* ----------
- * Cipher-Block Chaining
- * CT = (FB = ENC (PT^IV, EK))
- * PT = DEC ((FB = CT), DK)
- */
-BLOCK_FUNC(EncryptCBC,encrypt_cbc)
-BLOCK_FUNC(DecryptCBC,decrypt_cbc)
-
-/* ----------
- * Propagating cipher-block chaining
- * FB = PT ^ (CT = ENC ((PT^IV), EK))
- * FB = CT ^ (PT = DEC (CT,DK) ^ IV)
- */
-BLOCK_FUNC(EncryptPCBC,encrypt_pcbc)
-BLOCK_FUNC(DecryptPCBC,decrypt_pcbc)
-
-/* ----------
- * Cipher Feedback
- * CT = (FB = PT) ^ ENC (IV, EK))
- * PT = (FB = CT) ^ DEC (IV, DK)
- */
-BLOCK_FUNC(EncryptCFB,encrypt_cfb)
-BLOCK_FUNC(DecryptCFB,decrypt_cfb)
-
-/* ----------
- * Output Feedback
- * CT = PT ^ (FB = ENC (IV, EK))
- * PT = CT ^ (FB = DEC (IV, DK))
- */
-BLOCK_FUNC(EncryptOFB,encrypt_ofb)
-BLOCK_FUNC(DecryptOFB,decrypt_ofb)
-
-/* Counter
- * IV is a nonce and not re-used as FB
- * CT = PT ^ ENC (N, EK)
- * PT = CT ^ ENC (N, DK) 
- *
- * The enc_ctr_func (or dec_ctr_func) will be called to update the ivec before
- * to be the nonce (number used once) before each call to the block cipher 
- * encrypt function.  The encrypt function is used for decryption mode as well
- */
-BLOCK_FUNC(EncryptCTR,encrypt_ctr)
-BLOCK_FUNC(DecryptCTR,decrypt_ctr)
-
-
-#ifndef USE_SLOW_ONES
-#define USE_SLOW_ONES 0
-#endif
-rc_t KCipherMakeInt (KCipher ** new_cipher, kcipher_type type)
-{
-    rc_t rc;
-
-    *new_cipher = NULL;
-
-#if 0
-    rc = KCipherVecAesNiMake (new_cipher, type);
-    if (rc)
-    {
-        if (GetRCState(rc) == rcUnsupported)
-        {
-#if USE_SLOW_ONES
-            rc = KCipherVecRegMake (new_cipher, type);
-            if (rc)
-            {
-                if (GetRCState(rc) == rcUnsupported)
-                {
-                    rc = KCipherVecMake (new_cipher, type);
-                    if (GetRCState(rc) == rcUnsupported)
-                    {
-#endif
-#endif
-                        rc = KCipherByteMake (new_cipher, type);
-#if 0
-#if USE_SLOW_ONES
-                    }
-                }
-            }
-#endif
-        }
-    }
-#endif
-    return rc;
-}
-
-kcipher_subtype KCipherSubType = ksubcipher_none;
-
-rc_t KCipherMake (KCipher ** new_cipher, kcipher_type type)
-{
-    rc_t rc;
-
-    if (new_cipher == NULL)
-        rc = RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-    {
-        switch (type)
-        {
-        case kcipher_null:
-        case kcipher_AES:
-            switch (KCipherSubType)
-            {
-            case ksubcipher_byte:
-                rc = KCipherByteMake (new_cipher, type);
-                break;
-#ifdef USEVEC
-            case ksubcipher_vec:
-                rc = KCipherVecMake (new_cipher, type);
-                break;
-#endif
-#ifdef USEVECREG
-            case ksubcipher_vecreg:
-                rc = KCipherVecRegMake (new_cipher, type);
-                break;
-#endif
-#ifdef USEAESNI
-            case ksubcipher_accelerated:
-                rc = KCipherVecAesNiMake (new_cipher, type);
-                break;
-#endif
-            default:
-                rc = KCipherMakeInt (new_cipher, type);
-                break;
-            }
-            break;
-        default:
-            rc = RC (rcKrypto, rcCipher, rcConstructing, rcBlockCipher, rcInvalid);
-            break;
-        }
-    }
-    return rc;
-}
-
-
-
-
-
-
-/* EOF */
diff --git a/libs/krypto/ciphermgr.c b/libs/krypto/ciphermgr.c
deleted file mode 100644
index 25e0b1a..0000000
--- a/libs/krypto/ciphermgr.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define USE_AES_NI false
-
-#include <krypto/extern.h>
-#include <krypto/ciphermgr.h>
-#include <krypto/cipher.h>
-
-#include "cipher-priv.h"
-
-#include <kproc/lock.h>
-
-#include <klib/rc.h>
-#include <klib/refcount.h>
-#include <klib/debug.h>
-
-#include <sysalloc.h>
-
-#include <atomic.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-#ifdef _DEBUGGING
-#define MGR_DEBUG(msg) DBGMSG(DBG_KFS,DBG_FLAG(DBG_KFS_MGR), msg)
-#else
-#define MGR_DEBUG(msg)
-#endif
-
-
-
-static const char kciphermanager_classname [] = "KCipherManager";
-
-
-/*--------------------------------------------------------------------------
- * KCipherManager
- */
-/* currently expected to be a singleton and not use a vtable but
- * be fully fleshed out here */
-static 
-KCipherManager * singleton = NULL;
-
-
-struct KCipherManager
-{
-    KRefcount refcount;
-
-    KLock * lock;
-
-};
-
-
-static
-rc_t KCipherManagerAlloc (KCipherManager ** ppobj)
-{
-    KCipherManager * pobj;
-
-    assert (ppobj);
-
-    pobj = calloc (sizeof *pobj, 1);
-    if (pobj)
-    {
-        *ppobj = pobj;
-        return 0;
-    }
-
-    *ppobj = NULL;
-    return RC (rcKrypto, rcMgr, rcConstructing, rcMemory, rcExhausted);
-}
-
-
-static
-rc_t KCipherManagerInit (KCipherManager * self)
-{
-    rc_t rc;
-
-    rc = KLockMake (&self->lock);
-    if (rc == 0)
-    {
-        KRefcountInit (&self->refcount, 1, kciphermanager_classname, "init",
-                       "singleton");
-    }
-
-    return rc;
-}
-
-
-/* Destroy
- *  destroy
- */
-LIB_EXPORT rc_t CC KCipherManagerDestroy ( KCipherManager *self )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        rc = RC ( rcKrypto, rcMgr, rcDestroying, rcSelf, rcNull );
-    else
-    {
-        if (self == singleton)
-        {
-            KCipherManager * reread;
-
-            reread = atomic_test_and_set_ptr ((void*volatile*)&singleton, NULL, self);
-
-            /* ignore results: just going for guaranteed atomicity though might not need it */
-        }
-
-        /* no return value */
-        KRefcountWhack (&self->refcount, kciphermanager_classname);
-
-        rc = KLockRelease (self->lock);
-
-        free (self);
-    }
-    return rc;
-}
-
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KCipherManagerAddRef ( const KCipherManager *self )
-{
-    if (self != NULL)
-    {
-        switch (KRefcountAdd (&self->refcount, kciphermanager_classname))
-        {
-        case krefOkay:
-            break;
-        case krefZero:
-            return RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcIncorrect);
-        case krefLimit:
-            return RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcExhausted);
-        case krefNegative:
-            return RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            return RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcUnknown);
-        }
-    }
-    return 0;
-}
-
-
-/* Release
- *  discard reference to manager
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC KCipherManagerRelease ( const KCipherManager *self )
-{
-    rc_t rc = 0;
-    if (self != NULL)
-    {
-        switch (KRefcountDrop (&self->refcount, kciphermanager_classname))
-        {
-        case krefOkay:
-        case krefZero:
-            break;
-        case krefWhack:
-            rc = KCipherManagerDestroy ((KCipherManager*)self);
-            break;
-        case krefNegative:
-            return RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            rc = RC (rcFS, rcMgr, rcAttaching, rcRefcount, rcUnknown);
-            break;            
-        }
-    }
-    return rc;
-}
-
-
-/* Make
- *  we have a shared singleton for the cipher manager
- *  first call actually makes the managerblo
- *  subsequent calls get added references
- */
-LIB_EXPORT rc_t CC KCipherManagerMake (KCipherManager ** mgr)
-{
-    rc_t rc = 0;
-
-    if (mgr == NULL)
-        return RC (rcKrypto, rcMgr, rcConstructing, rcSelf, rcNull);
-
-    *mgr = NULL;
-
-make_race_retry:
-
-    if (singleton)
-    {
-        rc = KCipherManagerAddRef (singleton);
-        if (rc == 0)
-        {
-            *mgr = singleton;
-            return 0;
-        }
-    }
-    else
-    {
-        KCipherManager * self;
-
-        rc = KCipherManagerAlloc (&self);
-        if (rc == 0)
-        {
-            rc = KCipherManagerInit (self);
-            if (rc == 0)
-            {
-                KCipherManager * reread;
-
-                reread = atomic_test_and_set_ptr ((void*volatile*)&singleton, self, NULL);
-
-                if (reread)
-                {
-                    KCipherManagerDestroy (self);
-                    goto make_race_retry;
-                }
-
-                *mgr = self;
-                return 0;
-            }
-            else
-            {
-                KCipherManagerDestroy (self);
-            }
-        }
-    }
-    return rc;
-}
-
-
-static __inline__
-rc_t KCipherManagerMakeCipherInt (const KCipherManager *self,
-                                  KCipher ** pcipher,
-                                  kcipher_type type)
-{
-    KCipher * pc;
-    rc_t rc;
-
-    assert (self);
-    assert (pcipher);
-
-    rc = KCipherMake (&pc, type);
-
-    *pcipher = rc ? NULL : pc;
-
-    return rc;
-}
-
-
-LIB_EXPORT
-rc_t CC KCipherManagerMakeCipher (const KCipherManager * self,
-                                  struct KCipher ** pcipher,
-                                  kcipher_type type)
-{
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC (rcKrypto, rcMgr, rcConstructing, rcSelf, rcNull);
-
-    if (pcipher == NULL)
-        return RC (rcKrypto, rcMgr, rcConstructing, rcParam, rcNull);
-
-    *pcipher = NULL;
-
-    rc = KCipherManagerMakeCipherInt (self, pcipher, type);
-
-    return rc;
-}
-
-
-
diff --git a/libs/krypto/compile-test.c b/libs/krypto/compile-test.c
deleted file mode 100644
index 1d3de7a..0000000
--- a/libs/krypto/compile-test.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-
-#include <cpuid.h>
-#include <v128.h>
-
-#include "ncbi-priv.h"
-#include "blockcipher-impl.h"
-
-
-
-const
-CipherVec CMEMBER(test) (void)
-{
-#if USEVEC
-    CipherVec zero  =  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-    CipherVec one   =  { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-                         0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-#else
-    CipherVec zero  =  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-    CipherVec one   =  { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-                         0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-#endif
-    return zero + one;
-}
diff --git a/libs/krypto/csprng.c b/libs/krypto/csprng.c
deleted file mode 100644
index 4ee747b..0000000
--- a/libs/krypto/csprng.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-#include <krypto/extern.h>
-
-#include <krypto/rng.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/refcount.h>
-
-#include <sysalloc.h>
-
-#include <openssl/rand.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
-typedef KRng KCSPRng;
-
-#define KRNG_IMPL KCSPRng
-#include <krypto/rng-impl.h>
-
-
-
-static
-rc_t CC KCSPRngDestroy (KCSPRng * self)
-{
-    free (self);
-    return 0;
-}
-
-static
-rc_t CC KCSPRngSeed (KRng * self)
-{
-    rc_t rc;
-    uint8_t buff [16];
-
-    if (self == NULL)
-        return RC (rcKrypto, rcRng, rcWriting, rcSelf, rcNull);
-
-    /* get some system entropy */
-    rc = KRngSysEntropy (self, buff, sizeof (buff));
-    if (rc)
-        return rc;
-
-    RAND_seed (buff, sizeof (buff));
-
-    return 0;
-}
-
-static
-rc_t CC KCSPRngReseed (KRng * self, const void * buffer_, 
-                       size_t buff_size)
-{
-    const char * buffer;
-    rc_t rc;
-    int32_t ix;
-    uint8_t buff [256];
-
-    if (self == NULL)
-        return RC (rcKrypto, rcRng, rcUpdating, rcSelf, rcNull);
-
-    if (((buffer = buffer_) == NULL) && (buff_size != 0))
-        return RC (rcKrypto, rcRng, rcUpdating, rcParam, rcNull);
-
-    rc = KRngSysEntropy (self, buff, 16);
-    if (rc)
-        return rc;
-
-    if (buffer)
-        for (ix = (buff_size + sizeof (buff) - 1)/sizeof (buff);
-             ix > 0; 
-             (ix -= sizeof (buff)),
-                 (buff_size -= sizeof(buff)),
-                 (buffer += sizeof (buff)))
-        {
-            int32_t jx = (buff_size>sizeof (buff))?sizeof(buff):buff_size;
-            while (--jx > 0)
-                buff[jx] ^= buffer[jx];
-        }
-
-    RAND_add (buffer, buff_size, 1); /* what is that entropy supposed to do? */
-
-    return 0;
-}
-
-static
-rc_t CC KCSPRngRead (const KCSPRng * self, void * buffer, uint32_t bsize, uint32_t * num_read)
-{
-    int ret;
-
-    ret = RAND_bytes (buffer, bsize);
-    if (ret == -1)
-    {
-        *num_read = 0;
-        return RC (rcKrypto, rcRng, rcReading, rcSelf, rcInsufficient);
-    }
-    *num_read = bsize;
-    return 0;
-}
-
-static const
-KRng_vt_v1 vt = 
-{
-    1, 0,
-
-    /* start minor version == 0 */
-    KCSPRngDestroy,
-    KCSPRngSeed,
-    KCSPRngReseed,
-    KCSPRngRead
-    /* end minor version == 0 */
-};
-    
-LIB_EXPORT rc_t CC KCSPRngMake (KRng ** pself)
-{
-    KCSPRng * self;
-    rc_t rc;
-
-    if (pself == NULL)
-        return RC (rcRuntime, 0, rcConstructing, rcSelf, rcNull);
-    else
-    {
-        *pself = NULL;
-
-        self = malloc (sizeof (*self));
-        if (self == NULL)
-            return RC (rcRuntime, 0, rcConstructing, rcMemory, rcExhausted);
-
-        else
-        {
-            rc = KRngInit (self, (union KRng_vt*)&vt, "KCSPRng");
-            *pself = self;
-            return 0;
-        }
-    }
-    return rc;
-}
diff --git a/libs/krypto/encfile-priv.h b/libs/krypto/encfile-priv.h
deleted file mode 100644
index 8061508..0000000
--- a/libs/krypto/encfile-priv.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#ifndef _h_krypto_encfile_priv_libs_
-#define _h_krypto_encfile_priv_libs_
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/* ----------------------------------------------------------------------
- * Offset conversions between encrypted file offset, decrypted file offset
- * and block ID and block offset
- */
-
-/* -----
- * A data block within the encrypted file may not divide nicely by the size of
- * its greatest alignment issue. That is there is currently a uint64_t within 
- * the KEncFileKey forcing 8-byte alignment by default but the whole of the
- * size of KEncFileKey plus the size of the KEncFileData plus the size of
- * the KEncFileCRC is not divisible by 8 so it can't be treated as a single 
- * structure for the puroses of using the sizeof() operator.
- *
- * If the size of the header, block or footer are modified in the future
- * care should be take to retain accuracy of the new versions of these
- * functions.
- */
-
-static __inline__ uint64_t BlockId_to_EncryptedPos (uint64_t block_id)
-{
-    /* the whole block structure is not divisible by 8
-     * so this is not a simple multiply by the sizeof KEncFileBlock
-     */
-    return (sizeof (KEncFileHeader) + block_id * sizeof (KEncFileBlock));
-}
-
-
-static __inline__ uint64_t BlockId_to_DecryptedPos (uint64_t block_id)
-{
-    /* the simplest conversion as its a simple multiply */
-    return (block_id * sizeof (KEncFileData));
-}
-
-
-/* -----
- * when converting from file offsets to block ids we effectively have a
- * quotient and a remainder.  The block id is the quotient and the
- * offset within the block is the remainder.  We use lldiv not ldiv as we
- * are required to work on both 32 and 64 bit machines where long might
- * be 32 bits or it might be 64 bits.  If long long is 128 we willingly
- * sacrifice efficiency for accuracy.
- */
-static __inline__
-uint64_t DecryptedPos_to_BlockId (uint64_t dec_offset, uint32_t * poffset)
-{
-    if (poffset)
-        *poffset = dec_offset % sizeof (KEncFileData);
-    return dec_offset / sizeof (KEncFileData);
-}
-
-static __inline__
-uint64_t EncryptedPos_to_BlockId (uint64_t enc_offset, uint32_t * poffset,
-                                     bool * in_block)
-{
-    uint64_t block_id;
-
-    if (enc_offset < sizeof (KEncFileHeader))
-    {
-        if (poffset)
-            *poffset = 0;
-        if (in_block)
-            *in_block = false;
-        block_id = 0;
-    }
-    else
-    {
-        uint64_t offset;
-
-        enc_offset -= sizeof (KEncFileHeader);
-        block_id = enc_offset / sizeof (KEncFileBlock);
-        offset = enc_offset % sizeof (KEncFileBlock);
-
-        if (offset <= sizeof(KEncFileKey))
-        {
-            if (poffset)
-                *poffset = 0;
-            if (in_block)
-                *in_block = false;
-        }
-        else
-        {
-            offset -= sizeof(KEncFileKey);
-
-            if (offset >= sizeof(KEncFileData))
-            {
-                if (poffset)
-                    *poffset = 0;
-                if (in_block)
-                    *in_block = false;
-            }
-            else
-            {
-                if (poffset)
-                    *poffset = offset;
-                if (in_block)
-                    *in_block = true;
-            }
-        }
-    }
-    return block_id;
-}
-
-struct KFile;
-struct KKey;
-
-KRYPTO_EXTERN rc_t CC KEncFileWriteHeader (struct KFile * self);
-KRYPTO_EXTERN rc_t CC KEncFileWriteHeader_v1 (struct KFile * self);
-KRYPTO_EXTERN rc_t CC KEncFileWriteHeader_v2 (struct KFile * self);
-KRYPTO_EXTERN rc_t CC KEncFileMakeWriteBlock (struct KFile ** pself, 
-                                              struct KFile * encrypted,
-                                              const struct KKey * key);
-
-KRYPTO_EXTERN rc_t CC KEncFileMakeBlock_v2 (struct KFile ** pself,
-                                         struct KFile * encrypted,
-                                         const struct KKey * key);
-
-
-#if 0
-#if USE_UPDATE_V1
-#define KEncFileWriteHeader KEncFileWriteHeader_v1
-#else
-#define KEncFileWriteHeader KEncFileWriteHeader_v2
-#endif
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_encfile_priv_libs_ */
-
-
diff --git a/libs/krypto/encfile.c b/libs/krypto/encfile.c
deleted file mode 100644
index 1c0a970..0000000
--- a/libs/krypto/encfile.c
+++ /dev/null
@@ -1,2122 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <krypto/encfile.h>
-#include <krypto/encfile-priv.h>
-#include <krypto/key.h>
-#include <krypto/ciphermgr.h>
-#include <krypto/cipher.h>
-#include "aes-priv.h"
-#include "encfile-priv.h"
-
-#include <klib/rc.h>
-#include <klib/checksum.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/vector.h>
-#include <klib/status.h>
-#include <kfs/file.h>
-
-#include <sysalloc.h>
-
-#include <byteswap.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-#include <klib/out.h>
-
-#define USE_READ_V1     false
-#define USE_WRITE_V1    false
-#define USE_UPDATE_V1   false
-#define USE_BLOCK_V1    false
-/* KReencFile and KEncryptFile need to use update v1 as it is different */
-#define USE_VALIDATE_V1 false
-#define USE_ISENC_V1    false
-
-#define ENABLE_V2 true
-
-
-/* ----------------------------------------------------------------------
- * KEncFileV1
- *   Base object class for the encryption, decryption and validation of
- *   the file format defined above
- */
-typedef struct KEncFileV1  KEncFileV1;
-#define KFILE_IMPL struct KEncFileV1
-#include <kfs/impl.h>
-
-
-#include "encfile-priv.h"
-
-/* ----------
- * BufferCalcMD5
- *    Generate the MD5 digest for a buffer
- */
-static
-void BufferCalcMD5 (const void * buffer, size_t size, uint8_t digest [16])
-{
-    MD5State state;
-
-    assert (buffer);
-    assert (size);
-    assert (digest);
-
-    MD5StateInit (&state);
-    MD5StateAppend (&state, buffer, size);
-    MD5StateFinish (&state, digest);
-}
-
-#if 0
-/* ----------------------------------------------------------------------
- * Offset conversions between encrypted file offset, decrypted file offset
- * and block ID and block offset
- */
-
-/* -----
- * A data block within the encrypted file may not divide nicely by the size of
- * its greatest alignment issue. That is there is currently a uint64_t within 
- * the KEncFileKey forcing 8-byte alignment by default but the whole of the
- * size of KEncFileKey plus the sizze of the KEncFileData plus the size of
- * the KEncFileCRC is not divisible by 8 so it can't be treated as a single 
- * structure for the puroses of using the sizeof() operator.
- *
- * If the size of the header, block or footer are modified in the future
- * care should be take to retain accuracy of the new versions of these
- * functions.
- */
-
-static __inline__ uint64_t BlockId_to_EncryptedPos (uint64_t block_id)
-{
-    /* the whole block structure is not divisible by 8
-     * so this is not a simple multiply by the sizeof KEncFileBlock
-     */
-    return (sizeof (KEncFileHeader) + block_id * sizeof (KEncFileBlock));
-}
-
-
-static __inline__ uint64_t BlockId_to_DecryptedPos (uint64_t block_id)
-{
-    /* the simplest conversion as its a simple multiply */
-    return (block_id * sizeof (KEncFileData));
-}
-
-
-/* -----
- * when converting from file offsets to block ids we effectively have a
- * quotient and a remainder.  The block id is the quotient and the
- * offset within the block is the remainder.  We use lldiv not ldiv as we
- * are required to work on both 32 and 64 bit machines where long might
- * be 32 bits or it might be 64 bits.  If long long is 128 we willingly
- * sacrifice efficiency for accuracy.
- */
-static __inline__
-uint64_t DecryptedPos_to_BlockId (uint64_t dec_offset, uint32_t * poffset)
-{
-    if (poffset)
-        *poffset = dec_offset % sizeof (KEncFileData);
-    return dec_offset / sizeof (KEncFileData);
-}
-
-/* not so easy - fix this if needed... */
-#if 0
-static
-uint64_t EncryptedPos_to_BlockId (uint64_t enc_offset, uint32_t * poffset)
-{
-    uint64_t block_id;
-
-    if (enc_offset < sizeof (KEncFileHeader))
-    {
-        if (poffset)
-            *poffset = 0;
-        block_id = 0;
-    }
-    else
-    {
-        uint64_t offset;
-
-        enc_offset -= sizeof (KEncFileHeader);
-        block_id = enc_offset / sizeof (KEncFileBlock);
-        offset = enc_offset % sizeof (KEncFileBlock);
-
-        if (offset <= sizeof(KEncFileKey))
-            offset = 0;
-        else
-        {
-            offset -= sizeof(KEncFileKey);
-
-            if (offset >= sizeof(KEncFileData))
-            {
-                ++block_id;
-                offset = 0;
-            }
-        }
-
-        if (poffset)
-            *poffset = offset;
-    }
-    return block_id;
-}
-#endif
-#endif
-
-typedef struct KEncFileCiphers KEncFileCiphers;
-struct KEncFileCiphers
-{
-    KCipher * master;
-    KCipher * block;
-};
-
-typedef uint8_t KEncFileIVec [16];
-/* -----
- */
-struct KEncFileV1
-{
-    KFile dad;                  /* base class */
-    KFile * encrypted;          /* encrypted file as a KFile */
-    KEncFileCiphers ciphers;
-    KEncFileBlock block;        /* */
-    uint64_t encrypted_max;     /* highest read/written point in the encrypted file */
-    KEncFileFooter foot;        /* contains rcrchecksum and blockcount */
-#if ENABLE_V2
-    KEncFileVersion version;
-#endif
-    bool dirty;                 /* data written but not flushed */
-    bool bswap;
-    bool eof;
-    bool seekable;
-    bool written;
-    bool swarm;
-};
-
-
-/* ----------------------------------------------------------------------
- * Buffer - just some part of the encrypted file read or written
- *
- *   these functions exist to hide the potential multiple calls needed
- *   if the KFileRead or KFileWrite called on the encrypted file break up
- *   the requested amount into partial reads or writes
- */
-
-/* ----------
- * BufferRead
- *    Fill a buffer with a requested number of bytes from the encrypted file.  
- *    Read either the requested number of bytes or up through EOF.
- *    The caller has to handle an EOF shorted buffer.
- */
-static
-rc_t KEncFileV1BufferRead (const KEncFileV1 * cself, uint64_t pos, void * buffer,
-                         size_t bsize, size_t * pnum_read)
-{
-    KEncFileV1 * self;   /* for mutable fields */
-    uint8_t * bbuffer; /* void pointer made to a byyte pointer */
-    rc_t rc;
-
-    assert (cself);
-    assert (buffer);
-    assert (pnum_read);
-
-    *pnum_read = 0;
-
-    self = (KEncFileV1*)cself; /* to hit mutable fields */
-    bbuffer = buffer; /* convert to a pointer of sized target */
-
-    /* we want to read a full requested size if possible so keep trying if we
-     * haven't read enough yet. 
-     * We can quit early only if EOF (i.e. read 0 bytes.
-     */
-    rc = KFileReadAll (self->encrypted, pos, buffer, bsize, pnum_read);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc,
-                  "error reading position '$(P)' in encrypted file",
-                  "P=%lu", pos));
-
-    else if (self->encrypted_max < pos)
-        self->encrypted_max = pos;
-            
-    return rc;
-}
-
-
-/* ----------
- * BufferWrite
- *    Write a buffer of requested size out to the encrypted file.
- *    return the number of bytes successfully written
- */
-static
-rc_t KEncFileV1BufferWrite (KEncFileV1 * self, uint64_t pos, const void * buffer,
-                          size_t bsize, size_t * pnum_writ)
-{
-    rc_t rc;
-
-    rc =  KFileWriteAll (self->encrypted, pos, buffer, bsize, pnum_writ);
-    if ((rc == 0) && (self->encrypted_max < pos))
-        self->encrypted_max = pos;
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * operations on KEncFileHeader
- *
- * The header only needs to be read and validated or written  we need not 
- * reatian within the KEncFile object any information about the header in
- * the initial version of this file format.
- */
-
-/* -----
- * the first eight bytes of the file are two four byte strings
- *  The first is a common "NCBI"
- *  The second is the format specific "nenc"
- */
-static const KEncFileSig KEncFileSignature = "NCBInenc";
-
-/* -----
- * the common constant used throughout the project to check the byte order 
- * as written by the system which created the file
- */
-/* enum fails to handle these due to integer overflow */
-
-#define eByteOrderTag     (0x05031988)
-#define eByteOrderReverse (0x88190305)
-
-/* ----
- * Not unexpectedly the first version of this file will be "1"
- */
-#if ENABLE_V2
-
-#define eCurrentVersion (0x00000002)
-#define eCurrentVersionReverse (0x02000000)
-
-static
-const KEncFileHeader const_header_v1
-= { "NCBInenc", eByteOrderTag, 0x00000001 };
-
-static
-const KEncFileHeader const_bswap_header_v1
-= { "NCBInenc", eByteOrderReverse, 0x01000000 };
-    
-#else
-
-#define eCurrentVersion (0x00000001)
-#define eCurrentVersionReverse (0x01000000)
-
-#endif
-    
-static
-const KEncFileHeader const_header
-= { "NCBInenc", eByteOrderTag, eCurrentVersion };
-
-static
-const KEncFileHeader const_bswap_header
-= { "NCBInenc", eByteOrderReverse, eCurrentVersionReverse };
-
-
-/* ----------
- * HeaderRead
- *    Read the header of an encrypted file and validate it.
- */
-static
-rc_t KEncFileV1HeaderRead (KEncFileV1 * self)
-{
-    KEncFileHeader header;
-    size_t num_read;
-    rc_t rc;
-
-    assert (self);
-
-    rc = KEncFileV1BufferRead (self, 0, &header, sizeof (header), &num_read);
-    if (rc)
-        return rc;
-
-    if (num_read != sizeof (header))
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcHeader, rcTooShort);
-        PLOGERR (klogErr,
-                 (klogErr, rc, "error reading full header of encrypted "
-                  "file  wanted '$(S)' got '$(N); bytes read", "S=%u,N=%u",
-                  sizeof (header), num_read));
-        return rc;
-    }
-
-    /* expected is encrypted on a system of the same endianess */
-    if (memcmp (&header, &const_header, sizeof (header)) == 0)
-    {
-        self->bswap = false;
-#if ENABLE_V2
-        self->version = eCurrentVersion;
-#endif
-        return 0;
-    }
-
-    /* next most likely is encrypted on a machine of opposite endianess */
-    if (memcmp (&header, &const_bswap_header, sizeof (header)) == 0)
-    {
-        self->bswap = true;
-#if ENABLE_V2
-        self->version = eCurrentVersion;
-#endif
-        return 0;
-    }
-
-#if ENABLE_V2
-    if (memcmp (&header, &const_header_v1, sizeof (header)) == 0)
-    {
-        self->bswap = false;
-        self->version = 1;
-        return 0;
-    }
-
-    /* next most likely is encrypted on a machine of opposite endianess */
-    if (memcmp (&header, &const_bswap_header_v1, sizeof (header)) == 0)
-    {
-        self->bswap = true;
-        self->version = 1;
-        return 0;
-    }
-#endif
-
-    /* okay it's a "bad" header, so figure out why */
-    if (memcmp (&header, &const_header, sizeof (header.file_sig)) != 0)
-    {
-        rc = RC (rcKrypto, rcFile, rcReading, rcHeader, rcInvalid);
-        LOGERR (klogErr, rc, "file is not the NCBI encrypted file format");
-        /* if this fails the rest doesn't matter */
-        return rc;
-    }
-
-    switch (header.byte_order)
-    {
-    default:
-        rc = RC (rcFS, rcFile, rcConstructing, rcByteOrder, rcInvalid);
-        PLOGERR (klogErr, 
-                 (klogErr, rc, "invalid byte order flag '$(F); in "
-                  "encrypted file", "F=%X", header.byte_order));
-        /* we don't return to possibly log other version errors */
-        break;
-    case eByteOrderReverse:
-    case eByteOrderTag:
-        break;
-    }
-
-    switch (header.version)
-    {
-    default:
-        rc = RC (rcFS, rcFile, rcConstructing, rcHeader, rcBadVersion);
-        PLOGERR (klogErr, 
-                 (klogErr, rc, "can not decrypt version '$(V)'",
-                  "V=%u", header.version));
-        break;
-
-    case 1:
-#if ENABLE_V2
-    case 2:
-#endif
-        break;
-    }
-    return rc;
-}
-
-
-/* -----
- * HeaderWrite
- *
- * build a ram copy of the header and write it to the file
- */
-static
-rc_t KEncFileV1HeaderWrite (KEncFileV1 * self)
-{
-    size_t num_writ;
-    rc_t rc;
-
-    rc = KEncFileV1BufferWrite (self, 0, &const_header, sizeof (const_header),
-                              &num_writ);
-    if (rc == 0)
-    {
-        if (num_writ != sizeof (const_header))
-            rc = RC (rcFS, rcFile, rcWriting, rcHeader, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KEncFileV1WriteHeader_v1  (KFile * self)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcFile, rcWriting, rcSelf, rcNull);
-    return KEncFileV1HeaderWrite ((KEncFileV1*)self);
-}
-
-
-/* ----------------------------------------------------------------------
- * operations on KEncFileFooter
- */
-
-/* ----------
- * Validate
- * we expect to read a Footer when we expect a Block so we validate in RAM
- * without a Read
- *
- * we're just comparing the values in the footer against expected values
- */
-static
-rc_t KEncFileV1FooterValidate (const KEncFileV1 * self,
-                             uint64_t block_count, uint64_t crc_checksum)
-{
-    rc_t rc1 = 0, rc2 = 0;
-
-    if (self->foot.block_count != block_count)
-    {
-        rc2 = RC (rcKrypto, rcFile, rcValidating, rcFile, rcCorrupt);
-        LOGERR (klogErr, rc1, "bad block count in encrypted file footer");
-    }
-    if ((self->foot.crc_checksum != crc_checksum)
-#if ENABLE_V2
-        &&((crc_checksum != 0) || (self->version == 1))
-#endif
-        )
-    {
-        rc1 = RC (rcKrypto, rcFile, rcValidating, rcChecksum, rcCorrupt);
-        LOGERR (klogErr, rc2, "bad crc checksum in encrypted file footer");
-    }
-    return (rc1 ? rc1 : rc2);
-}
-
-
-/* ----------
- * Write
- * when we write a footer we write from the values in the object.  They
- * are stored in the same object format as the footer so its very simple
- */
-static
-rc_t KEncFileV1FooterWrite (KEncFileV1 * self)
-{
-    KEncFileFooter foot;
-    uint64_t offset;
-    size_t num_writ;
-    rc_t rc;
-
-    memcpy (&foot, &self->foot, sizeof (foot));
-    if (self->bswap)
-    {
-        foot.block_count = bswap_64 (foot.block_count);
-        foot.crc_checksum = bswap_64 (foot.crc_checksum);
-    }
-
-    offset = BlockId_to_EncryptedPos (self->foot.block_count);
-
-/*     assert ((self->encrypted_max == offset) || */
-/*             (self->encrypted_max + sizeof(self->foot) == offset)); */
-
-    rc = KEncFileV1BufferWrite (self, offset, &foot, sizeof (foot),
-                              &num_writ);
-    if (rc == 0)
-    {
-        if (num_writ != sizeof (foot))
-            rc = RC (rcFS, rcFile, rcWriting, rcFile, rcInsufficient);
-    }
-    return rc;
-}
-
-
-/* ----------
- * IvecInit
- *    create the ivec for a given block
- *    done in a function to ensure decrypt and encrypt use the same code to
- *    generate this.  Anything used to create this has to be available to
- *    code that doesn't know the content of the data or the state of the file
- *    beyond the location of the block with in the file.
- *
- *    This is definitely over-kill using the MD5.
- */
-static
-void KEncFileV1IVecInit (const KEncFileV1 * self, KEncFileIVec ivec)
-{
-    BufferCalcMD5 (&self->block.id, sizeof self->block.id, ivec);
-}
-
- 
-/* ----------
- * BlockEncrypt
- */
-
-static
-rc_t KEncFileV1BlockEncrypt (KEncFileV1 * self, KEncFileBlock * e)
-{
-    SHA256State state;
-    uint64_t id;
-    uint16_t valid;
-    uint16_t saved_valid;
-    KEncFileCRC crc;
-    uint8_t ivec [16];
-    rc_t rc;
-
-    assert (self);
-    assert (e);
-
-    /*
-     * First we finish preparing the two ciphers by creating the block
-     * user key out of the first part of the data and the shared Initialization
-     * vector for Chained Block Cipher mode encryption out of the block id
-     * 
-     * create the initialization vector for this block
-     */
-    KEncFileV1IVecInit (self, ivec);
-
-    /*
-     * set the ivec for both the master and data block ciphers
-     */
-    rc = KCipherSetEncryptIVec (self->ciphers.master, ivec);
-    if (rc)
-        return rc;
-
-    rc = KCipherSetEncryptIVec (self->ciphers.block, ivec);
-    if (rc)
-        return rc;
-
-    /*
-     * create the block user key out of the first 4kb of data and the block id 
-     */
-    saved_valid = valid = self->block.u.valid;
-    id = self->block.id;
-
-    SHA256StateInit (&state);
-    SHA256StateAppend (&state, self->block.data, 
-                       valid > 4096 ? 4096 : valid);
-    SHA256StateAppend (&state, &id, sizeof (id));
-    SHA256StateFinish (&state, self->block.key);
-        
-    /*
-     * create the block key schedule out of the block user key
-     */
-    rc = KCipherSetEncryptKey (self->ciphers.block, self->block.key,
-                               sizeof self->block.key);
-    if (rc)
-        return rc;
-
-    /* 
-     * Salt the block using the randomish user key to randomly select
-     * data from the valid data.
-     *
-     * This will cover the data portion of the block past the last valid
-     * byte.
-     *
-     * NOTE we are accessing a byte array as a word array.
-     *
-     * NOTE we are using the array named data to access data beyond it's end.
-     */
-    {
-        uint16_t * pw;
-        unsigned int windex;
-        unsigned int rindex;
-        size_t bindex;
-
-        pw = (uint16_t*)self->block.key;
-        windex = 0;
-
-        for (bindex = valid;
-             bindex < sizeof self->block.data + sizeof self->block.u; 
-             ++ bindex)
-        {
-            /* this goes beyond the end of the data array by design */
-            rindex = (size_t)pw[windex];
-            rindex %= bindex;
-
-            self->block.data[bindex] = self->block.data[rindex];
-        
-            ++rindex;
-            if (rindex >= sizeof self->block.key / sizeof *pw)
-                rindex = 0;
-        }
-    }
-
-    /* 
-     * If we are modifying a block created on a system with a different default
-     * Endian choice we'll need to byte swap the block id and the block valid
-     * count
-     */
-    if (self->bswap)
-    {
-        id = bswap_64 (id);
-        valid = bswap_16 (valid);
-    }
-
-
-    if (saved_valid == sizeof self->block.data)
-        self->block.u.valid |= valid;
-    else
-        self->block.u.valid = valid;
-
-    e->id = id;
-
-    /* 
-     * encrypt the block user key into the buffer
-     */
-    rc = KCipherEncryptCBC (self->ciphers.master, self->block.key, e->key,
-                            sizeof (self->block.key) / sizeof (ivec));
-    if (rc)
-        return rc;
-
-    /*
-     * encrypt the data, offset and valid values
-     */
-    rc = KCipherEncryptCBC (self->ciphers.block, 
-                            self->block.data, e->data,
-                            (sizeof self->block.data + sizeof self->block.u) / sizeof (ivec));
-    if (rc)
-        return rc;
-
-    self->block.u.valid = saved_valid;
-
-    crc = CRC32 (0, e, (char*)(&e->crc)-(char*)e);
-
-    self->block.crc = crc;
-
-    if (self->bswap)
-    {
-        crc = bswap_32 (crc);
-    }
-    e->crc_copy = e->crc = crc;
-    
-    return 0;
-}
-
-
-/* ----------
- * BlockDecrypt
- *   decrypt decrypts the data from a KEncFileBlock into the KEncFileBlock
- *   in the KEncFile object
- */
-
-static
-rc_t KEncFileV1BlockDecrypt (KEncFileV1 * self, KEncFileBlock * e)
-{
-    uint8_t ivec [16];
-    rc_t rc;
-
-    assert (self);
-    assert (e);
-
-    /* create the initialization vector for this block */
-    KEncFileV1IVecInit (self, ivec);
-
-    /*
-     * set the ivec for both the master and data block ciphers
-     */
-    rc = KCipherSetDecryptIVec (self->ciphers.master, ivec);
-    if (rc)
-        return rc;
-
-    rc = KCipherSetDecryptIVec (self->ciphers.block, ivec);
-    if (rc)
-        return rc;
-
-    /* 
-     * decrypt the block key and initial vector using the user key and 
-     * the computer ivec
-     */
-    rc = KCipherDecryptCBC (self->ciphers.master, e->key, self->block.key,
-                            (sizeof e->key) / sizeof ivec);
-    if (rc)
-        return rc;
-
-    /* 
-     * now create the AES key for the block from the newly decrypted 
-     * block key
-     */
-    rc = KCipherSetDecryptKey (self->ciphers.block, self->block.key,
-                               sizeof self->block.key);
-    if (rc)
-        return rc;
-    rc = KCipherDecryptCBC (self->ciphers.block, e->data, 
-                            self->block.data, 
-                            (sizeof e->data + sizeof e->u) / sizeof ivec);
-    if (rc)
-        return rc;
-
-    if (self->bswap)
-    {
-        self->block.u.valid = bswap_16 (self->block.u.valid);
-/*         self->block.id = bswap_64 (self->block.id); */
-    }
-
-    /* we choose not to flag errors in decryption so don't validate these */
-    if (self->block.u.valid & 0x8000)
-        self->block.u.valid = 0x8000;
-
-    return rc;
-}
-
-
-/* ----------
- * BlockRead
- *    read a requested block from the encrypted file; 
- *    decryption is a separate step
- */
-static
-rc_t KEncFileV1BlockRead (const KEncFileV1 * cself, uint64_t block_id,
-                        KEncFileBlock * block, bool validate)
-{
-    KEncFileV1 * self;    /* mutable fields */
-    uint64_t pos;
-    uint64_t max;
-    size_t num_read;
-    rc_t rc;
-    KEncFileBlock e;
-
-    assert (cself);
-    assert (block);
-
-    self = (KEncFileV1*)cself;
-    pos = BlockId_to_EncryptedPos (block_id);
-
-    /* set aside the current maximum position within the encrypted file */
-    max = self->encrypted_max;
-
-    memset (&self->block, 0, sizeof self->block);
-    self->block.id = block_id;
-    self->block.u.valid = 0;
-    self->dirty = false;
-
-    rc = KEncFileV1BufferRead (self, pos, &e, sizeof e, &num_read);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc,
-                  "error in reading block '$(BID)' from encrypted file",
-                  "BID=%lu", block_id));
-    else
-    {
-        uint32_t crc;
-
-        /* we'll judge the success of the read now on how many bytes read
-         * there are only three legitimate values:  
-         *   + size of a block 
-         *   + size of a footer
-         *   + zero meaning no footer yet
-         *
-         * This might have to change to handled streamed files where the 
-         * producer jsut hasn't finished yet
-         */
-        switch (num_read)
-        {
-        default: /* bad value means a truncated file most likely */
-            rc = RC (rcKrypto, rcFile, rcReading, rcFile, rcInsufficient);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "wrong size reading block '$(B)' at '$(P)' "
-                      "from encrypted file - likely truncated", "B=%lu,P=%lu",
-                      block_id, pos));
-            break;
-
-        case sizeof e:
-            if (max <= pos) /* if we hadn't read this far do accounting */
-            {
-                if (self->bswap)
-                {
-                    e.crc = bswap_32 (e.crc);
-                    e.id = bswap_64 (e.id);
-                }
-
-                if (block_id != e.id)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr,
-                              RC (rcKrypto, rcFile, rcValidating, rcIndex, rcIncorrect),
-                              "error validating id for block '$(BID)' is not $(C2)", 
-                              "BID=%lu,C2=%lu", block_id, e.id));
-                }
-
-                if (validate)
-                {
-                    crc = CRC32 (0, &e, (char*)(&e.crc)-(char*)&e);
-
-
-                    if (crc != e.crc)
-                    {
-                        PLOGERR (klogErr,
-                                 (klogErr,
-                                  RC (rcKrypto, rcFile, rcValidating, rcCrc, rcCorrupt),
-                                  "error validating crc for block '$(BID)' $(C1) is not $(C2)", 
-                                  "BID=%lu,C1=0x%X,C2=0x%X", block_id,
-                                  crc, e.crc));
-                    }
-                }
-
-                ++self->foot.block_count;
-/* Byte Endian problem! */
-                self->foot.crc_checksum += e.crc;
-            }
-            memcpy (block, &e, sizeof e);
-            self->eof = false;
-            break;
-
-        case sizeof (self->foot):
-            {
-                KEncFileFooter foot;
-                memmove (&foot, &e, sizeof foot);
-                if (self->bswap)
-                {
-                    foot.block_count = bswap_64 (foot.block_count);
-                    foot.crc_checksum = bswap_64 (foot.crc_checksum);
-                }
-                if (validate && !self->written)
-                {
-                    rc = KEncFileV1FooterValidate (self, foot.block_count,
-                                                 foot.crc_checksum);
-                    if (rc)
-                        break;
-                }
-            }
-            /* fall through */
-        case 0:
-            self->block.u.valid = 0;
-            self->block.crc = 0;
-            self->eof = true;
-            return 0;
-
-        }
-    }
-    return rc;
-}
-
-static
-rc_t KEncFileV1BlockWrite (KEncFileV1 * self)
-{
-    KEncFileBlock e;
-    uint64_t block_offset;
-    size_t num_writ;
-    rc_t rc;
- 
-    assert (self);
-
-    if (self->block.u.valid > sizeof self->block.data)
-        return RC (rcFS, rcFile, rcWriting, rcBuffer, rcCorrupt);
-
-    /* where in the file is this block */
-    block_offset = BlockId_to_EncryptedPos(self->block.id);
-
-    /* if this is an update to a block take out the old crc value */
-    if (block_offset < self->encrypted_max)
-        self->foot.crc_checksum -= self->block.crc;
-
-    /* if it's not we need to add it as a new block in the count */
-    else
-        ++self->foot.block_count;
-
-    rc = KEncFileV1BlockEncrypt (self, &e);
-    if (rc)
-        return rc;
-
-/* Byte Endian problem */
-    self->foot.crc_checksum += self->block.crc;
-
-    /* now write the buffer to the encrypted file */
-    rc = KEncFileV1BufferWrite (self, block_offset, &e, sizeof e, &num_writ);
-
-    if ((rc == 0) && (num_writ != sizeof e))
-    {
-        rc = RC (rcFS, rcFile, rcWriting, rcFile, rcTooShort);
-        PLOGERR (klogErr,
-                 (klogErr, rc, "incomplete block write '$(B)' wanted"
-                  " '$(V)' got '$(N)'", "B=%lu,V=%u,N=%u",
-                  self->foot.block_count+1, self->block.u.valid, num_writ));
-    }
-    return rc;
-}
-
-
-static
-rc_t KEncFileV1BlockFlush (KEncFileV1 *self)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (self->block.u.valid);
-    assert (self->block.u.valid <= sizeof (self->block.data));
-
-    /* first do we need to deal with the file header? 
-     * if the encrypted file has not been written to we do */
-    if ((self->encrypted_max == 0) && (self->swarm == false))
-    {
-        rc = KEncFileV1HeaderWrite (self);
-        if (rc)
-            return rc;
-    }
-
-    if (self->dirty)
-    {
-        rc = KEncFileV1BlockWrite (self);
-        if (rc == 0)
-            self->dirty = false;
-    }
-    return rc;
-}
-
-
-/*
- * block_id - which block to read and decrypt
- * fill - if not false, we fill in zero blocks up through this block
- *
- */
-static
-rc_t KEncFileV1BlockSeek (KEncFileV1 * self, uint64_t block_id, bool fill, bool validate)
-{
-    KEncFileBlock b;
-    rc_t rc;
-
-    if (block_id != self->block.id)
-    {
-        if (self->dirty)
-        {
-            /* flush what we got */
-            rc = KEncFileV1BlockFlush (self);
-            if (rc)
-                return rc;
-        }
-
-        if (validate && (block_id > self->block.id))
-        {
-            uint64_t tid;
-
-            for (tid = self->block.id + 1; tid < block_id; ++tid)
-            {
-                if (self->encrypted_max > BlockId_to_EncryptedPos(block_id))
-                    continue;
-
-                memset (&b, 0, sizeof b);
-
-                rc = KEncFileV1BlockRead (self, tid, &b, validate);
-                if (rc)
-                    return rc;
-
-                if (self->eof)
-                {
-                    if (fill)
-                    {
-                        self->eof = false;
-                        memset (self->block.data, 0, sizeof (self->block.data));
-                        self->block.u.valid = sizeof (self->block.data);
-                        self->dirty = true;
-                        rc = KEncFileV1BlockFlush (self);
-                        if (rc)
-                            return rc;
-                    }
-                    else
-                        return 0;
-                }
-                /* in this loop a less than full block is end of file */
-                else if (fill)
-                {
-                    rc = KEncFileV1BlockDecrypt (self, &b);
-                    if (rc)
-                        return rc;
-
-                    if (self->block.u.valid < sizeof self->block.u.valid)
-                    {
-                        memset (self->block.data + self->block.u.valid, 0, 
-                                sizeof (self->block.data) - self->block.u.valid);
-                        self->dirty = true;
-                        rc = KEncFileV1BlockFlush (self);
-                        if (rc)
-                            return rc;
-                    }
-                    else
-                    {
-                        return 0;
-                    }
-                }
-            }
-        }
-    }
-    /* done with intervening blocks */
-    memset (&b, 0, sizeof b);
-
-    rc = KEncFileV1BlockRead (self, block_id, &b, validate);
-    if (rc)
-        return rc;
-
-    if (! self->eof)
-    {
-        rc = KEncFileV1BlockDecrypt (self, &b);
-    }
-    if (fill)
-    {
-        self->block.id = block_id;
-        self->block.u.valid = 0;
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Interface Functions
- *
- * Destroy
- *
- */
-static
-rc_t CC KEncFileV1DestroyRead (KEncFileV1 *self)
-{
-    rc_t rc1 = 0;
-    rc_t rc2 = 0;
-    rc_t rc3 = 0;
-
-    if (self)
-    {
-        rc1 = KFileRelease (self->encrypted);
-        rc2 = KCipherRelease (self->ciphers.master);
-        rc3 = KCipherRelease (self->ciphers.block);
-        free (self);
-        return rc1 ?  rc1 : rc2 ? rc2 : rc3;
-    }
-    return 0;
-}
-
-
-static
-rc_t CC KEncFileV1DestroyWrite (KEncFileV1 *self)
-{
-    rc_t rc1;
-    rc_t rc2;
-
-    rc1 = (self->block.u.valid) ? KEncFileV1BlockFlush (self) : 0;
-    if ((rc1 == 0)&&(self->encrypted_max != 0))
-        rc1 = KEncFileV1FooterWrite (self);
-    rc2 = KFileRelease (self->encrypted);
-
-    return (rc1 ?  rc1 : rc2);
-}
-
-
-static
-rc_t CC KEncFileV1DestroySwarm (KEncFileV1 *self)
-{
-    rc_t rc1 = 0;
-    rc_t rc2 = 0;
-    rc_t rc3 = 0;
-
-    if (self)
-    {
-        rc1 = KFileRelease (self->encrypted);
-        rc2 = KCipherRelease (self->ciphers.master);
-        rc3 = KCipherRelease (self->ciphers.block);
-        free (self);
-        return rc1 ?  rc1 : rc2 ? rc2 : rc3;
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We do not allow this for read, write or update as you can not memory map the 
- * unencrypted file in a meaningful way.
- */
-static
-struct KSysFile *CC KEncFileV1GetSysFileUnsupported (const KEncFileV1 *self, uint64_t *offset)
-{
-    assert (self);
-    assert (offset);
-    return NULL;
-}
-
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KEncFileV1RandomAccess (const KEncFileV1 *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-    return KFileRandomAccess (self->encrypted);
-}
-
-
-static
-rc_t CC KEncFileV1RandomAccessUnsupported (const KEncFileV1 *self)
-{
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KEncFileV1SizeUnsupported (const KEncFileV1 *self, uint64_t *size)
-{
-    return RC ( rcFS, rcFile, rcAccessing, rcFunction, rcUnsupported );
-}
-
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KEncFileV1SetSizeUnsupported (KEncFileV1 *self, uint64_t size)
-{
-    assert (self);
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KEncFileV1ReadUnsupported (const KEncFileV1 *self,
-                                 uint64_t pos,
-                                 void *buffer,
-                                 size_t bsize,
-                                 size_t *num_read)
-{
-    return RC ( rcFS, rcFile, rcReading, rcFunction, rcUnsupported );
-}
-
-
-static
-rc_t CC KEncFileV1Read	(const KEncFileV1 *cself,
-                         uint64_t pos,
-                         void *buffer,
-                         size_t bsize,
-                         size_t *num_read)
-{
-    KEncFileV1 * self = (KEncFileV1 *)cself; /* mutable values */
-    uint64_t block_id;
-    uint32_t offset;
-    size_t to_copy;
-    rc_t rc = 0;
-
-    assert (self); /* checked in file.c KFileRead() */
-    /* pos can be 'anything' */
-    assert (buffer); /* checked in file.c KFileRead() */
-    assert (bsize); /* checked in file.c KFileRead() */
-    assert (num_read); /* checked in file.c KFileRead() */
-
-    *num_read = 0;
-
-    block_id = DecryptedPos_to_BlockId (pos, &offset);
-
-    /*
-     * are we on the wrong block?
-     * Or are do we need to read the first block?
-     */
-    if ((block_id != self->block.id) || (self->block.u.valid == 0))
-    {
-        rc = KEncFileV1BlockSeek (self, block_id, false, false);
-        if (rc)
-            return rc;
-    }
-
-    /*
-     * if we are trying to read past the end of the file 
-     * return 0 with nothing read
-     */
-    if (self->eof || (block_id != self->block.id) ||
-        (offset >= self->block.u.valid))
-        return 0;
-
-    to_copy = self->block.u.valid - offset;
-    if (to_copy > bsize)
-        to_copy = bsize;
-
-    memmove (buffer, self->block.data + offset, to_copy);
-    *num_read = to_copy;
-
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KEncFileV1WriteUnsupported (KEncFileV1 *self, uint64_t pos,
-                                  const void *buffer, size_t bsize,
-                                  size_t *num_writ)
-{
-    rc_t rc = RC (rcFS, rcFile, rcReading, rcFunction, rcUnsupported);
-    LOGERR (klogInt, rc, "KFileRead failed to filter call");
-    return rc;
-}
-
-static
-rc_t KEncFileV1WriteInt (KEncFileV1 *self, uint64_t block_id, uint32_t block_offset,
-                       const void *buffer, size_t bsize,
-                       size_t *pnum_writ, bool seek)
-{
-    const uint8_t * pb;
-    size_t tot_writ;
-    rc_t rc;
-
-    assert (self);
-    assert (self->block.u.valid <= sizeof (self->block.data));
-    assert (block_offset < sizeof (self->block.data));
-    assert (buffer);
-    assert (bsize);
-    assert (pnum_writ);
-
-    if (seek)
-    {
-        /* if we need to change blocks */
-        if (block_id != self->block.id)
-        {
-            rc = KEncFileV1BlockSeek (self, block_id, true, false);
-            if (rc)
-                return rc;
-        }
-        /* do we have to fill some of this block */
-        if (self->block.u.valid < block_id)
-        {
-            memset (self->block.data + self->block.u.valid, 0,
-                    block_offset - self->block.u.valid);
-            self->block.u.valid = block_offset;
-        }
-    }
-
-    /*
-     * is the full write within this block?
-     * doesn't matter whether we are skipping back or not
-     */
-    if ((block_offset + bsize) <= sizeof (self->block.data))
-    {
-        memmove (self->block.data + block_offset, buffer, bsize);
-        self->dirty = true;
-        if (block_offset + bsize > self->block.u.valid)
-            self->block.u.valid = block_offset + bsize;
-        *pnum_writ = bsize;
-        return 0;
-    }
-
-    /* we are either forcing ourselves backward or not */
-    else 
-        self->block.u.valid = block_offset;
-
-    /* by this point we are 'at' the right place in the file */
-    /* do we have an existing (possibly partial) block? */
-
-    /* change to a sized target pointer */
-    pb = buffer;
-    tot_writ = 0;
-
-    /* handle this first block with some data in it */
-    if (self->block.u.valid != 0)
-    {
-        size_t remaining;
-
-        /* how many bytes left in this block */
-        remaining = sizeof self->block.data - self->block.u.valid;
-
-        memmove (self->block.data + self->block.u.valid, buffer, remaining);
-        self->block.u.valid = sizeof self->block.data;
-
-        self->dirty = true;
-        rc = KEncFileV1BlockFlush (self);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "error flushing block in encrypt");
-            return rc;
-        }
-
-        tot_writ = remaining;
-        pb += remaining;
-        bsize -= remaining; 
-        ++block_id;
-    }
-
-    /* now loop through complete blocks to write */
-    for (; bsize >= sizeof self->block.data; bsize -= sizeof self->block.data)
-    {
-        memcpy (self->block.data, pb, sizeof self->block.data);
-
-        self->block.u.valid = sizeof self->block.data;
-        self->block.id = block_id;
-        self->dirty = true;
-        rc = KEncFileV1BlockFlush (self);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "error flushing block in encrypt");
-            return rc;
-        }
-        pb += sizeof self->block.data;
-	tot_writ += sizeof self->block.data;
-        ++block_id;
-    }
-
-    /* now any last partial block that starts at the beginning of a block */
-    if (bsize != 0)
-    {
-        KEncFileBlock b;
-
-        if (self->encrypted_max > BlockId_to_EncryptedPos(block_id))
-        {
-            rc = KEncFileV1BlockRead (self, block_id, &b, false);
-            if (rc)
-                return rc;
-            /* if valid is not 0 we actually read something */
-            if (b.u.valid)
-                rc = KEncFileV1BlockDecrypt (self, &b);
-        }
-        else
-        {
-            self->block.u.valid = 0;
-            self->block.id = block_id;
-        }
-
-        memmove (self->block.data, pb, bsize);
-
-        if (bsize > self->block.u.valid)
-            self->block.u.valid = bsize;
-
-        self->dirty = true;
-        tot_writ += bsize;
-    }
-    *pnum_writ = tot_writ;
-    return 0;
-}
-
-
-static
-rc_t CC KEncFileV1Write (KEncFileV1 *self, uint64_t pos,
-                       const void *buffer, size_t bsize,
-                       size_t *pnum_writ)
-{
-    uint64_t block_id;
-    uint64_t curr_block_id;
-    uint32_t block_offset;
-    uint32_t curr_block_offset;
-    rc_t rc = 0;
-
-    /* -----
-     * check for incorrect call with a seek attempt
-     * we only allow seeks on read or read/write files
-     *
-     * find our location in the encrypted file by block id
-     * and offset
-     */
-    block_id = DecryptedPos_to_BlockId (pos, &block_offset);
-    curr_block_id = DecryptedPos_to_BlockId
-        (BlockId_to_DecryptedPos (self->block.id) + self->block.u.valid,
-         &curr_block_offset);
-
-    /* are we writing to the wrong block/offset? */
-    if ((block_id != curr_block_id) || (block_offset != curr_block_offset))
-    {
-        rc = RC (rcFS, rcFile, rcWriting, rcOffset, rcIncorrect);
-        PLOGERR (klogErr, (klogErr, rc, "attempt to seek in encryption write at"
-                           " '$(O)' seek to '$(P)'", "O=%lu,P=%lu",
-                           BlockId_to_EncryptedPos(self->block.id), pos));
-    }
-    else
-    {
-        if ((block_id != 0) && (block_id != self->block.id))
-        {
-            rc = KEncFileV1BlockFlush (self);
-            if (rc == 0)
-            {
-                ++self->block.id;
-                self->block.u.valid = 0;
-            }
-        }
-        
-        if (rc == 0)
-            rc = KEncFileV1WriteInt (self, block_id, block_offset, buffer,
-                                       bsize, pnum_writ, false);
-    }
-    return rc;
-}
-
-
-static
-rc_t CC KEncFileV1WriteSwarm (KEncFileV1 *self, uint64_t pos,
-                            const void *buffer, size_t bsize,
-                            size_t *pnum_writ)
-{
-    uint32_t block_offset;
-    rc_t rc;
-
-    self->block.id = DecryptedPos_to_BlockId (pos, &block_offset);
-    self->block.u.valid = 0;
-    if (bsize > sizeof self->block.data - block_offset)
-        bsize = sizeof self->block.data - block_offset;
-
-    rc = KEncFileV1WriteInt (self, self->block.id, block_offset, buffer,
-                           bsize, pnum_writ, false);
-    if (rc == 0)
-        rc = KEncFileV1BlockFlush (self);
-    return rc;
-}
-
-
-static
-rc_t CC KEncFileV1Update (KEncFileV1 *self, uint64_t pos,
-                        const void *buffer, size_t bsize,
-                        size_t *pnum_writ)
-{
-    return RC (rcKrypto, rcFile, rcConstructing, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KEncFileV1Type (const KEncFileV1 *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    return KFileType (self->encrypted);
-}
-
-
-/* ----------------------------------------------------------------------
- * KEncFileV1Make
- *  create a new file object
- */
-
-/* ----------
- * KeysInit
- */
-static
-rc_t KEncFileV1CiphersInit (KEncFileV1 * self, const KKey * key, bool read, bool write)
-{
-    KCipherManager * mgr;
-    size_t z;
-    rc_t rc;
-
-    switch ( key->type)
-    {
-    default:
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcInvalid);
-
-    case kkeyNone:
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcIncorrect);
-
-    case kkeyAES128:
-        z = 128/8; break;
-
-    case kkeyAES192:
-        z = 192/8; break;
-
-    case kkeyAES256:
-        z = 256/8; break;
-    }
-    rc = KCipherManagerMake (&mgr);
-    if (rc == 0)
-    {
-        rc = KCipherManagerMakeCipher (mgr, &self->ciphers.master, kcipher_AES);
-        if (rc == 0)
-        {
-            rc = KCipherManagerMakeCipher (mgr, &self->ciphers.block, kcipher_AES);
-            if (rc == 0)
-            {
-                rc = KCipherSetDecryptKey (self->ciphers.master, key->text, z);
-                if (rc == 0)
-                {
-                    rc = KCipherSetEncryptKey (self->ciphers.master, key->text, z);
-                    if (rc == 0)
-                        goto keep_ciphers;
-                }
-                KCipherRelease (self->ciphers.block);
-                self->ciphers.block = NULL;
-            }
-            KCipherRelease (self->ciphers.master);
-            self->ciphers.master = NULL;
-        }
-    keep_ciphers:
-        KCipherManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-
-/* ----------
- * MakeInt
- *    common make for all encryptor/decryptors
- */
-static
-rc_t KEncFileV1MakeInt (KEncFileV1 ** pself, KFile * encrypted,
-                      const KFile_vt_v1 * vt, bool r, bool w, bool v)
-{
-    KEncFileV1 * self;
-    rc_t rc;
-
-    assert (pself);
-    assert (encrypted);
-
-    /* allocate and zero out an object since we want much of it to be zeroed */
-    self = calloc (sizeof *self, 1);
-    if (self == NULL)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-        LOGERR (klogSys, rc,
-                "out of memory creating encrypter and/or decryptor");
-    }
-    else
-    {
-        /* all KFiles get this initialization */
-        rc = KFileInit (&self->dad, (const KFile_vt*)vt, "KEncFileV1", "no-name", r, w);
-        if (rc)
-            LOGERR (klogInt, rc, "failure initialize encrypted file root class");
-        else
-        {
-            rc = KFileAddRef (encrypted);
-            if (rc == 0)
-            {
-                self->encrypted = encrypted;
-                *pself = self;
-                return 0;
-            }
-        }
-        free (self);
-    }
-    return rc;
-}
-
-
-/* ----------
- * MakeCmn
- * common parameter validation for all encryptor/decryptors
- */
-static
-rc_t KEncFileV1MakeCmn (KEncFileV1 ** pself, KFile * encrypted, const KKey * key,
-                      const KFile_vt_v1 * vt, bool r, bool w)
-{
-    rc_t rc = 0;
-
-    do
-    {
-        CRC32Init();    /* likely to be called way too often */
-
-        if (pself == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-            LOGERR (klogErr, rc,
-                    "pointer to self NULL when creating "
-                    "an encryptor/decryptor");
-            break;
-        }
-        *pself = NULL;
-
-        if (encrypted == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-            LOGERR (klogErr, rc, 
-                    "encrypted file not supplied when creating "
-                    "an encryptor/decryptor");
-            break;
-        }
-
-        if (key == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-            LOGERR (klogErr, rc, 
-                    "key not supplied when creating an encryptor/decryptor");
-            break;
-        }
-
-        switch (key->type)
-        {
-        default:
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "invalid key type '$(T)' should be "
-                      "kkeyAES128(1), kkeyAES192(2) or kkeyAES256(3)",
-                      "T=%u", key->type));
-            break;
-
-        case kkeyAES128:
-        case kkeyAES192:
-        case kkeyAES256:
-            break;
-        }
-        if (rc == 0)
-        {
-            KEncFileV1 * self;
-
-            assert (vt);
-            assert ((r == true) || (r == false));
-            assert ((w == true) || (w == false));
-
-            rc = KEncFileV1MakeInt (&self, encrypted, vt, r, w, false);
-            if (rc == 0)
-            {
-                rc = KEncFileV1CiphersInit (self, key, r, w);
-                if (rc == 0)
-                {
-                    *pself = self;
-                    return 0;
-                }
-                KFileRelease (&self->dad);
-            }
-        }
-    } while (0);
-    return rc;
-}
-
-
-
-static const KFile_vt_v1 vtKEncFileV1Read =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KEncFileV1DestroyRead,
-    KEncFileV1GetSysFileUnsupported,
-    KEncFileV1RandomAccess,
-    KEncFileV1SizeUnsupported,
-    KEncFileV1SetSizeUnsupported,
-    KEncFileV1Read,
-    KEncFileV1WriteUnsupported,
-
-    /* 1.1 */
-    KEncFileV1Type
-};
-static const KFile_vt_v1 vtKEncFileV1Write =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KEncFileV1DestroyWrite,
-    KEncFileV1GetSysFileUnsupported,
-    KEncFileV1RandomAccessUnsupported,
-    KEncFileV1SizeUnsupported,
-    KEncFileV1SetSizeUnsupported,
-    KEncFileV1ReadUnsupported,
-    KEncFileV1Write,
-
-    /* 1.1 */
-    KEncFileV1Type
-};
-static const KFile_vt_v1 vtKEncFileV1Update =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KEncFileV1DestroySwarm,
-    KEncFileV1GetSysFileUnsupported,
-    KEncFileV1RandomAccess,
-    KEncFileV1SizeUnsupported,
-    KEncFileV1SetSizeUnsupported,
-    KEncFileV1ReadUnsupported,
-    KEncFileV1WriteSwarm,
-
-    /* 1.1 */
-    KEncFileV1Type
-};
-static const KFile_vt_v1 vtKEncFileV1Validate =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KEncFileV1DestroyRead,
-    KEncFileV1GetSysFileUnsupported,
-    KEncFileV1RandomAccessUnsupported,
-    KEncFileV1SizeUnsupported,
-    KEncFileV1SetSizeUnsupported,
-    KEncFileV1ReadUnsupported,
-    KEncFileV1WriteUnsupported,
-
-    /* 1.1 */
-    KEncFileV1Type
-};
-
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-LIB_EXPORT rc_t CC KEncFileMakeRead_v1 (const KFile ** pself, 
-                                        const KFile * encrypted,
-                                        const KKey * key)
-{
-    KEncFileV1 * self;
-    rc_t rc;
-    rc = KEncFileV1MakeCmn (&self, (KFile *)encrypted, key, &vtKEncFileV1Read, 
-                          true, false);
-    if (rc)
-        LOGERR (klogErr, rc, "error constructing decryptor");
-    else
-    {
-        rc = KEncFileV1HeaderRead (self);
-        if (rc)
-            LOGERR (klogErr, rc, "error reading encrypted file header");
-        else
-        {
-            *pself = &self->dad;
-            return 0;
-        }
-        KFileRelease (&self->dad);
-    }
-    return rc;
-}
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through form the
- * first byte to the last.
- */
-LIB_EXPORT rc_t CC KEncFileMakeWrite_v1 (KFile ** pself, 
-                                         KFile * encrypted,
-                                         const KKey * key)
-{
-    KEncFileV1 * self;
-    rc_t rc;
-
-    rc = KFileSetSize (encrypted, 0);
-#if 0
-    if (rc)
-        LOGERR (klogWarn, rc, "error truncating output file - "
-                "corrupted file might result");
-#endif
-
-    rc = KEncFileV1MakeCmn (&self, encrypted, key, &vtKEncFileV1Write, 
-                          false, true);
-    if (rc)
-        LOGERR (klogErr, rc, "error creating encryptor");
-    else
-        *pself = &self->dad;
-    return rc;
-}
-
-
-/* ----------
- * Update mode is read/write mode where seeking within the file is allowed.
- */
-
-
-LIB_EXPORT rc_t CC KEncFileV1MakeUpdate_v1 (KFile ** pself, 
-                                          KFile * encrypted,
-                                          const KKey * key)
-{
-    KEncFileV1 * self;
-    rc_t rc;
-
-    rc = KEncFileV1MakeCmn (&self, encrypted, key, &vtKEncFileV1Update, 
-                          false, true);
-    if (rc)
-        LOGERR (klogErr, rc, "error creating encryptor");
-    else
-    {
-        self->swarm = true;
-        *pself = &self->dad;
-    }
-    return rc;
-}
-
-
-/* ----------
- * Validate mode is useful only for the KFileEncValidate function
- */
-static
-rc_t KEncFileV1MakeValidate (const KEncFileV1 ** pself, const KFile * encrypted)
-{
-    KEncFileV1 * self;
-    rc_t rc;
-
-    assert (pself);
-    assert (encrypted);
-
-    rc = KEncFileV1MakeInt (&self, (KFile*)encrypted, &vtKEncFileV1Validate, true, false, true);
-    if (rc)
-        LOGERR (klogErr, rc, "error making KEncFileV1");
-    else
-    {
-        rc = KEncFileV1HeaderRead (self);
-        if (rc)
-            LOGERR (klogErr, rc, "error reading encrypted file header");
-        else
-        {
-            *pself = self;
-            return 0;
-        }
-    }
-    *pself = NULL;
-    return rc;
-}
-
-
-/* ----------
- * Validate mode can not be read or written.
- * Upon open the whole file is read from begining to end and all CRC
- * and other integrity checks are performed immedaitely
- */
-LIB_EXPORT rc_t CC KEncFileV1Validate_v1 (const KFile * encrypted)
-{
-    const KEncFileV1 * file;
-    rc_t rc;
-
-    /* fail if a NULL parameter: can't validate all addresses */
-    if (encrypted == NULL)
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcParam, rcNull);
-        LOGERR (klogErr, rc, "encrypted file was null when trying to validate");
-        return rc;
-    }
-
-    /* if the parameter is already a KEncFileV1 work on the file behind it instead */
-    /* we definitely can't work on a file being written that has not been closed */
-    if (encrypted->vt == (const KFile_vt*)&vtKEncFileV1Read)
-        encrypted = (const KFile *)(((const KEncFileV1*)encrypted)->encrypted);
-
-    /* file header is validated within the call to Make Validate */
-    rc = KEncFileV1MakeValidate (&file, encrypted);
-    if (rc)
-        LOGERR (klogErr, rc,
-                "unable to validate encrypted file due to "
-                "inability to open as encrypted file");
-    else
-    {
-        uint64_t pos;             /* position within the encrypted file */
-        uint64_t block_count = 0; /* how many blocks have we read */
-
-        /* loop through all data blocks */
-        pos = sizeof (KEncFileHeader);
-        for (block_count = 0; ; ++block_count)
-        {
-            KEncFileBlock block;
-
-            STSMSG (2, ("reading block '%u' at '%lu'", block_count,
-                        BlockId_to_EncryptedPos(block_count)));
-           
-            rc = KEncFileV1BlockRead (file, block_count, &block, true);
-            if (rc)
-            {
-                STSMSG (2, ("read error at block '%u'", block_count));
-                break;
-            }
-            if (file->eof)
-            {
-                STSMSG (2, ("block '%u' was end", block_count));
-
-                break;
-            }
-            pos += sizeof (KEncFileData);
-        }
-        KFileRelease (&file->dad);
-    }
-    return (rc);
-}
-
-
-LIB_EXPORT rc_t CC KFileIsEnc_v1 (const char * buffer, size_t buffer_size)
-{
-    const KEncFileHeader * header;
-
-    if ((buffer == NULL) || (buffer_size == 0))
-        return RC  (rcFS, rcFile, rcIdentifying, rcParam, rcNull); 
-
-    header = (const KEncFileHeader*)buffer;
-
-    if (buffer_size < sizeof header->file_sig)
-        return RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient); 
-
-    if (buffer_size > sizeof (*header))
-        buffer_size = sizeof (*header);
-
-    if ((memcmp (header, &const_header, buffer_size) == 0) ||
-        (memcmp (header, &const_bswap_header, buffer_size) == 0)
-#if ENABLE_V2
-        ||
-        (memcmp (header, &const_header_v1, buffer_size) == 0) ||
-        (memcmp (header, &const_bswap_header_v1, buffer_size) == 0)
-#endif
-        )
-        return 0;
-
-    return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType); 
-}
-
-
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-LIB_EXPORT rc_t CC KEncFileMakeRead (const struct KFile ** pself,
-                                        const struct KFile * encrypted_input,
-                                        const struct KKey * key)
-{
-#if USE_READ_V1
-    return KEncFileV1MakeRead_v1 (pself, encrypted_input, key);
-#else
-    return KEncFileMakeRead_v2 (pself, encrypted_input, key);
-#endif
-}
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through from the
- * first byte to the last.
- */
-LIB_EXPORT rc_t CC KEncFileMakeWrite (struct KFile ** pself,
-                                         struct KFile * encrypted_output,
-                                         const struct KKey * key)
-{
-#if USE_WRITE_V1
-    return KEncFileV1MakeWrite_v1 (pself, encrypted_output, key);
-#else
-    return KEncFileMakeWrite_v2 (pself, encrypted_output, key);
-#endif
-}
-
-/* ----------
- * Update mode is read/write mode where seeking within the file is allowed.
- *
- * NOTE this is in the private interface because it is not actually working
- * yet.
- */
-LIB_EXPORT rc_t CC KEncFileMakeUpdate (struct KFile ** pself, 
-                                       struct KFile * encrypted,
-                                       const struct KKey * key)
-{
-#if USE_UPDATE_V1
-    return KEncFileV1MakeUpdate_v1 (pself, encrypted, key);
-#else
-    return KEncFileMakeUpdate_v2 (pself, encrypted, key);
-#endif
-}
-LIB_EXPORT rc_t CC KEncFileMakeWriteBlock (struct KFile ** pself, 
-                                           struct KFile * encrypted,
-                                           const struct KKey * key)
-{
-#if USE_BLOCK_V1
-    return KEncFileV1MakeUpdate_v1 (pself, encrypted, key);
-#else
-    return KEncFileMakeBlock_v2 (pself, encrypted, key);
-#endif
-}
-
-
-LIB_EXPORT rc_t CC KEncFileWriteHeader  (KFile * self)
-{
-#if USE_BLOCK_V1
-    return KEncFileV1WriteHeader_v1  (self);
-#else
-    return KEncFileWriteHeader_v2  (self);
-#endif
-}
-
-
-/* ----------
- * Validate mode can not be read or written.
- * Upon open the whole file is read from begining to end and all CRC
- * and other integrity checks are performed immedaitely
- */
-LIB_EXPORT rc_t CC KEncFileValidate (const struct KFile * encrypted)
-{
-#if USE_VALIDATE_V1
-    return KEncFileV1Validate_v1 (encrypted);
-#else
-    return KEncFileValidate_v2 (encrypted);
-#endif
-}
-
-
-/* ----------
- * Identify whether a file is a KEncFile type encrypted file by the header.
- * read the header into a buffer and pass it into this function.  
- * The buffer_size needs to be at least 8 but more bytes lead to a better
- * check up to the size of the header of a KEncFile type encrypted file.
- * As the header may change in the future (in a backwards compatible way)
- * that size might change from the current 16.
- *
- * Possible returns:
- * 0:
- *      the file is an identified KEncFile type file.  False positives are
- *      possible if a file happens to match at 8 or more bytes
- *
- * RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType)
- *      the file is definitely not a KEncFile type encrypted file.
- *     
- * RC (rcFS, rcFile, rcIdentifying, rcParam, rcNull)
- *      bad parameters in the call
- *
- * RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient)
- *      not a large enough buffer to make an identification
- */
-LIB_EXPORT rc_t CC KFileIsEnc (const char * buffer, size_t buffer_size)
-{
-#if USE_ISENC_V1
-    return KFileIsEnc_v1 (buffer, buffer_size);
-#else
-    return KFileIsEnc_v2 (buffer, buffer_size);
-#endif
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-/* end of file encfile.c */
-
diff --git a/libs/krypto/encfilev2.c b/libs/krypto/encfilev2.c
deleted file mode 100644
index 25315ba..0000000
--- a/libs/krypto/encfilev2.c
+++ /dev/null
@@ -1,2589 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <krypto/encfile.h>
-#include <krypto/encfile-priv.h>
-#include "encfile-priv.h"
-#include <krypto/cipher.h>
-#include <krypto/ciphermgr.h>
-#include <krypto/key.h>
-
-/* #include "aes-priv.h" */
-
-#include <klib/rc.h>
-#include <klib/checksum.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/status.h>
-/* #include <klib/vector.h> */
-/* #include <klib/status.h> */
-#include <kfs/file.h>
-#include <kfs/sra.h>
-#include <sysalloc.h>
-
-#include <byteswap.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-/* #include <klib/out.h> */
-
-
-/* ----------------------------------------------------------------------
- * KEncFile
- *   Base object class for the encryption, decryption and validation of
- *   the file format defined above
- */
-
-#define KFILE_IMPL struct KEncFile
-#include <kfs/impl.h>
-
-
-#include "encfile-priv.h"
-
-typedef struct KEncFileCiphers KEncFileCiphers;
-struct KEncFileCiphers
-{
-    KCipher * master;
-    KCipher * block;
-};
-
-
-typedef struct KEncFileIVec { uint8_t ivec [16]; } KEncFileIVec;
-
-/* -----
- */
-struct KEncFile
-{
-    KFile dad;                  /* base class */
-    KFile * encrypted;          /* encrypted file as a KFile */
-    KEncFileCiphers ciphers;    /* file and block ciphers */
-    KEncFileBlock block;        /* current data block */
-    KEncFileFooter foot;        /* contains crc checksum and block count */
-    uint64_t dec_size;          /* size of decrypted file */
-    uint64_t enc_size;          /* size of encrypted file */
-    bool dirty;                 /* data written but not flushed set in Write cleared in Flush*/
-    bool seekable;              /* we can seek within the encrypted file */
-    bool size_known;            /* can we know the size? Only streaming read can not know */
-    bool bswap;                 /* file created on system of opposite endianess */
-    bool changed;               /* some write has happened cleared in Make, set in BufferWrite */
-    bool sought;                /* did a seek on a read or write invalidating crc checksum */
-    bool has_header;            /* have we read or written a header? */
-    bool eof;                   
-    bool sra;                   /* we know we are encrypting an SRA/KAR archive file */
-    bool swarm;                 /* block mode for swarm mode using KReencFile or KEncryptFile */
-    KEncFileVersion version;    /* version from the header if read; or the one being written */
-};
-
-
-/* ----------
- * BufferCalcMD5
- *    Generate the MD5 digest for a buffer
- */
-static __inline__
-void BufferCalcMD5 (const void * buffer, size_t size, uint8_t digest [16])
-{
-    MD5State state;
-
-    assert (buffer);
-    assert (size);
-    assert (digest);
-
-    MD5StateInit (&state);
-    MD5StateAppend (&state, buffer, size);
-    MD5StateFinish (&state, digest);
-}
-
-
-/* -----
- * return true or false as to whether the the buffer described is all 0 bits
- */
-static __inline__
-bool BufferAllZero (const void * buffer_, size_t size)
-{
-    const uint8_t * buffer;
-    size_t count;
-    bool ret;
-
-    assert (buffer_);
-
-    buffer = buffer_;
-    ret = true;
-
-    for (count = 0; count < size; ++count)
-    {
-        if (buffer[count] != '\0')
-        {
-            ret = false;
-            break;
-        }
-    }
-    return ret;
-}
-
-
-/* ----------
- * BufferRead
- *    Read from an encrypted file and update size if warranted
- *
- * Read's aren't guaranteed to get full amount
- */
-static
-rc_t KEncFileBufferRead (KEncFile * self, uint64_t offset, void * buffer,
-                         size_t bsize, size_t * num_read)
-{
-    rc_t rc;
-
-    assert (self);
-    assert (self->encrypted);
-    assert (buffer);
-    assert (bsize > 0);
-    assert (num_read);
-
-    rc = KFileReadAll (self->encrypted, offset, buffer, bsize, num_read);
-    if (rc == 0)
-    {
-        if (self->enc_size < offset + *num_read)
-        {
-            self->enc_size = offset + *num_read;
-        }
-    }
-/* leave logging to callers? */
-    else
-        PLOGERR (klogErr, (klogErr, rc, "Error reading from encrypted file "
-                           "at '$(P)", "P=%lu", offset));
-
-    return rc;
-}
-
-
-/* ----------
- * BufferWrite
- *    write to an encrypted file, mark it as changed and update size if warranted
- */
-static
-rc_t KEncFileBufferWrite (KEncFile * self, uint64_t offset, const void * buffer,
-                          size_t bsize, size_t * num_writ)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (self->encrypted);
-    assert (buffer);
-    assert (bsize > 0);
-    assert (num_writ);
-
-    rc = KFileWriteAll (self->encrypted, offset, buffer, bsize, num_writ);
-    if (rc)
-/* leave logging to callers? */
-        PLOGERR (klogErr, (klogErr, rc, "Error writing to encrypted file "
-                           "at '$(P)", "P=%lu", offset));
-    if (bsize != *num_writ)
-    {
-/*         KOutMsg ("%s: bsize %zu *num_writ %zu\n",__func__, bsize, *num_writ); */
-        rc = RC (rcKrypto, rcFile, rcWriting, rcTransfer, rcIncomplete);
-/* leave logging to callers? */
-        PLOGERR (klogErr, (klogErr, rc, "Error writing full buffer to"
-                           " encrypted file at '$(P) wrote '$(W)'",
-                           "P=%lu,W=%zu", offset, *num_writ));
-    }
-    else if (*num_writ > 0)
-    {
-        self->changed = true;
-        if (self->enc_size < offset + *num_writ)
-        {
-            self->enc_size = offset + *num_writ;
-        }
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * operations on KEncFileHeader
- *
- * The header only needs to be read and validated or written  we need not 
- * reatian within the KEncFile object any information about the header in
- * the initial version of this file format.
- */
-
-/* -----
- * the first eight bytes of the file are two four byte strings
- *  The first is a common "NCBI"
- *  The second is the format specific "nenc"
- */
-static const KEncFileSig KEncFileSignature = "NCBInenc";
-
-
-/* -----
- * the common constant used throughout the project to check the byte order 
- * as written by the system which created the file
- */
-/* enum fails to handle these due to integer overflow */
-
-#define eEncFileByteOrderTag     (0x05031988)
-#define eEncFileByteOrderReverse (0x88190305)
-
-/* ----
- */
-#define eCurrentVersion        (0x00000002)
-#define eCurrentVersionReverse (0x02000000)
-
-
-static
-const KEncFileHeader const_header
-= { "NCBInenc", eEncFileByteOrderTag, eCurrentVersion };
-
-
-static
-const KEncFileHeader const_bswap_header
-= { "NCBInenc", eEncFileByteOrderReverse, eCurrentVersionReverse };
-
-/* skipping v1 for NCBIkenc */
-static
-const KEncFileHeader const_header_sra
-= { "NCBIsenc", eEncFileByteOrderTag, eCurrentVersion };
-
-
-static
-const KEncFileHeader const_bswap_header_sra
-= { "NCBIsenc", eEncFileByteOrderReverse, eCurrentVersionReverse };
-
-    
-/* ----------
- * HeaderRead
- *    Read the header of an encrypted file and validate it.
- *
- * We only allow a missing header for an empty file opened for update
- */
-static
-rc_t KEncFileHeaderRead (KEncFile * self)
-{
-    KEncFileHeader header;
-    size_t num_read;
-    rc_t rc;
-
-    assert (self);
-
-    rc = KEncFileBufferRead (self, 0, &header, sizeof (header), &num_read);
-    if (rc)
-        LOGERR (klogErr, rc, "error reading encrypted file header");
-
-    else if ((num_read == 0) && (self->dad.write_enabled))
-    {
-        /* only allow read to fail with zero length if opened with write */
-        self->version = eCurrentVersion;
-        self->bswap = false;
-        self->enc_size = 0; /* redundant? */
-        self->dec_size = 0; /* redundant? */
-    }
-    else if (num_read != sizeof (header))
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcHeader, rcTooShort);
-        PLOGERR (klogErr,
-                 (klogErr, rc, "error reading full header of encrypted "
-                  "file  wanted '$(S)' got '$(N); bytes read", "S=%u,N=%u",
-                  sizeof (header), num_read));
-    }
-    else
-    {
-        rc_t orc;
-
-        if (memcmp (header.file_sig, const_header.file_sig,
-                     sizeof (header.file_sig)) == 0)
-            self->sra = false;
-        else if (memcmp (header.file_sig, const_header_sra.file_sig,
-                         sizeof (header.file_sig)) == 0)
-            self->sra = true;
-        else
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcHeader, rcInvalid);
-            LOGERR (klogErr, rc, "file signature not correct for encrypted file");
-        }
-
-        switch (header.byte_order)
-        {
-        case eEncFileByteOrderTag:
-            self->bswap = false;
-            self->version = header.version;
-            break;
-
-        case eEncFileByteOrderReverse:
-            self->bswap = true;
-
-            /* assert for the right bswap call */
-            assert (sizeof (self->version) == 4);
-
-            self->version = bswap_32 (header.version);
-            break;
-
-        default:
-            orc = RC (rcFS, rcFile, rcConstructing, rcByteOrder, rcInvalid);
-            PLOGERR (klogErr, (klogErr, rc, "invalid byte order flag '$(F); in "
-                               "encrypted file header", "F=%X",
-                               header.byte_order));
-            if (rc == 0)
-                rc = orc;
-            break;
-        }
-
-        if ((self->version > eCurrentVersion) || (self->version == 0))
-        {
-            orc = RC (rcFS, rcFile, rcConstructing, rcHeader, rcBadVersion);
-            PLOGERR (klogErr, (klogErr, orc, "can not decrypt version '$(V)'",
-                               "V=%u", header.version));
-            if (rc == 0)
-                rc = orc;
-        }
-        if (rc == 0)
-            self->has_header = true;
-    }
-    return rc;
-}
-
-
-/* -----
- * HeaderWrite
- */
-#ifndef SENC_IS_NENC_FOR_WRITER
-#define SENC_IS_NENC_FOR_WRITER 1
-#endif
-
-static
-rc_t KEncFileHeaderWrite (KEncFile * self)
-{
-    rc_t rc;
-    size_t num_writ;
-    const KEncFileHeader * head;
-
-#if SENC_IS_NENC_FOR_WRITER
-    head = self->sra 
-        ? (self->bswap ? &const_bswap_header_sra : &const_header_sra)
-        : (self->bswap ? &const_bswap_header : &const_header);
-#else
-    head = self->bswap ? &const_bswap_header : &const_header;
-#endif
-
-    rc = KEncFileBufferWrite (self, 0, head, sizeof * head, &num_writ);
-    if (rc)
-        LOGERR (klogErr, rc, "Failed to write encrypted file header");
-
-    else
-        /* forced upgrade by writing the header */
-        self->version = eCurrentVersion;
-
-    if (rc == 0)
-        self->has_header = true;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KEncFileWriteHeader_v2  (KFile * self)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcFile, rcWriting, rcSelf, rcNull);
-
-    return KEncFileHeaderWrite ((KEncFile*)self);
-}
-
-
-
-/* ----------------------------------------------------------------------
- * operations on KEncFileFooter
- */
-
-/* ----------
- * Validate
- * we expect to read a Footer when we expect a Block so we validate in RAM
- * without a Read
- *
- * we're just comparing the values in the footer against expected values
- */
-static
-rc_t KEncFileFooterValidate (const KEncFile * self, 
-                             const uint64_t block_count,
-                             const uint64_t crc_checksum)
-{
-    rc_t rc1 = 0, rc2 = 0;
-
-    assert (self);
-
-    if (self->foot.block_count != block_count)
-    {
-        rc1 = RC (rcKrypto, rcFile, rcValidating, rcFile, rcCorrupt);
-        LOGERR (klogErr, rc1, "bad block count in encrypted file footer");
-    }
-    /*
-     * crcs should match or the crc should be 0 and the version is 1
-     */
-    if ((self->foot.crc_checksum != crc_checksum) &&
-        ((self->version == 1) || (crc_checksum != 0)))
-    {
-        rc2 = RC (rcKrypto, rcFile, rcValidating, rcChecksum, rcCorrupt);
-        LOGERR (klogErr, rc2, "bad crc checksum in encrypted file footer");
-    }
-    return (rc1 ? rc1 : rc2);
-}
-
-
-static __inline__
-void KEncFileFooterSwap (const KEncFile * self, KEncFileFooter * foot)
-{
-    assert (self);
-    assert (foot);
-
-    if (self->bswap)
-    {
-        assert (sizeof (foot->block_count) == 8);
-        foot->block_count = bswap_64 (foot->block_count);
-
-        assert (sizeof (foot->crc_checksum) == 8);
-        foot->crc_checksum = bswap_64 (foot->crc_checksum);
-    }
-}
-
-
-/* ----------
- * Read
- * If we know where the footer is we can read it specifically
- */
-static
-rc_t KEncFileFooterRead (KEncFile * self, const uint64_t pos,
-                         const bool validate)
-{
-    union foot_plus
-    {
-        KEncFileFooter foot;
-        uint8_t bytes [sizeof (KEncFileFooter) + 1];
-    } u;
-    size_t num_read;
-    rc_t rc;
-
-    assert ((self->size_known == true) || (self->size_known == false));
-    assert (((self->size_known == true) &&
-             ((pos + sizeof (u.foot)) == self->enc_size)) ||
-            (pos == self->enc_size));
-
-    /* try to read too much just to validate nothing after the footer */
-    rc = KEncFileBufferRead (self, pos, u.bytes, sizeof u.bytes, &num_read);
-    if (rc)
-        PLOGERR (klogErr, (klogErr, rc, "failed to read encrypted file footer "
-                           "at '$(P)'", "P=%lu", pos));
-
-    else if (num_read == sizeof u.foot)
-    {
-        KEncFileFooterSwap (self, &u.foot);
-
-        if (validate)
-            rc = KEncFileFooterValidate (self, u.foot.block_count,
-                                         u.foot.crc_checksum);
-
-        if (rc == 0)
-        {
-            self->foot.block_count = u.foot.block_count;
-            self->foot.crc_checksum = u.foot.crc_checksum;
-        }
-    }
-    else if (num_read < sizeof u.foot)
-        rc = RC (rcKrypto, rcFile, rcReading, rcSize, rcInsufficient);
-
-    else
-    {
-        assert (num_read > sizeof u.foot);
-        rc = RC (rcKrypto, rcFile, rcReading, rcSize, rcExcessive);
-    }
-
-    return rc;
-}
-
-
-/* ----------
- * Write
- * when we write a footer we write from the values in the object.  They
- * are stored in the same object format as the footer so its very simple
- */
-static
-rc_t KEncFileFooterWrite (KEncFile * self)
-{
-    KEncFileFooter foot;
-    uint64_t pos;
-    size_t num_writ;
-    rc_t rc;
-
-    if (self->sought)
-    {
-        self->foot.block_count = foot.block_count = 1 + DecryptedPos_to_BlockId (self->dec_size, NULL);
-        foot.crc_checksum = 0;
-    }
-    else
-        memcpy (&foot, &self->foot, sizeof (foot));
-
-    KEncFileFooterSwap (self, &foot);
-
-    if (self->sought)
-        foot.crc_checksum = 0;
-
-    pos = BlockId_to_EncryptedPos (self->foot.block_count);
-
-    assert ((self->size_known == true) || (self->size_known == false));
-
-/*     if (!(((self->size_known == true) && */
-/*              ((pos + sizeof (foot)) == self->enc_size)) || */
-/*           (pos == self->enc_size))); */
-/*     { */
-/*         KOutMsg ("self->foot.block_count %lu\n",self->foot.block_count); */
-/*         KOutMsg ("self->size_known %u\n",self->size_known); */
-/*         KOutMsg ("pos %lu\n",pos); */
-/*         KOutMsg ("sizeof (foot) %zu\n",sizeof (foot)); */
-/*         KOutMsg ("pos + sizeof (foot) %lu\n", pos + sizeof (foot)); */
-/*         KOutMsg ("self->enc_size %lu\n",self->enc_size); */
-/*     } */
-/*     assert (((self->size_known == true) && */
-/*              ((pos + sizeof (foot)) == self->enc_size)) || */
-/*             (pos == self->enc_size)); */
-
-    rc = KEncFileBufferWrite (self, pos, &foot, sizeof (foot),
-                              &num_writ);
-    if (rc == 0)
-    {
-        if (num_writ != sizeof (foot))
-        {
-            rc = RC (rcFS, rcFile, rcWriting, rcFile, rcInsufficient);
-            LOGERR (klogErr, rc, "faled to write correctly sized fotter "
-                    "for encrypted file");
-        }
-        else
-            assert ((pos + sizeof (foot)) == self->enc_size);
-    }
-    return rc;
-}
-
-
-/* ----------
- * IvecInit
- *    create the ivec for a given block
- *    done in a function to ensure decrypt and encrypt use the same code to
- *    generate this.  Anything used to create this has to be available to
- *    code that doesn't know the content of the data or the state of the file
- *    beyond the location of the block with in the file.
- *
- *    This is definitely over-kill using the MD5.
- */
-static __inline__
-void KEncFileIVecInit (const uint64_t block_id, KEncFileIVec * ivec)
-{
-    BufferCalcMD5 (&block_id, sizeof block_id, ivec->ivec);
-}
-
- 
-/* ----------
- * BlockEncrypt
- *
- * Not thread safe - use of cipher schedules ivec and block key in the ciphers
- *
- * If this function were a protected region where only one thread could be in
- * the body of this function at a time it could be made thread safe.
- */
-static
-rc_t KEncFileBlockEncrypt (KEncFile * self, KEncFileBlock * d,
-                           KEncFileBlock * e)
-{
-    SHA256State state;
-    uint64_t id;
-    uint16_t valid;
-    uint16_t saved_valid;
-    KEncFileCRC crc;
-    KEncFileIVec ivec;
-    rc_t rc;
-
-    assert (self);
-    assert (d);
-    assert (e);
-
-    /*
-     * First we finish preparing the two ciphers by creating the block
-     * user key out of the first part of the data and the shared Initialization
-     * vector for Chained Block Cipher mode encryption out of the block id
-     * 
-     * create the initialization vector for this block
-     */
-    KEncFileIVecInit (d->id, &ivec);
-
-    /*
-     * set the ivec for both the master and data block ciphers
-     */
-    rc = KCipherSetEncryptIVec (self->ciphers.master, &ivec);
-    if (rc)
-        return rc;
-
-    rc = KCipherSetEncryptIVec (self->ciphers.block, &ivec);
-    if (rc)
-        return rc;
-
-    /*
-     * create the block user key out of the first 4kb of data and the block id 
-     */
-    saved_valid = valid = d->u.valid;
-    id = d->id;
-
-    SHA256StateInit (&state);
-    SHA256StateAppend (&state, d->data, 
-                       valid > 4096 ? 4096 : valid);
-    SHA256StateAppend (&state, &id, sizeof (id));
-    SHA256StateFinish (&state, d->key);
-        
-    /*
-     * create the block key schedule out of the block user key
-     */
-    rc = KCipherSetEncryptKey (self->ciphers.block, d->key, sizeof d->key);
-    if (rc)
-        return rc;
-
-    /* 
-     * Salt the block using the randomish user key to randomly select
-     * data from the valid data.
-     *
-     * This will cover the data portion of the block past the last valid
-     * byte.
-     *
-     * NOTE we are accessing a byte array as a word array. COuld be trouble
-     *      on some archaic processors such as the MC68000 family.
-     *
-     * NOTE we are using the array named data to access data beyond it's end
-     *      based on knowledge of the structure of the KEncFileBlock.
-     */
-    {
-        uint16_t * pw;
-        unsigned int windex;
-        unsigned int rindex;
-        size_t bindex;
-
-        pw = (uint16_t*)d->key;
-        windex = 0;
-
-        for (bindex = valid;
-             bindex < sizeof d->data + sizeof d->u; 
-             ++ bindex)
-        {
-            /* this goes beyond the end of the data array by design */
-            rindex = (size_t)pw[windex];
-            rindex %= bindex;
-
-            d->data[bindex] = d->data[rindex];
-        
-            ++rindex;
-            if (rindex >= sizeof self->block.key / sizeof *pw)
-                rindex = 0;
-        }
-    }
-
-    /* 
-     * If we are modifying a block created on a system with a different default
-     * Endian choice we'll need to byte swap the block id and the block valid
-     * count
-     */
-    if (self->bswap)
-    {
-        assert (sizeof id == 8);
-        id = bswap_64 (id);
-
-        assert (sizeof (valid = 2));
-        valid = bswap_16 (valid);
-    }
-
-    /* is this a bswap problem? */
-    if (saved_valid == sizeof d->data)
-        d->u.valid |= valid;
-    else
-        d->u.valid = valid;
-
-    e->id = id;
-
-    /* 
-     * encrypt the block user key into the buffer
-     */
-#if 0
-    {
-        unsigned iii;
-        KOutMsg ("v2 decrypted key %lu\n", d->id);
-        for (iii = 0; iii < sizeof (d->key); +++ iii) 
-            KOutMsg ("%2.2x ", d->key[iii]);
-        KOutMsg ("\n");
-    }
-#endif
-    rc = KCipherEncryptCBC (self->ciphers.master, d->key, e->key,
-                            sizeof (d->key) / sizeof (ivec));
-    if (rc)
-        return rc;
-#if 0
-    {
-        unsigned iii;
-        KOutMsg ("v2 encrypted key\n");
-        for (iii = 0; iii < sizeof (e->key); +++ iii) 
-            KOutMsg ("%2.2x ", e->key[iii]);
-        KOutMsg ("\n");
-    }
-#endif
-    /*
-     * encrypt the data, offset and valid values
-     */
-    rc = KCipherEncryptCBC (self->ciphers.block, 
-                            d->data, e->data,
-                            (sizeof d->data + sizeof d->u) / sizeof (ivec));
-    if (rc)
-        return rc;
-
-    d->u.valid = saved_valid;
-
-    crc = CRC32 (0, e, (char*)(&e->crc)-(char*)e);
-
-    self->block.crc = crc;
-
-    if (self->bswap)
-    {
-        assert (sizeof crc == 4);
-        crc = bswap_32 (crc);
-    }
-    e->crc_copy = e->crc = crc;
-
-/*     KOutMsg ("%s: %lu %lu %lu ", __func__, self->foot.block_count, self->foot.crc_checksum,self->block.id); */
-    if (self->foot.block_count <= self->block.id)
-        self->foot.block_count = self->block.id + 1;
-
-    if (!self->sought)
-        self->foot.crc_checksum += crc;
-
-/*     KOutMsg ("%lu %lu\n", __func__, self->foot.block_count, self->foot.crc_checksum); */
-
-    return 0;
-}
-
-
-/* ----------
- * BlockDecrypt
- *   decrypt decrypts the data from a KEncFileBlock into the KEncFileBlock
- *   in the KEncFile object
- *
- * Not thread safe - use of cipher schedules ivec and block key in the ciphers
- *
- * If this function were a protected region where only one thread could be in
- * the body of this function at a time it could be made thread safe.
- */
-static
-rc_t KEncFileBlockDecrypt (KEncFile * self, KEncFileBlockId bid,
-                           const KEncFileBlock * e, KEncFileBlock * d)
-{
-    KEncFileIVec ivec;
-    rc_t rc;
-
-    d->id = e->id;
-
-    /* create the initialization vector for this block */
-    KEncFileIVecInit (bid, &ivec);
-
-    /*
-     * set the ivec for both the master and data block ciphers
-     */
-    rc = KCipherSetDecryptIVec (self->ciphers.master, &ivec);
-    if (rc)
-        return rc;
-
-    rc = KCipherSetDecryptIVec (self->ciphers.block, &ivec);
-    if (rc)
-        return rc;
-
-    /* 
-     * decrypt the block key and initial vector using the user key and 
-     * the computer ivec
-     */
-    rc = KCipherDecryptCBC (self->ciphers.master, e->key, d->key,
-                            (sizeof e->key) / sizeof ivec);
-    if (rc)
-        return rc;
-
-    /* 
-     * now create the AES key for the block from the newly decrypted 
-     * block key
-     */
-    rc = KCipherSetDecryptKey (self->ciphers.block, d->key,
-                               sizeof d->key);
-    if (rc)
-        return rc;
-
-    rc = KCipherDecryptCBC (self->ciphers.block, e->data, d->data,
-                            (sizeof e->data + sizeof e->u) / sizeof ivec);
-    if (rc)
-        return rc;
-
-    if (self->bswap)
-    {
-        assert (sizeof d->u.valid == 2);
-        d->u.valid = bswap_16 (d->u.valid);
-    }
-
-    if (d->u.valid >= sizeof d->data)
-        d->u.valid = sizeof d->data;
-    else
-        memset (d->data + d->u.valid, 0, sizeof d->data - d->u.valid);
-
-    return rc;
-}
-
-
-/*
- * if not decrypting block can be NULL
- */
-
-/*
-  TBD: figure out rational way to handle bad password making blocks look really weird
-  If we have one that looks like a partial but isn't the last block -what do we do?
-*/
-
-static
-rc_t KEncFileBlockRead (KEncFile * self, KEncFileBlock * block, 
-                        KEncFileBlockId block_id, bool validate)
-{
-    union
-    {
-        KEncFileBlock b;
-        KEncFileFooter f;
-    } u;
-    size_t num_read;
-    uint64_t epos, dpos;
-    rc_t vrc, rc = 0;
-    bool missing;
-
-    assert (self);
-    assert ((validate == false) || (validate == true));
-    /* we should be decrypting or validating - maybe both */
-    assert ((block != NULL) || (validate == true));
-
-    /* translate block id into both encrypted and decrypted addresses */
-    epos = BlockId_to_EncryptedPos (block_id);
-    dpos = BlockId_to_DecryptedPos (block_id);
-
-    missing = false;
-
-    /* clear out target block */
-    if (block != NULL)
-        memset (block, 0, sizeof * block);
-
-    rc = KEncFileBufferRead (self, epos, &u.b, sizeof u.b, &num_read);
-    if (rc)
-    {
-        PLOGERR (klogErr, (klogErr, rc, "Failure to read block '$(B)' at '$(E)'"
-                           " in encrypted file decrypted at '$(D)",
-                           "B=%lu,E=%lu,D=%lu", block_id, epos, dpos));
-    }
-    else
-    {
-        switch (num_read)
-        {
-        case 0:
-            self->eof = true;
-            /* ain't got no block here */
-            break;
-
-        default:
-            /* Invalid size */
-            rc = RC (rcKrypto, rcFile, rcReading, rcBuffer, rcInsufficient);
-            PLOGERR (klogErr, (klogErr, rc, "Failure to read full block '$(B)' "
-                               "at '$(E)' in encrypted file decrypted at '$(D)",
-                               "B=%lu,E=%lu,D=%lu", block_id, epos, dpos));
-            break;
-
-        case sizeof (u.f):
-            /* footer */
-            if (validate) /* validate before checking as missing */
-            {
-                KEncFileFooterSwap (self, &u.f);
-
-                if (u.f.block_count != block_id)
-                {
-                    vrc = RC (rcKrypto, rcFile, rcValidating, rcSize,
-                              rcIncorrect);
-                    PLOGERR (klogErr,  (klogErr, vrc, "read footer block count "
-                                        "'$(B)' does not match actual block "
-                                        "count '$(A)'", "B=%lu,A=%lu",
-                                        u.f.block_count, block_id));
-                    if ( rc == 0 )
-                        rc = vrc;
-                }
-                vrc = KEncFileFooterValidate (self, u.f.block_count,
-                                              u.f.crc_checksum);
-
-#if 1
-                if ( rc == 0 )
-                    rc = vrc;
-#else
-                /* what is the significance of a NULL block? */
-                if (block == NULL)
-                    rc = vrc;
-#endif
-            }
-
-            /* is it a "missing" footer? */
-            /* or if the footer appears invalid - make it "valid" */
-            if (((missing = BufferAllZero(&u.f, sizeof u.f)) == true) ||
-                (self->foot.block_count != block_id))
-            {
-/*                 self->foot.block_count = block_id; */
-                self->foot.crc_checksum = 0;
-            }
-
-            /* force some values though they might already be known */
-            self->enc_size = epos + sizeof u.f;
-            self->size_known = true;
-            self->dec_size = dpos;
-            self->eof = true;
-            break;
-
-        case sizeof (u.b):
-            /* block */
-            self->eof = false;
-            /* is it a "missing" block? */
-            if ((missing = BufferAllZero(&u.b, sizeof u.b)) == true)
-            {
-                if (validate)
-                {
-                    vrc = RC (rcKrypto, rcFile, rcValidating,
-                                   rcData, rcNull);
-
-                    PLOGERR (klogErr, (klogErr, vrc, "read missing block at "
-                                       "block number '$(I)' encrypted position "
-                                       "$(E) decrypted postion $(D)",
-                                       "I=%lu,E=%lu,D=%lu", block_id, epos,
-                                       dpos));
-                    if ( rc == 0 )
-                        rc = vrc;
-                }
-                u.b.id = block_id;
-                u.b.u.valid = sizeof u.b.data;
-
-                /* if we can only learn of the size by reading and are thus scanning
-                 * through the current decrypt position must be the current known
-                 * decrypted side size
-                 */
-                if (!self->size_known)
-                {
-                    assert (dpos == self->dec_size);
-                    self->dec_size = dpos + sizeof u.b.data;
-                }
-                /*
-                 * if we know the decrypted size and it is less than what we
-                 * read, adjust the valid.  BUT this must not be for the block read
-                 * for the last block to know the decrypted size. A chicken and egg
-                 * problem.
-                 */
-                else if ((self->dec_size >= dpos) &&
-                         (self->dec_size < dpos + sizeof u.b.data))
-                    u.b.u.valid  = (uint16_t)(self->dec_size - dpos);
-            }
-
-            /* we read a full block that wasn't all zeroes */
-            else
-            {
-                /* since we've chosen not to standardize the file format byte ordering */
-                if (self->bswap)
-                {
-                    assert (sizeof u.b.crc == 4);
-                    u.b.crc = bswap_32 (u.b.crc);
-                    u.b.crc_copy = bswap_32 (u.b.crc_copy);
-
-                    assert (sizeof u.b.id == 8);
-                    u.b.id = bswap_64 (u.b.id);
-                }
-
-                if (validate)
-                {
-                    uint32_t crc;
-
-                    if (block_id != u.b.id)
-                    {
-                        vrc = RC (rcKrypto, rcFile, rcValidating, rcIndex,
-                                  rcIncorrect);
-                        PLOGERR (klogErr, (klogErr, vrc, "error validating id "
-                                           "for block '$(BID)' is not $(C2)", 
-                                           "BID=%lu,C2=%lu", block_id, u.b.id));
-                        if ( rc == 0 )
-                            rc = vrc;
-                    }
-
-                    crc = CRC32 (0, &u.b, (char*)&u.b.crc - (char*)&u.b);
-
-                    if (crc != u.b.crc)
-                    {
-                        vrc = RC (rcKrypto, rcFile, rcValidating, rcCrc, rcCorrupt);
-                        PLOGERR (klogErr,
-                                 (klogErr,
-                                  vrc,
-                                  "error validating crc for block '$(BID)' $(C1) is not $(C2)", 
-                                  "BID=%lu,C1=0x%X,C2=0x%X", block_id,
-                                  crc, u.b.crc));
-                        if ( rc == 0 )
-                            rc = vrc;
-                    }
-                    if (crc != u.b.crc_copy)
-                    {
-                        vrc = RC (rcKrypto, rcFile, rcValidating, rcCrc, rcCorrupt);
-                        PLOGERR (klogErr,
-                                 (klogErr,
-                                  vrc,
-                                  "error validating crc_copy for block '$(BID)' $(C1) is not $(C2)", 
-                                  "BID=%lu,C1=0x%X,C2=0x%X", block_id,
-                                  crc, u.b.crc_copy));
-                        if ( rc == 0 )
-                            rc = vrc;
-                    }
-                }
-            }
-            if (self->sought == false)
-            {
-                if (block_id == 0)
-                {
-                    self->foot.block_count = 1;
-                    self->foot.crc_checksum = u.b.crc;
-                }
-                else
-                {
-                    ++self->foot.block_count;
-                    self->foot.crc_checksum += u.b.crc;
-                }
-            }
-
-            if (block != NULL)
-            {
-                if (missing)
-                {
-                    if (self->dad.write_enabled == false)
-                        rc = RC (rcKrypto, rcFile, rcReading, rcData, rcIncomplete);
-                    else
-                    {
-                        memcpy (block, &u.b, sizeof u.b);
-                        rc = 0;
-                    }
-                }
-                else
-                {
-                    rc = KEncFileBlockDecrypt (self, block_id, &u.b, block);
-                    if (rc == 0)
-                    {
-                        if (block_id == 0)
-                        {
-                            rc_t sra = KFileIsSRA ((const char *)block->data, block->u.valid);
-                            self->sra =  (sra == 0);
-                        }
-
-                        if (!self->size_known)
-                        {
-                            assert (dpos == self->dec_size);
-                            self->dec_size = dpos + sizeof u.b.u.valid;
-                            if (u.b.u.valid != sizeof u.b.data)
-                            {
-                                self->size_known = true;
-                                self->enc_size = epos + sizeof u.b + sizeof self->foot;
-                            }
-                        }
-                    }
-                }
-            }
-            break;
-        }
-    }
-    return rc;
-}
-
-
-/*
- * Take a dirty block, encrypt it and write it to the backing file
- */
-static
-rc_t KEncFileBlockFlush (KEncFile * self, KEncFileBlock * dec_block)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (dec_block);
-
-
-    if (dec_block->id == 0)
-    {
-        rc = KFileIsSRA ((const char *)(dec_block->data), sizeof (KSraHeader));
-
-        /* we wait ALL the way until we try to flush the first block before we set
-         * the sra flag for write only files.
-         * we get it when we read the first block otherwise.
-         */
-        if (self->sra != (rc == 0))
-        {
-            self->sra = (rc == 0);
-            self->has_header = false;
-        }
-    }
-    if ((dec_block->id == 0) || (self->seekable))
-    {
-        if (!self->has_header)
-        {
-            if (!self->swarm)
-            {
-                rc = KEncFileHeaderWrite (self);
-                if (rc)
-                    return rc;
-            }
-            else if (dec_block->id == 0)
-                self->enc_size = sizeof (KEncFileHeader);
-        }
-    }
-
-/*     if (self->dirty) */
-    {
-        KEncFileBlock enc_block;
-
-        rc = KEncFileBlockEncrypt (self, dec_block, &enc_block);
-        if (rc == 0)
-        {
-            KEncFileBlockId block_id;
-            uint64_t pos;
-            size_t num_writ;
-
-            block_id = dec_block->id;
-
-            pos = BlockId_to_EncryptedPos (block_id);
-
-            rc = KEncFileBufferWrite (self, pos, &enc_block, sizeof enc_block,
-                                      &num_writ);
-
-            if (rc)
-                PLOGERR (klogErr, (klogErr, rc,
-                                   "error writing encrypted block '$(B)'",
-                                   "B=%lu", block_id));
-
-            else if (num_writ != sizeof enc_block)
-            {
-                rc = RC (rcKrypto, rcFile, rcWriting, rcBuffer, rcInsufficient);
-                PLOGERR (klogErr, (klogErr, rc, "error writing encrypted block "
-                                   "'$(B)' wrote '$(Z)' not '$(Y)'",
-                                   "B=%lu, Z=%zu", block_id, num_writ,
-                                   sizeof enc_block));
-            }
-            else
-                self->dirty = false;
-        }
-    }
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Interface Functions
- *
- * Destroy
- *
- */
-static
-rc_t CC KEncFileDestroy (KEncFile *self)
-{
-    rc_t rc1 = 0;
-    rc_t rc2 = 0;
-    rc_t rc3 = 0;
-    rc_t rc4 = 0;
-    rc_t rc5 = 0;
-    rc_t rc6 = 0;
-
-    assert (self);
-
-    if (self->dad.write_enabled)
-    {
-        /*
-         * write the header if we've written nothing to an empty file
-         * or if we've written something which will mean a change to v2
-         * of the encrypted file format
-         */
-        if ((self->enc_size == 0) || (self->seekable && self->changed) ||
-            (self->has_header == false))
-            rc1 = KEncFileHeaderWrite (self);
-
-        /* write any dirty block */
-        if (self->dirty)
-            rc2 = KEncFileBlockFlush (self, &self->block);
-
-        /* [re]write footer */
-        if (self->changed)
-            rc3 = KEncFileFooterWrite (self);
-    }
-    rc4 = KFileRelease (self->encrypted);
-    rc5 = KCipherRelease (self->ciphers.master);
-    rc6 = KCipherRelease (self->ciphers.block);
-
-    free (self);
-    
-    if (rc1)
-        return rc1;
-    if (rc2)
-        return rc2;
-    if (rc3)
-        return rc3;
-    if (rc4)
-        return rc4;
-    if (rc5)
-        return rc5;
-    return rc6;
-}
-
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We do not allow this for read, write or update as you can not memory map the 
- * unencrypted file in a meaningful way.
- */
-static
-struct KSysFile *CC KEncFileGetSysFile (const KEncFile *self, uint64_t *offset)
-{
-    assert (self);
-    assert (offset);
-
-    return NULL;
-}
-
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KEncFileRandomAccess (const KEncFile *self)
-{
-    assert (self != NULL);
-    assert ((self->seekable == true) || (self->seekable == false));
-
-    /* we checked for random access in the contructor */
-    if (self->seekable)
-        return 0;
-
-    return RC (rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KEncFileSize (const KEncFile *self, uint64_t *size)
-{
-    if (!self->size_known)
-        return RC (rcKrypto, rcFile, rcAccessing, rcSize, rcUnsupported);
-
-    *size = self->dec_size;
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- *
- * This is the size of the decrypted payload not of the encrypted file
- */
-static
-rc_t KEncFileSetSizeBlockFull (KEncFile *self, uint64_t block_id)
-{
-    if ((self->block.id == block_id) && (self->block.u.valid != 0))
-    {
-        if (self->block.u.valid < sizeof self->block.data)
-        {
-            self->block.u.valid = sizeof self->block.data;
-            self->dirty = true;
-        }
-        else
-            assert (self->block.u.valid  == sizeof self->block.data);
-    }
-    else
-    {
-        KEncFileBlock block;
-        rc_t rc;
-
-        rc = KEncFileBlockRead (self, &block, block_id, false);
-        if (rc)
-            return rc;
-
-/*         if (self->block.u.valid  != sizeof self->block.data) */
-/*         { */
-/*             OUTMSG (("%s: %u %u\n", __func__,self->block.u.valid,sizeof self->block.data)); */
-/*             OUTMSG (("%s: %lu %lu\n", __func__,self->block.id,block_id)); */
-/*         } */
-
-        /* only change block if not "missing" */
-        if (BufferAllZero (&block, sizeof block) == false)
-        {
-            assert (block.id == block_id);
-
-            /* only change if not already full - shouldnt get here if not? */
-            if (block.u.valid < sizeof block.data)
-            {
-                self->changed = self->sought = true;
-                block.u.valid = sizeof block.data;
-
-                rc = KEncFileBlockFlush (self, &block);
-                if (rc)
-                    return rc;
-            }
-            else
-                assert (self->block.u.valid  == sizeof self->block.data);
-        }
-    }
-    return 0;
-}
-
-
-static
-rc_t KEncFileSetSizeBlockPartial (KEncFile *self, uint64_t block_id, uint32_t valid)
-{
-    if ((self->block.id == block_id) && (self->block.u.valid != 0))
-    {
-        if (self->block.u.valid != valid)
-        {
-            self->block.u.valid = valid;
-            self->dirty = true;
-        }
-    }
-    else
-    {
-        KEncFileBlock block;
-        rc_t rc;
-
-        rc = KEncFileBlockRead (self, &block, block_id, false);
-        if (rc)
-            return rc;
-
-        /* only change block if not "missing" */
-        if (BufferAllZero (&block, sizeof block) == false)
-        {
-            assert (block.id == block_id);
-
-            if (block.u.valid != valid)
-            {
-                self->changed = self->sought = true;
-                block.u.valid = valid;
-                
-                rc = KEncFileBlockFlush (self, &block);
-                if (rc)
-                    return rc;
-            }
-        }
-    }
-    return 0;
-}
-
-
-static
-rc_t KEncFileSetSizeInt (KEncFile *self, uint64_t dec_size)
-{
-    uint64_t trim_size = 0;
-    uint64_t enc_size;
-    bool do_size = true;
-
-    rc_t rc = 0;
-
-    /* should we not have been called? */
-    if ((dec_size == self->dec_size) && (self->enc_size != 0))
-        return 0;
-
-    /* if wiping out the whole file */
-    if (dec_size == 0)
-    {
-        trim_size = sizeof (KEncFileHeader);
-        enc_size = (sizeof (KEncFileHeader) + sizeof (KEncFileFooter));
-
-        /* if we did clear out the RAM structures to match */
-        memset (&self->block, 0, sizeof self->block);
-        memset (&self->foot, 0, sizeof self->foot);
-        self->dirty = false;
-        self->size_known = true;
-        self->bswap = false;
-        self->changed = true;
-        self->sought = false;
-        self->has_header = false;
-        self->version = eCurrentVersion;
-    }
-    else
-    {
-        KEncFileBlockId new_bid;    /* block id of new last block */
-        KEncFileBlockId new_fid;    /* block id of new footer / block count */
-        uint32_t        new_doff;   /* bytes into last partial block */
-
-        /*
-         * determine sizes of decrypted virtual file
-         * and encrypted 'real' file
-         */
-        new_fid = new_bid = DecryptedPos_to_BlockId (dec_size, &new_doff);
-        if (new_doff == 0)
-            --new_bid; /* exactly fills a block */
-        else
-            ++new_fid;  /* leaves a partial block */
-    
-        enc_size = BlockId_to_EncryptedPos (new_fid) + sizeof self->foot;
-
-        /* are we starting with an empty file? It's easy if we are */
-        if (self->dec_size == 0)
-        {
-            trim_size = sizeof (KEncFileHeader);
-
-            /* if we did clear out the RAM structures to match */
-            memset (&self->block, 0, sizeof self->block);
-            self->bswap = false;
-            self->changed = true;
-            self->version = eCurrentVersion;
-        }
-        else
-        {
-            KEncFileBlockId old_bid;    /* block id of old last block */
-            KEncFileBlockId old_fid;    /* block id of old footer / block count */
-            uint32_t        old_doff;   /* bytes into last partial block */
-
-            old_fid = old_bid = DecryptedPos_to_BlockId (self->dec_size, &old_doff);
-            if (old_doff == 0)
-                --old_bid; /* exactly fills a block */
-            else
-                ++old_fid;  /* leaves a partial block */
-
-            /* are we only changing the last block? */
-            if (old_bid == new_bid)
-            {
-                assert ((self->dad.read_enabled == false) || (self->enc_size == enc_size));
-
-                if (new_doff == 0)
-                    rc = KEncFileSetSizeBlockFull (self, new_bid);
-                else
-                    rc = KEncFileSetSizeBlockPartial (self, new_bid, new_doff);
-                do_size = false;
-            }
-            else
-            {
-
-                /* truncating the file? */
-                if (dec_size < self->dec_size)
-                {
-                    trim_size = BlockId_to_EncryptedPos (new_fid);
-
-                    /* do we throw away the block in the object? */
-                    if (self->block.id > new_bid)
-                    {
-                        self->dirty = false;
-                        memset (&self->block, 0, sizeof self->block);
-                    }
-
-                    /* we only change the new last block if its now partial */
-                    if (new_doff)
-                        rc = KEncFileSetSizeBlockPartial (self, new_bid, new_doff);
-
-                }
-                /* expanding the file */
-                else
-                {
-                    assert (dec_size > self->dec_size);
-
-                    trim_size = BlockId_to_EncryptedPos (old_fid);
-
-                    /* make old last block a full block if it wasn't already */
-                    if (old_doff != 0)
-                        rc = KEncFileSetSizeBlockFull (self, old_bid);
-                }
-            }
-        }
-    }
-    if (rc == 0)
-    {
-        if (do_size)
-        {
-            rc = KFileSetSize (self->encrypted, trim_size);
-            if (rc)
-                LOGERR (klogErr, rc, "failure to trim size of encrpted file");
-            else
-            {
-                rc = KFileSetSize (self->encrypted, enc_size);
-                if (rc)
-                    LOGERR (klogErr, rc, "failure to file size of encrpted file");
-            }
-        }
-        if (rc == 0)
-        {
-            self->enc_size = enc_size;
-            self->dec_size = dec_size;
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t CC KEncFileSetSize (KEncFile *self, uint64_t dec_size)
-{
-    assert (self);
-    assert (self->encrypted);
-
-    if (self->dad.write_enabled == false)
-        return RC (rcKrypto, rcFile, rcResizing, rcFile, rcNoPerm);
-
-    if ((self->seekable == false) || (self->size_known == false))
-        return RC(rcKrypto, rcFile, rcAccessing, rcFunction, rcUnsupported);
-
-    /* silently ignore changes in size that don't change the size */
-    if (dec_size == self->dec_size)
-        return 0;
-
-    else
-        return KEncFileSetSizeInt (self, dec_size);
-}
-
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KEncFileRead (const KEncFile *cself,
-                      uint64_t pos,
-                      void *buffer,
-                      size_t bsize,
-                      size_t *num_read)
-{
-    KEncFile * self = (KEncFile *)cself; /* mutable values */
-    uint64_t max_bid;
-    uint64_t block_id;
-    uint32_t offset;
-    rc_t rc = 0;
-
-    assert (self); /* checked in file.c KFileRead() */
-    /* pos can be 'anything' */
-    assert (buffer); /* checked in file.c KFileRead() */
-    assert (bsize); /* checked in file.c KFileRead() */
-    assert (num_read); /* checked in file.c KFileRead() */
-
-    assert (self->dad.read_enabled);
-    assert (self->encrypted);
-
-    /* do we have a decrypted_size? */
-
-    block_id = DecryptedPos_to_BlockId (pos, &offset);
-
-    switch (self->size_known)
-    {
-    case false:
-
-        max_bid = EncryptedPos_to_BlockId (self->enc_size, NULL, NULL);
-
-        /* if past end of file as we know it so far quick out */
-        if (max_bid <= block_id)
-            return 0;
-        break;
-
-    case true:
-        /* if past end of file quick out */
-        if (pos > self->dec_size)
-            return 0;
-        break;
-
-    default:
-        assert (self->size_known);
-        break;
-    }
-
-    /*
-     * are we on the wrong block?
-     * Or are do we need to read the first block?
-     */
-    if ((block_id != self->block.id) || (self->block.u.valid == 0))
-    {
-        if ((!self->seekable) && (self->block.id + 1 != block_id))
-        {
-            rc = RC (rcFS, rcFile, rcReading, rcOffset, rcIncorrect);
-            PLOGERR (klogErr, (klogErr, rc, "attempt to seek in encryption write at"
-                               " '$(O)' seek to '$(P)'", "O=%lu,P=%lu",
-                               BlockId_to_EncryptedPos(self->block.id), pos));
-        }
-        else
-        {
-            /* flush any dirty block */
-            if (self->dirty)
-            {
-                assert (self->dad.write_enabled);
-                rc = KEncFileBlockFlush (self, &self->block);
-            }
-
-            /* now try to read in a new block */
-            if (rc == 0)
-                rc = KEncFileBlockRead (self, &self->block, block_id, false);
-
-            if (rc == 0)
-            {
-                uint64_t read_max;
-
-                read_max = BlockId_to_DecryptedPos(block_id) + self->block.u.valid;
-                if (self->dec_size < read_max)
-                    self->dec_size = read_max;
-            }
-        }
-    }
-
-    /*
-     * if we are trying to read past the end of the file 
-     * return 0 with nothing read
-     */
-    if ((rc == 0) &&
-        (block_id == self->block.id) &&
-        (offset < self->block.u.valid))
-    {
-        size_t to_copy;
-
-        to_copy = self->block.u.valid - offset;
-        if (to_copy > bsize)
-            to_copy = bsize;
-
-        memmove (buffer, self->block.data + offset, to_copy);
-        *num_read = to_copy;
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t CC KEncFileWrite (KEncFile *self, uint64_t pos,
-                       const void *buffer, size_t bsize,
-                       size_t *pnum_writ)
-{
-    rc_t rc = 0;
-
-    assert (self);
-    assert (buffer);
-    assert (bsize > 0);
-    assert (pnum_writ);
-
-    assert (self->dad.write_enabled);
-    assert (self->encrypted);
-
-/*     KOutMsg ("+++++\n%s: pos %lu\n",__func__,pos); */
-
-    if (self->dec_size != pos)
-    {
-        /* write only does not allow seeks */
-        if ((!self->dad.read_enabled) && (!self->swarm))
-        {
-            rc = RC (rcFS, rcFile, rcWriting, rcOffset, rcIncorrect);
-            PLOGERR (klogErr, (klogErr, rc, "attempt to seek in encryption write at"
-                               " '$(O)' seek to '$(P)'", "O=%lu,P=%lu",
-                               BlockId_to_EncryptedPos(self->block.id), pos));
-        }
-        else
-            self->sought = true;
-    }
-    if (rc == 0)
-    {
-        uint64_t block_id;
-        uint32_t offset;
-        uint64_t block_max;
-        uint64_t new_size;
-
-        rc = 0;
-        /* Block Id for this write */
-        block_id = DecryptedPos_to_BlockId (pos, &offset);
-
-        block_max = BlockId_to_DecryptedPos (block_id+1);
-
-        new_size = pos + bsize;
-        if (new_size > block_max)
-            bsize = block_max - new_size;
-
-
-        /* is the new position beyond the current file length? */
-        if ((new_size > self->dec_size) && (self->dad.read_enabled) && (!self->swarm))
-        {
-            rc = KEncFileSetSizeInt (self, new_size);
-            if (rc)
-                return rc;
-        }
-
-        /* are we going to a new block? */
-        if ((block_id != self->block.id) || (self->block.u.valid == 0))
-        {
-            /* do we have sometihng to flush first? */
-            if (self->dirty)
-            {
-                assert (self->dad.write_enabled);
-                rc = KEncFileBlockFlush (self, &self->block);
-            }
-
-            if (rc == 0)
-            {
-                /* if we are going to over write the whole block */
-                if ((!self->dad.read_enabled) ||
-                    ((offset == 0) && (bsize >= sizeof (self->block.data))))
-                {
-                    memset (&self->block, 0, sizeof self->block);
-                    self->block.id = block_id;
-                }
-                /* else try to fetch an existing block */
-                else
-                    rc = KEncFileBlockRead (self, &self->block, block_id, false);
-            }
-        }
-
-        if (rc == 0)
-        {
-            /* we are at the right block and ready to write */
-            uint32_t new_valid;
-            size_t to_copy;
-
-            /*
-             * force block id to be right even if fetch was beyond end of 
-             * existing file
-             */
-            self->block.id = block_id;
-
-/*             to_copy = sizeof self->block.data - self->block.u.valid; */
-            to_copy = sizeof self->block.data - offset;
-
-            if (to_copy > bsize)
-                to_copy = bsize;
-
-            memmove (self->block.data + offset, buffer, to_copy);
-            self->dirty = true;
-            *pnum_writ = to_copy;
-
-            new_valid = offset + to_copy;
-            if (new_valid > self->block.u.valid)
-            {
-                uint64_t new_size;
-
-                self->block.u.valid = new_valid;
-
-                new_size = pos + to_copy;
-                if (new_size > self->dec_size)
-                    self->dec_size = new_size;
-            }
-
-            if (self->swarm)
-                rc = KEncFileBlockFlush (self, &self->block);
-
-
-        }
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- *
- * Just return what the backing file says...
- */
-static
-uint32_t CC KEncFileType (const KEncFile *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    return KFileType (self->encrypted);
-}
-
-
-/* ----------------------------------------------------------------------
- * KEncFileMake
- *  create a new file object
- */
-
-/* ----------
- * KeysInit
- */
-static
-rc_t KEncFileCiphersInit (KEncFile * self, const KKey * key, bool read, bool write)
-{
-    KCipherManager * mgr;
-    size_t z;
-    rc_t rc;
-
-    switch ( key->type)
-    {
-    default:
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcInvalid);
-
-    case kkeyNone:
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcIncorrect);
-
-    case kkeyAES128:
-        z = 128/8; break;
-
-    case kkeyAES192:
-        z = 192/8; break;
-
-    case kkeyAES256:
-        z = 256/8; break;
-    }
-    rc = KCipherManagerMake (&mgr);
-    if (rc == 0)
-    {
-        rc = KCipherManagerMakeCipher (mgr, &self->ciphers.master, kcipher_AES);
-        if (rc == 0)
-        {
-            rc = KCipherManagerMakeCipher (mgr, &self->ciphers.block, kcipher_AES);
-            if (rc == 0)
-            {
-                rc = KCipherSetDecryptKey (self->ciphers.master, key->text, z);
-                if (rc == 0)
-                {
-                    rc = KCipherSetEncryptKey (self->ciphers.master, key->text, z);
-                    if (rc == 0)
-                        goto keep_ciphers;
-                }
-                KCipherRelease (self->ciphers.block);
-                self->ciphers.block = NULL;
-            }
-            KCipherRelease (self->ciphers.master);
-            self->ciphers.master = NULL;
-        }
-    keep_ciphers:
-        KCipherManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-
-static const KFile_vt_v1 vtKEncFile =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KEncFileDestroy,
-    KEncFileGetSysFile,
-    KEncFileRandomAccess,
-    KEncFileSize,
-    KEncFileSetSize,
-    KEncFileRead,
-    KEncFileWrite,
-    
-    /* 1.1 */
-    KEncFileType
-};
-
-
-static
-rc_t  KEncFileMakeIntValidSize (uint64_t enc_size, bool w)
-{
-
-    if (enc_size == 0)
-    {
-        if (w)
-            return 0;
-    }
-    else
-    {
-        uint64_t min_size = sizeof (KEncFileHeader) + sizeof (KEncFileFooter);
-        uint64_t block_count;
-
-        if (enc_size >= min_size)
-        {
-            block_count = EncryptedPos_to_BlockId (enc_size, NULL, NULL);
-
-            if (enc_size - BlockId_to_EncryptedPos (block_count) == sizeof (KEncFileFooter))
-                return 0;
-        }
-    }
-    return RC (rcKrypto, rcFile, rcConstructing, rcSize, rcIncorrect);
-}
-
-
-/* ----------
- * MakeInt
- *    common make for all encryptor/decryptors
- */
-static
-rc_t KEncFileMakeInt (KEncFile ** pself, KFile * encrypted,
-                      bool r, bool w, bool v, bool s)
-{
-    uint64_t enc_size;
-    rc_t rc = 0, orc;
-    bool seekable;
-    bool size_known;
-
-    assert (pself);
-    assert (encrypted);
-    assert (((r == true) || (r == false)) &&
-            ((w == true) || (w == false)) &&
-            ((v == true) || (v == false)));
-
-    /* must be able to do at elast one of read and write */
-    assert (r || w);
-
-    /* expecting to validate read only right now */
-/*     assert ((v && r && !w) || (!v)); */
-
-    if (w && ! encrypted->write_enabled)
-    {
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcFile, rcReadonly);
-        LOGERR (klogErr, rc, "Can not make a encryptor for a unwritable file");
-    }
-    if (r && ! encrypted->read_enabled)
-    {
-        orc = RC (rcKrypto, rcFile, rcConstructing, rcFile, rcWriteonly);
-        LOGERR (klogErr, orc, "Can not make a decryptor for an unreadable file");
-        if (rc == 0)
-            rc = orc;
-    }
-    if (rc)
-        return rc;
-
-    /* determine whether the original file can tell us the size */
-    rc = KFileSize (encrypted, &enc_size);
-    if (rc == 0)
-        size_known = true;
-
-    else if (GetRCState(rc) == rcUnsupported)
-        size_known = false;
-    
-    else
-        return rc;
-
-    if (!v && size_known)
-    {
-        rc = KEncFileMakeIntValidSize (enc_size, w);
-        if (rc)
-            return rc;
-    }
-
-    /* determine whether the original file allows seeks */
-    rc = KFileRandomAccess (encrypted);
-    if (rc == 0)
-        seekable = true;
-
-    else if (GetRCState(rc) == rcUnsupported)
-        seekable = false;
-
-    else
-    {
-        LOGERR (klogErr, rc, "error checking random access building "
-                "encrypted file");
-        return rc;
-    }
-
-    /* We are currently only supporting update on seekable and size_known original files */
-    if (r && w && ((!seekable) || (!size_known)))
-    {
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcFile, rcIncorrect);
-        LOGERR (klogErr, rc, "encryptor/decryptor requires seek and size ability");
-        return rc;
-    }
-
-    rc = KFileAddRef (encrypted);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Could not add reference to encrypted file");
-        return rc;
-    }
-    else
-    {
-        KEncFile * self;
-
-        /* allocate and zero out an object since we want much of it to be zeroed */
-        self = calloc (1, sizeof *self);
-        if (self == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-            LOGERR (klogSys, rc,
-                    "out of memory creating encryptor and/or decryptor");
-        }
-        else
-        {
-            /* all KFiles get this initialization */
-            rc = KFileInit (&self->dad, (const KFile_vt*)&vtKEncFile, "KEncFile", "no-name", r, w);
-            if (rc)
-                LOGERR (klogInt, rc, "error with init for encrypted file");
-
-            else
-            {
-                self->encrypted = encrypted;
-                self->swarm = s;
-
-                /* write only or empty updatable */
-                if ((!r) || (w && size_known && (enc_size == 0)))
-                {
-                    /* dummy size to make the SetSizeInt work */
-                    self->enc_size = enc_size;
-                    rc = KEncFileSetSizeInt (self, 0);
-                    self->seekable = r && seekable;
-                }
-                else
-                {
-                    self->enc_size = enc_size;
-                    self->seekable = seekable;
-                    self->size_known = size_known;
-                    rc = KEncFileHeaderRead (self);
-                }
-                if (rc == 0)
-                {
-                    *pself = self;
-                    return 0;
-                }
-            }
-            free (self);
-        }
-        KFileRelease (encrypted);
-    }
-    return rc;
-}
-
-
-static
-rc_t KEncFileMakeSize (KEncFile *self)
-{
-    KEncFileBlockId fid;
-    rc_t rc;
-
-    assert (self->seekable);
-
-    /*
-     * turn the encrypted size into a block/offset
-     * the offset should be 0 for a missing footer
-     * or the size of a footer
-     */
-    fid = EncryptedPos_to_BlockId (self->enc_size, NULL, NULL);
-
-    assert (BlockId_to_EncryptedPos(fid) + sizeof (self->foot) == self->enc_size);
-
-    if (fid == 0)
-        self->dec_size = 0;
-
-    else
-    {
-        KEncFileBlockId bid = fid - 1;
-        KEncFileBlock b;
-
-        /*
-         * not calling this a seek as its not reading a data block
-         * out of order that will be modified
-         */
-        rc = KEncFileBlockRead (self, &b, bid, false);
-        if (rc)
-            return rc;
-        else
-        {
-            if (BufferAllZero(&b, sizeof b) == true)
-                self->dec_size = BlockId_to_DecryptedPos (bid) + 
-                    sizeof self->block.data;
-
-            else
-                self->dec_size = BlockId_to_DecryptedPos (bid) + b.u.valid;
-        }
-    }
-    self->size_known = true;
-    return 0;
-}
-
-
-/* ----------
- * MakeCmn
- * common parameter validation for all encryptor/decryptors
- */
-static
-rc_t KEncFileMakeCmn (KEncFile ** pself, KFile * encrypted, const KKey * key,
-                      bool r, bool w, bool s)
-{
-    rc_t rc = 0, orc;
-
-    assert (((r == true)||(r == false))&&((w == true)||(w == false)));
-    assert (w || r);
-
-    if (pself == NULL)
-    {
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcSelf, rcNull);
-        LOGERR (klogErr, rc,
-                "pointer to self NULL when creating "
-                "an encryptor/decryptor");
-    }
-    else
-        *pself = NULL;
-
-    if (encrypted == NULL)
-    {
-        orc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-        LOGERR (klogErr, orc, 
-                "encrypted file not readable when creating "
-                "an encryptor/decryptor");
-        if (rc == 0)
-            rc = orc;
-    }
-
-    if (key == NULL)
-    {
-        orc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-        LOGERR (klogErr, orc, 
-                "key not supplied when creating an encryptor/decryptor");
-        if (rc == 0)
-            rc = orc;
-    }
-
-    CRC32Init();    /* likely to be called way too often */
-
-    switch (key->type)
-    {
-    default:
-        orc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-        PLOGERR (klogErr,
-                 (klogErr, orc, "invalid key type '$(T)' should be "
-                  "kkeyAES128(1), kkeyAES192(2) or kkeyAES256(3)",
-                  "T=%u", key->type));
-        if (rc == 0)
-            rc = orc;
-        break;
-
-    case kkeyAES128:
-    case kkeyAES192:
-    case kkeyAES256:
-        break;
-    }
-    if (rc == 0)
-    {
-        KEncFile * self;
-
-        assert ((r == true) || (r == false));
-        assert ((w == true) || (w == false));
-
-        rc = KEncFileMakeInt (&self, encrypted, r, w, false, s);
-        if (rc == 0)
-        {
-            rc = KEncFileCiphersInit (self, key, r, w);
-            if (rc == 0)
-            {
-                
-                if (self->seekable && self->size_known)
-                    rc = KEncFileMakeSize (self);
-
-                if (rc == 0)
-                {
-                    *pself = self;
-                    return 0;
-                }
-            }
-            KFileRelease (&self->dad);
-        }
-    }
-    return rc;
-}
-
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-LIB_EXPORT rc_t CC KEncFileMakeRead_v2 (const KFile ** pself, 
-                                        const KFile * encrypted,
-                                        const KKey * key)
-{
-    KEncFile * self;
-    rc_t rc;
-
-    /*
-     * casting encrypted dowsn't actually make it writable
-     * it just lets us use a common constructor
-     */
-    rc = KEncFileMakeCmn (&self, (KFile *)encrypted, key, true, false, false);
-    if (rc)
-        LOGERR (klogErr, rc, "error constructing decryptor");
-
-    else
-        *pself = &self->dad;
-
-    return rc;
-}
-
-
-/* ----------
- * Write mode encrypted file can only be written straight through form the
- * first byte to the last.
- *
- * Existing content is lost.
- */
-LIB_EXPORT rc_t CC KEncFileMakeWrite_v2 (KFile ** pself, 
-                                         KFile * encrypted,
-                                         const KKey * key)
-{
-    KEncFile * self;
-    rc_t rc;
-
-    rc = KEncFileMakeCmn (&self, encrypted, key, false, true, false);
-    if (rc)
-        LOGERR (klogErr, rc, "error constructing encryptor");
-
-    else
-        *pself = &self->dad;
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC KEncFileMakeUpdate_v2 (KFile ** pself, 
-                                          KFile * encrypted,
-                                          const KKey * key)
-{
-    KEncFile * self;
-    rc_t rc;
-
-/*     static int count = 0; */
-
-/*     KOutMsg ("%s: %d\n",__func__,++count); */
-
-    rc = KEncFileMakeCmn (&self, (KFile *)encrypted, key, true, true, false);
-    if (rc)
-        LOGERR (klogErr, rc, "error constructing encryptor/decryptor");
-
-    else
-        *pself = &self->dad;
-
-    return rc;
-}
-
-
-/* ----------
- * Swarm mode encrypted file can be writtenout of order but the footer is not
- * handled automatically
- */
-LIB_EXPORT rc_t CC KEncFileMakeBlock_v2 (KFile ** pself, 
-                                         KFile * encrypted,
-                                         const KKey * key)
-{
-    KEncFile * self;
-    rc_t rc;
-
-/*     static int count = 0; */
-
-/*     KOutMsg ("%s: %d\n",__func__,++count); */
-
-    rc = KEncFileMakeCmn (&self, (KFile *)encrypted, key, false, true, true);
-    if (rc)
-        LOGERR (klogErr, rc, "error constructing encryptor/decryptor");
-
-    else
-        *pself = &self->dad;
-
-    return rc;
-}
-
-
-/* ----------
- * Validate mode is useful only for the KFileEncValidate function
- */
-static
-rc_t KEncFileMakeValidate (KEncFile ** pself, const KFile * encrypted)
-{
-    KEncFile * self;
-    rc_t rc;
-
-    assert (pself);
-    assert (encrypted);
-
-    rc = KEncFileMakeInt (&self, (KFile*)encrypted, true, false, true, false);
-    if (rc)
-        LOGERR (klogErr, rc, "error making KEncFile");
-    else
-    {
-        rc = KEncFileHeaderRead (self);
-        if (rc)
-            LOGERR (klogErr, rc, "error reading encrypted file header");
-        else
-        {
-            *pself = self;
-            return 0;
-        }
-    }
-    *pself = NULL;
-    return rc;
-}
-
-
-/* ======================================================================
- * Interface extensions
- */
-
-
-/* ----------
- * Validate mode can not be read or written.
- * Upon open the whole file is read from begining to end and all CRC
- * and other integrity checks are performed immedaitely
- *
- * This will fail if the file being tested is not "at position 0" and can not
- * be sought back to 0.
- */
-
-
-
-LIB_EXPORT rc_t CC KEncFileValidate_v2 (const KFile * encrypted)
-{
-    KEncFile * file;
-    rc_t rc = 0;
-
-    /* fail if a NULL parameter: can't validate all addresses */
-    if (encrypted == NULL)
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcParam, rcNull);
-        LOGERR (klogErr, rc, "encrypted file was null when trying to validate");
-        return rc;
-    }
-
-    /* file header is validated within the call to Make Validate */
-    rc = KEncFileMakeValidate (&file, encrypted);
-    if (rc)
-        LOGERR (klogErr, rc,
-                "unable to validate encrypted file due to "
-                "inability to open as encrypted file");
-    else
-    {
-        uint64_t pos;             /* position within the encrypted file */
-        uint64_t block_count = 0; /* how many blocks have we read */
-
-        /* loop through all data blocks */
-        pos = sizeof (KEncFileHeader);
-        for (block_count = 0; ; ++block_count)
-        {
-            rc_t vrc;
-            STSMSG (2, ("reading block '%u' at '%lu'", block_count,
-                        BlockId_to_EncryptedPos(block_count)));
-           
-            vrc = KEncFileBlockRead (file, NULL, block_count, true);
-            if (vrc != 0)
-            {
-                if ( rc == 0 )
-                    rc = vrc;
-                if ( GetRCContext( vrc ) != rcValidating )
-                {
-                    STSMSG (2, ("read error at block '%u'", block_count));
-                    break;
-                }
-            }
-            if (file->eof)
-            {
-                STSMSG (2, ("block '%u' was end", block_count));
-                break;
-            }
-            pos += sizeof (KEncFileData);
-        }   
-        KFileRelease (&file->dad);
-    }
-    return (rc);
-}
-
-
-LIB_EXPORT rc_t CC KEncFileHeaderWrite_v2 (KFile * dad)
-{
-    rc_t rc;
-
-    if (dad->vt != (const KFile_vt*)&vtKEncFile)
-    {
-        rc = RC (rcKrypto, rcFile, rcWriting, rcType, rcIncorrect);
-        LOGERR (klogErr, rc, "file not an encryptor requested writing header");
-    }
-    else
-    {
-        KEncFile * self;
-        self = (KEncFile*)dad;
-
-        rc = KEncFileHeaderWrite (self);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC KEncFileFooterWrite_v2 (KFile * dad)
-{
-    rc_t rc;
-
-    if (dad->vt != (const KFile_vt*)&vtKEncFile)
-    {
-        rc = RC (rcKrypto, rcFile, rcWriting, rcType, rcIncorrect);
-        LOGERR (klogErr, rc, "file not an encryptor requested writing footer");
-    }
-    else
-    {
-        KEncFile * self;
-        self = (KEncFile*)dad;
-
-        rc = KEncFileFooterWrite (self);
-    }
-    return rc;
-}
-
-/* ----------
- * Identify whether a file is a KEncFile type encrypted file by the header.
- * read the header into a buffer and pass it into this function.  
- * The buffer_size needs to be at least 8 but more bytes lead to a better
- * check up to the size of the header of a KEncFile type encrypted file.
- * As the header may change in the future (in a backwards compatible way)
- * that size might change from the current 16.
- *
- * Possible returns:
- * 0:
- *      the file is an identified KEncFile type file.  False positives are
- *      possible if a file happens to match at 8 or more bytes
- *
- * RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType)
- *      the file is definitely not a KEncFile type encrypted file.
- *     
- * RC (rcFS, rcFile, rcIdentifying, rcParam, rcNull)
- *      bad parameters in the call
- *
- * RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient)
- *      not a large enough buffer to make an identification
- */
-LIB_EXPORT rc_t CC KFileIsEnc_v2 (const char * buffer, size_t buffer_size)
-{
-    KEncFileHeader header;
-    size_t count;
-    bool byte_swapped;
-
-    if ((buffer == NULL) || (buffer_size == 0))
-        return RC  (rcFS, rcFile, rcIdentifying, rcParam, rcNull); 
-
-    /* must have the signature to consider it an Encrypted file */
-    if (buffer_size < sizeof (header.file_sig))
-        return RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient); 
-
-    if ((memcmp (buffer, &const_header.file_sig, sizeof const_header.file_sig ) != 0) &&
-        (memcmp (buffer, &const_header_sra.file_sig, sizeof const_header_sra.file_sig ) != 0))
-        return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType); 
-
-    /* can we also check the byte order? It's okay if we can't */
-    if (buffer_size < sizeof header.file_sig + sizeof header.byte_order)
-        return 0; 
-    
-    count = buffer_size > sizeof header ? sizeof header : buffer_size;
-
-    memcpy (&header, buffer, count);
-
-    if (header.byte_order == const_header.byte_order)
-        byte_swapped = false;
-
-    else if (header.byte_order == const_bswap_header.byte_order)
-        byte_swapped = true;
-
-    /* but if it's not we fail with a different error */
-    else
-        return RC (rcFS, rcFile, rcIdentifying, rcFile, rcOutoforder); 
-
-    /* can we check the version as well? It's okay if we can't */
-    if (buffer_size < sizeof (header))
-        return 0; 
-
-    assert (sizeof (header.version) == 4);
-    if (byte_swapped)
-        header.version = bswap_32(header.version);
-
-    /* and it's a different error if the version is not within our range */
-    if ((header.version <= 0) || (header.version > eCurrentVersion))
-        return RC (rcKrypto, rcFile, rcClassifying, rcFile, rcBadVersion);
-
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KFileIsSraEnc (const char * buffer, size_t buffer_size)
-{
-    KEncFileHeader header;
-    size_t count;
-    bool byte_swapped;
-
-    if ((buffer == NULL) || (buffer_size == 0))
-        return RC  (rcFS, rcFile, rcIdentifying, rcParam, rcNull); 
-
-
-    if (buffer_size < sizeof (header.file_sig))
-        return RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient); 
-
-    if (memcmp (buffer, &const_header_sra.file_sig, sizeof const_header.file_sig ) != 0)
-        return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType); 
-
-    if (buffer_size < sizeof header.file_sig + sizeof header.byte_order)
-        return 0; 
-    
-    count = buffer_size > sizeof header ? sizeof header : buffer_size;
-
-    memcpy (&header, buffer, count);
-
-    if (header.byte_order == const_header.byte_order)
-        byte_swapped = false;
-
-    else if (header.byte_order == const_bswap_header.byte_order)
-        byte_swapped = true;
-
-    else
-        return RC (rcFS, rcFile, rcIdentifying, rcFile, rcOutoforder); 
-
-    if (buffer_size < sizeof (header))
-        return 0; 
-
-    assert (sizeof (header.version) == 4);
-    if (byte_swapped)
-        header.version = bswap_32(header.version);
-
-    if ((header.version <= 0) || (header.version > eCurrentVersion))
-        return RC (rcKrypto, rcFile, rcClassifying, rcFile, rcBadVersion);
-
-    return 0;
-}
-
-/* end of file encfile.c */
-
-
-
diff --git a/libs/krypto/key.c b/libs/krypto/key.c
deleted file mode 100644
index c57a45f..0000000
--- a/libs/krypto/key.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <krypto/extern.h>
-#include <krypto/key.h>
-#include <kapp/args.h>
-#include <klib/checksum.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <string.h>
-
-KRYPTO_EXTERN_DATA KKey KKeyEncrypt;
-KRYPTO_EXTERN_DATA KKey KKeyDecrypt;
-KRYPTO_EXTERN_DATA char WGAEncryptPassword[WGA_MAX_PASSWORD];
-KRYPTO_EXTERN_DATA char WGADecryptPassword[WGA_MAX_PASSWORD];
-
-
-static rc_t KKeyInitInt (KKey * self, KKeyType key_type, 
-                         const void * password, size_t password_size)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcSelf, rcNull);
-
-    if (key_type >= kkeyTypeCount)
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcInvalid);
-
-    if (key_type == kkeyNone)
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcIncorrect);
-
-    if (password == NULL)
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcNull);
-
-    if (password_size == 0)
-        return RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, rcTooShort);
-
-    {
-        SHA256State state;
-        size_t z;
-        uint8_t digest [64];
-
-
-        SHA256StateInit (&state);
-        SHA256StateAppend (&state, password, password_size);
-        SHA256StateFinish (&state, digest);
-        
-        switch (self->type = key_type)
-        {
-        default:
-            z = 0;
-            break;
-
-        case kkeyAES128:
-            z = 128/8;
-            break;
-
-        case kkeyAES192:
-            z = 192/8;
-            break;
-
-        case kkeyAES256:
-            z = 256/8;
-            break;
-        }
-        memcpy (self->text, digest, z);
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KKeyInitRead (KKey * self, KKeyType key_type, 
-                                 const void * password, size_t password_size)
-{
-    return KKeyInitInt (self, key_type, password, password_size);
-}
-
-LIB_EXPORT rc_t CC KKeyInitUpdate (KKey * self, KKeyType key_type, 
-                                   const void * password, size_t password_size)
-{
-    if (password_size < kkeyMinimumSize)
-    {
-        rc_t rc = RC (rcKrypto, rcEncryptionKey, rcConstructing, rcParam, 
-                      rcTooShort);
-#if FAIL_SHORT_PASSWORD
-        return rc;
-#else
-        PLOGERR (klogWarn, (klogWarn, rc,
-                            "Password is shorter than recommended '$(P)' is less than '$(Q)'"
-                            , "P=%zu,Q=%u"
-                            , password_size
-                            , ( uint32_t ) kkeyMinimumSize
-                     ));
-#endif
-    }
-    return KKeyInitInt (self, key_type, password, password_size);
-}
-    
-
-
-LIB_EXPORT rc_t CC KKeyInitHex()
-{
-    return 0;
-}
-
-/* end of file encfile.c */
-
diff --git a/libs/krypto/libkrypto.vers b/libs/krypto/libkrypto.vers
deleted file mode 100644
index 5b09c67..0000000
--- a/libs/krypto/libkrypto.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.14
diff --git a/libs/krypto/libkryptotest.vers b/libs/krypto/libkryptotest.vers
deleted file mode 100644
index 3eefcb9..0000000
--- a/libs/krypto/libkryptotest.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.0
diff --git a/libs/krypto/manager.c b/libs/krypto/manager.c
deleted file mode 100644
index 8b8c766..0000000
--- a/libs/krypto/manager.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#error "obsolete do not use"
-
-
-
-
-
-
-
-
-
-
diff --git a/libs/krypto/ncbi-priv.h b/libs/krypto/ncbi-priv.h
deleted file mode 100644
index 4814e4f..0000000
--- a/libs/krypto/ncbi-priv.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#ifndef _h_krypto_ncbi_priv_
-#define _h_krypto_ncbi_priv_
-
-#include <klib/defs.h>
-
-#ifdef _GNUC_
-#include <v128.h>
-#endif
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#if defined (USEVEC)
-#if defined (USEAESNI)
-
-# if ! defined (USEVECREG)
-/*
- * AES_NI && ! VECREG
- * Illegal
- */
-#  error "Bad combination of defines"
-
-# else
-
-/*
- * AESNI && VECREG
- * use AES-NI, and SSSE3 and lower
- */
-
-# define USE_AES_NI             true
-# define USE_VEC_REG            true
-# define USE_VEC                true
-# define CMEMBER(name)          KCipherVecAesNi##name
-# define CIPHER_IMPL            KCipherVecAesNi
-# define AESBCMEMBER(name)      KAESBlockCipherVecAesNi##name
-# define AESBCIPHER_IMPL        KAESBlockCipherVecAesNi
-# define NULLBCMEMBER(name)     KNullBlockCipherVecAesNi##name
-# define NULLBCIPHER_IMPL       KNullBlockCipherVecAesNi
-# define BCIPHER_VALUE          CipherVec
-
-# endif
-#elif defined (USEVECREG)
-
-# define USE_AES_NI             false
-# define USE_VEC_REG            true
-# define USE_VEC                true
-# define CMEMBER(name)          KCipherVecReg##name
-# define CIPHER_IMPL            KCipherVecReg
-# define AESBCMEMBER(name)      KAESBlockCipherVecReg##name
-# define AESBCIPHER_IMPL        KAESBlockCipherVecReg
-# define NULLBCMEMBER(name)     KNullBlockCipherVecReg##name
-# define NULLBCIPHER_IMPL       KNullBlockCipherVecReg
-# define BCIPHER_VALUE          CipherVec
-
-#else
-
-# define USE_AES_NI             false
-# define USE_VEC_REG            false
-# define USE_VEC                true
-# define CMEMBER(name)          KCipherVec##name
-# define CIPHER_IMPL            KCipherVec
-# define AESBCMEMBER(name)      KAESBlockCipherVec##name
-# define AESBCIPHER_IMPL        KAESBlockCipherVec
-# define NULLBCMEMBER(name)     KNullBlockCipherVec##name
-# define NULLBCIPHER_IMPL       KNullBlockCipherVec
-# define BCIPHER_VALUE          CipherVec
-
-#endif
-
-#else /* ! defined (USEVEC) */
-
-
-# define USE_AES_NI             false
-# define USE_VEC_REG            false
-# define USE_VEC                false
-# define MEMBER(name)           KCipherByte##name
-# define CMEMBER(name)          KCipherByte##name
-# define CIPHER_IMPL            KCipherByte
-# define AESBCMEMBER(name)      KAESBlockCipherByte##name
-# define AESBCIPHER_IMPL        KAESBlockCipherByte
-# define NULLBCMEMBER(name)     KNullBlockCipherByte##name
-# define NULLBCIPHER_IMPL       KNullBlockCipherByte
-# define BCIPHER_VALUE          CipherBlock
-
-#endif /* defined (USEVEC) */
-
-#define CLASS_STRING(name)  #name
-
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_ncbi_priv_ */
-
-
diff --git a/libs/krypto/no-null-ncbi.c b/libs/krypto/no-null-ncbi.c
deleted file mode 100644
index 7477512..0000000
--- a/libs/krypto/no-null-ncbi.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <krypto/extern.h>
-
-#include "ncbi-priv.h"
-#include "cipher-priv.h"
-/* #include "blockcipher-priv.h" */
-
-#include <klib/rc.h>
-
-/* ----------------------------------------------------------------------
- * Make
- *
- * Create a new Null Block Cipher object.
- * The processor is checked to see if this particular version is supported on
- * this particular CPU.
- */
-struct KBlockCipher;
-rc_t NULLBCMEMBER(Make) (struct KBlockCipher ** new_obj)
-{
-    rc_t rc;
-
-    /* Check parameter first */
-    if (new_obj == NULL)
-        rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-    {
-        *new_obj = NULL;
-
-        rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcFunction, rcUnsupported);
-    }
-    return rc;
-}
-
-/* end of file lib/krypto/aes-ncbi.c */
diff --git a/libs/krypto/null-ncbi-priv.h b/libs/krypto/null-ncbi-priv.h
deleted file mode 100644
index 1e485bd..0000000
--- a/libs/krypto/null-ncbi-priv.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#ifndef _h_krypto_null_ncbi_priv_libs_
-#define _h_krypto_null_ncbi_priv_libs_
-
-#include <klib/defs.h>
-#include <v128.h>
-
-#include "ncbi-priv.h"
-#include "cipher-impl.h"
-#include "blockcipher-impl.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-typedef struct CipherNull CipherNull;
-struct CipherNull
-{
-    KCipher dad;
-    CipherVec    e_ivec;
-    CipherVec    d_ivec;
-};
-
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* #ifndef _h_krypto_null_ncbi_priv_libs_ */
-
-
diff --git a/libs/krypto/null-ncbi.c b/libs/krypto/null-ncbi.c
deleted file mode 100644
index fe5e7bc..0000000
--- a/libs/krypto/null-ncbi.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <krypto/extern.h>
-
-#include "ncbi-priv.h"
-#include "cipher-priv.h"
-#include "blockcipher-priv.h"
-
-#include <klib/rc.h>
-
-
-#include <byteswap.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <sysalloc.h>
-
-#include "blockcipher-impl.h"
-
-#if USE_VEC
-#include <cpuid.h>
-#endif
-#if USE_VECREG
-#include <v128.h>
-#endif
-
-
-#if USE_VEC
-#define BLOCKCIPHER_IMPL BLOCKCIPHER_VEC_IMPL
-#else
-#define BLOCKCIPHER_IMPL BLOCKCIPHER_BYTE_IMPL
-#endif
-
-typedef struct NULL_CLASS NULL_CLASS;
-
-static const char NULLBCMEMBER(aes_ncbi_name) [] = CLASS_STRING(AES_CLASS);
-
-
-/* ----------------------------------------------------------------------
- * Destroy
- *   How large is the stored key for this cipher?  Not the user key used
- *   to create this key (key schedule)
- *
- *   This is needed by KCipher to know how large the KCipher objecr is at
- *   allocation and to know how much of a buffer each decryption/encryption is
- */
-static
-void NULLBCMEMBER(Destroy)    (const BLOCKCIPHER_IMPL * self)
-{
-    /* we use a constant object so do nothing */
-}
-
-
-/* ----------------------------------------------------------------------
- * BlockSize
- */
-static
-uint32_t NULLBCMEMBER(BlockSize) ()
-{
-    return 16;
-}
-
-
-/* ----------------------------------------------------------------------
- * KeySize
- *   How large is the stored key for this cipher?  Not the user key used
- *   to create this key (key schedule)
- *
- *   This is needed by KCipher to know how large the KCipher objecr is at
- *   allocation and to know how much of a buffer each decryption/encryption is
- */
-static uint32_t NULLBCMEMBER(KeySize) ()
-{
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetEncryptKey
- *   The KCipher calls this to have the block cipher build an encryption
- *   key in the KCipher object
- *
- */
-static rc_t NULLBCMEMBER(SetEncryptKey) (void * encrypt_key, const char * user_key,
-                                         uint32_t user_key_size)
-{
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetDecryptKey
- *   The KCipher calls this to have the block cipher build an decryption
- *   key in the KCipher object
- *
- */
-static rc_t NULLBCMEMBER(SetDecryptKey) (void * decrypt_key,
-                                     const char * user_key,
-                                     uint32_t user_key_size)
-{
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Encrypt
- *
- *   Perform an encryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- *
- */
-#if USE_VEC
-static CipherVec NULLBCMEMBER(Encrypt) (CipherVec state,
-                                        const void * encrypt_key)
-{
-    return state;
-}
-#else
-static void NULLBCMEMBER(Encrypt) (const CipherBlock in,
-                                   CipherBlock * out,
-                                   const void * encrypt_key)
-{
-}
-#endif
-
-
-/* ----------------------------------------------------------------------
- * Decrypt
- *
- *   Perform a decryption of a single block.  Chained modes and stream
- *   cipher modes will call this multiple times.
- */
-#if USE_VEC
-static CipherVec NULLBCMEMBER(Decrypt) (CipherVec state,
-                                        const void * decrypt_key)
-{
-    return state;
-}
-#else
-static void NULLBCMEMBER(Decrypt) (const CipherBlock in,
-                                   CipherBlock * out,
-                                   const void * encrypt_key)
-{
-}
-#endif
-
-
-/* ----------------------------------------------------------------------
- * MakeProcessorSupport
- *
- * Run-time check for support of this particular AES implementation by
- * checking the flags given via the cpuid instruction.
- */
-static __inline__
-bool NULLBCMEMBER(ProcessorSupport) ()
-{
-    return true;
-}
-
-
-/* ----------------------------------------------------------------------
- * Init
- *
- *   Initialize the fields of this object.  The derived class will call this
- *   during it's initialization.
- *
- * self      object to initialze
- * vt        the virtual table of the derived class
- * mgr       the cipher manager that is the construction factory block cipher
- *           objects hold references to the manager while the manager merely
- *           points at the block ciphers when all block ciphers are destroyed
- *           the manager loses its references and it too can be destroyed if not
- *           held elsewhere
- * name      ASCIZ c-string the name of this class
- */
-static const
-#if USE_VEC
-KBlockCipherVec_vt_v1
-#else
-KBlockCipherByte_vt_v1
-#endif
-NULLBCMEMBER(_vt_) = {
-    { 1, 1 },
-
-    NULLBCMEMBER(Destroy),
-    NULLBCMEMBER(BlockSize),
-    NULLBCMEMBER(KeySize),
-    NULLBCMEMBER(SetEncryptKey),
-    NULLBCMEMBER(SetDecryptKey),
-    NULLBCMEMBER(Encrypt),
-    NULLBCMEMBER(Decrypt)
-};
-
-
-/* ----------------------------------------------------------------------
- * Make
- *
- * Create a new Null Block Cipher object.
- * The processor is checked to see if this particular version is supported on
- * this particular CPU.
- */
-rc_t NULLBCMEMBER(Make) (KBlockCipher ** new_obj)
-{
-    rc_t rc;
-
-    /* Check parameter first */
-    if (new_obj == NULL)
-        rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-    {
-        *new_obj = NULL;
-
-        /* check for processor support of this flavor */
-        if ( ! NULLBCMEMBER(ProcessorSupport)())
-            rc = RC (rcKrypto, rcBlockCipher, rcConstructing, rcFunction, rcUnsupported);
-
-        else
-        {
-            rc = 0;
-            *new_obj = (KBlockCipher*)&(NULLBCMEMBER(_vt_));
-        }
-    }
-    return rc;
-}
-
-/* end of file lib/krypto/aes-ncbi.c */
diff --git a/libs/krypto/reencfile.c b/libs/krypto/reencfile.c
deleted file mode 100644
index 00ed4e3..0000000
--- a/libs/krypto/reencfile.c
+++ /dev/null
@@ -1,1255 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <krypto/reencfile.h>
-#include <krypto/key.h>
-#include <krypto/encfile.h>
-#include <krypto/encfile-priv.h>
-#include "encfile-priv.h"
-
-#include <klib/rc.h>
-#include <klib/checksum.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/vector.h>
-#include <klib/status.h>
-#include <kfs/file.h>
-#include <kfs/ramfile.h>
-
-#include <sysalloc.h>
-
-#include <byteswap.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include <klib/out.h>
-
-#define USE_MISSING_VECTOR false
-
-/* ----------------------------------------------------------------------
- * KReencFile
- *   Base object class for the encryption, decryption and validation of
- *   the file format defined above
- */
-#define KFILE_IMPL KReencFile
-#include <kfs/impl.h>
-
-/* -----
- */
-struct KReencFile
-{
-    KFile         dad;          /* base class */
-    const KFile * encrypted;    /* encrypted file we start from */
-    const KFile * dec;          /* decryptor of the original */
-    KFile *       enc;          /* encryptor */
-    KFile *       ram;          /* a file that works from a sliding window buffer */
-
-    size_t        num_read;
-    size_t        num_writ;
-/* block id's can not max out a 64 bit number as that is a file that is 32K times too big */
-#define NO_CURRENT_BLOCK (~(uint64_t)0)
-    uint64_t      block_id;
-    uint64_t      footer_block; /* if zero, still unknown */
-
-    uint64_t      size;         /* size as known from the original file [see known_size] */
-    bool          known_size;   /* is the size of the original file known? */
-
-    char          plain_text  [ENC_DATA_BLOCK_SIZE];
-    union
-    {
-        KEncFileBlock block;
-        char          text [sizeof (KEncFileBlock)];
-    } block;
-    union
-    {
-        KEncFileFooter foot;
-        char           text [sizeof (KEncFileFooter)];
-    } foot;
-
-};
-
-/* ----------------------------------------------------------------------
- * Interface Functions
- *
- * Destroy
- *
- */
-static
-rc_t CC KReencFileDestroy (KReencFile *self)
-{
-    if (self)
-    {
-        rc_t rc1, rc2, rc3, rc4;
-
-        rc1 = KFileRelease (self->encrypted);
-        if (rc1)
-            LOGERR (klogInt, rc1, "Re-enc failed to release encrypted file");
-
-        rc2 = KFileRelease (self->dec);
-        if (rc2)
-            LOGERR (klogInt, rc2, "Re-enc failed to release decryptor");
-
-        rc3 = KFileRelease (self->ram);
-        if (rc3)
-            LOGERR (klogInt, rc3, "Re-enc failed to release ram file");
-
-        rc4 = KFileRelease (self->enc);
-        if (rc4)
-            LOGERR (klogInt, rc4, "Re-enc failed to release encryptor");
-
-        free (self);
-
-        return (rc1 ? rc1 :
-                rc2 ? rc2 :
-                rc3 ? rc3 :
-                rc4);
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We do not allow this for read, write or update as you can not memory map the 
- * unencrypted file in a meaningful way.
- */
-static
-struct KSysFile *CC KReencFileGetSysFileUnsupported (const KReencFile *self, uint64_t *offset)
-{
-    assert (self);
-    assert (offset);
-
-    return NULL;
-}
-
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KReencFileRandomAccess (const KReencFile *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    return KFileRandomAccess (self->encrypted);
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KReencFileSize (const KReencFile *self, uint64_t *size)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    /* -----
-     * the re-encrypted file will be the same size as the 
-     * previously encrypted file and we have the same understanding
-     * about knowing the size
-     */
-    return KFileSize (self->encrypted, size);
-}
-
-
-static
-rc_t CC KEncryptFileSize (const KReencFile *self, uint64_t *size)
-{
-    uint64_t z;
-    rc_t rc;
-
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    /* -----
-     * the re-encrypted file will be the same size as the 
-     * previously encrypted file and we have the same understanding
-     * about knowing the size
-     */
-    rc = KFileSize (self->encrypted, &z);
-
-    if (rc == 0)
-    {
-        uint64_t bid;
-
-        bid = DecryptedPos_to_BlockId (z, NULL);
-
-        *size = BlockId_to_EncryptedPos (bid + 1) + sizeof (KEncFileFooter);
-    }
-    else
-        *size = z;
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KReencFileSetSizeUnsupported (KReencFile *self, uint64_t size)
-{
-    assert (self);
-
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/*
- * The next three functions do the actual Out from a KFileRead.
- * We will only out from the header, or a footer or a single
- * encrypted block rather than try to fully satisfy all of a
- * KFileRead. USe KFileReadAll to get more than one part
- *
- * For all we have an offset within the part which is the
- * position from the original read request for the header
- */
-static __inline__
-rc_t KReencFileReadHeaderOut (KReencFile * self, size_t offset, void * buffer,
-                              size_t bsize, size_t *num_read)
-{
-    assert (self);
-    assert (offset < sizeof (KEncFileHeader));
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    /* trim request if necessary */
-    if (offset + bsize > sizeof (KEncFileHeader))
-        bsize = sizeof (KEncFileHeader) - offset;
-
-    memcpy (buffer, self->block.text + offset, bsize);
-    self->block_id = NO_CURRENT_BLOCK;
-    *num_read = bsize;
-    
-    return 0;
-}
-
-
-static __inline__
-rc_t KReencFileReadBlockOut (KReencFile * self, size_t offset, void * buffer,
-                             size_t bsize, size_t * num_read)
-{
-    assert (self);
-    assert (offset < sizeof self->block);
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    if (offset + bsize > sizeof self->block)
-        bsize = sizeof self->block - offset;
-
-    memcpy (buffer, self->block.text + offset, bsize);
-    *num_read = bsize;
-
-    return 0;
-}
-
-
-static __inline__
-rc_t KReencFileReadFooterOut (KReencFile * self, size_t offset,
-                              void * buffer, size_t bsize, size_t * num_read)
-{
-    /* for the footer we will copy out from the footer in self */
-
-    assert (self);
-    assert (offset < sizeof self->foot);
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-/* KOutMsg ("%s: offset '%zu' bsize '%zu'",__func__,offset,bsize); */
-    if (offset + bsize > sizeof self->foot)
-        bsize = sizeof self->foot - offset;
-
-    memcpy (buffer, self->foot.text + offset, bsize);
-    self->block_id = NO_CURRENT_BLOCK;
-    *num_read = bsize;
-
-/* KOutMsg (" *num_read '%zu'\n",bsize); */
-/* { */
-/*     size_t ix; */
-/*     char * b = buffer; */
-/*     KOutMsg ("%s:",__func__); */
-/*     for (ix = 0; ix < bsize; ++ix) */
-/*         KOutMsg (" %2.2x",b[ix]); */
-/*     KOutMsg ("\n"); */
-
-/* } */
-    return 0;
-}
-
-
-/*
- * Handle Read within the Encrypted file header
- *
- * We use a private interface into the KEncFile then 
- * the Out function below to take what we write with
- * the Encryptor and copy it to the callers read buffer.
- */
-static
-rc_t KReencFileReadHandleBlock (KReencFile *self,
-                                uint64_t pos,
-                                void *buffer,
-                                size_t bsize,
-                                size_t *num_read);
-
-static __inline__
-rc_t KReencFileReadHandleHeader (KReencFile *self,
-                                 uint64_t pos,
-                                 void *buffer,
-                                 size_t bsize,
-                                 size_t *num_read)
-{
-    rc_t rc;
-
-    assert (self);
-    assert (pos < sizeof (KEncFileHeader));
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    /* added to support NCBInenc and NCBIsenc variants of KEncFile
-     * read the first block of the source file but don't write any of it
-     *
-     * If the source is stream mode only then the next block to be read is the
-     * first and this will not violate by seeking. It will just have already
-     * read the block it will want to read real soon. Likewith within a
-     * single call to KFileReadAll.
-     */
-    rc = KReencFileReadHandleBlock (self, 0, NULL, 0, NULL);
-    if (rc)
-        return rc;
-
-    /* use a private function from KEncFile to generate a header */
-    rc = KEncFileWriteHeader (self->enc);
-    if (rc)
-        LOGERR (klogErr, rc, "re-enc error generating encrypted header");
-    else
-    {
-        /*
-         * assume it worked and its the right size 
-         * copy the requested portion of the header out to finish the read
-         */
-        rc = KReencFileReadHeaderOut (self, pos, buffer, bsize, num_read);
-        if (rc)
-            LOGERR (klogErr, rc, "re-enc error filling read request");
-    }
-    return rc;
-}
-
-
-/*
- * Read the requested block form the source encrypted file
- */
-static
-rc_t KReencFileReadABlock (KReencFile * self, uint64_t block_id)
-{
-    rc_t rc;
-
-
-/*     OUTMSG (("%s: block_id %lu\n",__func__,block_id)); */
-
-    if (block_id + 1 == self->footer_block)
-        memset (self->plain_text, 0, sizeof self->plain_text);
-
-    /* -----
-     * simple call down to the decryptor to get the plain text data
-     * for this block. We will regenerate the framing when we re-encrypt
-     */
-    rc = KFileReadAll (self->dec, BlockId_to_DecryptedPos (block_id),
-                       &self->plain_text, sizeof (self->plain_text),
-                       &self->num_read);
-    if (rc)
-        LOGERR (klogErr, rc, "re-enc error reading a block");
-
-    /*
-     * interpret bytes read for validity
-     *
-     * zero means we hit a premature end of file where we expected a block
-     */
-    else if (self->num_read == 0)
-    {
-        /*misleading RC? */
-        rc = RC (rcKrypto, rcFile, rcReading, rcSize, rcInsufficient);
-        LOGERR (klogErr, rc, "re-enc no block read");
-    }
-    /*
-     * less than a full block must be in the last block
-     */
-    else if (self->num_read < sizeof self->plain_text)
-    {
-/*         KOutMsg ("%s: block_id '%lu'num_read '%zu' of '%zu' last_block '%lu'\n", */
-/*                  __func__, block_id, self->num_read, sizeof self->plain_text, */
-/*                  self->footer_block); */
-
-        if (block_id + 1 != self->footer_block)
-        {
-            rc = RC (rcKrypto, rcFile, rcReading, rcSize, rcInsufficient);
-            LOGERR (klogErr, rc, "re-enc incomplete block read");
-        }
-    }
-    /*
-     * unlikely scenario, read too much
-     */
-    else if (self->num_read > sizeof self->plain_text)
-    {
-        rc = RC (rcKrypto, rcFile, rcReading, rcBuffer, rcIncorrect);
-        LOGERR (klogErr, rc, "re-enc no block read");
-    }
-    if (rc == 0)
-        self->block_id = block_id;
-    return rc;
-}
-
-
-static
-rc_t KReencFileWriteABlock (KReencFile * self, uint64_t block_id)
-{
-    rc_t rc;
-
-    /* -----
-     * simple call to encrypt an entire data section for the relevant block
-     * We send in up to 32KB of plain text which through two element KFiles will
-     * we written into a buffer back in this KFile. More data will be written
-     * to that buffer than requested here - that is the framing and also the
-     * header if the block is the first one.
-     */
-    rc = KFileWriteAll (self->enc, BlockId_to_DecryptedPos (block_id),
-                         self->plain_text, self->num_read, &self->num_writ);
-
-    if (rc)
-        LOGERR (klogInt, rc, "re-enc error encrypting a block");
-
-    else if (self->num_writ != self->num_read)
-    {
-        rc = RC (rcKrypto, rcFile, rcWriting, rcFile, rcIncomplete);
-        LOGERR (klogErr, rc, "re-enc failure encrypting all of block");
-    }
-
-    /* trigger a flush */
-/*     if (rc == 0) */
-/*         rc = KFileWriteAll (self->enc, BlockId_to_DecryptedPos (block_id^1), */
-/*                          self->plain_text, self->num_read, &self->num_writ); */
-
-    return rc;
-}
-
-
-/*
- * Add the current encrypted block to the footer statistics
- */
-static __inline__
-rc_t KReencFileAddToFooter (KReencFile * self)
-{
-    assert (self);
-/*     KOutMsg ("%s: ",__func__);  */
-
-    if (self->block.block.crc != self->block.block.crc_copy)
-    {
-        rc_t rc = RC (rcKrypto, rcFile, rcReading, rcChecksum, rcInvalid);
-        LOGERR (klogInt, rc, "rc-enc block CRCs disagree");
-        return rc;
-    }
-
-    ++ self->foot.foot.block_count;
-    self->foot.foot.crc_checksum += self->block.block.crc;
-
-/*     KOutMsg ("%lu %lu %lu\n",self->foot.foot.block_count,self->block.block.crc,self->foot.foot.crc_checksum); */
-    return 0;
-}
-
-
-/*
- * Read a block from the source encrypted block and Write it which reencrypts it
- *
- * The new_block parameter says whether this is the first time we've seen this
- * block. If it is we need to add data to the footer
- */
-static
-rc_t KReencFileReencBlock (KReencFile * self, uint64_t block_id, bool new_block)
-{
-    rc_t rc;
-
-    assert (self);
-
-/*     KOutMsg ("%s: %lu %lu\n", __func__, block_id, self->footer_block); */
-    assert (block_id < self->footer_block);
-    assert ((new_block == true) || (new_block == false));
-
-
-
-    rc = KReencFileReadABlock (self, block_id);
-    if (rc)
-        LOGERR (klogErr, rc, "re-enc failure to read a block");
-    else
-    {
-        if ((self->num_read == 0) || (self->num_read > sizeof (self->plain_text)))
-        {
-            rc = RC (rcFS, rcFile, rcReading, rcSize, rcIncorrect);
-            LOGERR (klogErr, rc, "Bad length on block read of encrypted file");
-        }
-        else
-        {
-            rc = KReencFileWriteABlock (self, block_id);
-            if (rc)
-                LOGERR (klogErr, rc, "re-enc failure to write a block");
-
-            else if (new_block)
-            {
-                rc = KReencFileAddToFooter (self);
-                if (rc)
-                    LOGERR (klogErr, rc,
-                            "re-enc failure to do block accounting");
-            }
-        }
-    }
-    return rc;
-}
-
-
-/*
- * Handle Read within the Encrypted file footer
- */
-static __inline__
-rc_t KReencFileReadHandleFooter (KReencFile *self,
-                                 uint64_t pos,
-                                 void *buffer,
-                                 size_t bsize,
-                                 size_t *num_read)
-{
-    uint64_t block_id;  /* block id for the footer gets us the start of footer */
-    size_t offset;
-    rc_t rc;
-
-/* KOutMsg ("\n\n\n%s: pos '%lu' bsize '%zu'\n",__func__,pos,bsize); */
-
-    assert (self);
-    assert (pos >= sizeof (KEncFileHeader) + sizeof self->block);
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    rc = 0;
-    block_id = EncryptedPos_to_BlockId (pos, NULL, NULL);
-
-    /* our library does not allow an empty file to be encrypted
-     * so we call that an error
-     */
-    assert (block_id > 0);
-
-    assert (block_id == self->footer_block);
-
-    offset = pos - BlockId_to_EncryptedPos (block_id);
-
-    assert (offset < sizeof self->foot);
-
-    /* if we are tying to treat this as a footer but it wasn't the next
-     * expected block mark all inbetween as missing to handle in the 
-     * function just below this
-     */
-
-/* KOutMsg ("%s: self->next_block %lu\n",__func__, self->next_block); */
-
-    self->foot.foot.block_count = block_id;
-    self->foot.foot.crc_checksum = 0;
-
-    if (rc == 0)
-    {
-        uint64_t header_pos;
-
-        header_pos = BlockId_to_EncryptedPos(block_id);
-
-        assert (header_pos <= pos);
-        assert (pos - header_pos <= sizeof self->foot);
-
-        rc = KReencFileReadFooterOut (self, (size_t)(pos - header_pos),
-                                      buffer, bsize, num_read);
-
-/*             KOutMsg ("%s: footer '%lu' '%lx'\n",__func__, */
-/*                      self->foot.foot.block_count, */
-/*                      self->foot.foot.crc_checksum); */
-
-        if (rc)
-            LOGERR (klogInt, rc, "re-enc failed to output footer");
-    }
-    return rc;
-}
-
-
-/*
- *
- */
-static
-rc_t KReencFileReadHandleBlock (KReencFile *self,
-                                uint64_t pos,
-                                void *buffer,
-                                size_t bsize,
-                                size_t *num_read)
-{ 
-    rc_t rc = 0;            /* we have a path where we need to check this without set */
-    uint64_t block_id;      /* block id for the requeted position */
-    uint32_t offset;        /* how far into the encrypted block */
-    bool new_block;         /* is this the first time for this block */
-
-    /* -----
-     * figure out what block this corresponds to. 
-     * the header is for this purpose part of the first block
-     * when we decide what to give the reader. We only care
-     * about which block and not whether it is in the payload
-     * or framing.
-     * This block id is not to a known to exist block. It could be 
-     * to the header, the footer or past the end of the file.
-     *
-     * NOTE: This could be a pre-fetch of the first block when
-     * processing the header - it will have some funny values
-     * with just a self and all other parameters 0s.
-     * pos of zero gives block_id of 0 and the bsize of zero
-     * means we never look at the others. Thi sis to allow the 
-     * (at the time this was written) new feature of two
-     * different file-signatures for encrypted files.
-     */
-    block_id = EncryptedPos_to_BlockId (pos, NULL, NULL);
-
-    if (block_id != self->block_id)
-    {
-        new_block = true;
-
-        if (rc == 0)
-        {
-            /* read requested block */
-            rc = KReencFileReencBlock (self, block_id, new_block);
-            if (rc)
-            {
-                LOGERR (klogErr, rc,
-                        "re-enc failure re-encryptinng a requested block");
-            }
-        }
-    }
-    if ((rc == 0) && (bsize > 0))
-    {
-        /* satisfy read request
-         *
-         * if we are here we decrypted and re-encrypted the
-         * expected block
-         */
-        offset = pos - BlockId_to_EncryptedPos (block_id);
-        rc = KReencFileReadBlockOut (self, offset, buffer, bsize, num_read);
-        if (rc)
-            LOGERR (klogErr, rc, "re-enc error copying out from block");
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KReencFileReadUnsupported (const KReencFile *self,
-                                   uint64_t pos,
-                                   void *buffer,
-                                   size_t bsize,
-                                   size_t *num_read)
-{
-    assert (self);
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    return RC ( rcFS, rcFile, rcReading, rcFunction, rcUnsupported );
-}
-
-
-/*
- * Read will often return only a partial read.
- *
- * We take the less complex route here and return only from the header, a
- * single block or the footer, whatever is at the beginning of the requested
- * region.
- */
-static
-rc_t CC KReencFileRead (const KReencFile *self_,
-                        uint64_t pos,
-                        void *buffer,
-                        size_t bsize,
-                        size_t *num_read)
-{
-    /* make it all mutable and stop using self_ */
-    KReencFile * self = (KReencFile *)self_;
-    rc_t rc = 0;
-
-    assert (self);
-    assert (buffer);
-    assert (bsize);
-    assert (num_read);
-
-    *num_read = 0;
-
-    /* -----
-     * the size of the re-encrypted file will be the same as the size of the
-     * previously encrypted file so we can bail early if we know we can.
-     *
-     * The initial use case is that the file will just be lying out on disk
-     * and a KSysfile so that we do know the size.
-     *
-     * There are three pieces to an encrypted file:
-     * 1 Header
-     * 2 One or More Blocks
-     * 3 Footer
-     *
-     * We will only know if we are in the footer if we already know the size of
-     * the file. Else we have to find the footer by not finding a block when we
-     * try to read it. We'll thus look for the header first, then the footer else
-     * we try to find a block,
-     */
-
-    /* Header */
-    if (pos < sizeof (KEncFileHeader))
-        rc = KReencFileReadHandleHeader (self, pos, buffer, bsize, num_read);
-
-    /* if past the whole encrypted file */
-    else if (pos >= self->size)
-        rc = 0;
-
-    /* Footer */
-    else if (pos >= self->size - sizeof self->foot)
-        rc = KReencFileReadHandleFooter (self, pos, buffer, bsize, num_read);
-
-    /* Blocks */
-    else
-        rc = KReencFileReadHandleBlock (self, pos, buffer, bsize, num_read);
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KReencFileWriteUnsupported (KReencFile *self, uint64_t pos,
-                                    const void *buffer, size_t bsize,
-                                    size_t *num_writ)
-{
-    rc_t rc = RC (rcFS, rcFile, rcReading, rcFunction, rcUnsupported);
-
-    assert (self);
-    assert (buffer);
-    assert (bsize);
-    assert (num_writ);
-
-    assert (false);
-
-    LOGERR (klogInt, rc, "KFileRead failed to filter call");
-
-    return rc;
-}
-
-static
-rc_t CC KReencFileWrite (KReencFile *self, uint64_t pos,
-                         const void *buffer, size_t bsize,
-                         size_t *num_writ)
-{
-    assert (self);
-    assert (buffer);
-    assert (bsize);
-    assert (num_writ);
-
-    assert (REENCFILE_WRITE_SUPPORTED);
-
-    /* this needs to be finished before we can support Write open */
-
-    return KReencFileWriteUnsupported (self, pos, buffer, bsize, num_writ);
-}
-
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KReencFileType (const KReencFile *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    return KFileType (self->encrypted);
-}
-
-
-/* ----------------------------------------------------------------------
- * KReencFileMake
- *  create a new file object
- */
-
-
-/* ----------
- * MakeParamValidate
- * common parameter validation for both reencryptors
- */
-static
-rc_t KReencFileMakeParamValidate (const KFile ** pself, const KFile * encrypted, 
-                                  const KKey * deckey, const KKey * enckey)
-{
-    rc_t rc = 0;
-
-    do
-    {
-        if (pself == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-            LOGERR (klogErr, rc,
-                    "pointer to self NULL when creating "
-                    "a re-encryptor");
-            break;
-        }
-
-        *pself = NULL;
-
-        if (encrypted == NULL)
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-            LOGERR (klogErr, rc, 
-                    "encrypted file not supplied when creating "
-                    "an encryptor/decryptor");
-            break;
-        }
-
-        if ((enckey == NULL) || (deckey == NULL))
-        {
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-            LOGERR (klogErr, rc, 
-                    "key not supplied when creating a re-encryptor");
-            break;
-        }
-
-        switch (deckey->type)
-        {
-        default:
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "invalid key type '$(T)' should be "
-                      "kkeyAES128(1), kkeyAES192(2) or kkeyAES256(3)",
-                      "T=%u", deckey->type));
-            break;
-
-        case kkeyAES128:
-        case kkeyAES192:
-        case kkeyAES256:
-            break;
-        }
-        switch (enckey->type)
-        {
-        default:
-            rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "invalid key type '$(T)' should be "
-                      "kkeyAES128(1), kkeyAES192(2) or kkeyAES256(3)",
-                      "T=%u", enckey->type));
-            break;
-
-        case kkeyAES128:
-        case kkeyAES192:
-        case kkeyAES256:
-            break;
-        }
-    } while (0);
-    return rc;
-}
-
-
-/* ----------
- * Read mode is fully seekable if the underlying KFile is seekable some
- * integrity checking will not be performed in allowing this seeking.
- */
-static const KFile_vt_v1 vtKReencFileRead =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KReencFileDestroy,
-    KReencFileGetSysFileUnsupported,
-    KReencFileRandomAccess,
-    KReencFileSize,
-    KReencFileSetSizeUnsupported,
-    KReencFileRead,
-    KReencFileWriteUnsupported,
-
-    /* 1.1 */
-    KReencFileType
-};
-
-
-LIB_EXPORT rc_t CC KReencFileMakeRead (const KFile ** pself, 
-                                       const KFile * encrypted,
-                                       const KKey * deckey,
-                                       const KKey * enckey)
-{
-    KReencFile * self;
-    uint64_t size;
-    uint64_t block_count;
-    rc_t rc;
-
-    rc = KReencFileMakeParamValidate (pself, encrypted, deckey, enckey);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "error constructing decryptor");
-        return rc;
-    }
-
-    rc = KFileSize (encrypted, &size);
-    if (GetRCState (rc) == rcUnsupported)
-    {
-        size = 0;
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcSize, rcUnsupported);
-        LOGERR (klogErr, rc, "Can't re-encrypt files that don't support KFileSize");
-        return rc;
-    }
-    
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Unable to attempt to size encrypted file for reencryption");
-        return rc;
-    }
-
-    rc = KFileAddRef (encrypted);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Unable to add reference to encrypted file for re-encryptor");
-        return rc;
-    }
-
-    if (size == 0)
-    {
-        *pself = encrypted;
-        return rc;
-    }
-    if (size < sizeof (KEncFileHeader) + sizeof (KEncFileBlock) + sizeof (KEncFileFooter))
-    {
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcSize, rcTooShort);
-        LOGERR (klogErr, rc, "encrypted file too short to be valied for re-encryption");
-        KFileRelease (encrypted);
-        return rc;
-    }
-
-    {
-        uint64_t temp;
-
-        temp = size - (sizeof (KEncFileHeader) + sizeof (KEncFileFooter));
-        block_count = temp / sizeof (KEncFileBlock);
-        if ((block_count * sizeof (KEncFileBlock)) != temp)
-        {
-            rc = RC (rcKrypto, rcFile, rcConstructing, rcSize, rcInvalid);
-            LOGERR (klogErr, rc, "encrypted file invalid size for re-encryption");
-            KFileRelease (encrypted);
-            return rc;
-        }
-    }
-
-    self = calloc (1,sizeof (*self));
-
-    if (self == NULL)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-        LOGERR (klogSys, rc,
-                "out of memory creating encrypter and/or decryptor");
-    }
-    else
-    {
-        rc = KFileInit (&self->dad, (const KFile_vt*)&vtKReencFileRead, "KReencFile", "no-name", true, false);
-        if (rc)
-            LOGERR (klogInt, rc, "failed in initialize reenc base class");
-        else
-        {
-            self->encrypted = encrypted;
-            /* dec, enc, ram need to be Make */
-            /* num_read, num_write stay 0 */
-            self->block_id = NO_CURRENT_BLOCK;
-            /* missing needs to be Made */
-            /* next_block stays 0 */
-            /* seek_block stays 0 - obsolete */
-            self->footer_block = EncryptedPos_to_BlockId (size, NULL, NULL);
-            self->size = size;
-            self->known_size = true; /* obsolete */
-            /* plain_text and block stay 0 */
-            self->foot.foot.block_count = self->footer_block;
-
-            rc = KEncFileMakeRead (&self->dec, encrypted, deckey);
-            if (rc)
-                LOGERR (klogErr, rc, "Failed to create re-enc decryptor");
-
-            else
-            {
-                rc = KRamFileMakeUpdate (&self->ram, self->block.text, 
-                                         sizeof self->block.text);
-                if (rc)
-                    LOGERR (klogErr, rc, 
-                            "Failed to create re-enc encryptor");
-                else
-                {
-
-                    rc = KEncFileMakeWriteBlock (&self->enc, self->ram, enckey);
-                    if (rc)
-                        LOGERR (klogErr, rc,
-                                "Failed to create RAM file for reenc");
-                    else
-                    {
-                        *pself = &self->dad;
-                        return 0;
-                    }
-                    KFileRelease (self->ram);
-                }
-                KFileRelease (self->dec);
-            }
-        }
-        free (self);
-    }
-    KFileRelease (encrypted);
-    return rc;
-}
-
-
-static const KFile_vt_v1 vtKEncryptFileRead =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KReencFileDestroy,
-    KReencFileGetSysFileUnsupported,
-    KReencFileRandomAccess,
-    KEncryptFileSize,
-    KReencFileSetSizeUnsupported,
-    KReencFileRead,
-    KReencFileWriteUnsupported,
-
-    /* 1.1 */
-    KReencFileType
-};
-
-
-LIB_EXPORT rc_t CC KEncryptFileMakeRead (const KFile ** pself, 
-                                         const KFile * encrypted,
-                                         const KKey * enckey)
-{
-    KReencFile * self;
-    uint64_t rawsize;
-    uint64_t size;
-    uint64_t max_block;
-    rc_t rc;
-
-    rc = KReencFileMakeParamValidate (pself, encrypted, enckey, enckey);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "error constructing decryptor");
-        return rc;
-    }
-
-    rc = KFileSize (encrypted, &rawsize);
-    if (GetRCState (rc) == rcUnsupported)
-    {
-        size = 0;
-        rc = RC (rcKrypto, rcFile, rcConstructing, rcSize, rcUnsupported);
-        LOGERR (klogErr, rc, "Can't encrypt files that don't support KFileSize");
-        return rc;
-    }
-    
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Unable to attempt to size encrypted file for encryption");
-        return rc;
-    }
-
-    rc = KFileAddRef (encrypted);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Unable to add reference to unencrypted file for encryptor");
-        return rc;
-    }
-
-    if (rawsize == 0)
-    {
-        *pself = encrypted;
-        return rc;
-    }
-
-    self = calloc (1,sizeof (*self));
-
-    if (self == NULL)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-        LOGERR (klogSys, rc,
-                "out of memory creating encrypter and/or decryptor");
-    }
-    else
-    {
-        rc = KFileInit (&self->dad, (const KFile_vt*)&vtKEncryptFileRead, "KEncryptFile", "no-path", true, false);
-        if (rc)
-            LOGERR (klogInt, rc, "failed in initialize reenc base class");
-        else
-        {
-            self->encrypted = encrypted;
-            /* dec, enc, ram need to be made below */
-            /* num_read, num_write stay 0 */
-            self->block_id = NO_CURRENT_BLOCK;
-            /* missing needs to be Made */
-            /* next_block stays 0 */
-            /* seek_block stays 0 - obsolete */
-            max_block = DecryptedPos_to_BlockId (rawsize, NULL);
-            self->footer_block = max_block + 1;
-            size = BlockId_to_EncryptedPos (self->footer_block) + sizeof (KEncFileFooter);
-            self->size = size;
-            self->known_size = true; /* obsolete */
-
-            /* plain_text and block stay 0 */
-            self->foot.foot.block_count = self->footer_block;
-
-            rc = KFileAddRef (self->dec = encrypted);
-            if (rc)
-                LOGERR (klogErr, rc, "Unable to add reference to unencrypted file for encryptor");
-
-            else
-            {
-                rc = KRamFileMakeUpdate (&self->ram, self->block.text, 
-                                         sizeof self->block.text);
-                if (rc)
-                    LOGERR (klogErr, rc, 
-                            "Failed to create ram file for encryptor");
-                else
-                {
-                    
-                    rc = KEncFileMakeWriteBlock (&self->enc, self->ram, enckey);
-                    if (rc)
-                        LOGERR (klogErr, rc,
-                                "Failed to create RAM file for enc");
-                    else
-                    {
-                        *pself = &self->dad;
-                        return 0;
-                    }
-                    KFileRelease (self->ram);
-                }
-                KFileRelease (self->dec);
-            }
-        }
-        free (self);
-    }
-    KFileRelease (encrypted);
-    return rc;
-}
-
-
-/* ----------
- * Write mode re-encrypted file 
- */
-static const KFile_vt_v1 vtKReencFileWrite =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KReencFileDestroy,
-    KReencFileGetSysFileUnsupported,
-    KReencFileRandomAccess,
-    KReencFileSize,
-    KReencFileSetSizeUnsupported,
-    KReencFileReadUnsupported,
-    KReencFileWrite,
-
-    /* 1.1 */
-    KReencFileType
-};
-
-
-LIB_EXPORT rc_t CC KReencFileMakeWrite (KFile ** pself, 
-                                        KFile * encrypted,
-                                        const KKey * deckey,
-                                        const KKey * enckey)
-{
-#if REENCFILE_WRITE_SUPPORTED
-    KReencFile * self;
-    rc_t rc;
-
-    rc = KFileSetSize (encrypted, 0);
-#if 0
-    if (rc)
-        LOGERR (klogWarn, rc, "error truncating output file - "
-                "corrupted file might result");
-#endif
-
-    rc = KReencFileMakeParamValidate (&self, encrypted, deckey, enckey,
-                                      &vtKEncFileWrite, true);
-    if (rc)
-        LOGERR (klogErr, rc, "error creating encryptor");
-    else
-        *pself = &self->dad;
-    return rc;
-#else
-    return RC ( rcFS, rcFile, rcCreating, rcFunction, rcUnsupported );
-#endif
-}
-
-
-/* end of file reencfile.c */
-
-
diff --git a/libs/krypto/rng-impl.h b/libs/krypto/rng-impl.h
deleted file mode 100644
index 04b3418..0000000
--- a/libs/krypto/rng-impl.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kryptoimpl_
-#define _h_kryptoimpl_
-
-#include <klib/rc.h>
-#include <klib/refcount.h>
-#include <atomic.h>
-#include <krypto/rng.h>
-#include "rng-priv.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-
-typedef union KRng_vt KRng_vt;
-
-
-
-
-#ifndef KRNG_IMPL
-#define KRNG_IMPL KRng
-#endif
-
-typedef struct KRng_vt_v1 KRng_vt_v1;
-struct KRng_vt_v1
-{
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t (CC * destroy) (KRNG_IMPL * self);
-    rc_t (CC * seed)    (KRNG_IMPL * self);
-    rc_t (CC * reseed)  (KRNG_IMPL * self, const void * buff, size_t buff_size);
-    rc_t (CC * read)    (const KRNG_IMPL *self, void * buff, uint32_t buff_len,
-                         uint32_t * num_read);
-    /* end minor version == 0 */
-    /* start minor version == 1 */
-    /* end minor version == 1 */
-    /* end version == 1.x */
-};
-
-union KRng_vt
-{
-    KRng_vt_v1 v1;
-};
-
-static
-rc_t KRngInit (KRng * self, union KRng_vt * vt, const char * type)
-{
-    self->vt = vt;
-    KRefcountInit (&self->refcount, 1, "KRng", "Init", type);
-    return 0;
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_kryptoimpl_ */
diff --git a/libs/krypto/rng-priv.h b/libs/krypto/rng-priv.h
deleted file mode 100644
index e69de29..0000000
diff --git a/libs/krypto/rng.c b/libs/krypto/rng.c
deleted file mode 100644
index f19c4f9..0000000
--- a/libs/krypto/rng.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <krypto/extern.h>
-#include <krypto/rng.h>
-#include <krypto/rng-impl.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/refcount.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-LIB_EXPORT rc_t CC KRngAddRef (const KRng * self)
-{
-    if (self) switch (KRefcountAdd (&self->refcount, "KRng"))
-    {
-    case krefLimit:
-        return RC (rcRuntime, rcNoTarg, rcAttaching, rcRange, rcExcessive);
-    }
-
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KRngRelease (const KRng * self)
-{
-    if (self) switch (KRefcountDrop (&self->refcount, "KRng"))
-    {
-    case krefWhack:
-        switch (self->vt->v1.maj)
-        {
-        case 1:
-            return (self->vt->v1.destroy ((KRng*)self));
-        }
-        return RC (rcKrypto, rcRng, rcAccessing, rcSelf, rcBadVersion);
-    }
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC KRngSeed (KRng * self)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcSelf, rcNull);
-
-    switch (self->vt->v1.maj)
-    {
-    case 1:
-        return (self->vt->v1.seed (self));
-    }
-    return RC (rcKrypto, rcRng, rcAccessing, rcSelf, rcBadVersion);
-}
-
-
-LIB_EXPORT rc_t CC KRngReseed (KRng * self, void * buffer, size_t bsize)
-{
-    if (self == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcSelf, rcNull);
-    if (buffer == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcBuffer, rcNull);
-
-    switch (self->vt->v1.maj)
-    {
-    case 1:
-        return (self->vt->v1.reseed (self, buffer, bsize));
-    }
-    return RC (rcKrypto, rcRng, rcAccessing, rcSelf, rcBadVersion);
-}
-
-LIB_EXPORT rc_t CC KRngRead (const KRng * self, void * buffer, uint32_t bsize, uint32_t * num_read)
-{
-    if (num_read == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcParam, rcNull);
-    *num_read = 0;
-    if (self == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcSelf, rcNull);
-    if (buffer == NULL)
-        return RC (rcKrypto, rcRng, rcReading, rcBuffer, rcNull);
-
-    switch (self->vt->v1.maj)
-    {
-    case 1:
-        return (self->vt->v1.read (self, buffer, bsize, num_read));
-    }
-    return RC (rcKrypto, rcRng, rcAccessing, rcSelf, rcBadVersion);
-}
-
-LIB_EXPORT rc_t CC KRngInit (KRng * self, union KRng_vt * vt, const char * type)
-{
-    self->vt = vt;
-    KRefcountInit (&self->refcount, 1, "KRng", "Init", type);
-    return 0;
-}
-
-    
diff --git a/libs/krypto/testcipher.c b/libs/krypto/testcipher.c
deleted file mode 100644
index d23257f..0000000
--- a/libs/krypto/testcipher.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-#include <krypto/extern.h>
-#include <klib/defs.h>
-
-#include <krypto/cipher-test.h>
-#include "cipher-priv.h"
-#include <klib/rc.h>
-
-
-KRYPTO_EXTERN
-rc_t KCipherTestVecAesNiMake (struct KCipher ** new_cipher, kcipher_type type)
-{
-    if (new_cipher == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-        return KCipherVecAesNiMake (new_cipher, type);
-}
-
-
-KRYPTO_EXTERN
-rc_t KCipherTestVecRegMake   (struct KCipher ** new_cipher, kcipher_type type)
-{
-    if (new_cipher == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-        return KCipherVecRegMake (new_cipher, type);
-}
-
-
-KRYPTO_EXTERN
-rc_t KCipherTestVecMake      (struct KCipher ** new_cipher, kcipher_type type)
-{
-    if (new_cipher == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-        return KCipherVecMake (new_cipher, type);
-}
-
-
-KRYPTO_EXTERN
-rc_t KCipherTestByteMake     (struct KCipher ** new_cipher, kcipher_type type)
-{
-    if (new_cipher == NULL)
-        return RC (rcKrypto, rcCipher, rcConstructing, rcSelf, rcNull);
-
-    else
-        return KCipherByteMake (new_cipher, type);
-}
-
-
diff --git a/libs/krypto/wgaencrypt.c b/libs/krypto/wgaencrypt.c
deleted file mode 100644
index 0efc901..0000000
--- a/libs/krypto/wgaencrypt.c
+++ /dev/null
@@ -1,1254 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- */
-
-#include <krypto/extern.h>
-#include <krypto/cipher.h>
-#include <krypto/ciphermgr.h>
-
-#include <krypto/wgaencrypt.h>
-
-#include <kfs/file.h>
-#include <kfs/countfile.h>
-#include <kfs/md5.h>
-#include <kfs/buffile.h>
-#include <kfs/nullfile.h>
-
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/checksum.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-
-#include <sysalloc.h>
-
-#include <strtol.h>
-
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include <os-native.h> /* strncasecmp on Windows */
-
-/* retain errors in encryption to be compatible with C++ */
-#define RETAINED_COMPATIBILTY_WITH_ERROR 1
-
-
-#define WGA_AES_BITS (256)
-#define ECB_BYTES (16)
-#define DEFAULT_BUFF_SIZE       (32*1024)
-
-
-#define DEBUG_STS(msg)     DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_STS),msg)
-#define DEBUG_CFG(msg)     DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_CFG_,msg)
-#define DEBUG_ENCRYPT(msg) DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_ENCRYPT_,msg)
-#define DEBUG_DECRYPT(msg) DBGMSG(DBG_KRYPTO,DBG_FLAG(DBG_KRYPTO_DECRYPT_,msg)
-
-static
-void CalcMD5 (void * buffer, size_t size, char hexstr [32])
-{
-    static const char to_hex[16] = "0123456789abcdef";
-    MD5State state;
-    uint8_t digest [16];
-    uint8_t * bin;
-    char * hex;
-    int ix;
-
-    MD5StateInit (&state);
-    MD5StateAppend (&state, buffer, size);
-    MD5StateFinish (&state, digest);
-
-    bin = digest;
-    hex = hexstr;
-
-    for (ix = 0; ix < sizeof digest; ++ix)
-    {
-        uint8_t upper;
-        uint8_t lower;
-
-        upper = *bin++;
-        lower = upper & 0xF;
-        upper >>= 4;
-
-        *hex++ = to_hex [upper];
-        *hex++ = to_hex[lower];
-    }
-}
-
-
-/* ----------------------------------------------------------------------
- * KWGAEncFileMagic is extracted from 
- *      internal/WGA/access_countrol/src/wga/fuse/enc_reader.[ch]pp
- * 
- * the size 9 is not commented on but appears to be the size of ASCIZ
- * that is the 'magic' pattern including the NUL.
- *
- * There is no version number in the header and that NUL could be turned
- * into a single byte version.
- */
-typedef char KWGAEncFileMagic [9];
-static const KWGAEncFileMagic ncbi_crypt_magic = "NeCnBcIo";
-
-/* ----------------------------------------------------------------------
- * Some values are stored in the encrypted file header using an odd radix 33
- */
-#define KWGA_ENC_FILE_HEADER_RADIX      (33)
-
-static
-const char KWGAEncFileHeaderAlphabet[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-
-
-/* ----------------------------------------------------------------------
- * KWGAEncFileHeader is extracted from 
- *      internal/WGA/access_countrol/src/wga/fuse/enc_reader.[ch]pp
- *
- * There is no version number in this header; see the comment about KWGAEncFileMagic
- */
-typedef uint8_t FER_ENCODING;
-enum
-{
-    fer_encDES,
-    fer_encBLF,
-    fer_encAES
-};
-
-typedef struct KWGAEncFileHeader
-{
-    char magic [9];     /* "NeCnBcIo" -- NUL could be turned into a version */          /* 00 */
-    char block_sz [8];  /* radixx33 encoded: block size in bytes / usually 4096  */     /* 09 */
-    char file_sz [16];  /* radixx33 encoded: total size of unencrypted file */          /* 11 */
-    char mtime [8];     /* radixx33 encoded: 32 bit time_t  */                          /* 21 */
-    char fer_enc;       /* see FER_ENCODING */                                          /* 29 */
-    char md5_here;      /* bool if non zero, the whole file MD5 is below */             /* 2A */
-    char md5 [32];      /* whole file MD5 is ASCII hex */                               /* 2B */
-    char md51 [32];     /* first block MD5 */                                           /* 4B */
-    char reserved [21];                                                                 /* 6B */
-} KWGAEncFileHeader;                                                                    /* 80 */
-
-/* Original definition is in internal/WGA/access_countrol/src/wga/fuse/enc_reader.hpp */
-static const int8_t header_table[sizeof (KWGAEncFileHeader)] =
-{
-    101,  -6,   -23,  5,    -93,  20,   -128, -36,      /* 00 */
-    -42,  74,   -98,  104,  42,   12,   127,  37,       /* 08 */
-    -47,  -61,  124,  54,   -124, -94,  47,   72,       /* 10 */
-    70,   17,   -10,  108,  8,    31,   37,   -38,      /* 18 */
-    104,  -6,   -117, 79,   115,  89,   33,   -93,      /* 20 */
-    -47,  -105, -87,  -38,  90,   -45,  -59,  -46,      /* 28 */
-    -96,  106,  15,   -87,  -110, -101, 106,  -117,     /* 30 */
-    39,   73,   120,  -30,  -63,  21,   127,  -32,      /* 38 */
-    98,   -104, -3,   -81,  -60,  -120, 13,   -108,     /* 40 */
-    -53,  88,   123,  7,    103,  32,   -14,  -113,     /* 48 */
-    -68,  -27,  44,   109,  -122, -7,   81,   -13,      /* 50 */
-    64,   42,   -88,  -37,  -1,   -19,  66,   -105,     /* 58 */
-    -75,  -108, -5,   -121, -86,  47,   -120, -18,      /* 60 */
-    -69,  -29,  -68,  124,  -53,  -104, -28,  42,       /* 68 */
-    120,  52,   -80,  -23,  -110, -101, 106,  -117,     /* 70 */
-    -21,  -35,  12,   -117, 9,    -122, -21,  31        /* 78 */
-};                                                      /* 80 */
-
-static const KWGAEncFileHeader header_const =
-{
-    "NeCnBcIo", /* NUL terminator is significant */
-    {0},{0},{0},/* not constant */
-    fer_encAES, /* constant as DES and Blowfish are not implmented */
-    0,{0},{0},  /* not constant */
-    {0}         /* constant */
-};
-
-/* the header is obscured by XOR against a predefined pattern */
-static
-void KWGAEncFileHeaderDecrypt (KWGAEncFileHeader * header)
-{
-    size_t ix;
-    int8_t * p = (int8_t*)header;
-
-    assert (header);
-    for (ix = 0; ix < sizeof (*header); ++ix)
-        p[ix] ^= header_table[ix];
-}
-
-KRYPTO_EXTERN rc_t CC KFileIsWGAEnc (const void * buffer, size_t buffer_size)
-{
-    const uint8_t * ph;
-    const uint8_t * pt;
-    const uint8_t * pb;
-    int ix;
-    int lim;
-
-    if ((buffer == NULL) || (buffer_size == 0))
-        return RC  (rcFS, rcFile, rcIdentifying, rcParam, rcNull); 
-
-    /* bare minimum size to identify we decide is the first 8 
-     * obsfucated ASCII bytes */
-
-    if (buffer_size < (sizeof (header_const.magic) - 1))
-        return RC (rcFS, rcFile, rcIdentifying, rcBuffer, rcInsufficient); 
-
-    /* a match is ph[X] ^ pt[X] == pb[X] at specially identified points
-     * we could have put the ^ into a constant for a tad faster operation
-     * but meh...
-     */
-    ph = (const uint8_t*)&header_const;
-    pt = (const uint8_t*)&header_table;
-    pb = (const uint8_t*)buffer;
-
-    ix = offsetof (struct KWGAEncFileHeader, magic);
-    lim = ix + sizeof (header_const.magic);
-    if (lim > buffer_size)
-        lim = buffer_size;
-    for (; (ix < lim) && (ix < buffer_size); ++ix)
-        if ((ph[ix] ^ pt[ix]) != pb[ix])
-            return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType); 
-
-    if (buffer_size < offsetof (struct KWGAEncFileHeader, fer_enc))
-        return 0;
-
-    if ((ph[offsetof (struct KWGAEncFileHeader, fer_enc)] ^ pt[offsetof (struct KWGAEncFileHeader, fer_enc)])
-        != pb[offsetof (struct KWGAEncFileHeader, fer_enc)])
-        return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType); 
-
-
-    ix = offsetof (struct KWGAEncFileHeader, reserved);
-    if (buffer_size < ix)
-        return 0;
-
-    lim = ix + sizeof (header_const.reserved);
-
-    if (lim > buffer_size)
-        lim = buffer_size;
-    
-    for (; ix < lim; ++ix)
-        if ((ph[ix] ^ pt[ix]) != pb[ix])
-            return RC (rcFS, rcFile, rcIdentifying, rcFile, rcWrongType);
-
-    return 0;
-}
-
-
-
-
-
-
-/* ======================================================================
- * KWGAEncFile
- */
-
-/* -----
- * define the specific types to be used in the templatish/inheritancish
- * definition of vtables and their elements
- */
-typedef struct KWGAEncFile KWGAEncFile;
-#define KFILE_IMPL struct KWGAEncFile
-
-#include <kfs/impl.h>
-
-struct KWGAEncFile
-{
-    KFile dad;                  /* base class */
-    const KFile * encrypted;    /* encrypted file as a read only KFile */
-    uint64_t file_size;         /* as read from the encrypted file header */
-    KTime_t mtime;              /* as read from the encrypted file header */
-    uint32_t block_size;        /* block size is in KB  not bytes */
-    KCipher * cipher;
-
-    char inkey [32];
-    size_t inkey_size;
-
-    bool md5_here;              /* was the md5 in the header? */
-    char md5[32];            /* external md5 loaded into the header as ASCII hex */
-    char md51[32];           /* md5 of first block loaded into the header as ASCII hex */
-    struct
-    {
-        uint64_t  offset;       /* position with in the unencrypted file */
-        uint32_t  valid;        /* how much usable at data */
-        uint8_t   data [DEFAULT_BUFF_SIZE];
-    } buffer;
-};
-
-
-/* ----------------------------------------------------------------------
- * InitKey
- *
- * This method mimics the prepare_key method in the WGA C++ code including
- * what looks like programming errors.
- *
- * The goal is compatibility not 'correctness'.
- */
-static
-rc_t KWGAEncFileKeyInit (KWGAEncFile * self, const char * key, size_t key_size)
-{
-    rc_t rc;
-    char g_key [32];  /* original used 513 but no key uses that much */
-
-    /* scary! */
-    /* this is copied directly from enc_read.cpp with all the 'possibly wrong' code */
-    memset (g_key, 0, sizeof g_key);
-    if (key_size > sizeof (g_key))
-        key_size = sizeof (g_key);
-    memcpy (g_key, key, key_size);
-
-    if (key_size < 16) /* even though g_key and some cipher keys are larger than 16 */
-    {
-        int jx, ix;
-        for ((jx = key_size),(ix = 0); jx < 16; ++jx, ++ix)
-        {
-            g_key[jx] = self->md51[ix] | g_key[ix%(jx?jx:1)];    /* cringe? */
-        }
-    }
-
-    /* okay we'll use 32 bytes from g_key though is is highly
-     * likely we've only got 16 non-zero bytes */
-     rc = KCipherSetDecryptKey (self->cipher, g_key, WGA_AES_BITS/8);
-
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * Destroy
- *
- */
-static
-rc_t CC KWGAEncFileDestroyRead (KWGAEncFile *self)
-{
-    rc_t rc = 0;
-
-    if (self)
-    {
-        rc = KFileRelease (self->encrypted);
-        free (self);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- *
- * We do not allow this for read, write or update as you can not memory map the 
- * unencrypted file in a meaningful way.
- */
-static
-struct KSysFile *CC KWGAEncFileGetSysFile (const KWGAEncFile *self, uint64_t *offset)
-{
-    assert (self);
-    assert (offset);
-    return NULL;
-}
-
-
-/* ----------------------------------------------------------------------
- * RandomAccess
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t CC KWGAEncFileRandomAccess (const KWGAEncFile *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-    return KFileRandomAccess (self->encrypted);
-}
-
-
-/* ----------------------------------------------------------------------
- * Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t CC KWGAEncFileSize (const KWGAEncFile *self, uint64_t *size)
-{
-    uint64_t esize;
-    rc_t rc;
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-    assert (size != NULL);
-
-    *size = 0;
-    rc = KFileSize (self->encrypted, &esize);
-    if (rc == 0)
-        *size = esize - sizeof (KWGAEncFileHeader);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KWGAEncFileSetSize (KWGAEncFile *self, uint64_t size)
-{
-    assert (self);
-
-    return RC ( rcFS, rcFile, rcUpdating, rcFunction, rcUnsupported );
-}
-
-
-/* ----------------------------------------------------------------------
- * Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-
-/* local fill the buffer with block or more  */
-static
-rc_t KWGAEncFileReadInt (KWGAEncFile * self, uint64_t pos, size_t bsize)
-{
-    uint64_t adjpos;
-    size_t tot_read;
-    size_t num_read;
-    rc_t rc = 0;
-
-    assert (self);
-    assert (bsize);
-    assert (bsize <= 32 * 1024);
-    assert (128%16 == 0);
-
-    memset (self->buffer.data, 0, sizeof self->buffer.data);
-    tot_read = num_read = 0;
-    adjpos = pos + sizeof (KWGAEncFileHeader);
-#if 0
-    do
-    {
-        rc = KFileRead (self->encrypted, adjpos + tot_read,
-                        self->buffer.data + tot_read, bsize - tot_read,
-                        &num_read);
-        if (rc)
-            return rc;        
-        tot_read += num_read;
-    } while ((tot_read < bsize) && (num_read > 0));
-#else
-    rc = KFileReadAll (self->encrypted, adjpos, self->buffer.data, bsize,
-                       &tot_read);
-#endif
-    self->buffer.offset = pos;
-    self->buffer.valid = tot_read;
-
-    if (tot_read & 15)
-        rc = RC (rcKrypto, rcFile, rcReading, rcSize, rcInsufficient);
-    else if (tot_read > 0)
-    {
-#if 1
-
-#if RETAINED_COMPATIBILTY_WITH_ERROR
-        KCipherDecryptECB (self->cipher, self->buffer.data, self->buffer.data,
-                           (tot_read / ECB_BYTES));
-#else
-/* Well this is wrong for even being wrong now */
-        KCipherDecryptECB (self->cipher, self->buffer.data, self->buffer.data,
-                           tot_read);
-#endif
-
-#else
-        uint32_t count;
-        uint32_t ix;
-
-        /* this loop can be replaced by the KCipherDecryptECB
-         * with care taken to match the error in the original
-         * C++
-         */
-
-#if RETAINED_COMPATIBILTY_WITH_ERROR
-        count = tot_read / ECB_BYTES;
-#else
-        /* do all full 16 byte blocks plus a last partial block */
-        count = (tot_read + (ECB_BYTES-1)) / ECB_BYTES;
-#endif
-        for (ix = 0; ix < count; ++ix)
-        {
-            uint8_t * pb = self->buffer.data + (ix * ECB_BYTES);
-
-            rc = KCipherDecrypt (self->cipher, pb, pb);
-            if (rc)
-                break;
-        }
-#endif
-    }
-    return rc;
-}
-
-
-static
-rc_t CC KWGAEncFileRead	(const KWGAEncFile *cself,
-                         uint64_t pos,
-                         void *buffer,
-                         size_t bsize,
-                         size_t *num_read)
-{
-    KWGAEncFile * self = (KWGAEncFile *)cself; /* mutable values */
-    rc_t rc = 0;
-
-    assert (cself);
-    assert (buffer);
-    assert (num_read);
-
-
-    *num_read = 0;
-
-    /* are we even within the file? If not just say no. Drugs are bad Mmmkay */
-    if (pos >= self->file_size)
-    {}
-    /* are we not reading from out what is already in the decrypted buffer space? */
-    else
-    {
-        if ((self->buffer.valid == 0) ||
-            (pos < self->buffer.offset) ||
-            (pos >= (self->buffer.offset + self->buffer.valid)))
-        {
-            if (pos < self->block_size) /* we'll be reading from the first 'block' */
-            {
-                rc = KWGAEncFileReadInt (self, 0, self->block_size);
-                if (rc)
-                {
-                    LOGERR (klogErr, rc, "error reading first data block of"
-                            " encrypted file");
-                    return rc;
-                }
-                if (self->buffer.valid > self->block_size)
-                {
-                    rc = RC (rcFS, rcFile, rcReading, rcBuffer, rcTooBig);
-                    LOGERR (klogInt, rc, "read wrong amount for first block");
-                    return rc;
-                }
-                else
-                {
-                    size_t md5_size;
-                    size_t nudge = 0;
-                    char md51_comp [32];
-
-                    if (self->buffer.valid & (ECB_BYTES-1))
-                        nudge = ECB_BYTES - (self->buffer.valid & (ECB_BYTES-1));
-                    if (nudge)
-                        memset (self->buffer.data + self->buffer.valid, 0, nudge);
-
-                    md5_size = self->buffer.valid + nudge;
-
-                    CalcMD5 (self->buffer.data, md5_size, md51_comp);
-
-#if 1
-                    if (strcase_cmp (self->md51, string_size(self->md51),
-                                     md51_comp, string_size(md51_comp), 32) != 0)
-#else
-                    if (strncasecmp (self->md51, md51_comp, 32) != 0)
-#endif
-                    {
-                        rc = RC (rcFS, rcFile, rcReading, rcConstraint, rcCorrupt);
-                        LOGERR (klogErr, rc, "MD5 does not match in decryption");
-                        return rc;
-                    }
-                }
-            }
-            else /* if (pos >= self->block_size) */
-            {
-                rc = KWGAEncFileReadInt (self, (pos & ~ ( uint64_t ) (16-1)),
-                                         DEFAULT_BUFF_SIZE);
-                if (rc)
-                {
-                    LOGERR (klogErr, rc, "error reading data block of"
-                            " encrypted file");
-                    return rc;
-                }
-            }  /* if (pos < self->block_size) */
-        } /* if ((self->buffer.valid == 0) || etc. */
-        /* if here we have a valid buffer and it contains the start pos requested */
-/*     assert (pos >= self->buffer.offset); */
-/*     assert (pos < (self->buffer.offset +self->buffer.valid)); */
-        {
-            size_t start;
-            size_t limit;
-
-            /* find offset of start for copy within the buffer */
-            start = (size_t)(pos - self->buffer.offset);
-            /* how many bytes available starting here */
-            limit = self->buffer.valid - start;
-
-            if (pos + limit > self->file_size)
-                limit = self->file_size - pos;
-
-            /* are we asking to read more than we have? is so trim the request */
-            if (limit < bsize)
-                bsize = limit;
-
-            memmove (buffer, self->buffer.data + start, bsize);
-            *num_read = bsize;
-        }
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- *
- * Unsupported as we now treat archives as READ ONLY
- */
-static
-rc_t CC KWGAEncFileWriteFail (KWGAEncFile *self, uint64_t pos,
-                              const void *buffer, size_t bsize,
-                              size_t *num_writ)
-{
-    assert (self);
-    return RC (rcFS, rcFile, rcReading, rcFunction, rcUnsupported);
-}
-
-
-/* ----------------------------------------------------------------------
- * Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t CC KWGAEncFileType (const KWGAEncFile *self)
-{
-    assert (self != NULL);
-    assert (self->encrypted != NULL);
-
-    return KFileType (self->encrypted);
-}
-
-
-static const KFile_vt_v1 vtKWGAEncFileRead =
-{
-    /* version */
-    1, 1,
-
-    /* 1.0 */
-    KWGAEncFileDestroyRead,
-    KWGAEncFileGetSysFile,
-    KWGAEncFileRandomAccess,
-    KWGAEncFileSize,
-    KWGAEncFileSetSize,
-    KWGAEncFileRead,
-    KWGAEncFileWriteFail,
-
-    /* 1.1 */
-    KWGAEncFileType
-};
-
-
-static
-rc_t KWGAEncFileHeaderRead (KWGAEncFile * self)
-{
-    KWGAEncFileHeader header;
-    uint8_t * pb;
-    size_t num_read;
-    size_t tot_read;
-    rc_t rc;
-
-    assert (self);
-    assert (sizeof (KWGAEncFileHeader) == 128);
-
-
-    DEBUG_STS (("s: Enter '%p'\n", __func__, self));
-    pb = (void*)&header;
-    for (num_read = tot_read = 0; tot_read < sizeof header; )
-    {
-        rc = KFileRead (self->encrypted, (uint64_t)tot_read, pb, 
-                        sizeof (header) - tot_read, &num_read);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "Error reading the header for an encrypted file");
-            return rc;
-        }
-
-        if (num_read == 0)
-        {
-            rc =  RC (rcFS, rcFile, rcReading, rcFile, rcInsufficient);
-            LOGERR (klogErr, rc, "Header incomplete for an encrypted file");
-            return rc;
-        }
-        tot_read += num_read;
-        pb += num_read;
-    }
-
-    KWGAEncFileHeaderDecrypt (&header);
-
-    if (memcmp (header.magic, ncbi_crypt_magic, sizeof ncbi_crypt_magic) != 0)
-    {
-        rc = RC (rcFS, rcFile, rcReading, rcHeader, rcCorrupt);
-        LOGERR (klogErr, rc, "Header's magic bad for encrypted file");
-        return rc;
-    }
-
-    /* so far unknown legal range */
-    self->block_size = strtou32 (header.block_sz, NULL, KWGA_ENC_FILE_HEADER_RADIX);
-
-    self->file_size = strtou64 (header.file_sz, NULL, KWGA_ENC_FILE_HEADER_RADIX);
-
-    /* file format has limiting feature of a 32 bit timestamp */
-    self->mtime = (KTime_t)strtol (header.mtime, NULL, KWGA_ENC_FILE_HEADER_RADIX);
-
-    switch ((FER_ENCODING)header.fer_enc)
-    {
-    default:
-        rc = RC (rcFS, rcFile, rcReading, rcHeader, rcOutofrange);
-        LOGERR (klogErr, rc, "Enryption type code out of range");
-        return rc;
-    case fer_encDES:
-    case fer_encBLF:
-        rc = RC (rcFS, rcFile, rcReading, rcHeader, rcIncorrect);
-        LOGERR (klogErr, rc, "Enryption type code not supported");
-        return rc;
-    case fer_encAES:
-        break;
-    }
-
-    self->md5_here = (header.md5_here != 0);
-
-    if (self->md5_here)
-        memcpy (self->md5, header.md5, sizeof (self->md5));
-
-    memcpy (self->md51, header.md51, sizeof (self->md51));
-
-    return 0; /* yeah not really checking later errors am i? */
-}
-
-/* ----------------------------------------------------------------------
- * KWGAEncFileMake
- *  create a new file object
- *
- * pself        where to put pointer to new object
- * encrypted    a readable file that is encrypted
- * cipher       a cipher object that must support AES with 256 bit key
- *              not verified except through failure to decrypt a file
- * key          bytes containing the user key - should be utf-8 but with no
- *              control characters
- * key_size     how many bytes to use from the key 
- */
-/* read only version for decrypting of existing files */
-KRYPTO_EXTERN rc_t CC KFileMakeWGAEncRead (const struct KFile ** pself, 
-                                           const struct KFile * encrypted,
-                                           const char * key,
-                                           size_t key_size)
-{
-    rc_t rc;
-
-    if (pself == NULL)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcSelf, rcNull);
-        LOGERR (klogErr, rc, "key parameter for WGA encrypted file is empty");
-        return rc;
-    }
-
-    *pself = NULL;
-
-    if ((encrypted == NULL)||(key == NULL))
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcNull);
-        LOGERR (klogErr, rc, "missing WGA encrypted file passed in to constructor");
-    }
-
-    else if (key_size == 0)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcInvalid);
-        LOGERR (klogErr, rc, "missing WGA encrypted file passed in to constructor");
-    }
-
-    else if (encrypted->read_enabled == 0)
-    {
-        rc = RC (rcFS, rcFile, rcConstructing, rcParam, rcIncorrect);
-        LOGERR (klogErr, rc, "encrypted file not readable");
-    }
-    else
-    {
-        KCipherManager * cipher_mgr;
-
-        rc = KCipherManagerMake (&cipher_mgr);
-        if (rc == 0)
-        {
-            KCipher * cipher;
-
-            rc = KCipherManagerMakeCipher (cipher_mgr, &cipher, kcipher_AES);
-            if (rc == 0)
-            {
-                size_t z;
-
-                rc = KCipherBlockSize (cipher, &z);
-                if (rc)
-                {
-                    LOGERR (klogErr, rc, "unable to get block size for WGA "
-                            "encrypted file cipher passed in to constructor");
-                }
-                else
-                {
-                    if (z != ECB_BYTES)
-                    {
-                        rc = RC (rcFS, rcFile, rcConstructing, rcParam,
-                                 rcInvalid);
-                        LOGERR (klogErr, rc, "wrong block size for WGA "
-                                "encrypted file cipher passed in to "
-                                "constructor");
-                    }
-                    else
-                    {
-                        KWGAEncFile * self;
-
-                        self = calloc (sizeof (*self), sizeof (uint8_t));
-                        if (self == NULL)
-                        {
-                            rc = RC (rcFS, rcFile, rcConstructing, rcMemory,
-                                     rcExhausted);
-                            LOGERR (klogErr, rc, "out of memory while "
-                                    "constructing decryptor");
-                        }
-                        else
-                        {
-                            rc = KFileAddRef (encrypted);
-                            if (rc)
-                                LOGERR (klogErr, rc, "unable to add reference "
-                                "to encrypted file");
-                            else
-                            {
-                                /* cast to strip const */
-                                self->encrypted = encrypted;
-                                self->cipher = cipher;
-
-                                /* read the header of the encrypted file for
-                                 * details about the  decrypted file */
-                                DEBUG_STS(("%s: calling KWGAEncFileHeaderRead\n",
-                                           __func__));
-                                rc = KWGAEncFileHeaderRead (self);
-                                if (rc == 0)
-                                {
-                                    /* using the file header's stored encoding
-                                     * key build a key from the parameter key */
-                                    DEBUG_STS(("%s: calling "
-                                               "KWGAEncFileHeaderRead\n",
-                                               __func__));
-                                    rc = KWGAEncFileKeyInit (self, key,
-                                                             key_size);
-                                }
-                                if (rc == 0)
-                                {
-                                    rc = KFileInit (&self->dad, 
-                                                    (const KFile_vt*)
-                                                    &vtKWGAEncFileRead,
-                                                    "KWGAEncFile", "no-name",
-                                                    true, false);
-                                    if (rc)
-                                        LOGERR (klogInt, rc, "Failed to initialize decrypting file");
-                                    else
-                                    {
-                                        *pself = &self->dad;
-                                        self->buffer.offset = 0;
-                                        self->buffer.valid = 0;
-                                        KCipherManagerRelease (cipher_mgr);
-                                        return 0;
-                                    }
-                                }
-                                /* release of encrypted handled in destroy() */
-                            }
-                            KWGAEncFileDestroyRead (self);
-                        }
-                    }
-                }
-                KCipherRelease (cipher);
-            }           
-        }
-    }
-    return rc; 
-}
-
-static __inline__
-rc_t WGAEncValidateHeader (const KWGAEncFileHeader * header,
-                           size_t header_size)
-{
-    rc_t rc = 0;
-    unsigned ix;
-
-    if (header_size != sizeof * header)
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcHeader, rcInsufficient);
-        LOGERR (klogErr, rc, "incomplete header");
-        return rc;
-    }
-
-    if (memcmp (header, &header_const, sizeof header->magic) != 0)
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcHeader, rcInvalid);
-        LOGERR (klogErr, rc, "bad signature in encrypted file header");
-        return rc;
-    }
-
-#if 0
-    /* check block_size */
-    do
-    {
-        for (ix = 0; isspace(header->block_sz[ix]); ++ix)
-            ;
-
-        if (ix >= sizeof (header->block_sz))
-            break;
-
-        if (header->block_sz[ix] == '+')
-            ++ix;
-
-        if (ix >= sizeof (header->block_sz))
-            break;
-
-        for (; (ix < sizeof header->block_sz); ++ix)
-        {
-            if (isdigit (header->block_sz[ix]))
-                ;
-            else if ((header->block_sz[ix] >= 'a') &&
-                     (header->block_sz[ix] <= 'w'))
-                ;
-            else if ((header->block_sz[ix] >= 'A') &&
-                     (header->block_sz[ix] <= 'W'))
-                ;
-            else
-                break;
-        }
-        for (; (ix < sizeof header->block_sz); ++ix)
-        {
-            if (header->block_sz[ix] == '\0')
-                ;
-            else
-                break;
-        }
-        if (rc)
-        
-
-
-        for (ix = 0; ix < sizeof header->block_size; ++ix)
-        {
-            if ()
-                ;
-                }
-        
-            ;
-        else if (header->block_sz[ix] == '-')
-            ;
-        else
-            ;
-    }while (0);
-    /* check file_sz */
-    /* check mtime */
-#endif
-
-    if (header->fer_enc != fer_encAES)
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcHeader, rcInvalid);
-        LOGERR (klogErr, rc, "bad encoding flag in encrypted file header");
-        return rc;
-    }
-
-    if ((header->md5_here != true) && (header->md5_here != false))
-    {
-        rc = RC (rcKrypto, rcFile, rcValidating, rcHeader, rcInvalid);
-        LOGERR (klogErr, rc, "bad checksum flag in encrypted file header");
-        return rc;
-    }
-
-    /* check md5 */
-    /* check md51 */
-
-    for (ix = 0; ix < sizeof header->reserved; ++ix)
-    {
-        if (header->reserved[ix] != 0)
-        {
-            rc = RC (rcKrypto, rcFile, rcValidating, rcHeader, rcInvalid);
-            LOGERR (klogErr, rc, "bad reserved space in encrypted file header");
-            return rc;
-        }
-    }
-
-    return 0;
-}
-
-
-KRYPTO_EXTERN rc_t CC WGAEncValidate (const KFile * encrypted, 
-                                      const char * key,
-                                      size_t key_size)
-{
-    const KFile * buffile;
-    rc_t rc, orc;
-
-    rc = KBufFileMakeRead (&buffile, encrypted, 64*1024);
-    if (rc)
-        LOGERR (klogErr, rc, "unable to buffer encrypted file");
-
-    else
-    {
-        KWGAEncFileHeader header;
-        size_t num_read;
-
-        /* first let's disect the header */
-        rc = KFileReadAll (buffile, 0, &header, sizeof header, &num_read);
-        if (rc)
-            LOGERR (klogErr, rc, "unable to read encrypted file header");
-
-        else
-        {
-            uint64_t file_size;
-            uint64_t header_file_size;
-            char ascii_md5 [32];
-            char header_ascii_md5 [32];
-
-            KWGAEncFileHeaderDecrypt (&header);
-
-            rc = WGAEncValidateHeader (&header, num_read);
-            if (rc)
-                ;
-
-            else
-            {
-                if (key_size == 0)
-                {
-                    const KFile * countfile;
-                    rc = KFileMakeCounterRead (&countfile, encrypted, &file_size, NULL, false);
-                    if (rc)
-                    {
-                        LOGERR (klogErr, rc, "error making file size counter");
-                        file_size = 0;
-                    }
-                    else
-                    {
-                        KFileAddRef (encrypted);
-                        KFileRelease (countfile);
-
-                        file_size -= sizeof header;
-                    }
-                }
-                else
-                {
-                    union
-                    {
-                        const KFile * decrypted;
-                        const KWGAEncFile * decryptor;
-                    } u;
-
-                    rc = KFileMakeWGAEncRead (&u.decrypted, buffile, key, key_size);
-                    if (rc)
-                        LOGERR (klogErr, rc, "error making decryptor");
-
-                    else
-                    {
-                        KFile * nullfile;
-
-                        rc = KFileMakeNullUpdate (&nullfile);
-                        if (rc)
-                            LOGERR (klogInt, rc, "error making data sync");
-
-                        else
-                        {
-                            KMD5SumFmt * fmt;
-                            static const char name[] = "wgaencrypt";
-
-                            rc = KMD5SumFmtMakeUpdate (&fmt, nullfile);
-                            if (rc)
-                            {
-                                LOGERR (klogInt, rc, "error making md5sum database");
-                                KFileRelease (nullfile);
-                            }
-                            else
-                            {
-                                const KFile * md5file;
-
-                                rc = KFileMakeNewMD5Read (&md5file, u.decrypted, fmt, name);
-                                if (rc)
-                                    LOGERR (klogInt, rc, "error making MD5 calculator");
-
-                                else
-                                {
-                                    /*
-                                     * ill mannered md5file steals
-                                     * references instead of adding one
-                                     */
-                                    rc = KFileAddRef (u.decrypted);
-                                    if (rc)
-                                        LOGERR (klogInt, rc, "error adding reference to decryptor");
-
-                                    else
-                                    {
-
-                                        const KFile * countfile;
-                                        rc = KFileMakeCounterRead (&countfile,
-                                                                   md5file,
-                                                                   &file_size, NULL,
-                                                                   true);
-                                        if (rc)
-                                            LOGERR (klogErr, rc,
-                                                    "error making file size "
-                                                    "counter");
-                                        else
-                                        {
-                                            /*
-                                             * ill mannered countfile steals
-                                             * references instead of adding one
-                                             */
-                                            KFileAddRef (md5file);
-                                            rc = KFileRelease (countfile);
-                                        }
-
-                                        orc = KFileRelease (md5file);
-                                    
-                                        if (rc == 0)
-                                            rc = orc;
-
-                                        if (rc == 0)
-                                        {
-                                            uint8_t md5 [16];
-                                            bool bin;
-
-                                            rc = KMD5SumFmtFind (fmt, name, md5, &bin);
-                                            if (rc)
-                                                LOGERR (klogInt, rc, "error locating MD5");
-
-                                            else
-                                            {
-                                                size_t zz;
-                                                unsigned ix;
-                                                for (ix = 0; ix < 16; ++ix)
-                                                {
-                                                    string_printf (&ascii_md5[2*ix], 2, &zz, "%2.2x",
-                                                               (unsigned)(uint8_t)md5[ix]);
-                                                }
-                                                memcpy (header_ascii_md5,
-                                                        u.decryptor->md5,
-                                                        sizeof header_ascii_md5);
-                                            }
-                                        }
-                                    }
-                                }
-                                KMD5SumFmtRelease (fmt);
-                            }
-                        }
-                        KFileRelease (u.decrypted);
-                    }                
-                }
-            }
-            if (rc == 0)
-            {
-                uint64_t sys_file_size;
-                uint64_t pad_file_size = 0;
-                rc_t orc;
-
-                /* ccheck file size */
-
-                orc = KFileSize (encrypted, &sys_file_size);
-                if (orc == 0)
-                {
-                    pad_file_size = file_size + 15;
-                    pad_file_size &= ~ ( uint64_t ) 15;
-                    pad_file_size += sizeof (KWGAEncFileHeader);
-                }
-                header_file_size = strtou64 (header.file_sz, NULL, KWGA_ENC_FILE_HEADER_RADIX);
-
-                if (key_size == 0)
-                {
-                    header_file_size += 15;
-                    header_file_size &= ~ ( uint64_t ) 15;
-                }
-
-                if (file_size < header_file_size)
-                    rc = RC (rcKrypto, rcFile, rcValidating, rcSize, rcInsufficient);
-                
-                else if (file_size > header_file_size)
-                    rc = RC (rcKrypto, rcFile, rcValidating, rcSize, rcExcessive);
-
-                else if ((orc == 0) &&
-                         (sys_file_size > pad_file_size))
-                    rc = RC (rcKrypto, rcFile, rcValidating, rcSize, rcExcessive);
-
-                /* check md5 */
-                else if (!header.md5_here)
-                {
-                    /* rc = RC (rcKrypto, rcFile, rcValidating, rcEncryption, rcNotFound); */
-                }
-                else if (key_size == 0)
-                    rc = RC (rcKrypto, rcFile, rcValidating, rcEncryption, rcNull);
-
-                else
-                {
-                    int cmp;
-
-                    cmp = strcase_cmp (ascii_md5, sizeof ascii_md5, 
-                                       header_ascii_md5, sizeof header_ascii_md5,
-                                       sizeof ascii_md5);
-                    if (cmp)
-                    {
-                        rc = RC (rcKrypto, rcFile, rcValidating, rcChecksum,
-                                 rcInvalid);
-                        LOGERR (klogErr, rc, "Encrypted file MD5 does not match");
-                    }
-                }
-            }
-        }
-        KFileRelease (buffile);
-    }
-    return rc;
-}
-#if 0
-        /* not working as planned */
-        if (rc == 0)
-        {
-            uint32_t this_read;
-
-            /* try to read past size now obtained */
-            do
-            {
-                uint8_t throwaway [8192];
-
-                rc = KFileRead (encrypted, z + sizeof (KWGAEncFileHeader), throwaway, sizeof throwaway,
-                                &this_read);
-                if (rc)
-                {
-                    LOGERR (klogErr, rc, "Error reading file");
-                    break;
-                }
-                z += this_read;
-
-            } while (this_read);
-        }
-#endif
-
-/* end of file wgaencrypt.c */
-
diff --git a/libs/ktst/Makefile b/libs/ktst/Makefile
deleted file mode 100644
index f028b00..0000000
--- a/libs/ktst/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/ktst
-
-INT_LIBS = \
-    libktst
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# testing framework
-#
-$(ILIBDIR)/libktst: $(addprefix $(ILIBDIR)/libktst.,$(LIBX))
-
-TST_SRC = \
-	runprocesstestcase \
-	testenv \
-	testcase \
-	testrunner
-
-TST_OBJ = \
-	$(addsuffix .$(LOBX),$(TST_SRC))
-
-$(ILIBDIR)/libktst.$(LIBX): $(TST_OBJ)
-	$(LP) --slib -o $@ $^ $(TST_LIB)
-
diff --git a/libs/ktst/testcase.cpp b/libs/ktst/testcase.cpp
deleted file mode 100644
index 5c0a948..0000000
--- a/libs/ktst/testcase.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <ktst/unit_test.hpp>
-
-#include <klib/printf.h> 
-
-using namespace ncbi::NK;
-
-TestCase::TestCase(const std::string& name) 
-: _name(name), _ec(0) 
-{
-}
-
-void TestCase::report_error(const char* msg, const char* file, int line, bool is_msg, bool isCritical)
-{
-    ncbi::NK::saveLocation(file, line);
-    ++_ec;
-    LOG(LogLevel::e_error, file << "(" << line << "): ");
-    if (isCritical) 
-    {
-        LOG(LogLevel::e_error, "fatal ");
-    }
-    LOG(LogLevel::e_error, "error in \"" << _name << "\": ");
-    if (is_msg) 
-    {
-        LOG(LogLevel::e_error, msg);
-    }
-    else 
-    {
-        if (isCritical) 
-        {
-            LOG(LogLevel::e_error, "critical ");
-        }
-        LOG(LogLevel::e_error, "check " << msg << " failed");
-    }
-    LOG(LogLevel::e_error, std::endl);
-    if (isCritical)
-    { 
-        throw ncbi::NK::execution_aborted(); 
-    }
-}
-
-void TestCase::report_passed(const char* msg, const char* file, int line) 
-{
-    ncbi::NK::saveLocation(file, line);
-    LOG(LogLevel::e_all, file << "(" << line << "): info: " "check " << msg << " passed" << std::endl);
-}
-
-void TestCase::_REPORT_CRITICAL_ERROR_(const std::string& msg, const char* file, int line, bool is_msg)
-{ 
-    report_error( msg.c_str(), file, line, is_msg, true ); 
-}
-
-void TestCase::report_rc(rc_t rc, const char* callStr, const char* file, int line, int successExpected, bool isCritical)
-{
-    if ((successExpected && rc != 0) || (!successExpected && rc == 0))
-    {
-        const int BufSize=1024;
-        char buf[BufSize];
-        size_t num_writ=0;
-        if (0 == string_printf (buf, BufSize, &num_writ, "Unexpected return code from %s: %R\n", callStr, rc))
-        {
-            report_error(buf, file, line, true, isCritical);
-        }
-        else
-        {
-            report_error("***error message too large to print***", file, line, true, isCritical);
-        }
-    }
-}
-
diff --git a/libs/ktst/testenv.cpp b/libs/ktst/testenv.cpp
deleted file mode 100644
index b9a2301..0000000
--- a/libs/ktst/testenv.cpp
+++ /dev/null
@@ -1,505 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <ktst/unit_test.hpp>
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-
-#include <kapp/main.h> // KAppVersion
-#include <kapp/args.h> // ArgsWhack
-#include <klib/out.h> // KOutMsg
-
-#endif
-
-#include <klib/rc.h>
-#include <sstream> 
-#include <csignal>
-#include <cstdlib>
-#include <cstring>
-
-using namespace ::ncbi::NK;
-using std::string;
-
-//const int TestEnv::TEST_CASE_TIMED_OUT=14; //SIGALRM
-//const int TestEnv::TEST_CASE_FAILED=255;
-
-bool TestEnv::in_child_process = false;
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-struct Args* TestEnv::args = 0;
-#endif
-
-TestEnv::TestEnv(int argc, char* argv[], ArgsHandler* argsHandler) 
-    : catch_system_errors(true)
-    , argc2(0)
-    , argv2(NULL)
-{
-    process_args(argc, argv, argsHandler);
-}
-
-TestEnv::~TestEnv ()
-{
-    if (argv2 != NULL) {
-        for (int i = 0; i < argc2; ++i) {
-            free(argv2[i]);
-            argv2[i] = NULL;
-        }
-        free(argv2);
-    }
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-    ArgsWhack(args);
-    args = NULL;
-#endif
-}
-
-string TestEnv::lastLocation;
-LogLevel::E TestEnv::verbosity = LogLevel::e_error;
-
-void CC TestEnv::TermHandler() 
-{
-    SigHandler(SIGTERM);
-}
-
-void CC TestEnv::SigHandler(int sig) 
-{
-    switch (sig)
-    {
-        case SIGABRT:
-            LOG(ncbi::NK::LogLevel::e_fatal_error,
-                "fatal error: signal: SIGABRT(Abort call)\n");
-            break;
-        case SIGFPE:
-            LOG(ncbi::NK::LogLevel::e_fatal_error,
-                "fatal error: signal: SIGFPE(Floating point exception)\n");
-            break;
-        case SIGILL:
-            LOG(ncbi::NK::LogLevel::e_fatal_error,
-                "fatal error: signal: SIGILL(Illegal instruction)\n");
-            break;
-        case SIGSEGV:
-            LOG(ncbi::NK::LogLevel::e_fatal_error,
-                "fatal error: signal: SIGSEGV(Segmentation fault)\n");
-            break;
-        default:
-            LOG(ncbi::NK::LogLevel::e_fatal_error,
-                "fatal error: signal: " << sig << "\n");
-            break;
-    }
-    if (!ncbi::NK::TestEnv::lastLocation.empty())
-    {
-        LOG(ncbi::NK::LogLevel::e_fatal_error,
-            ncbi::NK::TestEnv::lastLocation << ": last checkpoint\n");
-    }
-    LOG(ncbi::NK::LogLevel::e_fatal_error, "Test is aborted\n");
-    exit(sig);
-}
-
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-
-#define OPTION_DBG "verbose_cmd_line"
-#define ALIAS_DBG "a"
-static const char * dbg_usage[] = { "print command line argument processing information", NULL };
-
-#define OPTION_CSE "catch_system_errors"
-#define ALIAS_CSE "c"
-static const char * cse_usage[] = { "[yes|y|no|n] catch system errors, default is yes", NULL };
-
-#define OPTION_LOG "test_log_level"
-#define ALIAS_LOG "t"
-static const char * log_usage[] = { "test log level, one of:",
-    "'all':       report all log messages",
-    "             including the passed test notification;",
-    "'test_suite': show test suite messages;",
-    "'message':   show user messages",
-    "'warning':   report warnings issued by user;",
-    "'error':     report all error conditions (default);",
-    "'fatal_error': report user or system originated fatal errors",
-    "             (for example, memory access violation);",
-    "'nothing':   do not report any information", NULL };
-
-OptDef Options[] = {
-      { OPTION_DBG, ALIAS_DBG, NULL, dbg_usage, 1, false, false }
-    , { OPTION_CSE, ALIAS_CSE, NULL, cse_usage, 1, true , false }
-    , { OPTION_LOG, ALIAS_LOG, NULL, log_usage, 1, true , false }
-};
-
-#endif
-
-rc_t TestEnv::process_args(int argc, char* argv[], ArgsHandler* argsHandler) 
-{
-    int arg2 = 9;
-    argv2 = static_cast<char**>(calloc(arg2, sizeof *argv2));
-    if (argv2 == NULL)
-    {   return RC (rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted); }
-    argv2[argc2] = strdup(argv[argc2]);
-    if (argv2[argc2] == NULL)
-    {   return RC (rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted); }
-    ++argc2;
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-
-    rc_t rc = ArgsMakeAndHandle(&args, argc, argv, 1,
-        Options, sizeof Options / sizeof (OptDef));
-    if (rc)
-    {   return rc; }
-
-    bool debug = false;
-    LogLevel::E detected = LogLevel::e_undefined;
-    do {
-        uint32_t pcount = 0;
-
-        rc = ArgsOptionCount(args, OPTION_DBG, &pcount);
-        if (rc)
-        {   return rc; }
-        if (pcount) {
-            debug = true;
-            LOG(LogLevel::e_nothing, "debug: debug was set to true\n");
-        }
-
-        rc = ArgsOptionCount(args, OPTION_CSE, &pcount);
-        if (rc)
-        {   return rc; }
-        if (pcount) {
-            const char* pc = NULL;
-            rc = ArgsOptionValue(args, OPTION_CSE, 0, &pc);
-            if (rc)
-            {   return rc; }
-            if (!strcmp(pc, "n") || !strcmp(pc, "no")) {
-                catch_system_errors = false;
-                if (debug) {
-                    LOG(LogLevel::e_nothing,
-                       "debug: arg_catch_system_errors was set to false\n");
-                }
-            }
-            else {
-                if (debug) {
-                    LOG(LogLevel::e_nothing,
-                       "debug: arg_catch_system_errors was set to true\n");
-                }
-            }
-        }
-
-        rc = ArgsOptionCount(args, OPTION_LOG, &pcount);
-        if (rc)
-        {   return rc; }
-        if (pcount) {
-            const char* a = NULL;
-            rc = ArgsOptionValue(args, OPTION_LOG, 0, &a);
-            if (rc)
-            {   return rc; }
-            if (!strcmp(a, "test_suite"))
-            { detected = LogLevel::e_test_suite; }
-            else if (strcmp(a, "all"    ) == 0)
-            { detected = LogLevel::e_all; }
-            else if (strcmp(a, "message") == 0)
-            { detected = LogLevel::e_message; }
-            else if (strcmp(a, "warning") == 0)
-            { detected = LogLevel::e_warning; }
-            else if (strcmp(a, "error"  ) == 0)
-            { detected = LogLevel::e_error; }
-            else if (strcmp(a, "nothing") == 0)
-            { detected = LogLevel::e_nothing; }
-            else if (strcmp(a, "fatal_error") == 0)
-            { detected = LogLevel::e_fatal_error; }
-            if (detected != LogLevel::e_undefined) {
-                verbosity = detected;
-                if (debug) {
-                    LOG(LogLevel::e_nothing,
-                        "debug: log_level was set to " << a << std::endl);
-                }
-            }
-            else {
-                verbosity = LogLevel::e_error;
-                if (debug) {
-                    LOG(LogLevel::e_nothing,
-                        "debug: log_level was set to error\n");
-                }
-            }
-        }
-    } while (0);
-
-    if (verbosity == LogLevel::e_undefined) {
-        verbosity = LogLevel::e_error;
-        if (debug) {
-            LOG(LogLevel::e_nothing,
-                "debug: log_level was set to error\n");
-        }
-    }
-#else
-
-    rc_t rc = 0;
-
-    bool debug = false;
-    LogLevel::E detected = LogLevel::e_undefined;
-    char arg_catch_system_errors[] = "-catch_system_errors=";
-    char arg_log_level          [] = "-l=";
-    char arg_app_args           [] = "-app_args=";
-    for (int i = 1; i < argc; ++i)
-    {
-        if (strncmp(argv[i], arg_log_level, strlen(arg_log_level))
-            == 0)
-        {
-            char* a = argv[i] + strlen(arg_log_level);
-            if (strcmp(a, "test_suite") == 0)
-                detected = LogLevel::e_test_suite;
-            else if (strcmp(a, "all"    ) == 0)
-                detected = LogLevel::e_all;
-            else if (strcmp(a, "message") == 0)
-                detected = LogLevel::e_message;
-            else if (strcmp(a, "warning") == 0)
-                detected = LogLevel::e_warning;
-            else if (strcmp(a, "error"  ) == 0)
-                detected = LogLevel::e_error;
-            else if (strcmp(a, "nothing") == 0)
-                detected = LogLevel::e_nothing;
-            else if (strcmp(a, "fatal_error") == 0)
-                detected = LogLevel::e_fatal_error;
-            if (detected != LogLevel::e_undefined)
-            {
-                verbosity = detected;
-                if (debug)
-                {
-                    LOG(LogLevel::e_nothing,
-                        "debug: log_level was set to " << a << std::endl);
-                }
-            }
-            else
-            {
-                verbosity = LogLevel::e_error;
-                if (debug)
-                {
-                    LOG(LogLevel::e_nothing,
-                        "debug: log_level was set to error\n");
-                }
-            }
-        }
-        else if (strncmp(argv[i], arg_catch_system_errors,
-            strlen(arg_catch_system_errors)) == 0)
-        {
-            char* a = argv[i] + strlen(arg_catch_system_errors);
-            if (strcmp(a, "n") == 0 || strcmp(a, "no") == 0)
-            {
-                catch_system_errors = false;
-                if (debug)
-                {
-                    LOG(LogLevel::e_nothing,
-                       "debug: arg_catch_system_errors was set to false\n");
-                }
-            }
-            else
-            {
-                if (debug)
-                {
-                    LOG(LogLevel::e_nothing,
-                       "debug: arg_catch_system_errors was set to true\n");
-                }
-            }
-        }
-        else if (strcmp(argv[i], "-debug") == 0)
-        {
-            debug = true;
-            LOG(LogLevel::e_nothing, "debug: debug was set to true\n");
-        }
-        else if (strcmp(argv[i], "-h") == 0)
-        {
-            if (debug)
-            {
-                LOG(LogLevel::e_nothing, "debug: help was set to true\n");
-            }
-            std::cout << "Usage:\n"
-                      << argv[0]
-                      << " [-debug] [-catch_system_errors=[yes|y|no|n]]\n"
-                         "      [-app_args='<value>'] [-l=<value>] [-h]\n"
-                "where:\n"
-                "debug              - Print recognized command line arguments\n"
-                "                     (should be specified first)\n"
-                "catch_system_errors -  Allows to switch between catching\n"
-                "                     and ignoring system errors (signals)\n"
-                "app_args           - Allows to pass command line arguments\n"
-                "                     to application handler\n"
-                "    (see unit_test.hpp/FIXTURE_TEST_SUITE_WITH_ARGS_HANDLER)\n"
-                "\n"
-                "l (log_level)       - Specifies log level\n"
-                "\tall        - report all log messages\n"
-                "\t             including the passed test notification\n"
-                "\ttest_suite - show test suite messages\n"
-                "\tmessage    - show user messages\n"
-                "\twarning    - report warnings issued by user\n"
-                "\terror      - report all error conditions (default)\n"
-                "\tfatal_error- report user or system originated fatal errors\n"
-                "\t             (for example, memory access violation)\n"
-                "\tnothing    - do not report any information\n"
-                "\n"
-                "h (help)            - this help message\n";
-            exit(0);
-        }
-        else if (strncmp(argv[i], arg_app_args, strlen(arg_app_args)) == 0)
-        {
-            char* a = argv[i] + strlen(arg_app_args);
-            if (debug)
-            {
-                LOG(LogLevel::e_nothing,
-                    string("debug: arg_app_args was detected: ") + a + "\n");
-            }
-            char* pch = strtok(a ," ");
-            while (pch != NULL) {
-                if (argc2 >= arg2) {
-                    arg2 *= 2;
-                    char** tmp = static_cast<char**>(
-                        realloc(argv2, arg2 * sizeof *argv2));
-                    if (tmp == NULL) {
-                        return RC(
-                            rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-                    }
-                    argv2 = tmp;
-                }
-                argv2[argc2] = strdup(pch);
-                if (argv2[argc2] == NULL) {
-                    return RC(
-                        rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-                }
-                ++argc2;
-                pch = strtok(NULL, " ");
-            }
-        }
-    }
-
-    if (verbosity == LogLevel::e_undefined)
-    {
-        verbosity = LogLevel::e_error;
-        if (debug)
-        {
-            LOG(LogLevel::e_nothing,
-                "debug: log_level was set to error\n");
-        }
-    }
-#endif
-
-    if (rc == 0) {
-        if (argsHandler)
-        {	rc = argsHandler(argc2, argv2); }
-    }
-
-    return rc;
-}
-
-void ::ncbi::NK::saveLocation(const char* file, int line) 
-{
-    std::ostringstream s;
-    s << file << "(" << line << ")";
-    TestEnv::lastLocation = s.str();
-}
-
-void ::ncbi::NK::_REPORT_CRITICAL_ERROR_(const string& msg, const char* file, int line, bool is_msg)
-{
-    LOG(ncbi::NK::LogLevel::e_error, file << "(" << line << "): ");
-    LOG(ncbi::NK::LogLevel::e_error, "fatal ");
-    LOG(ncbi::NK::LogLevel::e_error, "error in fixture: ");
-    if (is_msg) {
-        LOG(ncbi::NK::LogLevel::e_error, msg);
-    }
-    else {
-        LOG(ncbi::NK::LogLevel::e_error, "critical ");
-        LOG(ncbi::NK::LogLevel::e_error, "check " << msg << " failed");
-    }
-    LOG(ncbi::NK::LogLevel::e_error, std::endl);
-    throw ncbi::NK::execution_aborted();
- }
-
-ncbi::NK::TestRunner* 
-ncbi::NK::GetTestSuite(void)
-{ 
-    static ncbi::NK::TestRunner t; 
-    return &t; 
-}
-
-rc_t CC TestEnv::UsageSummary(const char* progname) {
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-    return KOutMsg(
-        "Usage:\n"
-        "  %s [--verbose_cmd_line] [--catch_system_errors [yes|y|no|n]] "
-        "[-t <value>] [-h] [...]\n", progname);
-#else
-    std::cout
-        << "Usage:\n"
-        << progname
-        << " [-debug] [-catch_system_errors=[yes|y|no|n]] "
-        "[-l=<value>] [-h] [...]\n";
-    return 0;
-#endif
-}
-
-#if ALLOW_TESTING_CODE_TO_RELY_UPON_CODE_BEING_TESTED
-rc_t CC TestEnv::Usage(const Args* args)
-{
-    const char* progname = UsageDefaultName;
-    const char* fullpath = UsageDefaultName;
-
-    rc_t rc = (args == NULL) ?
-        RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull):
-        ArgsProgram(args, &fullpath, &progname);
-
-    if (rc != 0)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary(progname);
-
-    KOutMsg("\nOptions:\n");
-    
-    HelpOptionLine(ALIAS_DBG, OPTION_DBG, NULL, dbg_usage);
-    HelpOptionLine(ALIAS_CSE, OPTION_CSE, NULL, cse_usage);
-    HelpOptionLine(ALIAS_LOG, OPTION_LOG, NULL, log_usage);
-    KOutMsg("\n");
-    HelpOptionsStandard();
-    HelpVersion(fullpath, KAppVersion());
-    
-    return rc;
-}
-#else
-rc_t CC TestEnv::Usage(const char *progname)
-{
-    UsageSummary ( progname );
-    std::cout <<
-        "where:\n"
-        "debug - Print recognized command line arguments (should be specified first)\n"
-        "catch_system_errors - "
-        "Allows to switch between catching and ignoring system errors (signals)\n"
-        "l (log_level) - Specifies log level\n"
-        "\tall        - report all log messages\n"
-        "\t             including the passed test notification\n"
-        "\ttest_suite - show test suite messages\n"
-        "\tmessage    - show user messages\n"
-        "\twarning    - report warnings issued by user\n"
-        "\terror      - report all error conditions (default)\n"
-        "\tfatal_error- report user or system originated fatal errors\n"
-        "\t             (for example, memory access violation)\n"
-        "\tnothing    - do not report any information\n"
-        "h (help) - this help message\n";
-    return 0;
-}
-#endif
diff --git a/libs/ktst/testrunner.cpp b/libs/ktst/testrunner.cpp
deleted file mode 100644
index cb31e16..0000000
--- a/libs/ktst/testrunner.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <ktst/unit_test.hpp>
-
-using namespace ncbi::NK;
-
-TestRunner::TestRunner() : argc(0), argv(NULL) {}
-
-void TestRunner::ReportTestNumber(void) 
-{
-    T::size_type sz = _cases.size();
-    if (sz == 1) {
-       LOG(LogLevel::e_fatal_error, "Running " << sz << " test case...\n");
-    } else if (sz > 1) {
-       LOG(LogLevel::e_fatal_error, "Running " << sz << " test cases...\n");
-    }
-}
-
-void TestRunner::SetArgs(int argc, char* argv[]) 
-{
-    this->argc = argc;
-    this->argv = argv;
-}
-
-void TestRunner::Add(ncbi::NK::TestInvoker* t) 
-{
-    if (t) 
-    {
-        _cases.push_back(t);
-    }
-}
-
-counter_t TestRunner::Run(void* globalFixture) const 
-{
-    counter_t ec = 0;
-    for (TCI it = _cases.begin(); it != _cases.end(); ++it) 
-    {
-       ncbi::NK::TestInvoker* c = *it;
-       try {
-           LOG(LogLevel::e_test_suite,
-               "Entering test case \"" << c->GetName() << "\"\n");
-           c->Run(globalFixture);
-           LOG(LogLevel::e_test_suite,
-               "Leaving test case \"" << c->GetName() << "\"\n");
-       } catch (const ncbi::NK::execution_aborted&) {
-           LOG(LogLevel::e_test_suite,
-               "Leaving test case \"" << c->GetName() << "\"\n");
-       }
-       ec += c->GetErrorCounter();
-    }
-    return ec;
-}
-
diff --git a/libs/ktst/unix/runprocesstestcase.cpp b/libs/ktst/unix/runprocesstestcase.cpp
deleted file mode 100644
index 60c608d..0000000
--- a/libs/ktst/unix/runprocesstestcase.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <ktst/unit_test_suite.hpp>
-
-#include <signal.h> // sigaction, not necessarily in csignal :-/
-#include <cstdlib>
-#include <cstring>
-#include <sstream>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-using namespace std;
-using namespace ncbi::NK;
-
-#define REPORT_ERROR(msg) _REPORT_CRITICAL_ERROR_("TestEnv::" msg, __FILE__, __LINE__, true);
-
-static void alarmHandler(int)
-{
-    cerr << "child process timed out" << endl;
-    
-    exit(TestEnv::TEST_CASE_TIMED_OUT);
-}
-
-int TestEnv::RunProcessTestCase(TestCase& obj, void(TestCase::*meth)(), int timeout)
-{
-    int pid=fork();
-    if (pid == -1)
-    {
-        REPORT_ERROR("RunProcessTestCase: fork() failed");
-    }
-    if (pid == 0)
-    {   /* child process */
-        if (timeout != 0)
-        {
-            struct sigaction act;
-            memset(&act, 0, sizeof act);
-            act.sa_handler = alarmHandler;
-            act.sa_flags = SA_RESETHAND;
-            sigaction(SIGALRM , &act, NULL);        
-            alarm(timeout);
-        }
-        try 
-        {
-            in_child_process = true;
-            (obj.*meth)();
-        }   
-        catch (const exception& ex)
-        {
-            cerr << obj.GetName() << " threw " << ex.what() << endl;
-            exit(TEST_CASE_FAILED);
-        }
-        catch (const ncbi::NK::execution_aborted&)
-        {
-            cerr << obj.GetName() << " aborted " << endl;
-            exit(TEST_CASE_FAILED);
-        }
-        catch (...)
-        {
-            cerr << obj.GetName() << " threw something " << endl;
-            exit(TEST_CASE_FAILED);  
-        }
-        exit(0);
-    }
-    /* parent process */
-    int status;
-    if (waitpid(pid, &status, 0) != pid) /* suspend until the child terminates */
-    {   
-        REPORT_ERROR("RunProcessTestCase: wait() failed");
-    }
-    if (!WIFEXITED(status)) 
-    {   
-        REPORT_ERROR("RunProcessTestCase: child exited abnormally");
-    }
-    
-    return WEXITSTATUS(status); /* exit status of the child process */
-}
-
-unsigned int TestEnv::Sleep(unsigned int seconds)
-{
-    return sleep(seconds);
-}
-
-void TestEnv::set_handlers(void)
-{
-    struct sigaction act;
-    memset(&act, 0, sizeof act);
-    act.sa_handler = SigHandler;
-    act.sa_flags = SA_RESETHAND;
-    if (sigaction(SIGFPE , &act, NULL) != 0)    REPORT_ERROR("set_handlers: sigaction() failed");
-    if (sigaction(SIGILL , &act, NULL) != 0)    REPORT_ERROR("set_handlers: sigaction() failed");
-    if (sigaction(SIGSEGV , &act, NULL) != 0)   REPORT_ERROR("set_handlers: sigaction() failed");
-}
-
-string TestEnv::GetPidString()
-{
-    ostringstream str;
-    str << getpid();
-    return str.str();
-}
-
diff --git a/libs/ktst/win/runprocesstestcase.cpp b/libs/ktst/win/runprocesstestcase.cpp
deleted file mode 100644
index ca621de..0000000
--- a/libs/ktst/win/runprocesstestcase.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <ktst/unit_test_suite.hpp>
-
-#include <csignal> 
-#include <sstream> 
-#include <windows.h>
-#include <process.h>
-
-using namespace std;
-using namespace ncbi::NK;
-
-/* signal handlers for a single-test case thread */
-void CC SigSubHandler(int sig)
-{
-    _endthreadex(sig);
-}
-void CC TermSubHandler() 
-{
-    SigSubHandler(SIGTERM);
-}
-
-struct TestCaseCall
-{
-    TestCaseCall(TestCase& obj, void(TestCase::*meth)())
-        : object(&obj), method(meth)
-    {
-    }
-
-    TestCase* object;
-    void(TestCase::*method)();
-};
-
-void ThreadProc(void* call)
-{
-    signal(SIGABRT, SigSubHandler);
-    signal(SIGFPE, SigSubHandler);
-    signal(SIGILL, SigSubHandler);
-    signal(SIGINT, SigSubHandler);
-    signal(SIGSEGV, SigSubHandler);
-    signal(SIGTERM, SigSubHandler);
-    set_terminate(TermSubHandler);
-
-    try
-    {
-        TestCaseCall* c=(TestCaseCall*)call;
-        ((c->object)->*(c->method))();
-    }
-    catch (...)
-    {
-        _endthreadex(TestEnv::TEST_CASE_FAILED);
-    }
-    _endthreadex(0);
-}
-
-int TestEnv::RunProcessTestCase(TestCase& obj, void(TestCase::*meth)(), int timeout)
-{
-    TestCaseCall call(obj, meth);
-    TestEnv::in_child_process = true;
-    HANDLE thread = (HANDLE)_beginthread( ThreadProc, 0, &call );
-    if (thread == NULL)
-    {
-        _REPORT_CRITICAL_ERROR_("TestEnv::RunProcessTestCase: failed to start a test case thread", __FILE__, __LINE__, true);
-    }
-
-    // make sure to restore main process's signal handlers before throwing an exception
-#define CALL_FAILED(call)\
-    _REPORT_CRITICAL_ERROR_("TestEnv::RunProcessTestCase: " call " failed", __FILE__, __LINE__, true);
-
-    DWORD rc=0;
-    DWORD result=WaitForSingleObject( (HANDLE)thread, timeout == 0 ? INFINITE : timeout*1000);
-    try
-    {
-        switch (result)
-        {
-        case WAIT_OBJECT_0:
-            if (GetExitCodeThread(thread, &rc) == 0)
-            {
-                CALL_FAILED("GetExitCodeThread");
-            }
-            break;
-        case WAIT_TIMEOUT:
-            if (!CloseHandle(thread))
-            {
-                CALL_FAILED("GetExitCodeThread");
-            }
-            rc=TEST_CASE_TIMED_OUT;
-            break;
-        default:
-            CALL_FAILED("WaitForSingleObject");
-            break;
-        }
-    }
-    catch(...)
-    {
-        set_handlers(); 
-        throw;
-    }
-#undef CALL_FAILED
-    set_handlers(); 
-    in_child_process = false;
-    return (int)rc;
-}
-
-unsigned int TestEnv::Sleep(unsigned int seconds)
-{
-    ::Sleep(seconds*1000);
-    return 0;
-}
-
-void TestEnv::set_handlers(void) 
-{
-    signal(SIGABRT, SigHandler);
-    signal(SIGFPE, SigHandler);
-    signal(SIGILL, SigHandler);
-    signal(SIGINT, SigHandler);
-    signal(SIGSEGV, SigHandler);
-    signal(SIGTERM, SigHandler);
-    set_terminate(TermHandler);
-}
-
-string TestEnv::GetPidString()
-{
-    ostringstream str;
-    str << GetCurrentProcessId();
-    return str.str();
-}
-
diff --git a/libs/kxml/Makefile b/libs/kxml/Makefile
deleted file mode 100644
index 15de2ca..0000000
--- a/libs/kxml/Makefile
+++ /dev/null
@@ -1,124 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/kxml
-
-INT_LIBS = \
-	libkxml \
-	libkxfs
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# where to find includes
-#
-DFLT_LIBXML_INCLUDES ?= /usr/include/libxml2
-
-LIBXML_INCLUDES ?= $(DFLT_LIBXML_INCLUDES)
-
-INCDIRS += $(addprefix -I,$(LIBXML_INCLUDES))
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-ifeq (win,$(OS))
-all std:
-	@ true
-else
-all std: makedirs
-	@ $(MAKE_CMD) LIBXML_INCLUDES=$(LIBXML_INCLUDES) $(TARGDIR)/std
-endif
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) LIBXML_INCLUDES=$(LIBXML_INCLUDES) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tiny, lightweight interface to libxml
-#
-$(ILIBDIR)/libkxml: $(addprefix $(ILIBDIR)/libkxml.,$(ILIBEXT))
-
-XML_SRC = \
-	xml
-
-XML_OBJ = \
-	$(addsuffix .$(LOBX),$(XML_SRC))
-
-XML_LIB = \
-	-dkfs \
-	-dklib 
-
-ifdef LIBXML_LPATH
-XML_LIB += \
-	-X$(LIBXML_LPATH) -lxml2
-endif
-
-$(ILIBDIR)/libkxml.$(LIBX): $(XML_OBJ)
-	$(LD) --slib -o $@ $^ $(XML_LIB)
-
-#-------------------------------------------------------------------------------
-# kxfs
-#
-$(ILIBDIR)/libkxfs: $(addprefix $(ILIBDIR)/libkxfs.,$(ILIBEXT))
-
-KXFS_SRC = \
-	xtoc \
-	xtoc-parsexml
-
-KXFS_OBJ = \
-	$(addsuffix .$(LOBX),$(KXFS_SRC))
-
-KXFS_LIB = \
-	-dkxml \
-	-dklib \
-	-ddl \
-	-dz \
-	-dbz2 \
-
-$(ILIBDIR)/libkxfs.$(LIBX): $(KXFS_OBJ)
-	$(LD) --slib -o $@ $^ $(KXFS_LIB)
-
diff --git a/libs/kxml/libkxfs.vers b/libs/kxml/libkxfs.vers
deleted file mode 100644
index 7ee7020..0000000
--- a/libs/kxml/libkxfs.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.10
diff --git a/libs/kxml/libkxml.vers b/libs/kxml/libkxml.vers
deleted file mode 100644
index 5b09c67..0000000
--- a/libs/kxml/libkxml.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.14
diff --git a/libs/kxml/xml.c b/libs/kxml/xml.c
deleted file mode 100644
index ce44542..0000000
--- a/libs/kxml/xml.c
+++ /dev/null
@@ -1,1705 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-struct s_KNodeNamelist;
-#define KNAMELIST_IMPL struct s_KNodeNamelist
-
-#include <sysalloc.h>
-#include <kxml/xml.h>
-
-#include <klib/impl.h>
-#include <kfs/file.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/debug.h>
-#include <klib/text.h>
-
-#include <os-native.h> /* for strndup on mac */
-#include <strtol.h>
-
-#include <libxml/xmlreader.h>
-#include <libxml/xpath.h>
-
-#include <assert.h>
-#include <string.h>
-
-
-#define XML_DEBUG(msg) DBGMSG (DBG_XML, DBG_FLAG(DBG_XML_XML), msg)
-
-/********* XML manager ********/
-
-struct KXMLMgr {
-    atomic32_t refcount;
-};
-
-static KXMLMgr s_KXMLMgr;
-/** calls vsnprintf and converts errors into KXMLErr */
-static rc_t s_KXML_vsnprintf(char *str,
-    size_t size,
-    const char *format,
-    va_list ap)
-{
-    int printed = vsnprintf(str, size, format, ap);
-    if (printed < 0) {
-        return RC ( rcXML, rcDoc, rcConstructing, rcData, rcCorrupt );
-    }
-    if ((size_t) printed >= size) { /* buffer is too small */
-        return RC ( rcXML, rcDoc, rcConstructing, rcBuffer, rcExhausted );
-    }
-    return 0;
-}
-
-rc_t KXMLMgrMakeRead(const KXMLMgr **result)
-{
-    if (!result) {
-        return RC ( rcXML, rcMgr, rcConstructing, rcParam, rcNull );
-    }
-    if (atomic32_read_and_add(&s_KXMLMgr.refcount, 1) == 0) {
-        xmlInitParser();
-    }
-    *result = &s_KXMLMgr;
-    return 0;
-}
-
-rc_t KXMLMgrAddRef(const KXMLMgr *cself)
-{
-    if (cself) {
-        KXMLMgr *self = (KXMLMgr*) cself;
-        atomic32_inc(&self->refcount);
-    }
-    return 0;
-}
-
-rc_t KXMLMgrRelease(const KXMLMgr *cself)
-{
-    if (cself) {
-        KXMLMgr *self = (KXMLMgr*) cself;
-        if (atomic32_dec_and_test(&self->refcount)) {
-            xmlCleanupParser();
-        }
-    }
-    return 0;
-}
-
-/********* XML doucument ********/
-struct KXMLDoc {
-    const KXMLMgr* parent;
-    xmlDocPtr doc;
-    xmlXPathContextPtr xpathCtx;
-    atomic32_t refcount;
-};
-
-/*static int s_XmlInputReadCallback(void * context, 
-					 char * buffer, 
-					 int len)
-{
-    static size_t offset = 0;
-    KFile *src = (KFile*) context;
-    assert(src);
-    {
-        size_t num_read = 0;
-        rc_t rc = KFileRead(src, offset, buffer, len, &num_read);
-        if (rc)
-        {   return -1; }
-        offset += num_read;
-        return num_read;
-    }
-}*/
-
-/* SchemaValidate
- *  validates an XML source file against an XSD schema.
- * schema parameter is the path to the schema
- */
-#if 0
-rc_t KXMLMgrSchemaValidate ( const KXMLMgr *self,
-    struct KFile const *src,
-    const char *schema )
-{
-    if (!src || !schema)
-    {   return RC(rcXML, rcDoc, rcValidating, rcParam, rcNull); }
-
-    {
-        rc_t rc = 0;
-        xmlTextReaderPtr reader
-            = xmlReaderForIO(s_XmlInputReadCallback, 0, (void*)src, "/", 0, 0);
-        if (!reader)
-        {   return RC(rcXML, rcDoc, rcValidating, rcSchema, rcUnknown); }
-        {
-            int r = xmlTextReaderSchemaValidate(reader, schema);
-            if (r != 0) {
-                rc = RC(rcXML, rcDoc, rcValidating, rcSchema, rcUnknown);
-            } else {
-                do {
-                    r = xmlTextReaderRead(reader);
-                } while (r == 1);
-                if (r == -1) {
-                    rc = RC(rcXML, rcDoc, rcValidating, rcDoc, rcInvalid);
-                } else {
-                    assert(r == 0);
-                    r = xmlTextReaderIsValid(reader);
-                    if (r != 1)
-                    {   rc = RC(rcXML, rcDoc, rcValidating, rcDoc, rcInvalid); }
-                }
-            }
-        }
-        xmlTextReaderClose(reader);
-        return rc;
-    }
-}
-#endif
-
-static void s_xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED,
-    const char *msg,
-    ...)
-{
-    va_list args;
-    va_start(args, msg);
-/*  vfprintf(stderr, msg, args); */
-    va_end(args);
-}
-
-static rc_t s_XmlReadFile(const KFile *src, char** aBuffer, uint64_t* aSize)
-{
-    rc_t rc = 0;
-    bool unknownFileSize = false;
-    uint64_t size = 0;
-    uint32_t t = KFileType(src);
-    assert(aBuffer && aSize);
-    *aBuffer = NULL;
-    *aSize = 0;
-
-    /* Read KFile by KFileRead: can use mmap instead */
-    if (t == kfdFIFO) {
-        XML_DEBUG (("%s: reading stdin ?", __func__));
-        unknownFileSize = true;
-        size = 0x10000;
-    }
-    else {
-        rc = KFileSize(src, &size);
-        if (rc)
-        {   return rc; }
-        if (!size) {
-            rc = RC(rcXML, rcDoc, rcConstructing, rcFile, rcEmpty);
-            return rc;
-        }
-    }
-    {
-        size_t num_read = 0;
-        char* buffer = (char*) malloc(size);
-        if (!buffer)
-        {   return RC(rcXML, rcDoc, rcConstructing, rcMemory, rcExhausted); }
-        rc = KFileRead(src, 0, buffer, size, &num_read);
-        if (rc == 0) {
-            if (!unknownFileSize) {
-                if (num_read != size) {
-                    rc = RC(rcXML, rcDoc, rcConstructing, rcFile, rcIncomplete);
-                }
-            }
-            else {
-                if (num_read == size) {
-                    rc = RC(rcXML, rcDoc, rcConstructing, rcFile, rcTooBig);
-                }
-            }
-        }
-        if (rc) {
-            free(buffer);
-            return rc;
-        }
-        *aBuffer = buffer;
-        *aSize = size;
-    }
-
-    return rc;
-}
-
-static int s_UseDefaultErrorHandler = 0;
-
-rc_t KXMLMgrMakeDocRead(const KXMLMgr *self,
-    const KXMLDoc **result,
-    const KFile *src)
-{
-    rc_t rc = 0;
-    if (self && src) {
-        char* buffer = NULL;
-        uint64_t size = 0;
-        rc = s_XmlReadFile(src, &buffer, &size);
-        if (rc)
-        {    return rc; }
-        rc = KXMLMgrMakeDocReadFromMemory(self, result, buffer, size);
-        free(buffer);
-    }
-    else
-    {    rc = RC ( rcXML, rcDoc, rcConstructing, rcParam, rcNull ); }
-    return rc;
-}
-
-rc_t KXMLMgrMakeDocReadFromMemory(const KXMLMgr *self,
-    const KXMLDoc **result,
-    const char* buffer,
-    uint64_t size)
-{
-    rc_t rc = 0;
-    if (!s_UseDefaultErrorHandler)
-    {   xmlSetGenericErrorFunc(0, s_xmlGenericErrorDefaultFunc); }
-    if (!result)
-    {   return RC ( rcXML, rcDoc, rcConstructing, rcParam, rcNull ); }
-    *result = 0;
-    if (self && buffer && size) {
-        KXMLDoc *obj = (KXMLDoc*) malloc(sizeof(KXMLDoc));
-        if (!obj)
-        {   return RC ( rcXML, rcDoc, rcConstructing, rcMemory, rcExhausted ); }
-        atomic32_set(&obj->refcount, 1);
-        obj->parent = self;
-        KXMLMgrAddRef(obj->parent);
-        obj->doc = 0;
-        obj->xpathCtx = 0;
-
-        /* Load XML document */
-        obj->doc = xmlParseMemory(buffer, size);
-
-        if (!obj->doc) {
-            KXMLDocRelease(obj);
-            return RC ( rcXML, rcDoc, rcConstructing, rcXmlDoc, rcInvalid );
-        }
-
-        /* Create xpath evaluation context */
-        obj->xpathCtx = xmlXPathNewContext(obj->doc);
-        if (!obj->xpathCtx) {
-            KXMLDocRelease(obj);
-            return RC ( rcXML, rcDoc, rcConstructing, rcMemory, rcCorrupt );
-        }
-        *result = obj;
-        rc = 0;
-    }
-    else {
-        rc = RC ( rcXML, rcDoc, rcConstructing, rcParam, rcNull );
-    }
-    return rc;
-}
-
-rc_t KXMLDocAddRef(const KXMLDoc *cself)
-{
-    if (cself) {
-        KXMLDoc *self = (KXMLDoc*) cself;
-        atomic32_inc(&self->refcount);
-    }
-    return 0;
-}
-
-rc_t KXMLDocRelease(const KXMLDoc *cself)
-{
-    if (cself) {
-        KXMLDoc *self = (KXMLDoc*) cself;
-        if (atomic32_dec_and_test(&self->refcount)) {
-            if (self->xpathCtx) {
-                xmlXPathFreeContext(self->xpathCtx);
-                self->xpathCtx = 0;
-            }
-            if (self->doc) {
-                xmlFreeDoc(self->doc);
-                self->doc = 0;
-            }
-            KXMLMgrRelease(self->parent);
-            self->parent = 0;
-            free(self);
-        }
-    }
-    return 0;
-}
-
-/********* XML node set ********/
-
-struct KXMLNodeset {
-    atomic32_t refcount;
-    const KXMLDoc *parent;
-    char *path;
-    xmlXPathObjectPtr xpathObj;
-};
-
-/** KXMLNodeset constructor */
-static rc_t KXMLNodeset_cTor(const KXMLDoc *parent,
-    const KXMLNodeset **result,
-    const char *path)
-{
-    assert(parent && result && path && path[0]);
-    if (!parent->xpathCtx) {
-        return RC ( rcXML, rcDoc, rcConstructing, rcData, rcIncorrect );
-    }
-    {
-        size_t size;
-        KXMLNodeset *obj = (KXMLNodeset*) malloc(sizeof(KXMLNodeset));
-        if (!obj) {
-            return RC ( rcXML, rcDoc, rcConstructing, rcMemory, rcExhausted );
-        }
-        atomic32_set(&obj->refcount, 1);
-        obj->parent = parent;
-        obj->path = 0;
-        KXMLDocAddRef(obj->parent);
-        obj->xpathObj = xmlXPathEvalExpression(BAD_CAST path, parent->xpathCtx);
-        if (!obj->xpathObj) {
-            KXMLNodesetRelease(obj);
-            return RC ( rcXML, rcDoc, rcConstructing, rcData, rcCorrupt );
-        }
-        if( obj->xpathObj->type != XPATH_NODESET ) {
-            KXMLNodesetRelease(obj);
-            return RC(rcXML, rcDoc, rcConstructing, rcData, rcUnsupported );
-        }
-        obj->path = string_dup(path, string_measure(path, &size));
-        if (!obj->path) {
-            KXMLNodesetRelease(obj);
-            return RC ( rcXML, rcDoc, rcConstructing, rcMemory, rcExhausted );
-        }
-        *result = obj;
-    }
-    return 0;
-}
-
-static rc_t s_KXML_snprintf(char *str,
-    size_t size,
-    const char *format,
-    ...)
-{
-    va_list args;
-    va_start(args, format);
-    {
-        rc_t rc = s_KXML_vsnprintf(str, size, format, args);
-        va_end(args);
-        return rc;
-    }
-}
-
-#define XPATH_MAX_LEN 1001
-/** Opens a node set relative to current node */
-rc_t KXMLDocOpenNodesetRead(const KXMLDoc *self,
-    const KXMLNodeset **result,
-    const char *path,
-    ...)
-{
-    rc_t rc = 0;
-    va_list args;
-    va_start ( args, path );
-    rc = KXMLDocVOpenNodesetRead ( self, result, path, args );
-    va_end ( args );
-    return rc;
-}
-
-rc_t KXMLDocVOpenNodesetRead(const KXMLDoc *self,
-    const KXMLNodeset **result,
-    const char *path,
-    va_list args)
-{
-    rc_t rc = 0;
-
-    if (!result || !path || !path[0]) {
-        return RC ( rcXML, rcDoc, rcConstructing, rcParam, rcNull );
-    }
-
-    *result = 0;
-
-    if (self) {
-        char buffer[XPATH_MAX_LEN];
-        rc = s_KXML_vsnprintf(buffer, sizeof(buffer), path, args);
-        if (rc != 0) {
-            return rc;
-        }
-        rc = KXMLNodeset_cTor(self, result, buffer);
-    }
-    else { rc = RC ( rcXML, rcDoc, rcConstructing, rcSelf, rcNull ); }
-
-    return rc;
-}
-
-rc_t KXMLNodesetAddRef(const KXMLNodeset *cself)
-{
-    if (cself) {
-        KXMLNodeset *self = (KXMLNodeset*) cself;
-        atomic32_inc(&self->refcount);
-    }
-    return 0;
-}
-
-rc_t KXMLNodesetRelease(const KXMLNodeset *cself)
-{
-    if (cself) {
-        KXMLNodeset *self = (KXMLNodeset*) cself;
-        if (atomic32_dec_and_test(&self->refcount)) {
-            if (self->xpathObj) {
-                xmlXPathFreeObject(self->xpathObj);
-                self->xpathObj = 0;
-            }
-            KXMLDocRelease(self->parent);
-            self->parent = 0;
-            if (self->path) {
-                free(self->path);
-                self->path = 0;
-            }
-            free(self);
-        }
-    }
-    return 0;
-}
-
-rc_t KXMLNodesetCount(const KXMLNodeset *self,
-    uint32_t *result)
-{
-    if (!result)
-    { return RC ( rcXML, rcDoc, rcListing, rcParam, rcNull ); }
-
-    *result = 0;
-
-    if (self && self->xpathObj) {
-        const xmlNodeSetPtr nodes = self->xpathObj->nodesetval;
-        if (nodes)
-        { *result = nodes->nodeNr; }
-        return 0;
-    }
-    else {
-        return RC ( rcXML, rcDoc, rcAccessing, rcSelf, rcNull );
-    }
-}
-
-/********* XML node ********/
-
-struct KXMLNode {
-    const KXMLNodeset *parent;
-    /* use parent's refcount; */
-
-    /* parent and index are used to find a node within a nodeset
-    (when children == 0) */
-    int32_t idx;
-
-    /* when children != 0 then children is an XML node,
-    path is node's path relative to parent's path */
-    const struct _xmlNode *children;
-    char *path;
-};
-
-static rc_t s_KXMLNode_cTor(const KXMLNodeset *self,
-    const KXMLNode **result,
-    uint32_t idx,
-    const struct _xmlNode *children,
-    char *path)
-{
-    KXMLNode *obj = (KXMLNode*) malloc(sizeof(KXMLNode));
-    if (!obj) {
-        return RC ( rcXML, rcDoc, rcAccessing, rcMemory, rcExhausted );
-    }
-    obj->parent = self;
-    obj->path = 0;
-    obj->children = children;
-    if (children) {
-        size_t size = 0;
-        size_t path_size;
-        if (path)
-        {   size += string_measure(path, &path_size) + 1; }
-        if (children->name)
-        {   
-            size_t sz;
-            size += string_measure((char*)children->name, &sz); 
-        }
-        obj->path = (char*)malloc(size + 1);
-        if (!obj->path) {
-            free(obj);
-            return RC ( rcXML, rcDoc, rcAccessing, rcMemory, rcExhausted );
-        }
-        *obj->path = 0;
-        if (path && path[0]) {
-            string_copy(obj->path, size + 1, path, path_size);
-            strcat(obj->path, "/");
-        }
-        strcat(obj->path, (char*)children->name);
-    }
-    KXMLNodesetAddRef(obj->parent);
-    obj->idx = idx;
-    *result = obj;
-    return 0;
-}
-
-/* GetName
- */
-rc_t KXMLNodeGetName ( const KXMLNode *self, const char **name ) {
-    if (!self)
-    {   return RC ( rcXML, rcNode, rcAccessing, rcSelf, rcNull ); }
-    if (!name)
-    {   return RC ( rcXML, rcNode, rcAccessing, rcParam, rcNull ); }
-    *name = 0;
-    if (!self->children) {
-        assert(self->parent);
-        *name = self->parent->path;
-        /*TODO
-        here name if not the last node name but absolute name from xml root*/
-    } else {
-        *name = (const char*)self->children->name;
-    }
-    return 0;
-}
-
-rc_t KXMLNodeElementName ( const KXMLNode *self, const char **name )
-{
-    if( self == NULL ) {
-        return RC ( rcXML, rcNode, rcAccessing, rcSelf, rcNull );
-    }
-    if( name == NULL ) {
-        return RC ( rcXML, rcNode, rcAccessing, rcParam, rcNull );
-    }
-    *name = NULL;
-    if( self->children == NULL ) {
-        *name = (const char*)self->parent->xpathObj->nodesetval->nodeTab[self->idx]->name;
-    } else {
-        *name = (const char*)self->children->name;
-    }
-    return 0;
-}
-
-rc_t KXMLNodesetGetNodeRead(const KXMLNodeset *self,
-    const KXMLNode **result,
-    uint32_t idx)
-{
-    rc_t rc = 0;
-    uint32_t count = 0;
-
-    if (!result)
-    { return RC ( rcXML, rcNode, rcAccessing, rcParam, rcNull ); }
-
-    *result = 0;
-
-    if (self) {
-        rc = KXMLNodesetCount(self, &count);
-        if (rc == 0) {
-            assert(count >= 0);
-            if (count == 0) {
-            /* TODO: this test should be made when KXMLNodeset is created */
-                rc = RC(rcXML, rcNode, rcAccessing, rcNode, rcNotFound);
-            }
-            else if (idx < count) {
-                rc = s_KXMLNode_cTor(self, result, idx, NULL, NULL);
-            }
-            else {
-                rc = RC (rcXML, rcNode, rcAccessing, rcParam, rcIncorrect);
-            }
-        }
-    }
-    else {
-        rc = RC ( rcXML, rcDoc, rcAccessing, rcSelf, rcCorrupt );
-    }
-    return rc;
-}
-
-/** Opens a node set relative to current node */
-rc_t KXMLNodeVOpenNodesetRead ( const KXMLNode *self,
-    struct KXMLNodeset const **result, const char *path, va_list args )
-{
-    rc_t rc = 0;
-
-    if (!result || !path || !path[0])
-    { return RC ( rcXML, rcNode, rcAccessing, rcParam, rcNull ); }
-
-    *result = 0;
-
-    if (self == NULL)
-    {  return RC ( rcXML, rcNode, rcAccessing, rcSelf, rcNull );}
-
-    if (self && self->parent && self->parent->path) {
-        char *newPath = 0;
-        char buffer[XPATH_MAX_LEN];
-        char outpath[XPATH_MAX_LEN];
-        rc = s_KXML_vsnprintf(outpath, sizeof(outpath), path, args);
-        if (rc != 0)
-        { return rc; }
-
-        if (path[0] == '/')
-        { newPath = outpath; }
-        else {
-            size_t size;
-            if ((string_measure(self->parent->path, &size) + 1 + string_measure(outpath, &size) + 1 + 3)
-                > XPATH_MAX_LEN)
-            {
-                /* buffer is too small */
-                return RC
-                    ( rcXML, rcNode, rcAccessing, rcBuffer, rcExhausted );
-            }
-            if( self->parent->path[0] == '/' && self->parent->path[1] == '\0' ) {
-                /* correctly construct child path if parent path is "/" */
-                rc = s_KXML_snprintf(buffer, sizeof(buffer), "/%s", outpath);
-            } else {
-                rc = s_KXML_snprintf(buffer, sizeof(buffer), "(%s)[%d]/%s", self->parent->path, self->idx + 1, outpath);
-            }
-            newPath = buffer;
-        }
-        assert(self->parent && self->parent->parent);
-        rc = KXMLNodeset_cTor(self->parent->parent, result, newPath);
-    }
-    else { rc = RC ( rcXML, rcNode, rcAccessing, rcSelf, rcCorrupt ); }
-
-    return rc;
-}
-
-/** Opens a node set relative to current node */
-rc_t KXMLNodeOpenNodesetRead(const KXMLNode *self,
-    const KXMLNodeset **result,
-    const char *path,
-    ...)
-{
-    rc_t rc = 0;
-    va_list args;
-    va_start ( args, path );
-    rc = KXMLNodeVOpenNodesetRead ( self, result, path, args );
-    va_end ( args );
-    return rc;
-}
-
-rc_t KXMLNodeRelease(const KXMLNode *cself) {
-    if (cself) {
-        KXMLNode *self = (KXMLNode*) cself;
-        KXMLNodesetRelease(self->parent);
-        free(self->path);
-        free(self);
-    }
-    return 0;
-}
-
-/** Reads node's value.
-remaining can be NULL */
-/* Implementation:
-Iterates over all XML_TEXT_NODE children starting from firstChild.
-Uses state machine.
-
-Initial state is eNotFound.
-First it skips all nodes until their cumulative size is < offset;
-Then it copies the [part of] the first node considering offset:
-if the buffer is filled then state changes to eFilled,
-otherwise to eStarted.
-
-If the state is eStarted: node is added to buffer.
-State remains eStarted or changes to eFilled.
-
-If the state is eFilled then remaining value is added up. */
-int s_KXMLNode_readTextNode(const xmlNodePtr firstChild,
-    void *buffer,
-    size_t bsize,
-    size_t *num_read,
-    size_t *remaining,
-    size_t offset)
-{
-    enum EState {
-        eNotFound,
-        eStarted,
-        eFilled
-    } state = eNotFound;
-
-    size_t head = 0;
-    size_t copied = 0;
-    size_t remains = 0;
-    xmlNodePtr node = firstChild;
-
-    if (!firstChild)
-    {   return RC ( rcXML, rcNode, rcReading, rcParam, rcNull ); }
-
-    assert(num_read);
-
-    while (node) {
-        if (node->type == XML_TEXT_NODE) {
-            char* content = (char*) node->content;
-            size_t size;
-            size_t chunkSz = string_measure(content, &size);
-            switch (state) {
-                case eNotFound: {
-                    if (offset < head + chunkSz) {
-                        size_t chunkOffset = offset - head;
-                        size_t readySz = chunkOffset + chunkSz;
-                        size_t size = readySz;
-                        if (readySz >= (bsize - copied)) {
-                            size = bsize - copied;
-                            state = eFilled;
-                        }
-                        else {
-                            state = eStarted;
-                        }
-                        if (size) {
-                            assert(buffer);
-                            string_copy((char*) buffer + copied, bsize - copied, 
-                                content + chunkOffset, size);
-                        }
-                        copied += size;
-                        if (state == eFilled) {
-                            remains = readySz - size;
-                        }
-                    }
-                    break;
-                }
-                case eStarted: {
-                    size_t chunkOffset = 0;
-                    size_t readySz = chunkSz;
-                    size_t size = readySz;
-                    if (readySz >= (bsize - copied)) {
-                        size = bsize - copied;
-                        state = eFilled;
-                    }
-                    if (size) {
-                        assert(buffer);
-                        string_copy((char*) buffer + copied, bsize - copied,
-                            content + chunkOffset, size);
-                    }
-                    copied += size;
-                    if (state == eFilled) {
-                        remains = readySz - size;
-                    }
-                    break;
-                }
-                case eFilled:
-                    remains += chunkSz;
-                    break;
-                default:
-                    assert(0);
-                    break;
-            }
-        }
-        node = node->next;
-    }
-
-    *num_read = copied;
-
-    if (remaining)
-    { *remaining = remains; }
-
-    return 0;
-}
-
-/** Reads XML Node value
-    remaining can be NULL.
-Can have bsize parameter equal to 0:
-can be used to find out the node value length.
-*/
-rc_t KXMLNodeRead(const KXMLNode *self,
-    size_t offset,
-    void *buffer,
-    size_t bsize,
-    size_t *num_read,
-    size_t *remaining)
-{
-    rc_t rc = 0;
-
-    if (!num_read)
-    { return RC ( rcXML, rcNode, rcReading, rcParam, rcNull ); }
-    if (bsize && !buffer)
-    { return RC ( rcXML, rcNode, rcReading, rcParam, rcNull ); }
-
-    *num_read = 0;
-
-    if (remaining)
-    { *remaining = 0; }
-
-    if (self) {
-        const struct _xmlNode *children = NULL;
-        if (self->children) {
-            /*the case when (KXMLNode::children != NULL) is implemented here*/
-            if (self->children->children)
-            { children = self->children->children; }
-        }
-        else if (self->parent && self->parent->xpathObj) {
-            xmlNodePtr node = NULL;
-            int32_t idx = self->idx;
-            const xmlXPathObjectPtr xpathObj = self->parent->xpathObj;
-            assert(xpathObj->nodesetval && idx < xpathObj->nodesetval->nodeNr);
-            node = xpathObj->nodesetval->nodeTab[idx];
-            if (node && node->type == XML_ELEMENT_NODE) {
-                children = node->children;
-            }
-            rc = 0;
-        }
-        if (children != NULL) {
-            return s_KXMLNode_readTextNode( ( xmlNodePtr )
-                children, buffer, bsize, num_read, remaining, offset);
-        }
-    }
-    else { rc = RC ( rcXML, rcNode, rcReading, rcNode, rcCorrupt ); }
-
-    return rc;
-}
-
-
-#define MAX_I16      0x8000 /* 32768 */
-#define MAX_U16     0x10000
-#define MAX_I32  0x80000000
-#define MAX_U32 0x100000000
-
-static
-rc_t s_KXMLNodeReadNodeOrAttrCString(const KXMLNode *self,
-    char *buffer, size_t bsize, size_t *size, const char *attr)
-{
-    if (attr)
-    { return KXMLNodeReadAttrCString(self, attr, buffer, bsize, size); }
-    else { return KXMLNodeReadCString(self, buffer, bsize, size); }
-}
-
-static
-rc_t s_KXMLNodeReadNodeOrAttrAs_long(const KXMLNode *self, long *l,
-    const char *attr)
-{
-    rc_t rc;
-    size_t num_read;
-    char buffer [ 256 ];
-
-    assert ( l );
-
-    rc = s_KXMLNodeReadNodeOrAttrCString
-        ( self, buffer, sizeof buffer, & num_read, attr );
-
-    if ( rc == 0 )
-    {
-        char *end;
-        *l = strtol ( buffer, & end, 0 );
-        if ( end [ 0 ] != 0 )
-            rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-    }
-
-    return rc;
-}
-
-static
-rc_t s_KXMLNodeReadNodeOrAttrAs_ulong(const KXMLNode *self, unsigned long *l,
-    const char *attr)
-{
-    rc_t rc;
-    size_t num_read;
-    char buffer [ 256 ];
-
-    assert ( l );
-
-    rc = s_KXMLNodeReadNodeOrAttrCString
-        ( self, buffer, sizeof buffer, & num_read, attr );
-
-    if ( rc == 0 )
-    {
-        char *end;
-        *l = strtoul ( buffer, & end, 0 );
-
-        if ( end [ 0 ] != 0 )
-        {
-    #if 1
-            rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-    #else
-            if ( end [ 0 ] != '-' && end [ 0 ] != '+' )
-                rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-            else
-            {
-                /* read signed, cast to unsigned... ? */
-            }
-    #endif
-        }
-    }
-
-    return rc;
-}
-
-/* ReadAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-static
-rc_t s_KXMLNodeReadNodeOrAttrAsI16 ( const KXMLNode *self, int16_t *i,
-    const char *attr )
-{
-    rc_t rc = 0;
-    long val = 0;
-
-    if ( i == NULL )
-        return RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-
-    rc = s_KXMLNodeReadNodeOrAttrAs_long ( self, &val, attr );
-
-    if ( rc == 0 )
-    {
-        if ( val < -32768  || val >= 32768 )
-            rc = RC ( rcXML, rcNode, rcReading, rcRange, rcExcessive );
-        else
-            * i = ( int16_t ) val;
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadAsI16 ( const KXMLNode *self, int16_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI16(self, i, NULL); }
-static 
-rc_t s_KXMLNodeReadNodeOrAttrAsU16 ( const KXMLNode *self, uint16_t *u,
-    const char *attr )
-{
-    rc_t rc = 0;
-    unsigned long val = 0;
-
-    if ( u == NULL )
-        return RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-
-    rc = s_KXMLNodeReadNodeOrAttrAs_ulong(self, &val, attr);
-
-    if ( rc == 0 )
-    {
-        if ( val >= 0x10000 )
-            rc = RC ( rcXML, rcNode, rcReading, rcRange, rcExcessive );
-        else
-            * u = ( uint16_t ) val;
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadAsU16 ( const KXMLNode *self, uint16_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU16(self, u, NULL); }
-static
-rc_t s_KXMLNodeReadNodeOrAttrAsI32 ( const KXMLNode *self, int32_t *i,
-    const char *attr )
-{
-    rc_t rc = 0;
-    long val = 0;
-
-    if ( i == NULL )
-        return RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-
-    rc = s_KXMLNodeReadNodeOrAttrAs_long ( self, &val, attr );
-
-    if ( rc == 0 )
-    {
-        * i = ( int32_t ) val;
-        if ( ( long ) ( * i ) != val )
-            rc = RC ( rcXML, rcNode, rcReading, rcRange, rcExcessive );
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadAsI32 ( const KXMLNode *self, int32_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI32(self, i, NULL); }
-rc_t s_KXMLNodeReadNodeOrAttrAsU32 ( const KXMLNode *self, uint32_t *u,
-    const char *attr )
-{
-    rc_t rc = 0;
-    unsigned long val = 0;
-
-    if ( u == NULL )
-        return RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-
-    rc = s_KXMLNodeReadNodeOrAttrAs_ulong(self, &val, attr);
-
-    if ( rc == 0 )
-    {
-        * u = ( uint32_t ) val;
-        if ( ( unsigned long ) ( * u ) != val )
-            rc = RC ( rcXML, rcNode, rcReading, rcRange, rcExcessive );
-    }
-
-    return rc;
-}
-rc_t KXMLNodeReadAsU32 ( const KXMLNode *self, uint32_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU32(self, u, NULL); }
-static
-rc_t s_KXMLNodeReadNodeOrAttrAsI64 ( const KXMLNode *self, int64_t *i,
-    const char *attr )
-{
-    rc_t rc;
-
-    if ( i == NULL )
-        rc = RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t num_read;
-        char buffer [ 256 ];
-
-        rc = s_KXMLNodeReadNodeOrAttrCString
-            ( self, buffer, sizeof buffer, & num_read, attr );
-
-        if ( rc == 0 )
-        {
-            char *end;
-            int64_t val = strtoi64 ( buffer, & end, 0 );
-
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-            else
-                * i = val;
-        }
-    }
-
-    return rc;
-}
-rc_t KXMLNodeReadAsI64 ( const KXMLNode *self, int64_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI64(self, i, NULL); }
-
-rc_t s_KXMLNodeReadNodeOrAttrAsU64 ( const KXMLNode *self, uint64_t *u,
-    const char *attr )
-{
-    rc_t rc;
-
-    if ( u == NULL )
-        rc = RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t num_read;
-        char buffer [ 256 ];
-
-        rc = s_KXMLNodeReadNodeOrAttrCString
-            ( self, buffer, sizeof buffer, & num_read, attr );
-
-        if ( rc == 0 )
-        {
-            char *end;
-            uint64_t val = strtou64 ( buffer, & end, 0 );
-
-            if ( end [ 0 ] != 0 )
-            {
-        #if 1
-                rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-        #else
-                if ( end [ 0 ] != '-' && end [ 0 ] != '+' )
-                    rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-                else
-                {
-                    /* read signed, cast to unsigned... ? */
-                    /* FYI
-                       centos64: strtou64("-1") = 0xffff...
-                       errno = 1; end[0] = '\0' */
-                }
-        #endif
-            }
-            else
-                * u = val;
-        }
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadAsU64 ( const KXMLNode *self, uint64_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU64(self, u, NULL); }
-rc_t s_KXMLNodeReadNodeOrAttrAsF64 ( const KXMLNode *self, double *f,
-    const char *attr )
-{
-    rc_t rc;
-
-    if ( f == NULL )
-        rc = RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t num_read;
-        char buffer [ 256 ];
-
-        rc = s_KXMLNodeReadNodeOrAttrCString
-            ( self, buffer, sizeof buffer, & num_read, attr );
-
-        if ( rc == 0 )
-        {
-            char *end;
-            * f = strtod ( buffer, & end );
-            if ( end [ 0 ] != 0 )
-                rc = RC ( rcXML, rcNode, rcReading, rcType, rcIncorrect );
-        }
-    }
-
-    return rc;
-}
-rc_t KXMLNodeReadAsF64 ( const KXMLNode *self, double *f )
-{ return s_KXMLNodeReadNodeOrAttrAsF64(self, f, NULL); }
-
-/* Read ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-rc_t KXMLNodeReadCString ( const KXMLNode *self,
-    char *buffer, size_t bsize, size_t *size )
-{
-    rc_t rc;
-
-    if ( size == NULL )
-        rc = RC ( rcXML, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t remaining;
-        rc = KXMLNodeRead ( self, 0, buffer, bsize, size, & remaining );
-        if ( rc == 0 )
-        {
-            if ( * size == bsize )
-            {
-                rc = RC ( rcXML, rcNode, rcReading, rcBuffer, rcInsufficient );
-                * size += remaining;
-            }
-            else
-            {
-                buffer [ * size ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadCStr( const KXMLNode *self, char** str, const char* default_value)
-{
-    rc_t rc = 0;
-
-    if( self == NULL || str == NULL ) {
-        rc = RC( rcXML, rcNode, rcReading, rcParam, rcNull);
-    } else { 
-        char b[10240];
-        size_t to_read = sizeof(b) - 1, nread = 0;
-        
-        *str = NULL;
-        if( (rc = KXMLNodeReadCString(self, b, to_read, &nread)) == 0 ) {
-            if( nread == 0 && default_value != NULL ) {
-                size_t size;
-                *str = string_dup(default_value, string_measure(default_value, &size));
-            } else {
-                *str = string_dup(b, nread);
-            }
-            if( *str == NULL ) {
-                rc = RC(rcXML, rcNode, rcReading, rcMemory, rcInsufficient);
-            }
-        }
-    }
-    return rc;
-}
-
-
-/** Reads XML Node attribute value
-attr: attribute name
-    remaining can be NULL.
-Can have bsize parameter equal to 0:
-can be used to find out the attribute value length.
-*/
-rc_t KXMLNodeReadAttr(const KXMLNode *self,
-     const char *attr,
-     void *buffer,
-     size_t bsize,
-     size_t *num_read,
-     size_t *remaining)
-{
-    rc_t status = 0;
-    struct _xmlAttr* properti = NULL;
-    if (!attr || !num_read) {
-        return RC ( rcXML, rcAttr, rcReading, rcParam, rcNull );
-    }
-    if (bsize && !buffer)
-    {   return RC ( rcXML, rcNode, rcReading, rcParam, rcNull ); }
-    *num_read = 0;
-    if (remaining) {
-        *remaining = 0;
-    }
-    if (!self)
-    {   return RC ( rcXML, rcAttr, rcReading, rcSelf, rcCorrupt ); }
-    if (self->children) {
-        properti = self->children->properties;
-    }
-    else if (self->parent && self->parent->xpathObj) {
-        int32_t idx = self->idx;
-        const xmlXPathObjectPtr xpathObj = self->parent->xpathObj;
-        assert(xpathObj->nodesetval && idx < xpathObj->nodesetval->nodeNr);
-        {
-            xmlNodePtr node = xpathObj->nodesetval->nodeTab[idx];
-            if (node && node->type == XML_ELEMENT_NODE)
-            {   properti = node->properties; }
-        }
-    }
-    else {
-        status = RC ( rcXML, rcAttr, rcReading, rcSelf, rcCorrupt );
-    }
-    if (properti) {
-        while (properti) {
-            if (!xmlStrcmp(BAD_CAST attr, properti->name)) {
-                return s_KXMLNode_readTextNode(properti->children,
-                    buffer, bsize, num_read, remaining, 0);
-            }
-            properti = properti->next;
-        }
-    }
-    status = RC ( rcXML, rcAttr, rcReading, rcAttr, rcNotFound );
-    return status;
-}
-
-
-/* ReadAttrAs ( formatted )
- *  reads as integer or float value in native byte order
- *  casts smaller-sized values to desired size, e.g.
- *    uint32_t to uint64_t
- *
- *  "i" [ OUT ] - return parameter for signed integer
- *  "u" [ OUT ] - return parameter for unsigned integer
- *  "f" [ OUT ] - return parameter for double float
- */
-rc_t KXMLNodeReadAttrAsI16
-    ( const KXMLNode *self, const char *attr, int16_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI16(self, i, attr); }
-
-rc_t KXMLNodeReadAttrAsU16
-    ( const KXMLNode *self, const char *attr, uint16_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU16(self, u, attr); }
-
-rc_t KXMLNodeReadAttrAsI32 ( const KXMLNode *self,
-    const char *attr, int32_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI32(self, i, attr); }
-
-rc_t KXMLNodeReadAttrAsU32
-    ( const KXMLNode *self, const char *attr, uint32_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU32(self, u, attr); }
-
-rc_t KXMLNodeReadAttrAsI64
-    ( const KXMLNode *self, const char *attr, int64_t *i )
-{ return s_KXMLNodeReadNodeOrAttrAsI64(self, i, attr); }
-
-rc_t KXMLNodeReadAttrAsU64
-    ( const KXMLNode *self, const char *attr, uint64_t *u )
-{ return s_KXMLNodeReadNodeOrAttrAsU64(self, u, attr); }
-
-rc_t KXMLNodeReadAttrAsF64 ( const KXMLNode *self, const char *attr, double *f )
-{ return s_KXMLNodeReadNodeOrAttrAsF64(self, f, attr); }
-
-
-/* ReadAttrCString ( formatted )
- *  reads as C-string
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated string.
- *
- *  "size" [ OUT ] - return parameter giving size of string
- *  not including NUL byte. the size is set both upon success
- *  and insufficient buffer space error.
- */
-rc_t KXMLNodeReadAttrCString ( const KXMLNode *self, const char *attr,
-    char *buffer, size_t bsize, size_t *size )
-{
-    rc_t rc;
-
-    if ( size == NULL )
-        rc = RC ( rcXML, rcAttr, rcReading, rcParam, rcNull );
-    else
-    {
-        size_t remaining;
-        rc = KXMLNodeReadAttr ( self, attr, buffer, bsize, size, & remaining );
-        if ( rc == 0 )
-        {
-            if ( * size == bsize )
-            {
-                rc = RC ( rcXML, rcAttr, rcReading, rcBuffer, rcInsufficient );
-                * size += remaining;
-            }
-            else
-            {
-                buffer [ * size ] = 0;
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeReadAttrCStr( const KXMLNode *self, const char *attr, char** str, const char* default_value)
-{
-    rc_t rc = 0;
-
-    if( self == NULL || attr == NULL || str == NULL ) {
-        rc = RC( rcXML, rcNode, rcReading, rcParam, rcNull);
-    } else { 
-        char b[10240];
-        size_t to_read = sizeof(b) - 1, nread = 0;
-        
-        *str = NULL;
-        if( (rc = KXMLNodeReadAttrCString(self, attr, b, to_read, &nread)) == 0 ) {
-            if( nread == 0 && default_value != NULL ) {
-                size_t size;
-                *str = string_dup(default_value, string_measure(default_value, &size));
-            } else {
-                *str = string_dup(b, nread);
-            }
-        } else if( GetRCState(rc) == rcNotFound && default_value != NULL ) {
-            size_t size;
-            *str = string_dup(default_value, string_measure(default_value, &size));
-            rc = 0;
-        }
-        if( rc == 0 && *str == NULL ) {
-            rc = RC(rcXML, rcNode, rcReading, rcMemory, rcInsufficient);
-        }
-    }
-    return rc;
-}
-
-
-struct s_KNodeNamelist {
-    KNamelist dad;
-    struct _xmlAttr* properties;
-    struct _xmlNode* children;
-};
-typedef struct s_KNodeNamelist s_KNodeNamelist;
-static rc_t KNodeNamelistDestroy (s_KNodeNamelist *self)
-{
-    free(self);
-    return 0;
-}
-
-static rc_t s_LibXmlCount(uint32_t *count,
-    const struct _xmlNode* children,
-    const struct _xmlAttr* properties)
-{
-    assert(count);
-
-    *count = 0;
-
-    /* It neither of properties nor children exists
-    then this node does not have children */
-
-    if (properties) {
-        while (properties) {
-            ++(*count);
-            properties = properties->next;
-        }
-    }
-    else if (children) {
-        while (children) {
-            if (children->type == XML_ELEMENT_NODE) {
-                ++(*count);
-            }
-            children = children->next;
-        }
-    }
-
-    return 0;
-}
-
-static rc_t KNodeNamelistCount(const s_KNodeNamelist *self,
-    uint32_t *count)
-{
-    if (!count) {
-        return RC ( rcXML, rcNamelist, rcListing, rcParam, rcNull );
-    }
-
-    return s_LibXmlCount(count, self->children, self->properties);
-}
-
-static rc_t s_LibXmlGetNode(const struct _xmlNode** result,
-    uint32_t idx,
-    const struct _xmlNode* children)
-{
-    uint32_t count = 0;
-    while (children) {
-        if (children->type == XML_ELEMENT_NODE) {
-            if (count == idx) {
-                *result = children;
-                return 0;
-            }
-            ++count;
-        }
-        children = children->next;
-    }
-    return RC ( rcXML, rcNode, rcReading, rcIndex, rcNotFound );
-}
-
-/* TODO:
-quick and dirty version: bad style and code copying: has to be refactored */
-rc_t KXMLNodeGetNodeRead ( const KXMLNode *self,
-    const KXMLNode **result,
-    uint32_t idx )
-{
-    if (!self)
-    {   return RC ( rcXML, rcNode, rcReading, rcSelf, rcNull ); }
-    if (!result)
-    {   return RC ( rcXML, rcNode, rcReading, rcParam, rcNull ); }
-
-    *result = 0;
-
-    {
-        uint32_t count = 0;
-        rc_t rc = KXMLNodeCountChildNodes(self, &count);
-        if (rc)
-        {   return rc; }
-        if (idx >= count)
-        {   return RC ( rcXML, rcNode, rcCreating, rcIndex, rcInvalid ); }
-
-        {
-            const struct _xmlNode *resultChildren = 0;
-            const struct _xmlNode *children = self->children;
-            if (children) {
-                children = children->children;
-                assert(children);
-            }
-            else {
-                if (self && self->parent && self->parent->xpathObj) {
-                    const xmlNodeSetPtr nodesetval
-                        = self->parent->xpathObj->nodesetval;
-                    if (nodesetval) {
-                        if ((nodesetval->nodeNr > 0)
-                            && nodesetval->nodeTab)
-                        {
-                            if (nodesetval->nodeNr <= self->idx) {
-                                return RC ( rcXML, rcNode, rcCreating,
-                                    rcSelf, rcCorrupt );
-                            }
-                            if (nodesetval->nodeTab[self->idx]) {
-                                children
-                                    = nodesetval->nodeTab[self->idx]->children;
-                            /*parent node for our requested parent->child[idx]*/
-                                assert(children);
-                            }
-                            else {
-                                return RC ( rcXML, rcNode, rcCreating,
-                                    rcSelf, rcCorrupt );
-                            }
-                        }
-                        else {
-                            return RC ( rcXML, rcNode, rcCreating,
-                                rcSelf, rcCorrupt );
-                        }
-                    } else {
-                        return RC(rcXML, rcNode, rcCreating, rcSelf, rcCorrupt);
-                    }
-                } else {
-                    return RC ( rcXML, rcNode, rcCreating, rcSelf, rcCorrupt );
-                }
-            }
-            rc = s_LibXmlGetNode(&resultChildren, idx, children);
-            if (rc)
-            {   return rc; }
-            rc = s_KXMLNode_cTor
-                (self->parent, result, 0, resultChildren, self->path);
-            return rc;
-        }
-    }
-}
-
-static rc_t KNodeNamelistGet(const s_KNodeNamelist *self,
-    uint32_t idx,
-    const char **name)
-{
-    uint32_t count = 0;
-    if (self->properties) {
-        struct _xmlAttr* properties = self->properties;
-        while (properties) {
-            if (count == idx) {
-                *name = (const char*)properties->name;
-                return 0;
-            }
-            ++count;
-            properties = properties->next;
-        }
-    }
-    else if (self->children) {
-        const struct _xmlNode *result = 0;
-        rc_t rc = s_LibXmlGetNode(&result, idx, self->children);
-        if (rc)
-        { return rc; }
-        *name = (const char*)result->name;
-        return 0;
-    }
-    return RC ( rcXML, rcNode, rcReading, rcIndex, rcNotFound );
-}
-
-static KNamelist_vt_v1 vtKNodeNamelist = {
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    KNodeNamelistDestroy,
-    KNodeNamelistCount,
-    KNodeNamelistGet
-    /* end minor version 0 methods */
-};
-
-enum EKNodeNamelistType {
-    eAttr,
-    eNode
-};
-
-/** KAttrNamelist factory method */
-static int s_KXMLNode_createKNodeNamelist(const KXMLNode *self,
-    const KNamelist **list,
-    uint32_t type)
-{
-    /*TODO it seems
-    that the case when (KXMLNode::children != NULL) is not implemented*/
-    rc_t status = 0;
-    *list = 0;
-    if (self && self->parent && self->parent->xpathObj) {
-        s_KNodeNamelist* obj
-            = (s_KNodeNamelist*) malloc(sizeof(s_KNodeNamelist));
-        if (!obj) {
-            return RC ( rcXML, rcNamelist, rcCreating, rcMemory, rcExhausted );
-        }
-        status
-            = KNamelistInit(&obj->dad, (const KNamelist_vt*) &vtKNodeNamelist);
-        if (status != 0) {
-            free(obj);
-            return status;
-        }
-        obj->properties = 0;
-        obj->children = 0;
-        *list = &obj->dad;
-        if( self->children ) {
-            switch (type) {
-                case eAttr:
-                    obj->properties = self->children->properties;
-                    break;
-                case eNode:
-                    obj->children = self->children->children;
-                    break;
-                default:
-                    assert(0);
-                    break;
-            }
-        } else {
-            const xmlNodeSetPtr nodesetval = self->parent->xpathObj->nodesetval;
-            if (nodesetval) {
-                if ((nodesetval->nodeNr > 0) && nodesetval->nodeTab) {
-                    if (nodesetval->nodeNr <= self->idx) {
-                        free(obj);
-                        *list = 0;
-                        return RC
-                            (rcXML, rcNamelist, rcCreating, rcSelf, rcCorrupt);
-                    }
-                    if (nodesetval->nodeTab[self->idx]) {
-                        switch (type) {
-                            case eAttr:
-                                obj->properties =
-                                    nodesetval->nodeTab[self->idx]->properties;
-                                break;
-                            case eNode:
-                                obj->children =
-                                    nodesetval->nodeTab[self->idx]->children;
-                                break;
-                            default:
-                                assert(0);
-                                break;
-                        }
-                    }
-                }
-            }
-        }
-        status = 0;
-    }
-    else {
-        status = RC ( rcXML, rcNamelist, rcCreating, rcSelf, rcCorrupt );
-    }
-    return status;
-}
-rc_t KXMLNodeListAttr(const KXMLNode *self,
-    const KNamelist **names)
-{
-    return s_KXMLNode_createKNodeNamelist(self, names, eAttr);
-}
-
-rc_t KXMLNodeListChild(const KXMLNode *self,
-    const KNamelist **names)
-{
-    return s_KXMLNode_createKNodeNamelist(self, names, eNode);
-}
-
-rc_t KXMLNodeCountChildNodes(const KXMLNode *self,
-    uint32_t *count)
-{
-    if (!self)
-    {   return RC ( rcXML, rcNode, rcListing, rcSelf, rcNull ); }
-    if (!count)
-    {   return RC ( rcXML, rcNode, rcListing, rcParam, rcNull ); }
-    *count = 0;
-    if (self && self->parent && self->parent->xpathObj) {
-        const xmlNodeSetPtr nodesetval = self->parent->xpathObj->nodesetval;
-        if (nodesetval) {
-            if ((nodesetval->nodeNr > 0) && nodesetval->nodeTab) {
-                if (nodesetval->nodeNr <= self->idx) {
-                    return RC(rcXML, rcNamelist, rcCreating, rcSelf, rcCorrupt);
-                }
-                if (nodesetval->nodeTab[self->idx]) {
-                    if (!self->children) {
-                        return s_LibXmlCount(
-                            count, nodesetval->nodeTab[self->idx]->children, 0);
-                    } else { 
-                        /*assert(0); // not implemented*/
-                        if (!self->children->children)
-        /* 'self->children'
-         is a node that should contain its children in self->children->children.
-         If (self->children->children == NULL) then the node has no child. */
-                        {   return 0; }
-                        else {
-                            return s_LibXmlCount
-                                (count, self->children->children, 0);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return RC ( rcXML, rcNamelist, rcCreating, rcSelf, rcCorrupt );
-}
-
-/* GetFirstChildNodeRead
- *  Returns the first(with index 0) sub-node of self using path.
- *  Is equivalent to:
- *          KXMLNodeOpenNodesetRead(self, &nc, path, ...);
- *          KXMLNodesetGetNodeRead(ns, node, 0);
- */
-rc_t KXMLNodeVGetFirstChildNodeRead ( const KXMLNode *self,
-    const KXMLNode **node, const char *path, va_list args )
-{
-    rc_t rc = 0;
-
-    struct KXMLNodeset const *ns = NULL;
-
-    if (node == NULL) {
-        return RC(rcXML, rcNode, rcReading, rcParam, rcNull);
-    }
-
-    *node = NULL;
-
-    rc = KXMLNodeVOpenNodesetRead(self, &ns, path, args);
-
-    if (rc == 0) {
-        rc = KXMLNodesetGetNodeRead(ns, node, 0);
-        KXMLNodesetRelease(ns);
-    }
-
-    return rc;
-}
-
-rc_t KXMLNodeGetFirstChildNodeRead ( const KXMLNode *self,
-    const KXMLNode **node, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start(args, path);
-    rc = KXMLNodeVGetFirstChildNodeRead(self, node, path, args);
-    va_end(args);
-
-    return rc;
-}
-
-/* EOF */
diff --git a/libs/kxml/xtoc-parsexml.c b/libs/kxml/xtoc-parsexml.c
deleted file mode 100644
index b2093d2..0000000
--- a/libs/kxml/xtoc-parsexml.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/*******************************************************************************
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * =============================================================================
- */
-
-#include "xtoc-priv.h" /* XTocParseXml */
-
-#include <kxml/xml.h> /* KXMLNode */
-/* #include <klib/log.h> LOGERR */
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/printf.h>
-#include <klib/out.h>
-#include <klib/rc.h> /* RC */
-
-#include "os-native.h"
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdio.h> /* printf */
-#include <stdlib.h> /* free */
-#include <string.h> /* memset */
-#include <time.h>      /* timegm */
-#include <os-native.h> /* timegm */
-
-typedef struct KFile KFile;
-
-/*#define DISP_RC(rc, msg) (void) ( (rc == 0) ? 0 : LOGERR(klogInt, rc, msg) )*/
-#define DISP_RC(rc, msg) (void) ( 0 )
-
-/* copy-paste from libs/kfs/md5.c */
-
-static
-int hex_to_int ( char hex )
-{
-    int i = hex - '0';
-    if ( hex > '9' )
-    {
-        if ( hex < 'a' )
-            i = hex - 'A' + 10;
-        else
-            i = hex - 'a' + 10;
-
-        if ( i > 15 )
-            return -1;
-    }
-    return i;
-}
-
-static
-rc_t MD5SumExtract(const char* str, uint8_t digest[16])
-{
-    rc_t rc = 0;
-
-    int i = 0;
-    /* parse checksum */
-    for ( i = 0; i < 16; ++ i )
-    {
-        int l, u = hex_to_int ( str [ i + i + 0 ] );
-        l = hex_to_int ( str [ i + i + 1 ] );
-        if ( u < 0 || l < 0 )
-        {
-            rc = RC ( rcFS, rcXmlDoc, rcReading, rcFormat, rcInvalid );
-            break;
-        }
-
-        digest [ i ] = ( uint8_t ) ( ( u << 4 ) | l );
-    }
-
-    return rc;
-}
-
-typedef enum NodeType {
-     eUndefined
-    ,eROOT
-    ,eArchive
-    ,eContainer
-    ,eDirectory
-    ,eFile
-    ,eSymlink
-} NodeType;
-typedef struct NodeData {
-    const char* nodeName;
-
-/* need to free */
-    char* nodeValue;
-
-/* attributes */
-    char* id;
-    char* path;
-    char* name;
-    char* mtime;
-    char* filetype;
-    char* md5;
-    char* crc32;
-    char* size;
-    char* offset;
-
-/* parsed node information */
-    NodeType nodeType;
-    uint8_t digest[16];
-    uint64_t iSize;
-    uint64_t iOffset;
-    KTime_t tMtime;
-} NodeData;
-
-static
-NodeType GetNodeType(const char* nodeName)
-{
-    NodeType t = eUndefined;
-
-    if (nodeName == NULL) {
-        t = eUndefined;
-    }
-    else if (!strcmp(nodeName, "archive")) {
-        t = eArchive;
-    }
-    else if (!strcmp(nodeName, "container")) {
-        t = eContainer;
-    }
-    else if (!strcmp(nodeName, "directory")) {
-        t = eDirectory;
-    }
-    else if (!strcmp(nodeName, "file")) {
-        t = eFile;
-    }
-    else if (!strcmp(nodeName, "symlink")) {
-        t = eSymlink;
-    }
-    else if (strstr(nodeName, "ROOT")) {
-        t = eROOT;
-    }
-
-    return t;
-}
-
-#define DEBUG_PRINT false /* true false */
-
-/* TODO: check possible errors */
-/* Reverse to KTimePrint for tools/copycat/cctree-dump.c */
-static
-rc_t CC StrToKTime(const char* str, KTime_t* t)
-{
-    rc_t rc = 0;
-
-    assert(t);
-
-    if (str) {
-        int y, m, d, hr, mn, sc;
-        struct tm gmt;
-        memset(&gmt, 0, sizeof gmt);
-        sscanf(str, "%04d-%02d-%02dT%02d:%02d:%02dZ",
-                                &y, &m, &d, &hr, &mn, &sc);
-        gmt.tm_year = y - 1900;
-        gmt.tm_mon  = m - 1;
-        gmt.tm_mday = d;
-        gmt.tm_hour = hr;
-        gmt.tm_min  = mn;
-        gmt.tm_sec  = sc;
-        *t = timegm(&gmt);
-
-        if (DEBUG_PRINT) {
-            time_t t2 = ( time_t ) * t;
-            size_t len;
-            char buffer [ 64 ];
-
-            struct tm gmt;
-#if SUN
-	    gmt = * gmtime ( & t2 );
-#else
-            gmtime_r ( & t2, & gmt );
-#endif
-            rc = string_printf ( buffer, sizeof buffer, & len
-                , "%04d-%02d-%02dT%02d:%02d:%02dZ"
-                , gmt . tm_year + 1900
-                , gmt . tm_mon + 1
-                , gmt . tm_mday
-                , gmt . tm_hour
-                , gmt . tm_min
-                , gmt . tm_sec
-            );
-            
-            OUTMSG((">> %s\n", str));
-            OUTMSG(("<< %s\n", buffer));
-        }
-    }
-
-    return rc;
-}
-
-#define READ_ATTR(NODE, V) \
-    if (rc == 0) { \
-        rc = KXMLNodeReadAttrCStr(NODE, #V, &data->V, NULL); \
-        if (rc != 0) { \
-            if (GetRCState(rc) == rcNotFound) \
-                rc = 0; \
-        } \
-    }
-/*          else if (data->nodeName) \
-                PLOGERR(klogErr, (klogErr, rc, \
-                    "while calling KXMLNodeReadAttrCStr($(name)/@$(attr))", \
-                    "name=%s,attr=%s", data->nodeName, #V)); */
-
-#define PRN_ATTR(NM, V) \
-    if (DEBUG_PRINT && data->V) OUTMSG(("%s=\"%s\" ", NM, data->V))
-
-#define GET_ATTR(NODE, V) READ_ATTR(NODE, V); PRN_ATTR(#V, V)
-
-static rc_t CC NodeDataReadAttribs(NodeData* data, const KXMLNode* node,
-    const char* parentName, uint32_t idx)
-{
-    rc_t rc = 0;
-
-    assert(node && parentName && data);
-
-    if (DEBUG_PRINT) OUTMSG(("<%s ", data->nodeName));
-
-    GET_ATTR(node, id);
-    GET_ATTR(node, path);
-    GET_ATTR(node, name);
-    GET_ATTR(node, mtime);
-    GET_ATTR(node, filetype);
-    GET_ATTR(node, md5);
-    GET_ATTR(node, crc32);
-
-    READ_ATTR(node, size);
-    READ_ATTR(node, offset);
-
-    if (rc == 0)
-    {
-/* TODO: what size is negative no error is detected */
-        char * attr = "size";
-        rc = KXMLNodeReadAttrAsU64(node, attr, &data->iSize);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                rc = 0;
-            }
-        }
-
-        attr = "offset";
-        rc = KXMLNodeReadAttrAsU64(node, attr, &data->iOffset);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                rc = 0;
-            }
-        }
-/*          else if (data->nodeName) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "while calling KXMLNodeReadAttrAsU64($(name)/@$(attr))",
-                    "name=%s,attr=%s", data->nodeName, attr));
-            }*/
-        if (DEBUG_PRINT) 
-        {
-            OUTMSG(("%s=\"%lu\" ", attr, data->iSize));
-            OUTMSG(("%s=\"%lu\" ", attr, data->iOffset));
-        }
-    }
-
-    if (DEBUG_PRINT) OUTMSG((">"));
-    if (DEBUG_PRINT && data->nodeValue) OUTMSG(("%s", data->nodeValue));
-    if (DEBUG_PRINT) OUTMSG(("</%s>\n", data->nodeName));
-
-    return rc;
-}
-
-#define FREE(V) free(data->V); data->V = NULL
-
-static
-rc_t CC NodeDataDestroy(NodeData* data)
-{
-    assert(data);
-
-    FREE(nodeValue);
-    FREE(id);
-    FREE(path);
-    FREE(name);
-    FREE(mtime);
-    FREE(filetype);
-    FREE(md5);
-    FREE(crc32);
-    FREE(size);
-    FREE(offset);
-
-    return 0;
-}
-
-static rc_t CC NodeDataInit(NodeData* data, const KXMLNode* node,
-    const char* parentName, uint32_t idx)
-{
-    rc_t rc = 0;
-
-    assert(node && parentName && data);
-
-    memset(data, 0, sizeof *data);
-
-    rc = KXMLNodeGetName(node, &data->nodeName);
-/*  if (rc != 0) {
-        PLOGERR(klogErr, (klogErr, rc,
-            "while calling KXMLNodeGetName($(parent)[$(i)]",
-            "parent=%s,i=%d", parentName, idx));
-    }*/
-
-    if (rc == 0
-        && data->nodeName && !strcmp(data->nodeName, "symlink"))
-    {
-        rc = KXMLNodeReadCStr(node, &data->nodeValue, NULL);
-/*      if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLNodeReadCStr($(name))",
-                "name=%s", data->nodeName));
-        }*/
-    }
-
-    if (rc == 0) {
-        rc = NodeDataReadAttribs(data, node, parentName, idx);
-    }
-
-    if (rc == 0) {
-        data->nodeType = GetNodeType(data->nodeName);
-
-        if (data->md5) {
-            if (strlen(data->md5) != 32) {
-                rc = RC(rcFS, rcXmlDoc, rcReading, rcFormat, rcInvalid);
-/*              PLOGERR(klogErr, (klogErr, rc,
-                    "md5sum '$(md5)'", "md5=%s", data->md5));*/
-            }
-            else {
-                rc = MD5SumExtract(data->md5, data->digest);
-            }
-        }
-    }
-
-    if (rc == 0) {
-        rc = StrToKTime(data->mtime, &data->tMtime);
-    }
-
-    return rc;
-}
-
-static
-rc_t CC NodeDataAddToXToc(NodeData* data,
-                          struct XTocEntry* xSelf, struct XTocEntry* xContainer,
-                          struct XTocEntry** xEntry, bool *isContainer)
-{
-    rc_t rc = 0;
-
-    assert(data && xEntry && isContainer);
-
-    *isContainer = false;
-
-    switch (data->nodeType) {
-        case eUndefined:
-            rc = RC(rcFS, rcTocEntry, rcInflating, rcData, rcInvalid);
-/*          LOGERR(klogErr, rc, "undefined node type in DataXAdd");*/
-            break;
-        case eROOT: /* ignore root node */
-            *xEntry = xSelf;
-            break;
-        case eArchive:
-            *isContainer = true;
-            rc = XTocTreeAddArchive(xSelf, xEntry, xContainer,
-                data->name, data->tMtime, data->id, 
-                data->filetype, data->iSize, data->iOffset, data->digest);
-            break;
-        case eContainer:
-            *isContainer = true;
-            rc = XTocTreeAddContainer(xSelf, xEntry, xContainer,
-                data->name, data->tMtime, data->id, 
-                data->filetype, data->iSize, data->iOffset, data->digest);
-            break;
-        case eDirectory:
-            rc = XTocTreeAddDir(xSelf, xEntry, xContainer,
-                data->name, data->tMtime);
-            break;
-        case eFile:
-            rc = XTocTreeAddFile(xSelf, xEntry, xContainer,
-                data->name, data->tMtime,  data->id, 
-                data->filetype, data->iSize, data->iOffset, data->digest);
-            break;
-        case eSymlink:
-            rc = XTocTreeAddSymlink(xSelf, xEntry, xContainer,
-                data->name, data->tMtime, data->nodeValue);
-            break;
-    }
-
-    return rc;
-}
-
-static
-rc_t ProcessNode(const KXMLNode* node,
-    const char* parentName, uint32_t idx,
-    struct XTocEntry* xSelf, struct XTocEntry* xContainer)
-{
-    rc_t rc = 0;
-    uint32_t count = 0;
-    uint32_t i = 0;
-    struct XTocEntry* xEntry = NULL;
-    bool isContainer = false;
-    NodeData data;
-
-    assert(node && parentName);
-
-    if (rc == 0) {
-        rc = NodeDataInit(&data, node, parentName, idx);
-    }
-
-    if (rc == 0) {
-        DBGMSG(DBG_APP,DBG_COND_1,
-            ("%s[%i] = %s\n", parentName, idx, data.nodeName));
-        rc = NodeDataAddToXToc(&data, xSelf, xContainer, &xEntry, &isContainer);
-        if (isContainer) {
-            xContainer = xEntry;
-        }
-    }
-
-    if (rc == 0) {
-        rc = KXMLNodeCountChildNodes(node, &count);
-        if (rc != 0) {
-/*          PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLNodeCountChildNodes($(parent)[$(i)])",
-                "parent=%s,i=%d", parentName, idx));*/
-        }
-        else {
-/*          DBGMSG(DBG_APP,DBG_COND_1,
-                ("KXMLNodeCountChildNodes(%s) = %i\n", data.nodeName, count));*/
-        }
-    }
-
-    for (i = 0; i < count && rc == 0; ++i) {
-        const KXMLNode* child = NULL;
-
-        rc = KXMLNodeGetNodeRead(node, &child, i);
-        if (rc != 0) {
-/*          PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLNodeCountChildNodes($(parent)[$(i)][$(j)]",
-                "parent=%s,i=%d,j=%d", parentName, idx, i));*/
-        }
-        else {
-/*          DBGMSG(DBG_APP,DBG_COND_1,
-                ("KXMLNodeGetNodeRead(%s[%i])\n", data.nodeName, idx, i));*/
-            ProcessNode(child, data.nodeName, i, xEntry, xContainer);
-        }
-
-        {
-            rc_t rc2 = KXMLNodeRelease(child);
-            if (rc == 0)
-            {   rc = rc2; }
-            child = NULL;
-        }
-    }
-
-    NodeDataDestroy(&data);
-
-    return rc;
-}
-
-rc_t XTocParseXml(struct XTocEntry* xRoot, const KFile* file)
-{
-    rc_t rc = 0;
-
-    const KXMLMgr* mgr = NULL;
-    const KXMLDoc* doc = NULL;
-    const KXMLNodeset* root = NULL;
-    const char rootName[] = "/ROOT";
-
-/**** INIT ****/
-
-    if (rc == 0) {
-        rc = KXMLMgrMakeRead(&mgr);
-        DISP_RC(rc, "while calling KXMLMgrMakeRead");
-    }
-
-    if (rc == 0) {
-        KXMLMgrMakeDocRead(mgr, &doc, file);
-        DISP_RC(rc, "while calling KXMLMgrMakeDocRead");
-    }
-
-    if (rc == 0) {
-        rc = KXMLDocOpenNodesetRead(doc, &root, rootName);
-        if (rc != 0) {
-/*          PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLDocOpenNodesetRead $(name)",
-                "name=%s", rootName));*/
-        }
-    }
-
-    if (rc == 0) {
-        uint32_t count = 0;
-        rc = KXMLNodesetCount(root, &count);
-        if (rc != 0) {
-/*          PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLNodesetCount($(name))", "name=%s",
-                rootName));*/
-        }
-        else if (count != 1) {
-            rc = RC(rcFS, rcXmlDoc, rcReading,
-                rcTag, count ? rcExcessive : rcNotFound);
-/*          PLOGERR(klogErr, (klogErr, rc, "$(name)", "name=%s", rootName));*/
-        }
-        else if (false) {
-            DBGMSG(DBG_APP,DBG_COND_1,
-                ("KXMLNodesetCount(%s)=%d\n", rootName, count));
-        }
-    }
-
-/**** READ AND PROCESS THE ROOT XML NODE ****/
-
-    if (rc == 0) {
-        uint32_t i = 0;
-        const KXMLNode *node = NULL;
-
-        rc = KXMLNodesetGetNodeRead(root, &node, i);
-        if (rc == 0) {
-            ProcessNode(node, rootName, i, xRoot, xRoot);
-        }
-/*      else {
-*            PLOGERR(klogErr, (klogErr, rc,
-                "while calling KXMLNodesetGetNodeRead($(name), $(i))",
-                "name=%s,i=%d", rootName, i));
-        }*/
-
-        {
-            rc_t rc2 = KXMLNodeRelease(node);
-            if (rc == 0)
-            {   rc = rc2; }
-            node = NULL;
-        }
-    }
-
-/**** RELEASE ****/
-
-    {
-        rc_t rc2 = KXMLDocRelease(doc);
-        if (rc == 0)
-        {   rc = rc2; }
-        doc = NULL;
-    }
-
-    {
-        rc_t rc2 = KXMLNodesetRelease(root);
-        if (rc == 0)
-        {   rc = rc2; }
-        root = NULL;
-    }
-
-    {
-        rc_t rc2 = KXMLMgrRelease(mgr);
-        if (rc == 0)
-        {   rc = rc2; }
-        mgr = NULL;
-    }
-
-    return rc;
-}
-
-/************************************ EOF ****************** ******************/
diff --git a/libs/kxml/xtoc-priv.h b/libs/kxml/xtoc-priv.h
deleted file mode 100644
index 688ec88..0000000
--- a/libs/kxml/xtoc-priv.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_kfs_xtoc_priv_h_
-#define _h_kfs_xtoc_priv_h_
-
-#include <klib/defs.h>
-#include <klib/text.h>
-#include <klib/container.h>
-#include <stdarg.h>
-
-struct KFile;
-struct KDirectory;
-struct XToc;
-struct XTocEntry;
-struct XTocEntryDir;
-struct XTocEntryFile;
-struct XTocListing;
-
-/* ======================================================================
- * shared path routines that really should be their own class
- */
-
-rc_t XTocPathMakePath (char ** ppath, bool canon, const char * path,
-                       va_list args);
-
-/*
- * In parsing the copycat XML we add nodes stating at the root XTocEntry
- * of the XToc.
- *
- * For each node in the DOM add one entry in the XTocEntry for the containing
- * container/archive/directory
- *
- * use the id="xxx" attribute to create a symbolic link in the root.
- * we'll come up with a safe version of the name such as "id:1" using a name
- * that won't exist in the regular filename space.
- *
- *Parameters:
- *   self:      Use the inner most archive, directory, or container for self.
- *              Use the root for the entries inside of root
- *
- *   entry:     Use a local XTocEntry pointer for each new node.  Some will 
- *              remembered for a while and some won't.  It depends upon whether
- *              it has subnodes.  Do not free or release these pointers.  Just
- *              stop using them as they are not referenced counted and freed only
- *              by the KToc itself when it is Whacked.
- *
- *   container: Use the most recent containing archive or container XTocEntry for
- *              each new node.  Use root for those outside the outer most
- *              container or archive.  Do not use directory nodes for this.
- *
- *   name:      comes directly form the XML as is
- *
- *   mtime:     comes directly form the XML converted to 64 bit unsigned
- *
- *   filetype:  comes directly form the XML as is
- *
- *   md5:       comes directly form the XML converted from hex string to byte string
- *
- *   size:      comes directly form the XML converty to 64 bit unsigned
- *
- * For each directory node in the XML use XTocTreeAddDir()
- * For each archive node in the XML use XTocTreeAddArchive()
- * For each container node in the XML use XTocTreeAddContainer()
- * For each file node in the XML use XTocTreeAddFile()
- * For each symlink node in the XML use XTocTreeAddSymLink()
- *
- * For each file, container, or archive use XTocTreeAddSymLink()
- *  use the original root as self, a local pointer, name, mtime from the target and
- *  path of the file, archive or container from the XML as target
- *
- * All of these are local and in Windows build they do not get the CC needed for inter-library calls.
- */
-rc_t XTocParseXml (struct XTocEntry * root, const struct KFile * xml);
-
-rc_t XTocTreeAddFile      (struct XTocEntry * self, struct XTocEntry ** pentry,
-                           struct XTocEntry * container, const char * name,
-                           KTime_t mtime, const char * id, const char * filetype, 
-                           uint64_t size, uint64_t offset, uint8_t md5 [16]);
-
-rc_t XTocTreeAddContainer (struct XTocEntry * self, struct XTocEntry ** pentry,
-                           struct XTocEntry * container, const char * name,
-                           KTime_t mtime, const char * id, const char * filetype, 
-                           uint64_t size, uint64_t offset, uint8_t md5 [16]);
-
-rc_t XTocTreeAddArchive (struct XTocEntry * self, struct XTocEntry ** pentry,
-                         struct XTocEntry * container, const char * name,
-                         KTime_t mtime, const char * id, const char * filetype,
-                         uint64_t size, uint64_t offset, uint8_t md5 [16]);
-
-rc_t XTocTreeAddDir       (struct XTocEntry * self, struct XTocEntry ** entry,
-                           struct XTocEntry * container, const char * name,
-                           KTime_t mtime);
-
-rc_t XTocTreeAddSymlink   (struct XTocEntry * self, struct XTocEntry ** entry,
-                           struct XTocEntry * container, const char * name,
-                           KTime_t mtime, const char * target);
-
-
-#endif /* #ifndef _h_kfs_xtoc_priv_h_ */
-/* end of file */
diff --git a/libs/kxml/xtoc.c b/libs/kxml/xtoc.c
deleted file mode 100644
index 5d2dc22..0000000
--- a/libs/kxml/xtoc.c
+++ /dev/null
@@ -1,3466 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/extern.h>
-
-#include <kxml/xml.h>
-
-#include <klib/defs.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/refcount.h>
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/namelist.h>
-
-#include <kfs/file.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-#include <kfs/directory.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <assert.h>
-
-#include <klib/debug.h>
-#define DBGTOC(m)   DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TOC), m)
-#define DBGENTRY(m) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TOC), m)
-#define DBGCACHE(m) DBGMSG (DBG_KFS, DBG_FLAG(DBG_KFS_TOC), m)
-
-#include "xtoc-priv.h"
-
-struct KSysFile;
-
-typedef struct XToc XToc;
-static rc_t XTocRelease (const XToc * self);
-static rc_t XTocAddRef (const XToc * self);
-
-typedef struct XTocListing XTocListing;
-typedef struct XTocEntry XTocEntry;
-typedef struct KXTocDir KXTocDir;
-typedef struct KXTocFile KXTocFile;
-typedef struct XTocCache XTocCache;
-
-
-/* ======================================================================
- * XTocEntry_t
- *   Each node in the XToc tree needs to be one of a limited number of types
- *   these relate to the KPathType for KDirectory but are more limited in
- *   number.  However the file can explicity be treated as a directory if
- *   flagged as such.
- */
-
-typedef uint32_t XTocEntry_t;
-typedef enum XTocEntry_e
-{
-    xtoce_undefined,
-    xtoce_root,
-    xtoce_id,
-    xtoce_file,
-    xtoce_dir,
-    xtoce_link
-} XTocEntry_e;
-
-#define KDIR_IMPL struct KXTocDir
-#define KFILE_IMPL struct KXTocFile
-#include <kfs/impl.h>
-
-
-#define KNAMELIST_IMPL struct XTocListing
-#include <klib/impl.h>
-
-
-/* ======================================================================
- * XTocEntry
- *
- * TBD:  More efficient use of memory might be obtained by converting
- *       the union into space allocated after the main entry
- */
-struct XTocEntry
-{
-    BSTNode     node;           /* book keeping for the tree structure */
-    String	name;           /* leaf name */
-    XTocEntry * parent;         /* directory containing this entry */
-    XTocEntry * container;      /* compressed file or archive holding this */
-    XTocEntry * root;           /* base entry of the TOC that is '/' */
-    XTocCache * cache;          /* if opened this will be non-NULL */
-    KTime_t     mtime;          /* object modified time/date from the XML */
-    BSTree      tree;           /* objects below this (inverse of parent */
-    XTocEntry_t type;           /* XTocEntry_e */
-    union utype
-    {
-        struct /* idtype - name conflict on Solaris */
-        {
-            XTocEntry * target;
-        } id;
-
-        struct dirtype
-        {
-            int ignored;        /* currently nothing is here */
-        } dir;
-
-        struct filetype
-        {
-            String   filetype;  /* string from copycat XML describing file */
-            uint64_t size;      /* size of file within archive or decompressed */
-            uint64_t offset;    /* offset with in containing file */
-            uint8_t  md5 [16];  /* md5 sum digest */
-            bool has_tree;      /* tree is meaningfull if not false: see next two */
-            bool archive;       /* set if this is an archive, has_tree also set */
-            bool container;     /* set if this is acompressed file, has_tree also set */
-        } file;
-
-        struct linktype
-        {
-            String target;      /* path of the symbolic link */
-        } link;
-    } u;
-};
-
-#if _DEBUGGING
-#define DBG_XTocEntry(p)                                                \
-    {                                                                   \
-        DBGENTRY(("XTocEntry: %p\n", p));                               \
-        if (p)                                                          \
-        {                                                               \
-            DBGENTRY(("    name:      %S\n", &(p)->name));              \
-            DBGENTRY(("    parent:    %p\n", (p)->parent));             \
-            DBGENTRY(("    container: %p\n", (p)->container));          \
-            DBGENTRY(("    root:      %p\n", (p)->root));               \
-            DBGENTRY(("    cache:     %p\n", (p)->cache));              \
-            DBGENTRY(("    tree:      %p\n", (p)->tree));               \
-            DBGENTRY(("    type:      %u\n", (p)->type));               \
-            if ((p)->type == xtoce_id)                                  \
-                DBGENTRY(("    target:      %p\n", &(p)->u.id.target)); \
-            else if ((p)->type == xtoce_link)                          \
-                DBGENTRY(("    target:      %S\n", &(p)->u.link.target)); \
-            else if((p)->type == xtoce_file)                            \
-            {                                                           \
-                DBGENTRY(("    filetype:     %S\n", &(p)->u.file.filetype)); \
-                DBGENTRY(("    size:         %lu\n", (p)->u.file.size)); \
-                DBGENTRY(("    offset:       %lu\n", (p)->u.file.offset)); \
-                DBGENTRY(("    base_tree:    %u\n", (p)->u.file.has_tree)); \
-                DBGENTRY(("    archive:      %u\n", (p)->u.file.archive)); \
-                DBGENTRY(("    container:    %u\n", (p)->u.file.container));  }}}
-#else
-#define DBG_XTocEntry(p)
-#endif
-
-/* function for BSTreeInsert or BSTreeInsertUnique */
-static
-int CC XTocEntrySort (const BSTNode * item, const BSTNode * n)
-{
-    return StringCompare (&((const XTocEntry*)item)->name,
-                          &((const XTocEntry*)n)->name);
-}
-
-/* function for BSTreeFind */
-static
-int CC XTocEntryCmpString (const void * item, const BSTNode * n)
-{
-    return (int)StringCompare ((const String *)item, 
-                               &((const XTocEntry*)n)->name);
-}
-
-/* forward as we have a loop in calls */
-static
-void XTocTreeWhack (BSTNode * item, void * data);
-
-/*
- * XTocEntryDestroy
- *  object destructor
- *  It recursively destroys entries in its tree
- */
-static
-void XTocEntryDestroy (XTocEntry * self)
-{
-    if (self)
-    {
-        switch (self->type)
-        {
-        case xtoce_root:
-        case xtoce_dir:
-        case xtoce_file:
-            /* delete an entries below this one */
-            BSTreeWhack (&self->tree, XTocTreeWhack, NULL);
-            break;
-        case xtoce_link:
-        case xtoce_id:
-        default:
-            break;
-        }
-        free (self);
-    }
-}
-
-/* recursive destructor call for BSTreeWhack */
-static
-void XTocTreeWhack (BSTNode * item, void * data)
-{
-    XTocEntryDestroy ((XTocEntry*)item);
-}
-
-
-rc_t XTocEntryResolvePath (const XTocEntry * self, const char * path_, bool follow_link,
-                           XTocEntry ** pnode)
-{
-    rc_t rc = 0;
-    const char * path;
-    const char * limit;
-    XTocEntry * node;
-    size_t size;
-
-    assert (self);
-    assert (path_);
-    assert (pnode);
-#if 0
-    DBGENTRY (("%s: resolve %s from %p\n", __func__, path_, self));
-#endif
-    node = (XTocEntry *)self;
-#if 0
-    DBGENTRY(("%s: node starts at %s\n", __func__, node ? node->name.addr : "NULL"));
-#endif
-    path = path_;
-#if 0
-    /* this was causing a seg fault for some reason */
-    limit = path + string_size (path);
-#else
-    limit = path + string_measure(path, &size);
-#endif
-
-    do
-    {
-        String s;
-        char * slash;
-        size_t z;
-        BSTree * t;
-#if 0
-        DBGENTRY (("%s: path %s size %lu %p - %p = %lu\n", __func__, path, string_size(path), limit, path, limit-path));
-#endif
-        while (*path == '/')
-                ++path;
-
-        z = limit - path;
-        if (z == 0)
-            break;
-#if 0
-        DBGENTRY (("%s: path %s z %lu %p - %p = %lu\n", __func__, path, z, limit, path, limit-path));
-        DBG_XTocEntry(node);
-#endif
-        switch (node->type)
-        {
-        case xtoce_link:
-        {
-            XTocEntry * nnode;
-            rc = XTocEntryResolvePath (node, node->u.link.target.addr,
-                                       follow_link, &nnode);
-#if 0
-            DBGENTRY(("%s: node becomes %s\n", __func__, node ? node->name.addr : "NULL"));
-#endif
-            if (rc)
-                return rc;
-
-            node = nnode;
-            continue;
-        }
-        case xtoce_id:
-            /* this needed to be a leaf */
-            rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid);
-            LOGERR (klogErr, rc, "bad path resolving path by id in XML FS");
-            return rc;
-        default:
-            return RC (rcFS, rcDirectory, rcResolving, rcPath, rcIncorrect);
-
-        case xtoce_file:
-            if ( ! node->u.file.has_tree)
-            {
-                /* this needed to be a leaf */
-                rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid);
-                LOGERR (klogErr, rc, "bad path resolving path by name in XML FS");
-                return rc;
-            }
-            /* fall through */
-        case xtoce_root:
-        case xtoce_dir:
-            t = &node->tree;
-            break;
-        }
-        slash = string_chr (path, z, '/');
-        if (slash)
-            z = slash - path;
-
-        StringInit (&s, path, z, string_len (path, z));
-#if 0
-        DBGENTRY (("%s: as String %S\n", __func__, &s));
-#endif
-        node = (XTocEntry*)BSTreeFind (t, &s, XTocEntryCmpString);
-#if 0
-        DBGENTRY (("%s: node is now %p\n", __func__, node));
-#endif
-        if (node == NULL)
-            return RC (rcFS, rcDirectory, rcResolving, rcPath, rcNotFound);
-
-        path += StringSize (&s);
-#if 0
-        DBGENTRY (("%s: looping at %s %p %p\n", __func__, path, path, limit-1));
-#endif
-    } while (path < limit-1);
-
-    if (rc == 0)
-    {
-        if(path[0] == '\0')
-        {
-            switch (node->type)
-            {
-            case xtoce_id:
-                node = node->u.id.target;
-                if (node == NULL)
-                    rc = RC (rcFS, rcDirectory, rcResolving, rcLink, rcCorrupt);
-                break;
-            case xtoce_link:
-                if (follow_link)
-                    return XTocEntryResolvePath (node, path, follow_link, pnode);
-            default:
-                break;
-            }
-        }
-        *pnode = node;
-    }
-#if 1
-    DBGENTRY(("%s: %R\n",__func__, rc));
-#endif
-    return rc;
-}
-
-
-KPathType XTocEntryPathType (const XTocEntry * self, const char * path)
-{
-    rc_t rc;
-    KPathType type = 0;
-    XTocEntry * node;
-
-    rc = XTocEntryResolvePath (self, path, false, &node);
-    if ((rc == 0) && (node->type == xtoce_link))
-        type = kptAlias;
-
-    rc = XTocEntryResolvePath (self, path, true, &node);
-    if (rc)
-    {
-        if (GetRCState (rc) == rcNotFound)
-            return type | kptNotFound;
-        return type | kptBadPath;
-    }
-
-    switch (node->type)
-    {
-    default:
-    case xtoce_undefined:
-        return type | kptBadPath;
-
-    case xtoce_root:
-    case xtoce_dir:
-        return type | kptDir;
-
-    case xtoce_file:
-#if 0
-    /* archives and containers are files */
-        return type | kptFile;
-#else
-    /* archives and containers are directories */
-        return type | (node->u.file.has_tree) ? kptDir : kptFile;
-#endif
-        /* not sure how we'd get here */
-    case xtoce_link:
-        return type | kptBadPath;
-    }
-}
-
-
-/* ======================================================================
- * rc_t XTocTree
- *   This set of functions is the API for building up the entries within an 
- *   XToc.
- */
-
-/*
- * XTocEntryMakeInt
- *
- *  This function creates and initializes the common part of the
- *  XTocEntry
- *
- *  extra_alloc is space set aside for string space not initialized
- *              here.  target path in links for example
- */
-static
-rc_t XTocEntryMakeInt (XTocEntry ** pself, const char * name,
-                       XTocEntry * parent, XTocEntry * container,
-                       KTime_t mtime, size_t extra_alloc)
-{
-    XTocEntry * self;
-    char * pc;
-    size_t  z;
-    rc_t rc = 0;
-
-    assert ((container != NULL) || (strcmp(name,"/") == 0));
-    assert (name);
-    assert (pself);
-
-    z = string_size (name) + 1;
-
-    if (z <= 1)
-    {
-        rc = RC (rcFS, rcTocEntry, rcConstructing, rcName, rcTooShort);
-        LOGERR (klogErr, rc, "No name for directory entry in XML TOC");
-        return rc;
-    }
-
-    /* allocate the memory for the entry node.  
-     * size of the node, space for the name and extra space requested
-     * by the caller of this intermediate function
-     */
-    self = malloc (sizeof (*self) + z + extra_alloc);
-    DBGENTRY (("%s: entry %p name %s\n",__func__,self,name));
-    if (self == NULL)
-        rc = RC (rcFS, rcToc, rcConstructing, rcMemory, rcExhausted);
-
-    else
-    {
-        /* copy the name immediately after the common section */
-        pc = (char*)(self+1);
-        string_copy (pc, z, name, z);
-        z --;
-        StringInit (&self->name, pc, z, string_len (pc, z));
-
-        self->container = container;
-        self->parent = parent;
-        self->root = container == NULL ? container : container->root;
-        self->cache = NULL;
-        self->mtime = mtime;
-        BSTreeInit (&self->tree);
-        if (parent)
-            rc = BSTreeInsert (&parent->tree, &self->node, XTocEntrySort);
-        if (rc == 0)
-        {
-            *pself = self;
-            return 0;
-        }
-        XTocEntryDestroy (self);
-    }
-    return rc;
-}
-
-static
-rc_t XTocTreeAddID (XTocEntry * self, const char * name, KTime_t mtime, 
-                    XTocEntry * target)
-{
-    XTocEntry * entry;
-    rc_t rc;
-
-    DBGENTRY(("%s: self %p name %s target %p\n", __func__, self, name, target));
-    rc = XTocEntryMakeInt (&entry, name, self, self, mtime, 0);
-    if (rc == 0)
-    {
-        entry->u.id.target = target;
-        entry->type = xtoce_id;
-        DBG_XTocEntry (entry);
-    }
-    return rc;
-}
-
-
-rc_t XTocTreeAddDir (XTocEntry * self, XTocEntry ** pentry, XTocEntry * container,
-                           const char * name, KTime_t mtime)
-{
-    rc_t rc = XTocEntryMakeInt (pentry, name, self, container, mtime, 0);
-    if (rc == 0)
-    {
-        (*pentry)->type = xtoce_dir;
-        DBG_XTocEntry (*pentry);
-    }
-    return rc;
-}
-
-
-rc_t XTocTreeAddSymlink   (XTocEntry * self, XTocEntry ** pentry, XTocEntry * container,
-                           const char * name, KTime_t mtime, const char * target)
-{
-    XTocEntry * entry;
-    size_t z = string_size (target) + 1;
-    rc_t rc = XTocEntryMakeInt (&entry, name, self, container, mtime, z);
-
-    if (rc == 0)
-    {
-        char * pc = (char *)entry->name.addr + entry->name.size + 1;
-        string_copy (pc, z, target, z);
-        z--;
-        StringInit (&entry->u.link.target, pc, z, string_len (pc, z));
-        entry->type = xtoce_link;
-        DBG_XTocEntry (entry);
-    }
-    *pentry = entry;
-    return rc;
-}
-
-
-rc_t XTocTreeAddFile      (XTocEntry * self, XTocEntry ** pentry,
-                           XTocEntry * container, const char * name,
-                           KTime_t mtime, const char * id,
-                           const char * filetype, uint64_t size,
-                           uint64_t offset, uint8_t md5 [16])
-{
-    XTocEntry * entry;
-    size_t z;
-    rc_t rc;
-
-    DBGENTRY (("%s: name %s id %s filetype %s\n", __func__, name, id, filetype));
-
-    z = string_size (filetype) + 1;
-    rc = XTocEntryMakeInt (&entry, name, self, container, mtime, z);
-    if (rc == 0)
-    {
-        char * pc;
-
-        pc = (char*)entry->name.addr + entry->name.size + 1;
-        string_copy (pc, z, filetype, z);
-        z--;
-
-        StringInit (&entry->u.file.filetype, pc, z, string_len (pc, z));
-        entry->u.file.size = size;
-        entry->u.file.offset = offset;
-        memcpy (entry->u.file.md5, md5, sizeof entry->u.file.md5);
-        entry->u.file.has_tree = false;
-        entry->u.file.archive = false;
-        entry->u.file.container = false;
-        entry->type = xtoce_file;
-
-        DBGENTRY (("%s: entry %p entry->root %p id %s\n",
-                   __func__, entry, id, entry->root));
-        rc = XTocTreeAddID (entry->root, id, mtime, entry);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "failed to create alias id - continuing");
-            rc = 0;
-        }
-        DBG_XTocEntry (entry);
-    }
-    *pentry = entry;
-    return rc;
-}
-
-
-rc_t XTocTreeAddContainer (XTocEntry * self, XTocEntry ** pentry,
-                           XTocEntry * container, const char * name,
-                           KTime_t mtime, const char * id,
-                           const char * filetype, uint64_t size,
-                           uint64_t offset, uint8_t md5 [16])
-{
-    rc_t rc = XTocTreeAddFile (self, pentry, container, name, mtime, id, 
-                               filetype, size, offset, md5);
-    if (rc == 0)
-    {
-        (*pentry)->u.file.has_tree = true;
-        (*pentry)->u.file.container = true;
-        DBG_XTocEntry ((*pentry));
-    }
-    return rc;
-}
-
-
-rc_t XTocTreeAddArchive (XTocEntry * self, XTocEntry ** pentry,
-                         XTocEntry * container, const char * name,
-                         KTime_t mtime, const char * id,
-                         const char * filetype, uint64_t size,
-                         uint64_t offset, uint8_t md5 [16])
-{
-    rc_t rc = XTocTreeAddFile (self, pentry, container, name, mtime, id, 
-                               filetype, size, offset, md5);
-    if (rc == 0)
-    {
-        (*pentry)->u.file.has_tree = true;
-        (*pentry)->u.file.archive = true;
-        DBG_XTocEntry ((*pentry));
-    }
-    return rc;
-}
-
-
-/* ======================================================================
- * XTocCache
- *
- * When an entry in the TOC is opened as either a file or a directory
- * it is recorded in the tree indexed by path.  The objects in that
- * tree are of tupe XTocCache
- */
-struct XTocCache
-{
-    BSTNode node;
-    KRefcount refcount;
-    String path;
-    XToc * toc;                 /* ref counted keep daddy alive */
-
-    /* these three references are not reference counted */
-    XTocEntry * entry;
-
-    /* these references are back pointers for "re-opens" */
-    const KXTocFile * file;
-    const KXTocDir * dir;
-};
-static const char XTocCacheClassname[] = "XTocCache";
-
-#if _DEBUGGING
-#define DBG_XTocCache(p)                                                \
-    {   DBGCACHE(("XTocCache: %p\n", (p)));                             \
-        if (p) {                                                        \
-            DBGCACHE(("    refcount: %u\n",*(unsigned*)&(p)->refcount)); \
-            DBGCACHE(("    path:     %S\n",&(p)->path));                \
-            DBGCACHE(("    toc:      %p\n",(p)->toc));                  \
-            DBGCACHE(("    entry:    %p\n",(p)->entry));                \
-            DBGCACHE(("    file:     %p\n",(p)->file));                 \
-            DBGCACHE(("    dir:      %p\n",(p)->dir));                  \
-            if ((p)->file) DBG_KXTocDir((p)->file);                     \
-            if ((p)->dir) DBG_KXTocDir((p)->dir); }}
-#else
-#define DBG_XTocCache(p)
-#endif
-
-/* Sort
- *   A sort comparitor suitable for BSTreeInsert/NSTreInsertUnique
- */
-static
-int CC XTocCacheSort (const BSTNode * item, const BSTNode * n)
-{
-    return StringCompare (&((const XTocCache*)item)->path,
-                          &((const XTocCache*)n)->path);
-}
-
-
-/* 
- * Cmp
- *   A sort comparitor suitable for BSTreeFind
- */
-static
-int CC XTocCacheCmp (const void * item, const BSTNode * n)
-{
-    const String * s = item;
-    const XTocCache * node = (const XTocCache *)n;
-    return StringCompare (s, &node->path);
-}
-
-
-/* 
- * Destroy
- */
-static void XTocCacheDestroy (XTocCache * self);
-
-
-/*
- * AddRef
- */
-static
-rc_t XTocCacheAddRef (const XTocCache * self)
-{
-    assert (self);
-    switch (KRefcountAdd (&self->refcount, XTocCacheClassname))
-    {
-    case krefLimit:
-        return RC (rcFS, rcToc, rcAttaching, rcRange, rcExcessive);
-    }
-    return 0;
-}
-
-
-/*
- * Release
- */
-static
-rc_t XTocCacheRelease (const XTocCache * cself)
-{
-    if (cself)
-    {
-        XTocCache * self = (XTocCache*)cself;
-        switch (KRefcountDrop (&self->refcount, XTocCacheClassname))
-        {
-        case krefWhack:
-            XTocCacheDestroy (self);
-        }
-    }
-    return 0;    
-}
-
-
-/*
- * Make
- *
- * This creates the node with one reference.  The file or directory
- * are not opened by this, nor are they initialized to non-NULL.
- */
-static
-rc_t XTocCacheMake (XTocCache ** pself, String * path,
-                         XToc * toc, XTocEntry * entry)
-{
-    XTocCache * self;
-    char * pc;
-    rc_t rc;
-
-    assert (pself);
-    assert (path);
-    assert (entry);
-
-    *pself = NULL;
-
-    rc = XTocAddRef (toc);
-    if (rc)
-        return rc;
-
-    self = calloc (sizeof (*self) + 1 + StringSize (path), 1);
-    if (self == NULL)
-        return RC (rcFS, rcTocEntry, rcConstructing, rcMemory, rcExhausted);
-
-
-    KRefcountInit (&self->refcount, 1,  XTocCacheClassname, "Init",
-                   path->addr);
-
-    self->entry = entry;
-    self->toc = toc;
-
-    pc = (char *)(self + 1);
-    string_copy (pc, StringSize (path), path->addr, StringSize (path));
-    StringInit (&self->path, pc, StringSize(path), StringLength(path));
-    *pself = self;
-    return 0;
-}
-
-
-/* ======================================================================
- * XToc
- */
-
-/* ----------------------------------------------------------------------
- * XToc
- *   The flagshop class for this is a very simple class.  It has no use 
- *   outside of NCBI at this point.
- *
- *   It maintains in debugging situations the path for the object that
- *   was opened upon creation.
- *
- *   It maintains the directory like entries created by copycat when it
- *    cataloged a submission.
- *
- *   It maintains a list of what fiels and directories within that catalog
- *   are currently open.  A request to open it again will end up just reusing
- *   the same KFile/KDirectory
- */
-
-struct XToc
-{
-    String base_path;
-    KRefcount refcount;
-    XTocEntry * root;   /* binary search tree full objects of type XTocEntry */
-    BSTree open;        /* opened entries stored in an XTocCache */
-    XTocCache * cache;  /* shortcut to "/" cache entry - not ref counted */
-};
-static char XTocClassname[] = "XToc";
-
-#if _DEBUGGING
-#define DBG_XToc(p) \
-    {   DBGTOC(("XToc: %p\n", (p))); \
-        if (p) {                                                        \
-            DBGTOC(("    base_path: %S\n", &(p)->base_path));           \
-            DBGTOC(("    refcount:  %u\n", *(unsigned*)&(p)->refcount)); \
-            DBGTOC(("    root       %p\n", (p)->root));                 \
-            DBGTOC(("    open       %p\n", *(void**)&(p)->open)); \
-            DBGTOC(("    cache      %p\n", (p)->cache)); \
-            if((p)->root) DBG_XTocEntry((p)->root); \
-            if((p)->cache) DBGXTocCache((p)->cache); }}
-#else
-#define DBG_XToc(p)
-#endif
-
-static
-rc_t XTocDestroy (XToc * self)
-{
-    XTocEntryDestroy (self->root);
-    /* the open tree will be empty for us to get here */
-    free (self);
-    return 0;
-}
-
-
-static
-rc_t XTocAddRef (const XToc * self)
-{
-    if (self)
-        switch (KRefcountAdd (&self->refcount, XTocClassname))
-        {
-        case krefLimit:
-            return RC (rcFS, rcToc, rcAttaching, rcRange, rcExcessive);
-        }
-    return 0;
-}
-
-
-static
-rc_t XTocRelease (const XToc * cself)
-{
-    if (cself)
-    {
-        XToc * self = (XToc*)cself;
-        switch (KRefcountDrop (&self->refcount, XTocClassname))
-        {
-        case krefWhack:
-            XTocDestroy (self);
-        }
-    }
-    return 0;    
-}
-
-
-static
-void XTocCacheDestroy (XTocCache * self)
-{
-    assert (self);
-    BSTreeUnlink (&self->toc->open, &self->node);
-    self->entry->cache = NULL;
-    XTocRelease (self->toc);
-    free (self);
-}
-
-
-static
-rc_t XTocMake (XToc ** pself, const String * base_path)
-{
-    XToc * self;
-    char * pc;
-    rc_t rc;
-
-    assert (pself);
-    assert (base_path);
-
-    self = malloc (sizeof (*self) + StringSize(base_path) + 1);
-    if (self == NULL)
-        return RC (rcFS, rcToc, rcConstructing, rcMemory, rcExhausted);
-
-    pc = (char*)(self+1);
-    memcpy (pc, base_path->addr, StringSize(base_path));
-    pc[StringSize(base_path)] = '\0';
-    StringInit (&self->base_path, pc, StringSize(base_path),
-                StringLength(base_path));
-
-    KRefcountInit (&self->refcount, 1, XTocClassname, "Init", base_path->addr);
-
-    rc = XTocEntryMakeInt (&self->root, "/", NULL, NULL,
-                           (KTime_t)time(NULL), 0);
-    if (rc)
-    {
-        free (self);
-        return rc;
-    }
-    self->root->type = xtoce_root;
-    self->root->container = self->root->root = self->root;
-    
-    BSTreeInit (&self->open);
-
-    *pself = self;
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * KXTocFile
- *  
- *
- * This type exists only to keep the XToc Open
- */
-struct KXTocFile
-{
-    KFile dad;
-    const KFile * base;
-    XTocCache * cache;
-    XTocEntry * entry;
-    String base_path;
-};
-#if _DEBUGGING
-#define DBG_KXTocFile(p)                             \
-    {   DBGTOC(("  KXTocFile: %p\n", (p)));                               \
-        if (p) {                                                        \
-            DBGTOC(("    dad.vt:            %p\n", (p)->dad.vt));           \
-            DBGTOC(("    dad.file:          %p\n",(p)->dad.dir));           \
-            DBGTOC(("    dad.refcount:      %u\n",*(unsigned*)&(p)->dad.refcount)); \
-            DBGTOC(("    dad.read_enabled:  %u\n",*(unsigned*)&(p)->dad.read_enabled)); \
-            DBGTOC(("    dad.write_enabled: %u\n",*(unsigned*)&(p)->dad.write_enabled)); \
-            DBGTOC(("    base:              %p\n",(p)->base));              \
-            DBGTOC(("    cache:             %p\n",(p)->cache));             \
-            DBGTOC(("    entry:             %p\n",(p)->entry));             \
-            DBGTOC(("    base_path:         %S\n",&(p)->base_path));        \
-            if ((p)->base){                                             \
-                DBGTOC(("      base->vt:            %p\n", (p)->base->vt));       \
-                DBGTOC(("      base->file:          %p\n",(p)->base->dir));       \
-                DBGTOC(("      base->refcount:      %u\n",*(unsigned*)&(p)->base->refcount)); \
-                DBGTOC(("      base->read_enabled:  %u\n",*(unsigned*)&(p)->base->read_enabled)); \
-                DBGTOC(("      base->write_enabled: %u\n",*(unsigned*)&(p)->base->write_enabled)); \
-            }}}
-#else
-#define DBG_KXTocFile(p)
-#endif
-
-/* Destroy
- */
-static
-rc_t KXTocFileDestroy ( KXTocFile *self )
-{
-    assert (self);
-    KFileRelease (self->base);
-    XTocCacheRelease (self->cache);
-    self->cache->file = NULL;
-    free (self);
-    return 0;
-}
-
-/* GetSysFile
- *  returns an underlying system file object
- *  and starting offset to contiguous region
- *  suitable for memory mapping, or NULL if
- *  no such file is available.
- */
-static
-struct KSysFile *KXTocFileGetSysFile ( const KXTocFile *self, uint64_t *offset )
-{
-#if 1
-    return NULL;
-#else
-    struct KSysfile * sf;
-    uint64_t loffset;
-
-    assert (self);
-    assert (offset);
-
-    sf = KFileGetSysFile (self->base, &loffset);
-    if (sf)
-        *offset = 0;
-    else
-        *offset = loffset + self->entry->u.file.offset;
-    return sf;
-#endif
-}
-
-/* RandomAccess
- *  ALMOST by definition, the file is random access
- *  certain file types ( notably compressors ) will refuse random access
- *
- *  returns 0 if random access, error code otherwise
- */
-static
-rc_t KXTocFileRandomAccess ( const KXTocFile *self )
-{
-    assert (self);
-    return KFileRandomAccess (self->base);
-}
-
-
-/* Type
- *  returns a KFileDesc
- *  not intended to be a content type,
- *  but rather an implementation class
- */
-static
-uint32_t KXTocFileType ( const KXTocFile *self )
-{
-    assert (self);
-    return KFileType (self->base);
-}
-
-
-/* Size
- *  returns size in bytes of file
- *
- *  "size" [ OUT ] - return parameter for file size
- */
-static
-rc_t KXTocFileSize ( const KXTocFile *self, uint64_t *size )
-{
-    assert (self);
-    assert (size);
-    *size = self->entry->u.file.size;
-    return 0;
-}
-
-
-/* SetSize
- *  sets size in bytes of file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t KXTocFileSetSize ( KXTocFile *self, uint64_t size )
-{
-    return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-/* Read
- *  read file from known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - return buffer for read
- *
- *  "num_read" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually read
- */
-static
-rc_t CC KXTocFileRead ( const KXTocFile *self, uint64_t pos,
-    void *buffer, size_t bsize, size_t *num_read )
-{
-    uint64_t size;
-    uint64_t limit;
-
-    assert (self);
-    assert (buffer);
-    assert (num_read);
-
-    DBG_XTocEntry(self->entry);
-
-    size = self->entry->u.file.size;    /* how big is our portion of the file */
-    if(pos >= size)  {                  /* if past end of file we're done */
-        *num_read = 0;
-        return 0;
-    }
-    limit = pos + bsize;                /* requested limit */
-    if(limit > size) {                  /* if beyond end of file trim it down */
-        limit = size;
-    }
-    return KFileRead (self->base, pos + self->entry->u.file.offset, buffer,
-                      limit - pos, num_read);
-}
-
-
-/* Write
- *  write file at known position
- *
- *  "pos" [ IN ] - starting position within file
- *
- *  "buffer" [ IN ] and "size" [ IN ] - data to be written
- *
- *  "num_writ" [ OUT, NULL OKAY ] - optional return parameter
- *  giving number of bytes actually written
- */
-static
-rc_t KXTocFileWrite ( KXTocFile *self, uint64_t pos,
-    const void *buffer, size_t size, size_t *num_writ)
-{
-    return RC (rcFS, rcFile, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-/* Make
- *  create a new file object
- *  from file descriptor
- */
-static KFile_vt_v1 vtKXTocFile =
-{
-    /* version 1.1 */
-    1, 1,
-
-    /* start minor version 0 methods */
-    KXTocFileDestroy,
-    KXTocFileGetSysFile,
-    KXTocFileRandomAccess,
-    KXTocFileSize,
-    KXTocFileSetSize,
-    KXTocFileRead,
-    KXTocFileWrite,
-    /* end minor version 0 methods */
-
-    /* start minor version == 1 */
-    KXTocFileType
-    /* end minor version == 1 */
-};
-
-
-static
- rc_t KXTocFileMake (KXTocFile **pself, const KFile * base,
-                     XTocCache * cache, XTocEntry * entry,
-                     const String *path)
-{
-    KXTocFile * self;
-    rc_t rc;
-
-    assert (pself);
-    assert (base);
-    assert (cache);
-    assert (path);
-
-    self = malloc (sizeof (*self) + 1 + StringSize (path));
-    if (self == NULL)
-        rc = RC (rcFS, rcFile, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        rc = KFileInit (&self->dad, (const KFile_vt*)&vtKXTocFile, "KXTocFile", "no-name", true, false);
-        if (rc == 0)
-        {
-            rc = KFileAddRef (base);
-            if (rc == 0)
-            {
-                rc = XTocCacheAddRef (cache);
-                if (rc == 0)
-                {
-                    char * pc;
-
-                    pc = (char*)(self+1);
-                    string_copy (pc, StringSize(path), path->addr, StringSize(path));
-                    pc[StringSize(path)] = '\0';
-                    StringInit (&self->base_path, pc, StringSize (path),
-                                StringLength (path));
-                    self->base = base;
-                    self->entry = entry;
-                    self->cache = cache;
-
-                    cache -> file = self;
-
-                    * pself = self;
-                    return 0;
-                }
-
-                KFileRelease ( base );
-            }
-        }
-
-        free ( self );
-    }
-
-    PLOGERR (klogErr, 
-             (klogErr, rc,
-              "Unable to make/open $(F)",
-              "F=%S", path));
-
-    *pself = NULL;
-    return rc;
-}
-
-
-struct KXTocDir
-{
-    KDirectory dad;
-    const KDirectory * base;
-    XToc * toc;
-    XTocCache * cache;    /* owns a reference */
-    XTocEntry * entry;
-    XTocEntry * container;
-    XTocEntry * root;
-    String      base_path;
-};
-
-#if _DEBUGGING
-#define DBG_KXTocDir(p)                                                 \
-    {   if (p)                                                          \
-            DBGTOC(("KXTocDir -   %p\n"                                 \
-                    "   base_path %S\n"                                 \
-                    "   base      %p\n"                                 \
-                    "   cache     %p\n"                                 \
-                    "   entry     %p\n"                                 \
-                    "   container %p\n"                                 \
-                    "   root      %p\n",                                \
-                    p, &p->base_path, p->base, p->cache,                \
-                    p->entry, p->container, p->root));                  \
-        else DBGTOC(("KXTocDir @ NULL\n")); }
-#else
-#define DBG_KXTocDir(p)
-#endif
-/*--------------------------------------------------------------------------
- * XTocListing
- *  a directory listing
- *
- * NOTE:
- * This is nearly identical to KSysDirListing but both are currently private to
- * their compilation units.
- */
-struct XTocListing
-{
-    KNamelist dad;      /* base class */
-    Vector    list;
-    XTocEntry * entry;
-};
-
-
-
-/* ======================================================================
- * shared path routines that really should be their own class
- */
-/* ----------------------------------------------------------------------
- * KXTocDirCanonPath
- *
- * In this context CanonPath means to make the path a pure /x/y/z with no back tracking 
- * by using ~/../~ or redundant ~/./~ or ~//~ here notations.  Not exactly the usage of 
- * canonical in describing a path in other places but consistent within KFS.  It matches
- * the common meaning of canonical path as the one true path except that processing out
- * of sym links isn't done here but would normally have been.  Not processing the 
- * links means potentially more than one canonical path can reach the same target 
- * violating the usual meaning of canonical path as the one true shortest path to any
- * element.
- *
- * const KXTocDir *		self		Object oriented C; KXTocDir object for this method
- * enum RCContext 		ctx
- * char * 			path
- * size_t			psize
- */
-static
-rc_t XTocPathCanonize (char * path, size_t psize)
-{
-    char *	low;	/* a pointer to the root location in path; not changed after initialization */
-    char *	dst;	/* a target reference for compressing a path to remove . and .. references */
-    char *	last;	/* the end of the last processed facet of the path */
-    char *	end;	/* absolute end of the incoming path */
-    char * 	src;	/* the start of the current facet to be processed */
-
-    /* end is the character after the end of the incoming path */
-    end = path + psize;
-
-    /* point all other temp pointers at the root point in the incoming path */
-    last = path;
-
-    /* handle windows / / network path starter */
-    if ((last == path) && (last[0] == '/') && (last[1] == '/'))
-      last ++;
-
-    low = dst = last;
-
-    for (;;)
-    {
-
-	/* point at the first / after the most recent processed facet */
-	src = string_chr (last + 1, end-last-1, '/');
-	if (src == NULL)	/* if no '/' point to the end */
-	    src = end;
-
-	/* detect special sequences */
-	switch (src - last)
-	{
-	case 1: /* / / (with nothing between) is a superflouous / hurting us to parse later;
-		 * /. is a here reference to the same directory as the previous */
-	    if ((last[1] == '/')||(last[1] == '.'))
-	    {
-		/* skip over */
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-	case 2: /* /./ is a "here" reference point and is omitted by not copying it over */
-	    if (last[1] == '.')
-	    {
-		/* skip over */
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-
-	case 3: /* /../ is a up one directory and is processed by deleting the last facet copied */
-	    if (last [1] == '.' && last [2] == '.')
-	    {
-		/* remove previous leaf in path */
-		dst [ 0 ] = 0;
-		dst = string_rchr (path, end-path, '/');
-		/* can't up a directory past the root */
-		if (dst == NULL || dst < low)
-		{
-		    return RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid);
-		}
-
-		last = src;
-		if (src != end)
-		    continue;
-	    }
-	    break;
-	}
-
-	/* if rewriting, copy leaf */
-	if (dst != last)
-	{
-	    memmove (dst, last, src - last);
-	}
-
-	/* move destination ahead */
-	dst += src - last;
-        
-	/* if we're done, go */
-	if (src == end)
-	    break;
-
-	/* find next separator */
-	last = src;
-    }
-
-    /* NUL terminate if modified */
-    if (dst != end)
-	* dst = 0;
-
-    /* say we did did it with no problems */
-    return 0;
-}
-
-
-rc_t XTocMakePath (const char ** ppath, bool canon, const char * path, va_list args)
-{
-    char * b;
-    size_t bz;  /* size to allocate */
-    rc_t rc = 0;
-    bool   use_printf;
-
-    assert (ppath);
-    assert (path);
-#if 0
-    DBGTOC(("%s: make path from %s\n", __func__, path));
-#endif
-    b = NULL;
-    bz = string_size (path) + 1;  /* start assuming out is same size as in */
-
-    use_printf = (string_chr (path, bz, '%') != NULL);
-    if (use_printf)
-    {
-        char shortbuff [32];
-        int  pz = vsnprintf (shortbuff, sizeof shortbuff, path, args);
-        if (pz < 0)
-        {
-            rc = RC (rcFS, rcDirectory, rcFormatting, rcPath, rcInvalid);
-            DBGTOC(("%s: invalid path %s\n", __func__, path));
-            LOGERR(klogErr, rc, "Error building XTOC path");
-            return rc;
-        }
-        bz = pz + 1;
-    }
-
-    b = malloc (bz);
-    if (b == NULL)
-        return RC (rcFS, rcDirectory, rcFormatting, rcMemory, rcExhausted);
-
-    if (use_printf)
-    {
-        int pz = vsnprintf (b, bz, path, args);
-        if (pz < 0)
-            rc = RC (rcFS, rcDirectory, rcFormatting, rcPath, rcInvalid);
-        else
-            b[pz] = '\0';
-    }
-    else
-        string_copy (b, bz, path, bz);
-
-    if ((rc == 0) && canon)
-        rc = XTocPathCanonize (b, bz);
-
-    if (rc == 0)
-        *ppath = b;
-    else
-        free (b);
-    return 0;
-}
-
-static char * XTocEntryMakeFullPathRecur (XTocEntry * self, size_t also, 
-                                          char ** phere)
-{
-    char * path;
-    char * here;
-
-    assert (self);
-
-#if 0
-    DBGENTRY(("%s: self %p also %lu  %p\n",__func__,self,also,phere));
-    DBG_XTocEntry(self);
-#endif
-    if (self->type == xtoce_root)
-    {
-        *phere = NULL;
-        path = malloc (2 + also);
-        if (path != NULL)
-        {
-            path[0] = '/';
-            path[1] = '\0';
-            *phere = path;
-        }
-#if 0
-        DBGENTRY (("%s: path %s %p %p\n", __func__, path, path, *phere));
-#endif
-    }
-    else
-    {
-        path = XTocEntryMakeFullPathRecur (self->parent,
-                                           also + 1 + StringSize (&self->name),
-                                           &here);
-        if (path == NULL)
-        {
-            *phere = NULL;
-            return NULL;
-        }
-#if 0
-        DBGENTRY (("%s: path '%s' %p '%s' %p\n",__func__, path, path, here, here));
-#endif
-        here[0] = '/';
-        string_copy (here+1, StringSize (&self->name) + 1,
-                     self->name.addr, StringSize (&self->name));
-        *phere = here + 1 + StringSize (&self->name);
-    }
-    return path;
-}
-
-static
-rc_t XTocEntryMakeFullPath (XTocEntry * self, const char ** pfull)
-{
-    char * ignored;
-    char * full_path;
-#if 0
-    DBGENTRY(("%s: self %p pfull %p\n",__func__,self,pfull));
-#endif
-    assert (pfull);
-    *pfull = NULL;
-    full_path = XTocEntryMakeFullPathRecur (self, 0, &ignored);
-    if (full_path == NULL)
-        return RC (rcFS, rcPath, rcCreating, rcMemory, rcExhausted);
-    *pfull = full_path;
-    return 0;
-}
-
-
-
-/* ======================================================================
- */
-/* ----------------------------------------------------------------------
- * XTocListingDestroy
- * Class destructor
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT] XTocListing *	self		Listing self reference: object oriented in C
- */
-static
-rc_t CC XTocListingDestroy (XTocListing *self)
-{
-    VectorWhack (&self->list, NULL, NULL);
-    free (self);
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * XTocListingCount
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const XTocListing *	self		Listing self reference: object oriented in C
- * [OUT] uint32_t *		count		Where to put the count of names
- */
-static rc_t CC XTocListingCount (const XTocListing *self, uint32_t *count)
-{
-    *count = VectorLength (&self->list);
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * XTocListingGet
- *
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]  const XTocListing *	self		Listing self reference: object oriented in C
- * [IN]  uint32_t		idx		?
- * [OUT] const char **		name		Where to put the name
- */
-static rc_t CC XTocListingGet (const XTocListing *self, uint32_t idx, const char **name)
-{
-    uint32_t count;
-    rc_t rc;
-
-    rc = XTocListingCount(self, &count);
-    if (rc == 0)
-    {
-        if (idx >= count)
-            return RC (rcFS, rcNamelist, rcAccessing, rcParam, rcExcessive);
-        *name = VectorGet (&self->list, idx);
-    }
-    return 0;
-}
-
-
-/* ----------------------------------------------------------------------
- * XTocListingSort
- *
- * This function has the signature needed to use with the NameList base class for
- * XTocListings to determine the order of two names.  Matches the signature of
- * strcmp() and other functions suitable for use by qsort() and others
- *
- * [RET] int					0:  if a == b 
- *						<0: if a < b
- *						>0: if a > b
- * [IN] const void *		a
- * [IN] const void *		b
- *
- * Elements are typed as const void * to match the signature needed for 
- * a call to qsort() but they should be pointers to namelist elements
- */
-#if NOT_YET
-static int CC XTocListingSort (const void *a, const void *b, void * ignored)
-{
-    return strcmp (*(const char**)a, *(const char**)b);
-}
-#endif
-static KNamelist_vt_v1 vtXTocListing =
-{
-    /* version 1.0 */
-    1, 0,
-
-    /* start minor version 0 methods */
-    XTocListingDestroy,
-    XTocListingCount,
-    XTocListingGet
-    /* end minor version 0 methods */
-};
-
-
-/* ----------------------------------------------------------------------
- * XTocListingInit
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [INOUT] XTocListing *	self		Listing self reference: object oriented in C
- * [IN]    const char *		path		?
- * [IN]    const KDirectory *	dir		?
- * [IN]    bool (* 		f	)(const KDirectory*, const char*, void*),
- *						This is a filter function - any listing element
- *						passed to this function will generate a true ot
- *						a false.  If false that listing element is dropped.
- *						If this parameter is NULL all elements are kept.
- * [IN]	   void *		data		Ignored.  May use NULL if permitted
- *						by 'f'.
- */
-struct XTocListingInitData
-{
-    Vector * v;
-    rc_t rc;
-};
-static
-void CC XTocListingAdd (BSTNode * n_, void * data_)
-{
-    struct XTocListingInitData * data = data_;
-    const XTocEntry * n = (const XTocEntry *)n_;
-
-    if (data->rc == 0)
-    {
-        data->rc = VectorAppend (data->v, NULL, n->name.addr);
-    }
-}
-
-
-rc_t XTocListingMake (XTocListing ** pself, XTocEntry * entry,
-                      bool (CC* f) (const KDirectory*, const char*, void*),
-                      void *data)
-{
-    XTocListing * self;
-    BSTree * tree;
-    rc_t rc;
-
-    /* is self parameter possibly NULL? */
-    if (pself == NULL)
-    {
-	return  RC (rcFS, rcDirectory, rcConstructing, rcSelf, rcNull);
-    }
-    *pself = NULL;
-
-    self = malloc (sizeof (*self));
-    if (self == NULL)
-        return RC (rcFS, rcListing, rcConstructing, rcMemory, rcExhausted);
-
-    switch (entry->type)
-    {
-    default:
-        return RC (rcFS, rcDirectory, rcConstructing, rcListing, rcIncorrect);
-
-    case xtoce_file:
-    case xtoce_dir:
-        tree = &entry->tree;
-        break;
-    }
-
-    /* start with an empty name list */
-    VectorInit (&self->list, 0, 16);
-
-    /* initialize the Namelist base class */
-    if ((rc = KNamelistInit (& self -> dad,
-			     (const KNamelist_vt*)&vtXTocListing)) == 0)
-    {
-        struct XTocListingInitData data;
-
-        data.v = &self->list;
-        data.rc = 0;
-
-        BSTreeForEach (tree, false, XTocListingAdd, &data);
-
-        rc = data.rc;
-    }
-    if (rc == 0)
-        *pself = self;
-    return rc;
-}
-
-
-static
-rc_t XTocFindXTocCache (XToc * self, XTocCache ** pcache,
-                        const String * spath)
-{
-    XTocCache * cache;
-    assert (self);
-    assert (pcache);
-    assert (spath);
-
-    DBGTOC(("%s: self %p pcache %p spath %S\n",__func__,self,pcache,spath));
-    cache = (XTocCache*)BSTreeFind (&self->open, spath, XTocCacheCmp);
-    DBGTOC(("%s: found cache %p\n",__func__,cache));
-    *pcache = cache;
-    return cache ? 0 : RC (rcFS, rcToc, rcSearching, rcNode, rcNotFound);
-}
-
-
-static
-rc_t XTocMakeXTocCache (XToc * self, XTocCache ** pcache,
-                        String * path, XTocEntry * entry)
-{
-    XTocCache * cache;
-    rc_t rc;
-
-    assert (self);
-    assert (pcache);
-    assert (path);
-
-/*     DBGTOC(("%s: %S\n",path)); */
-    *pcache = NULL;
-    rc = XTocCacheMake (&cache, path, self, entry);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "error creating cache entry for $(P)",
-                  "P=%S", path));
-    else
-    {
-        union
-        {
-            BSTNode * b;
-            XTocCache * x;
-        } exist;
-        DBGTOC(("%s: insert cache\n",__func__));
-        rc = BSTreeInsertUnique (&self->open, &cache->node, &exist.b, XTocCacheSort);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "error inserting cache entry for $(P)",
-                      "P=%S", path));
-        else
-        {
-            *pcache = entry->cache = cache;
-            return 0;
-        }
-        XTocCacheDestroy (cache);
-    }
-    return rc;
-}
-
-
-static
-rc_t XTocDirGetCache (const KXTocDir * self, const char * path_, XTocCache ** pcache)
-{
-    const char * path;  /* absolute canonical path in ASCIZ */
-    String spath;       /* absolute canonical path as a String */
-    XTocEntry * entry;  /* toc entry for the path */
-    XTocCache * cache;  /* cache entry for the path */
-    rc_t rc;
-
-    assert (self);
-    assert (path_);
-    assert (pcache);
-
-    DBGCACHE(("%s: Get cache node for %s\n", __func__, path_));
-
-    /* assume not found or errors */
-    *pcache = NULL;
-
-    /* first resolve the path to an entry node */
-    rc = XTocEntryResolvePath (self->entry, path_, true, &entry);
-    DBGCACHE (("%s: path resolved\n",__func__));
-    if (rc)
-    {
-        PLOGERR (klogErr, 
-                 (klogErr, rc, "Unable to resolve path $(P)",
-                  "P=%s", path_));
-        return rc;
-    }
-
-    DBGCACHE(("%s: entry  %p\n",__func__,entry));
-
-    /* now create a actual canonical path from the root to the located entry
-     * the incoming path could have had symbolic links or the like so we're
-     * making it a single non-ambiguous version
-     */
-    rc = XTocEntryMakeFullPath (entry, &path);
-    if (rc)
-    {
-        PLOGERR (klogErr, 
-                 (klogErr, rc, "Unable to build full path for $(P)",
-                  "P=%s", path_));
-        return rc;
-    }
-
-    /* make a String version as that is what the cache holds */
-    StringInitCString (&spath, path);
-    DBGCACHE(("%s: made full path %S %s\n",__func__,&spath,path));
-
-    /* see if it's already open */
-
-    rc = XTocFindXTocCache (self->toc, &cache, &spath);
-    if (rc == 0)
-    {
-        DBGCACHE(("%s: found an existing cache node for %S\n",__func__,&spath));
-        XTocCacheAddRef (cache);
-    }
-    else
-    {
-        DBGCACHE(("%s: did not find an existing cache node for %S\n",__func__,&spath));
-        /* not found is not an error condition */
-        if (GetRCState(rc) == rcNotFound)
-        {
-            /* not found so make one */
-            rc = XTocMakeXTocCache (self->toc, &cache, &spath, entry);
-            DBGCACHE(("%s: made a cache node %p\n",__func__,cache));
-        }
-    }
-    /* for rc to be 0 here we either found or created a cache node
-     * we will have an ownership apassed to the caller
-     */
-    if (rc == 0)
-        *pcache = cache;
-    /* free allocated path in a buffer */
-    free ((void*)path);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirDestroy
- */
-static
-rc_t CC KXTocDirDestroy (KXTocDir *self)
-{
-    assert (self);
-
-    XTocCacheRelease (self->cache);
-    self->cache->file = NULL;
-    KDirectoryRelease (self->base);
-    free (self);
-    return 0;
-}
-
-
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirList
- *  create a directory listing
- *
- *  "list" [ OUT ] - return parameter for list object
- *
- *  "path" [ IN, NULL OKAY ] - optional parameter for target
- *  directory. if NULL, interpreted to mean "."
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN]	 const KXTocDir *	self		Object oriented C; KXTocDir object for this method
- * [OUT] KNamelist **		listp,
- * [IN]  bool (* 		f	)(const KDirectory*,const char *, void *)
- * [IN]  void *			data
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static
-rc_t CC KXTocDirList (const KXTocDir *self,
-                     KNamelist **listp,
-                     bool (CC* f) (const KDirectory *dir, const char *name, void *data),
-                     void *data,
-                     const char *path_,
-                     va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    if (path_ == NULL)
-        path_ = "/";
-
-    rc = XTocMakePath (&path, true, path_, args);
-    if (rc == 0)
-    {
-        struct XTocEntry * node;
-
-        rc = XTocEntryResolvePath (self->entry->root, path, true, &node);
-        if (rc == 0)
-        {
-            rc = XTocListingMake ((struct XTocListing **)listp, node, f, data);
-        }
-        free ((void*)path);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirPathType
- *  returns a KPathType
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- *
- * [RET] uint32_t
- * [IN]  const KXTocDir *	self		Object oriented C; KXTocDir object for this method
- * [IN]  const char *		path
- * [IN]  va_list		args
- */
-static KPathType CC KXTocDirPathType (const KXTocDir *self, const char *path_, va_list args)
-{
-    const char * path;
-    rc_t rc;
-    KPathType type = kptBadPath;
-
-    rc = XTocMakePath (&path, true, path_, args);
-    if (rc == 0)
-    {
-        type = XTocEntryPathType (self->cache->entry->root, path);
-        free ((void*)path);
-    }
-    return type;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirRelativePath
- *
- * KXTocDirRelativePath
- *  makes "path" relative to "root"
- *  both "root" and "path" MUST be absolute
- *  both "root" and "path" MUST be canonical, i.e. have no "//", "/./" or "/../" sequences
- *
- * [RET] rc_t					0 for success; anything else for a failure
- *						see itf/klib/rc.h for general details
- * [IN] const KXTocDir *		self		Object oriented C; KXTocDir object for this method
- * [IN] enum RCContext 		ctx
- * [IN] const char *		root
- * [IN] char *			path
- * [IN] size_t			path_max
- */
-#if not_USED
-static
-rc_t KXTocDirRelativePath (const KXTocDir *self, enum RCContext ctx,
-                           const char *root, char *path, size_t path_max)
-{
-#if 1
-    return -1;
-#else
-    int backup;
-    size_t bsize, psize;
-    size_t size;
-
-    const char *r = root + self -> root;
-    const char *p = path + self -> root;
-
-    assert (r != NULL && r [ 0 ] == '/');
-    assert (p != NULL && p [ 0 ] == '/');
-
-    for (; * r == * p; ++ r, ++ p)
-    {
-	/* disallow identical paths */
-	if (* r == 0)
-	    return RC (rcFS, rcDirectory, ctx, rcPath, rcInvalid);
-    }
-
-    /* paths are identical up to "r","p"
-       if "r" is within a leaf name, then no backup is needed
-       by counting every '/' from "r" to end, obtain backup count */
-    for (backup = 0; * r != 0; ++ r)
-    {
-	if (* r == '/')
-	    ++ backup;
-    }
-
-    /* the number of bytes to be inserted */
-    bsize = backup * 3;
-
-    /* align "p" to last directory separator */
-    while (p [ -1 ] != '/') -- p;
-
-    /* the size of the remaining relative path */
-    psize = string_measure(p, &size);
-
-    /* open up space if needed */
-    if ( (size_t)(p - path) < bsize )
-    {
-	/* prevent overflow */
-	if (bsize + psize >= path_max)
-	    return RC (rcFS, rcDirectory, ctx, rcPath, rcExcessive);
-	memmove (path + bsize, p, psize);
-    }
-
-    /* insert backup sequences */
-    for (bsize = 0; backup > 0; bsize += 3, -- backup)
-	memcpy (& path [ bsize ], "../", 3);
-
-    /* close gap */
-    if ( (size_t)( p - path ) > bsize )
-	{
-        size_t size;
-		string_copy (& path [ bsize ], path_max - bsize, p, measure_string(p, &size));
-	}
-
-	return 0;
-#endif
-}
-#endif
-
-/* ----------------------------------------------------------------------
- * KXTocDirVisit
- *  visit each path under designated directory,
- *  recursively if so indicated
- *
- *  "recurse" [ IN ] - if non-zero, recursively visit sub-directories
- *
- *  "f" [ IN ] and "data" [ IN, OPAQUE ] - function to execute
- *  on each path. receives a base directory and relative path
- *  for each entry, where each path is also given the leaf name
- *  for convenience. if "f" returns non-zero, the iteration will
- *  terminate and that value will be returned. NB - "dir" will not
- *  be the same as "self".
- *
- *  "path" [ IN ] - NUL terminated string in directory-native character set
- */
-/* ----------------------------------------------------------------------
- * KXTocDirVisitDir
- *
- * [IN] KXTocDirVisitData *	pb
- */
-#if NOT_YET
-typedef struct KXTocDirVisitData
-{
-    int nada;
-} KXTocDirVisitData;
-static
-rc_t KXTocDirVisitDir(KXTocDirVisitData *pb)
-{
-    return -1;
-}
-#endif
-static 
-rc_t CC KXTocDirVisit (const KXTocDir *self, 
-                      bool recurse,
-                      rc_t (CC* f) (const KDirectory *, uint32_t, const char *, void *), 
-                      void *data,
-                      const char *path,
-                      va_list args)
-{
-#if 1
-    return RC (rcFS, rcDirectory, rcVisiting, rcSelf, rcUnsupported);
-#else
-    char * full_path;
-    rc_t   rc;
-
-    if (path == NULL)
-        path = "/";
-
-    /* -----
-     * First fix the path to make it useable
-     */
-    rc = KXTocDirMakePath (self, rcVisiting, true, &full_path, path, args);
-    if (rc != 0)
-    {
-	LOGERR (klogInt, rc, "failed to make path in Visit");
-    }
-    else
-    {
-	const XTocEntry * pnode;
-
-	/* -----
-	 * Now find that path as a node and validate it is a directory
-	 */
-	rc = KXTocEntryResolvePath (&self->toc->root, full_path, true, &pnode);
-	if (rc != 0)
-	{
-	    PLOGERR (klogInt, (klogInt, rc, "failed to resolve path $(P) in Visit", "P=%s", full_path));
-	}
-	else
-	{
-            switch (pnode->type)
-            {
-            case xtoce_file:
-                if (pnode->u.file.has_tree)
-                    break;
-            default:
-                rc = RC (rcFS, rcDirectory, rcVisiting, rcPath, rcInvalid);
-                break;
-            case xtoce_dir:
-                break;
-            }
-
-            if (rc == 0)
-            {
-                size_t size;
-		KXTocDir * full_dir;
-		uint32_t path_size;
-
-		/* -----
-		 * make a locally accessible private KDirectory/KXTocDir
-		 */
-		for ( path_size = (uint32_t)string_measure( full_path, &size );
-		      ( path_size > self->root ) && ( full_path[ path_size - 1 ] == '/' );
-		      -- path_size )
-		{}
-		rc = KXTocDirMake (&full_dir, 
-				  rcVisiting,
-				  self->parent,
-				  self->toc,
-				  pnode,
-				  self->archive.v,
-				  self->arctype,
-				  self->root,
-				  full_path,
-				  path_size, 
-				  true,
-				  false);
-		if (rc == 0)
-		{
-		    KXTocDirVisitData pb;
-
-		    pb.f = f;
-		    pb.data = data;
-		    pb.dir = full_dir;
-		    pb.recurse = recurse;
-/*		    pb.dir.path[--pb.dir.size] = 0; */
-
-		    rc = KXTocDirVisitDir (&pb);
-
-		    KXTocDirDestroy (full_dir);
-		}
-	    }
-	    else
-	    {
-		rc = RC (rcFS, rcDirectory, rcVisiting, rcPath, rcIncorrect);
-		LOGERR (klogInt, rc, "Type is not a directory");
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-#endif
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirVisitUpdate
- */
-static rc_t CC KXTocDirVisitUpdate (KXTocDir *self,
-                                   bool recurse,
-                                   rc_t (CC*f) (KDirectory *,uint32_t,const char *,void *),
-                                   void *data,
-                                   const char *path,
-                                   va_list args)
-{
-    return RC (rcFS, rcDirectory, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirResolvePath
- *
- *  resolves path to an absolute or directory-relative path
- *
- * [IN]  const KXTocDir *self		Objected oriented self
- * [IN]	 bool 		absolute	if non-zero, always give a path starting
- *  					with '/'. NB - if the directory is 
- *					chroot'd, the absolute path
- *					will still be relative to directory root.
- * [OUT] char *		resolved	buffer for NUL terminated result path in 
- *					directory-native character set
- * [IN]	 size_t		rsize		limiting size of resolved buffer
- * [IN]  const char *	path		NUL terminated string in directory-native
- *					character set denoting target path. 
- *					NB - need not exist.
- */
-static rc_t CC KXTocDirResolvePath (const KXTocDir *self,
-                                   bool absolute,
-                                   char *resolved,
-                                   size_t rsize,
-                                   const char *path_,
-                                   va_list args)
-{
-    rc_t rc;
-    const char * path;
-
-    KOutMsg ("+++++\n%s: absolute %d\n", __func__, absolute);
-
-    assert (self);
-    assert (resolved);
-    assert (path_);
-
-    *resolved = '\0';
-    rc = XTocMakePath (&path, false, path_, args);
-    KOutMsg ("%s: rc %R new '%s' old '%s'\n", __func__, rc, path, path_);
-    if (rc != 0)
-    {
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error building path based on $(P)", "P=%s", path_));
-    }
-    else
-    {
-        size_t path_sz = string_size(path);
-
-        if (absolute)
-        {
-            XTocEntry * entry;
-
-            rc = XTocEntryResolvePath (self->entry, path, false, &entry);
-
-            if (rc)
-                PLOGERR (klogErr,
-                         (klogErr, rc, "Error resolving path based on $(P)", "P=%s", path_));
-            else
-            {
-                free ((void*)path);
-                path = NULL;
-                rc = XTocEntryMakeFullPath (entry, &path);
-                if (rc == 0)
-                {
-                    size_t k = self->toc->base_path.size;
-                    if (k > 1)
-                    {
-                        memcpy (resolved, self->toc->base_path.addr, k);
-                        resolved += k;
-                        rsize -= k;
-                    }
-                }
-            }
-        }
-        if (rc == 0)
-        {
-            if (rsize < (path_sz - 1))
-                rc = RC(rcFS, rcDirectory, rcResolving, rcBuffer, rcInsufficient);
-            else
-                string_copy(resolved, rsize, path, rsize);
-        }
-        if (path)
-            free ((void*)path);
-    }
-    return rc;
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirResolveAlias
- *  resolves an alias path to its immediate target
- *  NB - the resolved path may be yet another alias
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting an object presumed to be an alias.
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - buffer for
- *  NUL terminated result path in directory-native character set
- *
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static rc_t CC KXTocDirResolveAlias (const KXTocDir * self, 
-				 bool absolute,
-				 char * resolved,
-				 size_t rsize,
-				 const char *path_,
-				 va_list args)
-{
-#if 0
-    return -1;
-#else
-    rc_t rc;
-    const char * path;
-
-    assert (self);
-    assert (resolved);
-    assert (path_);
-
-    *resolved = '\0';
-    rc = XTocMakePath (&path, false, path_, args);
-    if (rc != 0)
-    {
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error building path based on $(P)", "P=%s", path_));
-    }
-    else
-    {
-        XTocEntry * entry;
-
-        rc = XTocEntryResolvePath (self->entry, path, true , &entry);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Error resolving path based on $(P)", "P=%s", path_));
-        else
-        {
-            free ((void*)path);
-            path = NULL;
-            rc = XTocEntryMakeFullPath (entry, &path);
-        }
-    }
-
-/* THIS IS WRONG!
- * this is the absolute path not the relative one
- */
-    if (rc == 0)
-        string_copy (resolved, rsize, path, string_size (path));
-    
-    if (path)
-        free ((void*)path);
-
-    return rc;
-#endif
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirRename
- *  rename an object accessible from directory, replacing
- *  any existing target object of the same type
- *
- *  "from" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- *
- *  "to" [ IN ] - NUL terminated string in directory-native
- *  character set denoting existing object
- */
-static
-rc_t CC KXTocDirRename (KXTocDir *self, bool force, const char *from, const char *to)
-{
-    assert (self != NULL);
-    assert (from != NULL);
-    assert (to != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirRemove
- *  remove an accessible object from its directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "force" [ IN ] - if non-zero and target is a directory,
- *  remove recursively
- */
-static
-rc_t CC KXTocDirRemove (KXTocDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirClearDir
- *  remove all directory contents
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "force" [ IN ] - if non-zero and directory entry is a
- *  sub-directory, remove recursively
- */
-static
-rc_t CC KXTocDirClearDir (KXTocDir *self, bool force, const char *path, va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirAccess
- *  get access to object
- *
- *  "access" [ OUT ] - return parameter for Unix access mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-static rc_t CC KXTocDirVAccess (const KXTocDir *self,
-			    uint32_t *access,
-			    const char *path_,
-			    va_list args)
-{
-#if 1
-    return -1;
-#else
-    char * path;
-    rc_t rc;
-
-    if (path_ == NULL)
-        path_ = "/";
-
-    rc = KXTocDirMakePath (self, rcAccessing, true, &path, path_, args);
-    if (rc == 0)
-    {
-        XTocEntry * node;
-
-        rc = XTocEntryResolvePath (&self->toc->root, path, true, &node);
-
-
-    const KTocEntry *	entry;
-    rc_t 		rc;
-    uint32_t		acc;
-    KTocEntryType	type;
-    char * 		full;
-
-    assert (self != NULL);
-    assert (access != NULL);
-    assert (path != NULL);
-
-    /* -----
-     * by C standard the nested ifs (if A { if B { if C ... could have been if A && B && C
-     */
-    if ((rc = KXTocDirMakePath (self, rcAccessing, false, &full, path, args)) == 0)
-    {
-	if ((rc = KXTocDirResolvePathNode (self, rcAccessing, path, true, &entry, &type)) == 0)
-	{
-	    if ((rc = KTocEntryGetAccess (entry, &acc)) == 0)
-	    {
-                /*
-                 * We want to filter the access because within an Archive
-                 * a file is unwritable
-                 */
-		*access = acc & ~(S_IWRITE|S_IWGRP|S_IWOTH);
-		rc = 0;
-	    }
-	}
-    }
-    if (full != NULL)
-	free (full);
-    return rc;
-#endif
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirSetAccess
- *  set access to object a la Unix "chmod"
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "access" [ IN ] and "mask" [ IN ] - definition of change
- *  where "access" contains new bit values and "mask defines
- *  which bits should be changed.
- *
- *  "recurse" [ IN ] - if non zero and "path" is a directory,
- *  apply changes recursively.
- */
-static rc_t CC KXTocDirSetAccess (KXTocDir *self,
-			      bool recurse,
-			      uint32_t access,
-			      uint32_t mask,
-			      const char *path,
-			      va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-
-static	rc_t CC KXTocDirVDate		(const KXTocDir *self,
-					 KTime_t *date,
-					 const char *path_,
-					 va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    assert (self);
-    assert (date);
-    assert (path_);
-
-    *date = 0;
-    path = NULL;
-    rc = XTocMakePath (&path, false, path_, args);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-    else
-    {
-        XTocEntry * entry;
-        rc = XTocEntryResolvePath (self->entry, path, false, &entry);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-        else
-            *date = entry->mtime;
-        free ((void*)path);
-    }
-    return rc;
-}
-
-static	rc_t CC KXTocDirSetDate		(KXTocDir *self,
-					 bool recurse,
-					 KTime_t date,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-static
-struct KSysDir *CC KXTocDirGetSysDir ( const KXTocDir *self )
-{
-    return NULL;
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirCreateAlias
- *  creates a path alias according to create mode
- *
- *  "targ" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- *
- *  "alias" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target alias
- *
- *  "access" [ IN ] - standard Unix directory access mode
- *  used when "mode" has kcmParents set and alias path does
- *  not exist.
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KXTocDirCreateAlias (KXTocDir *self,
-			 uint32_t access,
-			 KCreateMode mode,
-			 const char *targ,
-			 const char *alias)
-{
-    assert (self != NULL);
-    assert (targ != NULL);
-    assert (alias != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirOpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t  KXTocDirOpenFileReadInt	(const KXTocDir *self,
-                                 const KXTocFile **f,
-                                 const char *path)
-{
-    XTocCache * cache;
-    rc_t rc;
-
-    DBGTOC (("%s: Opening %s\n", __func__, path));
-    /* resolve path to a cache entry - one will be created if it did not yet exist */
-    rc = XTocDirGetCache (self, path, &cache);
-    DBGTOC(("%s: got cache %p\n",__func__,cache));
-    if (rc == 0)
-    {
-        /* if the file is already open this is easiest */
-        if (cache->file)
-        {
-            DBGTOC(("%s: found open\n",__func__));
-            rc = KFileAddRef (&cache->file->dad);
-            if (rc)
-                *f = cache->file;
-        }
-        else
-        {
-            do
-            {
-                const KFile * bfile = NULL;     /* base file for this new KXTocFile */
-                XTocEntry * entry;
-
-                entry = cache->entry;
-
-                /* next easiest is files not in a container or archive
-                 * the base file will be a KSysFile (most likely) */
-                if (entry->container == entry->root)
-                {
-                    DBGTOC(("%s: NOT in a container or archive\n",__func__));
-                    rc = KDirectoryOpenFileRead (((const KXTocDir*)self->toc->cache->dir)->base,
-                                                 &bfile, path);
-                }
-                else do
-                {
-                    /* more difficult is a file inside a compressed container
-                     * or an archive container */
-                    const KXTocFile * cfile;    /* container's KXTocFile */
-                    XTocCache * ccache;
-
-                    DBGTOC(("%s: in a container or archive\n",__func__));
-                    ccache = entry->container->cache;
-
-                    /* is the container open? */
-                    if (ccache)
-                    {
-                        /* was the container open but not the file?
-                         * not sure if this is possible */
-                        if (ccache->file == NULL)
-                        {
-                            rc = KXTocDirOpenFileReadInt (self->toc->cache->dir, 
-                                                          &cfile, 
-                                                          ccache->path.addr);
-                            if (rc)
-                                break;
-                        }
-                        else
-                            cfile = ccache->file;
-                    }
-                    /* else the container was not yet open */
-                    else
-                    {
-                        /* build the conatiner's path */
-                        const char * cpath;
-                        rc = XTocEntryMakeFullPath (entry->container, &cpath);
-                        if (rc)
-                            break;
-                        else
-                        {
-                            /* now open the container's KXTocFile */
-                            rc = KXTocDirOpenFileReadInt (self->toc->cache->dir, &cfile, cpath);
-                            free ((void*)cpath);
-                            if (rc)
-                                break;
-                        }                        
-                    }
-
-                    /* we should now have an opened container file
-                     * it might be our base file or the source for our base */
-                    DBGTOC(("%s: we have a container file %p\n", __func__, cfile));
-                    DBG_KXTocFile (cfile);
-                    
-                    if (entry->container->u.file.archive) /* extracting from an archive file */
-                    {
-                        /* base file is the container file for an archive */
-                        bfile = &cfile->dad;
-                            DBGTOC(("%s: archive file set cfile %p bfile %p\n",
-                                    __func__, cfile, bfile));
-                    }
-                    else if (entry->container->u.file.container) /* extracting from a compressed file */
-                    {
-                        /* the base file is built from the container's file via decompression */
-                        if (strcmp (entry->container->u.file.filetype.addr, "Compressed/GnuZip") == 0)
-                        {
-                            rc = KFileMakeGzipForRead (&bfile, &cfile->dad);
-                        }
-                        else if (strcmp (entry->container->u.file.filetype.addr, "Compressed/Bzip") == 0)
-                        {
-                            rc = KFileMakeBzip2ForRead (&bfile, &cfile->dad);
-                        }
-                        else
-                        {
-                            DBGTOC(("%s: unsupported %s %s\n",__func__, cfile, 
-                                    entry->container->u.file.filetype.addr));
-                            LOGERR (klogErr, rc, "Unsupported compression type");
-                            rc = RC (rcFS, rcToc, rcOpening, rcToc, rcUnsupported);
-                        }
-                        if (rc == 0)
-                        {
-                            /* release the container file leaving only the
-                             * decompressed file owning it */
-                            KFileRelease (&cfile->dad);
-                            DBGTOC(("%s: container file created cfile %p bfile %p\n",
-                                    __func__, cfile, bfile));
-                        }
-                    }
-                    else
-                        rc = RC (rcFS, rcToc, rcOpening, rcToc, rcCorrupt);
-                }  while (0);
-                if (rc == 0)
-                {
-                    /* now we have a base file for our XTocFile */
-                    String spath;
-                    KXTocFile * xfile;
-                    StringInitCString (&spath, path);
-                    rc = KXTocFileMake (&xfile, bfile, cache, entry, &spath);
-                    DBGTOC(("%s: we have a new KXTocFile file %p bfile %p)\n", __func__, xfile, bfile));
-                    DBG_KXTocFile(xfile);
-                    if (rc == 0)
-                        *f = xfile;
-                }
-                KFileRelease (bfile);
-            } while (0);
-        }
-        XTocCacheRelease (cache);
-    }
-    return rc;
-}
-
-
-static
-rc_t CC KXTocDirOpenFileRead	(const KXTocDir *self,
-                                 const KFile **f,
-                                 const char *path_,
-                                 va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    assert (self);
-    assert (f);
-    assert (path_);
-
-    DBGTOC (("%s: open %s\n", __func__, path_));
-
-    /* make sure we'll write something to the output pointer */
-    *f = NULL;
-
-    /* build path from format and arguments or just the format that is a path in and of itself */
-    rc = XTocMakePath (&path, true, path_, args);
-    if (rc)
-    {
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error opening file $(P)", "P=%s", path_));
-    }
-    else
-        rc = KXTocDirOpenFileReadInt (self, (const KXTocFile**)f, path);
-    free ((void*)path);
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirOpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- */
-static
-rc_t CC KXTocDirOpenFileWrite	(KXTocDir *self,
-					 KFile **f,
-					 bool update,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirCreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "update" [ IN ] - if non-zero, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KXTocDirCreateFile	(KXTocDir *self,
-					 KFile **f,
-					 bool update,
-					 uint32_t access,
-					 KCreateMode cmode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirFileLocator
- *  returns locator in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "locator" [ OUT ] - return parameter for file locator
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KXTocDirFileLocator		(const KXTocDir *self,
-					 uint64_t *locator,
-					 const char *path_,
-					 va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    assert (self);
-    assert (locator);
-    assert (path_);
-
-    *locator = 0;
-    path = NULL;
-    rc = XTocMakePath (&path, false, path_, args);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-    else
-    {
-        XTocEntry * entry;
-        rc = XTocEntryResolvePath (self->entry, path, false, &entry);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-        else if (entry->type != xtoce_file)
-            rc = RC (rcFS, rcDirectory, rcAccessing, rcPath, rcIncorrect);
-        else
-            *locator = entry->u.file.offset;
-        free ((void*)path);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KXTocDirFileSize		(const KXTocDir *self,
-					 uint64_t *size,
-					 const char *path_,
-					 va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    assert (self);
-    assert (size);
-    assert (path_);
-
-    *size = 0;
-    path = NULL;
-    rc = XTocMakePath (&path, false, path_, args);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-    else
-    {
-        XTocEntry * entry;
-        rc = XTocEntryResolvePath (self->entry, path, false, &entry);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-        else if (entry->type != xtoce_file)
-            rc = RC (rcFS, rcDirectory, rcAccessing, rcPath, rcIncorrect);
-        else
-            *size = entry->u.file.size;
-        free ((void*)path);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirFileSize
- *  returns size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ OUT ] - return parameter for file size
- * NOTE: Does not meet a design target of on stack (localized variable) allocation of single 4kb path
- */
-static
-rc_t CC KXTocDirFilePhysicalSize        (const KXTocDir *self,
-					 uint64_t *size,
-					 const char *path_,
-					 va_list args)
-{
-    const char * path;
-    rc_t rc;
-
-    assert (self);
-    assert (size);
-    assert (path_);
-
-    *size = 0;
-    path = NULL;
-    rc = XTocMakePath (&path, false, path_, args);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-    else
-    {
-        XTocEntry * entry;
-        rc = XTocEntryResolvePath (self->entry, path, false, &entry);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Error resolving path from $(P)", "P=%s", path_));
-        else if (entry->type != xtoce_file)
-            rc = RC (rcFS, rcDirectory, rcAccessing, rcPath, rcIncorrect);
-        else
-            *size = entry->u.file.size;
-        free ((void*)path);
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------
- * KXTocDirSetFileSize
- *  sets size in bytes of target file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "size" [ IN ] - new file size
- */
-static
-rc_t CC KXTocDirSetFileSize	(KXTocDir *self,
-					 uint64_t size,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcWriting, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirOpenDirRead
- *
- *  opens a sub-directory
- *
- * [IN]  const KXTocDir *	self	Object Oriented C KXTocDir self
- * [OUT] const KDirectory **	subp	Where to put the new KDirectory/KXTocDir
- * [IN]  bool			chroot	Create a chroot cage for this new subdirectory
- * [IN]  const char *		path	Path to the directory to open
- * [IN]  va_list		args	So far the only use of args is possible additions to path
- */
-static 
-rc_t CC KXTocDirOpenDirRead	(const KXTocDir *self,
-					 const KDirectory **subp,
-					 bool chroot,
-					 const char *path,
-					 va_list args)
-{
-#if 1
-    return -1;
-#else
-    char * full;
-    rc_t rc;
-    size_t size;
-
-    assert (self != NULL);
-    assert (subp != NULL);
-    assert (path != NULL);
-
-    rc = KXTocDirMakePath (self, rcOpening, true, &full, path, args);
-    if (rc == 0)
-    {
-	const KTocEntry *	pnode;
-	KTocEntryType		type;
-	size_t path_size = string_measure (full, &size);
-
-	/* -----
-	 * get rid of any extra '/' characters at the end of path
-	 */
-	while (path_size > 0 && full [ path_size - 1 ] == '/')
-	    full [ -- path_size ] = 0;
-
-	/* -----
-	 * get the node for this path 
-	 */
-	rc = KXTocDirResolvePathNode (self, rcOpening, full, true, &pnode, &type);
-	if (rc == 0)
-	{
-            switch (type)
-            {
-            default:
-		/* fail */
-		rc = RC (rcFS, rcDirectory, rcOpening, rcPath, rcIncorrect);
-                break;
-            case ktocentrytype_dir:
-            case ktocentrytype_hardlink:
-	    {
-		KXTocDir *	sub;
-
-		rc = KXTocDirMake (&sub,
-				  rcOpening,
-				  self->parent,
-				  self->toc,
-				  pnode,
-				  self->archive.v,
-				  self->arctype,
-				  self->root,
-				  full,
-				  (uint32_t)path_size,
-				  false,
-				  chroot);
-		if (rc == 0)
-		{
-		    /* succeed */
-		    *subp = &sub->dad;
-		}
-	    }
-            }
-	}
-	free (full);
-    }
-    return rc;
-#endif
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirOpenDirUpdate
- *  opens a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "chroot" [ IN ] - if non-zero, the new directory becomes
- *  chroot'd and will interpret paths beginning with '/'
- *  relative to itself.
- */
-static
-rc_t CC KXTocDirOpenDirUpdate	(KXTocDir *self,
-					 KDirectory ** subp, 
-					 bool chroot, 
-					 const char *path, 
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (subp != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcUpdating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirCreateDir
- *  create a sub-directory
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target directory
- *
- *  "access" [ IN ] - standard Unix directory permissions
- *
- *  "mode" [ IN ] - a creation mode (see explanation above).
- */
-static
-rc_t CC KXTocDirCreateDir	(KXTocDir *self,
-					 uint32_t access,
-					 KCreateMode mode,
-					 const char *path,
-					 va_list args)
-{
-    assert (self != NULL);
-    assert (path != NULL);
-
-    return RC (rcFS, rcArc, rcCreating, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirDestroyFile
- */
-static
-rc_t CC KXTocDirDestroyFile	(KXTocDir *self,
-					 KFile * f)
-{
-    assert (self != NULL);
-    assert (f != NULL);
-
-    return RC (rcFS, rcArc, rcDestroying, rcSelf, rcUnsupported);
-}
-
-/* ----------------------------------------------------------------------
- * KXTocDirFileContiguous
- *  
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- *
- *  "contiguous" [ OUT ] - return parameter for file status
- */
-static
-rc_t CC KXTocDirFileContiguous		(const KXTocDir *self,
-                                         bool * contiguous,
-					 const char *path,
-                                         va_list args)
-{
-#if 1
-    return -1;
-#else
-    char *		full_path;
-    rc_t		rc;
-
-    assert (self != NULL);
-    assert (contiguous != NULL);
-    assert (path != NULL);
-
-    rc = KXTocDirMakePath (self, rcResolving, true,
-			  &full_path, path, args);
-
-    if (rc != 0)
-    {
-	/* can't "fix" path */
-	/*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-    }
-    else
-    {
-	const KTocEntry * pnode;
-	KTocEntryType     type;
-
-	rc = KXTocDirResolvePathNode (self, rcResolving, full_path, /*follow links*/true, &pnode, &type);
-
-	if (rc != 0)
-	{
-	    /* can't resolve path */
-	    /*rc = RC (rcFS, rcDirectory, rcResolving, rcPath, rcInvalid); ? or tweak it? */
-	}
-	else
-	{
-	    switch (type)
-	    {
-	    default:
-                *contiguous = false;
-		break;
-	    case ktocentrytype_emptyfile:
-	    case ktocentrytype_file:
-                *contiguous = true;
-		break;
-	    }
-	}
-	free (full_path);
-    }
-    return rc;
-#endif
-}
-/* ----------------------------------------------------------------------
- *
- */
-static KDirectory_vt_v1 vtKXTocDir =
-{
-    /* version 1.0 */
-    1, 3,
-
-    /* start minor version 0 methods*/
-    KXTocDirDestroy,
-    KXTocDirList,
-    KXTocDirVisit,
-    KXTocDirVisitUpdate,
-    KXTocDirPathType,
-    KXTocDirResolvePath,
-    KXTocDirResolveAlias,
-    KXTocDirRename,
-    KXTocDirRemove,
-    KXTocDirClearDir,
-    KXTocDirVAccess,
-    KXTocDirSetAccess,
-    KXTocDirCreateAlias,
-    KXTocDirOpenFileRead,
-    KXTocDirOpenFileWrite,
-    KXTocDirCreateFile,
-    KXTocDirFileSize,
-    KXTocDirSetFileSize,
-    KXTocDirOpenDirRead,
-    KXTocDirOpenDirUpdate,
-    KXTocDirCreateDir,
-    KXTocDirDestroyFile,
-    /* end minor version 0 methods*/
-    /* start minor version 1 methods*/
-    KXTocDirVDate,
-    KXTocDirSetDate,
-    KXTocDirGetSysDir,
-    /* end minor version 2 methods*/
-    KXTocDirFileLocator,
-    /* end minor version 2 methods*/
-    /* end minor version 3 methods*/
-    KXTocDirFilePhysicalSize,
-    KXTocDirFileContiguous
-    /* end minor version 3 methods*/
-};
-
-static
-rc_t KXTocDirMake (const KXTocDir ** pself, const KDirectory * base,
-                   XToc * toc, XTocCache * cache, XTocEntry * entry,
-                   const String * path)
-{
-    rc_t rc;
-    KXTocDir * self;
-
-    assert (pself);
-    assert (base);
-    assert (toc);
-    assert (cache);
-    assert (entry);
-    assert (path);
-
-    self = malloc (sizeof (*self) + 1 + StringSize (path));
-    if (self == NULL)
-        rc = RC (rcFS, rcDirectory, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        char * pc;
-
-        self->base = base;        /* we take ownership of base */
-        self->toc = toc;
-        self->cache = cache;
-        self->entry = entry;
-        self->container = entry->container;
-        self->root = toc->root;
-
-        pc = (char *)(self + 1);
-        string_copy (pc, StringSize (path), path->addr, StringSize (path));
-        StringInit (&self->base_path, pc, StringSize (path), StringLength (path));
-
-        rc = KDirectoryInit (&self->dad, (const KDirectory_vt*)&vtKXTocDir,
-                             "KXTocDir", pc, false);
-        if (rc == 0)
-        {
-            *pself = self;
-            return 0;
-        }
-        free (self);
-    }
-    return rc;
-}
-
-
-static 
-rc_t KDirectoryOpenXTocDirReadInt (const KDirectory * dir,
-                                   const KDirectory ** pnew_dir,
-                                   const KFile * xml,
-                                   const String * spath)
-{
-    XToc * xtoc;
-    rc_t rc;
-
-    rc = XTocMake (&xtoc, spath);
-    if (rc)
-        LOGERR (klogErr, rc, "Error creating toc for xtc directory");
-    else
-    {
-        String sroot;
-        XTocCache * cache;
-
-        StringInitCString (&sroot, ".");
-        rc = XTocMakeXTocCache (xtoc, &cache, &sroot, xtoc->root);
-        if (rc)
-            LOGERR (klogErr, rc, 
-                    "Failed to make cache for root for "
-                    "xtoc directory");
-        else
-        {
-            const KXTocDir * xdir;
-
-            /* now that we have a cache node we should release
-             * the original reference to the xtoc */
-/* ??? */
-            XTocRelease (xtoc);
-
-            xtoc->cache = xtoc->root->cache = cache;
-
-            rc = KXTocDirMake (&xdir, dir, xtoc, cache, xtoc->root,
-                               &sroot);
-            if (rc)
-                LOGERR (klogErr, rc, "Error making xtoc directory");
-            else
-            {
-                DBG_KXTocDir((xdir));
-                cache->dir = xdir;
-
-                rc = XTocParseXml (xtoc->root, xml);
-                if (rc)
-                    LOGERR (klogErr, rc, "Error parsing copycat xml file");
-                else
-                {
-                    *pnew_dir = &xdir->dad;
-                    return 0;
-                }
-                KDirectoryRelease (&xdir->dad);
-            }                
-            XTocCacheRelease (cache);
-        }
-        XTocRelease (xtoc);
-    }
-    return rc;
-}
-
-rc_t CC KDirectoryOpenXTocDirReadDir (const KDirectory * self,
-                                                 const KDirectory ** pnew_dir,
-                                                 const KFile * xml,
-                                                 const String * spath)
-{
-    rc_t rc;
-    
-    /* loosely validate parameters */
-    if (pnew_dir == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc,
-                "new directory parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    *pnew_dir = NULL;
-
-    if (self == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcSelf, rcNull);
-        LOGERR (klogErr, rc, "self is NULL for opening XToc Directory");
-        return rc;
-    }
-    else if (xml == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc, "xml parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    else if (spath == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc, "base path parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    else
-    {
-        rc = KDirectoryOpenXTocDirReadInt (self, pnew_dir, xml, spath);
-    }
-    return rc;
-}
-
-
-rc_t CC KDirectoryVOpenXTocDirRead (const KDirectory * self,
-                                               const KDirectory ** pnew_dir,
-                                               bool chroot,
-                                               const KFile * xml,
-                                               const char * _path,
-                                               va_list args )
-{
-    rc_t rc;
-    
-    /* loosely validate parameters */
-    if (pnew_dir == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc,
-                "new directory parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    *pnew_dir = NULL;
-
-    if (self == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcSelf, rcNull);
-        LOGERR (klogErr, rc, "self is NULL for opening XToc Directory");
-        return rc;
-    }
-    else if (xml == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc, "xml parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    else if (_path == NULL)
-    {
-        rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNull);
-        LOGERR (klogErr, rc, "base path parameter is NULL for opening XToc Directory");
-        return rc;
-    }
-    else
-    /* okay none of our parameters are NULL; they could still be bad but let's start */
-    {
-        String spath;
-        const KDirectory * bdir;
-        KPathType type;
-        char path [8192];
-
-        rc = KDirectoryVResolvePath (self, true, path, sizeof path, _path, args);
-        if (rc)
-            return rc;
-
-        type = KDirectoryPathType (self, path);
-        switch (type & ~kptAlias)
-        {
-        case kptNotFound:
-            rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcNotFound);
-            LOGERR (klogErr, rc, "base path parameter is not found when opening XToc Directory");
-            return rc;
-
-        case kptBadPath:
-            rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcInvalid);
-            LOGERR (klogErr, rc, "base path parameter is a bad path when opening XToc Directory");
-            return rc;
-
-        case kptFile:
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-        case kptZombieFile:
-        case kptDataset:
-        case kptDatatype:
-            KOutMsg ("%s: type '%u' path '%s'\n",type,path);
-            rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcWrongType);
-            LOGERR (klogErr, rc, "base path parameter is an unusable type when opening XToc Directory");
-            return rc;
-
-        default:
-            rc = RC (rcFS, rcDirectory, rcOpening, rcParam, rcCorrupt);
-            LOGERR (klogErr, rc, "base path parameter is not a known type when opening XToc Directory");
-            return rc;
-
-        case kptDir:
-            break;
-        }
-
-        rc = KDirectoryVOpenDirRead (self, &bdir, true, path, args);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "failed to open base directory for XToc directory");
-            return rc;
-        }
-        else
-        {
-            static const char absroot[] = "/";
-
-            if (chroot)
-                StringInitCString (&spath, absroot);
-            else
-                StringInitCString (&spath, path);
-
-            rc = KDirectoryOpenXTocDirReadInt (bdir, pnew_dir, xml, &spath);
-            if (rc == 0)
-                return 0;
-
-            KDirectoryRelease (bdir);
-        }
-    }
-    return rc;
-}
-
-
-rc_t CC KDirectoryOpenXTocDirRead (const KDirectory * self,
-                                              const KDirectory ** pnew_dir,
-                                              bool chroot,
-                                              const KFile * xml,
-                                              const char * path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start (args, path);
-    rc = KDirectoryVOpenXTocDirRead (self, pnew_dir, chroot, xml, path, args);
-    va_end (args);
-
-    return rc;
-}
-
-
-struct VFSManager;
-
-rc_t CC VFSManagerOpenXTocDirRead (const struct VFSManager * self,
-                                              const struct KDirectory ** pnew_dir,
-                                              const struct KFile * xml,
-                                              const struct VPath * path)
-{
-    rc_t rc = 0;
-
-    /* needs to be replaced with proper checking and rc returns */
-    assert (pnew_dir);
-
-    *pnew_dir = NULL;
-
-    assert (self);
-    assert (xml);
-    assert (path);
-
-    if (rc == 0)
-    {
-        const KDirectory * dir;
-
-        rc = VFSManagerOpenDirectoryRead (self, &dir, path);
-        if (rc == 0)
-        {
-            char pbuff [8192];
-            size_t z;
-
-            rc = VPathReadPath (path, pbuff, sizeof pbuff, &z);
-            if (rc == 0)
-            {
-                String string;
-
-                StringInit (&string, pbuff, z, string_len (pbuff, z));
-
-                rc = KDirectoryOpenXTocDirReadDir (dir, pnew_dir, xml, &string);
-                if (rc == 0)
-                    return 0;
-            }
-
-            KDirectoryRelease (dir);
-        }
-    }
-    return rc;
-}
-
-
-
-/* end of file */
diff --git a/libs/loader/Makefile b/libs/loader/Makefile
deleted file mode 100644
index d1410c8..0000000
--- a/libs/loader/Makefile
+++ /dev/null
@@ -1,87 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/loader
-
-INT_LIBS = \
-	libloader
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-TEST_TOOLS = 
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs 
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(TEST_TOOLS): std makedirs
-	@ $(MAKE_CMD) $(TEST_BINDIR)/$@
-
-.PHONY: all std $(ALL_LIBS) $(TEST_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# libloader
-#
-$(ILIBDIR)/libloader: $(ILIBDIR)/libloader.$(LIBX)
-
-LOADER_SRC = \
-    mmarray \
-	common-reader \
-	common-writer \
-	sequence-writer \
-	reference-writer \
-	alignment-writer
-
-LOADER_OBJ = \
-	$(addsuffix .$(LOBX),$(LOADER_SRC))
-
-$(ILIBDIR)/libloader.$(LIBX): $(LOADER_OBJ)
-	$(LD) --slib -o $@ $^ $(LOADER_LIB)
-
diff --git a/libs/loader/alignment-writer.c b/libs/loader/alignment-writer.c
deleted file mode 100644
index 0b85c31..0000000
--- a/libs/loader/alignment-writer.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <klib/out.h>
-
-#include <vdb/vdb-priv.h>
-
-#include <loader/alignment-writer.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-enum e_tables {
-    tblPrimary,
-    tblSecondary,
-    tblN
-};
-
-struct AlignmentWriter {
-    VDatabase *db;
-    TableWriterAlgn const *tbl[tblN];
-    int64_t rowId;
-    int st;
-};
-
-AlignmentWriter *AlignmentMake(VDatabase *db) {
-    AlignmentWriter *self = calloc(1, sizeof(*self));
-    
-    if (self) {
-        self->db = db;
-        VDatabaseAddRef(self->db);
-    }
-    return self;
-}
-
-static rc_t SetColumnDefaults(TableWriterAlgn const *tbl)
-{
-    return 0;
-}
-
-static rc_t WritePrimaryRecord(AlignmentWriter *const self, AlignmentRecord *const data, bool expectUnsorted)
-{
-    if (self->tbl[tblPrimary] == NULL) {
-        rc_t rc = TableWriterAlgn_Make(&self->tbl[tblPrimary], self->db,
-                                       ewalgn_tabletype_PrimaryAlignment,
-                                       ewalgn_co_TMP_KEY_ID + 
-                                       (expectUnsorted ? ewalgn_co_unsorted : 0));
-        if (rc)
-            return rc;
-        rc = SetColumnDefaults(self->tbl[tblPrimary]);
-        if (rc)
-            return rc;
-    }
-    return TableWriterAlgn_Write(self->tbl[tblPrimary], &data->data, &data->alignId);
-}
-
-static rc_t WriteSecondaryRecord(AlignmentWriter *const self, AlignmentRecord *const data, bool expectUnsorted)
-{
-    if (self->tbl[tblSecondary] == NULL) {
-        rc_t rc = TableWriterAlgn_Make(&self->tbl[tblSecondary], self->db,
-                                       ewalgn_tabletype_SecondaryAlignment,
-                                       ewalgn_co_TMP_KEY_ID + 
-                                       (expectUnsorted ? ewalgn_co_unsorted : 0));
-        if (rc)
-            return rc;
-        rc = SetColumnDefaults(self->tbl[tblSecondary]);
-        if (rc)
-            return rc;
-    }
-#if 1
-    /* try to make consistent with cg-load */
-    if (data->mate_ref_pos == 0) {
-        data->data.mate_ref_orientation.elements = 0;
-    }
-#endif
-    return TableWriterAlgn_Write(self->tbl[tblSecondary], &data->data, &data->alignId);
-}
-
-rc_t AlignmentWriteRecord(AlignmentWriter *const self, AlignmentRecord *const data, bool expectUnsorted)
-{
-    return data->isPrimary ? WritePrimaryRecord(self, data, expectUnsorted) : WriteSecondaryRecord(self, data, expectUnsorted);
-}
-
-rc_t AlignmentStartUpdatingSpotIds(AlignmentWriter *const self)
-{
-    return 0;
-}
-
-rc_t AlignmentGetSpotKey(AlignmentWriter * const self, uint64_t *keyId, int64_t *alignId, bool *isPrimary)
-{
-    rc_t rc;
-    
-    switch (self->st) {
-    case 0:
-        rc = TableWriterAlgn_TmpKeyStart(self->tbl[tblPrimary]);
-        if (rc)
-            break;
-        self->rowId = 0;
-        ++self->st;
-    case 1:
-        rc = TableWriterAlgn_TmpKey(self->tbl[tblPrimary], ++self->rowId, keyId);
-        if (rc == 0) {
-            *alignId = self->rowId;
-            *isPrimary = true;
-            break;
-        }
-        ++self->st;
-        if (GetRCState(rc) != rcNotFound || GetRCObject(rc) != rcRow || self->tbl[tblSecondary] == NULL)
-            break;
-    case 2:
-        rc = TableWriterAlgn_TmpKeyStart(self->tbl[tblSecondary]);
-        if (rc)
-            break;
-        self->rowId = 0;
-        ++self->st;
-    case 3:
-        rc = TableWriterAlgn_TmpKey(self->tbl[tblSecondary], ++self->rowId, keyId);
-        if (rc == 0) {
-            *alignId = self->rowId;
-            *isPrimary = false;
-            break;
-        }
-        if (GetRCState(rc) != rcNotFound || GetRCObject(rc) != rcRow)
-            break;
-        ++self->st;
-        break;
-    default:
-        rc = RC(rcAlign, rcTable, rcUpdating, rcError, rcIgnored);
-        break;
-    }
-    return rc;
-}
-
-rc_t AlignmentGetRefPos(AlignmentWriter *const self, int64_t row, ReferenceStart *const rslt)
-{
-    switch (self->st) {
-    case 1:
-        return TableWriterAlgn_RefStart(self->tbl[tblPrimary], self->rowId, rslt);
-    case 3:
-    default:
-        return RC(rcAlign, rcTable, rcUpdating, rcSelf, rcInconsistent);
-    }
-}
-
-rc_t AlignmentUpdateInfo(AlignmentWriter * const self, int64_t const spotId, int64_t const mateId, ReferenceStart const *mateRefPos)
-{
-    switch (self->st) {
-    case 1:
-        return TableWriterAlgn_Write_SpotInfo(self->tbl[tblPrimary], self->rowId, spotId, mateId, mateRefPos);
-    case 3:
-        return TableWriterAlgn_Write_SpotInfo(self->tbl[tblSecondary], self->rowId, spotId, 0, 0);
-    default:
-        return RC(rcAlign, rcTable, rcUpdating, rcSelf, rcInconsistent);
-    }
-}
-
-rc_t AlignmentWhack(AlignmentWriter * const self, bool const commit) 
-{
-    rc_t const rc = TableWriterAlgn_Whack(self->tbl[tblPrimary], commit, NULL);
-    rc_t const rc2 = self->tbl[tblSecondary] ? TableWriterAlgn_Whack(self->tbl[tblSecondary], commit | (rc == 0), NULL) : 0;
-
-    VDatabaseRelease(self->db);
-    free(self);
-    return rc ? rc : rc2;
-}
-
-size_t AlignmentRecordBufferSize(size_t const readlen, bool hasMismatchQual)
-{
-    AlignmentRecord const *const dummy;
-    size_t const elemSize = sizeof(AR_OFFSET(*dummy)[0])
-                          + sizeof(AR_HAS_MISMATCH(*dummy)[0])
-                          + sizeof(AR_HAS_OFFSET(*dummy)[0])
-                          + sizeof(AR_MISMATCH(*dummy)[0])
-                          + (hasMismatchQual ? sizeof(AR_MISMATCH_QUAL(*dummy)[0]) : 0);
-    
-    return elemSize * readlen;
-}
-
-void AlignmentRecordInit(AlignmentRecord *self, void *buffer, unsigned readlen,
-                         char **endp,
-                         bool expectUnsorted,
-                         bool hasMismatchQual
-                         )
-{
-    memset(self, 0, sizeof(*self));
-
-    self->data.seq_read_id.buffer = &self->read_id;
-    self->data.seq_read_id.elements = 1;
-    self->data.ref_id.buffer = &self->ref_id;
-    self->data.ref_id.elements = 1;
-    if (expectUnsorted) {
-        self->data.ref_start.buffer = &self->ref_start;
-        self->data.ref_start.elements = 1;
-    }
-    else {
-        self->data.global_ref_start.buffer = &self->global_ref_start;
-        self->data.global_ref_start.elements = 1;
-    }
-    self->data.ref_orientation.buffer = &self->ref_orientation;
-    self->data.ref_orientation.elements = 1;
-    self->data.mapq.buffer = &self->mapq;
-    self->data.mapq.elements = 1;
-    self->data.tmp_key_id.buffer = &self->tmp_key_id;
-    self->data.tmp_key_id.elements = 1;
-    
-    self->data.read_start.buffer = &self->read_start;
-    self->data.read_start.elements = 1;
-    self->data.read_len.buffer = &self->read_len;
-    self->data.read_len.elements = 1;
-    
-    self->data.mate_ref_orientation.buffer = &self->mate_ref_orientation;
-    self->data.mate_ref_orientation.elements = 1;
-    self->data.mate_ref_id.buffer = &self->mate_ref_id;
-    self->data.mate_ref_id.elements = 1;
-    self->data.mate_ref_pos.buffer = &self->mate_ref_pos;
-    self->data.mate_ref_pos.elements = 1;
-    self->data.mate_align_id.buffer = &self->mate_align_id;
-    self->data.mate_align_id.elements = 1;
-    self->data.template_len.buffer = &self->template_len;
-    self->data.template_len.elements = 1;
-    
-    self->data.ref_offset.buffer = (int32_t *)buffer;
-    self->data.has_mismatch.buffer = (bool *)&AR_OFFSET(*self)[readlen];
-    self->data.has_mismatch.elements = readlen;
-    self->data.has_ref_offset.buffer = &AR_HAS_MISMATCH(*self)[readlen];
-    self->data.has_ref_offset.elements = readlen;
-    self->data.mismatch.buffer = (char *)&AR_HAS_OFFSET(*self)[readlen];
-    
-    if (hasMismatchQual) {
-        self->data.mismatch_qual.buffer = (uint8_t *)&AR_MISMATCH(*self)[readlen];
-        *endp = (char *)&AR_MISMATCH_QUAL(*self)[readlen];
-    }
-    else
-        *endp = (char *)&AR_MISMATCH(*self)[readlen];
-}
diff --git a/libs/loader/common-reader.c b/libs/loader/common-reader.c
deleted file mode 100644
index cde2bcf..0000000
--- a/libs/loader/common-reader.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <loader/common-reader-priv.h>
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include <klib/rc.h>
-
-/*--------------------------------------------------------------------------
- ReaderFile
- */
-rc_t CC ReaderFileAddRef ( const ReaderFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "ReaderFile" ) )
-        {
-        case krefLimit:
-            return RC ( RC_MODULE, rcFile, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-rc_t CC ReaderFileRelease ( const ReaderFile *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "ReaderFile" ) )
-        {
-        case krefWhack:
-            return self->vt.v1->destroy( (ReaderFile *)self );
-        case krefNegative:
-            return RC ( RC_MODULE, rcFile, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-rc_t CC ReaderFileGetRecord( const ReaderFile *self, const Record** result)
-{
-    assert(self);
-    assert(result);
-    return self->vt.v1->getRecord( self, result );
-}
-
-float CC ReaderFileGetProportionalPosition ( const READERFILE_IMPL *self )
-{
-    assert(self);
-    assert(self->vt.v1->getProportionalPosition);
-    return self->vt.v1->getProportionalPosition( self );
-}
-
-rc_t CC ReaderFileGetReferenceInfo ( const ReaderFile *self, const ReferenceInfo** result )
-{
-    assert(self);
-    assert(self->vt.v1->getReferenceInfo);
-    return self->vt.v1->getReferenceInfo( self, result );
-}
-
-/* Init
- *  polymorphic parent constructor
- */
-rc_t CC ReaderFileInit ( ReaderFile *self )
-{
-    if ( self == NULL )
-        return RC ( RC_MODULE, rcFileFormat, rcConstructing, rcSelf, rcNull );
-
-    KRefcountInit ( & self -> refcount, 1, "ReaderFile", "ReaderFileInit", "");
-
-    self->pathname = NULL;
-
-    return 0;
-}
-
-rc_t CC ReaderFileWhack ( ReaderFile *self )
-{
-    if ( self == NULL )
-        return RC ( RC_MODULE, rcFileFormat, rcConstructing, rcSelf, rcNull );
-
-    free( self->pathname );
-
-    return 0;
-}
-
-const char* CC ReaderFileGetPathname ( const ReaderFile *self )
-{
-    if ( self == NULL )
-        return NULL;
-    return self->pathname;
-}
-
-/*--------------------------------------------------------------------------
- Record
- */
-
-rc_t CC RecordAddRef ( const Record *self )
-{
-    assert(self);
-    assert(self->vt.v1->addRef);
-    return self->vt.v1->addRef(self);
-}
-
-rc_t CC RecordRelease ( const Record *self )
-{
-    assert(self);
-    assert(self->vt.v1->release);
-    return self->vt.v1->release(self);
-}
-
-rc_t CC RecordGetSequence ( const Record *self, const Sequence** result)
-{
-    assert(self);
-    assert(result);
-    assert(self->vt.v1->getSequence);
-    return self->vt.v1->getSequence(self, result);
-}
-
-rc_t CC RecordGetAlignment( const Record *self, const Alignment** result)
-{
-    assert(self);
-    assert(result);
-    assert(self->vt.v1->getAlignment);
-    return self->vt.v1->getAlignment(self, result);
-}
-
-rc_t CC RecordGetRejected ( const Record *self, const Rejected** result)
-{
-    assert(self);
-    assert(result);
-    assert(self->vt.v1->getRejected);
-    return self->vt.v1->getRejected(self, result);
-}
-
-/*--------------------------------------------------------------------------
- Sequence
- */
-rc_t CC SequenceAddRef ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->addRef);
-    return self->vt.v1->addRef(self);
-}
-
-rc_t CC SequenceRelease ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->release);
-    return self->vt.v1->release(self);
-}
-
-rc_t CC SequenceGetReadLength ( const Sequence *self, uint32_t *length )
-{
-    assert(self);
-    assert(length);
-    assert(self->vt.v1->getReadLength);
-    return self->vt.v1->getReadLength(self, length);
-}
-
-rc_t CC SequenceGetRead( const Sequence *self, char *sequence )
-{
-    assert(self);
-    assert(sequence);
-    assert(self->vt.v1->getRead);
-    return self->vt.v1->getRead(self, sequence);
-}
-
-rc_t CC SequenceGetRead2 ( const Sequence *self, char *sequence, uint32_t start, uint32_t stop)
-{
-    assert(self);
-    assert(sequence);
-    assert(self->vt.v1->getRead2);
-    return self->vt.v1->getRead2(self, sequence, start, stop);
-}
-
-rc_t CC SequenceGetQuality(const Sequence *self, const int8_t **quality, uint8_t *offset, int *qualType)
-{
-    assert(self);
-    assert(quality);
-    assert(offset);
-    assert(qualType);
-    assert(self->vt.v1->getQuality);
-    return self->vt.v1->getQuality(self, quality, offset, qualType);
-}
-
-rc_t CC SequenceGetSpotGroup ( const Sequence *self, const char **name, size_t *length )
-{
-    assert(self);
-    assert(name);
-    assert(length);
-    assert(self->vt.v1->getSpotGroup);
-    return self->vt.v1->getSpotGroup(self, name, length);
-}
-
-rc_t CC SequenceGetSpotName ( const Sequence *self, const char **name, size_t *length )
-{
-    assert(self);
-    assert(name);
-    assert(length);
-    assert(self->vt.v1->getSpotName);
-    return self->vt.v1->getSpotName(self, name, length);
-}
-
-bool CC SequenceIsColorSpace ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->isColorSpace);
-    return self->vt.v1->isColorSpace(self);
-}
-
-rc_t CC SequenceGetCSKey ( const Sequence *self, char cskey[1] )
-{
-    assert(self);
-    assert(self->vt.v1->getCSKey);
-    return self->vt.v1->getCSKey(self, cskey);
-}
-
-rc_t CC SequenceGetCSReadLength ( const Sequence *self, uint32_t *length )
-{
-    assert(self);
-    assert(self->vt.v1->getCSReadLength);
-    return self->vt.v1->getCSReadLength(self, length);
-}
-
-rc_t CC SequenceGetCSRead( const Sequence *self, char *sequence )
-{
-    assert(self);
-    assert(self->vt.v1->getCSRead);
-    return self->vt.v1->getCSRead(self, sequence);
-}
-
-rc_t CC SequenceGetCSQuality(const Sequence *self, const int8_t **quality, uint8_t *offset, int *qualType)
-{
-    assert(self);
-    assert(quality);
-    assert(offset);
-    assert(qualType);
-    assert(self->vt.v1->getCSQuality);
-    return self->vt.v1->getCSQuality(self, quality, offset, qualType);
-}
-
-bool CC SequenceWasPaired     ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->wasPaired);
-    return self->vt.v1->wasPaired(self);
-}
-
-int CC SequenceGetOrientationSelf( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->orientationSelf);
-    return self->vt.v1->orientationSelf(self);
-}
- 
-int CC SequenceGetOrientationMate( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->orientationMate);
-    return self->vt.v1->orientationMate(self);
-}
-
-bool CC SequenceIsFirst       ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->isFirst);
-    return self->vt.v1->isFirst(self);
-}
-
-bool CC SequenceIsSecond      ( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->isSecond);
-    return self->vt.v1->isSecond(self);
-}
-
-rc_t SequenceGetTI(Sequence const *self, uint64_t *ti)
-{
-    assert(self);
-    assert(ti);
-    assert(self->vt.v1->getTI);
-    return self->vt.v1->getTI(self, ti);
-}
-
-bool CC SequenceIsDuplicate( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->isDuplicate);
-    return self->vt.v1->isDuplicate(self);
-}
-
-bool CC SequenceIsLowQuality( const Sequence *self )
-{
-    assert(self);
-    assert(self->vt.v1->isLowQuality);
-    return self->vt.v1->isLowQuality(self);
-}
-
-/*--------------------------------------------------------------------------
- Alignment
- */
-
-rc_t CC AlignmentAddRef ( const Alignment *self )
-{
-    assert(self);
-    assert(self->vt.v1->addRef);
-    return self->vt.v1->addRef(self);
-}
-
-rc_t CC AlignmentRelease ( const Alignment *self )
-{
-    assert(self);
-    assert(self->vt.v1->release);
-    return self->vt.v1->release(self);
-}
-
-rc_t CC AlignmentGetRefSeqId ( const Alignment *self, int32_t *refSeqId )
-{
-    assert(self);
-    assert(refSeqId);
-    assert(self->vt.v1->getRefSeqId);
-    return self->vt.v1->getRefSeqId(self, refSeqId);
-}
-
-rc_t CC AlignmentGetMateRefSeqId ( const Alignment *self, int32_t *refSeqId )
-{
-    assert(self);
-    assert(refSeqId);
-    assert(self->vt.v1->getMateRefSeqId);
-    return self->vt.v1->getMateRefSeqId(self, refSeqId);
-}
-
-rc_t CC AlignmentGetPosition ( const Alignment *self, int64_t *pos )
-{
-    assert(self);
-    assert(pos);
-    assert(self->vt.v1->getPosition);
-    return self->vt.v1->getPosition(self, pos);
-}
-
-rc_t CC AlignmentGetMatePosition ( const Alignment *self, int64_t *pos )
-{
-    assert(self);
-    assert(pos);
-    assert(self->vt.v1->getMatePosition);
-    return self->vt.v1->getMatePosition(self, pos);
-}
-
-rc_t CC AlignmentGetMapQuality ( const Alignment *self, uint8_t *qual )
-{
-    assert(self);
-    assert(qual);
-    assert(self->vt.v1->getMapQuality);
-    return self->vt.v1->getMapQuality(self, qual);
-}
-
-rc_t CC AlignmentGetAlignmentDetail ( const Alignment *self,
-                                      AlignmentDetail *rslt, 
-                                      uint32_t count, 
-                                      uint32_t *actual,
-                                      int32_t *firstMatch, 
-                                      int32_t *lastMatch )
-{
-    assert(self);
-    assert(self->vt.v1->getAlignmentDetail);
-    return self->vt.v1->getAlignmentDetail(self, rslt, count, actual, firstMatch, lastMatch);
-}
-
-rc_t CC AlignmentGetAlignOpCount ( const Alignment *self, uint32_t *n )
-{
-    assert(self);
-    assert(n);
-    assert(self->vt.v1->getAlignOpCount);
-    return self->vt.v1->getAlignOpCount(self, n);
-}
-
-rc_t CC AlignmentGetInsertSize ( const Alignment *self, int64_t *size )
-{
-    assert(self);
-    assert(size);
-    assert(self->vt.v1->getInsertSize);
-    return self->vt.v1->getInsertSize(self, size);
-}
-
-rc_t AlignmentGetCGData ( const ALIGNMENT_IMPL *self, const CGData** result)
-{
-    assert(self);
-    assert(result);
-    assert(self->vt.v1->getCG);
-    return self->vt.v1->getCG(self, result);
-}
-
-rc_t AlignmentGetBAMCigar ( const ALIGNMENT_IMPL *self, uint32_t const **rslt, uint32_t *length )
-{
-    assert(self);
-    assert(rslt);
-    assert(length);
-    assert(self->vt.v1->getBAMCigar);
-    return self->vt.v1->getBAMCigar(self, rslt, length);
-}
-
-bool AlignmentIsSecondary( const Alignment *self )
-{
-    assert(self);
-    assert(self->vt.v1->isSecondary);
-    return self->vt.v1->isSecondary(self);
-}
-
-/*--------------------------------------------------------------------------
- * CGData
- */
-rc_t CC CGDataAddRef ( const CGData *self )
-{
-    assert(self);
-    assert(self->vt.v1->addRef);
-    return self->vt.v1->addRef(self);
-}
-
-rc_t CC CGDataRelease ( const CGData *self )
-{
-    assert(self);
-    assert(self->vt.v1->release);
-    return self->vt.v1->release(self);
-}
-
-/* CGGetSeqQual
- */
-rc_t CC CGDataGetSeqQual ( const CGData* self,
-                           char sequence[/* 35 */],
-                           uint8_t quality[/* 35 */] )
-{
-    assert(self);
-    assert(sequence);
-    assert(quality);
-    assert(self->vt.v1->getSeqQual);
-    return self->vt.v1->getSeqQual(self, sequence, quality); 
-}                       
-
-/* CGGetCigar
- */
-rc_t CC CGDataGetCigar ( const CGData* self,
-                         uint32_t *cigar,
-                         uint32_t cig_max,
-                         uint32_t *cig_act )
-{
-    assert(self);
-    assert(cigar);
-    assert(cig_act);
-    assert(self->vt.v1->getCigar);
-    return self->vt.v1->getCigar(self, cigar, cig_max, cig_act);
-}                     
-
-/* CGGetAlignGroup
- */
-rc_t CC CGDataGetAlignGroup ( const CGData* self,
-                              char buffer[],
-                              size_t max_size,
-                              size_t *act_size )
-{
-    assert(self);
-    assert(act_size);
-    assert(self->vt.v1->getAlignGroup);
-    return self->vt.v1->getAlignGroup(self, buffer, max_size, act_size);
-}
-                          
-/*--------------------------------------------------------------------------
- * Rejected
- */
-
-rc_t CC RejectedInit ( Rejected *self )
-{
-    KRefcountInit ( & self -> refcount, 1, "Rejected", "RejectedInit", "");
-    StringInit(&self->source, 0, 0, 0);
-    self->message = 0;
-    self->column = 0;
-    self->line = 0;
-    self->fatal = false;
-    return 0;
-}
-
-static rc_t CC RejectedWhack ( const Rejected *self )
-{
-    free( (void*)self->source.addr );
-    free( (void*)self->message );
-    free( (void*)self );
-    return 0;
-}
-
-rc_t CC RejectedAddRef ( const Rejected *self )
-{
-    assert(self);
-    KRefcountAdd( & self->refcount, "Rejected" );
-    /* TODO: handle rc from KRefcountAdd */
-    return 0;
-}
-
-rc_t CC RejectedRelease ( const Rejected *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "Rejected" ) )
-        {
-        case krefWhack:
-            RejectedWhack( self );
-            break;
-        default:
-            /* TODO: handle other values */
-            break;
-        }
-    }
-    return 0;
-}
-
-rc_t CC RejectedGetError( const Rejected* self, const char** text, uint64_t* line, uint64_t* column, bool* fatal )
-{
-    assert(self);
-    assert(text);
-    assert(line);
-    assert(column);
-    *text = self->message;
-    *line = self->line;
-    *column = self->column;
-    *fatal = self->fatal;
-    return 0;
-}
-
-rc_t CC RejectedGetData( const Rejected* self, const void** data, size_t* length )
-{
-    assert(self);
-    assert(data);
-    assert(length);
-    *data = self->source.addr;
-    *length = StringSize( & self->source );
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * ReferenceInfo
- */
-rc_t CC ReferenceInfoAddRef ( const ReferenceInfo *self )
-{
-    assert(self);
-    assert(self->vt.v1->addRef);
-    return self->vt.v1->addRef(self);
-}
-
-rc_t CC ReferenceInfoRelease ( const ReferenceInfo *self )
-{
-    assert(self);
-    assert(self->vt.v1->release);
-    return self->vt.v1->release(self);
-}
-
-rc_t CC ReferenceInfoGetRefSeqCount ( const ReferenceInfo *self, uint32_t* count )
-{
-    assert(self);
-    assert(self->vt.v1->getRefSeqCount);
-    return self->vt.v1->getRefSeqCount(self, count);
-}
-
-rc_t CC ReferenceInfoGetRefSeq ( const ReferenceInfo *self, uint32_t n, ReferenceSequence *result )
-{
-    assert(self);
-    assert(self->vt.v1->getRefSeq);
-    return self->vt.v1->getRefSeq(self, n, result);
-}
-
-rc_t CC ReferenceInfoGetReadGroupCount ( const ReferenceInfo *self, uint32_t *count )
-{
-    assert(self);
-    assert(self->vt.v1->getReadGroupCount);
-    return self->vt.v1->getReadGroupCount(self, count);
-}
-
-rc_t CC ReferenceInfoGetReadGroup ( const ReferenceInfo *self, unsigned n, ReadGroup *result )
-{
-    assert(self);
-    assert(self->vt.v1->getReadGroup);
-    return self->vt.v1->getReadGroup(self, n, result);
-}
-
-rc_t CC ReferenceInfoGetReadGroupByName ( const ReferenceInfo *self, const char *name, ReadGroup *result )
-{
-    assert(self);
-    assert(self->vt.v1->getReadGroupByName );
-    return self->vt.v1->getReadGroupByName(self, name, result);
-}
diff --git a/libs/loader/common-writer.c b/libs/loader/common-writer.c
deleted file mode 100644
index 74ca451..0000000
--- a/libs/loader/common-writer.c
+++ /dev/null
@@ -1,2051 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
- 
-#include <sysalloc.h>
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <klib/status.h>
-
-#include <kdb/btree.h>
-
-#include <kfs/pmem.h>
-#include <kfs/file.h>
-#include <kfs/pagefile.h>
-
-#include <kapp/progressbar.h>
-#include <kapp/main.h>
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-
-#include <loader/sequence-writer.h>
-#include <loader/alignment-writer.h>
-#include <loader/reference-writer.h>
-#include <loader/common-writer.h>
-#include <loader/common-reader-priv.h>
-
-/*--------------------------------------------------------------------------
- * ctx_value_t, FragmentInfo
- */
-typedef struct {
-    uint32_t primaryId[2];
-    uint32_t spotId;
-    uint32_t fragmentId;
-    uint16_t seqHash[2];
-    uint8_t  platform;
-    uint8_t  pId_ext[2];
-    uint8_t  spotId_ext;
-    uint8_t  alignmentCount[2]; /* 0..254; 254: saturated max; 255: special meaning "too many" */
-    uint8_t  unmated: 1,
-             pcr_dup: 1,
-             has_a_read: 1,
-             unaligned_1: 1,
-             unaligned_2: 1;
-} ctx_value_t;
-
-#define CTX_VALUE_SET_P_ID(O,N,V) do { int64_t tv = (V); (O).primaryId[N] = (uint32_t)tv; (O).pId_ext[N] = tv >> 32; } while(0);
-#define CTX_VALUE_GET_P_ID(O,N) ((((int64_t)((O).pId_ext[N])) << 32) | (O).primaryId[N])
-
-#define CTX_VALUE_SET_S_ID(O,V) do { int64_t tv = (V); (O).spotId = (uint32_t)tv; (O).spotId_ext = tv >> 32; } while(0);
-#define CTX_VALUE_GET_S_ID(O) ((((int64_t)(O).spotId_ext) << 32) | (O).spotId)
-
-typedef struct FragmentInfo {
-    uint64_t ti;
-    uint32_t readlen;
-    uint8_t  aligned;
-    uint8_t  is_bad;
-    uint8_t  orientation;
-    uint8_t  otherReadNo;
-    uint8_t  sglen;
-    uint8_t  cskey;
-} FragmentInfo;
-
-
-rc_t OpenKBTree(const CommonWriterSettings* settings, struct KBTree **const rslt, size_t const n, size_t const max)
-{
-    size_t const cacheSize = (((settings->cache_size - (settings->cache_size / 2) - (settings->cache_size / 8)) / max)
-                            + 0xFFFFF) & ~((size_t)0xFFFFF);
-    KFile *file = NULL;
-    KDirectory *dir;
-    char fname[4096];
-    rc_t rc;
-
-    rc = KDirectoryNativeDir(&dir);
-    if (rc)
-        return rc;
-    
-    rc = string_printf(fname, sizeof(fname), NULL, "%s/key2id.%u.%u", settings->tmpfs, settings->pid, n); if (rc) return rc;
-    STSMSG(1, ("Path for scratch files: %s\n", fname));
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    KDirectoryRelease(dir);
-    if (rc == 0) {
-        rc = KBTreeMakeUpdate(rslt, file, cacheSize,
-                              false, kbtOpaqueKey,
-                              1, 255, sizeof ( uint32_t ),
-                              NULL
-                              );
-        KFileRelease(file);
-#if PERF
-        if (rc == 0) {
-            static unsigned treecount = 0;
-
-            (void)PLOGMSG(klogInfo, (klogInfo, "Number of trees: $(cnt)", "cnt=%u", ++treecount));
-        }
-#endif
-    }
-    return rc;
-}
-
-rc_t GetKeyIDOld(const CommonWriterSettings* settings, SpotAssembler* const ctx, uint64_t *const rslt, bool *const wasInserted, char const key[], char const name[], size_t const namelen)
-{
-    size_t const keylen = strlen(key);
-    rc_t rc;
-    uint64_t tmpKey;
-
-    if (ctx->key2id_count == 0) {
-        rc = OpenKBTree(settings, &ctx->key2id[0], 1, 1);
-        if (rc) return rc;
-        ctx->key2id_count = 1;
-    }
-    if (memcmp(key, name, keylen) == 0) {
-        /* qname starts with read group; no append */
-        tmpKey = ctx->idCount[0];
-        rc = KBTreeEntry(ctx->key2id[0], &tmpKey, wasInserted, name, namelen);
-    }
-    else {
-        char sbuf[4096];
-        char *buf = sbuf;
-        char *hbuf = NULL;
-        size_t bsize = sizeof(sbuf);
-        size_t actsize;
-        
-        if (keylen + namelen + 2 > bsize) {
-            hbuf = malloc(bsize = keylen + namelen + 2);
-            if (hbuf == NULL)
-                return RC(rcExe, rcName, rcAllocating, rcMemory, rcExhausted);
-            buf = hbuf;
-        }
-        rc = string_printf(buf, bsize, &actsize, "%s\t%.*s", key, (int)namelen, name);
-        
-        tmpKey = ctx->idCount[0];
-        rc = KBTreeEntry(ctx->key2id[0], &tmpKey, wasInserted, buf, actsize);
-        if (hbuf)
-            free(hbuf);
-    }
-    if (rc == 0) {
-        *rslt = tmpKey;
-        if (*wasInserted)
-            ++ctx->idCount[0];
-    }
-    return rc;
-}
-
-static char const *Print_ctx_value_t(ctx_value_t const *const self)
-{
-    static char buffer[4096];
-    uint8_t const *const flag = self->alignmentCount + 2;
-    rc_t rc = string_printf(buffer, sizeof(buffer), NULL,
-                            "pid: { %lu, %lu }, sid: %lu, fid: %u, alc: { %u, %u }, flg: %x",
-                            CTX_VALUE_GET_P_ID(*self, 0),
-                            CTX_VALUE_GET_P_ID(*self, 1),
-                            CTX_VALUE_GET_S_ID(*self),
-                            self->fragmentId,
-                            self->alignmentCount[0],
-                            self->alignmentCount[1],
-                            *flag);
-
-    if (rc)
-        return 0;
-    return buffer;
-}
-
-static unsigned HashKey(void const *const key, size_t const keylen)
-{
-    /* There is nothing special about this hash. It was randomly generated. */
-    static const uint8_t T1[] = {
-         64, 186,  39, 203,  54, 211,  98,  32,  26,  23, 219,  94,  77,  60,  56, 184,
-        129, 242,  10,  91,  84, 192,  19, 197, 231, 133, 125, 244,  48, 176, 160, 164,
-         17,  41,  57, 137,  44, 196, 116, 146, 105,  40, 122,  47, 220, 226, 213, 212,
-        107, 191,  52, 144,   9, 145,  81, 101, 217, 206,  85, 134, 143,  58, 128,  20,
-        236, 102,  83, 149, 148, 180, 167, 163,  12, 239,  31,   0,  73, 152,   1,  15,
-         75, 200,   4, 165,   5,  66,  25, 111, 255,  70, 174, 151,  96, 126, 147,  34,
-        112, 161, 127, 181, 237,  78,  37,  74, 222, 123,  21, 132,  95,  51, 141,  45,
-         61, 131, 193,  68,  62, 249, 178,  33,   7, 195, 228,  82,  27,  46, 254,  90,
-        185, 240, 246, 124, 205, 182,  42,  22, 198,  69, 166,  92, 169, 136, 223, 245,
-        118,  97, 115,  80, 252, 209,  49,  79, 221,  38,  28,  35,  36, 208, 187, 248,
-        158, 201, 202, 168,   2,  18, 189, 119, 216, 214,  11,   6,  89,  16, 229, 109,
-        120,  43, 162, 106, 204,   8, 199, 235, 142, 210,  86, 153, 227, 230,  24, 100,
-        224, 113, 190, 243, 218, 215, 225, 173,  99, 238, 138,  59, 183, 154, 171, 232,
-        157, 247, 233,  67,  88,  50, 253, 251, 140, 104, 156, 170, 150, 103, 117, 110,
-        155,  72, 207, 250, 159, 194, 177, 130, 135,  87,  71, 175,  14,  55, 172, 121,
-        234,  13,  30, 241,  93, 188,  53, 114,  76,  29,  65,   3, 179, 108,  63, 139
-    };
-    unsigned h = 0x55;
-    size_t i = keylen;
-    
-    do { h = T1[h ^ ((uint8_t)i)]; } while ((i >>= 8) != 0);
-
-    for (i = 0; i != keylen; ++i)
-        h = T1[h ^ ((uint8_t const *)key)[i]];
-
-    return h;
-}
-
-static unsigned SeqHashKey(void const *const key, size_t const keylen)
-{
-    /* There is nothing special about this hash. It was randomly generated. */
-    static const uint8_t T1[] = {
-         64, 186,  39, 203,  54, 211,  98,  32,  26,  23, 219,  94,  77,  60,  56, 184,
-        129, 242,  10,  91,  84, 192,  19, 197, 231, 133, 125, 244,  48, 176, 160, 164,
-         17,  41,  57, 137,  44, 196, 116, 146, 105,  40, 122,  47, 220, 226, 213, 212,
-        107, 191,  52, 144,   9, 145,  81, 101, 217, 206,  85, 134, 143,  58, 128,  20,
-        236, 102,  83, 149, 148, 180, 167, 163,  12, 239,  31,   0,  73, 152,   1,  15,
-         75, 200,   4, 165,   5,  66,  25, 111, 255,  70, 174, 151,  96, 126, 147,  34,
-        112, 161, 127, 181, 237,  78,  37,  74, 222, 123,  21, 132,  95,  51, 141,  45,
-         61, 131, 193,  68,  62, 249, 178,  33,   7, 195, 228,  82,  27,  46, 254,  90,
-        185, 240, 246, 124, 205, 182,  42,  22, 198,  69, 166,  92, 169, 136, 223, 245,
-        118,  97, 115,  80, 252, 209,  49,  79, 221,  38,  28,  35,  36, 208, 187, 248,
-        158, 201, 202, 168,   2,  18, 189, 119, 216, 214,  11,   6,  89,  16, 229, 109,
-        120,  43, 162, 106, 204,   8, 199, 235, 142, 210,  86, 153, 227, 230,  24, 100,
-        224, 113, 190, 243, 218, 215, 225, 173,  99, 238, 138,  59, 183, 154, 171, 232,
-        157, 247, 233,  67,  88,  50, 253, 251, 140, 104, 156, 170, 150, 103, 117, 110,
-        155,  72, 207, 250, 159, 194, 177, 130, 135,  87,  71, 175,  14,  55, 172, 121,
-        234,  13,  30, 241,  93, 188,  53, 114,  76,  29,  65,   3, 179, 108,  63, 139
-    };
-    unsigned h1 = 0x55;
-    unsigned h2 = 0x22;
-    size_t i = keylen;
-    
-    do { h1 = T1[h1 ^ ((uint8_t)i)]; } while ((i >>= 8) != 0);
-
-    for (i = 0; i != keylen; ++i)
-    {
-        unsigned temp = ((uint8_t const *)key)[i];
-        h1 = T1[h1 ^ temp];
-        h2 = T1[h2 ^ temp];
-    }
-
-    return (h1 << 8) | h2;
-}
-
-
-#define USE_ILLUMINA_NAMING_POUND_NUMBER_SLASH_HACK 1
-
-static size_t GetFixedNameLength(char const name[], size_t const namelen)
-{
-#if USE_ILLUMINA_NAMING_POUND_NUMBER_SLASH_HACK
-    char const *const pound = string_chr(name, namelen, '#');
-    
-    if (pound && pound + 2u < name + namelen && pound[1] >= '0' && pound[1] <= '9' && pound[2] == '/') {
-        return (size_t)(pound - name) + 2u;
-    }
-#endif
-    return namelen;
-}
-
-rc_t GetKeyID(CommonWriterSettings *const settings,
-              SpotAssembler *const ctx,
-              uint64_t *const rslt,
-              bool *const wasInserted,
-              char const key[],
-              char const name[],
-              size_t const o_namelen)
-{
-    size_t const namelen = GetFixedNameLength(name, o_namelen);
-
-    if (ctx->key2id_max == 1)
-        return GetKeyIDOld(settings, ctx, rslt, wasInserted, key, name, namelen);
-    else {
-        size_t const keylen = strlen(key);
-        unsigned const h = HashKey(key, keylen);
-        size_t f;
-        size_t e = ctx->key2id_count;
-        uint64_t tmpKey;
-        
-        *rslt = 0;
-        {{
-            uint32_t const bucket_value = ctx->key2id_hash[h];
-            unsigned const n  = (uint8_t) bucket_value;
-            unsigned const i1 = (uint8_t)(bucket_value >>  8);
-            unsigned const i2 = (uint8_t)(bucket_value >> 16);
-            unsigned const i3 = (uint8_t)(bucket_value >> 24);
-            
-            if (n > 0 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i1]) == 0) {
-                f = i1;
-                /*
-                ctx->key2id_hash[h] = (i3 << 24) | (i2 << 16) | (i1 << 8) | n;
-                 */
-                goto GET_ID;
-            }
-            if (n > 1 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i2]) == 0) {
-                f = i2;
-                ctx->key2id_hash[h] = (i3 << 24) | (i1 << 16) | (i2 << 8) | n;
-                goto GET_ID;
-            }
-            if (n > 2 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i3]) == 0) {
-                f = i3;
-                ctx->key2id_hash[h] = (i2 << 24) | (i1 << 16) | (i3 << 8) | n;
-                goto GET_ID;
-            }
-        }}
-        f = 0;
-        while (f < e) {
-            size_t const m = (f + e) / 2;
-            size_t const oid = ctx->key2id_oid[m];
-            int const diff = strcmp(key, ctx->key2id_names + ctx->key2id_name[oid]);
-            
-            if (diff < 0)
-                e = m;
-            else if (diff > 0)
-                f = m + 1;
-            else {
-                f = oid;
-                goto GET_ID;
-            }
-        }
-        if (ctx->key2id_count < ctx->key2id_max) {
-            size_t const name_max = ctx->key2id_name_max + keylen + 1;
-            KBTree *tree;
-            rc_t rc = OpenKBTree(settings, &tree, ctx->key2id_count + 1, 1); /* ctx->key2id_max); */
-            
-            if (rc) return rc;
-            
-            if (ctx->key2id_name_alloc < name_max) {
-                size_t alloc = ctx->key2id_name_alloc;
-                void *tmp;
-                
-                if (alloc == 0)
-                    alloc = 4096;
-                while (alloc < name_max)
-                    alloc <<= 1;
-                tmp = realloc(ctx->key2id_names, alloc);
-                if (tmp == NULL)
-                    return RC(rcExe, rcName, rcAllocating, rcMemory, rcExhausted);
-                ctx->key2id_names = tmp;
-                ctx->key2id_name_alloc = alloc;
-            }
-            if (f < ctx->key2id_count) {
-                memmove(&ctx->key2id_oid[f + 1], &ctx->key2id_oid[f], (ctx->key2id_count - f) * sizeof(ctx->key2id_oid[f]));
-            }
-            ctx->key2id_oid[f] = ctx->key2id_count;
-            ++ctx->key2id_count;
-            f = ctx->key2id_oid[f];
-            ctx->key2id_name[f] = ctx->key2id_name_max;
-            ctx->key2id_name_max = name_max;
-
-            memcpy(&ctx->key2id_names[ctx->key2id_name[f]], key, keylen + 1);
-            ctx->key2id[f] = tree;
-            ctx->idCount[f] = 0;
-            if ((uint8_t)ctx->key2id_hash[h] < 3) {
-                unsigned const n = (uint8_t)ctx->key2id_hash[h] + 1;
-                
-                ctx->key2id_hash[h] = (uint32_t)((((ctx->key2id_hash[h] & ~(0xFFu)) | f) << 8) | n);
-            }
-            else {
-                /* the hash function isn't working too well
-                 * keep the 3 mru
-                 */
-                ctx->key2id_hash[h] = (uint32_t)((((ctx->key2id_hash[h] & ~(0xFFu)) | f) << 8) | 3);
-            }
-        GET_ID:
-            tmpKey = ctx->idCount[f];
-            rc = KBTreeEntry(ctx->key2id[f], &tmpKey, wasInserted, name, namelen);
-            if (rc == 0) {
-                *rslt = (((uint64_t)f) << 32) | tmpKey;
-                if (*wasInserted)
-                    ++ctx->idCount[f];
-                assert(tmpKey < ctx->idCount[f]);
-            }
-            return rc;
-        }
-        return RC(rcExe, rcTree, rcAllocating, rcConstraint, rcViolated);
-    }
-}
-
-static rc_t OpenMMapFile(const CommonWriterSettings* settings, SpotAssembler *const ctx, KDirectory *const dir)
-{
-    KFile *file = NULL;
-    char fname[4096];
-    rc_t rc = string_printf(fname, sizeof(fname), NULL, "%s/id2value.%u", settings->tmpfs, settings->pid);
-    
-    if (rc)
-        return rc;
-    
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    if (rc == 0)
-        rc = MMArrayMake(&ctx->id2value, file, sizeof(ctx_value_t));
-    KFileRelease(file);
-    return rc;
-}
-
-static rc_t OpenMBankFile(const CommonWriterSettings* settings, SpotAssembler *const ctx, KDirectory *const dir, int which, size_t climit)
-{
-    KFile *file = NULL;
-    char fname[4096];
-    char const *const suffix = which == 1 ? "One" : "Both";
-    KMemBank **const mbank = which == 1 ? &ctx->fragsOne : &ctx->fragsBoth;
-    rc_t rc = string_printf(fname, sizeof(fname), NULL, "%s/frag_data%s.%u", settings->tmpfs, suffix, settings->pid);
-    
-    if (rc)
-        return rc;
-    
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    if (rc == 0) {
-        KPageFile *backing;
-        
-        rc = KPageFileMakeUpdate(&backing, file, climit, false);
-        KFileRelease(file);
-        if (rc == 0) {
-            rc = KMemBankMake(mbank, FRAG_CHUNK_SIZE, 0, backing);
-            KPageFileRelease(backing);
-        }
-    }
-    return rc;
-}
-
-rc_t SetupContext(const CommonWriterSettings* settings, SpotAssembler *ctx)
-{
-    rc_t rc = 0;
-
-    memset(ctx, 0, sizeof(*ctx));
-    
-    ctx->pass = 1;
-    
-    if (settings->mode == mode_Archive) {
-        KDirectory *dir;
-        size_t fragSizeBoth; /*** temporary hold for first side of mate pair with both sides aligned**/
-        size_t fragSizeOne; /*** temporary hold for first side of mate pair with one side aligned**/
-
-        STSMSG(1, ("Cache size: %uM\n", settings->cache_size / 1024 / 1024));
-        
-        fragSizeBoth    =   (settings->cache_size / 8);
-        fragSizeOne     =   (settings->cache_size / 2);
-
-        rc = KLoadProgressbar_Make(&ctx->progress[0], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[1], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[2], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[3], 0); if (rc) return rc;
-        
-        KLoadProgressbar_Append(ctx->progress[0], 100 * settings->numfiles);
-        
-        rc = KDirectoryNativeDir(&dir);
-        if (rc == 0)
-            rc = OpenMMapFile(settings, ctx, dir);
-        if (rc == 0)
-            rc = OpenMBankFile(settings, ctx, dir, 0, fragSizeBoth);
-        if (rc == 0)
-            rc = OpenMBankFile(settings, ctx, dir, 1, fragSizeOne);
-        KDirectoryRelease(dir);
-    }
-    return rc;
-}
-
-void ContextReleaseMemBank(SpotAssembler *ctx)
-{
-    KMemBankRelease(ctx->fragsOne);
-    ctx->fragsOne = NULL;
-    KMemBankRelease(ctx->fragsBoth);
-    ctx->fragsBoth = NULL;
-}
-
-void ContextRelease(SpotAssembler *ctx)
-{
-    KLoadProgressbar_Release(ctx->progress[0], true);
-    KLoadProgressbar_Release(ctx->progress[1], true);
-    KLoadProgressbar_Release(ctx->progress[2], true);
-    KLoadProgressbar_Release(ctx->progress[3], true);
-    MMArrayWhack(ctx->id2value);
-}
-
-static
-rc_t WriteSoloFragments(const CommonWriterSettings* settings, SpotAssembler* ctx, SequenceWriter *seq)
-{
-    uint32_t i;
-    unsigned j;
-    uint32_t fcountOne  = 0;
-    uint32_t fcountBoth = 0;
-    uint64_t idCount = 0;
-    rc_t rc;
-    KDataBuffer fragBuf;
-    SequenceRecord srec;
-    
-    ++ctx->pass;
-    memset(&srec, 0, sizeof(srec));
-    
-    rc = KDataBufferMake(&fragBuf, 8, 0);
-    if (rc) {
-        (void)LOGERR(klogErr, rc, "KDataBufferMake failed");
-        return rc;
-    }
-    for (idCount = 0, j = 0; j < ctx->key2id_count; ++j) {
-        idCount += ctx->idCount[j];
-    }
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], idCount);
-    
-    for (idCount = 0, j = 0; j < ctx->key2id_count; ++j) {
-        for (i = 0; i != ctx->idCount[j]; ++i, ++idCount) {
-            uint64_t const keyId = ((uint64_t)j << 32) | i;
-            ctx_value_t *value;
-            size_t rsize;
-            uint64_t id;
-            uint64_t sz;
-            unsigned readLen[2];
-            unsigned read = 0;
-            FragmentInfo const *fip;
-            uint8_t const *src;
-            KMemBank *frags;
-            
-            rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-            if (rc)
-                break;
-            KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-            if (value->fragmentId == 0)
-                continue;
-            if (value->fragmentId & 1) {
-                frags = ctx->fragsOne;
-                fcountOne++;
-            }
-            else {
-                frags = ctx->fragsBoth; 
-                fcountBoth++;
-            }
-            id = value->fragmentId >> 1;
-            
-            rc = KMemBankSize(frags, id, &sz);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KMemBankSize failed");
-                break;
-            }
-            rc = KDataBufferResize(&fragBuf, (size_t)sz);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KDataBufferResize failed");
-                break;
-            }
-            rc = KMemBankRead(frags, id, 0, fragBuf.base, sz, &rsize);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KMemBankRead failed");
-                break;
-            }
-            assert( rsize == sz );
-            fip = (FragmentInfo const *)fragBuf.base;
-            src = (uint8_t const *)&fip[1];
-            
-            readLen[0] = readLen[1] = 0;
-            if (!value->unmated && (   (fip->aligned && CTX_VALUE_GET_P_ID(*value, 0) == 0)
-                                     || (value->unaligned_2)))
-            {
-                read = 1;
-            }
-            
-            readLen[read] = fip->readlen;
-            rc = SequenceRecordInit(&srec, value->unmated ? 1 : 2, readLen);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "SequenceRecordInit failed");
-                break;
-            }
-            
-            srec.ti[read] = fip->ti;
-            srec.aligned[read] = fip->aligned;
-            srec.is_bad[read] = fip->is_bad;
-            srec.orientation[read] = fip->orientation;
-            srec.cskey[read] = fip->cskey;
-            memcpy(srec.seq + srec.readStart[read], src, srec.readLen[read]);
-            src += fip->readlen;
-            memcpy(srec.qual + srec.readStart[read], src, srec.readLen[read]);
-            src += fip->readlen;
-            srec.spotGroup = (char *)src;
-            srec.spotGroupLen = fip->sglen;
-            srec.keyId = keyId;
-            
-            rc = SequenceWriteRecord(seq, &srec, ctx->isColorSpace, value->pcr_dup, value->platform, 
-                                    settings->keepMismatchQual, settings->no_real_output, settings->hasTI, settings->QualQuantizer);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "SequenceWriteRecord failed");
-                break;
-            }
-            /*rc = KMemBankFree(frags, id);*/
-            CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-        }
-    }
-    /*printf("DONE_SOLO:\tcnt2=%d\tcnt1=%d\n",fcountBoth,fcountOne);*/
-    KDataBufferWhack(&fragBuf);
-    KDataBufferWhack(&srec.storage);
-    return rc;
-}
-
-static
-rc_t AlignmentUpdateSpotInfo(SpotAssembler *ctx, struct AlignmentWriter *align, uint64_t maxDistance)
-{
-    rc_t rc;
-    
-    ++ctx->pass;
-
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], ctx->alignCount);
-
-    rc = AlignmentStartUpdatingSpotIds(align);
-    while (rc == 0 && (rc = Quitting()) == 0) {
-        ctx_value_t const *value;
-        uint64_t keyId;
-        int64_t alignId;
-        bool isPrimary;
-        
-        rc = AlignmentGetSpotKey(align, &keyId, &alignId, &isPrimary);
-        if (rc) {
-            if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                rc = 0;
-            break;
-        }
-        assert(keyId >> 32 < ctx->key2id_count);
-        assert((uint32_t)keyId < ctx->idCount[keyId >> 32]);
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc == 0) {
-            int64_t const spotId = CTX_VALUE_GET_S_ID(*value);
-            int64_t const id[] = {
-                CTX_VALUE_GET_P_ID(*value, 0),
-                CTX_VALUE_GET_P_ID(*value, 1)
-            };
-            int64_t mateId = 0;
-            ReferenceStart mateGlobalRefPos;
-            
-            memset(&mateGlobalRefPos, 0, sizeof(mateGlobalRefPos));
-            if (spotId == 0) {
-                assert(!isPrimary);
-                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(id)' was never assigned a spot id, probably has no primary alignments", "id=%lx", keyId));
-                /* (void)PLOGMSG(klogWarn, (klogWarn, "Spot #$(i): { $(s) }", "i=%lu,s=%s", keyId, Print_ctx_value_t(value))); */
-            }
-            if (isPrimary) {
-                if (id[0] != 0 && id[1] != 0)
-                    mateId = alignId == id[0] ? id[1] : id[0];
-                
-                if (mateId && maxDistance && (id[0] > id[1] ? id[0] - id[1] : id[1] - id[0]) > maxDistance) {
-                    rc = AlignmentGetRefPos(align, mateId, &mateGlobalRefPos);
-                    if (rc) break;
-                }
-            }
-            rc = AlignmentUpdateInfo(align, spotId, mateId, &mateGlobalRefPos);
-        }
-        KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-    }
-    return rc;
-}
-
-rc_t SequenceUpdateAlignInfo(SpotAssembler *ctx, struct SequenceWriter *seq)
-{
-    rc_t rc = 0;
-    uint64_t row;
-    const ctx_value_t *value;
-    uint64_t keyId;
-    
-    ++ctx->pass;
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], ctx->spotId + 1);
-    
-    for (row = 1; row <= ctx->spotId; ++row) {
-        rc = SequenceReadKey(seq, row, &keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to get key for row $(row)", "row=%u", (unsigned)row));
-            break;
-        }
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to read info for row $(row), index $(idx)", "row=%u,idx=%u", (unsigned)row, (unsigned)keyId));
-            break;
-        }
-        if (row != CTX_VALUE_GET_S_ID(*value)) {
-            rc = RC(rcApp, rcTable, rcWriting, rcData, rcUnexpected);
-            (void)PLOGMSG(klogErr, (klogErr, "Unexpected spot id $(spotId) for row $(row), index $(idx)", "spotId=%u,row=%u,idx=%u", (unsigned)CTX_VALUE_GET_S_ID(*value), (unsigned)row, (unsigned)keyId));
-            break;
-        }
-        {{
-            int64_t primaryId[2];
-            /*uint64_t const spotId = CTX_VALUE_GET_S_ID(*value);*/
-            
-            primaryId[0] = CTX_VALUE_GET_P_ID(*value, 0);
-            primaryId[1] = CTX_VALUE_GET_P_ID(*value, 1);
-            
-            rc = SequenceUpdateAlignData(seq, row, value->unmated ? 1 : 2,
-                                         primaryId,
-                                         value->alignmentCount);
-        }}
-        if (rc) {
-            (void)LOGERR(klogErr, rc, "Failed updating AlignmentWriter data in sequence table");
-            break;
-        }
-        KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-    }
-    return rc;
-}
-
-void EditAlignedQualities(const CommonWriterSettings* settings, uint8_t qual[], bool const hasMismatch[], unsigned readlen) /* generic */
-{
-    unsigned i;
-    
-    for (i = 0; i < readlen; ++i) {
-        uint8_t const q = hasMismatch[i] ? settings->alignedQualValue : qual[i];
-        
-        qual[i] = q;
-    }
-}
-
-void EditUnalignedQualities(uint8_t qual[], bool const hasMismatch[], unsigned readlen) /* generic */
-{
-    unsigned i;
-    
-    for (i = 0; i < readlen; ++i) {
-        uint8_t const q = (qual[i] & 0x7F) | (hasMismatch[i] ? 0x80 : 0);
-        
-        qual[i] = q;
-    }
-}
-
-bool platform_cmp(char const platform[], char const test[])
-{
-    unsigned i;
-
-    for (i = 0; ; ++i) {
-        int ch1 = test[i];
-        int ch2 = toupper(platform[i]);
-        
-        if (ch1 != ch2)
-            break;
-        if (ch1 == 0)
-            return true;
-    }
-    return false;
-}
-
-rc_t CheckLimitAndLogError(CommonWriterSettings* settings)
-{
-    ++settings->errCount;
-    if (settings->maxErrCount > 0 && settings->errCount > settings->maxErrCount) {
-        (void)PLOGERR(klogErr, (klogErr, RC(rcAlign, rcFile, rcReading, rcError, rcExcessive), 
-                                "Number of errors $(cnt) exceeds limit of $(max): Exiting", "cnt=%lu,max=%lu", 
-                                settings->errCount, settings->maxErrCount));
-        return RC(rcAlign, rcFile, rcReading, rcError, rcExcessive);
-    }
-    return 0;
-}
-
-void RecordNoMatch(const CommonWriterSettings* settings, char const readName[], char const refName[], uint32_t const refPos)
-{
-    if (settings->noMatchLog) {
-        static uint64_t lpos = 0;
-        char logbuf[256];
-        size_t len;
-        
-        if (string_printf(logbuf, sizeof(logbuf), &len, "%s\t%s\t%u\n", readName, refName, refPos) == 0) {
-            KFileWrite(settings->noMatchLog, lpos, logbuf, len, NULL);
-            lpos += len;
-        }
-    }
-}
-
-rc_t LogNoMatch(CommonWriterSettings* settings, char const readName[], char const refName[], unsigned rpos, unsigned matches)
-{
-    rc_t const rc = CheckLimitAndLogError(settings);
-    static unsigned count = 0;
-    
-    ++count;
-    if (rc) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "This is the last warning; this class of warning occurred $(occurred) times",
-                                 "occurred=%u", count));
-        (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' contains too few ($(count)) matching bases to reference '$(ref)' at $(pos)",
-                                 "name=%s,ref=%s,pos=%u,count=%u", readName, refName, rpos, matches));
-    }
-    else if (settings->maxWarnCount_NoMatch == 0 || count < settings->maxWarnCount_NoMatch)
-        (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' contains too few ($(count)) matching bases to reference '$(ref)' at $(pos)",
-                                 "name=%s,ref=%s,pos=%u,count=%u", readName, refName, rpos, matches));
-    return rc;
-}
-
-rc_t LogDupConflict(CommonWriterSettings* settings, char const readName[])
-{
-    rc_t const rc = CheckLimitAndLogError(settings);
-    static unsigned count = 0;
-    
-    ++count;
-    if (rc) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "This is the last warning; this class of warning occurred $(occurred) times",
-                                 "occurred=%u", count));
-        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                 "Spot '$(name)' is both a duplicate and NOT a duplicate!",
-                                 "name=%s", readName));
-    }
-    else if (settings->maxWarnCount_DupConflict == 0 || count < settings->maxWarnCount_DupConflict)
-        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                 "Spot '$(name)' is both a duplicate and NOT a duplicate!",
-                                 "name=%s", readName));
-    return rc;
-}
-
-void COPY_QUAL(uint8_t D[], uint8_t const S[], unsigned const L, bool const R)
-{
-    if (R) {
-        unsigned i;
-        unsigned j;
-        
-        for (i = 0, j = L - 1; i != L; ++i, --j)
-            D[i] = S[j];
-    }
-    else
-        memcpy(D, S, L);
-}
-
-void COPY_READ(INSDC_dna_text D[], INSDC_dna_text const S[], unsigned const L, bool const R)
-{
-    static INSDC_dna_text const compl[] = {
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 , '.',  0 , 
-        '0', '1', '2', '3',  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 , 'T', 'V', 'G', 'H',  0 ,  0 , 'C', 
-        'D',  0 ,  0 , 'M',  0 , 'K', 'N',  0 , 
-         0 ,  0 , 'Y', 'S', 'A', 'A', 'B', 'W', 
-         0 , 'R',  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 , 'T', 'V', 'G', 'H',  0 ,  0 , 'C', 
-        'D',  0 ,  0 , 'M',  0 , 'K', 'N',  0 , 
-         0 ,  0 , 'Y', 'S', 'A', 'A', 'B', 'W', 
-         0 , 'R',  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0
-    };
-    if (R) {
-        unsigned i;
-        unsigned j;
-        
-        for (i = 0, j = L - 1; i != L; ++i, --j)
-            D[i] = compl[((uint8_t const *)S)[j]];
-    }
-    else
-        memcpy(D, S, L);
-}
-
-/*--------------------------------------------------------------------------
- * ArchiveFile
- */
-static uint8_t GetMapQ(Alignment const *rec)
-{
-    uint8_t mapQ;
-    
-    AlignmentGetMapQuality(rec, &mapQ);
-    return mapQ;
-}
-
-INSDC_SRA_platform_id PlatformToId(const char* name)
-{
-    if (name != NULL)
-    {
-        switch (toupper(name[0])) {
-        case 'C':
-            if (platform_cmp(name, "COMPLETE GENOMICS") || platform_cmp(name, "COMPLETE_GENOMICS"))
-                return SRA_PLATFORM_COMPLETE_GENOMICS;
-            if (platform_cmp(name, "CAPILLARY"))
-                return SRA_PLATFORM_SANGER;
-            break;
-        case 'H':
-            if (platform_cmp(name, "HELICOS"))
-                return SRA_PLATFORM_HELICOS;
-            break;
-        case 'I':
-            if (platform_cmp(name, "ILLUMINA"))
-                return SRA_PLATFORM_ILLUMINA;
-            if (platform_cmp(name, "IONTORRENT"))
-                return SRA_PLATFORM_ION_TORRENT;
-            break;
-        case 'L':
-            if (platform_cmp(name, "LS454"))
-                return SRA_PLATFORM_454;
-            break;
-        case 'P':
-            if (platform_cmp(name, "PACBIO"))
-                return SRA_PLATFORM_PACBIO_SMRT;
-            break;
-        case 'S':
-            if (platform_cmp(name, "SOLID"))
-                return SRA_PLATFORM_ABSOLID;
-            break;
-        default:
-            break;
-        }
-    }
-    return SRA_PLATFORM_UNDEFINED;
-}
-
-INSDC_SRA_platform_id GetINSDCPlatform(ReferenceInfo const *ref, char const name[]) {
-    if (ref != NULL && name != NULL) {
-        ReadGroup rg;
-
-        rc_t rc = ReferenceInfoGetReadGroupByName(ref, name, &rg);
-        if (rc == 0 && rg.platform) 
-            return PlatformToId(rg.platform) ;
-    }
-    return SRA_PLATFORM_UNDEFINED;
-}
-
-void ParseSpotName(char const name[], size_t* namelen)
-{ /* remove trailing #... */
-    const char* hash = string_chr(name, *namelen, '#');
-    if (hash)
-        *namelen = hash - name;
-}
-
-
-static const int8_t toPhred[] =
-{
-              0, 1, 1, 2, 2, 3, 3,
-     4, 4, 5, 5, 6, 7, 8, 9,10,10,
-    11,12,13,14,15,16,17,18,19,20,
-    21,22,23,24,25,26,27,28,29,30,
-    31,32,33,34,35,36,37,38,39,40
-};
-
-static int8_t LogOddsToPhred ( int8_t logOdds )
-{ /* conversion table copied from interface/ncbi/seq.vschema */
-    if (logOdds < -6)
-        return 0;
-    if (logOdds > 40)
-        return 40;
-    return toPhred[logOdds + 6];
-}
-
-rc_t ArchiveFile(const struct ReaderFile *const reader,
-                 CommonWriterSettings *const G,
-                 struct SpotAssembler *const ctx,
-                 struct Reference *const ref,
-                 struct SequenceWriter *const seq,
-                 struct AlignmentWriter *const align,
-                 bool *const had_alignments,
-                 bool *const had_sequences)
-{
-    KDataBuffer buf;
-    KDataBuffer fragBuf;
-    KDataBuffer cigBuf;
-    rc_t rc;
-    int32_t lastRefSeqId = -1;
-    size_t rsize;
-    uint64_t keyId = 0;
-    uint64_t reccount = 0;
-    SequenceRecord srec;
-    char spotGroup[512];
-    size_t namelen;
-    unsigned progress = 0;
-    unsigned warned = 0;
-    long     fcountBoth=0;
-    long     fcountOne=0;
-    int skipRefSeqID = -1;
-    uint64_t recordsProcessed = 0;
-    uint64_t filterFlagConflictRecords=0; /*** counts number of conflicts between flags 'duplicate' and 'lowQuality' ***/
-#define MAX_WARNINGS_FLAG_CONFLICT 10000 /*** maximum errors to report ***/
-
-    bool isColorSpace = false;
-    bool isNotColorSpace = G->noColorSpace;
-    char alignGroup[32];
-    size_t alignGroupLen;
-    
-    const ReferenceInfo* header = NULL;
-    
-    rc = ReaderFileGetReferenceInfo(reader, &header);
-    if (rc)
-        return rc;
-
-    if (ctx->key2id_max == 0) {
-        if (header != NULL) {
-            uint32_t rgcount;
-            unsigned rgi;
-            
-            ReferenceInfoGetReadGroupCount(header, &rgcount);
-            if (rgcount > (sizeof(ctx->key2id)/sizeof(ctx->key2id[0]) - 1))
-                ctx->key2id_max = 1;
-            else
-                ctx->key2id_max = sizeof(ctx->key2id)/sizeof(ctx->key2id[0]);
-            
-            for (rgi = 0; rgi != rgcount; ++rgi) {
-                ReadGroup rg;
-                
-                rc_t rc2 = ReferenceInfoGetReadGroup(header, rgi, &rg);
-                if (rc2 == 0 && rg.platform && platform_cmp(rg.platform, "CAPILLARY")) {
-                    G->hasTI = true;
-                    break;
-                }
-            }
-        }
-        else
-            ctx->key2id_max = 1;        
-    }
-    
-    memset(&srec, 0, sizeof(srec));
-    
-    rc = KDataBufferMake(&cigBuf, 32, 0);
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferMake(&fragBuf, 8, FRAG_CHUNK_SIZE);
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferMake(&buf, (AlignmentRecordBufferSize(1, false) + sizeof(char) + sizeof(uint8_t)) * 8, 0);
-    if (rc)
-        return rc;
-    
-    if (rc == 0) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "Loading '$(file)'", "file=%s", ReaderFileGetPathname(reader)));
-    }
-    
-    *had_alignments = false;
-    *had_sequences = false;
-    
-    while (rc == 0 && (rc = Quitting()) == 0) {
-        bool aligned;
-        AlignmentRecord data;
-        uint32_t readlen;
-        int64_t rpos=0;
-        char *seqDNA;
-        ReferenceSequence refSeq;
-        ctx_value_t *value;
-        bool wasInserted;
-        int32_t refSeqId=-1;
-        uint8_t *qual;
-        bool mated;
-        const char *name;
-        char cskey = 0;
-        bool originally_aligned;
-        bool isPrimary;
-        uint32_t opCount;
-        bool hasCG;
-        uint64_t ti = 0;
-        uint32_t csSeqLen = 0;
-        int readOrientation;
-        
-        const Record* record;
-        const Sequence* sequence = NULL;
-        const Alignment* alignment = NULL;
-        const CGData* cg = NULL;
-
-        rc = ReaderFileGetRecord(reader, &record);
-        if (rc || record == 0)
-            break;
-
-        {
-            const Rejected* rej;
-            rc = RecordGetRejected(record, &rej);
-            if (rc)
-            {
-                (void)LOGERR(klogErr, rc, "ArchiveFile: RecordGetSequence failed");
-                break;
-            }
-            if (rej != NULL)
-            {
-                const char* message;
-                uint64_t line;
-                uint64_t col;
-                bool fatal;
-                rc = RejectedGetError(rej, &message, &line, &col, &fatal);
-                if (rc)
-                {
-                    (void)LOGERR(klogErr, rc, "ArchiveFile: RejectedGetError failed");
-                    break;
-                }
-                (void)PLOGMSG(fatal ? klogErr : klogWarn, (fatal ? klogErr : klogWarn, 
-                              "$(file):$(l):$(c):$(msg)", "file=%s,l=%lu,c=%lu,msg=%s", 
-                              ReaderFileGetPathname(reader), line, col, message));
-                rc = CheckLimitAndLogError(G);
-                RejectedRelease(rej);
-                
-                if (fatal)
-                {
-                    rc = RC(rcExe, rcFile, rcParsing, rcFormat, rcUnsupported);
-                    break;
-                }
-                    
-                goto LOOP_END;
-            }
-        }
-        rc = RecordGetSequence(record, &sequence);
-        if (rc)
-        {
-            (void)LOGERR(klogErr, rc, "ArchiveFile: RecordGetSequence failed");
-            break;
-        }
-        rc = RecordGetAlignment(record, &alignment);
-        if (rc)
-        {
-            (void)LOGERR(klogErr, rc, "ArchiveFile: RecordGetAlignment failed");
-            break;
-        }
-        if (alignment != NULL)
-        {
-            rc = AlignmentGetCGData(alignment, &cg);      
-            if (rc)
-            {
-                (void)LOGERR(klogErr, rc, "ArchiveFile: AlignmentGetCG failed");
-                break;
-            }
-        }
-        
-        if ((unsigned)(ReaderFileGetProportionalPosition(reader) * 100.0) > progress) { 
-            unsigned new_value = ReaderFileGetProportionalPosition(reader) * 100.0;
-            KLoadProgressbar_Process(ctx->progress[0], new_value - progress, false);
-            progress = new_value;
-        }
-
-
-        /**************************************************************/
-        if (!G->noColorSpace) {
-            if (SequenceIsColorSpace(sequence)) {
-                if (isNotColorSpace) {
-                MIXED_BASE_AND_COLOR:
-                    rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);  
-                    (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)' contains base space and color space", "file=%s", ReaderFileGetPathname(reader)));
-                    goto LOOP_END;
-                }
-                ctx->isColorSpace = isColorSpace = true;
-            }
-            else if (isColorSpace)
-                goto MIXED_BASE_AND_COLOR;
-            else
-                isNotColorSpace = true;
-        }
-        hasCG = cg != NULL;
-        if (hasCG) {
-            AlignmentGetAlignOpCount(alignment, &opCount);
-            rc = KDataBufferResize(&cigBuf, opCount * 2 + 5);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize CIGAR buffer");
-                goto LOOP_END;
-            }
-            
-            rc = KDataBufferResize(&buf, readlen = 35);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize record buffer");
-                goto LOOP_END;
-            }
-            
-            AlignmentRecordInit(&data, buf.base, readlen, &seqDNA, G->expectUnsorted, G->compressQuality);
-            qual = (uint8_t *)&seqDNA[readlen];
-        }
-        else {
-            if (alignment != 0)
-            {
-                uint32_t const *tmp;
-                AlignmentGetBAMCigar(alignment, &tmp, &opCount);
-                rc = KDataBufferResize(&cigBuf, opCount);
-                if (rc) {
-                    (void)LOGERR(klogErr, rc, "Failed to resize CIGAR buffer");
-                    goto LOOP_END;
-                }
-                memcpy(cigBuf.base, tmp, opCount * sizeof(uint32_t));
-            }
-            
-            SequenceGetReadLength(sequence, &readlen);
-            if (isColorSpace) {
-                SequenceGetCSReadLength(sequence, &csSeqLen);
-                if (readlen > csSeqLen) {
-                    rc = RC(rcAlign, rcRow, rcReading, rcData, rcInconsistent);
-                    (void)LOGERR(klogErr, rc, "SequenceWriter length and CS SequenceWriter length are inconsistent");
-                    goto LOOP_END;
-                }
-                else if (readlen < csSeqLen)
-                {
-                    readlen = 0; /* will be hard clipped */
-                }
-            }
-            else if (readlen == 0) {
-            }
-            rc = KDataBufferResize(&buf, readlen | csSeqLen);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize record buffer");
-                goto LOOP_END;
-            }
-            
-            AlignmentRecordInit(&data, buf.base, readlen | csSeqLen, &seqDNA, G->expectUnsorted, G->compressQuality);
-            qual = (uint8_t *)&seqDNA[readlen | csSeqLen];
-        }
-        SequenceGetSpotName(sequence, &name, &namelen);
-        if (G->parseSpotName)
-            ParseSpotName(name, &namelen);
-        SequenceGetRead(sequence, seqDNA);
-        
-        {
-            int8_t const *squal;
-            uint8_t qoffset = 0;
-            int qualType=0;            
-            unsigned i;
-            
-            rc = SequenceGetQuality(sequence, &squal, &qoffset, &qualType);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Spot '$(name)': length of original quality does not match sequence", 
-                                                        "name=%.*s", (uint32_t)namelen, name));
-                rc = CheckLimitAndLogError(G);
-                goto LOOP_END;
-            }
-            else if (squal == NULL)
-                memset(qual, 0, readlen);
-            else 
-            {  
-                if (G->useQUAL)
-                    memcpy(qual, squal, readlen);
-                else
-                {
-                    switch (qualType)
-                    {
-                    case QT_LogOdds:
-                        for (i = 0; i != readlen; ++i)
-                            qual[i] = LogOddsToPhred(squal[i]);
-                        break;
-                        
-                    case QT_Phred:
-                        if (qoffset) {
-                            for (i = 0; i != readlen; ++i)
-                                qual[i] = squal[i] - qoffset;
-                        }
-                        else
-                            memcpy(qual, squal, readlen);
-                        break;
-                        
-                    default:
-                        memcpy(qual, squal, readlen);
-                        break;
-                    }
-                }
-            }
-        }
-        
-        if (hasCG) {
-            rc = CGDataGetSeqQual(cg, seqDNA, qual);
-            if (rc == 0)
-                rc = CGDataGetCigar(cg, cigBuf.base, cigBuf.elem_count, &opCount);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to read CG data");
-                goto LOOP_END;
-            }
-        }
-        if (G->hasTI) {
-            rc = SequenceGetTI(sequence, &ti);
-            if (rc)
-                ti = 0;
-            rc = 0;
-        }
-        data.data.align_group.buffer = alignGroup;
-        if (hasCG && CGDataGetAlignGroup(cg, alignGroup, sizeof(alignGroup), &alignGroupLen) == 0)
-            data.data.align_group.elements = alignGroupLen;
-        else
-            data.data.align_group.elements = 0;
-
-        if (alignment != 0)
-            AR_MAPQ(data) = GetMapQ(alignment);
-        {{
-            char const *rgname;
-            size_t rgnamelen;
-
-            SequenceGetSpotGroup(sequence, &rgname, &rgnamelen);
-            if (rgname)
-            {
-                string_copy(spotGroup, sizeof(spotGroup), rgname, rgnamelen);
-                spotGroup[rgnamelen] = '\0';
-            }
-            else
-                spotGroup[0] = '\0';
-        }}        
-        readOrientation = SequenceGetOrientationSelf(sequence);
-        AR_REF_ORIENT(data) = readOrientation == ReadOrientationReverse;
-        isPrimary = alignment == 0 || ! AlignmentIsSecondary(alignment);
-        if (G->noSecondary && !isPrimary)
-            goto LOOP_END;
-        originally_aligned = (alignment != 0);
-        aligned = originally_aligned && (AR_MAPQ(data) >= G->minMapQual);
-        
-        if (isColorSpace && readlen == 0)   /* detect hard clipped colorspace   */
-            aligned = false;                /* reads and make unaligned         */
-
-        if (aligned && align == NULL) {
-            rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);
-            (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)' contains aligned records", "file=%s", ReaderFileGetPathname(reader)));
-            goto LOOP_END;
-        }
-        if (header != NULL)
-        {
-            while (aligned) {
-                AlignmentGetPosition(alignment, &rpos);
-                AlignmentGetRefSeqId(alignment, &refSeqId);
-                if (rpos >= 0 && refSeqId >= 0) {
-                    if (refSeqId == skipRefSeqID)
-                        goto LOOP_END;
-                    if (refSeqId == lastRefSeqId)
-                        break;
-                    rc = ReferenceInfoGetRefSeq(header, refSeqId, &refSeq);
-                    if (rc != 0) {
-                        rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);
-                        (void)PLOGERR(klogWarn, (klogWarn, rc, "File '$(file)': Spot '$(name)' refers to an unknown Reference number $(refSeqId)", "file=%s,refSeqId=%i,name=%s", ReaderFileGetPathname(reader), (int)refSeqId, name));
-                        rc = CheckLimitAndLogError(G);
-                        goto LOOP_END;
-                    }
-                    else {
-                        if (G->refFilter && strcmp(G->refFilter, refSeq.name) != 0) {
-                            (void)PLOGMSG(klogInfo, (klogInfo, "Skipping Reference '$(name)'", "name=%s", refSeq.name));
-                            skipRefSeqID = refSeqId;
-                            goto LOOP_END;
-                        }
-                        
-                        rc = ReferenceSetFile(ref, refSeq.name, refSeq.length, refSeq.checksum, G->maxSeqLen);
-                        if (rc == 0) {
-                            lastRefSeqId = refSeqId;
-                            break;
-                        }
-                        if (GetRCObject(rc) == rcConstraint && GetRCState(rc) == rcViolated) {
-                            int const level = G->limit2config ? klogWarn : klogErr;
-                            
-                            (void)PLOGMSG(level, (level, "Could not find a Reference to match { name: '$(name)', length: $(rlen) }", "name=%s,rlen=%u", refSeq.name, (unsigned)refSeq.length));
-                        }
-                        else if (!G->limit2config)
-                            (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)': Spot '$(sname)' refers to an unknown Reference '$(rname)'", "file=%s,rname=%s,sname=%s", ReaderFileGetPathname(reader), refSeq.name, name));
-                        if (G->limit2config)
-                            rc = 0;
-                        goto LOOP_END;
-                    }
-                }
-                else {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' was marked aligned, but reference id = $(id) and reference position = $(pos) are invalid", "name=%.*s,id=%i,pos=%i", namelen, name, refSeqId, rpos));
-                    if ((rc = CheckLimitAndLogError(G)) != 0) goto LOOP_END;
-                }
-
-                aligned = false;
-            }
-        }
-        if (!aligned && (G->refFilter != NULL || G->limit2config))
-            goto LOOP_END;
-        
-        rc = GetKeyID(G, ctx, &keyId, &wasInserted, spotGroup, name, namelen);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "KBTreeEntry: failed on key '$(key)'", "key=%.*s", namelen, name));
-            goto LOOP_END;
-        }
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "MMArrayGet: failed on id '$(id)'", "id=%u", keyId));
-            goto LOOP_END;
-        }
-        
-        AR_KEY(data) = keyId;
-        
-        mated = false;
-        if (SequenceWasPaired(sequence)) {
-            if (SequenceIsFirst(sequence))
-                AR_READNO(data) |= 1;
-            if (SequenceIsSecond(sequence))
-                AR_READNO(data) |= 2;
-            switch (AR_READNO(data)) {
-            case 1:
-            case 2:
-                mated = true;
-                break;
-            case 0:
-                if ((warned & 1) == 0) {
-                    (void)LOGMSG(klogWarn, "Spots without fragment info have been encountered");
-                    warned |= 1;
-                }
-                break;
-            case 3:
-                if ((warned & 2) == 0) {
-                    (void)LOGMSG(klogWarn, "Spots with more than two fragments have been encountered");
-                    warned |= 2;
-                }
-                break;
-            }
-        }
-        if (!mated)
-            AR_READNO(data) = 1;
-        
-        if (wasInserted) {
-            memset(value, 0, sizeof(*value));
-            value->unmated = !mated;
-            value->pcr_dup = SequenceIsDuplicate(sequence);
-            value->platform = GetINSDCPlatform(header, spotGroup);
-            if (value->platform == SRA_PLATFORM_UNDEFINED)
-                value->platform = G->platform;
-        }
-        else {
-            if (!G->acceptBadDups && value->pcr_dup != SequenceIsDuplicate(sequence)) {
-                rc = LogDupConflict(G, name);
-                goto LOOP_END; /* TODO: is this correct? */
-            }
-            value->pcr_dup &= SequenceIsDuplicate(sequence);
-            if (mated && value->unmated) {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                         "Spot '$(name)', which was first seen without mate info, now has mate info",
-                                         "name=%s", name));
-                rc = CheckLimitAndLogError(G);
-                goto LOOP_END;
-            }
-            else if (!mated && !value->unmated) {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                         "Spot '$(name)', which was first seen with mate info, now has no mate info",
-                                         "name=%s", name));
-                rc = CheckLimitAndLogError(G);
-                goto LOOP_END;
-            }
-        }
-        
-        ++recordsProcessed;
-
-        if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                if (CTX_VALUE_GET_P_ID(*value, 0) != 0)
-                {
-                    isPrimary = false;
-                    if (value->seqHash[0] != SeqHashKey(seqDNA, readlen))
-                    {
-                        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                                 "Read 1 of spot '$(name)', possible sequence mismatch", "name=%s", name));
-                        rc = CheckLimitAndLogError(G);
-                        goto LOOP_END;
-                    }
-                }
-                else if (aligned && value->unaligned_1) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Read 1 of spot '$(name)', which was unmapped, is now being mapped at position $(pos) on reference '$(ref)'; this alignment will be considered as secondary", "name=%s,ref=%s,pos=%u", name, refSeq.name, rpos));
-                    isPrimary = false;
-                }
-                break;
-            case 2:
-                if (CTX_VALUE_GET_P_ID(*value, 1) != 0)
-                {
-                    isPrimary = false;
-                    if (value->seqHash[1] != SeqHashKey(seqDNA, readlen))
-                    {
-                        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                                 "Read 2 of spot '$(name)', possible sequence mismatch", "name=%s", name));
-                        rc = CheckLimitAndLogError(G);
-                        goto LOOP_END;
-                    }
-                }
-                else if (aligned && value->unaligned_2) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Read 2 of spot '$(name)', which was unmapped, is now being mapped at position $(pos) on reference '$(ref)'; this alignment will be considered as secondary", "name=%s,ref=%s,pos=%u", name, refSeq.name, rpos));
-                    isPrimary = false;
-                }
-                break;
-            default:
-                break;
-            }
-        }
-        data.isPrimary = isPrimary;
-        if (aligned) {
-            uint32_t matches = 0;
-            
-            rc = ReferenceRead(ref, &data, rpos, cigBuf.base, opCount, seqDNA, readlen, &matches, G->acceptNoMatch, G->minMatchCount, G->maxSeqLen);
-            if (rc) {
-                aligned = false;
-                
-                if (   (GetRCState(rc) == rcViolated  && GetRCObject(rc) == rcConstraint)
-                    || (GetRCState(rc) == rcExcessive && GetRCObject(rc) == rcRange))
-                {
-                    RecordNoMatch(G, name, refSeq.name, rpos);
-                }
-                if (GetRCState(rc) == rcViolated && GetRCObject(rc) == rcConstraint) {
-                    rc = LogNoMatch(G, name, refSeq.name, (unsigned)rpos, (unsigned)matches);
-                }
-                else if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInvalid) {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': bad alignment to reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq.name, rpos));
-                    rc = CheckLimitAndLogError(G);
-                }
-                else if (GetRCObject(rc) == rcData) {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': bad alignment to reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq.name, rpos));
-                    rc = CheckLimitAndLogError(G);
-                }
-                else {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': error reading reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq.name, rpos));
-                    rc = CheckLimitAndLogError(G);
-                }
-                if (rc) goto LOOP_END;
-            }
-        }
-        if (isColorSpace) {
-            /* must be after ReferenceRead */
-            SequenceGetCSKey(sequence, &cskey);
-            SequenceGetCSRead(sequence, seqDNA);
-            if (!aligned && !G->useQUAL) {
-                int8_t const *squal;
-                uint8_t qoffset = 0;
-                int qualType=0;                
-                
-                rc = SequenceGetCSQuality(sequence, &squal, &qoffset, &qualType);
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Spot '$(name)': length of colorspace quality does not match sequence", "name=%s", name));
-                    goto LOOP_END;
-                }
-                if (qoffset) {
-                    unsigned i;
-                    
-                    for (i = 0; i < csSeqLen; ++i)
-                        qual[i] = squal[i] - qoffset;
-                }
-                else if (squal != NULL)
-                    memcpy(qual, squal, csSeqLen);
-                readlen = csSeqLen;
-            }
-        }
-        
-        if (aligned) {
-            if (G->editAlignedQual ) EditAlignedQualities  (G, qual, AR_HAS_MISMATCH(data), readlen);
-            if (G->keepMismatchQual) EditUnalignedQualities(qual, AR_HAS_MISMATCH(data), readlen);
-            AR_NUM_MISMATCH_QUAL(data) = (AR_MISMATCH_QUAL(data) == NULL) ? (size_t)0 : ReferenceMgr_CompressHelper(AR_MISMATCH_QUAL(data), &data.data, qual);
-        }
-        else if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                value->unaligned_1 = 1;
-                break;
-            case 2:
-                value->unaligned_2 = 1;
-                break;
-            default:
-                break;
-            }
-        }
-        if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                if (CTX_VALUE_GET_P_ID(*value, 0) == 0 && aligned) {
-                    data.alignId = ++ctx->primaryId;
-                    CTX_VALUE_SET_P_ID(*value, 0, data.alignId);
-                }
-                break;
-            case 2:
-                if (CTX_VALUE_GET_P_ID(*value, 1) == 0 && aligned) {
-                    data.alignId = ++ctx->primaryId;
-                    CTX_VALUE_SET_P_ID(*value, 1, data.alignId);
-                }
-                break;
-            default:
-                break;
-            }
-        }
-        if (mated) {
-            if (isPrimary || !originally_aligned) {
-                if (value->spotId != 0) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' has already been assigned a spot id", "name=%.*s", namelen, name));
-                }
-                else if (!value->has_a_read) {
-                    /* new mated fragment - do spot assembly */
-                    unsigned sz;
-                    uint64_t    fragmentId;
-                    FragmentInfo fi;
-                    KMemBank *frags;
-                    int32_t mate_refSeqId = -1;
-                    int64_t pnext = 0;
-                    
-                    value->seqHash[AR_READNO(data) - 1] = SeqHashKey(seqDNA, readlen);
-                    
-                    memset(&fi, 0, sizeof(fi));
-                    fi.aligned = aligned;
-                    fi.ti = ti;
-                    fi.orientation = readOrientation;
-                    fi.otherReadNo = AR_READNO(data);
-                    fi.sglen   = strlen(spotGroup);
-                    fi.readlen = readlen;
-                    fi.cskey = cskey;
-                    fi.is_bad = SequenceIsLowQuality(sequence);
-                    sz = sizeof(fi) + 2*fi.readlen + fi.sglen;
-                    if (align && aligned) {
-                        AlignmentGetMateRefSeqId(alignment, &mate_refSeqId);
-                        AlignmentGetMatePosition(alignment, &pnext);
-                    }
-                    if(align && aligned && mate_refSeqId == refSeqId && pnext > 0 && pnext!=rpos /*** weird case in some bams**/){ 
-                        frags = ctx->fragsBoth;
-                        rc = KMemBankAlloc(frags, &fragmentId, sz, 0);
-                        value->fragmentId = fragmentId*2;
-                        fcountBoth++;
-                    } else {
-                        frags = ctx->fragsOne;
-                        rc = KMemBankAlloc(frags, &fragmentId, sz, 0);
-                        value->fragmentId = fragmentId*2+1;
-                        fcountOne++;
-                    }
-                    if (rc) {
-                        (void)LOGERR(klogErr, rc, "KMemBankAlloc failed");
-                        goto LOOP_END;
-                    }
-                    /*printf("IN:%10d\tcnt2=%ld\tcnt1=%ld\n",value->fragmentId,fcountBoth,fcountOne);*/
-                    
-                    rc = KDataBufferResize(&fragBuf, sz);
-                    if (rc) {
-                        (void)LOGERR(klogErr, rc, "Failed to resize fragment buffer");
-                        goto LOOP_END;
-                    }
-                    {{
-                        uint8_t *dst = (uint8_t*) fragBuf.base;
-                        memcpy(dst,&fi,sizeof(fi));
-                        dst += sizeof(fi);
-                        COPY_READ((char *)dst, seqDNA, fi.readlen, (isColorSpace && !aligned) ? 0 : fi.orientation == ReadOrientationReverse);
-                        dst += fi.readlen;
-                        COPY_QUAL(dst, qual, fi.readlen, (isColorSpace && !aligned) ? 0 : fi.orientation == ReadOrientationReverse);
-                        dst += fi.readlen;
-                        memcpy(dst,spotGroup,fi.sglen);
-                    }}
-                    rc = KMemBankWrite(frags, fragmentId, 0, fragBuf.base, sz, &rsize);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankWrite failed writing fragment $(id)", "id=%u", fragmentId));
-                        goto LOOP_END;
-                    }
-                    value->has_a_read = 1;
-                }
-                else if (value->fragmentId != 0 ) {
-                    /* might be second fragment */
-                    uint64_t sz;
-                    FragmentInfo *fip;
-                    KMemBank *frags;
-                    
-                    if(value->fragmentId & 1) frags = ctx->fragsOne;
-                    else               frags = ctx->fragsBoth; 
-                    
-                    rc=KMemBankSize(frags, value->fragmentId>>1, &sz);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankSize failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                        goto LOOP_END;
-                    }
-                    rc=KDataBufferResize(&fragBuf, (size_t)sz);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to resize fragment buffer", ""));
-                        goto LOOP_END;
-                    }
-                    rc=KMemBankRead(frags, value->fragmentId>>1, 0, fragBuf.base, sz, &rsize);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankRead failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                        goto LOOP_END;
-                    }
-                    
-                    assert( rsize == sz );
-                    fip = (FragmentInfo *) fragBuf.base;
-                    if(AR_READNO(data) != fip->otherReadNo) {
-                        /* mate found */
-                        unsigned readLen[2];
-                        unsigned read1 = 0;
-                        unsigned read2 = 1;
-                        uint8_t  *src  = (uint8_t*) fip + sizeof(*fip);
-                        
-                        value->seqHash[AR_READNO(data) - 1] = SeqHashKey(seqDNA, readlen);
-                        
-                        if (AR_READNO(data) < fip->otherReadNo) {
-                            read1 = 1;
-                            read2 = 0;
-                        }
-                        readLen[read1] = fip->readlen;
-                        readLen[read2] = readlen;
-                        rc = SequenceRecordInit(&srec, 2, readLen);
-                        if (rc) {
-                            (void)PLOGERR(klogErr, (klogErr, rc, "Failed resizing sequence record buffer", ""));
-                            goto LOOP_END;
-                        }
-                        srec.ti[read1] = fip->ti;
-                        srec.aligned[read1] = fip->aligned;
-                        srec.is_bad[read1] = fip->is_bad;
-                        srec.orientation[read1] = fip->orientation;
-                        srec.cskey[read1] = fip->cskey;
-                        memcpy(srec.seq + srec.readStart[read1], src, fip->readlen);
-                        src += fip->readlen;
-                        memcpy(srec.qual + srec.readStart[read1], src, fip->readlen);
-                        src += fip->readlen;
-                        
-                        srec.orientation[read2] = readOrientation;
-                        COPY_READ(srec.seq + srec.readStart[read2], 
-                                  seqDNA, 
-                                  srec.readLen[read2], 
-                                  (isColorSpace && !aligned) ? 0 : srec.orientation[read2] == ReadOrientationReverse);
-                        COPY_QUAL(srec.qual + srec.readStart[read2], 
-                                  qual, 
-                                  srec.readLen[read2],  
-                                  (isColorSpace && !aligned) ? 0 : srec.orientation[read2] == ReadOrientationReverse);
-
-                        srec.keyId = keyId;
-                        srec.is_bad[read2] = SequenceIsLowQuality(sequence);
-                        srec.aligned[read2] = aligned;
-                        srec.cskey[read2] = cskey;
-                        srec.ti[read2] = ti;
-                        
-                        srec.spotGroup = spotGroup;
-                        srec.spotGroupLen = strlen(spotGroup);
-                        if (value->pcr_dup && (srec.is_bad[0] || srec.is_bad[1])) {
-                            filterFlagConflictRecords++;
-                            if(filterFlagConflictRecords < MAX_WARNINGS_FLAG_CONFLICT){
-                                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)': both 'duplicate' and 'lowQuality' flag bits set, only 'duplicate' will be saved", "name=%s", name));
-                            } else if(filterFlagConflictRecords == MAX_WARNINGS_FLAG_CONFLICT){
-                                (void)PLOGMSG(klogWarn, (klogWarn, "Last reported warning: Spot '$(name)': both 'duplicate' and 'lowQuality' flag bits set, only 'duplicate' will be saved", "name=%s", name));
-                            }
-                        }
-                        rc = SequenceWriteRecord(seq, &srec, isColorSpace, value->pcr_dup, value->platform, 
-                                                G->keepMismatchQual, G->no_real_output, G->hasTI, G->QualQuantizer);
-                        if (rc) {
-                            (void)LOGERR(klogErr, rc, "SequenceWriteRecord failed");
-                            goto LOOP_END;
-                        }
-                        CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-                        if(value->fragmentId & 1){
-                            fcountOne--;
-                        } else {
-                            fcountBoth--;
-                        }
-                        /*  printf("OUT:%9d\tcnt2=%ld\tcnt1=%ld\n",value->fragmentId,fcountBoth,fcountOne);*/
-                        rc = KMemBankFree(frags, value->fragmentId>>1);
-                        if (rc) {
-                            (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankFree failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                            goto LOOP_END;
-                        }
-                        value->fragmentId = 0;
-                    }
-                }
-            }
-            if (!isPrimary && aligned) {
-                int32_t bam_mrid;
-                int64_t mpos;
-                int64_t mrid;
-                int64_t tlen;
-                
-                AlignmentGetMatePosition(alignment, &mpos);
-                AlignmentGetMateRefSeqId(alignment, &bam_mrid);
-                AlignmentGetInsertSize(alignment, &tlen);
-                
-                if (mpos >= 0 && bam_mrid >= 0 && tlen != 0 && header != NULL) {
-                    ReferenceSequence mref;
-                    if (ReferenceInfoGetRefSeq(header, bam_mrid, &mref) == 0) {
-                        rc_t rc_temp = ReferenceGet1stRow(ref, &mrid, mref.name);
-                        if (rc_temp == 0) {
-                            data.mate_ref_pos = mpos;
-                            data.template_len = tlen;
-                            data.mate_ref_orientation = (SequenceGetOrientationMate(sequence) == ReadOrientationReverse);
-                        }
-                        else {
-                            (void)PLOGERR(klogWarn, (klogWarn, rc_temp, "Failed to get refID for $(name)", "name=%s", mref.name));
-                            mrid = 0;
-                        }
-                        data.mate_ref_id = mrid;
-                    }
-                }
-            }
-        }
-        else if (wasInserted & (isPrimary || !originally_aligned)) {
-            /* new unmated fragment - no spot assembly */
-            unsigned readLen[1];
-
-            value->seqHash[0] = SeqHashKey(seqDNA, readlen);
-            
-            readLen[0] = readlen;
-            rc = SequenceRecordInit(&srec, 1, readLen);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failed resizing sequence record buffer", ""));
-                goto LOOP_END;
-            }
-            srec.ti[0] = ti;
-            srec.aligned[0] = aligned;
-            srec.is_bad[0] = SequenceIsLowQuality(sequence);
-            srec.orientation[0] = readOrientation;
-            srec.cskey[0] = cskey;
-            COPY_READ(srec.seq  + srec.readStart[0], seqDNA, readlen, (isColorSpace && !aligned) ? 0 : srec.orientation[0] == ReadOrientationReverse);
-            COPY_QUAL(srec.qual + srec.readStart[0], qual, readlen, (isColorSpace && !aligned) ? 0 : srec.orientation[0] == ReadOrientationReverse);
-         
-            srec.keyId = keyId;
-            
-            srec.spotGroup = spotGroup;
-            srec.spotGroupLen = strlen(spotGroup);
-            if (value->pcr_dup && srec.is_bad[0]) {
-                filterFlagConflictRecords++;
-                if (filterFlagConflictRecords < MAX_WARNINGS_FLAG_CONFLICT) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)': both 'duplicate' and 'lowQuality' flag bits set, only 'duplicate' will be saved", "name=%s", name));
-                }
-                else if (filterFlagConflictRecords == MAX_WARNINGS_FLAG_CONFLICT) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Last reported warning: Spot '$(name)': both 'duplicate' and 'lowQuality' flag bits set, only 'duplicate' will be saved", "name=%s", name));
-        }
-            }
-            rc = SequenceWriteRecord(seq, &srec, isColorSpace, value->pcr_dup, value->platform, 
-                                                G->keepMismatchQual, G->no_real_output, G->hasTI, G->QualQuantizer);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "SequenceWriteRecord failed", ""));
-                goto LOOP_END;
-            }
-            CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-            value->fragmentId = 0;
-        }
-        
-        if (aligned) {
-            if (value->alignmentCount[AR_READNO(data) - 1] < 254)
-                ++value->alignmentCount[AR_READNO(data) - 1];
-            ++ctx->alignCount;
-            
-            assert(keyId >> 32 < ctx->key2id_count);
-            assert((uint32_t)keyId < ctx->idCount[keyId >> 32]);
-            
-            rc = AlignmentWriteRecord(align, &data, G->expectUnsorted);
-            if (rc == 0) {
-                if (!isPrimary)
-                    data.alignId = ++ctx->secondId;
-                
-                rc = ReferenceAddAlignId(ref, data.alignId, isPrimary);
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "ReferenceAddAlignId failed", ""));
-                }
-                else {
-                    *had_alignments = true;
-                }
-            }
-            else {
-                (void)PLOGERR(klogErr, (klogErr, rc, "AlignmentWriteRecord failed", ""));
-            }
-        }
-        /**************************************************************/
-        
-    LOOP_END:
-        RecordRelease(record);
-        if (sequence != NULL)
-            SequenceRelease(sequence);
-        if (alignment != NULL)
-            AlignmentRelease(alignment);
-        if (cg != NULL)
-            CGDataRelease(cg);
-        
-        ++reccount;
-        if (G->maxAlignCount > 0 && reccount >= G->maxAlignCount)
-            break;
-        if (rc == 0)
-            *had_sequences = true;
-    }
-    
-    if (header != NULL)
-        ReferenceInfoRelease(header);
-    
-    if (filterFlagConflictRecords > 0) {
-        (void)PLOGMSG(klogWarn, (klogWarn, "$(cnt1) out of $(cnt2) records contained warning : both 'duplicate' and 'lowQuality' flag bits set, only 'duplicate' will be saved", "cnt1=%lu,cnt2=%lu", filterFlagConflictRecords,recordsProcessed));
-    }
-    if (rc == 0 && recordsProcessed == 0) {
-        (void)LOGMSG(klogWarn, (G->limit2config || G->refFilter != NULL) ? 
-                     "All records from the file were filtered out" :
-                     "The file contained no records that were processed.");
-        rc = RC(rcAlign, rcFile, rcReading, rcData, rcEmpty);
-    }
-    if (rc == 0 && reccount > 0) {
-        double percentage = ((double)G->errCount) / reccount; 
-        double allowed = G->maxErrPct/ 100.0;
-        if (percentage > allowed) {
-            rc = RC(rcExe, rcTable, rcClosing, rcData, rcInvalid);
-            (void)PLOGERR(klogErr, 
-                            (klogErr, rc,
-                             "Too many bad records: "
-                                 "records: $(records), bad records: $(bad_records), "
-                                 "bad records percentage: $(percentage), "
-                                 "allowed percentage: $(allowed)",
-                             "records=%lu,bad_records=%lu,percentage=%.2f,allowed=%.2f",
-                             reccount, G->errCount, percentage, allowed));
-        }
-    }
-
-    KDataBufferWhack(&buf);
-    KDataBufferWhack(&fragBuf);
-    KDataBufferWhack(&srec.storage);
-    KDataBufferWhack(&cigBuf);
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * CommonWriter
- */
- 
-rc_t CommonWriterInit(CommonWriter* self, struct VDBManager *mgr, struct VDatabase *db, const CommonWriterSettings* G)
-{
-    rc_t rc; 
-    assert(self);
-    assert(mgr);
-    assert(db);
-    
-    memset(self, 0, sizeof(*self));
-    if (G)
-        self->settings = *G;
-
-    self->ref = malloc(sizeof(*self->ref));
-    if (self->ref == 0)
-        return RC(rcAlign, rcArc, rcAllocating, rcMemory, rcExhausted);
-        
-    rc = ReferenceInit(self->ref, 
-                       mgr, 
-                       db, 
-                       self->settings.expectUnsorted, 
-                       self->settings.acceptHardClip, 
-                       self->settings.refXRefPath, 
-                       self->settings.inpath, 
-                       self->settings.maxSeqLen, 
-                       self->settings.refFiles);
-    if (rc == 0)
-    {
-        self->seq = malloc(sizeof(*self->seq));
-        if (self->seq == 0)
-        {
-            ReferenceWhack(self->ref, false, 0, NULL);
-            free(self->ref);
-            return RC(rcAlign, rcArc, rcAllocating, rcMemory, rcExhausted);
-        }
-        SequenceWriterInit(self->seq, db);
-        
-        self->align = AlignmentMake(db);
-        if (self->align == 0)
-        {
-            ReferenceWhack(self->ref, false, 0, NULL);
-            free(self->ref);
-            
-            SequenceWhack(self->seq, false);
-            free(self->seq);
-            
-            return RC(rcAlign, rcArc, rcAllocating, rcMemory, rcExhausted);
-        }
-        
-        rc = SetupContext(&self->settings, &self->ctx);
-        if (rc != 0)
-        {
-            ReferenceWhack(self->ref, false, 0, NULL);
-            free(self->ref);
-            
-            SequenceWhack(self->seq, false);
-            free(self->seq);
-            
-            AlignmentWhack(self->align, false);
-        }
-    }
-    if (self->settings.tmpfs == NULL)
-        self->settings.tmpfs = "/tmp";
-
-    self->commit = true;
-    
-    return rc;
-}
-
-rc_t CommonWriterArchive(CommonWriter *const self,
-                         const struct ReaderFile *const reader)
-{
-    rc_t rc;
-
-    assert(self);
-    rc = ArchiveFile(reader,
-                     &self->settings,
-                     &self->ctx,
-                     self->ref,
-                     self->seq,
-                     self->align,
-                     &self->had_alignments,
-                     &self->had_sequences);
-    if (rc)
-        self->commit = false;
-    
-    self->err_count += self->settings.errCount;
-    return rc;
-}
-
-rc_t CommonWriterComplete(CommonWriter* self, bool quitting, uint64_t maxDistance)
-{
-    rc_t rc=0;
-    /*** No longer need memory for key2id ***/
-    size_t i;
-    for (i = 0; i != self->ctx.key2id_count; ++i) {
-        KBTreeDropBacking(self->ctx.key2id[i]);
-        KBTreeRelease(self->ctx.key2id[i]);
-        self->ctx.key2id[i] = NULL;
-    }
-    free(self->ctx.key2id_names);
-    self->ctx.key2id_names = NULL;
-    /*******************/
-
-    if (self->had_sequences) {
-        if (!quitting) {
-            (void)LOGMSG(klogInfo, "Writing unpaired sequences");
-            rc = WriteSoloFragments(&self->settings, &self->ctx, self->seq);
-            ContextReleaseMemBank(&self->ctx);
-            if (rc == 0) {
-                rc = SequenceDoneWriting(self->seq);
-                if (rc == 0) {
-                    (void)LOGMSG(klogInfo, "Updating sequence alignment info");
-                    rc = SequenceUpdateAlignInfo(&self->ctx, self->seq);
-                }
-            }
-        }
-        else
-            ContextReleaseMemBank(&self->ctx);
-    }
-    
-    if (self->had_alignments && !quitting) {
-        (void)LOGMSG(klogInfo, "Writing alignment spot ids");
-        rc = AlignmentUpdateSpotInfo(&self->ctx, self->align, maxDistance);
-    }
-
-    return rc;
-}
-
-rc_t CommonWriterWhack(CommonWriter* self)
-{
-    rc_t rc = 0;
-    assert(self);
-    
-    ContextRelease(&self->ctx);
-    
-    if (self->align)
-        rc = AlignmentWhack(self->align, self->commit);
-        
-    if (self->seq)
-    {
-        SequenceWhack(self->seq, self->commit);
-        free(self->seq);
-    }
-
-    if (self->ref)
-    {
-        rc_t rc2 = ReferenceWhack(self->ref, self->commit, self->settings.maxSeqLen, Quitting);
-        if (rc == 0)
-            rc = rc2;
-        free(self->ref);
-    }
-
-    return rc;
-}
-
diff --git a/libs/loader/mmarray.c b/libs/loader/mmarray.c
deleted file mode 100644
index 9a62fd2..0000000
--- a/libs/loader/mmarray.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <loader/mmarray.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-
-#include <klib/rc.h>
-
-#include <kfs/mmap.h>
-#include <kfs/file.h>
-
-#define MMA_NUM_CHUNKS_BITS (24u)
-#define MMA_NUM_SUBCHUNKS_BITS ((32u)-(MMA_NUM_CHUNKS_BITS))
-#define MMA_SUBCHUNK_SIZE (1u << MMA_NUM_CHUNKS_BITS)
-#define MMA_SUBCHUNK_COUNT (1u << MMA_NUM_SUBCHUNKS_BITS)
-
-typedef struct MMArray {
-    KFile *fp;
-    size_t elemSize;
-    uint64_t fsize;
-    struct mma_map_s {
-        struct mma_submap_s {
-            uint8_t *base;
-            KMMap *mmap;
-        } submap[MMA_SUBCHUNK_COUNT];
-    } map[NUM_ID_SPACES];
-} MMArray;
-
-rc_t MMArrayMake(struct MMArray **rslt, KFile *fp, uint32_t elemSize)
-{
-    MMArray *const self = calloc(1, sizeof(*self));
-
-    if (self == NULL)
-        return RC(rcExe, rcMemMap, rcConstructing, rcMemory, rcExhausted);
-    self->elemSize = (elemSize + 3) & ~(3u); /** align to 4 byte **/
-    self->fp = fp;
-    KFileAddRef(fp);
-    *rslt = self;
-    return 0;
-}
-
-#define PERF 0
-
-rc_t MMArrayGet(struct MMArray *const self, void **const value, uint64_t const element)
-{
-    unsigned const bin_no = element >> 32;
-    unsigned const subbin = ((uint32_t)element) >> MMA_NUM_CHUNKS_BITS;
-    unsigned const in_bin = (uint32_t)element & (MMA_SUBCHUNK_SIZE - 1);
-
-    if (bin_no >= sizeof(self->map)/sizeof(self->map[0]))
-        return RC(rcExe, rcMemMap, rcConstructing, rcId, rcExcessive);
-    
-    if (self->map[bin_no].submap[subbin].base == NULL) {
-        size_t const chunk = MMA_SUBCHUNK_SIZE * self->elemSize;
-        size_t const fsize = self->fsize + chunk;
-        rc_t rc = KFileSetSize(self->fp, fsize);
-        
-        if (rc == 0) {
-            KMMap *mmap;
-            
-            self->fsize = fsize;
-            rc = KMMapMakeRgnUpdate(&mmap, self->fp, self->fsize, chunk);
-            if (rc == 0) {
-                void *base;
-                
-                rc = KMMapAddrUpdate(mmap, &base);
-                if (rc == 0) {
-#if PERF
-                    static unsigned mapcount = 0;
-
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Number of mmaps: $(cnt)", "cnt=%u", ++mapcount));
-#endif
-                    self->map[bin_no].submap[subbin].mmap = mmap;
-                    self->map[bin_no].submap[subbin].base = base;
-
-                    goto GET_MAP;
-                }
-                KMMapRelease(mmap);
-            }
-        }
-        return rc;
-    }
-GET_MAP:
-    *value = &self->map[bin_no].submap[subbin].base[(size_t)in_bin * self->elemSize];
-    return 0;
-}
-
-void MMArrayWhack(struct MMArray *self)
-{
-    unsigned i;
-
-    for (i = 0; i != sizeof(self->map)/sizeof(self->map[0]); ++i) {
-        unsigned j;
-        
-        for (j = 0; j != sizeof(self->map[0].submap)/sizeof(self->map[0].submap[0]); ++j) {
-            if (self->map[i].submap[j].mmap)
-                KMMapRelease(self->map[i].submap[j].mmap);
-            self->map[i].submap[j].mmap = NULL;
-            self->map[i].submap[j].base = NULL;
-        }
-    }
-    KFileRelease(self->fp);
-    free(self);
-}
-
-
diff --git a/libs/loader/reference-writer.c b/libs/loader/reference-writer.c
deleted file mode 100644
index 8a41009..0000000
--- a/libs/loader/reference-writer.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <kfs/file.h>
-
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <align/writer-refseq.h>
-
-#include <loader/reference-writer.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-#define SORTED_OPEN_TABLE_LIMIT (2)
-#define SORTED_CACHE_SIZE ((2 * 1024 * 1024)/(SORTED_OPEN_TABLE_LIMIT))
-
-#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
-#define UNSORTED_OPEN_TABLE_LIMIT (8)
-#define UNSORTED_CACHE_SIZE ((1024 * 1024 * 1024)/(UNSORTED_OPEN_TABLE_LIMIT))
-#else
-#define UNSORTED_OPEN_TABLE_LIMIT (64)
-#define UNSORTED_CACHE_SIZE (350 * 1024 * 1024)
-#endif
-
-#if _DEBUGGING
-#define DUMP_CONFIG 1
-#endif
-
-struct overlap_s {
-    uint32_t min; /* minimum start pos of any alignment that ends in this chunk */
-    uint32_t max; /* maximum end pos of any alignment that starts before this chunk and ends in this chunk */
-};
-
-extern void ReferenceMgr_DumpConfig(ReferenceMgr const *const self);
-
-rc_t ReferenceInit(Reference *self, 
-                   const VDBManager *mgr, 
-                   VDatabase *db, 
-                   bool expectUnsorted,
-                   bool acceptHardClip,
-                   char const *refXRefPath,
-                   char const *inpath,
-                   uint32_t maxSeqLen,
-                   char const** refFiles
-                   )
-{
-    rc_t rc;
-    size_t const cache = expectUnsorted ? UNSORTED_CACHE_SIZE : SORTED_CACHE_SIZE;
-    unsigned const open_count = expectUnsorted ? UNSORTED_OPEN_TABLE_LIMIT : SORTED_OPEN_TABLE_LIMIT;
-    
-    memset(self, 0, sizeof(*self));
-    
-    self->coverage.elem_bits = self->mismatches.elem_bits = self->indels.elem_bits = 32;
-    self->pri_align.elem_bits = self->sec_align.elem_bits = 64;
-    self->pri_overlap.elem_bits = self->sec_overlap.elem_bits = sizeof(struct overlap_s) * 8;
-    
-    self->acceptHardClip = acceptHardClip;
-    
-    rc = ReferenceMgr_Make(&self->mgr, db, mgr, 
-                           ewrefmgr_co_Coverage,
-                           refXRefPath, inpath,
-                           maxSeqLen, cache, open_count);
-    if (rc == 0 && refFiles != NULL) {
-        unsigned i;
-        
-        for (i = 0; refFiles[i]; ++i) {
-            rc = ReferenceMgr_FastaPath(self->mgr, refFiles[i]);
-            if (rc) {
-                (void)PLOGERR(klogWarn, (klogWarn, rc, "fasta file '$(file)'", "file=%s", refFiles[i]));
-                break;
-            }
-        }
-#if DUMP_CONFIG
-        if (rc == 0) {
-            ReferenceMgr_DumpConfig(self->mgr);
-        }
-#endif
-    }
-    return rc;
-}
-
-static
-void Unsorted(Reference *self) {
-    (void)LOGMSG(klogWarn, "Alignments are unsorted");
-    self->out_of_order = true;
-    ReferenceMgr_SetCache(self->mgr, UNSORTED_CACHE_SIZE, UNSORTED_OPEN_TABLE_LIMIT);
-    KDataBufferWhack(&self->sec_align);
-    KDataBufferWhack(&self->pri_align);
-    KDataBufferWhack(&self->mismatches);
-    KDataBufferWhack(&self->indels);
-    KDataBufferWhack(&self->coverage);
-    KDataBufferWhack(&self->pri_overlap);
-    KDataBufferWhack(&self->sec_overlap);
-}
-
-#define BAIL_ON_FAIL(STMT) do { rc_t const rc__ = (STMT); if (rc__) return rc__; } while(0)
-
-static rc_t FlushBuffers(Reference *self, uint64_t upto, bool full, bool final, uint32_t maxSeqLen)
-{
-    if (!self->out_of_order && upto > 0) {
-        size_t offset = 0;
-        unsigned *const miss = (unsigned *)self->mismatches.base;
-        unsigned *const indel = (unsigned *)self->indels.base;
-        unsigned *const cov = (unsigned *)self->coverage.base;
-        struct overlap_s *const pri_overlap = (struct overlap_s *)self->pri_overlap.base;
-        struct overlap_s *const sec_overlap = (struct overlap_s *)self->sec_overlap.base;
-        unsigned chunk = 0;
-        
-        while ((self->curPos + offset + (full ? 0 : maxSeqLen)) <= upto) {
-            ReferenceSeqCoverage data;
-            uint64_t const curPos = self->curPos + offset;
-            unsigned const n = self->endPos > (curPos + maxSeqLen) ?
-                               maxSeqLen : (self->endPos - curPos);
-            unsigned const m = curPos + n > upto ? upto - curPos : n;
-            unsigned i;
-            unsigned hi;
-            unsigned lo;
-            
-            if (n == 0) break;
-            
-            memset(&data, 0, sizeof(data));
-            
-            data.ids[ewrefcov_primary_table].elements = self->pri_align.elem_count;
-            data.ids[ewrefcov_primary_table].buffer = self->pri_align.base;
-            data.overlap_ref_pos[ewrefcov_primary_table] = pri_overlap[chunk].min;
-            data.overlap_ref_len[ewrefcov_primary_table] = pri_overlap[chunk].max ? pri_overlap[chunk].max - curPos : 0;
-            
-            data.ids[ewrefcov_secondary_table].elements = self->sec_align.elem_count;
-            data.ids[ewrefcov_secondary_table].buffer = self->sec_align.base;
-            data.overlap_ref_pos[ewrefcov_secondary_table] = sec_overlap[chunk].min;
-            data.overlap_ref_len[ewrefcov_secondary_table] = sec_overlap[chunk].max ? sec_overlap[chunk].max - curPos : 0;
-            
-            for (hi = 0, lo = UINT_MAX, i = 0; i != m; ++i) {
-                unsigned const coverage = cov[offset + i];
-                
-                if (hi < coverage)
-                    hi = coverage;
-                if (lo > coverage)
-                    lo = coverage;
-            }
-            data.low  = lo > 255 ? 255 : lo;
-            data.high = hi > 255 ? 255 : hi;
-            
-            for (i = 0; i != m; ++i)
-                data.mismatches += miss[offset + i];
-
-            for (i = 0; i != m; ++i)
-                data.indels += indel[offset + i];
-            
-            {
-                rc_t rc = ReferenceSeq_AddCoverage(self->rseq, curPos, &data);
-                
-                if (rc) {
-                    Unsorted(self);
-                    return 0;
-                }
-            }
-            
-            KDataBufferResize(&self->pri_align, 0);
-            KDataBufferResize(&self->sec_align, 0);
-            offset += n;
-            ++chunk;
-        }
-        if (!final && offset > 0) {
-            unsigned const newChunkCount = self->pri_overlap.elem_count - chunk;
-            unsigned const newBaseCount = self->endPos - self->curPos - offset;
-            
-            memmove(self->pri_overlap.base, pri_overlap + chunk, newChunkCount * sizeof(pri_overlap[0]));
-            memmove(self->sec_overlap.base, sec_overlap + chunk, newChunkCount * sizeof(sec_overlap[0]));
-            memmove(self->mismatches.base, miss + offset, newBaseCount * sizeof(miss[0]));
-            memmove(self->indels.base, indel + offset, newBaseCount * sizeof(indel[0]));
-            memmove(self->coverage.base, cov + offset, newBaseCount * sizeof(cov[0]));
-
-            KDataBufferResize(&self->pri_overlap, newChunkCount);
-            KDataBufferResize(&self->sec_overlap, newChunkCount);
-            
-            self->curPos += offset;
-        }
-    }
-    return 0;
-}
-
-rc_t ReferenceSetFile(Reference *self, const char id[],
-                      uint64_t length, uint8_t const md5[16], uint32_t maxSeqLen)
-{
-    const ReferenceSeq *rseq;
-    unsigned n;
-    
-    for (n = 0; ; ++n) {
-        if (self->last_id[n] != id[n])
-            break;
-        if (self->last_id[n] == 0 && id[n] == 0)
-            return 0;
-    }
-    while (id[n])
-        ++n;
-    if (n >= sizeof(self->last_id))
-        return RC(rcApp, rcTable, rcAccessing, rcParam, rcTooLong);
-    
-    BAIL_ON_FAIL(FlushBuffers(self, self->length, true, true, maxSeqLen));
-    BAIL_ON_FAIL(ReferenceMgr_GetSeq(self->mgr, &rseq, id));
-
-    if (self->rseq)
-        ReferenceSeq_Release(self->rseq);
-    self->rseq = rseq;
-    
-    memcpy(self->last_id, id, n + 1);
-    self->curPos = self->endPos = 0;
-    self->length = length;
-    self->lastOffset = 0;
-
-    if(!self->out_of_order) (void)PLOGMSG(klogInfo, (klogInfo, "Processing Reference '$(id)'", "id=%s", id));
-    
-    return 0;
-}
-
-rc_t ReferenceVerify(Reference const *self, char const id[], uint64_t length, uint8_t const md5[16])
-{
-    return ReferenceMgr_Verify(self->mgr, id, length, md5);
-}
-
-rc_t ReferenceGet1stRow(Reference const *self, int64_t *refID, char const refName[])
-{
-    const ReferenceSeq* rseq;
-    rc_t rc = ReferenceMgr_GetSeq(self->mgr, &rseq, refName);
-    if( rc == 0 ) {
-        rc = ReferenceSeq_Get1stRow(rseq, refID);
-        ReferenceSeq_Release(rseq);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceAddCoverage(Reference *const self,
-                          unsigned const refStart,
-                          unsigned const refLength,
-                          uint32_t const mismatches,
-                          uint32_t const indels,
-                          bool const isPrimary,
-                          uint32_t maxSeqLen
-                          )
-{
-    unsigned const refEnd = refStart + refLength;
-    
-    if (refEnd > self->endPos) {
-        unsigned const t1 = refEnd + (maxSeqLen - 1);
-        unsigned const adjust = t1 % maxSeqLen;
-        unsigned const newEndPos = t1 - adjust;
-        unsigned const baseCount = self->endPos - self->curPos;
-        unsigned const newBaseCount = newEndPos - self->curPos;
-        
-        BAIL_ON_FAIL(KDataBufferResize(&self->coverage, newBaseCount));
-        BAIL_ON_FAIL(KDataBufferResize(&self->mismatches, newBaseCount));
-        BAIL_ON_FAIL(KDataBufferResize(&self->indels, newBaseCount));
-        
-        memset(&((unsigned *)self->coverage.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        memset(&((unsigned *)self->mismatches.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        memset(&((unsigned *)self->indels.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        self->endPos = newEndPos;
-    }
-    if ((refEnd - self->curPos) / maxSeqLen >= self->pri_overlap.elem_count) {
-        unsigned const chunks = (refEnd - self->curPos) / maxSeqLen + 1;
-        unsigned const end = self->pri_overlap.elem_count;
-        
-        BAIL_ON_FAIL(KDataBufferResize(&self->pri_overlap, chunks));
-        BAIL_ON_FAIL(KDataBufferResize(&self->sec_overlap, chunks));
-        
-        memset(&((struct overlap_s *)self->pri_overlap.base)[end], 0, (chunks - end) * sizeof(struct overlap_s));
-        memset(&((struct overlap_s *)self->sec_overlap.base)[end], 0, (chunks - end) * sizeof(struct overlap_s));
-    }
-    BAIL_ON_FAIL(FlushBuffers(self, refStart, false, false, maxSeqLen));
-    if (!self->out_of_order) {
-        unsigned const startBase = refStart - self->curPos;
-        unsigned const endChunk = (startBase + refLength) / maxSeqLen;
-        KDataBuffer *const overlapBuffer = isPrimary ? &self->pri_overlap : &self->sec_overlap;
-        unsigned *const cov = &((unsigned *)self->coverage.base)[startBase];
-        unsigned i;
-        
-        ((unsigned *)self->mismatches.base)[startBase] += mismatches;
-        ((unsigned *)self->indels.base)[startBase] += indels;
-        
-        if (((struct overlap_s *)overlapBuffer->base)[endChunk].min == 0 || 
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].min > refStart)
-        {
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].min = refStart;
-        }
-        if (endChunk != 0 &&
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].max < refStart + refLength)
-        {
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].max = refStart + refLength;
-        }
-        
-        for (i = 0; i != refLength; ++i) {
-            if (cov[i] < UINT_MAX)
-                ++cov[i];
-        }
-    }
-    return 0;
-}
-
-static void GetCounts(AlignmentRecord const *data, unsigned const seqLen,
-                      unsigned *const nMatch,
-                      unsigned *const nMiss,
-                      unsigned *const nIndels)
-{
-    bool const *has_mismatch = data->data.has_mismatch.buffer;
-    bool const *has_offset = data->data.has_ref_offset.buffer;
-    int32_t const *ref_offset = data->data.ref_offset.buffer;
-    unsigned const n = data->data.ref_offset.elements;
-    unsigned const left_clip = (n != 0 && has_offset[0] && ref_offset[0] < 0) ? -ref_offset[0] : 0;
-    int right_edge;
-    unsigned nmis;
-    unsigned nmatch;
-    unsigned i;
-    unsigned j;
-    
-    for (right_edge = data->data.ref_len, i = 0; i != n; ++i)
-        right_edge -= ref_offset[i];
-    if (right_edge > seqLen)
-        right_edge = seqLen;
-    for (j = left_clip ? 1 : 0, i = left_clip, nmatch = nmis = 0; i < right_edge; ) {
-        if (has_offset[i]) {
-            int const offs = ref_offset[j++];
-            
-            if (offs < 0) {
-                i += (unsigned)(-offs);
-                continue;
-            }
-        }
-        if (has_mismatch[i])
-            ++nmis;
-        else
-            ++nmatch;
-        ++i;
-    }
-    *nMatch = nmatch;
-    *nMiss = nmis;
-    *nIndels = n - (left_clip ? 1 : 0);
-}
-
-rc_t ReferenceRead(Reference *self, AlignmentRecord *data, uint64_t const pos,
-                   uint32_t const rawCigar[], uint32_t const cigCount,
-                   char const seqDNA[], uint32_t const seqLen, uint32_t *matches,
-                   bool acceptNoMatch, unsigned minMatchCount, uint32_t maxSeqLen)
-{
-    *matches = 0;
-    BAIL_ON_FAIL(ReferenceSeq_Compress(self->rseq, 
-                                       (self->acceptHardClip ? ewrefmgr_co_AcceptHardClip : 0) + ewrefmgr_cmp_Binary, 
-                                       pos,
-                                       seqDNA, seqLen, rawCigar, cigCount, 0, NULL, 0, 0, NULL, 0, &data->data));
-
-    if (!acceptNoMatch && data->data.ref_len == 0)
-        return RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
-    
-    if (!self->out_of_order && pos < self->lastOffset) {
-        Unsorted(self);
-    }
-    if (self->out_of_order)
-        return 0;
-    else {
-        unsigned nmis;
-        unsigned nmatch;
-        unsigned indels;
-
-        self->lastOffset = data->data.effective_offset;
-        GetCounts(data, seqLen, &nmatch, &nmis, &indels);
-        *matches = nmatch;
-        
-        if (acceptNoMatch || nmatch >= minMatchCount)
-            return ReferenceAddCoverage(self, data->data.effective_offset,
-                                        data->data.ref_len, nmis, indels,
-                                        data->isPrimary, maxSeqLen);
-        else
-            return RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
-    }
-}
-
-static rc_t IdVecAppend(KDataBuffer *vec, uint64_t id)
-{
-    uint64_t const end = vec->elem_count;
-    
-    BAIL_ON_FAIL(KDataBufferResize(vec, end + 1));
-    ((uint64_t *)vec->base)[end] = id;
-    return 0;
-}
-
-rc_t ReferenceAddAlignId(Reference *self,
-                         int64_t align_id,
-                         bool is_primary
-                         )
-{
-    if (self->out_of_order)
-        return 0;
-    return IdVecAppend(is_primary ? &self->pri_align : &self->sec_align, align_id);
-}
-
-rc_t ReferenceWhack(Reference *self, bool commit, uint32_t maxSeqLen,
-                    rc_t (*const quitting)(void)
-                    )
-{
-    rc_t rc = 0;
-    
-    if (self) {
-#if DUMP_CONFIG
-        if (self->mgr)
-            ReferenceMgr_DumpConfig(self->mgr);
-#endif
-        if (commit) {
-            rc = FlushBuffers(self, self->length, true, true, maxSeqLen);
-            if (rc != 0)
-                commit = false;
-        }
-        KDataBufferWhack(&self->sec_align);
-        KDataBufferWhack(&self->pri_align);
-        KDataBufferWhack(&self->mismatches);
-        KDataBufferWhack(&self->indels);
-        KDataBufferWhack(&self->coverage);
-        KDataBufferWhack(&self->pri_overlap);
-        KDataBufferWhack(&self->sec_overlap);
-        if (self->rseq)
-            rc = ReferenceSeq_Release(self->rseq);
-        if (self->out_of_order) {
-            (void)LOGMSG(klogInfo, "Starting coverage calculation");
-            rc = ReferenceMgr_Release(self->mgr, commit, NULL, true, quitting);
-        }
-        else {
-            rc = ReferenceMgr_Release(self->mgr, commit, NULL, false, NULL);
-        }
-    }
-    return rc;
-}
diff --git a/libs/loader/sequence-writer.c b/libs/loader/sequence-writer.c
deleted file mode 100644
index a5f3e1b..0000000
--- a/libs/loader/sequence-writer.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <vdb/database.h>
-
-#include <kdb/manager.h>
-
-#include <insdc/sra.h>
-#include <insdc/insdc.h>
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-#include <ctype.h>
-
-#include <align/writer-sequence.h>
-
-#include <loader/sequence-writer.h>
-#include <loader/common-reader.h>
-
-/* MARK: SequenceWriter Object */
-
-SequenceWriter *SequenceWriterInit(SequenceWriter *self, VDatabase *db) {
-    memset(self, 0, sizeof(*self));
-    self->db = db;
-    VDatabaseAddRef(db);
-    return self;
-}
-
-rc_t SequenceWriteRecord(SequenceWriter *self,
-                         SequenceRecord const *rec,
-                         bool color,
-                         bool isDup,
-                         INSDC_SRA_platform_id platform,
-                         bool keepMismatchQual,
-                         bool no_real_output,
-                         bool hasTI,
-                         char const *QualQuantizer
-                         )
-{
-    rc_t rc = 0;
-    uint8_t nreads = rec->numreads;
-    unsigned i;
-    unsigned seqLen;
-    int64_t dummyRowId;
-    
-    uint8_t readInfo[4096];
-    void *h_readInfo = NULL;
-    
-    INSDC_coord_zero *readStart = (void *)readInfo;
-    INSDC_coord_len *readLen;
-    uint8_t *alcnt;
-    INSDC_SRA_xread_type *readType;
-    INSDC_SRA_read_filter *readFilter;
-    bool *mask = NULL;
-    size_t const elemSize = sizeof(alcnt[0]) + sizeof(readType[0])
-                          + sizeof(readStart[0]) + sizeof(readLen[0])
-                          + sizeof(readFilter[0]);
-    
-    TableWriterSeqData data;
-
-    for (i = seqLen = 0; i != nreads; ++i) {
-        seqLen += rec->readLen[i];
-    }
-    
-    if (nreads * elemSize + keepMismatchQual * seqLen * sizeof(mask[0]) > sizeof(readInfo))
-    {
-        h_readInfo = malloc(nreads * elemSize + keepMismatchQual * seqLen * sizeof(mask[0]));
-        if (h_readInfo == NULL)
-            return RC(rcAlign, rcTable, rcWriting, rcMemory, rcExhausted);
-        readStart = h_readInfo;
-    }
-    readLen = (INSDC_coord_len *)&readStart[nreads];
-    alcnt = (uint8_t *)&readLen[nreads];
-    readType = (INSDC_SRA_xread_type *)&alcnt[nreads];
-    readFilter = (INSDC_SRA_read_filter *)&readType[nreads];
-    
-    if (keepMismatchQual) {
-        mask = (bool *)&readFilter[nreads];
-        
-        for (i = 0; i != seqLen; ++i) {
-            mask[i] = (rec->qual[i] & 0x80) != 0;
-        }
-    }
-    
-    for (i = 0; i != nreads; ++i) {
-        alcnt[i] = rec->aligned[i] ? 1 : 0;
-        readLen[i] = rec->readLen[i];
-        readStart[i] = rec->readStart[i];
-        readType[i] = readLen[i] ? SRA_READ_TYPE_BIOLOGICAL : SRA_READ_TYPE_TECHNICAL;
-        switch ( rec->orientation[i] )
-        {
-            case ReadOrientationForward:
-                readType[i] |= SRA_READ_TYPE_FORWARD;
-                break;
-            case ReadOrientationReverse:
-                readType[i] |= SRA_READ_TYPE_REVERSE;
-                break;
-            case ReadOrientationUnknown:
-            default:
-                break;
-        }
-        readFilter[i] = isDup ? SRA_READ_FILTER_CRITERIA
-                      : rec->is_bad[i] ? SRA_READ_FILTER_REJECT : SRA_READ_FILTER_PASS;
-    }
-
-    memset(&data, 0, sizeof(data));
-    
-    data.sequence.buffer = rec->seq;
-    data.sequence.elements = seqLen;
-    
-    data.quality.buffer = rec->qual;
-    data.quality.elements = seqLen;
-    
-    if (keepMismatchQual) {
-        data.no_quantize_mask.buffer = mask;
-        data.no_quantize_mask.elements = seqLen;
-    }
-    
-    data.alignment_count.buffer = alcnt;
-    data.alignment_count.elements = nreads;
-    
-    data.nreads = nreads;
-    
-    data.read_type.buffer = readType;
-    data.read_type.elements = nreads;
-    
-    data.read_start.buffer = readStart;
-    data.read_start.elements = nreads;
-    
-    data.read_len.buffer = readLen;
-    data.read_len.elements = nreads;
-    
-    data.tmp_key_id = rec->keyId;
-    
-    data.spot_group.buffer = rec->spotGroup;
-    data.spot_group.elements = rec->spotGroupLen;
-    
-    data.cskey.buffer = rec->cskey;
-    data.cskey.elements = nreads;
-    
-    data.read_filter.buffer = readFilter;
-    data.read_filter.elements = nreads;
-    
-    data.platform.buffer = &platform;
-    data.platform.elements = 1;
-    
-    data.ti.buffer = rec->ti;
-    data.ti.elements = nreads;
-    
-    if (!no_real_output) {
-        if (self->tbl == NULL) {
-            int csoption = (color ? ewseq_co_ColorSpace : 0);
-
-	    if(hasTI) csoption |= ewseq_co_TI;
-            
-            rc = TableWriterSeq_Make(&self->tbl, self->db,
-                                     csoption | ewseq_co_NoLabelData | ewseq_co_SpotGroup, QualQuantizer);
-        }
-        if (rc == 0) {
-            rc = TableWriterSeq_Write(self->tbl, &data, &dummyRowId);
-        }
-    }
-    
-    if (h_readInfo)
-        free(h_readInfo);
-    
-    return rc;
-}
-
-rc_t SequenceDoneWriting(SequenceWriter *self)
-{
-    return TableWriterSeq_TmpKeyStart(self->tbl);
-}
-
-rc_t SequenceReadKey(const SequenceWriter *cself, int64_t row, uint64_t *keyId)
-{
-    return TableWriterSeq_TmpKey(cself->tbl, row, keyId);
-}
-
-rc_t SequenceUpdateAlignData(SequenceWriter *self, int64_t rowId, unsigned nreads,
-                             int64_t const primeId[/* nreads */],
-                             uint8_t const algnCnt[/* nreads */])
-{
-    TableWriterData data[2];
-    
-    data[0].buffer = primeId; data[0].elements = nreads;
-    data[1].buffer = algnCnt; data[1].elements = nreads;
-    
-    return TableWriterSeq_WriteAlignmentData(self->tbl, rowId, &data[0], &data[1]);
-}
-
-void SequenceWhack(SequenceWriter *self, bool commit) {
-    uint64_t dummyRows;
-    rc_t rc;
-    
-    VDatabaseRelease(self->db);
-    
-    if (self->tbl == NULL)
-        return;
-    
-    rc = TableWriterSeq_Whack(self->tbl, commit, &dummyRows);
-}
-
-/* MARK: SequenceRecord Object */
-static
-rc_t SequenceRecordResize(SequenceRecord *self,
-                          KDataBuffer *storage,
-                          unsigned numreads,
-                          unsigned seqLen)
-{
-    size_t sz;
-    rc_t rc;
-    
-    sz = seqLen * (sizeof(self->seq[0]) + sizeof(self->qual[0])) +
-         numreads * (sizeof(self->ti) +
-                     sizeof(self->readStart[0]) +
-                     sizeof(self->readLen[0]) +
-                     sizeof(self->aligned[0]) + 
-                     sizeof(self->orientation[0]) +
-                     sizeof(self->alignmentCount[0]) +
-                     sizeof(self->cskey[0])
-                     );
-    storage->elem_bits = 8;
-    rc = KDataBufferResize(storage, sz);
-    if (rc)
-        return rc;
-    self->numreads = numreads;
-    
-    self->ti = (uint64_t *)storage->base;
-    self->readStart = (uint32_t *)&self->ti[numreads];
-    self->readLen = (uint32_t *)&self->readStart[numreads];
-    self->aligned = (bool *)&self->readLen[numreads];
-    self->orientation = (uint8_t *)&self->aligned[numreads];
-    self->is_bad = (uint8_t *)&self->orientation[numreads];
-    self->alignmentCount = (uint8_t *)&self->is_bad[numreads];
-    self->cskey = (char *)&self->alignmentCount[numreads];
-    self->seq = (char *)&self->cskey[numreads];
-    self->qual = (uint8_t *)&self->seq[seqLen];
-
-    self->spotGroup = NULL;
-    self->spotGroupLen = 0;
-    
-    return 0;
-}
-
-rc_t SequenceRecordInit(SequenceRecord *self, unsigned numreads, unsigned readLen[])
-{
-    unsigned i;
-    unsigned seqlen = 0;
-    rc_t rc;
-    
-    for (i = 0; i != numreads; ++i) {
-        seqlen += readLen[i];
-    }
-    rc = SequenceRecordResize(self, &self->storage, numreads, seqlen);
-    if (rc)
-        return rc;
-    memset(self->storage.base, 0, KDataBufferBytes(&self->storage));
-    
-    for (seqlen = 0, i = 0; i != numreads; ++i) {
-        self->readLen[i] = readLen[i];
-        self->readStart[i] = seqlen;
-        seqlen += readLen[i];
-    }
-    self->numreads = numreads;
-    memset(self->cskey, 'T', numreads);
-    return 0;
-}
-
-rc_t SequenceRecordAppend(SequenceRecord *self,
-                          const SequenceRecord *other
-                          )
-{
-    /* save the locations of the original data */
-    unsigned const seq = (uint8_t const *)self->seq - (uint8_t const *)self->storage.base;
-    unsigned const qual = (uint8_t const *)self->qual - (uint8_t const *)self->storage.base;
-    unsigned const cskey = (uint8_t const *)self->cskey - (uint8_t const *)self->storage.base;
-    unsigned const alignmentCount = (uint8_t const *)self->alignmentCount - (uint8_t const *)self->storage.base;
-    unsigned const is_bad = (uint8_t const *)self->is_bad - (uint8_t const *)self->storage.base;
-    unsigned const orientation = (uint8_t const *)self->orientation - (uint8_t const *)self->storage.base;
-    unsigned const aligned = (uint8_t const *)self->aligned - (uint8_t const *)self->storage.base;
-    unsigned const ti = (uint8_t const *)self->ti - (uint8_t const *)self->storage.base;
-    unsigned const readLen = (uint8_t const *)self->readLen - (uint8_t const *)self->storage.base;
-/*    unsigned const readStart = (uint8_t const *)self->readStart - (uint8_t const *)self->storage.base;*/
-
-    rc_t rc;
-    unsigned seqlen;
-    unsigned otherSeqlen;
-    unsigned i;
-    unsigned numreads = self->numreads;
-    
-    for (seqlen = 0, i = 0; i != numreads; ++i) {
-        seqlen += self->readLen[i];
-    }
-    for (otherSeqlen = 0, i = 0; i != other->numreads; ++i) {
-        otherSeqlen += other->readLen[i];
-    }
-
-    rc = SequenceRecordResize(self, &self->storage, self->numreads + other->numreads, seqlen + otherSeqlen);
-    if (rc)
-        return rc;
-    /* this needs to be reverse order from assignment in Resize function
-     * these regions can overlap
-     */
-    memmove(self->qual,             &((uint8_t const *)self->storage.base)[qual],              seqlen);
-    memmove(self->seq,              &((uint8_t const *)self->storage.base)[seq],               seqlen);
-    memmove(self->cskey,            &((uint8_t const *)self->storage.base)[cskey],             numreads * sizeof(self->cskey[0]));
-    memmove(self->alignmentCount,   &((uint8_t const *)self->storage.base)[alignmentCount],    numreads * sizeof(self->alignmentCount[0]));
-    memmove(self->is_bad,           &((uint8_t const *)self->storage.base)[is_bad],            numreads * sizeof(self->is_bad[0]));
-    memmove(self->orientation,      &((uint8_t const *)self->storage.base)[orientation],       numreads * sizeof(self->orientation[0]));
-    memmove(self->aligned,          &((uint8_t const *)self->storage.base)[aligned],           numreads * sizeof(self->aligned[0]));
-    memmove(self->readLen,          &((uint8_t const *)self->storage.base)[readLen],           numreads * sizeof(self->readLen[0]));
-    memmove(self->ti,               &((uint8_t const *)self->storage.base)[ti],                numreads * sizeof(self->ti[0]));
-    
-    memcpy(&self->ti[numreads],             other->ti,              other->numreads * sizeof(self->ti[0]));
-    memcpy(&self->readLen[numreads],        other->readLen,         other->numreads * sizeof(self->readLen[0]));
-    memcpy(&self->aligned[numreads],        other->aligned,         other->numreads * sizeof(self->aligned[0]));
-    memcpy(&self->orientation[numreads],    other->orientation,     other->numreads * sizeof(self->orientation[0]));
-    memcpy(&self->is_bad[numreads],         other->is_bad,          other->numreads * sizeof(self->is_bad[0]));
-    memcpy(&self->alignmentCount[numreads], other->alignmentCount,  other->numreads * sizeof(self->alignmentCount[0]));
-    memcpy(&self->cskey[numreads],          other->cskey,           other->numreads * sizeof(self->cskey[0]));
-    memcpy(&self->seq[seqlen],              other->seq,             otherSeqlen);
-    memcpy(&self->qual[seqlen],             other->qual,            otherSeqlen);
-    
-    for (i = 0, seqlen = 0; i != self->numreads; ++i) {
-        self->readStart[i] = seqlen;
-        seqlen += self->readLen[i];
-    }
-    
-    return 0;
-}
diff --git a/libs/ncbi-vdb/Makefile b/libs/ncbi-vdb/Makefile
deleted file mode 100644
index 7b08def..0000000
--- a/libs/ncbi-vdb/Makefile
+++ /dev/null
@@ -1,154 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/ncbi-vdb
-
-EXT_LIBS = \
-	libncbi-vdb \
-	libncbi-wvdb
-
-ALL_LIBS = \
-	$(EXT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(EXT_LIBS): makedirs
-	@ $(MAKE_CMD) $(LIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(LIBDIR)/,$(EXT_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# virtual db library
-#
-$(LIBDIR)/libncbi-vdb: $(addprefix $(LIBDIR)/libncbi-vdb.,$(LIBEXT))
-
-ifeq (linux,$(OS))
-LIBKFF = kff magic
-LIBVDB_BLAST = vdb-blast
-else
-LIBKFF =
-LIBVDB_BLAST =
-endif
-
-ifeq (win,$(OS))
-LIBENTREZ =
-LIBKQ =
-LIBKXML =
-else
-LIBENTREZ =
-LIBKQ = kq
-LIBKXML = kxml kxfs
-endif
-
-VDB_LIB_CMN = \
-	align-access \
-	bz2 \
-	kfg \
-	kfs \
-	klib \
-	kproc \
-	$(LIBKQ) \
-	krypto \
-	ksrch \
-	$(LIBKXML) \
-	kurl \
-	vfs \
-	z
-
-VDB_LIB_RD = \
-	$(VDB_LIB_CMN) \
-	align-reader \
-	ascp \
-	$(EXT_SCHEMA_MODULES) \
-	kdb \
-	sradb \
-	srareader \
-	$(LIBVDB-BLAST) \
-	vdb
-
-VDB_OBJ = \
-	$(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RD)))
-
-VDB_LIB = \
-	$(addprefix -s,$(VDB_LIB_RD))
-
-$(LIBDIR)/libncbi-vdb.$(SHLX): $(VDB_OBJ)
-	$(LD) --dlib --vers $(SRCDIR) -o $@ $(VDB_LIB)
-
-$(LIBDIR)/libncbi-vdb.$(LIBX): $(VDB_OBJ)
-	$(LD) --slib --vers $(SRCDIR) -o $@ $(VDB_LIB)
-
-#-------------------------------------------------------------------------------
-# update version
-#
-$(LIBDIR)/libncbi-wvdb: $(addprefix $(LIBDIR)/libncbi-wvdb.,$(LIBEXT))
-
-VDB_LIB_RDWR = \
-	$(VDB_LIB_CMN) \
-	align-writer \
-	waxf \
-	wkdb \
-	wsradb \
-	wsraxf \
-	wvdb \
-	$(LIBENTREZ) \
-	wvxf \
-	wwgsxf
-
-WVDB_OBJ = \
-	$(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RDWR)))
-
-WVDB_LIB = \
-	$(addprefix -s,$(VDB_LIB_RDWR))
-
-$(LIBDIR)/libncbi-wvdb.$(SHLX): $(WVDB_OBJ)
-	$(LD) --dlib --vers $(SRCDIR) -o $@ $(WVDB_LIB) -lxml2
-
-$(LIBDIR)/libncbi-wvdb.$(LIBX): $(WVDB_OBJ)
-	$(LD) --slib --vers $(SRCDIR) -o $@ $(WVDB_LIB)
diff --git a/libs/ncbi-vdb/libncbi-vdb.vers b/libs/ncbi-vdb/libncbi-vdb.vers
deleted file mode 100644
index 0bee604..0000000
--- a/libs/ncbi-vdb/libncbi-vdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/libs/ncbi-vdb/libncbi-wvdb.vers b/libs/ncbi-vdb/libncbi-wvdb.vers
deleted file mode 100644
index 0bee604..0000000
--- a/libs/ncbi-vdb/libncbi-wvdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/libs/search/Makefile b/libs/search/Makefile
deleted file mode 100644
index 1157a73..0000000
--- a/libs/search/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/search
-
-INT_LIBS = \
-	libksrch
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f $(addsuffix .*,$(addprefix $(ILIBDIR)/,libnucstrstr libgrep))
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# search
-#
-$(ILIBDIR)/libksrch: $(addprefix $(ILIBDIR)/libksrch.,$(ILIBEXT))
-
-SEARCH_SRC = \
-	search \
-	fgrep-dumb \
-	fgrep-boyermoore \
-	fgrep-aho \
-	agrep-wumanber \
-	agrep-myers \
-	agrep-myersunltd \
-	agrep-dp
-
-ifeq (linux,$(OS))
-SEARCH_SRC += \
-	nucstrstr-icc-$(ARCH)-$(BUILDTYPE)
-else
-SEARCH_SRC += \
-	nucstrstr
-endif
-
-SEARCH_OBJ = \
-	$(addsuffix .$(LOBX),$(SEARCH_SRC))
-
-SEARCH_LIB = \
-	-dklib \
-	-dm
-
-$(ILIBDIR)/libksrch.$(LIBX): $(SEARCH_OBJ)
-	$(LD) --slib -o $@ $^ $(SEARCH_LIB)
diff --git a/libs/search/agrep-dp.c b/libs/search/agrep-dp.c
deleted file mode 100644
index 85df7bf..0000000
--- a/libs/search/agrep-dp.c
+++ /dev/null
@@ -1,873 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*
-  From Gene Myers, 1998, 
-  "A Fast Bit-vector Algorithm for Approxsimat String Matching
-  Based on Dynamic Programming" -- explains dp pretty well.
-
-  If we place the pattern down the left of a matrix,
-  and the scored text along the top horizontally,
-  pattern p(length m) and text t(length n),
-  we can compute the dynamic programming matrix C[0..m, 0..n] as 
-
-  C[i,j] = min{C[i-1,j-1]+(if p(i)=t(j) then 0 else 1), C[i-1,j]+1, C[i,j-1]+1}
-
-  given that C[0,j] = 0 for all j.
-  We can replace the constants with table-driven scores,
-  so that we have a match cost for (P(i),t(i)), 
-  and costs for skippings parts of the pattern (first 1) or text (second 1).
-*/
-
-#include <search/extern.h>
-#include <os-native.h>
-#include <compiler.h>
-#include <sysalloc.h>
-#include "search-priv.h"
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h> /* lroundf */
-
-#define _TRACE 0
-
-static
-void reverse_string(const char* from, int32_t len, char *to) 
-{
-    const char* p = from + len;
-    while( p != from ) {
-        *to++ = *--p;
-    }
-    *to = '\0';
-}
-
-struct DPParams {
-    char *pattern;
-    char *rpattern;
-    AgrepFlags mode;
-    int32_t plen;
-};
-
-rc_t AgrepDPMake( DPParams **self, AgrepFlags mode, const char *pattern )
-{
-    rc_t rc = 0;
-
-    if( (*self = malloc(sizeof(**self))) == NULL ) {
-        rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-    } else {
-        int32_t i;
-        (*self)->mode = mode;
-        (*self)->pattern = strdup(pattern);
-        (*self)->plen = strlen(pattern);
-        (*self)->rpattern = malloc((*self)->plen + 1);
-        if( (*self)->pattern == NULL || (*self)->pattern == NULL ) {
-            rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-        } else if( mode & AGREP_MODE_ASCII ) {
-            if( mode & AGREP_IGNORE_CASE ) {
-                for(i = 0; i < (*self)->plen; i++) {
-                    (*self)->pattern[i] = tolower((*self)->pattern[i]);
-                }
-            }
-        }
-    }
-    if( rc != 0 ) {
-        AgrepDPFree(*self);
-    } else {
-        reverse_string((*self)->pattern, (*self)->plen, (*self)->rpattern);
-    }
-    return rc;
-}
-
-void AgrepDPFree( DPParams *self )
-{
-    if( self != NULL ) {
-        free(self->pattern);
-        free(self->rpattern);
-        free(self);
-    }
-}
-
-#if _TRACE
-static
-void print_col_as_row(int32_t *col, int32_t plen) 
-{
-    int32_t i;
-    for (i=0; i<=plen; i++) {
-        printf("%2d ", col[i]);
-    }
-    printf("\n");
-}
-#endif
-
-static
-void init_col(const char *p, int32_t plen, int32_t *col)
-{
-    int32_t i;
-    col[0] = 0;
-    for (i=1; i<=plen; i++) {
-        col[i] = col[i-1] + 1;
-    }  
-}
-
-bool na4_match(unsigned char p, unsigned char c)
-{
-    if( p == c ) {
-        return true;
-    } else {
-        const unsigned char* ps = IUPAC_decode[p];
-        const unsigned char* cs = IUPAC_decode[c];
-        if( ps != NULL && cs != NULL ) {
-            while( *ps != '\0' ) {
-                while( *cs != '\0' ) {
-                    if( *ps == *cs++ ) {
-                        return true;
-                    }
-                }
-                ps++;
-            }
-        }
-    }
-    return false;
-}
-
-#undef min
-#define min(a,b) ((a)<(b)?(a):(b))
-
-/* No longer returns a return code. */
-static
-void compute_dp_next_col(const char *p, int32_t plen, AgrepFlags mode, int32_t startcost, char t, int32_t *prev, int32_t *nxt)
-{
-    int32_t i;
-    int32_t matchscore = 0;
-    nxt[0] = startcost;
-
-    if( (mode & AGREP_TEXT_EXPANDED_2NA) && t < 5 ) {
-        t = "ACGTN"[(unsigned char)t];
-    }
-    for(i = 1; i <= plen; i++) {
-        if( p[i - 1] == t ) {
-            matchscore = 0;
-        } else if( mode & AGREP_MODE_ASCII ) {
-            if( mode & AGREP_IGNORE_CASE ) {
-                t = tolower(t);
-            }
-            if( p[i - 1] == t ) {
-                matchscore = 0;
-            }
-        } else if( (mode & AGREP_PATTERN_4NA) && na4_match(p[i - 1], t) ) {
-            matchscore = 0;
-        } else {
-            matchscore = 1;
-        }
-        /*
-        a = prev[i-1] + matchscore;
-        b = nxt[i-1] + 1;
-        c = prev[i] + 1;
-        if (a < b) {
-            if (a < c) {
-                nxt[i] = a;
-            } else {
-                nxt[i] = c;
-            }
-        } else {
-            if (c < b) {
-                nxt[i] = c;
-            } else {
-                nxt[i] = b;
-            }
-            }*/
-        nxt[i] = min(min(prev[i-1] + matchscore,
-                         nxt[i-1] + 1),
-                     prev[i] + 1);
-    }
-}
-
-/*
-This is new functionality to support partial matches at the beginning
-or end of a sequence.
-Errors is the number of errors over the whole pattern,
-so we can assume a constant error rate, or do something more sophisticated.
-Bestpos is the last position that seems to be a match,
-and returns the number of "hits" and "misses" where a hit decreases the
-edit distance score, and a miss is everything else.
-
-The way to use this is use it in the "forward" direction to find an endpoint,
-then assume that's the end of the pattern, and do a reverse search
-compare with the (reversed) pattern to see if it really matches
-the end of the pattern.  See how it's used in the system for more hints.
-*/
-
-LIB_EXPORT void CC dp_scan_for_left_match ( char *pattern, int errors, char *buf, 
-    int buflen, int *bestpos, int *ret_hits, int *ret_misses )
-{
-    int plen = strlen(pattern);
-    int *prev = malloc(sizeof(int)*(plen+1));
-    int *nxt = malloc(sizeof(int)*(plen+1));
-    int *tmp;
-    int i;
-
-    int patlen = strlen(pattern);
-    float errrate = (float)errors / (float)patlen;
-    float play;
-
-    int hits = 0;
-    int misses = 0;
-
-    int change;
-
-    int lastscore = plen;
-
-    int cont = 1;
-
-    int lastwasmiss = 0;
-    int trailing_misses = 0;
-
-    *bestpos = -1;
-#if _TRACE
-    printf("Err rate is %f\n", errrate);
-#endif
-
-    init_col(pattern, plen, nxt);
-#if _TRACE
-    print_col_as_row(nxt, plen);
-#endif
-    for (i=0; i<buflen && cont; i++) {
-        tmp = prev; prev = nxt; nxt = tmp;
-        compute_dp_next_col(pattern, plen, 0, buf[i], i, prev, nxt);
-
-        change = lastscore - nxt[plen];
-        if (change == 1) {
-            lastwasmiss = 0;
-            trailing_misses = 0;
-            hits++;
-        } else {
-            if (lastwasmiss)
-                trailing_misses++;
-            else
-                trailing_misses = 1;
-            misses++;
-            lastwasmiss = 1;
-        }
-
-        play = errrate * (i+1);
-
-        cont = (misses < (1.0+play));
-
-#if _TRACE
-        printf("i %d char %c score %d diff %d continue %d misses %d play %f\n", 
-               i, buf[i], nxt[plen], lastscore - nxt[plen], cont, misses, play);
-#endif
-        lastscore = nxt[plen];
-
-    }
-    /* Settle up */
-    i--;
-#if _TRACE
-    printf("Total hits: %d trailing misses: %d  position: %d\n",
-           hits, trailing_misses, i);
-#endif
-    free(prev);
-    free(nxt);
-
-    *bestpos = i - trailing_misses;
-    /* Not our usual score. */
-    *ret_hits = hits;
-    *ret_misses = misses;
-}
-
-
-static
-AgrepContinueFlag dp_callback_begin(const AgrepCallArgs *args, int32_t end, int32_t forwardscore)
-{
-    AgrepFlags mode = args->self->mode;
-    char *reverse_pattern = args->self->dp->rpattern;
-    int32_t threshold = args->threshold;
-    const char *buf = args->buf;
-    AgrepMatchCallback cb = args->cb;
-    void *cbinfo = args->cbinfo;
-
-    int32_t plen = strlen(reverse_pattern);
-    int32_t *prev = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int32_t)*(plen+1));
-    AgrepMatch match;
-    AgrepContinueFlag cont;
-    int32_t *tmp;
-    int32_t i;
-
-    int32_t curscore = 0;
-    int32_t curlast = 0;
-    int32_t continuing = 0;
-
-    int32_t limit;
-
-    init_col(reverse_pattern, plen, nxt);
-#if _TRACE
-    print_col_as_row(nxt, plen);
-#endif
-
-    limit = end - args->self->dp->plen - threshold - 1;
-    if (limit < 0)
-        limit = 0;
-    
-    for (i=end; i>=limit; i--) {
-        tmp = prev; prev = nxt; nxt = tmp;
-        /* For the reverse scan, we need to make the initial cost
-           of the column depend upon the price of skipping the
-           suffix (up to this point) of the text */
-        compute_dp_next_col(reverse_pattern, plen, mode, end-i+1,
-                            buf[i], prev, nxt);
-
-        if ((mode & AGREP_LEFT_MAINTAIN_SCORE)?
-            nxt[plen] <= forwardscore:
-            nxt[plen] <= threshold)
-        {
-            if (continuing) {
-                if (nxt[plen] < curscore) {
-                    curscore = nxt[plen];
-                    curlast = i;
-                } else if (nxt[plen] == curscore &&
-                           (mode & AGREP_EXTEND_SAME)) {
-                    curlast = i;
-                } else {
-                    continuing = 0;
-                    match.score = curscore;
-                    match.position = curlast;
-                    match.length = end - curlast + 1;
-                    cont = AGREP_CONTINUE;
-                    (*cb)(cbinfo, &match, &cont);
-                    if (cont != AGREP_CONTINUE)
-                        goto EXIT;
-                }
-            } else if ((mode & AGREP_EXTEND_SAME) ||
-                       (mode & AGREP_EXTEND_BETTER)) {
-                curscore = nxt[plen];
-                curlast = i;
-                continuing = 1;
-            } else {
-                match.score = nxt[plen];
-                match.position = i;
-                match.length = end - i + 1;
-                cont = AGREP_CONTINUE;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != AGREP_CONTINUE)
-                    goto EXIT;
-            }
-        }
-#if _TRACE
-        print_col_as_row(nxt, plen);
-#endif
-    }
-    if (continuing) {
-        continuing = 0;
-        match.score = curscore;
-        match.position = curlast;
-        match.length = end - curlast + 1;
-        cont = AGREP_CONTINUE;
-        (*cb)(cbinfo, &match, &cont);
-        goto EXIT;
-    }
-    cont = AGREP_CONTINUE;
-EXIT:
-    free(prev);
-    free(nxt);
-    return cont;
-}
-
-rc_t CC dp_end_callback( const void *cbinfo, const AgrepMatch *match, AgrepContinueFlag *flag )
-{
-    const AgrepCallArgs *cbi = cbinfo;
-    *flag = dp_callback_begin(cbi, match->position, match->score);
-    return 0;
-}
-
-
-static
-void dp_callback_end( const AgrepCallArgs *args )
-{
-    AgrepFlags mode = args->self->mode;
-    char *pattern = args->self->dp->pattern;
-    int32_t threshold = args->threshold;
-    const char *buf = args->buf;
-    int32_t buflen = args->buflen;
-
-    AgrepMatchCallback cb = dp_end_callback;
-    const void *cbinfo = args;
-
-    int32_t plen = strlen(pattern);
-    int32_t *prev = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int32_t)*(plen+1));
-    int32_t curscore = 0;
-    int32_t curlast = 0;
-    int32_t continuing = 0;
-
-    int32_t startingcost = 0;
-    int32_t limit;
-
-    AgrepMatch match;
-    AgrepContinueFlag cont;
-    int32_t *tmp;
-    int32_t i;
-
-    init_col(pattern, plen, nxt);
-#if _TRACE
-    print_col_as_row(nxt, plen);
-#endif
-    
-    limit = buflen;
-    if (mode & AGREP_ANCHOR_LEFT) {
-        limit = args->self->dp->plen + threshold+1;
-        if (limit > buflen) {
-            limit = buflen;
-        }
-        cb = args->cb;
-        cbinfo = args->cbinfo;
-    }
-
-    for (i=0; i<limit; i++) {
-        tmp = prev; prev = nxt; nxt = tmp;
-
-        if (mode & AGREP_ANCHOR_LEFT) 
-            startingcost = i+1;
-        compute_dp_next_col(pattern, plen, mode, startingcost, 
-                            buf[i], prev, nxt);
-        if (nxt[plen] <= threshold) {
-
-            if (continuing) {
-                if (nxt[plen] < curscore &&
-                    ((mode & AGREP_EXTEND_BETTER) ||
-                     (mode & AGREP_EXTEND_SAME))) {
-                    curscore = nxt[plen];
-                    curlast = i;
-                } else if (nxt[plen] == curscore &&
-                           ((mode & AGREP_EXTEND_BETTER) ||
-                            (mode & AGREP_EXTEND_SAME))) {
-                    if (mode & AGREP_EXTEND_SAME) {
-                        curlast = i;
-                    }
-                } else {
-                    continuing = 0;
-                    match.score = curscore;
-                    if (mode & AGREP_ANCHOR_LEFT) {
-                        match.position = 0;
-                        match.length = curlast+1;
-                    } else {
-                        match.position = curlast;
-                        match.length = -1;
-                    }
-                    cont = AGREP_CONTINUE;
-                    (*cb)(cbinfo, &match, &cont);
-                    if (cont != AGREP_CONTINUE)
-                        goto EXIT;
-                }
-            } else if ((mode & AGREP_EXTEND_SAME) ||
-                       (mode & AGREP_EXTEND_BETTER)) {
-                curscore = nxt[plen];
-                curlast = i;
-                continuing = 1;
-            } else {
-                match.score = nxt[plen];
-                if (mode & AGREP_ANCHOR_LEFT) {
-                    match.position = 0;
-                    match.length = i+1;
-                } else {
-                    match.position = i;
-                    match.length = -1;
-                }
-                cont = AGREP_CONTINUE;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != AGREP_CONTINUE)
-                    goto EXIT;
-            }
-            /* If we're no longer under the threshold, we might
-               have been moving forward looking for a better match 
-            */
-        } else if (continuing) {
-            continuing = 0;
-            match.score = curscore;
-            if (mode & AGREP_ANCHOR_LEFT) {
-                match.position = 0;
-                match.length = curlast+1;
-            } else {
-                match.position = curlast;
-                match.length = -1;
-            }
-            cont = AGREP_CONTINUE;
-            (*cb)(cbinfo, &match, &cont);
-            if (cont != AGREP_CONTINUE)
-                goto EXIT;
-        }
-#if _TRACE
-        print_col_as_row(nxt, plen);
-#endif
-    }
-    if (continuing) {
-        continuing = 0;
-        match.score = curscore;
-        if (mode & AGREP_ANCHOR_LEFT) {
-            match.position = 0;
-            match.length = curlast+1;
-        } else {
-            match.position = curlast;
-            match.length = -1;
-        }
-        (*cb)(cbinfo, &match, &cont);
-    }
-EXIT:
-    free(prev);
-    free(nxt);
-}
-
-
-
-static
-uint32_t dp_find_end(const char *pattern, AgrepFlags mode, int32_t threshold, const char *buf, int32_t buflen, int32_t *bestpos, int32_t *bestscore) 
-{
-    int32_t plen = strlen(pattern);
-    int32_t *prev = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *tmp;
-    int32_t i;
-
-    int32_t foundit = 0;
-
-
-    *bestscore = 10000;
-    *bestpos = 1;
-
-    init_col(pattern, plen, nxt);
-#if _TRACE
-    print_col_as_row(nxt, plen);
-#endif
-    for (i=0; i<buflen; i++) {
-        tmp = prev; prev = nxt; nxt = tmp;
-        compute_dp_next_col(pattern, plen, mode, 0, buf[i], prev, nxt);
-        if (nxt[plen] <= threshold) {
-            if (foundit) {
-                if (nxt[plen] <= *bestscore) {
-                    *bestpos = i;
-                    *bestscore = nxt[plen];
-                } else {
-                    /* Here we'd extend even if the score was equal, maybe */
-                }
-            } else {
-                /* Ok, we have a match under threshold.
-                   Let's continue and see if we can improve on it.
-                */
-                *bestpos = i;
-                *bestscore = nxt[plen];
-                foundit = 1;
-            }
-        } else {
-            if (foundit)
-                goto EXIT;
-        }
-#if _TRACE
-        print_col_as_row(nxt, plen);
-#endif
-    }
-EXIT:
-    free(prev);
-    free(nxt);
-    if (foundit)
-        return 1;
-    return 0;
-}
-
-
-
-
-static
-uint32_t dp_find_begin(char *reverse_pattern, AgrepFlags mode, int32_t threshold, const char *buf, int32_t buflen, int32_t end, int32_t *begin) 
-{
-    int32_t plen = strlen(reverse_pattern);
-    int32_t *prev = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int32_t)*(plen+1));
-    int32_t *tmp;
-    int32_t i;
-
-    int32_t limit;
-
-    int32_t foundit = 0;
-    int32_t bestscore = 10000;
-
-    *begin = 0;
-
-    limit = end - plen - threshold - 1;
-    if (limit < 0)
-        limit = 0;
-
-    init_col(reverse_pattern, plen, nxt);
-#if _TRACE
-    print_col_as_row(nxt, plen);
-#endif
-    for (i=end; i>=limit; i--) {
-        tmp = prev; prev = nxt; nxt = tmp;
-        /* We need to make the initial cost of this column
-           reflect the cost of skipping the suffix (up to this point)
-           of the text */
-        compute_dp_next_col(reverse_pattern, plen, mode, end-i, buf[i], prev, nxt);
-
-        if (nxt[plen] <= threshold) {
-            *begin = i;
-            bestscore = nxt[plen];
-            foundit = 1;
-        } else {
-            if (foundit)
-                goto EXIT;
-        }
-#if _TRACE
-        print_col_as_row(nxt, plen);
-#endif
-    }
-EXIT:
-    free(prev);
-    free(nxt);
-    if (foundit)
-        return 1;
-    return 0;
-}
-
-
-uint32_t AgrepDPFindFirst ( const DPParams *self, int32_t threshold, AgrepFlags mode, 
-        const char *buf, int32_t buflen, AgrepMatch *match )
-{
-    int32_t begin, end;
-    int32_t score;
-    if (dp_find_end(self->pattern, mode, threshold, buf, buflen, &end, &score)) {
-        if (dp_find_begin(self->rpattern, mode, threshold, buf, buflen, end, &begin)) {
-            match->position = begin;
-            match->length = end-begin+1;
-            match->score = score;
-            return 1;
-        }
-    }
-    return 0;
-}
-
-
-void AgrepDPFindAll( const AgrepCallArgs *args )
-{
-    dp_callback_end( args );
-}
-
-
-/* Try the longest match first. */
-LIB_EXPORT uint32_t CC has_left_approx_match( char *pattern, uint32_t errors, 
-                               char *buf, size_t buflen, 
-                               uint32_t *length, uint32_t *errcnt )
-{
-    int32_t plen = strlen(pattern);
-    int32_t *prev = malloc(sizeof(int)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int)*(plen+1));
-    int32_t *tmp;
-    int32_t i, j;
-    int32_t allowable;
-    char *subpattern;
-    int32_t dist;
-
-    int32_t found = 0;
-    int32_t foundpos = 0;
-    int32_t founderr = 0;
-
-    for (i=plen; i>=8; i--) {
-
-        /* See if the first i chars of the text match the last i
-           chars of the pattern with (errors) errors.
-        */
-        subpattern = pattern + (plen - i);
-        init_col(subpattern, i, nxt);
-        for (j=0; j<i; j++) {
-            tmp = prev; prev = nxt; nxt = tmp;
-            compute_dp_next_col(subpattern, i, 0, buf[j], j, prev, nxt);
-        }
-        dist = nxt[i];
-        allowable = 1+lroundf((float)i * (float)errors / (float)plen);
-        if (found) {
-            if (dist <= founderr) {
-                foundpos = i-1;
-                founderr = dist;
-            } else {
-                goto DONE;
-            }
-        } else if (dist <= allowable) {
-            /* Found a match */
-            found = 1;
-            foundpos = i-1;
-            founderr = dist;
-
-            /* Continue a bit to see if something's equally good or better */
-        }
-    }
-    DONE:
-    free(prev);
-    free(nxt);
-    if (found) {
-        *length = foundpos+1;
-        *errcnt = founderr;
-        return 1;
-    }
-    return 0;
-}
-
-
-/* Try the longest match first. */
-LIB_EXPORT uint32_t CC has_right_approx_match( char *pattern, uint32_t errors, 
-                                char *buf, size_t buflen, 
-                                uint32_t *bestpos, uint32_t *errcnt )
-{
-    uint32_t plen = strlen(pattern);
-    int32_t *prev = malloc(sizeof(int)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int)*(plen+1));
-    int32_t *tmp;
-    int32_t i, j;
-    int32_t allowable;
-    char *subpattern;
-    char *subpattern_r;
-    int32_t dist;
-
-    int32_t found = 0;
-    int32_t foundpos = 0;
-    int32_t founderr = 0;
-    int32_t bufj;
-
-    int bound = plen;
-    if (buflen < bound) {
-        bound = buflen;
-    }
-
-    for (i=bound; i>=8; i--) {
-
-        /* See if the first i chars of the pattern match the last i
-           chars of the text with (errors) errors.
-           We match in reverse, so the initial penalty of skipping
-           the "first part" of the pattern means skipping the end
-        */
-        /* Some leaks here! */
-        subpattern = substring(pattern, i);
-        subpattern_r = malloc(i + 1);
-        reverse_string(subpattern, i, subpattern_r);
-        init_col(subpattern_r, i, nxt);
-
-        for (j=0; j<i; j++) {
-            bufj = buflen - j - 1;
-            tmp = prev; prev = nxt; nxt = tmp;
-            compute_dp_next_col(subpattern_r, i, 0, buf[bufj], j, prev, nxt);
-        }
-        dist = nxt[i];
-        allowable = 1+lroundf((float)i * (float)errors / (float)plen);
-        if (found) {
-            if (dist <= founderr) {
-                foundpos = buflen - i;
-                founderr = dist;
-            } else {
-                goto DONE;
-            }
-        } else if (dist <= allowable) {
-            /* Found a match */
-            found = 1;
-            foundpos = buflen - i;
-            founderr = dist;
-
-            /* Continue a bit to see if something's equally good or better */
-        }
-    }
-    DONE:
-    free(prev);
-    free(nxt);
-    if (found) {
-        *bestpos = foundpos;
-        *errcnt = founderr;
-        return 1;
-    }
-    return 0;
-}
-
-
-
-/* Try the longest match first. */
-/* Call with pattern as the text, text as pattern. */
-LIB_EXPORT uint32_t CC has_inside_approx_match( char *pattern, uint32_t plen, uint32_t errors, 
-                                 char *buf, size_t buflen, 
-                                 uint32_t *skip, uint32_t *errcnt )
-{
-    int32_t *prev = malloc(sizeof(int)*(plen+1));
-    int32_t *nxt = malloc(sizeof(int)*(plen+1));
-    int32_t *tmp;
-    int32_t j;
-    int32_t allowable;
-    int32_t dist;
-
-    int32_t found = 0;
-    int32_t foundpos = 0;
-    int32_t founderr = 0;
-
-    allowable = 1+lroundf((float)errors * plen / (float)buflen);
-
-
-    init_col(pattern, plen, nxt);
-    
-    for (j=0; j<buflen; j++) {
-        tmp = prev; prev = nxt; nxt = tmp;
-        compute_dp_next_col(pattern, plen, 0, buf[j], 0, prev, nxt);
-
-        dist = nxt[plen];
-
-        /* 
-           We still have to do this kind of thing because otherwise
-           the match will extend past the end of the text (here pattern),
-           and will match "useless" letters that just increase the score.
-           So we continue looking at smaller subsequences of the pattern
-           to see if something smaller matches better. 
-        */
-        
-        if (found) {
-            if (dist <= founderr && dist <= allowable) {
-                foundpos = j;
-                founderr = dist;
-            } else {
-                goto DONE;
-            }
-        } else if (dist <= allowable) {
-            /* Found a match */
-            found = 1;
-            foundpos = j;
-            founderr = dist;
-
-            /* Continue a bit to see if something's equally good or better */
-        }
-    }
-DONE:
-    free(prev);
-    free(nxt);
-    if (found) {
-        *skip = foundpos;
-        *errcnt = founderr;
-        return 1;
-    }
-    return 0;
-}
diff --git a/libs/search/agrep-myers.c b/libs/search/agrep-myers.c
deleted file mode 100644
index 8d84bc8..0000000
--- a/libs/search/agrep-myers.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include "search-priv.h"
-#include "debug.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#define DBG_SEARCH_METHOD DBG_SEARCH_MYERS
-
-#define UBITTYPE uint64_t
-
-struct MyersSearch {
-    AgrepFlags mode;
-    int32_t m;
-    UBITTYPE PEq[256];
-    UBITTYPE PEq_R[256];
-};
-
-static
-rc_t myers_translate(AgrepFlags mode, UBITTYPE* PEq, unsigned char p, UBITTYPE val)
-{
-    if( mode & AGREP_PATTERN_4NA ) {
-        return na4_set_bits(mode, PEq, p, val);
-    } else if( mode & AGREP_MODE_ASCII ) {
-        if( mode & AGREP_IGNORE_CASE ) {
-            PEq[tolower(p)] |= val;
-            PEq[toupper(p)] |= val;
-        } else {
-            PEq[p] |= val;
-        }
-    }
-    return 0;
-}
-
-#if _DEBUGGING
-static
-void printbits( UBITTYPE in )
-{
-    char buf[9];
-    int32_t j, k;
-    unsigned char byte;
-    buf[8] = '\0';
-    for (j=0; j<sizeof(UBITTYPE); j++) {
-        byte = in >> (8*(sizeof(UBITTYPE) - j - 1));
-        for (k=0; k<8; k++) {
-            buf[k] = "01"[1&(byte>>(7-k))];
-        }
-        SEARCH_DBGF(("%s ", buf));
-    }
-}
-#else
-#define printbits(in) ((void)0)
-#endif
-
-void AgrepMyersFree( MyersSearch *self )
-{
-    free(self);
-}
-  
-rc_t AgrepMyersMake( MyersSearch **self, AgrepFlags mode, const char *pattern )
-{
-    rc_t rc = 0;
-    uint32_t max_pattern_length = sizeof(UBITTYPE) * 8;
-    int32_t m = strlen(pattern);
-
-    *self = NULL;
-    if( m > max_pattern_length ) {
-        rc = RC(rcText, rcString, rcSearching, rcParam, rcExcessive);
-    } else if( (*self = malloc(sizeof(**self))) == NULL ) {
-        rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-    } else {            
-        int32_t j;
-        const unsigned char *upattern = (const unsigned char *)pattern;
-
-        (*self)->m = m;
-        (*self)->mode = mode;
-        memset((*self)->PEq, 0, sizeof((*self)->PEq));
-        for(j = 0; rc == 0 && j < m; j++) {
-            rc = myers_translate(mode, (*self)->PEq, upattern[j], (UBITTYPE)1 << j);
-        }
-        SEARCH_DBG("pattern '%s'", upattern);
-        for(j = 0; j < sizeof((*self)->PEq) / sizeof((*self)->PEq[0]); j++) {
-            if( (*self)->PEq[j] ) {
-                printbits((*self)->PEq[j]);
-                SEARCH_DBGF((" <- %c\n", j));
-            }
-        }
-        memset((*self)->PEq_R, 0, sizeof((*self)->PEq_R));
-        for(j = 0; rc == 0 && j < m; j++) {
-            rc = myers_translate(mode, (*self)->PEq_R, upattern[m - j - 1], (UBITTYPE)1 << j);
-        }
-        SEARCH_DBG("pattern rev '%s'", upattern);
-        for(j = 0; j < sizeof((*self)->PEq) / sizeof((*self)->PEq[0]); j++) {
-            if( (*self)->PEq[j] ) {
-                printbits((*self)->PEq[j]);
-                SEARCH_DBGF((" <- %c\n", j));
-            }
-        }
-    }
-    return rc;
-}
-
-/* 
-   This finds the first match forward in the string less than or equal
-   the threshold.  If nonzero, this will be a prefix of any exact match.
-*/
-uint32_t MyersFindFirst( MyersSearch *self, int32_t threshold, 
-                   const char* text, size_t n,
-                   AgrepMatch *match )
-{
-    const unsigned char *utext = (const unsigned char *)text;
-    UBITTYPE Pv;
-    UBITTYPE Mv;
-
-    int32_t m = self->m;
-    int32_t Score;
-    int32_t BestScore = m;
-    int32_t from = 0;
-    int32_t to = -1;
-
-    int32_t j;
-    UBITTYPE Eq, Xv, Xh, Ph, Mh;
-
-    Score = m;
-    Pv = (UBITTYPE)-1;
-    Mv = (UBITTYPE)0;
-    
-    for(j = 0; j < n; j++) {
-        Eq = self->PEq[utext[j]];
-        Xv = Eq | Mv;
-        Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-        Ph = Mv | ~ (Xh | Pv);
-        Mh = Pv & Xh;
-        if(Ph & ((UBITTYPE)1 << (m - 1))) {
-            Score++;
-        } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-            Score--;
-        }
-        Ph <<= 1;
-        Mh <<= 1;
-        Pv = Mh | ~(Xv | Ph);
-        Mv = Ph & Xv;
-        SEARCH_DBG("1st: %3d. '%c' score %d", j, utext[j], Score);
-        if (Score <= threshold) {
-            BestScore = Score;
-            to = j;
-            break;
-        }
-    }
-
-    if (BestScore <= threshold) {
-
-        /* Continue while score decreases under the threshold */
-        for(j++; j < n; j++) {
-            Eq = self->PEq[utext[j]];
-            Xv = Eq | Mv;
-            Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-            Ph = Mv | ~ (Xh | Pv);
-            Mh = Pv & Xh;
-            if(Ph & ((UBITTYPE)1 << (m - 1))) {
-                Score++;
-            } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-                Score--;
-            }
-            Ph <<= 1;
-            Mh <<= 1;
-            Pv = Mh | ~(Xv | Ph);
-            Mv = Ph & Xv;
-            SEARCH_DBG("2nd: %3d. '%c' score %d", j, utext[j], Score);
-            if( Score < BestScore ||
-                ( (self->mode & (AGREP_EXTEND_BETTER | AGREP_EXTEND_SAME)) && Score <= BestScore) ) {
-                BestScore = Score;
-                to = j;
-            } else {
-                break;
-            }
-        }
-    }
-
-    if (BestScore <= threshold) {
-        /* Re-initialize for next scan! */
-        Score = m;
-        Pv = (UBITTYPE)-1;
-        Mv = (UBITTYPE)0;
-        
-        for(j = to; j >= 0; j--) {
-            Eq = self->PEq_R[utext[j]];
-            Xv = Eq | Mv;
-            Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-            Ph = Mv | ~ (Xh | Pv);
-            Mh = Pv & Xh;
-            if(Ph & ((UBITTYPE)1 << (m - 1))) {
-                Score++;
-            } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-                Score--;
-            }
-            Ph <<= 1;
-            Mh <<= 1;
-            Pv = Mh | ~(Xv | Ph);
-            Mv = Ph & Xv;
-            SEARCH_DBG("Rvs: %3d. '%c' score %d", j, utext[j], Score);
-            if(Score <= BestScore) {
-                from = j;
-                break;
-            }
-        }
-    }
-    if (BestScore <= threshold) {
-        match->position = from;
-        match->length = to-from+1;
-        match->score = BestScore;
-        SEARCH_DBG("Hit: [%d,%d] '%.*s' score %d", match->position, match->length,
-                    match->length, &utext[match->position], match->score);
-        return 1;
-    }
-    return 0;
-}
-
-  
-
-/* 
-   Returns non-negative if something found.
-   Return value is the number of mismatches.
-*/
-LIB_EXPORT int32_t CC MyersFindBest ( MyersSearch *self, const char* text, 
-    size_t n, int32_t *pos, int32_t *len )
-{
-    const unsigned char *utext = (const unsigned char *)text;
-    UBITTYPE Pv;
-    UBITTYPE Mv;
-
-    int32_t m = self->m;
-    int32_t Score;
-    int32_t BestScore = m;
-    int32_t from = 0;
-    int32_t to = -1;
-
-    int32_t j;
-    UBITTYPE Eq, Xv, Xh, Ph, Mh;
-
-    Score = m;
-    Pv = (UBITTYPE)-1;
-    Mv = (UBITTYPE)0;
-    
-    for(j = 0; j < n; j++) {
-        Eq = self->PEq[utext[j]];
-        Xv = Eq | Mv;
-        Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-        Ph = Mv | ~ (Xh | Pv);
-        Mh = Pv & Xh;
-        if(Ph & ((UBITTYPE)1 << (m - 1))) {
-            Score++;
-        } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-            Score--;
-        }
-        Ph <<= 1;
-        Mh <<= 1;
-        Pv = Mh | ~(Xv | Ph);
-        Mv = Ph & Xv;
-        SEARCH_DBG("Fwd: %3d. '%c' score %d", j, utext[j], Score);
-        if( Score < BestScore ) {
-            BestScore = Score;
-            to = j;
-        }
-    }
-
-    /* Re-initialize for next scan! */
-    Score = m;
-    Pv = (UBITTYPE)-1;
-    Mv = (UBITTYPE)0;
-    
-    for(j = to; j >= 0; j--) {
-        Eq = self->PEq_R[utext[j]];
-        Xv = Eq | Mv;
-        Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-        Ph = Mv | ~ (Xh | Pv);
-        Mh = Pv & Xh;
-        if(Ph & ((UBITTYPE)1 << (m - 1))) {
-            Score++;
-        } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-            Score--;
-        }
-        Ph <<= 1;
-        Mh <<= 1;
-        Pv = Mh | ~(Xv | Ph);
-        Mv = Ph & Xv;
-        SEARCH_DBG("Rvs: %3d. '%c' score %d", j, utext[j], Score);
-        if(Score <= BestScore) {
-            from = j;
-            break;
-        }
-    }
-    
-    *pos = from;
-    *len = to-from+1;
-    SEARCH_DBG("Hit: [%d,%d] '%.*s' score %d", *pos, *len, *len, &utext[*pos], BestScore);
-    return BestScore;
-}
-
-/* 
-   This finds the first match forward in the string less than or equal
-   the threshold.  If nonzero, this will be a prefix of any exact match.
-*/
-void MyersFindAll ( const AgrepCallArgs *args )
-{
-    AgrepFlags mode = args->self->mode;
-    MyersSearch *self = args->self->myers;
-    int32_t threshold = args->threshold;
-    const unsigned char *utext = (const unsigned char *)args->buf;
-    int32_t n = args->buflen;
-    AgrepMatchCallback cb = dp_end_callback;
-    const void *cbinfo = args;
-
-    AgrepMatch match;
-    AgrepContinueFlag cont;
-
-    UBITTYPE Pv;
-    UBITTYPE Mv;
-
-    int32_t m = self->m;
-    int32_t Score;
-    int32_t BestScore;
-
-    int32_t j;
-    UBITTYPE Eq, Xv, Xh, Ph, Mh;
-
-    int32_t curscore = 0;
-    int32_t curlast = 0;
-    int32_t continuing = 0;
-    
-    BestScore = m;
-    Score = m;
-    Pv = (UBITTYPE)-1;
-    Mv = (UBITTYPE)0;
-    
-    for(j = 0; j < n; j++) {
-        Eq = self->PEq[utext[j]];
-        Xv = Eq | Mv;
-        Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq;
-        Ph = Mv | ~ (Xh | Pv);
-        Mh = Pv & Xh;
-
-        SEARCH_DBG("%d: Ph ", j);
-        printbits(Ph);
-        SEARCH_DBG(" %s ", "Mh");
-        printbits(Mh);
-        SEARCH_DBG("%s", "");
-
-        if(Ph & ((UBITTYPE)1 << (m - 1))) {
-            Score++;
-        } else if(Mh & ((UBITTYPE)1 << (m - 1))) {
-            Score--;
-        }
-        Ph <<= 1;
-        Mh <<= 1;
-        Pv = Mh | ~(Xv | Ph);
-        Mv = Ph & Xv;
-        SEARCH_DBG("%3d. '%c' score %d", j, utext[j], Score);
-        if (Score <= threshold) {
-            /* At this point we let the DP algorithm find the starting point. */
-            /* This just passes the end position. */
-
-            if (continuing) {
-                if (Score < curscore &&
-                    ((mode & AGREP_EXTEND_BETTER) ||
-                     (mode & AGREP_EXTEND_SAME))) {
-                    curscore = Score;
-                    curlast = j;
-                } else if (Score == curscore &&
-                           ((mode & AGREP_EXTEND_BETTER) ||
-                            (mode & AGREP_EXTEND_SAME))) {
-                    if (mode & AGREP_EXTEND_SAME) {
-                        curlast = j;
-                    }
-                } else {
-                    continuing = 0;
-                    match.score = curscore;
-                    match.position = curlast;
-                    match.length = -1;
-                    cont = AGREP_CONTINUE;
-                    (*cb)(cbinfo, &match, &cont);
-                    if (cont != AGREP_CONTINUE)
-                        return;
-                }
-            } else if ((mode & AGREP_EXTEND_SAME) ||
-                       (mode & AGREP_EXTEND_BETTER)) {
-                curscore = Score;
-                curlast = j;
-                continuing = 1;
-            } else {
-                match.score = Score;
-                match.position = j;
-                match.length = -1;
-                cont = AGREP_CONTINUE;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != AGREP_CONTINUE)
-                    return;
-            }
-            /* If we're no longer under the threshold, we might
-               have been moving forward looking for a better match 
-            */
-        } else if (continuing) {
-            continuing = 0;
-            match.score = curscore;
-            match.position = curlast;
-            match.length = -1;
-            cont = AGREP_CONTINUE;
-            (*cb)(cbinfo, &match, &cont);
-            if (cont != AGREP_CONTINUE)
-                return;
-        }
-    }
-    if (continuing) {
-        continuing = 0;
-        match.score = curscore;
-        match.position = curlast;
-        match.length = -1;
-        (*cb)(cbinfo, &match, &cont);
-    }
-}
diff --git a/libs/search/agrep-myersunltd.c b/libs/search/agrep-myersunltd.c
deleted file mode 100644
index bb47527..0000000
--- a/libs/search/agrep-myersunltd.c
+++ /dev/null
@@ -1,1039 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "search-priv.h"
-
-
-/* 
-   We don't use longs here because the addition means we need to keep
-   some bits in reserve to calculate carries.
-*/   
-
-typedef int32_t schunk;
-typedef uint32_t uchunk;
-
-typedef struct CHUNK {
-    int32_t size;
-    uchunk *chunks;
-} CHUNK;
-
-struct MyersUnlimitedSearch {
-    int32_t m;
-    CHUNK *PEq[256];
-    CHUNK *PEq_R[256];
-};
-
-static const char NA2KEY [] = "ACGT";
-static const char NA4KEY [] = " ACMGRSVTWYHKDBN";
-
-static
-int32_t any_non_4na_chars(const char *pattern)
-{
-    int32_t len = strlen(pattern);
-    int32_t i;
-    char *p;
-
-    for ( i=0; i<len; i++ )
-    {
-        p = strchr( NA4KEY, pattern[i] );
-        if ( p == NULL )
-            return 1;
-    }
-    return 0;
-}
-
-static
-int32_t na4key_matches(AgrepFlags mode, char na4, char acgt)
-{
-    char *p;
-    int32_t pos4, pos2;
-    p = strchr( NA4KEY, na4 );
-    if ( p == NULL )
-    {
-        p = strchr( NA4KEY, 'N' );
-    }
-    pos4 = p - NA4KEY;
-    pos2 = strchr( NA2KEY, acgt ) - NA2KEY;
-    if ( pos4 & ( 1 << pos2 ) )
-        return 1;
-    return 0;
-}
-
-
-
-
-int32_t chunksize(int32_t size) {
-    int32_t ret;
-    ret = 1 + (size / (8*sizeof(uchunk)));
-    return ret;
-}
-
-void chunk_or_in(CHUNK *chunk, CHUNK *or)
-{
-    int32_t i;
-    int32_t size = chunk->size;
-    for (i=0; i<size; i++)
-        chunk->chunks[i] |= or->chunks[i];
-}
-
-void chunk_xor_in(CHUNK *chunk, CHUNK *xor)
-{
-    int32_t i;
-    int32_t size = chunk->size;
-    for (i=0; i<size; i++)
-        chunk->chunks[i] ^= xor->chunks[i];
-}
-
-
-void chunk_and_in(CHUNK *chunk, CHUNK *and)
-{
-    int32_t i;
-    int32_t size = chunk->size;
-    for (i=0; i<size; i++)
-        chunk->chunks[i] &= and->chunks[i];
-}
-
-void chunk_add_in(CHUNK *chunk, CHUNK *add)
-{
-    int32_t i;
-    int32_t size = chunk->size;
-    uint64_t carry = 0;
-    uint64_t newcarry;
-    for (i=size-1; i>=0; i--) {
-        newcarry = 
-            ((uint64_t)chunk->chunks[i] + (uint64_t)add->chunks[i]
-             + carry)
-            >> (8*sizeof(uchunk));
-        chunk->chunks[i] += add->chunks[i] + carry;
-        carry = newcarry;
-    }
-}
-
-
-void chunk_set(CHUNK *chunk, CHUNK *copy)
-{
-    int32_t i;
-    for (i=0; i<chunk->size; i++) {
-        chunk->chunks[i] = copy->chunks[i];
-    }
-}
-
-
-int32_t chunk_isbit_set(CHUNK *chunk, int32_t bit)
-{
-    int32_t cn = chunk->size - 1 - (bit / (8*sizeof(uchunk)));
-    int32_t chunkbit = bit % (8*sizeof(uchunk));
-    return chunk->chunks[cn] & (1 << chunkbit);
-}
-
-
-void chunk_set_bit(CHUNK *chunk, int32_t bit) 
-{
-    int32_t cn = chunk->size - 1 - (bit / (8*sizeof(uchunk)));
-    int32_t chunkbit = bit % (8*sizeof(uchunk));
-    chunk->chunks[cn] |= (1 << chunkbit);
-}
-
-
-void chunk_negate(CHUNK *chunk)
-{
-    int32_t i;
-    for (i=0; i<chunk->size; i++) {
-        chunk->chunks[i] = ~chunk->chunks[i];
-    }
-}
-
-void alloc_chunk_and_zero(CHUNK *chunk, int32_t size)
-{
-    chunk->chunks = malloc(size * sizeof(uchunk));
-    memset(chunk->chunks, 0, size * sizeof(uchunk));
-}
-
-void free_chunk_parts(CHUNK *chunk)
-{
-    free(chunk->chunks);
-    chunk->chunks = NULL;
-}
-
-void free_chunk(CHUNK *chunk)
-{
-    free(chunk->chunks);
-    free(chunk);
-}
-
-
-CHUNK *alloc_chunk(int32_t size)
-{
-    CHUNK *ret;
-    ret = malloc(sizeof(CHUNK));
-    ret->size = size;
-    ret->chunks = malloc(size * sizeof(uchunk));
-    memset(ret->chunks, 0, size * sizeof(uchunk));
-    return ret;
-}
-  
-void chunk_set_minusone(CHUNK *src)
-{
-    int32_t i;
-    for (i=0; i<src->size; i++) {
-        src->chunks[i] = (uchunk)-1;
-    }
-}
-
-void chunk_zero(CHUNK *src)
-{
-    int32_t i;
-    for (i=0; i<src->size; i++) {
-        src->chunks[i] = (uchunk)0;
-    }
-}
-
-void print_chunk(CHUNK *src)
-{
-    uchunk chunk;
-    unsigned char byte;
-    char buf[9];
-    int32_t i, j, k;
-    buf[8] = '\0';
-    for (i=0; i<src->size; i++) {
-        chunk = src->chunks[i];
-        for (j=0; j<sizeof(uchunk); j++) {
-            byte = chunk >> (8*(sizeof(uchunk) - j - 1));
-            for (k=0; k<8; k++) {
-                buf[k] = "01"[1&(byte>>(7-k))];
-            }
-            printf("%s ", buf);
-        }
-    }
-    printf("\n");
-}
-
-
-/*
-  This currently does not preserve the sign bit.
-*/
-void lshift_chunk(CHUNK *dest, CHUNK *src, int32_t n)
-{
-    int32_t i, j;
-    uchunk slop;
-    int32_t chunkshift = n / (8*sizeof(uchunk));
-    int32_t rem = n % (8*sizeof(uchunk));
-    /* Assumes they're both the same size. */
-    int32_t size = src->size;
-
-
-    /* i is the destination chunk */
-    slop = 0;
-    for (i=size-1; i>=0; i--) {
-        j = i+chunkshift;
-        if (j >= size) {
-            dest->chunks[i] = 0;
-        } else {
-            dest->chunks[i] = slop | src->chunks[j] << rem;
-            slop = src->chunks[j] >> (8*sizeof(uchunk) - rem);
-        }
-    }
-}
-
-void chunk_lshift_one_inplace(CHUNK *dest)
-{
-    int32_t i;
-    uchunk slop, newslop;
-    int32_t size = dest->size;
-
-    slop = 0;
-    for (i=size-1; i>=0; i--) {
-        newslop = dest->chunks[i] >> (8*sizeof(uchunk) - 1);
-        dest->chunks[i] = slop | dest->chunks[i] << 1;
-        slop = newslop;
-    }
-}
-
-
-void chunk_lshift_one(CHUNK *dest, CHUNK *src)
-{
-    int32_t i;
-    uchunk slop;
-    int32_t size = src->size;
-
-    slop = 0;
-    for (i=size-1; i>=0; i--) {
-        dest->chunks[i] = slop | src->chunks[i] << 1;
-        slop = src->chunks[i] >> (8*sizeof(uchunk) - 1);
-    }
-}
-
-
-
-#ifdef UNUSED_MAY_NOT_WORK  
-  
-/*
- * In this, chunks are big-endian, meaning 0 is the most significant chunk.
- */
-void rshift_uchunk(CHUNK *dest, CHUNK *src, int32_t n)
-{
-    int32_t size = src->size;
-    uchunk slop;
-    int32_t chunkshift = n / (8*sizeof(uchunk));
-    int32_t rem = n % (8*sizeof(uchunk));
-    int32_t i, j;
-
-    /* i is the destination chunk */
-    slop = 0;
-    for (i=0; i<size; i++) {
-        j = i-chunkshift;
-        if (j < 0) {
-            dest->chunks[i] = 0;
-        } else {
-            dest->chunks[i] = slop | src->chunks[j] >> rem;
-            slop = src->chunks[j] << (8*sizeof(uchunk) - rem);
-        }
-    }
-}
-
-void rshift_schunk(CHUNK *dest, CHUNK *src, int32_t n)
-{
-    uchunk slop;
-    int32_t chunkshift = n / (8*sizeof(uchunk));
-    int32_t rem = n % (8*sizeof(uchunk));
-    int32_t i, j, size;
-
-    /* i is the destination chunk */
-    slop = -1;
-    for (i=0; i<size; i++) {
-        j = i-chunkshift;
-        if (j < 0) {
-            dest->chunks[i] = -1;
-        } else {
-            dest->chunks[i] = slop | src->chunks[j] >> rem;
-            slop = src->chunks[j] << (8*sizeof(uchunk) - rem);
-        }
-    }
-}
-
-#endif
-
-
-void MyersUnlimitedFree ( MyersUnlimitedSearch *self )
-{
-    int32_t j;
-    for (j=0; j<256; j++) {
-        free_chunk(self->PEq[j]);
-        free_chunk(self->PEq_R[j]);
-    }
-    free(self);
-}
-  
-
-rc_t MyersUnlimitedMake ( MyersUnlimitedSearch **self,
-        AgrepFlags mode, const char *pattern )
-{
-    const unsigned char *upattern = (const unsigned char *)pattern;
-    int32_t rc;
-    int32_t len = strlen(pattern);
-    int32_t plen = len;
-    int32_t i, j;
-    int32_t m;
-    int32_t chunks;
-
-    if (!(mode & AGREP_ANYTHING_ELSE_IS_N) &&
-        any_non_4na_chars(pattern))
-        /* This should be a return code. */
-        return RC( rcText, rcString, rcSearching, rcParam, rcUnrecognized);
-
-
-    *self = malloc(sizeof(MyersUnlimitedSearch));
-    m = (*self)->m = len;
-    chunks = chunksize(m);
-    for (j=0; j<256; j++) {
-        (*self)->PEq[j] = alloc_chunk(chunks);
-        (*self)->PEq_R[j] = alloc_chunk(chunks);
-    }
-
-    for(j = 0; j < m; j++) {
-        chunk_set_bit((*self)->PEq[upattern[j]], j);
-        if( pattern[j] == 'a' ) {
-            chunk_set_bit((*self)->PEq['t'], j); /* t == a */
-        }
-    }
-
-    for(j = 0; j < m; j++) {
-        chunk_set_bit((*self)->PEq_R[upattern[m-j-1]], j);
-        if( pattern[m-j-1] == 'a' ) {
-            chunk_set_bit((*self)->PEq_R['t'], j); /* t == a */
-        }
-    }
-
-    for (i=0; i<4; i++) {
-        unsigned char acgt = NA2KEY[i];
-        for (j=0; j<plen; j++) {
-            if (na4key_matches(mode, pattern[j], acgt)) {
-                /* bits |= (unsigned long)1<<j; */
-                chunk_set_bit((*self)->PEq[acgt], j);
-                if (mode & AGREP_TEXT_EXPANDED_2NA)
-                    chunk_set_bit((*self)->PEq[i], j);
-            }
-        }
-    }
-    for (i=0; i<4; i++) {
-        unsigned char acgt = NA2KEY[i];
-        for (j=0; j<plen; j++) {
-            if (na4key_matches(mode, pattern[plen-j-1], acgt)) {
-                chunk_set_bit((*self)->PEq_R[acgt], j);
-                if (mode & AGREP_TEXT_EXPANDED_2NA)
-                    chunk_set_bit((*self)->PEq_R[i], j);
-            }
-        }
-    }
-    return 0;
-
-    for (j=0; j<256; j++) {
-        free_chunk((*self)->PEq[j]);
-        free_chunk((*self)->PEq_R[j]);
-    }
-    free(*self);
-    *self = NULL;
-    return rc;
-
-}
-
-
-/* 
-   This finds the first match forward in the string less than or equal
-   the threshold.  If nonzero, this will be a prefix of any exact match.
-*/
-uint32_t MyersUnlimitedFindFirst ( MyersUnlimitedSearch *self, 
-        int32_t threshold, const char* text, size_t n, AgrepMatch *match )
-{
-    const unsigned char *utext = (const unsigned char *)text;
-    CHUNK *Pv;
-    CHUNK *Mv;
-    CHUNK *Xv, *Xh, *Ph, *Mh;
-
-    int32_t m = self->m;
-    int32_t csize = chunksize(m);
-    int32_t Score;
-    int32_t BestScore = m;
-    int32_t from = 0;
-    int32_t to = -1;
-
-    int32_t j;
-
-    CHUNK *Eq;
-
-    Pv = alloc_chunk(csize);
-    Mv = alloc_chunk(csize);
-    Xv = alloc_chunk(csize);
-    Xh = alloc_chunk(csize);
-    Ph = alloc_chunk(csize);
-    Mh = alloc_chunk(csize);
-
-
-    Score = m;
-    chunk_set_minusone(Pv);
-    chunk_zero(Mv);
-    
-    for(j = 0; j < n; j++) {
-#ifdef DEBUG
-        printf("%d j loop\n", j);
-#endif
-        Eq = self->PEq[utext[j]];
-#ifdef DEBUG
-        printf("Eq: "); print_chunk(Eq); printf("\n");
-#endif
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-#ifdef DEBUG
-        printf("Xv: "); print_chunk(Xv); printf("\n");
-#endif
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-#ifdef DEBUG
-        printf("Xh: "); print_chunk(Xh); printf("\n");
-#endif
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-#ifdef DEBUG
-        printf("Pv: "); print_chunk(Pv); printf("\n");
-#endif
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-#ifdef DEBUG
-        printf("Mv: "); print_chunk(Mv); printf("\n");
-#endif
-#ifdef DEBUG
-        printf("%3d. score %d\n", j, Score);
-#endif
-        if (Score <= threshold) {
-            BestScore = Score;
-            to = j;
-            break;
-        }
-    }
-
-    /* Continue while score decreases under the threshold */
-    for(j++; j < n; j++) {
-        Eq = self->PEq[utext[j]];
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-
-#ifdef DEBUG	
-        printf("%3d. score %d\n", j, Score);
-#endif
-        if (Score < BestScore) {
-            BestScore = Score;
-            to = j;
-        } else {
-            break;
-        }
-    }
-
-    /* Re-initialize for next scan! */
-    Score = m;
-    chunk_set_minusone(Pv);
-    chunk_zero(Mv);
-    
-    for(j = to; j >= 0; j--) {
-        Eq = self->PEq_R[utext[j]]; 	/* This line is different. */
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-
-#ifdef DEBUG	
-        printf("%3d. score %d\n", j, Score); 
-#endif
-        if(Score <= BestScore) {
-#ifdef DEBUG	    
-            printf("rev match at position %d\n", j);
-#endif
-            from = j;
-            break;
-        }
-    }
-
-    free_chunk(Pv);
-    free_chunk(Mv);
-    free_chunk(Xv);
-    free_chunk(Xh);
-    free_chunk(Ph);
-    free_chunk(Mh);
-    
-    if (BestScore <= threshold) {
-        match->position = from;
-        match->length = to-from+1;
-        match->score = BestScore;
-        return 1;
-    } else {
-        return 0;
-    }
-}
-
-/* 
-   This finds the first match forward in the string less than or equal
-   the threshold.  If nonzero, this will be a prefix of any exact match.
-*/
-void MyersUnlimitedFindAll ( const AgrepCallArgs *args )
-{
-    AgrepFlags mode = args->self->mode;
-    MyersUnlimitedSearch *self = args->self->myersunltd;
-    int32_t threshold = args->threshold;
-    const unsigned char *utext = (const unsigned char *)args->buf;
-    int32_t n = args->buflen;
-    AgrepMatchCallback cb = dp_end_callback;
-    const void *cbinfo = args;
-
-    AgrepMatch match;
-    AgrepContinueFlag cont;
-
-    CHUNK *Pv;
-    CHUNK *Mv;
-    CHUNK *Xv, *Xh, *Ph, *Mh;
-
-    int32_t m = self->m;
-    int32_t csize = chunksize(m);
-    int32_t Score;
-
-    int32_t curscore = 0;
-    int32_t curlast = 0;
-    int32_t continuing = 0;
-
-    int32_t j;
-
-    CHUNK *Eq;
-
-
-
-    Pv = alloc_chunk(csize);
-    Mv = alloc_chunk(csize);
-    Xv = alloc_chunk(csize);
-    Xh = alloc_chunk(csize);
-    Ph = alloc_chunk(csize);
-    Mh = alloc_chunk(csize);
-
-    Score = m;
-    chunk_set_minusone(Pv);
-    chunk_zero(Mv);
-    
-    for(j = 0; j < n; j++) {
-#ifdef DEBUG
-        printf("%d j loop\n", j);
-#endif
-        Eq = self->PEq[utext[j]];
-#ifdef DEBUG
-        printf("Eq: "); print_chunk(Eq); printf("\n");
-#endif
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-#ifdef DEBUG
-        printf("Xv: "); print_chunk(Xv); printf("\n");
-#endif
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-#ifdef DEBUG
-        printf("Xh: "); print_chunk(Xh); printf("\n");
-#endif
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-#ifdef DEBUG
-        printf("Pv: "); print_chunk(Pv); printf("\n");
-#endif
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-#ifdef DEBUG
-        printf("Mv: "); print_chunk(Mv); printf("\n");
-#endif
-#ifdef DEBUG
-        printf("%3d. score %d\n", j, Score);
-#endif
-        if (Score <= threshold) {
-            if (continuing) {
-                if (Score < curscore &&
-                    ((mode & AGREP_EXTEND_BETTER) ||
-                     (mode & AGREP_EXTEND_SAME))) {
-                    curscore = Score;
-                    curlast = j;
-                } else if (Score == curscore &&
-                           ((mode & AGREP_EXTEND_BETTER) ||
-                            (mode & AGREP_EXTEND_SAME))) {
-                    if (mode & AGREP_EXTEND_SAME) {
-                        curlast = j;
-                    }
-                } else {
-                    continuing = 0;
-                    match.score = curscore;
-                    match.position = curlast;
-                    match.length = -1;
-                    cont = AGREP_CONTINUE;
-                    (*cb)(cbinfo, &match, &cont);
-                    if (cont != AGREP_CONTINUE)
-                        goto EXIT;
-                }
-            } else if ((mode & AGREP_EXTEND_SAME) ||
-                       (mode & AGREP_EXTEND_BETTER)) {
-                curscore = Score;
-                curlast = j;
-                continuing = 1;
-            } else {
-                match.score = Score;
-                match.position = j;
-                match.length = -1;
-                cont = AGREP_CONTINUE;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != AGREP_CONTINUE)
-                    goto EXIT;
-            }
-            /* If we're no longer under the threshold, we might
-               have been moving forward looking for a better match 
-            */
-        } else if (continuing) {
-            continuing = 0;
-            match.score = curscore;
-            match.position = curlast;
-            match.length = -1;
-            cont = AGREP_CONTINUE;
-            (*cb)(cbinfo, &match, &cont);
-            if (cont != AGREP_CONTINUE)
-                goto EXIT;
-        }
-        /* print_col_as_row(nxt, plen); */
-    }
-    if (continuing) {
-        continuing = 0;
-        match.score = curscore;
-        match.position = curlast;
-        match.length = -1;
-        (*cb)(cbinfo, &match, &cont);
-    }
-
-EXIT:
-
-    free_chunk(Pv);
-    free_chunk(Mv);
-    free_chunk(Xv);
-    free_chunk(Xh);
-    free_chunk(Ph);
-    free_chunk(Mh);
-}
-
-
-LIB_EXPORT int32_t CC MyersUnlimitedFindBest ( MyersUnlimitedSearch *self,
-        const char* text, size_t n, int32_t *pos, int32_t *len )
-{
-    const unsigned char *utext = (const unsigned char *)text;
-    CHUNK *Pv;
-    CHUNK *Mv;
-    CHUNK *Xv, *Xh, *Ph, *Mh;
-
-    int32_t m = self->m;
-    int32_t csize = chunksize(m);
-    int32_t Score;
-    int32_t BestScore = m;
-    int32_t from = 0;
-    int32_t to = -1;
-
-    int32_t j;
-
-    CHUNK *Eq;
-
-    Pv = alloc_chunk(csize);
-    Mv = alloc_chunk(csize);
-    Xv = alloc_chunk(csize);
-    Xh = alloc_chunk(csize);
-    Ph = alloc_chunk(csize);
-    Mh = alloc_chunk(csize);
-
-
-    Score = m;
-    chunk_set_minusone(Pv);
-    chunk_zero(Mv);
-    
-    for(j = 0; j < n; j++) {
-#ifdef DEBUG
-        printf("%d j loop\n", j);
-#endif
-        Eq = self->PEq[utext[j]];
-#ifdef DEBUG
-        printf("Eq: "); print_chunk(Eq); printf("\n");
-#endif
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-#ifdef DEBUG
-        printf("Xv: "); print_chunk(Xv); printf("\n");
-#endif
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-#ifdef DEBUG
-        printf("Xh: "); print_chunk(Xh); printf("\n");
-#endif
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-#ifdef DEBUG
-        printf("Ph: "); print_chunk(Ph); printf("\n");
-#endif
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-#ifdef DEBUG
-        printf("Mh: "); print_chunk(Mh); printf("\n");
-#endif
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-#ifdef DEBUG
-        printf("Pv: "); print_chunk(Pv); printf("\n");
-#endif
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-#ifdef DEBUG
-        printf("Mv: "); print_chunk(Mv); printf("\n");
-#endif
-#ifdef DEBUG
-        printf("%3d. score %d\n", j, Score);
-#endif
-        if (Score < BestScore) {
-            BestScore = Score;
-            to = j;
-        }
-    }
-
-    /* Re-initialize for next scan! */
-    Score = m;
-    chunk_set_minusone(Pv);
-    chunk_zero(Mv);
-    
-    for(j = to; j >= 0; j--) {
-        Eq = self->PEq_R[utext[j]]; 	/* This line is different. */
-        /* Xv = Eq | Mv; */
-        chunk_set(Xv, Eq);
-        chunk_or_in(Xv, Mv);
-        /* Xh = (((Eq & Pv) + Pv) ^ Pv) | Eq; */
-        chunk_set(Xh, Eq);
-        chunk_and_in(Xh, Pv);
-        chunk_add_in(Xh, Pv);
-        chunk_xor_in(Xh, Pv);
-        chunk_or_in(Xh, Eq);
-        /* Ph = Mv | ~ (Xh | Pv); */
-        chunk_set(Ph, Xh);
-        chunk_or_in(Ph, Pv);
-        chunk_negate(Ph);
-        chunk_or_in(Ph, Mv);
-        /* Mh = Pv & Xh; */
-        chunk_set(Mh, Pv);
-        chunk_and_in(Mh, Xh);
-        /* Ph & (1 << (m - 1)) */
-        if (chunk_isbit_set(Ph, m-1)) {
-            Score++;
-            /* Mh & (1 << (m - 1)) */
-        } else if (chunk_isbit_set(Mh, m-1)) {
-            Score--;
-        }
-        /* Ph <<= 1; */
-        chunk_lshift_one_inplace(Ph);
-        /* Mh <<= 1; */
-        chunk_lshift_one_inplace(Mh);
-        /* Pv = Mh | ~(Xv | Ph); */
-        chunk_set(Pv, Xv);
-        chunk_or_in(Pv, Ph);
-        chunk_negate(Pv);
-        chunk_or_in(Pv, Mh);
-        /* Mv = Ph & Xv; */
-        chunk_set(Mv, Ph);
-        chunk_and_in(Mv, Xv);
-
-#ifdef DEBUG
-        printf("%3d. score %d\n", j, Score); 
-#endif
-        if(Score <= BestScore) {
-#ifdef DEBUG
-            printf("rev match at position %d\n", j);
-#endif
-            from = j;
-            break;
-        }
-    }
-
-    free_chunk(Pv);
-    free_chunk(Mv);
-    free_chunk(Xv);
-    free_chunk(Xh);
-    free_chunk(Ph);
-    free_chunk(Mh);
-    
-    *pos = from;
-    *len = to-from+1;
-
-    return BestScore;
-
-    /* printf("Found [%d,%d]\n", from, to);
-       printf("Found '%.*s'\n", to - from + 1, &text[from]); */
-}
-
diff --git a/libs/search/agrep-wumanber.c b/libs/search/agrep-wumanber.c
deleted file mode 100644
index 881b83d..0000000
--- a/libs/search/agrep-wumanber.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "search-priv.h"
-
-static
-int32_t debug = 0;
-
-struct AgrepWuParams {
-    unsigned char* pattern;
-    int32_t len;
-    uint64_t alphabits[256];
-    uint64_t r_alphabits[256];
-    int64_t patmask; /* Actually an inverse mask (0's in the pattern positions) */
-};
-
-/* This now computes the alphabits for a 4na pattern. */
-static
-rc_t compute_alphabits_4na(AgrepWuParams *self, AgrepFlags mode)
-{
-    rc_t rc = 0;
-    int32_t i;
-
-    self->patmask = ((uint64_t) -1) << self->len;
-
-    for(i = 0; i < 256; i++) {
-        self->alphabits[i] = self->patmask;
-        self->r_alphabits[i] = self->patmask;
-    }
-    for(i = 0; rc == 0 && i < self->len; i++) {
-        if( (rc = na4_set_bits(mode, self->alphabits, self->pattern[i], (uint64_t)1<<(self->len-i-1))) == 0 ) {
-            rc = na4_set_bits(mode, self->r_alphabits, self->pattern[self->len-i-1], (uint64_t)1<<(self->len-i-1));
-        }
-    }
-    return rc;
-}
-
-static
-void compute_alphabits(AgrepWuParams *self)
-{
-    int32_t i, j;
-    uint64_t bits, patmask;
-
-    patmask = self->patmask = ((uint64_t)-1) << self->len;
- 
-    /* TBD use AGREP_IGNORE_CASE */
-    for (i=0; i<256; i++) {
-        bits = 0;
-        for (j=0; j<self->len; j++) {
-            if (self->pattern[j] == i) {
-                bits |= (uint64_t)1<<(self->len-j-1);
-            }
-        }
-        self->alphabits[i] = bits | patmask;
-    }
-    for (i=0; i<256; i++) {
-        bits = 0;
-        for (j=0; j<self->len; j++) {
-            if (self->pattern[self->len-j-1] == i) {
-                bits |= (uint64_t)1<<(self->len-j-1);
-            }
-        }
-        self->r_alphabits[i] = bits | patmask;
-    }
-}
-
-rc_t AgrepWuMake( AgrepWuParams **self, AgrepFlags mode, const char *pattern )
-{
-    rc_t rc = 0;
-
-    *self = NULL;
-    if(strlen(pattern) > 63) {
-        rc = RC( rcText, rcString, rcSearching, rcParam, rcExcessive);
-    } else if( (*self = malloc(sizeof(**self))) == NULL ) {
-        rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-    } else {
-        (*self)->pattern = (unsigned char*)strdup(pattern);
-        (*self)->len = strlen(pattern);
-        if( (*self)->pattern == NULL ) {
-            rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-        } else if(mode & AGREP_PATTERN_4NA) {
-            rc = compute_alphabits_4na(*self, mode);
-        } else {
-            compute_alphabits(*self);
-        }
-    }
-    if( rc != 0 ) {
-        AgrepWuFree(*self);
-        *self = NULL;
-    }
-    return rc;
-}
-
-void AgrepWuFree ( AgrepWuParams *self )
-{
-    if( self != NULL ) {
-        free(self->pattern);
-        free(self);
-    }
-}
-
-static
-void callback_with_end( const AgrepCallArgs *args )
-{
-    AgrepFlags mode = args->self->mode;
-    AgrepWuParams *self = args->self->wu;
-    int32_t threshold = args->threshold;
-    unsigned char *buf = (unsigned char *)args->buf;
-    int32_t buflen = args->buflen;
-    AgrepMatchCallback cb = dp_end_callback;
-    const void *cbinfo = args;
-    
-    AgrepMatch match;
-    AgrepContinueFlag cont;
-    int32_t i, k;
-    int64_t *R = malloc(sizeof(int64_t) * (threshold + 1));
-    int64_t *Rnew = malloc(sizeof(int64_t) * (threshold + 1));
-    int64_t *tmp;
-
-    int32_t Score;
-    int32_t curscore = 0;
-    int32_t curlast = 0;
-    int32_t continuing = 0;
-
-    for (k=0; k<=threshold; k++) {
-        R[k] = self->patmask>>k;
-    }
-
-    for (i=0; i<buflen; i++) {
-        /* Not with 2na, you don't! 
-        if (buf[i] == '\0')
-        break; */
-
-        uint64_t bits = self->alphabits[buf[i]];
-        Rnew[0] = (R[0] >> 1) & bits;
-        for (k=1; k<=threshold; k++) {
-            Rnew[k] = ((R[k] >> 1) & bits) | R[k-1]>>1 | Rnew[k-1]>>1 | R[k-1];
-        }
-        Score = -1;
-        for (k=0; k<=threshold; k++) {
-            if (Rnew[k] & 1) {
-                /* Found a match -- report ending position, use DP for backscan */
-                Score = k;
-                break;
-            }
-        }
-        if (Score >= 0) {
-            if (continuing) {
-                if (Score < curscore &&
-                    ((mode & AGREP_EXTEND_BETTER) ||
-                     (mode & AGREP_EXTEND_SAME))) {
-                    curscore = Score;
-                    curlast = i;
-                } else if (Score == curscore &&
-                           ((mode & AGREP_EXTEND_BETTER) ||
-                            (mode & AGREP_EXTEND_SAME))) {
-                    if (mode & AGREP_EXTEND_SAME) {
-                        curlast = i;
-                    }
-                } else {
-                    continuing = 0;
-                    match.score = curscore;
-                    match.position = curlast;
-                    match.length = -1;
-                    cont = AGREP_CONTINUE;
-                    (*cb)(cbinfo, &match, &cont);
-                    if (cont != AGREP_CONTINUE)
-                        goto EXIT;
-                }
-            } else if ((mode & AGREP_EXTEND_SAME) ||
-                       (mode & AGREP_EXTEND_BETTER)) {
-                curscore = Score;
-                curlast = i;
-                continuing = 1;
-            } else {
-                match.score = Score;
-                match.position = i;
-                match.length = -1;
-                cont = AGREP_CONTINUE;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != AGREP_CONTINUE)
-                    goto EXIT;
-            }
-            /* If we're no longer under the threshold, we might
-               have been moving forward looking for a better match 
-            */
-        } else if (continuing) {
-            continuing = 0;
-            match.score = curscore;
-            match.position = curlast;
-            match.length = -1;
-            cont = AGREP_CONTINUE;
-            (*cb)(cbinfo, &match, &cont);
-            if (cont != AGREP_CONTINUE)
-                goto EXIT;
-        }
-        tmp = R; R = Rnew; Rnew = tmp;
-    }
-    if (continuing) {
-        continuing = 0;
-        match.score = curscore;
-        match.position = curlast;
-        match.length = -1;
-        (*cb)(cbinfo, &match, &cont);
-    }
-EXIT:
-    free(R);
-    free(Rnew);
-}
-
-/* 
-   Returns -1 if no match found, otherwise returns ENDING position.
-*/
-
-static
-int32_t find_end(const AgrepWuParams *self, int32_t threshold, const char *buf, int32_t buflen, int32_t *score)
-{
-    const unsigned char *ubuf = (const unsigned char *)buf;
-    int32_t i, k;
-    int64_t *R = malloc(sizeof(int64_t) * (threshold + 1));
-    int64_t *Rnew = malloc(sizeof(int64_t) * (threshold + 1));
-    int64_t *tmp;
-    int32_t foundit = 0;
-    int32_t found = -1; /* This is the value. */
-    int32_t stillunderthreshold = 0;
-    uint64_t bits;
-
-    *score = threshold;
-
-    for (k=0; k<=threshold; k++) {
-        R[k] = self->patmask>>k;
-    }
-
-    for (i=0; i<buflen; i++) {
-
-        if (buf[i] == '\0')
-            break;
-        bits = self->alphabits[ubuf[i]];
-        Rnew[0] = (R[0] >> 1) & bits;
-        if (Rnew[0] & 1) {
-            /* Exact match */
-            *score = 0;
-            if (debug) {
-                printf("Found end match at position %d\n", i);
-            }
-            free(R);
-            free(Rnew);
-            return i;
-        }
-        stillunderthreshold = 0;
-        for (k=1; k<=threshold; k++) {
-
-            Rnew[k] = ((R[k] >> 1) & bits) | R[k-1]>>1 | Rnew[k-1]>>1 | R[k-1];
-
-            if (Rnew[k] & 1) {
-                stillunderthreshold = 1;
-                /* Approx match */
-                if (k <= *score) {
-                    *score = k;
-                    if (debug) {
-                        printf("Found approx match at position %d\n", i);
-                    }
-                    foundit = 1;
-                    found = i;
-                }
-            }
-        }
-        /* If we're here, we haven't found anything at the threshold we're looking. */
-        if (foundit && !stillunderthreshold) {
-            free(R);
-            free(Rnew);
-            return found;
-        }
-        tmp = R; R = Rnew; Rnew = tmp;
-    }
-    free(R);
-    free(Rnew);
-    if (foundit)
-        return found;
-    return -1;
-}
-
-/*
-We only need to compute up to the score we're searching for.
-
-Returns nonnegative if found, otherwise returns -1.
-*/
-static
-int32_t find_begin(const AgrepWuParams *self, const char *buf, int32_t buflen, int32_t end, int32_t score )
-{
-    const unsigned char *ubuf = (const unsigned char *)buf;
-    int32_t i, k;
-    int64_t *R = malloc(sizeof(int64_t) * (score + 1));
-    int64_t *Rnew = malloc(sizeof(int64_t) * (score + 1));
-    int64_t *tmp;
-    int32_t foundit = 0;
-    int32_t found = -1;
-
-    for (k=0; k<=score; k++) {
-        R[k] = self->patmask>>k;
-    }
-
-    for (i=end; i>=0; i--) {
-
-        uint64_t bits = self->r_alphabits[ubuf[i]];
-        Rnew[0] = (R[0] >> 1) & bits;
-        if (Rnew[0] & 1) {
-            /* Exact match */
-            if (debug) {
-                printf("Found begin match at position %d\n", i);
-            }
-            free(R);
-            free(Rnew);
-            return i;
-        }
-        for (k=1; k<=score; k++) {
-
-            Rnew[k] = ((R[k] >> 1) & bits) | R[k-1]>>1 | Rnew[k-1]>>1 | R[k-1];
-
-            if (Rnew[k] & 1) {
-                /* Approx match */
-                if (debug) {
-                    printf("Found approx begin match at position %d\n", i);
-                }
-                score = k; /* Not sure this has an effect */
-                foundit = 1;
-                found = i;
-                goto CONTINUE;
-            }
-        }
-        /* If we're here, we haven't found anything at the threshold we're looking */
-        if (foundit) {
-            free(R);
-            free(Rnew);
-            return found;
-        }
-    CONTINUE:
-        tmp = R; R = Rnew; Rnew = tmp;
-    }
-    free(R);
-    free(Rnew);
-    if (foundit)
-        return found;
-    return -1;
-}
-
-/* 
-Returns nonzero if found something.
-*/
-uint32_t AgrepWuFindFirst( const AgrepWuParams *self, 
-        int32_t threshold, const char *buf, int32_t buflen, AgrepMatch *match )
-{
-    int32_t end, begin;
-    int32_t score;
-    while (-1 != (end = find_end(self, threshold, buf, buflen, &score))) {
-        begin = find_begin(self, buf, buflen, end, threshold);
-        if (begin < 0) {
-            /* This is some kind of error condition -- when the reverse search
-               goes past the beginning.  I think I wasn't biasing the 
-               reverse search, so a "best" reverse search didn't necessarily 
-               start at the end of the matching sequence. */
-            /* printf("It happened\n"); */
-            begin = end-self->len - threshold;
-            if (begin < 0) {
-                begin = 0;
-            }
-        }
-        match->position = begin;
-        match->length = end - begin + 1;
-        match->score = score;
-        return 1;
-    }
-    return 0;
-}
-
-void AgrepWuFindAll( const AgrepCallArgs *args )
-{
-    callback_with_end( args );
-}
-    
-
diff --git a/libs/search/debug.h b/libs/search/debug.h
deleted file mode 100644
index cbbb709..0000000
--- a/libs/search/debug.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _h_search_debug_
-#define _h_search_debug_
-
-#include <klib/debug.h>
-
-#if _DEBUGGING
-#define SEARCH_DBGF(msg) DBGMSG(DBG_SEARCH, DBG_FLAG(DBG_SEARCH_METHOD), msg)
-#define SEARCH_DBG(fmt, ...) SEARCH_DBGF(("%s:%u: " fmt "\n", __func__, __LINE__, __VA_ARGS__))
-#define SEARCH_DBGERR(rc) SEARCH_DBGF(("%s:%u: %R\n", __func__, __LINE__, rc))
-#define SEARCH_DBGERRP(fmt, rc, ...) SEARCH_DBGF(("%s:%u: %R " fmt "\n", __func__, __LINE__, rc, __VA_ARGS__))
-#else
-#define SEARCH_DBG(fmt, ...) ((void)0)
-#define SEARCH_DBGERR(rc) ((void)0)
-#define SEARCH_DBGERRP(fmt, rc, ...) ((void)0)
-#define SEARCH_DBGF(msg) ((void)0)
-#endif
-
-#endif /* _h_search_debug_ */
diff --git a/libs/search/fgrep-aho.c b/libs/search/fgrep-aho.c
deleted file mode 100644
index b3001b4..0000000
--- a/libs/search/fgrep-aho.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include "search-priv.h"
-#include <sysalloc.h>
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-struct FgrepAhoParams {
-    struct trie *trie;
-    int32_t charskips[256];
-    int32_t minlength;
-};
-
-/*
-  Need tries for large alphabets -- maybe based on hashtable
-  of (state, char) pairs.
-  Can build alphabet-indexed trie for small alphabets.
-
-  Given a set of strings we're looking for, we have minlength.
-  We start looking at curpos + minlength.
-*/
-
-static int32_t quiet = 1;
-
-typedef struct out_s {
-    const char *s;
-    int32_t whichpattern;
-    struct out_s *nxt;
-} out_s;
-
-void push_out(out_s **where, const char *out, int32_t whichpattern)
-{
-    out_s *newout = malloc(sizeof(out_s));
-    newout->s = out;
-    newout->whichpattern = whichpattern;
-    newout->nxt = *where;
-    *where = newout;
-}
-    
-
-struct trie {
-    struct trie *next[256];  
-    struct trie *fail; /* New for aho-corasick */
-    out_s *outs;
-    char *debugs;
-    int32_t depth;
-    int32_t hasmatch; /* Has match below here in the trie. */
-};
-
-static
-void print_trie_node(struct trie *self, char *car)
-{
-    out_s *outs;
-    if (!quiet) {
-        printf("%s: %s: outputs ", car, self->debugs);
-        outs = self->outs;
-        while (outs != NULL) {
-            printf("%s ", outs->s);
-            outs = outs->nxt;
-        }
-    }
-}
-
-static
-void free_trie(struct trie *self)
-{
-    int i;
-    for (i=0; i<256; i++) {
-        if (self->next[i] != NULL) {
-            free_trie(self->next[i]);
-            self->next[i] = NULL;
-        }
-    }
-    free(self);
-}
-
-static
-void print_trie(struct trie *self, char *car) 
-{
-    int32_t i;
-    char buf[2];
-    if (!quiet) {
-        for (i=0; i<self->depth; i++) 
-            printf(" ");
-        print_trie_node(self, car);
-        for (i=0; i<256; i++) {
-            if (self->next[i] != NULL) {
-                buf[0] = i;
-                buf[1] = '\0';
-                print_trie(self->next[i], buf);
-            }
-        }
-    }
-}
-
-static
-void trie_enter(struct trie *self, int32_t whichpattern, const char *s, int32_t minlen)
-{
-    struct trie *cur = self;
-    struct trie *newone = NULL;
-    int32_t len;
-    int32_t i;
-    len = strlen(s);
-    for (i=0; i<len; i++) {
-        unsigned char c = (unsigned char)s[i];
-        if (NULL != cur->next[c]) {
-            cur->hasmatch = 1;
-            cur = cur->next[c];
-        } else {
-            newone = (struct trie *)malloc(sizeof(struct trie));
-            newone->fail = NULL;
-            newone->outs = NULL;
-            newone->debugs = substring(s, i+1);
-            newone->depth = i+1;
-            newone->hasmatch = 1;
-            memset( newone->next, 0, sizeof( *newone->next ) );
-            cur->next[c] = newone;
-            cur = newone;
-        }
-    }
-    push_out(&cur->outs, s, whichpattern);
-}
-
-static
-void trie_calc_failure_links(struct trie *self)
-{
-    struct queue_s {
-        struct trie *trie;
-        struct queue_s *nxt;
-    };
-    struct queue_s *queue = NULL;
-    struct queue_s *queueend = NULL;
-    struct queue_s *newq, *tmpqueue;
-    struct trie *r, *u, *v;
-    struct trie *trie;
-    int32_t i;
-    out_s *outs;
-
-    for (i = 0; i<256; i++) {
-        if ((trie = self->next[i]) != NULL) {
-            trie->fail = self;
-            newq = malloc(sizeof(struct queue_s));
-            newq->nxt = NULL;
-            newq->trie = trie;
-            if (queueend != NULL) {
-                queueend->nxt = newq;
-                queueend = newq;
-            } else {
-                queue = queueend = newq;
-            }
-        }
-    }
-    while (queue != NULL) {
-        r = queue->trie;
-        tmpqueue = queue;
-        queue = queue->nxt;
-        free(tmpqueue);
-        if (queueend == tmpqueue) {
-            queueend = NULL;
-        }
-
-        if (r == NULL) {
-            printf("It happened.\n");
-            continue;
-        }
-        
-        for (i = 0; i<256; i++) {
-            if ((u = r->next[i]) != NULL) {            
-                newq = malloc(sizeof(struct queue_s));
-                newq->trie = u;
-                newq->nxt = NULL;
-                if (queueend != NULL) {
-                    queueend->nxt = newq;
-                    queueend = newq;
-                } else {
-                    queue = queueend = newq;
-                }
-                /* Not sure about this stuff here. */
-                v = r->fail;
-                while (v != NULL && v->next[i] == NULL) {
-                    v = v->fail;
-                }
-                if (v != NULL && v->next[i] != NULL) {
-                    u->fail = v->next[i];
-                } else {
-                    u->fail = self;
-                }
-                outs = u->fail->outs;
-                while (outs != NULL) {
-                    push_out(&trie->outs, outs->s, outs->whichpattern);
-                    outs = outs->nxt;
-                }
-            }
-        }
-    }
-}
-
-static 
-void buildtrie(struct trie **self, const char *strings[], int32_t numstrings)
-{
-    int32_t i;
-    int32_t minlen = 1000000;
-    int32_t len;
-
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-        if (len < minlen) {
-            minlen = len;
-        }
-    }
-
-    *self = (struct trie *)malloc(sizeof(struct trie));
-    for (i=0; i<256; i++) {
-        (*self)->next[i] = NULL;
-    }
-    (*self)->outs = NULL;
-  
-    for (i=0; i<numstrings; i++) {
-        trie_enter(*self, i, strings[i], minlen);
-    }
-    trie_calc_failure_links(*self);
-}
-
-void FgrepAhoFree( FgrepAhoParams *self )
-{
-    free_trie(self->trie);
-    free(self);
-}
-
-void FgrepAhoMake ( FgrepAhoParams **self,
-        const char *strings[], uint32_t numstrings )
-{
-    int32_t i;
-    struct trie *trie;
-    int32_t len;
-    buildtrie(&trie, strings, numstrings);
-    if (!quiet) {
-        print_trie(trie, "");
-    }
-    *self = (FgrepAhoParams *)malloc(sizeof(FgrepAhoParams));
-    (*self)->trie = trie;
-    (*self)->minlength = 10000;
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-        if (len < (*self)->minlength) {
-            (*self)->minlength = len;
-        }
-    }
-}
-
-
-/* 
-Returns nonzero when found something.
-*/  
-uint32_t FgrepAhoFindFirst ( FgrepAhoParams *self,
-        const char *buf, size_t len, FgrepMatch *match )
-{
-    unsigned char *ubuf = (unsigned char *)buf;
-    struct trie *trie;
-    struct trie *newtrie;
-    
-    unsigned char nxt;
-    int32_t mend = 0;
-    
-    trie = self->trie;
-    while (mend < len) {
-        nxt = ubuf[mend++];
-        newtrie = trie->next[nxt];
-        if (newtrie == NULL) {
-            newtrie = trie->fail;
-            mend--;
-        }
-        if (newtrie == NULL) {
-            trie = self->trie;
-            mend++;
-        } else if (newtrie->outs != NULL) {
-            match->position = mend - newtrie->depth;
-            match->length = newtrie->depth;
-            match->whichpattern = newtrie->outs->whichpattern;
-            return 1;
-        } else {
-            trie = newtrie;
-        }
-    }
-    return 0;
-}
-
-int32_t FgrepAhoFindAll ( FgrepAhoParams *self,
-    char *buf, int32_t len, int32_t *whichpattern )
-{
-    unsigned char *ubuf = (unsigned char *)buf;
-    struct trie *trie;
-    struct trie *newtrie;
-
-    unsigned char nxt;
-    int32_t mend = 0;
-    
-    trie = self->trie;
-    while (mend < len) {
-        nxt = ubuf[mend++];
-        newtrie = trie->next[nxt];
-        if (newtrie == NULL) {
-            newtrie = trie->fail;
-            mend--;
-        }
-        if (newtrie == NULL) {
-            trie = self->trie;
-            mend++;
-        } else if (newtrie->outs != NULL) {
-            *whichpattern = newtrie->outs->whichpattern;
-            return mend - newtrie->depth;
-        } else {
-            trie = newtrie;
-        }
-    }
-    return -1;
-}
diff --git a/libs/search/fgrep-boyermoore.c b/libs/search/fgrep-boyermoore.c
deleted file mode 100644
index 375bd27..0000000
--- a/libs/search/fgrep-boyermoore.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include "search-priv.h"
-#include <sysalloc.h>
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
-  Need tries for large alphabets -- maybe based on hashtable
-  of (state, char) pairs.
-  Can build alphabet-indexed trie for small alphabets.
-
-  Given a set of strings we're looking for, we have minlength.
-  We start looking at curpos + minlength.
-*/
-
-static
-char *reverse_string(const char *s) 
-{
-    int32_t len = strlen(s);
-    char *ret = malloc(len+1);
-    char *rp = ret;
-    const char *src = s+len;
-    while (--src >= s) {
-        *rp++ = *src;
-    }
-    *rp = '\0';
-    return ret;
-}
-
-
-struct trie {
-    struct trie *next[256];
-    char *s;
-#ifdef DEBUG
-    char *debugs;
-#endif
-    int32_t whichpattern;
-    int32_t depth;
-    int32_t hasmatch; /* Has match below here in the trie. */
-    /*
-      Used to be called "contained".  Basically we have a pattern that
-      has been matched in the text, so we either need to contain this,
-      or use a suffix of this as a prefix of our pattern.
-
-      Any prospective pattern must either have its prefix here,
-      or contain what we've seen.
-      Note: this will be less than the skip below.
-    */
-    int32_t minskip_matched; 
-
-    /* 
-       The pattern contained unmatched chars.  This used to be called prefix.
-       Basically we have some unmatched characters, so it doesn't help to 
-       contain this pattern, we need to start our string using some suffix
-       of this pattern.  Note: the whole pattern could start a match.
-
-       Any prospective pattern must have its prefix match a suffix of this.
-    */
-    int32_t minskip_unmatched; 
-};
-
-#ifdef DEBUG
-
-static
-void print_trie_node(struct trie *self, char *car)
-{
-    printf("%s: %s: %s hasmatch %d matched %d unmatched %d\n",
-           car, self->debugs, self->s, self->hasmatch, self->minskip_matched, self->minskip_unmatched);
-}
-
-static
-void print_trie(struct trie *self, char *car) 
-{
-    int32_t i;
-    char buf[2];
-    for (i=0; i<self->depth; i++) 
-        printf(" ");
-    print_trie_node(self, car);
-    for (i=0; i<256; i++) {
-        if (self->next[i] != NULL) {
-            buf[0] = i;
-            buf[1] = '\0';
-            print_trie(self->next[i], buf);
-        }
-    }
-}
-
-#endif /* DEBUG */
-
-
-static
-void free_trie(struct trie *self)
-{
-    int i;
-    for (i=0; i<256; i++) {
-        if (self->next[i] != NULL) {
-            free_trie(self->next[i]);
-            self->next[i] = NULL;
-        }
-    }
-    free(self);
-}
-
-
-static
-void trie_enter(struct trie *self, int32_t whichpattern, char *s, int32_t minlen)
-{
-    struct trie *cur = self;
-    struct trie *newone = NULL;
-    int32_t len;
-    int32_t i;
-    len = strlen(s);
-    for (i=0; i<len; i++) {
-        unsigned char c = (unsigned char)s[i];
-        if (NULL != cur->next[c]) {
-            cur->hasmatch = 1;
-            cur = cur->next[c];
-        } else {
-            newone = (struct trie *)malloc(sizeof(struct trie));
-            newone->s = NULL;
-#ifdef DEBUG
-            newone->debugs = substring(s, i+1);
-#endif
-            newone->depth = i+1;
-            newone->hasmatch = 1;
-            newone->minskip_matched = minlen;
-            newone->minskip_unmatched = minlen;
-            memset( newone->next, 0, sizeof( *newone->next ) );
-            cur->next[c] = newone;
-            cur = newone;
-        }
-    }
-    cur->whichpattern = whichpattern;
-    cur->s = s;
-}
-
-static
-void trie_enter_suffixes(struct trie *self, char *s, int32_t minlen)
-{
-    struct trie *cur;
-    struct trie *newone;
-    int32_t suf;
-    int32_t i;
-    int32_t len;
-    len = strlen(s);
-    for (suf = 1; suf<len; suf++) {
-        cur = self;
-        for (i=0; suf+i<len; i++) {
-            unsigned char c = s[suf+i];
-            if (NULL != cur->next[c]) {
-                cur = cur->next[c];
-#ifdef NOPE
-                if (!cur->hasmatch)
-                    break;
-#endif
-            } else {
-                newone = (struct trie *)malloc(sizeof(struct trie));
-                newone->s = NULL;
-#ifdef DEBUG
-                newone->debugs = substring(s+suf, i+1);
-#endif
-                newone->depth = i+1;
-                newone->hasmatch = 0;
-                newone->minskip_matched = suf;
-                newone->minskip_unmatched = minlen;
-                memset( newone->next, 0, sizeof( *newone->next ) );
-                cur->next[c] = newone;
-                cur = newone;
-            }
-        }
-    }
-}
-
-
-/* This recurses down the trie and sets the prefix_skip
-   based upon what's computer in trie_set_minskip for the prefix skip.
-*/
-static
-void trie_recurse_prefix_minskip(struct trie *trie, int32_t skip) 
-{
-    int32_t i;
-    if (skip < trie->minskip_unmatched) {
-#ifdef DEBUG
-        if (trie->debugs == NULL) {
-            fprintf(stderr, "Setting minskip prefix unmatched of (something) to %d\n", skip);
-        } else {
-            fprintf(stderr, "Setting minskip prefix unmatched of %s to %d\n", trie->debugs, skip);
-        }
-#endif
-        trie->minskip_unmatched = skip;
-    }
-    if (skip < trie->minskip_matched) {
-#ifdef DEBUG
-        if (trie->debugs == NULL) {
-            fprintf(stderr, "Setting minskip prefix matched of (something) to %d\n", skip);
-        } else {
-            fprintf(stderr, "Setting minskip prefix matched of %s to %d\n", trie->debugs, skip);
-        }
-#endif
-        trie->minskip_matched = skip;
-    }
-    for (i=0; i<256; i++) {
-        if (trie->next[i] != NULL) {
-            trie_recurse_prefix_minskip(trie->next[i], skip);
-        }
-    }
-}
-
-static
-void trie_set_minskip(struct trie *trie, const char *s, const char *rs)
-{
-    unsigned char *urs = (unsigned char *)rs;
-    unsigned char *us = (unsigned char *)s;
-    struct trie *cur;
-    int32_t len;
-    int32_t i;
-    int32_t skip;
-    char buf[1024];
-    int32_t prefix;
-    len = strlen(rs);
-    for (skip=1; skip<len; skip++) {
-        cur = trie->next[urs[skip]];
-        for (i=1; i<len-skip && cur != NULL; i++) {
-            if (skip < cur->minskip_matched) {
-                strncpy(buf, rs+skip, i);
-                buf[i] = '\0';
-#ifdef DEBUG
-                fprintf(stderr, "Setting minskip contained of %s to %d\n", buf, skip);
-#endif                    
-                cur->minskip_matched = skip;
-            }
-            cur = cur->next[urs[skip+i]];
-        }
-    }
-    /* Now we need to set up minskip_prefix --
-       We need to walk down the tree from any prefix of our word,
-       and set the minskip_prefix based upon (wordlen-prefix).
-       Note: non-empty prefixes, so start at 1.
-    */
-    for (prefix = 1; prefix<len; prefix++) {
-        skip = len - prefix;
-        cur = trie;
-        for (i=prefix-1; i>=0 && cur != NULL; i--) {
-            cur = cur->next[us[i]];
-        }
-        if (cur != NULL) {
-#ifdef DEBUG
-            fprintf(stderr, "Setting minskip to at most %d in:\n", skip);
-            print_trie_node(cur, s);
-#endif            
-            trie_recurse_prefix_minskip(cur, skip);
-        }
-    }
-}
-
-static    
-void buildreversetrie(struct trie **self, const char *strings[], int32_t numstrings)
-{
-    int32_t i;
-    int32_t minlen = 1000000;
-    int32_t len;
-    char *reversestrings[10000];
-
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-        if (len < minlen) {
-            minlen = len;
-        }
-    }
-
-    *self = (struct trie *)malloc(sizeof(struct trie));
-    for (i=0; i<256; i++) {
-        (*self)->next[i] = NULL;
-    }
-    (*self)->s = NULL;
-  
-    for (i=0; i<numstrings; i++) {
-        reversestrings[i] = reverse_string(strings[i]);
-    }
-    for (i=0; i<numstrings; i++) {
-        trie_enter(*self, i, reversestrings[i], minlen);
-    }
-    for (i=0; i<numstrings; i++) {
-        trie_enter_suffixes(*self, reversestrings[i], minlen);
-    }
-    for (i=0; i<numstrings; i++) {
-        trie_set_minskip(*self, strings[i], reversestrings[i]);
-    }
-    (*self)->minskip_matched = 1;
-    (*self)->minskip_unmatched = minlen;
-}
-
-
-
-struct FgrepBoyerParams {
-    struct trie *trie;
-    int32_t charskips[256];
-    int32_t minlength;
-};
-
-
-void FgrepBoyerSearchFree( FgrepBoyerParams *self )
-{
-    free_trie(self->trie);
-    free(self);
-}
-
-
-void FgrepBoyerSearchMake ( FgrepBoyerParams **self,
-        const char *strings[], uint32_t numstrings )
-{
-    int32_t i;
-    struct trie *trie;
-    int32_t len;
-    buildreversetrie(&trie, strings, numstrings);
-#ifdef DEBUG
-    print_trie(trie, "");
-#endif
-    *self = (FgrepBoyerParams *)malloc(sizeof(FgrepBoyerParams));
-    (*self)->trie = trie;
-    (*self)->minlength = 10000;
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-        if (len < (*self)->minlength) {
-            (*self)->minlength = len;
-        }
-    }
-}
-
-/*
-  Currently implementing for bytes.
-  Returns non-negative if found, -1 if not.
-*/
-uint32_t FgrepBoyerFindFirst ( FgrepBoyerParams *self,
-        const char *buf, size_t len, FgrepMatch *match )
-{
-    unsigned char *ubuf = (unsigned char *)buf;
-    struct trie *trie;
-    struct trie *newtrie;
-    unsigned char *p = ubuf;
-    unsigned char *startp;
-    unsigned char *endp = ubuf+len;
-    int32_t skips = 0;
-
-    /* fprintf(stderr, "Searching %10s... for %d chars\n", buf, len); */
-    p = ubuf + self->minlength;
-    while (1) {
-        if (p >= endp)
-            break;
-        startp = p;
-        trie = self->trie;
-    CONT:
-        if (NULL == (newtrie = trie->next[*--p])) {
-            p = startp + trie->minskip_unmatched;
-            skips += trie->minskip_unmatched;
-            continue;
-        }
-        if (!newtrie->hasmatch) {
-            while (newtrie) {
-                trie = newtrie;
-                newtrie = newtrie->next[*--p];
-            }
-            p = startp + trie->minskip_unmatched;
-            skips += trie->minskip_unmatched;
-            continue;
-        }
-        if (newtrie->s != NULL) {
-            match->position = p - ubuf;
-            match->length = newtrie->depth;
-            match->whichpattern = newtrie->whichpattern;
-            return 1;
-        }
-        trie = newtrie;
-        goto CONT;
-    }
-    return 0;
-}
-
-void FgrepBoyerFindAll ( FgrepBoyerParams *self,
-        char *buf, int32_t len, FgrepMatchCallback cb, void *cbinfo )
-{
-    unsigned char *ubuf = (unsigned char *)buf;
-    struct trie *trie;
-    struct trie *newtrie;
-    unsigned char *p = ubuf;
-    unsigned char *startp;
-    unsigned char *endp = ubuf+len;
-    int32_t skips = 0;
-    FgrepContinueFlag cont;
-    FgrepMatch match;
-
-    /* fprintf(stderr, "Searching %10s... for %d chars\n", buf, len); */
-    p = ubuf + self->minlength;
-    while (1) {
-        if (p >= endp)
-            break;
-        startp = p;
-        trie = self->trie;
-    CONT:
-        if (NULL == (newtrie = trie->next[*--p])) {
-            p = startp + trie->minskip_unmatched;
-            skips += trie->minskip_unmatched;
-            continue;
-        }
-        if (!newtrie->hasmatch) {
-            while (newtrie) {
-                trie = newtrie;
-                newtrie = newtrie->next[*--p];
-            }
-            p = startp + trie->minskip_unmatched;
-            skips += trie->minskip_unmatched;
-            continue;
-        }
-        if (newtrie->s != NULL) {
-            cont = FGREP_CONTINUE;
-            match.position = p - ubuf;
-            match.length = newtrie->depth;
-            match.whichpattern = newtrie->whichpattern;
-            (*cb)(cbinfo, &match, &cont);
-            if (cont != FGREP_CONTINUE)
-                return;
-        }
-        trie = newtrie;
-        goto CONT;
-    }
-}
diff --git a/libs/search/fgrep-dumb.c b/libs/search/fgrep-dumb.c
deleted file mode 100644
index d34f09c..0000000
--- a/libs/search/fgrep-dumb.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <compiler.h>
-#include <os-native.h>
-#include "search-priv.h"
-#include <sysalloc.h>
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
-  Need tries for large alphabets -- maybe based on hashtable
-  of (state, char) pairs.
-  Can build alphabet-indexed trie for small alphabets.
-
-  Given a set of strings we're looking for, we have minlength.
-  We start looking at curpos + minlength.
-*/
-
-struct trie {
-    struct trie *next[256];
-    const char *s;
-#ifdef DEBUG
-    char *debugs;
-#endif
-    int32_t whichpattern;
-    int32_t depth;
-    int32_t hasmatch; /* Has match below here in the trie. */
-};
-
-struct FgrepDumbParams {
-    struct trie *trie;
-};
-
-
-#ifdef DEBUG
-
-static
-void print_trie_node(struct trie *self, char *car)
-{
-    printf("%s: %s: %s hasmatch %d\n",
-           car, self->debugs, self->s, 0);
-}
-
-static
-void print_trie(struct trie *self, char *car) 
-{
-    int32_t i;
-    char buf[2];
-    for (i=0; i<self->depth; i++) 
-        printf(" ");
-    print_trie_node(self, car);
-    for (i=0; i<256; i++) {
-        if (self->next[i] != NULL) {
-            buf[0] = i;
-            buf[1] = '\0';
-            print_trie(self->next[i], buf);
-        }
-    }
-}
-
-#endif /* DEBUG */
-
-static
-void free_trie(struct trie *self)
-{
-    int i;
-    for (i=0; i<256; i++) {
-        if (self->next[i] != NULL) {
-            free_trie(self->next[i]);
-            self->next[i] = NULL;
-        }
-    }
-    free(self);
-}
-
-static
-void trie_enter(struct trie *self, const char *s, int32_t minlen)
-{
-    struct trie *cur = self;
-    struct trie *newone = NULL;
-    int32_t len;
-    int32_t i;
-    len = strlen(s);
-    for (i=0; i<len; i++) {
-        unsigned char c = s[i];
-        if (NULL != cur->next[c]) {
-            cur->hasmatch = 1;
-            cur = cur->next[c];
-        } else {
-            newone = (struct trie *)malloc(sizeof(struct trie));
-            newone->s = NULL;
-#ifdef DEBUG
-            newone->debugs = substring(s, i+1);
-#endif
-            newone->depth = i+1;
-            newone->hasmatch = 1;
-            memset( newone->next, 0, sizeof( *newone->next ) );
-            cur->next[c] = newone;
-            cur = newone;
-        }
-    }
-    cur->s = s;
-}
-
-
-static
-void buildtrie(struct trie **self, const char *strings[], int32_t numstrings)
-{
-    int32_t i;
-    int32_t minlen = 1000000;
-    int32_t len;
-
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-        if (len < minlen) {
-            minlen = len;
-        }
-    }
-
-    *self = (struct trie *)malloc(sizeof(struct trie));
-    for (i=0; i<256; i++) {
-        (*self)->next[i] = NULL;
-    }
-    (*self)->s = NULL;
-  
-    for (i=0; i<numstrings; i++) {
-        trie_enter(*self, strings[i], minlen);
-    }
-}
-
-void FgrepDumbSearchFree( FgrepDumbParams *self )
-{
-    free_trie(self->trie);
-    free(self);
-}
-
-void FgrepDumbSearchMake( FgrepDumbParams **self,
-        const char *strings[], uint32_t numstrings )
-{
-    int32_t i;
-    struct trie *trie;
-    int32_t len;
-    buildtrie(&trie, strings, numstrings);
-    *self = (FgrepDumbParams *)malloc(sizeof(FgrepDumbParams));
-    (*self)->trie = trie;
-    for (i=0; i<numstrings; i++) {
-        len = strlen(strings[i]);
-    }
-}
-
-uint32_t FgrepDumbFindFirst( FgrepDumbParams *self,
-        const char *buf, size_t len, FgrepMatch *match )
-{
-    struct trie *trie;
-    struct trie *newtrie;
-    unsigned char *p = (unsigned char *)buf;
-    unsigned char *startp;
-    unsigned char *endp = (unsigned char *)buf+len;
-
-    for (startp = (unsigned char *)buf; startp < endp; startp++) {
-        p = startp;
-        trie = self->trie;
-        while (p < endp) {
-            newtrie = trie->next[*p++];
-            if (newtrie == NULL) {
-                break;
-            }
-            trie = newtrie;
-            if (trie->s != NULL) {
-                match->position = startp-(unsigned char *)buf;
-                match->length = trie->depth;
-                match->whichpattern = trie->whichpattern;
-                return 1;
-            }
-        }
-    }
-    return 0;
-}
-
-void FgrepDumbFindAll ( FgrepDumbParams *self,
-        char *buf, int32_t len, FgrepMatchCallback cb, void *cbinfo )
-{
-    unsigned char *ubuf = (unsigned char *)buf;
-    struct trie *trie;
-    struct trie *newtrie;
-    unsigned char *p = ubuf;
-    unsigned char *startp;
-    unsigned char *endp = ubuf+len;
-    FgrepContinueFlag cont;
-    FgrepMatch match;
-
-    for (startp = ubuf; startp < endp; startp++) {
-        p = startp;
-        trie = self->trie;
-        while (p < endp) {
-            newtrie = trie->next[*p++];
-            if (newtrie == NULL) {
-                break;
-            }
-            trie = newtrie;
-            if (trie->s != NULL) {
-                cont = FGREP_CONTINUE;
-                match.position = startp-ubuf;
-                match.length = trie->depth;
-                match.whichpattern = trie->whichpattern;
-                (*cb)(cbinfo, &match, &cont);
-                if (cont != FGREP_CONTINUE)
-                    return;
-            }
-        }
-    }
-}
-
-
-/* Try the longest match first. */
-LIB_EXPORT uint32_t CC has_left_exact_match( char *pattern, char *buf, size_t buflen, 
-                              int32_t *length )
-{
-    int32_t plen = strlen(pattern);
-    int32_t i, j;
-
-    /* Added bounds checking -- untested */
-    int32_t bound = plen;
-    if (buflen < bound)
-        bound = buflen;
-    
-    for (i=bound; i>=1; i--) {
-        for (j=0; j<i; j++) {
-            if (pattern[plen-i+j] != buf[j] &&
-                buf[j] != 'N')
-                goto CONT;
-        }
-        /* Found a match */
-        *length = i;
-        return 1;
-    CONT: {}
-    }
-    return 0;
-}
-
-LIB_EXPORT uint32_t CC has_right_exact_match( char *pattern, char *buf, size_t buflen, 
-                               int32_t *bestpos )
-{
-    int32_t plen = strlen(pattern);
-    int32_t bound = plen;
-    int32_t i, j;
-
-    if (buflen <= 0)
-        return 0;
-
-    if (buflen < bound) 
-        bound = buflen;
-
-    /* i is here the length of the prefix */
-    for (i=bound; i>=1; i--) {
-        for (j=0; j<i; j++) {
-            if (pattern[j] != buf[buflen-i+j] &&
-                buf[buflen-i+j] != 'N')
-                goto CONT;
-        }
-        /* Found a match */
-        *bestpos = buflen-i;
-        return 1;
-    CONT: {}
-    }
-    return 0;
-}
-
-
-/* Try the longest match first. */
-/* Used to assume that the text to be matched was at least as long as 
-the pattern.  No more. 
-*/
-LIB_EXPORT uint32_t CC has_inside_exact_match( char *pattern, char *buf, size_t buflen, 
-                                int32_t *skip )
-{
-    int32_t plen = strlen(pattern);
-    int32_t i, j;
-
-    if (buflen <= 0)
-        return 0;
-
-    /* i is here the start in the pattern */
-    for (i=1; i<=plen; i++) {
-        for (j=0; j<buflen; j++) {
-            if (pattern[i+j] != buf[j] &&
-                buf[j] != 'N')
-                goto CONT;
-        }
-        /* Found a match */
-        *skip = i;
-        return 1;
-    CONT: {}
-    }
-    return 0;
-}
-
diff --git a/libs/search/libksrch.vers b/libs/search/libksrch.vers
deleted file mode 100644
index 2ac9634..0000000
--- a/libs/search/libksrch.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.13
diff --git a/libs/search/libnucstrstr.vers b/libs/search/libnucstrstr.vers
deleted file mode 100644
index 6d7de6e..0000000
--- a/libs/search/libnucstrstr.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.2
diff --git a/libs/search/nucstrstr-icc-i386-dbg.pic.s b/libs/search/nucstrstr-icc-i386-dbg.pic.s
deleted file mode 100644
index 3fe1a26..0000000
--- a/libs/search/nucstrstr-icc-i386-dbg.pic.s
+++ /dev/null
@@ -1,31488 +0,0 @@
-	.section .text
-.LNDBG_TX:
-# -- Machine type IA32
-# mark_description "Intel(R) C++ Compiler for applications running on IA-32, Version 10.1    Build 20081024 %s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -I/";
-# mark_description "home/yaschenk/devel/internal/asm-trace/inc/gcc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I/hom";
-# mark_description "e/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home/rod";
-# mark_description "armer/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -g -Wall -D_DEBUGGING -DLINUX -DUNIX -D_GN";
-# mark_description "U_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.file "nucstrstr.c"
-	.data
-	.text
-..TXTST0:
-# -- Begin  uint16_lsbit
-# mark_begin;
-       .align    2,0x90
-uint16_lsbit:
-# parameter 1(self): 8 + %ebp
-..B1.1:                         # Preds ..B1.0
-..___tag_value_uint16_lsbit.2:                                  #
-..LN1:
-        pushl     %ebp                                          #38.1
-        movl      %esp, %ebp                                    #38.1
-..___tag_value_uint16_lsbit.7:                                  #
-        pushl     %esi                                          #38.1
-..LN3:
-        movzwl    8(%ebp), %eax                                 #40.0
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #40.0
-        movw      %ax, -4(%ebp)                                 #40.0
-..LN5:
-        movswl    -4(%ebp), %eax                                #49.12
-        leave                                                   #49.12
-..___tag_value_uint16_lsbit.11:                                 #
-        ret                                                     #49.12
-        .align    2,0x90
-..___tag_value_uint16_lsbit.12:                                 #
-                                # LOE
-# mark_end;
-	.type	uint16_lsbit, at function
-	.size	uint16_lsbit,.-uint16_lsbit
-.LNuint16_lsbit:
-	.data
-# -- End  uint16_lsbit
-	.data
-	.text
-# -- Begin  uint128_shr
-# mark_begin;
-       .align    2,0x90
-uint128_shr:
-# parameter 1(self): 8 + %ebp
-# parameter 2(i): 12 + %ebp
-..B2.1:                         # Preds ..B2.0
-..___tag_value_uint128_shr.15:                                  #
-..LN7:
-        pushl     %ebp                                          #295.1
-        movl      %esp, %ebp                                    #295.1
-..___tag_value_uint128_shr.20:                                  #
-..LN9:
-        movl      8(%ebp), %edx                                 #296.0
-        movl      12(%ebp), %ecx                                #296.0
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #296.0
-..LN11:
-        leave                                                   #310.1
-..___tag_value_uint128_shr.24:                                  #
-        ret                                                     #310.1
-        .align    2,0x90
-..___tag_value_uint128_shr.25:                                  #
-                                # LOE
-# mark_end;
-	.type	uint128_shr, at function
-	.size	uint128_shr,.-uint128_shr
-.LNuint128_shr:
-	.data
-# -- End  uint128_shr
-	.text
-# -- Begin  uint128_bswap
-# mark_begin;
-       .align    2,0x90
-uint128_bswap:
-# parameter 1(self): 8 + %ebp
-..B3.1:                         # Preds ..B3.0
-..___tag_value_uint128_bswap.28:                                #
-..LN13:
-        pushl     %ebp                                          #333.1
-        movl      %esp, %ebp                                    #333.1
-..___tag_value_uint128_bswap.33:                                #
-..LN15:
-        movl      8(%ebp), %ecx                                 #334.0
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #334.0
-..LN17:
-        leave                                                   #352.1
-..___tag_value_uint128_bswap.37:                                #
-        ret                                                     #352.1
-        .align    2,0x90
-..___tag_value_uint128_bswap.38:                                #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap, at function
-	.size	uint128_bswap,.-uint128_bswap
-.LNuint128_bswap:
-	.data
-# -- End  uint128_bswap
-	.text
-# -- Begin  uint128_bswap_copy
-# mark_begin;
-       .align    2,0x90
-uint128_bswap_copy:
-# parameter 1(to): 8 + %ebp
-# parameter 2(from): 12 + %ebp
-..B4.1:                         # Preds ..B4.0
-..___tag_value_uint128_bswap_copy.41:                           #
-..LN19:
-        pushl     %ebp                                          #356.1
-        movl      %esp, %ebp                                    #356.1
-..___tag_value_uint128_bswap_copy.46:                           #
-..LN21:
-        movl      8(%ebp), %ecx                                 #357.0
-        movl      12(%ebp), %edx                                #357.0
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #357.0
-..LN23:
-        leave                                                   #377.1
-..___tag_value_uint128_bswap_copy.50:                           #
-        ret                                                     #377.1
-        .align    2,0x90
-..___tag_value_uint128_bswap_copy.51:                           #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap_copy, at function
-	.size	uint128_bswap_copy,.-uint128_bswap_copy
-.LNuint128_bswap_copy:
-	.data
-# -- End  uint128_bswap_copy
-	.data
-	.text
-# -- Begin  prime_buffer_2na
-# mark_begin;
-       .align    2,0x90
-prime_buffer_2na:
-# parameter 1(src): 8 + %ebx
-# parameter 2(ignore): 12 + %ebx
-..B5.1:                         # Preds ..B5.0
-..___tag_value_prime_buffer_2na.54:                             #
-..LN25:
-        pushl     %ebx                                          #2129.1
-..___tag_value_prime_buffer_2na.59:                             #
-        movl      %esp, %ebx                                    #2129.1
-..___tag_value_prime_buffer_2na.60:                             #
-        andl      $-16, %esp                                    #2129.1
-        pushl     %ebp                                          #2129.1
-        pushl     %ebp                                          #2129.1
-        movl      4(%ebx), %ebp                                 #2129.1
-        movl      %ebp, 4(%esp)                                 #2129.1
-        movl      %esp, %ebp                                    #2129.1
-..___tag_value_prime_buffer_2na.62:                             #
-        subl      $24, %esp                                     #2129.1
-..LN27:
-        movl      8(%ebx), %eax                                 #2132.23
-..LN29:
-        testb     $15, %al                                      #2132.29
-..LN31:
-        jne       ..B5.3        # Prob 50%                      #2132.37
-                                # LOE
-..B5.2:                         # Preds ..B5.1
-..LN33:
-        movl      8(%ebx), %eax                                 #2133.54
-        movdqa    (%eax), %xmm0                                 #2133.54
-..LN35:
-        movdqa    %xmm0, -24(%ebp)                              #2133.9
-        jmp       ..B5.4        # Prob 100%                     #2133.9
-                                # LOE
-..B5.3:                         # Preds ..B5.1
-..LN37:
-        movl      8(%ebx), %eax                                 #2135.55
-        movdqu    (%eax), %xmm0                                 #2135.55
-..LN39:
-        movdqa    %xmm0, -24(%ebp)                              #2135.9
-                                # LOE
-..B5.4:                         # Preds ..B5.2 ..B5.3
-..LN41:
-        movdqa    -24(%ebp), %xmm0                              #2136.12
-        leave                                                   #2136.12
-..___tag_value_prime_buffer_2na.65:                             #
-        movl      %ebx, %esp                                    #2136.12
-        popl      %ebx                                          #2136.12
-..___tag_value_prime_buffer_2na.66:                             #
-        ret                                                     #2136.12
-        .align    2,0x90
-..___tag_value_prime_buffer_2na.68:                             #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_2na, at function
-	.size	prime_buffer_2na,.-prime_buffer_2na
-.LNprime_buffer_2na:
-	.data
-# -- End  prime_buffer_2na
-	.data
-	.align 32
-	.align 32
-expand_2na:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na, at object
-	.size	expand_2na,512
-	.data
-	.text
-# -- Begin  prime_buffer_4na
-# mark_begin;
-       .align    2,0x90
-prime_buffer_4na:
-# parameter 1(src): 8 + %ebx
-# parameter 2(ignore): 12 + %ebx
-..B6.1:                         # Preds ..B6.0
-..___tag_value_prime_buffer_4na.71:                             #
-..LN43:
-        pushl     %ebx                                          #3990.1
-..___tag_value_prime_buffer_4na.76:                             #
-        movl      %esp, %ebx                                    #3990.1
-..___tag_value_prime_buffer_4na.77:                             #
-        andl      $-16, %esp                                    #3990.1
-        pushl     %ebp                                          #3990.1
-        pushl     %ebp                                          #3990.1
-        movl      4(%ebx), %ebp                                 #3990.1
-        movl      %ebp, 4(%esp)                                 #3990.1
-        movl      %esp, %ebp                                    #3990.1
-..___tag_value_prime_buffer_4na.79:                             #
-        subl      $40, %esp                                     #3990.1
-        call      ..L81         # Prob 100%                     #3990.1
-..L81:                                                          #
-        popl      %eax                                          #3990.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L81], %eax      #3990.1
-..LN45:
-        movl      8(%ebx), %edx                                 #3996.34
-        movzbl    (%edx), %edx                                  #3996.34
-        movzbl    %dl, %edx                                     #3996.34
-..LN47:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #3996.21
-..LN49:
-        movw      %dx, -40(%ebp)                                #3996.5
-..LN51:
-        movl      8(%ebx), %edx                                 #3997.34
-        movzbl    1(%edx), %edx                                 #3997.34
-        movzbl    %dl, %edx                                     #3997.34
-..LN53:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #3997.21
-..LN55:
-        movw      %dx, -38(%ebp)                                #3997.5
-..LN57:
-        movl      8(%ebx), %edx                                 #3998.34
-        movzbl    2(%edx), %edx                                 #3998.34
-        movzbl    %dl, %edx                                     #3998.34
-..LN59:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #3998.21
-..LN61:
-        movw      %dx, -36(%ebp)                                #3998.5
-..LN63:
-        movl      8(%ebx), %edx                                 #3999.34
-        movzbl    3(%edx), %edx                                 #3999.34
-        movzbl    %dl, %edx                                     #3999.34
-..LN65:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #3999.21
-..LN67:
-        movw      %dx, -34(%ebp)                                #3999.5
-..LN69:
-        movl      8(%ebx), %edx                                 #4000.34
-        movzbl    4(%edx), %edx                                 #4000.34
-        movzbl    %dl, %edx                                     #4000.34
-..LN71:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #4000.21
-..LN73:
-        movw      %dx, -32(%ebp)                                #4000.5
-..LN75:
-        movl      8(%ebx), %edx                                 #4001.34
-        movzbl    5(%edx), %edx                                 #4001.34
-        movzbl    %dl, %edx                                     #4001.34
-..LN77:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #4001.21
-..LN79:
-        movw      %dx, -30(%ebp)                                #4001.5
-..LN81:
-        movl      8(%ebx), %edx                                 #4002.34
-        movzbl    6(%edx), %edx                                 #4002.34
-        movzbl    %dl, %edx                                     #4002.34
-..LN83:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %edx          #4002.21
-..LN85:
-        movw      %dx, -28(%ebp)                                #4002.5
-..LN87:
-        movl      8(%ebx), %edx                                 #4003.34
-        movzbl    7(%edx), %edx                                 #4003.34
-        movzbl    %dl, %edx                                     #4003.34
-..LN89:
-        movzwl    expand_2na at GOTOFF(%eax,%edx,2), %eax          #4003.21
-..LN91:
-        movw      %ax, -26(%ebp)                                #4003.5
-..LN93:
-        movdqu    -40(%ebp), %xmm0                              #4005.51
-..LN95:
-        movdqa    %xmm0, -24(%ebp)                              #4005.5
-..LN97:
-        movdqa    -24(%ebp), %xmm0                              #4006.12
-        leave                                                   #4006.12
-..___tag_value_prime_buffer_4na.83:                             #
-        movl      %ebx, %esp                                    #4006.12
-        popl      %ebx                                          #4006.12
-..___tag_value_prime_buffer_4na.84:                             #
-        ret                                                     #4006.12
-        .align    2,0x90
-..___tag_value_prime_buffer_4na.86:                             #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_4na, at function
-	.size	prime_buffer_4na,.-prime_buffer_4na
-.LNprime_buffer_4na:
-	.data
-# -- End  prime_buffer_4na
-	.section .rodata, "a"
-	.align 4
-	.align 4
-__$U0:
-	.byte	78
-	.byte	117
-	.byte	99
-	.byte	83
-	.byte	116
-	.byte	114
-	.byte	70
-	.byte	97
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	69
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	65
-	.byte	108
-	.byte	108
-	.byte	111
-	.byte	99
-	.byte	0
-	.type	__$U0, at object
-	.size	__$U0,21
-	.space 3	# pad
-_2__STRING.1:
-	.byte	110
-	.byte	117
-	.byte	99
-	.byte	115
-	.byte	116
-	.byte	114
-	.byte	115
-	.byte	116
-	.byte	114
-	.byte	46
-	.byte	99
-	.byte	0
-	.type	_2__STRING.1, at object
-	.size	_2__STRING.1,12
-_2__STRING.0:
-	.byte	40
-	.byte	32
-	.byte	40
-	.byte	32
-	.byte	115
-	.byte	105
-	.byte	122
-	.byte	101
-	.byte	95
-	.byte	116
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	113
-	.byte	117
-	.byte	101
-	.byte	114
-	.byte	121
-	.byte	32
-	.byte	91
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	93
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	112
-	.byte	97
-	.byte	116
-	.byte	116
-	.byte	101
-	.byte	114
-	.byte	110
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	49
-	.byte	53
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	61
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	0
-	.type	_2__STRING.0, at object
-	.size	_2__STRING.0,54
-	.space 2	# pad
-_2__STRING.2:
-	.byte	40
-	.byte	32
-	.byte	40
-	.byte	32
-	.byte	115
-	.byte	105
-	.byte	122
-	.byte	101
-	.byte	95
-	.byte	116
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	113
-	.byte	117
-	.byte	101
-	.byte	114
-	.byte	121
-	.byte	32
-	.byte	91
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	93
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	109
-	.byte	97
-	.byte	115
-	.byte	107
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	49
-	.byte	53
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	61
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	0
-	.type	_2__STRING.2, at object
-	.size	_2__STRING.2,51
-	.data
-	.text
-# -- Begin  NucStrFastaExprAlloc
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprAlloc:
-# parameter 1(sz): 8 + %ebp
-..B7.1:                         # Preds ..B7.0
-..___tag_value_NucStrFastaExprAlloc.89:                         #
-..LN99:
-        pushl     %ebp                                          #790.1
-        movl      %esp, %ebp                                    #790.1
-..___tag_value_NucStrFastaExprAlloc.94:                         #
-        subl      $24, %esp                                     #790.1
-        movl      %ebx, -4(%ebp)                                #790.1
-..___tag_value_NucStrFastaExprAlloc.97:                         #
-        call      ..L98         # Prob 100%                     #790.1
-..L98:                                                          #
-        popl      %eax                                          #790.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L98], %eax      #790.1
-        movl      %eax, -12(%ebp)                               #790.1
-..LN101:
-        addl      $0, %esp                                      #791.19
-..LN103:
-        movl      8(%ebp), %edx                                 #791.28
-..LN105:
-        addl      $16, %edx                                     #791.33
-        movl      %edx, (%esp)                                  #791.33
-..LN107:
-        movl      %eax, %ebx                                    #791.19
-        call      malloc at PLT                                    #791.19
-                                # LOE eax
-..B7.11:                        # Preds ..B7.1
-        popl      %ecx                                          #791.19
-        movl      %eax, -8(%ebp)                                #791.19
-                                # LOE
-..B7.2:                         # Preds ..B7.11
-..LN109:
-        movl      -8(%ebp), %eax                                #791.17
-        movl      %eax, -16(%ebp)                               #791.17
-..LN111:
-        movl      -16(%ebp), %eax                               #792.10
-..LN113:
-        testl     %eax, %eax                                    #792.19
-        je        ..B7.8        # Prob 50%                      #792.19
-                                # LOE
-..B7.3:                         # Preds ..B7.2
-..LN115:
-        movl      -16(%ebp), %eax                               #795.28
-..LN117:
-        addl      $15, %eax                                     #795.36
-..LN119:
-        andl      $-16, %eax                                    #795.43
-..LN121:
-        movl      %eax, -20(%ebp)                               #794.28
-..LN123:
-        movl      -20(%ebp), %eax                               #796.9
-..LN125:
-        movl      -16(%ebp), %edx                               #796.26
-..LN127:
-        movl      %edx, 8(%eax)                                 #796.9
-..LN129:
-        movl      -20(%ebp), %eax                               #797.9
-        testb     $15, %al                                      #797.9
-        je        ..B7.5        # Prob 50%                      #797.9
-..___tag_value_NucStrFastaExprAlloc.99:                         #
-                                # LOE
-..B7.4:                         # Preds ..B7.3
-        addl      $-16, %esp                                    #797.9
-        movl      -12(%ebp), %eax                               #797.9
-        lea       _2__STRING.0 at GOTOFF(%eax), %eax               #797.9
-        movl      %eax, (%esp)                                  #797.9
-        movl      -12(%ebp), %eax                               #797.9
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #797.9
-        movl      %eax, 4(%esp)                                 #797.9
-        movl      $797, 8(%esp)                                 #797.9
-        movl      -12(%ebp), %eax                               #797.9
-        lea       __$U0 at GOTOFF(%eax), %eax                      #797.9
-        movl      %eax, 12(%esp)                                #797.9
-        movl      -12(%ebp), %eax                               #797.9
-        movl      %eax, %ebx                                    #797.9
-        call      __assert_fail at PLT                             #797.9
-                                # LOE
-..B7.12:                        # Preds ..B7.4
-        addl      $16, %esp                                     #797.9
-..___tag_value_NucStrFastaExprAlloc.100:                        #
-                                # LOE
-..B7.5:                         # Preds ..B7.3
-..LN131:
-        movl      -20(%ebp), %eax                               #798.9
-        testb     $15, %al                                      #798.9
-        je        ..B7.7        # Prob 50%                      #798.9
-..___tag_value_NucStrFastaExprAlloc.101:                        #
-                                # LOE
-..B7.6:                         # Preds ..B7.5
-        addl      $-16, %esp                                    #798.9
-        movl      -12(%ebp), %eax                               #798.9
-        lea       _2__STRING.2 at GOTOFF(%eax), %eax               #798.9
-        movl      %eax, (%esp)                                  #798.9
-        movl      -12(%ebp), %eax                               #798.9
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #798.9
-        movl      %eax, 4(%esp)                                 #798.9
-        movl      $798, 8(%esp)                                 #798.9
-        movl      -12(%ebp), %eax                               #798.9
-        lea       __$U0 at GOTOFF(%eax), %eax                      #798.9
-        movl      %eax, 12(%esp)                                #798.9
-        movl      -12(%ebp), %eax                               #798.9
-        movl      %eax, %ebx                                    #798.9
-        call      __assert_fail at PLT                             #798.9
-                                # LOE
-..B7.13:                        # Preds ..B7.6
-        addl      $16, %esp                                     #798.9
-..___tag_value_NucStrFastaExprAlloc.102:                        #
-                                # LOE
-..B7.7:                         # Preds ..B7.5
-..LN133:
-        movl      -20(%ebp), %eax                               #799.16
-        movl      -4(%ebp), %ebx                                #799.16
-..___tag_value_NucStrFastaExprAlloc.103:                        #
-        leave                                                   #799.16
-..___tag_value_NucStrFastaExprAlloc.105:                        #
-        ret                                                     #799.16
-..___tag_value_NucStrFastaExprAlloc.106:                        #
-                                # LOE
-..B7.8:                         # Preds ..B7.2
-..LN135:
-        xorl      %eax, %eax                                    #801.12
-        movl      -4(%ebp), %ebx                                #801.12
-..___tag_value_NucStrFastaExprAlloc.108:                        #
-        leave                                                   #801.12
-..___tag_value_NucStrFastaExprAlloc.110:                        #
-        ret                                                     #801.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprAlloc.111:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprAlloc, at function
-	.size	NucStrFastaExprAlloc,.-NucStrFastaExprAlloc
-.LNNucStrFastaExprAlloc:
-	.data
-# -- End  NucStrFastaExprAlloc
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map:
-	.type	fasta_2na_map, at object
-	.size	fasta_2na_map,128
-	.space 128	# pad
-	.data
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake2:
-# parameter 1(expr): 8 + %ebp
-# parameter 2(positional): 12 + %ebp
-# parameter 3(fasta): 16 + %ebp
-# parameter 4(size): 20 + %ebp
-..B8.1:                         # Preds ..B8.0
-..___tag_value_NucStrFastaExprMake2.114:                        #
-..LN137:
-        pushl     %ebp                                          #838.1
-        movl      %esp, %ebp                                    #838.1
-..___tag_value_NucStrFastaExprMake2.119:                        #
-        subl      $60, %esp                                     #838.1
-        movl      %ebx, -4(%ebp)                                #838.1
-..___tag_value_NucStrFastaExprMake2.122:                        #
-..LN139:
-        movl      20(%ebp), %eax                                #844.10
-..LN141:
-        cmpl      $61, %eax                                     #844.17
-        jbe       ..B8.3        # Prob 50%                      #844.17
-                                # LOE
-..B8.2:                         # Preds ..B8.1
-..LN143:
-        movl      $7, %eax                                      #845.16
-        movl      -4(%ebp), %ebx                                #845.16
-..___tag_value_NucStrFastaExprMake2.123:                        #
-        leave                                                   #845.16
-..___tag_value_NucStrFastaExprMake2.125:                        #
-        ret                                                     #845.16
-..___tag_value_NucStrFastaExprMake2.126:                        #
-                                # LOE
-..B8.3:                         # Preds ..B8.1
-..LN145:
-        pushl     %edi                                          #847.9
-..LN147:
-        movl      $144, (%esp)                                  #847.32
-..LN149:
-        call      NucStrFastaExprAlloc                          #847.9
-                                # LOE eax
-..B8.48:                        # Preds ..B8.3
-        popl      %ecx                                          #847.9
-        movl      %eax, -16(%ebp)                               #847.9
-                                # LOE
-..B8.4:                         # Preds ..B8.48
-        call      ..L128        # Prob 100%                     #
-..L128:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L128], %eax     #
-        movl      %eax, -12(%ebp)                               #
-..LN151:
-        movl      -16(%ebp), %eax                               #847.5
-        movl      %eax, -20(%ebp)                               #847.5
-..LN153:
-        movl      -20(%ebp), %eax                               #848.10
-..LN155:
-        testl     %eax, %eax                                    #848.15
-        jne       ..B8.6        # Prob 50%                      #848.15
-                                # LOE
-..B8.5:                         # Preds ..B8.4
-..LN157:
-        movl      -12(%ebp), %eax                               #849.16
-        movl      %eax, %ebx                                    #849.16
-        call      __errno_location at PLT                          #849.16
-                                # LOE eax
-..B8.49:                        # Preds ..B8.5
-        movl      (%eax), %eax                                  #849.16
-        movl      -4(%ebp), %ebx                                #849.16
-..___tag_value_NucStrFastaExprMake2.129:                        #
-        leave                                                   #849.16
-..___tag_value_NucStrFastaExprMake2.131:                        #
-        ret                                                     #849.16
-..___tag_value_NucStrFastaExprMake2.132:                        #
-                                # LOE
-..B8.6:                         # Preds ..B8.4
-..LN159:
-        movl      8(%ebp), %eax                                 #851.5
-..LN161:
-        movl      -20(%ebp), %edx                               #851.14
-..LN163:
-        movl      %edx, (%eax)                                  #851.5
-..LN165:
-        movl      -20(%ebp), %eax                               #852.5
-..LN167:
-        movl      20(%ebp), %edx                                #852.25
-..LN169:
-        movl      %edx, 4(%eax)                                 #852.5
-..LN171:
-        movl      $0, -28(%ebp)                                 #856.11
-..LN173:
-        movl      -28(%ebp), %eax                               #856.18
-..LN175:
-        movl      20(%ebp), %edx                                #856.22
-        cmpl      %edx, %eax                                    #856.22
-        jb        ..B8.9        # Prob 50%                      #856.22
-        jmp       ..B8.17       # Prob 100%                     #856.22
-                                # LOE
-..B8.7:                         # Preds ..B8.13 ..B8.14 ..B8.15 ..B8.16 ..B8.12
-                                #      
-..LN177:
-        incl      -28(%ebp)                                     #856.31
-..LN179:
-        movl      -28(%ebp), %eax                               #856.18
-..LN181:
-        movl      20(%ebp), %edx                                #856.22
-        cmpl      %edx, %eax                                    #856.22
-        jae       ..B8.17       # Prob 50%                      #856.22
-                                # LOE
-..B8.9:                         # Preds ..B8.6 ..B8.7
-..LN183:
-        movl      16(%ebp), %eax                                #858.48
-..LN185:
-        movl      -28(%ebp), %edx                               #858.56
-..LN187:
-        movzbl    (%edx,%eax), %eax                             #858.48
-        movsbl    %al, %eax                                     #858.48
-..LN189:
-        movl      -12(%ebp), %edx                               #858.24
-        movzbl    fasta_2na_map at GOTOFF(%eax,%edx), %eax         #858.24
-..LN191:
-        movb      %al, -8(%ebp)                                 #858.22
-..LN193:
-        movl      -28(%ebp), %eax                               #859.18
-..LN195:
-        andl      $3, %eax                                      #859.22
-        movl      %eax, -24(%ebp)                               #859.22
-        je        ..B8.13       # Prob 50%                      #859.22
-                                # LOE
-..B8.10:                        # Preds ..B8.9
-        movl      -24(%ebp), %eax                               #859.22
-        cmpl      $1, %eax                                      #859.22
-        je        ..B8.14       # Prob 50%                      #859.22
-                                # LOE
-..B8.11:                        # Preds ..B8.10
-        movl      -24(%ebp), %eax                               #859.22
-        cmpl      $2, %eax                                      #859.22
-        je        ..B8.15       # Prob 50%                      #859.22
-                                # LOE
-..B8.12:                        # Preds ..B8.11
-        movl      -24(%ebp), %eax                               #859.22
-        cmpl      $3, %eax                                      #859.22
-        je        ..B8.16       # Prob 50%                      #859.22
-        jmp       ..B8.7        # Prob 100%                     #859.22
-                                # LOE
-..B8.13:                        # Preds ..B8.9
-..LN197:
-        movzbl    -8(%ebp), %eax                                #862.38
-..LN199:
-        shll      $6, %eax                                      #862.46
-..LN201:
-        movl      -28(%ebp), %edx                               #862.27
-..LN203:
-        shrl      $2, %edx                                      #862.32
-..LN205:
-        movb      %al, -60(%ebp,%edx)                           #862.13
-..LN207:
-        movl      -28(%ebp), %eax                               #863.24
-..LN209:
-        shrl      $2, %eax                                      #863.29
-..LN211:
-        movb      $192, -44(%ebp,%eax)                          #863.13
-        jmp       ..B8.7        # Prob 100%                     #863.13
-                                # LOE
-..B8.14:                        # Preds ..B8.10
-..LN213:
-        movl      -28(%ebp), %eax                               #866.27
-..LN215:
-        shrl      $2, %eax                                      #866.32
-..LN217:
-        movzbl    -60(%ebp,%eax), %eax                          #866.13
-..LN219:
-        movzbl    -8(%ebp), %edx                                #866.39
-..LN221:
-        shll      $4, %edx                                      #866.47
-..LN223:
-        orl       %edx, %eax                                    #866.13
-..LN225:
-        movl      -28(%ebp), %edx                               #866.27
-..LN227:
-        shrl      $2, %edx                                      #866.32
-..LN229:
-        movb      %al, -60(%ebp,%edx)                           #866.13
-..LN231:
-        movl      -28(%ebp), %eax                               #867.24
-..LN233:
-        shrl      $2, %eax                                      #867.29
-..LN235:
-        movzbl    -44(%ebp,%eax), %eax                          #867.13
-        orl       $48, %eax                                     #867.13
-..LN237:
-        movl      -28(%ebp), %edx                               #867.24
-..LN239:
-        shrl      $2, %edx                                      #867.29
-..LN241:
-        movb      %al, -44(%ebp,%edx)                           #867.13
-        jmp       ..B8.7        # Prob 100%                     #867.13
-                                # LOE
-..B8.15:                        # Preds ..B8.11
-..LN243:
-        movl      -28(%ebp), %eax                               #870.27
-..LN245:
-        shrl      $2, %eax                                      #870.32
-..LN247:
-        movzbl    -60(%ebp,%eax), %eax                          #870.13
-..LN249:
-        movzbl    -8(%ebp), %edx                                #870.39
-..LN251:
-        shll      $2, %edx                                      #870.47
-..LN253:
-        orl       %edx, %eax                                    #870.13
-..LN255:
-        movl      -28(%ebp), %edx                               #870.27
-..LN257:
-        shrl      $2, %edx                                      #870.32
-..LN259:
-        movb      %al, -60(%ebp,%edx)                           #870.13
-..LN261:
-        movl      -28(%ebp), %eax                               #871.24
-..LN263:
-        shrl      $2, %eax                                      #871.29
-..LN265:
-        movzbl    -44(%ebp,%eax), %eax                          #871.13
-        orl       $12, %eax                                     #871.13
-..LN267:
-        movl      -28(%ebp), %edx                               #871.24
-..LN269:
-        shrl      $2, %edx                                      #871.29
-..LN271:
-        movb      %al, -44(%ebp,%edx)                           #871.13
-        jmp       ..B8.7        # Prob 100%                     #871.13
-                                # LOE
-..B8.16:                        # Preds ..B8.12
-..LN273:
-        movl      -28(%ebp), %eax                               #874.27
-..LN275:
-        shrl      $2, %eax                                      #874.32
-..LN277:
-        movzbl    -60(%ebp,%eax), %eax                          #874.13
-..LN279:
-        movzbl    -8(%ebp), %edx                                #874.39
-..LN281:
-        orl       %edx, %eax                                    #874.13
-..LN283:
-        movl      -28(%ebp), %edx                               #874.27
-..LN285:
-        shrl      $2, %edx                                      #874.32
-..LN287:
-        movb      %al, -60(%ebp,%edx)                           #874.13
-..LN289:
-        movl      -28(%ebp), %eax                               #875.24
-..LN291:
-        shrl      $2, %eax                                      #875.29
-..LN293:
-        movzbl    -44(%ebp,%eax), %eax                          #875.13
-        orl       $3, %eax                                      #875.13
-..LN295:
-        movl      -28(%ebp), %edx                               #875.24
-..LN297:
-        shrl      $2, %edx                                      #875.29
-..LN299:
-        movb      %al, -44(%ebp,%edx)                           #875.13
-        jmp       ..B8.7        # Prob 100%                     #875.13
-                                # LOE
-..B8.17:                        # Preds ..B8.7 ..B8.6
-..LN301:
-        movl      -28(%ebp), %eax                               #881.17
-..LN303:
-        addl      $3, %eax                                      #881.21
-..LN305:
-        shrl      $2, %eax                                      #881.28
-..LN307:
-        movl      %eax, -28(%ebp)                               #881.11
-..LN309:
-        movl      -28(%ebp), %eax                               #881.31
-..LN311:
-        cmpl      $16, %eax                                     #881.35
-        jae       ..B8.20       # Prob 50%                      #881.35
-                                # LOE
-..B8.19:                        # Preds ..B8.17 ..B8.19
-..LN313:
-        movl      -28(%ebp), %eax                               #883.23
-..LN315:
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, -60(%ebp,%eax)                           #883.9
-..LN317:
-        movl      -28(%ebp), %eax                               #884.20
-..LN319:
-        movb      %dl, -44(%ebp,%eax)                           #884.9
-..LN321:
-        incl      -28(%ebp)                                     #881.42
-..LN323:
-        movl      -28(%ebp), %eax                               #881.31
-..LN325:
-        cmpl      $16, %eax                                     #881.35
-        jb        ..B8.19       # Prob 50%                      #881.35
-                                # LOE
-..B8.20:                        # Preds ..B8.19 ..B8.17
-..LN327:
-        movl      12(%ebp), %eax                                #890.10
-        testl     %eax, %eax                                    #890.10
-        je        ..B8.22       # Prob 50%                      #890.10
-                                # LOE
-..B8.21:                        # Preds ..B8.20
-..LN329:
-        movl      -20(%ebp), %eax                               #892.9
-        movl      $9, (%eax)                                    #892.9
-        jmp       ..B8.31       # Prob 100%                     #892.9
-                                # LOE
-..B8.22:                        # Preds ..B8.20
-..LN331:
-        movl      20(%ebp), %eax                                #896.15
-..LN333:
-        cmpl      $2, %eax                                      #896.22
-        jae       ..B8.24       # Prob 50%                      #896.22
-                                # LOE
-..B8.23:                        # Preds ..B8.22
-..LN335:
-        movzbl    -60(%ebp), %eax                               #898.29
-..LN337:
-        movb      %al, -59(%ebp)                                #898.9
-..LN339:
-        movzwl    -60(%ebp), %eax                               #899.29
-..LN341:
-        movw      %ax, -58(%ebp)                                #899.9
-..LN343:
-        movl      -60(%ebp), %eax                               #900.29
-..LN345:
-        movl      %eax, -56(%ebp)                               #900.9
-..LN347:
-        movl      -60(%ebp), %eax                               #901.29
-        movl      -56(%ebp), %edx                               #901.29
-..LN349:
-        movl      %eax, -52(%ebp)                               #901.9
-        movl      %edx, -48(%ebp)                               #901.9
-..LN351:
-        movzbl    -44(%ebp), %eax                               #903.26
-..LN353:
-        movb      %al, -43(%ebp)                                #903.9
-..LN355:
-        movzwl    -44(%ebp), %eax                               #904.26
-..LN357:
-        movw      %ax, -42(%ebp)                                #904.9
-..LN359:
-        movl      -44(%ebp), %eax                               #905.26
-..LN361:
-        movl      %eax, -40(%ebp)                               #905.9
-..LN363:
-        movl      -44(%ebp), %eax                               #906.26
-        movl      -40(%ebp), %edx                               #906.26
-..LN365:
-        movl      %eax, -36(%ebp)                               #906.9
-        movl      %edx, -32(%ebp)                               #906.9
-..LN367:
-        movl      -20(%ebp), %eax                               #908.9
-        movl      $2, (%eax)                                    #908.9
-        jmp       ..B8.31       # Prob 100%                     #908.9
-                                # LOE
-..B8.24:                        # Preds ..B8.22
-..LN369:
-        movl      20(%ebp), %eax                                #910.15
-..LN371:
-        cmpl      $6, %eax                                      #910.22
-        jae       ..B8.26       # Prob 50%                      #910.22
-                                # LOE
-..B8.25:                        # Preds ..B8.24
-..LN373:
-        movzwl    -60(%ebp), %eax                               #912.29
-..LN375:
-        movw      %ax, -58(%ebp)                                #912.9
-..LN377:
-        movl      -60(%ebp), %eax                               #913.29
-..LN379:
-        movl      %eax, -56(%ebp)                               #913.9
-..LN381:
-        movl      -60(%ebp), %eax                               #914.29
-        movl      -56(%ebp), %edx                               #914.29
-..LN383:
-        movl      %eax, -52(%ebp)                               #914.9
-        movl      %edx, -48(%ebp)                               #914.9
-..LN385:
-        movzwl    -44(%ebp), %eax                               #916.26
-..LN387:
-        movw      %ax, -42(%ebp)                                #916.9
-..LN389:
-        movl      -44(%ebp), %eax                               #917.26
-..LN391:
-        movl      %eax, -40(%ebp)                               #917.9
-..LN393:
-        movl      -44(%ebp), %eax                               #918.26
-        movl      -40(%ebp), %edx                               #918.26
-..LN395:
-        movl      %eax, -36(%ebp)                               #918.9
-        movl      %edx, -32(%ebp)                               #918.9
-..LN397:
-        movl      -20(%ebp), %eax                               #920.9
-        movl      $3, (%eax)                                    #920.9
-        jmp       ..B8.31       # Prob 100%                     #920.9
-                                # LOE
-..B8.26:                        # Preds ..B8.24
-..LN399:
-        movl      20(%ebp), %eax                                #922.15
-..LN401:
-        cmpl      $14, %eax                                     #922.22
-        jae       ..B8.28       # Prob 50%                      #922.22
-                                # LOE
-..B8.27:                        # Preds ..B8.26
-..LN403:
-        movl      -60(%ebp), %eax                               #924.29
-..LN405:
-        movl      %eax, -56(%ebp)                               #924.9
-..LN407:
-        movl      -60(%ebp), %eax                               #925.29
-        movl      -56(%ebp), %edx                               #925.29
-..LN409:
-        movl      %eax, -52(%ebp)                               #925.9
-        movl      %edx, -48(%ebp)                               #925.9
-..LN411:
-        movl      -44(%ebp), %eax                               #927.26
-..LN413:
-        movl      %eax, -40(%ebp)                               #927.9
-..LN415:
-        movl      -44(%ebp), %eax                               #928.26
-        movl      -40(%ebp), %edx                               #928.26
-..LN417:
-        movl      %eax, -36(%ebp)                               #928.9
-        movl      %edx, -32(%ebp)                               #928.9
-..LN419:
-        movl      -20(%ebp), %eax                               #930.9
-        movl      $4, (%eax)                                    #930.9
-        jmp       ..B8.31       # Prob 100%                     #930.9
-                                # LOE
-..B8.28:                        # Preds ..B8.26
-..LN421:
-        movl      20(%ebp), %eax                                #932.15
-..LN423:
-        cmpl      $30, %eax                                     #932.22
-        jae       ..B8.30       # Prob 50%                      #932.22
-                                # LOE
-..B8.29:                        # Preds ..B8.28
-..LN425:
-        movl      -60(%ebp), %eax                               #934.29
-        movl      -56(%ebp), %edx                               #934.29
-..LN427:
-        movl      %eax, -52(%ebp)                               #934.9
-        movl      %edx, -48(%ebp)                               #934.9
-..LN429:
-        movl      -44(%ebp), %eax                               #935.26
-        movl      -40(%ebp), %edx                               #935.26
-..LN431:
-        movl      %eax, -36(%ebp)                               #935.9
-        movl      %edx, -32(%ebp)                               #935.9
-..LN433:
-        movl      -20(%ebp), %eax                               #937.9
-        movl      $0, (%eax)                                    #937.9
-        jmp       ..B8.31       # Prob 100%                     #937.9
-                                # LOE
-..B8.30:                        # Preds ..B8.28
-..LN435:
-        movl      -20(%ebp), %eax                               #941.9
-        movl      $5, (%eax)                                    #941.9
-                                # LOE
-..B8.31:                        # Preds ..B8.21 ..B8.23 ..B8.25 ..B8.27 ..B8.29
-                                #       ..B8.30
-..LN437:
-        movl      -20(%ebp), %eax                               #944.5
-..LN439:
-        movl      -60(%ebp), %edx                               #944.42
-        movl      %edx, 16(%eax)                                #944.42
-        movl      -56(%ebp), %edx                               #944.42
-        movl      %edx, 20(%eax)                                #944.42
-        movl      -52(%ebp), %edx                               #944.42
-        movl      %edx, 24(%eax)                                #944.42
-        movl      -48(%ebp), %edx                               #944.42
-        movl      %edx, 28(%eax)                                #944.42
-..LN441:
-        movl      -20(%ebp), %eax                               #945.5
-..LN443:
-        movl      -44(%ebp), %edx                               #945.39
-        movl      %edx, 32(%eax)                                #945.39
-        movl      -40(%ebp), %edx                               #945.39
-        movl      %edx, 36(%eax)                                #945.39
-        movl      -36(%ebp), %edx                               #945.39
-        movl      %edx, 40(%eax)                                #945.39
-        movl      -32(%ebp), %edx                               #945.39
-        movl      %edx, 44(%eax)                                #945.39
-..LN445:
-        pushl     %edi                                          #948.5
-..LN447:
-        lea       -60(%ebp), %eax                               #948.23
-        movl      %eax, (%esp)                                  #948.23
-..LN449:
-        call      uint128_bswap                                 #948.5
-                                # LOE
-..B8.50:                        # Preds ..B8.31
-        popl      %ecx                                          #948.5
-                                # LOE
-..B8.32:                        # Preds ..B8.50
-..LN451:
-        pushl     %edi                                          #949.5
-..LN453:
-        lea       -44(%ebp), %eax                               #949.23
-        movl      %eax, (%esp)                                  #949.23
-..LN455:
-        call      uint128_bswap                                 #949.5
-                                # LOE
-..B8.51:                        # Preds ..B8.32
-        popl      %ecx                                          #949.5
-                                # LOE
-..B8.33:                        # Preds ..B8.51
-..LN457:
-        addl      $-8, %esp                                     #952.5
-..LN459:
-        lea       -60(%ebp), %eax                               #952.21
-        movl      %eax, (%esp)                                  #952.21
-..LN461:
-        movl      $2, 4(%esp)                                   #952.34
-..LN463:
-        call      uint128_shr                                   #952.5
-                                # LOE
-..B8.52:                        # Preds ..B8.33
-        addl      $8, %esp                                      #952.5
-                                # LOE
-..B8.34:                        # Preds ..B8.52
-..LN465:
-        addl      $-8, %esp                                     #953.5
-..LN467:
-        lea       -44(%ebp), %eax                               #953.21
-        movl      %eax, (%esp)                                  #953.21
-..LN469:
-        movl      $2, 4(%esp)                                   #953.31
-..LN471:
-        call      uint128_shr                                   #953.5
-                                # LOE
-..B8.53:                        # Preds ..B8.34
-        addl      $8, %esp                                      #953.5
-                                # LOE
-..B8.35:                        # Preds ..B8.53
-..LN473:
-        addl      $-8, %esp                                     #956.5
-..LN475:
-        movl      -20(%ebp), %eax                               #956.28
-..LN477:
-        addl      $48, %eax                                     #956.5
-        movl      %eax, (%esp)                                  #956.5
-..LN479:
-        lea       -60(%ebp), %eax                               #956.70
-        movl      %eax, 4(%esp)                                 #956.70
-..LN481:
-        call      uint128_bswap_copy                            #956.5
-                                # LOE
-..B8.54:                        # Preds ..B8.35
-        addl      $8, %esp                                      #956.5
-                                # LOE
-..B8.36:                        # Preds ..B8.54
-..LN483:
-        addl      $-8, %esp                                     #957.5
-..LN485:
-        movl      -20(%ebp), %eax                               #957.28
-..LN487:
-        addl      $64, %eax                                     #957.5
-        movl      %eax, (%esp)                                  #957.5
-..LN489:
-        lea       -44(%ebp), %eax                               #957.67
-        movl      %eax, 4(%esp)                                 #957.67
-..LN491:
-        call      uint128_bswap_copy                            #957.5
-                                # LOE
-..B8.55:                        # Preds ..B8.36
-        addl      $8, %esp                                      #957.5
-                                # LOE
-..B8.37:                        # Preds ..B8.55
-..LN493:
-        addl      $-8, %esp                                     #959.5
-..LN495:
-        lea       -60(%ebp), %eax                               #959.21
-        movl      %eax, (%esp)                                  #959.21
-..LN497:
-        movl      $2, 4(%esp)                                   #959.34
-..LN499:
-        call      uint128_shr                                   #959.5
-                                # LOE
-..B8.56:                        # Preds ..B8.37
-        addl      $8, %esp                                      #959.5
-                                # LOE
-..B8.38:                        # Preds ..B8.56
-..LN501:
-        addl      $-8, %esp                                     #960.5
-..LN503:
-        lea       -44(%ebp), %eax                               #960.21
-        movl      %eax, (%esp)                                  #960.21
-..LN505:
-        movl      $2, 4(%esp)                                   #960.31
-..LN507:
-        call      uint128_shr                                   #960.5
-                                # LOE
-..B8.57:                        # Preds ..B8.38
-        addl      $8, %esp                                      #960.5
-                                # LOE
-..B8.39:                        # Preds ..B8.57
-..LN509:
-        addl      $-8, %esp                                     #962.5
-..LN511:
-        movl      -20(%ebp), %eax                               #962.28
-..LN513:
-        addl      $80, %eax                                     #962.5
-        movl      %eax, (%esp)                                  #962.5
-..LN515:
-        lea       -60(%ebp), %eax                               #962.70
-        movl      %eax, 4(%esp)                                 #962.70
-..LN517:
-        call      uint128_bswap_copy                            #962.5
-                                # LOE
-..B8.58:                        # Preds ..B8.39
-        addl      $8, %esp                                      #962.5
-                                # LOE
-..B8.40:                        # Preds ..B8.58
-..LN519:
-        addl      $-8, %esp                                     #963.5
-..LN521:
-        movl      -20(%ebp), %eax                               #963.28
-..LN523:
-        addl      $96, %eax                                     #963.5
-        movl      %eax, (%esp)                                  #963.5
-..LN525:
-        lea       -44(%ebp), %eax                               #963.67
-        movl      %eax, 4(%esp)                                 #963.67
-..LN527:
-        call      uint128_bswap_copy                            #963.5
-                                # LOE
-..B8.59:                        # Preds ..B8.40
-        addl      $8, %esp                                      #963.5
-                                # LOE
-..B8.41:                        # Preds ..B8.59
-..LN529:
-        addl      $-8, %esp                                     #965.5
-..LN531:
-        lea       -60(%ebp), %eax                               #965.21
-        movl      %eax, (%esp)                                  #965.21
-..LN533:
-        movl      $2, 4(%esp)                                   #965.34
-..LN535:
-        call      uint128_shr                                   #965.5
-                                # LOE
-..B8.60:                        # Preds ..B8.41
-        addl      $8, %esp                                      #965.5
-                                # LOE
-..B8.42:                        # Preds ..B8.60
-..LN537:
-        addl      $-8, %esp                                     #966.5
-..LN539:
-        lea       -44(%ebp), %eax                               #966.21
-        movl      %eax, (%esp)                                  #966.21
-..LN541:
-        movl      $2, 4(%esp)                                   #966.31
-..LN543:
-        call      uint128_shr                                   #966.5
-                                # LOE
-..B8.61:                        # Preds ..B8.42
-        addl      $8, %esp                                      #966.5
-                                # LOE
-..B8.43:                        # Preds ..B8.61
-..LN545:
-        addl      $-8, %esp                                     #968.5
-..LN547:
-        movl      -20(%ebp), %eax                               #968.28
-..LN549:
-        addl      $112, %eax                                    #968.5
-        movl      %eax, (%esp)                                  #968.5
-..LN551:
-        lea       -60(%ebp), %eax                               #968.70
-        movl      %eax, 4(%esp)                                 #968.70
-..LN553:
-        call      uint128_bswap_copy                            #968.5
-                                # LOE
-..B8.62:                        # Preds ..B8.43
-        addl      $8, %esp                                      #968.5
-                                # LOE
-..B8.44:                        # Preds ..B8.62
-..LN555:
-        addl      $-8, %esp                                     #969.5
-..LN557:
-        movl      -20(%ebp), %eax                               #969.28
-..LN559:
-        addl      $128, %eax                                    #969.5
-        movl      %eax, (%esp)                                  #969.5
-..LN561:
-        lea       -44(%ebp), %eax                               #969.67
-        movl      %eax, 4(%esp)                                 #969.67
-..LN563:
-        call      uint128_bswap_copy                            #969.5
-                                # LOE
-..B8.63:                        # Preds ..B8.44
-        addl      $8, %esp                                      #969.5
-                                # LOE
-..B8.45:                        # Preds ..B8.63
-..LN565:
-        xorl      %eax, %eax                                    #1011.12
-        movl      -4(%ebp), %ebx                                #1011.12
-..___tag_value_NucStrFastaExprMake2.134:                        #
-        leave                                                   #1011.12
-..___tag_value_NucStrFastaExprMake2.136:                        #
-        ret                                                     #1011.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprMake2.137:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-.LNNucStrFastaExprMake2:
-	.data
-# -- End  NucStrFastaExprMake2
-	.bss
-	.align 32
-fasta_4na_map:
-	.type	fasta_4na_map, at object
-	.size	fasta_4na_map,128
-	.space 128	# pad
-	.data
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake4:
-# parameter 1(expr): 8 + %ebp
-# parameter 2(positional): 12 + %ebp
-# parameter 3(fasta): 16 + %ebp
-# parameter 4(size): 20 + %ebp
-..B9.1:                         # Preds ..B9.0
-..___tag_value_NucStrFastaExprMake4.140:                        #
-..LN567:
-        pushl     %ebp                                          #1017.1
-        movl      %esp, %ebp                                    #1017.1
-..___tag_value_NucStrFastaExprMake4.145:                        #
-        subl      $60, %esp                                     #1017.1
-        movl      %ebx, -4(%ebp)                                #1017.1
-..___tag_value_NucStrFastaExprMake4.148:                        #
-..LN569:
-        movl      20(%ebp), %eax                                #1023.10
-..LN571:
-        cmpl      $29, %eax                                     #1023.17
-        jbe       ..B9.3        # Prob 50%                      #1023.17
-                                # LOE
-..B9.2:                         # Preds ..B9.1
-..LN573:
-        movl      $7, %eax                                      #1024.16
-        movl      -4(%ebp), %ebx                                #1024.16
-..___tag_value_NucStrFastaExprMake4.149:                        #
-        leave                                                   #1024.16
-..___tag_value_NucStrFastaExprMake4.151:                        #
-        ret                                                     #1024.16
-..___tag_value_NucStrFastaExprMake4.152:                        #
-                                # LOE
-..B9.3:                         # Preds ..B9.1
-..LN575:
-        pushl     %edi                                          #1026.9
-..LN577:
-        movl      $144, (%esp)                                  #1026.32
-..LN579:
-        call      NucStrFastaExprAlloc                          #1026.9
-                                # LOE eax
-..B9.46:                        # Preds ..B9.3
-        popl      %ecx                                          #1026.9
-        movl      %eax, -12(%ebp)                               #1026.9
-                                # LOE
-..B9.4:                         # Preds ..B9.46
-        call      ..L154        # Prob 100%                     #
-..L154:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L154], %eax     #
-        movl      %eax, -8(%ebp)                                #
-..LN581:
-        movl      -12(%ebp), %eax                               #1026.5
-        movl      %eax, -16(%ebp)                               #1026.5
-..LN583:
-        movl      -16(%ebp), %eax                               #1027.10
-..LN585:
-        testl     %eax, %eax                                    #1027.15
-        jne       ..B9.6        # Prob 50%                      #1027.15
-                                # LOE
-..B9.5:                         # Preds ..B9.4
-..LN587:
-        movl      -8(%ebp), %eax                                #1028.16
-        movl      %eax, %ebx                                    #1028.16
-        call      __errno_location at PLT                          #1028.16
-                                # LOE eax
-..B9.47:                        # Preds ..B9.5
-        movl      (%eax), %eax                                  #1028.16
-        movl      -4(%ebp), %ebx                                #1028.16
-..___tag_value_NucStrFastaExprMake4.155:                        #
-        leave                                                   #1028.16
-..___tag_value_NucStrFastaExprMake4.157:                        #
-        ret                                                     #1028.16
-..___tag_value_NucStrFastaExprMake4.158:                        #
-                                # LOE
-..B9.6:                         # Preds ..B9.4
-..LN589:
-        movl      8(%ebp), %eax                                 #1030.5
-..LN591:
-        movl      -16(%ebp), %edx                               #1030.14
-..LN593:
-        movl      %edx, (%eax)                                  #1030.5
-..LN595:
-        movl      -16(%ebp), %eax                               #1031.5
-..LN597:
-        movl      20(%ebp), %edx                                #1031.25
-..LN599:
-        movl      %edx, 4(%eax)                                 #1031.5
-..LN601:
-        movl      $0, -28(%ebp)                                 #1035.11
-..LN603:
-        movl      -28(%ebp), %eax                               #1035.18
-..LN605:
-        movl      20(%ebp), %edx                                #1035.22
-        cmpl      %edx, %eax                                    #1035.22
-        jb        ..B9.9        # Prob 50%                      #1035.22
-        jmp       ..B9.17       # Prob 100%                     #1035.22
-                                # LOE
-..B9.7:                         # Preds ..B9.13 ..B9.14 ..B9.15 ..B9.16 ..B9.12
-                                #      
-..LN607:
-        incl      -28(%ebp)                                     #1035.31
-..LN609:
-        movl      -28(%ebp), %eax                               #1035.18
-..LN611:
-        movl      20(%ebp), %edx                                #1035.22
-        cmpl      %edx, %eax                                    #1035.22
-        jae       ..B9.17       # Prob 50%                      #1035.22
-                                # LOE
-..B9.9:                         # Preds ..B9.6 ..B9.7
-..LN613:
-        movl      16(%ebp), %eax                                #1037.49
-..LN615:
-        movl      -28(%ebp), %edx                               #1037.57
-..LN617:
-        movzbl    (%edx,%eax), %eax                             #1037.49
-        movsbl    %al, %eax                                     #1037.49
-..LN619:
-        movl      -8(%ebp), %edx                                #1037.25
-        movzbl    fasta_4na_map at GOTOFF(%eax,%edx), %eax         #1037.25
-        movsbl    %al, %eax                                     #1037.25
-..LN621:
-        movw      %ax, -20(%ebp)                                #1037.23
-..LN623:
-        movl      -28(%ebp), %eax                               #1038.18
-..LN625:
-        andl      $3, %eax                                      #1038.22
-        movl      %eax, -24(%ebp)                               #1038.22
-        je        ..B9.13       # Prob 50%                      #1038.22
-                                # LOE
-..B9.10:                        # Preds ..B9.9
-        movl      -24(%ebp), %eax                               #1038.22
-        cmpl      $1, %eax                                      #1038.22
-        je        ..B9.14       # Prob 50%                      #1038.22
-                                # LOE
-..B9.11:                        # Preds ..B9.10
-        movl      -24(%ebp), %eax                               #1038.22
-        cmpl      $2, %eax                                      #1038.22
-        je        ..B9.15       # Prob 50%                      #1038.22
-                                # LOE
-..B9.12:                        # Preds ..B9.11
-        movl      -24(%ebp), %eax                               #1038.22
-        cmpl      $3, %eax                                      #1038.22
-        je        ..B9.16       # Prob 50%                      #1038.22
-        jmp       ..B9.7        # Prob 100%                     #1038.22
-                                # LOE
-..B9.13:                        # Preds ..B9.9
-..LN627:
-        movzwl    -20(%ebp), %eax                               #1041.38
-..LN629:
-        shll      $4, %eax                                      #1041.46
-..LN631:
-        movl      -28(%ebp), %edx                               #1041.27
-..LN633:
-        shrl      $2, %edx                                      #1041.32
-..LN635:
-        movw      %ax, -60(%ebp,%edx,2)                         #1041.13
-..LN637:
-        movl      -28(%ebp), %eax                               #1042.24
-..LN639:
-        shrl      $2, %eax                                      #1042.29
-..LN641:
-        movw      $240, -44(%ebp,%eax,2)                        #1042.13
-        jmp       ..B9.7        # Prob 100%                     #1042.13
-                                # LOE
-..B9.14:                        # Preds ..B9.10
-..LN643:
-        movl      -28(%ebp), %eax                               #1045.27
-..LN645:
-        shrl      $2, %eax                                      #1045.32
-..LN647:
-        movzwl    -60(%ebp,%eax,2), %eax                        #1045.13
-..LN649:
-        movzwl    -20(%ebp), %edx                               #1045.39
-..LN651:
-        orl       %edx, %eax                                    #1045.13
-..LN653:
-        movl      -28(%ebp), %edx                               #1045.27
-..LN655:
-        shrl      $2, %edx                                      #1045.32
-..LN657:
-        movw      %ax, -60(%ebp,%edx,2)                         #1045.13
-..LN659:
-        movl      -28(%ebp), %eax                               #1046.24
-..LN661:
-        shrl      $2, %eax                                      #1046.29
-..LN663:
-        movzwl    -44(%ebp,%eax,2), %eax                        #1046.13
-        orl       $15, %eax                                     #1046.13
-..LN665:
-        movl      -28(%ebp), %edx                               #1046.24
-..LN667:
-        shrl      $2, %edx                                      #1046.29
-..LN669:
-        movw      %ax, -44(%ebp,%edx,2)                         #1046.13
-        jmp       ..B9.7        # Prob 100%                     #1046.13
-                                # LOE
-..B9.15:                        # Preds ..B9.11
-..LN671:
-        movl      -28(%ebp), %eax                               #1049.27
-..LN673:
-        shrl      $2, %eax                                      #1049.32
-..LN675:
-        movzwl    -60(%ebp,%eax,2), %eax                        #1049.13
-..LN677:
-        movzwl    -20(%ebp), %edx                               #1049.39
-..LN679:
-        shll      $12, %edx                                     #1049.47
-..LN681:
-        orl       %edx, %eax                                    #1049.13
-..LN683:
-        movl      -28(%ebp), %edx                               #1049.27
-..LN685:
-        shrl      $2, %edx                                      #1049.32
-..LN687:
-        movw      %ax, -60(%ebp,%edx,2)                         #1049.13
-..LN689:
-        movl      -28(%ebp), %eax                               #1050.24
-..LN691:
-        shrl      $2, %eax                                      #1050.29
-..LN693:
-        movzwl    -44(%ebp,%eax,2), %eax                        #1050.13
-        orl       $-4096, %eax                                  #1050.13
-..LN695:
-        movl      -28(%ebp), %edx                               #1050.24
-..LN697:
-        shrl      $2, %edx                                      #1050.29
-..LN699:
-        movw      %ax, -44(%ebp,%edx,2)                         #1050.13
-        jmp       ..B9.7        # Prob 100%                     #1050.13
-                                # LOE
-..B9.16:                        # Preds ..B9.12
-..LN701:
-        movl      -28(%ebp), %eax                               #1053.27
-..LN703:
-        shrl      $2, %eax                                      #1053.32
-..LN705:
-        movzwl    -60(%ebp,%eax,2), %eax                        #1053.13
-..LN707:
-        movzwl    -20(%ebp), %edx                               #1053.39
-..LN709:
-        shll      $8, %edx                                      #1053.47
-..LN711:
-        orl       %edx, %eax                                    #1053.13
-..LN713:
-        movl      -28(%ebp), %edx                               #1053.27
-..LN715:
-        shrl      $2, %edx                                      #1053.32
-..LN717:
-        movw      %ax, -60(%ebp,%edx,2)                         #1053.13
-..LN719:
-        movl      -28(%ebp), %eax                               #1054.24
-..LN721:
-        shrl      $2, %eax                                      #1054.29
-..LN723:
-        movzwl    -44(%ebp,%eax,2), %eax                        #1054.13
-        orl       $-61696, %eax                                 #1054.13
-..LN725:
-        movl      -28(%ebp), %edx                               #1054.24
-..LN727:
-        shrl      $2, %edx                                      #1054.29
-..LN729:
-        movw      %ax, -44(%ebp,%edx,2)                         #1054.13
-        jmp       ..B9.7        # Prob 100%                     #1054.13
-                                # LOE
-..B9.17:                        # Preds ..B9.7 ..B9.6
-..LN731:
-        movl      -28(%ebp), %eax                               #1060.17
-..LN733:
-        addl      $3, %eax                                      #1060.21
-..LN735:
-        shrl      $2, %eax                                      #1060.28
-..LN737:
-        movl      %eax, -28(%ebp)                               #1060.11
-..LN739:
-        movl      -28(%ebp), %eax                               #1060.31
-..LN741:
-        cmpl      $8, %eax                                      #1060.35
-        jae       ..B9.20       # Prob 50%                      #1060.35
-                                # LOE
-..B9.19:                        # Preds ..B9.17 ..B9.19
-..LN743:
-        movl      -28(%ebp), %eax                               #1062.23
-..LN745:
-        xorl      %edx, %edx                                    #1062.9
-        movw      %dx, -60(%ebp,%eax,2)                         #1062.9
-..LN747:
-        movl      -28(%ebp), %eax                               #1063.20
-..LN749:
-        movw      %dx, -44(%ebp,%eax,2)                         #1063.9
-..LN751:
-        incl      -28(%ebp)                                     #1060.41
-..LN753:
-        movl      -28(%ebp), %eax                               #1060.31
-..LN755:
-        cmpl      $8, %eax                                      #1060.35
-        jb        ..B9.19       # Prob 50%                      #1060.35
-                                # LOE
-..B9.20:                        # Preds ..B9.19 ..B9.17
-..LN757:
-        movl      12(%ebp), %eax                                #1068.10
-        testl     %eax, %eax                                    #1068.10
-        je        ..B9.22       # Prob 50%                      #1068.10
-                                # LOE
-..B9.21:                        # Preds ..B9.20
-..LN759:
-        movl      -16(%ebp), %eax                               #1070.9
-        movl      $10, (%eax)                                   #1070.9
-        jmp       ..B9.29       # Prob 100%                     #1070.9
-                                # LOE
-..B9.22:                        # Preds ..B9.20
-..LN761:
-        movl      20(%ebp), %eax                                #1072.15
-..LN763:
-        cmpl      $2, %eax                                      #1072.22
-        jae       ..B9.24       # Prob 50%                      #1072.22
-                                # LOE
-..B9.23:                        # Preds ..B9.22
-..LN765:
-        movzwl    -60(%ebp), %eax                               #1074.29
-..LN767:
-        movw      %ax, -58(%ebp)                                #1074.9
-..LN769:
-        movl      -60(%ebp), %eax                               #1075.29
-..LN771:
-        movl      %eax, -56(%ebp)                               #1075.9
-..LN773:
-        movl      -60(%ebp), %eax                               #1076.29
-        movl      -56(%ebp), %edx                               #1076.29
-..LN775:
-        movl      %eax, -52(%ebp)                               #1076.9
-        movl      %edx, -48(%ebp)                               #1076.9
-..LN777:
-        movzwl    -44(%ebp), %eax                               #1078.26
-..LN779:
-        movw      %ax, -42(%ebp)                                #1078.9
-..LN781:
-        movl      -44(%ebp), %eax                               #1079.26
-..LN783:
-        movl      %eax, -40(%ebp)                               #1079.9
-..LN785:
-        movl      -44(%ebp), %eax                               #1080.26
-        movl      -40(%ebp), %edx                               #1080.26
-..LN787:
-        movl      %eax, -36(%ebp)                               #1080.9
-        movl      %edx, -32(%ebp)                               #1080.9
-..LN789:
-        movl      -16(%ebp), %eax                               #1082.9
-        movl      $6, (%eax)                                    #1082.9
-        jmp       ..B9.29       # Prob 100%                     #1082.9
-                                # LOE
-..B9.24:                        # Preds ..B9.22
-..LN791:
-        movl      20(%ebp), %eax                                #1084.15
-..LN793:
-        cmpl      $6, %eax                                      #1084.22
-        jae       ..B9.26       # Prob 50%                      #1084.22
-                                # LOE
-..B9.25:                        # Preds ..B9.24
-..LN795:
-        movl      -60(%ebp), %eax                               #1086.29
-..LN797:
-        movl      %eax, -56(%ebp)                               #1086.9
-..LN799:
-        movl      -60(%ebp), %eax                               #1087.29
-        movl      -56(%ebp), %edx                               #1087.29
-..LN801:
-        movl      %eax, -52(%ebp)                               #1087.9
-        movl      %edx, -48(%ebp)                               #1087.9
-..LN803:
-        movl      -44(%ebp), %eax                               #1089.26
-..LN805:
-        movl      %eax, -40(%ebp)                               #1089.9
-..LN807:
-        movl      -44(%ebp), %eax                               #1090.26
-        movl      -40(%ebp), %edx                               #1090.26
-..LN809:
-        movl      %eax, -36(%ebp)                               #1090.9
-        movl      %edx, -32(%ebp)                               #1090.9
-..LN811:
-        movl      -16(%ebp), %eax                               #1092.9
-        movl      $7, (%eax)                                    #1092.9
-        jmp       ..B9.29       # Prob 100%                     #1092.9
-                                # LOE
-..B9.26:                        # Preds ..B9.24
-..LN813:
-        movl      20(%ebp), %eax                                #1094.15
-..LN815:
-        cmpl      $14, %eax                                     #1094.22
-        jae       ..B9.28       # Prob 50%                      #1094.22
-                                # LOE
-..B9.27:                        # Preds ..B9.26
-..LN817:
-        movl      -60(%ebp), %eax                               #1096.29
-        movl      -56(%ebp), %edx                               #1096.29
-..LN819:
-        movl      %eax, -52(%ebp)                               #1096.9
-        movl      %edx, -48(%ebp)                               #1096.9
-..LN821:
-        movl      -44(%ebp), %eax                               #1097.26
-        movl      -40(%ebp), %edx                               #1097.26
-..LN823:
-        movl      %eax, -36(%ebp)                               #1097.9
-        movl      %edx, -32(%ebp)                               #1097.9
-..LN825:
-        movl      -16(%ebp), %eax                               #1099.9
-        movl      $1, (%eax)                                    #1099.9
-        jmp       ..B9.29       # Prob 100%                     #1099.9
-                                # LOE
-..B9.28:                        # Preds ..B9.26
-..LN827:
-        movl      -16(%ebp), %eax                               #1103.9
-        movl      $8, (%eax)                                    #1103.9
-                                # LOE
-..B9.29:                        # Preds ..B9.21 ..B9.23 ..B9.25 ..B9.27 ..B9.28
-                                #      
-..LN829:
-        movl      -16(%ebp), %eax                               #1106.5
-..LN831:
-        movl      -60(%ebp), %edx                               #1106.42
-        movl      %edx, 16(%eax)                                #1106.42
-        movl      -56(%ebp), %edx                               #1106.42
-        movl      %edx, 20(%eax)                                #1106.42
-        movl      -52(%ebp), %edx                               #1106.42
-        movl      %edx, 24(%eax)                                #1106.42
-        movl      -48(%ebp), %edx                               #1106.42
-        movl      %edx, 28(%eax)                                #1106.42
-..LN833:
-        movl      -16(%ebp), %eax                               #1107.5
-..LN835:
-        movl      -44(%ebp), %edx                               #1107.39
-        movl      %edx, 32(%eax)                                #1107.39
-        movl      -40(%ebp), %edx                               #1107.39
-        movl      %edx, 36(%eax)                                #1107.39
-        movl      -36(%ebp), %edx                               #1107.39
-        movl      %edx, 40(%eax)                                #1107.39
-        movl      -32(%ebp), %edx                               #1107.39
-        movl      %edx, 44(%eax)                                #1107.39
-..LN837:
-        pushl     %edi                                          #1110.5
-..LN839:
-        lea       -60(%ebp), %eax                               #1110.23
-        movl      %eax, (%esp)                                  #1110.23
-..LN841:
-        call      uint128_bswap                                 #1110.5
-                                # LOE
-..B9.48:                        # Preds ..B9.29
-        popl      %ecx                                          #1110.5
-                                # LOE
-..B9.30:                        # Preds ..B9.48
-..LN843:
-        pushl     %edi                                          #1111.5
-..LN845:
-        lea       -44(%ebp), %eax                               #1111.23
-        movl      %eax, (%esp)                                  #1111.23
-..LN847:
-        call      uint128_bswap                                 #1111.5
-                                # LOE
-..B9.49:                        # Preds ..B9.30
-        popl      %ecx                                          #1111.5
-                                # LOE
-..B9.31:                        # Preds ..B9.49
-..LN849:
-        addl      $-8, %esp                                     #1114.5
-..LN851:
-        lea       -60(%ebp), %eax                               #1114.21
-        movl      %eax, (%esp)                                  #1114.21
-..LN853:
-        movl      $4, 4(%esp)                                   #1114.34
-..LN855:
-        call      uint128_shr                                   #1114.5
-                                # LOE
-..B9.50:                        # Preds ..B9.31
-        addl      $8, %esp                                      #1114.5
-                                # LOE
-..B9.32:                        # Preds ..B9.50
-..LN857:
-        addl      $-8, %esp                                     #1115.5
-..LN859:
-        lea       -44(%ebp), %eax                               #1115.21
-        movl      %eax, (%esp)                                  #1115.21
-..LN861:
-        movl      $4, 4(%esp)                                   #1115.31
-..LN863:
-        call      uint128_shr                                   #1115.5
-                                # LOE
-..B9.51:                        # Preds ..B9.32
-        addl      $8, %esp                                      #1115.5
-                                # LOE
-..B9.33:                        # Preds ..B9.51
-..LN865:
-        addl      $-8, %esp                                     #1118.5
-..LN867:
-        movl      -16(%ebp), %eax                               #1118.28
-..LN869:
-        addl      $48, %eax                                     #1118.5
-        movl      %eax, (%esp)                                  #1118.5
-..LN871:
-        lea       -60(%ebp), %eax                               #1118.70
-        movl      %eax, 4(%esp)                                 #1118.70
-..LN873:
-        call      uint128_bswap_copy                            #1118.5
-                                # LOE
-..B9.52:                        # Preds ..B9.33
-        addl      $8, %esp                                      #1118.5
-                                # LOE
-..B9.34:                        # Preds ..B9.52
-..LN875:
-        addl      $-8, %esp                                     #1119.5
-..LN877:
-        movl      -16(%ebp), %eax                               #1119.28
-..LN879:
-        addl      $64, %eax                                     #1119.5
-        movl      %eax, (%esp)                                  #1119.5
-..LN881:
-        lea       -44(%ebp), %eax                               #1119.67
-        movl      %eax, 4(%esp)                                 #1119.67
-..LN883:
-        call      uint128_bswap_copy                            #1119.5
-                                # LOE
-..B9.53:                        # Preds ..B9.34
-        addl      $8, %esp                                      #1119.5
-                                # LOE
-..B9.35:                        # Preds ..B9.53
-..LN885:
-        addl      $-8, %esp                                     #1121.5
-..LN887:
-        lea       -60(%ebp), %eax                               #1121.21
-        movl      %eax, (%esp)                                  #1121.21
-..LN889:
-        movl      $4, 4(%esp)                                   #1121.34
-..LN891:
-        call      uint128_shr                                   #1121.5
-                                # LOE
-..B9.54:                        # Preds ..B9.35
-        addl      $8, %esp                                      #1121.5
-                                # LOE
-..B9.36:                        # Preds ..B9.54
-..LN893:
-        addl      $-8, %esp                                     #1122.5
-..LN895:
-        lea       -44(%ebp), %eax                               #1122.21
-        movl      %eax, (%esp)                                  #1122.21
-..LN897:
-        movl      $4, 4(%esp)                                   #1122.31
-..LN899:
-        call      uint128_shr                                   #1122.5
-                                # LOE
-..B9.55:                        # Preds ..B9.36
-        addl      $8, %esp                                      #1122.5
-                                # LOE
-..B9.37:                        # Preds ..B9.55
-..LN901:
-        addl      $-8, %esp                                     #1124.5
-..LN903:
-        movl      -16(%ebp), %eax                               #1124.28
-..LN905:
-        addl      $80, %eax                                     #1124.5
-        movl      %eax, (%esp)                                  #1124.5
-..LN907:
-        lea       -60(%ebp), %eax                               #1124.70
-        movl      %eax, 4(%esp)                                 #1124.70
-..LN909:
-        call      uint128_bswap_copy                            #1124.5
-                                # LOE
-..B9.56:                        # Preds ..B9.37
-        addl      $8, %esp                                      #1124.5
-                                # LOE
-..B9.38:                        # Preds ..B9.56
-..LN911:
-        addl      $-8, %esp                                     #1125.5
-..LN913:
-        movl      -16(%ebp), %eax                               #1125.28
-..LN915:
-        addl      $96, %eax                                     #1125.5
-        movl      %eax, (%esp)                                  #1125.5
-..LN917:
-        lea       -44(%ebp), %eax                               #1125.67
-        movl      %eax, 4(%esp)                                 #1125.67
-..LN919:
-        call      uint128_bswap_copy                            #1125.5
-                                # LOE
-..B9.57:                        # Preds ..B9.38
-        addl      $8, %esp                                      #1125.5
-                                # LOE
-..B9.39:                        # Preds ..B9.57
-..LN921:
-        addl      $-8, %esp                                     #1127.5
-..LN923:
-        lea       -60(%ebp), %eax                               #1127.21
-        movl      %eax, (%esp)                                  #1127.21
-..LN925:
-        movl      $4, 4(%esp)                                   #1127.34
-..LN927:
-        call      uint128_shr                                   #1127.5
-                                # LOE
-..B9.58:                        # Preds ..B9.39
-        addl      $8, %esp                                      #1127.5
-                                # LOE
-..B9.40:                        # Preds ..B9.58
-..LN929:
-        addl      $-8, %esp                                     #1128.5
-..LN931:
-        lea       -44(%ebp), %eax                               #1128.21
-        movl      %eax, (%esp)                                  #1128.21
-..LN933:
-        movl      $4, 4(%esp)                                   #1128.31
-..LN935:
-        call      uint128_shr                                   #1128.5
-                                # LOE
-..B9.59:                        # Preds ..B9.40
-        addl      $8, %esp                                      #1128.5
-                                # LOE
-..B9.41:                        # Preds ..B9.59
-..LN937:
-        addl      $-8, %esp                                     #1130.5
-..LN939:
-        movl      -16(%ebp), %eax                               #1130.28
-..LN941:
-        addl      $112, %eax                                    #1130.5
-        movl      %eax, (%esp)                                  #1130.5
-..LN943:
-        lea       -60(%ebp), %eax                               #1130.70
-        movl      %eax, 4(%esp)                                 #1130.70
-..LN945:
-        call      uint128_bswap_copy                            #1130.5
-                                # LOE
-..B9.60:                        # Preds ..B9.41
-        addl      $8, %esp                                      #1130.5
-                                # LOE
-..B9.42:                        # Preds ..B9.60
-..LN947:
-        addl      $-8, %esp                                     #1131.5
-..LN949:
-        movl      -16(%ebp), %eax                               #1131.28
-..LN951:
-        addl      $128, %eax                                    #1131.5
-        movl      %eax, (%esp)                                  #1131.5
-..LN953:
-        lea       -44(%ebp), %eax                               #1131.67
-        movl      %eax, 4(%esp)                                 #1131.67
-..LN955:
-        call      uint128_bswap_copy                            #1131.5
-                                # LOE
-..B9.61:                        # Preds ..B9.42
-        addl      $8, %esp                                      #1131.5
-                                # LOE
-..B9.43:                        # Preds ..B9.61
-..LN957:
-        xorl      %eax, %eax                                    #1173.12
-        movl      -4(%ebp), %ebx                                #1173.12
-..___tag_value_NucStrFastaExprMake4.160:                        #
-        leave                                                   #1173.12
-..___tag_value_NucStrFastaExprMake4.162:                        #
-        ret                                                     #1173.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprMake4.163:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-.LNNucStrFastaExprMake4:
-	.data
-# -- End  NucStrFastaExprMake4
-	.data
-	.text
-# -- Begin  nss_sob
-# mark_begin;
-       .align    2,0x90
-nss_sob:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-..B10.1:                        # Preds ..B10.0
-..___tag_value_nss_sob.166:                                     #
-..LN959:
-        pushl     %ebp                                          #1181.1
-        movl      %esp, %ebp                                    #1181.1
-..___tag_value_nss_sob.171:                                     #
-        subl      $8, %esp                                      #1181.1
-        movl      %ebx, -4(%ebp)                                #1181.1
-..___tag_value_nss_sob.174:                                     #
-..LN961:
-        movl      8(%ebp), %eax                                 #1182.13
-..LN963:
-        movl      12(%ebp), %edx                                #1182.17
-        cmpl      %edx, %eax                                    #1182.17
-        jae       ..B10.6       # Prob 50%                      #1182.17
-                                # LOE
-..B10.2:                        # Preds ..B10.1
-        call      ..L175        # Prob 100%                     #
-..L175:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L175], %eax     #
-        movl      %eax, -8(%ebp)                                #
-..LN965:
-        movl      %eax, %ebx                                    #1182.24
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE eax
-..B10.9:                        # Preds ..B10.2
-        movl      8(%ebp), %edx                                 #1182.24
-        movzbl    (%edx), %edx                                  #1182.24
-        movzbl    %dl, %edx                                     #1182.24
-        movl      (%eax), %eax                                  #1182.24
-        movzwl    (%eax,%edx,2), %eax                           #1182.24
-        testl     $8192, %eax                                   #1182.24
-        jne       ..B10.5       # Prob 50%                      #1182.24
-        jmp       ..B10.6       # Prob 100%                     #1182.24
-                                # LOE
-..B10.3:                        # Preds ..B10.5
-        movl      -8(%ebp), %eax                                #1182.24
-        movl      %eax, %ebx                                    #1182.24
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE eax
-..B10.10:                       # Preds ..B10.3
-        movl      8(%ebp), %edx                                 #1182.24
-        movzbl    (%edx), %edx                                  #1182.24
-        movzbl    %dl, %edx                                     #1182.24
-        movl      (%eax), %eax                                  #1182.24
-        movzwl    (%eax,%edx,2), %eax                           #1182.24
-        testl     $8192, %eax                                   #1182.24
-        je        ..B10.6       # Prob 50%                      #1182.24
-                                # LOE
-..B10.5:                        # Preds ..B10.9 ..B10.10
-..LN967:
-        incl      8(%ebp)                                       #1183.12
-..LN969:
-        movl      8(%ebp), %eax                                 #1182.13
-..LN971:
-        movl      12(%ebp), %edx                                #1182.17
-        cmpl      %edx, %eax                                    #1182.17
-        jb        ..B10.3       # Prob 50%                      #1182.17
-                                # LOE
-..B10.6:                        # Preds ..B10.10 ..B10.9 ..B10.5 ..B10.1
-..LN973:
-        movl      8(%ebp), %eax                                 #1184.12
-        movl      -4(%ebp), %ebx                                #1184.12
-..___tag_value_nss_sob.176:                                     #
-        leave                                                   #1184.12
-..___tag_value_nss_sob.178:                                     #
-        ret                                                     #1184.12
-        .align    2,0x90
-..___tag_value_nss_sob.179:                                     #
-                                # LOE
-# mark_end;
-	.type	nss_sob, at function
-	.size	nss_sob,.-nss_sob
-.LNnss_sob:
-	.data
-# -- End  nss_sob
-	.text
-# -- Begin  nss_FASTA_expr
-# mark_begin;
-       .align    2,0x90
-nss_FASTA_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B11.1:                        # Preds ..B11.0
-..___tag_value_nss_FASTA_expr.182:                              #
-..LN975:
-        pushl     %ebp                                          #1192.1
-        movl      %esp, %ebp                                    #1192.1
-..___tag_value_nss_FASTA_expr.187:                              #
-        subl      $24, %esp                                     #1192.1
-..LN977:
-        movl      8(%ebp), %eax                                 #1193.10
-..LN979:
-        movl      12(%ebp), %edx                                #1193.15
-        cmpl      %edx, %eax                                    #1193.15
-        jb        ..B11.3       # Prob 50%                      #1193.15
-                                # LOE
-..B11.2:                        # Preds ..B11.1
-..LN981:
-        movl      20(%ebp), %eax                                #1194.9
-        movl      $22, (%eax)                                   #1194.9
-        jmp       ..B11.17      # Prob 100%                     #1194.9
-                                # LOE
-..B11.3:                        # Preds ..B11.1
-        call      ..L190        # Prob 100%                     #
-..L190:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L190], %eax     #
-        movl      %eax, -4(%ebp)                                #
-..LN983:
-        movl      8(%ebp), %edx                                 #1197.30
-..LN985:
-        movl      %edx, -16(%ebp)                               #1197.27
-..LN987:
-        movl      $0, -12(%ebp)                                 #1199.22
-..LN989:
-        lea       fasta_2na_map at GOTOFF(%eax), %eax              #1200.27
-        movl      %eax, -8(%ebp)                                #1200.27
-                                # LOE
-..B11.4:                        # Preds ..B11.9 ..B11.3
-..LN991:
-        movl      8(%ebp), %eax                                 #1203.20
-        movzbl    (%eax), %eax                                  #1203.20
-        movsbl    %al, %eax                                     #1203.20
-..LN993:
-        testl     %eax, %eax                                    #1203.24
-        jl        ..B11.10      # Prob 50%                      #1203.24
-                                # LOE
-..B11.5:                        # Preds ..B11.4
-..LN995:
-        movl      8(%ebp), %eax                                 #1206.45
-        movzbl    (%eax), %eax                                  #1206.45
-        movzbl    %al, %eax                                     #1206.45
-..LN997:
-        movl      -8(%ebp), %edx                                #1206.18
-        movzbl    (%eax,%edx), %eax                             #1206.18
-        movsbl    %al, %eax                                     #1206.18
-..LN999:
-        testl     %eax, %eax                                    #1206.51
-        jge       ..B11.9       # Prob 50%                      #1206.51
-                                # LOE
-..B11.6:                        # Preds ..B11.5
-..LN1001:
-        movl      -4(%ebp), %eax                                #1208.29
-        lea       fasta_4na_map at GOTOFF(%eax), %eax              #1208.29
-..LN1003:
-        movl      -8(%ebp), %edx                                #1208.22
-..LN1005:
-        cmpl      %eax, %edx                                    #1208.29
-        je        ..B11.10      # Prob 50%                      #1208.29
-                                # LOE
-..B11.7:                        # Preds ..B11.6
-..LN1007:
-        movl      8(%ebp), %eax                                 #1210.59
-        movzbl    (%eax), %eax                                  #1210.59
-        movzbl    %al, %eax                                     #1210.59
-..LN1009:
-        movl      -4(%ebp), %edx                                #1210.22
-        movzbl    fasta_4na_map at GOTOFF(%eax,%edx), %eax         #1210.22
-        movsbl    %al, %eax                                     #1210.22
-..LN1011:
-        testl     %eax, %eax                                    #1210.65
-        jl        ..B11.10      # Prob 50%                      #1210.65
-                                # LOE
-..B11.8:                        # Preds ..B11.7
-..LN1013:
-        movl      $1, -12(%ebp)                                 #1212.17
-..LN1015:
-        movl      -4(%ebp), %eax                                #1213.23
-        lea       fasta_4na_map at GOTOFF(%eax), %eax              #1213.23
-..LN1017:
-        movl      %eax, -8(%ebp)                                #1213.17
-                                # LOE
-..B11.9:                        # Preds ..B11.8 ..B11.5
-..LN1019:
-        movl      8(%ebp), %eax                                 #1216.20
-        incl      %eax                                          #1216.20
-        movl      %eax, 8(%ebp)                                 #1216.20
-..LN1021:
-        movl      12(%ebp), %edx                                #1216.24
-        cmpl      %edx, %eax                                    #1216.24
-        jb        ..B11.4       # Prob 50%                      #1216.24
-                                # LOE
-..B11.10:                       # Preds ..B11.7 ..B11.6 ..B11.4 ..B11.9
-..LN1023:
-        movl      8(%ebp), %eax                                 #1218.14
-..LN1025:
-        movl      -16(%ebp), %edx                               #1218.19
-        cmpl      %edx, %eax                                    #1218.19
-        ja        ..B11.12      # Prob 50%                      #1218.19
-                                # LOE
-..B11.11:                       # Preds ..B11.10
-..LN1027:
-        movl      20(%ebp), %eax                                #1219.13
-        movl      $22, (%eax)                                   #1219.13
-        jmp       ..B11.17      # Prob 100%                     #1219.13
-                                # LOE
-..B11.12:                       # Preds ..B11.10
-..LN1029:
-        movl      -12(%ebp), %eax                               #1220.19
-..LN1031:
-        testl     %eax, %eax                                    #1220.27
-        jne       ..B11.15      # Prob 50%                      #1220.27
-                                # LOE
-..B11.13:                       # Preds ..B11.12
-..LN1033:
-        addl      $-16, %esp                                    #1221.24
-..LN1035:
-        movl      16(%ebp), %eax                                #1221.47
-        movl      %eax, (%esp)                                  #1221.47
-..LN1037:
-        movl      24(%ebp), %eax                                #1221.53
-        movl      %eax, 4(%esp)                                 #1221.53
-..LN1039:
-        movl      -16(%ebp), %eax                               #1221.65
-        movl      %eax, 8(%esp)                                 #1221.65
-..LN1041:
-        movl      -16(%ebp), %eax                               #1221.76
-        negl      %eax                                          #1221.76
-        addl      8(%ebp), %eax                                 #1221.76
-        movl      %eax, 12(%esp)                                #1221.76
-..LN1043:
-        call      NucStrFastaExprMake2                          #1221.24
-                                # LOE eax
-..B11.20:                       # Preds ..B11.13
-        addl      $16, %esp                                     #1221.24
-        movl      %eax, -24(%ebp)                               #1221.24
-                                # LOE
-..B11.14:                       # Preds ..B11.20
-..LN1045:
-        movl      20(%ebp), %eax                                #1221.13
-        movl      -24(%ebp), %edx                               #1221.13
-        movl      %edx, (%eax)                                  #1221.13
-        jmp       ..B11.17      # Prob 100%                     #1221.13
-                                # LOE
-..B11.15:                       # Preds ..B11.12
-..LN1047:
-        addl      $-16, %esp                                    #1223.24
-..LN1049:
-        movl      16(%ebp), %eax                                #1223.47
-        movl      %eax, (%esp)                                  #1223.47
-..LN1051:
-        movl      24(%ebp), %eax                                #1223.53
-        movl      %eax, 4(%esp)                                 #1223.53
-..LN1053:
-        movl      -16(%ebp), %eax                               #1223.65
-        movl      %eax, 8(%esp)                                 #1223.65
-..LN1055:
-        movl      -16(%ebp), %eax                               #1223.76
-        negl      %eax                                          #1223.76
-        addl      8(%ebp), %eax                                 #1223.76
-        movl      %eax, 12(%esp)                                #1223.76
-..LN1057:
-        call      NucStrFastaExprMake4                          #1223.24
-                                # LOE eax
-..B11.21:                       # Preds ..B11.15
-        addl      $16, %esp                                     #1223.24
-        movl      %eax, -20(%ebp)                               #1223.24
-                                # LOE
-..B11.16:                       # Preds ..B11.21
-..LN1059:
-        movl      20(%ebp), %eax                                #1223.13
-        movl      -20(%ebp), %edx                               #1223.13
-        movl      %edx, (%eax)                                  #1223.13
-                                # LOE
-..B11.17:                       # Preds ..B11.2 ..B11.11 ..B11.14 ..B11.16
-..LN1061:
-        movl      8(%ebp), %eax                                 #1226.12
-        leave                                                   #1226.12
-..___tag_value_nss_FASTA_expr.192:                              #
-        ret                                                     #1226.12
-        .align    2,0x90
-..___tag_value_nss_FASTA_expr.193:                              #
-                                # LOE
-# mark_end;
-	.type	nss_FASTA_expr, at function
-	.size	nss_FASTA_expr,.-nss_FASTA_expr
-.LNnss_FASTA_expr:
-	.data
-# -- End  nss_FASTA_expr
-	.section .rodata, "a"
-	.align 4
-__$U1:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	102
-	.byte	97
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U1, at object
-	.size	__$U1,15
-	.space 1	# pad
-_2__STRING.3:
-	.byte	112
-	.byte	32
-	.byte	60
-	.byte	32
-	.byte	101
-	.byte	110
-	.byte	100
-	.byte	0
-	.type	_2__STRING.3, at object
-	.size	_2__STRING.3,8
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    2,0x90
-nss_fasta_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B12.1:                        # Preds ..B12.0
-..___tag_value_nss_fasta_expr.196:                              #
-..LN1063:
-        pushl     %ebp                                          #1234.1
-        movl      %esp, %ebp                                    #1234.1
-..___tag_value_nss_fasta_expr.201:                              #
-        subl      $28, %esp                                     #1234.1
-        movl      %ebx, -4(%ebp)                                #1234.1
-..___tag_value_nss_fasta_expr.204:                              #
-..LN1065:
-        movl      8(%ebp), %eax                                 #1235.5
-        movl      12(%ebp), %edx                                #1235.5
-        cmpl      %edx, %eax                                    #1235.5
-        jb        ..B12.3       # Prob 50%                      #1235.5
-..___tag_value_nss_fasta_expr.205:                              #
-                                # LOE
-..B12.2:                        # Preds ..B12.1
-        call      ..L206        # Prob 100%                     #
-..L206:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L206], %eax     #
-        addl      $-16, %esp                                    #1235.5
-        lea       _2__STRING.3 at GOTOFF(%eax), %edx               #1235.5
-        movl      %edx, (%esp)                                  #1235.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #1235.5
-        movl      %edx, 4(%esp)                                 #1235.5
-        movl      $1235, 8(%esp)                                #1235.5
-        lea       __$U1 at GOTOFF(%eax), %edx                      #1235.5
-        movl      %edx, 12(%esp)                                #1235.5
-        movl      %eax, %ebx                                    #1235.5
-        call      __assert_fail at PLT                             #1235.5
-                                # LOE
-..B12.26:                       # Preds ..B12.2
-        addl      $16, %esp                                     #1235.5
-..___tag_value_nss_fasta_expr.207:                              #
-                                # LOE
-..B12.3:                        # Preds ..B12.1
-..LN1067:
-        movl      8(%ebp), %eax                                 #1236.16
-        movzbl    (%eax), %eax                                  #1236.16
-        movsbl    %al, %eax                                     #1236.16
-        movl      %eax, -8(%ebp)                                #1236.16
-        cmpl      $39, %eax                                     #1236.16
-        je        ..B12.5       # Prob 50%                      #1236.16
-                                # LOE
-..B12.4:                        # Preds ..B12.3
-        movl      -8(%ebp), %eax                                #1236.16
-        cmpl      $34, %eax                                     #1236.16
-        je        ..B12.13      # Prob 50%                      #1236.16
-        jmp       ..B12.21      # Prob 100%                     #1236.16
-                                # LOE
-..B12.5:                        # Preds ..B12.3
-..LN1069:
-        addl      $-20, %esp                                    #1239.13
-..LN1071:
-        movl      8(%ebp), %eax                                 #1239.30
-        incl      %eax                                          #1239.30
-        movl      %eax, (%esp)                                  #1239.30
-..LN1073:
-        movl      12(%ebp), %eax                                #1239.37
-        movl      %eax, 4(%esp)                                 #1239.37
-..LN1075:
-        movl      16(%ebp), %eax                                #1239.42
-        movl      %eax, 8(%esp)                                 #1239.42
-..LN1077:
-        movl      20(%ebp), %eax                                #1239.48
-        movl      %eax, 12(%esp)                                #1239.48
-..LN1079:
-        movl      24(%ebp), %eax                                #1239.56
-        movl      %eax, 16(%esp)                                #1239.56
-..LN1081:
-        call      nss_FASTA_expr                                #1239.13
-                                # LOE eax
-..B12.27:                       # Preds ..B12.5
-        addl      $20, %esp                                     #1239.13
-        movl      %eax, -12(%ebp)                               #1239.13
-                                # LOE
-..B12.6:                        # Preds ..B12.27
-..LN1083:
-        movl      -12(%ebp), %eax                               #1239.9
-        movl      %eax, 8(%ebp)                                 #1239.9
-..LN1085:
-        movl      20(%ebp), %eax                                #1240.16
-        movl      (%eax), %eax                                  #1240.16
-..LN1087:
-        testl     %eax, %eax                                    #1240.26
-        jne       ..B12.23      # Prob 50%                      #1240.26
-                                # LOE
-..B12.7:                        # Preds ..B12.6
-..LN1089:
-        movl      8(%ebp), %eax                                 #1240.33
-..LN1091:
-        movl      12(%ebp), %edx                                #1240.38
-        cmpl      %edx, %eax                                    #1240.38
-        je        ..B12.12      # Prob 50%                      #1240.38
-                                # LOE
-..B12.8:                        # Preds ..B12.7
-..LN1093:
-        movl      8(%ebp), %eax                                 #1240.47
-        movzbl    (%eax), %eax                                  #1240.47
-        movsbl    %al, %eax                                     #1240.47
-..LN1095:
-        cmpl      $39, %eax                                     #1240.55
-        jne       ..B12.10      # Prob 50%                      #1240.55
-                                # LOE
-..B12.9:                        # Preds ..B12.8
-        movl      $0, -24(%ebp)                                 #1240.55
-        jmp       ..B12.11      # Prob 100%                     #1240.55
-                                # LOE
-..B12.10:                       # Preds ..B12.8
-        movl      $1, -24(%ebp)                                 #1240.55
-                                # LOE
-..B12.11:                       # Preds ..B12.10 ..B12.9
-..LN1097:
-        movl      -24(%ebp), %eax                               #1240.47
-        incl      8(%ebp)                                       #1240.47
-..LN1099:
-        testl     %eax, %eax                                    #1240.55
-        je        ..B12.23      # Prob 100%                     #1240.55
-                                # LOE
-..B12.12:                       # Preds ..B12.7 ..B12.11
-..LN1101:
-        movl      20(%ebp), %eax                                #1241.13
-        movl      $22, (%eax)                                   #1241.13
-        jmp       ..B12.23      # Prob 100%                     #1241.13
-                                # LOE
-..B12.13:                       # Preds ..B12.4
-..LN1103:
-        addl      $-20, %esp                                    #1244.13
-..LN1105:
-        movl      8(%ebp), %eax                                 #1244.30
-        incl      %eax                                          #1244.30
-        movl      %eax, (%esp)                                  #1244.30
-..LN1107:
-        movl      12(%ebp), %eax                                #1244.37
-        movl      %eax, 4(%esp)                                 #1244.37
-..LN1109:
-        movl      16(%ebp), %eax                                #1244.42
-        movl      %eax, 8(%esp)                                 #1244.42
-..LN1111:
-        movl      20(%ebp), %eax                                #1244.48
-        movl      %eax, 12(%esp)                                #1244.48
-..LN1113:
-        movl      24(%ebp), %eax                                #1244.56
-        movl      %eax, 16(%esp)                                #1244.56
-..LN1115:
-        call      nss_FASTA_expr                                #1244.13
-                                # LOE eax
-..B12.28:                       # Preds ..B12.13
-        addl      $20, %esp                                     #1244.13
-        movl      %eax, -20(%ebp)                               #1244.13
-                                # LOE
-..B12.14:                       # Preds ..B12.28
-..LN1117:
-        movl      -20(%ebp), %eax                               #1244.9
-        movl      %eax, 8(%ebp)                                 #1244.9
-..LN1119:
-        movl      20(%ebp), %eax                                #1245.16
-        movl      (%eax), %eax                                  #1245.16
-..LN1121:
-        testl     %eax, %eax                                    #1245.26
-        jne       ..B12.23      # Prob 50%                      #1245.26
-                                # LOE
-..B12.15:                       # Preds ..B12.14
-..LN1123:
-        movl      8(%ebp), %eax                                 #1245.33
-..LN1125:
-        movl      12(%ebp), %edx                                #1245.38
-        cmpl      %edx, %eax                                    #1245.38
-        je        ..B12.20      # Prob 50%                      #1245.38
-                                # LOE
-..B12.16:                       # Preds ..B12.15
-..LN1127:
-        movl      8(%ebp), %eax                                 #1245.47
-        movzbl    (%eax), %eax                                  #1245.47
-        movsbl    %al, %eax                                     #1245.47
-..LN1129:
-        cmpl      $34, %eax                                     #1245.55
-        jne       ..B12.18      # Prob 50%                      #1245.55
-                                # LOE
-..B12.17:                       # Preds ..B12.16
-        movl      $0, -28(%ebp)                                 #1245.55
-        jmp       ..B12.19      # Prob 100%                     #1245.55
-                                # LOE
-..B12.18:                       # Preds ..B12.16
-        movl      $1, -28(%ebp)                                 #1245.55
-                                # LOE
-..B12.19:                       # Preds ..B12.18 ..B12.17
-..LN1131:
-        movl      -28(%ebp), %eax                               #1245.47
-        incl      8(%ebp)                                       #1245.47
-..LN1133:
-        testl     %eax, %eax                                    #1245.55
-        je        ..B12.23      # Prob 100%                     #1245.55
-                                # LOE
-..B12.20:                       # Preds ..B12.15 ..B12.19
-..LN1135:
-        movl      20(%ebp), %eax                                #1246.13
-        movl      $22, (%eax)                                   #1246.13
-        jmp       ..B12.23      # Prob 100%                     #1246.13
-                                # LOE
-..B12.21:                       # Preds ..B12.4
-..LN1137:
-        addl      $-20, %esp                                    #1249.16
-..LN1139:
-        movl      8(%ebp), %eax                                 #1249.33
-        movl      %eax, (%esp)                                  #1249.33
-..LN1141:
-        movl      12(%ebp), %eax                                #1249.36
-        movl      %eax, 4(%esp)                                 #1249.36
-..LN1143:
-        movl      16(%ebp), %eax                                #1249.41
-        movl      %eax, 8(%esp)                                 #1249.41
-..LN1145:
-        movl      20(%ebp), %eax                                #1249.47
-        movl      %eax, 12(%esp)                                #1249.47
-..LN1147:
-        movl      24(%ebp), %eax                                #1249.55
-        movl      %eax, 16(%esp)                                #1249.55
-..LN1149:
-        call      nss_FASTA_expr                                #1249.16
-                                # LOE eax
-..B12.29:                       # Preds ..B12.21
-        addl      $20, %esp                                     #1249.16
-        movl      %eax, -16(%ebp)                               #1249.16
-                                # LOE
-..B12.22:                       # Preds ..B12.29
-        movl      -16(%ebp), %eax                               #1249.16
-        movl      -4(%ebp), %ebx                                #1249.16
-..___tag_value_nss_fasta_expr.208:                              #
-        leave                                                   #1249.16
-..___tag_value_nss_fasta_expr.210:                              #
-        ret                                                     #1249.16
-..___tag_value_nss_fasta_expr.211:                              #
-                                # LOE
-..B12.23:                       # Preds ..B12.12 ..B12.11 ..B12.6 ..B12.20 ..B12.19
-                                #       ..B12.14
-..LN1151:
-        movl      8(%ebp), %eax                                 #1252.12
-        movl      -4(%ebp), %ebx                                #1252.12
-..___tag_value_nss_fasta_expr.213:                              #
-        leave                                                   #1252.12
-..___tag_value_nss_fasta_expr.215:                              #
-        ret                                                     #1252.12
-        .align    2,0x90
-..___tag_value_nss_fasta_expr.216:                              #
-                                # LOE
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-.LNnss_fasta_expr:
-	.data
-# -- End  nss_fasta_expr
-	.section .rodata, "a"
-	.align 4
-__$U2:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	112
-	.byte	114
-	.byte	105
-	.byte	109
-	.byte	97
-	.byte	114
-	.byte	121
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U2, at object
-	.size	__$U2,17
-	.text
-# -- Begin  nss_primary_expr
-# mark_begin;
-       .align    2,0x90
-nss_primary_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B13.1:                        # Preds ..B13.0
-..___tag_value_nss_primary_expr.219:                            #
-..LN1153:
-        pushl     %ebp                                          #1291.1
-        movl      %esp, %ebp                                    #1291.1
-..___tag_value_nss_primary_expr.224:                            #
-        subl      $52, %esp                                     #1291.1
-        movl      %ebx, -4(%ebp)                                #1291.1
-..___tag_value_nss_primary_expr.227:                            #
-        call      ..L228        # Prob 100%                     #1291.1
-..L228:                                                         #
-        popl      %eax                                          #1291.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L228], %eax     #1291.1
-        movl      %eax, -8(%ebp)                                #1291.1
-..LN1155:
-        movl      8(%ebp), %eax                                 #1294.5
-        movl      12(%ebp), %edx                                #1294.5
-        cmpl      %edx, %eax                                    #1294.5
-        jb        ..B13.3       # Prob 50%                      #1294.5
-..___tag_value_nss_primary_expr.229:                            #
-                                # LOE
-..B13.2:                        # Preds ..B13.1
-        addl      $-16, %esp                                    #1294.5
-        movl      -8(%ebp), %eax                                #1294.5
-        lea       _2__STRING.3 at GOTOFF(%eax), %eax               #1294.5
-        movl      %eax, (%esp)                                  #1294.5
-        movl      -8(%ebp), %eax                                #1294.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #1294.5
-        movl      %eax, 4(%esp)                                 #1294.5
-        movl      $1294, 8(%esp)                                #1294.5
-        movl      -8(%ebp), %eax                                #1294.5
-        lea       __$U2 at GOTOFF(%eax), %eax                      #1294.5
-        movl      %eax, 12(%esp)                                #1294.5
-        movl      -8(%ebp), %eax                                #1294.5
-        movl      %eax, %ebx                                    #1294.5
-        call      __assert_fail at PLT                             #1294.5
-                                # LOE
-..B13.38:                       # Preds ..B13.2
-        addl      $16, %esp                                     #1294.5
-..___tag_value_nss_primary_expr.230:                            #
-                                # LOE
-..B13.3:                        # Preds ..B13.1
-..LN1157:
-        movl      8(%ebp), %eax                                 #1295.16
-        movzbl    (%eax), %eax                                  #1295.16
-        movsbl    %al, %eax                                     #1295.16
-        movl      %eax, -12(%ebp)                               #1295.16
-        cmpl      $94, %eax                                     #1295.16
-        je        ..B13.5       # Prob 50%                      #1295.16
-                                # LOE
-..B13.4:                        # Preds ..B13.3
-        movl      -12(%ebp), %eax                               #1295.16
-        cmpl      $40, %eax                                     #1295.16
-        je        ..B13.12      # Prob 50%                      #1295.16
-        jmp       ..B13.25      # Prob 100%                     #1295.16
-                                # LOE
-..B13.5:                        # Preds ..B13.3
-..LN1159:
-        pushl     %edi                                          #1298.13
-..LN1161:
-        movl      $12, (%esp)                                   #1298.22
-..LN1163:
-        movl      -8(%ebp), %eax                                #1298.13
-        movl      %eax, %ebx                                    #1298.13
-        call      malloc at PLT                                    #1298.13
-                                # LOE eax
-..B13.39:                       # Preds ..B13.5
-        popl      %ecx                                          #1298.13
-        movl      %eax, -16(%ebp)                               #1298.13
-                                # LOE
-..B13.6:                        # Preds ..B13.39
-..LN1165:
-        movl      -16(%ebp), %eax                               #1298.9
-        movl      %eax, -20(%ebp)                               #1298.9
-..LN1167:
-        movl      -20(%ebp), %eax                               #1299.14
-..LN1169:
-        testl     %eax, %eax                                    #1299.19
-        jne       ..B13.8       # Prob 50%                      #1299.19
-                                # LOE
-..B13.7:                        # Preds ..B13.6
-..LN1171:
-        movl      -8(%ebp), %eax                                #1300.24
-        movl      %eax, %ebx                                    #1300.24
-        call      __errno_location at PLT                          #1300.24
-                                # LOE eax
-..B13.40:                       # Preds ..B13.7
-..LN1173:
-        movl      20(%ebp), %edx                                #1300.13
-..LN1175:
-        movl      (%eax), %eax                                  #1300.24
-..LN1177:
-        movl      %eax, (%edx)                                  #1300.13
-        jmp       ..B13.11      # Prob 100%                     #1300.13
-                                # LOE
-..B13.8:                        # Preds ..B13.6
-..LN1179:
-        movl      -20(%ebp), %eax                               #1303.13
-        movl      $12, (%eax)                                   #1303.13
-..LN1181:
-        movl      -20(%ebp), %eax                               #1304.13
-        movl      $14, 4(%eax)                                  #1304.13
-..LN1183:
-        movl      -20(%ebp), %eax                               #1305.13
-        movl      $0, 8(%eax)                                   #1305.13
-..LN1185:
-        movl      16(%ebp), %eax                                #1306.13
-..LN1187:
-        movl      -20(%ebp), %edx                               #1306.22
-..LN1189:
-        movl      %edx, (%eax)                                  #1306.13
-..LN1191:
-        addl      $-8, %esp                                     #1308.17
-..LN1193:
-        movl      8(%ebp), %eax                                 #1308.27
-        incl      %eax                                          #1308.27
-        movl      %eax, (%esp)                                  #1308.27
-..LN1195:
-        movl      12(%ebp), %eax                                #1308.34
-        movl      %eax, 4(%esp)                                 #1308.34
-..LN1197:
-        call      nss_sob                                       #1308.17
-                                # LOE eax
-..B13.41:                       # Preds ..B13.8
-        addl      $8, %esp                                      #1308.17
-        movl      %eax, -36(%ebp)                               #1308.17
-                                # LOE
-..B13.9:                        # Preds ..B13.41
-..LN1199:
-        movl      -36(%ebp), %eax                               #1308.13
-        movl      %eax, 8(%ebp)                                 #1308.13
-..LN1201:
-        addl      $-20, %esp                                    #1309.17
-        movl      8(%ebp), %eax                                 #1309.17
-        movl      %eax, (%esp)                                  #1309.17
-        movl      12(%ebp), %eax                                #1309.17
-        movl      %eax, 4(%esp)                                 #1309.17
-        movl      -20(%ebp), %eax                               #1309.17
-        addl      $8, %eax                                      #1309.17
-        movl      %eax, 8(%esp)                                 #1309.17
-        movl      20(%ebp), %eax                                #1309.17
-        movl      %eax, 12(%esp)                                #1309.17
-        movl      24(%ebp), %eax                                #1309.17
-        movl      %eax, 16(%esp)                                #1309.17
-        call      nss_fasta_expr                                #1309.17
-                                # LOE eax
-..B13.42:                       # Preds ..B13.9
-        addl      $20, %esp                                     #1309.17
-        movl      %eax, -32(%ebp)                               #1309.17
-                                # LOE
-..B13.10:                       # Preds ..B13.42
-..LN1203:
-        movl      -32(%ebp), %eax                               #1309.13
-        movl      %eax, 8(%ebp)                                 #1309.13
-                                # LOE
-..B13.11:                       # Preds ..B13.40 ..B13.10
-..LN1205:
-        movl      8(%ebp), %eax                                 #1311.16
-        movl      -4(%ebp), %ebx                                #1311.16
-..___tag_value_nss_primary_expr.231:                            #
-        leave                                                   #1311.16
-..___tag_value_nss_primary_expr.233:                            #
-        ret                                                     #1311.16
-..___tag_value_nss_primary_expr.234:                            #
-                                # LOE
-..B13.12:                       # Preds ..B13.4
-..LN1207:
-        pushl     %edi                                          #1313.13
-..LN1209:
-        movl      $12, (%esp)                                   #1313.22
-..LN1211:
-        movl      -8(%ebp), %eax                                #1313.13
-        movl      %eax, %ebx                                    #1313.13
-        call      malloc at PLT                                    #1313.13
-                                # LOE eax
-..B13.43:                       # Preds ..B13.12
-        popl      %ecx                                          #1313.13
-        movl      %eax, -28(%ebp)                               #1313.13
-                                # LOE
-..B13.13:                       # Preds ..B13.43
-..LN1213:
-        movl      -28(%ebp), %eax                               #1313.9
-        movl      %eax, -20(%ebp)                               #1313.9
-..LN1215:
-        movl      -20(%ebp), %eax                               #1314.14
-..LN1217:
-        testl     %eax, %eax                                    #1314.19
-        jne       ..B13.15      # Prob 50%                      #1314.19
-                                # LOE
-..B13.14:                       # Preds ..B13.13
-..LN1219:
-        movl      -8(%ebp), %eax                                #1315.24
-        movl      %eax, %ebx                                    #1315.24
-        call      __errno_location at PLT                          #1315.24
-                                # LOE eax
-..B13.44:                       # Preds ..B13.14
-..LN1221:
-        movl      20(%ebp), %edx                                #1315.13
-..LN1223:
-        movl      (%eax), %eax                                  #1315.24
-..LN1225:
-        movl      %eax, (%edx)                                  #1315.13
-        jmp       ..B13.24      # Prob 100%                     #1315.13
-                                # LOE
-..B13.15:                       # Preds ..B13.13
-..LN1227:
-        movl      -20(%ebp), %eax                               #1318.13
-        movl      $12, (%eax)                                   #1318.13
-..LN1229:
-        movl      -20(%ebp), %eax                               #1319.13
-        movl      $0, 4(%eax)                                   #1319.13
-..LN1231:
-        movl      16(%ebp), %eax                                #1320.13
-..LN1233:
-        movl      -20(%ebp), %edx                               #1320.22
-..LN1235:
-        movl      %edx, (%eax)                                  #1320.13
-..LN1237:
-        addl      $-20, %esp                                    #1322.17
-..LN1239:
-        movl      8(%ebp), %eax                                 #1322.28
-        incl      %eax                                          #1322.28
-        movl      %eax, (%esp)                                  #1322.28
-..LN1241:
-        movl      12(%ebp), %eax                                #1322.35
-        movl      %eax, 4(%esp)                                 #1322.35
-..LN1243:
-        movl      -20(%ebp), %eax                               #1322.42
-        addl      $8, %eax                                      #1322.42
-        movl      %eax, 8(%esp)                                 #1322.42
-..LN1245:
-        movl      20(%ebp), %eax                                #1322.59
-        movl      %eax, 12(%esp)                                #1322.59
-..LN1247:
-        movl      24(%ebp), %eax                                #1322.67
-        movl      %eax, 16(%esp)                                #1322.67
-..LN1249:
-        call      nss_expr                                      #1322.17
-                                # LOE eax
-..B13.45:                       # Preds ..B13.15
-        addl      $20, %esp                                     #1322.17
-        movl      %eax, -40(%ebp)                               #1322.17
-                                # LOE
-..B13.16:                       # Preds ..B13.45
-..LN1251:
-        movl      -40(%ebp), %eax                               #1322.13
-        movl      %eax, 8(%ebp)                                 #1322.13
-..LN1253:
-        movl      20(%ebp), %eax                                #1323.20
-        movl      (%eax), %eax                                  #1323.20
-..LN1255:
-        testl     %eax, %eax                                    #1323.30
-        jne       ..B13.24      # Prob 50%                      #1323.30
-                                # LOE
-..B13.17:                       # Preds ..B13.16
-..LN1257:
-        movl      -20(%ebp), %eax                               #1325.22
-        movl      8(%eax), %eax                                 #1325.22
-..LN1259:
-        testl     %eax, %eax                                    #1325.41
-        je        ..B13.23      # Prob 50%                      #1325.41
-                                # LOE
-..B13.18:                       # Preds ..B13.17
-..LN1261:
-        movl      8(%ebp), %eax                                 #1325.49
-..LN1263:
-        movl      12(%ebp), %edx                                #1325.54
-        cmpl      %edx, %eax                                    #1325.54
-        je        ..B13.23      # Prob 50%                      #1325.54
-                                # LOE
-..B13.19:                       # Preds ..B13.18
-..LN1265:
-        movl      8(%ebp), %eax                                 #1325.63
-        movzbl    (%eax), %eax                                  #1325.63
-        movsbl    %al, %eax                                     #1325.63
-..LN1267:
-        cmpl      $41, %eax                                     #1325.71
-        jne       ..B13.21      # Prob 50%                      #1325.71
-                                # LOE
-..B13.20:                       # Preds ..B13.19
-        movl      $0, -52(%ebp)                                 #1325.71
-        jmp       ..B13.22      # Prob 100%                     #1325.71
-                                # LOE
-..B13.21:                       # Preds ..B13.19
-        movl      $1, -52(%ebp)                                 #1325.71
-                                # LOE
-..B13.22:                       # Preds ..B13.21 ..B13.20
-..LN1269:
-        movl      -52(%ebp), %eax                               #1325.63
-        incl      8(%ebp)                                       #1325.63
-..LN1271:
-        testl     %eax, %eax                                    #1325.71
-        je        ..B13.24      # Prob 100%                     #1325.71
-                                # LOE
-..B13.23:                       # Preds ..B13.17 ..B13.18 ..B13.22
-..LN1273:
-        movl      20(%ebp), %eax                                #1326.21
-        movl      $22, (%eax)                                   #1326.21
-                                # LOE
-..B13.24:                       # Preds ..B13.44 ..B13.23 ..B13.22 ..B13.16
-..LN1275:
-        movl      8(%ebp), %eax                                 #1329.16
-        movl      -4(%ebp), %ebx                                #1329.16
-..___tag_value_nss_primary_expr.236:                            #
-        leave                                                   #1329.16
-..___tag_value_nss_primary_expr.238:                            #
-        ret                                                     #1329.16
-..___tag_value_nss_primary_expr.239:                            #
-                                # LOE
-..B13.25:                       # Preds ..B13.4
-..LN1277:
-        addl      $-20, %esp                                    #1332.9
-        movl      8(%ebp), %eax                                 #1332.9
-        movl      %eax, (%esp)                                  #1332.9
-        movl      12(%ebp), %eax                                #1332.9
-        movl      %eax, 4(%esp)                                 #1332.9
-        movl      16(%ebp), %eax                                #1332.9
-        movl      %eax, 8(%esp)                                 #1332.9
-        movl      20(%ebp), %eax                                #1332.9
-        movl      %eax, 12(%esp)                                #1332.9
-        movl      24(%ebp), %eax                                #1332.9
-        movl      %eax, 16(%esp)                                #1332.9
-        call      nss_fasta_expr                                #1332.9
-                                # LOE eax
-..B13.46:                       # Preds ..B13.25
-        addl      $20, %esp                                     #1332.9
-        movl      %eax, -24(%ebp)                               #1332.9
-                                # LOE
-..B13.26:                       # Preds ..B13.46
-..LN1279:
-        movl      -24(%ebp), %eax                               #1332.5
-        movl      %eax, 8(%ebp)                                 #1332.5
-..LN1281:
-        movl      20(%ebp), %eax                                #1333.12
-        movl      (%eax), %eax                                  #1333.12
-..LN1283:
-        testl     %eax, %eax                                    #1333.22
-        jne       ..B13.35      # Prob 50%                      #1333.22
-                                # LOE
-..B13.27:                       # Preds ..B13.26
-..LN1285:
-        movl      8(%ebp), %eax                                 #1333.27
-..LN1287:
-        movl      12(%ebp), %edx                                #1333.31
-        cmpl      %edx, %eax                                    #1333.31
-        jae       ..B13.35      # Prob 50%                      #1333.31
-                                # LOE
-..B13.28:                       # Preds ..B13.27
-..LN1289:
-        addl      $-8, %esp                                     #1335.13
-..LN1291:
-        movl      8(%ebp), %eax                                 #1335.23
-        movl      %eax, (%esp)                                  #1335.23
-..LN1293:
-        movl      12(%ebp), %eax                                #1335.26
-        movl      %eax, 4(%esp)                                 #1335.26
-..LN1295:
-        call      nss_sob                                       #1335.13
-                                # LOE eax
-..B13.47:                       # Preds ..B13.28
-        addl      $8, %esp                                      #1335.13
-        movl      %eax, -44(%ebp)                               #1335.13
-                                # LOE
-..B13.29:                       # Preds ..B13.47
-..LN1297:
-        movl      -44(%ebp), %eax                               #1335.9
-        movl      %eax, 8(%ebp)                                 #1335.9
-..LN1299:
-        movl      8(%ebp), %eax                                 #1336.14
-..LN1301:
-        movl      12(%ebp), %edx                                #1336.18
-        cmpl      %edx, %eax                                    #1336.18
-        jae       ..B13.35      # Prob 50%                      #1336.18
-                                # LOE
-..B13.30:                       # Preds ..B13.29
-..LN1303:
-        movl      8(%ebp), %eax                                 #1336.27
-        movzbl    (%eax), %eax                                  #1336.27
-        movsbl    %al, %eax                                     #1336.27
-..LN1305:
-        cmpl      $36, %eax                                     #1336.32
-        jne       ..B13.35      # Prob 50%                      #1336.32
-                                # LOE
-..B13.31:                       # Preds ..B13.30
-..LN1307:
-        incl      8(%ebp)                                       #1338.16
-..LN1309:
-        pushl     %edi                                          #1340.17
-..LN1311:
-        movl      $12, (%esp)                                   #1340.26
-..LN1313:
-        movl      -8(%ebp), %eax                                #1340.17
-        movl      %eax, %ebx                                    #1340.17
-        call      malloc at PLT                                    #1340.17
-                                # LOE eax
-..B13.48:                       # Preds ..B13.31
-        popl      %ecx                                          #1340.17
-        movl      %eax, -48(%ebp)                               #1340.17
-                                # LOE
-..B13.32:                       # Preds ..B13.48
-..LN1315:
-        movl      -48(%ebp), %eax                               #1340.13
-        movl      %eax, -20(%ebp)                               #1340.13
-..LN1317:
-        movl      -20(%ebp), %eax                               #1341.18
-..LN1319:
-        testl     %eax, %eax                                    #1341.23
-        jne       ..B13.34      # Prob 50%                      #1341.23
-                                # LOE
-..B13.33:                       # Preds ..B13.32
-..LN1321:
-        movl      -8(%ebp), %eax                                #1342.28
-        movl      %eax, %ebx                                    #1342.28
-        call      __errno_location at PLT                          #1342.28
-                                # LOE eax
-..B13.49:                       # Preds ..B13.33
-..LN1323:
-        movl      20(%ebp), %edx                                #1342.17
-..LN1325:
-        movl      (%eax), %eax                                  #1342.28
-..LN1327:
-        movl      %eax, (%edx)                                  #1342.17
-        jmp       ..B13.35      # Prob 100%                     #1342.17
-                                # LOE
-..B13.34:                       # Preds ..B13.32
-..LN1329:
-        movl      -20(%ebp), %eax                               #1345.17
-        movl      $12, (%eax)                                   #1345.17
-..LN1331:
-        movl      -20(%ebp), %eax                               #1346.17
-        movl      $15, 4(%eax)                                  #1346.17
-..LN1333:
-        movl      16(%ebp), %eax                                #1347.37
-..LN1335:
-        movl      -20(%ebp), %edx                               #1347.17
-..LN1337:
-        movl      (%eax), %eax                                  #1347.37
-..LN1339:
-        movl      %eax, 8(%edx)                                 #1347.17
-..LN1341:
-        movl      16(%ebp), %eax                                #1348.17
-..LN1343:
-        movl      -20(%ebp), %edx                               #1348.26
-..LN1345:
-        movl      %edx, (%eax)                                  #1348.17
-                                # LOE
-..B13.35:                       # Preds ..B13.49 ..B13.34 ..B13.30 ..B13.29 ..B13.27
-                                #       ..B13.26
-..LN1347:
-        movl      8(%ebp), %eax                                 #1353.12
-        movl      -4(%ebp), %ebx                                #1353.12
-..___tag_value_nss_primary_expr.241:                            #
-        leave                                                   #1353.12
-..___tag_value_nss_primary_expr.243:                            #
-        ret                                                     #1353.12
-        .align    2,0x90
-..___tag_value_nss_primary_expr.244:                            #
-                                # LOE
-# mark_end;
-	.type	nss_primary_expr, at function
-	.size	nss_primary_expr,.-nss_primary_expr
-.LNnss_primary_expr:
-	.data
-# -- End  nss_primary_expr
-	.section .rodata, "a"
-	.align 4
-__$U3:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	117
-	.byte	110
-	.byte	97
-	.byte	114
-	.byte	121
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U3, at object
-	.size	__$U3,15
-	.space 1	# pad
-_2__STRING.4:
-	.byte	42
-	.byte	32
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	116
-	.byte	117
-	.byte	115
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	124
-	.byte	124
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	115
-	.byte	117
-	.byte	98
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.4, at object
-	.size	_2__STRING.4,48
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    2,0x90
-nss_unary_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B14.1:                        # Preds ..B14.0
-..___tag_value_nss_unary_expr.247:                              #
-..LN1349:
-        pushl     %ebp                                          #1361.1
-        movl      %esp, %ebp                                    #1361.1
-..___tag_value_nss_unary_expr.252:                              #
-        subl      $28, %esp                                     #1361.1
-        movl      %ebx, -4(%ebp)                                #1361.1
-..___tag_value_nss_unary_expr.255:                              #
-        call      ..L256        # Prob 100%                     #1361.1
-..L256:                                                         #
-        popl      %eax                                          #1361.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L256], %eax     #1361.1
-        movl      %eax, -8(%ebp)                                #1361.1
-..LN1351:
-        movl      8(%ebp), %eax                                 #1362.5
-        movl      12(%ebp), %edx                                #1362.5
-        cmpl      %edx, %eax                                    #1362.5
-        jb        ..B14.3       # Prob 50%                      #1362.5
-..___tag_value_nss_unary_expr.257:                              #
-                                # LOE
-..B14.2:                        # Preds ..B14.1
-        addl      $-16, %esp                                    #1362.5
-        movl      -8(%ebp), %eax                                #1362.5
-        lea       _2__STRING.3 at GOTOFF(%eax), %eax               #1362.5
-        movl      %eax, (%esp)                                  #1362.5
-        movl      -8(%ebp), %eax                                #1362.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #1362.5
-        movl      %eax, 4(%esp)                                 #1362.5
-        movl      $1362, 8(%esp)                                #1362.5
-        movl      -8(%ebp), %eax                                #1362.5
-        lea       __$U3 at GOTOFF(%eax), %eax                      #1362.5
-        movl      %eax, 12(%esp)                                #1362.5
-        movl      -8(%ebp), %eax                                #1362.5
-        movl      %eax, %ebx                                    #1362.5
-        call      __assert_fail at PLT                             #1362.5
-                                # LOE
-..B14.19:                       # Preds ..B14.2
-        addl      $16, %esp                                     #1362.5
-..___tag_value_nss_unary_expr.258:                              #
-                                # LOE
-..B14.3:                        # Preds ..B14.1
-..LN1353:
-        movl      8(%ebp), %eax                                 #1363.12
-        movzbl    (%eax), %eax                                  #1363.12
-        movsbl    %al, %eax                                     #1363.12
-..LN1355:
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B14.6       # Prob 50%                      #1363.17
-                                # LOE
-..B14.4:                        # Preds ..B14.3
-..LN1357:
-        addl      $-20, %esp                                    #1364.16
-..LN1359:
-        movl      8(%ebp), %eax                                 #1364.35
-        movl      %eax, (%esp)                                  #1364.35
-..LN1361:
-        movl      12(%ebp), %eax                                #1364.38
-        movl      %eax, 4(%esp)                                 #1364.38
-..LN1363:
-        movl      16(%ebp), %eax                                #1364.43
-        movl      %eax, 8(%esp)                                 #1364.43
-..LN1365:
-        movl      20(%ebp), %eax                                #1364.49
-        movl      %eax, 12(%esp)                                #1364.49
-..LN1367:
-        movl      24(%ebp), %eax                                #1364.57
-        movl      %eax, 16(%esp)                                #1364.57
-..LN1369:
-        call      nss_primary_expr                              #1364.16
-                                # LOE eax
-..B14.20:                       # Preds ..B14.4
-        addl      $20, %esp                                     #1364.16
-        movl      %eax, -16(%ebp)                               #1364.16
-                                # LOE
-..B14.5:                        # Preds ..B14.20
-        movl      -16(%ebp), %eax                               #1364.16
-        movl      -4(%ebp), %ebx                                #1364.16
-..___tag_value_nss_unary_expr.259:                              #
-        leave                                                   #1364.16
-..___tag_value_nss_unary_expr.261:                              #
-        ret                                                     #1364.16
-..___tag_value_nss_unary_expr.262:                              #
-                                # LOE
-..B14.6:                        # Preds ..B14.3
-..LN1371:
-        addl      $-8, %esp                                     #1374.9
-..LN1373:
-        movl      8(%ebp), %eax                                 #1374.19
-        incl      %eax                                          #1374.19
-        movl      %eax, (%esp)                                  #1374.19
-..LN1375:
-        movl      12(%ebp), %eax                                #1374.26
-        movl      %eax, 4(%esp)                                 #1374.26
-..LN1377:
-        call      nss_sob                                       #1374.9
-                                # LOE eax
-..B14.21:                       # Preds ..B14.6
-        addl      $8, %esp                                      #1374.9
-        movl      %eax, -12(%ebp)                               #1374.9
-                                # LOE
-..B14.7:                        # Preds ..B14.21
-..LN1379:
-        movl      -12(%ebp), %eax                               #1374.5
-        movl      %eax, 8(%ebp)                                 #1374.5
-..LN1381:
-        movl      8(%ebp), %eax                                 #1375.10
-..LN1383:
-        movl      12(%ebp), %edx                                #1375.15
-        cmpl      %edx, %eax                                    #1375.15
-        jne       ..B14.9       # Prob 50%                      #1375.15
-                                # LOE
-..B14.8:                        # Preds ..B14.7
-..LN1385:
-        movl      20(%ebp), %eax                                #1376.9
-        movl      $22, (%eax)                                   #1376.9
-        jmp       ..B14.16      # Prob 100%                     #1376.9
-                                # LOE
-..B14.9:                        # Preds ..B14.7
-..LN1387:
-        pushl     %edi                                          #1379.25
-..LN1389:
-        movl      $12, (%esp)                                   #1379.34
-..LN1391:
-        movl      -8(%ebp), %eax                                #1379.25
-        movl      %eax, %ebx                                    #1379.25
-        call      malloc at PLT                                    #1379.25
-                                # LOE eax
-..B14.22:                       # Preds ..B14.9
-        popl      %ecx                                          #1379.25
-        movl      %eax, -20(%ebp)                               #1379.25
-                                # LOE
-..B14.10:                       # Preds ..B14.22
-..LN1393:
-        movl      -20(%ebp), %eax                               #1379.23
-        movl      %eax, -24(%ebp)                               #1379.23
-..LN1395:
-        movl      -24(%ebp), %eax                               #1380.14
-..LN1397:
-        testl     %eax, %eax                                    #1380.19
-        jne       ..B14.12      # Prob 50%                      #1380.19
-                                # LOE
-..B14.11:                       # Preds ..B14.10
-..LN1399:
-        movl      -8(%ebp), %eax                                #1381.24
-        movl      %eax, %ebx                                    #1381.24
-        call      __errno_location at PLT                          #1381.24
-                                # LOE eax
-..B14.23:                       # Preds ..B14.11
-..LN1401:
-        movl      20(%ebp), %edx                                #1381.13
-..LN1403:
-        movl      (%eax), %eax                                  #1381.24
-..LN1405:
-        movl      %eax, (%edx)                                  #1381.13
-        jmp       ..B14.16      # Prob 100%                     #1381.13
-                                # LOE
-..B14.12:                       # Preds ..B14.10
-..LN1407:
-        movl      -24(%ebp), %eax                               #1384.13
-        movl      $12, (%eax)                                   #1384.13
-..LN1409:
-        movl      -24(%ebp), %eax                               #1385.13
-        movl      $13, 4(%eax)                                  #1385.13
-..LN1411:
-        movl      -24(%ebp), %eax                               #1386.13
-        movl      $0, 8(%eax)                                   #1386.13
-..LN1413:
-        movl      16(%ebp), %eax                                #1387.13
-..LN1415:
-        movl      -24(%ebp), %edx                               #1387.22
-..LN1417:
-        movl      %edx, (%eax)                                  #1387.13
-..LN1419:
-        addl      $-20, %esp                                    #1389.17
-..LN1421:
-        movl      8(%ebp), %eax                                 #1389.34
-        movl      %eax, (%esp)                                  #1389.34
-..LN1423:
-        movl      12(%ebp), %eax                                #1389.37
-        movl      %eax, 4(%esp)                                 #1389.37
-..LN1425:
-        movl      -24(%ebp), %eax                               #1389.44
-        addl      $8, %eax                                      #1389.44
-        movl      %eax, 8(%esp)                                 #1389.44
-..LN1427:
-        movl      20(%ebp), %eax                                #1389.61
-        movl      %eax, 12(%esp)                                #1389.61
-..LN1429:
-        movl      24(%ebp), %eax                                #1389.69
-        movl      %eax, 16(%esp)                                #1389.69
-..LN1431:
-        call      nss_unary_expr                                #1389.17
-                                # LOE eax
-..B14.24:                       # Preds ..B14.12
-        addl      $20, %esp                                     #1389.17
-        movl      %eax, -28(%ebp)                               #1389.17
-                                # LOE
-..B14.13:                       # Preds ..B14.24
-..LN1433:
-        movl      -28(%ebp), %eax                               #1389.13
-        movl      %eax, 8(%ebp)                                 #1389.13
-..LN1435:
-        movl      20(%ebp), %eax                                #1390.13
-        movl      (%eax), %eax                                  #1390.13
-        testl     %eax, %eax                                    #1390.13
-        jne       ..B14.16      # Prob 50%                      #1390.13
-                                # LOE
-..B14.14:                       # Preds ..B14.13
-        movl      -24(%ebp), %eax                               #1390.13
-        movl      8(%eax), %eax                                 #1390.13
-        testl     %eax, %eax                                    #1390.13
-        jne       ..B14.16      # Prob 50%                      #1390.13
-..___tag_value_nss_unary_expr.264:                              #
-                                # LOE
-..B14.15:                       # Preds ..B14.14
-        addl      $-16, %esp                                    #1390.13
-        movl      -8(%ebp), %eax                                #1390.13
-        lea       _2__STRING.4 at GOTOFF(%eax), %eax               #1390.13
-        movl      %eax, (%esp)                                  #1390.13
-        movl      -8(%ebp), %eax                                #1390.13
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #1390.13
-        movl      %eax, 4(%esp)                                 #1390.13
-        movl      $1390, 8(%esp)                                #1390.13
-        movl      -8(%ebp), %eax                                #1390.13
-        lea       __$U3 at GOTOFF(%eax), %eax                      #1390.13
-        movl      %eax, 12(%esp)                                #1390.13
-        movl      -8(%ebp), %eax                                #1390.13
-        movl      %eax, %ebx                                    #1390.13
-        call      __assert_fail at PLT                             #1390.13
-                                # LOE
-..B14.25:                       # Preds ..B14.15
-        addl      $16, %esp                                     #1390.13
-..___tag_value_nss_unary_expr.265:                              #
-                                # LOE
-..B14.16:                       # Preds ..B14.23 ..B14.8 ..B14.14 ..B14.13
-..LN1437:
-        movl      8(%ebp), %eax                                 #1393.12
-        movl      -4(%ebp), %ebx                                #1393.12
-..___tag_value_nss_unary_expr.266:                              #
-        leave                                                   #1393.12
-..___tag_value_nss_unary_expr.268:                              #
-        ret                                                     #1393.12
-        .align    2,0x90
-..___tag_value_nss_unary_expr.269:                              #
-                                # LOE
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-.LNnss_unary_expr:
-	.data
-# -- End  nss_unary_expr
-	.section .rodata, "a"
-	.align 4
-__$U4:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U4, at object
-	.size	__$U4,9
-	.space 3	# pad
-_2__STRING.5:
-	.byte	42
-	.byte	32
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.5, at object
-	.size	_2__STRING.5,22
-	.space 2	# pad
-_2__STRING.6:
-	.byte	42
-	.byte	32
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	116
-	.byte	117
-	.byte	115
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	124
-	.byte	124
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	98
-	.byte	111
-	.byte	111
-	.byte	108
-	.byte	101
-	.byte	97
-	.byte	110
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	114
-	.byte	105
-	.byte	103
-	.byte	104
-	.byte	116
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.6, at object
-	.size	_2__STRING.6,53
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    2,0x90
-nss_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B15.1:                        # Preds ..B15.0
-..___tag_value_nss_expr.272:                                    #
-..LN1439:
-        pushl     %ebp                                          #1406.1
-        movl      %esp, %ebp                                    #1406.1
-..___tag_value_nss_expr.277:                                    #
-        subl      $48, %esp                                     #1406.1
-        movl      %ebx, -4(%ebp)                                #1406.1
-..___tag_value_nss_expr.280:                                    #
-..LN1441:
-        movl      16(%ebp), %eax                                #1407.5
-        movl      $0, (%eax)                                    #1407.5
-..LN1443:
-        addl      $0, %esp                                      #1409.9
-..LN1445:
-        movl      8(%ebp), %eax                                 #1409.19
-        movl      %eax, (%esp)                                  #1409.19
-..LN1447:
-        movl      12(%ebp), %eax                                #1409.22
-        movl      %eax, 4(%esp)                                 #1409.22
-..LN1449:
-        call      nss_sob                                       #1409.9
-                                # LOE eax
-..B15.32:                       # Preds ..B15.1
-        addl      $8, %esp                                      #1409.9
-        movl      %eax, -8(%ebp)                                #1409.9
-                                # LOE
-..B15.2:                        # Preds ..B15.32
-..LN1451:
-        movl      -8(%ebp), %eax                                #1409.5
-        movl      %eax, 8(%ebp)                                 #1409.5
-..LN1453:
-        movl      8(%ebp), %eax                                 #1410.10
-..LN1455:
-        movl      12(%ebp), %edx                                #1410.15
-        cmpl      %edx, %eax                                    #1410.15
-        je        ..B15.29      # Prob 50%                      #1410.15
-                                # LOE
-..B15.3:                        # Preds ..B15.2
-..LN1457:
-        addl      $-20, %esp                                    #1412.13
-..LN1459:
-        movl      8(%ebp), %eax                                 #1412.30
-        movl      %eax, (%esp)                                  #1412.30
-..LN1461:
-        movl      12(%ebp), %eax                                #1412.33
-        movl      %eax, 4(%esp)                                 #1412.33
-..LN1463:
-        movl      16(%ebp), %eax                                #1412.38
-        movl      %eax, 8(%esp)                                 #1412.38
-..LN1465:
-        movl      20(%ebp), %eax                                #1412.44
-        movl      %eax, 12(%esp)                                #1412.44
-..LN1467:
-        movl      24(%ebp), %eax                                #1412.52
-        movl      %eax, 16(%esp)                                #1412.52
-..LN1469:
-        call      nss_unary_expr                                #1412.13
-                                # LOE eax
-..B15.33:                       # Preds ..B15.3
-        addl      $20, %esp                                     #1412.13
-        movl      %eax, -12(%ebp)                               #1412.13
-                                # LOE
-..B15.4:                        # Preds ..B15.33
-..LN1471:
-        movl      -12(%ebp), %eax                               #1412.9
-        movl      %eax, 8(%ebp)                                 #1412.9
-..LN1473:
-        movl      20(%ebp), %eax                                #1413.16
-        movl      (%eax), %eax                                  #1413.16
-..LN1475:
-        testl     %eax, %eax                                    #1413.26
-        jne       ..B15.29      # Prob 50%                      #1413.26
-                                # LOE
-..B15.5:                        # Preds ..B15.4
-..LN1477:
-        addl      $-8, %esp                                     #1415.17
-..LN1479:
-        movl      8(%ebp), %eax                                 #1415.27
-        movl      %eax, (%esp)                                  #1415.27
-..LN1481:
-        movl      12(%ebp), %eax                                #1415.30
-        movl      %eax, 4(%esp)                                 #1415.30
-..LN1483:
-        call      nss_sob                                       #1415.17
-                                # LOE eax
-..B15.34:                       # Preds ..B15.5
-        addl      $8, %esp                                      #1415.17
-        movl      %eax, -16(%ebp)                               #1415.17
-                                # LOE
-..B15.6:                        # Preds ..B15.34
-..LN1485:
-        movl      -16(%ebp), %eax                               #1415.13
-        movl      %eax, 8(%ebp)                                 #1415.13
-..LN1487:
-        movl      8(%ebp), %eax                                 #1416.18
-..LN1489:
-        movl      12(%ebp), %edx                                #1416.23
-        cmpl      %edx, %eax                                    #1416.23
-        je        ..B15.29      # Prob 50%                      #1416.23
-                                # LOE
-..B15.7:                        # Preds ..B15.6
-        call      ..L281        # Prob 100%                     #
-..L281:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L281], %eax     #
-        movl      %eax, -20(%ebp)                               #
-..LN1491:
-        movl      16(%ebp), %eax                                #1420.17
-        movl      (%eax), %eax                                  #1420.17
-        testl     %eax, %eax                                    #1420.17
-        jne       ..B15.9       # Prob 50%                      #1420.17
-..___tag_value_nss_expr.282:                                    #
-                                # LOE
-..B15.8:                        # Preds ..B15.7
-        addl      $-16, %esp                                    #1420.17
-        movl      -20(%ebp), %eax                               #1420.17
-        lea       _2__STRING.5 at GOTOFF(%eax), %eax               #1420.17
-        movl      %eax, (%esp)                                  #1420.17
-        movl      -20(%ebp), %eax                               #1420.17
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #1420.17
-        movl      %eax, 4(%esp)                                 #1420.17
-        movl      $1420, 8(%esp)                                #1420.17
-        movl      -20(%ebp), %eax                               #1420.17
-        lea       __$U4 at GOTOFF(%eax), %eax                      #1420.17
-        movl      %eax, 12(%esp)                                #1420.17
-        movl      -20(%ebp), %eax                               #1420.17
-        movl      %eax, %ebx                                    #1420.17
-        call      __assert_fail at PLT                             #1420.17
-                                # LOE
-..B15.35:                       # Preds ..B15.8
-        addl      $16, %esp                                     #1420.17
-..___tag_value_nss_expr.283:                                    #
-                                # LOE
-..B15.9:                        # Preds ..B15.7
-..LN1493:
-        movl      8(%ebp), %eax                                 #1422.28
-        movzbl    (%eax), %eax                                  #1422.28
-        movsbl    %al, %eax                                     #1422.28
-        movl      %eax, -24(%ebp)                               #1422.28
-        incl      8(%ebp)                                       #1422.28
-        cmpl      $41, %eax                                     #1422.28
-        je        ..B15.12      # Prob 50%                      #1422.28
-                                # LOE
-..B15.10:                       # Preds ..B15.9
-        movl      -24(%ebp), %eax                               #1422.28
-        cmpl      $38, %eax                                     #1422.28
-        je        ..B15.13      # Prob 50%                      #1422.28
-                                # LOE
-..B15.11:                       # Preds ..B15.10
-        movl      -24(%ebp), %eax                               #1422.28
-        cmpl      $124, %eax                                    #1422.28
-        je        ..B15.17      # Prob 50%                      #1422.28
-        jmp       ..B15.21      # Prob 100%                     #1422.28
-                                # LOE
-..B15.12:                       # Preds ..B15.9
-..LN1495:
-        movl      8(%ebp), %eax                                 #1425.28
-..LN1497:
-        decl      %eax                                          #1425.32
-        movl      -4(%ebp), %ebx                                #1425.32
-..___tag_value_nss_expr.284:                                    #
-        leave                                                   #1425.32
-..___tag_value_nss_expr.286:                                    #
-        ret                                                     #1425.32
-..___tag_value_nss_expr.287:                                    #
-                                # LOE
-..B15.13:                       # Preds ..B15.10
-..LN1499:
-        movl      8(%ebp), %eax                                 #1427.26
-..LN1501:
-        movl      12(%ebp), %edx                                #1427.30
-        cmpl      %edx, %eax                                    #1427.30
-        jae       ..B15.16      # Prob 50%                      #1427.30
-                                # LOE
-..B15.14:                       # Preds ..B15.13
-..LN1503:
-        movl      8(%ebp), %eax                                 #1427.39
-        movzbl    (%eax), %eax                                  #1427.39
-        movsbl    %al, %eax                                     #1427.39
-..LN1505:
-        cmpl      $38, %eax                                     #1427.44
-        jne       ..B15.16      # Prob 50%                      #1427.44
-                                # LOE
-..B15.15:                       # Preds ..B15.14
-..LN1507:
-        incl      8(%ebp)                                       #1428.28
-                                # LOE
-..B15.16:                       # Preds ..B15.15 ..B15.14 ..B15.13
-..LN1509:
-        movl      $16, -36(%ebp)                                #1429.21
-        jmp       ..B15.22      # Prob 100%                     #1429.21
-                                # LOE
-..B15.17:                       # Preds ..B15.11
-..LN1511:
-        movl      8(%ebp), %eax                                 #1432.26
-..LN1513:
-        movl      12(%ebp), %edx                                #1432.30
-        cmpl      %edx, %eax                                    #1432.30
-        jae       ..B15.20      # Prob 50%                      #1432.30
-                                # LOE
-..B15.18:                       # Preds ..B15.17
-..LN1515:
-        movl      8(%ebp), %eax                                 #1432.39
-        movzbl    (%eax), %eax                                  #1432.39
-        movsbl    %al, %eax                                     #1432.39
-..LN1517:
-        cmpl      $124, %eax                                    #1432.44
-        jne       ..B15.20      # Prob 50%                      #1432.44
-                                # LOE
-..B15.19:                       # Preds ..B15.18
-..LN1519:
-        incl      8(%ebp)                                       #1433.28
-                                # LOE
-..B15.20:                       # Preds ..B15.19 ..B15.18 ..B15.17
-..LN1521:
-        movl      $17, -36(%ebp)                                #1434.21
-        jmp       ..B15.22      # Prob 100%                     #1434.21
-                                # LOE
-..B15.21:                       # Preds ..B15.11
-..LN1523:
-        movl      20(%ebp), %eax                                #1438.21
-        movl      $22, (%eax)                                   #1438.21
-..LN1525:
-        movl      8(%ebp), %eax                                 #1439.28
-..LN1527:
-        decl      %eax                                          #1439.32
-        movl      -4(%ebp), %ebx                                #1439.32
-..___tag_value_nss_expr.289:                                    #
-        leave                                                   #1439.32
-..___tag_value_nss_expr.291:                                    #
-        ret                                                     #1439.32
-..___tag_value_nss_expr.292:                                    #
-                                # LOE
-..B15.22:                       # Preds ..B15.16 ..B15.20
-..LN1529:
-        pushl     %edi                                          #1451.21
-..LN1531:
-        movl      $16, (%esp)                                   #1451.30
-..LN1533:
-        movl      -20(%ebp), %eax                               #1451.21
-        movl      %eax, %ebx                                    #1451.21
-        call      malloc at PLT                                    #1451.21
-                                # LOE eax
-..B15.36:                       # Preds ..B15.22
-        popl      %ecx                                          #1451.21
-        movl      %eax, -28(%ebp)                               #1451.21
-                                # LOE
-..B15.23:                       # Preds ..B15.36
-..LN1535:
-        movl      -28(%ebp), %eax                               #1451.17
-        movl      %eax, -32(%ebp)                               #1451.17
-..LN1537:
-        movl      -32(%ebp), %eax                               #1452.22
-..LN1539:
-        testl     %eax, %eax                                    #1452.27
-        jne       ..B15.25      # Prob 50%                      #1452.27
-                                # LOE
-..B15.24:                       # Preds ..B15.23
-..LN1541:
-        movl      -20(%ebp), %eax                               #1454.32
-        movl      %eax, %ebx                                    #1454.32
-        call      __errno_location at PLT                          #1454.32
-                                # LOE eax
-..B15.37:                       # Preds ..B15.24
-..LN1543:
-        movl      20(%ebp), %edx                                #1454.21
-..LN1545:
-        movl      (%eax), %eax                                  #1454.32
-..LN1547:
-        movl      %eax, (%edx)                                  #1454.21
-..LN1549:
-        movl      8(%ebp), %eax                                 #1455.28
-        movl      -4(%ebp), %ebx                                #1455.28
-..___tag_value_nss_expr.294:                                    #
-        leave                                                   #1455.28
-..___tag_value_nss_expr.296:                                    #
-        ret                                                     #1455.28
-..___tag_value_nss_expr.297:                                    #
-                                # LOE
-..B15.25:                       # Preds ..B15.23
-..LN1551:
-        movl      -32(%ebp), %eax                               #1458.17
-        movl      $11, (%eax)                                   #1458.17
-..LN1553:
-        movl      -32(%ebp), %eax                               #1459.17
-..LN1555:
-        movl      -36(%ebp), %edx                               #1459.37
-..LN1557:
-        movl      %edx, 4(%eax)                                 #1459.17
-..LN1559:
-        movl      16(%ebp), %eax                                #1460.41
-..LN1561:
-        movl      -32(%ebp), %edx                               #1460.17
-..LN1563:
-        movl      (%eax), %eax                                  #1460.41
-..LN1565:
-        movl      %eax, 8(%edx)                                 #1460.17
-..LN1567:
-        movl      16(%ebp), %eax                                #1461.17
-..LN1569:
-        movl      -32(%ebp), %edx                               #1461.26
-..LN1571:
-        movl      %edx, (%eax)                                  #1461.17
-..LN1573:
-        addl      $-20, %esp                                    #1464.21
-..LN1575:
-        movl      8(%ebp), %eax                                 #1464.32
-        movl      %eax, (%esp)                                  #1464.32
-..LN1577:
-        movl      12(%ebp), %eax                                #1464.35
-        movl      %eax, 4(%esp)                                 #1464.35
-..LN1579:
-        movl      -32(%ebp), %eax                               #1464.42
-        addl      $12, %eax                                     #1464.42
-        movl      %eax, 8(%esp)                                 #1464.42
-..LN1581:
-        movl      20(%ebp), %eax                                #1464.64
-        movl      %eax, 12(%esp)                                #1464.64
-..LN1583:
-        movl      24(%ebp), %eax                                #1464.72
-        movl      %eax, 16(%esp)                                #1464.72
-..LN1585:
-        call      nss_expr                                      #1464.21
-                                # LOE eax
-..B15.38:                       # Preds ..B15.25
-        addl      $20, %esp                                     #1464.21
-        movl      %eax, -40(%ebp)                               #1464.21
-                                # LOE
-..B15.26:                       # Preds ..B15.38
-..LN1587:
-        movl      -40(%ebp), %eax                               #1464.17
-        movl      %eax, 8(%ebp)                                 #1464.17
-..LN1589:
-        movl      20(%ebp), %eax                                #1465.17
-        movl      (%eax), %eax                                  #1465.17
-        testl     %eax, %eax                                    #1465.17
-        jne       ..B15.29      # Prob 50%                      #1465.17
-                                # LOE
-..B15.27:                       # Preds ..B15.26
-        movl      -32(%ebp), %eax                               #1465.17
-        movl      12(%eax), %eax                                #1465.17
-        testl     %eax, %eax                                    #1465.17
-        jne       ..B15.29      # Prob 50%                      #1465.17
-..___tag_value_nss_expr.299:                                    #
-                                # LOE
-..B15.28:                       # Preds ..B15.27
-        addl      $-16, %esp                                    #1465.17
-        movl      -20(%ebp), %eax                               #1465.17
-        lea       _2__STRING.6 at GOTOFF(%eax), %eax               #1465.17
-        movl      %eax, (%esp)                                  #1465.17
-        movl      -20(%ebp), %eax                               #1465.17
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #1465.17
-        movl      %eax, 4(%esp)                                 #1465.17
-        movl      $1465, 8(%esp)                                #1465.17
-        movl      -20(%ebp), %eax                               #1465.17
-        lea       __$U4 at GOTOFF(%eax), %eax                      #1465.17
-        movl      %eax, 12(%esp)                                #1465.17
-        movl      -20(%ebp), %eax                               #1465.17
-        movl      %eax, %ebx                                    #1465.17
-        call      __assert_fail at PLT                             #1465.17
-                                # LOE
-..B15.39:                       # Preds ..B15.28
-        addl      $16, %esp                                     #1465.17
-..___tag_value_nss_expr.300:                                    #
-                                # LOE
-..B15.29:                       # Preds ..B15.27 ..B15.26 ..B15.6 ..B15.4 ..B15.2
-                                #      
-..LN1591:
-        movl      8(%ebp), %eax                                 #1470.12
-        movl      -4(%ebp), %ebx                                #1470.12
-..___tag_value_nss_expr.301:                                    #
-        leave                                                   #1470.12
-..___tag_value_nss_expr.303:                                    #
-        ret                                                     #1470.12
-        .align    2,0x90
-..___tag_value_nss_expr.304:                                    #
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-.LNnss_expr:
-	.data
-# -- End  nss_expr
-	.section .rodata, "a"
-	.align 4
-_2__STRING.7:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.7, at object
-	.size	_2__STRING.7,5
-	.space 3	# pad
-_2__STRING.8:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.8, at object
-	.size	_2__STRING.8,17
-	.text
-# -- Begin  NucStrstrInit
-# mark_begin;
-       .align    2,0x90
-NucStrstrInit:
-..B16.1:                        # Preds ..B16.0
-..___tag_value_NucStrstrInit.307:                               #
-..LN1593:
-        pushl     %ebp                                          #1484.1
-        movl      %esp, %ebp                                    #1484.1
-..___tag_value_NucStrstrInit.312:                               #
-        subl      $64, %esp                                     #1484.1
-        movl      %ebx, -12(%ebp)                               #1484.1
-..___tag_value_NucStrstrInit.315:                               #
-        call      ..L316        # Prob 100%                     #1484.1
-..L316:                                                         #
-        popl      %eax                                          #1484.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L316], %eax     #1484.1
-        movl      %eax, -32(%ebp)                               #1484.1
-..LN1595:
-        lea       _2__STRING.7 at GOTOFF(%eax), %edx               #1487.29
-        movl      %edx, -52(%ebp)                               #1487.29
-..LN1597:
-        lea       _2__STRING.8 at GOTOFF(%eax), %edx               #1488.25
-        movl      %edx, -48(%ebp)                               #1488.25
-..LN1599:
-        addl      $0, %esp                                      #1491.5
-..LN1601:
-        lea       fasta_2na_map at GOTOFF(%eax), %edx              #1491.14
-        movl      %edx, (%esp)                                  #1491.14
-..LN1603:
-        movl      $-1, 4(%esp)                                  #1491.29
-..LN1605:
-        movl      $128, 8(%esp)                                 #1491.33
-..LN1607:
-        movl      %eax, %ebx                                    #1491.5
-        call      memset at PLT                                    #1491.5
-                                # LOE
-..B16.20:                       # Preds ..B16.1
-        addl      $12, %esp                                     #1491.5
-                                # LOE
-..B16.2:                        # Preds ..B16.20
-..LN1609:
-        addl      $-12, %esp                                    #1492.5
-..LN1611:
-        movl      -32(%ebp), %eax                               #1492.14
-        lea       fasta_4na_map at GOTOFF(%eax), %eax              #1492.14
-        movl      %eax, (%esp)                                  #1492.14
-..LN1613:
-        movl      $-1, 4(%esp)                                  #1492.29
-..LN1615:
-        movl      $128, 8(%esp)                                 #1492.33
-..LN1617:
-        movl      -32(%ebp), %eax                               #1492.5
-        movl      %eax, %ebx                                    #1492.5
-        call      memset at PLT                                    #1492.5
-                                # LOE
-..B16.21:                       # Preds ..B16.2
-        addl      $12, %esp                                     #1492.5
-                                # LOE
-..B16.3:                        # Preds ..B16.21
-..LN1619:
-        movl      $0, -44(%ebp)                                 #1495.11
-..LN1621:
-        movl      -52(%ebp), %eax                               #1495.22
-..LN1623:
-        movl      %eax, -40(%ebp)                               #1495.18
-..LN1625:
-        movl      -40(%ebp), %eax                               #1495.31
-        movzbl    (%eax), %eax                                  #1495.31
-        movsbl    %al, %eax                                     #1495.31
-..LN1627:
-        testl     %eax, %eax                                    #1495.42
-        je        ..B16.7       # Prob 50%                      #1495.42
-                                # LOE
-..B16.5:                        # Preds ..B16.3 ..B16.6
-..LN1629:
-        movl      -40(%ebp), %eax                               #1497.14
-        movzbl    (%eax), %eax                                  #1497.14
-        movsbl    %al, %eax                                     #1497.14
-..LN1631:
-        movl      %eax, -36(%ebp)                               #1497.9
-..LN1633:
-        movl      -44(%ebp), %eax                               #1498.78
-        movsbl    %al, %eax                                     #1498.78
-        movl      %eax, -28(%ebp)                               #1498.78
-..LN1635:
-        pushl     %edi                                          #1498.48
-..LN1637:
-        movl      -36(%ebp), %eax                               #1498.58
-        movl      %eax, (%esp)                                  #1498.58
-..LN1639:
-        movl      -32(%ebp), %eax                               #1498.48
-        movl      %eax, %ebx                                    #1498.48
-        call      tolower at PLT                                   #1498.48
-                                # LOE eax
-..B16.22:                       # Preds ..B16.5
-        popl      %ecx                                          #1498.48
-        movl      %eax, -24(%ebp)                               #1498.48
-                                # LOE
-..B16.6:                        # Preds ..B16.22
-..LN1641:
-        movl      -32(%ebp), %eax                               #1498.32
-        movl      -28(%ebp), %edx                               #1498.32
-        movl      -24(%ebp), %ecx                               #1498.32
-        movb      %dl, fasta_2na_map at GOTOFF(%ecx,%eax)          #1498.32
-..LN1643:
-        movl      -36(%ebp), %eax                               #1498.25
-..LN1645:
-        movl      -32(%ebp), %edx                               #1498.9
-        movl      -28(%ebp), %ecx                               #1498.9
-        movb      %cl, fasta_2na_map at GOTOFF(%eax,%edx)          #1498.9
-..LN1647:
-        incl      -44(%ebp)                                     #1495.48
-..LN1649:
-        incl      -40(%ebp)                                     #1495.54
-..LN1651:
-        movl      -40(%ebp), %eax                               #1495.31
-        movzbl    (%eax), %eax                                  #1495.31
-        movsbl    %al, %eax                                     #1495.31
-..LN1653:
-        testl     %eax, %eax                                    #1495.42
-        jne       ..B16.5       # Prob 50%                      #1495.42
-                                # LOE
-..B16.7:                        # Preds ..B16.6 ..B16.3
-..LN1655:
-        movl      $0, -44(%ebp)                                 #1502.11
-..LN1657:
-        movl      -48(%ebp), %eax                               #1502.22
-..LN1659:
-        movl      %eax, -40(%ebp)                               #1502.18
-..LN1661:
-        movl      -40(%ebp), %eax                               #1502.31
-        movzbl    (%eax), %eax                                  #1502.31
-        movsbl    %al, %eax                                     #1502.31
-..LN1663:
-        testl     %eax, %eax                                    #1502.42
-        je        ..B16.11      # Prob 50%                      #1502.42
-                                # LOE
-..B16.9:                        # Preds ..B16.7 ..B16.10
-..LN1665:
-        movl      -40(%ebp), %eax                               #1504.14
-        movzbl    (%eax), %eax                                  #1504.14
-        movsbl    %al, %eax                                     #1504.14
-..LN1667:
-        movl      %eax, -36(%ebp)                               #1504.9
-..LN1669:
-        movl      -44(%ebp), %eax                               #1505.78
-        movsbl    %al, %eax                                     #1505.78
-        movl      %eax, -20(%ebp)                               #1505.78
-..LN1671:
-        pushl     %edi                                          #1505.48
-..LN1673:
-        movl      -36(%ebp), %eax                               #1505.58
-        movl      %eax, (%esp)                                  #1505.58
-..LN1675:
-        movl      -32(%ebp), %eax                               #1505.48
-        movl      %eax, %ebx                                    #1505.48
-        call      tolower at PLT                                   #1505.48
-                                # LOE eax
-..B16.23:                       # Preds ..B16.9
-        popl      %ecx                                          #1505.48
-        movl      %eax, -16(%ebp)                               #1505.48
-                                # LOE
-..B16.10:                       # Preds ..B16.23
-..LN1677:
-        movl      -32(%ebp), %eax                               #1505.32
-        movl      -20(%ebp), %edx                               #1505.32
-        movl      -16(%ebp), %ecx                               #1505.32
-        movb      %dl, fasta_4na_map at GOTOFF(%ecx,%eax)          #1505.32
-..LN1679:
-        movl      -36(%ebp), %eax                               #1505.25
-..LN1681:
-        movl      -32(%ebp), %edx                               #1505.9
-        movl      -20(%ebp), %ecx                               #1505.9
-        movb      %cl, fasta_4na_map at GOTOFF(%eax,%edx)          #1505.9
-..LN1683:
-        incl      -44(%ebp)                                     #1502.48
-..LN1685:
-        incl      -40(%ebp)                                     #1502.54
-..LN1687:
-        movl      -40(%ebp), %eax                               #1502.31
-        movzbl    (%eax), %eax                                  #1502.31
-        movsbl    %al, %eax                                     #1502.31
-..LN1689:
-        testl     %eax, %eax                                    #1502.42
-        jne       ..B16.9       # Prob 50%                      #1502.42
-                                # LOE
-..B16.11:                       # Preds ..B16.10 ..B16.7
-..LN1691:
-        movl      $0, -44(%ebp)                                 #1510.11
-..LN1693:
-        movl      -44(%ebp), %eax                               #1510.18
-..LN1695:
-        cmpl      $256, %eax                                    #1510.22
-        jae       ..B16.17      # Prob 50%                      #1510.22
-                                # LOE
-..B16.13:                       # Preds ..B16.11 ..B16.16
-..LN1697:
-        movl      -44(%ebp), %eax                               #1511.28
-        movl      -32(%ebp), %edx                               #1511.28
-        movzwl    expand_2na at GOTOFF(%edx,%eax,2), %eax          #1511.28
-        movw      %ax, -8(%ebp)                                 #1511.28
-        xorl      %eax, %eax                                    #1511.28
-        testl     %eax, %eax                                    #1511.28
-        jne       ..B16.15      # Prob 50%                      #1511.28
-                                # LOE
-..B16.14:                       # Preds ..B16.13
-..LN1699:
-        movzwl    -8(%ebp), %eax                                #1511.0
-# Begin ASM
-        rorw $8, %ax
-# End ASM                                                       #1511.0
-        movw      %ax, -4(%ebp)                                 #1511.0
-        jmp       ..B16.16      # Prob 100%                     #1511.0
-                                # LOE
-..B16.15:                       # Preds ..B16.13
-..LN1701:
-        movzwl    -8(%ebp), %eax                                #1511.28
-        shrl      $8, %eax                                      #1511.28
-        movzbl    %al, %eax                                     #1511.28
-        movzwl    -8(%ebp), %edx                                #1511.28
-        movzbl    %dl, %edx                                     #1511.28
-        shll      $8, %edx                                      #1511.28
-        orl       %edx, %eax                                    #1511.28
-        movw      %ax, -4(%ebp)                                 #1511.28
-                                # LOE
-..B16.16:                       # Preds ..B16.15 ..B16.14
-..LN1703:
-        movl      -44(%ebp), %eax                               #1511.22
-..LN1705:
-        movzwl    -4(%ebp), %edx                                #1511.28
-..LN1707:
-        movl      -32(%ebp), %ecx                               #1511.9
-        movw      %dx, expand_2na at GOTOFF(%ecx,%eax,2)           #1511.9
-..LN1709:
-        incl      -44(%ebp)                                     #1510.30
-..LN1711:
-        movl      -44(%ebp), %eax                               #1510.18
-..LN1713:
-        cmpl      $256, %eax                                    #1510.22
-        jb        ..B16.13      # Prob 50%                      #1510.22
-                                # LOE
-..B16.17:                       # Preds ..B16.16 ..B16.11
-..LN1715:
-        movl      -12(%ebp), %ebx                               #1513.1
-..___tag_value_NucStrstrInit.317:                               #
-        leave                                                   #1513.1
-..___tag_value_NucStrstrInit.319:                               #
-        ret                                                     #1513.1
-        .align    2,0x90
-..___tag_value_NucStrstrInit.320:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrInit, at function
-	.size	NucStrstrInit,.-NucStrstrInit
-.LNNucStrstrInit:
-	.data
-# -- End  NucStrstrInit
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1(nss): 8 + %ebp
-# parameter 2(positional): 12 + %ebp
-# parameter 3(query): 16 + %ebp
-# parameter 4(len): 20 + %ebp
-..B17.1:                        # Preds ..B17.0
-..___tag_value_NucStrstrMake.323:                               #
-..LN1717:
-        pushl     %ebp                                          #1539.1
-        movl      %esp, %ebp                                    #1539.1
-..___tag_value_NucStrstrMake.328:                               #
-        subl      $20, %esp                                     #1539.1
-        movl      %ebx, -4(%ebp)                                #1539.1
-..___tag_value_NucStrstrMake.331:                               #
-..LN1719:
-        movl      8(%ebp), %eax                                 #1540.10
-..LN1721:
-        testl     %eax, %eax                                    #1540.17
-        je        ..B17.14      # Prob 50%                      #1540.17
-                                # LOE
-..B17.2:                        # Preds ..B17.1
-..LN1723:
-        movl      16(%ebp), %eax                                #1542.14
-..LN1725:
-        testl     %eax, %eax                                    #1542.23
-        je        ..B17.13      # Prob 50%                      #1542.23
-                                # LOE
-..B17.3:                        # Preds ..B17.2
-..LN1727:
-        movl      20(%ebp), %eax                                #1542.31
-..LN1729:
-        testl     %eax, %eax                                    #1542.38
-        je        ..B17.13      # Prob 50%                      #1542.38
-                                # LOE
-..B17.4:                        # Preds ..B17.3
-        call      ..L332        # Prob 100%                     #
-..L332:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L332], %eax     #
-        movl      %eax, -12(%ebp)                               #
-..LN1731:
-        movl      $0, -20(%ebp)                                 #1544.24
-..LN1733:
-        movzbl    fasta_2na_map at GOTOFF(%eax), %eax              #1547.18
-        movsbl    %al, %eax                                     #1547.18
-..LN1735:
-        testl     %eax, %eax                                    #1547.41
-        jne       ..B17.6       # Prob 50%                      #1547.41
-                                # LOE
-..B17.5:                        # Preds ..B17.4
-..LN1737:
-        call      NucStrstrInit                                 #1548.17
-                                # LOE
-..B17.6:                        # Preds ..B17.5 ..B17.4
-..LN1739:
-        movl      20(%ebp), %eax                                #1550.27
-..LN1741:
-        addl      16(%ebp), %eax                                #1550.19
-..LN1743:
-        movl      %eax, -16(%ebp)                               #1550.13
-..LN1745:
-        addl      $-20, %esp                                    #1551.21
-..LN1747:
-        movl      16(%ebp), %eax                                #1551.32
-        movl      %eax, (%esp)                                  #1551.32
-..LN1749:
-        movl      -16(%ebp), %eax                               #1551.39
-        movl      %eax, 4(%esp)                                 #1551.39
-..LN1751:
-        movl      8(%ebp), %eax                                 #1551.44
-        movl      %eax, 8(%esp)                                 #1551.44
-..LN1753:
-        lea       -20(%ebp), %eax                               #1551.49
-        movl      %eax, 12(%esp)                                #1551.49
-..LN1755:
-        movl      12(%ebp), %eax                                #1551.59
-        movl      %eax, 16(%esp)                                #1551.59
-..LN1757:
-        call      nss_expr                                      #1551.21
-                                # LOE eax
-..B17.17:                       # Preds ..B17.6
-        addl      $20, %esp                                     #1551.21
-        movl      %eax, -8(%ebp)                                #1551.21
-                                # LOE
-..B17.7:                        # Preds ..B17.17
-..LN1759:
-        movl      -8(%ebp), %eax                                #1551.13
-        movl      %eax, 16(%ebp)                                #1551.13
-..LN1761:
-        movl      -20(%ebp), %eax                               #1552.18
-..LN1763:
-        testl     %eax, %eax                                    #1552.28
-        jne       ..B17.11      # Prob 50%                      #1552.28
-                                # LOE
-..B17.8:                        # Preds ..B17.7
-..LN1765:
-        movl      16(%ebp), %eax                                #1554.22
-..LN1767:
-        movl      -16(%ebp), %edx                               #1554.31
-        cmpl      %edx, %eax                                    #1554.31
-        jne       ..B17.10      # Prob 50%                      #1554.31
-                                # LOE
-..B17.9:                        # Preds ..B17.8
-..LN1769:
-        xorl      %eax, %eax                                    #1555.28
-        movl      -4(%ebp), %ebx                                #1555.28
-..___tag_value_NucStrstrMake.333:                               #
-        leave                                                   #1555.28
-..___tag_value_NucStrstrMake.335:                               #
-        ret                                                     #1555.28
-..___tag_value_NucStrstrMake.336:                               #
-                                # LOE
-..B17.10:                       # Preds ..B17.8
-..LN1771:
-        movl      $22, -20(%ebp)                                #1557.17
-                                # LOE
-..B17.11:                       # Preds ..B17.10 ..B17.7
-..LN1773:
-        pushl     %edi                                          #1560.13
-..LN1775:
-        movl      8(%ebp), %eax                                 #1560.32
-        movl      (%eax), %eax                                  #1560.32
-        movl      %eax, (%esp)                                  #1560.32
-..LN1777:
-        movl      -12(%ebp), %eax                               #1560.13
-        movl      %eax, %ebx                                    #1560.13
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE
-..B17.18:                       # Preds ..B17.11
-        popl      %ecx                                          #1560.13
-                                # LOE
-..B17.12:                       # Preds ..B17.18
-..LN1779:
-        movl      8(%ebp), %eax                                 #1561.13
-        movl      $0, (%eax)                                    #1561.13
-..LN1781:
-        movl      -20(%ebp), %eax                               #1562.20
-        movl      -4(%ebp), %ebx                                #1562.20
-..___tag_value_NucStrstrMake.338:                               #
-        leave                                                   #1562.20
-..___tag_value_NucStrstrMake.340:                               #
-        ret                                                     #1562.20
-..___tag_value_NucStrstrMake.341:                               #
-                                # LOE
-..B17.13:                       # Preds ..B17.3 ..B17.2
-..LN1783:
-        movl      8(%ebp), %eax                                 #1565.9
-        movl      $0, (%eax)                                    #1565.9
-                                # LOE
-..B17.14:                       # Preds ..B17.13 ..B17.1
-..LN1785:
-        movl      $22, %eax                                     #1567.12
-        movl      -4(%ebp), %ebx                                #1567.12
-..___tag_value_NucStrstrMake.343:                               #
-        leave                                                   #1567.12
-..___tag_value_NucStrstrMake.345:                               #
-        ret                                                     #1567.12
-        .align    2,0x90
-..___tag_value_NucStrstrMake.346:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-.LNNucStrstrMake:
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1(self): 8 + %ebp
-..B18.1:                        # Preds ..B18.0
-..___tag_value_NucStrstrWhack.349:                              #
-..LN1787:
-        pushl     %ebp                                          #1574.1
-        movl      %esp, %ebp                                    #1574.1
-..___tag_value_NucStrstrWhack.354:                              #
-        subl      $12, %esp                                     #1574.1
-        movl      %ebx, -4(%ebp)                                #1574.1
-..___tag_value_NucStrstrWhack.357:                              #
-..LN1789:
-        movl      8(%ebp), %eax                                 #1575.10
-..LN1791:
-        testl     %eax, %eax                                    #1575.18
-        je        ..B18.22      # Prob 50%                      #1575.18
-                                # LOE
-..B18.2:                        # Preds ..B18.1
-        call      ..L358        # Prob 100%                     #
-..L358:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L358], %eax     #
-        movl      %eax, -12(%ebp)                               #
-..LN1793:
-        movl      8(%ebp), %eax                                 #1577.18
-        movl      (%eax), %eax                                  #1577.18
-        movl      %eax, -8(%ebp)                                #1577.18
-..LN1795:
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B18.21      # Prob 50%                      #1577.9
-                                # LOE
-..B18.3:                        # Preds ..B18.2
-        movl      -12(%ebp), %eax                               #1577.9
-        movl      -8(%ebp), %edx                                #1577.9
-        movl      ..1..TPKT.18_0 at GOTOFF(%eax,%edx,4), %eax      #1577.9
-        jmp       *%eax                                         #1577.9
-                                # LOE
-..1.18_0.TAG.0a:
-..1.18_0.TAG.09:
-..1.18_0.TAG.08:
-..1.18_0.TAG.07:
-..1.18_0.TAG.06:
-..1.18_0.TAG.05:
-..1.18_0.TAG.04:
-..1.18_0.TAG.03:
-..1.18_0.TAG.02:
-..1.18_0.TAG.01:
-..1.18_0.TAG.00:
-..B18.15:                       # Preds ..B18.3 ..B18.3 ..B18.3 ..B18.3 ..B18.3
-                                #       ..B18.3 ..B18.3 ..B18.3 ..B18.3 ..B18.3
-                                #       ..B18.3
-..LN1797:
-        movl      8(%ebp), %eax                                 #1593.20
-        movl      8(%eax), %eax                                 #1593.20
-..LN1799:
-        movl      %eax, 8(%ebp)                                 #1593.13
-        jmp       ..B18.21      # Prob 100%                     #1593.13
-                                # LOE
-..1.18_0.TAG.0b:
-..B18.17:                       # Preds ..B18.3
-..LN1801:
-        pushl     %edi                                          #1597.13
-..LN1803:
-        movl      8(%ebp), %eax                                 #1597.30
-        movl      8(%eax), %eax                                 #1597.30
-        movl      %eax, (%esp)                                  #1597.30
-..LN1805:
-        movl      -12(%ebp), %eax                               #1597.13
-        movl      %eax, %ebx                                    #1597.13
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE
-..B18.25:                       # Preds ..B18.17
-        popl      %ecx                                          #1597.13
-                                # LOE
-..B18.18:                       # Preds ..B18.25
-..LN1807:
-        pushl     %edi                                          #1598.13
-..LN1809:
-        movl      8(%ebp), %eax                                 #1598.30
-        movl      12(%eax), %eax                                #1598.30
-        movl      %eax, (%esp)                                  #1598.30
-..LN1811:
-        movl      -12(%ebp), %eax                               #1598.13
-        movl      %eax, %ebx                                    #1598.13
-        call      NucStrstrWhack at PLT                            #1598.13
-                                # LOE
-..B18.26:                       # Preds ..B18.18
-        popl      %ecx                                          #1598.13
-        jmp       ..B18.21      # Prob 100%                     #1598.13
-                                # LOE
-..1.18_0.TAG.0c:
-..B18.20:                       # Preds ..B18.3
-..LN1813:
-        pushl     %edi                                          #1601.13
-..LN1815:
-        movl      8(%ebp), %eax                                 #1601.30
-        movl      8(%eax), %eax                                 #1601.30
-        movl      %eax, (%esp)                                  #1601.30
-..LN1817:
-        movl      -12(%ebp), %eax                               #1601.13
-        movl      %eax, %ebx                                    #1601.13
-        call      NucStrstrWhack at PLT                            #1601.13
-                                # LOE
-..B18.27:                       # Preds ..B18.20
-        popl      %ecx                                          #1601.13
-                                # LOE
-..B18.21:                       # Preds ..B18.27 ..B18.26 ..B18.15 ..B18.2
-..LN1819:
-        pushl     %edi                                          #1604.9
-..LN1821:
-        movl      8(%ebp), %eax                                 #1604.16
-        movl      %eax, (%esp)                                  #1604.16
-..LN1823:
-        movl      -12(%ebp), %eax                               #1604.9
-        movl      %eax, %ebx                                    #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE
-..B18.28:                       # Preds ..B18.21
-        popl      %ecx                                          #1604.9
-                                # LOE
-..B18.22:                       # Preds ..B18.28 ..B18.1
-..LN1825:
-        movl      -4(%ebp), %ebx                                #1606.1
-..___tag_value_NucStrstrWhack.359:                              #
-        leave                                                   #1606.1
-..___tag_value_NucStrstrWhack.361:                              #
-        ret                                                     #1606.1
-        .align    2,0x90
-..___tag_value_NucStrstrWhack.362:                              #
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-.LNNucStrstrWhack:
-	.section .data1, "wa"
-	.align 4
-	.align 4
-..1..TPKT.18_0:
-	.long	..1.18_0.TAG.00
-	.long	..1.18_0.TAG.01
-	.long	..1.18_0.TAG.02
-	.long	..1.18_0.TAG.03
-	.long	..1.18_0.TAG.04
-	.long	..1.18_0.TAG.05
-	.long	..1.18_0.TAG.06
-	.long	..1.18_0.TAG.07
-	.long	..1.18_0.TAG.08
-	.long	..1.18_0.TAG.09
-	.long	..1.18_0.TAG.0a
-	.long	..1.18_0.TAG.0b
-	.long	..1.18_0.TAG.0c
-	.data
-# -- End  NucStrstrWhack
-	.section .rodata, "a"
-	.align 4
-__$U5:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	56
-	.byte	0
-	.type	__$U5, at object
-	.size	__$U5,11
-	.space 1	# pad
-_2__STRING.9:
-	.byte	108
-	.byte	101
-	.byte	110
-	.byte	32
-	.byte	62
-	.byte	61
-	.byte	32
-	.byte	113
-	.byte	108
-	.byte	101
-	.byte	110
-	.byte	0
-	.type	_2__STRING.9, at object
-	.size	_2__STRING.9,12
-	.data
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    2,0x90
-eval_2na_8:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B19.1:                        # Preds ..B19.0
-..___tag_value_eval_2na_8.365:                                  #
-..LN1827:
-        pushl     %ebx                                          #2196.1
-..___tag_value_eval_2na_8.370:                                  #
-        movl      %esp, %ebx                                    #2196.1
-..___tag_value_eval_2na_8.371:                                  #
-        andl      $-16, %esp                                    #2196.1
-        pushl     %ebp                                          #2196.1
-        pushl     %ebp                                          #2196.1
-        movl      4(%ebx), %ebp                                 #2196.1
-        movl      %ebp, 4(%esp)                                 #2196.1
-        movl      %esp, %ebp                                    #2196.1
-..___tag_value_eval_2na_8.373:                                  #
-        subl      $280, %esp                                    #2196.1
-        movl      %ebx, -280(%ebp)                              #2196.1
-..LN1829:
-        movl      8(%ebx), %eax                                 #2226.25
-        movl      4(%eax), %eax                                 #2226.25
-..LN1831:
-        movl      %eax, -4(%ebp)                                #2226.23
-..LN1833:
-        movl      20(%ebx), %eax                                #2229.5
-        movl      -4(%ebp), %edx                                #2229.5
-        cmpl      %edx, %eax                                    #2229.5
-        jae       ..B19.3       # Prob 50%                      #2229.5
-                                # LOE
-..B19.2:                        # Preds ..B19.1
-        call      ..L375        # Prob 100%                     #
-..L375:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L375], %eax     #
-        addl      $-16, %esp                                    #2229.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #2229.5
-        movl      %edx, (%esp)                                  #2229.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #2229.5
-        movl      %edx, 4(%esp)                                 #2229.5
-        movl      $2229, 8(%esp)                                #2229.5
-        lea       __$U5 at GOTOFF(%eax), %edx                      #2229.5
-        movl      %edx, 12(%esp)                                #2229.5
-        movl      %eax, %ebx                                    #2229.5
-..___tag_value_eval_2na_8.376:                                  #2229.5
-        call      __assert_fail at PLT                             #2229.5
-        movl      -280(%ebp), %ebx                              #2229.5
-..___tag_value_eval_2na_8.377:                                  #
-                                # LOE
-..B19.43:                       # Preds ..B19.2
-        addl      $16, %esp                                     #2229.5
-                                # LOE
-..B19.3:                        # Preds ..B19.1
-..LN1835:
-        movl      16(%ebx), %eax                                #2233.12
-..LN1837:
-        addl      20(%ebx), %eax                                #2233.5
-        movl      %eax, 20(%ebx)                                #2233.5
-..LN1839:
-        movl      16(%ebx), %eax                                #2236.42
-..LN1841:
-        shrl      $2, %eax                                      #2236.49
-..LN1843:
-        addl      12(%ebx), %eax                                #2236.30
-..LN1845:
-        movl      %eax, -36(%ebp)                               #2236.5
-..LN1847:
-        movl      -4(%ebp), %eax                                #2239.18
-        negl      %eax                                          #2239.18
-        addl      20(%ebx), %eax                                #2239.18
-..LN1849:
-        movl      %eax, -32(%ebp)                               #2239.5
-..LN1851:
-        movl      20(%ebx), %eax                                #2242.44
-..LN1853:
-        addl      $3, %eax                                      #2242.50
-..LN1855:
-        shrl      $2, %eax                                      #2242.57
-..LN1857:
-        addl      12(%ebx), %eax                                #2242.30
-..LN1859:
-        movl      %eax, -28(%ebp)                               #2242.5
-..LN1861:
-        addl      $-8, %esp                                     #2245.14
-..LN1863:
-        movl      -36(%ebp), %eax                               #2245.33
-        movl      %eax, (%esp)                                  #2245.33
-..LN1865:
-        movl      -28(%ebp), %eax                               #2245.38
-        movl      %eax, 4(%esp)                                 #2245.38
-..LN1867:
-        call      prime_buffer_2na                              #2245.14
-                                # LOE xmm0
-..B19.44:                       # Preds ..B19.3
-        addl      $8, %esp                                      #2245.14
-        movdqa    %xmm0, -88(%ebp)                              #2245.14
-                                # LOE
-..B19.4:                        # Preds ..B19.44
-..LN1869:
-        movdqa    -88(%ebp), %xmm0                              #2245.5
-        movdqa    %xmm0, -232(%ebp)                             #2245.5
-..LN1871:
-        addl      $16, -36(%ebp)                                #2246.5
-..LN1873:
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    16(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -216(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    32(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -200(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    48(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -184(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    64(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -168(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    80(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -152(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    96(%eax), %xmm0                               #2256.5
-        movdqa    %xmm0, -136(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    112(%eax), %xmm0                              #2256.5
-        movdqa    %xmm0, -120(%ebp)                             #2256.5
-        movl      8(%ebx), %eax                                 #2256.5
-        movdqa    128(%eax), %xmm0                              #2256.5
-        movdqa    %xmm0, -104(%ebp)                             #2256.5
-..LN1875:
-        xorl      %eax, %eax                                    #2259.15
-        movl      %eax, -24(%ebp)                               #2259.15
-..LN1877:
-        movl      %eax, -20(%ebp)                               #2259.10
-..LN1879:
-        movl      %eax, -16(%ebp)                               #2259.5
-..LN1881:
-        movl      $1, -12(%ebp)                                 #2263.5
-..LN1883:
-        movl      16(%ebx), %eax                                #2268.14
-..LN1885:
-        andl      $3, %eax                                      #2268.20
-        movl      %eax, -8(%ebp)                                #2268.20
-        je        ..B19.12      # Prob 50%                      #2268.20
-                                # LOE
-..B19.5:                        # Preds ..B19.4
-        movl      -8(%ebp), %eax                                #2268.20
-        cmpl      $1, %eax                                      #2268.20
-        je        ..B19.13      # Prob 50%                      #2268.20
-                                # LOE
-..B19.6:                        # Preds ..B19.5
-        movl      -8(%ebp), %eax                                #2268.20
-        cmpl      $2, %eax                                      #2268.20
-        je        ..B19.14      # Prob 50%                      #2268.20
-                                # LOE
-..B19.7:                        # Preds ..B19.6
-        movl      -8(%ebp), %eax                                #2268.20
-        cmpl      $3, %eax                                      #2268.20
-        je        ..B19.15      # Prob 50%                      #2268.20
-                                # LOE
-..B19.8:                        # Preds ..B19.39 ..B19.7
-..LN1887:
-        movl      $1, %eax                                      #2273.9
-        testl     %eax, %eax                                    #2273.9
-        je        ..B19.40      # Prob 100%                     #2273.9
-                                # LOE
-..B19.9:                        # Preds ..B19.8
-..LN1889:
-        movl      $1, -12(%ebp)                                 #2275.13
-                                # LOE
-..B19.10:                       # Preds ..B19.34 ..B19.9
-..LN1891:
-        movl      $1, %eax                                      #2278.13
-        testl     %eax, %eax                                    #2278.13
-        je        ..B19.36      # Prob 100%                     #2278.13
-                                # LOE
-..B19.12:                       # Preds ..B19.4 ..B19.10
-..LN1893:
-        movdqa    -232(%ebp), %xmm0                             #2285.38
-..LN1895:
-        movdqa    -200(%ebp), %xmm1                             #2285.46
-..LN1897:
-        pand      %xmm1, %xmm0                                  #2285.22
-..LN1899:
-        movdqa    %xmm0, -248(%ebp)                             #2285.17
-..LN1901:
-        movdqa    -248(%ebp), %xmm0                             #2286.22
-        movdqa    -216(%ebp), %xmm1                             #2286.22
-        pcmpeqb   %xmm1, %xmm0                                  #2286.22
-..LN1903:
-        movdqa    %xmm0, -248(%ebp)                             #2286.17
-..LN1905:
-        movdqa    -248(%ebp), %xmm0                             #2287.42
-..LN1907:
-        pmovmskb  %xmm0, %eax                                   #2287.22
-..LN1909:
-        movl      %eax, -16(%ebp)                               #2287.17
-                                # LOE
-..B19.13:                       # Preds ..B19.5 ..B19.12
-..LN1911:
-        movdqa    -232(%ebp), %xmm0                             #2291.38
-..LN1913:
-        movdqa    -168(%ebp), %xmm1                             #2291.46
-..LN1915:
-        pand      %xmm1, %xmm0                                  #2291.22
-..LN1917:
-        movdqa    %xmm0, -248(%ebp)                             #2291.17
-..LN1919:
-        movdqa    -248(%ebp), %xmm0                             #2292.22
-        movdqa    -184(%ebp), %xmm1                             #2292.22
-        pcmpeqb   %xmm1, %xmm0                                  #2292.22
-..LN1921:
-        movdqa    %xmm0, -248(%ebp)                             #2292.17
-..LN1923:
-        movdqa    -248(%ebp), %xmm0                             #2293.42
-..LN1925:
-        pmovmskb  %xmm0, %eax                                   #2293.22
-..LN1927:
-        movl      %eax, -20(%ebp)                               #2293.17
-                                # LOE
-..B19.14:                       # Preds ..B19.6 ..B19.13
-..LN1929:
-        movdqa    -232(%ebp), %xmm0                             #2297.38
-..LN1931:
-        movdqa    -136(%ebp), %xmm1                             #2297.46
-..LN1933:
-        pand      %xmm1, %xmm0                                  #2297.22
-..LN1935:
-        movdqa    %xmm0, -248(%ebp)                             #2297.17
-..LN1937:
-        movdqa    -248(%ebp), %xmm0                             #2298.22
-        movdqa    -152(%ebp), %xmm1                             #2298.22
-        pcmpeqb   %xmm1, %xmm0                                  #2298.22
-..LN1939:
-        movdqa    %xmm0, -248(%ebp)                             #2298.17
-..LN1941:
-        movdqa    -248(%ebp), %xmm0                             #2299.42
-..LN1943:
-        pmovmskb  %xmm0, %eax                                   #2299.22
-..LN1945:
-        movl      %eax, -24(%ebp)                               #2299.17
-                                # LOE
-..B19.15:                       # Preds ..B19.7 ..B19.14
-..LN1947:
-        movdqa    -232(%ebp), %xmm0                             #2303.38
-..LN1949:
-        movdqa    -104(%ebp), %xmm1                             #2303.46
-..LN1951:
-        pand      %xmm1, %xmm0                                  #2303.22
-..LN1953:
-        movdqa    %xmm0, -248(%ebp)                             #2303.17
-..LN1955:
-        movdqa    -248(%ebp), %xmm0                             #2304.22
-        movdqa    -120(%ebp), %xmm1                             #2304.22
-        pcmpeqb   %xmm1, %xmm0                                  #2304.22
-..LN1957:
-        movdqa    %xmm0, -248(%ebp)                             #2304.17
-..LN1959:
-        movdqa    -248(%ebp), %xmm0                             #2305.42
-..LN1961:
-        pmovmskb  %xmm0, %eax                                   #2305.22
-..LN1963:
-        movl      %eax, -40(%ebp)                               #2305.17
-..LN1965:
-        movl      16(%ebx), %eax                                #2310.17
-        andl      $-4, %eax                                     #2310.17
-        movl      %eax, 16(%ebx)                                #2310.17
-..LN1967:
-        movl      -20(%ebp), %eax                               #2313.29
-        orl       -16(%ebp), %eax                               #2313.29
-..LN1969:
-        orl       -24(%ebp), %eax                               #2313.34
-..LN1971:
-        orl       -40(%ebp), %eax                               #2313.39
-..LN1973:
-        je        ..B19.32      # Prob 50%                      #2313.47
-                                # LOE
-..B19.16:                       # Preds ..B19.15
-..LN1975:
-        pushl     %edi                                          #2331.30
-..LN1977:
-        movl      -16(%ebp), %eax                               #2331.58
-        movw      %ax, (%esp)                                   #2331.58
-..LN1979:
-        call      uint16_lsbit                                  #2331.30
-                                # LOE eax
-..B19.45:                       # Preds ..B19.16
-        popl      %ecx                                          #2331.30
-        movl      %eax, -56(%ebp)                               #2331.30
-                                # LOE
-..B19.17:                       # Preds ..B19.45
-        movl      -56(%ebp), %eax                               #2331.30
-        movswl    %ax, %eax                                     #2331.30
-..LN1981:
-        movl      %eax, -72(%ebp)                               #2331.28
-..LN1983:
-        pushl     %edi                                          #2332.30
-..LN1985:
-        movl      -20(%ebp), %eax                               #2332.58
-        movw      %ax, (%esp)                                   #2332.58
-..LN1987:
-        call      uint16_lsbit                                  #2332.30
-                                # LOE eax
-..B19.46:                       # Preds ..B19.17
-        popl      %ecx                                          #2332.30
-        movl      %eax, -52(%ebp)                               #2332.30
-                                # LOE
-..B19.18:                       # Preds ..B19.46
-        movl      -52(%ebp), %eax                               #2332.30
-        movswl    %ax, %eax                                     #2332.30
-..LN1989:
-        movl      %eax, -68(%ebp)                               #2332.28
-..LN1991:
-        pushl     %edi                                          #2333.30
-..LN1993:
-        movl      -24(%ebp), %eax                               #2333.58
-        movw      %ax, (%esp)                                   #2333.58
-..LN1995:
-        call      uint16_lsbit                                  #2333.30
-                                # LOE eax
-..B19.47:                       # Preds ..B19.18
-        popl      %ecx                                          #2333.30
-        movl      %eax, -48(%ebp)                               #2333.30
-                                # LOE
-..B19.19:                       # Preds ..B19.47
-        movl      -48(%ebp), %eax                               #2333.30
-        movswl    %ax, %eax                                     #2333.30
-..LN1997:
-        movl      %eax, -64(%ebp)                               #2333.28
-..LN1999:
-        pushl     %edi                                          #2334.30
-..LN2001:
-        movl      -40(%ebp), %eax                               #2334.58
-        movw      %ax, (%esp)                                   #2334.58
-..LN2003:
-        call      uint16_lsbit                                  #2334.30
-                                # LOE eax
-..B19.48:                       # Preds ..B19.19
-        popl      %ecx                                          #2334.30
-        movl      %eax, -44(%ebp)                               #2334.30
-                                # LOE
-..B19.20:                       # Preds ..B19.48
-        movl      -44(%ebp), %eax                               #2334.30
-        movswl    %ax, %eax                                     #2334.30
-..LN2005:
-        movl      %eax, -60(%ebp)                               #2334.28
-..LN2007:
-        shll      $2, -72(%ebp)                                 #2339.34
-..LN2009:
-        movl      -68(%ebp), %eax                               #2340.28
-..LN2011:
-        lea       1(,%eax,4), %eax                              #2340.40
-..LN2013:
-        movl      %eax, -68(%ebp)                               #2340.21
-..LN2015:
-        movl      -64(%ebp), %eax                               #2341.28
-..LN2017:
-        lea       2(,%eax,4), %eax                              #2341.40
-..LN2019:
-        movl      %eax, -64(%ebp)                               #2341.21
-..LN2021:
-        movl      -60(%ebp), %eax                               #2342.28
-..LN2023:
-        lea       3(,%eax,4), %eax                              #2342.40
-..LN2025:
-        movl      %eax, -60(%ebp)                               #2342.21
-..LN2027:
-        movl      -16(%ebp), %eax                               #2346.26
-..LN2029:
-        testl     %eax, %eax                                    #2346.32
-        je        ..B19.23      # Prob 50%                      #2346.32
-                                # LOE
-..B19.21:                       # Preds ..B19.20
-..LN2031:
-        movl      -72(%ebp), %eax                               #2346.43
-        addl      16(%ebx), %eax                                #2346.43
-..LN2033:
-        movl      -32(%ebp), %edx                               #2346.49
-        cmpl      %edx, %eax                                    #2346.49
-        ja        ..B19.23      # Prob 50%                      #2346.49
-                                # LOE
-..B19.22:                       # Preds ..B19.21
-..LN2035:
-        movl      $1, %eax                                      #2346.63
-        leave                                                   #2346.63
-..___tag_value_eval_2na_8.379:                                  #
-        movl      %ebx, %esp                                    #2346.63
-        popl      %ebx                                          #2346.63
-..___tag_value_eval_2na_8.380:                                  #
-        ret                                                     #2346.63
-..___tag_value_eval_2na_8.382:                                  #
-                                # LOE
-..B19.23:                       # Preds ..B19.21 ..B19.20
-..LN2037:
-        movl      -20(%ebp), %eax                               #2347.26
-..LN2039:
-        testl     %eax, %eax                                    #2347.32
-        je        ..B19.26      # Prob 50%                      #2347.32
-                                # LOE
-..B19.24:                       # Preds ..B19.23
-..LN2041:
-        movl      -68(%ebp), %eax                               #2347.43
-        addl      16(%ebx), %eax                                #2347.43
-..LN2043:
-        movl      -32(%ebp), %edx                               #2347.49
-        cmpl      %edx, %eax                                    #2347.49
-        ja        ..B19.26      # Prob 50%                      #2347.49
-                                # LOE
-..B19.25:                       # Preds ..B19.24
-..LN2045:
-        movl      $1, %eax                                      #2347.63
-        leave                                                   #2347.63
-..___tag_value_eval_2na_8.386:                                  #
-        movl      %ebx, %esp                                    #2347.63
-        popl      %ebx                                          #2347.63
-..___tag_value_eval_2na_8.387:                                  #
-        ret                                                     #2347.63
-..___tag_value_eval_2na_8.389:                                  #
-                                # LOE
-..B19.26:                       # Preds ..B19.24 ..B19.23
-..LN2047:
-        movl      -24(%ebp), %eax                               #2348.26
-..LN2049:
-        testl     %eax, %eax                                    #2348.32
-        je        ..B19.29      # Prob 50%                      #2348.32
-                                # LOE
-..B19.27:                       # Preds ..B19.26
-..LN2051:
-        movl      -64(%ebp), %eax                               #2348.43
-        addl      16(%ebx), %eax                                #2348.43
-..LN2053:
-        movl      -32(%ebp), %edx                               #2348.49
-        cmpl      %edx, %eax                                    #2348.49
-        ja        ..B19.29      # Prob 50%                      #2348.49
-                                # LOE
-..B19.28:                       # Preds ..B19.27
-..LN2055:
-        movl      $1, %eax                                      #2348.63
-        leave                                                   #2348.63
-..___tag_value_eval_2na_8.393:                                  #
-        movl      %ebx, %esp                                    #2348.63
-        popl      %ebx                                          #2348.63
-..___tag_value_eval_2na_8.394:                                  #
-        ret                                                     #2348.63
-..___tag_value_eval_2na_8.396:                                  #
-                                # LOE
-..B19.29:                       # Preds ..B19.27 ..B19.26
-..LN2057:
-        movl      -40(%ebp), %eax                               #2349.26
-..LN2059:
-        testl     %eax, %eax                                    #2349.32
-        je        ..B19.32      # Prob 50%                      #2349.32
-                                # LOE
-..B19.30:                       # Preds ..B19.29
-..LN2061:
-        movl      -60(%ebp), %eax                               #2349.43
-        addl      16(%ebx), %eax                                #2349.43
-..LN2063:
-        movl      -32(%ebp), %edx                               #2349.49
-        cmpl      %edx, %eax                                    #2349.49
-        ja        ..B19.32      # Prob 50%                      #2349.49
-                                # LOE
-..B19.31:                       # Preds ..B19.30
-..LN2065:
-        movl      $1, %eax                                      #2349.63
-        leave                                                   #2349.63
-..___tag_value_eval_2na_8.400:                                  #
-        movl      %ebx, %esp                                    #2349.63
-        popl      %ebx                                          #2349.63
-..___tag_value_eval_2na_8.401:                                  #
-        ret                                                     #2349.63
-..___tag_value_eval_2na_8.403:                                  #
-                                # LOE
-..B19.32:                       # Preds ..B19.30 ..B19.29 ..B19.15
-..LN2067:
-        movl      16(%ebx), %eax                                #2354.17
-        addl      $4, %eax                                      #2354.17
-        movl      %eax, 16(%ebx)                                #2354.17
-..LN2069:
-        movl      16(%ebx), %eax                                #2357.22
-..LN2071:
-        movl      -32(%ebp), %edx                               #2357.28
-        cmpl      %edx, %eax                                    #2357.28
-        jbe       ..B19.34      # Prob 50%                      #2357.28
-                                # LOE
-..B19.33:                       # Preds ..B19.32
-..LN2073:
-        xorl      %eax, %eax                                    #2358.28
-        leave                                                   #2358.28
-..___tag_value_eval_2na_8.407:                                  #
-        movl      %ebx, %esp                                    #2358.28
-        popl      %ebx                                          #2358.28
-..___tag_value_eval_2na_8.408:                                  #
-        ret                                                     #2358.28
-..___tag_value_eval_2na_8.410:                                  #
-                                # LOE
-..B19.34:                       # Preds ..B19.32
-..LN2075:
-        movl      -12(%ebp), %eax                               #2361.25
-        decl      %eax                                          #2361.25
-        movl      %eax, -12(%ebp)                               #2361.25
-..LN2077:
-        jne       ..B19.10      # Prob 50%                      #2361.39
-                                # LOE
-..B19.36:                       # Preds ..B19.34 ..B19.10
-..LN2079:
-        movl      -36(%ebp), %eax                               #2382.18
-..LN2081:
-        movl      -28(%ebp), %edx                               #2382.25
-        cmpl      %edx, %eax                                    #2382.25
-        jae       ..B19.40      # Prob 50%                      #2382.25
-                                # LOE
-..B19.37:                       # Preds ..B19.36
-..LN2083:
-        movl      16(%ebx), %eax                                #2386.13
-        addl      $60, %eax                                     #2386.13
-        movl      %eax, 16(%ebx)                                #2386.13
-..LN2085:
-        movl      16(%ebx), %eax                                #2387.18
-..LN2087:
-        movl      -32(%ebp), %edx                               #2387.24
-        cmpl      %edx, %eax                                    #2387.24
-        ja        ..B19.40      # Prob 50%                      #2387.24
-                                # LOE
-..B19.38:                       # Preds ..B19.37
-..LN2089:
-        addl      $-8, %esp                                     #2392.22
-..LN2091:
-        movl      -36(%ebp), %eax                               #2392.41
-        movl      %eax, (%esp)                                  #2392.41
-..LN2093:
-        movl      -28(%ebp), %eax                               #2392.46
-        movl      %eax, 4(%esp)                                 #2392.46
-..LN2095:
-        call      prime_buffer_2na                              #2392.22
-                                # LOE xmm0
-..B19.49:                       # Preds ..B19.38
-        addl      $8, %esp                                      #2392.22
-        movdqa    %xmm0, -264(%ebp)                             #2392.22
-                                # LOE
-..B19.39:                       # Preds ..B19.49
-..LN2097:
-        movdqa    -264(%ebp), %xmm0                             #2392.13
-        movdqa    %xmm0, -232(%ebp)                             #2392.13
-..LN2099:
-        addl      $16, -36(%ebp)                                #2470.13
-        jmp       ..B19.8       # Prob 100%                     #2470.13
-                                # LOE
-..B19.40:                       # Preds ..B19.37 ..B19.36 ..B19.8
-..LN2101:
-        xorl      %eax, %eax                                    #2483.12
-        leave                                                   #2483.12
-..___tag_value_eval_2na_8.414:                                  #
-        movl      %ebx, %esp                                    #2483.12
-        popl      %ebx                                          #2483.12
-..___tag_value_eval_2na_8.415:                                  #
-        ret                                                     #2483.12
-        .align    2,0x90
-..___tag_value_eval_2na_8.417:                                  #
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-.LNeval_2na_8:
-	.data
-# -- End  eval_2na_8
-	.section .rodata, "a"
-	.align 4
-__$U6:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	54
-	.byte	0
-	.type	__$U6, at object
-	.size	__$U6,12
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    2,0x90
-eval_2na_16:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B20.1:                        # Preds ..B20.0
-..___tag_value_eval_2na_16.420:                                 #
-..LN2103:
-        pushl     %ebx                                          #2489.1
-..___tag_value_eval_2na_16.425:                                 #
-        movl      %esp, %ebx                                    #2489.1
-..___tag_value_eval_2na_16.426:                                 #
-        andl      $-16, %esp                                    #2489.1
-        pushl     %ebp                                          #2489.1
-        pushl     %ebp                                          #2489.1
-        movl      4(%ebx), %ebp                                 #2489.1
-        movl      %ebp, 4(%esp)                                 #2489.1
-        movl      %esp, %ebp                                    #2489.1
-..___tag_value_eval_2na_16.428:                                 #
-        subl      $296, %esp                                    #2489.1
-        movl      %ebx, -296(%ebp)                              #2489.1
-..LN2105:
-        movl      8(%ebx), %eax                                 #2519.25
-        movl      4(%eax), %eax                                 #2519.25
-..LN2107:
-        movl      %eax, -12(%ebp)                               #2519.23
-..LN2109:
-        movl      20(%ebx), %eax                                #2522.5
-        movl      -12(%ebp), %edx                               #2522.5
-        cmpl      %edx, %eax                                    #2522.5
-        jae       ..B20.3       # Prob 50%                      #2522.5
-                                # LOE
-..B20.2:                        # Preds ..B20.1
-        call      ..L430        # Prob 100%                     #
-..L430:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L430], %eax     #
-        addl      $-16, %esp                                    #2522.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #2522.5
-        movl      %edx, (%esp)                                  #2522.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #2522.5
-        movl      %edx, 4(%esp)                                 #2522.5
-        movl      $2522, 8(%esp)                                #2522.5
-        lea       __$U6 at GOTOFF(%eax), %edx                      #2522.5
-        movl      %edx, 12(%esp)                                #2522.5
-        movl      %eax, %ebx                                    #2522.5
-..___tag_value_eval_2na_16.431:                                 #2522.5
-        call      __assert_fail at PLT                             #2522.5
-        movl      -296(%ebp), %ebx                              #2522.5
-..___tag_value_eval_2na_16.432:                                 #
-                                # LOE
-..B20.49:                       # Preds ..B20.2
-        addl      $16, %esp                                     #2522.5
-                                # LOE
-..B20.3:                        # Preds ..B20.1
-..LN2111:
-        movl      16(%ebx), %eax                                #2526.12
-..LN2113:
-        addl      20(%ebx), %eax                                #2526.5
-        movl      %eax, 20(%ebx)                                #2526.5
-..LN2115:
-        movl      16(%ebx), %eax                                #2529.42
-..LN2117:
-        shrl      $2, %eax                                      #2529.49
-..LN2119:
-        addl      12(%ebx), %eax                                #2529.30
-..LN2121:
-        movl      %eax, -48(%ebp)                               #2529.5
-..LN2123:
-        movl      -12(%ebp), %eax                               #2532.18
-        negl      %eax                                          #2532.18
-        addl      20(%ebx), %eax                                #2532.18
-..LN2125:
-        movl      %eax, -44(%ebp)                               #2532.5
-..LN2127:
-        movl      20(%ebx), %eax                                #2535.44
-..LN2129:
-        addl      $3, %eax                                      #2535.50
-..LN2131:
-        shrl      $2, %eax                                      #2535.57
-..LN2133:
-        addl      12(%ebx), %eax                                #2535.30
-..LN2135:
-        movl      %eax, -40(%ebp)                               #2535.5
-..LN2137:
-        addl      $-8, %esp                                     #2538.14
-..LN2139:
-        movl      -48(%ebp), %eax                               #2538.33
-        movl      %eax, (%esp)                                  #2538.33
-..LN2141:
-        movl      -40(%ebp), %eax                               #2538.38
-        movl      %eax, 4(%esp)                                 #2538.38
-..LN2143:
-        call      prime_buffer_2na                              #2538.14
-                                # LOE xmm0
-..B20.50:                       # Preds ..B20.3
-        addl      $8, %esp                                      #2538.14
-        movdqa    %xmm0, -104(%ebp)                             #2538.14
-                                # LOE
-..B20.4:                        # Preds ..B20.50
-..LN2145:
-        movdqa    -104(%ebp), %xmm0                             #2538.5
-        movdqa    %xmm0, -248(%ebp)                             #2538.5
-..LN2147:
-        addl      $16, -48(%ebp)                                #2539.5
-..LN2149:
-        movl      -48(%ebp), %eax                               #2541.9
-..LN2151:
-        movl      %eax, -36(%ebp)                               #2541.5
-..LN2153:
-        movl      -48(%ebp), %eax                               #2544.10
-..LN2155:
-        movl      -40(%ebp), %edx                               #2544.16
-        cmpl      %edx, %eax                                    #2544.16
-        jae       ..B20.6       # Prob 50%                      #2544.16
-                                # LOE
-..B20.5:                        # Preds ..B20.4
-..LN2157:
-        movl      -48(%ebp), %eax                               #2545.24
-        movzbl    -1(%eax), %eax                                #2545.24
-        movzbl    %al, %eax                                     #2545.24
-..LN2159:
-        shll      $8, %eax                                      #2545.38
-..LN2161:
-        movl      %eax, -56(%ebp)                               #2545.9
-                                # LOE
-..B20.6:                        # Preds ..B20.5 ..B20.4
-..LN2163:
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    16(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -232(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    32(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -216(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    48(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -200(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    64(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -184(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    80(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -168(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    96(%eax), %xmm0                               #2549.5
-        movdqa    %xmm0, -152(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    112(%eax), %xmm0                              #2549.5
-        movdqa    %xmm0, -136(%ebp)                             #2549.5
-        movl      8(%ebx), %eax                                 #2549.5
-        movdqa    128(%eax), %xmm0                              #2549.5
-        movdqa    %xmm0, -120(%ebp)                             #2549.5
-..LN2165:
-        xorl      %eax, %eax                                    #2552.15
-        movl      %eax, -32(%ebp)                               #2552.15
-..LN2167:
-        movl      %eax, -28(%ebp)                               #2552.10
-..LN2169:
-        movl      %eax, -24(%ebp)                               #2552.5
-..LN2171:
-        movl      $2, -20(%ebp)                                 #2556.5
-..LN2173:
-        movl      16(%ebx), %eax                                #2561.14
-..LN2175:
-        andl      $3, %eax                                      #2561.20
-        movl      %eax, -16(%ebp)                               #2561.20
-        je        ..B20.14      # Prob 50%                      #2561.20
-                                # LOE
-..B20.7:                        # Preds ..B20.6
-        movl      -16(%ebp), %eax                               #2561.20
-        cmpl      $1, %eax                                      #2561.20
-        je        ..B20.15      # Prob 50%                      #2561.20
-                                # LOE
-..B20.8:                        # Preds ..B20.7
-        movl      -16(%ebp), %eax                               #2561.20
-        cmpl      $2, %eax                                      #2561.20
-        je        ..B20.16      # Prob 50%                      #2561.20
-                                # LOE
-..B20.9:                        # Preds ..B20.8
-        movl      -16(%ebp), %eax                               #2561.20
-        cmpl      $3, %eax                                      #2561.20
-        je        ..B20.17      # Prob 50%                      #2561.20
-                                # LOE
-..B20.10:                       # Preds ..B20.45 ..B20.44 ..B20.9
-..LN2177:
-        movl      $1, %eax                                      #2566.9
-        testl     %eax, %eax                                    #2566.9
-        je        ..B20.46      # Prob 100%                     #2566.9
-                                # LOE
-..B20.11:                       # Preds ..B20.10
-..LN2179:
-        movl      $2, -20(%ebp)                                 #2568.13
-                                # LOE
-..B20.12:                       # Preds ..B20.39 ..B20.11
-..LN2181:
-        movl      $1, %eax                                      #2571.13
-        testl     %eax, %eax                                    #2571.13
-        je        ..B20.41      # Prob 100%                     #2571.13
-                                # LOE
-..B20.14:                       # Preds ..B20.6 ..B20.12
-..LN2183:
-        movdqa    -248(%ebp), %xmm0                             #2578.38
-..LN2185:
-        movdqa    -216(%ebp), %xmm1                             #2578.46
-..LN2187:
-        pand      %xmm1, %xmm0                                  #2578.22
-..LN2189:
-        movdqa    %xmm0, -264(%ebp)                             #2578.17
-..LN2191:
-        movdqa    -264(%ebp), %xmm0                             #2579.22
-        movdqa    -232(%ebp), %xmm1                             #2579.22
-        pcmpeqw   %xmm1, %xmm0                                  #2579.22
-..LN2193:
-        movdqa    %xmm0, -264(%ebp)                             #2579.17
-..LN2195:
-        movdqa    -264(%ebp), %xmm0                             #2580.42
-..LN2197:
-        pmovmskb  %xmm0, %eax                                   #2580.22
-..LN2199:
-        movl      %eax, -24(%ebp)                               #2580.17
-                                # LOE
-..B20.15:                       # Preds ..B20.7 ..B20.14
-..LN2201:
-        movdqa    -248(%ebp), %xmm0                             #2584.38
-..LN2203:
-        movdqa    -184(%ebp), %xmm1                             #2584.46
-..LN2205:
-        pand      %xmm1, %xmm0                                  #2584.22
-..LN2207:
-        movdqa    %xmm0, -264(%ebp)                             #2584.17
-..LN2209:
-        movdqa    -264(%ebp), %xmm0                             #2585.22
-        movdqa    -200(%ebp), %xmm1                             #2585.22
-        pcmpeqw   %xmm1, %xmm0                                  #2585.22
-..LN2211:
-        movdqa    %xmm0, -264(%ebp)                             #2585.17
-..LN2213:
-        movdqa    -264(%ebp), %xmm0                             #2586.42
-..LN2215:
-        pmovmskb  %xmm0, %eax                                   #2586.22
-..LN2217:
-        movl      %eax, -28(%ebp)                               #2586.17
-                                # LOE
-..B20.16:                       # Preds ..B20.8 ..B20.15
-..LN2219:
-        movdqa    -248(%ebp), %xmm0                             #2590.38
-..LN2221:
-        movdqa    -152(%ebp), %xmm1                             #2590.46
-..LN2223:
-        pand      %xmm1, %xmm0                                  #2590.22
-..LN2225:
-        movdqa    %xmm0, -264(%ebp)                             #2590.17
-..LN2227:
-        movdqa    -264(%ebp), %xmm0                             #2591.22
-        movdqa    -168(%ebp), %xmm1                             #2591.22
-        pcmpeqw   %xmm1, %xmm0                                  #2591.22
-..LN2229:
-        movdqa    %xmm0, -264(%ebp)                             #2591.17
-..LN2231:
-        movdqa    -264(%ebp), %xmm0                             #2592.42
-..LN2233:
-        pmovmskb  %xmm0, %eax                                   #2592.22
-..LN2235:
-        movl      %eax, -32(%ebp)                               #2592.17
-                                # LOE
-..B20.17:                       # Preds ..B20.9 ..B20.16
-..LN2237:
-        movdqa    -248(%ebp), %xmm0                             #2596.38
-..LN2239:
-        movdqa    -120(%ebp), %xmm1                             #2596.46
-..LN2241:
-        pand      %xmm1, %xmm0                                  #2596.22
-..LN2243:
-        movdqa    %xmm0, -264(%ebp)                             #2596.17
-..LN2245:
-        movdqa    -264(%ebp), %xmm0                             #2597.22
-        movdqa    -136(%ebp), %xmm1                             #2597.22
-        pcmpeqw   %xmm1, %xmm0                                  #2597.22
-..LN2247:
-        movdqa    %xmm0, -264(%ebp)                             #2597.17
-..LN2249:
-        movdqa    -264(%ebp), %xmm0                             #2598.42
-..LN2251:
-        pmovmskb  %xmm0, %eax                                   #2598.22
-..LN2253:
-        movl      %eax, -52(%ebp)                               #2598.17
-..LN2255:
-        movl      16(%ebx), %eax                                #2603.17
-        andl      $-4, %eax                                     #2603.17
-        movl      %eax, 16(%ebx)                                #2603.17
-..LN2257:
-        movl      -28(%ebp), %eax                               #2606.29
-        orl       -24(%ebp), %eax                               #2606.29
-..LN2259:
-        orl       -32(%ebp), %eax                               #2606.34
-..LN2261:
-        orl       -52(%ebp), %eax                               #2606.39
-..LN2263:
-        je        ..B20.34      # Prob 50%                      #2606.47
-                                # LOE
-..B20.18:                       # Preds ..B20.17
-..LN2265:
-        pushl     %edi                                          #2624.30
-..LN2267:
-        movl      -24(%ebp), %eax                               #2624.58
-        movw      %ax, (%esp)                                   #2624.58
-..LN2269:
-        call      uint16_lsbit                                  #2624.30
-                                # LOE eax
-..B20.51:                       # Preds ..B20.18
-        popl      %ecx                                          #2624.30
-        movl      %eax, -72(%ebp)                               #2624.30
-                                # LOE
-..B20.19:                       # Preds ..B20.51
-        movl      -72(%ebp), %eax                               #2624.30
-        movswl    %ax, %eax                                     #2624.30
-..LN2271:
-        movl      %eax, -88(%ebp)                               #2624.28
-..LN2273:
-        pushl     %edi                                          #2625.30
-..LN2275:
-        movl      -28(%ebp), %eax                               #2625.58
-        movw      %ax, (%esp)                                   #2625.58
-..LN2277:
-        call      uint16_lsbit                                  #2625.30
-                                # LOE eax
-..B20.52:                       # Preds ..B20.19
-        popl      %ecx                                          #2625.30
-        movl      %eax, -68(%ebp)                               #2625.30
-                                # LOE
-..B20.20:                       # Preds ..B20.52
-        movl      -68(%ebp), %eax                               #2625.30
-        movswl    %ax, %eax                                     #2625.30
-..LN2279:
-        movl      %eax, -84(%ebp)                               #2625.28
-..LN2281:
-        pushl     %edi                                          #2626.30
-..LN2283:
-        movl      -32(%ebp), %eax                               #2626.58
-        movw      %ax, (%esp)                                   #2626.58
-..LN2285:
-        call      uint16_lsbit                                  #2626.30
-                                # LOE eax
-..B20.53:                       # Preds ..B20.20
-        popl      %ecx                                          #2626.30
-        movl      %eax, -64(%ebp)                               #2626.30
-                                # LOE
-..B20.21:                       # Preds ..B20.53
-        movl      -64(%ebp), %eax                               #2626.30
-        movswl    %ax, %eax                                     #2626.30
-..LN2287:
-        movl      %eax, -80(%ebp)                               #2626.28
-..LN2289:
-        pushl     %edi                                          #2627.30
-..LN2291:
-        movl      -52(%ebp), %eax                               #2627.58
-        movw      %ax, (%esp)                                   #2627.58
-..LN2293:
-        call      uint16_lsbit                                  #2627.30
-                                # LOE eax
-..B20.54:                       # Preds ..B20.21
-        popl      %ecx                                          #2627.30
-        movl      %eax, -60(%ebp)                               #2627.30
-                                # LOE
-..B20.22:                       # Preds ..B20.54
-        movl      -60(%ebp), %eax                               #2627.30
-        movswl    %ax, %eax                                     #2627.30
-..LN2295:
-        movl      %eax, -76(%ebp)                               #2627.28
-..LN2297:
-        shll      $2, -88(%ebp)                                 #2632.34
-..LN2299:
-        movl      -84(%ebp), %eax                               #2633.28
-..LN2301:
-        lea       1(,%eax,4), %eax                              #2633.40
-..LN2303:
-        movl      %eax, -84(%ebp)                               #2633.21
-..LN2305:
-        movl      -80(%ebp), %eax                               #2634.28
-..LN2307:
-        lea       2(,%eax,4), %eax                              #2634.40
-..LN2309:
-        movl      %eax, -80(%ebp)                               #2634.21
-..LN2311:
-        movl      -76(%ebp), %eax                               #2635.28
-..LN2313:
-        lea       3(,%eax,4), %eax                              #2635.40
-..LN2315:
-        movl      %eax, -76(%ebp)                               #2635.21
-..LN2317:
-        movl      -24(%ebp), %eax                               #2639.26
-..LN2319:
-        testl     %eax, %eax                                    #2639.32
-        je        ..B20.25      # Prob 50%                      #2639.32
-                                # LOE
-..B20.23:                       # Preds ..B20.22
-..LN2321:
-        movl      -88(%ebp), %eax                               #2639.43
-        addl      16(%ebx), %eax                                #2639.43
-..LN2323:
-        movl      -44(%ebp), %edx                               #2639.49
-        cmpl      %edx, %eax                                    #2639.49
-        ja        ..B20.25      # Prob 50%                      #2639.49
-                                # LOE
-..B20.24:                       # Preds ..B20.23
-..LN2325:
-        movl      $1, %eax                                      #2639.63
-        leave                                                   #2639.63
-..___tag_value_eval_2na_16.434:                                 #
-        movl      %ebx, %esp                                    #2639.63
-        popl      %ebx                                          #2639.63
-..___tag_value_eval_2na_16.435:                                 #
-        ret                                                     #2639.63
-..___tag_value_eval_2na_16.437:                                 #
-                                # LOE
-..B20.25:                       # Preds ..B20.23 ..B20.22
-..LN2327:
-        movl      -28(%ebp), %eax                               #2640.26
-..LN2329:
-        testl     %eax, %eax                                    #2640.32
-        je        ..B20.28      # Prob 50%                      #2640.32
-                                # LOE
-..B20.26:                       # Preds ..B20.25
-..LN2331:
-        movl      -84(%ebp), %eax                               #2640.43
-        addl      16(%ebx), %eax                                #2640.43
-..LN2333:
-        movl      -44(%ebp), %edx                               #2640.49
-        cmpl      %edx, %eax                                    #2640.49
-        ja        ..B20.28      # Prob 50%                      #2640.49
-                                # LOE
-..B20.27:                       # Preds ..B20.26
-..LN2335:
-        movl      $1, %eax                                      #2640.63
-        leave                                                   #2640.63
-..___tag_value_eval_2na_16.441:                                 #
-        movl      %ebx, %esp                                    #2640.63
-        popl      %ebx                                          #2640.63
-..___tag_value_eval_2na_16.442:                                 #
-        ret                                                     #2640.63
-..___tag_value_eval_2na_16.444:                                 #
-                                # LOE
-..B20.28:                       # Preds ..B20.26 ..B20.25
-..LN2337:
-        movl      -32(%ebp), %eax                               #2641.26
-..LN2339:
-        testl     %eax, %eax                                    #2641.32
-        je        ..B20.31      # Prob 50%                      #2641.32
-                                # LOE
-..B20.29:                       # Preds ..B20.28
-..LN2341:
-        movl      -80(%ebp), %eax                               #2641.43
-        addl      16(%ebx), %eax                                #2641.43
-..LN2343:
-        movl      -44(%ebp), %edx                               #2641.49
-        cmpl      %edx, %eax                                    #2641.49
-        ja        ..B20.31      # Prob 50%                      #2641.49
-                                # LOE
-..B20.30:                       # Preds ..B20.29
-..LN2345:
-        movl      $1, %eax                                      #2641.63
-        leave                                                   #2641.63
-..___tag_value_eval_2na_16.448:                                 #
-        movl      %ebx, %esp                                    #2641.63
-        popl      %ebx                                          #2641.63
-..___tag_value_eval_2na_16.449:                                 #
-        ret                                                     #2641.63
-..___tag_value_eval_2na_16.451:                                 #
-                                # LOE
-..B20.31:                       # Preds ..B20.29 ..B20.28
-..LN2347:
-        movl      -52(%ebp), %eax                               #2642.26
-..LN2349:
-        testl     %eax, %eax                                    #2642.32
-        je        ..B20.34      # Prob 50%                      #2642.32
-                                # LOE
-..B20.32:                       # Preds ..B20.31
-..LN2351:
-        movl      -76(%ebp), %eax                               #2642.43
-        addl      16(%ebx), %eax                                #2642.43
-..LN2353:
-        movl      -44(%ebp), %edx                               #2642.49
-        cmpl      %edx, %eax                                    #2642.49
-        ja        ..B20.34      # Prob 50%                      #2642.49
-                                # LOE
-..B20.33:                       # Preds ..B20.32
-..LN2355:
-        movl      $1, %eax                                      #2642.63
-        leave                                                   #2642.63
-..___tag_value_eval_2na_16.455:                                 #
-        movl      %ebx, %esp                                    #2642.63
-        popl      %ebx                                          #2642.63
-..___tag_value_eval_2na_16.456:                                 #
-        ret                                                     #2642.63
-..___tag_value_eval_2na_16.458:                                 #
-                                # LOE
-..B20.34:                       # Preds ..B20.32 ..B20.31 ..B20.17
-..LN2357:
-        movl      16(%ebx), %eax                                #2647.17
-        addl      $4, %eax                                      #2647.17
-        movl      %eax, 16(%ebx)                                #2647.17
-..LN2359:
-        movl      16(%ebx), %eax                                #2650.22
-..LN2361:
-        movl      -44(%ebp), %edx                               #2650.28
-        cmpl      %edx, %eax                                    #2650.28
-        jbe       ..B20.36      # Prob 50%                      #2650.28
-                                # LOE
-..B20.35:                       # Preds ..B20.34
-..LN2363:
-        xorl      %eax, %eax                                    #2651.28
-        leave                                                   #2651.28
-..___tag_value_eval_2na_16.462:                                 #
-        movl      %ebx, %esp                                    #2651.28
-        popl      %ebx                                          #2651.28
-..___tag_value_eval_2na_16.463:                                 #
-        ret                                                     #2651.28
-..___tag_value_eval_2na_16.465:                                 #
-                                # LOE
-..B20.36:                       # Preds ..B20.34
-..LN2365:
-        movl      -20(%ebp), %eax                               #2654.25
-        decl      %eax                                          #2654.25
-        movl      %eax, -20(%ebp)                               #2654.25
-..LN2367:
-        je        ..B20.41      # Prob 50%                      #2654.39
-                                # LOE
-..B20.37:                       # Preds ..B20.36
-..LN2369:
-        movdqa    -248(%ebp), %xmm0                             #2659.43
-..LN2371:
-        psrldq    $1, %xmm0                                     #2659.26
-..LN2373:
-        movdqa    %xmm0, -248(%ebp)                             #2659.17
-..LN2375:
-        movl      -36(%ebp), %eax                               #2662.22
-..LN2377:
-        movl      -40(%ebp), %edx                               #2662.26
-        cmpl      %edx, %eax                                    #2662.26
-        jae       ..B20.39      # Prob 50%                      #2662.26
-                                # LOE
-..B20.38:                       # Preds ..B20.37
-..LN2379:
-        sarl      $8, -56(%ebp)                                 #2664.21
-..LN2381:
-        movl      -36(%ebp), %eax                               #2665.37
-        movzbl    (%eax), %eax                                  #2665.37
-        movzbl    %al, %eax                                     #2665.37
-..LN2383:
-        shll      $8, %eax                                      #2665.48
-..LN2385:
-        orl       -56(%ebp), %eax                               #2665.21
-        movl      %eax, -56(%ebp)                               #2665.21
-..LN2387:
-        movdqa    -248(%ebp), %xmm0                             #2666.49
-..LN2389:
-        movl      -56(%ebp), %eax                               #2666.57
-..LN2391:
-        pinsrw    $7, %eax, %xmm0                               #2666.30
-..LN2393:
-        movdqa    %xmm0, -248(%ebp)                             #2666.21
-                                # LOE
-..B20.39:                       # Preds ..B20.38 ..B20.37
-..LN2395:
-        incl      -36(%ebp)                                     #2670.20
-        jmp       ..B20.12      # Prob 100%                     #2670.20
-                                # LOE
-..B20.41:                       # Preds ..B20.36 ..B20.12
-..LN2397:
-        movl      -48(%ebp), %eax                               #2675.18
-..LN2399:
-        movl      -40(%ebp), %edx                               #2675.25
-        cmpl      %edx, %eax                                    #2675.25
-        jae       ..B20.46      # Prob 50%                      #2675.25
-                                # LOE
-..B20.42:                       # Preds ..B20.41
-..LN2401:
-        movl      16(%ebx), %eax                                #2679.13
-        addl      $56, %eax                                     #2679.13
-        movl      %eax, 16(%ebx)                                #2679.13
-..LN2403:
-        movl      16(%ebx), %eax                                #2680.18
-..LN2405:
-        movl      -44(%ebp), %edx                               #2680.24
-        cmpl      %edx, %eax                                    #2680.24
-        ja        ..B20.46      # Prob 50%                      #2680.24
-                                # LOE
-..B20.43:                       # Preds ..B20.42
-..LN2407:
-        addl      $-8, %esp                                     #2685.22
-..LN2409:
-        movl      -48(%ebp), %eax                               #2685.41
-        movl      %eax, (%esp)                                  #2685.41
-..LN2411:
-        movl      -40(%ebp), %eax                               #2685.46
-        movl      %eax, 4(%esp)                                 #2685.46
-..LN2413:
-        call      prime_buffer_2na                              #2685.22
-                                # LOE xmm0
-..B20.55:                       # Preds ..B20.43
-        addl      $8, %esp                                      #2685.22
-        movdqa    %xmm0, -280(%ebp)                             #2685.22
-                                # LOE
-..B20.44:                       # Preds ..B20.55
-..LN2415:
-        movdqa    -280(%ebp), %xmm0                             #2685.13
-        movdqa    %xmm0, -248(%ebp)                             #2685.13
-..LN2417:
-        addl      $16, -48(%ebp)                                #2763.13
-..LN2419:
-        movl      -48(%ebp), %eax                               #2765.17
-..LN2421:
-        movl      %eax, -36(%ebp)                               #2765.13
-..LN2423:
-        movl      -48(%ebp), %eax                               #2766.18
-..LN2425:
-        movl      -40(%ebp), %edx                               #2766.24
-        cmpl      %edx, %eax                                    #2766.24
-        jae       ..B20.10      # Prob 50%                      #2766.24
-                                # LOE
-..B20.45:                       # Preds ..B20.44
-..LN2427:
-        movl      -48(%ebp), %eax                               #2767.32
-        movzbl    -1(%eax), %eax                                #2767.32
-        movzbl    %al, %eax                                     #2767.32
-..LN2429:
-        shll      $8, %eax                                      #2767.46
-..LN2431:
-        movl      %eax, -56(%ebp)                               #2767.17
-        jmp       ..B20.10      # Prob 100%                     #2767.17
-                                # LOE
-..B20.46:                       # Preds ..B20.42 ..B20.41 ..B20.10
-..LN2433:
-        xorl      %eax, %eax                                    #2776.12
-        leave                                                   #2776.12
-..___tag_value_eval_2na_16.469:                                 #
-        movl      %ebx, %esp                                    #2776.12
-        popl      %ebx                                          #2776.12
-..___tag_value_eval_2na_16.470:                                 #
-        ret                                                     #2776.12
-        .align    2,0x90
-..___tag_value_eval_2na_16.472:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-.LNeval_2na_16:
-	.data
-# -- End  eval_2na_16
-	.section .rodata, "a"
-	.align 4
-__$U7:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	51
-	.byte	50
-	.byte	0
-	.type	__$U7, at object
-	.size	__$U7,12
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    2,0x90
-eval_2na_32:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B21.1:                        # Preds ..B21.0
-..___tag_value_eval_2na_32.475:                                 #
-..LN2435:
-        pushl     %ebx                                          #2782.1
-..___tag_value_eval_2na_32.480:                                 #
-        movl      %esp, %ebx                                    #2782.1
-..___tag_value_eval_2na_32.481:                                 #
-        andl      $-16, %esp                                    #2782.1
-        pushl     %ebp                                          #2782.1
-        pushl     %ebp                                          #2782.1
-        movl      4(%ebx), %ebp                                 #2782.1
-        movl      %ebp, 4(%esp)                                 #2782.1
-        movl      %esp, %ebp                                    #2782.1
-..___tag_value_eval_2na_32.483:                                 #
-        subl      $296, %esp                                    #2782.1
-        movl      %ebx, -296(%ebp)                              #2782.1
-..LN2437:
-        movl      8(%ebx), %eax                                 #2812.25
-        movl      4(%eax), %eax                                 #2812.25
-..LN2439:
-        movl      %eax, -12(%ebp)                               #2812.23
-..LN2441:
-        movl      20(%ebx), %eax                                #2815.5
-        movl      -12(%ebp), %edx                               #2815.5
-        cmpl      %edx, %eax                                    #2815.5
-        jae       ..B21.3       # Prob 50%                      #2815.5
-                                # LOE
-..B21.2:                        # Preds ..B21.1
-        call      ..L485        # Prob 100%                     #
-..L485:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L485], %eax     #
-        addl      $-16, %esp                                    #2815.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #2815.5
-        movl      %edx, (%esp)                                  #2815.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #2815.5
-        movl      %edx, 4(%esp)                                 #2815.5
-        movl      $2815, 8(%esp)                                #2815.5
-        lea       __$U7 at GOTOFF(%eax), %edx                      #2815.5
-        movl      %edx, 12(%esp)                                #2815.5
-        movl      %eax, %ebx                                    #2815.5
-..___tag_value_eval_2na_32.486:                                 #2815.5
-        call      __assert_fail at PLT                             #2815.5
-        movl      -296(%ebp), %ebx                              #2815.5
-..___tag_value_eval_2na_32.487:                                 #
-                                # LOE
-..B21.49:                       # Preds ..B21.2
-        addl      $16, %esp                                     #2815.5
-                                # LOE
-..B21.3:                        # Preds ..B21.1
-..LN2443:
-        movl      16(%ebx), %eax                                #2819.12
-..LN2445:
-        addl      20(%ebx), %eax                                #2819.5
-        movl      %eax, 20(%ebx)                                #2819.5
-..LN2447:
-        movl      16(%ebx), %eax                                #2822.42
-..LN2449:
-        shrl      $2, %eax                                      #2822.49
-..LN2451:
-        addl      12(%ebx), %eax                                #2822.30
-..LN2453:
-        movl      %eax, -48(%ebp)                               #2822.5
-..LN2455:
-        movl      -12(%ebp), %eax                               #2825.18
-        negl      %eax                                          #2825.18
-        addl      20(%ebx), %eax                                #2825.18
-..LN2457:
-        movl      %eax, -44(%ebp)                               #2825.5
-..LN2459:
-        movl      20(%ebx), %eax                                #2828.44
-..LN2461:
-        addl      $3, %eax                                      #2828.50
-..LN2463:
-        shrl      $2, %eax                                      #2828.57
-..LN2465:
-        addl      12(%ebx), %eax                                #2828.30
-..LN2467:
-        movl      %eax, -40(%ebp)                               #2828.5
-..LN2469:
-        addl      $-8, %esp                                     #2831.14
-..LN2471:
-        movl      -48(%ebp), %eax                               #2831.33
-        movl      %eax, (%esp)                                  #2831.33
-..LN2473:
-        movl      -40(%ebp), %eax                               #2831.38
-        movl      %eax, 4(%esp)                                 #2831.38
-..LN2475:
-        call      prime_buffer_2na                              #2831.14
-                                # LOE xmm0
-..B21.50:                       # Preds ..B21.3
-        addl      $8, %esp                                      #2831.14
-        movdqa    %xmm0, -104(%ebp)                             #2831.14
-                                # LOE
-..B21.4:                        # Preds ..B21.50
-..LN2477:
-        movdqa    -104(%ebp), %xmm0                             #2831.5
-        movdqa    %xmm0, -248(%ebp)                             #2831.5
-..LN2479:
-        addl      $16, -48(%ebp)                                #2832.5
-..LN2481:
-        movl      -48(%ebp), %eax                               #2834.9
-..LN2483:
-        movl      %eax, -36(%ebp)                               #2834.5
-..LN2485:
-        movl      -48(%ebp), %eax                               #2837.10
-..LN2487:
-        movl      -40(%ebp), %edx                               #2837.16
-        cmpl      %edx, %eax                                    #2837.16
-        jae       ..B21.6       # Prob 50%                      #2837.16
-                                # LOE
-..B21.5:                        # Preds ..B21.4
-..LN2489:
-        movl      -48(%ebp), %eax                               #2838.24
-        movzbl    -1(%eax), %eax                                #2838.24
-        movzbl    %al, %eax                                     #2838.24
-..LN2491:
-        shll      $8, %eax                                      #2838.38
-..LN2493:
-        movl      %eax, -56(%ebp)                               #2838.9
-                                # LOE
-..B21.6:                        # Preds ..B21.5 ..B21.4
-..LN2495:
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    16(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -232(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    32(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -216(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    48(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -200(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    64(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -184(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    80(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -168(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    96(%eax), %xmm0                               #2842.5
-        movdqa    %xmm0, -152(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    112(%eax), %xmm0                              #2842.5
-        movdqa    %xmm0, -136(%ebp)                             #2842.5
-        movl      8(%ebx), %eax                                 #2842.5
-        movdqa    128(%eax), %xmm0                              #2842.5
-        movdqa    %xmm0, -120(%ebp)                             #2842.5
-..LN2497:
-        xorl      %eax, %eax                                    #2845.15
-        movl      %eax, -32(%ebp)                               #2845.15
-..LN2499:
-        movl      %eax, -28(%ebp)                               #2845.10
-..LN2501:
-        movl      %eax, -24(%ebp)                               #2845.5
-..LN2503:
-        movl      $4, -20(%ebp)                                 #2849.5
-..LN2505:
-        movl      16(%ebx), %eax                                #2854.14
-..LN2507:
-        andl      $3, %eax                                      #2854.20
-        movl      %eax, -16(%ebp)                               #2854.20
-        je        ..B21.14      # Prob 50%                      #2854.20
-                                # LOE
-..B21.7:                        # Preds ..B21.6
-        movl      -16(%ebp), %eax                               #2854.20
-        cmpl      $1, %eax                                      #2854.20
-        je        ..B21.15      # Prob 50%                      #2854.20
-                                # LOE
-..B21.8:                        # Preds ..B21.7
-        movl      -16(%ebp), %eax                               #2854.20
-        cmpl      $2, %eax                                      #2854.20
-        je        ..B21.16      # Prob 50%                      #2854.20
-                                # LOE
-..B21.9:                        # Preds ..B21.8
-        movl      -16(%ebp), %eax                               #2854.20
-        cmpl      $3, %eax                                      #2854.20
-        je        ..B21.17      # Prob 50%                      #2854.20
-                                # LOE
-..B21.10:                       # Preds ..B21.45 ..B21.44 ..B21.9
-..LN2509:
-        movl      $1, %eax                                      #2859.9
-        testl     %eax, %eax                                    #2859.9
-        je        ..B21.46      # Prob 100%                     #2859.9
-                                # LOE
-..B21.11:                       # Preds ..B21.10
-..LN2511:
-        movl      $4, -20(%ebp)                                 #2861.13
-                                # LOE
-..B21.12:                       # Preds ..B21.39 ..B21.11
-..LN2513:
-        movl      $1, %eax                                      #2864.13
-        testl     %eax, %eax                                    #2864.13
-        je        ..B21.41      # Prob 100%                     #2864.13
-                                # LOE
-..B21.14:                       # Preds ..B21.6 ..B21.12
-..LN2515:
-        movdqa    -248(%ebp), %xmm0                             #2871.38
-..LN2517:
-        movdqa    -216(%ebp), %xmm1                             #2871.46
-..LN2519:
-        pand      %xmm1, %xmm0                                  #2871.22
-..LN2521:
-        movdqa    %xmm0, -264(%ebp)                             #2871.17
-..LN2523:
-        movdqa    -264(%ebp), %xmm0                             #2872.22
-        movdqa    -232(%ebp), %xmm1                             #2872.22
-        pcmpeqd   %xmm1, %xmm0                                  #2872.22
-..LN2525:
-        movdqa    %xmm0, -264(%ebp)                             #2872.17
-..LN2527:
-        movdqa    -264(%ebp), %xmm0                             #2873.42
-..LN2529:
-        pmovmskb  %xmm0, %eax                                   #2873.22
-..LN2531:
-        movl      %eax, -24(%ebp)                               #2873.17
-                                # LOE
-..B21.15:                       # Preds ..B21.7 ..B21.14
-..LN2533:
-        movdqa    -248(%ebp), %xmm0                             #2877.38
-..LN2535:
-        movdqa    -184(%ebp), %xmm1                             #2877.46
-..LN2537:
-        pand      %xmm1, %xmm0                                  #2877.22
-..LN2539:
-        movdqa    %xmm0, -264(%ebp)                             #2877.17
-..LN2541:
-        movdqa    -264(%ebp), %xmm0                             #2878.22
-        movdqa    -200(%ebp), %xmm1                             #2878.22
-        pcmpeqd   %xmm1, %xmm0                                  #2878.22
-..LN2543:
-        movdqa    %xmm0, -264(%ebp)                             #2878.17
-..LN2545:
-        movdqa    -264(%ebp), %xmm0                             #2879.42
-..LN2547:
-        pmovmskb  %xmm0, %eax                                   #2879.22
-..LN2549:
-        movl      %eax, -28(%ebp)                               #2879.17
-                                # LOE
-..B21.16:                       # Preds ..B21.8 ..B21.15
-..LN2551:
-        movdqa    -248(%ebp), %xmm0                             #2883.38
-..LN2553:
-        movdqa    -152(%ebp), %xmm1                             #2883.46
-..LN2555:
-        pand      %xmm1, %xmm0                                  #2883.22
-..LN2557:
-        movdqa    %xmm0, -264(%ebp)                             #2883.17
-..LN2559:
-        movdqa    -264(%ebp), %xmm0                             #2884.22
-        movdqa    -168(%ebp), %xmm1                             #2884.22
-        pcmpeqd   %xmm1, %xmm0                                  #2884.22
-..LN2561:
-        movdqa    %xmm0, -264(%ebp)                             #2884.17
-..LN2563:
-        movdqa    -264(%ebp), %xmm0                             #2885.42
-..LN2565:
-        pmovmskb  %xmm0, %eax                                   #2885.22
-..LN2567:
-        movl      %eax, -32(%ebp)                               #2885.17
-                                # LOE
-..B21.17:                       # Preds ..B21.9 ..B21.16
-..LN2569:
-        movdqa    -248(%ebp), %xmm0                             #2889.38
-..LN2571:
-        movdqa    -120(%ebp), %xmm1                             #2889.46
-..LN2573:
-        pand      %xmm1, %xmm0                                  #2889.22
-..LN2575:
-        movdqa    %xmm0, -264(%ebp)                             #2889.17
-..LN2577:
-        movdqa    -264(%ebp), %xmm0                             #2890.22
-        movdqa    -136(%ebp), %xmm1                             #2890.22
-        pcmpeqd   %xmm1, %xmm0                                  #2890.22
-..LN2579:
-        movdqa    %xmm0, -264(%ebp)                             #2890.17
-..LN2581:
-        movdqa    -264(%ebp), %xmm0                             #2891.42
-..LN2583:
-        pmovmskb  %xmm0, %eax                                   #2891.22
-..LN2585:
-        movl      %eax, -52(%ebp)                               #2891.17
-..LN2587:
-        movl      16(%ebx), %eax                                #2896.17
-        andl      $-4, %eax                                     #2896.17
-        movl      %eax, 16(%ebx)                                #2896.17
-..LN2589:
-        movl      -28(%ebp), %eax                               #2899.29
-        orl       -24(%ebp), %eax                               #2899.29
-..LN2591:
-        orl       -32(%ebp), %eax                               #2899.34
-..LN2593:
-        orl       -52(%ebp), %eax                               #2899.39
-..LN2595:
-        je        ..B21.34      # Prob 50%                      #2899.47
-                                # LOE
-..B21.18:                       # Preds ..B21.17
-..LN2597:
-        pushl     %edi                                          #2917.30
-..LN2599:
-        movl      -24(%ebp), %eax                               #2917.58
-        movw      %ax, (%esp)                                   #2917.58
-..LN2601:
-        call      uint16_lsbit                                  #2917.30
-                                # LOE eax
-..B21.51:                       # Preds ..B21.18
-        popl      %ecx                                          #2917.30
-        movl      %eax, -72(%ebp)                               #2917.30
-                                # LOE
-..B21.19:                       # Preds ..B21.51
-        movl      -72(%ebp), %eax                               #2917.30
-        movswl    %ax, %eax                                     #2917.30
-..LN2603:
-        movl      %eax, -88(%ebp)                               #2917.28
-..LN2605:
-        pushl     %edi                                          #2918.30
-..LN2607:
-        movl      -28(%ebp), %eax                               #2918.58
-        movw      %ax, (%esp)                                   #2918.58
-..LN2609:
-        call      uint16_lsbit                                  #2918.30
-                                # LOE eax
-..B21.52:                       # Preds ..B21.19
-        popl      %ecx                                          #2918.30
-        movl      %eax, -68(%ebp)                               #2918.30
-                                # LOE
-..B21.20:                       # Preds ..B21.52
-        movl      -68(%ebp), %eax                               #2918.30
-        movswl    %ax, %eax                                     #2918.30
-..LN2611:
-        movl      %eax, -84(%ebp)                               #2918.28
-..LN2613:
-        pushl     %edi                                          #2919.30
-..LN2615:
-        movl      -32(%ebp), %eax                               #2919.58
-        movw      %ax, (%esp)                                   #2919.58
-..LN2617:
-        call      uint16_lsbit                                  #2919.30
-                                # LOE eax
-..B21.53:                       # Preds ..B21.20
-        popl      %ecx                                          #2919.30
-        movl      %eax, -64(%ebp)                               #2919.30
-                                # LOE
-..B21.21:                       # Preds ..B21.53
-        movl      -64(%ebp), %eax                               #2919.30
-        movswl    %ax, %eax                                     #2919.30
-..LN2619:
-        movl      %eax, -80(%ebp)                               #2919.28
-..LN2621:
-        pushl     %edi                                          #2920.30
-..LN2623:
-        movl      -52(%ebp), %eax                               #2920.58
-        movw      %ax, (%esp)                                   #2920.58
-..LN2625:
-        call      uint16_lsbit                                  #2920.30
-                                # LOE eax
-..B21.54:                       # Preds ..B21.21
-        popl      %ecx                                          #2920.30
-        movl      %eax, -60(%ebp)                               #2920.30
-                                # LOE
-..B21.22:                       # Preds ..B21.54
-        movl      -60(%ebp), %eax                               #2920.30
-        movswl    %ax, %eax                                     #2920.30
-..LN2627:
-        movl      %eax, -76(%ebp)                               #2920.28
-..LN2629:
-        shll      $2, -88(%ebp)                                 #2925.34
-..LN2631:
-        movl      -84(%ebp), %eax                               #2926.28
-..LN2633:
-        lea       1(,%eax,4), %eax                              #2926.40
-..LN2635:
-        movl      %eax, -84(%ebp)                               #2926.21
-..LN2637:
-        movl      -80(%ebp), %eax                               #2927.28
-..LN2639:
-        lea       2(,%eax,4), %eax                              #2927.40
-..LN2641:
-        movl      %eax, -80(%ebp)                               #2927.21
-..LN2643:
-        movl      -76(%ebp), %eax                               #2928.28
-..LN2645:
-        lea       3(,%eax,4), %eax                              #2928.40
-..LN2647:
-        movl      %eax, -76(%ebp)                               #2928.21
-..LN2649:
-        movl      -24(%ebp), %eax                               #2932.26
-..LN2651:
-        testl     %eax, %eax                                    #2932.32
-        je        ..B21.25      # Prob 50%                      #2932.32
-                                # LOE
-..B21.23:                       # Preds ..B21.22
-..LN2653:
-        movl      -88(%ebp), %eax                               #2932.43
-        addl      16(%ebx), %eax                                #2932.43
-..LN2655:
-        movl      -44(%ebp), %edx                               #2932.49
-        cmpl      %edx, %eax                                    #2932.49
-        ja        ..B21.25      # Prob 50%                      #2932.49
-                                # LOE
-..B21.24:                       # Preds ..B21.23
-..LN2657:
-        movl      $1, %eax                                      #2932.63
-        leave                                                   #2932.63
-..___tag_value_eval_2na_32.489:                                 #
-        movl      %ebx, %esp                                    #2932.63
-        popl      %ebx                                          #2932.63
-..___tag_value_eval_2na_32.490:                                 #
-        ret                                                     #2932.63
-..___tag_value_eval_2na_32.492:                                 #
-                                # LOE
-..B21.25:                       # Preds ..B21.23 ..B21.22
-..LN2659:
-        movl      -28(%ebp), %eax                               #2933.26
-..LN2661:
-        testl     %eax, %eax                                    #2933.32
-        je        ..B21.28      # Prob 50%                      #2933.32
-                                # LOE
-..B21.26:                       # Preds ..B21.25
-..LN2663:
-        movl      -84(%ebp), %eax                               #2933.43
-        addl      16(%ebx), %eax                                #2933.43
-..LN2665:
-        movl      -44(%ebp), %edx                               #2933.49
-        cmpl      %edx, %eax                                    #2933.49
-        ja        ..B21.28      # Prob 50%                      #2933.49
-                                # LOE
-..B21.27:                       # Preds ..B21.26
-..LN2667:
-        movl      $1, %eax                                      #2933.63
-        leave                                                   #2933.63
-..___tag_value_eval_2na_32.496:                                 #
-        movl      %ebx, %esp                                    #2933.63
-        popl      %ebx                                          #2933.63
-..___tag_value_eval_2na_32.497:                                 #
-        ret                                                     #2933.63
-..___tag_value_eval_2na_32.499:                                 #
-                                # LOE
-..B21.28:                       # Preds ..B21.26 ..B21.25
-..LN2669:
-        movl      -32(%ebp), %eax                               #2934.26
-..LN2671:
-        testl     %eax, %eax                                    #2934.32
-        je        ..B21.31      # Prob 50%                      #2934.32
-                                # LOE
-..B21.29:                       # Preds ..B21.28
-..LN2673:
-        movl      -80(%ebp), %eax                               #2934.43
-        addl      16(%ebx), %eax                                #2934.43
-..LN2675:
-        movl      -44(%ebp), %edx                               #2934.49
-        cmpl      %edx, %eax                                    #2934.49
-        ja        ..B21.31      # Prob 50%                      #2934.49
-                                # LOE
-..B21.30:                       # Preds ..B21.29
-..LN2677:
-        movl      $1, %eax                                      #2934.63
-        leave                                                   #2934.63
-..___tag_value_eval_2na_32.503:                                 #
-        movl      %ebx, %esp                                    #2934.63
-        popl      %ebx                                          #2934.63
-..___tag_value_eval_2na_32.504:                                 #
-        ret                                                     #2934.63
-..___tag_value_eval_2na_32.506:                                 #
-                                # LOE
-..B21.31:                       # Preds ..B21.29 ..B21.28
-..LN2679:
-        movl      -52(%ebp), %eax                               #2935.26
-..LN2681:
-        testl     %eax, %eax                                    #2935.32
-        je        ..B21.34      # Prob 50%                      #2935.32
-                                # LOE
-..B21.32:                       # Preds ..B21.31
-..LN2683:
-        movl      -76(%ebp), %eax                               #2935.43
-        addl      16(%ebx), %eax                                #2935.43
-..LN2685:
-        movl      -44(%ebp), %edx                               #2935.49
-        cmpl      %edx, %eax                                    #2935.49
-        ja        ..B21.34      # Prob 50%                      #2935.49
-                                # LOE
-..B21.33:                       # Preds ..B21.32
-..LN2687:
-        movl      $1, %eax                                      #2935.63
-        leave                                                   #2935.63
-..___tag_value_eval_2na_32.510:                                 #
-        movl      %ebx, %esp                                    #2935.63
-        popl      %ebx                                          #2935.63
-..___tag_value_eval_2na_32.511:                                 #
-        ret                                                     #2935.63
-..___tag_value_eval_2na_32.513:                                 #
-                                # LOE
-..B21.34:                       # Preds ..B21.32 ..B21.31 ..B21.17
-..LN2689:
-        movl      16(%ebx), %eax                                #2940.17
-        addl      $4, %eax                                      #2940.17
-        movl      %eax, 16(%ebx)                                #2940.17
-..LN2691:
-        movl      16(%ebx), %eax                                #2943.22
-..LN2693:
-        movl      -44(%ebp), %edx                               #2943.28
-        cmpl      %edx, %eax                                    #2943.28
-        jbe       ..B21.36      # Prob 50%                      #2943.28
-                                # LOE
-..B21.35:                       # Preds ..B21.34
-..LN2695:
-        xorl      %eax, %eax                                    #2944.28
-        leave                                                   #2944.28
-..___tag_value_eval_2na_32.517:                                 #
-        movl      %ebx, %esp                                    #2944.28
-        popl      %ebx                                          #2944.28
-..___tag_value_eval_2na_32.518:                                 #
-        ret                                                     #2944.28
-..___tag_value_eval_2na_32.520:                                 #
-                                # LOE
-..B21.36:                       # Preds ..B21.34
-..LN2697:
-        movl      -20(%ebp), %eax                               #2947.25
-        decl      %eax                                          #2947.25
-        movl      %eax, -20(%ebp)                               #2947.25
-..LN2699:
-        je        ..B21.41      # Prob 50%                      #2947.39
-                                # LOE
-..B21.37:                       # Preds ..B21.36
-..LN2701:
-        movdqa    -248(%ebp), %xmm0                             #2952.43
-..LN2703:
-        psrldq    $1, %xmm0                                     #2952.26
-..LN2705:
-        movdqa    %xmm0, -248(%ebp)                             #2952.17
-..LN2707:
-        movl      -36(%ebp), %eax                               #2955.22
-..LN2709:
-        movl      -40(%ebp), %edx                               #2955.26
-        cmpl      %edx, %eax                                    #2955.26
-        jae       ..B21.39      # Prob 50%                      #2955.26
-                                # LOE
-..B21.38:                       # Preds ..B21.37
-..LN2711:
-        sarl      $8, -56(%ebp)                                 #2957.21
-..LN2713:
-        movl      -36(%ebp), %eax                               #2958.37
-        movzbl    (%eax), %eax                                  #2958.37
-        movzbl    %al, %eax                                     #2958.37
-..LN2715:
-        shll      $8, %eax                                      #2958.48
-..LN2717:
-        orl       -56(%ebp), %eax                               #2958.21
-        movl      %eax, -56(%ebp)                               #2958.21
-..LN2719:
-        movdqa    -248(%ebp), %xmm0                             #2959.49
-..LN2721:
-        movl      -56(%ebp), %eax                               #2959.57
-..LN2723:
-        pinsrw    $7, %eax, %xmm0                               #2959.30
-..LN2725:
-        movdqa    %xmm0, -248(%ebp)                             #2959.21
-                                # LOE
-..B21.39:                       # Preds ..B21.38 ..B21.37
-..LN2727:
-        incl      -36(%ebp)                                     #2963.20
-        jmp       ..B21.12      # Prob 100%                     #2963.20
-                                # LOE
-..B21.41:                       # Preds ..B21.36 ..B21.12
-..LN2729:
-        movl      -48(%ebp), %eax                               #2968.18
-..LN2731:
-        movl      -40(%ebp), %edx                               #2968.25
-        cmpl      %edx, %eax                                    #2968.25
-        jae       ..B21.46      # Prob 50%                      #2968.25
-                                # LOE
-..B21.42:                       # Preds ..B21.41
-..LN2733:
-        movl      16(%ebx), %eax                                #2972.13
-        addl      $48, %eax                                     #2972.13
-        movl      %eax, 16(%ebx)                                #2972.13
-..LN2735:
-        movl      16(%ebx), %eax                                #2973.18
-..LN2737:
-        movl      -44(%ebp), %edx                               #2973.24
-        cmpl      %edx, %eax                                    #2973.24
-        ja        ..B21.46      # Prob 50%                      #2973.24
-                                # LOE
-..B21.43:                       # Preds ..B21.42
-..LN2739:
-        addl      $-8, %esp                                     #2978.22
-..LN2741:
-        movl      -48(%ebp), %eax                               #2978.41
-        movl      %eax, (%esp)                                  #2978.41
-..LN2743:
-        movl      -40(%ebp), %eax                               #2978.46
-        movl      %eax, 4(%esp)                                 #2978.46
-..LN2745:
-        call      prime_buffer_2na                              #2978.22
-                                # LOE xmm0
-..B21.55:                       # Preds ..B21.43
-        addl      $8, %esp                                      #2978.22
-        movdqa    %xmm0, -280(%ebp)                             #2978.22
-                                # LOE
-..B21.44:                       # Preds ..B21.55
-..LN2747:
-        movdqa    -280(%ebp), %xmm0                             #2978.13
-        movdqa    %xmm0, -248(%ebp)                             #2978.13
-..LN2749:
-        addl      $16, -48(%ebp)                                #3056.13
-..LN2751:
-        movl      -48(%ebp), %eax                               #3058.17
-..LN2753:
-        movl      %eax, -36(%ebp)                               #3058.13
-..LN2755:
-        movl      -48(%ebp), %eax                               #3059.18
-..LN2757:
-        movl      -40(%ebp), %edx                               #3059.24
-        cmpl      %edx, %eax                                    #3059.24
-        jae       ..B21.10      # Prob 50%                      #3059.24
-                                # LOE
-..B21.45:                       # Preds ..B21.44
-..LN2759:
-        movl      -48(%ebp), %eax                               #3060.32
-        movzbl    -1(%eax), %eax                                #3060.32
-        movzbl    %al, %eax                                     #3060.32
-..LN2761:
-        shll      $8, %eax                                      #3060.46
-..LN2763:
-        movl      %eax, -56(%ebp)                               #3060.17
-        jmp       ..B21.10      # Prob 100%                     #3060.17
-                                # LOE
-..B21.46:                       # Preds ..B21.42 ..B21.41 ..B21.10
-..LN2765:
-        xorl      %eax, %eax                                    #3069.12
-        leave                                                   #3069.12
-..___tag_value_eval_2na_32.524:                                 #
-        movl      %ebx, %esp                                    #3069.12
-        popl      %ebx                                          #3069.12
-..___tag_value_eval_2na_32.525:                                 #
-        ret                                                     #3069.12
-        .align    2,0x90
-..___tag_value_eval_2na_32.527:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-.LNeval_2na_32:
-	.data
-# -- End  eval_2na_32
-	.section .rodata, "a"
-	.align 4
-__$U8:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	54
-	.byte	52
-	.byte	0
-	.type	__$U8, at object
-	.size	__$U8,12
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    2,0x90
-eval_2na_64:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B22.1:                        # Preds ..B22.0
-..___tag_value_eval_2na_64.530:                                 #
-..LN2767:
-        pushl     %ebx                                          #3075.1
-..___tag_value_eval_2na_64.535:                                 #
-        movl      %esp, %ebx                                    #3075.1
-..___tag_value_eval_2na_64.536:                                 #
-        andl      $-16, %esp                                    #3075.1
-        pushl     %ebp                                          #3075.1
-        pushl     %ebp                                          #3075.1
-        movl      4(%ebx), %ebp                                 #3075.1
-        movl      %ebp, 4(%esp)                                 #3075.1
-        movl      %esp, %ebp                                    #3075.1
-..___tag_value_eval_2na_64.538:                                 #
-        subl      $296, %esp                                    #3075.1
-        movl      %ebx, -296(%ebp)                              #3075.1
-..LN2769:
-        movl      8(%ebx), %eax                                 #3106.25
-        movl      4(%eax), %eax                                 #3106.25
-..LN2771:
-        movl      %eax, -12(%ebp)                               #3106.23
-..LN2773:
-        movl      20(%ebx), %eax                                #3109.5
-        movl      -12(%ebp), %edx                               #3109.5
-        cmpl      %edx, %eax                                    #3109.5
-        jae       ..B22.3       # Prob 50%                      #3109.5
-                                # LOE
-..B22.2:                        # Preds ..B22.1
-        call      ..L540        # Prob 100%                     #
-..L540:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L540], %eax     #
-        addl      $-16, %esp                                    #3109.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #3109.5
-        movl      %edx, (%esp)                                  #3109.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #3109.5
-        movl      %edx, 4(%esp)                                 #3109.5
-        movl      $3109, 8(%esp)                                #3109.5
-        lea       __$U8 at GOTOFF(%eax), %edx                      #3109.5
-        movl      %edx, 12(%esp)                                #3109.5
-        movl      %eax, %ebx                                    #3109.5
-..___tag_value_eval_2na_64.541:                                 #3109.5
-        call      __assert_fail at PLT                             #3109.5
-        movl      -296(%ebp), %ebx                              #3109.5
-..___tag_value_eval_2na_64.542:                                 #
-                                # LOE
-..B22.49:                       # Preds ..B22.2
-        addl      $16, %esp                                     #3109.5
-                                # LOE
-..B22.3:                        # Preds ..B22.1
-..LN2775:
-        movl      16(%ebx), %eax                                #3113.12
-..LN2777:
-        addl      20(%ebx), %eax                                #3113.5
-        movl      %eax, 20(%ebx)                                #3113.5
-..LN2779:
-        movl      16(%ebx), %eax                                #3116.42
-..LN2781:
-        shrl      $2, %eax                                      #3116.49
-..LN2783:
-        addl      12(%ebx), %eax                                #3116.30
-..LN2785:
-        movl      %eax, -48(%ebp)                               #3116.5
-..LN2787:
-        movl      -12(%ebp), %eax                               #3119.18
-        negl      %eax                                          #3119.18
-        addl      20(%ebx), %eax                                #3119.18
-..LN2789:
-        movl      %eax, -44(%ebp)                               #3119.5
-..LN2791:
-        movl      20(%ebx), %eax                                #3122.44
-..LN2793:
-        addl      $3, %eax                                      #3122.50
-..LN2795:
-        shrl      $2, %eax                                      #3122.57
-..LN2797:
-        addl      12(%ebx), %eax                                #3122.30
-..LN2799:
-        movl      %eax, -40(%ebp)                               #3122.5
-..LN2801:
-        addl      $-8, %esp                                     #3125.14
-..LN2803:
-        movl      -48(%ebp), %eax                               #3125.33
-        movl      %eax, (%esp)                                  #3125.33
-..LN2805:
-        movl      -40(%ebp), %eax                               #3125.38
-        movl      %eax, 4(%esp)                                 #3125.38
-..LN2807:
-        call      prime_buffer_2na                              #3125.14
-                                # LOE xmm0
-..B22.50:                       # Preds ..B22.3
-        addl      $8, %esp                                      #3125.14
-        movdqa    %xmm0, -104(%ebp)                             #3125.14
-                                # LOE
-..B22.4:                        # Preds ..B22.50
-..LN2809:
-        movdqa    -104(%ebp), %xmm0                             #3125.5
-        movdqa    %xmm0, -248(%ebp)                             #3125.5
-..LN2811:
-        addl      $16, -48(%ebp)                                #3126.5
-..LN2813:
-        movl      -48(%ebp), %eax                               #3128.9
-..LN2815:
-        movl      %eax, -36(%ebp)                               #3128.5
-..LN2817:
-        movl      -48(%ebp), %eax                               #3131.10
-..LN2819:
-        movl      -40(%ebp), %edx                               #3131.16
-        cmpl      %edx, %eax                                    #3131.16
-        jae       ..B22.6       # Prob 50%                      #3131.16
-                                # LOE
-..B22.5:                        # Preds ..B22.4
-..LN2821:
-        movl      -48(%ebp), %eax                               #3132.24
-        movzbl    -1(%eax), %eax                                #3132.24
-        movzbl    %al, %eax                                     #3132.24
-..LN2823:
-        shll      $8, %eax                                      #3132.38
-..LN2825:
-        movl      %eax, -56(%ebp)                               #3132.9
-                                # LOE
-..B22.6:                        # Preds ..B22.5 ..B22.4
-..LN2827:
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    16(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -232(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    32(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -216(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    48(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -200(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    64(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -184(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    80(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -168(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    96(%eax), %xmm0                               #3136.5
-        movdqa    %xmm0, -152(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    112(%eax), %xmm0                              #3136.5
-        movdqa    %xmm0, -136(%ebp)                             #3136.5
-        movl      8(%ebx), %eax                                 #3136.5
-        movdqa    128(%eax), %xmm0                              #3136.5
-        movdqa    %xmm0, -120(%ebp)                             #3136.5
-..LN2829:
-        xorl      %eax, %eax                                    #3139.15
-        movl      %eax, -32(%ebp)                               #3139.15
-..LN2831:
-        movl      %eax, -28(%ebp)                               #3139.10
-..LN2833:
-        movl      %eax, -24(%ebp)                               #3139.5
-..LN2835:
-        movl      $8, -20(%ebp)                                 #3143.5
-..LN2837:
-        movl      16(%ebx), %eax                                #3148.14
-..LN2839:
-        andl      $3, %eax                                      #3148.20
-        movl      %eax, -16(%ebp)                               #3148.20
-        je        ..B22.14      # Prob 50%                      #3148.20
-                                # LOE
-..B22.7:                        # Preds ..B22.6
-        movl      -16(%ebp), %eax                               #3148.20
-        cmpl      $1, %eax                                      #3148.20
-        je        ..B22.15      # Prob 50%                      #3148.20
-                                # LOE
-..B22.8:                        # Preds ..B22.7
-        movl      -16(%ebp), %eax                               #3148.20
-        cmpl      $2, %eax                                      #3148.20
-        je        ..B22.16      # Prob 50%                      #3148.20
-                                # LOE
-..B22.9:                        # Preds ..B22.8
-        movl      -16(%ebp), %eax                               #3148.20
-        cmpl      $3, %eax                                      #3148.20
-        je        ..B22.17      # Prob 50%                      #3148.20
-                                # LOE
-..B22.10:                       # Preds ..B22.45 ..B22.44 ..B22.9
-..LN2841:
-        movl      $1, %eax                                      #3153.9
-        testl     %eax, %eax                                    #3153.9
-        je        ..B22.46      # Prob 100%                     #3153.9
-                                # LOE
-..B22.11:                       # Preds ..B22.10
-..LN2843:
-        movl      $8, -20(%ebp)                                 #3155.13
-                                # LOE
-..B22.12:                       # Preds ..B22.39 ..B22.11
-..LN2845:
-        movl      $1, %eax                                      #3158.13
-        testl     %eax, %eax                                    #3158.13
-        je        ..B22.41      # Prob 100%                     #3158.13
-                                # LOE
-..B22.14:                       # Preds ..B22.6 ..B22.12
-..LN2847:
-        movdqa    -248(%ebp), %xmm0                             #3165.38
-..LN2849:
-        movdqa    -216(%ebp), %xmm1                             #3165.46
-..LN2851:
-        pand      %xmm1, %xmm0                                  #3165.22
-..LN2853:
-        movdqa    %xmm0, -264(%ebp)                             #3165.17
-..LN2855:
-        movdqa    -264(%ebp), %xmm0                             #3166.22
-        movdqa    -232(%ebp), %xmm1                             #3166.22
-        pcmpeqd   %xmm1, %xmm0                                  #3166.22
-..LN2857:
-        movdqa    %xmm0, -264(%ebp)                             #3166.17
-..LN2859:
-        movdqa    -264(%ebp), %xmm0                             #3167.42
-..LN2861:
-        pmovmskb  %xmm0, %eax                                   #3167.22
-..LN2863:
-        movl      %eax, -24(%ebp)                               #3167.17
-..LN2865:
-        movl      -24(%ebp), %eax                               #3168.17
-        andl      $3855, %eax                                   #3168.17
-        shll      $4, %eax                                      #3168.17
-        andl      -24(%ebp), %eax                               #3168.17
-        movl      %eax, -24(%ebp)                               #3168.17
-        movl      -24(%ebp), %eax                               #3168.17
-        sarl      $4, %eax                                      #3168.17
-        orl       -24(%ebp), %eax                               #3168.17
-        movl      %eax, -24(%ebp)                               #3168.17
-                                # LOE
-..B22.15:                       # Preds ..B22.7 ..B22.14
-..LN2867:
-        movdqa    -248(%ebp), %xmm0                             #3171.38
-..LN2869:
-        movdqa    -184(%ebp), %xmm1                             #3171.46
-..LN2871:
-        pand      %xmm1, %xmm0                                  #3171.22
-..LN2873:
-        movdqa    %xmm0, -264(%ebp)                             #3171.17
-..LN2875:
-        movdqa    -264(%ebp), %xmm0                             #3172.22
-        movdqa    -200(%ebp), %xmm1                             #3172.22
-        pcmpeqd   %xmm1, %xmm0                                  #3172.22
-..LN2877:
-        movdqa    %xmm0, -264(%ebp)                             #3172.17
-..LN2879:
-        movdqa    -264(%ebp), %xmm0                             #3173.42
-..LN2881:
-        pmovmskb  %xmm0, %eax                                   #3173.22
-..LN2883:
-        movl      %eax, -28(%ebp)                               #3173.17
-..LN2885:
-        movl      -28(%ebp), %eax                               #3174.17
-        andl      $3855, %eax                                   #3174.17
-        shll      $4, %eax                                      #3174.17
-        andl      -28(%ebp), %eax                               #3174.17
-        movl      %eax, -28(%ebp)                               #3174.17
-        movl      -28(%ebp), %eax                               #3174.17
-        sarl      $4, %eax                                      #3174.17
-        orl       -28(%ebp), %eax                               #3174.17
-        movl      %eax, -28(%ebp)                               #3174.17
-                                # LOE
-..B22.16:                       # Preds ..B22.8 ..B22.15
-..LN2887:
-        movdqa    -248(%ebp), %xmm0                             #3177.38
-..LN2889:
-        movdqa    -152(%ebp), %xmm1                             #3177.46
-..LN2891:
-        pand      %xmm1, %xmm0                                  #3177.22
-..LN2893:
-        movdqa    %xmm0, -264(%ebp)                             #3177.17
-..LN2895:
-        movdqa    -264(%ebp), %xmm0                             #3178.22
-        movdqa    -168(%ebp), %xmm1                             #3178.22
-        pcmpeqd   %xmm1, %xmm0                                  #3178.22
-..LN2897:
-        movdqa    %xmm0, -264(%ebp)                             #3178.17
-..LN2899:
-        movdqa    -264(%ebp), %xmm0                             #3179.42
-..LN2901:
-        pmovmskb  %xmm0, %eax                                   #3179.22
-..LN2903:
-        movl      %eax, -32(%ebp)                               #3179.17
-..LN2905:
-        movl      -32(%ebp), %eax                               #3180.17
-        andl      $3855, %eax                                   #3180.17
-        shll      $4, %eax                                      #3180.17
-        andl      -32(%ebp), %eax                               #3180.17
-        movl      %eax, -32(%ebp)                               #3180.17
-        movl      -32(%ebp), %eax                               #3180.17
-        sarl      $4, %eax                                      #3180.17
-        orl       -32(%ebp), %eax                               #3180.17
-        movl      %eax, -32(%ebp)                               #3180.17
-                                # LOE
-..B22.17:                       # Preds ..B22.9 ..B22.16
-..LN2907:
-        movdqa    -248(%ebp), %xmm0                             #3183.38
-..LN2909:
-        movdqa    -120(%ebp), %xmm1                             #3183.46
-..LN2911:
-        pand      %xmm1, %xmm0                                  #3183.22
-..LN2913:
-        movdqa    %xmm0, -264(%ebp)                             #3183.17
-..LN2915:
-        movdqa    -264(%ebp), %xmm0                             #3184.22
-        movdqa    -136(%ebp), %xmm1                             #3184.22
-        pcmpeqd   %xmm1, %xmm0                                  #3184.22
-..LN2917:
-        movdqa    %xmm0, -264(%ebp)                             #3184.17
-..LN2919:
-        movdqa    -264(%ebp), %xmm0                             #3185.42
-..LN2921:
-        pmovmskb  %xmm0, %eax                                   #3185.22
-..LN2923:
-        movl      %eax, -52(%ebp)                               #3185.17
-..LN2925:
-        movl      -52(%ebp), %eax                               #3186.17
-        andl      $3855, %eax                                   #3186.17
-        shll      $4, %eax                                      #3186.17
-        andl      -52(%ebp), %eax                               #3186.17
-        movl      %eax, -52(%ebp)                               #3186.17
-        movl      -52(%ebp), %eax                               #3186.17
-        sarl      $4, %eax                                      #3186.17
-        orl       -52(%ebp), %eax                               #3186.17
-        movl      %eax, -52(%ebp)                               #3186.17
-..LN2927:
-        movl      16(%ebx), %eax                                #3190.17
-        andl      $-4, %eax                                     #3190.17
-        movl      %eax, 16(%ebx)                                #3190.17
-..LN2929:
-        movl      -28(%ebp), %eax                               #3193.29
-        orl       -24(%ebp), %eax                               #3193.29
-..LN2931:
-        orl       -32(%ebp), %eax                               #3193.34
-..LN2933:
-        orl       -52(%ebp), %eax                               #3193.39
-..LN2935:
-        je        ..B22.34      # Prob 50%                      #3193.47
-                                # LOE
-..B22.18:                       # Preds ..B22.17
-..LN2937:
-        pushl     %edi                                          #3211.30
-..LN2939:
-        movl      -24(%ebp), %eax                               #3211.58
-        movw      %ax, (%esp)                                   #3211.58
-..LN2941:
-        call      uint16_lsbit                                  #3211.30
-                                # LOE eax
-..B22.51:                       # Preds ..B22.18
-        popl      %ecx                                          #3211.30
-        movl      %eax, -72(%ebp)                               #3211.30
-                                # LOE
-..B22.19:                       # Preds ..B22.51
-        movl      -72(%ebp), %eax                               #3211.30
-        movswl    %ax, %eax                                     #3211.30
-..LN2943:
-        movl      %eax, -88(%ebp)                               #3211.28
-..LN2945:
-        pushl     %edi                                          #3212.30
-..LN2947:
-        movl      -28(%ebp), %eax                               #3212.58
-        movw      %ax, (%esp)                                   #3212.58
-..LN2949:
-        call      uint16_lsbit                                  #3212.30
-                                # LOE eax
-..B22.52:                       # Preds ..B22.19
-        popl      %ecx                                          #3212.30
-        movl      %eax, -68(%ebp)                               #3212.30
-                                # LOE
-..B22.20:                       # Preds ..B22.52
-        movl      -68(%ebp), %eax                               #3212.30
-        movswl    %ax, %eax                                     #3212.30
-..LN2951:
-        movl      %eax, -84(%ebp)                               #3212.28
-..LN2953:
-        pushl     %edi                                          #3213.30
-..LN2955:
-        movl      -32(%ebp), %eax                               #3213.58
-        movw      %ax, (%esp)                                   #3213.58
-..LN2957:
-        call      uint16_lsbit                                  #3213.30
-                                # LOE eax
-..B22.53:                       # Preds ..B22.20
-        popl      %ecx                                          #3213.30
-        movl      %eax, -64(%ebp)                               #3213.30
-                                # LOE
-..B22.21:                       # Preds ..B22.53
-        movl      -64(%ebp), %eax                               #3213.30
-        movswl    %ax, %eax                                     #3213.30
-..LN2959:
-        movl      %eax, -80(%ebp)                               #3213.28
-..LN2961:
-        pushl     %edi                                          #3214.30
-..LN2963:
-        movl      -52(%ebp), %eax                               #3214.58
-        movw      %ax, (%esp)                                   #3214.58
-..LN2965:
-        call      uint16_lsbit                                  #3214.30
-                                # LOE eax
-..B22.54:                       # Preds ..B22.21
-        popl      %ecx                                          #3214.30
-        movl      %eax, -60(%ebp)                               #3214.30
-                                # LOE
-..B22.22:                       # Preds ..B22.54
-        movl      -60(%ebp), %eax                               #3214.30
-        movswl    %ax, %eax                                     #3214.30
-..LN2967:
-        movl      %eax, -76(%ebp)                               #3214.28
-..LN2969:
-        shll      $2, -88(%ebp)                                 #3219.34
-..LN2971:
-        movl      -84(%ebp), %eax                               #3220.28
-..LN2973:
-        lea       1(,%eax,4), %eax                              #3220.40
-..LN2975:
-        movl      %eax, -84(%ebp)                               #3220.21
-..LN2977:
-        movl      -80(%ebp), %eax                               #3221.28
-..LN2979:
-        lea       2(,%eax,4), %eax                              #3221.40
-..LN2981:
-        movl      %eax, -80(%ebp)                               #3221.21
-..LN2983:
-        movl      -76(%ebp), %eax                               #3222.28
-..LN2985:
-        lea       3(,%eax,4), %eax                              #3222.40
-..LN2987:
-        movl      %eax, -76(%ebp)                               #3222.21
-..LN2989:
-        movl      -24(%ebp), %eax                               #3226.26
-..LN2991:
-        testl     %eax, %eax                                    #3226.32
-        je        ..B22.25      # Prob 50%                      #3226.32
-                                # LOE
-..B22.23:                       # Preds ..B22.22
-..LN2993:
-        movl      -88(%ebp), %eax                               #3226.43
-        addl      16(%ebx), %eax                                #3226.43
-..LN2995:
-        movl      -44(%ebp), %edx                               #3226.49
-        cmpl      %edx, %eax                                    #3226.49
-        ja        ..B22.25      # Prob 50%                      #3226.49
-                                # LOE
-..B22.24:                       # Preds ..B22.23
-..LN2997:
-        movl      $1, %eax                                      #3226.63
-        leave                                                   #3226.63
-..___tag_value_eval_2na_64.544:                                 #
-        movl      %ebx, %esp                                    #3226.63
-        popl      %ebx                                          #3226.63
-..___tag_value_eval_2na_64.545:                                 #
-        ret                                                     #3226.63
-..___tag_value_eval_2na_64.547:                                 #
-                                # LOE
-..B22.25:                       # Preds ..B22.23 ..B22.22
-..LN2999:
-        movl      -28(%ebp), %eax                               #3227.26
-..LN3001:
-        testl     %eax, %eax                                    #3227.32
-        je        ..B22.28      # Prob 50%                      #3227.32
-                                # LOE
-..B22.26:                       # Preds ..B22.25
-..LN3003:
-        movl      -84(%ebp), %eax                               #3227.43
-        addl      16(%ebx), %eax                                #3227.43
-..LN3005:
-        movl      -44(%ebp), %edx                               #3227.49
-        cmpl      %edx, %eax                                    #3227.49
-        ja        ..B22.28      # Prob 50%                      #3227.49
-                                # LOE
-..B22.27:                       # Preds ..B22.26
-..LN3007:
-        movl      $1, %eax                                      #3227.63
-        leave                                                   #3227.63
-..___tag_value_eval_2na_64.551:                                 #
-        movl      %ebx, %esp                                    #3227.63
-        popl      %ebx                                          #3227.63
-..___tag_value_eval_2na_64.552:                                 #
-        ret                                                     #3227.63
-..___tag_value_eval_2na_64.554:                                 #
-                                # LOE
-..B22.28:                       # Preds ..B22.26 ..B22.25
-..LN3009:
-        movl      -32(%ebp), %eax                               #3228.26
-..LN3011:
-        testl     %eax, %eax                                    #3228.32
-        je        ..B22.31      # Prob 50%                      #3228.32
-                                # LOE
-..B22.29:                       # Preds ..B22.28
-..LN3013:
-        movl      -80(%ebp), %eax                               #3228.43
-        addl      16(%ebx), %eax                                #3228.43
-..LN3015:
-        movl      -44(%ebp), %edx                               #3228.49
-        cmpl      %edx, %eax                                    #3228.49
-        ja        ..B22.31      # Prob 50%                      #3228.49
-                                # LOE
-..B22.30:                       # Preds ..B22.29
-..LN3017:
-        movl      $1, %eax                                      #3228.63
-        leave                                                   #3228.63
-..___tag_value_eval_2na_64.558:                                 #
-        movl      %ebx, %esp                                    #3228.63
-        popl      %ebx                                          #3228.63
-..___tag_value_eval_2na_64.559:                                 #
-        ret                                                     #3228.63
-..___tag_value_eval_2na_64.561:                                 #
-                                # LOE
-..B22.31:                       # Preds ..B22.29 ..B22.28
-..LN3019:
-        movl      -52(%ebp), %eax                               #3229.26
-..LN3021:
-        testl     %eax, %eax                                    #3229.32
-        je        ..B22.34      # Prob 50%                      #3229.32
-                                # LOE
-..B22.32:                       # Preds ..B22.31
-..LN3023:
-        movl      -76(%ebp), %eax                               #3229.43
-        addl      16(%ebx), %eax                                #3229.43
-..LN3025:
-        movl      -44(%ebp), %edx                               #3229.49
-        cmpl      %edx, %eax                                    #3229.49
-        ja        ..B22.34      # Prob 50%                      #3229.49
-                                # LOE
-..B22.33:                       # Preds ..B22.32
-..LN3027:
-        movl      $1, %eax                                      #3229.63
-        leave                                                   #3229.63
-..___tag_value_eval_2na_64.565:                                 #
-        movl      %ebx, %esp                                    #3229.63
-        popl      %ebx                                          #3229.63
-..___tag_value_eval_2na_64.566:                                 #
-        ret                                                     #3229.63
-..___tag_value_eval_2na_64.568:                                 #
-                                # LOE
-..B22.34:                       # Preds ..B22.32 ..B22.31 ..B22.17
-..LN3029:
-        movl      16(%ebx), %eax                                #3234.17
-        addl      $4, %eax                                      #3234.17
-        movl      %eax, 16(%ebx)                                #3234.17
-..LN3031:
-        movl      16(%ebx), %eax                                #3237.22
-..LN3033:
-        movl      -44(%ebp), %edx                               #3237.28
-        cmpl      %edx, %eax                                    #3237.28
-        jbe       ..B22.36      # Prob 50%                      #3237.28
-                                # LOE
-..B22.35:                       # Preds ..B22.34
-..LN3035:
-        xorl      %eax, %eax                                    #3238.28
-        leave                                                   #3238.28
-..___tag_value_eval_2na_64.572:                                 #
-        movl      %ebx, %esp                                    #3238.28
-        popl      %ebx                                          #3238.28
-..___tag_value_eval_2na_64.573:                                 #
-        ret                                                     #3238.28
-..___tag_value_eval_2na_64.575:                                 #
-                                # LOE
-..B22.36:                       # Preds ..B22.34
-..LN3037:
-        movl      -20(%ebp), %eax                               #3241.25
-        decl      %eax                                          #3241.25
-        movl      %eax, -20(%ebp)                               #3241.25
-..LN3039:
-        je        ..B22.41      # Prob 50%                      #3241.39
-                                # LOE
-..B22.37:                       # Preds ..B22.36
-..LN3041:
-        movdqa    -248(%ebp), %xmm0                             #3246.43
-..LN3043:
-        psrldq    $1, %xmm0                                     #3246.26
-..LN3045:
-        movdqa    %xmm0, -248(%ebp)                             #3246.17
-..LN3047:
-        movl      -36(%ebp), %eax                               #3249.22
-..LN3049:
-        movl      -40(%ebp), %edx                               #3249.26
-        cmpl      %edx, %eax                                    #3249.26
-        jae       ..B22.39      # Prob 50%                      #3249.26
-                                # LOE
-..B22.38:                       # Preds ..B22.37
-..LN3051:
-        sarl      $8, -56(%ebp)                                 #3251.21
-..LN3053:
-        movl      -36(%ebp), %eax                               #3252.37
-        movzbl    (%eax), %eax                                  #3252.37
-        movzbl    %al, %eax                                     #3252.37
-..LN3055:
-        shll      $8, %eax                                      #3252.48
-..LN3057:
-        orl       -56(%ebp), %eax                               #3252.21
-        movl      %eax, -56(%ebp)                               #3252.21
-..LN3059:
-        movdqa    -248(%ebp), %xmm0                             #3253.49
-..LN3061:
-        movl      -56(%ebp), %eax                               #3253.57
-..LN3063:
-        pinsrw    $7, %eax, %xmm0                               #3253.30
-..LN3065:
-        movdqa    %xmm0, -248(%ebp)                             #3253.21
-                                # LOE
-..B22.39:                       # Preds ..B22.38 ..B22.37
-..LN3067:
-        incl      -36(%ebp)                                     #3257.20
-        jmp       ..B22.12      # Prob 100%                     #3257.20
-                                # LOE
-..B22.41:                       # Preds ..B22.36 ..B22.12
-..LN3069:
-        movl      -48(%ebp), %eax                               #3262.18
-..LN3071:
-        movl      -40(%ebp), %edx                               #3262.25
-        cmpl      %edx, %eax                                    #3262.25
-        jae       ..B22.46      # Prob 50%                      #3262.25
-                                # LOE
-..B22.42:                       # Preds ..B22.41
-..LN3073:
-        movl      16(%ebx), %eax                                #3266.13
-        addl      $32, %eax                                     #3266.13
-        movl      %eax, 16(%ebx)                                #3266.13
-..LN3075:
-        movl      16(%ebx), %eax                                #3267.18
-..LN3077:
-        movl      -44(%ebp), %edx                               #3267.24
-        cmpl      %edx, %eax                                    #3267.24
-        ja        ..B22.46      # Prob 50%                      #3267.24
-                                # LOE
-..B22.43:                       # Preds ..B22.42
-..LN3079:
-        addl      $-8, %esp                                     #3272.22
-..LN3081:
-        movl      -48(%ebp), %eax                               #3272.41
-        movl      %eax, (%esp)                                  #3272.41
-..LN3083:
-        movl      -40(%ebp), %eax                               #3272.46
-        movl      %eax, 4(%esp)                                 #3272.46
-..LN3085:
-        call      prime_buffer_2na                              #3272.22
-                                # LOE xmm0
-..B22.55:                       # Preds ..B22.43
-        addl      $8, %esp                                      #3272.22
-        movdqa    %xmm0, -280(%ebp)                             #3272.22
-                                # LOE
-..B22.44:                       # Preds ..B22.55
-..LN3087:
-        movdqa    -280(%ebp), %xmm0                             #3272.13
-        movdqa    %xmm0, -248(%ebp)                             #3272.13
-..LN3089:
-        addl      $16, -48(%ebp)                                #3350.13
-..LN3091:
-        movl      -48(%ebp), %eax                               #3352.17
-..LN3093:
-        movl      %eax, -36(%ebp)                               #3352.13
-..LN3095:
-        movl      -48(%ebp), %eax                               #3353.18
-..LN3097:
-        movl      -40(%ebp), %edx                               #3353.24
-        cmpl      %edx, %eax                                    #3353.24
-        jae       ..B22.10      # Prob 50%                      #3353.24
-                                # LOE
-..B22.45:                       # Preds ..B22.44
-..LN3099:
-        movl      -48(%ebp), %eax                               #3354.32
-        movzbl    -1(%eax), %eax                                #3354.32
-        movzbl    %al, %eax                                     #3354.32
-..LN3101:
-        shll      $8, %eax                                      #3354.46
-..LN3103:
-        movl      %eax, -56(%ebp)                               #3354.17
-        jmp       ..B22.10      # Prob 100%                     #3354.17
-                                # LOE
-..B22.46:                       # Preds ..B22.42 ..B22.41 ..B22.10
-..LN3105:
-        xorl      %eax, %eax                                    #3363.12
-        leave                                                   #3363.12
-..___tag_value_eval_2na_64.579:                                 #
-        movl      %ebx, %esp                                    #3363.12
-        popl      %ebx                                          #3363.12
-..___tag_value_eval_2na_64.580:                                 #
-        ret                                                     #3363.12
-        .align    2,0x90
-..___tag_value_eval_2na_64.582:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-.LNeval_2na_64:
-	.data
-# -- End  eval_2na_64
-	.section .rodata, "a"
-	.align 4
-__$U9:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	50
-	.byte	56
-	.byte	0
-	.type	__$U9, at object
-	.size	__$U9,13
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    2,0x90
-eval_2na_128:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B23.1:                        # Preds ..B23.0
-..___tag_value_eval_2na_128.585:                                #
-..LN3107:
-        pushl     %ebx                                          #3369.1
-..___tag_value_eval_2na_128.590:                                #
-        movl      %esp, %ebx                                    #3369.1
-..___tag_value_eval_2na_128.591:                                #
-        andl      $-16, %esp                                    #3369.1
-        pushl     %ebp                                          #3369.1
-        pushl     %ebp                                          #3369.1
-        movl      4(%ebx), %ebp                                 #3369.1
-        movl      %ebp, 4(%esp)                                 #3369.1
-        movl      %esp, %ebp                                    #3369.1
-..___tag_value_eval_2na_128.593:                                #
-        subl      $264, %esp                                    #3369.1
-        movl      %ebx, -264(%ebp)                              #3369.1
-..LN3109:
-        movl      8(%ebx), %eax                                 #3399.25
-        movl      4(%eax), %eax                                 #3399.25
-..LN3111:
-        movl      %eax, -8(%ebp)                                #3399.23
-..LN3113:
-        movl      20(%ebx), %eax                                #3402.5
-        movl      -8(%ebp), %edx                                #3402.5
-        cmpl      %edx, %eax                                    #3402.5
-        jae       ..B23.3       # Prob 50%                      #3402.5
-                                # LOE
-..B23.2:                        # Preds ..B23.1
-        call      ..L595        # Prob 100%                     #
-..L595:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L595], %eax     #
-        addl      $-16, %esp                                    #3402.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #3402.5
-        movl      %edx, (%esp)                                  #3402.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #3402.5
-        movl      %edx, 4(%esp)                                 #3402.5
-        movl      $3402, 8(%esp)                                #3402.5
-        lea       __$U9 at GOTOFF(%eax), %edx                      #3402.5
-        movl      %edx, 12(%esp)                                #3402.5
-        movl      %eax, %ebx                                    #3402.5
-..___tag_value_eval_2na_128.596:                                #3402.5
-        call      __assert_fail at PLT                             #3402.5
-        movl      -264(%ebp), %ebx                              #3402.5
-..___tag_value_eval_2na_128.597:                                #
-                                # LOE
-..B23.44:                       # Preds ..B23.2
-        addl      $16, %esp                                     #3402.5
-                                # LOE
-..B23.3:                        # Preds ..B23.1
-..LN3115:
-        movl      16(%ebx), %eax                                #3406.12
-..LN3117:
-        addl      20(%ebx), %eax                                #3406.5
-        movl      %eax, 20(%ebx)                                #3406.5
-..LN3119:
-        movl      16(%ebx), %eax                                #3409.42
-..LN3121:
-        shrl      $2, %eax                                      #3409.49
-..LN3123:
-        addl      12(%ebx), %eax                                #3409.30
-..LN3125:
-        movl      %eax, -44(%ebp)                               #3409.5
-..LN3127:
-        movl      -8(%ebp), %eax                                #3412.18
-        negl      %eax                                          #3412.18
-        addl      20(%ebx), %eax                                #3412.18
-..LN3129:
-        movl      %eax, -40(%ebp)                               #3412.5
-..LN3131:
-        movl      20(%ebx), %eax                                #3415.44
-..LN3133:
-        addl      $3, %eax                                      #3415.50
-..LN3135:
-        shrl      $2, %eax                                      #3415.57
-..LN3137:
-        addl      12(%ebx), %eax                                #3415.30
-..LN3139:
-        movl      %eax, -36(%ebp)                               #3415.5
-..LN3141:
-        addl      $-8, %esp                                     #3418.14
-..LN3143:
-        movl      -44(%ebp), %eax                               #3418.33
-        movl      %eax, (%esp)                                  #3418.33
-..LN3145:
-        movl      -36(%ebp), %eax                               #3418.38
-        movl      %eax, 4(%esp)                                 #3418.38
-..LN3147:
-        call      prime_buffer_2na                              #3418.14
-                                # LOE xmm0
-..B23.45:                       # Preds ..B23.3
-        addl      $8, %esp                                      #3418.14
-        movdqa    %xmm0, -72(%ebp)                              #3418.14
-                                # LOE
-..B23.4:                        # Preds ..B23.45
-..LN3149:
-        movdqa    -72(%ebp), %xmm0                              #3418.5
-        movdqa    %xmm0, -216(%ebp)                             #3418.5
-..LN3151:
-        addl      $16, -44(%ebp)                                #3419.5
-..LN3153:
-        movl      -44(%ebp), %eax                               #3421.9
-..LN3155:
-        movl      %eax, -32(%ebp)                               #3421.5
-..LN3157:
-        movl      -44(%ebp), %eax                               #3424.10
-..LN3159:
-        movl      -36(%ebp), %edx                               #3424.16
-        cmpl      %edx, %eax                                    #3424.16
-        jae       ..B23.6       # Prob 50%                      #3424.16
-                                # LOE
-..B23.5:                        # Preds ..B23.4
-..LN3161:
-        movl      -44(%ebp), %eax                               #3425.24
-        movzbl    -1(%eax), %eax                                #3425.24
-        movzbl    %al, %eax                                     #3425.24
-..LN3163:
-        shll      $8, %eax                                      #3425.38
-..LN3165:
-        movl      %eax, -52(%ebp)                               #3425.9
-                                # LOE
-..B23.6:                        # Preds ..B23.5 ..B23.4
-..LN3167:
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    16(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -200(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    32(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -184(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    48(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -168(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    64(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -152(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    80(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -136(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    96(%eax), %xmm0                               #3429.5
-        movdqa    %xmm0, -120(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    112(%eax), %xmm0                              #3429.5
-        movdqa    %xmm0, -104(%ebp)                             #3429.5
-        movl      8(%ebx), %eax                                 #3429.5
-        movdqa    128(%eax), %xmm0                              #3429.5
-        movdqa    %xmm0, -88(%ebp)                              #3429.5
-..LN3169:
-        xorl      %eax, %eax                                    #3432.15
-        movl      %eax, -28(%ebp)                               #3432.15
-..LN3171:
-        movl      %eax, -24(%ebp)                               #3432.10
-..LN3173:
-        movl      %eax, -20(%ebp)                               #3432.5
-..LN3175:
-        movl      16(%ebx), %eax                                #3434.27
-        negl      %eax                                          #3434.27
-..LN3177:
-        movl      -40(%ebp), %edx                               #3434.20
-..LN3179:
-        lea       7(%edx,%eax), %eax                            #3434.33
-..LN3181:
-        shrl      $2, %eax                                      #3434.40
-..LN3183:
-        movl      %eax, -16(%ebp)                               #3434.5
-..LN3185:
-        movl      16(%ebx), %eax                                #3441.14
-..LN3187:
-        andl      $3, %eax                                      #3441.20
-        movl      %eax, -12(%ebp)                               #3441.20
-        je        ..B23.14      # Prob 50%                      #3441.20
-                                # LOE
-..B23.7:                        # Preds ..B23.6
-        movl      -12(%ebp), %eax                               #3441.20
-        cmpl      $1, %eax                                      #3441.20
-        je        ..B23.15      # Prob 50%                      #3441.20
-                                # LOE
-..B23.8:                        # Preds ..B23.7
-        movl      -12(%ebp), %eax                               #3441.20
-        cmpl      $2, %eax                                      #3441.20
-        je        ..B23.16      # Prob 50%                      #3441.20
-                                # LOE
-..B23.9:                        # Preds ..B23.8
-        movl      -12(%ebp), %eax                               #3441.20
-        cmpl      $3, %eax                                      #3441.20
-        je        ..B23.17      # Prob 50%                      #3441.20
-                                # LOE
-..B23.10:                       # Preds ..B23.40 ..B23.39 ..B23.9
-..LN3189:
-        movl      $1, %eax                                      #3446.9
-        testl     %eax, %eax                                    #3446.9
-        je        ..B23.41      # Prob 100%                     #3446.9
-                                # LOE
-..B23.11:                       # Preds ..B23.10
-..LN3191:
-        movl      $16, -16(%ebp)                                #3448.13
-                                # LOE
-..B23.12:                       # Preds ..B23.34 ..B23.11
-..LN3193:
-        movl      $1, %eax                                      #3451.13
-        testl     %eax, %eax                                    #3451.13
-        je        ..B23.36      # Prob 100%                     #3451.13
-                                # LOE
-..B23.14:                       # Preds ..B23.6 ..B23.12
-..LN3195:
-        movdqa    -216(%ebp), %xmm0                             #3458.38
-..LN3197:
-        movdqa    -184(%ebp), %xmm1                             #3458.46
-..LN3199:
-        pand      %xmm1, %xmm0                                  #3458.22
-..LN3201:
-        movdqa    %xmm0, -232(%ebp)                             #3458.17
-..LN3203:
-        movdqa    -232(%ebp), %xmm0                             #3459.22
-        movdqa    -200(%ebp), %xmm1                             #3459.22
-        pcmpeqd   %xmm1, %xmm0                                  #3459.22
-..LN3205:
-        movdqa    %xmm0, -232(%ebp)                             #3459.17
-..LN3207:
-        movdqa    -232(%ebp), %xmm0                             #3460.42
-..LN3209:
-        pmovmskb  %xmm0, %eax                                   #3460.22
-..LN3211:
-        movl      %eax, -20(%ebp)                               #3460.17
-..LN3213:
-        movl      -20(%ebp), %eax                               #3461.17
-        incl      %eax                                          #3461.17
-        sarl      $16, %eax                                     #3461.17
-        negl      %eax                                          #3461.17
-        movl      %eax, -20(%ebp)                               #3461.17
-                                # LOE
-..B23.15:                       # Preds ..B23.7 ..B23.14
-..LN3215:
-        movdqa    -216(%ebp), %xmm0                             #3464.38
-..LN3217:
-        movdqa    -152(%ebp), %xmm1                             #3464.46
-..LN3219:
-        pand      %xmm1, %xmm0                                  #3464.22
-..LN3221:
-        movdqa    %xmm0, -232(%ebp)                             #3464.17
-..LN3223:
-        movdqa    -232(%ebp), %xmm0                             #3465.22
-        movdqa    -168(%ebp), %xmm1                             #3465.22
-        pcmpeqd   %xmm1, %xmm0                                  #3465.22
-..LN3225:
-        movdqa    %xmm0, -232(%ebp)                             #3465.17
-..LN3227:
-        movdqa    -232(%ebp), %xmm0                             #3466.42
-..LN3229:
-        pmovmskb  %xmm0, %eax                                   #3466.22
-..LN3231:
-        movl      %eax, -24(%ebp)                               #3466.17
-..LN3233:
-        movl      -24(%ebp), %eax                               #3467.17
-        incl      %eax                                          #3467.17
-        sarl      $16, %eax                                     #3467.17
-        negl      %eax                                          #3467.17
-        movl      %eax, -24(%ebp)                               #3467.17
-                                # LOE
-..B23.16:                       # Preds ..B23.8 ..B23.15
-..LN3235:
-        movdqa    -216(%ebp), %xmm0                             #3470.38
-..LN3237:
-        movdqa    -120(%ebp), %xmm1                             #3470.46
-..LN3239:
-        pand      %xmm1, %xmm0                                  #3470.22
-..LN3241:
-        movdqa    %xmm0, -232(%ebp)                             #3470.17
-..LN3243:
-        movdqa    -232(%ebp), %xmm0                             #3471.22
-        movdqa    -136(%ebp), %xmm1                             #3471.22
-        pcmpeqd   %xmm1, %xmm0                                  #3471.22
-..LN3245:
-        movdqa    %xmm0, -232(%ebp)                             #3471.17
-..LN3247:
-        movdqa    -232(%ebp), %xmm0                             #3472.42
-..LN3249:
-        pmovmskb  %xmm0, %eax                                   #3472.22
-..LN3251:
-        movl      %eax, -28(%ebp)                               #3472.17
-..LN3253:
-        movl      -28(%ebp), %eax                               #3473.17
-        incl      %eax                                          #3473.17
-        sarl      $16, %eax                                     #3473.17
-        negl      %eax                                          #3473.17
-        movl      %eax, -28(%ebp)                               #3473.17
-                                # LOE
-..B23.17:                       # Preds ..B23.9 ..B23.16
-..LN3255:
-        movdqa    -216(%ebp), %xmm0                             #3476.38
-..LN3257:
-        movdqa    -88(%ebp), %xmm1                              #3476.46
-..LN3259:
-        pand      %xmm1, %xmm0                                  #3476.22
-..LN3261:
-        movdqa    %xmm0, -232(%ebp)                             #3476.17
-..LN3263:
-        movdqa    -232(%ebp), %xmm0                             #3477.22
-        movdqa    -104(%ebp), %xmm1                             #3477.22
-        pcmpeqd   %xmm1, %xmm0                                  #3477.22
-..LN3265:
-        movdqa    %xmm0, -232(%ebp)                             #3477.17
-..LN3267:
-        movdqa    -232(%ebp), %xmm0                             #3478.42
-..LN3269:
-        pmovmskb  %xmm0, %eax                                   #3478.22
-..LN3271:
-        movl      %eax, -48(%ebp)                               #3478.17
-..LN3273:
-        movl      -48(%ebp), %eax                               #3479.17
-        incl      %eax                                          #3479.17
-        sarl      $16, %eax                                     #3479.17
-        negl      %eax                                          #3479.17
-        movl      %eax, -48(%ebp)                               #3479.17
-..LN3275:
-        movl      16(%ebx), %eax                                #3483.17
-        andl      $-4, %eax                                     #3483.17
-        movl      %eax, 16(%ebx)                                #3483.17
-..LN3277:
-        movl      -24(%ebp), %eax                               #3486.29
-        orl       -20(%ebp), %eax                               #3486.29
-..LN3279:
-        orl       -28(%ebp), %eax                               #3486.34
-..LN3281:
-        orl       -48(%ebp), %eax                               #3486.39
-..LN3283:
-        je        ..B23.29      # Prob 50%                      #3486.47
-                                # LOE
-..B23.18:                       # Preds ..B23.17
-..LN3285:
-        movl      16(%ebx), %eax                                #3489.37
-        negl      %eax                                          #3489.37
-        addl      -40(%ebp), %eax                               #3489.37
-        movl      %eax, -56(%ebp)                               #3489.37
-        cmpl      $2, %eax                                      #3489.37
-        je        ..B23.22      # Prob 50%                      #3489.37
-                                # LOE
-..B23.19:                       # Preds ..B23.18
-        movl      -56(%ebp), %eax                               #3489.37
-        cmpl      $1, %eax                                      #3489.37
-        je        ..B23.24      # Prob 50%                      #3489.37
-                                # LOE
-..B23.20:                       # Preds ..B23.19
-        movl      -56(%ebp), %eax                               #3489.37
-        testl     %eax, %eax                                    #3489.37
-        je        ..B23.26      # Prob 50%                      #3489.37
-                                # LOE
-..B23.21:                       # Preds ..B23.20
-..LN3287:
-        movl      $1, %eax                                      #3492.32
-        leave                                                   #3492.32
-..___tag_value_eval_2na_128.599:                                #
-        movl      %ebx, %esp                                    #3492.32
-        popl      %ebx                                          #3492.32
-..___tag_value_eval_2na_128.600:                                #
-        ret                                                     #3492.32
-..___tag_value_eval_2na_128.602:                                #
-                                # LOE
-..B23.22:                       # Preds ..B23.18
-..LN3289:
-        movl      -28(%ebp), %eax                               #3494.30
-..LN3291:
-        testl     %eax, %eax                                    #3494.36
-        je        ..B23.24      # Prob 50%                      #3494.36
-                                # LOE
-..B23.23:                       # Preds ..B23.22
-..LN3293:
-        movl      $1, %eax                                      #3494.47
-        leave                                                   #3494.47
-..___tag_value_eval_2na_128.606:                                #
-        movl      %ebx, %esp                                    #3494.47
-        popl      %ebx                                          #3494.47
-..___tag_value_eval_2na_128.607:                                #
-        ret                                                     #3494.47
-..___tag_value_eval_2na_128.609:                                #
-                                # LOE
-..B23.24:                       # Preds ..B23.22 ..B23.19
-..LN3295:
-        movl      -24(%ebp), %eax                               #3496.30
-..LN3297:
-        testl     %eax, %eax                                    #3496.36
-        je        ..B23.26      # Prob 50%                      #3496.36
-                                # LOE
-..B23.25:                       # Preds ..B23.24
-..LN3299:
-        movl      $1, %eax                                      #3496.47
-        leave                                                   #3496.47
-..___tag_value_eval_2na_128.613:                                #
-        movl      %ebx, %esp                                    #3496.47
-        popl      %ebx                                          #3496.47
-..___tag_value_eval_2na_128.614:                                #
-        ret                                                     #3496.47
-..___tag_value_eval_2na_128.616:                                #
-                                # LOE
-..B23.26:                       # Preds ..B23.24 ..B23.20
-..LN3301:
-        movl      -20(%ebp), %eax                               #3498.30
-..LN3303:
-        testl     %eax, %eax                                    #3498.36
-        je        ..B23.28      # Prob 50%                      #3498.36
-                                # LOE
-..B23.27:                       # Preds ..B23.26
-..LN3305:
-        movl      $1, %eax                                      #3498.47
-        leave                                                   #3498.47
-..___tag_value_eval_2na_128.620:                                #
-        movl      %ebx, %esp                                    #3498.47
-        popl      %ebx                                          #3498.47
-..___tag_value_eval_2na_128.621:                                #
-        ret                                                     #3498.47
-..___tag_value_eval_2na_128.623:                                #
-                                # LOE
-..B23.28:                       # Preds ..B23.26
-..LN3307:
-        xorl      %eax, %eax                                    #3500.28
-        leave                                                   #3500.28
-..___tag_value_eval_2na_128.627:                                #
-        movl      %ebx, %esp                                    #3500.28
-        popl      %ebx                                          #3500.28
-..___tag_value_eval_2na_128.628:                                #
-        ret                                                     #3500.28
-..___tag_value_eval_2na_128.630:                                #
-                                # LOE
-..B23.29:                       # Preds ..B23.17
-..LN3309:
-        movl      16(%ebx), %eax                                #3527.17
-        addl      $4, %eax                                      #3527.17
-        movl      %eax, 16(%ebx)                                #3527.17
-..LN3311:
-        movl      16(%ebx), %eax                                #3530.22
-..LN3313:
-        movl      -40(%ebp), %edx                               #3530.28
-        cmpl      %edx, %eax                                    #3530.28
-        jbe       ..B23.31      # Prob 50%                      #3530.28
-                                # LOE
-..B23.30:                       # Preds ..B23.29
-..LN3315:
-        xorl      %eax, %eax                                    #3531.28
-        leave                                                   #3531.28
-..___tag_value_eval_2na_128.634:                                #
-        movl      %ebx, %esp                                    #3531.28
-        popl      %ebx                                          #3531.28
-..___tag_value_eval_2na_128.635:                                #
-        ret                                                     #3531.28
-..___tag_value_eval_2na_128.637:                                #
-                                # LOE
-..B23.31:                       # Preds ..B23.29
-..LN3317:
-        movl      -16(%ebp), %eax                               #3534.25
-        decl      %eax                                          #3534.25
-        movl      %eax, -16(%ebp)                               #3534.25
-..LN3319:
-        je        ..B23.36      # Prob 50%                      #3534.39
-                                # LOE
-..B23.32:                       # Preds ..B23.31
-..LN3321:
-        movdqa    -216(%ebp), %xmm0                             #3539.43
-..LN3323:
-        psrldq    $1, %xmm0                                     #3539.26
-..LN3325:
-        movdqa    %xmm0, -216(%ebp)                             #3539.17
-..LN3327:
-        movl      -32(%ebp), %eax                               #3542.22
-..LN3329:
-        movl      -36(%ebp), %edx                               #3542.26
-        cmpl      %edx, %eax                                    #3542.26
-        jae       ..B23.34      # Prob 50%                      #3542.26
-                                # LOE
-..B23.33:                       # Preds ..B23.32
-..LN3331:
-        sarl      $8, -52(%ebp)                                 #3544.21
-..LN3333:
-        movl      -32(%ebp), %eax                               #3545.37
-        movzbl    (%eax), %eax                                  #3545.37
-        movzbl    %al, %eax                                     #3545.37
-..LN3335:
-        shll      $8, %eax                                      #3545.48
-..LN3337:
-        orl       -52(%ebp), %eax                               #3545.21
-        movl      %eax, -52(%ebp)                               #3545.21
-..LN3339:
-        movdqa    -216(%ebp), %xmm0                             #3546.49
-..LN3341:
-        movl      -52(%ebp), %eax                               #3546.57
-..LN3343:
-        pinsrw    $7, %eax, %xmm0                               #3546.30
-..LN3345:
-        movdqa    %xmm0, -216(%ebp)                             #3546.21
-                                # LOE
-..B23.34:                       # Preds ..B23.33 ..B23.32
-..LN3347:
-        incl      -32(%ebp)                                     #3550.20
-        jmp       ..B23.12      # Prob 100%                     #3550.20
-                                # LOE
-..B23.36:                       # Preds ..B23.31 ..B23.12
-..LN3349:
-        movl      -44(%ebp), %eax                               #3555.18
-..LN3351:
-        movl      -36(%ebp), %edx                               #3555.25
-        cmpl      %edx, %eax                                    #3555.25
-        jae       ..B23.41      # Prob 50%                      #3555.25
-                                # LOE
-..B23.37:                       # Preds ..B23.36
-..LN3353:
-        movl      16(%ebx), %eax                                #3560.18
-..LN3355:
-        movl      -40(%ebp), %edx                               #3560.24
-        cmpl      %edx, %eax                                    #3560.24
-        ja        ..B23.41      # Prob 50%                      #3560.24
-                                # LOE
-..B23.38:                       # Preds ..B23.37
-..LN3357:
-        addl      $-8, %esp                                     #3565.22
-..LN3359:
-        movl      -44(%ebp), %eax                               #3565.41
-        movl      %eax, (%esp)                                  #3565.41
-..LN3361:
-        movl      -36(%ebp), %eax                               #3565.46
-        movl      %eax, 4(%esp)                                 #3565.46
-..LN3363:
-        call      prime_buffer_2na                              #3565.22
-                                # LOE xmm0
-..B23.46:                       # Preds ..B23.38
-        addl      $8, %esp                                      #3565.22
-        movdqa    %xmm0, -248(%ebp)                             #3565.22
-                                # LOE
-..B23.39:                       # Preds ..B23.46
-..LN3365:
-        movdqa    -248(%ebp), %xmm0                             #3565.13
-        movdqa    %xmm0, -216(%ebp)                             #3565.13
-..LN3367:
-        addl      $16, -44(%ebp)                                #3643.13
-..LN3369:
-        movl      -44(%ebp), %eax                               #3645.17
-..LN3371:
-        movl      %eax, -32(%ebp)                               #3645.13
-..LN3373:
-        movl      -44(%ebp), %eax                               #3646.18
-..LN3375:
-        movl      -36(%ebp), %edx                               #3646.24
-        cmpl      %edx, %eax                                    #3646.24
-        jae       ..B23.10      # Prob 50%                      #3646.24
-                                # LOE
-..B23.40:                       # Preds ..B23.39
-..LN3377:
-        movl      -44(%ebp), %eax                               #3647.32
-        movzbl    -1(%eax), %eax                                #3647.32
-        movzbl    %al, %eax                                     #3647.32
-..LN3379:
-        shll      $8, %eax                                      #3647.46
-..LN3381:
-        movl      %eax, -52(%ebp)                               #3647.17
-        jmp       ..B23.10      # Prob 100%                     #3647.17
-                                # LOE
-..B23.41:                       # Preds ..B23.37 ..B23.36 ..B23.10
-..LN3383:
-        xorl      %eax, %eax                                    #3656.12
-        leave                                                   #3656.12
-..___tag_value_eval_2na_128.641:                                #
-        movl      %ebx, %esp                                    #3656.12
-        popl      %ebx                                          #3656.12
-..___tag_value_eval_2na_128.642:                                #
-        ret                                                     #3656.12
-        .align    2,0x90
-..___tag_value_eval_2na_128.644:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-.LNeval_2na_128:
-	.data
-# -- End  eval_2na_128
-	.section .rodata, "a"
-	.align 4
-__$Ua:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	112
-	.byte	111
-	.byte	115
-	.byte	0
-	.type	__$Ua, at object
-	.size	__$Ua,13
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    2,0x90
-eval_2na_pos:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B24.1:                        # Preds ..B24.0
-..___tag_value_eval_2na_pos.647:                                #
-..LN3385:
-        pushl     %ebx                                          #3662.1
-..___tag_value_eval_2na_pos.652:                                #
-        movl      %esp, %ebx                                    #3662.1
-..___tag_value_eval_2na_pos.653:                                #
-        andl      $-16, %esp                                    #3662.1
-        pushl     %ebp                                          #3662.1
-        pushl     %ebp                                          #3662.1
-        movl      4(%ebx), %ebp                                 #3662.1
-        movl      %ebp, 4(%esp)                                 #3662.1
-        movl      %esp, %ebp                                    #3662.1
-..___tag_value_eval_2na_pos.655:                                #
-        subl      $264, %esp                                    #3662.1
-        movl      %ebx, -264(%ebp)                              #3662.1
-..LN3387:
-        movl      8(%ebx), %eax                                 #3698.25
-        movl      4(%eax), %eax                                 #3698.25
-..LN3389:
-        movl      %eax, -4(%ebp)                                #3698.23
-..LN3391:
-        movl      20(%ebx), %eax                                #3701.5
-        movl      -4(%ebp), %edx                                #3701.5
-        cmpl      %edx, %eax                                    #3701.5
-        jae       ..B24.3       # Prob 50%                      #3701.5
-                                # LOE
-..B24.2:                        # Preds ..B24.1
-        call      ..L657        # Prob 100%                     #
-..L657:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L657], %eax     #
-        addl      $-16, %esp                                    #3701.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #3701.5
-        movl      %edx, (%esp)                                  #3701.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #3701.5
-        movl      %edx, 4(%esp)                                 #3701.5
-        movl      $3701, 8(%esp)                                #3701.5
-        lea       __$Ua at GOTOFF(%eax), %edx                      #3701.5
-        movl      %edx, 12(%esp)                                #3701.5
-        movl      %eax, %ebx                                    #3701.5
-..___tag_value_eval_2na_pos.658:                                #3701.5
-        call      __assert_fail at PLT                             #3701.5
-        movl      -264(%ebp), %ebx                              #3701.5
-..___tag_value_eval_2na_pos.659:                                #
-                                # LOE
-..B24.57:                       # Preds ..B24.2
-        addl      $16, %esp                                     #3701.5
-                                # LOE
-..B24.3:                        # Preds ..B24.1
-..LN3393:
-        movl      16(%ebx), %eax                                #3705.12
-..LN3395:
-        addl      20(%ebx), %eax                                #3705.5
-        movl      %eax, 20(%ebx)                                #3705.5
-..LN3397:
-        movl      16(%ebx), %eax                                #3709.13
-..LN3399:
-        movl      %eax, -44(%ebp)                               #3709.5
-..LN3401:
-        movl      16(%ebx), %eax                                #3713.42
-..LN3403:
-        shrl      $2, %eax                                      #3713.49
-..LN3405:
-        addl      12(%ebx), %eax                                #3713.30
-..LN3407:
-        movl      %eax, -40(%ebp)                               #3713.5
-..LN3409:
-        movl      -4(%ebp), %eax                                #3716.18
-        negl      %eax                                          #3716.18
-        addl      20(%ebx), %eax                                #3716.18
-..LN3411:
-        movl      %eax, -36(%ebp)                               #3716.5
-..LN3413:
-        movl      20(%ebx), %eax                                #3719.44
-..LN3415:
-        addl      $3, %eax                                      #3719.50
-..LN3417:
-        shrl      $2, %eax                                      #3719.57
-..LN3419:
-        addl      12(%ebx), %eax                                #3719.30
-..LN3421:
-        movl      %eax, -32(%ebp)                               #3719.5
-..LN3423:
-        addl      $-8, %esp                                     #3722.14
-..LN3425:
-        movl      -40(%ebp), %eax                               #3722.33
-        movl      %eax, (%esp)                                  #3722.33
-..LN3427:
-        movl      -32(%ebp), %eax                               #3722.38
-        movl      %eax, 4(%esp)                                 #3722.38
-..LN3429:
-        call      prime_buffer_2na                              #3722.14
-                                # LOE xmm0
-..B24.58:                       # Preds ..B24.3
-        addl      $8, %esp                                      #3722.14
-        movdqa    %xmm0, -72(%ebp)                              #3722.14
-                                # LOE
-..B24.4:                        # Preds ..B24.58
-..LN3431:
-        movdqa    -72(%ebp), %xmm0                              #3722.5
-        movdqa    %xmm0, -216(%ebp)                             #3722.5
-..LN3433:
-        addl      $16, -40(%ebp)                                #3723.5
-..LN3435:
-        movl      -40(%ebp), %eax                               #3725.9
-..LN3437:
-        movl      %eax, -28(%ebp)                               #3725.5
-..LN3439:
-        movl      -40(%ebp), %eax                               #3728.10
-..LN3441:
-        movl      -32(%ebp), %edx                               #3728.16
-        cmpl      %edx, %eax                                    #3728.16
-        jae       ..B24.6       # Prob 50%                      #3728.16
-                                # LOE
-..B24.5:                        # Preds ..B24.4
-..LN3443:
-        movl      -40(%ebp), %eax                               #3729.24
-        movzbl    -1(%eax), %eax                                #3729.24
-        movzbl    %al, %eax                                     #3729.24
-..LN3445:
-        shll      $8, %eax                                      #3729.38
-..LN3447:
-        movl      %eax, -52(%ebp)                               #3729.9
-                                # LOE
-..B24.6:                        # Preds ..B24.5 ..B24.4
-..LN3449:
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    16(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -200(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    32(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -184(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    48(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -168(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    64(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -152(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    80(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -136(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    96(%eax), %xmm0                               #3733.5
-        movdqa    %xmm0, -120(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    112(%eax), %xmm0                              #3733.5
-        movdqa    %xmm0, -104(%ebp)                             #3733.5
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    128(%eax), %xmm0                              #3733.5
-        movdqa    %xmm0, -88(%ebp)                              #3733.5
-..LN3451:
-        xorl      %eax, %eax                                    #3736.15
-        movl      %eax, -24(%ebp)                               #3736.15
-..LN3453:
-        movl      %eax, -20(%ebp)                               #3736.10
-..LN3455:
-        movl      %eax, -16(%ebp)                               #3736.5
-..LN3457:
-        movl      16(%ebx), %eax                                #3738.27
-        negl      %eax                                          #3738.27
-..LN3459:
-        movl      -36(%ebp), %edx                               #3738.20
-..LN3461:
-        lea       7(%edx,%eax), %eax                            #3738.33
-..LN3463:
-        shrl      $2, %eax                                      #3738.40
-..LN3465:
-        movl      %eax, -12(%ebp)                               #3738.5
-..LN3467:
-        movl      16(%ebx), %eax                                #3745.14
-..LN3469:
-        andl      $3, %eax                                      #3745.20
-        movl      %eax, -8(%ebp)                                #3745.20
-        je        ..B24.14      # Prob 50%                      #3745.20
-                                # LOE
-..B24.7:                        # Preds ..B24.6
-        movl      -8(%ebp), %eax                                #3745.20
-        cmpl      $1, %eax                                      #3745.20
-        je        ..B24.15      # Prob 50%                      #3745.20
-                                # LOE
-..B24.8:                        # Preds ..B24.7
-        movl      -8(%ebp), %eax                                #3745.20
-        cmpl      $2, %eax                                      #3745.20
-        je        ..B24.16      # Prob 50%                      #3745.20
-                                # LOE
-..B24.9:                        # Preds ..B24.8
-        movl      -8(%ebp), %eax                                #3745.20
-        cmpl      $3, %eax                                      #3745.20
-        je        ..B24.17      # Prob 50%                      #3745.20
-                                # LOE
-..B24.10:                       # Preds ..B24.53 ..B24.52 ..B24.9
-..LN3471:
-        movl      $1, %eax                                      #3750.9
-        testl     %eax, %eax                                    #3750.9
-        je        ..B24.54      # Prob 100%                     #3750.9
-                                # LOE
-..B24.11:                       # Preds ..B24.10
-..LN3473:
-        movl      $16, -12(%ebp)                                #3752.13
-                                # LOE
-..B24.12:                       # Preds ..B24.47 ..B24.11
-..LN3475:
-        movl      $1, %eax                                      #3755.13
-        testl     %eax, %eax                                    #3755.13
-        je        ..B24.49      # Prob 100%                     #3755.13
-                                # LOE
-..B24.14:                       # Preds ..B24.6 ..B24.12
-..LN3477:
-        movdqa    -216(%ebp), %xmm0                             #3762.38
-..LN3479:
-        movdqa    -184(%ebp), %xmm1                             #3762.46
-..LN3481:
-        pand      %xmm1, %xmm0                                  #3762.22
-..LN3483:
-        movdqa    %xmm0, -232(%ebp)                             #3762.17
-..LN3485:
-        movdqa    -232(%ebp), %xmm0                             #3763.22
-        movdqa    -200(%ebp), %xmm1                             #3763.22
-        pcmpeqd   %xmm1, %xmm0                                  #3763.22
-..LN3487:
-        movdqa    %xmm0, -232(%ebp)                             #3763.17
-..LN3489:
-        movdqa    -232(%ebp), %xmm0                             #3764.42
-..LN3491:
-        pmovmskb  %xmm0, %eax                                   #3764.22
-..LN3493:
-        movl      %eax, -16(%ebp)                               #3764.17
-..LN3495:
-        movl      -16(%ebp), %eax                               #3765.17
-        incl      %eax                                          #3765.17
-        sarl      $16, %eax                                     #3765.17
-        negl      %eax                                          #3765.17
-        movl      %eax, -16(%ebp)                               #3765.17
-                                # LOE
-..B24.15:                       # Preds ..B24.7 ..B24.14
-..LN3497:
-        movdqa    -216(%ebp), %xmm0                             #3768.38
-..LN3499:
-        movdqa    -152(%ebp), %xmm1                             #3768.46
-..LN3501:
-        pand      %xmm1, %xmm0                                  #3768.22
-..LN3503:
-        movdqa    %xmm0, -232(%ebp)                             #3768.17
-..LN3505:
-        movdqa    -232(%ebp), %xmm0                             #3769.22
-        movdqa    -168(%ebp), %xmm1                             #3769.22
-        pcmpeqd   %xmm1, %xmm0                                  #3769.22
-..LN3507:
-        movdqa    %xmm0, -232(%ebp)                             #3769.17
-..LN3509:
-        movdqa    -232(%ebp), %xmm0                             #3770.42
-..LN3511:
-        pmovmskb  %xmm0, %eax                                   #3770.22
-..LN3513:
-        movl      %eax, -20(%ebp)                               #3770.17
-..LN3515:
-        movl      -20(%ebp), %eax                               #3771.17
-        incl      %eax                                          #3771.17
-        sarl      $16, %eax                                     #3771.17
-        negl      %eax                                          #3771.17
-        movl      %eax, -20(%ebp)                               #3771.17
-                                # LOE
-..B24.16:                       # Preds ..B24.8 ..B24.15
-..LN3517:
-        movdqa    -216(%ebp), %xmm0                             #3774.38
-..LN3519:
-        movdqa    -120(%ebp), %xmm1                             #3774.46
-..LN3521:
-        pand      %xmm1, %xmm0                                  #3774.22
-..LN3523:
-        movdqa    %xmm0, -232(%ebp)                             #3774.17
-..LN3525:
-        movdqa    -232(%ebp), %xmm0                             #3775.22
-        movdqa    -136(%ebp), %xmm1                             #3775.22
-        pcmpeqd   %xmm1, %xmm0                                  #3775.22
-..LN3527:
-        movdqa    %xmm0, -232(%ebp)                             #3775.17
-..LN3529:
-        movdqa    -232(%ebp), %xmm0                             #3776.42
-..LN3531:
-        pmovmskb  %xmm0, %eax                                   #3776.22
-..LN3533:
-        movl      %eax, -24(%ebp)                               #3776.17
-..LN3535:
-        movl      -24(%ebp), %eax                               #3777.17
-        incl      %eax                                          #3777.17
-        sarl      $16, %eax                                     #3777.17
-        negl      %eax                                          #3777.17
-        movl      %eax, -24(%ebp)                               #3777.17
-                                # LOE
-..B24.17:                       # Preds ..B24.9 ..B24.16
-..LN3537:
-        movdqa    -216(%ebp), %xmm0                             #3780.38
-..LN3539:
-        movdqa    -88(%ebp), %xmm1                              #3780.46
-..LN3541:
-        pand      %xmm1, %xmm0                                  #3780.22
-..LN3543:
-        movdqa    %xmm0, -232(%ebp)                             #3780.17
-..LN3545:
-        movdqa    -232(%ebp), %xmm0                             #3781.22
-        movdqa    -104(%ebp), %xmm1                             #3781.22
-        pcmpeqd   %xmm1, %xmm0                                  #3781.22
-..LN3547:
-        movdqa    %xmm0, -232(%ebp)                             #3781.17
-..LN3549:
-        movdqa    -232(%ebp), %xmm0                             #3782.42
-..LN3551:
-        pmovmskb  %xmm0, %eax                                   #3782.22
-..LN3553:
-        movl      %eax, -48(%ebp)                               #3782.17
-..LN3555:
-        movl      -48(%ebp), %eax                               #3783.17
-        incl      %eax                                          #3783.17
-        sarl      $16, %eax                                     #3783.17
-        negl      %eax                                          #3783.17
-        movl      %eax, -48(%ebp)                               #3783.17
-..LN3557:
-        movl      16(%ebx), %eax                                #3787.17
-        andl      $-4, %eax                                     #3787.17
-        movl      %eax, 16(%ebx)                                #3787.17
-..LN3559:
-        movl      -20(%ebp), %eax                               #3790.29
-        orl       -16(%ebp), %eax                               #3790.29
-..LN3561:
-        orl       -24(%ebp), %eax                               #3790.34
-..LN3563:
-        orl       -48(%ebp), %eax                               #3790.39
-..LN3565:
-        je        ..B24.42      # Prob 50%                      #3790.47
-                                # LOE
-..B24.18:                       # Preds ..B24.17
-..LN3567:
-        movl      16(%ebx), %eax                                #3793.37
-        negl      %eax                                          #3793.37
-        addl      -36(%ebp), %eax                               #3793.37
-        movl      %eax, -56(%ebp)                               #3793.37
-        je        ..B24.21      # Prob 50%                      #3793.37
-                                # LOE
-..B24.19:                       # Preds ..B24.18
-        movl      -56(%ebp), %eax                               #3793.37
-        cmpl      $1, %eax                                      #3793.37
-        je        ..B24.23      # Prob 50%                      #3793.37
-                                # LOE
-..B24.20:                       # Preds ..B24.19
-        movl      -56(%ebp), %eax                               #3793.37
-        cmpl      $2, %eax                                      #3793.37
-        je        ..B24.27      # Prob 50%                      #3793.37
-        jmp       ..B24.33      # Prob 100%                     #3793.37
-                                # LOE
-..B24.21:                       # Preds ..B24.18
-..LN3569:
-        movl      -16(%ebp), %eax                               #3796.30
-..LN3571:
-        testl     %eax, %eax                                    #3796.36
-        je        ..B24.41      # Prob 50%                      #3796.36
-                                # LOE
-..B24.22:                       # Preds ..B24.21
-..LN3573:
-        movl      -44(%ebp), %eax                               #3796.53
-        negl      %eax                                          #3796.53
-..LN3575:
-        movl      16(%ebx), %edx                                #3796.47
-..LN3577:
-        lea       1(%edx,%eax), %eax                            #3796.61
-        leave                                                   #3796.61
-..___tag_value_eval_2na_pos.661:                                #
-        movl      %ebx, %esp                                    #3796.61
-        popl      %ebx                                          #3796.61
-..___tag_value_eval_2na_pos.662:                                #
-        ret                                                     #3796.61
-..___tag_value_eval_2na_pos.664:                                #
-                                # LOE
-..B24.23:                       # Preds ..B24.19
-..LN3579:
-        movl      -16(%ebp), %eax                               #3799.30
-..LN3581:
-        testl     %eax, %eax                                    #3799.36
-        je        ..B24.25      # Prob 50%                      #3799.36
-                                # LOE
-..B24.24:                       # Preds ..B24.23
-..LN3583:
-        movl      -44(%ebp), %eax                               #3799.53
-        negl      %eax                                          #3799.53
-..LN3585:
-        movl      16(%ebx), %edx                                #3799.47
-..LN3587:
-        lea       1(%edx,%eax), %eax                            #3799.61
-        leave                                                   #3799.61
-..___tag_value_eval_2na_pos.668:                                #
-        movl      %ebx, %esp                                    #3799.61
-        popl      %ebx                                          #3799.61
-..___tag_value_eval_2na_pos.669:                                #
-        ret                                                     #3799.61
-..___tag_value_eval_2na_pos.671:                                #
-                                # LOE
-..B24.25:                       # Preds ..B24.23
-..LN3589:
-        movl      -20(%ebp), %eax                               #3800.30
-..LN3591:
-        testl     %eax, %eax                                    #3800.36
-        je        ..B24.41      # Prob 50%                      #3800.36
-                                # LOE
-..B24.26:                       # Preds ..B24.25
-..LN3593:
-        movl      -44(%ebp), %eax                               #3800.53
-        negl      %eax                                          #3800.53
-..LN3595:
-        movl      16(%ebx), %edx                                #3800.47
-..LN3597:
-        lea       2(%edx,%eax), %eax                            #3800.61
-        leave                                                   #3800.61
-..___tag_value_eval_2na_pos.675:                                #
-        movl      %ebx, %esp                                    #3800.61
-        popl      %ebx                                          #3800.61
-..___tag_value_eval_2na_pos.676:                                #
-        ret                                                     #3800.61
-..___tag_value_eval_2na_pos.678:                                #
-                                # LOE
-..B24.27:                       # Preds ..B24.20
-..LN3599:
-        movl      -16(%ebp), %eax                               #3803.30
-..LN3601:
-        testl     %eax, %eax                                    #3803.36
-        je        ..B24.29      # Prob 50%                      #3803.36
-                                # LOE
-..B24.28:                       # Preds ..B24.27
-..LN3603:
-        movl      -44(%ebp), %eax                               #3803.53
-        negl      %eax                                          #3803.53
-..LN3605:
-        movl      16(%ebx), %edx                                #3803.47
-..LN3607:
-        lea       1(%edx,%eax), %eax                            #3803.61
-        leave                                                   #3803.61
-..___tag_value_eval_2na_pos.682:                                #
-        movl      %ebx, %esp                                    #3803.61
-        popl      %ebx                                          #3803.61
-..___tag_value_eval_2na_pos.683:                                #
-        ret                                                     #3803.61
-..___tag_value_eval_2na_pos.685:                                #
-                                # LOE
-..B24.29:                       # Preds ..B24.27
-..LN3609:
-        movl      -20(%ebp), %eax                               #3804.30
-..LN3611:
-        testl     %eax, %eax                                    #3804.36
-        je        ..B24.31      # Prob 50%                      #3804.36
-                                # LOE
-..B24.30:                       # Preds ..B24.29
-..LN3613:
-        movl      -44(%ebp), %eax                               #3804.53
-        negl      %eax                                          #3804.53
-..LN3615:
-        movl      16(%ebx), %edx                                #3804.47
-..LN3617:
-        lea       2(%edx,%eax), %eax                            #3804.61
-        leave                                                   #3804.61
-..___tag_value_eval_2na_pos.689:                                #
-        movl      %ebx, %esp                                    #3804.61
-        popl      %ebx                                          #3804.61
-..___tag_value_eval_2na_pos.690:                                #
-        ret                                                     #3804.61
-..___tag_value_eval_2na_pos.692:                                #
-                                # LOE
-..B24.31:                       # Preds ..B24.29
-..LN3619:
-        movl      -24(%ebp), %eax                               #3805.30
-..LN3621:
-        testl     %eax, %eax                                    #3805.36
-        je        ..B24.41      # Prob 50%                      #3805.36
-                                # LOE
-..B24.32:                       # Preds ..B24.31
-..LN3623:
-        movl      -44(%ebp), %eax                               #3805.53
-        negl      %eax                                          #3805.53
-..LN3625:
-        movl      16(%ebx), %edx                                #3805.47
-..LN3627:
-        lea       3(%edx,%eax), %eax                            #3805.61
-        leave                                                   #3805.61
-..___tag_value_eval_2na_pos.696:                                #
-        movl      %ebx, %esp                                    #3805.61
-        popl      %ebx                                          #3805.61
-..___tag_value_eval_2na_pos.697:                                #
-        ret                                                     #3805.61
-..___tag_value_eval_2na_pos.699:                                #
-                                # LOE
-..B24.33:                       # Preds ..B24.20
-..LN3629:
-        movl      -16(%ebp), %eax                               #3808.30
-..LN3631:
-        testl     %eax, %eax                                    #3808.36
-        je        ..B24.35      # Prob 50%                      #3808.36
-                                # LOE
-..B24.34:                       # Preds ..B24.33
-..LN3633:
-        movl      -44(%ebp), %eax                               #3808.53
-        negl      %eax                                          #3808.53
-..LN3635:
-        movl      16(%ebx), %edx                                #3808.47
-..LN3637:
-        lea       1(%edx,%eax), %eax                            #3808.61
-        leave                                                   #3808.61
-..___tag_value_eval_2na_pos.703:                                #
-        movl      %ebx, %esp                                    #3808.61
-        popl      %ebx                                          #3808.61
-..___tag_value_eval_2na_pos.704:                                #
-        ret                                                     #3808.61
-..___tag_value_eval_2na_pos.706:                                #
-                                # LOE
-..B24.35:                       # Preds ..B24.33
-..LN3639:
-        movl      -20(%ebp), %eax                               #3809.30
-..LN3641:
-        testl     %eax, %eax                                    #3809.36
-        je        ..B24.37      # Prob 50%                      #3809.36
-                                # LOE
-..B24.36:                       # Preds ..B24.35
-..LN3643:
-        movl      -44(%ebp), %eax                               #3809.53
-        negl      %eax                                          #3809.53
-..LN3645:
-        movl      16(%ebx), %edx                                #3809.47
-..LN3647:
-        lea       2(%edx,%eax), %eax                            #3809.61
-        leave                                                   #3809.61
-..___tag_value_eval_2na_pos.710:                                #
-        movl      %ebx, %esp                                    #3809.61
-        popl      %ebx                                          #3809.61
-..___tag_value_eval_2na_pos.711:                                #
-        ret                                                     #3809.61
-..___tag_value_eval_2na_pos.713:                                #
-                                # LOE
-..B24.37:                       # Preds ..B24.35
-..LN3649:
-        movl      -24(%ebp), %eax                               #3810.30
-..LN3651:
-        testl     %eax, %eax                                    #3810.36
-        je        ..B24.39      # Prob 50%                      #3810.36
-                                # LOE
-..B24.38:                       # Preds ..B24.37
-..LN3653:
-        movl      -44(%ebp), %eax                               #3810.53
-        negl      %eax                                          #3810.53
-..LN3655:
-        movl      16(%ebx), %edx                                #3810.47
-..LN3657:
-        lea       3(%edx,%eax), %eax                            #3810.61
-        leave                                                   #3810.61
-..___tag_value_eval_2na_pos.717:                                #
-        movl      %ebx, %esp                                    #3810.61
-        popl      %ebx                                          #3810.61
-..___tag_value_eval_2na_pos.718:                                #
-        ret                                                     #3810.61
-..___tag_value_eval_2na_pos.720:                                #
-                                # LOE
-..B24.39:                       # Preds ..B24.37
-..LN3659:
-        movl      -48(%ebp), %eax                               #3811.30
-..LN3661:
-        testl     %eax, %eax                                    #3811.36
-        je        ..B24.41      # Prob 50%                      #3811.36
-                                # LOE
-..B24.40:                       # Preds ..B24.39
-..LN3663:
-        movl      -44(%ebp), %eax                               #3811.53
-        negl      %eax                                          #3811.53
-..LN3665:
-        movl      16(%ebx), %edx                                #3811.47
-..LN3667:
-        lea       4(%edx,%eax), %eax                            #3811.61
-        leave                                                   #3811.61
-..___tag_value_eval_2na_pos.724:                                #
-        movl      %ebx, %esp                                    #3811.61
-        popl      %ebx                                          #3811.61
-..___tag_value_eval_2na_pos.725:                                #
-        ret                                                     #3811.61
-..___tag_value_eval_2na_pos.727:                                #
-                                # LOE
-..B24.41:                       # Preds ..B24.21 ..B24.25 ..B24.31 ..B24.39
-..LN3669:
-        xorl      %eax, %eax                                    #3813.28
-        leave                                                   #3813.28
-..___tag_value_eval_2na_pos.731:                                #
-        movl      %ebx, %esp                                    #3813.28
-        popl      %ebx                                          #3813.28
-..___tag_value_eval_2na_pos.732:                                #
-        ret                                                     #3813.28
-..___tag_value_eval_2na_pos.734:                                #
-                                # LOE
-..B24.42:                       # Preds ..B24.17
-..LN3671:
-        movl      16(%ebx), %eax                                #3853.17
-        addl      $4, %eax                                      #3853.17
-        movl      %eax, 16(%ebx)                                #3853.17
-..LN3673:
-        movl      16(%ebx), %eax                                #3856.22
-..LN3675:
-        movl      -36(%ebp), %edx                               #3856.28
-        cmpl      %edx, %eax                                    #3856.28
-        jbe       ..B24.44      # Prob 50%                      #3856.28
-                                # LOE
-..B24.43:                       # Preds ..B24.42
-..LN3677:
-        xorl      %eax, %eax                                    #3857.28
-        leave                                                   #3857.28
-..___tag_value_eval_2na_pos.738:                                #
-        movl      %ebx, %esp                                    #3857.28
-        popl      %ebx                                          #3857.28
-..___tag_value_eval_2na_pos.739:                                #
-        ret                                                     #3857.28
-..___tag_value_eval_2na_pos.741:                                #
-                                # LOE
-..B24.44:                       # Preds ..B24.42
-..LN3679:
-        movl      -12(%ebp), %eax                               #3860.25
-        decl      %eax                                          #3860.25
-        movl      %eax, -12(%ebp)                               #3860.25
-..LN3681:
-        je        ..B24.49      # Prob 50%                      #3860.39
-                                # LOE
-..B24.45:                       # Preds ..B24.44
-..LN3683:
-        movdqa    -216(%ebp), %xmm0                             #3865.43
-..LN3685:
-        psrldq    $1, %xmm0                                     #3865.26
-..LN3687:
-        movdqa    %xmm0, -216(%ebp)                             #3865.17
-..LN3689:
-        movl      -28(%ebp), %eax                               #3868.22
-..LN3691:
-        movl      -32(%ebp), %edx                               #3868.26
-        cmpl      %edx, %eax                                    #3868.26
-        jae       ..B24.47      # Prob 50%                      #3868.26
-                                # LOE
-..B24.46:                       # Preds ..B24.45
-..LN3693:
-        sarl      $8, -52(%ebp)                                 #3870.21
-..LN3695:
-        movl      -28(%ebp), %eax                               #3871.37
-        movzbl    (%eax), %eax                                  #3871.37
-        movzbl    %al, %eax                                     #3871.37
-..LN3697:
-        shll      $8, %eax                                      #3871.48
-..LN3699:
-        orl       -52(%ebp), %eax                               #3871.21
-        movl      %eax, -52(%ebp)                               #3871.21
-..LN3701:
-        movdqa    -216(%ebp), %xmm0                             #3872.49
-..LN3703:
-        movl      -52(%ebp), %eax                               #3872.57
-..LN3705:
-        pinsrw    $7, %eax, %xmm0                               #3872.30
-..LN3707:
-        movdqa    %xmm0, -216(%ebp)                             #3872.21
-                                # LOE
-..B24.47:                       # Preds ..B24.46 ..B24.45
-..LN3709:
-        incl      -28(%ebp)                                     #3876.20
-        jmp       ..B24.12      # Prob 100%                     #3876.20
-                                # LOE
-..B24.49:                       # Preds ..B24.44 ..B24.12
-..LN3711:
-        movl      -40(%ebp), %eax                               #3881.18
-..LN3713:
-        movl      -32(%ebp), %edx                               #3881.25
-        cmpl      %edx, %eax                                    #3881.25
-        jae       ..B24.54      # Prob 50%                      #3881.25
-                                # LOE
-..B24.50:                       # Preds ..B24.49
-..LN3715:
-        movl      16(%ebx), %eax                                #3886.18
-..LN3717:
-        movl      -36(%ebp), %edx                               #3886.24
-        cmpl      %edx, %eax                                    #3886.24
-        ja        ..B24.54      # Prob 50%                      #3886.24
-                                # LOE
-..B24.51:                       # Preds ..B24.50
-..LN3719:
-        addl      $-8, %esp                                     #3891.22
-..LN3721:
-        movl      -40(%ebp), %eax                               #3891.41
-        movl      %eax, (%esp)                                  #3891.41
-..LN3723:
-        movl      -32(%ebp), %eax                               #3891.46
-        movl      %eax, 4(%esp)                                 #3891.46
-..LN3725:
-        call      prime_buffer_2na                              #3891.22
-                                # LOE xmm0
-..B24.59:                       # Preds ..B24.51
-        addl      $8, %esp                                      #3891.22
-        movdqa    %xmm0, -248(%ebp)                             #3891.22
-                                # LOE
-..B24.52:                       # Preds ..B24.59
-..LN3727:
-        movdqa    -248(%ebp), %xmm0                             #3891.13
-        movdqa    %xmm0, -216(%ebp)                             #3891.13
-..LN3729:
-        addl      $16, -40(%ebp)                                #3969.13
-..LN3731:
-        movl      -40(%ebp), %eax                               #3971.17
-..LN3733:
-        movl      %eax, -28(%ebp)                               #3971.13
-..LN3735:
-        movl      -40(%ebp), %eax                               #3972.18
-..LN3737:
-        movl      -32(%ebp), %edx                               #3972.24
-        cmpl      %edx, %eax                                    #3972.24
-        jae       ..B24.10      # Prob 50%                      #3972.24
-                                # LOE
-..B24.53:                       # Preds ..B24.52
-..LN3739:
-        movl      -40(%ebp), %eax                               #3973.32
-        movzbl    -1(%eax), %eax                                #3973.32
-        movzbl    %al, %eax                                     #3973.32
-..LN3741:
-        shll      $8, %eax                                      #3973.46
-..LN3743:
-        movl      %eax, -52(%ebp)                               #3973.17
-        jmp       ..B24.10      # Prob 100%                     #3973.17
-                                # LOE
-..B24.54:                       # Preds ..B24.50 ..B24.49 ..B24.10
-..LN3745:
-        xorl      %eax, %eax                                    #3983.12
-        leave                                                   #3983.12
-..___tag_value_eval_2na_pos.745:                                #
-        movl      %ebx, %esp                                    #3983.12
-        popl      %ebx                                          #3983.12
-..___tag_value_eval_2na_pos.746:                                #
-        ret                                                     #3983.12
-        .align    2,0x90
-..___tag_value_eval_2na_pos.748:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-.LNeval_2na_pos:
-	.data
-# -- End  eval_2na_pos
-	.section .rodata, "a"
-	.align 4
-__$Ub:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	54
-	.byte	0
-	.type	__$Ub, at object
-	.size	__$Ub,12
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    2,0x90
-eval_4na_16:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B25.1:                        # Preds ..B25.0
-..___tag_value_eval_4na_16.751:                                 #
-..LN3747:
-        pushl     %ebx                                          #4057.1
-..___tag_value_eval_4na_16.756:                                 #
-        movl      %esp, %ebx                                    #4057.1
-..___tag_value_eval_4na_16.757:                                 #
-        andl      $-16, %esp                                    #4057.1
-        pushl     %ebp                                          #4057.1
-        pushl     %ebp                                          #4057.1
-        movl      4(%ebx), %ebp                                 #4057.1
-        movl      %ebp, 4(%esp)                                 #4057.1
-        movl      %esp, %ebp                                    #4057.1
-..___tag_value_eval_4na_16.759:                                 #
-        subl      $296, %esp                                    #4057.1
-        movl      %ebx, -296(%ebp)                              #4057.1
-..LN3749:
-        movl      8(%ebx), %eax                                 #4083.25
-        movl      4(%eax), %eax                                 #4083.25
-..LN3751:
-        movl      %eax, -4(%ebp)                                #4083.23
-..LN3753:
-        movl      20(%ebx), %eax                                #4086.5
-        movl      -4(%ebp), %edx                                #4086.5
-        cmpl      %edx, %eax                                    #4086.5
-        jae       ..B25.3       # Prob 50%                      #4086.5
-                                # LOE
-..B25.2:                        # Preds ..B25.1
-        call      ..L761        # Prob 100%                     #
-..L761:                                                         #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L761], %eax     #
-        addl      $-16, %esp                                    #4086.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %edx               #4086.5
-        movl      %edx, (%esp)                                  #4086.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %edx               #4086.5
-        movl      %edx, 4(%esp)                                 #4086.5
-        movl      $4086, 8(%esp)                                #4086.5
-        lea       __$Ub at GOTOFF(%eax), %edx                      #4086.5
-        movl      %edx, 12(%esp)                                #4086.5
-        movl      %eax, %ebx                                    #4086.5
-..___tag_value_eval_4na_16.762:                                 #4086.5
-        call      __assert_fail at PLT                             #4086.5
-        movl      -296(%ebp), %ebx                              #4086.5
-..___tag_value_eval_4na_16.763:                                 #
-                                # LOE
-..B25.43:                       # Preds ..B25.2
-        addl      $16, %esp                                     #4086.5
-                                # LOE
-..B25.3:                        # Preds ..B25.1
-..LN3755:
-        movl      16(%ebx), %eax                                #4090.12
-..LN3757:
-        addl      20(%ebx), %eax                                #4090.5
-        movl      %eax, 20(%ebx)                                #4090.5
-..LN3759:
-        movl      16(%ebx), %eax                                #4093.42
-..LN3761:
-        shrl      $2, %eax                                      #4093.49
-..LN3763:
-        addl      12(%ebx), %eax                                #4093.30
-..LN3765:
-        movl      %eax, -36(%ebp)                               #4093.5
-..LN3767:
-        movl      -4(%ebp), %eax                                #4096.18
-        negl      %eax                                          #4096.18
-        addl      20(%ebx), %eax                                #4096.18
-..LN3769:
-        movl      %eax, -32(%ebp)                               #4096.5
-..LN3771:
-        movl      20(%ebx), %eax                                #4099.44
-..LN3773:
-        addl      $3, %eax                                      #4099.50
-..LN3775:
-        shrl      $2, %eax                                      #4099.57
-..LN3777:
-        addl      12(%ebx), %eax                                #4099.30
-..LN3779:
-        movl      %eax, -28(%ebp)                               #4099.5
-..LN3781:
-        addl      $-8, %esp                                     #4102.14
-..LN3783:
-        movl      -36(%ebp), %eax                               #4102.33
-        movl      %eax, (%esp)                                  #4102.33
-..LN3785:
-        movl      -28(%ebp), %eax                               #4102.38
-        movl      %eax, 4(%esp)                                 #4102.38
-..LN3787:
-        call      prime_buffer_4na                              #4102.14
-                                # LOE xmm0
-..B25.44:                       # Preds ..B25.3
-        addl      $8, %esp                                      #4102.14
-        movdqa    %xmm0, -88(%ebp)                              #4102.14
-                                # LOE
-..B25.4:                        # Preds ..B25.44
-..LN3789:
-        movdqa    -88(%ebp), %xmm0                              #4102.5
-        movdqa    %xmm0, -232(%ebp)                             #4102.5
-..LN3791:
-        addl      $8, -36(%ebp)                                 #4103.5
-..LN3793:
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    16(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -216(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    32(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -200(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    48(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -184(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    64(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -168(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    80(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -152(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    96(%eax), %xmm0                               #4109.5
-        movdqa    %xmm0, -136(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    112(%eax), %xmm0                              #4109.5
-        movdqa    %xmm0, -120(%ebp)                             #4109.5
-        movl      8(%ebx), %eax                                 #4109.5
-        movdqa    128(%eax), %xmm0                              #4109.5
-        movdqa    %xmm0, -104(%ebp)                             #4109.5
-..LN3795:
-        xorl      %eax, %eax                                    #4112.15
-        movl      %eax, -24(%ebp)                               #4112.15
-..LN3797:
-        movl      %eax, -20(%ebp)                               #4112.10
-..LN3799:
-        movl      %eax, -16(%ebp)                               #4112.5
-..LN3801:
-        movl      $1, -12(%ebp)                                 #4118.5
-..LN3803:
-        movl      16(%ebx), %eax                                #4123.14
-..LN3805:
-        andl      $3, %eax                                      #4123.20
-        movl      %eax, -8(%ebp)                                #4123.20
-        je        ..B25.12      # Prob 50%                      #4123.20
-                                # LOE
-..B25.5:                        # Preds ..B25.4
-        movl      -8(%ebp), %eax                                #4123.20
-        cmpl      $1, %eax                                      #4123.20
-        je        ..B25.13      # Prob 50%                      #4123.20
-                                # LOE
-..B25.6:                        # Preds ..B25.5
-        movl      -8(%ebp), %eax                                #4123.20
-        cmpl      $2, %eax                                      #4123.20
-        je        ..B25.14      # Prob 50%                      #4123.20
-                                # LOE
-..B25.7:                        # Preds ..B25.6
-        movl      -8(%ebp), %eax                                #4123.20
-        cmpl      $3, %eax                                      #4123.20
-        je        ..B25.15      # Prob 50%                      #4123.20
-                                # LOE
-..B25.8:                        # Preds ..B25.39 ..B25.7
-..LN3807:
-        movl      $1, %eax                                      #4128.9
-        testl     %eax, %eax                                    #4128.9
-        je        ..B25.40      # Prob 100%                     #4128.9
-                                # LOE
-..B25.9:                        # Preds ..B25.8
-..LN3809:
-        movl      $1, -12(%ebp)                                 #4130.13
-                                # LOE
-..B25.10:                       # Preds ..B25.34 ..B25.9
-..LN3811:
-        movl      $1, %eax                                      #4133.13
-        testl     %eax, %eax                                    #4133.13
-        je        ..B25.36      # Prob 100%                     #4133.13
-                                # LOE
-..B25.12:                       # Preds ..B25.4 ..B25.10
-..LN3813:
-        movdqa    -232(%ebp), %xmm0                             #4140.38
-..LN3815:
-        movdqa    -216(%ebp), %xmm1                             #4140.46
-..LN3817:
-        pand      %xmm1, %xmm0                                  #4140.22
-..LN3819:
-        movdqa    %xmm0, -264(%ebp)                             #4140.17
-..LN3821:
-        movdqa    -232(%ebp), %xmm0                             #4141.38
-..LN3823:
-        movdqa    -200(%ebp), %xmm1                             #4141.46
-..LN3825:
-        pand      %xmm1, %xmm0                                  #4141.22
-..LN3827:
-        movdqa    %xmm0, -248(%ebp)                             #4141.17
-..LN3829:
-        movdqa    -264(%ebp), %xmm0                             #4142.22
-        movdqa    -248(%ebp), %xmm1                             #4142.22
-        pcmpeqw   %xmm1, %xmm0                                  #4142.22
-..LN3831:
-        movdqa    %xmm0, -264(%ebp)                             #4142.17
-..LN3833:
-        movdqa    -264(%ebp), %xmm0                             #4143.42
-..LN3835:
-        pmovmskb  %xmm0, %eax                                   #4143.22
-..LN3837:
-        movl      %eax, -16(%ebp)                               #4143.17
-                                # LOE
-..B25.13:                       # Preds ..B25.5 ..B25.12
-..LN3839:
-        movdqa    -232(%ebp), %xmm0                             #4147.38
-..LN3841:
-        movdqa    -184(%ebp), %xmm1                             #4147.46
-..LN3843:
-        pand      %xmm1, %xmm0                                  #4147.22
-..LN3845:
-        movdqa    %xmm0, -264(%ebp)                             #4147.17
-..LN3847:
-        movdqa    -232(%ebp), %xmm0                             #4148.38
-..LN3849:
-        movdqa    -168(%ebp), %xmm1                             #4148.46
-..LN3851:
-        pand      %xmm1, %xmm0                                  #4148.22
-..LN3853:
-        movdqa    %xmm0, -248(%ebp)                             #4148.17
-..LN3855:
-        movdqa    -264(%ebp), %xmm0                             #4149.22
-        movdqa    -248(%ebp), %xmm1                             #4149.22
-        pcmpeqw   %xmm1, %xmm0                                  #4149.22
-..LN3857:
-        movdqa    %xmm0, -264(%ebp)                             #4149.17
-..LN3859:
-        movdqa    -264(%ebp), %xmm0                             #4150.42
-..LN3861:
-        pmovmskb  %xmm0, %eax                                   #4150.22
-..LN3863:
-        movl      %eax, -20(%ebp)                               #4150.17
-                                # LOE
-..B25.14:                       # Preds ..B25.6 ..B25.13
-..LN3865:
-        movdqa    -232(%ebp), %xmm0                             #4154.38
-..LN3867:
-        movdqa    -152(%ebp), %xmm1                             #4154.46
-..LN3869:
-        pand      %xmm1, %xmm0                                  #4154.22
-..LN3871:
-        movdqa    %xmm0, -264(%ebp)                             #4154.17
-..LN3873:
-        movdqa    -232(%ebp), %xmm0                             #4155.38
-..LN3875:
-        movdqa    -136(%ebp), %xmm1                             #4155.46
-..LN3877:
-        pand      %xmm1, %xmm0                                  #4155.22
-..LN3879:
-        movdqa    %xmm0, -248(%ebp)                             #4155.17
-..LN3881:
-        movdqa    -264(%ebp), %xmm0                             #4156.22
-        movdqa    -248(%ebp), %xmm1                             #4156.22
-        pcmpeqw   %xmm1, %xmm0                                  #4156.22
-..LN3883:
-        movdqa    %xmm0, -264(%ebp)                             #4156.17
-..LN3885:
-        movdqa    -264(%ebp), %xmm0                             #4157.42
-..LN3887:
-        pmovmskb  %xmm0, %eax                                   #4157.22
-..LN3889:
-        movl      %eax, -24(%ebp)                               #4157.17
-                                # LOE
-..B25.15:                       # Preds ..B25.7 ..B25.14
-..LN3891:
-        movdqa    -232(%ebp), %xmm0                             #4161.38
-..LN3893:
-        movdqa    -120(%ebp), %xmm1                             #4161.46
-..LN3895:
-        pand      %xmm1, %xmm0                                  #4161.22
-..LN3897:
-        movdqa    %xmm0, -264(%ebp)                             #4161.17
-..LN3899:
-        movdqa    -232(%ebp), %xmm0                             #4162.38
-..LN3901:
-        movdqa    -104(%ebp), %xmm1                             #4162.46
-..LN3903:
-        pand      %xmm1, %xmm0                                  #4162.22
-..LN3905:
-        movdqa    %xmm0, -248(%ebp)                             #4162.17
-..LN3907:
-        movdqa    -264(%ebp), %xmm0                             #4163.22
-        movdqa    -248(%ebp), %xmm1                             #4163.22
-        pcmpeqw   %xmm1, %xmm0                                  #4163.22
-..LN3909:
-        movdqa    %xmm0, -264(%ebp)                             #4163.17
-..LN3911:
-        movdqa    -264(%ebp), %xmm0                             #4164.42
-..LN3913:
-        pmovmskb  %xmm0, %eax                                   #4164.22
-..LN3915:
-        movl      %eax, -40(%ebp)                               #4164.17
-..LN3917:
-        movl      16(%ebx), %eax                                #4169.17
-        andl      $-4, %eax                                     #4169.17
-        movl      %eax, 16(%ebx)                                #4169.17
-..LN3919:
-        movl      -20(%ebp), %eax                               #4172.29
-        orl       -16(%ebp), %eax                               #4172.29
-..LN3921:
-        orl       -24(%ebp), %eax                               #4172.34
-..LN3923:
-        orl       -40(%ebp), %eax                               #4172.39
-..LN3925:
-        je        ..B25.32      # Prob 50%                      #4172.47
-                                # LOE
-..B25.16:                       # Preds ..B25.15
-..LN3927:
-        pushl     %edi                                          #4190.30
-..LN3929:
-        movl      -16(%ebp), %eax                               #4190.58
-        movw      %ax, (%esp)                                   #4190.58
-..LN3931:
-        call      uint16_lsbit                                  #4190.30
-                                # LOE eax
-..B25.45:                       # Preds ..B25.16
-        popl      %ecx                                          #4190.30
-        movl      %eax, -56(%ebp)                               #4190.30
-                                # LOE
-..B25.17:                       # Preds ..B25.45
-        movl      -56(%ebp), %eax                               #4190.30
-        movswl    %ax, %eax                                     #4190.30
-..LN3933:
-        movl      %eax, -72(%ebp)                               #4190.28
-..LN3935:
-        pushl     %edi                                          #4191.30
-..LN3937:
-        movl      -20(%ebp), %eax                               #4191.58
-        movw      %ax, (%esp)                                   #4191.58
-..LN3939:
-        call      uint16_lsbit                                  #4191.30
-                                # LOE eax
-..B25.46:                       # Preds ..B25.17
-        popl      %ecx                                          #4191.30
-        movl      %eax, -52(%ebp)                               #4191.30
-                                # LOE
-..B25.18:                       # Preds ..B25.46
-        movl      -52(%ebp), %eax                               #4191.30
-        movswl    %ax, %eax                                     #4191.30
-..LN3941:
-        movl      %eax, -68(%ebp)                               #4191.28
-..LN3943:
-        pushl     %edi                                          #4192.30
-..LN3945:
-        movl      -24(%ebp), %eax                               #4192.58
-        movw      %ax, (%esp)                                   #4192.58
-..LN3947:
-        call      uint16_lsbit                                  #4192.30
-                                # LOE eax
-..B25.47:                       # Preds ..B25.18
-        popl      %ecx                                          #4192.30
-        movl      %eax, -48(%ebp)                               #4192.30
-                                # LOE
-..B25.19:                       # Preds ..B25.47
-        movl      -48(%ebp), %eax                               #4192.30
-        movswl    %ax, %eax                                     #4192.30
-..LN3949:
-        movl      %eax, -64(%ebp)                               #4192.28
-..LN3951:
-        pushl     %edi                                          #4193.30
-..LN3953:
-        movl      -40(%ebp), %eax                               #4193.58
-        movw      %ax, (%esp)                                   #4193.58
-..LN3955:
-        call      uint16_lsbit                                  #4193.30
-                                # LOE eax
-..B25.48:                       # Preds ..B25.19
-        popl      %ecx                                          #4193.30
-        movl      %eax, -44(%ebp)                               #4193.30
-                                # LOE
-..B25.20:                       # Preds ..B25.48
-        movl      -44(%ebp), %eax                               #4193.30
-        movswl    %ax, %eax                                     #4193.30
-..LN3957:
-        movl      %eax, -60(%ebp)                               #4193.28
-..LN3959:
-        movl      -72(%ebp), %eax                               #4198.28
-..LN3961:
-        addl      %eax, %eax                                    #4198.34
-..LN3963:
-        movl      %eax, -72(%ebp)                               #4198.21
-..LN3965:
-        movl      -68(%ebp), %eax                               #4199.28
-..LN3967:
-        lea       1(%eax,%eax), %eax                            #4199.40
-..LN3969:
-        movl      %eax, -68(%ebp)                               #4199.21
-..LN3971:
-        movl      -64(%ebp), %eax                               #4200.28
-..LN3973:
-        lea       2(%eax,%eax), %eax                            #4200.40
-..LN3975:
-        movl      %eax, -64(%ebp)                               #4200.21
-..LN3977:
-        movl      -60(%ebp), %eax                               #4201.28
-..LN3979:
-        lea       3(%eax,%eax), %eax                            #4201.40
-..LN3981:
-        movl      %eax, -60(%ebp)                               #4201.21
-..LN3983:
-        movl      -16(%ebp), %eax                               #4205.26
-..LN3985:
-        testl     %eax, %eax                                    #4205.32
-        je        ..B25.23      # Prob 50%                      #4205.32
-                                # LOE
-..B25.21:                       # Preds ..B25.20
-..LN3987:
-        movl      -72(%ebp), %eax                               #4205.43
-        addl      16(%ebx), %eax                                #4205.43
-..LN3989:
-        movl      -32(%ebp), %edx                               #4205.49
-        cmpl      %edx, %eax                                    #4205.49
-        ja        ..B25.23      # Prob 50%                      #4205.49
-                                # LOE
-..B25.22:                       # Preds ..B25.21
-..LN3991:
-        movl      $1, %eax                                      #4205.63
-        leave                                                   #4205.63
-..___tag_value_eval_4na_16.765:                                 #
-        movl      %ebx, %esp                                    #4205.63
-        popl      %ebx                                          #4205.63
-..___tag_value_eval_4na_16.766:                                 #
-        ret                                                     #4205.63
-..___tag_value_eval_4na_16.768:                                 #
-                                # LOE
-..B25.23:                       # Preds ..B25.21 ..B25.20
-..LN3993:
-        movl      -20(%ebp), %eax                               #4206.26
-..LN3995:
-        testl     %eax, %eax                                    #4206.32
-        je        ..B25.26      # Prob 50%                      #4206.32
-                                # LOE
-..B25.24:                       # Preds ..B25.23
-..LN3997:
-        movl      -68(%ebp), %eax                               #4206.43
-        addl      16(%ebx), %eax                                #4206.43
-..LN3999:
-        movl      -32(%ebp), %edx                               #4206.49
-        cmpl      %edx, %eax                                    #4206.49
-        ja        ..B25.26      # Prob 50%                      #4206.49
-                                # LOE
-..B25.25:                       # Preds ..B25.24
-..LN4001:
-        movl      $1, %eax                                      #4206.63
-        leave                                                   #4206.63
-..___tag_value_eval_4na_16.772:                                 #
-        movl      %ebx, %esp                                    #4206.63
-        popl      %ebx                                          #4206.63
-..___tag_value_eval_4na_16.773:                                 #
-        ret                                                     #4206.63
-..___tag_value_eval_4na_16.775:                                 #
-                                # LOE
-..B25.26:                       # Preds ..B25.24 ..B25.23
-..LN4003:
-        movl      -24(%ebp), %eax                               #4207.26
-..LN4005:
-        testl     %eax, %eax                                    #4207.32
-        je        ..B25.29      # Prob 50%                      #4207.32
-                                # LOE
-..B25.27:                       # Preds ..B25.26
-..LN4007:
-        movl      -64(%ebp), %eax                               #4207.43
-        addl      16(%ebx), %eax                                #4207.43
-..LN4009:
-        movl      -32(%ebp), %edx                               #4207.49
-        cmpl      %edx, %eax                                    #4207.49
-        ja        ..B25.29      # Prob 50%                      #4207.49
-                                # LOE
-..B25.28:                       # Preds ..B25.27
-..LN4011:
-        movl      $1, %eax                                      #4207.63
-        leave                                                   #4207.63
-..___tag_value_eval_4na_16.779:                                 #
-        movl      %ebx, %esp                                    #4207.63
-        popl      %ebx                                          #4207.63
-..___tag_value_eval_4na_16.780:                                 #
-        ret                                                     #4207.63
-..___tag_value_eval_4na_16.782:                                 #
-                                # LOE
-..B25.29:                       # Preds ..B25.27 ..B25.26
-..LN4013:
-        movl      -40(%ebp), %eax                               #4208.26
-..LN4015:
-        testl     %eax, %eax                                    #4208.32
-        je        ..B25.32      # Prob 50%                      #4208.32
-                                # LOE
-..B25.30:                       # Preds ..B25.29
-..LN4017:
-        movl      -60(%ebp), %eax                               #4208.43
-        addl      16(%ebx), %eax                                #4208.43
-..LN4019:
-        movl      -32(%ebp), %edx                               #4208.49
-        cmpl      %edx, %eax                                    #4208.49
-        ja        ..B25.32      # Prob 50%                      #4208.49
-                                # LOE
-..B25.31:                       # Preds ..B25.30
-..LN4021:
-        movl      $1, %eax                                      #4208.63
-        leave                                                   #4208.63
-..___tag_value_eval_4na_16.786:                                 #
-        movl      %ebx, %esp                                    #4208.63
-        popl      %ebx                                          #4208.63
-..___tag_value_eval_4na_16.787:                                 #
-        ret                                                     #4208.63
-..___tag_value_eval_4na_16.789:                                 #
-                                # LOE
-..B25.32:                       # Preds ..B25.30 ..B25.29 ..B25.15
-..LN4023:
-        movl      16(%ebx), %eax                                #4213.17
-        addl      $4, %eax                                      #4213.17
-        movl      %eax, 16(%ebx)                                #4213.17
-..LN4025:
-        movl      16(%ebx), %eax                                #4216.22
-..LN4027:
-        movl      -32(%ebp), %edx                               #4216.28
-        cmpl      %edx, %eax                                    #4216.28
-        jbe       ..B25.34      # Prob 50%                      #4216.28
-                                # LOE
-..B25.33:                       # Preds ..B25.32
-..LN4029:
-        xorl      %eax, %eax                                    #4217.28
-        leave                                                   #4217.28
-..___tag_value_eval_4na_16.793:                                 #
-        movl      %ebx, %esp                                    #4217.28
-        popl      %ebx                                          #4217.28
-..___tag_value_eval_4na_16.794:                                 #
-        ret                                                     #4217.28
-..___tag_value_eval_4na_16.796:                                 #
-                                # LOE
-..B25.34:                       # Preds ..B25.32
-..LN4031:
-        movl      -12(%ebp), %eax                               #4220.25
-        decl      %eax                                          #4220.25
-        movl      %eax, -12(%ebp)                               #4220.25
-..LN4033:
-        jne       ..B25.10      # Prob 50%                      #4220.39
-                                # LOE
-..B25.36:                       # Preds ..B25.34 ..B25.10
-..LN4035:
-        movl      -36(%ebp), %eax                               #4237.18
-..LN4037:
-        movl      -28(%ebp), %edx                               #4237.25
-        cmpl      %edx, %eax                                    #4237.25
-        jae       ..B25.40      # Prob 50%                      #4237.25
-                                # LOE
-..B25.37:                       # Preds ..B25.36
-..LN4039:
-        movl      16(%ebx), %eax                                #4241.13
-        addl      $28, %eax                                     #4241.13
-        movl      %eax, 16(%ebx)                                #4241.13
-..LN4041:
-        movl      16(%ebx), %eax                                #4242.18
-..LN4043:
-        movl      -32(%ebp), %edx                               #4242.24
-        cmpl      %edx, %eax                                    #4242.24
-        ja        ..B25.40      # Prob 50%                      #4242.24
-                                # LOE
-..B25.38:                       # Preds ..B25.37
-..LN4045:
-        addl      $-8, %esp                                     #4247.22
-..LN4047:
-        movl      -36(%ebp), %eax                               #4247.41
-        movl      %eax, (%esp)                                  #4247.41
-..LN4049:
-        movl      -28(%ebp), %eax                               #4247.46
-        movl      %eax, 4(%esp)                                 #4247.46
-..LN4051:
-        call      prime_buffer_4na                              #4247.22
-                                # LOE xmm0
-..B25.49:                       # Preds ..B25.38
-        addl      $8, %esp                                      #4247.22
-        movdqa    %xmm0, -280(%ebp)                             #4247.22
-                                # LOE
-..B25.39:                       # Preds ..B25.49
-..LN4053:
-        movdqa    -280(%ebp), %xmm0                             #4247.13
-        movdqa    %xmm0, -232(%ebp)                             #4247.13
-..LN4055:
-        addl      $8, -36(%ebp)                                 #4262.13
-        jmp       ..B25.8       # Prob 100%                     #4262.13
-                                # LOE
-..B25.40:                       # Preds ..B25.37 ..B25.36 ..B25.8
-..LN4057:
-        xorl      %eax, %eax                                    #4273.12
-        leave                                                   #4273.12
-..___tag_value_eval_4na_16.800:                                 #
-        movl      %ebx, %esp                                    #4273.12
-        popl      %ebx                                          #4273.12
-..___tag_value_eval_4na_16.801:                                 #
-        ret                                                     #4273.12
-        .align    2,0x90
-..___tag_value_eval_4na_16.803:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-.LNeval_4na_16:
-	.data
-# -- End  eval_4na_16
-	.section .rodata, "a"
-	.align 4
-__$Uc:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	51
-	.byte	50
-	.byte	0
-	.type	__$Uc, at object
-	.size	__$Uc,12
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    2,0x90
-eval_4na_32:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B26.1:                        # Preds ..B26.0
-..___tag_value_eval_4na_32.806:                                 #
-..LN4059:
-        pushl     %ebx                                          #4279.1
-..___tag_value_eval_4na_32.811:                                 #
-        movl      %esp, %ebx                                    #4279.1
-..___tag_value_eval_4na_32.812:                                 #
-        andl      $-16, %esp                                    #4279.1
-        pushl     %ebp                                          #4279.1
-        pushl     %ebp                                          #4279.1
-        movl      4(%ebx), %ebp                                 #4279.1
-        movl      %ebp, 4(%esp)                                 #4279.1
-        movl      %esp, %ebp                                    #4279.1
-..___tag_value_eval_4na_32.814:                                 #
-        subl      $312, %esp                                    #4279.1
-        movl      %ebx, -312(%ebp)                              #4279.1
-        call      ..L816        # Prob 100%                     #4279.1
-..L816:                                                         #
-        popl      %eax                                          #4279.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L816], %eax     #4279.1
-        movl      %eax, -12(%ebp)                               #4279.1
-..LN4061:
-        movl      8(%ebx), %eax                                 #4305.25
-        movl      4(%eax), %eax                                 #4305.25
-..LN4063:
-        movl      %eax, -16(%ebp)                               #4305.23
-..LN4065:
-        movl      20(%ebx), %eax                                #4308.5
-        movl      -16(%ebp), %edx                               #4308.5
-        cmpl      %edx, %eax                                    #4308.5
-        jae       ..B26.3       # Prob 50%                      #4308.5
-                                # LOE
-..B26.2:                        # Preds ..B26.1
-        addl      $-16, %esp                                    #4308.5
-        movl      -12(%ebp), %eax                               #4308.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %eax               #4308.5
-        movl      %eax, (%esp)                                  #4308.5
-        movl      -12(%ebp), %eax                               #4308.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #4308.5
-        movl      %eax, 4(%esp)                                 #4308.5
-        movl      $4308, 8(%esp)                                #4308.5
-        movl      -12(%ebp), %eax                               #4308.5
-        lea       __$Uc at GOTOFF(%eax), %eax                      #4308.5
-        movl      %eax, 12(%esp)                                #4308.5
-        movl      -12(%ebp), %eax                               #4308.5
-        movl      %eax, %ebx                                    #4308.5
-..___tag_value_eval_4na_32.817:                                 #4308.5
-        call      __assert_fail at PLT                             #4308.5
-        movl      -312(%ebp), %ebx                              #4308.5
-..___tag_value_eval_4na_32.818:                                 #
-                                # LOE
-..B26.46:                       # Preds ..B26.2
-        addl      $16, %esp                                     #4308.5
-                                # LOE
-..B26.3:                        # Preds ..B26.1
-..LN4067:
-        movl      16(%ebx), %eax                                #4312.12
-..LN4069:
-        addl      20(%ebx), %eax                                #4312.5
-        movl      %eax, 20(%ebx)                                #4312.5
-..LN4071:
-        movl      16(%ebx), %eax                                #4315.42
-..LN4073:
-        shrl      $2, %eax                                      #4315.49
-..LN4075:
-        addl      12(%ebx), %eax                                #4315.30
-..LN4077:
-        movl      %eax, -52(%ebp)                               #4315.5
-..LN4079:
-        movl      -16(%ebp), %eax                               #4318.18
-        negl      %eax                                          #4318.18
-        addl      20(%ebx), %eax                                #4318.18
-..LN4081:
-        movl      %eax, -48(%ebp)                               #4318.5
-..LN4083:
-        movl      20(%ebx), %eax                                #4321.44
-..LN4085:
-        addl      $3, %eax                                      #4321.50
-..LN4087:
-        shrl      $2, %eax                                      #4321.57
-..LN4089:
-        addl      12(%ebx), %eax                                #4321.30
-..LN4091:
-        movl      %eax, -44(%ebp)                               #4321.5
-..LN4093:
-        addl      $-8, %esp                                     #4324.14
-..LN4095:
-        movl      -52(%ebp), %eax                               #4324.33
-        movl      %eax, (%esp)                                  #4324.33
-..LN4097:
-        movl      -44(%ebp), %eax                               #4324.38
-        movl      %eax, 4(%esp)                                 #4324.38
-..LN4099:
-        call      prime_buffer_4na                              #4324.14
-                                # LOE xmm0
-..B26.47:                       # Preds ..B26.3
-        addl      $8, %esp                                      #4324.14
-        movdqa    %xmm0, -104(%ebp)                             #4324.14
-                                # LOE
-..B26.4:                        # Preds ..B26.47
-..LN4101:
-        movdqa    -104(%ebp), %xmm0                             #4324.5
-        movdqa    %xmm0, -248(%ebp)                             #4324.5
-..LN4103:
-        addl      $8, -52(%ebp)                                 #4325.5
-..LN4105:
-        movl      -52(%ebp), %eax                               #4327.9
-..LN4107:
-        movl      %eax, -40(%ebp)                               #4327.5
-..LN4109:
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    16(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -232(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    32(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -216(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    48(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -200(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    64(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -184(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    80(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -168(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    96(%eax), %xmm0                               #4331.5
-        movdqa    %xmm0, -152(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    112(%eax), %xmm0                              #4331.5
-        movdqa    %xmm0, -136(%ebp)                             #4331.5
-        movl      8(%ebx), %eax                                 #4331.5
-        movdqa    128(%eax), %xmm0                              #4331.5
-        movdqa    %xmm0, -120(%ebp)                             #4331.5
-..LN4111:
-        xorl      %eax, %eax                                    #4334.15
-        movl      %eax, -36(%ebp)                               #4334.15
-..LN4113:
-        movl      %eax, -32(%ebp)                               #4334.10
-..LN4115:
-        movl      %eax, -28(%ebp)                               #4334.5
-..LN4117:
-        movl      $2, -24(%ebp)                                 #4340.5
-..LN4119:
-        movl      16(%ebx), %eax                                #4345.14
-..LN4121:
-        andl      $3, %eax                                      #4345.20
-        movl      %eax, -20(%ebp)                               #4345.20
-        je        ..B26.12      # Prob 50%                      #4345.20
-                                # LOE
-..B26.5:                        # Preds ..B26.4
-        movl      -20(%ebp), %eax                               #4345.20
-        cmpl      $1, %eax                                      #4345.20
-        je        ..B26.13      # Prob 50%                      #4345.20
-                                # LOE
-..B26.6:                        # Preds ..B26.5
-        movl      -20(%ebp), %eax                               #4345.20
-        cmpl      $2, %eax                                      #4345.20
-        je        ..B26.14      # Prob 50%                      #4345.20
-                                # LOE
-..B26.7:                        # Preds ..B26.6
-        movl      -20(%ebp), %eax                               #4345.20
-        cmpl      $3, %eax                                      #4345.20
-        je        ..B26.15      # Prob 50%                      #4345.20
-                                # LOE
-..B26.8:                        # Preds ..B26.42 ..B26.7
-..LN4123:
-        movl      $1, %eax                                      #4350.9
-        testl     %eax, %eax                                    #4350.9
-        je        ..B26.43      # Prob 100%                     #4350.9
-                                # LOE
-..B26.9:                        # Preds ..B26.8
-..LN4125:
-        movl      $2, -24(%ebp)                                 #4352.13
-                                # LOE
-..B26.10:                       # Preds ..B26.37 ..B26.9
-..LN4127:
-        movl      $1, %eax                                      #4355.13
-        testl     %eax, %eax                                    #4355.13
-        je        ..B26.39      # Prob 100%                     #4355.13
-                                # LOE
-..B26.12:                       # Preds ..B26.4 ..B26.10
-..LN4129:
-        movdqa    -248(%ebp), %xmm0                             #4362.38
-..LN4131:
-        movdqa    -232(%ebp), %xmm1                             #4362.46
-..LN4133:
-        pand      %xmm1, %xmm0                                  #4362.22
-..LN4135:
-        movdqa    %xmm0, -280(%ebp)                             #4362.17
-..LN4137:
-        movdqa    -248(%ebp), %xmm0                             #4363.38
-..LN4139:
-        movdqa    -216(%ebp), %xmm1                             #4363.46
-..LN4141:
-        pand      %xmm1, %xmm0                                  #4363.22
-..LN4143:
-        movdqa    %xmm0, -264(%ebp)                             #4363.17
-..LN4145:
-        movdqa    -280(%ebp), %xmm0                             #4364.22
-        movdqa    -264(%ebp), %xmm1                             #4364.22
-        pcmpeqd   %xmm1, %xmm0                                  #4364.22
-..LN4147:
-        movdqa    %xmm0, -280(%ebp)                             #4364.17
-..LN4149:
-        movdqa    -280(%ebp), %xmm0                             #4365.42
-..LN4151:
-        pmovmskb  %xmm0, %eax                                   #4365.22
-..LN4153:
-        movl      %eax, -28(%ebp)                               #4365.17
-                                # LOE
-..B26.13:                       # Preds ..B26.5 ..B26.12
-..LN4155:
-        movdqa    -248(%ebp), %xmm0                             #4369.38
-..LN4157:
-        movdqa    -200(%ebp), %xmm1                             #4369.46
-..LN4159:
-        pand      %xmm1, %xmm0                                  #4369.22
-..LN4161:
-        movdqa    %xmm0, -280(%ebp)                             #4369.17
-..LN4163:
-        movdqa    -248(%ebp), %xmm0                             #4370.38
-..LN4165:
-        movdqa    -184(%ebp), %xmm1                             #4370.46
-..LN4167:
-        pand      %xmm1, %xmm0                                  #4370.22
-..LN4169:
-        movdqa    %xmm0, -264(%ebp)                             #4370.17
-..LN4171:
-        movdqa    -280(%ebp), %xmm0                             #4371.22
-        movdqa    -264(%ebp), %xmm1                             #4371.22
-        pcmpeqd   %xmm1, %xmm0                                  #4371.22
-..LN4173:
-        movdqa    %xmm0, -280(%ebp)                             #4371.17
-..LN4175:
-        movdqa    -280(%ebp), %xmm0                             #4372.42
-..LN4177:
-        pmovmskb  %xmm0, %eax                                   #4372.22
-..LN4179:
-        movl      %eax, -32(%ebp)                               #4372.17
-                                # LOE
-..B26.14:                       # Preds ..B26.6 ..B26.13
-..LN4181:
-        movdqa    -248(%ebp), %xmm0                             #4376.38
-..LN4183:
-        movdqa    -168(%ebp), %xmm1                             #4376.46
-..LN4185:
-        pand      %xmm1, %xmm0                                  #4376.22
-..LN4187:
-        movdqa    %xmm0, -280(%ebp)                             #4376.17
-..LN4189:
-        movdqa    -248(%ebp), %xmm0                             #4377.38
-..LN4191:
-        movdqa    -152(%ebp), %xmm1                             #4377.46
-..LN4193:
-        pand      %xmm1, %xmm0                                  #4377.22
-..LN4195:
-        movdqa    %xmm0, -264(%ebp)                             #4377.17
-..LN4197:
-        movdqa    -280(%ebp), %xmm0                             #4378.22
-        movdqa    -264(%ebp), %xmm1                             #4378.22
-        pcmpeqd   %xmm1, %xmm0                                  #4378.22
-..LN4199:
-        movdqa    %xmm0, -280(%ebp)                             #4378.17
-..LN4201:
-        movdqa    -280(%ebp), %xmm0                             #4379.42
-..LN4203:
-        pmovmskb  %xmm0, %eax                                   #4379.22
-..LN4205:
-        movl      %eax, -36(%ebp)                               #4379.17
-                                # LOE
-..B26.15:                       # Preds ..B26.7 ..B26.14
-..LN4207:
-        movdqa    -248(%ebp), %xmm0                             #4383.38
-..LN4209:
-        movdqa    -136(%ebp), %xmm1                             #4383.46
-..LN4211:
-        pand      %xmm1, %xmm0                                  #4383.22
-..LN4213:
-        movdqa    %xmm0, -280(%ebp)                             #4383.17
-..LN4215:
-        movdqa    -248(%ebp), %xmm0                             #4384.38
-..LN4217:
-        movdqa    -120(%ebp), %xmm1                             #4384.46
-..LN4219:
-        pand      %xmm1, %xmm0                                  #4384.22
-..LN4221:
-        movdqa    %xmm0, -264(%ebp)                             #4384.17
-..LN4223:
-        movdqa    -280(%ebp), %xmm0                             #4385.22
-        movdqa    -264(%ebp), %xmm1                             #4385.22
-        pcmpeqd   %xmm1, %xmm0                                  #4385.22
-..LN4225:
-        movdqa    %xmm0, -280(%ebp)                             #4385.17
-..LN4227:
-        movdqa    -280(%ebp), %xmm0                             #4386.42
-..LN4229:
-        pmovmskb  %xmm0, %eax                                   #4386.22
-..LN4231:
-        movl      %eax, -56(%ebp)                               #4386.17
-..LN4233:
-        movl      16(%ebx), %eax                                #4391.17
-        andl      $-4, %eax                                     #4391.17
-        movl      %eax, 16(%ebx)                                #4391.17
-..LN4235:
-        movl      -32(%ebp), %eax                               #4394.29
-        orl       -28(%ebp), %eax                               #4394.29
-..LN4237:
-        orl       -36(%ebp), %eax                               #4394.34
-..LN4239:
-        orl       -56(%ebp), %eax                               #4394.39
-..LN4241:
-        je        ..B26.32      # Prob 50%                      #4394.47
-                                # LOE
-..B26.16:                       # Preds ..B26.15
-..LN4243:
-        pushl     %edi                                          #4412.30
-..LN4245:
-        movl      -28(%ebp), %eax                               #4412.58
-        movw      %ax, (%esp)                                   #4412.58
-..LN4247:
-        call      uint16_lsbit                                  #4412.30
-                                # LOE eax
-..B26.48:                       # Preds ..B26.16
-        popl      %ecx                                          #4412.30
-        movl      %eax, -72(%ebp)                               #4412.30
-                                # LOE
-..B26.17:                       # Preds ..B26.48
-        movl      -72(%ebp), %eax                               #4412.30
-        movswl    %ax, %eax                                     #4412.30
-..LN4249:
-        movl      %eax, -88(%ebp)                               #4412.28
-..LN4251:
-        pushl     %edi                                          #4413.30
-..LN4253:
-        movl      -32(%ebp), %eax                               #4413.58
-        movw      %ax, (%esp)                                   #4413.58
-..LN4255:
-        call      uint16_lsbit                                  #4413.30
-                                # LOE eax
-..B26.49:                       # Preds ..B26.17
-        popl      %ecx                                          #4413.30
-        movl      %eax, -68(%ebp)                               #4413.30
-                                # LOE
-..B26.18:                       # Preds ..B26.49
-        movl      -68(%ebp), %eax                               #4413.30
-        movswl    %ax, %eax                                     #4413.30
-..LN4257:
-        movl      %eax, -84(%ebp)                               #4413.28
-..LN4259:
-        pushl     %edi                                          #4414.30
-..LN4261:
-        movl      -36(%ebp), %eax                               #4414.58
-        movw      %ax, (%esp)                                   #4414.58
-..LN4263:
-        call      uint16_lsbit                                  #4414.30
-                                # LOE eax
-..B26.50:                       # Preds ..B26.18
-        popl      %ecx                                          #4414.30
-        movl      %eax, -64(%ebp)                               #4414.30
-                                # LOE
-..B26.19:                       # Preds ..B26.50
-        movl      -64(%ebp), %eax                               #4414.30
-        movswl    %ax, %eax                                     #4414.30
-..LN4265:
-        movl      %eax, -80(%ebp)                               #4414.28
-..LN4267:
-        pushl     %edi                                          #4415.30
-..LN4269:
-        movl      -56(%ebp), %eax                               #4415.58
-        movw      %ax, (%esp)                                   #4415.58
-..LN4271:
-        call      uint16_lsbit                                  #4415.30
-                                # LOE eax
-..B26.51:                       # Preds ..B26.19
-        popl      %ecx                                          #4415.30
-        movl      %eax, -60(%ebp)                               #4415.30
-                                # LOE
-..B26.20:                       # Preds ..B26.51
-        movl      -60(%ebp), %eax                               #4415.30
-        movswl    %ax, %eax                                     #4415.30
-..LN4273:
-        movl      %eax, -76(%ebp)                               #4415.28
-..LN4275:
-        movl      -88(%ebp), %eax                               #4420.28
-..LN4277:
-        addl      %eax, %eax                                    #4420.34
-..LN4279:
-        movl      %eax, -88(%ebp)                               #4420.21
-..LN4281:
-        movl      -84(%ebp), %eax                               #4421.28
-..LN4283:
-        lea       1(%eax,%eax), %eax                            #4421.40
-..LN4285:
-        movl      %eax, -84(%ebp)                               #4421.21
-..LN4287:
-        movl      -80(%ebp), %eax                               #4422.28
-..LN4289:
-        lea       2(%eax,%eax), %eax                            #4422.40
-..LN4291:
-        movl      %eax, -80(%ebp)                               #4422.21
-..LN4293:
-        movl      -76(%ebp), %eax                               #4423.28
-..LN4295:
-        lea       3(%eax,%eax), %eax                            #4423.40
-..LN4297:
-        movl      %eax, -76(%ebp)                               #4423.21
-..LN4299:
-        movl      -28(%ebp), %eax                               #4427.26
-..LN4301:
-        testl     %eax, %eax                                    #4427.32
-        je        ..B26.23      # Prob 50%                      #4427.32
-                                # LOE
-..B26.21:                       # Preds ..B26.20
-..LN4303:
-        movl      -88(%ebp), %eax                               #4427.43
-        addl      16(%ebx), %eax                                #4427.43
-..LN4305:
-        movl      -48(%ebp), %edx                               #4427.49
-        cmpl      %edx, %eax                                    #4427.49
-        ja        ..B26.23      # Prob 50%                      #4427.49
-                                # LOE
-..B26.22:                       # Preds ..B26.21
-..LN4307:
-        movl      $1, %eax                                      #4427.63
-        leave                                                   #4427.63
-..___tag_value_eval_4na_32.820:                                 #
-        movl      %ebx, %esp                                    #4427.63
-        popl      %ebx                                          #4427.63
-..___tag_value_eval_4na_32.821:                                 #
-        ret                                                     #4427.63
-..___tag_value_eval_4na_32.823:                                 #
-                                # LOE
-..B26.23:                       # Preds ..B26.21 ..B26.20
-..LN4309:
-        movl      -32(%ebp), %eax                               #4428.26
-..LN4311:
-        testl     %eax, %eax                                    #4428.32
-        je        ..B26.26      # Prob 50%                      #4428.32
-                                # LOE
-..B26.24:                       # Preds ..B26.23
-..LN4313:
-        movl      -84(%ebp), %eax                               #4428.43
-        addl      16(%ebx), %eax                                #4428.43
-..LN4315:
-        movl      -48(%ebp), %edx                               #4428.49
-        cmpl      %edx, %eax                                    #4428.49
-        ja        ..B26.26      # Prob 50%                      #4428.49
-                                # LOE
-..B26.25:                       # Preds ..B26.24
-..LN4317:
-        movl      $1, %eax                                      #4428.63
-        leave                                                   #4428.63
-..___tag_value_eval_4na_32.827:                                 #
-        movl      %ebx, %esp                                    #4428.63
-        popl      %ebx                                          #4428.63
-..___tag_value_eval_4na_32.828:                                 #
-        ret                                                     #4428.63
-..___tag_value_eval_4na_32.830:                                 #
-                                # LOE
-..B26.26:                       # Preds ..B26.24 ..B26.23
-..LN4319:
-        movl      -36(%ebp), %eax                               #4429.26
-..LN4321:
-        testl     %eax, %eax                                    #4429.32
-        je        ..B26.29      # Prob 50%                      #4429.32
-                                # LOE
-..B26.27:                       # Preds ..B26.26
-..LN4323:
-        movl      -80(%ebp), %eax                               #4429.43
-        addl      16(%ebx), %eax                                #4429.43
-..LN4325:
-        movl      -48(%ebp), %edx                               #4429.49
-        cmpl      %edx, %eax                                    #4429.49
-        ja        ..B26.29      # Prob 50%                      #4429.49
-                                # LOE
-..B26.28:                       # Preds ..B26.27
-..LN4327:
-        movl      $1, %eax                                      #4429.63
-        leave                                                   #4429.63
-..___tag_value_eval_4na_32.834:                                 #
-        movl      %ebx, %esp                                    #4429.63
-        popl      %ebx                                          #4429.63
-..___tag_value_eval_4na_32.835:                                 #
-        ret                                                     #4429.63
-..___tag_value_eval_4na_32.837:                                 #
-                                # LOE
-..B26.29:                       # Preds ..B26.27 ..B26.26
-..LN4329:
-        movl      -56(%ebp), %eax                               #4430.26
-..LN4331:
-        testl     %eax, %eax                                    #4430.32
-        je        ..B26.32      # Prob 50%                      #4430.32
-                                # LOE
-..B26.30:                       # Preds ..B26.29
-..LN4333:
-        movl      -76(%ebp), %eax                               #4430.43
-        addl      16(%ebx), %eax                                #4430.43
-..LN4335:
-        movl      -48(%ebp), %edx                               #4430.49
-        cmpl      %edx, %eax                                    #4430.49
-        ja        ..B26.32      # Prob 50%                      #4430.49
-                                # LOE
-..B26.31:                       # Preds ..B26.30
-..LN4337:
-        movl      $1, %eax                                      #4430.63
-        leave                                                   #4430.63
-..___tag_value_eval_4na_32.841:                                 #
-        movl      %ebx, %esp                                    #4430.63
-        popl      %ebx                                          #4430.63
-..___tag_value_eval_4na_32.842:                                 #
-        ret                                                     #4430.63
-..___tag_value_eval_4na_32.844:                                 #
-                                # LOE
-..B26.32:                       # Preds ..B26.30 ..B26.29 ..B26.15
-..LN4339:
-        movl      16(%ebx), %eax                                #4435.17
-        addl      $4, %eax                                      #4435.17
-        movl      %eax, 16(%ebx)                                #4435.17
-..LN4341:
-        movl      16(%ebx), %eax                                #4438.22
-..LN4343:
-        movl      -48(%ebp), %edx                               #4438.28
-        cmpl      %edx, %eax                                    #4438.28
-        jbe       ..B26.34      # Prob 50%                      #4438.28
-                                # LOE
-..B26.33:                       # Preds ..B26.32
-..LN4345:
-        xorl      %eax, %eax                                    #4439.28
-        leave                                                   #4439.28
-..___tag_value_eval_4na_32.848:                                 #
-        movl      %ebx, %esp                                    #4439.28
-        popl      %ebx                                          #4439.28
-..___tag_value_eval_4na_32.849:                                 #
-        ret                                                     #4439.28
-..___tag_value_eval_4na_32.851:                                 #
-                                # LOE
-..B26.34:                       # Preds ..B26.32
-..LN4347:
-        movl      -24(%ebp), %eax                               #4442.25
-        decl      %eax                                          #4442.25
-        movl      %eax, -24(%ebp)                               #4442.25
-..LN4349:
-        je        ..B26.39      # Prob 50%                      #4442.39
-                                # LOE
-..B26.35:                       # Preds ..B26.34
-..LN4351:
-        movdqa    -248(%ebp), %xmm0                             #4447.43
-..LN4353:
-        psrldq    $2, %xmm0                                     #4447.26
-..LN4355:
-        movdqa    %xmm0, -248(%ebp)                             #4447.17
-..LN4357:
-        movl      -40(%ebp), %eax                               #4450.22
-..LN4359:
-        movl      -44(%ebp), %edx                               #4450.26
-        cmpl      %edx, %eax                                    #4450.26
-        jae       ..B26.37      # Prob 50%                      #4450.26
-                                # LOE
-..B26.36:                       # Preds ..B26.35
-..LN4361:
-        movdqa    -248(%ebp), %xmm0                             #4451.49
-..LN4363:
-        movl      -40(%ebp), %eax                               #4451.72
-        movzbl    (%eax), %eax                                  #4451.72
-        movzbl    %al, %eax                                     #4451.72
-..LN4365:
-        movl      -12(%ebp), %edx                               #4451.57
-        movzwl    expand_2na at GOTOFF(%edx,%eax,2), %eax          #4451.57
-        movzwl    %ax, %eax                                     #4451.57
-..LN4367:
-        pinsrw    $7, %eax, %xmm0                               #4451.30
-..LN4369:
-        movdqa    %xmm0, -248(%ebp)                             #4451.21
-                                # LOE
-..B26.37:                       # Preds ..B26.36 ..B26.35
-..LN4371:
-        incl      -40(%ebp)                                     #4454.20
-        jmp       ..B26.10      # Prob 100%                     #4454.20
-                                # LOE
-..B26.39:                       # Preds ..B26.34 ..B26.10
-..LN4373:
-        movl      -52(%ebp), %eax                               #4459.18
-..LN4375:
-        movl      -44(%ebp), %edx                               #4459.25
-        cmpl      %edx, %eax                                    #4459.25
-        jae       ..B26.43      # Prob 50%                      #4459.25
-                                # LOE
-..B26.40:                       # Preds ..B26.39
-..LN4377:
-        movl      16(%ebx), %eax                                #4463.13
-        addl      $24, %eax                                     #4463.13
-        movl      %eax, 16(%ebx)                                #4463.13
-..LN4379:
-        movl      16(%ebx), %eax                                #4464.18
-..LN4381:
-        movl      -48(%ebp), %edx                               #4464.24
-        cmpl      %edx, %eax                                    #4464.24
-        ja        ..B26.43      # Prob 50%                      #4464.24
-                                # LOE
-..B26.41:                       # Preds ..B26.40
-..LN4383:
-        addl      $-8, %esp                                     #4469.22
-..LN4385:
-        movl      -52(%ebp), %eax                               #4469.41
-        movl      %eax, (%esp)                                  #4469.41
-..LN4387:
-        movl      -44(%ebp), %eax                               #4469.46
-        movl      %eax, 4(%esp)                                 #4469.46
-..LN4389:
-        call      prime_buffer_4na                              #4469.22
-                                # LOE xmm0
-..B26.52:                       # Preds ..B26.41
-        addl      $8, %esp                                      #4469.22
-        movdqa    %xmm0, -296(%ebp)                             #4469.22
-                                # LOE
-..B26.42:                       # Preds ..B26.52
-..LN4391:
-        movdqa    -296(%ebp), %xmm0                             #4469.13
-        movdqa    %xmm0, -248(%ebp)                             #4469.13
-..LN4393:
-        addl      $8, -52(%ebp)                                 #4484.13
-..LN4395:
-        movl      -52(%ebp), %eax                               #4486.17
-..LN4397:
-        movl      %eax, -40(%ebp)                               #4486.13
-        jmp       ..B26.8       # Prob 100%                     #4486.13
-                                # LOE
-..B26.43:                       # Preds ..B26.40 ..B26.39 ..B26.8
-..LN4399:
-        xorl      %eax, %eax                                    #4495.12
-        leave                                                   #4495.12
-..___tag_value_eval_4na_32.855:                                 #
-        movl      %ebx, %esp                                    #4495.12
-        popl      %ebx                                          #4495.12
-..___tag_value_eval_4na_32.856:                                 #
-        ret                                                     #4495.12
-        .align    2,0x90
-..___tag_value_eval_4na_32.858:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-.LNeval_4na_32:
-	.data
-# -- End  eval_4na_32
-	.section .rodata, "a"
-	.align 4
-__$Ud:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	54
-	.byte	52
-	.byte	0
-	.type	__$Ud, at object
-	.size	__$Ud,12
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    2,0x90
-eval_4na_64:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B27.1:                        # Preds ..B27.0
-..___tag_value_eval_4na_64.861:                                 #
-..LN4401:
-        pushl     %ebx                                          #4501.1
-..___tag_value_eval_4na_64.866:                                 #
-        movl      %esp, %ebx                                    #4501.1
-..___tag_value_eval_4na_64.867:                                 #
-        andl      $-16, %esp                                    #4501.1
-        pushl     %ebp                                          #4501.1
-        pushl     %ebp                                          #4501.1
-        movl      4(%ebx), %ebp                                 #4501.1
-        movl      %ebp, 4(%esp)                                 #4501.1
-        movl      %esp, %ebp                                    #4501.1
-..___tag_value_eval_4na_64.869:                                 #
-        subl      $312, %esp                                    #4501.1
-        movl      %ebx, -312(%ebp)                              #4501.1
-        call      ..L871        # Prob 100%                     #4501.1
-..L871:                                                         #
-        popl      %eax                                          #4501.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L871], %eax     #4501.1
-        movl      %eax, -12(%ebp)                               #4501.1
-..LN4403:
-        movl      8(%ebx), %eax                                 #4528.25
-        movl      4(%eax), %eax                                 #4528.25
-..LN4405:
-        movl      %eax, -16(%ebp)                               #4528.23
-..LN4407:
-        movl      20(%ebx), %eax                                #4531.5
-        movl      -16(%ebp), %edx                               #4531.5
-        cmpl      %edx, %eax                                    #4531.5
-        jae       ..B27.3       # Prob 50%                      #4531.5
-                                # LOE
-..B27.2:                        # Preds ..B27.1
-        addl      $-16, %esp                                    #4531.5
-        movl      -12(%ebp), %eax                               #4531.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %eax               #4531.5
-        movl      %eax, (%esp)                                  #4531.5
-        movl      -12(%ebp), %eax                               #4531.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #4531.5
-        movl      %eax, 4(%esp)                                 #4531.5
-        movl      $4531, 8(%esp)                                #4531.5
-        movl      -12(%ebp), %eax                               #4531.5
-        lea       __$Ud at GOTOFF(%eax), %eax                      #4531.5
-        movl      %eax, 12(%esp)                                #4531.5
-        movl      -12(%ebp), %eax                               #4531.5
-        movl      %eax, %ebx                                    #4531.5
-..___tag_value_eval_4na_64.872:                                 #4531.5
-        call      __assert_fail at PLT                             #4531.5
-        movl      -312(%ebp), %ebx                              #4531.5
-..___tag_value_eval_4na_64.873:                                 #
-                                # LOE
-..B27.46:                       # Preds ..B27.2
-        addl      $16, %esp                                     #4531.5
-                                # LOE
-..B27.3:                        # Preds ..B27.1
-..LN4409:
-        movl      16(%ebx), %eax                                #4535.12
-..LN4411:
-        addl      20(%ebx), %eax                                #4535.5
-        movl      %eax, 20(%ebx)                                #4535.5
-..LN4413:
-        movl      16(%ebx), %eax                                #4538.42
-..LN4415:
-        shrl      $2, %eax                                      #4538.49
-..LN4417:
-        addl      12(%ebx), %eax                                #4538.30
-..LN4419:
-        movl      %eax, -52(%ebp)                               #4538.5
-..LN4421:
-        movl      -16(%ebp), %eax                               #4541.18
-        negl      %eax                                          #4541.18
-        addl      20(%ebx), %eax                                #4541.18
-..LN4423:
-        movl      %eax, -48(%ebp)                               #4541.5
-..LN4425:
-        movl      20(%ebx), %eax                                #4544.44
-..LN4427:
-        addl      $3, %eax                                      #4544.50
-..LN4429:
-        shrl      $2, %eax                                      #4544.57
-..LN4431:
-        addl      12(%ebx), %eax                                #4544.30
-..LN4433:
-        movl      %eax, -44(%ebp)                               #4544.5
-..LN4435:
-        addl      $-8, %esp                                     #4547.14
-..LN4437:
-        movl      -52(%ebp), %eax                               #4547.33
-        movl      %eax, (%esp)                                  #4547.33
-..LN4439:
-        movl      -44(%ebp), %eax                               #4547.38
-        movl      %eax, 4(%esp)                                 #4547.38
-..LN4441:
-        call      prime_buffer_4na                              #4547.14
-                                # LOE xmm0
-..B27.47:                       # Preds ..B27.3
-        addl      $8, %esp                                      #4547.14
-        movdqa    %xmm0, -104(%ebp)                             #4547.14
-                                # LOE
-..B27.4:                        # Preds ..B27.47
-..LN4443:
-        movdqa    -104(%ebp), %xmm0                             #4547.5
-        movdqa    %xmm0, -248(%ebp)                             #4547.5
-..LN4445:
-        addl      $8, -52(%ebp)                                 #4548.5
-..LN4447:
-        movl      -52(%ebp), %eax                               #4550.9
-..LN4449:
-        movl      %eax, -40(%ebp)                               #4550.5
-..LN4451:
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    16(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -232(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    32(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -216(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    48(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -200(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    64(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -184(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    80(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -168(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    96(%eax), %xmm0                               #4554.5
-        movdqa    %xmm0, -152(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    112(%eax), %xmm0                              #4554.5
-        movdqa    %xmm0, -136(%ebp)                             #4554.5
-        movl      8(%ebx), %eax                                 #4554.5
-        movdqa    128(%eax), %xmm0                              #4554.5
-        movdqa    %xmm0, -120(%ebp)                             #4554.5
-..LN4453:
-        xorl      %eax, %eax                                    #4557.15
-        movl      %eax, -36(%ebp)                               #4557.15
-..LN4455:
-        movl      %eax, -32(%ebp)                               #4557.10
-..LN4457:
-        movl      %eax, -28(%ebp)                               #4557.5
-..LN4459:
-        movl      $4, -24(%ebp)                                 #4563.5
-..LN4461:
-        movl      16(%ebx), %eax                                #4568.14
-..LN4463:
-        andl      $3, %eax                                      #4568.20
-        movl      %eax, -20(%ebp)                               #4568.20
-        je        ..B27.12      # Prob 50%                      #4568.20
-                                # LOE
-..B27.5:                        # Preds ..B27.4
-        movl      -20(%ebp), %eax                               #4568.20
-        cmpl      $1, %eax                                      #4568.20
-        je        ..B27.13      # Prob 50%                      #4568.20
-                                # LOE
-..B27.6:                        # Preds ..B27.5
-        movl      -20(%ebp), %eax                               #4568.20
-        cmpl      $2, %eax                                      #4568.20
-        je        ..B27.14      # Prob 50%                      #4568.20
-                                # LOE
-..B27.7:                        # Preds ..B27.6
-        movl      -20(%ebp), %eax                               #4568.20
-        cmpl      $3, %eax                                      #4568.20
-        je        ..B27.15      # Prob 50%                      #4568.20
-                                # LOE
-..B27.8:                        # Preds ..B27.42 ..B27.7
-..LN4465:
-        movl      $1, %eax                                      #4573.9
-        testl     %eax, %eax                                    #4573.9
-        je        ..B27.43      # Prob 100%                     #4573.9
-                                # LOE
-..B27.9:                        # Preds ..B27.8
-..LN4467:
-        movl      $4, -24(%ebp)                                 #4575.13
-                                # LOE
-..B27.10:                       # Preds ..B27.37 ..B27.9
-..LN4469:
-        movl      $1, %eax                                      #4578.13
-        testl     %eax, %eax                                    #4578.13
-        je        ..B27.39      # Prob 100%                     #4578.13
-                                # LOE
-..B27.12:                       # Preds ..B27.4 ..B27.10
-..LN4471:
-        movdqa    -248(%ebp), %xmm0                             #4585.38
-..LN4473:
-        movdqa    -232(%ebp), %xmm1                             #4585.46
-..LN4475:
-        pand      %xmm1, %xmm0                                  #4585.22
-..LN4477:
-        movdqa    %xmm0, -280(%ebp)                             #4585.17
-..LN4479:
-        movdqa    -248(%ebp), %xmm0                             #4586.38
-..LN4481:
-        movdqa    -216(%ebp), %xmm1                             #4586.46
-..LN4483:
-        pand      %xmm1, %xmm0                                  #4586.22
-..LN4485:
-        movdqa    %xmm0, -264(%ebp)                             #4586.17
-..LN4487:
-        movdqa    -280(%ebp), %xmm0                             #4587.22
-        movdqa    -264(%ebp), %xmm1                             #4587.22
-        pcmpeqd   %xmm1, %xmm0                                  #4587.22
-..LN4489:
-        movdqa    %xmm0, -280(%ebp)                             #4587.17
-..LN4491:
-        movdqa    -280(%ebp), %xmm0                             #4588.42
-..LN4493:
-        pmovmskb  %xmm0, %eax                                   #4588.22
-..LN4495:
-        movl      %eax, -28(%ebp)                               #4588.17
-..LN4497:
-        movl      -28(%ebp), %eax                               #4589.17
-        andl      $3855, %eax                                   #4589.17
-        shll      $4, %eax                                      #4589.17
-        andl      -28(%ebp), %eax                               #4589.17
-        movl      %eax, -28(%ebp)                               #4589.17
-        movl      -28(%ebp), %eax                               #4589.17
-        sarl      $4, %eax                                      #4589.17
-        orl       -28(%ebp), %eax                               #4589.17
-        movl      %eax, -28(%ebp)                               #4589.17
-                                # LOE
-..B27.13:                       # Preds ..B27.5 ..B27.12
-..LN4499:
-        movdqa    -248(%ebp), %xmm0                             #4592.38
-..LN4501:
-        movdqa    -200(%ebp), %xmm1                             #4592.46
-..LN4503:
-        pand      %xmm1, %xmm0                                  #4592.22
-..LN4505:
-        movdqa    %xmm0, -280(%ebp)                             #4592.17
-..LN4507:
-        movdqa    -248(%ebp), %xmm0                             #4593.38
-..LN4509:
-        movdqa    -184(%ebp), %xmm1                             #4593.46
-..LN4511:
-        pand      %xmm1, %xmm0                                  #4593.22
-..LN4513:
-        movdqa    %xmm0, -264(%ebp)                             #4593.17
-..LN4515:
-        movdqa    -280(%ebp), %xmm0                             #4594.22
-        movdqa    -264(%ebp), %xmm1                             #4594.22
-        pcmpeqd   %xmm1, %xmm0                                  #4594.22
-..LN4517:
-        movdqa    %xmm0, -280(%ebp)                             #4594.17
-..LN4519:
-        movdqa    -280(%ebp), %xmm0                             #4595.42
-..LN4521:
-        pmovmskb  %xmm0, %eax                                   #4595.22
-..LN4523:
-        movl      %eax, -32(%ebp)                               #4595.17
-..LN4525:
-        movl      -32(%ebp), %eax                               #4596.17
-        andl      $3855, %eax                                   #4596.17
-        shll      $4, %eax                                      #4596.17
-        andl      -32(%ebp), %eax                               #4596.17
-        movl      %eax, -32(%ebp)                               #4596.17
-        movl      -32(%ebp), %eax                               #4596.17
-        sarl      $4, %eax                                      #4596.17
-        orl       -32(%ebp), %eax                               #4596.17
-        movl      %eax, -32(%ebp)                               #4596.17
-                                # LOE
-..B27.14:                       # Preds ..B27.6 ..B27.13
-..LN4527:
-        movdqa    -248(%ebp), %xmm0                             #4599.38
-..LN4529:
-        movdqa    -168(%ebp), %xmm1                             #4599.46
-..LN4531:
-        pand      %xmm1, %xmm0                                  #4599.22
-..LN4533:
-        movdqa    %xmm0, -280(%ebp)                             #4599.17
-..LN4535:
-        movdqa    -248(%ebp), %xmm0                             #4600.38
-..LN4537:
-        movdqa    -152(%ebp), %xmm1                             #4600.46
-..LN4539:
-        pand      %xmm1, %xmm0                                  #4600.22
-..LN4541:
-        movdqa    %xmm0, -264(%ebp)                             #4600.17
-..LN4543:
-        movdqa    -280(%ebp), %xmm0                             #4601.22
-        movdqa    -264(%ebp), %xmm1                             #4601.22
-        pcmpeqd   %xmm1, %xmm0                                  #4601.22
-..LN4545:
-        movdqa    %xmm0, -280(%ebp)                             #4601.17
-..LN4547:
-        movdqa    -280(%ebp), %xmm0                             #4602.42
-..LN4549:
-        pmovmskb  %xmm0, %eax                                   #4602.22
-..LN4551:
-        movl      %eax, -36(%ebp)                               #4602.17
-..LN4553:
-        movl      -36(%ebp), %eax                               #4603.17
-        andl      $3855, %eax                                   #4603.17
-        shll      $4, %eax                                      #4603.17
-        andl      -36(%ebp), %eax                               #4603.17
-        movl      %eax, -36(%ebp)                               #4603.17
-        movl      -36(%ebp), %eax                               #4603.17
-        sarl      $4, %eax                                      #4603.17
-        orl       -36(%ebp), %eax                               #4603.17
-        movl      %eax, -36(%ebp)                               #4603.17
-                                # LOE
-..B27.15:                       # Preds ..B27.7 ..B27.14
-..LN4555:
-        movdqa    -248(%ebp), %xmm0                             #4606.38
-..LN4557:
-        movdqa    -136(%ebp), %xmm1                             #4606.46
-..LN4559:
-        pand      %xmm1, %xmm0                                  #4606.22
-..LN4561:
-        movdqa    %xmm0, -280(%ebp)                             #4606.17
-..LN4563:
-        movdqa    -248(%ebp), %xmm0                             #4607.38
-..LN4565:
-        movdqa    -120(%ebp), %xmm1                             #4607.46
-..LN4567:
-        pand      %xmm1, %xmm0                                  #4607.22
-..LN4569:
-        movdqa    %xmm0, -264(%ebp)                             #4607.17
-..LN4571:
-        movdqa    -280(%ebp), %xmm0                             #4608.22
-        movdqa    -264(%ebp), %xmm1                             #4608.22
-        pcmpeqd   %xmm1, %xmm0                                  #4608.22
-..LN4573:
-        movdqa    %xmm0, -280(%ebp)                             #4608.17
-..LN4575:
-        movdqa    -280(%ebp), %xmm0                             #4609.42
-..LN4577:
-        pmovmskb  %xmm0, %eax                                   #4609.22
-..LN4579:
-        movl      %eax, -56(%ebp)                               #4609.17
-..LN4581:
-        movl      -56(%ebp), %eax                               #4610.17
-        andl      $3855, %eax                                   #4610.17
-        shll      $4, %eax                                      #4610.17
-        andl      -56(%ebp), %eax                               #4610.17
-        movl      %eax, -56(%ebp)                               #4610.17
-        movl      -56(%ebp), %eax                               #4610.17
-        sarl      $4, %eax                                      #4610.17
-        orl       -56(%ebp), %eax                               #4610.17
-        movl      %eax, -56(%ebp)                               #4610.17
-..LN4583:
-        movl      16(%ebx), %eax                                #4614.17
-        andl      $-4, %eax                                     #4614.17
-        movl      %eax, 16(%ebx)                                #4614.17
-..LN4585:
-        movl      -32(%ebp), %eax                               #4617.29
-        orl       -28(%ebp), %eax                               #4617.29
-..LN4587:
-        orl       -36(%ebp), %eax                               #4617.34
-..LN4589:
-        orl       -56(%ebp), %eax                               #4617.39
-..LN4591:
-        je        ..B27.32      # Prob 50%                      #4617.47
-                                # LOE
-..B27.16:                       # Preds ..B27.15
-..LN4593:
-        pushl     %edi                                          #4635.30
-..LN4595:
-        movl      -28(%ebp), %eax                               #4635.58
-        movw      %ax, (%esp)                                   #4635.58
-..LN4597:
-        call      uint16_lsbit                                  #4635.30
-                                # LOE eax
-..B27.48:                       # Preds ..B27.16
-        popl      %ecx                                          #4635.30
-        movl      %eax, -72(%ebp)                               #4635.30
-                                # LOE
-..B27.17:                       # Preds ..B27.48
-        movl      -72(%ebp), %eax                               #4635.30
-        movswl    %ax, %eax                                     #4635.30
-..LN4599:
-        movl      %eax, -88(%ebp)                               #4635.28
-..LN4601:
-        pushl     %edi                                          #4636.30
-..LN4603:
-        movl      -32(%ebp), %eax                               #4636.58
-        movw      %ax, (%esp)                                   #4636.58
-..LN4605:
-        call      uint16_lsbit                                  #4636.30
-                                # LOE eax
-..B27.49:                       # Preds ..B27.17
-        popl      %ecx                                          #4636.30
-        movl      %eax, -68(%ebp)                               #4636.30
-                                # LOE
-..B27.18:                       # Preds ..B27.49
-        movl      -68(%ebp), %eax                               #4636.30
-        movswl    %ax, %eax                                     #4636.30
-..LN4607:
-        movl      %eax, -84(%ebp)                               #4636.28
-..LN4609:
-        pushl     %edi                                          #4637.30
-..LN4611:
-        movl      -36(%ebp), %eax                               #4637.58
-        movw      %ax, (%esp)                                   #4637.58
-..LN4613:
-        call      uint16_lsbit                                  #4637.30
-                                # LOE eax
-..B27.50:                       # Preds ..B27.18
-        popl      %ecx                                          #4637.30
-        movl      %eax, -64(%ebp)                               #4637.30
-                                # LOE
-..B27.19:                       # Preds ..B27.50
-        movl      -64(%ebp), %eax                               #4637.30
-        movswl    %ax, %eax                                     #4637.30
-..LN4615:
-        movl      %eax, -80(%ebp)                               #4637.28
-..LN4617:
-        pushl     %edi                                          #4638.30
-..LN4619:
-        movl      -56(%ebp), %eax                               #4638.58
-        movw      %ax, (%esp)                                   #4638.58
-..LN4621:
-        call      uint16_lsbit                                  #4638.30
-                                # LOE eax
-..B27.51:                       # Preds ..B27.19
-        popl      %ecx                                          #4638.30
-        movl      %eax, -60(%ebp)                               #4638.30
-                                # LOE
-..B27.20:                       # Preds ..B27.51
-        movl      -60(%ebp), %eax                               #4638.30
-        movswl    %ax, %eax                                     #4638.30
-..LN4623:
-        movl      %eax, -76(%ebp)                               #4638.28
-..LN4625:
-        movl      -88(%ebp), %eax                               #4643.28
-..LN4627:
-        addl      %eax, %eax                                    #4643.34
-..LN4629:
-        movl      %eax, -88(%ebp)                               #4643.21
-..LN4631:
-        movl      -84(%ebp), %eax                               #4644.28
-..LN4633:
-        lea       1(%eax,%eax), %eax                            #4644.40
-..LN4635:
-        movl      %eax, -84(%ebp)                               #4644.21
-..LN4637:
-        movl      -80(%ebp), %eax                               #4645.28
-..LN4639:
-        lea       2(%eax,%eax), %eax                            #4645.40
-..LN4641:
-        movl      %eax, -80(%ebp)                               #4645.21
-..LN4643:
-        movl      -76(%ebp), %eax                               #4646.28
-..LN4645:
-        lea       3(%eax,%eax), %eax                            #4646.40
-..LN4647:
-        movl      %eax, -76(%ebp)                               #4646.21
-..LN4649:
-        movl      -28(%ebp), %eax                               #4650.26
-..LN4651:
-        testl     %eax, %eax                                    #4650.32
-        je        ..B27.23      # Prob 50%                      #4650.32
-                                # LOE
-..B27.21:                       # Preds ..B27.20
-..LN4653:
-        movl      -88(%ebp), %eax                               #4650.43
-        addl      16(%ebx), %eax                                #4650.43
-..LN4655:
-        movl      -48(%ebp), %edx                               #4650.49
-        cmpl      %edx, %eax                                    #4650.49
-        ja        ..B27.23      # Prob 50%                      #4650.49
-                                # LOE
-..B27.22:                       # Preds ..B27.21
-..LN4657:
-        movl      $1, %eax                                      #4650.63
-        leave                                                   #4650.63
-..___tag_value_eval_4na_64.875:                                 #
-        movl      %ebx, %esp                                    #4650.63
-        popl      %ebx                                          #4650.63
-..___tag_value_eval_4na_64.876:                                 #
-        ret                                                     #4650.63
-..___tag_value_eval_4na_64.878:                                 #
-                                # LOE
-..B27.23:                       # Preds ..B27.21 ..B27.20
-..LN4659:
-        movl      -32(%ebp), %eax                               #4651.26
-..LN4661:
-        testl     %eax, %eax                                    #4651.32
-        je        ..B27.26      # Prob 50%                      #4651.32
-                                # LOE
-..B27.24:                       # Preds ..B27.23
-..LN4663:
-        movl      -84(%ebp), %eax                               #4651.43
-        addl      16(%ebx), %eax                                #4651.43
-..LN4665:
-        movl      -48(%ebp), %edx                               #4651.49
-        cmpl      %edx, %eax                                    #4651.49
-        ja        ..B27.26      # Prob 50%                      #4651.49
-                                # LOE
-..B27.25:                       # Preds ..B27.24
-..LN4667:
-        movl      $1, %eax                                      #4651.63
-        leave                                                   #4651.63
-..___tag_value_eval_4na_64.882:                                 #
-        movl      %ebx, %esp                                    #4651.63
-        popl      %ebx                                          #4651.63
-..___tag_value_eval_4na_64.883:                                 #
-        ret                                                     #4651.63
-..___tag_value_eval_4na_64.885:                                 #
-                                # LOE
-..B27.26:                       # Preds ..B27.24 ..B27.23
-..LN4669:
-        movl      -36(%ebp), %eax                               #4652.26
-..LN4671:
-        testl     %eax, %eax                                    #4652.32
-        je        ..B27.29      # Prob 50%                      #4652.32
-                                # LOE
-..B27.27:                       # Preds ..B27.26
-..LN4673:
-        movl      -80(%ebp), %eax                               #4652.43
-        addl      16(%ebx), %eax                                #4652.43
-..LN4675:
-        movl      -48(%ebp), %edx                               #4652.49
-        cmpl      %edx, %eax                                    #4652.49
-        ja        ..B27.29      # Prob 50%                      #4652.49
-                                # LOE
-..B27.28:                       # Preds ..B27.27
-..LN4677:
-        movl      $1, %eax                                      #4652.63
-        leave                                                   #4652.63
-..___tag_value_eval_4na_64.889:                                 #
-        movl      %ebx, %esp                                    #4652.63
-        popl      %ebx                                          #4652.63
-..___tag_value_eval_4na_64.890:                                 #
-        ret                                                     #4652.63
-..___tag_value_eval_4na_64.892:                                 #
-                                # LOE
-..B27.29:                       # Preds ..B27.27 ..B27.26
-..LN4679:
-        movl      -56(%ebp), %eax                               #4653.26
-..LN4681:
-        testl     %eax, %eax                                    #4653.32
-        je        ..B27.32      # Prob 50%                      #4653.32
-                                # LOE
-..B27.30:                       # Preds ..B27.29
-..LN4683:
-        movl      -76(%ebp), %eax                               #4653.43
-        addl      16(%ebx), %eax                                #4653.43
-..LN4685:
-        movl      -48(%ebp), %edx                               #4653.49
-        cmpl      %edx, %eax                                    #4653.49
-        ja        ..B27.32      # Prob 50%                      #4653.49
-                                # LOE
-..B27.31:                       # Preds ..B27.30
-..LN4687:
-        movl      $1, %eax                                      #4653.63
-        leave                                                   #4653.63
-..___tag_value_eval_4na_64.896:                                 #
-        movl      %ebx, %esp                                    #4653.63
-        popl      %ebx                                          #4653.63
-..___tag_value_eval_4na_64.897:                                 #
-        ret                                                     #4653.63
-..___tag_value_eval_4na_64.899:                                 #
-                                # LOE
-..B27.32:                       # Preds ..B27.30 ..B27.29 ..B27.15
-..LN4689:
-        movl      16(%ebx), %eax                                #4658.17
-        addl      $4, %eax                                      #4658.17
-        movl      %eax, 16(%ebx)                                #4658.17
-..LN4691:
-        movl      16(%ebx), %eax                                #4661.22
-..LN4693:
-        movl      -48(%ebp), %edx                               #4661.28
-        cmpl      %edx, %eax                                    #4661.28
-        jbe       ..B27.34      # Prob 50%                      #4661.28
-                                # LOE
-..B27.33:                       # Preds ..B27.32
-..LN4695:
-        xorl      %eax, %eax                                    #4662.28
-        leave                                                   #4662.28
-..___tag_value_eval_4na_64.903:                                 #
-        movl      %ebx, %esp                                    #4662.28
-        popl      %ebx                                          #4662.28
-..___tag_value_eval_4na_64.904:                                 #
-        ret                                                     #4662.28
-..___tag_value_eval_4na_64.906:                                 #
-                                # LOE
-..B27.34:                       # Preds ..B27.32
-..LN4697:
-        movl      -24(%ebp), %eax                               #4665.25
-        decl      %eax                                          #4665.25
-        movl      %eax, -24(%ebp)                               #4665.25
-..LN4699:
-        je        ..B27.39      # Prob 50%                      #4665.39
-                                # LOE
-..B27.35:                       # Preds ..B27.34
-..LN4701:
-        movdqa    -248(%ebp), %xmm0                             #4670.43
-..LN4703:
-        psrldq    $2, %xmm0                                     #4670.26
-..LN4705:
-        movdqa    %xmm0, -248(%ebp)                             #4670.17
-..LN4707:
-        movl      -40(%ebp), %eax                               #4673.22
-..LN4709:
-        movl      -44(%ebp), %edx                               #4673.26
-        cmpl      %edx, %eax                                    #4673.26
-        jae       ..B27.37      # Prob 50%                      #4673.26
-                                # LOE
-..B27.36:                       # Preds ..B27.35
-..LN4711:
-        movdqa    -248(%ebp), %xmm0                             #4674.49
-..LN4713:
-        movl      -40(%ebp), %eax                               #4674.72
-        movzbl    (%eax), %eax                                  #4674.72
-        movzbl    %al, %eax                                     #4674.72
-..LN4715:
-        movl      -12(%ebp), %edx                               #4674.57
-        movzwl    expand_2na at GOTOFF(%edx,%eax,2), %eax          #4674.57
-        movzwl    %ax, %eax                                     #4674.57
-..LN4717:
-        pinsrw    $7, %eax, %xmm0                               #4674.30
-..LN4719:
-        movdqa    %xmm0, -248(%ebp)                             #4674.21
-                                # LOE
-..B27.37:                       # Preds ..B27.36 ..B27.35
-..LN4721:
-        incl      -40(%ebp)                                     #4677.20
-        jmp       ..B27.10      # Prob 100%                     #4677.20
-                                # LOE
-..B27.39:                       # Preds ..B27.34 ..B27.10
-..LN4723:
-        movl      -52(%ebp), %eax                               #4682.18
-..LN4725:
-        movl      -44(%ebp), %edx                               #4682.25
-        cmpl      %edx, %eax                                    #4682.25
-        jae       ..B27.43      # Prob 50%                      #4682.25
-                                # LOE
-..B27.40:                       # Preds ..B27.39
-..LN4727:
-        movl      16(%ebx), %eax                                #4686.13
-        addl      $16, %eax                                     #4686.13
-        movl      %eax, 16(%ebx)                                #4686.13
-..LN4729:
-        movl      16(%ebx), %eax                                #4687.18
-..LN4731:
-        movl      -48(%ebp), %edx                               #4687.24
-        cmpl      %edx, %eax                                    #4687.24
-        ja        ..B27.43      # Prob 50%                      #4687.24
-                                # LOE
-..B27.41:                       # Preds ..B27.40
-..LN4733:
-        addl      $-8, %esp                                     #4692.22
-..LN4735:
-        movl      -52(%ebp), %eax                               #4692.41
-        movl      %eax, (%esp)                                  #4692.41
-..LN4737:
-        movl      -44(%ebp), %eax                               #4692.46
-        movl      %eax, 4(%esp)                                 #4692.46
-..LN4739:
-        call      prime_buffer_4na                              #4692.22
-                                # LOE xmm0
-..B27.52:                       # Preds ..B27.41
-        addl      $8, %esp                                      #4692.22
-        movdqa    %xmm0, -296(%ebp)                             #4692.22
-                                # LOE
-..B27.42:                       # Preds ..B27.52
-..LN4741:
-        movdqa    -296(%ebp), %xmm0                             #4692.13
-        movdqa    %xmm0, -248(%ebp)                             #4692.13
-..LN4743:
-        addl      $8, -52(%ebp)                                 #4707.13
-..LN4745:
-        movl      -52(%ebp), %eax                               #4709.17
-..LN4747:
-        movl      %eax, -40(%ebp)                               #4709.13
-        jmp       ..B27.8       # Prob 100%                     #4709.13
-                                # LOE
-..B27.43:                       # Preds ..B27.40 ..B27.39 ..B27.8
-..LN4749:
-        xorl      %eax, %eax                                    #4718.12
-        leave                                                   #4718.12
-..___tag_value_eval_4na_64.910:                                 #
-        movl      %ebx, %esp                                    #4718.12
-        popl      %ebx                                          #4718.12
-..___tag_value_eval_4na_64.911:                                 #
-        ret                                                     #4718.12
-        .align    2,0x90
-..___tag_value_eval_4na_64.913:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-.LNeval_4na_64:
-	.data
-# -- End  eval_4na_64
-	.section .rodata, "a"
-	.align 4
-__$Ue:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	50
-	.byte	56
-	.byte	0
-	.type	__$Ue, at object
-	.size	__$Ue,13
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    2,0x90
-eval_4na_128:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B28.1:                        # Preds ..B28.0
-..___tag_value_eval_4na_128.916:                                #
-..LN4751:
-        pushl     %ebx                                          #4724.1
-..___tag_value_eval_4na_128.921:                                #
-        movl      %esp, %ebx                                    #4724.1
-..___tag_value_eval_4na_128.922:                                #
-        andl      $-16, %esp                                    #4724.1
-        pushl     %ebp                                          #4724.1
-        pushl     %ebp                                          #4724.1
-        movl      4(%ebx), %ebp                                 #4724.1
-        movl      %ebp, 4(%esp)                                 #4724.1
-        movl      %esp, %ebp                                    #4724.1
-..___tag_value_eval_4na_128.924:                                #
-        subl      $280, %esp                                    #4724.1
-        movl      %ebx, -280(%ebp)                              #4724.1
-        call      ..L926        # Prob 100%                     #4724.1
-..L926:                                                         #
-        popl      %eax                                          #4724.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L926], %eax     #4724.1
-        movl      %eax, -8(%ebp)                                #4724.1
-..LN4753:
-        movl      8(%ebx), %eax                                 #4750.25
-        movl      4(%eax), %eax                                 #4750.25
-..LN4755:
-        movl      %eax, -12(%ebp)                               #4750.23
-..LN4757:
-        movl      20(%ebx), %eax                                #4753.5
-        movl      -12(%ebp), %edx                               #4753.5
-        cmpl      %edx, %eax                                    #4753.5
-        jae       ..B28.3       # Prob 50%                      #4753.5
-                                # LOE
-..B28.2:                        # Preds ..B28.1
-        addl      $-16, %esp                                    #4753.5
-        movl      -8(%ebp), %eax                                #4753.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %eax               #4753.5
-        movl      %eax, (%esp)                                  #4753.5
-        movl      -8(%ebp), %eax                                #4753.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #4753.5
-        movl      %eax, 4(%esp)                                 #4753.5
-        movl      $4753, 8(%esp)                                #4753.5
-        movl      -8(%ebp), %eax                                #4753.5
-        lea       __$Ue at GOTOFF(%eax), %eax                      #4753.5
-        movl      %eax, 12(%esp)                                #4753.5
-        movl      -8(%ebp), %eax                                #4753.5
-        movl      %eax, %ebx                                    #4753.5
-..___tag_value_eval_4na_128.927:                                #4753.5
-        call      __assert_fail at PLT                             #4753.5
-        movl      -280(%ebp), %ebx                              #4753.5
-..___tag_value_eval_4na_128.928:                                #
-                                # LOE
-..B28.41:                       # Preds ..B28.2
-        addl      $16, %esp                                     #4753.5
-                                # LOE
-..B28.3:                        # Preds ..B28.1
-..LN4759:
-        movl      16(%ebx), %eax                                #4757.12
-..LN4761:
-        addl      20(%ebx), %eax                                #4757.5
-        movl      %eax, 20(%ebx)                                #4757.5
-..LN4763:
-        movl      16(%ebx), %eax                                #4760.42
-..LN4765:
-        shrl      $2, %eax                                      #4760.49
-..LN4767:
-        addl      12(%ebx), %eax                                #4760.30
-..LN4769:
-        movl      %eax, -48(%ebp)                               #4760.5
-..LN4771:
-        movl      -12(%ebp), %eax                               #4763.18
-        negl      %eax                                          #4763.18
-        addl      20(%ebx), %eax                                #4763.18
-..LN4773:
-        movl      %eax, -44(%ebp)                               #4763.5
-..LN4775:
-        movl      20(%ebx), %eax                                #4766.44
-..LN4777:
-        addl      $3, %eax                                      #4766.50
-..LN4779:
-        shrl      $2, %eax                                      #4766.57
-..LN4781:
-        addl      12(%ebx), %eax                                #4766.30
-..LN4783:
-        movl      %eax, -40(%ebp)                               #4766.5
-..LN4785:
-        addl      $-8, %esp                                     #4769.14
-..LN4787:
-        movl      -48(%ebp), %eax                               #4769.33
-        movl      %eax, (%esp)                                  #4769.33
-..LN4789:
-        movl      -40(%ebp), %eax                               #4769.38
-        movl      %eax, 4(%esp)                                 #4769.38
-..LN4791:
-        call      prime_buffer_4na                              #4769.14
-                                # LOE xmm0
-..B28.42:                       # Preds ..B28.3
-        addl      $8, %esp                                      #4769.14
-        movdqa    %xmm0, -72(%ebp)                              #4769.14
-                                # LOE
-..B28.4:                        # Preds ..B28.42
-..LN4793:
-        movdqa    -72(%ebp), %xmm0                              #4769.5
-        movdqa    %xmm0, -216(%ebp)                             #4769.5
-..LN4795:
-        addl      $8, -48(%ebp)                                 #4770.5
-..LN4797:
-        movl      -48(%ebp), %eax                               #4772.9
-..LN4799:
-        movl      %eax, -36(%ebp)                               #4772.5
-..LN4801:
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    16(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -200(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    32(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -184(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    48(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -168(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    64(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -152(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    80(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -136(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    96(%eax), %xmm0                               #4776.5
-        movdqa    %xmm0, -120(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    112(%eax), %xmm0                              #4776.5
-        movdqa    %xmm0, -104(%ebp)                             #4776.5
-        movl      8(%ebx), %eax                                 #4776.5
-        movdqa    128(%eax), %xmm0                              #4776.5
-        movdqa    %xmm0, -88(%ebp)                              #4776.5
-..LN4803:
-        xorl      %eax, %eax                                    #4779.15
-        movl      %eax, -32(%ebp)                               #4779.15
-..LN4805:
-        movl      %eax, -28(%ebp)                               #4779.10
-..LN4807:
-        movl      %eax, -24(%ebp)                               #4779.5
-..LN4809:
-        movl      16(%ebx), %eax                                #4781.27
-        negl      %eax                                          #4781.27
-..LN4811:
-        movl      -44(%ebp), %edx                               #4781.20
-..LN4813:
-        lea       7(%edx,%eax), %eax                            #4781.33
-..LN4815:
-        shrl      $2, %eax                                      #4781.40
-..LN4817:
-        movl      %eax, -20(%ebp)                               #4781.5
-..LN4819:
-        movl      16(%ebx), %eax                                #4790.14
-..LN4821:
-        andl      $3, %eax                                      #4790.20
-        movl      %eax, -16(%ebp)                               #4790.20
-        je        ..B28.12      # Prob 50%                      #4790.20
-                                # LOE
-..B28.5:                        # Preds ..B28.4
-        movl      -16(%ebp), %eax                               #4790.20
-        cmpl      $1, %eax                                      #4790.20
-        je        ..B28.13      # Prob 50%                      #4790.20
-                                # LOE
-..B28.6:                        # Preds ..B28.5
-        movl      -16(%ebp), %eax                               #4790.20
-        cmpl      $2, %eax                                      #4790.20
-        je        ..B28.14      # Prob 50%                      #4790.20
-                                # LOE
-..B28.7:                        # Preds ..B28.6
-        movl      -16(%ebp), %eax                               #4790.20
-        cmpl      $3, %eax                                      #4790.20
-        je        ..B28.15      # Prob 50%                      #4790.20
-                                # LOE
-..B28.8:                        # Preds ..B28.37 ..B28.7
-..LN4823:
-        movl      $1, %eax                                      #4795.9
-        testl     %eax, %eax                                    #4795.9
-        je        ..B28.38      # Prob 100%                     #4795.9
-                                # LOE
-..B28.9:                        # Preds ..B28.8
-..LN4825:
-        movl      $8, -20(%ebp)                                 #4797.13
-                                # LOE
-..B28.10:                       # Preds ..B28.32 ..B28.9
-..LN4827:
-        movl      $1, %eax                                      #4800.13
-        testl     %eax, %eax                                    #4800.13
-        je        ..B28.34      # Prob 100%                     #4800.13
-                                # LOE
-..B28.12:                       # Preds ..B28.4 ..B28.10
-..LN4829:
-        movdqa    -216(%ebp), %xmm0                             #4807.38
-..LN4831:
-        movdqa    -200(%ebp), %xmm1                             #4807.46
-..LN4833:
-        pand      %xmm1, %xmm0                                  #4807.22
-..LN4835:
-        movdqa    %xmm0, -248(%ebp)                             #4807.17
-..LN4837:
-        movdqa    -216(%ebp), %xmm0                             #4808.38
-..LN4839:
-        movdqa    -184(%ebp), %xmm1                             #4808.46
-..LN4841:
-        pand      %xmm1, %xmm0                                  #4808.22
-..LN4843:
-        movdqa    %xmm0, -232(%ebp)                             #4808.17
-..LN4845:
-        movdqa    -248(%ebp), %xmm0                             #4809.22
-        movdqa    -232(%ebp), %xmm1                             #4809.22
-        pcmpeqd   %xmm1, %xmm0                                  #4809.22
-..LN4847:
-        movdqa    %xmm0, -248(%ebp)                             #4809.17
-..LN4849:
-        movdqa    -248(%ebp), %xmm0                             #4810.42
-..LN4851:
-        pmovmskb  %xmm0, %eax                                   #4810.22
-..LN4853:
-        movl      %eax, -24(%ebp)                               #4810.17
-..LN4855:
-        movl      -24(%ebp), %eax                               #4811.17
-        incl      %eax                                          #4811.17
-        sarl      $16, %eax                                     #4811.17
-        negl      %eax                                          #4811.17
-        movl      %eax, -24(%ebp)                               #4811.17
-                                # LOE
-..B28.13:                       # Preds ..B28.5 ..B28.12
-..LN4857:
-        movdqa    -216(%ebp), %xmm0                             #4814.38
-..LN4859:
-        movdqa    -168(%ebp), %xmm1                             #4814.46
-..LN4861:
-        pand      %xmm1, %xmm0                                  #4814.22
-..LN4863:
-        movdqa    %xmm0, -248(%ebp)                             #4814.17
-..LN4865:
-        movdqa    -216(%ebp), %xmm0                             #4815.38
-..LN4867:
-        movdqa    -152(%ebp), %xmm1                             #4815.46
-..LN4869:
-        pand      %xmm1, %xmm0                                  #4815.22
-..LN4871:
-        movdqa    %xmm0, -232(%ebp)                             #4815.17
-..LN4873:
-        movdqa    -248(%ebp), %xmm0                             #4816.22
-        movdqa    -232(%ebp), %xmm1                             #4816.22
-        pcmpeqd   %xmm1, %xmm0                                  #4816.22
-..LN4875:
-        movdqa    %xmm0, -248(%ebp)                             #4816.17
-..LN4877:
-        movdqa    -248(%ebp), %xmm0                             #4817.42
-..LN4879:
-        pmovmskb  %xmm0, %eax                                   #4817.22
-..LN4881:
-        movl      %eax, -28(%ebp)                               #4817.17
-..LN4883:
-        movl      -28(%ebp), %eax                               #4818.17
-        incl      %eax                                          #4818.17
-        sarl      $16, %eax                                     #4818.17
-        negl      %eax                                          #4818.17
-        movl      %eax, -28(%ebp)                               #4818.17
-                                # LOE
-..B28.14:                       # Preds ..B28.6 ..B28.13
-..LN4885:
-        movdqa    -216(%ebp), %xmm0                             #4821.38
-..LN4887:
-        movdqa    -136(%ebp), %xmm1                             #4821.46
-..LN4889:
-        pand      %xmm1, %xmm0                                  #4821.22
-..LN4891:
-        movdqa    %xmm0, -248(%ebp)                             #4821.17
-..LN4893:
-        movdqa    -216(%ebp), %xmm0                             #4822.38
-..LN4895:
-        movdqa    -120(%ebp), %xmm1                             #4822.46
-..LN4897:
-        pand      %xmm1, %xmm0                                  #4822.22
-..LN4899:
-        movdqa    %xmm0, -232(%ebp)                             #4822.17
-..LN4901:
-        movdqa    -248(%ebp), %xmm0                             #4823.22
-        movdqa    -232(%ebp), %xmm1                             #4823.22
-        pcmpeqd   %xmm1, %xmm0                                  #4823.22
-..LN4903:
-        movdqa    %xmm0, -248(%ebp)                             #4823.17
-..LN4905:
-        movdqa    -248(%ebp), %xmm0                             #4824.42
-..LN4907:
-        pmovmskb  %xmm0, %eax                                   #4824.22
-..LN4909:
-        movl      %eax, -32(%ebp)                               #4824.17
-..LN4911:
-        movl      -32(%ebp), %eax                               #4825.17
-        incl      %eax                                          #4825.17
-        sarl      $16, %eax                                     #4825.17
-        negl      %eax                                          #4825.17
-        movl      %eax, -32(%ebp)                               #4825.17
-                                # LOE
-..B28.15:                       # Preds ..B28.7 ..B28.14
-..LN4913:
-        movdqa    -216(%ebp), %xmm0                             #4828.38
-..LN4915:
-        movdqa    -104(%ebp), %xmm1                             #4828.46
-..LN4917:
-        pand      %xmm1, %xmm0                                  #4828.22
-..LN4919:
-        movdqa    %xmm0, -248(%ebp)                             #4828.17
-..LN4921:
-        movdqa    -216(%ebp), %xmm0                             #4829.38
-..LN4923:
-        movdqa    -88(%ebp), %xmm1                              #4829.46
-..LN4925:
-        pand      %xmm1, %xmm0                                  #4829.22
-..LN4927:
-        movdqa    %xmm0, -232(%ebp)                             #4829.17
-..LN4929:
-        movdqa    -248(%ebp), %xmm0                             #4830.22
-        movdqa    -232(%ebp), %xmm1                             #4830.22
-        pcmpeqd   %xmm1, %xmm0                                  #4830.22
-..LN4931:
-        movdqa    %xmm0, -248(%ebp)                             #4830.17
-..LN4933:
-        movdqa    -248(%ebp), %xmm0                             #4831.42
-..LN4935:
-        pmovmskb  %xmm0, %eax                                   #4831.22
-..LN4937:
-        movl      %eax, -52(%ebp)                               #4831.17
-..LN4939:
-        movl      -52(%ebp), %eax                               #4832.17
-        incl      %eax                                          #4832.17
-        sarl      $16, %eax                                     #4832.17
-        negl      %eax                                          #4832.17
-        movl      %eax, -52(%ebp)                               #4832.17
-..LN4941:
-        movl      16(%ebx), %eax                                #4836.17
-        andl      $-4, %eax                                     #4836.17
-        movl      %eax, 16(%ebx)                                #4836.17
-..LN4943:
-        movl      -28(%ebp), %eax                               #4839.29
-        orl       -24(%ebp), %eax                               #4839.29
-..LN4945:
-        orl       -32(%ebp), %eax                               #4839.34
-..LN4947:
-        orl       -52(%ebp), %eax                               #4839.39
-..LN4949:
-        je        ..B28.27      # Prob 50%                      #4839.47
-                                # LOE
-..B28.16:                       # Preds ..B28.15
-..LN4951:
-        movl      16(%ebx), %eax                                #4842.37
-        negl      %eax                                          #4842.37
-        addl      -44(%ebp), %eax                               #4842.37
-        movl      %eax, -56(%ebp)                               #4842.37
-        cmpl      $2, %eax                                      #4842.37
-        je        ..B28.20      # Prob 50%                      #4842.37
-                                # LOE
-..B28.17:                       # Preds ..B28.16
-        movl      -56(%ebp), %eax                               #4842.37
-        cmpl      $1, %eax                                      #4842.37
-        je        ..B28.22      # Prob 50%                      #4842.37
-                                # LOE
-..B28.18:                       # Preds ..B28.17
-        movl      -56(%ebp), %eax                               #4842.37
-        testl     %eax, %eax                                    #4842.37
-        je        ..B28.24      # Prob 50%                      #4842.37
-                                # LOE
-..B28.19:                       # Preds ..B28.18
-..LN4953:
-        movl      $1, %eax                                      #4845.32
-        leave                                                   #4845.32
-..___tag_value_eval_4na_128.930:                                #
-        movl      %ebx, %esp                                    #4845.32
-        popl      %ebx                                          #4845.32
-..___tag_value_eval_4na_128.931:                                #
-        ret                                                     #4845.32
-..___tag_value_eval_4na_128.933:                                #
-                                # LOE
-..B28.20:                       # Preds ..B28.16
-..LN4955:
-        movl      -32(%ebp), %eax                               #4847.30
-..LN4957:
-        testl     %eax, %eax                                    #4847.36
-        je        ..B28.22      # Prob 50%                      #4847.36
-                                # LOE
-..B28.21:                       # Preds ..B28.20
-..LN4959:
-        movl      $1, %eax                                      #4847.47
-        leave                                                   #4847.47
-..___tag_value_eval_4na_128.937:                                #
-        movl      %ebx, %esp                                    #4847.47
-        popl      %ebx                                          #4847.47
-..___tag_value_eval_4na_128.938:                                #
-        ret                                                     #4847.47
-..___tag_value_eval_4na_128.940:                                #
-                                # LOE
-..B28.22:                       # Preds ..B28.20 ..B28.17
-..LN4961:
-        movl      -28(%ebp), %eax                               #4849.30
-..LN4963:
-        testl     %eax, %eax                                    #4849.36
-        je        ..B28.24      # Prob 50%                      #4849.36
-                                # LOE
-..B28.23:                       # Preds ..B28.22
-..LN4965:
-        movl      $1, %eax                                      #4849.47
-        leave                                                   #4849.47
-..___tag_value_eval_4na_128.944:                                #
-        movl      %ebx, %esp                                    #4849.47
-        popl      %ebx                                          #4849.47
-..___tag_value_eval_4na_128.945:                                #
-        ret                                                     #4849.47
-..___tag_value_eval_4na_128.947:                                #
-                                # LOE
-..B28.24:                       # Preds ..B28.22 ..B28.18
-..LN4967:
-        movl      -24(%ebp), %eax                               #4851.30
-..LN4969:
-        testl     %eax, %eax                                    #4851.36
-        je        ..B28.26      # Prob 50%                      #4851.36
-                                # LOE
-..B28.25:                       # Preds ..B28.24
-..LN4971:
-        movl      $1, %eax                                      #4851.47
-        leave                                                   #4851.47
-..___tag_value_eval_4na_128.951:                                #
-        movl      %ebx, %esp                                    #4851.47
-        popl      %ebx                                          #4851.47
-..___tag_value_eval_4na_128.952:                                #
-        ret                                                     #4851.47
-..___tag_value_eval_4na_128.954:                                #
-                                # LOE
-..B28.26:                       # Preds ..B28.24
-..LN4973:
-        xorl      %eax, %eax                                    #4853.28
-        leave                                                   #4853.28
-..___tag_value_eval_4na_128.958:                                #
-        movl      %ebx, %esp                                    #4853.28
-        popl      %ebx                                          #4853.28
-..___tag_value_eval_4na_128.959:                                #
-        ret                                                     #4853.28
-..___tag_value_eval_4na_128.961:                                #
-                                # LOE
-..B28.27:                       # Preds ..B28.15
-..LN4975:
-        movl      16(%ebx), %eax                                #4880.17
-        addl      $4, %eax                                      #4880.17
-        movl      %eax, 16(%ebx)                                #4880.17
-..LN4977:
-        movl      16(%ebx), %eax                                #4883.22
-..LN4979:
-        movl      -44(%ebp), %edx                               #4883.28
-        cmpl      %edx, %eax                                    #4883.28
-        jbe       ..B28.29      # Prob 50%                      #4883.28
-                                # LOE
-..B28.28:                       # Preds ..B28.27
-..LN4981:
-        xorl      %eax, %eax                                    #4884.28
-        leave                                                   #4884.28
-..___tag_value_eval_4na_128.965:                                #
-        movl      %ebx, %esp                                    #4884.28
-        popl      %ebx                                          #4884.28
-..___tag_value_eval_4na_128.966:                                #
-        ret                                                     #4884.28
-..___tag_value_eval_4na_128.968:                                #
-                                # LOE
-..B28.29:                       # Preds ..B28.27
-..LN4983:
-        movl      -20(%ebp), %eax                               #4887.25
-        decl      %eax                                          #4887.25
-        movl      %eax, -20(%ebp)                               #4887.25
-..LN4985:
-        je        ..B28.34      # Prob 50%                      #4887.39
-                                # LOE
-..B28.30:                       # Preds ..B28.29
-..LN4987:
-        movdqa    -216(%ebp), %xmm0                             #4892.43
-..LN4989:
-        psrldq    $2, %xmm0                                     #4892.26
-..LN4991:
-        movdqa    %xmm0, -216(%ebp)                             #4892.17
-..LN4993:
-        movl      -36(%ebp), %eax                               #4895.22
-..LN4995:
-        movl      -40(%ebp), %edx                               #4895.26
-        cmpl      %edx, %eax                                    #4895.26
-        jae       ..B28.32      # Prob 50%                      #4895.26
-                                # LOE
-..B28.31:                       # Preds ..B28.30
-..LN4997:
-        movdqa    -216(%ebp), %xmm0                             #4896.49
-..LN4999:
-        movl      -36(%ebp), %eax                               #4896.72
-        movzbl    (%eax), %eax                                  #4896.72
-        movzbl    %al, %eax                                     #4896.72
-..LN5001:
-        movl      -8(%ebp), %edx                                #4896.57
-        movzwl    expand_2na at GOTOFF(%edx,%eax,2), %eax          #4896.57
-        movzwl    %ax, %eax                                     #4896.57
-..LN5003:
-        pinsrw    $7, %eax, %xmm0                               #4896.30
-..LN5005:
-        movdqa    %xmm0, -216(%ebp)                             #4896.21
-                                # LOE
-..B28.32:                       # Preds ..B28.31 ..B28.30
-..LN5007:
-        incl      -36(%ebp)                                     #4899.20
-        jmp       ..B28.10      # Prob 100%                     #4899.20
-                                # LOE
-..B28.34:                       # Preds ..B28.29 ..B28.10
-..LN5009:
-        movl      -48(%ebp), %eax                               #4904.18
-..LN5011:
-        movl      -40(%ebp), %edx                               #4904.25
-        cmpl      %edx, %eax                                    #4904.25
-        jae       ..B28.38      # Prob 50%                      #4904.25
-                                # LOE
-..B28.35:                       # Preds ..B28.34
-..LN5013:
-        movl      16(%ebx), %eax                                #4909.18
-..LN5015:
-        movl      -44(%ebp), %edx                               #4909.24
-        cmpl      %edx, %eax                                    #4909.24
-        ja        ..B28.38      # Prob 50%                      #4909.24
-                                # LOE
-..B28.36:                       # Preds ..B28.35
-..LN5017:
-        addl      $-8, %esp                                     #4914.22
-..LN5019:
-        movl      -48(%ebp), %eax                               #4914.41
-        movl      %eax, (%esp)                                  #4914.41
-..LN5021:
-        movl      -40(%ebp), %eax                               #4914.46
-        movl      %eax, 4(%esp)                                 #4914.46
-..LN5023:
-        call      prime_buffer_4na                              #4914.22
-                                # LOE xmm0
-..B28.43:                       # Preds ..B28.36
-        addl      $8, %esp                                      #4914.22
-        movdqa    %xmm0, -264(%ebp)                             #4914.22
-                                # LOE
-..B28.37:                       # Preds ..B28.43
-..LN5025:
-        movdqa    -264(%ebp), %xmm0                             #4914.13
-        movdqa    %xmm0, -216(%ebp)                             #4914.13
-..LN5027:
-        addl      $8, -48(%ebp)                                 #4929.13
-..LN5029:
-        movl      -48(%ebp), %eax                               #4931.17
-..LN5031:
-        movl      %eax, -36(%ebp)                               #4931.13
-        jmp       ..B28.8       # Prob 100%                     #4931.13
-                                # LOE
-..B28.38:                       # Preds ..B28.35 ..B28.34 ..B28.8
-..LN5033:
-        xorl      %eax, %eax                                    #4940.12
-        leave                                                   #4940.12
-..___tag_value_eval_4na_128.972:                                #
-        movl      %ebx, %esp                                    #4940.12
-        popl      %ebx                                          #4940.12
-..___tag_value_eval_4na_128.973:                                #
-        ret                                                     #4940.12
-        .align    2,0x90
-..___tag_value_eval_4na_128.975:                                #
-                                # LOE
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-.LNeval_4na_128:
-	.data
-# -- End  eval_4na_128
-	.section .rodata, "a"
-	.align 4
-__$Uf:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	112
-	.byte	111
-	.byte	115
-	.byte	0
-	.type	__$Uf, at object
-	.size	__$Uf,13
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    2,0x90
-eval_4na_pos:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B29.1:                        # Preds ..B29.0
-..___tag_value_eval_4na_pos.978:                                #
-..LN5035:
-        pushl     %ebx                                          #4946.1
-..___tag_value_eval_4na_pos.983:                                #
-        movl      %esp, %ebx                                    #4946.1
-..___tag_value_eval_4na_pos.984:                                #
-        andl      $-16, %esp                                    #4946.1
-        pushl     %ebp                                          #4946.1
-        pushl     %ebp                                          #4946.1
-        movl      4(%ebx), %ebp                                 #4946.1
-        movl      %ebp, 4(%esp)                                 #4946.1
-        movl      %esp, %ebp                                    #4946.1
-..___tag_value_eval_4na_pos.986:                                #
-        subl      $280, %esp                                    #4946.1
-        movl      %ebx, -280(%ebp)                              #4946.1
-        call      ..L988        # Prob 100%                     #4946.1
-..L988:                                                         #
-        popl      %eax                                          #4946.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L988], %eax     #4946.1
-        movl      %eax, -4(%ebp)                                #4946.1
-..LN5037:
-        movl      8(%ebx), %eax                                 #4978.25
-        movl      4(%eax), %eax                                 #4978.25
-..LN5039:
-        movl      %eax, -8(%ebp)                                #4978.23
-..LN5041:
-        movl      20(%ebx), %eax                                #4981.5
-        movl      -8(%ebp), %edx                                #4981.5
-        cmpl      %edx, %eax                                    #4981.5
-        jae       ..B29.3       # Prob 50%                      #4981.5
-                                # LOE
-..B29.2:                        # Preds ..B29.1
-        addl      $-16, %esp                                    #4981.5
-        movl      -4(%ebp), %eax                                #4981.5
-        lea       _2__STRING.9 at GOTOFF(%eax), %eax               #4981.5
-        movl      %eax, (%esp)                                  #4981.5
-        movl      -4(%ebp), %eax                                #4981.5
-        lea       _2__STRING.1 at GOTOFF(%eax), %eax               #4981.5
-        movl      %eax, 4(%esp)                                 #4981.5
-        movl      $4981, 8(%esp)                                #4981.5
-        movl      -4(%ebp), %eax                                #4981.5
-        lea       __$Uf at GOTOFF(%eax), %eax                      #4981.5
-        movl      %eax, 12(%esp)                                #4981.5
-        movl      -4(%ebp), %eax                                #4981.5
-        movl      %eax, %ebx                                    #4981.5
-..___tag_value_eval_4na_pos.989:                                #4981.5
-        call      __assert_fail at PLT                             #4981.5
-        movl      -280(%ebp), %ebx                              #4981.5
-..___tag_value_eval_4na_pos.990:                                #
-                                # LOE
-..B29.54:                       # Preds ..B29.2
-        addl      $16, %esp                                     #4981.5
-                                # LOE
-..B29.3:                        # Preds ..B29.1
-..LN5043:
-        movl      16(%ebx), %eax                                #4985.12
-..LN5045:
-        addl      20(%ebx), %eax                                #4985.5
-        movl      %eax, 20(%ebx)                                #4985.5
-..LN5047:
-        movl      16(%ebx), %eax                                #4989.13
-..LN5049:
-        movl      %eax, -48(%ebp)                               #4989.5
-..LN5051:
-        movl      16(%ebx), %eax                                #4993.42
-..LN5053:
-        shrl      $2, %eax                                      #4993.49
-..LN5055:
-        addl      12(%ebx), %eax                                #4993.30
-..LN5057:
-        movl      %eax, -44(%ebp)                               #4993.5
-..LN5059:
-        movl      -8(%ebp), %eax                                #4996.18
-        negl      %eax                                          #4996.18
-        addl      20(%ebx), %eax                                #4996.18
-..LN5061:
-        movl      %eax, -40(%ebp)                               #4996.5
-..LN5063:
-        movl      20(%ebx), %eax                                #4999.44
-..LN5065:
-        addl      $3, %eax                                      #4999.50
-..LN5067:
-        shrl      $2, %eax                                      #4999.57
-..LN5069:
-        addl      12(%ebx), %eax                                #4999.30
-..LN5071:
-        movl      %eax, -36(%ebp)                               #4999.5
-..LN5073:
-        addl      $-8, %esp                                     #5002.14
-..LN5075:
-        movl      -44(%ebp), %eax                               #5002.33
-        movl      %eax, (%esp)                                  #5002.33
-..LN5077:
-        movl      -36(%ebp), %eax                               #5002.38
-        movl      %eax, 4(%esp)                                 #5002.38
-..LN5079:
-        call      prime_buffer_4na                              #5002.14
-                                # LOE xmm0
-..B29.55:                       # Preds ..B29.3
-        addl      $8, %esp                                      #5002.14
-        movdqa    %xmm0, -72(%ebp)                              #5002.14
-                                # LOE
-..B29.4:                        # Preds ..B29.55
-..LN5081:
-        movdqa    -72(%ebp), %xmm0                              #5002.5
-        movdqa    %xmm0, -216(%ebp)                             #5002.5
-..LN5083:
-        addl      $8, -44(%ebp)                                 #5003.5
-..LN5085:
-        movl      -44(%ebp), %eax                               #5005.9
-..LN5087:
-        movl      %eax, -32(%ebp)                               #5005.5
-..LN5089:
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    16(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -200(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    32(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -184(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    48(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -168(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    64(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -152(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    80(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -136(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    96(%eax), %xmm0                               #5009.5
-        movdqa    %xmm0, -120(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    112(%eax), %xmm0                              #5009.5
-        movdqa    %xmm0, -104(%ebp)                             #5009.5
-        movl      8(%ebx), %eax                                 #5009.5
-        movdqa    128(%eax), %xmm0                              #5009.5
-        movdqa    %xmm0, -88(%ebp)                              #5009.5
-..LN5091:
-        xorl      %eax, %eax                                    #5012.15
-        movl      %eax, -28(%ebp)                               #5012.15
-..LN5093:
-        movl      %eax, -24(%ebp)                               #5012.10
-..LN5095:
-        movl      %eax, -20(%ebp)                               #5012.5
-..LN5097:
-        movl      16(%ebx), %eax                                #5014.27
-        negl      %eax                                          #5014.27
-..LN5099:
-        movl      -40(%ebp), %edx                               #5014.20
-..LN5101:
-        lea       7(%edx,%eax), %eax                            #5014.33
-..LN5103:
-        shrl      $2, %eax                                      #5014.40
-..LN5105:
-        movl      %eax, -16(%ebp)                               #5014.5
-..LN5107:
-        movl      16(%ebx), %eax                                #5023.14
-..LN5109:
-        andl      $3, %eax                                      #5023.20
-        movl      %eax, -12(%ebp)                               #5023.20
-        je        ..B29.12      # Prob 50%                      #5023.20
-                                # LOE
-..B29.5:                        # Preds ..B29.4
-        movl      -12(%ebp), %eax                               #5023.20
-        cmpl      $1, %eax                                      #5023.20
-        je        ..B29.13      # Prob 50%                      #5023.20
-                                # LOE
-..B29.6:                        # Preds ..B29.5
-        movl      -12(%ebp), %eax                               #5023.20
-        cmpl      $2, %eax                                      #5023.20
-        je        ..B29.14      # Prob 50%                      #5023.20
-                                # LOE
-..B29.7:                        # Preds ..B29.6
-        movl      -12(%ebp), %eax                               #5023.20
-        cmpl      $3, %eax                                      #5023.20
-        je        ..B29.15      # Prob 50%                      #5023.20
-                                # LOE
-..B29.8:                        # Preds ..B29.50 ..B29.7
-..LN5111:
-        movl      $1, %eax                                      #5028.9
-        testl     %eax, %eax                                    #5028.9
-        je        ..B29.51      # Prob 100%                     #5028.9
-                                # LOE
-..B29.9:                        # Preds ..B29.8
-..LN5113:
-        movl      $8, -16(%ebp)                                 #5030.13
-                                # LOE
-..B29.10:                       # Preds ..B29.45 ..B29.9
-..LN5115:
-        movl      $1, %eax                                      #5033.13
-        testl     %eax, %eax                                    #5033.13
-        je        ..B29.47      # Prob 100%                     #5033.13
-                                # LOE
-..B29.12:                       # Preds ..B29.4 ..B29.10
-..LN5117:
-        movdqa    -216(%ebp), %xmm0                             #5040.38
-..LN5119:
-        movdqa    -200(%ebp), %xmm1                             #5040.46
-..LN5121:
-        pand      %xmm1, %xmm0                                  #5040.22
-..LN5123:
-        movdqa    %xmm0, -248(%ebp)                             #5040.17
-..LN5125:
-        movdqa    -216(%ebp), %xmm0                             #5041.38
-..LN5127:
-        movdqa    -184(%ebp), %xmm1                             #5041.46
-..LN5129:
-        pand      %xmm1, %xmm0                                  #5041.22
-..LN5131:
-        movdqa    %xmm0, -232(%ebp)                             #5041.17
-..LN5133:
-        movdqa    -248(%ebp), %xmm0                             #5042.22
-        movdqa    -232(%ebp), %xmm1                             #5042.22
-        pcmpeqd   %xmm1, %xmm0                                  #5042.22
-..LN5135:
-        movdqa    %xmm0, -248(%ebp)                             #5042.17
-..LN5137:
-        movdqa    -248(%ebp), %xmm0                             #5043.42
-..LN5139:
-        pmovmskb  %xmm0, %eax                                   #5043.22
-..LN5141:
-        movl      %eax, -20(%ebp)                               #5043.17
-..LN5143:
-        movl      -20(%ebp), %eax                               #5044.17
-        incl      %eax                                          #5044.17
-        sarl      $16, %eax                                     #5044.17
-        negl      %eax                                          #5044.17
-        movl      %eax, -20(%ebp)                               #5044.17
-                                # LOE
-..B29.13:                       # Preds ..B29.5 ..B29.12
-..LN5145:
-        movdqa    -216(%ebp), %xmm0                             #5047.38
-..LN5147:
-        movdqa    -168(%ebp), %xmm1                             #5047.46
-..LN5149:
-        pand      %xmm1, %xmm0                                  #5047.22
-..LN5151:
-        movdqa    %xmm0, -248(%ebp)                             #5047.17
-..LN5153:
-        movdqa    -216(%ebp), %xmm0                             #5048.38
-..LN5155:
-        movdqa    -152(%ebp), %xmm1                             #5048.46
-..LN5157:
-        pand      %xmm1, %xmm0                                  #5048.22
-..LN5159:
-        movdqa    %xmm0, -232(%ebp)                             #5048.17
-..LN5161:
-        movdqa    -248(%ebp), %xmm0                             #5049.22
-        movdqa    -232(%ebp), %xmm1                             #5049.22
-        pcmpeqd   %xmm1, %xmm0                                  #5049.22
-..LN5163:
-        movdqa    %xmm0, -248(%ebp)                             #5049.17
-..LN5165:
-        movdqa    -248(%ebp), %xmm0                             #5050.42
-..LN5167:
-        pmovmskb  %xmm0, %eax                                   #5050.22
-..LN5169:
-        movl      %eax, -24(%ebp)                               #5050.17
-..LN5171:
-        movl      -24(%ebp), %eax                               #5051.17
-        incl      %eax                                          #5051.17
-        sarl      $16, %eax                                     #5051.17
-        negl      %eax                                          #5051.17
-        movl      %eax, -24(%ebp)                               #5051.17
-                                # LOE
-..B29.14:                       # Preds ..B29.6 ..B29.13
-..LN5173:
-        movdqa    -216(%ebp), %xmm0                             #5054.38
-..LN5175:
-        movdqa    -136(%ebp), %xmm1                             #5054.46
-..LN5177:
-        pand      %xmm1, %xmm0                                  #5054.22
-..LN5179:
-        movdqa    %xmm0, -248(%ebp)                             #5054.17
-..LN5181:
-        movdqa    -216(%ebp), %xmm0                             #5055.38
-..LN5183:
-        movdqa    -120(%ebp), %xmm1                             #5055.46
-..LN5185:
-        pand      %xmm1, %xmm0                                  #5055.22
-..LN5187:
-        movdqa    %xmm0, -232(%ebp)                             #5055.17
-..LN5189:
-        movdqa    -248(%ebp), %xmm0                             #5056.22
-        movdqa    -232(%ebp), %xmm1                             #5056.22
-        pcmpeqd   %xmm1, %xmm0                                  #5056.22
-..LN5191:
-        movdqa    %xmm0, -248(%ebp)                             #5056.17
-..LN5193:
-        movdqa    -248(%ebp), %xmm0                             #5057.42
-..LN5195:
-        pmovmskb  %xmm0, %eax                                   #5057.22
-..LN5197:
-        movl      %eax, -28(%ebp)                               #5057.17
-..LN5199:
-        movl      -28(%ebp), %eax                               #5058.17
-        incl      %eax                                          #5058.17
-        sarl      $16, %eax                                     #5058.17
-        negl      %eax                                          #5058.17
-        movl      %eax, -28(%ebp)                               #5058.17
-                                # LOE
-..B29.15:                       # Preds ..B29.7 ..B29.14
-..LN5201:
-        movdqa    -216(%ebp), %xmm0                             #5061.38
-..LN5203:
-        movdqa    -104(%ebp), %xmm1                             #5061.46
-..LN5205:
-        pand      %xmm1, %xmm0                                  #5061.22
-..LN5207:
-        movdqa    %xmm0, -248(%ebp)                             #5061.17
-..LN5209:
-        movdqa    -216(%ebp), %xmm0                             #5062.38
-..LN5211:
-        movdqa    -88(%ebp), %xmm1                              #5062.46
-..LN5213:
-        pand      %xmm1, %xmm0                                  #5062.22
-..LN5215:
-        movdqa    %xmm0, -232(%ebp)                             #5062.17
-..LN5217:
-        movdqa    -248(%ebp), %xmm0                             #5063.22
-        movdqa    -232(%ebp), %xmm1                             #5063.22
-        pcmpeqd   %xmm1, %xmm0                                  #5063.22
-..LN5219:
-        movdqa    %xmm0, -248(%ebp)                             #5063.17
-..LN5221:
-        movdqa    -248(%ebp), %xmm0                             #5064.42
-..LN5223:
-        pmovmskb  %xmm0, %eax                                   #5064.22
-..LN5225:
-        movl      %eax, -52(%ebp)                               #5064.17
-..LN5227:
-        movl      -52(%ebp), %eax                               #5065.17
-        incl      %eax                                          #5065.17
-        sarl      $16, %eax                                     #5065.17
-        negl      %eax                                          #5065.17
-        movl      %eax, -52(%ebp)                               #5065.17
-..LN5229:
-        movl      16(%ebx), %eax                                #5069.17
-        andl      $-4, %eax                                     #5069.17
-        movl      %eax, 16(%ebx)                                #5069.17
-..LN5231:
-        movl      -24(%ebp), %eax                               #5072.29
-        orl       -20(%ebp), %eax                               #5072.29
-..LN5233:
-        orl       -28(%ebp), %eax                               #5072.34
-..LN5235:
-        orl       -52(%ebp), %eax                               #5072.39
-..LN5237:
-        je        ..B29.40      # Prob 50%                      #5072.47
-                                # LOE
-..B29.16:                       # Preds ..B29.15
-..LN5239:
-        movl      16(%ebx), %eax                                #5075.37
-        negl      %eax                                          #5075.37
-        addl      -40(%ebp), %eax                               #5075.37
-        movl      %eax, -56(%ebp)                               #5075.37
-        je        ..B29.19      # Prob 50%                      #5075.37
-                                # LOE
-..B29.17:                       # Preds ..B29.16
-        movl      -56(%ebp), %eax                               #5075.37
-        cmpl      $1, %eax                                      #5075.37
-        je        ..B29.21      # Prob 50%                      #5075.37
-                                # LOE
-..B29.18:                       # Preds ..B29.17
-        movl      -56(%ebp), %eax                               #5075.37
-        cmpl      $2, %eax                                      #5075.37
-        je        ..B29.25      # Prob 50%                      #5075.37
-        jmp       ..B29.31      # Prob 100%                     #5075.37
-                                # LOE
-..B29.19:                       # Preds ..B29.16
-..LN5241:
-        movl      -20(%ebp), %eax                               #5078.30
-..LN5243:
-        testl     %eax, %eax                                    #5078.36
-        je        ..B29.39      # Prob 50%                      #5078.36
-                                # LOE
-..B29.20:                       # Preds ..B29.19
-..LN5245:
-        movl      -48(%ebp), %eax                               #5078.53
-        negl      %eax                                          #5078.53
-..LN5247:
-        movl      16(%ebx), %edx                                #5078.47
-..LN5249:
-        lea       1(%edx,%eax), %eax                            #5078.61
-        leave                                                   #5078.61
-..___tag_value_eval_4na_pos.992:                                #
-        movl      %ebx, %esp                                    #5078.61
-        popl      %ebx                                          #5078.61
-..___tag_value_eval_4na_pos.993:                                #
-        ret                                                     #5078.61
-..___tag_value_eval_4na_pos.995:                                #
-                                # LOE
-..B29.21:                       # Preds ..B29.17
-..LN5251:
-        movl      -20(%ebp), %eax                               #5081.30
-..LN5253:
-        testl     %eax, %eax                                    #5081.36
-        je        ..B29.23      # Prob 50%                      #5081.36
-                                # LOE
-..B29.22:                       # Preds ..B29.21
-..LN5255:
-        movl      -48(%ebp), %eax                               #5081.53
-        negl      %eax                                          #5081.53
-..LN5257:
-        movl      16(%ebx), %edx                                #5081.47
-..LN5259:
-        lea       1(%edx,%eax), %eax                            #5081.61
-        leave                                                   #5081.61
-..___tag_value_eval_4na_pos.999:                                #
-        movl      %ebx, %esp                                    #5081.61
-        popl      %ebx                                          #5081.61
-..___tag_value_eval_4na_pos.1000:                               #
-        ret                                                     #5081.61
-..___tag_value_eval_4na_pos.1002:                               #
-                                # LOE
-..B29.23:                       # Preds ..B29.21
-..LN5261:
-        movl      -24(%ebp), %eax                               #5082.30
-..LN5263:
-        testl     %eax, %eax                                    #5082.36
-        je        ..B29.39      # Prob 50%                      #5082.36
-                                # LOE
-..B29.24:                       # Preds ..B29.23
-..LN5265:
-        movl      -48(%ebp), %eax                               #5082.53
-        negl      %eax                                          #5082.53
-..LN5267:
-        movl      16(%ebx), %edx                                #5082.47
-..LN5269:
-        lea       2(%edx,%eax), %eax                            #5082.61
-        leave                                                   #5082.61
-..___tag_value_eval_4na_pos.1006:                               #
-        movl      %ebx, %esp                                    #5082.61
-        popl      %ebx                                          #5082.61
-..___tag_value_eval_4na_pos.1007:                               #
-        ret                                                     #5082.61
-..___tag_value_eval_4na_pos.1009:                               #
-                                # LOE
-..B29.25:                       # Preds ..B29.18
-..LN5271:
-        movl      -20(%ebp), %eax                               #5085.30
-..LN5273:
-        testl     %eax, %eax                                    #5085.36
-        je        ..B29.27      # Prob 50%                      #5085.36
-                                # LOE
-..B29.26:                       # Preds ..B29.25
-..LN5275:
-        movl      -48(%ebp), %eax                               #5085.53
-        negl      %eax                                          #5085.53
-..LN5277:
-        movl      16(%ebx), %edx                                #5085.47
-..LN5279:
-        lea       1(%edx,%eax), %eax                            #5085.61
-        leave                                                   #5085.61
-..___tag_value_eval_4na_pos.1013:                               #
-        movl      %ebx, %esp                                    #5085.61
-        popl      %ebx                                          #5085.61
-..___tag_value_eval_4na_pos.1014:                               #
-        ret                                                     #5085.61
-..___tag_value_eval_4na_pos.1016:                               #
-                                # LOE
-..B29.27:                       # Preds ..B29.25
-..LN5281:
-        movl      -24(%ebp), %eax                               #5086.30
-..LN5283:
-        testl     %eax, %eax                                    #5086.36
-        je        ..B29.29      # Prob 50%                      #5086.36
-                                # LOE
-..B29.28:                       # Preds ..B29.27
-..LN5285:
-        movl      -48(%ebp), %eax                               #5086.53
-        negl      %eax                                          #5086.53
-..LN5287:
-        movl      16(%ebx), %edx                                #5086.47
-..LN5289:
-        lea       2(%edx,%eax), %eax                            #5086.61
-        leave                                                   #5086.61
-..___tag_value_eval_4na_pos.1020:                               #
-        movl      %ebx, %esp                                    #5086.61
-        popl      %ebx                                          #5086.61
-..___tag_value_eval_4na_pos.1021:                               #
-        ret                                                     #5086.61
-..___tag_value_eval_4na_pos.1023:                               #
-                                # LOE
-..B29.29:                       # Preds ..B29.27
-..LN5291:
-        movl      -28(%ebp), %eax                               #5087.30
-..LN5293:
-        testl     %eax, %eax                                    #5087.36
-        je        ..B29.39      # Prob 50%                      #5087.36
-                                # LOE
-..B29.30:                       # Preds ..B29.29
-..LN5295:
-        movl      -48(%ebp), %eax                               #5087.53
-        negl      %eax                                          #5087.53
-..LN5297:
-        movl      16(%ebx), %edx                                #5087.47
-..LN5299:
-        lea       3(%edx,%eax), %eax                            #5087.61
-        leave                                                   #5087.61
-..___tag_value_eval_4na_pos.1027:                               #
-        movl      %ebx, %esp                                    #5087.61
-        popl      %ebx                                          #5087.61
-..___tag_value_eval_4na_pos.1028:                               #
-        ret                                                     #5087.61
-..___tag_value_eval_4na_pos.1030:                               #
-                                # LOE
-..B29.31:                       # Preds ..B29.18
-..LN5301:
-        movl      -20(%ebp), %eax                               #5090.30
-..LN5303:
-        testl     %eax, %eax                                    #5090.36
-        je        ..B29.33      # Prob 50%                      #5090.36
-                                # LOE
-..B29.32:                       # Preds ..B29.31
-..LN5305:
-        movl      -48(%ebp), %eax                               #5090.53
-        negl      %eax                                          #5090.53
-..LN5307:
-        movl      16(%ebx), %edx                                #5090.47
-..LN5309:
-        lea       1(%edx,%eax), %eax                            #5090.61
-        leave                                                   #5090.61
-..___tag_value_eval_4na_pos.1034:                               #
-        movl      %ebx, %esp                                    #5090.61
-        popl      %ebx                                          #5090.61
-..___tag_value_eval_4na_pos.1035:                               #
-        ret                                                     #5090.61
-..___tag_value_eval_4na_pos.1037:                               #
-                                # LOE
-..B29.33:                       # Preds ..B29.31
-..LN5311:
-        movl      -24(%ebp), %eax                               #5091.30
-..LN5313:
-        testl     %eax, %eax                                    #5091.36
-        je        ..B29.35      # Prob 50%                      #5091.36
-                                # LOE
-..B29.34:                       # Preds ..B29.33
-..LN5315:
-        movl      -48(%ebp), %eax                               #5091.53
-        negl      %eax                                          #5091.53
-..LN5317:
-        movl      16(%ebx), %edx                                #5091.47
-..LN5319:
-        lea       2(%edx,%eax), %eax                            #5091.61
-        leave                                                   #5091.61
-..___tag_value_eval_4na_pos.1041:                               #
-        movl      %ebx, %esp                                    #5091.61
-        popl      %ebx                                          #5091.61
-..___tag_value_eval_4na_pos.1042:                               #
-        ret                                                     #5091.61
-..___tag_value_eval_4na_pos.1044:                               #
-                                # LOE
-..B29.35:                       # Preds ..B29.33
-..LN5321:
-        movl      -28(%ebp), %eax                               #5092.30
-..LN5323:
-        testl     %eax, %eax                                    #5092.36
-        je        ..B29.37      # Prob 50%                      #5092.36
-                                # LOE
-..B29.36:                       # Preds ..B29.35
-..LN5325:
-        movl      -48(%ebp), %eax                               #5092.53
-        negl      %eax                                          #5092.53
-..LN5327:
-        movl      16(%ebx), %edx                                #5092.47
-..LN5329:
-        lea       3(%edx,%eax), %eax                            #5092.61
-        leave                                                   #5092.61
-..___tag_value_eval_4na_pos.1048:                               #
-        movl      %ebx, %esp                                    #5092.61
-        popl      %ebx                                          #5092.61
-..___tag_value_eval_4na_pos.1049:                               #
-        ret                                                     #5092.61
-..___tag_value_eval_4na_pos.1051:                               #
-                                # LOE
-..B29.37:                       # Preds ..B29.35
-..LN5331:
-        movl      -52(%ebp), %eax                               #5093.30
-..LN5333:
-        testl     %eax, %eax                                    #5093.36
-        je        ..B29.39      # Prob 50%                      #5093.36
-                                # LOE
-..B29.38:                       # Preds ..B29.37
-..LN5335:
-        movl      -48(%ebp), %eax                               #5093.53
-        negl      %eax                                          #5093.53
-..LN5337:
-        movl      16(%ebx), %edx                                #5093.47
-..LN5339:
-        lea       4(%edx,%eax), %eax                            #5093.61
-        leave                                                   #5093.61
-..___tag_value_eval_4na_pos.1055:                               #
-        movl      %ebx, %esp                                    #5093.61
-        popl      %ebx                                          #5093.61
-..___tag_value_eval_4na_pos.1056:                               #
-        ret                                                     #5093.61
-..___tag_value_eval_4na_pos.1058:                               #
-                                # LOE
-..B29.39:                       # Preds ..B29.19 ..B29.23 ..B29.29 ..B29.37
-..LN5341:
-        xorl      %eax, %eax                                    #5095.28
-        leave                                                   #5095.28
-..___tag_value_eval_4na_pos.1062:                               #
-        movl      %ebx, %esp                                    #5095.28
-        popl      %ebx                                          #5095.28
-..___tag_value_eval_4na_pos.1063:                               #
-        ret                                                     #5095.28
-..___tag_value_eval_4na_pos.1065:                               #
-                                # LOE
-..B29.40:                       # Preds ..B29.15
-..LN5343:
-        movl      16(%ebx), %eax                                #5135.17
-        addl      $4, %eax                                      #5135.17
-        movl      %eax, 16(%ebx)                                #5135.17
-..LN5345:
-        movl      16(%ebx), %eax                                #5138.22
-..LN5347:
-        movl      -40(%ebp), %edx                               #5138.28
-        cmpl      %edx, %eax                                    #5138.28
-        jbe       ..B29.42      # Prob 50%                      #5138.28
-                                # LOE
-..B29.41:                       # Preds ..B29.40
-..LN5349:
-        xorl      %eax, %eax                                    #5139.28
-        leave                                                   #5139.28
-..___tag_value_eval_4na_pos.1069:                               #
-        movl      %ebx, %esp                                    #5139.28
-        popl      %ebx                                          #5139.28
-..___tag_value_eval_4na_pos.1070:                               #
-        ret                                                     #5139.28
-..___tag_value_eval_4na_pos.1072:                               #
-                                # LOE
-..B29.42:                       # Preds ..B29.40
-..LN5351:
-        movl      -16(%ebp), %eax                               #5142.25
-        decl      %eax                                          #5142.25
-        movl      %eax, -16(%ebp)                               #5142.25
-..LN5353:
-        je        ..B29.47      # Prob 50%                      #5142.39
-                                # LOE
-..B29.43:                       # Preds ..B29.42
-..LN5355:
-        movdqa    -216(%ebp), %xmm0                             #5147.43
-..LN5357:
-        psrldq    $2, %xmm0                                     #5147.26
-..LN5359:
-        movdqa    %xmm0, -216(%ebp)                             #5147.17
-..LN5361:
-        movl      -32(%ebp), %eax                               #5150.22
-..LN5363:
-        movl      -36(%ebp), %edx                               #5150.26
-        cmpl      %edx, %eax                                    #5150.26
-        jae       ..B29.45      # Prob 50%                      #5150.26
-                                # LOE
-..B29.44:                       # Preds ..B29.43
-..LN5365:
-        movdqa    -216(%ebp), %xmm0                             #5151.49
-..LN5367:
-        movl      -32(%ebp), %eax                               #5151.72
-        movzbl    (%eax), %eax                                  #5151.72
-        movzbl    %al, %eax                                     #5151.72
-..LN5369:
-        movl      -4(%ebp), %edx                                #5151.57
-        movzwl    expand_2na at GOTOFF(%edx,%eax,2), %eax          #5151.57
-        movzwl    %ax, %eax                                     #5151.57
-..LN5371:
-        pinsrw    $7, %eax, %xmm0                               #5151.30
-..LN5373:
-        movdqa    %xmm0, -216(%ebp)                             #5151.21
-                                # LOE
-..B29.45:                       # Preds ..B29.44 ..B29.43
-..LN5375:
-        incl      -32(%ebp)                                     #5154.20
-        jmp       ..B29.10      # Prob 100%                     #5154.20
-                                # LOE
-..B29.47:                       # Preds ..B29.42 ..B29.10
-..LN5377:
-        movl      -44(%ebp), %eax                               #5159.18
-..LN5379:
-        movl      -36(%ebp), %edx                               #5159.25
-        cmpl      %edx, %eax                                    #5159.25
-        jae       ..B29.51      # Prob 50%                      #5159.25
-                                # LOE
-..B29.48:                       # Preds ..B29.47
-..LN5381:
-        movl      16(%ebx), %eax                                #5164.18
-..LN5383:
-        movl      -40(%ebp), %edx                               #5164.24
-        cmpl      %edx, %eax                                    #5164.24
-        ja        ..B29.51      # Prob 50%                      #5164.24
-                                # LOE
-..B29.49:                       # Preds ..B29.48
-..LN5385:
-        addl      $-8, %esp                                     #5169.22
-..LN5387:
-        movl      -44(%ebp), %eax                               #5169.41
-        movl      %eax, (%esp)                                  #5169.41
-..LN5389:
-        movl      -36(%ebp), %eax                               #5169.46
-        movl      %eax, 4(%esp)                                 #5169.46
-..LN5391:
-        call      prime_buffer_4na                              #5169.22
-                                # LOE xmm0
-..B29.56:                       # Preds ..B29.49
-        addl      $8, %esp                                      #5169.22
-        movdqa    %xmm0, -264(%ebp)                             #5169.22
-                                # LOE
-..B29.50:                       # Preds ..B29.56
-..LN5393:
-        movdqa    -264(%ebp), %xmm0                             #5169.13
-        movdqa    %xmm0, -216(%ebp)                             #5169.13
-..LN5395:
-        addl      $8, -44(%ebp)                                 #5184.13
-..LN5397:
-        movl      -44(%ebp), %eax                               #5186.17
-..LN5399:
-        movl      %eax, -32(%ebp)                               #5186.13
-        jmp       ..B29.8       # Prob 100%                     #5186.13
-                                # LOE
-..B29.51:                       # Preds ..B29.48 ..B29.47 ..B29.8
-..LN5401:
-        xorl      %eax, %eax                                    #5196.12
-        leave                                                   #5196.12
-..___tag_value_eval_4na_pos.1076:                               #
-        movl      %ebx, %esp                                    #5196.12
-        popl      %ebx                                          #5196.12
-..___tag_value_eval_4na_pos.1077:                               #
-        ret                                                     #5196.12
-        .align    2,0x90
-..___tag_value_eval_4na_pos.1079:                               #
-                                # LOE
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-.LNeval_4na_pos:
-	.data
-# -- End  eval_4na_pos
-	.data
-	.text
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1(self): 8 + %ebp
-# parameter 2(ncbi2na): 12 + %ebp
-# parameter 3(pos): 16 + %ebp
-# parameter 4(len): 20 + %ebp
-# parameter 5(selflen): 24 + %ebp
-..B30.1:                        # Preds ..B30.0
-..___tag_value_NucStrstrSearch.1082:                            #
-..LN5403:
-        pushl     %ebp                                          #5217.1
-        movl      %esp, %ebp                                    #5217.1
-..___tag_value_NucStrstrSearch.1087:                            #
-        subl      $92, %esp                                     #5217.1
-        movl      %ebx, -4(%ebp)                                #5217.1
-..___tag_value_NucStrstrSearch.1090:                            #
-..LN5405:
-        movl      8(%ebp), %eax                                 #5218.10
-..LN5407:
-        testl     %eax, %eax                                    #5218.18
-        je        ..B30.111     # Prob 50%                      #5218.18
-                                # LOE
-..B30.2:                        # Preds ..B30.1
-..LN5409:
-        movl      12(%ebp), %eax                                #5218.26
-..LN5411:
-        testl     %eax, %eax                                    #5218.37
-        je        ..B30.111     # Prob 50%                      #5218.37
-                                # LOE
-..B30.3:                        # Preds ..B30.2
-..LN5413:
-        movl      20(%ebp), %eax                                #5218.45
-..LN5415:
-        testl     %eax, %eax                                    #5218.52
-        je        ..B30.111     # Prob 50%                      #5218.52
-                                # LOE
-..B30.4:                        # Preds ..B30.3
-..LN5417:
-        movl      8(%ebp), %eax                                 #5223.18
-        movl      (%eax), %eax                                  #5223.18
-        movl      %eax, -8(%ebp)                                #5223.18
-..LN5419:
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B30.111     # Prob 50%                      #5223.9
-                                # LOE
-..B30.5:                        # Preds ..B30.4
-        call      ..L1091       # Prob 100%                     #
-..L1091:                                                        #
-        popl      %eax                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L1091], %eax    #
-        movl      %eax, -12(%ebp)                               #
-        movl      -8(%ebp), %edx                                #5223.9
-        movl      ..1..TPKT.30_0 at GOTOFF(%eax,%edx,4), %eax      #5223.9
-        jmp       *%eax                                         #5223.9
-                                # LOE
-..1.30_0.TAG.00:
-..B30.7:                        # Preds ..B30.5
-..LN5421:
-        movl      8(%ebp), %eax                                 #5226.24
-..LN5423:
-        movl      20(%ebp), %edx                                #5226.18
-..LN5425:
-        movl      4(%eax), %eax                                 #5226.24
-        cmpl      %eax, %edx                                    #5226.24
-        jae       ..B30.9       # Prob 50%                      #5226.24
-                                # LOE
-..B30.8:                        # Preds ..B30.7
-..LN5427:
-        xorl      %eax, %eax                                    #5226.54
-        movl      -4(%ebp), %ebx                                #5226.54
-..___tag_value_NucStrstrSearch.1092:                            #
-        leave                                                   #5226.54
-..___tag_value_NucStrstrSearch.1094:                            #
-        ret                                                     #5226.54
-..___tag_value_NucStrstrSearch.1095:                            #
-                                # LOE
-..B30.9:                        # Preds ..B30.7
-..LN5429:
-        movl      24(%ebp), %eax                                #5227.9
-        testl     %eax, %eax                                    #5227.9
-        je        ..B30.11      # Prob 50%                      #5227.9
-                                # LOE
-..B30.10:                       # Preds ..B30.9
-..LN5431:
-        movl      8(%ebp), %eax                                 #5227.27
-..LN5433:
-        movl      24(%ebp), %edx                                #5227.18
-..LN5435:
-        movl      4(%eax), %eax                                 #5227.27
-..LN5437:
-        movl      %eax, (%edx)                                  #5227.18
-                                # LOE
-..B30.11:                       # Preds ..B30.10 ..B30.9
-..LN5439:
-        addl      $-16, %esp                                    #5228.20
-..LN5441:
-        movl      8(%ebp), %eax                                 #5228.36
-        movl      %eax, (%esp)                                  #5228.36
-..LN5443:
-        movl      12(%ebp), %eax                                #5228.51
-        movl      %eax, 4(%esp)                                 #5228.51
-..LN5445:
-        movl      16(%ebp), %eax                                #5228.60
-        movl      %eax, 8(%esp)                                 #5228.60
-..LN5447:
-        movl      20(%ebp), %eax                                #5228.65
-        movl      %eax, 12(%esp)                                #5228.65
-..LN5449:
-        call      eval_2na_64                                   #5228.20
-                                # LOE eax
-..B30.114:                      # Preds ..B30.11
-        addl      $16, %esp                                     #5228.20
-        movl      %eax, -80(%ebp)                               #5228.20
-                                # LOE
-..B30.12:                       # Preds ..B30.114
-        movl      -80(%ebp), %eax                               #5228.20
-        movl      -4(%ebp), %ebx                                #5228.20
-..___tag_value_NucStrstrSearch.1097:                            #
-        leave                                                   #5228.20
-..___tag_value_NucStrstrSearch.1099:                            #
-        ret                                                     #5228.20
-..___tag_value_NucStrstrSearch.1100:                            #
-                                # LOE
-..1.30_0.TAG.01:
-..B30.14:                       # Preds ..B30.5
-..LN5451:
-        movl      8(%ebp), %eax                                 #5230.24
-..LN5453:
-        movl      20(%ebp), %edx                                #5230.18
-..LN5455:
-        movl      4(%eax), %eax                                 #5230.24
-        cmpl      %eax, %edx                                    #5230.24
-        jae       ..B30.16      # Prob 50%                      #5230.24
-                                # LOE
-..B30.15:                       # Preds ..B30.14
-..LN5457:
-        xorl      %eax, %eax                                    #5230.54
-        movl      -4(%ebp), %ebx                                #5230.54
-..___tag_value_NucStrstrSearch.1102:                            #
-        leave                                                   #5230.54
-..___tag_value_NucStrstrSearch.1104:                            #
-        ret                                                     #5230.54
-..___tag_value_NucStrstrSearch.1105:                            #
-                                # LOE
-..B30.16:                       # Preds ..B30.14
-..LN5459:
-        movl      24(%ebp), %eax                                #5231.9
-        testl     %eax, %eax                                    #5231.9
-        je        ..B30.18      # Prob 50%                      #5231.9
-                                # LOE
-..B30.17:                       # Preds ..B30.16
-..LN5461:
-        movl      8(%ebp), %eax                                 #5231.27
-..LN5463:
-        movl      24(%ebp), %edx                                #5231.18
-..LN5465:
-        movl      4(%eax), %eax                                 #5231.27
-..LN5467:
-        movl      %eax, (%edx)                                  #5231.18
-                                # LOE
-..B30.18:                       # Preds ..B30.17 ..B30.16
-..LN5469:
-        addl      $-16, %esp                                    #5232.20
-..LN5471:
-        movl      8(%ebp), %eax                                 #5232.36
-        movl      %eax, (%esp)                                  #5232.36
-..LN5473:
-        movl      12(%ebp), %eax                                #5232.51
-        movl      %eax, 4(%esp)                                 #5232.51
-..LN5475:
-        movl      16(%ebp), %eax                                #5232.60
-        movl      %eax, 8(%esp)                                 #5232.60
-..LN5477:
-        movl      20(%ebp), %eax                                #5232.65
-        movl      %eax, 12(%esp)                                #5232.65
-..LN5479:
-        call      eval_4na_64                                   #5232.20
-                                # LOE eax
-..B30.115:                      # Preds ..B30.18
-        addl      $16, %esp                                     #5232.20
-        movl      %eax, -76(%ebp)                               #5232.20
-                                # LOE
-..B30.19:                       # Preds ..B30.115
-        movl      -76(%ebp), %eax                               #5232.20
-        movl      -4(%ebp), %ebx                                #5232.20
-..___tag_value_NucStrstrSearch.1107:                            #
-        leave                                                   #5232.20
-..___tag_value_NucStrstrSearch.1109:                            #
-        ret                                                     #5232.20
-..___tag_value_NucStrstrSearch.1110:                            #
-                                # LOE
-..1.30_0.TAG.02:
-..B30.21:                       # Preds ..B30.5
-..LN5481:
-        movl      8(%ebp), %eax                                 #5235.24
-..LN5483:
-        movl      20(%ebp), %edx                                #5235.18
-..LN5485:
-        movl      4(%eax), %eax                                 #5235.24
-        cmpl      %eax, %edx                                    #5235.24
-        jae       ..B30.23      # Prob 50%                      #5235.24
-                                # LOE
-..B30.22:                       # Preds ..B30.21
-..LN5487:
-        xorl      %eax, %eax                                    #5235.54
-        movl      -4(%ebp), %ebx                                #5235.54
-..___tag_value_NucStrstrSearch.1112:                            #
-        leave                                                   #5235.54
-..___tag_value_NucStrstrSearch.1114:                            #
-        ret                                                     #5235.54
-..___tag_value_NucStrstrSearch.1115:                            #
-                                # LOE
-..B30.23:                       # Preds ..B30.21
-..LN5489:
-        movl      24(%ebp), %eax                                #5236.9
-        testl     %eax, %eax                                    #5236.9
-        je        ..B30.25      # Prob 50%                      #5236.9
-                                # LOE
-..B30.24:                       # Preds ..B30.23
-..LN5491:
-        movl      8(%ebp), %eax                                 #5236.27
-..LN5493:
-        movl      24(%ebp), %edx                                #5236.18
-..LN5495:
-        movl      4(%eax), %eax                                 #5236.27
-..LN5497:
-        movl      %eax, (%edx)                                  #5236.18
-                                # LOE
-..B30.25:                       # Preds ..B30.24 ..B30.23
-..LN5499:
-        addl      $-16, %esp                                    #5237.20
-..LN5501:
-        movl      8(%ebp), %eax                                 #5237.35
-        movl      %eax, (%esp)                                  #5237.35
-..LN5503:
-        movl      12(%ebp), %eax                                #5237.50
-        movl      %eax, 4(%esp)                                 #5237.50
-..LN5505:
-        movl      16(%ebp), %eax                                #5237.59
-        movl      %eax, 8(%esp)                                 #5237.59
-..LN5507:
-        movl      20(%ebp), %eax                                #5237.64
-        movl      %eax, 12(%esp)                                #5237.64
-..LN5509:
-        call      eval_2na_8                                    #5237.20
-                                # LOE eax
-..B30.116:                      # Preds ..B30.25
-        addl      $16, %esp                                     #5237.20
-        movl      %eax, -72(%ebp)                               #5237.20
-                                # LOE
-..B30.26:                       # Preds ..B30.116
-        movl      -72(%ebp), %eax                               #5237.20
-        movl      -4(%ebp), %ebx                                #5237.20
-..___tag_value_NucStrstrSearch.1117:                            #
-        leave                                                   #5237.20
-..___tag_value_NucStrstrSearch.1119:                            #
-        ret                                                     #5237.20
-..___tag_value_NucStrstrSearch.1120:                            #
-                                # LOE
-..1.30_0.TAG.03:
-..B30.28:                       # Preds ..B30.5
-..LN5511:
-        movl      8(%ebp), %eax                                 #5239.24
-..LN5513:
-        movl      20(%ebp), %edx                                #5239.18
-..LN5515:
-        movl      4(%eax), %eax                                 #5239.24
-        cmpl      %eax, %edx                                    #5239.24
-        jae       ..B30.30      # Prob 50%                      #5239.24
-                                # LOE
-..B30.29:                       # Preds ..B30.28
-..LN5517:
-        xorl      %eax, %eax                                    #5239.54
-        movl      -4(%ebp), %ebx                                #5239.54
-..___tag_value_NucStrstrSearch.1122:                            #
-        leave                                                   #5239.54
-..___tag_value_NucStrstrSearch.1124:                            #
-        ret                                                     #5239.54
-..___tag_value_NucStrstrSearch.1125:                            #
-                                # LOE
-..B30.30:                       # Preds ..B30.28
-..LN5519:
-        movl      24(%ebp), %eax                                #5240.9
-        testl     %eax, %eax                                    #5240.9
-        je        ..B30.32      # Prob 50%                      #5240.9
-                                # LOE
-..B30.31:                       # Preds ..B30.30
-..LN5521:
-        movl      8(%ebp), %eax                                 #5240.27
-..LN5523:
-        movl      24(%ebp), %edx                                #5240.18
-..LN5525:
-        movl      4(%eax), %eax                                 #5240.27
-..LN5527:
-        movl      %eax, (%edx)                                  #5240.18
-                                # LOE
-..B30.32:                       # Preds ..B30.31 ..B30.30
-..LN5529:
-        addl      $-16, %esp                                    #5241.20
-..LN5531:
-        movl      8(%ebp), %eax                                 #5241.36
-        movl      %eax, (%esp)                                  #5241.36
-..LN5533:
-        movl      12(%ebp), %eax                                #5241.51
-        movl      %eax, 4(%esp)                                 #5241.51
-..LN5535:
-        movl      16(%ebp), %eax                                #5241.60
-        movl      %eax, 8(%esp)                                 #5241.60
-..LN5537:
-        movl      20(%ebp), %eax                                #5241.65
-        movl      %eax, 12(%esp)                                #5241.65
-..LN5539:
-        call      eval_2na_16                                   #5241.20
-                                # LOE eax
-..B30.117:                      # Preds ..B30.32
-        addl      $16, %esp                                     #5241.20
-        movl      %eax, -68(%ebp)                               #5241.20
-                                # LOE
-..B30.33:                       # Preds ..B30.117
-        movl      -68(%ebp), %eax                               #5241.20
-        movl      -4(%ebp), %ebx                                #5241.20
-..___tag_value_NucStrstrSearch.1127:                            #
-        leave                                                   #5241.20
-..___tag_value_NucStrstrSearch.1129:                            #
-        ret                                                     #5241.20
-..___tag_value_NucStrstrSearch.1130:                            #
-                                # LOE
-..1.30_0.TAG.04:
-..B30.35:                       # Preds ..B30.5
-..LN5541:
-        movl      8(%ebp), %eax                                 #5243.24
-..LN5543:
-        movl      20(%ebp), %edx                                #5243.18
-..LN5545:
-        movl      4(%eax), %eax                                 #5243.24
-        cmpl      %eax, %edx                                    #5243.24
-        jae       ..B30.37      # Prob 50%                      #5243.24
-                                # LOE
-..B30.36:                       # Preds ..B30.35
-..LN5547:
-        xorl      %eax, %eax                                    #5243.54
-        movl      -4(%ebp), %ebx                                #5243.54
-..___tag_value_NucStrstrSearch.1132:                            #
-        leave                                                   #5243.54
-..___tag_value_NucStrstrSearch.1134:                            #
-        ret                                                     #5243.54
-..___tag_value_NucStrstrSearch.1135:                            #
-                                # LOE
-..B30.37:                       # Preds ..B30.35
-..LN5549:
-        movl      24(%ebp), %eax                                #5244.9
-        testl     %eax, %eax                                    #5244.9
-        je        ..B30.39      # Prob 50%                      #5244.9
-                                # LOE
-..B30.38:                       # Preds ..B30.37
-..LN5551:
-        movl      8(%ebp), %eax                                 #5244.27
-..LN5553:
-        movl      24(%ebp), %edx                                #5244.18
-..LN5555:
-        movl      4(%eax), %eax                                 #5244.27
-..LN5557:
-        movl      %eax, (%edx)                                  #5244.18
-                                # LOE
-..B30.39:                       # Preds ..B30.38 ..B30.37
-..LN5559:
-        addl      $-16, %esp                                    #5245.20
-..LN5561:
-        movl      8(%ebp), %eax                                 #5245.36
-        movl      %eax, (%esp)                                  #5245.36
-..LN5563:
-        movl      12(%ebp), %eax                                #5245.51
-        movl      %eax, 4(%esp)                                 #5245.51
-..LN5565:
-        movl      16(%ebp), %eax                                #5245.60
-        movl      %eax, 8(%esp)                                 #5245.60
-..LN5567:
-        movl      20(%ebp), %eax                                #5245.65
-        movl      %eax, 12(%esp)                                #5245.65
-..LN5569:
-        call      eval_2na_32                                   #5245.20
-                                # LOE eax
-..B30.118:                      # Preds ..B30.39
-        addl      $16, %esp                                     #5245.20
-        movl      %eax, -64(%ebp)                               #5245.20
-                                # LOE
-..B30.40:                       # Preds ..B30.118
-        movl      -64(%ebp), %eax                               #5245.20
-        movl      -4(%ebp), %ebx                                #5245.20
-..___tag_value_NucStrstrSearch.1137:                            #
-        leave                                                   #5245.20
-..___tag_value_NucStrstrSearch.1139:                            #
-        ret                                                     #5245.20
-..___tag_value_NucStrstrSearch.1140:                            #
-                                # LOE
-..1.30_0.TAG.05:
-..B30.42:                       # Preds ..B30.5
-..LN5571:
-        movl      8(%ebp), %eax                                 #5247.24
-..LN5573:
-        movl      20(%ebp), %edx                                #5247.18
-..LN5575:
-        movl      4(%eax), %eax                                 #5247.24
-        cmpl      %eax, %edx                                    #5247.24
-        jae       ..B30.44      # Prob 50%                      #5247.24
-                                # LOE
-..B30.43:                       # Preds ..B30.42
-..LN5577:
-        xorl      %eax, %eax                                    #5247.54
-        movl      -4(%ebp), %ebx                                #5247.54
-..___tag_value_NucStrstrSearch.1142:                            #
-        leave                                                   #5247.54
-..___tag_value_NucStrstrSearch.1144:                            #
-        ret                                                     #5247.54
-..___tag_value_NucStrstrSearch.1145:                            #
-                                # LOE
-..B30.44:                       # Preds ..B30.42
-..LN5579:
-        movl      24(%ebp), %eax                                #5248.9
-        testl     %eax, %eax                                    #5248.9
-        je        ..B30.46      # Prob 50%                      #5248.9
-                                # LOE
-..B30.45:                       # Preds ..B30.44
-..LN5581:
-        movl      8(%ebp), %eax                                 #5248.27
-..LN5583:
-        movl      24(%ebp), %edx                                #5248.18
-..LN5585:
-        movl      4(%eax), %eax                                 #5248.27
-..LN5587:
-        movl      %eax, (%edx)                                  #5248.18
-                                # LOE
-..B30.46:                       # Preds ..B30.45 ..B30.44
-..LN5589:
-        addl      $-16, %esp                                    #5249.20
-..LN5591:
-        movl      8(%ebp), %eax                                 #5249.37
-        movl      %eax, (%esp)                                  #5249.37
-..LN5593:
-        movl      12(%ebp), %eax                                #5249.52
-        movl      %eax, 4(%esp)                                 #5249.52
-..LN5595:
-        movl      16(%ebp), %eax                                #5249.61
-        movl      %eax, 8(%esp)                                 #5249.61
-..LN5597:
-        movl      20(%ebp), %eax                                #5249.66
-        movl      %eax, 12(%esp)                                #5249.66
-..LN5599:
-        call      eval_2na_128                                  #5249.20
-                                # LOE eax
-..B30.119:                      # Preds ..B30.46
-        addl      $16, %esp                                     #5249.20
-        movl      %eax, -60(%ebp)                               #5249.20
-                                # LOE
-..B30.47:                       # Preds ..B30.119
-        movl      -60(%ebp), %eax                               #5249.20
-        movl      -4(%ebp), %ebx                                #5249.20
-..___tag_value_NucStrstrSearch.1147:                            #
-        leave                                                   #5249.20
-..___tag_value_NucStrstrSearch.1149:                            #
-        ret                                                     #5249.20
-..___tag_value_NucStrstrSearch.1150:                            #
-                                # LOE
-..1.30_0.TAG.06:
-..B30.49:                       # Preds ..B30.5
-..LN5601:
-        movl      8(%ebp), %eax                                 #5251.24
-..LN5603:
-        movl      20(%ebp), %edx                                #5251.18
-..LN5605:
-        movl      4(%eax), %eax                                 #5251.24
-        cmpl      %eax, %edx                                    #5251.24
-        jae       ..B30.51      # Prob 50%                      #5251.24
-                                # LOE
-..B30.50:                       # Preds ..B30.49
-..LN5607:
-        xorl      %eax, %eax                                    #5251.54
-        movl      -4(%ebp), %ebx                                #5251.54
-..___tag_value_NucStrstrSearch.1152:                            #
-        leave                                                   #5251.54
-..___tag_value_NucStrstrSearch.1154:                            #
-        ret                                                     #5251.54
-..___tag_value_NucStrstrSearch.1155:                            #
-                                # LOE
-..B30.51:                       # Preds ..B30.49
-..LN5609:
-        movl      24(%ebp), %eax                                #5252.9
-        testl     %eax, %eax                                    #5252.9
-        je        ..B30.53      # Prob 50%                      #5252.9
-                                # LOE
-..B30.52:                       # Preds ..B30.51
-..LN5611:
-        movl      8(%ebp), %eax                                 #5252.27
-..LN5613:
-        movl      24(%ebp), %edx                                #5252.18
-..LN5615:
-        movl      4(%eax), %eax                                 #5252.27
-..LN5617:
-        movl      %eax, (%edx)                                  #5252.18
-                                # LOE
-..B30.53:                       # Preds ..B30.52 ..B30.51
-..LN5619:
-        addl      $-16, %esp                                    #5253.20
-..LN5621:
-        movl      8(%ebp), %eax                                 #5253.36
-        movl      %eax, (%esp)                                  #5253.36
-..LN5623:
-        movl      12(%ebp), %eax                                #5253.51
-        movl      %eax, 4(%esp)                                 #5253.51
-..LN5625:
-        movl      16(%ebp), %eax                                #5253.60
-        movl      %eax, 8(%esp)                                 #5253.60
-..LN5627:
-        movl      20(%ebp), %eax                                #5253.65
-        movl      %eax, 12(%esp)                                #5253.65
-..LN5629:
-        call      eval_4na_16                                   #5253.20
-                                # LOE eax
-..B30.120:                      # Preds ..B30.53
-        addl      $16, %esp                                     #5253.20
-        movl      %eax, -56(%ebp)                               #5253.20
-                                # LOE
-..B30.54:                       # Preds ..B30.120
-        movl      -56(%ebp), %eax                               #5253.20
-        movl      -4(%ebp), %ebx                                #5253.20
-..___tag_value_NucStrstrSearch.1157:                            #
-        leave                                                   #5253.20
-..___tag_value_NucStrstrSearch.1159:                            #
-        ret                                                     #5253.20
-..___tag_value_NucStrstrSearch.1160:                            #
-                                # LOE
-..1.30_0.TAG.07:
-..B30.56:                       # Preds ..B30.5
-..LN5631:
-        movl      8(%ebp), %eax                                 #5255.24
-..LN5633:
-        movl      20(%ebp), %edx                                #5255.18
-..LN5635:
-        movl      4(%eax), %eax                                 #5255.24
-        cmpl      %eax, %edx                                    #5255.24
-        jae       ..B30.58      # Prob 50%                      #5255.24
-                                # LOE
-..B30.57:                       # Preds ..B30.56
-..LN5637:
-        xorl      %eax, %eax                                    #5255.54
-        movl      -4(%ebp), %ebx                                #5255.54
-..___tag_value_NucStrstrSearch.1162:                            #
-        leave                                                   #5255.54
-..___tag_value_NucStrstrSearch.1164:                            #
-        ret                                                     #5255.54
-..___tag_value_NucStrstrSearch.1165:                            #
-                                # LOE
-..B30.58:                       # Preds ..B30.56
-..LN5639:
-        movl      24(%ebp), %eax                                #5256.9
-        testl     %eax, %eax                                    #5256.9
-        je        ..B30.60      # Prob 50%                      #5256.9
-                                # LOE
-..B30.59:                       # Preds ..B30.58
-..LN5641:
-        movl      8(%ebp), %eax                                 #5256.27
-..LN5643:
-        movl      24(%ebp), %edx                                #5256.18
-..LN5645:
-        movl      4(%eax), %eax                                 #5256.27
-..LN5647:
-        movl      %eax, (%edx)                                  #5256.18
-                                # LOE
-..B30.60:                       # Preds ..B30.59 ..B30.58
-..LN5649:
-        addl      $-16, %esp                                    #5257.20
-..LN5651:
-        movl      8(%ebp), %eax                                 #5257.36
-        movl      %eax, (%esp)                                  #5257.36
-..LN5653:
-        movl      12(%ebp), %eax                                #5257.51
-        movl      %eax, 4(%esp)                                 #5257.51
-..LN5655:
-        movl      16(%ebp), %eax                                #5257.60
-        movl      %eax, 8(%esp)                                 #5257.60
-..LN5657:
-        movl      20(%ebp), %eax                                #5257.65
-        movl      %eax, 12(%esp)                                #5257.65
-..LN5659:
-        call      eval_4na_32                                   #5257.20
-                                # LOE eax
-..B30.121:                      # Preds ..B30.60
-        addl      $16, %esp                                     #5257.20
-        movl      %eax, -52(%ebp)                               #5257.20
-                                # LOE
-..B30.61:                       # Preds ..B30.121
-        movl      -52(%ebp), %eax                               #5257.20
-        movl      -4(%ebp), %ebx                                #5257.20
-..___tag_value_NucStrstrSearch.1167:                            #
-        leave                                                   #5257.20
-..___tag_value_NucStrstrSearch.1169:                            #
-        ret                                                     #5257.20
-..___tag_value_NucStrstrSearch.1170:                            #
-                                # LOE
-..1.30_0.TAG.08:
-..B30.63:                       # Preds ..B30.5
-..LN5661:
-        movl      8(%ebp), %eax                                 #5259.24
-..LN5663:
-        movl      20(%ebp), %edx                                #5259.18
-..LN5665:
-        movl      4(%eax), %eax                                 #5259.24
-        cmpl      %eax, %edx                                    #5259.24
-        jae       ..B30.65      # Prob 50%                      #5259.24
-                                # LOE
-..B30.64:                       # Preds ..B30.63
-..LN5667:
-        xorl      %eax, %eax                                    #5259.54
-        movl      -4(%ebp), %ebx                                #5259.54
-..___tag_value_NucStrstrSearch.1172:                            #
-        leave                                                   #5259.54
-..___tag_value_NucStrstrSearch.1174:                            #
-        ret                                                     #5259.54
-..___tag_value_NucStrstrSearch.1175:                            #
-                                # LOE
-..B30.65:                       # Preds ..B30.63
-..LN5669:
-        movl      24(%ebp), %eax                                #5260.9
-        testl     %eax, %eax                                    #5260.9
-        je        ..B30.67      # Prob 50%                      #5260.9
-                                # LOE
-..B30.66:                       # Preds ..B30.65
-..LN5671:
-        movl      8(%ebp), %eax                                 #5260.27
-..LN5673:
-        movl      24(%ebp), %edx                                #5260.18
-..LN5675:
-        movl      4(%eax), %eax                                 #5260.27
-..LN5677:
-        movl      %eax, (%edx)                                  #5260.18
-                                # LOE
-..B30.67:                       # Preds ..B30.66 ..B30.65
-..LN5679:
-        addl      $-16, %esp                                    #5261.20
-..LN5681:
-        movl      8(%ebp), %eax                                 #5261.37
-        movl      %eax, (%esp)                                  #5261.37
-..LN5683:
-        movl      12(%ebp), %eax                                #5261.52
-        movl      %eax, 4(%esp)                                 #5261.52
-..LN5685:
-        movl      16(%ebp), %eax                                #5261.61
-        movl      %eax, 8(%esp)                                 #5261.61
-..LN5687:
-        movl      20(%ebp), %eax                                #5261.66
-        movl      %eax, 12(%esp)                                #5261.66
-..LN5689:
-        call      eval_4na_128                                  #5261.20
-                                # LOE eax
-..B30.122:                      # Preds ..B30.67
-        addl      $16, %esp                                     #5261.20
-        movl      %eax, -48(%ebp)                               #5261.20
-                                # LOE
-..B30.68:                       # Preds ..B30.122
-        movl      -48(%ebp), %eax                               #5261.20
-        movl      -4(%ebp), %ebx                                #5261.20
-..___tag_value_NucStrstrSearch.1177:                            #
-        leave                                                   #5261.20
-..___tag_value_NucStrstrSearch.1179:                            #
-        ret                                                     #5261.20
-..___tag_value_NucStrstrSearch.1180:                            #
-                                # LOE
-..1.30_0.TAG.09:
-..B30.70:                       # Preds ..B30.5
-..LN5691:
-        movl      8(%ebp), %eax                                 #5264.24
-..LN5693:
-        movl      20(%ebp), %edx                                #5264.18
-..LN5695:
-        movl      4(%eax), %eax                                 #5264.24
-        cmpl      %eax, %edx                                    #5264.24
-        jae       ..B30.72      # Prob 50%                      #5264.24
-                                # LOE
-..B30.71:                       # Preds ..B30.70
-..LN5697:
-        xorl      %eax, %eax                                    #5264.54
-        movl      -4(%ebp), %ebx                                #5264.54
-..___tag_value_NucStrstrSearch.1182:                            #
-        leave                                                   #5264.54
-..___tag_value_NucStrstrSearch.1184:                            #
-        ret                                                     #5264.54
-..___tag_value_NucStrstrSearch.1185:                            #
-                                # LOE
-..B30.72:                       # Preds ..B30.70
-..LN5699:
-        movl      24(%ebp), %eax                                #5265.9
-        testl     %eax, %eax                                    #5265.9
-        je        ..B30.74      # Prob 50%                      #5265.9
-                                # LOE
-..B30.73:                       # Preds ..B30.72
-..LN5701:
-        movl      8(%ebp), %eax                                 #5265.27
-..LN5703:
-        movl      24(%ebp), %edx                                #5265.18
-..LN5705:
-        movl      4(%eax), %eax                                 #5265.27
-..LN5707:
-        movl      %eax, (%edx)                                  #5265.18
-                                # LOE
-..B30.74:                       # Preds ..B30.73 ..B30.72
-..LN5709:
-        addl      $-16, %esp                                    #5266.20
-..LN5711:
-        movl      8(%ebp), %eax                                 #5266.37
-        movl      %eax, (%esp)                                  #5266.37
-..LN5713:
-        movl      12(%ebp), %eax                                #5266.52
-        movl      %eax, 4(%esp)                                 #5266.52
-..LN5715:
-        movl      16(%ebp), %eax                                #5266.61
-        movl      %eax, 8(%esp)                                 #5266.61
-..LN5717:
-        movl      20(%ebp), %eax                                #5266.66
-        movl      %eax, 12(%esp)                                #5266.66
-..LN5719:
-        call      eval_2na_pos                                  #5266.20
-                                # LOE eax
-..B30.123:                      # Preds ..B30.74
-        addl      $16, %esp                                     #5266.20
-        movl      %eax, -44(%ebp)                               #5266.20
-                                # LOE
-..B30.75:                       # Preds ..B30.123
-        movl      -44(%ebp), %eax                               #5266.20
-        movl      -4(%ebp), %ebx                                #5266.20
-..___tag_value_NucStrstrSearch.1187:                            #
-        leave                                                   #5266.20
-..___tag_value_NucStrstrSearch.1189:                            #
-        ret                                                     #5266.20
-..___tag_value_NucStrstrSearch.1190:                            #
-                                # LOE
-..1.30_0.TAG.0a:
-..B30.77:                       # Preds ..B30.5
-..LN5721:
-        movl      8(%ebp), %eax                                 #5268.24
-..LN5723:
-        movl      20(%ebp), %edx                                #5268.18
-..LN5725:
-        movl      4(%eax), %eax                                 #5268.24
-        cmpl      %eax, %edx                                    #5268.24
-        jae       ..B30.79      # Prob 50%                      #5268.24
-                                # LOE
-..B30.78:                       # Preds ..B30.77
-..LN5727:
-        xorl      %eax, %eax                                    #5268.54
-        movl      -4(%ebp), %ebx                                #5268.54
-..___tag_value_NucStrstrSearch.1192:                            #
-        leave                                                   #5268.54
-..___tag_value_NucStrstrSearch.1194:                            #
-        ret                                                     #5268.54
-..___tag_value_NucStrstrSearch.1195:                            #
-                                # LOE
-..B30.79:                       # Preds ..B30.77
-..LN5729:
-        movl      24(%ebp), %eax                                #5269.9
-        testl     %eax, %eax                                    #5269.9
-        je        ..B30.81      # Prob 50%                      #5269.9
-                                # LOE
-..B30.80:                       # Preds ..B30.79
-..LN5731:
-        movl      8(%ebp), %eax                                 #5269.27
-..LN5733:
-        movl      24(%ebp), %edx                                #5269.18
-..LN5735:
-        movl      4(%eax), %eax                                 #5269.27
-..LN5737:
-        movl      %eax, (%edx)                                  #5269.18
-                                # LOE
-..B30.81:                       # Preds ..B30.80 ..B30.79
-..LN5739:
-        addl      $-16, %esp                                    #5270.20
-..LN5741:
-        movl      8(%ebp), %eax                                 #5270.37
-        movl      %eax, (%esp)                                  #5270.37
-..LN5743:
-        movl      12(%ebp), %eax                                #5270.52
-        movl      %eax, 4(%esp)                                 #5270.52
-..LN5745:
-        movl      16(%ebp), %eax                                #5270.61
-        movl      %eax, 8(%esp)                                 #5270.61
-..LN5747:
-        movl      20(%ebp), %eax                                #5270.66
-        movl      %eax, 12(%esp)                                #5270.66
-..LN5749:
-        call      eval_4na_pos                                  #5270.20
-                                # LOE eax
-..B30.124:                      # Preds ..B30.81
-        addl      $16, %esp                                     #5270.20
-        movl      %eax, -40(%ebp)                               #5270.20
-                                # LOE
-..B30.82:                       # Preds ..B30.124
-        movl      -40(%ebp), %eax                               #5270.20
-        movl      -4(%ebp), %ebx                                #5270.20
-..___tag_value_NucStrstrSearch.1197:                            #
-        leave                                                   #5270.20
-..___tag_value_NucStrstrSearch.1199:                            #
-        ret                                                     #5270.20
-..___tag_value_NucStrstrSearch.1200:                            #
-                                # LOE
-..1.30_0.TAG.0b:
-..B30.84:                       # Preds ..B30.5
-..LN5751:
-        addl      $-20, %esp                                    #5272.21
-..LN5753:
-        movl      8(%ebp), %eax                                 #5272.39
-        movl      8(%eax), %eax                                 #5272.39
-        movl      %eax, (%esp)                                  #5272.39
-..LN5755:
-        movl      12(%ebp), %eax                                #5272.63
-        movl      %eax, 4(%esp)                                 #5272.63
-..LN5757:
-        movl      16(%ebp), %eax                                #5272.72
-        movl      %eax, 8(%esp)                                 #5272.72
-..LN5759:
-        movl      20(%ebp), %eax                                #5272.77
-        movl      %eax, 12(%esp)                                #5272.77
-..LN5761:
-        movl      24(%ebp), %eax                                #5272.82
-        movl      %eax, 16(%esp)                                #5272.82
-..LN5763:
-        movl      -12(%ebp), %eax                               #5272.21
-        movl      %eax, %ebx                                    #5272.21
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE eax
-..B30.125:                      # Preds ..B30.84
-        addl      $20, %esp                                     #5272.21
-        movl      %eax, -24(%ebp)                               #5272.21
-                                # LOE
-..B30.85:                       # Preds ..B30.125
-..LN5765:
-        movl      -24(%ebp), %eax                               #5272.13
-        movl      %eax, -28(%ebp)                               #5272.13
-..LN5767:
-        movl      8(%ebp), %eax                                 #5273.22
-        movl      4(%eax), %eax                                 #5273.22
-        movl      %eax, -20(%ebp)                               #5273.22
-        cmpl      $17, %eax                                     #5273.22
-        je        ..B30.87      # Prob 50%                      #5273.22
-                                # LOE
-..B30.86:                       # Preds ..B30.85
-        movl      -20(%ebp), %eax                               #5273.22
-        cmpl      $16, %eax                                     #5273.22
-        je        ..B30.89      # Prob 50%                      #5273.22
-        jmp       ..B30.91      # Prob 100%                     #5273.22
-                                # LOE
-..B30.87:                       # Preds ..B30.85
-..LN5769:
-        movl      -28(%ebp), %eax                               #5276.22
-..LN5771:
-        testl     %eax, %eax                                    #5276.31
-        je        ..B30.91      # Prob 50%                      #5276.31
-                                # LOE
-..B30.88:                       # Preds ..B30.87
-..LN5773:
-        movl      -28(%ebp), %eax                               #5277.28
-        movl      -4(%ebp), %ebx                                #5277.28
-..___tag_value_NucStrstrSearch.1202:                            #
-        leave                                                   #5277.28
-..___tag_value_NucStrstrSearch.1204:                            #
-        ret                                                     #5277.28
-..___tag_value_NucStrstrSearch.1205:                            #
-                                # LOE
-..B30.89:                       # Preds ..B30.86
-..LN5775:
-        movl      -28(%ebp), %eax                               #5280.22
-..LN5777:
-        testl     %eax, %eax                                    #5280.31
-        jne       ..B30.91      # Prob 50%                      #5280.31
-                                # LOE
-..B30.90:                       # Preds ..B30.89
-..LN5779:
-        movl      -28(%ebp), %eax                               #5281.28
-        movl      -4(%ebp), %ebx                                #5281.28
-..___tag_value_NucStrstrSearch.1207:                            #
-        leave                                                   #5281.28
-..___tag_value_NucStrstrSearch.1209:                            #
-        ret                                                     #5281.28
-..___tag_value_NucStrstrSearch.1210:                            #
-                                # LOE
-..B30.91:                       # Preds ..B30.87 ..B30.89 ..B30.86
-..LN5781:
-        addl      $-20, %esp                                    #5284.20
-..LN5783:
-        movl      8(%ebp), %eax                                 #5284.38
-        movl      12(%eax), %eax                                #5284.38
-        movl      %eax, (%esp)                                  #5284.38
-..LN5785:
-        movl      12(%ebp), %eax                                #5284.63
-        movl      %eax, 4(%esp)                                 #5284.63
-..LN5787:
-        movl      16(%ebp), %eax                                #5284.72
-        movl      %eax, 8(%esp)                                 #5284.72
-..LN5789:
-        movl      20(%ebp), %eax                                #5284.77
-        movl      %eax, 12(%esp)                                #5284.77
-..LN5791:
-        movl      24(%ebp), %eax                                #5284.82
-        movl      %eax, 16(%esp)                                #5284.82
-..LN5793:
-        movl      -12(%ebp), %eax                               #5284.20
-        movl      %eax, %ebx                                    #5284.20
-        call      NucStrstrSearch at PLT                           #5284.20
-                                # LOE eax
-..B30.126:                      # Preds ..B30.91
-        addl      $20, %esp                                     #5284.20
-        movl      %eax, -36(%ebp)                               #5284.20
-                                # LOE
-..B30.92:                       # Preds ..B30.126
-        movl      -36(%ebp), %eax                               #5284.20
-        movl      -4(%ebp), %ebx                                #5284.20
-..___tag_value_NucStrstrSearch.1212:                            #
-        leave                                                   #5284.20
-..___tag_value_NucStrstrSearch.1214:                            #
-        ret                                                     #5284.20
-..___tag_value_NucStrstrSearch.1215:                            #
-                                # LOE
-..1.30_0.TAG.0c:
-..B30.94:                       # Preds ..B30.5
-..LN5795:
-        movl      8(%ebp), %eax                                 #5286.22
-        movl      4(%eax), %eax                                 #5286.22
-        movl      %eax, -16(%ebp)                               #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B30.98      # Prob 50%                      #5286.22
-                                # LOE
-..B30.95:                       # Preds ..B30.94
-        movl      -16(%ebp), %eax                               #5286.22
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B30.98      # Prob 50%                      #5286.22
-                                # LOE
-..B30.96:                       # Preds ..B30.95
-        movl      -16(%ebp), %eax                               #5286.22
-        cmpl      $14, %eax                                     #5286.22
-        je        ..B30.103     # Prob 50%                      #5286.22
-                                # LOE
-..B30.97:                       # Preds ..B30.96
-        movl      -16(%ebp), %eax                               #5286.22
-        cmpl      $15, %eax                                     #5286.22
-        je        ..B30.107     # Prob 50%                      #5286.22
-        jmp       ..B30.111     # Prob 100%                     #5286.22
-                                # LOE
-..B30.98:                       # Preds ..B30.94 ..B30.95
-..LN5797:
-        addl      $-20, %esp                                    #5290.25
-..LN5799:
-        movl      8(%ebp), %eax                                 #5290.43
-        movl      8(%eax), %eax                                 #5290.43
-        movl      %eax, (%esp)                                  #5290.43
-..LN5801:
-        movl      12(%ebp), %eax                                #5290.63
-        movl      %eax, 4(%esp)                                 #5290.63
-..LN5803:
-        movl      16(%ebp), %eax                                #5290.72
-        movl      %eax, 8(%esp)                                 #5290.72
-..LN5805:
-        movl      20(%ebp), %eax                                #5290.77
-        movl      %eax, 12(%esp)                                #5290.77
-..LN5807:
-        movl      24(%ebp), %eax                                #5290.82
-        movl      %eax, 16(%esp)                                #5290.82
-..LN5809:
-        movl      -12(%ebp), %eax                               #5290.25
-        movl      %eax, %ebx                                    #5290.25
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE eax
-..B30.127:                      # Preds ..B30.98
-        addl      $20, %esp                                     #5290.25
-        movl      %eax, -32(%ebp)                               #5290.25
-                                # LOE
-..B30.99:                       # Preds ..B30.127
-..LN5811:
-        movl      -32(%ebp), %eax                               #5290.17
-        movl      %eax, -28(%ebp)                               #5290.17
-..LN5813:
-        movl      8(%ebp), %eax                                 #5291.22
-        movl      4(%eax), %eax                                 #5291.22
-..LN5815:
-        testl     %eax, %eax                                    #5291.42
-        jne       ..B30.101     # Prob 50%                      #5291.42
-                                # LOE
-..B30.100:                      # Preds ..B30.99
-..LN5817:
-        movl      -28(%ebp), %eax                               #5292.28
-        movl      -4(%ebp), %ebx                                #5292.28
-..___tag_value_NucStrstrSearch.1217:                            #
-        leave                                                   #5292.28
-..___tag_value_NucStrstrSearch.1219:                            #
-        ret                                                     #5292.28
-..___tag_value_NucStrstrSearch.1220:                            #
-                                # LOE
-..B30.101:                      # Preds ..B30.99
-..LN5819:
-        movl      -28(%ebp), %eax                               #5293.22
-..LN5821:
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B30.111     # Prob 50%                      #5293.31
-                                # LOE
-..B30.102:                      # Preds ..B30.101
-..LN5823:
-        movl      $1, %eax                                      #5294.28
-        movl      -4(%ebp), %ebx                                #5294.28
-..___tag_value_NucStrstrSearch.1222:                            #
-        leave                                                   #5294.28
-..___tag_value_NucStrstrSearch.1224:                            #
-        ret                                                     #5294.28
-..___tag_value_NucStrstrSearch.1225:                            #
-                                # LOE
-..B30.103:                      # Preds ..B30.96
-..LN5825:
-        movl      8(%ebp), %eax                                 #5297.29
-        movl      8(%eax), %eax                                 #5297.29
-        movl      4(%eax), %eax                                 #5297.29
-..LN5827:
-        movl      %eax, -84(%ebp)                               #5297.17
-..LN5829:
-        movl      -84(%ebp), %eax                               #5298.22
-..LN5831:
-        movl      20(%ebp), %edx                                #5298.34
-        cmpl      %edx, %eax                                    #5298.34
-        jbe       ..B30.105     # Prob 50%                      #5298.34
-                                # LOE
-..B30.104:                      # Preds ..B30.103
-..LN5833:
-        xorl      %eax, %eax                                    #5299.28
-        movl      -4(%ebp), %ebx                                #5299.28
-..___tag_value_NucStrstrSearch.1227:                            #
-        leave                                                   #5299.28
-..___tag_value_NucStrstrSearch.1229:                            #
-        ret                                                     #5299.28
-..___tag_value_NucStrstrSearch.1230:                            #
-                                # LOE
-..B30.105:                      # Preds ..B30.103
-..LN5835:
-        addl      $-20, %esp                                    #5300.24
-..LN5837:
-        movl      8(%ebp), %eax                                 #5300.42
-        movl      8(%eax), %eax                                 #5300.42
-        movl      %eax, (%esp)                                  #5300.42
-..LN5839:
-        movl      12(%ebp), %eax                                #5300.62
-        movl      %eax, 4(%esp)                                 #5300.62
-..LN5841:
-        movl      16(%ebp), %eax                                #5300.71
-        movl      %eax, 8(%esp)                                 #5300.71
-..LN5843:
-        movl      -84(%ebp), %eax                               #5300.76
-        movl      %eax, 12(%esp)                                #5300.76
-..LN5845:
-        movl      24(%ebp), %eax                                #5300.87
-        movl      %eax, 16(%esp)                                #5300.87
-..LN5847:
-        movl      -12(%ebp), %eax                               #5300.24
-        movl      %eax, %ebx                                    #5300.24
-        call      NucStrstrSearch at PLT                           #5300.24
-                                # LOE eax
-..B30.128:                      # Preds ..B30.105
-        addl      $20, %esp                                     #5300.24
-        movl      %eax, -88(%ebp)                               #5300.24
-                                # LOE
-..B30.106:                      # Preds ..B30.128
-        movl      -88(%ebp), %eax                               #5300.24
-        movl      -4(%ebp), %ebx                                #5300.24
-..___tag_value_NucStrstrSearch.1232:                            #
-        leave                                                   #5300.24
-..___tag_value_NucStrstrSearch.1234:                            #
-        ret                                                     #5300.24
-..___tag_value_NucStrstrSearch.1235:                            #
-                                # LOE
-..B30.107:                      # Preds ..B30.97
-..LN5849:
-        movl      8(%ebp), %eax                                 #5302.29
-        movl      8(%eax), %eax                                 #5302.29
-        movl      4(%eax), %eax                                 #5302.29
-..LN5851:
-        movl      %eax, -84(%ebp)                               #5302.17
-..LN5853:
-        movl      -84(%ebp), %eax                               #5303.22
-..LN5855:
-        movl      20(%ebp), %edx                                #5303.34
-        cmpl      %edx, %eax                                    #5303.34
-        jbe       ..B30.109     # Prob 50%                      #5303.34
-                                # LOE
-..B30.108:                      # Preds ..B30.107
-..LN5857:
-        xorl      %eax, %eax                                    #5304.28
-        movl      -4(%ebp), %ebx                                #5304.28
-..___tag_value_NucStrstrSearch.1237:                            #
-        leave                                                   #5304.28
-..___tag_value_NucStrstrSearch.1239:                            #
-        ret                                                     #5304.28
-..___tag_value_NucStrstrSearch.1240:                            #
-                                # LOE
-..B30.109:                      # Preds ..B30.107
-..LN5859:
-        addl      $-20, %esp                                    #5305.24
-..LN5861:
-        movl      8(%ebp), %eax                                 #5305.42
-        movl      8(%eax), %eax                                 #5305.42
-        movl      %eax, (%esp)                                  #5305.42
-..LN5863:
-        movl      12(%ebp), %eax                                #5305.62
-        movl      %eax, 4(%esp)                                 #5305.62
-..LN5865:
-        movl      20(%ebp), %eax                                #5306.27
-        addl      16(%ebp), %eax                                #5306.27
-..LN5867:
-        movl      -84(%ebp), %edx                               #5306.33
-        negl      %edx                                          #5306.33
-        addl      %edx, %eax                                    #5306.33
-        movl      %eax, 8(%esp)                                 #5306.33
-..LN5869:
-        movl      -84(%ebp), %eax                               #5306.44
-        movl      %eax, 12(%esp)                                #5306.44
-..LN5871:
-        movl      24(%ebp), %eax                                #5306.55
-        movl      %eax, 16(%esp)                                #5306.55
-..LN5873:
-        movl      -12(%ebp), %eax                               #5305.24
-        movl      %eax, %ebx                                    #5305.24
-        call      NucStrstrSearch at PLT                           #5305.24
-                                # LOE eax
-..B30.129:                      # Preds ..B30.109
-        addl      $20, %esp                                     #5305.24
-        movl      %eax, -92(%ebp)                               #5305.24
-                                # LOE
-..B30.110:                      # Preds ..B30.129
-        movl      -92(%ebp), %eax                               #5305.24
-        movl      -4(%ebp), %ebx                                #5305.24
-..___tag_value_NucStrstrSearch.1242:                            #
-        leave                                                   #5305.24
-..___tag_value_NucStrstrSearch.1244:                            #
-        ret                                                     #5305.24
-..___tag_value_NucStrstrSearch.1245:                            #
-                                # LOE
-..B30.111:                      # Preds ..B30.101 ..B30.97 ..B30.4 ..B30.3 ..B30.2
-                                #       ..B30.1
-..LN5875:
-        xorl      %eax, %eax                                    #5311.12
-        movl      -4(%ebp), %ebx                                #5311.12
-..___tag_value_NucStrstrSearch.1247:                            #
-        leave                                                   #5311.12
-..___tag_value_NucStrstrSearch.1249:                            #
-        ret                                                     #5311.12
-        .align    2,0x90
-..___tag_value_NucStrstrSearch.1250:                            #
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-.LNNucStrstrSearch:
-	.section .data1, "wa"
-	.align 4
-..1..TPKT.30_0:
-	.long	..1.30_0.TAG.00
-	.long	..1.30_0.TAG.01
-	.long	..1.30_0.TAG.02
-	.long	..1.30_0.TAG.03
-	.long	..1.30_0.TAG.04
-	.long	..1.30_0.TAG.05
-	.long	..1.30_0.TAG.06
-	.long	..1.30_0.TAG.07
-	.long	..1.30_0.TAG.08
-	.long	..1.30_0.TAG.09
-	.long	..1.30_0.TAG.0a
-	.long	..1.30_0.TAG.0b
-	.long	..1.30_0.TAG.0c
-	.data
-# -- End  NucStrstrSearch
-	.data
-	.section .note.GNU-stack, ""
-// -- Begin DWARF2 SEGMENT .debug_info
-	.section .debug_info
-.debug_info_seg:
-	.align 1
-	.4byte 0x00002957
-	.2byte 0x0002
-	.4byte .debug_abbrev_seg
-	.byte 0x04
-.DWinfo0:
-//	DW_TAG_compile_unit:
-	.byte 0x01
-//	DW_AT_comp_dir:
-	.8byte 0x6f722f656d6f682f
-	.8byte 0x642f72656d726164
-	.8byte 0x746e692f6c657665
-	.8byte 0x73612f6c616e7265
-	.8byte 0x2f65636172742d6d
-	.8byte 0x726165732f617273
-	.2byte 0x6863
-	.byte 0x00
-//	DW_AT_language:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372747363756e
-	.4byte 0x00632e72
-//	DW_AT_producer:
-	.8byte 0x2952286c65746e49
-	.8byte 0x6d6f43202b2b4320
-	.8byte 0x6f662072656c6970
-	.8byte 0x63696c7070612072
-	.8byte 0x7220736e6f697461
-	.8byte 0x6f20676e696e6e75
-	.8byte 0x2c32332d4149206e
-	.8byte 0x6e6f697372655620
-	.8byte 0x202020312e303120
-	.8byte 0x3220646c69754220
-	.8byte 0x2034323031383030
-	.8byte 0x65786946200a7325
-	.8byte 0x7365676e61522073
-	.8byte 0x65766974616c6552
-	.2byte 0x000a
-//	DW_AT_stmt_list:
-	.4byte .debug_line_seg
-.DWinfo31:
-//	DW_TAG_enumeration_type:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_sibling:
-	.4byte 0x0000015b
-.DWinfo32:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x726570707553495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x0280
-.DWinfo33:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x7265776f6c53495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x0480
-.DWinfo34:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x6168706c6153495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x0880
-.DWinfo35:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x746967696453495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x1080
-.DWinfo36:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x696769647853495f
-	.2byte 0x0074
-//	DW_AT_const_value:
-	.2byte 0x2080
-.DWinfo37:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x656361707353495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0xc080
-	.byte 0x00
-.DWinfo38:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x746e69727053495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x8080
-	.byte 0x01
-.DWinfo39:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x687061726753495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.2byte 0x8080
-	.byte 0x02
-.DWinfo40:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x6b6e616c6253495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x01
-.DWinfo41:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x6c72746e6353495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x02
-.DWinfo42:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x74636e757053495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x04
-.DWinfo43:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x6d756e6c6153495f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x08
-	.byte 0x00
-.DWinfo44:
-//	DW_TAG_enumeration_type:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_sibling:
-	.4byte 0x00000245
-.DWinfo45:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.4byte 0x0034365f
-//	DW_AT_const_value:
-	.byte 0x00
-.DWinfo46:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e345f65707974
-	.4byte 0x0034365f
-//	DW_AT_const_value:
-	.byte 0x01
-.DWinfo47:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.2byte 0x385f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x02
-.DWinfo48:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.4byte 0x0036315f
-//	DW_AT_const_value:
-	.byte 0x03
-.DWinfo49:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.4byte 0x0032335f
-//	DW_AT_const_value:
-	.byte 0x04
-.DWinfo50:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x05
-.DWinfo51:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e345f65707974
-	.4byte 0x0036315f
-//	DW_AT_const_value:
-	.byte 0x06
-.DWinfo52:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e345f65707974
-	.4byte 0x0032335f
-//	DW_AT_const_value:
-	.byte 0x07
-.DWinfo53:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e345f65707974
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x08
-.DWinfo54:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e325f65707974
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x09
-.DWinfo55:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x616e345f65707974
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x0a
-.DWinfo56:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x00504f5f65707974
-//	DW_AT_const_value:
-	.byte 0x0b
-.DWinfo57:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x5058455f65707974
-	.2byte 0x0052
-//	DW_AT_const_value:
-	.byte 0x0c
-.DWinfo58:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.4byte 0x4e5f706f
-	.2byte 0x544f
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x0d
-.DWinfo59:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x00444145485f706f
-//	DW_AT_const_value:
-	.byte 0x0e
-.DWinfo60:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.8byte 0x004c4941545f706f
-//	DW_AT_const_value:
-	.byte 0x0f
-.DWinfo61:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.4byte 0x415f706f
-	.2byte 0x444e
-	.byte 0x00
-//	DW_AT_const_value:
-	.byte 0x10
-.DWinfo62:
-//	DW_TAG_enumerator:
-	.byte 0x03
-//	DW_AT_name:
-	.4byte 0x4f5f706f
-	.2byte 0x0052
-//	DW_AT_const_value:
-	.byte 0x11
-	.byte 0x00
-.DWinfo63:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x26
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f3631746e69
-//	DW_AT_type:
-	.4byte 0x00000256
-.DWinfo64:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x02
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x726f6873
-	.2byte 0x0074
-.DWinfo1:
-//	DW_TAG_subprogram:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000245
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6c5f3631746e6975
-	.4byte 0x74696273
-	.byte 0x00
-	.8byte 0x6c5f3631746e6975
-	.4byte 0x74696273
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte uint16_lsbit
-//	DW_AT_high_pc:
-	.4byte .LNuint16_lsbit
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000002b2
-.DWinfo65:
-//	DW_TAG_formal_parameter:
-	.byte 0x07
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002b2
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo66:
-//	DW_TAG_variable:
-	.byte 0x08
-//	DW_AT_decl_line:
-	.byte 0x27
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x006e7472
-//	DW_AT_type:
-	.4byte 0x00000245
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x7c
-	.byte 0x00
-.DWinfo67:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x32
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3631746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000002c4
-.DWinfo68:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x02
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x6f687320
-	.2byte 0x7472
-	.byte 0x00
-.DWinfo69:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x00
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x64696f76
-	.byte 0x00
-.DWinfo2:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0126
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002d6
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.4byte 0x00726873
-	.8byte 0x5f383231746e6975
-	.4byte 0x00726873
-//	DW_AT_low_pc:
-	.4byte uint128_shr
-//	DW_AT_high_pc:
-	.4byte .LNuint128_shr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x0000032f
-.DWinfo70:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0126
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000032f
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo71:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0126
-//	DW_AT_decl_column:
-	.byte 0x2e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000003a0
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-	.byte 0x00
-.DWinfo72:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00000334
-.DWinfo73:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x63
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x00000347
-.DWinfo74:
-//	DW_TAG_structure_type:
-	.byte 0x0c
-//	DW_AT_decl_line:
-	.byte 0x64
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.2byte 0x0074
-//	DW_AT_sibling:
-	.4byte 0x00000378
-.DWinfo75:
-//	DW_TAG_member:
-	.byte 0x0d
-//	DW_AT_decl_line:
-	.byte 0x66
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x6f6c
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000378
-.DWinfo76:
-//	DW_TAG_member:
-	.byte 0x0d
-//	DW_AT_decl_line:
-	.byte 0x67
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.2byte 0x6968
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000378
-	.byte 0x00
-.DWinfo77:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x3b
-//	DW_AT_decl_column:
-	.byte 0x20
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3436746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000038a
-.DWinfo78:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x08
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.8byte 0x6f6c20676e6f6c20
-	.2byte 0x676e
-	.byte 0x00
-.DWinfo79:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x34
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3233746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-.DWinfo80:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x746e6920
-	.byte 0x00
-.DWinfo3:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x014c
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002d6
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.4byte 0x61777362
-	.2byte 0x0070
-	.8byte 0x5f383231746e6975
-	.4byte 0x61777362
-	.2byte 0x0070
-//	DW_AT_low_pc:
-	.4byte uint128_bswap
-//	DW_AT_high_pc:
-	.4byte .LNuint128_bswap
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000409
-.DWinfo81:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x014c
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000032f
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-	.byte 0x00
-.DWinfo4:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0163
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002d6
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.8byte 0x6f635f7061777362
-	.2byte 0x7970
-	.byte 0x00
-	.8byte 0x5f383231746e6975
-	.8byte 0x6f635f7061777362
-	.2byte 0x7970
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte uint128_bswap_copy
-//	DW_AT_high_pc:
-	.4byte .LNuint128_bswap_copy
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000469
-.DWinfo82:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0163
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000032f
-//	DW_AT_name:
-	.2byte 0x6f74
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo83:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0163
-//	DW_AT_decl_column:
-	.byte 0x3b
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000469
-//	DW_AT_name:
-	.4byte 0x6d6f7266
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-	.byte 0x00
-.DWinfo84:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000046e
-.DWinfo85:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00000334
-.DWinfo86:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x2b
-//	DW_AT_decl_column:
-	.byte 0x36
-//	DW_AT_decl_file:
-	.byte 0x04
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_type:
-	.4byte 0x00000484
-.DWinfo87:
-//	DW_TAG_array_type:
-	.byte 0x0f
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_type:
-	.4byte 0x0000038a
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x000004a4
-.DWinfo88:
-//	DW_TAG_subrange_type:
-	.byte 0x10
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_upper_bound:
-	.byte 0x01
-//	DW_AT_lower_bound:
-	.byte 0x00
-	.byte 0x00
-.DWinfo5:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000473
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x75625f656d697270
-	.8byte 0x616e325f72656666
-	.byte 0x00
-	.8byte 0x75625f656d697270
-	.8byte 0x616e325f72656666
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte prime_buffer_2na
-//	DW_AT_high_pc:
-	.4byte .LNprime_buffer_2na
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000517
-.DWinfo89:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo90:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x3f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_name:
-	.4byte 0x6f6e6769
-	.2byte 0x6572
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo91:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0852
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000473
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-	.byte 0x00
-.DWinfo92:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000051c
-.DWinfo93:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00000521
-.DWinfo94:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x31
-//	DW_AT_decl_column:
-	.byte 0x18
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f38746e6975
-//	DW_AT_type:
-	.4byte 0x00000532
-.DWinfo95:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x01
-//	DW_AT_encoding:
-	.byte 0x08
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x61686320
-	.2byte 0x0072
-.DWinfo6:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000473
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x75625f656d697270
-	.8byte 0x616e345f72656666
-	.byte 0x00
-	.8byte 0x75625f656d697270
-	.8byte 0x616e345f72656666
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte prime_buffer_4na
-//	DW_AT_high_pc:
-	.4byte .LNprime_buffer_4na
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000005c7
-.DWinfo96:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo97:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x3f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_name:
-	.4byte 0x6f6e6769
-	.2byte 0x6572
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo98:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0f97
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00706d74
-//	DW_AT_type:
-	.4byte 0x000005c7
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo99:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0f98
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000473
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-	.byte 0x00
-.DWinfo100:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x48
-//	DW_AT_decl_column:
-	.byte 0x03
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f74617063756e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000005d9
-.DWinfo101:
-//	DW_TAG_union_type:
-	.byte 0x12
-//	DW_AT_decl_line:
-	.byte 0x42
-//	DW_AT_decl_column:
-	.byte 0x01
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x0000062a
-.DWinfo102:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.byte 0x43
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0062
-//	DW_AT_type:
-	.4byte 0x0000062a
-.DWinfo103:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.byte 0x44
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0077
-//	DW_AT_type:
-	.4byte 0x00000637
-.DWinfo104:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.byte 0x45
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x00000644
-.DWinfo105:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.byte 0x46
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x006c
-//	DW_AT_type:
-	.4byte 0x00000651
-.DWinfo106:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.byte 0x47
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0073
-//	DW_AT_type:
-	.4byte 0x00000334
-	.byte 0x00
-.DWinfo107:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00000521
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x00000637
-.DWinfo108:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x0f
-	.byte 0x00
-.DWinfo109:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000002b2
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x00000644
-.DWinfo110:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x07
-	.byte 0x00
-.DWinfo111:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000003a0
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x00000651
-.DWinfo112:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x03
-	.byte 0x00
-.DWinfo113:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00000378
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_sibling:
-	.4byte 0x0000065e
-.DWinfo114:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x01
-	.byte 0x00
-.DWinfo115:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000002d6
-.DWinfo7:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0315
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000065e
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4172707845617473
-	.4byte 0x636f6c6c
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4172707845617473
-	.4byte 0x636f6c6c
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte NucStrFastaExprAlloc
-//	DW_AT_high_pc:
-	.4byte .LNNucStrFastaExprAlloc
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000006e6
-.DWinfo116:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0315
-//	DW_AT_decl_column:
-	.byte 0x25
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000006e6
-//	DW_AT_name:
-	.2byte 0x7a73
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo117:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0317
-//	DW_AT_decl_column:
-	.byte 0x0b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6574756f
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x0000065e
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo118:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0319
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN121
-//	DW_AT_high_pc:
-	.4byte ..LN135
-.DWinfo119:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x031a
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000006f6
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-	.byte 0x00
-	.byte 0x00
-.DWinfo120:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x20
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x05
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.2byte 0x745f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-.DWinfo121:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000006fb
-.DWinfo122:
-//	DW_TAG_typedef:
-	.byte 0x17
-//	DW_AT_decl_line:
-	.2byte 0x02fa
-//	DW_AT_decl_column:
-	.byte 0x20
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x0072707845617473
-//	DW_AT_type:
-	.4byte 0x00000715
-.DWinfo123:
-//	DW_TAG_structure_type:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.2byte 0x02fb
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x90
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x0072707845617473
-//	DW_AT_sibling:
-	.4byte 0x00000773
-.DWinfo124:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x02fd
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-.DWinfo125:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x02fe
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003a0
-.DWinfo126:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x0307
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.2byte 0x0075
-//	DW_AT_type:
-	.4byte 0x0000078b
-.DWinfo127:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x030d
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x10
-//	DW_AT_name:
-	.4byte 0x72657571
-	.2byte 0x0079
-//	DW_AT_type:
-	.4byte 0x000007bd
-	.byte 0x00
-.DWinfo128:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x27
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f3233746e69
-//	DW_AT_type:
-	.4byte 0x00000784
-.DWinfo129:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x00746e69
-.DWinfo130:
-//	DW_TAG_union_type:
-	.byte 0x1a
-//	DW_AT_decl_line:
-	.2byte 0x0301
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x08
-//	DW_AT_sibling:
-	.4byte 0x000007bd
-.DWinfo131:
-//	DW_TAG_member:
-	.byte 0x1b
-//	DW_AT_decl_line:
-	.2byte 0x0305
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x6574756f
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x0000065e
-.DWinfo132:
-//	DW_TAG_member:
-	.byte 0x1b
-//	DW_AT_decl_line:
-	.2byte 0x0306
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x67696c61
-	.2byte 0x006e
-//	DW_AT_type:
-	.4byte 0x00000378
-	.byte 0x00
-.DWinfo133:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000007ca
-//	DW_AT_byte_size:
-	.byte 0x80
-//	DW_AT_sibling:
-	.4byte 0x000007ca
-.DWinfo134:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x03
-	.byte 0x00
-.DWinfo135:
-//	DW_TAG_structure_type:
-	.byte 0x1c
-//	DW_AT_decl_line:
-	.2byte 0x030a
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x20
-//	DW_AT_sibling:
-	.4byte 0x000007fb
-.DWinfo136:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x030b
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x000005c7
-.DWinfo137:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x030c
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x10
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000005c7
-	.byte 0x00
-.DWinfo8:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x32656b61
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x32656b61
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte NucStrFastaExprMake2
-//	DW_AT_high_pc:
-	.4byte .LNNucStrFastaExprMake2
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000008ef
-.DWinfo138:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo139:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo140:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0345
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo141:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0345
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000006e6
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo142:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0347
-//	DW_AT_decl_column:
-	.byte 0x0c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x000006e6
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo143:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0348
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000008f4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo144:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0349
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x000005c7
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x44
-.DWinfo145:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0349
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000005c7
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo146:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0359
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN191
-//	DW_AT_high_pc:
-	.4byte ..LN301
-.DWinfo147:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x035a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65736162
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000521
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x78
-	.byte 0x00
-	.byte 0x00
-.DWinfo148:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000008f4
-.DWinfo149:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000008f9
-.DWinfo150:
-//	DW_TAG_typedef:
-	.byte 0x17
-//	DW_AT_decl_line:
-	.2byte 0x02df
-//	DW_AT_decl_column:
-	.byte 0x13
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x784572745363754e
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000090e
-.DWinfo151:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x44
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x06
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x00000921
-.DWinfo152:
-//	DW_TAG_union_type:
-	.byte 0x1d
-//	DW_AT_decl_line:
-	.2byte 0x0339
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x90
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.2byte 0x0072
-//	DW_AT_sibling:
-	.4byte 0x00000970
-.DWinfo153:
-//	DW_TAG_member:
-	.byte 0x1b
-//	DW_AT_decl_line:
-	.2byte 0x033b
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_type:
-	.4byte 0x000006fb
-.DWinfo154:
-//	DW_TAG_member:
-	.byte 0x1b
-//	DW_AT_decl_line:
-	.2byte 0x033c
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.8byte 0x006e61656c6f6f62
-//	DW_AT_type:
-	.4byte 0x00000970
-.DWinfo155:
-//	DW_TAG_member:
-	.byte 0x1b
-//	DW_AT_decl_line:
-	.2byte 0x033d
-//	DW_AT_decl_column:
-	.byte 0x13
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x00627573
-//	DW_AT_type:
-	.4byte 0x000009e3
-	.byte 0x00
-.DWinfo156:
-//	DW_TAG_typedef:
-	.byte 0x17
-//	DW_AT_decl_line:
-	.2byte 0x0328
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x704f72745363754e
-	.4byte 0x72707845
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000987
-.DWinfo157:
-//	DW_TAG_structure_type:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.2byte 0x0329
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_name:
-	.8byte 0x704f72745363754e
-	.4byte 0x72707845
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000009e3
-.DWinfo158:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x032b
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-.DWinfo159:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x032c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-.DWinfo160:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x032d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.4byte 0x7466656c
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000008f4
-.DWinfo161:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x032e
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x0c
-//	DW_AT_name:
-	.4byte 0x68676972
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x000008f4
-	.byte 0x00
-.DWinfo162:
-//	DW_TAG_typedef:
-	.byte 0x17
-//	DW_AT_decl_line:
-	.2byte 0x0331
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x755372745363754e
-	.4byte 0x70784562
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x000009fb
-.DWinfo163:
-//	DW_TAG_structure_type:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.2byte 0x0332
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x0c
-//	DW_AT_name:
-	.8byte 0x755372745363754e
-	.4byte 0x70784562
-	.2byte 0x0072
-//	DW_AT_sibling:
-	.4byte 0x00000a46
-.DWinfo164:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x0334
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-.DWinfo165:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x0335
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-.DWinfo166:
-//	DW_TAG_member:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x0336
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000008f4
-	.byte 0x00
-.DWinfo167:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00000a4b
-.DWinfo168:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00000a50
-.DWinfo169:
-//	DW_TAG_base_type:
-	.byte 0x05
-//	DW_AT_byte_size:
-	.byte 0x01
-//	DW_AT_encoding:
-	.byte 0x06
-//	DW_AT_name:
-	.4byte 0x72616863
-	.byte 0x00
-.DWinfo9:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x34656b61
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x34656b61
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte NucStrFastaExprMake4
-//	DW_AT_high_pc:
-	.4byte .LNNucStrFastaExprMake4
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000b4c
-.DWinfo170:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo171:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo172:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x03f8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo173:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x03f8
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000006e6
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo174:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x03fa
-//	DW_AT_decl_column:
-	.byte 0x0c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x000006e6
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo175:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x03fb
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000008f4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo176:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x03fc
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x000005c7
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x44
-.DWinfo177:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x03fc
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000005c7
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo178:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x040c
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN621
-//	DW_AT_high_pc:
-	.4byte ..LN731
-.DWinfo179:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x040d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65736162
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000002b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-	.byte 0x00
-	.byte 0x00
-.DWinfo10:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00626f735f73736e
-	.8byte 0x00626f735f73736e
-//	DW_AT_low_pc:
-	.4byte nss_sob
-//	DW_AT_high_pc:
-	.4byte .LNnss_sob
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000b94
-.DWinfo180:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x23
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo181:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x32
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-	.byte 0x00
-.DWinfo11:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x545341465f73736e
-	.4byte 0x78655f41
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x545341465f73736e
-	.4byte 0x78655f41
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte nss_FASTA_expr
-//	DW_AT_high_pc:
-	.4byte .LNnss_FASTA_expr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000c69
-.DWinfo182:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo183:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo184:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo185:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000c69
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo186:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-.DWinfo187:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x04ac
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN985
-//	DW_AT_high_pc:
-	.4byte ..LN1061
-.DWinfo188:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x04ad
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo189:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x04af
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo190:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x04b0
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x0070616d
-//	DW_AT_type:
-	.4byte 0x00000c6e
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x78
-	.byte 0x00
-	.byte 0x00
-.DWinfo191:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00000784
-.DWinfo192:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00000c73
-.DWinfo193:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00000c78
-.DWinfo194:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x38746e69
-	.2byte 0x745f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000a50
-.DWinfo12:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747361665f73736e
-	.4byte 0x78655f61
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x747361665f73736e
-	.4byte 0x78655f61
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte nss_fasta_expr
-//	DW_AT_high_pc:
-	.4byte .LNnss_fasta_expr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000d19
-.DWinfo195:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo196:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo197:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo198:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000c69
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo199:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-	.byte 0x00
-.DWinfo13:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6d6972705f73736e
-	.8byte 0x727078655f797261
-	.byte 0x00
-	.8byte 0x6d6972705f73736e
-	.8byte 0x727078655f797261
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte nss_primary_expr
-//	DW_AT_high_pc:
-	.4byte .LNnss_primary_expr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000dbd
-.DWinfo200:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x2c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo201:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x3b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo202:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo203:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000c69
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo204:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-.DWinfo205:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x050c
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000008f4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-	.byte 0x00
-.DWinfo14:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x72616e755f73736e
-	.4byte 0x78655f79
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x72616e755f73736e
-	.4byte 0x78655f79
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte nss_unary_expr
-//	DW_AT_high_pc:
-	.4byte .LNnss_unary_expr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000e6b
-.DWinfo206:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo207:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo208:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo209:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000c69
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo210:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-.DWinfo211:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0562
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN1393
-//	DW_AT_high_pc:
-	.4byte ..LN1437
-.DWinfo212:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0563
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000008f4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-	.byte 0x00
-	.byte 0x00
-.DWinfo15:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x727078655f73736e
-	.byte 0x00
-	.8byte 0x727078655f73736e
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte nss_expr
-//	DW_AT_high_pc:
-	.4byte .LNnss_expr
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000f1d
-.DWinfo213:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x24
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo214:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo215:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000008ef
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo216:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000c69
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo217:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-.DWinfo218:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0589
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN1491
-//	DW_AT_high_pc:
-	.4byte ..LN1591
-.DWinfo219:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x058a
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000773
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo220:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x058b
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x000008f4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-	.byte 0x00
-	.byte 0x00
-.DWinfo16:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x05cb
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002d6
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x696e4972
-	.2byte 0x0074
-	.8byte 0x747372745363754e
-	.4byte 0x696e4972
-	.2byte 0x0074
-//	DW_AT_low_pc:
-	.4byte NucStrstrInit
-//	DW_AT_high_pc:
-	.4byte .LNNucStrstrInit
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00000fdb
-.DWinfo221:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05cd
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6863
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo222:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05ce
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo223:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05cf
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo224:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05cf
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo225:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05d0
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00616e346962636e
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo226:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN1699
-//	DW_AT_high_pc:
-	.4byte ..LN1715
-.DWinfo227:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00765f5f
-//	DW_AT_type:
-	.4byte 0x000002c4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x7c
-.DWinfo228:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00785f5f
-//	DW_AT_type:
-	.4byte 0x000002c4
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x78
-	.byte 0x00
-	.byte 0x00
-.DWinfo17:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x6b614d72
-	.2byte 0x0065
-	.8byte 0x747372745363754e
-	.4byte 0x6b614d72
-	.2byte 0x0065
-//	DW_AT_low_pc:
-	.4byte NucStrstrMake
-//	DW_AT_high_pc:
-	.4byte .LNNucStrstrMake
-//	DW_AT_external:
-	.byte 0x01
-//	DW_AT_sibling:
-	.4byte 0x0000108d
-.DWinfo229:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000108d
-//	DW_AT_name:
-	.4byte 0x0073736e
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo230:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo231:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0602
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_name:
-	.4byte 0x72657571
-	.2byte 0x0079
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo232:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0602
-//	DW_AT_decl_column:
-	.byte 0x25
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo233:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0607
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN1731
-//	DW_AT_high_pc:
-	.4byte ..LN1783
-.DWinfo234:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0608
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo235:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0609
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000a46
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-	.byte 0x00
-	.byte 0x00
-.DWinfo236:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00001092
-.DWinfo237:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000090e
-.DWinfo18:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0625
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000002d6
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x61685772
-	.2byte 0x6b63
-	.byte 0x00
-	.8byte 0x747372745363754e
-	.4byte 0x61685772
-	.2byte 0x6b63
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte NucStrstrWhack
-//	DW_AT_high_pc:
-	.4byte .LNNucStrstrWhack
-//	DW_AT_external:
-	.byte 0x01
-//	DW_AT_sibling:
-	.4byte 0x000010e0
-.DWinfo238:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0625
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00001092
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-	.byte 0x00
-.DWinfo19:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0892
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.2byte 0x385f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.2byte 0x385f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte eval_2na_8
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_8
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000012f1
-.DWinfo239:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0892
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo240:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo241:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo242:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo243:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a1
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo244:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a1
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo245:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo246:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo247:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo248:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo249:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo250:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo251:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo252:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo253:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo254:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo255:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo256:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo257:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a8
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo258:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08a8
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo259:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08b1
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo260:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08b1
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo261:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x08b2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x7c
-.DWinfo262:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x090a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN1981
-//	DW_AT_high_pc:
-	.4byte ..LN2067
-.DWinfo263:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x091b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb87503
-.DWinfo264:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x091c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fbc7503
-.DWinfo265:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x091d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x40
-.DWinfo266:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x091e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x44
-	.byte 0x00
-	.byte 0x00
-.DWinfo267:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000012f6
-.DWinfo268:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x000006fb
-.DWinfo269:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00001300
-.DWinfo270:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x000002d6
-.DWinfo271:
-//	DW_TAG_typedef:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.byte 0x40
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f67657263756e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000473
-.DWinfo20:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x09b7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0036315f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0036315f
-//	DW_AT_low_pc:
-	.4byte eval_2na_16
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_16
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x0000154d
-.DWinfo272:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x09b7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo273:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo274:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo275:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo276:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c6
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo277:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c6
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo278:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo279:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo280:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo281:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo282:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo283:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo284:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo285:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo286:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo287:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo288:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo289:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo290:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09cd
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo291:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09cd
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo292:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09d2
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x48
-.DWinfo293:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09d3
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo294:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09d6
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo295:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09d6
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo296:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x09d7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo297:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0a2f
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN2271
-//	DW_AT_high_pc:
-	.4byte ..LN2357
-.DWinfo298:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0a40
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo299:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0a41
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fac7503
-.DWinfo300:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0a42
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb07503
-.DWinfo301:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0a43
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb47503
-	.byte 0x00
-	.byte 0x00
-.DWinfo21:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0adc
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0032335f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0032335f
-//	DW_AT_low_pc:
-	.4byte eval_2na_32
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_32
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00001783
-.DWinfo302:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0adc
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo303:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo304:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo305:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo306:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aeb
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo307:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aeb
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo308:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo309:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo310:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo311:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo312:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo313:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo314:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo315:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo316:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo317:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo318:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo319:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo320:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0af2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo321:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0af2
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo322:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0af7
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x48
-.DWinfo323:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0af8
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo324:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0afb
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo325:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0afb
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo326:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0afc
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo327:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0b54
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN2603
-//	DW_AT_high_pc:
-	.4byte ..LN2689
-.DWinfo328:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0b65
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo329:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0b66
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fac7503
-.DWinfo330:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0b67
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb07503
-.DWinfo331:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0b68
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb47503
-	.byte 0x00
-	.byte 0x00
-.DWinfo22:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0c01
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0034365f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0034365f
-//	DW_AT_low_pc:
-	.4byte eval_2na_64
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_64
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000019b9
-.DWinfo332:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0c01
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo333:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo334:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo335:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo336:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c11
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo337:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c11
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo338:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo339:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo340:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo341:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo342:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo343:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo344:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo345:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo346:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo347:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo348:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo349:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo350:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c18
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo351:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c18
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo352:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c1d
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x48
-.DWinfo353:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c1e
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo354:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c21
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo355:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c21
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo356:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c22
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo357:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x0c7a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN2943
-//	DW_AT_high_pc:
-	.4byte ..LN3029
-.DWinfo358:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c8b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo359:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c8c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fac7503
-.DWinfo360:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c8d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb07503
-.DWinfo361:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0c8e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb47503
-	.byte 0x00
-	.byte 0x00
-.DWinfo23:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0d27
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte eval_2na_128
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_128
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00001b9f
-.DWinfo362:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0d27
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo363:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo364:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo365:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo366:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d36
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo367:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d36
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo368:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo369:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo370:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo371:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo372:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo373:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo374:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo375:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo376:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo377:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo378:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo379:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo380:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo381:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d3d
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo382:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d42
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo383:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d43
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo384:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d46
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo385:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d46
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo386:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0d47
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x78
-	.byte 0x00
-.DWinfo24:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0e4c
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte eval_2na_pos
-//	DW_AT_high_pc:
-	.4byte .LNeval_2na_pos
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00001d98
-.DWinfo387:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0e4c
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo388:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo389:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo390:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo391:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5c
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo392:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5c
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo393:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo394:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo395:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo396:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo397:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo398:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo399:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo400:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo401:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo402:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo403:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo404:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo405:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e63
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo406:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e63
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo407:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e67
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo408:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e6d
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo409:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e6e
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo410:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e71
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo411:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e71
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo412:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0e72
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x7c
-	.byte 0x00
-.DWinfo25:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x0fd7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0036315f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0036315f
-//	DW_AT_low_pc:
-	.4byte eval_4na_16
-//	DW_AT_high_pc:
-	.4byte .LNeval_4na_16
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00001fbc
-.DWinfo413:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0fd7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo414:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo415:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo416:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo417:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo418:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo419:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo420:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo421:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo422:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo423:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo424:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo425:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo426:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo427:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo428:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo429:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo430:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo431:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo432:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fed
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-.DWinfo433:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0fed
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo434:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0ff2
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo435:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0ff2
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo436:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0ff3
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x7c
-.DWinfo437:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x104d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN3933
-//	DW_AT_high_pc:
-	.4byte ..LN4023
-.DWinfo438:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x105e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb87503
-.DWinfo439:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x105f
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fbc7503
-.DWinfo440:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1060
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x40
-.DWinfo441:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1061
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x44
-	.byte 0x00
-	.byte 0x00
-.DWinfo26:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x10b5
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0032335f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0032335f
-//	DW_AT_low_pc:
-	.4byte eval_4na_32
-//	DW_AT_high_pc:
-	.4byte .LNeval_4na_32
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x000021f1
-.DWinfo442:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x10b5
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo443:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo444:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo445:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo446:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo447:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7de87503
-.DWinfo448:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo449:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo450:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo451:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo452:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo453:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo454:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo455:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo456:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo457:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo458:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo459:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo460:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x48
-.DWinfo461:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10cb
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo462:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10cb
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo463:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10ce
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo464:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10d0
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo465:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10d0
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo466:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x10d1
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo467:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x112b
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN4249
-//	DW_AT_high_pc:
-	.4byte ..LN4339
-.DWinfo468:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x113c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo469:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x113d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fac7503
-.DWinfo470:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x113e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb07503
-.DWinfo471:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x113f
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb47503
-	.byte 0x00
-	.byte 0x00
-.DWinfo27:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x1193
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0034365f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0034365f
-//	DW_AT_low_pc:
-	.4byte eval_4na_64
-//	DW_AT_high_pc:
-	.4byte .LNeval_4na_64
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00002426
-.DWinfo472:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1193
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo473:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo474:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo475:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo476:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo477:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7de87503
-.DWinfo478:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7df87503
-.DWinfo479:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo480:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo481:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo482:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo483:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo484:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo485:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo486:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo487:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo488:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo489:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo490:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x48
-.DWinfo491:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11aa
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo492:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11aa
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo493:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11ad
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo494:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11af
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo495:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11af
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo496:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x11b0
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo497:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x120a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN4599
-//	DW_AT_high_pc:
-	.4byte ..LN4689
-.DWinfo498:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x121b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo499:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x121c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fac7503
-.DWinfo500:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x121d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb07503
-.DWinfo501:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x121e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.4byte 0x7fb47503
-	.byte 0x00
-	.byte 0x00
-.DWinfo28:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x1272
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-	.8byte 0x616e345f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte eval_4na_128
-//	DW_AT_high_pc:
-	.4byte .LNeval_4na_128
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x0000260b
-.DWinfo502:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1272
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo503:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo504:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo505:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo506:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo507:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo508:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo509:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo510:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo511:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo512:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo513:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo514:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo515:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo516:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo517:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo518:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo519:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo520:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo521:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1288
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo522:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1288
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo523:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x128b
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo524:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x128d
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo525:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x128d
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo526:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x128e
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x74
-	.byte 0x00
-.DWinfo29:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x1350
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-	.8byte 0x616e345f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.4byte eval_4na_pos
-//	DW_AT_high_pc:
-	.4byte .LNeval_4na_pos
-//	DW_AT_external:
-	.byte 0x00
-//	DW_AT_sibling:
-	.4byte 0x00002803
-.DWinfo527:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1350
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012f1
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x08
-.DWinfo528:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x0c
-.DWinfo529:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x10
-.DWinfo530:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7302
-	.byte 0x14
-.DWinfo531:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ea87503
-.DWinfo532:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e887503
-.DWinfo533:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7e987503
-.DWinfo534:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7eb87503
-.DWinfo535:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ed87503
-.DWinfo536:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ef87503
-.DWinfo537:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f987503
-.DWinfo538:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ec87503
-.DWinfo539:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7ee87503
-.DWinfo540:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7f887503
-.DWinfo541:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00001305
-//	DW_AT_location:
-	.4byte 0x7fa87503
-.DWinfo542:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x6c
-.DWinfo543:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x68
-.DWinfo544:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo545:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x4c
-.DWinfo546:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1367
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x70
-.DWinfo547:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1367
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x58
-.DWinfo548:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x136b
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x50
-.DWinfo549:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x136f
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x60
-.DWinfo550:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1371
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x5c
-.DWinfo551:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1371
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00000517
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x54
-.DWinfo552:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1372
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x78
-	.byte 0x00
-.DWinfo30:
-//	DW_TAG_subprogram:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.2byte 0x145f
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.8byte 0x0068637261655372
-	.8byte 0x747372745363754e
-	.8byte 0x0068637261655372
-//	DW_AT_low_pc:
-	.4byte NucStrstrSearch
-//	DW_AT_high_pc:
-	.4byte .LNNucStrstrSearch
-//	DW_AT_external:
-	.byte 0x01
-//	DW_AT_sibling:
-	.4byte 0x000028cf
-.DWinfo553:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x145f
-//	DW_AT_decl_column:
-	.byte 0x28
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000028cf
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x08
-.DWinfo554:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000012fb
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x0c
-.DWinfo555:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x10
-.DWinfo556:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x14
-.DWinfo557:
-//	DW_TAG_formal_parameter:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x4e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000028d9
-//	DW_AT_name:
-	.8byte 0x006e656c666c6573
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x18
-.DWinfo558:
-//	DW_TAG_lexical_block:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x1463
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.4byte ..LN5427
-//	DW_AT_high_pc:
-	.4byte ..LN5875
-.DWinfo559:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1464
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e756f66
-	.2byte 0x0064
-//	DW_AT_type:
-	.4byte 0x00000784
-//	DW_AT_location:
-	.2byte 0x7502
-	.byte 0x64
-.DWinfo560:
-//	DW_TAG_variable:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x1465
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x656c5f6174736166
-	.2byte 0x006e
-//	DW_AT_type:
-	.4byte 0x000003b2
-//	DW_AT_location:
-	.4byte 0x7fac7503
-	.byte 0x00
-	.byte 0x00
-.DWinfo561:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000028d4
-.DWinfo562:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x0000090e
-.DWinfo563:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000003b2
-.DWinfo564:
-//	DW_TAG_variable:
-	.byte 0x08
-//	DW_AT_decl_line:
-	.byte 0x5a
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6e325f6174736166
-	.4byte 0x616d5f61
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x000028fb
-//	DW_AT_location:
-	.2byte 0x0305
-	.4byte fasta_2na_map
-.DWinfo565:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00000c78
-//	DW_AT_byte_size:
-	.byte 0x80
-//	DW_AT_sibling:
-	.4byte 0x00002908
-.DWinfo566:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x7f
-	.byte 0x00
-.DWinfo567:
-//	DW_TAG_variable:
-	.byte 0x08
-//	DW_AT_decl_line:
-	.byte 0x5b
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6e345f6174736166
-	.4byte 0x616d5f61
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002925
-//	DW_AT_location:
-	.2byte 0x0305
-	.4byte fasta_4na_map
-.DWinfo568:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00000c78
-//	DW_AT_byte_size:
-	.byte 0x80
-//	DW_AT_sibling:
-	.4byte 0x00002932
-.DWinfo569:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x7f
-	.byte 0x00
-.DWinfo570:
-//	DW_TAG_variable:
-	.byte 0x08
-//	DW_AT_decl_line:
-	.byte 0x5c
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x325f646e61707865
-	.2byte 0x616e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000294c
-//	DW_AT_location:
-	.2byte 0x0305
-	.4byte expand_2na
-.DWinfo571:
-//	DW_TAG_array_type:
-	.byte 0x1e
-//	DW_AT_type:
-	.4byte 0x000002b2
-//	DW_AT_byte_size:
-	.2byte 0x0200
-.DWinfo572:
-//	DW_TAG_subrange_type:
-	.byte 0x1f
-//	DW_AT_upper_bound:
-	.2byte 0x00ff
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-// -- Begin DWARF2 SEGMENT .debug_line
-	.section .debug_line
-.debug_line_seg:
-	.align 1
-	.4byte 0x000026aa
-	.2byte 0x0002
-	.4byte 0x00000114
-	.byte 0x01
-	.byte 0x01
-	.byte 0xff
-	.byte 0x04
-	.byte 0x0a
-	.8byte 0x0000000101010100
-	.byte 0x01
-	.8byte 0x6f722f656d6f682f
-	.8byte 0x642f72656d726164
-	.8byte 0x746e692f6c657665
-	.8byte 0x73612f6c616e7265
-	.8byte 0x2f65636172742d6d
-	.8byte 0x2f6363672f636e69
-	.4byte 0x36383369
-	.byte 0x00
-	.8byte 0x636e692f7273752f
-	.4byte 0x6564756c
-	.byte 0x00
-	.8byte 0x746e692f74706f2f
-	.8byte 0x30312f63632f6c65
-	.8byte 0x692f3132302e312e
-	.4byte 0x756c636e
-	.2byte 0x6564
-	.byte 0x00
-	.8byte 0x6f722f656d6f682f
-	.8byte 0x642f72656d726164
-	.8byte 0x746e692f6c657665
-	.8byte 0x73612f6c616e7265
-	.8byte 0x2f65636172742d6d
-	.8byte 0x006172732f667469
-	.byte 0x00
-	.8byte 0x706d692d68637261
-	.4byte 0x00682e6c
-	.8byte 0x41e904d1e4efaf01
-	.8byte 0x682e746e69647473
-	.byte 0x00
-	.8byte 0x42e104bffdfc8e02
-	.8byte 0x747372747363756e
-	.4byte 0x00632e72
-	.8byte 0x8eec04d283e7bd00
-	.byte 0x0a
-	.8byte 0x6972746e696d6d65
-	.4byte 0x00682e6e
-	.8byte 0x7bca04c1ab8cdd03
-	.8byte 0x682e666564647473
-	.byte 0x00
-	.8byte 0x07c404c1ab8cdd03
-	.8byte 0x747372747363756e
-	.4byte 0x00682e72
-	.8byte 0x27d104cb94abbd04
-	.byte 0x00
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1
-	.2byte 0x2503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN7
-	.2byte 0xf603
-	.byte 0x01
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN9
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN11
-	.2byte 0x0e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN13
-	.2byte 0x1703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN15
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN17
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN19
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN21
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN23
-	.2byte 0x1403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN25
-	.byte 0x04
-	.byte 0x03
-	.2byte 0xd803
-	.byte 0x0d
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN27
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN33
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN37
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN41
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN43
-	.2byte 0xbe03
-	.byte 0x0e
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN45
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN51
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN57
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN63
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN69
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN75
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN81
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN87
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN93
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN97
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN99
-	.2byte 0xf003
-	.byte 0x66
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN101
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN111
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN115
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN121
-	.byte 0x0a
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN123
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN129
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN131
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN133
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN135
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN137
-	.2byte 0x2503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN139
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN143
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN145
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN153
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN157
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN159
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN165
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN171
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN183
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN193
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN197
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN207
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN213
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN231
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN243
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN261
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN273
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN289
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN301
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN313
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN317
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN321
-	.2byte 0x7d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN327
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN329
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN331
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN335
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN339
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN343
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN347
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN351
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN355
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN359
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN363
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN367
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN369
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN373
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN377
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN381
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN385
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN389
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN393
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN397
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN399
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN403
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN407
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN411
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN415
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN419
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN421
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN425
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN429
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN433
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN435
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN437
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN441
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN445
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN451
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN457
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN465
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN473
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN483
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN493
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN501
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN509
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN519
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN529
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN537
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN545
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN555
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN565
-	.2byte 0x2a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN567
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN569
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN573
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN575
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN583
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN587
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN589
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN595
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN601
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN613
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN623
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN627
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN637
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN643
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN659
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN671
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN689
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN701
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN719
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN731
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN743
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN747
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN751
-	.2byte 0x7d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN757
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN759
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN761
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN765
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN769
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN773
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN777
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN781
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN785
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN789
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN791
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN795
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN799
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN803
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN807
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN811
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN813
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN817
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN821
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN825
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN827
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN829
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN833
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN837
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN843
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN849
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN857
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN865
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN875
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN885
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN893
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN901
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN911
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN921
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN929
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN937
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN947
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN957
-	.2byte 0x2a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN959
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN961
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN967
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN969
-	.byte 0x0a
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN973
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN975
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN977
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN981
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN983
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN987
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN989
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN991
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN995
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1001
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1007
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1013
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1015
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1019
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1023
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1027
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1029
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1033
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1047
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1061
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1063
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1065
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1067
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1069
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1085
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1101
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1103
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1119
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1135
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1137
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1151
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1153
-	.2byte 0x2703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1155
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1157
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1159
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1167
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1171
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1179
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1181
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1183
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1185
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1191
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1201
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1205
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1207
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1215
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1219
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1227
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1229
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1231
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1237
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1253
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1257
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1273
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1275
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1277
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1281
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1289
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1299
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1307
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1309
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1317
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1321
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1329
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1331
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1333
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1341
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1347
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1349
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1351
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1353
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1357
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1371
-	.2byte 0x0a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1381
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1385
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1387
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1395
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1399
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1407
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1409
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1411
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1413
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1419
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1435
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1437
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1439
-	.2byte 0x0d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1441
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1443
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1453
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1457
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1473
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1477
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1487
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1491
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1493
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1495
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1499
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1507
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1509
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1511
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1519
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1521
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1523
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1525
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1529
-	.2byte 0x0c03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1537
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1541
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1549
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1551
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1553
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1559
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1567
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1573
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1589
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1591
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1593
-	.2byte 0x0e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1595
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1597
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1599
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1609
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1619
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1629
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1633
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1647
-	.2byte 0x7d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1655
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1665
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1669
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1683
-	.2byte 0x7d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1691
-	.2byte 0x0803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1697
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1709
-	.byte 0x0a
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1715
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1717
-	.2byte 0x1a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1719
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1723
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1731
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1733
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1737
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1739
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1745
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1761
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1765
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1769
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1771
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1773
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1779
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1781
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1783
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1785
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1787
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1789
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1793
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1797
-	.2byte 0x1003
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1801
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1807
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1813
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1819
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1825
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1827
-	.2byte 0xce03
-	.byte 0x04
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1829
-	.2byte 0x1e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1833
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1835
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1839
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1847
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1851
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1861
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1871
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1873
-	.2byte 0x0a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1875
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1881
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1883
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1887
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1889
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1891
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1893
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1901
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1905
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1911
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1919
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1923
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1929
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1937
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1941
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1947
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1955
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1959
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1965
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1967
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1975
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1983
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1991
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN1999
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2007
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2009
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2015
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2021
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2027
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2037
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2047
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2057
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2067
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2069
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2073
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2075
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2079
-	.2byte 0x1503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2083
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2085
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2089
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2099
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2101
-	.2byte 0x0d03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2103
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2105
-	.2byte 0x1e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2109
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2111
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2115
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2123
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2127
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2137
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2147
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2149
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2153
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2157
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2163
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2165
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2171
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2173
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2177
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2179
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2181
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2183
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2191
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2195
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2201
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2209
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2213
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2219
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2227
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2231
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2237
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2245
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2249
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2255
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2257
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2265
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2273
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2281
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2289
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2297
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2299
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2305
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2311
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2317
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2327
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2337
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2347
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2357
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2359
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2363
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2365
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2369
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2375
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2379
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2381
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2387
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2395
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2397
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2401
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2403
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2407
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2417
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2419
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2423
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2427
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2433
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2435
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2437
-	.2byte 0x1e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2441
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2443
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2447
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2455
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2459
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2469
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2479
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2481
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2485
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2489
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2495
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2497
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2503
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2505
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2509
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2511
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2513
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2515
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2523
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2527
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2533
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2541
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2545
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2551
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2559
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2563
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2569
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2577
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2581
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2587
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2589
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2597
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2605
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2613
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2621
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2629
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2631
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2637
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2643
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2649
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2659
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2669
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2679
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2689
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2691
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2695
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2697
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2701
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2707
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2711
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2713
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2719
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2727
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2729
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2733
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2735
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2739
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2749
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2751
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2755
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2759
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2765
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2767
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2769
-	.2byte 0x1f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2773
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2775
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2779
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2787
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2791
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2801
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2811
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2813
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2817
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2821
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2827
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2829
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2835
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2837
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2841
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2843
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2845
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2847
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2855
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2859
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2865
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2867
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2875
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2879
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2885
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2887
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2895
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2899
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2905
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2907
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2915
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2919
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2925
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2927
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2929
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2937
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2945
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2953
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2961
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2969
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2971
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2977
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2983
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2989
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN2999
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3009
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3019
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3029
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3031
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3035
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3037
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3041
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3047
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3051
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3053
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3059
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3067
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3069
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3073
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3075
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3079
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3089
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3091
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3095
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3099
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3105
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3107
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3109
-	.2byte 0x1e03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3113
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3115
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3119
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3127
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3131
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3141
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3151
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3153
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3157
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3161
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3167
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3169
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3175
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3185
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3189
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3191
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3193
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3195
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3203
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3207
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3213
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3215
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3223
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3227
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3233
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3235
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3243
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3247
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3253
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3255
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3263
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3267
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3273
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3275
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3277
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3285
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3287
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3289
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3295
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3301
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3307
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3309
-	.2byte 0x1b03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3311
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3315
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3317
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3321
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3327
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3331
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3333
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3339
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3347
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3349
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3353
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3357
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3367
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3369
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3373
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3377
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3383
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3385
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3387
-	.2byte 0x2403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3391
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3393
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3397
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3401
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3409
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3413
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3423
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3433
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3435
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3439
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3443
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3449
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3451
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3457
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3467
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3471
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3473
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3475
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3477
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3485
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3489
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3495
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3497
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3505
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3509
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3515
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3517
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3525
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3529
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3535
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3537
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3545
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3549
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3555
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3557
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3559
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3567
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3569
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3579
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3589
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3599
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3609
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3619
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3629
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3639
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3649
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3659
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3669
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3671
-	.2byte 0x2803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3673
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3677
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3679
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3683
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3689
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3693
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3695
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3701
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3709
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3711
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3715
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3719
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3729
-	.2byte 0xce03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3731
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3735
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3739
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3745
-	.2byte 0x0a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3747
-	.2byte 0xca03
-	.byte 0x00
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3749
-	.2byte 0x1a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3753
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3755
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3759
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3767
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3771
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3781
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3791
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3793
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3795
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3801
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3803
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3807
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3809
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3811
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3813
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3821
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3829
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3833
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3839
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3847
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3855
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3859
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3865
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3873
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3881
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3885
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3891
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3899
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3907
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3911
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3917
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3919
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3927
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3935
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3943
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3951
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3959
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3965
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3971
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3977
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3983
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN3993
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4003
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4013
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4023
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4025
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4029
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4031
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4035
-	.2byte 0x1103
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4039
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4041
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4045
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4055
-	.2byte 0x0f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4057
-	.2byte 0x0b03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4059
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4061
-	.2byte 0x1a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4065
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4067
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4071
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4079
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4083
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4093
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4103
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4105
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4109
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4111
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4117
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4119
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4123
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4125
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4127
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4129
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4137
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4145
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4149
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4155
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4163
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4171
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4175
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4181
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4189
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4197
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4201
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4207
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4215
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4223
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4227
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4233
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4235
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4243
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4251
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4259
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4267
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4275
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4281
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4287
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4293
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4299
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4309
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4319
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4329
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4339
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4341
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4345
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4347
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4351
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4357
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4361
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4371
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4373
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4377
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4379
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4383
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4393
-	.2byte 0x0f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4395
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4399
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4401
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4403
-	.2byte 0x1b03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4407
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4409
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4413
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4421
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4425
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4435
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4445
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4447
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4451
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4453
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4459
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4461
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4465
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4467
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4469
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4471
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4479
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4487
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4491
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4497
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4499
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4507
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4515
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4519
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4525
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4527
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4535
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4543
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4547
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4553
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4555
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4563
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4571
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4575
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4581
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4583
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4585
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4593
-	.2byte 0x1203
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4601
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4609
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4617
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4625
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4631
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4637
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4643
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4649
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4659
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4669
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4679
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4689
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4691
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4695
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4697
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4701
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4707
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4711
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4721
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4723
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4727
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4729
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4733
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4743
-	.2byte 0x0f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4745
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4749
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4751
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4753
-	.2byte 0x1a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4757
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4759
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4763
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4771
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4775
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4785
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4795
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4797
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4801
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4803
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4809
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4819
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4823
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4825
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4827
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4829
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4837
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4845
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4849
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4855
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4857
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4865
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4873
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4877
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4883
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4885
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4893
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4901
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4905
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4911
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4913
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4921
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4929
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4933
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4939
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4941
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4943
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4951
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4953
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4955
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4961
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4967
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4973
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4975
-	.2byte 0x1b03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4977
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4981
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4983
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4987
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4993
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN4997
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5007
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5009
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5013
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5017
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5027
-	.2byte 0x0f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5029
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5033
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5035
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5037
-	.2byte 0x2003
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5041
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5043
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5047
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5051
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5059
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5063
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5073
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5083
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5085
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5089
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5091
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5097
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5107
-	.2byte 0x0903
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5111
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5113
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5115
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5117
-	.2byte 0x0703
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5125
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5133
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5137
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5143
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5145
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5153
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5161
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5165
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5171
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5173
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5181
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5189
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5193
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5199
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5201
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5209
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5217
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5221
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5227
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5229
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5231
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5239
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5241
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5251
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5261
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5271
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5281
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5291
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5301
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5311
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5321
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5331
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5341
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5343
-	.2byte 0x2803
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5345
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5349
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5351
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5355
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5361
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5365
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5375
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5377
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5381
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5385
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5395
-	.2byte 0x0f03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5397
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5401
-	.2byte 0x0a03
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5403
-	.2byte 0x1503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5405
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5417
-	.2byte 0x0503
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5421
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5429
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5439
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5451
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5459
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5469
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5481
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5489
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5499
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5511
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5519
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5529
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5541
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5549
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5559
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5571
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5579
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5589
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5601
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5609
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5619
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5631
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5639
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5649
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5661
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5669
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5679
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5691
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5699
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5709
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5721
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5729
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5739
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5751
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5767
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5769
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5773
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5775
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5779
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5781
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5795
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5797
-	.2byte 0x0403
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5813
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5817
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5819
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5823
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5825
-	.2byte 0x0303
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5829
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5833
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5835
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5849
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5853
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5857
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5859
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5865
-	.byte 0x0c
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5873
-	.byte 0x0a
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte ..LN5875
-	.2byte 0x0603
-	.byte 0x01
-	.byte 0x00
-	.byte 0x05
-	.byte 0x02
-	.4byte .LNNucStrstrSearch
-	.byte 0x00
-	.byte 0x01
-	.byte 0x01
-// -- Begin DWARF2 SEGMENT .debug_abbrev
-	.section .debug_abbrev
-.debug_abbrev_seg:
-	.align 1
-	.byte 0x01
-	.byte 0x11
-	.byte 0x01
-	.byte 0x1b
-	.byte 0x08
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x25
-	.byte 0x08
-	.byte 0x10
-	.byte 0x06
-	.2byte 0x0000
-	.byte 0x02
-	.byte 0x04
-	.byte 0x01
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x3e
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x03
-	.byte 0x28
-	.byte 0x00
-	.byte 0x03
-	.byte 0x08
-	.byte 0x1c
-	.byte 0x0d
-	.2byte 0x0000
-	.byte 0x04
-	.byte 0x16
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x05
-	.byte 0x24
-	.byte 0x00
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x3e
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x0000
-	.byte 0x06
-	.byte 0x2e
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x20
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x27
-	.byte 0x0c
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x4087
-	.byte 0x08
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.byte 0x3f
-	.byte 0x0c
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x07
-	.byte 0x05
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x03
-	.byte 0x08
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x08
-	.byte 0x34
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x09
-	.byte 0x2e
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x20
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x27
-	.byte 0x0c
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x4087
-	.byte 0x08
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.byte 0x3f
-	.byte 0x0c
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0a
-	.byte 0x05
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x03
-	.byte 0x08
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x0b
-	.byte 0x0f
-	.byte 0x00
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0c
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0d
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0e
-	.byte 0x26
-	.byte 0x00
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0f
-	.byte 0x01
-	.byte 0x01
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x10
-	.byte 0x21
-	.byte 0x00
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x2f
-	.byte 0x0b
-	.byte 0x22
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x11
-	.byte 0x34
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x12
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x13
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x14
-	.byte 0x01
-	.byte 0x01
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x15
-	.byte 0x21
-	.byte 0x00
-	.byte 0x2f
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x16
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.2byte 0x0000
-	.byte 0x17
-	.byte 0x16
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x18
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x19
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x1a
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x1b
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x1c
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x1d
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x01
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x1e
-	.byte 0x01
-	.byte 0x01
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x05
-	.2byte 0x0000
-	.byte 0x1f
-	.byte 0x21
-	.byte 0x00
-	.byte 0x2f
-	.byte 0x05
-	.2byte 0x0000
-	.byte 0x00
-// -- Begin DWARF2 SEGMENT .debug_frame
-	.section .debug_frame
-.debug_frame_seg:
-	.align 1
-	.4byte 0x00000010
-	.4byte 0xffffffff
-	.byte 0x01
-	.byte 0x00
-	.byte 0x01
-	.byte 0x7c
-	.byte 0x08
-	.4byte 0x8804040c
-	.byte 0x01
-	.2byte 0x0000
-	.4byte 0x0000001c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_uint16_lsbit.2
-	.4byte ..___tag_value_uint16_lsbit.12-..___tag_value_uint16_lsbit.2
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.7-..___tag_value_uint16_lsbit.2
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x0000001c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_uint128_shr.15
-	.4byte ..___tag_value_uint128_shr.25-..___tag_value_uint128_shr.15
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.20-..___tag_value_uint128_shr.15
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x0000001c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_uint128_bswap.28
-	.4byte ..___tag_value_uint128_bswap.38-..___tag_value_uint128_bswap.28
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.33-..___tag_value_uint128_bswap.28
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x0000001c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_uint128_bswap_copy.41
-	.4byte ..___tag_value_uint128_bswap_copy.51-..___tag_value_uint128_bswap_copy.41
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.46-..___tag_value_uint128_bswap_copy.41
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x00000038
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_prime_buffer_2na.54
-	.4byte ..___tag_value_prime_buffer_2na.68-..___tag_value_prime_buffer_2na.54
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.59-..___tag_value_prime_buffer_2na.54
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.60-..___tag_value_prime_buffer_2na.59
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.62-..___tag_value_prime_buffer_2na.60
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.66-..___tag_value_prime_buffer_2na.62
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000038
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_prime_buffer_4na.71
-	.4byte ..___tag_value_prime_buffer_4na.86-..___tag_value_prime_buffer_4na.71
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.76-..___tag_value_prime_buffer_4na.71
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.77-..___tag_value_prime_buffer_4na.76
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.79-..___tag_value_prime_buffer_4na.77
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.84-..___tag_value_prime_buffer_4na.79
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000003c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrFastaExprAlloc.89
-	.4byte ..___tag_value_NucStrFastaExprAlloc.111-..___tag_value_NucStrFastaExprAlloc.89
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.94-..___tag_value_NucStrFastaExprAlloc.89
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.97-..___tag_value_NucStrFastaExprAlloc.94
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.100-..___tag_value_NucStrFastaExprAlloc.97
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.102-..___tag_value_NucStrFastaExprAlloc.100
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.106-..___tag_value_NucStrFastaExprAlloc.102
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrFastaExprMake2.114
-	.4byte ..___tag_value_NucStrFastaExprMake2.137-..___tag_value_NucStrFastaExprMake2.114
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.119-..___tag_value_NucStrFastaExprMake2.114
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.122-..___tag_value_NucStrFastaExprMake2.119
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.126-..___tag_value_NucStrFastaExprMake2.122
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.132-..___tag_value_NucStrFastaExprMake2.126
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrFastaExprMake4.140
-	.4byte ..___tag_value_NucStrFastaExprMake4.163-..___tag_value_NucStrFastaExprMake4.140
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.145-..___tag_value_NucStrFastaExprMake4.140
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.148-..___tag_value_NucStrFastaExprMake4.145
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.152-..___tag_value_NucStrFastaExprMake4.148
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.158-..___tag_value_NucStrFastaExprMake4.152
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_sob.166
-	.4byte ..___tag_value_nss_sob.179-..___tag_value_nss_sob.166
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.171-..___tag_value_nss_sob.166
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.174-..___tag_value_nss_sob.171
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.4byte 0x0000001c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_FASTA_expr.182
-	.4byte ..___tag_value_nss_FASTA_expr.193-..___tag_value_nss_FASTA_expr.182
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.187-..___tag_value_nss_FASTA_expr.182
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_fasta_expr.196
-	.4byte ..___tag_value_nss_fasta_expr.216-..___tag_value_nss_fasta_expr.196
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.201-..___tag_value_nss_fasta_expr.196
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.204-..___tag_value_nss_fasta_expr.201
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.207-..___tag_value_nss_fasta_expr.204
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.211-..___tag_value_nss_fasta_expr.207
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.4byte 0x0000003c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_primary_expr.219
-	.4byte ..___tag_value_nss_primary_expr.244-..___tag_value_nss_primary_expr.219
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.224-..___tag_value_nss_primary_expr.219
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.227-..___tag_value_nss_primary_expr.224
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.230-..___tag_value_nss_primary_expr.227
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.234-..___tag_value_nss_primary_expr.230
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.239-..___tag_value_nss_primary_expr.234
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x00
-	.4byte 0x0000003c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_unary_expr.247
-	.4byte ..___tag_value_nss_unary_expr.269-..___tag_value_nss_unary_expr.247
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.252-..___tag_value_nss_unary_expr.247
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.255-..___tag_value_nss_unary_expr.252
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.258-..___tag_value_nss_unary_expr.255
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.262-..___tag_value_nss_unary_expr.258
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.265-..___tag_value_nss_unary_expr.262
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000004c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_nss_expr.272
-	.4byte ..___tag_value_nss_expr.304-..___tag_value_nss_expr.272
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.277-..___tag_value_nss_expr.272
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.280-..___tag_value_nss_expr.277
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.283-..___tag_value_nss_expr.280
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.287-..___tag_value_nss_expr.283
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.292-..___tag_value_nss_expr.287
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.297-..___tag_value_nss_expr.292
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.300-..___tag_value_nss_expr.297
-	.byte 0x83
-	.byte 0x03
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrstrInit.307
-	.4byte ..___tag_value_NucStrstrInit.320-..___tag_value_NucStrstrInit.307
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.312-..___tag_value_NucStrstrInit.307
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.315-..___tag_value_NucStrstrInit.312
-	.byte 0x83
-	.byte 0x05
-	.2byte 0x0000
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrstrMake.323
-	.4byte ..___tag_value_NucStrstrMake.346-..___tag_value_NucStrstrMake.323
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.328-..___tag_value_NucStrstrMake.323
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.331-..___tag_value_NucStrstrMake.328
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.336-..___tag_value_NucStrstrMake.331
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.341-..___tag_value_NucStrstrMake.336
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrstrWhack.349
-	.4byte ..___tag_value_NucStrstrWhack.362-..___tag_value_NucStrstrWhack.349
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.354-..___tag_value_NucStrstrWhack.349
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.357-..___tag_value_NucStrstrWhack.354
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_8.365
-	.4byte ..___tag_value_eval_2na_8.417-..___tag_value_eval_2na_8.365
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.370-..___tag_value_eval_2na_8.365
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.371-..___tag_value_eval_2na_8.370
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.373-..___tag_value_eval_2na_8.371
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.376-..___tag_value_eval_2na_8.373
-	.byte 0x0f
-	.4byte 0x7de87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.377-..___tag_value_eval_2na_8.376
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.380-..___tag_value_eval_2na_8.377
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.382-..___tag_value_eval_2na_8.380
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.387-..___tag_value_eval_2na_8.382
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.389-..___tag_value_eval_2na_8.387
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.394-..___tag_value_eval_2na_8.389
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.396-..___tag_value_eval_2na_8.394
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.401-..___tag_value_eval_2na_8.396
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.403-..___tag_value_eval_2na_8.401
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.408-..___tag_value_eval_2na_8.403
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.410-..___tag_value_eval_2na_8.408
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.415-..___tag_value_eval_2na_8.410
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_16.420
-	.4byte ..___tag_value_eval_2na_16.472-..___tag_value_eval_2na_16.420
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.425-..___tag_value_eval_2na_16.420
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.426-..___tag_value_eval_2na_16.425
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.428-..___tag_value_eval_2na_16.426
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.431-..___tag_value_eval_2na_16.428
-	.byte 0x0f
-	.4byte 0x7dd87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.432-..___tag_value_eval_2na_16.431
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.435-..___tag_value_eval_2na_16.432
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.437-..___tag_value_eval_2na_16.435
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.442-..___tag_value_eval_2na_16.437
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.444-..___tag_value_eval_2na_16.442
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.449-..___tag_value_eval_2na_16.444
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.451-..___tag_value_eval_2na_16.449
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.456-..___tag_value_eval_2na_16.451
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.458-..___tag_value_eval_2na_16.456
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.463-..___tag_value_eval_2na_16.458
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.465-..___tag_value_eval_2na_16.463
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.470-..___tag_value_eval_2na_16.465
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_32.475
-	.4byte ..___tag_value_eval_2na_32.527-..___tag_value_eval_2na_32.475
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.480-..___tag_value_eval_2na_32.475
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.481-..___tag_value_eval_2na_32.480
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.483-..___tag_value_eval_2na_32.481
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.486-..___tag_value_eval_2na_32.483
-	.byte 0x0f
-	.4byte 0x7dd87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.487-..___tag_value_eval_2na_32.486
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.490-..___tag_value_eval_2na_32.487
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.492-..___tag_value_eval_2na_32.490
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.497-..___tag_value_eval_2na_32.492
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.499-..___tag_value_eval_2na_32.497
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.504-..___tag_value_eval_2na_32.499
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.506-..___tag_value_eval_2na_32.504
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.511-..___tag_value_eval_2na_32.506
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.513-..___tag_value_eval_2na_32.511
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.518-..___tag_value_eval_2na_32.513
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.520-..___tag_value_eval_2na_32.518
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.525-..___tag_value_eval_2na_32.520
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_64.530
-	.4byte ..___tag_value_eval_2na_64.582-..___tag_value_eval_2na_64.530
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.535-..___tag_value_eval_2na_64.530
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.536-..___tag_value_eval_2na_64.535
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.538-..___tag_value_eval_2na_64.536
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.541-..___tag_value_eval_2na_64.538
-	.byte 0x0f
-	.4byte 0x7dd87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.542-..___tag_value_eval_2na_64.541
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.545-..___tag_value_eval_2na_64.542
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.547-..___tag_value_eval_2na_64.545
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.552-..___tag_value_eval_2na_64.547
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.554-..___tag_value_eval_2na_64.552
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.559-..___tag_value_eval_2na_64.554
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.561-..___tag_value_eval_2na_64.559
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.566-..___tag_value_eval_2na_64.561
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.568-..___tag_value_eval_2na_64.566
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.573-..___tag_value_eval_2na_64.568
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.575-..___tag_value_eval_2na_64.573
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.580-..___tag_value_eval_2na_64.575
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000d4
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_128.585
-	.4byte ..___tag_value_eval_2na_128.644-..___tag_value_eval_2na_128.585
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.590-..___tag_value_eval_2na_128.585
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.591-..___tag_value_eval_2na_128.590
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.593-..___tag_value_eval_2na_128.591
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.596-..___tag_value_eval_2na_128.593
-	.byte 0x0f
-	.4byte 0x7df87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.597-..___tag_value_eval_2na_128.596
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.600-..___tag_value_eval_2na_128.597
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.602-..___tag_value_eval_2na_128.600
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.607-..___tag_value_eval_2na_128.602
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.609-..___tag_value_eval_2na_128.607
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.614-..___tag_value_eval_2na_128.609
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.616-..___tag_value_eval_2na_128.614
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.621-..___tag_value_eval_2na_128.616
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.623-..___tag_value_eval_2na_128.621
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.628-..___tag_value_eval_2na_128.623
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.630-..___tag_value_eval_2na_128.628
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.635-..___tag_value_eval_2na_128.630
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.637-..___tag_value_eval_2na_128.635
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.642-..___tag_value_eval_2na_128.637
-	.byte 0x0c
-	.2byte 0x0404
-	.4byte 0x00000160
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_2na_pos.647
-	.4byte ..___tag_value_eval_2na_pos.748-..___tag_value_eval_2na_pos.647
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.652-..___tag_value_eval_2na_pos.647
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.653-..___tag_value_eval_2na_pos.652
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.655-..___tag_value_eval_2na_pos.653
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.658-..___tag_value_eval_2na_pos.655
-	.byte 0x0f
-	.4byte 0x7df87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.659-..___tag_value_eval_2na_pos.658
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.662-..___tag_value_eval_2na_pos.659
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.664-..___tag_value_eval_2na_pos.662
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.669-..___tag_value_eval_2na_pos.664
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.671-..___tag_value_eval_2na_pos.669
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.676-..___tag_value_eval_2na_pos.671
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.678-..___tag_value_eval_2na_pos.676
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.683-..___tag_value_eval_2na_pos.678
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.685-..___tag_value_eval_2na_pos.683
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.690-..___tag_value_eval_2na_pos.685
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.692-..___tag_value_eval_2na_pos.690
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.697-..___tag_value_eval_2na_pos.692
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.699-..___tag_value_eval_2na_pos.697
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.704-..___tag_value_eval_2na_pos.699
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.706-..___tag_value_eval_2na_pos.704
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.711-..___tag_value_eval_2na_pos.706
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.713-..___tag_value_eval_2na_pos.711
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.718-..___tag_value_eval_2na_pos.713
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.720-..___tag_value_eval_2na_pos.718
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.725-..___tag_value_eval_2na_pos.720
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.727-..___tag_value_eval_2na_pos.725
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.732-..___tag_value_eval_2na_pos.727
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.734-..___tag_value_eval_2na_pos.732
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.739-..___tag_value_eval_2na_pos.734
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.741-..___tag_value_eval_2na_pos.739
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.746-..___tag_value_eval_2na_pos.741
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_4na_16.751
-	.4byte ..___tag_value_eval_4na_16.803-..___tag_value_eval_4na_16.751
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.756-..___tag_value_eval_4na_16.751
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.757-..___tag_value_eval_4na_16.756
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.759-..___tag_value_eval_4na_16.757
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.762-..___tag_value_eval_4na_16.759
-	.byte 0x0f
-	.4byte 0x7dd87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.763-..___tag_value_eval_4na_16.762
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.766-..___tag_value_eval_4na_16.763
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.768-..___tag_value_eval_4na_16.766
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.773-..___tag_value_eval_4na_16.768
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.775-..___tag_value_eval_4na_16.773
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.780-..___tag_value_eval_4na_16.775
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.782-..___tag_value_eval_4na_16.780
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.787-..___tag_value_eval_4na_16.782
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.789-..___tag_value_eval_4na_16.787
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.794-..___tag_value_eval_4na_16.789
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.796-..___tag_value_eval_4na_16.794
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.801-..___tag_value_eval_4na_16.796
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_4na_32.806
-	.4byte ..___tag_value_eval_4na_32.858-..___tag_value_eval_4na_32.806
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.811-..___tag_value_eval_4na_32.806
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.812-..___tag_value_eval_4na_32.811
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.814-..___tag_value_eval_4na_32.812
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.817-..___tag_value_eval_4na_32.814
-	.byte 0x0f
-	.4byte 0x7dc87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.818-..___tag_value_eval_4na_32.817
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.821-..___tag_value_eval_4na_32.818
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.823-..___tag_value_eval_4na_32.821
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.828-..___tag_value_eval_4na_32.823
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.830-..___tag_value_eval_4na_32.828
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.835-..___tag_value_eval_4na_32.830
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.837-..___tag_value_eval_4na_32.835
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.842-..___tag_value_eval_4na_32.837
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.844-..___tag_value_eval_4na_32.842
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.849-..___tag_value_eval_4na_32.844
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.851-..___tag_value_eval_4na_32.849
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.856-..___tag_value_eval_4na_32.851
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000c0
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_4na_64.861
-	.4byte ..___tag_value_eval_4na_64.913-..___tag_value_eval_4na_64.861
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.866-..___tag_value_eval_4na_64.861
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.867-..___tag_value_eval_4na_64.866
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.869-..___tag_value_eval_4na_64.867
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.872-..___tag_value_eval_4na_64.869
-	.byte 0x0f
-	.4byte 0x7dc87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.873-..___tag_value_eval_4na_64.872
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.876-..___tag_value_eval_4na_64.873
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.878-..___tag_value_eval_4na_64.876
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.883-..___tag_value_eval_4na_64.878
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.885-..___tag_value_eval_4na_64.883
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.890-..___tag_value_eval_4na_64.885
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.892-..___tag_value_eval_4na_64.890
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.897-..___tag_value_eval_4na_64.892
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.899-..___tag_value_eval_4na_64.897
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.904-..___tag_value_eval_4na_64.899
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.906-..___tag_value_eval_4na_64.904
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.911-..___tag_value_eval_4na_64.906
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000d4
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_4na_128.916
-	.4byte ..___tag_value_eval_4na_128.975-..___tag_value_eval_4na_128.916
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.921-..___tag_value_eval_4na_128.916
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.922-..___tag_value_eval_4na_128.921
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.924-..___tag_value_eval_4na_128.922
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.927-..___tag_value_eval_4na_128.924
-	.byte 0x0f
-	.4byte 0x7de87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.928-..___tag_value_eval_4na_128.927
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.931-..___tag_value_eval_4na_128.928
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.933-..___tag_value_eval_4na_128.931
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.938-..___tag_value_eval_4na_128.933
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.940-..___tag_value_eval_4na_128.938
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.945-..___tag_value_eval_4na_128.940
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.947-..___tag_value_eval_4na_128.945
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.952-..___tag_value_eval_4na_128.947
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.954-..___tag_value_eval_4na_128.952
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.959-..___tag_value_eval_4na_128.954
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.961-..___tag_value_eval_4na_128.959
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.966-..___tag_value_eval_4na_128.961
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.968-..___tag_value_eval_4na_128.966
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.973-..___tag_value_eval_4na_128.968
-	.byte 0x0c
-	.2byte 0x0404
-	.4byte 0x00000160
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_eval_4na_pos.978
-	.4byte ..___tag_value_eval_4na_pos.1079-..___tag_value_eval_4na_pos.978
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.983-..___tag_value_eval_4na_pos.978
-	.byte 0x0c
-	.2byte 0x0804
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.984-..___tag_value_eval_4na_pos.983
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.986-..___tag_value_eval_4na_pos.984
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.989-..___tag_value_eval_4na_pos.986
-	.byte 0x0f
-	.4byte 0x7de87506
-	.2byte 0x2306
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.990-..___tag_value_eval_4na_pos.989
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.993-..___tag_value_eval_4na_pos.990
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.995-..___tag_value_eval_4na_pos.993
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1000-..___tag_value_eval_4na_pos.995
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1002-..___tag_value_eval_4na_pos.1000
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1007-..___tag_value_eval_4na_pos.1002
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1009-..___tag_value_eval_4na_pos.1007
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1014-..___tag_value_eval_4na_pos.1009
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1016-..___tag_value_eval_4na_pos.1014
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1021-..___tag_value_eval_4na_pos.1016
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1023-..___tag_value_eval_4na_pos.1021
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1028-..___tag_value_eval_4na_pos.1023
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1030-..___tag_value_eval_4na_pos.1028
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1035-..___tag_value_eval_4na_pos.1030
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1037-..___tag_value_eval_4na_pos.1035
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1042-..___tag_value_eval_4na_pos.1037
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1044-..___tag_value_eval_4na_pos.1042
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1049-..___tag_value_eval_4na_pos.1044
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1051-..___tag_value_eval_4na_pos.1049
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1056-..___tag_value_eval_4na_pos.1051
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1058-..___tag_value_eval_4na_pos.1056
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1063-..___tag_value_eval_4na_pos.1058
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1065-..___tag_value_eval_4na_pos.1063
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1070-..___tag_value_eval_4na_pos.1065
-	.byte 0x0c
-	.2byte 0x0404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1072-..___tag_value_eval_4na_pos.1070
-	.byte 0x0c
-	.2byte 0x0803
-	.byte 0x10
-	.4byte 0x00750205
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.1077-..___tag_value_eval_4na_pos.1072
-	.byte 0x0c
-	.2byte 0x0404
-	.2byte 0x0000
-	.4byte 0x0000013c
-	.4byte .debug_frame_seg
-	.4byte ..___tag_value_NucStrstrSearch.1082
-	.4byte ..___tag_value_NucStrstrSearch.1250-..___tag_value_NucStrstrSearch.1082
-	.byte 0x04
-	.4byte 0x00000000
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1087-..___tag_value_NucStrstrSearch.1082
-	.byte 0x0c
-	.2byte 0x0805
-	.byte 0x85
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1090-..___tag_value_NucStrstrSearch.1087
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1095-..___tag_value_NucStrstrSearch.1090
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1100-..___tag_value_NucStrstrSearch.1095
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1105-..___tag_value_NucStrstrSearch.1100
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1110-..___tag_value_NucStrstrSearch.1105
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1115-..___tag_value_NucStrstrSearch.1110
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1120-..___tag_value_NucStrstrSearch.1115
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1125-..___tag_value_NucStrstrSearch.1120
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1130-..___tag_value_NucStrstrSearch.1125
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1135-..___tag_value_NucStrstrSearch.1130
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1140-..___tag_value_NucStrstrSearch.1135
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1145-..___tag_value_NucStrstrSearch.1140
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1150-..___tag_value_NucStrstrSearch.1145
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1155-..___tag_value_NucStrstrSearch.1150
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1160-..___tag_value_NucStrstrSearch.1155
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1165-..___tag_value_NucStrstrSearch.1160
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1170-..___tag_value_NucStrstrSearch.1165
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1175-..___tag_value_NucStrstrSearch.1170
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1180-..___tag_value_NucStrstrSearch.1175
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1185-..___tag_value_NucStrstrSearch.1180
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1190-..___tag_value_NucStrstrSearch.1185
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1195-..___tag_value_NucStrstrSearch.1190
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1200-..___tag_value_NucStrstrSearch.1195
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1205-..___tag_value_NucStrstrSearch.1200
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1210-..___tag_value_NucStrstrSearch.1205
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1215-..___tag_value_NucStrstrSearch.1210
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1220-..___tag_value_NucStrstrSearch.1215
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1225-..___tag_value_NucStrstrSearch.1220
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1230-..___tag_value_NucStrstrSearch.1225
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1235-..___tag_value_NucStrstrSearch.1230
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1240-..___tag_value_NucStrstrSearch.1235
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.1245-..___tag_value_NucStrstrSearch.1240
-	.byte 0x85
-	.byte 0x02
-	.byte 0x83
-	.byte 0x03
-	.2byte 0x0000
-	.byte 0x00
-	.section .text
-.LNDBG_TXe:
-# End
diff --git a/libs/search/nucstrstr-icc-i386-prof.pic.s b/libs/search/nucstrstr-icc-i386-prof.pic.s
deleted file mode 100644
index a44ad71..0000000
--- a/libs/search/nucstrstr-icc-i386-prof.pic.s
+++ /dev/null
@@ -1,7600 +0,0 @@
-	.section .text
-.LNDBG_TX:
-# -- Machine type PW
-# mark_description "Intel(R) C++ Compiler for applications running on IA-32, Version 10.1    Build 20081024 %s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -I/";
-# mark_description "home/yaschenk/devel/internal/asm-trace/inc/gcc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I/hom";
-# mark_description "e/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home/rod";
-# mark_description "armer/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -O3 -unroll -xW -vec_report5 -DNDEBUG -D_P";
-# mark_description "ROFILING -p -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.file "nucstrstr.c"
-	.text
-..TXTST0:
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1(self): 8 + %ebp
-# parameter 2(ncbi2na): 12 + %ebp
-# parameter 3(pos): 16 + %ebp
-# parameter 4(len): 20 + %ebp
-# parameter 5(selflen): 24 + %ebp
-..B1.1:                         # Preds ..B1.0
-        pushl     %ebp                                          #5217.1
-        movl      %esp, %ebp                                    #5217.1
-        subl      $16, %esp                                     #5217.1
-        movl      %edi, -8(%ebp)                                #5217.1
-        movl      %esi, -12(%ebp)                               #5217.1
-        movl      %ebx, -16(%ebp)                               #5217.1
-        movl      8(%ebp), %edi                                 #5215.5
-        movl      16(%ebp), %eax                                #5215.5
-        movl      20(%ebp), %esi                                #5215.5
-        movl      %eax, -4(%ebp)                                #5215.5
-        call      ..L1          # Prob 100%                     #5217.1
-..L1:                                                           #
-        popl      %ebx                                          #5217.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L1], %ebx       #5217.1
-        lea       _gprof_pack0 at GOTOFF(%ebx), %edx               #5217.1
-        call      mcount at PLT                                    #5217.1
-                                # LOE ebx esi edi
-..B1.2:                         # Preds ..B1.1
-        testl     %edi, %edi                                    #5218.18
-        je        ..B1.108      # Prob 6%                       #5218.18
-                                # LOE ebx esi edi
-..B1.3:                         # Preds ..B1.2
-        movl      12(%ebp), %eax                                #5218.37
-        testl     %eax, %eax                                    #5218.37
-        je        ..B1.108      # Prob 6%                       #5218.37
-                                # LOE ebx esi edi
-..B1.4:                         # Preds ..B1.3
-        movl      -4(%ebp), %edx                                #
-                                # LOE edx ebx esi edi
-..B1.5:                         # Preds ..B1.15 ..B1.18 ..B1.4
-        testl     %esi, %esi                                    #5218.52
-        je        ..B1.108      # Prob 28%                      #5218.52
-                                # LOE edx ebx esi edi
-..B1.8:                         # Preds ..B1.5 ..B1.32
-        movl      (%edi), %eax                                  #5223.18
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B1.108      # Prob 50%                      #5223.9
-                                # LOE eax edx ebx esi edi
-..B1.9:                         # Preds ..B1.8
-        movl      ..1..TPKT.30_0.0.0 at GOTOFF(%ebx,%eax,4), %eax  #5223.9
-        jmp       *%eax                                         #5223.9
-                                # LOE edx ebx esi edi
-..1.30_0.TAG.0c.0.0:
-..B1.11:                        # Preds ..B1.9
-        movl      4(%edi), %eax                                 #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B1.20       # Prob 20%                      #5286.22
-                                # LOE eax edx ebx esi edi
-..B1.12:                        # Preds ..B1.11
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B1.20       # Prob 25%                      #5286.22
-                                # LOE eax edx ebx esi edi
-..B1.13:                        # Preds ..B1.12
-        cmpl      $14, %eax                                     #5286.22
-        jne       ..B1.16       # Prob 67%                      #5286.22
-                                # LOE eax edx ebx esi edi
-..B1.14:                        # Preds ..B1.13
-        movl      8(%edi), %edi                                 #5297.29
-        movl      4(%edi), %eax                                 #5297.29
-        cmpl      %esi, %eax                                    #5298.34
-        ja        ..B1.108      # Prob 5%                       #5298.34
-                                # LOE eax edx ebx edi
-..B1.15:                        # Preds ..B1.14
-        movl      %eax, %esi                                    #5297.17
-        testl     %edi, %edi                                    #5218.18
-        jne       ..B1.5        # Prob 94%                      #5218.18
-        jmp       ..B1.108      # Prob 100%                     #5218.18
-                                # LOE edx ebx esi edi
-..B1.16:                        # Preds ..B1.13
-        cmpl      $15, %eax                                     #5286.22
-        jne       ..B1.108      # Prob 50%                      #5286.22
-                                # LOE edx ebx esi edi
-..B1.17:                        # Preds ..B1.16
-        movl      8(%edi), %edi                                 #5302.29
-        movl      4(%edi), %eax                                 #5302.29
-        cmpl      %esi, %eax                                    #5303.34
-        ja        ..B1.108      # Prob 5%                       #5303.34
-                                # LOE eax edx ebx esi edi
-..B1.18:                        # Preds ..B1.17
-        addl      %esi, %edx                                    #5306.27
-        subl      %eax, %edx                                    #5306.33
-        movl      %eax, %esi                                    #5302.17
-        testl     %edi, %edi                                    #5218.18
-        jne       ..B1.5        # Prob 94%                      #5218.18
-        jmp       ..B1.108      # Prob 100%                     #5218.18
-                                # LOE edx ebx esi edi
-..B1.20:                        # Preds ..B1.11 ..B1.12
-        movl      %edx, -4(%ebp)                                #
-                                # LOE edx ebx esi edi dl dh
-..B1.21:                        # Preds ..B1.20
-        movl      24(%ebp), %eax                                #5217.1
-        movl      12(%ebp), %ecx                                #5217.1
-        pushl     %eax                                          #5217.1
-        pushl     %esi                                          #5217.1
-        pushl     %edx                                          #5217.1
-        pushl     %ecx                                          #5217.1
-        pushl     8(%edi)                                       #5217.1
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE eax edi
-..B1.118:                       # Preds ..B1.21
-        addl      $20, %esp                                     #5290.25
-                                # LOE eax edi
-..B1.22:                        # Preds ..B1.118
-        movl      4(%edi), %edx                                 #5291.22
-        testl     %edx, %edx                                    #5291.42
-        je        ..B1.57       # Prob 28%                      #5291.42
-                                # LOE eax
-..B1.23:                        # Preds ..B1.22
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B1.108      # Prob 72%                      #5293.31
-                                # LOE
-..B1.24:                        # Preds ..B1.23
-        movl      -16(%ebp), %ebx                               #5294.28
-        movl      -12(%ebp), %esi                               #5294.28
-        movl      -8(%ebp), %edi                                #5294.28
-        movl      $1, %eax                                      #5294.28
-        movl      %ebp, %esp                                    #5294.28
-        popl      %ebp                                          #5294.28
-        ret                                                     #5294.28
-                                # LOE
-..1.30_0.TAG.0b.0.0:
-..B1.27:                        # Preds ..B1.9
-        movl      24(%ebp), %eax                                #5217.1
-        movl      12(%ebp), %ecx                                #5217.1
-        movl      %edx, -4(%ebp)                                #5272.21
-        pushl     %eax                                          #5217.1
-        pushl     %esi                                          #5217.1
-        pushl     %edx                                          #5217.1
-        pushl     %ecx                                          #5217.1
-        pushl     8(%edi)                                       #5217.1
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE eax ebx esi edi
-..B1.119:                       # Preds ..B1.27
-        movl      -4(%ebp), %edx                                #
-        addl      $20, %esp                                     #5272.21
-                                # LOE eax edx ebx esi edi dl dh
-..B1.28:                        # Preds ..B1.119
-        movl      4(%edi), %ecx                                 #5273.22
-        cmpl      $17, %ecx                                     #5273.22
-        jne       ..B1.30       # Prob 67%                      #5273.22
-                                # LOE eax edx ecx ebx esi edi dl dh
-..B1.29:                        # Preds ..B1.28
-        testl     %eax, %eax                                    #5276.31
-        jne       ..B1.57       # Prob 5%                       #5276.31
-        jmp       ..B1.32       # Prob 100%                     #5276.31
-                                # LOE eax edx ebx esi edi dl dh
-..B1.30:                        # Preds ..B1.28
-        cmpl      $16, %ecx                                     #5273.22
-        jne       ..B1.32       # Prob 50%                      #5273.22
-                                # LOE eax edx ebx esi edi dl dh
-..B1.31:                        # Preds ..B1.30
-        testl     %eax, %eax                                    #5280.31
-        je        ..B1.57       # Prob 5%                       #5280.31
-                                # LOE eax edx ebx esi edi dl dh
-..B1.32:                        # Preds ..B1.29 ..B1.31 ..B1.30
-        movl      12(%edi), %edi                                #5284.38
-        testl     %edi, %edi                                    #5218.18
-        jne       ..B1.8        # Prob 94%                      #5218.18
-        jmp       ..B1.108      # Prob 100%                     #5218.18
-                                # LOE edx ebx esi edi
-..1.30_0.TAG.0a.0.0:
-..B1.34:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.35:                        # Preds ..B1.34
-        movl      4(%edi), %edx                                 #5268.24
-        cmpl      %edx, %esi                                    #5268.24
-        jb        ..B1.108      # Prob 28%                      #5268.24
-                                # LOE edx esi edi
-..B1.36:                        # Preds ..B1.35
-        movl      24(%ebp), %eax                                #5269.9
-        testl     %eax, %eax                                    #5269.9
-        je        ..B1.38       # Prob 12%                      #5269.9
-                                # LOE edx esi edi
-..B1.37:                        # Preds ..B1.36
-        movl      24(%ebp), %eax                                #5269.18
-        movl      %edx, (%eax)                                  #5269.18
-                                # LOE esi edi
-..B1.38:                        # Preds ..B1.37 ..B1.36
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_4na_pos                                  #5270.20
-                                # LOE eax
-..B1.120:                       # Preds ..B1.38
-        movl      -16(%ebp), %ebx                               #5270.20
-        movl      -12(%ebp), %esi                               #5270.20
-        movl      -8(%ebp), %edi                                #5270.20
-        addl      $16, %esp                                     #5270.20
-        movl      %ebp, %esp                                    #5270.20
-        popl      %ebp                                          #5270.20
-        ret                                                     #5270.20
-                                # LOE
-..1.30_0.TAG.09.0.0:
-..B1.40:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.41:                        # Preds ..B1.40
-        movl      4(%edi), %edx                                 #5264.24
-        cmpl      %edx, %esi                                    #5264.24
-        jb        ..B1.108      # Prob 28%                      #5264.24
-                                # LOE edx esi edi
-..B1.42:                        # Preds ..B1.41
-        movl      24(%ebp), %eax                                #5265.9
-        testl     %eax, %eax                                    #5265.9
-        je        ..B1.44       # Prob 12%                      #5265.9
-                                # LOE edx esi edi
-..B1.43:                        # Preds ..B1.42
-        movl      24(%ebp), %eax                                #5265.18
-        movl      %edx, (%eax)                                  #5265.18
-                                # LOE esi edi
-..B1.44:                        # Preds ..B1.43 ..B1.42
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_pos                                  #5266.20
-                                # LOE eax
-..B1.121:                       # Preds ..B1.44
-        movl      -16(%ebp), %ebx                               #5266.20
-        movl      -12(%ebp), %esi                               #5266.20
-        movl      -8(%ebp), %edi                                #5266.20
-        addl      $16, %esp                                     #5266.20
-        movl      %ebp, %esp                                    #5266.20
-        popl      %ebp                                          #5266.20
-        ret                                                     #5266.20
-                                # LOE
-..1.30_0.TAG.08.0.0:
-..B1.46:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.47:                        # Preds ..B1.46
-        movl      4(%edi), %edx                                 #5259.24
-        cmpl      %edx, %esi                                    #5259.24
-        jb        ..B1.108      # Prob 28%                      #5259.24
-                                # LOE edx esi edi
-..B1.48:                        # Preds ..B1.47
-        movl      24(%ebp), %eax                                #5260.9
-        testl     %eax, %eax                                    #5260.9
-        je        ..B1.50       # Prob 12%                      #5260.9
-                                # LOE edx esi edi
-..B1.49:                        # Preds ..B1.48
-        movl      24(%ebp), %eax                                #5260.18
-        movl      %edx, (%eax)                                  #5260.18
-                                # LOE esi edi
-..B1.50:                        # Preds ..B1.49 ..B1.48
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_4na_128                                  #5261.20
-                                # LOE eax
-..B1.122:                       # Preds ..B1.50
-        movl      -16(%ebp), %ebx                               #5261.20
-        movl      -12(%ebp), %esi                               #5261.20
-        movl      -8(%ebp), %edi                                #5261.20
-        addl      $16, %esp                                     #5261.20
-        movl      %ebp, %esp                                    #5261.20
-        popl      %ebp                                          #5261.20
-        ret                                                     #5261.20
-                                # LOE
-..1.30_0.TAG.07.0.0:
-..B1.52:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.53:                        # Preds ..B1.52
-        movl      4(%edi), %edx                                 #5255.24
-        cmpl      %edx, %esi                                    #5255.24
-        jb        ..B1.108      # Prob 28%                      #5255.24
-                                # LOE edx esi edi
-..B1.54:                        # Preds ..B1.53
-        movl      24(%ebp), %eax                                #5256.9
-        testl     %eax, %eax                                    #5256.9
-        je        ..B1.56       # Prob 12%                      #5256.9
-                                # LOE edx esi edi
-..B1.55:                        # Preds ..B1.54
-        movl      24(%ebp), %eax                                #5256.18
-        movl      %edx, (%eax)                                  #5256.18
-                                # LOE esi edi
-..B1.56:                        # Preds ..B1.55 ..B1.54
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_4na_32                                   #5257.20
-                                # LOE eax
-..B1.123:                       # Preds ..B1.56
-        addl      $16, %esp                                     #5257.20
-                                # LOE eax
-..B1.57:                        # Preds ..B1.29 ..B1.31 ..B1.22 ..B1.123
-        movl      -16(%ebp), %ebx                               #5257.20
-        movl      -12(%ebp), %esi                               #5257.20
-        movl      -8(%ebp), %edi                                #5257.20
-        movl      %ebp, %esp                                    #5257.20
-        popl      %ebp                                          #5257.20
-        ret                                                     #5257.20
-                                # LOE
-..1.30_0.TAG.06.0.0:
-..B1.59:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.60:                        # Preds ..B1.59
-        movl      4(%edi), %edx                                 #5251.24
-        cmpl      %edx, %esi                                    #5251.24
-        jb        ..B1.108      # Prob 28%                      #5251.24
-                                # LOE edx esi edi
-..B1.61:                        # Preds ..B1.60
-        movl      24(%ebp), %eax                                #5252.9
-        testl     %eax, %eax                                    #5252.9
-        je        ..B1.63       # Prob 12%                      #5252.9
-                                # LOE edx esi edi
-..B1.62:                        # Preds ..B1.61
-        movl      24(%ebp), %eax                                #5252.18
-        movl      %edx, (%eax)                                  #5252.18
-                                # LOE esi edi
-..B1.63:                        # Preds ..B1.62 ..B1.61
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_4na_16                                   #5253.20
-                                # LOE eax
-..B1.124:                       # Preds ..B1.63
-        addl      $16, %esp                                     #5253.20
-                                # LOE eax
-..B1.64:                        # Preds ..B1.124
-        movl      -16(%ebp), %ebx                               #5253.20
-        movl      -12(%ebp), %esi                               #5253.20
-        movl      -8(%ebp), %edi                                #5253.20
-        movl      %ebp, %esp                                    #5253.20
-        popl      %ebp                                          #5253.20
-        ret                                                     #5253.20
-                                # LOE
-..1.30_0.TAG.05.0.0:
-..B1.66:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.67:                        # Preds ..B1.66
-        movl      4(%edi), %edx                                 #5247.24
-        cmpl      %edx, %esi                                    #5247.24
-        jb        ..B1.108      # Prob 28%                      #5247.24
-                                # LOE edx esi edi
-..B1.68:                        # Preds ..B1.67
-        movl      24(%ebp), %eax                                #5248.9
-        testl     %eax, %eax                                    #5248.9
-        je        ..B1.70       # Prob 12%                      #5248.9
-                                # LOE edx esi edi
-..B1.69:                        # Preds ..B1.68
-        movl      24(%ebp), %eax                                #5248.18
-        movl      %edx, (%eax)                                  #5248.18
-                                # LOE esi edi
-..B1.70:                        # Preds ..B1.69 ..B1.68
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_128                                  #5249.20
-                                # LOE eax
-..B1.125:                       # Preds ..B1.70
-        movl      -16(%ebp), %ebx                               #5249.20
-        movl      -12(%ebp), %esi                               #5249.20
-        movl      -8(%ebp), %edi                                #5249.20
-        addl      $16, %esp                                     #5249.20
-        movl      %ebp, %esp                                    #5249.20
-        popl      %ebp                                          #5249.20
-        ret                                                     #5249.20
-                                # LOE
-..1.30_0.TAG.04.0.0:
-..B1.72:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.73:                        # Preds ..B1.72
-        movl      4(%edi), %edx                                 #5243.24
-        cmpl      %edx, %esi                                    #5243.24
-        jb        ..B1.108      # Prob 28%                      #5243.24
-                                # LOE edx esi edi
-..B1.74:                        # Preds ..B1.73
-        movl      24(%ebp), %eax                                #5244.9
-        testl     %eax, %eax                                    #5244.9
-        je        ..B1.76       # Prob 12%                      #5244.9
-                                # LOE edx esi edi
-..B1.75:                        # Preds ..B1.74
-        movl      24(%ebp), %eax                                #5244.18
-        movl      %edx, (%eax)                                  #5244.18
-                                # LOE esi edi
-..B1.76:                        # Preds ..B1.75 ..B1.74
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_32                                   #5245.20
-                                # LOE eax
-..B1.126:                       # Preds ..B1.76
-        addl      $16, %esp                                     #5245.20
-                                # LOE eax
-..B1.77:                        # Preds ..B1.126
-        movl      -16(%ebp), %ebx                               #5245.20
-        movl      -12(%ebp), %esi                               #5245.20
-        movl      -8(%ebp), %edi                                #5245.20
-        movl      %ebp, %esp                                    #5245.20
-        popl      %ebp                                          #5245.20
-        ret                                                     #5245.20
-                                # LOE
-..1.30_0.TAG.03.0.0:
-..B1.79:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.80:                        # Preds ..B1.79
-        movl      4(%edi), %edx                                 #5239.24
-        cmpl      %edx, %esi                                    #5239.24
-        jb        ..B1.108      # Prob 28%                      #5239.24
-                                # LOE edx esi edi
-..B1.81:                        # Preds ..B1.80
-        movl      24(%ebp), %eax                                #5240.9
-        testl     %eax, %eax                                    #5240.9
-        je        ..B1.83       # Prob 12%                      #5240.9
-                                # LOE edx esi edi
-..B1.82:                        # Preds ..B1.81
-        movl      24(%ebp), %eax                                #5240.18
-        movl      %edx, (%eax)                                  #5240.18
-                                # LOE esi edi
-..B1.83:                        # Preds ..B1.82 ..B1.81
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_16                                   #5241.20
-                                # LOE eax
-..B1.127:                       # Preds ..B1.83
-        addl      $16, %esp                                     #5241.20
-                                # LOE eax
-..B1.84:                        # Preds ..B1.127
-        movl      -16(%ebp), %ebx                               #5241.20
-        movl      -12(%ebp), %esi                               #5241.20
-        movl      -8(%ebp), %edi                                #5241.20
-        movl      %ebp, %esp                                    #5241.20
-        popl      %ebp                                          #5241.20
-        ret                                                     #5241.20
-                                # LOE
-..1.30_0.TAG.02.0.0:
-..B1.86:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.87:                        # Preds ..B1.86
-        movl      4(%edi), %edx                                 #5235.24
-        cmpl      %edx, %esi                                    #5235.24
-        jb        ..B1.108      # Prob 28%                      #5235.24
-                                # LOE edx esi edi
-..B1.88:                        # Preds ..B1.87
-        movl      24(%ebp), %eax                                #5236.9
-        testl     %eax, %eax                                    #5236.9
-        je        ..B1.90       # Prob 12%                      #5236.9
-                                # LOE edx esi edi
-..B1.89:                        # Preds ..B1.88
-        movl      24(%ebp), %eax                                #5236.18
-        movl      %edx, (%eax)                                  #5236.18
-                                # LOE esi edi
-..B1.90:                        # Preds ..B1.89 ..B1.88
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_8                                    #5237.20
-                                # LOE eax
-..B1.128:                       # Preds ..B1.90
-        addl      $16, %esp                                     #5237.20
-                                # LOE eax
-..B1.91:                        # Preds ..B1.128
-        movl      -16(%ebp), %ebx                               #5237.20
-        movl      -12(%ebp), %esi                               #5237.20
-        movl      -8(%ebp), %edi                                #5237.20
-        movl      %ebp, %esp                                    #5237.20
-        popl      %ebp                                          #5237.20
-        ret                                                     #5237.20
-                                # LOE
-..1.30_0.TAG.01.0.0:
-..B1.93:                        # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.94:                        # Preds ..B1.93
-        movl      4(%edi), %edx                                 #5230.24
-        cmpl      %edx, %esi                                    #5230.24
-        jb        ..B1.108      # Prob 28%                      #5230.24
-                                # LOE edx esi edi
-..B1.95:                        # Preds ..B1.94
-        movl      24(%ebp), %eax                                #5231.9
-        testl     %eax, %eax                                    #5231.9
-        je        ..B1.97       # Prob 12%                      #5231.9
-                                # LOE edx esi edi
-..B1.96:                        # Preds ..B1.95
-        movl      24(%ebp), %eax                                #5231.18
-        movl      %edx, (%eax)                                  #5231.18
-                                # LOE esi edi
-..B1.97:                        # Preds ..B1.96 ..B1.95
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_4na_64                                   #5232.20
-                                # LOE eax
-..B1.129:                       # Preds ..B1.97
-        addl      $16, %esp                                     #5232.20
-                                # LOE eax
-..B1.98:                        # Preds ..B1.129
-        movl      -16(%ebp), %ebx                               #5232.20
-        movl      -12(%ebp), %esi                               #5232.20
-        movl      -8(%ebp), %edi                                #5232.20
-        movl      %ebp, %esp                                    #5232.20
-        popl      %ebp                                          #5232.20
-        ret                                                     #5232.20
-                                # LOE
-..1.30_0.TAG.00.0.0:
-..B1.100:                       # Preds ..B1.9
-        movl      %edx, -4(%ebp)                                #
-                                # LOE esi edi
-..B1.101:                       # Preds ..B1.100
-        movl      4(%edi), %edx                                 #5226.24
-        cmpl      %edx, %esi                                    #5226.24
-        jb        ..B1.108      # Prob 28%                      #5226.24
-                                # LOE edx esi edi
-..B1.102:                       # Preds ..B1.101
-        movl      24(%ebp), %eax                                #5227.9
-        testl     %eax, %eax                                    #5227.9
-        je        ..B1.104      # Prob 12%                      #5227.9
-                                # LOE edx esi edi
-..B1.103:                       # Preds ..B1.102
-        movl      24(%ebp), %eax                                #5227.18
-        movl      %edx, (%eax)                                  #5227.18
-                                # LOE esi edi
-..B1.104:                       # Preds ..B1.103 ..B1.102
-        movl      -4(%ebp), %eax                                #5218.5
-        movl      12(%ebp), %edx                                #5218.5
-        pushl     %esi                                          #5218.5
-        pushl     %eax                                          #5218.5
-        pushl     %edx                                          #5218.5
-        pushl     %edi                                          #5218.5
-        call      eval_2na_64                                   #5228.20
-                                # LOE eax
-..B1.130:                       # Preds ..B1.104
-        addl      $16, %esp                                     #5228.20
-                                # LOE eax
-..B1.105:                       # Preds ..B1.130
-        movl      -16(%ebp), %ebx                               #5228.20
-        movl      -12(%ebp), %esi                               #5228.20
-        movl      -8(%ebp), %edi                                #5228.20
-        movl      %ebp, %esp                                    #5228.20
-        popl      %ebp                                          #5228.20
-        ret                                                     #5228.20
-                                # LOE
-..B1.108:                       # Preds ..B1.14 ..B1.17 ..B1.18 ..B1.15 ..B1.8
-                                #       ..B1.32 ..B1.16 ..B1.5 ..B1.101 ..B1.94
-                                #       ..B1.87 ..B1.80 ..B1.73 ..B1.67 ..B1.60
-                                #       ..B1.53 ..B1.47 ..B1.41 ..B1.35 ..B1.23
-                                #       ..B1.3 ..B1.2
-        movl      -16(%ebp), %ebx                               #5311.12
-        movl      -12(%ebp), %esi                               #5311.12
-        movl      -8(%ebp), %edi                                #5311.12
-        xorl      %eax, %eax                                    #5311.12
-        movl      %ebp, %esp                                    #5311.12
-        popl      %ebp                                          #5311.12
-        ret                                                     #5311.12
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-.LNNucStrstrSearch:
-	.section .data1, "wa"
-	.align 4
-	.align 4
-..1..TPKT.30_0.0.0:
-	.long	..1.30_0.TAG.00.0.0
-	.long	..1.30_0.TAG.01.0.0
-	.long	..1.30_0.TAG.02.0.0
-	.long	..1.30_0.TAG.03.0.0
-	.long	..1.30_0.TAG.04.0.0
-	.long	..1.30_0.TAG.05.0.0
-	.long	..1.30_0.TAG.06.0.0
-	.long	..1.30_0.TAG.07.0.0
-	.long	..1.30_0.TAG.08.0.0
-	.long	..1.30_0.TAG.09.0.0
-	.long	..1.30_0.TAG.0a.0.0
-	.long	..1.30_0.TAG.0b.0.0
-	.long	..1.30_0.TAG.0c.0.0
-	.data
-# -- End  NucStrstrSearch
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    2,0x90
-eval_2na_64:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B2.1:                         # Preds ..B2.0
-        pushl     %ebx                                          #3075.1
-        movl      %esp, %ebx                                    #3075.1
-        andl      $-16, %esp                                    #3075.1
-        pushl     %ebp                                          #3075.1
-        pushl     %ebp                                          #3075.1
-        movl      4(%ebx), %ebp                                 #3075.1
-        movl      %ebp, 4(%esp)                                 #3075.1
-        movl      %esp, %ebp                                    #3075.1
-        subl      $120, %esp                                    #3075.1
-        movl      %ebx, -120(%ebp)                              #3075.1
-        movl      %edi, -40(%ebp)                               #3075.1
-        movl      %esi, -36(%ebp)                               #3075.1
-        movl      16(%ebx), %eax                                #3073.5
-        movl      %eax, -24(%ebp)                               #3073.5
-        call      ..L2          # Prob 100%                     #3075.1
-..L2:                                                           #
-        popl      %ecx                                          #3075.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L2], %ecx       #3075.1
-        lea       _gprof_pack1 at GOTOFF(%ecx), %edx               #3075.1
-        movl      %ecx, %ebx                                    #3075.1
-        call      mcount at PLT                                    #3075.1
-        movl      -120(%ebp), %ebx                              #3075.1
-                                # LOE
-..B2.51:                        # Preds ..B2.1
-        movl      20(%ebx), %edx                                #3113.5
-        movl      -24(%ebp), %eax                               #3113.5
-        movl      12(%ebx), %ecx                                #3116.30
-        lea       (%eax,%edx), %esi                             #3113.5
-        movl      %eax, %edi                                    #3116.49
-        shrl      $2, %edi                                      #3116.49
-        movl      %edi, -16(%ebp)                               #3116.49
-        lea       (%ecx,%edi), %edi                             #3116.30
-        movl      %edi, -20(%ebp)                               #3116.30
-        movl      8(%ebx), %edi                                 #3119.12
-        subl      4(%edi), %esi                                 #3119.12
-        movl      %esi, -28(%ebp)                               #3119.12
-        lea       3(%eax,%edx), %esi                            #3122.50
-        movl      -20(%ebp), %eax                               #3125.14
-        movl      -16(%ebp), %edx                               #3125.14
-        shrl      $2, %esi                                      #3122.57
-        addl      %ecx, %esi                                    #3122.30
-        testb     $15, %al                                      #3125.14
-        jne       ..B2.3        # Prob 50%                      #3125.14
-                                # LOE eax edx esi al dl ah dh
-..B2.2:                         # Preds ..B2.51
-        movdqa    (%eax), %xmm0                                 #3125.14
-        movdqa    %xmm0, -104(%ebp)                             #3125.14
-        jmp       ..B2.4        # Prob 100%                     #3125.14
-                                # LOE edx esi dl dh
-..B2.3:                         # Preds ..B2.51
-        movdqu    (%eax), %xmm0                                 #3125.14
-        movdqa    %xmm0, -104(%ebp)                             #3125.14
-                                # LOE edx esi dl dh
-..B2.4:                         # Preds ..B2.2 ..B2.3
-        movl      12(%ebx), %eax                                #3126.5
-        lea       16(%eax,%edx), %edx                           #3126.5
-        movl      %edx, -32(%ebp)                               #3126.5
-        cmpl      %esi, %edx                                    #3131.16
-        jae       ..B2.6        # Prob 12%                      #3131.16
-                                # LOE edx esi dl dh
-..B2.5:                         # Preds ..B2.4
-        movzbl    -1(%edx), %eax                                #3132.24
-        shll      $8, %eax                                      #3132.38
-        jmp       ..B2.7        # Prob 100%                     #3132.38
-                                # LOE eax edx esi dl dh
-..B2.6:                         # Preds ..B2.4
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx esi dl dh
-..B2.7:                         # Preds ..B2.5 ..B2.6
-        movl      8(%ebx), %ecx                                 #3136.5
-        movl      -24(%ebp), %edi                               #3148.20
-        movdqa    16(%ecx), %xmm6                               #3136.5
-        movdqa    32(%ecx), %xmm5                               #3136.5
-        movdqa    48(%ecx), %xmm7                               #3136.5
-        movdqa    64(%ecx), %xmm4                               #3136.5
-        movdqa    80(%ecx), %xmm3                               #3136.5
-        movdqa    96(%ecx), %xmm2                               #3136.5
-        movdqa    112(%ecx), %xmm0                              #3136.5
-        movdqa    128(%ecx), %xmm1                              #3136.5
-        andl      $3, %edi                                      #3148.20
-        je        ..B2.43       # Prob 20%                      #3148.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.8:                         # Preds ..B2.7
-        cmpl      $1, %edi                                      #3148.20
-        je        ..B2.14       # Prob 25%                      #3148.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.9:                         # Preds ..B2.8
-        cmpl      $2, %edi                                      #3148.20
-        je        ..B2.13       # Prob 33%                      #3148.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.10:                        # Preds ..B2.9
-        cmpl      $3, %edi                                      #3148.20
-        je        ..B2.12       # Prob 50%                      #3148.20
-                                # LOE eax edx esi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.11:                        # Preds ..B2.10
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -104(%ebp), %xmm0                             #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %esi, -48(%ebp)                               #
-        jmp       ..B2.35       # Prob 100%                     #
-                                # LOE eax edx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.12:                        # Preds ..B2.10
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -104(%ebp), %xmm0                             #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %esi, -48(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      %ecx, -56(%ebp)                               #
-        movl      %ecx, -52(%ebp)                               #
-        movl      %ecx, -44(%ebp)                               #
-        movl      $8, %ecx                                      #
-        jmp       ..B2.17       # Prob 100%                     #
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.13:                        # Preds ..B2.9
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -104(%ebp), %xmm0                             #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %esi, -48(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      %ecx, -52(%ebp)                               #
-        movl      %ecx, -44(%ebp)                               #
-        movl      $8, %ecx                                      #
-        jmp       ..B2.16       # Prob 100%                     #
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.14:                        # Preds ..B2.8
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -104(%ebp), %xmm0                             #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %esi, -48(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -44(%ebp)                               #
-        movl      $8, %ecx                                      #
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.15:                        # Preds ..B2.14 ..B2.39
-        movdqa    %xmm0, %xmm7                                  #3171.22
-        pand      %xmm4, %xmm7                                  #3171.22
-        pcmpeqd   -72(%ebp), %xmm7                              #3172.22
-        pmovmskb  %xmm7, %esi                                   #3173.22
-        movl      %esi, %edi                                    #3174.17
-        andl      $3855, %edi                                   #3174.17
-        shll      $4, %edi                                      #3174.17
-        andl      %edi, %esi                                    #3174.17
-        movl      %esi, %edi                                    #3174.17
-        sarl      $4, %edi                                      #3174.17
-        orl       %edi, %esi                                    #3174.17
-        movl      %esi, -52(%ebp)                               #3174.17
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.16:                        # Preds ..B2.13 ..B2.15
-        movdqa    %xmm0, %xmm7                                  #3177.22
-        pand      %xmm2, %xmm7                                  #3177.22
-        pcmpeqd   %xmm3, %xmm7                                  #3178.22
-        pmovmskb  %xmm7, %esi                                   #3179.22
-        movl      %esi, %edi                                    #3180.17
-        andl      $3855, %edi                                   #3180.17
-        shll      $4, %edi                                      #3180.17
-        andl      %edi, %esi                                    #3180.17
-        movl      %esi, %edi                                    #3180.17
-        sarl      $4, %edi                                      #3180.17
-        orl       %edi, %esi                                    #3180.17
-        movl      %esi, -56(%ebp)                               #3180.17
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.17:                        # Preds ..B2.12 ..B2.16
-        movdqa    %xmm0, %xmm7                                  #3183.22
-        pand      %xmm1, %xmm7                                  #3183.22
-        pcmpeqd   -88(%ebp), %xmm7                              #3184.22
-        pmovmskb  %xmm7, %esi                                   #3185.22
-        movl      %esi, %edi                                    #3186.17
-        andl      $3855, %edi                                   #3186.17
-        shll      $4, %edi                                      #3186.17
-        andl      %edi, %esi                                    #3186.17
-        movl      %esi, %edi                                    #3186.17
-        sarl      $4, %edi                                      #3186.17
-        orl       %edi, %esi                                    #3186.17
-        movl      -24(%ebp), %edi                               #3190.17
-        movl      %esi, -20(%ebp)                               #3186.17
-        andl      $-4, %edi                                     #3190.17
-        movl      %edi, -16(%ebp)                               #3190.17
-        movl      -44(%ebp), %edi                               #3193.29
-        orl       -52(%ebp), %edi                               #3193.29
-        orl       -56(%ebp), %edi                               #3193.34
-        orl       %esi, %edi                                    #3193.39
-        je        ..B2.26       # Prob 78%                      #3193.47
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.18:                        # Preds ..B2.17
-        movl      -44(%ebp), %edi                               #3211.58
-        movl      %ecx, -104(%ebp)                              #
-        movl      %edx, -100(%ebp)                              #
-        movl      %eax, -96(%ebp)                               #
-        movzwl    %di, %eax                                     #3211.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3211.30
-        movswl    %ax, %eax                                     #3211.30
-        movl      %eax, -24(%ebp)                               #3211.30
-        movl      -52(%ebp), %eax                               #3212.58
-        movzwl    %ax, %eax                                     #3212.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3212.30
-        movswl    %ax, %esi                                     #3212.30
-        movl      -56(%ebp), %eax                               #3213.58
-        movzwl    %ax, %eax                                     #3213.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3213.30
-        movswl    %ax, %ecx                                     #3213.30
-        movl      -20(%ebp), %eax                               #3214.58
-        movzwl    %ax, %eax                                     #3214.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3214.30
-        movswl    %ax, %edx                                     #3214.30
-        lea       1(,%esi,4), %eax                              #3220.40
-        movl      %eax, -116(%ebp)                              #3220.40
-        lea       2(,%ecx,4), %eax                              #3221.40
-        movl      -104(%ebp), %ecx                              #3226.32
-        testl     %edi, %edi                                    #3226.32
-        movl      %eax, -112(%ebp)                              #3221.40
-        lea       3(,%edx,4), %eax                              #3222.40
-        movl      -100(%ebp), %edx                              #3226.32
-        movl      %eax, -108(%ebp)                              #3222.40
-        movl      -96(%ebp), %eax                               #3226.32
-        je        ..B2.20       # Prob 50%                      #3226.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.19:                        # Preds ..B2.18
-        movl      -24(%ebp), %edi                               #3226.43
-        movl      -16(%ebp), %esi                               #3226.43
-        lea       (%esi,%edi,4), %edi                           #3226.43
-        movl      -28(%ebp), %esi                               #3226.49
-        cmpl      %edi, %esi                                    #3226.49
-        jae       ..B2.44       # Prob 1%                       #3226.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.20:                        # Preds ..B2.19 ..B2.18
-        movl      -52(%ebp), %esi                               #3227.32
-        testl     %esi, %esi                                    #3227.32
-        je        ..B2.22       # Prob 50%                      #3227.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.21:                        # Preds ..B2.20
-        movl      -116(%ebp), %edi                              #3227.43
-        addl      -16(%ebp), %edi                               #3227.43
-        movl      -28(%ebp), %esi                               #3227.49
-        cmpl      %edi, %esi                                    #3227.49
-        jae       ..B2.44       # Prob 1%                       #3227.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.22:                        # Preds ..B2.21 ..B2.20
-        movl      -56(%ebp), %esi                               #3228.32
-        testl     %esi, %esi                                    #3228.32
-        je        ..B2.24       # Prob 50%                      #3228.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.23:                        # Preds ..B2.22
-        movl      -112(%ebp), %edi                              #3228.43
-        addl      -16(%ebp), %edi                               #3228.43
-        movl      -28(%ebp), %esi                               #3228.49
-        cmpl      %edi, %esi                                    #3228.49
-        jae       ..B2.44       # Prob 1%                       #3228.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.24:                        # Preds ..B2.23 ..B2.22
-        movl      -20(%ebp), %esi                               #3229.32
-        testl     %esi, %esi                                    #3229.32
-        je        ..B2.26       # Prob 50%                      #3229.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.25:                        # Preds ..B2.24
-        movl      -108(%ebp), %edi                              #3229.43
-        addl      -16(%ebp), %edi                               #3229.43
-        movl      -28(%ebp), %esi                               #3229.49
-        cmpl      %edi, %esi                                    #3229.49
-        jae       ..B2.44       # Prob 1%                       #3229.49
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.26:                        # Preds ..B2.25 ..B2.24 ..B2.17
-        movl      -16(%ebp), %esi                               #3234.17
-        lea       4(%esi), %edi                                 #3234.17
-        movl      -28(%ebp), %esi                               #3237.28
-        movl      %edi, -24(%ebp)                               #3234.17
-        cmpl      %esi, %edi                                    #3237.28
-        ja        ..B2.41       # Prob 1%                       #3237.28
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.27:                        # Preds ..B2.26
-        addl      $-1, %ecx                                     #3241.25
-        jne       ..B2.36       # Prob 50%                      #3241.39
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.28:                        # Preds ..B2.27
-        movl      -48(%ebp), %ecx                               #3262.25
-        cmpl      %ecx, %edx                                    #3262.25
-        jae       ..B2.41       # Prob 1%                       #3262.25
-                                # LOE eax edx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.29:                        # Preds ..B2.28
-        movl      -16(%ebp), %ecx                               #3266.13
-        movl      %esi, %edi                                    #3267.24
-        lea       36(%ecx), %esi                                #3266.13
-        movl      %esi, -24(%ebp)                               #3266.13
-        cmpl      %edi, %esi                                    #3267.24
-        ja        ..B2.41       # Prob 1%                       #3267.24
-                                # LOE eax edx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.30:                        # Preds ..B2.29
-        testb     $15, %dl                                      #3272.22
-        jne       ..B2.32       # Prob 50%                      #3272.22
-                                # LOE eax edx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.31:                        # Preds ..B2.30
-        movdqa    (%edx), %xmm0                                 #3272.22
-        jmp       ..B2.33       # Prob 100%                     #3272.22
-                                # LOE eax edx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.32:                        # Preds ..B2.30
-        movdqu    (%edx), %xmm0                                 #3272.22
-                                # LOE eax edx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.33:                        # Preds ..B2.31 ..B2.32
-        movl      -48(%ebp), %ecx                               #3353.24
-        addl      $16, %edx                                     #3350.13
-        movl      %edx, -32(%ebp)                               #3350.13
-        cmpl      %ecx, %edx                                    #3353.24
-        jae       ..B2.35       # Prob 12%                      #3353.24
-                                # LOE eax edx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.34:                        # Preds ..B2.33
-        movzbl    -1(%edx), %eax                                #3354.32
-        shll      $8, %eax                                      #3354.46
-                                # LOE eax edx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.35:                        # Preds ..B2.33 ..B2.11 ..B2.34
-        movl      $8, %ecx                                      #3155.13
-        jmp       ..B2.39       # Prob 100%                     #3155.13
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.36:                        # Preds ..B2.27
-        movl      -32(%ebp), %esi                               #3249.26
-        movl      -48(%ebp), %edi                               #3249.26
-        psrldq    $1, %xmm0                                     #3246.26
-        cmpl      %edi, %esi                                    #3249.26
-        jae       ..B2.38       # Prob 19%                      #3249.26
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.37:                        # Preds ..B2.36
-        movzbl    (%esi), %edi                                  #3252.37
-        sarl      $8, %eax                                      #3251.21
-        shll      $8, %edi                                      #3252.48
-        orl       %edi, %eax                                    #3252.21
-        pinsrw    $7, %eax, %xmm0                               #3253.30
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.38:                        # Preds ..B2.37 ..B2.36
-        addl      $1, -32(%ebp)                                 #3257.20
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.39:                        # Preds ..B2.35 ..B2.38 ..B2.43
-        movdqa    %xmm0, %xmm7                                  #3165.22
-        pand      %xmm5, %xmm7                                  #3165.22
-        pcmpeqd   %xmm6, %xmm7                                  #3166.22
-        pmovmskb  %xmm7, %esi                                   #3167.22
-        movl      %esi, %edi                                    #3168.17
-        andl      $3855, %edi                                   #3168.17
-        shll      $4, %edi                                      #3168.17
-        andl      %edi, %esi                                    #3168.17
-        movl      %esi, %edi                                    #3168.17
-        sarl      $4, %edi                                      #3168.17
-        orl       %edi, %esi                                    #3168.17
-        movl      %esi, -44(%ebp)                               #3168.17
-        jmp       ..B2.15       # Prob 100%                     #3168.17
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.41:                        # Preds ..B2.26 ..B2.28 ..B2.29 # Infreq
-        movl      -36(%ebp), %esi                               #3363.12
-        movl      -40(%ebp), %edi                               #3363.12
-        xorl      %eax, %eax                                    #3363.12
-        movl      %ebp, %esp                                    #3363.12
-        popl      %ebp                                          #3363.12
-        movl      %ebx, %esp                                    #3363.12
-        popl      %ebx                                          #3363.12
-        ret                                                     #3363.12
-                                # LOE
-..B2.43:                        # Preds ..B2.7                  # Infreq
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -104(%ebp), %xmm0                             #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %esi, -48(%ebp)                               #
-        movl      $8, %ecx                                      #
-        jmp       ..B2.39       # Prob 100%                     #
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.44:                        # Preds ..B2.21 ..B2.19 ..B2.25 ..B2.23 # Infreq
-        movl      -36(%ebp), %esi                               #3228.63
-        movl      -40(%ebp), %edi                               #3228.63
-        movl      $1, %eax                                      #3228.63
-        movl      %ebp, %esp                                    #3228.63
-        popl      %ebp                                          #3228.63
-        movl      %ebx, %esp                                    #3228.63
-        popl      %ebx                                          #3228.63
-        ret                                                     #3228.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-.LNeval_2na_64:
-	.data
-# -- End  eval_2na_64
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    2,0x90
-eval_4na_64:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B3.1:                         # Preds ..B3.0
-        pushl     %ebx                                          #4501.1
-        movl      %esp, %ebx                                    #4501.1
-        andl      $-16, %esp                                    #4501.1
-        pushl     %ebp                                          #4501.1
-        pushl     %ebp                                          #4501.1
-        movl      4(%ebx), %ebp                                 #4501.1
-        movl      %ebp, 4(%esp)                                 #4501.1
-        movl      %esp, %ebp                                    #4501.1
-        subl      $152, %esp                                    #4501.1
-        movl      %ebx, -152(%ebp)                              #4501.1
-        movl      %edi, -44(%ebp)                               #4501.1
-        movl      %esi, -40(%ebp)                               #4501.1
-        movl      12(%ebx), %ecx                                #4499.5
-        movl      16(%ebx), %esi                                #4499.5
-        call      ..L3          # Prob 100%                     #4501.1
-..L3:                                                           #
-        popl      %edi                                          #4501.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L3], %edi       #4501.1
-        lea       _gprof_pack2 at GOTOFF(%edi), %edx               #4501.1
-        movl      %edi, %ebx                                    #4501.1
-        call      mcount at PLT                                    #4501.1
-        movl      -152(%ebp), %ebx                              #4501.1
-                                # LOE esi edi
-..B3.41:                        # Preds ..B3.1
-        movl      12(%ebx), %ecx                                #
-        movl      %esi, -24(%ebp)                               #
-        movl      %esi, %eax                                    #4538.49
-        movl      %edi, -16(%ebp)                               #
-        shrl      $2, %eax                                      #4538.49
-        movl      20(%ebx), %edi                                #4535.5
-        movl      %eax, -20(%ebp)                               #4538.49
-        movl      8(%ebx), %eax                                 #4541.12
-        movdqa    16(%eax), %xmm5                               #4554.5
-        movdqa    32(%eax), %xmm4                               #4554.5
-        movdqa    48(%eax), %xmm3                               #4554.5
-        movdqa    64(%eax), %xmm6                               #4554.5
-        movdqa    80(%eax), %xmm2                               #4554.5
-        movdqa    96(%eax), %xmm1                               #4554.5
-        movdqa    128(%eax), %xmm7                              #4554.5
-        lea       (%esi,%edi), %edx                             #4535.5
-        subl      4(%eax), %edx                                 #4541.12
-        movl      %edx, -32(%ebp)                               #4541.12
-        lea       3(%esi,%edi), %edx                            #4544.50
-        shrl      $2, %edx                                      #4544.57
-        movl      -20(%ebp), %esi                               #4547.14
-        movl      -16(%ebp), %edi                               #4547.14
-        addl      %ecx, %edx                                    #4544.30
-        movl      %edx, -36(%ebp)                               #4544.30
-        movzbl    (%esi,%ecx), %edx                             #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -148(%ebp)                               #4547.14
-        movzbl    1(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -146(%ebp)                               #4547.14
-        movzbl    2(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -144(%ebp)                               #4547.14
-        movzbl    3(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -142(%ebp)                               #4547.14
-        movzbl    4(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -140(%ebp)                               #4547.14
-        movzbl    5(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -138(%ebp)                               #4547.14
-        movzbl    6(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -136(%ebp)                               #4547.14
-        movzbl    7(%esi,%ecx), %edx                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4547.14
-        movw      %dx, -134(%ebp)                               #4547.14
-        movdqu    -148(%ebp), %xmm0                             #4547.14
-        lea       8(%ecx,%esi), %edx                            #4548.5
-        movl      -24(%ebp), %esi                               #4568.20
-        movdqa    %xmm0, -120(%ebp)                             #4547.14
-        movdqa    112(%eax), %xmm0                              #4554.5
-        movl      %esi, %eax                                    #4568.20
-        movl      %edx, -28(%ebp)                               #4548.5
-        andl      $3, %eax                                      #4568.20
-        je        ..B3.33       # Prob 20%                      #4568.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.2:                         # Preds ..B3.41
-        cmpl      $1, %eax                                      #4568.20
-        je        ..B3.8        # Prob 25%                      #4568.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.3:                         # Preds ..B3.2
-        cmpl      $2, %eax                                      #4568.20
-        je        ..B3.7        # Prob 33%                      #4568.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.4:                         # Preds ..B3.3
-        cmpl      $3, %eax                                      #4568.20
-        je        ..B3.6        # Prob 50%                      #4568.20
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.5:                         # Preds ..B3.4
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -88(%ebp)                              #
-        movl      %edi, -16(%ebp)                               #
-        jmp       ..B3.25       # Prob 100%                     #
-                                # LOE edx esi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.6:                         # Preds ..B3.4
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -88(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -56(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      $4, %eax                                      #
-        movl      %ecx, -52(%ebp)                               #
-        movl      %ecx, -48(%ebp)                               #
-        jmp       ..B3.11       # Prob 100%                     #
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.7:                         # Preds ..B3.3
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -88(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -52(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      $4, %eax                                      #
-        movl      %ecx, -48(%ebp)                               #
-        jmp       ..B3.10       # Prob 100%                     #
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.8:                         # Preds ..B3.2
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -88(%ebp)                              #
-        xorl      %ecx, %ecx                                    #
-        movl      %ecx, -48(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        movl      $4, %eax                                      #
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.9:                         # Preds ..B3.8 ..B3.29
-        movdqa    %xmm0, %xmm7                                  #4592.22
-        movdqa    %xmm0, %xmm6                                  #4593.22
-        pand      -88(%ebp), %xmm6                              #4593.22
-        pand      %xmm3, %xmm7                                  #4592.22
-        pcmpeqd   %xmm6, %xmm7                                  #4594.22
-        pmovmskb  %xmm7, %ecx                                   #4595.22
-        movl      %ecx, %edi                                    #4596.17
-        andl      $3855, %edi                                   #4596.17
-        shll      $4, %edi                                      #4596.17
-        andl      %edi, %ecx                                    #4596.17
-        movl      %ecx, %edi                                    #4596.17
-        sarl      $4, %edi                                      #4596.17
-        orl       %edi, %ecx                                    #4596.17
-        movl      %ecx, -52(%ebp)                               #4596.17
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.10:                        # Preds ..B3.7 ..B3.9
-        movdqa    %xmm0, %xmm7                                  #4599.22
-        movdqa    %xmm0, %xmm6                                  #4600.22
-        pand      %xmm2, %xmm7                                  #4599.22
-        pand      %xmm1, %xmm6                                  #4600.22
-        pcmpeqd   %xmm6, %xmm7                                  #4601.22
-        pmovmskb  %xmm7, %ecx                                   #4602.22
-        movl      %ecx, %edi                                    #4603.17
-        andl      $3855, %edi                                   #4603.17
-        shll      $4, %edi                                      #4603.17
-        andl      %edi, %ecx                                    #4603.17
-        movl      %ecx, %edi                                    #4603.17
-        sarl      $4, %edi                                      #4603.17
-        orl       %edi, %ecx                                    #4603.17
-        movl      %ecx, -56(%ebp)                               #4603.17
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.11:                        # Preds ..B3.6 ..B3.10
-        movdqa    %xmm0, %xmm7                                  #4606.22
-        movdqa    %xmm0, %xmm6                                  #4607.22
-        pand      -72(%ebp), %xmm7                              #4606.22
-        pand      -104(%ebp), %xmm6                             #4607.22
-        pcmpeqd   %xmm6, %xmm7                                  #4608.22
-        pmovmskb  %xmm7, %edi                                   #4609.22
-        movl      %edi, %ecx                                    #4610.17
-        andl      $3855, %ecx                                   #4610.17
-        shll      $4, %ecx                                      #4610.17
-        andl      %ecx, %edi                                    #4610.17
-        movl      %edi, %ecx                                    #4610.17
-        sarl      $4, %ecx                                      #4610.17
-        orl       %ecx, %edi                                    #4610.17
-        movl      %edi, -20(%ebp)                               #4610.17
-        movl      %esi, %ecx                                    #4614.17
-        andl      $-4, %ecx                                     #4614.17
-        movl      -48(%ebp), %esi                               #4617.29
-        orl       -52(%ebp), %esi                               #4617.29
-        orl       -56(%ebp), %esi                               #4617.34
-        orl       %edi, %esi                                    #4617.39
-        je        ..B3.20       # Prob 78%                      #4617.47
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.12:                        # Preds ..B3.11
-        movl      -48(%ebp), %edi                               #4635.58
-        movl      %ecx, -120(%ebp)                              #
-        movl      %eax, -116(%ebp)                              #
-        movzwl    %di, %eax                                     #4635.58
-        movl      %edx, -112(%ebp)                              #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4635.30
-        movswl    %ax, %eax                                     #4635.30
-        movl      %eax, -132(%ebp)                              #4635.30
-        movl      -52(%ebp), %eax                               #4636.58
-        movzwl    %ax, %eax                                     #4636.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4636.30
-        movswl    %ax, %esi                                     #4636.30
-        movl      -56(%ebp), %eax                               #4637.58
-        movzwl    %ax, %eax                                     #4637.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4637.30
-        movswl    %ax, %ecx                                     #4637.30
-        movl      -20(%ebp), %eax                               #4638.58
-        movzwl    %ax, %eax                                     #4638.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4638.30
-        movswl    %ax, %edx                                     #4638.30
-        lea       1(%esi,%esi), %eax                            #4644.40
-        movl      %eax, -128(%ebp)                              #4644.40
-        lea       2(%ecx,%ecx), %eax                            #4645.40
-        movl      -120(%ebp), %ecx                              #4650.32
-        testl     %edi, %edi                                    #4650.32
-        movl      %eax, -124(%ebp)                              #4645.40
-        lea       3(%edx,%edx), %eax                            #4646.40
-        movl      -112(%ebp), %edx                              #4650.32
-        movl      %eax, -24(%ebp)                               #4646.40
-        movl      -116(%ebp), %eax                              #4650.32
-        je        ..B3.14       # Prob 50%                      #4650.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.13:                        # Preds ..B3.12
-        movl      -132(%ebp), %esi                              #4650.43
-        movl      -32(%ebp), %edi                               #4650.49
-        lea       (%ecx,%esi,2), %esi                           #4650.43
-        cmpl      %esi, %edi                                    #4650.49
-        jae       ..B3.34       # Prob 1%                       #4650.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.14:                        # Preds ..B3.13 ..B3.12
-        movl      -52(%ebp), %esi                               #4651.32
-        testl     %esi, %esi                                    #4651.32
-        je        ..B3.16       # Prob 50%                      #4651.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.15:                        # Preds ..B3.14
-        movl      -128(%ebp), %edi                              #4651.43
-        movl      -32(%ebp), %esi                               #4651.49
-        addl      %ecx, %edi                                    #4651.43
-        cmpl      %edi, %esi                                    #4651.49
-        jae       ..B3.34       # Prob 1%                       #4651.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.16:                        # Preds ..B3.15 ..B3.14
-        movl      -56(%ebp), %esi                               #4652.32
-        testl     %esi, %esi                                    #4652.32
-        je        ..B3.18       # Prob 50%                      #4652.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.17:                        # Preds ..B3.16
-        movl      -124(%ebp), %edi                              #4652.43
-        movl      -32(%ebp), %esi                               #4652.49
-        addl      %ecx, %edi                                    #4652.43
-        cmpl      %edi, %esi                                    #4652.49
-        jae       ..B3.34       # Prob 1%                       #4652.49
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.18:                        # Preds ..B3.17 ..B3.16
-        movl      -20(%ebp), %esi                               #4653.32
-        testl     %esi, %esi                                    #4653.32
-        je        ..B3.20       # Prob 50%                      #4653.32
-                                # LOE eax edx ecx al dl cl ah dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.19:                        # Preds ..B3.18
-        movl      -24(%ebp), %edi                               #4653.43
-        movl      -32(%ebp), %esi                               #4653.49
-        addl      %ecx, %edi                                    #4653.43
-        cmpl      %edi, %esi                                    #4653.49
-        jae       ..B3.34       # Prob 1%                       #4653.49
-                                # LOE eax edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.20:                        # Preds ..B3.19 ..B3.18 ..B3.11
-        movl      -32(%ebp), %edi                               #4661.28
-        lea       4(%ecx), %esi                                 #4658.17
-        cmpl      %edi, %esi                                    #4661.28
-        ja        ..B3.31       # Prob 1%                       #4661.28
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.21:                        # Preds ..B3.20
-        addl      $-1, %eax                                     #4665.25
-        jne       ..B3.26       # Prob 50%                      #4665.39
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.22:                        # Preds ..B3.21
-        movl      -36(%ebp), %eax                               #4682.25
-        cmpl      %eax, %edx                                    #4682.25
-        jae       ..B3.31       # Prob 1%                       #4682.25
-                                # LOE edx ecx edi xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.23:                        # Preds ..B3.22
-        movl      %edi, %eax                                    #4687.24
-        lea       20(%ecx), %esi                                #4686.13
-        cmpl      %eax, %esi                                    #4687.24
-        ja        ..B3.31       # Prob 1%                       #4687.24
-                                # LOE edx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.24:                        # Preds ..B3.23
-        movl      -16(%ebp), %eax                               #4692.22
-        movzbl    (%edx), %ecx                                  #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %edi        #4692.22
-        movzbl    1(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %di, -148(%ebp)                               #4692.22
-        movw      %cx, -146(%ebp)                               #4692.22
-        movzbl    2(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %cx, -144(%ebp)                               #4692.22
-        movzbl    3(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %cx, -142(%ebp)                               #4692.22
-        movzbl    4(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %cx, -140(%ebp)                               #4692.22
-        movzbl    5(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %cx, -138(%ebp)                               #4692.22
-        movzbl    6(%edx), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4692.22
-        movw      %cx, -136(%ebp)                               #4692.22
-        movzbl    7(%edx), %ecx                                 #4692.22
-        addl      $8, %edx                                      #4707.13
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %eax        #4692.22
-        movw      %ax, -134(%ebp)                               #4692.22
-        movdqu    -148(%ebp), %xmm0                             #4692.22
-        movl      %edx, -28(%ebp)                               #4707.13
-                                # LOE edx esi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.25:                        # Preds ..B3.5 ..B3.24
-        movl      $4, %eax                                      #4575.13
-        jmp       ..B3.29       # Prob 100%                     #4575.13
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.26:                        # Preds ..B3.21
-        movl      -36(%ebp), %edi                               #4673.26
-        movl      -28(%ebp), %ecx                               #4673.26
-        psrldq    $2, %xmm0                                     #4670.26
-        cmpl      %edi, %ecx                                    #4673.26
-        jae       ..B3.28       # Prob 19%                      #4673.26
-                                # LOE eax edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.27:                        # Preds ..B3.26
-        movl      -16(%ebp), %edi                               #4674.57
-        movzbl    (%ecx), %ecx                                  #4674.72
-        movzwl    expand_2na.0 at GOTOFF(%edi,%ecx,2), %ecx        #4674.57
-        pinsrw    $7, %ecx, %xmm0                               #4674.30
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.28:                        # Preds ..B3.27 ..B3.26
-        addl      $1, -28(%ebp)                                 #4677.20
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.29:                        # Preds ..B3.25 ..B3.28 ..B3.33
-        movdqa    %xmm0, %xmm7                                  #4585.22
-        movdqa    %xmm0, %xmm6                                  #4586.22
-        pand      %xmm5, %xmm7                                  #4585.22
-        pand      %xmm4, %xmm6                                  #4586.22
-        pcmpeqd   %xmm6, %xmm7                                  #4587.22
-        pmovmskb  %xmm7, %ecx                                   #4588.22
-        movl      %ecx, %edi                                    #4589.17
-        andl      $3855, %edi                                   #4589.17
-        shll      $4, %edi                                      #4589.17
-        andl      %edi, %ecx                                    #4589.17
-        movl      %ecx, %edi                                    #4589.17
-        sarl      $4, %edi                                      #4589.17
-        orl       %edi, %ecx                                    #4589.17
-        movl      %ecx, -48(%ebp)                               #4589.17
-        jmp       ..B3.9        # Prob 100%                     #4589.17
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.31:                        # Preds ..B3.20 ..B3.22 ..B3.23 # Infreq
-        movl      -40(%ebp), %esi                               #4718.12
-        movl      -44(%ebp), %edi                               #4718.12
-        xorl      %eax, %eax                                    #4718.12
-        movl      %ebp, %esp                                    #4718.12
-        popl      %ebp                                          #4718.12
-        movl      %ebx, %esp                                    #4718.12
-        popl      %ebx                                          #4718.12
-        ret                                                     #4718.12
-                                # LOE
-..B3.33:                        # Preds ..B3.41                 # Infreq
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -88(%ebp)                              #
-        movl      $4, %eax                                      #
-        movl      %edi, -16(%ebp)                               #
-        jmp       ..B3.29       # Prob 100%                     #
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.34:                        # Preds ..B3.13 ..B3.19 ..B3.17 ..B3.15 # Infreq
-        movl      -40(%ebp), %esi                               #4651.63
-        movl      -44(%ebp), %edi                               #4651.63
-        movl      $1, %eax                                      #4651.63
-        movl      %ebp, %esp                                    #4651.63
-        popl      %ebp                                          #4651.63
-        movl      %ebx, %esp                                    #4651.63
-        popl      %ebx                                          #4651.63
-        ret                                                     #4651.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-.LNeval_4na_64:
-	.data
-# -- End  eval_4na_64
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    2,0x90
-eval_2na_8:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B4.1:                         # Preds ..B4.0
-        pushl     %ebx                                          #2196.1
-        movl      %esp, %ebx                                    #2196.1
-        andl      $-16, %esp                                    #2196.1
-        pushl     %ebp                                          #2196.1
-        pushl     %ebp                                          #2196.1
-        movl      4(%ebx), %ebp                                 #2196.1
-        movl      %ebp, 4(%esp)                                 #2196.1
-        movl      %esp, %ebp                                    #2196.1
-        subl      $88, %esp                                     #2196.1
-        movl      %ebx, -88(%ebp)                               #2196.1
-        movl      %edi, -16(%ebp)                               #2196.1
-        movl      %esi, -12(%ebp)                               #2196.1
-        movl      16(%ebx), %esi                                #2194.5
-        call      ..L4          # Prob 100%                     #2196.1
-..L4:                                                           #
-        popl      %eax                                          #2196.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L4], %eax       #2196.1
-        lea       _gprof_pack3 at GOTOFF(%eax), %edx               #2196.1
-        movl      %eax, %ebx                                    #2196.1
-        call      mcount at PLT                                    #2196.1
-        movl      -88(%ebp), %ebx                               #2196.1
-                                # LOE esi
-..B4.41:                        # Preds ..B4.1
-        movl      20(%ebx), %eax                                #2233.5
-        movl      12(%ebx), %ecx                                #2236.30
-        lea       (%esi,%eax), %edx                             #2233.5
-        movl      %esi, %edi                                    #2236.49
-        shrl      $2, %edi                                      #2236.49
-        lea       3(%esi,%eax), %eax                            #2242.50
-        movl      %edi, -4(%ebp)                                #2236.49
-        lea       (%ecx,%edi), %edi                             #2236.30
-        movl      %edi, -8(%ebp)                                #2236.30
-        shrl      $2, %eax                                      #2242.57
-        movl      8(%ebx), %edi                                 #2239.12
-        subl      4(%edi), %edx                                 #2239.12
-        movl      -8(%ebp), %edi                                #2245.14
-        addl      %ecx, %eax                                    #2242.30
-        testl     $15, %edi                                     #2245.14
-        movl      -4(%ebp), %ecx                                #2245.14
-        jne       ..B4.3        # Prob 50%                      #2245.14
-                                # LOE eax edx ecx esi edi cl ch
-..B4.2:                         # Preds ..B4.41
-        movdqa    (%edi), %xmm6                                 #2245.14
-        jmp       ..B4.4        # Prob 100%                     #2245.14
-                                # LOE eax edx ecx esi cl ch xmm6
-..B4.3:                         # Preds ..B4.41
-        movdqu    (%edi), %xmm6                                 #2245.14
-                                # LOE eax edx ecx esi cl ch xmm6
-..B4.4:                         # Preds ..B4.2 ..B4.3
-        movl      12(%ebx), %edi                                #2246.5
-        lea       16(%edi,%ecx), %ecx                           #2246.5
-        movl      8(%ebx), %edi                                 #2256.5
-        movdqa    16(%edi), %xmm0                               #2256.5
-        movdqa    32(%edi), %xmm5                               #2256.5
-        movdqa    48(%edi), %xmm4                               #2256.5
-        movdqa    64(%edi), %xmm3                               #2256.5
-        movdqa    80(%edi), %xmm2                               #2256.5
-        movdqa    96(%edi), %xmm1                               #2256.5
-        movdqa    128(%edi), %xmm7                              #2256.5
-        movdqa    %xmm0, -40(%ebp)                              #2256.5
-        movdqa    112(%edi), %xmm0                              #2256.5
-        movdqa    %xmm7, -56(%ebp)                              #2256.5
-        movl      %esi, %edi                                    #2268.20
-        andl      $3, %edi                                      #2268.20
-        je        ..B4.8        # Prob 20%                      #2268.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.5:                         # Preds ..B4.4
-        cmpl      $1, %edi                                      #2268.20
-        je        ..B4.11       # Prob 25%                      #2268.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.6:                         # Preds ..B4.5
-        cmpl      $2, %edi                                      #2268.20
-        je        ..B4.10       # Prob 33%                      #2268.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.7:                         # Preds ..B4.6
-        cmpl      $3, %edi                                      #2268.20
-        je        ..B4.9        # Prob 50%                      #2268.20
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.8:                         # Preds ..B4.4 ..B4.7
-        movl      %eax, -20(%ebp)                               #
-        jmp       ..B4.30       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.9:                         # Preds ..B4.7
-        movl      %eax, -20(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -60(%ebp)                               #
-        movl      %edi, -24(%ebp)                               #
-        movl      %edi, -4(%ebp)                                #
-        jmp       ..B4.14       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.10:                        # Preds ..B4.6
-        movl      %eax, -20(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -24(%ebp)                               #
-        movl      %edi, -4(%ebp)                                #
-        jmp       ..B4.13       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.11:                        # Preds ..B4.5
-        movl      %eax, -20(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -4(%ebp)                                #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.12:                        # Preds ..B4.11 ..B4.30
-        movdqa    %xmm6, %xmm7                                  #2291.22
-        pand      %xmm3, %xmm7                                  #2291.22
-        pcmpeqb   %xmm4, %xmm7                                  #2292.22
-        pmovmskb  %xmm7, %eax                                   #2293.22
-        movl      %eax, -24(%ebp)                               #2293.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.13:                        # Preds ..B4.10 ..B4.12
-        movdqa    %xmm6, %xmm7                                  #2297.22
-        pand      %xmm1, %xmm7                                  #2297.22
-        pcmpeqb   %xmm2, %xmm7                                  #2298.22
-        pmovmskb  %xmm7, %eax                                   #2299.22
-        movl      %eax, -60(%ebp)                               #2299.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.14:                        # Preds ..B4.9 ..B4.13
-        pand      -56(%ebp), %xmm6                              #2303.22
-        movl      -4(%ebp), %edi                                #2313.29
-        pcmpeqb   %xmm0, %xmm6                                  #2304.22
-        pmovmskb  %xmm6, %eax                                   #2305.22
-        movl      %eax, -8(%ebp)                                #2305.22
-        andl      $-4, %esi                                     #2310.17
-        orl       -24(%ebp), %edi                               #2313.29
-        orl       -60(%ebp), %edi                               #2313.34
-        orl       %eax, %edi                                    #2313.39
-        je        ..B4.23       # Prob 78%                      #2313.47
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.15:                        # Preds ..B4.14
-        movl      -4(%ebp), %edi                                #2331.30
-        movl      %esi, -68(%ebp)                               #
-        movl      %edi, %eax                                    #2331.30
-        movl      %ecx, -64(%ebp)                               #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2331.30
-        movswl    %ax, %ecx                                     #2331.30
-        movl      -24(%ebp), %eax                               #2332.30
-        movl      %ecx, -84(%ebp)                               #2331.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2332.30
-        movswl    %ax, %ecx                                     #2332.30
-        movl      -60(%ebp), %eax                               #2333.30
-        lea       1(,%ecx,4), %ecx                              #2340.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2333.30
-        movswl    %ax, %esi                                     #2333.30
-        movl      -8(%ebp), %eax                                #2334.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2334.30
-        movl      %ecx, -80(%ebp)                               #2340.40
-        movswl    %ax, %eax                                     #2334.30
-        lea       2(,%esi,4), %ecx                              #2341.40
-        movl      -68(%ebp), %esi                               #2346.32
-        movl      %ecx, -76(%ebp)                               #2341.40
-        lea       3(,%eax,4), %ecx                              #2342.40
-        movl      %ecx, -72(%ebp)                               #2342.40
-        movl      -64(%ebp), %ecx                               #2346.32
-        testl     %edi, %edi                                    #2346.32
-        je        ..B4.17       # Prob 50%                      #2346.32
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.16:                        # Preds ..B4.15
-        movl      -84(%ebp), %eax                               #2346.43
-        lea       (%esi,%eax,4), %edi                           #2346.43
-        cmpl      %edi, %edx                                    #2346.49
-        jae       ..B4.34       # Prob 1%                       #2346.49
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.17:                        # Preds ..B4.16 ..B4.15
-        movl      -24(%ebp), %eax                               #2347.32
-        testl     %eax, %eax                                    #2347.32
-        je        ..B4.19       # Prob 50%                      #2347.32
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.18:                        # Preds ..B4.17
-        movl      -80(%ebp), %eax                               #2347.43
-        addl      %esi, %eax                                    #2347.43
-        cmpl      %eax, %edx                                    #2347.49
-        jae       ..B4.35       # Prob 1%                       #2347.49
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.19:                        # Preds ..B4.18 ..B4.17
-        movl      -60(%ebp), %eax                               #2348.32
-        testl     %eax, %eax                                    #2348.32
-        je        ..B4.21       # Prob 50%                      #2348.32
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.20:                        # Preds ..B4.19
-        movl      -76(%ebp), %eax                               #2348.43
-        addl      %esi, %eax                                    #2348.43
-        cmpl      %eax, %edx                                    #2348.49
-        jae       ..B4.35       # Prob 1%                       #2348.49
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.21:                        # Preds ..B4.20 ..B4.19
-        movl      -8(%ebp), %eax                                #2349.32
-        testl     %eax, %eax                                    #2349.32
-        je        ..B4.23       # Prob 50%                      #2349.32
-                                # LOE edx ecx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.22:                        # Preds ..B4.21
-        movl      -72(%ebp), %eax                               #2349.43
-        addl      %esi, %eax                                    #2349.43
-        cmpl      %eax, %edx                                    #2349.49
-        jae       ..B4.35       # Prob 1%                       #2349.49
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.23:                        # Preds ..B4.22 ..B4.21 ..B4.14
-        lea       4(%esi), %eax                                 #2386.13
-        cmpl      %eax, %edx                                    #2357.28
-        jb        ..B4.32       # Prob 1%                       #2357.28
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.24:                        # Preds ..B4.23
-        movl      -20(%ebp), %eax                               #2382.25
-        cmpl      %eax, %ecx                                    #2382.25
-        jae       ..B4.32       # Prob 1%                       #2382.25
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.25:                        # Preds ..B4.24
-        addl      $64, %esi                                     #2386.13
-        cmpl      %edx, %esi                                    #2387.24
-        ja        ..B4.32       # Prob 1%                       #2387.24
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.26:                        # Preds ..B4.25
-        testb     $15, %cl                                      #2392.22
-        jne       ..B4.28       # Prob 50%                      #2392.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B4.27:                        # Preds ..B4.26
-        movdqa    (%ecx), %xmm6                                 #2392.22
-        jmp       ..B4.29       # Prob 100%                     #2392.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.28:                        # Preds ..B4.26
-        movdqu    (%ecx), %xmm6                                 #2392.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.29:                        # Preds ..B4.27 ..B4.28
-        addl      $16, %ecx                                     #2470.13
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.30:                        # Preds ..B4.29 ..B4.8
-        movdqa    %xmm6, %xmm7                                  #2285.22
-        pand      %xmm5, %xmm7                                  #2285.22
-        pcmpeqb   -40(%ebp), %xmm7                              #2286.22
-        pmovmskb  %xmm7, %eax                                   #2287.22
-        movl      %eax, -4(%ebp)                                #2287.22
-        jmp       ..B4.12       # Prob 100%                     #2287.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.32:                        # Preds ..B4.23 ..B4.24 ..B4.25 # Infreq
-        movl      -12(%ebp), %esi                               #2483.12
-        movl      -16(%ebp), %edi                               #2483.12
-        xorl      %eax, %eax                                    #2483.12
-        movl      %ebp, %esp                                    #2483.12
-        popl      %ebp                                          #2483.12
-        movl      %ebx, %esp                                    #2483.12
-        popl      %ebx                                          #2483.12
-        ret                                                     #2483.12
-                                # LOE
-..B4.34:                        # Preds ..B4.16                 # Infreq
-        movl      -12(%ebp), %esi                               #2346.63
-        movl      -16(%ebp), %edi                               #2346.63
-        movl      $1, %eax                                      #2346.63
-        movl      %ebp, %esp                                    #2346.63
-        popl      %ebp                                          #2346.63
-        movl      %ebx, %esp                                    #2346.63
-        popl      %ebx                                          #2346.63
-        ret                                                     #2346.63
-                                # LOE
-..B4.35:                        # Preds ..B4.22 ..B4.20 ..B4.18 # Infreq
-        movl      -12(%ebp), %esi                               #2347.63
-        movl      -16(%ebp), %edi                               #2347.63
-        movl      $1, %eax                                      #2347.63
-        movl      %ebp, %esp                                    #2347.63
-        popl      %ebp                                          #2347.63
-        movl      %ebx, %esp                                    #2347.63
-        popl      %ebx                                          #2347.63
-        ret                                                     #2347.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-.LNeval_2na_8:
-	.data
-# -- End  eval_2na_8
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    2,0x90
-eval_2na_16:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B5.1:                         # Preds ..B5.0
-        pushl     %ebx                                          #2489.1
-        movl      %esp, %ebx                                    #2489.1
-        andl      $-16, %esp                                    #2489.1
-        pushl     %ebp                                          #2489.1
-        pushl     %ebp                                          #2489.1
-        movl      4(%ebx), %ebp                                 #2489.1
-        movl      %ebp, 4(%esp)                                 #2489.1
-        movl      %esp, %ebp                                    #2489.1
-        subl      $104, %esp                                    #2489.1
-        movl      %ebx, -104(%ebp)                              #2489.1
-        movl      %edi, -28(%ebp)                               #2489.1
-        movl      %esi, -24(%ebp)                               #2489.1
-        movl      16(%ebx), %eax                                #2487.5
-        movl      %eax, -12(%ebp)                               #2487.5
-        call      ..L5          # Prob 100%                     #2489.1
-..L5:                                                           #
-        popl      %ecx                                          #2489.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L5], %ecx       #2489.1
-        lea       _gprof_pack4 at GOTOFF(%ecx), %edx               #2489.1
-        movl      %ecx, %ebx                                    #2489.1
-        call      mcount at PLT                                    #2489.1
-        movl      -104(%ebp), %ebx                              #2489.1
-                                # LOE
-..B5.51:                        # Preds ..B5.1
-        movl      20(%ebx), %ecx                                #2526.5
-        movl      -12(%ebp), %edx                               #2526.5
-        movl      12(%ebx), %esi                                #2529.30
-        lea       (%edx,%ecx), %eax                             #2526.5
-        movl      %edx, %edi                                    #2529.49
-        shrl      $2, %edi                                      #2529.49
-        movl      %edi, -4(%ebp)                                #2529.49
-        lea       (%esi,%edi), %edi                             #2529.30
-        movl      %edi, -8(%ebp)                                #2529.30
-        movl      8(%ebx), %edi                                 #2532.12
-        subl      4(%edi), %eax                                 #2532.12
-        movl      %eax, -16(%ebp)                               #2532.12
-        lea       3(%edx,%ecx), %eax                            #2535.50
-        movl      -8(%ebp), %edx                                #2538.14
-        movl      -4(%ebp), %ecx                                #2538.14
-        shrl      $2, %eax                                      #2535.57
-        addl      %esi, %eax                                    #2535.30
-        testb     $15, %dl                                      #2538.14
-        jne       ..B5.3        # Prob 50%                      #2538.14
-                                # LOE eax edx ecx dl cl dh ch
-..B5.2:                         # Preds ..B5.51
-        movdqa    (%edx), %xmm0                                 #2538.14
-        movdqa    %xmm0, -88(%ebp)                              #2538.14
-        jmp       ..B5.4        # Prob 100%                     #2538.14
-                                # LOE eax ecx cl ch
-..B5.3:                         # Preds ..B5.51
-        movdqu    (%edx), %xmm0                                 #2538.14
-        movdqa    %xmm0, -88(%ebp)                              #2538.14
-                                # LOE eax ecx cl ch
-..B5.4:                         # Preds ..B5.2 ..B5.3
-        movl      12(%ebx), %edx                                #2539.5
-        lea       16(%edx,%ecx), %esi                           #2539.5
-        movl      %esi, -20(%ebp)                               #2539.5
-        cmpl      %eax, %esi                                    #2544.16
-        jae       ..B5.6        # Prob 12%                      #2544.16
-                                # LOE eax esi
-..B5.5:                         # Preds ..B5.4
-        movzbl    -1(%esi), %ecx                                #2545.24
-        shll      $8, %ecx                                      #2545.38
-        jmp       ..B5.7        # Prob 100%                     #2545.38
-                                # LOE eax ecx esi
-..B5.6:                         # Preds ..B5.4
-        xorl      %ecx, %ecx                                    #
-                                # LOE eax ecx esi
-..B5.7:                         # Preds ..B5.5 ..B5.6
-        movl      8(%ebx), %edx                                 #2549.5
-        movl      -12(%ebp), %edi                               #2561.20
-        movdqa    16(%edx), %xmm7                               #2549.5
-        movdqa    32(%edx), %xmm6                               #2549.5
-        movdqa    48(%edx), %xmm5                               #2549.5
-        movdqa    64(%edx), %xmm4                               #2549.5
-        movdqa    80(%edx), %xmm3                               #2549.5
-        movdqa    96(%edx), %xmm2                               #2549.5
-        movdqa    112(%edx), %xmm0                              #2549.5
-        movdqa    128(%edx), %xmm1                              #2549.5
-        andl      $3, %edi                                      #2561.20
-        je        ..B5.43       # Prob 20%                      #2561.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.8:                         # Preds ..B5.7
-        cmpl      $1, %edi                                      #2561.20
-        je        ..B5.14       # Prob 25%                      #2561.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.9:                         # Preds ..B5.8
-        cmpl      $2, %edi                                      #2561.20
-        je        ..B5.13       # Prob 33%                      #2561.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.10:                        # Preds ..B5.9
-        cmpl      $3, %edi                                      #2561.20
-        je        ..B5.12       # Prob 50%                      #2561.20
-                                # LOE eax ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.11:                        # Preds ..B5.10
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        jmp       ..B5.35       # Prob 100%                     #
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.12:                        # Preds ..B5.10
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -40(%ebp)                               #
-        movl      %edx, -36(%ebp)                               #
-        movl      %edx, -8(%ebp)                                #
-        movl      $2, %edx                                      #
-        jmp       ..B5.17       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.13:                        # Preds ..B5.9
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -36(%ebp)                               #
-        movl      %edx, -8(%ebp)                                #
-        movl      $2, %edx                                      #
-        jmp       ..B5.16       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.14:                        # Preds ..B5.8
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -8(%ebp)                                #
-        movl      $2, %edx                                      #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.15:                        # Preds ..B5.14 ..B5.39
-        movdqa    %xmm0, %xmm7                                  #2584.22
-        pand      %xmm4, %xmm7                                  #2584.22
-        pcmpeqw   %xmm5, %xmm7                                  #2585.22
-        pmovmskb  %xmm7, %eax                                   #2586.22
-        movl      %eax, -36(%ebp)                               #2586.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.16:                        # Preds ..B5.13 ..B5.15
-        movdqa    %xmm0, %xmm7                                  #2590.22
-        pand      %xmm2, %xmm7                                  #2590.22
-        pcmpeqw   %xmm3, %xmm7                                  #2591.22
-        pmovmskb  %xmm7, %eax                                   #2592.22
-        movl      %eax, -40(%ebp)                               #2592.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.17:                        # Preds ..B5.12 ..B5.16
-        movdqa    %xmm0, %xmm7                                  #2596.22
-        movl      -12(%ebp), %edi                               #2603.17
-        pand      %xmm1, %xmm7                                  #2596.22
-        andl      $-4, %edi                                     #2603.17
-        pcmpeqw   -56(%ebp), %xmm7                              #2597.22
-        pmovmskb  %xmm7, %eax                                   #2598.22
-        movl      %edi, -4(%ebp)                                #2603.17
-        movl      -8(%ebp), %edi                                #2606.29
-        movl      %eax, -76(%ebp)                               #2598.22
-        orl       -36(%ebp), %edi                               #2606.29
-        orl       -40(%ebp), %edi                               #2606.34
-        orl       %eax, %edi                                    #2606.39
-        je        ..B5.26       # Prob 78%                      #2606.47
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.18:                        # Preds ..B5.17
-        movl      -8(%ebp), %edi                                #2624.30
-        movl      %edx, -88(%ebp)                               #
-        movl      %edi, %eax                                    #2624.30
-        movl      %esi, -84(%ebp)                               #
-        movl      %ecx, -80(%ebp)                               #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2624.30
-        movswl    %ax, %edx                                     #2624.30
-        movl      -36(%ebp), %eax                               #2625.30
-        movl      %edx, -12(%ebp)                               #2624.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2625.30
-        movswl    %ax, %esi                                     #2625.30
-        movl      -40(%ebp), %eax                               #2626.30
-        lea       1(,%esi,4), %esi                              #2633.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2626.30
-        movswl    %ax, %ecx                                     #2626.30
-        lea       2(,%ecx,4), %ecx                              #2634.40
-        movl      -76(%ebp), %eax                               #2627.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2627.30
-        movl      %esi, -100(%ebp)                              #2633.40
-        movl      -84(%ebp), %esi                               #2639.32
-        movl      %ecx, -96(%ebp)                               #2634.40
-        movl      -80(%ebp), %ecx                               #2639.32
-        movswl    %ax, %edx                                     #2627.30
-        lea       3(,%edx,4), %edx                              #2635.40
-        movl      %edx, -92(%ebp)                               #2635.40
-        movl      -88(%ebp), %edx                               #2639.32
-        testl     %edi, %edi                                    #2639.32
-        je        ..B5.20       # Prob 50%                      #2639.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.19:                        # Preds ..B5.18
-        movl      -12(%ebp), %edi                               #2639.43
-        movl      -4(%ebp), %eax                                #2639.43
-        lea       (%eax,%edi,4), %edi                           #2639.43
-        movl      -16(%ebp), %eax                               #2639.49
-        cmpl      %edi, %eax                                    #2639.49
-        jae       ..B5.44       # Prob 1%                       #2639.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.20:                        # Preds ..B5.19 ..B5.18
-        movl      -36(%ebp), %eax                               #2640.32
-        testl     %eax, %eax                                    #2640.32
-        je        ..B5.22       # Prob 50%                      #2640.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.21:                        # Preds ..B5.20
-        movl      -100(%ebp), %edi                              #2640.43
-        addl      -4(%ebp), %edi                                #2640.43
-        movl      -16(%ebp), %eax                               #2640.49
-        cmpl      %edi, %eax                                    #2640.49
-        jae       ..B5.44       # Prob 1%                       #2640.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.22:                        # Preds ..B5.21 ..B5.20
-        movl      -40(%ebp), %eax                               #2641.32
-        testl     %eax, %eax                                    #2641.32
-        je        ..B5.24       # Prob 50%                      #2641.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.23:                        # Preds ..B5.22
-        movl      -96(%ebp), %edi                               #2641.43
-        addl      -4(%ebp), %edi                                #2641.43
-        movl      -16(%ebp), %eax                               #2641.49
-        cmpl      %edi, %eax                                    #2641.49
-        jae       ..B5.44       # Prob 1%                       #2641.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.24:                        # Preds ..B5.23 ..B5.22
-        movl      -76(%ebp), %eax                               #2642.32
-        testl     %eax, %eax                                    #2642.32
-        je        ..B5.26       # Prob 50%                      #2642.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.25:                        # Preds ..B5.24
-        movl      -92(%ebp), %edi                               #2642.43
-        addl      -4(%ebp), %edi                                #2642.43
-        movl      -16(%ebp), %eax                               #2642.49
-        cmpl      %edi, %eax                                    #2642.49
-        jae       ..B5.44       # Prob 1%                       #2642.49
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.26:                        # Preds ..B5.25 ..B5.24 ..B5.17
-        movl      -4(%ebp), %eax                                #2647.17
-        lea       4(%eax), %edi                                 #2647.17
-        movl      -16(%ebp), %eax                               #2650.28
-        movl      %edi, -12(%ebp)                               #2647.17
-        cmpl      %eax, %edi                                    #2650.28
-        ja        ..B5.41       # Prob 1%                       #2650.28
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.27:                        # Preds ..B5.26
-        addl      $-1, %edx                                     #2654.25
-        jne       ..B5.36       # Prob 50%                      #2654.39
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.28:                        # Preds ..B5.27
-        movl      -32(%ebp), %eax                               #2675.25
-        cmpl      %eax, %esi                                    #2675.25
-        jae       ..B5.41       # Prob 1%                       #2675.25
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.29:                        # Preds ..B5.28
-        movl      -4(%ebp), %eax                                #2679.13
-        movl      -16(%ebp), %edi                               #2680.24
-        lea       60(%eax), %edx                                #2679.13
-        movl      %edx, -12(%ebp)                               #2679.13
-        cmpl      %edi, %edx                                    #2680.24
-        ja        ..B5.41       # Prob 1%                       #2680.24
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.30:                        # Preds ..B5.29
-        testl     $15, %esi                                     #2685.22
-        jne       ..B5.32       # Prob 50%                      #2685.22
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.31:                        # Preds ..B5.30
-        movdqa    (%esi), %xmm0                                 #2685.22
-        jmp       ..B5.33       # Prob 100%                     #2685.22
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.32:                        # Preds ..B5.30
-        movdqu    (%esi), %xmm0                                 #2685.22
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.33:                        # Preds ..B5.31 ..B5.32
-        movl      -32(%ebp), %eax                               #2766.24
-        addl      $16, %esi                                     #2763.13
-        movl      %esi, -20(%ebp)                               #2763.13
-        cmpl      %eax, %esi                                    #2766.24
-        jae       ..B5.35       # Prob 12%                      #2766.24
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.34:                        # Preds ..B5.33
-        movzbl    -1(%esi), %ecx                                #2767.32
-        shll      $8, %ecx                                      #2767.46
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.35:                        # Preds ..B5.33 ..B5.11 ..B5.34
-        movl      $2, %edx                                      #2568.13
-        jmp       ..B5.39       # Prob 100%                     #2568.13
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.36:                        # Preds ..B5.27
-        movl      -20(%ebp), %eax                               #2662.26
-        movl      -32(%ebp), %edi                               #2662.26
-        psrldq    $1, %xmm0                                     #2659.26
-        cmpl      %edi, %eax                                    #2662.26
-        jae       ..B5.38       # Prob 19%                      #2662.26
-                                # LOE eax edx ecx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.37:                        # Preds ..B5.36
-        movzbl    (%eax), %edi                                  #2665.37
-        sarl      $8, %ecx                                      #2664.21
-        shll      $8, %edi                                      #2665.48
-        orl       %edi, %ecx                                    #2665.21
-        pinsrw    $7, %ecx, %xmm0                               #2666.30
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.38:                        # Preds ..B5.37 ..B5.36
-        addl      $1, -20(%ebp)                                 #2670.20
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.39:                        # Preds ..B5.35 ..B5.38 ..B5.43
-        movdqa    %xmm0, %xmm7                                  #2578.22
-        pand      %xmm6, %xmm7                                  #2578.22
-        pcmpeqw   -72(%ebp), %xmm7                              #2579.22
-        pmovmskb  %xmm7, %eax                                   #2580.22
-        movl      %eax, -8(%ebp)                                #2580.22
-        jmp       ..B5.15       # Prob 100%                     #2580.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.41:                        # Preds ..B5.26 ..B5.28 ..B5.29 # Infreq
-        movl      -24(%ebp), %esi                               #2776.12
-        movl      -28(%ebp), %edi                               #2776.12
-        xorl      %eax, %eax                                    #2776.12
-        movl      %ebp, %esp                                    #2776.12
-        popl      %ebp                                          #2776.12
-        movl      %ebx, %esp                                    #2776.12
-        popl      %ebx                                          #2776.12
-        ret                                                     #2776.12
-                                # LOE
-..B5.43:                        # Preds ..B5.7                  # Infreq
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        movl      $2, %edx                                      #
-        jmp       ..B5.39       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.44:                        # Preds ..B5.21 ..B5.19 ..B5.25 ..B5.23 # Infreq
-        movl      -24(%ebp), %esi                               #2641.63
-        movl      -28(%ebp), %edi                               #2641.63
-        movl      $1, %eax                                      #2641.63
-        movl      %ebp, %esp                                    #2641.63
-        popl      %ebp                                          #2641.63
-        movl      %ebx, %esp                                    #2641.63
-        popl      %ebx                                          #2641.63
-        ret                                                     #2641.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-.LNeval_2na_16:
-	.data
-# -- End  eval_2na_16
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    2,0x90
-eval_2na_32:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B6.1:                         # Preds ..B6.0
-        pushl     %ebx                                          #2782.1
-        movl      %esp, %ebx                                    #2782.1
-        andl      $-16, %esp                                    #2782.1
-        pushl     %ebp                                          #2782.1
-        pushl     %ebp                                          #2782.1
-        movl      4(%ebx), %ebp                                 #2782.1
-        movl      %ebp, 4(%esp)                                 #2782.1
-        movl      %esp, %ebp                                    #2782.1
-        subl      $104, %esp                                    #2782.1
-        movl      %ebx, -104(%ebp)                              #2782.1
-        movl      %edi, -28(%ebp)                               #2782.1
-        movl      %esi, -24(%ebp)                               #2782.1
-        movl      16(%ebx), %eax                                #2780.5
-        movl      %eax, -12(%ebp)                               #2780.5
-        call      ..L6          # Prob 100%                     #2782.1
-..L6:                                                           #
-        popl      %ecx                                          #2782.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L6], %ecx       #2782.1
-        lea       _gprof_pack5 at GOTOFF(%ecx), %edx               #2782.1
-        movl      %ecx, %ebx                                    #2782.1
-        call      mcount at PLT                                    #2782.1
-        movl      -104(%ebp), %ebx                              #2782.1
-                                # LOE
-..B6.51:                        # Preds ..B6.1
-        movl      20(%ebx), %ecx                                #2819.5
-        movl      -12(%ebp), %edx                               #2819.5
-        movl      12(%ebx), %esi                                #2822.30
-        lea       (%edx,%ecx), %eax                             #2819.5
-        movl      %edx, %edi                                    #2822.49
-        shrl      $2, %edi                                      #2822.49
-        movl      %edi, -4(%ebp)                                #2822.49
-        lea       (%esi,%edi), %edi                             #2822.30
-        movl      %edi, -8(%ebp)                                #2822.30
-        movl      8(%ebx), %edi                                 #2825.12
-        subl      4(%edi), %eax                                 #2825.12
-        movl      %eax, -16(%ebp)                               #2825.12
-        lea       3(%edx,%ecx), %eax                            #2828.50
-        movl      -8(%ebp), %edx                                #2831.14
-        movl      -4(%ebp), %ecx                                #2831.14
-        shrl      $2, %eax                                      #2828.57
-        addl      %esi, %eax                                    #2828.30
-        testb     $15, %dl                                      #2831.14
-        jne       ..B6.3        # Prob 50%                      #2831.14
-                                # LOE eax edx ecx dl cl dh ch
-..B6.2:                         # Preds ..B6.51
-        movdqa    (%edx), %xmm0                                 #2831.14
-        movdqa    %xmm0, -88(%ebp)                              #2831.14
-        jmp       ..B6.4        # Prob 100%                     #2831.14
-                                # LOE eax ecx cl ch
-..B6.3:                         # Preds ..B6.51
-        movdqu    (%edx), %xmm0                                 #2831.14
-        movdqa    %xmm0, -88(%ebp)                              #2831.14
-                                # LOE eax ecx cl ch
-..B6.4:                         # Preds ..B6.2 ..B6.3
-        movl      12(%ebx), %edx                                #2832.5
-        lea       16(%edx,%ecx), %esi                           #2832.5
-        movl      %esi, -20(%ebp)                               #2832.5
-        cmpl      %eax, %esi                                    #2837.16
-        jae       ..B6.6        # Prob 12%                      #2837.16
-                                # LOE eax esi
-..B6.5:                         # Preds ..B6.4
-        movzbl    -1(%esi), %ecx                                #2838.24
-        shll      $8, %ecx                                      #2838.38
-        jmp       ..B6.7        # Prob 100%                     #2838.38
-                                # LOE eax ecx esi
-..B6.6:                         # Preds ..B6.4
-        xorl      %ecx, %ecx                                    #
-                                # LOE eax ecx esi
-..B6.7:                         # Preds ..B6.5 ..B6.6
-        movl      8(%ebx), %edx                                 #2842.5
-        movl      -12(%ebp), %edi                               #2854.20
-        movdqa    16(%edx), %xmm7                               #2842.5
-        movdqa    32(%edx), %xmm6                               #2842.5
-        movdqa    48(%edx), %xmm5                               #2842.5
-        movdqa    64(%edx), %xmm4                               #2842.5
-        movdqa    80(%edx), %xmm3                               #2842.5
-        movdqa    96(%edx), %xmm2                               #2842.5
-        movdqa    112(%edx), %xmm0                              #2842.5
-        movdqa    128(%edx), %xmm1                              #2842.5
-        andl      $3, %edi                                      #2854.20
-        je        ..B6.43       # Prob 20%                      #2854.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.8:                         # Preds ..B6.7
-        cmpl      $1, %edi                                      #2854.20
-        je        ..B6.14       # Prob 25%                      #2854.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.9:                         # Preds ..B6.8
-        cmpl      $2, %edi                                      #2854.20
-        je        ..B6.13       # Prob 33%                      #2854.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.10:                        # Preds ..B6.9
-        cmpl      $3, %edi                                      #2854.20
-        je        ..B6.12       # Prob 50%                      #2854.20
-                                # LOE eax ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.11:                        # Preds ..B6.10
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        jmp       ..B6.35       # Prob 100%                     #
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.12:                        # Preds ..B6.10
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -40(%ebp)                               #
-        movl      %edx, -36(%ebp)                               #
-        movl      %edx, -8(%ebp)                                #
-        movl      $4, %edx                                      #
-        jmp       ..B6.17       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.13:                        # Preds ..B6.9
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -36(%ebp)                               #
-        movl      %edx, -8(%ebp)                                #
-        movl      $4, %edx                                      #
-        jmp       ..B6.16       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.14:                        # Preds ..B6.8
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, -8(%ebp)                                #
-        movl      $4, %edx                                      #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.15:                        # Preds ..B6.14 ..B6.39
-        movdqa    %xmm0, %xmm7                                  #2877.22
-        pand      %xmm4, %xmm7                                  #2877.22
-        pcmpeqd   %xmm5, %xmm7                                  #2878.22
-        pmovmskb  %xmm7, %eax                                   #2879.22
-        movl      %eax, -36(%ebp)                               #2879.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.16:                        # Preds ..B6.13 ..B6.15
-        movdqa    %xmm0, %xmm7                                  #2883.22
-        pand      %xmm2, %xmm7                                  #2883.22
-        pcmpeqd   %xmm3, %xmm7                                  #2884.22
-        pmovmskb  %xmm7, %eax                                   #2885.22
-        movl      %eax, -40(%ebp)                               #2885.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.17:                        # Preds ..B6.12 ..B6.16
-        movdqa    %xmm0, %xmm7                                  #2889.22
-        movl      -12(%ebp), %edi                               #2896.17
-        pand      %xmm1, %xmm7                                  #2889.22
-        andl      $-4, %edi                                     #2896.17
-        pcmpeqd   -56(%ebp), %xmm7                              #2890.22
-        pmovmskb  %xmm7, %eax                                   #2891.22
-        movl      %edi, -4(%ebp)                                #2896.17
-        movl      -8(%ebp), %edi                                #2899.29
-        movl      %eax, -76(%ebp)                               #2891.22
-        orl       -36(%ebp), %edi                               #2899.29
-        orl       -40(%ebp), %edi                               #2899.34
-        orl       %eax, %edi                                    #2899.39
-        je        ..B6.26       # Prob 78%                      #2899.47
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.18:                        # Preds ..B6.17
-        movl      -8(%ebp), %edi                                #2917.30
-        movl      %edx, -88(%ebp)                               #
-        movl      %edi, %eax                                    #2917.30
-        movl      %esi, -84(%ebp)                               #
-        movl      %ecx, -80(%ebp)                               #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2917.30
-        movswl    %ax, %edx                                     #2917.30
-        movl      -36(%ebp), %eax                               #2918.30
-        movl      %edx, -12(%ebp)                               #2917.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2918.30
-        movswl    %ax, %esi                                     #2918.30
-        movl      -40(%ebp), %eax                               #2919.30
-        lea       1(,%esi,4), %esi                              #2926.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2919.30
-        movswl    %ax, %ecx                                     #2919.30
-        lea       2(,%ecx,4), %ecx                              #2927.40
-        movl      -76(%ebp), %eax                               #2920.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2920.30
-        movl      %esi, -100(%ebp)                              #2926.40
-        movl      -84(%ebp), %esi                               #2932.32
-        movl      %ecx, -96(%ebp)                               #2927.40
-        movl      -80(%ebp), %ecx                               #2932.32
-        movswl    %ax, %edx                                     #2920.30
-        lea       3(,%edx,4), %edx                              #2928.40
-        movl      %edx, -92(%ebp)                               #2928.40
-        movl      -88(%ebp), %edx                               #2932.32
-        testl     %edi, %edi                                    #2932.32
-        je        ..B6.20       # Prob 50%                      #2932.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.19:                        # Preds ..B6.18
-        movl      -12(%ebp), %edi                               #2932.43
-        movl      -4(%ebp), %eax                                #2932.43
-        lea       (%eax,%edi,4), %edi                           #2932.43
-        movl      -16(%ebp), %eax                               #2932.49
-        cmpl      %edi, %eax                                    #2932.49
-        jae       ..B6.44       # Prob 1%                       #2932.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.20:                        # Preds ..B6.19 ..B6.18
-        movl      -36(%ebp), %eax                               #2933.32
-        testl     %eax, %eax                                    #2933.32
-        je        ..B6.22       # Prob 50%                      #2933.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.21:                        # Preds ..B6.20
-        movl      -100(%ebp), %edi                              #2933.43
-        addl      -4(%ebp), %edi                                #2933.43
-        movl      -16(%ebp), %eax                               #2933.49
-        cmpl      %edi, %eax                                    #2933.49
-        jae       ..B6.44       # Prob 1%                       #2933.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.22:                        # Preds ..B6.21 ..B6.20
-        movl      -40(%ebp), %eax                               #2934.32
-        testl     %eax, %eax                                    #2934.32
-        je        ..B6.24       # Prob 50%                      #2934.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.23:                        # Preds ..B6.22
-        movl      -96(%ebp), %edi                               #2934.43
-        addl      -4(%ebp), %edi                                #2934.43
-        movl      -16(%ebp), %eax                               #2934.49
-        cmpl      %edi, %eax                                    #2934.49
-        jae       ..B6.44       # Prob 1%                       #2934.49
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.24:                        # Preds ..B6.23 ..B6.22
-        movl      -76(%ebp), %eax                               #2935.32
-        testl     %eax, %eax                                    #2935.32
-        je        ..B6.26       # Prob 50%                      #2935.32
-                                # LOE edx ecx esi dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.25:                        # Preds ..B6.24
-        movl      -92(%ebp), %edi                               #2935.43
-        addl      -4(%ebp), %edi                                #2935.43
-        movl      -16(%ebp), %eax                               #2935.49
-        cmpl      %edi, %eax                                    #2935.49
-        jae       ..B6.44       # Prob 1%                       #2935.49
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.26:                        # Preds ..B6.25 ..B6.24 ..B6.17
-        movl      -4(%ebp), %eax                                #2940.17
-        lea       4(%eax), %edi                                 #2940.17
-        movl      -16(%ebp), %eax                               #2943.28
-        movl      %edi, -12(%ebp)                               #2940.17
-        cmpl      %eax, %edi                                    #2943.28
-        ja        ..B6.41       # Prob 1%                       #2943.28
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.27:                        # Preds ..B6.26
-        addl      $-1, %edx                                     #2947.25
-        jne       ..B6.36       # Prob 50%                      #2947.39
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.28:                        # Preds ..B6.27
-        movl      -32(%ebp), %eax                               #2968.25
-        cmpl      %eax, %esi                                    #2968.25
-        jae       ..B6.41       # Prob 1%                       #2968.25
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.29:                        # Preds ..B6.28
-        movl      -4(%ebp), %eax                                #2972.13
-        movl      -16(%ebp), %edi                               #2973.24
-        lea       52(%eax), %edx                                #2972.13
-        movl      %edx, -12(%ebp)                               #2972.13
-        cmpl      %edi, %edx                                    #2973.24
-        ja        ..B6.41       # Prob 1%                       #2973.24
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.30:                        # Preds ..B6.29
-        testl     $15, %esi                                     #2978.22
-        jne       ..B6.32       # Prob 50%                      #2978.22
-                                # LOE ecx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.31:                        # Preds ..B6.30
-        movdqa    (%esi), %xmm0                                 #2978.22
-        jmp       ..B6.33       # Prob 100%                     #2978.22
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.32:                        # Preds ..B6.30
-        movdqu    (%esi), %xmm0                                 #2978.22
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.33:                        # Preds ..B6.31 ..B6.32
-        movl      -32(%ebp), %eax                               #3059.24
-        addl      $16, %esi                                     #3056.13
-        movl      %esi, -20(%ebp)                               #3056.13
-        cmpl      %eax, %esi                                    #3059.24
-        jae       ..B6.35       # Prob 12%                      #3059.24
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.34:                        # Preds ..B6.33
-        movzbl    -1(%esi), %ecx                                #3060.32
-        shll      $8, %ecx                                      #3060.46
-                                # LOE ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.35:                        # Preds ..B6.33 ..B6.11 ..B6.34
-        movl      $4, %edx                                      #2861.13
-        jmp       ..B6.39       # Prob 100%                     #2861.13
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.36:                        # Preds ..B6.27
-        movl      -20(%ebp), %eax                               #2955.26
-        movl      -32(%ebp), %edi                               #2955.26
-        psrldq    $1, %xmm0                                     #2952.26
-        cmpl      %edi, %eax                                    #2955.26
-        jae       ..B6.38       # Prob 19%                      #2955.26
-                                # LOE eax edx ecx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.37:                        # Preds ..B6.36
-        movzbl    (%eax), %edi                                  #2958.37
-        sarl      $8, %ecx                                      #2957.21
-        shll      $8, %edi                                      #2958.48
-        orl       %edi, %ecx                                    #2958.21
-        pinsrw    $7, %ecx, %xmm0                               #2959.30
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.38:                        # Preds ..B6.37 ..B6.36
-        addl      $1, -20(%ebp)                                 #2963.20
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.39:                        # Preds ..B6.35 ..B6.38 ..B6.43
-        movdqa    %xmm0, %xmm7                                  #2871.22
-        pand      %xmm6, %xmm7                                  #2871.22
-        pcmpeqd   -72(%ebp), %xmm7                              #2872.22
-        pmovmskb  %xmm7, %eax                                   #2873.22
-        movl      %eax, -8(%ebp)                                #2873.22
-        jmp       ..B6.15       # Prob 100%                     #2873.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.41:                        # Preds ..B6.26 ..B6.28 ..B6.29 # Infreq
-        movl      -24(%ebp), %esi                               #3069.12
-        movl      -28(%ebp), %edi                               #3069.12
-        xorl      %eax, %eax                                    #3069.12
-        movl      %ebp, %esp                                    #3069.12
-        popl      %ebp                                          #3069.12
-        movl      %ebx, %esp                                    #3069.12
-        popl      %ebx                                          #3069.12
-        ret                                                     #3069.12
-                                # LOE
-..B6.43:                        # Preds ..B6.7                  # Infreq
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -88(%ebp), %xmm0                              #
-        movdqa    %xmm7, -72(%ebp)                              #
-        movl      %eax, -32(%ebp)                               #
-        movl      $4, %edx                                      #
-        jmp       ..B6.39       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.44:                        # Preds ..B6.21 ..B6.19 ..B6.25 ..B6.23 # Infreq
-        movl      -24(%ebp), %esi                               #2934.63
-        movl      -28(%ebp), %edi                               #2934.63
-        movl      $1, %eax                                      #2934.63
-        movl      %ebp, %esp                                    #2934.63
-        popl      %ebp                                          #2934.63
-        movl      %ebx, %esp                                    #2934.63
-        popl      %ebx                                          #2934.63
-        ret                                                     #2934.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-.LNeval_2na_32:
-	.data
-# -- End  eval_2na_32
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    2,0x90
-eval_2na_128:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B7.1:                         # Preds ..B7.0
-        pushl     %ebx                                          #3369.1
-        movl      %esp, %ebx                                    #3369.1
-        andl      $-16, %esp                                    #3369.1
-        pushl     %ebp                                          #3369.1
-        pushl     %ebp                                          #3369.1
-        movl      4(%ebx), %ebp                                 #3369.1
-        movl      %ebp, 4(%esp)                                 #3369.1
-        movl      %esp, %ebp                                    #3369.1
-        subl      $88, %esp                                     #3369.1
-        movl      %ebx, -88(%ebp)                               #3369.1
-        movl      %edi, -24(%ebp)                               #3369.1
-        movl      %esi, -20(%ebp)                               #3369.1
-        movl      16(%ebx), %esi                                #3367.5
-        call      ..L7          # Prob 100%                     #3369.1
-..L7:                                                           #
-        popl      %eax                                          #3369.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L7], %eax       #3369.1
-        lea       _gprof_pack6 at GOTOFF(%eax), %edx               #3369.1
-        movl      %eax, %ebx                                    #3369.1
-        call      mcount at PLT                                    #3369.1
-        movl      -88(%ebp), %ebx                               #3369.1
-                                # LOE esi
-..B7.47:                        # Preds ..B7.1
-        movl      20(%ebx), %ecx                                #3406.5
-        movl      12(%ebx), %edx                                #3409.30
-        lea       (%esi,%ecx), %eax                             #3406.5
-        movl      %esi, %edi                                    #3409.49
-        shrl      $2, %edi                                      #3409.49
-        lea       3(%esi,%ecx), %ecx                            #3415.50
-        movl      %edi, -4(%ebp)                                #3409.49
-        lea       (%edx,%edi), %edi                             #3409.30
-        movl      %edi, -12(%ebp)                               #3409.30
-        shrl      $2, %ecx                                      #3415.57
-        movl      8(%ebx), %edi                                 #3412.12
-        subl      4(%edi), %eax                                 #3412.12
-        addl      %edx, %ecx                                    #3415.30
-        movl      -12(%ebp), %edx                               #3418.14
-        movl      %ecx, -8(%ebp)                                #3415.30
-        movl      -4(%ebp), %ecx                                #3418.14
-        testb     $15, %dl                                      #3418.14
-        jne       ..B7.3        # Prob 50%                      #3418.14
-                                # LOE eax edx ecx esi dl cl dh ch
-..B7.2:                         # Preds ..B7.47
-        movdqa    (%edx), %xmm0                                 #3418.14
-        movdqa    %xmm0, -40(%ebp)                              #3418.14
-        jmp       ..B7.4        # Prob 100%                     #3418.14
-                                # LOE eax ecx esi cl ch
-..B7.3:                         # Preds ..B7.47
-        movdqu    (%edx), %xmm0                                 #3418.14
-        movdqa    %xmm0, -40(%ebp)                              #3418.14
-                                # LOE eax ecx esi cl ch
-..B7.4:                         # Preds ..B7.2 ..B7.3
-        movl      12(%ebx), %edi                                #3419.5
-        movl      -8(%ebp), %edx                                #3424.16
-        lea       16(%edi,%ecx), %edi                           #3419.5
-        movl      %edi, -16(%ebp)                               #3419.5
-        cmpl      %edx, %edi                                    #3424.16
-        jae       ..B7.6        # Prob 12%                      #3424.16
-                                # LOE eax esi edi
-..B7.5:                         # Preds ..B7.4
-        movzbl    -1(%edi), %ecx                                #3425.24
-        shll      $8, %ecx                                      #3425.38
-        jmp       ..B7.7        # Prob 100%                     #3425.38
-                                # LOE eax ecx esi edi
-..B7.6:                         # Preds ..B7.4
-        xorl      %ecx, %ecx                                    #
-                                # LOE eax ecx esi edi
-..B7.7:                         # Preds ..B7.5 ..B7.6
-        movl      8(%ebx), %edx                                 #3429.5
-        movdqa    16(%edx), %xmm6                               #3429.5
-        movdqa    32(%edx), %xmm5                               #3429.5
-        movdqa    48(%edx), %xmm4                               #3429.5
-        movdqa    64(%edx), %xmm3                               #3429.5
-        movdqa    80(%edx), %xmm2                               #3429.5
-        movdqa    96(%edx), %xmm1                               #3429.5
-        movdqa    112(%edx), %xmm0                              #3429.5
-        movdqa    128(%edx), %xmm7                              #3429.5
-        movl      %eax, %edx                                    #3434.20
-        subl      %esi, %edx                                    #3434.20
-        addl      $7, %edx                                      #3434.33
-        shrl      $2, %edx                                      #3434.40
-        movl      %edx, -12(%ebp)                               #3434.40
-        movl      %esi, %edx                                    #3441.20
-        andl      $3, %edx                                      #3441.20
-        je        ..B7.42       # Prob 20%                      #3441.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.8:                         # Preds ..B7.7
-        cmpl      $1, %edx                                      #3441.20
-        je        ..B7.14       # Prob 25%                      #3441.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.9:                         # Preds ..B7.8
-        cmpl      $2, %edx                                      #3441.20
-        je        ..B7.13       # Prob 33%                      #3441.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.10:                        # Preds ..B7.9
-        cmpl      $3, %edx                                      #3441.20
-        je        ..B7.12       # Prob 50%                      #3441.20
-                                # LOE eax ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.11:                        # Preds ..B7.10
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movl      %eax, -76(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        jmp       ..B7.26       # Prob 100%                     #
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.12:                        # Preds ..B7.10
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movl      %eax, -76(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -84(%ebp)                               #
-        movl      %edx, -80(%ebp)                               #
-        jmp       ..B7.17       # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.13:                        # Preds ..B7.9
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movl      %eax, -76(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        xorl      %edx, %edx                                    #
-        movl      %edx, -80(%ebp)                               #
-        jmp       ..B7.16       # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.14:                        # Preds ..B7.8
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movl      %eax, -76(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        xorl      %edx, %edx                                    #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.15:                        # Preds ..B7.14 ..B7.30
-        movdqa    %xmm0, %xmm7                                  #3464.22
-        pand      %xmm3, %xmm7                                  #3464.22
-        pcmpeqd   %xmm4, %xmm7                                  #3465.22
-        pmovmskb  %xmm7, %eax                                   #3466.22
-        addl      $1, %eax                                      #3467.17
-        shrl      $16, %eax                                     #3467.17
-        negl      %eax                                          #3467.17
-        movl      %eax, -80(%ebp)                               #3467.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.16:                        # Preds ..B7.13 ..B7.15
-        movdqa    %xmm0, %xmm7                                  #3470.22
-        pand      %xmm1, %xmm7                                  #3470.22
-        pcmpeqd   %xmm2, %xmm7                                  #3471.22
-        pmovmskb  %xmm7, %eax                                   #3472.22
-        addl      $1, %eax                                      #3473.17
-        shrl      $16, %eax                                     #3473.17
-        negl      %eax                                          #3473.17
-        movl      %eax, -84(%ebp)                               #3473.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.17:                        # Preds ..B7.12 ..B7.16
-        movdqa    %xmm0, %xmm7                                  #3476.22
-        pand      -72(%ebp), %xmm7                              #3476.22
-        pcmpeqd   -56(%ebp), %xmm7                              #3477.22
-        pmovmskb  %xmm7, %eax                                   #3478.22
-        andl      $-4, %esi                                     #3483.17
-        movl      %edx, %ecx                                    #3486.29
-        orl       -80(%ebp), %ecx                               #3486.29
-        addl      $1, %eax                                      #3479.17
-        shrl      $16, %eax                                     #3479.17
-        orl       -84(%ebp), %ecx                               #3486.34
-        negl      %eax                                          #3479.17
-        orl       %eax, %ecx                                    #3486.39
-        jne       ..B7.31       # Prob 1%                       #3486.47
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.18:                        # Preds ..B7.17
-        movl      -76(%ebp), %eax                               #3530.28
-        addl      $4, %esi                                      #3527.17
-        cmpl      %eax, %esi                                    #3530.28
-        ja        ..B7.38       # Prob 1%                       #3530.28
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.19:                        # Preds ..B7.18
-        movl      -12(%ebp), %eax                               #3534.25
-        addl      $-1, %eax                                     #3534.25
-        movl      %eax, -12(%ebp)                               #3534.25
-        jne       ..B7.27       # Prob 50%                      #3534.39
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.20:                        # Preds ..B7.19
-        movl      -8(%ebp), %eax                                #3555.25
-        cmpl      %eax, %edi                                    #3555.25
-        jae       ..B7.38       # Prob 1%                       #3555.25
-                                # LOE eax esi edi al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.21:                        # Preds ..B7.20
-        testl     $15, %edi                                     #3565.22
-        jne       ..B7.23       # Prob 50%                      #3565.22
-                                # LOE eax esi edi al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.22:                        # Preds ..B7.21
-        movdqa    (%edi), %xmm0                                 #3565.22
-        jmp       ..B7.24       # Prob 100%                     #3565.22
-                                # LOE eax esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.23:                        # Preds ..B7.21
-        movdqu    (%edi), %xmm0                                 #3565.22
-                                # LOE eax esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.24:                        # Preds ..B7.22 ..B7.23
-        addl      $16, %edi                                     #3643.13
-        movl      %edi, -16(%ebp)                               #3643.13
-        cmpl      %eax, %edi                                    #3646.24
-        jae       ..B7.26       # Prob 12%                      #3646.24
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.25:                        # Preds ..B7.24
-        movzbl    -1(%edi), %eax                                #3647.32
-        shll      $8, %eax                                      #3647.46
-        movl      %eax, -4(%ebp)                                #3647.46
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.26:                        # Preds ..B7.24 ..B7.11 ..B7.25
-        movl      $16, %eax                                     #3448.13
-        movl      %eax, -12(%ebp)                               #3448.13
-        jmp       ..B7.30       # Prob 100%                     #3448.13
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.27:                        # Preds ..B7.19
-        movl      -8(%ebp), %edx                                #3542.26
-        movl      -16(%ebp), %eax                               #3542.26
-        psrldq    $1, %xmm0                                     #3539.26
-        cmpl      %edx, %eax                                    #3542.26
-        jae       ..B7.29       # Prob 19%                      #3542.26
-                                # LOE eax esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.28:                        # Preds ..B7.27
-        movl      -4(%ebp), %ecx                                #3544.21
-        movzbl    (%eax), %edx                                  #3545.37
-        sarl      $8, %ecx                                      #3544.21
-        shll      $8, %edx                                      #3545.48
-        orl       %edx, %ecx                                    #3545.21
-        pinsrw    $7, %ecx, %xmm0                               #3546.30
-        movl      %ecx, -4(%ebp)                                #3545.21
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.29:                        # Preds ..B7.28 ..B7.27
-        addl      $1, -16(%ebp)                                 #3550.20
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.30:                        # Preds ..B7.26 ..B7.29 ..B7.42
-        movdqa    %xmm0, %xmm7                                  #3458.22
-        pand      %xmm5, %xmm7                                  #3458.22
-        pcmpeqd   %xmm6, %xmm7                                  #3459.22
-        pmovmskb  %xmm7, %edx                                   #3460.22
-        addl      $1, %edx                                      #3461.17
-        shrl      $16, %edx                                     #3461.17
-        negl      %edx                                          #3461.17
-        jmp       ..B7.15       # Prob 100%                     #3461.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.31:                        # Preds ..B7.17                 # Infreq
-        movl      -76(%ebp), %eax                               #
-        subl      %esi, %eax                                    #3489.30
-        cmpl      $2, %eax                                      #3489.37
-        je        ..B7.35       # Prob 25%                      #3489.37
-                                # LOE eax edx
-..B7.32:                        # Preds ..B7.31                 # Infreq
-        cmpl      $1, %eax                                      #3489.37
-        je        ..B7.36       # Prob 33%                      #3489.37
-                                # LOE eax edx
-..B7.33:                        # Preds ..B7.32                 # Infreq
-        testl     %eax, %eax                                    #3489.37
-        je        ..B7.37       # Prob 50%                      #3489.37
-                                # LOE edx
-..B7.34:                        # Preds ..B7.35 ..B7.36 ..B7.37 ..B7.33 # Infreq
-        movl      -20(%ebp), %esi                               #3492.32
-        movl      -24(%ebp), %edi                               #3492.32
-        movl      $1, %eax                                      #3492.32
-        movl      %ebp, %esp                                    #3492.32
-        popl      %ebp                                          #3492.32
-        movl      %ebx, %esp                                    #3492.32
-        popl      %ebx                                          #3492.32
-        ret                                                     #3492.32
-                                # LOE
-..B7.35:                        # Preds ..B7.31                 # Infreq
-        movl      -84(%ebp), %eax                               #3494.36
-        testl     %eax, %eax                                    #3494.36
-        jne       ..B7.34       # Prob 28%                      #3494.36
-                                # LOE edx
-..B7.36:                        # Preds ..B7.35 ..B7.32         # Infreq
-        movl      -80(%ebp), %eax                               #3496.36
-        testl     %eax, %eax                                    #3496.36
-        jne       ..B7.34       # Prob 28%                      #3496.36
-                                # LOE edx
-..B7.37:                        # Preds ..B7.33 ..B7.36         # Infreq
-        testl     %edx, %edx                                    #3498.36
-        jne       ..B7.34       # Prob 28%                      #3498.36
-                                # LOE
-..B7.38:                        # Preds ..B7.20 ..B7.18 ..B7.37 # Infreq
-        movl      -20(%ebp), %esi                               #3500.28
-        movl      -24(%ebp), %edi                               #3500.28
-        xorl      %eax, %eax                                    #3500.28
-        movl      %ebp, %esp                                    #3500.28
-        popl      %ebp                                          #3500.28
-        movl      %ebx, %esp                                    #3500.28
-        popl      %ebx                                          #3500.28
-        ret                                                     #3500.28
-                                # LOE
-..B7.42:                        # Preds ..B7.7                  # Infreq
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -56(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movl      %eax, -76(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        jmp       ..B7.30       # Prob 100%                     #
-        .align    2,0x90
-                                # LOE esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-.LNeval_2na_128:
-	.data
-# -- End  eval_2na_128
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    2,0x90
-eval_4na_16:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B8.1:                         # Preds ..B8.0
-        pushl     %ebx                                          #4057.1
-        movl      %esp, %ebx                                    #4057.1
-        andl      $-16, %esp                                    #4057.1
-        pushl     %ebp                                          #4057.1
-        pushl     %ebp                                          #4057.1
-        movl      4(%ebx), %ebp                                 #4057.1
-        movl      %ebp, 4(%esp)                                 #4057.1
-        movl      %esp, %ebp                                    #4057.1
-        subl      $136, %esp                                    #4057.1
-        movl      %ebx, -136(%ebp)                              #4057.1
-        movl      %edi, -36(%ebp)                               #4057.1
-        movl      %esi, -32(%ebp)                               #4057.1
-        movl      12(%ebx), %ecx                                #4055.5
-        movl      16(%ebx), %esi                                #4055.5
-        call      ..L8          # Prob 100%                     #4057.1
-..L8:                                                           #
-        popl      %edi                                          #4057.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L8], %edi       #4057.1
-        lea       _gprof_pack7 at GOTOFF(%edi), %edx               #4057.1
-        movl      %edi, %ebx                                    #4057.1
-        call      mcount at PLT                                    #4057.1
-        movl      -136(%ebp), %ebx                              #4057.1
-                                # LOE esi edi
-..B8.35:                        # Preds ..B8.1
-        movl      12(%ebx), %ecx                                #
-        movl      %esi, -16(%ebp)                               #
-        movl      %esi, %eax                                    #4093.49
-        movl      %edi, -116(%ebp)                              #
-        shrl      $2, %eax                                      #4093.49
-        movl      20(%ebx), %edi                                #4090.5
-        movl      %eax, -20(%ebp)                               #4093.49
-        movl      8(%ebx), %eax                                 #4096.12
-        movdqa    16(%eax), %xmm5                               #4109.5
-        movdqa    32(%eax), %xmm4                               #4109.5
-        movdqa    48(%eax), %xmm3                               #4109.5
-        movdqa    64(%eax), %xmm0                               #4109.5
-        movdqa    80(%eax), %xmm7                               #4109.5
-        movdqa    96(%eax), %xmm1                               #4109.5
-        movdqa    112(%eax), %xmm6                              #4109.5
-        movdqa    %xmm0, -56(%ebp)                              #4109.5
-        movdqa    128(%eax), %xmm0                              #4109.5
-        lea       (%esi,%edi), %edx                             #4090.5
-        subl      4(%eax), %edx                                 #4096.12
-        movl      %edx, -24(%ebp)                               #4096.12
-        lea       3(%esi,%edi), %edx                            #4099.50
-        shrl      $2, %edx                                      #4099.57
-        movl      -20(%ebp), %esi                               #4102.14
-        movl      -116(%ebp), %edi                              #4102.14
-        addl      %ecx, %edx                                    #4099.30
-        movl      %edx, -28(%ebp)                               #4099.30
-        movzbl    (%esi,%ecx), %edx                             #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -132(%ebp)                               #4102.14
-        movzbl    1(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -130(%ebp)                               #4102.14
-        movzbl    2(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -128(%ebp)                               #4102.14
-        movzbl    3(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -126(%ebp)                               #4102.14
-        movzbl    4(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -124(%ebp)                               #4102.14
-        movzbl    5(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -122(%ebp)                               #4102.14
-        movzbl    6(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -120(%ebp)                               #4102.14
-        movzbl    7(%esi,%ecx), %edx                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4102.14
-        movw      %dx, -118(%ebp)                               #4102.14
-        movdqu    -132(%ebp), %xmm2                             #4102.14
-        lea       8(%ecx,%esi), %edx                            #4103.5
-        movl      -16(%ebp), %esi                               #4123.20
-        movl      %esi, %eax                                    #4123.20
-        andl      $3, %eax                                      #4123.20
-        je        ..B8.5        # Prob 20%                      #4123.20
-                                # LOE eax edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.2:                         # Preds ..B8.35
-        cmpl      $1, %eax                                      #4123.20
-        je        ..B8.8        # Prob 25%                      #4123.20
-                                # LOE eax edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.3:                         # Preds ..B8.2
-        cmpl      $2, %eax                                      #4123.20
-        je        ..B8.7        # Prob 33%                      #4123.20
-                                # LOE eax edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.4:                         # Preds ..B8.3
-        cmpl      $3, %eax                                      #4123.20
-        je        ..B8.6        # Prob 50%                      #4123.20
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.5:                         # Preds ..B8.35 ..B8.4
-        movdqa    %xmm6, -72(%ebp)                              #
-        movdqa    %xmm7, -88(%ebp)                              #
-        jmp       ..B8.24       # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.6:                         # Preds ..B8.4
-        movdqa    %xmm6, -72(%ebp)                              #
-        movdqa    %xmm7, -88(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -96(%ebp)                               #
-        movl      %eax, -20(%ebp)                               #
-        movl      %eax, -40(%ebp)                               #
-        jmp       ..B8.11       # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.7:                         # Preds ..B8.3
-        movdqa    %xmm6, -72(%ebp)                              #
-        movdqa    %xmm7, -88(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -40(%ebp)                               #
-        movl      %eax, -20(%ebp)                               #
-        jmp       ..B8.10       # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.8:                         # Preds ..B8.2
-        movdqa    %xmm6, -72(%ebp)                              #
-        movdqa    %xmm7, -88(%ebp)                              #
-        xorl      %ecx, %ecx                                    #
-        movl      %ecx, -20(%ebp)                               #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.9:                         # Preds ..B8.8 ..B8.24
-        movdqa    %xmm2, %xmm7                                  #4147.22
-        movdqa    %xmm2, %xmm6                                  #4148.22
-        pand      -56(%ebp), %xmm6                              #4148.22
-        pand      %xmm3, %xmm7                                  #4147.22
-        pcmpeqw   %xmm6, %xmm7                                  #4149.22
-        pmovmskb  %xmm7, %eax                                   #4150.22
-        movl      %eax, -40(%ebp)                               #4150.22
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.10:                        # Preds ..B8.7 ..B8.9
-        movdqa    %xmm2, %xmm7                                  #4154.22
-        movdqa    %xmm2, %xmm6                                  #4155.22
-        pand      -88(%ebp), %xmm7                              #4154.22
-        pand      %xmm1, %xmm6                                  #4155.22
-        pcmpeqw   %xmm6, %xmm7                                  #4156.22
-        pmovmskb  %xmm7, %eax                                   #4157.22
-        movl      %eax, -96(%ebp)                               #4157.22
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.11:                        # Preds ..B8.6 ..B8.10
-        movdqa    %xmm2, %xmm6                                  #4161.22
-        pand      -72(%ebp), %xmm6                              #4161.22
-        movl      -20(%ebp), %ecx                               #4172.29
-        pand      %xmm0, %xmm2                                  #4162.22
-        pcmpeqw   %xmm2, %xmm6                                  #4163.22
-        pmovmskb  %xmm6, %eax                                   #4164.22
-        movl      %eax, -92(%ebp)                               #4164.22
-        andl      $-4, %esi                                     #4169.17
-        orl       -40(%ebp), %ecx                               #4172.29
-        orl       -96(%ebp), %ecx                               #4172.34
-        orl       %eax, %ecx                                    #4172.39
-        je        ..B8.20       # Prob 78%                      #4172.47
-                                # LOE edx esi edi xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.12:                        # Preds ..B8.11
-        movl      %esi, -16(%ebp)                               #
-        movl      -20(%ebp), %esi                               #4190.30
-        movl      %edx, -100(%ebp)                              #
-        movl      %esi, %eax                                    #4190.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4190.30
-        movswl    %ax, %edx                                     #4190.30
-        movl      -40(%ebp), %eax                               #4191.30
-        movl      %edx, -116(%ebp)                              #4190.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4191.30
-        movswl    %ax, %edx                                     #4191.30
-        movl      -96(%ebp), %eax                               #4192.30
-        lea       1(%edx,%edx), %edx                            #4199.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4192.30
-        movswl    %ax, %ecx                                     #4192.30
-        movl      -92(%ebp), %eax                               #4193.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4193.30
-        movl      %edx, -112(%ebp)                              #4199.40
-        movswl    %ax, %eax                                     #4193.30
-        lea       2(%ecx,%ecx), %edx                            #4200.40
-        movl      %edx, -108(%ebp)                              #4200.40
-        lea       3(%eax,%eax), %edx                            #4201.40
-        testl     %esi, %esi                                    #4205.32
-        movl      -16(%ebp), %esi                               #4205.32
-        movl      %edx, -104(%ebp)                              #4201.40
-        movl      -100(%ebp), %edx                              #4205.32
-        je        ..B8.14       # Prob 50%                      #4205.32
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.13:                        # Preds ..B8.12
-        movl      -116(%ebp), %eax                              #4205.43
-        movl      -24(%ebp), %ecx                               #4205.49
-        lea       (%esi,%eax,2), %eax                           #4205.43
-        cmpl      %eax, %ecx                                    #4205.49
-        jae       ..B8.28       # Prob 1%                       #4205.49
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.14:                        # Preds ..B8.13 ..B8.12
-        movl      -40(%ebp), %eax                               #4206.32
-        testl     %eax, %eax                                    #4206.32
-        je        ..B8.16       # Prob 50%                      #4206.32
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.15:                        # Preds ..B8.14
-        movl      -112(%ebp), %ecx                              #4206.43
-        movl      -24(%ebp), %eax                               #4206.49
-        addl      %esi, %ecx                                    #4206.43
-        cmpl      %ecx, %eax                                    #4206.49
-        jae       ..B8.28       # Prob 1%                       #4206.49
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.16:                        # Preds ..B8.15 ..B8.14
-        movl      -96(%ebp), %eax                               #4207.32
-        testl     %eax, %eax                                    #4207.32
-        je        ..B8.18       # Prob 50%                      #4207.32
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.17:                        # Preds ..B8.16
-        movl      -108(%ebp), %ecx                              #4207.43
-        movl      -24(%ebp), %eax                               #4207.49
-        addl      %esi, %ecx                                    #4207.43
-        cmpl      %ecx, %eax                                    #4207.49
-        jae       ..B8.28       # Prob 1%                       #4207.49
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.18:                        # Preds ..B8.17 ..B8.16
-        movl      -92(%ebp), %eax                               #4208.32
-        testl     %eax, %eax                                    #4208.32
-        je        ..B8.20       # Prob 50%                      #4208.32
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.19:                        # Preds ..B8.18
-        movl      -104(%ebp), %ecx                              #4208.43
-        movl      -24(%ebp), %eax                               #4208.49
-        addl      %esi, %ecx                                    #4208.43
-        cmpl      %ecx, %eax                                    #4208.49
-        jae       ..B8.28       # Prob 1%                       #4208.49
-                                # LOE edx esi edi xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.20:                        # Preds ..B8.19 ..B8.18 ..B8.11
-        movl      -24(%ebp), %eax                               #4216.28
-        lea       4(%esi), %ecx                                 #4241.13
-        cmpl      %ecx, %eax                                    #4216.28
-        jb        ..B8.26       # Prob 1%                       #4216.28
-                                # LOE edx esi edi xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.21:                        # Preds ..B8.20
-        movl      -28(%ebp), %eax                               #4237.25
-        cmpl      %eax, %edx                                    #4237.25
-        jae       ..B8.26       # Prob 1%                       #4237.25
-                                # LOE edx esi edi xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.22:                        # Preds ..B8.21
-        movl      -24(%ebp), %eax                               #4242.24
-        addl      $32, %esi                                     #4241.13
-        cmpl      %eax, %esi                                    #4242.24
-        ja        ..B8.26       # Prob 1%                       #4242.24
-                                # LOE edx esi edi xmm0 xmm1 xmm3 xmm4 xmm5
-..B8.23:                        # Preds ..B8.22
-        movzbl    (%edx), %eax                                  #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %ecx        #4247.22
-        movzbl    1(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %cx, -132(%ebp)                               #4247.22
-        movw      %ax, -130(%ebp)                               #4247.22
-        movzbl    2(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %ax, -128(%ebp)                               #4247.22
-        movzbl    3(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %ax, -126(%ebp)                               #4247.22
-        movzbl    4(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %ax, -124(%ebp)                               #4247.22
-        movzbl    5(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %ax, -122(%ebp)                               #4247.22
-        movzbl    6(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        movw      %ax, -120(%ebp)                               #4247.22
-        movzbl    7(%edx), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4247.22
-        addl      $8, %edx                                      #4262.13
-        movw      %ax, -118(%ebp)                               #4247.22
-        movdqu    -132(%ebp), %xmm2                             #4247.22
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.24:                        # Preds ..B8.23 ..B8.5
-        movdqa    %xmm2, %xmm7                                  #4140.22
-        movdqa    %xmm2, %xmm6                                  #4141.22
-        pand      %xmm5, %xmm7                                  #4140.22
-        pand      %xmm4, %xmm6                                  #4141.22
-        pcmpeqw   %xmm6, %xmm7                                  #4142.22
-        pmovmskb  %xmm7, %eax                                   #4143.22
-        movl      %eax, -20(%ebp)                               #4143.22
-        jmp       ..B8.9        # Prob 100%                     #4143.22
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.26:                        # Preds ..B8.20 ..B8.21 ..B8.22 # Infreq
-        movl      -32(%ebp), %esi                               #4273.12
-        movl      -36(%ebp), %edi                               #4273.12
-        xorl      %eax, %eax                                    #4273.12
-        movl      %ebp, %esp                                    #4273.12
-        popl      %ebp                                          #4273.12
-        movl      %ebx, %esp                                    #4273.12
-        popl      %ebx                                          #4273.12
-        ret                                                     #4273.12
-                                # LOE
-..B8.28:                        # Preds ..B8.19 ..B8.17 ..B8.15 ..B8.13 # Infreq
-        movl      -32(%ebp), %esi                               #4205.63
-        movl      -36(%ebp), %edi                               #4205.63
-        movl      $1, %eax                                      #4205.63
-        movl      %ebp, %esp                                    #4205.63
-        popl      %ebp                                          #4205.63
-        movl      %ebx, %esp                                    #4205.63
-        popl      %ebx                                          #4205.63
-        ret                                                     #4205.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-.LNeval_4na_16:
-	.data
-# -- End  eval_4na_16
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    2,0x90
-eval_4na_32:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B9.1:                         # Preds ..B9.0
-        pushl     %ebx                                          #4279.1
-        movl      %esp, %ebx                                    #4279.1
-        andl      $-16, %esp                                    #4279.1
-        pushl     %ebp                                          #4279.1
-        pushl     %ebp                                          #4279.1
-        movl      4(%ebx), %ebp                                 #4279.1
-        movl      %ebp, 4(%esp)                                 #4279.1
-        movl      %esp, %ebp                                    #4279.1
-        subl      $152, %esp                                    #4279.1
-        movl      %ebx, -152(%ebp)                              #4279.1
-        movl      %edi, -44(%ebp)                               #4279.1
-        movl      %esi, -40(%ebp)                               #4279.1
-        movl      12(%ebx), %ecx                                #4277.5
-        movl      16(%ebx), %esi                                #4277.5
-        call      ..L9          # Prob 100%                     #4279.1
-..L9:                                                           #
-        popl      %edi                                          #4279.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L9], %edi       #4279.1
-        lea       _gprof_pack8 at GOTOFF(%edi), %edx               #4279.1
-        movl      %edi, %ebx                                    #4279.1
-        call      mcount at PLT                                    #4279.1
-        movl      -152(%ebp), %ebx                              #4279.1
-                                # LOE esi edi
-..B9.41:                        # Preds ..B9.1
-        movl      12(%ebx), %ecx                                #
-        movl      %esi, -24(%ebp)                               #
-        movl      %esi, %eax                                    #4315.49
-        movl      %edi, -16(%ebp)                               #
-        shrl      $2, %eax                                      #4315.49
-        movl      20(%ebx), %edi                                #4312.5
-        movl      %eax, -20(%ebp)                               #4315.49
-        movl      8(%ebx), %eax                                 #4318.12
-        movdqa    16(%eax), %xmm5                               #4331.5
-        movdqa    32(%eax), %xmm4                               #4331.5
-        movdqa    48(%eax), %xmm3                               #4331.5
-        movdqa    64(%eax), %xmm6                               #4331.5
-        movdqa    80(%eax), %xmm2                               #4331.5
-        movdqa    96(%eax), %xmm1                               #4331.5
-        movdqa    128(%eax), %xmm7                              #4331.5
-        lea       (%esi,%edi), %edx                             #4312.5
-        subl      4(%eax), %edx                                 #4318.12
-        movl      %edx, -32(%ebp)                               #4318.12
-        lea       3(%esi,%edi), %edx                            #4321.50
-        shrl      $2, %edx                                      #4321.57
-        movl      -20(%ebp), %esi                               #4324.14
-        movl      -16(%ebp), %edi                               #4324.14
-        addl      %ecx, %edx                                    #4321.30
-        movl      %edx, -36(%ebp)                               #4321.30
-        movzbl    (%esi,%ecx), %edx                             #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -148(%ebp)                               #4324.14
-        movzbl    1(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -146(%ebp)                               #4324.14
-        movzbl    2(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -144(%ebp)                               #4324.14
-        movzbl    3(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -142(%ebp)                               #4324.14
-        movzbl    4(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -140(%ebp)                               #4324.14
-        movzbl    5(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -138(%ebp)                               #4324.14
-        movzbl    6(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -136(%ebp)                               #4324.14
-        movzbl    7(%esi,%ecx), %edx                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%edx,2), %edx        #4324.14
-        movw      %dx, -134(%ebp)                               #4324.14
-        movdqu    -148(%ebp), %xmm0                             #4324.14
-        lea       8(%ecx,%esi), %edx                            #4325.5
-        movl      -24(%ebp), %esi                               #4345.20
-        movdqa    %xmm0, -120(%ebp)                             #4324.14
-        movdqa    112(%eax), %xmm0                              #4331.5
-        movl      %esi, %eax                                    #4345.20
-        movl      %edx, -28(%ebp)                               #4325.5
-        andl      $3, %eax                                      #4345.20
-        je        ..B9.33       # Prob 20%                      #4345.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.2:                         # Preds ..B9.41
-        cmpl      $1, %eax                                      #4345.20
-        je        ..B9.8        # Prob 25%                      #4345.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.3:                         # Preds ..B9.2
-        cmpl      $2, %eax                                      #4345.20
-        je        ..B9.7        # Prob 33%                      #4345.20
-                                # LOE eax edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.4:                         # Preds ..B9.3
-        cmpl      $3, %eax                                      #4345.20
-        je        ..B9.6        # Prob 50%                      #4345.20
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.5:                         # Preds ..B9.4
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -104(%ebp)                             #
-        movl      %edi, -16(%ebp)                               #
-        jmp       ..B9.25       # Prob 100%                     #
-                                # LOE edx esi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.6:                         # Preds ..B9.4
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -104(%ebp)                             #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -56(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      %ecx, -52(%ebp)                               #
-        movl      %eax, -48(%ebp)                               #
-        movl      $2, %ecx                                      #
-        jmp       ..B9.11       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.7:                         # Preds ..B9.3
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -104(%ebp)                             #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -52(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        movl      $2, %ecx                                      #
-        movl      %eax, -48(%ebp)                               #
-        jmp       ..B9.10       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.8:                         # Preds ..B9.2
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -104(%ebp)                             #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -48(%ebp)                               #
-        movl      %edi, -16(%ebp)                               #
-        movl      $2, %ecx                                      #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.9:                         # Preds ..B9.8 ..B9.29
-        movdqa    %xmm0, %xmm7                                  #4369.22
-        movdqa    %xmm0, %xmm6                                  #4370.22
-        pand      -104(%ebp), %xmm6                             #4370.22
-        pand      %xmm3, %xmm7                                  #4369.22
-        pcmpeqd   %xmm6, %xmm7                                  #4371.22
-        pmovmskb  %xmm7, %eax                                   #4372.22
-        movl      %eax, -52(%ebp)                               #4372.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.10:                        # Preds ..B9.7 ..B9.9
-        movdqa    %xmm0, %xmm7                                  #4376.22
-        movdqa    %xmm0, %xmm6                                  #4377.22
-        pand      %xmm2, %xmm7                                  #4376.22
-        pand      %xmm1, %xmm6                                  #4377.22
-        pcmpeqd   %xmm6, %xmm7                                  #4378.22
-        pmovmskb  %xmm7, %eax                                   #4379.22
-        movl      %eax, -56(%ebp)                               #4379.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.11:                        # Preds ..B9.6 ..B9.10
-        movdqa    %xmm0, %xmm7                                  #4383.22
-        movdqa    %xmm0, %xmm6                                  #4384.22
-        pand      -88(%ebp), %xmm7                              #4383.22
-        pand      -72(%ebp), %xmm6                              #4384.22
-        pcmpeqd   %xmm6, %xmm7                                  #4385.22
-        pmovmskb  %xmm7, %eax                                   #4386.22
-        movl      -48(%ebp), %edi                               #4394.29
-        movl      %eax, -112(%ebp)                              #4386.22
-        andl      $-4, %esi                                     #4391.17
-        movl      %esi, -20(%ebp)                               #4391.17
-        orl       -52(%ebp), %edi                               #4394.29
-        orl       -56(%ebp), %edi                               #4394.34
-        orl       %eax, %edi                                    #4394.39
-        je        ..B9.20       # Prob 78%                      #4394.47
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.12:                        # Preds ..B9.11
-        movl      %esi, %eax                                    #
-        movl      -48(%ebp), %edi                               #4412.30
-        movl      %eax, -20(%ebp)                               #
-        movl      %edi, %eax                                    #4412.30
-        movl      %ecx, -120(%ebp)                              #
-        movl      %edx, -116(%ebp)                              #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4412.30
-        movswl    %ax, %edx                                     #4412.30
-        movl      -52(%ebp), %eax                               #4413.30
-        movl      %edx, -132(%ebp)                              #4412.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4413.30
-        movswl    %ax, %esi                                     #4413.30
-        lea       1(%esi,%esi), %esi                            #4421.40
-        movl      -56(%ebp), %eax                               #4414.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4414.30
-        movswl    %ax, %ecx                                     #4414.30
-        movl      -112(%ebp), %eax                              #4415.30
-        lea       2(%ecx,%ecx), %ecx                            #4422.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4415.30
-        movl      %esi, -128(%ebp)                              #4421.40
-        movl      %ecx, -124(%ebp)                              #4422.40
-        movl      -120(%ebp), %ecx                              #4427.32
-        movswl    %ax, %edx                                     #4415.30
-        lea       3(%edx,%edx), %edx                            #4423.40
-        testl     %edi, %edi                                    #4427.32
-        movl      %edx, -24(%ebp)                               #4423.40
-        movl      -116(%ebp), %edx                              #4427.32
-        je        ..B9.14       # Prob 50%                      #4427.32
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.13:                        # Preds ..B9.12
-        movl      -132(%ebp), %esi                              #4427.43
-        movl      -20(%ebp), %eax                               #4427.43
-        movl      -32(%ebp), %edi                               #4427.49
-        lea       (%eax,%esi,2), %eax                           #4427.43
-        cmpl      %eax, %edi                                    #4427.49
-        jae       ..B9.34       # Prob 1%                       #4427.49
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.14:                        # Preds ..B9.13 ..B9.12
-        movl      -52(%ebp), %eax                               #4428.32
-        testl     %eax, %eax                                    #4428.32
-        je        ..B9.16       # Prob 50%                      #4428.32
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.15:                        # Preds ..B9.14
-        movl      -128(%ebp), %esi                              #4428.43
-        addl      -20(%ebp), %esi                               #4428.43
-        movl      -32(%ebp), %eax                               #4428.49
-        cmpl      %esi, %eax                                    #4428.49
-        jae       ..B9.34       # Prob 1%                       #4428.49
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.16:                        # Preds ..B9.15 ..B9.14
-        movl      -56(%ebp), %eax                               #4429.32
-        testl     %eax, %eax                                    #4429.32
-        je        ..B9.18       # Prob 50%                      #4429.32
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.17:                        # Preds ..B9.16
-        movl      -124(%ebp), %esi                              #4429.43
-        addl      -20(%ebp), %esi                               #4429.43
-        movl      -32(%ebp), %eax                               #4429.49
-        cmpl      %esi, %eax                                    #4429.49
-        jae       ..B9.34       # Prob 1%                       #4429.49
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.18:                        # Preds ..B9.17 ..B9.16
-        movl      -112(%ebp), %eax                              #4430.32
-        testl     %eax, %eax                                    #4430.32
-        je        ..B9.20       # Prob 50%                      #4430.32
-                                # LOE edx ecx dl cl dh ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.19:                        # Preds ..B9.18
-        movl      -24(%ebp), %esi                               #4430.43
-        addl      -20(%ebp), %esi                               #4430.43
-        movl      -32(%ebp), %eax                               #4430.49
-        cmpl      %esi, %eax                                    #4430.49
-        jae       ..B9.34       # Prob 1%                       #4430.49
-                                # LOE edx ecx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.20:                        # Preds ..B9.19 ..B9.18 ..B9.11
-        movl      -20(%ebp), %esi                               #4435.17
-        movl      -32(%ebp), %eax                               #4438.28
-        lea       4(%esi), %esi                                 #4435.17
-        cmpl      %eax, %esi                                    #4438.28
-        ja        ..B9.31       # Prob 1%                       #4438.28
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.21:                        # Preds ..B9.20
-        addl      $-1, %ecx                                     #4442.25
-        jne       ..B9.26       # Prob 50%                      #4442.39
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.22:                        # Preds ..B9.21
-        movl      -36(%ebp), %eax                               #4459.25
-        cmpl      %eax, %edx                                    #4459.25
-        jae       ..B9.31       # Prob 1%                       #4459.25
-                                # LOE edx xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.23:                        # Preds ..B9.22
-        movl      -20(%ebp), %esi                               #4463.13
-        movl      -32(%ebp), %eax                               #4464.24
-        lea       28(%esi), %esi                                #4463.13
-        cmpl      %eax, %esi                                    #4464.24
-        ja        ..B9.31       # Prob 1%                       #4464.24
-                                # LOE edx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.24:                        # Preds ..B9.23
-        movl      -16(%ebp), %eax                               #4469.22
-        movzbl    (%edx), %ecx                                  #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %edi        #4469.22
-        movzbl    1(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %di, -148(%ebp)                               #4469.22
-        movw      %cx, -146(%ebp)                               #4469.22
-        movzbl    2(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %cx, -144(%ebp)                               #4469.22
-        movzbl    3(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %cx, -142(%ebp)                               #4469.22
-        movzbl    4(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %cx, -140(%ebp)                               #4469.22
-        movzbl    5(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %cx, -138(%ebp)                               #4469.22
-        movzbl    6(%edx), %ecx                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %ecx        #4469.22
-        movw      %cx, -136(%ebp)                               #4469.22
-        movzbl    7(%edx), %ecx                                 #4469.22
-        addl      $8, %edx                                      #4484.13
-        movzwl    expand_2na.0 at GOTOFF(%eax,%ecx,2), %eax        #4469.22
-        movw      %ax, -134(%ebp)                               #4469.22
-        movdqu    -148(%ebp), %xmm0                             #4469.22
-        movl      %edx, -28(%ebp)                               #4484.13
-                                # LOE edx esi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.25:                        # Preds ..B9.5 ..B9.24
-        movl      $2, %ecx                                      #4352.13
-        jmp       ..B9.29       # Prob 100%                     #4352.13
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.26:                        # Preds ..B9.21
-        movl      -36(%ebp), %edi                               #4450.26
-        movl      -28(%ebp), %eax                               #4450.26
-        psrldq    $2, %xmm0                                     #4447.26
-        cmpl      %edi, %eax                                    #4450.26
-        jae       ..B9.28       # Prob 19%                      #4450.26
-                                # LOE eax edx ecx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.27:                        # Preds ..B9.26
-        movl      -16(%ebp), %edi                               #4451.57
-        movzbl    (%eax), %eax                                  #4451.72
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4451.57
-        pinsrw    $7, %eax, %xmm0                               #4451.30
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.28:                        # Preds ..B9.27 ..B9.26
-        addl      $1, -28(%ebp)                                 #4454.20
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.29:                        # Preds ..B9.25 ..B9.28 ..B9.33
-        movdqa    %xmm0, %xmm7                                  #4362.22
-        movdqa    %xmm0, %xmm6                                  #4363.22
-        pand      %xmm5, %xmm7                                  #4362.22
-        pand      %xmm4, %xmm6                                  #4363.22
-        pcmpeqd   %xmm6, %xmm7                                  #4364.22
-        pmovmskb  %xmm7, %eax                                   #4365.22
-        movl      %eax, -48(%ebp)                               #4365.22
-        jmp       ..B9.9        # Prob 100%                     #4365.22
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.31:                        # Preds ..B9.20 ..B9.22 ..B9.23 # Infreq
-        movl      -40(%ebp), %esi                               #4495.12
-        movl      -44(%ebp), %edi                               #4495.12
-        xorl      %eax, %eax                                    #4495.12
-        movl      %ebp, %esp                                    #4495.12
-        popl      %ebp                                          #4495.12
-        movl      %ebx, %esp                                    #4495.12
-        popl      %ebx                                          #4495.12
-        ret                                                     #4495.12
-                                # LOE
-..B9.33:                        # Preds ..B9.41                 # Infreq
-        movdqa    %xmm7, -72(%ebp)                              #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -120(%ebp), %xmm0                             #
-        movdqa    %xmm6, -104(%ebp)                             #
-        movl      $2, %ecx                                      #
-        movl      %edi, -16(%ebp)                               #
-        jmp       ..B9.29       # Prob 100%                     #
-                                # LOE edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.34:                        # Preds ..B9.13 ..B9.19 ..B9.17 ..B9.15 # Infreq
-        movl      -40(%ebp), %esi                               #4428.63
-        movl      -44(%ebp), %edi                               #4428.63
-        movl      $1, %eax                                      #4428.63
-        movl      %ebp, %esp                                    #4428.63
-        popl      %ebp                                          #4428.63
-        movl      %ebx, %esp                                    #4428.63
-        popl      %ebx                                          #4428.63
-        ret                                                     #4428.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-.LNeval_4na_32:
-	.data
-# -- End  eval_4na_32
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    2,0x90
-eval_4na_128:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B10.1:                        # Preds ..B10.0
-        pushl     %ebx                                          #4724.1
-        movl      %esp, %ebx                                    #4724.1
-        andl      $-16, %esp                                    #4724.1
-        pushl     %ebp                                          #4724.1
-        pushl     %ebp                                          #4724.1
-        movl      4(%ebx), %ebp                                 #4724.1
-        movl      %ebp, 4(%esp)                                 #4724.1
-        movl      %esp, %ebp                                    #4724.1
-        subl      $120, %esp                                    #4724.1
-        movl      %ebx, -120(%ebp)                              #4724.1
-        movl      %edi, -24(%ebp)                               #4724.1
-        movl      %esi, -20(%ebp)                               #4724.1
-        movl      12(%ebx), %ecx                                #4722.5
-        movl      16(%ebx), %esi                                #4722.5
-        call      ..L10         # Prob 100%                     #4724.1
-..L10:                                                          #
-        popl      %edi                                          #4724.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L10], %edi      #4724.1
-        lea       _gprof_pack9 at GOTOFF(%edi), %edx               #4724.1
-        movl      %edi, %ebx                                    #4724.1
-        call      mcount at PLT                                    #4724.1
-        movl      -120(%ebp), %ebx                              #4724.1
-                                # LOE esi edi
-..B10.37:                       # Preds ..B10.1
-        movl      12(%ebx), %ecx                                #
-        movl      %esi, -100(%ebp)                              #
-        movl      %esi, %eax                                    #4760.49
-        movl      %edi, -96(%ebp)                               #
-        shrl      $2, %eax                                      #4760.49
-        movl      20(%ebx), %edi                                #4757.5
-        movl      %eax, -4(%ebp)                                #4760.49
-        movl      8(%ebx), %eax                                 #4763.12
-        movdqa    16(%eax), %xmm5                               #4776.5
-        movdqa    32(%eax), %xmm4                               #4776.5
-        movdqa    48(%eax), %xmm3                               #4776.5
-        movdqa    64(%eax), %xmm2                               #4776.5
-        movdqa    80(%eax), %xmm1                               #4776.5
-        movdqa    96(%eax), %xmm6                               #4776.5
-        movdqa    128(%eax), %xmm7                              #4776.5
-        lea       (%esi,%edi), %edx                             #4757.5
-        subl      4(%eax), %edx                                 #4763.12
-        movl      %edx, -12(%ebp)                               #4763.12
-        movl      -4(%ebp), %edx                                #4769.14
-        lea       3(%esi,%edi), %esi                            #4766.50
-        movl      -96(%ebp), %edi                               #4769.14
-        shrl      $2, %esi                                      #4766.57
-        addl      %ecx, %esi                                    #4766.30
-        movl      %esi, -16(%ebp)                               #4766.30
-        movzbl    (%edx,%ecx), %esi                             #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -116(%ebp)                               #4769.14
-        movzbl    1(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -114(%ebp)                               #4769.14
-        movzbl    2(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -112(%ebp)                               #4769.14
-        movzbl    3(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -110(%ebp)                               #4769.14
-        movzbl    4(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -108(%ebp)                               #4769.14
-        movzbl    5(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -106(%ebp)                               #4769.14
-        movzbl    6(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        movw      %si, -104(%ebp)                               #4769.14
-        movzbl    7(%edx,%ecx), %esi                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #4769.14
-        lea       8(%ecx,%edx), %edx                            #4770.5
-        movl      -12(%ebp), %ecx                               #4781.20
-        movw      %si, -102(%ebp)                               #4769.14
-        movdqu    -116(%ebp), %xmm0                             #4769.14
-        movl      -100(%ebp), %esi                              #4781.20
-        movdqa    %xmm0, -40(%ebp)                              #4769.14
-        movdqa    112(%eax), %xmm0                              #4776.5
-        movl      %edx, -8(%ebp)                                #4770.5
-        subl      %esi, %ecx                                    #4781.20
-        addl      $7, %ecx                                      #4781.33
-        shrl      $2, %ecx                                      #4781.40
-        movl      %esi, %eax                                    #4790.20
-        andl      $3, %eax                                      #4790.20
-        je        ..B10.32      # Prob 20%                      #4790.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.2:                        # Preds ..B10.37
-        cmpl      $1, %eax                                      #4790.20
-        je        ..B10.8       # Prob 25%                      #4790.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.3:                        # Preds ..B10.2
-        cmpl      $2, %eax                                      #4790.20
-        je        ..B10.7       # Prob 33%                      #4790.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.4:                        # Preds ..B10.3
-        cmpl      $3, %eax                                      #4790.20
-        je        ..B10.6       # Prob 50%                      #4790.20
-                                # LOE edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.5:                        # Preds ..B10.4
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movdqa    %xmm6, -56(%ebp)                              #
-        jmp       ..B10.16      # Prob 100%                     #
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.6:                        # Preds ..B10.4
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movdqa    %xmm6, -56(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -100(%ebp)                              #
-        movl      %ecx, -4(%ebp)                                #
-        movl      %eax, -96(%ebp)                               #
-        movl      %eax, -92(%ebp)                               #
-        jmp       ..B10.11      # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.7:                        # Preds ..B10.3
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movdqa    %xmm6, -56(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -96(%ebp)                               #
-        movl      %ecx, -4(%ebp)                                #
-        movl      %eax, -92(%ebp)                               #
-        jmp       ..B10.10      # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.8:                        # Preds ..B10.2
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movdqa    %xmm6, -56(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %ecx, -4(%ebp)                                #
-        movl      %eax, -92(%ebp)                               #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.9:                        # Preds ..B10.8 ..B10.20
-        movdqa    %xmm0, %xmm7                                  #4814.22
-        movdqa    %xmm0, %xmm6                                  #4815.22
-        pand      %xmm3, %xmm7                                  #4814.22
-        pand      %xmm2, %xmm6                                  #4815.22
-        pcmpeqd   %xmm6, %xmm7                                  #4816.22
-        pmovmskb  %xmm7, %eax                                   #4817.22
-        addl      $1, %eax                                      #4818.17
-        shrl      $16, %eax                                     #4818.17
-        negl      %eax                                          #4818.17
-        movl      %eax, -96(%ebp)                               #4818.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.10:                       # Preds ..B10.7 ..B10.9
-        movdqa    %xmm0, %xmm7                                  #4821.22
-        movdqa    %xmm0, %xmm6                                  #4822.22
-        pand      -56(%ebp), %xmm6                              #4822.22
-        pand      %xmm1, %xmm7                                  #4821.22
-        pcmpeqd   %xmm6, %xmm7                                  #4823.22
-        pmovmskb  %xmm7, %eax                                   #4824.22
-        addl      $1, %eax                                      #4825.17
-        shrl      $16, %eax                                     #4825.17
-        negl      %eax                                          #4825.17
-        movl      %eax, -100(%ebp)                              #4825.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.11:                       # Preds ..B10.6 ..B10.10
-        movdqa    %xmm0, %xmm7                                  #4828.22
-        movdqa    %xmm0, %xmm6                                  #4829.22
-        movl      -92(%ebp), %ecx                               #4839.29
-        pand      -72(%ebp), %xmm7                              #4828.22
-        pand      -88(%ebp), %xmm6                              #4829.22
-        pcmpeqd   %xmm6, %xmm7                                  #4830.22
-        pmovmskb  %xmm7, %eax                                   #4831.22
-        andl      $-4, %esi                                     #4836.17
-        addl      $1, %eax                                      #4832.17
-        orl       -96(%ebp), %ecx                               #4839.29
-        orl       -100(%ebp), %ecx                              #4839.34
-        shrl      $16, %eax                                     #4832.17
-        negl      %eax                                          #4832.17
-        orl       %eax, %ecx                                    #4839.39
-        jne       ..B10.21      # Prob 1%                       #4839.47
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.12:                       # Preds ..B10.11
-        movl      -12(%ebp), %eax                               #4883.28
-        addl      $4, %esi                                      #4880.17
-        cmpl      %eax, %esi                                    #4883.28
-        ja        ..B10.28      # Prob 1%                       #4883.28
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.13:                       # Preds ..B10.12
-        movl      -4(%ebp), %eax                                #4887.25
-        addl      $-1, %eax                                     #4887.25
-        movl      %eax, -4(%ebp)                                #4887.25
-        jne       ..B10.17      # Prob 50%                      #4887.39
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.14:                       # Preds ..B10.13
-        movl      -16(%ebp), %eax                               #4904.25
-        cmpl      %eax, %edx                                    #4904.25
-        jae       ..B10.28      # Prob 1%                       #4904.25
-                                # LOE edx esi edi xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.15:                       # Preds ..B10.14
-        movzbl    (%edx), %eax                                  #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %ecx        #4914.22
-        movzbl    1(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %cx, -116(%ebp)                               #4914.22
-        movw      %ax, -114(%ebp)                               #4914.22
-        movzbl    2(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %ax, -112(%ebp)                               #4914.22
-        movzbl    3(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %ax, -110(%ebp)                               #4914.22
-        movzbl    4(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %ax, -108(%ebp)                               #4914.22
-        movzbl    5(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %ax, -106(%ebp)                               #4914.22
-        movzbl    6(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        movw      %ax, -104(%ebp)                               #4914.22
-        movzbl    7(%edx), %eax                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #4914.22
-        addl      $8, %edx                                      #4929.13
-        movw      %ax, -102(%ebp)                               #4914.22
-        movdqu    -116(%ebp), %xmm0                             #4914.22
-        movl      %edx, -8(%ebp)                                #4929.13
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.16:                       # Preds ..B10.5 ..B10.15
-        movl      $8, %eax                                      #4797.13
-        movl      %eax, -4(%ebp)                                #4797.13
-        jmp       ..B10.20      # Prob 100%                     #4797.13
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.17:                       # Preds ..B10.13
-        movl      -16(%ebp), %ecx                               #4895.26
-        movl      -8(%ebp), %eax                                #4895.26
-        psrldq    $2, %xmm0                                     #4892.26
-        cmpl      %ecx, %eax                                    #4895.26
-        jae       ..B10.19      # Prob 19%                      #4895.26
-                                # LOE eax edx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.18:                       # Preds ..B10.17
-        movzbl    (%eax), %ecx                                  #4896.72
-        movzwl    expand_2na.0 at GOTOFF(%edi,%ecx,2), %eax        #4896.57
-        pinsrw    $7, %eax, %xmm0                               #4896.30
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.19:                       # Preds ..B10.18 ..B10.17
-        addl      $1, -8(%ebp)                                  #4899.20
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.20:                       # Preds ..B10.16 ..B10.19 ..B10.32
-        movdqa    %xmm0, %xmm7                                  #4807.22
-        movdqa    %xmm0, %xmm6                                  #4808.22
-        pand      %xmm5, %xmm7                                  #4807.22
-        pand      %xmm4, %xmm6                                  #4808.22
-        pcmpeqd   %xmm6, %xmm7                                  #4809.22
-        pmovmskb  %xmm7, %eax                                   #4810.22
-        addl      $1, %eax                                      #4811.17
-        shrl      $16, %eax                                     #4811.17
-        negl      %eax                                          #4811.17
-        movl      %eax, -92(%ebp)                               #4811.17
-        jmp       ..B10.9       # Prob 100%                     #4811.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.21:                       # Preds ..B10.11                # Infreq
-        movl      -92(%ebp), %eax                               #
-        movl      -12(%ebp), %edx                               #4842.30
-        subl      %esi, %edx                                    #4842.30
-        movl      %edx, -12(%ebp)                               #4842.30
-        cmpl      $2, %edx                                      #4842.37
-        je        ..B10.25      # Prob 25%                      #4842.37
-                                # LOE eax edx al dl ah dh
-..B10.22:                       # Preds ..B10.21                # Infreq
-        cmpl      $1, %edx                                      #4842.37
-        je        ..B10.26      # Prob 33%                      #4842.37
-                                # LOE eax edx al dl ah dh
-..B10.23:                       # Preds ..B10.22                # Infreq
-        testl     %edx, %edx                                    #4842.37
-        je        ..B10.27      # Prob 50%                      #4842.37
-                                # LOE eax al ah
-..B10.24:                       # Preds ..B10.25 ..B10.26 ..B10.27 ..B10.23 # Infreq
-        movl      -20(%ebp), %esi                               #4845.32
-        movl      -24(%ebp), %edi                               #4845.32
-        movl      $1, %eax                                      #4845.32
-        movl      %ebp, %esp                                    #4845.32
-        popl      %ebp                                          #4845.32
-        movl      %ebx, %esp                                    #4845.32
-        popl      %ebx                                          #4845.32
-        ret                                                     #4845.32
-                                # LOE
-..B10.25:                       # Preds ..B10.21                # Infreq
-        movl      -100(%ebp), %edx                              #4847.36
-        testl     %edx, %edx                                    #4847.36
-        jne       ..B10.24      # Prob 28%                      #4847.36
-                                # LOE eax al ah
-..B10.26:                       # Preds ..B10.25 ..B10.22       # Infreq
-        movl      -96(%ebp), %edx                               #4849.36
-        testl     %edx, %edx                                    #4849.36
-        jne       ..B10.24      # Prob 28%                      #4849.36
-                                # LOE eax al ah
-..B10.27:                       # Preds ..B10.23 ..B10.26       # Infreq
-        testl     %eax, %eax                                    #4851.36
-        jne       ..B10.24      # Prob 28%                      #4851.36
-                                # LOE
-..B10.28:                       # Preds ..B10.14 ..B10.12 ..B10.27 # Infreq
-        movl      -20(%ebp), %esi                               #4853.28
-        movl      -24(%ebp), %edi                               #4853.28
-        xorl      %eax, %eax                                    #4853.28
-        movl      %ebp, %esp                                    #4853.28
-        popl      %ebp                                          #4853.28
-        movl      %ebx, %esp                                    #4853.28
-        popl      %ebx                                          #4853.28
-        ret                                                     #4853.28
-                                # LOE
-..B10.32:                       # Preds ..B10.37                # Infreq
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -40(%ebp), %xmm0                              #
-        movdqa    %xmm6, -56(%ebp)                              #
-        movl      %ecx, -4(%ebp)                                #
-        jmp       ..B10.20      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-.LNeval_4na_128:
-	.data
-# -- End  eval_4na_128
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    2,0x90
-eval_2na_pos:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B11.1:                        # Preds ..B11.0
-        pushl     %ebx                                          #3662.1
-        movl      %esp, %ebx                                    #3662.1
-        andl      $-16, %esp                                    #3662.1
-        pushl     %ebp                                          #3662.1
-        pushl     %ebp                                          #3662.1
-        movl      4(%ebx), %ebp                                 #3662.1
-        movl      %ebp, 4(%esp)                                 #3662.1
-        movl      %esp, %ebp                                    #3662.1
-        subl      $104, %esp                                    #3662.1
-        movl      %ebx, -104(%ebp)                              #3662.1
-        movl      %edi, -36(%ebp)                               #3662.1
-        movl      %esi, -40(%ebp)                               #3662.1
-        movl      16(%ebx), %esi                                #3660.5
-        call      ..L11         # Prob 100%                     #3662.1
-..L11:                                                          #
-        popl      %eax                                          #3662.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L11], %eax      #3662.1
-        lea       _gprof_pack10 at GOTOFF(%eax), %edx              #3662.1
-        movl      %eax, %ebx                                    #3662.1
-        call      mcount at PLT                                    #3662.1
-        movl      -104(%ebp), %ebx                              #3662.1
-                                # LOE esi
-..B11.60:                       # Preds ..B11.1
-        movl      20(%ebx), %ecx                                #3705.5
-        movl      12(%ebx), %eax                                #3713.30
-        movl      %esi, -32(%ebp)                               #3662.1
-        lea       (%esi,%ecx), %edx                             #3705.5
-        movl      %esi, %edi                                    #3713.49
-        shrl      $2, %edi                                      #3713.49
-        movl      %edi, -12(%ebp)                               #3713.49
-        lea       (%eax,%edi), %edi                             #3713.30
-        movl      %edi, -16(%ebp)                               #3713.30
-        lea       3(%esi,%ecx), %ecx                            #3719.50
-        shrl      $2, %ecx                                      #3719.57
-        movl      8(%ebx), %edi                                 #3716.12
-        subl      4(%edi), %edx                                 #3716.12
-        addl      %eax, %ecx                                    #3719.30
-        movl      -16(%ebp), %eax                               #3722.14
-        movl      %ecx, -20(%ebp)                               #3719.30
-        movl      -12(%ebp), %ecx                               #3722.14
-        testb     $15, %al                                      #3722.14
-        jne       ..B11.3       # Prob 50%                      #3722.14
-                                # LOE eax edx ecx esi al cl ah ch
-..B11.2:                        # Preds ..B11.60
-        movdqa    (%eax), %xmm0                                 #3722.14
-        movdqa    %xmm0, -56(%ebp)                              #3722.14
-        jmp       ..B11.4       # Prob 100%                     #3722.14
-                                # LOE edx ecx esi cl ch
-..B11.3:                        # Preds ..B11.60
-        movdqu    (%eax), %xmm0                                 #3722.14
-        movdqa    %xmm0, -56(%ebp)                              #3722.14
-                                # LOE edx ecx esi cl ch
-..B11.4:                        # Preds ..B11.2 ..B11.3
-        movl      12(%ebx), %edi                                #3723.5
-        movl      -20(%ebp), %eax                               #3728.16
-        lea       16(%edi,%ecx), %edi                           #3723.5
-        movl      %edi, -28(%ebp)                               #3723.5
-        cmpl      %eax, %edi                                    #3728.16
-        jae       ..B11.6       # Prob 12%                      #3728.16
-                                # LOE edx esi edi
-..B11.5:                        # Preds ..B11.4
-        movzbl    -1(%edi), %ecx                                #3729.24
-        shll      $8, %ecx                                      #3729.38
-        jmp       ..B11.7       # Prob 100%                     #3729.38
-                                # LOE edx ecx esi edi
-..B11.6:                        # Preds ..B11.4
-        xorl      %ecx, %ecx                                    #
-                                # LOE edx ecx esi edi
-..B11.7:                        # Preds ..B11.5 ..B11.6
-        movl      8(%ebx), %eax                                 #3733.5
-        movdqa    16(%eax), %xmm6                               #3733.5
-        movdqa    32(%eax), %xmm5                               #3733.5
-        movdqa    48(%eax), %xmm4                               #3733.5
-        movdqa    64(%eax), %xmm3                               #3733.5
-        movdqa    80(%eax), %xmm2                               #3733.5
-        movdqa    96(%eax), %xmm1                               #3733.5
-        movdqa    112(%eax), %xmm0                              #3733.5
-        movdqa    128(%eax), %xmm7                              #3733.5
-        movl      %edx, %eax                                    #3738.20
-        subl      %esi, %eax                                    #3738.20
-        addl      $7, %eax                                      #3738.33
-        shrl      $2, %eax                                      #3738.40
-        movl      %eax, -24(%ebp)                               #3738.40
-        movl      %esi, %eax                                    #3745.20
-        andl      $3, %eax                                      #3745.20
-        je        ..B11.55      # Prob 20%                      #3745.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.8:                        # Preds ..B11.7
-        cmpl      $1, %eax                                      #3745.20
-        je        ..B11.14      # Prob 25%                      #3745.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.9:                        # Preds ..B11.8
-        cmpl      $2, %eax                                      #3745.20
-        je        ..B11.13      # Prob 33%                      #3745.20
-                                # LOE eax edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.10:                       # Preds ..B11.9
-        cmpl      $3, %eax                                      #3745.20
-        je        ..B11.12      # Prob 50%                      #3745.20
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.11:                       # Preds ..B11.10
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movl      %edx, -92(%ebp)                               #
-        jmp       ..B11.26      # Prob 100%                     #
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.12:                       # Preds ..B11.10
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movl      %edx, -92(%ebp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -100(%ebp)                              #
-        movl      %eax, -96(%ebp)                               #
-        movl      %eax, -12(%ebp)                               #
-        jmp       ..B11.17      # Prob 100%                     #
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.13:                       # Preds ..B11.9
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movl      %edx, -92(%ebp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -96(%ebp)                               #
-        movl      %eax, -12(%ebp)                               #
-        jmp       ..B11.16      # Prob 100%                     #
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.14:                       # Preds ..B11.8
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movl      %edx, -92(%ebp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -12(%ebp)                               #
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.15:                       # Preds ..B11.14 ..B11.30
-        movdqa    %xmm0, %xmm7                                  #3768.22
-        pand      %xmm3, %xmm7                                  #3768.22
-        pcmpeqd   %xmm4, %xmm7                                  #3769.22
-        pmovmskb  %xmm7, %eax                                   #3770.22
-        addl      $1, %eax                                      #3771.17
-        shrl      $16, %eax                                     #3771.17
-        negl      %eax                                          #3771.17
-        movl      %eax, -96(%ebp)                               #3771.17
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.16:                       # Preds ..B11.13 ..B11.15
-        movdqa    %xmm0, %xmm7                                  #3774.22
-        pand      %xmm1, %xmm7                                  #3774.22
-        pcmpeqd   %xmm2, %xmm7                                  #3775.22
-        pmovmskb  %xmm7, %eax                                   #3776.22
-        addl      $1, %eax                                      #3777.17
-        shrl      $16, %eax                                     #3777.17
-        negl      %eax                                          #3777.17
-        movl      %eax, -100(%ebp)                              #3777.17
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.17:                       # Preds ..B11.12 ..B11.16
-        movdqa    %xmm0, %xmm7                                  #3780.22
-        movl      -12(%ebp), %edx                               #3790.29
-        pand      -88(%ebp), %xmm7                              #3780.22
-        pcmpeqd   -72(%ebp), %xmm7                              #3781.22
-        pmovmskb  %xmm7, %eax                                   #3782.22
-        andl      $-4, %esi                                     #3787.17
-        orl       -96(%ebp), %edx                               #3790.29
-        addl      $1, %eax                                      #3783.17
-        orl       -100(%ebp), %edx                              #3790.34
-        shrl      $16, %eax                                     #3783.17
-        negl      %eax                                          #3783.17
-        orl       %eax, %edx                                    #3790.39
-        movl      %eax, -16(%ebp)                               #3783.17
-        jne       ..B11.31      # Prob 1%                       #3790.47
-                                # LOE eax ecx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.18:                       # Preds ..B11.17
-        movl      -92(%ebp), %eax                               #3856.28
-        addl      $4, %esi                                      #3853.17
-        cmpl      %eax, %esi                                    #3856.28
-        ja        ..B11.53      # Prob 1%                       #3856.28
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.19:                       # Preds ..B11.18
-        movl      -24(%ebp), %eax                               #3860.25
-        addl      $-1, %eax                                     #3860.25
-        movl      %eax, -24(%ebp)                               #3860.25
-        jne       ..B11.27      # Prob 50%                      #3860.39
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.20:                       # Preds ..B11.19
-        movl      -20(%ebp), %eax                               #3881.25
-        cmpl      %eax, %edi                                    #3881.25
-        jae       ..B11.53      # Prob 1%                       #3881.25
-                                # LOE eax ecx esi edi al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.21:                       # Preds ..B11.20
-        testl     $15, %edi                                     #3891.22
-        jne       ..B11.23      # Prob 50%                      #3891.22
-                                # LOE eax ecx esi edi al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.22:                       # Preds ..B11.21
-        movdqa    (%edi), %xmm0                                 #3891.22
-        jmp       ..B11.24      # Prob 100%                     #3891.22
-                                # LOE eax ecx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.23:                       # Preds ..B11.21
-        movdqu    (%edi), %xmm0                                 #3891.22
-                                # LOE eax ecx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.24:                       # Preds ..B11.22 ..B11.23
-        addl      $16, %edi                                     #3969.13
-        movl      %edi, -28(%ebp)                               #3969.13
-        cmpl      %eax, %edi                                    #3972.24
-        jae       ..B11.26      # Prob 12%                      #3972.24
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.25:                       # Preds ..B11.24
-        movzbl    -1(%edi), %ecx                                #3973.32
-        shll      $8, %ecx                                      #3973.46
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.26:                       # Preds ..B11.24 ..B11.11 ..B11.25
-        movl      $16, %eax                                     #3752.13
-        movl      %eax, -24(%ebp)                               #3752.13
-        jmp       ..B11.30      # Prob 100%                     #3752.13
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.27:                       # Preds ..B11.19
-        movl      -20(%ebp), %edx                               #3868.26
-        movl      -28(%ebp), %eax                               #3868.26
-        psrldq    $1, %xmm0                                     #3865.26
-        cmpl      %edx, %eax                                    #3868.26
-        jae       ..B11.29      # Prob 19%                      #3868.26
-                                # LOE eax ecx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.28:                       # Preds ..B11.27
-        movzbl    (%eax), %edx                                  #3871.37
-        sarl      $8, %ecx                                      #3870.21
-        shll      $8, %edx                                      #3871.48
-        orl       %edx, %ecx                                    #3871.21
-        pinsrw    $7, %ecx, %xmm0                               #3872.30
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.29:                       # Preds ..B11.28 ..B11.27
-        addl      $1, -28(%ebp)                                 #3876.20
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.30:                       # Preds ..B11.26 ..B11.29 ..B11.55
-        movdqa    %xmm0, %xmm7                                  #3762.22
-        pand      %xmm5, %xmm7                                  #3762.22
-        pcmpeqd   %xmm6, %xmm7                                  #3763.22
-        pmovmskb  %xmm7, %eax                                   #3764.22
-        addl      $1, %eax                                      #3765.17
-        shrl      $16, %eax                                     #3765.17
-        negl      %eax                                          #3765.17
-        movl      %eax, -12(%ebp)                               #3765.17
-        jmp       ..B11.15      # Prob 100%                     #3765.17
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.31:                       # Preds ..B11.17                # Infreq
-        movl      -92(%ebp), %edx                               #
-        movl      %eax, %ecx                                    #
-        movl      -12(%ebp), %eax                               #
-        subl      %esi, %edx                                    #3793.30
-        je        ..B11.52      # Prob 25%                      #3793.37
-                                # LOE eax edx ecx esi al cl ah ch
-..B11.32:                       # Preds ..B11.31                # Infreq
-        cmpl      $1, %edx                                      #3793.37
-        jne       ..B11.37      # Prob 67%                      #3793.37
-                                # LOE eax edx ecx esi al cl ah ch
-..B11.33:                       # Preds ..B11.32                # Infreq
-        testl     %eax, %eax                                    #3799.36
-        jne       ..B11.36      # Prob 28%                      #3799.36
-                                # LOE esi
-..B11.34:                       # Preds ..B11.33                # Infreq
-        movl      -96(%ebp), %eax                               #3800.36
-        testl     %eax, %eax                                    #3800.36
-        je        ..B11.53      # Prob 72%                      #3800.36
-                                # LOE esi
-..B11.35:                       # Preds ..B11.45 ..B11.39 ..B11.34 # Infreq
-        subl      -32(%ebp), %esi                               #3800.47
-        movl      -36(%ebp), %edi                               #3800.61
-        addl      $2, %esi                                      #3800.61
-        movl      %esi, %eax                                    #3800.61
-        movl      -40(%ebp), %esi                               #3800.61
-        movl      %ebp, %esp                                    #3800.61
-        popl      %ebp                                          #3800.61
-        movl      %ebx, %esp                                    #3800.61
-        popl      %ebx                                          #3800.61
-        ret                                                     #3800.61
-                                # LOE
-..B11.36:                       # Preds ..B11.52 ..B11.44 ..B11.38 ..B11.33 # Infreq
-        subl      -32(%ebp), %esi                               #3799.47
-        movl      -36(%ebp), %edi                               #3799.61
-        addl      $1, %esi                                      #3799.61
-        movl      %esi, %eax                                    #3799.61
-        movl      -40(%ebp), %esi                               #3799.61
-        movl      %ebp, %esp                                    #3799.61
-        popl      %ebp                                          #3799.61
-        movl      %ebx, %esp                                    #3799.61
-        popl      %ebx                                          #3799.61
-        ret                                                     #3799.61
-                                # LOE
-..B11.37:                       # Preds ..B11.32                # Infreq
-        cmpl      $2, %edx                                      #3793.37
-        jne       ..B11.44      # Prob 50%                      #3793.37
-                                # LOE eax ecx esi al cl ah ch
-..B11.38:                       # Preds ..B11.37                # Infreq
-        testl     %eax, %eax                                    #3803.36
-        jne       ..B11.36      # Prob 28%                      #3803.36
-                                # LOE esi
-..B11.39:                       # Preds ..B11.38                # Infreq
-        movl      -96(%ebp), %eax                               #3804.36
-        testl     %eax, %eax                                    #3804.36
-        jne       ..B11.35      # Prob 28%                      #3804.36
-                                # LOE esi
-..B11.40:                       # Preds ..B11.39                # Infreq
-        movl      -100(%ebp), %eax                              #3805.36
-        testl     %eax, %eax                                    #3805.36
-        je        ..B11.53      # Prob 72%                      #3805.36
-                                # LOE esi
-..B11.41:                       # Preds ..B11.46 ..B11.40       # Infreq
-        subl      -32(%ebp), %esi                               #3805.47
-        movl      -36(%ebp), %edi                               #3805.61
-        addl      $3, %esi                                      #3805.61
-        movl      %esi, %eax                                    #3805.61
-        movl      -40(%ebp), %esi                               #3805.61
-        movl      %ebp, %esp                                    #3805.61
-        popl      %ebp                                          #3805.61
-        movl      %ebx, %esp                                    #3805.61
-        popl      %ebx                                          #3805.61
-        ret                                                     #3805.61
-                                # LOE
-..B11.44:                       # Preds ..B11.37                # Infreq
-        testl     %eax, %eax                                    #3808.36
-        jne       ..B11.36      # Prob 28%                      #3808.36
-                                # LOE ecx esi cl ch
-..B11.45:                       # Preds ..B11.44                # Infreq
-        movl      -96(%ebp), %eax                               #3809.36
-        testl     %eax, %eax                                    #3809.36
-        jne       ..B11.35      # Prob 28%                      #3809.36
-                                # LOE ecx esi cl ch
-..B11.46:                       # Preds ..B11.45                # Infreq
-        movl      -100(%ebp), %eax                              #3810.36
-        testl     %eax, %eax                                    #3810.36
-        jne       ..B11.41      # Prob 28%                      #3810.36
-                                # LOE ecx esi cl ch
-..B11.47:                       # Preds ..B11.46                # Infreq
-        testl     %ecx, %ecx                                    #3811.36
-        je        ..B11.53      # Prob 72%                      #3811.36
-                                # LOE esi
-..B11.48:                       # Preds ..B11.47                # Infreq
-        subl      -32(%ebp), %esi                               #3811.47
-        movl      -36(%ebp), %edi                               #3811.61
-        addl      $4, %esi                                      #3811.61
-        movl      %esi, %eax                                    #3811.61
-        movl      -40(%ebp), %esi                               #3811.61
-        movl      %ebp, %esp                                    #3811.61
-        popl      %ebp                                          #3811.61
-        movl      %ebx, %esp                                    #3811.61
-        popl      %ebx                                          #3811.61
-        ret                                                     #3811.61
-                                # LOE
-..B11.52:                       # Preds ..B11.31                # Infreq
-        testl     %eax, %eax                                    #3796.36
-        jne       ..B11.36      # Prob 28%                      #3796.36
-                                # LOE esi
-..B11.53:                       # Preds ..B11.20 ..B11.18 ..B11.52 ..B11.34 ..B11.40
-                                #       ..B11.47                # Infreq
-        movl      -40(%ebp), %esi                               #3813.28
-        movl      -36(%ebp), %edi                               #3813.28
-        xorl      %eax, %eax                                    #3813.28
-        movl      %ebp, %esp                                    #3813.28
-        popl      %ebp                                          #3813.28
-        movl      %ebx, %esp                                    #3813.28
-        popl      %ebx                                          #3813.28
-        ret                                                     #3813.28
-                                # LOE
-..B11.55:                       # Preds ..B11.7                 # Infreq
-        movdqa    %xmm7, -88(%ebp)                              #
-        movdqa    %xmm0, -72(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movl      %edx, -92(%ebp)                               #
-        jmp       ..B11.30      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-.LNeval_2na_pos:
-	.data
-# -- End  eval_2na_pos
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    2,0x90
-eval_4na_pos:
-# parameter 1(self): 8 + %ebx
-# parameter 2(ncbi2na): 12 + %ebx
-# parameter 3(pos): 16 + %ebx
-# parameter 4(len): 20 + %ebx
-..B12.1:                        # Preds ..B12.0
-        pushl     %ebx                                          #4946.1
-        movl      %esp, %ebx                                    #4946.1
-        andl      $-16, %esp                                    #4946.1
-        pushl     %ebp                                          #4946.1
-        pushl     %ebp                                          #4946.1
-        movl      4(%ebx), %ebp                                 #4946.1
-        movl      %ebp, 4(%esp)                                 #4946.1
-        movl      %esp, %ebp                                    #4946.1
-        subl      $136, %esp                                    #4946.1
-        movl      %ebx, -136(%ebp)                              #4946.1
-        movl      %edi, -32(%ebp)                               #4946.1
-        movl      %esi, -36(%ebp)                               #4946.1
-        movl      12(%ebx), %ecx                                #4944.5
-        movl      16(%ebx), %esi                                #4944.5
-        call      ..L12         # Prob 100%                     #4946.1
-..L12:                                                          #
-        popl      %edi                                          #4946.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L12], %edi      #4946.1
-        lea       _gprof_pack11 at GOTOFF(%edi), %edx              #4946.1
-        movl      %edi, %ebx                                    #4946.1
-        call      mcount at PLT                                    #4946.1
-        movl      -136(%ebp), %ebx                              #4946.1
-                                # LOE esi edi
-..B12.50:                       # Preds ..B12.1
-        movl      12(%ebx), %ecx                                #
-        movl      %esi, -116(%ebp)                              #
-        movl      %esi, %eax                                    #4993.49
-        movl      %edi, -112(%ebp)                              #
-        movl      20(%ebx), %edi                                #4985.5
-        movl      %esi, -28(%ebp)                               #4946.1
-        lea       (%esi,%edi), %edx                             #4985.5
-        shrl      $2, %eax                                      #4993.49
-        lea       3(%esi,%edi), %esi                            #4999.50
-        movl      -112(%ebp), %edi                              #5002.14
-        movl      %eax, -12(%ebp)                               #4993.49
-        movl      8(%ebx), %eax                                 #4996.12
-        movdqa    16(%eax), %xmm5                               #5009.5
-        movdqa    32(%eax), %xmm4                               #5009.5
-        subl      4(%eax), %edx                                 #4996.12
-        movdqa    48(%eax), %xmm3                               #5009.5
-        movdqa    64(%eax), %xmm2                               #5009.5
-        movdqa    80(%eax), %xmm1                               #5009.5
-        movdqa    96(%eax), %xmm6                               #5009.5
-        movdqa    128(%eax), %xmm7                              #5009.5
-        movl      %edx, -20(%ebp)                               #4996.12
-        movl      -12(%ebp), %edx                               #5002.14
-        shrl      $2, %esi                                      #4999.57
-        addl      %ecx, %esi                                    #4999.30
-        movl      %esi, -24(%ebp)                               #4999.30
-        movzbl    (%edx,%ecx), %esi                             #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -132(%ebp)                               #5002.14
-        movzbl    1(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -130(%ebp)                               #5002.14
-        movzbl    2(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -128(%ebp)                               #5002.14
-        movzbl    3(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -126(%ebp)                               #5002.14
-        movzbl    4(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -124(%ebp)                               #5002.14
-        movzbl    5(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -122(%ebp)                               #5002.14
-        movzbl    6(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        movw      %si, -120(%ebp)                               #5002.14
-        movzbl    7(%edx,%ecx), %esi                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%edi,%esi,2), %esi        #5002.14
-        lea       8(%ecx,%edx), %edx                            #5003.5
-        movl      -20(%ebp), %ecx                               #5014.20
-        movw      %si, -118(%ebp)                               #5002.14
-        movdqu    -132(%ebp), %xmm0                             #5002.14
-        movl      -116(%ebp), %esi                              #5014.20
-        movdqa    %xmm0, -56(%ebp)                              #5002.14
-        movdqa    112(%eax), %xmm0                              #5009.5
-        movl      %edx, -16(%ebp)                               #5003.5
-        subl      %esi, %ecx                                    #5014.20
-        addl      $7, %ecx                                      #5014.33
-        shrl      $2, %ecx                                      #5014.40
-        movl      %esi, %eax                                    #5023.20
-        andl      $3, %eax                                      #5023.20
-        je        ..B12.45      # Prob 20%                      #5023.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.2:                        # Preds ..B12.50
-        cmpl      $1, %eax                                      #5023.20
-        je        ..B12.8       # Prob 25%                      #5023.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.3:                        # Preds ..B12.2
-        cmpl      $2, %eax                                      #5023.20
-        je        ..B12.7       # Prob 33%                      #5023.20
-                                # LOE eax edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.4:                        # Preds ..B12.3
-        cmpl      $3, %eax                                      #5023.20
-        je        ..B12.6       # Prob 50%                      #5023.20
-                                # LOE edx ecx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.5:                        # Preds ..B12.4
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movdqa    %xmm6, -72(%ebp)                              #
-        jmp       ..B12.16      # Prob 100%                     #
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.6:                        # Preds ..B12.4
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movdqa    %xmm6, -72(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -116(%ebp)                              #
-        movl      %ecx, -12(%ebp)                               #
-        movl      %eax, -112(%ebp)                              #
-        movl      %eax, -40(%ebp)                               #
-        jmp       ..B12.11      # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.7:                        # Preds ..B12.3
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movdqa    %xmm6, -72(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %eax, -112(%ebp)                              #
-        movl      %ecx, -12(%ebp)                               #
-        movl      %eax, -40(%ebp)                               #
-        jmp       ..B12.10      # Prob 100%                     #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.8:                        # Preds ..B12.2
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movdqa    %xmm6, -72(%ebp)                              #
-        xorl      %eax, %eax                                    #
-        movl      %ecx, -12(%ebp)                               #
-        movl      %eax, -40(%ebp)                               #
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.9:                        # Preds ..B12.8 ..B12.20
-        movdqa    %xmm0, %xmm7                                  #5047.22
-        movdqa    %xmm0, %xmm6                                  #5048.22
-        pand      %xmm3, %xmm7                                  #5047.22
-        pand      %xmm2, %xmm6                                  #5048.22
-        pcmpeqd   %xmm6, %xmm7                                  #5049.22
-        pmovmskb  %xmm7, %eax                                   #5050.22
-        addl      $1, %eax                                      #5051.17
-        shrl      $16, %eax                                     #5051.17
-        negl      %eax                                          #5051.17
-        movl      %eax, -112(%ebp)                              #5051.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.10:                       # Preds ..B12.7 ..B12.9
-        movdqa    %xmm0, %xmm7                                  #5054.22
-        movdqa    %xmm0, %xmm6                                  #5055.22
-        pand      -72(%ebp), %xmm6                              #5055.22
-        pand      %xmm1, %xmm7                                  #5054.22
-        pcmpeqd   %xmm6, %xmm7                                  #5056.22
-        pmovmskb  %xmm7, %eax                                   #5057.22
-        addl      $1, %eax                                      #5058.17
-        shrl      $16, %eax                                     #5058.17
-        negl      %eax                                          #5058.17
-        movl      %eax, -116(%ebp)                              #5058.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.11:                       # Preds ..B12.6 ..B12.10
-        movdqa    %xmm0, %xmm7                                  #5061.22
-        movdqa    %xmm0, %xmm6                                  #5062.22
-        movl      -40(%ebp), %ecx                               #5072.29
-        pand      -88(%ebp), %xmm7                              #5061.22
-        pand      -104(%ebp), %xmm6                             #5062.22
-        pcmpeqd   %xmm6, %xmm7                                  #5063.22
-        pmovmskb  %xmm7, %eax                                   #5064.22
-        andl      $-4, %esi                                     #5069.17
-        addl      $1, %eax                                      #5065.17
-        orl       -112(%ebp), %ecx                              #5072.29
-        orl       -116(%ebp), %ecx                              #5072.34
-        shrl      $16, %eax                                     #5065.17
-        negl      %eax                                          #5065.17
-        movl      %eax, -108(%ebp)                              #5065.17
-        orl       %eax, %ecx                                    #5072.39
-        jne       ..B12.21      # Prob 1%                       #5072.47
-                                # LOE eax edx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.12:                       # Preds ..B12.11
-        movl      -20(%ebp), %eax                               #5138.28
-        addl      $4, %esi                                      #5135.17
-        cmpl      %eax, %esi                                    #5138.28
-        ja        ..B12.43      # Prob 1%                       #5138.28
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.13:                       # Preds ..B12.12
-        movl      -12(%ebp), %eax                               #5142.25
-        addl      $-1, %eax                                     #5142.25
-        movl      %eax, -12(%ebp)                               #5142.25
-        jne       ..B12.17      # Prob 50%                      #5142.39
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.14:                       # Preds ..B12.13
-        movl      -24(%ebp), %eax                               #5159.25
-        cmpl      %eax, %edx                                    #5159.25
-        jae       ..B12.43      # Prob 1%                       #5159.25
-                                # LOE edx esi edi xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.15:                       # Preds ..B12.14
-        movzbl    (%edx), %eax                                  #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %ecx        #5169.22
-        movzbl    1(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %cx, -132(%ebp)                               #5169.22
-        movw      %ax, -130(%ebp)                               #5169.22
-        movzbl    2(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %ax, -128(%ebp)                               #5169.22
-        movzbl    3(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %ax, -126(%ebp)                               #5169.22
-        movzbl    4(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %ax, -124(%ebp)                               #5169.22
-        movzbl    5(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %ax, -122(%ebp)                               #5169.22
-        movzbl    6(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        movw      %ax, -120(%ebp)                               #5169.22
-        movzbl    7(%edx), %eax                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%edi,%eax,2), %eax        #5169.22
-        addl      $8, %edx                                      #5184.13
-        movw      %ax, -118(%ebp)                               #5169.22
-        movdqu    -132(%ebp), %xmm0                             #5169.22
-        movl      %edx, -16(%ebp)                               #5184.13
-                                # LOE edx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.16:                       # Preds ..B12.5 ..B12.15
-        movl      $8, %eax                                      #5030.13
-        movl      %eax, -12(%ebp)                               #5030.13
-        jmp       ..B12.20      # Prob 100%                     #5030.13
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.17:                       # Preds ..B12.13
-        movl      -24(%ebp), %ecx                               #5150.26
-        movl      -16(%ebp), %eax                               #5150.26
-        psrldq    $2, %xmm0                                     #5147.26
-        cmpl      %ecx, %eax                                    #5150.26
-        jae       ..B12.19      # Prob 19%                      #5150.26
-                                # LOE eax edx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.18:                       # Preds ..B12.17
-        movzbl    (%eax), %ecx                                  #5151.72
-        movzwl    expand_2na.0 at GOTOFF(%edi,%ecx,2), %eax        #5151.57
-        pinsrw    $7, %eax, %xmm0                               #5151.30
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.19:                       # Preds ..B12.18 ..B12.17
-        addl      $1, -16(%ebp)                                 #5154.20
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.20:                       # Preds ..B12.16 ..B12.19 ..B12.45
-        movdqa    %xmm0, %xmm7                                  #5040.22
-        movdqa    %xmm0, %xmm6                                  #5041.22
-        pand      %xmm5, %xmm7                                  #5040.22
-        pand      %xmm4, %xmm6                                  #5041.22
-        pcmpeqd   %xmm6, %xmm7                                  #5042.22
-        pmovmskb  %xmm7, %eax                                   #5043.22
-        addl      $1, %eax                                      #5044.17
-        shrl      $16, %eax                                     #5044.17
-        negl      %eax                                          #5044.17
-        movl      %eax, -40(%ebp)                               #5044.17
-        jmp       ..B12.9       # Prob 100%                     #5044.17
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.21:                       # Preds ..B12.11                # Infreq
-        movl      %eax, %edx                                    #
-        movl      -40(%ebp), %eax                               #
-        movl      -20(%ebp), %ecx                               #5075.30
-        subl      %esi, %ecx                                    #5075.30
-        movl      %ecx, -20(%ebp)                               #5075.30
-        je        ..B12.42      # Prob 25%                      #5075.37
-                                # LOE eax edx ecx esi al dl cl ah dh ch
-..B12.22:                       # Preds ..B12.21                # Infreq
-        cmpl      $1, %ecx                                      #5075.37
-        jne       ..B12.27      # Prob 67%                      #5075.37
-                                # LOE eax edx ecx esi al dl cl ah dh ch
-..B12.23:                       # Preds ..B12.22                # Infreq
-        testl     %eax, %eax                                    #5081.36
-        jne       ..B12.26      # Prob 28%                      #5081.36
-                                # LOE esi
-..B12.24:                       # Preds ..B12.23                # Infreq
-        movl      -112(%ebp), %eax                              #5082.36
-        testl     %eax, %eax                                    #5082.36
-        je        ..B12.43      # Prob 72%                      #5082.36
-                                # LOE esi
-..B12.25:                       # Preds ..B12.35 ..B12.29 ..B12.24 # Infreq
-        subl      -28(%ebp), %esi                               #5082.47
-        movl      -32(%ebp), %edi                               #5082.61
-        addl      $2, %esi                                      #5082.61
-        movl      %esi, %eax                                    #5082.61
-        movl      -36(%ebp), %esi                               #5082.61
-        movl      %ebp, %esp                                    #5082.61
-        popl      %ebp                                          #5082.61
-        movl      %ebx, %esp                                    #5082.61
-        popl      %ebx                                          #5082.61
-        ret                                                     #5082.61
-                                # LOE
-..B12.26:                       # Preds ..B12.42 ..B12.34 ..B12.28 ..B12.23 # Infreq
-        subl      -28(%ebp), %esi                               #5081.47
-        movl      -32(%ebp), %edi                               #5081.61
-        addl      $1, %esi                                      #5081.61
-        movl      %esi, %eax                                    #5081.61
-        movl      -36(%ebp), %esi                               #5081.61
-        movl      %ebp, %esp                                    #5081.61
-        popl      %ebp                                          #5081.61
-        movl      %ebx, %esp                                    #5081.61
-        popl      %ebx                                          #5081.61
-        ret                                                     #5081.61
-                                # LOE
-..B12.27:                       # Preds ..B12.22                # Infreq
-        cmpl      $2, %ecx                                      #5075.37
-        jne       ..B12.34      # Prob 50%                      #5075.37
-                                # LOE eax edx esi al dl ah dh
-..B12.28:                       # Preds ..B12.27                # Infreq
-        testl     %eax, %eax                                    #5085.36
-        jne       ..B12.26      # Prob 28%                      #5085.36
-                                # LOE esi
-..B12.29:                       # Preds ..B12.28                # Infreq
-        movl      -112(%ebp), %eax                              #5086.36
-        testl     %eax, %eax                                    #5086.36
-        jne       ..B12.25      # Prob 28%                      #5086.36
-                                # LOE esi
-..B12.30:                       # Preds ..B12.29                # Infreq
-        movl      -116(%ebp), %eax                              #5087.36
-        testl     %eax, %eax                                    #5087.36
-        je        ..B12.43      # Prob 72%                      #5087.36
-                                # LOE esi
-..B12.31:                       # Preds ..B12.36 ..B12.30       # Infreq
-        subl      -28(%ebp), %esi                               #5087.47
-        movl      -32(%ebp), %edi                               #5087.61
-        addl      $3, %esi                                      #5087.61
-        movl      %esi, %eax                                    #5087.61
-        movl      -36(%ebp), %esi                               #5087.61
-        movl      %ebp, %esp                                    #5087.61
-        popl      %ebp                                          #5087.61
-        movl      %ebx, %esp                                    #5087.61
-        popl      %ebx                                          #5087.61
-        ret                                                     #5087.61
-                                # LOE
-..B12.34:                       # Preds ..B12.27                # Infreq
-        testl     %eax, %eax                                    #5090.36
-        jne       ..B12.26      # Prob 28%                      #5090.36
-                                # LOE edx esi dl dh
-..B12.35:                       # Preds ..B12.34                # Infreq
-        movl      -112(%ebp), %eax                              #5091.36
-        testl     %eax, %eax                                    #5091.36
-        jne       ..B12.25      # Prob 28%                      #5091.36
-                                # LOE edx esi dl dh
-..B12.36:                       # Preds ..B12.35                # Infreq
-        movl      -116(%ebp), %eax                              #5092.36
-        testl     %eax, %eax                                    #5092.36
-        jne       ..B12.31      # Prob 28%                      #5092.36
-                                # LOE edx esi dl dh
-..B12.37:                       # Preds ..B12.36                # Infreq
-        testl     %edx, %edx                                    #5093.36
-        je        ..B12.43      # Prob 72%                      #5093.36
-                                # LOE esi
-..B12.38:                       # Preds ..B12.37                # Infreq
-        subl      -28(%ebp), %esi                               #5093.47
-        movl      -32(%ebp), %edi                               #5093.61
-        addl      $4, %esi                                      #5093.61
-        movl      %esi, %eax                                    #5093.61
-        movl      -36(%ebp), %esi                               #5093.61
-        movl      %ebp, %esp                                    #5093.61
-        popl      %ebp                                          #5093.61
-        movl      %ebx, %esp                                    #5093.61
-        popl      %ebx                                          #5093.61
-        ret                                                     #5093.61
-                                # LOE
-..B12.42:                       # Preds ..B12.21                # Infreq
-        testl     %eax, %eax                                    #5078.36
-        jne       ..B12.26      # Prob 28%                      #5078.36
-                                # LOE esi
-..B12.43:                       # Preds ..B12.14 ..B12.12 ..B12.42 ..B12.24 ..B12.30
-                                #       ..B12.37                # Infreq
-        movl      -36(%ebp), %esi                               #5095.28
-        movl      -32(%ebp), %edi                               #5095.28
-        xorl      %eax, %eax                                    #5095.28
-        movl      %ebp, %esp                                    #5095.28
-        popl      %ebp                                          #5095.28
-        movl      %ebx, %esp                                    #5095.28
-        popl      %ebx                                          #5095.28
-        ret                                                     #5095.28
-                                # LOE
-..B12.45:                       # Preds ..B12.50                # Infreq
-        movdqa    %xmm7, -104(%ebp)                             #
-        movdqa    %xmm0, -88(%ebp)                              #
-        movdqa    -56(%ebp), %xmm0                              #
-        movdqa    %xmm6, -72(%ebp)                              #
-        movl      %ecx, -12(%ebp)                               #
-        jmp       ..B12.20      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE edx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-.LNeval_4na_pos:
-	.data
-# -- End  eval_4na_pos
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1(nss): 8 + %ebp
-# parameter 2(positional): 12 + %ebp
-# parameter 3(query): 16 + %ebp
-# parameter 4(len): 20 + %ebp
-..B13.1:                        # Preds ..B13.0
-        pushl     %ebp                                          #1539.1
-        movl      %esp, %ebp                                    #1539.1
-        subl      $16, %esp                                     #1539.1
-        movl      %edi, -8(%ebp)                                #1539.1
-        movl      %esi, -4(%ebp)                                #1539.1
-        movl      %ebx, -12(%ebp)                               #1539.1
-        movl      8(%ebp), %esi                                 #1537.5
-        call      ..L13         # Prob 100%                     #1539.1
-..L13:                                                          #
-        popl      %ebx                                          #1539.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L13], %ebx      #1539.1
-        lea       _gprof_pack12 at GOTOFF(%ebx), %edx              #1539.1
-        call      mcount at PLT                                    #1539.1
-                                # LOE ebx esi
-..B13.17:                       # Preds ..B13.1
-        testl     %esi, %esi                                    #1540.17
-        je        ..B13.12      # Prob 6%                       #1540.17
-                                # LOE ebx esi
-..B13.2:                        # Preds ..B13.17
-        movl      16(%ebp), %eax                                #1542.23
-        testl     %eax, %eax                                    #1542.23
-        je        ..B13.11      # Prob 12%                      #1542.23
-                                # LOE ebx esi
-..B13.3:                        # Preds ..B13.2
-        movl      20(%ebp), %eax                                #1542.38
-        testl     %eax, %eax                                    #1542.38
-        je        ..B13.11      # Prob 50%                      #1542.38
-                                # LOE ebx esi
-..B13.4:                        # Preds ..B13.3
-        movsbl    fasta_2na_map.0 at GOTOFF(%ebx), %eax            #1547.18
-        movl      $0, -16(%ebp)                                 #1544.24
-        testl     %eax, %eax                                    #1547.41
-        je        ..B13.13      # Prob 5%                       #1547.41
-                                # LOE ebx esi
-..B13.5:                        # Preds ..B13.13 ..B13.4
-        pushl     12(%ebp)                                      #1539.1
-        movl      20(%ebp), %edi                                #1550.19
-        movl      16(%ebp), %edx                                #1550.19
-        lea       -16(%ebp), %eax                               #1551.49
-        pushl     %eax                                          #1539.1
-        pushl     %esi                                          #1539.1
-        lea       (%edi,%edx), %edi                             #1550.19
-        pushl     %edi                                          #1539.1
-        pushl     %edx                                          #1539.1
-        call      nss_expr                                      #1551.21
-                                # LOE eax ebx esi edi
-..B13.18:                       # Preds ..B13.5
-        addl      $20, %esp                                     #1551.21
-                                # LOE eax ebx esi edi
-..B13.6:                        # Preds ..B13.18
-        movl      -16(%ebp), %edx                               #1552.18
-        testl     %edx, %edx                                    #1552.28
-        jne       ..B13.9       # Prob 22%                      #1552.28
-                                # LOE eax ebx esi edi
-..B13.7:                        # Preds ..B13.6
-        cmpl      %edi, %eax                                    #1554.31
-        je        ..B13.14      # Prob 5%                       #1554.31
-                                # LOE ebx esi
-..B13.8:                        # Preds ..B13.7
-        movl      $22, -16(%ebp)                                #1557.17
-                                # LOE ebx esi
-..B13.9:                        # Preds ..B13.8 ..B13.6
-        pushl     (%esi)                                        #1560.32
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE esi
-..B13.19:                       # Preds ..B13.9
-        popl      %ecx                                          #1560.13
-                                # LOE esi
-..B13.10:                       # Preds ..B13.19
-        movl      -16(%ebp), %eax                               #1562.20
-        movl      -12(%ebp), %ebx                               #1562.20
-        movl      -8(%ebp), %edi                                #1562.20
-        movl      $0, (%esi)                                    #1561.13
-        movl      -4(%ebp), %esi                                #1562.20
-        movl      %ebp, %esp                                    #1562.20
-        popl      %ebp                                          #1562.20
-        ret                                                     #1562.20
-                                # LOE
-..B13.11:                       # Preds ..B13.3 ..B13.2
-        movl      $0, (%esi)                                    #1565.9
-                                # LOE
-..B13.12:                       # Preds ..B13.17 ..B13.11
-        movl      -12(%ebp), %ebx                               #1567.12
-        movl      -4(%ebp), %esi                                #1567.12
-        movl      -8(%ebp), %edi                                #1567.12
-        movl      $22, %eax                                     #1567.12
-        movl      %ebp, %esp                                    #1567.12
-        popl      %ebp                                          #1567.12
-        ret                                                     #1567.12
-                                # LOE
-..B13.13:                       # Preds ..B13.4                 # Infreq
-        call      NucStrstrInit                                 #1548.17
-        jmp       ..B13.5       # Prob 100%                     #1548.17
-                                # LOE ebx esi
-..B13.14:                       # Preds ..B13.7                 # Infreq
-        movl      -12(%ebp), %ebx                               #1555.28
-        movl      -4(%ebp), %esi                                #1555.28
-        movl      -8(%ebp), %edi                                #1555.28
-        xorl      %eax, %eax                                    #1555.28
-        movl      %ebp, %esp                                    #1555.28
-        popl      %ebp                                          #1555.28
-        ret                                                     #1555.28
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-.LNNucStrstrMake:
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1(self): 8 + %ebp
-..B14.1:                        # Preds ..B14.0
-        pushl     %ebp                                          #1574.1
-        movl      %esp, %ebp                                    #1574.1
-        subl      $8, %esp                                      #1574.1
-        movl      %edi, -4(%ebp)                                #1574.1
-        movl      %ebx, -8(%ebp)                                #1574.1
-        movl      8(%ebp), %edi                                 #1573.6
-        call      ..L14         # Prob 100%                     #1574.1
-..L14:                                                          #
-        popl      %ebx                                          #1574.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L14], %ebx      #1574.1
-        lea       _gprof_pack13 at GOTOFF(%ebx), %edx              #1574.1
-        call      mcount at PLT                                    #1574.1
-                                # LOE ebx esi edi
-..B14.25:                       # Preds ..B14.1
-        testl     %edi, %edi                                    #1575.18
-        je        ..B14.22      # Prob 12%                      #1575.18
-                                # LOE ebx esi edi
-..B14.2:                        # Preds ..B14.25
-        movl      (%edi), %eax                                  #1577.18
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B14.21      # Prob 50%                      #1577.9
-                                # LOE eax ebx esi edi
-..B14.3:                        # Preds ..B14.2
-        movl      ..1..TPKT.18_0.0.15 at GOTOFF(%ebx,%eax,4), %eax #1577.9
-        jmp       *%eax                                         #1577.9
-                                # LOE ebx esi edi
-..1.18_0.TAG.0c.0.15:
-..B14.5:                        # Preds ..B14.3
-        pushl     8(%edi)                                       #1601.30
-        call      NucStrstrWhack at PLT                            #1601.13
-                                # LOE ebx esi edi
-..B14.26:                       # Preds ..B14.5
-        popl      %ecx                                          #1601.13
-        jmp       ..B14.21      # Prob 100%                     #1601.13
-                                # LOE ebx esi edi
-..1.18_0.TAG.0b.0.15:
-..B14.7:                        # Preds ..B14.3
-        pushl     8(%edi)                                       #1597.30
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE ebx esi edi
-..B14.8:                        # Preds ..B14.7
-        pushl     12(%edi)                                      #1598.30
-        call      NucStrstrWhack at PLT                            #1598.13
-                                # LOE ebx esi edi
-..B14.27:                       # Preds ..B14.8
-        addl      $8, %esp                                      #1598.13
-        jmp       ..B14.21      # Prob 100%                     #1598.13
-                                # LOE ebx esi edi
-..1.18_0.TAG.0a.0.15:
-..1.18_0.TAG.09.0.15:
-..1.18_0.TAG.08.0.15:
-..1.18_0.TAG.07.0.15:
-..1.18_0.TAG.06.0.15:
-..1.18_0.TAG.05.0.15:
-..1.18_0.TAG.04.0.15:
-..1.18_0.TAG.03.0.15:
-..1.18_0.TAG.02.0.15:
-..1.18_0.TAG.01.0.15:
-..1.18_0.TAG.00.0.15:
-..B14.20:                       # Preds ..B14.3 ..B14.3 ..B14.3 ..B14.3 ..B14.3
-                                #       ..B14.3 ..B14.3 ..B14.3 ..B14.3 ..B14.3
-                                #       ..B14.3
-        movl      8(%edi), %edi                                 #1593.20
-                                # LOE ebx esi edi
-..B14.21:                       # Preds ..B14.27 ..B14.26 ..B14.20 ..B14.2
-        pushl     %edi                                          #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE esi
-..B14.28:                       # Preds ..B14.21
-        popl      %ecx                                          #1604.9
-                                # LOE esi
-..B14.22:                       # Preds ..B14.28 ..B14.25
-        movl      -8(%ebp), %ebx                                #1606.1
-        movl      -4(%ebp), %edi                                #1606.1
-        movl      %ebp, %esp                                    #1606.1
-        popl      %ebp                                          #1606.1
-        ret                                                     #1606.1
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-.LNNucStrstrWhack:
-	.section .data1, "wa"
-	.align 4
-..1..TPKT.18_0.0.15:
-	.long	..1.18_0.TAG.00.0.15
-	.long	..1.18_0.TAG.01.0.15
-	.long	..1.18_0.TAG.02.0.15
-	.long	..1.18_0.TAG.03.0.15
-	.long	..1.18_0.TAG.04.0.15
-	.long	..1.18_0.TAG.05.0.15
-	.long	..1.18_0.TAG.06.0.15
-	.long	..1.18_0.TAG.07.0.15
-	.long	..1.18_0.TAG.08.0.15
-	.long	..1.18_0.TAG.09.0.15
-	.long	..1.18_0.TAG.0a.0.15
-	.long	..1.18_0.TAG.0b.0.15
-	.long	..1.18_0.TAG.0c.0.15
-	.data
-# -- End  NucStrstrWhack
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    2,0x90
-nss_unary_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B15.1:                        # Preds ..B15.0
-        pushl     %ebp                                          #1361.1
-        movl      %esp, %ebp                                    #1361.1
-        subl      $16, %esp                                     #1361.1
-        movl      %edi, -12(%ebp)                               #1361.1
-        movl      %esi, -8(%ebp)                                #1361.1
-        movl      %ebx, -4(%ebp)                                #1361.1
-        movl      8(%ebp), %esi                                 #1359.13
-        movl      16(%ebp), %edi                                #1359.13
-        call      ..L15         # Prob 100%                     #1361.1
-..L15:                                                          #
-        popl      %ebx                                          #1361.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L15], %ebx      #1361.1
-        lea       _gprof_pack14 at GOTOFF(%ebx), %edx              #1361.1
-        call      mcount at PLT                                    #1361.1
-        jmp       ..B15.2       # Prob 100%                     #1361.1
-                                # LOE ebx esi edi
-..B15.43:                       # Preds ..B15.42
-        movl      $12, (%eax)                                   #1384.13
-        movl      $13, 4(%eax)                                  #1385.13
-        movl      $0, 8(%eax)                                   #1386.13
-        movl      %eax, (%edi)                                  #1387.13
-        lea       8(%eax), %edi                                 #1389.44
-                                # LOE ebx esi edi
-..B15.2:                        # Preds ..B15.43 ..B15.1
-        movsbl    (%esi), %eax                                  #1363.12
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B15.32      # Prob 16%                      #1363.17
-                                # LOE eax ebx esi edi
-..B15.3:                        # Preds ..B15.2
-        cmpl      $94, %eax                                     #1364.16
-        jne       ..B15.10      # Prob 67%                      #1364.16
-                                # LOE eax ebx esi edi
-..B15.4:                        # Preds ..B15.3
-        pushl     $12                                           #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx esi edi
-..B15.48:                       # Preds ..B15.4
-        popl      %ecx                                          #1364.16
-        movl      %eax, %edx                                    #1364.16
-                                # LOE edx ebx esi edi
-..B15.5:                        # Preds ..B15.48
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.7       # Prob 68%                      #1364.16
-                                # LOE edx ebx esi edi
-..B15.6:                        # Preds ..B15.5
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax esi
-..B15.49:                       # Preds ..B15.6
-        movl      20(%ebp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.7:                        # Preds ..B15.5
-        movl      12(%ebp), %ecx                                #1361.1
-        movl      %edx, -16(%ebp)                               #1364.16
-        movl      $12, (%edx)                                   #1364.16
-        movl      $14, 4(%edx)                                  #1364.16
-        pushl     %ecx                                          #1361.1
-        movl      %edx, (%edi)                                  #1364.16
-        movl      $0, 8(%edx)                                   #1364.16
-        addl      $1, %esi                                      #1364.16
-        pushl     %esi                                          #1361.1
-        call      nss_sob                                       #1364.16
-                                # LOE eax
-..B15.50:                       # Preds ..B15.7
-        movl      -16(%ebp), %edx                               #
-        movl      24(%ebp), %ecx                                #1361.1
-        movl      20(%ebp), %ebx                                #1361.1
-        pushl     %ecx                                          #1361.1
-        pushl     %ebx                                          #1361.1
-        addl      $8, %edx                                      #1364.16
-        pushl     %edx                                          #1361.1
-        movl      12(%ebp), %edx                                #1361.1
-        pushl     %edx                                          #1361.1
-        pushl     %eax                                          #1361.1
-        call      nss_fasta_expr                                #1364.16
-                                # LOE eax
-..B15.51:                       # Preds ..B15.50
-        addl      $28, %esp                                     #1364.16
-        movl      %eax, %esi                                    #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.10:                       # Preds ..B15.3
-        cmpl      $40, %eax                                     #1364.16
-        jne       ..B15.21      # Prob 50%                      #1364.16
-                                # LOE ebx esi edi
-..B15.11:                       # Preds ..B15.10
-        pushl     $12                                           #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx esi edi
-..B15.52:                       # Preds ..B15.11
-        popl      %ecx                                          #1364.16
-        movl      %eax, %edx                                    #1364.16
-                                # LOE edx ebx esi edi
-..B15.12:                       # Preds ..B15.52
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.14      # Prob 68%                      #1364.16
-                                # LOE edx ebx esi edi
-..B15.13:                       # Preds ..B15.12
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax esi
-..B15.53:                       # Preds ..B15.13
-        movl      20(%ebp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.14:                       # Preds ..B15.12
-        movl      24(%ebp), %ecx                                #1361.1
-        movl      20(%ebp), %ebx                                #1361.1
-        movl      %edx, -16(%ebp)                               #1364.16
-        pushl     %ecx                                          #1361.1
-        movl      12(%ebp), %ecx                                #1361.1
-        movl      $12, (%edx)                                   #1364.16
-        movl      %edx, (%edi)                                  #1364.16
-        addl      $1, %esi                                      #1364.16
-        movl      $0, 4(%edx)                                   #1364.16
-        pushl     %ebx                                          #1361.1
-        lea       8(%edx), %edi                                 #1364.16
-        pushl     %edi                                          #1361.1
-        pushl     %ecx                                          #1361.1
-        pushl     %esi                                          #1361.1
-        call      nss_expr                                      #1364.16
-                                # LOE eax
-..B15.54:                       # Preds ..B15.14
-        movl      -16(%ebp), %edx                               #
-        addl      $20, %esp                                     #1364.16
-        movl      %eax, %esi                                    #1364.16
-                                # LOE edx esi dl dh
-..B15.15:                       # Preds ..B15.54
-        movl      20(%ebp), %ecx                                #1364.16
-        movl      (%ecx), %ebx                                  #1364.16
-        testl     %ebx, %ebx                                    #1364.16
-        jne       ..B15.27      # Prob 50%                      #1364.16
-                                # LOE edx esi dl dh
-..B15.16:                       # Preds ..B15.15
-        movl      8(%edx), %eax                                 #1364.16
-        testl     %eax, %eax                                    #1364.16
-        je        ..B15.19      # Prob 12%                      #1364.16
-                                # LOE esi
-..B15.17:                       # Preds ..B15.16
-        movl      12(%ebp), %eax                                #1364.16
-        cmpl      %eax, %esi                                    #1364.16
-        je        ..B15.19      # Prob 12%                      #1364.16
-                                # LOE esi
-..B15.18:                       # Preds ..B15.17
-        movsbl    (%esi), %eax                                  #1364.16
-        addl      $1, %esi                                      #1364.16
-        cmpl      $41, %eax                                     #1364.16
-        je        ..B15.27      # Prob 50%                      #1364.16
-                                # LOE esi
-..B15.19:                       # Preds ..B15.18 ..B15.17 ..B15.16
-        movl      20(%ebp), %eax                                #1364.16
-        movl      $22, (%eax)                                   #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.21:                       # Preds ..B15.10
-        movl      24(%ebp), %eax                                #1361.1
-        movl      20(%ebp), %edx                                #1361.1
-        movl      12(%ebp), %ecx                                #1361.1
-        pushl     %eax                                          #1361.1
-        pushl     %edx                                          #1361.1
-        pushl     %edi                                          #1361.1
-        pushl     %ecx                                          #1361.1
-        pushl     %esi                                          #1361.1
-        call      nss_fasta_expr                                #1364.16
-                                # LOE eax ebx edi
-..B15.55:                       # Preds ..B15.21
-        addl      $20, %esp                                     #1364.16
-        movl      %eax, %esi                                    #1364.16
-                                # LOE ebx esi edi
-..B15.22:                       # Preds ..B15.55
-        movl      20(%ebp), %eax                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.27      # Prob 50%                      #1364.16
-                                # LOE ebx esi edi
-..B15.23:                       # Preds ..B15.22
-        movl      12(%ebp), %eax                                #1364.16
-        cmpl      %eax, %esi                                    #1364.16
-        jae       ..B15.27      # Prob 33%                      #1364.16
-                                # LOE ebx esi edi
-..B15.24:                       # Preds ..B15.23
-        movl      12(%ebp), %eax                                #1361.1
-        pushl     %eax                                          #1361.1
-        pushl     %esi                                          #1361.1
-        call      nss_sob                                       #1364.16
-                                # LOE eax ebx edi
-..B15.56:                       # Preds ..B15.24
-        addl      $8, %esp                                      #1364.16
-        movl      %eax, %esi                                    #1364.16
-        movl      12(%ebp), %eax                                #1364.16
-        cmpl      %eax, %esi                                    #1364.16
-        jae       ..B15.27      # Prob 12%                      #1364.16
-                                # LOE ebx esi edi
-..B15.25:                       # Preds ..B15.56
-        movsbl    (%esi), %eax                                  #1364.16
-        cmpl      $36, %eax                                     #1364.16
-        je        ..B15.28      # Prob 5%                       #1364.16
-                                # LOE ebx esi edi
-..B15.27:                       # Preds ..B15.22 ..B15.23 ..B15.25 ..B15.30 ..B15.56
-                                #       ..B15.58 ..B15.15 ..B15.19 ..B15.18 ..B15.53
-                                #       ..B15.49 ..B15.51
-        movl      -4(%ebp), %ebx                                #1364.16
-        movl      -12(%ebp), %edi                               #1364.16
-        movl      %esi, %eax                                    #1364.16
-        movl      -8(%ebp), %esi                                #1364.16
-        movl      %ebp, %esp                                    #1364.16
-        popl      %ebp                                          #1364.16
-        ret                                                     #1364.16
-                                # LOE
-..B15.28:                       # Preds ..B15.25                # Infreq
-        pushl     $12                                           #1364.16
-        addl      $1, %esi                                      #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx esi edi
-..B15.57:                       # Preds ..B15.28                # Infreq
-        popl      %ecx                                          #1364.16
-                                # LOE eax ebx esi edi
-..B15.29:                       # Preds ..B15.57                # Infreq
-        testl     %eax, %eax                                    #1364.16
-        je        ..B15.31      # Prob 12%                      #1364.16
-                                # LOE eax ebx esi edi
-..B15.30:                       # Preds ..B15.29                # Infreq
-        movl      (%edi), %edx                                  #1364.16
-        movl      $12, (%eax)                                   #1364.16
-        movl      %edx, 8(%eax)                                 #1364.16
-        movl      %eax, (%edi)                                  #1364.16
-        movl      $15, 4(%eax)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.31:                       # Preds ..B15.29                # Infreq
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax esi
-..B15.58:                       # Preds ..B15.31                # Infreq
-        movl      20(%ebp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE esi
-..B15.32:                       # Preds ..B15.2                 # Infreq
-        movl      12(%ebp), %eax                                #1374.9
-        addl      $1, %esi                                      #1374.19
-        cmpl      %eax, %esi                                    #1374.9
-        jae       ..B15.38      # Prob 12%                      #1374.9
-                                # LOE ebx esi edi
-..B15.33:                       # Preds ..B15.32                # Infreq
-        call      __ctype_b_loc at PLT                             #1374.9
-                                # LOE eax ebx esi edi
-..B15.59:                       # Preds ..B15.33                # Infreq
-        movzbl    (%esi), %ecx                                  #1374.9
-        movl      (%eax), %edx                                  #1374.9
-        movzwl    (%edx,%ecx,2), %eax                           #1374.9
-        testl     $8192, %eax                                   #1374.9
-        je        ..B15.38      # Prob 15%                      #1374.9
-                                # LOE edx ebx esi edi
-..B15.34:                       # Preds ..B15.59                # Infreq
-        movl      12(%ebp), %eax                                #
-                                # LOE eax edx ebx esi edi
-..B15.35:                       # Preds ..B15.36 ..B15.34       # Infreq
-        addl      $1, %esi                                      #1374.9
-        cmpl      %eax, %esi                                    #1374.9
-        jae       ..B15.38      # Prob 1%                       #1374.9
-                                # LOE eax edx ebx esi edi
-..B15.36:                       # Preds ..B15.35                # Infreq
-        movzbl    (%esi), %ecx                                  #1374.9
-        movzwl    (%edx,%ecx,2), %ecx                           #1374.9
-        testl     $8192, %ecx                                   #1374.9
-        jne       ..B15.35      # Prob 82%                      #1374.9
-                                # LOE eax edx ebx esi edi
-..B15.38:                       # Preds ..B15.35 ..B15.36 ..B15.59 ..B15.32 # Infreq
-        movl      12(%ebp), %eax                                #1375.15
-        cmpl      %eax, %esi                                    #1375.15
-        jne       ..B15.41      # Prob 68%                      #1375.15
-                                # LOE ebx esi edi
-..B15.39:                       # Preds ..B15.38                # Infreq
-        movl      20(%ebp), %eax                                #1376.9
-        movl      $22, (%eax)                                   #1376.9
-                                # LOE esi
-..B15.40:                       # Preds ..B15.61 ..B15.39       # Infreq
-        movl      -4(%ebp), %ebx                                #1393.12
-        movl      -12(%ebp), %edi                               #1393.12
-        movl      %esi, %eax                                    #1375.5
-        movl      -8(%ebp), %esi                                #1393.12
-        movl      %ebp, %esp                                    #1393.12
-        popl      %ebp                                          #1393.12
-        ret                                                     #1393.12
-                                # LOE
-..B15.41:                       # Preds ..B15.38                # Infreq
-        pushl     $12                                           #1379.34
-        call      malloc at PLT                                    #1379.25
-                                # LOE eax ebx esi edi
-..B15.60:                       # Preds ..B15.41                # Infreq
-        popl      %ecx                                          #1379.25
-                                # LOE eax ebx esi edi
-..B15.42:                       # Preds ..B15.60                # Infreq
-        testl     %eax, %eax                                    #1380.19
-        jne       ..B15.43      # Prob 99%                      #1380.19
-                                # LOE eax ebx esi edi
-..B15.44:                       # Preds ..B15.42                # Infreq
-        call      __errno_location at PLT                          #1381.24
-                                # LOE eax esi
-..B15.61:                       # Preds ..B15.44                # Infreq
-        movl      20(%ebp), %ecx                                #1381.13
-        movl      (%eax), %edx                                  #1381.24
-        movl      %edx, (%ecx)                                  #1381.13
-        jmp       ..B15.40      # Prob 100%                     #1381.13
-        .align    2,0x90
-                                # LOE esi
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-.LNnss_unary_expr:
-	.data
-# -- End  nss_unary_expr
-	.text
-# -- Begin  nss_sob
-# mark_begin;
-       .align    2,0x90
-nss_sob:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-..B16.1:                        # Preds ..B16.0
-        pushl     %ebp                                          #1181.1
-        movl      %esp, %ebp                                    #1181.1
-        subl      $12, %esp                                     #1181.1
-        movl      %edi, -4(%ebp)                                #1181.1
-        movl      %esi, -8(%ebp)                                #1181.1
-        movl      %ebx, -12(%ebp)                               #1181.1
-        movl      8(%ebp), %esi                                 #1180.13
-        movl      12(%ebp), %edi                                #1180.13
-        call      ..L16         # Prob 100%                     #1181.1
-..L16:                                                          #
-        popl      %ebx                                          #1181.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L16], %ebx      #1181.1
-        lea       _gprof_pack15 at GOTOFF(%ebx), %edx              #1181.1
-        call      mcount at PLT                                    #1181.1
-                                # LOE ebx esi edi
-..B16.11:                       # Preds ..B16.1
-        cmpl      %edi, %esi                                    #1182.17
-        jae       ..B16.7       # Prob 12%                      #1182.17
-                                # LOE ebx esi edi
-..B16.2:                        # Preds ..B16.11
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE eax esi edi
-..B16.12:                       # Preds ..B16.2
-        movzbl    (%esi), %edx                                  #1182.24
-        movl      (%eax), %ecx                                  #1182.24
-        movzwl    (%ecx,%edx,2), %ebx                           #1182.24
-        testl     $8192, %ebx                                   #1182.24
-        je        ..B16.7       # Prob 15%                      #1182.24
-                                # LOE ecx esi edi
-..B16.3:                        # Preds ..B16.12
-        xorl      %edx, %edx                                    #1182.24
-        movl      %esi, %eax                                    #1182.24
-                                # LOE eax edx ecx esi edi
-..B16.4:                        # Preds ..B16.5 ..B16.3
-        addl      $1, %eax                                      #1182.24
-        addl      $1, %edx                                      #1182.24
-        cmpl      %eax, %edi                                    #1182.17
-        jbe       ..B16.6       # Prob 1%                       #1182.17
-                                # LOE eax edx ecx esi edi
-..B16.5:                        # Preds ..B16.4
-        movzbl    (%esi,%edx), %ebx                             #1182.24
-        movzwl    (%ecx,%ebx,2), %ebx                           #1182.24
-        testl     $8192, %ebx                                   #1182.24
-        jne       ..B16.4       # Prob 82%                      #1182.24
-                                # LOE eax edx ecx esi edi
-..B16.6:                        # Preds ..B16.4 ..B16.5
-        addl      %edx, %esi                                    #1183.12
-                                # LOE esi
-..B16.7:                        # Preds ..B16.12 ..B16.11 ..B16.6
-        movl      -12(%ebp), %ebx                               #1184.12
-        movl      -4(%ebp), %edi                                #1184.12
-        movl      %esi, %eax                                    #1184.12
-        movl      -8(%ebp), %esi                                #1184.12
-        movl      %ebp, %esp                                    #1184.12
-        popl      %ebp                                          #1184.12
-        ret                                                     #1184.12
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	nss_sob, at function
-	.size	nss_sob,.-nss_sob
-.LNnss_sob:
-	.data
-# -- End  nss_sob
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    2,0x90
-nss_fasta_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B17.1:                        # Preds ..B17.0
-        pushl     %ebp                                          #1234.1
-        movl      %esp, %ebp                                    #1234.1
-        subl      $16, %esp                                     #1234.1
-        movl      %edi, -4(%ebp)                                #1234.1
-        movl      %esi, -8(%ebp)                                #1234.1
-        movl      %ebx, -12(%ebp)                               #1234.1
-        movl      8(%ebp), %esi                                 #1232.13
-        call      ..L17         # Prob 100%                     #1234.1
-..L17:                                                          #
-        popl      %ebx                                          #1234.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L17], %ebx      #1234.1
-        lea       _gprof_pack16 at GOTOFF(%ebx), %edx              #1234.1
-        call      mcount at PLT                                    #1234.1
-                                # LOE ebx esi
-..B17.77:                       # Preds ..B17.1
-        movsbl    (%esi), %eax                                  #1236.16
-        cmpl      $39, %eax                                     #1236.16
-        jne       ..B17.16      # Prob 67%                      #1236.16
-                                # LOE eax ebx esi
-..B17.2:                        # Preds ..B17.77
-        movl      12(%ebp), %eax                                #1239.13
-        lea       1(%esi), %ecx                                 #1239.30
-        movl      %ecx, %esi                                    #1239.30
-        cmpl      %eax, %ecx                                    #1239.13
-        jae       ..B17.10      # Prob 44%                      #1239.13
-                                # LOE ecx ebx esi
-..B17.4:                        # Preds ..B17.2
-        lea       fasta_2na_map.0 at GOTOFF(%ebx), %edx            #1239.13
-        movl      %ecx, -16(%ebp)                               #
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx ebx esi
-..B17.5:                        # Preds ..B17.7 ..B17.4
-        movsbl    (%esi), %ecx                                  #1239.13
-        testl     %ecx, %ecx                                    #1239.13
-        jl        ..B17.92      # Prob 1%                       #1239.13
-                                # LOE eax edx ebx esi
-..B17.6:                        # Preds ..B17.5
-        movzbl    (%esi), %edi                                  #1239.13
-        movsbl    (%edi,%edx), %ecx                             #1239.13
-        testl     %ecx, %ecx                                    #1239.13
-        jl        ..B17.47      # Prob 16%                      #1239.13
-                                # LOE eax edx ebx esi edi
-..B17.7:                        # Preds ..B17.49 ..B17.6
-        movl      12(%ebp), %ecx                                #1239.13
-        addl      $1, %esi                                      #1239.13
-        cmpl      %ecx, %esi                                    #1239.13
-        jb        ..B17.5       # Prob 82%                      #1239.13
-                                # LOE eax edx ebx esi
-..B17.8:                        # Preds ..B17.7
-        movl      -16(%ebp), %ecx                               #
-                                # LOE eax ecx esi cl ch
-..B17.9:                        # Preds ..B17.92 ..B17.8
-        cmpl      %ecx, %esi                                    #1239.13
-        ja        ..B17.42      # Prob 12%                      #1239.13
-                                # LOE eax ecx esi cl ch
-..B17.10:                       # Preds ..B17.2 ..B17.9
-        movl      $22, %edx                                     #1239.13
-        movl      $22, %eax                                     #
-                                # LOE eax edx esi
-..B17.11:                       # Preds ..B17.10 ..B17.44 ..B17.46
-        testl     %eax, %eax                                    #1240.26
-        jne       ..B17.30      # Prob 50%                      #1240.26
-                                # LOE edx esi
-..B17.12:                       # Preds ..B17.11
-        movl      12(%ebp), %eax                                #1240.38
-        cmpl      %eax, %esi                                    #1240.38
-        je        ..B17.14      # Prob 12%                      #1240.38
-                                # LOE edx esi
-..B17.13:                       # Preds ..B17.12
-        movl      20(%ebp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-        movsbl    (%esi), %edx                                  #1240.47
-        addl      $1, %esi                                      #1240.47
-        cmpl      $39, %edx                                     #1240.55
-        je        ..B17.31      # Prob 50%                      #1240.55
-                                # LOE esi
-..B17.14:                       # Preds ..B17.13 ..B17.12
-        movl      20(%ebp), %eax                                #1241.13
-        movl      $22, (%eax)                                   #1241.13
-        jmp       ..B17.31      # Prob 100%                     #1241.13
-                                # LOE esi
-..B17.16:                       # Preds ..B17.77
-        cmpl      $34, %eax                                     #1236.16
-        jne       ..B17.32      # Prob 50%                      #1236.16
-                                # LOE ebx esi
-..B17.17:                       # Preds ..B17.16
-        movl      12(%ebp), %eax                                #1244.13
-        lea       1(%esi), %ecx                                 #1244.30
-        movl      %ecx, %esi                                    #1244.30
-        cmpl      %eax, %ecx                                    #1244.13
-        jae       ..B17.25      # Prob 44%                      #1244.13
-                                # LOE ecx ebx esi
-..B17.19:                       # Preds ..B17.17
-        lea       fasta_2na_map.0 at GOTOFF(%ebx), %edx            #1244.13
-        movl      %ecx, -16(%ebp)                               #
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx ebx esi
-..B17.20:                       # Preds ..B17.22 ..B17.19
-        movsbl    (%esi), %ecx                                  #1244.13
-        testl     %ecx, %ecx                                    #1244.13
-        jl        ..B17.91      # Prob 1%                       #1244.13
-                                # LOE eax edx ebx esi
-..B17.21:                       # Preds ..B17.20
-        movzbl    (%esi), %edi                                  #1244.13
-        movsbl    (%edi,%edx), %ecx                             #1244.13
-        testl     %ecx, %ecx                                    #1244.13
-        jl        ..B17.58      # Prob 16%                      #1244.13
-                                # LOE eax edx ebx esi edi
-..B17.22:                       # Preds ..B17.60 ..B17.21
-        movl      12(%ebp), %ecx                                #1244.13
-        addl      $1, %esi                                      #1244.13
-        cmpl      %ecx, %esi                                    #1244.13
-        jb        ..B17.20      # Prob 82%                      #1244.13
-                                # LOE eax edx ebx esi
-..B17.23:                       # Preds ..B17.22
-        movl      -16(%ebp), %ecx                               #
-                                # LOE eax ecx esi cl ch
-..B17.24:                       # Preds ..B17.91 ..B17.23
-        cmpl      %ecx, %esi                                    #1244.13
-        ja        ..B17.53      # Prob 12%                      #1244.13
-                                # LOE eax ecx esi cl ch
-..B17.25:                       # Preds ..B17.17 ..B17.24
-        movl      $22, %edx                                     #1244.13
-        movl      $22, %eax                                     #
-                                # LOE eax edx esi
-..B17.26:                       # Preds ..B17.25 ..B17.55 ..B17.57
-        testl     %eax, %eax                                    #1245.26
-        jne       ..B17.30      # Prob 50%                      #1245.26
-                                # LOE edx esi
-..B17.27:                       # Preds ..B17.26
-        movl      12(%ebp), %eax                                #1245.38
-        cmpl      %eax, %esi                                    #1245.38
-        je        ..B17.29      # Prob 12%                      #1245.38
-                                # LOE edx esi
-..B17.28:                       # Preds ..B17.27
-        movl      20(%ebp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-        movsbl    (%esi), %edx                                  #1245.47
-        addl      $1, %esi                                      #1245.47
-        cmpl      $34, %edx                                     #1245.55
-        je        ..B17.31      # Prob 50%                      #1245.55
-                                # LOE esi
-..B17.29:                       # Preds ..B17.28 ..B17.27
-        movl      20(%ebp), %eax                                #1246.13
-        movl      $22, (%eax)                                   #1246.13
-        jmp       ..B17.31      # Prob 100%                     #1246.13
-                                # LOE esi
-..B17.30:                       # Preds ..B17.11 ..B17.26
-        movl      20(%ebp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-                                # LOE esi
-..B17.31:                       # Preds ..B17.13 ..B17.28 ..B17.30 ..B17.14 ..B17.29
-                                #      
-        movl      -12(%ebp), %ebx                               #1252.12
-        movl      -4(%ebp), %edi                                #1252.12
-        movl      %esi, %eax                                    #1252.12
-        movl      -8(%ebp), %esi                                #1252.12
-        movl      %ebp, %esp                                    #1252.12
-        popl      %ebp                                          #1252.12
-        ret                                                     #1252.12
-                                # LOE
-..B17.32:                       # Preds ..B17.16
-        movl      12(%ebp), %eax                                #1249.16
-        movl      %esi, %edi                                    #1234.1
-        cmpl      %eax, %esi                                    #1249.16
-        jae       ..B17.40      # Prob 44%                      #1249.16
-                                # LOE ebx esi edi
-..B17.34:                       # Preds ..B17.32
-        lea       fasta_2na_map.0 at GOTOFF(%ebx), %edx            #1249.16
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx ebx esi edi
-..B17.35:                       # Preds ..B17.37 ..B17.34
-        movsbl    (%edi), %ecx                                  #1249.16
-        testl     %ecx, %ecx                                    #1249.16
-        jl        ..B17.90      # Prob 1%                       #1249.16
-                                # LOE eax edx ebx edi
-..B17.36:                       # Preds ..B17.35
-        movzbl    (%edi), %esi                                  #1249.16
-        movsbl    (%esi,%edx), %ecx                             #1249.16
-        testl     %ecx, %ecx                                    #1249.16
-        jl        ..B17.69      # Prob 16%                      #1249.16
-                                # LOE eax edx ebx esi edi
-..B17.37:                       # Preds ..B17.71 ..B17.36
-        movl      12(%ebp), %ecx                                #1249.16
-        addl      $1, %edi                                      #1249.16
-        cmpl      %ecx, %edi                                    #1249.16
-        jb        ..B17.35      # Prob 82%                      #1249.16
-                                # LOE eax edx ebx edi
-..B17.38:                       # Preds ..B17.37
-        movl      8(%ebp), %esi                                 #
-                                # LOE eax esi edi
-..B17.39:                       # Preds ..B17.90 ..B17.38
-        cmpl      %esi, %edi                                    #1249.16
-        ja        ..B17.64      # Prob 12%                      #1249.16
-                                # LOE eax esi edi
-..B17.40:                       # Preds ..B17.32 ..B17.39
-        movl      20(%ebp), %eax                                #1249.16
-        movl      $22, (%eax)                                   #1249.16
-                                # LOE edi
-..B17.41:                       # Preds ..B17.40 ..B17.66 ..B17.68
-        movl      -12(%ebp), %ebx                               #1249.16
-        movl      -8(%ebp), %esi                                #1249.16
-        movl      %edi, %eax                                    #1249.16
-        movl      -4(%ebp), %edi                                #1249.16
-        movl      %ebp, %esp                                    #1249.16
-        popl      %ebp                                          #1249.16
-        ret                                                     #1249.16
-                                # LOE
-..B17.42:                       # Preds ..B17.9                 # Infreq
-        testl     %eax, %eax                                    #1239.13
-        jne       ..B17.45      # Prob 50%                      #1239.13
-                                # LOE ecx esi cl ch
-..B17.43:                       # Preds ..B17.42                # Infreq
-        movl      24(%ebp), %edx                                #1239.13
-        movl      %esi, %eax                                    #1239.13
-        subl      %ecx, %eax                                    #1239.13
-        pushl     %eax                                          #1239.13
-        pushl     %ecx                                          #1239.13
-        movl      16(%ebp), %ecx                                #1239.13
-        pushl     %edx                                          #1239.13
-        pushl     %ecx                                          #1239.13
-        call      NucStrFastaExprMake2                          #1239.13
-                                # LOE eax esi
-..B17.78:                       # Preds ..B17.43                # Infreq
-        addl      $16, %esp                                     #1239.13
-                                # LOE eax esi
-..B17.44:                       # Preds ..B17.78                # Infreq
-        movl      %eax, %edx                                    #1239.13
-        jmp       ..B17.11      # Prob 100%                     #1239.13
-                                # LOE eax edx esi
-..B17.45:                       # Preds ..B17.42                # Infreq
-        movl      24(%ebp), %edx                                #1239.13
-        movl      %esi, %eax                                    #1239.13
-        subl      %ecx, %eax                                    #1239.13
-        pushl     %eax                                          #1239.13
-        pushl     %ecx                                          #1239.13
-        movl      16(%ebp), %ecx                                #1239.13
-        pushl     %edx                                          #1239.13
-        pushl     %ecx                                          #1239.13
-        call      NucStrFastaExprMake4                          #1239.13
-                                # LOE eax esi
-..B17.79:                       # Preds ..B17.45                # Infreq
-        addl      $16, %esp                                     #1239.13
-                                # LOE eax esi
-..B17.46:                       # Preds ..B17.79                # Infreq
-        movl      %eax, %edx                                    #1239.13
-        jmp       ..B17.11      # Prob 100%                     #1239.13
-                                # LOE eax edx esi
-..B17.47:                       # Preds ..B17.6                 # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%ebx), %ecx            #1239.13
-        cmpl      %ecx, %edx                                    #1239.13
-        je        ..B17.92      # Prob 1%                       #1239.13
-                                # LOE eax ecx ebx esi edi
-..B17.48:                       # Preds ..B17.47                # Infreq
-        movsbl    (%edi,%ecx), %edx                             #1239.13
-        testl     %edx, %edx                                    #1239.13
-        jl        ..B17.92      # Prob 1%                       #1239.13
-                                # LOE eax ecx ebx esi
-..B17.49:                       # Preds ..B17.48                # Infreq
-        movl      %ecx, %edx                                    #1239.13
-        movl      $1, %eax                                      #
-        jmp       ..B17.7       # Prob 100%                     #
-                                # LOE eax edx ebx esi
-..B17.92:                       # Preds ..B17.47 ..B17.48 ..B17.5 # Infreq
-        movl      -16(%ebp), %ecx                               #
-        jmp       ..B17.9       # Prob 100%                     #
-                                # LOE eax ecx esi cl ch
-..B17.53:                       # Preds ..B17.24                # Infreq
-        testl     %eax, %eax                                    #1244.13
-        jne       ..B17.56      # Prob 50%                      #1244.13
-                                # LOE ecx esi cl ch
-..B17.54:                       # Preds ..B17.53                # Infreq
-        movl      24(%ebp), %edx                                #1244.13
-        movl      %esi, %eax                                    #1244.13
-        subl      %ecx, %eax                                    #1244.13
-        pushl     %eax                                          #1244.13
-        pushl     %ecx                                          #1244.13
-        movl      16(%ebp), %ecx                                #1244.13
-        pushl     %edx                                          #1244.13
-        pushl     %ecx                                          #1244.13
-        call      NucStrFastaExprMake2                          #1244.13
-                                # LOE eax esi
-..B17.80:                       # Preds ..B17.54                # Infreq
-        addl      $16, %esp                                     #1244.13
-                                # LOE eax esi
-..B17.55:                       # Preds ..B17.80                # Infreq
-        movl      %eax, %edx                                    #1244.13
-        jmp       ..B17.26      # Prob 100%                     #1244.13
-                                # LOE eax edx esi
-..B17.56:                       # Preds ..B17.53                # Infreq
-        movl      24(%ebp), %edx                                #1244.13
-        movl      %esi, %eax                                    #1244.13
-        subl      %ecx, %eax                                    #1244.13
-        pushl     %eax                                          #1244.13
-        pushl     %ecx                                          #1244.13
-        movl      16(%ebp), %ecx                                #1244.13
-        pushl     %edx                                          #1244.13
-        pushl     %ecx                                          #1244.13
-        call      NucStrFastaExprMake4                          #1244.13
-                                # LOE eax esi
-..B17.81:                       # Preds ..B17.56                # Infreq
-        addl      $16, %esp                                     #1244.13
-                                # LOE eax esi
-..B17.57:                       # Preds ..B17.81                # Infreq
-        movl      %eax, %edx                                    #1244.13
-        jmp       ..B17.26      # Prob 100%                     #1244.13
-                                # LOE eax edx esi
-..B17.58:                       # Preds ..B17.21                # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%ebx), %ecx            #1244.13
-        cmpl      %ecx, %edx                                    #1244.13
-        je        ..B17.91      # Prob 1%                       #1244.13
-                                # LOE eax ecx ebx esi edi
-..B17.59:                       # Preds ..B17.58                # Infreq
-        movsbl    (%edi,%ecx), %edx                             #1244.13
-        testl     %edx, %edx                                    #1244.13
-        jl        ..B17.91      # Prob 1%                       #1244.13
-                                # LOE eax ecx ebx esi
-..B17.60:                       # Preds ..B17.59                # Infreq
-        movl      %ecx, %edx                                    #1244.13
-        movl      $1, %eax                                      #
-        jmp       ..B17.22      # Prob 100%                     #
-                                # LOE eax edx ebx esi
-..B17.91:                       # Preds ..B17.58 ..B17.59 ..B17.20 # Infreq
-        movl      -16(%ebp), %ecx                               #
-        jmp       ..B17.24      # Prob 100%                     #
-                                # LOE eax ecx esi cl ch
-..B17.64:                       # Preds ..B17.39                # Infreq
-        testl     %eax, %eax                                    #1249.16
-        jne       ..B17.67      # Prob 50%                      #1249.16
-                                # LOE esi edi
-..B17.65:                       # Preds ..B17.64                # Infreq
-        movl      24(%ebp), %edx                                #1249.16
-        movl      16(%ebp), %ecx                                #1249.16
-        movl      %edi, %eax                                    #1249.16
-        subl      %esi, %eax                                    #1249.16
-        pushl     %eax                                          #1249.16
-        pushl     %esi                                          #1249.16
-        pushl     %edx                                          #1249.16
-        pushl     %ecx                                          #1249.16
-        call      NucStrFastaExprMake2                          #1249.16
-                                # LOE eax edi
-..B17.82:                       # Preds ..B17.65                # Infreq
-        addl      $16, %esp                                     #1249.16
-                                # LOE eax edi
-..B17.66:                       # Preds ..B17.82                # Infreq
-        movl      20(%ebp), %edx                                #1249.16
-        movl      %eax, (%edx)                                  #1249.16
-        jmp       ..B17.41      # Prob 100%                     #1249.16
-                                # LOE edi
-..B17.67:                       # Preds ..B17.64                # Infreq
-        movl      24(%ebp), %edx                                #1249.16
-        movl      16(%ebp), %ecx                                #1249.16
-        movl      %edi, %eax                                    #1249.16
-        subl      %esi, %eax                                    #1249.16
-        pushl     %eax                                          #1249.16
-        pushl     %esi                                          #1249.16
-        pushl     %edx                                          #1249.16
-        pushl     %ecx                                          #1249.16
-        call      NucStrFastaExprMake4                          #1249.16
-                                # LOE eax edi
-..B17.83:                       # Preds ..B17.67                # Infreq
-        addl      $16, %esp                                     #1249.16
-                                # LOE eax edi
-..B17.68:                       # Preds ..B17.83                # Infreq
-        movl      20(%ebp), %edx                                #1249.16
-        movl      %eax, (%edx)                                  #1249.16
-        jmp       ..B17.41      # Prob 100%                     #1249.16
-                                # LOE edi
-..B17.69:                       # Preds ..B17.36                # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%ebx), %ecx            #1249.16
-        cmpl      %ecx, %edx                                    #1249.16
-        je        ..B17.90      # Prob 1%                       #1249.16
-                                # LOE eax ecx ebx esi edi
-..B17.70:                       # Preds ..B17.69                # Infreq
-        movsbl    (%ecx,%esi), %edx                             #1249.16
-        testl     %edx, %edx                                    #1249.16
-        jl        ..B17.90      # Prob 1%                       #1249.16
-                                # LOE eax ecx ebx edi
-..B17.71:                       # Preds ..B17.70                # Infreq
-        movl      %ecx, %edx                                    #1249.16
-        movl      $1, %eax                                      #
-        jmp       ..B17.37      # Prob 100%                     #
-                                # LOE eax edx ebx edi
-..B17.90:                       # Preds ..B17.69 ..B17.70 ..B17.35 # Infreq
-        movl      8(%ebp), %esi                                 #
-        jmp       ..B17.39      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE eax esi edi
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-.LNnss_fasta_expr:
-	.data
-# -- End  nss_fasta_expr
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake4:
-# parameter 1(expr): 8 + %ebx
-# parameter 2(positional): 12 + %ebx
-# parameter 3(fasta): 16 + %ebx
-# parameter 4(size): 20 + %ebx
-..B18.1:                        # Preds ..B18.0
-        pushl     %ebx                                          #1017.1
-        movl      %esp, %ebx                                    #1017.1
-        andl      $-16, %esp                                    #1017.1
-        pushl     %ebp                                          #1017.1
-        pushl     %ebp                                          #1017.1
-        movl      4(%ebx), %ebp                                 #1017.1
-        movl      %ebp, 4(%esp)                                 #1017.1
-        movl      %esp, %ebp                                    #1017.1
-        subl      $72, %esp                                     #1017.1
-        movl      %ebx, -72(%ebp)                               #1017.1
-        movl      %edi, -44(%ebp)                               #1017.1
-        movl      %esi, -48(%ebp)                               #1017.1
-        call      ..L18         # Prob 100%                     #1017.1
-..L18:                                                          #
-        popl      %edi                                          #1017.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L18], %edi      #1017.1
-        lea       _gprof_pack17 at GOTOFF(%edi), %edx              #1017.1
-        movl      %edi, %ebx                                    #1017.1
-        call      mcount at PLT                                    #1017.1
-        movl      -72(%ebp), %ebx                               #1017.1
-                                # LOE edi
-..B18.46:                       # Preds ..B18.1
-        movl      20(%ebx), %eax                                #1023.17
-        cmpl      $29, %eax                                     #1023.17
-        jbe       ..B18.3       # Prob 43%                      #1023.17
-                                # LOE edi
-..B18.2:                        # Preds ..B18.46
-        movl      -48(%ebp), %esi                               #1024.16
-        movl      -44(%ebp), %edi                               #1024.16
-        movl      $7, %eax                                      #1024.16
-        movl      %ebp, %esp                                    #1024.16
-        popl      %ebp                                          #1024.16
-        movl      %ebx, %esp                                    #1024.16
-        popl      %ebx                                          #1024.16
-        ret                                                     #1024.16
-                                # LOE
-..B18.3:                        # Preds ..B18.46
-        pushl     $160                                          #1026.32
-        movl      %edi, %ebx                                    #1026.9
-        call      malloc at PLT                                    #1026.9
-        movl      -72(%ebp), %ebx                               #1026.9
-                                # LOE eax edi
-..B18.47:                       # Preds ..B18.3
-        addl      $4, %esp                                      #1026.9
-                                # LOE eax edi
-..B18.4:                        # Preds ..B18.47
-        testl     %eax, %eax                                    #1026.9
-        je        ..B18.43      # Prob 12%                      #1026.9
-                                # LOE eax edi
-..B18.5:                        # Preds ..B18.4
-        lea       15(%eax), %esi                                #1026.9
-        andl      $-16, %esi                                    #1026.9
-        movl      %eax, 8(%esi)                                 #1026.9
-        je        ..B18.43      # Prob 5%                       #1027.15
-                                # LOE esi edi
-..B18.6:                        # Preds ..B18.5
-        movl      8(%ebx), %eax                                 #1030.5
-        movl      20(%ebx), %edx                                #1031.5
-        movl      %esi, (%eax)                                  #1030.5
-        movl      %edx, 4(%esi)                                 #1031.5
-        testl     %edx, %edx                                    #1035.22
-        jbe       ..B18.42      # Prob 16%                      #1035.22
-                                # LOE esi edi
-..B18.7:                        # Preds ..B18.6
-        movl      16(%ebx), %ecx                                #
-        movl      %esi, -60(%ebp)                               #
-        xorl      %eax, %eax                                    #
-                                # LOE eax ecx edi
-..B18.8:                        # Preds ..B18.15 ..B18.7
-        movsbl    (%ecx,%eax), %edx                             #1037.49
-        movsbl    fasta_4na_map.0 at GOTOFF(%edi,%edx), %edx       #1037.25
-        movl      %eax, %esi                                    #1038.22
-        andl      $3, %esi                                      #1038.22
-        je        ..B18.41      # Prob 20%                      #1038.22
-                                # LOE eax edx ecx esi edi
-..B18.9:                        # Preds ..B18.8
-        cmpl      $1, %esi                                      #1038.22
-        je        ..B18.14      # Prob 25%                      #1038.22
-                                # LOE eax edx ecx esi edi
-..B18.10:                       # Preds ..B18.9
-        cmpl      $2, %esi                                      #1038.22
-        jne       ..B18.12      # Prob 67%                      #1038.22
-                                # LOE eax edx ecx esi edi
-..B18.11:                       # Preds ..B18.10
-        movl      %eax, %esi                                    #1049.32
-        shrl      $2, %esi                                      #1049.32
-        shll      $12, %edx                                     #1049.47
-        orw       %dx, -40(%ebp,%esi,2)                         #1049.13
-        movzwl    -24(%ebp,%esi,2), %edx                        #1050.13
-        orl       $-4096, %edx                                  #1050.13
-        movw      %dx, -24(%ebp,%esi,2)                         #1050.13
-        jmp       ..B18.15      # Prob 100%                     #1050.13
-                                # LOE eax ecx edi
-..B18.12:                       # Preds ..B18.10
-        cmpl      $3, %esi                                      #1038.22
-        jne       ..B18.15      # Prob 50%                      #1038.22
-                                # LOE eax edx ecx edi
-..B18.13:                       # Preds ..B18.12
-        movl      %eax, %esi                                    #1053.32
-        shrl      $2, %esi                                      #1053.32
-        shll      $8, %edx                                      #1053.47
-        orw       %dx, -40(%ebp,%esi,2)                         #1053.13
-        movzwl    -24(%ebp,%esi,2), %edx                        #1054.13
-        orl       $-61696, %edx                                 #1054.13
-        movw      %dx, -24(%ebp,%esi,2)                         #1054.13
-        jmp       ..B18.15      # Prob 100%                     #1054.13
-                                # LOE eax ecx edi
-..B18.14:                       # Preds ..B18.9
-        movl      %eax, %esi                                    #1045.32
-        shrl      $2, %esi                                      #1045.32
-        orw       %dx, -40(%ebp,%esi,2)                         #1045.13
-        movzwl    -24(%ebp,%esi,2), %edx                        #1046.13
-        orl       $15, %edx                                     #1046.13
-        movw      %dx, -24(%ebp,%esi,2)                         #1046.13
-                                # LOE eax ecx edi
-..B18.15:                       # Preds ..B18.41 ..B18.14 ..B18.11 ..B18.13 ..B18.12
-                                #      
-        movl      20(%ebx), %edx                                #1035.22
-        addl      $1, %eax                                      #1035.31
-        cmpl      %edx, %eax                                    #1035.22
-        jb        ..B18.8       # Prob 82%                      #1035.22
-                                # LOE eax ecx edi
-..B18.16:                       # Preds ..B18.15
-        movl      -60(%ebp), %esi                               #
-                                # LOE eax esi
-..B18.17:                       # Preds ..B18.16 ..B18.42
-        addl      $3, %eax                                      #1060.21
-        shrl      $2, %eax                                      #1060.28
-        cmpl      $8, %eax                                      #1060.35
-        jae       ..B18.30      # Prob 50%                      #1060.35
-                                # LOE eax esi
-..B18.18:                       # Preds ..B18.17
-        lea       -40(%ebp,%eax,2), %ecx                        #1060.5
-        movl      %eax, %edi                                    #1060.5
-        negl      %edi                                          #1060.5
-        addl      $8, %edi                                      #1060.5
-        lea       (%eax,%eax), %edx                             #
-        andl      $15, %ecx                                     #1060.5
-        movl      %edx, -56(%ebp)                               #
-        movl      %ecx, %edx                                    #1060.5
-        negl      %edx                                          #1060.5
-        addl      $16, %edx                                     #1060.5
-        shrl      $1, %edx                                      #1060.5
-        cmpl      $0, %ecx                                      #1060.5
-        cmovne    %edx, %ecx                                    #1060.5
-        movl      %ecx, -52(%ebp)                               #1060.5
-        lea       8(%ecx), %edx                                 #1060.5
-        cmpl      %edx, %edi                                    #1060.5
-        jb        ..B18.40      # Prob 10%                      #1060.5
-                                # LOE eax ecx esi edi cl ch
-..B18.19:                       # Preds ..B18.18
-        movl      %edi, %edx                                    #1060.5
-        subl      %ecx, %edx                                    #1060.5
-        andl      $7, %edx                                      #1060.5
-        negl      %edx                                          #1060.5
-        addl      %edi, %edx                                    #1060.5
-        testl     %ecx, %ecx                                    #1060.5
-        jbe       ..B18.23      # Prob 1%                       #1060.5
-                                # LOE eax edx ecx esi edi cl ch
-..B18.20:                       # Preds ..B18.19
-        movl      %edi, -68(%ebp)                               #
-        movl      %ecx, %edi                                    #
-        movl      %eax, -64(%ebp)                               #
-        xorl      %ecx, %ecx                                    #
-        movl      %esi, -60(%ebp)                               #
-        movl      -56(%ebp), %esi                               #
-                                # LOE edx ecx esi edi
-..B18.21:                       # Preds ..B18.21 ..B18.20
-        xorl      %eax, %eax                                    #1062.9
-        movw      %ax, -40(%ebp,%esi)                           #1062.9
-        addl      $1, %ecx                                      #1060.5
-        movw      %ax, -24(%ebp,%esi)                           #1063.9
-        addl      $2, %esi                                      #1060.5
-        cmpl      %edi, %ecx                                    #1060.5
-        jb        ..B18.21      # Prob 99%                      #1060.5
-                                # LOE edx ecx esi edi
-..B18.22:                       # Preds ..B18.21
-        movl      -64(%ebp), %eax                               #
-        movl      -60(%ebp), %esi                               #
-        movl      %edi, -52(%ebp)                               #
-        movl      -68(%ebp), %edi                               #
-                                # LOE eax edx esi edi
-..B18.23:                       # Preds ..B18.22 ..B18.19
-        movl      -52(%ebp), %ecx                               #1062.29
-        movl      %esi, -60(%ebp)                               #1062.29
-        movl      %ecx, %esi                                    #1062.29
-        lea       (%ecx,%ecx), %ecx                             #1062.29
-        pxor      %xmm0, %xmm0                                  #1062.29
-        lea       (%ecx,%eax,2), %ecx                           #1062.29
-                                # LOE eax edx ecx esi edi xmm0
-..B18.24:                       # Preds ..B18.24 ..B18.23
-        movdqa    %xmm0, -40(%ebp,%ecx)                         #1062.9
-        movdqa    %xmm0, -24(%ebp,%ecx)                         #1063.9
-        addl      $16, %ecx                                     #1060.5
-        addl      $8, %esi                                      #1060.5
-        cmpl      %edx, %esi                                    #1060.5
-        jb        ..B18.24      # Prob 99%                      #1060.5
-                                # LOE eax edx ecx esi edi xmm0
-..B18.25:                       # Preds ..B18.24
-        movl      -60(%ebp), %esi                               #
-                                # LOE eax edx esi edi
-..B18.26:                       # Preds ..B18.25 ..B18.40
-        cmpl      %edi, %edx                                    #1060.5
-        jae       ..B18.30      # Prob 1%                       #1060.5
-                                # LOE eax edx esi edi
-..B18.27:                       # Preds ..B18.26
-        lea       (%edx,%edx), %ecx                             #
-        lea       (%ecx,%eax,2), %eax                           #
-                                # LOE eax edx esi edi
-..B18.28:                       # Preds ..B18.28 ..B18.27
-        xorl      %ecx, %ecx                                    #1062.9
-        movw      %cx, -40(%ebp,%eax)                           #1062.9
-        addl      $1, %edx                                      #1060.5
-        movw      %cx, -24(%ebp,%eax)                           #1063.9
-        addl      $2, %eax                                      #1060.5
-        cmpl      %edi, %edx                                    #1060.5
-        jb        ..B18.28      # Prob 99%                      #1060.5
-                                # LOE eax edx esi edi
-..B18.30:                       # Preds ..B18.28 ..B18.26 ..B18.17
-        movl      12(%ebx), %eax                                #1068.10
-        testl     %eax, %eax                                    #1068.10
-        je        ..B18.32      # Prob 50%                      #1068.10
-                                # LOE esi
-..B18.31:                       # Preds ..B18.30
-        movl      $10, (%esi)                                   #1070.9
-        jmp       ..B18.39      # Prob 100%                     #1070.9
-                                # LOE esi
-..B18.32:                       # Preds ..B18.30
-        movl      20(%ebx), %eax                                #1072.22
-        cmpl      $2, %eax                                      #1072.22
-        jae       ..B18.34      # Prob 50%                      #1072.22
-                                # LOE esi
-..B18.33:                       # Preds ..B18.32
-        movzwl    -40(%ebp), %eax                               #1074.29
-        movl      $6, (%esi)                                    #1082.9
-        movw      %ax, -38(%ebp)                                #1074.9
-        movl      -40(%ebp), %edi                               #1075.29
-        movzwl    -24(%ebp), %eax                               #1078.26
-        movl      %edi, -36(%ebp)                               #1075.9
-        movl      -40(%ebp), %edx                               #1076.29
-        movl      %edx, -32(%ebp)                               #1076.9
-        movl      %edi, -28(%ebp)                               #1076.9
-        movw      %ax, -22(%ebp)                                #1078.9
-        movl      -24(%ebp), %edx                               #1079.26
-        movl      %edx, -20(%ebp)                               #1079.9
-        movl      -24(%ebp), %eax                               #1080.26
-        movl      %eax, -16(%ebp)                               #1080.9
-        movl      %edx, -12(%ebp)                               #1080.9
-        jmp       ..B18.39      # Prob 100%                     #1080.9
-                                # LOE esi
-..B18.34:                       # Preds ..B18.32
-        movl      20(%ebx), %eax                                #1084.22
-        cmpl      $6, %eax                                      #1084.22
-        jae       ..B18.36      # Prob 50%                      #1084.22
-                                # LOE esi
-..B18.35:                       # Preds ..B18.34
-        movl      -40(%ebp), %edx                               #1086.29
-        movl      $7, (%esi)                                    #1092.9
-        movl      %edx, -36(%ebp)                               #1086.9
-        movl      -40(%ebp), %eax                               #1087.29
-        movl      %eax, -32(%ebp)                               #1087.9
-        movl      -24(%ebp), %eax                               #1089.26
-        movl      %edx, -28(%ebp)                               #1087.9
-        movl      %eax, -20(%ebp)                               #1089.9
-        movl      -24(%ebp), %edi                               #1090.26
-        movl      %edi, -16(%ebp)                               #1090.9
-        movl      %eax, -12(%ebp)                               #1090.9
-        jmp       ..B18.39      # Prob 100%                     #1090.9
-                                # LOE esi
-..B18.36:                       # Preds ..B18.34
-        movl      20(%ebx), %eax                                #1094.22
-        cmpl      $14, %eax                                     #1094.22
-        jae       ..B18.38      # Prob 50%                      #1094.22
-                                # LOE esi
-..B18.37:                       # Preds ..B18.36
-        movl      -40(%ebp), %eax                               #1096.29
-        movl      -36(%ebp), %edx                               #1096.29
-        movl      -24(%ebp), %edi                               #1097.26
-        movl      %eax, -32(%ebp)                               #1096.9
-        movl      -20(%ebp), %eax                               #1097.26
-        movl      $1, (%esi)                                    #1099.9
-        movl      %edx, -28(%ebp)                               #1096.9
-        movl      %edi, -16(%ebp)                               #1097.9
-        movl      %eax, -12(%ebp)                               #1097.9
-        jmp       ..B18.39      # Prob 100%                     #1097.9
-                                # LOE esi
-..B18.38:                       # Preds ..B18.36
-        movl      $8, (%esi)                                    #1103.9
-                                # LOE esi
-..B18.39:                       # Preds ..B18.31 ..B18.33 ..B18.35 ..B18.37 ..B18.38
-                                #      
-        movl      -40(%ebp), %eax                               #1106.42
-        movl      -36(%ebp), %edi                               #1106.42
-        lea       -40(%ebp), %ecx                               #1110.5
-        movl      %eax, 16(%esi)                                #1106.42
-        movl      -32(%ebp), %eax                               #1106.42
-        movl      %edi, 20(%esi)                                #1106.42
-        movl      %eax, 24(%esi)                                #1106.42
-        movl      -28(%ebp), %eax                               #1106.42
-        movl      %eax, 28(%esi)                                #1106.42
-        movl      -24(%ebp), %eax                               #1107.39
-        movl      %eax, 32(%esi)                                #1107.39
-        movl      -20(%ebp), %eax                               #1107.39
-        movl      %eax, 36(%esi)                                #1107.39
-        movl      -16(%ebp), %eax                               #1107.39
-        movl      %eax, 40(%esi)                                #1107.39
-        movl      -12(%ebp), %eax                               #1107.39
-        movl      %eax, 44(%esi)                                #1107.39
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #1110.5
-        lea       -24(%ebp), %ecx                               #1111.5
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #1111.5
-        movl      $4, %ecx                                      #1114.5
-        lea       -40(%ebp), %edx                               #1114.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1114.5
-        lea       -24(%ebp), %edx                               #1115.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1115.5
-        lea       48(%esi), %ecx                                #1118.5
-        lea       -40(%ebp), %edx                               #1118.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1118.5
-        lea       64(%esi), %ecx                                #1119.5
-        lea       -24(%ebp), %edx                               #1119.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1119.5
-        movl      $4, %ecx                                      #1121.5
-        lea       -40(%ebp), %edx                               #1121.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1121.5
-        lea       -24(%ebp), %edx                               #1122.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1122.5
-        lea       80(%esi), %ecx                                #1124.5
-        lea       -40(%ebp), %edx                               #1124.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1124.5
-        lea       96(%esi), %ecx                                #1125.5
-        lea       -24(%ebp), %edx                               #1125.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1125.5
-        movl      $4, %ecx                                      #1127.5
-        lea       -40(%ebp), %edx                               #1127.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1127.5
-        lea       -24(%ebp), %edx                               #1128.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1128.5
-        lea       112(%esi), %ecx                               #1130.5
-        lea       -40(%ebp), %edx                               #1130.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1130.5
-        addl      $128, %esi                                    #1131.5
-        movl      %esi, %ecx                                    #1131.5
-        lea       -24(%ebp), %edx                               #1131.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1131.5
-        xorl      %eax, %eax                                    #1173.12
-        movl      -48(%ebp), %esi                               #1173.12
-        movl      -44(%ebp), %edi                               #1173.12
-        movl      %ebp, %esp                                    #1173.12
-        popl      %ebp                                          #1173.12
-        movl      %ebx, %esp                                    #1173.12
-        popl      %ebx                                          #1173.12
-        ret                                                     #1173.12
-                                # LOE
-..B18.40:                       # Preds ..B18.18                # Infreq
-        xorl      %edx, %edx                                    #1060.5
-        jmp       ..B18.26      # Prob 100%                     #1060.5
-                                # LOE eax edx esi edi
-..B18.41:                       # Preds ..B18.8                 # Infreq
-        movl      %eax, %esi                                    #1041.32
-        shrl      $2, %esi                                      #1041.32
-        shll      $4, %edx                                      #1041.46
-        movw      %dx, -40(%ebp,%esi,2)                         #1041.13
-        movl      $240, %edx                                    #1042.13
-        movw      %dx, -24(%ebp,%esi,2)                         #1042.13
-        jmp       ..B18.15      # Prob 100%                     #1042.13
-                                # LOE eax ecx edi
-..B18.42:                       # Preds ..B18.6                 # Infreq
-        xorl      %eax, %eax                                    #
-        jmp       ..B18.17      # Prob 100%                     #
-                                # LOE eax esi
-..B18.43:                       # Preds ..B18.4 ..B18.5         # Infreq
-        movl      %edi, %ebx                                    #1028.16
-        call      __errno_location at PLT                          #1028.16
-        movl      -72(%ebp), %ebx                               #1028.16
-                                # LOE eax
-..B18.48:                       # Preds ..B18.43                # Infreq
-        movl      -48(%ebp), %esi                               #1028.16
-        movl      -44(%ebp), %edi                               #1028.16
-        movl      (%eax), %eax                                  #1028.16
-        movl      %ebp, %esp                                    #1028.16
-        popl      %ebp                                          #1028.16
-        movl      %ebx, %esp                                    #1028.16
-        popl      %ebx                                          #1028.16
-        ret                                                     #1028.16
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-.LNNucStrFastaExprMake4:
-	.data
-# -- End  NucStrFastaExprMake4
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake2:
-# parameter 1(expr): 8 + %ebx
-# parameter 2(positional): 12 + %ebx
-# parameter 3(fasta): 16 + %ebx
-# parameter 4(size): 20 + %ebx
-..B19.1:                        # Preds ..B19.0
-        pushl     %ebx                                          #838.1
-        movl      %esp, %ebx                                    #838.1
-        andl      $-16, %esp                                    #838.1
-        pushl     %ebp                                          #838.1
-        pushl     %ebp                                          #838.1
-        movl      4(%ebx), %ebp                                 #838.1
-        movl      %ebp, 4(%esp)                                 #838.1
-        movl      %esp, %ebp                                    #838.1
-        subl      $72, %esp                                     #838.1
-        movl      %ebx, -72(%ebp)                               #838.1
-        movl      %edi, -48(%ebp)                               #838.1
-        movl      %esi, -52(%ebp)                               #838.1
-        call      ..L19         # Prob 100%                     #838.1
-..L19:                                                          #
-        popl      %edi                                          #838.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L19], %edi      #838.1
-        lea       _gprof_pack18 at GOTOFF(%edi), %edx              #838.1
-        movl      %edi, %ebx                                    #838.1
-        call      mcount at PLT                                    #838.1
-        movl      -72(%ebp), %ebx                               #838.1
-                                # LOE edi
-..B19.48:                       # Preds ..B19.1
-        movl      20(%ebx), %eax                                #844.17
-        cmpl      $61, %eax                                     #844.17
-        jbe       ..B19.3       # Prob 43%                      #844.17
-                                # LOE edi
-..B19.2:                        # Preds ..B19.48
-        movl      -52(%ebp), %esi                               #845.16
-        movl      -48(%ebp), %edi                               #845.16
-        movl      $7, %eax                                      #845.16
-        movl      %ebp, %esp                                    #845.16
-        popl      %ebp                                          #845.16
-        movl      %ebx, %esp                                    #845.16
-        popl      %ebx                                          #845.16
-        ret                                                     #845.16
-                                # LOE
-..B19.3:                        # Preds ..B19.48
-        pushl     $160                                          #847.32
-        movl      %edi, %ebx                                    #847.9
-        call      malloc at PLT                                    #847.9
-        movl      -72(%ebp), %ebx                               #847.9
-                                # LOE eax edi
-..B19.49:                       # Preds ..B19.3
-        addl      $4, %esp                                      #847.9
-                                # LOE eax edi
-..B19.4:                        # Preds ..B19.49
-        testl     %eax, %eax                                    #847.9
-        je        ..B19.45      # Prob 12%                      #847.9
-                                # LOE eax edi
-..B19.5:                        # Preds ..B19.4
-        lea       15(%eax), %esi                                #847.9
-        andl      $-16, %esi                                    #847.9
-        movl      %eax, 8(%esi)                                 #847.9
-        je        ..B19.45      # Prob 5%                       #848.15
-                                # LOE esi edi
-..B19.6:                        # Preds ..B19.5
-        movl      8(%ebx), %eax                                 #851.5
-        movl      20(%ebx), %edx                                #852.5
-        movl      %esi, (%eax)                                  #851.5
-        movl      %edx, 4(%esi)                                 #852.5
-        testl     %edx, %edx                                    #856.22
-        jbe       ..B19.44      # Prob 16%                      #856.22
-                                # LOE esi edi
-..B19.7:                        # Preds ..B19.6
-        movl      16(%ebx), %edx                                #
-        movl      %esi, -60(%ebp)                               #
-        movl      %edi, -44(%ebp)                               #
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx
-..B19.8:                        # Preds ..B19.15 ..B19.7
-        movl      -44(%ebp), %ecx                               #858.24
-        movsbl    (%edx,%eax), %esi                             #858.48
-        movzbl    fasta_2na_map.0 at GOTOFF(%ecx,%esi), %ecx       #858.24
-        movl      %eax, %esi                                    #859.22
-        andl      $3, %esi                                      #859.22
-        je        ..B19.43      # Prob 20%                      #859.22
-                                # LOE eax edx ecx esi
-..B19.9:                        # Preds ..B19.8
-        cmpl      $1, %esi                                      #859.22
-        je        ..B19.14      # Prob 25%                      #859.22
-                                # LOE eax edx ecx esi
-..B19.10:                       # Preds ..B19.9
-        cmpl      $2, %esi                                      #859.22
-        jne       ..B19.12      # Prob 67%                      #859.22
-                                # LOE eax edx ecx esi
-..B19.11:                       # Preds ..B19.10
-        movl      %eax, %esi                                    #870.32
-        shrl      $2, %esi                                      #870.32
-        orb       $12, -24(%ebp,%esi)                           #871.13
-        shll      $2, %ecx                                      #870.47
-        orb       %cl, -40(%ebp,%esi)                           #870.13
-        jmp       ..B19.15      # Prob 100%                     #870.13
-                                # LOE eax edx
-..B19.12:                       # Preds ..B19.10
-        cmpl      $3, %esi                                      #859.22
-        jne       ..B19.15      # Prob 50%                      #859.22
-                                # LOE eax edx ecx
-..B19.13:                       # Preds ..B19.12
-        movl      %eax, %esi                                    #874.32
-        shrl      $2, %esi                                      #874.32
-        orb       $3, -24(%ebp,%esi)                            #875.13
-        orb       %cl, -40(%ebp,%esi)                           #874.13
-        jmp       ..B19.15      # Prob 100%                     #874.13
-                                # LOE eax edx
-..B19.14:                       # Preds ..B19.9
-        movl      %eax, %esi                                    #866.32
-        shrl      $2, %esi                                      #866.32
-        orb       $48, -24(%ebp,%esi)                           #867.13
-        shll      $4, %ecx                                      #866.47
-        orb       %cl, -40(%ebp,%esi)                           #866.13
-                                # LOE eax edx
-..B19.15:                       # Preds ..B19.43 ..B19.14 ..B19.11 ..B19.13 ..B19.12
-                                #      
-        movl      20(%ebx), %ecx                                #856.22
-        addl      $1, %eax                                      #856.31
-        cmpl      %ecx, %eax                                    #856.22
-        jb        ..B19.8       # Prob 82%                      #856.22
-                                # LOE eax edx
-..B19.16:                       # Preds ..B19.15
-        movl      -60(%ebp), %esi                               #
-                                # LOE eax esi
-..B19.17:                       # Preds ..B19.16 ..B19.44
-        addl      $3, %eax                                      #881.21
-        shrl      $2, %eax                                      #881.28
-        cmpl      $16, %eax                                     #881.35
-        jae       ..B19.30      # Prob 50%                      #881.35
-                                # LOE eax esi
-..B19.18:                       # Preds ..B19.17
-        lea       -40(%ebp), %edx                               #883.9
-        movl      %eax, %ecx                                    #881.5
-        negl      %ecx                                          #881.5
-        addl      $16, %ecx                                     #881.5
-        lea       (%edx,%eax), %edx                             #881.5
-        andl      $15, %edx                                     #881.5
-        movl      %edx, %edi                                    #881.5
-        negl      %edi                                          #881.5
-        addl      $16, %edi                                     #881.5
-        cmpl      $0, %edx                                      #881.5
-        cmovne    %edi, %edx                                    #881.5
-        movl      %edx, -56(%ebp)                               #881.5
-        lea       16(%edx), %edx                                #881.5
-        cmpl      %edx, %ecx                                    #881.5
-        jb        ..B19.42      # Prob 10%                      #881.5
-                                # LOE eax ecx esi
-..B19.19:                       # Preds ..B19.18
-        movl      -56(%ebp), %edx                               #881.5
-        movl      %ecx, %edi                                    #881.5
-        subl      %edx, %edi                                    #881.5
-        andl      $15, %edi                                     #881.5
-        negl      %edi                                          #881.5
-        addl      %ecx, %edi                                    #881.5
-        testl     %edx, %edx                                    #881.5
-        jbe       ..B19.23      # Prob 1%                       #881.5
-                                # LOE eax edx ecx esi edi dl dh
-..B19.20:                       # Preds ..B19.19
-        movl      %eax, -64(%ebp)                               #
-        movl      %ecx, -68(%ebp)                               #
-        movl      %eax, %ecx                                    #
-        movl      %esi, -60(%ebp)                               #
-        lea       (%edx,%eax), %edx                             #
-        movl      %edx, -44(%ebp)                               #
-        movl      %edx, %esi                                    #
-                                # LOE eax ecx esi edi
-..B19.21:                       # Preds ..B19.21 ..B19.20
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, -40(%ebp,%ecx)                           #883.9
-        movb      %dl, -24(%ebp,%ecx)                           #884.9
-        addl      $1, %ecx                                      #881.5
-        cmpl      %esi, %ecx                                    #881.5
-        jb        ..B19.21      # Prob 99%                      #881.5
-                                # LOE eax ecx esi edi
-..B19.22:                       # Preds ..B19.21
-        movl      -68(%ebp), %ecx                               #
-        movl      -60(%ebp), %esi                               #
-                                # LOE eax ecx esi edi
-..B19.23:                       # Preds ..B19.22 ..B19.19
-        movl      -56(%ebp), %edx                               #883.29
-        movl      %esi, -60(%ebp)                               #883.29
-        movl      %edx, %esi                                    #883.29
-        lea       (%edx,%eax), %edx                             #883.29
-        pxor      %xmm0, %xmm0                                  #883.29
-        movl      %edx, -44(%ebp)                               #883.29
-                                # LOE eax edx ecx esi edi xmm0
-..B19.24:                       # Preds ..B19.24 ..B19.23
-        movdqa    %xmm0, -40(%ebp,%edx)                         #883.9
-        movdqa    %xmm0, -24(%ebp,%edx)                         #884.9
-        addl      $16, %edx                                     #881.5
-        addl      $16, %esi                                     #881.5
-        cmpl      %edi, %esi                                    #881.5
-        jb        ..B19.24      # Prob 99%                      #881.5
-                                # LOE eax edx ecx esi edi xmm0
-..B19.25:                       # Preds ..B19.24
-        movl      -60(%ebp), %esi                               #
-                                # LOE eax ecx esi edi
-..B19.26:                       # Preds ..B19.25 ..B19.42
-        cmpl      %ecx, %edi                                    #881.5
-        jae       ..B19.30      # Prob 1%                       #881.5
-                                # LOE eax ecx esi edi
-..B19.27:                       # Preds ..B19.26
-        addl      %edi, %eax                                    #
-                                # LOE eax ecx esi edi
-..B19.28:                       # Preds ..B19.28 ..B19.27
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, -40(%ebp,%eax)                           #883.9
-        addl      $1, %edi                                      #881.5
-        movb      %dl, -24(%ebp,%eax)                           #884.9
-        addl      $1, %eax                                      #881.5
-        cmpl      %ecx, %edi                                    #881.5
-        jb        ..B19.28      # Prob 99%                      #881.5
-                                # LOE eax ecx esi edi
-..B19.30:                       # Preds ..B19.28 ..B19.26 ..B19.17
-        movl      12(%ebx), %eax                                #890.10
-        testl     %eax, %eax                                    #890.10
-        je        ..B19.32      # Prob 50%                      #890.10
-                                # LOE esi
-..B19.31:                       # Preds ..B19.30
-        movl      $9, (%esi)                                    #892.9
-        jmp       ..B19.41      # Prob 100%                     #892.9
-                                # LOE esi
-..B19.32:                       # Preds ..B19.30
-        movl      20(%ebx), %eax                                #896.22
-        cmpl      $2, %eax                                      #896.22
-        jae       ..B19.34      # Prob 50%                      #896.22
-                                # LOE esi
-..B19.33:                       # Preds ..B19.32
-        movzbl    -40(%ebp), %eax                               #898.29
-        movl      $2, (%esi)                                    #908.9
-        movb      %al, -39(%ebp)                                #898.9
-        movzwl    -40(%ebp), %edi                               #899.29
-        movw      %di, -38(%ebp)                                #899.9
-        movl      -40(%ebp), %eax                               #900.29
-        movl      %eax, -36(%ebp)                               #900.9
-        movl      -40(%ebp), %edx                               #901.29
-        movl      %edx, -32(%ebp)                               #901.9
-        movl      %eax, -28(%ebp)                               #901.9
-        movzbl    -24(%ebp), %eax                               #903.26
-        movb      %al, -23(%ebp)                                #903.9
-        movzwl    -24(%ebp), %eax                               #904.26
-        movw      %ax, -22(%ebp)                                #904.9
-        movl      -24(%ebp), %edx                               #905.26
-        movl      %edx, -20(%ebp)                               #905.9
-        movl      -24(%ebp), %eax                               #906.26
-        movl      %eax, -16(%ebp)                               #906.9
-        movl      %edx, -12(%ebp)                               #906.9
-        jmp       ..B19.41      # Prob 100%                     #906.9
-                                # LOE esi
-..B19.34:                       # Preds ..B19.32
-        movl      20(%ebx), %eax                                #910.22
-        cmpl      $6, %eax                                      #910.22
-        jae       ..B19.36      # Prob 50%                      #910.22
-                                # LOE esi
-..B19.35:                       # Preds ..B19.34
-        movzwl    -40(%ebp), %eax                               #912.29
-        movl      $3, (%esi)                                    #920.9
-        movw      %ax, -38(%ebp)                                #912.9
-        movl      -40(%ebp), %edi                               #913.29
-        movzwl    -24(%ebp), %eax                               #916.26
-        movl      %edi, -36(%ebp)                               #913.9
-        movl      -40(%ebp), %edx                               #914.29
-        movl      %edx, -32(%ebp)                               #914.9
-        movl      %edi, -28(%ebp)                               #914.9
-        movw      %ax, -22(%ebp)                                #916.9
-        movl      -24(%ebp), %edx                               #917.26
-        movl      %edx, -20(%ebp)                               #917.9
-        movl      -24(%ebp), %eax                               #918.26
-        movl      %eax, -16(%ebp)                               #918.9
-        movl      %edx, -12(%ebp)                               #918.9
-        jmp       ..B19.41      # Prob 100%                     #918.9
-                                # LOE esi
-..B19.36:                       # Preds ..B19.34
-        movl      20(%ebx), %eax                                #922.22
-        cmpl      $14, %eax                                     #922.22
-        jae       ..B19.38      # Prob 50%                      #922.22
-                                # LOE esi
-..B19.37:                       # Preds ..B19.36
-        movl      -40(%ebp), %edx                               #924.29
-        movl      $4, (%esi)                                    #930.9
-        movl      %edx, -36(%ebp)                               #924.9
-        movl      -40(%ebp), %eax                               #925.29
-        movl      %eax, -32(%ebp)                               #925.9
-        movl      -24(%ebp), %eax                               #927.26
-        movl      %edx, -28(%ebp)                               #925.9
-        movl      %eax, -20(%ebp)                               #927.9
-        movl      -24(%ebp), %edi                               #928.26
-        movl      %edi, -16(%ebp)                               #928.9
-        movl      %eax, -12(%ebp)                               #928.9
-        jmp       ..B19.41      # Prob 100%                     #928.9
-                                # LOE esi
-..B19.38:                       # Preds ..B19.36
-        movl      20(%ebx), %eax                                #932.22
-        cmpl      $30, %eax                                     #932.22
-        jae       ..B19.40      # Prob 50%                      #932.22
-                                # LOE esi
-..B19.39:                       # Preds ..B19.38
-        movl      -40(%ebp), %eax                               #934.29
-        movl      -36(%ebp), %edx                               #934.29
-        movl      -24(%ebp), %edi                               #935.26
-        movl      %eax, -32(%ebp)                               #934.9
-        movl      -20(%ebp), %eax                               #935.26
-        movl      $0, (%esi)                                    #937.9
-        movl      %edx, -28(%ebp)                               #934.9
-        movl      %edi, -16(%ebp)                               #935.9
-        movl      %eax, -12(%ebp)                               #935.9
-        jmp       ..B19.41      # Prob 100%                     #935.9
-                                # LOE esi
-..B19.40:                       # Preds ..B19.38
-        movl      $5, (%esi)                                    #941.9
-                                # LOE esi
-..B19.41:                       # Preds ..B19.31 ..B19.33 ..B19.35 ..B19.37 ..B19.39
-                                #       ..B19.40
-        movl      -40(%ebp), %eax                               #944.42
-        movl      -36(%ebp), %edi                               #944.42
-        lea       -40(%ebp), %ecx                               #948.5
-        movl      %eax, 16(%esi)                                #944.42
-        movl      -32(%ebp), %eax                               #944.42
-        movl      %edi, 20(%esi)                                #944.42
-        movl      %eax, 24(%esi)                                #944.42
-        movl      -28(%ebp), %eax                               #944.42
-        movl      %eax, 28(%esi)                                #944.42
-        movl      -24(%ebp), %eax                               #945.39
-        movl      %eax, 32(%esi)                                #945.39
-        movl      -20(%ebp), %eax                               #945.39
-        movl      %eax, 36(%esi)                                #945.39
-        movl      -16(%ebp), %eax                               #945.39
-        movl      %eax, 40(%esi)                                #945.39
-        movl      -12(%ebp), %eax                               #945.39
-        movl      %eax, 44(%esi)                                #945.39
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #948.5
-        lea       -24(%ebp), %ecx                               #949.5
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #949.5
-        movl      $2, %ecx                                      #952.5
-        lea       -40(%ebp), %edx                               #952.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #952.5
-        lea       -24(%ebp), %edx                               #953.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #953.5
-        lea       48(%esi), %ecx                                #956.5
-        lea       -40(%ebp), %edx                               #956.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #956.5
-        lea       64(%esi), %ecx                                #957.5
-        lea       -24(%ebp), %edx                               #957.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #957.5
-        movl      $2, %ecx                                      #959.5
-        lea       -40(%ebp), %edx                               #959.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #959.5
-        lea       -24(%ebp), %edx                               #960.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #960.5
-        lea       80(%esi), %ecx                                #962.5
-        lea       -40(%ebp), %edx                               #962.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #962.5
-        lea       96(%esi), %ecx                                #963.5
-        lea       -24(%ebp), %edx                               #963.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #963.5
-        movl      $2, %ecx                                      #965.5
-        lea       -40(%ebp), %edx                               #965.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #965.5
-        lea       -24(%ebp), %edx                               #966.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #966.5
-        lea       112(%esi), %ecx                               #968.5
-        lea       -40(%ebp), %edx                               #968.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #968.5
-        addl      $128, %esi                                    #969.5
-        movl      %esi, %ecx                                    #969.5
-        lea       -24(%ebp), %edx                               #969.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #969.5
-        xorl      %eax, %eax                                    #1011.12
-        movl      -52(%ebp), %esi                               #1011.12
-        movl      -48(%ebp), %edi                               #1011.12
-        movl      %ebp, %esp                                    #1011.12
-        popl      %ebp                                          #1011.12
-        movl      %ebx, %esp                                    #1011.12
-        popl      %ebx                                          #1011.12
-        ret                                                     #1011.12
-                                # LOE
-..B19.42:                       # Preds ..B19.18                # Infreq
-        xorl      %edi, %edi                                    #881.5
-        jmp       ..B19.26      # Prob 100%                     #881.5
-                                # LOE eax ecx esi edi
-..B19.43:                       # Preds ..B19.8                 # Infreq
-        movl      %eax, %esi                                    #862.32
-        shrl      $2, %esi                                      #862.32
-        movb      $192, -24(%ebp,%esi)                          #863.13
-        shll      $6, %ecx                                      #862.46
-        movb      %cl, -40(%ebp,%esi)                           #862.13
-        jmp       ..B19.15      # Prob 100%                     #862.13
-                                # LOE eax edx
-..B19.44:                       # Preds ..B19.6                 # Infreq
-        xorl      %eax, %eax                                    #
-        jmp       ..B19.17      # Prob 100%                     #
-                                # LOE eax esi
-..B19.45:                       # Preds ..B19.4 ..B19.5         # Infreq
-        movl      %edi, %ebx                                    #849.16
-        call      __errno_location at PLT                          #849.16
-        movl      -72(%ebp), %ebx                               #849.16
-                                # LOE eax
-..B19.50:                       # Preds ..B19.45                # Infreq
-        movl      -52(%ebp), %esi                               #849.16
-        movl      -48(%ebp), %edi                               #849.16
-        movl      (%eax), %eax                                  #849.16
-        movl      %ebp, %esp                                    #849.16
-        popl      %ebp                                          #849.16
-        movl      %ebx, %esp                                    #849.16
-        popl      %ebx                                          #849.16
-        ret                                                     #849.16
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-.LNNucStrFastaExprMake2:
-	.data
-# -- End  NucStrFastaExprMake2
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    2,0x90
-nss_expr:
-# parameter 1(p): 8 + %ebp
-# parameter 2(end): 12 + %ebp
-# parameter 3(expr): 16 + %ebp
-# parameter 4(status): 20 + %ebp
-# parameter 5(positional): 24 + %ebp
-..B20.1:                        # Preds ..B20.0
-        pushl     %ebp                                          #1406.1
-        movl      %esp, %ebp                                    #1406.1
-        subl      $28, %esp                                     #1406.1
-        movl      %edi, -16(%ebp)                               #1406.1
-        movl      %esi, -20(%ebp)                               #1406.1
-        movl      %ebx, -12(%ebp)                               #1406.1
-        movl      8(%ebp), %esi                                 #1404.13
-        movl      16(%ebp), %edi                                #1404.13
-        call      ..L20         # Prob 100%                     #1406.1
-..L20:                                                          #
-        popl      %ebx                                          #1406.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L20], %ebx      #1406.1
-        lea       _gprof_pack19 at GOTOFF(%ebx), %edx              #1406.1
-        call      mcount at PLT                                    #1406.1
-                                # LOE ebx esi edi
-..B20.85:                       # Preds ..B20.1
-        call      __ctype_b_loc at PLT                             #1409.9
-                                # LOE eax ebx esi edi
-..B20.86:                       # Preds ..B20.85
-        movl      20(%ebp), %edx                                #1409.9
-        movl      12(%ebp), %ecx                                #1409.9
-        movl      %ebx, -8(%ebp)                                #1409.9
-        movl      %eax, -4(%ebp)                                #1409.9
-        jmp       ..B20.2       # Prob 100%                     #1409.9
-                                # LOE edx ecx esi edi
-..B20.54:                       # Preds ..B20.53
-        movl      -24(%ebp), %ebx                               #1459.17
-        movl      $11, (%eax)                                   #1458.17
-        movl      %ebx, 4(%eax)                                 #1459.17
-        movl      (%edi), %ebx                                  #1460.41
-        movl      %ebx, 8(%eax)                                 #1460.17
-        movl      %eax, (%edi)                                  #1461.17
-        lea       12(%eax), %edi                                #1464.42
-                                # LOE edx ecx esi edi
-..B20.2:                        # Preds ..B20.86 ..B20.54
-        movl      $0, (%edi)                                    #1407.5
-        cmpl      %ecx, %esi                                    #1409.9
-        jae       ..B20.8       # Prob 12%                      #1409.9
-                                # LOE edx ecx esi edi
-..B20.3:                        # Preds ..B20.2
-        movl      -4(%ebp), %eax                                #1409.9
-        movl      (%eax), %eax                                  #1409.9
-        movzbl    (%esi), %ebx                                  #1409.9
-        movzwl    (%eax,%ebx,2), %ebx                           #1409.9
-        testl     $8192, %ebx                                   #1409.9
-        je        ..B20.8       # Prob 15%                      #1409.9
-                                # LOE eax edx ecx esi edi
-..B20.5:                        # Preds ..B20.3 ..B20.6
-        addl      $1, %esi                                      #1409.9
-        cmpl      %ecx, %esi                                    #1409.9
-        jae       ..B20.8       # Prob 1%                       #1409.9
-                                # LOE eax edx ecx esi edi
-..B20.6:                        # Preds ..B20.5
-        movzbl    (%esi), %ebx                                  #1409.9
-        movzwl    (%eax,%ebx,2), %ebx                           #1409.9
-        testl     $8192, %ebx                                   #1409.9
-        jne       ..B20.5       # Prob 82%                      #1409.9
-                                # LOE eax edx ecx esi edi
-..B20.8:                        # Preds ..B20.5 ..B20.6 ..B20.3 ..B20.2
-        cmpl      %ecx, %esi                                    #1410.15
-        je        ..B20.58      # Prob 16%                      #1410.15
-                                # LOE edx ecx esi edi
-..B20.9:                        # Preds ..B20.8
-        movsbl    (%esi), %eax                                  #1412.13
-        cmpl      $33, %eax                                     #1412.13
-        je        ..B20.65      # Prob 16%                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.10:                       # Preds ..B20.9
-        cmpl      $94, %eax                                     #1412.13
-        jne       ..B20.17      # Prob 67%                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.11:                       # Preds ..B20.10
-        movl      -8(%ebp), %ebx                                #1412.13
-        pushl     $12                                           #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE eax esi edi
-..B20.87:                       # Preds ..B20.11
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $4, %esp                                      #1412.13
-        movl      %eax, %ebx                                    #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.12:                       # Preds ..B20.87
-        testl     %ebx, %ebx                                    #1412.13
-        jne       ..B20.14      # Prob 68%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.13:                       # Preds ..B20.12
-        movl      -8(%ebp), %ebx                                #1412.13
-        call      __errno_location at PLT                          #1412.13
-                                # LOE eax esi edi
-..B20.88:                       # Preds ..B20.13
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      (%eax), %ebx                                  #1412.13
-        movl      %ebx, (%edx)                                  #1412.13
-        jmp       ..B20.35      # Prob 100%                     #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.14:                       # Preds ..B20.12
-        movl      %ebx, -24(%ebp)                               #1412.13
-        movl      $12, (%ebx)                                   #1412.13
-        movl      %ebx, (%edi)                                  #1412.13
-        movl      $14, 4(%ebx)                                  #1412.13
-        pushl     %ecx                                          #1406.1
-        addl      $1, %esi                                      #1412.13
-        movl      $0, 8(%ebx)                                   #1412.13
-        pushl     %esi                                          #1406.1
-        call      nss_sob                                       #1412.13
-                                # LOE eax ebx edi bl bh
-..B20.89:                       # Preds ..B20.14
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      24(%ebp), %esi                                #1406.1
-        addl      $8, %ebx                                      #1412.13
-        pushl     %esi                                          #1406.1
-        pushl     %edx                                          #1406.1
-        pushl     %ebx                                          #1406.1
-        pushl     %ecx                                          #1406.1
-        pushl     %eax                                          #1406.1
-        call      nss_fasta_expr                                #1412.13
-                                # LOE eax edi
-..B20.90:                       # Preds ..B20.89
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $28, %esp                                     #1412.13
-        movl      %eax, %esi                                    #1412.13
-                                # LOE edx ecx esi edi
-..B20.15:                       # Preds ..B20.90
-        movl      (%edx), %ebx                                  #1413.16
-        jmp       ..B20.35      # Prob 100%                     #1413.16
-                                # LOE edx ecx ebx esi edi
-..B20.17:                       # Preds ..B20.10
-        cmpl      $40, %eax                                     #1412.13
-        jne       ..B20.28      # Prob 50%                      #1412.13
-                                # LOE edx ecx esi edi
-..B20.18:                       # Preds ..B20.17
-        movl      -8(%ebp), %ebx                                #1412.13
-        pushl     $12                                           #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE eax esi edi
-..B20.91:                       # Preds ..B20.18
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      %eax, -24(%ebp)                               #1412.13
-        addl      $4, %esp                                      #1412.13
-                                # LOE eax edx ecx esi edi al ah
-..B20.19:                       # Preds ..B20.91
-        testl     %eax, %eax                                    #1412.13
-        jne       ..B20.21      # Prob 68%                      #1412.13
-                                # LOE eax edx ecx esi edi al ah
-..B20.20:                       # Preds ..B20.19
-        movl      -8(%ebp), %ebx                                #1412.13
-        call      __errno_location at PLT                          #1412.13
-                                # LOE eax esi edi
-..B20.92:                       # Preds ..B20.20
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      (%eax), %ebx                                  #1412.13
-        movl      %ebx, (%edx)                                  #1412.13
-        jmp       ..B20.35      # Prob 100%                     #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.21:                       # Preds ..B20.19
-        movl      24(%ebp), %ebx                                #1406.1
-        movl      $12, (%eax)                                   #1412.13
-        movl      %eax, (%edi)                                  #1412.13
-        movl      $0, 4(%eax)                                   #1412.13
-        pushl     %ebx                                          #1406.1
-        addl      $1, %esi                                      #1412.13
-        pushl     %edx                                          #1406.1
-        lea       8(%eax), %eax                                 #1412.13
-        pushl     %eax                                          #1406.1
-        pushl     %ecx                                          #1406.1
-        pushl     %esi                                          #1406.1
-        call      nss_expr                                      #1412.13
-                                # LOE eax edi
-..B20.93:                       # Preds ..B20.21
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $20, %esp                                     #1412.13
-        movl      %eax, %esi                                    #1412.13
-                                # LOE edx ecx esi edi
-..B20.22:                       # Preds ..B20.93
-        movl      (%edx), %ebx                                  #1412.13
-        testl     %ebx, %ebx                                    #1412.13
-        jne       ..B20.35      # Prob 50%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.23:                       # Preds ..B20.22
-        movl      -24(%ebp), %eax                               #1412.13
-        movl      8(%eax), %eax                                 #1412.13
-        testl     %eax, %eax                                    #1412.13
-        je        ..B20.26      # Prob 12%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.24:                       # Preds ..B20.23
-        cmpl      %ecx, %esi                                    #1412.13
-        je        ..B20.26      # Prob 12%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.25:                       # Preds ..B20.24
-        movsbl    (%esi), %eax                                  #1412.13
-        addl      $1, %esi                                      #1412.13
-        cmpl      $41, %eax                                     #1412.13
-        je        ..B20.35      # Prob 50%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.26:                       # Preds ..B20.25 ..B20.24 ..B20.23
-        movl      $22, (%edx)                                   #1412.13
-        movl      $22, %ebx                                     #
-        jmp       ..B20.35      # Prob 100%                     #
-                                # LOE edx ecx ebx esi edi
-..B20.28:                       # Preds ..B20.17
-        movl      24(%ebp), %eax                                #1406.1
-        pushl     %eax                                          #1406.1
-        pushl     %edx                                          #1406.1
-        pushl     %edi                                          #1406.1
-        pushl     %ecx                                          #1406.1
-        pushl     %esi                                          #1406.1
-        call      nss_fasta_expr                                #1412.13
-                                # LOE eax edi
-..B20.94:                       # Preds ..B20.28
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $20, %esp                                     #1412.13
-        movl      %eax, %esi                                    #1412.13
-                                # LOE edx ecx esi edi
-..B20.29:                       # Preds ..B20.94
-        movl      (%edx), %ebx                                  #1412.13
-        testl     %ebx, %ebx                                    #1412.13
-        jne       ..B20.35      # Prob 50%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.30:                       # Preds ..B20.29
-        cmpl      %ecx, %esi                                    #1412.13
-        jae       ..B20.35      # Prob 33%                      #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.31:                       # Preds ..B20.30
-        movl      %ebx, -28(%ebp)                               #1412.13
-        pushl     %ecx                                          #1406.1
-        pushl     %esi                                          #1406.1
-        call      nss_sob                                       #1412.13
-                                # LOE eax ebx edi bl bh
-..B20.95:                       # Preds ..B20.31
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $8, %esp                                      #1412.13
-        movl      %eax, %esi                                    #1412.13
-        cmpl      %ecx, %esi                                    #1412.13
-        jae       ..B20.35      # Prob 12%                      #1412.13
-                                # LOE edx ecx ebx esi edi bl bh
-..B20.32:                       # Preds ..B20.95
-        movsbl    (%esi), %eax                                  #1412.13
-        cmpl      $36, %eax                                     #1412.13
-        je        ..B20.59      # Prob 5%                       #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.35:                       # Preds ..B20.76 ..B20.72 ..B20.101 ..B20.88 ..B20.15
-                                #       ..B20.92 ..B20.25 ..B20.26 ..B20.22 ..B20.98
-                                #       ..B20.95 ..B20.61 ..B20.32 ..B20.30 ..B20.29
-                                #      
-        testl     %ebx, %ebx                                    #1413.26
-        jne       ..B20.58      # Prob 58%                      #1413.26
-                                # LOE edx ecx esi edi
-..B20.36:                       # Preds ..B20.35
-        cmpl      %ecx, %esi                                    #1415.17
-        jae       ..B20.42      # Prob 12%                      #1415.17
-                                # LOE edx ecx esi edi
-..B20.37:                       # Preds ..B20.36
-        movl      -4(%ebp), %eax                                #1415.17
-        movl      (%eax), %eax                                  #1415.17
-        movzbl    (%esi), %ebx                                  #1415.17
-        movzwl    (%eax,%ebx,2), %ebx                           #1415.17
-        testl     $8192, %ebx                                   #1415.17
-        je        ..B20.42      # Prob 15%                      #1415.17
-                                # LOE eax edx ecx esi edi
-..B20.39:                       # Preds ..B20.37 ..B20.40
-        addl      $1, %esi                                      #1415.17
-        cmpl      %ecx, %esi                                    #1415.17
-        jae       ..B20.42      # Prob 1%                       #1415.17
-                                # LOE eax edx ecx esi edi
-..B20.40:                       # Preds ..B20.39
-        movzbl    (%esi), %ebx                                  #1415.17
-        movzwl    (%eax,%ebx,2), %ebx                           #1415.17
-        testl     $8192, %ebx                                   #1415.17
-        jne       ..B20.39      # Prob 82%                      #1415.17
-                                # LOE eax edx ecx esi edi
-..B20.42:                       # Preds ..B20.39 ..B20.40 ..B20.37 ..B20.36
-        cmpl      %ecx, %esi                                    #1416.23
-        je        ..B20.58      # Prob 4%                       #1416.23
-                                # LOE edx ecx esi edi
-..B20.43:                       # Preds ..B20.42
-        movsbl    (%esi), %eax                                  #1422.28
-        addl      $1, %esi                                      #1422.28
-        cmpl      $41, %eax                                     #1422.28
-        je        ..B20.56      # Prob 25%                      #1422.28
-                                # LOE eax edx ecx esi edi
-..B20.44:                       # Preds ..B20.43
-        cmpl      $38, %eax                                     #1422.28
-        jne       ..B20.48      # Prob 67%                      #1422.28
-                                # LOE eax edx ecx esi edi
-..B20.45:                       # Preds ..B20.44
-        cmpl      %ecx, %esi                                    #1427.30
-        jae       ..B20.47      # Prob 12%                      #1427.30
-                                # LOE edx ecx esi edi
-..B20.46:                       # Preds ..B20.45
-        movsbl    (%esi), %eax                                  #1427.39
-        lea       1(%esi), %ebx                                 #1428.28
-        cmpl      $38, %eax                                     #1428.28
-        cmove     %ebx, %esi                                    #1428.28
-                                # LOE edx ecx esi edi
-..B20.47:                       # Preds ..B20.46 ..B20.45
-        movl      $16, %eax                                     #1429.21
-        movl      %eax, -24(%ebp)                               #1429.21
-        jmp       ..B20.52      # Prob 100%                     #1429.21
-                                # LOE edx ecx esi edi
-..B20.48:                       # Preds ..B20.44
-        cmpl      $124, %eax                                    #1422.28
-        jne       ..B20.55      # Prob 50%                      #1422.28
-                                # LOE edx ecx esi edi
-..B20.49:                       # Preds ..B20.48
-        cmpl      %ecx, %esi                                    #1432.30
-        jae       ..B20.51      # Prob 12%                      #1432.30
-                                # LOE edx ecx esi edi
-..B20.50:                       # Preds ..B20.49
-        movsbl    (%esi), %eax                                  #1432.39
-        lea       1(%esi), %ebx                                 #1433.28
-        cmpl      $124, %eax                                    #1433.28
-        cmove     %ebx, %esi                                    #1433.28
-                                # LOE edx ecx esi edi
-..B20.51:                       # Preds ..B20.50 ..B20.49
-        movl      $17, %eax                                     #1434.21
-        movl      %eax, -24(%ebp)                               #1434.21
-                                # LOE edx ecx esi edi
-..B20.52:                       # Preds ..B20.47 ..B20.51
-        movl      -8(%ebp), %ebx                                #1451.21
-        pushl     $16                                           #1451.30
-        call      malloc at PLT                                    #1451.21
-                                # LOE eax esi edi
-..B20.96:                       # Preds ..B20.52
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $4, %esp                                      #1451.21
-                                # LOE eax edx ecx esi edi
-..B20.53:                       # Preds ..B20.96
-        testl     %eax, %eax                                    #1452.27
-        je        ..B20.82      # Prob 1%                       #1452.27
-        jmp       ..B20.54      # Prob 100%                     #1452.27
-                                # LOE eax edx ecx esi edi
-..B20.55:                       # Preds ..B20.48
-        movl      20(%ebp), %edx                                #1438.21
-        movl      -12(%ebp), %ebx                               #1439.32
-        movl      -16(%ebp), %edi                               #1439.32
-        addl      $-1, %esi                                     #1439.32
-        movl      %esi, %eax                                    #1439.32
-        movl      -20(%ebp), %esi                               #1439.32
-        movl      $22, (%edx)                                   #1438.21
-        movl      %ebp, %esp                                    #1439.32
-        popl      %ebp                                          #1439.32
-        ret                                                     #1439.32
-                                # LOE
-..B20.56:                       # Preds ..B20.43
-        movl      -12(%ebp), %ebx                               #1425.32
-        movl      -16(%ebp), %edi                               #1425.32
-        addl      $-1, %esi                                     #1425.32
-        movl      %esi, %eax                                    #1425.32
-        movl      -20(%ebp), %esi                               #1425.32
-        movl      %ebp, %esp                                    #1425.32
-        popl      %ebp                                          #1425.32
-        ret                                                     #1425.32
-                                # LOE
-..B20.58:                       # Preds ..B20.8 ..B20.42 ..B20.35
-        movl      -12(%ebp), %ebx                               #1470.12
-        movl      -16(%ebp), %edi                               #1470.12
-        movl      %esi, %eax                                    #1470.12
-        movl      -20(%ebp), %esi                               #1470.12
-        movl      %ebp, %esp                                    #1470.12
-        popl      %ebp                                          #1470.12
-        ret                                                     #1470.12
-                                # LOE
-..B20.59:                       # Preds ..B20.32                # Infreq
-        movl      -8(%ebp), %ebx                                #1412.13
-        pushl     $12                                           #1412.13
-        addl      $1, %esi                                      #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE eax esi edi
-..B20.97:                       # Preds ..B20.59                # Infreq
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $4, %esp                                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.60:                       # Preds ..B20.97                # Infreq
-        testl     %eax, %eax                                    #1412.13
-        je        ..B20.62      # Prob 12%                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.61:                       # Preds ..B20.60                # Infreq
-        movl      (%edi), %ebx                                  #1412.13
-        movl      $12, (%eax)                                   #1412.13
-        movl      %ebx, 8(%eax)                                 #1412.13
-        movl      %eax, (%edi)                                  #1412.13
-        movl      (%edx), %ebx                                  #1413.16
-        movl      $15, 4(%eax)                                  #1412.13
-        jmp       ..B20.35      # Prob 100%                     #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.62:                       # Preds ..B20.60                # Infreq
-        movl      -8(%ebp), %ebx                                #1412.13
-        call      __errno_location at PLT                          #1412.13
-                                # LOE eax esi edi
-..B20.98:                       # Preds ..B20.62                # Infreq
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      (%eax), %ebx                                  #1412.13
-        movl      %ebx, (%edx)                                  #1412.13
-        jmp       ..B20.35      # Prob 100%                     #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.65:                       # Preds ..B20.9                 # Infreq
-        addl      $1, %esi                                      #1412.13
-        cmpl      %ecx, %esi                                    #1412.13
-        jae       ..B20.71      # Prob 12%                      #1412.13
-                                # LOE edx ecx esi edi
-..B20.66:                       # Preds ..B20.65                # Infreq
-        movl      -4(%ebp), %eax                                #1412.13
-        movl      (%eax), %eax                                  #1412.13
-        movzbl    (%esi), %ebx                                  #1412.13
-        movzwl    (%eax,%ebx,2), %ebx                           #1412.13
-        testl     $8192, %ebx                                   #1412.13
-        je        ..B20.71      # Prob 15%                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.68:                       # Preds ..B20.66 ..B20.69       # Infreq
-        addl      $1, %esi                                      #1412.13
-        cmpl      %ecx, %esi                                    #1412.13
-        jae       ..B20.71      # Prob 1%                       #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.69:                       # Preds ..B20.68                # Infreq
-        movzbl    (%esi), %ebx                                  #1412.13
-        movzwl    (%eax,%ebx,2), %ebx                           #1412.13
-        testl     $8192, %ebx                                   #1412.13
-        jne       ..B20.68      # Prob 82%                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.71:                       # Preds ..B20.68 ..B20.69 ..B20.66 ..B20.65 # Infreq
-        cmpl      %ecx, %esi                                    #1412.13
-        jne       ..B20.73      # Prob 68%                      #1412.13
-                                # LOE edx ecx esi edi
-..B20.72:                       # Preds ..B20.71                # Infreq
-        movl      $22, (%edx)                                   #1412.13
-        movl      $22, %ebx                                     #
-        jmp       ..B20.35      # Prob 100%                     #
-                                # LOE edx ecx ebx esi edi
-..B20.73:                       # Preds ..B20.71                # Infreq
-        movl      -8(%ebp), %ebx                                #1412.13
-        pushl     $12                                           #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE eax esi edi
-..B20.99:                       # Preds ..B20.73                # Infreq
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $4, %esp                                      #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.74:                       # Preds ..B20.99                # Infreq
-        testl     %eax, %eax                                    #1412.13
-        je        ..B20.78      # Prob 1%                       #1412.13
-                                # LOE eax edx ecx esi edi
-..B20.75:                       # Preds ..B20.74                # Infreq
-        movl      24(%ebp), %ebx                                #1406.1
-        movl      $12, (%eax)                                   #1412.13
-        movl      %eax, (%edi)                                  #1412.13
-        movl      $13, 4(%eax)                                  #1412.13
-        pushl     %ebx                                          #1406.1
-        movl      $0, 8(%eax)                                   #1412.13
-        pushl     %edx                                          #1406.1
-        addl      $8, %eax                                      #1412.13
-        pushl     %eax                                          #1406.1
-        pushl     %ecx                                          #1406.1
-        pushl     %esi                                          #1406.1
-        call      nss_unary_expr                                #1412.13
-                                # LOE eax edi
-..B20.100:                      # Preds ..B20.75                # Infreq
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        addl      $20, %esp                                     #1412.13
-        movl      %eax, %esi                                    #1412.13
-                                # LOE edx ecx esi edi
-..B20.76:                       # Preds ..B20.100               # Infreq
-        movl      (%edx), %ebx                                  #1413.16
-        jmp       ..B20.35      # Prob 100%                     #1413.16
-                                # LOE edx ecx ebx esi edi
-..B20.78:                       # Preds ..B20.74                # Infreq
-        movl      -8(%ebp), %ebx                                #1412.13
-        call      __errno_location at PLT                          #1412.13
-                                # LOE eax esi edi
-..B20.101:                      # Preds ..B20.78                # Infreq
-        movl      20(%ebp), %edx                                #
-        movl      12(%ebp), %ecx                                #
-        movl      (%eax), %ebx                                  #1412.13
-        movl      %ebx, (%edx)                                  #1412.13
-        jmp       ..B20.35      # Prob 100%                     #1412.13
-                                # LOE edx ecx ebx esi edi
-..B20.82:                       # Preds ..B20.53                # Infreq
-        movl      -8(%ebp), %ebx                                #
-        call      __errno_location at PLT                          #1454.32
-                                # LOE eax esi
-..B20.102:                      # Preds ..B20.82                # Infreq
-        movl      20(%ebp), %ecx                                #1454.21
-        movl      -12(%ebp), %ebx                               #1455.28
-        movl      -16(%ebp), %edi                               #1455.28
-        movl      (%eax), %edx                                  #1454.32
-        movl      %edx, (%ecx)                                  #1454.21
-        movl      %esi, %eax                                    #1451.21
-        movl      -20(%ebp), %esi                               #1455.28
-        movl      %ebp, %esp                                    #1455.28
-        popl      %ebp                                          #1455.28
-        ret                                                     #1455.28
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-.LNnss_expr:
-	.data
-# -- End  nss_expr
-	.text
-# -- Begin  NucStrstrInit
-# mark_begin;
-       .align    2,0x90
-NucStrstrInit:
-..B21.1:                        # Preds ..B21.0
-        pushl     %ebp                                          #1484.1
-        movl      %esp, %ebp                                    #1484.1
-        subl      $32, %esp                                     #1484.1
-        movl      %edi, -24(%ebp)                               #1484.1
-        movl      %esi, -28(%ebp)                               #1484.1
-        movl      %ebx, -32(%ebp)                               #1484.1
-        call      ..L21         # Prob 100%                     #1484.1
-..L21:                                                          #
-        popl      %ebx                                          #1484.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L21], %ebx      #1484.1
-        lea       _gprof_pack20 at GOTOFF(%ebx), %edx              #1484.1
-        call      mcount at PLT                                    #1484.1
-                                # LOE ebx
-..B21.29:                       # Preds ..B21.1
-        lea       fasta_2na_map.0 at GOTOFF(%ebx), %edi            #1491.14
-        movl      $-1, %eax                                     #1491.5
-        movd      %eax, %xmm0                                   #1491.5
-        pshufd    $0, %xmm0, %xmm1                              #1491.5
-        movq      %xmm1, (%edi)                                 #1491.5
-        movq      %xmm1, 8(%edi)                                #1491.5
-        movq      %xmm1, 16(%edi)                               #1491.5
-        movq      %xmm1, 24(%edi)                               #1491.5
-        movq      %xmm1, 32(%edi)                               #1491.5
-        movq      %xmm1, 40(%edi)                               #1491.5
-        movq      %xmm1, 48(%edi)                               #1491.5
-        movq      %xmm1, 56(%edi)                               #1491.5
-        movq      %xmm1, 64(%edi)                               #1491.5
-        movq      %xmm1, 72(%edi)                               #1491.5
-        movq      %xmm1, 80(%edi)                               #1491.5
-        movq      %xmm1, 88(%edi)                               #1491.5
-        movq      %xmm1, 96(%edi)                               #1491.5
-        movq      %xmm1, 104(%edi)                              #1491.5
-        movq      %xmm1, 112(%edi)                              #1491.5
-        movq      %xmm1, 120(%edi)                              #1491.5
-                                # LOE ebx edi
-..B21.2:                        # Preds ..B21.29
-        lea       fasta_4na_map.0 at GOTOFF(%ebx), %eax            #1492.14
-        movl      $-1, %edx                                     #1492.5
-        movd      %edx, %xmm0                                   #1492.5
-        pshufd    $0, %xmm0, %xmm1                              #1492.5
-        movq      %xmm1, (%eax)                                 #1492.5
-        movq      %xmm1, 8(%eax)                                #1492.5
-        movq      %xmm1, 16(%eax)                               #1492.5
-        movq      %xmm1, 24(%eax)                               #1492.5
-        movq      %xmm1, 32(%eax)                               #1492.5
-        movq      %xmm1, 40(%eax)                               #1492.5
-        movq      %xmm1, 48(%eax)                               #1492.5
-        movq      %xmm1, 56(%eax)                               #1492.5
-        movq      %xmm1, 64(%eax)                               #1492.5
-        movq      %xmm1, 72(%eax)                               #1492.5
-        movq      %xmm1, 80(%eax)                               #1492.5
-        movq      %xmm1, 88(%eax)                               #1492.5
-        movq      %xmm1, 96(%eax)                               #1492.5
-        movq      %xmm1, 104(%eax)                              #1492.5
-        movq      %xmm1, 112(%eax)                              #1492.5
-        movq      %xmm1, 120(%eax)                              #1492.5
-                                # LOE eax ebx edi
-..B21.3:                        # Preds ..B21.2
-        lea       _2__STRING.0.0 at GOTOFF(%ebx), %ecx             #1487.29
-        movsbl    (%ecx), %esi                                  #1497.14
-        movl      %eax, -8(%ebp)                                #
-        movl      %edi, -4(%ebp)                                #
-        movl      %ebx, -20(%ebp)                               #
-        xorl      %edx, %edx                                    #
-                                # LOE edx ecx esi
-..B21.10:                       # Preds ..B21.3 ..B21.11
-        movl      -20(%ebp), %ebx                               #1498.48
-        movl      %edx, -16(%ebp)                               #1498.48
-        pushl     %esi                                          #1497.9
-        movl      %ecx, -12(%ebp)                               #1498.48
-        call      tolower at PLT                                   #1498.48
-                                # LOE eax esi
-..B21.30:                       # Preds ..B21.10
-        movl      -12(%ebp), %ecx                               #
-        movl      -16(%ebp), %edx                               #
-        addl      $4, %esp                                      #1498.48
-                                # LOE eax edx ecx esi dl cl dh ch
-..B21.11:                       # Preds ..B21.30
-        movl      -4(%ebp), %ebx                                #1498.32
-        movb      %dl, (%eax,%ebx)                              #1498.32
-        movb      %dl, (%ebx,%esi)                              #1498.9
-        movsbl    1(%ecx), %esi                                 #1495.31
-        addl      $1, %edx                                      #1495.48
-        addl      $1, %ecx                                      #1495.54
-        testl     %esi, %esi                                    #1495.42
-        jne       ..B21.10      # Prob 82%                      #1495.42
-                                # LOE edx ecx esi
-..B21.12:                       # Preds ..B21.11
-        movl      -8(%ebp), %eax                                #
-        movl      -20(%ebp), %ebx                               #
-        lea       _2__STRING.1.0 at GOTOFF(%ebx), %ecx             #1488.25
-        movsbl    (%ecx), %esi                                  #1504.14
-        xorl      %edx, %edx                                    #
-        movl      %eax, -8(%ebp)                                #
-        movl      %ebx, -20(%ebp)                               #
-                                # LOE edx ecx esi
-..B21.19:                       # Preds ..B21.12 ..B21.20
-        movl      -20(%ebp), %ebx                               #1505.48
-        movl      %edx, -12(%ebp)                               #1505.48
-        pushl     %esi                                          #1504.9
-        movl      %ecx, -16(%ebp)                               #1505.48
-        call      tolower at PLT                                   #1505.48
-                                # LOE eax esi
-..B21.31:                       # Preds ..B21.19
-        movl      -16(%ebp), %ecx                               #
-        movl      -12(%ebp), %edx                               #
-        addl      $4, %esp                                      #1505.48
-                                # LOE eax edx ecx esi dl cl dh ch
-..B21.20:                       # Preds ..B21.31
-        movl      -8(%ebp), %ebx                                #1505.32
-        movb      %dl, (%eax,%ebx)                              #1505.32
-        movb      %dl, (%ebx,%esi)                              #1505.9
-        movsbl    1(%ecx), %esi                                 #1502.31
-        addl      $1, %edx                                      #1502.48
-        addl      $1, %ecx                                      #1502.54
-        testl     %esi, %esi                                    #1502.42
-        jne       ..B21.19      # Prob 82%                      #1502.42
-                                # LOE edx ecx esi
-..B21.21:                       # Preds ..B21.20
-        movl      -20(%ebp), %ebx                               #
-        lea       512(%ebx), %eax                               #1510.11
-                                # LOE eax ebx
-..B21.22:                       # Preds ..B21.25 ..B21.21
-        movzwl    expand_2na.0 at GOTOFF(%ebx), %edx               #1511.28
-                                # LOE eax edx ebx
-..B21.24:                       # Preds ..B21.22
-# Begin ASM
-        rorw $8, %dx
-# End ASM                                                       #1511.0
-                                # LOE eax edx ebx
-..B21.25:                       # Preds ..B21.24
-        movw      %dx, expand_2na.0 at GOTOFF(%ebx)                #1511.9
-        addl      $2, %ebx                                      #1510.30
-        cmpl      %ebx, %eax                                    #1510.22
-        ja        ..B21.22      # Prob 99%                      #1510.22
-                                # LOE eax ebx
-..B21.26:                       # Preds ..B21.25
-        movl      -32(%ebp), %ebx                               #1513.1
-        movl      -28(%ebp), %esi                               #1513.1
-        movl      -24(%ebp), %edi                               #1513.1
-        movl      %ebp, %esp                                    #1513.1
-        popl      %ebp                                          #1513.1
-        ret                                                     #1513.1
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrInit, at function
-	.size	NucStrstrInit,.-NucStrstrInit
-.LNNucStrstrInit:
-	.data
-# -- End  NucStrstrInit
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map.0:
-	.type	fasta_2na_map.0, at object
-	.size	fasta_2na_map.0,128
-	.space 128	# pad
-fasta_4na_map.0:
-	.type	fasta_4na_map.0, at object
-	.size	fasta_4na_map.0,128
-	.space 128	# pad
-	.data
-	.align 32
-	.align 32
-expand_2na.0:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na.0, at object
-	.size	expand_2na.0,512
-	.section .rodata, "a"
-	.align 4
-	.align 4
-_gprof_pack0:
-	.long	0
-	.type	_gprof_pack0, at object
-	.size	_gprof_pack0,4
-_gprof_pack1:
-	.long	0
-	.type	_gprof_pack1, at object
-	.size	_gprof_pack1,4
-_gprof_pack2:
-	.long	0
-	.type	_gprof_pack2, at object
-	.size	_gprof_pack2,4
-_gprof_pack3:
-	.long	0
-	.type	_gprof_pack3, at object
-	.size	_gprof_pack3,4
-_gprof_pack4:
-	.long	0
-	.type	_gprof_pack4, at object
-	.size	_gprof_pack4,4
-_gprof_pack5:
-	.long	0
-	.type	_gprof_pack5, at object
-	.size	_gprof_pack5,4
-_gprof_pack6:
-	.long	0
-	.type	_gprof_pack6, at object
-	.size	_gprof_pack6,4
-_gprof_pack7:
-	.long	0
-	.type	_gprof_pack7, at object
-	.size	_gprof_pack7,4
-_gprof_pack8:
-	.long	0
-	.type	_gprof_pack8, at object
-	.size	_gprof_pack8,4
-_gprof_pack9:
-	.long	0
-	.type	_gprof_pack9, at object
-	.size	_gprof_pack9,4
-_gprof_pack10:
-	.long	0
-	.type	_gprof_pack10, at object
-	.size	_gprof_pack10,4
-_gprof_pack11:
-	.long	0
-	.type	_gprof_pack11, at object
-	.size	_gprof_pack11,4
-_gprof_pack12:
-	.long	0
-	.type	_gprof_pack12, at object
-	.size	_gprof_pack12,4
-_gprof_pack13:
-	.long	0
-	.type	_gprof_pack13, at object
-	.size	_gprof_pack13,4
-_gprof_pack14:
-	.long	0
-	.type	_gprof_pack14, at object
-	.size	_gprof_pack14,4
-_gprof_pack15:
-	.long	0
-	.type	_gprof_pack15, at object
-	.size	_gprof_pack15,4
-_gprof_pack16:
-	.long	0
-	.type	_gprof_pack16, at object
-	.size	_gprof_pack16,4
-_gprof_pack17:
-	.long	0
-	.type	_gprof_pack17, at object
-	.size	_gprof_pack17,4
-_gprof_pack18:
-	.long	0
-	.type	_gprof_pack18, at object
-	.size	_gprof_pack18,4
-_gprof_pack19:
-	.long	0
-	.type	_gprof_pack19, at object
-	.size	_gprof_pack19,4
-_gprof_pack20:
-	.long	0
-	.type	_gprof_pack20, at object
-	.size	_gprof_pack20,4
-	.section .rodata.str1.4, "aMS", at progbits,1
-	.align 4
-	.align 4
-_2__STRING.0.0:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.0.0, at object
-	.size	_2__STRING.0.0,5
-	.space 3	# pad
-_2__STRING.1.0:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.1.0, at object
-	.size	_2__STRING.1.0,17
-	.data
-	.section .note.GNU-stack, ""
-// -- Begin DWARF2 SEGMENT .debug_info
-	.section .debug_info
-.debug_info_seg:
-	.align 1
-// -- Begin DWARF2 SEGMENT .debug_abbrev
-	.section .debug_abbrev
-.debug_abbrev_seg:
-	.align 1
-	.section .text
-.LNDBG_TXe:
-# End
diff --git a/libs/search/nucstrstr-icc-i386-rel.pic.s b/libs/search/nucstrstr-icc-i386-rel.pic.s
deleted file mode 100644
index fad8b32..0000000
--- a/libs/search/nucstrstr-icc-i386-rel.pic.s
+++ /dev/null
@@ -1,6711 +0,0 @@
-# -- Machine type PW
-# mark_description "Intel(R) C++ Compiler for applications running on IA-32, Version 10.1    Build 20081024 %s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -I/";
-# mark_description "home/yaschenk/devel/internal/asm-trace/inc/gcc/i386 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I/hom";
-# mark_description "e/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home/rod";
-# mark_description "armer/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -O3 -unroll -xW -DNDEBUG -DLINUX -DUNIX -D";
-# mark_description "_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.file "nucstrstr.c"
-	.text
-..TXTST0:
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1: 36 + %esp
-# parameter 2: 40 + %esp
-# parameter 3: 44 + %esp
-# parameter 4: 48 + %esp
-# parameter 5: 52 + %esp
-..B1.1:                         # Preds ..B1.0
-        pushl     %edi                                          #5217.1
-        pushl     %esi                                          #5217.1
-        pushl     %ebx                                          #5217.1
-        subl      $20, %esp                                     #5217.1
-        movl      36(%esp), %esi                                #5215.5
-        movl      40(%esp), %edx                                #5215.5
-        movl      44(%esp), %ecx                                #5215.5
-        movl      48(%esp), %edi                                #5215.5
-                                # LOE edx ecx ebp esi edi
-..B1.2:                         # Preds ..B1.1
-        testl     %esi, %esi                                    #5218.18
-        je        ..B1.108      # Prob 6%                       #5218.18
-                                # LOE edx ecx ebp esi edi
-..B1.3:                         # Preds ..B1.2
-        testl     %edx, %edx                                    #5218.37
-        je        ..B1.108      # Prob 6%                       #5218.37
-                                # LOE edx ecx ebp esi edi
-..B1.4:                         # Preds ..B1.3
-        call      ..L1          # Prob 100%                     #
-..L1:                                                           #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L1], %ebx       #
-                                # LOE edx ecx ebx ebp esi edi
-..B1.5:                         # Preds ..B1.15 ..B1.18 ..B1.4
-        testl     %edi, %edi                                    #5218.52
-        je        ..B1.108      # Prob 28%                      #5218.52
-                                # LOE edx ecx ebx ebp esi edi
-..B1.7:                         # Preds ..B1.5
-        movl      %ebp, 16(%esp)                                #
-        movl      %ecx, %ebp                                    #
-                                # LOE edx ebx ebp esi edi
-..B1.8:                         # Preds ..B1.32 ..B1.7
-        movl      (%esi), %eax                                  #5223.18
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B1.33       # Prob 50%                      #5223.9
-                                # LOE eax ebx ebp esi edi
-..B1.9:                         # Preds ..B1.8
-        movl      ..1..TPKT.30_0.0.0 at GOTOFF(%ebx,%eax,4), %eax  #5223.9
-        jmp       *%eax                                         #5223.9
-                                # LOE ebx ebp esi edi
-..1.30_0.TAG.0c.0.0:
-..B1.10:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebx ebp esi edi
-..B1.11:                        # Preds ..B1.10
-        movl      4(%esi), %eax                                 #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B1.21       # Prob 20%                      #5286.22
-                                # LOE eax edx ecx ebx ebp esi edi
-..B1.12:                        # Preds ..B1.11
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B1.21       # Prob 25%                      #5286.22
-                                # LOE eax edx ecx ebx ebp esi edi
-..B1.13:                        # Preds ..B1.12
-        cmpl      $14, %eax                                     #5286.22
-        jne       ..B1.16       # Prob 67%                      #5286.22
-                                # LOE eax edx ecx ebx ebp esi edi
-..B1.14:                        # Preds ..B1.13
-        movl      8(%esi), %esi                                 #5297.29
-        movl      4(%esi), %eax                                 #5297.29
-        cmpl      %edi, %eax                                    #5298.34
-        ja        ..B1.108      # Prob 5%                       #5298.34
-                                # LOE eax edx ecx ebx ebp esi
-..B1.15:                        # Preds ..B1.14
-        movl      %eax, %edi                                    #5297.17
-        testl     %esi, %esi                                    #5218.18
-        jne       ..B1.5        # Prob 94%                      #5218.18
-        jmp       ..B1.108      # Prob 100%                     #5218.18
-                                # LOE edx ecx ebx ebp esi edi
-..B1.16:                        # Preds ..B1.13
-        cmpl      $15, %eax                                     #5286.22
-        jne       ..B1.108      # Prob 50%                      #5286.22
-                                # LOE edx ecx ebx ebp esi edi
-..B1.17:                        # Preds ..B1.16
-        movl      8(%esi), %esi                                 #5302.29
-        movl      4(%esi), %eax                                 #5302.29
-        cmpl      %edi, %eax                                    #5303.34
-        ja        ..B1.108      # Prob 5%                       #5303.34
-                                # LOE eax edx ecx ebx ebp esi edi
-..B1.18:                        # Preds ..B1.17
-        addl      %edi, %ecx                                    #5306.27
-        subl      %eax, %ecx                                    #5306.33
-        movl      %eax, %edi                                    #5302.17
-        testl     %esi, %esi                                    #5218.18
-        jne       ..B1.5        # Prob 94%                      #5218.18
-        jmp       ..B1.108      # Prob 100%                     #5218.18
-                                # LOE edx ecx ebx ebp esi edi
-..B1.21:                        # Preds ..B1.11 ..B1.12
-        movl      52(%esp), %eax                                #5217.1
-        pushl     %eax                                          #5217.1
-        pushl     %edi                                          #5217.1
-        pushl     %ecx                                          #5217.1
-        pushl     %edx                                          #5217.1
-        pushl     8(%esi)                                       #5217.1
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE eax ebp esi
-..B1.118:                       # Preds ..B1.21
-        addl      $20, %esp                                     #5290.25
-                                # LOE eax ebp esi
-..B1.22:                        # Preds ..B1.118
-        movl      4(%esi), %edx                                 #5291.22
-        testl     %edx, %edx                                    #5291.42
-        je        ..B1.57       # Prob 28%                      #5291.42
-                                # LOE eax ebp
-..B1.23:                        # Preds ..B1.22
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B1.108      # Prob 72%                      #5293.31
-                                # LOE ebp
-..B1.24:                        # Preds ..B1.23
-        movl      $1, %eax                                      #5294.28
-        addl      $20, %esp                                     #5294.28
-        popl      %ebx                                          #5294.28
-        popl      %esi                                          #5294.28
-        popl      %edi                                          #5294.28
-        ret                                                     #5294.28
-                                # LOE
-..1.30_0.TAG.0b.0.0:
-..B1.27:                        # Preds ..B1.9
-        movl      52(%esp), %eax                                #5217.1
-        pushl     %eax                                          #5217.1
-        pushl     %edi                                          #5217.1
-        pushl     %ebp                                          #5217.1
-        movl      52(%esp), %edx                                #5217.1
-        pushl     %edx                                          #5217.1
-        pushl     8(%esi)                                       #5217.1
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE eax ebx ebp esi edi
-..B1.119:                       # Preds ..B1.27
-        addl      $20, %esp                                     #5272.21
-                                # LOE eax ebx ebp esi edi
-..B1.28:                        # Preds ..B1.119
-        movl      4(%esi), %edx                                 #5273.22
-        cmpl      $17, %edx                                     #5273.22
-        jne       ..B1.30       # Prob 67%                      #5273.22
-                                # LOE eax edx ebx ebp esi edi
-..B1.29:                        # Preds ..B1.28
-        testl     %eax, %eax                                    #5276.31
-        jne       ..B1.112      # Prob 5%                       #5276.31
-        jmp       ..B1.32       # Prob 100%                     #5276.31
-                                # LOE eax ebx ebp esi edi
-..B1.30:                        # Preds ..B1.28
-        cmpl      $16, %edx                                     #5273.22
-        jne       ..B1.32       # Prob 50%                      #5273.22
-                                # LOE eax ebx ebp esi edi
-..B1.31:                        # Preds ..B1.30
-        testl     %eax, %eax                                    #5280.31
-        je        ..B1.112      # Prob 5%                       #5280.31
-                                # LOE eax ebx ebp esi edi
-..B1.32:                        # Preds ..B1.29 ..B1.31 ..B1.30
-        movl      12(%esi), %esi                                #5284.38
-        testl     %esi, %esi                                    #5218.18
-        jne       ..B1.8        # Prob 94%                      #5218.18
-                                # LOE ebx ebp esi edi
-..B1.33:                        # Preds ..B1.8 ..B1.32
-        movl      16(%esp), %ebp                                #
-        jmp       ..B1.108      # Prob 100%                     #
-                                # LOE ebp
-..1.30_0.TAG.0a.0.0:
-..B1.34:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.35:                        # Preds ..B1.34
-        movl      4(%esi), %eax                                 #5268.24
-        cmpl      %eax, %edi                                    #5268.24
-        jb        ..B1.108      # Prob 28%                      #5268.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.36:                        # Preds ..B1.35
-        movl      52(%esp), %ebx                                #5269.9
-        testl     %ebx, %ebx                                    #5269.9
-        je        ..B1.38       # Prob 12%                      #5269.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.37:                        # Preds ..B1.36
-        movl      52(%esp), %ebx                                #5269.18
-        movl      %eax, (%ebx)                                  #5269.18
-                                # LOE edx ecx ebp esi edi
-..B1.38:                        # Preds ..B1.37 ..B1.36
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5270.20
-        call      eval_4na_pos                                  #5270.20
-                                # LOE eax ebp
-..B1.120:                       # Preds ..B1.38
-        addl      $20, %esp                                     #5270.20
-        popl      %ebx                                          #5270.20
-        popl      %esi                                          #5270.20
-        popl      %edi                                          #5270.20
-        ret                                                     #5270.20
-                                # LOE
-..1.30_0.TAG.09.0.0:
-..B1.40:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.41:                        # Preds ..B1.40
-        movl      4(%esi), %eax                                 #5264.24
-        cmpl      %eax, %edi                                    #5264.24
-        jb        ..B1.108      # Prob 28%                      #5264.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.42:                        # Preds ..B1.41
-        movl      52(%esp), %ebx                                #5265.9
-        testl     %ebx, %ebx                                    #5265.9
-        je        ..B1.44       # Prob 12%                      #5265.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.43:                        # Preds ..B1.42
-        movl      52(%esp), %ebx                                #5265.18
-        movl      %eax, (%ebx)                                  #5265.18
-                                # LOE edx ecx ebp esi edi
-..B1.44:                        # Preds ..B1.43 ..B1.42
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5266.20
-        call      eval_2na_pos                                  #5266.20
-                                # LOE eax ebp
-..B1.121:                       # Preds ..B1.44
-        addl      $20, %esp                                     #5266.20
-        popl      %ebx                                          #5266.20
-        popl      %esi                                          #5266.20
-        popl      %edi                                          #5266.20
-        ret                                                     #5266.20
-                                # LOE
-..1.30_0.TAG.08.0.0:
-..B1.46:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.47:                        # Preds ..B1.46
-        movl      4(%esi), %eax                                 #5259.24
-        cmpl      %eax, %edi                                    #5259.24
-        jb        ..B1.108      # Prob 28%                      #5259.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.48:                        # Preds ..B1.47
-        movl      52(%esp), %ebx                                #5260.9
-        testl     %ebx, %ebx                                    #5260.9
-        je        ..B1.50       # Prob 12%                      #5260.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.49:                        # Preds ..B1.48
-        movl      52(%esp), %ebx                                #5260.18
-        movl      %eax, (%ebx)                                  #5260.18
-                                # LOE edx ecx ebp esi edi
-..B1.50:                        # Preds ..B1.49 ..B1.48
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5261.20
-        call      eval_4na_128                                  #5261.20
-                                # LOE eax ebp
-..B1.122:                       # Preds ..B1.50
-        addl      $20, %esp                                     #5261.20
-        popl      %ebx                                          #5261.20
-        popl      %esi                                          #5261.20
-        popl      %edi                                          #5261.20
-        ret                                                     #5261.20
-                                # LOE
-..1.30_0.TAG.07.0.0:
-..B1.52:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.53:                        # Preds ..B1.52
-        movl      4(%esi), %eax                                 #5255.24
-        cmpl      %eax, %edi                                    #5255.24
-        jb        ..B1.108      # Prob 28%                      #5255.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.54:                        # Preds ..B1.53
-        movl      52(%esp), %ebx                                #5256.9
-        testl     %ebx, %ebx                                    #5256.9
-        je        ..B1.56       # Prob 12%                      #5256.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.55:                        # Preds ..B1.54
-        movl      52(%esp), %ebx                                #5256.18
-        movl      %eax, (%ebx)                                  #5256.18
-                                # LOE edx ecx ebp esi edi
-..B1.56:                        # Preds ..B1.55 ..B1.54
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5257.20
-        call      eval_4na_32                                   #5257.20
-                                # LOE eax ebp
-..B1.57:                        # Preds ..B1.22 ..B1.56
-        addl      $20, %esp                                     #5257.20
-        popl      %ebx                                          #5257.20
-        popl      %esi                                          #5257.20
-        popl      %edi                                          #5257.20
-        ret                                                     #5257.20
-                                # LOE
-..1.30_0.TAG.06.0.0:
-..B1.59:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.60:                        # Preds ..B1.59
-        movl      4(%esi), %eax                                 #5251.24
-        cmpl      %eax, %edi                                    #5251.24
-        jb        ..B1.108      # Prob 28%                      #5251.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.61:                        # Preds ..B1.60
-        movl      52(%esp), %ebx                                #5252.9
-        testl     %ebx, %ebx                                    #5252.9
-        je        ..B1.63       # Prob 12%                      #5252.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.62:                        # Preds ..B1.61
-        movl      52(%esp), %ebx                                #5252.18
-        movl      %eax, (%ebx)                                  #5252.18
-                                # LOE edx ecx ebp esi edi
-..B1.63:                        # Preds ..B1.62 ..B1.61
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5253.20
-        call      eval_4na_16                                   #5253.20
-                                # LOE eax ebp
-..B1.64:                        # Preds ..B1.63
-        addl      $20, %esp                                     #5253.20
-        popl      %ebx                                          #5253.20
-        popl      %esi                                          #5253.20
-        popl      %edi                                          #5253.20
-        ret                                                     #5253.20
-                                # LOE
-..1.30_0.TAG.05.0.0:
-..B1.66:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.67:                        # Preds ..B1.66
-        movl      4(%esi), %eax                                 #5247.24
-        cmpl      %eax, %edi                                    #5247.24
-        jb        ..B1.108      # Prob 28%                      #5247.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.68:                        # Preds ..B1.67
-        movl      52(%esp), %ebx                                #5248.9
-        testl     %ebx, %ebx                                    #5248.9
-        je        ..B1.70       # Prob 12%                      #5248.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.69:                        # Preds ..B1.68
-        movl      52(%esp), %ebx                                #5248.18
-        movl      %eax, (%ebx)                                  #5248.18
-                                # LOE edx ecx ebp esi edi
-..B1.70:                        # Preds ..B1.69 ..B1.68
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5249.20
-        call      eval_2na_128                                  #5249.20
-                                # LOE eax ebp
-..B1.125:                       # Preds ..B1.70
-        addl      $20, %esp                                     #5249.20
-        popl      %ebx                                          #5249.20
-        popl      %esi                                          #5249.20
-        popl      %edi                                          #5249.20
-        ret                                                     #5249.20
-                                # LOE
-..1.30_0.TAG.04.0.0:
-..B1.72:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.73:                        # Preds ..B1.72
-        movl      4(%esi), %eax                                 #5243.24
-        cmpl      %eax, %edi                                    #5243.24
-        jb        ..B1.108      # Prob 28%                      #5243.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.74:                        # Preds ..B1.73
-        movl      52(%esp), %ebx                                #5244.9
-        testl     %ebx, %ebx                                    #5244.9
-        je        ..B1.76       # Prob 12%                      #5244.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.75:                        # Preds ..B1.74
-        movl      52(%esp), %ebx                                #5244.18
-        movl      %eax, (%ebx)                                  #5244.18
-                                # LOE edx ecx ebp esi edi
-..B1.76:                        # Preds ..B1.75 ..B1.74
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5245.20
-        call      eval_2na_32                                   #5245.20
-                                # LOE eax ebp
-..B1.77:                        # Preds ..B1.76
-        addl      $20, %esp                                     #5245.20
-        popl      %ebx                                          #5245.20
-        popl      %esi                                          #5245.20
-        popl      %edi                                          #5245.20
-        ret                                                     #5245.20
-                                # LOE
-..1.30_0.TAG.03.0.0:
-..B1.79:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.80:                        # Preds ..B1.79
-        movl      4(%esi), %eax                                 #5239.24
-        cmpl      %eax, %edi                                    #5239.24
-        jb        ..B1.108      # Prob 28%                      #5239.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.81:                        # Preds ..B1.80
-        movl      52(%esp), %ebx                                #5240.9
-        testl     %ebx, %ebx                                    #5240.9
-        je        ..B1.83       # Prob 12%                      #5240.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.82:                        # Preds ..B1.81
-        movl      52(%esp), %ebx                                #5240.18
-        movl      %eax, (%ebx)                                  #5240.18
-                                # LOE edx ecx ebp esi edi
-..B1.83:                        # Preds ..B1.82 ..B1.81
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5241.20
-        call      eval_2na_16                                   #5241.20
-                                # LOE eax ebp
-..B1.84:                        # Preds ..B1.83
-        addl      $20, %esp                                     #5241.20
-        popl      %ebx                                          #5241.20
-        popl      %esi                                          #5241.20
-        popl      %edi                                          #5241.20
-        ret                                                     #5241.20
-                                # LOE
-..1.30_0.TAG.02.0.0:
-..B1.86:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.87:                        # Preds ..B1.86
-        movl      4(%esi), %eax                                 #5235.24
-        cmpl      %eax, %edi                                    #5235.24
-        jb        ..B1.108      # Prob 28%                      #5235.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.88:                        # Preds ..B1.87
-        movl      52(%esp), %ebx                                #5236.9
-        testl     %ebx, %ebx                                    #5236.9
-        je        ..B1.90       # Prob 12%                      #5236.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.89:                        # Preds ..B1.88
-        movl      52(%esp), %ebx                                #5236.18
-        movl      %eax, (%ebx)                                  #5236.18
-                                # LOE edx ecx ebp esi edi
-..B1.90:                        # Preds ..B1.89 ..B1.88
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5237.20
-        call      eval_2na_8                                    #5237.20
-                                # LOE eax ebp
-..B1.91:                        # Preds ..B1.90
-        addl      $20, %esp                                     #5237.20
-        popl      %ebx                                          #5237.20
-        popl      %esi                                          #5237.20
-        popl      %edi                                          #5237.20
-        ret                                                     #5237.20
-                                # LOE
-..1.30_0.TAG.01.0.0:
-..B1.93:                        # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.94:                        # Preds ..B1.93
-        movl      4(%esi), %eax                                 #5230.24
-        cmpl      %eax, %edi                                    #5230.24
-        jb        ..B1.108      # Prob 28%                      #5230.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.95:                        # Preds ..B1.94
-        movl      52(%esp), %ebx                                #5231.9
-        testl     %ebx, %ebx                                    #5231.9
-        je        ..B1.97       # Prob 12%                      #5231.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.96:                        # Preds ..B1.95
-        movl      52(%esp), %ebx                                #5231.18
-        movl      %eax, (%ebx)                                  #5231.18
-                                # LOE edx ecx ebp esi edi
-..B1.97:                        # Preds ..B1.96 ..B1.95
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5232.20
-        call      eval_4na_64                                   #5232.20
-                                # LOE eax ebp
-..B1.98:                        # Preds ..B1.97
-        addl      $20, %esp                                     #5232.20
-        popl      %ebx                                          #5232.20
-        popl      %esi                                          #5232.20
-        popl      %edi                                          #5232.20
-        ret                                                     #5232.20
-                                # LOE
-..1.30_0.TAG.00.0.0:
-..B1.100:                       # Preds ..B1.9
-        movl      40(%esp), %edx                                #
-        movl      %ebp, %ecx                                    #
-        movl      16(%esp), %ebp                                #
-                                # LOE edx ecx ebp esi edi
-..B1.101:                       # Preds ..B1.100
-        movl      4(%esi), %eax                                 #5226.24
-        cmpl      %eax, %edi                                    #5226.24
-        jb        ..B1.108      # Prob 28%                      #5226.24
-                                # LOE eax edx ecx ebp esi edi
-..B1.102:                       # Preds ..B1.101
-        movl      52(%esp), %ebx                                #5227.9
-        testl     %ebx, %ebx                                    #5227.9
-        je        ..B1.104      # Prob 12%                      #5227.9
-                                # LOE eax edx ecx ebp esi edi
-..B1.103:                       # Preds ..B1.102
-        movl      52(%esp), %ebx                                #5227.18
-        movl      %eax, (%ebx)                                  #5227.18
-                                # LOE edx ecx ebp esi edi
-..B1.104:                       # Preds ..B1.103 ..B1.102
-        movl      %edi, 12(%esp)                                #5218.5
-        movl      %esi, %eax                                    #5228.20
-        call      eval_2na_64                                   #5228.20
-                                # LOE eax ebp
-..B1.105:                       # Preds ..B1.104
-        addl      $20, %esp                                     #5228.20
-        popl      %ebx                                          #5228.20
-        popl      %esi                                          #5228.20
-        popl      %edi                                          #5228.20
-        ret                                                     #5228.20
-                                # LOE
-..B1.108:                       # Preds ..B1.14 ..B1.17 ..B1.18 ..B1.15 ..B1.16
-                                #       ..B1.5 ..B1.101 ..B1.94 ..B1.87 ..B1.80
-                                #       ..B1.73 ..B1.67 ..B1.60 ..B1.53 ..B1.47
-                                #       ..B1.41 ..B1.35 ..B1.33 ..B1.23 ..B1.3
-                                #       ..B1.2
-        xorl      %eax, %eax                                    #5311.12
-        addl      $20, %esp                                     #5311.12
-        popl      %ebx                                          #5311.12
-        popl      %esi                                          #5311.12
-        popl      %edi                                          #5311.12
-        ret                                                     #5311.12
-                                # LOE
-..B1.112:                       # Preds ..B1.29 ..B1.31         # Infreq
-        movl      16(%esp), %ebp                                #
-        addl      $20, %esp                                     #5281.28
-        popl      %ebx                                          #5281.28
-        popl      %esi                                          #5281.28
-        popl      %edi                                          #5281.28
-        ret                                                     #5281.28
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-	.section .data1, "wa"
-	.align 4
-	.align 4
-..1..TPKT.30_0.0.0:
-	.long	..1.30_0.TAG.00.0.0
-	.long	..1.30_0.TAG.01.0.0
-	.long	..1.30_0.TAG.02.0.0
-	.long	..1.30_0.TAG.03.0.0
-	.long	..1.30_0.TAG.04.0.0
-	.long	..1.30_0.TAG.05.0.0
-	.long	..1.30_0.TAG.06.0.0
-	.long	..1.30_0.TAG.07.0.0
-	.long	..1.30_0.TAG.08.0.0
-	.long	..1.30_0.TAG.09.0.0
-	.long	..1.30_0.TAG.0a.0.0
-	.long	..1.30_0.TAG.0b.0.0
-	.long	..1.30_0.TAG.0c.0.0
-	.data
-# -- End  NucStrstrSearch
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    2,0x90
-eval_2na_64:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B2.1:                         # Preds ..B2.0
-        pushl     %ebp                                          #3075.1
-        movl      %esp, %ebp                                    #3075.1
-        andl      $-16, %esp                                    #3075.1
-        pushl     %edi                                          #3075.1
-        pushl     %esi                                          #3075.1
-        pushl     %ebx                                          #3075.1
-        subl      $84, %esp                                     #3075.1
-        movl      %ecx, %ebx                                    #3116.49
-        shrl      $2, %ebx                                      #3116.49
-        movl      20(%ebp), %edi                                #3073.5
-        movl      %ebx, 80(%esp)                                #3116.49
-        lea       (%ecx,%edi), %esi                             #3113.5
-        lea       (%edx,%ebx), %ebx                             #3116.30
-        lea       3(%ecx,%edi), %edi                            #3122.50
-        subl      4(%eax), %esi                                 #3119.12
-        movl      %esi, 72(%esp)                                #3119.12
-        movl      80(%esp), %esi                                #3125.14
-        shrl      $2, %edi                                      #3122.57
-        addl      %edx, %edi                                    #3122.30
-        testb     $15, %bl                                      #3125.14
-        jne       ..B2.3        # Prob 50%                      #3125.14
-                                # LOE eax edx ecx ebx esi edi
-..B2.2:                         # Preds ..B2.1
-        movdqa    (%ebx), %xmm0                                 #3125.14
-        movdqa    %xmm0, (%esp)                                 #3125.14
-        jmp       ..B2.4        # Prob 100%                     #3125.14
-                                # LOE eax edx ecx esi edi
-..B2.3:                         # Preds ..B2.1
-        movdqu    (%ebx), %xmm0                                 #3125.14
-        movdqa    %xmm0, (%esp)                                 #3125.14
-                                # LOE eax edx ecx esi edi
-..B2.4:                         # Preds ..B2.2 ..B2.3
-        lea       16(%edx,%esi), %ebx                           #3126.5
-        movl      %ebx, 76(%esp)                                #3126.5
-        cmpl      %edi, %ebx                                    #3131.16
-        jae       ..B2.6        # Prob 12%                      #3131.16
-                                # LOE eax ecx ebx edi bl bh
-..B2.5:                         # Preds ..B2.4
-        movzbl    -1(%ebx), %edx                                #3132.24
-        shll      $8, %edx                                      #3132.38
-        jmp       ..B2.7        # Prob 100%                     #3132.38
-                                # LOE eax edx ecx ebx edi bl bh
-..B2.6:                         # Preds ..B2.4
-        xorl      %edx, %edx                                    #
-                                # LOE eax edx ecx ebx edi bl bh
-..B2.7:                         # Preds ..B2.5 ..B2.6
-        movdqa    16(%eax), %xmm7                               #3136.5
-        movdqa    32(%eax), %xmm6                               #3136.5
-        movdqa    48(%eax), %xmm5                               #3136.5
-        movdqa    64(%eax), %xmm4                               #3136.5
-        movdqa    80(%eax), %xmm3                               #3136.5
-        movdqa    96(%eax), %xmm0                               #3136.5
-        movdqa    112(%eax), %xmm2                              #3136.5
-        movdqa    128(%eax), %xmm1                              #3136.5
-        movl      %ecx, %eax                                    #3148.20
-        andl      $3, %eax                                      #3148.20
-        je        ..B2.43       # Prob 20%                      #3148.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.8:                         # Preds ..B2.7
-        cmpl      $1, %eax                                      #3148.20
-        je        ..B2.14       # Prob 25%                      #3148.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.9:                         # Preds ..B2.8
-        cmpl      $2, %eax                                      #3148.20
-        je        ..B2.13       # Prob 33%                      #3148.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.10:                        # Preds ..B2.9
-        cmpl      $3, %eax                                      #3148.20
-        je        ..B2.12       # Prob 50%                      #3148.20
-                                # LOE edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B2.11:                        # Preds ..B2.10
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      %edi, 64(%esp)                                #
-        jmp       ..B2.35       # Prob 100%                     #
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.12:                        # Preds ..B2.10
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 24(%esp)                                #
-        xorl      %esi, %esi                                    #
-        movl      %esi, 28(%esp)                                #
-        movl      %eax, 80(%esp)                                #
-        movl      $8, %esi                                      #
-        jmp       ..B2.17       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.13:                        # Preds ..B2.9
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 28(%esp)                                #
-        movl      %eax, 80(%esp)                                #
-        movl      $8, %esi                                      #
-        jmp       ..B2.16       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.14:                        # Preds ..B2.8
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 80(%esp)                                #
-        movl      $8, %esi                                      #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.15:                        # Preds ..B2.14 ..B2.39
-        movdqa    %xmm0, %xmm7                                  #3171.22
-        pand      %xmm4, %xmm7                                  #3171.22
-        pcmpeqd   %xmm5, %xmm7                                  #3172.22
-        pmovmskb  %xmm7, %eax                                   #3173.22
-        movl      %eax, %edi                                    #3174.17
-        andl      $3855, %edi                                   #3174.17
-        shll      $4, %edi                                      #3174.17
-        andl      %edi, %eax                                    #3174.17
-        movl      %eax, %edi                                    #3174.17
-        sarl      $4, %edi                                      #3174.17
-        orl       %edi, %eax                                    #3174.17
-        movl      %eax, 28(%esp)                                #3174.17
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.16:                        # Preds ..B2.13 ..B2.15
-        movdqa    %xmm0, %xmm7                                  #3177.22
-        pand      32(%esp), %xmm7                               #3177.22
-        pcmpeqd   %xmm3, %xmm7                                  #3178.22
-        pmovmskb  %xmm7, %eax                                   #3179.22
-        movl      %eax, %edi                                    #3180.17
-        andl      $3855, %edi                                   #3180.17
-        shll      $4, %edi                                      #3180.17
-        andl      %edi, %eax                                    #3180.17
-        movl      %eax, %edi                                    #3180.17
-        sarl      $4, %edi                                      #3180.17
-        orl       %edi, %eax                                    #3180.17
-        movl      %eax, 24(%esp)                                #3180.17
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.17:                        # Preds ..B2.12 ..B2.16
-        movdqa    %xmm0, %xmm7                                  #3183.22
-        pand      %xmm1, %xmm7                                  #3183.22
-        pcmpeqd   %xmm2, %xmm7                                  #3184.22
-        pmovmskb  %xmm7, %eax                                   #3185.22
-        movl      %eax, %edi                                    #3186.17
-        andl      $3855, %edi                                   #3186.17
-        shll      $4, %edi                                      #3186.17
-        andl      %edi, %eax                                    #3186.17
-        movl      %eax, %edi                                    #3186.17
-        sarl      $4, %edi                                      #3186.17
-        orl       %edi, %eax                                    #3186.17
-        movl      %eax, 68(%esp)                                #3186.17
-        movl      %ecx, %edi                                    #3190.17
-        movl      80(%esp), %ecx                                #3193.29
-        andl      $-4, %edi                                     #3190.17
-        orl       28(%esp), %ecx                                #3193.29
-        orl       24(%esp), %ecx                                #3193.34
-        orl       %eax, %ecx                                    #3193.39
-        je        ..B2.26       # Prob 78%                      #3193.47
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.18:                        # Preds ..B2.17
-        movl      %ebx, 16(%esp)                                #
-        movl      80(%esp), %ebx                                #3211.58
-        movl      %edx, 20(%esp)                                #
-        movzwl    %bx, %eax                                     #3211.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3211.30
-        movswl    %ax, %eax                                     #3211.30
-        movl      %eax, (%esp)                                  #3211.30
-        movl      28(%esp), %eax                                #3212.58
-        movzwl    %ax, %eax                                     #3212.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3212.30
-        movswl    %ax, %edx                                     #3212.30
-        lea       1(,%edx,4), %edx                              #3220.40
-        movl      24(%esp), %eax                                #3213.58
-        movzwl    %ax, %eax                                     #3213.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3213.30
-        movswl    %ax, %ecx                                     #3213.30
-        movl      68(%esp), %eax                                #3214.58
-        movzwl    %ax, %eax                                     #3214.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3214.30
-        movl      %edx, 4(%esp)                                 #3220.40
-        movswl    %ax, %eax                                     #3214.30
-        lea       2(,%ecx,4), %edx                              #3221.40
-        movl      %edx, 8(%esp)                                 #3221.40
-        movl      20(%esp), %edx                                #3226.32
-        lea       3(,%eax,4), %eax                              #3222.40
-        testl     %ebx, %ebx                                    #3226.32
-        movl      16(%esp), %ebx                                #3226.32
-        movl      %eax, 12(%esp)                                #3222.40
-        je        ..B2.20       # Prob 50%                      #3226.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.19:                        # Preds ..B2.18
-        movl      (%esp), %eax                                  #3226.43
-        movl      72(%esp), %ecx                                #3226.49
-        lea       (%edi,%eax,4), %eax                           #3226.43
-        cmpl      %eax, %ecx                                    #3226.49
-        jae       ..B2.44       # Prob 1%                       #3226.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.20:                        # Preds ..B2.19 ..B2.18
-        movl      28(%esp), %eax                                #3227.32
-        testl     %eax, %eax                                    #3227.32
-        je        ..B2.22       # Prob 50%                      #3227.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.21:                        # Preds ..B2.20
-        movl      4(%esp), %ecx                                 #3227.43
-        movl      72(%esp), %eax                                #3227.49
-        addl      %edi, %ecx                                    #3227.43
-        cmpl      %ecx, %eax                                    #3227.49
-        jae       ..B2.44       # Prob 1%                       #3227.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.22:                        # Preds ..B2.21 ..B2.20
-        movl      24(%esp), %eax                                #3228.32
-        testl     %eax, %eax                                    #3228.32
-        je        ..B2.24       # Prob 50%                      #3228.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.23:                        # Preds ..B2.22
-        movl      8(%esp), %ecx                                 #3228.43
-        movl      72(%esp), %eax                                #3228.49
-        addl      %edi, %ecx                                    #3228.43
-        cmpl      %ecx, %eax                                    #3228.49
-        jae       ..B2.44       # Prob 1%                       #3228.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.24:                        # Preds ..B2.23 ..B2.22
-        movl      68(%esp), %eax                                #3229.32
-        testl     %eax, %eax                                    #3229.32
-        je        ..B2.26       # Prob 50%                      #3229.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.25:                        # Preds ..B2.24
-        movl      12(%esp), %ecx                                #3229.43
-        movl      72(%esp), %eax                                #3229.49
-        addl      %edi, %ecx                                    #3229.43
-        cmpl      %ecx, %eax                                    #3229.49
-        jae       ..B2.44       # Prob 1%                       #3229.49
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.26:                        # Preds ..B2.25 ..B2.24 ..B2.17
-        movl      72(%esp), %eax                                #3237.28
-        lea       4(%edi), %ecx                                 #3234.17
-        cmpl      %eax, %ecx                                    #3237.28
-        ja        ..B2.41       # Prob 1%                       #3237.28
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.27:                        # Preds ..B2.26
-        addl      $-1, %esi                                     #3241.25
-        jne       ..B2.36       # Prob 50%                      #3241.39
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.28:                        # Preds ..B2.27
-        movl      64(%esp), %eax                                #3262.25
-        cmpl      %eax, %ebx                                    #3262.25
-        jae       ..B2.41       # Prob 1%                       #3262.25
-                                # LOE edx ebx edi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.29:                        # Preds ..B2.28
-        movl      72(%esp), %eax                                #3267.24
-        lea       36(%edi), %ecx                                #3266.13
-        cmpl      %eax, %ecx                                    #3267.24
-        ja        ..B2.41       # Prob 1%                       #3267.24
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.30:                        # Preds ..B2.29
-        testb     $15, %bl                                      #3272.22
-        jne       ..B2.32       # Prob 50%                      #3272.22
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.31:                        # Preds ..B2.30
-        movdqa    (%ebx), %xmm0                                 #3272.22
-        jmp       ..B2.33       # Prob 100%                     #3272.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.32:                        # Preds ..B2.30
-        movdqu    (%ebx), %xmm0                                 #3272.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.33:                        # Preds ..B2.31 ..B2.32
-        movl      64(%esp), %eax                                #3353.24
-        addl      $16, %ebx                                     #3350.13
-        movl      %ebx, 76(%esp)                                #3350.13
-        cmpl      %eax, %ebx                                    #3353.24
-        jae       ..B2.35       # Prob 12%                      #3353.24
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.34:                        # Preds ..B2.33
-        movzbl    -1(%ebx), %edx                                #3354.32
-        shll      $8, %edx                                      #3354.46
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.35:                        # Preds ..B2.33 ..B2.11 ..B2.34
-        movl      $8, %esi                                      #3155.13
-        jmp       ..B2.39       # Prob 100%                     #3155.13
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.36:                        # Preds ..B2.27
-        movl      76(%esp), %eax                                #3249.26
-        movl      64(%esp), %edi                                #3249.26
-        psrldq    $1, %xmm0                                     #3246.26
-        cmpl      %edi, %eax                                    #3249.26
-        jae       ..B2.38       # Prob 19%                      #3249.26
-                                # LOE eax edx ecx ebx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.37:                        # Preds ..B2.36
-        movzbl    (%eax), %edi                                  #3252.37
-        sarl      $8, %edx                                      #3251.21
-        shll      $8, %edi                                      #3252.48
-        orl       %edi, %edx                                    #3252.21
-        pinsrw    $7, %edx, %xmm0                               #3253.30
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.38:                        # Preds ..B2.37 ..B2.36
-        addl      $1, 76(%esp)                                  #3257.20
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.39:                        # Preds ..B2.35 ..B2.38 ..B2.43
-        movdqa    %xmm0, %xmm7                                  #3165.22
-        pand      %xmm6, %xmm7                                  #3165.22
-        pcmpeqd   48(%esp), %xmm7                               #3166.22
-        pmovmskb  %xmm7, %eax                                   #3167.22
-        movl      %eax, %edi                                    #3168.17
-        andl      $3855, %edi                                   #3168.17
-        shll      $4, %edi                                      #3168.17
-        andl      %edi, %eax                                    #3168.17
-        movl      %eax, %edi                                    #3168.17
-        sarl      $4, %edi                                      #3168.17
-        orl       %edi, %eax                                    #3168.17
-        movl      %eax, 80(%esp)                                #3168.17
-        jmp       ..B2.15       # Prob 100%                     #3168.17
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.41:                        # Preds ..B2.26 ..B2.28 ..B2.29 # Infreq
-        xorl      %eax, %eax                                    #3363.12
-        addl      $84, %esp                                     #3363.12
-        popl      %ebx                                          #3363.12
-        popl      %esi                                          #3363.12
-        popl      %edi                                          #3363.12
-        movl      %ebp, %esp                                    #3363.12
-        popl      %ebp                                          #3363.12
-        ret                                                     #3363.12
-                                # LOE
-..B2.43:                        # Preds ..B2.7                  # Infreq
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      %edi, 64(%esp)                                #
-        movl      $8, %esi                                      #
-        jmp       ..B2.39       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B2.44:                        # Preds ..B2.21 ..B2.19 ..B2.25 ..B2.23 # Infreq
-        movl      $1, %eax                                      #3228.63
-        addl      $84, %esp                                     #3228.63
-        popl      %ebx                                          #3228.63
-        popl      %esi                                          #3228.63
-        popl      %edi                                          #3228.63
-        movl      %ebp, %esp                                    #3228.63
-        popl      %ebp                                          #3228.63
-        ret                                                     #3228.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-	.data
-# -- End  eval_2na_64
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    2,0x90
-eval_4na_64:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B3.1:                         # Preds ..B3.0
-        pushl     %ebp                                          #4501.1
-        movl      %esp, %ebp                                    #4501.1
-        andl      $-16, %esp                                    #4501.1
-        pushl     %edi                                          #4501.1
-        pushl     %esi                                          #4501.1
-        pushl     %ebx                                          #4501.1
-        subl      $132, %esp                                    #4501.1
-        movdqa    16(%eax), %xmm5                               #4554.5
-        movdqa    32(%eax), %xmm6                               #4554.5
-        movl      20(%ebp), %ebx                                #4499.5
-        movdqa    48(%eax), %xmm4                               #4554.5
-        movdqa    64(%eax), %xmm3                               #4554.5
-        movdqa    80(%eax), %xmm2                               #4554.5
-        movdqa    96(%eax), %xmm1                               #4554.5
-        movdqa    128(%eax), %xmm7                              #4554.5
-        movl      %ecx, %edi                                    #4538.49
-        shrl      $2, %edi                                      #4538.49
-        call      ..L2          # Prob 100%                     #4501.1
-..L2:                                                           #
-        popl      %esi                                          #4501.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L2], %esi       #4501.1
-        movl      %esi, 32(%esp)                                #4501.1
-        lea       (%ecx,%ebx), %esi                             #4535.5
-        lea       3(%ecx,%ebx), %ebx                            #4544.50
-        shrl      $2, %ebx                                      #4544.57
-        subl      4(%eax), %esi                                 #4541.12
-        movl      %esi, 112(%esp)                               #4541.12
-        movzbl    (%edi,%edx), %esi                             #4547.14
-        addl      %edx, %ebx                                    #4544.30
-        movl      %ebx, 116(%esp)                               #4544.30
-        movl      32(%esp), %ebx                                #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, (%esp)                                   #4547.14
-        movzbl    1(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 2(%esp)                                  #4547.14
-        movzbl    2(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 4(%esp)                                  #4547.14
-        movzbl    3(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 6(%esp)                                  #4547.14
-        movzbl    4(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 8(%esp)                                  #4547.14
-        movzbl    5(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 10(%esp)                                 #4547.14
-        movzbl    6(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 12(%esp)                                 #4547.14
-        movzbl    7(%edi,%edx), %esi                            #4547.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4547.14
-        movw      %si, 14(%esp)                                 #4547.14
-        movdqu    (%esp), %xmm0                                 #4547.14
-        lea       8(%edx,%edi), %esi                            #4548.5
-        movdqa    %xmm0, 16(%esp)                               #4547.14
-        movdqa    112(%eax), %xmm0                              #4554.5
-        movl      %esi, %edx                                    #4548.5
-        movl      %ecx, %eax                                    #4568.20
-        andl      $3, %eax                                      #4568.20
-        je        ..B3.33       # Prob 20%                      #4568.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.2:                         # Preds ..B3.1
-        cmpl      $1, %eax                                      #4568.20
-        je        ..B3.8        # Prob 25%                      #4568.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.3:                         # Preds ..B3.2
-        cmpl      $2, %eax                                      #4568.20
-        je        ..B3.7        # Prob 33%                      #4568.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.4:                         # Preds ..B3.3
-        cmpl      $3, %eax                                      #4568.20
-        je        ..B3.6        # Prob 50%                      #4568.20
-                                # LOE edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B3.5:                         # Preds ..B3.4
-        movdqa    %xmm7, 80(%esp)                               #
-        movdqa    %xmm0, 48(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movl      %ecx, 96(%esp)                                #
-        jmp       ..B3.25       # Prob 100%                     #
-                                # LOE edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.6:                         # Preds ..B3.4
-        movdqa    %xmm7, 80(%esp)                               #
-        movdqa    %xmm0, 48(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 40(%esp)                                #
-        movl      %ecx, 96(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      $4, %eax                                      #
-        movl      %edi, 44(%esp)                                #
-        movl      %edi, 100(%esp)                               #
-        jmp       ..B3.11       # Prob 100%                     #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.7:                         # Preds ..B3.3
-        movdqa    %xmm7, 80(%esp)                               #
-        movdqa    %xmm0, 48(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 44(%esp)                                #
-        movl      %ecx, 96(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      $4, %eax                                      #
-        movl      %edi, 100(%esp)                               #
-        jmp       ..B3.10       # Prob 100%                     #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.8:                         # Preds ..B3.2
-        movdqa    %xmm7, 80(%esp)                               #
-        movdqa    %xmm0, 48(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %ecx, 96(%esp)                                #
-        movl      %edi, 100(%esp)                               #
-        movl      $4, %eax                                      #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.9:                         # Preds ..B3.8 ..B3.29
-        movdqa    %xmm0, %xmm7                                  #4592.22
-        movdqa    %xmm0, %xmm6                                  #4593.22
-        pand      %xmm4, %xmm7                                  #4592.22
-        pand      %xmm3, %xmm6                                  #4593.22
-        pcmpeqd   %xmm6, %xmm7                                  #4594.22
-        pmovmskb  %xmm7, %ecx                                   #4595.22
-        movl      %ecx, %edi                                    #4596.17
-        andl      $3855, %edi                                   #4596.17
-        shll      $4, %edi                                      #4596.17
-        andl      %edi, %ecx                                    #4596.17
-        movl      %ecx, %edi                                    #4596.17
-        sarl      $4, %edi                                      #4596.17
-        orl       %edi, %ecx                                    #4596.17
-        movl      %ecx, 44(%esp)                                #4596.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.10:                        # Preds ..B3.7 ..B3.9
-        movdqa    %xmm0, %xmm7                                  #4599.22
-        movdqa    %xmm0, %xmm6                                  #4600.22
-        pand      %xmm2, %xmm7                                  #4599.22
-        pand      %xmm1, %xmm6                                  #4600.22
-        pcmpeqd   %xmm6, %xmm7                                  #4601.22
-        pmovmskb  %xmm7, %ecx                                   #4602.22
-        movl      %ecx, %edi                                    #4603.17
-        andl      $3855, %edi                                   #4603.17
-        shll      $4, %edi                                      #4603.17
-        andl      %edi, %ecx                                    #4603.17
-        movl      %ecx, %edi                                    #4603.17
-        sarl      $4, %edi                                      #4603.17
-        orl       %edi, %ecx                                    #4603.17
-        movl      %ecx, 40(%esp)                                #4603.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.11:                        # Preds ..B3.6 ..B3.10
-        movdqa    %xmm0, %xmm7                                  #4606.22
-        movdqa    %xmm0, %xmm6                                  #4607.22
-        pand      48(%esp), %xmm7                               #4606.22
-        pand      80(%esp), %xmm6                               #4607.22
-        pcmpeqd   %xmm6, %xmm7                                  #4608.22
-        pmovmskb  %xmm7, %ecx                                   #4609.22
-        movl      %ecx, %edi                                    #4610.17
-        andl      $3855, %edi                                   #4610.17
-        shll      $4, %edi                                      #4610.17
-        andl      %edi, %ecx                                    #4610.17
-        movl      %ecx, %edi                                    #4610.17
-        sarl      $4, %edi                                      #4610.17
-        orl       %edi, %ecx                                    #4610.17
-        movl      96(%esp), %edi                                #4614.17
-        movl      %ecx, 104(%esp)                               #4610.17
-        andl      $-4, %edi                                     #4614.17
-        movl      %edi, 108(%esp)                               #4614.17
-        movl      100(%esp), %edi                               #4617.29
-        orl       44(%esp), %edi                                #4617.29
-        orl       40(%esp), %edi                                #4617.34
-        orl       %ecx, %edi                                    #4617.39
-        je        ..B3.20       # Prob 78%                      #4617.47
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.12:                        # Preds ..B3.11
-        movl      100(%esp), %edi                               #4635.58
-        movl      %eax, 28(%esp)                                #
-        movl      %esi, 32(%esp)                                #
-        movzwl    %di, %eax                                     #4635.58
-        movl      %edx, 36(%esp)                                #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4635.30
-        movswl    %ax, %eax                                     #4635.30
-        movl      %eax, 16(%esp)                                #4635.30
-        movl      44(%esp), %eax                                #4636.58
-        movzwl    %ax, %eax                                     #4636.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4636.30
-        movswl    %ax, %esi                                     #4636.30
-        movl      40(%esp), %eax                                #4637.58
-        movzwl    %ax, %eax                                     #4637.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4637.30
-        movswl    %ax, %ecx                                     #4637.30
-        movl      104(%esp), %eax                               #4638.58
-        movzwl    %ax, %eax                                     #4638.58
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4638.30
-        movswl    %ax, %edx                                     #4638.30
-        lea       1(%esi,%esi), %eax                            #4644.40
-        movl      32(%esp), %esi                                #4650.32
-        movl      %eax, 20(%esp)                                #4644.40
-        lea       2(%ecx,%ecx), %eax                            #4645.40
-        testl     %edi, %edi                                    #4650.32
-        movl      %eax, 24(%esp)                                #4645.40
-        lea       3(%edx,%edx), %eax                            #4646.40
-        movl      36(%esp), %edx                                #4650.32
-        movl      %eax, 96(%esp)                                #4646.40
-        movl      28(%esp), %eax                                #4650.32
-        je        ..B3.14       # Prob 50%                      #4650.32
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.13:                        # Preds ..B3.12
-        movl      16(%esp), %edi                                #4650.43
-        movl      108(%esp), %ecx                               #4650.43
-        lea       (%ecx,%edi,2), %edi                           #4650.43
-        movl      112(%esp), %ecx                               #4650.49
-        cmpl      %edi, %ecx                                    #4650.49
-        jae       ..B3.34       # Prob 1%                       #4650.49
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.14:                        # Preds ..B3.13 ..B3.12
-        movl      44(%esp), %ecx                                #4651.32
-        testl     %ecx, %ecx                                    #4651.32
-        je        ..B3.16       # Prob 50%                      #4651.32
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.15:                        # Preds ..B3.14
-        movl      20(%esp), %edi                                #4651.43
-        addl      108(%esp), %edi                               #4651.43
-        movl      112(%esp), %ecx                               #4651.49
-        cmpl      %edi, %ecx                                    #4651.49
-        jae       ..B3.34       # Prob 1%                       #4651.49
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.16:                        # Preds ..B3.15 ..B3.14
-        movl      40(%esp), %ecx                                #4652.32
-        testl     %ecx, %ecx                                    #4652.32
-        je        ..B3.18       # Prob 50%                      #4652.32
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.17:                        # Preds ..B3.16
-        movl      24(%esp), %edi                                #4652.43
-        addl      108(%esp), %edi                               #4652.43
-        movl      112(%esp), %ecx                               #4652.49
-        cmpl      %edi, %ecx                                    #4652.49
-        jae       ..B3.34       # Prob 1%                       #4652.49
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.18:                        # Preds ..B3.17 ..B3.16
-        movl      104(%esp), %ecx                               #4653.32
-        testl     %ecx, %ecx                                    #4653.32
-        je        ..B3.20       # Prob 50%                      #4653.32
-                                # LOE eax edx ebx esi al dl ah dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.19:                        # Preds ..B3.18
-        movl      96(%esp), %edi                                #4653.43
-        addl      108(%esp), %edi                               #4653.43
-        movl      112(%esp), %ecx                               #4653.49
-        cmpl      %edi, %ecx                                    #4653.49
-        jae       ..B3.34       # Prob 1%                       #4653.49
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.20:                        # Preds ..B3.19 ..B3.18 ..B3.11
-        movl      108(%esp), %ecx                               #4658.17
-        lea       4(%ecx), %edi                                 #4658.17
-        movl      112(%esp), %ecx                               #4661.28
-        movl      %edi, 96(%esp)                                #4658.17
-        cmpl      %ecx, %edi                                    #4661.28
-        ja        ..B3.31       # Prob 1%                       #4661.28
-                                # LOE eax edx ecx ebx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.21:                        # Preds ..B3.20
-        addl      $-1, %eax                                     #4665.25
-        jne       ..B3.26       # Prob 50%                      #4665.39
-                                # LOE eax edx ecx ebx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.22:                        # Preds ..B3.21
-        movl      116(%esp), %eax                               #4682.25
-        cmpl      %eax, %esi                                    #4682.25
-        jae       ..B3.31       # Prob 1%                       #4682.25
-                                # LOE ecx ebx esi cl ch xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.23:                        # Preds ..B3.22
-        movl      108(%esp), %eax                               #4686.13
-        lea       20(%eax), %edx                                #4686.13
-        movl      %edx, 96(%esp)                                #4686.13
-        cmpl      %ecx, %edx                                    #4687.24
-        ja        ..B3.31       # Prob 1%                       #4687.24
-                                # LOE ebx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.24:                        # Preds ..B3.23
-        movzbl    (%esi), %eax                                  #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %edx        #4692.22
-        movzbl    1(%esi), %ecx                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%ecx,2), %edi        #4692.22
-        movzbl    2(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        movw      %dx, (%esp)                                   #4692.22
-        movw      %di, 2(%esp)                                  #4692.22
-        movw      %ax, 4(%esp)                                  #4692.22
-        movzbl    3(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        movw      %ax, 6(%esp)                                  #4692.22
-        movzbl    4(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        movw      %ax, 8(%esp)                                  #4692.22
-        movzbl    5(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        movw      %ax, 10(%esp)                                 #4692.22
-        movzbl    6(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        movw      %ax, 12(%esp)                                 #4692.22
-        movzbl    7(%esi), %eax                                 #4692.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4692.22
-        addl      $8, %esi                                      #4707.13
-        movl      %esi, %edx                                    #4707.13
-        movw      %ax, 14(%esp)                                 #4692.22
-        movdqu    (%esp), %xmm0                                 #4692.22
-                                # LOE edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.25:                        # Preds ..B3.5 ..B3.24
-        movl      $4, %eax                                      #4575.13
-        jmp       ..B3.29       # Prob 100%                     #4575.13
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.26:                        # Preds ..B3.21
-        movl      116(%esp), %ecx                               #4673.26
-        psrldq    $2, %xmm0                                     #4670.26
-        cmpl      %ecx, %edx                                    #4673.26
-        jae       ..B3.28       # Prob 19%                      #4673.26
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.27:                        # Preds ..B3.26
-        movzbl    (%edx), %ecx                                  #4674.72
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%ecx,2), %edi        #4674.57
-        pinsrw    $7, %edi, %xmm0                               #4674.30
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.28:                        # Preds ..B3.27 ..B3.26
-        addl      $1, %edx                                      #4677.20
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.29:                        # Preds ..B3.25 ..B3.28 ..B3.33
-        movdqa    %xmm0, %xmm7                                  #4585.22
-        movdqa    %xmm0, %xmm6                                  #4586.22
-        pand      64(%esp), %xmm6                               #4586.22
-        pand      %xmm5, %xmm7                                  #4585.22
-        pcmpeqd   %xmm6, %xmm7                                  #4587.22
-        pmovmskb  %xmm7, %ecx                                   #4588.22
-        movl      %ecx, %edi                                    #4589.17
-        andl      $3855, %edi                                   #4589.17
-        shll      $4, %edi                                      #4589.17
-        andl      %edi, %ecx                                    #4589.17
-        movl      %ecx, %edi                                    #4589.17
-        sarl      $4, %edi                                      #4589.17
-        orl       %edi, %ecx                                    #4589.17
-        movl      %ecx, 100(%esp)                               #4589.17
-        jmp       ..B3.9        # Prob 100%                     #4589.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.31:                        # Preds ..B3.20 ..B3.22 ..B3.23 # Infreq
-        xorl      %eax, %eax                                    #4718.12
-        addl      $132, %esp                                    #4718.12
-        popl      %ebx                                          #4718.12
-        popl      %esi                                          #4718.12
-        popl      %edi                                          #4718.12
-        movl      %ebp, %esp                                    #4718.12
-        popl      %ebp                                          #4718.12
-        ret                                                     #4718.12
-                                # LOE
-..B3.33:                        # Preds ..B3.1                  # Infreq
-        movdqa    %xmm7, 80(%esp)                               #
-        movdqa    %xmm0, 48(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movl      $4, %eax                                      #
-        movl      %ecx, 96(%esp)                                #
-        jmp       ..B3.29       # Prob 100%                     #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B3.34:                        # Preds ..B3.13 ..B3.19 ..B3.17 ..B3.15 # Infreq
-        movl      $1, %eax                                      #4651.63
-        addl      $132, %esp                                    #4651.63
-        popl      %ebx                                          #4651.63
-        popl      %esi                                          #4651.63
-        popl      %edi                                          #4651.63
-        movl      %ebp, %esp                                    #4651.63
-        popl      %ebp                                          #4651.63
-        ret                                                     #4651.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-	.data
-# -- End  eval_4na_64
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    2,0x90
-eval_2na_8:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B4.1:                         # Preds ..B4.0
-        pushl     %ebp                                          #2196.1
-        movl      %esp, %ebp                                    #2196.1
-        andl      $-16, %esp                                    #2196.1
-        pushl     %edi                                          #2196.1
-        pushl     %esi                                          #2196.1
-        pushl     %ebx                                          #2196.1
-        subl      $84, %esp                                     #2196.1
-        movl      %ecx, %esi                                    #2236.49
-        shrl      $2, %esi                                      #2236.49
-        movl      20(%ebp), %ebx                                #2194.5
-        movl      %esi, 68(%esp)                                #2236.49
-        lea       (%ecx,%ebx), %edi                             #2233.5
-        lea       (%edx,%esi), %esi                             #2236.30
-        lea       3(%ecx,%ebx), %ebx                            #2242.50
-        subl      4(%eax), %edi                                 #2239.12
-        movl      %edi, 64(%esp)                                #2239.12
-        movl      68(%esp), %edi                                #2245.14
-        shrl      $2, %ebx                                      #2242.57
-        addl      %edx, %ebx                                    #2242.30
-        testl     $15, %esi                                     #2245.14
-        jne       ..B4.3        # Prob 50%                      #2245.14
-                                # LOE eax edx ecx ebx esi edi
-..B4.2:                         # Preds ..B4.1
-        movdqa    (%esi), %xmm0                                 #2245.14
-        movdqa    %xmm0, 48(%esp)                               #2245.14
-        jmp       ..B4.4        # Prob 100%                     #2245.14
-                                # LOE eax edx ecx ebx edi
-..B4.3:                         # Preds ..B4.1
-        movdqu    (%esi), %xmm0                                 #2245.14
-        movdqa    %xmm0, 48(%esp)                               #2245.14
-                                # LOE eax edx ecx ebx edi
-..B4.4:                         # Preds ..B4.2 ..B4.3
-        movdqa    16(%eax), %xmm7                               #2256.5
-        movdqa    32(%eax), %xmm6                               #2256.5
-        movdqa    48(%eax), %xmm5                               #2256.5
-        movdqa    64(%eax), %xmm4                               #2256.5
-        movdqa    80(%eax), %xmm3                               #2256.5
-        movdqa    96(%eax), %xmm2                               #2256.5
-        movdqa    112(%eax), %xmm1                              #2256.5
-        movdqa    128(%eax), %xmm0                              #2256.5
-        lea       16(%edx,%edi), %edi                           #2246.5
-        movl      %ecx, %eax                                    #2268.20
-        andl      $3, %eax                                      #2268.20
-        je        ..B4.8        # Prob 20%                      #2268.20
-                                # LOE eax ecx ebx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B4.5:                         # Preds ..B4.4
-        cmpl      $1, %eax                                      #2268.20
-        je        ..B4.11       # Prob 25%                      #2268.20
-                                # LOE eax ecx ebx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B4.6:                         # Preds ..B4.5
-        cmpl      $2, %eax                                      #2268.20
-        je        ..B4.10       # Prob 33%                      #2268.20
-                                # LOE eax ecx ebx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B4.7:                         # Preds ..B4.6
-        cmpl      $3, %eax                                      #2268.20
-        je        ..B4.9        # Prob 50%                      #2268.20
-                                # LOE ecx ebx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B4.8:                         # Preds ..B4.4 ..B4.7
-        movdqa    %xmm7, 32(%esp)                               #
-        movl      %ebx, 28(%esp)                                #
-        jmp       ..B4.30       # Prob 100%                     #
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.9:                         # Preds ..B4.7
-        movdqa    %xmm7, 32(%esp)                               #
-        movl      %ebx, 28(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 68(%esp)                                #
-        xorl      %edx, %edx                                    #
-        xorl      %esi, %esi                                    #
-        jmp       ..B4.14       # Prob 100%                     #
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.10:                        # Preds ..B4.6
-        movdqa    %xmm7, 32(%esp)                               #
-        movl      %ebx, 28(%esp)                                #
-        xorl      %edx, %edx                                    #
-        xorl      %esi, %esi                                    #
-        jmp       ..B4.13       # Prob 100%                     #
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.11:                        # Preds ..B4.5
-        movdqa    %xmm7, 32(%esp)                               #
-        movl      %ebx, 28(%esp)                                #
-        xorl      %esi, %esi                                    #
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.12:                        # Preds ..B4.11 ..B4.30
-        movdqa    48(%esp), %xmm7                               #2291.22
-        pand      %xmm4, %xmm7                                  #2291.22
-        pcmpeqb   %xmm5, %xmm7                                  #2292.22
-        pmovmskb  %xmm7, %edx                                   #2293.22
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.13:                        # Preds ..B4.10 ..B4.12
-        movdqa    48(%esp), %xmm7                               #2297.22
-        pand      %xmm2, %xmm7                                  #2297.22
-        pcmpeqb   %xmm3, %xmm7                                  #2298.22
-        pmovmskb  %xmm7, %ebx                                   #2299.22
-        movl      %ebx, 68(%esp)                                #2299.22
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.14:                        # Preds ..B4.9 ..B4.13
-        movdqa    48(%esp), %xmm7                               #2303.22
-        pand      %xmm0, %xmm7                                  #2303.22
-        pcmpeqb   %xmm1, %xmm7                                  #2304.22
-        pmovmskb  %xmm7, %ebx                                   #2305.22
-        andl      $-4, %ecx                                     #2310.17
-        movl      %ebx, 24(%esp)                                #2305.22
-        movl      %esi, %eax                                    #2313.29
-        orl       %edx, %eax                                    #2313.29
-        orl       68(%esp), %eax                                #2313.34
-        orl       %ebx, %eax                                    #2313.39
-        je        ..B4.23       # Prob 78%                      #2313.47
-                                # LOE edx ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.15:                        # Preds ..B4.14
-        movl      %ecx, 16(%esp)                                #
-        movl      %esi, %eax                                    #2331.30
-        movl      %edi, 20(%esp)                                #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2331.30
-        movswl    %ax, %ecx                                     #2331.30
-        movl      %ecx, (%esp)                                  #2331.30
-        movl      %edx, %eax                                    #2332.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2332.30
-        movswl    %ax, %edi                                     #2332.30
-        lea       1(,%edi,4), %edi                              #2340.40
-        movl      68(%esp), %eax                                #2333.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2333.30
-        movswl    %ax, %ebx                                     #2333.30
-        movl      24(%esp), %eax                                #2334.30
-        lea       2(,%ebx,4), %ebx                              #2341.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2334.30
-        movl      %edi, 4(%esp)                                 #2340.40
-        movl      20(%esp), %edi                                #2346.32
-        movl      %ebx, 8(%esp)                                 #2341.40
-        movswl    %ax, %ecx                                     #2334.30
-        lea       3(,%ecx,4), %ecx                              #2342.40
-        movl      %ecx, 12(%esp)                                #2342.40
-        movl      16(%esp), %ecx                                #2346.32
-        testl     %esi, %esi                                    #2346.32
-        je        ..B4.17       # Prob 50%                      #2346.32
-                                # LOE edx ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.16:                        # Preds ..B4.15
-        movl      (%esp), %ebx                                  #2346.43
-        movl      64(%esp), %esi                                #2346.49
-        lea       (%ecx,%ebx,4), %ebx                           #2346.43
-        cmpl      %ebx, %esi                                    #2346.49
-        jae       ..B4.34       # Prob 1%                       #2346.49
-                                # LOE edx ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.17:                        # Preds ..B4.16 ..B4.15
-        testl     %edx, %edx                                    #2347.32
-        je        ..B4.19       # Prob 50%                      #2347.32
-                                # LOE ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.18:                        # Preds ..B4.17
-        movl      4(%esp), %edx                                 #2347.43
-        movl      64(%esp), %eax                                #2347.49
-        addl      %ecx, %edx                                    #2347.43
-        cmpl      %edx, %eax                                    #2347.49
-        jae       ..B4.34       # Prob 1%                       #2347.49
-                                # LOE ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.19:                        # Preds ..B4.18 ..B4.17
-        movl      68(%esp), %eax                                #2348.32
-        testl     %eax, %eax                                    #2348.32
-        je        ..B4.21       # Prob 50%                      #2348.32
-                                # LOE ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.20:                        # Preds ..B4.19
-        movl      8(%esp), %edx                                 #2348.43
-        movl      64(%esp), %eax                                #2348.49
-        addl      %ecx, %edx                                    #2348.43
-        cmpl      %edx, %eax                                    #2348.49
-        jae       ..B4.34       # Prob 1%                       #2348.49
-                                # LOE ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.21:                        # Preds ..B4.20 ..B4.19
-        movl      24(%esp), %eax                                #2349.32
-        testl     %eax, %eax                                    #2349.32
-        je        ..B4.23       # Prob 50%                      #2349.32
-                                # LOE ecx edi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.22:                        # Preds ..B4.21
-        movl      12(%esp), %edx                                #2349.43
-        movl      64(%esp), %eax                                #2349.49
-        addl      %ecx, %edx                                    #2349.43
-        cmpl      %edx, %eax                                    #2349.49
-        jae       ..B4.34       # Prob 1%                       #2349.49
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.23:                        # Preds ..B4.22 ..B4.21 ..B4.14
-        movl      64(%esp), %eax                                #2357.28
-        lea       4(%ecx), %edx                                 #2386.13
-        cmpl      %edx, %eax                                    #2357.28
-        jb        ..B4.32       # Prob 1%                       #2357.28
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.24:                        # Preds ..B4.23
-        movl      28(%esp), %eax                                #2382.25
-        cmpl      %eax, %edi                                    #2382.25
-        jae       ..B4.32       # Prob 1%                       #2382.25
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.25:                        # Preds ..B4.24
-        movl      64(%esp), %eax                                #2387.24
-        addl      $64, %ecx                                     #2386.13
-        cmpl      %eax, %ecx                                    #2387.24
-        ja        ..B4.32       # Prob 1%                       #2387.24
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.26:                        # Preds ..B4.25
-        testl     $15, %edi                                     #2392.22
-        jne       ..B4.28       # Prob 50%                      #2392.22
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.27:                        # Preds ..B4.26
-        movdqa    (%edi), %xmm7                                 #2392.22
-        movdqa    %xmm7, 48(%esp)                               #2392.22
-        jmp       ..B4.29       # Prob 100%                     #2392.22
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.28:                        # Preds ..B4.26
-        movdqu    (%edi), %xmm7                                 #2392.22
-        movdqa    %xmm7, 48(%esp)                               #2392.22
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.29:                        # Preds ..B4.27 ..B4.28
-        addl      $16, %edi                                     #2470.13
-                                # LOE ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.30:                        # Preds ..B4.29 ..B4.8
-        movdqa    48(%esp), %xmm7                               #2285.22
-        pand      %xmm6, %xmm7                                  #2285.22
-        pcmpeqb   32(%esp), %xmm7                               #2286.22
-        pmovmskb  %xmm7, %esi                                   #2287.22
-        jmp       ..B4.12       # Prob 100%                     #2287.22
-                                # LOE ecx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B4.32:                        # Preds ..B4.23 ..B4.24 ..B4.25 # Infreq
-        xorl      %eax, %eax                                    #2483.12
-        addl      $84, %esp                                     #2483.12
-        popl      %ebx                                          #2483.12
-        popl      %esi                                          #2483.12
-        popl      %edi                                          #2483.12
-        movl      %ebp, %esp                                    #2483.12
-        popl      %ebp                                          #2483.12
-        ret                                                     #2483.12
-                                # LOE
-..B4.34:                        # Preds ..B4.22 ..B4.20 ..B4.18 ..B4.16 # Infreq
-        movl      $1, %eax                                      #2346.63
-        addl      $84, %esp                                     #2346.63
-        popl      %ebx                                          #2346.63
-        popl      %esi                                          #2346.63
-        popl      %edi                                          #2346.63
-        movl      %ebp, %esp                                    #2346.63
-        popl      %ebp                                          #2346.63
-        ret                                                     #2346.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-	.data
-# -- End  eval_2na_8
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    2,0x90
-eval_2na_16:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B5.1:                         # Preds ..B5.0
-        pushl     %ebp                                          #2489.1
-        movl      %esp, %ebp                                    #2489.1
-        andl      $-16, %esp                                    #2489.1
-        pushl     %edi                                          #2489.1
-        pushl     %esi                                          #2489.1
-        pushl     %ebx                                          #2489.1
-        subl      $84, %esp                                     #2489.1
-        movl      %ecx, %ebx                                    #2529.49
-        shrl      $2, %ebx                                      #2529.49
-        movl      20(%ebp), %edi                                #2487.5
-        movl      %ebx, 80(%esp)                                #2529.49
-        lea       (%ecx,%edi), %esi                             #2526.5
-        lea       (%edx,%ebx), %ebx                             #2529.30
-        lea       3(%ecx,%edi), %edi                            #2535.50
-        subl      4(%eax), %esi                                 #2532.12
-        movl      %esi, 72(%esp)                                #2532.12
-        movl      80(%esp), %esi                                #2538.14
-        shrl      $2, %edi                                      #2535.57
-        addl      %edx, %edi                                    #2535.30
-        testb     $15, %bl                                      #2538.14
-        jne       ..B5.3        # Prob 50%                      #2538.14
-                                # LOE eax edx ecx ebx esi edi
-..B5.2:                         # Preds ..B5.1
-        movdqa    (%ebx), %xmm0                                 #2538.14
-        movdqa    %xmm0, (%esp)                                 #2538.14
-        jmp       ..B5.4        # Prob 100%                     #2538.14
-                                # LOE eax edx ecx esi edi
-..B5.3:                         # Preds ..B5.1
-        movdqu    (%ebx), %xmm0                                 #2538.14
-        movdqa    %xmm0, (%esp)                                 #2538.14
-                                # LOE eax edx ecx esi edi
-..B5.4:                         # Preds ..B5.2 ..B5.3
-        lea       16(%edx,%esi), %ebx                           #2539.5
-        movl      %ebx, 76(%esp)                                #2539.5
-        cmpl      %edi, %ebx                                    #2544.16
-        jae       ..B5.6        # Prob 12%                      #2544.16
-                                # LOE eax ecx ebx edi bl bh
-..B5.5:                         # Preds ..B5.4
-        movzbl    -1(%ebx), %edx                                #2545.24
-        shll      $8, %edx                                      #2545.38
-        jmp       ..B5.7        # Prob 100%                     #2545.38
-                                # LOE eax edx ecx ebx edi bl bh
-..B5.6:                         # Preds ..B5.4
-        xorl      %edx, %edx                                    #
-                                # LOE eax edx ecx ebx edi bl bh
-..B5.7:                         # Preds ..B5.5 ..B5.6
-        movdqa    16(%eax), %xmm0                               #2549.5
-        movdqa    32(%eax), %xmm6                               #2549.5
-        movdqa    48(%eax), %xmm5                               #2549.5
-        movdqa    64(%eax), %xmm4                               #2549.5
-        movdqa    80(%eax), %xmm3                               #2549.5
-        movdqa    96(%eax), %xmm2                               #2549.5
-        movdqa    112(%eax), %xmm1                              #2549.5
-        movdqa    128(%eax), %xmm7                              #2549.5
-        movl      %ecx, %eax                                    #2561.20
-        andl      $3, %eax                                      #2561.20
-        je        ..B5.43       # Prob 20%                      #2561.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.8:                         # Preds ..B5.7
-        cmpl      $1, %eax                                      #2561.20
-        je        ..B5.14       # Prob 25%                      #2561.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.9:                         # Preds ..B5.8
-        cmpl      $2, %eax                                      #2561.20
-        je        ..B5.13       # Prob 33%                      #2561.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.10:                        # Preds ..B5.9
-        cmpl      $3, %eax                                      #2561.20
-        je        ..B5.12       # Prob 50%                      #2561.20
-                                # LOE edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B5.11:                        # Preds ..B5.10
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        jmp       ..B5.35       # Prob 100%                     #
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.12:                        # Preds ..B5.10
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        xorl      %esi, %esi                                    #
-        movl      %eax, 24(%esp)                                #
-        movl      %esi, 28(%esp)                                #
-        movl      $2, %esi                                      #
-        movl      %eax, 80(%esp)                                #
-        jmp       ..B5.17       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.13:                        # Preds ..B5.9
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      $2, %esi                                      #
-        movl      %eax, 28(%esp)                                #
-        movl      %eax, 80(%esp)                                #
-        jmp       ..B5.16       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.14:                        # Preds ..B5.8
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      $2, %esi                                      #
-        movl      %eax, 80(%esp)                                #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.15:                        # Preds ..B5.14 ..B5.39
-        movdqa    %xmm0, %xmm7                                  #2584.22
-        pand      %xmm4, %xmm7                                  #2584.22
-        pcmpeqw   %xmm5, %xmm7                                  #2585.22
-        pmovmskb  %xmm7, %eax                                   #2586.22
-        movl      %eax, 28(%esp)                                #2586.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.16:                        # Preds ..B5.13 ..B5.15
-        movdqa    %xmm0, %xmm7                                  #2590.22
-        pand      %xmm2, %xmm7                                  #2590.22
-        pcmpeqw   %xmm3, %xmm7                                  #2591.22
-        pmovmskb  %xmm7, %eax                                   #2592.22
-        movl      %eax, 24(%esp)                                #2592.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.17:                        # Preds ..B5.12 ..B5.16
-        movdqa    %xmm0, %xmm7                                  #2596.22
-        pand      48(%esp), %xmm7                               #2596.22
-        pcmpeqw   %xmm1, %xmm7                                  #2597.22
-        pmovmskb  %xmm7, %eax                                   #2598.22
-        movl      %ecx, %edi                                    #2603.17
-        movl      80(%esp), %ecx                                #2606.29
-        movl      %eax, 68(%esp)                                #2598.22
-        andl      $-4, %edi                                     #2603.17
-        orl       28(%esp), %ecx                                #2606.29
-        orl       24(%esp), %ecx                                #2606.34
-        orl       %eax, %ecx                                    #2606.39
-        je        ..B5.26       # Prob 78%                      #2606.47
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.18:                        # Preds ..B5.17
-        movl      %ebx, 16(%esp)                                #
-        movl      80(%esp), %ebx                                #2624.30
-        movl      %edx, 20(%esp)                                #
-        movl      %ebx, %eax                                    #2624.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2624.30
-        movswl    %ax, %edx                                     #2624.30
-        movl      28(%esp), %eax                                #2625.30
-        movl      %edx, (%esp)                                  #2624.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2625.30
-        movswl    %ax, %edx                                     #2625.30
-        movl      24(%esp), %eax                                #2626.30
-        lea       1(,%edx,4), %edx                              #2633.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2626.30
-        movswl    %ax, %ecx                                     #2626.30
-        movl      68(%esp), %eax                                #2627.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2627.30
-        movl      %edx, 4(%esp)                                 #2633.40
-        movswl    %ax, %eax                                     #2627.30
-        lea       2(,%ecx,4), %edx                              #2634.40
-        movl      %edx, 8(%esp)                                 #2634.40
-        lea       3(,%eax,4), %edx                              #2635.40
-        testl     %ebx, %ebx                                    #2639.32
-        movl      16(%esp), %ebx                                #2639.32
-        movl      %edx, 12(%esp)                                #2635.40
-        movl      20(%esp), %edx                                #2639.32
-        je        ..B5.20       # Prob 50%                      #2639.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.19:                        # Preds ..B5.18
-        movl      (%esp), %eax                                  #2639.43
-        movl      72(%esp), %ecx                                #2639.49
-        lea       (%edi,%eax,4), %eax                           #2639.43
-        cmpl      %eax, %ecx                                    #2639.49
-        jae       ..B5.44       # Prob 1%                       #2639.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.20:                        # Preds ..B5.19 ..B5.18
-        movl      28(%esp), %eax                                #2640.32
-        testl     %eax, %eax                                    #2640.32
-        je        ..B5.22       # Prob 50%                      #2640.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.21:                        # Preds ..B5.20
-        movl      4(%esp), %ecx                                 #2640.43
-        movl      72(%esp), %eax                                #2640.49
-        addl      %edi, %ecx                                    #2640.43
-        cmpl      %ecx, %eax                                    #2640.49
-        jae       ..B5.44       # Prob 1%                       #2640.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.22:                        # Preds ..B5.21 ..B5.20
-        movl      24(%esp), %eax                                #2641.32
-        testl     %eax, %eax                                    #2641.32
-        je        ..B5.24       # Prob 50%                      #2641.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.23:                        # Preds ..B5.22
-        movl      8(%esp), %ecx                                 #2641.43
-        movl      72(%esp), %eax                                #2641.49
-        addl      %edi, %ecx                                    #2641.43
-        cmpl      %ecx, %eax                                    #2641.49
-        jae       ..B5.44       # Prob 1%                       #2641.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.24:                        # Preds ..B5.23 ..B5.22
-        movl      68(%esp), %eax                                #2642.32
-        testl     %eax, %eax                                    #2642.32
-        je        ..B5.26       # Prob 50%                      #2642.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.25:                        # Preds ..B5.24
-        movl      12(%esp), %ecx                                #2642.43
-        movl      72(%esp), %eax                                #2642.49
-        addl      %edi, %ecx                                    #2642.43
-        cmpl      %ecx, %eax                                    #2642.49
-        jae       ..B5.44       # Prob 1%                       #2642.49
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.26:                        # Preds ..B5.25 ..B5.24 ..B5.17
-        movl      72(%esp), %eax                                #2650.28
-        lea       4(%edi), %ecx                                 #2647.17
-        cmpl      %eax, %ecx                                    #2650.28
-        ja        ..B5.41       # Prob 1%                       #2650.28
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.27:                        # Preds ..B5.26
-        addl      $-1, %esi                                     #2654.25
-        jne       ..B5.36       # Prob 50%                      #2654.39
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.28:                        # Preds ..B5.27
-        movl      64(%esp), %eax                                #2675.25
-        cmpl      %eax, %ebx                                    #2675.25
-        jae       ..B5.41       # Prob 1%                       #2675.25
-                                # LOE edx ebx edi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.29:                        # Preds ..B5.28
-        movl      72(%esp), %eax                                #2680.24
-        lea       60(%edi), %ecx                                #2679.13
-        cmpl      %eax, %ecx                                    #2680.24
-        ja        ..B5.41       # Prob 1%                       #2680.24
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.30:                        # Preds ..B5.29
-        testb     $15, %bl                                      #2685.22
-        jne       ..B5.32       # Prob 50%                      #2685.22
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.31:                        # Preds ..B5.30
-        movdqa    (%ebx), %xmm0                                 #2685.22
-        jmp       ..B5.33       # Prob 100%                     #2685.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.32:                        # Preds ..B5.30
-        movdqu    (%ebx), %xmm0                                 #2685.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.33:                        # Preds ..B5.31 ..B5.32
-        movl      64(%esp), %eax                                #2766.24
-        addl      $16, %ebx                                     #2763.13
-        movl      %ebx, 76(%esp)                                #2763.13
-        cmpl      %eax, %ebx                                    #2766.24
-        jae       ..B5.35       # Prob 12%                      #2766.24
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.34:                        # Preds ..B5.33
-        movzbl    -1(%ebx), %edx                                #2767.32
-        shll      $8, %edx                                      #2767.46
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.35:                        # Preds ..B5.33 ..B5.11 ..B5.34
-        movl      $2, %esi                                      #2568.13
-        jmp       ..B5.39       # Prob 100%                     #2568.13
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.36:                        # Preds ..B5.27
-        movl      76(%esp), %eax                                #2662.26
-        movl      64(%esp), %edi                                #2662.26
-        psrldq    $1, %xmm0                                     #2659.26
-        cmpl      %edi, %eax                                    #2662.26
-        jae       ..B5.38       # Prob 19%                      #2662.26
-                                # LOE eax edx ecx ebx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.37:                        # Preds ..B5.36
-        movzbl    (%eax), %edi                                  #2665.37
-        sarl      $8, %edx                                      #2664.21
-        shll      $8, %edi                                      #2665.48
-        orl       %edi, %edx                                    #2665.21
-        pinsrw    $7, %edx, %xmm0                               #2666.30
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.38:                        # Preds ..B5.37 ..B5.36
-        addl      $1, 76(%esp)                                  #2670.20
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.39:                        # Preds ..B5.35 ..B5.38 ..B5.43
-        movdqa    %xmm0, %xmm7                                  #2578.22
-        pand      %xmm6, %xmm7                                  #2578.22
-        pcmpeqw   32(%esp), %xmm7                               #2579.22
-        pmovmskb  %xmm7, %eax                                   #2580.22
-        movl      %eax, 80(%esp)                                #2580.22
-        jmp       ..B5.15       # Prob 100%                     #2580.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.41:                        # Preds ..B5.26 ..B5.28 ..B5.29 # Infreq
-        xorl      %eax, %eax                                    #2776.12
-        addl      $84, %esp                                     #2776.12
-        popl      %ebx                                          #2776.12
-        popl      %esi                                          #2776.12
-        popl      %edi                                          #2776.12
-        movl      %ebp, %esp                                    #2776.12
-        popl      %ebp                                          #2776.12
-        ret                                                     #2776.12
-                                # LOE
-..B5.43:                        # Preds ..B5.7                  # Infreq
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        movl      $2, %esi                                      #
-        jmp       ..B5.39       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B5.44:                        # Preds ..B5.21 ..B5.19 ..B5.25 ..B5.23 # Infreq
-        movl      $1, %eax                                      #2641.63
-        addl      $84, %esp                                     #2641.63
-        popl      %ebx                                          #2641.63
-        popl      %esi                                          #2641.63
-        popl      %edi                                          #2641.63
-        movl      %ebp, %esp                                    #2641.63
-        popl      %ebp                                          #2641.63
-        ret                                                     #2641.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-	.data
-# -- End  eval_2na_16
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    2,0x90
-eval_2na_32:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B6.1:                         # Preds ..B6.0
-        pushl     %ebp                                          #2782.1
-        movl      %esp, %ebp                                    #2782.1
-        andl      $-16, %esp                                    #2782.1
-        pushl     %edi                                          #2782.1
-        pushl     %esi                                          #2782.1
-        pushl     %ebx                                          #2782.1
-        subl      $84, %esp                                     #2782.1
-        movl      %ecx, %ebx                                    #2822.49
-        shrl      $2, %ebx                                      #2822.49
-        movl      20(%ebp), %edi                                #2780.5
-        movl      %ebx, 80(%esp)                                #2822.49
-        lea       (%ecx,%edi), %esi                             #2819.5
-        lea       (%edx,%ebx), %ebx                             #2822.30
-        lea       3(%ecx,%edi), %edi                            #2828.50
-        subl      4(%eax), %esi                                 #2825.12
-        movl      %esi, 72(%esp)                                #2825.12
-        movl      80(%esp), %esi                                #2831.14
-        shrl      $2, %edi                                      #2828.57
-        addl      %edx, %edi                                    #2828.30
-        testb     $15, %bl                                      #2831.14
-        jne       ..B6.3        # Prob 50%                      #2831.14
-                                # LOE eax edx ecx ebx esi edi
-..B6.2:                         # Preds ..B6.1
-        movdqa    (%ebx), %xmm0                                 #2831.14
-        movdqa    %xmm0, (%esp)                                 #2831.14
-        jmp       ..B6.4        # Prob 100%                     #2831.14
-                                # LOE eax edx ecx esi edi
-..B6.3:                         # Preds ..B6.1
-        movdqu    (%ebx), %xmm0                                 #2831.14
-        movdqa    %xmm0, (%esp)                                 #2831.14
-                                # LOE eax edx ecx esi edi
-..B6.4:                         # Preds ..B6.2 ..B6.3
-        lea       16(%edx,%esi), %ebx                           #2832.5
-        movl      %ebx, 76(%esp)                                #2832.5
-        cmpl      %edi, %ebx                                    #2837.16
-        jae       ..B6.6        # Prob 12%                      #2837.16
-                                # LOE eax ecx ebx edi bl bh
-..B6.5:                         # Preds ..B6.4
-        movzbl    -1(%ebx), %edx                                #2838.24
-        shll      $8, %edx                                      #2838.38
-        jmp       ..B6.7        # Prob 100%                     #2838.38
-                                # LOE eax edx ecx ebx edi bl bh
-..B6.6:                         # Preds ..B6.4
-        xorl      %edx, %edx                                    #
-                                # LOE eax edx ecx ebx edi bl bh
-..B6.7:                         # Preds ..B6.5 ..B6.6
-        movdqa    16(%eax), %xmm0                               #2842.5
-        movdqa    32(%eax), %xmm6                               #2842.5
-        movdqa    48(%eax), %xmm5                               #2842.5
-        movdqa    64(%eax), %xmm4                               #2842.5
-        movdqa    80(%eax), %xmm3                               #2842.5
-        movdqa    96(%eax), %xmm2                               #2842.5
-        movdqa    112(%eax), %xmm1                              #2842.5
-        movdqa    128(%eax), %xmm7                              #2842.5
-        movl      %ecx, %eax                                    #2854.20
-        andl      $3, %eax                                      #2854.20
-        je        ..B6.43       # Prob 20%                      #2854.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.8:                         # Preds ..B6.7
-        cmpl      $1, %eax                                      #2854.20
-        je        ..B6.14       # Prob 25%                      #2854.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.9:                         # Preds ..B6.8
-        cmpl      $2, %eax                                      #2854.20
-        je        ..B6.13       # Prob 33%                      #2854.20
-                                # LOE eax edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.10:                        # Preds ..B6.9
-        cmpl      $3, %eax                                      #2854.20
-        je        ..B6.12       # Prob 50%                      #2854.20
-                                # LOE edx ecx ebx edi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B6.11:                        # Preds ..B6.10
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        jmp       ..B6.35       # Prob 100%                     #
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.12:                        # Preds ..B6.10
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        xorl      %esi, %esi                                    #
-        movl      %eax, 24(%esp)                                #
-        movl      %esi, 28(%esp)                                #
-        movl      $4, %esi                                      #
-        movl      %eax, 80(%esp)                                #
-        jmp       ..B6.17       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.13:                        # Preds ..B6.9
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      $4, %esi                                      #
-        movl      %eax, 28(%esp)                                #
-        movl      %eax, 80(%esp)                                #
-        jmp       ..B6.16       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.14:                        # Preds ..B6.8
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      $4, %esi                                      #
-        movl      %eax, 80(%esp)                                #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.15:                        # Preds ..B6.14 ..B6.39
-        movdqa    %xmm0, %xmm7                                  #2877.22
-        pand      %xmm4, %xmm7                                  #2877.22
-        pcmpeqd   %xmm5, %xmm7                                  #2878.22
-        pmovmskb  %xmm7, %eax                                   #2879.22
-        movl      %eax, 28(%esp)                                #2879.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.16:                        # Preds ..B6.13 ..B6.15
-        movdqa    %xmm0, %xmm7                                  #2883.22
-        pand      %xmm2, %xmm7                                  #2883.22
-        pcmpeqd   %xmm3, %xmm7                                  #2884.22
-        pmovmskb  %xmm7, %eax                                   #2885.22
-        movl      %eax, 24(%esp)                                #2885.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.17:                        # Preds ..B6.12 ..B6.16
-        movdqa    %xmm0, %xmm7                                  #2889.22
-        pand      48(%esp), %xmm7                               #2889.22
-        pcmpeqd   %xmm1, %xmm7                                  #2890.22
-        pmovmskb  %xmm7, %eax                                   #2891.22
-        movl      %ecx, %edi                                    #2896.17
-        movl      80(%esp), %ecx                                #2899.29
-        movl      %eax, 68(%esp)                                #2891.22
-        andl      $-4, %edi                                     #2896.17
-        orl       28(%esp), %ecx                                #2899.29
-        orl       24(%esp), %ecx                                #2899.34
-        orl       %eax, %ecx                                    #2899.39
-        je        ..B6.26       # Prob 78%                      #2899.47
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.18:                        # Preds ..B6.17
-        movl      %ebx, 16(%esp)                                #
-        movl      80(%esp), %ebx                                #2917.30
-        movl      %edx, 20(%esp)                                #
-        movl      %ebx, %eax                                    #2917.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2917.30
-        movswl    %ax, %edx                                     #2917.30
-        movl      28(%esp), %eax                                #2918.30
-        movl      %edx, (%esp)                                  #2917.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2918.30
-        movswl    %ax, %edx                                     #2918.30
-        movl      24(%esp), %eax                                #2919.30
-        lea       1(,%edx,4), %edx                              #2926.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2919.30
-        movswl    %ax, %ecx                                     #2919.30
-        movl      68(%esp), %eax                                #2920.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2920.30
-        movl      %edx, 4(%esp)                                 #2926.40
-        movswl    %ax, %eax                                     #2920.30
-        lea       2(,%ecx,4), %edx                              #2927.40
-        movl      %edx, 8(%esp)                                 #2927.40
-        lea       3(,%eax,4), %edx                              #2928.40
-        testl     %ebx, %ebx                                    #2932.32
-        movl      16(%esp), %ebx                                #2932.32
-        movl      %edx, 12(%esp)                                #2928.40
-        movl      20(%esp), %edx                                #2932.32
-        je        ..B6.20       # Prob 50%                      #2932.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.19:                        # Preds ..B6.18
-        movl      (%esp), %eax                                  #2932.43
-        movl      72(%esp), %ecx                                #2932.49
-        lea       (%edi,%eax,4), %eax                           #2932.43
-        cmpl      %eax, %ecx                                    #2932.49
-        jae       ..B6.44       # Prob 1%                       #2932.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.20:                        # Preds ..B6.19 ..B6.18
-        movl      28(%esp), %eax                                #2933.32
-        testl     %eax, %eax                                    #2933.32
-        je        ..B6.22       # Prob 50%                      #2933.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.21:                        # Preds ..B6.20
-        movl      4(%esp), %ecx                                 #2933.43
-        movl      72(%esp), %eax                                #2933.49
-        addl      %edi, %ecx                                    #2933.43
-        cmpl      %ecx, %eax                                    #2933.49
-        jae       ..B6.44       # Prob 1%                       #2933.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.22:                        # Preds ..B6.21 ..B6.20
-        movl      24(%esp), %eax                                #2934.32
-        testl     %eax, %eax                                    #2934.32
-        je        ..B6.24       # Prob 50%                      #2934.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.23:                        # Preds ..B6.22
-        movl      8(%esp), %ecx                                 #2934.43
-        movl      72(%esp), %eax                                #2934.49
-        addl      %edi, %ecx                                    #2934.43
-        cmpl      %ecx, %eax                                    #2934.49
-        jae       ..B6.44       # Prob 1%                       #2934.49
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.24:                        # Preds ..B6.23 ..B6.22
-        movl      68(%esp), %eax                                #2935.32
-        testl     %eax, %eax                                    #2935.32
-        je        ..B6.26       # Prob 50%                      #2935.32
-                                # LOE edx ebx esi edi dl bl dh bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.25:                        # Preds ..B6.24
-        movl      12(%esp), %ecx                                #2935.43
-        movl      72(%esp), %eax                                #2935.49
-        addl      %edi, %ecx                                    #2935.43
-        cmpl      %ecx, %eax                                    #2935.49
-        jae       ..B6.44       # Prob 1%                       #2935.49
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.26:                        # Preds ..B6.25 ..B6.24 ..B6.17
-        movl      72(%esp), %eax                                #2943.28
-        lea       4(%edi), %ecx                                 #2940.17
-        cmpl      %eax, %ecx                                    #2943.28
-        ja        ..B6.41       # Prob 1%                       #2943.28
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.27:                        # Preds ..B6.26
-        addl      $-1, %esi                                     #2947.25
-        jne       ..B6.36       # Prob 50%                      #2947.39
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.28:                        # Preds ..B6.27
-        movl      64(%esp), %eax                                #2968.25
-        cmpl      %eax, %ebx                                    #2968.25
-        jae       ..B6.41       # Prob 1%                       #2968.25
-                                # LOE edx ebx edi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.29:                        # Preds ..B6.28
-        movl      72(%esp), %eax                                #2973.24
-        lea       52(%edi), %ecx                                #2972.13
-        cmpl      %eax, %ecx                                    #2973.24
-        ja        ..B6.41       # Prob 1%                       #2973.24
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.30:                        # Preds ..B6.29
-        testb     $15, %bl                                      #2978.22
-        jne       ..B6.32       # Prob 50%                      #2978.22
-                                # LOE edx ecx ebx xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.31:                        # Preds ..B6.30
-        movdqa    (%ebx), %xmm0                                 #2978.22
-        jmp       ..B6.33       # Prob 100%                     #2978.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.32:                        # Preds ..B6.30
-        movdqu    (%ebx), %xmm0                                 #2978.22
-                                # LOE edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.33:                        # Preds ..B6.31 ..B6.32
-        movl      64(%esp), %eax                                #3059.24
-        addl      $16, %ebx                                     #3056.13
-        movl      %ebx, 76(%esp)                                #3056.13
-        cmpl      %eax, %ebx                                    #3059.24
-        jae       ..B6.35       # Prob 12%                      #3059.24
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.34:                        # Preds ..B6.33
-        movzbl    -1(%ebx), %edx                                #3060.32
-        shll      $8, %edx                                      #3060.46
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.35:                        # Preds ..B6.33 ..B6.11 ..B6.34
-        movl      $4, %esi                                      #2861.13
-        jmp       ..B6.39       # Prob 100%                     #2861.13
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.36:                        # Preds ..B6.27
-        movl      76(%esp), %eax                                #2955.26
-        movl      64(%esp), %edi                                #2955.26
-        psrldq    $1, %xmm0                                     #2952.26
-        cmpl      %edi, %eax                                    #2955.26
-        jae       ..B6.38       # Prob 19%                      #2955.26
-                                # LOE eax edx ecx ebx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.37:                        # Preds ..B6.36
-        movzbl    (%eax), %edi                                  #2958.37
-        sarl      $8, %edx                                      #2957.21
-        shll      $8, %edi                                      #2958.48
-        orl       %edi, %edx                                    #2958.21
-        pinsrw    $7, %edx, %xmm0                               #2959.30
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.38:                        # Preds ..B6.37 ..B6.36
-        addl      $1, 76(%esp)                                  #2963.20
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.39:                        # Preds ..B6.35 ..B6.38 ..B6.43
-        movdqa    %xmm0, %xmm7                                  #2871.22
-        pand      %xmm6, %xmm7                                  #2871.22
-        pcmpeqd   32(%esp), %xmm7                               #2872.22
-        pmovmskb  %xmm7, %eax                                   #2873.22
-        movl      %eax, 80(%esp)                                #2873.22
-        jmp       ..B6.15       # Prob 100%                     #2873.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.41:                        # Preds ..B6.26 ..B6.28 ..B6.29 # Infreq
-        xorl      %eax, %eax                                    #3069.12
-        addl      $84, %esp                                     #3069.12
-        popl      %ebx                                          #3069.12
-        popl      %esi                                          #3069.12
-        popl      %edi                                          #3069.12
-        movl      %ebp, %esp                                    #3069.12
-        popl      %ebp                                          #3069.12
-        ret                                                     #3069.12
-                                # LOE
-..B6.43:                        # Preds ..B6.7                  # Infreq
-        movdqa    %xmm7, 48(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    (%esp), %xmm0                                 #
-        movl      %edi, 64(%esp)                                #
-        movl      $4, %esi                                      #
-        jmp       ..B6.39       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B6.44:                        # Preds ..B6.21 ..B6.19 ..B6.25 ..B6.23 # Infreq
-        movl      $1, %eax                                      #2934.63
-        addl      $84, %esp                                     #2934.63
-        popl      %ebx                                          #2934.63
-        popl      %esi                                          #2934.63
-        popl      %edi                                          #2934.63
-        movl      %ebp, %esp                                    #2934.63
-        popl      %ebp                                          #2934.63
-        ret                                                     #2934.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-	.data
-# -- End  eval_2na_32
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    2,0x90
-eval_2na_128:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B7.1:                         # Preds ..B7.0
-        pushl     %ebp                                          #3369.1
-        movl      %esp, %ebp                                    #3369.1
-        andl      $-16, %esp                                    #3369.1
-        pushl     %edi                                          #3369.1
-        pushl     %esi                                          #3369.1
-        pushl     %ebx                                          #3369.1
-        subl      $84, %esp                                     #3369.1
-        movl      %ecx, %esi                                    #3409.49
-        shrl      $2, %esi                                      #3409.49
-        movl      20(%ebp), %ebx                                #3367.5
-        movl      %esi, 68(%esp)                                #3409.49
-        lea       (%ecx,%ebx), %edi                             #3406.5
-        lea       (%edx,%esi), %esi                             #3409.30
-        lea       3(%ecx,%ebx), %ebx                            #3415.50
-        subl      4(%eax), %edi                                 #3412.12
-        movl      %edi, 60(%esp)                                #3412.12
-        movl      68(%esp), %edi                                #3418.14
-        shrl      $2, %ebx                                      #3415.57
-        addl      %edx, %ebx                                    #3415.30
-        testl     $15, %esi                                     #3418.14
-        jne       ..B7.3        # Prob 50%                      #3418.14
-                                # LOE eax edx ecx ebx esi edi
-..B7.2:                         # Preds ..B7.1
-        movdqa    (%esi), %xmm0                                 #3418.14
-        movdqa    %xmm0, 32(%esp)                               #3418.14
-        jmp       ..B7.4        # Prob 100%                     #3418.14
-                                # LOE eax edx ecx ebx edi
-..B7.3:                         # Preds ..B7.1
-        movdqu    (%esi), %xmm0                                 #3418.14
-        movdqa    %xmm0, 32(%esp)                               #3418.14
-                                # LOE eax edx ecx ebx edi
-..B7.4:                         # Preds ..B7.2 ..B7.3
-        lea       16(%edx,%edi), %edx                           #3419.5
-        movl      %edx, 64(%esp)                                #3419.5
-        cmpl      %ebx, %edx                                    #3424.16
-        jae       ..B7.6        # Prob 12%                      #3424.16
-                                # LOE eax edx ecx ebx dl dh
-..B7.5:                         # Preds ..B7.4
-        movzbl    -1(%edx), %esi                                #3425.24
-        shll      $8, %esi                                      #3425.38
-        jmp       ..B7.7        # Prob 100%                     #3425.38
-                                # LOE eax edx ecx ebx esi dl dh
-..B7.6:                         # Preds ..B7.4
-        xorl      %esi, %esi                                    #
-                                # LOE eax edx ecx ebx esi dl dh
-..B7.7:                         # Preds ..B7.5 ..B7.6
-        movl      60(%esp), %edi                                #3434.20
-        movdqa    16(%eax), %xmm6                               #3429.5
-        movdqa    32(%eax), %xmm5                               #3429.5
-        movdqa    48(%eax), %xmm4                               #3429.5
-        movdqa    64(%eax), %xmm3                               #3429.5
-        movdqa    80(%eax), %xmm2                               #3429.5
-        movdqa    96(%eax), %xmm1                               #3429.5
-        movdqa    112(%eax), %xmm0                              #3429.5
-        movdqa    128(%eax), %xmm7                              #3429.5
-        subl      %ecx, %edi                                    #3434.20
-        addl      $7, %edi                                      #3434.33
-        shrl      $2, %edi                                      #3434.40
-        movl      %ecx, %eax                                    #3441.20
-        andl      $3, %eax                                      #3441.20
-        je        ..B7.42       # Prob 20%                      #3441.20
-                                # LOE eax edx ecx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.8:                         # Preds ..B7.7
-        cmpl      $1, %eax                                      #3441.20
-        je        ..B7.14       # Prob 25%                      #3441.20
-                                # LOE eax edx ecx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.9:                         # Preds ..B7.8
-        cmpl      $2, %eax                                      #3441.20
-        je        ..B7.13       # Prob 33%                      #3441.20
-                                # LOE eax edx ecx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.10:                        # Preds ..B7.9
-        cmpl      $3, %eax                                      #3441.20
-        je        ..B7.12       # Prob 50%                      #3441.20
-                                # LOE edx ecx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B7.11:                        # Preds ..B7.10
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 68(%esp)                                #
-        movl      %ebx, 56(%esp)                                #
-        jmp       ..B7.26       # Prob 100%                     #
-                                # LOE edx ecx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.12:                        # Preds ..B7.10
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 68(%esp)                                #
-        movl      %ebx, 56(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 48(%esp)                                #
-        movl      %eax, 52(%esp)                                #
-        jmp       ..B7.17       # Prob 100%                     #
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.13:                        # Preds ..B7.9
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 68(%esp)                                #
-        movl      %ebx, 56(%esp)                                #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 52(%esp)                                #
-        jmp       ..B7.16       # Prob 100%                     #
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.14:                        # Preds ..B7.8
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 68(%esp)                                #
-        movl      %ebx, 56(%esp)                                #
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.15:                        # Preds ..B7.14 ..B7.30
-        movdqa    %xmm0, %xmm7                                  #3464.22
-        pand      %xmm3, %xmm7                                  #3464.22
-        pcmpeqd   %xmm4, %xmm7                                  #3465.22
-        pmovmskb  %xmm7, %ebx                                   #3466.22
-        addl      $1, %ebx                                      #3467.17
-        shrl      $16, %ebx                                     #3467.17
-        negl      %ebx                                          #3467.17
-        movl      %ebx, 52(%esp)                                #3467.17
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.16:                        # Preds ..B7.13 ..B7.15
-        movdqa    %xmm0, %xmm7                                  #3470.22
-        pand      %xmm1, %xmm7                                  #3470.22
-        pcmpeqd   %xmm2, %xmm7                                  #3471.22
-        pmovmskb  %xmm7, %ebx                                   #3472.22
-        addl      $1, %ebx                                      #3473.17
-        shrl      $16, %ebx                                     #3473.17
-        negl      %ebx                                          #3473.17
-        movl      %ebx, 48(%esp)                                #3473.17
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.17:                        # Preds ..B7.12 ..B7.16
-        movdqa    %xmm0, %xmm7                                  #3476.22
-        pand      (%esp), %xmm7                                 #3476.22
-        pcmpeqd   16(%esp), %xmm7                               #3477.22
-        pmovmskb  %xmm7, %ebx                                   #3478.22
-        andl      $-4, %ecx                                     #3483.17
-        movl      %eax, %esi                                    #3486.29
-        orl       52(%esp), %esi                                #3486.29
-        addl      $1, %ebx                                      #3479.17
-        shrl      $16, %ebx                                     #3479.17
-        orl       48(%esp), %esi                                #3486.34
-        negl      %ebx                                          #3479.17
-        orl       %ebx, %esi                                    #3486.39
-        jne       ..B7.31       # Prob 1%                       #3486.47
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.18:                        # Preds ..B7.17
-        movl      60(%esp), %eax                                #3530.28
-        addl      $4, %ecx                                      #3527.17
-        cmpl      %eax, %ecx                                    #3530.28
-        ja        ..B7.38       # Prob 1%                       #3530.28
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.19:                        # Preds ..B7.18
-        addl      $-1, %edi                                     #3534.25
-        jne       ..B7.27       # Prob 50%                      #3534.39
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.20:                        # Preds ..B7.19
-        movl      56(%esp), %eax                                #3555.25
-        cmpl      %eax, %edx                                    #3555.25
-        jae       ..B7.38       # Prob 1%                       #3555.25
-                                # LOE eax edx ecx al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.21:                        # Preds ..B7.20
-        testb     $15, %dl                                      #3565.22
-        jne       ..B7.23       # Prob 50%                      #3565.22
-                                # LOE eax edx ecx al ah xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.22:                        # Preds ..B7.21
-        movdqa    (%edx), %xmm0                                 #3565.22
-        jmp       ..B7.24       # Prob 100%                     #3565.22
-                                # LOE eax edx ecx al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.23:                        # Preds ..B7.21
-        movdqu    (%edx), %xmm0                                 #3565.22
-                                # LOE eax edx ecx al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.24:                        # Preds ..B7.22 ..B7.23
-        addl      $16, %edx                                     #3643.13
-        movl      %edx, 64(%esp)                                #3643.13
-        cmpl      %eax, %edx                                    #3646.24
-        jae       ..B7.26       # Prob 12%                      #3646.24
-                                # LOE edx ecx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.25:                        # Preds ..B7.24
-        movzbl    -1(%edx), %eax                                #3647.32
-        shll      $8, %eax                                      #3647.46
-        movl      %eax, 68(%esp)                                #3647.46
-                                # LOE edx ecx dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.26:                        # Preds ..B7.24 ..B7.11 ..B7.25
-        movl      $16, %edi                                     #3448.13
-        jmp       ..B7.30       # Prob 100%                     #3448.13
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.27:                        # Preds ..B7.19
-        movl      64(%esp), %eax                                #3542.26
-        movl      56(%esp), %ebx                                #3542.26
-        psrldq    $1, %xmm0                                     #3539.26
-        cmpl      %ebx, %eax                                    #3542.26
-        jae       ..B7.29       # Prob 19%                      #3542.26
-                                # LOE eax edx ecx edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.28:                        # Preds ..B7.27
-        movl      68(%esp), %esi                                #3544.21
-        movzbl    (%eax), %ebx                                  #3545.37
-        sarl      $8, %esi                                      #3544.21
-        shll      $8, %ebx                                      #3545.48
-        orl       %ebx, %esi                                    #3545.21
-        pinsrw    $7, %esi, %xmm0                               #3546.30
-        movl      %esi, 68(%esp)                                #3545.21
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.29:                        # Preds ..B7.28 ..B7.27
-        addl      $1, 64(%esp)                                  #3550.20
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.30:                        # Preds ..B7.26 ..B7.29 ..B7.42
-        movdqa    %xmm0, %xmm7                                  #3458.22
-        pand      %xmm5, %xmm7                                  #3458.22
-        pcmpeqd   %xmm6, %xmm7                                  #3459.22
-        pmovmskb  %xmm7, %eax                                   #3460.22
-        addl      $1, %eax                                      #3461.17
-        shrl      $16, %eax                                     #3461.17
-        negl      %eax                                          #3461.17
-        jmp       ..B7.15       # Prob 100%                     #3461.17
-                                # LOE eax edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B7.31:                        # Preds ..B7.17                 # Infreq
-        movl      60(%esp), %edx                                #3489.30
-        subl      %ecx, %edx                                    #3489.30
-        movl      %edx, 60(%esp)                                #3489.30
-        cmpl      $2, %edx                                      #3489.37
-        je        ..B7.35       # Prob 25%                      #3489.37
-                                # LOE eax edx dl dh
-..B7.32:                        # Preds ..B7.31                 # Infreq
-        cmpl      $1, %edx                                      #3489.37
-        je        ..B7.36       # Prob 33%                      #3489.37
-                                # LOE eax edx dl dh
-..B7.33:                        # Preds ..B7.32                 # Infreq
-        testl     %edx, %edx                                    #3489.37
-        je        ..B7.37       # Prob 50%                      #3489.37
-                                # LOE eax
-..B7.34:                        # Preds ..B7.35 ..B7.36 ..B7.37 ..B7.33 # Infreq
-        movl      $1, %eax                                      #3492.32
-        addl      $84, %esp                                     #3492.32
-        popl      %ebx                                          #3492.32
-        popl      %esi                                          #3492.32
-        popl      %edi                                          #3492.32
-        movl      %ebp, %esp                                    #3492.32
-        popl      %ebp                                          #3492.32
-        ret                                                     #3492.32
-                                # LOE
-..B7.35:                        # Preds ..B7.31                 # Infreq
-        movl      48(%esp), %edx                                #3494.36
-        testl     %edx, %edx                                    #3494.36
-        jne       ..B7.34       # Prob 28%                      #3494.36
-                                # LOE eax
-..B7.36:                        # Preds ..B7.35 ..B7.32         # Infreq
-        movl      52(%esp), %edx                                #3496.36
-        testl     %edx, %edx                                    #3496.36
-        jne       ..B7.34       # Prob 28%                      #3496.36
-                                # LOE eax
-..B7.37:                        # Preds ..B7.33 ..B7.36         # Infreq
-        testl     %eax, %eax                                    #3498.36
-        jne       ..B7.34       # Prob 28%                      #3498.36
-                                # LOE
-..B7.38:                        # Preds ..B7.20 ..B7.18 ..B7.37 # Infreq
-        xorl      %eax, %eax                                    #3500.28
-        addl      $84, %esp                                     #3500.28
-        popl      %ebx                                          #3500.28
-        popl      %esi                                          #3500.28
-        popl      %edi                                          #3500.28
-        movl      %ebp, %esp                                    #3500.28
-        popl      %ebp                                          #3500.28
-        ret                                                     #3500.28
-                                # LOE
-..B7.42:                        # Preds ..B7.7                  # Infreq
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 68(%esp)                                #
-        movl      %ebx, 56(%esp)                                #
-        jmp       ..B7.30       # Prob 100%                     #
-        .align    2,0x90
-                                # LOE edx ecx edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-	.data
-# -- End  eval_2na_128
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    2,0x90
-eval_4na_16:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B8.1:                         # Preds ..B8.0
-        pushl     %ebp                                          #4057.1
-        movl      %esp, %ebp                                    #4057.1
-        andl      $-16, %esp                                    #4057.1
-        pushl     %edi                                          #4057.1
-        pushl     %esi                                          #4057.1
-        pushl     %ebx                                          #4057.1
-        subl      $116, %esp                                    #4057.1
-        movdqa    16(%eax), %xmm5                               #4109.5
-        movdqa    32(%eax), %xmm4                               #4109.5
-        movl      20(%ebp), %ebx                                #4055.5
-        movdqa    48(%eax), %xmm6                               #4109.5
-        movdqa    64(%eax), %xmm3                               #4109.5
-        movdqa    80(%eax), %xmm2                               #4109.5
-        movdqa    96(%eax), %xmm0                               #4109.5
-        movdqa    128(%eax), %xmm7                              #4109.5
-        movdqa    %xmm0, 80(%esp)                               #4109.5
-        movdqa    112(%eax), %xmm0                              #4109.5
-        movl      %ecx, %edi                                    #4093.49
-        call      ..L3          # Prob 100%                     #4057.1
-..L3:                                                           #
-        popl      %esi                                          #4057.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L3], %esi       #4057.1
-        shrl      $2, %edi                                      #4093.49
-        movl      %esi, 16(%esp)                                #4057.1
-        lea       (%ecx,%ebx), %esi                             #4090.5
-        subl      4(%eax), %esi                                 #4096.12
-        lea       3(%ecx,%ebx), %ebx                            #4099.50
-        movl      %esi, 100(%esp)                               #4096.12
-        movzbl    (%edi,%edx), %esi                             #4102.14
-        shrl      $2, %ebx                                      #4099.57
-        addl      %edx, %ebx                                    #4099.30
-        movl      %ecx, %eax                                    #4123.20
-        movl      %ebx, 104(%esp)                               #4099.30
-        movl      16(%esp), %ebx                                #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, (%esp)                                   #4102.14
-        movzbl    1(%edi,%edx), %esi                            #4102.14
-        andl      $3, %eax                                      #4123.20
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 2(%esp)                                  #4102.14
-        movzbl    2(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 4(%esp)                                  #4102.14
-        movzbl    3(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 6(%esp)                                  #4102.14
-        movzbl    4(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 8(%esp)                                  #4102.14
-        movzbl    5(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 10(%esp)                                 #4102.14
-        movzbl    6(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 12(%esp)                                 #4102.14
-        movzbl    7(%edi,%edx), %esi                            #4102.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4102.14
-        movw      %si, 14(%esp)                                 #4102.14
-        movdqu    (%esp), %xmm1                                 #4102.14
-        lea       8(%edx,%edi), %esi                            #4103.5
-        je        ..B8.5        # Prob 20%                      #4123.20
-                                # LOE eax ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.2:                         # Preds ..B8.1
-        cmpl      $1, %eax                                      #4123.20
-        je        ..B8.8        # Prob 25%                      #4123.20
-                                # LOE eax ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.3:                         # Preds ..B8.2
-        cmpl      $2, %eax                                      #4123.20
-        je        ..B8.7        # Prob 33%                      #4123.20
-                                # LOE eax ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.4:                         # Preds ..B8.3
-        cmpl      $3, %eax                                      #4123.20
-        je        ..B8.6        # Prob 50%                      #4123.20
-                                # LOE ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B8.5:                         # Preds ..B8.1 ..B8.4
-        movdqa    %xmm7, 64(%esp)                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        jmp       ..B8.24       # Prob 100%                     #
-                                # LOE ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.6:                         # Preds ..B8.4
-        movdqa    %xmm7, 64(%esp)                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 44(%esp)                                #
-        xorl      %edx, %edx                                    #
-        movl      %edi, 96(%esp)                                #
-        jmp       ..B8.11       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.7:                         # Preds ..B8.3
-        movdqa    %xmm7, 64(%esp)                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 96(%esp)                                #
-        xorl      %edx, %edx                                    #
-        jmp       ..B8.10       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.8:                         # Preds ..B8.2
-        movdqa    %xmm7, 64(%esp)                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edx, %edx                                    #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.9:                         # Preds ..B8.8 ..B8.24
-        movdqa    %xmm1, %xmm7                                  #4147.22
-        movdqa    %xmm1, %xmm6                                  #4148.22
-        pand      48(%esp), %xmm7                               #4147.22
-        pand      %xmm3, %xmm6                                  #4148.22
-        pcmpeqw   %xmm6, %xmm7                                  #4149.22
-        pmovmskb  %xmm7, %edi                                   #4150.22
-        movl      %edi, 96(%esp)                                #4150.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.10:                        # Preds ..B8.7 ..B8.9
-        movdqa    %xmm1, %xmm7                                  #4154.22
-        movdqa    %xmm1, %xmm6                                  #4155.22
-        pand      80(%esp), %xmm6                               #4155.22
-        pand      %xmm2, %xmm7                                  #4154.22
-        pcmpeqw   %xmm6, %xmm7                                  #4156.22
-        pmovmskb  %xmm7, %edi                                   #4157.22
-        movl      %edi, 44(%esp)                                #4157.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.11:                        # Preds ..B8.6 ..B8.10
-        movdqa    %xmm1, %xmm6                                  #4161.22
-        pand      64(%esp), %xmm1                               #4162.22
-        andl      $-4, %ecx                                     #4169.17
-        pand      %xmm0, %xmm6                                  #4161.22
-        pcmpeqw   %xmm1, %xmm6                                  #4163.22
-        pmovmskb  %xmm6, %edi                                   #4164.22
-        movl      %edi, 40(%esp)                                #4164.22
-        movl      %edx, %eax                                    #4172.29
-        orl       96(%esp), %eax                                #4172.29
-        orl       44(%esp), %eax                                #4172.34
-        orl       %edi, %eax                                    #4172.39
-        je        ..B8.20       # Prob 78%                      #4172.47
-                                # LOE edx ecx ebx esi xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.12:                        # Preds ..B8.11
-        movl      %ecx, 32(%esp)                                #
-        movl      %edx, %eax                                    #4190.30
-        movl      %esi, 36(%esp)                                #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4190.30
-        movswl    %ax, %ecx                                     #4190.30
-        movl      96(%esp), %eax                                #4191.30
-        movl      %ecx, 16(%esp)                                #4190.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4191.30
-        movswl    %ax, %edi                                     #4191.30
-        lea       1(%edi,%edi), %edi                            #4199.40
-        movl      44(%esp), %eax                                #4192.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4192.30
-        movswl    %ax, %esi                                     #4192.30
-        movl      40(%esp), %eax                                #4193.30
-        lea       2(%esi,%esi), %esi                            #4200.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4193.30
-        movl      %edi, 20(%esp)                                #4199.40
-        movl      %esi, 24(%esp)                                #4200.40
-        movl      36(%esp), %esi                                #4205.32
-        movswl    %ax, %ecx                                     #4193.30
-        lea       3(%ecx,%ecx), %ecx                            #4201.40
-        testl     %edx, %edx                                    #4205.32
-        movl      %ecx, 28(%esp)                                #4201.40
-        movl      32(%esp), %ecx                                #4205.32
-        je        ..B8.14       # Prob 50%                      #4205.32
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.13:                        # Preds ..B8.12
-        movl      16(%esp), %eax                                #4205.43
-        movl      100(%esp), %edx                               #4205.49
-        lea       (%ecx,%eax,2), %edi                           #4205.43
-        cmpl      %edi, %edx                                    #4205.49
-        jae       ..B8.28       # Prob 1%                       #4205.49
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.14:                        # Preds ..B8.13 ..B8.12
-        movl      96(%esp), %eax                                #4206.32
-        testl     %eax, %eax                                    #4206.32
-        je        ..B8.16       # Prob 50%                      #4206.32
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.15:                        # Preds ..B8.14
-        movl      20(%esp), %edx                                #4206.43
-        movl      100(%esp), %eax                               #4206.49
-        addl      %ecx, %edx                                    #4206.43
-        cmpl      %edx, %eax                                    #4206.49
-        jae       ..B8.28       # Prob 1%                       #4206.49
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.16:                        # Preds ..B8.15 ..B8.14
-        movl      44(%esp), %eax                                #4207.32
-        testl     %eax, %eax                                    #4207.32
-        je        ..B8.18       # Prob 50%                      #4207.32
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.17:                        # Preds ..B8.16
-        movl      24(%esp), %edx                                #4207.43
-        movl      100(%esp), %eax                               #4207.49
-        addl      %ecx, %edx                                    #4207.43
-        cmpl      %edx, %eax                                    #4207.49
-        jae       ..B8.28       # Prob 1%                       #4207.49
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.18:                        # Preds ..B8.17 ..B8.16
-        movl      40(%esp), %eax                                #4208.32
-        testl     %eax, %eax                                    #4208.32
-        je        ..B8.20       # Prob 50%                      #4208.32
-                                # LOE ecx ebx esi cl ch xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.19:                        # Preds ..B8.18
-        movl      28(%esp), %edx                                #4208.43
-        movl      100(%esp), %eax                               #4208.49
-        addl      %ecx, %edx                                    #4208.43
-        cmpl      %edx, %eax                                    #4208.49
-        jae       ..B8.28       # Prob 1%                       #4208.49
-                                # LOE ecx ebx esi xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.20:                        # Preds ..B8.19 ..B8.18 ..B8.11
-        movl      100(%esp), %eax                               #4216.28
-        lea       4(%ecx), %edx                                 #4241.13
-        cmpl      %edx, %eax                                    #4216.28
-        jb        ..B8.26       # Prob 1%                       #4216.28
-                                # LOE ecx ebx esi xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.21:                        # Preds ..B8.20
-        movl      104(%esp), %eax                               #4237.25
-        cmpl      %eax, %esi                                    #4237.25
-        jae       ..B8.26       # Prob 1%                       #4237.25
-                                # LOE ecx ebx esi xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.22:                        # Preds ..B8.21
-        movl      100(%esp), %eax                               #4242.24
-        addl      $32, %ecx                                     #4241.13
-        cmpl      %eax, %ecx                                    #4242.24
-        ja        ..B8.26       # Prob 1%                       #4242.24
-                                # LOE ecx ebx esi xmm0 xmm2 xmm3 xmm4 xmm5
-..B8.23:                        # Preds ..B8.22
-        movzbl    (%esi), %eax                                  #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %edx        #4247.22
-        movzbl    1(%esi), %edi                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%edi,2), %eax        #4247.22
-        movw      %dx, (%esp)                                   #4247.22
-        movw      %ax, 2(%esp)                                  #4247.22
-        movzbl    2(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        movw      %ax, 4(%esp)                                  #4247.22
-        movzbl    3(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        movw      %ax, 6(%esp)                                  #4247.22
-        movzbl    4(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        movw      %ax, 8(%esp)                                  #4247.22
-        movzbl    5(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        movw      %ax, 10(%esp)                                 #4247.22
-        movzbl    6(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        movw      %ax, 12(%esp)                                 #4247.22
-        movzbl    7(%esi), %eax                                 #4247.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4247.22
-        addl      $8, %esi                                      #4262.13
-        movw      %ax, 14(%esp)                                 #4247.22
-        movdqu    (%esp), %xmm1                                 #4247.22
-                                # LOE ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.24:                        # Preds ..B8.23 ..B8.5
-        movdqa    %xmm1, %xmm7                                  #4140.22
-        movdqa    %xmm1, %xmm6                                  #4141.22
-        pand      %xmm5, %xmm7                                  #4140.22
-        pand      %xmm4, %xmm6                                  #4141.22
-        pcmpeqw   %xmm6, %xmm7                                  #4142.22
-        pmovmskb  %xmm7, %edx                                   #4143.22
-        jmp       ..B8.9        # Prob 100%                     #4143.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B8.26:                        # Preds ..B8.20 ..B8.21 ..B8.22 # Infreq
-        xorl      %eax, %eax                                    #4273.12
-        addl      $116, %esp                                    #4273.12
-        popl      %ebx                                          #4273.12
-        popl      %esi                                          #4273.12
-        popl      %edi                                          #4273.12
-        movl      %ebp, %esp                                    #4273.12
-        popl      %ebp                                          #4273.12
-        ret                                                     #4273.12
-                                # LOE
-..B8.28:                        # Preds ..B8.19 ..B8.17 ..B8.15 ..B8.13 # Infreq
-        movl      $1, %eax                                      #4205.63
-        addl      $116, %esp                                    #4205.63
-        popl      %ebx                                          #4205.63
-        popl      %esi                                          #4205.63
-        popl      %edi                                          #4205.63
-        movl      %ebp, %esp                                    #4205.63
-        popl      %ebp                                          #4205.63
-        ret                                                     #4205.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-	.data
-# -- End  eval_4na_16
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    2,0x90
-eval_4na_32:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B9.1:                         # Preds ..B9.0
-        pushl     %ebp                                          #4279.1
-        movl      %esp, %ebp                                    #4279.1
-        andl      $-16, %esp                                    #4279.1
-        pushl     %edi                                          #4279.1
-        pushl     %esi                                          #4279.1
-        pushl     %ebx                                          #4279.1
-        subl      $132, %esp                                    #4279.1
-        movdqa    16(%eax), %xmm7                               #4331.5
-        movdqa    32(%eax), %xmm5                               #4331.5
-        movl      20(%ebp), %ebx                                #4277.5
-        movdqa    48(%eax), %xmm4                               #4331.5
-        movdqa    64(%eax), %xmm3                               #4331.5
-        movdqa    80(%eax), %xmm6                               #4331.5
-        movdqa    112(%eax), %xmm2                              #4331.5
-        movdqa    128(%eax), %xmm1                              #4331.5
-        movl      %ecx, %edi                                    #4315.49
-        shrl      $2, %edi                                      #4315.49
-        call      ..L4          # Prob 100%                     #4279.1
-..L4:                                                           #
-        popl      %esi                                          #4279.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L4], %esi       #4279.1
-        movl      %esi, 32(%esp)                                #4279.1
-        lea       (%ecx,%ebx), %esi                             #4312.5
-        lea       3(%ecx,%ebx), %ebx                            #4321.50
-        shrl      $2, %ebx                                      #4321.57
-        subl      4(%eax), %esi                                 #4318.12
-        movl      %esi, 112(%esp)                               #4318.12
-        movzbl    (%edi,%edx), %esi                             #4324.14
-        addl      %edx, %ebx                                    #4321.30
-        movl      %ebx, 116(%esp)                               #4321.30
-        movl      32(%esp), %ebx                                #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, (%esp)                                   #4324.14
-        movzbl    1(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 2(%esp)                                  #4324.14
-        movzbl    2(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 4(%esp)                                  #4324.14
-        movzbl    3(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 6(%esp)                                  #4324.14
-        movzbl    4(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 8(%esp)                                  #4324.14
-        movzbl    5(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 10(%esp)                                 #4324.14
-        movzbl    6(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 12(%esp)                                 #4324.14
-        movzbl    7(%edi,%edx), %esi                            #4324.14
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%esi,2), %esi        #4324.14
-        movw      %si, 14(%esp)                                 #4324.14
-        movdqu    (%esp), %xmm0                                 #4324.14
-        lea       8(%edx,%edi), %esi                            #4325.5
-        movdqa    %xmm0, 16(%esp)                               #4324.14
-        movdqa    96(%eax), %xmm0                               #4331.5
-        movl      %esi, %edx                                    #4325.5
-        movl      %ecx, %eax                                    #4345.20
-        andl      $3, %eax                                      #4345.20
-        je        ..B9.33       # Prob 20%                      #4345.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.2:                         # Preds ..B9.1
-        cmpl      $1, %eax                                      #4345.20
-        je        ..B9.8        # Prob 25%                      #4345.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.3:                         # Preds ..B9.2
-        cmpl      $2, %eax                                      #4345.20
-        je        ..B9.7        # Prob 33%                      #4345.20
-                                # LOE eax edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.4:                         # Preds ..B9.3
-        cmpl      $3, %eax                                      #4345.20
-        je        ..B9.6        # Prob 50%                      #4345.20
-                                # LOE edx ecx ebx esi bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B9.5:                         # Preds ..B9.4
-        movdqa    %xmm0, 80(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movdqa    %xmm7, 48(%esp)                               #
-        jmp       ..B9.25       # Prob 100%                     #
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.6:                         # Preds ..B9.4
-        movdqa    %xmm0, 80(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movdqa    %xmm7, 48(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 44(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 96(%esp)                                #
-        movl      %eax, 104(%esp)                               #
-        movl      $2, %edi                                      #
-        jmp       ..B9.11       # Prob 100%                     #
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.7:                         # Preds ..B9.3
-        movdqa    %xmm0, 80(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movdqa    %xmm7, 48(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 96(%esp)                                #
-        movl      $2, %edi                                      #
-        movl      %eax, 104(%esp)                               #
-        jmp       ..B9.10       # Prob 100%                     #
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.8:                         # Preds ..B9.2
-        movdqa    %xmm0, 80(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movdqa    %xmm7, 48(%esp)                               #
-        xorl      %eax, %eax                                    #
-        movl      %eax, 104(%esp)                               #
-        movl      $2, %edi                                      #
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.9:                         # Preds ..B9.8 ..B9.29
-        movdqa    %xmm0, %xmm7                                  #4369.22
-        movdqa    %xmm0, %xmm6                                  #4370.22
-        pand      %xmm4, %xmm7                                  #4369.22
-        pand      %xmm3, %xmm6                                  #4370.22
-        pcmpeqd   %xmm6, %xmm7                                  #4371.22
-        pmovmskb  %xmm7, %eax                                   #4372.22
-        movl      %eax, 96(%esp)                                #4372.22
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.10:                        # Preds ..B9.7 ..B9.9
-        movdqa    %xmm0, %xmm7                                  #4376.22
-        movdqa    %xmm0, %xmm6                                  #4377.22
-        pand      64(%esp), %xmm7                               #4376.22
-        pand      80(%esp), %xmm6                               #4377.22
-        pcmpeqd   %xmm6, %xmm7                                  #4378.22
-        pmovmskb  %xmm7, %eax                                   #4379.22
-        movl      %eax, 44(%esp)                                #4379.22
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.11:                        # Preds ..B9.6 ..B9.10
-        movdqa    %xmm0, %xmm7                                  #4383.22
-        movdqa    %xmm0, %xmm6                                  #4384.22
-        pand      %xmm2, %xmm7                                  #4383.22
-        pand      %xmm1, %xmm6                                  #4384.22
-        pcmpeqd   %xmm6, %xmm7                                  #4385.22
-        pmovmskb  %xmm7, %eax                                   #4386.22
-        movl      %eax, 100(%esp)                               #4386.22
-        andl      $-4, %ecx                                     #4391.17
-        movl      %ecx, 108(%esp)                               #4391.17
-        movl      104(%esp), %ecx                               #4394.29
-        orl       96(%esp), %ecx                                #4394.29
-        orl       44(%esp), %ecx                                #4394.34
-        orl       %eax, %ecx                                    #4394.39
-        je        ..B9.20       # Prob 78%                      #4394.47
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.12:                        # Preds ..B9.11
-        movl      %edi, 32(%esp)                                #
-        movl      104(%esp), %edi                               #4412.30
-        movl      %esi, 36(%esp)                                #
-        movl      %edi, %eax                                    #4412.30
-        movl      %edx, 40(%esp)                                #
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4412.30
-        movswl    %ax, %edx                                     #4412.30
-        movl      96(%esp), %eax                                #4413.30
-        movl      %edx, 16(%esp)                                #4412.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4413.30
-        movswl    %ax, %esi                                     #4413.30
-        lea       1(%esi,%esi), %esi                            #4421.40
-        movl      44(%esp), %eax                                #4414.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4414.30
-        movswl    %ax, %ecx                                     #4414.30
-        movl      100(%esp), %eax                               #4415.30
-        lea       2(%ecx,%ecx), %ecx                            #4422.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+5;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4415.30
-        movl      %esi, 20(%esp)                                #4421.40
-        movl      36(%esp), %esi                                #4427.32
-        movl      %ecx, 24(%esp)                                #4422.40
-        movswl    %ax, %edx                                     #4415.30
-        lea       3(%edx,%edx), %edx                            #4423.40
-        movl      %edx, 28(%esp)                                #4423.40
-        movl      40(%esp), %edx                                #4427.32
-        testl     %edi, %edi                                    #4427.32
-        movl      32(%esp), %edi                                #4427.32
-        je        ..B9.14       # Prob 50%                      #4427.32
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.13:                        # Preds ..B9.12
-        movl      16(%esp), %ecx                                #4427.43
-        movl      108(%esp), %eax                               #4427.43
-        lea       (%eax,%ecx,2), %ecx                           #4427.43
-        movl      112(%esp), %eax                               #4427.49
-        cmpl      %ecx, %eax                                    #4427.49
-        jae       ..B9.34       # Prob 1%                       #4427.49
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.14:                        # Preds ..B9.13 ..B9.12
-        movl      96(%esp), %eax                                #4428.32
-        testl     %eax, %eax                                    #4428.32
-        je        ..B9.16       # Prob 50%                      #4428.32
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.15:                        # Preds ..B9.14
-        movl      20(%esp), %ecx                                #4428.43
-        addl      108(%esp), %ecx                               #4428.43
-        movl      112(%esp), %eax                               #4428.49
-        cmpl      %ecx, %eax                                    #4428.49
-        jae       ..B9.34       # Prob 1%                       #4428.49
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.16:                        # Preds ..B9.15 ..B9.14
-        movl      44(%esp), %eax                                #4429.32
-        testl     %eax, %eax                                    #4429.32
-        je        ..B9.18       # Prob 50%                      #4429.32
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.17:                        # Preds ..B9.16
-        movl      24(%esp), %ecx                                #4429.43
-        addl      108(%esp), %ecx                               #4429.43
-        movl      112(%esp), %eax                               #4429.49
-        cmpl      %ecx, %eax                                    #4429.49
-        jae       ..B9.34       # Prob 1%                       #4429.49
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.18:                        # Preds ..B9.17 ..B9.16
-        movl      100(%esp), %eax                               #4430.32
-        testl     %eax, %eax                                    #4430.32
-        je        ..B9.20       # Prob 50%                      #4430.32
-                                # LOE edx ebx esi edi dl dh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.19:                        # Preds ..B9.18
-        movl      28(%esp), %ecx                                #4430.43
-        addl      108(%esp), %ecx                               #4430.43
-        movl      112(%esp), %eax                               #4430.49
-        cmpl      %ecx, %eax                                    #4430.49
-        jae       ..B9.34       # Prob 1%                       #4430.49
-                                # LOE edx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.20:                        # Preds ..B9.19 ..B9.18 ..B9.11
-        movl      108(%esp), %ecx                               #4435.17
-        movl      112(%esp), %eax                               #4438.28
-        lea       4(%ecx), %ecx                                 #4435.17
-        cmpl      %eax, %ecx                                    #4438.28
-        ja        ..B9.31       # Prob 1%                       #4438.28
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.21:                        # Preds ..B9.20
-        addl      $-1, %edi                                     #4442.25
-        jne       ..B9.26       # Prob 50%                      #4442.39
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.22:                        # Preds ..B9.21
-        movl      116(%esp), %eax                               #4459.25
-        cmpl      %eax, %esi                                    #4459.25
-        jae       ..B9.31       # Prob 1%                       #4459.25
-                                # LOE ebx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.23:                        # Preds ..B9.22
-        movl      108(%esp), %ecx                               #4463.13
-        movl      112(%esp), %eax                               #4464.24
-        lea       28(%ecx), %ecx                                #4463.13
-        cmpl      %eax, %ecx                                    #4464.24
-        ja        ..B9.31       # Prob 1%                       #4464.24
-                                # LOE ecx ebx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.24:                        # Preds ..B9.23
-        movzbl    (%esi), %eax                                  #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %edx        #4469.22
-        movzbl    1(%esi), %edi                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%edi,2), %eax        #4469.22
-        movw      %dx, (%esp)                                   #4469.22
-        movw      %ax, 2(%esp)                                  #4469.22
-        movzbl    2(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        movw      %ax, 4(%esp)                                  #4469.22
-        movzbl    3(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        movw      %ax, 6(%esp)                                  #4469.22
-        movzbl    4(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        movw      %ax, 8(%esp)                                  #4469.22
-        movzbl    5(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        movw      %ax, 10(%esp)                                 #4469.22
-        movzbl    6(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        movw      %ax, 12(%esp)                                 #4469.22
-        movzbl    7(%esi), %eax                                 #4469.22
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4469.22
-        addl      $8, %esi                                      #4484.13
-        movl      %esi, %edx                                    #4484.13
-        movw      %ax, 14(%esp)                                 #4469.22
-        movdqu    (%esp), %xmm0                                 #4469.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.25:                        # Preds ..B9.5 ..B9.24
-        movl      $2, %edi                                      #4352.13
-        jmp       ..B9.29       # Prob 100%                     #4352.13
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.26:                        # Preds ..B9.21
-        movl      116(%esp), %eax                               #4450.26
-        psrldq    $2, %xmm0                                     #4447.26
-        cmpl      %eax, %edx                                    #4450.26
-        jae       ..B9.28       # Prob 19%                      #4450.26
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.27:                        # Preds ..B9.26
-        movzbl    (%edx), %eax                                  #4451.72
-        movzwl    expand_2na.0 at GOTOFF(%ebx,%eax,2), %eax        #4451.57
-        pinsrw    $7, %eax, %xmm0                               #4451.30
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.28:                        # Preds ..B9.27 ..B9.26
-        addl      $1, %edx                                      #4454.20
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.29:                        # Preds ..B9.25 ..B9.28 ..B9.33
-        movdqa    %xmm0, %xmm7                                  #4362.22
-        movdqa    %xmm0, %xmm6                                  #4363.22
-        pand      48(%esp), %xmm7                               #4362.22
-        pand      %xmm5, %xmm6                                  #4363.22
-        pcmpeqd   %xmm6, %xmm7                                  #4364.22
-        pmovmskb  %xmm7, %eax                                   #4365.22
-        movl      %eax, 104(%esp)                               #4365.22
-        jmp       ..B9.9        # Prob 100%                     #4365.22
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.31:                        # Preds ..B9.20 ..B9.22 ..B9.23 # Infreq
-        xorl      %eax, %eax                                    #4495.12
-        addl      $132, %esp                                    #4495.12
-        popl      %ebx                                          #4495.12
-        popl      %esi                                          #4495.12
-        popl      %edi                                          #4495.12
-        movl      %ebp, %esp                                    #4495.12
-        popl      %ebp                                          #4495.12
-        ret                                                     #4495.12
-                                # LOE
-..B9.33:                        # Preds ..B9.1                  # Infreq
-        movdqa    %xmm0, 80(%esp)                               #
-        movdqa    16(%esp), %xmm0                               #
-        movdqa    %xmm6, 64(%esp)                               #
-        movdqa    %xmm7, 48(%esp)                               #
-        movl      $2, %edi                                      #
-        jmp       ..B9.29       # Prob 100%                     #
-                                # LOE edx ecx ebx esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B9.34:                        # Preds ..B9.13 ..B9.19 ..B9.17 ..B9.15 # Infreq
-        movl      $1, %eax                                      #4428.63
-        addl      $132, %esp                                    #4428.63
-        popl      %ebx                                          #4428.63
-        popl      %esi                                          #4428.63
-        popl      %edi                                          #4428.63
-        movl      %ebp, %esp                                    #4428.63
-        popl      %ebp                                          #4428.63
-        ret                                                     #4428.63
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-	.data
-# -- End  eval_4na_32
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    2,0x90
-eval_4na_128:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B10.1:                        # Preds ..B10.0
-        pushl     %ebp                                          #4724.1
-        movl      %esp, %ebp                                    #4724.1
-        andl      $-16, %esp                                    #4724.1
-        pushl     %edi                                          #4724.1
-        pushl     %esi                                          #4724.1
-        pushl     %ebx                                          #4724.1
-        subl      $116, %esp                                    #4724.1
-        movl      20(%ebp), %esi                                #4722.5
-        movl      %ecx, 16(%esp)                                #4724.1
-        movdqa    16(%eax), %xmm5                               #4776.5
-        movdqa    32(%eax), %xmm4                               #4776.5
-        movdqa    48(%eax), %xmm3                               #4776.5
-        movdqa    64(%eax), %xmm2                               #4776.5
-        movdqa    80(%eax), %xmm1                               #4776.5
-        movdqa    96(%eax), %xmm6                               #4776.5
-        movdqa    128(%eax), %xmm7                              #4776.5
-        movl      %ecx, %edi                                    #4760.49
-        shrl      $2, %edi                                      #4760.49
-        call      ..L5          # Prob 100%                     #4724.1
-..L5:                                                           #
-        popl      %ebx                                          #4724.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L5], %ebx       #4724.1
-        movl      %ebx, 20(%esp)                                #4724.1
-        lea       (%ecx,%esi), %ebx                             #4757.5
-        lea       3(%ecx,%esi), %ecx                            #4766.50
-        subl      4(%eax), %ebx                                 #4763.12
-        movl      20(%esp), %esi                                #4769.14
-        movl      %ebx, 100(%esp)                               #4763.12
-        shrl      $2, %ecx                                      #4766.57
-        addl      %edx, %ecx                                    #4766.30
-        movl      %ecx, 96(%esp)                                #4766.30
-        movzbl    (%edi,%edx), %ecx                             #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, (%esp)                                   #4769.14
-        movzbl    1(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 2(%esp)                                  #4769.14
-        movzbl    2(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 4(%esp)                                  #4769.14
-        movzbl    3(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 6(%esp)                                  #4769.14
-        movzbl    4(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 8(%esp)                                  #4769.14
-        movzbl    5(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 10(%esp)                                 #4769.14
-        movzbl    6(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 12(%esp)                                 #4769.14
-        movzbl    7(%edi,%edx), %ecx                            #4769.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4769.14
-        movw      %cx, 14(%esp)                                 #4769.14
-        movdqu    (%esp), %xmm0                                 #4769.14
-        lea       8(%edx,%edi), %edx                            #4770.5
-        movdqa    %xmm0, 64(%esp)                               #4769.14
-        movdqa    112(%eax), %xmm0                              #4776.5
-        movl      %edx, %ecx                                    #4770.5
-        movl      16(%esp), %eax                                #4781.20
-        subl      %eax, %ebx                                    #4781.20
-        addl      $7, %ebx                                      #4781.33
-        shrl      $2, %ebx                                      #4781.40
-        movl      %eax, %edi                                    #4790.20
-        andl      $3, %edi                                      #4790.20
-        je        ..B10.32      # Prob 20%                      #4790.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.2:                        # Preds ..B10.1
-        cmpl      $1, %edi                                      #4790.20
-        je        ..B10.8       # Prob 25%                      #4790.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.3:                        # Preds ..B10.2
-        cmpl      $2, %edi                                      #4790.20
-        je        ..B10.7       # Prob 33%                      #4790.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.4:                        # Preds ..B10.3
-        cmpl      $3, %edi                                      #4790.20
-        je        ..B10.6       # Prob 50%                      #4790.20
-                                # LOE eax edx ecx ebx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B10.5:                        # Preds ..B10.4
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        movl      %ecx, 92(%esp)                                #
-        jmp       ..B10.16      # Prob 100%                     #
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.6:                        # Preds ..B10.4
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 80(%esp)                                #
-        movl      %ecx, 92(%esp)                                #
-        movl      %edi, 84(%esp)                                #
-        movl      %edi, 88(%esp)                                #
-        jmp       ..B10.11      # Prob 100%                     #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.7:                        # Preds ..B10.3
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 84(%esp)                                #
-        movl      %ecx, 92(%esp)                                #
-        movl      %edi, 88(%esp)                                #
-        jmp       ..B10.10      # Prob 100%                     #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.8:                        # Preds ..B10.2
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %ecx, 92(%esp)                                #
-        movl      %edi, 88(%esp)                                #
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.9:                        # Preds ..B10.8 ..B10.20
-        movdqa    %xmm0, %xmm7                                  #4814.22
-        movdqa    %xmm0, %xmm6                                  #4815.22
-        pand      %xmm3, %xmm7                                  #4814.22
-        pand      %xmm2, %xmm6                                  #4815.22
-        pcmpeqd   %xmm6, %xmm7                                  #4816.22
-        pmovmskb  %xmm7, %ecx                                   #4817.22
-        addl      $1, %ecx                                      #4818.17
-        shrl      $16, %ecx                                     #4818.17
-        negl      %ecx                                          #4818.17
-        movl      %ecx, 84(%esp)                                #4818.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.10:                       # Preds ..B10.7 ..B10.9
-        movdqa    %xmm0, %xmm7                                  #4821.22
-        movdqa    %xmm0, %xmm6                                  #4822.22
-        pand      48(%esp), %xmm6                               #4822.22
-        pand      %xmm1, %xmm7                                  #4821.22
-        pcmpeqd   %xmm6, %xmm7                                  #4823.22
-        pmovmskb  %xmm7, %ecx                                   #4824.22
-        addl      $1, %ecx                                      #4825.17
-        shrl      $16, %ecx                                     #4825.17
-        negl      %ecx                                          #4825.17
-        movl      %ecx, 80(%esp)                                #4825.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.11:                       # Preds ..B10.6 ..B10.10
-        movdqa    %xmm0, %xmm7                                  #4828.22
-        movdqa    %xmm0, %xmm6                                  #4829.22
-        movl      88(%esp), %edi                                #4839.29
-        pand      32(%esp), %xmm7                               #4828.22
-        pand      16(%esp), %xmm6                               #4829.22
-        pcmpeqd   %xmm6, %xmm7                                  #4830.22
-        pmovmskb  %xmm7, %ecx                                   #4831.22
-        andl      $-4, %eax                                     #4836.17
-        addl      $1, %ecx                                      #4832.17
-        orl       84(%esp), %edi                                #4839.29
-        orl       80(%esp), %edi                                #4839.34
-        shrl      $16, %ecx                                     #4832.17
-        negl      %ecx                                          #4832.17
-        orl       %ecx, %edi                                    #4839.39
-        jne       ..B10.21      # Prob 1%                       #4839.47
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.12:                       # Preds ..B10.11
-        movl      100(%esp), %ecx                               #4883.28
-        addl      $4, %eax                                      #4880.17
-        cmpl      %ecx, %eax                                    #4883.28
-        ja        ..B10.28      # Prob 1%                       #4883.28
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.13:                       # Preds ..B10.12
-        addl      $-1, %ebx                                     #4887.25
-        jne       ..B10.17      # Prob 50%                      #4887.39
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.14:                       # Preds ..B10.13
-        movl      96(%esp), %ecx                                #4904.25
-        cmpl      %ecx, %edx                                    #4904.25
-        jae       ..B10.28      # Prob 1%                       #4904.25
-                                # LOE eax edx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.15:                       # Preds ..B10.14
-        movzbl    (%edx), %ecx                                  #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ebx        #4914.22
-        movzbl    1(%edx), %edi                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edi,2), %ecx        #4914.22
-        movw      %bx, (%esp)                                   #4914.22
-        movw      %cx, 2(%esp)                                  #4914.22
-        movzbl    2(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        movw      %cx, 4(%esp)                                  #4914.22
-        movzbl    3(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        movw      %cx, 6(%esp)                                  #4914.22
-        movzbl    4(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        movw      %cx, 8(%esp)                                  #4914.22
-        movzbl    5(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        movw      %cx, 10(%esp)                                 #4914.22
-        movzbl    6(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        movw      %cx, 12(%esp)                                 #4914.22
-        movzbl    7(%edx), %ecx                                 #4914.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #4914.22
-        addl      $8, %edx                                      #4929.13
-        movw      %cx, 14(%esp)                                 #4914.22
-        movdqu    (%esp), %xmm0                                 #4914.22
-        movl      %edx, 92(%esp)                                #4929.13
-                                # LOE eax edx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.16:                       # Preds ..B10.5 ..B10.15
-        movl      $8, %ebx                                      #4797.13
-        jmp       ..B10.20      # Prob 100%                     #4797.13
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.17:                       # Preds ..B10.13
-        movl      96(%esp), %edi                                #4895.26
-        movl      92(%esp), %ecx                                #4895.26
-        psrldq    $2, %xmm0                                     #4892.26
-        cmpl      %edi, %ecx                                    #4895.26
-        jae       ..B10.19      # Prob 19%                      #4895.26
-                                # LOE eax edx ecx ebx esi cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.18:                       # Preds ..B10.17
-        movzbl    (%ecx), %edi                                  #4896.72
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edi,2), %ecx        #4896.57
-        pinsrw    $7, %ecx, %xmm0                               #4896.30
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.19:                       # Preds ..B10.18 ..B10.17
-        addl      $1, 92(%esp)                                  #4899.20
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.20:                       # Preds ..B10.16 ..B10.19 ..B10.32
-        movdqa    %xmm0, %xmm7                                  #4807.22
-        movdqa    %xmm0, %xmm6                                  #4808.22
-        pand      %xmm5, %xmm7                                  #4807.22
-        pand      %xmm4, %xmm6                                  #4808.22
-        pcmpeqd   %xmm6, %xmm7                                  #4809.22
-        pmovmskb  %xmm7, %ecx                                   #4810.22
-        addl      $1, %ecx                                      #4811.17
-        shrl      $16, %ecx                                     #4811.17
-        negl      %ecx                                          #4811.17
-        movl      %ecx, 88(%esp)                                #4811.17
-        jmp       ..B10.9       # Prob 100%                     #4811.17
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B10.21:                       # Preds ..B10.11                # Infreq
-        movl      88(%esp), %edi                                #
-        movl      100(%esp), %edx                               #4842.30
-        subl      %eax, %edx                                    #4842.30
-        movl      %edx, 100(%esp)                               #4842.30
-        cmpl      $2, %edx                                      #4842.37
-        je        ..B10.25      # Prob 25%                      #4842.37
-                                # LOE edx edi dl dh
-..B10.22:                       # Preds ..B10.21                # Infreq
-        movl      %edx, %eax                                    #4842.37
-        cmpl      $1, %eax                                      #4842.37
-        je        ..B10.26      # Prob 33%                      #4842.37
-                                # LOE eax edi al ah
-..B10.23:                       # Preds ..B10.22                # Infreq
-        testl     %eax, %eax                                    #4842.37
-        je        ..B10.27      # Prob 50%                      #4842.37
-                                # LOE edi
-..B10.24:                       # Preds ..B10.25 ..B10.26 ..B10.27 ..B10.23 # Infreq
-        movl      $1, %eax                                      #4845.32
-        addl      $116, %esp                                    #4845.32
-        popl      %ebx                                          #4845.32
-        popl      %esi                                          #4845.32
-        popl      %edi                                          #4845.32
-        movl      %ebp, %esp                                    #4845.32
-        popl      %ebp                                          #4845.32
-        ret                                                     #4845.32
-                                # LOE
-..B10.25:                       # Preds ..B10.21                # Infreq
-        movl      80(%esp), %eax                                #4847.36
-        testl     %eax, %eax                                    #4847.36
-        jne       ..B10.24      # Prob 28%                      #4847.36
-                                # LOE edi
-..B10.26:                       # Preds ..B10.25 ..B10.22       # Infreq
-        movl      84(%esp), %eax                                #4849.36
-        testl     %eax, %eax                                    #4849.36
-        jne       ..B10.24      # Prob 28%                      #4849.36
-                                # LOE edi
-..B10.27:                       # Preds ..B10.23 ..B10.26       # Infreq
-        testl     %edi, %edi                                    #4851.36
-        jne       ..B10.24      # Prob 28%                      #4851.36
-                                # LOE
-..B10.28:                       # Preds ..B10.14 ..B10.12 ..B10.27 # Infreq
-        xorl      %eax, %eax                                    #4853.28
-        addl      $116, %esp                                    #4853.28
-        popl      %ebx                                          #4853.28
-        popl      %esi                                          #4853.28
-        popl      %edi                                          #4853.28
-        movl      %ebp, %esp                                    #4853.28
-        popl      %ebp                                          #4853.28
-        ret                                                     #4853.28
-                                # LOE
-..B10.32:                       # Preds ..B10.1                 # Infreq
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        movl      %ecx, 92(%esp)                                #
-        jmp       ..B10.20      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE eax edx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-	.data
-# -- End  eval_4na_128
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    2,0x90
-eval_2na_pos:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B11.1:                        # Preds ..B11.0
-        pushl     %ebp                                          #3662.1
-        movl      %esp, %ebp                                    #3662.1
-        andl      $-16, %esp                                    #3662.1
-        pushl     %edi                                          #3662.1
-        pushl     %esi                                          #3662.1
-        pushl     %ebx                                          #3662.1
-        subl      $84, %esp                                     #3662.1
-        movl      20(%ebp), %edi                                #3660.5
-        movl      %ecx, 60(%esp)                                #3662.1
-        lea       (%ecx,%edi), %esi                             #3705.5
-        subl      4(%eax), %esi                                 #3716.12
-        movl      %ecx, %ebx                                    #3713.49
-        movl      %esi, 64(%esp)                                #3716.12
-        shrl      $2, %ebx                                      #3713.49
-        movl      %ebx, 72(%esp)                                #3713.49
-        lea       (%edx,%ebx), %ebx                             #3713.30
-        lea       3(%ecx,%edi), %esi                            #3719.50
-        shrl      $2, %esi                                      #3719.57
-        movl      72(%esp), %edi                                #3722.14
-        addl      %edx, %esi                                    #3719.30
-        testb     $15, %bl                                      #3722.14
-        jne       ..B11.3       # Prob 50%                      #3722.14
-                                # LOE eax edx ecx ebx esi edi cl ch
-..B11.2:                        # Preds ..B11.1
-        movdqa    (%ebx), %xmm0                                 #3722.14
-        movdqa    %xmm0, 32(%esp)                               #3722.14
-        jmp       ..B11.4       # Prob 100%                     #3722.14
-                                # LOE eax edx ecx esi edi cl ch
-..B11.3:                        # Preds ..B11.1
-        movdqu    (%ebx), %xmm0                                 #3722.14
-        movdqa    %xmm0, 32(%esp)                               #3722.14
-                                # LOE eax edx ecx esi edi cl ch
-..B11.4:                        # Preds ..B11.2 ..B11.3
-        lea       16(%edx,%edi), %ebx                           #3723.5
-        movl      %ebx, 68(%esp)                                #3723.5
-        cmpl      %esi, %ebx                                    #3728.16
-        jae       ..B11.6       # Prob 12%                      #3728.16
-                                # LOE eax ecx ebx esi cl bl ch bh
-..B11.5:                        # Preds ..B11.4
-        movzbl    -1(%ebx), %edx                                #3729.24
-        shll      $8, %edx                                      #3729.38
-        jmp       ..B11.7       # Prob 100%                     #3729.38
-                                # LOE eax edx ecx ebx esi cl bl ch bh
-..B11.6:                        # Preds ..B11.4
-        xorl      %edx, %edx                                    #
-                                # LOE eax edx ecx ebx esi cl bl ch bh
-..B11.7:                        # Preds ..B11.5 ..B11.6
-        movdqa    16(%eax), %xmm6                               #3733.5
-        movdqa    32(%eax), %xmm5                               #3733.5
-        movdqa    48(%eax), %xmm4                               #3733.5
-        movdqa    64(%eax), %xmm3                               #3733.5
-        movdqa    80(%eax), %xmm2                               #3733.5
-        movdqa    96(%eax), %xmm1                               #3733.5
-        movdqa    112(%eax), %xmm0                              #3733.5
-        movdqa    128(%eax), %xmm7                              #3733.5
-        movl      64(%esp), %eax                                #3738.20
-        subl      %ecx, %eax                                    #3738.20
-        addl      $7, %eax                                      #3738.33
-        shrl      $2, %eax                                      #3738.40
-        movl      %ecx, %edi                                    #3745.20
-        andl      $3, %edi                                      #3745.20
-        je        ..B11.55      # Prob 20%                      #3745.20
-                                # LOE eax edx ecx ebx esi edi cl bl ch bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.8:                        # Preds ..B11.7
-        cmpl      $1, %edi                                      #3745.20
-        je        ..B11.14      # Prob 25%                      #3745.20
-                                # LOE eax edx ecx ebx esi edi cl bl ch bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.9:                        # Preds ..B11.8
-        cmpl      $2, %edi                                      #3745.20
-        je        ..B11.13      # Prob 33%                      #3745.20
-                                # LOE eax edx ecx ebx esi edi cl bl ch bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.10:                       # Preds ..B11.9
-        cmpl      $3, %edi                                      #3745.20
-        je        ..B11.12      # Prob 50%                      #3745.20
-                                # LOE eax edx ecx ebx esi cl bl ch bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B11.11:                       # Preds ..B11.10
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 56(%esp)                                #
-        jmp       ..B11.26      # Prob 100%                     #
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.12:                       # Preds ..B11.10
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 56(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 48(%esp)                                #
-        movl      %edi, 52(%esp)                                #
-        movl      %edi, 72(%esp)                                #
-        jmp       ..B11.17      # Prob 100%                     #
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.13:                       # Preds ..B11.9
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 56(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 52(%esp)                                #
-        movl      %edi, 72(%esp)                                #
-        jmp       ..B11.16      # Prob 100%                     #
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.14:                       # Preds ..B11.8
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 56(%esp)                                #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 72(%esp)                                #
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.15:                       # Preds ..B11.14 ..B11.30
-        movdqa    %xmm0, %xmm7                                  #3768.22
-        pand      %xmm3, %xmm7                                  #3768.22
-        pcmpeqd   %xmm4, %xmm7                                  #3769.22
-        pmovmskb  %xmm7, %esi                                   #3770.22
-        addl      $1, %esi                                      #3771.17
-        shrl      $16, %esi                                     #3771.17
-        negl      %esi                                          #3771.17
-        movl      %esi, 52(%esp)                                #3771.17
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.16:                       # Preds ..B11.13 ..B11.15
-        movdqa    %xmm0, %xmm7                                  #3774.22
-        pand      %xmm1, %xmm7                                  #3774.22
-        pcmpeqd   %xmm2, %xmm7                                  #3775.22
-        pmovmskb  %xmm7, %esi                                   #3776.22
-        addl      $1, %esi                                      #3777.17
-        shrl      $16, %esi                                     #3777.17
-        negl      %esi                                          #3777.17
-        movl      %esi, 48(%esp)                                #3777.17
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.17:                       # Preds ..B11.12 ..B11.16
-        movdqa    %xmm0, %xmm7                                  #3780.22
-        movl      72(%esp), %edi                                #3790.29
-        pand      (%esp), %xmm7                                 #3780.22
-        pcmpeqd   16(%esp), %xmm7                               #3781.22
-        pmovmskb  %xmm7, %esi                                   #3782.22
-        andl      $-4, %ecx                                     #3787.17
-        orl       52(%esp), %edi                                #3790.29
-        addl      $1, %esi                                      #3783.17
-        orl       48(%esp), %edi                                #3790.34
-        shrl      $16, %esi                                     #3783.17
-        negl      %esi                                          #3783.17
-        orl       %esi, %edi                                    #3790.39
-        movl      %esi, 32(%esp)                                #3783.17
-        jne       ..B11.31      # Prob 1%                       #3790.47
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.18:                       # Preds ..B11.17
-        movl      64(%esp), %esi                                #3856.28
-        addl      $4, %ecx                                      #3853.17
-        cmpl      %esi, %ecx                                    #3856.28
-        ja        ..B11.53      # Prob 1%                       #3856.28
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.19:                       # Preds ..B11.18
-        addl      $-1, %eax                                     #3860.25
-        jne       ..B11.27      # Prob 50%                      #3860.39
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.20:                       # Preds ..B11.19
-        movl      56(%esp), %esi                                #3881.25
-        cmpl      %esi, %ebx                                    #3881.25
-        jae       ..B11.53      # Prob 1%                       #3881.25
-                                # LOE edx ecx ebx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.21:                       # Preds ..B11.20
-        testb     $15, %bl                                      #3891.22
-        jne       ..B11.23      # Prob 50%                      #3891.22
-                                # LOE edx ecx ebx esi xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.22:                       # Preds ..B11.21
-        movdqa    (%ebx), %xmm0                                 #3891.22
-        jmp       ..B11.24      # Prob 100%                     #3891.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.23:                       # Preds ..B11.21
-        movdqu    (%ebx), %xmm0                                 #3891.22
-                                # LOE edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.24:                       # Preds ..B11.22 ..B11.23
-        addl      $16, %ebx                                     #3969.13
-        movl      %ebx, 68(%esp)                                #3969.13
-        cmpl      %esi, %ebx                                    #3972.24
-        jae       ..B11.26      # Prob 12%                      #3972.24
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.25:                       # Preds ..B11.24
-        movzbl    -1(%ebx), %edx                                #3973.32
-        shll      $8, %edx                                      #3973.46
-                                # LOE edx ecx ebx bl bh xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.26:                       # Preds ..B11.24 ..B11.11 ..B11.25
-        movl      $16, %eax                                     #3752.13
-        jmp       ..B11.30      # Prob 100%                     #3752.13
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.27:                       # Preds ..B11.19
-        movl      68(%esp), %esi                                #3868.26
-        movl      56(%esp), %edi                                #3868.26
-        psrldq    $1, %xmm0                                     #3865.26
-        cmpl      %edi, %esi                                    #3868.26
-        jae       ..B11.29      # Prob 19%                      #3868.26
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.28:                       # Preds ..B11.27
-        movzbl    (%esi), %edi                                  #3871.37
-        sarl      $8, %edx                                      #3870.21
-        shll      $8, %edi                                      #3871.48
-        orl       %edi, %edx                                    #3871.21
-        pinsrw    $7, %edx, %xmm0                               #3872.30
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.29:                       # Preds ..B11.28 ..B11.27
-        addl      $1, 68(%esp)                                  #3876.20
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.30:                       # Preds ..B11.26 ..B11.29 ..B11.55
-        movdqa    %xmm0, %xmm7                                  #3762.22
-        pand      %xmm5, %xmm7                                  #3762.22
-        pcmpeqd   %xmm6, %xmm7                                  #3763.22
-        pmovmskb  %xmm7, %esi                                   #3764.22
-        addl      $1, %esi                                      #3765.17
-        shrl      $16, %esi                                     #3765.17
-        negl      %esi                                          #3765.17
-        movl      %esi, 72(%esp)                                #3765.17
-        jmp       ..B11.15      # Prob 100%                     #3765.17
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-..B11.31:                       # Preds ..B11.17                # Infreq
-        movl      %esi, %edx                                    #
-        movl      72(%esp), %edi                                #
-        movl      64(%esp), %ebx                                #3793.30
-        subl      %ecx, %ebx                                    #3793.30
-        movl      %ebx, 64(%esp)                                #3793.30
-        je        ..B11.52      # Prob 25%                      #3793.37
-                                # LOE edx ecx ebx edi dl bl dh bh
-..B11.32:                       # Preds ..B11.31                # Infreq
-        cmpl      $1, %ebx                                      #3793.37
-        jne       ..B11.37      # Prob 67%                      #3793.37
-                                # LOE edx ecx ebx edi dl bl dh bh
-..B11.33:                       # Preds ..B11.32                # Infreq
-        testl     %edi, %edi                                    #3799.36
-        jne       ..B11.36      # Prob 28%                      #3799.36
-                                # LOE ecx
-..B11.34:                       # Preds ..B11.33                # Infreq
-        movl      52(%esp), %edx                                #3800.36
-        testl     %edx, %edx                                    #3800.36
-        je        ..B11.53      # Prob 72%                      #3800.36
-                                # LOE ecx
-..B11.35:                       # Preds ..B11.45 ..B11.39 ..B11.34 # Infreq
-        subl      60(%esp), %ecx                                #3800.47
-        addl      $2, %ecx                                      #3800.61
-        movl      %ecx, %eax                                    #3800.61
-        addl      $84, %esp                                     #3800.61
-        popl      %ebx                                          #3800.61
-        popl      %esi                                          #3800.61
-        popl      %edi                                          #3800.61
-        movl      %ebp, %esp                                    #3800.61
-        popl      %ebp                                          #3800.61
-        ret                                                     #3800.61
-                                # LOE
-..B11.36:                       # Preds ..B11.52 ..B11.44 ..B11.38 ..B11.33 # Infreq
-        subl      60(%esp), %ecx                                #3799.47
-        addl      $1, %ecx                                      #3799.61
-        movl      %ecx, %eax                                    #3799.61
-        addl      $84, %esp                                     #3799.61
-        popl      %ebx                                          #3799.61
-        popl      %esi                                          #3799.61
-        popl      %edi                                          #3799.61
-        movl      %ebp, %esp                                    #3799.61
-        popl      %ebp                                          #3799.61
-        ret                                                     #3799.61
-                                # LOE
-..B11.37:                       # Preds ..B11.32                # Infreq
-        cmpl      $2, %ebx                                      #3793.37
-        jne       ..B11.44      # Prob 50%                      #3793.37
-                                # LOE edx ecx edi dl dh
-..B11.38:                       # Preds ..B11.37                # Infreq
-        testl     %edi, %edi                                    #3803.36
-        jne       ..B11.36      # Prob 28%                      #3803.36
-                                # LOE ecx
-..B11.39:                       # Preds ..B11.38                # Infreq
-        movl      52(%esp), %edx                                #3804.36
-        testl     %edx, %edx                                    #3804.36
-        jne       ..B11.35      # Prob 28%                      #3804.36
-                                # LOE ecx
-..B11.40:                       # Preds ..B11.39                # Infreq
-        movl      48(%esp), %edx                                #3805.36
-        testl     %edx, %edx                                    #3805.36
-        je        ..B11.53      # Prob 72%                      #3805.36
-                                # LOE ecx
-..B11.41:                       # Preds ..B11.46 ..B11.40       # Infreq
-        subl      60(%esp), %ecx                                #3805.47
-        addl      $3, %ecx                                      #3805.61
-        movl      %ecx, %eax                                    #3805.61
-        addl      $84, %esp                                     #3805.61
-        popl      %ebx                                          #3805.61
-        popl      %esi                                          #3805.61
-        popl      %edi                                          #3805.61
-        movl      %ebp, %esp                                    #3805.61
-        popl      %ebp                                          #3805.61
-        ret                                                     #3805.61
-                                # LOE
-..B11.44:                       # Preds ..B11.37                # Infreq
-        testl     %edi, %edi                                    #3808.36
-        jne       ..B11.36      # Prob 28%                      #3808.36
-                                # LOE edx ecx dl dh
-..B11.45:                       # Preds ..B11.44                # Infreq
-        movl      52(%esp), %ebx                                #3809.36
-        testl     %ebx, %ebx                                    #3809.36
-        jne       ..B11.35      # Prob 28%                      #3809.36
-                                # LOE edx ecx dl dh
-..B11.46:                       # Preds ..B11.45                # Infreq
-        movl      48(%esp), %ebx                                #3810.36
-        testl     %ebx, %ebx                                    #3810.36
-        jne       ..B11.41      # Prob 28%                      #3810.36
-                                # LOE edx ecx dl dh
-..B11.47:                       # Preds ..B11.46                # Infreq
-        testl     %edx, %edx                                    #3811.36
-        je        ..B11.53      # Prob 72%                      #3811.36
-                                # LOE ecx
-..B11.48:                       # Preds ..B11.47                # Infreq
-        subl      60(%esp), %ecx                                #3811.47
-        addl      $4, %ecx                                      #3811.61
-        movl      %ecx, %eax                                    #3811.61
-        addl      $84, %esp                                     #3811.61
-        popl      %ebx                                          #3811.61
-        popl      %esi                                          #3811.61
-        popl      %edi                                          #3811.61
-        movl      %ebp, %esp                                    #3811.61
-        popl      %ebp                                          #3811.61
-        ret                                                     #3811.61
-                                # LOE
-..B11.52:                       # Preds ..B11.31                # Infreq
-        testl     %edi, %edi                                    #3796.36
-        jne       ..B11.36      # Prob 28%                      #3796.36
-                                # LOE ecx
-..B11.53:                       # Preds ..B11.20 ..B11.18 ..B11.52 ..B11.34 ..B11.40
-                                #       ..B11.47                # Infreq
-        xorl      %eax, %eax                                    #3813.28
-        addl      $84, %esp                                     #3813.28
-        popl      %ebx                                          #3813.28
-        popl      %esi                                          #3813.28
-        popl      %edi                                          #3813.28
-        movl      %ebp, %esp                                    #3813.28
-        popl      %ebp                                          #3813.28
-        ret                                                     #3813.28
-                                # LOE
-..B11.55:                       # Preds ..B11.7                 # Infreq
-        movdqa    %xmm7, (%esp)                                 #
-        movdqa    %xmm0, 16(%esp)                               #
-        movdqa    32(%esp), %xmm0                               #
-        movl      %esi, 56(%esp)                                #
-        jmp       ..B11.30      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE eax edx ecx ebx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-	.data
-# -- End  eval_2na_pos
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    2,0x90
-eval_4na_pos:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B12.1:                        # Preds ..B12.0
-        pushl     %ebp                                          #4946.1
-        movl      %esp, %ebp                                    #4946.1
-        andl      $-16, %esp                                    #4946.1
-        pushl     %edi                                          #4946.1
-        pushl     %esi                                          #4946.1
-        pushl     %ebx                                          #4946.1
-        subl      $116, %esp                                    #4946.1
-        movl      20(%ebp), %esi                                #4944.5
-        movl      %ecx, 104(%esp)                               #4946.1
-        movl      %ecx, 92(%esp)                                #4946.1
-        movdqa    16(%eax), %xmm5                               #5009.5
-        movdqa    32(%eax), %xmm4                               #5009.5
-        movdqa    48(%eax), %xmm3                               #5009.5
-        movdqa    64(%eax), %xmm2                               #5009.5
-        movdqa    80(%eax), %xmm1                               #5009.5
-        movdqa    96(%eax), %xmm6                               #5009.5
-        movdqa    128(%eax), %xmm7                              #5009.5
-        movl      %ecx, %edi                                    #4993.49
-        shrl      $2, %edi                                      #4993.49
-        call      ..L6          # Prob 100%                     #4946.1
-..L6:                                                           #
-        popl      %ebx                                          #4946.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L6], %ebx       #4946.1
-        movl      %ebx, 16(%esp)                                #4946.1
-        lea       (%ecx,%esi), %ebx                             #4985.5
-        subl      4(%eax), %ebx                                 #4996.12
-        lea       3(%ecx,%esi), %ecx                            #4999.50
-        movl      16(%esp), %esi                                #5002.14
-        movl      %ebx, 100(%esp)                               #4996.12
-        shrl      $2, %ecx                                      #4999.57
-        addl      %edx, %ecx                                    #4999.30
-        movl      %ecx, 96(%esp)                                #4999.30
-        movzbl    (%edi,%edx), %ecx                             #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, (%esp)                                   #5002.14
-        movzbl    1(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 2(%esp)                                  #5002.14
-        movzbl    2(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 4(%esp)                                  #5002.14
-        movzbl    3(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 6(%esp)                                  #5002.14
-        movzbl    4(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 8(%esp)                                  #5002.14
-        movzbl    5(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 10(%esp)                                 #5002.14
-        movzbl    6(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 12(%esp)                                 #5002.14
-        movzbl    7(%edi,%edx), %ecx                            #5002.14
-        movzwl    expand_2na.0 at GOTOFF(%esi,%ecx,2), %ecx        #5002.14
-        movw      %cx, 14(%esp)                                 #5002.14
-        movdqu    (%esp), %xmm0                                 #5002.14
-        lea       8(%edx,%edi), %ecx                            #5003.5
-        movdqa    %xmm0, 64(%esp)                               #5002.14
-        movdqa    112(%eax), %xmm0                              #5009.5
-        movl      %ecx, %edx                                    #5003.5
-        movl      104(%esp), %eax                               #5014.20
-        subl      %eax, %ebx                                    #5014.20
-        addl      $7, %ebx                                      #5014.33
-        shrl      $2, %ebx                                      #5014.40
-        movl      %eax, %edi                                    #5023.20
-        andl      $3, %edi                                      #5023.20
-        je        ..B12.45      # Prob 20%                      #5023.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.2:                        # Preds ..B12.1
-        cmpl      $1, %edi                                      #5023.20
-        je        ..B12.8       # Prob 25%                      #5023.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.3:                        # Preds ..B12.2
-        cmpl      $2, %edi                                      #5023.20
-        je        ..B12.7       # Prob 33%                      #5023.20
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.4:                        # Preds ..B12.3
-        cmpl      $3, %edi                                      #5023.20
-        je        ..B12.6       # Prob 50%                      #5023.20
-                                # LOE eax edx ecx ebx esi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
-..B12.5:                        # Preds ..B12.4
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        jmp       ..B12.16      # Prob 100%                     #
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.6:                        # Preds ..B12.4
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 80(%esp)                                #
-        movl      %edi, 84(%esp)                                #
-        movl      %edi, 88(%esp)                                #
-        jmp       ..B12.11      # Prob 100%                     #
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.7:                        # Preds ..B12.3
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 84(%esp)                                #
-        movl      %edi, 88(%esp)                                #
-        jmp       ..B12.10      # Prob 100%                     #
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.8:                        # Preds ..B12.2
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        xorl      %edi, %edi                                    #
-        movl      %edi, 88(%esp)                                #
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.9:                        # Preds ..B12.8 ..B12.20
-        movdqa    %xmm0, %xmm7                                  #5047.22
-        movdqa    %xmm0, %xmm6                                  #5048.22
-        pand      %xmm3, %xmm7                                  #5047.22
-        pand      %xmm2, %xmm6                                  #5048.22
-        pcmpeqd   %xmm6, %xmm7                                  #5049.22
-        pmovmskb  %xmm7, %edi                                   #5050.22
-        addl      $1, %edi                                      #5051.17
-        shrl      $16, %edi                                     #5051.17
-        negl      %edi                                          #5051.17
-        movl      %edi, 84(%esp)                                #5051.17
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.10:                       # Preds ..B12.7 ..B12.9
-        movdqa    %xmm0, %xmm7                                  #5054.22
-        movdqa    %xmm0, %xmm6                                  #5055.22
-        pand      48(%esp), %xmm6                               #5055.22
-        pand      %xmm1, %xmm7                                  #5054.22
-        pcmpeqd   %xmm6, %xmm7                                  #5056.22
-        pmovmskb  %xmm7, %edi                                   #5057.22
-        addl      $1, %edi                                      #5058.17
-        shrl      $16, %edi                                     #5058.17
-        negl      %edi                                          #5058.17
-        movl      %edi, 80(%esp)                                #5058.17
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.11:                       # Preds ..B12.6 ..B12.10
-        movdqa    %xmm0, %xmm7                                  #5061.22
-        movdqa    %xmm0, %xmm6                                  #5062.22
-        pand      32(%esp), %xmm7                               #5061.22
-        pand      16(%esp), %xmm6                               #5062.22
-        pcmpeqd   %xmm6, %xmm7                                  #5063.22
-        pmovmskb  %xmm7, %edi                                   #5064.22
-        andl      $-4, %eax                                     #5069.17
-        movl      %eax, 104(%esp)                               #5069.17
-        addl      $1, %edi                                      #5065.17
-        shrl      $16, %edi                                     #5065.17
-        movl      88(%esp), %eax                                #5072.29
-        negl      %edi                                          #5065.17
-        movl      %edi, 64(%esp)                                #5065.17
-        orl       84(%esp), %eax                                #5072.29
-        orl       80(%esp), %eax                                #5072.34
-        orl       %edi, %eax                                    #5072.39
-        movl      104(%esp), %eax                               #5072.47
-        jne       ..B12.21      # Prob 1%                       #5072.47
-                                # LOE eax edx ecx ebx esi edi al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.12:                       # Preds ..B12.11
-        movl      100(%esp), %edi                               #5138.28
-        addl      $4, %eax                                      #5135.17
-        cmpl      %edi, %eax                                    #5138.28
-        ja        ..B12.43      # Prob 1%                       #5138.28
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.13:                       # Preds ..B12.12
-        addl      $-1, %ebx                                     #5142.25
-        jne       ..B12.17      # Prob 50%                      #5142.39
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.14:                       # Preds ..B12.13
-        movl      96(%esp), %edx                                #5159.25
-        cmpl      %edx, %ecx                                    #5159.25
-        jae       ..B12.43      # Prob 1%                       #5159.25
-                                # LOE eax ecx esi xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.15:                       # Preds ..B12.14
-        movzbl    (%ecx), %edx                                  #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %ebx        #5169.22
-        movzbl    1(%ecx), %edi                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edi,2), %edx        #5169.22
-        movw      %bx, (%esp)                                   #5169.22
-        movw      %dx, 2(%esp)                                  #5169.22
-        movzbl    2(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        movw      %dx, 4(%esp)                                  #5169.22
-        movzbl    3(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        movw      %dx, 6(%esp)                                  #5169.22
-        movzbl    4(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        movw      %dx, 8(%esp)                                  #5169.22
-        movzbl    5(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        movw      %dx, 10(%esp)                                 #5169.22
-        movzbl    6(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        movw      %dx, 12(%esp)                                 #5169.22
-        movzbl    7(%ecx), %edx                                 #5169.22
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edx,2), %edx        #5169.22
-        addl      $8, %ecx                                      #5184.13
-        movw      %dx, 14(%esp)                                 #5169.22
-        movdqu    (%esp), %xmm0                                 #5169.22
-        movl      %ecx, %edx                                    #5184.13
-                                # LOE eax edx ecx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.16:                       # Preds ..B12.5 ..B12.15
-        movl      $8, %ebx                                      #5030.13
-        jmp       ..B12.20      # Prob 100%                     #5030.13
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.17:                       # Preds ..B12.13
-        movl      96(%esp), %edi                                #5150.26
-        psrldq    $2, %xmm0                                     #5147.26
-        cmpl      %edi, %edx                                    #5150.26
-        jae       ..B12.19      # Prob 19%                      #5150.26
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.18:                       # Preds ..B12.17
-        movzbl    (%edx), %edi                                  #5151.72
-        movzwl    expand_2na.0 at GOTOFF(%esi,%edi,2), %edi        #5151.57
-        pinsrw    $7, %edi, %xmm0                               #5151.30
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.19:                       # Preds ..B12.18 ..B12.17
-        addl      $1, %edx                                      #5154.20
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.20:                       # Preds ..B12.16 ..B12.19 ..B12.45
-        movdqa    %xmm0, %xmm7                                  #5040.22
-        movdqa    %xmm0, %xmm6                                  #5041.22
-        pand      %xmm5, %xmm7                                  #5040.22
-        pand      %xmm4, %xmm6                                  #5041.22
-        pcmpeqd   %xmm6, %xmm7                                  #5042.22
-        pmovmskb  %xmm7, %edi                                   #5043.22
-        addl      $1, %edi                                      #5044.17
-        shrl      $16, %edi                                     #5044.17
-        negl      %edi                                          #5044.17
-        movl      %edi, 88(%esp)                                #5044.17
-        jmp       ..B12.9       # Prob 100%                     #5044.17
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-..B12.21:                       # Preds ..B12.11                # Infreq
-        movl      %edi, %edx                                    #
-        movl      88(%esp), %edi                                #
-        movl      100(%esp), %ecx                               #5075.30
-        subl      %eax, %ecx                                    #5075.30
-        movl      %ecx, 100(%esp)                               #5075.30
-        je        ..B12.42      # Prob 25%                      #5075.37
-                                # LOE eax edx ecx edi al dl cl ah dh ch
-..B12.22:                       # Preds ..B12.21                # Infreq
-        cmpl      $1, %ecx                                      #5075.37
-        jne       ..B12.27      # Prob 67%                      #5075.37
-                                # LOE eax edx ecx edi al dl cl ah dh ch
-..B12.23:                       # Preds ..B12.22                # Infreq
-        testl     %edi, %edi                                    #5081.36
-        jne       ..B12.26      # Prob 28%                      #5081.36
-                                # LOE eax al ah
-..B12.24:                       # Preds ..B12.23                # Infreq
-        movl      84(%esp), %edx                                #5082.36
-        testl     %edx, %edx                                    #5082.36
-        je        ..B12.43      # Prob 72%                      #5082.36
-                                # LOE eax al ah
-..B12.25:                       # Preds ..B12.35 ..B12.29 ..B12.24 # Infreq
-        subl      92(%esp), %eax                                #5082.47
-        addl      $2, %eax                                      #5082.61
-        addl      $116, %esp                                    #5082.61
-        popl      %ebx                                          #5082.61
-        popl      %esi                                          #5082.61
-        popl      %edi                                          #5082.61
-        movl      %ebp, %esp                                    #5082.61
-        popl      %ebp                                          #5082.61
-        ret                                                     #5082.61
-                                # LOE
-..B12.26:                       # Preds ..B12.42 ..B12.34 ..B12.28 ..B12.23 # Infreq
-        subl      92(%esp), %eax                                #5081.47
-        addl      $1, %eax                                      #5081.61
-        addl      $116, %esp                                    #5081.61
-        popl      %ebx                                          #5081.61
-        popl      %esi                                          #5081.61
-        popl      %edi                                          #5081.61
-        movl      %ebp, %esp                                    #5081.61
-        popl      %ebp                                          #5081.61
-        ret                                                     #5081.61
-                                # LOE
-..B12.27:                       # Preds ..B12.22                # Infreq
-        cmpl      $2, %ecx                                      #5075.37
-        jne       ..B12.34      # Prob 50%                      #5075.37
-                                # LOE eax edx edi al dl ah dh
-..B12.28:                       # Preds ..B12.27                # Infreq
-        testl     %edi, %edi                                    #5085.36
-        jne       ..B12.26      # Prob 28%                      #5085.36
-                                # LOE eax al ah
-..B12.29:                       # Preds ..B12.28                # Infreq
-        movl      84(%esp), %edx                                #5086.36
-        testl     %edx, %edx                                    #5086.36
-        jne       ..B12.25      # Prob 28%                      #5086.36
-                                # LOE eax al ah
-..B12.30:                       # Preds ..B12.29                # Infreq
-        movl      80(%esp), %edx                                #5087.36
-        testl     %edx, %edx                                    #5087.36
-        je        ..B12.43      # Prob 72%                      #5087.36
-                                # LOE eax al ah
-..B12.31:                       # Preds ..B12.36 ..B12.30       # Infreq
-        subl      92(%esp), %eax                                #5087.47
-        addl      $3, %eax                                      #5087.61
-        addl      $116, %esp                                    #5087.61
-        popl      %ebx                                          #5087.61
-        popl      %esi                                          #5087.61
-        popl      %edi                                          #5087.61
-        movl      %ebp, %esp                                    #5087.61
-        popl      %ebp                                          #5087.61
-        ret                                                     #5087.61
-                                # LOE
-..B12.34:                       # Preds ..B12.27                # Infreq
-        testl     %edi, %edi                                    #5090.36
-        jne       ..B12.26      # Prob 28%                      #5090.36
-                                # LOE eax edx al dl ah dh
-..B12.35:                       # Preds ..B12.34                # Infreq
-        movl      84(%esp), %ecx                                #5091.36
-        testl     %ecx, %ecx                                    #5091.36
-        jne       ..B12.25      # Prob 28%                      #5091.36
-                                # LOE eax edx al dl ah dh
-..B12.36:                       # Preds ..B12.35                # Infreq
-        movl      80(%esp), %ecx                                #5092.36
-        testl     %ecx, %ecx                                    #5092.36
-        jne       ..B12.31      # Prob 28%                      #5092.36
-                                # LOE eax edx al dl ah dh
-..B12.37:                       # Preds ..B12.36                # Infreq
-        testl     %edx, %edx                                    #5093.36
-        je        ..B12.43      # Prob 72%                      #5093.36
-                                # LOE eax al ah
-..B12.38:                       # Preds ..B12.37                # Infreq
-        subl      92(%esp), %eax                                #5093.47
-        addl      $4, %eax                                      #5093.61
-        addl      $116, %esp                                    #5093.61
-        popl      %ebx                                          #5093.61
-        popl      %esi                                          #5093.61
-        popl      %edi                                          #5093.61
-        movl      %ebp, %esp                                    #5093.61
-        popl      %ebp                                          #5093.61
-        ret                                                     #5093.61
-                                # LOE
-..B12.42:                       # Preds ..B12.21                # Infreq
-        testl     %edi, %edi                                    #5078.36
-        jne       ..B12.26      # Prob 28%                      #5078.36
-                                # LOE eax al ah
-..B12.43:                       # Preds ..B12.14 ..B12.12 ..B12.42 ..B12.24 ..B12.30
-                                #       ..B12.37                # Infreq
-        xorl      %eax, %eax                                    #5095.28
-        addl      $116, %esp                                    #5095.28
-        popl      %ebx                                          #5095.28
-        popl      %esi                                          #5095.28
-        popl      %edi                                          #5095.28
-        movl      %ebp, %esp                                    #5095.28
-        popl      %ebp                                          #5095.28
-        ret                                                     #5095.28
-                                # LOE
-..B12.45:                       # Preds ..B12.1                 # Infreq
-        movdqa    %xmm7, 16(%esp)                               #
-        movdqa    %xmm0, 32(%esp)                               #
-        movdqa    64(%esp), %xmm0                               #
-        movdqa    %xmm6, 48(%esp)                               #
-        jmp       ..B12.20      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE eax edx ecx ebx esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-	.data
-# -- End  eval_4na_pos
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1: 44 + %esp
-# parameter 2: 48 + %esp
-# parameter 3: 52 + %esp
-# parameter 4: 56 + %esp
-..B13.1:                        # Preds ..B13.0
-        pushl     %edi                                          #1539.1
-        pushl     %esi                                          #1539.1
-        pushl     %ebp                                          #1539.1
-        pushl     %ebx                                          #1539.1
-        subl      $24, %esp                                     #1539.1
-        movl      44(%esp), %esi                                #1537.5
-        testl     %esi, %esi                                    #1540.17
-        movl      52(%esp), %ebp                                #1537.5
-        movl      56(%esp), %edi                                #1537.5
-        je        ..B13.12      # Prob 6%                       #1540.17
-                                # LOE ebp esi edi
-..B13.2:                        # Preds ..B13.1
-        testl     %ebp, %ebp                                    #1542.23
-        je        ..B13.11      # Prob 12%                      #1542.23
-                                # LOE ebp esi edi
-..B13.3:                        # Preds ..B13.2
-        testl     %edi, %edi                                    #1542.38
-        je        ..B13.11      # Prob 50%                      #1542.38
-                                # LOE ebp esi edi
-..B13.4:                        # Preds ..B13.3
-        movl      $0, 20(%esp)                                  #1544.24
-        call      ..L7          # Prob 100%                     #
-..L7:                                                           #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L7], %ebx       #
-        movsbl    fasta_2na_map.0 at GOTOFF(%ebx), %eax            #1547.18
-        testl     %eax, %eax                                    #1547.41
-        je        ..B13.13      # Prob 5%                       #1547.41
-                                # LOE ebx ebp esi edi
-..B13.5:                        # Preds ..B13.13 ..B13.4
-        lea       20(%esp), %eax                                #1551.49
-        movl      %eax, 12(%esp)                                #1551.49
-        movl      48(%esp), %eax                                #1539.1
-        lea       (%edi,%ebp), %edi                             #1550.19
-        movl      %edi, %edx                                    #1551.21
-        movl      %eax, 16(%esp)                                #1539.1
-        movl      %ebp, %eax                                    #1551.21
-        movl      %esi, %ecx                                    #1551.21
-        call      nss_expr                                      #1551.21
-                                # LOE eax ebx esi edi
-..B13.6:                        # Preds ..B13.5
-        movl      20(%esp), %edx                                #1552.18
-        testl     %edx, %edx                                    #1552.28
-        jne       ..B13.9       # Prob 22%                      #1552.28
-                                # LOE eax ebx esi edi
-..B13.7:                        # Preds ..B13.6
-        cmpl      %edi, %eax                                    #1554.31
-        je        ..B13.14      # Prob 5%                       #1554.31
-                                # LOE ebx esi
-..B13.8:                        # Preds ..B13.7
-        movl      $22, 20(%esp)                                 #1557.17
-                                # LOE ebx esi
-..B13.9:                        # Preds ..B13.8 ..B13.6
-        pushl     (%esi)                                        #1560.32
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE esi
-..B13.10:                       # Preds ..B13.9
-        movl      24(%esp), %eax                                #1562.20
-        movl      $0, (%esi)                                    #1561.13
-        addl      $28, %esp                                     #1562.20
-        popl      %ebx                                          #1562.20
-        popl      %ebp                                          #1562.20
-        popl      %esi                                          #1562.20
-        popl      %edi                                          #1562.20
-        ret                                                     #1562.20
-                                # LOE
-..B13.11:                       # Preds ..B13.3 ..B13.2
-        movl      $0, (%esi)                                    #1565.9
-                                # LOE
-..B13.12:                       # Preds ..B13.11 ..B13.1
-        movl      $22, %eax                                     #1567.12
-        addl      $24, %esp                                     #1567.12
-        popl      %ebx                                          #1567.12
-        popl      %ebp                                          #1567.12
-        popl      %esi                                          #1567.12
-        popl      %edi                                          #1567.12
-        ret                                                     #1567.12
-                                # LOE
-..B13.13:                       # Preds ..B13.4                 # Infreq
-        call      NucStrstrInit                                 #1548.17
-        jmp       ..B13.5       # Prob 100%                     #1548.17
-                                # LOE ebx ebp esi edi
-..B13.14:                       # Preds ..B13.7                 # Infreq
-        xorl      %eax, %eax                                    #1555.28
-        addl      $24, %esp                                     #1555.28
-        popl      %ebx                                          #1555.28
-        popl      %ebp                                          #1555.28
-        popl      %esi                                          #1555.28
-        popl      %edi                                          #1555.28
-        ret                                                     #1555.28
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    2,0x90
-nss_expr:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 68 + %esp
-# parameter 5: 72 + %esp
-..B14.1:                        # Preds ..B14.0
-        pushl     %edi                                          #1406.1
-        pushl     %esi                                          #1406.1
-        pushl     %ebp                                          #1406.1
-        pushl     %ebx                                          #1406.1
-        subl      $36, %esp                                     #1406.1
-        movl      %ecx, %edi                                    #1406.1
-        movl      %edx, %esi                                    #1406.1
-        movl      %eax, %ebp                                    #1406.1
-        call      ..L8          # Prob 100%                     #1406.1
-..L8:                                                           #
-        popl      %ebx                                          #1406.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L8], %ebx       #1406.1
-        call      __ctype_b_loc at PLT                             #1409.9
-                                # LOE eax ebx ebp esi edi
-..B14.41:                       # Preds ..B14.1
-        movl      %ebx, 28(%esp)                                #1409.9
-        movl      %eax, 32(%esp)                                #1409.9
-        movl      %ebp, %edx                                    #1409.9
-        movl      68(%esp), %ebp                                #1409.9
-        jmp       ..B14.2       # Prob 100%                     #1409.9
-                                # LOE edx ebp esi edi
-..B14.29:                       # Preds ..B14.28
-        movl      20(%esp), %ecx                                #1459.17
-        movl      $11, (%eax)                                   #1458.17
-        movl      %ecx, 4(%eax)                                 #1459.17
-        movl      (%edi), %ebx                                  #1460.41
-        movl      %ebx, 8(%eax)                                 #1460.17
-        movl      %eax, (%edi)                                  #1461.17
-        lea       12(%eax), %edi                                #1464.42
-                                # LOE edx ebp esi edi
-..B14.2:                        # Preds ..B14.41 ..B14.29
-        movl      $0, (%edi)                                    #1407.5
-        cmpl      %esi, %edx                                    #1409.9
-        jae       ..B14.8       # Prob 12%                      #1409.9
-                                # LOE edx ebp esi edi
-..B14.3:                        # Preds ..B14.2
-        movl      32(%esp), %ecx                                #1409.9
-        movl      (%ecx), %ecx                                  #1409.9
-        movzbl    (%edx), %ebx                                  #1409.9
-        movzwl    (%ecx,%ebx,2), %ebx                           #1409.9
-        testl     $8192, %ebx                                   #1409.9
-        je        ..B14.8       # Prob 15%                      #1409.9
-                                # LOE edx ecx ebp esi edi
-..B14.5:                        # Preds ..B14.3 ..B14.6
-        addl      $1, %edx                                      #1409.9
-        cmpl      %esi, %edx                                    #1409.9
-        jae       ..B14.8       # Prob 1%                       #1409.9
-                                # LOE edx ecx ebp esi edi
-..B14.6:                        # Preds ..B14.5
-        movzbl    (%edx), %ebx                                  #1409.9
-        movzwl    (%ecx,%ebx,2), %ebx                           #1409.9
-        testl     $8192, %ebx                                   #1409.9
-        jne       ..B14.5       # Prob 82%                      #1409.9
-                                # LOE edx ecx ebp esi edi
-..B14.8:                        # Preds ..B14.5 ..B14.6 ..B14.3 ..B14.2
-        cmpl      %esi, %edx                                    #1410.15
-        je        ..B14.32      # Prob 16%                      #1410.15
-                                # LOE edx ebp esi edi
-..B14.9:                        # Preds ..B14.8
-        movl      72(%esp), %ebx                                #1406.1
-        movl      %ebp, 12(%esp)                                #1406.1
-        movl      %ebx, 16(%esp)                                #1406.1
-        movl      %edx, %eax                                    #1412.13
-        movl      %esi, %edx                                    #1412.13
-        movl      %edi, %ecx                                    #1412.13
-        call      nss_unary_expr                                #1412.13
-                                # LOE eax ebp esi edi
-..B14.42:                       # Preds ..B14.9
-        movl      %eax, %edx                                    #1412.13
-                                # LOE edx ebp esi edi
-..B14.10:                       # Preds ..B14.42
-        movl      (%ebp), %ecx                                  #1413.16
-        testl     %ecx, %ecx                                    #1413.26
-        jne       ..B14.32      # Prob 58%                      #1413.26
-                                # LOE edx ebp esi edi
-..B14.11:                       # Preds ..B14.10
-        cmpl      %esi, %edx                                    #1415.17
-        jae       ..B14.17      # Prob 12%                      #1415.17
-                                # LOE edx ebp esi edi
-..B14.12:                       # Preds ..B14.11
-        movl      32(%esp), %ecx                                #1415.17
-        movl      (%ecx), %ecx                                  #1415.17
-        movzbl    (%edx), %ebx                                  #1415.17
-        movzwl    (%ecx,%ebx,2), %ebx                           #1415.17
-        testl     $8192, %ebx                                   #1415.17
-        je        ..B14.17      # Prob 15%                      #1415.17
-                                # LOE edx ecx ebp esi edi
-..B14.14:                       # Preds ..B14.12 ..B14.15
-        addl      $1, %edx                                      #1415.17
-        cmpl      %esi, %edx                                    #1415.17
-        jae       ..B14.17      # Prob 1%                       #1415.17
-                                # LOE edx ecx ebp esi edi
-..B14.15:                       # Preds ..B14.14
-        movzbl    (%edx), %ebx                                  #1415.17
-        movzwl    (%ecx,%ebx,2), %ebx                           #1415.17
-        testl     $8192, %ebx                                   #1415.17
-        jne       ..B14.14      # Prob 82%                      #1415.17
-                                # LOE edx ecx ebp esi edi
-..B14.17:                       # Preds ..B14.14 ..B14.15 ..B14.12 ..B14.11
-        cmpl      %esi, %edx                                    #1416.23
-        je        ..B14.32      # Prob 4%                       #1416.23
-                                # LOE edx ebp esi edi
-..B14.18:                       # Preds ..B14.17
-        movsbl    (%edx), %ecx                                  #1422.28
-        addl      $1, %edx                                      #1422.28
-        cmpl      $41, %ecx                                     #1422.28
-        je        ..B14.31      # Prob 25%                      #1422.28
-                                # LOE edx ecx ebp esi edi
-..B14.19:                       # Preds ..B14.18
-        cmpl      $38, %ecx                                     #1422.28
-        jne       ..B14.23      # Prob 67%                      #1422.28
-                                # LOE edx ecx ebp esi edi
-..B14.20:                       # Preds ..B14.19
-        cmpl      %esi, %edx                                    #1427.30
-        jae       ..B14.22      # Prob 12%                      #1427.30
-                                # LOE edx ebp esi edi
-..B14.21:                       # Preds ..B14.20
-        movsbl    (%edx), %ecx                                  #1427.39
-        lea       1(%edx), %ebx                                 #1428.28
-        cmpl      $38, %ecx                                     #1428.28
-        cmove     %ebx, %edx                                    #1428.28
-                                # LOE edx ebp esi edi
-..B14.22:                       # Preds ..B14.21 ..B14.20
-        movl      $16, %ecx                                     #1429.21
-        movl      %ecx, 20(%esp)                                #1429.21
-        jmp       ..B14.27      # Prob 100%                     #1429.21
-                                # LOE edx ebp esi edi
-..B14.23:                       # Preds ..B14.19
-        cmpl      $124, %ecx                                    #1422.28
-        jne       ..B14.30      # Prob 50%                      #1422.28
-                                # LOE edx ebp esi edi
-..B14.24:                       # Preds ..B14.23
-        cmpl      %esi, %edx                                    #1432.30
-        jae       ..B14.26      # Prob 12%                      #1432.30
-                                # LOE edx ebp esi edi
-..B14.25:                       # Preds ..B14.24
-        movsbl    (%edx), %ecx                                  #1432.39
-        lea       1(%edx), %ebx                                 #1433.28
-        cmpl      $124, %ecx                                    #1433.28
-        cmove     %ebx, %edx                                    #1433.28
-                                # LOE edx ebp esi edi
-..B14.26:                       # Preds ..B14.25 ..B14.24
-        movl      $17, %ecx                                     #1434.21
-        movl      %ecx, 20(%esp)                                #1434.21
-                                # LOE edx ebp esi edi
-..B14.27:                       # Preds ..B14.22 ..B14.26
-        pushl     $16                                           #1451.30
-        movl      32(%esp), %ebx                                #1451.21
-        movl      %edx, 28(%esp)                                #1451.21
-        call      malloc at PLT                                    #1451.21
-                                # LOE eax ebp esi edi
-..B14.43:                       # Preds ..B14.27
-        movl      28(%esp), %edx                                #
-        addl      $4, %esp                                      #1451.21
-                                # LOE eax edx ebp esi edi dl dh
-..B14.28:                       # Preds ..B14.43
-        testl     %eax, %eax                                    #1452.27
-        je        ..B14.38      # Prob 1%                       #1452.27
-        jmp       ..B14.29      # Prob 100%                     #1452.27
-                                # LOE eax edx ebp esi edi dl dh
-..B14.30:                       # Preds ..B14.23
-        movl      68(%esp), %ecx                                #1438.21
-        movl      $22, (%ecx)                                   #1438.21
-        movl      %edx, %ebp                                    #
-        addl      $-1, %ebp                                     #1439.32
-        movl      %ebp, %eax                                    #1439.32
-        addl      $36, %esp                                     #1439.32
-        popl      %ebx                                          #1439.32
-        popl      %ebp                                          #1439.32
-        popl      %esi                                          #1439.32
-        popl      %edi                                          #1439.32
-        ret                                                     #1439.32
-                                # LOE
-..B14.31:                       # Preds ..B14.18
-        movl      %edx, %ebp                                    #
-        addl      $-1, %ebp                                     #1425.32
-        movl      %ebp, %eax                                    #1425.32
-        addl      $36, %esp                                     #1425.32
-        popl      %ebx                                          #1425.32
-        popl      %ebp                                          #1425.32
-        popl      %esi                                          #1425.32
-        popl      %edi                                          #1425.32
-        ret                                                     #1425.32
-                                # LOE
-..B14.32:                       # Preds ..B14.8 ..B14.17 ..B14.10
-        movl      %edx, %ebp                                    #
-                                # LOE ebp
-..B14.33:                       # Preds ..B14.32
-        movl      %ebp, %eax                                    #1470.12
-        addl      $36, %esp                                     #1470.12
-        popl      %ebx                                          #1470.12
-        popl      %ebp                                          #1470.12
-        popl      %esi                                          #1470.12
-        popl      %edi                                          #1470.12
-        ret                                                     #1470.12
-                                # LOE
-..B14.38:                       # Preds ..B14.28                # Infreq
-        movl      28(%esp), %ebx                                #
-        movl      %edx, %ebp                                    #
-        call      __errno_location at PLT                          #1454.32
-                                # LOE eax ebp
-..B14.44:                       # Preds ..B14.38                # Infreq
-        movl      68(%esp), %ebx                                #1454.21
-        movl      (%eax), %ecx                                  #1454.32
-        movl      %ecx, (%ebx)                                  #1454.21
-        movl      %ebp, %eax                                    #1451.21
-        addl      $36, %esp                                     #1455.28
-        popl      %ebx                                          #1455.28
-        popl      %ebp                                          #1455.28
-        popl      %esi                                          #1455.28
-        popl      %edi                                          #1455.28
-        ret                                                     #1455.28
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-	.data
-# -- End  nss_expr
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    2,0x90
-nss_unary_expr:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 56 + %esp
-# parameter 5: 60 + %esp
-..B15.1:                        # Preds ..B15.0
-        pushl     %edi                                          #1361.1
-        pushl     %esi                                          #1361.1
-        pushl     %ebp                                          #1361.1
-        pushl     %ebx                                          #1361.1
-        subl      $24, %esp                                     #1361.1
-        movl      %ecx, %edi                                    #1361.1
-        movl      %edx, %esi                                    #1361.1
-        movl      %eax, %ebp                                    #1361.1
-        call      ..L9          # Prob 100%                     #1361.1
-..L9:                                                           #
-        popl      %ebx                                          #1361.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L9], %ebx       #1361.1
-        jmp       ..B15.2       # Prob 100%                     #1361.1
-                                # LOE ebx ebp esi edi
-..B15.43:                       # Preds ..B15.42
-        movl      $12, (%eax)                                   #1384.13
-        movl      $13, 4(%eax)                                  #1385.13
-        movl      $0, 8(%eax)                                   #1386.13
-        movl      %eax, (%edi)                                  #1387.13
-        lea       8(%eax), %edi                                 #1389.44
-                                # LOE ebx ebp esi edi
-..B15.2:                        # Preds ..B15.43 ..B15.1
-        movsbl    (%ebp), %eax                                  #1363.12
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B15.32      # Prob 16%                      #1363.17
-                                # LOE eax ebx ebp esi edi
-..B15.3:                        # Preds ..B15.2
-        cmpl      $94, %eax                                     #1364.16
-        jne       ..B15.10      # Prob 67%                      #1364.16
-                                # LOE eax ebx ebp esi edi
-..B15.4:                        # Preds ..B15.3
-        pushl     $12                                           #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx ebp esi edi
-..B15.48:                       # Preds ..B15.4
-        popl      %ecx                                          #1364.16
-        movl      %eax, %ecx                                    #1364.16
-                                # LOE ecx ebx ebp esi edi
-..B15.5:                        # Preds ..B15.48
-        testl     %ecx, %ecx                                    #1364.16
-        jne       ..B15.7       # Prob 68%                      #1364.16
-                                # LOE ecx ebx ebp esi edi
-..B15.6:                        # Preds ..B15.5
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax ebp
-..B15.49:                       # Preds ..B15.6
-        movl      56(%esp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.7:                        # Preds ..B15.5
-        movl      $12, (%ecx)                                   #1364.16
-        movl      %ecx, 20(%esp)                                #1364.16
-        movl      %ecx, (%edi)                                  #1364.16
-        addl      $1, %ebp                                      #1364.16
-        movl      $14, 4(%ecx)                                  #1364.16
-        movl      %ebp, %eax                                    #1364.16
-        movl      %esi, %edx                                    #1364.16
-        movl      $0, 8(%ecx)                                   #1364.16
-        call      nss_sob                                       #1364.16
-                                # LOE eax esi
-..B15.50:                       # Preds ..B15.7
-        movl      20(%esp), %ecx                                #
-        movl      56(%esp), %ebx                                #1361.1
-        movl      60(%esp), %ebp                                #1361.1
-        movl      %ebx, 12(%esp)                                #1361.1
-        movl      %ebp, 16(%esp)                                #1361.1
-        addl      $8, %ecx                                      #1364.16
-        movl      %esi, %edx                                    #1364.16
-        call      nss_fasta_expr                                #1364.16
-                                # LOE eax
-..B15.51:                       # Preds ..B15.50
-        movl      %eax, %ebp                                    #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.10:                       # Preds ..B15.3
-        cmpl      $40, %eax                                     #1364.16
-        jne       ..B15.21      # Prob 50%                      #1364.16
-                                # LOE ebx ebp esi edi
-..B15.11:                       # Preds ..B15.10
-        pushl     $12                                           #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx ebp esi edi
-..B15.52:                       # Preds ..B15.11
-        popl      %ecx                                          #1364.16
-        movl      %eax, 20(%esp)                                #1364.16
-                                # LOE eax ebx ebp esi edi al ah
-..B15.12:                       # Preds ..B15.52
-        testl     %eax, %eax                                    #1364.16
-        jne       ..B15.14      # Prob 68%                      #1364.16
-                                # LOE eax ebx ebp esi edi al ah
-..B15.13:                       # Preds ..B15.12
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax ebp
-..B15.53:                       # Preds ..B15.13
-        movl      56(%esp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.14:                       # Preds ..B15.12
-        movl      %eax, %ebx                                    #1364.16
-        movl      60(%esp), %eax                                #1361.1
-        movl      $12, (%ebx)                                   #1364.16
-        movl      %ebx, (%edi)                                  #1364.16
-        movl      56(%esp), %edi                                #1361.1
-        movl      $0, 4(%ebx)                                   #1364.16
-        addl      $1, %ebp                                      #1364.16
-        lea       8(%ebx), %ecx                                 #1364.16
-        movl      %edi, 12(%esp)                                #1361.1
-        movl      %eax, 16(%esp)                                #1361.1
-        movl      %ebp, %eax                                    #1364.16
-        movl      %esi, %edx                                    #1364.16
-        call      nss_expr                                      #1364.16
-                                # LOE eax ebx esi bl bh
-..B15.54:                       # Preds ..B15.14
-        movl      %eax, %ebp                                    #1364.16
-                                # LOE ebx ebp esi bl bh
-..B15.15:                       # Preds ..B15.54
-        movl      56(%esp), %eax                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.27      # Prob 50%                      #1364.16
-                                # LOE ebx ebp esi bl bh
-..B15.16:                       # Preds ..B15.15
-        movl      %ebx, %eax                                    #1364.16
-        movl      8(%eax), %edx                                 #1364.16
-        testl     %edx, %edx                                    #1364.16
-        je        ..B15.19      # Prob 12%                      #1364.16
-                                # LOE ebp esi
-..B15.17:                       # Preds ..B15.16
-        cmpl      %esi, %ebp                                    #1364.16
-        je        ..B15.19      # Prob 12%                      #1364.16
-                                # LOE ebp
-..B15.18:                       # Preds ..B15.17
-        movsbl    (%ebp), %eax                                  #1364.16
-        addl      $1, %ebp                                      #1364.16
-        cmpl      $41, %eax                                     #1364.16
-        je        ..B15.27      # Prob 50%                      #1364.16
-                                # LOE ebp
-..B15.19:                       # Preds ..B15.18 ..B15.17 ..B15.16
-        movl      56(%esp), %eax                                #1364.16
-        movl      $22, (%eax)                                   #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.21:                       # Preds ..B15.10
-        movl      56(%esp), %eax                                #1361.1
-        movl      %eax, 12(%esp)                                #1361.1
-        movl      60(%esp), %eax                                #1361.1
-        movl      %esi, %edx                                    #1364.16
-        movl      %edi, %ecx                                    #1364.16
-        movl      %eax, 16(%esp)                                #1361.1
-        movl      %ebp, %eax                                    #1364.16
-        call      nss_fasta_expr                                #1364.16
-                                # LOE eax ebx esi edi
-..B15.55:                       # Preds ..B15.21
-        movl      %eax, %ebp                                    #1364.16
-                                # LOE ebx ebp esi edi
-..B15.22:                       # Preds ..B15.55
-        movl      56(%esp), %eax                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.27      # Prob 50%                      #1364.16
-                                # LOE ebx ebp esi edi
-..B15.23:                       # Preds ..B15.22
-        cmpl      %esi, %ebp                                    #1364.16
-        jae       ..B15.27      # Prob 33%                      #1364.16
-                                # LOE ebx ebp esi edi
-..B15.24:                       # Preds ..B15.23
-        movl      %ebp, %eax                                    #1364.16
-        movl      %esi, %edx                                    #1364.16
-        call      nss_sob                                       #1364.16
-                                # LOE eax ebx esi edi
-..B15.56:                       # Preds ..B15.24
-        movl      %eax, %ebp                                    #1364.16
-        cmpl      %esi, %ebp                                    #1364.16
-        jae       ..B15.27      # Prob 12%                      #1364.16
-                                # LOE ebx ebp edi
-..B15.25:                       # Preds ..B15.56
-        movsbl    (%ebp), %eax                                  #1364.16
-        cmpl      $36, %eax                                     #1364.16
-        je        ..B15.28      # Prob 5%                       #1364.16
-                                # LOE ebx ebp edi
-..B15.27:                       # Preds ..B15.22 ..B15.23 ..B15.25 ..B15.30 ..B15.56
-                                #       ..B15.58 ..B15.15 ..B15.19 ..B15.18 ..B15.53
-                                #       ..B15.49 ..B15.51
-        movl      %ebp, %eax                                    #1364.16
-        addl      $24, %esp                                     #1364.16
-        popl      %ebx                                          #1364.16
-        popl      %ebp                                          #1364.16
-        popl      %esi                                          #1364.16
-        popl      %edi                                          #1364.16
-        ret                                                     #1364.16
-                                # LOE
-..B15.28:                       # Preds ..B15.25                # Infreq
-        pushl     $12                                           #1364.16
-        addl      $1, %ebp                                      #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE eax ebx ebp edi
-..B15.57:                       # Preds ..B15.28                # Infreq
-        popl      %ecx                                          #1364.16
-                                # LOE eax ebx ebp edi
-..B15.29:                       # Preds ..B15.57                # Infreq
-        testl     %eax, %eax                                    #1364.16
-        je        ..B15.31      # Prob 12%                      #1364.16
-                                # LOE eax ebx ebp edi
-..B15.30:                       # Preds ..B15.29                # Infreq
-        movl      (%edi), %edx                                  #1364.16
-        movl      $12, (%eax)                                   #1364.16
-        movl      %edx, 8(%eax)                                 #1364.16
-        movl      %eax, (%edi)                                  #1364.16
-        movl      $15, 4(%eax)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.31:                       # Preds ..B15.29                # Infreq
-        call      __errno_location at PLT                          #1364.16
-                                # LOE eax ebp
-..B15.58:                       # Preds ..B15.31                # Infreq
-        movl      56(%esp), %ecx                                #1364.16
-        movl      (%eax), %edx                                  #1364.16
-        movl      %edx, (%ecx)                                  #1364.16
-        jmp       ..B15.27      # Prob 100%                     #1364.16
-                                # LOE ebp
-..B15.32:                       # Preds ..B15.2                 # Infreq
-        addl      $1, %ebp                                      #1374.19
-        cmpl      %esi, %ebp                                    #1374.9
-        jae       ..B15.38      # Prob 12%                      #1374.9
-                                # LOE ebx ebp esi edi
-..B15.33:                       # Preds ..B15.32                # Infreq
-        call      __ctype_b_loc at PLT                             #1374.9
-                                # LOE eax ebx ebp esi edi
-..B15.59:                       # Preds ..B15.33                # Infreq
-        movzbl    (%ebp), %edx                                  #1374.9
-        movl      (%eax), %eax                                  #1374.9
-        movzwl    (%eax,%edx,2), %ecx                           #1374.9
-        testl     $8192, %ecx                                   #1374.9
-        je        ..B15.38      # Prob 15%                      #1374.9
-                                # LOE eax ebx ebp esi edi
-..B15.35:                       # Preds ..B15.59 ..B15.36       # Infreq
-        addl      $1, %ebp                                      #1374.9
-        cmpl      %esi, %ebp                                    #1374.9
-        jae       ..B15.38      # Prob 1%                       #1374.9
-                                # LOE eax ebx ebp esi edi
-..B15.36:                       # Preds ..B15.35                # Infreq
-        movzbl    (%ebp), %edx                                  #1374.9
-        movzwl    (%eax,%edx,2), %ecx                           #1374.9
-        testl     $8192, %ecx                                   #1374.9
-        jne       ..B15.35      # Prob 82%                      #1374.9
-                                # LOE eax ebx ebp esi edi
-..B15.38:                       # Preds ..B15.35 ..B15.36 ..B15.59 ..B15.32 # Infreq
-        cmpl      %esi, %ebp                                    #1375.15
-        jne       ..B15.41      # Prob 68%                      #1375.15
-                                # LOE ebx ebp esi edi
-..B15.39:                       # Preds ..B15.38                # Infreq
-        movl      56(%esp), %eax                                #1376.9
-        movl      $22, (%eax)                                   #1376.9
-                                # LOE ebp
-..B15.40:                       # Preds ..B15.61 ..B15.39       # Infreq
-        movl      %ebp, %eax                                    #1375.5
-        addl      $24, %esp                                     #1393.12
-        popl      %ebx                                          #1393.12
-        popl      %ebp                                          #1393.12
-        popl      %esi                                          #1393.12
-        popl      %edi                                          #1393.12
-        ret                                                     #1393.12
-                                # LOE
-..B15.41:                       # Preds ..B15.38                # Infreq
-        pushl     $12                                           #1379.34
-        call      malloc at PLT                                    #1379.25
-                                # LOE eax ebx ebp esi edi
-..B15.60:                       # Preds ..B15.41                # Infreq
-        popl      %ecx                                          #1379.25
-                                # LOE eax ebx ebp esi edi
-..B15.42:                       # Preds ..B15.60                # Infreq
-        testl     %eax, %eax                                    #1380.19
-        jne       ..B15.43      # Prob 99%                      #1380.19
-                                # LOE eax ebx ebp esi edi
-..B15.44:                       # Preds ..B15.42                # Infreq
-        call      __errno_location at PLT                          #1381.24
-                                # LOE eax ebp
-..B15.61:                       # Preds ..B15.44                # Infreq
-        movl      56(%esp), %ecx                                #1381.13
-        movl      (%eax), %edx                                  #1381.24
-        movl      %edx, (%ecx)                                  #1381.13
-        jmp       ..B15.40      # Prob 100%                     #1381.13
-        .align    2,0x90
-                                # LOE ebp
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-	.data
-# -- End  nss_unary_expr
-	.text
-# -- Begin  nss_sob
-# mark_begin;
-       .align    2,0x90
-nss_sob:
-# parameter 1: %eax
-# parameter 2: %edx
-..B16.1:                        # Preds ..B16.0
-        pushl     %edi                                          #1181.1
-        pushl     %esi                                          #1181.1
-        pushl     %ebx                                          #1181.1
-        movl      %edx, %edi                                    #1181.1
-        movl      %eax, %esi                                    #1181.1
-        cmpl      %edi, %esi                                    #1182.17
-        jae       ..B16.7       # Prob 12%                      #1182.17
-                                # LOE ebp esi edi
-..B16.2:                        # Preds ..B16.1
-        call      ..L10         # Prob 100%                     #
-..L10:                                                          #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L10], %ebx      #
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE eax ebp esi edi
-..B16.11:                       # Preds ..B16.2
-        movzbl    (%esi), %edx                                  #1182.24
-        movl      (%eax), %ecx                                  #1182.24
-        movzwl    (%ecx,%edx,2), %ebx                           #1182.24
-        testl     $8192, %ebx                                   #1182.24
-        je        ..B16.7       # Prob 15%                      #1182.24
-                                # LOE ecx ebp esi edi
-..B16.3:                        # Preds ..B16.11
-        xorl      %edx, %edx                                    #1182.24
-        movl      %esi, %eax                                    #1182.24
-                                # LOE eax edx ecx ebp esi edi
-..B16.4:                        # Preds ..B16.5 ..B16.3
-        addl      $1, %eax                                      #1182.24
-        addl      $1, %edx                                      #1182.24
-        cmpl      %eax, %edi                                    #1182.17
-        jbe       ..B16.6       # Prob 1%                       #1182.17
-                                # LOE eax edx ecx ebp esi edi
-..B16.5:                        # Preds ..B16.4
-        movzbl    (%esi,%edx), %ebx                             #1182.24
-        movzwl    (%ecx,%ebx,2), %ebx                           #1182.24
-        testl     $8192, %ebx                                   #1182.24
-        jne       ..B16.4       # Prob 82%                      #1182.24
-                                # LOE eax edx ecx ebp esi edi
-..B16.6:                        # Preds ..B16.4 ..B16.5
-        addl      %edx, %esi                                    #1183.12
-                                # LOE ebp esi
-..B16.7:                        # Preds ..B16.11 ..B16.6 ..B16.1
-        movl      %esi, %eax                                    #1184.12
-        popl      %ebx                                          #1184.12
-        popl      %esi                                          #1184.12
-        popl      %edi                                          #1184.12
-        ret                                                     #1184.12
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	nss_sob, at function
-	.size	nss_sob,.-nss_sob
-	.data
-# -- End  nss_sob
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    2,0x90
-nss_fasta_expr:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 56 + %esp
-# parameter 5: 60 + %esp
-..B17.1:                        # Preds ..B17.0
-        pushl     %edi                                          #1234.1
-        pushl     %esi                                          #1234.1
-        pushl     %ebp                                          #1234.1
-        pushl     %ebx                                          #1234.1
-        subl      $24, %esp                                     #1234.1
-        movl      %edx, %ebx                                    #1234.1
-        movl      %eax, %esi                                    #1234.1
-        movsbl    (%esi), %ebp                                  #1236.16
-        call      ..L11         # Prob 100%                     #1234.1
-..L11:                                                          #
-        popl      %edx                                          #1234.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L11], %edx      #1234.1
-        cmpl      $39, %ebp                                     #1236.16
-        jne       ..B17.16      # Prob 67%                      #1236.16
-                                # LOE edx ecx ebx ebp esi
-..B17.2:                        # Preds ..B17.1
-        addl      $1, %esi                                      #1239.30
-        movl      %esi, %ebp                                    #1239.30
-        cmpl      %ebx, %esi                                    #1239.13
-        jae       ..B17.10      # Prob 44%                      #1239.13
-                                # LOE edx ecx ebx ebp esi
-..B17.4:                        # Preds ..B17.2
-        lea       fasta_2na_map.0 at GOTOFF(%edx), %eax            #1239.13
-        movl      %esi, 16(%esp)                                #
-        movl      %ecx, 20(%esp)                                #
-        xorl      %edi, %edi                                    #
-                                # LOE eax edx ebx ebp edi
-..B17.5:                        # Preds ..B17.7 ..B17.4
-        movsbl    (%ebp), %ecx                                  #1239.13
-        testl     %ecx, %ecx                                    #1239.13
-        jl        ..B17.91      # Prob 1%                       #1239.13
-                                # LOE eax edx ebx ebp edi
-..B17.6:                        # Preds ..B17.5
-        movzbl    (%ebp), %esi                                  #1239.13
-        movsbl    (%esi,%eax), %ecx                             #1239.13
-        testl     %ecx, %ecx                                    #1239.13
-        jl        ..B17.47      # Prob 16%                      #1239.13
-                                # LOE eax edx ebx ebp esi edi
-..B17.7:                        # Preds ..B17.49 ..B17.6
-        addl      $1, %ebp                                      #1239.13
-        cmpl      %ebx, %ebp                                    #1239.13
-        jb        ..B17.5       # Prob 82%                      #1239.13
-                                # LOE eax edx ebx ebp edi
-..B17.8:                        # Preds ..B17.7
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.9:                        # Preds ..B17.91 ..B17.8
-        cmpl      %esi, %ebp                                    #1239.13
-        ja        ..B17.42      # Prob 12%                      #1239.13
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.10:                       # Preds ..B17.2 ..B17.9
-        movl      $22, %edx                                     #1239.13
-        movl      $22, %eax                                     #
-                                # LOE eax edx ebx ebp
-..B17.11:                       # Preds ..B17.10 ..B17.44 ..B17.46
-        testl     %eax, %eax                                    #1240.26
-        jne       ..B17.30      # Prob 50%                      #1240.26
-                                # LOE edx ebx ebp
-..B17.12:                       # Preds ..B17.11
-        cmpl      %ebx, %ebp                                    #1240.38
-        je        ..B17.14      # Prob 12%                      #1240.38
-                                # LOE edx ebp
-..B17.13:                       # Preds ..B17.12
-        movl      56(%esp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-        movsbl    (%ebp), %edx                                  #1240.47
-        addl      $1, %ebp                                      #1240.47
-        cmpl      $39, %edx                                     #1240.55
-        je        ..B17.31      # Prob 50%                      #1240.55
-                                # LOE ebp
-..B17.14:                       # Preds ..B17.13 ..B17.12
-        movl      56(%esp), %eax                                #1241.13
-        movl      $22, (%eax)                                   #1241.13
-        jmp       ..B17.31      # Prob 100%                     #1241.13
-                                # LOE ebp
-..B17.16:                       # Preds ..B17.1
-        cmpl      $34, %ebp                                     #1236.16
-        jne       ..B17.32      # Prob 50%                      #1236.16
-                                # LOE edx ecx ebx esi
-..B17.17:                       # Preds ..B17.16
-        addl      $1, %esi                                      #1244.30
-        movl      %esi, %ebp                                    #1244.30
-        cmpl      %ebx, %esi                                    #1244.13
-        jae       ..B17.25      # Prob 44%                      #1244.13
-                                # LOE edx ecx ebx ebp esi
-..B17.19:                       # Preds ..B17.17
-        lea       fasta_2na_map.0 at GOTOFF(%edx), %eax            #1244.13
-        movl      %esi, 16(%esp)                                #
-        movl      %ecx, 20(%esp)                                #
-        xorl      %edi, %edi                                    #
-                                # LOE eax edx ebx ebp edi
-..B17.20:                       # Preds ..B17.22 ..B17.19
-        movsbl    (%ebp), %ecx                                  #1244.13
-        testl     %ecx, %ecx                                    #1244.13
-        jl        ..B17.90      # Prob 1%                       #1244.13
-                                # LOE eax edx ebx ebp edi
-..B17.21:                       # Preds ..B17.20
-        movzbl    (%ebp), %esi                                  #1244.13
-        movsbl    (%esi,%eax), %ecx                             #1244.13
-        testl     %ecx, %ecx                                    #1244.13
-        jl        ..B17.58      # Prob 16%                      #1244.13
-                                # LOE eax edx ebx ebp esi edi
-..B17.22:                       # Preds ..B17.60 ..B17.21
-        addl      $1, %ebp                                      #1244.13
-        cmpl      %ebx, %ebp                                    #1244.13
-        jb        ..B17.20      # Prob 82%                      #1244.13
-                                # LOE eax edx ebx ebp edi
-..B17.23:                       # Preds ..B17.22
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.24:                       # Preds ..B17.90 ..B17.23
-        cmpl      %esi, %ebp                                    #1244.13
-        ja        ..B17.53      # Prob 12%                      #1244.13
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.25:                       # Preds ..B17.17 ..B17.24
-        movl      $22, %edx                                     #1244.13
-        movl      $22, %eax                                     #
-                                # LOE eax edx ebx ebp
-..B17.26:                       # Preds ..B17.25 ..B17.55 ..B17.57
-        testl     %eax, %eax                                    #1245.26
-        jne       ..B17.30      # Prob 50%                      #1245.26
-                                # LOE edx ebx ebp
-..B17.27:                       # Preds ..B17.26
-        cmpl      %ebx, %ebp                                    #1245.38
-        je        ..B17.29      # Prob 12%                      #1245.38
-                                # LOE edx ebp
-..B17.28:                       # Preds ..B17.27
-        movl      56(%esp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-        movsbl    (%ebp), %edx                                  #1245.47
-        addl      $1, %ebp                                      #1245.47
-        cmpl      $34, %edx                                     #1245.55
-        je        ..B17.31      # Prob 50%                      #1245.55
-                                # LOE ebp
-..B17.29:                       # Preds ..B17.28 ..B17.27
-        movl      56(%esp), %eax                                #1246.13
-        movl      $22, (%eax)                                   #1246.13
-        jmp       ..B17.31      # Prob 100%                     #1246.13
-                                # LOE ebp
-..B17.30:                       # Preds ..B17.11 ..B17.26
-        movl      56(%esp), %eax                                #1241.13
-        movl      %edx, (%eax)                                  #1241.13
-                                # LOE ebp
-..B17.31:                       # Preds ..B17.13 ..B17.28 ..B17.30 ..B17.14 ..B17.29
-                                #      
-        movl      %ebp, %eax                                    #1252.12
-        addl      $24, %esp                                     #1252.12
-        popl      %ebx                                          #1252.12
-        popl      %ebp                                          #1252.12
-        popl      %esi                                          #1252.12
-        popl      %edi                                          #1252.12
-        ret                                                     #1252.12
-                                # LOE
-..B17.32:                       # Preds ..B17.16
-        movl      %esi, %ebp                                    #1234.1
-        cmpl      %ebx, %esi                                    #1249.16
-        jae       ..B17.40      # Prob 44%                      #1249.16
-                                # LOE edx ecx ebx ebp esi
-..B17.34:                       # Preds ..B17.32
-        lea       fasta_2na_map.0 at GOTOFF(%edx), %eax            #1249.16
-        movl      %esi, 16(%esp)                                #
-        movl      %ecx, 20(%esp)                                #
-        xorl      %edi, %edi                                    #
-                                # LOE eax edx ebx ebp edi
-..B17.35:                       # Preds ..B17.37 ..B17.34
-        movsbl    (%ebp), %ecx                                  #1249.16
-        testl     %ecx, %ecx                                    #1249.16
-        jl        ..B17.89      # Prob 1%                       #1249.16
-                                # LOE eax edx ebx ebp edi
-..B17.36:                       # Preds ..B17.35
-        movzbl    (%ebp), %esi                                  #1249.16
-        movsbl    (%esi,%eax), %ecx                             #1249.16
-        testl     %ecx, %ecx                                    #1249.16
-        jl        ..B17.69      # Prob 16%                      #1249.16
-                                # LOE eax edx ebx ebp esi edi
-..B17.37:                       # Preds ..B17.71 ..B17.36
-        addl      $1, %ebp                                      #1249.16
-        cmpl      %ebx, %ebp                                    #1249.16
-        jb        ..B17.35      # Prob 82%                      #1249.16
-                                # LOE eax edx ebx ebp edi
-..B17.38:                       # Preds ..B17.37
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-                                # LOE ecx ebp esi edi cl ch
-..B17.39:                       # Preds ..B17.89 ..B17.38
-        cmpl      %esi, %ebp                                    #1249.16
-        ja        ..B17.64      # Prob 12%                      #1249.16
-                                # LOE ecx ebp esi edi cl ch
-..B17.40:                       # Preds ..B17.32 ..B17.39
-        movl      56(%esp), %eax                                #1249.16
-        movl      $22, (%eax)                                   #1249.16
-                                # LOE ebp
-..B17.41:                       # Preds ..B17.40 ..B17.66 ..B17.68
-        movl      %ebp, %eax                                    #1249.16
-        addl      $24, %esp                                     #1249.16
-        popl      %ebx                                          #1249.16
-        popl      %ebp                                          #1249.16
-        popl      %esi                                          #1249.16
-        popl      %edi                                          #1249.16
-        ret                                                     #1249.16
-                                # LOE
-..B17.42:                       # Preds ..B17.9                 # Infreq
-        testl     %edi, %edi                                    #1239.13
-        jne       ..B17.45      # Prob 50%                      #1239.13
-                                # LOE ecx ebx ebp esi cl ch
-..B17.43:                       # Preds ..B17.42                # Infreq
-        movl      60(%esp), %edx                                #1239.13
-        movl      %ebp, %edi                                    #1239.13
-        subl      %esi, %edi                                    #1239.13
-        movl      %edi, 12(%esp)                                #1239.13
-        movl      %ecx, %eax                                    #1239.13
-        movl      %esi, %ecx                                    #1239.13
-        call      NucStrFastaExprMake2                          #1239.13
-                                # LOE eax ebx ebp
-..B17.44:                       # Preds ..B17.43                # Infreq
-        movl      %eax, %edx                                    #1239.13
-        jmp       ..B17.11      # Prob 100%                     #1239.13
-                                # LOE eax edx ebx ebp
-..B17.45:                       # Preds ..B17.42                # Infreq
-        movl      60(%esp), %edx                                #1239.13
-        movl      %ebp, %edi                                    #1239.13
-        subl      %esi, %edi                                    #1239.13
-        movl      %edi, 12(%esp)                                #1239.13
-        movl      %ecx, %eax                                    #1239.13
-        movl      %esi, %ecx                                    #1239.13
-        call      NucStrFastaExprMake4                          #1239.13
-                                # LOE eax ebx ebp
-..B17.46:                       # Preds ..B17.45                # Infreq
-        movl      %eax, %edx                                    #1239.13
-        jmp       ..B17.11      # Prob 100%                     #1239.13
-                                # LOE eax edx ebx ebp
-..B17.47:                       # Preds ..B17.6                 # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%edx), %ecx            #1239.13
-        cmpl      %ecx, %eax                                    #1239.13
-        je        ..B17.91      # Prob 1%                       #1239.13
-                                # LOE edx ecx ebx ebp esi edi
-..B17.48:                       # Preds ..B17.47                # Infreq
-        movsbl    (%esi,%ecx), %eax                             #1239.13
-        testl     %eax, %eax                                    #1239.13
-        jl        ..B17.91      # Prob 1%                       #1239.13
-                                # LOE edx ecx ebx ebp edi
-..B17.49:                       # Preds ..B17.48                # Infreq
-        movl      %ecx, %eax                                    #1239.13
-        movl      $1, %edi                                      #
-        jmp       ..B17.7       # Prob 100%                     #
-                                # LOE eax edx ebx ebp edi
-..B17.91:                       # Preds ..B17.47 ..B17.48 ..B17.5 # Infreq
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-        jmp       ..B17.9       # Prob 100%                     #
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.53:                       # Preds ..B17.24                # Infreq
-        testl     %edi, %edi                                    #1244.13
-        jne       ..B17.56      # Prob 50%                      #1244.13
-                                # LOE ecx ebx ebp esi cl ch
-..B17.54:                       # Preds ..B17.53                # Infreq
-        movl      60(%esp), %edx                                #1244.13
-        movl      %ebp, %edi                                    #1244.13
-        subl      %esi, %edi                                    #1244.13
-        movl      %edi, 12(%esp)                                #1244.13
-        movl      %ecx, %eax                                    #1244.13
-        movl      %esi, %ecx                                    #1244.13
-        call      NucStrFastaExprMake2                          #1244.13
-                                # LOE eax ebx ebp
-..B17.55:                       # Preds ..B17.54                # Infreq
-        movl      %eax, %edx                                    #1244.13
-        jmp       ..B17.26      # Prob 100%                     #1244.13
-                                # LOE eax edx ebx ebp
-..B17.56:                       # Preds ..B17.53                # Infreq
-        movl      60(%esp), %edx                                #1244.13
-        movl      %ebp, %edi                                    #1244.13
-        subl      %esi, %edi                                    #1244.13
-        movl      %edi, 12(%esp)                                #1244.13
-        movl      %ecx, %eax                                    #1244.13
-        movl      %esi, %ecx                                    #1244.13
-        call      NucStrFastaExprMake4                          #1244.13
-                                # LOE eax ebx ebp
-..B17.57:                       # Preds ..B17.56                # Infreq
-        movl      %eax, %edx                                    #1244.13
-        jmp       ..B17.26      # Prob 100%                     #1244.13
-                                # LOE eax edx ebx ebp
-..B17.58:                       # Preds ..B17.21                # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%edx), %ecx            #1244.13
-        cmpl      %ecx, %eax                                    #1244.13
-        je        ..B17.90      # Prob 1%                       #1244.13
-                                # LOE edx ecx ebx ebp esi edi
-..B17.59:                       # Preds ..B17.58                # Infreq
-        movsbl    (%esi,%ecx), %eax                             #1244.13
-        testl     %eax, %eax                                    #1244.13
-        jl        ..B17.90      # Prob 1%                       #1244.13
-                                # LOE edx ecx ebx ebp edi
-..B17.60:                       # Preds ..B17.59                # Infreq
-        movl      %ecx, %eax                                    #1244.13
-        movl      $1, %edi                                      #
-        jmp       ..B17.22      # Prob 100%                     #
-                                # LOE eax edx ebx ebp edi
-..B17.90:                       # Preds ..B17.58 ..B17.59 ..B17.20 # Infreq
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-        jmp       ..B17.24      # Prob 100%                     #
-                                # LOE ecx ebx ebp esi edi cl ch
-..B17.64:                       # Preds ..B17.39                # Infreq
-        testl     %edi, %edi                                    #1249.16
-        jne       ..B17.67      # Prob 50%                      #1249.16
-                                # LOE ecx ebp esi cl ch
-..B17.65:                       # Preds ..B17.64                # Infreq
-        movl      60(%esp), %edx                                #1249.16
-        movl      %ebp, %ebx                                    #1249.16
-        subl      %esi, %ebx                                    #1249.16
-        movl      %ebx, 12(%esp)                                #1249.16
-        movl      %ecx, %eax                                    #1249.16
-        movl      %esi, %ecx                                    #1249.16
-        call      NucStrFastaExprMake2                          #1249.16
-                                # LOE eax ebp
-..B17.66:                       # Preds ..B17.65                # Infreq
-        movl      56(%esp), %edx                                #1249.16
-        movl      %eax, (%edx)                                  #1249.16
-        jmp       ..B17.41      # Prob 100%                     #1249.16
-                                # LOE ebp
-..B17.67:                       # Preds ..B17.64                # Infreq
-        movl      60(%esp), %edx                                #1249.16
-        movl      %ebp, %ebx                                    #1249.16
-        subl      %esi, %ebx                                    #1249.16
-        movl      %ebx, 12(%esp)                                #1249.16
-        movl      %ecx, %eax                                    #1249.16
-        movl      %esi, %ecx                                    #1249.16
-        call      NucStrFastaExprMake4                          #1249.16
-                                # LOE eax ebp
-..B17.68:                       # Preds ..B17.67                # Infreq
-        movl      56(%esp), %edx                                #1249.16
-        movl      %eax, (%edx)                                  #1249.16
-        jmp       ..B17.41      # Prob 100%                     #1249.16
-                                # LOE ebp
-..B17.69:                       # Preds ..B17.36                # Infreq
-        lea       fasta_4na_map.0 at GOTOFF(%edx), %ecx            #1249.16
-        cmpl      %ecx, %eax                                    #1249.16
-        je        ..B17.89      # Prob 1%                       #1249.16
-                                # LOE edx ecx ebx ebp esi edi
-..B17.70:                       # Preds ..B17.69                # Infreq
-        movsbl    (%ecx,%esi), %eax                             #1249.16
-        testl     %eax, %eax                                    #1249.16
-        jl        ..B17.89      # Prob 1%                       #1249.16
-                                # LOE edx ecx ebx ebp edi
-..B17.71:                       # Preds ..B17.70                # Infreq
-        movl      %ecx, %eax                                    #1249.16
-        movl      $1, %edi                                      #
-        jmp       ..B17.37      # Prob 100%                     #
-                                # LOE eax edx ebx ebp edi
-..B17.89:                       # Preds ..B17.69 ..B17.70 ..B17.35 # Infreq
-        movl      16(%esp), %esi                                #
-        movl      20(%esp), %ecx                                #
-        jmp       ..B17.39      # Prob 100%                     #
-        .align    2,0x90
-                                # LOE ecx ebp esi edi cl ch
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-	.data
-# -- End  nss_fasta_expr
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake4:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B18.1:                        # Preds ..B18.0
-        pushl     %ebp                                          #1017.1
-        movl      %esp, %ebp                                    #1017.1
-        andl      $-16, %esp                                    #1017.1
-        pushl     %edi                                          #1017.1
-        pushl     %esi                                          #1017.1
-        pushl     %ebx                                          #1017.1
-        subl      $52, %esp                                     #1017.1
-        movl      %ecx, %esi                                    #1017.1
-        movl      20(%ebp), %ecx                                #1015.5
-        movl      %edx, 12(%esp)                                #1017.1
-        movl      %eax, %edx                                    #1017.1
-        cmpl      $29, %ecx                                     #1023.17
-        jbe       ..B18.3       # Prob 43%                      #1023.17
-                                # LOE edx esi
-..B18.2:                        # Preds ..B18.1
-        movl      $7, %eax                                      #1024.16
-        addl      $52, %esp                                     #1024.16
-        popl      %ebx                                          #1024.16
-        popl      %esi                                          #1024.16
-        popl      %edi                                          #1024.16
-        movl      %ebp, %esp                                    #1024.16
-        popl      %ebp                                          #1024.16
-        ret                                                     #1024.16
-                                # LOE
-..B18.3:                        # Preds ..B18.1
-        pushl     $160                                          #1026.32
-        movl      %edx, 12(%esp)                                #1026.9
-        call      ..L12         # Prob 100%                     #
-..L12:                                                          #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L12], %ebx      #
-        call      malloc at PLT                                    #1026.9
-                                # LOE eax ebx esi
-..B18.46:                       # Preds ..B18.3
-        movl      12(%esp), %edx                                #
-        addl      $4, %esp                                      #1026.9
-                                # LOE eax edx ebx esi dl dh
-..B18.4:                        # Preds ..B18.46
-        testl     %eax, %eax                                    #1026.9
-        je        ..B18.43      # Prob 12%                      #1026.9
-                                # LOE eax edx ebx esi dl dh
-..B18.5:                        # Preds ..B18.4
-        lea       15(%eax), %edi                                #1026.9
-        andl      $-16, %edi                                    #1026.9
-        movl      %eax, 8(%edi)                                 #1026.9
-        je        ..B18.43      # Prob 5%                       #1027.15
-                                # LOE edx ebx esi edi dl dh
-..B18.6:                        # Preds ..B18.5
-        movl      20(%ebp), %eax                                #1031.5
-        movl      %edi, (%edx)                                  #1030.5
-        movl      %eax, 4(%edi)                                 #1031.5
-        testl     %eax, %eax                                    #1035.22
-        jbe       ..B18.42      # Prob 16%                      #1035.22
-                                # LOE ebx esi edi
-..B18.7:                        # Preds ..B18.6
-        movl      20(%ebp), %edx                                #
-        movl      %edi, 4(%esp)                                 #
-        xorl      %ecx, %ecx                                    #
-                                # LOE edx ecx ebx esi
-..B18.8:                        # Preds ..B18.15 ..B18.7
-        movsbl    (%esi,%ecx), %eax                             #1037.49
-        movsbl    fasta_4na_map.0 at GOTOFF(%ebx,%eax), %eax       #1037.25
-        movl      %ecx, %edi                                    #1038.22
-        andl      $3, %edi                                      #1038.22
-        je        ..B18.41      # Prob 20%                      #1038.22
-                                # LOE eax edx ecx ebx esi edi
-..B18.9:                        # Preds ..B18.8
-        cmpl      $1, %edi                                      #1038.22
-        je        ..B18.14      # Prob 25%                      #1038.22
-                                # LOE eax edx ecx ebx esi edi
-..B18.10:                       # Preds ..B18.9
-        cmpl      $2, %edi                                      #1038.22
-        jne       ..B18.12      # Prob 67%                      #1038.22
-                                # LOE eax edx ecx ebx esi edi
-..B18.11:                       # Preds ..B18.10
-        movl      %ecx, %edi                                    #1049.32
-        shrl      $2, %edi                                      #1049.32
-        shll      $12, %eax                                     #1049.47
-        orw       %ax, 16(%esp,%edi,2)                          #1049.13
-        movzwl    32(%esp,%edi,2), %eax                         #1050.13
-        orl       $-4096, %eax                                  #1050.13
-        movw      %ax, 32(%esp,%edi,2)                          #1050.13
-        jmp       ..B18.15      # Prob 100%                     #1050.13
-                                # LOE edx ecx ebx esi
-..B18.12:                       # Preds ..B18.10
-        cmpl      $3, %edi                                      #1038.22
-        jne       ..B18.15      # Prob 50%                      #1038.22
-                                # LOE eax edx ecx ebx esi
-..B18.13:                       # Preds ..B18.12
-        movl      %ecx, %edi                                    #1053.32
-        shrl      $2, %edi                                      #1053.32
-        shll      $8, %eax                                      #1053.47
-        orw       %ax, 16(%esp,%edi,2)                          #1053.13
-        movzwl    32(%esp,%edi,2), %eax                         #1054.13
-        orl       $-61696, %eax                                 #1054.13
-        movw      %ax, 32(%esp,%edi,2)                          #1054.13
-        jmp       ..B18.15      # Prob 100%                     #1054.13
-                                # LOE edx ecx ebx esi
-..B18.14:                       # Preds ..B18.9
-        movl      %ecx, %edi                                    #1045.32
-        shrl      $2, %edi                                      #1045.32
-        orw       %ax, 16(%esp,%edi,2)                          #1045.13
-        movzwl    32(%esp,%edi,2), %eax                         #1046.13
-        orl       $15, %eax                                     #1046.13
-        movw      %ax, 32(%esp,%edi,2)                          #1046.13
-                                # LOE edx ecx ebx esi
-..B18.15:                       # Preds ..B18.41 ..B18.14 ..B18.11 ..B18.13 ..B18.12
-                                #      
-        addl      $1, %ecx                                      #1035.31
-        cmpl      %edx, %ecx                                    #1035.22
-        jb        ..B18.8       # Prob 82%                      #1035.22
-                                # LOE edx ecx ebx esi
-..B18.16:                       # Preds ..B18.15
-        movl      4(%esp), %edi                                 #
-                                # LOE ecx edi
-..B18.17:                       # Preds ..B18.16 ..B18.42
-        addl      $3, %ecx                                      #1060.21
-        shrl      $2, %ecx                                      #1060.28
-        cmpl      $8, %ecx                                      #1060.35
-        jae       ..B18.30      # Prob 50%                      #1060.35
-                                # LOE ecx edi
-..B18.18:                       # Preds ..B18.17
-        movl      %ecx, %ebx                                    #1060.5
-        negl      %ebx                                          #1060.5
-        addl      $8, %ebx                                      #1060.5
-        lea       (%ecx,%ecx), %esi                             #
-        movl      %esi, 8(%esp)                                 #
-        lea       16(%esp,%ecx,2), %esi                         #1060.5
-        andl      $15, %esi                                     #1060.5
-        movl      %esi, %eax                                    #1060.5
-        negl      %eax                                          #1060.5
-        addl      $16, %eax                                     #1060.5
-        shrl      $1, %eax                                      #1060.5
-        cmpl      $0, %esi                                      #1060.5
-        cmovne    %eax, %esi                                    #1060.5
-        lea       8(%esi), %edx                                 #1060.5
-        cmpl      %edx, %ebx                                    #1060.5
-        jb        ..B18.40      # Prob 10%                      #1060.5
-                                # LOE ecx ebx esi edi
-..B18.19:                       # Preds ..B18.18
-        movl      %ebx, %edx                                    #1060.5
-        subl      %esi, %edx                                    #1060.5
-        andl      $7, %edx                                      #1060.5
-        negl      %edx                                          #1060.5
-        addl      %ebx, %edx                                    #1060.5
-        testl     %esi, %esi                                    #1060.5
-        jbe       ..B18.23      # Prob 1%                       #1060.5
-                                # LOE edx ecx ebx esi edi
-..B18.20:                       # Preds ..B18.19
-        movl      %ecx, (%esp)                                  #
-        movl      %edi, 4(%esp)                                 #
-        movl      8(%esp), %edi                                 #
-        xorl      %eax, %eax                                    #
-                                # LOE eax edx ebx esi edi
-..B18.21:                       # Preds ..B18.21 ..B18.20
-        xorl      %ecx, %ecx                                    #1062.9
-        movw      %cx, 16(%esp,%edi)                            #1062.9
-        addl      $1, %eax                                      #1060.5
-        movw      %cx, 32(%esp,%edi)                            #1063.9
-        addl      $2, %edi                                      #1060.5
-        cmpl      %esi, %eax                                    #1060.5
-        jb        ..B18.21      # Prob 99%                      #1060.5
-                                # LOE eax edx ebx esi edi
-..B18.22:                       # Preds ..B18.21
-        movl      (%esp), %ecx                                  #
-        movl      4(%esp), %edi                                 #
-                                # LOE edx ecx ebx esi edi
-..B18.23:                       # Preds ..B18.22 ..B18.19
-        lea       (%esi,%esi), %eax                             #1062.29
-        lea       (%eax,%ecx,2), %eax                           #1062.29
-        pxor      %xmm0, %xmm0                                  #1062.29
-                                # LOE eax edx ecx ebx esi edi xmm0
-..B18.24:                       # Preds ..B18.24 ..B18.23
-        movdqa    %xmm0, 16(%esp,%eax)                          #1062.9
-        movdqa    %xmm0, 32(%esp,%eax)                          #1063.9
-        addl      $16, %eax                                     #1060.5
-        addl      $8, %esi                                      #1060.5
-        cmpl      %edx, %esi                                    #1060.5
-        jb        ..B18.24      # Prob 99%                      #1060.5
-                                # LOE eax edx ecx ebx esi edi xmm0
-..B18.26:                       # Preds ..B18.24 ..B18.40
-        cmpl      %ebx, %edx                                    #1060.5
-        jae       ..B18.30      # Prob 1%                       #1060.5
-                                # LOE edx ecx ebx edi
-..B18.27:                       # Preds ..B18.26
-        lea       (%edx,%edx), %eax                             #
-        lea       (%eax,%ecx,2), %eax                           #
-                                # LOE eax edx ebx edi
-..B18.28:                       # Preds ..B18.28 ..B18.27
-        xorl      %esi, %esi                                    #1062.9
-        movw      %si, 16(%esp,%eax)                            #1062.9
-        addl      $1, %edx                                      #1060.5
-        movw      %si, 32(%esp,%eax)                            #1063.9
-        addl      $2, %eax                                      #1060.5
-        cmpl      %ebx, %edx                                    #1060.5
-        jb        ..B18.28      # Prob 99%                      #1060.5
-                                # LOE eax edx ebx edi
-..B18.30:                       # Preds ..B18.28 ..B18.26 ..B18.17
-        movl      12(%esp), %eax                                #1068.10
-        testl     %eax, %eax                                    #1068.10
-        je        ..B18.32      # Prob 50%                      #1068.10
-                                # LOE edi
-..B18.31:                       # Preds ..B18.30
-        movl      $10, (%edi)                                   #1070.9
-        jmp       ..B18.39      # Prob 100%                     #1070.9
-                                # LOE edi
-..B18.32:                       # Preds ..B18.30
-        movl      20(%ebp), %eax                                #1072.22
-        cmpl      $2, %eax                                      #1072.22
-        jae       ..B18.34      # Prob 50%                      #1072.22
-                                # LOE edi
-..B18.33:                       # Preds ..B18.32
-        movzwl    16(%esp), %eax                                #1074.29
-        movzwl    32(%esp), %esi                                #1078.26
-        movl      $6, (%edi)                                    #1082.9
-        movw      %ax, 18(%esp)                                 #1074.9
-        movl      16(%esp), %ebx                                #1075.29
-        movl      %ebx, 20(%esp)                                #1075.9
-        movl      16(%esp), %edx                                #1076.29
-        movl      %edx, 24(%esp)                                #1076.9
-        movl      %ebx, 28(%esp)                                #1076.9
-        movw      %si, 34(%esp)                                 #1078.9
-        movl      32(%esp), %edx                                #1079.26
-        movl      %edx, 36(%esp)                                #1079.9
-        movl      32(%esp), %eax                                #1080.26
-        movl      %eax, 40(%esp)                                #1080.9
-        movl      %edx, 44(%esp)                                #1080.9
-        jmp       ..B18.39      # Prob 100%                     #1080.9
-                                # LOE edi
-..B18.34:                       # Preds ..B18.32
-        movl      20(%ebp), %eax                                #1084.22
-        cmpl      $6, %eax                                      #1084.22
-        jae       ..B18.36      # Prob 50%                      #1084.22
-                                # LOE edi
-..B18.35:                       # Preds ..B18.34
-        movl      16(%esp), %edx                                #1086.29
-        movl      32(%esp), %esi                                #1089.26
-        movl      $7, (%edi)                                    #1092.9
-        movl      %edx, 20(%esp)                                #1086.9
-        movl      16(%esp), %eax                                #1087.29
-        movl      %eax, 24(%esp)                                #1087.9
-        movl      %edx, 28(%esp)                                #1087.9
-        movl      %esi, 36(%esp)                                #1089.9
-        movl      32(%esp), %ebx                                #1090.26
-        movl      %ebx, 40(%esp)                                #1090.9
-        movl      %esi, 44(%esp)                                #1090.9
-        jmp       ..B18.39      # Prob 100%                     #1090.9
-                                # LOE edi
-..B18.36:                       # Preds ..B18.34
-        movl      20(%ebp), %eax                                #1094.22
-        cmpl      $14, %eax                                     #1094.22
-        jae       ..B18.38      # Prob 50%                      #1094.22
-                                # LOE edi
-..B18.37:                       # Preds ..B18.36
-        movl      16(%esp), %eax                                #1096.29
-        movl      20(%esp), %edx                                #1096.29
-        movl      32(%esp), %ebx                                #1097.26
-        movl      36(%esp), %esi                                #1097.26
-        movl      %eax, 24(%esp)                                #1096.9
-        movl      $1, (%edi)                                    #1099.9
-        movl      %edx, 28(%esp)                                #1096.9
-        movl      %ebx, 40(%esp)                                #1097.9
-        movl      %esi, 44(%esp)                                #1097.9
-        jmp       ..B18.39      # Prob 100%                     #1097.9
-                                # LOE edi
-..B18.38:                       # Preds ..B18.36
-        movl      $8, (%edi)                                    #1103.9
-                                # LOE edi
-..B18.39:                       # Preds ..B18.31 ..B18.33 ..B18.35 ..B18.37 ..B18.38
-                                #      
-        movl      16(%esp), %eax                                #1106.42
-        movl      20(%esp), %ebx                                #1106.42
-        movl      24(%esp), %esi                                #1106.42
-        lea       16(%esp), %ecx                                #1110.5
-        movl      %eax, 16(%edi)                                #1106.42
-        movl      28(%esp), %eax                                #1106.42
-        movl      %ebx, 20(%edi)                                #1106.42
-        movl      %esi, 24(%edi)                                #1106.42
-        movl      %eax, 28(%edi)                                #1106.42
-        movl      32(%esp), %eax                                #1107.39
-        movl      %eax, 32(%edi)                                #1107.39
-        movl      36(%esp), %eax                                #1107.39
-        movl      %eax, 36(%edi)                                #1107.39
-        movl      40(%esp), %eax                                #1107.39
-        movl      %eax, 40(%edi)                                #1107.39
-        movl      44(%esp), %eax                                #1107.39
-        movl      %eax, 44(%edi)                                #1107.39
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #1110.5
-        lea       32(%esp), %ecx                                #1111.5
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #1111.5
-        movl      $4, %ecx                                      #1114.5
-        lea       16(%esp), %edx                                #1114.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1114.5
-        lea       32(%esp), %edx                                #1115.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1115.5
-        lea       48(%edi), %ecx                                #1118.5
-        lea       16(%esp), %edx                                #1118.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1118.5
-        lea       64(%edi), %ecx                                #1119.5
-        lea       32(%esp), %edx                                #1119.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1119.5
-        movl      $4, %ecx                                      #1121.5
-        lea       16(%esp), %edx                                #1121.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1121.5
-        lea       32(%esp), %edx                                #1122.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1122.5
-        lea       80(%edi), %ecx                                #1124.5
-        lea       16(%esp), %edx                                #1124.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1124.5
-        lea       96(%edi), %ecx                                #1125.5
-        lea       32(%esp), %edx                                #1125.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1125.5
-        movl      $4, %ecx                                      #1127.5
-        lea       16(%esp), %edx                                #1127.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1127.5
-        lea       32(%esp), %edx                                #1128.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #1128.5
-        lea       112(%edi), %ecx                               #1130.5
-        lea       16(%esp), %edx                                #1130.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1130.5
-        addl      $128, %edi                                    #1131.5
-        movl      %edi, %ecx                                    #1131.5
-        lea       32(%esp), %edx                                #1131.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #1131.5
-        xorl      %eax, %eax                                    #1173.12
-        addl      $52, %esp                                     #1173.12
-        popl      %ebx                                          #1173.12
-        popl      %esi                                          #1173.12
-        popl      %edi                                          #1173.12
-        movl      %ebp, %esp                                    #1173.12
-        popl      %ebp                                          #1173.12
-        ret                                                     #1173.12
-                                # LOE
-..B18.40:                       # Preds ..B18.18                # Infreq
-        xorl      %edx, %edx                                    #1060.5
-        jmp       ..B18.26      # Prob 100%                     #1060.5
-                                # LOE edx ecx ebx edi
-..B18.41:                       # Preds ..B18.8                 # Infreq
-        movl      %ecx, %edi                                    #1041.32
-        shrl      $2, %edi                                      #1041.32
-        shll      $4, %eax                                      #1041.46
-        movw      %ax, 16(%esp,%edi,2)                          #1041.13
-        movl      $240, %eax                                    #1042.13
-        movw      %ax, 32(%esp,%edi,2)                          #1042.13
-        jmp       ..B18.15      # Prob 100%                     #1042.13
-                                # LOE edx ecx ebx esi
-..B18.42:                       # Preds ..B18.6                 # Infreq
-        xorl      %ecx, %ecx                                    #
-        jmp       ..B18.17      # Prob 100%                     #
-                                # LOE ecx edi
-..B18.43:                       # Preds ..B18.4 ..B18.5         # Infreq
-        call      __errno_location at PLT                          #1028.16
-                                # LOE eax
-..B18.47:                       # Preds ..B18.43                # Infreq
-        movl      (%eax), %eax                                  #1028.16
-        addl      $52, %esp                                     #1028.16
-        popl      %ebx                                          #1028.16
-        popl      %esi                                          #1028.16
-        popl      %edi                                          #1028.16
-        movl      %ebp, %esp                                    #1028.16
-        popl      %ebp                                          #1028.16
-        ret                                                     #1028.16
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-	.data
-# -- End  NucStrFastaExprMake4
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake2:
-# parameter 1: %eax
-# parameter 2: %edx
-# parameter 3: %ecx
-# parameter 4: 20 + %ebp
-..B19.1:                        # Preds ..B19.0
-        pushl     %ebp                                          #838.1
-        movl      %esp, %ebp                                    #838.1
-        andl      $-16, %esp                                    #838.1
-        pushl     %edi                                          #838.1
-        pushl     %esi                                          #838.1
-        pushl     %ebx                                          #838.1
-        subl      $52, %esp                                     #838.1
-        movl      %ecx, %esi                                    #838.1
-        movl      %edx, 48(%esp)                                #838.1
-        movl      %eax, %edi                                    #838.1
-        movl      20(%ebp), %eax                                #836.5
-        cmpl      $61, %eax                                     #844.17
-        jbe       ..B19.3       # Prob 43%                      #844.17
-                                # LOE esi edi
-..B19.2:                        # Preds ..B19.1
-        movl      $7, %eax                                      #845.16
-        addl      $52, %esp                                     #845.16
-        popl      %ebx                                          #845.16
-        popl      %esi                                          #845.16
-        popl      %edi                                          #845.16
-        movl      %ebp, %esp                                    #845.16
-        popl      %ebp                                          #845.16
-        ret                                                     #845.16
-                                # LOE
-..B19.3:                        # Preds ..B19.1
-        call      ..L13         # Prob 100%                     #
-..L13:                                                          #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L13], %ebx      #
-        movl      %ebx, 12(%esp)                                #
-        pushl     $160                                          #847.32
-        call      malloc at PLT                                    #847.9
-                                # LOE eax esi edi
-..B19.48:                       # Preds ..B19.3
-        popl      %ecx                                          #847.9
-                                # LOE eax esi edi
-..B19.4:                        # Preds ..B19.48
-        testl     %eax, %eax                                    #847.9
-        je        ..B19.45      # Prob 12%                      #847.9
-                                # LOE eax esi edi
-..B19.5:                        # Preds ..B19.4
-        lea       15(%eax), %ebx                                #847.9
-        andl      $-16, %ebx                                    #847.9
-        movl      %eax, 8(%ebx)                                 #847.9
-        je        ..B19.45      # Prob 5%                       #848.15
-                                # LOE ebx esi edi
-..B19.6:                        # Preds ..B19.5
-        movl      20(%ebp), %eax                                #852.5
-        movl      %ebx, (%edi)                                  #851.5
-        movl      %eax, 4(%ebx)                                 #852.5
-        testl     %eax, %eax                                    #856.22
-        jbe       ..B19.44      # Prob 16%                      #856.22
-                                # LOE ebx esi
-..B19.7:                        # Preds ..B19.6
-        movl      12(%esp), %eax                                #
-        movl      %ebx, 8(%esp)                                 #
-        xorl      %edi, %edi                                    #
-                                # LOE eax esi edi
-..B19.8:                        # Preds ..B19.15 ..B19.7
-        movsbl    (%esi,%edi), %edx                             #858.48
-        movzbl    fasta_2na_map.0 at GOTOFF(%eax,%edx), %edx       #858.24
-        movl      %edi, %ecx                                    #859.22
-        andl      $3, %ecx                                      #859.22
-        je        ..B19.43      # Prob 20%                      #859.22
-                                # LOE eax edx ecx esi edi
-..B19.9:                        # Preds ..B19.8
-        cmpl      $1, %ecx                                      #859.22
-        je        ..B19.14      # Prob 25%                      #859.22
-                                # LOE eax edx ecx esi edi
-..B19.10:                       # Preds ..B19.9
-        cmpl      $2, %ecx                                      #859.22
-        jne       ..B19.12      # Prob 67%                      #859.22
-                                # LOE eax edx ecx esi edi
-..B19.11:                       # Preds ..B19.10
-        movl      %edi, %ecx                                    #870.32
-        shrl      $2, %ecx                                      #870.32
-        orb       $12, 32(%esp,%ecx)                            #871.13
-        shll      $2, %edx                                      #870.47
-        orb       %dl, 16(%esp,%ecx)                            #870.13
-        jmp       ..B19.15      # Prob 100%                     #870.13
-                                # LOE eax esi edi
-..B19.12:                       # Preds ..B19.10
-        cmpl      $3, %ecx                                      #859.22
-        jne       ..B19.15      # Prob 50%                      #859.22
-                                # LOE eax edx esi edi
-..B19.13:                       # Preds ..B19.12
-        movl      %edi, %ecx                                    #874.32
-        shrl      $2, %ecx                                      #874.32
-        orb       $3, 32(%esp,%ecx)                             #875.13
-        orb       %dl, 16(%esp,%ecx)                            #874.13
-        jmp       ..B19.15      # Prob 100%                     #874.13
-                                # LOE eax esi edi
-..B19.14:                       # Preds ..B19.9
-        movl      %edi, %ecx                                    #866.32
-        shrl      $2, %ecx                                      #866.32
-        orb       $48, 32(%esp,%ecx)                            #867.13
-        shll      $4, %edx                                      #866.47
-        orb       %dl, 16(%esp,%ecx)                            #866.13
-                                # LOE eax esi edi
-..B19.15:                       # Preds ..B19.43 ..B19.14 ..B19.11 ..B19.13 ..B19.12
-                                #      
-        movl      20(%ebp), %edx                                #856.22
-        addl      $1, %edi                                      #856.31
-        cmpl      %edx, %edi                                    #856.22
-        jb        ..B19.8       # Prob 82%                      #856.22
-                                # LOE eax esi edi
-..B19.16:                       # Preds ..B19.15
-        movl      8(%esp), %ebx                                 #
-                                # LOE ebx edi
-..B19.17:                       # Preds ..B19.16 ..B19.44
-        addl      $3, %edi                                      #881.21
-        shrl      $2, %edi                                      #881.28
-        cmpl      $16, %edi                                     #881.35
-        jae       ..B19.30      # Prob 50%                      #881.35
-                                # LOE ebx edi
-..B19.18:                       # Preds ..B19.17
-        lea       16(%esp), %edx                                #883.9
-        movl      %edi, %esi                                    #881.5
-        negl      %esi                                          #881.5
-        addl      $16, %esi                                     #881.5
-        lea       (%edx,%edi), %edx                             #881.5
-        andl      $15, %edx                                     #881.5
-        movl      %edx, %eax                                    #881.5
-        negl      %eax                                          #881.5
-        addl      $16, %eax                                     #881.5
-        cmpl      $0, %edx                                      #881.5
-        cmovne    %eax, %edx                                    #881.5
-        lea       16(%edx), %eax                                #881.5
-        cmpl      %eax, %esi                                    #881.5
-        jb        ..B19.42      # Prob 10%                      #881.5
-                                # LOE edx ebx esi edi
-..B19.19:                       # Preds ..B19.18
-        movl      %esi, %eax                                    #881.5
-        subl      %edx, %eax                                    #881.5
-        andl      $15, %eax                                     #881.5
-        negl      %eax                                          #881.5
-        addl      %esi, %eax                                    #881.5
-        testl     %edx, %edx                                    #881.5
-        jbe       ..B19.23      # Prob 1%                       #881.5
-                                # LOE eax edx ebx esi edi
-..B19.20:                       # Preds ..B19.19
-        movl      %edi, 4(%esp)                                 #
-        movl      %esi, (%esp)                                  #
-        movl      %ebx, 8(%esp)                                 #
-        movl      %edi, %ebx                                    #
-        lea       (%edx,%edi), %ecx                             #
-        movl      %ecx, 12(%esp)                                #
-        movl      %ecx, %esi                                    #
-                                # LOE eax edx ebx esi edi
-..B19.21:                       # Preds ..B19.21 ..B19.20
-        xorl      %ecx, %ecx                                    #883.9
-        movb      %cl, 16(%esp,%ebx)                            #883.9
-        movb      %cl, 32(%esp,%ebx)                            #884.9
-        addl      $1, %ebx                                      #881.5
-        cmpl      %esi, %ebx                                    #881.5
-        jb        ..B19.21      # Prob 99%                      #881.5
-                                # LOE eax edx ebx esi edi
-..B19.22:                       # Preds ..B19.21
-        movl      (%esp), %esi                                  #
-        movl      8(%esp), %ebx                                 #
-                                # LOE eax edx ebx esi edi
-..B19.23:                       # Preds ..B19.22 ..B19.19
-        lea       (%edx,%edi), %ecx                             #883.29
-        movl      %ecx, 12(%esp)                                #883.29
-        pxor      %xmm0, %xmm0                                  #883.29
-                                # LOE eax edx ecx ebx esi edi xmm0
-..B19.24:                       # Preds ..B19.24 ..B19.23
-        movdqa    %xmm0, 16(%esp,%ecx)                          #883.9
-        movdqa    %xmm0, 32(%esp,%ecx)                          #884.9
-        addl      $16, %ecx                                     #881.5
-        addl      $16, %edx                                     #881.5
-        cmpl      %eax, %edx                                    #881.5
-        jb        ..B19.24      # Prob 99%                      #881.5
-                                # LOE eax edx ecx ebx esi edi xmm0
-..B19.26:                       # Preds ..B19.24 ..B19.42
-        cmpl      %esi, %eax                                    #881.5
-        jae       ..B19.30      # Prob 1%                       #881.5
-                                # LOE eax ebx esi edi
-..B19.27:                       # Preds ..B19.26
-        addl      %eax, %edi                                    #
-                                # LOE eax ebx esi edi
-..B19.28:                       # Preds ..B19.28 ..B19.27
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, 16(%esp,%edi)                            #883.9
-        addl      $1, %eax                                      #881.5
-        movb      %dl, 32(%esp,%edi)                            #884.9
-        addl      $1, %edi                                      #881.5
-        cmpl      %esi, %eax                                    #881.5
-        jb        ..B19.28      # Prob 99%                      #881.5
-                                # LOE eax ebx esi edi
-..B19.30:                       # Preds ..B19.28 ..B19.26 ..B19.17
-        movl      48(%esp), %eax                                #890.10
-        testl     %eax, %eax                                    #890.10
-        je        ..B19.32      # Prob 50%                      #890.10
-                                # LOE ebx
-..B19.31:                       # Preds ..B19.30
-        movl      $9, (%ebx)                                    #892.9
-        jmp       ..B19.41      # Prob 100%                     #892.9
-                                # LOE ebx
-..B19.32:                       # Preds ..B19.30
-        movl      20(%ebp), %eax                                #896.22
-        cmpl      $2, %eax                                      #896.22
-        jae       ..B19.34      # Prob 50%                      #896.22
-                                # LOE ebx
-..B19.33:                       # Preds ..B19.32
-        movzbl    16(%esp), %eax                                #898.29
-        movl      $2, (%ebx)                                    #908.9
-        movb      %al, 17(%esp)                                 #898.9
-        movzwl    16(%esp), %esi                                #899.29
-        movzbl    32(%esp), %eax                                #903.26
-        movw      %si, 18(%esp)                                 #899.9
-        movl      16(%esp), %edx                                #900.29
-        movl      %edx, 20(%esp)                                #900.9
-        movl      16(%esp), %edi                                #901.29
-        movl      %edi, 24(%esp)                                #901.9
-        movl      %edx, 28(%esp)                                #901.9
-        movb      %al, 33(%esp)                                 #903.9
-        movzwl    32(%esp), %eax                                #904.26
-        movw      %ax, 34(%esp)                                 #904.9
-        movl      32(%esp), %edx                                #905.26
-        movl      %edx, 36(%esp)                                #905.9
-        movl      32(%esp), %eax                                #906.26
-        movl      %eax, 40(%esp)                                #906.9
-        movl      %edx, 44(%esp)                                #906.9
-        jmp       ..B19.41      # Prob 100%                     #906.9
-                                # LOE ebx
-..B19.34:                       # Preds ..B19.32
-        movl      20(%ebp), %eax                                #910.22
-        cmpl      $6, %eax                                      #910.22
-        jae       ..B19.36      # Prob 50%                      #910.22
-                                # LOE ebx
-..B19.35:                       # Preds ..B19.34
-        movzwl    16(%esp), %eax                                #912.29
-        movzwl    32(%esp), %edi                                #916.26
-        movl      $3, (%ebx)                                    #920.9
-        movw      %ax, 18(%esp)                                 #912.9
-        movl      16(%esp), %esi                                #913.29
-        movl      %esi, 20(%esp)                                #913.9
-        movl      16(%esp), %edx                                #914.29
-        movl      %edx, 24(%esp)                                #914.9
-        movl      %esi, 28(%esp)                                #914.9
-        movw      %di, 34(%esp)                                 #916.9
-        movl      32(%esp), %edx                                #917.26
-        movl      %edx, 36(%esp)                                #917.9
-        movl      32(%esp), %eax                                #918.26
-        movl      %eax, 40(%esp)                                #918.9
-        movl      %edx, 44(%esp)                                #918.9
-        jmp       ..B19.41      # Prob 100%                     #918.9
-                                # LOE ebx
-..B19.36:                       # Preds ..B19.34
-        movl      20(%ebp), %eax                                #922.22
-        cmpl      $14, %eax                                     #922.22
-        jae       ..B19.38      # Prob 50%                      #922.22
-                                # LOE ebx
-..B19.37:                       # Preds ..B19.36
-        movl      16(%esp), %edx                                #924.29
-        movl      32(%esp), %edi                                #927.26
-        movl      $4, (%ebx)                                    #930.9
-        movl      %edx, 20(%esp)                                #924.9
-        movl      16(%esp), %eax                                #925.29
-        movl      %eax, 24(%esp)                                #925.9
-        movl      %edx, 28(%esp)                                #925.9
-        movl      %edi, 36(%esp)                                #927.9
-        movl      32(%esp), %esi                                #928.26
-        movl      %esi, 40(%esp)                                #928.9
-        movl      %edi, 44(%esp)                                #928.9
-        jmp       ..B19.41      # Prob 100%                     #928.9
-                                # LOE ebx
-..B19.38:                       # Preds ..B19.36
-        movl      20(%ebp), %eax                                #932.22
-        cmpl      $30, %eax                                     #932.22
-        jae       ..B19.40      # Prob 50%                      #932.22
-                                # LOE ebx
-..B19.39:                       # Preds ..B19.38
-        movl      16(%esp), %eax                                #934.29
-        movl      20(%esp), %edx                                #934.29
-        movl      32(%esp), %esi                                #935.26
-        movl      36(%esp), %edi                                #935.26
-        movl      %eax, 24(%esp)                                #934.9
-        movl      $0, (%ebx)                                    #937.9
-        movl      %edx, 28(%esp)                                #934.9
-        movl      %esi, 40(%esp)                                #935.9
-        movl      %edi, 44(%esp)                                #935.9
-        jmp       ..B19.41      # Prob 100%                     #935.9
-                                # LOE ebx
-..B19.40:                       # Preds ..B19.38
-        movl      $5, (%ebx)                                    #941.9
-                                # LOE ebx
-..B19.41:                       # Preds ..B19.31 ..B19.33 ..B19.35 ..B19.37 ..B19.39
-                                #       ..B19.40
-        movl      16(%esp), %eax                                #944.42
-        movl      20(%esp), %esi                                #944.42
-        movl      24(%esp), %edi                                #944.42
-        lea       16(%esp), %ecx                                #948.5
-        movl      %eax, 16(%ebx)                                #944.42
-        movl      28(%esp), %eax                                #944.42
-        movl      %esi, 20(%ebx)                                #944.42
-        movl      %edi, 24(%ebx)                                #944.42
-        movl      %eax, 28(%ebx)                                #944.42
-        movl      32(%esp), %eax                                #945.39
-        movl      %eax, 32(%ebx)                                #945.39
-        movl      36(%esp), %eax                                #945.39
-        movl      %eax, 36(%ebx)                                #945.39
-        movl      40(%esp), %eax                                #945.39
-        movl      %eax, 40(%ebx)                                #945.39
-        movl      44(%esp), %eax                                #945.39
-        movl      %eax, 44(%ebx)                                #945.39
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #948.5
-        lea       32(%esp), %ecx                                #949.5
-# Begin ASM
-        mov (%ecx), %eax;mov 12(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 12(%ecx);mov %edx, (%ecx);mov 4(%ecx), %eax;mov 8(%ecx), %edx;bswap %eax;bswap %edx;mov %eax, 8(%ecx);mov %edx, 4(%ecx);
-# End ASM                                                       #949.5
-        movl      $2, %ecx                                      #952.5
-        lea       16(%esp), %edx                                #952.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #952.5
-        lea       32(%esp), %edx                                #953.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #953.5
-        lea       48(%ebx), %ecx                                #956.5
-        lea       16(%esp), %edx                                #956.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #956.5
-        lea       64(%ebx), %ecx                                #957.5
-        lea       32(%esp), %edx                                #957.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #957.5
-        movl      $2, %ecx                                      #959.5
-        lea       16(%esp), %edx                                #959.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #959.5
-        lea       32(%esp), %edx                                #960.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #960.5
-        lea       80(%ebx), %ecx                                #962.5
-        lea       16(%esp), %edx                                #962.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #962.5
-        lea       96(%ebx), %ecx                                #963.5
-        lea       32(%esp), %edx                                #963.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #963.5
-        movl      $2, %ecx                                      #965.5
-        lea       16(%esp), %edx                                #965.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #965.5
-        lea       32(%esp), %edx                                #966.5
-# Begin ASM
-        mov 4(%edx), %eax;shrd %cl, %eax, (%edx);mov 8(%edx), %eax;shrd %cl, %eax, 4(%edx);mov 12(%edx), %eax;shrd %cl, %eax, 8(%edx);shr %cl, %eax;mov %eax, 12(%edx);
-# End ASM                                                       #966.5
-        lea       112(%ebx), %ecx                               #968.5
-        lea       16(%esp), %edx                                #968.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #968.5
-        addl      $128, %ebx                                    #969.5
-        movl      %ebx, %ecx                                    #969.5
-        lea       32(%esp), %edx                                #969.5
-# Begin ASM
-        push %ebx;mov (%edx), %eax;mov 12(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 12(%ecx);mov %ebx, (%ecx);mov 4(%edx), %eax;mov 8(%edx), %ebx;bswap %eax;bswap %ebx;mov %eax, 8(%ecx);mov %ebx, 4(%ecx);pop %ebx;
-# End ASM                                                       #969.5
-        xorl      %eax, %eax                                    #1011.12
-        addl      $52, %esp                                     #1011.12
-        popl      %ebx                                          #1011.12
-        popl      %esi                                          #1011.12
-        popl      %edi                                          #1011.12
-        movl      %ebp, %esp                                    #1011.12
-        popl      %ebp                                          #1011.12
-        ret                                                     #1011.12
-                                # LOE
-..B19.42:                       # Preds ..B19.18                # Infreq
-        xorl      %eax, %eax                                    #881.5
-        jmp       ..B19.26      # Prob 100%                     #881.5
-                                # LOE eax ebx esi edi
-..B19.43:                       # Preds ..B19.8                 # Infreq
-        movl      %edi, %ecx                                    #862.32
-        shrl      $2, %ecx                                      #862.32
-        movb      $192, 32(%esp,%ecx)                           #863.13
-        shll      $6, %edx                                      #862.46
-        movb      %dl, 16(%esp,%ecx)                            #862.13
-        jmp       ..B19.15      # Prob 100%                     #862.13
-                                # LOE eax esi edi
-..B19.44:                       # Preds ..B19.6                 # Infreq
-        xorl      %edi, %edi                                    #
-        jmp       ..B19.17      # Prob 100%                     #
-                                # LOE ebx edi
-..B19.45:                       # Preds ..B19.4 ..B19.5         # Infreq
-        movl      12(%esp), %ebx                                #849.16
-        call      __errno_location at PLT                          #849.16
-                                # LOE eax
-..B19.49:                       # Preds ..B19.45                # Infreq
-        movl      (%eax), %eax                                  #849.16
-        addl      $52, %esp                                     #849.16
-        popl      %ebx                                          #849.16
-        popl      %esi                                          #849.16
-        popl      %edi                                          #849.16
-        movl      %ebp, %esp                                    #849.16
-        popl      %ebp                                          #849.16
-        ret                                                     #849.16
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-	.data
-# -- End  NucStrFastaExprMake2
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1: 12 + %esp
-..B20.1:                        # Preds ..B20.0
-        pushl     %ebp                                          #1574.1
-        pushl     %ebx                                          #1574.1
-        movl      12(%esp), %ebp                                #1573.6
-        testl     %ebp, %ebp                                    #1575.18
-        je        ..B20.22      # Prob 12%                      #1575.18
-                                # LOE ebp esi edi
-..B20.2:                        # Preds ..B20.1
-        movl      (%ebp), %eax                                  #1577.18
-        call      ..L14         # Prob 100%                     #
-..L14:                                                          #
-        popl      %ebx                                          #
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L14], %ebx      #
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B20.21      # Prob 50%                      #1577.9
-                                # LOE eax ebx ebp esi edi
-..B20.3:                        # Preds ..B20.2
-        movl      ..1..TPKT.18_0.0.15 at GOTOFF(%ebx,%eax,4), %eax #1577.9
-        jmp       *%eax                                         #1577.9
-                                # LOE ebx ebp esi edi
-..1.18_0.TAG.0c.0.15:
-..B20.5:                        # Preds ..B20.3
-        pushl     8(%ebp)                                       #1601.30
-        call      NucStrstrWhack at PLT                            #1601.13
-                                # LOE ebx ebp esi edi
-..B20.25:                       # Preds ..B20.5
-        popl      %ecx                                          #1601.13
-        jmp       ..B20.21      # Prob 100%                     #1601.13
-                                # LOE ebx ebp esi edi
-..1.18_0.TAG.0b.0.15:
-..B20.7:                        # Preds ..B20.3
-        pushl     8(%ebp)                                       #1597.30
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE ebx ebp esi edi
-..B20.8:                        # Preds ..B20.7
-        pushl     12(%ebp)                                      #1598.30
-        call      NucStrstrWhack at PLT                            #1598.13
-                                # LOE ebx ebp esi edi
-..B20.26:                       # Preds ..B20.8
-        addl      $8, %esp                                      #1598.13
-        jmp       ..B20.21      # Prob 100%                     #1598.13
-                                # LOE ebx ebp esi edi
-..1.18_0.TAG.0a.0.15:
-..1.18_0.TAG.09.0.15:
-..1.18_0.TAG.08.0.15:
-..1.18_0.TAG.07.0.15:
-..1.18_0.TAG.06.0.15:
-..1.18_0.TAG.05.0.15:
-..1.18_0.TAG.04.0.15:
-..1.18_0.TAG.03.0.15:
-..1.18_0.TAG.02.0.15:
-..1.18_0.TAG.01.0.15:
-..1.18_0.TAG.00.0.15:
-..B20.20:                       # Preds ..B20.3 ..B20.3 ..B20.3 ..B20.3 ..B20.3
-                                #       ..B20.3 ..B20.3 ..B20.3 ..B20.3 ..B20.3
-                                #       ..B20.3
-        movl      8(%ebp), %ebp                                 #1593.20
-                                # LOE ebx ebp esi edi
-..B20.21:                       # Preds ..B20.26 ..B20.25 ..B20.20 ..B20.2
-        pushl     %ebp                                          #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE esi edi
-..B20.27:                       # Preds ..B20.21
-        popl      %ecx                                          #1604.9
-                                # LOE esi edi
-..B20.22:                       # Preds ..B20.27 ..B20.1
-        popl      %ebx                                          #1606.1
-        popl      %ebp                                          #1606.1
-        ret                                                     #1606.1
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-	.section .data1, "wa"
-	.align 4
-..1..TPKT.18_0.0.15:
-	.long	..1.18_0.TAG.00.0.15
-	.long	..1.18_0.TAG.01.0.15
-	.long	..1.18_0.TAG.02.0.15
-	.long	..1.18_0.TAG.03.0.15
-	.long	..1.18_0.TAG.04.0.15
-	.long	..1.18_0.TAG.05.0.15
-	.long	..1.18_0.TAG.06.0.15
-	.long	..1.18_0.TAG.07.0.15
-	.long	..1.18_0.TAG.08.0.15
-	.long	..1.18_0.TAG.09.0.15
-	.long	..1.18_0.TAG.0a.0.15
-	.long	..1.18_0.TAG.0b.0.15
-	.long	..1.18_0.TAG.0c.0.15
-	.data
-# -- End  NucStrstrWhack
-	.text
-# -- Begin  NucStrstrInit
-# mark_begin;
-       .align    2,0x90
-NucStrstrInit:
-..B21.1:                        # Preds ..B21.0
-        pushl     %edi                                          #1484.1
-        pushl     %esi                                          #1484.1
-        pushl     %ebp                                          #1484.1
-        pushl     %ebx                                          #1484.1
-        subl      $12, %esp                                     #1484.1
-        movl      $-1, %edx                                     #1491.5
-        call      ..L15         # Prob 100%                     #1484.1
-..L15:                                                          #
-        popl      %ebx                                          #1484.1
-        addl      $_GLOBAL_OFFSET_TABLE_+[. - ..L15], %ebx      #1484.1
-        lea       fasta_2na_map.0 at GOTOFF(%ebx), %eax            #1491.14
-        movd      %edx, %xmm0                                   #1491.5
-        pshufd    $0, %xmm0, %xmm1                              #1491.5
-        movq      %xmm1, (%eax)                                 #1491.5
-        movq      %xmm1, 8(%eax)                                #1491.5
-        movq      %xmm1, 16(%eax)                               #1491.5
-        movq      %xmm1, 24(%eax)                               #1491.5
-        movq      %xmm1, 32(%eax)                               #1491.5
-        movq      %xmm1, 40(%eax)                               #1491.5
-        movq      %xmm1, 48(%eax)                               #1491.5
-        movq      %xmm1, 56(%eax)                               #1491.5
-        movq      %xmm1, 64(%eax)                               #1491.5
-        movq      %xmm1, 72(%eax)                               #1491.5
-        movq      %xmm1, 80(%eax)                               #1491.5
-        movq      %xmm1, 88(%eax)                               #1491.5
-        movq      %xmm1, 96(%eax)                               #1491.5
-        movq      %xmm1, 104(%eax)                              #1491.5
-        movq      %xmm1, 112(%eax)                              #1491.5
-        movq      %xmm1, 120(%eax)                              #1491.5
-                                # LOE eax ebx edi
-..B21.2:                        # Preds ..B21.1
-        lea       fasta_4na_map.0 at GOTOFF(%ebx), %ecx            #1492.14
-        movl      $-1, %edx                                     #1492.5
-        movd      %edx, %xmm0                                   #1492.5
-        pshufd    $0, %xmm0, %xmm1                              #1492.5
-        movq      %xmm1, (%ecx)                                 #1492.5
-        movq      %xmm1, 8(%ecx)                                #1492.5
-        movq      %xmm1, 16(%ecx)                               #1492.5
-        movq      %xmm1, 24(%ecx)                               #1492.5
-        movq      %xmm1, 32(%ecx)                               #1492.5
-        movq      %xmm1, 40(%ecx)                               #1492.5
-        movq      %xmm1, 48(%ecx)                               #1492.5
-        movq      %xmm1, 56(%ecx)                               #1492.5
-        movq      %xmm1, 64(%ecx)                               #1492.5
-        movq      %xmm1, 72(%ecx)                               #1492.5
-        movq      %xmm1, 80(%ecx)                               #1492.5
-        movq      %xmm1, 88(%ecx)                               #1492.5
-        movq      %xmm1, 96(%ecx)                               #1492.5
-        movq      %xmm1, 104(%ecx)                              #1492.5
-        movq      %xmm1, 112(%ecx)                              #1492.5
-        movq      %xmm1, 120(%ecx)                              #1492.5
-                                # LOE eax ecx ebx edi
-..B21.3:                        # Preds ..B21.2
-        lea       _2__STRING.0.0 at GOTOFF(%ebx), %esi             #1487.29
-        movsbl    (%esi), %ebp                                  #1497.14
-        movl      %ecx, 4(%esp)                                 #
-        movl      %eax, 8(%esp)                                 #
-        xorl      %edx, %edx                                    #
-                                # LOE edx ebx ebp esi
-..B21.10:                       # Preds ..B21.3 ..B21.11
-        pushl     %ebp                                          #1497.9
-        movl      %edx, 4(%esp)                                 #1498.48
-        call      tolower at PLT                                   #1498.48
-                                # LOE eax ebx ebp esi
-..B21.29:                       # Preds ..B21.10
-        movl      4(%esp), %edx                                 #
-        addl      $4, %esp                                      #1498.48
-                                # LOE eax edx ebx ebp esi dl dh
-..B21.11:                       # Preds ..B21.29
-        movl      8(%esp), %ecx                                 #1498.32
-        movb      %dl, (%eax,%ecx)                              #1498.32
-        movb      %dl, (%ecx,%ebp)                              #1498.9
-        movsbl    1(%esi), %ebp                                 #1495.31
-        addl      $1, %edx                                      #1495.48
-        addl      $1, %esi                                      #1495.54
-        testl     %ebp, %ebp                                    #1495.42
-        jne       ..B21.10      # Prob 82%                      #1495.42
-                                # LOE edx ebx ebp esi
-..B21.12:                       # Preds ..B21.11
-        movl      4(%esp), %ecx                                 #
-        lea       _2__STRING.1.0 at GOTOFF(%ebx), %esi             #1488.25
-        movsbl    (%esi), %ebp                                  #1504.14
-        movl      %ecx, 4(%esp)                                 #
-        xorl      %edx, %edx                                    #
-                                # LOE edx ebx ebp esi
-..B21.19:                       # Preds ..B21.12 ..B21.20
-        pushl     %ebp                                          #1504.9
-        movl      %edx, 4(%esp)                                 #1505.48
-        call      tolower at PLT                                   #1505.48
-                                # LOE eax ebx ebp esi
-..B21.30:                       # Preds ..B21.19
-        movl      4(%esp), %edx                                 #
-        addl      $4, %esp                                      #1505.48
-                                # LOE eax edx ebx ebp esi dl dh
-..B21.20:                       # Preds ..B21.30
-        movl      4(%esp), %ecx                                 #1505.32
-        movb      %dl, (%eax,%ecx)                              #1505.32
-        movb      %dl, (%ecx,%ebp)                              #1505.9
-        movsbl    1(%esi), %ebp                                 #1502.31
-        addl      $1, %edx                                      #1502.48
-        addl      $1, %esi                                      #1502.54
-        testl     %ebp, %ebp                                    #1502.42
-        jne       ..B21.19      # Prob 82%                      #1502.42
-                                # LOE edx ebx ebp esi
-..B21.21:                       # Preds ..B21.20
-        lea       512(%ebx), %eax                               #1510.11
-                                # LOE eax ebx edi
-..B21.22:                       # Preds ..B21.25 ..B21.21
-        movzwl    expand_2na.0 at GOTOFF(%ebx), %edx               #1511.28
-                                # LOE eax edx ebx edi
-..B21.24:                       # Preds ..B21.22
-# Begin ASM
-        rorw $8, %dx
-# End ASM                                                       #1511.0
-                                # LOE eax edx ebx edi
-..B21.25:                       # Preds ..B21.24
-        movw      %dx, expand_2na.0 at GOTOFF(%ebx)                #1511.9
-        addl      $2, %ebx                                      #1510.30
-        cmpl      %ebx, %eax                                    #1510.22
-        ja        ..B21.22      # Prob 99%                      #1510.22
-                                # LOE eax ebx edi
-..B21.26:                       # Preds ..B21.25
-        addl      $12, %esp                                     #1513.1
-        popl      %ebx                                          #1513.1
-        popl      %ebp                                          #1513.1
-        popl      %esi                                          #1513.1
-        popl      %edi                                          #1513.1
-        ret                                                     #1513.1
-        .align    2,0x90
-                                # LOE
-# mark_end;
-	.type	NucStrstrInit, at function
-	.size	NucStrstrInit,.-NucStrstrInit
-	.data
-# -- End  NucStrstrInit
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map.0:
-	.type	fasta_2na_map.0, at object
-	.size	fasta_2na_map.0,128
-	.space 128	# pad
-fasta_4na_map.0:
-	.type	fasta_4na_map.0, at object
-	.size	fasta_4na_map.0,128
-	.space 128	# pad
-	.data
-	.align 32
-	.align 32
-expand_2na.0:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na.0, at object
-	.size	expand_2na.0,512
-	.section .rodata.str1.4, "aMS", at progbits,1
-	.align 4
-	.align 4
-_2__STRING.0.0:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.0.0, at object
-	.size	_2__STRING.0.0,5
-	.space 3	# pad
-_2__STRING.1.0:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.1.0, at object
-	.size	_2__STRING.1.0,17
-	.data
-	.section .note.GNU-stack, ""
-# End
diff --git a/libs/search/nucstrstr-icc-x86_64-dbg.pic.s b/libs/search/nucstrstr-icc-x86_64-dbg.pic.s
deleted file mode 100644
index 973e6b2..0000000
--- a/libs/search/nucstrstr-icc-x86_64-dbg.pic.s
+++ /dev/null
@@ -1,25447 +0,0 @@
-	.section .text
-.LNDBG_TX:
-# -- Machine type EFI2
-# mark_description "Intel(R) C++ Compiler Professional for applications running on Intel(R) 64, Version 11.0    Build 20090131 %";
-# mark_description "s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -";
-# mark_description "I/home/yaschenk/devel/internal/asm-trace/inc/gcc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I";
-# mark_description "/home/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home";
-# mark_description "/yaschenk/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -g -Wall -D_DEBUGGING -DLINUX -DUNIX -";
-# mark_description "D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.text
-..TXTST0:
-# -- Begin  uint16_lsbit
-# mark_begin;
-       .align    2,0x90
-uint16_lsbit:
-# parameter 1(self): %edi
-..B1.1:                         # Preds ..B1.0
-..___tag_value_uint16_lsbit.2:                                  #
-..LN1:
-        pushq     %rbp                                          #38.1
-        movq      %rsp, %rbp                                    #38.1
-..___tag_value_uint16_lsbit.3:                                  #
-        subq      $16, %rsp                                     #38.1
-        movw      %di, -8(%rbp)                                 #38.1
-..LN3:
-        movzwl    -8(%rbp), %eax                                #40.0
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #40.0
-        movw      %ax, -16(%rbp)                                #40.0
-..LN5:
-        movswl    -16(%rbp), %eax                               #49.12
-        leave                                                   #49.12
-..___tag_value_uint16_lsbit.7:                                  #
-        ret                                                     #49.12
-        .align    2,0x90
-..___tag_value_uint16_lsbit.8:                                  #
-                                # LOE
-# mark_end;
-	.type	uint16_lsbit, at function
-	.size	uint16_lsbit,.-uint16_lsbit
-.LNuint16_lsbit:
-	.data
-# -- End  uint16_lsbit
-	.text
-# -- Begin  uint128_shr
-# mark_begin;
-       .align    2,0x90
-uint128_shr:
-# parameter 1(self): %rdi
-# parameter 2(i): %esi
-..B2.1:                         # Preds ..B2.0
-..___tag_value_uint128_shr.11:                                  #
-..LN7:
-        pushq     %rbp                                          #262.1
-        movq      %rsp, %rbp                                    #262.1
-..___tag_value_uint128_shr.12:                                  #
-        subq      $16, %rsp                                     #262.1
-        movq      %rdi, -16(%rbp)                               #262.1
-        movl      %esi, -8(%rbp)                                #262.1
-..LN9:
-        movq      -16(%rbp), %rdi                               #263.0
-        movl      -8(%rbp), %esi                                #263.0
-        movl      %esi, %ecx                                    #263.0
-        movq      8(%rdi), %rax                                 #263.0
-        shrdq     %cl, %rax, (%rdi)                             #263.0
-        shrq      %cl, %rax                                     #263.0
-        movq      %rax, 8(%rdi)                                 #263.0
-..LN11:
-        leave                                                   #274.1
-..___tag_value_uint128_shr.16:                                  #
-        ret                                                     #274.1
-        .align    2,0x90
-..___tag_value_uint128_shr.17:                                  #
-                                # LOE
-# mark_end;
-	.type	uint128_shr, at function
-	.size	uint128_shr,.-uint128_shr
-.LNuint128_shr:
-	.data
-# -- End  uint128_shr
-	.text
-# -- Begin  uint128_bswap
-# mark_begin;
-       .align    2,0x90
-uint128_bswap:
-# parameter 1(self): %rdi
-..B3.1:                         # Preds ..B3.0
-..___tag_value_uint128_bswap.20:                                #
-..LN13:
-        pushq     %rbp                                          #294.1
-        movq      %rsp, %rbp                                    #294.1
-..___tag_value_uint128_bswap.21:                                #
-        subq      $16, %rsp                                     #294.1
-        movq      %rdi, -16(%rbp)                               #294.1
-..LN15:
-        movq      -16(%rbp), %rdi                               #295.0
-        movq      (%rdi), %rax                                  #295.0
-        movq      8(%rdi), %rcx                                 #295.0
-        bswap     %rax                                          #295.0
-        bswap     %rcx                                          #295.0
-        movq      %rax, 8(%rdi)                                 #295.0
-        movq      %rcx, (%rdi)                                  #295.0
-..LN17:
-        leave                                                   #307.1
-..___tag_value_uint128_bswap.25:                                #
-        ret                                                     #307.1
-        .align    2,0x90
-..___tag_value_uint128_bswap.26:                                #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap, at function
-	.size	uint128_bswap,.-uint128_bswap
-.LNuint128_bswap:
-	.data
-# -- End  uint128_bswap
-	.text
-# -- Begin  uint128_bswap_copy
-# mark_begin;
-       .align    2,0x90
-uint128_bswap_copy:
-# parameter 1(to): %rdi
-# parameter 2(from): %rsi
-..B4.1:                         # Preds ..B4.0
-..___tag_value_uint128_bswap_copy.29:                           #
-..LN19:
-        pushq     %rbp                                          #311.1
-        movq      %rsp, %rbp                                    #311.1
-..___tag_value_uint128_bswap_copy.30:                           #
-        subq      $16, %rsp                                     #311.1
-        movq      %rdi, -16(%rbp)                               #311.1
-        movq      %rsi, -8(%rbp)                                #311.1
-..LN21:
-        movq      -16(%rbp), %rdi                               #312.0
-        movq      -8(%rbp), %rsi                                #312.0
-        movq      (%rsi), %rax                                  #312.0
-        movq      8(%rsi), %rcx                                 #312.0
-        bswap     %rax                                          #312.0
-        bswap     %rcx                                          #312.0
-        movq      %rax, 8(%rdi)                                 #312.0
-        movq      %rcx, (%rdi)                                  #312.0
-..LN23:
-        leave                                                   #324.1
-..___tag_value_uint128_bswap_copy.34:                           #
-        ret                                                     #324.1
-        .align    2,0x90
-..___tag_value_uint128_bswap_copy.35:                           #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap_copy, at function
-	.size	uint128_bswap_copy,.-uint128_bswap_copy
-.LNuint128_bswap_copy:
-	.data
-# -- End  uint128_bswap_copy
-	.text
-# -- Begin  NucStrFastaExprAlloc
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprAlloc:
-# parameter 1(sz): %rdi
-..B5.1:                         # Preds ..B5.0
-..___tag_value_NucStrFastaExprAlloc.38:                         #
-..LN25:
-        pushq     %rbp                                          #790.1
-        movq      %rsp, %rbp                                    #790.1
-..___tag_value_NucStrFastaExprAlloc.39:                         #
-        subq      $32, %rsp                                     #790.1
-        movq      %rdi, -24(%rbp)                               #790.1
-..LN27:
-        movq      -24(%rbp), %rax                               #791.28
-..LN29:
-        addq      $16, %rax                                     #791.33
-..LN31:
-        movq      %rax, %rdi                                    #791.19
-        call      malloc at PLT                                    #791.19
-                                # LOE rax
-..B5.11:                        # Preds ..B5.1
-        movq      %rax, -8(%rbp)                                #791.19
-                                # LOE
-..B5.2:                         # Preds ..B5.11
-..LN33:
-        movq      -8(%rbp), %rax                                #791.17
-        movq      %rax, -16(%rbp)                               #791.17
-..LN35:
-        movq      -16(%rbp), %rax                               #792.10
-..LN37:
-        testq     %rax, %rax                                    #792.19
-        je        ..B5.8        # Prob 50%                      #792.19
-                                # LOE
-..B5.3:                         # Preds ..B5.2
-..LN39:
-        movq      -16(%rbp), %rax                               #795.28
-..LN41:
-        addq      $15, %rax                                     #795.36
-..LN43:
-        andq      $-16, %rax                                    #795.43
-..LN45:
-        movq      %rax, -32(%rbp)                               #794.28
-..LN47:
-        movq      -32(%rbp), %rax                               #796.9
-..LN49:
-        movq      -16(%rbp), %rdx                               #796.26
-..LN51:
-        movq      %rdx, 8(%rax)                                 #796.9
-..LN53:
-        movq      -32(%rbp), %rax                               #797.9
-        addq      $16, %rax                                     #797.9
-        testq     $15, %rax                                     #797.9
-        je        ..B5.5        # Prob 50%                      #797.9
-                                # LOE
-..B5.4:                         # Preds ..B5.3
-        lea       _2__STRING.0.0(%rip), %rax                    #797.9
-        lea       _2__STRING.1.0(%rip), %rdx                    #797.9
-        lea       __$U0.0(%rip), %rcx                           #797.9
-        movq      %rax, %rdi                                    #797.9
-        movq      %rdx, %rsi                                    #797.9
-        movl      $797, %edx                                    #797.9
-        call      __assert_fail at PLT                             #797.9
-                                # LOE
-..B5.5:                         # Preds ..B5.3
-..LN55:
-        movq      -32(%rbp), %rax                               #798.9
-        addq      $32, %rax                                     #798.9
-        testq     $15, %rax                                     #798.9
-        je        ..B5.7        # Prob 50%                      #798.9
-                                # LOE
-..B5.6:                         # Preds ..B5.5
-        lea       _2__STRING.2.0(%rip), %rax                    #798.9
-        lea       _2__STRING.1.0(%rip), %rdx                    #798.9
-        lea       __$U0.0(%rip), %rcx                           #798.9
-        movq      %rax, %rdi                                    #798.9
-        movq      %rdx, %rsi                                    #798.9
-        movl      $798, %edx                                    #798.9
-        call      __assert_fail at PLT                             #798.9
-                                # LOE
-..B5.7:                         # Preds ..B5.5
-..LN57:
-        movq      -32(%rbp), %rax                               #799.16
-        leave                                                   #799.16
-..___tag_value_NucStrFastaExprAlloc.43:                         #
-        ret                                                     #799.16
-..___tag_value_NucStrFastaExprAlloc.44:                         #
-                                # LOE
-..B5.8:                         # Preds ..B5.2
-..LN59:
-        xorl      %eax, %eax                                    #801.12
-        leave                                                   #801.12
-..___tag_value_NucStrFastaExprAlloc.46:                         #
-        ret                                                     #801.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprAlloc.47:                         #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprAlloc, at function
-	.size	NucStrFastaExprAlloc,.-NucStrFastaExprAlloc
-.LNNucStrFastaExprAlloc:
-	.data
-# -- End  NucStrFastaExprAlloc
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake2:
-# parameter 1(expr): %rdi
-# parameter 2(positional): %esi
-# parameter 3(fasta): %rdx
-# parameter 4(size): %rcx
-..B6.1:                         # Preds ..B6.0
-..___tag_value_NucStrFastaExprMake2.50:                         #
-..LN61:
-        pushq     %rbp                                          #838.1
-        movq      %rsp, %rbp                                    #838.1
-..___tag_value_NucStrFastaExprMake2.51:                         #
-        subq      $112, %rsp                                    #838.1
-        movq      %rdi, -48(%rbp)                               #838.1
-        movl      %esi, -16(%rbp)                               #838.1
-        movq      %rdx, -40(%rbp)                               #838.1
-        movq      %rcx, -32(%rbp)                               #838.1
-..LN63:
-        movq      -32(%rbp), %rax                               #844.10
-..LN65:
-        cmpq      $61, %rax                                     #844.17
-        jbe       ..B6.3        # Prob 50%                      #844.17
-                                # LOE
-..B6.2:                         # Preds ..B6.1
-..LN67:
-        movl      $7, %eax                                      #845.16
-        leave                                                   #845.16
-..___tag_value_NucStrFastaExprMake2.55:                         #
-        ret                                                     #845.16
-..___tag_value_NucStrFastaExprMake2.56:                         #
-                                # LOE
-..B6.3:                         # Preds ..B6.1
-..LN69:
-        movl      $144, %edi                                    #847.9
-        call      NucStrFastaExprAlloc at PLT                      #847.9
-                                # LOE rax
-..B6.48:                        # Preds ..B6.3
-        movq      %rax, -56(%rbp)                               #847.9
-                                # LOE
-..B6.4:                         # Preds ..B6.48
-..LN71:
-        movq      -56(%rbp), %rax                               #847.5
-        movq      %rax, -64(%rbp)                               #847.5
-..LN73:
-        movq      -64(%rbp), %rax                               #848.10
-..LN75:
-        testq     %rax, %rax                                    #848.15
-        jne       ..B6.6        # Prob 50%                      #848.15
-                                # LOE
-..B6.5:                         # Preds ..B6.4
-..LN77:
-        call      __errno_location at PLT                          #849.16
-                                # LOE rax
-..B6.49:                        # Preds ..B6.5
-        movl      (%rax), %eax                                  #849.16
-        leave                                                   #849.16
-..___tag_value_NucStrFastaExprMake2.58:                         #
-        ret                                                     #849.16
-..___tag_value_NucStrFastaExprMake2.59:                         #
-                                # LOE
-..B6.6:                         # Preds ..B6.4
-..LN79:
-        movq      -48(%rbp), %rax                               #851.5
-..LN81:
-        movq      -64(%rbp), %rdx                               #851.14
-..LN83:
-        movq      %rdx, (%rax)                                  #851.5
-..LN85:
-        movq      -32(%rbp), %rax                               #852.38
-..LN87:
-        movq      -64(%rbp), %rdx                               #852.5
-        movl      %eax, 4(%rdx)                                 #852.5
-..LN89:
-        movq      $0, -80(%rbp)                                 #856.11
-..LN91:
-        movq      -80(%rbp), %rax                               #856.18
-..LN93:
-        movq      -32(%rbp), %rdx                               #856.22
-        cmpq      %rdx, %rax                                    #856.22
-        jb        ..B6.9        # Prob 50%                      #856.22
-        jmp       ..B6.17       # Prob 100%                     #856.22
-                                # LOE
-..B6.7:                         # Preds ..B6.13 ..B6.14 ..B6.15 ..B6.16 ..B6.12
-                                #      
-..LN95:
-        incq      -80(%rbp)                                     #856.31
-..LN97:
-        movq      -80(%rbp), %rax                               #856.18
-..LN99:
-        movq      -32(%rbp), %rdx                               #856.22
-        cmpq      %rdx, %rax                                    #856.22
-        jae       ..B6.17       # Prob 50%                      #856.22
-                                # LOE
-..B6.9:                         # Preds ..B6.6 ..B6.7
-..LN101:
-        movq      -40(%rbp), %rax                               #858.48
-..LN103:
-        movq      -80(%rbp), %rdx                               #858.56
-..LN105:
-        movzbl    (%rdx,%rax), %eax                             #858.48
-        movsbq    %al, %rax                                     #858.48
-..LN107:
-        movslq    %eax, %rax                                    #858.24
-        lea       fasta_2na_map.0(%rip), %rdx                   #858.24
-        movzbl    (%rax,%rdx), %eax                             #858.24
-        movsbq    %al, %rax                                     #858.24
-..LN109:
-        movb      %al, -24(%rbp)                                #858.22
-..LN111:
-        movq      -80(%rbp), %rax                               #859.18
-..LN113:
-        andq      $3, %rax                                      #859.22
-        movq      %rax, -72(%rbp)                               #859.22
-        je        ..B6.13       # Prob 50%                      #859.22
-                                # LOE
-..B6.10:                        # Preds ..B6.9
-        movq      -72(%rbp), %rax                               #859.22
-        cmpq      $1, %rax                                      #859.22
-        je        ..B6.14       # Prob 50%                      #859.22
-                                # LOE
-..B6.11:                        # Preds ..B6.10
-        movq      -72(%rbp), %rax                               #859.22
-        cmpq      $2, %rax                                      #859.22
-        je        ..B6.15       # Prob 50%                      #859.22
-                                # LOE
-..B6.12:                        # Preds ..B6.11
-        movq      -72(%rbp), %rax                               #859.22
-        cmpq      $3, %rax                                      #859.22
-        je        ..B6.16       # Prob 50%                      #859.22
-        jmp       ..B6.7        # Prob 100%                     #859.22
-                                # LOE
-..B6.13:                        # Preds ..B6.9
-..LN115:
-        movzbl    -24(%rbp), %eax                               #862.38
-..LN117:
-        shll      $6, %eax                                      #862.46
-..LN119:
-        movq      -80(%rbp), %rdx                               #862.27
-..LN121:
-        shrq      $2, %rdx                                      #862.32
-..LN123:
-        movb      %al, -112(%rbp,%rdx)                          #862.13
-..LN125:
-        movq      -80(%rbp), %rax                               #863.24
-..LN127:
-        shrq      $2, %rax                                      #863.29
-..LN129:
-        movb      $192, -96(%rbp,%rax)                          #863.13
-        jmp       ..B6.7        # Prob 100%                     #863.13
-                                # LOE
-..B6.14:                        # Preds ..B6.10
-..LN131:
-        movq      -80(%rbp), %rax                               #866.27
-..LN133:
-        shrq      $2, %rax                                      #866.32
-..LN135:
-        movzbl    -112(%rbp,%rax), %eax                         #866.13
-..LN137:
-        movzbl    -24(%rbp), %edx                               #866.39
-..LN139:
-        shll      $4, %edx                                      #866.47
-..LN141:
-        orl       %edx, %eax                                    #866.13
-..LN143:
-        movq      -80(%rbp), %rdx                               #866.27
-..LN145:
-        shrq      $2, %rdx                                      #866.32
-..LN147:
-        movb      %al, -112(%rbp,%rdx)                          #866.13
-..LN149:
-        movq      -80(%rbp), %rax                               #867.24
-..LN151:
-        shrq      $2, %rax                                      #867.29
-..LN153:
-        movzbl    -96(%rbp,%rax), %eax                          #867.13
-        orl       $48, %eax                                     #867.13
-..LN155:
-        movq      -80(%rbp), %rdx                               #867.24
-..LN157:
-        shrq      $2, %rdx                                      #867.29
-..LN159:
-        movb      %al, -96(%rbp,%rdx)                           #867.13
-        jmp       ..B6.7        # Prob 100%                     #867.13
-                                # LOE
-..B6.15:                        # Preds ..B6.11
-..LN161:
-        movq      -80(%rbp), %rax                               #870.27
-..LN163:
-        shrq      $2, %rax                                      #870.32
-..LN165:
-        movzbl    -112(%rbp,%rax), %eax                         #870.13
-..LN167:
-        movzbl    -24(%rbp), %edx                               #870.39
-..LN169:
-        shll      $2, %edx                                      #870.47
-..LN171:
-        orl       %edx, %eax                                    #870.13
-..LN173:
-        movq      -80(%rbp), %rdx                               #870.27
-..LN175:
-        shrq      $2, %rdx                                      #870.32
-..LN177:
-        movb      %al, -112(%rbp,%rdx)                          #870.13
-..LN179:
-        movq      -80(%rbp), %rax                               #871.24
-..LN181:
-        shrq      $2, %rax                                      #871.29
-..LN183:
-        movzbl    -96(%rbp,%rax), %eax                          #871.13
-        orl       $12, %eax                                     #871.13
-..LN185:
-        movq      -80(%rbp), %rdx                               #871.24
-..LN187:
-        shrq      $2, %rdx                                      #871.29
-..LN189:
-        movb      %al, -96(%rbp,%rdx)                           #871.13
-        jmp       ..B6.7        # Prob 100%                     #871.13
-                                # LOE
-..B6.16:                        # Preds ..B6.12
-..LN191:
-        movq      -80(%rbp), %rax                               #874.27
-..LN193:
-        shrq      $2, %rax                                      #874.32
-..LN195:
-        movzbl    -112(%rbp,%rax), %eax                         #874.13
-..LN197:
-        movzbl    -24(%rbp), %edx                               #874.39
-..LN199:
-        orl       %edx, %eax                                    #874.13
-..LN201:
-        movq      -80(%rbp), %rdx                               #874.27
-..LN203:
-        shrq      $2, %rdx                                      #874.32
-..LN205:
-        movb      %al, -112(%rbp,%rdx)                          #874.13
-..LN207:
-        movq      -80(%rbp), %rax                               #875.24
-..LN209:
-        shrq      $2, %rax                                      #875.29
-..LN211:
-        movzbl    -96(%rbp,%rax), %eax                          #875.13
-        orl       $3, %eax                                      #875.13
-..LN213:
-        movq      -80(%rbp), %rdx                               #875.24
-..LN215:
-        shrq      $2, %rdx                                      #875.29
-..LN217:
-        movb      %al, -96(%rbp,%rdx)                           #875.13
-        jmp       ..B6.7        # Prob 100%                     #875.13
-                                # LOE
-..B6.17:                        # Preds ..B6.7 ..B6.6
-..LN219:
-        movq      -80(%rbp), %rax                               #881.17
-..LN221:
-        addq      $3, %rax                                      #881.21
-..LN223:
-        shrq      $2, %rax                                      #881.28
-..LN225:
-        movq      %rax, -80(%rbp)                               #881.11
-..LN227:
-        movq      -80(%rbp), %rax                               #881.31
-..LN229:
-        cmpq      $16, %rax                                     #881.35
-        jae       ..B6.20       # Prob 50%                      #881.35
-                                # LOE
-..B6.19:                        # Preds ..B6.17 ..B6.19
-..LN231:
-        movq      -80(%rbp), %rax                               #883.23
-..LN233:
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, -112(%rbp,%rax)                          #883.9
-..LN235:
-        movq      -80(%rbp), %rax                               #884.20
-..LN237:
-        movb      %dl, -96(%rbp,%rax)                           #884.9
-..LN239:
-        incq      -80(%rbp)                                     #881.42
-..LN241:
-        movq      -80(%rbp), %rax                               #881.31
-..LN243:
-        cmpq      $16, %rax                                     #881.35
-        jb        ..B6.19       # Prob 50%                      #881.35
-                                # LOE
-..B6.20:                        # Preds ..B6.19 ..B6.17
-..LN245:
-        movl      -16(%rbp), %eax                               #890.10
-        testl     %eax, %eax                                    #890.10
-        je        ..B6.22       # Prob 50%                      #890.10
-                                # LOE
-..B6.21:                        # Preds ..B6.20
-..LN247:
-        movq      -64(%rbp), %rax                               #892.9
-        movl      $9, (%rax)                                    #892.9
-        jmp       ..B6.31       # Prob 100%                     #892.9
-                                # LOE
-..B6.22:                        # Preds ..B6.20
-..LN249:
-        movq      -32(%rbp), %rax                               #896.15
-..LN251:
-        cmpq      $2, %rax                                      #896.22
-        jae       ..B6.24       # Prob 50%                      #896.22
-                                # LOE
-..B6.23:                        # Preds ..B6.22
-..LN253:
-        movzbl    -112(%rbp), %eax                              #898.29
-..LN255:
-        movb      %al, -111(%rbp)                               #898.9
-..LN257:
-        movzwl    -112(%rbp), %eax                              #899.29
-..LN259:
-        movw      %ax, -110(%rbp)                               #899.9
-..LN261:
-        movl      -112(%rbp), %eax                              #900.29
-..LN263:
-        movl      %eax, -108(%rbp)                              #900.9
-..LN265:
-        movq      -112(%rbp), %rax                              #901.29
-..LN267:
-        movq      %rax, -104(%rbp)                              #901.9
-..LN269:
-        movzbl    -96(%rbp), %eax                               #903.26
-..LN271:
-        movb      %al, -95(%rbp)                                #903.9
-..LN273:
-        movzwl    -96(%rbp), %eax                               #904.26
-..LN275:
-        movw      %ax, -94(%rbp)                                #904.9
-..LN277:
-        movl      -96(%rbp), %eax                               #905.26
-..LN279:
-        movl      %eax, -92(%rbp)                               #905.9
-..LN281:
-        movq      -96(%rbp), %rax                               #906.26
-..LN283:
-        movq      %rax, -88(%rbp)                               #906.9
-..LN285:
-        movq      -64(%rbp), %rax                               #908.9
-        movl      $2, (%rax)                                    #908.9
-        jmp       ..B6.31       # Prob 100%                     #908.9
-                                # LOE
-..B6.24:                        # Preds ..B6.22
-..LN287:
-        movq      -32(%rbp), %rax                               #910.15
-..LN289:
-        cmpq      $6, %rax                                      #910.22
-        jae       ..B6.26       # Prob 50%                      #910.22
-                                # LOE
-..B6.25:                        # Preds ..B6.24
-..LN291:
-        movzwl    -112(%rbp), %eax                              #912.29
-..LN293:
-        movw      %ax, -110(%rbp)                               #912.9
-..LN295:
-        movl      -112(%rbp), %eax                              #913.29
-..LN297:
-        movl      %eax, -108(%rbp)                              #913.9
-..LN299:
-        movq      -112(%rbp), %rax                              #914.29
-..LN301:
-        movq      %rax, -104(%rbp)                              #914.9
-..LN303:
-        movzwl    -96(%rbp), %eax                               #916.26
-..LN305:
-        movw      %ax, -94(%rbp)                                #916.9
-..LN307:
-        movl      -96(%rbp), %eax                               #917.26
-..LN309:
-        movl      %eax, -92(%rbp)                               #917.9
-..LN311:
-        movq      -96(%rbp), %rax                               #918.26
-..LN313:
-        movq      %rax, -88(%rbp)                               #918.9
-..LN315:
-        movq      -64(%rbp), %rax                               #920.9
-        movl      $3, (%rax)                                    #920.9
-        jmp       ..B6.31       # Prob 100%                     #920.9
-                                # LOE
-..B6.26:                        # Preds ..B6.24
-..LN317:
-        movq      -32(%rbp), %rax                               #922.15
-..LN319:
-        cmpq      $14, %rax                                     #922.22
-        jae       ..B6.28       # Prob 50%                      #922.22
-                                # LOE
-..B6.27:                        # Preds ..B6.26
-..LN321:
-        movl      -112(%rbp), %eax                              #924.29
-..LN323:
-        movl      %eax, -108(%rbp)                              #924.9
-..LN325:
-        movq      -112(%rbp), %rax                              #925.29
-..LN327:
-        movq      %rax, -104(%rbp)                              #925.9
-..LN329:
-        movl      -96(%rbp), %eax                               #927.26
-..LN331:
-        movl      %eax, -92(%rbp)                               #927.9
-..LN333:
-        movq      -96(%rbp), %rax                               #928.26
-..LN335:
-        movq      %rax, -88(%rbp)                               #928.9
-..LN337:
-        movq      -64(%rbp), %rax                               #930.9
-        movl      $4, (%rax)                                    #930.9
-        jmp       ..B6.31       # Prob 100%                     #930.9
-                                # LOE
-..B6.28:                        # Preds ..B6.26
-..LN339:
-        movq      -32(%rbp), %rax                               #932.15
-..LN341:
-        cmpq      $30, %rax                                     #932.22
-        jae       ..B6.30       # Prob 50%                      #932.22
-                                # LOE
-..B6.29:                        # Preds ..B6.28
-..LN343:
-        movq      -112(%rbp), %rax                              #934.29
-..LN345:
-        movq      %rax, -104(%rbp)                              #934.9
-..LN347:
-        movq      -96(%rbp), %rax                               #935.26
-..LN349:
-        movq      %rax, -88(%rbp)                               #935.9
-..LN351:
-        movq      -64(%rbp), %rax                               #937.9
-        movl      $0, (%rax)                                    #937.9
-        jmp       ..B6.31       # Prob 100%                     #937.9
-                                # LOE
-..B6.30:                        # Preds ..B6.28
-..LN353:
-        movq      -64(%rbp), %rax                               #941.9
-        movl      $5, (%rax)                                    #941.9
-                                # LOE
-..B6.31:                        # Preds ..B6.21 ..B6.23 ..B6.25 ..B6.27 ..B6.29
-                                #       ..B6.30
-..LN355:
-        movq      -64(%rbp), %rax                               #944.5
-..LN357:
-        movq      -112(%rbp), %rdx                              #944.42
-        movq      %rdx, 16(%rax)                                #944.42
-        movq      -104(%rbp), %rdx                              #944.42
-        movq      %rdx, 24(%rax)                                #944.42
-..LN359:
-        movq      -64(%rbp), %rax                               #945.5
-..LN361:
-        movq      -96(%rbp), %rdx                               #945.39
-        movq      %rdx, 32(%rax)                                #945.39
-        movq      -88(%rbp), %rdx                               #945.39
-        movq      %rdx, 40(%rax)                                #945.39
-..LN363:
-        lea       -112(%rbp), %rax                              #948.23
-..LN365:
-        movq      %rax, %rdi                                    #948.5
-        call      uint128_bswap at PLT                             #948.5
-                                # LOE
-..B6.32:                        # Preds ..B6.31
-..LN367:
-        lea       -96(%rbp), %rax                               #949.23
-..LN369:
-        movq      %rax, %rdi                                    #949.5
-        call      uint128_bswap at PLT                             #949.5
-                                # LOE
-..B6.33:                        # Preds ..B6.32
-..LN371:
-        lea       -112(%rbp), %rax                              #952.21
-..LN373:
-        movq      %rax, %rdi                                    #952.5
-        movl      $2, %esi                                      #952.5
-        call      uint128_shr at PLT                               #952.5
-                                # LOE
-..B6.34:                        # Preds ..B6.33
-..LN375:
-        lea       -96(%rbp), %rax                               #953.21
-..LN377:
-        movq      %rax, %rdi                                    #953.5
-        movl      $2, %esi                                      #953.5
-        call      uint128_shr at PLT                               #953.5
-                                # LOE
-..B6.35:                        # Preds ..B6.34
-..LN379:
-        movq      -64(%rbp), %rax                               #956.28
-..LN381:
-        addq      $48, %rax                                     #956.5
-..LN383:
-        lea       -112(%rbp), %rdx                              #956.70
-..LN385:
-        movq      %rax, %rdi                                    #956.5
-        movq      %rdx, %rsi                                    #956.5
-        call      uint128_bswap_copy at PLT                        #956.5
-                                # LOE
-..B6.36:                        # Preds ..B6.35
-..LN387:
-        movq      -64(%rbp), %rax                               #957.28
-..LN389:
-        addq      $64, %rax                                     #957.5
-..LN391:
-        lea       -96(%rbp), %rdx                               #957.67
-..LN393:
-        movq      %rax, %rdi                                    #957.5
-        movq      %rdx, %rsi                                    #957.5
-        call      uint128_bswap_copy at PLT                        #957.5
-                                # LOE
-..B6.37:                        # Preds ..B6.36
-..LN395:
-        lea       -112(%rbp), %rax                              #959.21
-..LN397:
-        movq      %rax, %rdi                                    #959.5
-        movl      $2, %esi                                      #959.5
-        call      uint128_shr at PLT                               #959.5
-                                # LOE
-..B6.38:                        # Preds ..B6.37
-..LN399:
-        lea       -96(%rbp), %rax                               #960.21
-..LN401:
-        movq      %rax, %rdi                                    #960.5
-        movl      $2, %esi                                      #960.5
-        call      uint128_shr at PLT                               #960.5
-                                # LOE
-..B6.39:                        # Preds ..B6.38
-..LN403:
-        movq      -64(%rbp), %rax                               #962.28
-..LN405:
-        addq      $80, %rax                                     #962.5
-..LN407:
-        lea       -112(%rbp), %rdx                              #962.70
-..LN409:
-        movq      %rax, %rdi                                    #962.5
-        movq      %rdx, %rsi                                    #962.5
-        call      uint128_bswap_copy at PLT                        #962.5
-                                # LOE
-..B6.40:                        # Preds ..B6.39
-..LN411:
-        movq      -64(%rbp), %rax                               #963.28
-..LN413:
-        addq      $96, %rax                                     #963.5
-..LN415:
-        lea       -96(%rbp), %rdx                               #963.67
-..LN417:
-        movq      %rax, %rdi                                    #963.5
-        movq      %rdx, %rsi                                    #963.5
-        call      uint128_bswap_copy at PLT                        #963.5
-                                # LOE
-..B6.41:                        # Preds ..B6.40
-..LN419:
-        lea       -112(%rbp), %rax                              #965.21
-..LN421:
-        movq      %rax, %rdi                                    #965.5
-        movl      $2, %esi                                      #965.5
-        call      uint128_shr at PLT                               #965.5
-                                # LOE
-..B6.42:                        # Preds ..B6.41
-..LN423:
-        lea       -96(%rbp), %rax                               #966.21
-..LN425:
-        movq      %rax, %rdi                                    #966.5
-        movl      $2, %esi                                      #966.5
-        call      uint128_shr at PLT                               #966.5
-                                # LOE
-..B6.43:                        # Preds ..B6.42
-..LN427:
-        movq      -64(%rbp), %rax                               #968.28
-..LN429:
-        addq      $112, %rax                                    #968.5
-..LN431:
-        lea       -112(%rbp), %rdx                              #968.70
-..LN433:
-        movq      %rax, %rdi                                    #968.5
-        movq      %rdx, %rsi                                    #968.5
-        call      uint128_bswap_copy at PLT                        #968.5
-                                # LOE
-..B6.44:                        # Preds ..B6.43
-..LN435:
-        movq      -64(%rbp), %rax                               #969.28
-..LN437:
-        addq      $128, %rax                                    #969.5
-..LN439:
-        lea       -96(%rbp), %rdx                               #969.67
-..LN441:
-        movq      %rax, %rdi                                    #969.5
-        movq      %rdx, %rsi                                    #969.5
-        call      uint128_bswap_copy at PLT                        #969.5
-                                # LOE
-..B6.45:                        # Preds ..B6.44
-..LN443:
-        xorl      %eax, %eax                                    #1011.12
-        leave                                                   #1011.12
-..___tag_value_NucStrFastaExprMake2.61:                         #
-        ret                                                     #1011.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprMake2.62:                         #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-.LNNucStrFastaExprMake2:
-	.data
-# -- End  NucStrFastaExprMake2
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    2,0x90
-NucStrFastaExprMake4:
-# parameter 1(expr): %rdi
-# parameter 2(positional): %esi
-# parameter 3(fasta): %rdx
-# parameter 4(size): %rcx
-..B7.1:                         # Preds ..B7.0
-..___tag_value_NucStrFastaExprMake4.65:                         #
-..LN445:
-        pushq     %rbp                                          #1017.1
-        movq      %rsp, %rbp                                    #1017.1
-..___tag_value_NucStrFastaExprMake4.66:                         #
-        subq      $112, %rsp                                    #1017.1
-        movq      %rdi, -40(%rbp)                               #1017.1
-        movl      %esi, -16(%rbp)                               #1017.1
-        movq      %rdx, -32(%rbp)                               #1017.1
-        movq      %rcx, -24(%rbp)                               #1017.1
-..LN447:
-        movq      -24(%rbp), %rax                               #1023.10
-..LN449:
-        cmpq      $29, %rax                                     #1023.17
-        jbe       ..B7.3        # Prob 50%                      #1023.17
-                                # LOE
-..B7.2:                         # Preds ..B7.1
-..LN451:
-        movl      $7, %eax                                      #1024.16
-        leave                                                   #1024.16
-..___tag_value_NucStrFastaExprMake4.70:                         #
-        ret                                                     #1024.16
-..___tag_value_NucStrFastaExprMake4.71:                         #
-                                # LOE
-..B7.3:                         # Preds ..B7.1
-..LN453:
-        movl      $144, %edi                                    #1026.9
-        call      NucStrFastaExprAlloc at PLT                      #1026.9
-                                # LOE rax
-..B7.46:                        # Preds ..B7.3
-        movq      %rax, -56(%rbp)                               #1026.9
-                                # LOE
-..B7.4:                         # Preds ..B7.46
-..LN455:
-        movq      -56(%rbp), %rax                               #1026.5
-        movq      %rax, -64(%rbp)                               #1026.5
-..LN457:
-        movq      -64(%rbp), %rax                               #1027.10
-..LN459:
-        testq     %rax, %rax                                    #1027.15
-        jne       ..B7.6        # Prob 50%                      #1027.15
-                                # LOE
-..B7.5:                         # Preds ..B7.4
-..LN461:
-        call      __errno_location at PLT                          #1028.16
-                                # LOE rax
-..B7.47:                        # Preds ..B7.5
-        movl      (%rax), %eax                                  #1028.16
-        leave                                                   #1028.16
-..___tag_value_NucStrFastaExprMake4.73:                         #
-        ret                                                     #1028.16
-..___tag_value_NucStrFastaExprMake4.74:                         #
-                                # LOE
-..B7.6:                         # Preds ..B7.4
-..LN463:
-        movq      -40(%rbp), %rax                               #1030.5
-..LN465:
-        movq      -64(%rbp), %rdx                               #1030.14
-..LN467:
-        movq      %rdx, (%rax)                                  #1030.5
-..LN469:
-        movq      -24(%rbp), %rax                               #1031.38
-..LN471:
-        movq      -64(%rbp), %rdx                               #1031.5
-        movl      %eax, 4(%rdx)                                 #1031.5
-..LN473:
-        movq      $0, -80(%rbp)                                 #1035.11
-..LN475:
-        movq      -80(%rbp), %rax                               #1035.18
-..LN477:
-        movq      -24(%rbp), %rdx                               #1035.22
-        cmpq      %rdx, %rax                                    #1035.22
-        jb        ..B7.9        # Prob 50%                      #1035.22
-        jmp       ..B7.17       # Prob 100%                     #1035.22
-                                # LOE
-..B7.7:                         # Preds ..B7.13 ..B7.14 ..B7.15 ..B7.16 ..B7.12
-                                #      
-..LN479:
-        incq      -80(%rbp)                                     #1035.31
-..LN481:
-        movq      -80(%rbp), %rax                               #1035.18
-..LN483:
-        movq      -24(%rbp), %rdx                               #1035.22
-        cmpq      %rdx, %rax                                    #1035.22
-        jae       ..B7.17       # Prob 50%                      #1035.22
-                                # LOE
-..B7.9:                         # Preds ..B7.6 ..B7.7
-..LN485:
-        movq      -32(%rbp), %rax                               #1037.49
-..LN487:
-        movq      -80(%rbp), %rdx                               #1037.57
-..LN489:
-        movzbl    (%rdx,%rax), %eax                             #1037.49
-        movsbq    %al, %rax                                     #1037.49
-..LN491:
-        movslq    %eax, %rax                                    #1037.25
-        lea       fasta_4na_map.0(%rip), %rdx                   #1037.25
-        movzbl    (%rax,%rdx), %eax                             #1037.25
-        movsbq    %al, %rax                                     #1037.25
-..LN493:
-        movw      %ax, -48(%rbp)                                #1037.23
-..LN495:
-        movq      -80(%rbp), %rax                               #1038.18
-..LN497:
-        andq      $3, %rax                                      #1038.22
-        movq      %rax, -72(%rbp)                               #1038.22
-        je        ..B7.13       # Prob 50%                      #1038.22
-                                # LOE
-..B7.10:                        # Preds ..B7.9
-        movq      -72(%rbp), %rax                               #1038.22
-        cmpq      $1, %rax                                      #1038.22
-        je        ..B7.14       # Prob 50%                      #1038.22
-                                # LOE
-..B7.11:                        # Preds ..B7.10
-        movq      -72(%rbp), %rax                               #1038.22
-        cmpq      $2, %rax                                      #1038.22
-        je        ..B7.15       # Prob 50%                      #1038.22
-                                # LOE
-..B7.12:                        # Preds ..B7.11
-        movq      -72(%rbp), %rax                               #1038.22
-        cmpq      $3, %rax                                      #1038.22
-        je        ..B7.16       # Prob 50%                      #1038.22
-        jmp       ..B7.7        # Prob 100%                     #1038.22
-                                # LOE
-..B7.13:                        # Preds ..B7.9
-..LN499:
-        movzwl    -48(%rbp), %eax                               #1041.38
-..LN501:
-        shll      $4, %eax                                      #1041.46
-..LN503:
-        movq      -80(%rbp), %rdx                               #1041.27
-..LN505:
-        shrq      $2, %rdx                                      #1041.32
-..LN507:
-        movw      %ax, -112(%rbp,%rdx,2)                        #1041.13
-..LN509:
-        movq      -80(%rbp), %rax                               #1042.24
-..LN511:
-        shrq      $2, %rax                                      #1042.29
-..LN513:
-        movw      $240, -96(%rbp,%rax,2)                        #1042.13
-        jmp       ..B7.7        # Prob 100%                     #1042.13
-                                # LOE
-..B7.14:                        # Preds ..B7.10
-..LN515:
-        movq      -80(%rbp), %rax                               #1045.27
-..LN517:
-        shrq      $2, %rax                                      #1045.32
-..LN519:
-        movzwl    -112(%rbp,%rax,2), %eax                       #1045.13
-..LN521:
-        movzwl    -48(%rbp), %edx                               #1045.39
-..LN523:
-        orl       %edx, %eax                                    #1045.13
-..LN525:
-        movq      -80(%rbp), %rdx                               #1045.27
-..LN527:
-        shrq      $2, %rdx                                      #1045.32
-..LN529:
-        movw      %ax, -112(%rbp,%rdx,2)                        #1045.13
-..LN531:
-        movq      -80(%rbp), %rax                               #1046.24
-..LN533:
-        shrq      $2, %rax                                      #1046.29
-..LN535:
-        movzwl    -96(%rbp,%rax,2), %eax                        #1046.13
-        orl       $15, %eax                                     #1046.13
-..LN537:
-        movq      -80(%rbp), %rdx                               #1046.24
-..LN539:
-        shrq      $2, %rdx                                      #1046.29
-..LN541:
-        movw      %ax, -96(%rbp,%rdx,2)                         #1046.13
-        jmp       ..B7.7        # Prob 100%                     #1046.13
-                                # LOE
-..B7.15:                        # Preds ..B7.11
-..LN543:
-        movq      -80(%rbp), %rax                               #1049.27
-..LN545:
-        shrq      $2, %rax                                      #1049.32
-..LN547:
-        movzwl    -112(%rbp,%rax,2), %eax                       #1049.13
-..LN549:
-        movzwl    -48(%rbp), %edx                               #1049.39
-..LN551:
-        shll      $12, %edx                                     #1049.47
-..LN553:
-        orl       %edx, %eax                                    #1049.13
-..LN555:
-        movq      -80(%rbp), %rdx                               #1049.27
-..LN557:
-        shrq      $2, %rdx                                      #1049.32
-..LN559:
-        movw      %ax, -112(%rbp,%rdx,2)                        #1049.13
-..LN561:
-        movq      -80(%rbp), %rax                               #1050.24
-..LN563:
-        shrq      $2, %rax                                      #1050.29
-..LN565:
-        movzwl    -96(%rbp,%rax,2), %eax                        #1050.13
-        orl       $-4096, %eax                                  #1050.13
-..LN567:
-        movq      -80(%rbp), %rdx                               #1050.24
-..LN569:
-        shrq      $2, %rdx                                      #1050.29
-..LN571:
-        movw      %ax, -96(%rbp,%rdx,2)                         #1050.13
-        jmp       ..B7.7        # Prob 100%                     #1050.13
-                                # LOE
-..B7.16:                        # Preds ..B7.12
-..LN573:
-        movq      -80(%rbp), %rax                               #1053.27
-..LN575:
-        shrq      $2, %rax                                      #1053.32
-..LN577:
-        movzwl    -112(%rbp,%rax,2), %eax                       #1053.13
-..LN579:
-        movzwl    -48(%rbp), %edx                               #1053.39
-..LN581:
-        shll      $8, %edx                                      #1053.47
-..LN583:
-        orl       %edx, %eax                                    #1053.13
-..LN585:
-        movq      -80(%rbp), %rdx                               #1053.27
-..LN587:
-        shrq      $2, %rdx                                      #1053.32
-..LN589:
-        movw      %ax, -112(%rbp,%rdx,2)                        #1053.13
-..LN591:
-        movq      -80(%rbp), %rax                               #1054.24
-..LN593:
-        shrq      $2, %rax                                      #1054.29
-..LN595:
-        movzwl    -96(%rbp,%rax,2), %eax                        #1054.13
-        orl       $-61696, %eax                                 #1054.13
-..LN597:
-        movq      -80(%rbp), %rdx                               #1054.24
-..LN599:
-        shrq      $2, %rdx                                      #1054.29
-..LN601:
-        movw      %ax, -96(%rbp,%rdx,2)                         #1054.13
-        jmp       ..B7.7        # Prob 100%                     #1054.13
-                                # LOE
-..B7.17:                        # Preds ..B7.7 ..B7.6
-..LN603:
-        movq      -80(%rbp), %rax                               #1060.17
-..LN605:
-        addq      $3, %rax                                      #1060.21
-..LN607:
-        shrq      $2, %rax                                      #1060.28
-..LN609:
-        movq      %rax, -80(%rbp)                               #1060.11
-..LN611:
-        movq      -80(%rbp), %rax                               #1060.31
-..LN613:
-        cmpq      $8, %rax                                      #1060.35
-        jae       ..B7.20       # Prob 50%                      #1060.35
-                                # LOE
-..B7.19:                        # Preds ..B7.17 ..B7.19
-..LN615:
-        movq      -80(%rbp), %rax                               #1062.23
-..LN617:
-        xorl      %edx, %edx                                    #1062.9
-        movw      %dx, -112(%rbp,%rax,2)                        #1062.9
-..LN619:
-        movq      -80(%rbp), %rax                               #1063.20
-..LN621:
-        movw      %dx, -96(%rbp,%rax,2)                         #1063.9
-..LN623:
-        incq      -80(%rbp)                                     #1060.41
-..LN625:
-        movq      -80(%rbp), %rax                               #1060.31
-..LN627:
-        cmpq      $8, %rax                                      #1060.35
-        jb        ..B7.19       # Prob 50%                      #1060.35
-                                # LOE
-..B7.20:                        # Preds ..B7.19 ..B7.17
-..LN629:
-        movl      -16(%rbp), %eax                               #1068.10
-        testl     %eax, %eax                                    #1068.10
-        je        ..B7.22       # Prob 50%                      #1068.10
-                                # LOE
-..B7.21:                        # Preds ..B7.20
-..LN631:
-        movq      -64(%rbp), %rax                               #1070.9
-        movl      $10, (%rax)                                   #1070.9
-        jmp       ..B7.29       # Prob 100%                     #1070.9
-                                # LOE
-..B7.22:                        # Preds ..B7.20
-..LN633:
-        movq      -24(%rbp), %rax                               #1072.15
-..LN635:
-        cmpq      $2, %rax                                      #1072.22
-        jae       ..B7.24       # Prob 50%                      #1072.22
-                                # LOE
-..B7.23:                        # Preds ..B7.22
-..LN637:
-        movzwl    -112(%rbp), %eax                              #1074.29
-..LN639:
-        movw      %ax, -110(%rbp)                               #1074.9
-..LN641:
-        movl      -112(%rbp), %eax                              #1075.29
-..LN643:
-        movl      %eax, -108(%rbp)                              #1075.9
-..LN645:
-        movq      -112(%rbp), %rax                              #1076.29
-..LN647:
-        movq      %rax, -104(%rbp)                              #1076.9
-..LN649:
-        movzwl    -96(%rbp), %eax                               #1078.26
-..LN651:
-        movw      %ax, -94(%rbp)                                #1078.9
-..LN653:
-        movl      -96(%rbp), %eax                               #1079.26
-..LN655:
-        movl      %eax, -92(%rbp)                               #1079.9
-..LN657:
-        movq      -96(%rbp), %rax                               #1080.26
-..LN659:
-        movq      %rax, -88(%rbp)                               #1080.9
-..LN661:
-        movq      -64(%rbp), %rax                               #1082.9
-        movl      $6, (%rax)                                    #1082.9
-        jmp       ..B7.29       # Prob 100%                     #1082.9
-                                # LOE
-..B7.24:                        # Preds ..B7.22
-..LN663:
-        movq      -24(%rbp), %rax                               #1084.15
-..LN665:
-        cmpq      $6, %rax                                      #1084.22
-        jae       ..B7.26       # Prob 50%                      #1084.22
-                                # LOE
-..B7.25:                        # Preds ..B7.24
-..LN667:
-        movl      -112(%rbp), %eax                              #1086.29
-..LN669:
-        movl      %eax, -108(%rbp)                              #1086.9
-..LN671:
-        movq      -112(%rbp), %rax                              #1087.29
-..LN673:
-        movq      %rax, -104(%rbp)                              #1087.9
-..LN675:
-        movl      -96(%rbp), %eax                               #1089.26
-..LN677:
-        movl      %eax, -92(%rbp)                               #1089.9
-..LN679:
-        movq      -96(%rbp), %rax                               #1090.26
-..LN681:
-        movq      %rax, -88(%rbp)                               #1090.9
-..LN683:
-        movq      -64(%rbp), %rax                               #1092.9
-        movl      $7, (%rax)                                    #1092.9
-        jmp       ..B7.29       # Prob 100%                     #1092.9
-                                # LOE
-..B7.26:                        # Preds ..B7.24
-..LN685:
-        movq      -24(%rbp), %rax                               #1094.15
-..LN687:
-        cmpq      $14, %rax                                     #1094.22
-        jae       ..B7.28       # Prob 50%                      #1094.22
-                                # LOE
-..B7.27:                        # Preds ..B7.26
-..LN689:
-        movq      -112(%rbp), %rax                              #1096.29
-..LN691:
-        movq      %rax, -104(%rbp)                              #1096.9
-..LN693:
-        movq      -96(%rbp), %rax                               #1097.26
-..LN695:
-        movq      %rax, -88(%rbp)                               #1097.9
-..LN697:
-        movq      -64(%rbp), %rax                               #1099.9
-        movl      $1, (%rax)                                    #1099.9
-        jmp       ..B7.29       # Prob 100%                     #1099.9
-                                # LOE
-..B7.28:                        # Preds ..B7.26
-..LN699:
-        movq      -64(%rbp), %rax                               #1103.9
-        movl      $8, (%rax)                                    #1103.9
-                                # LOE
-..B7.29:                        # Preds ..B7.21 ..B7.23 ..B7.25 ..B7.27 ..B7.28
-                                #      
-..LN701:
-        movq      -64(%rbp), %rax                               #1106.5
-..LN703:
-        movq      -112(%rbp), %rdx                              #1106.42
-        movq      %rdx, 16(%rax)                                #1106.42
-        movq      -104(%rbp), %rdx                              #1106.42
-        movq      %rdx, 24(%rax)                                #1106.42
-..LN705:
-        movq      -64(%rbp), %rax                               #1107.5
-..LN707:
-        movq      -96(%rbp), %rdx                               #1107.39
-        movq      %rdx, 32(%rax)                                #1107.39
-        movq      -88(%rbp), %rdx                               #1107.39
-        movq      %rdx, 40(%rax)                                #1107.39
-..LN709:
-        lea       -112(%rbp), %rax                              #1110.23
-..LN711:
-        movq      %rax, %rdi                                    #1110.5
-        call      uint128_bswap at PLT                             #1110.5
-                                # LOE
-..B7.30:                        # Preds ..B7.29
-..LN713:
-        lea       -96(%rbp), %rax                               #1111.23
-..LN715:
-        movq      %rax, %rdi                                    #1111.5
-        call      uint128_bswap at PLT                             #1111.5
-                                # LOE
-..B7.31:                        # Preds ..B7.30
-..LN717:
-        lea       -112(%rbp), %rax                              #1114.21
-..LN719:
-        movq      %rax, %rdi                                    #1114.5
-        movl      $4, %esi                                      #1114.5
-        call      uint128_shr at PLT                               #1114.5
-                                # LOE
-..B7.32:                        # Preds ..B7.31
-..LN721:
-        lea       -96(%rbp), %rax                               #1115.21
-..LN723:
-        movq      %rax, %rdi                                    #1115.5
-        movl      $4, %esi                                      #1115.5
-        call      uint128_shr at PLT                               #1115.5
-                                # LOE
-..B7.33:                        # Preds ..B7.32
-..LN725:
-        movq      -64(%rbp), %rax                               #1118.28
-..LN727:
-        addq      $48, %rax                                     #1118.5
-..LN729:
-        lea       -112(%rbp), %rdx                              #1118.70
-..LN731:
-        movq      %rax, %rdi                                    #1118.5
-        movq      %rdx, %rsi                                    #1118.5
-        call      uint128_bswap_copy at PLT                        #1118.5
-                                # LOE
-..B7.34:                        # Preds ..B7.33
-..LN733:
-        movq      -64(%rbp), %rax                               #1119.28
-..LN735:
-        addq      $64, %rax                                     #1119.5
-..LN737:
-        lea       -96(%rbp), %rdx                               #1119.67
-..LN739:
-        movq      %rax, %rdi                                    #1119.5
-        movq      %rdx, %rsi                                    #1119.5
-        call      uint128_bswap_copy at PLT                        #1119.5
-                                # LOE
-..B7.35:                        # Preds ..B7.34
-..LN741:
-        lea       -112(%rbp), %rax                              #1121.21
-..LN743:
-        movq      %rax, %rdi                                    #1121.5
-        movl      $4, %esi                                      #1121.5
-        call      uint128_shr at PLT                               #1121.5
-                                # LOE
-..B7.36:                        # Preds ..B7.35
-..LN745:
-        lea       -96(%rbp), %rax                               #1122.21
-..LN747:
-        movq      %rax, %rdi                                    #1122.5
-        movl      $4, %esi                                      #1122.5
-        call      uint128_shr at PLT                               #1122.5
-                                # LOE
-..B7.37:                        # Preds ..B7.36
-..LN749:
-        movq      -64(%rbp), %rax                               #1124.28
-..LN751:
-        addq      $80, %rax                                     #1124.5
-..LN753:
-        lea       -112(%rbp), %rdx                              #1124.70
-..LN755:
-        movq      %rax, %rdi                                    #1124.5
-        movq      %rdx, %rsi                                    #1124.5
-        call      uint128_bswap_copy at PLT                        #1124.5
-                                # LOE
-..B7.38:                        # Preds ..B7.37
-..LN757:
-        movq      -64(%rbp), %rax                               #1125.28
-..LN759:
-        addq      $96, %rax                                     #1125.5
-..LN761:
-        lea       -96(%rbp), %rdx                               #1125.67
-..LN763:
-        movq      %rax, %rdi                                    #1125.5
-        movq      %rdx, %rsi                                    #1125.5
-        call      uint128_bswap_copy at PLT                        #1125.5
-                                # LOE
-..B7.39:                        # Preds ..B7.38
-..LN765:
-        lea       -112(%rbp), %rax                              #1127.21
-..LN767:
-        movq      %rax, %rdi                                    #1127.5
-        movl      $4, %esi                                      #1127.5
-        call      uint128_shr at PLT                               #1127.5
-                                # LOE
-..B7.40:                        # Preds ..B7.39
-..LN769:
-        lea       -96(%rbp), %rax                               #1128.21
-..LN771:
-        movq      %rax, %rdi                                    #1128.5
-        movl      $4, %esi                                      #1128.5
-        call      uint128_shr at PLT                               #1128.5
-                                # LOE
-..B7.41:                        # Preds ..B7.40
-..LN773:
-        movq      -64(%rbp), %rax                               #1130.28
-..LN775:
-        addq      $112, %rax                                    #1130.5
-..LN777:
-        lea       -112(%rbp), %rdx                              #1130.70
-..LN779:
-        movq      %rax, %rdi                                    #1130.5
-        movq      %rdx, %rsi                                    #1130.5
-        call      uint128_bswap_copy at PLT                        #1130.5
-                                # LOE
-..B7.42:                        # Preds ..B7.41
-..LN781:
-        movq      -64(%rbp), %rax                               #1131.28
-..LN783:
-        addq      $128, %rax                                    #1131.5
-..LN785:
-        lea       -96(%rbp), %rdx                               #1131.67
-..LN787:
-        movq      %rax, %rdi                                    #1131.5
-        movq      %rdx, %rsi                                    #1131.5
-        call      uint128_bswap_copy at PLT                        #1131.5
-                                # LOE
-..B7.43:                        # Preds ..B7.42
-..LN789:
-        xorl      %eax, %eax                                    #1173.12
-        leave                                                   #1173.12
-..___tag_value_NucStrFastaExprMake4.76:                         #
-        ret                                                     #1173.12
-        .align    2,0x90
-..___tag_value_NucStrFastaExprMake4.77:                         #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-.LNNucStrFastaExprMake4:
-	.data
-# -- End  NucStrFastaExprMake4
-	.text
-# -- Begin  nss_sob
-# mark_begin;
-       .align    2,0x90
-nss_sob:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-..B8.1:                         # Preds ..B8.0
-..___tag_value_nss_sob.80:                                      #
-..LN791:
-        pushq     %rbp                                          #1181.1
-        movq      %rsp, %rbp                                    #1181.1
-..___tag_value_nss_sob.81:                                      #
-        subq      $16, %rsp                                     #1181.1
-        movq      %rdi, -16(%rbp)                               #1181.1
-        movq      %rsi, -8(%rbp)                                #1181.1
-..LN793:
-        movq      -16(%rbp), %rax                               #1182.13
-..LN795:
-        movq      -8(%rbp), %rdx                                #1182.17
-        cmpq      %rdx, %rax                                    #1182.17
-        jae       ..B8.5        # Prob 50%                      #1182.17
-                                # LOE
-..B8.3:                         # Preds ..B8.1 ..B8.4
-..LN797:
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE rax
-..B8.8:                         # Preds ..B8.3
-        movq      -16(%rbp), %rdx                               #1182.24
-        movzbl    (%rdx), %edx                                  #1182.24
-        movzbl    %dl, %edx                                     #1182.24
-        movslq    %edx, %rdx                                    #1182.24
-        movq      (%rax), %rax                                  #1182.24
-        movzwl    (%rax,%rdx,2), %eax                           #1182.24
-        testl     $8192, %eax                                   #1182.24
-        je        ..B8.5        # Prob 50%                      #1182.24
-                                # LOE
-..B8.4:                         # Preds ..B8.8
-..LN799:
-        incq      -16(%rbp)                                     #1183.12
-..LN801:
-        movq      -16(%rbp), %rax                               #1182.13
-..LN803:
-        movq      -8(%rbp), %rdx                                #1182.17
-        cmpq      %rdx, %rax                                    #1182.17
-        jb        ..B8.3        # Prob 50%                      #1182.17
-                                # LOE
-..B8.5:                         # Preds ..B8.4 ..B8.8 ..B8.1
-..LN805:
-        movq      -16(%rbp), %rax                               #1184.12
-        leave                                                   #1184.12
-..___tag_value_nss_sob.85:                                      #
-        ret                                                     #1184.12
-        .align    2,0x90
-..___tag_value_nss_sob.86:                                      #
-                                # LOE
-# mark_end;
-	.type	nss_sob, at function
-	.size	nss_sob,.-nss_sob
-.LNnss_sob:
-	.data
-# -- End  nss_sob
-	.text
-# -- Begin  nss_FASTA_expr
-# mark_begin;
-       .align    2,0x90
-nss_FASTA_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B9.1:                         # Preds ..B9.0
-..___tag_value_nss_FASTA_expr.89:                               #
-..LN807:
-        pushq     %rbp                                          #1192.1
-        movq      %rsp, %rbp                                    #1192.1
-..___tag_value_nss_FASTA_expr.90:                               #
-        subq      $80, %rsp                                     #1192.1
-        movq      %rbx, -16(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.93:                               #
-        movq      %rdi, -48(%rbp)                               #1192.1
-        movq      %rsi, -40(%rbp)                               #1192.1
-        movq      %rdx, -32(%rbp)                               #1192.1
-        movq      %rcx, -24(%rbp)                               #1192.1
-        movl      %r8d, -8(%rbp)                                #1192.1
-..LN809:
-        movq      -48(%rbp), %rax                               #1193.10
-..LN811:
-        movq      -40(%rbp), %rdx                               #1193.15
-        cmpq      %rdx, %rax                                    #1193.15
-        jb        ..B9.3        # Prob 50%                      #1193.15
-                                # LOE
-..B9.2:                         # Preds ..B9.1
-..LN813:
-        movq      -24(%rbp), %rax                               #1194.9
-        movl      $22, (%rax)                                   #1194.9
-        jmp       ..B9.17       # Prob 100%                     #1194.9
-                                # LOE
-..B9.3:                         # Preds ..B9.1
-..LN815:
-        movq      -48(%rbp), %rax                               #1197.30
-..LN817:
-        movq      %rax, -72(%rbp)                               #1197.27
-..LN819:
-        movl      $0, -56(%rbp)                                 #1199.22
-..LN821:
-        lea       fasta_2na_map.0(%rip), %rax                   #1200.27
-        movq      %rax, -64(%rbp)                               #1200.27
-                                # LOE
-..B9.4:                         # Preds ..B9.9 ..B9.3
-..LN823:
-        movq      -48(%rbp), %rax                               #1203.20
-        movzbl    (%rax), %eax                                  #1203.20
-        movsbq    %al, %rax                                     #1203.20
-..LN825:
-        testl     %eax, %eax                                    #1203.24
-        jl        ..B9.10       # Prob 50%                      #1203.24
-                                # LOE
-..B9.5:                         # Preds ..B9.4
-..LN827:
-        movq      -48(%rbp), %rax                               #1206.45
-        movzbl    (%rax), %eax                                  #1206.45
-        movzbl    %al, %eax                                     #1206.45
-..LN829:
-        movslq    %eax, %rax                                    #1206.18
-        movq      -64(%rbp), %rdx                               #1206.18
-        movzbl    (%rax,%rdx), %eax                             #1206.18
-        movsbq    %al, %rax                                     #1206.18
-..LN831:
-        testl     %eax, %eax                                    #1206.51
-        jge       ..B9.9        # Prob 50%                      #1206.51
-                                # LOE
-..B9.6:                         # Preds ..B9.5
-..LN833:
-        movq      -64(%rbp), %rax                               #1208.22
-..LN835:
-        lea       fasta_4na_map.0(%rip), %rdx                   #1208.29
-        cmpq      %rdx, %rax                                    #1208.29
-        je        ..B9.10       # Prob 50%                      #1208.29
-                                # LOE
-..B9.7:                         # Preds ..B9.6
-..LN837:
-        movq      -48(%rbp), %rax                               #1210.59
-        movzbl    (%rax), %eax                                  #1210.59
-        movzbl    %al, %eax                                     #1210.59
-..LN839:
-        movslq    %eax, %rax                                    #1210.22
-        lea       fasta_4na_map.0(%rip), %rdx                   #1210.22
-        movzbl    (%rax,%rdx), %eax                             #1210.22
-        movsbq    %al, %rax                                     #1210.22
-..LN841:
-        testl     %eax, %eax                                    #1210.65
-        jl        ..B9.10       # Prob 50%                      #1210.65
-                                # LOE
-..B9.8:                         # Preds ..B9.7
-..LN843:
-        movl      $1, -56(%rbp)                                 #1212.17
-..LN845:
-        lea       fasta_4na_map.0(%rip), %rax                   #1213.23
-..LN847:
-        movq      %rax, -64(%rbp)                               #1213.17
-                                # LOE
-..B9.9:                         # Preds ..B9.8 ..B9.5
-..LN849:
-        movq      -48(%rbp), %rax                               #1216.20
-        incq      %rax                                          #1216.20
-        movq      %rax, -48(%rbp)                               #1216.20
-..LN851:
-        movq      -40(%rbp), %rdx                               #1216.24
-        cmpq      %rdx, %rax                                    #1216.24
-        jb        ..B9.4        # Prob 50%                      #1216.24
-                                # LOE
-..B9.10:                        # Preds ..B9.7 ..B9.6 ..B9.4 ..B9.9
-..LN853:
-        movq      -48(%rbp), %rax                               #1218.14
-..LN855:
-        movq      -72(%rbp), %rdx                               #1218.19
-        cmpq      %rdx, %rax                                    #1218.19
-        ja        ..B9.12       # Prob 50%                      #1218.19
-                                # LOE
-..B9.11:                        # Preds ..B9.10
-..LN857:
-        movq      -24(%rbp), %rax                               #1219.13
-        movl      $22, (%rax)                                   #1219.13
-        jmp       ..B9.17       # Prob 100%                     #1219.13
-                                # LOE
-..B9.12:                        # Preds ..B9.10
-..LN859:
-        movl      -56(%rbp), %eax                               #1220.19
-..LN861:
-        testl     %eax, %eax                                    #1220.27
-        jne       ..B9.15       # Prob 50%                      #1220.27
-                                # LOE
-..B9.13:                        # Preds ..B9.12
-..LN863:
-        movq      -32(%rbp), %rax                               #1221.47
-..LN865:
-        movl      -8(%rbp), %edx                                #1221.53
-..LN867:
-        movq      -72(%rbp), %rcx                               #1221.65
-..LN869:
-        movq      -72(%rbp), %rbx                               #1221.76
-        negq      %rbx                                          #1221.76
-        addq      -48(%rbp), %rbx                               #1221.76
-..LN871:
-        movq      %rax, %rdi                                    #1221.24
-        movl      %edx, %esi                                    #1221.24
-        movq      %rcx, %rdx                                    #1221.24
-        movq      %rbx, %rcx                                    #1221.24
-        call      NucStrFastaExprMake2 at PLT                      #1221.24
-                                # LOE eax
-..B9.20:                        # Preds ..B9.13
-        movl      %eax, -80(%rbp)                               #1221.24
-                                # LOE
-..B9.14:                        # Preds ..B9.20
-..LN873:
-        movq      -24(%rbp), %rax                               #1221.13
-        movl      -80(%rbp), %edx                               #1221.13
-        movl      %edx, (%rax)                                  #1221.13
-        jmp       ..B9.17       # Prob 100%                     #1221.13
-                                # LOE
-..B9.15:                        # Preds ..B9.12
-..LN875:
-        movq      -32(%rbp), %rax                               #1223.47
-..LN877:
-        movl      -8(%rbp), %edx                                #1223.53
-..LN879:
-        movq      -72(%rbp), %rcx                               #1223.65
-..LN881:
-        movq      -72(%rbp), %rbx                               #1223.76
-        negq      %rbx                                          #1223.76
-        addq      -48(%rbp), %rbx                               #1223.76
-..LN883:
-        movq      %rax, %rdi                                    #1223.24
-        movl      %edx, %esi                                    #1223.24
-        movq      %rcx, %rdx                                    #1223.24
-        movq      %rbx, %rcx                                    #1223.24
-        call      NucStrFastaExprMake4 at PLT                      #1223.24
-                                # LOE eax
-..B9.21:                        # Preds ..B9.15
-        movl      %eax, -76(%rbp)                               #1223.24
-                                # LOE
-..B9.16:                        # Preds ..B9.21
-..LN885:
-        movq      -24(%rbp), %rax                               #1223.13
-        movl      -76(%rbp), %edx                               #1223.13
-        movl      %edx, (%rax)                                  #1223.13
-                                # LOE
-..B9.17:                        # Preds ..B9.2 ..B9.11 ..B9.14 ..B9.16
-..LN887:
-        movq      -48(%rbp), %rax                               #1226.12
-        movq      -16(%rbp), %rbx                               #1226.12
-..___tag_value_nss_FASTA_expr.94:                               #
-        leave                                                   #1226.12
-..___tag_value_nss_FASTA_expr.96:                               #
-        ret                                                     #1226.12
-        .align    2,0x90
-..___tag_value_nss_FASTA_expr.97:                               #
-                                # LOE
-# mark_end;
-	.type	nss_FASTA_expr, at function
-	.size	nss_FASTA_expr,.-nss_FASTA_expr
-.LNnss_FASTA_expr:
-	.data
-# -- End  nss_FASTA_expr
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    2,0x90
-nss_fasta_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B10.1:                        # Preds ..B10.0
-..___tag_value_nss_fasta_expr.100:                              #
-..LN889:
-        pushq     %rbp                                          #1234.1
-        movq      %rsp, %rbp                                    #1234.1
-..___tag_value_nss_fasta_expr.101:                              #
-        subq      $112, %rsp                                    #1234.1
-        movq      %rbx, -16(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.104:                              #
-        movq      %rdi, -48(%rbp)                               #1234.1
-        movq      %rsi, -40(%rbp)                               #1234.1
-        movq      %rdx, -32(%rbp)                               #1234.1
-        movq      %rcx, -24(%rbp)                               #1234.1
-        movl      %r8d, -8(%rbp)                                #1234.1
-..LN891:
-        movq      -48(%rbp), %rax                               #1235.5
-        movq      -40(%rbp), %rdx                               #1235.5
-        cmpq      %rdx, %rax                                    #1235.5
-        jb        ..B10.3       # Prob 50%                      #1235.5
-                                # LOE
-..B10.2:                        # Preds ..B10.1
-        lea       _2__STRING.3.0(%rip), %rax                    #1235.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #1235.5
-        lea       __$U1.0(%rip), %rcx                           #1235.5
-        movq      %rax, %rdi                                    #1235.5
-        movq      %rdx, %rsi                                    #1235.5
-        movl      $1235, %edx                                   #1235.5
-        call      __assert_fail at PLT                             #1235.5
-                                # LOE
-..B10.3:                        # Preds ..B10.1
-..LN893:
-        movq      -48(%rbp), %rax                               #1236.16
-        movzbl    (%rax), %eax                                  #1236.16
-        movsbq    %al, %rax                                     #1236.16
-        movl      %eax, -56(%rbp)                               #1236.16
-        cmpl      $39, %eax                                     #1236.16
-        je        ..B10.5       # Prob 50%                      #1236.16
-                                # LOE
-..B10.4:                        # Preds ..B10.3
-        movl      -56(%rbp), %eax                               #1236.16
-        cmpl      $34, %eax                                     #1236.16
-        je        ..B10.13      # Prob 50%                      #1236.16
-        jmp       ..B10.21      # Prob 100%                     #1236.16
-                                # LOE
-..B10.5:                        # Preds ..B10.3
-..LN895:
-        movq      -48(%rbp), %rax                               #1239.30
-        incq      %rax                                          #1239.30
-..LN897:
-        movq      -40(%rbp), %rdx                               #1239.37
-..LN899:
-        movq      -32(%rbp), %rcx                               #1239.42
-..LN901:
-        movq      -24(%rbp), %rbx                               #1239.48
-..LN903:
-        movl      -8(%rbp), %esi                                #1239.56
-..LN905:
-        movq      %rax, %rdi                                    #1239.13
-        movl      %esi, -64(%rbp)                               #1239.13
-        movq      %rdx, %rsi                                    #1239.13
-        movq      %rcx, %rdx                                    #1239.13
-        movq      %rbx, %rcx                                    #1239.13
-        movl      -64(%rbp), %eax                               #1239.13
-        movl      %eax, %r8d                                    #1239.13
-        call      nss_FASTA_expr at PLT                            #1239.13
-                                # LOE rax
-..B10.26:                       # Preds ..B10.5
-        movq      %rax, -72(%rbp)                               #1239.13
-                                # LOE
-..B10.6:                        # Preds ..B10.26
-..LN907:
-        movq      -72(%rbp), %rax                               #1239.9
-        movq      %rax, -48(%rbp)                               #1239.9
-..LN909:
-        movq      -24(%rbp), %rax                               #1240.16
-        movl      (%rax), %eax                                  #1240.16
-..LN911:
-        testl     %eax, %eax                                    #1240.26
-        jne       ..B10.23      # Prob 50%                      #1240.26
-                                # LOE
-..B10.7:                        # Preds ..B10.6
-..LN913:
-        movq      -48(%rbp), %rax                               #1240.33
-..LN915:
-        movq      -40(%rbp), %rdx                               #1240.38
-        cmpq      %rdx, %rax                                    #1240.38
-        je        ..B10.12      # Prob 50%                      #1240.38
-                                # LOE
-..B10.8:                        # Preds ..B10.7
-..LN917:
-        movq      -48(%rbp), %rax                               #1240.47
-        movzbl    (%rax), %eax                                  #1240.47
-        movsbq    %al, %rax                                     #1240.47
-..LN919:
-        cmpl      $39, %eax                                     #1240.55
-        jne       ..B10.10      # Prob 50%                      #1240.55
-                                # LOE
-..B10.9:                        # Preds ..B10.8
-        movl      $0, -108(%rbp)                                #1240.55
-        jmp       ..B10.11      # Prob 100%                     #1240.55
-                                # LOE
-..B10.10:                       # Preds ..B10.8
-        movl      $1, -108(%rbp)                                #1240.55
-                                # LOE
-..B10.11:                       # Preds ..B10.10 ..B10.9
-..LN921:
-        movl      -108(%rbp), %eax                              #1240.47
-        incq      -48(%rbp)                                     #1240.47
-..LN923:
-        testl     %eax, %eax                                    #1240.55
-        je        ..B10.23      # Prob 100%                     #1240.55
-                                # LOE
-..B10.12:                       # Preds ..B10.7 ..B10.11
-..LN925:
-        movq      -24(%rbp), %rax                               #1241.13
-        movl      $22, (%rax)                                   #1241.13
-        jmp       ..B10.23      # Prob 100%                     #1241.13
-                                # LOE
-..B10.13:                       # Preds ..B10.4
-..LN927:
-        movq      -48(%rbp), %rax                               #1244.30
-        incq      %rax                                          #1244.30
-..LN929:
-        movq      -40(%rbp), %rdx                               #1244.37
-..LN931:
-        movq      -32(%rbp), %rcx                               #1244.42
-..LN933:
-        movq      -24(%rbp), %rbx                               #1244.48
-..LN935:
-        movl      -8(%rbp), %esi                                #1244.56
-..LN937:
-        movq      %rax, %rdi                                    #1244.13
-        movl      %esi, -88(%rbp)                               #1244.13
-        movq      %rdx, %rsi                                    #1244.13
-        movq      %rcx, %rdx                                    #1244.13
-        movq      %rbx, %rcx                                    #1244.13
-        movl      -88(%rbp), %eax                               #1244.13
-        movl      %eax, %r8d                                    #1244.13
-        call      nss_FASTA_expr at PLT                            #1244.13
-                                # LOE rax
-..B10.27:                       # Preds ..B10.13
-        movq      %rax, -104(%rbp)                              #1244.13
-                                # LOE
-..B10.14:                       # Preds ..B10.27
-..LN939:
-        movq      -104(%rbp), %rax                              #1244.9
-        movq      %rax, -48(%rbp)                               #1244.9
-..LN941:
-        movq      -24(%rbp), %rax                               #1245.16
-        movl      (%rax), %eax                                  #1245.16
-..LN943:
-        testl     %eax, %eax                                    #1245.26
-        jne       ..B10.23      # Prob 50%                      #1245.26
-                                # LOE
-..B10.15:                       # Preds ..B10.14
-..LN945:
-        movq      -48(%rbp), %rax                               #1245.33
-..LN947:
-        movq      -40(%rbp), %rdx                               #1245.38
-        cmpq      %rdx, %rax                                    #1245.38
-        je        ..B10.20      # Prob 50%                      #1245.38
-                                # LOE
-..B10.16:                       # Preds ..B10.15
-..LN949:
-        movq      -48(%rbp), %rax                               #1245.47
-        movzbl    (%rax), %eax                                  #1245.47
-        movsbq    %al, %rax                                     #1245.47
-..LN951:
-        cmpl      $34, %eax                                     #1245.55
-        jne       ..B10.18      # Prob 50%                      #1245.55
-                                # LOE
-..B10.17:                       # Preds ..B10.16
-        movl      $0, -112(%rbp)                                #1245.55
-        jmp       ..B10.19      # Prob 100%                     #1245.55
-                                # LOE
-..B10.18:                       # Preds ..B10.16
-        movl      $1, -112(%rbp)                                #1245.55
-                                # LOE
-..B10.19:                       # Preds ..B10.18 ..B10.17
-..LN953:
-        movl      -112(%rbp), %eax                              #1245.47
-        incq      -48(%rbp)                                     #1245.47
-..LN955:
-        testl     %eax, %eax                                    #1245.55
-        je        ..B10.23      # Prob 100%                     #1245.55
-                                # LOE
-..B10.20:                       # Preds ..B10.15 ..B10.19
-..LN957:
-        movq      -24(%rbp), %rax                               #1246.13
-        movl      $22, (%rax)                                   #1246.13
-        jmp       ..B10.23      # Prob 100%                     #1246.13
-                                # LOE
-..B10.21:                       # Preds ..B10.4
-..LN959:
-        movq      -48(%rbp), %rax                               #1249.33
-..LN961:
-        movq      -40(%rbp), %rdx                               #1249.36
-..LN963:
-        movq      -32(%rbp), %rcx                               #1249.41
-..LN965:
-        movq      -24(%rbp), %rbx                               #1249.47
-..LN967:
-        movl      -8(%rbp), %esi                                #1249.55
-..LN969:
-        movq      %rax, %rdi                                    #1249.16
-        movl      %esi, -80(%rbp)                               #1249.16
-        movq      %rdx, %rsi                                    #1249.16
-        movq      %rcx, %rdx                                    #1249.16
-        movq      %rbx, %rcx                                    #1249.16
-        movl      -80(%rbp), %eax                               #1249.16
-        movl      %eax, %r8d                                    #1249.16
-        call      nss_FASTA_expr at PLT                            #1249.16
-                                # LOE rax
-..B10.28:                       # Preds ..B10.21
-        movq      %rax, -96(%rbp)                               #1249.16
-                                # LOE
-..B10.22:                       # Preds ..B10.28
-        movq      -96(%rbp), %rax                               #1249.16
-        movq      -16(%rbp), %rbx                               #1249.16
-..___tag_value_nss_fasta_expr.105:                              #
-        leave                                                   #1249.16
-..___tag_value_nss_fasta_expr.107:                              #
-        ret                                                     #1249.16
-..___tag_value_nss_fasta_expr.108:                              #
-                                # LOE
-..B10.23:                       # Preds ..B10.12 ..B10.11 ..B10.6 ..B10.20 ..B10.19
-                                #       ..B10.14
-..LN971:
-        movq      -48(%rbp), %rax                               #1252.12
-        movq      -16(%rbp), %rbx                               #1252.12
-..___tag_value_nss_fasta_expr.110:                              #
-        leave                                                   #1252.12
-..___tag_value_nss_fasta_expr.112:                              #
-        ret                                                     #1252.12
-        .align    2,0x90
-..___tag_value_nss_fasta_expr.113:                              #
-                                # LOE
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-.LNnss_fasta_expr:
-	.data
-# -- End  nss_fasta_expr
-	.text
-# -- Begin  nss_primary_expr
-# mark_begin;
-       .align    2,0x90
-nss_primary_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B11.1:                        # Preds ..B11.0
-..___tag_value_nss_primary_expr.116:                            #
-..LN973:
-        pushq     %rbp                                          #1291.1
-        movq      %rsp, %rbp                                    #1291.1
-..___tag_value_nss_primary_expr.117:                            #
-        subq      $160, %rsp                                    #1291.1
-        movq      %rbx, -16(%rbp)                               #1291.1
-..___tag_value_nss_primary_expr.120:                            #
-        movq      %rdi, -48(%rbp)                               #1291.1
-        movq      %rsi, -40(%rbp)                               #1291.1
-        movq      %rdx, -32(%rbp)                               #1291.1
-        movq      %rcx, -24(%rbp)                               #1291.1
-        movl      %r8d, -8(%rbp)                                #1291.1
-..LN975:
-        movq      -48(%rbp), %rax                               #1294.5
-        movq      -40(%rbp), %rdx                               #1294.5
-        cmpq      %rdx, %rax                                    #1294.5
-        jb        ..B11.3       # Prob 50%                      #1294.5
-                                # LOE
-..B11.2:                        # Preds ..B11.1
-        lea       _2__STRING.3.0(%rip), %rax                    #1294.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #1294.5
-        lea       __$U2.0(%rip), %rcx                           #1294.5
-        movq      %rax, %rdi                                    #1294.5
-        movq      %rdx, %rsi                                    #1294.5
-        movl      $1294, %edx                                   #1294.5
-        call      __assert_fail at PLT                             #1294.5
-                                # LOE
-..B11.3:                        # Preds ..B11.1
-..LN977:
-        movq      -48(%rbp), %rax                               #1295.16
-        movzbl    (%rax), %eax                                  #1295.16
-        movsbq    %al, %rax                                     #1295.16
-        movl      %eax, -56(%rbp)                               #1295.16
-        cmpl      $94, %eax                                     #1295.16
-        je        ..B11.5       # Prob 50%                      #1295.16
-                                # LOE
-..B11.4:                        # Preds ..B11.3
-        movl      -56(%rbp), %eax                               #1295.16
-        cmpl      $40, %eax                                     #1295.16
-        je        ..B11.12      # Prob 50%                      #1295.16
-        jmp       ..B11.25      # Prob 100%                     #1295.16
-                                # LOE
-..B11.5:                        # Preds ..B11.3
-..LN979:
-        movl      $16, %edi                                     #1298.13
-        call      malloc at PLT                                    #1298.13
-                                # LOE rax
-..B11.38:                       # Preds ..B11.5
-        movq      %rax, -64(%rbp)                               #1298.13
-                                # LOE
-..B11.6:                        # Preds ..B11.38
-..LN981:
-        movq      -64(%rbp), %rax                               #1298.9
-        movq      %rax, -72(%rbp)                               #1298.9
-..LN983:
-        movq      -72(%rbp), %rax                               #1299.14
-..LN985:
-        testq     %rax, %rax                                    #1299.19
-        jne       ..B11.8       # Prob 50%                      #1299.19
-                                # LOE
-..B11.7:                        # Preds ..B11.6
-..LN987:
-        call      __errno_location at PLT                          #1300.24
-                                # LOE rax
-..B11.39:                       # Preds ..B11.7
-..LN989:
-        movq      -24(%rbp), %rdx                               #1300.13
-..LN991:
-        movl      (%rax), %eax                                  #1300.24
-..LN993:
-        movl      %eax, (%rdx)                                  #1300.13
-        jmp       ..B11.11      # Prob 100%                     #1300.13
-                                # LOE
-..B11.8:                        # Preds ..B11.6
-..LN995:
-        movq      -72(%rbp), %rax                               #1303.13
-        movl      $12, (%rax)                                   #1303.13
-..LN997:
-        movq      -72(%rbp), %rax                               #1304.13
-        movl      $14, 4(%rax)                                  #1304.13
-..LN999:
-        movq      -72(%rbp), %rax                               #1305.13
-        movq      $0, 8(%rax)                                   #1305.13
-..LN1001:
-        movq      -32(%rbp), %rax                               #1306.13
-..LN1003:
-        movq      -72(%rbp), %rdx                               #1306.22
-..LN1005:
-        movq      %rdx, (%rax)                                  #1306.13
-..LN1007:
-        movq      -48(%rbp), %rax                               #1308.27
-        incq      %rax                                          #1308.27
-..LN1009:
-        movq      -40(%rbp), %rdx                               #1308.34
-..LN1011:
-        movq      %rax, %rdi                                    #1308.17
-        movq      %rdx, %rsi                                    #1308.17
-        call      nss_sob at PLT                                   #1308.17
-                                # LOE rax
-..B11.40:                       # Preds ..B11.8
-        movq      %rax, -120(%rbp)                              #1308.17
-                                # LOE
-..B11.9:                        # Preds ..B11.40
-..LN1013:
-        movq      -120(%rbp), %rax                              #1308.13
-        movq      %rax, -48(%rbp)                               #1308.13
-..LN1015:
-        movq      -48(%rbp), %rax                               #1309.17
-        movq      -40(%rbp), %rdx                               #1309.17
-        movq      -72(%rbp), %rcx                               #1309.17
-        addq      $8, %rcx                                      #1309.17
-        movq      -24(%rbp), %rbx                               #1309.17
-        movl      -8(%rbp), %esi                                #1309.17
-        movq      %rax, %rdi                                    #1309.17
-        movl      %esi, -88(%rbp)                               #1309.17
-        movq      %rdx, %rsi                                    #1309.17
-        movq      %rcx, %rdx                                    #1309.17
-        movq      %rbx, %rcx                                    #1309.17
-        movl      -88(%rbp), %eax                               #1309.17
-        movl      %eax, %r8d                                    #1309.17
-        call      nss_fasta_expr at PLT                            #1309.17
-                                # LOE rax
-..B11.41:                       # Preds ..B11.9
-        movq      %rax, -112(%rbp)                              #1309.17
-                                # LOE
-..B11.10:                       # Preds ..B11.41
-..LN1017:
-        movq      -112(%rbp), %rax                              #1309.13
-        movq      %rax, -48(%rbp)                               #1309.13
-                                # LOE
-..B11.11:                       # Preds ..B11.39 ..B11.10
-..LN1019:
-        movq      -48(%rbp), %rax                               #1311.16
-        movq      -16(%rbp), %rbx                               #1311.16
-..___tag_value_nss_primary_expr.121:                            #
-        leave                                                   #1311.16
-..___tag_value_nss_primary_expr.123:                            #
-        ret                                                     #1311.16
-..___tag_value_nss_primary_expr.124:                            #
-                                # LOE
-..B11.12:                       # Preds ..B11.4
-..LN1021:
-        movl      $16, %edi                                     #1313.13
-        call      malloc at PLT                                    #1313.13
-                                # LOE rax
-..B11.42:                       # Preds ..B11.12
-        movq      %rax, -104(%rbp)                              #1313.13
-                                # LOE
-..B11.13:                       # Preds ..B11.42
-..LN1023:
-        movq      -104(%rbp), %rax                              #1313.9
-        movq      %rax, -72(%rbp)                               #1313.9
-..LN1025:
-        movq      -72(%rbp), %rax                               #1314.14
-..LN1027:
-        testq     %rax, %rax                                    #1314.19
-        jne       ..B11.15      # Prob 50%                      #1314.19
-                                # LOE
-..B11.14:                       # Preds ..B11.13
-..LN1029:
-        call      __errno_location at PLT                          #1315.24
-                                # LOE rax
-..B11.43:                       # Preds ..B11.14
-..LN1031:
-        movq      -24(%rbp), %rdx                               #1315.13
-..LN1033:
-        movl      (%rax), %eax                                  #1315.24
-..LN1035:
-        movl      %eax, (%rdx)                                  #1315.13
-        jmp       ..B11.24      # Prob 100%                     #1315.13
-                                # LOE
-..B11.15:                       # Preds ..B11.13
-..LN1037:
-        movq      -72(%rbp), %rax                               #1318.13
-        movl      $12, (%rax)                                   #1318.13
-..LN1039:
-        movq      -72(%rbp), %rax                               #1319.13
-        movl      $0, 4(%rax)                                   #1319.13
-..LN1041:
-        movq      -32(%rbp), %rax                               #1320.13
-..LN1043:
-        movq      -72(%rbp), %rdx                               #1320.22
-..LN1045:
-        movq      %rdx, (%rax)                                  #1320.13
-..LN1047:
-        movq      -48(%rbp), %rax                               #1322.28
-        incq      %rax                                          #1322.28
-..LN1049:
-        movq      -40(%rbp), %rdx                               #1322.35
-..LN1051:
-        movq      -72(%rbp), %rcx                               #1322.42
-        addq      $8, %rcx                                      #1322.42
-..LN1053:
-        movq      -24(%rbp), %rbx                               #1322.59
-..LN1055:
-        movl      -8(%rbp), %esi                                #1322.67
-..LN1057:
-        movq      %rax, %rdi                                    #1322.17
-        movl      %esi, -128(%rbp)                              #1322.17
-        movq      %rdx, %rsi                                    #1322.17
-        movq      %rcx, %rdx                                    #1322.17
-        movq      %rbx, %rcx                                    #1322.17
-        movl      -128(%rbp), %eax                              #1322.17
-        movl      %eax, %r8d                                    #1322.17
-        call      nss_expr at PLT                                  #1322.17
-                                # LOE rax
-..B11.44:                       # Preds ..B11.15
-        movq      %rax, -136(%rbp)                              #1322.17
-                                # LOE
-..B11.16:                       # Preds ..B11.44
-..LN1059:
-        movq      -136(%rbp), %rax                              #1322.13
-        movq      %rax, -48(%rbp)                               #1322.13
-..LN1061:
-        movq      -24(%rbp), %rax                               #1323.20
-        movl      (%rax), %eax                                  #1323.20
-..LN1063:
-        testl     %eax, %eax                                    #1323.30
-        jne       ..B11.24      # Prob 50%                      #1323.30
-                                # LOE
-..B11.17:                       # Preds ..B11.16
-..LN1065:
-        movq      -72(%rbp), %rax                               #1325.22
-        movq      8(%rax), %rax                                 #1325.22
-..LN1067:
-        testq     %rax, %rax                                    #1325.41
-        je        ..B11.23      # Prob 50%                      #1325.41
-                                # LOE
-..B11.18:                       # Preds ..B11.17
-..LN1069:
-        movq      -48(%rbp), %rax                               #1325.49
-..LN1071:
-        movq      -40(%rbp), %rdx                               #1325.54
-        cmpq      %rdx, %rax                                    #1325.54
-        je        ..B11.23      # Prob 50%                      #1325.54
-                                # LOE
-..B11.19:                       # Preds ..B11.18
-..LN1073:
-        movq      -48(%rbp), %rax                               #1325.63
-        movzbl    (%rax), %eax                                  #1325.63
-        movsbq    %al, %rax                                     #1325.63
-..LN1075:
-        cmpl      $41, %eax                                     #1325.71
-        jne       ..B11.21      # Prob 50%                      #1325.71
-                                # LOE
-..B11.20:                       # Preds ..B11.19
-        movl      $0, -152(%rbp)                                #1325.71
-        jmp       ..B11.22      # Prob 100%                     #1325.71
-                                # LOE
-..B11.21:                       # Preds ..B11.19
-        movl      $1, -152(%rbp)                                #1325.71
-                                # LOE
-..B11.22:                       # Preds ..B11.21 ..B11.20
-..LN1077:
-        movl      -152(%rbp), %eax                              #1325.63
-        incq      -48(%rbp)                                     #1325.63
-..LN1079:
-        testl     %eax, %eax                                    #1325.71
-        je        ..B11.24      # Prob 100%                     #1325.71
-                                # LOE
-..B11.23:                       # Preds ..B11.17 ..B11.18 ..B11.22
-..LN1081:
-        movq      -24(%rbp), %rax                               #1326.21
-        movl      $22, (%rax)                                   #1326.21
-                                # LOE
-..B11.24:                       # Preds ..B11.43 ..B11.23 ..B11.22 ..B11.16
-..LN1083:
-        movq      -48(%rbp), %rax                               #1329.16
-        movq      -16(%rbp), %rbx                               #1329.16
-..___tag_value_nss_primary_expr.126:                            #
-        leave                                                   #1329.16
-..___tag_value_nss_primary_expr.128:                            #
-        ret                                                     #1329.16
-..___tag_value_nss_primary_expr.129:                            #
-                                # LOE
-..B11.25:                       # Preds ..B11.4
-..LN1085:
-        movq      -48(%rbp), %rax                               #1332.9
-        movq      -40(%rbp), %rdx                               #1332.9
-        movq      -32(%rbp), %rcx                               #1332.9
-        movq      -24(%rbp), %rbx                               #1332.9
-        movl      -8(%rbp), %esi                                #1332.9
-        movq      %rax, %rdi                                    #1332.9
-        movl      %esi, -80(%rbp)                               #1332.9
-        movq      %rdx, %rsi                                    #1332.9
-        movq      %rcx, %rdx                                    #1332.9
-        movq      %rbx, %rcx                                    #1332.9
-        movl      -80(%rbp), %eax                               #1332.9
-        movl      %eax, %r8d                                    #1332.9
-        call      nss_fasta_expr at PLT                            #1332.9
-                                # LOE rax
-..B11.45:                       # Preds ..B11.25
-        movq      %rax, -96(%rbp)                               #1332.9
-                                # LOE
-..B11.26:                       # Preds ..B11.45
-..LN1087:
-        movq      -96(%rbp), %rax                               #1332.5
-        movq      %rax, -48(%rbp)                               #1332.5
-..LN1089:
-        movq      -24(%rbp), %rax                               #1333.12
-        movl      (%rax), %eax                                  #1333.12
-..LN1091:
-        testl     %eax, %eax                                    #1333.22
-        jne       ..B11.35      # Prob 50%                      #1333.22
-                                # LOE
-..B11.27:                       # Preds ..B11.26
-..LN1093:
-        movq      -48(%rbp), %rax                               #1333.27
-..LN1095:
-        movq      -40(%rbp), %rdx                               #1333.31
-        cmpq      %rdx, %rax                                    #1333.31
-        jae       ..B11.35      # Prob 50%                      #1333.31
-                                # LOE
-..B11.28:                       # Preds ..B11.27
-..LN1097:
-        movq      -48(%rbp), %rax                               #1335.23
-..LN1099:
-        movq      -40(%rbp), %rdx                               #1335.26
-..LN1101:
-        movq      %rax, %rdi                                    #1335.13
-        movq      %rdx, %rsi                                    #1335.13
-        call      nss_sob at PLT                                   #1335.13
-                                # LOE rax
-..B11.46:                       # Preds ..B11.28
-        movq      %rax, -144(%rbp)                              #1335.13
-                                # LOE
-..B11.29:                       # Preds ..B11.46
-..LN1103:
-        movq      -144(%rbp), %rax                              #1335.9
-        movq      %rax, -48(%rbp)                               #1335.9
-..LN1105:
-        movq      -48(%rbp), %rax                               #1336.14
-..LN1107:
-        movq      -40(%rbp), %rdx                               #1336.18
-        cmpq      %rdx, %rax                                    #1336.18
-        jae       ..B11.35      # Prob 50%                      #1336.18
-                                # LOE
-..B11.30:                       # Preds ..B11.29
-..LN1109:
-        movq      -48(%rbp), %rax                               #1336.27
-        movzbl    (%rax), %eax                                  #1336.27
-        movsbq    %al, %rax                                     #1336.27
-..LN1111:
-        cmpl      $36, %eax                                     #1336.32
-        jne       ..B11.35      # Prob 50%                      #1336.32
-                                # LOE
-..B11.31:                       # Preds ..B11.30
-..LN1113:
-        incq      -48(%rbp)                                     #1338.16
-..LN1115:
-        movl      $16, %edi                                     #1340.17
-        call      malloc at PLT                                    #1340.17
-                                # LOE rax
-..B11.47:                       # Preds ..B11.31
-        movq      %rax, -160(%rbp)                              #1340.17
-                                # LOE
-..B11.32:                       # Preds ..B11.47
-..LN1117:
-        movq      -160(%rbp), %rax                              #1340.13
-        movq      %rax, -72(%rbp)                               #1340.13
-..LN1119:
-        movq      -72(%rbp), %rax                               #1341.18
-..LN1121:
-        testq     %rax, %rax                                    #1341.23
-        jne       ..B11.34      # Prob 50%                      #1341.23
-                                # LOE
-..B11.33:                       # Preds ..B11.32
-..LN1123:
-        call      __errno_location at PLT                          #1342.28
-                                # LOE rax
-..B11.48:                       # Preds ..B11.33
-..LN1125:
-        movq      -24(%rbp), %rdx                               #1342.17
-..LN1127:
-        movl      (%rax), %eax                                  #1342.28
-..LN1129:
-        movl      %eax, (%rdx)                                  #1342.17
-        jmp       ..B11.35      # Prob 100%                     #1342.17
-                                # LOE
-..B11.34:                       # Preds ..B11.32
-..LN1131:
-        movq      -72(%rbp), %rax                               #1345.17
-        movl      $12, (%rax)                                   #1345.17
-..LN1133:
-        movq      -72(%rbp), %rax                               #1346.17
-        movl      $15, 4(%rax)                                  #1346.17
-..LN1135:
-        movq      -32(%rbp), %rax                               #1347.37
-..LN1137:
-        movq      -72(%rbp), %rdx                               #1347.17
-..LN1139:
-        movq      (%rax), %rax                                  #1347.37
-..LN1141:
-        movq      %rax, 8(%rdx)                                 #1347.17
-..LN1143:
-        movq      -32(%rbp), %rax                               #1348.17
-..LN1145:
-        movq      -72(%rbp), %rdx                               #1348.26
-..LN1147:
-        movq      %rdx, (%rax)                                  #1348.17
-                                # LOE
-..B11.35:                       # Preds ..B11.48 ..B11.34 ..B11.30 ..B11.29 ..B11.27
-                                #       ..B11.26
-..LN1149:
-        movq      -48(%rbp), %rax                               #1353.12
-        movq      -16(%rbp), %rbx                               #1353.12
-..___tag_value_nss_primary_expr.131:                            #
-        leave                                                   #1353.12
-..___tag_value_nss_primary_expr.133:                            #
-        ret                                                     #1353.12
-        .align    2,0x90
-..___tag_value_nss_primary_expr.134:                            #
-                                # LOE
-# mark_end;
-	.type	nss_primary_expr, at function
-	.size	nss_primary_expr,.-nss_primary_expr
-.LNnss_primary_expr:
-	.data
-# -- End  nss_primary_expr
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    2,0x90
-nss_unary_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B12.1:                        # Preds ..B12.0
-..___tag_value_nss_unary_expr.137:                              #
-..LN1151:
-        pushq     %rbp                                          #1361.1
-        movq      %rsp, %rbp                                    #1361.1
-..___tag_value_nss_unary_expr.138:                              #
-        subq      $112, %rsp                                    #1361.1
-        movq      %rbx, -24(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.141:                              #
-        movq      %rdi, -56(%rbp)                               #1361.1
-        movq      %rsi, -48(%rbp)                               #1361.1
-        movq      %rdx, -40(%rbp)                               #1361.1
-        movq      %rcx, -32(%rbp)                               #1361.1
-        movl      %r8d, -16(%rbp)                               #1361.1
-..LN1153:
-        movq      -56(%rbp), %rax                               #1362.5
-        movq      -48(%rbp), %rdx                               #1362.5
-        cmpq      %rdx, %rax                                    #1362.5
-        jb        ..B12.3       # Prob 50%                      #1362.5
-                                # LOE
-..B12.2:                        # Preds ..B12.1
-        lea       _2__STRING.3.0(%rip), %rax                    #1362.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #1362.5
-        lea       __$U3.0(%rip), %rcx                           #1362.5
-        movq      %rax, %rdi                                    #1362.5
-        movq      %rdx, %rsi                                    #1362.5
-        movl      $1362, %edx                                   #1362.5
-        call      __assert_fail at PLT                             #1362.5
-                                # LOE
-..B12.3:                        # Preds ..B12.1
-..LN1155:
-        movq      -56(%rbp), %rax                               #1363.12
-        movzbl    (%rax), %eax                                  #1363.12
-        movsbq    %al, %rax                                     #1363.12
-..LN1157:
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B12.6       # Prob 50%                      #1363.17
-                                # LOE
-..B12.4:                        # Preds ..B12.3
-..LN1159:
-        movq      -56(%rbp), %rax                               #1364.35
-..LN1161:
-        movq      -48(%rbp), %rdx                               #1364.38
-..LN1163:
-        movq      -40(%rbp), %rcx                               #1364.43
-..LN1165:
-        movq      -32(%rbp), %rbx                               #1364.49
-..LN1167:
-        movl      -16(%rbp), %esi                               #1364.57
-..LN1169:
-        movq      %rax, %rdi                                    #1364.16
-        movl      %esi, -64(%rbp)                               #1364.16
-        movq      %rdx, %rsi                                    #1364.16
-        movq      %rcx, %rdx                                    #1364.16
-        movq      %rbx, %rcx                                    #1364.16
-        movl      -64(%rbp), %eax                               #1364.16
-        movl      %eax, %r8d                                    #1364.16
-        call      nss_primary_expr at PLT                          #1364.16
-                                # LOE rax
-..B12.19:                       # Preds ..B12.4
-        movq      %rax, -80(%rbp)                               #1364.16
-                                # LOE
-..B12.5:                        # Preds ..B12.19
-        movq      -80(%rbp), %rax                               #1364.16
-        movq      -24(%rbp), %rbx                               #1364.16
-..___tag_value_nss_unary_expr.142:                              #
-        leave                                                   #1364.16
-..___tag_value_nss_unary_expr.144:                              #
-        ret                                                     #1364.16
-..___tag_value_nss_unary_expr.145:                              #
-                                # LOE
-..B12.6:                        # Preds ..B12.3
-..LN1171:
-        movq      -56(%rbp), %rax                               #1374.19
-        incq      %rax                                          #1374.19
-..LN1173:
-        movq      -48(%rbp), %rdx                               #1374.26
-..LN1175:
-        movq      %rax, %rdi                                    #1374.9
-        movq      %rdx, %rsi                                    #1374.9
-        call      nss_sob at PLT                                   #1374.9
-                                # LOE rax
-..B12.20:                       # Preds ..B12.6
-        movq      %rax, -72(%rbp)                               #1374.9
-                                # LOE
-..B12.7:                        # Preds ..B12.20
-..LN1177:
-        movq      -72(%rbp), %rax                               #1374.5
-        movq      %rax, -56(%rbp)                               #1374.5
-..LN1179:
-        movq      -56(%rbp), %rax                               #1375.10
-..LN1181:
-        movq      -48(%rbp), %rdx                               #1375.15
-        cmpq      %rdx, %rax                                    #1375.15
-        jne       ..B12.9       # Prob 50%                      #1375.15
-                                # LOE
-..B12.8:                        # Preds ..B12.7
-..LN1183:
-        movq      -32(%rbp), %rax                               #1376.9
-        movl      $22, (%rax)                                   #1376.9
-        jmp       ..B12.16      # Prob 100%                     #1376.9
-                                # LOE
-..B12.9:                        # Preds ..B12.7
-..LN1185:
-        movl      $16, %edi                                     #1379.25
-        call      malloc at PLT                                    #1379.25
-                                # LOE rax
-..B12.21:                       # Preds ..B12.9
-        movq      %rax, -88(%rbp)                               #1379.25
-                                # LOE
-..B12.10:                       # Preds ..B12.21
-..LN1187:
-        movq      -88(%rbp), %rax                               #1379.23
-        movq      %rax, -96(%rbp)                               #1379.23
-..LN1189:
-        movq      -96(%rbp), %rax                               #1380.14
-..LN1191:
-        testq     %rax, %rax                                    #1380.19
-        jne       ..B12.12      # Prob 50%                      #1380.19
-                                # LOE
-..B12.11:                       # Preds ..B12.10
-..LN1193:
-        call      __errno_location at PLT                          #1381.24
-                                # LOE rax
-..B12.22:                       # Preds ..B12.11
-..LN1195:
-        movq      -32(%rbp), %rdx                               #1381.13
-..LN1197:
-        movl      (%rax), %eax                                  #1381.24
-..LN1199:
-        movl      %eax, (%rdx)                                  #1381.13
-        jmp       ..B12.16      # Prob 100%                     #1381.13
-                                # LOE
-..B12.12:                       # Preds ..B12.10
-..LN1201:
-        movq      -96(%rbp), %rax                               #1384.13
-        movl      $12, (%rax)                                   #1384.13
-..LN1203:
-        movq      -96(%rbp), %rax                               #1385.13
-        movl      $13, 4(%rax)                                  #1385.13
-..LN1205:
-        movq      -96(%rbp), %rax                               #1386.13
-        movq      $0, 8(%rax)                                   #1386.13
-..LN1207:
-        movq      -40(%rbp), %rax                               #1387.13
-..LN1209:
-        movq      -96(%rbp), %rdx                               #1387.22
-..LN1211:
-        movq      %rdx, (%rax)                                  #1387.13
-..LN1213:
-        movq      -56(%rbp), %rax                               #1389.34
-..LN1215:
-        movq      -48(%rbp), %rdx                               #1389.37
-..LN1217:
-        movq      -96(%rbp), %rcx                               #1389.44
-        addq      $8, %rcx                                      #1389.44
-..LN1219:
-        movq      -32(%rbp), %rbx                               #1389.61
-..LN1221:
-        movl      -16(%rbp), %esi                               #1389.69
-..LN1223:
-        movq      %rax, %rdi                                    #1389.17
-        movl      %esi, -104(%rbp)                              #1389.17
-        movq      %rdx, %rsi                                    #1389.17
-        movq      %rcx, %rdx                                    #1389.17
-        movq      %rbx, %rcx                                    #1389.17
-        movl      -104(%rbp), %eax                              #1389.17
-        movl      %eax, %r8d                                    #1389.17
-        call      nss_unary_expr at PLT                            #1389.17
-                                # LOE rax
-..B12.23:                       # Preds ..B12.12
-        movq      %rax, -112(%rbp)                              #1389.17
-                                # LOE
-..B12.13:                       # Preds ..B12.23
-..LN1225:
-        movq      -112(%rbp), %rax                              #1389.13
-        movq      %rax, -56(%rbp)                               #1389.13
-..LN1227:
-        movq      -32(%rbp), %rax                               #1390.13
-        movl      (%rax), %eax                                  #1390.13
-        testl     %eax, %eax                                    #1390.13
-        jne       ..B12.16      # Prob 50%                      #1390.13
-                                # LOE
-..B12.14:                       # Preds ..B12.13
-        movq      -96(%rbp), %rax                               #1390.13
-        movq      8(%rax), %rax                                 #1390.13
-        testq     %rax, %rax                                    #1390.13
-        jne       ..B12.16      # Prob 50%                      #1390.13
-                                # LOE
-..B12.15:                       # Preds ..B12.14
-        lea       _2__STRING.4.0(%rip), %rax                    #1390.13
-        lea       _2__STRING.1.0(%rip), %rdx                    #1390.13
-        lea       __$U3.0(%rip), %rcx                           #1390.13
-        movq      %rax, %rdi                                    #1390.13
-        movq      %rdx, %rsi                                    #1390.13
-        movl      $1390, %edx                                   #1390.13
-        call      __assert_fail at PLT                             #1390.13
-                                # LOE
-..B12.16:                       # Preds ..B12.8 ..B12.22 ..B12.14 ..B12.13
-..LN1229:
-        movq      -56(%rbp), %rax                               #1393.12
-        movq      -24(%rbp), %rbx                               #1393.12
-..___tag_value_nss_unary_expr.147:                              #
-        leave                                                   #1393.12
-..___tag_value_nss_unary_expr.149:                              #
-        ret                                                     #1393.12
-        .align    2,0x90
-..___tag_value_nss_unary_expr.150:                              #
-                                # LOE
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-.LNnss_unary_expr:
-	.data
-# -- End  nss_unary_expr
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    2,0x90
-nss_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B13.1:                        # Preds ..B13.0
-..___tag_value_nss_expr.153:                                    #
-..LN1231:
-        pushq     %rbp                                          #1406.1
-        movq      %rsp, %rbp                                    #1406.1
-..___tag_value_nss_expr.154:                                    #
-        subq      $128, %rsp                                    #1406.1
-        movq      %rbx, -24(%rbp)                               #1406.1
-..___tag_value_nss_expr.157:                                    #
-        movq      %rdi, -64(%rbp)                               #1406.1
-        movq      %rsi, -56(%rbp)                               #1406.1
-        movq      %rdx, -48(%rbp)                               #1406.1
-        movq      %rcx, -40(%rbp)                               #1406.1
-        movl      %r8d, -16(%rbp)                               #1406.1
-..LN1233:
-        movq      -48(%rbp), %rax                               #1407.5
-        movq      $0, (%rax)                                    #1407.5
-..LN1235:
-        movq      -64(%rbp), %rax                               #1409.19
-..LN1237:
-        movq      -56(%rbp), %rdx                               #1409.22
-..LN1239:
-        movq      %rax, %rdi                                    #1409.9
-        movq      %rdx, %rsi                                    #1409.9
-        call      nss_sob at PLT                                   #1409.9
-                                # LOE rax
-..B13.32:                       # Preds ..B13.1
-        movq      %rax, -32(%rbp)                               #1409.9
-                                # LOE
-..B13.2:                        # Preds ..B13.32
-..LN1241:
-        movq      -32(%rbp), %rax                               #1409.5
-        movq      %rax, -64(%rbp)                               #1409.5
-..LN1243:
-        movq      -64(%rbp), %rax                               #1410.10
-..LN1245:
-        movq      -56(%rbp), %rdx                               #1410.15
-        cmpq      %rdx, %rax                                    #1410.15
-        je        ..B13.29      # Prob 50%                      #1410.15
-                                # LOE
-..B13.3:                        # Preds ..B13.2
-..LN1247:
-        movq      -64(%rbp), %rax                               #1412.30
-..LN1249:
-        movq      -56(%rbp), %rdx                               #1412.33
-..LN1251:
-        movq      -48(%rbp), %rcx                               #1412.38
-..LN1253:
-        movq      -40(%rbp), %rbx                               #1412.44
-..LN1255:
-        movl      -16(%rbp), %esi                               #1412.52
-..LN1257:
-        movq      %rax, %rdi                                    #1412.13
-        movl      %esi, -72(%rbp)                               #1412.13
-        movq      %rdx, %rsi                                    #1412.13
-        movq      %rcx, %rdx                                    #1412.13
-        movq      %rbx, %rcx                                    #1412.13
-        movl      -72(%rbp), %eax                               #1412.13
-        movl      %eax, %r8d                                    #1412.13
-        call      nss_unary_expr at PLT                            #1412.13
-                                # LOE rax
-..B13.33:                       # Preds ..B13.3
-        movq      %rax, -80(%rbp)                               #1412.13
-                                # LOE
-..B13.4:                        # Preds ..B13.33
-..LN1259:
-        movq      -80(%rbp), %rax                               #1412.9
-        movq      %rax, -64(%rbp)                               #1412.9
-..LN1261:
-        movq      -40(%rbp), %rax                               #1413.16
-        movl      (%rax), %eax                                  #1413.16
-..LN1263:
-        testl     %eax, %eax                                    #1413.26
-        jne       ..B13.29      # Prob 50%                      #1413.26
-                                # LOE
-..B13.5:                        # Preds ..B13.4
-..LN1265:
-        movq      -64(%rbp), %rax                               #1415.27
-..LN1267:
-        movq      -56(%rbp), %rdx                               #1415.30
-..LN1269:
-        movq      %rax, %rdi                                    #1415.17
-        movq      %rdx, %rsi                                    #1415.17
-        call      nss_sob at PLT                                   #1415.17
-                                # LOE rax
-..B13.34:                       # Preds ..B13.5
-        movq      %rax, -88(%rbp)                               #1415.17
-                                # LOE
-..B13.6:                        # Preds ..B13.34
-..LN1271:
-        movq      -88(%rbp), %rax                               #1415.13
-        movq      %rax, -64(%rbp)                               #1415.13
-..LN1273:
-        movq      -64(%rbp), %rax                               #1416.18
-..LN1275:
-        movq      -56(%rbp), %rdx                               #1416.23
-        cmpq      %rdx, %rax                                    #1416.23
-        je        ..B13.29      # Prob 50%                      #1416.23
-                                # LOE
-..B13.7:                        # Preds ..B13.6
-..LN1277:
-        movq      -48(%rbp), %rax                               #1420.17
-        movq      (%rax), %rax                                  #1420.17
-        testq     %rax, %rax                                    #1420.17
-        jne       ..B13.9       # Prob 50%                      #1420.17
-                                # LOE
-..B13.8:                        # Preds ..B13.7
-        lea       _2__STRING.5.0(%rip), %rax                    #1420.17
-        lea       _2__STRING.1.0(%rip), %rdx                    #1420.17
-        lea       __$U4.0(%rip), %rcx                           #1420.17
-        movq      %rax, %rdi                                    #1420.17
-        movq      %rdx, %rsi                                    #1420.17
-        movl      $1420, %edx                                   #1420.17
-        call      __assert_fail at PLT                             #1420.17
-                                # LOE
-..B13.9:                        # Preds ..B13.7
-..LN1279:
-        movq      -64(%rbp), %rax                               #1422.28
-        movzbl    (%rax), %eax                                  #1422.28
-        movsbq    %al, %rax                                     #1422.28
-        movl      %eax, -92(%rbp)                               #1422.28
-        incq      -64(%rbp)                                     #1422.28
-        cmpl      $41, %eax                                     #1422.28
-        je        ..B13.12      # Prob 50%                      #1422.28
-                                # LOE
-..B13.10:                       # Preds ..B13.9
-        movl      -92(%rbp), %eax                               #1422.28
-        cmpl      $38, %eax                                     #1422.28
-        je        ..B13.13      # Prob 50%                      #1422.28
-                                # LOE
-..B13.11:                       # Preds ..B13.10
-        movl      -92(%rbp), %eax                               #1422.28
-        cmpl      $124, %eax                                    #1422.28
-        je        ..B13.17      # Prob 50%                      #1422.28
-        jmp       ..B13.21      # Prob 100%                     #1422.28
-                                # LOE
-..B13.12:                       # Preds ..B13.9
-..LN1281:
-        movq      -64(%rbp), %rax                               #1425.28
-..LN1283:
-        decq      %rax                                          #1425.32
-        movq      -24(%rbp), %rbx                               #1425.32
-..___tag_value_nss_expr.158:                                    #
-        leave                                                   #1425.32
-..___tag_value_nss_expr.160:                                    #
-        ret                                                     #1425.32
-..___tag_value_nss_expr.161:                                    #
-                                # LOE
-..B13.13:                       # Preds ..B13.10
-..LN1285:
-        movq      -64(%rbp), %rax                               #1427.26
-..LN1287:
-        movq      -56(%rbp), %rdx                               #1427.30
-        cmpq      %rdx, %rax                                    #1427.30
-        jae       ..B13.16      # Prob 50%                      #1427.30
-                                # LOE
-..B13.14:                       # Preds ..B13.13
-..LN1289:
-        movq      -64(%rbp), %rax                               #1427.39
-        movzbl    (%rax), %eax                                  #1427.39
-        movsbq    %al, %rax                                     #1427.39
-..LN1291:
-        cmpl      $38, %eax                                     #1427.44
-        jne       ..B13.16      # Prob 50%                      #1427.44
-                                # LOE
-..B13.15:                       # Preds ..B13.14
-..LN1293:
-        incq      -64(%rbp)                                     #1428.28
-                                # LOE
-..B13.16:                       # Preds ..B13.15 ..B13.14 ..B13.13
-..LN1295:
-        movl      $16, -96(%rbp)                                #1429.21
-        jmp       ..B13.22      # Prob 100%                     #1429.21
-                                # LOE
-..B13.17:                       # Preds ..B13.11
-..LN1297:
-        movq      -64(%rbp), %rax                               #1432.26
-..LN1299:
-        movq      -56(%rbp), %rdx                               #1432.30
-        cmpq      %rdx, %rax                                    #1432.30
-        jae       ..B13.20      # Prob 50%                      #1432.30
-                                # LOE
-..B13.18:                       # Preds ..B13.17
-..LN1301:
-        movq      -64(%rbp), %rax                               #1432.39
-        movzbl    (%rax), %eax                                  #1432.39
-        movsbq    %al, %rax                                     #1432.39
-..LN1303:
-        cmpl      $124, %eax                                    #1432.44
-        jne       ..B13.20      # Prob 50%                      #1432.44
-                                # LOE
-..B13.19:                       # Preds ..B13.18
-..LN1305:
-        incq      -64(%rbp)                                     #1433.28
-                                # LOE
-..B13.20:                       # Preds ..B13.19 ..B13.18 ..B13.17
-..LN1307:
-        movl      $17, -96(%rbp)                                #1434.21
-        jmp       ..B13.22      # Prob 100%                     #1434.21
-                                # LOE
-..B13.21:                       # Preds ..B13.11
-..LN1309:
-        movq      -40(%rbp), %rax                               #1438.21
-        movl      $22, (%rax)                                   #1438.21
-..LN1311:
-        movq      -64(%rbp), %rax                               #1439.28
-..LN1313:
-        decq      %rax                                          #1439.32
-        movq      -24(%rbp), %rbx                               #1439.32
-..___tag_value_nss_expr.163:                                    #
-        leave                                                   #1439.32
-..___tag_value_nss_expr.165:                                    #
-        ret                                                     #1439.32
-..___tag_value_nss_expr.166:                                    #
-                                # LOE
-..B13.22:                       # Preds ..B13.16 ..B13.20
-..LN1315:
-        movl      $24, %edi                                     #1451.21
-        call      malloc at PLT                                    #1451.21
-                                # LOE rax
-..B13.35:                       # Preds ..B13.22
-        movq      %rax, -104(%rbp)                              #1451.21
-                                # LOE
-..B13.23:                       # Preds ..B13.35
-..LN1317:
-        movq      -104(%rbp), %rax                              #1451.17
-        movq      %rax, -112(%rbp)                              #1451.17
-..LN1319:
-        movq      -112(%rbp), %rax                              #1452.22
-..LN1321:
-        testq     %rax, %rax                                    #1452.27
-        jne       ..B13.25      # Prob 50%                      #1452.27
-                                # LOE
-..B13.24:                       # Preds ..B13.23
-..LN1323:
-        call      __errno_location at PLT                          #1454.32
-                                # LOE rax
-..B13.36:                       # Preds ..B13.24
-..LN1325:
-        movq      -40(%rbp), %rdx                               #1454.21
-..LN1327:
-        movl      (%rax), %eax                                  #1454.32
-..LN1329:
-        movl      %eax, (%rdx)                                  #1454.21
-..LN1331:
-        movq      -64(%rbp), %rax                               #1455.28
-        movq      -24(%rbp), %rbx                               #1455.28
-..___tag_value_nss_expr.168:                                    #
-        leave                                                   #1455.28
-..___tag_value_nss_expr.170:                                    #
-        ret                                                     #1455.28
-..___tag_value_nss_expr.171:                                    #
-                                # LOE
-..B13.25:                       # Preds ..B13.23
-..LN1333:
-        movq      -112(%rbp), %rax                              #1458.17
-        movl      $11, (%rax)                                   #1458.17
-..LN1335:
-        movq      -112(%rbp), %rax                              #1459.17
-..LN1337:
-        movl      -96(%rbp), %edx                               #1459.37
-..LN1339:
-        movl      %edx, 4(%rax)                                 #1459.17
-..LN1341:
-        movq      -48(%rbp), %rax                               #1460.41
-..LN1343:
-        movq      -112(%rbp), %rdx                              #1460.17
-..LN1345:
-        movq      (%rax), %rax                                  #1460.41
-..LN1347:
-        movq      %rax, 8(%rdx)                                 #1460.17
-..LN1349:
-        movq      -48(%rbp), %rax                               #1461.17
-..LN1351:
-        movq      -112(%rbp), %rdx                              #1461.26
-..LN1353:
-        movq      %rdx, (%rax)                                  #1461.17
-..LN1355:
-        movq      -64(%rbp), %rax                               #1464.32
-..LN1357:
-        movq      -56(%rbp), %rdx                               #1464.35
-..LN1359:
-        movq      -112(%rbp), %rcx                              #1464.42
-        addq      $16, %rcx                                     #1464.42
-..LN1361:
-        movq      -40(%rbp), %rbx                               #1464.64
-..LN1363:
-        movl      -16(%rbp), %esi                               #1464.72
-..LN1365:
-        movq      %rax, %rdi                                    #1464.21
-        movl      %esi, -120(%rbp)                              #1464.21
-        movq      %rdx, %rsi                                    #1464.21
-        movq      %rcx, %rdx                                    #1464.21
-        movq      %rbx, %rcx                                    #1464.21
-        movl      -120(%rbp), %eax                              #1464.21
-        movl      %eax, %r8d                                    #1464.21
-        call      nss_expr at PLT                                  #1464.21
-                                # LOE rax
-..B13.37:                       # Preds ..B13.25
-        movq      %rax, -128(%rbp)                              #1464.21
-                                # LOE
-..B13.26:                       # Preds ..B13.37
-..LN1367:
-        movq      -128(%rbp), %rax                              #1464.17
-        movq      %rax, -64(%rbp)                               #1464.17
-..LN1369:
-        movq      -40(%rbp), %rax                               #1465.17
-        movl      (%rax), %eax                                  #1465.17
-        testl     %eax, %eax                                    #1465.17
-        jne       ..B13.29      # Prob 50%                      #1465.17
-                                # LOE
-..B13.27:                       # Preds ..B13.26
-        movq      -112(%rbp), %rax                              #1465.17
-        movq      16(%rax), %rax                                #1465.17
-        testq     %rax, %rax                                    #1465.17
-        jne       ..B13.29      # Prob 50%                      #1465.17
-                                # LOE
-..B13.28:                       # Preds ..B13.27
-        lea       _2__STRING.6.0(%rip), %rax                    #1465.17
-        lea       _2__STRING.1.0(%rip), %rdx                    #1465.17
-        lea       __$U4.0(%rip), %rcx                           #1465.17
-        movq      %rax, %rdi                                    #1465.17
-        movq      %rdx, %rsi                                    #1465.17
-        movl      $1465, %edx                                   #1465.17
-        call      __assert_fail at PLT                             #1465.17
-                                # LOE
-..B13.29:                       # Preds ..B13.27 ..B13.26 ..B13.6 ..B13.4 ..B13.2
-                                #      
-..LN1371:
-        movq      -64(%rbp), %rax                               #1470.12
-        movq      -24(%rbp), %rbx                               #1470.12
-..___tag_value_nss_expr.173:                                    #
-        leave                                                   #1470.12
-..___tag_value_nss_expr.175:                                    #
-        ret                                                     #1470.12
-        .align    2,0x90
-..___tag_value_nss_expr.176:                                    #
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-.LNnss_expr:
-	.data
-# -- End  nss_expr
-	.text
-# -- Begin  NucStrstrInit
-# mark_begin;
-       .align    2,0x90
-NucStrstrInit:
-..B14.1:                        # Preds ..B14.0
-..___tag_value_NucStrstrInit.179:                               #
-..LN1373:
-        pushq     %rbp                                          #1484.1
-        movq      %rsp, %rbp                                    #1484.1
-..___tag_value_NucStrstrInit.180:                               #
-        subq      $64, %rsp                                     #1484.1
-..LN1375:
-        lea       _2__STRING.7.0(%rip), %rax                    #1487.29
-        movq      %rax, -64(%rbp)                               #1487.29
-..LN1377:
-        lea       _2__STRING.8.0(%rip), %rax                    #1488.25
-        movq      %rax, -56(%rbp)                               #1488.25
-..LN1379:
-        lea       fasta_2na_map.0(%rip), %rax                   #1491.14
-..LN1381:
-        movq      %rax, %rdi                                    #1491.5
-        movl      $-1, %esi                                     #1491.5
-        movl      $128, %edx                                    #1491.5
-        call      memset at PLT                                    #1491.5
-                                # LOE
-..B14.2:                        # Preds ..B14.1
-..LN1383:
-        lea       fasta_4na_map.0(%rip), %rax                   #1492.14
-..LN1385:
-        movq      %rax, %rdi                                    #1492.5
-        movl      $-1, %esi                                     #1492.5
-        movl      $128, %edx                                    #1492.5
-        call      memset at PLT                                    #1492.5
-                                # LOE
-..B14.3:                        # Preds ..B14.2
-..LN1387:
-        movl      $0, -40(%rbp)                                 #1495.11
-..LN1389:
-        movq      -64(%rbp), %rax                               #1495.22
-..LN1391:
-        movq      %rax, -48(%rbp)                               #1495.18
-..LN1393:
-        movq      -48(%rbp), %rax                               #1495.31
-        movzbl    (%rax), %eax                                  #1495.31
-        movsbq    %al, %rax                                     #1495.31
-..LN1395:
-        testl     %eax, %eax                                    #1495.42
-        je        ..B14.7       # Prob 50%                      #1495.42
-                                # LOE
-..B14.5:                        # Preds ..B14.3 ..B14.6
-..LN1397:
-        movq      -48(%rbp), %rax                               #1497.14
-        movzbl    (%rax), %eax                                  #1497.14
-        movsbq    %al, %rax                                     #1497.14
-..LN1399:
-        movl      %eax, -36(%rbp)                               #1497.9
-..LN1401:
-        movl      -40(%rbp), %eax                               #1498.78
-        movl      %eax, -32(%rbp)                               #1498.78
-..LN1403:
-        movl      -36(%rbp), %eax                               #1498.58
-..LN1405:
-        movl      %eax, %edi                                    #1498.48
-        call      tolower at PLT                                   #1498.48
-                                # LOE eax
-..B14.20:                       # Preds ..B14.5
-        movl      %eax, -28(%rbp)                               #1498.48
-                                # LOE
-..B14.6:                        # Preds ..B14.20
-..LN1407:
-        movl      -28(%rbp), %eax                               #1498.32
-        movslq    %eax, %rax                                    #1498.32
-        lea       fasta_2na_map.0(%rip), %rdx                   #1498.32
-        movl      -32(%rbp), %ecx                               #1498.32
-        movb      %cl, (%rax,%rdx)                              #1498.32
-..LN1409:
-        movl      -36(%rbp), %eax                               #1498.25
-..LN1411:
-        movslq    %eax, %rax                                    #1498.9
-        lea       fasta_2na_map.0(%rip), %rdx                   #1498.9
-        movl      -32(%rbp), %ecx                               #1498.9
-        movb      %cl, (%rax,%rdx)                              #1498.9
-..LN1413:
-        incl      -40(%rbp)                                     #1495.48
-..LN1415:
-        incq      -48(%rbp)                                     #1495.54
-..LN1417:
-        movq      -48(%rbp), %rax                               #1495.31
-        movzbl    (%rax), %eax                                  #1495.31
-        movsbq    %al, %rax                                     #1495.31
-..LN1419:
-        testl     %eax, %eax                                    #1495.42
-        jne       ..B14.5       # Prob 50%                      #1495.42
-                                # LOE
-..B14.7:                        # Preds ..B14.6 ..B14.3
-..LN1421:
-        movl      $0, -40(%rbp)                                 #1502.11
-..LN1423:
-        movq      -56(%rbp), %rax                               #1502.22
-..LN1425:
-        movq      %rax, -48(%rbp)                               #1502.18
-..LN1427:
-        movq      -48(%rbp), %rax                               #1502.31
-        movzbl    (%rax), %eax                                  #1502.31
-        movsbq    %al, %rax                                     #1502.31
-..LN1429:
-        testl     %eax, %eax                                    #1502.42
-        je        ..B14.11      # Prob 50%                      #1502.42
-                                # LOE
-..B14.9:                        # Preds ..B14.7 ..B14.10
-..LN1431:
-        movq      -48(%rbp), %rax                               #1504.14
-        movzbl    (%rax), %eax                                  #1504.14
-        movsbq    %al, %rax                                     #1504.14
-..LN1433:
-        movl      %eax, -36(%rbp)                               #1504.9
-..LN1435:
-        movl      -40(%rbp), %eax                               #1505.78
-        movl      %eax, -24(%rbp)                               #1505.78
-..LN1437:
-        movl      -36(%rbp), %eax                               #1505.58
-..LN1439:
-        movl      %eax, %edi                                    #1505.48
-        call      tolower at PLT                                   #1505.48
-                                # LOE eax
-..B14.21:                       # Preds ..B14.9
-        movl      %eax, -20(%rbp)                               #1505.48
-                                # LOE
-..B14.10:                       # Preds ..B14.21
-..LN1441:
-        movl      -20(%rbp), %eax                               #1505.32
-        movslq    %eax, %rax                                    #1505.32
-        lea       fasta_4na_map.0(%rip), %rdx                   #1505.32
-        movl      -24(%rbp), %ecx                               #1505.32
-        movb      %cl, (%rax,%rdx)                              #1505.32
-..LN1443:
-        movl      -36(%rbp), %eax                               #1505.25
-..LN1445:
-        movslq    %eax, %rax                                    #1505.9
-        lea       fasta_4na_map.0(%rip), %rdx                   #1505.9
-        movl      -24(%rbp), %ecx                               #1505.9
-        movb      %cl, (%rax,%rdx)                              #1505.9
-..LN1447:
-        incl      -40(%rbp)                                     #1502.48
-..LN1449:
-        incq      -48(%rbp)                                     #1502.54
-..LN1451:
-        movq      -48(%rbp), %rax                               #1502.31
-        movzbl    (%rax), %eax                                  #1502.31
-        movsbq    %al, %rax                                     #1502.31
-..LN1453:
-        testl     %eax, %eax                                    #1502.42
-        jne       ..B14.9       # Prob 50%                      #1502.42
-                                # LOE
-..B14.11:                       # Preds ..B14.10 ..B14.7
-..LN1455:
-        movl      $0, -40(%rbp)                                 #1510.11
-..LN1457:
-        movl      -40(%rbp), %eax                               #1510.18
-..LN1459:
-        cmpl      $256, %eax                                    #1510.22
-        jae       ..B14.17      # Prob 50%                      #1510.22
-                                # LOE
-..B14.13:                       # Preds ..B14.11 ..B14.16
-..LN1461:
-        movl      -40(%rbp), %eax                               #1511.28
-        movl      %eax, %eax                                    #1511.28
-        lea       expand_2na.0(%rip), %rdx                      #1511.28
-        movzwl    (%rdx,%rax,2), %eax                           #1511.28
-        movw      %ax, -16(%rbp)                                #1511.28
-        xorl      %eax, %eax                                    #1511.28
-        testl     %eax, %eax                                    #1511.28
-        jne       ..B14.15      # Prob 50%                      #1511.28
-                                # LOE
-..B14.14:                       # Preds ..B14.13
-..LN1463:
-        movzwl    -16(%rbp), %eax                               #1511.0
-        rorw      $8, %ax                                       #1511.0
-        movw      %ax, -12(%rbp)                                #1511.0
-        jmp       ..B14.16      # Prob 100%                     #1511.0
-                                # LOE
-..B14.15:                       # Preds ..B14.13
-..LN1465:
-        movzwl    -16(%rbp), %eax                               #1511.28
-        shrl      $8, %eax                                      #1511.28
-        movzbl    %al, %eax                                     #1511.28
-        movzwl    -16(%rbp), %edx                               #1511.28
-        movzbl    %dl, %edx                                     #1511.28
-        shll      $8, %edx                                      #1511.28
-        orl       %edx, %eax                                    #1511.28
-        movw      %ax, -12(%rbp)                                #1511.28
-                                # LOE
-..B14.16:                       # Preds ..B14.15 ..B14.14
-..LN1467:
-        movl      -40(%rbp), %eax                               #1511.22
-..LN1469:
-        movl      %eax, %eax                                    #1511.9
-        lea       expand_2na.0(%rip), %rdx                      #1511.9
-..LN1471:
-        movzwl    -12(%rbp), %ecx                               #1511.28
-..LN1473:
-        movw      %cx, (%rdx,%rax,2)                            #1511.9
-..LN1475:
-        incl      -40(%rbp)                                     #1510.30
-..LN1477:
-        movl      -40(%rbp), %eax                               #1510.18
-..LN1479:
-        cmpl      $256, %eax                                    #1510.22
-        jb        ..B14.13      # Prob 50%                      #1510.22
-                                # LOE
-..B14.17:                       # Preds ..B14.16 ..B14.11
-..LN1481:
-        leave                                                   #1513.1
-..___tag_value_NucStrstrInit.184:                               #
-        ret                                                     #1513.1
-        .align    2,0x90
-..___tag_value_NucStrstrInit.185:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrInit, at function
-	.size	NucStrstrInit,.-NucStrstrInit
-.LNNucStrstrInit:
-	.data
-# -- End  NucStrstrInit
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1(nss): %rdi
-# parameter 2(positional): %esi
-# parameter 3(query): %rdx
-# parameter 4(len): %ecx
-..B15.1:                        # Preds ..B15.0
-..___tag_value_NucStrstrMake.188:                               #
-..LN1483:
-        pushq     %rbp                                          #1539.1
-        movq      %rsp, %rbp                                    #1539.1
-..___tag_value_NucStrstrMake.189:                               #
-        subq      $80, %rsp                                     #1539.1
-        movq      %rbx, -32(%rbp)                               #1539.1
-..___tag_value_NucStrstrMake.192:                               #
-        movq      %rdi, -48(%rbp)                               #1539.1
-        movl      %esi, -24(%rbp)                               #1539.1
-        movq      %rdx, -40(%rbp)                               #1539.1
-        movl      %ecx, -16(%rbp)                               #1539.1
-..LN1485:
-        movq      -48(%rbp), %rax                               #1540.10
-..LN1487:
-        testq     %rax, %rax                                    #1540.17
-        je        ..B15.14      # Prob 50%                      #1540.17
-                                # LOE
-..B15.2:                        # Preds ..B15.1
-..LN1489:
-        movq      -40(%rbp), %rax                               #1542.14
-..LN1491:
-        testq     %rax, %rax                                    #1542.23
-        je        ..B15.13      # Prob 50%                      #1542.23
-                                # LOE
-..B15.3:                        # Preds ..B15.2
-..LN1493:
-        movl      -16(%rbp), %eax                               #1542.31
-..LN1495:
-        testl     %eax, %eax                                    #1542.38
-        je        ..B15.13      # Prob 50%                      #1542.38
-                                # LOE
-..B15.4:                        # Preds ..B15.3
-..LN1497:
-        movl      $0, -56(%rbp)                                 #1544.24
-..LN1499:
-        lea       fasta_2na_map.0(%rip), %rax                   #1547.18
-        movzbl    (%rax), %eax                                  #1547.18
-        movsbq    %al, %rax                                     #1547.18
-..LN1501:
-        testl     %eax, %eax                                    #1547.41
-        jne       ..B15.6       # Prob 50%                      #1547.41
-                                # LOE
-..B15.5:                        # Preds ..B15.4
-..LN1503:
-        call      NucStrstrInit at PLT                             #1548.17
-                                # LOE
-..B15.6:                        # Preds ..B15.5 ..B15.4
-..LN1505:
-        movl      -16(%rbp), %eax                               #1550.27
-..LN1507:
-        movl      %eax, %eax                                    #1550.19
-        addq      -40(%rbp), %rax                               #1550.19
-..LN1509:
-        movq      %rax, -80(%rbp)                               #1550.13
-..LN1511:
-        movq      -40(%rbp), %rax                               #1551.32
-..LN1513:
-        movq      -80(%rbp), %rdx                               #1551.39
-..LN1515:
-        movq      -48(%rbp), %rcx                               #1551.44
-..LN1517:
-        lea       -56(%rbp), %rbx                               #1551.49
-..LN1519:
-        movl      -24(%rbp), %esi                               #1551.59
-..LN1521:
-        movq      %rax, %rdi                                    #1551.21
-        movl      %esi, -64(%rbp)                               #1551.21
-        movq      %rdx, %rsi                                    #1551.21
-        movq      %rcx, %rdx                                    #1551.21
-        movq      %rbx, %rcx                                    #1551.21
-        movl      -64(%rbp), %eax                               #1551.21
-        movl      %eax, %r8d                                    #1551.21
-        call      nss_expr at PLT                                  #1551.21
-                                # LOE rax
-..B15.17:                       # Preds ..B15.6
-        movq      %rax, -72(%rbp)                               #1551.21
-                                # LOE
-..B15.7:                        # Preds ..B15.17
-..LN1523:
-        movq      -72(%rbp), %rax                               #1551.13
-        movq      %rax, -40(%rbp)                               #1551.13
-..LN1525:
-        movl      -56(%rbp), %eax                               #1552.18
-..LN1527:
-        testl     %eax, %eax                                    #1552.28
-        jne       ..B15.11      # Prob 50%                      #1552.28
-                                # LOE
-..B15.8:                        # Preds ..B15.7
-..LN1529:
-        movq      -40(%rbp), %rax                               #1554.22
-..LN1531:
-        movq      -80(%rbp), %rdx                               #1554.31
-        cmpq      %rdx, %rax                                    #1554.31
-        jne       ..B15.10      # Prob 50%                      #1554.31
-                                # LOE
-..B15.9:                        # Preds ..B15.8
-..LN1533:
-        xorl      %eax, %eax                                    #1555.28
-        movq      -32(%rbp), %rbx                               #1555.28
-..___tag_value_NucStrstrMake.193:                               #
-        leave                                                   #1555.28
-..___tag_value_NucStrstrMake.195:                               #
-        ret                                                     #1555.28
-..___tag_value_NucStrstrMake.196:                               #
-                                # LOE
-..B15.10:                       # Preds ..B15.8
-..LN1535:
-        movl      $22, -56(%rbp)                                #1557.17
-                                # LOE
-..B15.11:                       # Preds ..B15.10 ..B15.7
-..LN1537:
-        movq      -48(%rbp), %rax                               #1560.32
-        movq      (%rax), %rax                                  #1560.32
-..LN1539:
-        movq      %rax, %rdi                                    #1560.13
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE
-..B15.12:                       # Preds ..B15.11
-..LN1541:
-        movq      -48(%rbp), %rax                               #1561.13
-        movq      $0, (%rax)                                    #1561.13
-..LN1543:
-        movl      -56(%rbp), %eax                               #1562.20
-        movq      -32(%rbp), %rbx                               #1562.20
-..___tag_value_NucStrstrMake.198:                               #
-        leave                                                   #1562.20
-..___tag_value_NucStrstrMake.200:                               #
-        ret                                                     #1562.20
-..___tag_value_NucStrstrMake.201:                               #
-                                # LOE
-..B15.13:                       # Preds ..B15.3 ..B15.2
-..LN1545:
-        movq      -48(%rbp), %rax                               #1565.9
-        movq      $0, (%rax)                                    #1565.9
-                                # LOE
-..B15.14:                       # Preds ..B15.13 ..B15.1
-..LN1547:
-        movl      $22, %eax                                     #1567.12
-        movq      -32(%rbp), %rbx                               #1567.12
-..___tag_value_NucStrstrMake.203:                               #
-        leave                                                   #1567.12
-..___tag_value_NucStrstrMake.205:                               #
-        ret                                                     #1567.12
-        .align    2,0x90
-..___tag_value_NucStrstrMake.206:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-.LNNucStrstrMake:
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1(self): %rdi
-..B16.1:                        # Preds ..B16.0
-..___tag_value_NucStrstrWhack.209:                              #
-..LN1549:
-        pushq     %rbp                                          #1574.1
-        movq      %rsp, %rbp                                    #1574.1
-..___tag_value_NucStrstrWhack.210:                              #
-        subq      $16, %rsp                                     #1574.1
-        movq      %rdi, -8(%rbp)                                #1574.1
-..LN1551:
-        movq      -8(%rbp), %rax                                #1575.10
-..LN1553:
-        testq     %rax, %rax                                    #1575.18
-        je        ..B16.22      # Prob 50%                      #1575.18
-                                # LOE
-..B16.2:                        # Preds ..B16.1
-..LN1555:
-        movq      -8(%rbp), %rax                                #1577.18
-        movl      (%rax), %eax                                  #1577.18
-        movl      %eax, -16(%rbp)                               #1577.18
-..LN1557:
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B16.21      # Prob 50%                      #1577.9
-                                # LOE
-..B16.3:                        # Preds ..B16.2
-        movl      -16(%rbp), %eax                               #1577.9
-        movl      %eax, %eax                                    #1577.9
-        lea       ..1..TPKT.18_0.0.13(%rip), %rdx               #1577.9
-        movq      (%rdx,%rax,8), %rax                           #1577.9
-        jmp       *%rax                                         #1577.9
-                                # LOE
-..1.18_0.TAG.0a.0.13:
-..1.18_0.TAG.09.0.13:
-..1.18_0.TAG.08.0.13:
-..1.18_0.TAG.07.0.13:
-..1.18_0.TAG.06.0.13:
-..1.18_0.TAG.05.0.13:
-..1.18_0.TAG.04.0.13:
-..1.18_0.TAG.03.0.13:
-..1.18_0.TAG.02.0.13:
-..1.18_0.TAG.01.0.13:
-..1.18_0.TAG.00.0.13:
-..B16.15:                       # Preds ..B16.3 ..B16.3 ..B16.3 ..B16.3 ..B16.3
-                                #       ..B16.3 ..B16.3 ..B16.3 ..B16.3 ..B16.3
-                                #       ..B16.3
-..LN1559:
-        movq      -8(%rbp), %rax                                #1593.20
-        movq      8(%rax), %rax                                 #1593.20
-..LN1561:
-        movq      %rax, -8(%rbp)                                #1593.13
-        jmp       ..B16.21      # Prob 100%                     #1593.13
-                                # LOE
-..1.18_0.TAG.0b.0.13:
-..B16.17:                       # Preds ..B16.3
-..LN1563:
-        movq      -8(%rbp), %rax                                #1597.30
-        movq      8(%rax), %rax                                 #1597.30
-..LN1565:
-        movq      %rax, %rdi                                    #1597.13
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE
-..B16.18:                       # Preds ..B16.17
-..LN1567:
-        movq      -8(%rbp), %rax                                #1598.30
-        movq      16(%rax), %rax                                #1598.30
-..LN1569:
-        movq      %rax, %rdi                                    #1598.13
-        call      NucStrstrWhack at PLT                            #1598.13
-        jmp       ..B16.21      # Prob 100%                     #1598.13
-                                # LOE
-..1.18_0.TAG.0c.0.13:
-..B16.20:                       # Preds ..B16.3
-..LN1571:
-        movq      -8(%rbp), %rax                                #1601.30
-        movq      8(%rax), %rax                                 #1601.30
-..LN1573:
-        movq      %rax, %rdi                                    #1601.13
-        call      NucStrstrWhack at PLT                            #1601.13
-                                # LOE
-..B16.21:                       # Preds ..B16.20 ..B16.18 ..B16.15 ..B16.2
-..LN1575:
-        movq      -8(%rbp), %rax                                #1604.16
-..LN1577:
-        movq      %rax, %rdi                                    #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE
-..B16.22:                       # Preds ..B16.21 ..B16.1
-..LN1579:
-        leave                                                   #1606.1
-..___tag_value_NucStrstrWhack.214:                              #
-        ret                                                     #1606.1
-        .align    2,0x90
-..___tag_value_NucStrstrWhack.215:                              #
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-.LNNucStrstrWhack:
-	.section .data1, "wa"
-	.align 32
-	.align 32
-..1..TPKT.18_0.0.13:
-	.quad	..1.18_0.TAG.00.0.13
-	.quad	..1.18_0.TAG.01.0.13
-	.quad	..1.18_0.TAG.02.0.13
-	.quad	..1.18_0.TAG.03.0.13
-	.quad	..1.18_0.TAG.04.0.13
-	.quad	..1.18_0.TAG.05.0.13
-	.quad	..1.18_0.TAG.06.0.13
-	.quad	..1.18_0.TAG.07.0.13
-	.quad	..1.18_0.TAG.08.0.13
-	.quad	..1.18_0.TAG.09.0.13
-	.quad	..1.18_0.TAG.0a.0.13
-	.quad	..1.18_0.TAG.0b.0.13
-	.quad	..1.18_0.TAG.0c.0.13
-	.data
-# -- End  NucStrstrWhack
-	.text
-# -- Begin  prime_buffer_2na
-# mark_begin;
-       .align    2,0x90
-prime_buffer_2na:
-# parameter 1(src): %rdi
-# parameter 2(ignore): %rsi
-..B17.1:                        # Preds ..B17.0
-..___tag_value_prime_buffer_2na.218:                            #
-..LN1581:
-        pushq     %rbp                                          #2129.1
-        movq      %rsp, %rbp                                    #2129.1
-..___tag_value_prime_buffer_2na.219:                            #
-        subq      $32, %rsp                                     #2129.1
-        movq      %rdi, -16(%rbp)                               #2129.1
-        movq      %rsi, -8(%rbp)                                #2129.1
-..LN1583:
-        movq      -16(%rbp), %rax                               #2132.23
-..LN1585:
-        testq     $15, %rax                                     #2132.29
-..LN1587:
-        jne       ..B17.3       # Prob 50%                      #2132.37
-                                # LOE
-..B17.2:                        # Preds ..B17.1
-..LN1589:
-        movq      -16(%rbp), %rax                               #2133.54
-        movdqa    (%rax), %xmm0                                 #2133.54
-..LN1591:
-        movdqa    %xmm0, -32(%rbp)                              #2133.9
-        jmp       ..B17.4       # Prob 100%                     #2133.9
-                                # LOE
-..B17.3:                        # Preds ..B17.1
-..LN1593:
-        movq      -16(%rbp), %rax                               #2135.55
-        movdqu    (%rax), %xmm0                                 #2135.55
-..LN1595:
-        movdqa    %xmm0, -32(%rbp)                              #2135.9
-                                # LOE
-..B17.4:                        # Preds ..B17.2 ..B17.3
-..LN1597:
-        movdqa    -32(%rbp), %xmm0                              #2136.12
-        leave                                                   #2136.12
-..___tag_value_prime_buffer_2na.223:                            #
-        ret                                                     #2136.12
-        .align    2,0x90
-..___tag_value_prime_buffer_2na.224:                            #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_2na, at function
-	.size	prime_buffer_2na,.-prime_buffer_2na
-.LNprime_buffer_2na:
-	.data
-# -- End  prime_buffer_2na
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    2,0x90
-eval_2na_8:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B18.1:                        # Preds ..B18.0
-..___tag_value_eval_2na_8.227:                                  #
-..LN1599:
-        pushq     %rbp                                          #2196.1
-        movq      %rsp, %rbp                                    #2196.1
-..___tag_value_eval_2na_8.228:                                  #
-        subq      $320, %rsp                                    #2196.1
-        movq      %rdi, -48(%rbp)                               #2196.1
-        movq      %rsi, -40(%rbp)                               #2196.1
-        movl      %edx, -24(%rbp)                               #2196.1
-        movl      %ecx, -16(%rbp)                               #2196.1
-..LN1601:
-        movq      -48(%rbp), %rax                               #2226.25
-        movl      4(%rax), %eax                                 #2226.25
-..LN1603:
-        movl      %eax, -32(%rbp)                               #2226.23
-..LN1605:
-        movl      -16(%rbp), %eax                               #2229.5
-        movl      -32(%rbp), %edx                               #2229.5
-        cmpl      %edx, %eax                                    #2229.5
-        jae       ..B18.3       # Prob 50%                      #2229.5
-                                # LOE
-..B18.2:                        # Preds ..B18.1
-        lea       _2__STRING.9.0(%rip), %rax                    #2229.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #2229.5
-        lea       __$U5.0(%rip), %rcx                           #2229.5
-        movq      %rax, %rdi                                    #2229.5
-        movq      %rdx, %rsi                                    #2229.5
-        movl      $2229, %edx                                   #2229.5
-        call      __assert_fail at PLT                             #2229.5
-                                # LOE
-..B18.3:                        # Preds ..B18.1
-..LN1607:
-        movl      -24(%rbp), %eax                               #2233.12
-..LN1609:
-        addl      -16(%rbp), %eax                               #2233.5
-        movl      %eax, -16(%rbp)                               #2233.5
-..LN1611:
-        movl      -24(%rbp), %eax                               #2236.42
-..LN1613:
-        shrl      $2, %eax                                      #2236.49
-..LN1615:
-        addq      -40(%rbp), %rax                               #2236.30
-..LN1617:
-        movq      %rax, -96(%rbp)                               #2236.5
-..LN1619:
-        movl      -32(%rbp), %eax                               #2239.18
-        negl      %eax                                          #2239.18
-        addl      -16(%rbp), %eax                               #2239.18
-..LN1621:
-        movl      %eax, -76(%rbp)                               #2239.5
-..LN1623:
-        movl      -16(%rbp), %eax                               #2242.44
-..LN1625:
-        addl      $3, %eax                                      #2242.50
-..LN1627:
-        shrl      $2, %eax                                      #2242.57
-..LN1629:
-        addq      -40(%rbp), %rax                               #2242.30
-..LN1631:
-        movq      %rax, -88(%rbp)                               #2242.5
-..LN1633:
-        movq      -96(%rbp), %rax                               #2245.33
-..LN1635:
-        movq      -88(%rbp), %rdx                               #2245.38
-..LN1637:
-        movq      %rax, %rdi                                    #2245.14
-        movq      %rdx, %rsi                                    #2245.14
-        call      prime_buffer_2na at PLT                          #2245.14
-                                # LOE xmm0
-..B18.43:                       # Preds ..B18.3
-        movdqa    %xmm0, -144(%rbp)                             #2245.14
-                                # LOE
-..B18.4:                        # Preds ..B18.43
-..LN1639:
-        movdqa    -144(%rbp), %xmm0                             #2245.5
-        movdqa    %xmm0, -288(%rbp)                             #2245.5
-..LN1641:
-        addq      $16, -96(%rbp)                                #2246.5
-..LN1643:
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    16(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -272(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    32(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -256(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    48(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -240(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    64(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -224(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    80(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -208(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    96(%rax), %xmm0                               #2256.5
-        movdqa    %xmm0, -192(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    112(%rax), %xmm0                              #2256.5
-        movdqa    %xmm0, -176(%rbp)                             #2256.5
-        movq      -48(%rbp), %rax                               #2256.5
-        movdqa    128(%rax), %xmm0                              #2256.5
-        movdqa    %xmm0, -160(%rbp)                             #2256.5
-..LN1645:
-        xorl      %eax, %eax                                    #2259.15
-        movl      %eax, -72(%rbp)                               #2259.15
-..LN1647:
-        movl      %eax, -68(%rbp)                               #2259.10
-..LN1649:
-        movl      %eax, -64(%rbp)                               #2259.5
-..LN1651:
-        movl      $1, -60(%rbp)                                 #2263.5
-..LN1653:
-        movl      -24(%rbp), %eax                               #2268.14
-..LN1655:
-        andl      $3, %eax                                      #2268.20
-        movl      %eax, -56(%rbp)                               #2268.20
-        je        ..B18.12      # Prob 50%                      #2268.20
-                                # LOE
-..B18.5:                        # Preds ..B18.4
-        movl      -56(%rbp), %eax                               #2268.20
-        cmpl      $1, %eax                                      #2268.20
-        je        ..B18.13      # Prob 50%                      #2268.20
-                                # LOE
-..B18.6:                        # Preds ..B18.5
-        movl      -56(%rbp), %eax                               #2268.20
-        cmpl      $2, %eax                                      #2268.20
-        je        ..B18.14      # Prob 50%                      #2268.20
-                                # LOE
-..B18.7:                        # Preds ..B18.6
-        movl      -56(%rbp), %eax                               #2268.20
-        cmpl      $3, %eax                                      #2268.20
-        je        ..B18.15      # Prob 50%                      #2268.20
-                                # LOE
-..B18.8:                        # Preds ..B18.39 ..B18.7
-..LN1657:
-        movl      $1, %eax                                      #2273.9
-        testl     %eax, %eax                                    #2273.9
-        je        ..B18.40      # Prob 100%                     #2273.9
-                                # LOE
-..B18.9:                        # Preds ..B18.8
-..LN1659:
-        movl      $1, -60(%rbp)                                 #2275.13
-                                # LOE
-..B18.10:                       # Preds ..B18.34 ..B18.9
-..LN1661:
-        movl      $1, %eax                                      #2278.13
-        testl     %eax, %eax                                    #2278.13
-        je        ..B18.36      # Prob 100%                     #2278.13
-                                # LOE
-..B18.12:                       # Preds ..B18.4 ..B18.10
-..LN1663:
-        movdqa    -288(%rbp), %xmm0                             #2285.38
-..LN1665:
-        movdqa    -256(%rbp), %xmm1                             #2285.46
-..LN1667:
-        pand      %xmm1, %xmm0                                  #2285.22
-..LN1669:
-        movdqa    %xmm0, -304(%rbp)                             #2285.17
-..LN1671:
-        movdqa    -304(%rbp), %xmm0                             #2286.22
-        movdqa    -272(%rbp), %xmm1                             #2286.22
-        pcmpeqb   %xmm1, %xmm0                                  #2286.22
-..LN1673:
-        movdqa    %xmm0, -304(%rbp)                             #2286.17
-..LN1675:
-        movdqa    -304(%rbp), %xmm0                             #2287.42
-..LN1677:
-        pmovmskb  %xmm0, %eax                                   #2287.22
-..LN1679:
-        movl      %eax, -64(%rbp)                               #2287.17
-                                # LOE
-..B18.13:                       # Preds ..B18.5 ..B18.12
-..LN1681:
-        movdqa    -288(%rbp), %xmm0                             #2291.38
-..LN1683:
-        movdqa    -224(%rbp), %xmm1                             #2291.46
-..LN1685:
-        pand      %xmm1, %xmm0                                  #2291.22
-..LN1687:
-        movdqa    %xmm0, -304(%rbp)                             #2291.17
-..LN1689:
-        movdqa    -304(%rbp), %xmm0                             #2292.22
-        movdqa    -240(%rbp), %xmm1                             #2292.22
-        pcmpeqb   %xmm1, %xmm0                                  #2292.22
-..LN1691:
-        movdqa    %xmm0, -304(%rbp)                             #2292.17
-..LN1693:
-        movdqa    -304(%rbp), %xmm0                             #2293.42
-..LN1695:
-        pmovmskb  %xmm0, %eax                                   #2293.22
-..LN1697:
-        movl      %eax, -68(%rbp)                               #2293.17
-                                # LOE
-..B18.14:                       # Preds ..B18.6 ..B18.13
-..LN1699:
-        movdqa    -288(%rbp), %xmm0                             #2297.38
-..LN1701:
-        movdqa    -192(%rbp), %xmm1                             #2297.46
-..LN1703:
-        pand      %xmm1, %xmm0                                  #2297.22
-..LN1705:
-        movdqa    %xmm0, -304(%rbp)                             #2297.17
-..LN1707:
-        movdqa    -304(%rbp), %xmm0                             #2298.22
-        movdqa    -208(%rbp), %xmm1                             #2298.22
-        pcmpeqb   %xmm1, %xmm0                                  #2298.22
-..LN1709:
-        movdqa    %xmm0, -304(%rbp)                             #2298.17
-..LN1711:
-        movdqa    -304(%rbp), %xmm0                             #2299.42
-..LN1713:
-        pmovmskb  %xmm0, %eax                                   #2299.22
-..LN1715:
-        movl      %eax, -72(%rbp)                               #2299.17
-                                # LOE
-..B18.15:                       # Preds ..B18.7 ..B18.14
-..LN1717:
-        movdqa    -288(%rbp), %xmm0                             #2303.38
-..LN1719:
-        movdqa    -160(%rbp), %xmm1                             #2303.46
-..LN1721:
-        pand      %xmm1, %xmm0                                  #2303.22
-..LN1723:
-        movdqa    %xmm0, -304(%rbp)                             #2303.17
-..LN1725:
-        movdqa    -304(%rbp), %xmm0                             #2304.22
-        movdqa    -176(%rbp), %xmm1                             #2304.22
-        pcmpeqb   %xmm1, %xmm0                                  #2304.22
-..LN1727:
-        movdqa    %xmm0, -304(%rbp)                             #2304.17
-..LN1729:
-        movdqa    -304(%rbp), %xmm0                             #2305.42
-..LN1731:
-        pmovmskb  %xmm0, %eax                                   #2305.22
-..LN1733:
-        movl      %eax, -80(%rbp)                               #2305.17
-..LN1735:
-        andl      $-4, -24(%rbp)                                #2310.17
-..LN1737:
-        movl      -68(%rbp), %eax                               #2313.29
-        orl       -64(%rbp), %eax                               #2313.29
-..LN1739:
-        orl       -72(%rbp), %eax                               #2313.34
-..LN1741:
-        orl       -80(%rbp), %eax                               #2313.39
-..LN1743:
-        je        ..B18.32      # Prob 50%                      #2313.47
-                                # LOE
-..B18.16:                       # Preds ..B18.15
-..LN1745:
-        movl      -64(%rbp), %eax                               #2331.58
-..LN1747:
-        movl      %eax, %edi                                    #2331.30
-        call      uint16_lsbit at PLT                              #2331.30
-                                # LOE eax
-..B18.44:                       # Preds ..B18.16
-        movl      %eax, -112(%rbp)                              #2331.30
-                                # LOE
-..B18.17:                       # Preds ..B18.44
-        movl      -112(%rbp), %eax                              #2331.30
-        movswq    %ax, %rax                                     #2331.30
-..LN1749:
-        movl      %eax, -128(%rbp)                              #2331.28
-..LN1751:
-        movl      -68(%rbp), %eax                               #2332.58
-..LN1753:
-        movl      %eax, %edi                                    #2332.30
-        call      uint16_lsbit at PLT                              #2332.30
-                                # LOE eax
-..B18.45:                       # Preds ..B18.17
-        movl      %eax, -108(%rbp)                              #2332.30
-                                # LOE
-..B18.18:                       # Preds ..B18.45
-        movl      -108(%rbp), %eax                              #2332.30
-        movswq    %ax, %rax                                     #2332.30
-..LN1755:
-        movl      %eax, -124(%rbp)                              #2332.28
-..LN1757:
-        movl      -72(%rbp), %eax                               #2333.58
-..LN1759:
-        movl      %eax, %edi                                    #2333.30
-        call      uint16_lsbit at PLT                              #2333.30
-                                # LOE eax
-..B18.46:                       # Preds ..B18.18
-        movl      %eax, -104(%rbp)                              #2333.30
-                                # LOE
-..B18.19:                       # Preds ..B18.46
-        movl      -104(%rbp), %eax                              #2333.30
-        movswq    %ax, %rax                                     #2333.30
-..LN1761:
-        movl      %eax, -120(%rbp)                              #2333.28
-..LN1763:
-        movl      -80(%rbp), %eax                               #2334.58
-..LN1765:
-        movl      %eax, %edi                                    #2334.30
-        call      uint16_lsbit at PLT                              #2334.30
-                                # LOE eax
-..B18.47:                       # Preds ..B18.19
-        movl      %eax, -100(%rbp)                              #2334.30
-                                # LOE
-..B18.20:                       # Preds ..B18.47
-        movl      -100(%rbp), %eax                              #2334.30
-        movswq    %ax, %rax                                     #2334.30
-..LN1767:
-        movl      %eax, -116(%rbp)                              #2334.28
-..LN1769:
-        shll      $2, -128(%rbp)                                #2339.34
-..LN1771:
-        movl      -124(%rbp), %eax                              #2340.28
-..LN1773:
-        shll      $2, %eax                                      #2340.34
-..LN1775:
-        incl      %eax                                          #2340.40
-..LN1777:
-        movl      %eax, -124(%rbp)                              #2340.21
-..LN1779:
-        movl      -120(%rbp), %eax                              #2341.28
-..LN1781:
-        shll      $2, %eax                                      #2341.34
-..LN1783:
-        addl      $2, %eax                                      #2341.40
-..LN1785:
-        movl      %eax, -120(%rbp)                              #2341.21
-..LN1787:
-        movl      -116(%rbp), %eax                              #2342.28
-..LN1789:
-        shll      $2, %eax                                      #2342.34
-..LN1791:
-        addl      $3, %eax                                      #2342.40
-..LN1793:
-        movl      %eax, -116(%rbp)                              #2342.21
-..LN1795:
-        movl      -64(%rbp), %eax                               #2346.26
-..LN1797:
-        testl     %eax, %eax                                    #2346.32
-        je        ..B18.23      # Prob 50%                      #2346.32
-                                # LOE
-..B18.21:                       # Preds ..B18.20
-..LN1799:
-        movl      -128(%rbp), %eax                              #2346.43
-        addl      -24(%rbp), %eax                               #2346.43
-..LN1801:
-        movl      -76(%rbp), %edx                               #2346.49
-        cmpl      %edx, %eax                                    #2346.49
-        ja        ..B18.23      # Prob 50%                      #2346.49
-                                # LOE
-..B18.22:                       # Preds ..B18.21
-..LN1803:
-        movl      $1, %eax                                      #2346.63
-        leave                                                   #2346.63
-..___tag_value_eval_2na_8.232:                                  #
-        ret                                                     #2346.63
-..___tag_value_eval_2na_8.233:                                  #
-                                # LOE
-..B18.23:                       # Preds ..B18.21 ..B18.20
-..LN1805:
-        movl      -68(%rbp), %eax                               #2347.26
-..LN1807:
-        testl     %eax, %eax                                    #2347.32
-        je        ..B18.26      # Prob 50%                      #2347.32
-                                # LOE
-..B18.24:                       # Preds ..B18.23
-..LN1809:
-        movl      -124(%rbp), %eax                              #2347.43
-        addl      -24(%rbp), %eax                               #2347.43
-..LN1811:
-        movl      -76(%rbp), %edx                               #2347.49
-        cmpl      %edx, %eax                                    #2347.49
-        ja        ..B18.26      # Prob 50%                      #2347.49
-                                # LOE
-..B18.25:                       # Preds ..B18.24
-..LN1813:
-        movl      $1, %eax                                      #2347.63
-        leave                                                   #2347.63
-..___tag_value_eval_2na_8.235:                                  #
-        ret                                                     #2347.63
-..___tag_value_eval_2na_8.236:                                  #
-                                # LOE
-..B18.26:                       # Preds ..B18.24 ..B18.23
-..LN1815:
-        movl      -72(%rbp), %eax                               #2348.26
-..LN1817:
-        testl     %eax, %eax                                    #2348.32
-        je        ..B18.29      # Prob 50%                      #2348.32
-                                # LOE
-..B18.27:                       # Preds ..B18.26
-..LN1819:
-        movl      -120(%rbp), %eax                              #2348.43
-        addl      -24(%rbp), %eax                               #2348.43
-..LN1821:
-        movl      -76(%rbp), %edx                               #2348.49
-        cmpl      %edx, %eax                                    #2348.49
-        ja        ..B18.29      # Prob 50%                      #2348.49
-                                # LOE
-..B18.28:                       # Preds ..B18.27
-..LN1823:
-        movl      $1, %eax                                      #2348.63
-        leave                                                   #2348.63
-..___tag_value_eval_2na_8.238:                                  #
-        ret                                                     #2348.63
-..___tag_value_eval_2na_8.239:                                  #
-                                # LOE
-..B18.29:                       # Preds ..B18.27 ..B18.26
-..LN1825:
-        movl      -80(%rbp), %eax                               #2349.26
-..LN1827:
-        testl     %eax, %eax                                    #2349.32
-        je        ..B18.32      # Prob 50%                      #2349.32
-                                # LOE
-..B18.30:                       # Preds ..B18.29
-..LN1829:
-        movl      -116(%rbp), %eax                              #2349.43
-        addl      -24(%rbp), %eax                               #2349.43
-..LN1831:
-        movl      -76(%rbp), %edx                               #2349.49
-        cmpl      %edx, %eax                                    #2349.49
-        ja        ..B18.32      # Prob 50%                      #2349.49
-                                # LOE
-..B18.31:                       # Preds ..B18.30
-..LN1833:
-        movl      $1, %eax                                      #2349.63
-        leave                                                   #2349.63
-..___tag_value_eval_2na_8.241:                                  #
-        ret                                                     #2349.63
-..___tag_value_eval_2na_8.242:                                  #
-                                # LOE
-..B18.32:                       # Preds ..B18.30 ..B18.29 ..B18.15
-..LN1835:
-        addl      $4, -24(%rbp)                                 #2354.17
-..LN1837:
-        movl      -24(%rbp), %eax                               #2357.22
-..LN1839:
-        movl      -76(%rbp), %edx                               #2357.28
-        cmpl      %edx, %eax                                    #2357.28
-        jbe       ..B18.34      # Prob 50%                      #2357.28
-                                # LOE
-..B18.33:                       # Preds ..B18.32
-..LN1841:
-        xorl      %eax, %eax                                    #2358.28
-        leave                                                   #2358.28
-..___tag_value_eval_2na_8.244:                                  #
-        ret                                                     #2358.28
-..___tag_value_eval_2na_8.245:                                  #
-                                # LOE
-..B18.34:                       # Preds ..B18.32
-..LN1843:
-        movl      -60(%rbp), %eax                               #2361.25
-        decl      %eax                                          #2361.25
-        movl      %eax, -60(%rbp)                               #2361.25
-..LN1845:
-        jne       ..B18.10      # Prob 50%                      #2361.39
-                                # LOE
-..B18.36:                       # Preds ..B18.34 ..B18.10
-..LN1847:
-        movq      -96(%rbp), %rax                               #2382.18
-..LN1849:
-        movq      -88(%rbp), %rdx                               #2382.25
-        cmpq      %rdx, %rax                                    #2382.25
-        jae       ..B18.40      # Prob 50%                      #2382.25
-                                # LOE
-..B18.37:                       # Preds ..B18.36
-..LN1851:
-        addl      $60, -24(%rbp)                                #2386.13
-..LN1853:
-        movl      -24(%rbp), %eax                               #2387.18
-..LN1855:
-        movl      -76(%rbp), %edx                               #2387.24
-        cmpl      %edx, %eax                                    #2387.24
-        ja        ..B18.40      # Prob 50%                      #2387.24
-                                # LOE
-..B18.38:                       # Preds ..B18.37
-..LN1857:
-        movq      -96(%rbp), %rax                               #2392.41
-..LN1859:
-        movq      -88(%rbp), %rdx                               #2392.46
-..LN1861:
-        movq      %rax, %rdi                                    #2392.22
-        movq      %rdx, %rsi                                    #2392.22
-        call      prime_buffer_2na at PLT                          #2392.22
-                                # LOE xmm0
-..B18.48:                       # Preds ..B18.38
-        movdqa    %xmm0, -320(%rbp)                             #2392.22
-                                # LOE
-..B18.39:                       # Preds ..B18.48
-..LN1863:
-        movdqa    -320(%rbp), %xmm0                             #2392.13
-        movdqa    %xmm0, -288(%rbp)                             #2392.13
-..LN1865:
-        addq      $16, -96(%rbp)                                #2470.13
-        jmp       ..B18.8       # Prob 100%                     #2470.13
-                                # LOE
-..B18.40:                       # Preds ..B18.37 ..B18.36 ..B18.8
-..LN1867:
-        xorl      %eax, %eax                                    #2483.12
-        leave                                                   #2483.12
-..___tag_value_eval_2na_8.247:                                  #
-        ret                                                     #2483.12
-        .align    2,0x90
-..___tag_value_eval_2na_8.248:                                  #
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-.LNeval_2na_8:
-	.data
-# -- End  eval_2na_8
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    2,0x90
-eval_2na_16:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B19.1:                        # Preds ..B19.0
-..___tag_value_eval_2na_16.251:                                 #
-..LN1869:
-        pushq     %rbp                                          #2489.1
-        movq      %rsp, %rbp                                    #2489.1
-..___tag_value_eval_2na_16.252:                                 #
-        subq      $336, %rsp                                    #2489.1
-        movq      %rdi, -48(%rbp)                               #2489.1
-        movq      %rsi, -40(%rbp)                               #2489.1
-        movl      %edx, -24(%rbp)                               #2489.1
-        movl      %ecx, -16(%rbp)                               #2489.1
-..LN1871:
-        movq      -48(%rbp), %rax                               #2519.25
-        movl      4(%rax), %eax                                 #2519.25
-..LN1873:
-        movl      %eax, -32(%rbp)                               #2519.23
-..LN1875:
-        movl      -16(%rbp), %eax                               #2522.5
-        movl      -32(%rbp), %edx                               #2522.5
-        cmpl      %edx, %eax                                    #2522.5
-        jae       ..B19.3       # Prob 50%                      #2522.5
-                                # LOE
-..B19.2:                        # Preds ..B19.1
-        lea       _2__STRING.9.0(%rip), %rax                    #2522.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #2522.5
-        lea       __$U6.0(%rip), %rcx                           #2522.5
-        movq      %rax, %rdi                                    #2522.5
-        movq      %rdx, %rsi                                    #2522.5
-        movl      $2522, %edx                                   #2522.5
-        call      __assert_fail at PLT                             #2522.5
-                                # LOE
-..B19.3:                        # Preds ..B19.1
-..LN1877:
-        movl      -24(%rbp), %eax                               #2526.12
-..LN1879:
-        addl      -16(%rbp), %eax                               #2526.5
-        movl      %eax, -16(%rbp)                               #2526.5
-..LN1881:
-        movl      -24(%rbp), %eax                               #2529.42
-..LN1883:
-        shrl      $2, %eax                                      #2529.49
-..LN1885:
-        addq      -40(%rbp), %rax                               #2529.30
-..LN1887:
-        movq      %rax, -104(%rbp)                              #2529.5
-..LN1889:
-        movl      -32(%rbp), %eax                               #2532.18
-        negl      %eax                                          #2532.18
-        addl      -16(%rbp), %eax                               #2532.18
-..LN1891:
-        movl      %eax, -76(%rbp)                               #2532.5
-..LN1893:
-        movl      -16(%rbp), %eax                               #2535.44
-..LN1895:
-        addl      $3, %eax                                      #2535.50
-..LN1897:
-        shrl      $2, %eax                                      #2535.57
-..LN1899:
-        addq      -40(%rbp), %rax                               #2535.30
-..LN1901:
-        movq      %rax, -96(%rbp)                               #2535.5
-..LN1903:
-        movq      -104(%rbp), %rax                              #2538.33
-..LN1905:
-        movq      -96(%rbp), %rdx                               #2538.38
-..LN1907:
-        movq      %rax, %rdi                                    #2538.14
-        movq      %rdx, %rsi                                    #2538.14
-        call      prime_buffer_2na at PLT                          #2538.14
-                                # LOE xmm0
-..B19.49:                       # Preds ..B19.3
-        movdqa    %xmm0, -160(%rbp)                             #2538.14
-                                # LOE
-..B19.4:                        # Preds ..B19.49
-..LN1909:
-        movdqa    -160(%rbp), %xmm0                             #2538.5
-        movdqa    %xmm0, -304(%rbp)                             #2538.5
-..LN1911:
-        addq      $16, -104(%rbp)                               #2539.5
-..LN1913:
-        movq      -104(%rbp), %rax                              #2541.9
-..LN1915:
-        movq      %rax, -88(%rbp)                               #2541.5
-..LN1917:
-        movq      -104(%rbp), %rax                              #2544.10
-..LN1919:
-        movq      -96(%rbp), %rdx                               #2544.16
-        cmpq      %rdx, %rax                                    #2544.16
-        jae       ..B19.6       # Prob 50%                      #2544.16
-                                # LOE
-..B19.5:                        # Preds ..B19.4
-..LN1921:
-        movq      -104(%rbp), %rax                              #2545.24
-        movzbl    -1(%rax), %eax                                #2545.24
-        movzbl    %al, %eax                                     #2545.24
-..LN1923:
-        shll      $8, %eax                                      #2545.38
-..LN1925:
-        movl      %eax, -112(%rbp)                              #2545.9
-                                # LOE
-..B19.6:                        # Preds ..B19.5 ..B19.4
-..LN1927:
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    16(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -288(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    32(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -272(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    48(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -256(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    64(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -240(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    80(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -224(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    96(%rax), %xmm0                               #2549.5
-        movdqa    %xmm0, -208(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    112(%rax), %xmm0                              #2549.5
-        movdqa    %xmm0, -192(%rbp)                             #2549.5
-        movq      -48(%rbp), %rax                               #2549.5
-        movdqa    128(%rax), %xmm0                              #2549.5
-        movdqa    %xmm0, -176(%rbp)                             #2549.5
-..LN1929:
-        xorl      %eax, %eax                                    #2552.15
-        movl      %eax, -72(%rbp)                               #2552.15
-..LN1931:
-        movl      %eax, -68(%rbp)                               #2552.10
-..LN1933:
-        movl      %eax, -64(%rbp)                               #2552.5
-..LN1935:
-        movl      $2, -60(%rbp)                                 #2556.5
-..LN1937:
-        movl      -24(%rbp), %eax                               #2561.14
-..LN1939:
-        andl      $3, %eax                                      #2561.20
-        movl      %eax, -56(%rbp)                               #2561.20
-        je        ..B19.14      # Prob 50%                      #2561.20
-                                # LOE
-..B19.7:                        # Preds ..B19.6
-        movl      -56(%rbp), %eax                               #2561.20
-        cmpl      $1, %eax                                      #2561.20
-        je        ..B19.15      # Prob 50%                      #2561.20
-                                # LOE
-..B19.8:                        # Preds ..B19.7
-        movl      -56(%rbp), %eax                               #2561.20
-        cmpl      $2, %eax                                      #2561.20
-        je        ..B19.16      # Prob 50%                      #2561.20
-                                # LOE
-..B19.9:                        # Preds ..B19.8
-        movl      -56(%rbp), %eax                               #2561.20
-        cmpl      $3, %eax                                      #2561.20
-        je        ..B19.17      # Prob 50%                      #2561.20
-                                # LOE
-..B19.10:                       # Preds ..B19.45 ..B19.44 ..B19.9
-..LN1941:
-        movl      $1, %eax                                      #2566.9
-        testl     %eax, %eax                                    #2566.9
-        je        ..B19.46      # Prob 100%                     #2566.9
-                                # LOE
-..B19.11:                       # Preds ..B19.10
-..LN1943:
-        movl      $2, -60(%rbp)                                 #2568.13
-                                # LOE
-..B19.12:                       # Preds ..B19.39 ..B19.11
-..LN1945:
-        movl      $1, %eax                                      #2571.13
-        testl     %eax, %eax                                    #2571.13
-        je        ..B19.41      # Prob 100%                     #2571.13
-                                # LOE
-..B19.14:                       # Preds ..B19.6 ..B19.12
-..LN1947:
-        movdqa    -304(%rbp), %xmm0                             #2578.38
-..LN1949:
-        movdqa    -272(%rbp), %xmm1                             #2578.46
-..LN1951:
-        pand      %xmm1, %xmm0                                  #2578.22
-..LN1953:
-        movdqa    %xmm0, -320(%rbp)                             #2578.17
-..LN1955:
-        movdqa    -320(%rbp), %xmm0                             #2579.22
-        movdqa    -288(%rbp), %xmm1                             #2579.22
-        pcmpeqw   %xmm1, %xmm0                                  #2579.22
-..LN1957:
-        movdqa    %xmm0, -320(%rbp)                             #2579.17
-..LN1959:
-        movdqa    -320(%rbp), %xmm0                             #2580.42
-..LN1961:
-        pmovmskb  %xmm0, %eax                                   #2580.22
-..LN1963:
-        movl      %eax, -64(%rbp)                               #2580.17
-                                # LOE
-..B19.15:                       # Preds ..B19.7 ..B19.14
-..LN1965:
-        movdqa    -304(%rbp), %xmm0                             #2584.38
-..LN1967:
-        movdqa    -240(%rbp), %xmm1                             #2584.46
-..LN1969:
-        pand      %xmm1, %xmm0                                  #2584.22
-..LN1971:
-        movdqa    %xmm0, -320(%rbp)                             #2584.17
-..LN1973:
-        movdqa    -320(%rbp), %xmm0                             #2585.22
-        movdqa    -256(%rbp), %xmm1                             #2585.22
-        pcmpeqw   %xmm1, %xmm0                                  #2585.22
-..LN1975:
-        movdqa    %xmm0, -320(%rbp)                             #2585.17
-..LN1977:
-        movdqa    -320(%rbp), %xmm0                             #2586.42
-..LN1979:
-        pmovmskb  %xmm0, %eax                                   #2586.22
-..LN1981:
-        movl      %eax, -68(%rbp)                               #2586.17
-                                # LOE
-..B19.16:                       # Preds ..B19.8 ..B19.15
-..LN1983:
-        movdqa    -304(%rbp), %xmm0                             #2590.38
-..LN1985:
-        movdqa    -208(%rbp), %xmm1                             #2590.46
-..LN1987:
-        pand      %xmm1, %xmm0                                  #2590.22
-..LN1989:
-        movdqa    %xmm0, -320(%rbp)                             #2590.17
-..LN1991:
-        movdqa    -320(%rbp), %xmm0                             #2591.22
-        movdqa    -224(%rbp), %xmm1                             #2591.22
-        pcmpeqw   %xmm1, %xmm0                                  #2591.22
-..LN1993:
-        movdqa    %xmm0, -320(%rbp)                             #2591.17
-..LN1995:
-        movdqa    -320(%rbp), %xmm0                             #2592.42
-..LN1997:
-        pmovmskb  %xmm0, %eax                                   #2592.22
-..LN1999:
-        movl      %eax, -72(%rbp)                               #2592.17
-                                # LOE
-..B19.17:                       # Preds ..B19.9 ..B19.16
-..LN2001:
-        movdqa    -304(%rbp), %xmm0                             #2596.38
-..LN2003:
-        movdqa    -176(%rbp), %xmm1                             #2596.46
-..LN2005:
-        pand      %xmm1, %xmm0                                  #2596.22
-..LN2007:
-        movdqa    %xmm0, -320(%rbp)                             #2596.17
-..LN2009:
-        movdqa    -320(%rbp), %xmm0                             #2597.22
-        movdqa    -192(%rbp), %xmm1                             #2597.22
-        pcmpeqw   %xmm1, %xmm0                                  #2597.22
-..LN2011:
-        movdqa    %xmm0, -320(%rbp)                             #2597.17
-..LN2013:
-        movdqa    -320(%rbp), %xmm0                             #2598.42
-..LN2015:
-        pmovmskb  %xmm0, %eax                                   #2598.22
-..LN2017:
-        movl      %eax, -80(%rbp)                               #2598.17
-..LN2019:
-        andl      $-4, -24(%rbp)                                #2603.17
-..LN2021:
-        movl      -68(%rbp), %eax                               #2606.29
-        orl       -64(%rbp), %eax                               #2606.29
-..LN2023:
-        orl       -72(%rbp), %eax                               #2606.34
-..LN2025:
-        orl       -80(%rbp), %eax                               #2606.39
-..LN2027:
-        je        ..B19.34      # Prob 50%                      #2606.47
-                                # LOE
-..B19.18:                       # Preds ..B19.17
-..LN2029:
-        movl      -64(%rbp), %eax                               #2624.58
-..LN2031:
-        movl      %eax, %edi                                    #2624.30
-        call      uint16_lsbit at PLT                              #2624.30
-                                # LOE eax
-..B19.50:                       # Preds ..B19.18
-        movl      %eax, -128(%rbp)                              #2624.30
-                                # LOE
-..B19.19:                       # Preds ..B19.50
-        movl      -128(%rbp), %eax                              #2624.30
-        movswq    %ax, %rax                                     #2624.30
-..LN2033:
-        movl      %eax, -144(%rbp)                              #2624.28
-..LN2035:
-        movl      -68(%rbp), %eax                               #2625.58
-..LN2037:
-        movl      %eax, %edi                                    #2625.30
-        call      uint16_lsbit at PLT                              #2625.30
-                                # LOE eax
-..B19.51:                       # Preds ..B19.19
-        movl      %eax, -124(%rbp)                              #2625.30
-                                # LOE
-..B19.20:                       # Preds ..B19.51
-        movl      -124(%rbp), %eax                              #2625.30
-        movswq    %ax, %rax                                     #2625.30
-..LN2039:
-        movl      %eax, -140(%rbp)                              #2625.28
-..LN2041:
-        movl      -72(%rbp), %eax                               #2626.58
-..LN2043:
-        movl      %eax, %edi                                    #2626.30
-        call      uint16_lsbit at PLT                              #2626.30
-                                # LOE eax
-..B19.52:                       # Preds ..B19.20
-        movl      %eax, -120(%rbp)                              #2626.30
-                                # LOE
-..B19.21:                       # Preds ..B19.52
-        movl      -120(%rbp), %eax                              #2626.30
-        movswq    %ax, %rax                                     #2626.30
-..LN2045:
-        movl      %eax, -136(%rbp)                              #2626.28
-..LN2047:
-        movl      -80(%rbp), %eax                               #2627.58
-..LN2049:
-        movl      %eax, %edi                                    #2627.30
-        call      uint16_lsbit at PLT                              #2627.30
-                                # LOE eax
-..B19.53:                       # Preds ..B19.21
-        movl      %eax, -116(%rbp)                              #2627.30
-                                # LOE
-..B19.22:                       # Preds ..B19.53
-        movl      -116(%rbp), %eax                              #2627.30
-        movswq    %ax, %rax                                     #2627.30
-..LN2051:
-        movl      %eax, -132(%rbp)                              #2627.28
-..LN2053:
-        shll      $2, -144(%rbp)                                #2632.34
-..LN2055:
-        movl      -140(%rbp), %eax                              #2633.28
-..LN2057:
-        shll      $2, %eax                                      #2633.34
-..LN2059:
-        incl      %eax                                          #2633.40
-..LN2061:
-        movl      %eax, -140(%rbp)                              #2633.21
-..LN2063:
-        movl      -136(%rbp), %eax                              #2634.28
-..LN2065:
-        shll      $2, %eax                                      #2634.34
-..LN2067:
-        addl      $2, %eax                                      #2634.40
-..LN2069:
-        movl      %eax, -136(%rbp)                              #2634.21
-..LN2071:
-        movl      -132(%rbp), %eax                              #2635.28
-..LN2073:
-        shll      $2, %eax                                      #2635.34
-..LN2075:
-        addl      $3, %eax                                      #2635.40
-..LN2077:
-        movl      %eax, -132(%rbp)                              #2635.21
-..LN2079:
-        movl      -64(%rbp), %eax                               #2639.26
-..LN2081:
-        testl     %eax, %eax                                    #2639.32
-        je        ..B19.25      # Prob 50%                      #2639.32
-                                # LOE
-..B19.23:                       # Preds ..B19.22
-..LN2083:
-        movl      -144(%rbp), %eax                              #2639.43
-        addl      -24(%rbp), %eax                               #2639.43
-..LN2085:
-        movl      -76(%rbp), %edx                               #2639.49
-        cmpl      %edx, %eax                                    #2639.49
-        ja        ..B19.25      # Prob 50%                      #2639.49
-                                # LOE
-..B19.24:                       # Preds ..B19.23
-..LN2087:
-        movl      $1, %eax                                      #2639.63
-        leave                                                   #2639.63
-..___tag_value_eval_2na_16.256:                                 #
-        ret                                                     #2639.63
-..___tag_value_eval_2na_16.257:                                 #
-                                # LOE
-..B19.25:                       # Preds ..B19.23 ..B19.22
-..LN2089:
-        movl      -68(%rbp), %eax                               #2640.26
-..LN2091:
-        testl     %eax, %eax                                    #2640.32
-        je        ..B19.28      # Prob 50%                      #2640.32
-                                # LOE
-..B19.26:                       # Preds ..B19.25
-..LN2093:
-        movl      -140(%rbp), %eax                              #2640.43
-        addl      -24(%rbp), %eax                               #2640.43
-..LN2095:
-        movl      -76(%rbp), %edx                               #2640.49
-        cmpl      %edx, %eax                                    #2640.49
-        ja        ..B19.28      # Prob 50%                      #2640.49
-                                # LOE
-..B19.27:                       # Preds ..B19.26
-..LN2097:
-        movl      $1, %eax                                      #2640.63
-        leave                                                   #2640.63
-..___tag_value_eval_2na_16.259:                                 #
-        ret                                                     #2640.63
-..___tag_value_eval_2na_16.260:                                 #
-                                # LOE
-..B19.28:                       # Preds ..B19.26 ..B19.25
-..LN2099:
-        movl      -72(%rbp), %eax                               #2641.26
-..LN2101:
-        testl     %eax, %eax                                    #2641.32
-        je        ..B19.31      # Prob 50%                      #2641.32
-                                # LOE
-..B19.29:                       # Preds ..B19.28
-..LN2103:
-        movl      -136(%rbp), %eax                              #2641.43
-        addl      -24(%rbp), %eax                               #2641.43
-..LN2105:
-        movl      -76(%rbp), %edx                               #2641.49
-        cmpl      %edx, %eax                                    #2641.49
-        ja        ..B19.31      # Prob 50%                      #2641.49
-                                # LOE
-..B19.30:                       # Preds ..B19.29
-..LN2107:
-        movl      $1, %eax                                      #2641.63
-        leave                                                   #2641.63
-..___tag_value_eval_2na_16.262:                                 #
-        ret                                                     #2641.63
-..___tag_value_eval_2na_16.263:                                 #
-                                # LOE
-..B19.31:                       # Preds ..B19.29 ..B19.28
-..LN2109:
-        movl      -80(%rbp), %eax                               #2642.26
-..LN2111:
-        testl     %eax, %eax                                    #2642.32
-        je        ..B19.34      # Prob 50%                      #2642.32
-                                # LOE
-..B19.32:                       # Preds ..B19.31
-..LN2113:
-        movl      -132(%rbp), %eax                              #2642.43
-        addl      -24(%rbp), %eax                               #2642.43
-..LN2115:
-        movl      -76(%rbp), %edx                               #2642.49
-        cmpl      %edx, %eax                                    #2642.49
-        ja        ..B19.34      # Prob 50%                      #2642.49
-                                # LOE
-..B19.33:                       # Preds ..B19.32
-..LN2117:
-        movl      $1, %eax                                      #2642.63
-        leave                                                   #2642.63
-..___tag_value_eval_2na_16.265:                                 #
-        ret                                                     #2642.63
-..___tag_value_eval_2na_16.266:                                 #
-                                # LOE
-..B19.34:                       # Preds ..B19.32 ..B19.31 ..B19.17
-..LN2119:
-        addl      $4, -24(%rbp)                                 #2647.17
-..LN2121:
-        movl      -24(%rbp), %eax                               #2650.22
-..LN2123:
-        movl      -76(%rbp), %edx                               #2650.28
-        cmpl      %edx, %eax                                    #2650.28
-        jbe       ..B19.36      # Prob 50%                      #2650.28
-                                # LOE
-..B19.35:                       # Preds ..B19.34
-..LN2125:
-        xorl      %eax, %eax                                    #2651.28
-        leave                                                   #2651.28
-..___tag_value_eval_2na_16.268:                                 #
-        ret                                                     #2651.28
-..___tag_value_eval_2na_16.269:                                 #
-                                # LOE
-..B19.36:                       # Preds ..B19.34
-..LN2127:
-        movl      -60(%rbp), %eax                               #2654.25
-        decl      %eax                                          #2654.25
-        movl      %eax, -60(%rbp)                               #2654.25
-..LN2129:
-        je        ..B19.41      # Prob 50%                      #2654.39
-                                # LOE
-..B19.37:                       # Preds ..B19.36
-..LN2131:
-        movdqa    -304(%rbp), %xmm0                             #2659.43
-..LN2133:
-        psrldq    $1, %xmm0                                     #2659.26
-..LN2135:
-        movdqa    %xmm0, -304(%rbp)                             #2659.17
-..LN2137:
-        movq      -88(%rbp), %rax                               #2662.22
-..LN2139:
-        movq      -96(%rbp), %rdx                               #2662.26
-        cmpq      %rdx, %rax                                    #2662.26
-        jae       ..B19.39      # Prob 50%                      #2662.26
-                                # LOE
-..B19.38:                       # Preds ..B19.37
-..LN2141:
-        sarl      $8, -112(%rbp)                                #2664.21
-..LN2143:
-        movq      -88(%rbp), %rax                               #2665.37
-        movzbl    (%rax), %eax                                  #2665.37
-        movzbl    %al, %eax                                     #2665.37
-..LN2145:
-        shll      $8, %eax                                      #2665.48
-..LN2147:
-        orl       -112(%rbp), %eax                              #2665.21
-        movl      %eax, -112(%rbp)                              #2665.21
-..LN2149:
-        movdqa    -304(%rbp), %xmm0                             #2666.49
-..LN2151:
-        movl      -112(%rbp), %eax                              #2666.57
-..LN2153:
-        pinsrw    $7, %eax, %xmm0                               #2666.30
-..LN2155:
-        movdqa    %xmm0, -304(%rbp)                             #2666.21
-                                # LOE
-..B19.39:                       # Preds ..B19.38 ..B19.37
-..LN2157:
-        incq      -88(%rbp)                                     #2670.20
-        jmp       ..B19.12      # Prob 100%                     #2670.20
-                                # LOE
-..B19.41:                       # Preds ..B19.36 ..B19.12
-..LN2159:
-        movq      -104(%rbp), %rax                              #2675.18
-..LN2161:
-        movq      -96(%rbp), %rdx                               #2675.25
-        cmpq      %rdx, %rax                                    #2675.25
-        jae       ..B19.46      # Prob 50%                      #2675.25
-                                # LOE
-..B19.42:                       # Preds ..B19.41
-..LN2163:
-        addl      $56, -24(%rbp)                                #2679.13
-..LN2165:
-        movl      -24(%rbp), %eax                               #2680.18
-..LN2167:
-        movl      -76(%rbp), %edx                               #2680.24
-        cmpl      %edx, %eax                                    #2680.24
-        ja        ..B19.46      # Prob 50%                      #2680.24
-                                # LOE
-..B19.43:                       # Preds ..B19.42
-..LN2169:
-        movq      -104(%rbp), %rax                              #2685.41
-..LN2171:
-        movq      -96(%rbp), %rdx                               #2685.46
-..LN2173:
-        movq      %rax, %rdi                                    #2685.22
-        movq      %rdx, %rsi                                    #2685.22
-        call      prime_buffer_2na at PLT                          #2685.22
-                                # LOE xmm0
-..B19.54:                       # Preds ..B19.43
-        movdqa    %xmm0, -336(%rbp)                             #2685.22
-                                # LOE
-..B19.44:                       # Preds ..B19.54
-..LN2175:
-        movdqa    -336(%rbp), %xmm0                             #2685.13
-        movdqa    %xmm0, -304(%rbp)                             #2685.13
-..LN2177:
-        addq      $16, -104(%rbp)                               #2763.13
-..LN2179:
-        movq      -104(%rbp), %rax                              #2765.17
-..LN2181:
-        movq      %rax, -88(%rbp)                               #2765.13
-..LN2183:
-        movq      -104(%rbp), %rax                              #2766.18
-..LN2185:
-        movq      -96(%rbp), %rdx                               #2766.24
-        cmpq      %rdx, %rax                                    #2766.24
-        jae       ..B19.10      # Prob 50%                      #2766.24
-                                # LOE
-..B19.45:                       # Preds ..B19.44
-..LN2187:
-        movq      -104(%rbp), %rax                              #2767.32
-        movzbl    -1(%rax), %eax                                #2767.32
-        movzbl    %al, %eax                                     #2767.32
-..LN2189:
-        shll      $8, %eax                                      #2767.46
-..LN2191:
-        movl      %eax, -112(%rbp)                              #2767.17
-        jmp       ..B19.10      # Prob 100%                     #2767.17
-                                # LOE
-..B19.46:                       # Preds ..B19.42 ..B19.41 ..B19.10
-..LN2193:
-        xorl      %eax, %eax                                    #2776.12
-        leave                                                   #2776.12
-..___tag_value_eval_2na_16.271:                                 #
-        ret                                                     #2776.12
-        .align    2,0x90
-..___tag_value_eval_2na_16.272:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-.LNeval_2na_16:
-	.data
-# -- End  eval_2na_16
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    2,0x90
-eval_2na_32:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B20.1:                        # Preds ..B20.0
-..___tag_value_eval_2na_32.275:                                 #
-..LN2195:
-        pushq     %rbp                                          #2782.1
-        movq      %rsp, %rbp                                    #2782.1
-..___tag_value_eval_2na_32.276:                                 #
-        subq      $336, %rsp                                    #2782.1
-        movq      %rdi, -48(%rbp)                               #2782.1
-        movq      %rsi, -40(%rbp)                               #2782.1
-        movl      %edx, -24(%rbp)                               #2782.1
-        movl      %ecx, -16(%rbp)                               #2782.1
-..LN2197:
-        movq      -48(%rbp), %rax                               #2812.25
-        movl      4(%rax), %eax                                 #2812.25
-..LN2199:
-        movl      %eax, -32(%rbp)                               #2812.23
-..LN2201:
-        movl      -16(%rbp), %eax                               #2815.5
-        movl      -32(%rbp), %edx                               #2815.5
-        cmpl      %edx, %eax                                    #2815.5
-        jae       ..B20.3       # Prob 50%                      #2815.5
-                                # LOE
-..B20.2:                        # Preds ..B20.1
-        lea       _2__STRING.9.0(%rip), %rax                    #2815.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #2815.5
-        lea       __$U7.0(%rip), %rcx                           #2815.5
-        movq      %rax, %rdi                                    #2815.5
-        movq      %rdx, %rsi                                    #2815.5
-        movl      $2815, %edx                                   #2815.5
-        call      __assert_fail at PLT                             #2815.5
-                                # LOE
-..B20.3:                        # Preds ..B20.1
-..LN2203:
-        movl      -24(%rbp), %eax                               #2819.12
-..LN2205:
-        addl      -16(%rbp), %eax                               #2819.5
-        movl      %eax, -16(%rbp)                               #2819.5
-..LN2207:
-        movl      -24(%rbp), %eax                               #2822.42
-..LN2209:
-        shrl      $2, %eax                                      #2822.49
-..LN2211:
-        addq      -40(%rbp), %rax                               #2822.30
-..LN2213:
-        movq      %rax, -104(%rbp)                              #2822.5
-..LN2215:
-        movl      -32(%rbp), %eax                               #2825.18
-        negl      %eax                                          #2825.18
-        addl      -16(%rbp), %eax                               #2825.18
-..LN2217:
-        movl      %eax, -76(%rbp)                               #2825.5
-..LN2219:
-        movl      -16(%rbp), %eax                               #2828.44
-..LN2221:
-        addl      $3, %eax                                      #2828.50
-..LN2223:
-        shrl      $2, %eax                                      #2828.57
-..LN2225:
-        addq      -40(%rbp), %rax                               #2828.30
-..LN2227:
-        movq      %rax, -96(%rbp)                               #2828.5
-..LN2229:
-        movq      -104(%rbp), %rax                              #2831.33
-..LN2231:
-        movq      -96(%rbp), %rdx                               #2831.38
-..LN2233:
-        movq      %rax, %rdi                                    #2831.14
-        movq      %rdx, %rsi                                    #2831.14
-        call      prime_buffer_2na at PLT                          #2831.14
-                                # LOE xmm0
-..B20.49:                       # Preds ..B20.3
-        movdqa    %xmm0, -160(%rbp)                             #2831.14
-                                # LOE
-..B20.4:                        # Preds ..B20.49
-..LN2235:
-        movdqa    -160(%rbp), %xmm0                             #2831.5
-        movdqa    %xmm0, -304(%rbp)                             #2831.5
-..LN2237:
-        addq      $16, -104(%rbp)                               #2832.5
-..LN2239:
-        movq      -104(%rbp), %rax                              #2834.9
-..LN2241:
-        movq      %rax, -88(%rbp)                               #2834.5
-..LN2243:
-        movq      -104(%rbp), %rax                              #2837.10
-..LN2245:
-        movq      -96(%rbp), %rdx                               #2837.16
-        cmpq      %rdx, %rax                                    #2837.16
-        jae       ..B20.6       # Prob 50%                      #2837.16
-                                # LOE
-..B20.5:                        # Preds ..B20.4
-..LN2247:
-        movq      -104(%rbp), %rax                              #2838.24
-        movzbl    -1(%rax), %eax                                #2838.24
-        movzbl    %al, %eax                                     #2838.24
-..LN2249:
-        shll      $8, %eax                                      #2838.38
-..LN2251:
-        movl      %eax, -112(%rbp)                              #2838.9
-                                # LOE
-..B20.6:                        # Preds ..B20.5 ..B20.4
-..LN2253:
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    16(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -288(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    32(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -272(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    48(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -256(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    64(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -240(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    80(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -224(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    96(%rax), %xmm0                               #2842.5
-        movdqa    %xmm0, -208(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    112(%rax), %xmm0                              #2842.5
-        movdqa    %xmm0, -192(%rbp)                             #2842.5
-        movq      -48(%rbp), %rax                               #2842.5
-        movdqa    128(%rax), %xmm0                              #2842.5
-        movdqa    %xmm0, -176(%rbp)                             #2842.5
-..LN2255:
-        xorl      %eax, %eax                                    #2845.15
-        movl      %eax, -72(%rbp)                               #2845.15
-..LN2257:
-        movl      %eax, -68(%rbp)                               #2845.10
-..LN2259:
-        movl      %eax, -64(%rbp)                               #2845.5
-..LN2261:
-        movl      $4, -60(%rbp)                                 #2849.5
-..LN2263:
-        movl      -24(%rbp), %eax                               #2854.14
-..LN2265:
-        andl      $3, %eax                                      #2854.20
-        movl      %eax, -56(%rbp)                               #2854.20
-        je        ..B20.14      # Prob 50%                      #2854.20
-                                # LOE
-..B20.7:                        # Preds ..B20.6
-        movl      -56(%rbp), %eax                               #2854.20
-        cmpl      $1, %eax                                      #2854.20
-        je        ..B20.15      # Prob 50%                      #2854.20
-                                # LOE
-..B20.8:                        # Preds ..B20.7
-        movl      -56(%rbp), %eax                               #2854.20
-        cmpl      $2, %eax                                      #2854.20
-        je        ..B20.16      # Prob 50%                      #2854.20
-                                # LOE
-..B20.9:                        # Preds ..B20.8
-        movl      -56(%rbp), %eax                               #2854.20
-        cmpl      $3, %eax                                      #2854.20
-        je        ..B20.17      # Prob 50%                      #2854.20
-                                # LOE
-..B20.10:                       # Preds ..B20.45 ..B20.44 ..B20.9
-..LN2267:
-        movl      $1, %eax                                      #2859.9
-        testl     %eax, %eax                                    #2859.9
-        je        ..B20.46      # Prob 100%                     #2859.9
-                                # LOE
-..B20.11:                       # Preds ..B20.10
-..LN2269:
-        movl      $4, -60(%rbp)                                 #2861.13
-                                # LOE
-..B20.12:                       # Preds ..B20.39 ..B20.11
-..LN2271:
-        movl      $1, %eax                                      #2864.13
-        testl     %eax, %eax                                    #2864.13
-        je        ..B20.41      # Prob 100%                     #2864.13
-                                # LOE
-..B20.14:                       # Preds ..B20.6 ..B20.12
-..LN2273:
-        movdqa    -304(%rbp), %xmm0                             #2871.38
-..LN2275:
-        movdqa    -272(%rbp), %xmm1                             #2871.46
-..LN2277:
-        pand      %xmm1, %xmm0                                  #2871.22
-..LN2279:
-        movdqa    %xmm0, -320(%rbp)                             #2871.17
-..LN2281:
-        movdqa    -320(%rbp), %xmm0                             #2872.22
-        movdqa    -288(%rbp), %xmm1                             #2872.22
-        pcmpeqd   %xmm1, %xmm0                                  #2872.22
-..LN2283:
-        movdqa    %xmm0, -320(%rbp)                             #2872.17
-..LN2285:
-        movdqa    -320(%rbp), %xmm0                             #2873.42
-..LN2287:
-        pmovmskb  %xmm0, %eax                                   #2873.22
-..LN2289:
-        movl      %eax, -64(%rbp)                               #2873.17
-                                # LOE
-..B20.15:                       # Preds ..B20.7 ..B20.14
-..LN2291:
-        movdqa    -304(%rbp), %xmm0                             #2877.38
-..LN2293:
-        movdqa    -240(%rbp), %xmm1                             #2877.46
-..LN2295:
-        pand      %xmm1, %xmm0                                  #2877.22
-..LN2297:
-        movdqa    %xmm0, -320(%rbp)                             #2877.17
-..LN2299:
-        movdqa    -320(%rbp), %xmm0                             #2878.22
-        movdqa    -256(%rbp), %xmm1                             #2878.22
-        pcmpeqd   %xmm1, %xmm0                                  #2878.22
-..LN2301:
-        movdqa    %xmm0, -320(%rbp)                             #2878.17
-..LN2303:
-        movdqa    -320(%rbp), %xmm0                             #2879.42
-..LN2305:
-        pmovmskb  %xmm0, %eax                                   #2879.22
-..LN2307:
-        movl      %eax, -68(%rbp)                               #2879.17
-                                # LOE
-..B20.16:                       # Preds ..B20.8 ..B20.15
-..LN2309:
-        movdqa    -304(%rbp), %xmm0                             #2883.38
-..LN2311:
-        movdqa    -208(%rbp), %xmm1                             #2883.46
-..LN2313:
-        pand      %xmm1, %xmm0                                  #2883.22
-..LN2315:
-        movdqa    %xmm0, -320(%rbp)                             #2883.17
-..LN2317:
-        movdqa    -320(%rbp), %xmm0                             #2884.22
-        movdqa    -224(%rbp), %xmm1                             #2884.22
-        pcmpeqd   %xmm1, %xmm0                                  #2884.22
-..LN2319:
-        movdqa    %xmm0, -320(%rbp)                             #2884.17
-..LN2321:
-        movdqa    -320(%rbp), %xmm0                             #2885.42
-..LN2323:
-        pmovmskb  %xmm0, %eax                                   #2885.22
-..LN2325:
-        movl      %eax, -72(%rbp)                               #2885.17
-                                # LOE
-..B20.17:                       # Preds ..B20.9 ..B20.16
-..LN2327:
-        movdqa    -304(%rbp), %xmm0                             #2889.38
-..LN2329:
-        movdqa    -176(%rbp), %xmm1                             #2889.46
-..LN2331:
-        pand      %xmm1, %xmm0                                  #2889.22
-..LN2333:
-        movdqa    %xmm0, -320(%rbp)                             #2889.17
-..LN2335:
-        movdqa    -320(%rbp), %xmm0                             #2890.22
-        movdqa    -192(%rbp), %xmm1                             #2890.22
-        pcmpeqd   %xmm1, %xmm0                                  #2890.22
-..LN2337:
-        movdqa    %xmm0, -320(%rbp)                             #2890.17
-..LN2339:
-        movdqa    -320(%rbp), %xmm0                             #2891.42
-..LN2341:
-        pmovmskb  %xmm0, %eax                                   #2891.22
-..LN2343:
-        movl      %eax, -80(%rbp)                               #2891.17
-..LN2345:
-        andl      $-4, -24(%rbp)                                #2896.17
-..LN2347:
-        movl      -68(%rbp), %eax                               #2899.29
-        orl       -64(%rbp), %eax                               #2899.29
-..LN2349:
-        orl       -72(%rbp), %eax                               #2899.34
-..LN2351:
-        orl       -80(%rbp), %eax                               #2899.39
-..LN2353:
-        je        ..B20.34      # Prob 50%                      #2899.47
-                                # LOE
-..B20.18:                       # Preds ..B20.17
-..LN2355:
-        movl      -64(%rbp), %eax                               #2917.58
-..LN2357:
-        movl      %eax, %edi                                    #2917.30
-        call      uint16_lsbit at PLT                              #2917.30
-                                # LOE eax
-..B20.50:                       # Preds ..B20.18
-        movl      %eax, -128(%rbp)                              #2917.30
-                                # LOE
-..B20.19:                       # Preds ..B20.50
-        movl      -128(%rbp), %eax                              #2917.30
-        movswq    %ax, %rax                                     #2917.30
-..LN2359:
-        movl      %eax, -144(%rbp)                              #2917.28
-..LN2361:
-        movl      -68(%rbp), %eax                               #2918.58
-..LN2363:
-        movl      %eax, %edi                                    #2918.30
-        call      uint16_lsbit at PLT                              #2918.30
-                                # LOE eax
-..B20.51:                       # Preds ..B20.19
-        movl      %eax, -124(%rbp)                              #2918.30
-                                # LOE
-..B20.20:                       # Preds ..B20.51
-        movl      -124(%rbp), %eax                              #2918.30
-        movswq    %ax, %rax                                     #2918.30
-..LN2365:
-        movl      %eax, -140(%rbp)                              #2918.28
-..LN2367:
-        movl      -72(%rbp), %eax                               #2919.58
-..LN2369:
-        movl      %eax, %edi                                    #2919.30
-        call      uint16_lsbit at PLT                              #2919.30
-                                # LOE eax
-..B20.52:                       # Preds ..B20.20
-        movl      %eax, -120(%rbp)                              #2919.30
-                                # LOE
-..B20.21:                       # Preds ..B20.52
-        movl      -120(%rbp), %eax                              #2919.30
-        movswq    %ax, %rax                                     #2919.30
-..LN2371:
-        movl      %eax, -136(%rbp)                              #2919.28
-..LN2373:
-        movl      -80(%rbp), %eax                               #2920.58
-..LN2375:
-        movl      %eax, %edi                                    #2920.30
-        call      uint16_lsbit at PLT                              #2920.30
-                                # LOE eax
-..B20.53:                       # Preds ..B20.21
-        movl      %eax, -116(%rbp)                              #2920.30
-                                # LOE
-..B20.22:                       # Preds ..B20.53
-        movl      -116(%rbp), %eax                              #2920.30
-        movswq    %ax, %rax                                     #2920.30
-..LN2377:
-        movl      %eax, -132(%rbp)                              #2920.28
-..LN2379:
-        shll      $2, -144(%rbp)                                #2925.34
-..LN2381:
-        movl      -140(%rbp), %eax                              #2926.28
-..LN2383:
-        shll      $2, %eax                                      #2926.34
-..LN2385:
-        incl      %eax                                          #2926.40
-..LN2387:
-        movl      %eax, -140(%rbp)                              #2926.21
-..LN2389:
-        movl      -136(%rbp), %eax                              #2927.28
-..LN2391:
-        shll      $2, %eax                                      #2927.34
-..LN2393:
-        addl      $2, %eax                                      #2927.40
-..LN2395:
-        movl      %eax, -136(%rbp)                              #2927.21
-..LN2397:
-        movl      -132(%rbp), %eax                              #2928.28
-..LN2399:
-        shll      $2, %eax                                      #2928.34
-..LN2401:
-        addl      $3, %eax                                      #2928.40
-..LN2403:
-        movl      %eax, -132(%rbp)                              #2928.21
-..LN2405:
-        movl      -64(%rbp), %eax                               #2932.26
-..LN2407:
-        testl     %eax, %eax                                    #2932.32
-        je        ..B20.25      # Prob 50%                      #2932.32
-                                # LOE
-..B20.23:                       # Preds ..B20.22
-..LN2409:
-        movl      -144(%rbp), %eax                              #2932.43
-        addl      -24(%rbp), %eax                               #2932.43
-..LN2411:
-        movl      -76(%rbp), %edx                               #2932.49
-        cmpl      %edx, %eax                                    #2932.49
-        ja        ..B20.25      # Prob 50%                      #2932.49
-                                # LOE
-..B20.24:                       # Preds ..B20.23
-..LN2413:
-        movl      $1, %eax                                      #2932.63
-        leave                                                   #2932.63
-..___tag_value_eval_2na_32.280:                                 #
-        ret                                                     #2932.63
-..___tag_value_eval_2na_32.281:                                 #
-                                # LOE
-..B20.25:                       # Preds ..B20.23 ..B20.22
-..LN2415:
-        movl      -68(%rbp), %eax                               #2933.26
-..LN2417:
-        testl     %eax, %eax                                    #2933.32
-        je        ..B20.28      # Prob 50%                      #2933.32
-                                # LOE
-..B20.26:                       # Preds ..B20.25
-..LN2419:
-        movl      -140(%rbp), %eax                              #2933.43
-        addl      -24(%rbp), %eax                               #2933.43
-..LN2421:
-        movl      -76(%rbp), %edx                               #2933.49
-        cmpl      %edx, %eax                                    #2933.49
-        ja        ..B20.28      # Prob 50%                      #2933.49
-                                # LOE
-..B20.27:                       # Preds ..B20.26
-..LN2423:
-        movl      $1, %eax                                      #2933.63
-        leave                                                   #2933.63
-..___tag_value_eval_2na_32.283:                                 #
-        ret                                                     #2933.63
-..___tag_value_eval_2na_32.284:                                 #
-                                # LOE
-..B20.28:                       # Preds ..B20.26 ..B20.25
-..LN2425:
-        movl      -72(%rbp), %eax                               #2934.26
-..LN2427:
-        testl     %eax, %eax                                    #2934.32
-        je        ..B20.31      # Prob 50%                      #2934.32
-                                # LOE
-..B20.29:                       # Preds ..B20.28
-..LN2429:
-        movl      -136(%rbp), %eax                              #2934.43
-        addl      -24(%rbp), %eax                               #2934.43
-..LN2431:
-        movl      -76(%rbp), %edx                               #2934.49
-        cmpl      %edx, %eax                                    #2934.49
-        ja        ..B20.31      # Prob 50%                      #2934.49
-                                # LOE
-..B20.30:                       # Preds ..B20.29
-..LN2433:
-        movl      $1, %eax                                      #2934.63
-        leave                                                   #2934.63
-..___tag_value_eval_2na_32.286:                                 #
-        ret                                                     #2934.63
-..___tag_value_eval_2na_32.287:                                 #
-                                # LOE
-..B20.31:                       # Preds ..B20.29 ..B20.28
-..LN2435:
-        movl      -80(%rbp), %eax                               #2935.26
-..LN2437:
-        testl     %eax, %eax                                    #2935.32
-        je        ..B20.34      # Prob 50%                      #2935.32
-                                # LOE
-..B20.32:                       # Preds ..B20.31
-..LN2439:
-        movl      -132(%rbp), %eax                              #2935.43
-        addl      -24(%rbp), %eax                               #2935.43
-..LN2441:
-        movl      -76(%rbp), %edx                               #2935.49
-        cmpl      %edx, %eax                                    #2935.49
-        ja        ..B20.34      # Prob 50%                      #2935.49
-                                # LOE
-..B20.33:                       # Preds ..B20.32
-..LN2443:
-        movl      $1, %eax                                      #2935.63
-        leave                                                   #2935.63
-..___tag_value_eval_2na_32.289:                                 #
-        ret                                                     #2935.63
-..___tag_value_eval_2na_32.290:                                 #
-                                # LOE
-..B20.34:                       # Preds ..B20.32 ..B20.31 ..B20.17
-..LN2445:
-        addl      $4, -24(%rbp)                                 #2940.17
-..LN2447:
-        movl      -24(%rbp), %eax                               #2943.22
-..LN2449:
-        movl      -76(%rbp), %edx                               #2943.28
-        cmpl      %edx, %eax                                    #2943.28
-        jbe       ..B20.36      # Prob 50%                      #2943.28
-                                # LOE
-..B20.35:                       # Preds ..B20.34
-..LN2451:
-        xorl      %eax, %eax                                    #2944.28
-        leave                                                   #2944.28
-..___tag_value_eval_2na_32.292:                                 #
-        ret                                                     #2944.28
-..___tag_value_eval_2na_32.293:                                 #
-                                # LOE
-..B20.36:                       # Preds ..B20.34
-..LN2453:
-        movl      -60(%rbp), %eax                               #2947.25
-        decl      %eax                                          #2947.25
-        movl      %eax, -60(%rbp)                               #2947.25
-..LN2455:
-        je        ..B20.41      # Prob 50%                      #2947.39
-                                # LOE
-..B20.37:                       # Preds ..B20.36
-..LN2457:
-        movdqa    -304(%rbp), %xmm0                             #2952.43
-..LN2459:
-        psrldq    $1, %xmm0                                     #2952.26
-..LN2461:
-        movdqa    %xmm0, -304(%rbp)                             #2952.17
-..LN2463:
-        movq      -88(%rbp), %rax                               #2955.22
-..LN2465:
-        movq      -96(%rbp), %rdx                               #2955.26
-        cmpq      %rdx, %rax                                    #2955.26
-        jae       ..B20.39      # Prob 50%                      #2955.26
-                                # LOE
-..B20.38:                       # Preds ..B20.37
-..LN2467:
-        sarl      $8, -112(%rbp)                                #2957.21
-..LN2469:
-        movq      -88(%rbp), %rax                               #2958.37
-        movzbl    (%rax), %eax                                  #2958.37
-        movzbl    %al, %eax                                     #2958.37
-..LN2471:
-        shll      $8, %eax                                      #2958.48
-..LN2473:
-        orl       -112(%rbp), %eax                              #2958.21
-        movl      %eax, -112(%rbp)                              #2958.21
-..LN2475:
-        movdqa    -304(%rbp), %xmm0                             #2959.49
-..LN2477:
-        movl      -112(%rbp), %eax                              #2959.57
-..LN2479:
-        pinsrw    $7, %eax, %xmm0                               #2959.30
-..LN2481:
-        movdqa    %xmm0, -304(%rbp)                             #2959.21
-                                # LOE
-..B20.39:                       # Preds ..B20.38 ..B20.37
-..LN2483:
-        incq      -88(%rbp)                                     #2963.20
-        jmp       ..B20.12      # Prob 100%                     #2963.20
-                                # LOE
-..B20.41:                       # Preds ..B20.36 ..B20.12
-..LN2485:
-        movq      -104(%rbp), %rax                              #2968.18
-..LN2487:
-        movq      -96(%rbp), %rdx                               #2968.25
-        cmpq      %rdx, %rax                                    #2968.25
-        jae       ..B20.46      # Prob 50%                      #2968.25
-                                # LOE
-..B20.42:                       # Preds ..B20.41
-..LN2489:
-        addl      $48, -24(%rbp)                                #2972.13
-..LN2491:
-        movl      -24(%rbp), %eax                               #2973.18
-..LN2493:
-        movl      -76(%rbp), %edx                               #2973.24
-        cmpl      %edx, %eax                                    #2973.24
-        ja        ..B20.46      # Prob 50%                      #2973.24
-                                # LOE
-..B20.43:                       # Preds ..B20.42
-..LN2495:
-        movq      -104(%rbp), %rax                              #2978.41
-..LN2497:
-        movq      -96(%rbp), %rdx                               #2978.46
-..LN2499:
-        movq      %rax, %rdi                                    #2978.22
-        movq      %rdx, %rsi                                    #2978.22
-        call      prime_buffer_2na at PLT                          #2978.22
-                                # LOE xmm0
-..B20.54:                       # Preds ..B20.43
-        movdqa    %xmm0, -336(%rbp)                             #2978.22
-                                # LOE
-..B20.44:                       # Preds ..B20.54
-..LN2501:
-        movdqa    -336(%rbp), %xmm0                             #2978.13
-        movdqa    %xmm0, -304(%rbp)                             #2978.13
-..LN2503:
-        addq      $16, -104(%rbp)                               #3056.13
-..LN2505:
-        movq      -104(%rbp), %rax                              #3058.17
-..LN2507:
-        movq      %rax, -88(%rbp)                               #3058.13
-..LN2509:
-        movq      -104(%rbp), %rax                              #3059.18
-..LN2511:
-        movq      -96(%rbp), %rdx                               #3059.24
-        cmpq      %rdx, %rax                                    #3059.24
-        jae       ..B20.10      # Prob 50%                      #3059.24
-                                # LOE
-..B20.45:                       # Preds ..B20.44
-..LN2513:
-        movq      -104(%rbp), %rax                              #3060.32
-        movzbl    -1(%rax), %eax                                #3060.32
-        movzbl    %al, %eax                                     #3060.32
-..LN2515:
-        shll      $8, %eax                                      #3060.46
-..LN2517:
-        movl      %eax, -112(%rbp)                              #3060.17
-        jmp       ..B20.10      # Prob 100%                     #3060.17
-                                # LOE
-..B20.46:                       # Preds ..B20.42 ..B20.41 ..B20.10
-..LN2519:
-        xorl      %eax, %eax                                    #3069.12
-        leave                                                   #3069.12
-..___tag_value_eval_2na_32.295:                                 #
-        ret                                                     #3069.12
-        .align    2,0x90
-..___tag_value_eval_2na_32.296:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-.LNeval_2na_32:
-	.data
-# -- End  eval_2na_32
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    2,0x90
-eval_2na_64:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B21.1:                        # Preds ..B21.0
-..___tag_value_eval_2na_64.299:                                 #
-..LN2521:
-        pushq     %rbp                                          #3075.1
-        movq      %rsp, %rbp                                    #3075.1
-..___tag_value_eval_2na_64.300:                                 #
-        subq      $336, %rsp                                    #3075.1
-        movq      %rdi, -48(%rbp)                               #3075.1
-        movq      %rsi, -40(%rbp)                               #3075.1
-        movl      %edx, -24(%rbp)                               #3075.1
-        movl      %ecx, -16(%rbp)                               #3075.1
-..LN2523:
-        movq      -48(%rbp), %rax                               #3106.25
-        movl      4(%rax), %eax                                 #3106.25
-..LN2525:
-        movl      %eax, -32(%rbp)                               #3106.23
-..LN2527:
-        movl      -16(%rbp), %eax                               #3109.5
-        movl      -32(%rbp), %edx                               #3109.5
-        cmpl      %edx, %eax                                    #3109.5
-        jae       ..B21.3       # Prob 50%                      #3109.5
-                                # LOE
-..B21.2:                        # Preds ..B21.1
-        lea       _2__STRING.9.0(%rip), %rax                    #3109.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #3109.5
-        lea       __$U8.0(%rip), %rcx                           #3109.5
-        movq      %rax, %rdi                                    #3109.5
-        movq      %rdx, %rsi                                    #3109.5
-        movl      $3109, %edx                                   #3109.5
-        call      __assert_fail at PLT                             #3109.5
-                                # LOE
-..B21.3:                        # Preds ..B21.1
-..LN2529:
-        movl      -24(%rbp), %eax                               #3113.12
-..LN2531:
-        addl      -16(%rbp), %eax                               #3113.5
-        movl      %eax, -16(%rbp)                               #3113.5
-..LN2533:
-        movl      -24(%rbp), %eax                               #3116.42
-..LN2535:
-        shrl      $2, %eax                                      #3116.49
-..LN2537:
-        addq      -40(%rbp), %rax                               #3116.30
-..LN2539:
-        movq      %rax, -104(%rbp)                              #3116.5
-..LN2541:
-        movl      -32(%rbp), %eax                               #3119.18
-        negl      %eax                                          #3119.18
-        addl      -16(%rbp), %eax                               #3119.18
-..LN2543:
-        movl      %eax, -76(%rbp)                               #3119.5
-..LN2545:
-        movl      -16(%rbp), %eax                               #3122.44
-..LN2547:
-        addl      $3, %eax                                      #3122.50
-..LN2549:
-        shrl      $2, %eax                                      #3122.57
-..LN2551:
-        addq      -40(%rbp), %rax                               #3122.30
-..LN2553:
-        movq      %rax, -96(%rbp)                               #3122.5
-..LN2555:
-        movq      -104(%rbp), %rax                              #3125.33
-..LN2557:
-        movq      -96(%rbp), %rdx                               #3125.38
-..LN2559:
-        movq      %rax, %rdi                                    #3125.14
-        movq      %rdx, %rsi                                    #3125.14
-        call      prime_buffer_2na at PLT                          #3125.14
-                                # LOE xmm0
-..B21.49:                       # Preds ..B21.3
-        movdqa    %xmm0, -160(%rbp)                             #3125.14
-                                # LOE
-..B21.4:                        # Preds ..B21.49
-..LN2561:
-        movdqa    -160(%rbp), %xmm0                             #3125.5
-        movdqa    %xmm0, -304(%rbp)                             #3125.5
-..LN2563:
-        addq      $16, -104(%rbp)                               #3126.5
-..LN2565:
-        movq      -104(%rbp), %rax                              #3128.9
-..LN2567:
-        movq      %rax, -88(%rbp)                               #3128.5
-..LN2569:
-        movq      -104(%rbp), %rax                              #3131.10
-..LN2571:
-        movq      -96(%rbp), %rdx                               #3131.16
-        cmpq      %rdx, %rax                                    #3131.16
-        jae       ..B21.6       # Prob 50%                      #3131.16
-                                # LOE
-..B21.5:                        # Preds ..B21.4
-..LN2573:
-        movq      -104(%rbp), %rax                              #3132.24
-        movzbl    -1(%rax), %eax                                #3132.24
-        movzbl    %al, %eax                                     #3132.24
-..LN2575:
-        shll      $8, %eax                                      #3132.38
-..LN2577:
-        movl      %eax, -112(%rbp)                              #3132.9
-                                # LOE
-..B21.6:                        # Preds ..B21.5 ..B21.4
-..LN2579:
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    16(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -288(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    32(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -272(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    48(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -256(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    64(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -240(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    80(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -224(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    96(%rax), %xmm0                               #3136.5
-        movdqa    %xmm0, -208(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    112(%rax), %xmm0                              #3136.5
-        movdqa    %xmm0, -192(%rbp)                             #3136.5
-        movq      -48(%rbp), %rax                               #3136.5
-        movdqa    128(%rax), %xmm0                              #3136.5
-        movdqa    %xmm0, -176(%rbp)                             #3136.5
-..LN2581:
-        xorl      %eax, %eax                                    #3139.15
-        movl      %eax, -72(%rbp)                               #3139.15
-..LN2583:
-        movl      %eax, -68(%rbp)                               #3139.10
-..LN2585:
-        movl      %eax, -64(%rbp)                               #3139.5
-..LN2587:
-        movl      $8, -60(%rbp)                                 #3143.5
-..LN2589:
-        movl      -24(%rbp), %eax                               #3148.14
-..LN2591:
-        andl      $3, %eax                                      #3148.20
-        movl      %eax, -56(%rbp)                               #3148.20
-        je        ..B21.14      # Prob 50%                      #3148.20
-                                # LOE
-..B21.7:                        # Preds ..B21.6
-        movl      -56(%rbp), %eax                               #3148.20
-        cmpl      $1, %eax                                      #3148.20
-        je        ..B21.15      # Prob 50%                      #3148.20
-                                # LOE
-..B21.8:                        # Preds ..B21.7
-        movl      -56(%rbp), %eax                               #3148.20
-        cmpl      $2, %eax                                      #3148.20
-        je        ..B21.16      # Prob 50%                      #3148.20
-                                # LOE
-..B21.9:                        # Preds ..B21.8
-        movl      -56(%rbp), %eax                               #3148.20
-        cmpl      $3, %eax                                      #3148.20
-        je        ..B21.17      # Prob 50%                      #3148.20
-                                # LOE
-..B21.10:                       # Preds ..B21.45 ..B21.44 ..B21.9
-..LN2593:
-        movl      $1, %eax                                      #3153.9
-        testl     %eax, %eax                                    #3153.9
-        je        ..B21.46      # Prob 100%                     #3153.9
-                                # LOE
-..B21.11:                       # Preds ..B21.10
-..LN2595:
-        movl      $8, -60(%rbp)                                 #3155.13
-                                # LOE
-..B21.12:                       # Preds ..B21.39 ..B21.11
-..LN2597:
-        movl      $1, %eax                                      #3158.13
-        testl     %eax, %eax                                    #3158.13
-        je        ..B21.41      # Prob 100%                     #3158.13
-                                # LOE
-..B21.14:                       # Preds ..B21.6 ..B21.12
-..LN2599:
-        movdqa    -304(%rbp), %xmm0                             #3165.38
-..LN2601:
-        movdqa    -272(%rbp), %xmm1                             #3165.46
-..LN2603:
-        pand      %xmm1, %xmm0                                  #3165.22
-..LN2605:
-        movdqa    %xmm0, -320(%rbp)                             #3165.17
-..LN2607:
-        movdqa    -320(%rbp), %xmm0                             #3166.22
-        movdqa    -288(%rbp), %xmm1                             #3166.22
-        pcmpeqd   %xmm1, %xmm0                                  #3166.22
-..LN2609:
-        movdqa    %xmm0, -320(%rbp)                             #3166.17
-..LN2611:
-        movdqa    -320(%rbp), %xmm0                             #3167.42
-..LN2613:
-        pmovmskb  %xmm0, %eax                                   #3167.22
-..LN2615:
-        movl      %eax, -64(%rbp)                               #3167.17
-..LN2617:
-        movl      -64(%rbp), %eax                               #3168.17
-        andl      $3855, %eax                                   #3168.17
-        shll      $4, %eax                                      #3168.17
-        andl      -64(%rbp), %eax                               #3168.17
-        movl      %eax, -64(%rbp)                               #3168.17
-        movl      -64(%rbp), %eax                               #3168.17
-        sarl      $4, %eax                                      #3168.17
-        orl       -64(%rbp), %eax                               #3168.17
-        movl      %eax, -64(%rbp)                               #3168.17
-                                # LOE
-..B21.15:                       # Preds ..B21.7 ..B21.14
-..LN2619:
-        movdqa    -304(%rbp), %xmm0                             #3171.38
-..LN2621:
-        movdqa    -240(%rbp), %xmm1                             #3171.46
-..LN2623:
-        pand      %xmm1, %xmm0                                  #3171.22
-..LN2625:
-        movdqa    %xmm0, -320(%rbp)                             #3171.17
-..LN2627:
-        movdqa    -320(%rbp), %xmm0                             #3172.22
-        movdqa    -256(%rbp), %xmm1                             #3172.22
-        pcmpeqd   %xmm1, %xmm0                                  #3172.22
-..LN2629:
-        movdqa    %xmm0, -320(%rbp)                             #3172.17
-..LN2631:
-        movdqa    -320(%rbp), %xmm0                             #3173.42
-..LN2633:
-        pmovmskb  %xmm0, %eax                                   #3173.22
-..LN2635:
-        movl      %eax, -68(%rbp)                               #3173.17
-..LN2637:
-        movl      -68(%rbp), %eax                               #3174.17
-        andl      $3855, %eax                                   #3174.17
-        shll      $4, %eax                                      #3174.17
-        andl      -68(%rbp), %eax                               #3174.17
-        movl      %eax, -68(%rbp)                               #3174.17
-        movl      -68(%rbp), %eax                               #3174.17
-        sarl      $4, %eax                                      #3174.17
-        orl       -68(%rbp), %eax                               #3174.17
-        movl      %eax, -68(%rbp)                               #3174.17
-                                # LOE
-..B21.16:                       # Preds ..B21.8 ..B21.15
-..LN2639:
-        movdqa    -304(%rbp), %xmm0                             #3177.38
-..LN2641:
-        movdqa    -208(%rbp), %xmm1                             #3177.46
-..LN2643:
-        pand      %xmm1, %xmm0                                  #3177.22
-..LN2645:
-        movdqa    %xmm0, -320(%rbp)                             #3177.17
-..LN2647:
-        movdqa    -320(%rbp), %xmm0                             #3178.22
-        movdqa    -224(%rbp), %xmm1                             #3178.22
-        pcmpeqd   %xmm1, %xmm0                                  #3178.22
-..LN2649:
-        movdqa    %xmm0, -320(%rbp)                             #3178.17
-..LN2651:
-        movdqa    -320(%rbp), %xmm0                             #3179.42
-..LN2653:
-        pmovmskb  %xmm0, %eax                                   #3179.22
-..LN2655:
-        movl      %eax, -72(%rbp)                               #3179.17
-..LN2657:
-        movl      -72(%rbp), %eax                               #3180.17
-        andl      $3855, %eax                                   #3180.17
-        shll      $4, %eax                                      #3180.17
-        andl      -72(%rbp), %eax                               #3180.17
-        movl      %eax, -72(%rbp)                               #3180.17
-        movl      -72(%rbp), %eax                               #3180.17
-        sarl      $4, %eax                                      #3180.17
-        orl       -72(%rbp), %eax                               #3180.17
-        movl      %eax, -72(%rbp)                               #3180.17
-                                # LOE
-..B21.17:                       # Preds ..B21.9 ..B21.16
-..LN2659:
-        movdqa    -304(%rbp), %xmm0                             #3183.38
-..LN2661:
-        movdqa    -176(%rbp), %xmm1                             #3183.46
-..LN2663:
-        pand      %xmm1, %xmm0                                  #3183.22
-..LN2665:
-        movdqa    %xmm0, -320(%rbp)                             #3183.17
-..LN2667:
-        movdqa    -320(%rbp), %xmm0                             #3184.22
-        movdqa    -192(%rbp), %xmm1                             #3184.22
-        pcmpeqd   %xmm1, %xmm0                                  #3184.22
-..LN2669:
-        movdqa    %xmm0, -320(%rbp)                             #3184.17
-..LN2671:
-        movdqa    -320(%rbp), %xmm0                             #3185.42
-..LN2673:
-        pmovmskb  %xmm0, %eax                                   #3185.22
-..LN2675:
-        movl      %eax, -80(%rbp)                               #3185.17
-..LN2677:
-        movl      -80(%rbp), %eax                               #3186.17
-        andl      $3855, %eax                                   #3186.17
-        shll      $4, %eax                                      #3186.17
-        andl      -80(%rbp), %eax                               #3186.17
-        movl      %eax, -80(%rbp)                               #3186.17
-        movl      -80(%rbp), %eax                               #3186.17
-        sarl      $4, %eax                                      #3186.17
-        orl       -80(%rbp), %eax                               #3186.17
-        movl      %eax, -80(%rbp)                               #3186.17
-..LN2679:
-        andl      $-4, -24(%rbp)                                #3190.17
-..LN2681:
-        movl      -68(%rbp), %eax                               #3193.29
-        orl       -64(%rbp), %eax                               #3193.29
-..LN2683:
-        orl       -72(%rbp), %eax                               #3193.34
-..LN2685:
-        orl       -80(%rbp), %eax                               #3193.39
-..LN2687:
-        je        ..B21.34      # Prob 50%                      #3193.47
-                                # LOE
-..B21.18:                       # Preds ..B21.17
-..LN2689:
-        movl      -64(%rbp), %eax                               #3211.58
-..LN2691:
-        movl      %eax, %edi                                    #3211.30
-        call      uint16_lsbit at PLT                              #3211.30
-                                # LOE eax
-..B21.50:                       # Preds ..B21.18
-        movl      %eax, -128(%rbp)                              #3211.30
-                                # LOE
-..B21.19:                       # Preds ..B21.50
-        movl      -128(%rbp), %eax                              #3211.30
-        movswq    %ax, %rax                                     #3211.30
-..LN2693:
-        movl      %eax, -144(%rbp)                              #3211.28
-..LN2695:
-        movl      -68(%rbp), %eax                               #3212.58
-..LN2697:
-        movl      %eax, %edi                                    #3212.30
-        call      uint16_lsbit at PLT                              #3212.30
-                                # LOE eax
-..B21.51:                       # Preds ..B21.19
-        movl      %eax, -124(%rbp)                              #3212.30
-                                # LOE
-..B21.20:                       # Preds ..B21.51
-        movl      -124(%rbp), %eax                              #3212.30
-        movswq    %ax, %rax                                     #3212.30
-..LN2699:
-        movl      %eax, -140(%rbp)                              #3212.28
-..LN2701:
-        movl      -72(%rbp), %eax                               #3213.58
-..LN2703:
-        movl      %eax, %edi                                    #3213.30
-        call      uint16_lsbit at PLT                              #3213.30
-                                # LOE eax
-..B21.52:                       # Preds ..B21.20
-        movl      %eax, -120(%rbp)                              #3213.30
-                                # LOE
-..B21.21:                       # Preds ..B21.52
-        movl      -120(%rbp), %eax                              #3213.30
-        movswq    %ax, %rax                                     #3213.30
-..LN2705:
-        movl      %eax, -136(%rbp)                              #3213.28
-..LN2707:
-        movl      -80(%rbp), %eax                               #3214.58
-..LN2709:
-        movl      %eax, %edi                                    #3214.30
-        call      uint16_lsbit at PLT                              #3214.30
-                                # LOE eax
-..B21.53:                       # Preds ..B21.21
-        movl      %eax, -116(%rbp)                              #3214.30
-                                # LOE
-..B21.22:                       # Preds ..B21.53
-        movl      -116(%rbp), %eax                              #3214.30
-        movswq    %ax, %rax                                     #3214.30
-..LN2711:
-        movl      %eax, -132(%rbp)                              #3214.28
-..LN2713:
-        shll      $2, -144(%rbp)                                #3219.34
-..LN2715:
-        movl      -140(%rbp), %eax                              #3220.28
-..LN2717:
-        shll      $2, %eax                                      #3220.34
-..LN2719:
-        incl      %eax                                          #3220.40
-..LN2721:
-        movl      %eax, -140(%rbp)                              #3220.21
-..LN2723:
-        movl      -136(%rbp), %eax                              #3221.28
-..LN2725:
-        shll      $2, %eax                                      #3221.34
-..LN2727:
-        addl      $2, %eax                                      #3221.40
-..LN2729:
-        movl      %eax, -136(%rbp)                              #3221.21
-..LN2731:
-        movl      -132(%rbp), %eax                              #3222.28
-..LN2733:
-        shll      $2, %eax                                      #3222.34
-..LN2735:
-        addl      $3, %eax                                      #3222.40
-..LN2737:
-        movl      %eax, -132(%rbp)                              #3222.21
-..LN2739:
-        movl      -64(%rbp), %eax                               #3226.26
-..LN2741:
-        testl     %eax, %eax                                    #3226.32
-        je        ..B21.25      # Prob 50%                      #3226.32
-                                # LOE
-..B21.23:                       # Preds ..B21.22
-..LN2743:
-        movl      -144(%rbp), %eax                              #3226.43
-        addl      -24(%rbp), %eax                               #3226.43
-..LN2745:
-        movl      -76(%rbp), %edx                               #3226.49
-        cmpl      %edx, %eax                                    #3226.49
-        ja        ..B21.25      # Prob 50%                      #3226.49
-                                # LOE
-..B21.24:                       # Preds ..B21.23
-..LN2747:
-        movl      $1, %eax                                      #3226.63
-        leave                                                   #3226.63
-..___tag_value_eval_2na_64.304:                                 #
-        ret                                                     #3226.63
-..___tag_value_eval_2na_64.305:                                 #
-                                # LOE
-..B21.25:                       # Preds ..B21.23 ..B21.22
-..LN2749:
-        movl      -68(%rbp), %eax                               #3227.26
-..LN2751:
-        testl     %eax, %eax                                    #3227.32
-        je        ..B21.28      # Prob 50%                      #3227.32
-                                # LOE
-..B21.26:                       # Preds ..B21.25
-..LN2753:
-        movl      -140(%rbp), %eax                              #3227.43
-        addl      -24(%rbp), %eax                               #3227.43
-..LN2755:
-        movl      -76(%rbp), %edx                               #3227.49
-        cmpl      %edx, %eax                                    #3227.49
-        ja        ..B21.28      # Prob 50%                      #3227.49
-                                # LOE
-..B21.27:                       # Preds ..B21.26
-..LN2757:
-        movl      $1, %eax                                      #3227.63
-        leave                                                   #3227.63
-..___tag_value_eval_2na_64.307:                                 #
-        ret                                                     #3227.63
-..___tag_value_eval_2na_64.308:                                 #
-                                # LOE
-..B21.28:                       # Preds ..B21.26 ..B21.25
-..LN2759:
-        movl      -72(%rbp), %eax                               #3228.26
-..LN2761:
-        testl     %eax, %eax                                    #3228.32
-        je        ..B21.31      # Prob 50%                      #3228.32
-                                # LOE
-..B21.29:                       # Preds ..B21.28
-..LN2763:
-        movl      -136(%rbp), %eax                              #3228.43
-        addl      -24(%rbp), %eax                               #3228.43
-..LN2765:
-        movl      -76(%rbp), %edx                               #3228.49
-        cmpl      %edx, %eax                                    #3228.49
-        ja        ..B21.31      # Prob 50%                      #3228.49
-                                # LOE
-..B21.30:                       # Preds ..B21.29
-..LN2767:
-        movl      $1, %eax                                      #3228.63
-        leave                                                   #3228.63
-..___tag_value_eval_2na_64.310:                                 #
-        ret                                                     #3228.63
-..___tag_value_eval_2na_64.311:                                 #
-                                # LOE
-..B21.31:                       # Preds ..B21.29 ..B21.28
-..LN2769:
-        movl      -80(%rbp), %eax                               #3229.26
-..LN2771:
-        testl     %eax, %eax                                    #3229.32
-        je        ..B21.34      # Prob 50%                      #3229.32
-                                # LOE
-..B21.32:                       # Preds ..B21.31
-..LN2773:
-        movl      -132(%rbp), %eax                              #3229.43
-        addl      -24(%rbp), %eax                               #3229.43
-..LN2775:
-        movl      -76(%rbp), %edx                               #3229.49
-        cmpl      %edx, %eax                                    #3229.49
-        ja        ..B21.34      # Prob 50%                      #3229.49
-                                # LOE
-..B21.33:                       # Preds ..B21.32
-..LN2777:
-        movl      $1, %eax                                      #3229.63
-        leave                                                   #3229.63
-..___tag_value_eval_2na_64.313:                                 #
-        ret                                                     #3229.63
-..___tag_value_eval_2na_64.314:                                 #
-                                # LOE
-..B21.34:                       # Preds ..B21.32 ..B21.31 ..B21.17
-..LN2779:
-        addl      $4, -24(%rbp)                                 #3234.17
-..LN2781:
-        movl      -24(%rbp), %eax                               #3237.22
-..LN2783:
-        movl      -76(%rbp), %edx                               #3237.28
-        cmpl      %edx, %eax                                    #3237.28
-        jbe       ..B21.36      # Prob 50%                      #3237.28
-                                # LOE
-..B21.35:                       # Preds ..B21.34
-..LN2785:
-        xorl      %eax, %eax                                    #3238.28
-        leave                                                   #3238.28
-..___tag_value_eval_2na_64.316:                                 #
-        ret                                                     #3238.28
-..___tag_value_eval_2na_64.317:                                 #
-                                # LOE
-..B21.36:                       # Preds ..B21.34
-..LN2787:
-        movl      -60(%rbp), %eax                               #3241.25
-        decl      %eax                                          #3241.25
-        movl      %eax, -60(%rbp)                               #3241.25
-..LN2789:
-        je        ..B21.41      # Prob 50%                      #3241.39
-                                # LOE
-..B21.37:                       # Preds ..B21.36
-..LN2791:
-        movdqa    -304(%rbp), %xmm0                             #3246.43
-..LN2793:
-        psrldq    $1, %xmm0                                     #3246.26
-..LN2795:
-        movdqa    %xmm0, -304(%rbp)                             #3246.17
-..LN2797:
-        movq      -88(%rbp), %rax                               #3249.22
-..LN2799:
-        movq      -96(%rbp), %rdx                               #3249.26
-        cmpq      %rdx, %rax                                    #3249.26
-        jae       ..B21.39      # Prob 50%                      #3249.26
-                                # LOE
-..B21.38:                       # Preds ..B21.37
-..LN2801:
-        sarl      $8, -112(%rbp)                                #3251.21
-..LN2803:
-        movq      -88(%rbp), %rax                               #3252.37
-        movzbl    (%rax), %eax                                  #3252.37
-        movzbl    %al, %eax                                     #3252.37
-..LN2805:
-        shll      $8, %eax                                      #3252.48
-..LN2807:
-        orl       -112(%rbp), %eax                              #3252.21
-        movl      %eax, -112(%rbp)                              #3252.21
-..LN2809:
-        movdqa    -304(%rbp), %xmm0                             #3253.49
-..LN2811:
-        movl      -112(%rbp), %eax                              #3253.57
-..LN2813:
-        pinsrw    $7, %eax, %xmm0                               #3253.30
-..LN2815:
-        movdqa    %xmm0, -304(%rbp)                             #3253.21
-                                # LOE
-..B21.39:                       # Preds ..B21.38 ..B21.37
-..LN2817:
-        incq      -88(%rbp)                                     #3257.20
-        jmp       ..B21.12      # Prob 100%                     #3257.20
-                                # LOE
-..B21.41:                       # Preds ..B21.36 ..B21.12
-..LN2819:
-        movq      -104(%rbp), %rax                              #3262.18
-..LN2821:
-        movq      -96(%rbp), %rdx                               #3262.25
-        cmpq      %rdx, %rax                                    #3262.25
-        jae       ..B21.46      # Prob 50%                      #3262.25
-                                # LOE
-..B21.42:                       # Preds ..B21.41
-..LN2823:
-        addl      $32, -24(%rbp)                                #3266.13
-..LN2825:
-        movl      -24(%rbp), %eax                               #3267.18
-..LN2827:
-        movl      -76(%rbp), %edx                               #3267.24
-        cmpl      %edx, %eax                                    #3267.24
-        ja        ..B21.46      # Prob 50%                      #3267.24
-                                # LOE
-..B21.43:                       # Preds ..B21.42
-..LN2829:
-        movq      -104(%rbp), %rax                              #3272.41
-..LN2831:
-        movq      -96(%rbp), %rdx                               #3272.46
-..LN2833:
-        movq      %rax, %rdi                                    #3272.22
-        movq      %rdx, %rsi                                    #3272.22
-        call      prime_buffer_2na at PLT                          #3272.22
-                                # LOE xmm0
-..B21.54:                       # Preds ..B21.43
-        movdqa    %xmm0, -336(%rbp)                             #3272.22
-                                # LOE
-..B21.44:                       # Preds ..B21.54
-..LN2835:
-        movdqa    -336(%rbp), %xmm0                             #3272.13
-        movdqa    %xmm0, -304(%rbp)                             #3272.13
-..LN2837:
-        addq      $16, -104(%rbp)                               #3350.13
-..LN2839:
-        movq      -104(%rbp), %rax                              #3352.17
-..LN2841:
-        movq      %rax, -88(%rbp)                               #3352.13
-..LN2843:
-        movq      -104(%rbp), %rax                              #3353.18
-..LN2845:
-        movq      -96(%rbp), %rdx                               #3353.24
-        cmpq      %rdx, %rax                                    #3353.24
-        jae       ..B21.10      # Prob 50%                      #3353.24
-                                # LOE
-..B21.45:                       # Preds ..B21.44
-..LN2847:
-        movq      -104(%rbp), %rax                              #3354.32
-        movzbl    -1(%rax), %eax                                #3354.32
-        movzbl    %al, %eax                                     #3354.32
-..LN2849:
-        shll      $8, %eax                                      #3354.46
-..LN2851:
-        movl      %eax, -112(%rbp)                              #3354.17
-        jmp       ..B21.10      # Prob 100%                     #3354.17
-                                # LOE
-..B21.46:                       # Preds ..B21.42 ..B21.41 ..B21.10
-..LN2853:
-        xorl      %eax, %eax                                    #3363.12
-        leave                                                   #3363.12
-..___tag_value_eval_2na_64.319:                                 #
-        ret                                                     #3363.12
-        .align    2,0x90
-..___tag_value_eval_2na_64.320:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-.LNeval_2na_64:
-	.data
-# -- End  eval_2na_64
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    2,0x90
-eval_2na_128:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B22.1:                        # Preds ..B22.0
-..___tag_value_eval_2na_128.323:                                #
-..LN2855:
-        pushq     %rbp                                          #3369.1
-        movq      %rsp, %rbp                                    #3369.1
-..___tag_value_eval_2na_128.324:                                #
-        subq      $304, %rsp                                    #3369.1
-        movq      %rdi, -40(%rbp)                               #3369.1
-        movq      %rsi, -32(%rbp)                               #3369.1
-        movl      %edx, -16(%rbp)                               #3369.1
-        movl      %ecx, -8(%rbp)                                #3369.1
-..LN2857:
-        movq      -40(%rbp), %rax                               #3399.25
-        movl      4(%rax), %eax                                 #3399.25
-..LN2859:
-        movl      %eax, -24(%rbp)                               #3399.23
-..LN2861:
-        movl      -8(%rbp), %eax                                #3402.5
-        movl      -24(%rbp), %edx                               #3402.5
-        cmpl      %edx, %eax                                    #3402.5
-        jae       ..B22.3       # Prob 50%                      #3402.5
-                                # LOE
-..B22.2:                        # Preds ..B22.1
-        lea       _2__STRING.9.0(%rip), %rax                    #3402.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #3402.5
-        lea       __$U9.0(%rip), %rcx                           #3402.5
-        movq      %rax, %rdi                                    #3402.5
-        movq      %rdx, %rsi                                    #3402.5
-        movl      $3402, %edx                                   #3402.5
-        call      __assert_fail at PLT                             #3402.5
-                                # LOE
-..B22.3:                        # Preds ..B22.1
-..LN2863:
-        movl      -16(%rbp), %eax                               #3406.12
-..LN2865:
-        addl      -8(%rbp), %eax                                #3406.5
-        movl      %eax, -8(%rbp)                                #3406.5
-..LN2867:
-        movl      -16(%rbp), %eax                               #3409.42
-..LN2869:
-        shrl      $2, %eax                                      #3409.49
-..LN2871:
-        addq      -32(%rbp), %rax                               #3409.30
-..LN2873:
-        movq      %rax, -88(%rbp)                               #3409.5
-..LN2875:
-        movl      -24(%rbp), %eax                               #3412.18
-        negl      %eax                                          #3412.18
-        addl      -8(%rbp), %eax                                #3412.18
-..LN2877:
-        movl      %eax, -64(%rbp)                               #3412.5
-..LN2879:
-        movl      -8(%rbp), %eax                                #3415.44
-..LN2881:
-        addl      $3, %eax                                      #3415.50
-..LN2883:
-        shrl      $2, %eax                                      #3415.57
-..LN2885:
-        addq      -32(%rbp), %rax                               #3415.30
-..LN2887:
-        movq      %rax, -80(%rbp)                               #3415.5
-..LN2889:
-        movq      -88(%rbp), %rax                               #3418.33
-..LN2891:
-        movq      -80(%rbp), %rdx                               #3418.38
-..LN2893:
-        movq      %rax, %rdi                                    #3418.14
-        movq      %rdx, %rsi                                    #3418.14
-        call      prime_buffer_2na at PLT                          #3418.14
-                                # LOE xmm0
-..B22.44:                       # Preds ..B22.3
-        movdqa    %xmm0, -112(%rbp)                             #3418.14
-                                # LOE
-..B22.4:                        # Preds ..B22.44
-..LN2895:
-        movdqa    -112(%rbp), %xmm0                             #3418.5
-        movdqa    %xmm0, -256(%rbp)                             #3418.5
-..LN2897:
-        addq      $16, -88(%rbp)                                #3419.5
-..LN2899:
-        movq      -88(%rbp), %rax                               #3421.9
-..LN2901:
-        movq      %rax, -72(%rbp)                               #3421.5
-..LN2903:
-        movq      -88(%rbp), %rax                               #3424.10
-..LN2905:
-        movq      -80(%rbp), %rdx                               #3424.16
-        cmpq      %rdx, %rax                                    #3424.16
-        jae       ..B22.6       # Prob 50%                      #3424.16
-                                # LOE
-..B22.5:                        # Preds ..B22.4
-..LN2907:
-        movq      -88(%rbp), %rax                               #3425.24
-        movzbl    -1(%rax), %eax                                #3425.24
-        movzbl    %al, %eax                                     #3425.24
-..LN2909:
-        shll      $8, %eax                                      #3425.38
-..LN2911:
-        movl      %eax, -96(%rbp)                               #3425.9
-                                # LOE
-..B22.6:                        # Preds ..B22.5 ..B22.4
-..LN2913:
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    16(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -240(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    32(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -224(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    48(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -208(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    64(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -192(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    80(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -176(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    96(%rax), %xmm0                               #3429.5
-        movdqa    %xmm0, -160(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    112(%rax), %xmm0                              #3429.5
-        movdqa    %xmm0, -144(%rbp)                             #3429.5
-        movq      -40(%rbp), %rax                               #3429.5
-        movdqa    128(%rax), %xmm0                              #3429.5
-        movdqa    %xmm0, -128(%rbp)                             #3429.5
-..LN2915:
-        xorl      %eax, %eax                                    #3432.15
-        movl      %eax, -60(%rbp)                               #3432.15
-..LN2917:
-        movl      %eax, -56(%rbp)                               #3432.10
-..LN2919:
-        movl      %eax, -52(%rbp)                               #3432.5
-..LN2921:
-        movl      -16(%rbp), %eax                               #3434.27
-        negl      %eax                                          #3434.27
-..LN2923:
-        movl      -64(%rbp), %edx                               #3434.20
-..LN2925:
-        lea       7(%rdx,%rax), %eax                            #3434.33
-..LN2927:
-        shrl      $2, %eax                                      #3434.40
-..LN2929:
-        movl      %eax, -48(%rbp)                               #3434.5
-..LN2931:
-        movl      -16(%rbp), %eax                               #3441.14
-..LN2933:
-        andl      $3, %eax                                      #3441.20
-        movl      %eax, -44(%rbp)                               #3441.20
-        je        ..B22.14      # Prob 50%                      #3441.20
-                                # LOE
-..B22.7:                        # Preds ..B22.6
-        movl      -44(%rbp), %eax                               #3441.20
-        cmpl      $1, %eax                                      #3441.20
-        je        ..B22.15      # Prob 50%                      #3441.20
-                                # LOE
-..B22.8:                        # Preds ..B22.7
-        movl      -44(%rbp), %eax                               #3441.20
-        cmpl      $2, %eax                                      #3441.20
-        je        ..B22.16      # Prob 50%                      #3441.20
-                                # LOE
-..B22.9:                        # Preds ..B22.8
-        movl      -44(%rbp), %eax                               #3441.20
-        cmpl      $3, %eax                                      #3441.20
-        je        ..B22.17      # Prob 50%                      #3441.20
-                                # LOE
-..B22.10:                       # Preds ..B22.40 ..B22.39 ..B22.9
-..LN2935:
-        movl      $1, %eax                                      #3446.9
-        testl     %eax, %eax                                    #3446.9
-        je        ..B22.41      # Prob 100%                     #3446.9
-                                # LOE
-..B22.11:                       # Preds ..B22.10
-..LN2937:
-        movl      $16, -48(%rbp)                                #3448.13
-                                # LOE
-..B22.12:                       # Preds ..B22.34 ..B22.11
-..LN2939:
-        movl      $1, %eax                                      #3451.13
-        testl     %eax, %eax                                    #3451.13
-        je        ..B22.36      # Prob 100%                     #3451.13
-                                # LOE
-..B22.14:                       # Preds ..B22.6 ..B22.12
-..LN2941:
-        movdqa    -256(%rbp), %xmm0                             #3458.38
-..LN2943:
-        movdqa    -224(%rbp), %xmm1                             #3458.46
-..LN2945:
-        pand      %xmm1, %xmm0                                  #3458.22
-..LN2947:
-        movdqa    %xmm0, -288(%rbp)                             #3458.17
-..LN2949:
-        movdqa    -288(%rbp), %xmm0                             #3459.22
-        movdqa    -240(%rbp), %xmm1                             #3459.22
-        pcmpeqd   %xmm1, %xmm0                                  #3459.22
-..LN2951:
-        movdqa    %xmm0, -288(%rbp)                             #3459.17
-..LN2953:
-        movdqa    -288(%rbp), %xmm0                             #3460.42
-..LN2955:
-        pmovmskb  %xmm0, %eax                                   #3460.22
-..LN2957:
-        movl      %eax, -52(%rbp)                               #3460.17
-..LN2959:
-        movl      -52(%rbp), %eax                               #3461.17
-        incl      %eax                                          #3461.17
-        sarl      $16, %eax                                     #3461.17
-        negl      %eax                                          #3461.17
-        movl      %eax, -52(%rbp)                               #3461.17
-                                # LOE
-..B22.15:                       # Preds ..B22.7 ..B22.14
-..LN2961:
-        movdqa    -256(%rbp), %xmm0                             #3464.38
-..LN2963:
-        movdqa    -192(%rbp), %xmm1                             #3464.46
-..LN2965:
-        pand      %xmm1, %xmm0                                  #3464.22
-..LN2967:
-        movdqa    %xmm0, -288(%rbp)                             #3464.17
-..LN2969:
-        movdqa    -288(%rbp), %xmm0                             #3465.22
-        movdqa    -208(%rbp), %xmm1                             #3465.22
-        pcmpeqd   %xmm1, %xmm0                                  #3465.22
-..LN2971:
-        movdqa    %xmm0, -288(%rbp)                             #3465.17
-..LN2973:
-        movdqa    -288(%rbp), %xmm0                             #3466.42
-..LN2975:
-        pmovmskb  %xmm0, %eax                                   #3466.22
-..LN2977:
-        movl      %eax, -56(%rbp)                               #3466.17
-..LN2979:
-        movl      -56(%rbp), %eax                               #3467.17
-        incl      %eax                                          #3467.17
-        sarl      $16, %eax                                     #3467.17
-        negl      %eax                                          #3467.17
-        movl      %eax, -56(%rbp)                               #3467.17
-                                # LOE
-..B22.16:                       # Preds ..B22.8 ..B22.15
-..LN2981:
-        movdqa    -256(%rbp), %xmm0                             #3470.38
-..LN2983:
-        movdqa    -160(%rbp), %xmm1                             #3470.46
-..LN2985:
-        pand      %xmm1, %xmm0                                  #3470.22
-..LN2987:
-        movdqa    %xmm0, -288(%rbp)                             #3470.17
-..LN2989:
-        movdqa    -288(%rbp), %xmm0                             #3471.22
-        movdqa    -176(%rbp), %xmm1                             #3471.22
-        pcmpeqd   %xmm1, %xmm0                                  #3471.22
-..LN2991:
-        movdqa    %xmm0, -288(%rbp)                             #3471.17
-..LN2993:
-        movdqa    -288(%rbp), %xmm0                             #3472.42
-..LN2995:
-        pmovmskb  %xmm0, %eax                                   #3472.22
-..LN2997:
-        movl      %eax, -60(%rbp)                               #3472.17
-..LN2999:
-        movl      -60(%rbp), %eax                               #3473.17
-        incl      %eax                                          #3473.17
-        sarl      $16, %eax                                     #3473.17
-        negl      %eax                                          #3473.17
-        movl      %eax, -60(%rbp)                               #3473.17
-                                # LOE
-..B22.17:                       # Preds ..B22.9 ..B22.16
-..LN3001:
-        movdqa    -256(%rbp), %xmm0                             #3476.38
-..LN3003:
-        movdqa    -128(%rbp), %xmm1                             #3476.46
-..LN3005:
-        pand      %xmm1, %xmm0                                  #3476.22
-..LN3007:
-        movdqa    %xmm0, -288(%rbp)                             #3476.17
-..LN3009:
-        movdqa    -288(%rbp), %xmm0                             #3477.22
-        movdqa    -144(%rbp), %xmm1                             #3477.22
-        pcmpeqd   %xmm1, %xmm0                                  #3477.22
-..LN3011:
-        movdqa    %xmm0, -288(%rbp)                             #3477.17
-..LN3013:
-        movdqa    -288(%rbp), %xmm0                             #3478.42
-..LN3015:
-        pmovmskb  %xmm0, %eax                                   #3478.22
-..LN3017:
-        movl      %eax, -92(%rbp)                               #3478.17
-..LN3019:
-        movl      -92(%rbp), %eax                               #3479.17
-        incl      %eax                                          #3479.17
-        sarl      $16, %eax                                     #3479.17
-        negl      %eax                                          #3479.17
-        movl      %eax, -92(%rbp)                               #3479.17
-..LN3021:
-        andl      $-4, -16(%rbp)                                #3483.17
-..LN3023:
-        movl      -56(%rbp), %eax                               #3486.29
-        orl       -52(%rbp), %eax                               #3486.29
-..LN3025:
-        orl       -60(%rbp), %eax                               #3486.34
-..LN3027:
-        orl       -92(%rbp), %eax                               #3486.39
-..LN3029:
-        je        ..B22.29      # Prob 50%                      #3486.47
-                                # LOE
-..B22.18:                       # Preds ..B22.17
-..LN3031:
-        movl      -16(%rbp), %eax                               #3489.37
-        negl      %eax                                          #3489.37
-        addl      -64(%rbp), %eax                               #3489.37
-        movl      %eax, -272(%rbp)                              #3489.37
-        cmpl      $2, %eax                                      #3489.37
-        je        ..B22.22      # Prob 50%                      #3489.37
-                                # LOE
-..B22.19:                       # Preds ..B22.18
-        movl      -272(%rbp), %eax                              #3489.37
-        cmpl      $1, %eax                                      #3489.37
-        je        ..B22.24      # Prob 50%                      #3489.37
-                                # LOE
-..B22.20:                       # Preds ..B22.19
-        movl      -272(%rbp), %eax                              #3489.37
-        testl     %eax, %eax                                    #3489.37
-        je        ..B22.26      # Prob 50%                      #3489.37
-                                # LOE
-..B22.21:                       # Preds ..B22.20
-..LN3033:
-        movl      $1, %eax                                      #3492.32
-        leave                                                   #3492.32
-..___tag_value_eval_2na_128.328:                                #
-        ret                                                     #3492.32
-..___tag_value_eval_2na_128.329:                                #
-                                # LOE
-..B22.22:                       # Preds ..B22.18
-..LN3035:
-        movl      -60(%rbp), %eax                               #3494.30
-..LN3037:
-        testl     %eax, %eax                                    #3494.36
-        je        ..B22.24      # Prob 50%                      #3494.36
-                                # LOE
-..B22.23:                       # Preds ..B22.22
-..LN3039:
-        movl      $1, %eax                                      #3494.47
-        leave                                                   #3494.47
-..___tag_value_eval_2na_128.331:                                #
-        ret                                                     #3494.47
-..___tag_value_eval_2na_128.332:                                #
-                                # LOE
-..B22.24:                       # Preds ..B22.22 ..B22.19
-..LN3041:
-        movl      -56(%rbp), %eax                               #3496.30
-..LN3043:
-        testl     %eax, %eax                                    #3496.36
-        je        ..B22.26      # Prob 50%                      #3496.36
-                                # LOE
-..B22.25:                       # Preds ..B22.24
-..LN3045:
-        movl      $1, %eax                                      #3496.47
-        leave                                                   #3496.47
-..___tag_value_eval_2na_128.334:                                #
-        ret                                                     #3496.47
-..___tag_value_eval_2na_128.335:                                #
-                                # LOE
-..B22.26:                       # Preds ..B22.24 ..B22.20
-..LN3047:
-        movl      -52(%rbp), %eax                               #3498.30
-..LN3049:
-        testl     %eax, %eax                                    #3498.36
-        je        ..B22.28      # Prob 50%                      #3498.36
-                                # LOE
-..B22.27:                       # Preds ..B22.26
-..LN3051:
-        movl      $1, %eax                                      #3498.47
-        leave                                                   #3498.47
-..___tag_value_eval_2na_128.337:                                #
-        ret                                                     #3498.47
-..___tag_value_eval_2na_128.338:                                #
-                                # LOE
-..B22.28:                       # Preds ..B22.26
-..LN3053:
-        xorl      %eax, %eax                                    #3500.28
-        leave                                                   #3500.28
-..___tag_value_eval_2na_128.340:                                #
-        ret                                                     #3500.28
-..___tag_value_eval_2na_128.341:                                #
-                                # LOE
-..B22.29:                       # Preds ..B22.17
-..LN3055:
-        addl      $4, -16(%rbp)                                 #3527.17
-..LN3057:
-        movl      -16(%rbp), %eax                               #3530.22
-..LN3059:
-        movl      -64(%rbp), %edx                               #3530.28
-        cmpl      %edx, %eax                                    #3530.28
-        jbe       ..B22.31      # Prob 50%                      #3530.28
-                                # LOE
-..B22.30:                       # Preds ..B22.29
-..LN3061:
-        xorl      %eax, %eax                                    #3531.28
-        leave                                                   #3531.28
-..___tag_value_eval_2na_128.343:                                #
-        ret                                                     #3531.28
-..___tag_value_eval_2na_128.344:                                #
-                                # LOE
-..B22.31:                       # Preds ..B22.29
-..LN3063:
-        movl      -48(%rbp), %eax                               #3534.25
-        decl      %eax                                          #3534.25
-        movl      %eax, -48(%rbp)                               #3534.25
-..LN3065:
-        je        ..B22.36      # Prob 50%                      #3534.39
-                                # LOE
-..B22.32:                       # Preds ..B22.31
-..LN3067:
-        movdqa    -256(%rbp), %xmm0                             #3539.43
-..LN3069:
-        psrldq    $1, %xmm0                                     #3539.26
-..LN3071:
-        movdqa    %xmm0, -256(%rbp)                             #3539.17
-..LN3073:
-        movq      -72(%rbp), %rax                               #3542.22
-..LN3075:
-        movq      -80(%rbp), %rdx                               #3542.26
-        cmpq      %rdx, %rax                                    #3542.26
-        jae       ..B22.34      # Prob 50%                      #3542.26
-                                # LOE
-..B22.33:                       # Preds ..B22.32
-..LN3077:
-        sarl      $8, -96(%rbp)                                 #3544.21
-..LN3079:
-        movq      -72(%rbp), %rax                               #3545.37
-        movzbl    (%rax), %eax                                  #3545.37
-        movzbl    %al, %eax                                     #3545.37
-..LN3081:
-        shll      $8, %eax                                      #3545.48
-..LN3083:
-        orl       -96(%rbp), %eax                               #3545.21
-        movl      %eax, -96(%rbp)                               #3545.21
-..LN3085:
-        movdqa    -256(%rbp), %xmm0                             #3546.49
-..LN3087:
-        movl      -96(%rbp), %eax                               #3546.57
-..LN3089:
-        pinsrw    $7, %eax, %xmm0                               #3546.30
-..LN3091:
-        movdqa    %xmm0, -256(%rbp)                             #3546.21
-                                # LOE
-..B22.34:                       # Preds ..B22.33 ..B22.32
-..LN3093:
-        incq      -72(%rbp)                                     #3550.20
-        jmp       ..B22.12      # Prob 100%                     #3550.20
-                                # LOE
-..B22.36:                       # Preds ..B22.31 ..B22.12
-..LN3095:
-        movq      -88(%rbp), %rax                               #3555.18
-..LN3097:
-        movq      -80(%rbp), %rdx                               #3555.25
-        cmpq      %rdx, %rax                                    #3555.25
-        jae       ..B22.41      # Prob 50%                      #3555.25
-                                # LOE
-..B22.37:                       # Preds ..B22.36
-..LN3099:
-        movl      -16(%rbp), %eax                               #3560.18
-..LN3101:
-        movl      -64(%rbp), %edx                               #3560.24
-        cmpl      %edx, %eax                                    #3560.24
-        ja        ..B22.41      # Prob 50%                      #3560.24
-                                # LOE
-..B22.38:                       # Preds ..B22.37
-..LN3103:
-        movq      -88(%rbp), %rax                               #3565.41
-..LN3105:
-        movq      -80(%rbp), %rdx                               #3565.46
-..LN3107:
-        movq      %rax, %rdi                                    #3565.22
-        movq      %rdx, %rsi                                    #3565.22
-        call      prime_buffer_2na at PLT                          #3565.22
-                                # LOE xmm0
-..B22.45:                       # Preds ..B22.38
-        movdqa    %xmm0, -304(%rbp)                             #3565.22
-                                # LOE
-..B22.39:                       # Preds ..B22.45
-..LN3109:
-        movdqa    -304(%rbp), %xmm0                             #3565.13
-        movdqa    %xmm0, -256(%rbp)                             #3565.13
-..LN3111:
-        addq      $16, -88(%rbp)                                #3643.13
-..LN3113:
-        movq      -88(%rbp), %rax                               #3645.17
-..LN3115:
-        movq      %rax, -72(%rbp)                               #3645.13
-..LN3117:
-        movq      -88(%rbp), %rax                               #3646.18
-..LN3119:
-        movq      -80(%rbp), %rdx                               #3646.24
-        cmpq      %rdx, %rax                                    #3646.24
-        jae       ..B22.10      # Prob 50%                      #3646.24
-                                # LOE
-..B22.40:                       # Preds ..B22.39
-..LN3121:
-        movq      -88(%rbp), %rax                               #3647.32
-        movzbl    -1(%rax), %eax                                #3647.32
-        movzbl    %al, %eax                                     #3647.32
-..LN3123:
-        shll      $8, %eax                                      #3647.46
-..LN3125:
-        movl      %eax, -96(%rbp)                               #3647.17
-        jmp       ..B22.10      # Prob 100%                     #3647.17
-                                # LOE
-..B22.41:                       # Preds ..B22.37 ..B22.36 ..B22.10
-..LN3127:
-        xorl      %eax, %eax                                    #3656.12
-        leave                                                   #3656.12
-..___tag_value_eval_2na_128.346:                                #
-        ret                                                     #3656.12
-        .align    2,0x90
-..___tag_value_eval_2na_128.347:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-.LNeval_2na_128:
-	.data
-# -- End  eval_2na_128
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    2,0x90
-eval_2na_pos:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B23.1:                        # Preds ..B23.0
-..___tag_value_eval_2na_pos.350:                                #
-..LN3129:
-        pushq     %rbp                                          #3662.1
-        movq      %rsp, %rbp                                    #3662.1
-..___tag_value_eval_2na_pos.351:                                #
-        subq      $320, %rsp                                    #3662.1
-        movq      %rdi, -48(%rbp)                               #3662.1
-        movq      %rsi, -40(%rbp)                               #3662.1
-        movl      %edx, -24(%rbp)                               #3662.1
-        movl      %ecx, -16(%rbp)                               #3662.1
-..LN3131:
-        movq      -48(%rbp), %rax                               #3698.25
-        movl      4(%rax), %eax                                 #3698.25
-..LN3133:
-        movl      %eax, -32(%rbp)                               #3698.23
-..LN3135:
-        movl      -16(%rbp), %eax                               #3701.5
-        movl      -32(%rbp), %edx                               #3701.5
-        cmpl      %edx, %eax                                    #3701.5
-        jae       ..B23.3       # Prob 50%                      #3701.5
-                                # LOE
-..B23.2:                        # Preds ..B23.1
-        lea       _2__STRING.9.0(%rip), %rax                    #3701.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #3701.5
-        lea       __$Ua.0(%rip), %rcx                           #3701.5
-        movq      %rax, %rdi                                    #3701.5
-        movq      %rdx, %rsi                                    #3701.5
-        movl      $3701, %edx                                   #3701.5
-        call      __assert_fail at PLT                             #3701.5
-                                # LOE
-..B23.3:                        # Preds ..B23.1
-..LN3137:
-        movl      -24(%rbp), %eax                               #3705.12
-..LN3139:
-        addl      -16(%rbp), %eax                               #3705.5
-        movl      %eax, -16(%rbp)                               #3705.5
-..LN3141:
-        movl      -24(%rbp), %eax                               #3709.13
-..LN3143:
-        movl      %eax, -80(%rbp)                               #3709.5
-..LN3145:
-        movl      -24(%rbp), %eax                               #3713.42
-..LN3147:
-        shrl      $2, %eax                                      #3713.49
-..LN3149:
-        addq      -40(%rbp), %rax                               #3713.30
-..LN3151:
-        movq      %rax, -104(%rbp)                              #3713.5
-..LN3153:
-        movl      -32(%rbp), %eax                               #3716.18
-        negl      %eax                                          #3716.18
-        addl      -16(%rbp), %eax                               #3716.18
-..LN3155:
-        movl      %eax, -76(%rbp)                               #3716.5
-..LN3157:
-        movl      -16(%rbp), %eax                               #3719.44
-..LN3159:
-        addl      $3, %eax                                      #3719.50
-..LN3161:
-        shrl      $2, %eax                                      #3719.57
-..LN3163:
-        addq      -40(%rbp), %rax                               #3719.30
-..LN3165:
-        movq      %rax, -96(%rbp)                               #3719.5
-..LN3167:
-        movq      -104(%rbp), %rax                              #3722.33
-..LN3169:
-        movq      -96(%rbp), %rdx                               #3722.38
-..LN3171:
-        movq      %rax, %rdi                                    #3722.14
-        movq      %rdx, %rsi                                    #3722.14
-        call      prime_buffer_2na at PLT                          #3722.14
-                                # LOE xmm0
-..B23.57:                       # Preds ..B23.3
-        movdqa    %xmm0, -128(%rbp)                             #3722.14
-                                # LOE
-..B23.4:                        # Preds ..B23.57
-..LN3173:
-        movdqa    -128(%rbp), %xmm0                             #3722.5
-        movdqa    %xmm0, -272(%rbp)                             #3722.5
-..LN3175:
-        addq      $16, -104(%rbp)                               #3723.5
-..LN3177:
-        movq      -104(%rbp), %rax                              #3725.9
-..LN3179:
-        movq      %rax, -88(%rbp)                               #3725.5
-..LN3181:
-        movq      -104(%rbp), %rax                              #3728.10
-..LN3183:
-        movq      -96(%rbp), %rdx                               #3728.16
-        cmpq      %rdx, %rax                                    #3728.16
-        jae       ..B23.6       # Prob 50%                      #3728.16
-                                # LOE
-..B23.5:                        # Preds ..B23.4
-..LN3185:
-        movq      -104(%rbp), %rax                              #3729.24
-        movzbl    -1(%rax), %eax                                #3729.24
-        movzbl    %al, %eax                                     #3729.24
-..LN3187:
-        shll      $8, %eax                                      #3729.38
-..LN3189:
-        movl      %eax, -112(%rbp)                              #3729.9
-                                # LOE
-..B23.6:                        # Preds ..B23.5 ..B23.4
-..LN3191:
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    16(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -256(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    32(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -240(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    48(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -224(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    64(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -208(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    80(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -192(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    96(%rax), %xmm0                               #3733.5
-        movdqa    %xmm0, -176(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    112(%rax), %xmm0                              #3733.5
-        movdqa    %xmm0, -160(%rbp)                             #3733.5
-        movq      -48(%rbp), %rax                               #3733.5
-        movdqa    128(%rax), %xmm0                              #3733.5
-        movdqa    %xmm0, -144(%rbp)                             #3733.5
-..LN3193:
-        xorl      %eax, %eax                                    #3736.15
-        movl      %eax, -72(%rbp)                               #3736.15
-..LN3195:
-        movl      %eax, -68(%rbp)                               #3736.10
-..LN3197:
-        movl      %eax, -64(%rbp)                               #3736.5
-..LN3199:
-        movl      -24(%rbp), %eax                               #3738.27
-        negl      %eax                                          #3738.27
-..LN3201:
-        movl      -76(%rbp), %edx                               #3738.20
-..LN3203:
-        lea       7(%rdx,%rax), %eax                            #3738.33
-..LN3205:
-        shrl      $2, %eax                                      #3738.40
-..LN3207:
-        movl      %eax, -60(%rbp)                               #3738.5
-..LN3209:
-        movl      -24(%rbp), %eax                               #3745.14
-..LN3211:
-        andl      $3, %eax                                      #3745.20
-        movl      %eax, -56(%rbp)                               #3745.20
-        je        ..B23.14      # Prob 50%                      #3745.20
-                                # LOE
-..B23.7:                        # Preds ..B23.6
-        movl      -56(%rbp), %eax                               #3745.20
-        cmpl      $1, %eax                                      #3745.20
-        je        ..B23.15      # Prob 50%                      #3745.20
-                                # LOE
-..B23.8:                        # Preds ..B23.7
-        movl      -56(%rbp), %eax                               #3745.20
-        cmpl      $2, %eax                                      #3745.20
-        je        ..B23.16      # Prob 50%                      #3745.20
-                                # LOE
-..B23.9:                        # Preds ..B23.8
-        movl      -56(%rbp), %eax                               #3745.20
-        cmpl      $3, %eax                                      #3745.20
-        je        ..B23.17      # Prob 50%                      #3745.20
-                                # LOE
-..B23.10:                       # Preds ..B23.53 ..B23.52 ..B23.9
-..LN3213:
-        movl      $1, %eax                                      #3750.9
-        testl     %eax, %eax                                    #3750.9
-        je        ..B23.54      # Prob 100%                     #3750.9
-                                # LOE
-..B23.11:                       # Preds ..B23.10
-..LN3215:
-        movl      $16, -60(%rbp)                                #3752.13
-                                # LOE
-..B23.12:                       # Preds ..B23.47 ..B23.11
-..LN3217:
-        movl      $1, %eax                                      #3755.13
-        testl     %eax, %eax                                    #3755.13
-        je        ..B23.49      # Prob 100%                     #3755.13
-                                # LOE
-..B23.14:                       # Preds ..B23.6 ..B23.12
-..LN3219:
-        movdqa    -272(%rbp), %xmm0                             #3762.38
-..LN3221:
-        movdqa    -240(%rbp), %xmm1                             #3762.46
-..LN3223:
-        pand      %xmm1, %xmm0                                  #3762.22
-..LN3225:
-        movdqa    %xmm0, -304(%rbp)                             #3762.17
-..LN3227:
-        movdqa    -304(%rbp), %xmm0                             #3763.22
-        movdqa    -256(%rbp), %xmm1                             #3763.22
-        pcmpeqd   %xmm1, %xmm0                                  #3763.22
-..LN3229:
-        movdqa    %xmm0, -304(%rbp)                             #3763.17
-..LN3231:
-        movdqa    -304(%rbp), %xmm0                             #3764.42
-..LN3233:
-        pmovmskb  %xmm0, %eax                                   #3764.22
-..LN3235:
-        movl      %eax, -64(%rbp)                               #3764.17
-..LN3237:
-        movl      -64(%rbp), %eax                               #3765.17
-        incl      %eax                                          #3765.17
-        sarl      $16, %eax                                     #3765.17
-        negl      %eax                                          #3765.17
-        movl      %eax, -64(%rbp)                               #3765.17
-                                # LOE
-..B23.15:                       # Preds ..B23.7 ..B23.14
-..LN3239:
-        movdqa    -272(%rbp), %xmm0                             #3768.38
-..LN3241:
-        movdqa    -208(%rbp), %xmm1                             #3768.46
-..LN3243:
-        pand      %xmm1, %xmm0                                  #3768.22
-..LN3245:
-        movdqa    %xmm0, -304(%rbp)                             #3768.17
-..LN3247:
-        movdqa    -304(%rbp), %xmm0                             #3769.22
-        movdqa    -224(%rbp), %xmm1                             #3769.22
-        pcmpeqd   %xmm1, %xmm0                                  #3769.22
-..LN3249:
-        movdqa    %xmm0, -304(%rbp)                             #3769.17
-..LN3251:
-        movdqa    -304(%rbp), %xmm0                             #3770.42
-..LN3253:
-        pmovmskb  %xmm0, %eax                                   #3770.22
-..LN3255:
-        movl      %eax, -68(%rbp)                               #3770.17
-..LN3257:
-        movl      -68(%rbp), %eax                               #3771.17
-        incl      %eax                                          #3771.17
-        sarl      $16, %eax                                     #3771.17
-        negl      %eax                                          #3771.17
-        movl      %eax, -68(%rbp)                               #3771.17
-                                # LOE
-..B23.16:                       # Preds ..B23.8 ..B23.15
-..LN3259:
-        movdqa    -272(%rbp), %xmm0                             #3774.38
-..LN3261:
-        movdqa    -176(%rbp), %xmm1                             #3774.46
-..LN3263:
-        pand      %xmm1, %xmm0                                  #3774.22
-..LN3265:
-        movdqa    %xmm0, -304(%rbp)                             #3774.17
-..LN3267:
-        movdqa    -304(%rbp), %xmm0                             #3775.22
-        movdqa    -192(%rbp), %xmm1                             #3775.22
-        pcmpeqd   %xmm1, %xmm0                                  #3775.22
-..LN3269:
-        movdqa    %xmm0, -304(%rbp)                             #3775.17
-..LN3271:
-        movdqa    -304(%rbp), %xmm0                             #3776.42
-..LN3273:
-        pmovmskb  %xmm0, %eax                                   #3776.22
-..LN3275:
-        movl      %eax, -72(%rbp)                               #3776.17
-..LN3277:
-        movl      -72(%rbp), %eax                               #3777.17
-        incl      %eax                                          #3777.17
-        sarl      $16, %eax                                     #3777.17
-        negl      %eax                                          #3777.17
-        movl      %eax, -72(%rbp)                               #3777.17
-                                # LOE
-..B23.17:                       # Preds ..B23.9 ..B23.16
-..LN3279:
-        movdqa    -272(%rbp), %xmm0                             #3780.38
-..LN3281:
-        movdqa    -144(%rbp), %xmm1                             #3780.46
-..LN3283:
-        pand      %xmm1, %xmm0                                  #3780.22
-..LN3285:
-        movdqa    %xmm0, -304(%rbp)                             #3780.17
-..LN3287:
-        movdqa    -304(%rbp), %xmm0                             #3781.22
-        movdqa    -160(%rbp), %xmm1                             #3781.22
-        pcmpeqd   %xmm1, %xmm0                                  #3781.22
-..LN3289:
-        movdqa    %xmm0, -304(%rbp)                             #3781.17
-..LN3291:
-        movdqa    -304(%rbp), %xmm0                             #3782.42
-..LN3293:
-        pmovmskb  %xmm0, %eax                                   #3782.22
-..LN3295:
-        movl      %eax, -108(%rbp)                              #3782.17
-..LN3297:
-        movl      -108(%rbp), %eax                              #3783.17
-        incl      %eax                                          #3783.17
-        sarl      $16, %eax                                     #3783.17
-        negl      %eax                                          #3783.17
-        movl      %eax, -108(%rbp)                              #3783.17
-..LN3299:
-        andl      $-4, -24(%rbp)                                #3787.17
-..LN3301:
-        movl      -68(%rbp), %eax                               #3790.29
-        orl       -64(%rbp), %eax                               #3790.29
-..LN3303:
-        orl       -72(%rbp), %eax                               #3790.34
-..LN3305:
-        orl       -108(%rbp), %eax                              #3790.39
-..LN3307:
-        je        ..B23.42      # Prob 50%                      #3790.47
-                                # LOE
-..B23.18:                       # Preds ..B23.17
-..LN3309:
-        movl      -24(%rbp), %eax                               #3793.37
-        negl      %eax                                          #3793.37
-        addl      -76(%rbp), %eax                               #3793.37
-        movl      %eax, -288(%rbp)                              #3793.37
-        je        ..B23.21      # Prob 50%                      #3793.37
-                                # LOE
-..B23.19:                       # Preds ..B23.18
-        movl      -288(%rbp), %eax                              #3793.37
-        cmpl      $1, %eax                                      #3793.37
-        je        ..B23.23      # Prob 50%                      #3793.37
-                                # LOE
-..B23.20:                       # Preds ..B23.19
-        movl      -288(%rbp), %eax                              #3793.37
-        cmpl      $2, %eax                                      #3793.37
-        je        ..B23.27      # Prob 50%                      #3793.37
-        jmp       ..B23.33      # Prob 100%                     #3793.37
-                                # LOE
-..B23.21:                       # Preds ..B23.18
-..LN3311:
-        movl      -64(%rbp), %eax                               #3796.30
-..LN3313:
-        testl     %eax, %eax                                    #3796.36
-        je        ..B23.41      # Prob 50%                      #3796.36
-                                # LOE
-..B23.22:                       # Preds ..B23.21
-..LN3315:
-        movl      -80(%rbp), %eax                               #3796.53
-        negl      %eax                                          #3796.53
-..LN3317:
-        movl      -24(%rbp), %edx                               #3796.47
-..LN3319:
-        lea       1(%rdx,%rax), %eax                            #3796.61
-        leave                                                   #3796.61
-..___tag_value_eval_2na_pos.355:                                #
-        ret                                                     #3796.61
-..___tag_value_eval_2na_pos.356:                                #
-                                # LOE
-..B23.23:                       # Preds ..B23.19
-..LN3321:
-        movl      -64(%rbp), %eax                               #3799.30
-..LN3323:
-        testl     %eax, %eax                                    #3799.36
-        je        ..B23.25      # Prob 50%                      #3799.36
-                                # LOE
-..B23.24:                       # Preds ..B23.23
-..LN3325:
-        movl      -80(%rbp), %eax                               #3799.53
-        negl      %eax                                          #3799.53
-..LN3327:
-        movl      -24(%rbp), %edx                               #3799.47
-..LN3329:
-        lea       1(%rdx,%rax), %eax                            #3799.61
-        leave                                                   #3799.61
-..___tag_value_eval_2na_pos.358:                                #
-        ret                                                     #3799.61
-..___tag_value_eval_2na_pos.359:                                #
-                                # LOE
-..B23.25:                       # Preds ..B23.23
-..LN3331:
-        movl      -68(%rbp), %eax                               #3800.30
-..LN3333:
-        testl     %eax, %eax                                    #3800.36
-        je        ..B23.41      # Prob 50%                      #3800.36
-                                # LOE
-..B23.26:                       # Preds ..B23.25
-..LN3335:
-        movl      -80(%rbp), %eax                               #3800.53
-        negl      %eax                                          #3800.53
-..LN3337:
-        movl      -24(%rbp), %edx                               #3800.47
-..LN3339:
-        lea       2(%rdx,%rax), %eax                            #3800.61
-        leave                                                   #3800.61
-..___tag_value_eval_2na_pos.361:                                #
-        ret                                                     #3800.61
-..___tag_value_eval_2na_pos.362:                                #
-                                # LOE
-..B23.27:                       # Preds ..B23.20
-..LN3341:
-        movl      -64(%rbp), %eax                               #3803.30
-..LN3343:
-        testl     %eax, %eax                                    #3803.36
-        je        ..B23.29      # Prob 50%                      #3803.36
-                                # LOE
-..B23.28:                       # Preds ..B23.27
-..LN3345:
-        movl      -80(%rbp), %eax                               #3803.53
-        negl      %eax                                          #3803.53
-..LN3347:
-        movl      -24(%rbp), %edx                               #3803.47
-..LN3349:
-        lea       1(%rdx,%rax), %eax                            #3803.61
-        leave                                                   #3803.61
-..___tag_value_eval_2na_pos.364:                                #
-        ret                                                     #3803.61
-..___tag_value_eval_2na_pos.365:                                #
-                                # LOE
-..B23.29:                       # Preds ..B23.27
-..LN3351:
-        movl      -68(%rbp), %eax                               #3804.30
-..LN3353:
-        testl     %eax, %eax                                    #3804.36
-        je        ..B23.31      # Prob 50%                      #3804.36
-                                # LOE
-..B23.30:                       # Preds ..B23.29
-..LN3355:
-        movl      -80(%rbp), %eax                               #3804.53
-        negl      %eax                                          #3804.53
-..LN3357:
-        movl      -24(%rbp), %edx                               #3804.47
-..LN3359:
-        lea       2(%rdx,%rax), %eax                            #3804.61
-        leave                                                   #3804.61
-..___tag_value_eval_2na_pos.367:                                #
-        ret                                                     #3804.61
-..___tag_value_eval_2na_pos.368:                                #
-                                # LOE
-..B23.31:                       # Preds ..B23.29
-..LN3361:
-        movl      -72(%rbp), %eax                               #3805.30
-..LN3363:
-        testl     %eax, %eax                                    #3805.36
-        je        ..B23.41      # Prob 50%                      #3805.36
-                                # LOE
-..B23.32:                       # Preds ..B23.31
-..LN3365:
-        movl      -80(%rbp), %eax                               #3805.53
-        negl      %eax                                          #3805.53
-..LN3367:
-        movl      -24(%rbp), %edx                               #3805.47
-..LN3369:
-        lea       3(%rdx,%rax), %eax                            #3805.61
-        leave                                                   #3805.61
-..___tag_value_eval_2na_pos.370:                                #
-        ret                                                     #3805.61
-..___tag_value_eval_2na_pos.371:                                #
-                                # LOE
-..B23.33:                       # Preds ..B23.20
-..LN3371:
-        movl      -64(%rbp), %eax                               #3808.30
-..LN3373:
-        testl     %eax, %eax                                    #3808.36
-        je        ..B23.35      # Prob 50%                      #3808.36
-                                # LOE
-..B23.34:                       # Preds ..B23.33
-..LN3375:
-        movl      -80(%rbp), %eax                               #3808.53
-        negl      %eax                                          #3808.53
-..LN3377:
-        movl      -24(%rbp), %edx                               #3808.47
-..LN3379:
-        lea       1(%rdx,%rax), %eax                            #3808.61
-        leave                                                   #3808.61
-..___tag_value_eval_2na_pos.373:                                #
-        ret                                                     #3808.61
-..___tag_value_eval_2na_pos.374:                                #
-                                # LOE
-..B23.35:                       # Preds ..B23.33
-..LN3381:
-        movl      -68(%rbp), %eax                               #3809.30
-..LN3383:
-        testl     %eax, %eax                                    #3809.36
-        je        ..B23.37      # Prob 50%                      #3809.36
-                                # LOE
-..B23.36:                       # Preds ..B23.35
-..LN3385:
-        movl      -80(%rbp), %eax                               #3809.53
-        negl      %eax                                          #3809.53
-..LN3387:
-        movl      -24(%rbp), %edx                               #3809.47
-..LN3389:
-        lea       2(%rdx,%rax), %eax                            #3809.61
-        leave                                                   #3809.61
-..___tag_value_eval_2na_pos.376:                                #
-        ret                                                     #3809.61
-..___tag_value_eval_2na_pos.377:                                #
-                                # LOE
-..B23.37:                       # Preds ..B23.35
-..LN3391:
-        movl      -72(%rbp), %eax                               #3810.30
-..LN3393:
-        testl     %eax, %eax                                    #3810.36
-        je        ..B23.39      # Prob 50%                      #3810.36
-                                # LOE
-..B23.38:                       # Preds ..B23.37
-..LN3395:
-        movl      -80(%rbp), %eax                               #3810.53
-        negl      %eax                                          #3810.53
-..LN3397:
-        movl      -24(%rbp), %edx                               #3810.47
-..LN3399:
-        lea       3(%rdx,%rax), %eax                            #3810.61
-        leave                                                   #3810.61
-..___tag_value_eval_2na_pos.379:                                #
-        ret                                                     #3810.61
-..___tag_value_eval_2na_pos.380:                                #
-                                # LOE
-..B23.39:                       # Preds ..B23.37
-..LN3401:
-        movl      -108(%rbp), %eax                              #3811.30
-..LN3403:
-        testl     %eax, %eax                                    #3811.36
-        je        ..B23.41      # Prob 50%                      #3811.36
-                                # LOE
-..B23.40:                       # Preds ..B23.39
-..LN3405:
-        movl      -80(%rbp), %eax                               #3811.53
-        negl      %eax                                          #3811.53
-..LN3407:
-        movl      -24(%rbp), %edx                               #3811.47
-..LN3409:
-        lea       4(%rdx,%rax), %eax                            #3811.61
-        leave                                                   #3811.61
-..___tag_value_eval_2na_pos.382:                                #
-        ret                                                     #3811.61
-..___tag_value_eval_2na_pos.383:                                #
-                                # LOE
-..B23.41:                       # Preds ..B23.21 ..B23.25 ..B23.31 ..B23.39
-..LN3411:
-        xorl      %eax, %eax                                    #3813.28
-        leave                                                   #3813.28
-..___tag_value_eval_2na_pos.385:                                #
-        ret                                                     #3813.28
-..___tag_value_eval_2na_pos.386:                                #
-                                # LOE
-..B23.42:                       # Preds ..B23.17
-..LN3413:
-        addl      $4, -24(%rbp)                                 #3853.17
-..LN3415:
-        movl      -24(%rbp), %eax                               #3856.22
-..LN3417:
-        movl      -76(%rbp), %edx                               #3856.28
-        cmpl      %edx, %eax                                    #3856.28
-        jbe       ..B23.44      # Prob 50%                      #3856.28
-                                # LOE
-..B23.43:                       # Preds ..B23.42
-..LN3419:
-        xorl      %eax, %eax                                    #3857.28
-        leave                                                   #3857.28
-..___tag_value_eval_2na_pos.388:                                #
-        ret                                                     #3857.28
-..___tag_value_eval_2na_pos.389:                                #
-                                # LOE
-..B23.44:                       # Preds ..B23.42
-..LN3421:
-        movl      -60(%rbp), %eax                               #3860.25
-        decl      %eax                                          #3860.25
-        movl      %eax, -60(%rbp)                               #3860.25
-..LN3423:
-        je        ..B23.49      # Prob 50%                      #3860.39
-                                # LOE
-..B23.45:                       # Preds ..B23.44
-..LN3425:
-        movdqa    -272(%rbp), %xmm0                             #3865.43
-..LN3427:
-        psrldq    $1, %xmm0                                     #3865.26
-..LN3429:
-        movdqa    %xmm0, -272(%rbp)                             #3865.17
-..LN3431:
-        movq      -88(%rbp), %rax                               #3868.22
-..LN3433:
-        movq      -96(%rbp), %rdx                               #3868.26
-        cmpq      %rdx, %rax                                    #3868.26
-        jae       ..B23.47      # Prob 50%                      #3868.26
-                                # LOE
-..B23.46:                       # Preds ..B23.45
-..LN3435:
-        sarl      $8, -112(%rbp)                                #3870.21
-..LN3437:
-        movq      -88(%rbp), %rax                               #3871.37
-        movzbl    (%rax), %eax                                  #3871.37
-        movzbl    %al, %eax                                     #3871.37
-..LN3439:
-        shll      $8, %eax                                      #3871.48
-..LN3441:
-        orl       -112(%rbp), %eax                              #3871.21
-        movl      %eax, -112(%rbp)                              #3871.21
-..LN3443:
-        movdqa    -272(%rbp), %xmm0                             #3872.49
-..LN3445:
-        movl      -112(%rbp), %eax                              #3872.57
-..LN3447:
-        pinsrw    $7, %eax, %xmm0                               #3872.30
-..LN3449:
-        movdqa    %xmm0, -272(%rbp)                             #3872.21
-                                # LOE
-..B23.47:                       # Preds ..B23.46 ..B23.45
-..LN3451:
-        incq      -88(%rbp)                                     #3876.20
-        jmp       ..B23.12      # Prob 100%                     #3876.20
-                                # LOE
-..B23.49:                       # Preds ..B23.44 ..B23.12
-..LN3453:
-        movq      -104(%rbp), %rax                              #3881.18
-..LN3455:
-        movq      -96(%rbp), %rdx                               #3881.25
-        cmpq      %rdx, %rax                                    #3881.25
-        jae       ..B23.54      # Prob 50%                      #3881.25
-                                # LOE
-..B23.50:                       # Preds ..B23.49
-..LN3457:
-        movl      -24(%rbp), %eax                               #3886.18
-..LN3459:
-        movl      -76(%rbp), %edx                               #3886.24
-        cmpl      %edx, %eax                                    #3886.24
-        ja        ..B23.54      # Prob 50%                      #3886.24
-                                # LOE
-..B23.51:                       # Preds ..B23.50
-..LN3461:
-        movq      -104(%rbp), %rax                              #3891.41
-..LN3463:
-        movq      -96(%rbp), %rdx                               #3891.46
-..LN3465:
-        movq      %rax, %rdi                                    #3891.22
-        movq      %rdx, %rsi                                    #3891.22
-        call      prime_buffer_2na at PLT                          #3891.22
-                                # LOE xmm0
-..B23.58:                       # Preds ..B23.51
-        movdqa    %xmm0, -320(%rbp)                             #3891.22
-                                # LOE
-..B23.52:                       # Preds ..B23.58
-..LN3467:
-        movdqa    -320(%rbp), %xmm0                             #3891.13
-        movdqa    %xmm0, -272(%rbp)                             #3891.13
-..LN3469:
-        addq      $16, -104(%rbp)                               #3969.13
-..LN3471:
-        movq      -104(%rbp), %rax                              #3971.17
-..LN3473:
-        movq      %rax, -88(%rbp)                               #3971.13
-..LN3475:
-        movq      -104(%rbp), %rax                              #3972.18
-..LN3477:
-        movq      -96(%rbp), %rdx                               #3972.24
-        cmpq      %rdx, %rax                                    #3972.24
-        jae       ..B23.10      # Prob 50%                      #3972.24
-                                # LOE
-..B23.53:                       # Preds ..B23.52
-..LN3479:
-        movq      -104(%rbp), %rax                              #3973.32
-        movzbl    -1(%rax), %eax                                #3973.32
-        movzbl    %al, %eax                                     #3973.32
-..LN3481:
-        shll      $8, %eax                                      #3973.46
-..LN3483:
-        movl      %eax, -112(%rbp)                              #3973.17
-        jmp       ..B23.10      # Prob 100%                     #3973.17
-                                # LOE
-..B23.54:                       # Preds ..B23.50 ..B23.49 ..B23.10
-..LN3485:
-        xorl      %eax, %eax                                    #3983.12
-        leave                                                   #3983.12
-..___tag_value_eval_2na_pos.391:                                #
-        ret                                                     #3983.12
-        .align    2,0x90
-..___tag_value_eval_2na_pos.392:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-.LNeval_2na_pos:
-	.data
-# -- End  eval_2na_pos
-	.text
-# -- Begin  prime_buffer_4na
-# mark_begin;
-       .align    2,0x90
-prime_buffer_4na:
-# parameter 1(src): %rdi
-# parameter 2(ignore): %rsi
-..B24.1:                        # Preds ..B24.0
-..___tag_value_prime_buffer_4na.395:                            #
-..LN3487:
-        pushq     %rbp                                          #3990.1
-        movq      %rsp, %rbp                                    #3990.1
-..___tag_value_prime_buffer_4na.396:                            #
-        subq      $48, %rsp                                     #3990.1
-        movq      %rdi, -16(%rbp)                               #3990.1
-        movq      %rsi, -8(%rbp)                                #3990.1
-..LN3489:
-        movq      -16(%rbp), %rax                               #3996.34
-        movzbl    (%rax), %eax                                  #3996.34
-        movzbl    %al, %eax                                     #3996.34
-..LN3491:
-        movslq    %eax, %rax                                    #3996.21
-        lea       expand_2na.0(%rip), %rdx                      #3996.21
-        movzwl    (%rdx,%rax,2), %eax                           #3996.21
-..LN3493:
-        movw      %ax, -48(%rbp)                                #3996.5
-..LN3495:
-        movq      -16(%rbp), %rax                               #3997.34
-        movzbl    1(%rax), %eax                                 #3997.34
-        movzbl    %al, %eax                                     #3997.34
-..LN3497:
-        movslq    %eax, %rax                                    #3997.21
-        lea       expand_2na.0(%rip), %rdx                      #3997.21
-        movzwl    (%rdx,%rax,2), %eax                           #3997.21
-..LN3499:
-        movw      %ax, -46(%rbp)                                #3997.5
-..LN3501:
-        movq      -16(%rbp), %rax                               #3998.34
-        movzbl    2(%rax), %eax                                 #3998.34
-        movzbl    %al, %eax                                     #3998.34
-..LN3503:
-        movslq    %eax, %rax                                    #3998.21
-        lea       expand_2na.0(%rip), %rdx                      #3998.21
-        movzwl    (%rdx,%rax,2), %eax                           #3998.21
-..LN3505:
-        movw      %ax, -44(%rbp)                                #3998.5
-..LN3507:
-        movq      -16(%rbp), %rax                               #3999.34
-        movzbl    3(%rax), %eax                                 #3999.34
-        movzbl    %al, %eax                                     #3999.34
-..LN3509:
-        movslq    %eax, %rax                                    #3999.21
-        lea       expand_2na.0(%rip), %rdx                      #3999.21
-        movzwl    (%rdx,%rax,2), %eax                           #3999.21
-..LN3511:
-        movw      %ax, -42(%rbp)                                #3999.5
-..LN3513:
-        movq      -16(%rbp), %rax                               #4000.34
-        movzbl    4(%rax), %eax                                 #4000.34
-        movzbl    %al, %eax                                     #4000.34
-..LN3515:
-        movslq    %eax, %rax                                    #4000.21
-        lea       expand_2na.0(%rip), %rdx                      #4000.21
-        movzwl    (%rdx,%rax,2), %eax                           #4000.21
-..LN3517:
-        movw      %ax, -40(%rbp)                                #4000.5
-..LN3519:
-        movq      -16(%rbp), %rax                               #4001.34
-        movzbl    5(%rax), %eax                                 #4001.34
-        movzbl    %al, %eax                                     #4001.34
-..LN3521:
-        movslq    %eax, %rax                                    #4001.21
-        lea       expand_2na.0(%rip), %rdx                      #4001.21
-        movzwl    (%rdx,%rax,2), %eax                           #4001.21
-..LN3523:
-        movw      %ax, -38(%rbp)                                #4001.5
-..LN3525:
-        movq      -16(%rbp), %rax                               #4002.34
-        movzbl    6(%rax), %eax                                 #4002.34
-        movzbl    %al, %eax                                     #4002.34
-..LN3527:
-        movslq    %eax, %rax                                    #4002.21
-        lea       expand_2na.0(%rip), %rdx                      #4002.21
-        movzwl    (%rdx,%rax,2), %eax                           #4002.21
-..LN3529:
-        movw      %ax, -36(%rbp)                                #4002.5
-..LN3531:
-        movq      -16(%rbp), %rax                               #4003.34
-        movzbl    7(%rax), %eax                                 #4003.34
-        movzbl    %al, %eax                                     #4003.34
-..LN3533:
-        movslq    %eax, %rax                                    #4003.21
-        lea       expand_2na.0(%rip), %rdx                      #4003.21
-        movzwl    (%rdx,%rax,2), %eax                           #4003.21
-..LN3535:
-        movw      %ax, -34(%rbp)                                #4003.5
-..LN3537:
-        movdqu    -48(%rbp), %xmm0                              #4005.51
-..LN3539:
-        movdqa    %xmm0, -32(%rbp)                              #4005.5
-..LN3541:
-        movdqa    -32(%rbp), %xmm0                              #4006.12
-        leave                                                   #4006.12
-..___tag_value_prime_buffer_4na.400:                            #
-        ret                                                     #4006.12
-        .align    2,0x90
-..___tag_value_prime_buffer_4na.401:                            #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_4na, at function
-	.size	prime_buffer_4na,.-prime_buffer_4na
-.LNprime_buffer_4na:
-	.data
-# -- End  prime_buffer_4na
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    2,0x90
-eval_4na_16:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B25.1:                        # Preds ..B25.0
-..___tag_value_eval_4na_16.404:                                 #
-..LN3543:
-        pushq     %rbp                                          #4057.1
-        movq      %rsp, %rbp                                    #4057.1
-..___tag_value_eval_4na_16.405:                                 #
-        subq      $336, %rsp                                    #4057.1
-        movq      %rdi, -48(%rbp)                               #4057.1
-        movq      %rsi, -40(%rbp)                               #4057.1
-        movl      %edx, -24(%rbp)                               #4057.1
-        movl      %ecx, -16(%rbp)                               #4057.1
-..LN3545:
-        movq      -48(%rbp), %rax                               #4083.25
-        movl      4(%rax), %eax                                 #4083.25
-..LN3547:
-        movl      %eax, -32(%rbp)                               #4083.23
-..LN3549:
-        movl      -16(%rbp), %eax                               #4086.5
-        movl      -32(%rbp), %edx                               #4086.5
-        cmpl      %edx, %eax                                    #4086.5
-        jae       ..B25.3       # Prob 50%                      #4086.5
-                                # LOE
-..B25.2:                        # Preds ..B25.1
-        lea       _2__STRING.9.0(%rip), %rax                    #4086.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #4086.5
-        lea       __$Ub.0(%rip), %rcx                           #4086.5
-        movq      %rax, %rdi                                    #4086.5
-        movq      %rdx, %rsi                                    #4086.5
-        movl      $4086, %edx                                   #4086.5
-        call      __assert_fail at PLT                             #4086.5
-                                # LOE
-..B25.3:                        # Preds ..B25.1
-..LN3551:
-        movl      -24(%rbp), %eax                               #4090.12
-..LN3553:
-        addl      -16(%rbp), %eax                               #4090.5
-        movl      %eax, -16(%rbp)                               #4090.5
-..LN3555:
-        movl      -24(%rbp), %eax                               #4093.42
-..LN3557:
-        shrl      $2, %eax                                      #4093.49
-..LN3559:
-        addq      -40(%rbp), %rax                               #4093.30
-..LN3561:
-        movq      %rax, -96(%rbp)                               #4093.5
-..LN3563:
-        movl      -32(%rbp), %eax                               #4096.18
-        negl      %eax                                          #4096.18
-        addl      -16(%rbp), %eax                               #4096.18
-..LN3565:
-        movl      %eax, -76(%rbp)                               #4096.5
-..LN3567:
-        movl      -16(%rbp), %eax                               #4099.44
-..LN3569:
-        addl      $3, %eax                                      #4099.50
-..LN3571:
-        shrl      $2, %eax                                      #4099.57
-..LN3573:
-        addq      -40(%rbp), %rax                               #4099.30
-..LN3575:
-        movq      %rax, -88(%rbp)                               #4099.5
-..LN3577:
-        movq      -96(%rbp), %rax                               #4102.33
-..LN3579:
-        movq      -88(%rbp), %rdx                               #4102.38
-..LN3581:
-        movq      %rax, %rdi                                    #4102.14
-        movq      %rdx, %rsi                                    #4102.14
-        call      prime_buffer_4na at PLT                          #4102.14
-                                # LOE xmm0
-..B25.43:                       # Preds ..B25.3
-        movdqa    %xmm0, -144(%rbp)                             #4102.14
-                                # LOE
-..B25.4:                        # Preds ..B25.43
-..LN3583:
-        movdqa    -144(%rbp), %xmm0                             #4102.5
-        movdqa    %xmm0, -288(%rbp)                             #4102.5
-..LN3585:
-        addq      $8, -96(%rbp)                                 #4103.5
-..LN3587:
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    16(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -272(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    32(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -256(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    48(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -240(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    64(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -224(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    80(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -208(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    96(%rax), %xmm0                               #4109.5
-        movdqa    %xmm0, -192(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    112(%rax), %xmm0                              #4109.5
-        movdqa    %xmm0, -176(%rbp)                             #4109.5
-        movq      -48(%rbp), %rax                               #4109.5
-        movdqa    128(%rax), %xmm0                              #4109.5
-        movdqa    %xmm0, -160(%rbp)                             #4109.5
-..LN3589:
-        xorl      %eax, %eax                                    #4112.15
-        movl      %eax, -72(%rbp)                               #4112.15
-..LN3591:
-        movl      %eax, -68(%rbp)                               #4112.10
-..LN3593:
-        movl      %eax, -64(%rbp)                               #4112.5
-..LN3595:
-        movl      $1, -60(%rbp)                                 #4118.5
-..LN3597:
-        movl      -24(%rbp), %eax                               #4123.14
-..LN3599:
-        andl      $3, %eax                                      #4123.20
-        movl      %eax, -56(%rbp)                               #4123.20
-        je        ..B25.12      # Prob 50%                      #4123.20
-                                # LOE
-..B25.5:                        # Preds ..B25.4
-        movl      -56(%rbp), %eax                               #4123.20
-        cmpl      $1, %eax                                      #4123.20
-        je        ..B25.13      # Prob 50%                      #4123.20
-                                # LOE
-..B25.6:                        # Preds ..B25.5
-        movl      -56(%rbp), %eax                               #4123.20
-        cmpl      $2, %eax                                      #4123.20
-        je        ..B25.14      # Prob 50%                      #4123.20
-                                # LOE
-..B25.7:                        # Preds ..B25.6
-        movl      -56(%rbp), %eax                               #4123.20
-        cmpl      $3, %eax                                      #4123.20
-        je        ..B25.15      # Prob 50%                      #4123.20
-                                # LOE
-..B25.8:                        # Preds ..B25.39 ..B25.7
-..LN3601:
-        movl      $1, %eax                                      #4128.9
-        testl     %eax, %eax                                    #4128.9
-        je        ..B25.40      # Prob 100%                     #4128.9
-                                # LOE
-..B25.9:                        # Preds ..B25.8
-..LN3603:
-        movl      $1, -60(%rbp)                                 #4130.13
-                                # LOE
-..B25.10:                       # Preds ..B25.34 ..B25.9
-..LN3605:
-        movl      $1, %eax                                      #4133.13
-        testl     %eax, %eax                                    #4133.13
-        je        ..B25.36      # Prob 100%                     #4133.13
-                                # LOE
-..B25.12:                       # Preds ..B25.4 ..B25.10
-..LN3607:
-        movdqa    -288(%rbp), %xmm0                             #4140.38
-..LN3609:
-        movdqa    -272(%rbp), %xmm1                             #4140.46
-..LN3611:
-        pand      %xmm1, %xmm0                                  #4140.22
-..LN3613:
-        movdqa    %xmm0, -320(%rbp)                             #4140.17
-..LN3615:
-        movdqa    -288(%rbp), %xmm0                             #4141.38
-..LN3617:
-        movdqa    -256(%rbp), %xmm1                             #4141.46
-..LN3619:
-        pand      %xmm1, %xmm0                                  #4141.22
-..LN3621:
-        movdqa    %xmm0, -304(%rbp)                             #4141.17
-..LN3623:
-        movdqa    -320(%rbp), %xmm0                             #4142.22
-        movdqa    -304(%rbp), %xmm1                             #4142.22
-        pcmpeqw   %xmm1, %xmm0                                  #4142.22
-..LN3625:
-        movdqa    %xmm0, -320(%rbp)                             #4142.17
-..LN3627:
-        movdqa    -320(%rbp), %xmm0                             #4143.42
-..LN3629:
-        pmovmskb  %xmm0, %eax                                   #4143.22
-..LN3631:
-        movl      %eax, -64(%rbp)                               #4143.17
-                                # LOE
-..B25.13:                       # Preds ..B25.5 ..B25.12
-..LN3633:
-        movdqa    -288(%rbp), %xmm0                             #4147.38
-..LN3635:
-        movdqa    -240(%rbp), %xmm1                             #4147.46
-..LN3637:
-        pand      %xmm1, %xmm0                                  #4147.22
-..LN3639:
-        movdqa    %xmm0, -320(%rbp)                             #4147.17
-..LN3641:
-        movdqa    -288(%rbp), %xmm0                             #4148.38
-..LN3643:
-        movdqa    -224(%rbp), %xmm1                             #4148.46
-..LN3645:
-        pand      %xmm1, %xmm0                                  #4148.22
-..LN3647:
-        movdqa    %xmm0, -304(%rbp)                             #4148.17
-..LN3649:
-        movdqa    -320(%rbp), %xmm0                             #4149.22
-        movdqa    -304(%rbp), %xmm1                             #4149.22
-        pcmpeqw   %xmm1, %xmm0                                  #4149.22
-..LN3651:
-        movdqa    %xmm0, -320(%rbp)                             #4149.17
-..LN3653:
-        movdqa    -320(%rbp), %xmm0                             #4150.42
-..LN3655:
-        pmovmskb  %xmm0, %eax                                   #4150.22
-..LN3657:
-        movl      %eax, -68(%rbp)                               #4150.17
-                                # LOE
-..B25.14:                       # Preds ..B25.6 ..B25.13
-..LN3659:
-        movdqa    -288(%rbp), %xmm0                             #4154.38
-..LN3661:
-        movdqa    -208(%rbp), %xmm1                             #4154.46
-..LN3663:
-        pand      %xmm1, %xmm0                                  #4154.22
-..LN3665:
-        movdqa    %xmm0, -320(%rbp)                             #4154.17
-..LN3667:
-        movdqa    -288(%rbp), %xmm0                             #4155.38
-..LN3669:
-        movdqa    -192(%rbp), %xmm1                             #4155.46
-..LN3671:
-        pand      %xmm1, %xmm0                                  #4155.22
-..LN3673:
-        movdqa    %xmm0, -304(%rbp)                             #4155.17
-..LN3675:
-        movdqa    -320(%rbp), %xmm0                             #4156.22
-        movdqa    -304(%rbp), %xmm1                             #4156.22
-        pcmpeqw   %xmm1, %xmm0                                  #4156.22
-..LN3677:
-        movdqa    %xmm0, -320(%rbp)                             #4156.17
-..LN3679:
-        movdqa    -320(%rbp), %xmm0                             #4157.42
-..LN3681:
-        pmovmskb  %xmm0, %eax                                   #4157.22
-..LN3683:
-        movl      %eax, -72(%rbp)                               #4157.17
-                                # LOE
-..B25.15:                       # Preds ..B25.7 ..B25.14
-..LN3685:
-        movdqa    -288(%rbp), %xmm0                             #4161.38
-..LN3687:
-        movdqa    -176(%rbp), %xmm1                             #4161.46
-..LN3689:
-        pand      %xmm1, %xmm0                                  #4161.22
-..LN3691:
-        movdqa    %xmm0, -320(%rbp)                             #4161.17
-..LN3693:
-        movdqa    -288(%rbp), %xmm0                             #4162.38
-..LN3695:
-        movdqa    -160(%rbp), %xmm1                             #4162.46
-..LN3697:
-        pand      %xmm1, %xmm0                                  #4162.22
-..LN3699:
-        movdqa    %xmm0, -304(%rbp)                             #4162.17
-..LN3701:
-        movdqa    -320(%rbp), %xmm0                             #4163.22
-        movdqa    -304(%rbp), %xmm1                             #4163.22
-        pcmpeqw   %xmm1, %xmm0                                  #4163.22
-..LN3703:
-        movdqa    %xmm0, -320(%rbp)                             #4163.17
-..LN3705:
-        movdqa    -320(%rbp), %xmm0                             #4164.42
-..LN3707:
-        pmovmskb  %xmm0, %eax                                   #4164.22
-..LN3709:
-        movl      %eax, -80(%rbp)                               #4164.17
-..LN3711:
-        andl      $-4, -24(%rbp)                                #4169.17
-..LN3713:
-        movl      -68(%rbp), %eax                               #4172.29
-        orl       -64(%rbp), %eax                               #4172.29
-..LN3715:
-        orl       -72(%rbp), %eax                               #4172.34
-..LN3717:
-        orl       -80(%rbp), %eax                               #4172.39
-..LN3719:
-        je        ..B25.32      # Prob 50%                      #4172.47
-                                # LOE
-..B25.16:                       # Preds ..B25.15
-..LN3721:
-        movl      -64(%rbp), %eax                               #4190.58
-..LN3723:
-        movl      %eax, %edi                                    #4190.30
-        call      uint16_lsbit at PLT                              #4190.30
-                                # LOE eax
-..B25.44:                       # Preds ..B25.16
-        movl      %eax, -112(%rbp)                              #4190.30
-                                # LOE
-..B25.17:                       # Preds ..B25.44
-        movl      -112(%rbp), %eax                              #4190.30
-        movswq    %ax, %rax                                     #4190.30
-..LN3725:
-        movl      %eax, -128(%rbp)                              #4190.28
-..LN3727:
-        movl      -68(%rbp), %eax                               #4191.58
-..LN3729:
-        movl      %eax, %edi                                    #4191.30
-        call      uint16_lsbit at PLT                              #4191.30
-                                # LOE eax
-..B25.45:                       # Preds ..B25.17
-        movl      %eax, -108(%rbp)                              #4191.30
-                                # LOE
-..B25.18:                       # Preds ..B25.45
-        movl      -108(%rbp), %eax                              #4191.30
-        movswq    %ax, %rax                                     #4191.30
-..LN3731:
-        movl      %eax, -124(%rbp)                              #4191.28
-..LN3733:
-        movl      -72(%rbp), %eax                               #4192.58
-..LN3735:
-        movl      %eax, %edi                                    #4192.30
-        call      uint16_lsbit at PLT                              #4192.30
-                                # LOE eax
-..B25.46:                       # Preds ..B25.18
-        movl      %eax, -104(%rbp)                              #4192.30
-                                # LOE
-..B25.19:                       # Preds ..B25.46
-        movl      -104(%rbp), %eax                              #4192.30
-        movswq    %ax, %rax                                     #4192.30
-..LN3737:
-        movl      %eax, -120(%rbp)                              #4192.28
-..LN3739:
-        movl      -80(%rbp), %eax                               #4193.58
-..LN3741:
-        movl      %eax, %edi                                    #4193.30
-        call      uint16_lsbit at PLT                              #4193.30
-                                # LOE eax
-..B25.47:                       # Preds ..B25.19
-        movl      %eax, -100(%rbp)                              #4193.30
-                                # LOE
-..B25.20:                       # Preds ..B25.47
-        movl      -100(%rbp), %eax                              #4193.30
-        movswq    %ax, %rax                                     #4193.30
-..LN3743:
-        movl      %eax, -116(%rbp)                              #4193.28
-..LN3745:
-        movl      -128(%rbp), %eax                              #4198.28
-..LN3747:
-        addl      %eax, %eax                                    #4198.34
-..LN3749:
-        movl      %eax, -128(%rbp)                              #4198.21
-..LN3751:
-        movl      -124(%rbp), %eax                              #4199.28
-..LN3753:
-        lea       1(%rax,%rax), %eax                            #4199.40
-..LN3755:
-        movl      %eax, -124(%rbp)                              #4199.21
-..LN3757:
-        movl      -120(%rbp), %eax                              #4200.28
-..LN3759:
-        lea       2(%rax,%rax), %eax                            #4200.40
-..LN3761:
-        movl      %eax, -120(%rbp)                              #4200.21
-..LN3763:
-        movl      -116(%rbp), %eax                              #4201.28
-..LN3765:
-        lea       3(%rax,%rax), %eax                            #4201.40
-..LN3767:
-        movl      %eax, -116(%rbp)                              #4201.21
-..LN3769:
-        movl      -64(%rbp), %eax                               #4205.26
-..LN3771:
-        testl     %eax, %eax                                    #4205.32
-        je        ..B25.23      # Prob 50%                      #4205.32
-                                # LOE
-..B25.21:                       # Preds ..B25.20
-..LN3773:
-        movl      -128(%rbp), %eax                              #4205.43
-        addl      -24(%rbp), %eax                               #4205.43
-..LN3775:
-        movl      -76(%rbp), %edx                               #4205.49
-        cmpl      %edx, %eax                                    #4205.49
-        ja        ..B25.23      # Prob 50%                      #4205.49
-                                # LOE
-..B25.22:                       # Preds ..B25.21
-..LN3777:
-        movl      $1, %eax                                      #4205.63
-        leave                                                   #4205.63
-..___tag_value_eval_4na_16.409:                                 #
-        ret                                                     #4205.63
-..___tag_value_eval_4na_16.410:                                 #
-                                # LOE
-..B25.23:                       # Preds ..B25.21 ..B25.20
-..LN3779:
-        movl      -68(%rbp), %eax                               #4206.26
-..LN3781:
-        testl     %eax, %eax                                    #4206.32
-        je        ..B25.26      # Prob 50%                      #4206.32
-                                # LOE
-..B25.24:                       # Preds ..B25.23
-..LN3783:
-        movl      -124(%rbp), %eax                              #4206.43
-        addl      -24(%rbp), %eax                               #4206.43
-..LN3785:
-        movl      -76(%rbp), %edx                               #4206.49
-        cmpl      %edx, %eax                                    #4206.49
-        ja        ..B25.26      # Prob 50%                      #4206.49
-                                # LOE
-..B25.25:                       # Preds ..B25.24
-..LN3787:
-        movl      $1, %eax                                      #4206.63
-        leave                                                   #4206.63
-..___tag_value_eval_4na_16.412:                                 #
-        ret                                                     #4206.63
-..___tag_value_eval_4na_16.413:                                 #
-                                # LOE
-..B25.26:                       # Preds ..B25.24 ..B25.23
-..LN3789:
-        movl      -72(%rbp), %eax                               #4207.26
-..LN3791:
-        testl     %eax, %eax                                    #4207.32
-        je        ..B25.29      # Prob 50%                      #4207.32
-                                # LOE
-..B25.27:                       # Preds ..B25.26
-..LN3793:
-        movl      -120(%rbp), %eax                              #4207.43
-        addl      -24(%rbp), %eax                               #4207.43
-..LN3795:
-        movl      -76(%rbp), %edx                               #4207.49
-        cmpl      %edx, %eax                                    #4207.49
-        ja        ..B25.29      # Prob 50%                      #4207.49
-                                # LOE
-..B25.28:                       # Preds ..B25.27
-..LN3797:
-        movl      $1, %eax                                      #4207.63
-        leave                                                   #4207.63
-..___tag_value_eval_4na_16.415:                                 #
-        ret                                                     #4207.63
-..___tag_value_eval_4na_16.416:                                 #
-                                # LOE
-..B25.29:                       # Preds ..B25.27 ..B25.26
-..LN3799:
-        movl      -80(%rbp), %eax                               #4208.26
-..LN3801:
-        testl     %eax, %eax                                    #4208.32
-        je        ..B25.32      # Prob 50%                      #4208.32
-                                # LOE
-..B25.30:                       # Preds ..B25.29
-..LN3803:
-        movl      -116(%rbp), %eax                              #4208.43
-        addl      -24(%rbp), %eax                               #4208.43
-..LN3805:
-        movl      -76(%rbp), %edx                               #4208.49
-        cmpl      %edx, %eax                                    #4208.49
-        ja        ..B25.32      # Prob 50%                      #4208.49
-                                # LOE
-..B25.31:                       # Preds ..B25.30
-..LN3807:
-        movl      $1, %eax                                      #4208.63
-        leave                                                   #4208.63
-..___tag_value_eval_4na_16.418:                                 #
-        ret                                                     #4208.63
-..___tag_value_eval_4na_16.419:                                 #
-                                # LOE
-..B25.32:                       # Preds ..B25.30 ..B25.29 ..B25.15
-..LN3809:
-        addl      $4, -24(%rbp)                                 #4213.17
-..LN3811:
-        movl      -24(%rbp), %eax                               #4216.22
-..LN3813:
-        movl      -76(%rbp), %edx                               #4216.28
-        cmpl      %edx, %eax                                    #4216.28
-        jbe       ..B25.34      # Prob 50%                      #4216.28
-                                # LOE
-..B25.33:                       # Preds ..B25.32
-..LN3815:
-        xorl      %eax, %eax                                    #4217.28
-        leave                                                   #4217.28
-..___tag_value_eval_4na_16.421:                                 #
-        ret                                                     #4217.28
-..___tag_value_eval_4na_16.422:                                 #
-                                # LOE
-..B25.34:                       # Preds ..B25.32
-..LN3817:
-        movl      -60(%rbp), %eax                               #4220.25
-        decl      %eax                                          #4220.25
-        movl      %eax, -60(%rbp)                               #4220.25
-..LN3819:
-        jne       ..B25.10      # Prob 50%                      #4220.39
-                                # LOE
-..B25.36:                       # Preds ..B25.34 ..B25.10
-..LN3821:
-        movq      -96(%rbp), %rax                               #4237.18
-..LN3823:
-        movq      -88(%rbp), %rdx                               #4237.25
-        cmpq      %rdx, %rax                                    #4237.25
-        jae       ..B25.40      # Prob 50%                      #4237.25
-                                # LOE
-..B25.37:                       # Preds ..B25.36
-..LN3825:
-        addl      $28, -24(%rbp)                                #4241.13
-..LN3827:
-        movl      -24(%rbp), %eax                               #4242.18
-..LN3829:
-        movl      -76(%rbp), %edx                               #4242.24
-        cmpl      %edx, %eax                                    #4242.24
-        ja        ..B25.40      # Prob 50%                      #4242.24
-                                # LOE
-..B25.38:                       # Preds ..B25.37
-..LN3831:
-        movq      -96(%rbp), %rax                               #4247.41
-..LN3833:
-        movq      -88(%rbp), %rdx                               #4247.46
-..LN3835:
-        movq      %rax, %rdi                                    #4247.22
-        movq      %rdx, %rsi                                    #4247.22
-        call      prime_buffer_4na at PLT                          #4247.22
-                                # LOE xmm0
-..B25.48:                       # Preds ..B25.38
-        movdqa    %xmm0, -336(%rbp)                             #4247.22
-                                # LOE
-..B25.39:                       # Preds ..B25.48
-..LN3837:
-        movdqa    -336(%rbp), %xmm0                             #4247.13
-        movdqa    %xmm0, -288(%rbp)                             #4247.13
-..LN3839:
-        addq      $8, -96(%rbp)                                 #4262.13
-        jmp       ..B25.8       # Prob 100%                     #4262.13
-                                # LOE
-..B25.40:                       # Preds ..B25.37 ..B25.36 ..B25.8
-..LN3841:
-        xorl      %eax, %eax                                    #4273.12
-        leave                                                   #4273.12
-..___tag_value_eval_4na_16.424:                                 #
-        ret                                                     #4273.12
-        .align    2,0x90
-..___tag_value_eval_4na_16.425:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-.LNeval_4na_16:
-	.data
-# -- End  eval_4na_16
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    2,0x90
-eval_4na_32:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B26.1:                        # Preds ..B26.0
-..___tag_value_eval_4na_32.428:                                 #
-..LN3843:
-        pushq     %rbp                                          #4279.1
-        movq      %rsp, %rbp                                    #4279.1
-..___tag_value_eval_4na_32.429:                                 #
-        subq      $336, %rsp                                    #4279.1
-        movq      %rdi, -40(%rbp)                               #4279.1
-        movq      %rsi, -32(%rbp)                               #4279.1
-        movl      %edx, -16(%rbp)                               #4279.1
-        movl      %ecx, -8(%rbp)                                #4279.1
-..LN3845:
-        movq      -40(%rbp), %rax                               #4305.25
-        movl      4(%rax), %eax                                 #4305.25
-..LN3847:
-        movl      %eax, -24(%rbp)                               #4305.23
-..LN3849:
-        movl      -8(%rbp), %eax                                #4308.5
-        movl      -24(%rbp), %edx                               #4308.5
-        cmpl      %edx, %eax                                    #4308.5
-        jae       ..B26.3       # Prob 50%                      #4308.5
-                                # LOE
-..B26.2:                        # Preds ..B26.1
-        lea       _2__STRING.9.0(%rip), %rax                    #4308.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #4308.5
-        lea       __$Uc.0(%rip), %rcx                           #4308.5
-        movq      %rax, %rdi                                    #4308.5
-        movq      %rdx, %rsi                                    #4308.5
-        movl      $4308, %edx                                   #4308.5
-        call      __assert_fail at PLT                             #4308.5
-                                # LOE
-..B26.3:                        # Preds ..B26.1
-..LN3851:
-        movl      -16(%rbp), %eax                               #4312.12
-..LN3853:
-        addl      -8(%rbp), %eax                                #4312.5
-        movl      %eax, -8(%rbp)                                #4312.5
-..LN3855:
-        movl      -16(%rbp), %eax                               #4315.42
-..LN3857:
-        shrl      $2, %eax                                      #4315.49
-..LN3859:
-        addq      -32(%rbp), %rax                               #4315.30
-..LN3861:
-        movq      %rax, -96(%rbp)                               #4315.5
-..LN3863:
-        movl      -24(%rbp), %eax                               #4318.18
-        negl      %eax                                          #4318.18
-        addl      -8(%rbp), %eax                                #4318.18
-..LN3865:
-        movl      %eax, -68(%rbp)                               #4318.5
-..LN3867:
-        movl      -8(%rbp), %eax                                #4321.44
-..LN3869:
-        addl      $3, %eax                                      #4321.50
-..LN3871:
-        shrl      $2, %eax                                      #4321.57
-..LN3873:
-        addq      -32(%rbp), %rax                               #4321.30
-..LN3875:
-        movq      %rax, -88(%rbp)                               #4321.5
-..LN3877:
-        movq      -96(%rbp), %rax                               #4324.33
-..LN3879:
-        movq      -88(%rbp), %rdx                               #4324.38
-..LN3881:
-        movq      %rax, %rdi                                    #4324.14
-        movq      %rdx, %rsi                                    #4324.14
-        call      prime_buffer_4na at PLT                          #4324.14
-                                # LOE xmm0
-..B26.46:                       # Preds ..B26.3
-        movdqa    %xmm0, -144(%rbp)                             #4324.14
-                                # LOE
-..B26.4:                        # Preds ..B26.46
-..LN3883:
-        movdqa    -144(%rbp), %xmm0                             #4324.5
-        movdqa    %xmm0, -288(%rbp)                             #4324.5
-..LN3885:
-        addq      $8, -96(%rbp)                                 #4325.5
-..LN3887:
-        movq      -96(%rbp), %rax                               #4327.9
-..LN3889:
-        movq      %rax, -80(%rbp)                               #4327.5
-..LN3891:
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    16(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -272(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    32(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -256(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    48(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -240(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    64(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -224(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    80(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -208(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    96(%rax), %xmm0                               #4331.5
-        movdqa    %xmm0, -192(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    112(%rax), %xmm0                              #4331.5
-        movdqa    %xmm0, -176(%rbp)                             #4331.5
-        movq      -40(%rbp), %rax                               #4331.5
-        movdqa    128(%rax), %xmm0                              #4331.5
-        movdqa    %xmm0, -160(%rbp)                             #4331.5
-..LN3893:
-        xorl      %eax, %eax                                    #4334.15
-        movl      %eax, -64(%rbp)                               #4334.15
-..LN3895:
-        movl      %eax, -60(%rbp)                               #4334.10
-..LN3897:
-        movl      %eax, -56(%rbp)                               #4334.5
-..LN3899:
-        movl      $2, -52(%rbp)                                 #4340.5
-..LN3901:
-        movl      -16(%rbp), %eax                               #4345.14
-..LN3903:
-        andl      $3, %eax                                      #4345.20
-        movl      %eax, -48(%rbp)                               #4345.20
-        je        ..B26.12      # Prob 50%                      #4345.20
-                                # LOE
-..B26.5:                        # Preds ..B26.4
-        movl      -48(%rbp), %eax                               #4345.20
-        cmpl      $1, %eax                                      #4345.20
-        je        ..B26.13      # Prob 50%                      #4345.20
-                                # LOE
-..B26.6:                        # Preds ..B26.5
-        movl      -48(%rbp), %eax                               #4345.20
-        cmpl      $2, %eax                                      #4345.20
-        je        ..B26.14      # Prob 50%                      #4345.20
-                                # LOE
-..B26.7:                        # Preds ..B26.6
-        movl      -48(%rbp), %eax                               #4345.20
-        cmpl      $3, %eax                                      #4345.20
-        je        ..B26.15      # Prob 50%                      #4345.20
-                                # LOE
-..B26.8:                        # Preds ..B26.42 ..B26.7
-..LN3905:
-        movl      $1, %eax                                      #4350.9
-        testl     %eax, %eax                                    #4350.9
-        je        ..B26.43      # Prob 100%                     #4350.9
-                                # LOE
-..B26.9:                        # Preds ..B26.8
-..LN3907:
-        movl      $2, -52(%rbp)                                 #4352.13
-                                # LOE
-..B26.10:                       # Preds ..B26.37 ..B26.9
-..LN3909:
-        movl      $1, %eax                                      #4355.13
-        testl     %eax, %eax                                    #4355.13
-        je        ..B26.39      # Prob 100%                     #4355.13
-                                # LOE
-..B26.12:                       # Preds ..B26.4 ..B26.10
-..LN3911:
-        movdqa    -288(%rbp), %xmm0                             #4362.38
-..LN3913:
-        movdqa    -272(%rbp), %xmm1                             #4362.46
-..LN3915:
-        pand      %xmm1, %xmm0                                  #4362.22
-..LN3917:
-        movdqa    %xmm0, -320(%rbp)                             #4362.17
-..LN3919:
-        movdqa    -288(%rbp), %xmm0                             #4363.38
-..LN3921:
-        movdqa    -256(%rbp), %xmm1                             #4363.46
-..LN3923:
-        pand      %xmm1, %xmm0                                  #4363.22
-..LN3925:
-        movdqa    %xmm0, -304(%rbp)                             #4363.17
-..LN3927:
-        movdqa    -320(%rbp), %xmm0                             #4364.22
-        movdqa    -304(%rbp), %xmm1                             #4364.22
-        pcmpeqd   %xmm1, %xmm0                                  #4364.22
-..LN3929:
-        movdqa    %xmm0, -320(%rbp)                             #4364.17
-..LN3931:
-        movdqa    -320(%rbp), %xmm0                             #4365.42
-..LN3933:
-        pmovmskb  %xmm0, %eax                                   #4365.22
-..LN3935:
-        movl      %eax, -56(%rbp)                               #4365.17
-                                # LOE
-..B26.13:                       # Preds ..B26.5 ..B26.12
-..LN3937:
-        movdqa    -288(%rbp), %xmm0                             #4369.38
-..LN3939:
-        movdqa    -240(%rbp), %xmm1                             #4369.46
-..LN3941:
-        pand      %xmm1, %xmm0                                  #4369.22
-..LN3943:
-        movdqa    %xmm0, -320(%rbp)                             #4369.17
-..LN3945:
-        movdqa    -288(%rbp), %xmm0                             #4370.38
-..LN3947:
-        movdqa    -224(%rbp), %xmm1                             #4370.46
-..LN3949:
-        pand      %xmm1, %xmm0                                  #4370.22
-..LN3951:
-        movdqa    %xmm0, -304(%rbp)                             #4370.17
-..LN3953:
-        movdqa    -320(%rbp), %xmm0                             #4371.22
-        movdqa    -304(%rbp), %xmm1                             #4371.22
-        pcmpeqd   %xmm1, %xmm0                                  #4371.22
-..LN3955:
-        movdqa    %xmm0, -320(%rbp)                             #4371.17
-..LN3957:
-        movdqa    -320(%rbp), %xmm0                             #4372.42
-..LN3959:
-        pmovmskb  %xmm0, %eax                                   #4372.22
-..LN3961:
-        movl      %eax, -60(%rbp)                               #4372.17
-                                # LOE
-..B26.14:                       # Preds ..B26.6 ..B26.13
-..LN3963:
-        movdqa    -288(%rbp), %xmm0                             #4376.38
-..LN3965:
-        movdqa    -208(%rbp), %xmm1                             #4376.46
-..LN3967:
-        pand      %xmm1, %xmm0                                  #4376.22
-..LN3969:
-        movdqa    %xmm0, -320(%rbp)                             #4376.17
-..LN3971:
-        movdqa    -288(%rbp), %xmm0                             #4377.38
-..LN3973:
-        movdqa    -192(%rbp), %xmm1                             #4377.46
-..LN3975:
-        pand      %xmm1, %xmm0                                  #4377.22
-..LN3977:
-        movdqa    %xmm0, -304(%rbp)                             #4377.17
-..LN3979:
-        movdqa    -320(%rbp), %xmm0                             #4378.22
-        movdqa    -304(%rbp), %xmm1                             #4378.22
-        pcmpeqd   %xmm1, %xmm0                                  #4378.22
-..LN3981:
-        movdqa    %xmm0, -320(%rbp)                             #4378.17
-..LN3983:
-        movdqa    -320(%rbp), %xmm0                             #4379.42
-..LN3985:
-        pmovmskb  %xmm0, %eax                                   #4379.22
-..LN3987:
-        movl      %eax, -64(%rbp)                               #4379.17
-                                # LOE
-..B26.15:                       # Preds ..B26.7 ..B26.14
-..LN3989:
-        movdqa    -288(%rbp), %xmm0                             #4383.38
-..LN3991:
-        movdqa    -176(%rbp), %xmm1                             #4383.46
-..LN3993:
-        pand      %xmm1, %xmm0                                  #4383.22
-..LN3995:
-        movdqa    %xmm0, -320(%rbp)                             #4383.17
-..LN3997:
-        movdqa    -288(%rbp), %xmm0                             #4384.38
-..LN3999:
-        movdqa    -160(%rbp), %xmm1                             #4384.46
-..LN4001:
-        pand      %xmm1, %xmm0                                  #4384.22
-..LN4003:
-        movdqa    %xmm0, -304(%rbp)                             #4384.17
-..LN4005:
-        movdqa    -320(%rbp), %xmm0                             #4385.22
-        movdqa    -304(%rbp), %xmm1                             #4385.22
-        pcmpeqd   %xmm1, %xmm0                                  #4385.22
-..LN4007:
-        movdqa    %xmm0, -320(%rbp)                             #4385.17
-..LN4009:
-        movdqa    -320(%rbp), %xmm0                             #4386.42
-..LN4011:
-        pmovmskb  %xmm0, %eax                                   #4386.22
-..LN4013:
-        movl      %eax, -72(%rbp)                               #4386.17
-..LN4015:
-        andl      $-4, -16(%rbp)                                #4391.17
-..LN4017:
-        movl      -60(%rbp), %eax                               #4394.29
-        orl       -56(%rbp), %eax                               #4394.29
-..LN4019:
-        orl       -64(%rbp), %eax                               #4394.34
-..LN4021:
-        orl       -72(%rbp), %eax                               #4394.39
-..LN4023:
-        je        ..B26.32      # Prob 50%                      #4394.47
-                                # LOE
-..B26.16:                       # Preds ..B26.15
-..LN4025:
-        movl      -56(%rbp), %eax                               #4412.58
-..LN4027:
-        movl      %eax, %edi                                    #4412.30
-        call      uint16_lsbit at PLT                              #4412.30
-                                # LOE eax
-..B26.47:                       # Preds ..B26.16
-        movl      %eax, -112(%rbp)                              #4412.30
-                                # LOE
-..B26.17:                       # Preds ..B26.47
-        movl      -112(%rbp), %eax                              #4412.30
-        movswq    %ax, %rax                                     #4412.30
-..LN4029:
-        movl      %eax, -128(%rbp)                              #4412.28
-..LN4031:
-        movl      -60(%rbp), %eax                               #4413.58
-..LN4033:
-        movl      %eax, %edi                                    #4413.30
-        call      uint16_lsbit at PLT                              #4413.30
-                                # LOE eax
-..B26.48:                       # Preds ..B26.17
-        movl      %eax, -108(%rbp)                              #4413.30
-                                # LOE
-..B26.18:                       # Preds ..B26.48
-        movl      -108(%rbp), %eax                              #4413.30
-        movswq    %ax, %rax                                     #4413.30
-..LN4035:
-        movl      %eax, -124(%rbp)                              #4413.28
-..LN4037:
-        movl      -64(%rbp), %eax                               #4414.58
-..LN4039:
-        movl      %eax, %edi                                    #4414.30
-        call      uint16_lsbit at PLT                              #4414.30
-                                # LOE eax
-..B26.49:                       # Preds ..B26.18
-        movl      %eax, -104(%rbp)                              #4414.30
-                                # LOE
-..B26.19:                       # Preds ..B26.49
-        movl      -104(%rbp), %eax                              #4414.30
-        movswq    %ax, %rax                                     #4414.30
-..LN4041:
-        movl      %eax, -120(%rbp)                              #4414.28
-..LN4043:
-        movl      -72(%rbp), %eax                               #4415.58
-..LN4045:
-        movl      %eax, %edi                                    #4415.30
-        call      uint16_lsbit at PLT                              #4415.30
-                                # LOE eax
-..B26.50:                       # Preds ..B26.19
-        movl      %eax, -100(%rbp)                              #4415.30
-                                # LOE
-..B26.20:                       # Preds ..B26.50
-        movl      -100(%rbp), %eax                              #4415.30
-        movswq    %ax, %rax                                     #4415.30
-..LN4047:
-        movl      %eax, -116(%rbp)                              #4415.28
-..LN4049:
-        movl      -128(%rbp), %eax                              #4420.28
-..LN4051:
-        addl      %eax, %eax                                    #4420.34
-..LN4053:
-        movl      %eax, -128(%rbp)                              #4420.21
-..LN4055:
-        movl      -124(%rbp), %eax                              #4421.28
-..LN4057:
-        lea       1(%rax,%rax), %eax                            #4421.40
-..LN4059:
-        movl      %eax, -124(%rbp)                              #4421.21
-..LN4061:
-        movl      -120(%rbp), %eax                              #4422.28
-..LN4063:
-        lea       2(%rax,%rax), %eax                            #4422.40
-..LN4065:
-        movl      %eax, -120(%rbp)                              #4422.21
-..LN4067:
-        movl      -116(%rbp), %eax                              #4423.28
-..LN4069:
-        lea       3(%rax,%rax), %eax                            #4423.40
-..LN4071:
-        movl      %eax, -116(%rbp)                              #4423.21
-..LN4073:
-        movl      -56(%rbp), %eax                               #4427.26
-..LN4075:
-        testl     %eax, %eax                                    #4427.32
-        je        ..B26.23      # Prob 50%                      #4427.32
-                                # LOE
-..B26.21:                       # Preds ..B26.20
-..LN4077:
-        movl      -128(%rbp), %eax                              #4427.43
-        addl      -16(%rbp), %eax                               #4427.43
-..LN4079:
-        movl      -68(%rbp), %edx                               #4427.49
-        cmpl      %edx, %eax                                    #4427.49
-        ja        ..B26.23      # Prob 50%                      #4427.49
-                                # LOE
-..B26.22:                       # Preds ..B26.21
-..LN4081:
-        movl      $1, %eax                                      #4427.63
-        leave                                                   #4427.63
-..___tag_value_eval_4na_32.433:                                 #
-        ret                                                     #4427.63
-..___tag_value_eval_4na_32.434:                                 #
-                                # LOE
-..B26.23:                       # Preds ..B26.21 ..B26.20
-..LN4083:
-        movl      -60(%rbp), %eax                               #4428.26
-..LN4085:
-        testl     %eax, %eax                                    #4428.32
-        je        ..B26.26      # Prob 50%                      #4428.32
-                                # LOE
-..B26.24:                       # Preds ..B26.23
-..LN4087:
-        movl      -124(%rbp), %eax                              #4428.43
-        addl      -16(%rbp), %eax                               #4428.43
-..LN4089:
-        movl      -68(%rbp), %edx                               #4428.49
-        cmpl      %edx, %eax                                    #4428.49
-        ja        ..B26.26      # Prob 50%                      #4428.49
-                                # LOE
-..B26.25:                       # Preds ..B26.24
-..LN4091:
-        movl      $1, %eax                                      #4428.63
-        leave                                                   #4428.63
-..___tag_value_eval_4na_32.436:                                 #
-        ret                                                     #4428.63
-..___tag_value_eval_4na_32.437:                                 #
-                                # LOE
-..B26.26:                       # Preds ..B26.24 ..B26.23
-..LN4093:
-        movl      -64(%rbp), %eax                               #4429.26
-..LN4095:
-        testl     %eax, %eax                                    #4429.32
-        je        ..B26.29      # Prob 50%                      #4429.32
-                                # LOE
-..B26.27:                       # Preds ..B26.26
-..LN4097:
-        movl      -120(%rbp), %eax                              #4429.43
-        addl      -16(%rbp), %eax                               #4429.43
-..LN4099:
-        movl      -68(%rbp), %edx                               #4429.49
-        cmpl      %edx, %eax                                    #4429.49
-        ja        ..B26.29      # Prob 50%                      #4429.49
-                                # LOE
-..B26.28:                       # Preds ..B26.27
-..LN4101:
-        movl      $1, %eax                                      #4429.63
-        leave                                                   #4429.63
-..___tag_value_eval_4na_32.439:                                 #
-        ret                                                     #4429.63
-..___tag_value_eval_4na_32.440:                                 #
-                                # LOE
-..B26.29:                       # Preds ..B26.27 ..B26.26
-..LN4103:
-        movl      -72(%rbp), %eax                               #4430.26
-..LN4105:
-        testl     %eax, %eax                                    #4430.32
-        je        ..B26.32      # Prob 50%                      #4430.32
-                                # LOE
-..B26.30:                       # Preds ..B26.29
-..LN4107:
-        movl      -116(%rbp), %eax                              #4430.43
-        addl      -16(%rbp), %eax                               #4430.43
-..LN4109:
-        movl      -68(%rbp), %edx                               #4430.49
-        cmpl      %edx, %eax                                    #4430.49
-        ja        ..B26.32      # Prob 50%                      #4430.49
-                                # LOE
-..B26.31:                       # Preds ..B26.30
-..LN4111:
-        movl      $1, %eax                                      #4430.63
-        leave                                                   #4430.63
-..___tag_value_eval_4na_32.442:                                 #
-        ret                                                     #4430.63
-..___tag_value_eval_4na_32.443:                                 #
-                                # LOE
-..B26.32:                       # Preds ..B26.30 ..B26.29 ..B26.15
-..LN4113:
-        addl      $4, -16(%rbp)                                 #4435.17
-..LN4115:
-        movl      -16(%rbp), %eax                               #4438.22
-..LN4117:
-        movl      -68(%rbp), %edx                               #4438.28
-        cmpl      %edx, %eax                                    #4438.28
-        jbe       ..B26.34      # Prob 50%                      #4438.28
-                                # LOE
-..B26.33:                       # Preds ..B26.32
-..LN4119:
-        xorl      %eax, %eax                                    #4439.28
-        leave                                                   #4439.28
-..___tag_value_eval_4na_32.445:                                 #
-        ret                                                     #4439.28
-..___tag_value_eval_4na_32.446:                                 #
-                                # LOE
-..B26.34:                       # Preds ..B26.32
-..LN4121:
-        movl      -52(%rbp), %eax                               #4442.25
-        decl      %eax                                          #4442.25
-        movl      %eax, -52(%rbp)                               #4442.25
-..LN4123:
-        je        ..B26.39      # Prob 50%                      #4442.39
-                                # LOE
-..B26.35:                       # Preds ..B26.34
-..LN4125:
-        movdqa    -288(%rbp), %xmm0                             #4447.43
-..LN4127:
-        psrldq    $2, %xmm0                                     #4447.26
-..LN4129:
-        movdqa    %xmm0, -288(%rbp)                             #4447.17
-..LN4131:
-        movq      -80(%rbp), %rax                               #4450.22
-..LN4133:
-        movq      -88(%rbp), %rdx                               #4450.26
-        cmpq      %rdx, %rax                                    #4450.26
-        jae       ..B26.37      # Prob 50%                      #4450.26
-                                # LOE
-..B26.36:                       # Preds ..B26.35
-..LN4135:
-        movdqa    -288(%rbp), %xmm0                             #4451.49
-..LN4137:
-        movq      -80(%rbp), %rax                               #4451.72
-        movzbl    (%rax), %eax                                  #4451.72
-        movzbl    %al, %eax                                     #4451.72
-..LN4139:
-        movslq    %eax, %rax                                    #4451.57
-        lea       expand_2na.0(%rip), %rdx                      #4451.57
-        movzwl    (%rdx,%rax,2), %eax                           #4451.57
-        movzwl    %ax, %eax                                     #4451.57
-..LN4141:
-        pinsrw    $7, %eax, %xmm0                               #4451.30
-..LN4143:
-        movdqa    %xmm0, -288(%rbp)                             #4451.21
-                                # LOE
-..B26.37:                       # Preds ..B26.36 ..B26.35
-..LN4145:
-        incq      -80(%rbp)                                     #4454.20
-        jmp       ..B26.10      # Prob 100%                     #4454.20
-                                # LOE
-..B26.39:                       # Preds ..B26.34 ..B26.10
-..LN4147:
-        movq      -96(%rbp), %rax                               #4459.18
-..LN4149:
-        movq      -88(%rbp), %rdx                               #4459.25
-        cmpq      %rdx, %rax                                    #4459.25
-        jae       ..B26.43      # Prob 50%                      #4459.25
-                                # LOE
-..B26.40:                       # Preds ..B26.39
-..LN4151:
-        addl      $24, -16(%rbp)                                #4463.13
-..LN4153:
-        movl      -16(%rbp), %eax                               #4464.18
-..LN4155:
-        movl      -68(%rbp), %edx                               #4464.24
-        cmpl      %edx, %eax                                    #4464.24
-        ja        ..B26.43      # Prob 50%                      #4464.24
-                                # LOE
-..B26.41:                       # Preds ..B26.40
-..LN4157:
-        movq      -96(%rbp), %rax                               #4469.41
-..LN4159:
-        movq      -88(%rbp), %rdx                               #4469.46
-..LN4161:
-        movq      %rax, %rdi                                    #4469.22
-        movq      %rdx, %rsi                                    #4469.22
-        call      prime_buffer_4na at PLT                          #4469.22
-                                # LOE xmm0
-..B26.51:                       # Preds ..B26.41
-        movdqa    %xmm0, -336(%rbp)                             #4469.22
-                                # LOE
-..B26.42:                       # Preds ..B26.51
-..LN4163:
-        movdqa    -336(%rbp), %xmm0                             #4469.13
-        movdqa    %xmm0, -288(%rbp)                             #4469.13
-..LN4165:
-        addq      $8, -96(%rbp)                                 #4484.13
-..LN4167:
-        movq      -96(%rbp), %rax                               #4486.17
-..LN4169:
-        movq      %rax, -80(%rbp)                               #4486.13
-        jmp       ..B26.8       # Prob 100%                     #4486.13
-                                # LOE
-..B26.43:                       # Preds ..B26.40 ..B26.39 ..B26.8
-..LN4171:
-        xorl      %eax, %eax                                    #4495.12
-        leave                                                   #4495.12
-..___tag_value_eval_4na_32.448:                                 #
-        ret                                                     #4495.12
-        .align    2,0x90
-..___tag_value_eval_4na_32.449:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-.LNeval_4na_32:
-	.data
-# -- End  eval_4na_32
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    2,0x90
-eval_4na_64:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B27.1:                        # Preds ..B27.0
-..___tag_value_eval_4na_64.452:                                 #
-..LN4173:
-        pushq     %rbp                                          #4501.1
-        movq      %rsp, %rbp                                    #4501.1
-..___tag_value_eval_4na_64.453:                                 #
-        subq      $336, %rsp                                    #4501.1
-        movq      %rdi, -40(%rbp)                               #4501.1
-        movq      %rsi, -32(%rbp)                               #4501.1
-        movl      %edx, -16(%rbp)                               #4501.1
-        movl      %ecx, -8(%rbp)                                #4501.1
-..LN4175:
-        movq      -40(%rbp), %rax                               #4528.25
-        movl      4(%rax), %eax                                 #4528.25
-..LN4177:
-        movl      %eax, -24(%rbp)                               #4528.23
-..LN4179:
-        movl      -8(%rbp), %eax                                #4531.5
-        movl      -24(%rbp), %edx                               #4531.5
-        cmpl      %edx, %eax                                    #4531.5
-        jae       ..B27.3       # Prob 50%                      #4531.5
-                                # LOE
-..B27.2:                        # Preds ..B27.1
-        lea       _2__STRING.9.0(%rip), %rax                    #4531.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #4531.5
-        lea       __$Ud.0(%rip), %rcx                           #4531.5
-        movq      %rax, %rdi                                    #4531.5
-        movq      %rdx, %rsi                                    #4531.5
-        movl      $4531, %edx                                   #4531.5
-        call      __assert_fail at PLT                             #4531.5
-                                # LOE
-..B27.3:                        # Preds ..B27.1
-..LN4181:
-        movl      -16(%rbp), %eax                               #4535.12
-..LN4183:
-        addl      -8(%rbp), %eax                                #4535.5
-        movl      %eax, -8(%rbp)                                #4535.5
-..LN4185:
-        movl      -16(%rbp), %eax                               #4538.42
-..LN4187:
-        shrl      $2, %eax                                      #4538.49
-..LN4189:
-        addq      -32(%rbp), %rax                               #4538.30
-..LN4191:
-        movq      %rax, -96(%rbp)                               #4538.5
-..LN4193:
-        movl      -24(%rbp), %eax                               #4541.18
-        negl      %eax                                          #4541.18
-        addl      -8(%rbp), %eax                                #4541.18
-..LN4195:
-        movl      %eax, -68(%rbp)                               #4541.5
-..LN4197:
-        movl      -8(%rbp), %eax                                #4544.44
-..LN4199:
-        addl      $3, %eax                                      #4544.50
-..LN4201:
-        shrl      $2, %eax                                      #4544.57
-..LN4203:
-        addq      -32(%rbp), %rax                               #4544.30
-..LN4205:
-        movq      %rax, -88(%rbp)                               #4544.5
-..LN4207:
-        movq      -96(%rbp), %rax                               #4547.33
-..LN4209:
-        movq      -88(%rbp), %rdx                               #4547.38
-..LN4211:
-        movq      %rax, %rdi                                    #4547.14
-        movq      %rdx, %rsi                                    #4547.14
-        call      prime_buffer_4na at PLT                          #4547.14
-                                # LOE xmm0
-..B27.46:                       # Preds ..B27.3
-        movdqa    %xmm0, -144(%rbp)                             #4547.14
-                                # LOE
-..B27.4:                        # Preds ..B27.46
-..LN4213:
-        movdqa    -144(%rbp), %xmm0                             #4547.5
-        movdqa    %xmm0, -288(%rbp)                             #4547.5
-..LN4215:
-        addq      $8, -96(%rbp)                                 #4548.5
-..LN4217:
-        movq      -96(%rbp), %rax                               #4550.9
-..LN4219:
-        movq      %rax, -80(%rbp)                               #4550.5
-..LN4221:
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    16(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -272(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    32(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -256(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    48(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -240(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    64(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -224(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    80(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -208(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    96(%rax), %xmm0                               #4554.5
-        movdqa    %xmm0, -192(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    112(%rax), %xmm0                              #4554.5
-        movdqa    %xmm0, -176(%rbp)                             #4554.5
-        movq      -40(%rbp), %rax                               #4554.5
-        movdqa    128(%rax), %xmm0                              #4554.5
-        movdqa    %xmm0, -160(%rbp)                             #4554.5
-..LN4223:
-        xorl      %eax, %eax                                    #4557.15
-        movl      %eax, -64(%rbp)                               #4557.15
-..LN4225:
-        movl      %eax, -60(%rbp)                               #4557.10
-..LN4227:
-        movl      %eax, -56(%rbp)                               #4557.5
-..LN4229:
-        movl      $4, -52(%rbp)                                 #4563.5
-..LN4231:
-        movl      -16(%rbp), %eax                               #4568.14
-..LN4233:
-        andl      $3, %eax                                      #4568.20
-        movl      %eax, -48(%rbp)                               #4568.20
-        je        ..B27.12      # Prob 50%                      #4568.20
-                                # LOE
-..B27.5:                        # Preds ..B27.4
-        movl      -48(%rbp), %eax                               #4568.20
-        cmpl      $1, %eax                                      #4568.20
-        je        ..B27.13      # Prob 50%                      #4568.20
-                                # LOE
-..B27.6:                        # Preds ..B27.5
-        movl      -48(%rbp), %eax                               #4568.20
-        cmpl      $2, %eax                                      #4568.20
-        je        ..B27.14      # Prob 50%                      #4568.20
-                                # LOE
-..B27.7:                        # Preds ..B27.6
-        movl      -48(%rbp), %eax                               #4568.20
-        cmpl      $3, %eax                                      #4568.20
-        je        ..B27.15      # Prob 50%                      #4568.20
-                                # LOE
-..B27.8:                        # Preds ..B27.42 ..B27.7
-..LN4235:
-        movl      $1, %eax                                      #4573.9
-        testl     %eax, %eax                                    #4573.9
-        je        ..B27.43      # Prob 100%                     #4573.9
-                                # LOE
-..B27.9:                        # Preds ..B27.8
-..LN4237:
-        movl      $4, -52(%rbp)                                 #4575.13
-                                # LOE
-..B27.10:                       # Preds ..B27.37 ..B27.9
-..LN4239:
-        movl      $1, %eax                                      #4578.13
-        testl     %eax, %eax                                    #4578.13
-        je        ..B27.39      # Prob 100%                     #4578.13
-                                # LOE
-..B27.12:                       # Preds ..B27.4 ..B27.10
-..LN4241:
-        movdqa    -288(%rbp), %xmm0                             #4585.38
-..LN4243:
-        movdqa    -272(%rbp), %xmm1                             #4585.46
-..LN4245:
-        pand      %xmm1, %xmm0                                  #4585.22
-..LN4247:
-        movdqa    %xmm0, -320(%rbp)                             #4585.17
-..LN4249:
-        movdqa    -288(%rbp), %xmm0                             #4586.38
-..LN4251:
-        movdqa    -256(%rbp), %xmm1                             #4586.46
-..LN4253:
-        pand      %xmm1, %xmm0                                  #4586.22
-..LN4255:
-        movdqa    %xmm0, -304(%rbp)                             #4586.17
-..LN4257:
-        movdqa    -320(%rbp), %xmm0                             #4587.22
-        movdqa    -304(%rbp), %xmm1                             #4587.22
-        pcmpeqd   %xmm1, %xmm0                                  #4587.22
-..LN4259:
-        movdqa    %xmm0, -320(%rbp)                             #4587.17
-..LN4261:
-        movdqa    -320(%rbp), %xmm0                             #4588.42
-..LN4263:
-        pmovmskb  %xmm0, %eax                                   #4588.22
-..LN4265:
-        movl      %eax, -56(%rbp)                               #4588.17
-..LN4267:
-        movl      -56(%rbp), %eax                               #4589.17
-        andl      $3855, %eax                                   #4589.17
-        shll      $4, %eax                                      #4589.17
-        andl      -56(%rbp), %eax                               #4589.17
-        movl      %eax, -56(%rbp)                               #4589.17
-        movl      -56(%rbp), %eax                               #4589.17
-        sarl      $4, %eax                                      #4589.17
-        orl       -56(%rbp), %eax                               #4589.17
-        movl      %eax, -56(%rbp)                               #4589.17
-                                # LOE
-..B27.13:                       # Preds ..B27.5 ..B27.12
-..LN4269:
-        movdqa    -288(%rbp), %xmm0                             #4592.38
-..LN4271:
-        movdqa    -240(%rbp), %xmm1                             #4592.46
-..LN4273:
-        pand      %xmm1, %xmm0                                  #4592.22
-..LN4275:
-        movdqa    %xmm0, -320(%rbp)                             #4592.17
-..LN4277:
-        movdqa    -288(%rbp), %xmm0                             #4593.38
-..LN4279:
-        movdqa    -224(%rbp), %xmm1                             #4593.46
-..LN4281:
-        pand      %xmm1, %xmm0                                  #4593.22
-..LN4283:
-        movdqa    %xmm0, -304(%rbp)                             #4593.17
-..LN4285:
-        movdqa    -320(%rbp), %xmm0                             #4594.22
-        movdqa    -304(%rbp), %xmm1                             #4594.22
-        pcmpeqd   %xmm1, %xmm0                                  #4594.22
-..LN4287:
-        movdqa    %xmm0, -320(%rbp)                             #4594.17
-..LN4289:
-        movdqa    -320(%rbp), %xmm0                             #4595.42
-..LN4291:
-        pmovmskb  %xmm0, %eax                                   #4595.22
-..LN4293:
-        movl      %eax, -60(%rbp)                               #4595.17
-..LN4295:
-        movl      -60(%rbp), %eax                               #4596.17
-        andl      $3855, %eax                                   #4596.17
-        shll      $4, %eax                                      #4596.17
-        andl      -60(%rbp), %eax                               #4596.17
-        movl      %eax, -60(%rbp)                               #4596.17
-        movl      -60(%rbp), %eax                               #4596.17
-        sarl      $4, %eax                                      #4596.17
-        orl       -60(%rbp), %eax                               #4596.17
-        movl      %eax, -60(%rbp)                               #4596.17
-                                # LOE
-..B27.14:                       # Preds ..B27.6 ..B27.13
-..LN4297:
-        movdqa    -288(%rbp), %xmm0                             #4599.38
-..LN4299:
-        movdqa    -208(%rbp), %xmm1                             #4599.46
-..LN4301:
-        pand      %xmm1, %xmm0                                  #4599.22
-..LN4303:
-        movdqa    %xmm0, -320(%rbp)                             #4599.17
-..LN4305:
-        movdqa    -288(%rbp), %xmm0                             #4600.38
-..LN4307:
-        movdqa    -192(%rbp), %xmm1                             #4600.46
-..LN4309:
-        pand      %xmm1, %xmm0                                  #4600.22
-..LN4311:
-        movdqa    %xmm0, -304(%rbp)                             #4600.17
-..LN4313:
-        movdqa    -320(%rbp), %xmm0                             #4601.22
-        movdqa    -304(%rbp), %xmm1                             #4601.22
-        pcmpeqd   %xmm1, %xmm0                                  #4601.22
-..LN4315:
-        movdqa    %xmm0, -320(%rbp)                             #4601.17
-..LN4317:
-        movdqa    -320(%rbp), %xmm0                             #4602.42
-..LN4319:
-        pmovmskb  %xmm0, %eax                                   #4602.22
-..LN4321:
-        movl      %eax, -64(%rbp)                               #4602.17
-..LN4323:
-        movl      -64(%rbp), %eax                               #4603.17
-        andl      $3855, %eax                                   #4603.17
-        shll      $4, %eax                                      #4603.17
-        andl      -64(%rbp), %eax                               #4603.17
-        movl      %eax, -64(%rbp)                               #4603.17
-        movl      -64(%rbp), %eax                               #4603.17
-        sarl      $4, %eax                                      #4603.17
-        orl       -64(%rbp), %eax                               #4603.17
-        movl      %eax, -64(%rbp)                               #4603.17
-                                # LOE
-..B27.15:                       # Preds ..B27.7 ..B27.14
-..LN4325:
-        movdqa    -288(%rbp), %xmm0                             #4606.38
-..LN4327:
-        movdqa    -176(%rbp), %xmm1                             #4606.46
-..LN4329:
-        pand      %xmm1, %xmm0                                  #4606.22
-..LN4331:
-        movdqa    %xmm0, -320(%rbp)                             #4606.17
-..LN4333:
-        movdqa    -288(%rbp), %xmm0                             #4607.38
-..LN4335:
-        movdqa    -160(%rbp), %xmm1                             #4607.46
-..LN4337:
-        pand      %xmm1, %xmm0                                  #4607.22
-..LN4339:
-        movdqa    %xmm0, -304(%rbp)                             #4607.17
-..LN4341:
-        movdqa    -320(%rbp), %xmm0                             #4608.22
-        movdqa    -304(%rbp), %xmm1                             #4608.22
-        pcmpeqd   %xmm1, %xmm0                                  #4608.22
-..LN4343:
-        movdqa    %xmm0, -320(%rbp)                             #4608.17
-..LN4345:
-        movdqa    -320(%rbp), %xmm0                             #4609.42
-..LN4347:
-        pmovmskb  %xmm0, %eax                                   #4609.22
-..LN4349:
-        movl      %eax, -72(%rbp)                               #4609.17
-..LN4351:
-        movl      -72(%rbp), %eax                               #4610.17
-        andl      $3855, %eax                                   #4610.17
-        shll      $4, %eax                                      #4610.17
-        andl      -72(%rbp), %eax                               #4610.17
-        movl      %eax, -72(%rbp)                               #4610.17
-        movl      -72(%rbp), %eax                               #4610.17
-        sarl      $4, %eax                                      #4610.17
-        orl       -72(%rbp), %eax                               #4610.17
-        movl      %eax, -72(%rbp)                               #4610.17
-..LN4353:
-        andl      $-4, -16(%rbp)                                #4614.17
-..LN4355:
-        movl      -60(%rbp), %eax                               #4617.29
-        orl       -56(%rbp), %eax                               #4617.29
-..LN4357:
-        orl       -64(%rbp), %eax                               #4617.34
-..LN4359:
-        orl       -72(%rbp), %eax                               #4617.39
-..LN4361:
-        je        ..B27.32      # Prob 50%                      #4617.47
-                                # LOE
-..B27.16:                       # Preds ..B27.15
-..LN4363:
-        movl      -56(%rbp), %eax                               #4635.58
-..LN4365:
-        movl      %eax, %edi                                    #4635.30
-        call      uint16_lsbit at PLT                              #4635.30
-                                # LOE eax
-..B27.47:                       # Preds ..B27.16
-        movl      %eax, -112(%rbp)                              #4635.30
-                                # LOE
-..B27.17:                       # Preds ..B27.47
-        movl      -112(%rbp), %eax                              #4635.30
-        movswq    %ax, %rax                                     #4635.30
-..LN4367:
-        movl      %eax, -128(%rbp)                              #4635.28
-..LN4369:
-        movl      -60(%rbp), %eax                               #4636.58
-..LN4371:
-        movl      %eax, %edi                                    #4636.30
-        call      uint16_lsbit at PLT                              #4636.30
-                                # LOE eax
-..B27.48:                       # Preds ..B27.17
-        movl      %eax, -108(%rbp)                              #4636.30
-                                # LOE
-..B27.18:                       # Preds ..B27.48
-        movl      -108(%rbp), %eax                              #4636.30
-        movswq    %ax, %rax                                     #4636.30
-..LN4373:
-        movl      %eax, -124(%rbp)                              #4636.28
-..LN4375:
-        movl      -64(%rbp), %eax                               #4637.58
-..LN4377:
-        movl      %eax, %edi                                    #4637.30
-        call      uint16_lsbit at PLT                              #4637.30
-                                # LOE eax
-..B27.49:                       # Preds ..B27.18
-        movl      %eax, -104(%rbp)                              #4637.30
-                                # LOE
-..B27.19:                       # Preds ..B27.49
-        movl      -104(%rbp), %eax                              #4637.30
-        movswq    %ax, %rax                                     #4637.30
-..LN4379:
-        movl      %eax, -120(%rbp)                              #4637.28
-..LN4381:
-        movl      -72(%rbp), %eax                               #4638.58
-..LN4383:
-        movl      %eax, %edi                                    #4638.30
-        call      uint16_lsbit at PLT                              #4638.30
-                                # LOE eax
-..B27.50:                       # Preds ..B27.19
-        movl      %eax, -100(%rbp)                              #4638.30
-                                # LOE
-..B27.20:                       # Preds ..B27.50
-        movl      -100(%rbp), %eax                              #4638.30
-        movswq    %ax, %rax                                     #4638.30
-..LN4385:
-        movl      %eax, -116(%rbp)                              #4638.28
-..LN4387:
-        movl      -128(%rbp), %eax                              #4643.28
-..LN4389:
-        addl      %eax, %eax                                    #4643.34
-..LN4391:
-        movl      %eax, -128(%rbp)                              #4643.21
-..LN4393:
-        movl      -124(%rbp), %eax                              #4644.28
-..LN4395:
-        lea       1(%rax,%rax), %eax                            #4644.40
-..LN4397:
-        movl      %eax, -124(%rbp)                              #4644.21
-..LN4399:
-        movl      -120(%rbp), %eax                              #4645.28
-..LN4401:
-        lea       2(%rax,%rax), %eax                            #4645.40
-..LN4403:
-        movl      %eax, -120(%rbp)                              #4645.21
-..LN4405:
-        movl      -116(%rbp), %eax                              #4646.28
-..LN4407:
-        lea       3(%rax,%rax), %eax                            #4646.40
-..LN4409:
-        movl      %eax, -116(%rbp)                              #4646.21
-..LN4411:
-        movl      -56(%rbp), %eax                               #4650.26
-..LN4413:
-        testl     %eax, %eax                                    #4650.32
-        je        ..B27.23      # Prob 50%                      #4650.32
-                                # LOE
-..B27.21:                       # Preds ..B27.20
-..LN4415:
-        movl      -128(%rbp), %eax                              #4650.43
-        addl      -16(%rbp), %eax                               #4650.43
-..LN4417:
-        movl      -68(%rbp), %edx                               #4650.49
-        cmpl      %edx, %eax                                    #4650.49
-        ja        ..B27.23      # Prob 50%                      #4650.49
-                                # LOE
-..B27.22:                       # Preds ..B27.21
-..LN4419:
-        movl      $1, %eax                                      #4650.63
-        leave                                                   #4650.63
-..___tag_value_eval_4na_64.457:                                 #
-        ret                                                     #4650.63
-..___tag_value_eval_4na_64.458:                                 #
-                                # LOE
-..B27.23:                       # Preds ..B27.21 ..B27.20
-..LN4421:
-        movl      -60(%rbp), %eax                               #4651.26
-..LN4423:
-        testl     %eax, %eax                                    #4651.32
-        je        ..B27.26      # Prob 50%                      #4651.32
-                                # LOE
-..B27.24:                       # Preds ..B27.23
-..LN4425:
-        movl      -124(%rbp), %eax                              #4651.43
-        addl      -16(%rbp), %eax                               #4651.43
-..LN4427:
-        movl      -68(%rbp), %edx                               #4651.49
-        cmpl      %edx, %eax                                    #4651.49
-        ja        ..B27.26      # Prob 50%                      #4651.49
-                                # LOE
-..B27.25:                       # Preds ..B27.24
-..LN4429:
-        movl      $1, %eax                                      #4651.63
-        leave                                                   #4651.63
-..___tag_value_eval_4na_64.460:                                 #
-        ret                                                     #4651.63
-..___tag_value_eval_4na_64.461:                                 #
-                                # LOE
-..B27.26:                       # Preds ..B27.24 ..B27.23
-..LN4431:
-        movl      -64(%rbp), %eax                               #4652.26
-..LN4433:
-        testl     %eax, %eax                                    #4652.32
-        je        ..B27.29      # Prob 50%                      #4652.32
-                                # LOE
-..B27.27:                       # Preds ..B27.26
-..LN4435:
-        movl      -120(%rbp), %eax                              #4652.43
-        addl      -16(%rbp), %eax                               #4652.43
-..LN4437:
-        movl      -68(%rbp), %edx                               #4652.49
-        cmpl      %edx, %eax                                    #4652.49
-        ja        ..B27.29      # Prob 50%                      #4652.49
-                                # LOE
-..B27.28:                       # Preds ..B27.27
-..LN4439:
-        movl      $1, %eax                                      #4652.63
-        leave                                                   #4652.63
-..___tag_value_eval_4na_64.463:                                 #
-        ret                                                     #4652.63
-..___tag_value_eval_4na_64.464:                                 #
-                                # LOE
-..B27.29:                       # Preds ..B27.27 ..B27.26
-..LN4441:
-        movl      -72(%rbp), %eax                               #4653.26
-..LN4443:
-        testl     %eax, %eax                                    #4653.32
-        je        ..B27.32      # Prob 50%                      #4653.32
-                                # LOE
-..B27.30:                       # Preds ..B27.29
-..LN4445:
-        movl      -116(%rbp), %eax                              #4653.43
-        addl      -16(%rbp), %eax                               #4653.43
-..LN4447:
-        movl      -68(%rbp), %edx                               #4653.49
-        cmpl      %edx, %eax                                    #4653.49
-        ja        ..B27.32      # Prob 50%                      #4653.49
-                                # LOE
-..B27.31:                       # Preds ..B27.30
-..LN4449:
-        movl      $1, %eax                                      #4653.63
-        leave                                                   #4653.63
-..___tag_value_eval_4na_64.466:                                 #
-        ret                                                     #4653.63
-..___tag_value_eval_4na_64.467:                                 #
-                                # LOE
-..B27.32:                       # Preds ..B27.30 ..B27.29 ..B27.15
-..LN4451:
-        addl      $4, -16(%rbp)                                 #4658.17
-..LN4453:
-        movl      -16(%rbp), %eax                               #4661.22
-..LN4455:
-        movl      -68(%rbp), %edx                               #4661.28
-        cmpl      %edx, %eax                                    #4661.28
-        jbe       ..B27.34      # Prob 50%                      #4661.28
-                                # LOE
-..B27.33:                       # Preds ..B27.32
-..LN4457:
-        xorl      %eax, %eax                                    #4662.28
-        leave                                                   #4662.28
-..___tag_value_eval_4na_64.469:                                 #
-        ret                                                     #4662.28
-..___tag_value_eval_4na_64.470:                                 #
-                                # LOE
-..B27.34:                       # Preds ..B27.32
-..LN4459:
-        movl      -52(%rbp), %eax                               #4665.25
-        decl      %eax                                          #4665.25
-        movl      %eax, -52(%rbp)                               #4665.25
-..LN4461:
-        je        ..B27.39      # Prob 50%                      #4665.39
-                                # LOE
-..B27.35:                       # Preds ..B27.34
-..LN4463:
-        movdqa    -288(%rbp), %xmm0                             #4670.43
-..LN4465:
-        psrldq    $2, %xmm0                                     #4670.26
-..LN4467:
-        movdqa    %xmm0, -288(%rbp)                             #4670.17
-..LN4469:
-        movq      -80(%rbp), %rax                               #4673.22
-..LN4471:
-        movq      -88(%rbp), %rdx                               #4673.26
-        cmpq      %rdx, %rax                                    #4673.26
-        jae       ..B27.37      # Prob 50%                      #4673.26
-                                # LOE
-..B27.36:                       # Preds ..B27.35
-..LN4473:
-        movdqa    -288(%rbp), %xmm0                             #4674.49
-..LN4475:
-        movq      -80(%rbp), %rax                               #4674.72
-        movzbl    (%rax), %eax                                  #4674.72
-        movzbl    %al, %eax                                     #4674.72
-..LN4477:
-        movslq    %eax, %rax                                    #4674.57
-        lea       expand_2na.0(%rip), %rdx                      #4674.57
-        movzwl    (%rdx,%rax,2), %eax                           #4674.57
-        movzwl    %ax, %eax                                     #4674.57
-..LN4479:
-        pinsrw    $7, %eax, %xmm0                               #4674.30
-..LN4481:
-        movdqa    %xmm0, -288(%rbp)                             #4674.21
-                                # LOE
-..B27.37:                       # Preds ..B27.36 ..B27.35
-..LN4483:
-        incq      -80(%rbp)                                     #4677.20
-        jmp       ..B27.10      # Prob 100%                     #4677.20
-                                # LOE
-..B27.39:                       # Preds ..B27.34 ..B27.10
-..LN4485:
-        movq      -96(%rbp), %rax                               #4682.18
-..LN4487:
-        movq      -88(%rbp), %rdx                               #4682.25
-        cmpq      %rdx, %rax                                    #4682.25
-        jae       ..B27.43      # Prob 50%                      #4682.25
-                                # LOE
-..B27.40:                       # Preds ..B27.39
-..LN4489:
-        addl      $16, -16(%rbp)                                #4686.13
-..LN4491:
-        movl      -16(%rbp), %eax                               #4687.18
-..LN4493:
-        movl      -68(%rbp), %edx                               #4687.24
-        cmpl      %edx, %eax                                    #4687.24
-        ja        ..B27.43      # Prob 50%                      #4687.24
-                                # LOE
-..B27.41:                       # Preds ..B27.40
-..LN4495:
-        movq      -96(%rbp), %rax                               #4692.41
-..LN4497:
-        movq      -88(%rbp), %rdx                               #4692.46
-..LN4499:
-        movq      %rax, %rdi                                    #4692.22
-        movq      %rdx, %rsi                                    #4692.22
-        call      prime_buffer_4na at PLT                          #4692.22
-                                # LOE xmm0
-..B27.51:                       # Preds ..B27.41
-        movdqa    %xmm0, -336(%rbp)                             #4692.22
-                                # LOE
-..B27.42:                       # Preds ..B27.51
-..LN4501:
-        movdqa    -336(%rbp), %xmm0                             #4692.13
-        movdqa    %xmm0, -288(%rbp)                             #4692.13
-..LN4503:
-        addq      $8, -96(%rbp)                                 #4707.13
-..LN4505:
-        movq      -96(%rbp), %rax                               #4709.17
-..LN4507:
-        movq      %rax, -80(%rbp)                               #4709.13
-        jmp       ..B27.8       # Prob 100%                     #4709.13
-                                # LOE
-..B27.43:                       # Preds ..B27.40 ..B27.39 ..B27.8
-..LN4509:
-        xorl      %eax, %eax                                    #4718.12
-        leave                                                   #4718.12
-..___tag_value_eval_4na_64.472:                                 #
-        ret                                                     #4718.12
-        .align    2,0x90
-..___tag_value_eval_4na_64.473:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-.LNeval_4na_64:
-	.data
-# -- End  eval_4na_64
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    2,0x90
-eval_4na_128:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B28.1:                        # Preds ..B28.0
-..___tag_value_eval_4na_128.476:                                #
-..LN4511:
-        pushq     %rbp                                          #4724.1
-        movq      %rsp, %rbp                                    #4724.1
-..___tag_value_eval_4na_128.477:                                #
-        subq      $320, %rsp                                    #4724.1
-        movq      %rdi, -40(%rbp)                               #4724.1
-        movq      %rsi, -32(%rbp)                               #4724.1
-        movl      %edx, -16(%rbp)                               #4724.1
-        movl      %ecx, -8(%rbp)                                #4724.1
-..LN4513:
-        movq      -40(%rbp), %rax                               #4750.25
-        movl      4(%rax), %eax                                 #4750.25
-..LN4515:
-        movl      %eax, -24(%rbp)                               #4750.23
-..LN4517:
-        movl      -8(%rbp), %eax                                #4753.5
-        movl      -24(%rbp), %edx                               #4753.5
-        cmpl      %edx, %eax                                    #4753.5
-        jae       ..B28.3       # Prob 50%                      #4753.5
-                                # LOE
-..B28.2:                        # Preds ..B28.1
-        lea       _2__STRING.9.0(%rip), %rax                    #4753.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #4753.5
-        lea       __$Ue.0(%rip), %rcx                           #4753.5
-        movq      %rax, %rdi                                    #4753.5
-        movq      %rdx, %rsi                                    #4753.5
-        movl      $4753, %edx                                   #4753.5
-        call      __assert_fail at PLT                             #4753.5
-                                # LOE
-..B28.3:                        # Preds ..B28.1
-..LN4519:
-        movl      -16(%rbp), %eax                               #4757.12
-..LN4521:
-        addl      -8(%rbp), %eax                                #4757.5
-        movl      %eax, -8(%rbp)                                #4757.5
-..LN4523:
-        movl      -16(%rbp), %eax                               #4760.42
-..LN4525:
-        shrl      $2, %eax                                      #4760.49
-..LN4527:
-        addq      -32(%rbp), %rax                               #4760.30
-..LN4529:
-        movq      %rax, -88(%rbp)                               #4760.5
-..LN4531:
-        movl      -24(%rbp), %eax                               #4763.18
-        negl      %eax                                          #4763.18
-        addl      -8(%rbp), %eax                                #4763.18
-..LN4533:
-        movl      %eax, -64(%rbp)                               #4763.5
-..LN4535:
-        movl      -8(%rbp), %eax                                #4766.44
-..LN4537:
-        addl      $3, %eax                                      #4766.50
-..LN4539:
-        shrl      $2, %eax                                      #4766.57
-..LN4541:
-        addq      -32(%rbp), %rax                               #4766.30
-..LN4543:
-        movq      %rax, -80(%rbp)                               #4766.5
-..LN4545:
-        movq      -88(%rbp), %rax                               #4769.33
-..LN4547:
-        movq      -80(%rbp), %rdx                               #4769.38
-..LN4549:
-        movq      %rax, %rdi                                    #4769.14
-        movq      %rdx, %rsi                                    #4769.14
-        call      prime_buffer_4na at PLT                          #4769.14
-                                # LOE xmm0
-..B28.41:                       # Preds ..B28.3
-        movdqa    %xmm0, -112(%rbp)                             #4769.14
-                                # LOE
-..B28.4:                        # Preds ..B28.41
-..LN4551:
-        movdqa    -112(%rbp), %xmm0                             #4769.5
-        movdqa    %xmm0, -256(%rbp)                             #4769.5
-..LN4553:
-        addq      $8, -88(%rbp)                                 #4770.5
-..LN4555:
-        movq      -88(%rbp), %rax                               #4772.9
-..LN4557:
-        movq      %rax, -72(%rbp)                               #4772.5
-..LN4559:
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    16(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -240(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    32(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -224(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    48(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -208(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    64(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -192(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    80(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -176(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    96(%rax), %xmm0                               #4776.5
-        movdqa    %xmm0, -160(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    112(%rax), %xmm0                              #4776.5
-        movdqa    %xmm0, -144(%rbp)                             #4776.5
-        movq      -40(%rbp), %rax                               #4776.5
-        movdqa    128(%rax), %xmm0                              #4776.5
-        movdqa    %xmm0, -128(%rbp)                             #4776.5
-..LN4561:
-        xorl      %eax, %eax                                    #4779.15
-        movl      %eax, -60(%rbp)                               #4779.15
-..LN4563:
-        movl      %eax, -56(%rbp)                               #4779.10
-..LN4565:
-        movl      %eax, -52(%rbp)                               #4779.5
-..LN4567:
-        movl      -16(%rbp), %eax                               #4781.27
-        negl      %eax                                          #4781.27
-..LN4569:
-        movl      -64(%rbp), %edx                               #4781.20
-..LN4571:
-        lea       7(%rdx,%rax), %eax                            #4781.33
-..LN4573:
-        shrl      $2, %eax                                      #4781.40
-..LN4575:
-        movl      %eax, -48(%rbp)                               #4781.5
-..LN4577:
-        movl      -16(%rbp), %eax                               #4790.14
-..LN4579:
-        andl      $3, %eax                                      #4790.20
-        movl      %eax, -44(%rbp)                               #4790.20
-        je        ..B28.12      # Prob 50%                      #4790.20
-                                # LOE
-..B28.5:                        # Preds ..B28.4
-        movl      -44(%rbp), %eax                               #4790.20
-        cmpl      $1, %eax                                      #4790.20
-        je        ..B28.13      # Prob 50%                      #4790.20
-                                # LOE
-..B28.6:                        # Preds ..B28.5
-        movl      -44(%rbp), %eax                               #4790.20
-        cmpl      $2, %eax                                      #4790.20
-        je        ..B28.14      # Prob 50%                      #4790.20
-                                # LOE
-..B28.7:                        # Preds ..B28.6
-        movl      -44(%rbp), %eax                               #4790.20
-        cmpl      $3, %eax                                      #4790.20
-        je        ..B28.15      # Prob 50%                      #4790.20
-                                # LOE
-..B28.8:                        # Preds ..B28.37 ..B28.7
-..LN4581:
-        movl      $1, %eax                                      #4795.9
-        testl     %eax, %eax                                    #4795.9
-        je        ..B28.38      # Prob 100%                     #4795.9
-                                # LOE
-..B28.9:                        # Preds ..B28.8
-..LN4583:
-        movl      $8, -48(%rbp)                                 #4797.13
-                                # LOE
-..B28.10:                       # Preds ..B28.32 ..B28.9
-..LN4585:
-        movl      $1, %eax                                      #4800.13
-        testl     %eax, %eax                                    #4800.13
-        je        ..B28.34      # Prob 100%                     #4800.13
-                                # LOE
-..B28.12:                       # Preds ..B28.4 ..B28.10
-..LN4587:
-        movdqa    -256(%rbp), %xmm0                             #4807.38
-..LN4589:
-        movdqa    -240(%rbp), %xmm1                             #4807.46
-..LN4591:
-        pand      %xmm1, %xmm0                                  #4807.22
-..LN4593:
-        movdqa    %xmm0, -304(%rbp)                             #4807.17
-..LN4595:
-        movdqa    -256(%rbp), %xmm0                             #4808.38
-..LN4597:
-        movdqa    -224(%rbp), %xmm1                             #4808.46
-..LN4599:
-        pand      %xmm1, %xmm0                                  #4808.22
-..LN4601:
-        movdqa    %xmm0, -288(%rbp)                             #4808.17
-..LN4603:
-        movdqa    -304(%rbp), %xmm0                             #4809.22
-        movdqa    -288(%rbp), %xmm1                             #4809.22
-        pcmpeqd   %xmm1, %xmm0                                  #4809.22
-..LN4605:
-        movdqa    %xmm0, -304(%rbp)                             #4809.17
-..LN4607:
-        movdqa    -304(%rbp), %xmm0                             #4810.42
-..LN4609:
-        pmovmskb  %xmm0, %eax                                   #4810.22
-..LN4611:
-        movl      %eax, -52(%rbp)                               #4810.17
-..LN4613:
-        movl      -52(%rbp), %eax                               #4811.17
-        incl      %eax                                          #4811.17
-        sarl      $16, %eax                                     #4811.17
-        negl      %eax                                          #4811.17
-        movl      %eax, -52(%rbp)                               #4811.17
-                                # LOE
-..B28.13:                       # Preds ..B28.5 ..B28.12
-..LN4615:
-        movdqa    -256(%rbp), %xmm0                             #4814.38
-..LN4617:
-        movdqa    -208(%rbp), %xmm1                             #4814.46
-..LN4619:
-        pand      %xmm1, %xmm0                                  #4814.22
-..LN4621:
-        movdqa    %xmm0, -304(%rbp)                             #4814.17
-..LN4623:
-        movdqa    -256(%rbp), %xmm0                             #4815.38
-..LN4625:
-        movdqa    -192(%rbp), %xmm1                             #4815.46
-..LN4627:
-        pand      %xmm1, %xmm0                                  #4815.22
-..LN4629:
-        movdqa    %xmm0, -288(%rbp)                             #4815.17
-..LN4631:
-        movdqa    -304(%rbp), %xmm0                             #4816.22
-        movdqa    -288(%rbp), %xmm1                             #4816.22
-        pcmpeqd   %xmm1, %xmm0                                  #4816.22
-..LN4633:
-        movdqa    %xmm0, -304(%rbp)                             #4816.17
-..LN4635:
-        movdqa    -304(%rbp), %xmm0                             #4817.42
-..LN4637:
-        pmovmskb  %xmm0, %eax                                   #4817.22
-..LN4639:
-        movl      %eax, -56(%rbp)                               #4817.17
-..LN4641:
-        movl      -56(%rbp), %eax                               #4818.17
-        incl      %eax                                          #4818.17
-        sarl      $16, %eax                                     #4818.17
-        negl      %eax                                          #4818.17
-        movl      %eax, -56(%rbp)                               #4818.17
-                                # LOE
-..B28.14:                       # Preds ..B28.6 ..B28.13
-..LN4643:
-        movdqa    -256(%rbp), %xmm0                             #4821.38
-..LN4645:
-        movdqa    -176(%rbp), %xmm1                             #4821.46
-..LN4647:
-        pand      %xmm1, %xmm0                                  #4821.22
-..LN4649:
-        movdqa    %xmm0, -304(%rbp)                             #4821.17
-..LN4651:
-        movdqa    -256(%rbp), %xmm0                             #4822.38
-..LN4653:
-        movdqa    -160(%rbp), %xmm1                             #4822.46
-..LN4655:
-        pand      %xmm1, %xmm0                                  #4822.22
-..LN4657:
-        movdqa    %xmm0, -288(%rbp)                             #4822.17
-..LN4659:
-        movdqa    -304(%rbp), %xmm0                             #4823.22
-        movdqa    -288(%rbp), %xmm1                             #4823.22
-        pcmpeqd   %xmm1, %xmm0                                  #4823.22
-..LN4661:
-        movdqa    %xmm0, -304(%rbp)                             #4823.17
-..LN4663:
-        movdqa    -304(%rbp), %xmm0                             #4824.42
-..LN4665:
-        pmovmskb  %xmm0, %eax                                   #4824.22
-..LN4667:
-        movl      %eax, -60(%rbp)                               #4824.17
-..LN4669:
-        movl      -60(%rbp), %eax                               #4825.17
-        incl      %eax                                          #4825.17
-        sarl      $16, %eax                                     #4825.17
-        negl      %eax                                          #4825.17
-        movl      %eax, -60(%rbp)                               #4825.17
-                                # LOE
-..B28.15:                       # Preds ..B28.7 ..B28.14
-..LN4671:
-        movdqa    -256(%rbp), %xmm0                             #4828.38
-..LN4673:
-        movdqa    -144(%rbp), %xmm1                             #4828.46
-..LN4675:
-        pand      %xmm1, %xmm0                                  #4828.22
-..LN4677:
-        movdqa    %xmm0, -304(%rbp)                             #4828.17
-..LN4679:
-        movdqa    -256(%rbp), %xmm0                             #4829.38
-..LN4681:
-        movdqa    -128(%rbp), %xmm1                             #4829.46
-..LN4683:
-        pand      %xmm1, %xmm0                                  #4829.22
-..LN4685:
-        movdqa    %xmm0, -288(%rbp)                             #4829.17
-..LN4687:
-        movdqa    -304(%rbp), %xmm0                             #4830.22
-        movdqa    -288(%rbp), %xmm1                             #4830.22
-        pcmpeqd   %xmm1, %xmm0                                  #4830.22
-..LN4689:
-        movdqa    %xmm0, -304(%rbp)                             #4830.17
-..LN4691:
-        movdqa    -304(%rbp), %xmm0                             #4831.42
-..LN4693:
-        pmovmskb  %xmm0, %eax                                   #4831.22
-..LN4695:
-        movl      %eax, -96(%rbp)                               #4831.17
-..LN4697:
-        movl      -96(%rbp), %eax                               #4832.17
-        incl      %eax                                          #4832.17
-        sarl      $16, %eax                                     #4832.17
-        negl      %eax                                          #4832.17
-        movl      %eax, -96(%rbp)                               #4832.17
-..LN4699:
-        andl      $-4, -16(%rbp)                                #4836.17
-..LN4701:
-        movl      -56(%rbp), %eax                               #4839.29
-        orl       -52(%rbp), %eax                               #4839.29
-..LN4703:
-        orl       -60(%rbp), %eax                               #4839.34
-..LN4705:
-        orl       -96(%rbp), %eax                               #4839.39
-..LN4707:
-        je        ..B28.27      # Prob 50%                      #4839.47
-                                # LOE
-..B28.16:                       # Preds ..B28.15
-..LN4709:
-        movl      -16(%rbp), %eax                               #4842.37
-        negl      %eax                                          #4842.37
-        addl      -64(%rbp), %eax                               #4842.37
-        movl      %eax, -272(%rbp)                              #4842.37
-        cmpl      $2, %eax                                      #4842.37
-        je        ..B28.20      # Prob 50%                      #4842.37
-                                # LOE
-..B28.17:                       # Preds ..B28.16
-        movl      -272(%rbp), %eax                              #4842.37
-        cmpl      $1, %eax                                      #4842.37
-        je        ..B28.22      # Prob 50%                      #4842.37
-                                # LOE
-..B28.18:                       # Preds ..B28.17
-        movl      -272(%rbp), %eax                              #4842.37
-        testl     %eax, %eax                                    #4842.37
-        je        ..B28.24      # Prob 50%                      #4842.37
-                                # LOE
-..B28.19:                       # Preds ..B28.18
-..LN4711:
-        movl      $1, %eax                                      #4845.32
-        leave                                                   #4845.32
-..___tag_value_eval_4na_128.481:                                #
-        ret                                                     #4845.32
-..___tag_value_eval_4na_128.482:                                #
-                                # LOE
-..B28.20:                       # Preds ..B28.16
-..LN4713:
-        movl      -60(%rbp), %eax                               #4847.30
-..LN4715:
-        testl     %eax, %eax                                    #4847.36
-        je        ..B28.22      # Prob 50%                      #4847.36
-                                # LOE
-..B28.21:                       # Preds ..B28.20
-..LN4717:
-        movl      $1, %eax                                      #4847.47
-        leave                                                   #4847.47
-..___tag_value_eval_4na_128.484:                                #
-        ret                                                     #4847.47
-..___tag_value_eval_4na_128.485:                                #
-                                # LOE
-..B28.22:                       # Preds ..B28.20 ..B28.17
-..LN4719:
-        movl      -56(%rbp), %eax                               #4849.30
-..LN4721:
-        testl     %eax, %eax                                    #4849.36
-        je        ..B28.24      # Prob 50%                      #4849.36
-                                # LOE
-..B28.23:                       # Preds ..B28.22
-..LN4723:
-        movl      $1, %eax                                      #4849.47
-        leave                                                   #4849.47
-..___tag_value_eval_4na_128.487:                                #
-        ret                                                     #4849.47
-..___tag_value_eval_4na_128.488:                                #
-                                # LOE
-..B28.24:                       # Preds ..B28.22 ..B28.18
-..LN4725:
-        movl      -52(%rbp), %eax                               #4851.30
-..LN4727:
-        testl     %eax, %eax                                    #4851.36
-        je        ..B28.26      # Prob 50%                      #4851.36
-                                # LOE
-..B28.25:                       # Preds ..B28.24
-..LN4729:
-        movl      $1, %eax                                      #4851.47
-        leave                                                   #4851.47
-..___tag_value_eval_4na_128.490:                                #
-        ret                                                     #4851.47
-..___tag_value_eval_4na_128.491:                                #
-                                # LOE
-..B28.26:                       # Preds ..B28.24
-..LN4731:
-        xorl      %eax, %eax                                    #4853.28
-        leave                                                   #4853.28
-..___tag_value_eval_4na_128.493:                                #
-        ret                                                     #4853.28
-..___tag_value_eval_4na_128.494:                                #
-                                # LOE
-..B28.27:                       # Preds ..B28.15
-..LN4733:
-        addl      $4, -16(%rbp)                                 #4880.17
-..LN4735:
-        movl      -16(%rbp), %eax                               #4883.22
-..LN4737:
-        movl      -64(%rbp), %edx                               #4883.28
-        cmpl      %edx, %eax                                    #4883.28
-        jbe       ..B28.29      # Prob 50%                      #4883.28
-                                # LOE
-..B28.28:                       # Preds ..B28.27
-..LN4739:
-        xorl      %eax, %eax                                    #4884.28
-        leave                                                   #4884.28
-..___tag_value_eval_4na_128.496:                                #
-        ret                                                     #4884.28
-..___tag_value_eval_4na_128.497:                                #
-                                # LOE
-..B28.29:                       # Preds ..B28.27
-..LN4741:
-        movl      -48(%rbp), %eax                               #4887.25
-        decl      %eax                                          #4887.25
-        movl      %eax, -48(%rbp)                               #4887.25
-..LN4743:
-        je        ..B28.34      # Prob 50%                      #4887.39
-                                # LOE
-..B28.30:                       # Preds ..B28.29
-..LN4745:
-        movdqa    -256(%rbp), %xmm0                             #4892.43
-..LN4747:
-        psrldq    $2, %xmm0                                     #4892.26
-..LN4749:
-        movdqa    %xmm0, -256(%rbp)                             #4892.17
-..LN4751:
-        movq      -72(%rbp), %rax                               #4895.22
-..LN4753:
-        movq      -80(%rbp), %rdx                               #4895.26
-        cmpq      %rdx, %rax                                    #4895.26
-        jae       ..B28.32      # Prob 50%                      #4895.26
-                                # LOE
-..B28.31:                       # Preds ..B28.30
-..LN4755:
-        movdqa    -256(%rbp), %xmm0                             #4896.49
-..LN4757:
-        movq      -72(%rbp), %rax                               #4896.72
-        movzbl    (%rax), %eax                                  #4896.72
-        movzbl    %al, %eax                                     #4896.72
-..LN4759:
-        movslq    %eax, %rax                                    #4896.57
-        lea       expand_2na.0(%rip), %rdx                      #4896.57
-        movzwl    (%rdx,%rax,2), %eax                           #4896.57
-        movzwl    %ax, %eax                                     #4896.57
-..LN4761:
-        pinsrw    $7, %eax, %xmm0                               #4896.30
-..LN4763:
-        movdqa    %xmm0, -256(%rbp)                             #4896.21
-                                # LOE
-..B28.32:                       # Preds ..B28.31 ..B28.30
-..LN4765:
-        incq      -72(%rbp)                                     #4899.20
-        jmp       ..B28.10      # Prob 100%                     #4899.20
-                                # LOE
-..B28.34:                       # Preds ..B28.29 ..B28.10
-..LN4767:
-        movq      -88(%rbp), %rax                               #4904.18
-..LN4769:
-        movq      -80(%rbp), %rdx                               #4904.25
-        cmpq      %rdx, %rax                                    #4904.25
-        jae       ..B28.38      # Prob 50%                      #4904.25
-                                # LOE
-..B28.35:                       # Preds ..B28.34
-..LN4771:
-        movl      -16(%rbp), %eax                               #4909.18
-..LN4773:
-        movl      -64(%rbp), %edx                               #4909.24
-        cmpl      %edx, %eax                                    #4909.24
-        ja        ..B28.38      # Prob 50%                      #4909.24
-                                # LOE
-..B28.36:                       # Preds ..B28.35
-..LN4775:
-        movq      -88(%rbp), %rax                               #4914.41
-..LN4777:
-        movq      -80(%rbp), %rdx                               #4914.46
-..LN4779:
-        movq      %rax, %rdi                                    #4914.22
-        movq      %rdx, %rsi                                    #4914.22
-        call      prime_buffer_4na at PLT                          #4914.22
-                                # LOE xmm0
-..B28.42:                       # Preds ..B28.36
-        movdqa    %xmm0, -320(%rbp)                             #4914.22
-                                # LOE
-..B28.37:                       # Preds ..B28.42
-..LN4781:
-        movdqa    -320(%rbp), %xmm0                             #4914.13
-        movdqa    %xmm0, -256(%rbp)                             #4914.13
-..LN4783:
-        addq      $8, -88(%rbp)                                 #4929.13
-..LN4785:
-        movq      -88(%rbp), %rax                               #4931.17
-..LN4787:
-        movq      %rax, -72(%rbp)                               #4931.13
-        jmp       ..B28.8       # Prob 100%                     #4931.13
-                                # LOE
-..B28.38:                       # Preds ..B28.35 ..B28.34 ..B28.8
-..LN4789:
-        xorl      %eax, %eax                                    #4940.12
-        leave                                                   #4940.12
-..___tag_value_eval_4na_128.499:                                #
-        ret                                                     #4940.12
-        .align    2,0x90
-..___tag_value_eval_4na_128.500:                                #
-                                # LOE
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-.LNeval_4na_128:
-	.data
-# -- End  eval_4na_128
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    2,0x90
-eval_4na_pos:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B29.1:                        # Preds ..B29.0
-..___tag_value_eval_4na_pos.503:                                #
-..LN4791:
-        pushq     %rbp                                          #4946.1
-        movq      %rsp, %rbp                                    #4946.1
-..___tag_value_eval_4na_pos.504:                                #
-        subq      $336, %rsp                                    #4946.1
-        movq      %rdi, -48(%rbp)                               #4946.1
-        movq      %rsi, -40(%rbp)                               #4946.1
-        movl      %edx, -24(%rbp)                               #4946.1
-        movl      %ecx, -16(%rbp)                               #4946.1
-..LN4793:
-        movq      -48(%rbp), %rax                               #4978.25
-        movl      4(%rax), %eax                                 #4978.25
-..LN4795:
-        movl      %eax, -32(%rbp)                               #4978.23
-..LN4797:
-        movl      -16(%rbp), %eax                               #4981.5
-        movl      -32(%rbp), %edx                               #4981.5
-        cmpl      %edx, %eax                                    #4981.5
-        jae       ..B29.3       # Prob 50%                      #4981.5
-                                # LOE
-..B29.2:                        # Preds ..B29.1
-        lea       _2__STRING.9.0(%rip), %rax                    #4981.5
-        lea       _2__STRING.1.0(%rip), %rdx                    #4981.5
-        lea       __$Uf.0(%rip), %rcx                           #4981.5
-        movq      %rax, %rdi                                    #4981.5
-        movq      %rdx, %rsi                                    #4981.5
-        movl      $4981, %edx                                   #4981.5
-        call      __assert_fail at PLT                             #4981.5
-                                # LOE
-..B29.3:                        # Preds ..B29.1
-..LN4799:
-        movl      -24(%rbp), %eax                               #4985.12
-..LN4801:
-        addl      -16(%rbp), %eax                               #4985.5
-        movl      %eax, -16(%rbp)                               #4985.5
-..LN4803:
-        movl      -24(%rbp), %eax                               #4989.13
-..LN4805:
-        movl      %eax, -80(%rbp)                               #4989.5
-..LN4807:
-        movl      -24(%rbp), %eax                               #4993.42
-..LN4809:
-        shrl      $2, %eax                                      #4993.49
-..LN4811:
-        addq      -40(%rbp), %rax                               #4993.30
-..LN4813:
-        movq      %rax, -104(%rbp)                              #4993.5
-..LN4815:
-        movl      -32(%rbp), %eax                               #4996.18
-        negl      %eax                                          #4996.18
-        addl      -16(%rbp), %eax                               #4996.18
-..LN4817:
-        movl      %eax, -76(%rbp)                               #4996.5
-..LN4819:
-        movl      -16(%rbp), %eax                               #4999.44
-..LN4821:
-        addl      $3, %eax                                      #4999.50
-..LN4823:
-        shrl      $2, %eax                                      #4999.57
-..LN4825:
-        addq      -40(%rbp), %rax                               #4999.30
-..LN4827:
-        movq      %rax, -96(%rbp)                               #4999.5
-..LN4829:
-        movq      -104(%rbp), %rax                              #5002.33
-..LN4831:
-        movq      -96(%rbp), %rdx                               #5002.38
-..LN4833:
-        movq      %rax, %rdi                                    #5002.14
-        movq      %rdx, %rsi                                    #5002.14
-        call      prime_buffer_4na at PLT                          #5002.14
-                                # LOE xmm0
-..B29.54:                       # Preds ..B29.3
-        movdqa    %xmm0, -128(%rbp)                             #5002.14
-                                # LOE
-..B29.4:                        # Preds ..B29.54
-..LN4835:
-        movdqa    -128(%rbp), %xmm0                             #5002.5
-        movdqa    %xmm0, -272(%rbp)                             #5002.5
-..LN4837:
-        addq      $8, -104(%rbp)                                #5003.5
-..LN4839:
-        movq      -104(%rbp), %rax                              #5005.9
-..LN4841:
-        movq      %rax, -88(%rbp)                               #5005.5
-..LN4843:
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    16(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -256(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    32(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -240(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    48(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -224(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    64(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -208(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    80(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -192(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    96(%rax), %xmm0                               #5009.5
-        movdqa    %xmm0, -176(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    112(%rax), %xmm0                              #5009.5
-        movdqa    %xmm0, -160(%rbp)                             #5009.5
-        movq      -48(%rbp), %rax                               #5009.5
-        movdqa    128(%rax), %xmm0                              #5009.5
-        movdqa    %xmm0, -144(%rbp)                             #5009.5
-..LN4845:
-        xorl      %eax, %eax                                    #5012.15
-        movl      %eax, -72(%rbp)                               #5012.15
-..LN4847:
-        movl      %eax, -68(%rbp)                               #5012.10
-..LN4849:
-        movl      %eax, -64(%rbp)                               #5012.5
-..LN4851:
-        movl      -24(%rbp), %eax                               #5014.27
-        negl      %eax                                          #5014.27
-..LN4853:
-        movl      -76(%rbp), %edx                               #5014.20
-..LN4855:
-        lea       7(%rdx,%rax), %eax                            #5014.33
-..LN4857:
-        shrl      $2, %eax                                      #5014.40
-..LN4859:
-        movl      %eax, -60(%rbp)                               #5014.5
-..LN4861:
-        movl      -24(%rbp), %eax                               #5023.14
-..LN4863:
-        andl      $3, %eax                                      #5023.20
-        movl      %eax, -56(%rbp)                               #5023.20
-        je        ..B29.12      # Prob 50%                      #5023.20
-                                # LOE
-..B29.5:                        # Preds ..B29.4
-        movl      -56(%rbp), %eax                               #5023.20
-        cmpl      $1, %eax                                      #5023.20
-        je        ..B29.13      # Prob 50%                      #5023.20
-                                # LOE
-..B29.6:                        # Preds ..B29.5
-        movl      -56(%rbp), %eax                               #5023.20
-        cmpl      $2, %eax                                      #5023.20
-        je        ..B29.14      # Prob 50%                      #5023.20
-                                # LOE
-..B29.7:                        # Preds ..B29.6
-        movl      -56(%rbp), %eax                               #5023.20
-        cmpl      $3, %eax                                      #5023.20
-        je        ..B29.15      # Prob 50%                      #5023.20
-                                # LOE
-..B29.8:                        # Preds ..B29.50 ..B29.7
-..LN4865:
-        movl      $1, %eax                                      #5028.9
-        testl     %eax, %eax                                    #5028.9
-        je        ..B29.51      # Prob 100%                     #5028.9
-                                # LOE
-..B29.9:                        # Preds ..B29.8
-..LN4867:
-        movl      $8, -60(%rbp)                                 #5030.13
-                                # LOE
-..B29.10:                       # Preds ..B29.45 ..B29.9
-..LN4869:
-        movl      $1, %eax                                      #5033.13
-        testl     %eax, %eax                                    #5033.13
-        je        ..B29.47      # Prob 100%                     #5033.13
-                                # LOE
-..B29.12:                       # Preds ..B29.4 ..B29.10
-..LN4871:
-        movdqa    -272(%rbp), %xmm0                             #5040.38
-..LN4873:
-        movdqa    -256(%rbp), %xmm1                             #5040.46
-..LN4875:
-        pand      %xmm1, %xmm0                                  #5040.22
-..LN4877:
-        movdqa    %xmm0, -320(%rbp)                             #5040.17
-..LN4879:
-        movdqa    -272(%rbp), %xmm0                             #5041.38
-..LN4881:
-        movdqa    -240(%rbp), %xmm1                             #5041.46
-..LN4883:
-        pand      %xmm1, %xmm0                                  #5041.22
-..LN4885:
-        movdqa    %xmm0, -304(%rbp)                             #5041.17
-..LN4887:
-        movdqa    -320(%rbp), %xmm0                             #5042.22
-        movdqa    -304(%rbp), %xmm1                             #5042.22
-        pcmpeqd   %xmm1, %xmm0                                  #5042.22
-..LN4889:
-        movdqa    %xmm0, -320(%rbp)                             #5042.17
-..LN4891:
-        movdqa    -320(%rbp), %xmm0                             #5043.42
-..LN4893:
-        pmovmskb  %xmm0, %eax                                   #5043.22
-..LN4895:
-        movl      %eax, -64(%rbp)                               #5043.17
-..LN4897:
-        movl      -64(%rbp), %eax                               #5044.17
-        incl      %eax                                          #5044.17
-        sarl      $16, %eax                                     #5044.17
-        negl      %eax                                          #5044.17
-        movl      %eax, -64(%rbp)                               #5044.17
-                                # LOE
-..B29.13:                       # Preds ..B29.5 ..B29.12
-..LN4899:
-        movdqa    -272(%rbp), %xmm0                             #5047.38
-..LN4901:
-        movdqa    -224(%rbp), %xmm1                             #5047.46
-..LN4903:
-        pand      %xmm1, %xmm0                                  #5047.22
-..LN4905:
-        movdqa    %xmm0, -320(%rbp)                             #5047.17
-..LN4907:
-        movdqa    -272(%rbp), %xmm0                             #5048.38
-..LN4909:
-        movdqa    -208(%rbp), %xmm1                             #5048.46
-..LN4911:
-        pand      %xmm1, %xmm0                                  #5048.22
-..LN4913:
-        movdqa    %xmm0, -304(%rbp)                             #5048.17
-..LN4915:
-        movdqa    -320(%rbp), %xmm0                             #5049.22
-        movdqa    -304(%rbp), %xmm1                             #5049.22
-        pcmpeqd   %xmm1, %xmm0                                  #5049.22
-..LN4917:
-        movdqa    %xmm0, -320(%rbp)                             #5049.17
-..LN4919:
-        movdqa    -320(%rbp), %xmm0                             #5050.42
-..LN4921:
-        pmovmskb  %xmm0, %eax                                   #5050.22
-..LN4923:
-        movl      %eax, -68(%rbp)                               #5050.17
-..LN4925:
-        movl      -68(%rbp), %eax                               #5051.17
-        incl      %eax                                          #5051.17
-        sarl      $16, %eax                                     #5051.17
-        negl      %eax                                          #5051.17
-        movl      %eax, -68(%rbp)                               #5051.17
-                                # LOE
-..B29.14:                       # Preds ..B29.6 ..B29.13
-..LN4927:
-        movdqa    -272(%rbp), %xmm0                             #5054.38
-..LN4929:
-        movdqa    -192(%rbp), %xmm1                             #5054.46
-..LN4931:
-        pand      %xmm1, %xmm0                                  #5054.22
-..LN4933:
-        movdqa    %xmm0, -320(%rbp)                             #5054.17
-..LN4935:
-        movdqa    -272(%rbp), %xmm0                             #5055.38
-..LN4937:
-        movdqa    -176(%rbp), %xmm1                             #5055.46
-..LN4939:
-        pand      %xmm1, %xmm0                                  #5055.22
-..LN4941:
-        movdqa    %xmm0, -304(%rbp)                             #5055.17
-..LN4943:
-        movdqa    -320(%rbp), %xmm0                             #5056.22
-        movdqa    -304(%rbp), %xmm1                             #5056.22
-        pcmpeqd   %xmm1, %xmm0                                  #5056.22
-..LN4945:
-        movdqa    %xmm0, -320(%rbp)                             #5056.17
-..LN4947:
-        movdqa    -320(%rbp), %xmm0                             #5057.42
-..LN4949:
-        pmovmskb  %xmm0, %eax                                   #5057.22
-..LN4951:
-        movl      %eax, -72(%rbp)                               #5057.17
-..LN4953:
-        movl      -72(%rbp), %eax                               #5058.17
-        incl      %eax                                          #5058.17
-        sarl      $16, %eax                                     #5058.17
-        negl      %eax                                          #5058.17
-        movl      %eax, -72(%rbp)                               #5058.17
-                                # LOE
-..B29.15:                       # Preds ..B29.7 ..B29.14
-..LN4955:
-        movdqa    -272(%rbp), %xmm0                             #5061.38
-..LN4957:
-        movdqa    -160(%rbp), %xmm1                             #5061.46
-..LN4959:
-        pand      %xmm1, %xmm0                                  #5061.22
-..LN4961:
-        movdqa    %xmm0, -320(%rbp)                             #5061.17
-..LN4963:
-        movdqa    -272(%rbp), %xmm0                             #5062.38
-..LN4965:
-        movdqa    -144(%rbp), %xmm1                             #5062.46
-..LN4967:
-        pand      %xmm1, %xmm0                                  #5062.22
-..LN4969:
-        movdqa    %xmm0, -304(%rbp)                             #5062.17
-..LN4971:
-        movdqa    -320(%rbp), %xmm0                             #5063.22
-        movdqa    -304(%rbp), %xmm1                             #5063.22
-        pcmpeqd   %xmm1, %xmm0                                  #5063.22
-..LN4973:
-        movdqa    %xmm0, -320(%rbp)                             #5063.17
-..LN4975:
-        movdqa    -320(%rbp), %xmm0                             #5064.42
-..LN4977:
-        pmovmskb  %xmm0, %eax                                   #5064.22
-..LN4979:
-        movl      %eax, -112(%rbp)                              #5064.17
-..LN4981:
-        movl      -112(%rbp), %eax                              #5065.17
-        incl      %eax                                          #5065.17
-        sarl      $16, %eax                                     #5065.17
-        negl      %eax                                          #5065.17
-        movl      %eax, -112(%rbp)                              #5065.17
-..LN4983:
-        andl      $-4, -24(%rbp)                                #5069.17
-..LN4985:
-        movl      -68(%rbp), %eax                               #5072.29
-        orl       -64(%rbp), %eax                               #5072.29
-..LN4987:
-        orl       -72(%rbp), %eax                               #5072.34
-..LN4989:
-        orl       -112(%rbp), %eax                              #5072.39
-..LN4991:
-        je        ..B29.40      # Prob 50%                      #5072.47
-                                # LOE
-..B29.16:                       # Preds ..B29.15
-..LN4993:
-        movl      -24(%rbp), %eax                               #5075.37
-        negl      %eax                                          #5075.37
-        addl      -76(%rbp), %eax                               #5075.37
-        movl      %eax, -288(%rbp)                              #5075.37
-        je        ..B29.19      # Prob 50%                      #5075.37
-                                # LOE
-..B29.17:                       # Preds ..B29.16
-        movl      -288(%rbp), %eax                              #5075.37
-        cmpl      $1, %eax                                      #5075.37
-        je        ..B29.21      # Prob 50%                      #5075.37
-                                # LOE
-..B29.18:                       # Preds ..B29.17
-        movl      -288(%rbp), %eax                              #5075.37
-        cmpl      $2, %eax                                      #5075.37
-        je        ..B29.25      # Prob 50%                      #5075.37
-        jmp       ..B29.31      # Prob 100%                     #5075.37
-                                # LOE
-..B29.19:                       # Preds ..B29.16
-..LN4995:
-        movl      -64(%rbp), %eax                               #5078.30
-..LN4997:
-        testl     %eax, %eax                                    #5078.36
-        je        ..B29.39      # Prob 50%                      #5078.36
-                                # LOE
-..B29.20:                       # Preds ..B29.19
-..LN4999:
-        movl      -80(%rbp), %eax                               #5078.53
-        negl      %eax                                          #5078.53
-..LN5001:
-        movl      -24(%rbp), %edx                               #5078.47
-..LN5003:
-        lea       1(%rdx,%rax), %eax                            #5078.61
-        leave                                                   #5078.61
-..___tag_value_eval_4na_pos.508:                                #
-        ret                                                     #5078.61
-..___tag_value_eval_4na_pos.509:                                #
-                                # LOE
-..B29.21:                       # Preds ..B29.17
-..LN5005:
-        movl      -64(%rbp), %eax                               #5081.30
-..LN5007:
-        testl     %eax, %eax                                    #5081.36
-        je        ..B29.23      # Prob 50%                      #5081.36
-                                # LOE
-..B29.22:                       # Preds ..B29.21
-..LN5009:
-        movl      -80(%rbp), %eax                               #5081.53
-        negl      %eax                                          #5081.53
-..LN5011:
-        movl      -24(%rbp), %edx                               #5081.47
-..LN5013:
-        lea       1(%rdx,%rax), %eax                            #5081.61
-        leave                                                   #5081.61
-..___tag_value_eval_4na_pos.511:                                #
-        ret                                                     #5081.61
-..___tag_value_eval_4na_pos.512:                                #
-                                # LOE
-..B29.23:                       # Preds ..B29.21
-..LN5015:
-        movl      -68(%rbp), %eax                               #5082.30
-..LN5017:
-        testl     %eax, %eax                                    #5082.36
-        je        ..B29.39      # Prob 50%                      #5082.36
-                                # LOE
-..B29.24:                       # Preds ..B29.23
-..LN5019:
-        movl      -80(%rbp), %eax                               #5082.53
-        negl      %eax                                          #5082.53
-..LN5021:
-        movl      -24(%rbp), %edx                               #5082.47
-..LN5023:
-        lea       2(%rdx,%rax), %eax                            #5082.61
-        leave                                                   #5082.61
-..___tag_value_eval_4na_pos.514:                                #
-        ret                                                     #5082.61
-..___tag_value_eval_4na_pos.515:                                #
-                                # LOE
-..B29.25:                       # Preds ..B29.18
-..LN5025:
-        movl      -64(%rbp), %eax                               #5085.30
-..LN5027:
-        testl     %eax, %eax                                    #5085.36
-        je        ..B29.27      # Prob 50%                      #5085.36
-                                # LOE
-..B29.26:                       # Preds ..B29.25
-..LN5029:
-        movl      -80(%rbp), %eax                               #5085.53
-        negl      %eax                                          #5085.53
-..LN5031:
-        movl      -24(%rbp), %edx                               #5085.47
-..LN5033:
-        lea       1(%rdx,%rax), %eax                            #5085.61
-        leave                                                   #5085.61
-..___tag_value_eval_4na_pos.517:                                #
-        ret                                                     #5085.61
-..___tag_value_eval_4na_pos.518:                                #
-                                # LOE
-..B29.27:                       # Preds ..B29.25
-..LN5035:
-        movl      -68(%rbp), %eax                               #5086.30
-..LN5037:
-        testl     %eax, %eax                                    #5086.36
-        je        ..B29.29      # Prob 50%                      #5086.36
-                                # LOE
-..B29.28:                       # Preds ..B29.27
-..LN5039:
-        movl      -80(%rbp), %eax                               #5086.53
-        negl      %eax                                          #5086.53
-..LN5041:
-        movl      -24(%rbp), %edx                               #5086.47
-..LN5043:
-        lea       2(%rdx,%rax), %eax                            #5086.61
-        leave                                                   #5086.61
-..___tag_value_eval_4na_pos.520:                                #
-        ret                                                     #5086.61
-..___tag_value_eval_4na_pos.521:                                #
-                                # LOE
-..B29.29:                       # Preds ..B29.27
-..LN5045:
-        movl      -72(%rbp), %eax                               #5087.30
-..LN5047:
-        testl     %eax, %eax                                    #5087.36
-        je        ..B29.39      # Prob 50%                      #5087.36
-                                # LOE
-..B29.30:                       # Preds ..B29.29
-..LN5049:
-        movl      -80(%rbp), %eax                               #5087.53
-        negl      %eax                                          #5087.53
-..LN5051:
-        movl      -24(%rbp), %edx                               #5087.47
-..LN5053:
-        lea       3(%rdx,%rax), %eax                            #5087.61
-        leave                                                   #5087.61
-..___tag_value_eval_4na_pos.523:                                #
-        ret                                                     #5087.61
-..___tag_value_eval_4na_pos.524:                                #
-                                # LOE
-..B29.31:                       # Preds ..B29.18
-..LN5055:
-        movl      -64(%rbp), %eax                               #5090.30
-..LN5057:
-        testl     %eax, %eax                                    #5090.36
-        je        ..B29.33      # Prob 50%                      #5090.36
-                                # LOE
-..B29.32:                       # Preds ..B29.31
-..LN5059:
-        movl      -80(%rbp), %eax                               #5090.53
-        negl      %eax                                          #5090.53
-..LN5061:
-        movl      -24(%rbp), %edx                               #5090.47
-..LN5063:
-        lea       1(%rdx,%rax), %eax                            #5090.61
-        leave                                                   #5090.61
-..___tag_value_eval_4na_pos.526:                                #
-        ret                                                     #5090.61
-..___tag_value_eval_4na_pos.527:                                #
-                                # LOE
-..B29.33:                       # Preds ..B29.31
-..LN5065:
-        movl      -68(%rbp), %eax                               #5091.30
-..LN5067:
-        testl     %eax, %eax                                    #5091.36
-        je        ..B29.35      # Prob 50%                      #5091.36
-                                # LOE
-..B29.34:                       # Preds ..B29.33
-..LN5069:
-        movl      -80(%rbp), %eax                               #5091.53
-        negl      %eax                                          #5091.53
-..LN5071:
-        movl      -24(%rbp), %edx                               #5091.47
-..LN5073:
-        lea       2(%rdx,%rax), %eax                            #5091.61
-        leave                                                   #5091.61
-..___tag_value_eval_4na_pos.529:                                #
-        ret                                                     #5091.61
-..___tag_value_eval_4na_pos.530:                                #
-                                # LOE
-..B29.35:                       # Preds ..B29.33
-..LN5075:
-        movl      -72(%rbp), %eax                               #5092.30
-..LN5077:
-        testl     %eax, %eax                                    #5092.36
-        je        ..B29.37      # Prob 50%                      #5092.36
-                                # LOE
-..B29.36:                       # Preds ..B29.35
-..LN5079:
-        movl      -80(%rbp), %eax                               #5092.53
-        negl      %eax                                          #5092.53
-..LN5081:
-        movl      -24(%rbp), %edx                               #5092.47
-..LN5083:
-        lea       3(%rdx,%rax), %eax                            #5092.61
-        leave                                                   #5092.61
-..___tag_value_eval_4na_pos.532:                                #
-        ret                                                     #5092.61
-..___tag_value_eval_4na_pos.533:                                #
-                                # LOE
-..B29.37:                       # Preds ..B29.35
-..LN5085:
-        movl      -112(%rbp), %eax                              #5093.30
-..LN5087:
-        testl     %eax, %eax                                    #5093.36
-        je        ..B29.39      # Prob 50%                      #5093.36
-                                # LOE
-..B29.38:                       # Preds ..B29.37
-..LN5089:
-        movl      -80(%rbp), %eax                               #5093.53
-        negl      %eax                                          #5093.53
-..LN5091:
-        movl      -24(%rbp), %edx                               #5093.47
-..LN5093:
-        lea       4(%rdx,%rax), %eax                            #5093.61
-        leave                                                   #5093.61
-..___tag_value_eval_4na_pos.535:                                #
-        ret                                                     #5093.61
-..___tag_value_eval_4na_pos.536:                                #
-                                # LOE
-..B29.39:                       # Preds ..B29.19 ..B29.23 ..B29.29 ..B29.37
-..LN5095:
-        xorl      %eax, %eax                                    #5095.28
-        leave                                                   #5095.28
-..___tag_value_eval_4na_pos.538:                                #
-        ret                                                     #5095.28
-..___tag_value_eval_4na_pos.539:                                #
-                                # LOE
-..B29.40:                       # Preds ..B29.15
-..LN5097:
-        addl      $4, -24(%rbp)                                 #5135.17
-..LN5099:
-        movl      -24(%rbp), %eax                               #5138.22
-..LN5101:
-        movl      -76(%rbp), %edx                               #5138.28
-        cmpl      %edx, %eax                                    #5138.28
-        jbe       ..B29.42      # Prob 50%                      #5138.28
-                                # LOE
-..B29.41:                       # Preds ..B29.40
-..LN5103:
-        xorl      %eax, %eax                                    #5139.28
-        leave                                                   #5139.28
-..___tag_value_eval_4na_pos.541:                                #
-        ret                                                     #5139.28
-..___tag_value_eval_4na_pos.542:                                #
-                                # LOE
-..B29.42:                       # Preds ..B29.40
-..LN5105:
-        movl      -60(%rbp), %eax                               #5142.25
-        decl      %eax                                          #5142.25
-        movl      %eax, -60(%rbp)                               #5142.25
-..LN5107:
-        je        ..B29.47      # Prob 50%                      #5142.39
-                                # LOE
-..B29.43:                       # Preds ..B29.42
-..LN5109:
-        movdqa    -272(%rbp), %xmm0                             #5147.43
-..LN5111:
-        psrldq    $2, %xmm0                                     #5147.26
-..LN5113:
-        movdqa    %xmm0, -272(%rbp)                             #5147.17
-..LN5115:
-        movq      -88(%rbp), %rax                               #5150.22
-..LN5117:
-        movq      -96(%rbp), %rdx                               #5150.26
-        cmpq      %rdx, %rax                                    #5150.26
-        jae       ..B29.45      # Prob 50%                      #5150.26
-                                # LOE
-..B29.44:                       # Preds ..B29.43
-..LN5119:
-        movdqa    -272(%rbp), %xmm0                             #5151.49
-..LN5121:
-        movq      -88(%rbp), %rax                               #5151.72
-        movzbl    (%rax), %eax                                  #5151.72
-        movzbl    %al, %eax                                     #5151.72
-..LN5123:
-        movslq    %eax, %rax                                    #5151.57
-        lea       expand_2na.0(%rip), %rdx                      #5151.57
-        movzwl    (%rdx,%rax,2), %eax                           #5151.57
-        movzwl    %ax, %eax                                     #5151.57
-..LN5125:
-        pinsrw    $7, %eax, %xmm0                               #5151.30
-..LN5127:
-        movdqa    %xmm0, -272(%rbp)                             #5151.21
-                                # LOE
-..B29.45:                       # Preds ..B29.44 ..B29.43
-..LN5129:
-        incq      -88(%rbp)                                     #5154.20
-        jmp       ..B29.10      # Prob 100%                     #5154.20
-                                # LOE
-..B29.47:                       # Preds ..B29.42 ..B29.10
-..LN5131:
-        movq      -104(%rbp), %rax                              #5159.18
-..LN5133:
-        movq      -96(%rbp), %rdx                               #5159.25
-        cmpq      %rdx, %rax                                    #5159.25
-        jae       ..B29.51      # Prob 50%                      #5159.25
-                                # LOE
-..B29.48:                       # Preds ..B29.47
-..LN5135:
-        movl      -24(%rbp), %eax                               #5164.18
-..LN5137:
-        movl      -76(%rbp), %edx                               #5164.24
-        cmpl      %edx, %eax                                    #5164.24
-        ja        ..B29.51      # Prob 50%                      #5164.24
-                                # LOE
-..B29.49:                       # Preds ..B29.48
-..LN5139:
-        movq      -104(%rbp), %rax                              #5169.41
-..LN5141:
-        movq      -96(%rbp), %rdx                               #5169.46
-..LN5143:
-        movq      %rax, %rdi                                    #5169.22
-        movq      %rdx, %rsi                                    #5169.22
-        call      prime_buffer_4na at PLT                          #5169.22
-                                # LOE xmm0
-..B29.55:                       # Preds ..B29.49
-        movdqa    %xmm0, -336(%rbp)                             #5169.22
-                                # LOE
-..B29.50:                       # Preds ..B29.55
-..LN5145:
-        movdqa    -336(%rbp), %xmm0                             #5169.13
-        movdqa    %xmm0, -272(%rbp)                             #5169.13
-..LN5147:
-        addq      $8, -104(%rbp)                                #5184.13
-..LN5149:
-        movq      -104(%rbp), %rax                              #5186.17
-..LN5151:
-        movq      %rax, -88(%rbp)                               #5186.13
-        jmp       ..B29.8       # Prob 100%                     #5186.13
-                                # LOE
-..B29.51:                       # Preds ..B29.48 ..B29.47 ..B29.8
-..LN5153:
-        xorl      %eax, %eax                                    #5196.12
-        leave                                                   #5196.12
-..___tag_value_eval_4na_pos.544:                                #
-        ret                                                     #5196.12
-        .align    2,0x90
-..___tag_value_eval_4na_pos.545:                                #
-                                # LOE
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-.LNeval_4na_pos:
-	.data
-# -- End  eval_4na_pos
-	.text
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    2,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-# parameter 5(selflen): %r8
-..B30.1:                        # Preds ..B30.0
-..___tag_value_NucStrstrSearch.548:                             #
-..LN5155:
-        pushq     %rbp                                          #5217.1
-        movq      %rsp, %rbp                                    #5217.1
-..___tag_value_NucStrstrSearch.549:                             #
-        subq      $192, %rsp                                    #5217.1
-        movq      %rbx, -32(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.552:                             #
-        movq      %rdi, -56(%rbp)                               #5217.1
-        movq      %rsi, -48(%rbp)                               #5217.1
-        movl      %edx, -24(%rbp)                               #5217.1
-        movl      %ecx, -16(%rbp)                               #5217.1
-        movq      %r8, -40(%rbp)                                #5217.1
-..LN5157:
-        movq      -56(%rbp), %rax                               #5218.10
-..LN5159:
-        testq     %rax, %rax                                    #5218.18
-        je        ..B30.111     # Prob 50%                      #5218.18
-                                # LOE
-..B30.2:                        # Preds ..B30.1
-..LN5161:
-        movq      -48(%rbp), %rax                               #5218.26
-..LN5163:
-        testq     %rax, %rax                                    #5218.37
-        je        ..B30.111     # Prob 50%                      #5218.37
-                                # LOE
-..B30.3:                        # Preds ..B30.2
-..LN5165:
-        movl      -16(%rbp), %eax                               #5218.45
-..LN5167:
-        testl     %eax, %eax                                    #5218.52
-        je        ..B30.111     # Prob 50%                      #5218.52
-                                # LOE
-..B30.4:                        # Preds ..B30.3
-..LN5169:
-        movq      -56(%rbp), %rax                               #5223.18
-        movl      (%rax), %eax                                  #5223.18
-        movl      %eax, -64(%rbp)                               #5223.18
-..LN5171:
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B30.111     # Prob 50%                      #5223.9
-                                # LOE
-..B30.5:                        # Preds ..B30.4
-        movl      -64(%rbp), %eax                               #5223.9
-        movl      %eax, %eax                                    #5223.9
-        lea       ..1..TPKT.30_0.0.1(%rip), %rdx                #5223.9
-        movq      (%rdx,%rax,8), %rax                           #5223.9
-        jmp       *%rax                                         #5223.9
-                                # LOE
-..1.30_0.TAG.00.0.1:
-..B30.7:                        # Preds ..B30.5
-..LN5173:
-        movq      -56(%rbp), %rax                               #5226.24
-..LN5175:
-        movl      -16(%rbp), %edx                               #5226.18
-..LN5177:
-        movl      4(%rax), %eax                                 #5226.24
-        cmpl      %eax, %edx                                    #5226.24
-        jae       ..B30.9       # Prob 50%                      #5226.24
-                                # LOE
-..B30.8:                        # Preds ..B30.7
-..LN5179:
-        xorl      %eax, %eax                                    #5226.54
-        movq      -32(%rbp), %rbx                               #5226.54
-..___tag_value_NucStrstrSearch.553:                             #
-        leave                                                   #5226.54
-..___tag_value_NucStrstrSearch.555:                             #
-        ret                                                     #5226.54
-..___tag_value_NucStrstrSearch.556:                             #
-                                # LOE
-..B30.9:                        # Preds ..B30.7
-..LN5181:
-        movq      -40(%rbp), %rax                               #5227.9
-        testq     %rax, %rax                                    #5227.9
-        je        ..B30.11      # Prob 50%                      #5227.9
-                                # LOE
-..B30.10:                       # Preds ..B30.9
-..LN5183:
-        movq      -56(%rbp), %rax                               #5227.27
-..LN5185:
-        movq      -40(%rbp), %rdx                               #5227.18
-..LN5187:
-        movl      4(%rax), %eax                                 #5227.27
-..LN5189:
-        movl      %eax, (%rdx)                                  #5227.18
-                                # LOE
-..B30.11:                       # Preds ..B30.10 ..B30.9
-..LN5191:
-        movq      -56(%rbp), %rax                               #5228.36
-..LN5193:
-        movq      -48(%rbp), %rdx                               #5228.51
-..LN5195:
-        movl      -24(%rbp), %ecx                               #5228.60
-..LN5197:
-        movl      -16(%rbp), %ebx                               #5228.65
-..LN5199:
-        movq      %rax, %rdi                                    #5228.20
-        movq      %rdx, %rsi                                    #5228.20
-        movl      %ecx, %edx                                    #5228.20
-        movl      %ebx, %ecx                                    #5228.20
-        call      eval_2na_64 at PLT                               #5228.20
-                                # LOE eax
-..B30.114:                      # Preds ..B30.11
-        movl      %eax, -144(%rbp)                              #5228.20
-                                # LOE
-..B30.12:                       # Preds ..B30.114
-        movl      -144(%rbp), %eax                              #5228.20
-        movq      -32(%rbp), %rbx                               #5228.20
-..___tag_value_NucStrstrSearch.558:                             #
-        leave                                                   #5228.20
-..___tag_value_NucStrstrSearch.560:                             #
-        ret                                                     #5228.20
-..___tag_value_NucStrstrSearch.561:                             #
-                                # LOE
-..1.30_0.TAG.01.0.1:
-..B30.14:                       # Preds ..B30.5
-..LN5201:
-        movq      -56(%rbp), %rax                               #5230.24
-..LN5203:
-        movl      -16(%rbp), %edx                               #5230.18
-..LN5205:
-        movl      4(%rax), %eax                                 #5230.24
-        cmpl      %eax, %edx                                    #5230.24
-        jae       ..B30.16      # Prob 50%                      #5230.24
-                                # LOE
-..B30.15:                       # Preds ..B30.14
-..LN5207:
-        xorl      %eax, %eax                                    #5230.54
-        movq      -32(%rbp), %rbx                               #5230.54
-..___tag_value_NucStrstrSearch.563:                             #
-        leave                                                   #5230.54
-..___tag_value_NucStrstrSearch.565:                             #
-        ret                                                     #5230.54
-..___tag_value_NucStrstrSearch.566:                             #
-                                # LOE
-..B30.16:                       # Preds ..B30.14
-..LN5209:
-        movq      -40(%rbp), %rax                               #5231.9
-        testq     %rax, %rax                                    #5231.9
-        je        ..B30.18      # Prob 50%                      #5231.9
-                                # LOE
-..B30.17:                       # Preds ..B30.16
-..LN5211:
-        movq      -56(%rbp), %rax                               #5231.27
-..LN5213:
-        movq      -40(%rbp), %rdx                               #5231.18
-..LN5215:
-        movl      4(%rax), %eax                                 #5231.27
-..LN5217:
-        movl      %eax, (%rdx)                                  #5231.18
-                                # LOE
-..B30.18:                       # Preds ..B30.17 ..B30.16
-..LN5219:
-        movq      -56(%rbp), %rax                               #5232.36
-..LN5221:
-        movq      -48(%rbp), %rdx                               #5232.51
-..LN5223:
-        movl      -24(%rbp), %ecx                               #5232.60
-..LN5225:
-        movl      -16(%rbp), %ebx                               #5232.65
-..LN5227:
-        movq      %rax, %rdi                                    #5232.20
-        movq      %rdx, %rsi                                    #5232.20
-        movl      %ecx, %edx                                    #5232.20
-        movl      %ebx, %ecx                                    #5232.20
-        call      eval_4na_64 at PLT                               #5232.20
-                                # LOE eax
-..B30.115:                      # Preds ..B30.18
-        movl      %eax, -140(%rbp)                              #5232.20
-                                # LOE
-..B30.19:                       # Preds ..B30.115
-        movl      -140(%rbp), %eax                              #5232.20
-        movq      -32(%rbp), %rbx                               #5232.20
-..___tag_value_NucStrstrSearch.568:                             #
-        leave                                                   #5232.20
-..___tag_value_NucStrstrSearch.570:                             #
-        ret                                                     #5232.20
-..___tag_value_NucStrstrSearch.571:                             #
-                                # LOE
-..1.30_0.TAG.02.0.1:
-..B30.21:                       # Preds ..B30.5
-..LN5229:
-        movq      -56(%rbp), %rax                               #5235.24
-..LN5231:
-        movl      -16(%rbp), %edx                               #5235.18
-..LN5233:
-        movl      4(%rax), %eax                                 #5235.24
-        cmpl      %eax, %edx                                    #5235.24
-        jae       ..B30.23      # Prob 50%                      #5235.24
-                                # LOE
-..B30.22:                       # Preds ..B30.21
-..LN5235:
-        xorl      %eax, %eax                                    #5235.54
-        movq      -32(%rbp), %rbx                               #5235.54
-..___tag_value_NucStrstrSearch.573:                             #
-        leave                                                   #5235.54
-..___tag_value_NucStrstrSearch.575:                             #
-        ret                                                     #5235.54
-..___tag_value_NucStrstrSearch.576:                             #
-                                # LOE
-..B30.23:                       # Preds ..B30.21
-..LN5237:
-        movq      -40(%rbp), %rax                               #5236.9
-        testq     %rax, %rax                                    #5236.9
-        je        ..B30.25      # Prob 50%                      #5236.9
-                                # LOE
-..B30.24:                       # Preds ..B30.23
-..LN5239:
-        movq      -56(%rbp), %rax                               #5236.27
-..LN5241:
-        movq      -40(%rbp), %rdx                               #5236.18
-..LN5243:
-        movl      4(%rax), %eax                                 #5236.27
-..LN5245:
-        movl      %eax, (%rdx)                                  #5236.18
-                                # LOE
-..B30.25:                       # Preds ..B30.24 ..B30.23
-..LN5247:
-        movq      -56(%rbp), %rax                               #5237.35
-..LN5249:
-        movq      -48(%rbp), %rdx                               #5237.50
-..LN5251:
-        movl      -24(%rbp), %ecx                               #5237.59
-..LN5253:
-        movl      -16(%rbp), %ebx                               #5237.64
-..LN5255:
-        movq      %rax, %rdi                                    #5237.20
-        movq      %rdx, %rsi                                    #5237.20
-        movl      %ecx, %edx                                    #5237.20
-        movl      %ebx, %ecx                                    #5237.20
-        call      eval_2na_8 at PLT                                #5237.20
-                                # LOE eax
-..B30.116:                      # Preds ..B30.25
-        movl      %eax, -136(%rbp)                              #5237.20
-                                # LOE
-..B30.26:                       # Preds ..B30.116
-        movl      -136(%rbp), %eax                              #5237.20
-        movq      -32(%rbp), %rbx                               #5237.20
-..___tag_value_NucStrstrSearch.578:                             #
-        leave                                                   #5237.20
-..___tag_value_NucStrstrSearch.580:                             #
-        ret                                                     #5237.20
-..___tag_value_NucStrstrSearch.581:                             #
-                                # LOE
-..1.30_0.TAG.03.0.1:
-..B30.28:                       # Preds ..B30.5
-..LN5257:
-        movq      -56(%rbp), %rax                               #5239.24
-..LN5259:
-        movl      -16(%rbp), %edx                               #5239.18
-..LN5261:
-        movl      4(%rax), %eax                                 #5239.24
-        cmpl      %eax, %edx                                    #5239.24
-        jae       ..B30.30      # Prob 50%                      #5239.24
-                                # LOE
-..B30.29:                       # Preds ..B30.28
-..LN5263:
-        xorl      %eax, %eax                                    #5239.54
-        movq      -32(%rbp), %rbx                               #5239.54
-..___tag_value_NucStrstrSearch.583:                             #
-        leave                                                   #5239.54
-..___tag_value_NucStrstrSearch.585:                             #
-        ret                                                     #5239.54
-..___tag_value_NucStrstrSearch.586:                             #
-                                # LOE
-..B30.30:                       # Preds ..B30.28
-..LN5265:
-        movq      -40(%rbp), %rax                               #5240.9
-        testq     %rax, %rax                                    #5240.9
-        je        ..B30.32      # Prob 50%                      #5240.9
-                                # LOE
-..B30.31:                       # Preds ..B30.30
-..LN5267:
-        movq      -56(%rbp), %rax                               #5240.27
-..LN5269:
-        movq      -40(%rbp), %rdx                               #5240.18
-..LN5271:
-        movl      4(%rax), %eax                                 #5240.27
-..LN5273:
-        movl      %eax, (%rdx)                                  #5240.18
-                                # LOE
-..B30.32:                       # Preds ..B30.31 ..B30.30
-..LN5275:
-        movq      -56(%rbp), %rax                               #5241.36
-..LN5277:
-        movq      -48(%rbp), %rdx                               #5241.51
-..LN5279:
-        movl      -24(%rbp), %ecx                               #5241.60
-..LN5281:
-        movl      -16(%rbp), %ebx                               #5241.65
-..LN5283:
-        movq      %rax, %rdi                                    #5241.20
-        movq      %rdx, %rsi                                    #5241.20
-        movl      %ecx, %edx                                    #5241.20
-        movl      %ebx, %ecx                                    #5241.20
-        call      eval_2na_16 at PLT                               #5241.20
-                                # LOE eax
-..B30.117:                      # Preds ..B30.32
-        movl      %eax, -132(%rbp)                              #5241.20
-                                # LOE
-..B30.33:                       # Preds ..B30.117
-        movl      -132(%rbp), %eax                              #5241.20
-        movq      -32(%rbp), %rbx                               #5241.20
-..___tag_value_NucStrstrSearch.588:                             #
-        leave                                                   #5241.20
-..___tag_value_NucStrstrSearch.590:                             #
-        ret                                                     #5241.20
-..___tag_value_NucStrstrSearch.591:                             #
-                                # LOE
-..1.30_0.TAG.04.0.1:
-..B30.35:                       # Preds ..B30.5
-..LN5285:
-        movq      -56(%rbp), %rax                               #5243.24
-..LN5287:
-        movl      -16(%rbp), %edx                               #5243.18
-..LN5289:
-        movl      4(%rax), %eax                                 #5243.24
-        cmpl      %eax, %edx                                    #5243.24
-        jae       ..B30.37      # Prob 50%                      #5243.24
-                                # LOE
-..B30.36:                       # Preds ..B30.35
-..LN5291:
-        xorl      %eax, %eax                                    #5243.54
-        movq      -32(%rbp), %rbx                               #5243.54
-..___tag_value_NucStrstrSearch.593:                             #
-        leave                                                   #5243.54
-..___tag_value_NucStrstrSearch.595:                             #
-        ret                                                     #5243.54
-..___tag_value_NucStrstrSearch.596:                             #
-                                # LOE
-..B30.37:                       # Preds ..B30.35
-..LN5293:
-        movq      -40(%rbp), %rax                               #5244.9
-        testq     %rax, %rax                                    #5244.9
-        je        ..B30.39      # Prob 50%                      #5244.9
-                                # LOE
-..B30.38:                       # Preds ..B30.37
-..LN5295:
-        movq      -56(%rbp), %rax                               #5244.27
-..LN5297:
-        movq      -40(%rbp), %rdx                               #5244.18
-..LN5299:
-        movl      4(%rax), %eax                                 #5244.27
-..LN5301:
-        movl      %eax, (%rdx)                                  #5244.18
-                                # LOE
-..B30.39:                       # Preds ..B30.38 ..B30.37
-..LN5303:
-        movq      -56(%rbp), %rax                               #5245.36
-..LN5305:
-        movq      -48(%rbp), %rdx                               #5245.51
-..LN5307:
-        movl      -24(%rbp), %ecx                               #5245.60
-..LN5309:
-        movl      -16(%rbp), %ebx                               #5245.65
-..LN5311:
-        movq      %rax, %rdi                                    #5245.20
-        movq      %rdx, %rsi                                    #5245.20
-        movl      %ecx, %edx                                    #5245.20
-        movl      %ebx, %ecx                                    #5245.20
-        call      eval_2na_32 at PLT                               #5245.20
-                                # LOE eax
-..B30.118:                      # Preds ..B30.39
-        movl      %eax, -128(%rbp)                              #5245.20
-                                # LOE
-..B30.40:                       # Preds ..B30.118
-        movl      -128(%rbp), %eax                              #5245.20
-        movq      -32(%rbp), %rbx                               #5245.20
-..___tag_value_NucStrstrSearch.598:                             #
-        leave                                                   #5245.20
-..___tag_value_NucStrstrSearch.600:                             #
-        ret                                                     #5245.20
-..___tag_value_NucStrstrSearch.601:                             #
-                                # LOE
-..1.30_0.TAG.05.0.1:
-..B30.42:                       # Preds ..B30.5
-..LN5313:
-        movq      -56(%rbp), %rax                               #5247.24
-..LN5315:
-        movl      -16(%rbp), %edx                               #5247.18
-..LN5317:
-        movl      4(%rax), %eax                                 #5247.24
-        cmpl      %eax, %edx                                    #5247.24
-        jae       ..B30.44      # Prob 50%                      #5247.24
-                                # LOE
-..B30.43:                       # Preds ..B30.42
-..LN5319:
-        xorl      %eax, %eax                                    #5247.54
-        movq      -32(%rbp), %rbx                               #5247.54
-..___tag_value_NucStrstrSearch.603:                             #
-        leave                                                   #5247.54
-..___tag_value_NucStrstrSearch.605:                             #
-        ret                                                     #5247.54
-..___tag_value_NucStrstrSearch.606:                             #
-                                # LOE
-..B30.44:                       # Preds ..B30.42
-..LN5321:
-        movq      -40(%rbp), %rax                               #5248.9
-        testq     %rax, %rax                                    #5248.9
-        je        ..B30.46      # Prob 50%                      #5248.9
-                                # LOE
-..B30.45:                       # Preds ..B30.44
-..LN5323:
-        movq      -56(%rbp), %rax                               #5248.27
-..LN5325:
-        movq      -40(%rbp), %rdx                               #5248.18
-..LN5327:
-        movl      4(%rax), %eax                                 #5248.27
-..LN5329:
-        movl      %eax, (%rdx)                                  #5248.18
-                                # LOE
-..B30.46:                       # Preds ..B30.45 ..B30.44
-..LN5331:
-        movq      -56(%rbp), %rax                               #5249.37
-..LN5333:
-        movq      -48(%rbp), %rdx                               #5249.52
-..LN5335:
-        movl      -24(%rbp), %ecx                               #5249.61
-..LN5337:
-        movl      -16(%rbp), %ebx                               #5249.66
-..LN5339:
-        movq      %rax, %rdi                                    #5249.20
-        movq      %rdx, %rsi                                    #5249.20
-        movl      %ecx, %edx                                    #5249.20
-        movl      %ebx, %ecx                                    #5249.20
-        call      eval_2na_128 at PLT                              #5249.20
-                                # LOE eax
-..B30.119:                      # Preds ..B30.46
-        movl      %eax, -124(%rbp)                              #5249.20
-                                # LOE
-..B30.47:                       # Preds ..B30.119
-        movl      -124(%rbp), %eax                              #5249.20
-        movq      -32(%rbp), %rbx                               #5249.20
-..___tag_value_NucStrstrSearch.608:                             #
-        leave                                                   #5249.20
-..___tag_value_NucStrstrSearch.610:                             #
-        ret                                                     #5249.20
-..___tag_value_NucStrstrSearch.611:                             #
-                                # LOE
-..1.30_0.TAG.06.0.1:
-..B30.49:                       # Preds ..B30.5
-..LN5341:
-        movq      -56(%rbp), %rax                               #5251.24
-..LN5343:
-        movl      -16(%rbp), %edx                               #5251.18
-..LN5345:
-        movl      4(%rax), %eax                                 #5251.24
-        cmpl      %eax, %edx                                    #5251.24
-        jae       ..B30.51      # Prob 50%                      #5251.24
-                                # LOE
-..B30.50:                       # Preds ..B30.49
-..LN5347:
-        xorl      %eax, %eax                                    #5251.54
-        movq      -32(%rbp), %rbx                               #5251.54
-..___tag_value_NucStrstrSearch.613:                             #
-        leave                                                   #5251.54
-..___tag_value_NucStrstrSearch.615:                             #
-        ret                                                     #5251.54
-..___tag_value_NucStrstrSearch.616:                             #
-                                # LOE
-..B30.51:                       # Preds ..B30.49
-..LN5349:
-        movq      -40(%rbp), %rax                               #5252.9
-        testq     %rax, %rax                                    #5252.9
-        je        ..B30.53      # Prob 50%                      #5252.9
-                                # LOE
-..B30.52:                       # Preds ..B30.51
-..LN5351:
-        movq      -56(%rbp), %rax                               #5252.27
-..LN5353:
-        movq      -40(%rbp), %rdx                               #5252.18
-..LN5355:
-        movl      4(%rax), %eax                                 #5252.27
-..LN5357:
-        movl      %eax, (%rdx)                                  #5252.18
-                                # LOE
-..B30.53:                       # Preds ..B30.52 ..B30.51
-..LN5359:
-        movq      -56(%rbp), %rax                               #5253.36
-..LN5361:
-        movq      -48(%rbp), %rdx                               #5253.51
-..LN5363:
-        movl      -24(%rbp), %ecx                               #5253.60
-..LN5365:
-        movl      -16(%rbp), %ebx                               #5253.65
-..LN5367:
-        movq      %rax, %rdi                                    #5253.20
-        movq      %rdx, %rsi                                    #5253.20
-        movl      %ecx, %edx                                    #5253.20
-        movl      %ebx, %ecx                                    #5253.20
-        call      eval_4na_16 at PLT                               #5253.20
-                                # LOE eax
-..B30.120:                      # Preds ..B30.53
-        movl      %eax, -120(%rbp)                              #5253.20
-                                # LOE
-..B30.54:                       # Preds ..B30.120
-        movl      -120(%rbp), %eax                              #5253.20
-        movq      -32(%rbp), %rbx                               #5253.20
-..___tag_value_NucStrstrSearch.618:                             #
-        leave                                                   #5253.20
-..___tag_value_NucStrstrSearch.620:                             #
-        ret                                                     #5253.20
-..___tag_value_NucStrstrSearch.621:                             #
-                                # LOE
-..1.30_0.TAG.07.0.1:
-..B30.56:                       # Preds ..B30.5
-..LN5369:
-        movq      -56(%rbp), %rax                               #5255.24
-..LN5371:
-        movl      -16(%rbp), %edx                               #5255.18
-..LN5373:
-        movl      4(%rax), %eax                                 #5255.24
-        cmpl      %eax, %edx                                    #5255.24
-        jae       ..B30.58      # Prob 50%                      #5255.24
-                                # LOE
-..B30.57:                       # Preds ..B30.56
-..LN5375:
-        xorl      %eax, %eax                                    #5255.54
-        movq      -32(%rbp), %rbx                               #5255.54
-..___tag_value_NucStrstrSearch.623:                             #
-        leave                                                   #5255.54
-..___tag_value_NucStrstrSearch.625:                             #
-        ret                                                     #5255.54
-..___tag_value_NucStrstrSearch.626:                             #
-                                # LOE
-..B30.58:                       # Preds ..B30.56
-..LN5377:
-        movq      -40(%rbp), %rax                               #5256.9
-        testq     %rax, %rax                                    #5256.9
-        je        ..B30.60      # Prob 50%                      #5256.9
-                                # LOE
-..B30.59:                       # Preds ..B30.58
-..LN5379:
-        movq      -56(%rbp), %rax                               #5256.27
-..LN5381:
-        movq      -40(%rbp), %rdx                               #5256.18
-..LN5383:
-        movl      4(%rax), %eax                                 #5256.27
-..LN5385:
-        movl      %eax, (%rdx)                                  #5256.18
-                                # LOE
-..B30.60:                       # Preds ..B30.59 ..B30.58
-..LN5387:
-        movq      -56(%rbp), %rax                               #5257.36
-..LN5389:
-        movq      -48(%rbp), %rdx                               #5257.51
-..LN5391:
-        movl      -24(%rbp), %ecx                               #5257.60
-..LN5393:
-        movl      -16(%rbp), %ebx                               #5257.65
-..LN5395:
-        movq      %rax, %rdi                                    #5257.20
-        movq      %rdx, %rsi                                    #5257.20
-        movl      %ecx, %edx                                    #5257.20
-        movl      %ebx, %ecx                                    #5257.20
-        call      eval_4na_32 at PLT                               #5257.20
-                                # LOE eax
-..B30.121:                      # Preds ..B30.60
-        movl      %eax, -116(%rbp)                              #5257.20
-                                # LOE
-..B30.61:                       # Preds ..B30.121
-        movl      -116(%rbp), %eax                              #5257.20
-        movq      -32(%rbp), %rbx                               #5257.20
-..___tag_value_NucStrstrSearch.628:                             #
-        leave                                                   #5257.20
-..___tag_value_NucStrstrSearch.630:                             #
-        ret                                                     #5257.20
-..___tag_value_NucStrstrSearch.631:                             #
-                                # LOE
-..1.30_0.TAG.08.0.1:
-..B30.63:                       # Preds ..B30.5
-..LN5397:
-        movq      -56(%rbp), %rax                               #5259.24
-..LN5399:
-        movl      -16(%rbp), %edx                               #5259.18
-..LN5401:
-        movl      4(%rax), %eax                                 #5259.24
-        cmpl      %eax, %edx                                    #5259.24
-        jae       ..B30.65      # Prob 50%                      #5259.24
-                                # LOE
-..B30.64:                       # Preds ..B30.63
-..LN5403:
-        xorl      %eax, %eax                                    #5259.54
-        movq      -32(%rbp), %rbx                               #5259.54
-..___tag_value_NucStrstrSearch.633:                             #
-        leave                                                   #5259.54
-..___tag_value_NucStrstrSearch.635:                             #
-        ret                                                     #5259.54
-..___tag_value_NucStrstrSearch.636:                             #
-                                # LOE
-..B30.65:                       # Preds ..B30.63
-..LN5405:
-        movq      -40(%rbp), %rax                               #5260.9
-        testq     %rax, %rax                                    #5260.9
-        je        ..B30.67      # Prob 50%                      #5260.9
-                                # LOE
-..B30.66:                       # Preds ..B30.65
-..LN5407:
-        movq      -56(%rbp), %rax                               #5260.27
-..LN5409:
-        movq      -40(%rbp), %rdx                               #5260.18
-..LN5411:
-        movl      4(%rax), %eax                                 #5260.27
-..LN5413:
-        movl      %eax, (%rdx)                                  #5260.18
-                                # LOE
-..B30.67:                       # Preds ..B30.66 ..B30.65
-..LN5415:
-        movq      -56(%rbp), %rax                               #5261.37
-..LN5417:
-        movq      -48(%rbp), %rdx                               #5261.52
-..LN5419:
-        movl      -24(%rbp), %ecx                               #5261.61
-..LN5421:
-        movl      -16(%rbp), %ebx                               #5261.66
-..LN5423:
-        movq      %rax, %rdi                                    #5261.20
-        movq      %rdx, %rsi                                    #5261.20
-        movl      %ecx, %edx                                    #5261.20
-        movl      %ebx, %ecx                                    #5261.20
-        call      eval_4na_128 at PLT                              #5261.20
-                                # LOE eax
-..B30.122:                      # Preds ..B30.67
-        movl      %eax, -112(%rbp)                              #5261.20
-                                # LOE
-..B30.68:                       # Preds ..B30.122
-        movl      -112(%rbp), %eax                              #5261.20
-        movq      -32(%rbp), %rbx                               #5261.20
-..___tag_value_NucStrstrSearch.638:                             #
-        leave                                                   #5261.20
-..___tag_value_NucStrstrSearch.640:                             #
-        ret                                                     #5261.20
-..___tag_value_NucStrstrSearch.641:                             #
-                                # LOE
-..1.30_0.TAG.09.0.1:
-..B30.70:                       # Preds ..B30.5
-..LN5425:
-        movq      -56(%rbp), %rax                               #5264.24
-..LN5427:
-        movl      -16(%rbp), %edx                               #5264.18
-..LN5429:
-        movl      4(%rax), %eax                                 #5264.24
-        cmpl      %eax, %edx                                    #5264.24
-        jae       ..B30.72      # Prob 50%                      #5264.24
-                                # LOE
-..B30.71:                       # Preds ..B30.70
-..LN5431:
-        xorl      %eax, %eax                                    #5264.54
-        movq      -32(%rbp), %rbx                               #5264.54
-..___tag_value_NucStrstrSearch.643:                             #
-        leave                                                   #5264.54
-..___tag_value_NucStrstrSearch.645:                             #
-        ret                                                     #5264.54
-..___tag_value_NucStrstrSearch.646:                             #
-                                # LOE
-..B30.72:                       # Preds ..B30.70
-..LN5433:
-        movq      -40(%rbp), %rax                               #5265.9
-        testq     %rax, %rax                                    #5265.9
-        je        ..B30.74      # Prob 50%                      #5265.9
-                                # LOE
-..B30.73:                       # Preds ..B30.72
-..LN5435:
-        movq      -56(%rbp), %rax                               #5265.27
-..LN5437:
-        movq      -40(%rbp), %rdx                               #5265.18
-..LN5439:
-        movl      4(%rax), %eax                                 #5265.27
-..LN5441:
-        movl      %eax, (%rdx)                                  #5265.18
-                                # LOE
-..B30.74:                       # Preds ..B30.73 ..B30.72
-..LN5443:
-        movq      -56(%rbp), %rax                               #5266.37
-..LN5445:
-        movq      -48(%rbp), %rdx                               #5266.52
-..LN5447:
-        movl      -24(%rbp), %ecx                               #5266.61
-..LN5449:
-        movl      -16(%rbp), %ebx                               #5266.66
-..LN5451:
-        movq      %rax, %rdi                                    #5266.20
-        movq      %rdx, %rsi                                    #5266.20
-        movl      %ecx, %edx                                    #5266.20
-        movl      %ebx, %ecx                                    #5266.20
-        call      eval_2na_pos at PLT                              #5266.20
-                                # LOE eax
-..B30.123:                      # Preds ..B30.74
-        movl      %eax, -108(%rbp)                              #5266.20
-                                # LOE
-..B30.75:                       # Preds ..B30.123
-        movl      -108(%rbp), %eax                              #5266.20
-        movq      -32(%rbp), %rbx                               #5266.20
-..___tag_value_NucStrstrSearch.648:                             #
-        leave                                                   #5266.20
-..___tag_value_NucStrstrSearch.650:                             #
-        ret                                                     #5266.20
-..___tag_value_NucStrstrSearch.651:                             #
-                                # LOE
-..1.30_0.TAG.0a.0.1:
-..B30.77:                       # Preds ..B30.5
-..LN5453:
-        movq      -56(%rbp), %rax                               #5268.24
-..LN5455:
-        movl      -16(%rbp), %edx                               #5268.18
-..LN5457:
-        movl      4(%rax), %eax                                 #5268.24
-        cmpl      %eax, %edx                                    #5268.24
-        jae       ..B30.79      # Prob 50%                      #5268.24
-                                # LOE
-..B30.78:                       # Preds ..B30.77
-..LN5459:
-        xorl      %eax, %eax                                    #5268.54
-        movq      -32(%rbp), %rbx                               #5268.54
-..___tag_value_NucStrstrSearch.653:                             #
-        leave                                                   #5268.54
-..___tag_value_NucStrstrSearch.655:                             #
-        ret                                                     #5268.54
-..___tag_value_NucStrstrSearch.656:                             #
-                                # LOE
-..B30.79:                       # Preds ..B30.77
-..LN5461:
-        movq      -40(%rbp), %rax                               #5269.9
-        testq     %rax, %rax                                    #5269.9
-        je        ..B30.81      # Prob 50%                      #5269.9
-                                # LOE
-..B30.80:                       # Preds ..B30.79
-..LN5463:
-        movq      -56(%rbp), %rax                               #5269.27
-..LN5465:
-        movq      -40(%rbp), %rdx                               #5269.18
-..LN5467:
-        movl      4(%rax), %eax                                 #5269.27
-..LN5469:
-        movl      %eax, (%rdx)                                  #5269.18
-                                # LOE
-..B30.81:                       # Preds ..B30.80 ..B30.79
-..LN5471:
-        movq      -56(%rbp), %rax                               #5270.37
-..LN5473:
-        movq      -48(%rbp), %rdx                               #5270.52
-..LN5475:
-        movl      -24(%rbp), %ecx                               #5270.61
-..LN5477:
-        movl      -16(%rbp), %ebx                               #5270.66
-..LN5479:
-        movq      %rax, %rdi                                    #5270.20
-        movq      %rdx, %rsi                                    #5270.20
-        movl      %ecx, %edx                                    #5270.20
-        movl      %ebx, %ecx                                    #5270.20
-        call      eval_4na_pos at PLT                              #5270.20
-                                # LOE eax
-..B30.124:                      # Preds ..B30.81
-        movl      %eax, -104(%rbp)                              #5270.20
-                                # LOE
-..B30.82:                       # Preds ..B30.124
-        movl      -104(%rbp), %eax                              #5270.20
-        movq      -32(%rbp), %rbx                               #5270.20
-..___tag_value_NucStrstrSearch.658:                             #
-        leave                                                   #5270.20
-..___tag_value_NucStrstrSearch.660:                             #
-        ret                                                     #5270.20
-..___tag_value_NucStrstrSearch.661:                             #
-                                # LOE
-..1.30_0.TAG.0b.0.1:
-..B30.84:                       # Preds ..B30.5
-..LN5481:
-        movq      -56(%rbp), %rax                               #5272.39
-        movq      8(%rax), %rax                                 #5272.39
-..LN5483:
-        movq      -48(%rbp), %rdx                               #5272.63
-..LN5485:
-        movl      -24(%rbp), %ecx                               #5272.72
-..LN5487:
-        movl      -16(%rbp), %ebx                               #5272.77
-..LN5489:
-        movq      -40(%rbp), %rsi                               #5272.82
-..LN5491:
-        movq      %rax, %rdi                                    #5272.21
-        movq      %rsi, -96(%rbp)                               #5272.21
-        movq      %rdx, %rsi                                    #5272.21
-        movl      %ecx, %edx                                    #5272.21
-        movl      %ebx, %ecx                                    #5272.21
-        movq      -96(%rbp), %rax                               #5272.21
-        movq      %rax, %r8                                     #5272.21
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE eax
-..B30.125:                      # Preds ..B30.84
-        movl      %eax, -76(%rbp)                               #5272.21
-                                # LOE
-..B30.85:                       # Preds ..B30.125
-..LN5493:
-        movl      -76(%rbp), %eax                               #5272.13
-        movl      %eax, -80(%rbp)                               #5272.13
-..LN5495:
-        movq      -56(%rbp), %rax                               #5273.22
-        movl      4(%rax), %eax                                 #5273.22
-        movl      %eax, -72(%rbp)                               #5273.22
-        cmpl      $17, %eax                                     #5273.22
-        je        ..B30.87      # Prob 50%                      #5273.22
-                                # LOE
-..B30.86:                       # Preds ..B30.85
-        movl      -72(%rbp), %eax                               #5273.22
-        cmpl      $16, %eax                                     #5273.22
-        je        ..B30.89      # Prob 50%                      #5273.22
-        jmp       ..B30.91      # Prob 100%                     #5273.22
-                                # LOE
-..B30.87:                       # Preds ..B30.85
-..LN5497:
-        movl      -80(%rbp), %eax                               #5276.22
-..LN5499:
-        testl     %eax, %eax                                    #5276.31
-        je        ..B30.91      # Prob 50%                      #5276.31
-                                # LOE
-..B30.88:                       # Preds ..B30.87
-..LN5501:
-        movl      -80(%rbp), %eax                               #5277.28
-        movq      -32(%rbp), %rbx                               #5277.28
-..___tag_value_NucStrstrSearch.663:                             #
-        leave                                                   #5277.28
-..___tag_value_NucStrstrSearch.665:                             #
-        ret                                                     #5277.28
-..___tag_value_NucStrstrSearch.666:                             #
-                                # LOE
-..B30.89:                       # Preds ..B30.86
-..LN5503:
-        movl      -80(%rbp), %eax                               #5280.22
-..LN5505:
-        testl     %eax, %eax                                    #5280.31
-        jne       ..B30.91      # Prob 50%                      #5280.31
-                                # LOE
-..B30.90:                       # Preds ..B30.89
-..LN5507:
-        movl      -80(%rbp), %eax                               #5281.28
-        movq      -32(%rbp), %rbx                               #5281.28
-..___tag_value_NucStrstrSearch.668:                             #
-        leave                                                   #5281.28
-..___tag_value_NucStrstrSearch.670:                             #
-        ret                                                     #5281.28
-..___tag_value_NucStrstrSearch.671:                             #
-                                # LOE
-..B30.91:                       # Preds ..B30.87 ..B30.89 ..B30.86
-..LN5509:
-        movq      -56(%rbp), %rax                               #5284.38
-        movq      16(%rax), %rax                                #5284.38
-..LN5511:
-        movq      -48(%rbp), %rdx                               #5284.63
-..LN5513:
-        movl      -24(%rbp), %ecx                               #5284.72
-..LN5515:
-        movl      -16(%rbp), %ebx                               #5284.77
-..LN5517:
-        movq      -40(%rbp), %rsi                               #5284.82
-..LN5519:
-        movq      %rax, %rdi                                    #5284.20
-        movq      %rsi, -160(%rbp)                              #5284.20
-        movq      %rdx, %rsi                                    #5284.20
-        movl      %ecx, %edx                                    #5284.20
-        movl      %ebx, %ecx                                    #5284.20
-        movq      -160(%rbp), %rax                              #5284.20
-        movq      %rax, %r8                                     #5284.20
-        call      NucStrstrSearch at PLT                           #5284.20
-                                # LOE eax
-..B30.126:                      # Preds ..B30.91
-        movl      %eax, -88(%rbp)                               #5284.20
-                                # LOE
-..B30.92:                       # Preds ..B30.126
-        movl      -88(%rbp), %eax                               #5284.20
-        movq      -32(%rbp), %rbx                               #5284.20
-..___tag_value_NucStrstrSearch.673:                             #
-        leave                                                   #5284.20
-..___tag_value_NucStrstrSearch.675:                             #
-        ret                                                     #5284.20
-..___tag_value_NucStrstrSearch.676:                             #
-                                # LOE
-..1.30_0.TAG.0c.0.1:
-..B30.94:                       # Preds ..B30.5
-..LN5521:
-        movq      -56(%rbp), %rax                               #5286.22
-        movl      4(%rax), %eax                                 #5286.22
-        movl      %eax, -68(%rbp)                               #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B30.98      # Prob 50%                      #5286.22
-                                # LOE
-..B30.95:                       # Preds ..B30.94
-        movl      -68(%rbp), %eax                               #5286.22
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B30.98      # Prob 50%                      #5286.22
-                                # LOE
-..B30.96:                       # Preds ..B30.95
-        movl      -68(%rbp), %eax                               #5286.22
-        cmpl      $14, %eax                                     #5286.22
-        je        ..B30.103     # Prob 50%                      #5286.22
-                                # LOE
-..B30.97:                       # Preds ..B30.96
-        movl      -68(%rbp), %eax                               #5286.22
-        cmpl      $15, %eax                                     #5286.22
-        je        ..B30.107     # Prob 50%                      #5286.22
-        jmp       ..B30.111     # Prob 100%                     #5286.22
-                                # LOE
-..B30.98:                       # Preds ..B30.94 ..B30.95
-..LN5523:
-        movq      -56(%rbp), %rax                               #5290.43
-        movq      8(%rax), %rax                                 #5290.43
-..LN5525:
-        movq      -48(%rbp), %rdx                               #5290.63
-..LN5527:
-        movl      -24(%rbp), %ecx                               #5290.72
-..LN5529:
-        movl      -16(%rbp), %ebx                               #5290.77
-..LN5531:
-        movq      -40(%rbp), %rsi                               #5290.82
-..LN5533:
-        movq      %rax, %rdi                                    #5290.25
-        movq      %rsi, -152(%rbp)                              #5290.25
-        movq      %rdx, %rsi                                    #5290.25
-        movl      %ecx, %edx                                    #5290.25
-        movl      %ebx, %ecx                                    #5290.25
-        movq      -152(%rbp), %rax                              #5290.25
-        movq      %rax, %r8                                     #5290.25
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE eax
-..B30.127:                      # Preds ..B30.98
-        movl      %eax, -84(%rbp)                               #5290.25
-                                # LOE
-..B30.99:                       # Preds ..B30.127
-..LN5535:
-        movl      -84(%rbp), %eax                               #5290.17
-        movl      %eax, -80(%rbp)                               #5290.17
-..LN5537:
-        movq      -56(%rbp), %rax                               #5291.22
-        movl      4(%rax), %eax                                 #5291.22
-..LN5539:
-        testl     %eax, %eax                                    #5291.42
-        jne       ..B30.101     # Prob 50%                      #5291.42
-                                # LOE
-..B30.100:                      # Preds ..B30.99
-..LN5541:
-        movl      -80(%rbp), %eax                               #5292.28
-        movq      -32(%rbp), %rbx                               #5292.28
-..___tag_value_NucStrstrSearch.678:                             #
-        leave                                                   #5292.28
-..___tag_value_NucStrstrSearch.680:                             #
-        ret                                                     #5292.28
-..___tag_value_NucStrstrSearch.681:                             #
-                                # LOE
-..B30.101:                      # Preds ..B30.99
-..LN5543:
-        movl      -80(%rbp), %eax                               #5293.22
-..LN5545:
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B30.111     # Prob 50%                      #5293.31
-                                # LOE
-..B30.102:                      # Preds ..B30.101
-..LN5547:
-        movl      $1, %eax                                      #5294.28
-        movq      -32(%rbp), %rbx                               #5294.28
-..___tag_value_NucStrstrSearch.683:                             #
-        leave                                                   #5294.28
-..___tag_value_NucStrstrSearch.685:                             #
-        ret                                                     #5294.28
-..___tag_value_NucStrstrSearch.686:                             #
-                                # LOE
-..B30.103:                      # Preds ..B30.96
-..LN5549:
-        movq      -56(%rbp), %rax                               #5297.29
-        movq      8(%rax), %rax                                 #5297.29
-        movl      4(%rax), %eax                                 #5297.29
-..LN5551:
-        movl      %eax, -164(%rbp)                              #5297.17
-..LN5553:
-        movl      -164(%rbp), %eax                              #5298.22
-..LN5555:
-        movl      -16(%rbp), %edx                               #5298.34
-        cmpl      %edx, %eax                                    #5298.34
-        jbe       ..B30.105     # Prob 50%                      #5298.34
-                                # LOE
-..B30.104:                      # Preds ..B30.103
-..LN5557:
-        xorl      %eax, %eax                                    #5299.28
-        movq      -32(%rbp), %rbx                               #5299.28
-..___tag_value_NucStrstrSearch.688:                             #
-        leave                                                   #5299.28
-..___tag_value_NucStrstrSearch.690:                             #
-        ret                                                     #5299.28
-..___tag_value_NucStrstrSearch.691:                             #
-                                # LOE
-..B30.105:                      # Preds ..B30.103
-..LN5559:
-        movq      -56(%rbp), %rax                               #5300.42
-        movq      8(%rax), %rax                                 #5300.42
-..LN5561:
-        movq      -48(%rbp), %rdx                               #5300.62
-..LN5563:
-        movl      -24(%rbp), %ecx                               #5300.71
-..LN5565:
-        movl      -164(%rbp), %ebx                              #5300.76
-..LN5567:
-        movq      -40(%rbp), %rsi                               #5300.87
-..LN5569:
-        movq      %rax, %rdi                                    #5300.24
-        movq      %rsi, -176(%rbp)                              #5300.24
-        movq      %rdx, %rsi                                    #5300.24
-        movl      %ecx, %edx                                    #5300.24
-        movl      %ebx, %ecx                                    #5300.24
-        movq      -176(%rbp), %rax                              #5300.24
-        movq      %rax, %r8                                     #5300.24
-        call      NucStrstrSearch at PLT                           #5300.24
-                                # LOE eax
-..B30.128:                      # Preds ..B30.105
-        movl      %eax, -168(%rbp)                              #5300.24
-                                # LOE
-..B30.106:                      # Preds ..B30.128
-        movl      -168(%rbp), %eax                              #5300.24
-        movq      -32(%rbp), %rbx                               #5300.24
-..___tag_value_NucStrstrSearch.693:                             #
-        leave                                                   #5300.24
-..___tag_value_NucStrstrSearch.695:                             #
-        ret                                                     #5300.24
-..___tag_value_NucStrstrSearch.696:                             #
-                                # LOE
-..B30.107:                      # Preds ..B30.97
-..LN5571:
-        movq      -56(%rbp), %rax                               #5302.29
-        movq      8(%rax), %rax                                 #5302.29
-        movl      4(%rax), %eax                                 #5302.29
-..LN5573:
-        movl      %eax, -164(%rbp)                              #5302.17
-..LN5575:
-        movl      -164(%rbp), %eax                              #5303.22
-..LN5577:
-        movl      -16(%rbp), %edx                               #5303.34
-        cmpl      %edx, %eax                                    #5303.34
-        jbe       ..B30.109     # Prob 50%                      #5303.34
-                                # LOE
-..B30.108:                      # Preds ..B30.107
-..LN5579:
-        xorl      %eax, %eax                                    #5304.28
-        movq      -32(%rbp), %rbx                               #5304.28
-..___tag_value_NucStrstrSearch.698:                             #
-        leave                                                   #5304.28
-..___tag_value_NucStrstrSearch.700:                             #
-        ret                                                     #5304.28
-..___tag_value_NucStrstrSearch.701:                             #
-                                # LOE
-..B30.109:                      # Preds ..B30.107
-..LN5581:
-        movq      -56(%rbp), %rax                               #5305.42
-        movq      8(%rax), %rax                                 #5305.42
-..LN5583:
-        movq      -48(%rbp), %rdx                               #5305.62
-..LN5585:
-        movl      -16(%rbp), %ecx                               #5306.27
-        addl      -24(%rbp), %ecx                               #5306.27
-..LN5587:
-        movl      -164(%rbp), %ebx                              #5306.33
-        negl      %ebx                                          #5306.33
-        addl      %ebx, %ecx                                    #5306.33
-..LN5589:
-        movl      -164(%rbp), %ebx                              #5306.44
-..LN5591:
-        movq      -40(%rbp), %rsi                               #5306.55
-..LN5593:
-        movq      %rax, %rdi                                    #5305.24
-        movq      %rsi, -192(%rbp)                              #5305.24
-        movq      %rdx, %rsi                                    #5305.24
-        movl      %ecx, %edx                                    #5305.24
-        movl      %ebx, %ecx                                    #5305.24
-        movq      -192(%rbp), %rax                              #5305.24
-        movq      %rax, %r8                                     #5305.24
-        call      NucStrstrSearch at PLT                           #5305.24
-                                # LOE eax
-..B30.129:                      # Preds ..B30.109
-        movl      %eax, -184(%rbp)                              #5305.24
-                                # LOE
-..B30.110:                      # Preds ..B30.129
-        movl      -184(%rbp), %eax                              #5305.24
-        movq      -32(%rbp), %rbx                               #5305.24
-..___tag_value_NucStrstrSearch.703:                             #
-        leave                                                   #5305.24
-..___tag_value_NucStrstrSearch.705:                             #
-        ret                                                     #5305.24
-..___tag_value_NucStrstrSearch.706:                             #
-                                # LOE
-..B30.111:                      # Preds ..B30.101 ..B30.97 ..B30.4 ..B30.3 ..B30.2
-                                #       ..B30.1
-..LN5595:
-        xorl      %eax, %eax                                    #5311.12
-        movq      -32(%rbp), %rbx                               #5311.12
-..___tag_value_NucStrstrSearch.708:                             #
-        leave                                                   #5311.12
-..___tag_value_NucStrstrSearch.710:                             #
-        ret                                                     #5311.12
-        .align    2,0x90
-..___tag_value_NucStrstrSearch.711:                             #
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-.LNNucStrstrSearch:
-	.section .data1, "wa"
-	.space 24	# pad
-	.align 32
-..1..TPKT.30_0.0.1:
-	.quad	..1.30_0.TAG.00.0.1
-	.quad	..1.30_0.TAG.01.0.1
-	.quad	..1.30_0.TAG.02.0.1
-	.quad	..1.30_0.TAG.03.0.1
-	.quad	..1.30_0.TAG.04.0.1
-	.quad	..1.30_0.TAG.05.0.1
-	.quad	..1.30_0.TAG.06.0.1
-	.quad	..1.30_0.TAG.07.0.1
-	.quad	..1.30_0.TAG.08.0.1
-	.quad	..1.30_0.TAG.09.0.1
-	.quad	..1.30_0.TAG.0a.0.1
-	.quad	..1.30_0.TAG.0b.0.1
-	.quad	..1.30_0.TAG.0c.0.1
-	.data
-# -- End  NucStrstrSearch
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map.0:
-	.type	fasta_2na_map.0, at object
-	.size	fasta_2na_map.0,128
-	.space 128	# pad
-	.align 32
-fasta_4na_map.0:
-	.type	fasta_4na_map.0, at object
-	.size	fasta_4na_map.0,128
-	.space 128	# pad
-	.data
-	.align 32
-	.align 32
-expand_2na.0:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na.0, at object
-	.size	expand_2na.0,512
-	.section .rodata, "a"
-	.align 4
-	.align 4
-__$U0.0:
-	.byte	78
-	.byte	117
-	.byte	99
-	.byte	83
-	.byte	116
-	.byte	114
-	.byte	70
-	.byte	97
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	69
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	65
-	.byte	108
-	.byte	108
-	.byte	111
-	.byte	99
-	.byte	0
-	.type	__$U0.0, at object
-	.size	__$U0.0,21
-	.space 3	# pad
-	.align 4
-_2__STRING.1.0:
-	.byte	110
-	.byte	117
-	.byte	99
-	.byte	115
-	.byte	116
-	.byte	114
-	.byte	115
-	.byte	116
-	.byte	114
-	.byte	46
-	.byte	99
-	.byte	0
-	.type	_2__STRING.1.0, at object
-	.size	_2__STRING.1.0,12
-	.align 4
-_2__STRING.0.0:
-	.byte	40
-	.byte	32
-	.byte	40
-	.byte	32
-	.byte	115
-	.byte	105
-	.byte	122
-	.byte	101
-	.byte	95
-	.byte	116
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	113
-	.byte	117
-	.byte	101
-	.byte	114
-	.byte	121
-	.byte	32
-	.byte	91
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	93
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	112
-	.byte	97
-	.byte	116
-	.byte	116
-	.byte	101
-	.byte	114
-	.byte	110
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	49
-	.byte	53
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	61
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	0
-	.type	_2__STRING.0.0, at object
-	.size	_2__STRING.0.0,54
-	.space 2	# pad
-	.align 4
-_2__STRING.2.0:
-	.byte	40
-	.byte	32
-	.byte	40
-	.byte	32
-	.byte	115
-	.byte	105
-	.byte	122
-	.byte	101
-	.byte	95
-	.byte	116
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	113
-	.byte	117
-	.byte	101
-	.byte	114
-	.byte	121
-	.byte	32
-	.byte	91
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	93
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	109
-	.byte	97
-	.byte	115
-	.byte	107
-	.byte	32
-	.byte	38
-	.byte	32
-	.byte	49
-	.byte	53
-	.byte	32
-	.byte	41
-	.byte	32
-	.byte	61
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	0
-	.type	_2__STRING.2.0, at object
-	.size	_2__STRING.2.0,51
-	.space 1	# pad
-	.align 4
-__$U1.0:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	102
-	.byte	97
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U1.0, at object
-	.size	__$U1.0,15
-	.space 1	# pad
-	.align 4
-_2__STRING.3.0:
-	.byte	112
-	.byte	32
-	.byte	60
-	.byte	32
-	.byte	101
-	.byte	110
-	.byte	100
-	.byte	0
-	.type	_2__STRING.3.0, at object
-	.size	_2__STRING.3.0,8
-	.align 4
-__$U2.0:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	112
-	.byte	114
-	.byte	105
-	.byte	109
-	.byte	97
-	.byte	114
-	.byte	121
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U2.0, at object
-	.size	__$U2.0,17
-	.space 3	# pad
-	.align 4
-__$U3.0:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	117
-	.byte	110
-	.byte	97
-	.byte	114
-	.byte	121
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U3.0, at object
-	.size	__$U3.0,15
-	.space 1	# pad
-	.align 4
-_2__STRING.4.0:
-	.byte	42
-	.byte	32
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	116
-	.byte	117
-	.byte	115
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	124
-	.byte	124
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	115
-	.byte	117
-	.byte	98
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.4.0, at object
-	.size	_2__STRING.4.0,48
-	.align 4
-__$U4.0:
-	.byte	110
-	.byte	115
-	.byte	115
-	.byte	95
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	0
-	.type	__$U4.0, at object
-	.size	__$U4.0,9
-	.space 3	# pad
-	.align 4
-_2__STRING.5.0:
-	.byte	42
-	.byte	32
-	.byte	101
-	.byte	120
-	.byte	112
-	.byte	114
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.5.0, at object
-	.size	_2__STRING.5.0,22
-	.space 2	# pad
-	.align 4
-_2__STRING.6.0:
-	.byte	42
-	.byte	32
-	.byte	115
-	.byte	116
-	.byte	97
-	.byte	116
-	.byte	117
-	.byte	115
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	48
-	.byte	32
-	.byte	124
-	.byte	124
-	.byte	32
-	.byte	101
-	.byte	32
-	.byte	45
-	.byte	62
-	.byte	32
-	.byte	98
-	.byte	111
-	.byte	111
-	.byte	108
-	.byte	101
-	.byte	97
-	.byte	110
-	.byte	32
-	.byte	46
-	.byte	32
-	.byte	114
-	.byte	105
-	.byte	103
-	.byte	104
-	.byte	116
-	.byte	32
-	.byte	33
-	.byte	61
-	.byte	32
-	.byte	40
-	.byte	40
-	.byte	118
-	.byte	111
-	.byte	105
-	.byte	100
-	.byte	32
-	.byte	42
-	.byte	41
-	.byte	48
-	.byte	41
-	.byte	0
-	.type	_2__STRING.6.0, at object
-	.size	_2__STRING.6.0,53
-	.space 3	# pad
-	.align 4
-_2__STRING.7.0:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.7.0, at object
-	.size	_2__STRING.7.0,5
-	.space 3	# pad
-	.align 4
-_2__STRING.8.0:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.8.0, at object
-	.size	_2__STRING.8.0,17
-	.space 3	# pad
-	.align 4
-__$U5.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	56
-	.byte	0
-	.type	__$U5.0, at object
-	.size	__$U5.0,11
-	.space 1	# pad
-	.align 4
-_2__STRING.9.0:
-	.byte	108
-	.byte	101
-	.byte	110
-	.byte	32
-	.byte	62
-	.byte	61
-	.byte	32
-	.byte	113
-	.byte	108
-	.byte	101
-	.byte	110
-	.byte	0
-	.type	_2__STRING.9.0, at object
-	.size	_2__STRING.9.0,12
-	.align 4
-__$U6.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	54
-	.byte	0
-	.type	__$U6.0, at object
-	.size	__$U6.0,12
-	.align 4
-__$U7.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	51
-	.byte	50
-	.byte	0
-	.type	__$U7.0, at object
-	.size	__$U7.0,12
-	.align 4
-__$U8.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	54
-	.byte	52
-	.byte	0
-	.type	__$U8.0, at object
-	.size	__$U8.0,12
-	.align 4
-__$U9.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	50
-	.byte	56
-	.byte	0
-	.type	__$U9.0, at object
-	.size	__$U9.0,13
-	.space 3	# pad
-	.align 4
-__$Ua.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	50
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	112
-	.byte	111
-	.byte	115
-	.byte	0
-	.type	__$Ua.0, at object
-	.size	__$Ua.0,13
-	.space 3	# pad
-	.align 4
-__$Ub.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	54
-	.byte	0
-	.type	__$Ub.0, at object
-	.size	__$Ub.0,12
-	.align 4
-__$Uc.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	51
-	.byte	50
-	.byte	0
-	.type	__$Uc.0, at object
-	.size	__$Uc.0,12
-	.align 4
-__$Ud.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	54
-	.byte	52
-	.byte	0
-	.type	__$Ud.0, at object
-	.size	__$Ud.0,12
-	.align 4
-__$Ue.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	49
-	.byte	50
-	.byte	56
-	.byte	0
-	.type	__$Ue.0, at object
-	.size	__$Ue.0,13
-	.space 3	# pad
-	.align 4
-__$Uf.0:
-	.byte	101
-	.byte	118
-	.byte	97
-	.byte	108
-	.byte	95
-	.byte	52
-	.byte	110
-	.byte	97
-	.byte	95
-	.byte	112
-	.byte	111
-	.byte	115
-	.byte	0
-	.type	__$Uf.0, at object
-	.size	__$Uf.0,13
-	.data
-	.section .note.GNU-stack, ""
-// -- Begin DWARF2 SEGMENT .debug_info
-	.section .debug_info
-.debug_info_seg:
-	.align 1
-	.4byte 0x00002915
-	.2byte 0x0002
-	.4byte .debug_abbrev_seg
-	.byte 0x08
-.DWinfo0:
-//	DW_TAG_compile_unit:
-	.byte 0x01
-//	DW_AT_comp_dir:
-	.8byte 0x6f722f656d6f682f
-	.8byte 0x642f72656d726164
-	.8byte 0x746e692f6c657665
-	.8byte 0x73612f6c616e7265
-	.8byte 0x2f65636172742d6d
-	.8byte 0x726165732f617273
-	.2byte 0x6863
-	.byte 0x00
-//	DW_AT_language:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372747363756e
-	.4byte 0x00632e72
-//	DW_AT_producer:
-	.8byte 0x2952286c65746e49
-	.8byte 0x6d6f43202b2b4320
-	.8byte 0x72502072656c6970
-	.8byte 0x6e6f69737365666f
-	.8byte 0x6120726f66206c61
-	.8byte 0x69746163696c7070
-	.8byte 0x6e6e757220736e6f
-	.8byte 0x49206e6f20676e69
-	.8byte 0x202952286c65746e
-	.8byte 0x73726556202c3436
-	.8byte 0x302e3131206e6f69
-	.8byte 0x6c69754220202020
-	.8byte 0x3130393030322064
-	.8byte 0x46200a7325203133
-	.8byte 0x6e61522073657869
-	.8byte 0x74616c6552736567
-	.4byte 0x0a657669
-	.byte 0x00
-//	DW_AT_stmt_list:
-	.4byte .debug_line_seg
-.DWinfo31:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x26
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f3631746e69
-//	DW_AT_type:
-	.4byte 0x00002266
-.DWinfo30:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x145f
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.8byte 0x0068637261655372
-	.8byte 0x747372745363754e
-	.8byte 0x0068637261655372
-//	DW_AT_low_pc:
-	.8byte NucStrstrSearch
-//	DW_AT_high_pc:
-	.8byte .LNNucStrstrSearch
-//	DW_AT_external:
-	.byte 0x01
-.DWinfo32:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x145f
-//	DW_AT_decl_column:
-	.byte 0x28
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002889
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo33:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo34:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo35:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo36:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1460
-//	DW_AT_decl_column:
-	.byte 0x4e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002893
-//	DW_AT_name:
-	.8byte 0x006e656c666c6573
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo37:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x1463
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN5179
-//	DW_AT_high_pc:
-	.8byte ..LN5595
-.DWinfo38:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1464
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e756f66
-	.2byte 0x0064
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo39:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1465
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x656c5f6174736166
-	.2byte 0x006e
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7edc7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo29:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x1350
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-	.8byte 0x616e345f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte eval_4na_pos
-//	DW_AT_high_pc:
-	.8byte .LNeval_4na_pos
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo40:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1350
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo41:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo42:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo43:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1351
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo44:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo45:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo46:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1360
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo47:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo48:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo49:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo50:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo51:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo52:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo53:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo54:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1361
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo55:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo56:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo57:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo58:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1364
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo59:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1367
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo60:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1367
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo61:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x136b
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo62:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x136f
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo63:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1371
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo64:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1371
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7f987603
-.DWinfo65:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1372
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-	.byte 0x00
-.DWinfo28:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x1272
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-	.8byte 0x616e345f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte eval_4na_128
-//	DW_AT_high_pc:
-	.8byte .LNeval_4na_128
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo66:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1272
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo67:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo68:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo69:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1273
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo70:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo71:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo72:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1281
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo73:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo74:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo75:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo76:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo77:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo78:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo79:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo80:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1282
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo81:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x4c
-.DWinfo82:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo83:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo84:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1285
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo85:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1288
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo86:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1288
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo87:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x128b
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo88:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x128d
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo89:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x128d
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo90:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x128e
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-	.byte 0x00
-.DWinfo27:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x1193
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0034365f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0034365f
-//	DW_AT_low_pc:
-	.8byte eval_4na_64
-//	DW_AT_high_pc:
-	.8byte .LNeval_4na_64
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo91:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1193
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo92:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo93:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo94:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x1194
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo95:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo96:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo97:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a3
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo98:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo99:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo100:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo101:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo102:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo103:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo104:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo105:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a4
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo106:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo107:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo108:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo109:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11a7
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo110:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11aa
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x4c
-.DWinfo111:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11aa
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo112:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11ad
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo113:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11af
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo114:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11af
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo115:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x11b0
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo116:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x120a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN4367
-//	DW_AT_high_pc:
-	.8byte ..LN4451
-.DWinfo117:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x121b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo118:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x121c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f847603
-.DWinfo119:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x121d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f887603
-.DWinfo120:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x121e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f8c7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo26:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x10b5
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0032335f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0032335f
-//	DW_AT_low_pc:
-	.8byte eval_4na_32
-//	DW_AT_high_pc:
-	.8byte .LNeval_4na_32
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo121:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x10b5
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo122:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo123:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo124:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x10b6
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo125:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo126:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo127:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c4
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo128:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo129:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo130:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo131:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo132:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo133:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo134:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo135:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c5
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo136:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo137:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo138:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo139:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10c8
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo140:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10cb
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x4c
-.DWinfo141:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10cb
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo142:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10ce
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo143:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10d0
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo144:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10d0
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo145:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x10d1
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo146:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x112b
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN4029
-//	DW_AT_high_pc:
-	.8byte ..LN4113
-.DWinfo147:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x113c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo148:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x113d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f847603
-.DWinfo149:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x113e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f887603
-.DWinfo150:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x113f
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f8c7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo25:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0fd7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e345f6c617665
-	.4byte 0x0036315f
-	.8byte 0x616e345f6c617665
-	.4byte 0x0036315f
-//	DW_AT_low_pc:
-	.8byte eval_4na_16
-//	DW_AT_high_pc:
-	.8byte .LNeval_4na_16
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo151:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0fd7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo152:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo153:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo154:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0fd8
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo155:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo156:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo157:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe6
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6a72
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo158:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo159:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo160:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo161:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo162:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo163:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo164:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo165:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fe7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo166:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo167:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo168:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo169:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fea
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo170:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fed
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo171:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0fed
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo172:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0ff2
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo173:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0ff2
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo174:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0ff3
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo175:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x104d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN3725
-//	DW_AT_high_pc:
-	.8byte ..LN3809
-.DWinfo176:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x105e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo177:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x105f
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f847603
-.DWinfo178:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1060
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f887603
-.DWinfo179:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x1061
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f8c7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo24:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000279f
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x75625f656d697270
-	.8byte 0x616e345f72656666
-	.byte 0x00
-	.8byte 0x75625f656d697270
-	.8byte 0x616e345f72656666
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte prime_buffer_4na
-//	DW_AT_high_pc:
-	.8byte .LNprime_buffer_4na
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo180:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo181:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0f95
-//	DW_AT_decl_column:
-	.byte 0x3f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_name:
-	.4byte 0x6f6e6769
-	.2byte 0x6572
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo182:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0f97
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00706d74
-//	DW_AT_type:
-	.4byte 0x00002574
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo183:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0f98
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000279f
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-	.byte 0x00
-.DWinfo23:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0e4c
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.4byte 0x736f705f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte eval_2na_pos
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_pos
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo184:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0e4c
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo185:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo186:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo187:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0e4d
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo188:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5c
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo189:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5c
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo190:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo191:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo192:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo193:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo194:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo195:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo196:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo197:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e5d
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo198:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo199:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo200:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo201:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e60
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f947603
-.DWinfo202:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e63
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo203:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e63
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo204:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e67
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo205:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e6d
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo206:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e6e
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo207:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e71
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo208:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e71
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7f987603
-.DWinfo209:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0e72
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-	.byte 0x00
-.DWinfo22:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0d27
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.4byte 0x3832315f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte eval_2na_128
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_128
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo210:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0d27
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo211:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo212:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo213:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0d28
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo214:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d36
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo215:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d36
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo216:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo217:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo218:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo219:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo220:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo221:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo222:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo223:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d37
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo224:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x4c
-.DWinfo225:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo226:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo227:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3a
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fa47603
-.DWinfo228:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo229:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d3d
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo230:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d42
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo231:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d43
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo232:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d46
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo233:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d46
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo234:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0d47
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-	.byte 0x00
-.DWinfo21:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0c01
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0034365f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0034365f
-//	DW_AT_low_pc:
-	.8byte eval_2na_64
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_64
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo235:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0c01
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo236:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo237:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo238:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0c02
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo239:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c11
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo240:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c11
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo241:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo242:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo243:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo244:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo245:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo246:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo247:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo248:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c12
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo249:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo250:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo251:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo252:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c15
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo253:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c18
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo254:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c18
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo255:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c1d
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo256:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c1e
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo257:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c21
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo258:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c21
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7f987603
-.DWinfo259:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c22
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo260:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0c7a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN2693
-//	DW_AT_high_pc:
-	.8byte ..LN2779
-.DWinfo261:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c8b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo262:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c8c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef47603
-.DWinfo263:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c8d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef87603
-.DWinfo264:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0c8e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7efc7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo20:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0adc
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0032335f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0032335f
-//	DW_AT_low_pc:
-	.8byte eval_2na_32
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_32
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo265:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0adc
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo266:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo267:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo268:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0add
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo269:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aeb
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo270:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aeb
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo271:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo272:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo273:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo274:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo275:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo276:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo277:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo278:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aec
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo279:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo280:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo281:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo282:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0aef
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo283:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0af2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo284:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0af2
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo285:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0af7
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo286:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0af8
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo287:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0afb
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo288:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0afb
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7f987603
-.DWinfo289:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0afc
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo290:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0b54
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN2359
-//	DW_AT_high_pc:
-	.8byte ..LN2445
-.DWinfo291:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0b65
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo292:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0b66
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef47603
-.DWinfo293:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0b67
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef87603
-.DWinfo294:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0b68
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7efc7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo19:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x09b7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.4byte 0x0036315f
-	.8byte 0x616e325f6c617665
-	.4byte 0x0036315f
-//	DW_AT_low_pc:
-	.8byte eval_2na_16
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_16
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo295:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x09b7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo296:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo297:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo298:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x09b8
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo299:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c6
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo300:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c6
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dc07603
-.DWinfo301:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo302:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo303:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo304:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo305:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo306:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo307:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo308:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09c7
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo309:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo310:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo311:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo312:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09ca
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo313:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09cd
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo314:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09cd
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo315:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09d2
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6d616c73
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo316:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09d3
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo317:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09d6
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo318:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09d6
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7f987603
-.DWinfo319:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x09d7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo320:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0a2f
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN2033
-//	DW_AT_high_pc:
-	.8byte ..LN2119
-.DWinfo321:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0a40
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef07603
-.DWinfo322:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0a41
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef47603
-.DWinfo323:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0a42
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7ef87603
-.DWinfo324:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0a43
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7efc7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo18:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0892
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x616e325f6c617665
-	.2byte 0x385f
-	.byte 0x00
-	.8byte 0x616e325f6c617665
-	.2byte 0x385f
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte eval_2na_8
-//	DW_AT_high_pc:
-	.8byte .LNeval_2na_8
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo325:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0892
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002863
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo326:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000286d
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo327:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x27
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x00736f70
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo328:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0893
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo329:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a1
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7de07603
-.DWinfo330:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a1
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6972
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7dd07603
-.DWinfo331:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3070
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7df07603
-.DWinfo332:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3170
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e907603
-.DWinfo333:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7eb07603
-.DWinfo334:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x3370
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ed07603
-.DWinfo335:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x306d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7e807603
-.DWinfo336:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x316d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ea07603
-.DWinfo337:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x326d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ec07603
-.DWinfo338:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a2
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x336d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002877
-//	DW_AT_location:
-	.4byte 0x7ee07603
-.DWinfo339:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6172
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo340:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6272
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fbc7603
-.DWinfo341:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6372
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo342:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a5
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6472
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo343:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a8
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x737361705f6d756e
-	.2byte 0x7365
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x44
-.DWinfo344:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08a8
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x706f7473
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.4byte 0x7fb47603
-.DWinfo345:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08b1
-//	DW_AT_decl_column:
-	.byte 0x14
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa87603
-.DWinfo346:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08b1
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo347:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x08b2
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6e656c71
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo348:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x090a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN1749
-//	DW_AT_high_pc:
-	.8byte ..LN1835
-.DWinfo349:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x091b
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6166
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f807603
-.DWinfo350:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x091c
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6266
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f847603
-.DWinfo351:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x091d
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6366
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f887603
-.DWinfo352:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x091e
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6466
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.4byte 0x7f8c7603
-	.byte 0x00
-	.byte 0x00
-.DWinfo16:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0625
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022ea
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x61685772
-	.2byte 0x6b63
-	.byte 0x00
-	.8byte 0x747372745363754e
-	.4byte 0x61685772
-	.2byte 0x6b63
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte NucStrstrWhack
-//	DW_AT_high_pc:
-	.8byte .LNNucStrstrWhack
-//	DW_AT_external:
-	.byte 0x01
-.DWinfo353:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0625
-//	DW_AT_decl_column:
-	.byte 0x22
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000279a
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-	.byte 0x00
-.DWinfo15:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x6b614d72
-	.2byte 0x0065
-	.8byte 0x747372745363754e
-	.4byte 0x6b614d72
-	.2byte 0x0065
-//	DW_AT_low_pc:
-	.8byte NucStrstrMake
-//	DW_AT_high_pc:
-	.8byte .LNNucStrstrMake
-//	DW_AT_external:
-	.byte 0x01
-.DWinfo354:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002795
-//	DW_AT_name:
-	.4byte 0x0073736e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo355:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0601
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo356:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0602
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x72657571
-	.2byte 0x0079
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo357:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0602
-//	DW_AT_decl_column:
-	.byte 0x25
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_name:
-	.4byte 0x006e656c
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo358:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0607
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN1497
-//	DW_AT_high_pc:
-	.8byte ..LN1545
-.DWinfo359:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0608
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo360:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0609
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_location:
-	.4byte 0x7fb07603
-	.byte 0x00
-	.byte 0x00
-.DWinfo14:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x05cb
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022ea
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.4byte 0x696e4972
-	.2byte 0x0074
-	.8byte 0x747372745363754e
-	.4byte 0x696e4972
-	.2byte 0x0074
-//	DW_AT_low_pc:
-	.8byte NucStrstrInit
-//	DW_AT_high_pc:
-	.8byte .LNNucStrstrInit
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo361:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05cd
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x6863
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x5c
-.DWinfo362:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05ce
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x000023c1
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo363:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05cf
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo364:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05cf
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00616e326962636e
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo365:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05d0
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00616e346962636e
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo366:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN1463
-//	DW_AT_high_pc:
-	.8byte ..LN1481
-.DWinfo367:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00765f5f
-//	DW_AT_type:
-	.4byte 0x000022d8
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x74
-.DWinfo368:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x05e7
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x00785f5f
-//	DW_AT_type:
-	.4byte 0x000022d8
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-	.byte 0x00
-	.byte 0x00
-.DWinfo13:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x727078655f73736e
-	.byte 0x00
-	.8byte 0x727078655f73736e
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte nss_expr
-//	DW_AT_high_pc:
-	.8byte .LNnss_expr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo369:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x24
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo370:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x057c
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo371:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo372:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002776
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo373:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x057d
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo374:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0589
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN1277
-//	DW_AT_high_pc:
-	.8byte ..LN1371
-.DWinfo375:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x058a
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo376:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x058b
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000261e
-//	DW_AT_location:
-	.4byte 0x7f907603
-	.byte 0x00
-	.byte 0x00
-.DWinfo12:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x72616e755f73736e
-	.4byte 0x78655f79
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x72616e755f73736e
-	.4byte 0x78655f79
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte nss_unary_expr
-//	DW_AT_high_pc:
-	.8byte .LNnss_unary_expr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo377:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo378:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x054f
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo379:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo380:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002776
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo381:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0550
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo382:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0562
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN1187
-//	DW_AT_high_pc:
-	.8byte ..LN1229
-.DWinfo383:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0563
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000261e
-//	DW_AT_location:
-	.4byte 0x7fa07603
-	.byte 0x00
-	.byte 0x00
-.DWinfo11:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6d6972705f73736e
-	.8byte 0x727078655f797261
-	.byte 0x00
-	.8byte 0x6d6972705f73736e
-	.8byte 0x727078655f797261
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte nss_primary_expr
-//	DW_AT_high_pc:
-	.8byte .LNnss_primary_expr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo384:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x2c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo385:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0509
-//	DW_AT_decl_column:
-	.byte 0x3b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo386:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo387:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002776
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo388:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x050a
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo389:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x050c
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000261e
-//	DW_AT_location:
-	.4byte 0x7fb87603
-	.byte 0x00
-.DWinfo10:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747361665f73736e
-	.4byte 0x78655f61
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x747361665f73736e
-	.4byte 0x78655f61
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte nss_fasta_expr
-//	DW_AT_high_pc:
-	.8byte .LNnss_fasta_expr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo390:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo391:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04d0
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo392:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo393:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002776
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo394:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04d1
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-	.byte 0x00
-.DWinfo9:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x545341465f73736e
-	.4byte 0x78655f41
-	.2byte 0x7270
-	.byte 0x00
-	.8byte 0x545341465f73736e
-	.4byte 0x78655f41
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte nss_FASTA_expr
-//	DW_AT_high_pc:
-	.8byte .LNnss_FASTA_expr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo395:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x2a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo396:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04a6
-//	DW_AT_decl_column:
-	.byte 0x39
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo397:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo398:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002776
-//	DW_AT_name:
-	.4byte 0x74617473
-	.2byte 0x7375
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo399:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x04a7
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo400:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x04ac
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN817
-//	DW_AT_high_pc:
-	.8byte ..LN887
-.DWinfo401:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x04ad
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x72617473
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_location:
-	.4byte 0x7fb87603
-.DWinfo402:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x04af
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x48
-.DWinfo403:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x04b0
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x0070616d
-//	DW_AT_type:
-	.4byte 0x0000277b
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-	.byte 0x00
-	.byte 0x00
-.DWinfo8:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00626f735f73736e
-	.8byte 0x00626f735f73736e
-//	DW_AT_low_pc:
-	.8byte nss_sob
-//	DW_AT_high_pc:
-	.8byte .LNnss_sob
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo404:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x23
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.2byte 0x0070
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo405:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x049c
-//	DW_AT_decl_column:
-	.byte 0x32
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x00646e65
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-	.byte 0x00
-.DWinfo7:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x34656b61
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x34656b61
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte NucStrFastaExprMake4
-//	DW_AT_high_pc:
-	.8byte .LNNucStrFastaExprMake4
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo406:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo407:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x03f7
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo408:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x03f8
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo409:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x03f8
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000246f
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo410:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x03fa
-//	DW_AT_decl_column:
-	.byte 0x0c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x0000246f
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo411:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x03fb
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000261e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo412:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x03fc
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x00002574
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo413:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x03fc
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002574
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo414:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x040c
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN493
-//	DW_AT_high_pc:
-	.8byte ..LN603
-.DWinfo415:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x040d
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65736162
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000022c6
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-	.byte 0x00
-	.byte 0x00
-.DWinfo6:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x32656b61
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4d72707845617473
-	.4byte 0x32656b61
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte NucStrFastaExprMake2
-//	DW_AT_high_pc:
-	.8byte .LNNucStrFastaExprMake2
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo416:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x29
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002619
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x50
-.DWinfo417:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0344
-//	DW_AT_decl_column:
-	.byte 0x33
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002509
-//	DW_AT_name:
-	.8byte 0x6e6f697469736f70
-	.2byte 0x6c61
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo418:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0345
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002764
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x58
-.DWinfo419:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0345
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000246f
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-.DWinfo420:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0347
-//	DW_AT_decl_column:
-	.byte 0x0c
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x0000246f
-//	DW_AT_location:
-	.4byte 0x7fb07603
-.DWinfo421:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0348
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000261e
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x40
-.DWinfo422:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0349
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x00002574
-//	DW_AT_location:
-	.4byte 0x7f907603
-.DWinfo423:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0349
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002574
-//	DW_AT_location:
-	.4byte 0x7fa07603
-.DWinfo424:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0359
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN109
-//	DW_AT_high_pc:
-	.8byte ..LN219
-.DWinfo425:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x035a
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x65736162
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000025dc
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-	.byte 0x00
-	.byte 0x00
-.DWinfo4:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0136
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022ea
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.8byte 0x6f635f7061777362
-	.2byte 0x7970
-	.byte 0x00
-	.8byte 0x5f383231746e6975
-	.8byte 0x6f635f7061777362
-	.2byte 0x7970
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte uint128_bswap_copy
-//	DW_AT_high_pc:
-	.8byte .LNuint128_bswap_copy
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo426:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0136
-//	DW_AT_decl_column:
-	.byte 0x26
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002347
-//	DW_AT_name:
-	.2byte 0x6f74
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo427:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0136
-//	DW_AT_decl_column:
-	.byte 0x3b
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000023d1
-//	DW_AT_name:
-	.4byte 0x6d6f7266
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-	.byte 0x00
-.DWinfo3:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0125
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022ea
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.4byte 0x61777362
-	.2byte 0x0070
-	.8byte 0x5f383231746e6975
-	.4byte 0x61777362
-	.2byte 0x0070
-//	DW_AT_low_pc:
-	.8byte uint128_bswap
-//	DW_AT_high_pc:
-	.8byte .LNuint128_bswap
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo428:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0125
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002347
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-	.byte 0x00
-.DWinfo429:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x02
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x726f6873
-	.2byte 0x0074
-.DWinfo1:
-//	DW_TAG_subprogram:
-	.byte 0x08
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000000d5
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6c5f3631746e6975
-	.4byte 0x74696273
-	.byte 0x00
-	.8byte 0x6c5f3631746e6975
-	.4byte 0x74696273
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte uint16_lsbit
-//	DW_AT_high_pc:
-	.8byte .LNuint16_lsbit
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo430:
-//	DW_TAG_formal_parameter:
-	.byte 0x09
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x21
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022c6
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo431:
-//	DW_TAG_variable:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.byte 0x27
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x006e7472
-//	DW_AT_type:
-	.4byte 0x000000d5
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-	.byte 0x00
-.DWinfo432:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x32
-//	DW_AT_decl_column:
-	.byte 0x1c
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3631746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000022d8
-.DWinfo433:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x02
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x6f687320
-	.2byte 0x7472
-	.byte 0x00
-.DWinfo434:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x00
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x64696f76
-	.byte 0x00
-.DWinfo2:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0105
-//	DW_AT_decl_column:
-	.byte 0x06
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000022ea
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.4byte 0x00726873
-	.8byte 0x5f383231746e6975
-	.4byte 0x00726873
-//	DW_AT_low_pc:
-	.8byte uint128_shr
-//	DW_AT_high_pc:
-	.8byte .LNuint128_shr
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo435:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0105
-//	DW_AT_decl_column:
-	.byte 0x1f
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x00002347
-//	DW_AT_name:
-	.4byte 0x666c6573
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo436:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0105
-//	DW_AT_decl_column:
-	.byte 0x2e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000023af
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-	.byte 0x00
-.DWinfo437:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000234c
-.DWinfo438:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x63
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x0000235f
-.DWinfo439:
-//	DW_TAG_structure_type:
-	.byte 0x0c
-//	DW_AT_decl_line:
-	.byte 0x64
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_name:
-	.8byte 0x5f383231746e6975
-	.2byte 0x0074
-.DWinfo440:
-//	DW_TAG_member:
-	.byte 0x0d
-//	DW_AT_decl_line:
-	.byte 0x66
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x6f6c
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000238c
-.DWinfo441:
-//	DW_TAG_member:
-	.byte 0x0d
-//	DW_AT_decl_line:
-	.byte 0x67
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.2byte 0x6968
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000238c
-	.byte 0x00
-.DWinfo442:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x38
-//	DW_AT_decl_column:
-	.byte 0x1b
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3436746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000239e
-.DWinfo443:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x08
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x6e6f6c20
-	.2byte 0x0067
-.DWinfo444:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x34
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f3233746e6975
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023c1
-.DWinfo445:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x746e6920
-	.byte 0x00
-.DWinfo446:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000023d6
-.DWinfo447:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x0000234c
-.DWinfo448:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000022ea
-.DWinfo5:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0315
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x00
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x000023db
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x4172707845617473
-	.4byte 0x636f6c6c
-	.byte 0x00
-	.8byte 0x614672745363754e
-	.8byte 0x4172707845617473
-	.4byte 0x636f6c6c
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte NucStrFastaExprAlloc
-//	DW_AT_high_pc:
-	.8byte .LNNucStrFastaExprAlloc
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo449:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0315
-//	DW_AT_decl_column:
-	.byte 0x25
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x0000246f
-//	DW_AT_name:
-	.2byte 0x7a73
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x68
-.DWinfo450:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0317
-//	DW_AT_decl_column:
-	.byte 0x0b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x6574756f
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x000023db
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo451:
-//	DW_TAG_lexical_block:
-	.byte 0x05
-//	DW_AT_decl_line:
-	.2byte 0x0319
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_low_pc:
-	.8byte ..LN45
-//	DW_AT_high_pc:
-	.8byte ..LN59
-.DWinfo452:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x031a
-//	DW_AT_decl_column:
-	.byte 0x1a
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.2byte 0x0065
-//	DW_AT_type:
-	.4byte 0x0000247f
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-	.byte 0x00
-	.byte 0x00
-.DWinfo453:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x32
-//	DW_AT_decl_column:
-	.byte 0x17
-//	DW_AT_decl_file:
-	.byte 0x04
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.2byte 0x745f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000239e
-.DWinfo454:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002484
-.DWinfo455:
-//	DW_TAG_typedef:
-	.byte 0x0f
-//	DW_AT_decl_line:
-	.2byte 0x02fa
-//	DW_AT_decl_column:
-	.byte 0x20
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x0072707845617473
-//	DW_AT_type:
-	.4byte 0x0000249e
-.DWinfo456:
-//	DW_TAG_structure_type:
-	.byte 0x10
-//	DW_AT_decl_line:
-	.2byte 0x02fb
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x90
-//	DW_AT_name:
-	.8byte 0x614672745363754e
-	.8byte 0x0072707845617473
-.DWinfo457:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x02fd
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-.DWinfo458:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x02fe
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.4byte 0x657a6973
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000023af
-.DWinfo459:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0307
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.2byte 0x0075
-//	DW_AT_type:
-	.4byte 0x00002510
-.DWinfo460:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x030d
-//	DW_AT_decl_column:
-	.byte 0x07
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x10
-//	DW_AT_name:
-	.4byte 0x72657571
-	.2byte 0x0079
-//	DW_AT_type:
-	.4byte 0x0000253e
-	.byte 0x00
-.DWinfo461:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x27
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f3233746e69
-//	DW_AT_type:
-	.4byte 0x00002509
-.DWinfo462:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x04
-//	DW_AT_encoding:
-	.byte 0x05
-//	DW_AT_name:
-	.4byte 0x00746e69
-.DWinfo463:
-//	DW_TAG_union_type:
-	.byte 0x12
-//	DW_AT_decl_line:
-	.2byte 0x0301
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x08
-.DWinfo464:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.2byte 0x0305
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x6574756f
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x000023db
-.DWinfo465:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.2byte 0x0306
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x67696c61
-	.2byte 0x006e
-//	DW_AT_type:
-	.4byte 0x0000238c
-	.byte 0x00
-.DWinfo466:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00002547
-//	DW_AT_byte_size:
-	.byte 0x80
-.DWinfo467:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x03
-	.byte 0x00
-.DWinfo468:
-//	DW_TAG_structure_type:
-	.byte 0x16
-//	DW_AT_decl_line:
-	.2byte 0x030a
-//	DW_AT_decl_column:
-	.byte 0x05
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x20
-.DWinfo469:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x030b
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.8byte 0x006e726574746170
-//	DW_AT_type:
-	.4byte 0x00002574
-.DWinfo470:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x030c
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x10
-//	DW_AT_name:
-	.4byte 0x6b73616d
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002574
-	.byte 0x00
-.DWinfo471:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x48
-//	DW_AT_decl_column:
-	.byte 0x03
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f74617063756e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002586
-.DWinfo472:
-//	DW_TAG_union_type:
-	.byte 0x17
-//	DW_AT_decl_line:
-	.byte 0x42
-//	DW_AT_decl_column:
-	.byte 0x01
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo473:
-//	DW_TAG_member:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.byte 0x43
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0062
-//	DW_AT_type:
-	.4byte 0x000025d3
-.DWinfo474:
-//	DW_TAG_member:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.byte 0x44
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0077
-//	DW_AT_type:
-	.4byte 0x000025fe
-.DWinfo475:
-//	DW_TAG_member:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.byte 0x45
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0069
-//	DW_AT_type:
-	.4byte 0x00002607
-.DWinfo476:
-//	DW_TAG_member:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.byte 0x46
-//	DW_AT_decl_column:
-	.byte 0x0e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x006c
-//	DW_AT_type:
-	.4byte 0x00002610
-.DWinfo477:
-//	DW_TAG_member:
-	.byte 0x18
-//	DW_AT_decl_line:
-	.byte 0x47
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.2byte 0x0073
-//	DW_AT_type:
-	.4byte 0x0000234c
-	.byte 0x00
-.DWinfo478:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000025dc
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo479:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x0f
-	.byte 0x00
-.DWinfo480:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x31
-//	DW_AT_decl_column:
-	.byte 0x18
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00745f38746e6975
-//	DW_AT_type:
-	.4byte 0x000025ed
-.DWinfo481:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x01
-//	DW_AT_encoding:
-	.byte 0x08
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.4byte 0x61686320
-	.2byte 0x0072
-.DWinfo482:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000022c6
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo483:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x07
-	.byte 0x00
-.DWinfo484:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x000023af
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo485:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x03
-	.byte 0x00
-.DWinfo486:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x0000238c
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo487:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x01
-	.byte 0x00
-.DWinfo488:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000261e
-.DWinfo489:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002623
-.DWinfo490:
-//	DW_TAG_typedef:
-	.byte 0x0f
-//	DW_AT_decl_line:
-	.2byte 0x02df
-//	DW_AT_decl_column:
-	.byte 0x13
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x784572745363754e
-	.2byte 0x7270
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x00002638
-.DWinfo491:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x44
-//	DW_AT_decl_column:
-	.byte 0x19
-//	DW_AT_decl_file:
-	.byte 0x05
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x0000264b
-.DWinfo492:
-//	DW_TAG_union_type:
-	.byte 0x19
-//	DW_AT_decl_line:
-	.2byte 0x0339
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x90
-//	DW_AT_name:
-	.8byte 0x747372745363754e
-	.2byte 0x0072
-.DWinfo493:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.2byte 0x033b
-//	DW_AT_decl_column:
-	.byte 0x15
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x74736166
-	.2byte 0x0061
-//	DW_AT_type:
-	.4byte 0x00002484
-.DWinfo494:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.2byte 0x033c
-//	DW_AT_decl_column:
-	.byte 0x12
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.8byte 0x006e61656c6f6f62
-//	DW_AT_type:
-	.4byte 0x00002696
-.DWinfo495:
-//	DW_TAG_member:
-	.byte 0x13
-//	DW_AT_decl_line:
-	.2byte 0x033d
-//	DW_AT_decl_column:
-	.byte 0x13
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x00627573
-//	DW_AT_type:
-	.4byte 0x00002705
-	.byte 0x00
-.DWinfo496:
-//	DW_TAG_typedef:
-	.byte 0x0f
-//	DW_AT_decl_line:
-	.2byte 0x0328
-//	DW_AT_decl_column:
-	.byte 0x1d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x704f72745363754e
-	.4byte 0x72707845
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000026ad
-.DWinfo497:
-//	DW_TAG_structure_type:
-	.byte 0x10
-//	DW_AT_decl_line:
-	.2byte 0x0329
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x18
-//	DW_AT_name:
-	.8byte 0x704f72745363754e
-	.4byte 0x72707845
-	.byte 0x00
-.DWinfo498:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x032b
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-.DWinfo499:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x032c
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-.DWinfo500:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x032d
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.4byte 0x7466656c
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000261e
-.DWinfo501:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x032e
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x10
-//	DW_AT_name:
-	.4byte 0x68676972
-	.2byte 0x0074
-//	DW_AT_type:
-	.4byte 0x0000261e
-	.byte 0x00
-.DWinfo502:
-//	DW_TAG_typedef:
-	.byte 0x0f
-//	DW_AT_decl_line:
-	.2byte 0x0331
-//	DW_AT_decl_column:
-	.byte 0x1e
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x755372745363754e
-	.4byte 0x70784562
-	.2byte 0x0072
-//	DW_AT_type:
-	.4byte 0x0000271d
-.DWinfo503:
-//	DW_TAG_structure_type:
-	.byte 0x10
-//	DW_AT_decl_line:
-	.2byte 0x0332
-//	DW_AT_decl_column:
-	.byte 0x08
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_byte_size:
-	.byte 0x10
-//	DW_AT_name:
-	.8byte 0x755372745363754e
-	.4byte 0x70784562
-	.2byte 0x0072
-.DWinfo504:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0334
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x00
-//	DW_AT_name:
-	.4byte 0x65707974
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-.DWinfo505:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0335
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x04
-//	DW_AT_name:
-	.2byte 0x706f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x000024f8
-.DWinfo506:
-//	DW_TAG_member:
-	.byte 0x11
-//	DW_AT_decl_line:
-	.2byte 0x0336
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_data_member_location:
-	.2byte 0x2302
-	.byte 0x08
-//	DW_AT_name:
-	.4byte 0x72707865
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000261e
-	.byte 0x00
-.DWinfo507:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002769
-.DWinfo508:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x0000276e
-.DWinfo509:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x01
-//	DW_AT_encoding:
-	.byte 0x06
-//	DW_AT_name:
-	.4byte 0x72616863
-	.byte 0x00
-.DWinfo510:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002509
-.DWinfo511:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002780
-.DWinfo512:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00002785
-.DWinfo513:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x25
-//	DW_AT_decl_column:
-	.byte 0x16
-//	DW_AT_decl_file:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x38746e69
-	.2byte 0x745f
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000276e
-.DWinfo514:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000279a
-.DWinfo515:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002638
-.DWinfo516:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x2b
-//	DW_AT_decl_column:
-	.byte 0x36
-//	DW_AT_decl_file:
-	.byte 0x06
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_type:
-	.4byte 0x000027b0
-.DWinfo517:
-//	DW_TAG_array_type:
-	.byte 0x1a
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_type:
-	.4byte 0x000027cc
-//	DW_AT_byte_size:
-	.byte 0x10
-.DWinfo518:
-//	DW_TAG_subrange_type:
-	.byte 0x1b
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x00693832316d5f5f
-//	DW_AT_upper_bound:
-	.byte 0x01
-//	DW_AT_lower_bound:
-	.byte 0x00
-	.byte 0x00
-.DWinfo519:
-//	DW_TAG_base_type:
-	.byte 0x07
-//	DW_AT_byte_size:
-	.byte 0x08
-//	DW_AT_encoding:
-	.byte 0x07
-//	DW_AT_name:
-	.8byte 0x64656e6769736e75
-	.8byte 0x6f6c20676e6f6c20
-	.2byte 0x676e
-	.byte 0x00
-.DWinfo17:
-//	DW_TAG_subprogram:
-	.byte 0x03
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x09
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_inline:
-	.byte 0x02
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_type:
-	.4byte 0x0000279f
-//	DW_AT_prototyped:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x75625f656d697270
-	.8byte 0x616e325f72656666
-	.byte 0x00
-	.8byte 0x75625f656d697270
-	.8byte 0x616e325f72656666
-	.byte 0x00
-//	DW_AT_low_pc:
-	.8byte prime_buffer_2na
-//	DW_AT_high_pc:
-	.8byte .LNprime_buffer_2na
-//	DW_AT_external:
-	.byte 0x00
-.DWinfo520:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x2b
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_name:
-	.4byte 0x00637273
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x70
-.DWinfo521:
-//	DW_TAG_formal_parameter:
-	.byte 0x04
-//	DW_AT_decl_line:
-	.2byte 0x0850
-//	DW_AT_decl_column:
-	.byte 0x3f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_type:
-	.4byte 0x00002859
-//	DW_AT_name:
-	.4byte 0x6f6e6769
-	.2byte 0x6572
-	.byte 0x00
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x78
-.DWinfo522:
-//	DW_TAG_variable:
-	.byte 0x06
-//	DW_AT_decl_line:
-	.2byte 0x0852
-//	DW_AT_decl_column:
-	.byte 0x0d
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.4byte 0x66667562
-	.2byte 0x7265
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000279f
-//	DW_AT_location:
-	.2byte 0x7602
-	.byte 0x60
-	.byte 0x00
-.DWinfo523:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000285e
-.DWinfo524:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x000025dc
-.DWinfo525:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002868
-.DWinfo526:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00002484
-.DWinfo527:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x00002872
-.DWinfo528:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x000022ea
-.DWinfo529:
-//	DW_TAG_typedef:
-	.byte 0x02
-//	DW_AT_decl_line:
-	.byte 0x40
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x745f67657263756e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000279f
-.DWinfo530:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x0000288e
-.DWinfo531:
-//	DW_TAG_const_type:
-	.byte 0x0e
-//	DW_AT_type:
-	.4byte 0x00002638
-.DWinfo532:
-//	DW_TAG_pointer_type:
-	.byte 0x0b
-//	DW_AT_type:
-	.4byte 0x000023c1
-.DWinfo533:
-//	DW_TAG_variable:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.byte 0x5a
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6e325f6174736166
-	.4byte 0x616d5f61
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x000028b9
-//	DW_AT_location:
-	.2byte 0x0309
-	.8byte fasta_2na_map.0
-.DWinfo534:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00002785
-//	DW_AT_byte_size:
-	.byte 0x80
-.DWinfo535:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x7f
-	.byte 0x00
-.DWinfo536:
-//	DW_TAG_variable:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.byte 0x5b
-//	DW_AT_decl_column:
-	.byte 0x0f
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x6e345f6174736166
-	.4byte 0x616d5f61
-	.2byte 0x0070
-//	DW_AT_type:
-	.4byte 0x000028e3
-//	DW_AT_location:
-	.2byte 0x0309
-	.8byte fasta_4na_map.0
-.DWinfo537:
-//	DW_TAG_array_type:
-	.byte 0x14
-//	DW_AT_type:
-	.4byte 0x00002785
-//	DW_AT_byte_size:
-	.byte 0x80
-.DWinfo538:
-//	DW_TAG_subrange_type:
-	.byte 0x15
-//	DW_AT_upper_bound:
-	.byte 0x7f
-	.byte 0x00
-.DWinfo539:
-//	DW_TAG_variable:
-	.byte 0x0a
-//	DW_AT_decl_line:
-	.byte 0x5c
-//	DW_AT_decl_column:
-	.byte 0x11
-//	DW_AT_decl_file:
-	.byte 0x03
-//	DW_AT_accessibility:
-	.byte 0x01
-//	DW_AT_name:
-	.8byte 0x325f646e61707865
-	.2byte 0x616e
-	.byte 0x00
-//	DW_AT_type:
-	.4byte 0x0000290a
-//	DW_AT_location:
-	.2byte 0x0309
-	.8byte expand_2na.0
-.DWinfo540:
-//	DW_TAG_array_type:
-	.byte 0x1c
-//	DW_AT_type:
-	.4byte 0x000022c6
-//	DW_AT_byte_size:
-	.2byte 0x0200
-.DWinfo541:
-//	DW_TAG_subrange_type:
-	.byte 0x1d
-//	DW_AT_upper_bound:
-	.2byte 0x00ff
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-	.byte 0x00
-// -- Begin DWARF2 SEGMENT .debug_line
-	.section .debug_line
-.debug_line_seg:
-	.align 1
-// -- Begin DWARF2 SEGMENT .debug_abbrev
-	.section .debug_abbrev
-.debug_abbrev_seg:
-	.align 1
-	.byte 0x01
-	.byte 0x11
-	.byte 0x01
-	.byte 0x1b
-	.byte 0x08
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x25
-	.byte 0x08
-	.byte 0x10
-	.byte 0x06
-	.2byte 0x0000
-	.byte 0x02
-	.byte 0x16
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x03
-	.byte 0x2e
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x20
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x27
-	.byte 0x0c
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x4087
-	.byte 0x08
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.byte 0x3f
-	.byte 0x0c
-	.2byte 0x0000
-	.byte 0x04
-	.byte 0x05
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x03
-	.byte 0x08
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x05
-	.byte 0x0b
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.2byte 0x0000
-	.byte 0x06
-	.byte 0x34
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x07
-	.byte 0x24
-	.byte 0x00
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x3e
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x0000
-	.byte 0x08
-	.byte 0x2e
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x20
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x27
-	.byte 0x0c
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x4087
-	.byte 0x08
-	.byte 0x11
-	.byte 0x01
-	.byte 0x12
-	.byte 0x01
-	.byte 0x3f
-	.byte 0x0c
-	.2byte 0x0000
-	.byte 0x09
-	.byte 0x05
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x49
-	.byte 0x13
-	.byte 0x03
-	.byte 0x08
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x0a
-	.byte 0x34
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x02
-	.byte 0x0a
-	.2byte 0x0000
-	.byte 0x0b
-	.byte 0x0f
-	.byte 0x00
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0c
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x0000
-	.byte 0x0d
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0e
-	.byte 0x26
-	.byte 0x00
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x0f
-	.byte 0x16
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x10
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x0000
-	.byte 0x11
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x12
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x13
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x14
-	.byte 0x01
-	.byte 0x01
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x15
-	.byte 0x21
-	.byte 0x00
-	.byte 0x2f
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x16
-	.byte 0x13
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x17
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x18
-	.byte 0x0d
-	.byte 0x00
-	.byte 0x3b
-	.byte 0x0b
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x38
-	.byte 0x0a
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.2byte 0x0000
-	.byte 0x19
-	.byte 0x17
-	.byte 0x01
-	.byte 0x3b
-	.byte 0x05
-	.byte 0x39
-	.byte 0x0b
-	.byte 0x3a
-	.byte 0x0b
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.2byte 0x0000
-	.byte 0x1a
-	.byte 0x01
-	.byte 0x01
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x1b
-	.byte 0x21
-	.byte 0x00
-	.byte 0x32
-	.byte 0x0b
-	.byte 0x03
-	.byte 0x08
-	.byte 0x2f
-	.byte 0x0b
-	.byte 0x22
-	.byte 0x0b
-	.2byte 0x0000
-	.byte 0x1c
-	.byte 0x01
-	.byte 0x01
-	.byte 0x49
-	.byte 0x13
-	.byte 0x0b
-	.byte 0x05
-	.2byte 0x0000
-	.byte 0x1d
-	.byte 0x21
-	.byte 0x00
-	.byte 0x2f
-	.byte 0x05
-	.2byte 0x0000
-	.byte 0x00
-// -- Begin DWARF2 SEGMENT .debug_frame
-	.section .debug_frame
-.debug_frame_seg:
-	.align 1
-	.4byte 0x00000014
-	.4byte 0xffffffff
-	.byte 0x01
-	.byte 0x00
-	.byte 0x01
-	.byte 0x78
-	.byte 0x10
-	.4byte 0x9008070c
-	.byte 0x01
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_uint16_lsbit.2
-	.4byte ..___tag_value_uint16_lsbit.8-..___tag_value_uint16_lsbit.2
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.3-..___tag_value_uint16_lsbit.2
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.7-..___tag_value_uint16_lsbit.3
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_uint128_shr.11
-	.4byte ..___tag_value_uint128_shr.17-..___tag_value_uint128_shr.11
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.12-..___tag_value_uint128_shr.11
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.16-..___tag_value_uint128_shr.12
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_uint128_bswap.20
-	.4byte ..___tag_value_uint128_bswap.26-..___tag_value_uint128_bswap.20
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.21-..___tag_value_uint128_bswap.20
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.25-..___tag_value_uint128_bswap.21
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_uint128_bswap_copy.29
-	.4byte ..___tag_value_uint128_bswap_copy.35-..___tag_value_uint128_bswap_copy.29
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.30-..___tag_value_uint128_bswap_copy.29
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.34-..___tag_value_uint128_bswap_copy.30
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrFastaExprAlloc.38
-	.4byte ..___tag_value_NucStrFastaExprAlloc.47-..___tag_value_NucStrFastaExprAlloc.38
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.39-..___tag_value_NucStrFastaExprAlloc.38
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.43-..___tag_value_NucStrFastaExprAlloc.39
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.44-..___tag_value_NucStrFastaExprAlloc.43
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.46-..___tag_value_NucStrFastaExprAlloc.44
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000044
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrFastaExprMake2.50
-	.4byte ..___tag_value_NucStrFastaExprMake2.62-..___tag_value_NucStrFastaExprMake2.50
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.51-..___tag_value_NucStrFastaExprMake2.50
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.55-..___tag_value_NucStrFastaExprMake2.51
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.56-..___tag_value_NucStrFastaExprMake2.55
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.58-..___tag_value_NucStrFastaExprMake2.56
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.59-..___tag_value_NucStrFastaExprMake2.58
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.61-..___tag_value_NucStrFastaExprMake2.59
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.4byte 0x00000044
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrFastaExprMake4.65
-	.4byte ..___tag_value_NucStrFastaExprMake4.77-..___tag_value_NucStrFastaExprMake4.65
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.66-..___tag_value_NucStrFastaExprMake4.65
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.70-..___tag_value_NucStrFastaExprMake4.66
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.71-..___tag_value_NucStrFastaExprMake4.70
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.73-..___tag_value_NucStrFastaExprMake4.71
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.74-..___tag_value_NucStrFastaExprMake4.73
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.76-..___tag_value_NucStrFastaExprMake4.74
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_sob.80
-	.4byte ..___tag_value_nss_sob.86-..___tag_value_nss_sob.80
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.81-..___tag_value_nss_sob.80
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.85-..___tag_value_nss_sob.81
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000034
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_FASTA_expr.89
-	.4byte ..___tag_value_nss_FASTA_expr.97-..___tag_value_nss_FASTA_expr.89
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.90-..___tag_value_nss_FASTA_expr.89
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.93-..___tag_value_nss_FASTA_expr.90
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.94-..___tag_value_nss_FASTA_expr.93
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.96-..___tag_value_nss_FASTA_expr.94
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000004c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_fasta_expr.100
-	.4byte ..___tag_value_nss_fasta_expr.113-..___tag_value_nss_fasta_expr.100
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.101-..___tag_value_nss_fasta_expr.100
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.104-..___tag_value_nss_fasta_expr.101
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.105-..___tag_value_nss_fasta_expr.104
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.107-..___tag_value_nss_fasta_expr.105
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.108-..___tag_value_nss_fasta_expr.107
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.110-..___tag_value_nss_fasta_expr.108
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.112-..___tag_value_nss_fasta_expr.110
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000064
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_primary_expr.116
-	.4byte ..___tag_value_nss_primary_expr.134-..___tag_value_nss_primary_expr.116
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.117-..___tag_value_nss_primary_expr.116
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.120-..___tag_value_nss_primary_expr.117
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.121-..___tag_value_nss_primary_expr.120
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.123-..___tag_value_nss_primary_expr.121
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.124-..___tag_value_nss_primary_expr.123
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.126-..___tag_value_nss_primary_expr.124
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.128-..___tag_value_nss_primary_expr.126
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.129-..___tag_value_nss_primary_expr.128
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.131-..___tag_value_nss_primary_expr.129
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.133-..___tag_value_nss_primary_expr.131
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x0000004c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_unary_expr.137
-	.4byte ..___tag_value_nss_unary_expr.150-..___tag_value_nss_unary_expr.137
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.138-..___tag_value_nss_unary_expr.137
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.141-..___tag_value_nss_unary_expr.138
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.142-..___tag_value_nss_unary_expr.141
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.144-..___tag_value_nss_unary_expr.142
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.145-..___tag_value_nss_unary_expr.144
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.147-..___tag_value_nss_unary_expr.145
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.149-..___tag_value_nss_unary_expr.147
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000007c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_nss_expr.153
-	.4byte ..___tag_value_nss_expr.176-..___tag_value_nss_expr.153
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.154-..___tag_value_nss_expr.153
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.157-..___tag_value_nss_expr.154
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.158-..___tag_value_nss_expr.157
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.160-..___tag_value_nss_expr.158
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.161-..___tag_value_nss_expr.160
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.163-..___tag_value_nss_expr.161
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.165-..___tag_value_nss_expr.163
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.166-..___tag_value_nss_expr.165
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.168-..___tag_value_nss_expr.166
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.170-..___tag_value_nss_expr.168
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.171-..___tag_value_nss_expr.170
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.173-..___tag_value_nss_expr.171
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.175-..___tag_value_nss_expr.173
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrstrInit.179
-	.4byte ..___tag_value_NucStrstrInit.185-..___tag_value_NucStrstrInit.179
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.180-..___tag_value_NucStrstrInit.179
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.184-..___tag_value_NucStrstrInit.180
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000064
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrstrMake.188
-	.4byte ..___tag_value_NucStrstrMake.206-..___tag_value_NucStrstrMake.188
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.189-..___tag_value_NucStrstrMake.188
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.192-..___tag_value_NucStrstrMake.189
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.193-..___tag_value_NucStrstrMake.192
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.195-..___tag_value_NucStrstrMake.193
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.196-..___tag_value_NucStrstrMake.195
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.198-..___tag_value_NucStrstrMake.196
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.200-..___tag_value_NucStrstrMake.198
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.201-..___tag_value_NucStrstrMake.200
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.203-..___tag_value_NucStrstrMake.201
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.205-..___tag_value_NucStrstrMake.203
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrstrWhack.209
-	.4byte ..___tag_value_NucStrstrWhack.215-..___tag_value_NucStrstrWhack.209
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.210-..___tag_value_NucStrstrWhack.209
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.214-..___tag_value_NucStrstrWhack.210
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_prime_buffer_2na.218
-	.4byte ..___tag_value_prime_buffer_2na.224-..___tag_value_prime_buffer_2na.218
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.219-..___tag_value_prime_buffer_2na.218
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.223-..___tag_value_prime_buffer_2na.219
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_8.227
-	.4byte ..___tag_value_eval_2na_8.248-..___tag_value_eval_2na_8.227
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.228-..___tag_value_eval_2na_8.227
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.232-..___tag_value_eval_2na_8.228
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.233-..___tag_value_eval_2na_8.232
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.235-..___tag_value_eval_2na_8.233
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.236-..___tag_value_eval_2na_8.235
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.238-..___tag_value_eval_2na_8.236
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.239-..___tag_value_eval_2na_8.238
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.241-..___tag_value_eval_2na_8.239
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.242-..___tag_value_eval_2na_8.241
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.244-..___tag_value_eval_2na_8.242
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.245-..___tag_value_eval_2na_8.244
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.247-..___tag_value_eval_2na_8.245
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_16.251
-	.4byte ..___tag_value_eval_2na_16.272-..___tag_value_eval_2na_16.251
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.252-..___tag_value_eval_2na_16.251
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.256-..___tag_value_eval_2na_16.252
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.257-..___tag_value_eval_2na_16.256
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.259-..___tag_value_eval_2na_16.257
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.260-..___tag_value_eval_2na_16.259
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.262-..___tag_value_eval_2na_16.260
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.263-..___tag_value_eval_2na_16.262
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.265-..___tag_value_eval_2na_16.263
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.266-..___tag_value_eval_2na_16.265
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.268-..___tag_value_eval_2na_16.266
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.269-..___tag_value_eval_2na_16.268
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.271-..___tag_value_eval_2na_16.269
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_32.275
-	.4byte ..___tag_value_eval_2na_32.296-..___tag_value_eval_2na_32.275
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.276-..___tag_value_eval_2na_32.275
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.280-..___tag_value_eval_2na_32.276
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.281-..___tag_value_eval_2na_32.280
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.283-..___tag_value_eval_2na_32.281
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.284-..___tag_value_eval_2na_32.283
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.286-..___tag_value_eval_2na_32.284
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.287-..___tag_value_eval_2na_32.286
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.289-..___tag_value_eval_2na_32.287
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.290-..___tag_value_eval_2na_32.289
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.292-..___tag_value_eval_2na_32.290
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.293-..___tag_value_eval_2na_32.292
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.295-..___tag_value_eval_2na_32.293
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_64.299
-	.4byte ..___tag_value_eval_2na_64.320-..___tag_value_eval_2na_64.299
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.300-..___tag_value_eval_2na_64.299
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.304-..___tag_value_eval_2na_64.300
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.305-..___tag_value_eval_2na_64.304
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.307-..___tag_value_eval_2na_64.305
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.308-..___tag_value_eval_2na_64.307
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.310-..___tag_value_eval_2na_64.308
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.311-..___tag_value_eval_2na_64.310
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.313-..___tag_value_eval_2na_64.311
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.314-..___tag_value_eval_2na_64.313
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.316-..___tag_value_eval_2na_64.314
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.317-..___tag_value_eval_2na_64.316
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.319-..___tag_value_eval_2na_64.317
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000007c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_128.323
-	.4byte ..___tag_value_eval_2na_128.347-..___tag_value_eval_2na_128.323
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.324-..___tag_value_eval_2na_128.323
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.328-..___tag_value_eval_2na_128.324
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.329-..___tag_value_eval_2na_128.328
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.331-..___tag_value_eval_2na_128.329
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.332-..___tag_value_eval_2na_128.331
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.334-..___tag_value_eval_2na_128.332
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.335-..___tag_value_eval_2na_128.334
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.337-..___tag_value_eval_2na_128.335
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.338-..___tag_value_eval_2na_128.337
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.340-..___tag_value_eval_2na_128.338
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.341-..___tag_value_eval_2na_128.340
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.343-..___tag_value_eval_2na_128.341
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.344-..___tag_value_eval_2na_128.343
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.346-..___tag_value_eval_2na_128.344
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x000000dc
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_2na_pos.350
-	.4byte ..___tag_value_eval_2na_pos.392-..___tag_value_eval_2na_pos.350
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.351-..___tag_value_eval_2na_pos.350
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.355-..___tag_value_eval_2na_pos.351
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.356-..___tag_value_eval_2na_pos.355
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.358-..___tag_value_eval_2na_pos.356
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.359-..___tag_value_eval_2na_pos.358
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.361-..___tag_value_eval_2na_pos.359
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.362-..___tag_value_eval_2na_pos.361
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.364-..___tag_value_eval_2na_pos.362
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.365-..___tag_value_eval_2na_pos.364
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.367-..___tag_value_eval_2na_pos.365
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.368-..___tag_value_eval_2na_pos.367
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.370-..___tag_value_eval_2na_pos.368
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.371-..___tag_value_eval_2na_pos.370
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.373-..___tag_value_eval_2na_pos.371
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.374-..___tag_value_eval_2na_pos.373
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.376-..___tag_value_eval_2na_pos.374
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.377-..___tag_value_eval_2na_pos.376
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.379-..___tag_value_eval_2na_pos.377
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.380-..___tag_value_eval_2na_pos.379
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.382-..___tag_value_eval_2na_pos.380
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.383-..___tag_value_eval_2na_pos.382
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.385-..___tag_value_eval_2na_pos.383
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.386-..___tag_value_eval_2na_pos.385
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.388-..___tag_value_eval_2na_pos.386
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.389-..___tag_value_eval_2na_pos.388
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.391-..___tag_value_eval_2na_pos.389
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_prime_buffer_4na.395
-	.4byte ..___tag_value_prime_buffer_4na.401-..___tag_value_prime_buffer_4na.395
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.396-..___tag_value_prime_buffer_4na.395
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.400-..___tag_value_prime_buffer_4na.396
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_4na_16.404
-	.4byte ..___tag_value_eval_4na_16.425-..___tag_value_eval_4na_16.404
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.405-..___tag_value_eval_4na_16.404
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.409-..___tag_value_eval_4na_16.405
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.410-..___tag_value_eval_4na_16.409
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.412-..___tag_value_eval_4na_16.410
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.413-..___tag_value_eval_4na_16.412
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.415-..___tag_value_eval_4na_16.413
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.416-..___tag_value_eval_4na_16.415
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.418-..___tag_value_eval_4na_16.416
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.419-..___tag_value_eval_4na_16.418
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.421-..___tag_value_eval_4na_16.419
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.422-..___tag_value_eval_4na_16.421
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.424-..___tag_value_eval_4na_16.422
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_4na_32.428
-	.4byte ..___tag_value_eval_4na_32.449-..___tag_value_eval_4na_32.428
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.429-..___tag_value_eval_4na_32.428
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.433-..___tag_value_eval_4na_32.429
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.434-..___tag_value_eval_4na_32.433
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.436-..___tag_value_eval_4na_32.434
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.437-..___tag_value_eval_4na_32.436
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.439-..___tag_value_eval_4na_32.437
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.440-..___tag_value_eval_4na_32.439
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.442-..___tag_value_eval_4na_32.440
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.443-..___tag_value_eval_4na_32.442
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.445-..___tag_value_eval_4na_32.443
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.446-..___tag_value_eval_4na_32.445
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.448-..___tag_value_eval_4na_32.446
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000074
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_4na_64.452
-	.4byte ..___tag_value_eval_4na_64.473-..___tag_value_eval_4na_64.452
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.453-..___tag_value_eval_4na_64.452
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.457-..___tag_value_eval_4na_64.453
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.458-..___tag_value_eval_4na_64.457
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.460-..___tag_value_eval_4na_64.458
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.461-..___tag_value_eval_4na_64.460
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.463-..___tag_value_eval_4na_64.461
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.464-..___tag_value_eval_4na_64.463
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.466-..___tag_value_eval_4na_64.464
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.467-..___tag_value_eval_4na_64.466
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.469-..___tag_value_eval_4na_64.467
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.470-..___tag_value_eval_4na_64.469
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.472-..___tag_value_eval_4na_64.470
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000007c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_4na_128.476
-	.4byte ..___tag_value_eval_4na_128.500-..___tag_value_eval_4na_128.476
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.477-..___tag_value_eval_4na_128.476
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.481-..___tag_value_eval_4na_128.477
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.482-..___tag_value_eval_4na_128.481
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.484-..___tag_value_eval_4na_128.482
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.485-..___tag_value_eval_4na_128.484
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.487-..___tag_value_eval_4na_128.485
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.488-..___tag_value_eval_4na_128.487
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.490-..___tag_value_eval_4na_128.488
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.491-..___tag_value_eval_4na_128.490
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.493-..___tag_value_eval_4na_128.491
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.494-..___tag_value_eval_4na_128.493
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.496-..___tag_value_eval_4na_128.494
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.497-..___tag_value_eval_4na_128.496
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.499-..___tag_value_eval_4na_128.497
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x000000dc
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_eval_4na_pos.503
-	.4byte ..___tag_value_eval_4na_pos.545-..___tag_value_eval_4na_pos.503
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.504-..___tag_value_eval_4na_pos.503
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.508-..___tag_value_eval_4na_pos.504
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.509-..___tag_value_eval_4na_pos.508
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.511-..___tag_value_eval_4na_pos.509
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.512-..___tag_value_eval_4na_pos.511
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.514-..___tag_value_eval_4na_pos.512
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.515-..___tag_value_eval_4na_pos.514
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.517-..___tag_value_eval_4na_pos.515
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.518-..___tag_value_eval_4na_pos.517
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.520-..___tag_value_eval_4na_pos.518
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.521-..___tag_value_eval_4na_pos.520
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.523-..___tag_value_eval_4na_pos.521
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.524-..___tag_value_eval_4na_pos.523
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.526-..___tag_value_eval_4na_pos.524
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.527-..___tag_value_eval_4na_pos.526
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.529-..___tag_value_eval_4na_pos.527
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.530-..___tag_value_eval_4na_pos.529
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.532-..___tag_value_eval_4na_pos.530
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.533-..___tag_value_eval_4na_pos.532
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.535-..___tag_value_eval_4na_pos.533
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.536-..___tag_value_eval_4na_pos.535
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.538-..___tag_value_eval_4na_pos.536
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.539-..___tag_value_eval_4na_pos.538
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.541-..___tag_value_eval_4na_pos.539
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.542-..___tag_value_eval_4na_pos.541
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.544-..___tag_value_eval_4na_pos.542
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x0000033c
-	.4byte .debug_frame_seg
-	.8byte ..___tag_value_NucStrstrSearch.548
-	.4byte ..___tag_value_NucStrstrSearch.711-..___tag_value_NucStrstrSearch.548
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.549-..___tag_value_NucStrstrSearch.548
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.552-..___tag_value_NucStrstrSearch.549
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.553-..___tag_value_NucStrstrSearch.552
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.555-..___tag_value_NucStrstrSearch.553
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.556-..___tag_value_NucStrstrSearch.555
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.558-..___tag_value_NucStrstrSearch.556
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.560-..___tag_value_NucStrstrSearch.558
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.561-..___tag_value_NucStrstrSearch.560
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.563-..___tag_value_NucStrstrSearch.561
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.565-..___tag_value_NucStrstrSearch.563
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.566-..___tag_value_NucStrstrSearch.565
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.568-..___tag_value_NucStrstrSearch.566
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.570-..___tag_value_NucStrstrSearch.568
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.571-..___tag_value_NucStrstrSearch.570
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.573-..___tag_value_NucStrstrSearch.571
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.575-..___tag_value_NucStrstrSearch.573
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.576-..___tag_value_NucStrstrSearch.575
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.578-..___tag_value_NucStrstrSearch.576
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.580-..___tag_value_NucStrstrSearch.578
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.581-..___tag_value_NucStrstrSearch.580
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.583-..___tag_value_NucStrstrSearch.581
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.585-..___tag_value_NucStrstrSearch.583
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.586-..___tag_value_NucStrstrSearch.585
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.588-..___tag_value_NucStrstrSearch.586
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.590-..___tag_value_NucStrstrSearch.588
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.591-..___tag_value_NucStrstrSearch.590
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.593-..___tag_value_NucStrstrSearch.591
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.595-..___tag_value_NucStrstrSearch.593
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.596-..___tag_value_NucStrstrSearch.595
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.598-..___tag_value_NucStrstrSearch.596
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.600-..___tag_value_NucStrstrSearch.598
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.601-..___tag_value_NucStrstrSearch.600
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.603-..___tag_value_NucStrstrSearch.601
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.605-..___tag_value_NucStrstrSearch.603
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.606-..___tag_value_NucStrstrSearch.605
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.608-..___tag_value_NucStrstrSearch.606
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.610-..___tag_value_NucStrstrSearch.608
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.611-..___tag_value_NucStrstrSearch.610
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.613-..___tag_value_NucStrstrSearch.611
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.615-..___tag_value_NucStrstrSearch.613
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.616-..___tag_value_NucStrstrSearch.615
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.618-..___tag_value_NucStrstrSearch.616
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.620-..___tag_value_NucStrstrSearch.618
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.621-..___tag_value_NucStrstrSearch.620
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.623-..___tag_value_NucStrstrSearch.621
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.625-..___tag_value_NucStrstrSearch.623
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.626-..___tag_value_NucStrstrSearch.625
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.628-..___tag_value_NucStrstrSearch.626
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.630-..___tag_value_NucStrstrSearch.628
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.631-..___tag_value_NucStrstrSearch.630
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.633-..___tag_value_NucStrstrSearch.631
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.635-..___tag_value_NucStrstrSearch.633
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.636-..___tag_value_NucStrstrSearch.635
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.638-..___tag_value_NucStrstrSearch.636
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.640-..___tag_value_NucStrstrSearch.638
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.641-..___tag_value_NucStrstrSearch.640
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.643-..___tag_value_NucStrstrSearch.641
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.645-..___tag_value_NucStrstrSearch.643
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.646-..___tag_value_NucStrstrSearch.645
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.648-..___tag_value_NucStrstrSearch.646
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.650-..___tag_value_NucStrstrSearch.648
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.651-..___tag_value_NucStrstrSearch.650
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.653-..___tag_value_NucStrstrSearch.651
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.655-..___tag_value_NucStrstrSearch.653
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.656-..___tag_value_NucStrstrSearch.655
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.658-..___tag_value_NucStrstrSearch.656
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.660-..___tag_value_NucStrstrSearch.658
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.661-..___tag_value_NucStrstrSearch.660
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.663-..___tag_value_NucStrstrSearch.661
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.665-..___tag_value_NucStrstrSearch.663
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.666-..___tag_value_NucStrstrSearch.665
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.668-..___tag_value_NucStrstrSearch.666
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.670-..___tag_value_NucStrstrSearch.668
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.671-..___tag_value_NucStrstrSearch.670
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.673-..___tag_value_NucStrstrSearch.671
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.675-..___tag_value_NucStrstrSearch.673
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.676-..___tag_value_NucStrstrSearch.675
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.678-..___tag_value_NucStrstrSearch.676
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.680-..___tag_value_NucStrstrSearch.678
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.681-..___tag_value_NucStrstrSearch.680
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.683-..___tag_value_NucStrstrSearch.681
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.685-..___tag_value_NucStrstrSearch.683
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.686-..___tag_value_NucStrstrSearch.685
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.688-..___tag_value_NucStrstrSearch.686
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.690-..___tag_value_NucStrstrSearch.688
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.691-..___tag_value_NucStrstrSearch.690
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.693-..___tag_value_NucStrstrSearch.691
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.695-..___tag_value_NucStrstrSearch.693
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.696-..___tag_value_NucStrstrSearch.695
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.698-..___tag_value_NucStrstrSearch.696
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.700-..___tag_value_NucStrstrSearch.698
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.701-..___tag_value_NucStrstrSearch.700
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.703-..___tag_value_NucStrstrSearch.701
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.705-..___tag_value_NucStrstrSearch.703
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.706-..___tag_value_NucStrstrSearch.705
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.708-..___tag_value_NucStrstrSearch.706
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.710-..___tag_value_NucStrstrSearch.708
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-// -- Begin DWARF2 SEGMENT .eh_frame
-	.section .eh_frame,"a", at progbits
-.eh_frame_seg:
-	.align 1
-	.4byte 0x00000014
-	.4byte 0x00000000
-	.byte 0x01
-	.2byte 0x527a
-	.byte 0x00
-	.byte 0x01
-	.byte 0x78
-	.byte 0x10
-	.byte 0x01
-	.4byte 0x08070c1b
-	.2byte 0x0190
-	.2byte 0x0000
-	.4byte 0x00000024
-	.4byte 0x0000001c
-	.4byte ..___tag_value_uint16_lsbit.2-.
-	.4byte ..___tag_value_uint16_lsbit.8-..___tag_value_uint16_lsbit.2
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.3-..___tag_value_uint16_lsbit.2
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.7-..___tag_value_uint16_lsbit.3
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x00000044
-	.4byte ..___tag_value_uint128_shr.11-.
-	.4byte ..___tag_value_uint128_shr.17-..___tag_value_uint128_shr.11
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.12-..___tag_value_uint128_shr.11
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.16-..___tag_value_uint128_shr.12
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x0000006c
-	.4byte ..___tag_value_uint128_bswap.20-.
-	.4byte ..___tag_value_uint128_bswap.26-..___tag_value_uint128_bswap.20
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.21-..___tag_value_uint128_bswap.20
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.25-..___tag_value_uint128_bswap.21
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x00000094
-	.4byte ..___tag_value_uint128_bswap_copy.29-.
-	.4byte ..___tag_value_uint128_bswap_copy.35-..___tag_value_uint128_bswap_copy.29
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.30-..___tag_value_uint128_bswap_copy.29
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.34-..___tag_value_uint128_bswap_copy.30
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x000000bc
-	.4byte ..___tag_value_NucStrFastaExprAlloc.38-.
-	.4byte ..___tag_value_NucStrFastaExprAlloc.47-..___tag_value_NucStrFastaExprAlloc.38
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.39-..___tag_value_NucStrFastaExprAlloc.38
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.43-..___tag_value_NucStrFastaExprAlloc.39
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.44-..___tag_value_NucStrFastaExprAlloc.43
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.46-..___tag_value_NucStrFastaExprAlloc.44
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000044
-	.4byte 0x000000f4
-	.4byte ..___tag_value_NucStrFastaExprMake2.50-.
-	.4byte ..___tag_value_NucStrFastaExprMake2.62-..___tag_value_NucStrFastaExprMake2.50
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.51-..___tag_value_NucStrFastaExprMake2.50
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.55-..___tag_value_NucStrFastaExprMake2.51
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.56-..___tag_value_NucStrFastaExprMake2.55
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.58-..___tag_value_NucStrFastaExprMake2.56
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.59-..___tag_value_NucStrFastaExprMake2.58
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.61-..___tag_value_NucStrFastaExprMake2.59
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000044
-	.4byte 0x0000013c
-	.4byte ..___tag_value_NucStrFastaExprMake4.65-.
-	.4byte ..___tag_value_NucStrFastaExprMake4.77-..___tag_value_NucStrFastaExprMake4.65
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.66-..___tag_value_NucStrFastaExprMake4.65
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.70-..___tag_value_NucStrFastaExprMake4.66
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.71-..___tag_value_NucStrFastaExprMake4.70
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.73-..___tag_value_NucStrFastaExprMake4.71
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.74-..___tag_value_NucStrFastaExprMake4.73
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.76-..___tag_value_NucStrFastaExprMake4.74
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x00000184
-	.4byte ..___tag_value_nss_sob.80-.
-	.4byte ..___tag_value_nss_sob.86-..___tag_value_nss_sob.80
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.81-..___tag_value_nss_sob.80
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.85-..___tag_value_nss_sob.81
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x000001ac
-	.4byte ..___tag_value_nss_FASTA_expr.89-.
-	.4byte ..___tag_value_nss_FASTA_expr.97-..___tag_value_nss_FASTA_expr.89
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.90-..___tag_value_nss_FASTA_expr.89
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.93-..___tag_value_nss_FASTA_expr.90
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.94-..___tag_value_nss_FASTA_expr.93
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.96-..___tag_value_nss_FASTA_expr.94
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x0000004c
-	.4byte 0x000001e4
-	.4byte ..___tag_value_nss_fasta_expr.100-.
-	.4byte ..___tag_value_nss_fasta_expr.113-..___tag_value_nss_fasta_expr.100
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.101-..___tag_value_nss_fasta_expr.100
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.104-..___tag_value_nss_fasta_expr.101
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.105-..___tag_value_nss_fasta_expr.104
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.107-..___tag_value_nss_fasta_expr.105
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.108-..___tag_value_nss_fasta_expr.107
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.110-..___tag_value_nss_fasta_expr.108
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.112-..___tag_value_nss_fasta_expr.110
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000064
-	.4byte 0x00000234
-	.4byte ..___tag_value_nss_primary_expr.116-.
-	.4byte ..___tag_value_nss_primary_expr.134-..___tag_value_nss_primary_expr.116
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.117-..___tag_value_nss_primary_expr.116
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.120-..___tag_value_nss_primary_expr.117
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.121-..___tag_value_nss_primary_expr.120
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.123-..___tag_value_nss_primary_expr.121
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.124-..___tag_value_nss_primary_expr.123
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.126-..___tag_value_nss_primary_expr.124
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.128-..___tag_value_nss_primary_expr.126
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.129-..___tag_value_nss_primary_expr.128
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.131-..___tag_value_nss_primary_expr.129
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.133-..___tag_value_nss_primary_expr.131
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.4byte 0x0000004c
-	.4byte 0x0000029c
-	.4byte ..___tag_value_nss_unary_expr.137-.
-	.4byte ..___tag_value_nss_unary_expr.150-..___tag_value_nss_unary_expr.137
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.138-..___tag_value_nss_unary_expr.137
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.141-..___tag_value_nss_unary_expr.138
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.142-..___tag_value_nss_unary_expr.141
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.144-..___tag_value_nss_unary_expr.142
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.145-..___tag_value_nss_unary_expr.144
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.147-..___tag_value_nss_unary_expr.145
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.149-..___tag_value_nss_unary_expr.147
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x0000007c
-	.4byte 0x000002ec
-	.4byte ..___tag_value_nss_expr.153-.
-	.4byte ..___tag_value_nss_expr.176-..___tag_value_nss_expr.153
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.154-..___tag_value_nss_expr.153
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.157-..___tag_value_nss_expr.154
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.158-..___tag_value_nss_expr.157
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.160-..___tag_value_nss_expr.158
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.161-..___tag_value_nss_expr.160
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.163-..___tag_value_nss_expr.161
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.165-..___tag_value_nss_expr.163
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.166-..___tag_value_nss_expr.165
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.168-..___tag_value_nss_expr.166
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.170-..___tag_value_nss_expr.168
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.171-..___tag_value_nss_expr.170
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.173-..___tag_value_nss_expr.171
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.175-..___tag_value_nss_expr.173
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x0000036c
-	.4byte ..___tag_value_NucStrstrInit.179-.
-	.4byte ..___tag_value_NucStrstrInit.185-..___tag_value_NucStrstrInit.179
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.180-..___tag_value_NucStrstrInit.179
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.184-..___tag_value_NucStrstrInit.180
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000064
-	.4byte 0x00000394
-	.4byte ..___tag_value_NucStrstrMake.188-.
-	.4byte ..___tag_value_NucStrstrMake.206-..___tag_value_NucStrstrMake.188
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.189-..___tag_value_NucStrstrMake.188
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.192-..___tag_value_NucStrstrMake.189
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.193-..___tag_value_NucStrstrMake.192
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.195-..___tag_value_NucStrstrMake.193
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.196-..___tag_value_NucStrstrMake.195
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.198-..___tag_value_NucStrstrMake.196
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.200-..___tag_value_NucStrstrMake.198
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.201-..___tag_value_NucStrstrMake.200
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.203-..___tag_value_NucStrstrMake.201
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.205-..___tag_value_NucStrstrMake.203
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.4byte 0x00000024
-	.4byte 0x000003fc
-	.4byte ..___tag_value_NucStrstrWhack.209-.
-	.4byte ..___tag_value_NucStrstrWhack.215-..___tag_value_NucStrstrWhack.209
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.210-..___tag_value_NucStrstrWhack.209
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.214-..___tag_value_NucStrstrWhack.210
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x00000424
-	.4byte ..___tag_value_prime_buffer_2na.218-.
-	.4byte ..___tag_value_prime_buffer_2na.224-..___tag_value_prime_buffer_2na.218
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.219-..___tag_value_prime_buffer_2na.218
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.223-..___tag_value_prime_buffer_2na.219
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x0000006c
-	.4byte 0x0000044c
-	.4byte ..___tag_value_eval_2na_8.227-.
-	.4byte ..___tag_value_eval_2na_8.248-..___tag_value_eval_2na_8.227
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.228-..___tag_value_eval_2na_8.227
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.232-..___tag_value_eval_2na_8.228
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.233-..___tag_value_eval_2na_8.232
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.235-..___tag_value_eval_2na_8.233
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.236-..___tag_value_eval_2na_8.235
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.238-..___tag_value_eval_2na_8.236
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.239-..___tag_value_eval_2na_8.238
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.241-..___tag_value_eval_2na_8.239
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.242-..___tag_value_eval_2na_8.241
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.244-..___tag_value_eval_2na_8.242
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.245-..___tag_value_eval_2na_8.244
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.247-..___tag_value_eval_2na_8.245
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000006c
-	.4byte 0x000004bc
-	.4byte ..___tag_value_eval_2na_16.251-.
-	.4byte ..___tag_value_eval_2na_16.272-..___tag_value_eval_2na_16.251
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.252-..___tag_value_eval_2na_16.251
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.256-..___tag_value_eval_2na_16.252
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.257-..___tag_value_eval_2na_16.256
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.259-..___tag_value_eval_2na_16.257
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.260-..___tag_value_eval_2na_16.259
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.262-..___tag_value_eval_2na_16.260
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.263-..___tag_value_eval_2na_16.262
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.265-..___tag_value_eval_2na_16.263
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.266-..___tag_value_eval_2na_16.265
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.268-..___tag_value_eval_2na_16.266
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.269-..___tag_value_eval_2na_16.268
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.271-..___tag_value_eval_2na_16.269
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000006c
-	.4byte 0x0000052c
-	.4byte ..___tag_value_eval_2na_32.275-.
-	.4byte ..___tag_value_eval_2na_32.296-..___tag_value_eval_2na_32.275
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.276-..___tag_value_eval_2na_32.275
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.280-..___tag_value_eval_2na_32.276
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.281-..___tag_value_eval_2na_32.280
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.283-..___tag_value_eval_2na_32.281
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.284-..___tag_value_eval_2na_32.283
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.286-..___tag_value_eval_2na_32.284
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.287-..___tag_value_eval_2na_32.286
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.289-..___tag_value_eval_2na_32.287
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.290-..___tag_value_eval_2na_32.289
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.292-..___tag_value_eval_2na_32.290
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.293-..___tag_value_eval_2na_32.292
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.295-..___tag_value_eval_2na_32.293
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000006c
-	.4byte 0x0000059c
-	.4byte ..___tag_value_eval_2na_64.299-.
-	.4byte ..___tag_value_eval_2na_64.320-..___tag_value_eval_2na_64.299
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.300-..___tag_value_eval_2na_64.299
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.304-..___tag_value_eval_2na_64.300
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.305-..___tag_value_eval_2na_64.304
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.307-..___tag_value_eval_2na_64.305
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.308-..___tag_value_eval_2na_64.307
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.310-..___tag_value_eval_2na_64.308
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.311-..___tag_value_eval_2na_64.310
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.313-..___tag_value_eval_2na_64.311
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.314-..___tag_value_eval_2na_64.313
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.316-..___tag_value_eval_2na_64.314
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.317-..___tag_value_eval_2na_64.316
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.319-..___tag_value_eval_2na_64.317
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000007c
-	.4byte 0x0000060c
-	.4byte ..___tag_value_eval_2na_128.323-.
-	.4byte ..___tag_value_eval_2na_128.347-..___tag_value_eval_2na_128.323
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.324-..___tag_value_eval_2na_128.323
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.328-..___tag_value_eval_2na_128.324
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.329-..___tag_value_eval_2na_128.328
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.331-..___tag_value_eval_2na_128.329
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.332-..___tag_value_eval_2na_128.331
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.334-..___tag_value_eval_2na_128.332
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.335-..___tag_value_eval_2na_128.334
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.337-..___tag_value_eval_2na_128.335
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.338-..___tag_value_eval_2na_128.337
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.340-..___tag_value_eval_2na_128.338
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.341-..___tag_value_eval_2na_128.340
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.343-..___tag_value_eval_2na_128.341
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.344-..___tag_value_eval_2na_128.343
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.346-..___tag_value_eval_2na_128.344
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000d4
-	.4byte 0x0000068c
-	.4byte ..___tag_value_eval_2na_pos.350-.
-	.4byte ..___tag_value_eval_2na_pos.392-..___tag_value_eval_2na_pos.350
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.351-..___tag_value_eval_2na_pos.350
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.355-..___tag_value_eval_2na_pos.351
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.356-..___tag_value_eval_2na_pos.355
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.358-..___tag_value_eval_2na_pos.356
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.359-..___tag_value_eval_2na_pos.358
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.361-..___tag_value_eval_2na_pos.359
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.362-..___tag_value_eval_2na_pos.361
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.364-..___tag_value_eval_2na_pos.362
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.365-..___tag_value_eval_2na_pos.364
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.367-..___tag_value_eval_2na_pos.365
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.368-..___tag_value_eval_2na_pos.367
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.370-..___tag_value_eval_2na_pos.368
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.371-..___tag_value_eval_2na_pos.370
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.373-..___tag_value_eval_2na_pos.371
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.374-..___tag_value_eval_2na_pos.373
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.376-..___tag_value_eval_2na_pos.374
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.377-..___tag_value_eval_2na_pos.376
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.379-..___tag_value_eval_2na_pos.377
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.380-..___tag_value_eval_2na_pos.379
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.382-..___tag_value_eval_2na_pos.380
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.383-..___tag_value_eval_2na_pos.382
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.385-..___tag_value_eval_2na_pos.383
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.386-..___tag_value_eval_2na_pos.385
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.388-..___tag_value_eval_2na_pos.386
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.389-..___tag_value_eval_2na_pos.388
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.391-..___tag_value_eval_2na_pos.389
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x00000024
-	.4byte 0x00000764
-	.4byte ..___tag_value_prime_buffer_4na.395-.
-	.4byte ..___tag_value_prime_buffer_4na.401-..___tag_value_prime_buffer_4na.395
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.396-..___tag_value_prime_buffer_4na.395
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.400-..___tag_value_prime_buffer_4na.396
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x0000006c
-	.4byte 0x0000078c
-	.4byte ..___tag_value_eval_4na_16.404-.
-	.4byte ..___tag_value_eval_4na_16.425-..___tag_value_eval_4na_16.404
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.405-..___tag_value_eval_4na_16.404
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.409-..___tag_value_eval_4na_16.405
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.410-..___tag_value_eval_4na_16.409
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.412-..___tag_value_eval_4na_16.410
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.413-..___tag_value_eval_4na_16.412
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.415-..___tag_value_eval_4na_16.413
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.416-..___tag_value_eval_4na_16.415
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.418-..___tag_value_eval_4na_16.416
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.419-..___tag_value_eval_4na_16.418
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.421-..___tag_value_eval_4na_16.419
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.422-..___tag_value_eval_4na_16.421
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.424-..___tag_value_eval_4na_16.422
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000006c
-	.4byte 0x000007fc
-	.4byte ..___tag_value_eval_4na_32.428-.
-	.4byte ..___tag_value_eval_4na_32.449-..___tag_value_eval_4na_32.428
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.429-..___tag_value_eval_4na_32.428
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.433-..___tag_value_eval_4na_32.429
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.434-..___tag_value_eval_4na_32.433
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.436-..___tag_value_eval_4na_32.434
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.437-..___tag_value_eval_4na_32.436
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.439-..___tag_value_eval_4na_32.437
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.440-..___tag_value_eval_4na_32.439
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.442-..___tag_value_eval_4na_32.440
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.443-..___tag_value_eval_4na_32.442
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.445-..___tag_value_eval_4na_32.443
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.446-..___tag_value_eval_4na_32.445
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.448-..___tag_value_eval_4na_32.446
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000006c
-	.4byte 0x0000086c
-	.4byte ..___tag_value_eval_4na_64.452-.
-	.4byte ..___tag_value_eval_4na_64.473-..___tag_value_eval_4na_64.452
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.453-..___tag_value_eval_4na_64.452
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.457-..___tag_value_eval_4na_64.453
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.458-..___tag_value_eval_4na_64.457
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.460-..___tag_value_eval_4na_64.458
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.461-..___tag_value_eval_4na_64.460
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.463-..___tag_value_eval_4na_64.461
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.464-..___tag_value_eval_4na_64.463
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.466-..___tag_value_eval_4na_64.464
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.467-..___tag_value_eval_4na_64.466
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.469-..___tag_value_eval_4na_64.467
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.470-..___tag_value_eval_4na_64.469
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.472-..___tag_value_eval_4na_64.470
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.4byte 0x0000007c
-	.4byte 0x000008dc
-	.4byte ..___tag_value_eval_4na_128.476-.
-	.4byte ..___tag_value_eval_4na_128.500-..___tag_value_eval_4na_128.476
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.477-..___tag_value_eval_4na_128.476
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.481-..___tag_value_eval_4na_128.477
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.482-..___tag_value_eval_4na_128.481
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.484-..___tag_value_eval_4na_128.482
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.485-..___tag_value_eval_4na_128.484
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.487-..___tag_value_eval_4na_128.485
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.488-..___tag_value_eval_4na_128.487
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.490-..___tag_value_eval_4na_128.488
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.491-..___tag_value_eval_4na_128.490
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.493-..___tag_value_eval_4na_128.491
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.494-..___tag_value_eval_4na_128.493
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.496-..___tag_value_eval_4na_128.494
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.497-..___tag_value_eval_4na_128.496
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.499-..___tag_value_eval_4na_128.497
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000d4
-	.4byte 0x0000095c
-	.4byte ..___tag_value_eval_4na_pos.503-.
-	.4byte ..___tag_value_eval_4na_pos.545-..___tag_value_eval_4na_pos.503
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.504-..___tag_value_eval_4na_pos.503
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.508-..___tag_value_eval_4na_pos.504
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.509-..___tag_value_eval_4na_pos.508
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.511-..___tag_value_eval_4na_pos.509
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.512-..___tag_value_eval_4na_pos.511
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.514-..___tag_value_eval_4na_pos.512
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.515-..___tag_value_eval_4na_pos.514
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.517-..___tag_value_eval_4na_pos.515
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.518-..___tag_value_eval_4na_pos.517
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.520-..___tag_value_eval_4na_pos.518
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.521-..___tag_value_eval_4na_pos.520
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.523-..___tag_value_eval_4na_pos.521
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.524-..___tag_value_eval_4na_pos.523
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.526-..___tag_value_eval_4na_pos.524
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.527-..___tag_value_eval_4na_pos.526
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.529-..___tag_value_eval_4na_pos.527
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.530-..___tag_value_eval_4na_pos.529
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.532-..___tag_value_eval_4na_pos.530
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.533-..___tag_value_eval_4na_pos.532
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.535-..___tag_value_eval_4na_pos.533
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.536-..___tag_value_eval_4na_pos.535
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.538-..___tag_value_eval_4na_pos.536
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.539-..___tag_value_eval_4na_pos.538
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.541-..___tag_value_eval_4na_pos.539
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.542-..___tag_value_eval_4na_pos.541
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.544-..___tag_value_eval_4na_pos.542
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x0000033c
-	.4byte 0x00000a34
-	.4byte ..___tag_value_NucStrstrSearch.548-.
-	.4byte ..___tag_value_NucStrstrSearch.711-..___tag_value_NucStrstrSearch.548
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.549-..___tag_value_NucStrstrSearch.548
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.552-..___tag_value_NucStrstrSearch.549
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.553-..___tag_value_NucStrstrSearch.552
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.555-..___tag_value_NucStrstrSearch.553
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.556-..___tag_value_NucStrstrSearch.555
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.558-..___tag_value_NucStrstrSearch.556
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.560-..___tag_value_NucStrstrSearch.558
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.561-..___tag_value_NucStrstrSearch.560
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.563-..___tag_value_NucStrstrSearch.561
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.565-..___tag_value_NucStrstrSearch.563
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.566-..___tag_value_NucStrstrSearch.565
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.568-..___tag_value_NucStrstrSearch.566
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.570-..___tag_value_NucStrstrSearch.568
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.571-..___tag_value_NucStrstrSearch.570
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.573-..___tag_value_NucStrstrSearch.571
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.575-..___tag_value_NucStrstrSearch.573
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.576-..___tag_value_NucStrstrSearch.575
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.578-..___tag_value_NucStrstrSearch.576
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.580-..___tag_value_NucStrstrSearch.578
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.581-..___tag_value_NucStrstrSearch.580
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.583-..___tag_value_NucStrstrSearch.581
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.585-..___tag_value_NucStrstrSearch.583
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.586-..___tag_value_NucStrstrSearch.585
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.588-..___tag_value_NucStrstrSearch.586
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.590-..___tag_value_NucStrstrSearch.588
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.591-..___tag_value_NucStrstrSearch.590
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.593-..___tag_value_NucStrstrSearch.591
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.595-..___tag_value_NucStrstrSearch.593
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.596-..___tag_value_NucStrstrSearch.595
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.598-..___tag_value_NucStrstrSearch.596
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.600-..___tag_value_NucStrstrSearch.598
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.601-..___tag_value_NucStrstrSearch.600
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.603-..___tag_value_NucStrstrSearch.601
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.605-..___tag_value_NucStrstrSearch.603
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.606-..___tag_value_NucStrstrSearch.605
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.608-..___tag_value_NucStrstrSearch.606
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.610-..___tag_value_NucStrstrSearch.608
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.611-..___tag_value_NucStrstrSearch.610
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.613-..___tag_value_NucStrstrSearch.611
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.615-..___tag_value_NucStrstrSearch.613
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.616-..___tag_value_NucStrstrSearch.615
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.618-..___tag_value_NucStrstrSearch.616
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.620-..___tag_value_NucStrstrSearch.618
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.621-..___tag_value_NucStrstrSearch.620
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.623-..___tag_value_NucStrstrSearch.621
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.625-..___tag_value_NucStrstrSearch.623
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.626-..___tag_value_NucStrstrSearch.625
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.628-..___tag_value_NucStrstrSearch.626
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.630-..___tag_value_NucStrstrSearch.628
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.631-..___tag_value_NucStrstrSearch.630
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.633-..___tag_value_NucStrstrSearch.631
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.635-..___tag_value_NucStrstrSearch.633
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.636-..___tag_value_NucStrstrSearch.635
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.638-..___tag_value_NucStrstrSearch.636
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.640-..___tag_value_NucStrstrSearch.638
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.641-..___tag_value_NucStrstrSearch.640
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.643-..___tag_value_NucStrstrSearch.641
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.645-..___tag_value_NucStrstrSearch.643
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.646-..___tag_value_NucStrstrSearch.645
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.648-..___tag_value_NucStrstrSearch.646
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.650-..___tag_value_NucStrstrSearch.648
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.651-..___tag_value_NucStrstrSearch.650
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.653-..___tag_value_NucStrstrSearch.651
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.655-..___tag_value_NucStrstrSearch.653
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.656-..___tag_value_NucStrstrSearch.655
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.658-..___tag_value_NucStrstrSearch.656
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.660-..___tag_value_NucStrstrSearch.658
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.661-..___tag_value_NucStrstrSearch.660
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.663-..___tag_value_NucStrstrSearch.661
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.665-..___tag_value_NucStrstrSearch.663
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.666-..___tag_value_NucStrstrSearch.665
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.668-..___tag_value_NucStrstrSearch.666
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.670-..___tag_value_NucStrstrSearch.668
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.671-..___tag_value_NucStrstrSearch.670
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.673-..___tag_value_NucStrstrSearch.671
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.675-..___tag_value_NucStrstrSearch.673
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.676-..___tag_value_NucStrstrSearch.675
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.678-..___tag_value_NucStrstrSearch.676
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.680-..___tag_value_NucStrstrSearch.678
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.681-..___tag_value_NucStrstrSearch.680
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.683-..___tag_value_NucStrstrSearch.681
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.685-..___tag_value_NucStrstrSearch.683
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.686-..___tag_value_NucStrstrSearch.685
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.688-..___tag_value_NucStrstrSearch.686
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.690-..___tag_value_NucStrstrSearch.688
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.691-..___tag_value_NucStrstrSearch.690
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.693-..___tag_value_NucStrstrSearch.691
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.695-..___tag_value_NucStrstrSearch.693
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.696-..___tag_value_NucStrstrSearch.695
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.698-..___tag_value_NucStrstrSearch.696
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.700-..___tag_value_NucStrstrSearch.698
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.701-..___tag_value_NucStrstrSearch.700
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.703-..___tag_value_NucStrstrSearch.701
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.705-..___tag_value_NucStrstrSearch.703
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.706-..___tag_value_NucStrstrSearch.705
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.708-..___tag_value_NucStrstrSearch.706
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.710-..___tag_value_NucStrstrSearch.708
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.section .text
-.LNDBG_TXe:
-# End
diff --git a/libs/search/nucstrstr-icc-x86_64-prof.pic.s b/libs/search/nucstrstr-icc-x86_64-prof.pic.s
deleted file mode 100644
index c540857..0000000
--- a/libs/search/nucstrstr-icc-x86_64-prof.pic.s
+++ /dev/null
@@ -1,13651 +0,0 @@
-	.section .text
-.LNDBG_TX:
-# -- Machine type EFI2
-# mark_description "Intel(R) C++ Compiler Professional for applications running on Intel(R) 64, Version 11.0    Build 20090131 %";
-# mark_description "s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -";
-# mark_description "I/home/yaschenk/devel/internal/asm-trace/inc/gcc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I";
-# mark_description "/home/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home";
-# mark_description "/yaschenk/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -O3 -unroll -xW -vec_report5 -DNDEBUG ";
-# mark_description "-D_PROFILING -p -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.file "nucstrstr.c"
-	.text
-..TXTST0:
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-# parameter 5(selflen): %r8
-..B1.1:                         # Preds ..B1.0
-..___tag_value_NucStrstrSearch.1:                               #5217.1
-..LN1:
-  .file   1 "nucstrstr.c"
-   .loc    1  5217
-        pushq     %rbp                                          #5217.1
-        movq      %rsp, %rbp                                    #5217.1
-..___tag_value_NucStrstrSearch.2:                               #
-        subq      $48, %rsp                                     #5217.1
-        movq      %r15, -32(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.4:                               #
-        movq      %r14, -24(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.5:                               #
-        movq      %r13, -16(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.6:                               #
-        movq      %r12, -48(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.7:                               #
-        movq      %rbx, -40(%rbp)                               #5217.1
-..___tag_value_NucStrstrSearch.8:                               #
-        movq      %r8, %r15                                     #5217.1
-        movl      %ecx, %r14d                                   #5217.1
-        movl      %edx, %r13d                                   #5217.1
-        movq      %rsi, %r12                                    #5217.1
-        movq      %rdi, %rbx                                    #5217.1
-        lea       _gprof_pack0(%rip), %rdx                      #5217.1
-        call      mcount at PLT                                    #5217.1
-                                # LOE rbx r12 r15 r13d r14d
-..B1.117:                       # Preds ..B1.1
-..LN3:
-   .loc    1  5218
-        testq     %rbx, %rbx                                    #5218.18
-        je        ..B1.107      # Prob 6%                       #5218.18
-                                # LOE rbx r12 r15 r13d r14d
-..B1.2:                         # Preds ..B1.117
-..LN5:
-        testq     %r12, %r12                                    #5218.37
-        je        ..B1.107      # Prob 6%                       #5218.37
-                                # LOE rbx r12 r15 r13d r14d
-..B1.4:                         # Preds ..B1.2 ..B1.14 ..B1.17
-..LN7:
-        testl     %r14d, %r14d                                  #5218.52
-        je        ..B1.107      # Prob 28%                      #5218.52
-                                # LOE rbx r12 r15 r13d r14d
-..B1.7:                         # Preds ..B1.4 ..B1.31
-..LN9:
-   .loc    1  5223
-        movl      (%rbx), %eax                                  #5223.18
-..LN11:
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B1.107      # Prob 28%                      #5223.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.8:                         # Preds ..B1.7
-        movl      %eax, %eax                                    #5223.9
-        lea       ..1..TPKT.30_0.0.1(%rip), %rdx                #5223.9
-        movq      (%rdx,%rax,8), %rcx                           #5223.9
-        jmp       *%rcx                                         #5223.9
-                                # LOE rbx r12 r15 r13d r14d
-..1.30_0.TAG.0c.0.1:
-..B1.10:                        # Preds ..B1.8
-..LN13:
-   .loc    1  5286
-        movl      4(%rbx), %eax                                 #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B1.20       # Prob 20%                      #5286.22
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.11:                        # Preds ..B1.10
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B1.20       # Prob 25%                      #5286.22
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.12:                        # Preds ..B1.11
-        cmpl      $14, %eax                                     #5286.22
-        jne       ..B1.15       # Prob 67%                      #5286.22
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.13:                        # Preds ..B1.12
-..LN15:
-   .loc    1  5297
-        movq      8(%rbx), %rbx                                 #5297.29
-        movl      4(%rbx), %eax                                 #5297.29
-..LN17:
-   .loc    1  5298
-        cmpl      %r14d, %eax                                   #5298.34
-        ja        ..B1.107      # Prob 12%                      #5298.34
-                                # LOE rbx r12 r15 eax r13d
-..B1.14:                        # Preds ..B1.13
-..LN19:
-   .loc    1  5297
-        movl      %eax, %r14d                                   #5297.17
-..LN21:
-   .loc    1  5218
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.4        # Prob 94%                      #5218.18
-        jmp       ..B1.107      # Prob 100%                     #5218.18
-                                # LOE rbx r12 r15 r13d r14d
-..B1.15:                        # Preds ..B1.12
-..LN23:
-   .loc    1  5286
-        cmpl      $15, %eax                                     #5286.22
-        jne       ..B1.107      # Prob 50%                      #5286.22
-                                # LOE rbx r12 r15 r13d r14d
-..B1.16:                        # Preds ..B1.15
-..LN25:
-   .loc    1  5302
-        movq      8(%rbx), %rbx                                 #5302.29
-        movl      4(%rbx), %eax                                 #5302.29
-..LN27:
-   .loc    1  5303
-        cmpl      %r14d, %eax                                   #5303.34
-        ja        ..B1.107      # Prob 12%                      #5303.34
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.17:                        # Preds ..B1.16
-..LN29:
-   .loc    1  5306
-        addl      %r14d, %r13d                                  #5306.27
-..LN31:
-        subl      %eax, %r13d                                   #5306.33
-..LN33:
-   .loc    1  5302
-        movl      %eax, %r14d                                   #5302.17
-..LN35:
-   .loc    1  5218
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.4        # Prob 94%                      #5218.18
-        jmp       ..B1.107      # Prob 100%                     #5218.18
-                                # LOE rbx r12 r15 r13d r14d
-..B1.20:                        # Preds ..B1.10 ..B1.11
-..LN37:
-   .loc    1  5290
-        movq      8(%rbx), %rdi                                 #5290.25
-        movq      %r12, %rsi                                    #5290.25
-        movl      %r13d, %edx                                   #5290.25
-        movl      %r14d, %ecx                                   #5290.25
-        movq      %r15, %r8                                     #5290.25
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE rbx eax
-..B1.21:                        # Preds ..B1.20
-..LN39:
-   .loc    1  5291
-        movl      4(%rbx), %edx                                 #5291.22
-..LN41:
-        testl     %edx, %edx                                    #5291.42
-        je        ..B1.56       # Prob 28%                      #5291.42
-                                # LOE eax
-..B1.22:                        # Preds ..B1.21
-..LN43:
-   .loc    1  5293
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B1.107      # Prob 50%                      #5293.31
-                                # LOE
-..B1.23:                        # Preds ..B1.22
-..LN45:
-   .loc    1  5294
-        movq      -40(%rbp), %rbx                               #5294.28
-..___tag_value_NucStrstrSearch.9:                               #
-        movq      -48(%rbp), %r12                               #5294.28
-..___tag_value_NucStrstrSearch.10:                              #
-        movq      -16(%rbp), %r13                               #5294.28
-..___tag_value_NucStrstrSearch.11:                              #
-        movq      -24(%rbp), %r14                               #5294.28
-..___tag_value_NucStrstrSearch.12:                              #
-        movl      $1, %eax                                      #5294.28
-        movq      -32(%rbp), %r15                               #5294.28
-..___tag_value_NucStrstrSearch.13:                              #
-        movq      %rbp, %rsp                                    #5294.28
-        popq      %rbp                                          #5294.28
-..___tag_value_NucStrstrSearch.14:                              #
-        ret                                                     #5294.28
-..___tag_value_NucStrstrSearch.15:                              #
-                                # LOE
-..1.30_0.TAG.0b.0.1:
-..B1.26:                        # Preds ..B1.8
-..LN47:
-   .loc    1  5272
-        movq      8(%rbx), %rdi                                 #5272.21
-        movq      %r12, %rsi                                    #5272.21
-        movl      %r13d, %edx                                   #5272.21
-        movl      %r14d, %ecx                                   #5272.21
-        movq      %r15, %r8                                     #5272.21
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.27:                        # Preds ..B1.26
-..LN49:
-   .loc    1  5273
-        movl      4(%rbx), %edx                                 #5273.22
-        cmpl      $17, %edx                                     #5273.22
-        jne       ..B1.29       # Prob 67%                      #5273.22
-                                # LOE rbx r12 r15 eax edx r13d r14d
-..B1.28:                        # Preds ..B1.27
-..LN51:
-   .loc    1  5276
-        testl     %eax, %eax                                    #5276.31
-        jne       ..B1.56       # Prob 12%                      #5276.31
-        jmp       ..B1.31       # Prob 100%                     #5276.31
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.29:                        # Preds ..B1.27
-..LN53:
-   .loc    1  5273
-        cmpl      $16, %edx                                     #5273.22
-        jne       ..B1.31       # Prob 50%                      #5273.22
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.30:                        # Preds ..B1.29
-..LN55:
-   .loc    1  5280
-        testl     %eax, %eax                                    #5280.31
-        je        ..B1.56       # Prob 12%                      #5280.31
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.31:                        # Preds ..B1.28 ..B1.30 ..B1.29
-..LN57:
-   .loc    1  5284
-        movq      16(%rbx), %rbx                                #5284.38
-..LN59:
-   .loc    1  5218
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.7        # Prob 94%                      #5218.18
-        jmp       ..B1.107      # Prob 100%                     #5218.18
-                                # LOE rbx r12 r15 r13d r14d
-..1.30_0.TAG.0a.0.1:
-..B1.34:                        # Preds ..B1.8
-..LN61:
-   .loc    1  5268
-        movl      4(%rbx), %eax                                 #5268.24
-        cmpl      %eax, %r14d                                   #5268.24
-        jb        ..B1.107      # Prob 28%                      #5268.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.35:                        # Preds ..B1.34
-..LN63:
-   .loc    1  5269
-        testq     %r15, %r15                                    #5269.9
-        je        ..B1.37       # Prob 12%                      #5269.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.36:                        # Preds ..B1.35
-..LN65:
-        movl      %eax, (%r15)                                  #5269.18
-                                # LOE rbx r12 r13d r14d
-..B1.37:                        # Preds ..B1.35 ..B1.36
-..LN67:
-   .loc    1  5270
-        movq      %rbx, %rdi                                    #5270.20
-        movq      %r12, %rsi                                    #5270.20
-        movl      %r13d, %edx                                   #5270.20
-        movl      %r14d, %ecx                                   #5270.20
-        call      eval_4na_pos at PLT                              #5270.20
-                                # LOE eax
-..B1.120:                       # Preds ..B1.37
-        movq      -40(%rbp), %rbx                               #5270.20
-..___tag_value_NucStrstrSearch.21:                              #
-        movq      -48(%rbp), %r12                               #5270.20
-..___tag_value_NucStrstrSearch.22:                              #
-        movq      -16(%rbp), %r13                               #5270.20
-..___tag_value_NucStrstrSearch.23:                              #
-        movq      -24(%rbp), %r14                               #5270.20
-..___tag_value_NucStrstrSearch.24:                              #
-        movq      -32(%rbp), %r15                               #5270.20
-..___tag_value_NucStrstrSearch.25:                              #
-        movq      %rbp, %rsp                                    #5270.20
-        popq      %rbp                                          #5270.20
-..___tag_value_NucStrstrSearch.26:                              #
-        ret                                                     #5270.20
-..___tag_value_NucStrstrSearch.27:                              #
-                                # LOE
-..1.30_0.TAG.09.0.1:
-..B1.40:                        # Preds ..B1.8
-..LN69:
-   .loc    1  5264
-        movl      4(%rbx), %eax                                 #5264.24
-        cmpl      %eax, %r14d                                   #5264.24
-        jb        ..B1.107      # Prob 28%                      #5264.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.41:                        # Preds ..B1.40
-..LN71:
-   .loc    1  5265
-        testq     %r15, %r15                                    #5265.9
-        je        ..B1.43       # Prob 12%                      #5265.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.42:                        # Preds ..B1.41
-..LN73:
-        movl      %eax, (%r15)                                  #5265.18
-                                # LOE rbx r12 r13d r14d
-..B1.43:                        # Preds ..B1.41 ..B1.42
-..LN75:
-   .loc    1  5266
-        movq      %rbx, %rdi                                    #5266.20
-        movq      %r12, %rsi                                    #5266.20
-        movl      %r13d, %edx                                   #5266.20
-        movl      %r14d, %ecx                                   #5266.20
-        call      eval_2na_pos at PLT                              #5266.20
-                                # LOE eax
-..B1.121:                       # Preds ..B1.43
-        movq      -40(%rbp), %rbx                               #5266.20
-..___tag_value_NucStrstrSearch.33:                              #
-        movq      -48(%rbp), %r12                               #5266.20
-..___tag_value_NucStrstrSearch.34:                              #
-        movq      -16(%rbp), %r13                               #5266.20
-..___tag_value_NucStrstrSearch.35:                              #
-        movq      -24(%rbp), %r14                               #5266.20
-..___tag_value_NucStrstrSearch.36:                              #
-        movq      -32(%rbp), %r15                               #5266.20
-..___tag_value_NucStrstrSearch.37:                              #
-        movq      %rbp, %rsp                                    #5266.20
-        popq      %rbp                                          #5266.20
-..___tag_value_NucStrstrSearch.38:                              #
-        ret                                                     #5266.20
-..___tag_value_NucStrstrSearch.39:                              #
-                                # LOE
-..1.30_0.TAG.08.0.1:
-..B1.46:                        # Preds ..B1.8
-..LN77:
-   .loc    1  5259
-        movl      4(%rbx), %eax                                 #5259.24
-        cmpl      %eax, %r14d                                   #5259.24
-        jb        ..B1.107      # Prob 28%                      #5259.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.47:                        # Preds ..B1.46
-..LN79:
-   .loc    1  5260
-        testq     %r15, %r15                                    #5260.9
-        je        ..B1.49       # Prob 12%                      #5260.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.48:                        # Preds ..B1.47
-..LN81:
-        movl      %eax, (%r15)                                  #5260.18
-                                # LOE rbx r12 r13d r14d
-..B1.49:                        # Preds ..B1.47 ..B1.48
-..LN83:
-   .loc    1  5261
-        movq      %rbx, %rdi                                    #5261.20
-        movq      %r12, %rsi                                    #5261.20
-        movl      %r13d, %edx                                   #5261.20
-        movl      %r14d, %ecx                                   #5261.20
-        call      eval_4na_128 at PLT                              #5261.20
-                                # LOE eax
-..B1.122:                       # Preds ..B1.49
-        movq      -40(%rbp), %rbx                               #5261.20
-..___tag_value_NucStrstrSearch.45:                              #
-        movq      -48(%rbp), %r12                               #5261.20
-..___tag_value_NucStrstrSearch.46:                              #
-        movq      -16(%rbp), %r13                               #5261.20
-..___tag_value_NucStrstrSearch.47:                              #
-        movq      -24(%rbp), %r14                               #5261.20
-..___tag_value_NucStrstrSearch.48:                              #
-        movq      -32(%rbp), %r15                               #5261.20
-..___tag_value_NucStrstrSearch.49:                              #
-        movq      %rbp, %rsp                                    #5261.20
-        popq      %rbp                                          #5261.20
-..___tag_value_NucStrstrSearch.50:                              #
-        ret                                                     #5261.20
-..___tag_value_NucStrstrSearch.51:                              #
-                                # LOE
-..1.30_0.TAG.07.0.1:
-..B1.52:                        # Preds ..B1.8
-..LN85:
-   .loc    1  5255
-        movl      4(%rbx), %eax                                 #5255.24
-        cmpl      %eax, %r14d                                   #5255.24
-        jb        ..B1.107      # Prob 28%                      #5255.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.53:                        # Preds ..B1.52
-..LN87:
-   .loc    1  5256
-        testq     %r15, %r15                                    #5256.9
-        je        ..B1.55       # Prob 12%                      #5256.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.54:                        # Preds ..B1.53
-..LN89:
-        movl      %eax, (%r15)                                  #5256.18
-                                # LOE rbx r12 r13d r14d
-..B1.55:                        # Preds ..B1.53 ..B1.54
-..LN91:
-   .loc    1  5257
-        movq      %rbx, %rdi                                    #5257.20
-        movq      %r12, %rsi                                    #5257.20
-        movl      %r13d, %edx                                   #5257.20
-        movl      %r14d, %ecx                                   #5257.20
-        call      eval_4na_32 at PLT                               #5257.20
-                                # LOE eax
-..B1.56:                        # Preds ..B1.28 ..B1.30 ..B1.21 ..B1.55
-        movq      -40(%rbp), %rbx                               #5257.20
-..___tag_value_NucStrstrSearch.57:                              #
-        movq      -48(%rbp), %r12                               #5257.20
-..___tag_value_NucStrstrSearch.58:                              #
-        movq      -16(%rbp), %r13                               #5257.20
-..___tag_value_NucStrstrSearch.59:                              #
-        movq      -24(%rbp), %r14                               #5257.20
-..___tag_value_NucStrstrSearch.60:                              #
-        movq      -32(%rbp), %r15                               #5257.20
-..___tag_value_NucStrstrSearch.61:                              #
-        movq      %rbp, %rsp                                    #5257.20
-        popq      %rbp                                          #5257.20
-..___tag_value_NucStrstrSearch.62:                              #
-        ret                                                     #5257.20
-..___tag_value_NucStrstrSearch.63:                              #
-                                # LOE
-..1.30_0.TAG.06.0.1:
-..B1.59:                        # Preds ..B1.8
-..LN93:
-   .loc    1  5251
-        movl      4(%rbx), %eax                                 #5251.24
-        cmpl      %eax, %r14d                                   #5251.24
-        jb        ..B1.107      # Prob 28%                      #5251.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.60:                        # Preds ..B1.59
-..LN95:
-   .loc    1  5252
-        testq     %r15, %r15                                    #5252.9
-        je        ..B1.62       # Prob 12%                      #5252.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.61:                        # Preds ..B1.60
-..LN97:
-        movl      %eax, (%r15)                                  #5252.18
-                                # LOE rbx r12 r13d r14d
-..B1.62:                        # Preds ..B1.60 ..B1.61
-..LN99:
-   .loc    1  5253
-        movq      %rbx, %rdi                                    #5253.20
-        movq      %r12, %rsi                                    #5253.20
-        movl      %r13d, %edx                                   #5253.20
-        movl      %r14d, %ecx                                   #5253.20
-        call      eval_4na_16 at PLT                               #5253.20
-                                # LOE eax
-..B1.63:                        # Preds ..B1.62
-        movq      -40(%rbp), %rbx                               #5253.20
-..___tag_value_NucStrstrSearch.69:                              #
-        movq      -48(%rbp), %r12                               #5253.20
-..___tag_value_NucStrstrSearch.70:                              #
-        movq      -16(%rbp), %r13                               #5253.20
-..___tag_value_NucStrstrSearch.71:                              #
-        movq      -24(%rbp), %r14                               #5253.20
-..___tag_value_NucStrstrSearch.72:                              #
-        movq      -32(%rbp), %r15                               #5253.20
-..___tag_value_NucStrstrSearch.73:                              #
-        movq      %rbp, %rsp                                    #5253.20
-        popq      %rbp                                          #5253.20
-..___tag_value_NucStrstrSearch.74:                              #
-        ret                                                     #5253.20
-..___tag_value_NucStrstrSearch.75:                              #
-                                # LOE
-..1.30_0.TAG.05.0.1:
-..B1.66:                        # Preds ..B1.8
-..LN101:
-   .loc    1  5247
-        movl      4(%rbx), %eax                                 #5247.24
-        cmpl      %eax, %r14d                                   #5247.24
-        jb        ..B1.107      # Prob 28%                      #5247.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.67:                        # Preds ..B1.66
-..LN103:
-   .loc    1  5248
-        testq     %r15, %r15                                    #5248.9
-        je        ..B1.69       # Prob 12%                      #5248.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.68:                        # Preds ..B1.67
-..LN105:
-        movl      %eax, (%r15)                                  #5248.18
-                                # LOE rbx r12 r13d r14d
-..B1.69:                        # Preds ..B1.67 ..B1.68
-..LN107:
-   .loc    1  5249
-        movq      %rbx, %rdi                                    #5249.20
-        movq      %r12, %rsi                                    #5249.20
-        movl      %r13d, %edx                                   #5249.20
-        movl      %r14d, %ecx                                   #5249.20
-        call      eval_2na_128 at PLT                              #5249.20
-                                # LOE eax
-..B1.125:                       # Preds ..B1.69
-        movq      -40(%rbp), %rbx                               #5249.20
-..___tag_value_NucStrstrSearch.81:                              #
-        movq      -48(%rbp), %r12                               #5249.20
-..___tag_value_NucStrstrSearch.82:                              #
-        movq      -16(%rbp), %r13                               #5249.20
-..___tag_value_NucStrstrSearch.83:                              #
-        movq      -24(%rbp), %r14                               #5249.20
-..___tag_value_NucStrstrSearch.84:                              #
-        movq      -32(%rbp), %r15                               #5249.20
-..___tag_value_NucStrstrSearch.85:                              #
-        movq      %rbp, %rsp                                    #5249.20
-        popq      %rbp                                          #5249.20
-..___tag_value_NucStrstrSearch.86:                              #
-        ret                                                     #5249.20
-..___tag_value_NucStrstrSearch.87:                              #
-                                # LOE
-..1.30_0.TAG.04.0.1:
-..B1.72:                        # Preds ..B1.8
-..LN109:
-   .loc    1  5243
-        movl      4(%rbx), %eax                                 #5243.24
-        cmpl      %eax, %r14d                                   #5243.24
-        jb        ..B1.107      # Prob 28%                      #5243.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.73:                        # Preds ..B1.72
-..LN111:
-   .loc    1  5244
-        testq     %r15, %r15                                    #5244.9
-        je        ..B1.75       # Prob 12%                      #5244.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.74:                        # Preds ..B1.73
-..LN113:
-        movl      %eax, (%r15)                                  #5244.18
-                                # LOE rbx r12 r13d r14d
-..B1.75:                        # Preds ..B1.73 ..B1.74
-..LN115:
-   .loc    1  5245
-        movq      %rbx, %rdi                                    #5245.20
-        movq      %r12, %rsi                                    #5245.20
-        movl      %r13d, %edx                                   #5245.20
-        movl      %r14d, %ecx                                   #5245.20
-        call      eval_2na_32 at PLT                               #5245.20
-                                # LOE eax
-..B1.76:                        # Preds ..B1.75
-        movq      -40(%rbp), %rbx                               #5245.20
-..___tag_value_NucStrstrSearch.93:                              #
-        movq      -48(%rbp), %r12                               #5245.20
-..___tag_value_NucStrstrSearch.94:                              #
-        movq      -16(%rbp), %r13                               #5245.20
-..___tag_value_NucStrstrSearch.95:                              #
-        movq      -24(%rbp), %r14                               #5245.20
-..___tag_value_NucStrstrSearch.96:                              #
-        movq      -32(%rbp), %r15                               #5245.20
-..___tag_value_NucStrstrSearch.97:                              #
-        movq      %rbp, %rsp                                    #5245.20
-        popq      %rbp                                          #5245.20
-..___tag_value_NucStrstrSearch.98:                              #
-        ret                                                     #5245.20
-..___tag_value_NucStrstrSearch.99:                              #
-                                # LOE
-..1.30_0.TAG.03.0.1:
-..B1.79:                        # Preds ..B1.8
-..LN117:
-   .loc    1  5239
-        movl      4(%rbx), %eax                                 #5239.24
-        cmpl      %eax, %r14d                                   #5239.24
-        jb        ..B1.107      # Prob 28%                      #5239.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.80:                        # Preds ..B1.79
-..LN119:
-   .loc    1  5240
-        testq     %r15, %r15                                    #5240.9
-        je        ..B1.82       # Prob 12%                      #5240.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.81:                        # Preds ..B1.80
-..LN121:
-        movl      %eax, (%r15)                                  #5240.18
-                                # LOE rbx r12 r13d r14d
-..B1.82:                        # Preds ..B1.80 ..B1.81
-..LN123:
-   .loc    1  5241
-        movq      %rbx, %rdi                                    #5241.20
-        movq      %r12, %rsi                                    #5241.20
-        movl      %r13d, %edx                                   #5241.20
-        movl      %r14d, %ecx                                   #5241.20
-        call      eval_2na_16 at PLT                               #5241.20
-                                # LOE eax
-..B1.83:                        # Preds ..B1.82
-        movq      -40(%rbp), %rbx                               #5241.20
-..___tag_value_NucStrstrSearch.105:                             #
-        movq      -48(%rbp), %r12                               #5241.20
-..___tag_value_NucStrstrSearch.106:                             #
-        movq      -16(%rbp), %r13                               #5241.20
-..___tag_value_NucStrstrSearch.107:                             #
-        movq      -24(%rbp), %r14                               #5241.20
-..___tag_value_NucStrstrSearch.108:                             #
-        movq      -32(%rbp), %r15                               #5241.20
-..___tag_value_NucStrstrSearch.109:                             #
-        movq      %rbp, %rsp                                    #5241.20
-        popq      %rbp                                          #5241.20
-..___tag_value_NucStrstrSearch.110:                             #
-        ret                                                     #5241.20
-..___tag_value_NucStrstrSearch.111:                             #
-                                # LOE
-..1.30_0.TAG.02.0.1:
-..B1.86:                        # Preds ..B1.8
-..LN125:
-   .loc    1  5235
-        movl      4(%rbx), %eax                                 #5235.24
-        cmpl      %eax, %r14d                                   #5235.24
-        jb        ..B1.107      # Prob 28%                      #5235.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.87:                        # Preds ..B1.86
-..LN127:
-   .loc    1  5236
-        testq     %r15, %r15                                    #5236.9
-        je        ..B1.89       # Prob 12%                      #5236.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.88:                        # Preds ..B1.87
-..LN129:
-        movl      %eax, (%r15)                                  #5236.18
-                                # LOE rbx r12 r13d r14d
-..B1.89:                        # Preds ..B1.87 ..B1.88
-..LN131:
-   .loc    1  5237
-        movq      %rbx, %rdi                                    #5237.20
-        movq      %r12, %rsi                                    #5237.20
-        movl      %r13d, %edx                                   #5237.20
-        movl      %r14d, %ecx                                   #5237.20
-        call      eval_2na_8 at PLT                                #5237.20
-                                # LOE eax
-..B1.90:                        # Preds ..B1.89
-        movq      -40(%rbp), %rbx                               #5237.20
-..___tag_value_NucStrstrSearch.117:                             #
-        movq      -48(%rbp), %r12                               #5237.20
-..___tag_value_NucStrstrSearch.118:                             #
-        movq      -16(%rbp), %r13                               #5237.20
-..___tag_value_NucStrstrSearch.119:                             #
-        movq      -24(%rbp), %r14                               #5237.20
-..___tag_value_NucStrstrSearch.120:                             #
-        movq      -32(%rbp), %r15                               #5237.20
-..___tag_value_NucStrstrSearch.121:                             #
-        movq      %rbp, %rsp                                    #5237.20
-        popq      %rbp                                          #5237.20
-..___tag_value_NucStrstrSearch.122:                             #
-        ret                                                     #5237.20
-..___tag_value_NucStrstrSearch.123:                             #
-                                # LOE
-..1.30_0.TAG.01.0.1:
-..B1.93:                        # Preds ..B1.8
-..LN133:
-   .loc    1  5230
-        movl      4(%rbx), %eax                                 #5230.24
-        cmpl      %eax, %r14d                                   #5230.24
-        jb        ..B1.107      # Prob 28%                      #5230.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.94:                        # Preds ..B1.93
-..LN135:
-   .loc    1  5231
-        testq     %r15, %r15                                    #5231.9
-        je        ..B1.96       # Prob 12%                      #5231.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.95:                        # Preds ..B1.94
-..LN137:
-        movl      %eax, (%r15)                                  #5231.18
-                                # LOE rbx r12 r13d r14d
-..B1.96:                        # Preds ..B1.94 ..B1.95
-..LN139:
-   .loc    1  5232
-        movq      %rbx, %rdi                                    #5232.20
-        movq      %r12, %rsi                                    #5232.20
-        movl      %r13d, %edx                                   #5232.20
-        movl      %r14d, %ecx                                   #5232.20
-        call      eval_4na_64 at PLT                               #5232.20
-                                # LOE eax
-..B1.97:                        # Preds ..B1.96
-        movq      -40(%rbp), %rbx                               #5232.20
-..___tag_value_NucStrstrSearch.129:                             #
-        movq      -48(%rbp), %r12                               #5232.20
-..___tag_value_NucStrstrSearch.130:                             #
-        movq      -16(%rbp), %r13                               #5232.20
-..___tag_value_NucStrstrSearch.131:                             #
-        movq      -24(%rbp), %r14                               #5232.20
-..___tag_value_NucStrstrSearch.132:                             #
-        movq      -32(%rbp), %r15                               #5232.20
-..___tag_value_NucStrstrSearch.133:                             #
-        movq      %rbp, %rsp                                    #5232.20
-        popq      %rbp                                          #5232.20
-..___tag_value_NucStrstrSearch.134:                             #
-        ret                                                     #5232.20
-..___tag_value_NucStrstrSearch.135:                             #
-                                # LOE
-..1.30_0.TAG.00.0.1:
-..B1.100:                       # Preds ..B1.8
-..LN141:
-   .loc    1  5226
-        movl      4(%rbx), %eax                                 #5226.24
-        cmpl      %eax, %r14d                                   #5226.24
-        jb        ..B1.107      # Prob 28%                      #5226.24
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.101:                       # Preds ..B1.100
-..LN143:
-   .loc    1  5227
-        testq     %r15, %r15                                    #5227.9
-        je        ..B1.103      # Prob 12%                      #5227.9
-                                # LOE rbx r12 r15 eax r13d r14d
-..B1.102:                       # Preds ..B1.101
-..LN145:
-        movl      %eax, (%r15)                                  #5227.18
-                                # LOE rbx r12 r13d r14d
-..B1.103:                       # Preds ..B1.101 ..B1.102
-..LN147:
-   .loc    1  5228
-        movq      %rbx, %rdi                                    #5228.20
-        movq      %r12, %rsi                                    #5228.20
-        movl      %r13d, %edx                                   #5228.20
-        movl      %r14d, %ecx                                   #5228.20
-        call      eval_2na_64 at PLT                               #5228.20
-                                # LOE eax
-..B1.104:                       # Preds ..B1.103
-        movq      -40(%rbp), %rbx                               #5228.20
-..___tag_value_NucStrstrSearch.141:                             #
-        movq      -48(%rbp), %r12                               #5228.20
-..___tag_value_NucStrstrSearch.142:                             #
-        movq      -16(%rbp), %r13                               #5228.20
-..___tag_value_NucStrstrSearch.143:                             #
-        movq      -24(%rbp), %r14                               #5228.20
-..___tag_value_NucStrstrSearch.144:                             #
-        movq      -32(%rbp), %r15                               #5228.20
-..___tag_value_NucStrstrSearch.145:                             #
-        movq      %rbp, %rsp                                    #5228.20
-        popq      %rbp                                          #5228.20
-..___tag_value_NucStrstrSearch.146:                             #
-        ret                                                     #5228.20
-..___tag_value_NucStrstrSearch.147:                             #
-                                # LOE
-..B1.107:                       # Preds ..B1.13 ..B1.16 ..B1.17 ..B1.14 ..B1.7
-                                #       ..B1.31 ..B1.15 ..B1.4 ..B1.100 ..B1.93
-                                #       ..B1.86 ..B1.79 ..B1.72 ..B1.66 ..B1.59
-                                #       ..B1.52 ..B1.46 ..B1.40 ..B1.34 ..B1.22
-                                #       ..B1.2 ..B1.117
-..LN149:
-   .loc    1  5311
-        movq      -40(%rbp), %rbx                               #5311.12
-..___tag_value_NucStrstrSearch.153:                             #
-        movq      -48(%rbp), %r12                               #5311.12
-..___tag_value_NucStrstrSearch.154:                             #
-        movq      -16(%rbp), %r13                               #5311.12
-..___tag_value_NucStrstrSearch.155:                             #
-        movq      -24(%rbp), %r14                               #5311.12
-..___tag_value_NucStrstrSearch.156:                             #
-        xorl      %eax, %eax                                    #5311.12
-        movq      -32(%rbp), %r15                               #5311.12
-..___tag_value_NucStrstrSearch.157:                             #
-        movq      %rbp, %rsp                                    #5311.12
-        popq      %rbp                                          #5311.12
-..___tag_value_NucStrstrSearch.158:                             #
-        ret                                                     #5311.12
-        .align    16,0x90
-..___tag_value_NucStrstrSearch.159:                             #
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-.LNNucStrstrSearch:
-	.section .data1, "wa"
-	.align 32
-	.align 32
-..1..TPKT.30_0.0.1:
-	.quad	..1.30_0.TAG.00.0.1
-	.quad	..1.30_0.TAG.01.0.1
-	.quad	..1.30_0.TAG.02.0.1
-	.quad	..1.30_0.TAG.03.0.1
-	.quad	..1.30_0.TAG.04.0.1
-	.quad	..1.30_0.TAG.05.0.1
-	.quad	..1.30_0.TAG.06.0.1
-	.quad	..1.30_0.TAG.07.0.1
-	.quad	..1.30_0.TAG.08.0.1
-	.quad	..1.30_0.TAG.09.0.1
-	.quad	..1.30_0.TAG.0a.0.1
-	.quad	..1.30_0.TAG.0b.0.1
-	.quad	..1.30_0.TAG.0c.0.1
-	.data
-# -- End  NucStrstrSearch
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    16,0x90
-eval_4na_pos:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B2.1:                         # Preds ..B2.0
-..___tag_value_eval_4na_pos.160:                                #4946.1
-..LN151:
-   .loc    1  4946
-        pushq     %rbp                                          #4946.1
-        movq      %rsp, %rbp                                    #4946.1
-..___tag_value_eval_4na_pos.161:                                #
-        subq      $176, %rsp                                    #4946.1
-        movq      %r15, -48(%rbp)                               #4946.1
-..___tag_value_eval_4na_pos.163:                                #
-        movq      %r14, -40(%rbp)                               #4946.1
-..___tag_value_eval_4na_pos.164:                                #
-        movq      %r13, -32(%rbp)                               #4946.1
-..___tag_value_eval_4na_pos.165:                                #
-        movq      %r12, -24(%rbp)                               #4946.1
-..___tag_value_eval_4na_pos.166:                                #
-        movq      %rbx, -16(%rbp)                               #4946.1
-..___tag_value_eval_4na_pos.167:                                #
-        movl      %edx, %r14d                                   #4946.1
-        movq      %rsi, %r15                                    #4946.1
-        movq      %rdi, %rbx                                    #4946.1
-        lea       _gprof_pack1(%rip), %rdx                      #4946.1
-        movl      %ecx, -168(%rbp)                              #4946.1
-        call      mcount at PLT                                    #4946.1
-                                # LOE rbx r15 r14d
-..B2.50:                        # Preds ..B2.1
-        movl      -168(%rbp), %ecx                              #
-        movl      %r14d, -8(%rbp)                               #4946.1
-..LN153:
-   .loc    1  4985
-        lea       (%r14,%rcx), %r12d                            #4985.5
-..LN155:
-   .loc    1  4993
-        movl      %r14d, %r13d                                  #4993.49
-        shrl      $2, %r13d                                     #4993.49
-..LN157:
-   .loc    1  4996
-        subl      4(%rbx), %r12d                                #4996.12
-..LN159:
-   .loc    1  4993
-        lea       (%r15,%r13), %rdi                             #4993.30
-..LN161:
-   .loc    1  4999
-        lea       3(%r14,%rcx), %esi                            #4999.50
-..LN163:
-        shrl      $2, %esi                                      #4999.57
-..LN165:
-        addq      %r15, %rsi                                    #4999.30
-        movq      %rsi, -176(%rbp)                              #4999.30
-..LN167:
-   .loc    1  5002
-        call      prime_buffer_4na at PLT                          #5002.14
-                                # LOE rbx r13 r14 r15 r12d r14d r14b xmm0
-..B2.51:                        # Preds ..B2.50
-..LN169:
-   .loc    1  5009
-        movdqa    16(%rbx), %xmm8                               #5009.5
-        movdqa    32(%rbx), %xmm7                               #5009.5
-        movdqa    48(%rbx), %xmm6                               #5009.5
-        movdqa    64(%rbx), %xmm5                               #5009.5
-        movdqa    80(%rbx), %xmm4                               #5009.5
-        movdqa    96(%rbx), %xmm3                               #5009.5
-        movdqa    112(%rbx), %xmm2                              #5009.5
-        movdqa    128(%rbx), %xmm1                              #5009.5
-..LN171:
-   .loc    1  5003
-        lea       8(%r15,%r13), %r13                            #5003.5
-        movq      %r13, %rdx                                    #5003.5
-..LN173:
-   .loc    1  5012
-        xorl      %edi, %edi                                    #5012.15
-..LN175:
-        xorl      %r8d, %r8d                                    #5012.10
-..LN177:
-        xorl      %esi, %esi                                    #5012.5
-..LN179:
-   .loc    1  5014
-        movl      %r12d, %eax                                   #5014.20
-        subl      %r14d, %eax                                   #5014.20
-..LN181:
-        addl      $7, %eax                                      #5014.33
-..LN183:
-        shrl      $2, %eax                                      #5014.40
-..LN185:
-   .loc    1  5023
-        movl      %r14d, %ecx                                   #5023.20
-        andl      $3, %ecx                                      #5023.20
-        je        ..B2.45       # Prob 20%                      #5023.20
-                                # LOE rdx r13 r14 eax ecx esi edi r8d r12d r14d r14b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.2:                         # Preds ..B2.51
-        cmpl      $1, %ecx                                      #5023.20
-        je        ..B2.8        # Prob 25%                      #5023.20
-                                # LOE rdx r13 r14 eax ecx esi edi r8d r12d r14d r14b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.3:                         # Preds ..B2.2
-        cmpl      $2, %ecx                                      #5023.20
-        je        ..B2.7        # Prob 33%                      #5023.20
-                                # LOE rdx r13 r14 eax ecx esi edi r8d r12d r14d r14b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.4:                         # Preds ..B2.3
-        cmpl      $3, %ecx                                      #5023.20
-        je        ..B2.6        # Prob 50%                      #5023.20
-                                # LOE rdx r13 r14 eax esi edi r8d r12d r14d r14b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.5:                         # Preds ..B2.4
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B2.16       # Prob 100%                     #
-                                # LOE rdx rbx r13 r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.6:                         # Preds ..B2.4
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B2.11       # Prob 100%                     #
-                                # LOE rdx rbx r13 eax esi edi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.7:                         # Preds ..B2.3
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B2.10       # Prob 100%                     #
-                                # LOE rdx rbx r13 eax esi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.8:                         # Preds ..B2.2
-        movq      -176(%rbp), %rbx                              #
-                                # LOE rdx rbx r13 eax esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.9:                         # Preds ..B2.8 ..B2.20
-..LN187:
-   .loc    1  5047
-        movdqa    %xmm0, %xmm10                                 #5047.22
-..LN189:
-   .loc    1  5048
-        movdqa    %xmm0, %xmm9                                  #5048.22
-..LN191:
-   .loc    1  5047
-        pand      %xmm6, %xmm10                                 #5047.22
-..LN193:
-   .loc    1  5048
-        pand      %xmm5, %xmm9                                  #5048.22
-..LN195:
-   .loc    1  5049
-        pcmpeqd   %xmm9, %xmm10                                 #5049.22
-..LN197:
-   .loc    1  5050
-        pmovmskb  %xmm10, %r8d                                  #5050.22
-..LN199:
-   .loc    1  5051
-        incl      %r8d                                          #5051.17
-        shrl      $16, %r8d                                     #5051.17
-        negl      %r8d                                          #5051.17
-                                # LOE rdx rbx r13 eax esi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.10:                        # Preds ..B2.7 ..B2.9
-..LN201:
-   .loc    1  5054
-        movdqa    %xmm0, %xmm10                                 #5054.22
-..LN203:
-   .loc    1  5055
-        movdqa    %xmm0, %xmm9                                  #5055.22
-..LN205:
-   .loc    1  5054
-        pand      %xmm4, %xmm10                                 #5054.22
-..LN207:
-   .loc    1  5055
-        pand      %xmm3, %xmm9                                  #5055.22
-..LN209:
-   .loc    1  5056
-        pcmpeqd   %xmm9, %xmm10                                 #5056.22
-..LN211:
-   .loc    1  5057
-        pmovmskb  %xmm10, %edi                                  #5057.22
-..LN213:
-   .loc    1  5058
-        incl      %edi                                          #5058.17
-        shrl      $16, %edi                                     #5058.17
-        negl      %edi                                          #5058.17
-                                # LOE rdx rbx r13 eax esi edi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.11:                        # Preds ..B2.6 ..B2.10
-..LN215:
-   .loc    1  5061
-        movdqa    %xmm0, %xmm10                                 #5061.22
-..LN217:
-   .loc    1  5062
-        movdqa    %xmm0, %xmm9                                  #5062.22
-..LN219:
-   .loc    1  5069
-        andl      $-4, %r14d                                    #5069.17
-..LN221:
-   .loc    1  5061
-        pand      %xmm2, %xmm10                                 #5061.22
-..LN223:
-   .loc    1  5062
-        pand      %xmm1, %xmm9                                  #5062.22
-..LN225:
-   .loc    1  5063
-        pcmpeqd   %xmm9, %xmm10                                 #5063.22
-..LN227:
-   .loc    1  5064
-        pmovmskb  %xmm10, %ecx                                  #5064.22
-..LN229:
-   .loc    1  5072
-        movl      %esi, %r9d                                    #5072.29
-        orl       %r8d, %r9d                                    #5072.29
-..LN231:
-   .loc    1  5065
-        incl      %ecx                                          #5065.17
-        shrl      $16, %ecx                                     #5065.17
-        negl      %ecx                                          #5065.17
-..LN233:
-   .loc    1  5072
-        orl       %edi, %r9d                                    #5072.34
-..LN235:
-        orl       %ecx, %r9d                                    #5072.39
-..LN237:
-        jne       ..B2.21       # Prob 20%                      #5072.47
-                                # LOE rdx rbx r13 eax ecx esi edi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.12:                        # Preds ..B2.11
-..LN239:
-   .loc    1  5135
-        addl      $4, %r14d                                     #5135.17
-..LN241:
-   .loc    1  5138
-        cmpl      %r12d, %r14d                                  #5138.28
-        ja        ..B2.44       # Prob 20%                      #5138.28
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.13:                        # Preds ..B2.12
-..LN243:
-   .loc    1  5142
-        decl      %eax                                          #5142.25
-..LN245:
-        jne       ..B2.17       # Prob 50%                      #5142.39
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.14:                        # Preds ..B2.13
-..LN247:
-   .loc    1  5159
-        cmpq      %rbx, %r13                                    #5159.25
-        jae       ..B2.44       # Prob 4%                       #5159.25
-                                # LOE rbx r13 r12d r14d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.15:                        # Preds ..B2.14
-..LN249:
-   .loc    1  5169
-        movdqa    %xmm1, -176(%rbp)                             #5169.22
-        movdqa    %xmm2, -160(%rbp)                             #5169.22
-        movdqa    %xmm3, -144(%rbp)                             #5169.22
-        movdqa    %xmm4, -128(%rbp)                             #5169.22
-        movdqa    %xmm5, -112(%rbp)                             #5169.22
-        movdqa    %xmm6, -96(%rbp)                              #5169.22
-        movdqa    %xmm7, -80(%rbp)                              #5169.22
-        movdqa    %xmm8, -64(%rbp)                              #5169.22
-        movq      %r13, %rdi                                    #5169.22
-        movq      %rbx, %rsi                                    #5169.22
-        call      prime_buffer_4na at PLT                          #5169.22
-                                # LOE rbx r13 r12d r14d xmm0
-..B2.52:                        # Preds ..B2.15
-        movdqa    -64(%rbp), %xmm8                              #
-        movdqa    -80(%rbp), %xmm7                              #
-        movdqa    -96(%rbp), %xmm6                              #
-        movdqa    -112(%rbp), %xmm5                             #
-..LN251:
-   .loc    1  5184
-        addq      $8, %r13                                      #5184.13
-        movq      %r13, %rdx                                    #5184.13
-        movdqa    -128(%rbp), %xmm4                             #
-        movdqa    -144(%rbp), %xmm3                             #
-        movdqa    -160(%rbp), %xmm2                             #
-        movdqa    -176(%rbp), %xmm1                             #
-                                # LOE rdx rbx r13 r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.16:                        # Preds ..B2.5 ..B2.52
-..LN253:
-   .loc    1  5030
-        movl      $8, %eax                                      #5030.13
-        jmp       ..B2.20       # Prob 100%                     #5030.13
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.17:                        # Preds ..B2.13
-..LN255:
-   .loc    1  5147
-        psrldq    $2, %xmm0                                     #5147.26
-..LN257:
-   .loc    1  5150
-        cmpq      %rbx, %rdx                                    #5150.26
-        jae       ..B2.19       # Prob 19%                      #5150.26
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.18:                        # Preds ..B2.17
-..LN259:
-   .loc    1  5151
-        movzbl    (%rdx), %esi                                  #5151.72
-..LN261:
-        lea       expand_2na.0(%rip), %rcx                      #5151.57
-        movzwl    (%rcx,%rsi,2), %edi                           #5151.57
-..LN263:
-        pinsrw    $7, %edi, %xmm0                               #5151.30
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.19:                        # Preds ..B2.18 ..B2.17
-..LN265:
-   .loc    1  5154
-        incq      %rdx                                          #5154.20
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.20:                        # Preds ..B2.16 ..B2.19 ..B2.45
-..LN267:
-   .loc    1  5040
-        movdqa    %xmm0, %xmm10                                 #5040.22
-..LN269:
-   .loc    1  5041
-        movdqa    %xmm0, %xmm9                                  #5041.22
-..LN271:
-   .loc    1  5040
-        pand      %xmm8, %xmm10                                 #5040.22
-..LN273:
-   .loc    1  5041
-        pand      %xmm7, %xmm9                                  #5041.22
-..LN275:
-   .loc    1  5042
-        pcmpeqd   %xmm9, %xmm10                                 #5042.22
-..LN277:
-   .loc    1  5043
-        pmovmskb  %xmm10, %esi                                  #5043.22
-..LN279:
-   .loc    1  5044
-        incl      %esi                                          #5044.17
-        shrl      $16, %esi                                     #5044.17
-        negl      %esi                                          #5044.17
-        jmp       ..B2.9        # Prob 100%                     #5044.17
-                                # LOE rdx rbx r13 eax esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.21:                        # Preds ..B2.11                 # Infreq
-..LN281:
-   .loc    1  5075
-        subl      %r14d, %r12d                                  #5075.30
-..LN283:
-        je        ..B2.42       # Prob 25%                      #5075.37
-                                # LOE ecx esi edi r8d r12d r14d
-..B2.22:                        # Preds ..B2.21                 # Infreq
-        cmpl      $1, %r12d                                     #5075.37
-        jne       ..B2.27       # Prob 67%                      #5075.37
-                                # LOE ecx esi edi r8d r12d r14d
-..B2.23:                        # Preds ..B2.22                 # Infreq
-..LN285:
-   .loc    1  5081
-        testl     %esi, %esi                                    #5081.36
-        jne       ..B2.43       # Prob 28%                      #5081.36
-                                # LOE r8d r14d
-..B2.24:                        # Preds ..B2.23                 # Infreq
-..LN287:
-   .loc    1  5082
-        testl     %r8d, %r8d                                    #5082.36
-        je        ..B2.44       # Prob 50%                      #5082.36
-                                # LOE r14d
-..B2.25:                        # Preds ..B2.35 ..B2.29 ..B2.24 # Infreq
-..LN289:
-        subl      -8(%rbp), %r14d                               #5082.47
-..LN291:
-        movq      -16(%rbp), %rbx                               #5082.61
-..___tag_value_eval_4na_pos.168:                                #
-        addl      $2, %r14d                                     #5082.61
-        movl      %r14d, %eax                                   #5082.61
-        movq      -24(%rbp), %r12                               #5082.61
-..___tag_value_eval_4na_pos.169:                                #
-        movq      -32(%rbp), %r13                               #5082.61
-..___tag_value_eval_4na_pos.170:                                #
-        movq      -40(%rbp), %r14                               #5082.61
-..___tag_value_eval_4na_pos.171:                                #
-        movq      -48(%rbp), %r15                               #5082.61
-..___tag_value_eval_4na_pos.172:                                #
-        movq      %rbp, %rsp                                    #5082.61
-        popq      %rbp                                          #5082.61
-..___tag_value_eval_4na_pos.173:                                #
-        ret                                                     #5082.61
-..___tag_value_eval_4na_pos.174:                                #
-                                # LOE
-..B2.27:                        # Preds ..B2.22                 # Infreq
-..LN293:
-   .loc    1  5075
-        cmpl      $2, %r12d                                     #5075.37
-        jne       ..B2.34       # Prob 50%                      #5075.37
-                                # LOE ecx esi edi r8d r14d
-..B2.28:                        # Preds ..B2.27                 # Infreq
-..LN295:
-   .loc    1  5085
-        testl     %esi, %esi                                    #5085.36
-        jne       ..B2.43       # Prob 28%                      #5085.36
-                                # LOE edi r8d r14d
-..B2.29:                        # Preds ..B2.28                 # Infreq
-..LN297:
-   .loc    1  5086
-        testl     %r8d, %r8d                                    #5086.36
-        jne       ..B2.25       # Prob 28%                      #5086.36
-                                # LOE edi r14d
-..B2.30:                        # Preds ..B2.29                 # Infreq
-..LN299:
-   .loc    1  5087
-        testl     %edi, %edi                                    #5087.36
-        je        ..B2.44       # Prob 50%                      #5087.36
-                                # LOE r14d
-..B2.31:                        # Preds ..B2.36 ..B2.30         # Infreq
-..LN301:
-        subl      -8(%rbp), %r14d                               #5087.47
-..LN303:
-        movq      -16(%rbp), %rbx                               #5087.61
-..___tag_value_eval_4na_pos.180:                                #
-        addl      $3, %r14d                                     #5087.61
-        movl      %r14d, %eax                                   #5087.61
-        movq      -24(%rbp), %r12                               #5087.61
-..___tag_value_eval_4na_pos.181:                                #
-        movq      -32(%rbp), %r13                               #5087.61
-..___tag_value_eval_4na_pos.182:                                #
-        movq      -40(%rbp), %r14                               #5087.61
-..___tag_value_eval_4na_pos.183:                                #
-        movq      -48(%rbp), %r15                               #5087.61
-..___tag_value_eval_4na_pos.184:                                #
-        movq      %rbp, %rsp                                    #5087.61
-        popq      %rbp                                          #5087.61
-..___tag_value_eval_4na_pos.185:                                #
-        ret                                                     #5087.61
-..___tag_value_eval_4na_pos.186:                                #
-                                # LOE
-..B2.34:                        # Preds ..B2.27                 # Infreq
-..LN305:
-   .loc    1  5090
-        testl     %esi, %esi                                    #5090.36
-        jne       ..B2.43       # Prob 28%                      #5090.36
-                                # LOE ecx edi r8d r14d
-..B2.35:                        # Preds ..B2.34                 # Infreq
-..LN307:
-   .loc    1  5091
-        testl     %r8d, %r8d                                    #5091.36
-        jne       ..B2.25       # Prob 28%                      #5091.36
-                                # LOE ecx edi r14d
-..B2.36:                        # Preds ..B2.35                 # Infreq
-..LN309:
-   .loc    1  5092
-        testl     %edi, %edi                                    #5092.36
-        jne       ..B2.31       # Prob 28%                      #5092.36
-                                # LOE ecx r14d
-..B2.37:                        # Preds ..B2.36                 # Infreq
-..LN311:
-   .loc    1  5093
-        testl     %ecx, %ecx                                    #5093.36
-        je        ..B2.44       # Prob 50%                      #5093.36
-                                # LOE r14d
-..B2.38:                        # Preds ..B2.37                 # Infreq
-..LN313:
-        subl      -8(%rbp), %r14d                               #5093.47
-..LN315:
-        movq      -16(%rbp), %rbx                               #5093.61
-..___tag_value_eval_4na_pos.192:                                #
-        addl      $4, %r14d                                     #5093.61
-        movl      %r14d, %eax                                   #5093.61
-        movq      -24(%rbp), %r12                               #5093.61
-..___tag_value_eval_4na_pos.193:                                #
-        movq      -32(%rbp), %r13                               #5093.61
-..___tag_value_eval_4na_pos.194:                                #
-        movq      -40(%rbp), %r14                               #5093.61
-..___tag_value_eval_4na_pos.195:                                #
-        movq      -48(%rbp), %r15                               #5093.61
-..___tag_value_eval_4na_pos.196:                                #
-        movq      %rbp, %rsp                                    #5093.61
-        popq      %rbp                                          #5093.61
-..___tag_value_eval_4na_pos.197:                                #
-        ret                                                     #5093.61
-..___tag_value_eval_4na_pos.198:                                #
-                                # LOE
-..B2.42:                        # Preds ..B2.21                 # Infreq
-..LN317:
-   .loc    1  5078
-        testl     %esi, %esi                                    #5078.36
-        je        ..B2.44       # Prob 50%                      #5078.36
-                                # LOE r14d
-..B2.43:                        # Preds ..B2.34 ..B2.28 ..B2.23 ..B2.42 # Infreq
-..LN319:
-        subl      -8(%rbp), %r14d                               #5078.47
-..LN321:
-        movq      -16(%rbp), %rbx                               #5078.61
-..___tag_value_eval_4na_pos.204:                                #
-        incl      %r14d                                         #5078.61
-        movl      %r14d, %eax                                   #5078.61
-        movq      -24(%rbp), %r12                               #5078.61
-..___tag_value_eval_4na_pos.205:                                #
-        movq      -32(%rbp), %r13                               #5078.61
-..___tag_value_eval_4na_pos.206:                                #
-        movq      -40(%rbp), %r14                               #5078.61
-..___tag_value_eval_4na_pos.207:                                #
-        movq      -48(%rbp), %r15                               #5078.61
-..___tag_value_eval_4na_pos.208:                                #
-        movq      %rbp, %rsp                                    #5078.61
-        popq      %rbp                                          #5078.61
-..___tag_value_eval_4na_pos.209:                                #
-        ret                                                     #5078.61
-..___tag_value_eval_4na_pos.210:                                #
-                                # LOE
-..B2.44:                        # Preds ..B2.14 ..B2.12 ..B2.37 ..B2.30 ..B2.24
-                                #       ..B2.42                 # Infreq
-..LN323:
-   .loc    1  5095
-        movq      -16(%rbp), %rbx                               #5095.28
-..___tag_value_eval_4na_pos.216:                                #
-        movq      -24(%rbp), %r12                               #5095.28
-..___tag_value_eval_4na_pos.217:                                #
-        movq      -32(%rbp), %r13                               #5095.28
-..___tag_value_eval_4na_pos.218:                                #
-        movq      -40(%rbp), %r14                               #5095.28
-..___tag_value_eval_4na_pos.219:                                #
-        xorl      %eax, %eax                                    #5095.28
-        movq      -48(%rbp), %r15                               #5095.28
-..___tag_value_eval_4na_pos.220:                                #
-        movq      %rbp, %rsp                                    #5095.28
-        popq      %rbp                                          #5095.28
-..___tag_value_eval_4na_pos.221:                                #
-        ret                                                     #5095.28
-..___tag_value_eval_4na_pos.222:                                #
-                                # LOE
-..B2.45:                        # Preds ..B2.51                 # Infreq
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B2.20       # Prob 100%                     #
-        .align    16,0x90
-..___tag_value_eval_4na_pos.228:                                #
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-.LNeval_4na_pos:
-	.data
-# -- End  eval_4na_pos
-	.text
-# -- Begin  prime_buffer_4na
-# mark_begin;
-       .align    16,0x90
-prime_buffer_4na:
-# parameter 1(src): %rdi
-# parameter 2(ignore): %rsi
-..B3.1:                         # Preds ..B3.0
-..___tag_value_prime_buffer_4na.229:                            #3990.1
-..LN325:
-   .loc    1  3990
-        pushq     %rbp                                          #3990.1
-        movq      %rsp, %rbp                                    #3990.1
-..___tag_value_prime_buffer_4na.230:                            #
-        subq      $32, %rsp                                     #3990.1
-        movq      %r14, -16(%rbp)                               #3990.1
-..___tag_value_prime_buffer_4na.232:                            #
-        movq      %rdi, %r14                                    #3990.1
-        lea       _gprof_pack2(%rip), %rdx                      #3990.1
-        call      mcount at PLT                                    #3990.1
-                                # LOE rbx r12 r13 r14 r15
-..B3.4:                         # Preds ..B3.1
-..LN327:
-   .loc    1  3996
-        movzbl    (%r14), %edx                                  #3996.34
-..LN329:
-   .loc    1  3997
-        movzbl    1(%r14), %esi                                 #3997.34
-..LN331:
-   .loc    1  3998
-        movzbl    2(%r14), %r8d                                 #3998.34
-..LN333:
-   .loc    1  3999
-        movzbl    3(%r14), %r10d                                #3999.34
-..LN335:
-   .loc    1  3996
-        lea       expand_2na.0(%rip), %rax                      #3996.21
-        movzwl    (%rax,%rdx,2), %ecx                           #3996.21
-..LN337:
-   .loc    1  3997
-        movzwl    (%rax,%rsi,2), %edi                           #3997.21
-..LN339:
-   .loc    1  3998
-        movzwl    (%rax,%r8,2), %r9d                            #3998.21
-..LN341:
-   .loc    1  3999
-        movzwl    (%rax,%r10,2), %r11d                          #3999.21
-..LN343:
-   .loc    1  4000
-        movzbl    4(%r14), %edx                                 #4000.34
-..LN345:
-   .loc    1  4001
-        movzbl    5(%r14), %esi                                 #4001.34
-..LN347:
-   .loc    1  4002
-        movzbl    6(%r14), %r8d                                 #4002.34
-..LN349:
-   .loc    1  4003
-        movzbl    7(%r14), %r14d                                #4003.34
-..LN351:
-   .loc    1  3996
-        movw      %cx, -32(%rbp)                                #3996.5
-..LN353:
-   .loc    1  4000
-        movzwl    (%rax,%rdx,2), %ecx                           #4000.21
-..LN355:
-   .loc    1  3997
-        movw      %di, -30(%rbp)                                #3997.5
-..LN357:
-   .loc    1  4001
-        movzwl    (%rax,%rsi,2), %edi                           #4001.21
-..LN359:
-   .loc    1  3998
-        movw      %r9w, -28(%rbp)                               #3998.5
-..LN361:
-   .loc    1  4002
-        movzwl    (%rax,%r8,2), %r9d                            #4002.21
-..LN363:
-   .loc    1  4003
-        movzwl    (%rax,%r14,2), %eax                           #4003.21
-..LN365:
-   .loc    1  4006
-        movq      -16(%rbp), %r14                               #4006.12
-..___tag_value_prime_buffer_4na.233:                            #
-..LN367:
-   .loc    1  3999
-        movw      %r11w, -26(%rbp)                              #3999.5
-..LN369:
-   .loc    1  4000
-        movw      %cx, -24(%rbp)                                #4000.5
-..LN371:
-   .loc    1  4001
-        movw      %di, -22(%rbp)                                #4001.5
-..LN373:
-   .loc    1  4002
-        movw      %r9w, -20(%rbp)                               #4002.5
-..LN375:
-   .loc    1  4003
-        movw      %ax, -18(%rbp)                                #4003.5
-..LN377:
-   .loc    1  4005
-        movdqu    -32(%rbp), %xmm0                              #4005.51
-..LN379:
-   .loc    1  4006
-        movq      %rbp, %rsp                                    #4006.12
-        popq      %rbp                                          #4006.12
-..___tag_value_prime_buffer_4na.234:                            #
-        ret                                                     #4006.12
-        .align    16,0x90
-..___tag_value_prime_buffer_4na.235:                            #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_4na, at function
-	.size	prime_buffer_4na,.-prime_buffer_4na
-.LNprime_buffer_4na:
-	.data
-# -- End  prime_buffer_4na
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    16,0x90
-eval_2na_pos:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B4.1:                         # Preds ..B4.0
-..___tag_value_eval_2na_pos.236:                                #3662.1
-..LN381:
-   .loc    1  3662
-        pushq     %rbp                                          #3662.1
-        movq      %rsp, %rbp                                    #3662.1
-..___tag_value_eval_2na_pos.237:                                #
-        subq      $176, %rsp                                    #3662.1
-        movq      %r15, -48(%rbp)                               #3662.1
-..___tag_value_eval_2na_pos.239:                                #
-        movq      %r14, -40(%rbp)                               #3662.1
-..___tag_value_eval_2na_pos.240:                                #
-        movq      %r13, -32(%rbp)                               #3662.1
-..___tag_value_eval_2na_pos.241:                                #
-        movq      %r12, -24(%rbp)                               #3662.1
-..___tag_value_eval_2na_pos.242:                                #
-        movq      %rbx, -16(%rbp)                               #3662.1
-..___tag_value_eval_2na_pos.243:                                #
-        movl      %ecx, %r13d                                   #3662.1
-        movl      %edx, %r12d                                   #3662.1
-        movq      %rsi, %rbx                                    #3662.1
-        movq      %rdi, %r15                                    #3662.1
-        lea       _gprof_pack3(%rip), %rdx                      #3662.1
-        call      mcount at PLT                                    #3662.1
-                                # LOE rbx r15 r12d r13d
-..B4.53:                        # Preds ..B4.1
-        movl      %r12d, -8(%rbp)                               #3662.1
-..LN383:
-   .loc    1  3705
-        lea       (%r12,%r13), %r14d                            #3705.5
-..LN385:
-   .loc    1  3716
-        subl      4(%r15), %r14d                                #3716.12
-..LN387:
-   .loc    1  3713
-        movl      %r12d, %eax                                   #3713.49
-        shrl      $2, %eax                                      #3713.49
-..LN389:
-        movq      %rax, -176(%rbp)                              #3713.30
-        lea       (%rbx,%rax), %rdi                             #3713.30
-..LN391:
-   .loc    1  3719
-        lea       3(%r12,%r13), %r13d                           #3719.50
-..LN393:
-        shrl      $2, %r13d                                     #3719.57
-..LN395:
-        addq      %rbx, %r13                                    #3719.30
-..LN397:
-   .loc    1  3722
-        movq      %r13, %rsi                                    #3722.14
-        call      prime_buffer_2na at PLT                          #3722.14
-                                # LOE rbx r12 r13 r15 r12d r14d r12b xmm0
-..B4.54:                        # Preds ..B4.53
-..LN399:
-   .loc    1  3723
-        movq      -176(%rbp), %rax                              #3723.5
-        lea       16(%rbx,%rax), %r8                            #3723.5
-        movq      %r8, %rdi                                     #3723.5
-..LN401:
-   .loc    1  3728
-        cmpq      %r13, %r8                                     #3728.16
-..LN403:
-   .loc    1  3733
-..LN405:
-   .loc    1  3728
-        jae       ..B4.3        # Prob 12%                      #3728.16
-                                # LOE rdi r8 r12 r13 r15 ebx r12d r14d r12b xmm0
-..B4.2:                         # Preds ..B4.54
-..LN407:
-   .loc    1  3729
-        movzbl    -1(%r8), %ebx                                 #3729.24
-..LN409:
-        shll      $8, %ebx                                      #3729.38
-                                # LOE rdi r8 r12 r13 r15 ebx r12d r14d r12b xmm0
-..B4.3:                         # Preds ..B4.2 ..B4.54
-..LN411:
-   .loc    1  3733
-        movdqa    16(%r15), %xmm8                               #3733.5
-        movdqa    32(%r15), %xmm7                               #3733.5
-        movdqa    48(%r15), %xmm6                               #3733.5
-        movdqa    64(%r15), %xmm5                               #3733.5
-        movdqa    80(%r15), %xmm4                               #3733.5
-        movdqa    96(%r15), %xmm3                               #3733.5
-        movdqa    112(%r15), %xmm2                              #3733.5
-        movdqa    128(%r15), %xmm1                              #3733.5
-..LN413:
-   .loc    1  3736
-        xorl      %ecx, %ecx                                    #3736.15
-..LN415:
-        xorl      %esi, %esi                                    #3736.10
-..LN417:
-        xorl      %edx, %edx                                    #3736.5
-..LN419:
-   .loc    1  3738
-        movl      %r14d, %eax                                   #3738.20
-        subl      %r12d, %eax                                   #3738.20
-..LN421:
-        addl      $7, %eax                                      #3738.33
-..LN423:
-        shrl      $2, %eax                                      #3738.40
-..LN425:
-   .loc    1  3745
-        movl      %r12d, %r9d                                   #3745.20
-        andl      $3, %r9d                                      #3745.20
-        je        ..B4.48       # Prob 20%                      #3745.20
-                                # LOE rdi r8 r12 r13 eax edx ecx ebx esi r9d r12d r14d r12b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.4:                         # Preds ..B4.3
-        cmpl      $1, %r9d                                      #3745.20
-        je        ..B4.10       # Prob 25%                      #3745.20
-                                # LOE rdi r8 r12 r13 eax edx ecx ebx esi r9d r12d r14d r12b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.5:                         # Preds ..B4.4
-        cmpl      $2, %r9d                                      #3745.20
-        je        ..B4.9        # Prob 33%                      #3745.20
-                                # LOE rdi r8 r12 r13 eax edx ecx ebx esi r9d r12d r14d r12b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.6:                         # Preds ..B4.5
-        cmpl      $3, %r9d                                      #3745.20
-        je        ..B4.8        # Prob 50%                      #3745.20
-                                # LOE rdi r8 r12 r13 eax edx ecx ebx esi r12d r14d r12b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.7:                         # Preds ..B4.6
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B4.19       # Prob 100%                     #
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.8:                         # Preds ..B4.6
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B4.13       # Prob 100%                     #
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.9:                         # Preds ..B4.5
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B4.12       # Prob 100%                     #
-                                # LOE rdi r13 r15 eax edx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.10:                        # Preds ..B4.4
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-                                # LOE rdi r13 r15 eax edx ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.11:                        # Preds ..B4.10 ..B4.23
-..LN427:
-   .loc    1  3768
-        movdqa    %xmm0, %xmm9                                  #3768.22
-        pand      %xmm5, %xmm9                                  #3768.22
-..LN429:
-   .loc    1  3769
-        pcmpeqd   %xmm6, %xmm9                                  #3769.22
-..LN431:
-   .loc    1  3770
-        pmovmskb  %xmm9, %esi                                   #3770.22
-..LN433:
-   .loc    1  3771
-        incl      %esi                                          #3771.17
-        shrl      $16, %esi                                     #3771.17
-        negl      %esi                                          #3771.17
-                                # LOE rdi r13 r15 eax edx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.12:                        # Preds ..B4.9 ..B4.11
-..LN435:
-   .loc    1  3774
-        movdqa    %xmm0, %xmm9                                  #3774.22
-        pand      %xmm3, %xmm9                                  #3774.22
-..LN437:
-   .loc    1  3775
-        pcmpeqd   %xmm4, %xmm9                                  #3775.22
-..LN439:
-   .loc    1  3776
-        pmovmskb  %xmm9, %ecx                                   #3776.22
-..LN441:
-   .loc    1  3777
-        incl      %ecx                                          #3777.17
-        shrl      $16, %ecx                                     #3777.17
-        negl      %ecx                                          #3777.17
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.13:                        # Preds ..B4.8 ..B4.12
-..LN443:
-   .loc    1  3780
-        movdqa    %xmm0, %xmm9                                  #3780.22
-..LN445:
-   .loc    1  3787
-        andl      $-4, %r12d                                    #3787.17
-..LN447:
-   .loc    1  3790
-        movl      %edx, %r9d                                    #3790.29
-..LN449:
-   .loc    1  3780
-        pand      %xmm1, %xmm9                                  #3780.22
-..LN451:
-   .loc    1  3781
-        pcmpeqd   %xmm2, %xmm9                                  #3781.22
-..LN453:
-   .loc    1  3782
-        pmovmskb  %xmm9, %r8d                                   #3782.22
-..LN455:
-   .loc    1  3790
-        orl       %esi, %r9d                                    #3790.29
-..LN457:
-        orl       %ecx, %r9d                                    #3790.34
-..LN459:
-   .loc    1  3783
-        incl      %r8d                                          #3783.17
-        shrl      $16, %r8d                                     #3783.17
-        negl      %r8d                                          #3783.17
-..LN461:
-   .loc    1  3790
-        orl       %r8d, %r9d                                    #3790.39
-..LN463:
-        jne       ..B4.24       # Prob 20%                      #3790.47
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r8d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.14:                        # Preds ..B4.13
-..LN465:
-   .loc    1  3853
-        addl      $4, %r12d                                     #3853.17
-..LN467:
-   .loc    1  3856
-        cmpl      %r14d, %r12d                                  #3856.28
-        ja        ..B4.47       # Prob 20%                      #3856.28
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.15:                        # Preds ..B4.14
-..LN469:
-   .loc    1  3860
-        decl      %eax                                          #3860.25
-..LN471:
-        jne       ..B4.20       # Prob 50%                      #3860.39
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.16:                        # Preds ..B4.15
-..LN473:
-   .loc    1  3881
-        cmpq      %r15, %r13                                    #3881.25
-        jae       ..B4.47       # Prob 4%                       #3881.25
-                                # LOE r13 r15 ebx r12d r14d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.17:                        # Preds ..B4.16
-..LN475:
-   .loc    1  3891
-        movdqa    %xmm1, -176(%rbp)                             #3891.22
-        movdqa    %xmm2, -160(%rbp)                             #3891.22
-        movdqa    %xmm3, -144(%rbp)                             #3891.22
-        movdqa    %xmm4, -128(%rbp)                             #3891.22
-        movdqa    %xmm5, -112(%rbp)                             #3891.22
-        movdqa    %xmm6, -96(%rbp)                              #3891.22
-        movdqa    %xmm7, -80(%rbp)                              #3891.22
-        movdqa    %xmm8, -64(%rbp)                              #3891.22
-        movq      %r13, %rdi                                    #3891.22
-        movq      %r15, %rsi                                    #3891.22
-        call      prime_buffer_2na at PLT                          #3891.22
-                                # LOE r13 r15 ebx r12d r14d xmm0
-..B4.55:                        # Preds ..B4.17
-        movdqa    -64(%rbp), %xmm8                              #
-        movdqa    -80(%rbp), %xmm7                              #
-        movdqa    -96(%rbp), %xmm6                              #
-        movdqa    -112(%rbp), %xmm5                             #
-..LN477:
-   .loc    1  3969
-        addq      $16, %r13                                     #3969.13
-        movq      %r13, %rdi                                    #3969.13
-        movdqa    -128(%rbp), %xmm4                             #
-        movdqa    -144(%rbp), %xmm3                             #
-        movdqa    -160(%rbp), %xmm2                             #
-        movdqa    -176(%rbp), %xmm1                             #
-..LN479:
-   .loc    1  3972
-        cmpq      %r15, %r13                                    #3972.24
-        jae       ..B4.19       # Prob 12%                      #3972.24
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.18:                        # Preds ..B4.55
-..LN481:
-   .loc    1  3973
-        movzbl    -1(%r13), %ebx                                #3973.32
-..LN483:
-        shll      $8, %ebx                                      #3973.46
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.19:                        # Preds ..B4.55 ..B4.7 ..B4.18
-..LN485:
-   .loc    1  3752
-        movl      $16, %eax                                     #3752.13
-        jmp       ..B4.23       # Prob 100%                     #3752.13
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.20:                        # Preds ..B4.15
-..LN487:
-   .loc    1  3865
-        psrldq    $1, %xmm0                                     #3865.26
-..LN489:
-   .loc    1  3868
-        cmpq      %r15, %rdi                                    #3868.26
-        jae       ..B4.22       # Prob 19%                      #3868.26
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.21:                        # Preds ..B4.20
-..LN491:
-   .loc    1  3871
-        movzbl    (%rdi), %edx                                  #3871.37
-..LN493:
-   .loc    1  3870
-        sarl      $8, %ebx                                      #3870.21
-..LN495:
-   .loc    1  3871
-        shll      $8, %edx                                      #3871.48
-..LN497:
-        orl       %edx, %ebx                                    #3871.21
-..LN499:
-   .loc    1  3872
-        pinsrw    $7, %ebx, %xmm0                               #3872.30
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.22:                        # Preds ..B4.21 ..B4.20
-..LN501:
-   .loc    1  3876
-        incq      %rdi                                          #3876.20
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.23:                        # Preds ..B4.19 ..B4.22 ..B4.48
-..LN503:
-   .loc    1  3762
-        movdqa    %xmm0, %xmm9                                  #3762.22
-        pand      %xmm7, %xmm9                                  #3762.22
-..LN505:
-   .loc    1  3763
-        pcmpeqd   %xmm8, %xmm9                                  #3763.22
-..LN507:
-   .loc    1  3764
-        pmovmskb  %xmm9, %edx                                   #3764.22
-..LN509:
-   .loc    1  3765
-        incl      %edx                                          #3765.17
-        shrl      $16, %edx                                     #3765.17
-        negl      %edx                                          #3765.17
-        jmp       ..B4.11       # Prob 100%                     #3765.17
-                                # LOE rdi r13 r15 eax edx ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.24:                        # Preds ..B4.13                 # Infreq
-..LN511:
-   .loc    1  3793
-        subl      %r12d, %r14d                                  #3793.30
-..LN513:
-        je        ..B4.45       # Prob 25%                      #3793.37
-                                # LOE edx ecx esi r8d r12d r14d
-..B4.25:                        # Preds ..B4.24                 # Infreq
-        cmpl      $1, %r14d                                     #3793.37
-        jne       ..B4.30       # Prob 67%                      #3793.37
-                                # LOE edx ecx esi r8d r12d r14d
-..B4.26:                        # Preds ..B4.25                 # Infreq
-..LN515:
-   .loc    1  3799
-        testl     %edx, %edx                                    #3799.36
-        jne       ..B4.46       # Prob 28%                      #3799.36
-                                # LOE esi r12d
-..B4.27:                        # Preds ..B4.26                 # Infreq
-..LN517:
-   .loc    1  3800
-        testl     %esi, %esi                                    #3800.36
-        je        ..B4.47       # Prob 50%                      #3800.36
-                                # LOE r12d
-..B4.28:                        # Preds ..B4.38 ..B4.32 ..B4.27 # Infreq
-..LN519:
-        subl      -8(%rbp), %r12d                               #3800.47
-..LN521:
-        movq      -16(%rbp), %rbx                               #3800.61
-..___tag_value_eval_2na_pos.244:                                #
-        addl      $2, %r12d                                     #3800.61
-        movl      %r12d, %eax                                   #3800.61
-        movq      -24(%rbp), %r12                               #3800.61
-..___tag_value_eval_2na_pos.245:                                #
-        movq      -32(%rbp), %r13                               #3800.61
-..___tag_value_eval_2na_pos.246:                                #
-        movq      -40(%rbp), %r14                               #3800.61
-..___tag_value_eval_2na_pos.247:                                #
-        movq      -48(%rbp), %r15                               #3800.61
-..___tag_value_eval_2na_pos.248:                                #
-        movq      %rbp, %rsp                                    #3800.61
-        popq      %rbp                                          #3800.61
-..___tag_value_eval_2na_pos.249:                                #
-        ret                                                     #3800.61
-..___tag_value_eval_2na_pos.250:                                #
-                                # LOE
-..B4.30:                        # Preds ..B4.25                 # Infreq
-..LN523:
-   .loc    1  3793
-        cmpl      $2, %r14d                                     #3793.37
-        jne       ..B4.37       # Prob 50%                      #3793.37
-                                # LOE edx ecx esi r8d r12d
-..B4.31:                        # Preds ..B4.30                 # Infreq
-..LN525:
-   .loc    1  3803
-        testl     %edx, %edx                                    #3803.36
-        jne       ..B4.46       # Prob 28%                      #3803.36
-                                # LOE ecx esi r12d
-..B4.32:                        # Preds ..B4.31                 # Infreq
-..LN527:
-   .loc    1  3804
-        testl     %esi, %esi                                    #3804.36
-        jne       ..B4.28       # Prob 28%                      #3804.36
-                                # LOE ecx r12d
-..B4.33:                        # Preds ..B4.32                 # Infreq
-..LN529:
-   .loc    1  3805
-        testl     %ecx, %ecx                                    #3805.36
-        je        ..B4.47       # Prob 50%                      #3805.36
-                                # LOE r12d
-..B4.34:                        # Preds ..B4.39 ..B4.33         # Infreq
-..LN531:
-        subl      -8(%rbp), %r12d                               #3805.47
-..LN533:
-        movq      -16(%rbp), %rbx                               #3805.61
-..___tag_value_eval_2na_pos.256:                                #
-        addl      $3, %r12d                                     #3805.61
-        movl      %r12d, %eax                                   #3805.61
-        movq      -24(%rbp), %r12                               #3805.61
-..___tag_value_eval_2na_pos.257:                                #
-        movq      -32(%rbp), %r13                               #3805.61
-..___tag_value_eval_2na_pos.258:                                #
-        movq      -40(%rbp), %r14                               #3805.61
-..___tag_value_eval_2na_pos.259:                                #
-        movq      -48(%rbp), %r15                               #3805.61
-..___tag_value_eval_2na_pos.260:                                #
-        movq      %rbp, %rsp                                    #3805.61
-        popq      %rbp                                          #3805.61
-..___tag_value_eval_2na_pos.261:                                #
-        ret                                                     #3805.61
-..___tag_value_eval_2na_pos.262:                                #
-                                # LOE
-..B4.37:                        # Preds ..B4.30                 # Infreq
-..LN535:
-   .loc    1  3808
-        testl     %edx, %edx                                    #3808.36
-        jne       ..B4.46       # Prob 28%                      #3808.36
-                                # LOE ecx esi r8d r12d
-..B4.38:                        # Preds ..B4.37                 # Infreq
-..LN537:
-   .loc    1  3809
-        testl     %esi, %esi                                    #3809.36
-        jne       ..B4.28       # Prob 28%                      #3809.36
-                                # LOE ecx r8d r12d
-..B4.39:                        # Preds ..B4.38                 # Infreq
-..LN539:
-   .loc    1  3810
-        testl     %ecx, %ecx                                    #3810.36
-        jne       ..B4.34       # Prob 28%                      #3810.36
-                                # LOE r8d r12d
-..B4.40:                        # Preds ..B4.39                 # Infreq
-..LN541:
-   .loc    1  3811
-        testl     %r8d, %r8d                                    #3811.36
-        je        ..B4.47       # Prob 50%                      #3811.36
-                                # LOE r12d
-..B4.41:                        # Preds ..B4.40                 # Infreq
-..LN543:
-        subl      -8(%rbp), %r12d                               #3811.47
-..LN545:
-        movq      -16(%rbp), %rbx                               #3811.61
-..___tag_value_eval_2na_pos.268:                                #
-        addl      $4, %r12d                                     #3811.61
-        movl      %r12d, %eax                                   #3811.61
-        movq      -24(%rbp), %r12                               #3811.61
-..___tag_value_eval_2na_pos.269:                                #
-        movq      -32(%rbp), %r13                               #3811.61
-..___tag_value_eval_2na_pos.270:                                #
-        movq      -40(%rbp), %r14                               #3811.61
-..___tag_value_eval_2na_pos.271:                                #
-        movq      -48(%rbp), %r15                               #3811.61
-..___tag_value_eval_2na_pos.272:                                #
-        movq      %rbp, %rsp                                    #3811.61
-        popq      %rbp                                          #3811.61
-..___tag_value_eval_2na_pos.273:                                #
-        ret                                                     #3811.61
-..___tag_value_eval_2na_pos.274:                                #
-                                # LOE
-..B4.45:                        # Preds ..B4.24                 # Infreq
-..LN547:
-   .loc    1  3796
-        testl     %edx, %edx                                    #3796.36
-        je        ..B4.47       # Prob 50%                      #3796.36
-                                # LOE r12d
-..B4.46:                        # Preds ..B4.37 ..B4.31 ..B4.26 ..B4.45 # Infreq
-..LN549:
-        subl      -8(%rbp), %r12d                               #3796.47
-..LN551:
-        movq      -16(%rbp), %rbx                               #3796.61
-..___tag_value_eval_2na_pos.280:                                #
-        incl      %r12d                                         #3796.61
-        movl      %r12d, %eax                                   #3796.61
-        movq      -24(%rbp), %r12                               #3796.61
-..___tag_value_eval_2na_pos.281:                                #
-        movq      -32(%rbp), %r13                               #3796.61
-..___tag_value_eval_2na_pos.282:                                #
-        movq      -40(%rbp), %r14                               #3796.61
-..___tag_value_eval_2na_pos.283:                                #
-        movq      -48(%rbp), %r15                               #3796.61
-..___tag_value_eval_2na_pos.284:                                #
-        movq      %rbp, %rsp                                    #3796.61
-        popq      %rbp                                          #3796.61
-..___tag_value_eval_2na_pos.285:                                #
-        ret                                                     #3796.61
-..___tag_value_eval_2na_pos.286:                                #
-                                # LOE
-..B4.47:                        # Preds ..B4.14 ..B4.16 ..B4.40 ..B4.33 ..B4.27
-                                #       ..B4.45                 # Infreq
-..LN553:
-   .loc    1  3813
-        movq      -16(%rbp), %rbx                               #3813.28
-..___tag_value_eval_2na_pos.292:                                #
-        movq      -24(%rbp), %r12                               #3813.28
-..___tag_value_eval_2na_pos.293:                                #
-        movq      -32(%rbp), %r13                               #3813.28
-..___tag_value_eval_2na_pos.294:                                #
-        movq      -40(%rbp), %r14                               #3813.28
-..___tag_value_eval_2na_pos.295:                                #
-        xorl      %eax, %eax                                    #3813.28
-        movq      -48(%rbp), %r15                               #3813.28
-..___tag_value_eval_2na_pos.296:                                #
-        movq      %rbp, %rsp                                    #3813.28
-        popq      %rbp                                          #3813.28
-..___tag_value_eval_2na_pos.297:                                #
-        ret                                                     #3813.28
-..___tag_value_eval_2na_pos.298:                                #
-                                # LOE
-..B4.48:                        # Preds ..B4.3                  # Infreq
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B4.23       # Prob 100%                     #
-        .align    16,0x90
-..___tag_value_eval_2na_pos.304:                                #
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-.LNeval_2na_pos:
-	.data
-# -- End  eval_2na_pos
-	.text
-# -- Begin  prime_buffer_2na
-# mark_begin;
-       .align    16,0x90
-prime_buffer_2na:
-# parameter 1(src): %rdi
-# parameter 2(ignore): %rsi
-..B5.1:                         # Preds ..B5.0
-..___tag_value_prime_buffer_2na.305:                            #2129.1
-..LN555:
-   .loc    1  2129
-        pushq     %rbp                                          #2129.1
-        movq      %rsp, %rbp                                    #2129.1
-..___tag_value_prime_buffer_2na.306:                            #
-        subq      $16, %rsp                                     #2129.1
-        movq      %r12, -16(%rbp)                               #2129.1
-..___tag_value_prime_buffer_2na.308:                            #
-        movq      %rdi, %r12                                    #2129.1
-        lea       _gprof_pack4(%rip), %rdx                      #2129.1
-        call      mcount at PLT                                    #2129.1
-                                # LOE rbx r12 r13 r14 r15
-..B5.7:                         # Preds ..B5.1
-..LN557:
-   .loc    1  2132
-        testq     $15, %r12                                     #2132.29
-..LN559:
-        jne       ..B5.3        # Prob 50%                      #2132.37
-                                # LOE rbx r12 r13 r14 r15
-..B5.2:                         # Preds ..B5.7
-..LN561:
-   .loc    1  2133
-        movdqa    (%r12), %xmm0                                 #2133.54
-        jmp       ..B5.4        # Prob 100%                     #2133.54
-                                # LOE rbx r13 r14 r15 xmm0
-..B5.3:                         # Preds ..B5.7
-..LN563:
-   .loc    1  2135
-        movdqu    (%r12), %xmm0                                 #2135.55
-                                # LOE rbx r13 r14 r15 xmm0
-..B5.4:                         # Preds ..B5.2 ..B5.3
-..LN565:
-   .loc    1  2136
-        movq      -16(%rbp), %r12                               #2136.12
-..___tag_value_prime_buffer_2na.309:                            #
-        movq      %rbp, %rsp                                    #2136.12
-        popq      %rbp                                          #2136.12
-..___tag_value_prime_buffer_2na.310:                            #
-        ret                                                     #2136.12
-        .align    16,0x90
-..___tag_value_prime_buffer_2na.311:                            #
-                                # LOE
-# mark_end;
-	.type	prime_buffer_2na, at function
-	.size	prime_buffer_2na,.-prime_buffer_2na
-.LNprime_buffer_2na:
-	.data
-# -- End  prime_buffer_2na
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    16,0x90
-eval_4na_128:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B6.1:                         # Preds ..B6.0
-..___tag_value_eval_4na_128.312:                                #4724.1
-..LN567:
-   .loc    1  4724
-        pushq     %rbp                                          #4724.1
-        movq      %rsp, %rbp                                    #4724.1
-..___tag_value_eval_4na_128.313:                                #
-        subq      $176, %rsp                                    #4724.1
-        movq      %r15, -16(%rbp)                               #4724.1
-..___tag_value_eval_4na_128.315:                                #
-        movq      %r14, -24(%rbp)                               #4724.1
-..___tag_value_eval_4na_128.316:                                #
-        movq      %r13, -32(%rbp)                               #4724.1
-..___tag_value_eval_4na_128.317:                                #
-        movq      %r12, -40(%rbp)                               #4724.1
-..___tag_value_eval_4na_128.318:                                #
-        movq      %rbx, -48(%rbp)                               #4724.1
-..___tag_value_eval_4na_128.319:                                #
-        movl      %edx, %r14d                                   #4724.1
-        movq      %rsi, %r15                                    #4724.1
-        movq      %rdi, %rbx                                    #4724.1
-        lea       _gprof_pack5(%rip), %rdx                      #4724.1
-        movl      %ecx, -168(%rbp)                              #4724.1
-        call      mcount at PLT                                    #4724.1
-                                # LOE rbx r15 r14d
-..B6.37:                        # Preds ..B6.1
-        movl      -168(%rbp), %ecx                              #
-..LN569:
-   .loc    1  4757
-        lea       (%r14,%rcx), %r12d                            #4757.5
-..LN571:
-   .loc    1  4763
-        subl      4(%rbx), %r12d                                #4763.12
-..LN573:
-   .loc    1  4760
-        movl      %r14d, %r13d                                  #4760.49
-        shrl      $2, %r13d                                     #4760.49
-..LN575:
-        lea       (%r15,%r13), %rdi                             #4760.30
-..LN577:
-   .loc    1  4766
-        lea       3(%r14,%rcx), %esi                            #4766.50
-..LN579:
-        shrl      $2, %esi                                      #4766.57
-..LN581:
-        addq      %r15, %rsi                                    #4766.30
-        movq      %rsi, -176(%rbp)                              #4766.30
-..LN583:
-   .loc    1  4769
-        call      prime_buffer_4na at PLT                          #4769.14
-                                # LOE rbx r13 r15 r12d r14d xmm0
-..B6.38:                        # Preds ..B6.37
-..LN585:
-   .loc    1  4776
-        movdqa    16(%rbx), %xmm8                               #4776.5
-        movdqa    32(%rbx), %xmm7                               #4776.5
-        movdqa    48(%rbx), %xmm6                               #4776.5
-        movdqa    64(%rbx), %xmm5                               #4776.5
-        movdqa    80(%rbx), %xmm4                               #4776.5
-        movdqa    96(%rbx), %xmm3                               #4776.5
-        movdqa    112(%rbx), %xmm2                              #4776.5
-        movdqa    128(%rbx), %xmm1                              #4776.5
-..LN587:
-   .loc    1  4770
-        lea       8(%r15,%r13), %r13                            #4770.5
-        movq      %r13, %rdx                                    #4770.5
-..LN589:
-   .loc    1  4779
-        xorl      %esi, %esi                                    #4779.15
-..LN591:
-        xorl      %edi, %edi                                    #4779.10
-..LN593:
-        xorl      %ecx, %ecx                                    #4779.5
-..LN595:
-   .loc    1  4781
-        movl      %r12d, %eax                                   #4781.20
-        subl      %r14d, %eax                                   #4781.20
-..LN597:
-        addl      $7, %eax                                      #4781.33
-..LN599:
-        shrl      $2, %eax                                      #4781.40
-..LN601:
-   .loc    1  4790
-        movl      %r14d, %ebx                                   #4790.20
-        andl      $3, %ebx                                      #4790.20
-        je        ..B6.32       # Prob 20%                      #4790.20
-                                # LOE rdx r13 eax ecx ebx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.2:                         # Preds ..B6.38
-        cmpl      $1, %ebx                                      #4790.20
-        je        ..B6.8        # Prob 25%                      #4790.20
-                                # LOE rdx r13 eax ecx ebx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.3:                         # Preds ..B6.2
-        cmpl      $2, %ebx                                      #4790.20
-        je        ..B6.7        # Prob 33%                      #4790.20
-                                # LOE rdx r13 eax ecx ebx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.4:                         # Preds ..B6.3
-        cmpl      $3, %ebx                                      #4790.20
-        je        ..B6.6        # Prob 50%                      #4790.20
-                                # LOE rdx r13 eax ecx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.5:                         # Preds ..B6.4
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B6.16       # Prob 100%                     #
-                                # LOE rdx rbx r13 r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.6:                         # Preds ..B6.4
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B6.11       # Prob 100%                     #
-                                # LOE rdx rbx r13 eax ecx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.7:                         # Preds ..B6.3
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B6.10       # Prob 100%                     #
-                                # LOE rdx rbx r13 eax ecx edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.8:                         # Preds ..B6.2
-        movq      -176(%rbp), %rbx                              #
-                                # LOE rdx rbx r13 eax ecx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.9:                         # Preds ..B6.8 ..B6.20
-..LN603:
-   .loc    1  4814
-        movdqa    %xmm0, %xmm10                                 #4814.22
-..LN605:
-   .loc    1  4815
-        movdqa    %xmm0, %xmm9                                  #4815.22
-..LN607:
-   .loc    1  4814
-        pand      %xmm6, %xmm10                                 #4814.22
-..LN609:
-   .loc    1  4815
-        pand      %xmm5, %xmm9                                  #4815.22
-..LN611:
-   .loc    1  4816
-        pcmpeqd   %xmm9, %xmm10                                 #4816.22
-..LN613:
-   .loc    1  4817
-        pmovmskb  %xmm10, %edi                                  #4817.22
-..LN615:
-   .loc    1  4818
-        incl      %edi                                          #4818.17
-        shrl      $16, %edi                                     #4818.17
-        negl      %edi                                          #4818.17
-                                # LOE rdx rbx r13 eax ecx edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.10:                        # Preds ..B6.7 ..B6.9
-..LN617:
-   .loc    1  4821
-        movdqa    %xmm0, %xmm10                                 #4821.22
-..LN619:
-   .loc    1  4822
-        movdqa    %xmm0, %xmm9                                  #4822.22
-..LN621:
-   .loc    1  4821
-        pand      %xmm4, %xmm10                                 #4821.22
-..LN623:
-   .loc    1  4822
-        pand      %xmm3, %xmm9                                  #4822.22
-..LN625:
-   .loc    1  4823
-        pcmpeqd   %xmm9, %xmm10                                 #4823.22
-..LN627:
-   .loc    1  4824
-        pmovmskb  %xmm10, %esi                                  #4824.22
-..LN629:
-   .loc    1  4825
-        incl      %esi                                          #4825.17
-        shrl      $16, %esi                                     #4825.17
-        negl      %esi                                          #4825.17
-                                # LOE rdx rbx r13 eax ecx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.11:                        # Preds ..B6.6 ..B6.10
-..LN631:
-   .loc    1  4828
-        movdqa    %xmm0, %xmm10                                 #4828.22
-..LN633:
-   .loc    1  4829
-        movdqa    %xmm0, %xmm9                                  #4829.22
-..LN635:
-   .loc    1  4836
-        andl      $-4, %r14d                                    #4836.17
-..LN637:
-   .loc    1  4828
-        pand      %xmm2, %xmm10                                 #4828.22
-..LN639:
-   .loc    1  4829
-        pand      %xmm1, %xmm9                                  #4829.22
-..LN641:
-   .loc    1  4830
-        pcmpeqd   %xmm9, %xmm10                                 #4830.22
-..LN643:
-   .loc    1  4831
-        pmovmskb  %xmm10, %r8d                                  #4831.22
-..LN645:
-   .loc    1  4839
-        movl      %ecx, %r9d                                    #4839.29
-        orl       %edi, %r9d                                    #4839.29
-..LN647:
-   .loc    1  4832
-        incl      %r8d                                          #4832.17
-        shrl      $16, %r8d                                     #4832.17
-        negl      %r8d                                          #4832.17
-..LN649:
-   .loc    1  4839
-        orl       %esi, %r9d                                    #4839.34
-..LN651:
-        orl       %r8d, %r9d                                    #4839.39
-..LN653:
-        jne       ..B6.21       # Prob 20%                      #4839.47
-                                # LOE rdx rbx r13 eax ecx esi edi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.12:                        # Preds ..B6.11
-..LN655:
-   .loc    1  4880
-        addl      $4, %r14d                                     #4880.17
-..LN657:
-   .loc    1  4883
-        cmpl      %r12d, %r14d                                  #4883.28
-        ja        ..B6.29       # Prob 20%                      #4883.28
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.13:                        # Preds ..B6.12
-..LN659:
-   .loc    1  4887
-        decl      %eax                                          #4887.25
-..LN661:
-        jne       ..B6.17       # Prob 50%                      #4887.39
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.14:                        # Preds ..B6.13
-..LN663:
-   .loc    1  4904
-        cmpq      %rbx, %r13                                    #4904.25
-        jae       ..B6.29       # Prob 4%                       #4904.25
-                                # LOE rbx r13 r12d r14d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.15:                        # Preds ..B6.14
-..LN665:
-   .loc    1  4914
-        movdqa    %xmm1, -176(%rbp)                             #4914.22
-        movdqa    %xmm2, -160(%rbp)                             #4914.22
-        movdqa    %xmm3, -144(%rbp)                             #4914.22
-        movdqa    %xmm4, -128(%rbp)                             #4914.22
-        movdqa    %xmm5, -112(%rbp)                             #4914.22
-        movdqa    %xmm6, -96(%rbp)                              #4914.22
-        movdqa    %xmm7, -80(%rbp)                              #4914.22
-        movdqa    %xmm8, -64(%rbp)                              #4914.22
-        movq      %r13, %rdi                                    #4914.22
-        movq      %rbx, %rsi                                    #4914.22
-        call      prime_buffer_4na at PLT                          #4914.22
-                                # LOE rbx r13 r12d r14d xmm0
-..B6.39:                        # Preds ..B6.15
-        movdqa    -64(%rbp), %xmm8                              #
-        movdqa    -80(%rbp), %xmm7                              #
-        movdqa    -96(%rbp), %xmm6                              #
-        movdqa    -112(%rbp), %xmm5                             #
-..LN667:
-   .loc    1  4929
-        addq      $8, %r13                                      #4929.13
-        movq      %r13, %rdx                                    #4929.13
-        movdqa    -128(%rbp), %xmm4                             #
-        movdqa    -144(%rbp), %xmm3                             #
-        movdqa    -160(%rbp), %xmm2                             #
-        movdqa    -176(%rbp), %xmm1                             #
-                                # LOE rdx rbx r13 r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.16:                        # Preds ..B6.5 ..B6.39
-..LN669:
-   .loc    1  4797
-        movl      $8, %eax                                      #4797.13
-        jmp       ..B6.20       # Prob 100%                     #4797.13
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.17:                        # Preds ..B6.13
-..LN671:
-   .loc    1  4892
-        psrldq    $2, %xmm0                                     #4892.26
-..LN673:
-   .loc    1  4895
-        cmpq      %rbx, %rdx                                    #4895.26
-        jae       ..B6.19       # Prob 19%                      #4895.26
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.18:                        # Preds ..B6.17
-..LN675:
-   .loc    1  4896
-        movzbl    (%rdx), %esi                                  #4896.72
-..LN677:
-        lea       expand_2na.0(%rip), %rcx                      #4896.57
-        movzwl    (%rcx,%rsi,2), %edi                           #4896.57
-..LN679:
-        pinsrw    $7, %edi, %xmm0                               #4896.30
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.19:                        # Preds ..B6.18 ..B6.17
-..LN681:
-   .loc    1  4899
-        incq      %rdx                                          #4899.20
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.20:                        # Preds ..B6.16 ..B6.19 ..B6.32
-..LN683:
-   .loc    1  4807
-        movdqa    %xmm0, %xmm10                                 #4807.22
-..LN685:
-   .loc    1  4808
-        movdqa    %xmm0, %xmm9                                  #4808.22
-..LN687:
-   .loc    1  4807
-        pand      %xmm8, %xmm10                                 #4807.22
-..LN689:
-   .loc    1  4808
-        pand      %xmm7, %xmm9                                  #4808.22
-..LN691:
-   .loc    1  4809
-        pcmpeqd   %xmm9, %xmm10                                 #4809.22
-..LN693:
-   .loc    1  4810
-        pmovmskb  %xmm10, %ecx                                  #4810.22
-..LN695:
-   .loc    1  4811
-        incl      %ecx                                          #4811.17
-        shrl      $16, %ecx                                     #4811.17
-        negl      %ecx                                          #4811.17
-        jmp       ..B6.9        # Prob 100%                     #4811.17
-                                # LOE rdx rbx r13 eax ecx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.21:                        # Preds ..B6.11                 # Infreq
-..LN697:
-   .loc    1  4842
-        subl      %r14d, %r12d                                  #4842.30
-..LN699:
-        cmpl      $2, %r12d                                     #4842.37
-        je        ..B6.25       # Prob 25%                      #4842.37
-                                # LOE ecx esi edi r12d
-..B6.22:                        # Preds ..B6.21                 # Infreq
-        cmpl      $1, %r12d                                     #4842.37
-        je        ..B6.26       # Prob 33%                      #4842.37
-                                # LOE ecx edi r12d
-..B6.23:                        # Preds ..B6.22                 # Infreq
-        testl     %r12d, %r12d                                  #4842.37
-        je        ..B6.27       # Prob 50%                      #4842.37
-                                # LOE ecx
-..B6.24:                        # Preds ..B6.23                 # Infreq
-..LN701:
-   .loc    1  4845
-        movq      -48(%rbp), %rbx                               #4845.32
-..___tag_value_eval_4na_128.320:                                #
-        movq      -40(%rbp), %r12                               #4845.32
-..___tag_value_eval_4na_128.321:                                #
-        movq      -32(%rbp), %r13                               #4845.32
-..___tag_value_eval_4na_128.322:                                #
-        movq      -24(%rbp), %r14                               #4845.32
-..___tag_value_eval_4na_128.323:                                #
-        movl      $1, %eax                                      #4845.32
-        movq      -16(%rbp), %r15                               #4845.32
-..___tag_value_eval_4na_128.324:                                #
-        movq      %rbp, %rsp                                    #4845.32
-        popq      %rbp                                          #4845.32
-..___tag_value_eval_4na_128.325:                                #
-        ret                                                     #4845.32
-..___tag_value_eval_4na_128.326:                                #
-                                # LOE
-..B6.25:                        # Preds ..B6.21                 # Infreq
-..LN703:
-   .loc    1  4847
-        testl     %esi, %esi                                    #4847.36
-        jne       ..B6.28       # Prob 28%                      #4847.36
-                                # LOE ecx edi
-..B6.26:                        # Preds ..B6.22 ..B6.25         # Infreq
-..LN705:
-   .loc    1  4849
-        testl     %edi, %edi                                    #4849.36
-        jne       ..B6.28       # Prob 28%                      #4849.36
-                                # LOE ecx
-..B6.27:                        # Preds ..B6.26 ..B6.23         # Infreq
-..LN707:
-   .loc    1  4851
-        testl     %ecx, %ecx                                    #4851.36
-        je        ..B6.29       # Prob 50%                      #4851.36
-                                # LOE
-..B6.28:                        # Preds ..B6.25 ..B6.26 ..B6.27 # Infreq
-..LN709:
-        movq      -48(%rbp), %rbx                               #4851.47
-..___tag_value_eval_4na_128.332:                                #
-        movq      -40(%rbp), %r12                               #4851.47
-..___tag_value_eval_4na_128.333:                                #
-        movq      -32(%rbp), %r13                               #4851.47
-..___tag_value_eval_4na_128.334:                                #
-        movq      -24(%rbp), %r14                               #4851.47
-..___tag_value_eval_4na_128.335:                                #
-        movl      $1, %eax                                      #4851.47
-        movq      -16(%rbp), %r15                               #4851.47
-..___tag_value_eval_4na_128.336:                                #
-        movq      %rbp, %rsp                                    #4851.47
-        popq      %rbp                                          #4851.47
-..___tag_value_eval_4na_128.337:                                #
-        ret                                                     #4851.47
-..___tag_value_eval_4na_128.338:                                #
-                                # LOE
-..B6.29:                        # Preds ..B6.14 ..B6.12 ..B6.27 # Infreq
-..LN711:
-   .loc    1  4853
-        movq      -48(%rbp), %rbx                               #4853.28
-..___tag_value_eval_4na_128.344:                                #
-        movq      -40(%rbp), %r12                               #4853.28
-..___tag_value_eval_4na_128.345:                                #
-        movq      -32(%rbp), %r13                               #4853.28
-..___tag_value_eval_4na_128.346:                                #
-        movq      -24(%rbp), %r14                               #4853.28
-..___tag_value_eval_4na_128.347:                                #
-        xorl      %eax, %eax                                    #4853.28
-        movq      -16(%rbp), %r15                               #4853.28
-..___tag_value_eval_4na_128.348:                                #
-        movq      %rbp, %rsp                                    #4853.28
-        popq      %rbp                                          #4853.28
-..___tag_value_eval_4na_128.349:                                #
-        ret                                                     #4853.28
-..___tag_value_eval_4na_128.350:                                #
-                                # LOE
-..B6.32:                        # Preds ..B6.38                 # Infreq
-        movq      -176(%rbp), %rbx                              #
-        jmp       ..B6.20       # Prob 100%                     #
-        .align    16,0x90
-..___tag_value_eval_4na_128.356:                                #
-                                # LOE rdx rbx r13 eax r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-.LNeval_4na_128:
-	.data
-# -- End  eval_4na_128
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    16,0x90
-eval_4na_32:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B7.1:                         # Preds ..B7.0
-..___tag_value_eval_4na_32.357:                                 #4279.1
-..LN713:
-   .loc    1  4279
-        pushq     %rbp                                          #4279.1
-        movq      %rsp, %rbp                                    #4279.1
-..___tag_value_eval_4na_32.358:                                 #
-        subq      $256, %rsp                                    #4279.1
-        movq      %r15, -184(%rbp)                              #4279.1
-..___tag_value_eval_4na_32.360:                                 #
-        movq      %r14, -24(%rbp)                               #4279.1
-..___tag_value_eval_4na_32.361:                                 #
-        movq      %r13, -32(%rbp)                               #4279.1
-..___tag_value_eval_4na_32.362:                                 #
-        movq      %r12, -48(%rbp)                               #4279.1
-..___tag_value_eval_4na_32.363:                                 #
-        movq      %rbx, -40(%rbp)                               #4279.1
-..___tag_value_eval_4na_32.364:                                 #
-        movl      %ecx, %r12d                                   #4279.1
-        movl      %edx, %r13d                                   #4279.1
-        movq      %rsi, %r15                                    #4279.1
-        movq      %rdi, %rbx                                    #4279.1
-        lea       _gprof_pack6(%rip), %rdx                      #4279.1
-        call      mcount at PLT                                    #4279.1
-                                # LOE rbx r15 r12d r13d
-..B7.45:                        # Preds ..B7.1
-..LN715:
-   .loc    1  4312
-        lea       (%r13,%r12), %eax                             #4312.5
-..LN717:
-   .loc    1  4318
-        subl      4(%rbx), %eax                                 #4318.12
-..LN719:
-   .loc    1  4324
-        movl      %eax, -8(%rbp)                                #4324.14
-..LN721:
-   .loc    1  4315
-        movl      %r13d, %r14d                                  #4315.49
-        shrl      $2, %r14d                                     #4315.49
-..LN723:
-        lea       (%r15,%r14), %rdi                             #4315.30
-..LN725:
-   .loc    1  4321
-        lea       3(%r13,%r12), %esi                            #4321.50
-..LN727:
-        shrl      $2, %esi                                      #4321.57
-..LN729:
-        addq      %r15, %rsi                                    #4321.30
-        movq      %rsi, -16(%rbp)                               #4321.30
-..LN731:
-   .loc    1  4324
-        call      prime_buffer_4na at PLT                          #4324.14
-                                # LOE rbx r14 r15 r13d xmm0
-..B7.46:                        # Preds ..B7.45
-        movl      -8(%rbp), %eax                                #
-..LN733:
-   .loc    1  4331
-        movdqa    16(%rbx), %xmm7                               #4331.5
-        movdqa    32(%rbx), %xmm6                               #4331.5
-        movdqa    48(%rbx), %xmm5                               #4331.5
-        movdqa    64(%rbx), %xmm4                               #4331.5
-        movdqa    80(%rbx), %xmm3                               #4331.5
-        movdqa    96(%rbx), %xmm2                               #4331.5
-        movdqa    112(%rbx), %xmm1                              #4331.5
-        movdqa    128(%rbx), %xmm8                              #4331.5
-..LN735:
-   .loc    1  4325
-        lea       8(%r15,%r14), %r12                            #4325.5
-        movq      %r12, %rsi                                    #4325.5
-..LN737:
-   .loc    1  4334
-        xorl      %r15d, %r15d                                  #4334.15
-..LN739:
-        xorl      %r14d, %r14d                                  #4334.10
-..LN741:
-        xorl      %ecx, %ecx                                    #4334.5
-..LN743:
-   .loc    1  4340
-        movl      $2, %ebx                                      #4340.5
-..LN745:
-   .loc    1  4345
-        movl      %r13d, %edx                                   #4345.20
-        andl      $3, %edx                                      #4345.20
-        je        ..B7.37       # Prob 20%                      #4345.20
-                                # LOE rax rsi r12 eax edx ecx ebx r13d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.2:                         # Preds ..B7.46
-        cmpl      $1, %edx                                      #4345.20
-        je        ..B7.8        # Prob 25%                      #4345.20
-                                # LOE rax rsi r12 eax edx ecx ebx r13d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.3:                         # Preds ..B7.2
-        cmpl      $2, %edx                                      #4345.20
-        je        ..B7.7        # Prob 33%                      #4345.20
-                                # LOE rax rsi r12 eax edx ecx ebx r13d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.4:                         # Preds ..B7.3
-        cmpl      $3, %edx                                      #4345.20
-        je        ..B7.6        # Prob 50%                      #4345.20
-                                # LOE rax rsi r12 eax ecx ebx r13d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.5:                         # Preds ..B7.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -64(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -112(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -96(%rbp)                              #
-        movl      %eax, -8(%rbp)                                #
-        movl      %r13d, %eax                                   #
-        jmp       ..B7.29       # Prob 100%                     #
-                                # LOE rsi r12 eax xmm0
-..B7.6:                         # Preds ..B7.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -64(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -112(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -96(%rbp)                              #
-        movl      %eax, -8(%rbp)                                #
-        movl      %r13d, %eax                                   #
-        jmp       ..B7.11       # Prob 100%                     #
-                                # LOE rsi r12 eax ecx ebx r14d r15d xmm0
-..B7.7:                         # Preds ..B7.3
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -64(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -112(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -96(%rbp)                              #
-        movl      %eax, -8(%rbp)                                #
-        movl      %r13d, %eax                                   #
-        jmp       ..B7.10       # Prob 100%                     #
-                                # LOE rsi r12 eax ecx ebx r14d xmm0
-..B7.8:                         # Preds ..B7.2
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -64(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -112(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -96(%rbp)                              #
-        movl      %eax, -8(%rbp)                                #
-        movl      %r13d, %eax                                   #
-                                # LOE rsi r12 eax ecx ebx xmm0
-..B7.9:                         # Preds ..B7.8 ..B7.33
-..LN747:
-   .loc    1  4369
-        movdqa    %xmm0, %xmm2                                  #4369.22
-..LN749:
-   .loc    1  4370
-        movdqa    %xmm0, %xmm1                                  #4370.22
-..LN751:
-   .loc    1  4369
-        pand      -160(%rbp), %xmm2                             #4369.22
-..LN753:
-   .loc    1  4370
-        pand      -112(%rbp), %xmm1                             #4370.22
-..LN755:
-   .loc    1  4371
-        pcmpeqd   %xmm1, %xmm2                                  #4371.22
-..LN757:
-   .loc    1  4372
-        pmovmskb  %xmm2, %r14d                                  #4372.22
-                                # LOE rsi r12 eax ecx ebx r14d xmm0
-..B7.10:                        # Preds ..B7.7 ..B7.9
-..LN759:
-   .loc    1  4376
-        movdqa    %xmm0, %xmm2                                  #4376.22
-..LN761:
-   .loc    1  4377
-        movdqa    %xmm0, %xmm1                                  #4377.22
-..LN763:
-   .loc    1  4376
-        pand      -128(%rbp), %xmm2                             #4376.22
-..LN765:
-   .loc    1  4377
-        pand      -176(%rbp), %xmm1                             #4377.22
-..LN767:
-   .loc    1  4378
-        pcmpeqd   %xmm1, %xmm2                                  #4378.22
-..LN769:
-   .loc    1  4379
-        pmovmskb  %xmm2, %r15d                                  #4379.22
-                                # LOE rsi r12 eax ecx ebx r14d r15d xmm0
-..B7.11:                        # Preds ..B7.6 ..B7.10
-..LN771:
-   .loc    1  4383
-        movdqa    %xmm0, %xmm2                                  #4383.22
-..LN773:
-   .loc    1  4384
-        movdqa    %xmm0, %xmm1                                  #4384.22
-..LN775:
-   .loc    1  4383
-        pand      -64(%rbp), %xmm2                              #4383.22
-..LN777:
-   .loc    1  4384
-        pand      -80(%rbp), %xmm1                              #4384.22
-..LN779:
-   .loc    1  4385
-        pcmpeqd   %xmm1, %xmm2                                  #4385.22
-..LN781:
-   .loc    1  4386
-        pmovmskb  %xmm2, %edx                                   #4386.22
-..LN783:
-   .loc    1  4391
-        movl      %eax, %r13d                                   #4391.17
-        andl      $-4, %r13d                                    #4391.17
-..LN785:
-   .loc    1  4394
-        movl      %ecx, %eax                                    #4394.29
-        orl       %r14d, %eax                                   #4394.29
-..LN787:
-        orl       %r15d, %eax                                   #4394.34
-..LN789:
-        orl       %edx, %eax                                    #4394.39
-..LN791:
-        je        ..B7.24       # Prob 78%                      #4394.47
-                                # LOE rsi r12 edx ecx ebx r13d r14d r15d xmm0
-..B7.12:                        # Preds ..B7.11
-..LN793:
-   .loc    1  4412
-        movdqa    %xmm0, -256(%rbp)                             #4412.30
-        movl      %ecx, %edi                                    #4412.30
-        movl      %edx, -216(%rbp)                              #4412.30
-        movl      %ecx, -208(%rbp)                              #4412.30
-        movq      %rsi, -200(%rbp)                              #4412.30
-        call      uint16_lsbit at PLT                              #4412.30
-                                # LOE r12 eax ebx r13d r14d r15d
-..B7.47:                        # Preds ..B7.12
-        movq      -200(%rbp), %rsi                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r12 eax edx ecx ebx r13d r14d r15d dl cl dh ch xmm0
-..B7.13:                        # Preds ..B7.47
-..LN795:
-   .loc    1  4413
-        movdqa    %xmm0, -256(%rbp)                             #4413.30
-        movl      %r14d, %edi                                   #4413.30
-        movl      %edx, -216(%rbp)                              #4413.30
-..LN797:
-   .loc    1  4412
-        movswq    %ax, %rax                                     #4412.30
-        movl      %eax, -240(%rbp)                              #4412.30
-..LN799:
-   .loc    1  4413
-        movl      %ecx, -208(%rbp)                              #4413.30
-        movq      %rsi, -200(%rbp)                              #4413.30
-        call      uint16_lsbit at PLT                              #4413.30
-                                # LOE r12 eax ebx r13d r14d r15d
-..B7.48:                        # Preds ..B7.13
-        movq      -200(%rbp), %rsi                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r12 eax edx ecx ebx r13d r14d r15d dl cl dh ch xmm0
-..B7.14:                        # Preds ..B7.48
-..LN801:
-   .loc    1  4414
-        movdqa    %xmm0, -256(%rbp)                             #4414.30
-        movl      %r15d, %edi                                   #4414.30
-        movl      %edx, -216(%rbp)                              #4414.30
-..LN803:
-   .loc    1  4413
-        movswq    %ax, %rax                                     #4413.30
-        movl      %eax, -224(%rbp)                              #4413.30
-..LN805:
-   .loc    1  4414
-        movl      %ecx, -208(%rbp)                              #4414.30
-        movq      %rsi, -200(%rbp)                              #4414.30
-        call      uint16_lsbit at PLT                              #4414.30
-                                # LOE r12 eax ebx r13d r14d r15d
-..B7.49:                        # Preds ..B7.14
-        movq      -200(%rbp), %rsi                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r12 eax edx ecx ebx r13d r14d r15d dl cl dh ch xmm0
-..B7.15:                        # Preds ..B7.49
-..LN807:
-   .loc    1  4415
-        movdqa    %xmm0, -256(%rbp)                             #4415.30
-        movl      %edx, %edi                                    #4415.30
-        movl      %edx, -216(%rbp)                              #4415.30
-..LN809:
-   .loc    1  4414
-        movswq    %ax, %rax                                     #4414.30
-        movl      %eax, -232(%rbp)                              #4414.30
-..LN811:
-   .loc    1  4415
-        movl      %ecx, -208(%rbp)                              #4415.30
-        movq      %rsi, -200(%rbp)                              #4415.30
-        call      uint16_lsbit at PLT                              #4415.30
-                                # LOE r12 eax ebx r13d r14d r15d
-..B7.50:                        # Preds ..B7.15
-        movq      -200(%rbp), %rsi                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r12 eax edx ecx ebx r13d r14d r15d dl cl dh ch xmm0
-..B7.16:                        # Preds ..B7.50
-..LN813:
-   .loc    1  4422
-        movl      -232(%rbp), %r9d                              #4422.40
-..LN815:
-   .loc    1  4415
-        movswq    %ax, %r8                                      #4415.30
-..LN817:
-   .loc    1  4421
-        movl      -224(%rbp), %eax                              #4421.40
-..LN819:
-   .loc    1  4415
-..LN821:
-   .loc    1  4421
-        lea       1(%rax,%rax), %eax                            #4421.40
-..LN823:
-   .loc    1  4422
-        lea       2(%r9,%r9), %r9d                              #4422.40
-..LN825:
-   .loc    1  4423
-        lea       3(%r8,%r8), %r10d                             #4423.40
-..LN827:
-   .loc    1  4427
-        testl     %ecx, %ecx                                    #4427.32
-        je        ..B7.18       # Prob 50%                      #4427.32
-                                # LOE rdx rsi r12 eax edx ebx r9d r10d r13d r14d r15d dl dh xmm0
-..B7.17:                        # Preds ..B7.16
-..LN829:
-        movl      -240(%rbp), %ecx                              #4427.43
-        lea       (%r13,%rcx,2), %r8d                           #4427.43
-..LN831:
-        cmpl      -8(%rbp), %r8d                                #4427.49
-        jbe       ..B7.38       # Prob 20%                      #4427.49
-                                # LOE rdx rsi r12 eax edx ebx r9d r10d r13d r14d r15d dl dh xmm0
-..B7.18:                        # Preds ..B7.17 ..B7.16
-..LN833:
-   .loc    1  4428
-        testl     %r14d, %r14d                                  #4428.32
-        je        ..B7.20       # Prob 50%                      #4428.32
-                                # LOE rdx rsi r12 eax edx ebx r9d r10d r13d r15d dl dh xmm0
-..B7.19:                        # Preds ..B7.18
-..LN835:
-        addl      %r13d, %eax                                   #4428.43
-..LN837:
-        cmpl      -8(%rbp), %eax                                #4428.49
-        jbe       ..B7.38       # Prob 20%                      #4428.49
-                                # LOE rdx rsi r12 edx ebx r9d r10d r13d r15d dl dh xmm0
-..B7.20:                        # Preds ..B7.19 ..B7.18
-..LN839:
-   .loc    1  4429
-        testl     %r15d, %r15d                                  #4429.32
-        je        ..B7.22       # Prob 50%                      #4429.32
-                                # LOE rdx rsi r12 edx ebx r9d r10d r13d dl dh xmm0
-..B7.21:                        # Preds ..B7.20
-..LN841:
-        addl      %r13d, %r9d                                   #4429.43
-..LN843:
-        cmpl      -8(%rbp), %r9d                                #4429.49
-        jbe       ..B7.38       # Prob 20%                      #4429.49
-                                # LOE rdx rsi r12 edx ebx r10d r13d dl dh xmm0
-..B7.22:                        # Preds ..B7.21 ..B7.20
-..LN845:
-   .loc    1  4430
-        testl     %edx, %edx                                    #4430.32
-        je        ..B7.24       # Prob 50%                      #4430.32
-                                # LOE rsi r12 ebx r10d r13d xmm0
-..B7.23:                        # Preds ..B7.22
-..LN847:
-        addl      %r13d, %r10d                                  #4430.43
-..LN849:
-        cmpl      -8(%rbp), %r10d                               #4430.49
-        jbe       ..B7.38       # Prob 20%                      #4430.49
-                                # LOE rsi r12 ebx r13d xmm0
-..B7.24:                        # Preds ..B7.23 ..B7.22 ..B7.11
-..LN851:
-   .loc    1  4435
-        lea       4(%r13), %eax                                 #4435.17
-..LN853:
-   .loc    1  4438
-        cmpl      -8(%rbp), %eax                                #4438.28
-        ja        ..B7.35       # Prob 20%                      #4438.28
-                                # LOE rsi r12 eax ebx r13d xmm0
-..B7.25:                        # Preds ..B7.24
-..LN855:
-   .loc    1  4442
-        decl      %ebx                                          #4442.25
-..LN857:
-        jne       ..B7.30       # Prob 50%                      #4442.39
-                                # LOE rsi r12 eax ebx r13d xmm0
-..B7.26:                        # Preds ..B7.25
-..LN859:
-   .loc    1  4459
-        cmpq      -16(%rbp), %r12                               #4459.25
-        jae       ..B7.35       # Prob 4%                       #4459.25
-                                # LOE r12 r13d
-..B7.27:                        # Preds ..B7.26
-..LN861:
-   .loc    1  4463
-        lea       28(%r13), %eax                                #4463.13
-..LN863:
-   .loc    1  4464
-        cmpl      -8(%rbp), %eax                                #4464.24
-        ja        ..B7.35       # Prob 4%                       #4464.24
-                                # LOE r12 eax
-..B7.28:                        # Preds ..B7.27
-..LN865:
-   .loc    1  4469
-        movq      -16(%rbp), %rsi                               #4469.22
-        movl      %eax, -192(%rbp)                              #4469.22
-        movq      %r12, %rdi                                    #4469.22
-        call      prime_buffer_4na at PLT                          #4469.22
-                                # LOE r12 xmm0
-..B7.51:                        # Preds ..B7.28
-        movl      -192(%rbp), %eax                              #
-..LN867:
-   .loc    1  4484
-        addq      $8, %r12                                      #4484.13
-        movq      %r12, %rsi                                    #4484.13
-                                # LOE rsi r12 eax xmm0
-..B7.29:                        # Preds ..B7.5 ..B7.51
-..LN869:
-   .loc    1  4352
-        movl      $2, %ebx                                      #4352.13
-        jmp       ..B7.33       # Prob 100%                     #4352.13
-                                # LOE rsi r12 eax ebx xmm0
-..B7.30:                        # Preds ..B7.25
-..LN871:
-   .loc    1  4450
-        cmpq      -16(%rbp), %rsi                               #4450.26
-..LN873:
-   .loc    1  4447
-        psrldq    $2, %xmm0                                     #4447.26
-..LN875:
-   .loc    1  4450
-        jae       ..B7.32       # Prob 19%                      #4450.26
-                                # LOE rsi r12 eax ebx xmm0
-..B7.31:                        # Preds ..B7.30
-..LN877:
-   .loc    1  4451
-        movzbl    (%rsi), %ecx                                  #4451.72
-..LN879:
-        lea       expand_2na.0(%rip), %rdx                      #4451.57
-        movzwl    (%rdx,%rcx,2), %edi                           #4451.57
-..LN881:
-        pinsrw    $7, %edi, %xmm0                               #4451.30
-                                # LOE rsi r12 eax ebx xmm0
-..B7.32:                        # Preds ..B7.31 ..B7.30
-..LN883:
-   .loc    1  4454
-        incq      %rsi                                          #4454.20
-                                # LOE rsi r12 eax ebx xmm0
-..B7.33:                        # Preds ..B7.29 ..B7.32 ..B7.37
-..LN885:
-   .loc    1  4362
-        movdqa    %xmm0, %xmm2                                  #4362.22
-..LN887:
-   .loc    1  4363
-        movdqa    %xmm0, %xmm1                                  #4363.22
-..LN889:
-   .loc    1  4362
-        pand      -96(%rbp), %xmm2                              #4362.22
-..LN891:
-   .loc    1  4363
-        pand      -144(%rbp), %xmm1                             #4363.22
-..LN893:
-   .loc    1  4364
-        pcmpeqd   %xmm1, %xmm2                                  #4364.22
-..LN895:
-   .loc    1  4365
-        pmovmskb  %xmm2, %ecx                                   #4365.22
-        jmp       ..B7.9        # Prob 100%                     #4365.22
-                                # LOE rsi r12 eax ecx ebx xmm0
-..B7.35:                        # Preds ..B7.24 ..B7.26 ..B7.27 # Infreq
-..LN897:
-   .loc    1  4495
-        movq      -40(%rbp), %rbx                               #4495.12
-..___tag_value_eval_4na_32.365:                                 #
-        movq      -48(%rbp), %r12                               #4495.12
-..___tag_value_eval_4na_32.366:                                 #
-        movq      -32(%rbp), %r13                               #4495.12
-..___tag_value_eval_4na_32.367:                                 #
-        movq      -24(%rbp), %r14                               #4495.12
-..___tag_value_eval_4na_32.368:                                 #
-        xorl      %eax, %eax                                    #4495.12
-        movq      -184(%rbp), %r15                              #4495.12
-..___tag_value_eval_4na_32.369:                                 #
-        movq      %rbp, %rsp                                    #4495.12
-        popq      %rbp                                          #4495.12
-..___tag_value_eval_4na_32.370:                                 #
-        ret                                                     #4495.12
-..___tag_value_eval_4na_32.371:                                 #
-                                # LOE
-..B7.37:                        # Preds ..B7.46                 # Infreq
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -64(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -112(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -96(%rbp)                              #
-        movl      %eax, -8(%rbp)                                #
-        movl      %r13d, %eax                                   #
-        jmp       ..B7.33       # Prob 100%                     #
-                                # LOE rsi r12 eax ebx xmm0
-..B7.38:                        # Preds ..B7.17 ..B7.23 ..B7.21 ..B7.19 # Infreq
-..LN899:
-   .loc    1  4428
-        movq      -40(%rbp), %rbx                               #4428.63
-..___tag_value_eval_4na_32.377:                                 #
-        movq      -48(%rbp), %r12                               #4428.63
-..___tag_value_eval_4na_32.378:                                 #
-        movq      -32(%rbp), %r13                               #4428.63
-..___tag_value_eval_4na_32.379:                                 #
-        movq      -24(%rbp), %r14                               #4428.63
-..___tag_value_eval_4na_32.380:                                 #
-        movl      $1, %eax                                      #4428.63
-        movq      -184(%rbp), %r15                              #4428.63
-..___tag_value_eval_4na_32.381:                                 #
-        movq      %rbp, %rsp                                    #4428.63
-        popq      %rbp                                          #4428.63
-..___tag_value_eval_4na_32.382:                                 #
-        ret                                                     #4428.63
-        .align    16,0x90
-..___tag_value_eval_4na_32.383:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-.LNeval_4na_32:
-	.data
-# -- End  eval_4na_32
-	.text
-# -- Begin  uint16_lsbit
-# mark_begin;
-       .align    16,0x90
-uint16_lsbit:
-# parameter 1(self): %edi
-..B8.1:                         # Preds ..B8.0
-..___tag_value_uint16_lsbit.384:                                #38.1
-..LN901:
-  .file   2 "/home/yaschenk/devel/internal/asm-trace/inc/gcc/x86_64/arch-impl.h"
-   .loc    2  38
-        pushq     %rbp                                          #38.1
-        movq      %rsp, %rbp                                    #38.1
-..___tag_value_uint16_lsbit.385:                                #
-        subq      $16, %rsp                                     #38.1
-        movq      %rbx, -16(%rbp)                               #38.1
-..___tag_value_uint16_lsbit.387:                                #
-        movl      %edi, %ebx                                    #38.1
-        lea       _gprof_pack7(%rip), %rdx                      #38.1
-        call      mcount at PLT                                    #38.1
-                                # LOE r12 r13 r14 r15 ebx
-..B8.4:                         # Preds ..B8.1
-..LN903:
-   .loc    2  40
-        movl      %ebx, %eax                                    #40.0
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #40.0
-..LN905:
-   .loc    2  49
-        movq      -16(%rbp), %rbx                               #49.12
-..___tag_value_uint16_lsbit.388:                                #
-        movq      %rbp, %rsp                                    #49.12
-        popq      %rbp                                          #49.12
-..___tag_value_uint16_lsbit.389:                                #
-        ret                                                     #49.12
-        .align    16,0x90
-..___tag_value_uint16_lsbit.390:                                #
-                                # LOE
-# mark_end;
-	.type	uint16_lsbit, at function
-	.size	uint16_lsbit,.-uint16_lsbit
-.LNuint16_lsbit:
-	.data
-# -- End  uint16_lsbit
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    16,0x90
-eval_4na_16:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B9.1:                         # Preds ..B9.0
-..___tag_value_eval_4na_16.391:                                 #4057.1
-..LN907:
-   .loc    1  4057
-        pushq     %rbp                                          #4057.1
-        movq      %rsp, %rbp                                    #4057.1
-..___tag_value_eval_4na_16.392:                                 #
-        subq      $224, %rsp                                    #4057.1
-        movq      %r15, -48(%rbp)                               #4057.1
-..___tag_value_eval_4na_16.394:                                 #
-        movq      %r14, -40(%rbp)                               #4057.1
-..___tag_value_eval_4na_16.395:                                 #
-        movq      %r13, -32(%rbp)                               #4057.1
-..___tag_value_eval_4na_16.396:                                 #
-        movq      %r12, -24(%rbp)                               #4057.1
-..___tag_value_eval_4na_16.397:                                 #
-        movq      %rbx, -56(%rbp)                               #4057.1
-..___tag_value_eval_4na_16.398:                                 #
-        movl      %ecx, %ebx                                    #4057.1
-        movl      %edx, %r12d                                   #4057.1
-        movq      %rsi, %r15                                    #4057.1
-        movq      %rdi, %r13                                    #4057.1
-        lea       _gprof_pack8(%rip), %rdx                      #4057.1
-        call      mcount at PLT                                    #4057.1
-                                # LOE r13 r15 ebx r12d
-..B9.40:                        # Preds ..B9.1
-..LN909:
-   .loc    1  4090
-        lea       (%r12,%rbx), %eax                             #4090.5
-..LN911:
-   .loc    1  4096
-        subl      4(%r13), %eax                                 #4096.12
-..LN913:
-   .loc    1  4102
-        movl      %eax, -224(%rbp)                              #4102.14
-..LN915:
-   .loc    1  4093
-        movl      %r12d, %r14d                                  #4093.49
-        shrl      $2, %r14d                                     #4093.49
-..LN917:
-        lea       (%r15,%r14), %rdi                             #4093.30
-..LN919:
-   .loc    1  4099
-        lea       3(%r12,%rbx), %esi                            #4099.50
-..LN921:
-        shrl      $2, %esi                                      #4099.57
-..LN923:
-        addq      %r15, %rsi                                    #4099.30
-        movq      %rsi, -16(%rbp)                               #4099.30
-..LN925:
-   .loc    1  4102
-        call      prime_buffer_4na at PLT                          #4102.14
-                                # LOE r13 r14 r15 r12d xmm0
-..B9.41:                        # Preds ..B9.40
-        movl      -224(%rbp), %eax                              #
-..LN927:
-   .loc    1  4109
-        movdqa    16(%r13), %xmm7                               #4109.5
-        movdqa    32(%r13), %xmm6                               #4109.5
-        movdqa    48(%r13), %xmm5                               #4109.5
-        movdqa    64(%r13), %xmm4                               #4109.5
-        movdqa    80(%r13), %xmm3                               #4109.5
-        movdqa    96(%r13), %xmm2                               #4109.5
-        movdqa    112(%r13), %xmm1                              #4109.5
-        movdqa    128(%r13), %xmm8                              #4109.5
-..LN929:
-   .loc    1  4103
-        lea       8(%r15,%r14), %rbx                            #4103.5
-..LN931:
-   .loc    1  4112
-        xorl      %r14d, %r14d                                  #4112.15
-..LN933:
-        xorl      %r15d, %r15d                                  #4112.10
-..LN935:
-        xorl      %edx, %edx                                    #4112.5
-..LN937:
-   .loc    1  4123
-        movl      %r12d, %ecx                                   #4123.20
-        andl      $3, %ecx                                      #4123.20
-        je        ..B9.5        # Prob 20%                      #4123.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.2:                         # Preds ..B9.41
-        cmpl      $1, %ecx                                      #4123.20
-        je        ..B9.8        # Prob 25%                      #4123.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.3:                         # Preds ..B9.2
-        cmpl      $2, %ecx                                      #4123.20
-        je        ..B9.7        # Prob 33%                      #4123.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.4:                         # Preds ..B9.3
-        cmpl      $3, %ecx                                      #4123.20
-        je        ..B9.6        # Prob 50%                      #4123.20
-                                # LOE rax rbx eax edx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.5:                         # Preds ..B9.41 ..B9.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -144(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -112(%rbp)                             #
-        movdqa    %xmm4, -96(%rbp)                              #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -192(%rbp)                             #
-        movdqa    %xmm7, -176(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B9.28       # Prob 100%                     #
-                                # LOE rbx r12d r13d xmm0
-..B9.6:                         # Preds ..B9.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -144(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -112(%rbp)                             #
-        movdqa    %xmm4, -96(%rbp)                              #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -192(%rbp)                             #
-        movdqa    %xmm7, -176(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B9.11       # Prob 100%                     #
-                                # LOE rbx edx r12d r13d r14d r15d xmm0
-..B9.7:                         # Preds ..B9.3
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -144(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -112(%rbp)                             #
-        movdqa    %xmm4, -96(%rbp)                              #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -192(%rbp)                             #
-        movdqa    %xmm7, -176(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B9.10       # Prob 100%                     #
-                                # LOE rbx edx r12d r13d r15d xmm0
-..B9.8:                         # Preds ..B9.2
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -144(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -112(%rbp)                             #
-        movdqa    %xmm4, -96(%rbp)                              #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -192(%rbp)                             #
-        movdqa    %xmm7, -176(%rbp)                             #
-        movl      %eax, %r13d                                   #
-                                # LOE rbx edx r12d r13d xmm0
-..B9.9:                         # Preds ..B9.8 ..B9.28
-..LN939:
-   .loc    1  4147
-        movdqa    %xmm0, %xmm2                                  #4147.22
-..LN941:
-   .loc    1  4148
-        movdqa    %xmm0, %xmm1                                  #4148.22
-..LN943:
-   .loc    1  4147
-        pand      -128(%rbp), %xmm2                             #4147.22
-..LN945:
-   .loc    1  4148
-        pand      -96(%rbp), %xmm1                              #4148.22
-..LN947:
-   .loc    1  4149
-        pcmpeqw   %xmm1, %xmm2                                  #4149.22
-..LN949:
-   .loc    1  4150
-        pmovmskb  %xmm2, %r15d                                  #4150.22
-                                # LOE rbx edx r12d r13d r15d xmm0
-..B9.10:                        # Preds ..B9.7 ..B9.9
-..LN951:
-   .loc    1  4154
-        movdqa    %xmm0, %xmm2                                  #4154.22
-..LN953:
-   .loc    1  4155
-        movdqa    %xmm0, %xmm1                                  #4155.22
-..LN955:
-   .loc    1  4154
-        pand      -112(%rbp), %xmm2                             #4154.22
-..LN957:
-   .loc    1  4155
-        pand      -160(%rbp), %xmm1                             #4155.22
-..LN959:
-   .loc    1  4156
-        pcmpeqw   %xmm1, %xmm2                                  #4156.22
-..LN961:
-   .loc    1  4157
-        pmovmskb  %xmm2, %r14d                                  #4157.22
-                                # LOE rbx edx r12d r13d r14d r15d xmm0
-..B9.11:                        # Preds ..B9.6 ..B9.10
-..LN963:
-   .loc    1  4161
-        movdqa    %xmm0, %xmm1                                  #4161.22
-..LN965:
-   .loc    1  4162
-        pand      -80(%rbp), %xmm0                              #4162.22
-..LN967:
-   .loc    1  4161
-        pand      -144(%rbp), %xmm1                             #4161.22
-..LN969:
-   .loc    1  4163
-        pcmpeqw   %xmm0, %xmm1                                  #4163.22
-..LN971:
-   .loc    1  4164
-        pmovmskb  %xmm1, %ecx                                   #4164.22
-        movl      %ecx, -64(%rbp)                               #4164.22
-..LN973:
-   .loc    1  4169
-        andl      $-4, %r12d                                    #4169.17
-..LN975:
-   .loc    1  4172
-        movl      %edx, %esi                                    #4172.29
-        orl       %r15d, %esi                                   #4172.29
-..LN977:
-        orl       %r14d, %esi                                   #4172.34
-..LN979:
-        orl       %ecx, %esi                                    #4172.39
-..LN981:
-        je        ..B9.24       # Prob 78%                      #4172.47
-                                # LOE rbx edx r12d r13d r14d r15d
-..B9.12:                        # Preds ..B9.11
-..LN983:
-   .loc    1  4190
-        movl      %edx, -200(%rbp)                              #4190.30
-        movl      %edx, %edi                                    #4190.30
-        call      uint16_lsbit at PLT                              #4190.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B9.42:                        # Preds ..B9.12
-        movl      -200(%rbp), %edx                              #
-                                # LOE rdx rbx eax edx r12d r13d r14d r15d dl dh
-..B9.13:                        # Preds ..B9.42
-..LN985:
-   .loc    1  4191
-        movl      %edx, -200(%rbp)                              #4191.30
-..LN987:
-   .loc    1  4190
-        movswq    %ax, %rcx                                     #4190.30
-        movl      %ecx, -224(%rbp)                              #4190.30
-..LN989:
-   .loc    1  4191
-        movl      %r15d, %edi                                   #4191.30
-        call      uint16_lsbit at PLT                              #4191.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B9.43:                        # Preds ..B9.13
-        movl      -200(%rbp), %edx                              #
-                                # LOE rdx rbx eax edx r12d r13d r14d r15d dl dh
-..B9.14:                        # Preds ..B9.43
-..LN991:
-   .loc    1  4192
-        movl      %edx, -200(%rbp)                              #4192.30
-..LN993:
-   .loc    1  4191
-        movswq    %ax, %rcx                                     #4191.30
-        movl      %ecx, -216(%rbp)                              #4191.30
-..LN995:
-   .loc    1  4192
-        movl      %r14d, %edi                                   #4192.30
-        call      uint16_lsbit at PLT                              #4192.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B9.44:                        # Preds ..B9.14
-        movl      -200(%rbp), %edx                              #
-                                # LOE rdx rbx eax edx r12d r13d r14d r15d dl dh
-..B9.15:                        # Preds ..B9.44
-..LN997:
-   .loc    1  4193
-        movl      -64(%rbp), %edi                               #4193.30
-        movl      %edx, -200(%rbp)                              #4193.30
-..LN999:
-   .loc    1  4192
-        movswq    %ax, %rcx                                     #4192.30
-        movl      %ecx, -208(%rbp)                              #4192.30
-..LN1001:
-   .loc    1  4193
-        call      uint16_lsbit at PLT                              #4193.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B9.45:                        # Preds ..B9.15
-        movl      -200(%rbp), %edx                              #
-                                # LOE rdx rbx eax edx r12d r13d r14d r15d dl dh
-..B9.16:                        # Preds ..B9.45
-..LN1003:
-   .loc    1  4199
-        movl      -216(%rbp), %esi                              #4199.40
-..LN1005:
-   .loc    1  4200
-        movl      -208(%rbp), %r8d                              #4200.40
-..LN1007:
-   .loc    1  4193
-        movswq    %ax, %rcx                                     #4193.30
-..LN1009:
-   .loc    1  4199
-        lea       1(%rsi,%rsi), %esi                            #4199.40
-..LN1011:
-   .loc    1  4200
-        lea       2(%r8,%r8), %r8d                              #4200.40
-..LN1013:
-   .loc    1  4201
-        lea       3(%rcx,%rcx), %r9d                            #4201.40
-..LN1015:
-   .loc    1  4205
-        testl     %edx, %edx                                    #4205.32
-        je        ..B9.18       # Prob 50%                      #4205.32
-                                # LOE rbx esi r8d r9d r12d r13d r14d r15d
-..B9.17:                        # Preds ..B9.16
-..LN1017:
-        movl      -224(%rbp), %edx                              #4205.43
-        lea       (%r12,%rdx,2), %ecx                           #4205.43
-..LN1019:
-        cmpl      %ecx, %r13d                                   #4205.49
-        jae       ..B9.33       # Prob 20%                      #4205.49
-                                # LOE rbx esi r8d r9d r12d r13d r14d r15d
-..B9.18:                        # Preds ..B9.17 ..B9.16
-..LN1021:
-   .loc    1  4206
-        testl     %r15d, %r15d                                  #4206.32
-        je        ..B9.20       # Prob 50%                      #4206.32
-                                # LOE rbx esi r8d r9d r12d r13d r14d
-..B9.19:                        # Preds ..B9.18
-..LN1023:
-        addl      %r12d, %esi                                   #4206.43
-..LN1025:
-        cmpl      %esi, %r13d                                   #4206.49
-        jae       ..B9.33       # Prob 20%                      #4206.49
-                                # LOE rbx r8d r9d r12d r13d r14d
-..B9.20:                        # Preds ..B9.19 ..B9.18
-..LN1027:
-   .loc    1  4207
-        testl     %r14d, %r14d                                  #4207.32
-        je        ..B9.22       # Prob 50%                      #4207.32
-                                # LOE rbx r8d r9d r12d r13d
-..B9.21:                        # Preds ..B9.20
-..LN1029:
-        addl      %r12d, %r8d                                   #4207.43
-..LN1031:
-        cmpl      %r8d, %r13d                                   #4207.49
-        jae       ..B9.33       # Prob 20%                      #4207.49
-                                # LOE rbx r9d r12d r13d
-..B9.22:                        # Preds ..B9.21 ..B9.20
-..LN1033:
-   .loc    1  4208
-        movl      -64(%rbp), %edx                               #4208.32
-        testl     %edx, %edx                                    #4208.32
-        je        ..B9.24       # Prob 50%                      #4208.32
-                                # LOE rbx r9d r12d r13d
-..B9.23:                        # Preds ..B9.22
-..LN1035:
-        addl      %r12d, %r9d                                   #4208.43
-..LN1037:
-        cmpl      %r9d, %r13d                                   #4208.49
-        jae       ..B9.33       # Prob 20%                      #4208.49
-                                # LOE rbx r12d r13d
-..B9.24:                        # Preds ..B9.23 ..B9.22 ..B9.11
-..LN1039:
-   .loc    1  4241
-        lea       4(%r12), %edx                                 #4241.13
-..LN1041:
-   .loc    1  4216
-        cmpl      %edx, %r13d                                   #4216.28
-        jb        ..B9.30       # Prob 20%                      #4216.28
-                                # LOE rbx r12d r13d
-..B9.25:                        # Preds ..B9.24
-..LN1043:
-   .loc    1  4237
-        cmpq      -16(%rbp), %rbx                               #4237.25
-        jae       ..B9.30       # Prob 4%                       #4237.25
-                                # LOE rbx r12d r13d
-..B9.26:                        # Preds ..B9.25
-..LN1045:
-   .loc    1  4241
-        addl      $32, %r12d                                    #4241.13
-..LN1047:
-   .loc    1  4242
-        cmpl      %r13d, %r12d                                  #4242.24
-        ja        ..B9.30       # Prob 4%                       #4242.24
-                                # LOE rbx r12d r13d
-..B9.27:                        # Preds ..B9.26
-..LN1049:
-   .loc    1  4247
-        movq      -16(%rbp), %rsi                               #4247.22
-        movq      %rbx, %rdi                                    #4247.22
-        call      prime_buffer_4na at PLT                          #4247.22
-                                # LOE rbx r12d r13d xmm0
-..B9.46:                        # Preds ..B9.27
-..LN1051:
-   .loc    1  4262
-        addq      $8, %rbx                                      #4262.13
-                                # LOE rbx r12d r13d xmm0
-..B9.28:                        # Preds ..B9.5 ..B9.46
-..LN1053:
-   .loc    1  4140
-        movdqa    %xmm0, %xmm2                                  #4140.22
-..LN1055:
-   .loc    1  4141
-        movdqa    %xmm0, %xmm1                                  #4141.22
-..LN1057:
-   .loc    1  4140
-        pand      -176(%rbp), %xmm2                             #4140.22
-..LN1059:
-   .loc    1  4141
-        pand      -192(%rbp), %xmm1                             #4141.22
-..LN1061:
-   .loc    1  4142
-        pcmpeqw   %xmm1, %xmm2                                  #4142.22
-..LN1063:
-   .loc    1  4143
-        pmovmskb  %xmm2, %edx                                   #4143.22
-        jmp       ..B9.9        # Prob 100%                     #4143.22
-                                # LOE rbx edx r12d r13d xmm0
-..B9.30:                        # Preds ..B9.24 ..B9.25 ..B9.26 # Infreq
-..LN1065:
-   .loc    1  4273
-        movq      -56(%rbp), %rbx                               #4273.12
-..___tag_value_eval_4na_16.399:                                 #
-        movq      -24(%rbp), %r12                               #4273.12
-..___tag_value_eval_4na_16.400:                                 #
-        movq      -32(%rbp), %r13                               #4273.12
-..___tag_value_eval_4na_16.401:                                 #
-        movq      -40(%rbp), %r14                               #4273.12
-..___tag_value_eval_4na_16.402:                                 #
-        xorl      %eax, %eax                                    #4273.12
-        movq      -48(%rbp), %r15                               #4273.12
-..___tag_value_eval_4na_16.403:                                 #
-        movq      %rbp, %rsp                                    #4273.12
-        popq      %rbp                                          #4273.12
-..___tag_value_eval_4na_16.404:                                 #
-        ret                                                     #4273.12
-..___tag_value_eval_4na_16.405:                                 #
-                                # LOE
-..B9.33:                        # Preds ..B9.23 ..B9.21 ..B9.19 ..B9.17 # Infreq
-..LN1067:
-   .loc    1  4205
-        movq      -56(%rbp), %rbx                               #4205.63
-..___tag_value_eval_4na_16.411:                                 #
-        movq      -24(%rbp), %r12                               #4205.63
-..___tag_value_eval_4na_16.412:                                 #
-        movq      -32(%rbp), %r13                               #4205.63
-..___tag_value_eval_4na_16.413:                                 #
-        movq      -40(%rbp), %r14                               #4205.63
-..___tag_value_eval_4na_16.414:                                 #
-        movl      $1, %eax                                      #4205.63
-        movq      -48(%rbp), %r15                               #4205.63
-..___tag_value_eval_4na_16.415:                                 #
-        movq      %rbp, %rsp                                    #4205.63
-        popq      %rbp                                          #4205.63
-..___tag_value_eval_4na_16.416:                                 #
-        ret                                                     #4205.63
-        .align    16,0x90
-..___tag_value_eval_4na_16.417:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-.LNeval_4na_16:
-	.data
-# -- End  eval_4na_16
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    16,0x90
-eval_2na_128:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B10.1:                        # Preds ..B10.0
-..___tag_value_eval_2na_128.418:                                #3369.1
-..LN1069:
-   .loc    1  3369
-        pushq     %rbp                                          #3369.1
-        movq      %rsp, %rbp                                    #3369.1
-..___tag_value_eval_2na_128.419:                                #
-        subq      $176, %rsp                                    #3369.1
-        movq      %r15, -40(%rbp)                               #3369.1
-..___tag_value_eval_2na_128.421:                                #
-        movq      %r14, -24(%rbp)                               #3369.1
-..___tag_value_eval_2na_128.422:                                #
-        movq      %r13, -32(%rbp)                               #3369.1
-..___tag_value_eval_2na_128.423:                                #
-        movq      %r12, -16(%rbp)                               #3369.1
-..___tag_value_eval_2na_128.424:                                #
-        movq      %rbx, -48(%rbp)                               #3369.1
-..___tag_value_eval_2na_128.425:                                #
-        movl      %ecx, %r13d                                   #3369.1
-        movl      %edx, %r12d                                   #3369.1
-        movq      %rsi, %rbx                                    #3369.1
-        movq      %rdi, %r15                                    #3369.1
-        lea       _gprof_pack9(%rip), %rdx                      #3369.1
-        call      mcount at PLT                                    #3369.1
-                                # LOE rbx r15 r12d r13d
-..B10.40:                       # Preds ..B10.1
-..LN1071:
-   .loc    1  3406
-        lea       (%r12,%r13), %r14d                            #3406.5
-..LN1073:
-   .loc    1  3412
-        subl      4(%r15), %r14d                                #3412.12
-..LN1075:
-   .loc    1  3409
-        movl      %r12d, %eax                                   #3409.49
-        shrl      $2, %eax                                      #3409.49
-..LN1077:
-        movq      %rax, -176(%rbp)                              #3409.30
-        lea       (%rbx,%rax), %rdi                             #3409.30
-..LN1079:
-   .loc    1  3415
-        lea       3(%r12,%r13), %r13d                           #3415.50
-..LN1081:
-        shrl      $2, %r13d                                     #3415.57
-..LN1083:
-        addq      %rbx, %r13                                    #3415.30
-..LN1085:
-   .loc    1  3418
-        movq      %r13, %rsi                                    #3418.14
-        call      prime_buffer_2na at PLT                          #3418.14
-                                # LOE rbx r13 r15 r12d r14d xmm0
-..B10.41:                       # Preds ..B10.40
-..LN1087:
-   .loc    1  3419
-        movq      -176(%rbp), %rax                              #3419.5
-        lea       16(%rbx,%rax), %r8                            #3419.5
-        movq      %r8, %rdi                                     #3419.5
-..LN1089:
-   .loc    1  3424
-        cmpq      %r13, %r8                                     #3424.16
-..LN1091:
-   .loc    1  3429
-..LN1093:
-   .loc    1  3424
-        jae       ..B10.3       # Prob 12%                      #3424.16
-                                # LOE rdi r8 r13 r15 ebx r12d r14d xmm0
-..B10.2:                        # Preds ..B10.41
-..LN1095:
-   .loc    1  3425
-        movzbl    -1(%r8), %ebx                                 #3425.24
-..LN1097:
-        shll      $8, %ebx                                      #3425.38
-                                # LOE rdi r8 r13 r15 ebx r12d r14d xmm0
-..B10.3:                        # Preds ..B10.2 ..B10.41
-..LN1099:
-   .loc    1  3429
-        movdqa    16(%r15), %xmm8                               #3429.5
-        movdqa    32(%r15), %xmm7                               #3429.5
-        movdqa    48(%r15), %xmm6                               #3429.5
-        movdqa    64(%r15), %xmm5                               #3429.5
-        movdqa    80(%r15), %xmm4                               #3429.5
-        movdqa    96(%r15), %xmm3                               #3429.5
-        movdqa    112(%r15), %xmm2                              #3429.5
-        movdqa    128(%r15), %xmm1                              #3429.5
-..LN1101:
-   .loc    1  3432
-        xorl      %ecx, %ecx                                    #3432.15
-..LN1103:
-        xorl      %esi, %esi                                    #3432.10
-..LN1105:
-        xorl      %edx, %edx                                    #3432.5
-..LN1107:
-   .loc    1  3434
-        movl      %r14d, %eax                                   #3434.20
-        subl      %r12d, %eax                                   #3434.20
-..LN1109:
-        addl      $7, %eax                                      #3434.33
-..LN1111:
-        shrl      $2, %eax                                      #3434.40
-..LN1113:
-   .loc    1  3441
-        movl      %r12d, %r9d                                   #3441.20
-        andl      $3, %r9d                                      #3441.20
-        je        ..B10.35      # Prob 20%                      #3441.20
-                                # LOE rdi r8 r13 eax edx ecx ebx esi r9d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.4:                        # Preds ..B10.3
-        cmpl      $1, %r9d                                      #3441.20
-        je        ..B10.10      # Prob 25%                      #3441.20
-                                # LOE rdi r8 r13 eax edx ecx ebx esi r9d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.5:                        # Preds ..B10.4
-        cmpl      $2, %r9d                                      #3441.20
-        je        ..B10.9       # Prob 33%                      #3441.20
-                                # LOE rdi r8 r13 eax edx ecx ebx esi r9d r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.6:                        # Preds ..B10.5
-        cmpl      $3, %r9d                                      #3441.20
-        je        ..B10.8       # Prob 50%                      #3441.20
-                                # LOE rdi r8 r13 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.7:                        # Preds ..B10.6
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B10.19      # Prob 100%                     #
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.8:                        # Preds ..B10.6
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B10.13      # Prob 100%                     #
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.9:                        # Preds ..B10.5
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B10.12      # Prob 100%                     #
-                                # LOE rdi r13 r15 eax edx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.10:                       # Preds ..B10.4
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-                                # LOE rdi r13 r15 eax edx ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.11:                       # Preds ..B10.10 ..B10.23
-..LN1115:
-   .loc    1  3464
-        movdqa    %xmm0, %xmm9                                  #3464.22
-        pand      %xmm5, %xmm9                                  #3464.22
-..LN1117:
-   .loc    1  3465
-        pcmpeqd   %xmm6, %xmm9                                  #3465.22
-..LN1119:
-   .loc    1  3466
-        pmovmskb  %xmm9, %esi                                   #3466.22
-..LN1121:
-   .loc    1  3467
-        incl      %esi                                          #3467.17
-        shrl      $16, %esi                                     #3467.17
-        negl      %esi                                          #3467.17
-                                # LOE rdi r13 r15 eax edx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.12:                       # Preds ..B10.9 ..B10.11
-..LN1123:
-   .loc    1  3470
-        movdqa    %xmm0, %xmm9                                  #3470.22
-        pand      %xmm3, %xmm9                                  #3470.22
-..LN1125:
-   .loc    1  3471
-        pcmpeqd   %xmm4, %xmm9                                  #3471.22
-..LN1127:
-   .loc    1  3472
-        pmovmskb  %xmm9, %ecx                                   #3472.22
-..LN1129:
-   .loc    1  3473
-        incl      %ecx                                          #3473.17
-        shrl      $16, %ecx                                     #3473.17
-        negl      %ecx                                          #3473.17
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.13:                       # Preds ..B10.8 ..B10.12
-..LN1131:
-   .loc    1  3476
-        movdqa    %xmm0, %xmm9                                  #3476.22
-..LN1133:
-   .loc    1  3483
-        andl      $-4, %r12d                                    #3483.17
-..LN1135:
-   .loc    1  3486
-        movl      %edx, %r10d                                   #3486.29
-..LN1137:
-   .loc    1  3476
-        pand      %xmm1, %xmm9                                  #3476.22
-..LN1139:
-   .loc    1  3477
-        pcmpeqd   %xmm2, %xmm9                                  #3477.22
-..LN1141:
-   .loc    1  3478
-        pmovmskb  %xmm9, %r9d                                   #3478.22
-..LN1143:
-   .loc    1  3486
-        orl       %esi, %r10d                                   #3486.29
-..LN1145:
-        orl       %ecx, %r10d                                   #3486.34
-..LN1147:
-   .loc    1  3479
-        incl      %r9d                                          #3479.17
-        shrl      $16, %r9d                                     #3479.17
-        negl      %r9d                                          #3479.17
-..LN1149:
-   .loc    1  3486
-        orl       %r9d, %r10d                                   #3486.39
-..LN1151:
-        jne       ..B10.24      # Prob 20%                      #3486.47
-                                # LOE rdi r13 r15 eax edx ecx ebx esi r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.14:                       # Preds ..B10.13
-..LN1153:
-   .loc    1  3527
-        addl      $4, %r12d                                     #3527.17
-..LN1155:
-   .loc    1  3530
-        cmpl      %r14d, %r12d                                  #3530.28
-        ja        ..B10.32      # Prob 20%                      #3530.28
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.15:                       # Preds ..B10.14
-..LN1157:
-   .loc    1  3534
-        decl      %eax                                          #3534.25
-..LN1159:
-        jne       ..B10.20      # Prob 50%                      #3534.39
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.16:                       # Preds ..B10.15
-..LN1161:
-   .loc    1  3555
-        cmpq      %r15, %r13                                    #3555.25
-        jae       ..B10.32      # Prob 4%                       #3555.25
-                                # LOE r13 r15 ebx r12d r14d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.17:                       # Preds ..B10.16
-..LN1163:
-   .loc    1  3565
-        movdqa    %xmm1, -176(%rbp)                             #3565.22
-        movdqa    %xmm2, -160(%rbp)                             #3565.22
-        movdqa    %xmm3, -144(%rbp)                             #3565.22
-        movdqa    %xmm4, -128(%rbp)                             #3565.22
-        movdqa    %xmm5, -112(%rbp)                             #3565.22
-        movdqa    %xmm6, -96(%rbp)                              #3565.22
-        movdqa    %xmm7, -80(%rbp)                              #3565.22
-        movdqa    %xmm8, -64(%rbp)                              #3565.22
-        movq      %r13, %rdi                                    #3565.22
-        movq      %r15, %rsi                                    #3565.22
-        call      prime_buffer_2na at PLT                          #3565.22
-                                # LOE r13 r15 ebx r12d r14d xmm0
-..B10.42:                       # Preds ..B10.17
-        movdqa    -64(%rbp), %xmm8                              #
-        movdqa    -80(%rbp), %xmm7                              #
-        movdqa    -96(%rbp), %xmm6                              #
-        movdqa    -112(%rbp), %xmm5                             #
-..LN1165:
-   .loc    1  3643
-        addq      $16, %r13                                     #3643.13
-        movq      %r13, %rdi                                    #3643.13
-        movdqa    -128(%rbp), %xmm4                             #
-        movdqa    -144(%rbp), %xmm3                             #
-        movdqa    -160(%rbp), %xmm2                             #
-        movdqa    -176(%rbp), %xmm1                             #
-..LN1167:
-   .loc    1  3646
-        cmpq      %r15, %r13                                    #3646.24
-        jae       ..B10.19      # Prob 12%                      #3646.24
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.18:                       # Preds ..B10.42
-..LN1169:
-   .loc    1  3647
-        movzbl    -1(%r13), %ebx                                #3647.32
-..LN1171:
-        shll      $8, %ebx                                      #3647.46
-                                # LOE rdi r13 r15 ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.19:                       # Preds ..B10.42 ..B10.7 ..B10.18
-..LN1173:
-   .loc    1  3448
-        movl      $16, %eax                                     #3448.13
-        jmp       ..B10.23      # Prob 100%                     #3448.13
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.20:                       # Preds ..B10.15
-..LN1175:
-   .loc    1  3539
-        psrldq    $1, %xmm0                                     #3539.26
-..LN1177:
-   .loc    1  3542
-        cmpq      %r15, %rdi                                    #3542.26
-        jae       ..B10.22      # Prob 19%                      #3542.26
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.21:                       # Preds ..B10.20
-..LN1179:
-   .loc    1  3545
-        movzbl    (%rdi), %edx                                  #3545.37
-..LN1181:
-   .loc    1  3544
-        sarl      $8, %ebx                                      #3544.21
-..LN1183:
-   .loc    1  3545
-        shll      $8, %edx                                      #3545.48
-..LN1185:
-        orl       %edx, %ebx                                    #3545.21
-..LN1187:
-   .loc    1  3546
-        pinsrw    $7, %ebx, %xmm0                               #3546.30
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.22:                       # Preds ..B10.21 ..B10.20
-..LN1189:
-   .loc    1  3550
-        incq      %rdi                                          #3550.20
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.23:                       # Preds ..B10.19 ..B10.22 ..B10.35
-..LN1191:
-   .loc    1  3458
-        movdqa    %xmm0, %xmm9                                  #3458.22
-        pand      %xmm7, %xmm9                                  #3458.22
-..LN1193:
-   .loc    1  3459
-        pcmpeqd   %xmm8, %xmm9                                  #3459.22
-..LN1195:
-   .loc    1  3460
-        pmovmskb  %xmm9, %edx                                   #3460.22
-..LN1197:
-   .loc    1  3461
-        incl      %edx                                          #3461.17
-        shrl      $16, %edx                                     #3461.17
-        negl      %edx                                          #3461.17
-        jmp       ..B10.11      # Prob 100%                     #3461.17
-                                # LOE rdi r13 r15 eax edx ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.24:                       # Preds ..B10.13                # Infreq
-..LN1199:
-   .loc    1  3489
-        subl      %r12d, %r14d                                  #3489.30
-..LN1201:
-        cmpl      $2, %r14d                                     #3489.37
-        je        ..B10.28      # Prob 25%                      #3489.37
-                                # LOE edx ecx esi r14d
-..B10.25:                       # Preds ..B10.24                # Infreq
-        cmpl      $1, %r14d                                     #3489.37
-        je        ..B10.29      # Prob 33%                      #3489.37
-                                # LOE edx esi r14d
-..B10.26:                       # Preds ..B10.25                # Infreq
-        testl     %r14d, %r14d                                  #3489.37
-        je        ..B10.30      # Prob 50%                      #3489.37
-                                # LOE edx
-..B10.27:                       # Preds ..B10.26                # Infreq
-..LN1203:
-   .loc    1  3492
-        movq      -48(%rbp), %rbx                               #3492.32
-..___tag_value_eval_2na_128.426:                                #
-        movq      -16(%rbp), %r12                               #3492.32
-..___tag_value_eval_2na_128.427:                                #
-        movq      -32(%rbp), %r13                               #3492.32
-..___tag_value_eval_2na_128.428:                                #
-        movq      -24(%rbp), %r14                               #3492.32
-..___tag_value_eval_2na_128.429:                                #
-        movl      $1, %eax                                      #3492.32
-        movq      -40(%rbp), %r15                               #3492.32
-..___tag_value_eval_2na_128.430:                                #
-        movq      %rbp, %rsp                                    #3492.32
-        popq      %rbp                                          #3492.32
-..___tag_value_eval_2na_128.431:                                #
-        ret                                                     #3492.32
-..___tag_value_eval_2na_128.432:                                #
-                                # LOE
-..B10.28:                       # Preds ..B10.24                # Infreq
-..LN1205:
-   .loc    1  3494
-        testl     %ecx, %ecx                                    #3494.36
-        jne       ..B10.31      # Prob 28%                      #3494.36
-                                # LOE edx esi
-..B10.29:                       # Preds ..B10.28 ..B10.25       # Infreq
-..LN1207:
-   .loc    1  3496
-        testl     %esi, %esi                                    #3496.36
-        jne       ..B10.31      # Prob 28%                      #3496.36
-                                # LOE edx
-..B10.30:                       # Preds ..B10.29 ..B10.26       # Infreq
-..LN1209:
-   .loc    1  3498
-        testl     %edx, %edx                                    #3498.36
-        je        ..B10.32      # Prob 50%                      #3498.36
-                                # LOE
-..B10.31:                       # Preds ..B10.28 ..B10.29 ..B10.30 # Infreq
-..LN1211:
-        movq      -48(%rbp), %rbx                               #3498.47
-..___tag_value_eval_2na_128.438:                                #
-        movq      -16(%rbp), %r12                               #3498.47
-..___tag_value_eval_2na_128.439:                                #
-        movq      -32(%rbp), %r13                               #3498.47
-..___tag_value_eval_2na_128.440:                                #
-        movq      -24(%rbp), %r14                               #3498.47
-..___tag_value_eval_2na_128.441:                                #
-        movl      $1, %eax                                      #3498.47
-        movq      -40(%rbp), %r15                               #3498.47
-..___tag_value_eval_2na_128.442:                                #
-        movq      %rbp, %rsp                                    #3498.47
-        popq      %rbp                                          #3498.47
-..___tag_value_eval_2na_128.443:                                #
-        ret                                                     #3498.47
-..___tag_value_eval_2na_128.444:                                #
-                                # LOE
-..B10.32:                       # Preds ..B10.14 ..B10.16 ..B10.30 # Infreq
-..LN1213:
-   .loc    1  3500
-        movq      -48(%rbp), %rbx                               #3500.28
-..___tag_value_eval_2na_128.450:                                #
-        movq      -16(%rbp), %r12                               #3500.28
-..___tag_value_eval_2na_128.451:                                #
-        movq      -32(%rbp), %r13                               #3500.28
-..___tag_value_eval_2na_128.452:                                #
-        movq      -24(%rbp), %r14                               #3500.28
-..___tag_value_eval_2na_128.453:                                #
-        xorl      %eax, %eax                                    #3500.28
-        movq      -40(%rbp), %r15                               #3500.28
-..___tag_value_eval_2na_128.454:                                #
-        movq      %rbp, %rsp                                    #3500.28
-        popq      %rbp                                          #3500.28
-..___tag_value_eval_2na_128.455:                                #
-        ret                                                     #3500.28
-..___tag_value_eval_2na_128.456:                                #
-                                # LOE
-..B10.35:                       # Preds ..B10.3                 # Infreq
-        movq      %r13, %r15                                    #
-        movq      %r8, %r13                                     #
-        jmp       ..B10.23      # Prob 100%                     #
-        .align    16,0x90
-..___tag_value_eval_2na_128.462:                                #
-                                # LOE rdi r13 r15 eax ebx r12d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-.LNeval_2na_128:
-	.data
-# -- End  eval_2na_128
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    16,0x90
-eval_2na_32:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B11.1:                        # Preds ..B11.0
-..___tag_value_eval_2na_32.463:                                 #2782.1
-..LN1215:
-   .loc    1  2782
-        pushq     %rbp                                          #2782.1
-        movq      %rsp, %rbp                                    #2782.1
-..___tag_value_eval_2na_32.464:                                 #
-        subq      $272, %rsp                                    #2782.1
-        movq      %r15, -56(%rbp)                               #2782.1
-..___tag_value_eval_2na_32.466:                                 #
-        movq      %r14, -48(%rbp)                               #2782.1
-..___tag_value_eval_2na_32.467:                                 #
-        movq      %r13, -24(%rbp)                               #2782.1
-..___tag_value_eval_2na_32.468:                                 #
-        movq      %r12, -40(%rbp)                               #2782.1
-..___tag_value_eval_2na_32.469:                                 #
-        movq      %rbx, -32(%rbp)                               #2782.1
-..___tag_value_eval_2na_32.470:                                 #
-        movl      %ecx, %r12d                                   #2782.1
-        movl      %edx, %ebx                                    #2782.1
-        movq      %rsi, %r14                                    #2782.1
-        movq      %rdi, %r13                                    #2782.1
-        lea       _gprof_pack10(%rip), %rdx                     #2782.1
-        call      mcount at PLT                                    #2782.1
-                                # LOE r13 r14 ebx r12d
-..B11.48:                       # Preds ..B11.1
-..LN1217:
-   .loc    1  2819
-        lea       (%rbx,%r12), %eax                             #2819.5
-..LN1219:
-   .loc    1  2825
-        subl      4(%r13), %eax                                 #2825.12
-..LN1221:
-   .loc    1  2831
-        movl      %eax, -16(%rbp)                               #2831.14
-..LN1223:
-   .loc    1  2822
-        movl      %ebx, %r15d                                   #2822.49
-        shrl      $2, %r15d                                     #2822.49
-..LN1225:
-        lea       (%r14,%r15), %rdi                             #2822.30
-..LN1227:
-   .loc    1  2828
-        lea       3(%rbx,%r12), %r12d                           #2828.50
-..LN1229:
-        shrl      $2, %r12d                                     #2828.57
-..LN1231:
-        addq      %r14, %r12                                    #2828.30
-..LN1233:
-   .loc    1  2831
-        movq      %r12, %rsi                                    #2831.14
-        call      prime_buffer_2na at PLT                          #2831.14
-                                # LOE r12 r13 r14 r15 ebx xmm0
-..B11.49:                       # Preds ..B11.48
-        movl      -16(%rbp), %eax                               #
-..LN1235:
-   .loc    1  2832
-        lea       16(%r14,%r15), %r15                           #2832.5
-        movq      %r15, %rsi                                    #2832.5
-..LN1237:
-   .loc    1  2837
-        cmpq      %r12, %r15                                    #2837.16
-..LN1239:
-   .loc    1  2842
-..LN1241:
-   .loc    1  2837
-        jae       ..B11.3       # Prob 12%                      #2837.16
-                                # LOE rax rsi r12 r13 r15 eax ebx r14d al ah xmm0
-..B11.2:                        # Preds ..B11.49
-..LN1243:
-   .loc    1  2838
-        movzbl    -1(%r15), %r14d                               #2838.24
-..LN1245:
-        shll      $8, %r14d                                     #2838.38
-                                # LOE rax rsi r12 r13 r15 eax ebx r14d al ah xmm0
-..B11.3:                        # Preds ..B11.2 ..B11.49
-..LN1247:
-   .loc    1  2842
-        movdqa    16(%r13), %xmm7                               #2842.5
-        movdqa    32(%r13), %xmm6                               #2842.5
-        movdqa    48(%r13), %xmm5                               #2842.5
-        movdqa    64(%r13), %xmm4                               #2842.5
-        movdqa    80(%r13), %xmm3                               #2842.5
-        movdqa    96(%r13), %xmm2                               #2842.5
-        movdqa    112(%r13), %xmm1                              #2842.5
-        movdqa    128(%r13), %xmm8                              #2842.5
-..LN1249:
-   .loc    1  2845
-        xorl      %edi, %edi                                    #2845.15
-..LN1251:
-        xorl      %ecx, %ecx                                    #2845.10
-..LN1253:
-        xorl      %edx, %edx                                    #2845.5
-..LN1255:
-   .loc    1  2849
-        movl      $4, %r13d                                     #2849.5
-..LN1257:
-   .loc    1  2854
-        movl      %ebx, %r8d                                    #2854.20
-        andl      $3, %r8d                                      #2854.20
-        je        ..B11.40      # Prob 20%                      #2854.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.4:                        # Preds ..B11.3
-        cmpl      $1, %r8d                                      #2854.20
-        je        ..B11.10      # Prob 25%                      #2854.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.5:                        # Preds ..B11.4
-        cmpl      $2, %r8d                                      #2854.20
-        je        ..B11.9       # Prob 33%                      #2854.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.6:                        # Preds ..B11.5
-        cmpl      $3, %r8d                                      #2854.20
-        je        ..B11.8       # Prob 50%                      #2854.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.7:                        # Preds ..B11.6
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B11.32      # Prob 100%                     #
-                                # LOE rsi r15 eax r14d xmm0
-..B11.8:                        # Preds ..B11.6
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        movl      %edi, %ebx                                    #
-        jmp       ..B11.13      # Prob 100%                     #
-                                # LOE rsi r15 eax edx ecx ebx r13d r14d xmm0
-..B11.9:                        # Preds ..B11.5
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B11.12      # Prob 100%                     #
-                                # LOE rsi r15 eax edx ecx r13d r14d xmm0
-..B11.10:                       # Preds ..B11.4
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-                                # LOE rsi r15 eax edx r13d r14d xmm0
-..B11.11:                       # Preds ..B11.10 ..B11.36
-..LN1259:
-   .loc    1  2877
-        movdqa    %xmm0, %xmm1                                  #2877.22
-        pand      -80(%rbp), %xmm1                              #2877.22
-..LN1261:
-   .loc    1  2878
-        pcmpeqd   -192(%rbp), %xmm1                             #2878.22
-..LN1263:
-   .loc    1  2879
-        pmovmskb  %xmm1, %ecx                                   #2879.22
-                                # LOE rsi r15 eax edx ecx r13d r14d xmm0
-..B11.12:                       # Preds ..B11.9 ..B11.11
-..LN1265:
-   .loc    1  2883
-        movdqa    %xmm0, %xmm1                                  #2883.22
-        pand      -176(%rbp), %xmm1                             #2883.22
-..LN1267:
-   .loc    1  2884
-        pcmpeqd   -128(%rbp), %xmm1                             #2884.22
-..LN1269:
-   .loc    1  2885
-        pmovmskb  %xmm1, %ebx                                   #2885.22
-                                # LOE rsi r15 eax edx ecx ebx r13d r14d xmm0
-..B11.13:                       # Preds ..B11.8 ..B11.12
-..LN1271:
-   .loc    1  2889
-        movdqa    %xmm0, %xmm1                                  #2889.22
-        pand      -112(%rbp), %xmm1                             #2889.22
-..LN1273:
-   .loc    1  2890
-        pcmpeqd   -96(%rbp), %xmm1                              #2890.22
-..LN1275:
-   .loc    1  2891
-        pmovmskb  %xmm1, %r8d                                   #2891.22
-..LN1277:
-   .loc    1  2896
-        movl      %eax, %r12d                                   #2896.17
-        andl      $-4, %r12d                                    #2896.17
-..LN1279:
-   .loc    1  2899
-        movl      %edx, %eax                                    #2899.29
-        orl       %ecx, %eax                                    #2899.29
-..LN1281:
-        orl       %ebx, %eax                                    #2899.34
-..LN1283:
-        orl       %r8d, %eax                                    #2899.39
-..LN1285:
-        je        ..B11.26      # Prob 78%                      #2899.47
-                                # LOE rsi r15 edx ecx ebx r8d r12d r13d r14d xmm0
-..B11.14:                       # Preds ..B11.13
-..LN1287:
-   .loc    1  2917
-        movdqa    %xmm0, -272(%rbp)                             #2917.30
-        movl      %edx, %edi                                    #2917.30
-        movl      %r8d, -232(%rbp)                              #2917.30
-        movl      %edx, -224(%rbp)                              #2917.30
-        movl      %ecx, -216(%rbp)                              #2917.30
-        movq      %rsi, -208(%rbp)                              #2917.30
-        call      uint16_lsbit at PLT                              #2917.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B11.50:                       # Preds ..B11.14
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B11.15:                       # Preds ..B11.50
-..LN1289:
-   .loc    1  2918
-        movdqa    %xmm0, -272(%rbp)                             #2918.30
-        movl      %ecx, %edi                                    #2918.30
-        movl      %r8d, -232(%rbp)                              #2918.30
-..LN1291:
-   .loc    1  2917
-        movswq    %ax, %rax                                     #2917.30
-        movl      %eax, -240(%rbp)                              #2917.30
-..LN1293:
-   .loc    1  2918
-        movl      %edx, -224(%rbp)                              #2918.30
-        movl      %ecx, -216(%rbp)                              #2918.30
-        movq      %rsi, -208(%rbp)                              #2918.30
-        call      uint16_lsbit at PLT                              #2918.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B11.51:                       # Preds ..B11.15
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B11.16:                       # Preds ..B11.51
-..LN1295:
-   .loc    1  2919
-        movdqa    %xmm0, -272(%rbp)                             #2919.30
-        movl      %ebx, %edi                                    #2919.30
-        movl      %r8d, -232(%rbp)                              #2919.30
-..LN1297:
-   .loc    1  2918
-        movswq    %ax, %rax                                     #2918.30
-        movl      %eax, -248(%rbp)                              #2918.30
-..LN1299:
-   .loc    1  2919
-        movl      %edx, -224(%rbp)                              #2919.30
-        movl      %ecx, -216(%rbp)                              #2919.30
-        movq      %rsi, -208(%rbp)                              #2919.30
-        call      uint16_lsbit at PLT                              #2919.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B11.52:                       # Preds ..B11.16
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B11.17:                       # Preds ..B11.52
-..LN1301:
-   .loc    1  2920
-        movdqa    %xmm0, -272(%rbp)                             #2920.30
-        movl      %r8d, %edi                                    #2920.30
-        movl      %r8d, -232(%rbp)                              #2920.30
-..LN1303:
-   .loc    1  2919
-        movswq    %ax, %rax                                     #2919.30
-        movl      %eax, -256(%rbp)                              #2919.30
-..LN1305:
-   .loc    1  2920
-        movl      %edx, -224(%rbp)                              #2920.30
-        movl      %ecx, -216(%rbp)                              #2920.30
-        movq      %rsi, -208(%rbp)                              #2920.30
-        call      uint16_lsbit at PLT                              #2920.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B11.53:                       # Preds ..B11.17
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B11.18:                       # Preds ..B11.53
-..LN1307:
-   .loc    1  2925
-        movl      -240(%rbp), %r9d                              #2925.34
-..LN1309:
-   .loc    1  2926
-        movl      -248(%rbp), %r10d                             #2926.34
-..LN1311:
-   .loc    1  2927
-        movl      -256(%rbp), %r11d                             #2927.34
-..LN1313:
-   .loc    1  2920
-        movswq    %ax, %rax                                     #2920.30
-..LN1315:
-   .loc    1  2925
-        shll      $2, %r9d                                      #2925.34
-        movl      %r9d, -240(%rbp)                              #2925.34
-..LN1317:
-   .loc    1  2926
-        shll      $2, %r10d                                     #2926.34
-        movl      %r10d, -248(%rbp)                             #2926.34
-..LN1319:
-   .loc    1  2927
-        shll      $2, %r11d                                     #2927.34
-        movl      %r11d, -256(%rbp)                             #2927.34
-..LN1321:
-   .loc    1  2928
-        shll      $2, %eax                                      #2928.34
-..LN1323:
-   .loc    1  2932
-        testl     %edx, %edx                                    #2932.32
-        je        ..B11.20      # Prob 50%                      #2932.32
-                                # LOE rcx rsi r8 r9 r10 r11 r15 eax ecx ebx r8d r9d r10d r11d r12d r13d r14d cl r8b r9b r10b r11b ch xmm0
-..B11.19:                       # Preds ..B11.18
-..LN1325:
-        movl      %r9d, %edx                                    #2932.43
-        addl      %r12d, %edx                                   #2932.43
-..LN1327:
-        cmpl      -16(%rbp), %edx                               #2932.49
-        jbe       ..B11.41      # Prob 20%                      #2932.49
-                                # LOE rcx rsi r8 r10 r11 r15 eax ecx ebx r8d r10d r11d r12d r13d r14d cl r8b r10b r11b ch xmm0
-..B11.20:                       # Preds ..B11.19 ..B11.18
-..LN1329:
-   .loc    1  2933
-        testl     %ecx, %ecx                                    #2933.32
-        je        ..B11.22      # Prob 50%                      #2933.32
-                                # LOE rsi r8 r10 r11 r15 eax ebx r8d r10d r11d r12d r13d r14d r8b r10b r11b xmm0
-..B11.21:                       # Preds ..B11.20
-..LN1331:
-        movl      %r10d, %edx                                   #2933.43
-        lea       1(%r12,%rdx), %ecx                            #2933.43
-..LN1333:
-        cmpl      -16(%rbp), %ecx                               #2933.49
-        jbe       ..B11.41      # Prob 20%                      #2933.49
-                                # LOE rsi r8 r11 r15 eax ebx r8d r11d r12d r13d r14d r8b r11b xmm0
-..B11.22:                       # Preds ..B11.21 ..B11.20
-..LN1335:
-   .loc    1  2934
-        testl     %ebx, %ebx                                    #2934.32
-        je        ..B11.24      # Prob 50%                      #2934.32
-                                # LOE rsi r8 r11 r15 eax r8d r11d r12d r13d r14d r8b r11b xmm0
-..B11.23:                       # Preds ..B11.22
-..LN1337:
-        movl      %r11d, %edx                                   #2934.43
-        lea       2(%r12,%rdx), %ecx                            #2934.43
-..LN1339:
-        cmpl      -16(%rbp), %ecx                               #2934.49
-        jbe       ..B11.41      # Prob 20%                      #2934.49
-                                # LOE rsi r8 r15 eax r8d r12d r13d r14d r8b xmm0
-..B11.24:                       # Preds ..B11.23 ..B11.22
-..LN1341:
-   .loc    1  2935
-        testl     %r8d, %r8d                                    #2935.32
-        je        ..B11.26      # Prob 50%                      #2935.32
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B11.25:                       # Preds ..B11.24
-..LN1343:
-        lea       3(%r12,%rax), %eax                            #2935.43
-..LN1345:
-        cmpl      -16(%rbp), %eax                               #2935.49
-        jbe       ..B11.41      # Prob 20%                      #2935.49
-                                # LOE rsi r15 r12d r13d r14d xmm0
-..B11.26:                       # Preds ..B11.25 ..B11.24 ..B11.13
-..LN1347:
-   .loc    1  2940
-        lea       4(%r12), %eax                                 #2940.17
-..LN1349:
-   .loc    1  2943
-        cmpl      -16(%rbp), %eax                               #2943.28
-        ja        ..B11.38      # Prob 20%                      #2943.28
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B11.27:                       # Preds ..B11.26
-..LN1351:
-   .loc    1  2947
-        decl      %r13d                                         #2947.25
-..LN1353:
-        jne       ..B11.33      # Prob 50%                      #2947.39
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B11.28:                       # Preds ..B11.27
-..LN1355:
-   .loc    1  2968
-        cmpq      -64(%rbp), %r15                               #2968.25
-        jae       ..B11.38      # Prob 4%                       #2968.25
-                                # LOE r15 r12d r14d
-..B11.29:                       # Preds ..B11.28
-..LN1357:
-   .loc    1  2972
-        lea       52(%r12), %eax                                #2972.13
-..LN1359:
-   .loc    1  2973
-        cmpl      -16(%rbp), %eax                               #2973.24
-        ja        ..B11.38      # Prob 4%                       #2973.24
-                                # LOE r15 eax r14d
-..B11.30:                       # Preds ..B11.29
-..LN1361:
-   .loc    1  2978
-        movq      -64(%rbp), %rsi                               #2978.22
-        movl      %eax, -200(%rbp)                              #2978.22
-        movq      %r15, %rdi                                    #2978.22
-        call      prime_buffer_2na at PLT                          #2978.22
-                                # LOE r15 r14d xmm0
-..B11.54:                       # Preds ..B11.30
-        movl      -200(%rbp), %eax                              #
-..LN1363:
-   .loc    1  3056
-        addq      $16, %r15                                     #3056.13
-..LN1365:
-   .loc    1  3059
-        cmpq      -64(%rbp), %r15                               #3059.24
-..LN1367:
-   .loc    1  3056
-        movq      %r15, %rsi                                    #3056.13
-..LN1369:
-   .loc    1  3059
-        jae       ..B11.32      # Prob 12%                      #3059.24
-                                # LOE rax rsi r15 eax r14d al ah xmm0
-..B11.31:                       # Preds ..B11.54
-..LN1371:
-   .loc    1  3060
-        movzbl    -1(%r15), %r14d                               #3060.32
-..LN1373:
-        shll      $8, %r14d                                     #3060.46
-                                # LOE rsi r15 eax r14d xmm0
-..B11.32:                       # Preds ..B11.54 ..B11.7 ..B11.31
-..LN1375:
-   .loc    1  2861
-        movl      $4, %r13d                                     #2861.13
-        jmp       ..B11.36      # Prob 100%                     #2861.13
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B11.33:                       # Preds ..B11.27
-..LN1377:
-   .loc    1  2955
-        cmpq      -64(%rbp), %rsi                               #2955.26
-..LN1379:
-   .loc    1  2952
-        psrldq    $1, %xmm0                                     #2952.26
-..LN1381:
-   .loc    1  2955
-        jae       ..B11.35      # Prob 19%                      #2955.26
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B11.34:                       # Preds ..B11.33
-..LN1383:
-   .loc    1  2958
-        movzbl    (%rsi), %edx                                  #2958.37
-..LN1385:
-   .loc    1  2957
-        sarl      $8, %r14d                                     #2957.21
-..LN1387:
-   .loc    1  2958
-        shll      $8, %edx                                      #2958.48
-..LN1389:
-        orl       %edx, %r14d                                   #2958.21
-..LN1391:
-   .loc    1  2959
-        pinsrw    $7, %r14d, %xmm0                              #2959.30
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B11.35:                       # Preds ..B11.34 ..B11.33
-..LN1393:
-   .loc    1  2963
-        incq      %rsi                                          #2963.20
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B11.36:                       # Preds ..B11.32 ..B11.35 ..B11.40
-..LN1395:
-   .loc    1  2871
-        movdqa    %xmm0, %xmm1                                  #2871.22
-        pand      -160(%rbp), %xmm1                             #2871.22
-..LN1397:
-   .loc    1  2872
-        pcmpeqd   -144(%rbp), %xmm1                             #2872.22
-..LN1399:
-   .loc    1  2873
-        pmovmskb  %xmm1, %edx                                   #2873.22
-        jmp       ..B11.11      # Prob 100%                     #2873.22
-                                # LOE rsi r15 eax edx r13d r14d xmm0
-..B11.38:                       # Preds ..B11.26 ..B11.28 ..B11.29 # Infreq
-..LN1401:
-   .loc    1  3069
-        movq      -32(%rbp), %rbx                               #3069.12
-..___tag_value_eval_2na_32.471:                                 #
-        movq      -40(%rbp), %r12                               #3069.12
-..___tag_value_eval_2na_32.472:                                 #
-        movq      -24(%rbp), %r13                               #3069.12
-..___tag_value_eval_2na_32.473:                                 #
-        movq      -48(%rbp), %r14                               #3069.12
-..___tag_value_eval_2na_32.474:                                 #
-        xorl      %eax, %eax                                    #3069.12
-        movq      -56(%rbp), %r15                               #3069.12
-..___tag_value_eval_2na_32.475:                                 #
-        movq      %rbp, %rsp                                    #3069.12
-        popq      %rbp                                          #3069.12
-..___tag_value_eval_2na_32.476:                                 #
-        ret                                                     #3069.12
-..___tag_value_eval_2na_32.477:                                 #
-                                # LOE
-..B11.40:                       # Preds ..B11.3                 # Infreq
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B11.36      # Prob 100%                     #
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B11.41:                       # Preds ..B11.23 ..B11.21 ..B11.19 ..B11.25 # Infreq
-..LN1403:
-   .loc    1  2935
-        movq      -32(%rbp), %rbx                               #2935.63
-..___tag_value_eval_2na_32.483:                                 #
-        movq      -40(%rbp), %r12                               #2935.63
-..___tag_value_eval_2na_32.484:                                 #
-        movq      -24(%rbp), %r13                               #2935.63
-..___tag_value_eval_2na_32.485:                                 #
-        movq      -48(%rbp), %r14                               #2935.63
-..___tag_value_eval_2na_32.486:                                 #
-        movl      $1, %eax                                      #2935.63
-        movq      -56(%rbp), %r15                               #2935.63
-..___tag_value_eval_2na_32.487:                                 #
-        movq      %rbp, %rsp                                    #2935.63
-        popq      %rbp                                          #2935.63
-..___tag_value_eval_2na_32.488:                                 #
-        ret                                                     #2935.63
-        .align    16,0x90
-..___tag_value_eval_2na_32.489:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-.LNeval_2na_32:
-	.data
-# -- End  eval_2na_32
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    16,0x90
-eval_2na_16:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B12.1:                        # Preds ..B12.0
-..___tag_value_eval_2na_16.490:                                 #2489.1
-..LN1405:
-   .loc    1  2489
-        pushq     %rbp                                          #2489.1
-        movq      %rsp, %rbp                                    #2489.1
-..___tag_value_eval_2na_16.491:                                 #
-        subq      $272, %rsp                                    #2489.1
-        movq      %r15, -56(%rbp)                               #2489.1
-..___tag_value_eval_2na_16.493:                                 #
-        movq      %r14, -48(%rbp)                               #2489.1
-..___tag_value_eval_2na_16.494:                                 #
-        movq      %r13, -24(%rbp)                               #2489.1
-..___tag_value_eval_2na_16.495:                                 #
-        movq      %r12, -40(%rbp)                               #2489.1
-..___tag_value_eval_2na_16.496:                                 #
-        movq      %rbx, -32(%rbp)                               #2489.1
-..___tag_value_eval_2na_16.497:                                 #
-        movl      %ecx, %r12d                                   #2489.1
-        movl      %edx, %ebx                                    #2489.1
-        movq      %rsi, %r14                                    #2489.1
-        movq      %rdi, %r13                                    #2489.1
-        lea       _gprof_pack11(%rip), %rdx                     #2489.1
-        call      mcount at PLT                                    #2489.1
-                                # LOE r13 r14 ebx r12d
-..B12.48:                       # Preds ..B12.1
-..LN1407:
-   .loc    1  2526
-        lea       (%rbx,%r12), %eax                             #2526.5
-..LN1409:
-   .loc    1  2532
-        subl      4(%r13), %eax                                 #2532.12
-..LN1411:
-   .loc    1  2538
-        movl      %eax, -16(%rbp)                               #2538.14
-..LN1413:
-   .loc    1  2529
-        movl      %ebx, %r15d                                   #2529.49
-        shrl      $2, %r15d                                     #2529.49
-..LN1415:
-        lea       (%r14,%r15), %rdi                             #2529.30
-..LN1417:
-   .loc    1  2535
-        lea       3(%rbx,%r12), %r12d                           #2535.50
-..LN1419:
-        shrl      $2, %r12d                                     #2535.57
-..LN1421:
-        addq      %r14, %r12                                    #2535.30
-..LN1423:
-   .loc    1  2538
-        movq      %r12, %rsi                                    #2538.14
-        call      prime_buffer_2na at PLT                          #2538.14
-                                # LOE r12 r13 r14 r15 ebx xmm0
-..B12.49:                       # Preds ..B12.48
-        movl      -16(%rbp), %eax                               #
-..LN1425:
-   .loc    1  2539
-        lea       16(%r14,%r15), %r15                           #2539.5
-        movq      %r15, %rsi                                    #2539.5
-..LN1427:
-   .loc    1  2544
-        cmpq      %r12, %r15                                    #2544.16
-..LN1429:
-   .loc    1  2549
-..LN1431:
-   .loc    1  2544
-        jae       ..B12.3       # Prob 12%                      #2544.16
-                                # LOE rax rsi r12 r13 r15 eax ebx r14d al ah xmm0
-..B12.2:                        # Preds ..B12.49
-..LN1433:
-   .loc    1  2545
-        movzbl    -1(%r15), %r14d                               #2545.24
-..LN1435:
-        shll      $8, %r14d                                     #2545.38
-                                # LOE rax rsi r12 r13 r15 eax ebx r14d al ah xmm0
-..B12.3:                        # Preds ..B12.2 ..B12.49
-..LN1437:
-   .loc    1  2549
-        movdqa    16(%r13), %xmm7                               #2549.5
-        movdqa    32(%r13), %xmm6                               #2549.5
-        movdqa    48(%r13), %xmm5                               #2549.5
-        movdqa    64(%r13), %xmm4                               #2549.5
-        movdqa    80(%r13), %xmm3                               #2549.5
-        movdqa    96(%r13), %xmm2                               #2549.5
-        movdqa    112(%r13), %xmm1                              #2549.5
-        movdqa    128(%r13), %xmm8                              #2549.5
-..LN1439:
-   .loc    1  2552
-        xorl      %edi, %edi                                    #2552.15
-..LN1441:
-        xorl      %ecx, %ecx                                    #2552.10
-..LN1443:
-        xorl      %edx, %edx                                    #2552.5
-..LN1445:
-   .loc    1  2556
-        movl      $2, %r13d                                     #2556.5
-..LN1447:
-   .loc    1  2561
-        movl      %ebx, %r8d                                    #2561.20
-        andl      $3, %r8d                                      #2561.20
-        je        ..B12.40      # Prob 20%                      #2561.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.4:                        # Preds ..B12.3
-        cmpl      $1, %r8d                                      #2561.20
-        je        ..B12.10      # Prob 25%                      #2561.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.5:                        # Preds ..B12.4
-        cmpl      $2, %r8d                                      #2561.20
-        je        ..B12.9       # Prob 33%                      #2561.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r8d r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.6:                        # Preds ..B12.5
-        cmpl      $3, %r8d                                      #2561.20
-        je        ..B12.8       # Prob 50%                      #2561.20
-                                # LOE rax rsi r12 r15 eax edx ecx ebx edi r13d r14d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.7:                        # Preds ..B12.6
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B12.32      # Prob 100%                     #
-                                # LOE rsi r15 eax r14d xmm0
-..B12.8:                        # Preds ..B12.6
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        movl      %edi, %ebx                                    #
-        jmp       ..B12.13      # Prob 100%                     #
-                                # LOE rsi r15 eax edx ecx ebx r13d r14d xmm0
-..B12.9:                        # Preds ..B12.5
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B12.12      # Prob 100%                     #
-                                # LOE rsi r15 eax edx ecx r13d r14d xmm0
-..B12.10:                       # Preds ..B12.4
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-                                # LOE rsi r15 eax edx r13d r14d xmm0
-..B12.11:                       # Preds ..B12.10 ..B12.36
-..LN1449:
-   .loc    1  2584
-        movdqa    %xmm0, %xmm1                                  #2584.22
-        pand      -80(%rbp), %xmm1                              #2584.22
-..LN1451:
-   .loc    1  2585
-        pcmpeqw   -192(%rbp), %xmm1                             #2585.22
-..LN1453:
-   .loc    1  2586
-        pmovmskb  %xmm1, %ecx                                   #2586.22
-                                # LOE rsi r15 eax edx ecx r13d r14d xmm0
-..B12.12:                       # Preds ..B12.9 ..B12.11
-..LN1455:
-   .loc    1  2590
-        movdqa    %xmm0, %xmm1                                  #2590.22
-        pand      -176(%rbp), %xmm1                             #2590.22
-..LN1457:
-   .loc    1  2591
-        pcmpeqw   -128(%rbp), %xmm1                             #2591.22
-..LN1459:
-   .loc    1  2592
-        pmovmskb  %xmm1, %ebx                                   #2592.22
-                                # LOE rsi r15 eax edx ecx ebx r13d r14d xmm0
-..B12.13:                       # Preds ..B12.8 ..B12.12
-..LN1461:
-   .loc    1  2596
-        movdqa    %xmm0, %xmm1                                  #2596.22
-        pand      -112(%rbp), %xmm1                             #2596.22
-..LN1463:
-   .loc    1  2597
-        pcmpeqw   -96(%rbp), %xmm1                              #2597.22
-..LN1465:
-   .loc    1  2598
-        pmovmskb  %xmm1, %r8d                                   #2598.22
-..LN1467:
-   .loc    1  2603
-        movl      %eax, %r12d                                   #2603.17
-        andl      $-4, %r12d                                    #2603.17
-..LN1469:
-   .loc    1  2606
-        movl      %edx, %eax                                    #2606.29
-        orl       %ecx, %eax                                    #2606.29
-..LN1471:
-        orl       %ebx, %eax                                    #2606.34
-..LN1473:
-        orl       %r8d, %eax                                    #2606.39
-..LN1475:
-        je        ..B12.26      # Prob 78%                      #2606.47
-                                # LOE rsi r15 edx ecx ebx r8d r12d r13d r14d xmm0
-..B12.14:                       # Preds ..B12.13
-..LN1477:
-   .loc    1  2624
-        movdqa    %xmm0, -272(%rbp)                             #2624.30
-        movl      %edx, %edi                                    #2624.30
-        movl      %r8d, -232(%rbp)                              #2624.30
-        movl      %edx, -224(%rbp)                              #2624.30
-        movl      %ecx, -216(%rbp)                              #2624.30
-        movq      %rsi, -208(%rbp)                              #2624.30
-        call      uint16_lsbit at PLT                              #2624.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B12.50:                       # Preds ..B12.14
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B12.15:                       # Preds ..B12.50
-..LN1479:
-   .loc    1  2625
-        movdqa    %xmm0, -272(%rbp)                             #2625.30
-        movl      %ecx, %edi                                    #2625.30
-        movl      %r8d, -232(%rbp)                              #2625.30
-..LN1481:
-   .loc    1  2624
-        movswq    %ax, %rax                                     #2624.30
-        movl      %eax, -240(%rbp)                              #2624.30
-..LN1483:
-   .loc    1  2625
-        movl      %edx, -224(%rbp)                              #2625.30
-        movl      %ecx, -216(%rbp)                              #2625.30
-        movq      %rsi, -208(%rbp)                              #2625.30
-        call      uint16_lsbit at PLT                              #2625.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B12.51:                       # Preds ..B12.15
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B12.16:                       # Preds ..B12.51
-..LN1485:
-   .loc    1  2626
-        movdqa    %xmm0, -272(%rbp)                             #2626.30
-        movl      %ebx, %edi                                    #2626.30
-        movl      %r8d, -232(%rbp)                              #2626.30
-..LN1487:
-   .loc    1  2625
-        movswq    %ax, %rax                                     #2625.30
-        movl      %eax, -248(%rbp)                              #2625.30
-..LN1489:
-   .loc    1  2626
-        movl      %edx, -224(%rbp)                              #2626.30
-        movl      %ecx, -216(%rbp)                              #2626.30
-        movq      %rsi, -208(%rbp)                              #2626.30
-        call      uint16_lsbit at PLT                              #2626.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B12.52:                       # Preds ..B12.16
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B12.17:                       # Preds ..B12.52
-..LN1491:
-   .loc    1  2627
-        movdqa    %xmm0, -272(%rbp)                             #2627.30
-        movl      %r8d, %edi                                    #2627.30
-        movl      %r8d, -232(%rbp)                              #2627.30
-..LN1493:
-   .loc    1  2626
-        movswq    %ax, %rax                                     #2626.30
-        movl      %eax, -256(%rbp)                              #2626.30
-..LN1495:
-   .loc    1  2627
-        movl      %edx, -224(%rbp)                              #2627.30
-        movl      %ecx, -216(%rbp)                              #2627.30
-        movq      %rsi, -208(%rbp)                              #2627.30
-        call      uint16_lsbit at PLT                              #2627.30
-                                # LOE r15 eax ebx r12d r13d r14d
-..B12.53:                       # Preds ..B12.17
-        movq      -208(%rbp), %rsi                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %ecx                              #
-        movl      -224(%rbp), %edx                              #
-        movl      -232(%rbp), %r8d                              #
-                                # LOE rdx rcx rsi r8 r15 eax edx ecx ebx r8d r12d r13d r14d dl cl r8b dh ch xmm0
-..B12.18:                       # Preds ..B12.53
-..LN1497:
-   .loc    1  2632
-        movl      -240(%rbp), %r9d                              #2632.34
-..LN1499:
-   .loc    1  2633
-        movl      -248(%rbp), %r10d                             #2633.34
-..LN1501:
-   .loc    1  2634
-        movl      -256(%rbp), %r11d                             #2634.34
-..LN1503:
-   .loc    1  2627
-        movswq    %ax, %rax                                     #2627.30
-..LN1505:
-   .loc    1  2632
-        shll      $2, %r9d                                      #2632.34
-        movl      %r9d, -240(%rbp)                              #2632.34
-..LN1507:
-   .loc    1  2633
-        shll      $2, %r10d                                     #2633.34
-        movl      %r10d, -248(%rbp)                             #2633.34
-..LN1509:
-   .loc    1  2634
-        shll      $2, %r11d                                     #2634.34
-        movl      %r11d, -256(%rbp)                             #2634.34
-..LN1511:
-   .loc    1  2635
-        shll      $2, %eax                                      #2635.34
-..LN1513:
-   .loc    1  2639
-        testl     %edx, %edx                                    #2639.32
-        je        ..B12.20      # Prob 50%                      #2639.32
-                                # LOE rcx rsi r8 r9 r10 r11 r15 eax ecx ebx r8d r9d r10d r11d r12d r13d r14d cl r8b r9b r10b r11b ch xmm0
-..B12.19:                       # Preds ..B12.18
-..LN1515:
-        movl      %r9d, %edx                                    #2639.43
-        addl      %r12d, %edx                                   #2639.43
-..LN1517:
-        cmpl      -16(%rbp), %edx                               #2639.49
-        jbe       ..B12.41      # Prob 20%                      #2639.49
-                                # LOE rcx rsi r8 r10 r11 r15 eax ecx ebx r8d r10d r11d r12d r13d r14d cl r8b r10b r11b ch xmm0
-..B12.20:                       # Preds ..B12.19 ..B12.18
-..LN1519:
-   .loc    1  2640
-        testl     %ecx, %ecx                                    #2640.32
-        je        ..B12.22      # Prob 50%                      #2640.32
-                                # LOE rsi r8 r10 r11 r15 eax ebx r8d r10d r11d r12d r13d r14d r8b r10b r11b xmm0
-..B12.21:                       # Preds ..B12.20
-..LN1521:
-        movl      %r10d, %edx                                   #2640.43
-        lea       1(%r12,%rdx), %ecx                            #2640.43
-..LN1523:
-        cmpl      -16(%rbp), %ecx                               #2640.49
-        jbe       ..B12.41      # Prob 20%                      #2640.49
-                                # LOE rsi r8 r11 r15 eax ebx r8d r11d r12d r13d r14d r8b r11b xmm0
-..B12.22:                       # Preds ..B12.21 ..B12.20
-..LN1525:
-   .loc    1  2641
-        testl     %ebx, %ebx                                    #2641.32
-        je        ..B12.24      # Prob 50%                      #2641.32
-                                # LOE rsi r8 r11 r15 eax r8d r11d r12d r13d r14d r8b r11b xmm0
-..B12.23:                       # Preds ..B12.22
-..LN1527:
-        movl      %r11d, %edx                                   #2641.43
-        lea       2(%r12,%rdx), %ecx                            #2641.43
-..LN1529:
-        cmpl      -16(%rbp), %ecx                               #2641.49
-        jbe       ..B12.41      # Prob 20%                      #2641.49
-                                # LOE rsi r8 r15 eax r8d r12d r13d r14d r8b xmm0
-..B12.24:                       # Preds ..B12.23 ..B12.22
-..LN1531:
-   .loc    1  2642
-        testl     %r8d, %r8d                                    #2642.32
-        je        ..B12.26      # Prob 50%                      #2642.32
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B12.25:                       # Preds ..B12.24
-..LN1533:
-        lea       3(%r12,%rax), %eax                            #2642.43
-..LN1535:
-        cmpl      -16(%rbp), %eax                               #2642.49
-        jbe       ..B12.41      # Prob 20%                      #2642.49
-                                # LOE rsi r15 r12d r13d r14d xmm0
-..B12.26:                       # Preds ..B12.25 ..B12.24 ..B12.13
-..LN1537:
-   .loc    1  2647
-        lea       4(%r12), %eax                                 #2647.17
-..LN1539:
-   .loc    1  2650
-        cmpl      -16(%rbp), %eax                               #2650.28
-        ja        ..B12.38      # Prob 20%                      #2650.28
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B12.27:                       # Preds ..B12.26
-..LN1541:
-   .loc    1  2654
-        decl      %r13d                                         #2654.25
-..LN1543:
-        jne       ..B12.33      # Prob 50%                      #2654.39
-                                # LOE rsi r15 eax r12d r13d r14d xmm0
-..B12.28:                       # Preds ..B12.27
-..LN1545:
-   .loc    1  2675
-        cmpq      -64(%rbp), %r15                               #2675.25
-        jae       ..B12.38      # Prob 4%                       #2675.25
-                                # LOE r15 r12d r14d
-..B12.29:                       # Preds ..B12.28
-..LN1547:
-   .loc    1  2679
-        lea       60(%r12), %eax                                #2679.13
-..LN1549:
-   .loc    1  2680
-        cmpl      -16(%rbp), %eax                               #2680.24
-        ja        ..B12.38      # Prob 4%                       #2680.24
-                                # LOE r15 eax r14d
-..B12.30:                       # Preds ..B12.29
-..LN1551:
-   .loc    1  2685
-        movq      -64(%rbp), %rsi                               #2685.22
-        movl      %eax, -200(%rbp)                              #2685.22
-        movq      %r15, %rdi                                    #2685.22
-        call      prime_buffer_2na at PLT                          #2685.22
-                                # LOE r15 r14d xmm0
-..B12.54:                       # Preds ..B12.30
-        movl      -200(%rbp), %eax                              #
-..LN1553:
-   .loc    1  2763
-        addq      $16, %r15                                     #2763.13
-..LN1555:
-   .loc    1  2766
-        cmpq      -64(%rbp), %r15                               #2766.24
-..LN1557:
-   .loc    1  2763
-        movq      %r15, %rsi                                    #2763.13
-..LN1559:
-   .loc    1  2766
-        jae       ..B12.32      # Prob 12%                      #2766.24
-                                # LOE rax rsi r15 eax r14d al ah xmm0
-..B12.31:                       # Preds ..B12.54
-..LN1561:
-   .loc    1  2767
-        movzbl    -1(%r15), %r14d                               #2767.32
-..LN1563:
-        shll      $8, %r14d                                     #2767.46
-                                # LOE rsi r15 eax r14d xmm0
-..B12.32:                       # Preds ..B12.54 ..B12.7 ..B12.31
-..LN1565:
-   .loc    1  2568
-        movl      $2, %r13d                                     #2568.13
-        jmp       ..B12.36      # Prob 100%                     #2568.13
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B12.33:                       # Preds ..B12.27
-..LN1567:
-   .loc    1  2662
-        cmpq      -64(%rbp), %rsi                               #2662.26
-..LN1569:
-   .loc    1  2659
-        psrldq    $1, %xmm0                                     #2659.26
-..LN1571:
-   .loc    1  2662
-        jae       ..B12.35      # Prob 19%                      #2662.26
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B12.34:                       # Preds ..B12.33
-..LN1573:
-   .loc    1  2665
-        movzbl    (%rsi), %edx                                  #2665.37
-..LN1575:
-   .loc    1  2664
-        sarl      $8, %r14d                                     #2664.21
-..LN1577:
-   .loc    1  2665
-        shll      $8, %edx                                      #2665.48
-..LN1579:
-        orl       %edx, %r14d                                   #2665.21
-..LN1581:
-   .loc    1  2666
-        pinsrw    $7, %r14d, %xmm0                              #2666.30
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B12.35:                       # Preds ..B12.34 ..B12.33
-..LN1583:
-   .loc    1  2670
-        incq      %rsi                                          #2670.20
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B12.36:                       # Preds ..B12.32 ..B12.35 ..B12.40
-..LN1585:
-   .loc    1  2578
-        movdqa    %xmm0, %xmm1                                  #2578.22
-        pand      -160(%rbp), %xmm1                             #2578.22
-..LN1587:
-   .loc    1  2579
-        pcmpeqw   -144(%rbp), %xmm1                             #2579.22
-..LN1589:
-   .loc    1  2580
-        pmovmskb  %xmm1, %edx                                   #2580.22
-        jmp       ..B12.11      # Prob 100%                     #2580.22
-                                # LOE rsi r15 eax edx r13d r14d xmm0
-..B12.38:                       # Preds ..B12.26 ..B12.28 ..B12.29 # Infreq
-..LN1591:
-   .loc    1  2776
-        movq      -32(%rbp), %rbx                               #2776.12
-..___tag_value_eval_2na_16.498:                                 #
-        movq      -40(%rbp), %r12                               #2776.12
-..___tag_value_eval_2na_16.499:                                 #
-        movq      -24(%rbp), %r13                               #2776.12
-..___tag_value_eval_2na_16.500:                                 #
-        movq      -48(%rbp), %r14                               #2776.12
-..___tag_value_eval_2na_16.501:                                 #
-        xorl      %eax, %eax                                    #2776.12
-        movq      -56(%rbp), %r15                               #2776.12
-..___tag_value_eval_2na_16.502:                                 #
-        movq      %rbp, %rsp                                    #2776.12
-        popq      %rbp                                          #2776.12
-..___tag_value_eval_2na_16.503:                                 #
-        ret                                                     #2776.12
-..___tag_value_eval_2na_16.504:                                 #
-                                # LOE
-..B12.40:                       # Preds ..B12.3                 # Infreq
-        movdqa    %xmm8, -112(%rbp)                             #
-        movdqa    %xmm1, -96(%rbp)                              #
-        movdqa    %xmm2, -176(%rbp)                             #
-        movdqa    %xmm3, -128(%rbp)                             #
-        movdqa    %xmm4, -80(%rbp)                              #
-        movdqa    %xmm5, -192(%rbp)                             #
-        movdqa    %xmm6, -160(%rbp)                             #
-        movdqa    %xmm7, -144(%rbp)                             #
-        movq      %r12, -64(%rbp)                               #
-        movl      %eax, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        jmp       ..B12.36      # Prob 100%                     #
-                                # LOE rsi r15 eax r13d r14d xmm0
-..B12.41:                       # Preds ..B12.23 ..B12.21 ..B12.19 ..B12.25 # Infreq
-..LN1593:
-   .loc    1  2642
-        movq      -32(%rbp), %rbx                               #2642.63
-..___tag_value_eval_2na_16.510:                                 #
-        movq      -40(%rbp), %r12                               #2642.63
-..___tag_value_eval_2na_16.511:                                 #
-        movq      -24(%rbp), %r13                               #2642.63
-..___tag_value_eval_2na_16.512:                                 #
-        movq      -48(%rbp), %r14                               #2642.63
-..___tag_value_eval_2na_16.513:                                 #
-        movl      $1, %eax                                      #2642.63
-        movq      -56(%rbp), %r15                               #2642.63
-..___tag_value_eval_2na_16.514:                                 #
-        movq      %rbp, %rsp                                    #2642.63
-        popq      %rbp                                          #2642.63
-..___tag_value_eval_2na_16.515:                                 #
-        ret                                                     #2642.63
-        .align    16,0x90
-..___tag_value_eval_2na_16.516:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-.LNeval_2na_16:
-	.data
-# -- End  eval_2na_16
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    16,0x90
-eval_2na_8:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B13.1:                        # Preds ..B13.0
-..___tag_value_eval_2na_8.517:                                  #2196.1
-..LN1595:
-   .loc    1  2196
-        pushq     %rbp                                          #2196.1
-        movq      %rsp, %rbp                                    #2196.1
-..___tag_value_eval_2na_8.518:                                  #
-        subq      $224, %rsp                                    #2196.1
-        movq      %r15, -48(%rbp)                               #2196.1
-..___tag_value_eval_2na_8.520:                                  #
-        movq      %r14, -40(%rbp)                               #2196.1
-..___tag_value_eval_2na_8.521:                                  #
-        movq      %r13, -32(%rbp)                               #2196.1
-..___tag_value_eval_2na_8.522:                                  #
-        movq      %r12, -24(%rbp)                               #2196.1
-..___tag_value_eval_2na_8.523:                                  #
-        movq      %rbx, -56(%rbp)                               #2196.1
-..___tag_value_eval_2na_8.524:                                  #
-        movl      %ecx, %ebx                                    #2196.1
-        movl      %edx, %r12d                                   #2196.1
-        movq      %rsi, %r15                                    #2196.1
-        movq      %rdi, %r13                                    #2196.1
-        lea       _gprof_pack12(%rip), %rdx                     #2196.1
-        call      mcount at PLT                                    #2196.1
-                                # LOE r13 r15 ebx r12d
-..B13.40:                       # Preds ..B13.1
-..LN1597:
-   .loc    1  2233
-        lea       (%r12,%rbx), %eax                             #2233.5
-..LN1599:
-   .loc    1  2239
-        subl      4(%r13), %eax                                 #2239.12
-..LN1601:
-   .loc    1  2245
-        movl      %eax, -224(%rbp)                              #2245.14
-..LN1603:
-   .loc    1  2236
-        movl      %r12d, %r14d                                  #2236.49
-        shrl      $2, %r14d                                     #2236.49
-..LN1605:
-        lea       (%r15,%r14), %rdi                             #2236.30
-..LN1607:
-   .loc    1  2242
-        lea       3(%r12,%rbx), %esi                            #2242.50
-..LN1609:
-        shrl      $2, %esi                                      #2242.57
-..LN1611:
-        addq      %r15, %rsi                                    #2242.30
-        movq      %rsi, -16(%rbp)                               #2242.30
-..LN1613:
-   .loc    1  2245
-        call      prime_buffer_2na at PLT                          #2245.14
-                                # LOE r13 r14 r15 r12d xmm0
-..B13.41:                       # Preds ..B13.40
-        movl      -224(%rbp), %eax                              #
-..LN1615:
-   .loc    1  2256
-        movdqa    16(%r13), %xmm7                               #2256.5
-        movdqa    32(%r13), %xmm6                               #2256.5
-        movdqa    48(%r13), %xmm5                               #2256.5
-        movdqa    64(%r13), %xmm4                               #2256.5
-        movdqa    80(%r13), %xmm3                               #2256.5
-        movdqa    96(%r13), %xmm2                               #2256.5
-        movdqa    112(%r13), %xmm1                              #2256.5
-        movdqa    128(%r13), %xmm8                              #2256.5
-..LN1617:
-   .loc    1  2246
-        lea       16(%r15,%r14), %rbx                           #2246.5
-..LN1619:
-   .loc    1  2259
-        xorl      %r15d, %r15d                                  #2259.15
-..LN1621:
-        xorl      %ecx, %ecx                                    #2259.10
-..LN1623:
-        xorl      %r14d, %r14d                                  #2259.5
-..LN1625:
-   .loc    1  2268
-        movl      %r12d, %edx                                   #2268.20
-        andl      $3, %edx                                      #2268.20
-        je        ..B13.5       # Prob 20%                      #2268.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B13.2:                        # Preds ..B13.41
-        cmpl      $1, %edx                                      #2268.20
-        je        ..B13.8       # Prob 25%                      #2268.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B13.3:                        # Preds ..B13.2
-        cmpl      $2, %edx                                      #2268.20
-        je        ..B13.7       # Prob 33%                      #2268.20
-                                # LOE rax rbx eax edx ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B13.4:                        # Preds ..B13.3
-        cmpl      $3, %edx                                      #2268.20
-        je        ..B13.6       # Prob 50%                      #2268.20
-                                # LOE rax rbx eax ecx r12d r14d r15d al ah xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B13.5:                        # Preds ..B13.41 ..B13.4
-        movdqa    %xmm8, -96(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -176(%rbp)                             #
-        movdqa    %xmm4, -144(%rbp)                             #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -80(%rbp)                              #
-        movdqa    %xmm7, -192(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B13.28      # Prob 100%                     #
-                                # LOE rbx r12d r13d xmm0
-..B13.6:                        # Preds ..B13.4
-        movdqa    %xmm8, -96(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -176(%rbp)                             #
-        movdqa    %xmm4, -144(%rbp)                             #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -80(%rbp)                              #
-        movdqa    %xmm7, -192(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B13.11      # Prob 100%                     #
-                                # LOE rbx ecx r12d r13d r14d r15d xmm0
-..B13.7:                        # Preds ..B13.3
-        movdqa    %xmm8, -96(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -176(%rbp)                             #
-        movdqa    %xmm4, -144(%rbp)                             #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -80(%rbp)                              #
-        movdqa    %xmm7, -192(%rbp)                             #
-        movl      %eax, %r13d                                   #
-        jmp       ..B13.10      # Prob 100%                     #
-                                # LOE rbx ecx r12d r13d r14d xmm0
-..B13.8:                        # Preds ..B13.2
-        movdqa    %xmm8, -96(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -160(%rbp)                             #
-        movdqa    %xmm3, -176(%rbp)                             #
-        movdqa    %xmm4, -144(%rbp)                             #
-        movdqa    %xmm5, -128(%rbp)                             #
-        movdqa    %xmm6, -80(%rbp)                              #
-        movdqa    %xmm7, -192(%rbp)                             #
-        movl      %eax, %r13d                                   #
-                                # LOE rbx r12d r13d r14d xmm0
-..B13.9:                        # Preds ..B13.8 ..B13.28
-..LN1627:
-   .loc    1  2291
-        movdqa    %xmm0, %xmm1                                  #2291.22
-        pand      -144(%rbp), %xmm1                             #2291.22
-..LN1629:
-   .loc    1  2292
-        pcmpeqb   -128(%rbp), %xmm1                             #2292.22
-..LN1631:
-   .loc    1  2293
-        pmovmskb  %xmm1, %ecx                                   #2293.22
-                                # LOE rbx ecx r12d r13d r14d xmm0
-..B13.10:                       # Preds ..B13.7 ..B13.9
-..LN1633:
-   .loc    1  2297
-        movdqa    %xmm0, %xmm1                                  #2297.22
-        pand      -160(%rbp), %xmm1                             #2297.22
-..LN1635:
-   .loc    1  2298
-        pcmpeqb   -176(%rbp), %xmm1                             #2298.22
-..LN1637:
-   .loc    1  2299
-        pmovmskb  %xmm1, %r15d                                  #2299.22
-                                # LOE rbx ecx r12d r13d r14d r15d xmm0
-..B13.11:                       # Preds ..B13.6 ..B13.10
-..LN1639:
-   .loc    1  2303
-        pand      -96(%rbp), %xmm0                              #2303.22
-..LN1641:
-   .loc    1  2313
-        movl      %r14d, %esi                                   #2313.29
-..LN1643:
-   .loc    1  2304
-        pcmpeqb   -112(%rbp), %xmm0                             #2304.22
-..LN1645:
-   .loc    1  2305
-        pmovmskb  %xmm0, %edx                                   #2305.22
-..LN1647:
-   .loc    1  2310
-        andl      $-4, %r12d                                    #2310.17
-..LN1649:
-   .loc    1  2305
-        movl      %edx, -64(%rbp)                               #2305.22
-..LN1651:
-   .loc    1  2313
-        orl       %ecx, %esi                                    #2313.29
-..LN1653:
-        orl       %r15d, %esi                                   #2313.34
-..LN1655:
-        orl       %edx, %esi                                    #2313.39
-..LN1657:
-        je        ..B13.24      # Prob 78%                      #2313.47
-                                # LOE rbx ecx r12d r13d r14d r15d
-..B13.12:                       # Preds ..B13.11
-..LN1659:
-   .loc    1  2331
-        movl      %ecx, -208(%rbp)                              #2331.30
-        movl      %r14d, %edi                                   #2331.30
-        call      uint16_lsbit at PLT                              #2331.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B13.42:                       # Preds ..B13.12
-        movl      -208(%rbp), %ecx                              #
-                                # LOE rcx rbx eax ecx r12d r13d r14d r15d cl ch
-..B13.13:                       # Preds ..B13.42
-..LN1661:
-   .loc    1  2332
-        movl      %ecx, -208(%rbp)                              #2332.30
-..LN1663:
-   .loc    1  2331
-        movswq    %ax, %rdx                                     #2331.30
-        movl      %edx, -216(%rbp)                              #2331.30
-..LN1665:
-   .loc    1  2332
-        movl      %ecx, %edi                                    #2332.30
-        call      uint16_lsbit at PLT                              #2332.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B13.43:                       # Preds ..B13.13
-        movl      -208(%rbp), %ecx                              #
-                                # LOE rcx rbx eax ecx r12d r13d r14d r15d cl ch
-..B13.14:                       # Preds ..B13.43
-..LN1667:
-   .loc    1  2333
-        movl      %ecx, -208(%rbp)                              #2333.30
-..LN1669:
-   .loc    1  2332
-        movswq    %ax, %rdx                                     #2332.30
-        movl      %edx, -224(%rbp)                              #2332.30
-..LN1671:
-   .loc    1  2333
-        movl      %r15d, %edi                                   #2333.30
-        call      uint16_lsbit at PLT                              #2333.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B13.44:                       # Preds ..B13.14
-        movl      -208(%rbp), %ecx                              #
-                                # LOE rcx rbx eax ecx r12d r13d r14d r15d cl ch
-..B13.15:                       # Preds ..B13.44
-..LN1673:
-   .loc    1  2334
-        movl      -64(%rbp), %edi                               #2334.30
-        movl      %ecx, -208(%rbp)                              #2334.30
-..LN1675:
-   .loc    1  2333
-        movswq    %ax, %rdx                                     #2333.30
-..LN1677:
-   .loc    1  2334
-        movl      %edx, -200(%rbp)                              #2334.30
-        call      uint16_lsbit at PLT                              #2334.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B13.45:                       # Preds ..B13.15
-        movl      -208(%rbp), %ecx                              #
-        movl      -200(%rbp), %edx                              #
-                                # LOE rdx rcx rbx eax edx ecx r12d r13d r14d r15d dl cl dh ch
-..B13.16:                       # Preds ..B13.45
-..LN1679:
-   .loc    1  2339
-        movl      -216(%rbp), %esi                              #2339.34
-..LN1681:
-   .loc    1  2340
-        movl      -224(%rbp), %r8d                              #2340.34
-..LN1683:
-   .loc    1  2334
-        movswq    %ax, %rax                                     #2334.30
-..LN1685:
-   .loc    1  2339
-        shll      $2, %esi                                      #2339.34
-..LN1687:
-   .loc    1  2340
-        shll      $2, %r8d                                      #2340.34
-..LN1689:
-   .loc    1  2339
-        movl      %esi, -216(%rbp)                              #2339.34
-..LN1691:
-   .loc    1  2340
-        movl      %r8d, -224(%rbp)                              #2340.34
-..LN1693:
-   .loc    1  2341
-        shll      $2, %edx                                      #2341.34
-..LN1695:
-   .loc    1  2342
-        shll      $2, %eax                                      #2342.34
-..LN1697:
-   .loc    1  2346
-        testl     %r14d, %r14d                                  #2346.32
-        je        ..B13.18      # Prob 50%                      #2346.32
-                                # LOE rcx rbx rsi r8 eax edx ecx esi r8d r12d r13d r15d cl sil r8b ch
-..B13.17:                       # Preds ..B13.16
-..LN1699:
-        addl      %r12d, %esi                                   #2346.43
-..LN1701:
-        cmpl      %esi, %r13d                                   #2346.49
-        jae       ..B13.33      # Prob 20%                      #2346.49
-                                # LOE rcx rbx r8 eax edx ecx r8d r12d r13d r15d cl r8b ch
-..B13.18:                       # Preds ..B13.17 ..B13.16
-..LN1703:
-   .loc    1  2347
-        testl     %ecx, %ecx                                    #2347.32
-        je        ..B13.20      # Prob 50%                      #2347.32
-                                # LOE rbx r8 eax edx r8d r12d r13d r15d r8b
-..B13.19:                       # Preds ..B13.18
-..LN1705:
-        movl      %r8d, %ecx                                    #2347.43
-        lea       1(%r12,%rcx), %esi                            #2347.43
-..LN1707:
-        cmpl      %esi, %r13d                                   #2347.49
-        jae       ..B13.33      # Prob 20%                      #2347.49
-                                # LOE rbx eax edx r12d r13d r15d
-..B13.20:                       # Preds ..B13.19 ..B13.18
-..LN1709:
-   .loc    1  2348
-        testl     %r15d, %r15d                                  #2348.32
-        je        ..B13.22      # Prob 50%                      #2348.32
-                                # LOE rbx eax edx r12d r13d
-..B13.21:                       # Preds ..B13.20
-..LN1711:
-        lea       2(%r12,%rdx), %edx                            #2348.43
-..LN1713:
-        cmpl      %edx, %r13d                                   #2348.49
-        jae       ..B13.33      # Prob 20%                      #2348.49
-                                # LOE rbx eax r12d r13d
-..B13.22:                       # Preds ..B13.21 ..B13.20
-..LN1715:
-   .loc    1  2349
-        movl      -64(%rbp), %edx                               #2349.32
-        testl     %edx, %edx                                    #2349.32
-        je        ..B13.24      # Prob 50%                      #2349.32
-                                # LOE rbx eax r12d r13d
-..B13.23:                       # Preds ..B13.22
-..LN1717:
-        lea       3(%r12,%rax), %edx                            #2349.43
-..LN1719:
-        cmpl      %edx, %r13d                                   #2349.49
-        jae       ..B13.33      # Prob 20%                      #2349.49
-                                # LOE rbx r12d r13d
-..B13.24:                       # Preds ..B13.23 ..B13.22 ..B13.11
-..LN1721:
-   .loc    1  2386
-        lea       4(%r12), %edx                                 #2386.13
-..LN1723:
-   .loc    1  2357
-        cmpl      %edx, %r13d                                   #2357.28
-        jb        ..B13.30      # Prob 20%                      #2357.28
-                                # LOE rbx r12d r13d
-..B13.25:                       # Preds ..B13.24
-..LN1725:
-   .loc    1  2382
-        cmpq      -16(%rbp), %rbx                               #2382.25
-        jae       ..B13.30      # Prob 4%                       #2382.25
-                                # LOE rbx r12d r13d
-..B13.26:                       # Preds ..B13.25
-..LN1727:
-   .loc    1  2386
-        addl      $64, %r12d                                    #2386.13
-..LN1729:
-   .loc    1  2387
-        cmpl      %r13d, %r12d                                  #2387.24
-        ja        ..B13.30      # Prob 4%                       #2387.24
-                                # LOE rbx r12d r13d
-..B13.27:                       # Preds ..B13.26
-..LN1731:
-   .loc    1  2392
-        movq      -16(%rbp), %rsi                               #2392.22
-        movq      %rbx, %rdi                                    #2392.22
-        call      prime_buffer_2na at PLT                          #2392.22
-                                # LOE rbx r12d r13d xmm0
-..B13.46:                       # Preds ..B13.27
-..LN1733:
-   .loc    1  2470
-        addq      $16, %rbx                                     #2470.13
-                                # LOE rbx r12d r13d xmm0
-..B13.28:                       # Preds ..B13.5 ..B13.46
-..LN1735:
-   .loc    1  2285
-        movdqa    %xmm0, %xmm1                                  #2285.22
-        pand      -80(%rbp), %xmm1                              #2285.22
-..LN1737:
-   .loc    1  2286
-        pcmpeqb   -192(%rbp), %xmm1                             #2286.22
-..LN1739:
-   .loc    1  2287
-        pmovmskb  %xmm1, %r14d                                  #2287.22
-        jmp       ..B13.9       # Prob 100%                     #2287.22
-                                # LOE rbx r12d r13d r14d xmm0
-..B13.30:                       # Preds ..B13.24 ..B13.25 ..B13.26 # Infreq
-..LN1741:
-   .loc    1  2483
-        movq      -56(%rbp), %rbx                               #2483.12
-..___tag_value_eval_2na_8.525:                                  #
-        movq      -24(%rbp), %r12                               #2483.12
-..___tag_value_eval_2na_8.526:                                  #
-        movq      -32(%rbp), %r13                               #2483.12
-..___tag_value_eval_2na_8.527:                                  #
-        movq      -40(%rbp), %r14                               #2483.12
-..___tag_value_eval_2na_8.528:                                  #
-        xorl      %eax, %eax                                    #2483.12
-        movq      -48(%rbp), %r15                               #2483.12
-..___tag_value_eval_2na_8.529:                                  #
-        movq      %rbp, %rsp                                    #2483.12
-        popq      %rbp                                          #2483.12
-..___tag_value_eval_2na_8.530:                                  #
-        ret                                                     #2483.12
-..___tag_value_eval_2na_8.531:                                  #
-                                # LOE
-..B13.33:                       # Preds ..B13.23 ..B13.21 ..B13.19 ..B13.17 # Infreq
-..LN1743:
-   .loc    1  2346
-        movq      -56(%rbp), %rbx                               #2346.63
-..___tag_value_eval_2na_8.537:                                  #
-        movq      -24(%rbp), %r12                               #2346.63
-..___tag_value_eval_2na_8.538:                                  #
-        movq      -32(%rbp), %r13                               #2346.63
-..___tag_value_eval_2na_8.539:                                  #
-        movq      -40(%rbp), %r14                               #2346.63
-..___tag_value_eval_2na_8.540:                                  #
-        movl      $1, %eax                                      #2346.63
-        movq      -48(%rbp), %r15                               #2346.63
-..___tag_value_eval_2na_8.541:                                  #
-        movq      %rbp, %rsp                                    #2346.63
-        popq      %rbp                                          #2346.63
-..___tag_value_eval_2na_8.542:                                  #
-        ret                                                     #2346.63
-        .align    16,0x90
-..___tag_value_eval_2na_8.543:                                  #
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-.LNeval_2na_8:
-	.data
-# -- End  eval_2na_8
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    16,0x90
-eval_4na_64:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B14.1:                        # Preds ..B14.0
-..___tag_value_eval_4na_64.544:                                 #4501.1
-..LN1745:
-   .loc    1  4501
-        pushq     %rbp                                          #4501.1
-        movq      %rsp, %rbp                                    #4501.1
-..___tag_value_eval_4na_64.545:                                 #
-        subq      $256, %rsp                                    #4501.1
-        movq      %r15, -184(%rbp)                              #4501.1
-..___tag_value_eval_4na_64.547:                                 #
-        movq      %r14, -24(%rbp)                               #4501.1
-..___tag_value_eval_4na_64.548:                                 #
-        movq      %r13, -32(%rbp)                               #4501.1
-..___tag_value_eval_4na_64.549:                                 #
-        movq      %r12, -48(%rbp)                               #4501.1
-..___tag_value_eval_4na_64.550:                                 #
-        movq      %rbx, -40(%rbp)                               #4501.1
-..___tag_value_eval_4na_64.551:                                 #
-        movl      %ecx, %ebx                                    #4501.1
-        movl      %edx, %r12d                                   #4501.1
-        movq      %rsi, %r15                                    #4501.1
-        movq      %rdi, %r13                                    #4501.1
-        lea       _gprof_pack13(%rip), %rdx                     #4501.1
-        call      mcount at PLT                                    #4501.1
-                                # LOE r13 r15 ebx r12d
-..B14.45:                       # Preds ..B14.1
-..LN1747:
-   .loc    1  4535
-        lea       (%r12,%rbx), %ecx                             #4535.5
-..LN1749:
-   .loc    1  4541
-        subl      4(%r13), %ecx                                 #4541.12
-..LN1751:
-   .loc    1  4547
-        movl      %ecx, -8(%rbp)                                #4547.14
-..LN1753:
-   .loc    1  4538
-        movl      %r12d, %r14d                                  #4538.49
-        shrl      $2, %r14d                                     #4538.49
-..LN1755:
-        lea       (%r15,%r14), %rdi                             #4538.30
-..LN1757:
-   .loc    1  4544
-        lea       3(%r12,%rbx), %esi                            #4544.50
-..LN1759:
-        shrl      $2, %esi                                      #4544.57
-..LN1761:
-        addq      %r15, %rsi                                    #4544.30
-        movq      %rsi, -16(%rbp)                               #4544.30
-..LN1763:
-   .loc    1  4547
-        call      prime_buffer_4na at PLT                          #4547.14
-                                # LOE r13 r14 r15 r12d xmm0
-..B14.46:                       # Preds ..B14.45
-        movl      -8(%rbp), %ecx                                #
-..LN1765:
-   .loc    1  4554
-        movdqa    16(%r13), %xmm7                               #4554.5
-        movdqa    32(%r13), %xmm6                               #4554.5
-        movdqa    48(%r13), %xmm5                               #4554.5
-        movdqa    64(%r13), %xmm4                               #4554.5
-        movdqa    80(%r13), %xmm3                               #4554.5
-        movdqa    96(%r13), %xmm2                               #4554.5
-        movdqa    112(%r13), %xmm1                              #4554.5
-        movdqa    128(%r13), %xmm8                              #4554.5
-..LN1767:
-   .loc    1  4548
-        lea       8(%r15,%r14), %rbx                            #4548.5
-        movq      %rbx, %rdx                                    #4548.5
-..LN1769:
-   .loc    1  4557
-        xorl      %r15d, %r15d                                  #4557.15
-..LN1771:
-        xorl      %r14d, %r14d                                  #4557.10
-..LN1773:
-        xorl      %r13d, %r13d                                  #4557.5
-..LN1775:
-   .loc    1  4563
-        movl      $4, %esi                                      #4563.5
-..LN1777:
-   .loc    1  4568
-        movl      %r12d, %edi                                   #4568.20
-        andl      $3, %edi                                      #4568.20
-        je        ..B14.37      # Prob 20%                      #4568.20
-                                # LOE rdx rcx rbx ecx esi edi r12d r13d r14d r15d cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B14.2:                        # Preds ..B14.46
-        cmpl      $1, %edi                                      #4568.20
-        je        ..B14.8       # Prob 25%                      #4568.20
-                                # LOE rdx rcx rbx ecx esi edi r12d r13d r14d r15d cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B14.3:                        # Preds ..B14.2
-        cmpl      $2, %edi                                      #4568.20
-        je        ..B14.7       # Prob 33%                      #4568.20
-                                # LOE rdx rcx rbx ecx esi edi r12d r13d r14d r15d cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B14.4:                        # Preds ..B14.3
-        cmpl      $3, %edi                                      #4568.20
-        je        ..B14.6       # Prob 50%                      #4568.20
-                                # LOE rdx rcx rbx ecx esi r12d r13d r14d r15d cl ch xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B14.5:                        # Preds ..B14.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -64(%rbp)                              #
-        movdqa    %xmm4, -176(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -128(%rbp)                             #
-        movl      %r12d, %eax                                   #
-        movl      %ecx, -8(%rbp)                                #
-        jmp       ..B14.29      # Prob 100%                     #
-                                # LOE rdx rbx eax xmm0
-..B14.6:                        # Preds ..B14.4
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -64(%rbp)                              #
-        movdqa    %xmm4, -176(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -128(%rbp)                             #
-        movl      %r12d, %eax                                   #
-        movl      %ecx, -8(%rbp)                                #
-        jmp       ..B14.11      # Prob 100%                     #
-                                # LOE rdx rbx eax esi r13d r14d r15d xmm0
-..B14.7:                        # Preds ..B14.3
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -64(%rbp)                              #
-        movdqa    %xmm4, -176(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -128(%rbp)                             #
-        movl      %r12d, %eax                                   #
-        movl      %ecx, -8(%rbp)                                #
-        jmp       ..B14.10      # Prob 100%                     #
-                                # LOE rdx rbx eax esi r13d r14d xmm0
-..B14.8:                        # Preds ..B14.2
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -64(%rbp)                              #
-        movdqa    %xmm4, -176(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -128(%rbp)                             #
-        movl      %r12d, %eax                                   #
-        movl      %ecx, -8(%rbp)                                #
-                                # LOE rdx rbx eax esi r13d xmm0
-..B14.9:                        # Preds ..B14.8 ..B14.33
-..LN1779:
-   .loc    1  4592
-        movdqa    %xmm0, %xmm2                                  #4592.22
-..LN1781:
-   .loc    1  4593
-        movdqa    %xmm0, %xmm1                                  #4593.22
-..LN1783:
-   .loc    1  4592
-        pand      -160(%rbp), %xmm2                             #4592.22
-..LN1785:
-   .loc    1  4593
-        pand      -176(%rbp), %xmm1                             #4593.22
-..LN1787:
-   .loc    1  4594
-        pcmpeqd   %xmm1, %xmm2                                  #4594.22
-..LN1789:
-   .loc    1  4595
-        pmovmskb  %xmm2, %r14d                                  #4595.22
-..LN1791:
-   .loc    1  4596
-        movl      %r14d, %ecx                                   #4596.17
-        andl      $3855, %ecx                                   #4596.17
-        shll      $4, %ecx                                      #4596.17
-        andl      %ecx, %r14d                                   #4596.17
-        movl      %r14d, %edi                                   #4596.17
-        shrl      $4, %edi                                      #4596.17
-        orl       %edi, %r14d                                   #4596.17
-                                # LOE rdx rbx eax esi r13d r14d xmm0
-..B14.10:                       # Preds ..B14.7 ..B14.9
-..LN1793:
-   .loc    1  4599
-        movdqa    %xmm0, %xmm2                                  #4599.22
-..LN1795:
-   .loc    1  4600
-        movdqa    %xmm0, %xmm1                                  #4600.22
-..LN1797:
-   .loc    1  4599
-        pand      -64(%rbp), %xmm2                              #4599.22
-..LN1799:
-   .loc    1  4600
-        pand      -96(%rbp), %xmm1                              #4600.22
-..LN1801:
-   .loc    1  4601
-        pcmpeqd   %xmm1, %xmm2                                  #4601.22
-..LN1803:
-   .loc    1  4602
-        pmovmskb  %xmm2, %r15d                                  #4602.22
-..LN1805:
-   .loc    1  4603
-        movl      %r15d, %ecx                                   #4603.17
-        andl      $3855, %ecx                                   #4603.17
-        shll      $4, %ecx                                      #4603.17
-        andl      %ecx, %r15d                                   #4603.17
-        movl      %r15d, %edi                                   #4603.17
-        shrl      $4, %edi                                      #4603.17
-        orl       %edi, %r15d                                   #4603.17
-                                # LOE rdx rbx eax esi r13d r14d r15d xmm0
-..B14.11:                       # Preds ..B14.6 ..B14.10
-..LN1807:
-   .loc    1  4606
-        movdqa    %xmm0, %xmm2                                  #4606.22
-..LN1809:
-   .loc    1  4607
-        movdqa    %xmm0, %xmm1                                  #4607.22
-..LN1811:
-   .loc    1  4606
-        pand      -112(%rbp), %xmm2                             #4606.22
-..LN1813:
-   .loc    1  4607
-        pand      -80(%rbp), %xmm1                              #4607.22
-..LN1815:
-   .loc    1  4608
-        pcmpeqd   %xmm1, %xmm2                                  #4608.22
-..LN1817:
-   .loc    1  4609
-        pmovmskb  %xmm2, %r12d                                  #4609.22
-..LN1819:
-   .loc    1  4610
-        movl      %r12d, %ecx                                   #4610.17
-        andl      $3855, %ecx                                   #4610.17
-        shll      $4, %ecx                                      #4610.17
-        andl      %ecx, %r12d                                   #4610.17
-        movl      %r12d, %edi                                   #4610.17
-        shrl      $4, %edi                                      #4610.17
-        orl       %edi, %r12d                                   #4610.17
-..LN1821:
-   .loc    1  4614
-        movl      %eax, %ecx                                    #4614.17
-        andl      $-4, %ecx                                     #4614.17
-..LN1823:
-   .loc    1  4617
-        movl      %r13d, %eax                                   #4617.29
-        orl       %r14d, %eax                                   #4617.29
-..LN1825:
-        orl       %r15d, %eax                                   #4617.34
-..LN1827:
-        orl       %r12d, %eax                                   #4617.39
-..LN1829:
-        je        ..B14.24      # Prob 78%                      #4617.47
-                                # LOE rdx rbx ecx esi r12d r13d r14d r15d xmm0
-..B14.12:                       # Preds ..B14.11
-..LN1831:
-   .loc    1  4635
-        movdqa    %xmm0, -256(%rbp)                             #4635.30
-        movl      %r13d, %edi                                   #4635.30
-        movl      %esi, -216(%rbp)                              #4635.30
-        movl      %ecx, -208(%rbp)                              #4635.30
-        movq      %rdx, -200(%rbp)                              #4635.30
-        call      uint16_lsbit at PLT                              #4635.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B14.47:                       # Preds ..B14.12
-        movq      -200(%rbp), %rdx                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %esi                              #
-                                # LOE rdx rcx rbx rsi eax ecx esi r12d r13d r14d r15d cl sil ch xmm0
-..B14.13:                       # Preds ..B14.47
-..LN1833:
-   .loc    1  4636
-        movdqa    %xmm0, -256(%rbp)                             #4636.30
-        movl      %r14d, %edi                                   #4636.30
-        movl      %esi, -216(%rbp)                              #4636.30
-..LN1835:
-   .loc    1  4635
-        movswq    %ax, %rax                                     #4635.30
-        movl      %eax, -240(%rbp)                              #4635.30
-..LN1837:
-   .loc    1  4636
-        movl      %ecx, -208(%rbp)                              #4636.30
-        movq      %rdx, -200(%rbp)                              #4636.30
-        call      uint16_lsbit at PLT                              #4636.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B14.48:                       # Preds ..B14.13
-        movq      -200(%rbp), %rdx                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %esi                              #
-                                # LOE rdx rcx rbx rsi eax ecx esi r12d r13d r14d r15d cl sil ch xmm0
-..B14.14:                       # Preds ..B14.48
-..LN1839:
-   .loc    1  4637
-        movdqa    %xmm0, -256(%rbp)                             #4637.30
-        movl      %r15d, %edi                                   #4637.30
-        movl      %esi, -216(%rbp)                              #4637.30
-..LN1841:
-   .loc    1  4636
-        movswq    %ax, %rax                                     #4636.30
-        movl      %eax, -232(%rbp)                              #4636.30
-..LN1843:
-   .loc    1  4637
-        movl      %ecx, -208(%rbp)                              #4637.30
-        movq      %rdx, -200(%rbp)                              #4637.30
-        call      uint16_lsbit at PLT                              #4637.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B14.49:                       # Preds ..B14.14
-        movq      -200(%rbp), %rdx                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %esi                              #
-                                # LOE rdx rcx rbx rsi eax ecx esi r12d r13d r14d r15d cl sil ch xmm0
-..B14.15:                       # Preds ..B14.49
-..LN1845:
-   .loc    1  4638
-        movdqa    %xmm0, -256(%rbp)                             #4638.30
-        movl      %r12d, %edi                                   #4638.30
-        movl      %esi, -216(%rbp)                              #4638.30
-..LN1847:
-   .loc    1  4637
-        movswq    %ax, %rax                                     #4637.30
-        movl      %eax, -224(%rbp)                              #4637.30
-..LN1849:
-   .loc    1  4638
-        movl      %ecx, -208(%rbp)                              #4638.30
-        movq      %rdx, -200(%rbp)                              #4638.30
-        call      uint16_lsbit at PLT                              #4638.30
-                                # LOE rbx eax r12d r13d r14d r15d
-..B14.50:                       # Preds ..B14.15
-        movq      -200(%rbp), %rdx                              #
-        movdqa    -256(%rbp), %xmm0                             #
-        movl      -208(%rbp), %ecx                              #
-        movl      -216(%rbp), %esi                              #
-                                # LOE rdx rcx rbx rsi eax ecx esi r12d r13d r14d r15d cl sil ch xmm0
-..B14.16:                       # Preds ..B14.50
-..LN1851:
-   .loc    1  4645
-        movl      -224(%rbp), %r8d                              #4645.40
-..LN1853:
-   .loc    1  4638
-        movswq    %ax, %rdi                                     #4638.30
-..LN1855:
-   .loc    1  4644
-        movl      -232(%rbp), %eax                              #4644.40
-..LN1857:
-   .loc    1  4638
-..LN1859:
-   .loc    1  4644
-        lea       1(%rax,%rax), %eax                            #4644.40
-..LN1861:
-   .loc    1  4645
-        lea       2(%r8,%r8), %r9d                              #4645.40
-..LN1863:
-   .loc    1  4646
-        lea       3(%rdi,%rdi), %r10d                           #4646.40
-..LN1865:
-   .loc    1  4650
-        testl     %r13d, %r13d                                  #4650.32
-        je        ..B14.18      # Prob 50%                      #4650.32
-                                # LOE rdx rcx rbx rsi eax ecx esi r9d r10d r12d r14d r15d cl sil ch xmm0
-..B14.17:                       # Preds ..B14.16
-..LN1867:
-        movl      -240(%rbp), %edi                              #4650.43
-        lea       (%rcx,%rdi,2), %r8d                           #4650.43
-..LN1869:
-        cmpl      -8(%rbp), %r8d                                #4650.49
-        jbe       ..B14.38      # Prob 20%                      #4650.49
-                                # LOE rdx rcx rbx rsi eax ecx esi r9d r10d r12d r14d r15d cl sil ch xmm0
-..B14.18:                       # Preds ..B14.17 ..B14.16
-..LN1871:
-   .loc    1  4651
-        testl     %r14d, %r14d                                  #4651.32
-        je        ..B14.20      # Prob 50%                      #4651.32
-                                # LOE rdx rcx rbx rsi eax ecx esi r9d r10d r12d r15d cl sil ch xmm0
-..B14.19:                       # Preds ..B14.18
-..LN1873:
-        addl      %ecx, %eax                                    #4651.43
-..LN1875:
-        cmpl      -8(%rbp), %eax                                #4651.49
-        jbe       ..B14.38      # Prob 20%                      #4651.49
-                                # LOE rdx rcx rbx rsi ecx esi r9d r10d r12d r15d cl sil ch xmm0
-..B14.20:                       # Preds ..B14.19 ..B14.18
-..LN1877:
-   .loc    1  4652
-        testl     %r15d, %r15d                                  #4652.32
-        je        ..B14.22      # Prob 50%                      #4652.32
-                                # LOE rdx rcx rbx rsi ecx esi r9d r10d r12d cl sil ch xmm0
-..B14.21:                       # Preds ..B14.20
-..LN1879:
-        addl      %ecx, %r9d                                    #4652.43
-..LN1881:
-        cmpl      -8(%rbp), %r9d                                #4652.49
-        jbe       ..B14.38      # Prob 20%                      #4652.49
-                                # LOE rdx rcx rbx rsi ecx esi r10d r12d cl sil ch xmm0
-..B14.22:                       # Preds ..B14.21 ..B14.20
-..LN1883:
-   .loc    1  4653
-        testl     %r12d, %r12d                                  #4653.32
-        je        ..B14.24      # Prob 50%                      #4653.32
-                                # LOE rdx rcx rbx rsi ecx esi r10d cl sil ch xmm0
-..B14.23:                       # Preds ..B14.22
-..LN1885:
-        addl      %ecx, %r10d                                   #4653.43
-..LN1887:
-        cmpl      -8(%rbp), %r10d                               #4653.49
-        jbe       ..B14.38      # Prob 20%                      #4653.49
-                                # LOE rdx rbx ecx esi xmm0
-..B14.24:                       # Preds ..B14.23 ..B14.22 ..B14.11
-..LN1889:
-   .loc    1  4658
-        lea       4(%rcx), %eax                                 #4658.17
-..LN1891:
-   .loc    1  4661
-        cmpl      -8(%rbp), %eax                                #4661.28
-        ja        ..B14.35      # Prob 20%                      #4661.28
-                                # LOE rdx rbx eax ecx esi xmm0
-..B14.25:                       # Preds ..B14.24
-..LN1893:
-   .loc    1  4665
-        decl      %esi                                          #4665.25
-..LN1895:
-        jne       ..B14.30      # Prob 50%                      #4665.39
-                                # LOE rdx rbx eax ecx esi xmm0
-..B14.26:                       # Preds ..B14.25
-..LN1897:
-   .loc    1  4682
-        cmpq      -16(%rbp), %rbx                               #4682.25
-        jae       ..B14.35      # Prob 4%                       #4682.25
-                                # LOE rbx ecx
-..B14.27:                       # Preds ..B14.26
-..LN1899:
-   .loc    1  4686
-        lea       20(%rcx), %eax                                #4686.13
-..LN1901:
-   .loc    1  4687
-        cmpl      -8(%rbp), %eax                                #4687.24
-        ja        ..B14.35      # Prob 4%                       #4687.24
-                                # LOE rbx eax
-..B14.28:                       # Preds ..B14.27
-..LN1903:
-   .loc    1  4692
-        movq      -16(%rbp), %rsi                               #4692.22
-        movl      %eax, -192(%rbp)                              #4692.22
-        movq      %rbx, %rdi                                    #4692.22
-        call      prime_buffer_4na at PLT                          #4692.22
-                                # LOE rbx xmm0
-..B14.51:                       # Preds ..B14.28
-        movl      -192(%rbp), %eax                              #
-..LN1905:
-   .loc    1  4707
-        addq      $8, %rbx                                      #4707.13
-        movq      %rbx, %rdx                                    #4707.13
-                                # LOE rdx rbx eax xmm0
-..B14.29:                       # Preds ..B14.5 ..B14.51
-..LN1907:
-   .loc    1  4575
-        movl      $4, %esi                                      #4575.13
-        jmp       ..B14.33      # Prob 100%                     #4575.13
-                                # LOE rdx rbx eax esi xmm0
-..B14.30:                       # Preds ..B14.25
-..LN1909:
-   .loc    1  4673
-        cmpq      -16(%rbp), %rdx                               #4673.26
-..LN1911:
-   .loc    1  4670
-        psrldq    $2, %xmm0                                     #4670.26
-..LN1913:
-   .loc    1  4673
-        jae       ..B14.32      # Prob 19%                      #4673.26
-                                # LOE rdx rbx eax esi xmm0
-..B14.31:                       # Preds ..B14.30
-..LN1915:
-   .loc    1  4674
-        movzbl    (%rdx), %edi                                  #4674.72
-..LN1917:
-        lea       expand_2na.0(%rip), %rcx                      #4674.57
-        movzwl    (%rcx,%rdi,2), %r8d                           #4674.57
-..LN1919:
-        pinsrw    $7, %r8d, %xmm0                               #4674.30
-                                # LOE rdx rbx eax esi xmm0
-..B14.32:                       # Preds ..B14.31 ..B14.30
-..LN1921:
-   .loc    1  4677
-        incq      %rdx                                          #4677.20
-                                # LOE rdx rbx eax esi xmm0
-..B14.33:                       # Preds ..B14.29 ..B14.32 ..B14.37
-..LN1923:
-   .loc    1  4585
-        movdqa    %xmm0, %xmm2                                  #4585.22
-..LN1925:
-   .loc    1  4586
-        movdqa    %xmm0, %xmm1                                  #4586.22
-..LN1927:
-   .loc    1  4585
-        pand      -128(%rbp), %xmm2                             #4585.22
-..LN1929:
-   .loc    1  4586
-        pand      -144(%rbp), %xmm1                             #4586.22
-..LN1931:
-   .loc    1  4587
-        pcmpeqd   %xmm1, %xmm2                                  #4587.22
-..LN1933:
-   .loc    1  4588
-        pmovmskb  %xmm2, %r13d                                  #4588.22
-..LN1935:
-   .loc    1  4589
-        movl      %r13d, %ecx                                   #4589.17
-        andl      $3855, %ecx                                   #4589.17
-        shll      $4, %ecx                                      #4589.17
-        andl      %ecx, %r13d                                   #4589.17
-        movl      %r13d, %edi                                   #4589.17
-        shrl      $4, %edi                                      #4589.17
-        orl       %edi, %r13d                                   #4589.17
-        jmp       ..B14.9       # Prob 100%                     #4589.17
-                                # LOE rdx rbx eax esi r13d xmm0
-..B14.35:                       # Preds ..B14.24 ..B14.26 ..B14.27 # Infreq
-..LN1937:
-   .loc    1  4718
-        movq      -40(%rbp), %rbx                               #4718.12
-..___tag_value_eval_4na_64.552:                                 #
-        movq      -48(%rbp), %r12                               #4718.12
-..___tag_value_eval_4na_64.553:                                 #
-        movq      -32(%rbp), %r13                               #4718.12
-..___tag_value_eval_4na_64.554:                                 #
-        movq      -24(%rbp), %r14                               #4718.12
-..___tag_value_eval_4na_64.555:                                 #
-        xorl      %eax, %eax                                    #4718.12
-        movq      -184(%rbp), %r15                              #4718.12
-..___tag_value_eval_4na_64.556:                                 #
-        movq      %rbp, %rsp                                    #4718.12
-        popq      %rbp                                          #4718.12
-..___tag_value_eval_4na_64.557:                                 #
-        ret                                                     #4718.12
-..___tag_value_eval_4na_64.558:                                 #
-                                # LOE
-..B14.37:                       # Preds ..B14.46                # Infreq
-        movdqa    %xmm8, -80(%rbp)                              #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -64(%rbp)                              #
-        movdqa    %xmm4, -176(%rbp)                             #
-        movdqa    %xmm5, -160(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -128(%rbp)                             #
-        movl      %r12d, %eax                                   #
-        movl      %ecx, -8(%rbp)                                #
-        jmp       ..B14.33      # Prob 100%                     #
-                                # LOE rdx rbx eax esi xmm0
-..B14.38:                       # Preds ..B14.17 ..B14.23 ..B14.21 ..B14.19 # Infreq
-..LN1939:
-   .loc    1  4651
-        movq      -40(%rbp), %rbx                               #4651.63
-..___tag_value_eval_4na_64.564:                                 #
-        movq      -48(%rbp), %r12                               #4651.63
-..___tag_value_eval_4na_64.565:                                 #
-        movq      -32(%rbp), %r13                               #4651.63
-..___tag_value_eval_4na_64.566:                                 #
-        movq      -24(%rbp), %r14                               #4651.63
-..___tag_value_eval_4na_64.567:                                 #
-        movl      $1, %eax                                      #4651.63
-        movq      -184(%rbp), %r15                              #4651.63
-..___tag_value_eval_4na_64.568:                                 #
-        movq      %rbp, %rsp                                    #4651.63
-        popq      %rbp                                          #4651.63
-..___tag_value_eval_4na_64.569:                                 #
-        ret                                                     #4651.63
-        .align    16,0x90
-..___tag_value_eval_4na_64.570:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-.LNeval_4na_64:
-	.data
-# -- End  eval_4na_64
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    16,0x90
-eval_2na_64:
-# parameter 1(self): %rdi
-# parameter 2(ncbi2na): %rsi
-# parameter 3(pos): %edx
-# parameter 4(len): %ecx
-..B15.1:                        # Preds ..B15.0
-..___tag_value_eval_2na_64.571:                                 #3075.1
-..LN1941:
-   .loc    1  3075
-        pushq     %rbp                                          #3075.1
-        movq      %rsp, %rbp                                    #3075.1
-..___tag_value_eval_2na_64.572:                                 #
-        subq      $272, %rsp                                    #3075.1
-        movq      %r15, -56(%rbp)                               #3075.1
-..___tag_value_eval_2na_64.574:                                 #
-        movq      %r14, -48(%rbp)                               #3075.1
-..___tag_value_eval_2na_64.575:                                 #
-        movq      %r13, -24(%rbp)                               #3075.1
-..___tag_value_eval_2na_64.576:                                 #
-        movq      %r12, -40(%rbp)                               #3075.1
-..___tag_value_eval_2na_64.577:                                 #
-        movq      %rbx, -32(%rbp)                               #3075.1
-..___tag_value_eval_2na_64.578:                                 #
-        movl      %ecx, %r13d                                   #3075.1
-        movl      %edx, %ebx                                    #3075.1
-        movq      %rsi, %r14                                    #3075.1
-        movq      %rdi, %r12                                    #3075.1
-        lea       _gprof_pack14(%rip), %rdx                     #3075.1
-        call      mcount at PLT                                    #3075.1
-                                # LOE r12 r14 ebx r13d
-..B15.48:                       # Preds ..B15.1
-..LN1943:
-   .loc    1  3113
-        lea       (%rbx,%r13), %r8d                             #3113.5
-..LN1945:
-   .loc    1  3119
-        subl      4(%r12), %r8d                                 #3119.12
-..LN1947:
-   .loc    1  3125
-        movl      %r8d, -16(%rbp)                               #3125.14
-..LN1949:
-   .loc    1  3116
-        movl      %ebx, %r15d                                   #3116.49
-        shrl      $2, %r15d                                     #3116.49
-..LN1951:
-        lea       (%r14,%r15), %rdi                             #3116.30
-..LN1953:
-   .loc    1  3122
-        lea       3(%rbx,%r13), %r13d                           #3122.50
-..LN1955:
-        shrl      $2, %r13d                                     #3122.57
-..LN1957:
-        addq      %r14, %r13                                    #3122.30
-..LN1959:
-   .loc    1  3125
-        movq      %r13, %rsi                                    #3125.14
-        call      prime_buffer_2na at PLT                          #3125.14
-                                # LOE r12 r13 r14 r15 ebx xmm0
-..B15.49:                       # Preds ..B15.48
-        movl      -16(%rbp), %r8d                               #
-..LN1961:
-   .loc    1  3126
-        lea       16(%r14,%r15), %r14                           #3126.5
-        movq      %r14, %rcx                                    #3126.5
-..LN1963:
-   .loc    1  3131
-        cmpq      %r13, %r14                                    #3131.16
-..LN1965:
-   .loc    1  3136
-..LN1967:
-   .loc    1  3131
-        jae       ..B15.3       # Prob 12%                      #3131.16
-                                # LOE rcx r8 r12 r13 r14 ebx r8d r15d r8b xmm0
-..B15.2:                        # Preds ..B15.49
-..LN1969:
-   .loc    1  3132
-        movzbl    -1(%r14), %r15d                               #3132.24
-..LN1971:
-        shll      $8, %r15d                                     #3132.38
-                                # LOE rcx r8 r12 r13 r14 ebx r8d r15d r8b xmm0
-..B15.3:                        # Preds ..B15.2 ..B15.49
-..LN1973:
-   .loc    1  3136
-        movdqa    16(%r12), %xmm7                               #3136.5
-        movdqa    32(%r12), %xmm6                               #3136.5
-        movdqa    48(%r12), %xmm5                               #3136.5
-        movdqa    64(%r12), %xmm4                               #3136.5
-        movdqa    80(%r12), %xmm3                               #3136.5
-        movdqa    96(%r12), %xmm2                               #3136.5
-        movdqa    112(%r12), %xmm1                              #3136.5
-        movdqa    128(%r12), %xmm8                              #3136.5
-..LN1975:
-   .loc    1  3139
-        xorl      %esi, %esi                                    #3139.15
-..LN1977:
-        xorl      %eax, %eax                                    #3139.10
-..LN1979:
-        xorl      %r12d, %r12d                                  #3139.5
-..LN1981:
-   .loc    1  3143
-        movl      $8, %edx                                      #3143.5
-..LN1983:
-   .loc    1  3148
-        movl      %ebx, %edi                                    #3148.20
-        andl      $3, %edi                                      #3148.20
-        je        ..B15.40      # Prob 20%                      #3148.20
-                                # LOE rcx r8 r13 r14 eax edx ebx esi edi r8d r12d r15d r8b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B15.4:                        # Preds ..B15.3
-        cmpl      $1, %edi                                      #3148.20
-        je        ..B15.10      # Prob 25%                      #3148.20
-                                # LOE rcx r8 r13 r14 eax edx ebx esi edi r8d r12d r15d r8b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B15.5:                        # Preds ..B15.4
-        cmpl      $2, %edi                                      #3148.20
-        je        ..B15.9       # Prob 33%                      #3148.20
-                                # LOE rcx r8 r13 r14 eax edx ebx esi edi r8d r12d r15d r8b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B15.6:                        # Preds ..B15.5
-        cmpl      $3, %edi                                      #3148.20
-        je        ..B15.8       # Prob 50%                      #3148.20
-                                # LOE rcx r8 r13 r14 eax edx ebx esi r8d r12d r15d r8b xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B15.7:                        # Preds ..B15.6
-        movdqa    %xmm8, -128(%rbp)                             #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -160(%rbp)                             #
-        movdqa    %xmm4, -192(%rbp)                             #
-        movdqa    %xmm5, -176(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -80(%rbp)                              #
-        movl      %ebx, %eax                                    #
-        movq      %r13, -64(%rbp)                               #
-        movl      %r8d, -16(%rbp)                               #
-        jmp       ..B15.32      # Prob 100%                     #
-                                # LOE rcx r14 eax r15d xmm0
-..B15.8:                        # Preds ..B15.6
-        movdqa    %xmm8, -128(%rbp)                             #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -160(%rbp)                             #
-        movdqa    %xmm4, -192(%rbp)                             #
-        movdqa    %xmm5, -176(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -80(%rbp)                              #
-        movl      %eax, %edi                                    #
-        movq      %r13, -64(%rbp)                               #
-        movl      %r8d, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        movl      %edi, %ebx                                    #
-        movl      %esi, %r13d                                   #
-        jmp       ..B15.13      # Prob 100%                     #
-                                # LOE rcx r14 eax edx ebx r12d r13d r15d xmm0
-..B15.9:                        # Preds ..B15.5
-        movdqa    %xmm8, -128(%rbp)                             #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -160(%rbp)                             #
-        movdqa    %xmm4, -192(%rbp)                             #
-        movdqa    %xmm5, -176(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -80(%rbp)                              #
-        movl      %eax, %esi                                    #
-        movq      %r13, -64(%rbp)                               #
-        movl      %r8d, -16(%rbp)                               #
-        movl      %ebx, %eax                                    #
-        movl      %esi, %ebx                                    #
-        jmp       ..B15.12      # Prob 100%                     #
-                                # LOE rcx r14 eax edx ebx r12d r15d xmm0
-..B15.10:                       # Preds ..B15.4
-        movdqa    %xmm8, -128(%rbp)                             #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -160(%rbp)                             #
-        movdqa    %xmm4, -192(%rbp)                             #
-        movdqa    %xmm5, -176(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -80(%rbp)                              #
-        movl      %ebx, %eax                                    #
-        movq      %r13, -64(%rbp)                               #
-        movl      %r8d, -16(%rbp)                               #
-                                # LOE rcx r14 eax edx r12d r15d xmm0
-..B15.11:                       # Preds ..B15.10 ..B15.36
-..LN1985:
-   .loc    1  3171
-        movdqa    %xmm0, %xmm1                                  #3171.22
-        pand      -192(%rbp), %xmm1                             #3171.22
-..LN1987:
-   .loc    1  3172
-        pcmpeqd   -176(%rbp), %xmm1                             #3172.22
-..LN1989:
-   .loc    1  3173
-        pmovmskb  %xmm1, %ebx                                   #3173.22
-..LN1991:
-   .loc    1  3174
-        movl      %ebx, %esi                                    #3174.17
-        andl      $3855, %esi                                   #3174.17
-        shll      $4, %esi                                      #3174.17
-        andl      %esi, %ebx                                    #3174.17
-        movl      %ebx, %edi                                    #3174.17
-        shrl      $4, %edi                                      #3174.17
-        orl       %edi, %ebx                                    #3174.17
-                                # LOE rcx r14 eax edx ebx r12d r15d xmm0
-..B15.12:                       # Preds ..B15.9 ..B15.11
-..LN1993:
-   .loc    1  3177
-        movdqa    %xmm0, %xmm1                                  #3177.22
-        pand      -96(%rbp), %xmm1                              #3177.22
-..LN1995:
-   .loc    1  3178
-        pcmpeqd   -160(%rbp), %xmm1                             #3178.22
-..LN1997:
-   .loc    1  3179
-        pmovmskb  %xmm1, %r13d                                  #3179.22
-..LN1999:
-   .loc    1  3180
-        movl      %r13d, %edi                                   #3180.17
-        andl      $3855, %edi                                   #3180.17
-        shll      $4, %edi                                      #3180.17
-        andl      %edi, %r13d                                   #3180.17
-        movl      %r13d, %r8d                                   #3180.17
-        shrl      $4, %r8d                                      #3180.17
-        orl       %r8d, %r13d                                   #3180.17
-                                # LOE rcx r14 eax edx ebx r12d r13d r15d xmm0
-..B15.13:                       # Preds ..B15.8 ..B15.12
-..LN2001:
-   .loc    1  3183
-        movdqa    %xmm0, %xmm1                                  #3183.22
-        pand      -128(%rbp), %xmm1                             #3183.22
-..LN2003:
-   .loc    1  3184
-        pcmpeqd   -112(%rbp), %xmm1                             #3184.22
-..LN2005:
-   .loc    1  3185
-        pmovmskb  %xmm1, %r8d                                   #3185.22
-..LN2007:
-   .loc    1  3190
-        movl      %eax, %esi                                    #3190.17
-        andl      $-4, %esi                                     #3190.17
-..LN2009:
-   .loc    1  3186
-        movl      %r8d, %r9d                                    #3186.17
-        andl      $3855, %r9d                                   #3186.17
-        shll      $4, %r9d                                      #3186.17
-        andl      %r9d, %r8d                                    #3186.17
-        movl      %r8d, %r10d                                   #3186.17
-        shrl      $4, %r10d                                     #3186.17
-        orl       %r10d, %r8d                                   #3186.17
-..LN2011:
-   .loc    1  3193
-        movl      %r12d, %r11d                                  #3193.29
-        orl       %ebx, %r11d                                   #3193.29
-..LN2013:
-        orl       %r13d, %r11d                                  #3193.34
-..LN2015:
-        orl       %r8d, %r11d                                   #3193.39
-..LN2017:
-        je        ..B15.26      # Prob 78%                      #3193.47
-                                # LOE rcx r14 edx ebx esi r8d r12d r13d r15d xmm0
-..B15.14:                       # Preds ..B15.13
-..LN2019:
-   .loc    1  3211
-        movdqa    %xmm0, -272(%rbp)                             #3211.30
-        movl      %r12d, %edi                                   #3211.30
-        movl      %edx, -232(%rbp)                              #3211.30
-        movl      %esi, -224(%rbp)                              #3211.30
-        movl      %r8d, -216(%rbp)                              #3211.30
-        movq      %rcx, -208(%rbp)                              #3211.30
-        call      uint16_lsbit at PLT                              #3211.30
-                                # LOE r14 eax ebx r12d r13d r15d
-..B15.50:                       # Preds ..B15.14
-        movq      -208(%rbp), %rcx                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %r8d                              #
-        movl      -224(%rbp), %esi                              #
-        movl      -232(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r8 r14 eax edx ebx esi r8d r12d r13d r15d dl sil r8b dh xmm0
-..B15.15:                       # Preds ..B15.50
-..LN2021:
-   .loc    1  3212
-        movdqa    %xmm0, -272(%rbp)                             #3212.30
-        movl      %ebx, %edi                                    #3212.30
-        movl      %edx, -232(%rbp)                              #3212.30
-..LN2023:
-   .loc    1  3211
-        movswq    %ax, %r9                                      #3211.30
-        movl      %r9d, -240(%rbp)                              #3211.30
-..LN2025:
-   .loc    1  3212
-        movl      %esi, -224(%rbp)                              #3212.30
-        movl      %r8d, -216(%rbp)                              #3212.30
-        movq      %rcx, -208(%rbp)                              #3212.30
-        call      uint16_lsbit at PLT                              #3212.30
-                                # LOE r14 eax ebx r12d r13d r15d
-..B15.51:                       # Preds ..B15.15
-        movq      -208(%rbp), %rcx                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %r8d                              #
-        movl      -224(%rbp), %esi                              #
-        movl      -232(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r8 r14 eax edx ebx esi r8d r12d r13d r15d dl sil r8b dh xmm0
-..B15.16:                       # Preds ..B15.51
-..LN2027:
-   .loc    1  3213
-        movdqa    %xmm0, -272(%rbp)                             #3213.30
-        movl      %r13d, %edi                                   #3213.30
-        movl      %edx, -232(%rbp)                              #3213.30
-..LN2029:
-   .loc    1  3212
-        movswq    %ax, %r9                                      #3212.30
-        movl      %r9d, -248(%rbp)                              #3212.30
-..LN2031:
-   .loc    1  3213
-        movl      %esi, -224(%rbp)                              #3213.30
-        movl      %r8d, -216(%rbp)                              #3213.30
-        movq      %rcx, -208(%rbp)                              #3213.30
-        call      uint16_lsbit at PLT                              #3213.30
-                                # LOE r14 eax ebx r12d r13d r15d
-..B15.52:                       # Preds ..B15.16
-        movq      -208(%rbp), %rcx                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %r8d                              #
-        movl      -224(%rbp), %esi                              #
-        movl      -232(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r8 r14 eax edx ebx esi r8d r12d r13d r15d dl sil r8b dh xmm0
-..B15.17:                       # Preds ..B15.52
-..LN2033:
-   .loc    1  3214
-        movdqa    %xmm0, -272(%rbp)                             #3214.30
-        movl      %r8d, %edi                                    #3214.30
-        movl      %edx, -232(%rbp)                              #3214.30
-..LN2035:
-   .loc    1  3213
-        movswq    %ax, %r9                                      #3213.30
-        movl      %r9d, -256(%rbp)                              #3213.30
-..LN2037:
-   .loc    1  3214
-        movl      %esi, -224(%rbp)                              #3214.30
-        movl      %r8d, -216(%rbp)                              #3214.30
-        movq      %rcx, -208(%rbp)                              #3214.30
-        call      uint16_lsbit at PLT                              #3214.30
-                                # LOE r14 eax ebx r12d r13d r15d
-..B15.53:                       # Preds ..B15.17
-        movq      -208(%rbp), %rcx                              #
-        movdqa    -272(%rbp), %xmm0                             #
-        movl      -216(%rbp), %r8d                              #
-        movl      -224(%rbp), %esi                              #
-        movl      -232(%rbp), %edx                              #
-                                # LOE rdx rcx rsi r8 r14 eax edx ebx esi r8d r12d r13d r15d dl sil r8b dh xmm0
-..B15.18:                       # Preds ..B15.53
-..LN2039:
-   .loc    1  3219
-        movl      -240(%rbp), %r9d                              #3219.34
-..LN2041:
-   .loc    1  3220
-        movl      -248(%rbp), %r10d                             #3220.34
-..LN2043:
-   .loc    1  3221
-        movl      -256(%rbp), %r11d                             #3221.34
-..LN2045:
-   .loc    1  3214
-        movswq    %ax, %rax                                     #3214.30
-..LN2047:
-   .loc    1  3219
-        shll      $2, %r9d                                      #3219.34
-        movl      %r9d, -240(%rbp)                              #3219.34
-..LN2049:
-   .loc    1  3220
-        shll      $2, %r10d                                     #3220.34
-        movl      %r10d, -248(%rbp)                             #3220.34
-..LN2051:
-   .loc    1  3221
-        shll      $2, %r11d                                     #3221.34
-        movl      %r11d, -256(%rbp)                             #3221.34
-..LN2053:
-   .loc    1  3222
-        shll      $2, %eax                                      #3222.34
-..LN2055:
-   .loc    1  3226
-        testl     %r12d, %r12d                                  #3226.32
-        je        ..B15.20      # Prob 50%                      #3226.32
-                                # LOE rdx rcx rsi r8 r9 r10 r11 r14 eax edx ebx esi r8d r9d r10d r11d r13d r15d dl sil r8b r9b r10b r11b dh xmm0
-..B15.19:                       # Preds ..B15.18
-..LN2057:
-        addl      %esi, %r9d                                    #3226.43
-..LN2059:
-        cmpl      -16(%rbp), %r9d                               #3226.49
-        jbe       ..B15.41      # Prob 20%                      #3226.49
-                                # LOE rdx rcx rsi r8 r10 r11 r14 eax edx ebx esi r8d r10d r11d r13d r15d dl sil r8b r10b r11b dh xmm0
-..B15.20:                       # Preds ..B15.19 ..B15.18
-..LN2061:
-   .loc    1  3227
-        testl     %ebx, %ebx                                    #3227.32
-        je        ..B15.22      # Prob 50%                      #3227.32
-                                # LOE rdx rcx rsi r8 r10 r11 r14 eax edx esi r8d r10d r11d r13d r15d dl sil r8b r10b r11b dh xmm0
-..B15.21:                       # Preds ..B15.20
-..LN2063:
-        movl      %r10d, %ebx                                   #3227.43
-        lea       1(%rsi,%rbx), %r9d                            #3227.43
-..LN2065:
-        cmpl      -16(%rbp), %r9d                               #3227.49
-        jbe       ..B15.41      # Prob 20%                      #3227.49
-                                # LOE rdx rcx rsi r8 r11 r14 eax edx esi r8d r11d r13d r15d dl sil r8b r11b dh xmm0
-..B15.22:                       # Preds ..B15.21 ..B15.20
-..LN2067:
-   .loc    1  3228
-        testl     %r13d, %r13d                                  #3228.32
-        je        ..B15.24      # Prob 50%                      #3228.32
-                                # LOE rdx rcx rsi r8 r11 r14 eax edx esi r8d r11d r15d dl sil r8b r11b dh xmm0
-..B15.23:                       # Preds ..B15.22
-..LN2069:
-        movl      %r11d, %ebx                                   #3228.43
-        lea       2(%rsi,%rbx), %r9d                            #3228.43
-..LN2071:
-        cmpl      -16(%rbp), %r9d                               #3228.49
-        jbe       ..B15.41      # Prob 20%                      #3228.49
-                                # LOE rdx rcx rsi r8 r14 eax edx esi r8d r15d dl sil r8b dh xmm0
-..B15.24:                       # Preds ..B15.23 ..B15.22
-..LN2073:
-   .loc    1  3229
-        testl     %r8d, %r8d                                    #3229.32
-        je        ..B15.26      # Prob 50%                      #3229.32
-                                # LOE rdx rcx rsi r14 eax edx esi r15d dl sil dh xmm0
-..B15.25:                       # Preds ..B15.24
-..LN2075:
-        lea       3(%rsi,%rax), %eax                            #3229.43
-..LN2077:
-        cmpl      -16(%rbp), %eax                               #3229.49
-        jbe       ..B15.41      # Prob 20%                      #3229.49
-                                # LOE rcx r14 edx esi r15d xmm0
-..B15.26:                       # Preds ..B15.25 ..B15.24 ..B15.13
-..LN2079:
-   .loc    1  3234
-        lea       4(%rsi), %eax                                 #3234.17
-..LN2081:
-   .loc    1  3237
-        cmpl      -16(%rbp), %eax                               #3237.28
-        ja        ..B15.38      # Prob 20%                      #3237.28
-                                # LOE rcx r14 eax edx esi r15d xmm0
-..B15.27:                       # Preds ..B15.26
-..LN2083:
-   .loc    1  3241
-        decl      %edx                                          #3241.25
-..LN2085:
-        jne       ..B15.33      # Prob 50%                      #3241.39
-                                # LOE rcx r14 eax edx esi r15d xmm0
-..B15.28:                       # Preds ..B15.27
-..LN2087:
-   .loc    1  3262
-        cmpq      -64(%rbp), %r14                               #3262.25
-        jae       ..B15.38      # Prob 4%                       #3262.25
-                                # LOE r14 esi r15d
-..B15.29:                       # Preds ..B15.28
-..LN2089:
-   .loc    1  3266
-        lea       36(%rsi), %eax                                #3266.13
-..LN2091:
-   .loc    1  3267
-        cmpl      -16(%rbp), %eax                               #3267.24
-        ja        ..B15.38      # Prob 4%                       #3267.24
-                                # LOE r14 eax r15d
-..B15.30:                       # Preds ..B15.29
-..LN2093:
-   .loc    1  3272
-        movq      -64(%rbp), %rsi                               #3272.22
-        movl      %eax, -200(%rbp)                              #3272.22
-        movq      %r14, %rdi                                    #3272.22
-        call      prime_buffer_2na at PLT                          #3272.22
-                                # LOE r14 r15d xmm0
-..B15.54:                       # Preds ..B15.30
-        movl      -200(%rbp), %eax                              #
-..LN2095:
-   .loc    1  3350
-        addq      $16, %r14                                     #3350.13
-..LN2097:
-   .loc    1  3353
-        cmpq      -64(%rbp), %r14                               #3353.24
-..LN2099:
-   .loc    1  3350
-        movq      %r14, %rcx                                    #3350.13
-..LN2101:
-   .loc    1  3353
-        jae       ..B15.32      # Prob 12%                      #3353.24
-                                # LOE rax rcx r14 eax r15d al ah xmm0
-..B15.31:                       # Preds ..B15.54
-..LN2103:
-   .loc    1  3354
-        movzbl    -1(%r14), %r15d                               #3354.32
-..LN2105:
-        shll      $8, %r15d                                     #3354.46
-                                # LOE rcx r14 eax r15d xmm0
-..B15.32:                       # Preds ..B15.54 ..B15.7 ..B15.31
-..LN2107:
-   .loc    1  3155
-        movl      $8, %edx                                      #3155.13
-        jmp       ..B15.36      # Prob 100%                     #3155.13
-                                # LOE rcx r14 eax edx r15d xmm0
-..B15.33:                       # Preds ..B15.27
-..LN2109:
-   .loc    1  3249
-        cmpq      -64(%rbp), %rcx                               #3249.26
-..LN2111:
-   .loc    1  3246
-        psrldq    $1, %xmm0                                     #3246.26
-..LN2113:
-   .loc    1  3249
-        jae       ..B15.35      # Prob 19%                      #3249.26
-                                # LOE rcx r14 eax edx r15d xmm0
-..B15.34:                       # Preds ..B15.33
-..LN2115:
-   .loc    1  3252
-        movzbl    (%rcx), %esi                                  #3252.37
-..LN2117:
-   .loc    1  3251
-        sarl      $8, %r15d                                     #3251.21
-..LN2119:
-   .loc    1  3252
-        shll      $8, %esi                                      #3252.48
-..LN2121:
-        orl       %esi, %r15d                                   #3252.21
-..LN2123:
-   .loc    1  3253
-        pinsrw    $7, %r15d, %xmm0                              #3253.30
-                                # LOE rcx r14 eax edx r15d xmm0
-..B15.35:                       # Preds ..B15.34 ..B15.33
-..LN2125:
-   .loc    1  3257
-        incq      %rcx                                          #3257.20
-                                # LOE rcx r14 eax edx r15d xmm0
-..B15.36:                       # Preds ..B15.32 ..B15.35 ..B15.40
-..LN2127:
-   .loc    1  3165
-        movdqa    %xmm0, %xmm1                                  #3165.22
-        pand      -144(%rbp), %xmm1                             #3165.22
-..LN2129:
-   .loc    1  3166
-        pcmpeqd   -80(%rbp), %xmm1                              #3166.22
-..LN2131:
-   .loc    1  3167
-        pmovmskb  %xmm1, %r12d                                  #3167.22
-..LN2133:
-   .loc    1  3168
-        movl      %r12d, %esi                                   #3168.17
-        andl      $3855, %esi                                   #3168.17
-        shll      $4, %esi                                      #3168.17
-        andl      %esi, %r12d                                   #3168.17
-        movl      %r12d, %edi                                   #3168.17
-        shrl      $4, %edi                                      #3168.17
-        orl       %edi, %r12d                                   #3168.17
-        jmp       ..B15.11      # Prob 100%                     #3168.17
-                                # LOE rcx r14 eax edx r12d r15d xmm0
-..B15.38:                       # Preds ..B15.26 ..B15.28 ..B15.29 # Infreq
-..LN2135:
-   .loc    1  3363
-        movq      -32(%rbp), %rbx                               #3363.12
-..___tag_value_eval_2na_64.579:                                 #
-        movq      -40(%rbp), %r12                               #3363.12
-..___tag_value_eval_2na_64.580:                                 #
-        movq      -24(%rbp), %r13                               #3363.12
-..___tag_value_eval_2na_64.581:                                 #
-        movq      -48(%rbp), %r14                               #3363.12
-..___tag_value_eval_2na_64.582:                                 #
-        xorl      %eax, %eax                                    #3363.12
-        movq      -56(%rbp), %r15                               #3363.12
-..___tag_value_eval_2na_64.583:                                 #
-        movq      %rbp, %rsp                                    #3363.12
-        popq      %rbp                                          #3363.12
-..___tag_value_eval_2na_64.584:                                 #
-        ret                                                     #3363.12
-..___tag_value_eval_2na_64.585:                                 #
-                                # LOE
-..B15.40:                       # Preds ..B15.3                 # Infreq
-        movdqa    %xmm8, -128(%rbp)                             #
-        movdqa    %xmm1, -112(%rbp)                             #
-        movdqa    %xmm2, -96(%rbp)                              #
-        movdqa    %xmm3, -160(%rbp)                             #
-        movdqa    %xmm4, -192(%rbp)                             #
-        movdqa    %xmm5, -176(%rbp)                             #
-        movdqa    %xmm6, -144(%rbp)                             #
-        movdqa    %xmm7, -80(%rbp)                              #
-        movl      %ebx, %eax                                    #
-        movq      %r13, -64(%rbp)                               #
-        movl      %r8d, -16(%rbp)                               #
-        jmp       ..B15.36      # Prob 100%                     #
-                                # LOE rcx r14 eax edx r15d xmm0
-..B15.41:                       # Preds ..B15.23 ..B15.21 ..B15.19 ..B15.25 # Infreq
-..LN2137:
-   .loc    1  3229
-        movq      -32(%rbp), %rbx                               #3229.63
-..___tag_value_eval_2na_64.591:                                 #
-        movq      -40(%rbp), %r12                               #3229.63
-..___tag_value_eval_2na_64.592:                                 #
-        movq      -24(%rbp), %r13                               #3229.63
-..___tag_value_eval_2na_64.593:                                 #
-        movq      -48(%rbp), %r14                               #3229.63
-..___tag_value_eval_2na_64.594:                                 #
-        movl      $1, %eax                                      #3229.63
-        movq      -56(%rbp), %r15                               #3229.63
-..___tag_value_eval_2na_64.595:                                 #
-        movq      %rbp, %rsp                                    #3229.63
-        popq      %rbp                                          #3229.63
-..___tag_value_eval_2na_64.596:                                 #
-        ret                                                     #3229.63
-        .align    16,0x90
-..___tag_value_eval_2na_64.597:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-.LNeval_2na_64:
-	.data
-# -- End  eval_2na_64
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1(nss): %rdi
-# parameter 2(positional): %esi
-# parameter 3(query): %rdx
-# parameter 4(len): %ecx
-..B16.1:                        # Preds ..B16.0
-..___tag_value_NucStrstrMake.598:                               #1539.1
-..LN2139:
-   .loc    1  1539
-        pushq     %rbp                                          #1539.1
-        movq      %rsp, %rbp                                    #1539.1
-..___tag_value_NucStrstrMake.599:                               #
-        subq      $48, %rsp                                     #1539.1
-        movq      %r15, -48(%rbp)                               #1539.1
-..___tag_value_NucStrstrMake.601:                               #
-        movq      %r14, -40(%rbp)                               #1539.1
-..___tag_value_NucStrstrMake.602:                               #
-        movq      %r13, -32(%rbp)                               #1539.1
-..___tag_value_NucStrstrMake.603:                               #
-        movq      %r12, -24(%rbp)                               #1539.1
-..___tag_value_NucStrstrMake.604:                               #
-        movl      %ecx, %r15d                                   #1539.1
-        movq      %rdx, %r12                                    #1539.1
-        movl      %esi, %r13d                                   #1539.1
-        movq      %rdi, %r14                                    #1539.1
-        lea       _gprof_pack15(%rip), %rdx                     #1539.1
-        call      mcount at PLT                                    #1539.1
-                                # LOE rbx r12 r14 r13d r15d
-..B16.17:                       # Preds ..B16.1
-..LN2141:
-   .loc    1  1540
-        testq     %r14, %r14                                    #1540.17
-        je        ..B16.12      # Prob 6%                       #1540.17
-                                # LOE rbx r12 r14 r13d r15d
-..B16.2:                        # Preds ..B16.17
-..LN2143:
-   .loc    1  1542
-        testq     %r12, %r12                                    #1542.23
-        je        ..B16.11      # Prob 6%                       #1542.23
-                                # LOE rbx r12 r14 r13d r15d
-..B16.3:                        # Preds ..B16.2
-..LN2145:
-        testl     %r15d, %r15d                                  #1542.38
-        je        ..B16.11      # Prob 28%                      #1542.38
-                                # LOE rbx r12 r14 r13d r15d
-..B16.4:                        # Preds ..B16.3
-..LN2147:
-   .loc    1  1544
-        movl      $0, -16(%rbp)                                 #1544.24
-..LN2149:
-   .loc    1  1547
-        lea       fasta_2na_map.0(%rip), %rax                   #1547.18
-        movsbl    (%rax), %edx                                  #1547.18
-..LN2151:
-        testl     %edx, %edx                                    #1547.41
-        je        ..B16.13      # Prob 5%                       #1547.41
-                                # LOE rbx r12 r14 r13d r15d
-..B16.5:                        # Preds ..B16.13 ..B16.4
-..LN2153:
-   .loc    1  1551
-        lea       -16(%rbp), %rcx                               #1551.21
-..LN2155:
-   .loc    1  1550
-        movl      %r15d, %r15d                                  #1550.19
-        addq      %r12, %r15                                    #1550.19
-..LN2157:
-   .loc    1  1551
-        movq      %r12, %rdi                                    #1551.21
-        movq      %r15, %rsi                                    #1551.21
-        movq      %r14, %rdx                                    #1551.21
-        movl      %r13d, %r8d                                   #1551.21
-        call      nss_expr at PLT                                  #1551.21
-                                # LOE rax rbx r14 r15
-..B16.6:                        # Preds ..B16.5
-..LN2159:
-   .loc    1  1552
-        movl      -16(%rbp), %r12d                              #1552.18
-..LN2161:
-        testl     %r12d, %r12d                                  #1552.28
-        jne       ..B16.9       # Prob 10%                      #1552.28
-                                # LOE rax rbx r14 r15 r12d
-..B16.7:                        # Preds ..B16.6
-..LN2163:
-   .loc    1  1554
-        cmpq      %r15, %rax                                    #1554.31
-        je        ..B16.14      # Prob 12%                      #1554.31
-                                # LOE rbx r14
-..B16.8:                        # Preds ..B16.7
-..LN2165:
-   .loc    1  1557
-        movl      $22, -16(%rbp)                                #1557.17
-        movl      $22, %r12d                                    #1557.17
-                                # LOE rbx r14 r12d
-..B16.9:                        # Preds ..B16.8 ..B16.6
-..LN2167:
-   .loc    1  1560
-        movq      (%r14), %rdi                                  #1560.13
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE rbx r14 r12d
-..B16.10:                       # Preds ..B16.9
-..LN2169:
-   .loc    1  1562
-        movq      -32(%rbp), %r13                               #1562.20
-..___tag_value_NucStrstrMake.605:                               #
-        movq      -48(%rbp), %r15                               #1562.20
-..___tag_value_NucStrstrMake.606:                               #
-..LN2171:
-   .loc    1  1561
-        movq      $0, (%r14)                                    #1561.13
-..LN2173:
-   .loc    1  1562
-        movl      %r12d, %eax                                   #1562.20
-        movq      -24(%rbp), %r12                               #1562.20
-..___tag_value_NucStrstrMake.607:                               #
-        movq      -40(%rbp), %r14                               #1562.20
-..___tag_value_NucStrstrMake.608:                               #
-        movq      %rbp, %rsp                                    #1562.20
-        popq      %rbp                                          #1562.20
-..___tag_value_NucStrstrMake.609:                               #
-        ret                                                     #1562.20
-..___tag_value_NucStrstrMake.610:                               #
-                                # LOE
-..B16.11:                       # Preds ..B16.3 ..B16.2
-..LN2175:
-   .loc    1  1565
-        movq      $0, (%r14)                                    #1565.9
-                                # LOE rbx
-..B16.12:                       # Preds ..B16.17 ..B16.11
-..LN2177:
-   .loc    1  1567
-        movq      -24(%rbp), %r12                               #1567.12
-..___tag_value_NucStrstrMake.615:                               #
-        movq      -32(%rbp), %r13                               #1567.12
-..___tag_value_NucStrstrMake.616:                               #
-        movq      -40(%rbp), %r14                               #1567.12
-..___tag_value_NucStrstrMake.617:                               #
-        movq      -48(%rbp), %r15                               #1567.12
-..___tag_value_NucStrstrMake.618:                               #
-        movl      $22, %eax                                     #1567.12
-        movq      %rbp, %rsp                                    #1567.12
-        popq      %rbp                                          #1567.12
-..___tag_value_NucStrstrMake.619:                               #
-        ret                                                     #1567.12
-..___tag_value_NucStrstrMake.620:                               #
-                                # LOE
-..B16.13:                       # Preds ..B16.4                 # Infreq
-..LN2179:
-   .loc    1  1548
-        call      NucStrstrInit at PLT                             #1548.17
-        jmp       ..B16.5       # Prob 100%                     #1548.17
-                                # LOE rbx r12 r14 r13d r15d
-..B16.14:                       # Preds ..B16.7                 # Infreq
-..LN2181:
-   .loc    1  1555
-        movq      -24(%rbp), %r12                               #1555.28
-..___tag_value_NucStrstrMake.625:                               #
-        movq      -32(%rbp), %r13                               #1555.28
-..___tag_value_NucStrstrMake.626:                               #
-        movq      -40(%rbp), %r14                               #1555.28
-..___tag_value_NucStrstrMake.627:                               #
-        movq      -48(%rbp), %r15                               #1555.28
-..___tag_value_NucStrstrMake.628:                               #
-        xorl      %eax, %eax                                    #1555.28
-        movq      %rbp, %rsp                                    #1555.28
-        popq      %rbp                                          #1555.28
-..___tag_value_NucStrstrMake.629:                               #
-        ret                                                     #1555.28
-        .align    16,0x90
-..___tag_value_NucStrstrMake.630:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-.LNNucStrstrMake:
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    16,0x90
-nss_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B17.1:                        # Preds ..B17.0
-..___tag_value_nss_expr.631:                                    #1406.1
-..LN2183:
-   .loc    1  1406
-        pushq     %rbp                                          #1406.1
-        movq      %rsp, %rbp                                    #1406.1
-..___tag_value_nss_expr.632:                                    #
-        subq      $48, %rsp                                     #1406.1
-        movq      %r14, -24(%rbp)                               #1406.1
-..___tag_value_nss_expr.634:                                    #
-        movq      %r13, -32(%rbp)                               #1406.1
-..___tag_value_nss_expr.635:                                    #
-        movq      %r12, -40(%rbp)                               #1406.1
-..___tag_value_nss_expr.636:                                    #
-        movq      %rbx, -48(%rbp)                               #1406.1
-..___tag_value_nss_expr.637:                                    #
-        movq      %rcx, %r14                                    #1406.1
-        movl      %r8d, -8(%rbp)                                #1406.1
-        movq      %rdx, %r13                                    #1406.1
-        lea       _gprof_pack16(%rip), %rdx                     #1406.1
-        movq      %rsi, %r12                                    #1406.1
-        movq      %rdi, %rbx                                    #1406.1
-        call      mcount at PLT                                    #1406.1
-                                # LOE rbx r12 r13 r14 r15
-..B17.34:                       # Preds ..B17.1
-        movq      %r15, -16(%rbp)                               #
-..___tag_value_nss_expr.638:                                    #
-                                # LOE rbx r12 r13 r14
-..B17.2:                        # Preds ..B17.17 ..B17.34
-..LN2185:
-   .loc    1  1407
-        movq      $0, (%r13)                                    #1407.5
-..LN2187:
-   .loc    1  1409
-        movq      %rbx, %rdi                                    #1409.9
-        movq      %r12, %rsi                                    #1409.9
-        call      nss_sob at PLT                                   #1409.9
-                                # LOE rax r12 r13 r14
-..B17.27:                       # Preds ..B17.2
-..LN2189:
-   .loc    1  1410
-        cmpq      %r12, %rax                                    #1410.15
-        je        ..B17.33      # Prob 16%                      #1410.15
-                                # LOE rax r12 r13 r14
-..B17.3:                        # Preds ..B17.27
-..LN2191:
-   .loc    1  1412
-        movl      -8(%rbp), %r8d                                #1412.13
-        movq      %rax, %rdi                                    #1412.13
-        movq      %r12, %rsi                                    #1412.13
-        movq      %r13, %rdx                                    #1412.13
-        movq      %r14, %rcx                                    #1412.13
-        call      nss_unary_expr at PLT                            #1412.13
-                                # LOE rax r12 r13 r14
-..B17.4:                        # Preds ..B17.3
-..LN2193:
-   .loc    1  1413
-        movl      (%r14), %edx                                  #1413.16
-..LN2195:
-        testl     %edx, %edx                                    #1413.26
-        jne       ..B17.20      # Prob 58%                      #1413.26
-                                # LOE rax r12 r13 r14
-..B17.5:                        # Preds ..B17.4
-..LN2197:
-   .loc    1  1415
-        movq      %rax, %rdi                                    #1415.17
-        movq      %r12, %rsi                                    #1415.17
-        call      nss_sob at PLT                                   #1415.17
-                                # LOE rax r12 r13 r14
-..B17.29:                       # Preds ..B17.5
-..LN2199:
-   .loc    1  1416
-        cmpq      %r12, %rax                                    #1416.23
-        je        ..B17.33      # Prob 4%                       #1416.23
-                                # LOE rax r12 r13 r14
-..B17.6:                        # Preds ..B17.29
-..LN2201:
-   .loc    1  1422
-        movsbl    (%rax), %edx                                  #1422.28
-        lea       1(%rax), %rbx                                 #1422.28
-        cmpl      $41, %edx                                     #1422.28
-        je        ..B17.19      # Prob 25%                      #1422.28
-                                # LOE rax rbx r12 r13 r14 edx
-..B17.7:                        # Preds ..B17.6
-        cmpl      $38, %edx                                     #1422.28
-        jne       ..B17.11      # Prob 67%                      #1422.28
-                                # LOE rax rbx r12 r13 r14 edx
-..B17.8:                        # Preds ..B17.7
-..LN2203:
-   .loc    1  1427
-        cmpq      %r12, %rbx                                    #1427.30
-        jae       ..B17.10      # Prob 12%                      #1427.30
-                                # LOE rax rbx r12 r13 r14
-..B17.9:                        # Preds ..B17.8
-..LN2205:
-        movsbl    (%rbx), %edx                                  #1427.39
-..LN2207:
-   .loc    1  1428
-        addq      $2, %rax                                      #1428.28
-        cmpl      $38, %edx                                     #1428.28
-        cmove     %rax, %rbx                                    #1428.28
-                                # LOE rbx r12 r13 r14
-..B17.10:                       # Preds ..B17.9 ..B17.8
-..LN2209:
-   .loc    1  1429
-        movl      $16, %r15d                                    #1429.21
-        jmp       ..B17.15      # Prob 100%                     #1429.21
-                                # LOE rbx r12 r13 r14 r15d
-..B17.11:                       # Preds ..B17.7
-..LN2211:
-   .loc    1  1422
-        cmpl      $124, %edx                                    #1422.28
-        jne       ..B17.18      # Prob 50%                      #1422.28
-                                # LOE rax rbx r12 r13 r14
-..B17.12:                       # Preds ..B17.11
-..LN2213:
-   .loc    1  1432
-        cmpq      %r12, %rbx                                    #1432.30
-        jae       ..B17.14      # Prob 12%                      #1432.30
-                                # LOE rax rbx r12 r13 r14
-..B17.13:                       # Preds ..B17.12
-..LN2215:
-        movsbl    (%rbx), %edx                                  #1432.39
-..LN2217:
-   .loc    1  1433
-        addq      $2, %rax                                      #1433.28
-        cmpl      $124, %edx                                    #1433.28
-        cmove     %rax, %rbx                                    #1433.28
-                                # LOE rbx r12 r13 r14
-..B17.14:                       # Preds ..B17.13 ..B17.12
-..LN2219:
-   .loc    1  1434
-        movl      $17, %r15d                                    #1434.21
-                                # LOE rbx r12 r13 r14 r15d
-..B17.15:                       # Preds ..B17.10 ..B17.14
-..LN2221:
-   .loc    1  1451
-        movl      $24, %edi                                     #1451.21
-        call      malloc at PLT                                    #1451.21
-                                # LOE rax rbx r12 r13 r14 r15d
-..B17.16:                       # Preds ..B17.15
-..LN2223:
-   .loc    1  1452
-        testq     %rax, %rax                                    #1452.27
-        je        ..B17.24      # Prob 1%                       #1452.27
-                                # LOE rax rbx r12 r13 r14 r15d
-..B17.17:                       # Preds ..B17.16
-..LN2225:
-   .loc    1  1458
-        movl      $11, (%rax)                                   #1458.17
-..LN2227:
-   .loc    1  1459
-        movl      %r15d, 4(%rax)                                #1459.17
-..LN2229:
-   .loc    1  1460
-        movq      (%r13), %rdx                                  #1460.41
-..LN2231:
-        movq      %rdx, 8(%rax)                                 #1460.17
-..LN2233:
-   .loc    1  1461
-        movq      %rax, (%r13)                                  #1461.17
-..LN2235:
-   .loc    1  1464
-        lea       16(%rax), %r13                                #1464.42
-        jmp       ..B17.2       # Prob 100%                     #1464.42
-                                # LOE rbx r12 r13 r14
-..B17.18:                       # Preds ..B17.11
-        movq      -16(%rbp), %r15                               #
-..___tag_value_nss_expr.639:                                    #
-..LN2237:
-   .loc    1  1439
-        movq      -48(%rbp), %rbx                               #1439.32
-..___tag_value_nss_expr.640:                                    #
-        movq      -40(%rbp), %r12                               #1439.32
-..___tag_value_nss_expr.641:                                    #
-        movq      -32(%rbp), %r13                               #1439.32
-..___tag_value_nss_expr.642:                                    #
-..LN2239:
-   .loc    1  1438
-        movl      $22, (%r14)                                   #1438.21
-..LN2241:
-   .loc    1  1439
-        movq      -24(%rbp), %r14                               #1439.32
-..___tag_value_nss_expr.643:                                    #
-        movq      %rbp, %rsp                                    #1439.32
-        popq      %rbp                                          #1439.32
-..___tag_value_nss_expr.644:                                    #
-        ret                                                     #1439.32
-..___tag_value_nss_expr.645:                                    #
-                                # LOE
-..B17.19:                       # Preds ..B17.6
-        movq      -16(%rbp), %r15                               #
-..___tag_value_nss_expr.651:                                    #
-..LN2243:
-   .loc    1  1425
-        movq      -48(%rbp), %rbx                               #1425.32
-..___tag_value_nss_expr.652:                                    #
-        movq      -40(%rbp), %r12                               #1425.32
-..___tag_value_nss_expr.653:                                    #
-        movq      -32(%rbp), %r13                               #1425.32
-..___tag_value_nss_expr.654:                                    #
-        movq      -24(%rbp), %r14                               #1425.32
-..___tag_value_nss_expr.655:                                    #
-        movq      %rbp, %rsp                                    #1425.32
-        popq      %rbp                                          #1425.32
-..___tag_value_nss_expr.656:                                    #
-        ret                                                     #1425.32
-..___tag_value_nss_expr.657:                                    #
-                                # LOE
-..B17.20:                       # Preds ..B17.4
-        movq      -16(%rbp), %r15                               #
-..___tag_value_nss_expr.663:                                    #
-                                # LOE rax r15
-..B17.21:                       # Preds ..B17.33 ..B17.20
-..LN2245:
-   .loc    1  1470
-        movq      -48(%rbp), %rbx                               #1470.12
-..___tag_value_nss_expr.665:                                    #
-        movq      -40(%rbp), %r12                               #1470.12
-..___tag_value_nss_expr.666:                                    #
-        movq      -32(%rbp), %r13                               #1470.12
-..___tag_value_nss_expr.667:                                    #
-        movq      -24(%rbp), %r14                               #1470.12
-..___tag_value_nss_expr.668:                                    #
-        movq      %rbp, %rsp                                    #1470.12
-        popq      %rbp                                          #1470.12
-..___tag_value_nss_expr.669:                                    #
-        ret                                                     #1470.12
-..___tag_value_nss_expr.670:                                    #
-                                # LOE
-..B17.33:                       # Preds ..B17.29 ..B17.27
-        movq      -16(%rbp), %r15                               #
-..___tag_value_nss_expr.675:                                    #
-        jmp       ..B17.21      # Prob 100%                     #
-..___tag_value_nss_expr.676:                                    #
-                                # LOE rax r15
-..B17.24:                       # Preds ..B17.16                # Infreq
-        movq      -16(%rbp), %r15                               #
-..___tag_value_nss_expr.677:                                    #
-..LN2247:
-   .loc    1  1454
-        call      __errno_location at PLT                          #1454.32
-..___tag_value_nss_expr.678:                                    #
-                                # LOE rax rbx r14 r15
-..B17.31:                       # Preds ..B17.24                # Infreq
-..LN2249:
-   .loc    1  1455
-        movq      -40(%rbp), %r12                               #1455.28
-..___tag_value_nss_expr.679:                                    #
-        movq      -32(%rbp), %r13                               #1455.28
-..___tag_value_nss_expr.680:                                    #
-..LN2251:
-   .loc    1  1454
-        movl      (%rax), %edx                                  #1454.32
-..LN2253:
-        movl      %edx, (%r14)                                  #1454.21
-..LN2255:
-   .loc    1  1455
-        movq      %rbx, %rax                                    #1455.28
-        movq      -48(%rbp), %rbx                               #1455.28
-..___tag_value_nss_expr.681:                                    #
-        movq      -24(%rbp), %r14                               #1455.28
-..___tag_value_nss_expr.682:                                    #
-        movq      %rbp, %rsp                                    #1455.28
-        popq      %rbp                                          #1455.28
-..___tag_value_nss_expr.683:                                    #
-        ret                                                     #1455.28
-        .align    16,0x90
-..___tag_value_nss_expr.684:                                    #
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-.LNnss_expr:
-	.data
-# -- End  nss_expr
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    16,0x90
-nss_unary_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B18.1:                        # Preds ..B18.0
-..___tag_value_nss_unary_expr.685:                              #1361.1
-..LN2257:
-   .loc    1  1361
-        pushq     %rbp                                          #1361.1
-        movq      %rsp, %rbp                                    #1361.1
-..___tag_value_nss_unary_expr.686:                              #
-        subq      $48, %rsp                                     #1361.1
-        movq      %r15, -48(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.688:                              #
-        movq      %r14, -40(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.689:                              #
-        movq      %r13, -32(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.690:                              #
-        movq      %r12, -24(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.691:                              #
-        movq      %rbx, -16(%rbp)                               #1361.1
-..___tag_value_nss_unary_expr.692:                              #
-        movl      %r8d, %r13d                                   #1361.1
-        movq      %rcx, %r15                                    #1361.1
-        movq      %rdx, %r12                                    #1361.1
-        movq      %rsi, %rbx                                    #1361.1
-        movq      %rdi, %r14                                    #1361.1
-        lea       _gprof_pack17(%rip), %rdx                     #1361.1
-        call      mcount at PLT                                    #1361.1
-        jmp       ..B18.2       # Prob 100%                     #1361.1
-                                # LOE rbx r12 r14 r15 r13d
-..B18.10:                       # Preds ..B18.9
-..LN2259:
-   .loc    1  1384
-        movl      $12, (%rax)                                   #1384.13
-..LN2261:
-   .loc    1  1385
-        movl      $13, 4(%rax)                                  #1385.13
-..LN2263:
-   .loc    1  1386
-        movq      $0, 8(%rax)                                   #1386.13
-..LN2265:
-   .loc    1  1387
-        movq      %rax, (%r12)                                  #1387.13
-..LN2267:
-   .loc    1  1389
-        lea       8(%rax), %r12                                 #1389.44
-                                # LOE rbx r12 r14 r15 r13d
-..B18.2:                        # Preds ..B18.10 ..B18.1
-..LN2269:
-   .loc    1  1363
-        movsbl    (%r14), %eax                                  #1363.12
-..LN2271:
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B18.5       # Prob 33%                      #1363.17
-                                # LOE rbx r12 r14 r15 r13d
-..B18.3:                        # Preds ..B18.2
-..LN2273:
-   .loc    1  1364
-        movq      %r14, %rdi                                    #1364.16
-        movq      %rbx, %rsi                                    #1364.16
-        movq      %r12, %rdx                                    #1364.16
-        movq      %r15, %rcx                                    #1364.16
-        movl      %r13d, %r8d                                   #1364.16
-        call      nss_primary_expr at PLT                          #1364.16
-                                # LOE rax
-..B18.4:                        # Preds ..B18.3
-        movq      -16(%rbp), %rbx                               #1364.16
-..___tag_value_nss_unary_expr.693:                              #
-        movq      -24(%rbp), %r12                               #1364.16
-..___tag_value_nss_unary_expr.694:                              #
-        movq      -32(%rbp), %r13                               #1364.16
-..___tag_value_nss_unary_expr.695:                              #
-        movq      -40(%rbp), %r14                               #1364.16
-..___tag_value_nss_unary_expr.696:                              #
-        movq      -48(%rbp), %r15                               #1364.16
-..___tag_value_nss_unary_expr.697:                              #
-        movq      %rbp, %rsp                                    #1364.16
-        popq      %rbp                                          #1364.16
-..___tag_value_nss_unary_expr.698:                              #
-        ret                                                     #1364.16
-..___tag_value_nss_unary_expr.699:                              #
-                                # LOE
-..B18.5:                        # Preds ..B18.2
-..LN2275:
-   .loc    1  1374
-        incq      %r14                                          #1374.19
-..LN2277:
-        movq      %r14, %rdi                                    #1374.9
-        movq      %rbx, %rsi                                    #1374.9
-        call      nss_sob at PLT                                   #1374.9
-                                # LOE rax rbx r12 r15 r13d
-..B18.15:                       # Preds ..B18.5
-        movq      %rax, %r14                                    #1374.9
-..LN2279:
-   .loc    1  1375
-        cmpq      %rbx, %r14                                    #1375.15
-        jne       ..B18.8       # Prob 68%                      #1375.15
-                                # LOE rbx r12 r14 r15 r13d
-..B18.6:                        # Preds ..B18.15
-..LN2281:
-   .loc    1  1376
-        movl      $22, (%r15)                                   #1376.9
-                                # LOE r14
-..B18.7:                        # Preds ..B18.6 ..B18.17
-..LN2283:
-   .loc    1  1393
-        movq      -16(%rbp), %rbx                               #1393.12
-..___tag_value_nss_unary_expr.705:                              #
-        movq      -24(%rbp), %r12                               #1393.12
-..___tag_value_nss_unary_expr.706:                              #
-        movq      -32(%rbp), %r13                               #1393.12
-..___tag_value_nss_unary_expr.707:                              #
-        movq      -48(%rbp), %r15                               #1393.12
-..___tag_value_nss_unary_expr.708:                              #
-        movq      %r14, %rax                                    #1393.12
-        movq      -40(%rbp), %r14                               #1393.12
-..___tag_value_nss_unary_expr.709:                              #
-        movq      %rbp, %rsp                                    #1393.12
-        popq      %rbp                                          #1393.12
-..___tag_value_nss_unary_expr.710:                              #
-        ret                                                     #1393.12
-..___tag_value_nss_unary_expr.711:                              #
-                                # LOE
-..B18.8:                        # Preds ..B18.15
-..LN2285:
-   .loc    1  1379
-        movl      $16, %edi                                     #1379.25
-        call      malloc at PLT                                    #1379.25
-                                # LOE rax rbx r12 r14 r15 r13d
-..B18.9:                        # Preds ..B18.8
-..LN2287:
-   .loc    1  1380
-        testq     %rax, %rax                                    #1380.19
-        jne       ..B18.10      # Prob 99%                      #1380.19
-                                # LOE rax rbx r12 r14 r15 r13d
-..B18.11:                       # Preds ..B18.9                 # Infreq
-..LN2289:
-   .loc    1  1381
-        call      __errno_location at PLT                          #1381.24
-                                # LOE rax r14 r15
-..B18.17:                       # Preds ..B18.11                # Infreq
-        movl      (%rax), %edx                                  #1381.24
-..LN2291:
-        movl      %edx, (%r15)                                  #1381.13
-        jmp       ..B18.7       # Prob 100%                     #1381.13
-        .align    16,0x90
-..___tag_value_nss_unary_expr.717:                              #
-                                # LOE r14
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-.LNnss_unary_expr:
-	.data
-# -- End  nss_unary_expr
-	.text
-# -- Begin  nss_primary_expr
-# mark_begin;
-       .align    16,0x90
-nss_primary_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B19.1:                        # Preds ..B19.0
-..___tag_value_nss_primary_expr.718:                            #1291.1
-..LN2293:
-   .loc    1  1291
-        pushq     %rbp                                          #1291.1
-        movq      %rsp, %rbp                                    #1291.1
-..___tag_value_nss_primary_expr.719:                            #
-        subq      $48, %rsp                                     #1291.1
-        movq      %r15, -40(%rbp)                               #1291.1
-..___tag_value_nss_primary_expr.721:                            #
-        movq      %r14, -32(%rbp)                               #1291.1
-..___tag_value_nss_primary_expr.722:                            #
-        movq      %r13, -24(%rbp)                               #1291.1
-..___tag_value_nss_primary_expr.723:                            #
-        movq      %r12, -16(%rbp)                               #1291.1
-..___tag_value_nss_primary_expr.724:                            #
-        movq      %rbx, -8(%rbp)                                #1291.1
-..___tag_value_nss_primary_expr.725:                            #
-        movl      %r8d, %ebx                                    #1291.1
-        movq      %rcx, %r15                                    #1291.1
-        movq      %rdx, %r14                                    #1291.1
-        movq      %rsi, %r13                                    #1291.1
-        movq      %rdi, %r12                                    #1291.1
-        lea       _gprof_pack18(%rip), %rdx                     #1291.1
-        call      mcount at PLT                                    #1291.1
-                                # LOE r12 r13 r14 r15 ebx
-..B19.32:                       # Preds ..B19.1
-..LN2295:
-   .loc    1  1295
-        movsbl    (%r12), %eax                                  #1295.16
-        cmpl      $94, %eax                                     #1295.16
-        jne       ..B19.8       # Prob 67%                      #1295.16
-                                # LOE r12 r13 r14 r15 eax ebx
-..B19.2:                        # Preds ..B19.32
-..LN2297:
-   .loc    1  1298
-        movl      $16, %edi                                     #1298.13
-        call      malloc at PLT                                    #1298.13
-                                # LOE rax r12 r13 r14 r15 ebx
-..B19.33:                       # Preds ..B19.2
-        movq      %rax, %rdx                                    #1298.13
-                                # LOE rdx r12 r13 r14 r15 ebx
-..B19.3:                        # Preds ..B19.33
-..LN2299:
-   .loc    1  1299
-        testq     %rdx, %rdx                                    #1299.19
-        jne       ..B19.5       # Prob 68%                      #1299.19
-                                # LOE rdx r12 r13 r14 r15 ebx
-..B19.4:                        # Preds ..B19.3
-..LN2301:
-   .loc    1  1300
-        call      __errno_location at PLT                          #1300.24
-                                # LOE rax r12 r15
-..B19.34:                       # Preds ..B19.4
-        movl      (%rax), %edx                                  #1300.24
-..LN2303:
-        movl      %edx, (%r15)                                  #1300.13
-        jmp       ..B19.7       # Prob 100%                     #1300.13
-                                # LOE r12
-..B19.5:                        # Preds ..B19.3
-..LN2305:
-   .loc    1  1303
-        movl      $12, (%rdx)                                   #1303.13
-..LN2307:
-   .loc    1  1308
-        movq      %rdx, -48(%rbp)                               #1308.17
-..LN2309:
-   .loc    1  1306
-        movq      %rdx, (%r14)                                  #1306.13
-..LN2311:
-   .loc    1  1308
-        incq      %r12                                          #1308.27
-..LN2313:
-   .loc    1  1304
-        movl      $14, 4(%rdx)                                  #1304.13
-..LN2315:
-   .loc    1  1308
-        movq      %r12, %rdi                                    #1308.17
-        movq      %r13, %rsi                                    #1308.17
-..LN2317:
-   .loc    1  1305
-        movq      $0, 8(%rdx)                                   #1305.13
-..LN2319:
-   .loc    1  1308
-        call      nss_sob at PLT                                   #1308.17
-                                # LOE rax r13 r15 ebx
-..B19.35:                       # Preds ..B19.5
-        movq      -48(%rbp), %rdx                               #
-..LN2321:
-   .loc    1  1309
-        addq      $8, %rdx                                      #1309.17
-        movq      %rax, %rdi                                    #1309.17
-        movq      %r13, %rsi                                    #1309.17
-        movq      %r15, %rcx                                    #1309.17
-        movl      %ebx, %r8d                                    #1309.17
-        call      nss_fasta_expr at PLT                            #1309.17
-                                # LOE rax
-..B19.36:                       # Preds ..B19.35
-        movq      %rax, %r12                                    #1309.17
-                                # LOE r12
-..B19.7:                        # Preds ..B19.36 ..B19.34
-..LN2323:
-   .loc    1  1311
-        movq      -8(%rbp), %rbx                                #1311.16
-..___tag_value_nss_primary_expr.726:                            #
-        movq      -24(%rbp), %r13                               #1311.16
-..___tag_value_nss_primary_expr.727:                            #
-        movq      -32(%rbp), %r14                               #1311.16
-..___tag_value_nss_primary_expr.728:                            #
-        movq      -40(%rbp), %r15                               #1311.16
-..___tag_value_nss_primary_expr.729:                            #
-        movq      %r12, %rax                                    #1311.16
-        movq      -16(%rbp), %r12                               #1311.16
-..___tag_value_nss_primary_expr.730:                            #
-        movq      %rbp, %rsp                                    #1311.16
-        popq      %rbp                                          #1311.16
-..___tag_value_nss_primary_expr.731:                            #
-        ret                                                     #1311.16
-..___tag_value_nss_primary_expr.732:                            #
-                                # LOE
-..B19.8:                        # Preds ..B19.32
-..LN2325:
-   .loc    1  1295
-        cmpl      $40, %eax                                     #1295.16
-        jne       ..B19.19      # Prob 50%                      #1295.16
-                                # LOE r12 r13 r14 r15 ebx
-..B19.9:                        # Preds ..B19.8
-..LN2327:
-   .loc    1  1313
-        movl      $16, %edi                                     #1313.13
-        call      malloc at PLT                                    #1313.13
-                                # LOE rax r12 r13 r14 r15 ebx
-..B19.37:                       # Preds ..B19.9
-        movq      %rax, %r9                                     #1313.13
-                                # LOE r9 r12 r13 r14 r15 ebx
-..B19.10:                       # Preds ..B19.37
-..LN2329:
-   .loc    1  1314
-        testq     %r9, %r9                                      #1314.19
-        jne       ..B19.12      # Prob 68%                      #1314.19
-                                # LOE r9 r12 r13 r14 r15 ebx
-..B19.11:                       # Preds ..B19.10
-..LN2331:
-   .loc    1  1315
-        call      __errno_location at PLT                          #1315.24
-                                # LOE rax r12 r15
-..B19.38:                       # Preds ..B19.11
-        movl      (%rax), %edx                                  #1315.24
-..LN2333:
-        movl      %edx, (%r15)                                  #1315.13
-        jmp       ..B19.18      # Prob 100%                     #1315.13
-                                # LOE r12
-..B19.12:                       # Preds ..B19.10
-..LN2335:
-   .loc    1  1318
-        movl      $12, (%r9)                                    #1318.13
-..LN2337:
-   .loc    1  1322
-        movq      %r9, -48(%rbp)                                #1322.17
-..LN2339:
-   .loc    1  1320
-        movq      %r9, (%r14)                                   #1320.13
-..LN2341:
-   .loc    1  1322
-        incq      %r12                                          #1322.28
-..LN2343:
-   .loc    1  1319
-        movl      $0, 4(%r9)                                    #1319.13
-..LN2345:
-   .loc    1  1322
-        lea       8(%r9), %rdx                                  #1322.42
-..LN2347:
-        movq      %r12, %rdi                                    #1322.17
-        movq      %r13, %rsi                                    #1322.17
-        movq      %r15, %rcx                                    #1322.17
-        movl      %ebx, %r8d                                    #1322.17
-        call      nss_expr at PLT                                  #1322.17
-                                # LOE rax r13 r15
-..B19.39:                       # Preds ..B19.12
-        movq      -48(%rbp), %r9                                #
-                                # LOE rax r9 r13 r15
-..B19.13:                       # Preds ..B19.39
-..LN2349:
-   .loc    1  1323
-        movl      (%r15), %edx                                  #1323.20
-..LN2351:
-   .loc    1  1322
-        movq      %rax, %r12                                    #1322.17
-..LN2353:
-   .loc    1  1323
-        testl     %edx, %edx                                    #1323.30
-        jne       ..B19.18      # Prob 50%                      #1323.30
-                                # LOE rax r9 r12 r13 r15
-..B19.14:                       # Preds ..B19.13
-..LN2355:
-   .loc    1  1325
-        movq      8(%r9), %rdx                                  #1325.22
-..LN2357:
-        testq     %rdx, %rdx                                    #1325.41
-        je        ..B19.17      # Prob 12%                      #1325.41
-                                # LOE rax r12 r13 r15
-..B19.15:                       # Preds ..B19.14
-..LN2359:
-        cmpq      %r13, %rax                                    #1325.54
-        je        ..B19.17      # Prob 12%                      #1325.54
-                                # LOE rax r12 r15
-..B19.16:                       # Preds ..B19.15
-..LN2361:
-        lea       1(%rax), %r12                                 #1325.63
-        movsbl    (%rax), %eax                                  #1325.63
-..LN2363:
-        cmpl      $41, %eax                                     #1325.71
-        je        ..B19.18      # Prob 16%                      #1325.71
-                                # LOE r12 r15
-..B19.17:                       # Preds ..B19.15 ..B19.14 ..B19.16
-..LN2365:
-   .loc    1  1326
-        movl      $22, (%r15)                                   #1326.21
-                                # LOE r12
-..B19.18:                       # Preds ..B19.17 ..B19.16 ..B19.38 ..B19.13
-..LN2367:
-   .loc    1  1329
-        movq      -8(%rbp), %rbx                                #1329.16
-..___tag_value_nss_primary_expr.738:                            #
-        movq      -24(%rbp), %r13                               #1329.16
-..___tag_value_nss_primary_expr.739:                            #
-        movq      -32(%rbp), %r14                               #1329.16
-..___tag_value_nss_primary_expr.740:                            #
-        movq      -40(%rbp), %r15                               #1329.16
-..___tag_value_nss_primary_expr.741:                            #
-        movq      %r12, %rax                                    #1329.16
-        movq      -16(%rbp), %r12                               #1329.16
-..___tag_value_nss_primary_expr.742:                            #
-        movq      %rbp, %rsp                                    #1329.16
-        popq      %rbp                                          #1329.16
-..___tag_value_nss_primary_expr.743:                            #
-        ret                                                     #1329.16
-..___tag_value_nss_primary_expr.744:                            #
-                                # LOE
-..B19.19:                       # Preds ..B19.8
-..LN2369:
-   .loc    1  1332
-        movq      %r12, %rdi                                    #1332.9
-        movq      %r13, %rsi                                    #1332.9
-        movq      %r14, %rdx                                    #1332.9
-        movq      %r15, %rcx                                    #1332.9
-        movl      %ebx, %r8d                                    #1332.9
-        call      nss_fasta_expr at PLT                            #1332.9
-                                # LOE rax r13 r14 r15
-..B19.40:                       # Preds ..B19.19
-        movq      %rax, %rbx                                    #1332.9
-                                # LOE rbx r13 r14 r15
-..B19.20:                       # Preds ..B19.40
-..LN2371:
-   .loc    1  1333
-        movl      (%r15), %eax                                  #1333.12
-..LN2373:
-        testl     %eax, %eax                                    #1333.22
-        jne       ..B19.24      # Prob 50%                      #1333.22
-                                # LOE rbx r13 r14 r15
-..B19.21:                       # Preds ..B19.20
-..LN2375:
-        cmpq      %r13, %rbx                                    #1333.31
-        jae       ..B19.24      # Prob 33%                      #1333.31
-                                # LOE rbx r13 r14 r15
-..B19.22:                       # Preds ..B19.21
-..LN2377:
-   .loc    1  1335
-        movq      %rbx, %rdi                                    #1335.13
-        movq      %r13, %rsi                                    #1335.13
-        call      nss_sob at PLT                                   #1335.13
-                                # LOE rax r13 r14 r15
-..B19.41:                       # Preds ..B19.22
-        movq      %rax, %rbx                                    #1335.13
-..LN2379:
-   .loc    1  1336
-        cmpq      %r13, %rbx                                    #1336.18
-        jae       ..B19.24      # Prob 12%                      #1336.18
-                                # LOE rbx r14 r15
-..B19.23:                       # Preds ..B19.41
-..LN2381:
-        movsbl    (%rbx), %eax                                  #1336.27
-..LN2383:
-        cmpl      $36, %eax                                     #1336.32
-        je        ..B19.26      # Prob 5%                       #1336.32
-                                # LOE rbx r14 r15
-..B19.24:                       # Preds ..B19.43 ..B19.28 ..B19.23 ..B19.41 ..B19.21
-                                #       ..B19.20
-..LN2385:
-   .loc    1  1353
-        movq      -16(%rbp), %r12                               #1353.12
-..___tag_value_nss_primary_expr.750:                            #
-        movq      -24(%rbp), %r13                               #1353.12
-..___tag_value_nss_primary_expr.751:                            #
-        movq      -32(%rbp), %r14                               #1353.12
-..___tag_value_nss_primary_expr.752:                            #
-        movq      -40(%rbp), %r15                               #1353.12
-..___tag_value_nss_primary_expr.753:                            #
-        movq      %rbx, %rax                                    #1353.12
-        movq      -8(%rbp), %rbx                                #1353.12
-..___tag_value_nss_primary_expr.754:                            #
-        movq      %rbp, %rsp                                    #1353.12
-        popq      %rbp                                          #1353.12
-..___tag_value_nss_primary_expr.755:                            #
-        ret                                                     #1353.12
-..___tag_value_nss_primary_expr.756:                            #
-                                # LOE
-..B19.26:                       # Preds ..B19.23                # Infreq
-..LN2387:
-   .loc    1  1338
-        incq      %rbx                                          #1338.16
-..LN2389:
-   .loc    1  1340
-        movl      $16, %edi                                     #1340.17
-        call      malloc at PLT                                    #1340.17
-                                # LOE rax rbx r14 r15
-..B19.27:                       # Preds ..B19.26                # Infreq
-..LN2391:
-   .loc    1  1341
-        testq     %rax, %rax                                    #1341.23
-        je        ..B19.29      # Prob 12%                      #1341.23
-                                # LOE rax rbx r14 r15
-..B19.28:                       # Preds ..B19.27                # Infreq
-..LN2393:
-   .loc    1  1347
-        movq      (%r14), %rdx                                  #1347.37
-..LN2395:
-   .loc    1  1345
-        movl      $12, (%rax)                                   #1345.17
-..LN2397:
-   .loc    1  1347
-        movq      %rdx, 8(%rax)                                 #1347.17
-..LN2399:
-   .loc    1  1348
-        movq      %rax, (%r14)                                  #1348.17
-..LN2401:
-   .loc    1  1346
-        movl      $15, 4(%rax)                                  #1346.17
-        jmp       ..B19.24      # Prob 100%                     #1346.17
-                                # LOE rbx
-..B19.29:                       # Preds ..B19.27                # Infreq
-..LN2403:
-   .loc    1  1342
-        call      __errno_location at PLT                          #1342.28
-                                # LOE rax rbx r15
-..B19.43:                       # Preds ..B19.29                # Infreq
-        movl      (%rax), %edx                                  #1342.28
-..LN2405:
-        movl      %edx, (%r15)                                  #1342.17
-        jmp       ..B19.24      # Prob 100%                     #1342.17
-        .align    16,0x90
-..___tag_value_nss_primary_expr.762:                            #
-                                # LOE rbx
-# mark_end;
-	.type	nss_primary_expr, at function
-	.size	nss_primary_expr,.-nss_primary_expr
-.LNnss_primary_expr:
-	.data
-# -- End  nss_primary_expr
-	.text
-# -- Begin  nss_sob
-# mark_begin;
-       .align    16,0x90
-nss_sob:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-..B20.1:                        # Preds ..B20.0
-..___tag_value_nss_sob.763:                                     #1181.1
-..LN2407:
-   .loc    1  1181
-        pushq     %rbp                                          #1181.1
-        movq      %rsp, %rbp                                    #1181.1
-..___tag_value_nss_sob.764:                                     #
-        subq      $32, %rsp                                     #1181.1
-        movq      %r15, -24(%rbp)                               #1181.1
-..___tag_value_nss_sob.766:                                     #
-        movq      %r14, -16(%rbp)                               #1181.1
-..___tag_value_nss_sob.767:                                     #
-        movq      %r13, -8(%rbp)                                #1181.1
-..___tag_value_nss_sob.768:                                     #
-        movq      %rbx, -32(%rbp)                               #1181.1
-..___tag_value_nss_sob.769:                                     #
-        movq      %rsi, %rbx                                    #1181.1
-        movq      %rdi, %r15                                    #1181.1
-        lea       _gprof_pack19(%rip), %rdx                     #1181.1
-        call      mcount at PLT                                    #1181.1
-                                # LOE rbx r12 r15
-..B20.10:                       # Preds ..B20.1
-        movq      %r15, %r14                                    #1181.1
-..LN2409:
-   .loc    1  1182
-        xorl      %r13d, %r13d                                  #1182.5
-..LN2411:
-        cmpq      %rbx, %r15                                    #1182.17
-        jae       ..B20.6       # Prob 2%                       #1182.17
-                                # LOE rbx r12 r13 r14 r15
-..B20.2:                        # Preds ..B20.10
-..LN2413:
-        call      __ctype_b_loc at PLT                             #1182.24
-                                # LOE rax rbx r12 r13 r14 r15
-..B20.11:                       # Preds ..B20.2
-        movq      (%rax), %rax                                  #1182.24
-..LN2415:
-   .loc    1  1181
-        subq      %r15, %rbx                                    #1181.1
-                                # LOE rax rbx r12 r13 r14 r15
-..B20.3:                        # Preds ..B20.4 ..B20.11
-..LN2417:
-   .loc    1  1182
-        movzbl    (%r13,%r14), %edx                             #1182.24
-        movzwl    (%rax,%rdx,2), %ecx                           #1182.24
-        testl     $8192, %ecx                                   #1182.24
-        je        ..B20.6       # Prob 20%                      #1182.24
-                                # LOE rax rbx r12 r13 r14 r15
-..B20.4:                        # Preds ..B20.3
-..LN2419:
-   .loc    1  1183
-        lea       1(%r13,%r14), %r15                            #1183.12
-..LN2421:
-   .loc    1  1182
-        incq      %r13                                          #1182.5
-        cmpq      %rbx, %r13                                    #1182.5
-        jb        ..B20.3       # Prob 82%                      #1182.5
-                                # LOE rax rbx r12 r13 r14 r15
-..B20.6:                        # Preds ..B20.3 ..B20.4 ..B20.10
-..LN2423:
-   .loc    1  1184
-        movq      -32(%rbp), %rbx                               #1184.12
-..___tag_value_nss_sob.770:                                     #
-        movq      -8(%rbp), %r13                                #1184.12
-..___tag_value_nss_sob.771:                                     #
-        movq      -16(%rbp), %r14                               #1184.12
-..___tag_value_nss_sob.772:                                     #
-        movq      %r15, %rax                                    #1184.12
-        movq      -24(%rbp), %r15                               #1184.12
-..___tag_value_nss_sob.773:                                     #
-        movq      %rbp, %rsp                                    #1184.12
-        popq      %rbp                                          #1184.12
-..___tag_value_nss_sob.774:                                     #
-        ret                                                     #1184.12
-        .align    16,0x90
-..___tag_value_nss_sob.775:                                     #
-                                # LOE
-# mark_end;
-	.type	nss_sob, at function
-	.size	nss_sob,.-nss_sob
-.LNnss_sob:
-	.data
-# -- End  nss_sob
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    16,0x90
-nss_fasta_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B21.1:                        # Preds ..B21.0
-..___tag_value_nss_fasta_expr.776:                              #1234.1
-..LN2425:
-   .loc    1  1234
-        pushq     %rbp                                          #1234.1
-        movq      %rsp, %rbp                                    #1234.1
-..___tag_value_nss_fasta_expr.777:                              #
-        subq      $48, %rsp                                     #1234.1
-        movq      %r15, -24(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.779:                              #
-        movq      %r14, -16(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.780:                              #
-        movq      %r13, -48(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.781:                              #
-        movq      %r12, -40(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.782:                              #
-        movq      %rbx, -32(%rbp)                               #1234.1
-..___tag_value_nss_fasta_expr.783:                              #
-        movl      %r8d, %r13d                                   #1234.1
-        movq      %rcx, %r15                                    #1234.1
-        movq      %rdx, %r12                                    #1234.1
-        movq      %rsi, %r14                                    #1234.1
-        movq      %rdi, %rbx                                    #1234.1
-        lea       _gprof_pack20(%rip), %rdx                     #1234.1
-        call      mcount at PLT                                    #1234.1
-                                # LOE rbx r12 r14 r15 r13d
-..B21.20:                       # Preds ..B21.1
-..LN2427:
-   .loc    1  1236
-        movsbl    (%rbx), %eax                                  #1236.16
-        cmpl      $39, %eax                                     #1236.16
-        jne       ..B21.7       # Prob 67%                      #1236.16
-                                # LOE rbx r12 r14 r15 eax r13d
-..B21.2:                        # Preds ..B21.20
-..LN2429:
-   .loc    1  1239
-        incq      %rbx                                          #1239.30
-..LN2431:
-        movq      %rbx, %rdi                                    #1239.13
-        movq      %r14, %rsi                                    #1239.13
-        movq      %r12, %rdx                                    #1239.13
-        movq      %r15, %rcx                                    #1239.13
-        movl      %r13d, %r8d                                   #1239.13
-        call      nss_FASTA_expr at PLT                            #1239.13
-                                # LOE rax r14 r15
-..B21.3:                        # Preds ..B21.2
-..LN2433:
-   .loc    1  1240
-        movl      (%r15), %edx                                  #1240.16
-..LN2435:
-   .loc    1  1239
-        movq      %rax, %rcx                                    #1239.13
-..LN2437:
-   .loc    1  1240
-        testl     %edx, %edx                                    #1240.26
-        jne       ..B21.13      # Prob 50%                      #1240.26
-                                # LOE rax rcx r14 r15
-..B21.4:                        # Preds ..B21.3
-..LN2439:
-        cmpq      %r14, %rax                                    #1240.38
-        je        ..B21.12      # Prob 12%                      #1240.38
-                                # LOE rax rcx r15
-..B21.5:                        # Preds ..B21.4
-..LN2441:
-        movsbl    (%rax), %edx                                  #1240.47
-        lea       1(%rax), %rcx                                 #1240.47
-..LN2443:
-        cmpl      $39, %edx                                     #1240.55
-        jne       ..B21.12      # Prob 84%                      #1240.55
-        jmp       ..B21.13      # Prob 100%                     #1240.55
-                                # LOE rcx r15
-..B21.7:                        # Preds ..B21.20
-..LN2445:
-   .loc    1  1236
-        cmpl      $34, %eax                                     #1236.16
-        jne       ..B21.14      # Prob 50%                      #1236.16
-                                # LOE rbx r12 r14 r15 r13d
-..B21.8:                        # Preds ..B21.7
-..LN2447:
-   .loc    1  1244
-        incq      %rbx                                          #1244.30
-..LN2449:
-        movq      %rbx, %rdi                                    #1244.13
-        movq      %r14, %rsi                                    #1244.13
-        movq      %r12, %rdx                                    #1244.13
-        movq      %r15, %rcx                                    #1244.13
-        movl      %r13d, %r8d                                   #1244.13
-        call      nss_FASTA_expr at PLT                            #1244.13
-                                # LOE rax r14 r15
-..B21.9:                        # Preds ..B21.8
-..LN2451:
-   .loc    1  1245
-        movl      (%r15), %edx                                  #1245.16
-..LN2453:
-   .loc    1  1244
-        movq      %rax, %rcx                                    #1244.13
-..LN2455:
-   .loc    1  1245
-        testl     %edx, %edx                                    #1245.26
-        jne       ..B21.13      # Prob 50%                      #1245.26
-                                # LOE rax rcx r14 r15
-..B21.10:                       # Preds ..B21.9
-..LN2457:
-        cmpq      %r14, %rax                                    #1245.38
-        je        ..B21.12      # Prob 12%                      #1245.38
-                                # LOE rax rcx r15
-..B21.11:                       # Preds ..B21.10
-..LN2459:
-        movsbl    (%rax), %edx                                  #1245.47
-        lea       1(%rax), %rcx                                 #1245.47
-..LN2461:
-        cmpl      $34, %edx                                     #1245.55
-        je        ..B21.13      # Prob 16%                      #1245.55
-                                # LOE rcx r15
-..B21.12:                       # Preds ..B21.10 ..B21.4 ..B21.5 ..B21.11
-..LN2463:
-   .loc    1  1246
-        movl      $22, (%r15)                                   #1246.13
-                                # LOE rcx
-..B21.13:                       # Preds ..B21.5 ..B21.12 ..B21.11 ..B21.3 ..B21.9
-                                #      
-..LN2465:
-   .loc    1  1252
-        movq      -32(%rbp), %rbx                               #1252.12
-..___tag_value_nss_fasta_expr.784:                              #
-        movq      -40(%rbp), %r12                               #1252.12
-..___tag_value_nss_fasta_expr.785:                              #
-        movq      -48(%rbp), %r13                               #1252.12
-..___tag_value_nss_fasta_expr.786:                              #
-        movq      -16(%rbp), %r14                               #1252.12
-..___tag_value_nss_fasta_expr.787:                              #
-        movq      %rcx, %rax                                    #1252.12
-        movq      -24(%rbp), %r15                               #1252.12
-..___tag_value_nss_fasta_expr.788:                              #
-        movq      %rbp, %rsp                                    #1252.12
-        popq      %rbp                                          #1252.12
-..___tag_value_nss_fasta_expr.789:                              #
-        ret                                                     #1252.12
-..___tag_value_nss_fasta_expr.790:                              #
-                                # LOE
-..B21.14:                       # Preds ..B21.7
-..LN2467:
-   .loc    1  1249
-        movq      %rbx, %rdi                                    #1249.16
-        movq      %r14, %rsi                                    #1249.16
-        movq      %r12, %rdx                                    #1249.16
-        movq      %r15, %rcx                                    #1249.16
-        movl      %r13d, %r8d                                   #1249.16
-        call      nss_FASTA_expr at PLT                            #1249.16
-                                # LOE rax
-..B21.15:                       # Preds ..B21.14
-        movq      -32(%rbp), %rbx                               #1249.16
-..___tag_value_nss_fasta_expr.796:                              #
-        movq      -40(%rbp), %r12                               #1249.16
-..___tag_value_nss_fasta_expr.797:                              #
-        movq      -48(%rbp), %r13                               #1249.16
-..___tag_value_nss_fasta_expr.798:                              #
-        movq      -16(%rbp), %r14                               #1249.16
-..___tag_value_nss_fasta_expr.799:                              #
-        movq      -24(%rbp), %r15                               #1249.16
-..___tag_value_nss_fasta_expr.800:                              #
-        movq      %rbp, %rsp                                    #1249.16
-        popq      %rbp                                          #1249.16
-..___tag_value_nss_fasta_expr.801:                              #
-        ret                                                     #1249.16
-        .align    16,0x90
-..___tag_value_nss_fasta_expr.802:                              #
-                                # LOE
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-.LNnss_fasta_expr:
-	.data
-# -- End  nss_fasta_expr
-	.text
-# -- Begin  nss_FASTA_expr
-# mark_begin;
-       .align    16,0x90
-nss_FASTA_expr:
-# parameter 1(p): %rdi
-# parameter 2(end): %rsi
-# parameter 3(expr): %rdx
-# parameter 4(status): %rcx
-# parameter 5(positional): %r8d
-..B22.1:                        # Preds ..B22.0
-..___tag_value_nss_FASTA_expr.803:                              #1192.1
-..LN2469:
-   .loc    1  1192
-        pushq     %rbp                                          #1192.1
-        movq      %rsp, %rbp                                    #1192.1
-..___tag_value_nss_FASTA_expr.804:                              #
-        subq      $48, %rsp                                     #1192.1
-        movq      %r15, -48(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.806:                              #
-        movq      %r14, -40(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.807:                              #
-        movq      %r13, -32(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.808:                              #
-        movq      %r12, -24(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.809:                              #
-        movq      %rbx, -16(%rbp)                               #1192.1
-..___tag_value_nss_FASTA_expr.810:                              #
-        movl      %r8d, %r15d                                   #1192.1
-        movq      %rcx, %r14                                    #1192.1
-        movq      %rdx, %r13                                    #1192.1
-        movq      %rsi, %rbx                                    #1192.1
-        movq      %rdi, %r12                                    #1192.1
-        lea       _gprof_pack21(%rip), %rdx                     #1192.1
-        call      mcount at PLT                                    #1192.1
-                                # LOE rbx r12 r13 r14 r15d
-..B22.24:                       # Preds ..B22.1
-..LN2471:
-   .loc    1  1193
-        cmpq      %rbx, %r12                                    #1193.15
-        jae       ..B22.9       # Prob 44%                      #1193.15
-                                # LOE rbx r12 r13 r14 r15d
-..B22.3:                        # Preds ..B22.24
-..LN2473:
-   .loc    1  1192
-        movq      %r12, %rdx                                    #1192.1
-..LN2475:
-   .loc    1  1199
-        xorl      %eax, %eax                                    #1199.22
-..LN2477:
-   .loc    1  1200
-        lea       fasta_2na_map.0(%rip), %rcx                   #1200.27
-                                # LOE rdx rcx rbx r12 r13 r14 eax r15d
-..B22.4:                        # Preds ..B22.6 ..B22.3
-..LN2479:
-   .loc    1  1203
-        movsbl    (%r12), %esi                                  #1203.20
-..LN2481:
-        testl     %esi, %esi                                    #1203.24
-        jl        ..B22.8       # Prob 20%                      #1203.24
-                                # LOE rdx rcx rbx r12 r13 r14 eax r15d
-..B22.5:                        # Preds ..B22.4
-..LN2483:
-   .loc    1  1206
-        movzbl    (%r12), %esi                                  #1206.45
-..LN2485:
-        movsbl    (%rsi,%rcx), %edi                             #1206.18
-..LN2487:
-        testl     %edi, %edi                                    #1206.51
-        jl        ..B22.16      # Prob 16%                      #1206.51
-                                # LOE rdx rcx rbx r12 r13 r14 eax esi r15d
-..B22.6:                        # Preds ..B22.18 ..B22.5
-..LN2489:
-   .loc    1  1216
-        incq      %r12                                          #1216.20
-..LN2491:
-        cmpq      %rbx, %r12                                    #1216.24
-        jb        ..B22.4       # Prob 82%                      #1216.24
-                                # LOE rdx rcx rbx r12 r13 r14 eax r15d
-..B22.8:                        # Preds ..B22.17 ..B22.16 ..B22.4 ..B22.6
-..LN2493:
-   .loc    1  1218
-        cmpq      %rdx, %r12                                    #1218.19
-        ja        ..B22.11      # Prob 12%                      #1218.19
-                                # LOE rdx r12 r13 r14 eax r15d
-..B22.9:                        # Preds ..B22.24 ..B22.8
-..LN2495:
-   .loc    1  1219
-        movl      $22, (%r14)                                   #1219.13
-                                # LOE r12
-..B22.10:                       # Preds ..B22.9 ..B22.13 ..B22.15
-..LN2497:
-   .loc    1  1226
-        movq      -16(%rbp), %rbx                               #1226.12
-..___tag_value_nss_FASTA_expr.811:                              #
-        movq      -32(%rbp), %r13                               #1226.12
-..___tag_value_nss_FASTA_expr.812:                              #
-        movq      -40(%rbp), %r14                               #1226.12
-..___tag_value_nss_FASTA_expr.813:                              #
-        movq      -48(%rbp), %r15                               #1226.12
-..___tag_value_nss_FASTA_expr.814:                              #
-        movq      %r12, %rax                                    #1226.12
-        movq      -24(%rbp), %r12                               #1226.12
-..___tag_value_nss_FASTA_expr.815:                              #
-        movq      %rbp, %rsp                                    #1226.12
-        popq      %rbp                                          #1226.12
-..___tag_value_nss_FASTA_expr.816:                              #
-        ret                                                     #1226.12
-..___tag_value_nss_FASTA_expr.817:                              #
-                                # LOE
-..B22.11:                       # Preds ..B22.8                 # Infreq
-..LN2499:
-   .loc    1  1220
-        testl     %eax, %eax                                    #1220.27
-        jne       ..B22.14      # Prob 50%                      #1220.27
-                                # LOE rdx r12 r13 r14 r15d
-..B22.12:                       # Preds ..B22.11                # Infreq
-..LN2501:
-   .loc    1  1221
-        movq      %r12, %rcx                                    #1221.72
-        subq      %rdx, %rcx                                    #1221.72
-..LN2503:
-        movq      %r13, %rdi                                    #1221.24
-        movl      %r15d, %esi                                   #1221.24
-        call      NucStrFastaExprMake2 at PLT                      #1221.24
-                                # LOE r12 r14 eax
-..B22.13:                       # Preds ..B22.12                # Infreq
-..LN2505:
-        movl      %eax, (%r14)                                  #1221.13
-        jmp       ..B22.10      # Prob 100%                     #1221.13
-                                # LOE r12
-..B22.14:                       # Preds ..B22.11                # Infreq
-..LN2507:
-   .loc    1  1223
-        movq      %r12, %rcx                                    #1223.72
-        subq      %rdx, %rcx                                    #1223.72
-..LN2509:
-        movq      %r13, %rdi                                    #1223.24
-        movl      %r15d, %esi                                   #1223.24
-        call      NucStrFastaExprMake4 at PLT                      #1223.24
-                                # LOE r12 r14 eax
-..B22.15:                       # Preds ..B22.14                # Infreq
-..LN2511:
-        movl      %eax, (%r14)                                  #1223.13
-        jmp       ..B22.10      # Prob 100%                     #1223.13
-                                # LOE r12
-..B22.16:                       # Preds ..B22.5                 # Infreq
-..LN2513:
-   .loc    1  1208
-        lea       fasta_4na_map.0(%rip), %rdi                   #1208.29
-        cmpq      %rdi, %rcx                                    #1208.29
-        je        ..B22.8       # Prob 20%                      #1208.29
-                                # LOE rdx rbx r12 r13 r14 eax esi r15d
-..B22.17:                       # Preds ..B22.16                # Infreq
-..LN2515:
-   .loc    1  1210
-        movl      %esi, %esi                                    #1210.22
-        lea       fasta_4na_map.0(%rip), %rcx                   #1210.22
-        movsbl    (%rcx,%rsi), %edi                             #1210.22
-..LN2517:
-        testl     %edi, %edi                                    #1210.65
-        jl        ..B22.8       # Prob 20%                      #1210.65
-                                # LOE rdx rbx r12 r13 r14 eax r15d
-..B22.18:                       # Preds ..B22.17                # Infreq
-..LN2519:
-   .loc    1  1212
-        movl      $1, %eax                                      #1212.17
-..LN2521:
-   .loc    1  1213
-        lea       fasta_4na_map.0(%rip), %rcx                   #1213.23
-        jmp       ..B22.6       # Prob 100%                     #1213.23
-        .align    16,0x90
-..___tag_value_nss_FASTA_expr.823:                              #
-                                # LOE rdx rcx rbx r12 r13 r14 eax r15d
-# mark_end;
-	.type	nss_FASTA_expr, at function
-	.size	nss_FASTA_expr,.-nss_FASTA_expr
-.LNnss_FASTA_expr:
-	.data
-# -- End  nss_FASTA_expr
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    16,0x90
-NucStrFastaExprMake2:
-# parameter 1(expr): %rdi
-# parameter 2(positional): %esi
-# parameter 3(fasta): %rdx
-# parameter 4(size): %rcx
-..B23.1:                        # Preds ..B23.0
-..___tag_value_NucStrFastaExprMake2.824:                        #838.1
-..LN2523:
-   .loc    1  838
-        pushq     %rbp                                          #838.1
-        movq      %rsp, %rbp                                    #838.1
-..___tag_value_NucStrFastaExprMake2.825:                        #
-        subq      $80, %rsp                                     #838.1
-        movq      %r15, -32(%rbp)                               #838.1
-..___tag_value_NucStrFastaExprMake2.827:                        #
-        movq      %r14, -48(%rbp)                               #838.1
-..___tag_value_NucStrFastaExprMake2.828:                        #
-        movq      %r13, -40(%rbp)                               #838.1
-..___tag_value_NucStrFastaExprMake2.829:                        #
-        movq      %r12, -16(%rbp)                               #838.1
-..___tag_value_NucStrFastaExprMake2.830:                        #
-        movq      %rbx, -24(%rbp)                               #838.1
-..___tag_value_NucStrFastaExprMake2.831:                        #
-        movq      %rcx, %r13                                    #838.1
-        movq      %rdx, %r14                                    #838.1
-        movl      %esi, %r12d                                   #838.1
-        movq      %rdi, %r15                                    #838.1
-        lea       _gprof_pack22(%rip), %rdx                     #838.1
-        call      mcount at PLT                                    #838.1
-                                # LOE r13 r14 r15 r12d
-..B23.60:                       # Preds ..B23.1
-..LN2525:
-   .loc    1  844
-        cmpq      $61, %r13                                     #844.17
-        jbe       ..B23.3       # Prob 43%                      #844.17
-                                # LOE r13 r14 r15 r12d
-..B23.2:                        # Preds ..B23.60
-..LN2527:
-   .loc    1  845
-        movq      -24(%rbp), %rbx                               #845.16
-..___tag_value_NucStrFastaExprMake2.832:                        #
-        movq      -16(%rbp), %r12                               #845.16
-..___tag_value_NucStrFastaExprMake2.833:                        #
-        movq      -40(%rbp), %r13                               #845.16
-..___tag_value_NucStrFastaExprMake2.834:                        #
-        movq      -48(%rbp), %r14                               #845.16
-..___tag_value_NucStrFastaExprMake2.835:                        #
-        movl      $7, %eax                                      #845.16
-        movq      -32(%rbp), %r15                               #845.16
-..___tag_value_NucStrFastaExprMake2.836:                        #
-        movq      %rbp, %rsp                                    #845.16
-        popq      %rbp                                          #845.16
-..___tag_value_NucStrFastaExprMake2.837:                        #
-        ret                                                     #845.16
-..___tag_value_NucStrFastaExprMake2.838:                        #
-                                # LOE
-..B23.3:                        # Preds ..B23.60
-..LN2529:
-   .loc    1  847
-        movl      $144, %edi                                    #847.9
-        call      NucStrFastaExprAlloc at PLT                      #847.9
-                                # LOE rax r13 r14 r15 r12d
-..B23.61:                       # Preds ..B23.3
-        movq      %rax, %rbx                                    #847.9
-                                # LOE rbx r13 r14 r15 r12d
-..B23.4:                        # Preds ..B23.61
-..LN2531:
-   .loc    1  848
-        testq     %rbx, %rbx                                    #848.15
-        je        ..B23.57      # Prob 5%                       #848.15
-                                # LOE rbx r13 r14 r15 r12d
-..B23.5:                        # Preds ..B23.4
-..LN2533:
-   .loc    1  851
-        movq      %rbx, (%r15)                                  #851.5
-..LN2535:
-   .loc    1  852
-        movl      %r13d, 4(%rbx)                                #852.5
-..LN2537:
-   .loc    1  856
-        xorl      %edi, %edi                                    #856.11
-..LN2539:
-        testq     %r13, %r13                                    #856.22
-        jbe       ..B23.16      # Prob 16%                      #856.22
-                                # LOE rbx rdi r13 r14 r12d
-..B23.7:                        # Preds ..B23.5 ..B23.14
-..LN2541:
-   .loc    1  858
-        movsbq    (%rdi,%r14), %rdx                             #858.48
-..LN2543:
-        lea       fasta_2na_map.0(%rip), %rax                   #858.24
-        movzbl    (%rax,%rdx), %edx                             #858.24
-..LN2545:
-   .loc    1  859
-        movq      %rdi, %rax                                    #859.22
-        andq      $3, %rax                                      #859.22
-        je        ..B23.56      # Prob 20%                      #859.22
-                                # LOE rax rbx rdi r13 r14 edx r12d
-..B23.8:                        # Preds ..B23.7
-        cmpq      $1, %rax                                      #859.22
-        je        ..B23.13      # Prob 25%                      #859.22
-                                # LOE rax rbx rdi r13 r14 edx r12d
-..B23.9:                        # Preds ..B23.8
-        cmpq      $2, %rax                                      #859.22
-        jne       ..B23.11      # Prob 67%                      #859.22
-                                # LOE rax rbx rdi r13 r14 edx r12d
-..B23.10:                       # Preds ..B23.9
-..LN2547:
-   .loc    1  870
-        movq      %rdi, %rax                                    #870.32
-        shrq      $2, %rax                                      #870.32
-..LN2549:
-        shll      $2, %edx                                      #870.47
-..LN2551:
-        orb       %dl, -80(%rbp,%rax)                           #870.13
-..LN2553:
-   .loc    1  871
-        orb       $12, -64(%rbp,%rax)                           #871.13
-        jmp       ..B23.14      # Prob 100%                     #871.13
-                                # LOE rbx rdi r13 r14 r12d
-..B23.11:                       # Preds ..B23.9
-..LN2555:
-   .loc    1  859
-        cmpq      $3, %rax                                      #859.22
-        jne       ..B23.14      # Prob 50%                      #859.22
-                                # LOE rbx rdi r13 r14 edx r12d
-..B23.12:                       # Preds ..B23.11
-..LN2557:
-   .loc    1  874
-        movq      %rdi, %rax                                    #874.32
-        shrq      $2, %rax                                      #874.32
-..LN2559:
-        orb       %dl, -80(%rbp,%rax)                           #874.13
-..LN2561:
-   .loc    1  875
-        orb       $3, -64(%rbp,%rax)                            #875.13
-        jmp       ..B23.14      # Prob 100%                     #875.13
-                                # LOE rbx rdi r13 r14 r12d
-..B23.13:                       # Preds ..B23.8
-..LN2563:
-   .loc    1  866
-        movq      %rdi, %rax                                    #866.32
-        shrq      $2, %rax                                      #866.32
-..LN2565:
-        shll      $4, %edx                                      #866.47
-..LN2567:
-        orb       %dl, -80(%rbp,%rax)                           #866.13
-..LN2569:
-   .loc    1  867
-        orb       $48, -64(%rbp,%rax)                           #867.13
-                                # LOE rbx rdi r13 r14 r12d
-..B23.14:                       # Preds ..B23.11 ..B23.56 ..B23.13 ..B23.10 ..B23.12
-                                #      
-..LN2571:
-   .loc    1  856
-        incq      %rdi                                          #856.31
-..LN2573:
-        cmpq      %r13, %rdi                                    #856.22
-        jb        ..B23.7       # Prob 82%                      #856.22
-                                # LOE rbx rdi r13 r14 r12d
-..B23.16:                       # Preds ..B23.14 ..B23.5
-..LN2575:
-   .loc    1  881
-        addq      $3, %rdi                                      #881.21
-..LN2577:
-        shrq      $2, %rdi                                      #881.28
-..LN2579:
-        cmpq      $16, %rdi                                     #881.35
-        jae       ..B23.29      # Prob 50%                      #881.35
-                                # LOE rbx rdi r13 r12d
-..B23.17:                       # Preds ..B23.16
-..LN2581:
-   .loc    1  883
-        lea       -80(%rbp), %rdx                               #883.9
-..LN2583:
-   .loc    1  881
-        movq      %rdi, %rsi                                    #881.5
-        negq      %rsi                                          #881.5
-        addq      $16, %rsi                                     #881.5
-        lea       (%rdx,%rdi), %rcx                             #881.5
-        movq      %rcx, %rdx                                    #881.5
-        andq      $15, %rdx                                     #881.5
-        movq      %rdx, %rax                                    #881.5
-        negq      %rax                                          #881.5
-        addq      $16, %rax                                     #881.5
-        cmpq      $0, %rdx                                      #881.5
-        cmovne    %rax, %rdx                                    #881.5
-        lea       16(%rdx), %r8                                 #881.5
-        cmpq      %r8, %rsi                                     #881.5
-        jl        ..B23.55      # Prob 10%                      #881.5
-                                # LOE rdx rcx rbx rsi rdi r13 r12d
-..B23.18:                       # Preds ..B23.17
-        movq      %rsi, %rax                                    #881.5
-        subq      %rdx, %rax                                    #881.5
-        andq      $15, %rax                                     #881.5
-        negq      %rax                                          #881.5
-        addq      %rsi, %rax                                    #881.5
-        xorl      %r9d, %r9d                                    #881.5
-        testq     %rdx, %rdx                                    #881.5
-        jbe       ..B23.22      # Prob 10%                      #881.5
-                                # LOE rax rdx rcx rbx rsi rdi r9 r13 r12d
-..B23.19:                       # Preds ..B23.18
-..LN2585:
-   .loc    1  884
-        lea       -64(%rbp), %r8                                #884.9
-        addq      %rdi, %r8                                     #
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d
-..B23.20:                       # Preds ..B23.20 ..B23.19
-..LN2587:
-   .loc    1  883
-        xorl      %r10d, %r10d                                  #883.9
-        movb      %r10b, (%r9,%rcx)                             #883.9
-..LN2589:
-   .loc    1  884
-        movb      %r10b, (%r9,%r8)                              #884.9
-..LN2591:
-   .loc    1  881
-        incq      %r9                                           #881.5
-        cmpq      %rdx, %r9                                     #881.5
-        jb        ..B23.20      # Prob 82%                      #881.5
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d
-..B23.22:                       # Preds ..B23.20 ..B23.18
-..LN2593:
-   .loc    1  883
-        lea       -80(%rbp), %r9                                #883.9
-..LN2595:
-   .loc    1  884
-        lea       -64(%rbp), %r8                                #884.9
-        addq      %rdi, %r9                                     #
-        addq      %rdi, %r8                                     #
-..LN2597:
-   .loc    1  883
-        pxor      %xmm0, %xmm0                                  #883.29
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d xmm0
-..B23.23:                       # Preds ..B23.23 ..B23.22
-..LN2599:
-        movdqa    %xmm0, (%rdx,%r9)                             #883.9
-..LN2601:
-   .loc    1  884
-        movdqa    %xmm0, (%rdx,%r8)                             #884.9
-..LN2603:
-   .loc    1  881
-        addq      $16, %rdx                                     #881.5
-        cmpq      %rax, %rdx                                    #881.5
-        jb        ..B23.23      # Prob 82%                      #881.5
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d xmm0
-..B23.25:                       # Preds ..B23.23 ..B23.55
-        cmpq      %rsi, %rax                                    #881.5
-        jae       ..B23.29      # Prob 10%                      #881.5
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B23.26:                       # Preds ..B23.25
-..LN2605:
-   .loc    1  884
-        lea       -64(%rbp), %rdx                               #884.9
-        addq      %rdx, %rdi                                    #
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B23.27:                       # Preds ..B23.27 ..B23.26
-..LN2607:
-   .loc    1  883
-        xorl      %edx, %edx                                    #883.9
-        movb      %dl, (%rax,%rcx)                              #883.9
-..LN2609:
-   .loc    1  884
-        movb      %dl, (%rax,%rdi)                              #884.9
-..LN2611:
-   .loc    1  881
-        incq      %rax                                          #881.5
-        cmpq      %rsi, %rax                                    #881.5
-        jb        ..B23.27      # Prob 82%                      #881.5
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B23.29:                       # Preds ..B23.27 ..B23.25 ..B23.16
-..LN2613:
-   .loc    1  890
-        testl     %r12d, %r12d                                  #890.10
-        je        ..B23.31      # Prob 50%                      #890.10
-                                # LOE rbx r13
-..B23.30:                       # Preds ..B23.29
-..LN2615:
-   .loc    1  892
-        movl      $9, (%rbx)                                    #892.9
-        jmp       ..B23.40      # Prob 100%                     #892.9
-                                # LOE rbx
-..B23.31:                       # Preds ..B23.29
-..LN2617:
-   .loc    1  896
-        cmpq      $2, %r13                                      #896.22
-        jae       ..B23.33      # Prob 50%                      #896.22
-                                # LOE rbx r13
-..B23.32:                       # Preds ..B23.31
-..LN2619:
-   .loc    1  898
-        movzbl    -80(%rbp), %eax                               #898.29
-..LN2621:
-   .loc    1  903
-        movzbl    -64(%rbp), %edi                               #903.26
-..LN2623:
-   .loc    1  908
-        movl      $2, (%rbx)                                    #908.9
-..LN2625:
-   .loc    1  898
-        movb      %al, -79(%rbp)                                #898.9
-..LN2627:
-   .loc    1  899
-        movzwl    -80(%rbp), %edx                               #899.29
-..LN2629:
-        movw      %dx, -78(%rbp)                                #899.9
-..LN2631:
-   .loc    1  900
-        movl      -80(%rbp), %ecx                               #900.29
-..LN2633:
-   .loc    1  901
-        movl      -80(%rbp), %esi                               #901.29
-..LN2635:
-   .loc    1  900
-        movl      %ecx, -76(%rbp)                               #900.9
-..LN2637:
-   .loc    1  903
-        movb      %dil, -63(%rbp)                               #903.9
-..LN2639:
-   .loc    1  904
-        movzwl    -64(%rbp), %r8d                               #904.26
-..LN2641:
-        movw      %r8w, -62(%rbp)                               #904.9
-..LN2643:
-   .loc    1  905
-        movl      -64(%rbp), %r9d                               #905.26
-..LN2645:
-   .loc    1  906
-        movl      -64(%rbp), %r10d                              #906.26
-..LN2647:
-   .loc    1  905
-        movl      %r9d, -60(%rbp)                               #905.9
-..LN2649:
-   .loc    1  900
-        movl      %ecx, %ecx                                    #900.9
-..LN2651:
-   .loc    1  901
-        shlq      $32, %rcx                                     #901.29
-..LN2653:
-   .loc    1  905
-        movl      %r9d, %r9d                                    #905.9
-..LN2655:
-   .loc    1  906
-        shlq      $32, %r9                                      #906.26
-..LN2657:
-   .loc    1  901
-        orq       %rsi, %rcx                                    #901.29
-..LN2659:
-        movq      %rcx, -72(%rbp)                               #901.9
-..LN2661:
-   .loc    1  906
-        orq       %r10, %r9                                     #906.26
-..LN2663:
-        movq      %r9, -56(%rbp)                                #906.9
-        jmp       ..B23.40      # Prob 100%                     #906.9
-                                # LOE rbx
-..B23.33:                       # Preds ..B23.31
-..LN2665:
-   .loc    1  910
-        cmpq      $6, %r13                                      #910.22
-        jae       ..B23.35      # Prob 50%                      #910.22
-                                # LOE rbx r13
-..B23.34:                       # Preds ..B23.33
-..LN2667:
-   .loc    1  912
-        movzwl    -80(%rbp), %eax                               #912.29
-..LN2669:
-   .loc    1  916
-        movzwl    -64(%rbp), %esi                               #916.26
-..LN2671:
-   .loc    1  920
-        movl      $3, (%rbx)                                    #920.9
-..LN2673:
-   .loc    1  912
-        movw      %ax, -78(%rbp)                                #912.9
-..LN2675:
-   .loc    1  913
-        movl      -80(%rbp), %edx                               #913.29
-..LN2677:
-   .loc    1  914
-        movl      -80(%rbp), %ecx                               #914.29
-..LN2679:
-   .loc    1  913
-        movl      %edx, -76(%rbp)                               #913.9
-..LN2681:
-   .loc    1  916
-        movw      %si, -62(%rbp)                                #916.9
-..LN2683:
-   .loc    1  917
-        movl      -64(%rbp), %edi                               #917.26
-..LN2685:
-   .loc    1  918
-        movl      -64(%rbp), %r8d                               #918.26
-..LN2687:
-   .loc    1  917
-        movl      %edi, -60(%rbp)                               #917.9
-..LN2689:
-   .loc    1  913
-        movl      %edx, %edx                                    #913.9
-..LN2691:
-   .loc    1  914
-        shlq      $32, %rdx                                     #914.29
-..LN2693:
-   .loc    1  917
-        movl      %edi, %edi                                    #917.9
-..LN2695:
-   .loc    1  918
-        shlq      $32, %rdi                                     #918.26
-..LN2697:
-   .loc    1  914
-        orq       %rcx, %rdx                                    #914.29
-..LN2699:
-        movq      %rdx, -72(%rbp)                               #914.9
-..LN2701:
-   .loc    1  918
-        orq       %r8, %rdi                                     #918.26
-..LN2703:
-        movq      %rdi, -56(%rbp)                               #918.9
-        jmp       ..B23.40      # Prob 100%                     #918.9
-                                # LOE rbx
-..B23.35:                       # Preds ..B23.33
-..LN2705:
-   .loc    1  922
-        cmpq      $14, %r13                                     #922.22
-        jae       ..B23.37      # Prob 50%                      #922.22
-                                # LOE rbx r13
-..B23.36:                       # Preds ..B23.35
-..LN2707:
-   .loc    1  924
-        movl      -80(%rbp), %eax                               #924.29
-..LN2709:
-   .loc    1  925
-        movl      -80(%rbp), %edx                               #925.29
-..LN2711:
-   .loc    1  927
-        movl      -64(%rbp), %ecx                               #927.26
-..LN2713:
-   .loc    1  928
-        movl      -64(%rbp), %esi                               #928.26
-..LN2715:
-   .loc    1  924
-        movl      %eax, -76(%rbp)                               #924.9
-..LN2717:
-   .loc    1  930
-        movl      $4, (%rbx)                                    #930.9
-..LN2719:
-   .loc    1  924
-        movl      %eax, %eax                                    #924.9
-..LN2721:
-   .loc    1  925
-        shlq      $32, %rax                                     #925.29
-..LN2723:
-   .loc    1  927
-        movl      %ecx, -60(%rbp)                               #927.9
-        movl      %ecx, %ecx                                    #927.9
-..LN2725:
-   .loc    1  928
-        shlq      $32, %rcx                                     #928.26
-..LN2727:
-   .loc    1  925
-        orq       %rdx, %rax                                    #925.29
-..LN2729:
-        movq      %rax, -72(%rbp)                               #925.9
-..LN2731:
-   .loc    1  928
-        orq       %rsi, %rcx                                    #928.26
-..LN2733:
-        movq      %rcx, -56(%rbp)                               #928.9
-        jmp       ..B23.40      # Prob 100%                     #928.9
-                                # LOE rbx
-..B23.37:                       # Preds ..B23.35
-..LN2735:
-   .loc    1  932
-        cmpq      $30, %r13                                     #932.22
-        jae       ..B23.39      # Prob 50%                      #932.22
-                                # LOE rbx
-..B23.38:                       # Preds ..B23.37
-..LN2737:
-   .loc    1  934
-        movq      -80(%rbp), %rax                               #934.29
-..LN2739:
-   .loc    1  935
-        movq      -64(%rbp), %rdx                               #935.26
-..LN2741:
-   .loc    1  937
-        movl      $0, (%rbx)                                    #937.9
-..LN2743:
-   .loc    1  934
-        movq      %rax, -72(%rbp)                               #934.9
-..LN2745:
-   .loc    1  935
-        movq      %rdx, -56(%rbp)                               #935.9
-        jmp       ..B23.40      # Prob 100%                     #935.9
-                                # LOE rbx
-..B23.39:                       # Preds ..B23.37
-..LN2747:
-   .loc    1  941
-        movl      $5, (%rbx)                                    #941.9
-                                # LOE rbx
-..B23.40:                       # Preds ..B23.30 ..B23.32 ..B23.34 ..B23.36 ..B23.38
-                                #       ..B23.39
-..LN2749:
-   .loc    1  944
-        movq      -80(%rbp), %rax                               #944.42
-..LN2751:
-   .loc    1  948
-        lea       -80(%rbp), %rdi                               #948.5
-..LN2753:
-   .loc    1  944
-        movq      %rax, 16(%rbx)                                #944.42
-        movq      -72(%rbp), %rdx                               #944.42
-        movq      %rdx, 24(%rbx)                                #944.42
-..LN2755:
-   .loc    1  945
-        movq      -64(%rbp), %rcx                               #945.39
-        movq      %rcx, 32(%rbx)                                #945.39
-        movq      -56(%rbp), %rsi                               #945.39
-        movq      %rsi, 40(%rbx)                                #945.39
-..LN2757:
-   .loc    1  948
-        call      uint128_bswap at PLT                             #948.5
-                                # LOE rbx
-..B23.41:                       # Preds ..B23.40
-..LN2759:
-   .loc    1  949
-        lea       -64(%rbp), %rdi                               #949.5
-        call      uint128_bswap at PLT                             #949.5
-                                # LOE rbx
-..B23.42:                       # Preds ..B23.41
-..LN2761:
-   .loc    1  952
-        lea       -80(%rbp), %rdi                               #952.5
-        movl      $2, %esi                                      #952.5
-        call      uint128_shr at PLT                               #952.5
-                                # LOE rbx
-..B23.43:                       # Preds ..B23.42
-..LN2763:
-   .loc    1  953
-        lea       -64(%rbp), %rdi                               #953.5
-        movl      $2, %esi                                      #953.5
-        call      uint128_shr at PLT                               #953.5
-                                # LOE rbx
-..B23.44:                       # Preds ..B23.43
-..LN2765:
-   .loc    1  956
-        lea       -80(%rbp), %rsi                               #956.5
-        lea       48(%rbx), %rdi                                #956.5
-        call      uint128_bswap_copy at PLT                        #956.5
-                                # LOE rbx
-..B23.45:                       # Preds ..B23.44
-..LN2767:
-   .loc    1  957
-        lea       -64(%rbp), %rsi                               #957.5
-        lea       64(%rbx), %rdi                                #957.5
-        call      uint128_bswap_copy at PLT                        #957.5
-                                # LOE rbx
-..B23.46:                       # Preds ..B23.45
-..LN2769:
-   .loc    1  959
-        lea       -80(%rbp), %rdi                               #959.5
-        movl      $2, %esi                                      #959.5
-        call      uint128_shr at PLT                               #959.5
-                                # LOE rbx
-..B23.47:                       # Preds ..B23.46
-..LN2771:
-   .loc    1  960
-        lea       -64(%rbp), %rdi                               #960.5
-        movl      $2, %esi                                      #960.5
-        call      uint128_shr at PLT                               #960.5
-                                # LOE rbx
-..B23.48:                       # Preds ..B23.47
-..LN2773:
-   .loc    1  962
-        lea       -80(%rbp), %rsi                               #962.5
-        lea       80(%rbx), %rdi                                #962.5
-        call      uint128_bswap_copy at PLT                        #962.5
-                                # LOE rbx
-..B23.49:                       # Preds ..B23.48
-..LN2775:
-   .loc    1  963
-        lea       -64(%rbp), %rsi                               #963.5
-        lea       96(%rbx), %rdi                                #963.5
-        call      uint128_bswap_copy at PLT                        #963.5
-                                # LOE rbx
-..B23.50:                       # Preds ..B23.49
-..LN2777:
-   .loc    1  965
-        lea       -80(%rbp), %rdi                               #965.5
-        movl      $2, %esi                                      #965.5
-        call      uint128_shr at PLT                               #965.5
-                                # LOE rbx
-..B23.51:                       # Preds ..B23.50
-..LN2779:
-   .loc    1  966
-        lea       -64(%rbp), %rdi                               #966.5
-        movl      $2, %esi                                      #966.5
-        call      uint128_shr at PLT                               #966.5
-                                # LOE rbx
-..B23.52:                       # Preds ..B23.51
-..LN2781:
-   .loc    1  968
-        lea       -80(%rbp), %rsi                               #968.5
-        lea       112(%rbx), %rdi                               #968.5
-        call      uint128_bswap_copy at PLT                        #968.5
-                                # LOE rbx
-..B23.53:                       # Preds ..B23.52
-..LN2783:
-   .loc    1  969
-        lea       -64(%rbp), %rsi                               #969.5
-        addq      $128, %rbx                                    #969.5
-        movq      %rbx, %rdi                                    #969.5
-        call      uint128_bswap_copy at PLT                        #969.5
-                                # LOE
-..B23.54:                       # Preds ..B23.53
-..LN2785:
-   .loc    1  1011
-        movq      -24(%rbp), %rbx                               #1011.12
-..___tag_value_NucStrFastaExprMake2.844:                        #
-        movq      -16(%rbp), %r12                               #1011.12
-..___tag_value_NucStrFastaExprMake2.845:                        #
-        movq      -40(%rbp), %r13                               #1011.12
-..___tag_value_NucStrFastaExprMake2.846:                        #
-        movq      -48(%rbp), %r14                               #1011.12
-..___tag_value_NucStrFastaExprMake2.847:                        #
-        xorl      %eax, %eax                                    #1011.12
-        movq      -32(%rbp), %r15                               #1011.12
-..___tag_value_NucStrFastaExprMake2.848:                        #
-        movq      %rbp, %rsp                                    #1011.12
-        popq      %rbp                                          #1011.12
-..___tag_value_NucStrFastaExprMake2.849:                        #
-        ret                                                     #1011.12
-..___tag_value_NucStrFastaExprMake2.850:                        #
-                                # LOE
-..B23.55:                       # Preds ..B23.17                # Infreq
-..LN2787:
-   .loc    1  881
-        xorl      %eax, %eax                                    #881.5
-        jmp       ..B23.25      # Prob 100%                     #881.5
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B23.56:                       # Preds ..B23.7                 # Infreq
-..LN2789:
-   .loc    1  862
-        movq      %rdi, %rax                                    #862.32
-        shrq      $2, %rax                                      #862.32
-..LN2791:
-        shll      $6, %edx                                      #862.46
-..LN2793:
-        movb      %dl, -80(%rbp,%rax)                           #862.13
-..LN2795:
-   .loc    1  863
-        movb      $192, -64(%rbp,%rax)                          #863.13
-        jmp       ..B23.14      # Prob 100%                     #863.13
-                                # LOE rbx rdi r13 r14 r12d
-..B23.57:                       # Preds ..B23.4                 # Infreq
-..LN2797:
-   .loc    1  849
-        call      __errno_location at PLT                          #849.16
-                                # LOE rax
-..B23.62:                       # Preds ..B23.57                # Infreq
-        movq      -24(%rbp), %rbx                               #849.16
-..___tag_value_NucStrFastaExprMake2.856:                        #
-        movq      -16(%rbp), %r12                               #849.16
-..___tag_value_NucStrFastaExprMake2.857:                        #
-        movq      -40(%rbp), %r13                               #849.16
-..___tag_value_NucStrFastaExprMake2.858:                        #
-        movq      -48(%rbp), %r14                               #849.16
-..___tag_value_NucStrFastaExprMake2.859:                        #
-        movl      (%rax), %eax                                  #849.16
-        movq      -32(%rbp), %r15                               #849.16
-..___tag_value_NucStrFastaExprMake2.860:                        #
-        movq      %rbp, %rsp                                    #849.16
-        popq      %rbp                                          #849.16
-..___tag_value_NucStrFastaExprMake2.861:                        #
-        ret                                                     #849.16
-        .align    16,0x90
-..___tag_value_NucStrFastaExprMake2.862:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-.LNNucStrFastaExprMake2:
-	.data
-# -- End  NucStrFastaExprMake2
-	.text
-# -- Begin  uint128_bswap_copy
-# mark_begin;
-       .align    16,0x90
-uint128_bswap_copy:
-# parameter 1(to): %rdi
-# parameter 2(from): %rsi
-..B24.1:                        # Preds ..B24.0
-..___tag_value_uint128_bswap_copy.863:                          #311.1
-..LN2799:
-   .loc    2  311
-        pushq     %rbp                                          #311.1
-        movq      %rsp, %rbp                                    #311.1
-..___tag_value_uint128_bswap_copy.864:                          #
-        subq      $16, %rsp                                     #311.1
-        movq      %r13, -16(%rbp)                               #311.1
-..___tag_value_uint128_bswap_copy.866:                          #
-        movq      %r12, -8(%rbp)                                #311.1
-..___tag_value_uint128_bswap_copy.867:                          #
-        movq      %rsi, %r13                                    #311.1
-        movq      %rdi, %r12                                    #311.1
-        lea       _gprof_pack23(%rip), %rdx                     #311.1
-        call      mcount at PLT                                    #311.1
-                                # LOE rbx r12 r13 r14 r15
-..B24.4:                        # Preds ..B24.1
-..LN2801:
-   .loc    2  312
-        movq      %r12, %rdi                                    #312.0
-        movq      %r13, %rsi                                    #312.0
-        movq      (%rsi), %rax                                  #312.0
-        movq      8(%rsi), %rcx                                 #312.0
-        bswap     %rax                                          #312.0
-        bswap     %rcx                                          #312.0
-        movq      %rax, 8(%rdi)                                 #312.0
-        movq      %rcx, (%rdi)                                  #312.0
-..LN2803:
-   .loc    2  324
-        movq      -8(%rbp), %r12                                #324.1
-..___tag_value_uint128_bswap_copy.868:                          #
-        movq      -16(%rbp), %r13                               #324.1
-..___tag_value_uint128_bswap_copy.869:                          #
-        movq      %rbp, %rsp                                    #324.1
-        popq      %rbp                                          #324.1
-..___tag_value_uint128_bswap_copy.870:                          #
-        ret                                                     #324.1
-        .align    16,0x90
-..___tag_value_uint128_bswap_copy.871:                          #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap_copy, at function
-	.size	uint128_bswap_copy,.-uint128_bswap_copy
-.LNuint128_bswap_copy:
-	.data
-# -- End  uint128_bswap_copy
-	.text
-# -- Begin  uint128_shr
-# mark_begin;
-       .align    16,0x90
-uint128_shr:
-# parameter 1(self): %rdi
-# parameter 2(i): %esi
-..B25.1:                        # Preds ..B25.0
-..___tag_value_uint128_shr.872:                                 #262.1
-..LN2805:
-   .loc    2  262
-        pushq     %rbp                                          #262.1
-        movq      %rsp, %rbp                                    #262.1
-..___tag_value_uint128_shr.873:                                 #
-        subq      $16, %rsp                                     #262.1
-        movq      %r13, -16(%rbp)                               #262.1
-..___tag_value_uint128_shr.875:                                 #
-        movq      %r12, -8(%rbp)                                #262.1
-..___tag_value_uint128_shr.876:                                 #
-        movl      %esi, %r13d                                   #262.1
-        movq      %rdi, %r12                                    #262.1
-        lea       _gprof_pack24(%rip), %rdx                     #262.1
-        call      mcount at PLT                                    #262.1
-                                # LOE rbx r12 r14 r15 r13d
-..B25.4:                        # Preds ..B25.1
-..LN2807:
-   .loc    2  263
-        movq      %r12, %rdi                                    #263.0
-        movl      %r13d, %esi                                   #263.0
-        movl      %esi, %ecx                                    #263.0
-        movq      8(%rdi), %rax                                 #263.0
-        shrdq     %cl, %rax, (%rdi)                             #263.0
-        shrq      %cl, %rax                                     #263.0
-        movq      %rax, 8(%rdi)                                 #263.0
-..LN2809:
-   .loc    2  274
-        movq      -8(%rbp), %r12                                #274.1
-..___tag_value_uint128_shr.877:                                 #
-        movq      -16(%rbp), %r13                               #274.1
-..___tag_value_uint128_shr.878:                                 #
-        movq      %rbp, %rsp                                    #274.1
-        popq      %rbp                                          #274.1
-..___tag_value_uint128_shr.879:                                 #
-        ret                                                     #274.1
-        .align    16,0x90
-..___tag_value_uint128_shr.880:                                 #
-                                # LOE
-# mark_end;
-	.type	uint128_shr, at function
-	.size	uint128_shr,.-uint128_shr
-.LNuint128_shr:
-	.data
-# -- End  uint128_shr
-	.text
-# -- Begin  uint128_bswap
-# mark_begin;
-       .align    16,0x90
-uint128_bswap:
-# parameter 1(self): %rdi
-..B26.1:                        # Preds ..B26.0
-..___tag_value_uint128_bswap.881:                               #294.1
-..LN2811:
-   .loc    2  294
-        pushq     %rbp                                          #294.1
-        movq      %rsp, %rbp                                    #294.1
-..___tag_value_uint128_bswap.882:                               #
-        subq      $16, %rsp                                     #294.1
-        movq      %r13, -16(%rbp)                               #294.1
-..___tag_value_uint128_bswap.884:                               #
-        movq      %rdi, %r13                                    #294.1
-        lea       _gprof_pack25(%rip), %rdx                     #294.1
-        call      mcount at PLT                                    #294.1
-                                # LOE rbx r12 r13 r14 r15
-..B26.4:                        # Preds ..B26.1
-..LN2813:
-   .loc    2  295
-        movq      %r13, %rdi                                    #295.0
-        movq      (%rdi), %rax                                  #295.0
-        movq      8(%rdi), %rcx                                 #295.0
-        bswap     %rax                                          #295.0
-        bswap     %rcx                                          #295.0
-        movq      %rax, 8(%rdi)                                 #295.0
-        movq      %rcx, (%rdi)                                  #295.0
-..LN2815:
-   .loc    2  307
-        movq      -16(%rbp), %r13                               #307.1
-..___tag_value_uint128_bswap.885:                               #
-        movq      %rbp, %rsp                                    #307.1
-        popq      %rbp                                          #307.1
-..___tag_value_uint128_bswap.886:                               #
-        ret                                                     #307.1
-        .align    16,0x90
-..___tag_value_uint128_bswap.887:                               #
-                                # LOE
-# mark_end;
-	.type	uint128_bswap, at function
-	.size	uint128_bswap,.-uint128_bswap
-.LNuint128_bswap:
-	.data
-# -- End  uint128_bswap
-	.text
-# -- Begin  NucStrFastaExprAlloc
-# mark_begin;
-       .align    16,0x90
-NucStrFastaExprAlloc:
-# parameter 1(sz): %rdi
-..B27.1:                        # Preds ..B27.0
-..___tag_value_NucStrFastaExprAlloc.888:                        #790.1
-..LN2817:
-   .loc    1  790
-        pushq     %rbp                                          #790.1
-        movq      %rsp, %rbp                                    #790.1
-..___tag_value_NucStrFastaExprAlloc.889:                        #
-        lea       _gprof_pack26(%rip), %rdx                     #790.1
-        call      mcount at PLT                                    #790.1
-                                # LOE rbx r12 r13 r14 r15
-..B27.7:                        # Preds ..B27.1
-..LN2819:
-   .loc    1  791
-        movl      $160, %edi                                    #791.19
-        call      malloc at PLT                                    #791.19
-                                # LOE rax rbx r12 r13 r14 r15
-..B27.2:                        # Preds ..B27.7
-..LN2821:
-   .loc    1  792
-        testq     %rax, %rax                                    #792.19
-        je        ..B27.4       # Prob 12%                      #792.19
-                                # LOE rax rbx r12 r13 r14 r15
-..B27.3:                        # Preds ..B27.2
-..LN2823:
-   .loc    1  795
-        lea       15(%rax), %rdx                                #795.36
-..LN2825:
-        andq      $-16, %rdx                                    #795.43
-..LN2827:
-   .loc    1  796
-        movq      %rax, 8(%rdx)                                 #796.9
-..LN2829:
-   .loc    1  799
-        movq      %rdx, %rax                                    #799.16
-        movq      %rbp, %rsp                                    #799.16
-        popq      %rbp                                          #799.16
-..___tag_value_NucStrFastaExprAlloc.891:                        #
-        ret                                                     #799.16
-..___tag_value_NucStrFastaExprAlloc.892:                        #
-                                # LOE
-..B27.4:                        # Preds ..B27.2
-..LN2831:
-   .loc    1  801
-        xorl      %eax, %eax                                    #801.12
-        movq      %rbp, %rsp                                    #801.12
-        popq      %rbp                                          #801.12
-..___tag_value_NucStrFastaExprAlloc.893:                        #
-        ret                                                     #801.12
-        .align    16,0x90
-..___tag_value_NucStrFastaExprAlloc.894:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprAlloc, at function
-	.size	NucStrFastaExprAlloc,.-NucStrFastaExprAlloc
-.LNNucStrFastaExprAlloc:
-	.data
-# -- End  NucStrFastaExprAlloc
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    16,0x90
-NucStrFastaExprMake4:
-# parameter 1(expr): %rdi
-# parameter 2(positional): %esi
-# parameter 3(fasta): %rdx
-# parameter 4(size): %rcx
-..B28.1:                        # Preds ..B28.0
-..___tag_value_NucStrFastaExprMake4.895:                        #1017.1
-..LN2833:
-   .loc    1  1017
-        pushq     %rbp                                          #1017.1
-        movq      %rsp, %rbp                                    #1017.1
-..___tag_value_NucStrFastaExprMake4.896:                        #
-        subq      $80, %rsp                                     #1017.1
-        movq      %r15, -24(%rbp)                               #1017.1
-..___tag_value_NucStrFastaExprMake4.898:                        #
-        movq      %r14, -16(%rbp)                               #1017.1
-..___tag_value_NucStrFastaExprMake4.899:                        #
-        movq      %r13, -40(%rbp)                               #1017.1
-..___tag_value_NucStrFastaExprMake4.900:                        #
-        movq      %r12, -48(%rbp)                               #1017.1
-..___tag_value_NucStrFastaExprMake4.901:                        #
-        movq      %rbx, -32(%rbp)                               #1017.1
-..___tag_value_NucStrFastaExprMake4.902:                        #
-        movq      %rcx, %r13                                    #1017.1
-        movq      %rdx, %r14                                    #1017.1
-        movl      %esi, %r12d                                   #1017.1
-        movq      %rdi, %r15                                    #1017.1
-        lea       _gprof_pack27(%rip), %rdx                     #1017.1
-        call      mcount at PLT                                    #1017.1
-                                # LOE r13 r14 r15 r12d
-..B28.58:                       # Preds ..B28.1
-..LN2835:
-   .loc    1  1023
-        cmpq      $29, %r13                                     #1023.17
-        jbe       ..B28.3       # Prob 43%                      #1023.17
-                                # LOE r13 r14 r15 r12d
-..B28.2:                        # Preds ..B28.58
-..LN2837:
-   .loc    1  1024
-        movq      -32(%rbp), %rbx                               #1024.16
-..___tag_value_NucStrFastaExprMake4.903:                        #
-        movq      -48(%rbp), %r12                               #1024.16
-..___tag_value_NucStrFastaExprMake4.904:                        #
-        movq      -40(%rbp), %r13                               #1024.16
-..___tag_value_NucStrFastaExprMake4.905:                        #
-        movq      -16(%rbp), %r14                               #1024.16
-..___tag_value_NucStrFastaExprMake4.906:                        #
-        movl      $7, %eax                                      #1024.16
-        movq      -24(%rbp), %r15                               #1024.16
-..___tag_value_NucStrFastaExprMake4.907:                        #
-        movq      %rbp, %rsp                                    #1024.16
-        popq      %rbp                                          #1024.16
-..___tag_value_NucStrFastaExprMake4.908:                        #
-        ret                                                     #1024.16
-..___tag_value_NucStrFastaExprMake4.909:                        #
-                                # LOE
-..B28.3:                        # Preds ..B28.58
-..LN2839:
-   .loc    1  1026
-        movl      $144, %edi                                    #1026.9
-        call      NucStrFastaExprAlloc at PLT                      #1026.9
-                                # LOE rax r13 r14 r15 r12d
-..B28.59:                       # Preds ..B28.3
-        movq      %rax, %rbx                                    #1026.9
-                                # LOE rbx r13 r14 r15 r12d
-..B28.4:                        # Preds ..B28.59
-..LN2841:
-   .loc    1  1027
-        testq     %rbx, %rbx                                    #1027.15
-        je        ..B28.55      # Prob 5%                       #1027.15
-                                # LOE rbx r13 r14 r15 r12d
-..B28.5:                        # Preds ..B28.4
-..LN2843:
-   .loc    1  1030
-        movq      %rbx, (%r15)                                  #1030.5
-..LN2845:
-   .loc    1  1031
-        movl      %r13d, 4(%rbx)                                #1031.5
-..LN2847:
-   .loc    1  1035
-        xorl      %edx, %edx                                    #1035.11
-..LN2849:
-        testq     %r13, %r13                                    #1035.22
-        jbe       ..B28.16      # Prob 16%                      #1035.22
-                                # LOE rdx rbx r13 r14 r12d
-..B28.7:                        # Preds ..B28.5 ..B28.14
-..LN2851:
-   .loc    1  1037
-        movsbq    (%rdx,%r14), %rcx                             #1037.49
-..LN2853:
-        lea       fasta_4na_map.0(%rip), %rax                   #1037.25
-        movsbl    (%rax,%rcx), %esi                             #1037.25
-..LN2855:
-   .loc    1  1038
-        movq      %rdx, %rax                                    #1038.22
-        andq      $3, %rax                                      #1038.22
-        je        ..B28.54      # Prob 20%                      #1038.22
-                                # LOE rax rdx rbx r13 r14 esi r12d
-..B28.8:                        # Preds ..B28.7
-        cmpq      $1, %rax                                      #1038.22
-        je        ..B28.13      # Prob 25%                      #1038.22
-                                # LOE rax rdx rbx r13 r14 esi r12d
-..B28.9:                        # Preds ..B28.8
-        cmpq      $2, %rax                                      #1038.22
-        jne       ..B28.11      # Prob 67%                      #1038.22
-                                # LOE rax rdx rbx r13 r14 esi r12d
-..B28.10:                       # Preds ..B28.9
-..LN2857:
-   .loc    1  1049
-        movq      %rdx, %rcx                                    #1049.32
-        shrq      $2, %rcx                                      #1049.32
-..LN2859:
-   .loc    1  1050
-        movzwl    -64(%rbp,%rcx,2), %eax                        #1050.13
-..LN2861:
-   .loc    1  1049
-        shll      $12, %esi                                     #1049.47
-..LN2863:
-   .loc    1  1050
-        orl       $-4096, %eax                                  #1050.13
-..LN2865:
-   .loc    1  1049
-        orw       %si, -80(%rbp,%rcx,2)                         #1049.13
-..LN2867:
-   .loc    1  1050
-        movw      %ax, -64(%rbp,%rcx,2)                         #1050.13
-        jmp       ..B28.14      # Prob 100%                     #1050.13
-                                # LOE rdx rbx r13 r14 r12d
-..B28.11:                       # Preds ..B28.9
-..LN2869:
-   .loc    1  1038
-        cmpq      $3, %rax                                      #1038.22
-        jne       ..B28.14      # Prob 50%                      #1038.22
-                                # LOE rdx rbx r13 r14 esi r12d
-..B28.12:                       # Preds ..B28.11
-..LN2871:
-   .loc    1  1053
-        movq      %rdx, %rcx                                    #1053.32
-        shrq      $2, %rcx                                      #1053.32
-..LN2873:
-   .loc    1  1054
-        movzwl    -64(%rbp,%rcx,2), %eax                        #1054.13
-..LN2875:
-   .loc    1  1053
-        shll      $8, %esi                                      #1053.47
-..LN2877:
-   .loc    1  1054
-        orl       $-61696, %eax                                 #1054.13
-..LN2879:
-   .loc    1  1053
-        orw       %si, -80(%rbp,%rcx,2)                         #1053.13
-..LN2881:
-   .loc    1  1054
-        movw      %ax, -64(%rbp,%rcx,2)                         #1054.13
-        jmp       ..B28.14      # Prob 100%                     #1054.13
-                                # LOE rdx rbx r13 r14 r12d
-..B28.13:                       # Preds ..B28.8
-..LN2883:
-   .loc    1  1045
-        movq      %rdx, %rcx                                    #1045.32
-        shrq      $2, %rcx                                      #1045.32
-..LN2885:
-   .loc    1  1046
-        movzwl    -64(%rbp,%rcx,2), %eax                        #1046.13
-        orl       $15, %eax                                     #1046.13
-..LN2887:
-   .loc    1  1045
-        orw       %si, -80(%rbp,%rcx,2)                         #1045.13
-..LN2889:
-   .loc    1  1046
-        movw      %ax, -64(%rbp,%rcx,2)                         #1046.13
-                                # LOE rdx rbx r13 r14 r12d
-..B28.14:                       # Preds ..B28.11 ..B28.54 ..B28.13 ..B28.10 ..B28.12
-                                #      
-..LN2891:
-   .loc    1  1035
-        incq      %rdx                                          #1035.31
-..LN2893:
-        cmpq      %r13, %rdx                                    #1035.22
-        jb        ..B28.7       # Prob 82%                      #1035.22
-                                # LOE rdx rbx r13 r14 r12d
-..B28.16:                       # Preds ..B28.14 ..B28.5
-..LN2895:
-   .loc    1  1060
-        addq      $3, %rdx                                      #1060.21
-..LN2897:
-        shrq      $2, %rdx                                      #1060.28
-..LN2899:
-        cmpq      $8, %rdx                                      #1060.35
-        jae       ..B28.29      # Prob 50%                      #1060.35
-                                # LOE rdx rbx r13 r12d
-..B28.17:                       # Preds ..B28.16
-..LN2901:
-        lea       -80(%rbp,%rdx,2), %rsi                        #1060.5
-        movq      %rdx, %rdi                                    #1060.5
-        negq      %rdi                                          #1060.5
-        addq      $8, %rdi                                      #1060.5
-        movq      %rsi, %rax                                    #1060.5
-        andq      $15, %rax                                     #1060.5
-        movq      %rax, %rcx                                    #1060.5
-        negq      %rcx                                          #1060.5
-        addq      $16, %rcx                                     #1060.5
-        shrq      $1, %rcx                                      #1060.5
-        cmpq      $0, %rax                                      #1060.5
-        cmovne    %rcx, %rax                                    #1060.5
-        lea       8(%rax), %r8                                  #1060.5
-        cmpq      %r8, %rdi                                     #1060.5
-        jl        ..B28.53      # Prob 10%                      #1060.5
-                                # LOE rax rdx rbx rsi rdi r13 r12d
-..B28.18:                       # Preds ..B28.17
-        movq      %rdi, %rcx                                    #1060.5
-        subq      %rax, %rcx                                    #1060.5
-        andq      $7, %rcx                                      #1060.5
-        negq      %rcx                                          #1060.5
-        addq      %rdi, %rcx                                    #1060.5
-        xorl      %r9d, %r9d                                    #1060.5
-        testq     %rax, %rax                                    #1060.5
-        jbe       ..B28.22      # Prob 10%                      #1060.5
-                                # LOE rax rdx rcx rbx rsi rdi r9 r13 r12d
-..B28.19:                       # Preds ..B28.18
-        lea       -64(%rbp,%rdx,2), %r8                         #
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d
-..B28.20:                       # Preds ..B28.20 ..B28.19
-..LN2903:
-   .loc    1  1062
-        xorl      %r10d, %r10d                                  #1062.9
-        movw      %r10w, (%rsi,%r9,2)                           #1062.9
-..LN2905:
-   .loc    1  1063
-        movw      %r10w, (%r8,%r9,2)                            #1063.9
-..LN2907:
-   .loc    1  1060
-        incq      %r9                                           #1060.5
-        cmpq      %rax, %r9                                     #1060.5
-        jb        ..B28.20      # Prob 82%                      #1060.5
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d
-..B28.22:                       # Preds ..B28.20 ..B28.18
-        lea       -64(%rbp,%rdx,2), %r9                         #
-        lea       -80(%rbp,%rdx,2), %r8                         #
-..LN2909:
-   .loc    1  1062
-        pxor      %xmm0, %xmm0                                  #1062.29
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d xmm0
-..B28.23:                       # Preds ..B28.23 ..B28.22
-..LN2911:
-        movdqa    %xmm0, (%r8,%rax,2)                           #1062.9
-..LN2913:
-   .loc    1  1063
-        movdqa    %xmm0, (%r9,%rax,2)                           #1063.9
-..LN2915:
-   .loc    1  1060
-        addq      $8, %rax                                      #1060.5
-        cmpq      %rcx, %rax                                    #1060.5
-        jb        ..B28.23      # Prob 82%                      #1060.5
-                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r13 r12d xmm0
-..B28.25:                       # Preds ..B28.23 ..B28.53
-        cmpq      %rdi, %rcx                                    #1060.5
-        jae       ..B28.29      # Prob 10%                      #1060.5
-                                # LOE rdx rcx rbx rsi rdi r13 r12d
-..B28.26:                       # Preds ..B28.25
-        lea       -64(%rbp,%rdx,2), %rax                        #
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B28.27:                       # Preds ..B28.27 ..B28.26
-..LN2917:
-   .loc    1  1062
-        xorl      %edx, %edx                                    #1062.9
-        movw      %dx, (%rsi,%rcx,2)                            #1062.9
-..LN2919:
-   .loc    1  1063
-        movw      %dx, (%rax,%rcx,2)                            #1063.9
-..LN2921:
-   .loc    1  1060
-        incq      %rcx                                          #1060.5
-        cmpq      %rdi, %rcx                                    #1060.5
-        jb        ..B28.27      # Prob 82%                      #1060.5
-                                # LOE rax rcx rbx rsi rdi r13 r12d
-..B28.29:                       # Preds ..B28.27 ..B28.25 ..B28.16
-..LN2923:
-   .loc    1  1068
-        testl     %r12d, %r12d                                  #1068.10
-        je        ..B28.31      # Prob 50%                      #1068.10
-                                # LOE rbx r13
-..B28.30:                       # Preds ..B28.29
-..LN2925:
-   .loc    1  1070
-        movl      $10, (%rbx)                                   #1070.9
-        jmp       ..B28.38      # Prob 100%                     #1070.9
-                                # LOE rbx
-..B28.31:                       # Preds ..B28.29
-..LN2927:
-   .loc    1  1072
-        cmpq      $2, %r13                                      #1072.22
-        jae       ..B28.33      # Prob 50%                      #1072.22
-                                # LOE rbx r13
-..B28.32:                       # Preds ..B28.31
-..LN2929:
-   .loc    1  1074
-        movzwl    -80(%rbp), %eax                               #1074.29
-..LN2931:
-   .loc    1  1078
-        movzwl    -64(%rbp), %esi                               #1078.26
-..LN2933:
-   .loc    1  1082
-        movl      $6, (%rbx)                                    #1082.9
-..LN2935:
-   .loc    1  1074
-        movw      %ax, -78(%rbp)                                #1074.9
-..LN2937:
-   .loc    1  1075
-        movl      -80(%rbp), %edx                               #1075.29
-..LN2939:
-   .loc    1  1076
-        movl      -80(%rbp), %ecx                               #1076.29
-..LN2941:
-   .loc    1  1075
-        movl      %edx, -76(%rbp)                               #1075.9
-..LN2943:
-   .loc    1  1078
-        movw      %si, -62(%rbp)                                #1078.9
-..LN2945:
-   .loc    1  1079
-        movl      -64(%rbp), %edi                               #1079.26
-..LN2947:
-   .loc    1  1080
-        movl      -64(%rbp), %r8d                               #1080.26
-..LN2949:
-   .loc    1  1079
-        movl      %edi, -60(%rbp)                               #1079.9
-..LN2951:
-   .loc    1  1075
-        movl      %edx, %edx                                    #1075.9
-..LN2953:
-   .loc    1  1076
-        shlq      $32, %rdx                                     #1076.29
-..LN2955:
-   .loc    1  1079
-        movl      %edi, %edi                                    #1079.9
-..LN2957:
-   .loc    1  1080
-        shlq      $32, %rdi                                     #1080.26
-..LN2959:
-   .loc    1  1076
-        orq       %rcx, %rdx                                    #1076.29
-..LN2961:
-        movq      %rdx, -72(%rbp)                               #1076.9
-..LN2963:
-   .loc    1  1080
-        orq       %r8, %rdi                                     #1080.26
-..LN2965:
-        movq      %rdi, -56(%rbp)                               #1080.9
-        jmp       ..B28.38      # Prob 100%                     #1080.9
-                                # LOE rbx
-..B28.33:                       # Preds ..B28.31
-..LN2967:
-   .loc    1  1084
-        cmpq      $6, %r13                                      #1084.22
-        jae       ..B28.35      # Prob 50%                      #1084.22
-                                # LOE rbx r13
-..B28.34:                       # Preds ..B28.33
-..LN2969:
-   .loc    1  1086
-        movl      -80(%rbp), %eax                               #1086.29
-..LN2971:
-   .loc    1  1087
-        movl      -80(%rbp), %edx                               #1087.29
-..LN2973:
-   .loc    1  1089
-        movl      -64(%rbp), %ecx                               #1089.26
-..LN2975:
-   .loc    1  1090
-        movl      -64(%rbp), %esi                               #1090.26
-..LN2977:
-   .loc    1  1086
-        movl      %eax, -76(%rbp)                               #1086.9
-..LN2979:
-   .loc    1  1092
-        movl      $7, (%rbx)                                    #1092.9
-..LN2981:
-   .loc    1  1086
-        movl      %eax, %eax                                    #1086.9
-..LN2983:
-   .loc    1  1087
-        shlq      $32, %rax                                     #1087.29
-..LN2985:
-   .loc    1  1089
-        movl      %ecx, -60(%rbp)                               #1089.9
-        movl      %ecx, %ecx                                    #1089.9
-..LN2987:
-   .loc    1  1090
-        shlq      $32, %rcx                                     #1090.26
-..LN2989:
-   .loc    1  1087
-        orq       %rdx, %rax                                    #1087.29
-..LN2991:
-        movq      %rax, -72(%rbp)                               #1087.9
-..LN2993:
-   .loc    1  1090
-        orq       %rsi, %rcx                                    #1090.26
-..LN2995:
-        movq      %rcx, -56(%rbp)                               #1090.9
-        jmp       ..B28.38      # Prob 100%                     #1090.9
-                                # LOE rbx
-..B28.35:                       # Preds ..B28.33
-..LN2997:
-   .loc    1  1094
-        cmpq      $14, %r13                                     #1094.22
-        jae       ..B28.37      # Prob 50%                      #1094.22
-                                # LOE rbx
-..B28.36:                       # Preds ..B28.35
-..LN2999:
-   .loc    1  1096
-        movq      -80(%rbp), %rax                               #1096.29
-..LN3001:
-   .loc    1  1097
-        movq      -64(%rbp), %rdx                               #1097.26
-..LN3003:
-   .loc    1  1099
-        movl      $1, (%rbx)                                    #1099.9
-..LN3005:
-   .loc    1  1096
-        movq      %rax, -72(%rbp)                               #1096.9
-..LN3007:
-   .loc    1  1097
-        movq      %rdx, -56(%rbp)                               #1097.9
-        jmp       ..B28.38      # Prob 100%                     #1097.9
-                                # LOE rbx
-..B28.37:                       # Preds ..B28.35
-..LN3009:
-   .loc    1  1103
-        movl      $8, (%rbx)                                    #1103.9
-                                # LOE rbx
-..B28.38:                       # Preds ..B28.30 ..B28.32 ..B28.34 ..B28.36 ..B28.37
-                                #      
-..LN3011:
-   .loc    1  1106
-        movq      -80(%rbp), %rax                               #1106.42
-..LN3013:
-   .loc    1  1110
-        lea       -80(%rbp), %rdi                               #1110.5
-..LN3015:
-   .loc    1  1106
-        movq      %rax, 16(%rbx)                                #1106.42
-        movq      -72(%rbp), %rdx                               #1106.42
-        movq      %rdx, 24(%rbx)                                #1106.42
-..LN3017:
-   .loc    1  1107
-        movq      -64(%rbp), %rcx                               #1107.39
-        movq      %rcx, 32(%rbx)                                #1107.39
-        movq      -56(%rbp), %rsi                               #1107.39
-        movq      %rsi, 40(%rbx)                                #1107.39
-..LN3019:
-   .loc    1  1110
-        call      uint128_bswap at PLT                             #1110.5
-                                # LOE rbx
-..B28.39:                       # Preds ..B28.38
-..LN3021:
-   .loc    1  1111
-        lea       -64(%rbp), %rdi                               #1111.5
-        call      uint128_bswap at PLT                             #1111.5
-                                # LOE rbx
-..B28.40:                       # Preds ..B28.39
-..LN3023:
-   .loc    1  1114
-        lea       -80(%rbp), %rdi                               #1114.5
-        movl      $4, %esi                                      #1114.5
-        call      uint128_shr at PLT                               #1114.5
-                                # LOE rbx
-..B28.41:                       # Preds ..B28.40
-..LN3025:
-   .loc    1  1115
-        lea       -64(%rbp), %rdi                               #1115.5
-        movl      $4, %esi                                      #1115.5
-        call      uint128_shr at PLT                               #1115.5
-                                # LOE rbx
-..B28.42:                       # Preds ..B28.41
-..LN3027:
-   .loc    1  1118
-        lea       -80(%rbp), %rsi                               #1118.5
-        lea       48(%rbx), %rdi                                #1118.5
-        call      uint128_bswap_copy at PLT                        #1118.5
-                                # LOE rbx
-..B28.43:                       # Preds ..B28.42
-..LN3029:
-   .loc    1  1119
-        lea       -64(%rbp), %rsi                               #1119.5
-        lea       64(%rbx), %rdi                                #1119.5
-        call      uint128_bswap_copy at PLT                        #1119.5
-                                # LOE rbx
-..B28.44:                       # Preds ..B28.43
-..LN3031:
-   .loc    1  1121
-        lea       -80(%rbp), %rdi                               #1121.5
-        movl      $4, %esi                                      #1121.5
-        call      uint128_shr at PLT                               #1121.5
-                                # LOE rbx
-..B28.45:                       # Preds ..B28.44
-..LN3033:
-   .loc    1  1122
-        lea       -64(%rbp), %rdi                               #1122.5
-        movl      $4, %esi                                      #1122.5
-        call      uint128_shr at PLT                               #1122.5
-                                # LOE rbx
-..B28.46:                       # Preds ..B28.45
-..LN3035:
-   .loc    1  1124
-        lea       -80(%rbp), %rsi                               #1124.5
-        lea       80(%rbx), %rdi                                #1124.5
-        call      uint128_bswap_copy at PLT                        #1124.5
-                                # LOE rbx
-..B28.47:                       # Preds ..B28.46
-..LN3037:
-   .loc    1  1125
-        lea       -64(%rbp), %rsi                               #1125.5
-        lea       96(%rbx), %rdi                                #1125.5
-        call      uint128_bswap_copy at PLT                        #1125.5
-                                # LOE rbx
-..B28.48:                       # Preds ..B28.47
-..LN3039:
-   .loc    1  1127
-        lea       -80(%rbp), %rdi                               #1127.5
-        movl      $4, %esi                                      #1127.5
-        call      uint128_shr at PLT                               #1127.5
-                                # LOE rbx
-..B28.49:                       # Preds ..B28.48
-..LN3041:
-   .loc    1  1128
-        lea       -64(%rbp), %rdi                               #1128.5
-        movl      $4, %esi                                      #1128.5
-        call      uint128_shr at PLT                               #1128.5
-                                # LOE rbx
-..B28.50:                       # Preds ..B28.49
-..LN3043:
-   .loc    1  1130
-        lea       -80(%rbp), %rsi                               #1130.5
-        lea       112(%rbx), %rdi                               #1130.5
-        call      uint128_bswap_copy at PLT                        #1130.5
-                                # LOE rbx
-..B28.51:                       # Preds ..B28.50
-..LN3045:
-   .loc    1  1131
-        lea       -64(%rbp), %rsi                               #1131.5
-        addq      $128, %rbx                                    #1131.5
-        movq      %rbx, %rdi                                    #1131.5
-        call      uint128_bswap_copy at PLT                        #1131.5
-                                # LOE
-..B28.52:                       # Preds ..B28.51
-..LN3047:
-   .loc    1  1173
-        movq      -32(%rbp), %rbx                               #1173.12
-..___tag_value_NucStrFastaExprMake4.915:                        #
-        movq      -48(%rbp), %r12                               #1173.12
-..___tag_value_NucStrFastaExprMake4.916:                        #
-        movq      -40(%rbp), %r13                               #1173.12
-..___tag_value_NucStrFastaExprMake4.917:                        #
-        movq      -16(%rbp), %r14                               #1173.12
-..___tag_value_NucStrFastaExprMake4.918:                        #
-        xorl      %eax, %eax                                    #1173.12
-        movq      -24(%rbp), %r15                               #1173.12
-..___tag_value_NucStrFastaExprMake4.919:                        #
-        movq      %rbp, %rsp                                    #1173.12
-        popq      %rbp                                          #1173.12
-..___tag_value_NucStrFastaExprMake4.920:                        #
-        ret                                                     #1173.12
-..___tag_value_NucStrFastaExprMake4.921:                        #
-                                # LOE
-..B28.53:                       # Preds ..B28.17                # Infreq
-..LN3049:
-   .loc    1  1060
-        xorl      %ecx, %ecx                                    #1060.5
-        jmp       ..B28.25      # Prob 100%                     #1060.5
-                                # LOE rdx rcx rbx rsi rdi r13 r12d
-..B28.54:                       # Preds ..B28.7                 # Infreq
-..LN3051:
-   .loc    1  1041
-        movq      %rdx, %rax                                    #1041.32
-        shrq      $2, %rax                                      #1041.32
-..LN3053:
-        shll      $4, %esi                                      #1041.46
-..LN3055:
-        movw      %si, -80(%rbp,%rax,2)                         #1041.13
-..LN3057:
-   .loc    1  1042
-        movl      $240, %esi                                    #1042.13
-        movw      %si, -64(%rbp,%rax,2)                         #1042.13
-        jmp       ..B28.14      # Prob 100%                     #1042.13
-                                # LOE rdx rbx r13 r14 r12d
-..B28.55:                       # Preds ..B28.4                 # Infreq
-..LN3059:
-   .loc    1  1028
-        call      __errno_location at PLT                          #1028.16
-                                # LOE rax
-..B28.60:                       # Preds ..B28.55                # Infreq
-        movq      -32(%rbp), %rbx                               #1028.16
-..___tag_value_NucStrFastaExprMake4.927:                        #
-        movq      -48(%rbp), %r12                               #1028.16
-..___tag_value_NucStrFastaExprMake4.928:                        #
-        movq      -40(%rbp), %r13                               #1028.16
-..___tag_value_NucStrFastaExprMake4.929:                        #
-        movq      -16(%rbp), %r14                               #1028.16
-..___tag_value_NucStrFastaExprMake4.930:                        #
-        movl      (%rax), %eax                                  #1028.16
-        movq      -24(%rbp), %r15                               #1028.16
-..___tag_value_NucStrFastaExprMake4.931:                        #
-        movq      %rbp, %rsp                                    #1028.16
-        popq      %rbp                                          #1028.16
-..___tag_value_NucStrFastaExprMake4.932:                        #
-        ret                                                     #1028.16
-        .align    16,0x90
-..___tag_value_NucStrFastaExprMake4.933:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-.LNNucStrFastaExprMake4:
-	.data
-# -- End  NucStrFastaExprMake4
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1(self): %rdi
-..B29.1:                        # Preds ..B29.0
-..___tag_value_NucStrstrWhack.934:                              #1574.1
-..LN3061:
-   .loc    1  1574
-        pushq     %rbp                                          #1574.1
-        movq      %rsp, %rbp                                    #1574.1
-..___tag_value_NucStrstrWhack.935:                              #
-        subq      $16, %rsp                                     #1574.1
-        movq      %r13, -16(%rbp)                               #1574.1
-..___tag_value_NucStrstrWhack.937:                              #
-        movq      %rdi, %r13                                    #1574.1
-        lea       _gprof_pack28(%rip), %rdx                     #1574.1
-        call      mcount at PLT                                    #1574.1
-                                # LOE rbx r12 r13 r14 r15
-..B29.25:                       # Preds ..B29.1
-..LN3063:
-   .loc    1  1575
-        testq     %r13, %r13                                    #1575.18
-        je        ..B29.22      # Prob 12%                      #1575.18
-                                # LOE rbx r12 r13 r14 r15
-..B29.2:                        # Preds ..B29.25
-..LN3065:
-   .loc    1  1577
-        movl      (%r13), %eax                                  #1577.18
-..LN3067:
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B29.21      # Prob 50%                      #1577.9
-                                # LOE rbx r12 r13 r14 r15 eax
-..B29.3:                        # Preds ..B29.2
-        movl      %eax, %eax                                    #1577.9
-        lea       ..1..TPKT.18_0.0.13(%rip), %rdx               #1577.9
-        movq      (%rdx,%rax,8), %rcx                           #1577.9
-        jmp       *%rcx                                         #1577.9
-                                # LOE rbx r12 r13 r14 r15
-..1.18_0.TAG.0c.0.13:
-..B29.5:                        # Preds ..B29.3
-..LN3069:
-   .loc    1  1601
-        movq      8(%r13), %rdi                                 #1601.13
-        call      NucStrstrWhack at PLT                            #1601.13
-        jmp       ..B29.21      # Prob 100%                     #1601.13
-                                # LOE rbx r12 r13 r14 r15
-..1.18_0.TAG.0b.0.13:
-..B29.7:                        # Preds ..B29.3
-..LN3071:
-   .loc    1  1597
-        movq      8(%r13), %rdi                                 #1597.13
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE rbx r12 r13 r14 r15
-..B29.8:                        # Preds ..B29.7
-..LN3073:
-   .loc    1  1598
-        movq      16(%r13), %rdi                                #1598.13
-        call      NucStrstrWhack at PLT                            #1598.13
-        jmp       ..B29.21      # Prob 100%                     #1598.13
-                                # LOE rbx r12 r13 r14 r15
-..1.18_0.TAG.0a.0.13:
-..1.18_0.TAG.09.0.13:
-..1.18_0.TAG.08.0.13:
-..1.18_0.TAG.07.0.13:
-..1.18_0.TAG.06.0.13:
-..1.18_0.TAG.05.0.13:
-..1.18_0.TAG.04.0.13:
-..1.18_0.TAG.03.0.13:
-..1.18_0.TAG.02.0.13:
-..1.18_0.TAG.01.0.13:
-..1.18_0.TAG.00.0.13:
-..B29.20:                       # Preds ..B29.3 ..B29.3 ..B29.3 ..B29.3 ..B29.3
-                                #       ..B29.3 ..B29.3 ..B29.3 ..B29.3 ..B29.3
-                                #       ..B29.3
-..LN3075:
-   .loc    1  1593
-        movq      8(%r13), %r13                                 #1593.20
-                                # LOE rbx r12 r13 r14 r15
-..B29.21:                       # Preds ..B29.5 ..B29.8 ..B29.20 ..B29.2
-..LN3077:
-   .loc    1  1604
-        movq      %r13, %rdi                                    #1604.9
-        xorl      %eax, %eax                                    #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE rbx r12 r14 r15
-..B29.22:                       # Preds ..B29.21 ..B29.25
-..LN3079:
-   .loc    1  1606
-        movq      -16(%rbp), %r13                               #1606.1
-..___tag_value_NucStrstrWhack.938:                              #
-        movq      %rbp, %rsp                                    #1606.1
-        popq      %rbp                                          #1606.1
-..___tag_value_NucStrstrWhack.939:                              #
-        ret                                                     #1606.1
-        .align    16,0x90
-..___tag_value_NucStrstrWhack.940:                              #
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-.LNNucStrstrWhack:
-	.section .data1, "wa"
-	.space 24	# pad
-	.align 32
-..1..TPKT.18_0.0.13:
-	.quad	..1.18_0.TAG.00.0.13
-	.quad	..1.18_0.TAG.01.0.13
-	.quad	..1.18_0.TAG.02.0.13
-	.quad	..1.18_0.TAG.03.0.13
-	.quad	..1.18_0.TAG.04.0.13
-	.quad	..1.18_0.TAG.05.0.13
-	.quad	..1.18_0.TAG.06.0.13
-	.quad	..1.18_0.TAG.07.0.13
-	.quad	..1.18_0.TAG.08.0.13
-	.quad	..1.18_0.TAG.09.0.13
-	.quad	..1.18_0.TAG.0a.0.13
-	.quad	..1.18_0.TAG.0b.0.13
-	.quad	..1.18_0.TAG.0c.0.13
-	.data
-# -- End  NucStrstrWhack
-	.text
-# -- Begin  NucStrstrInit
-# mark_begin;
-       .align    16,0x90
-NucStrstrInit:
-..B30.1:                        # Preds ..B30.0
-..___tag_value_NucStrstrInit.941:                               #1484.1
-..LN3081:
-   .loc    1  1484
-        pushq     %rbp                                          #1484.1
-        movq      %rsp, %rbp                                    #1484.1
-..___tag_value_NucStrstrInit.942:                               #
-        subq      $32, %rsp                                     #1484.1
-        movq      %r15, -32(%rbp)                               #1484.1
-..___tag_value_NucStrstrInit.944:                               #
-        movq      %r12, -16(%rbp)                               #1484.1
-..___tag_value_NucStrstrInit.945:                               #
-        movq      %rbx, -24(%rbp)                               #1484.1
-..___tag_value_NucStrstrInit.946:                               #
-        lea       _gprof_pack29(%rip), %rdx                     #1484.1
-        call      mcount at PLT                                    #1484.1
-                                # LOE r13 r14
-..B30.27:                       # Preds ..B30.1
-..LN3083:
-   .loc    1  1491
-        lea       fasta_2na_map.0(%rip), %rdx                   #1491.14
-..LN3085:
-        movl      $-1, %eax                                     #1491.5
-        movd      %eax, %xmm0                                   #1491.5
-        pshufd    $0, %xmm0, %xmm1                              #1491.5
-        movaps    %xmm1, (%rdx)                                 #1491.5
-        movaps    %xmm1, 16(%rdx)                               #1491.5
-        movaps    %xmm1, 32(%rdx)                               #1491.5
-        movaps    %xmm1, 48(%rdx)                               #1491.5
-        movaps    %xmm1, 64(%rdx)                               #1491.5
-        movaps    %xmm1, 80(%rdx)                               #1491.5
-        movaps    %xmm1, 96(%rdx)                               #1491.5
-        movaps    %xmm1, 112(%rdx)                              #1491.5
-                                # LOE r13 r14
-..B30.2:                        # Preds ..B30.27
-..LN3087:
-   .loc    1  1492
-        lea       fasta_4na_map.0(%rip), %rdx                   #1492.14
-..LN3089:
-        movl      $-1, %eax                                     #1492.5
-        movd      %eax, %xmm0                                   #1492.5
-        pshufd    $0, %xmm0, %xmm1                              #1492.5
-        movaps    %xmm1, (%rdx)                                 #1492.5
-        movaps    %xmm1, 16(%rdx)                               #1492.5
-        movaps    %xmm1, 32(%rdx)                               #1492.5
-        movaps    %xmm1, 48(%rdx)                               #1492.5
-        movaps    %xmm1, 64(%rdx)                               #1492.5
-        movaps    %xmm1, 80(%rdx)                               #1492.5
-        movaps    %xmm1, 96(%rdx)                               #1492.5
-        movaps    %xmm1, 112(%rdx)                              #1492.5
-                                # LOE r13 r14
-..B30.3:                        # Preds ..B30.2
-..LN3091:
-   .loc    1  1495
-        xorl      %r15d, %r15d                                  #1495.11
-..LN3093:
-   .loc    1  1487
-        lea       _2__STRING.0.0(%rip), %rax                    #1487.29
-..LN3095:
-   .loc    1  1497
-        movsbl    (%rax), %ebx                                  #1497.14
-        lea       1+_2__STRING.0.0(%rip), %r12                  #
-..LN3097:
-   .loc    1  1498
-        call      __ctype_tolower_loc at PLT                       #1498.48
-                                # LOE r12 r13 r14 ebx r15d
-..B30.9:                        # Preds ..B30.3 ..B30.10
-        movl      %ebx, %edi                                    #1498.48
-        call      tolower at PLT                                   #1498.48
-                                # LOE r12 r13 r14 eax ebx r15d
-..B30.28:                       # Preds ..B30.9
-        movslq    %eax, %rdx                                    #1498.48
-                                # LOE rdx r12 r13 r14 ebx r15d
-..B30.10:                       # Preds ..B30.28
-..LN3099:
-        lea       fasta_2na_map.0(%rip), %rax                   #1498.32
-        movb      %r15b, (%rax,%rdx)                            #1498.32
-..LN3101:
-        movslq    %ebx, %rdx                                    #1498.9
-        movb      %r15b, (%rax,%rdx)                            #1498.9
-..LN3103:
-   .loc    1  1495
-        movsbl    (%r12), %ebx                                  #1495.31
-..LN3105:
-        incl      %r15d                                         #1495.48
-..LN3107:
-        incq      %r12                                          #1495.54
-..LN3109:
-        testl     %ebx, %ebx                                    #1495.42
-        jne       ..B30.9       # Prob 82%                      #1495.42
-                                # LOE r12 r13 r14 ebx r15d
-..B30.11:                       # Preds ..B30.10
-..LN3111:
-   .loc    1  1502
-        xorl      %r15d, %r15d                                  #1502.11
-..LN3113:
-   .loc    1  1488
-        lea       _2__STRING.1.0(%rip), %rax                    #1488.25
-..LN3115:
-   .loc    1  1504
-        movsbl    (%rax), %ebx                                  #1504.14
-        lea       1+_2__STRING.1.0(%rip), %r12                  #
-                                # LOE r12 r13 r14 ebx r15d
-..B30.17:                       # Preds ..B30.11 ..B30.18
-..LN3117:
-   .loc    1  1505
-        movl      %ebx, %edi                                    #1505.48
-        call      tolower at PLT                                   #1505.48
-                                # LOE r12 r13 r14 eax ebx r15d
-..B30.29:                       # Preds ..B30.17
-        movslq    %eax, %rdx                                    #1505.48
-                                # LOE rdx r12 r13 r14 ebx r15d
-..B30.18:                       # Preds ..B30.29
-..LN3119:
-        lea       fasta_4na_map.0(%rip), %rax                   #1505.32
-        movb      %r15b, (%rax,%rdx)                            #1505.32
-..LN3121:
-        movslq    %ebx, %rdx                                    #1505.9
-        movb      %r15b, (%rax,%rdx)                            #1505.9
-..LN3123:
-   .loc    1  1502
-        movsbl    (%r12), %ebx                                  #1502.31
-..LN3125:
-        incl      %r15d                                         #1502.48
-..LN3127:
-        incq      %r12                                          #1502.54
-..LN3129:
-        testl     %ebx, %ebx                                    #1502.42
-        jne       ..B30.17      # Prob 82%                      #1502.42
-                                # LOE r12 r13 r14 ebx r15d
-..B30.19:                       # Preds ..B30.18
-..LN3131:
-   .loc    1  1510
-        xorl      %edx, %edx                                    #1510.11
-..LN3133:
-        xorl      %eax, %eax                                    #1510.30
-                                # LOE rdx r13 r14 eax
-..B30.20:                       # Preds ..B30.23 ..B30.19
-..LN3135:
-   .loc    1  1511
-        lea       expand_2na.0(%rip), %rcx                      #1511.28
-        movzwl    (%rcx,%rdx,2), %ecx                           #1511.28
-                                # LOE rdx r13 r14 eax ecx
-..B30.22:                       # Preds ..B30.20
-..LN3137:
-        rorw      $8, %cx                                       #1511.0
-                                # LOE rdx r13 r14 eax ecx
-..B30.23:                       # Preds ..B30.22
-..LN3139:
-        lea       expand_2na.0(%rip), %rbx                      #1511.9
-        movw      %cx, (%rbx,%rdx,2)                            #1511.9
-..LN3141:
-   .loc    1  1510
-        incl      %eax                                          #1510.30
-        movl      %eax, %edx                                    #1510.30
-..LN3143:
-        movl      %edx, %eax                                    #1510.5
-..LN3145:
-        cmpl      $256, %eax                                    #1510.22
-        jb        ..B30.20      # Prob 99%                      #1510.22
-                                # LOE rdx r13 r14 eax
-..B30.24:                       # Preds ..B30.23
-..LN3147:
-   .loc    1  1513
-        movq      -24(%rbp), %rbx                               #1513.1
-..___tag_value_NucStrstrInit.947:                               #
-        movq      -16(%rbp), %r12                               #1513.1
-..___tag_value_NucStrstrInit.948:                               #
-        movq      -32(%rbp), %r15                               #1513.1
-..___tag_value_NucStrstrInit.949:                               #
-        movq      %rbp, %rsp                                    #1513.1
-        popq      %rbp                                          #1513.1
-..___tag_value_NucStrstrInit.950:                               #
-        ret                                                     #1513.1
-        .align    16,0x90
-..___tag_value_NucStrstrInit.951:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrInit, at function
-	.size	NucStrstrInit,.-NucStrstrInit
-.LNNucStrstrInit:
-	.data
-# -- End  NucStrstrInit
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map.0:
-	.type	fasta_2na_map.0, at object
-	.size	fasta_2na_map.0,128
-	.space 128	# pad
-	.align 32
-fasta_4na_map.0:
-	.type	fasta_4na_map.0, at object
-	.size	fasta_4na_map.0,128
-	.space 128	# pad
-	.data
-	.align 32
-	.align 32
-expand_2na.0:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na.0, at object
-	.size	expand_2na.0,512
-	.section .rodata, "a"
-	.align 4
-	.align 4
-_gprof_pack0:
-	.long	0
-	.type	_gprof_pack0, at object
-	.size	_gprof_pack0,4
-	.align 4
-_gprof_pack1:
-	.long	0
-	.type	_gprof_pack1, at object
-	.size	_gprof_pack1,4
-	.align 4
-_gprof_pack2:
-	.long	0
-	.type	_gprof_pack2, at object
-	.size	_gprof_pack2,4
-	.align 4
-_gprof_pack3:
-	.long	0
-	.type	_gprof_pack3, at object
-	.size	_gprof_pack3,4
-	.align 4
-_gprof_pack4:
-	.long	0
-	.type	_gprof_pack4, at object
-	.size	_gprof_pack4,4
-	.align 4
-_gprof_pack5:
-	.long	0
-	.type	_gprof_pack5, at object
-	.size	_gprof_pack5,4
-	.align 4
-_gprof_pack6:
-	.long	0
-	.type	_gprof_pack6, at object
-	.size	_gprof_pack6,4
-	.align 4
-_gprof_pack7:
-	.long	0
-	.type	_gprof_pack7, at object
-	.size	_gprof_pack7,4
-	.align 4
-_gprof_pack8:
-	.long	0
-	.type	_gprof_pack8, at object
-	.size	_gprof_pack8,4
-	.align 4
-_gprof_pack9:
-	.long	0
-	.type	_gprof_pack9, at object
-	.size	_gprof_pack9,4
-	.align 4
-_gprof_pack10:
-	.long	0
-	.type	_gprof_pack10, at object
-	.size	_gprof_pack10,4
-	.align 4
-_gprof_pack11:
-	.long	0
-	.type	_gprof_pack11, at object
-	.size	_gprof_pack11,4
-	.align 4
-_gprof_pack12:
-	.long	0
-	.type	_gprof_pack12, at object
-	.size	_gprof_pack12,4
-	.align 4
-_gprof_pack13:
-	.long	0
-	.type	_gprof_pack13, at object
-	.size	_gprof_pack13,4
-	.align 4
-_gprof_pack14:
-	.long	0
-	.type	_gprof_pack14, at object
-	.size	_gprof_pack14,4
-	.align 4
-_gprof_pack15:
-	.long	0
-	.type	_gprof_pack15, at object
-	.size	_gprof_pack15,4
-	.align 4
-_gprof_pack16:
-	.long	0
-	.type	_gprof_pack16, at object
-	.size	_gprof_pack16,4
-	.align 4
-_gprof_pack17:
-	.long	0
-	.type	_gprof_pack17, at object
-	.size	_gprof_pack17,4
-	.align 4
-_gprof_pack18:
-	.long	0
-	.type	_gprof_pack18, at object
-	.size	_gprof_pack18,4
-	.align 4
-_gprof_pack19:
-	.long	0
-	.type	_gprof_pack19, at object
-	.size	_gprof_pack19,4
-	.align 4
-_gprof_pack20:
-	.long	0
-	.type	_gprof_pack20, at object
-	.size	_gprof_pack20,4
-	.align 4
-_gprof_pack21:
-	.long	0
-	.type	_gprof_pack21, at object
-	.size	_gprof_pack21,4
-	.align 4
-_gprof_pack22:
-	.long	0
-	.type	_gprof_pack22, at object
-	.size	_gprof_pack22,4
-	.align 4
-_gprof_pack23:
-	.long	0
-	.type	_gprof_pack23, at object
-	.size	_gprof_pack23,4
-	.align 4
-_gprof_pack24:
-	.long	0
-	.type	_gprof_pack24, at object
-	.size	_gprof_pack24,4
-	.align 4
-_gprof_pack25:
-	.long	0
-	.type	_gprof_pack25, at object
-	.size	_gprof_pack25,4
-	.align 4
-_gprof_pack26:
-	.long	0
-	.type	_gprof_pack26, at object
-	.size	_gprof_pack26,4
-	.align 4
-_gprof_pack27:
-	.long	0
-	.type	_gprof_pack27, at object
-	.size	_gprof_pack27,4
-	.align 4
-_gprof_pack28:
-	.long	0
-	.type	_gprof_pack28, at object
-	.size	_gprof_pack28,4
-	.align 4
-_gprof_pack29:
-	.long	0
-	.type	_gprof_pack29, at object
-	.size	_gprof_pack29,4
-	.section .rodata.str1.4, "aMS", at progbits,1
-	.align 4
-	.align 4
-_2__STRING.0.0:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.0.0, at object
-	.size	_2__STRING.0.0,5
-	.space 3	# pad
-	.align 4
-_2__STRING.1.0:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.1.0, at object
-	.size	_2__STRING.1.0,17
-	.data
-	.section .note.GNU-stack, ""
-// -- Begin DWARF2 SEGMENT .debug_info
-	.section .debug_info
-.debug_info_seg:
-	.align 1
-// -- Begin DWARF2 SEGMENT .debug_line
-	.section .debug_line
-.debug_line_seg:
-	.align 1
-// -- Begin DWARF2 SEGMENT .debug_abbrev
-	.section .debug_abbrev
-.debug_abbrev_seg:
-	.align 1
-// -- Begin DWARF2 SEGMENT .eh_frame
-	.section .eh_frame,"a", at progbits
-.eh_frame_seg:
-	.align 1
-	.4byte 0x00000014
-	.4byte 0x00000000
-	.byte 0x01
-	.2byte 0x527a
-	.byte 0x00
-	.byte 0x01
-	.byte 0x78
-	.byte 0x10
-	.byte 0x01
-	.4byte 0x08070c1b
-	.2byte 0x0190
-	.2byte 0x0000
-	.4byte 0x0000037c
-	.4byte 0x0000001c
-	.4byte ..___tag_value_NucStrstrSearch.1-.
-	.4byte ..___tag_value_NucStrstrSearch.159-..___tag_value_NucStrstrSearch.1
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.2-..___tag_value_NucStrstrSearch.1
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.4-..___tag_value_NucStrstrSearch.2
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.5-..___tag_value_NucStrstrSearch.4
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.6-..___tag_value_NucStrstrSearch.5
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.7-..___tag_value_NucStrstrSearch.6
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.8-..___tag_value_NucStrstrSearch.7
-	.byte 0x83
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.9-..___tag_value_NucStrstrSearch.8
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.10-..___tag_value_NucStrstrSearch.9
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.11-..___tag_value_NucStrstrSearch.10
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.12-..___tag_value_NucStrstrSearch.11
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.13-..___tag_value_NucStrstrSearch.12
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.14-..___tag_value_NucStrstrSearch.13
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.15-..___tag_value_NucStrstrSearch.14
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.21-..___tag_value_NucStrstrSearch.15
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.22-..___tag_value_NucStrstrSearch.21
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.23-..___tag_value_NucStrstrSearch.22
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.24-..___tag_value_NucStrstrSearch.23
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.25-..___tag_value_NucStrstrSearch.24
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.26-..___tag_value_NucStrstrSearch.25
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.27-..___tag_value_NucStrstrSearch.26
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.33-..___tag_value_NucStrstrSearch.27
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.34-..___tag_value_NucStrstrSearch.33
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.35-..___tag_value_NucStrstrSearch.34
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.36-..___tag_value_NucStrstrSearch.35
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.37-..___tag_value_NucStrstrSearch.36
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.38-..___tag_value_NucStrstrSearch.37
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.39-..___tag_value_NucStrstrSearch.38
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.45-..___tag_value_NucStrstrSearch.39
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.46-..___tag_value_NucStrstrSearch.45
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.47-..___tag_value_NucStrstrSearch.46
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.48-..___tag_value_NucStrstrSearch.47
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.49-..___tag_value_NucStrstrSearch.48
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.50-..___tag_value_NucStrstrSearch.49
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.51-..___tag_value_NucStrstrSearch.50
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.57-..___tag_value_NucStrstrSearch.51
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.58-..___tag_value_NucStrstrSearch.57
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.59-..___tag_value_NucStrstrSearch.58
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.60-..___tag_value_NucStrstrSearch.59
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.61-..___tag_value_NucStrstrSearch.60
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.62-..___tag_value_NucStrstrSearch.61
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.63-..___tag_value_NucStrstrSearch.62
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.69-..___tag_value_NucStrstrSearch.63
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.70-..___tag_value_NucStrstrSearch.69
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.71-..___tag_value_NucStrstrSearch.70
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.72-..___tag_value_NucStrstrSearch.71
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.73-..___tag_value_NucStrstrSearch.72
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.74-..___tag_value_NucStrstrSearch.73
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.75-..___tag_value_NucStrstrSearch.74
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.81-..___tag_value_NucStrstrSearch.75
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.82-..___tag_value_NucStrstrSearch.81
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.83-..___tag_value_NucStrstrSearch.82
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.84-..___tag_value_NucStrstrSearch.83
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.85-..___tag_value_NucStrstrSearch.84
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.86-..___tag_value_NucStrstrSearch.85
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.87-..___tag_value_NucStrstrSearch.86
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.93-..___tag_value_NucStrstrSearch.87
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.94-..___tag_value_NucStrstrSearch.93
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.95-..___tag_value_NucStrstrSearch.94
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.96-..___tag_value_NucStrstrSearch.95
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.97-..___tag_value_NucStrstrSearch.96
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.98-..___tag_value_NucStrstrSearch.97
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.99-..___tag_value_NucStrstrSearch.98
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.105-..___tag_value_NucStrstrSearch.99
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.106-..___tag_value_NucStrstrSearch.105
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.107-..___tag_value_NucStrstrSearch.106
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.108-..___tag_value_NucStrstrSearch.107
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.109-..___tag_value_NucStrstrSearch.108
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.110-..___tag_value_NucStrstrSearch.109
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.111-..___tag_value_NucStrstrSearch.110
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.117-..___tag_value_NucStrstrSearch.111
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.118-..___tag_value_NucStrstrSearch.117
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.119-..___tag_value_NucStrstrSearch.118
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.120-..___tag_value_NucStrstrSearch.119
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.121-..___tag_value_NucStrstrSearch.120
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.122-..___tag_value_NucStrstrSearch.121
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.123-..___tag_value_NucStrstrSearch.122
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.129-..___tag_value_NucStrstrSearch.123
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.130-..___tag_value_NucStrstrSearch.129
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.131-..___tag_value_NucStrstrSearch.130
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.132-..___tag_value_NucStrstrSearch.131
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.133-..___tag_value_NucStrstrSearch.132
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.134-..___tag_value_NucStrstrSearch.133
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.135-..___tag_value_NucStrstrSearch.134
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.141-..___tag_value_NucStrstrSearch.135
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.142-..___tag_value_NucStrstrSearch.141
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.143-..___tag_value_NucStrstrSearch.142
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.144-..___tag_value_NucStrstrSearch.143
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.145-..___tag_value_NucStrstrSearch.144
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.146-..___tag_value_NucStrstrSearch.145
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.147-..___tag_value_NucStrstrSearch.146
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.153-..___tag_value_NucStrstrSearch.147
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.154-..___tag_value_NucStrstrSearch.153
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.155-..___tag_value_NucStrstrSearch.154
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.156-..___tag_value_NucStrstrSearch.155
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.157-..___tag_value_NucStrstrSearch.156
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.158-..___tag_value_NucStrstrSearch.157
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000184
-	.4byte 0x0000039c
-	.4byte ..___tag_value_eval_4na_pos.160-.
-	.4byte ..___tag_value_eval_4na_pos.228-..___tag_value_eval_4na_pos.160
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.161-..___tag_value_eval_4na_pos.160
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.163-..___tag_value_eval_4na_pos.161
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.164-..___tag_value_eval_4na_pos.163
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.165-..___tag_value_eval_4na_pos.164
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.166-..___tag_value_eval_4na_pos.165
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.167-..___tag_value_eval_4na_pos.166
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.168-..___tag_value_eval_4na_pos.167
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.169-..___tag_value_eval_4na_pos.168
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.170-..___tag_value_eval_4na_pos.169
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.171-..___tag_value_eval_4na_pos.170
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.172-..___tag_value_eval_4na_pos.171
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.173-..___tag_value_eval_4na_pos.172
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.174-..___tag_value_eval_4na_pos.173
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.180-..___tag_value_eval_4na_pos.174
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.181-..___tag_value_eval_4na_pos.180
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.182-..___tag_value_eval_4na_pos.181
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.183-..___tag_value_eval_4na_pos.182
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.184-..___tag_value_eval_4na_pos.183
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.185-..___tag_value_eval_4na_pos.184
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.186-..___tag_value_eval_4na_pos.185
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.192-..___tag_value_eval_4na_pos.186
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.193-..___tag_value_eval_4na_pos.192
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.194-..___tag_value_eval_4na_pos.193
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.195-..___tag_value_eval_4na_pos.194
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.196-..___tag_value_eval_4na_pos.195
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.197-..___tag_value_eval_4na_pos.196
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.198-..___tag_value_eval_4na_pos.197
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.204-..___tag_value_eval_4na_pos.198
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.205-..___tag_value_eval_4na_pos.204
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.206-..___tag_value_eval_4na_pos.205
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.207-..___tag_value_eval_4na_pos.206
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.208-..___tag_value_eval_4na_pos.207
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.209-..___tag_value_eval_4na_pos.208
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.210-..___tag_value_eval_4na_pos.209
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.216-..___tag_value_eval_4na_pos.210
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.217-..___tag_value_eval_4na_pos.216
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.218-..___tag_value_eval_4na_pos.217
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.219-..___tag_value_eval_4na_pos.218
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.220-..___tag_value_eval_4na_pos.219
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.221-..___tag_value_eval_4na_pos.220
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.222-..___tag_value_eval_4na_pos.221
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x00000524
-	.4byte ..___tag_value_prime_buffer_4na.229-.
-	.4byte ..___tag_value_prime_buffer_4na.235-..___tag_value_prime_buffer_4na.229
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.230-..___tag_value_prime_buffer_4na.229
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.232-..___tag_value_prime_buffer_4na.230
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.233-..___tag_value_prime_buffer_4na.232
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_4na.234-..___tag_value_prime_buffer_4na.233
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000184
-	.4byte 0x0000055c
-	.4byte ..___tag_value_eval_2na_pos.236-.
-	.4byte ..___tag_value_eval_2na_pos.304-..___tag_value_eval_2na_pos.236
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.237-..___tag_value_eval_2na_pos.236
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.239-..___tag_value_eval_2na_pos.237
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.240-..___tag_value_eval_2na_pos.239
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.241-..___tag_value_eval_2na_pos.240
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.242-..___tag_value_eval_2na_pos.241
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.243-..___tag_value_eval_2na_pos.242
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.244-..___tag_value_eval_2na_pos.243
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.245-..___tag_value_eval_2na_pos.244
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.246-..___tag_value_eval_2na_pos.245
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.247-..___tag_value_eval_2na_pos.246
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.248-..___tag_value_eval_2na_pos.247
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.249-..___tag_value_eval_2na_pos.248
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.250-..___tag_value_eval_2na_pos.249
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.256-..___tag_value_eval_2na_pos.250
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.257-..___tag_value_eval_2na_pos.256
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.258-..___tag_value_eval_2na_pos.257
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.259-..___tag_value_eval_2na_pos.258
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.260-..___tag_value_eval_2na_pos.259
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.261-..___tag_value_eval_2na_pos.260
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.262-..___tag_value_eval_2na_pos.261
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.268-..___tag_value_eval_2na_pos.262
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.269-..___tag_value_eval_2na_pos.268
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.270-..___tag_value_eval_2na_pos.269
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.271-..___tag_value_eval_2na_pos.270
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.272-..___tag_value_eval_2na_pos.271
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.273-..___tag_value_eval_2na_pos.272
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.274-..___tag_value_eval_2na_pos.273
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.280-..___tag_value_eval_2na_pos.274
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.281-..___tag_value_eval_2na_pos.280
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.282-..___tag_value_eval_2na_pos.281
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.283-..___tag_value_eval_2na_pos.282
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.284-..___tag_value_eval_2na_pos.283
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.285-..___tag_value_eval_2na_pos.284
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.286-..___tag_value_eval_2na_pos.285
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.292-..___tag_value_eval_2na_pos.286
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.293-..___tag_value_eval_2na_pos.292
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.294-..___tag_value_eval_2na_pos.293
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.295-..___tag_value_eval_2na_pos.294
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.296-..___tag_value_eval_2na_pos.295
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.297-..___tag_value_eval_2na_pos.296
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.298-..___tag_value_eval_2na_pos.297
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x000006e4
-	.4byte ..___tag_value_prime_buffer_2na.305-.
-	.4byte ..___tag_value_prime_buffer_2na.311-..___tag_value_prime_buffer_2na.305
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.306-..___tag_value_prime_buffer_2na.305
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.308-..___tag_value_prime_buffer_2na.306
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.309-..___tag_value_prime_buffer_2na.308
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_prime_buffer_2na.310-..___tag_value_prime_buffer_2na.309
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000104
-	.4byte 0x0000071c
-	.4byte ..___tag_value_eval_4na_128.312-.
-	.4byte ..___tag_value_eval_4na_128.356-..___tag_value_eval_4na_128.312
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.313-..___tag_value_eval_4na_128.312
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.315-..___tag_value_eval_4na_128.313
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.316-..___tag_value_eval_4na_128.315
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.317-..___tag_value_eval_4na_128.316
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.318-..___tag_value_eval_4na_128.317
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.319-..___tag_value_eval_4na_128.318
-	.byte 0x83
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.320-..___tag_value_eval_4na_128.319
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.321-..___tag_value_eval_4na_128.320
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.322-..___tag_value_eval_4na_128.321
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.323-..___tag_value_eval_4na_128.322
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.324-..___tag_value_eval_4na_128.323
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.325-..___tag_value_eval_4na_128.324
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.326-..___tag_value_eval_4na_128.325
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.332-..___tag_value_eval_4na_128.326
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.333-..___tag_value_eval_4na_128.332
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.334-..___tag_value_eval_4na_128.333
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.335-..___tag_value_eval_4na_128.334
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.336-..___tag_value_eval_4na_128.335
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.337-..___tag_value_eval_4na_128.336
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.338-..___tag_value_eval_4na_128.337
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.344-..___tag_value_eval_4na_128.338
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.345-..___tag_value_eval_4na_128.344
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.346-..___tag_value_eval_4na_128.345
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.347-..___tag_value_eval_4na_128.346
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.348-..___tag_value_eval_4na_128.347
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.349-..___tag_value_eval_4na_128.348
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.350-..___tag_value_eval_4na_128.349
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x04
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000824
-	.4byte ..___tag_value_eval_4na_32.357-.
-	.4byte ..___tag_value_eval_4na_32.383-..___tag_value_eval_4na_32.357
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.358-..___tag_value_eval_4na_32.357
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.360-..___tag_value_eval_4na_32.358
-	.byte 0x8f
-	.byte 0x19
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.361-..___tag_value_eval_4na_32.360
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.362-..___tag_value_eval_4na_32.361
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.363-..___tag_value_eval_4na_32.362
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.364-..___tag_value_eval_4na_32.363
-	.byte 0x83
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.365-..___tag_value_eval_4na_32.364
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.366-..___tag_value_eval_4na_32.365
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.367-..___tag_value_eval_4na_32.366
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.368-..___tag_value_eval_4na_32.367
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.369-..___tag_value_eval_4na_32.368
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.370-..___tag_value_eval_4na_32.369
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.371-..___tag_value_eval_4na_32.370
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x19
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.377-..___tag_value_eval_4na_32.371
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.378-..___tag_value_eval_4na_32.377
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.379-..___tag_value_eval_4na_32.378
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.380-..___tag_value_eval_4na_32.379
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.381-..___tag_value_eval_4na_32.380
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.382-..___tag_value_eval_4na_32.381
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x000008d4
-	.4byte ..___tag_value_uint16_lsbit.384-.
-	.4byte ..___tag_value_uint16_lsbit.390-..___tag_value_uint16_lsbit.384
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.385-..___tag_value_uint16_lsbit.384
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.387-..___tag_value_uint16_lsbit.385
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.388-..___tag_value_uint16_lsbit.387
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_uint16_lsbit.389-..___tag_value_uint16_lsbit.388
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x000000ac
-	.4byte 0x0000090c
-	.4byte ..___tag_value_eval_4na_16.391-.
-	.4byte ..___tag_value_eval_4na_16.417-..___tag_value_eval_4na_16.391
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.392-..___tag_value_eval_4na_16.391
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.394-..___tag_value_eval_4na_16.392
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.395-..___tag_value_eval_4na_16.394
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.396-..___tag_value_eval_4na_16.395
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.397-..___tag_value_eval_4na_16.396
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.398-..___tag_value_eval_4na_16.397
-	.byte 0x83
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.399-..___tag_value_eval_4na_16.398
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.400-..___tag_value_eval_4na_16.399
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.401-..___tag_value_eval_4na_16.400
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.402-..___tag_value_eval_4na_16.401
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.403-..___tag_value_eval_4na_16.402
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.404-..___tag_value_eval_4na_16.403
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.405-..___tag_value_eval_4na_16.404
-	.byte 0x83
-	.byte 0x09
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.411-..___tag_value_eval_4na_16.405
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.412-..___tag_value_eval_4na_16.411
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.413-..___tag_value_eval_4na_16.412
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.414-..___tag_value_eval_4na_16.413
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.415-..___tag_value_eval_4na_16.414
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.416-..___tag_value_eval_4na_16.415
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x00000104
-	.4byte 0x000009bc
-	.4byte ..___tag_value_eval_2na_128.418-.
-	.4byte ..___tag_value_eval_2na_128.462-..___tag_value_eval_2na_128.418
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.419-..___tag_value_eval_2na_128.418
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.421-..___tag_value_eval_2na_128.419
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.422-..___tag_value_eval_2na_128.421
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.423-..___tag_value_eval_2na_128.422
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.424-..___tag_value_eval_2na_128.423
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.425-..___tag_value_eval_2na_128.424
-	.byte 0x83
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.426-..___tag_value_eval_2na_128.425
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.427-..___tag_value_eval_2na_128.426
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.428-..___tag_value_eval_2na_128.427
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.429-..___tag_value_eval_2na_128.428
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.430-..___tag_value_eval_2na_128.429
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.431-..___tag_value_eval_2na_128.430
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.432-..___tag_value_eval_2na_128.431
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.438-..___tag_value_eval_2na_128.432
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.439-..___tag_value_eval_2na_128.438
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.440-..___tag_value_eval_2na_128.439
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.441-..___tag_value_eval_2na_128.440
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.442-..___tag_value_eval_2na_128.441
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.443-..___tag_value_eval_2na_128.442
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.444-..___tag_value_eval_2na_128.443
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.450-..___tag_value_eval_2na_128.444
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.451-..___tag_value_eval_2na_128.450
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.452-..___tag_value_eval_2na_128.451
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.453-..___tag_value_eval_2na_128.452
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.454-..___tag_value_eval_2na_128.453
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.455-..___tag_value_eval_2na_128.454
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.456-..___tag_value_eval_2na_128.455
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x07
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000ac4
-	.4byte ..___tag_value_eval_2na_32.463-.
-	.4byte ..___tag_value_eval_2na_32.489-..___tag_value_eval_2na_32.463
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.464-..___tag_value_eval_2na_32.463
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.466-..___tag_value_eval_2na_32.464
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.467-..___tag_value_eval_2na_32.466
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.468-..___tag_value_eval_2na_32.467
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.469-..___tag_value_eval_2na_32.468
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.470-..___tag_value_eval_2na_32.469
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.471-..___tag_value_eval_2na_32.470
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.472-..___tag_value_eval_2na_32.471
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.473-..___tag_value_eval_2na_32.472
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.474-..___tag_value_eval_2na_32.473
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.475-..___tag_value_eval_2na_32.474
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.476-..___tag_value_eval_2na_32.475
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.477-..___tag_value_eval_2na_32.476
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.483-..___tag_value_eval_2na_32.477
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.484-..___tag_value_eval_2na_32.483
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.485-..___tag_value_eval_2na_32.484
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.486-..___tag_value_eval_2na_32.485
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.487-..___tag_value_eval_2na_32.486
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.488-..___tag_value_eval_2na_32.487
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000b74
-	.4byte ..___tag_value_eval_2na_16.490-.
-	.4byte ..___tag_value_eval_2na_16.516-..___tag_value_eval_2na_16.490
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.491-..___tag_value_eval_2na_16.490
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.493-..___tag_value_eval_2na_16.491
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.494-..___tag_value_eval_2na_16.493
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.495-..___tag_value_eval_2na_16.494
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.496-..___tag_value_eval_2na_16.495
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.497-..___tag_value_eval_2na_16.496
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.498-..___tag_value_eval_2na_16.497
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.499-..___tag_value_eval_2na_16.498
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.500-..___tag_value_eval_2na_16.499
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.501-..___tag_value_eval_2na_16.500
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.502-..___tag_value_eval_2na_16.501
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.503-..___tag_value_eval_2na_16.502
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.504-..___tag_value_eval_2na_16.503
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.510-..___tag_value_eval_2na_16.504
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.511-..___tag_value_eval_2na_16.510
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.512-..___tag_value_eval_2na_16.511
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.513-..___tag_value_eval_2na_16.512
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.514-..___tag_value_eval_2na_16.513
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.515-..___tag_value_eval_2na_16.514
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000c24
-	.4byte ..___tag_value_eval_2na_8.517-.
-	.4byte ..___tag_value_eval_2na_8.543-..___tag_value_eval_2na_8.517
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.518-..___tag_value_eval_2na_8.517
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.520-..___tag_value_eval_2na_8.518
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.521-..___tag_value_eval_2na_8.520
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.522-..___tag_value_eval_2na_8.521
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.523-..___tag_value_eval_2na_8.522
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.524-..___tag_value_eval_2na_8.523
-	.byte 0x83
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.525-..___tag_value_eval_2na_8.524
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.526-..___tag_value_eval_2na_8.525
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.527-..___tag_value_eval_2na_8.526
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.528-..___tag_value_eval_2na_8.527
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.529-..___tag_value_eval_2na_8.528
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.530-..___tag_value_eval_2na_8.529
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.531-..___tag_value_eval_2na_8.530
-	.byte 0x83
-	.byte 0x09
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.537-..___tag_value_eval_2na_8.531
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.538-..___tag_value_eval_2na_8.537
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.539-..___tag_value_eval_2na_8.538
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.540-..___tag_value_eval_2na_8.539
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.541-..___tag_value_eval_2na_8.540
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.542-..___tag_value_eval_2na_8.541
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000cd4
-	.4byte ..___tag_value_eval_4na_64.544-.
-	.4byte ..___tag_value_eval_4na_64.570-..___tag_value_eval_4na_64.544
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.545-..___tag_value_eval_4na_64.544
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.547-..___tag_value_eval_4na_64.545
-	.byte 0x8f
-	.byte 0x19
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.548-..___tag_value_eval_4na_64.547
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.549-..___tag_value_eval_4na_64.548
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.550-..___tag_value_eval_4na_64.549
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.551-..___tag_value_eval_4na_64.550
-	.byte 0x83
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.552-..___tag_value_eval_4na_64.551
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.553-..___tag_value_eval_4na_64.552
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.554-..___tag_value_eval_4na_64.553
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.555-..___tag_value_eval_4na_64.554
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.556-..___tag_value_eval_4na_64.555
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.557-..___tag_value_eval_4na_64.556
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.558-..___tag_value_eval_4na_64.557
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x19
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.564-..___tag_value_eval_4na_64.558
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.565-..___tag_value_eval_4na_64.564
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.566-..___tag_value_eval_4na_64.565
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.567-..___tag_value_eval_4na_64.566
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.568-..___tag_value_eval_4na_64.567
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.569-..___tag_value_eval_4na_64.568
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00000d84
-	.4byte ..___tag_value_eval_2na_64.571-.
-	.4byte ..___tag_value_eval_2na_64.597-..___tag_value_eval_2na_64.571
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.572-..___tag_value_eval_2na_64.571
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.574-..___tag_value_eval_2na_64.572
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.575-..___tag_value_eval_2na_64.574
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.576-..___tag_value_eval_2na_64.575
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.577-..___tag_value_eval_2na_64.576
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.578-..___tag_value_eval_2na_64.577
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.579-..___tag_value_eval_2na_64.578
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.580-..___tag_value_eval_2na_64.579
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.581-..___tag_value_eval_2na_64.580
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.582-..___tag_value_eval_2na_64.581
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.583-..___tag_value_eval_2na_64.582
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.584-..___tag_value_eval_2na_64.583
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.585-..___tag_value_eval_2na_64.584
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x8f
-	.byte 0x09
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.591-..___tag_value_eval_2na_64.585
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.592-..___tag_value_eval_2na_64.591
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.593-..___tag_value_eval_2na_64.592
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.594-..___tag_value_eval_2na_64.593
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.595-..___tag_value_eval_2na_64.594
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.596-..___tag_value_eval_2na_64.595
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000cc
-	.4byte 0x00000e34
-	.4byte ..___tag_value_NucStrstrMake.598-.
-	.4byte ..___tag_value_NucStrstrMake.630-..___tag_value_NucStrstrMake.598
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.599-..___tag_value_NucStrstrMake.598
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.601-..___tag_value_NucStrstrMake.599
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.602-..___tag_value_NucStrstrMake.601
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.603-..___tag_value_NucStrstrMake.602
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.604-..___tag_value_NucStrstrMake.603
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.605-..___tag_value_NucStrstrMake.604
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.606-..___tag_value_NucStrstrMake.605
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.607-..___tag_value_NucStrstrMake.606
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.608-..___tag_value_NucStrstrMake.607
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.609-..___tag_value_NucStrstrMake.608
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.610-..___tag_value_NucStrstrMake.609
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.615-..___tag_value_NucStrstrMake.610
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.616-..___tag_value_NucStrstrMake.615
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.617-..___tag_value_NucStrstrMake.616
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.618-..___tag_value_NucStrstrMake.617
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.619-..___tag_value_NucStrstrMake.618
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.620-..___tag_value_NucStrstrMake.619
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.625-..___tag_value_NucStrstrMake.620
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.626-..___tag_value_NucStrstrMake.625
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.627-..___tag_value_NucStrstrMake.626
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.628-..___tag_value_NucStrstrMake.627
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.629-..___tag_value_NucStrstrMake.628
-	.byte 0x09
-	.2byte 0x0606
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000144
-	.4byte 0x00000f04
-	.4byte ..___tag_value_nss_expr.631-.
-	.4byte ..___tag_value_nss_expr.684-..___tag_value_nss_expr.631
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.632-..___tag_value_nss_expr.631
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.634-..___tag_value_nss_expr.632
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.635-..___tag_value_nss_expr.634
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.636-..___tag_value_nss_expr.635
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.637-..___tag_value_nss_expr.636
-	.byte 0x83
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.638-..___tag_value_nss_expr.637
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.639-..___tag_value_nss_expr.638
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.640-..___tag_value_nss_expr.639
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.641-..___tag_value_nss_expr.640
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.642-..___tag_value_nss_expr.641
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.643-..___tag_value_nss_expr.642
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.644-..___tag_value_nss_expr.643
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.645-..___tag_value_nss_expr.644
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.651-..___tag_value_nss_expr.645
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.652-..___tag_value_nss_expr.651
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.653-..___tag_value_nss_expr.652
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.654-..___tag_value_nss_expr.653
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.655-..___tag_value_nss_expr.654
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.656-..___tag_value_nss_expr.655
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.657-..___tag_value_nss_expr.656
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.663-..___tag_value_nss_expr.657
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.665-..___tag_value_nss_expr.663
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.666-..___tag_value_nss_expr.665
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.667-..___tag_value_nss_expr.666
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.668-..___tag_value_nss_expr.667
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.669-..___tag_value_nss_expr.668
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.670-..___tag_value_nss_expr.669
-	.byte 0x83
-	.byte 0x08
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.675-..___tag_value_nss_expr.670
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.676-..___tag_value_nss_expr.675
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.677-..___tag_value_nss_expr.676
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.678-..___tag_value_nss_expr.677
-	.byte 0x8f
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.679-..___tag_value_nss_expr.678
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.680-..___tag_value_nss_expr.679
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.681-..___tag_value_nss_expr.680
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.682-..___tag_value_nss_expr.681
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.683-..___tag_value_nss_expr.682
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000bc
-	.4byte 0x0000104c
-	.4byte ..___tag_value_nss_unary_expr.685-.
-	.4byte ..___tag_value_nss_unary_expr.717-..___tag_value_nss_unary_expr.685
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.686-..___tag_value_nss_unary_expr.685
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.688-..___tag_value_nss_unary_expr.686
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.689-..___tag_value_nss_unary_expr.688
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.690-..___tag_value_nss_unary_expr.689
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.691-..___tag_value_nss_unary_expr.690
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.692-..___tag_value_nss_unary_expr.691
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.693-..___tag_value_nss_unary_expr.692
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.694-..___tag_value_nss_unary_expr.693
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.695-..___tag_value_nss_unary_expr.694
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.696-..___tag_value_nss_unary_expr.695
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.697-..___tag_value_nss_unary_expr.696
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.698-..___tag_value_nss_unary_expr.697
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.699-..___tag_value_nss_unary_expr.698
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.705-..___tag_value_nss_unary_expr.699
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.706-..___tag_value_nss_unary_expr.705
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.707-..___tag_value_nss_unary_expr.706
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.708-..___tag_value_nss_unary_expr.707
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.709-..___tag_value_nss_unary_expr.708
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.710-..___tag_value_nss_unary_expr.709
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.711-..___tag_value_nss_unary_expr.710
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.4byte 0x00000104
-	.4byte 0x0000110c
-	.4byte ..___tag_value_nss_primary_expr.718-.
-	.4byte ..___tag_value_nss_primary_expr.762-..___tag_value_nss_primary_expr.718
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.719-..___tag_value_nss_primary_expr.718
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.721-..___tag_value_nss_primary_expr.719
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.722-..___tag_value_nss_primary_expr.721
-	.byte 0x8e
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.723-..___tag_value_nss_primary_expr.722
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.724-..___tag_value_nss_primary_expr.723
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.725-..___tag_value_nss_primary_expr.724
-	.byte 0x83
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.726-..___tag_value_nss_primary_expr.725
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.727-..___tag_value_nss_primary_expr.726
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.728-..___tag_value_nss_primary_expr.727
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.729-..___tag_value_nss_primary_expr.728
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.730-..___tag_value_nss_primary_expr.729
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.731-..___tag_value_nss_primary_expr.730
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.732-..___tag_value_nss_primary_expr.731
-	.byte 0x83
-	.byte 0x03
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x06
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.738-..___tag_value_nss_primary_expr.732
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.739-..___tag_value_nss_primary_expr.738
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.740-..___tag_value_nss_primary_expr.739
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.741-..___tag_value_nss_primary_expr.740
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.742-..___tag_value_nss_primary_expr.741
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.743-..___tag_value_nss_primary_expr.742
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.744-..___tag_value_nss_primary_expr.743
-	.byte 0x83
-	.byte 0x03
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x06
-	.byte 0x8f
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.750-..___tag_value_nss_primary_expr.744
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.751-..___tag_value_nss_primary_expr.750
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.752-..___tag_value_nss_primary_expr.751
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.753-..___tag_value_nss_primary_expr.752
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.754-..___tag_value_nss_primary_expr.753
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.755-..___tag_value_nss_primary_expr.754
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_primary_expr.756-..___tag_value_nss_primary_expr.755
-	.byte 0x83
-	.byte 0x03
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x05
-	.byte 0x8e
-	.byte 0x06
-	.byte 0x8f
-	.byte 0x07
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000005c
-	.4byte 0x00001214
-	.4byte ..___tag_value_nss_sob.763-.
-	.4byte ..___tag_value_nss_sob.775-..___tag_value_nss_sob.763
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.764-..___tag_value_nss_sob.763
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.766-..___tag_value_nss_sob.764
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.767-..___tag_value_nss_sob.766
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.768-..___tag_value_nss_sob.767
-	.byte 0x8d
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.769-..___tag_value_nss_sob.768
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.770-..___tag_value_nss_sob.769
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.771-..___tag_value_nss_sob.770
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.772-..___tag_value_nss_sob.771
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.773-..___tag_value_nss_sob.772
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_sob.774-..___tag_value_nss_sob.773
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x000000ac
-	.4byte 0x00001274
-	.4byte ..___tag_value_nss_fasta_expr.776-.
-	.4byte ..___tag_value_nss_fasta_expr.802-..___tag_value_nss_fasta_expr.776
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.777-..___tag_value_nss_fasta_expr.776
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.779-..___tag_value_nss_fasta_expr.777
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.780-..___tag_value_nss_fasta_expr.779
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.781-..___tag_value_nss_fasta_expr.780
-	.byte 0x8d
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.782-..___tag_value_nss_fasta_expr.781
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.783-..___tag_value_nss_fasta_expr.782
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.784-..___tag_value_nss_fasta_expr.783
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.785-..___tag_value_nss_fasta_expr.784
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.786-..___tag_value_nss_fasta_expr.785
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.787-..___tag_value_nss_fasta_expr.786
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.788-..___tag_value_nss_fasta_expr.787
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.789-..___tag_value_nss_fasta_expr.788
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.790-..___tag_value_nss_fasta_expr.789
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x07
-	.byte 0x8d
-	.byte 0x08
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.796-..___tag_value_nss_fasta_expr.790
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.797-..___tag_value_nss_fasta_expr.796
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.798-..___tag_value_nss_fasta_expr.797
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.799-..___tag_value_nss_fasta_expr.798
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.800-..___tag_value_nss_fasta_expr.799
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.801-..___tag_value_nss_fasta_expr.800
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x00
-	.4byte 0x0000007c
-	.4byte 0x00001324
-	.4byte ..___tag_value_nss_FASTA_expr.803-.
-	.4byte ..___tag_value_nss_FASTA_expr.823-..___tag_value_nss_FASTA_expr.803
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.804-..___tag_value_nss_FASTA_expr.803
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.806-..___tag_value_nss_FASTA_expr.804
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.807-..___tag_value_nss_FASTA_expr.806
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.808-..___tag_value_nss_FASTA_expr.807
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.809-..___tag_value_nss_FASTA_expr.808
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.810-..___tag_value_nss_FASTA_expr.809
-	.byte 0x83
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.811-..___tag_value_nss_FASTA_expr.810
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.812-..___tag_value_nss_FASTA_expr.811
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.813-..___tag_value_nss_FASTA_expr.812
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.814-..___tag_value_nss_FASTA_expr.813
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.815-..___tag_value_nss_FASTA_expr.814
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.816-..___tag_value_nss_FASTA_expr.815
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_FASTA_expr.817-..___tag_value_nss_FASTA_expr.816
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x06
-	.byte 0x8e
-	.byte 0x07
-	.byte 0x8f
-	.byte 0x08
-	.byte 0x00
-	.4byte 0x000000ec
-	.4byte 0x000013a4
-	.4byte ..___tag_value_NucStrFastaExprMake2.824-.
-	.4byte ..___tag_value_NucStrFastaExprMake2.862-..___tag_value_NucStrFastaExprMake2.824
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.825-..___tag_value_NucStrFastaExprMake2.824
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.827-..___tag_value_NucStrFastaExprMake2.825
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.828-..___tag_value_NucStrFastaExprMake2.827
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.829-..___tag_value_NucStrFastaExprMake2.828
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.830-..___tag_value_NucStrFastaExprMake2.829
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.831-..___tag_value_NucStrFastaExprMake2.830
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.832-..___tag_value_NucStrFastaExprMake2.831
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.833-..___tag_value_NucStrFastaExprMake2.832
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.834-..___tag_value_NucStrFastaExprMake2.833
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.835-..___tag_value_NucStrFastaExprMake2.834
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.836-..___tag_value_NucStrFastaExprMake2.835
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.837-..___tag_value_NucStrFastaExprMake2.836
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.838-..___tag_value_NucStrFastaExprMake2.837
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.844-..___tag_value_NucStrFastaExprMake2.838
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.845-..___tag_value_NucStrFastaExprMake2.844
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.846-..___tag_value_NucStrFastaExprMake2.845
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.847-..___tag_value_NucStrFastaExprMake2.846
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.848-..___tag_value_NucStrFastaExprMake2.847
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.849-..___tag_value_NucStrFastaExprMake2.848
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.850-..___tag_value_NucStrFastaExprMake2.849
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x8e
-	.byte 0x08
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.856-..___tag_value_NucStrFastaExprMake2.850
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.857-..___tag_value_NucStrFastaExprMake2.856
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.858-..___tag_value_NucStrFastaExprMake2.857
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.859-..___tag_value_NucStrFastaExprMake2.858
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.860-..___tag_value_NucStrFastaExprMake2.859
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.861-..___tag_value_NucStrFastaExprMake2.860
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000044
-	.4byte 0x00001494
-	.4byte ..___tag_value_uint128_bswap_copy.863-.
-	.4byte ..___tag_value_uint128_bswap_copy.871-..___tag_value_uint128_bswap_copy.863
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.864-..___tag_value_uint128_bswap_copy.863
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.866-..___tag_value_uint128_bswap_copy.864
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.867-..___tag_value_uint128_bswap_copy.866
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.868-..___tag_value_uint128_bswap_copy.867
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.869-..___tag_value_uint128_bswap_copy.868
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap_copy.870-..___tag_value_uint128_bswap_copy.869
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000044
-	.4byte 0x000014dc
-	.4byte ..___tag_value_uint128_shr.872-.
-	.4byte ..___tag_value_uint128_shr.880-..___tag_value_uint128_shr.872
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.873-..___tag_value_uint128_shr.872
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.875-..___tag_value_uint128_shr.873
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.876-..___tag_value_uint128_shr.875
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.877-..___tag_value_uint128_shr.876
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.878-..___tag_value_uint128_shr.877
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_uint128_shr.879-..___tag_value_uint128_shr.878
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x00001524
-	.4byte ..___tag_value_uint128_bswap.881-.
-	.4byte ..___tag_value_uint128_bswap.887-..___tag_value_uint128_bswap.881
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.882-..___tag_value_uint128_bswap.881
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.884-..___tag_value_uint128_bswap.882
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.885-..___tag_value_uint128_bswap.884
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_uint128_bswap.886-..___tag_value_uint128_bswap.885
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x00000034
-	.4byte 0x0000155c
-	.4byte ..___tag_value_NucStrFastaExprAlloc.888-.
-	.4byte ..___tag_value_NucStrFastaExprAlloc.894-..___tag_value_NucStrFastaExprAlloc.888
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.889-..___tag_value_NucStrFastaExprAlloc.888
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.891-..___tag_value_NucStrFastaExprAlloc.889
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.892-..___tag_value_NucStrFastaExprAlloc.891
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprAlloc.893-..___tag_value_NucStrFastaExprAlloc.892
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x000000ec
-	.4byte 0x00001594
-	.4byte ..___tag_value_NucStrFastaExprMake4.895-.
-	.4byte ..___tag_value_NucStrFastaExprMake4.933-..___tag_value_NucStrFastaExprMake4.895
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.896-..___tag_value_NucStrFastaExprMake4.895
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.898-..___tag_value_NucStrFastaExprMake4.896
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.899-..___tag_value_NucStrFastaExprMake4.898
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.900-..___tag_value_NucStrFastaExprMake4.899
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.901-..___tag_value_NucStrFastaExprMake4.900
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.902-..___tag_value_NucStrFastaExprMake4.901
-	.byte 0x83
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.903-..___tag_value_NucStrFastaExprMake4.902
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.904-..___tag_value_NucStrFastaExprMake4.903
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.905-..___tag_value_NucStrFastaExprMake4.904
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.906-..___tag_value_NucStrFastaExprMake4.905
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.907-..___tag_value_NucStrFastaExprMake4.906
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.908-..___tag_value_NucStrFastaExprMake4.907
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.909-..___tag_value_NucStrFastaExprMake4.908
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.915-..___tag_value_NucStrFastaExprMake4.909
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.916-..___tag_value_NucStrFastaExprMake4.915
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.917-..___tag_value_NucStrFastaExprMake4.916
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.918-..___tag_value_NucStrFastaExprMake4.917
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.919-..___tag_value_NucStrFastaExprMake4.918
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.920-..___tag_value_NucStrFastaExprMake4.919
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.921-..___tag_value_NucStrFastaExprMake4.920
-	.byte 0x83
-	.byte 0x06
-	.byte 0x86
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x08
-	.byte 0x8d
-	.byte 0x07
-	.byte 0x8e
-	.byte 0x04
-	.byte 0x8f
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.927-..___tag_value_NucStrFastaExprMake4.921
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.928-..___tag_value_NucStrFastaExprMake4.927
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.929-..___tag_value_NucStrFastaExprMake4.928
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.930-..___tag_value_NucStrFastaExprMake4.929
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.931-..___tag_value_NucStrFastaExprMake4.930
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.932-..___tag_value_NucStrFastaExprMake4.931
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000034
-	.4byte 0x00001684
-	.4byte ..___tag_value_NucStrstrWhack.934-.
-	.4byte ..___tag_value_NucStrstrWhack.940-..___tag_value_NucStrstrWhack.934
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.935-..___tag_value_NucStrstrWhack.934
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.937-..___tag_value_NucStrstrWhack.935
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.938-..___tag_value_NucStrstrWhack.937
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.939-..___tag_value_NucStrstrWhack.938
-	.byte 0x09
-	.2byte 0x0606
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x0000004c
-	.4byte 0x000016bc
-	.4byte ..___tag_value_NucStrstrInit.941-.
-	.4byte ..___tag_value_NucStrstrInit.951-..___tag_value_NucStrstrInit.941
-	.byte 0x00
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.942-..___tag_value_NucStrstrInit.941
-	.byte 0x0c
-	.2byte 0x1006
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.944-..___tag_value_NucStrstrInit.942
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.945-..___tag_value_NucStrstrInit.944
-	.byte 0x8c
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.946-..___tag_value_NucStrstrInit.945
-	.byte 0x83
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.947-..___tag_value_NucStrstrInit.946
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.948-..___tag_value_NucStrstrInit.947
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.949-..___tag_value_NucStrstrInit.948
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrInit.950-..___tag_value_NucStrstrInit.949
-	.byte 0x09
-	.2byte 0x0606
-	.section .text
-.LNDBG_TXe:
-# End
diff --git a/libs/search/nucstrstr-icc-x86_64-rel.pic.s b/libs/search/nucstrstr-icc-x86_64-rel.pic.s
deleted file mode 100644
index a133692..0000000
--- a/libs/search/nucstrstr-icc-x86_64-rel.pic.s
+++ /dev/null
@@ -1,9908 +0,0 @@
-# -- Machine type EFI2
-# mark_description "Intel(R) C++ Compiler Professional for applications running on Intel(R) 64, Version 11.0    Build 20090131 %";
-# mark_description "s";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/sra/search/linux -I/home/yaschenk/devel/internal/asm-trace/sra/sea";
-# mark_description "rch/unix -I/home/yaschenk/devel/internal/asm-trace/sra/search -I/home/yaschenk/devel/internal/asm-trace/itf ";
-# mark_description "-I/home/yaschenk/devel/internal/asm-trace/inc/icc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/icc -";
-# mark_description "I/home/yaschenk/devel/internal/asm-trace/inc/gcc/x86_64 -I/home/yaschenk/devel/internal/asm-trace/inc/gcc -I";
-# mark_description "/home/yaschenk/devel/internal/asm-trace/inc/linux -I/home/yaschenk/devel/internal/asm-trace/inc/unix -I/home";
-# mark_description "/yaschenk/devel/internal/asm-trace/inc -c -S -o nucstrstr.pic.s -fPIC -O3 -unroll -xW -DNDEBUG -DLINUX -DUNI";
-# mark_description "X -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MD";
-	.file "nucstrstr.c"
-	.text
-..TXTST0:
-# -- Begin  NucStrstrSearch
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrSearch
-NucStrstrSearch:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-# parameter 5: %r8
-..B1.1:                         # Preds ..B1.0
-..___tag_value_NucStrstrSearch.1:                               #5217.1
-        pushq     %rbx                                          #5217.1
-..___tag_value_NucStrstrSearch.3:                               #
-        subq      $32, %rsp                                     #5217.1
-..___tag_value_NucStrstrSearch.5:                               #
-        movq      %rdi, %rbx                                    #5217.1
-        testq     %rbx, %rbx                                    #5218.18
-        je        ..B1.107      # Prob 6%                       #5218.18
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.2:                         # Preds ..B1.1
-        testq     %rsi, %rsi                                    #5218.37
-        je        ..B1.107      # Prob 6%                       #5218.37
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.4:                         # Preds ..B1.2 ..B1.14 ..B1.17
-        testl     %ecx, %ecx                                    #5218.52
-        je        ..B1.107      # Prob 28%                      #5218.52
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.6:                         # Preds ..B1.4
-        movq      %r12, 24(%rsp)                                #
-..___tag_value_NucStrstrSearch.6:                               #
-        movq      %rsi, %r12                                    #
-        movq      %r13, 16(%rsp)                                #
-..___tag_value_NucStrstrSearch.7:                               #
-        movq      %r14, 8(%rsp)                                 #
-..___tag_value_NucStrstrSearch.8:                               #
-        movq      %r15, (%rsp)                                  #
-..___tag_value_NucStrstrSearch.9:                               #
-        movl      %edx, %r13d                                   #
-        movl      %ecx, %r14d                                   #
-        movq      %r8, %r15                                     #
-                                # LOE rbx rbp r12 r15 r13d r14d
-..B1.7:                         # Preds ..B1.31 ..B1.6
-        movl      (%rbx), %eax                                  #5223.18
-        cmpl      $12, %eax                                     #5223.9
-        ja        ..B1.32       # Prob 28%                      #5223.9
-                                # LOE rbx rbp r12 r15 eax r13d r14d
-..B1.8:                         # Preds ..B1.7
-        movl      %eax, %eax                                    #5223.9
-        lea       ..1..TPKT.30_0.0.1(%rip), %rdi                #5223.9
-        movq      (%rdi,%rax,8), %r9                            #5223.9
-        jmp       *%r9                                          #5223.9
-                                # LOE rbx rbp r12 r15 r13d r14d
-..1.30_0.TAG.0c.0.1:
-..B1.9:                         # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.10:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.11:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.12:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.13:                              #
-..___tag_value_NucStrstrSearch.14:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.10:                        # Preds ..B1.9
-        movl      4(%rbx), %eax                                 #5286.22
-        testl     %eax, %eax                                    #5286.22
-        je        ..B1.20       # Prob 20%                      #5286.22
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.11:                        # Preds ..B1.10
-        cmpl      $13, %eax                                     #5286.22
-        je        ..B1.20       # Prob 25%                      #5286.22
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.12:                        # Preds ..B1.11
-        cmpl      $14, %eax                                     #5286.22
-        jne       ..B1.15       # Prob 67%                      #5286.22
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.13:                        # Preds ..B1.12
-        movq      8(%rbx), %rbx                                 #5297.29
-        movl      4(%rbx), %eax                                 #5297.29
-        cmpl      %ecx, %eax                                    #5298.34
-        ja        ..B1.107      # Prob 12%                      #5298.34
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx
-..B1.14:                        # Preds ..B1.13
-        movl      %eax, %ecx                                    #5297.17
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.4        # Prob 94%                      #5218.18
-        jmp       ..B1.107      # Prob 100%                     #5218.18
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.15:                        # Preds ..B1.12
-        cmpl      $15, %eax                                     #5286.22
-        jne       ..B1.107      # Prob 50%                      #5286.22
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.16:                        # Preds ..B1.15
-        movq      8(%rbx), %rbx                                 #5302.29
-        movl      4(%rbx), %eax                                 #5302.29
-        cmpl      %ecx, %eax                                    #5303.34
-        ja        ..B1.107      # Prob 12%                      #5303.34
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.17:                        # Preds ..B1.16
-        addl      %ecx, %edx                                    #5306.27
-        subl      %eax, %edx                                    #5306.33
-        movl      %eax, %ecx                                    #5302.17
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.4        # Prob 94%                      #5218.18
-        jmp       ..B1.107      # Prob 100%                     #5218.18
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.20:                        # Preds ..B1.10 ..B1.11
-        movq      8(%rbx), %rdi                                 #5290.25
-        call      NucStrstrSearch at PLT                           #5290.25
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B1.21:                        # Preds ..B1.20
-        movl      4(%rbx), %edx                                 #5291.22
-        testl     %edx, %edx                                    #5291.42
-        je        ..B1.56       # Prob 28%                      #5291.42
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.22:                        # Preds ..B1.21
-        testl     %eax, %eax                                    #5293.31
-        jne       ..B1.107      # Prob 50%                      #5293.31
-                                # LOE rbp r12 r13 r14 r15
-..B1.23:                        # Preds ..B1.22
-        movl      $1, %eax                                      #5294.28
-        addq      $32, %rsp                                     #5294.28
-..___tag_value_NucStrstrSearch.18:                              #
-        popq      %rbx                                          #5294.28
-..___tag_value_NucStrstrSearch.20:                              #
-        ret                                                     #5294.28
-..___tag_value_NucStrstrSearch.21:                              #
-                                # LOE
-..1.30_0.TAG.0b.0.1:
-..B1.26:                        # Preds ..B1.8
-        movq      8(%rbx), %rdi                                 #5272.21
-        movq      %r12, %rsi                                    #5272.21
-        movl      %r13d, %edx                                   #5272.21
-        movl      %r14d, %ecx                                   #5272.21
-        movq      %r15, %r8                                     #5272.21
-        call      NucStrstrSearch at PLT                           #5272.21
-                                # LOE rbx rbp r12 r15 eax r13d r14d
-..B1.27:                        # Preds ..B1.26
-        movl      4(%rbx), %edi                                 #5273.22
-        cmpl      $17, %edi                                     #5273.22
-        jne       ..B1.29       # Prob 67%                      #5273.22
-                                # LOE rbx rbp r12 r15 eax edi r13d r14d
-..B1.28:                        # Preds ..B1.27
-        testl     %eax, %eax                                    #5276.31
-        jne       ..B1.111      # Prob 12%                      #5276.31
-        jmp       ..B1.31       # Prob 100%                     #5276.31
-                                # LOE rbx rbp r12 r15 eax r13d r14d
-..B1.29:                        # Preds ..B1.27
-        cmpl      $16, %edi                                     #5273.22
-        jne       ..B1.31       # Prob 50%                      #5273.22
-                                # LOE rbx rbp r12 r15 eax r13d r14d
-..B1.30:                        # Preds ..B1.29
-        testl     %eax, %eax                                    #5280.31
-        je        ..B1.111      # Prob 12%                      #5280.31
-                                # LOE rbx rbp r12 r15 eax r13d r14d
-..B1.31:                        # Preds ..B1.28 ..B1.30 ..B1.29
-        movq      16(%rbx), %rbx                                #5284.38
-        testq     %rbx, %rbx                                    #5218.18
-        jne       ..B1.7        # Prob 94%                      #5218.18
-                                # LOE rbx rbp r12 r15 r13d r14d
-..B1.32:                        # Preds ..B1.7 ..B1.31
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.23:                              #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.24:                              #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.25:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.26:                              #
-        jmp       ..B1.107      # Prob 100%                     #
-..___tag_value_NucStrstrSearch.27:                              #
-                                # LOE rbp r12 r13 r14 r15
-..1.30_0.TAG.0a.0.1:
-..B1.33:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.31:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.32:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.33:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.34:                              #
-..___tag_value_NucStrstrSearch.35:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.34:                        # Preds ..B1.33
-        movl      4(%rbx), %eax                                 #5268.24
-        cmpl      %eax, %ecx                                    #5268.24
-        jb        ..B1.107      # Prob 28%                      #5268.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.35:                        # Preds ..B1.34
-        testq     %r8, %r8                                      #5269.9
-        je        ..B1.37       # Prob 12%                      #5269.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.36:                        # Preds ..B1.35
-        movl      %eax, (%r8)                                   #5269.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.37:                        # Preds ..B1.35 ..B1.36
-        movq      %rbx, %rdi                                    #5270.20
-        call      eval_4na_pos at PLT                              #5270.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.119:                       # Preds ..B1.37
-        addq      $32, %rsp                                     #5270.20
-..___tag_value_NucStrstrSearch.39:                              #
-        popq      %rbx                                          #5270.20
-..___tag_value_NucStrstrSearch.41:                              #
-        ret                                                     #5270.20
-..___tag_value_NucStrstrSearch.42:                              #
-                                # LOE
-..1.30_0.TAG.09.0.1:
-..B1.39:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.44:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.45:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.46:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.47:                              #
-..___tag_value_NucStrstrSearch.48:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.40:                        # Preds ..B1.39
-        movl      4(%rbx), %eax                                 #5264.24
-        cmpl      %eax, %ecx                                    #5264.24
-        jb        ..B1.107      # Prob 28%                      #5264.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.41:                        # Preds ..B1.40
-        testq     %r8, %r8                                      #5265.9
-        je        ..B1.43       # Prob 12%                      #5265.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.42:                        # Preds ..B1.41
-        movl      %eax, (%r8)                                   #5265.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.43:                        # Preds ..B1.41 ..B1.42
-        movq      %rbx, %rdi                                    #5266.20
-        call      eval_2na_pos at PLT                              #5266.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.120:                       # Preds ..B1.43
-        addq      $32, %rsp                                     #5266.20
-..___tag_value_NucStrstrSearch.52:                              #
-        popq      %rbx                                          #5266.20
-..___tag_value_NucStrstrSearch.54:                              #
-        ret                                                     #5266.20
-..___tag_value_NucStrstrSearch.55:                              #
-                                # LOE
-..1.30_0.TAG.08.0.1:
-..B1.45:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.57:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.58:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.59:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.60:                              #
-..___tag_value_NucStrstrSearch.61:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.46:                        # Preds ..B1.45
-        movl      4(%rbx), %eax                                 #5259.24
-        cmpl      %eax, %ecx                                    #5259.24
-        jb        ..B1.107      # Prob 28%                      #5259.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.47:                        # Preds ..B1.46
-        testq     %r8, %r8                                      #5260.9
-        je        ..B1.49       # Prob 12%                      #5260.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.48:                        # Preds ..B1.47
-        movl      %eax, (%r8)                                   #5260.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.49:                        # Preds ..B1.47 ..B1.48
-        movq      %rbx, %rdi                                    #5261.20
-        call      eval_4na_128 at PLT                              #5261.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.121:                       # Preds ..B1.49
-        addq      $32, %rsp                                     #5261.20
-..___tag_value_NucStrstrSearch.65:                              #
-        popq      %rbx                                          #5261.20
-..___tag_value_NucStrstrSearch.67:                              #
-        ret                                                     #5261.20
-..___tag_value_NucStrstrSearch.68:                              #
-                                # LOE
-..1.30_0.TAG.07.0.1:
-..B1.51:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.70:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.71:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.72:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.73:                              #
-..___tag_value_NucStrstrSearch.74:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.52:                        # Preds ..B1.51
-        movl      4(%rbx), %eax                                 #5255.24
-        cmpl      %eax, %ecx                                    #5255.24
-        jb        ..B1.107      # Prob 28%                      #5255.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.53:                        # Preds ..B1.52
-        testq     %r8, %r8                                      #5256.9
-        je        ..B1.55       # Prob 12%                      #5256.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.54:                        # Preds ..B1.53
-        movl      %eax, (%r8)                                   #5256.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.55:                        # Preds ..B1.53 ..B1.54
-        movq      %rbx, %rdi                                    #5257.20
-        call      eval_4na_32 at PLT                               #5257.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.56:                        # Preds ..B1.21 ..B1.55
-        addq      $32, %rsp                                     #5257.20
-..___tag_value_NucStrstrSearch.78:                              #
-        popq      %rbx                                          #5257.20
-..___tag_value_NucStrstrSearch.80:                              #
-        ret                                                     #5257.20
-..___tag_value_NucStrstrSearch.81:                              #
-                                # LOE
-..1.30_0.TAG.06.0.1:
-..B1.58:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.83:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.84:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.85:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.86:                              #
-..___tag_value_NucStrstrSearch.87:                              #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.59:                        # Preds ..B1.58
-        movl      4(%rbx), %eax                                 #5251.24
-        cmpl      %eax, %ecx                                    #5251.24
-        jb        ..B1.107      # Prob 28%                      #5251.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.60:                        # Preds ..B1.59
-        testq     %r8, %r8                                      #5252.9
-        je        ..B1.62       # Prob 12%                      #5252.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.61:                        # Preds ..B1.60
-        movl      %eax, (%r8)                                   #5252.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.62:                        # Preds ..B1.60 ..B1.61
-        movq      %rbx, %rdi                                    #5253.20
-        call      eval_4na_16 at PLT                               #5253.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.63:                        # Preds ..B1.62
-        addq      $32, %rsp                                     #5253.20
-..___tag_value_NucStrstrSearch.91:                              #
-        popq      %rbx                                          #5253.20
-..___tag_value_NucStrstrSearch.93:                              #
-        ret                                                     #5253.20
-..___tag_value_NucStrstrSearch.94:                              #
-                                # LOE
-..1.30_0.TAG.05.0.1:
-..B1.65:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.96:                              #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.97:                              #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.98:                              #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.99:                              #
-..___tag_value_NucStrstrSearch.100:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.66:                        # Preds ..B1.65
-        movl      4(%rbx), %eax                                 #5247.24
-        cmpl      %eax, %ecx                                    #5247.24
-        jb        ..B1.107      # Prob 28%                      #5247.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.67:                        # Preds ..B1.66
-        testq     %r8, %r8                                      #5248.9
-        je        ..B1.69       # Prob 12%                      #5248.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.68:                        # Preds ..B1.67
-        movl      %eax, (%r8)                                   #5248.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.69:                        # Preds ..B1.67 ..B1.68
-        movq      %rbx, %rdi                                    #5249.20
-        call      eval_2na_128 at PLT                              #5249.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.124:                       # Preds ..B1.69
-        addq      $32, %rsp                                     #5249.20
-..___tag_value_NucStrstrSearch.104:                             #
-        popq      %rbx                                          #5249.20
-..___tag_value_NucStrstrSearch.106:                             #
-        ret                                                     #5249.20
-..___tag_value_NucStrstrSearch.107:                             #
-                                # LOE
-..1.30_0.TAG.04.0.1:
-..B1.71:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.109:                             #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.110:                             #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.111:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.112:                             #
-..___tag_value_NucStrstrSearch.113:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.72:                        # Preds ..B1.71
-        movl      4(%rbx), %eax                                 #5243.24
-        cmpl      %eax, %ecx                                    #5243.24
-        jb        ..B1.107      # Prob 28%                      #5243.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.73:                        # Preds ..B1.72
-        testq     %r8, %r8                                      #5244.9
-        je        ..B1.75       # Prob 12%                      #5244.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.74:                        # Preds ..B1.73
-        movl      %eax, (%r8)                                   #5244.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.75:                        # Preds ..B1.73 ..B1.74
-        movq      %rbx, %rdi                                    #5245.20
-        call      eval_2na_32 at PLT                               #5245.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.76:                        # Preds ..B1.75
-        addq      $32, %rsp                                     #5245.20
-..___tag_value_NucStrstrSearch.117:                             #
-        popq      %rbx                                          #5245.20
-..___tag_value_NucStrstrSearch.119:                             #
-        ret                                                     #5245.20
-..___tag_value_NucStrstrSearch.120:                             #
-                                # LOE
-..1.30_0.TAG.03.0.1:
-..B1.78:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.122:                             #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.123:                             #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.124:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.125:                             #
-..___tag_value_NucStrstrSearch.126:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.79:                        # Preds ..B1.78
-        movl      4(%rbx), %eax                                 #5239.24
-        cmpl      %eax, %ecx                                    #5239.24
-        jb        ..B1.107      # Prob 28%                      #5239.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.80:                        # Preds ..B1.79
-        testq     %r8, %r8                                      #5240.9
-        je        ..B1.82       # Prob 12%                      #5240.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.81:                        # Preds ..B1.80
-        movl      %eax, (%r8)                                   #5240.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.82:                        # Preds ..B1.80 ..B1.81
-        movq      %rbx, %rdi                                    #5241.20
-        call      eval_2na_16 at PLT                               #5241.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.83:                        # Preds ..B1.82
-        addq      $32, %rsp                                     #5241.20
-..___tag_value_NucStrstrSearch.130:                             #
-        popq      %rbx                                          #5241.20
-..___tag_value_NucStrstrSearch.132:                             #
-        ret                                                     #5241.20
-..___tag_value_NucStrstrSearch.133:                             #
-                                # LOE
-..1.30_0.TAG.02.0.1:
-..B1.85:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.135:                             #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.136:                             #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.137:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.138:                             #
-..___tag_value_NucStrstrSearch.139:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.86:                        # Preds ..B1.85
-        movl      4(%rbx), %eax                                 #5235.24
-        cmpl      %eax, %ecx                                    #5235.24
-        jb        ..B1.107      # Prob 28%                      #5235.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.87:                        # Preds ..B1.86
-        testq     %r8, %r8                                      #5236.9
-        je        ..B1.89       # Prob 12%                      #5236.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.88:                        # Preds ..B1.87
-        movl      %eax, (%r8)                                   #5236.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.89:                        # Preds ..B1.87 ..B1.88
-        movq      %rbx, %rdi                                    #5237.20
-        call      eval_2na_8 at PLT                                #5237.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.90:                        # Preds ..B1.89
-        addq      $32, %rsp                                     #5237.20
-..___tag_value_NucStrstrSearch.143:                             #
-        popq      %rbx                                          #5237.20
-..___tag_value_NucStrstrSearch.145:                             #
-        ret                                                     #5237.20
-..___tag_value_NucStrstrSearch.146:                             #
-                                # LOE
-..1.30_0.TAG.01.0.1:
-..B1.92:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.148:                             #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.149:                             #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.150:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.151:                             #
-..___tag_value_NucStrstrSearch.152:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.93:                        # Preds ..B1.92
-        movl      4(%rbx), %eax                                 #5230.24
-        cmpl      %eax, %ecx                                    #5230.24
-        jb        ..B1.107      # Prob 28%                      #5230.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.94:                        # Preds ..B1.93
-        testq     %r8, %r8                                      #5231.9
-        je        ..B1.96       # Prob 12%                      #5231.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.95:                        # Preds ..B1.94
-        movl      %eax, (%r8)                                   #5231.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.96:                        # Preds ..B1.94 ..B1.95
-        movq      %rbx, %rdi                                    #5232.20
-        call      eval_4na_64 at PLT                               #5232.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.97:                        # Preds ..B1.96
-        addq      $32, %rsp                                     #5232.20
-..___tag_value_NucStrstrSearch.156:                             #
-        popq      %rbx                                          #5232.20
-..___tag_value_NucStrstrSearch.158:                             #
-        ret                                                     #5232.20
-..___tag_value_NucStrstrSearch.159:                             #
-                                # LOE
-..1.30_0.TAG.00.0.1:
-..B1.99:                        # Preds ..B1.8
-        movq      %r12, %rsi                                    #
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.161:                             #
-        movl      %r13d, %edx                                   #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.162:                             #
-        movl      %r14d, %ecx                                   #
-        movq      %r15, %r8                                     #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.163:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.164:                             #
-..___tag_value_NucStrstrSearch.165:                             #
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 edx ecx
-..B1.100:                       # Preds ..B1.99
-        movl      4(%rbx), %eax                                 #5226.24
-        cmpl      %eax, %ecx                                    #5226.24
-        jb        ..B1.107      # Prob 28%                      #5226.24
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.101:                       # Preds ..B1.100
-        testq     %r8, %r8                                      #5227.9
-        je        ..B1.103      # Prob 12%                      #5227.9
-                                # LOE rbx rbp rsi r8 r12 r13 r14 r15 eax edx ecx
-..B1.102:                       # Preds ..B1.101
-        movl      %eax, (%r8)                                   #5227.18
-                                # LOE rbx rbp rsi r12 r13 r14 r15 edx ecx
-..B1.103:                       # Preds ..B1.101 ..B1.102
-        movq      %rbx, %rdi                                    #5228.20
-        call      eval_2na_64 at PLT                               #5228.20
-                                # LOE rbp r12 r13 r14 r15 eax
-..B1.104:                       # Preds ..B1.103
-        addq      $32, %rsp                                     #5228.20
-..___tag_value_NucStrstrSearch.169:                             #
-        popq      %rbx                                          #5228.20
-..___tag_value_NucStrstrSearch.171:                             #
-        ret                                                     #5228.20
-..___tag_value_NucStrstrSearch.172:                             #
-                                # LOE
-..B1.107:                       # Preds ..B1.13 ..B1.16 ..B1.17 ..B1.14 ..B1.15
-                                #       ..B1.4 ..B1.100 ..B1.93 ..B1.86 ..B1.79
-                                #       ..B1.72 ..B1.66 ..B1.59 ..B1.52 ..B1.46
-                                #       ..B1.40 ..B1.34 ..B1.32 ..B1.22 ..B1.2
-                                #       ..B1.1
-        xorl      %eax, %eax                                    #5311.12
-        addq      $32, %rsp                                     #5311.12
-..___tag_value_NucStrstrSearch.178:                             #
-        popq      %rbx                                          #5311.12
-..___tag_value_NucStrstrSearch.180:                             #
-        ret                                                     #5311.12
-..___tag_value_NucStrstrSearch.181:                             #
-                                # LOE
-..B1.111:                       # Preds ..B1.28 ..B1.30         # Infreq
-        movq      24(%rsp), %r12                                #
-..___tag_value_NucStrstrSearch.187:                             #
-        movq      16(%rsp), %r13                                #
-..___tag_value_NucStrstrSearch.188:                             #
-        movq      8(%rsp), %r14                                 #
-..___tag_value_NucStrstrSearch.189:                             #
-        movq      (%rsp), %r15                                  #
-..___tag_value_NucStrstrSearch.190:                             #
-        addq      $32, %rsp                                     #5281.28
-..___tag_value_NucStrstrSearch.191:                             #
-        popq      %rbx                                          #5281.28
-..___tag_value_NucStrstrSearch.193:                             #
-        ret                                                     #5281.28
-        .align    16,0x90
-..___tag_value_NucStrstrSearch.194:                             #
-                                # LOE
-# mark_end;
-	.type	NucStrstrSearch, at function
-	.size	NucStrstrSearch,.-NucStrstrSearch
-	.section .data1, "wa"
-	.align 32
-	.align 32
-..1..TPKT.30_0.0.1:
-	.quad	..1.30_0.TAG.00.0.1
-	.quad	..1.30_0.TAG.01.0.1
-	.quad	..1.30_0.TAG.02.0.1
-	.quad	..1.30_0.TAG.03.0.1
-	.quad	..1.30_0.TAG.04.0.1
-	.quad	..1.30_0.TAG.05.0.1
-	.quad	..1.30_0.TAG.06.0.1
-	.quad	..1.30_0.TAG.07.0.1
-	.quad	..1.30_0.TAG.08.0.1
-	.quad	..1.30_0.TAG.09.0.1
-	.quad	..1.30_0.TAG.0a.0.1
-	.quad	..1.30_0.TAG.0b.0.1
-	.quad	..1.30_0.TAG.0c.0.1
-	.data
-# -- End  NucStrstrSearch
-	.text
-# -- Begin  eval_4na_pos
-# mark_begin;
-       .align    16,0x90
-eval_4na_pos:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B2.1:                         # Preds ..B2.0
-..___tag_value_eval_4na_pos.195:                                #4946.1
-        pushq     %r12                                          #4946.1
-..___tag_value_eval_4na_pos.197:                                #
-        pushq     %rbp                                          #4946.1
-..___tag_value_eval_4na_pos.199:                                #
-        pushq     %rbx                                          #4946.1
-..___tag_value_eval_4na_pos.201:                                #
-        movdqa    16(%rdi), %xmm8                               #5009.5
-        movdqa    32(%rdi), %xmm7                               #5009.5
-        movdqa    48(%rdi), %xmm6                               #5009.5
-        movdqa    64(%rdi), %xmm5                               #5009.5
-        movdqa    80(%rdi), %xmm4                               #5009.5
-        movdqa    96(%rdi), %xmm3                               #5009.5
-        movdqa    112(%rdi), %xmm2                              #5009.5
-        movdqa    128(%rdi), %xmm1                              #5009.5
-        lea       (%rdx,%rcx), %ebx                             #4985.5
-        subl      4(%rdi), %ebx                                 #4996.12
-        movl      %edx, %r9d                                    #4946.1
-        movl      %edx, %ebp                                    #4993.49
-        shrl      $2, %ebp                                      #4993.49
-        movzbl    (%rbp,%rsi), %r10d                            #5002.14
-        lea       3(%rdx,%rcx), %r8d                            #4999.50
-        shrl      $2, %r8d                                      #4999.57
-        addq      %rsi, %r8                                     #4999.30
-        lea       expand_2na.0(%rip), %rcx                      #5002.14
-        movzwl    (%rcx,%r10,2), %r11d                          #5002.14
-        movzbl    1(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        movw      %r11w, -16(%rsp)                              #5002.14
-        movl      %ebx, %edi                                    #5014.20
-        xorl      %r11d, %r11d                                  #5012.15
-        movw      %r10w, -14(%rsp)                              #5002.14
-        movzbl    2(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        xorl      %eax, %eax                                    #5012.10
-        subl      %edx, %edi                                    #5014.20
-        movw      %r10w, -12(%rsp)                              #5002.14
-        movzbl    3(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        movw      %r10w, -10(%rsp)                              #5002.14
-        movzbl    4(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        movw      %r10w, -8(%rsp)                               #5002.14
-        movzbl    5(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        addl      $7, %edi                                      #5014.33
-        shrl      $2, %edi                                      #5014.40
-        movw      %r10w, -6(%rsp)                               #5002.14
-        movzbl    6(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %r10d                          #5002.14
-        movw      %r10w, -4(%rsp)                               #5002.14
-        movzbl    7(%rbp,%rsi), %r10d                           #5002.14
-        movzwl    (%rcx,%r10,2), %ecx                           #5002.14
-        movw      %cx, -2(%rsp)                                 #5002.14
-        movdqu    -16(%rsp), %xmm0                              #5002.14
-        lea       8(%rsi,%rbp), %rbp                            #5003.5
-        movq      %rbp, %rcx                                    #5003.5
-        xorl      %r10d, %r10d                                  #5012.5
-        movl      %edx, %esi                                    #5023.20
-        andl      $3, %esi                                      #5023.20
-        je        ..B2.20       # Prob 20%                      #5023.20
-                                # LOE rcx rbp r8 r12 r13 r14 r15 eax edx ebx esi edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.2:                         # Preds ..B2.1
-        cmpl      $1, %esi                                      #5023.20
-        je        ..B2.9        # Prob 25%                      #5023.20
-                                # LOE rcx rbp r8 r12 r13 r14 r15 eax edx ebx esi edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.3:                         # Preds ..B2.2
-        cmpl      $2, %esi                                      #5023.20
-        je        ..B2.10       # Prob 33%                      #5023.20
-                                # LOE rcx rbp r8 r12 r13 r14 r15 eax edx ebx esi edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.4:                         # Preds ..B2.3
-        cmpl      $3, %esi                                      #5023.20
-        je        ..B2.11       # Prob 50%                      #5023.20
-        jmp       ..B2.16       # Prob 100%                     #5023.20
-                                # LOE rcx rbp r8 r12 r13 r14 r15 eax edx ebx edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.9:                         # Preds ..B2.2 ..B2.20
-        movdqa    %xmm0, %xmm10                                 #5047.22
-        movdqa    %xmm0, %xmm9                                  #5048.22
-        pand      %xmm6, %xmm10                                 #5047.22
-        pand      %xmm5, %xmm9                                  #5048.22
-        pcmpeqd   %xmm9, %xmm10                                 #5049.22
-        pmovmskb  %xmm10, %eax                                  #5050.22
-        incl      %eax                                          #5051.17
-        shrl      $16, %eax                                     #5051.17
-        negl      %eax                                          #5051.17
-                                # LOE rcx rbp r8 r13 r14 r15 eax edx ebx edi r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.10:                        # Preds ..B2.3 ..B2.9
-        movdqa    %xmm0, %xmm10                                 #5054.22
-        movdqa    %xmm0, %xmm9                                  #5055.22
-        pand      %xmm4, %xmm10                                 #5054.22
-        pand      %xmm3, %xmm9                                  #5055.22
-        pcmpeqd   %xmm9, %xmm10                                 #5056.22
-        pmovmskb  %xmm10, %r11d                                 #5057.22
-        incl      %r11d                                         #5058.17
-        shrl      $16, %r11d                                    #5058.17
-        negl      %r11d                                         #5058.17
-                                # LOE rcx rbp r8 r13 r14 r15 eax edx ebx edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.11:                        # Preds ..B2.4 ..B2.10
-        movdqa    %xmm0, %xmm10                                 #5061.22
-        movdqa    %xmm0, %xmm9                                  #5062.22
-        andl      $-4, %edx                                     #5069.17
-        pand      %xmm2, %xmm10                                 #5061.22
-        pand      %xmm1, %xmm9                                  #5062.22
-        pcmpeqd   %xmm9, %xmm10                                 #5063.22
-        pmovmskb  %xmm10, %esi                                  #5064.22
-        movl      %r10d, %r12d                                  #5072.29
-        orl       %eax, %r12d                                   #5072.29
-        incl      %esi                                          #5065.17
-        shrl      $16, %esi                                     #5065.17
-        negl      %esi                                          #5065.17
-        orl       %r11d, %r12d                                  #5072.34
-        orl       %esi, %r12d                                   #5072.39
-        jne       ..B2.21       # Prob 20%                      #5072.47
-                                # LOE rcx rbp r8 r13 r14 r15 eax edx ebx esi edi r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.12:                        # Preds ..B2.11
-        addl      $4, %edx                                      #5135.17
-        cmpl      %ebx, %edx                                    #5138.28
-        ja        ..B2.44       # Prob 20%                      #5138.28
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.13:                        # Preds ..B2.12
-        decl      %edi                                          #5142.25
-        jne       ..B2.17       # Prob 50%                      #5142.39
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.14:                        # Preds ..B2.13
-        cmpq      %r8, %rbp                                     #5159.25
-        jae       ..B2.44       # Prob 4%                       #5159.25
-                                # LOE rbp r8 r13 r14 r15 edx ebx r9d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.15:                        # Preds ..B2.14
-        movzbl    (%rbp), %esi                                  #5169.22
-        movzbl    1(%rbp), %r10d                                #5169.22
-        movzbl    2(%rbp), %r12d                                #5169.22
-        lea       expand_2na.0(%rip), %rcx                      #5169.22
-        movzwl    (%rcx,%rsi,2), %edi                           #5169.22
-        movzwl    (%rcx,%r10,2), %r11d                          #5169.22
-        movzwl    (%rcx,%r12,2), %esi                           #5169.22
-        movw      %di, -16(%rsp)                                #5169.22
-        movw      %r11w, -14(%rsp)                              #5169.22
-        movw      %si, -12(%rsp)                                #5169.22
-        movzbl    3(%rbp), %esi                                 #5169.22
-        movzwl    (%rcx,%rsi,2), %esi                           #5169.22
-        movw      %si, -10(%rsp)                                #5169.22
-        movzbl    4(%rbp), %esi                                 #5169.22
-        movzwl    (%rcx,%rsi,2), %esi                           #5169.22
-        movw      %si, -8(%rsp)                                 #5169.22
-        movzbl    5(%rbp), %esi                                 #5169.22
-        movzwl    (%rcx,%rsi,2), %esi                           #5169.22
-        movw      %si, -6(%rsp)                                 #5169.22
-        movzbl    6(%rbp), %esi                                 #5169.22
-        movzwl    (%rcx,%rsi,2), %esi                           #5169.22
-        movw      %si, -4(%rsp)                                 #5169.22
-        movzbl    7(%rbp), %esi                                 #5169.22
-        movzwl    (%rcx,%rsi,2), %ecx                           #5169.22
-        addq      $8, %rbp                                      #5184.13
-        movw      %cx, -2(%rsp)                                 #5169.22
-        movdqu    -16(%rsp), %xmm0                              #5169.22
-        movq      %rbp, %rcx                                    #5184.13
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.16:                        # Preds ..B2.4 ..B2.15
-        movl      $8, %edi                                      #5030.13
-        jmp       ..B2.20       # Prob 100%                     #5030.13
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.17:                        # Preds ..B2.13
-        psrldq    $2, %xmm0                                     #5147.26
-        cmpq      %r8, %rcx                                     #5150.26
-        jae       ..B2.19       # Prob 19%                      #5150.26
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.18:                        # Preds ..B2.17
-        movzbl    (%rcx), %r10d                                 #5151.72
-        lea       expand_2na.0(%rip), %rsi                      #5151.57
-        movzwl    (%rsi,%r10,2), %r11d                          #5151.57
-        pinsrw    $7, %r11d, %xmm0                              #5151.30
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.19:                        # Preds ..B2.18 ..B2.17
-        incq      %rcx                                          #5154.20
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.20:                        # Preds ..B2.1 ..B2.16 ..B2.19
-        movdqa    %xmm0, %xmm10                                 #5040.22
-        movdqa    %xmm0, %xmm9                                  #5041.22
-        pand      %xmm8, %xmm10                                 #5040.22
-        pand      %xmm7, %xmm9                                  #5041.22
-        pcmpeqd   %xmm9, %xmm10                                 #5042.22
-        pmovmskb  %xmm10, %r10d                                 #5043.22
-        incl      %r10d                                         #5044.17
-        shrl      $16, %r10d                                    #5044.17
-        negl      %r10d                                         #5044.17
-        jmp       ..B2.9        # Prob 100%                     #5044.17
-                                # LOE rcx rbp r8 r13 r14 r15 edx ebx edi r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B2.21:                        # Preds ..B2.11                 # Infreq
-        subl      %edx, %ebx                                    #5075.30
-        je        ..B2.42       # Prob 25%                      #5075.37
-                                # LOE r12 r13 r14 r15 eax edx ebx esi r9d r10d r11d
-..B2.22:                        # Preds ..B2.21                 # Infreq
-        cmpl      $1, %ebx                                      #5075.37
-        jne       ..B2.27       # Prob 67%                      #5075.37
-                                # LOE r12 r13 r14 r15 eax edx ebx esi r9d r10d r11d
-..B2.23:                        # Preds ..B2.22                 # Infreq
-        testl     %r10d, %r10d                                  #5081.36
-        jne       ..B2.43       # Prob 28%                      #5081.36
-                                # LOE r12 r13 r14 r15 eax edx r9d
-..B2.24:                        # Preds ..B2.23                 # Infreq
-        testl     %eax, %eax                                    #5082.36
-        je        ..B2.44       # Prob 50%                      #5082.36
-                                # LOE r12 r13 r14 r15 edx r9d
-..B2.25:                        # Preds ..B2.35 ..B2.29 ..B2.24 # Infreq
-        subl      %r9d, %edx                                    #5082.47
-        addl      $2, %edx                                      #5082.61
-        movl      %edx, %eax                                    #5082.61
-..___tag_value_eval_4na_pos.204:                                #5082.61
-        popq      %rbx                                          #5082.61
-..___tag_value_eval_4na_pos.206:                                #
-        popq      %rbp                                          #5082.61
-..___tag_value_eval_4na_pos.208:                                #
-        popq      %r12                                          #5082.61
-..___tag_value_eval_4na_pos.210:                                #
-        ret                                                     #5082.61
-..___tag_value_eval_4na_pos.211:                                #
-                                # LOE
-..B2.27:                        # Preds ..B2.22                 # Infreq
-        cmpl      $2, %ebx                                      #5075.37
-        jne       ..B2.34       # Prob 50%                      #5075.37
-                                # LOE r12 r13 r14 r15 eax edx esi r9d r10d r11d
-..B2.28:                        # Preds ..B2.27                 # Infreq
-        testl     %r10d, %r10d                                  #5085.36
-        jne       ..B2.43       # Prob 28%                      #5085.36
-                                # LOE r12 r13 r14 r15 eax edx r9d r11d
-..B2.29:                        # Preds ..B2.28                 # Infreq
-        testl     %eax, %eax                                    #5086.36
-        jne       ..B2.25       # Prob 28%                      #5086.36
-                                # LOE r12 r13 r14 r15 edx r9d r11d
-..B2.30:                        # Preds ..B2.29                 # Infreq
-        testl     %r11d, %r11d                                  #5087.36
-        je        ..B2.44       # Prob 50%                      #5087.36
-                                # LOE r12 r13 r14 r15 edx r9d
-..B2.31:                        # Preds ..B2.36 ..B2.30         # Infreq
-        subl      %r9d, %edx                                    #5087.47
-        addl      $3, %edx                                      #5087.61
-        movl      %edx, %eax                                    #5087.61
-..___tag_value_eval_4na_pos.215:                                #5087.61
-        popq      %rbx                                          #5087.61
-..___tag_value_eval_4na_pos.217:                                #
-        popq      %rbp                                          #5087.61
-..___tag_value_eval_4na_pos.219:                                #
-        popq      %r12                                          #5087.61
-..___tag_value_eval_4na_pos.221:                                #
-        ret                                                     #5087.61
-..___tag_value_eval_4na_pos.222:                                #
-                                # LOE
-..B2.34:                        # Preds ..B2.27                 # Infreq
-        testl     %r10d, %r10d                                  #5090.36
-        jne       ..B2.43       # Prob 28%                      #5090.36
-                                # LOE r12 r13 r14 r15 eax edx esi r9d r11d
-..B2.35:                        # Preds ..B2.34                 # Infreq
-        testl     %eax, %eax                                    #5091.36
-        jne       ..B2.25       # Prob 28%                      #5091.36
-                                # LOE r12 r13 r14 r15 edx esi r9d r11d
-..B2.36:                        # Preds ..B2.35                 # Infreq
-        testl     %r11d, %r11d                                  #5092.36
-        jne       ..B2.31       # Prob 28%                      #5092.36
-                                # LOE r12 r13 r14 r15 edx esi r9d
-..B2.37:                        # Preds ..B2.36                 # Infreq
-        testl     %esi, %esi                                    #5093.36
-        je        ..B2.44       # Prob 50%                      #5093.36
-                                # LOE r12 r13 r14 r15 edx r9d
-..B2.38:                        # Preds ..B2.37                 # Infreq
-        subl      %r9d, %edx                                    #5093.47
-        addl      $4, %edx                                      #5093.61
-        movl      %edx, %eax                                    #5093.61
-..___tag_value_eval_4na_pos.226:                                #5093.61
-        popq      %rbx                                          #5093.61
-..___tag_value_eval_4na_pos.228:                                #
-        popq      %rbp                                          #5093.61
-..___tag_value_eval_4na_pos.230:                                #
-        popq      %r12                                          #5093.61
-..___tag_value_eval_4na_pos.232:                                #
-        ret                                                     #5093.61
-..___tag_value_eval_4na_pos.233:                                #
-                                # LOE
-..B2.42:                        # Preds ..B2.21                 # Infreq
-        testl     %r10d, %r10d                                  #5078.36
-        je        ..B2.44       # Prob 50%                      #5078.36
-                                # LOE r12 r13 r14 r15 edx r9d
-..B2.43:                        # Preds ..B2.34 ..B2.28 ..B2.23 ..B2.42 # Infreq
-        subl      %r9d, %edx                                    #5078.47
-        incl      %edx                                          #5078.61
-        movl      %edx, %eax                                    #5078.61
-..___tag_value_eval_4na_pos.237:                                #5078.61
-        popq      %rbx                                          #5078.61
-..___tag_value_eval_4na_pos.239:                                #
-        popq      %rbp                                          #5078.61
-..___tag_value_eval_4na_pos.241:                                #
-        popq      %r12                                          #5078.61
-..___tag_value_eval_4na_pos.243:                                #
-        ret                                                     #5078.61
-..___tag_value_eval_4na_pos.244:                                #
-                                # LOE
-..B2.44:                        # Preds ..B2.14 ..B2.12 ..B2.37 ..B2.30 ..B2.24
-                                #       ..B2.42                 # Infreq
-        xorl      %eax, %eax                                    #5095.28
-..___tag_value_eval_4na_pos.248:                                #5095.28
-        popq      %rbx                                          #5095.28
-..___tag_value_eval_4na_pos.250:                                #
-        popq      %rbp                                          #5095.28
-..___tag_value_eval_4na_pos.252:                                #
-        popq      %r12                                          #5095.28
-..___tag_value_eval_4na_pos.254:                                #
-        ret                                                     #5095.28
-        .align    16,0x90
-..___tag_value_eval_4na_pos.255:                                #
-                                # LOE
-# mark_end;
-	.type	eval_4na_pos, at function
-	.size	eval_4na_pos,.-eval_4na_pos
-	.data
-# -- End  eval_4na_pos
-	.text
-# -- Begin  eval_2na_pos
-# mark_begin;
-       .align    16,0x90
-eval_2na_pos:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B3.1:                         # Preds ..B3.0
-..___tag_value_eval_2na_pos.256:                                #3662.1
-        pushq     %r15                                          #3662.1
-..___tag_value_eval_2na_pos.258:                                #
-        pushq     %r12                                          #3662.1
-..___tag_value_eval_2na_pos.260:                                #
-        pushq     %rbp                                          #3662.1
-..___tag_value_eval_2na_pos.262:                                #
-        pushq     %rbx                                          #3662.1
-..___tag_value_eval_2na_pos.264:                                #
-        lea       (%rdx,%rcx), %ebx                             #3705.5
-        subl      4(%rdi), %ebx                                 #3716.12
-        movl      %edx, %r9d                                    #3662.1
-        movl      %edx, %r10d                                   #3713.49
-        shrl      $2, %r10d                                     #3713.49
-        lea       (%rsi,%r10), %rbp                             #3713.30
-        lea       3(%rdx,%rcx), %r8d                            #3719.50
-        shrl      $2, %r8d                                      #3719.57
-        addq      %rsi, %r8                                     #3719.30
-        testq     $15, %rbp                                     #3722.14
-        jne       ..B3.3        # Prob 50%                      #3722.14
-                                # LOE rbp rsi rdi r8 r10 r12 r13 r14 edx ebx r9d
-..B3.2:                         # Preds ..B3.1
-        movdqa    (%rbp), %xmm0                                 #3722.14
-        jmp       ..B3.4        # Prob 100%                     #3722.14
-                                # LOE rsi rdi r8 r10 r12 r13 r14 edx ebx r9d xmm0
-..B3.3:                         # Preds ..B3.1
-        movdqu    (%rbp), %xmm0                                 #3722.14
-                                # LOE rsi rdi r8 r10 r12 r13 r14 edx ebx r9d xmm0
-..B3.4:                         # Preds ..B3.2 ..B3.3
-        lea       16(%rsi,%r10), %rsi                           #3723.5
-        movq      %rsi, %rbp                                    #3723.5
-        cmpq      %r8, %rsi                                     #3728.16
-        jae       ..B3.6        # Prob 12%                      #3728.16
-                                # LOE rbp rsi rdi r8 r12 r13 r14 edx ecx ebx r9d xmm0
-..B3.5:                         # Preds ..B3.4
-        movzbl    -1(%rsi), %ecx                                #3729.24
-        shll      $8, %ecx                                      #3729.38
-                                # LOE rbp rsi rdi r8 r12 r13 r14 edx ecx ebx r9d xmm0
-..B3.6:                         # Preds ..B3.5 ..B3.4
-        movdqa    16(%rdi), %xmm8                               #3733.5
-        movdqa    32(%rdi), %xmm7                               #3733.5
-        movdqa    48(%rdi), %xmm6                               #3733.5
-        movdqa    64(%rdi), %xmm5                               #3733.5
-        movdqa    80(%rdi), %xmm4                               #3733.5
-        movdqa    96(%rdi), %xmm3                               #3733.5
-        movdqa    112(%rdi), %xmm2                              #3733.5
-        movdqa    128(%rdi), %xmm1                              #3733.5
-        xorl      %r15d, %r15d                                  #3736.15
-        xorl      %eax, %eax                                    #3736.10
-        xorl      %r11d, %r11d                                  #3736.5
-        movl      %ebx, %r10d                                   #3738.20
-        subl      %edx, %r10d                                   #3738.20
-        addl      $7, %r10d                                     #3738.33
-        shrl      $2, %r10d                                     #3738.40
-        movl      %edx, %edi                                    #3745.20
-        andl      $3, %edi                                      #3745.20
-        je        ..B3.29       # Prob 20%                      #3745.20
-                                # LOE rbp rsi r8 r12 r13 r14 eax edx ecx ebx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.7:                         # Preds ..B3.6
-        cmpl      $1, %edi                                      #3745.20
-        je        ..B3.14       # Prob 25%                      #3745.20
-                                # LOE rbp rsi r8 r12 r13 r14 eax edx ecx ebx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.8:                         # Preds ..B3.7
-        cmpl      $2, %edi                                      #3745.20
-        je        ..B3.15       # Prob 33%                      #3745.20
-                                # LOE rbp rsi r8 r12 r13 r14 eax edx ecx ebx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.9:                         # Preds ..B3.8
-        cmpl      $3, %edi                                      #3745.20
-        je        ..B3.16       # Prob 50%                      #3745.20
-        jmp       ..B3.25       # Prob 100%                     #3745.20
-                                # LOE rbp rsi r8 r12 r13 r14 eax edx ecx ebx r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.14:                        # Preds ..B3.7 ..B3.29
-        movdqa    %xmm0, %xmm9                                  #3768.22
-        pand      %xmm5, %xmm9                                  #3768.22
-        pcmpeqd   %xmm6, %xmm9                                  #3769.22
-        pmovmskb  %xmm9, %eax                                   #3770.22
-        incl      %eax                                          #3771.17
-        shrl      $16, %eax                                     #3771.17
-        negl      %eax                                          #3771.17
-                                # LOE rbp rsi r8 r13 r14 eax edx ecx ebx r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.15:                        # Preds ..B3.8 ..B3.14
-        movdqa    %xmm0, %xmm9                                  #3774.22
-        pand      %xmm3, %xmm9                                  #3774.22
-        pcmpeqd   %xmm4, %xmm9                                  #3775.22
-        pmovmskb  %xmm9, %r15d                                  #3776.22
-        incl      %r15d                                         #3777.17
-        shrl      $16, %r15d                                    #3777.17
-        negl      %r15d                                         #3777.17
-                                # LOE rbp rsi r8 r13 r14 eax edx ecx ebx r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.16:                        # Preds ..B3.9 ..B3.15
-        movdqa    %xmm0, %xmm9                                  #3780.22
-        andl      $-4, %edx                                     #3787.17
-        movl      %r11d, %r12d                                  #3790.29
-        pand      %xmm1, %xmm9                                  #3780.22
-        pcmpeqd   %xmm2, %xmm9                                  #3781.22
-        pmovmskb  %xmm9, %edi                                   #3782.22
-        orl       %eax, %r12d                                   #3790.29
-        orl       %r15d, %r12d                                  #3790.34
-        incl      %edi                                          #3783.17
-        shrl      $16, %edi                                     #3783.17
-        negl      %edi                                          #3783.17
-        orl       %edi, %r12d                                   #3790.39
-        jne       ..B3.30       # Prob 20%                      #3790.47
-                                # LOE rbp rsi r8 r13 r14 eax edx ecx ebx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.17:                        # Preds ..B3.16
-        addl      $4, %edx                                      #3853.17
-        cmpl      %ebx, %edx                                    #3856.28
-        ja        ..B3.53       # Prob 20%                      #3856.28
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.18:                        # Preds ..B3.17
-        decl      %r10d                                         #3860.25
-        jne       ..B3.26       # Prob 50%                      #3860.39
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.19:                        # Preds ..B3.18
-        cmpq      %r8, %rsi                                     #3881.25
-        jae       ..B3.53       # Prob 4%                       #3881.25
-                                # LOE rsi r8 r13 r14 edx ecx ebx r9d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.20:                        # Preds ..B3.19
-        testq     $15, %rsi                                     #3891.22
-        jne       ..B3.22       # Prob 50%                      #3891.22
-                                # LOE rsi r8 r13 r14 edx ecx ebx r9d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.21:                        # Preds ..B3.20
-        movdqa    (%rsi), %xmm0                                 #3891.22
-        jmp       ..B3.23       # Prob 100%                     #3891.22
-                                # LOE rsi r8 r13 r14 edx ecx ebx r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.22:                        # Preds ..B3.20
-        movdqu    (%rsi), %xmm0                                 #3891.22
-                                # LOE rsi r8 r13 r14 edx ecx ebx r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.23:                        # Preds ..B3.21 ..B3.22
-        addq      $16, %rsi                                     #3969.13
-        movq      %rsi, %rbp                                    #3969.13
-        cmpq      %r8, %rsi                                     #3972.24
-        jae       ..B3.25       # Prob 12%                      #3972.24
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.24:                        # Preds ..B3.23
-        movzbl    -1(%rsi), %ecx                                #3973.32
-        shll      $8, %ecx                                      #3973.46
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.25:                        # Preds ..B3.9 ..B3.23 ..B3.24
-        movl      $16, %r10d                                    #3752.13
-        jmp       ..B3.29       # Prob 100%                     #3752.13
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.26:                        # Preds ..B3.18
-        psrldq    $1, %xmm0                                     #3865.26
-        cmpq      %r8, %rbp                                     #3868.26
-        jae       ..B3.28       # Prob 19%                      #3868.26
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.27:                        # Preds ..B3.26
-        movzbl    (%rbp), %edi                                  #3871.37
-        sarl      $8, %ecx                                      #3870.21
-        shll      $8, %edi                                      #3871.48
-        orl       %edi, %ecx                                    #3871.21
-        pinsrw    $7, %ecx, %xmm0                               #3872.30
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.28:                        # Preds ..B3.27 ..B3.26
-        incq      %rbp                                          #3876.20
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.29:                        # Preds ..B3.6 ..B3.25 ..B3.28
-        movdqa    %xmm0, %xmm9                                  #3762.22
-        pand      %xmm7, %xmm9                                  #3762.22
-        pcmpeqd   %xmm8, %xmm9                                  #3763.22
-        pmovmskb  %xmm9, %r11d                                  #3764.22
-        incl      %r11d                                         #3765.17
-        shrl      $16, %r11d                                    #3765.17
-        negl      %r11d                                         #3765.17
-        jmp       ..B3.14       # Prob 100%                     #3765.17
-                                # LOE rbp rsi r8 r13 r14 edx ecx ebx r9d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B3.30:                        # Preds ..B3.16                 # Infreq
-        subl      %edx, %ebx                                    #3793.30
-        je        ..B3.51       # Prob 25%                      #3793.37
-                                # LOE r12 r13 r14 eax edx ebx edi r9d r11d r15d
-..B3.31:                        # Preds ..B3.30                 # Infreq
-        cmpl      $1, %ebx                                      #3793.37
-        jne       ..B3.36       # Prob 67%                      #3793.37
-                                # LOE r12 r13 r14 eax edx ebx edi r9d r11d r15d
-..B3.32:                        # Preds ..B3.31                 # Infreq
-        testl     %r11d, %r11d                                  #3799.36
-        jne       ..B3.52       # Prob 28%                      #3799.36
-                                # LOE r12 r13 r14 eax edx r9d
-..B3.33:                        # Preds ..B3.32                 # Infreq
-        testl     %eax, %eax                                    #3800.36
-        je        ..B3.53       # Prob 50%                      #3800.36
-                                # LOE r12 r13 r14 edx r9d
-..B3.34:                        # Preds ..B3.44 ..B3.38 ..B3.33 # Infreq
-        subl      %r9d, %edx                                    #3800.47
-        addl      $2, %edx                                      #3800.61
-        movl      %edx, %eax                                    #3800.61
-..___tag_value_eval_2na_pos.267:                                #3800.61
-        popq      %rbx                                          #3800.61
-..___tag_value_eval_2na_pos.269:                                #
-        popq      %rbp                                          #3800.61
-..___tag_value_eval_2na_pos.271:                                #
-        popq      %r12                                          #3800.61
-..___tag_value_eval_2na_pos.273:                                #
-        popq      %r15                                          #3800.61
-..___tag_value_eval_2na_pos.275:                                #
-        ret                                                     #3800.61
-..___tag_value_eval_2na_pos.276:                                #
-                                # LOE
-..B3.36:                        # Preds ..B3.31                 # Infreq
-        cmpl      $2, %ebx                                      #3793.37
-        jne       ..B3.43       # Prob 50%                      #3793.37
-                                # LOE r12 r13 r14 eax edx edi r9d r11d r15d
-..B3.37:                        # Preds ..B3.36                 # Infreq
-        testl     %r11d, %r11d                                  #3803.36
-        jne       ..B3.52       # Prob 28%                      #3803.36
-                                # LOE r12 r13 r14 eax edx r9d r15d
-..B3.38:                        # Preds ..B3.37                 # Infreq
-        testl     %eax, %eax                                    #3804.36
-        jne       ..B3.34       # Prob 28%                      #3804.36
-                                # LOE r12 r13 r14 edx r9d r15d
-..B3.39:                        # Preds ..B3.38                 # Infreq
-        testl     %r15d, %r15d                                  #3805.36
-        je        ..B3.53       # Prob 50%                      #3805.36
-                                # LOE r12 r13 r14 edx r9d
-..B3.40:                        # Preds ..B3.45 ..B3.39         # Infreq
-        subl      %r9d, %edx                                    #3805.47
-        addl      $3, %edx                                      #3805.61
-        movl      %edx, %eax                                    #3805.61
-..___tag_value_eval_2na_pos.281:                                #3805.61
-        popq      %rbx                                          #3805.61
-..___tag_value_eval_2na_pos.283:                                #
-        popq      %rbp                                          #3805.61
-..___tag_value_eval_2na_pos.285:                                #
-        popq      %r12                                          #3805.61
-..___tag_value_eval_2na_pos.287:                                #
-        popq      %r15                                          #3805.61
-..___tag_value_eval_2na_pos.289:                                #
-        ret                                                     #3805.61
-..___tag_value_eval_2na_pos.290:                                #
-                                # LOE
-..B3.43:                        # Preds ..B3.36                 # Infreq
-        testl     %r11d, %r11d                                  #3808.36
-        jne       ..B3.52       # Prob 28%                      #3808.36
-                                # LOE r12 r13 r14 eax edx edi r9d r15d
-..B3.44:                        # Preds ..B3.43                 # Infreq
-        testl     %eax, %eax                                    #3809.36
-        jne       ..B3.34       # Prob 28%                      #3809.36
-                                # LOE r12 r13 r14 edx edi r9d r15d
-..B3.45:                        # Preds ..B3.44                 # Infreq
-        testl     %r15d, %r15d                                  #3810.36
-        jne       ..B3.40       # Prob 28%                      #3810.36
-                                # LOE r12 r13 r14 edx edi r9d
-..B3.46:                        # Preds ..B3.45                 # Infreq
-        testl     %edi, %edi                                    #3811.36
-        je        ..B3.53       # Prob 50%                      #3811.36
-                                # LOE r12 r13 r14 edx r9d
-..B3.47:                        # Preds ..B3.46                 # Infreq
-        subl      %r9d, %edx                                    #3811.47
-        addl      $4, %edx                                      #3811.61
-        movl      %edx, %eax                                    #3811.61
-..___tag_value_eval_2na_pos.295:                                #3811.61
-        popq      %rbx                                          #3811.61
-..___tag_value_eval_2na_pos.297:                                #
-        popq      %rbp                                          #3811.61
-..___tag_value_eval_2na_pos.299:                                #
-        popq      %r12                                          #3811.61
-..___tag_value_eval_2na_pos.301:                                #
-        popq      %r15                                          #3811.61
-..___tag_value_eval_2na_pos.303:                                #
-        ret                                                     #3811.61
-..___tag_value_eval_2na_pos.304:                                #
-                                # LOE
-..B3.51:                        # Preds ..B3.30                 # Infreq
-        testl     %r11d, %r11d                                  #3796.36
-        je        ..B3.53       # Prob 50%                      #3796.36
-                                # LOE r12 r13 r14 edx r9d
-..B3.52:                        # Preds ..B3.43 ..B3.37 ..B3.32 ..B3.51 # Infreq
-        subl      %r9d, %edx                                    #3796.47
-        incl      %edx                                          #3796.61
-        movl      %edx, %eax                                    #3796.61
-..___tag_value_eval_2na_pos.309:                                #3796.61
-        popq      %rbx                                          #3796.61
-..___tag_value_eval_2na_pos.311:                                #
-        popq      %rbp                                          #3796.61
-..___tag_value_eval_2na_pos.313:                                #
-        popq      %r12                                          #3796.61
-..___tag_value_eval_2na_pos.315:                                #
-        popq      %r15                                          #3796.61
-..___tag_value_eval_2na_pos.317:                                #
-        ret                                                     #3796.61
-..___tag_value_eval_2na_pos.318:                                #
-                                # LOE
-..B3.53:                        # Preds ..B3.17 ..B3.19 ..B3.46 ..B3.39 ..B3.33
-                                #       ..B3.51                 # Infreq
-        xorl      %eax, %eax                                    #3813.28
-..___tag_value_eval_2na_pos.323:                                #3813.28
-        popq      %rbx                                          #3813.28
-..___tag_value_eval_2na_pos.325:                                #
-        popq      %rbp                                          #3813.28
-..___tag_value_eval_2na_pos.327:                                #
-        popq      %r12                                          #3813.28
-..___tag_value_eval_2na_pos.329:                                #
-        popq      %r15                                          #3813.28
-..___tag_value_eval_2na_pos.331:                                #
-        ret                                                     #3813.28
-        .align    16,0x90
-..___tag_value_eval_2na_pos.332:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_pos, at function
-	.size	eval_2na_pos,.-eval_2na_pos
-	.data
-# -- End  eval_2na_pos
-	.text
-# -- Begin  eval_4na_128
-# mark_begin;
-       .align    16,0x90
-eval_4na_128:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B4.1:                         # Preds ..B4.0
-..___tag_value_eval_4na_128.333:                                #4724.1
-        pushq     %rbp                                          #4724.1
-..___tag_value_eval_4na_128.335:                                #
-        pushq     %rbx                                          #4724.1
-..___tag_value_eval_4na_128.337:                                #
-        movdqa    16(%rdi), %xmm8                               #4776.5
-        movdqa    32(%rdi), %xmm7                               #4776.5
-        movdqa    48(%rdi), %xmm6                               #4776.5
-        movdqa    64(%rdi), %xmm5                               #4776.5
-        movdqa    80(%rdi), %xmm4                               #4776.5
-        movdqa    96(%rdi), %xmm3                               #4776.5
-        movdqa    112(%rdi), %xmm2                              #4776.5
-        movdqa    128(%rdi), %xmm1                              #4776.5
-        lea       (%rdx,%rcx), %ebp                             #4757.5
-        movl      %edx, %r10d                                   #4760.49
-        shrl      $2, %r10d                                     #4760.49
-        subl      4(%rdi), %ebp                                 #4763.12
-        movzbl    (%r10,%rsi), %r8d                             #4769.14
-        movzbl    1(%r10,%rsi), %r11d                           #4769.14
-        lea       3(%rdx,%rcx), %ecx                            #4766.50
-        shrl      $2, %ecx                                      #4766.57
-        addq      %rsi, %rcx                                    #4766.30
-        lea       expand_2na.0(%rip), %rax                      #4769.14
-        movzwl    (%rax,%r8,2), %r9d                            #4769.14
-        movzwl    (%rax,%r11,2), %r8d                           #4769.14
-        movw      %r9w, -24(%rsp)                               #4769.14
-        movzbl    2(%r10,%rsi), %r9d                            #4769.14
-        movzwl    (%rax,%r9,2), %r11d                           #4769.14
-        movw      %r8w, -22(%rsp)                               #4769.14
-        movzbl    3(%r10,%rsi), %r8d                            #4769.14
-        movzwl    (%rax,%r8,2), %r9d                            #4769.14
-        movw      %r11w, -20(%rsp)                              #4769.14
-        movzbl    4(%r10,%rsi), %r11d                           #4769.14
-        movzwl    (%rax,%r11,2), %r8d                           #4769.14
-        movw      %r9w, -18(%rsp)                               #4769.14
-        movzbl    5(%r10,%rsi), %r9d                            #4769.14
-        movzwl    (%rax,%r9,2), %r11d                           #4769.14
-        movw      %r8w, -16(%rsp)                               #4769.14
-        movzbl    6(%r10,%rsi), %r8d                            #4769.14
-        movzwl    (%rax,%r8,2), %r9d                            #4769.14
-        xorl      %r8d, %r8d                                    #4779.15
-        movw      %r11w, -14(%rsp)                              #4769.14
-        movzbl    7(%r10,%rsi), %r11d                           #4769.14
-        movzwl    (%rax,%r11,2), %eax                           #4769.14
-        movw      %r9w, -12(%rsp)                               #4769.14
-        xorl      %r9d, %r9d                                    #4779.10
-        movw      %ax, -10(%rsp)                                #4769.14
-        movdqu    -24(%rsp), %xmm0                              #4769.14
-        lea       8(%rsi,%r10), %rax                            #4770.5
-        movq      %rax, %r10                                    #4770.5
-        xorl      %edi, %edi                                    #4779.5
-        movl      %ebp, %esi                                    #4781.20
-        subl      %edx, %esi                                    #4781.20
-        addl      $7, %esi                                      #4781.33
-        shrl      $2, %esi                                      #4781.40
-        movl      %edx, %r11d                                   #4790.20
-        andl      $3, %r11d                                     #4790.20
-        je        ..B4.20       # Prob 20%                      #4790.20
-                                # LOE rax rcx rbx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.2:                         # Preds ..B4.1
-        cmpl      $1, %r11d                                     #4790.20
-        je        ..B4.9        # Prob 25%                      #4790.20
-                                # LOE rax rcx rbx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.3:                         # Preds ..B4.2
-        cmpl      $2, %r11d                                     #4790.20
-        je        ..B4.10       # Prob 33%                      #4790.20
-                                # LOE rax rcx rbx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.4:                         # Preds ..B4.3
-        cmpl      $3, %r11d                                     #4790.20
-        je        ..B4.11       # Prob 50%                      #4790.20
-        jmp       ..B4.16       # Prob 100%                     #4790.20
-                                # LOE rax rcx rbx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.9:                         # Preds ..B4.2 ..B4.20
-        movdqa    %xmm0, %xmm10                                 #4814.22
-        movdqa    %xmm0, %xmm9                                  #4815.22
-        pand      %xmm6, %xmm10                                 #4814.22
-        pand      %xmm5, %xmm9                                  #4815.22
-        pcmpeqd   %xmm9, %xmm10                                 #4816.22
-        pmovmskb  %xmm10, %r9d                                  #4817.22
-        incl      %r9d                                          #4818.17
-        shrl      $16, %r9d                                     #4818.17
-        negl      %r9d                                          #4818.17
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi edi r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.10:                        # Preds ..B4.3 ..B4.9
-        movdqa    %xmm0, %xmm10                                 #4821.22
-        movdqa    %xmm0, %xmm9                                  #4822.22
-        pand      %xmm4, %xmm10                                 #4821.22
-        pand      %xmm3, %xmm9                                  #4822.22
-        pcmpeqd   %xmm9, %xmm10                                 #4823.22
-        pmovmskb  %xmm10, %r8d                                  #4824.22
-        incl      %r8d                                          #4825.17
-        shrl      $16, %r8d                                     #4825.17
-        negl      %r8d                                          #4825.17
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.11:                        # Preds ..B4.4 ..B4.10
-        movdqa    %xmm0, %xmm10                                 #4828.22
-        movdqa    %xmm0, %xmm9                                  #4829.22
-        andl      $-4, %edx                                     #4836.17
-        pand      %xmm2, %xmm10                                 #4828.22
-        pand      %xmm1, %xmm9                                  #4829.22
-        pcmpeqd   %xmm9, %xmm10                                 #4830.22
-        pmovmskb  %xmm10, %ebx                                  #4831.22
-        movl      %edi, %r11d                                   #4839.29
-        orl       %r9d, %r11d                                   #4839.29
-        incl      %ebx                                          #4832.17
-        shrl      $16, %ebx                                     #4832.17
-        negl      %ebx                                          #4832.17
-        orl       %r8d, %r11d                                   #4839.34
-        orl       %ebx, %r11d                                   #4839.39
-        jne       ..B4.21       # Prob 20%                      #4839.47
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi edi r8d r9d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.12:                        # Preds ..B4.11
-        addl      $4, %edx                                      #4880.17
-        cmpl      %ebp, %edx                                    #4883.28
-        ja        ..B4.29       # Prob 20%                      #4883.28
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.13:                        # Preds ..B4.12
-        decl      %esi                                          #4887.25
-        jne       ..B4.17       # Prob 50%                      #4887.39
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.14:                        # Preds ..B4.13
-        cmpq      %rcx, %rax                                    #4904.25
-        jae       ..B4.29       # Prob 4%                       #4904.25
-                                # LOE rax rcx r12 r13 r14 r15 edx ebp xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.15:                        # Preds ..B4.14
-        movzbl    (%rax), %esi                                  #4914.22
-        movzbl    1(%rax), %r8d                                 #4914.22
-        movzbl    2(%rax), %r10d                                #4914.22
-        lea       expand_2na.0(%rip), %rbx                      #4914.22
-        movzwl    (%rbx,%rsi,2), %edi                           #4914.22
-        movzwl    (%rbx,%r8,2), %r9d                            #4914.22
-        movzwl    (%rbx,%r10,2), %r11d                          #4914.22
-        movzbl    3(%rax), %esi                                 #4914.22
-        movzbl    4(%rax), %r8d                                 #4914.22
-        movzbl    5(%rax), %r10d                                #4914.22
-        movw      %di, -24(%rsp)                                #4914.22
-        movzwl    (%rbx,%rsi,2), %edi                           #4914.22
-        movzbl    6(%rax), %esi                                 #4914.22
-        movw      %r9w, -22(%rsp)                               #4914.22
-        movzwl    (%rbx,%r8,2), %r9d                            #4914.22
-        movzbl    7(%rax), %r8d                                 #4914.22
-        movw      %r11w, -20(%rsp)                              #4914.22
-        movzwl    (%rbx,%r10,2), %r11d                          #4914.22
-        addq      $8, %rax                                      #4929.13
-        movq      %rax, %r10                                    #4929.13
-        movw      %di, -18(%rsp)                                #4914.22
-        movzwl    (%rbx,%rsi,2), %edi                           #4914.22
-        movzwl    (%rbx,%r8,2), %ebx                            #4914.22
-        movw      %r9w, -16(%rsp)                               #4914.22
-        movw      %r11w, -14(%rsp)                              #4914.22
-        movw      %di, -12(%rsp)                                #4914.22
-        movw      %bx, -10(%rsp)                                #4914.22
-        movdqu    -24(%rsp), %xmm0                              #4914.22
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.16:                        # Preds ..B4.4 ..B4.15
-        movl      $8, %esi                                      #4797.13
-        jmp       ..B4.20       # Prob 100%                     #4797.13
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.17:                        # Preds ..B4.13
-        psrldq    $2, %xmm0                                     #4892.26
-        cmpq      %rcx, %r10                                    #4895.26
-        jae       ..B4.19       # Prob 19%                      #4895.26
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.18:                        # Preds ..B4.17
-        movzbl    (%r10), %edi                                  #4896.72
-        lea       expand_2na.0(%rip), %rbx                      #4896.57
-        movzwl    (%rbx,%rdi,2), %r8d                           #4896.57
-        pinsrw    $7, %r8d, %xmm0                               #4896.30
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.19:                        # Preds ..B4.18 ..B4.17
-        incq      %r10                                          #4899.20
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.20:                        # Preds ..B4.1 ..B4.16 ..B4.19
-        movdqa    %xmm0, %xmm10                                 #4807.22
-        movdqa    %xmm0, %xmm9                                  #4808.22
-        pand      %xmm8, %xmm10                                 #4807.22
-        pand      %xmm7, %xmm9                                  #4808.22
-        pcmpeqd   %xmm9, %xmm10                                 #4809.22
-        pmovmskb  %xmm10, %edi                                  #4810.22
-        incl      %edi                                          #4811.17
-        shrl      $16, %edi                                     #4811.17
-        negl      %edi                                          #4811.17
-        jmp       ..B4.9        # Prob 100%                     #4811.17
-                                # LOE rax rcx r10 r12 r13 r14 r15 edx ebp esi edi xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B4.21:                        # Preds ..B4.11                 # Infreq
-        subl      %edx, %ebp                                    #4842.30
-        cmpl      $2, %ebp                                      #4842.37
-        je        ..B4.25       # Prob 25%                      #4842.37
-                                # LOE rbx r12 r13 r14 r15 ebp edi r8d r9d
-..B4.22:                        # Preds ..B4.21                 # Infreq
-        cmpl      $1, %ebp                                      #4842.37
-        je        ..B4.26       # Prob 33%                      #4842.37
-                                # LOE rbx r12 r13 r14 r15 ebp edi r9d
-..B4.23:                        # Preds ..B4.22                 # Infreq
-        testl     %ebp, %ebp                                    #4842.37
-        je        ..B4.27       # Prob 50%                      #4842.37
-                                # LOE rbx r12 r13 r14 r15 edi
-..B4.24:                        # Preds ..B4.23                 # Infreq
-        movl      $1, %eax                                      #4845.32
-..___tag_value_eval_4na_128.340:                                #4845.32
-        popq      %rbx                                          #4845.32
-..___tag_value_eval_4na_128.342:                                #
-        popq      %rbp                                          #4845.32
-..___tag_value_eval_4na_128.344:                                #
-        ret                                                     #4845.32
-..___tag_value_eval_4na_128.345:                                #
-                                # LOE
-..B4.25:                        # Preds ..B4.21                 # Infreq
-        testl     %r8d, %r8d                                    #4847.36
-        jne       ..B4.28       # Prob 28%                      #4847.36
-                                # LOE rbx r12 r13 r14 r15 edi r9d
-..B4.26:                        # Preds ..B4.22 ..B4.25         # Infreq
-        testl     %r9d, %r9d                                    #4849.36
-        jne       ..B4.28       # Prob 28%                      #4849.36
-                                # LOE rbx r12 r13 r14 r15 edi
-..B4.27:                        # Preds ..B4.26 ..B4.23         # Infreq
-        testl     %edi, %edi                                    #4851.36
-        je        ..B4.29       # Prob 50%                      #4851.36
-                                # LOE rbx r12 r13 r14 r15
-..B4.28:                        # Preds ..B4.25 ..B4.26 ..B4.27 # Infreq
-        movl      $1, %eax                                      #4851.47
-..___tag_value_eval_4na_128.348:                                #4851.47
-        popq      %rbx                                          #4851.47
-..___tag_value_eval_4na_128.350:                                #
-        popq      %rbp                                          #4851.47
-..___tag_value_eval_4na_128.352:                                #
-        ret                                                     #4851.47
-..___tag_value_eval_4na_128.353:                                #
-                                # LOE
-..B4.29:                        # Preds ..B4.14 ..B4.12 ..B4.27 # Infreq
-        xorl      %eax, %eax                                    #4853.28
-..___tag_value_eval_4na_128.356:                                #4853.28
-        popq      %rbx                                          #4853.28
-..___tag_value_eval_4na_128.358:                                #
-        popq      %rbp                                          #4853.28
-..___tag_value_eval_4na_128.360:                                #
-        ret                                                     #4853.28
-        .align    16,0x90
-..___tag_value_eval_4na_128.361:                                #
-                                # LOE
-# mark_end;
-	.type	eval_4na_128, at function
-	.size	eval_4na_128,.-eval_4na_128
-	.data
-# -- End  eval_4na_128
-	.text
-# -- Begin  eval_4na_32
-# mark_begin;
-       .align    16,0x90
-eval_4na_32:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B5.1:                         # Preds ..B5.0
-..___tag_value_eval_4na_32.362:                                 #4279.1
-        pushq     %r15                                          #4279.1
-..___tag_value_eval_4na_32.364:                                 #
-        pushq     %r14                                          #4279.1
-..___tag_value_eval_4na_32.366:                                 #
-        pushq     %r13                                          #4279.1
-..___tag_value_eval_4na_32.368:                                 #
-        pushq     %r12                                          #4279.1
-..___tag_value_eval_4na_32.370:                                 #
-        pushq     %rbx                                          #4279.1
-..___tag_value_eval_4na_32.372:                                 #
-        movdqa    16(%rdi), %xmm8                               #4331.5
-        movdqa    32(%rdi), %xmm7                               #4331.5
-        movdqa    48(%rdi), %xmm6                               #4331.5
-        movdqa    64(%rdi), %xmm5                               #4331.5
-        movdqa    80(%rdi), %xmm4                               #4331.5
-        movdqa    96(%rdi), %xmm3                               #4331.5
-        movdqa    112(%rdi), %xmm2                              #4331.5
-        movdqa    128(%rdi), %xmm1                              #4331.5
-        lea       (%rdx,%rcx), %r11d                            #4312.5
-        movl      %edx, %ebx                                    #4315.49
-        shrl      $2, %ebx                                      #4315.49
-        subl      4(%rdi), %r11d                                #4318.12
-        movzbl    (%rbx,%rsi), %eax                             #4324.14
-        movzbl    1(%rbx,%rsi), %r9d                            #4324.14
-        lea       3(%rdx,%rcx), %r10d                           #4321.50
-        shrl      $2, %r10d                                     #4321.57
-        addq      %rsi, %r10                                    #4321.30
-        lea       expand_2na.0(%rip), %rcx                      #4324.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4324.14
-        movzwl    (%rcx,%r9,2), %eax                            #4324.14
-        movw      %r8w, -16(%rsp)                               #4324.14
-        movzbl    2(%rbx,%rsi), %r8d                            #4324.14
-        movzwl    (%rcx,%r8,2), %r9d                            #4324.14
-        movw      %ax, -14(%rsp)                                #4324.14
-        movzbl    3(%rbx,%rsi), %eax                            #4324.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4324.14
-        movw      %r9w, -12(%rsp)                               #4324.14
-        movzbl    4(%rbx,%rsi), %r9d                            #4324.14
-        movzwl    (%rcx,%r9,2), %eax                            #4324.14
-        movw      %r8w, -10(%rsp)                               #4324.14
-        movzbl    5(%rbx,%rsi), %r8d                            #4324.14
-        movzwl    (%rcx,%r8,2), %r9d                            #4324.14
-        movw      %ax, -8(%rsp)                                 #4324.14
-        movzbl    6(%rbx,%rsi), %eax                            #4324.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4324.14
-        movw      %r9w, -6(%rsp)                                #4324.14
-        movzbl    7(%rbx,%rsi), %r9d                            #4324.14
-        movzwl    (%rcx,%r9,2), %ecx                            #4324.14
-        movw      %r8w, -4(%rsp)                                #4324.14
-        movl      %edx, %eax                                    #4345.20
-        lea       8(%rsi,%rbx), %rbx                            #4325.5
-        movw      %cx, -2(%rsp)                                 #4324.14
-        movdqu    -16(%rsp), %xmm0                              #4324.14
-        movq      %rbx, %rcx                                    #4325.5
-        xorl      %r8d, %r8d                                    #4334.15
-        xorl      %r9d, %r9d                                    #4334.10
-        xorl      %edi, %edi                                    #4334.5
-        movl      $2, %esi                                      #4340.5
-        andl      $3, %eax                                      #4345.20
-        je        ..B5.29       # Prob 20%                      #4345.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.2:                         # Preds ..B5.1
-        cmpl      $1, %eax                                      #4345.20
-        je        ..B5.9        # Prob 25%                      #4345.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.3:                         # Preds ..B5.2
-        cmpl      $2, %eax                                      #4345.20
-        je        ..B5.10       # Prob 33%                      #4345.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.4:                         # Preds ..B5.3
-        cmpl      $3, %eax                                      #4345.20
-        je        ..B5.11       # Prob 50%                      #4345.20
-        jmp       ..B5.25       # Prob 100%                     #4345.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.9:                         # Preds ..B5.2 ..B5.29
-        movdqa    %xmm0, %xmm10                                 #4369.22
-        movdqa    %xmm0, %xmm9                                  #4370.22
-        pand      %xmm6, %xmm10                                 #4369.22
-        pand      %xmm5, %xmm9                                  #4370.22
-        pcmpeqd   %xmm9, %xmm10                                 #4371.22
-        pmovmskb  %xmm10, %r9d                                  #4372.22
-                                # LOE rcx rbx rbp r10 edx esi edi r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.10:                        # Preds ..B5.3 ..B5.9
-        movdqa    %xmm0, %xmm10                                 #4376.22
-        movdqa    %xmm0, %xmm9                                  #4377.22
-        pand      %xmm4, %xmm10                                 #4376.22
-        pand      %xmm3, %xmm9                                  #4377.22
-        pcmpeqd   %xmm9, %xmm10                                 #4378.22
-        pmovmskb  %xmm10, %r8d                                  #4379.22
-                                # LOE rcx rbx rbp r10 edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.11:                        # Preds ..B5.4 ..B5.10
-        movdqa    %xmm0, %xmm10                                 #4383.22
-        movdqa    %xmm0, %xmm9                                  #4384.22
-        movl      %edx, %r13d                                   #4391.17
-        pand      %xmm2, %xmm10                                 #4383.22
-        pand      %xmm1, %xmm9                                  #4384.22
-        pcmpeqd   %xmm9, %xmm10                                 #4385.22
-        pmovmskb  %xmm10, %r12d                                 #4386.22
-        andl      $-4, %r13d                                    #4391.17
-        movl      %edi, %edx                                    #4394.29
-        orl       %r9d, %edx                                    #4394.29
-        orl       %r8d, %edx                                    #4394.34
-        orl       %r12d, %edx                                   #4394.39
-        je        ..B5.20       # Prob 78%                      #4394.47
-                                # LOE rcx rbx rbp r10 esi edi r8d r9d r11d r12d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.12:                        # Preds ..B5.11
-        movl      %edi, %eax                                    #4412.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4412.30
-        movswq    %ax, %r15                                     #4412.30
-        movl      %r9d, %eax                                    #4413.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4413.30
-        movswq    %ax, %rdx                                     #4413.30
-        movl      %r8d, %eax                                    #4414.30
-        lea       1(%rdx,%rdx), %edx                            #4421.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4414.30
-        movswq    %ax, %r14                                     #4414.30
-        movl      %r12d, %eax                                   #4415.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4415.30
-        movswq    %ax, %rax                                     #4415.30
-        lea       2(%r14,%r14), %r14d                           #4422.40
-        lea       3(%rax,%rax), %eax                            #4423.40
-        testl     %edi, %edi                                    #4427.32
-        je        ..B5.14       # Prob 50%                      #4427.32
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r9d r11d r12d r13d r14d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.13:                        # Preds ..B5.12
-        lea       (%r13,%r15,2), %edi                           #4427.43
-        cmpl      %edi, %r11d                                   #4427.49
-        jae       ..B5.34       # Prob 20%                      #4427.49
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r9d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.14:                        # Preds ..B5.13 ..B5.12
-        testl     %r9d, %r9d                                    #4428.32
-        je        ..B5.16       # Prob 50%                      #4428.32
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.15:                        # Preds ..B5.14
-        addl      %r13d, %edx                                   #4428.43
-        cmpl      %edx, %r11d                                   #4428.49
-        jae       ..B5.34       # Prob 20%                      #4428.49
-                                # LOE rcx rbx rbp r10 eax esi r8d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.16:                        # Preds ..B5.15 ..B5.14
-        testl     %r8d, %r8d                                    #4429.32
-        je        ..B5.18       # Prob 50%                      #4429.32
-                                # LOE rcx rbx rbp r10 eax esi r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.17:                        # Preds ..B5.16
-        addl      %r13d, %r14d                                  #4429.43
-        cmpl      %r14d, %r11d                                  #4429.49
-        jae       ..B5.34       # Prob 20%                      #4429.49
-                                # LOE rcx rbx rbp r10 eax esi r11d r12d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.18:                        # Preds ..B5.17 ..B5.16
-        testl     %r12d, %r12d                                  #4430.32
-        je        ..B5.20       # Prob 50%                      #4430.32
-                                # LOE rcx rbx rbp r10 eax esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.19:                        # Preds ..B5.18
-        addl      %r13d, %eax                                   #4430.43
-        cmpl      %eax, %r11d                                   #4430.49
-        jae       ..B5.34       # Prob 20%                      #4430.49
-                                # LOE rcx rbx rbp r10 esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.20:                        # Preds ..B5.19 ..B5.18 ..B5.11
-        lea       4(%r13), %edx                                 #4435.17
-        cmpl      %r11d, %edx                                   #4438.28
-        ja        ..B5.31       # Prob 20%                      #4438.28
-                                # LOE rcx rbx rbp r10 edx esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.21:                        # Preds ..B5.20
-        decl      %esi                                          #4442.25
-        jne       ..B5.26       # Prob 50%                      #4442.39
-                                # LOE rcx rbx rbp r10 edx esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.22:                        # Preds ..B5.21
-        cmpq      %r10, %rbx                                    #4459.25
-        jae       ..B5.31       # Prob 4%                       #4459.25
-                                # LOE rbx rbp r10 r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.23:                        # Preds ..B5.22
-        lea       28(%r13), %edx                                #4463.13
-        cmpl      %r11d, %edx                                   #4464.24
-        ja        ..B5.31       # Prob 4%                       #4464.24
-                                # LOE rbx rbp r10 edx r11d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.24:                        # Preds ..B5.23
-        movzbl    (%rbx), %ecx                                  #4469.22
-        movzbl    1(%rbx), %edi                                 #4469.22
-        movzbl    2(%rbx), %r9d                                 #4469.22
-        movzbl    3(%rbx), %r13d                                #4469.22
-        movzbl    4(%rbx), %r15d                                #4469.22
-        lea       expand_2na.0(%rip), %rax                      #4469.22
-        movzwl    (%rax,%rcx,2), %esi                           #4469.22
-        movzwl    (%rax,%rdi,2), %r8d                           #4469.22
-        movzwl    (%rax,%r9,2), %r12d                           #4469.22
-        movzwl    (%rax,%r13,2), %r14d                          #4469.22
-        movzwl    (%rax,%r15,2), %ecx                           #4469.22
-        movw      %si, -16(%rsp)                                #4469.22
-        movzbl    5(%rbx), %esi                                 #4469.22
-        movzwl    (%rax,%rsi,2), %edi                           #4469.22
-        movw      %r8w, -14(%rsp)                               #4469.22
-        movzbl    6(%rbx), %r8d                                 #4469.22
-        movzwl    (%rax,%r8,2), %r9d                            #4469.22
-        movw      %r12w, -12(%rsp)                              #4469.22
-        movzbl    7(%rbx), %r12d                                #4469.22
-        movzwl    (%rax,%r12,2), %eax                           #4469.22
-        movw      %r14w, -10(%rsp)                              #4469.22
-        movw      %cx, -8(%rsp)                                 #4469.22
-        addq      $8, %rbx                                      #4484.13
-        movw      %di, -6(%rsp)                                 #4469.22
-        movq      %rbx, %rcx                                    #4484.13
-        movw      %r9w, -4(%rsp)                                #4469.22
-        movw      %ax, -2(%rsp)                                 #4469.22
-        movdqu    -16(%rsp), %xmm0                              #4469.22
-                                # LOE rcx rbx rbp r10 edx r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.25:                        # Preds ..B5.4 ..B5.24
-        movl      $2, %esi                                      #4352.13
-        jmp       ..B5.29       # Prob 100%                     #4352.13
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.26:                        # Preds ..B5.21
-        psrldq    $2, %xmm0                                     #4447.26
-        cmpq      %r10, %rcx                                    #4450.26
-        jae       ..B5.28       # Prob 19%                      #4450.26
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.27:                        # Preds ..B5.26
-        movzbl    (%rcx), %edi                                  #4451.72
-        lea       expand_2na.0(%rip), %rax                      #4451.57
-        movzwl    (%rax,%rdi,2), %r8d                           #4451.57
-        pinsrw    $7, %r8d, %xmm0                               #4451.30
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.28:                        # Preds ..B5.27 ..B5.26
-        incq      %rcx                                          #4454.20
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.29:                        # Preds ..B5.1 ..B5.25 ..B5.28
-        movdqa    %xmm0, %xmm10                                 #4362.22
-        movdqa    %xmm0, %xmm9                                  #4363.22
-        pand      %xmm8, %xmm10                                 #4362.22
-        pand      %xmm7, %xmm9                                  #4363.22
-        pcmpeqd   %xmm9, %xmm10                                 #4364.22
-        pmovmskb  %xmm10, %edi                                  #4365.22
-        jmp       ..B5.9        # Prob 100%                     #4365.22
-                                # LOE rcx rbx rbp r10 edx esi edi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B5.31:                        # Preds ..B5.20 ..B5.22 ..B5.23 # Infreq
-        xorl      %eax, %eax                                    #4495.12
-..___tag_value_eval_4na_32.375:                                 #4495.12
-        popq      %rbx                                          #4495.12
-..___tag_value_eval_4na_32.377:                                 #
-        popq      %r12                                          #4495.12
-..___tag_value_eval_4na_32.379:                                 #
-        popq      %r13                                          #4495.12
-..___tag_value_eval_4na_32.381:                                 #
-        popq      %r14                                          #4495.12
-..___tag_value_eval_4na_32.383:                                 #
-        popq      %r15                                          #4495.12
-..___tag_value_eval_4na_32.385:                                 #
-        ret                                                     #4495.12
-..___tag_value_eval_4na_32.386:                                 #
-                                # LOE
-..B5.34:                        # Preds ..B5.13 ..B5.19 ..B5.17 ..B5.15 # Infreq
-        movl      $1, %eax                                      #4428.63
-..___tag_value_eval_4na_32.392:                                 #4428.63
-        popq      %rbx                                          #4428.63
-..___tag_value_eval_4na_32.394:                                 #
-        popq      %r12                                          #4428.63
-..___tag_value_eval_4na_32.396:                                 #
-        popq      %r13                                          #4428.63
-..___tag_value_eval_4na_32.398:                                 #
-        popq      %r14                                          #4428.63
-..___tag_value_eval_4na_32.400:                                 #
-        popq      %r15                                          #4428.63
-..___tag_value_eval_4na_32.402:                                 #
-        ret                                                     #4428.63
-        .align    16,0x90
-..___tag_value_eval_4na_32.403:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_32, at function
-	.size	eval_4na_32,.-eval_4na_32
-	.data
-# -- End  eval_4na_32
-	.text
-# -- Begin  eval_4na_16
-# mark_begin;
-       .align    16,0x90
-eval_4na_16:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B6.1:                         # Preds ..B6.0
-..___tag_value_eval_4na_16.404:                                 #4057.1
-        pushq     %r13                                          #4057.1
-..___tag_value_eval_4na_16.406:                                 #
-        pushq     %r12                                          #4057.1
-..___tag_value_eval_4na_16.408:                                 #
-        pushq     %rbx                                          #4057.1
-..___tag_value_eval_4na_16.410:                                 #
-        movdqa    16(%rdi), %xmm8                               #4109.5
-        movdqa    32(%rdi), %xmm7                               #4109.5
-        movdqa    48(%rdi), %xmm6                               #4109.5
-        movdqa    64(%rdi), %xmm5                               #4109.5
-        movdqa    80(%rdi), %xmm4                               #4109.5
-        movdqa    96(%rdi), %xmm3                               #4109.5
-        movdqa    112(%rdi), %xmm2                              #4109.5
-        movdqa    128(%rdi), %xmm1                              #4109.5
-        lea       (%rdx,%rcx), %r10d                            #4090.5
-        subl      4(%rdi), %r10d                                #4096.12
-        movl      %edx, %eax                                    #4093.49
-        shrl      $2, %eax                                      #4093.49
-        movzbl    (%rax,%rsi), %r8d                             #4102.14
-        lea       3(%rdx,%rcx), %r9d                            #4099.50
-        shrl      $2, %r9d                                      #4099.57
-        addq      %rsi, %r9                                     #4099.30
-        lea       expand_2na.0(%rip), %rcx                      #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    1(%rax,%rsi), %r8d                            #4102.14
-        movw      %r11w, -16(%rsp)                              #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    2(%rax,%rsi), %r8d                            #4102.14
-        xorl      %edi, %edi                                    #4112.15
-        movw      %r11w, -14(%rsp)                              #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    3(%rax,%rsi), %r8d                            #4102.14
-        movw      %r11w, -12(%rsp)                              #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    4(%rax,%rsi), %r8d                            #4102.14
-        movw      %r11w, -10(%rsp)                              #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    5(%rax,%rsi), %r8d                            #4102.14
-        movw      %r11w, -8(%rsp)                               #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    6(%rax,%rsi), %r8d                            #4102.14
-        movw      %r11w, -6(%rsp)                               #4102.14
-        movzwl    (%rcx,%r8,2), %r11d                           #4102.14
-        movzbl    7(%rax,%rsi), %r8d                            #4102.14
-        movzwl    (%rcx,%r8,2), %ecx                            #4102.14
-        xorl      %r8d, %r8d                                    #4112.10
-        movw      %r11w, -4(%rsp)                               #4102.14
-        movw      %cx, -2(%rsp)                                 #4102.14
-        movdqu    -16(%rsp), %xmm0                              #4102.14
-        lea       8(%rsi,%rax), %rcx                            #4103.5
-        xorl      %esi, %esi                                    #4112.5
-        movl      %edx, %r11d                                   #4123.20
-        andl      $3, %r11d                                     #4123.20
-        je        ..B6.24       # Prob 20%                      #4123.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.2:                         # Preds ..B6.1
-        cmpl      $1, %r11d                                     #4123.20
-        je        ..B6.9        # Prob 25%                      #4123.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.3:                         # Preds ..B6.2
-        cmpl      $2, %r11d                                     #4123.20
-        je        ..B6.10       # Prob 33%                      #4123.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.4:                         # Preds ..B6.3
-        cmpl      $3, %r11d                                     #4123.20
-        je        ..B6.11       # Prob 50%                      #4123.20
-        jmp       ..B6.24       # Prob 100%                     #4123.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.9:                         # Preds ..B6.2 ..B6.24
-        movdqa    %xmm0, %xmm10                                 #4147.22
-        movdqa    %xmm0, %xmm9                                  #4148.22
-        pand      %xmm6, %xmm10                                 #4147.22
-        pand      %xmm5, %xmm9                                  #4148.22
-        pcmpeqw   %xmm9, %xmm10                                 #4149.22
-        pmovmskb  %xmm10, %r8d                                  #4150.22
-                                # LOE rcx rbp r9 r14 r15 edx esi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.10:                        # Preds ..B6.3 ..B6.9
-        movdqa    %xmm0, %xmm10                                 #4154.22
-        movdqa    %xmm0, %xmm9                                  #4155.22
-        pand      %xmm4, %xmm10                                 #4154.22
-        pand      %xmm3, %xmm9                                  #4155.22
-        pcmpeqw   %xmm9, %xmm10                                 #4156.22
-        pmovmskb  %xmm10, %edi                                  #4157.22
-                                # LOE rcx rbp r9 r14 r15 edx esi edi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.11:                        # Preds ..B6.4 ..B6.10
-        movdqa    %xmm0, %xmm9                                  #4161.22
-        pand      %xmm1, %xmm0                                  #4162.22
-        andl      $-4, %edx                                     #4169.17
-        pand      %xmm2, %xmm9                                  #4161.22
-        pcmpeqw   %xmm0, %xmm9                                  #4163.22
-        pmovmskb  %xmm9, %r13d                                  #4164.22
-        movl      %esi, %ebx                                    #4172.29
-        orl       %r8d, %ebx                                    #4172.29
-        orl       %edi, %ebx                                    #4172.34
-        orl       %r13d, %ebx                                   #4172.39
-        je        ..B6.20       # Prob 78%                      #4172.47
-                                # LOE rcx rbp r9 r14 r15 edx esi edi r8d r10d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.12:                        # Preds ..B6.11
-        movl      %esi, %eax                                    #4190.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4190.30
-        movswq    %ax, %r12                                     #4190.30
-        movl      %r8d, %eax                                    #4191.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4191.30
-        movswq    %ax, %rbx                                     #4191.30
-        movl      %edi, %eax                                    #4192.30
-        lea       1(%rbx,%rbx), %ebx                            #4199.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4192.30
-        movswq    %ax, %r11                                     #4192.30
-        movl      %r13d, %eax                                   #4193.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4193.30
-        movswq    %ax, %rax                                     #4193.30
-        lea       2(%r11,%r11), %r11d                           #4200.40
-        lea       3(%rax,%rax), %eax                            #4201.40
-        testl     %esi, %esi                                    #4205.32
-        je        ..B6.14       # Prob 50%                      #4205.32
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r8d r10d r11d r12d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.13:                        # Preds ..B6.12
-        lea       (%rdx,%r12,2), %esi                           #4205.43
-        cmpl      %esi, %r10d                                   #4205.49
-        jae       ..B6.29       # Prob 20%                      #4205.49
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r8d r10d r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.14:                        # Preds ..B6.13 ..B6.12
-        testl     %r8d, %r8d                                    #4206.32
-        je        ..B6.16       # Prob 50%                      #4206.32
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r10d r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.15:                        # Preds ..B6.14
-        addl      %edx, %ebx                                    #4206.43
-        cmpl      %ebx, %r10d                                   #4206.49
-        jae       ..B6.29       # Prob 20%                      #4206.49
-                                # LOE rcx rbp r9 r14 r15 eax edx edi r10d r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.16:                        # Preds ..B6.15 ..B6.14
-        testl     %edi, %edi                                    #4207.32
-        je        ..B6.18       # Prob 50%                      #4207.32
-                                # LOE rcx rbp r9 r14 r15 eax edx r10d r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.17:                        # Preds ..B6.16
-        addl      %edx, %r11d                                   #4207.43
-        cmpl      %r11d, %r10d                                  #4207.49
-        jae       ..B6.29       # Prob 20%                      #4207.49
-                                # LOE rcx rbp r9 r14 r15 eax edx r10d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.18:                        # Preds ..B6.17 ..B6.16
-        testl     %r13d, %r13d                                  #4208.32
-        je        ..B6.20       # Prob 50%                      #4208.32
-                                # LOE rcx rbp r9 r14 r15 eax edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.19:                        # Preds ..B6.18
-        addl      %edx, %eax                                    #4208.43
-        cmpl      %eax, %r10d                                   #4208.49
-        jae       ..B6.29       # Prob 20%                      #4208.49
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.20:                        # Preds ..B6.19 ..B6.18 ..B6.11
-        lea       4(%rdx), %eax                                 #4241.13
-        cmpl      %eax, %r10d                                   #4216.28
-        jb        ..B6.26       # Prob 20%                      #4216.28
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.21:                        # Preds ..B6.20
-        cmpq      %r9, %rcx                                     #4237.25
-        jae       ..B6.26       # Prob 4%                       #4237.25
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.22:                        # Preds ..B6.21
-        addl      $32, %edx                                     #4241.13
-        cmpl      %r10d, %edx                                   #4242.24
-        ja        ..B6.26       # Prob 4%                       #4242.24
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.23:                        # Preds ..B6.22
-        movzbl    (%rcx), %ebx                                  #4247.22
-        movzbl    1(%rcx), %edi                                 #4247.22
-        movzbl    2(%rcx), %r11d                                #4247.22
-        movzbl    3(%rcx), %r13d                                #4247.22
-        lea       expand_2na.0(%rip), %rax                      #4247.22
-        movzwl    (%rax,%rbx,2), %esi                           #4247.22
-        movzwl    (%rax,%rdi,2), %r8d                           #4247.22
-        movzwl    (%rax,%r11,2), %r12d                          #4247.22
-        movzwl    (%rax,%r13,2), %ebx                           #4247.22
-        movw      %si, -16(%rsp)                                #4247.22
-        movzbl    4(%rcx), %esi                                 #4247.22
-        movzwl    (%rax,%rsi,2), %edi                           #4247.22
-        movw      %r8w, -14(%rsp)                               #4247.22
-        movzbl    5(%rcx), %r8d                                 #4247.22
-        movzwl    (%rax,%r8,2), %r11d                           #4247.22
-        movw      %r12w, -12(%rsp)                              #4247.22
-        movzbl    6(%rcx), %r12d                                #4247.22
-        movzwl    (%rax,%r12,2), %r13d                          #4247.22
-        movw      %bx, -10(%rsp)                                #4247.22
-        movzbl    7(%rcx), %ebx                                 #4247.22
-        movzwl    (%rax,%rbx,2), %eax                           #4247.22
-        movw      %di, -8(%rsp)                                 #4247.22
-        addq      $8, %rcx                                      #4262.13
-        movw      %r11w, -6(%rsp)                               #4247.22
-        movw      %r13w, -4(%rsp)                               #4247.22
-        movw      %ax, -2(%rsp)                                 #4247.22
-        movdqu    -16(%rsp), %xmm0                              #4247.22
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.24:                        # Preds ..B6.1 ..B6.4 ..B6.23
-        movdqa    %xmm0, %xmm10                                 #4140.22
-        movdqa    %xmm0, %xmm9                                  #4141.22
-        pand      %xmm8, %xmm10                                 #4140.22
-        pand      %xmm7, %xmm9                                  #4141.22
-        pcmpeqw   %xmm9, %xmm10                                 #4142.22
-        pmovmskb  %xmm10, %esi                                  #4143.22
-        jmp       ..B6.9        # Prob 100%                     #4143.22
-                                # LOE rcx rbp r9 r14 r15 edx esi r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B6.26:                        # Preds ..B6.20 ..B6.21 ..B6.22 # Infreq
-        xorl      %eax, %eax                                    #4273.12
-..___tag_value_eval_4na_16.413:                                 #4273.12
-        popq      %rbx                                          #4273.12
-..___tag_value_eval_4na_16.415:                                 #
-        popq      %r12                                          #4273.12
-..___tag_value_eval_4na_16.417:                                 #
-        popq      %r13                                          #4273.12
-..___tag_value_eval_4na_16.419:                                 #
-        ret                                                     #4273.12
-..___tag_value_eval_4na_16.420:                                 #
-                                # LOE
-..B6.29:                        # Preds ..B6.19 ..B6.17 ..B6.15 ..B6.13 # Infreq
-        movl      $1, %eax                                      #4205.63
-..___tag_value_eval_4na_16.424:                                 #4205.63
-        popq      %rbx                                          #4205.63
-..___tag_value_eval_4na_16.426:                                 #
-        popq      %r12                                          #4205.63
-..___tag_value_eval_4na_16.428:                                 #
-        popq      %r13                                          #4205.63
-..___tag_value_eval_4na_16.430:                                 #
-        ret                                                     #4205.63
-        .align    16,0x90
-..___tag_value_eval_4na_16.431:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_16, at function
-	.size	eval_4na_16,.-eval_4na_16
-	.data
-# -- End  eval_4na_16
-	.text
-# -- Begin  eval_2na_128
-# mark_begin;
-       .align    16,0x90
-eval_2na_128:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B7.1:                         # Preds ..B7.0
-..___tag_value_eval_2na_128.432:                                #3369.1
-        pushq     %r15                                          #3369.1
-..___tag_value_eval_2na_128.434:                                #
-        pushq     %r12                                          #3369.1
-..___tag_value_eval_2na_128.436:                                #
-        pushq     %rbx                                          #3369.1
-..___tag_value_eval_2na_128.438:                                #
-        lea       (%rdx,%rcx), %r15d                            #3406.5
-        movl      %edx, %eax                                    #3409.49
-        shrl      $2, %eax                                      #3409.49
-        subl      4(%rdi), %r15d                                #3412.12
-        lea       (%rsi,%rax), %rbx                             #3409.30
-        lea       3(%rdx,%rcx), %r11d                           #3415.50
-        shrl      $2, %r11d                                     #3415.57
-        addq      %rsi, %r11                                    #3415.30
-        testq     $15, %rbx                                     #3418.14
-        jne       ..B7.3        # Prob 50%                      #3418.14
-                                # LOE rax rbx rbp rsi rdi r11 r12 r13 r14 edx r15d
-..B7.2:                         # Preds ..B7.1
-        movdqa    (%rbx), %xmm0                                 #3418.14
-        jmp       ..B7.4        # Prob 100%                     #3418.14
-                                # LOE rax rbp rsi rdi r11 r12 r13 r14 edx r15d xmm0
-..B7.3:                         # Preds ..B7.1
-        movdqu    (%rbx), %xmm0                                 #3418.14
-                                # LOE rax rbp rsi rdi r11 r12 r13 r14 edx r15d xmm0
-..B7.4:                         # Preds ..B7.2 ..B7.3
-        lea       16(%rsi,%rax), %r10                           #3419.5
-        movq      %r10, %r9                                     #3419.5
-        cmpq      %r11, %r10                                    #3424.16
-        jae       ..B7.6        # Prob 12%                      #3424.16
-                                # LOE rbp rdi r9 r10 r11 r12 r13 r14 edx r8d r15d xmm0
-..B7.5:                         # Preds ..B7.4
-        movzbl    -1(%r10), %r8d                                #3425.24
-        shll      $8, %r8d                                      #3425.38
-                                # LOE rbp rdi r9 r10 r11 r12 r13 r14 edx r8d r15d xmm0
-..B7.6:                         # Preds ..B7.5 ..B7.4
-        movdqa    16(%rdi), %xmm8                               #3429.5
-        movdqa    32(%rdi), %xmm7                               #3429.5
-        movdqa    48(%rdi), %xmm6                               #3429.5
-        movdqa    64(%rdi), %xmm5                               #3429.5
-        movdqa    80(%rdi), %xmm4                               #3429.5
-        movdqa    96(%rdi), %xmm3                               #3429.5
-        movdqa    112(%rdi), %xmm2                              #3429.5
-        movdqa    128(%rdi), %xmm1                              #3429.5
-        xorl      %ebx, %ebx                                    #3432.15
-        xorl      %esi, %esi                                    #3432.10
-        xorl      %ecx, %ecx                                    #3432.5
-        movl      %r15d, %eax                                   #3434.20
-        subl      %edx, %eax                                    #3434.20
-        addl      $7, %eax                                      #3434.33
-        shrl      $2, %eax                                      #3434.40
-        movl      %edx, %edi                                    #3441.20
-        andl      $3, %edi                                      #3441.20
-        je        ..B7.29       # Prob 20%                      #3441.20
-                                # LOE rbp r9 r10 r11 r12 r13 r14 eax edx ecx ebx esi edi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.7:                         # Preds ..B7.6
-        cmpl      $1, %edi                                      #3441.20
-        je        ..B7.14       # Prob 25%                      #3441.20
-                                # LOE rbp r9 r10 r11 r12 r13 r14 eax edx ecx ebx esi edi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.8:                         # Preds ..B7.7
-        cmpl      $2, %edi                                      #3441.20
-        je        ..B7.15       # Prob 33%                      #3441.20
-                                # LOE rbp r9 r10 r11 r12 r13 r14 eax edx ecx ebx esi edi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.9:                         # Preds ..B7.8
-        cmpl      $3, %edi                                      #3441.20
-        je        ..B7.16       # Prob 50%                      #3441.20
-        jmp       ..B7.25       # Prob 100%                     #3441.20
-                                # LOE rbp r9 r10 r11 r12 r13 r14 eax edx ecx ebx esi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.14:                        # Preds ..B7.7 ..B7.29
-        movdqa    %xmm0, %xmm9                                  #3464.22
-        pand      %xmm5, %xmm9                                  #3464.22
-        pcmpeqd   %xmm6, %xmm9                                  #3465.22
-        pmovmskb  %xmm9, %esi                                   #3466.22
-        incl      %esi                                          #3467.17
-        shrl      $16, %esi                                     #3467.17
-        negl      %esi                                          #3467.17
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx ecx esi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.15:                        # Preds ..B7.8 ..B7.14
-        movdqa    %xmm0, %xmm9                                  #3470.22
-        pand      %xmm3, %xmm9                                  #3470.22
-        pcmpeqd   %xmm4, %xmm9                                  #3471.22
-        pmovmskb  %xmm9, %ebx                                   #3472.22
-        incl      %ebx                                          #3473.17
-        shrl      $16, %ebx                                     #3473.17
-        negl      %ebx                                          #3473.17
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx ecx ebx esi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.16:                        # Preds ..B7.9 ..B7.15
-        movdqa    %xmm0, %xmm9                                  #3476.22
-        andl      $-4, %edx                                     #3483.17
-        movl      %ecx, %r12d                                   #3486.29
-        pand      %xmm1, %xmm9                                  #3476.22
-        pcmpeqd   %xmm2, %xmm9                                  #3477.22
-        pmovmskb  %xmm9, %edi                                   #3478.22
-        orl       %esi, %r12d                                   #3486.29
-        orl       %ebx, %r12d                                   #3486.34
-        incl      %edi                                          #3479.17
-        shrl      $16, %edi                                     #3479.17
-        negl      %edi                                          #3479.17
-        orl       %edi, %r12d                                   #3486.39
-        jne       ..B7.30       # Prob 20%                      #3486.47
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx ecx ebx esi r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.17:                        # Preds ..B7.16
-        addl      $4, %edx                                      #3527.17
-        cmpl      %r15d, %edx                                   #3530.28
-        ja        ..B7.38       # Prob 20%                      #3530.28
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.18:                        # Preds ..B7.17
-        decl      %eax                                          #3534.25
-        jne       ..B7.26       # Prob 50%                      #3534.39
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.19:                        # Preds ..B7.18
-        cmpq      %r11, %r10                                    #3555.25
-        jae       ..B7.38       # Prob 4%                       #3555.25
-                                # LOE rbp r10 r11 r13 r14 edx r8d r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.20:                        # Preds ..B7.19
-        testq     $15, %r10                                     #3565.22
-        jne       ..B7.22       # Prob 50%                      #3565.22
-                                # LOE rbp r10 r11 r13 r14 edx r8d r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.21:                        # Preds ..B7.20
-        movdqa    (%r10), %xmm0                                 #3565.22
-        jmp       ..B7.23       # Prob 100%                     #3565.22
-                                # LOE rbp r10 r11 r13 r14 edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.22:                        # Preds ..B7.20
-        movdqu    (%r10), %xmm0                                 #3565.22
-                                # LOE rbp r10 r11 r13 r14 edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.23:                        # Preds ..B7.21 ..B7.22
-        addq      $16, %r10                                     #3643.13
-        movq      %r10, %r9                                     #3643.13
-        cmpq      %r11, %r10                                    #3646.24
-        jae       ..B7.25       # Prob 12%                      #3646.24
-                                # LOE rbp r9 r10 r11 r13 r14 edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.24:                        # Preds ..B7.23
-        movzbl    -1(%r10), %r8d                                #3647.32
-        shll      $8, %r8d                                      #3647.46
-                                # LOE rbp r9 r10 r11 r13 r14 edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.25:                        # Preds ..B7.9 ..B7.23 ..B7.24
-        movl      $16, %eax                                     #3448.13
-        jmp       ..B7.29       # Prob 100%                     #3448.13
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.26:                        # Preds ..B7.18
-        psrldq    $1, %xmm0                                     #3539.26
-        cmpq      %r11, %r9                                     #3542.26
-        jae       ..B7.28       # Prob 19%                      #3542.26
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.27:                        # Preds ..B7.26
-        movzbl    (%r9), %ecx                                   #3545.37
-        sarl      $8, %r8d                                      #3544.21
-        shll      $8, %ecx                                      #3545.48
-        orl       %ecx, %r8d                                    #3545.21
-        pinsrw    $7, %r8d, %xmm0                               #3546.30
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.28:                        # Preds ..B7.27 ..B7.26
-        incq      %r9                                           #3550.20
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.29:                        # Preds ..B7.6 ..B7.25 ..B7.28
-        movdqa    %xmm0, %xmm9                                  #3458.22
-        pand      %xmm7, %xmm9                                  #3458.22
-        pcmpeqd   %xmm8, %xmm9                                  #3459.22
-        pmovmskb  %xmm9, %ecx                                   #3460.22
-        incl      %ecx                                          #3461.17
-        shrl      $16, %ecx                                     #3461.17
-        negl      %ecx                                          #3461.17
-        jmp       ..B7.14       # Prob 100%                     #3461.17
-                                # LOE rbp r9 r10 r11 r13 r14 eax edx ecx r8d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B7.30:                        # Preds ..B7.16                 # Infreq
-        subl      %edx, %r15d                                   #3489.30
-        cmpl      $2, %r15d                                     #3489.37
-        je        ..B7.34       # Prob 25%                      #3489.37
-                                # LOE rbp r12 r13 r14 ecx ebx esi r15d
-..B7.31:                        # Preds ..B7.30                 # Infreq
-        cmpl      $1, %r15d                                     #3489.37
-        je        ..B7.35       # Prob 33%                      #3489.37
-                                # LOE rbp r12 r13 r14 ecx esi r15d
-..B7.32:                        # Preds ..B7.31                 # Infreq
-        testl     %r15d, %r15d                                  #3489.37
-        je        ..B7.36       # Prob 50%                      #3489.37
-                                # LOE rbp r12 r13 r14 ecx
-..B7.33:                        # Preds ..B7.32                 # Infreq
-        movl      $1, %eax                                      #3492.32
-..___tag_value_eval_2na_128.441:                                #3492.32
-        popq      %rbx                                          #3492.32
-..___tag_value_eval_2na_128.442:                                #
-        popq      %r12                                          #3492.32
-..___tag_value_eval_2na_128.444:                                #
-        popq      %r15                                          #3492.32
-..___tag_value_eval_2na_128.446:                                #
-        ret                                                     #3492.32
-..___tag_value_eval_2na_128.447:                                #
-                                # LOE
-..B7.34:                        # Preds ..B7.30                 # Infreq
-        testl     %ebx, %ebx                                    #3494.36
-        jne       ..B7.37       # Prob 28%                      #3494.36
-                                # LOE rbp r12 r13 r14 ecx esi
-..B7.35:                        # Preds ..B7.34 ..B7.31         # Infreq
-        testl     %esi, %esi                                    #3496.36
-        jne       ..B7.37       # Prob 28%                      #3496.36
-                                # LOE rbp r12 r13 r14 ecx
-..B7.36:                        # Preds ..B7.35 ..B7.32         # Infreq
-        testl     %ecx, %ecx                                    #3498.36
-        je        ..B7.38       # Prob 50%                      #3498.36
-                                # LOE rbp r12 r13 r14
-..B7.37:                        # Preds ..B7.34 ..B7.35 ..B7.36 # Infreq
-        movl      $1, %eax                                      #3498.47
-..___tag_value_eval_2na_128.451:                                #3498.47
-        popq      %rbx                                          #3498.47
-..___tag_value_eval_2na_128.452:                                #
-        popq      %r12                                          #3498.47
-..___tag_value_eval_2na_128.454:                                #
-        popq      %r15                                          #3498.47
-..___tag_value_eval_2na_128.456:                                #
-        ret                                                     #3498.47
-..___tag_value_eval_2na_128.457:                                #
-                                # LOE
-..B7.38:                        # Preds ..B7.17 ..B7.19 ..B7.36 # Infreq
-        xorl      %eax, %eax                                    #3500.28
-..___tag_value_eval_2na_128.461:                                #3500.28
-        popq      %rbx                                          #3500.28
-..___tag_value_eval_2na_128.462:                                #
-        popq      %r12                                          #3500.28
-..___tag_value_eval_2na_128.464:                                #
-        popq      %r15                                          #3500.28
-..___tag_value_eval_2na_128.466:                                #
-        ret                                                     #3500.28
-        .align    16,0x90
-..___tag_value_eval_2na_128.467:                                #
-                                # LOE
-# mark_end;
-	.type	eval_2na_128, at function
-	.size	eval_2na_128,.-eval_2na_128
-	.data
-# -- End  eval_2na_128
-	.text
-# -- Begin  eval_2na_32
-# mark_begin;
-       .align    16,0x90
-eval_2na_32:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B8.1:                         # Preds ..B8.0
-..___tag_value_eval_2na_32.468:                                 #2782.1
-        pushq     %r15                                          #2782.1
-..___tag_value_eval_2na_32.470:                                 #
-        pushq     %r14                                          #2782.1
-..___tag_value_eval_2na_32.472:                                 #
-        pushq     %r13                                          #2782.1
-..___tag_value_eval_2na_32.474:                                 #
-        pushq     %r12                                          #2782.1
-..___tag_value_eval_2na_32.476:                                 #
-        pushq     %rbp                                          #2782.1
-..___tag_value_eval_2na_32.478:                                 #
-        pushq     %rbx                                          #2782.1
-..___tag_value_eval_2na_32.480:                                 #
-        lea       (%rdx,%rcx), %r15d                            #2819.5
-        movl      %edx, %eax                                    #2822.49
-        shrl      $2, %eax                                      #2822.49
-        subl      4(%rdi), %r15d                                #2825.12
-        lea       (%rsi,%rax), %r8                              #2822.30
-        lea       3(%rdx,%rcx), %r14d                           #2828.50
-        shrl      $2, %r14d                                     #2828.57
-        addq      %rsi, %r14                                    #2828.30
-        testq     $15, %r8                                      #2831.14
-        jne       ..B8.3        # Prob 50%                      #2831.14
-                                # LOE rax rbx rbp rsi rdi r8 r12 r13 r14 edx r15d
-..B8.2:                         # Preds ..B8.1
-        movdqa    (%r8), %xmm0                                  #2831.14
-        jmp       ..B8.4        # Prob 100%                     #2831.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B8.3:                         # Preds ..B8.1
-        movdqu    (%r8), %xmm0                                  #2831.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B8.4:                         # Preds ..B8.2 ..B8.3
-        lea       16(%rsi,%rax), %r8                            #2832.5
-        movq      %r8, %rsi                                     #2832.5
-        cmpq      %r14, %r8                                     #2837.16
-        jae       ..B8.6        # Prob 12%                      #2837.16
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B8.5:                         # Preds ..B8.4
-        movzbl    -1(%r8), %ecx                                 #2838.24
-        shll      $8, %ecx                                      #2838.38
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B8.6:                         # Preds ..B8.5 ..B8.4
-        movdqa    16(%rdi), %xmm8                               #2842.5
-        movdqa    32(%rdi), %xmm7                               #2842.5
-        movdqa    48(%rdi), %xmm6                               #2842.5
-        movdqa    64(%rdi), %xmm5                               #2842.5
-        movdqa    80(%rdi), %xmm4                               #2842.5
-        movdqa    96(%rdi), %xmm3                               #2842.5
-        movdqa    112(%rdi), %xmm2                              #2842.5
-        movdqa    128(%rdi), %xmm1                              #2842.5
-        xorl      %r10d, %r10d                                  #2845.15
-        xorl      %r11d, %r11d                                  #2845.10
-        xorl      %r9d, %r9d                                    #2845.5
-        movl      $4, %edi                                      #2849.5
-        movl      %edx, %eax                                    #2854.20
-        andl      $3, %eax                                      #2854.20
-        je        ..B8.38       # Prob 20%                      #2854.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.7:                         # Preds ..B8.6
-        cmpl      $1, %eax                                      #2854.20
-        je        ..B8.14       # Prob 25%                      #2854.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.8:                         # Preds ..B8.7
-        cmpl      $2, %eax                                      #2854.20
-        je        ..B8.15       # Prob 33%                      #2854.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.9:                         # Preds ..B8.8
-        cmpl      $3, %eax                                      #2854.20
-        je        ..B8.16       # Prob 50%                      #2854.20
-        jmp       ..B8.34       # Prob 100%                     #2854.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.14:                        # Preds ..B8.7 ..B8.38
-        movdqa    %xmm0, %xmm9                                  #2877.22
-        pand      %xmm5, %xmm9                                  #2877.22
-        pcmpeqd   %xmm6, %xmm9                                  #2878.22
-        pmovmskb  %xmm9, %r11d                                  #2879.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.15:                        # Preds ..B8.8 ..B8.14
-        movdqa    %xmm0, %xmm9                                  #2883.22
-        pand      %xmm3, %xmm9                                  #2883.22
-        pcmpeqd   %xmm4, %xmm9                                  #2884.22
-        pmovmskb  %xmm9, %r10d                                  #2885.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.16:                        # Preds ..B8.9 ..B8.15
-        movdqa    %xmm0, %xmm9                                  #2889.22
-        movl      %edx, %ebx                                    #2896.17
-        andl      $-4, %ebx                                     #2896.17
-        pand      %xmm1, %xmm9                                  #2889.22
-        pcmpeqd   %xmm2, %xmm9                                  #2890.22
-        pmovmskb  %xmm9, %ebp                                   #2891.22
-        movl      %r9d, %edx                                    #2899.29
-        orl       %r11d, %edx                                   #2899.29
-        orl       %r10d, %edx                                   #2899.34
-        orl       %ebp, %edx                                    #2899.39
-        je        ..B8.25       # Prob 78%                      #2899.47
-                                # LOE rsi r8 r14 ecx ebx ebp edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.17:                        # Preds ..B8.16
-        movl      %r9d, %eax                                    #2917.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2917.30
-        movswq    %ax, %r13                                     #2917.30
-        movl      %r11d, %eax                                   #2918.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2918.30
-        movswq    %ax, %r12                                     #2918.30
-        movl      %r10d, %eax                                   #2919.30
-        shll      $2, %r13d                                     #2925.34
-        shll      $2, %r12d                                     #2926.34
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2919.30
-        movswq    %ax, %rdx                                     #2919.30
-        movl      %ebp, %eax                                    #2920.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2920.30
-        movswq    %ax, %rax                                     #2920.30
-        shll      $2, %edx                                      #2927.34
-        shll      $2, %eax                                      #2928.34
-        testl     %r9d, %r9d                                    #2932.32
-        je        ..B8.19       # Prob 50%                      #2932.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r13d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.18:                        # Preds ..B8.17
-        addl      %ebx, %r13d                                   #2932.43
-        cmpl      %r13d, %r15d                                  #2932.49
-        jae       ..B8.43       # Prob 20%                      #2932.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.19:                        # Preds ..B8.18 ..B8.17
-        testl     %r11d, %r11d                                  #2933.32
-        je        ..B8.21       # Prob 50%                      #2933.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.20:                        # Preds ..B8.19
-        lea       1(%rbx,%r12), %r9d                            #2933.43
-        cmpl      %r9d, %r15d                                   #2933.49
-        jae       ..B8.43       # Prob 20%                      #2933.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.21:                        # Preds ..B8.20 ..B8.19
-        testl     %r10d, %r10d                                  #2934.32
-        je        ..B8.23       # Prob 50%                      #2934.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.22:                        # Preds ..B8.21
-        lea       2(%rbx,%rdx), %edx                            #2934.43
-        cmpl      %edx, %r15d                                   #2934.49
-        jae       ..B8.43       # Prob 20%                      #2934.49
-                                # LOE rsi r8 r14 eax ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.23:                        # Preds ..B8.22 ..B8.21
-        testl     %ebp, %ebp                                    #2935.32
-        je        ..B8.25       # Prob 50%                      #2935.32
-                                # LOE rsi r8 r14 eax ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.24:                        # Preds ..B8.23
-        lea       3(%rbx,%rax), %eax                            #2935.43
-        cmpl      %eax, %r15d                                   #2935.49
-        jae       ..B8.43       # Prob 20%                      #2935.49
-                                # LOE rsi r8 r14 ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.25:                        # Preds ..B8.24 ..B8.23 ..B8.16
-        lea       4(%rbx), %edx                                 #2940.17
-        cmpl      %r15d, %edx                                   #2943.28
-        ja        ..B8.40       # Prob 20%                      #2943.28
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.26:                        # Preds ..B8.25
-        decl      %edi                                          #2947.25
-        jne       ..B8.35       # Prob 50%                      #2947.39
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.27:                        # Preds ..B8.26
-        cmpq      %r14, %r8                                     #2968.25
-        jae       ..B8.40       # Prob 4%                       #2968.25
-                                # LOE r8 r14 ecx ebx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.28:                        # Preds ..B8.27
-        lea       52(%rbx), %edx                                #2972.13
-        cmpl      %r15d, %edx                                   #2973.24
-        ja        ..B8.40       # Prob 4%                       #2973.24
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.29:                        # Preds ..B8.28
-        testq     $15, %r8                                      #2978.22
-        jne       ..B8.31       # Prob 50%                      #2978.22
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.30:                        # Preds ..B8.29
-        movdqa    (%r8), %xmm0                                  #2978.22
-        jmp       ..B8.32       # Prob 100%                     #2978.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.31:                        # Preds ..B8.29
-        movdqu    (%r8), %xmm0                                  #2978.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.32:                        # Preds ..B8.30 ..B8.31
-        addq      $16, %r8                                      #3056.13
-        movq      %r8, %rsi                                     #3056.13
-        cmpq      %r14, %r8                                     #3059.24
-        jae       ..B8.34       # Prob 12%                      #3059.24
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.33:                        # Preds ..B8.32
-        movzbl    -1(%r8), %ecx                                 #3060.32
-        shll      $8, %ecx                                      #3060.46
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.34:                        # Preds ..B8.9 ..B8.32 ..B8.33
-        movl      $4, %edi                                      #2861.13
-        jmp       ..B8.38       # Prob 100%                     #2861.13
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.35:                        # Preds ..B8.26
-        psrldq    $1, %xmm0                                     #2952.26
-        cmpq      %r14, %rsi                                    #2955.26
-        jae       ..B8.37       # Prob 19%                      #2955.26
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.36:                        # Preds ..B8.35
-        movzbl    (%rsi), %eax                                  #2958.37
-        sarl      $8, %ecx                                      #2957.21
-        shll      $8, %eax                                      #2958.48
-        orl       %eax, %ecx                                    #2958.21
-        pinsrw    $7, %ecx, %xmm0                               #2959.30
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.37:                        # Preds ..B8.36 ..B8.35
-        incq      %rsi                                          #2963.20
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.38:                        # Preds ..B8.6 ..B8.34 ..B8.37
-        movdqa    %xmm0, %xmm9                                  #2871.22
-        pand      %xmm7, %xmm9                                  #2871.22
-        pcmpeqd   %xmm8, %xmm9                                  #2872.22
-        pmovmskb  %xmm9, %r9d                                   #2873.22
-        jmp       ..B8.14       # Prob 100%                     #2873.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B8.40:                        # Preds ..B8.25 ..B8.27 ..B8.28 # Infreq
-        xorl      %eax, %eax                                    #3069.12
-..___tag_value_eval_2na_32.483:                                 #3069.12
-        popq      %rbx                                          #3069.12
-..___tag_value_eval_2na_32.485:                                 #
-        popq      %rbp                                          #3069.12
-..___tag_value_eval_2na_32.487:                                 #
-        popq      %r12                                          #3069.12
-..___tag_value_eval_2na_32.489:                                 #
-        popq      %r13                                          #3069.12
-..___tag_value_eval_2na_32.491:                                 #
-        popq      %r14                                          #3069.12
-..___tag_value_eval_2na_32.493:                                 #
-        popq      %r15                                          #3069.12
-..___tag_value_eval_2na_32.495:                                 #
-        ret                                                     #3069.12
-..___tag_value_eval_2na_32.496:                                 #
-                                # LOE
-..B8.43:                        # Preds ..B8.22 ..B8.20 ..B8.18 ..B8.24 # Infreq
-        movl      $1, %eax                                      #2935.63
-..___tag_value_eval_2na_32.503:                                 #2935.63
-        popq      %rbx                                          #2935.63
-..___tag_value_eval_2na_32.505:                                 #
-        popq      %rbp                                          #2935.63
-..___tag_value_eval_2na_32.507:                                 #
-        popq      %r12                                          #2935.63
-..___tag_value_eval_2na_32.509:                                 #
-        popq      %r13                                          #2935.63
-..___tag_value_eval_2na_32.511:                                 #
-        popq      %r14                                          #2935.63
-..___tag_value_eval_2na_32.513:                                 #
-        popq      %r15                                          #2935.63
-..___tag_value_eval_2na_32.515:                                 #
-        ret                                                     #2935.63
-        .align    16,0x90
-..___tag_value_eval_2na_32.516:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_32, at function
-	.size	eval_2na_32,.-eval_2na_32
-	.data
-# -- End  eval_2na_32
-	.text
-# -- Begin  eval_2na_16
-# mark_begin;
-       .align    16,0x90
-eval_2na_16:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B9.1:                         # Preds ..B9.0
-..___tag_value_eval_2na_16.517:                                 #2489.1
-        pushq     %r15                                          #2489.1
-..___tag_value_eval_2na_16.519:                                 #
-        pushq     %r14                                          #2489.1
-..___tag_value_eval_2na_16.521:                                 #
-        pushq     %r13                                          #2489.1
-..___tag_value_eval_2na_16.523:                                 #
-        pushq     %r12                                          #2489.1
-..___tag_value_eval_2na_16.525:                                 #
-        pushq     %rbp                                          #2489.1
-..___tag_value_eval_2na_16.527:                                 #
-        pushq     %rbx                                          #2489.1
-..___tag_value_eval_2na_16.529:                                 #
-        lea       (%rdx,%rcx), %r15d                            #2526.5
-        movl      %edx, %eax                                    #2529.49
-        shrl      $2, %eax                                      #2529.49
-        subl      4(%rdi), %r15d                                #2532.12
-        lea       (%rsi,%rax), %r8                              #2529.30
-        lea       3(%rdx,%rcx), %r14d                           #2535.50
-        shrl      $2, %r14d                                     #2535.57
-        addq      %rsi, %r14                                    #2535.30
-        testq     $15, %r8                                      #2538.14
-        jne       ..B9.3        # Prob 50%                      #2538.14
-                                # LOE rax rbx rbp rsi rdi r8 r12 r13 r14 edx r15d
-..B9.2:                         # Preds ..B9.1
-        movdqa    (%r8), %xmm0                                  #2538.14
-        jmp       ..B9.4        # Prob 100%                     #2538.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B9.3:                         # Preds ..B9.1
-        movdqu    (%r8), %xmm0                                  #2538.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B9.4:                         # Preds ..B9.2 ..B9.3
-        lea       16(%rsi,%rax), %r8                            #2539.5
-        movq      %r8, %rsi                                     #2539.5
-        cmpq      %r14, %r8                                     #2544.16
-        jae       ..B9.6        # Prob 12%                      #2544.16
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B9.5:                         # Preds ..B9.4
-        movzbl    -1(%r8), %ecx                                 #2545.24
-        shll      $8, %ecx                                      #2545.38
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B9.6:                         # Preds ..B9.5 ..B9.4
-        movdqa    16(%rdi), %xmm8                               #2549.5
-        movdqa    32(%rdi), %xmm7                               #2549.5
-        movdqa    48(%rdi), %xmm6                               #2549.5
-        movdqa    64(%rdi), %xmm5                               #2549.5
-        movdqa    80(%rdi), %xmm4                               #2549.5
-        movdqa    96(%rdi), %xmm3                               #2549.5
-        movdqa    112(%rdi), %xmm2                              #2549.5
-        movdqa    128(%rdi), %xmm1                              #2549.5
-        xorl      %r10d, %r10d                                  #2552.15
-        xorl      %r11d, %r11d                                  #2552.10
-        xorl      %r9d, %r9d                                    #2552.5
-        movl      $2, %edi                                      #2556.5
-        movl      %edx, %eax                                    #2561.20
-        andl      $3, %eax                                      #2561.20
-        je        ..B9.38       # Prob 20%                      #2561.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.7:                         # Preds ..B9.6
-        cmpl      $1, %eax                                      #2561.20
-        je        ..B9.14       # Prob 25%                      #2561.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.8:                         # Preds ..B9.7
-        cmpl      $2, %eax                                      #2561.20
-        je        ..B9.15       # Prob 33%                      #2561.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.9:                         # Preds ..B9.8
-        cmpl      $3, %eax                                      #2561.20
-        je        ..B9.16       # Prob 50%                      #2561.20
-        jmp       ..B9.34       # Prob 100%                     #2561.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.14:                        # Preds ..B9.7 ..B9.38
-        movdqa    %xmm0, %xmm9                                  #2584.22
-        pand      %xmm5, %xmm9                                  #2584.22
-        pcmpeqw   %xmm6, %xmm9                                  #2585.22
-        pmovmskb  %xmm9, %r11d                                  #2586.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.15:                        # Preds ..B9.8 ..B9.14
-        movdqa    %xmm0, %xmm9                                  #2590.22
-        pand      %xmm3, %xmm9                                  #2590.22
-        pcmpeqw   %xmm4, %xmm9                                  #2591.22
-        pmovmskb  %xmm9, %r10d                                  #2592.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.16:                        # Preds ..B9.9 ..B9.15
-        movdqa    %xmm0, %xmm9                                  #2596.22
-        movl      %edx, %ebx                                    #2603.17
-        andl      $-4, %ebx                                     #2603.17
-        pand      %xmm1, %xmm9                                  #2596.22
-        pcmpeqw   %xmm2, %xmm9                                  #2597.22
-        pmovmskb  %xmm9, %ebp                                   #2598.22
-        movl      %r9d, %edx                                    #2606.29
-        orl       %r11d, %edx                                   #2606.29
-        orl       %r10d, %edx                                   #2606.34
-        orl       %ebp, %edx                                    #2606.39
-        je        ..B9.25       # Prob 78%                      #2606.47
-                                # LOE rsi r8 r14 ecx ebx ebp edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.17:                        # Preds ..B9.16
-        movl      %r9d, %eax                                    #2624.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2624.30
-        movswq    %ax, %r13                                     #2624.30
-        movl      %r11d, %eax                                   #2625.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2625.30
-        movswq    %ax, %r12                                     #2625.30
-        movl      %r10d, %eax                                   #2626.30
-        shll      $2, %r13d                                     #2632.34
-        shll      $2, %r12d                                     #2633.34
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2626.30
-        movswq    %ax, %rdx                                     #2626.30
-        movl      %ebp, %eax                                    #2627.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2627.30
-        movswq    %ax, %rax                                     #2627.30
-        shll      $2, %edx                                      #2634.34
-        shll      $2, %eax                                      #2635.34
-        testl     %r9d, %r9d                                    #2639.32
-        je        ..B9.19       # Prob 50%                      #2639.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r13d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.18:                        # Preds ..B9.17
-        addl      %ebx, %r13d                                   #2639.43
-        cmpl      %r13d, %r15d                                  #2639.49
-        jae       ..B9.43       # Prob 20%                      #2639.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.19:                        # Preds ..B9.18 ..B9.17
-        testl     %r11d, %r11d                                  #2640.32
-        je        ..B9.21       # Prob 50%                      #2640.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.20:                        # Preds ..B9.19
-        lea       1(%rbx,%r12), %r9d                            #2640.43
-        cmpl      %r9d, %r15d                                   #2640.49
-        jae       ..B9.43       # Prob 20%                      #2640.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.21:                        # Preds ..B9.20 ..B9.19
-        testl     %r10d, %r10d                                  #2641.32
-        je        ..B9.23       # Prob 50%                      #2641.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.22:                        # Preds ..B9.21
-        lea       2(%rbx,%rdx), %edx                            #2641.43
-        cmpl      %edx, %r15d                                   #2641.49
-        jae       ..B9.43       # Prob 20%                      #2641.49
-                                # LOE rsi r8 r14 eax ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.23:                        # Preds ..B9.22 ..B9.21
-        testl     %ebp, %ebp                                    #2642.32
-        je        ..B9.25       # Prob 50%                      #2642.32
-                                # LOE rsi r8 r14 eax ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.24:                        # Preds ..B9.23
-        lea       3(%rbx,%rax), %eax                            #2642.43
-        cmpl      %eax, %r15d                                   #2642.49
-        jae       ..B9.43       # Prob 20%                      #2642.49
-                                # LOE rsi r8 r14 ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.25:                        # Preds ..B9.24 ..B9.23 ..B9.16
-        lea       4(%rbx), %edx                                 #2647.17
-        cmpl      %r15d, %edx                                   #2650.28
-        ja        ..B9.40       # Prob 20%                      #2650.28
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.26:                        # Preds ..B9.25
-        decl      %edi                                          #2654.25
-        jne       ..B9.35       # Prob 50%                      #2654.39
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.27:                        # Preds ..B9.26
-        cmpq      %r14, %r8                                     #2675.25
-        jae       ..B9.40       # Prob 4%                       #2675.25
-                                # LOE r8 r14 ecx ebx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.28:                        # Preds ..B9.27
-        lea       60(%rbx), %edx                                #2679.13
-        cmpl      %r15d, %edx                                   #2680.24
-        ja        ..B9.40       # Prob 4%                       #2680.24
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.29:                        # Preds ..B9.28
-        testq     $15, %r8                                      #2685.22
-        jne       ..B9.31       # Prob 50%                      #2685.22
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.30:                        # Preds ..B9.29
-        movdqa    (%r8), %xmm0                                  #2685.22
-        jmp       ..B9.32       # Prob 100%                     #2685.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.31:                        # Preds ..B9.29
-        movdqu    (%r8), %xmm0                                  #2685.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.32:                        # Preds ..B9.30 ..B9.31
-        addq      $16, %r8                                      #2763.13
-        movq      %r8, %rsi                                     #2763.13
-        cmpq      %r14, %r8                                     #2766.24
-        jae       ..B9.34       # Prob 12%                      #2766.24
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.33:                        # Preds ..B9.32
-        movzbl    -1(%r8), %ecx                                 #2767.32
-        shll      $8, %ecx                                      #2767.46
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.34:                        # Preds ..B9.9 ..B9.32 ..B9.33
-        movl      $2, %edi                                      #2568.13
-        jmp       ..B9.38       # Prob 100%                     #2568.13
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.35:                        # Preds ..B9.26
-        psrldq    $1, %xmm0                                     #2659.26
-        cmpq      %r14, %rsi                                    #2662.26
-        jae       ..B9.37       # Prob 19%                      #2662.26
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.36:                        # Preds ..B9.35
-        movzbl    (%rsi), %eax                                  #2665.37
-        sarl      $8, %ecx                                      #2664.21
-        shll      $8, %eax                                      #2665.48
-        orl       %eax, %ecx                                    #2665.21
-        pinsrw    $7, %ecx, %xmm0                               #2666.30
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.37:                        # Preds ..B9.36 ..B9.35
-        incq      %rsi                                          #2670.20
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.38:                        # Preds ..B9.6 ..B9.34 ..B9.37
-        movdqa    %xmm0, %xmm9                                  #2578.22
-        pand      %xmm7, %xmm9                                  #2578.22
-        pcmpeqw   %xmm8, %xmm9                                  #2579.22
-        pmovmskb  %xmm9, %r9d                                   #2580.22
-        jmp       ..B9.14       # Prob 100%                     #2580.22
-                                # LOE rsi r8 r14 edx ecx edi r9d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B9.40:                        # Preds ..B9.25 ..B9.27 ..B9.28 # Infreq
-        xorl      %eax, %eax                                    #2776.12
-..___tag_value_eval_2na_16.532:                                 #2776.12
-        popq      %rbx                                          #2776.12
-..___tag_value_eval_2na_16.534:                                 #
-        popq      %rbp                                          #2776.12
-..___tag_value_eval_2na_16.536:                                 #
-        popq      %r12                                          #2776.12
-..___tag_value_eval_2na_16.538:                                 #
-        popq      %r13                                          #2776.12
-..___tag_value_eval_2na_16.540:                                 #
-        popq      %r14                                          #2776.12
-..___tag_value_eval_2na_16.542:                                 #
-        popq      %r15                                          #2776.12
-..___tag_value_eval_2na_16.544:                                 #
-        ret                                                     #2776.12
-..___tag_value_eval_2na_16.545:                                 #
-                                # LOE
-..B9.43:                        # Preds ..B9.22 ..B9.20 ..B9.18 ..B9.24 # Infreq
-        movl      $1, %eax                                      #2642.63
-..___tag_value_eval_2na_16.552:                                 #2642.63
-        popq      %rbx                                          #2642.63
-..___tag_value_eval_2na_16.554:                                 #
-        popq      %rbp                                          #2642.63
-..___tag_value_eval_2na_16.556:                                 #
-        popq      %r12                                          #2642.63
-..___tag_value_eval_2na_16.558:                                 #
-        popq      %r13                                          #2642.63
-..___tag_value_eval_2na_16.560:                                 #
-        popq      %r14                                          #2642.63
-..___tag_value_eval_2na_16.562:                                 #
-        popq      %r15                                          #2642.63
-..___tag_value_eval_2na_16.564:                                 #
-        ret                                                     #2642.63
-        .align    16,0x90
-..___tag_value_eval_2na_16.565:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_16, at function
-	.size	eval_2na_16,.-eval_2na_16
-	.data
-# -- End  eval_2na_16
-	.text
-# -- Begin  eval_2na_8
-# mark_begin;
-       .align    16,0x90
-eval_2na_8:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B10.1:                        # Preds ..B10.0
-..___tag_value_eval_2na_8.566:                                  #2196.1
-        pushq     %r13                                          #2196.1
-..___tag_value_eval_2na_8.568:                                  #
-        pushq     %r12                                          #2196.1
-..___tag_value_eval_2na_8.570:                                  #
-        pushq     %rbx                                          #2196.1
-..___tag_value_eval_2na_8.572:                                  #
-        lea       (%rdx,%rcx), %r10d                            #2233.5
-        movl      %edx, %eax                                    #2236.49
-        shrl      $2, %eax                                      #2236.49
-        subl      4(%rdi), %r10d                                #2239.12
-        lea       (%rsi,%rax), %r8                              #2236.30
-        lea       3(%rdx,%rcx), %r9d                            #2242.50
-        shrl      $2, %r9d                                      #2242.57
-        addq      %rsi, %r9                                     #2242.30
-        testq     $15, %r8                                      #2245.14
-        jne       ..B10.3       # Prob 50%                      #2245.14
-                                # LOE rax rbx rbp rsi rdi r8 r9 r12 r13 r14 r15 edx r10d
-..B10.2:                        # Preds ..B10.1
-        movdqa    (%r8), %xmm0                                  #2245.14
-        jmp       ..B10.4       # Prob 100%                     #2245.14
-                                # LOE rax rbx rbp rsi rdi r9 r12 r13 r14 r15 edx r10d xmm0
-..B10.3:                        # Preds ..B10.1
-        movdqu    (%r8), %xmm0                                  #2245.14
-                                # LOE rax rbx rbp rsi rdi r9 r12 r13 r14 r15 edx r10d xmm0
-..B10.4:                        # Preds ..B10.2 ..B10.3
-        movdqa    16(%rdi), %xmm8                               #2256.5
-        movdqa    32(%rdi), %xmm7                               #2256.5
-        movdqa    48(%rdi), %xmm6                               #2256.5
-        movdqa    64(%rdi), %xmm5                               #2256.5
-        movdqa    80(%rdi), %xmm4                               #2256.5
-        movdqa    96(%rdi), %xmm3                               #2256.5
-        movdqa    112(%rdi), %xmm2                              #2256.5
-        movdqa    128(%rdi), %xmm1                              #2256.5
-        lea       16(%rsi,%rax), %rcx                           #2246.5
-        xorl      %edi, %edi                                    #2259.15
-        xorl      %r8d, %r8d                                    #2259.10
-        xorl      %esi, %esi                                    #2259.5
-        movl      %edx, %r11d                                   #2268.20
-        andl      $3, %r11d                                     #2268.20
-        je        ..B10.30      # Prob 20%                      #2268.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.5:                        # Preds ..B10.4
-        cmpl      $1, %r11d                                     #2268.20
-        je        ..B10.12      # Prob 25%                      #2268.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.6:                        # Preds ..B10.5
-        cmpl      $2, %r11d                                     #2268.20
-        je        ..B10.13      # Prob 33%                      #2268.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.7:                        # Preds ..B10.6
-        cmpl      $3, %r11d                                     #2268.20
-        je        ..B10.14      # Prob 50%                      #2268.20
-        jmp       ..B10.30      # Prob 100%                     #2268.20
-                                # LOE rcx rbx rbp r9 r12 r13 r14 r15 edx esi edi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.12:                       # Preds ..B10.5 ..B10.30
-        movdqa    %xmm0, %xmm9                                  #2291.22
-        pand      %xmm5, %xmm9                                  #2291.22
-        pcmpeqb   %xmm6, %xmm9                                  #2292.22
-        pmovmskb  %xmm9, %r8d                                   #2293.22
-                                # LOE rcx rbp r9 r14 r15 edx esi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.13:                       # Preds ..B10.6 ..B10.12
-        movdqa    %xmm0, %xmm9                                  #2297.22
-        pand      %xmm3, %xmm9                                  #2297.22
-        pcmpeqb   %xmm4, %xmm9                                  #2298.22
-        pmovmskb  %xmm9, %edi                                   #2299.22
-                                # LOE rcx rbp r9 r14 r15 edx esi edi r8d r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.14:                       # Preds ..B10.7 ..B10.13
-        pand      %xmm1, %xmm0                                  #2303.22
-        pcmpeqb   %xmm2, %xmm0                                  #2304.22
-        pmovmskb  %xmm0, %r12d                                  #2305.22
-        andl      $-4, %edx                                     #2310.17
-        movl      %esi, %ebx                                    #2313.29
-        orl       %r8d, %ebx                                    #2313.29
-        orl       %edi, %ebx                                    #2313.34
-        orl       %r12d, %ebx                                   #2313.39
-        je        ..B10.23      # Prob 78%                      #2313.47
-                                # LOE rcx rbp r9 r14 r15 edx esi edi r8d r10d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.15:                       # Preds ..B10.14
-        movl      %esi, %eax                                    #2331.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2331.30
-        movswq    %ax, %r13                                     #2331.30
-        movl      %r8d, %eax                                    #2332.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2332.30
-        movswq    %ax, %r11                                     #2332.30
-        movl      %edi, %eax                                    #2333.30
-        shll      $2, %r13d                                     #2339.34
-        shll      $2, %r11d                                     #2340.34
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2333.30
-        movswq    %ax, %rbx                                     #2333.30
-        movl      %r12d, %eax                                   #2334.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #2334.30
-        movswq    %ax, %rax                                     #2334.30
-        shll      $2, %ebx                                      #2341.34
-        shll      $2, %eax                                      #2342.34
-        testl     %esi, %esi                                    #2346.32
-        je        ..B10.17      # Prob 50%                      #2346.32
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r8d r10d r11d r12d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.16:                       # Preds ..B10.15
-        addl      %edx, %r13d                                   #2346.43
-        cmpl      %r13d, %r10d                                  #2346.49
-        jae       ..B10.35      # Prob 20%                      #2346.49
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r8d r10d r11d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.17:                       # Preds ..B10.16 ..B10.15
-        testl     %r8d, %r8d                                    #2347.32
-        je        ..B10.19      # Prob 50%                      #2347.32
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r10d r11d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.18:                       # Preds ..B10.17
-        lea       1(%rdx,%r11), %esi                            #2347.43
-        cmpl      %esi, %r10d                                   #2347.49
-        jae       ..B10.35      # Prob 20%                      #2347.49
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx edi r10d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.19:                       # Preds ..B10.18 ..B10.17
-        testl     %edi, %edi                                    #2348.32
-        je        ..B10.21      # Prob 50%                      #2348.32
-                                # LOE rcx rbp r9 r14 r15 eax edx ebx r10d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.20:                       # Preds ..B10.19
-        lea       2(%rdx,%rbx), %ebx                            #2348.43
-        cmpl      %ebx, %r10d                                   #2348.49
-        jae       ..B10.35      # Prob 20%                      #2348.49
-                                # LOE rcx rbp r9 r14 r15 eax edx r10d r12d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.21:                       # Preds ..B10.20 ..B10.19
-        testl     %r12d, %r12d                                  #2349.32
-        je        ..B10.23      # Prob 50%                      #2349.32
-                                # LOE rcx rbp r9 r14 r15 eax edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.22:                       # Preds ..B10.21
-        lea       3(%rdx,%rax), %eax                            #2349.43
-        cmpl      %eax, %r10d                                   #2349.49
-        jae       ..B10.35      # Prob 20%                      #2349.49
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.23:                       # Preds ..B10.22 ..B10.21 ..B10.14
-        lea       4(%rdx), %eax                                 #2386.13
-        cmpl      %eax, %r10d                                   #2357.28
-        jb        ..B10.32      # Prob 20%                      #2357.28
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.24:                       # Preds ..B10.23
-        cmpq      %r9, %rcx                                     #2382.25
-        jae       ..B10.32      # Prob 4%                       #2382.25
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.25:                       # Preds ..B10.24
-        addl      $64, %edx                                     #2386.13
-        cmpl      %r10d, %edx                                   #2387.24
-        ja        ..B10.32      # Prob 4%                       #2387.24
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.26:                       # Preds ..B10.25
-        testq     $15, %rcx                                     #2392.22
-        jne       ..B10.28      # Prob 50%                      #2392.22
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.27:                       # Preds ..B10.26
-        movdqa    (%rcx), %xmm0                                 #2392.22
-        jmp       ..B10.29      # Prob 100%                     #2392.22
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.28:                       # Preds ..B10.26
-        movdqu    (%rcx), %xmm0                                 #2392.22
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.29:                       # Preds ..B10.27 ..B10.28
-        addq      $16, %rcx                                     #2470.13
-                                # LOE rcx rbp r9 r14 r15 edx r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.30:                       # Preds ..B10.4 ..B10.7 ..B10.29
-        movdqa    %xmm0, %xmm9                                  #2285.22
-        pand      %xmm7, %xmm9                                  #2285.22
-        pcmpeqb   %xmm8, %xmm9                                  #2286.22
-        pmovmskb  %xmm9, %esi                                   #2287.22
-        jmp       ..B10.12      # Prob 100%                     #2287.22
-                                # LOE rcx rbp r9 r14 r15 edx esi r10d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B10.32:                       # Preds ..B10.23 ..B10.24 ..B10.25 # Infreq
-        xorl      %eax, %eax                                    #2483.12
-..___tag_value_eval_2na_8.575:                                  #2483.12
-        popq      %rbx                                          #2483.12
-..___tag_value_eval_2na_8.576:                                  #
-        popq      %r12                                          #2483.12
-..___tag_value_eval_2na_8.578:                                  #
-        popq      %r13                                          #2483.12
-..___tag_value_eval_2na_8.580:                                  #
-        ret                                                     #2483.12
-..___tag_value_eval_2na_8.581:                                  #
-                                # LOE
-..B10.35:                       # Preds ..B10.22 ..B10.20 ..B10.18 ..B10.16 # Infreq
-        movl      $1, %eax                                      #2346.63
-..___tag_value_eval_2na_8.585:                                  #2346.63
-        popq      %rbx                                          #2346.63
-..___tag_value_eval_2na_8.586:                                  #
-        popq      %r12                                          #2346.63
-..___tag_value_eval_2na_8.588:                                  #
-        popq      %r13                                          #2346.63
-..___tag_value_eval_2na_8.590:                                  #
-        ret                                                     #2346.63
-        .align    16,0x90
-..___tag_value_eval_2na_8.591:                                  #
-                                # LOE
-# mark_end;
-	.type	eval_2na_8, at function
-	.size	eval_2na_8,.-eval_2na_8
-	.data
-# -- End  eval_2na_8
-	.text
-# -- Begin  eval_4na_64
-# mark_begin;
-       .align    16,0x90
-eval_4na_64:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B11.1:                        # Preds ..B11.0
-..___tag_value_eval_4na_64.592:                                 #4501.1
-        pushq     %r15                                          #4501.1
-..___tag_value_eval_4na_64.594:                                 #
-        pushq     %r14                                          #4501.1
-..___tag_value_eval_4na_64.596:                                 #
-        pushq     %r13                                          #4501.1
-..___tag_value_eval_4na_64.598:                                 #
-        pushq     %r12                                          #4501.1
-..___tag_value_eval_4na_64.600:                                 #
-        pushq     %rbx                                          #4501.1
-..___tag_value_eval_4na_64.602:                                 #
-        movdqa    16(%rdi), %xmm8                               #4554.5
-        movdqa    32(%rdi), %xmm7                               #4554.5
-        movdqa    48(%rdi), %xmm6                               #4554.5
-        movdqa    64(%rdi), %xmm5                               #4554.5
-        movdqa    80(%rdi), %xmm4                               #4554.5
-        movdqa    96(%rdi), %xmm3                               #4554.5
-        movdqa    112(%rdi), %xmm2                              #4554.5
-        movdqa    128(%rdi), %xmm1                              #4554.5
-        lea       (%rdx,%rcx), %r11d                            #4535.5
-        movl      %edx, %ebx                                    #4538.49
-        shrl      $2, %ebx                                      #4538.49
-        subl      4(%rdi), %r11d                                #4541.12
-        movzbl    (%rbx,%rsi), %eax                             #4547.14
-        movzbl    1(%rbx,%rsi), %r9d                            #4547.14
-        lea       3(%rdx,%rcx), %r10d                           #4544.50
-        shrl      $2, %r10d                                     #4544.57
-        addq      %rsi, %r10                                    #4544.30
-        lea       expand_2na.0(%rip), %rcx                      #4547.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4547.14
-        movzwl    (%rcx,%r9,2), %eax                            #4547.14
-        movw      %r8w, -16(%rsp)                               #4547.14
-        movzbl    2(%rbx,%rsi), %r8d                            #4547.14
-        movzwl    (%rcx,%r8,2), %r9d                            #4547.14
-        movw      %ax, -14(%rsp)                                #4547.14
-        movzbl    3(%rbx,%rsi), %eax                            #4547.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4547.14
-        movw      %r9w, -12(%rsp)                               #4547.14
-        movzbl    4(%rbx,%rsi), %r9d                            #4547.14
-        movzwl    (%rcx,%r9,2), %eax                            #4547.14
-        movw      %r8w, -10(%rsp)                               #4547.14
-        movzbl    5(%rbx,%rsi), %r8d                            #4547.14
-        movzwl    (%rcx,%r8,2), %r9d                            #4547.14
-        movw      %ax, -8(%rsp)                                 #4547.14
-        movzbl    6(%rbx,%rsi), %eax                            #4547.14
-        movzwl    (%rcx,%rax,2), %r8d                           #4547.14
-        movw      %r9w, -6(%rsp)                                #4547.14
-        movzbl    7(%rbx,%rsi), %r9d                            #4547.14
-        movzwl    (%rcx,%r9,2), %ecx                            #4547.14
-        movw      %r8w, -4(%rsp)                                #4547.14
-        movl      %edx, %eax                                    #4568.20
-        lea       8(%rsi,%rbx), %rbx                            #4548.5
-        movw      %cx, -2(%rsp)                                 #4547.14
-        movdqu    -16(%rsp), %xmm0                              #4547.14
-        movq      %rbx, %rcx                                    #4548.5
-        xorl      %r8d, %r8d                                    #4557.15
-        xorl      %r9d, %r9d                                    #4557.10
-        xorl      %edi, %edi                                    #4557.5
-        movl      $4, %esi                                      #4563.5
-        andl      $3, %eax                                      #4568.20
-        je        ..B11.29      # Prob 20%                      #4568.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.2:                        # Preds ..B11.1
-        cmpl      $1, %eax                                      #4568.20
-        je        ..B11.9       # Prob 25%                      #4568.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.3:                        # Preds ..B11.2
-        cmpl      $2, %eax                                      #4568.20
-        je        ..B11.10      # Prob 33%                      #4568.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 eax edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.4:                        # Preds ..B11.3
-        cmpl      $3, %eax                                      #4568.20
-        je        ..B11.11      # Prob 50%                      #4568.20
-        jmp       ..B11.25      # Prob 100%                     #4568.20
-                                # LOE rcx rbx rbp r10 r12 r13 r14 r15 edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.9:                        # Preds ..B11.2 ..B11.29
-        movdqa    %xmm0, %xmm10                                 #4592.22
-        movdqa    %xmm0, %xmm9                                  #4593.22
-        pand      %xmm6, %xmm10                                 #4592.22
-        pand      %xmm5, %xmm9                                  #4593.22
-        pcmpeqd   %xmm9, %xmm10                                 #4594.22
-        pmovmskb  %xmm10, %r9d                                  #4595.22
-        movl      %r9d, %r8d                                    #4596.17
-        andl      $3855, %r8d                                   #4596.17
-        shll      $4, %r8d                                      #4596.17
-        andl      %r8d, %r9d                                    #4596.17
-        movl      %r9d, %r12d                                   #4596.17
-        shrl      $4, %r12d                                     #4596.17
-        orl       %r12d, %r9d                                   #4596.17
-                                # LOE rcx rbx rbp r10 edx esi edi r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.10:                       # Preds ..B11.3 ..B11.9
-        movdqa    %xmm0, %xmm10                                 #4599.22
-        movdqa    %xmm0, %xmm9                                  #4600.22
-        pand      %xmm4, %xmm10                                 #4599.22
-        pand      %xmm3, %xmm9                                  #4600.22
-        pcmpeqd   %xmm9, %xmm10                                 #4601.22
-        pmovmskb  %xmm10, %r8d                                  #4602.22
-        movl      %r8d, %r12d                                   #4603.17
-        andl      $3855, %r12d                                  #4603.17
-        shll      $4, %r12d                                     #4603.17
-        andl      %r12d, %r8d                                   #4603.17
-        movl      %r8d, %r13d                                   #4603.17
-        shrl      $4, %r13d                                     #4603.17
-        orl       %r13d, %r8d                                   #4603.17
-                                # LOE rcx rbx rbp r10 edx esi edi r8d r9d r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.11:                       # Preds ..B11.4 ..B11.10
-        movdqa    %xmm0, %xmm10                                 #4606.22
-        movdqa    %xmm0, %xmm9                                  #4607.22
-        pand      %xmm2, %xmm10                                 #4606.22
-        pand      %xmm1, %xmm9                                  #4607.22
-        pcmpeqd   %xmm9, %xmm10                                 #4608.22
-        pmovmskb  %xmm10, %r12d                                 #4609.22
-        movl      %r12d, %r13d                                  #4610.17
-        andl      $3855, %r13d                                  #4610.17
-        shll      $4, %r13d                                     #4610.17
-        andl      %r13d, %r12d                                  #4610.17
-        movl      %r12d, %r14d                                  #4610.17
-        shrl      $4, %r14d                                     #4610.17
-        orl       %r14d, %r12d                                  #4610.17
-        movl      %edx, %r13d                                   #4614.17
-        andl      $-4, %r13d                                    #4614.17
-        movl      %edi, %edx                                    #4617.29
-        orl       %r9d, %edx                                    #4617.29
-        orl       %r8d, %edx                                    #4617.34
-        orl       %r12d, %edx                                   #4617.39
-        je        ..B11.20      # Prob 78%                      #4617.47
-                                # LOE rcx rbx rbp r10 esi edi r8d r9d r11d r12d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.12:                       # Preds ..B11.11
-        movl      %edi, %eax                                    #4635.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4635.30
-        movswq    %ax, %r15                                     #4635.30
-        movl      %r9d, %eax                                    #4636.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4636.30
-        movswq    %ax, %rdx                                     #4636.30
-        movl      %r8d, %eax                                    #4637.30
-        lea       1(%rdx,%rdx), %edx                            #4644.40
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4637.30
-        movswq    %ax, %r14                                     #4637.30
-        movl      %r12d, %eax                                   #4638.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #4638.30
-        movswq    %ax, %rax                                     #4638.30
-        lea       2(%r14,%r14), %r14d                           #4645.40
-        lea       3(%rax,%rax), %eax                            #4646.40
-        testl     %edi, %edi                                    #4650.32
-        je        ..B11.14      # Prob 50%                      #4650.32
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r9d r11d r12d r13d r14d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.13:                       # Preds ..B11.12
-        lea       (%r13,%r15,2), %edi                           #4650.43
-        cmpl      %edi, %r11d                                   #4650.49
-        jae       ..B11.34      # Prob 20%                      #4650.49
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r9d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.14:                       # Preds ..B11.13 ..B11.12
-        testl     %r9d, %r9d                                    #4651.32
-        je        ..B11.16      # Prob 50%                      #4651.32
-                                # LOE rcx rbx rbp r10 eax edx esi r8d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.15:                       # Preds ..B11.14
-        addl      %r13d, %edx                                   #4651.43
-        cmpl      %edx, %r11d                                   #4651.49
-        jae       ..B11.34      # Prob 20%                      #4651.49
-                                # LOE rcx rbx rbp r10 eax esi r8d r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.16:                       # Preds ..B11.15 ..B11.14
-        testl     %r8d, %r8d                                    #4652.32
-        je        ..B11.18      # Prob 50%                      #4652.32
-                                # LOE rcx rbx rbp r10 eax esi r11d r12d r13d r14d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.17:                       # Preds ..B11.16
-        addl      %r13d, %r14d                                  #4652.43
-        cmpl      %r14d, %r11d                                  #4652.49
-        jae       ..B11.34      # Prob 20%                      #4652.49
-                                # LOE rcx rbx rbp r10 eax esi r11d r12d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.18:                       # Preds ..B11.17 ..B11.16
-        testl     %r12d, %r12d                                  #4653.32
-        je        ..B11.20      # Prob 50%                      #4653.32
-                                # LOE rcx rbx rbp r10 eax esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.19:                       # Preds ..B11.18
-        addl      %r13d, %eax                                   #4653.43
-        cmpl      %eax, %r11d                                   #4653.49
-        jae       ..B11.34      # Prob 20%                      #4653.49
-                                # LOE rcx rbx rbp r10 esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.20:                       # Preds ..B11.19 ..B11.18 ..B11.11
-        lea       4(%r13), %edx                                 #4658.17
-        cmpl      %r11d, %edx                                   #4661.28
-        ja        ..B11.31      # Prob 20%                      #4661.28
-                                # LOE rcx rbx rbp r10 edx esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.21:                       # Preds ..B11.20
-        decl      %esi                                          #4665.25
-        jne       ..B11.26      # Prob 50%                      #4665.39
-                                # LOE rcx rbx rbp r10 edx esi r11d r13d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.22:                       # Preds ..B11.21
-        cmpq      %r10, %rbx                                    #4682.25
-        jae       ..B11.31      # Prob 4%                       #4682.25
-                                # LOE rbx rbp r10 r11d r13d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.23:                       # Preds ..B11.22
-        lea       20(%r13), %edx                                #4686.13
-        cmpl      %r11d, %edx                                   #4687.24
-        ja        ..B11.31      # Prob 4%                       #4687.24
-                                # LOE rbx rbp r10 edx r11d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.24:                       # Preds ..B11.23
-        movzbl    (%rbx), %ecx                                  #4692.22
-        movzbl    1(%rbx), %edi                                 #4692.22
-        movzbl    2(%rbx), %r9d                                 #4692.22
-        movzbl    3(%rbx), %r13d                                #4692.22
-        movzbl    4(%rbx), %r15d                                #4692.22
-        lea       expand_2na.0(%rip), %rax                      #4692.22
-        movzwl    (%rax,%rcx,2), %esi                           #4692.22
-        movzwl    (%rax,%rdi,2), %r8d                           #4692.22
-        movzwl    (%rax,%r9,2), %r12d                           #4692.22
-        movzwl    (%rax,%r13,2), %r14d                          #4692.22
-        movzwl    (%rax,%r15,2), %ecx                           #4692.22
-        movw      %si, -16(%rsp)                                #4692.22
-        movzbl    5(%rbx), %esi                                 #4692.22
-        movzwl    (%rax,%rsi,2), %edi                           #4692.22
-        movw      %r8w, -14(%rsp)                               #4692.22
-        movzbl    6(%rbx), %r8d                                 #4692.22
-        movzwl    (%rax,%r8,2), %r9d                            #4692.22
-        movw      %r12w, -12(%rsp)                              #4692.22
-        movzbl    7(%rbx), %r12d                                #4692.22
-        movzwl    (%rax,%r12,2), %eax                           #4692.22
-        movw      %r14w, -10(%rsp)                              #4692.22
-        movw      %cx, -8(%rsp)                                 #4692.22
-        addq      $8, %rbx                                      #4707.13
-        movw      %di, -6(%rsp)                                 #4692.22
-        movq      %rbx, %rcx                                    #4707.13
-        movw      %r9w, -4(%rsp)                                #4692.22
-        movw      %ax, -2(%rsp)                                 #4692.22
-        movdqu    -16(%rsp), %xmm0                              #4692.22
-                                # LOE rcx rbx rbp r10 edx r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.25:                       # Preds ..B11.4 ..B11.24
-        movl      $4, %esi                                      #4575.13
-        jmp       ..B11.29      # Prob 100%                     #4575.13
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.26:                       # Preds ..B11.21
-        psrldq    $2, %xmm0                                     #4670.26
-        cmpq      %r10, %rcx                                    #4673.26
-        jae       ..B11.28      # Prob 19%                      #4673.26
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.27:                       # Preds ..B11.26
-        movzbl    (%rcx), %edi                                  #4674.72
-        lea       expand_2na.0(%rip), %rax                      #4674.57
-        movzwl    (%rax,%rdi,2), %r8d                           #4674.57
-        pinsrw    $7, %r8d, %xmm0                               #4674.30
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.28:                       # Preds ..B11.27 ..B11.26
-        incq      %rcx                                          #4677.20
-                                # LOE rcx rbx rbp r10 edx esi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.29:                       # Preds ..B11.1 ..B11.25 ..B11.28
-        movdqa    %xmm0, %xmm10                                 #4585.22
-        movdqa    %xmm0, %xmm9                                  #4586.22
-        pand      %xmm8, %xmm10                                 #4585.22
-        pand      %xmm7, %xmm9                                  #4586.22
-        pcmpeqd   %xmm9, %xmm10                                 #4587.22
-        pmovmskb  %xmm10, %edi                                  #4588.22
-        movl      %edi, %r8d                                    #4589.17
-        andl      $3855, %r8d                                   #4589.17
-        shll      $4, %r8d                                      #4589.17
-        andl      %r8d, %edi                                    #4589.17
-        movl      %edi, %r9d                                    #4589.17
-        shrl      $4, %r9d                                      #4589.17
-        orl       %r9d, %edi                                    #4589.17
-        jmp       ..B11.9       # Prob 100%                     #4589.17
-                                # LOE rcx rbx rbp r10 edx esi edi r11d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B11.31:                       # Preds ..B11.20 ..B11.22 ..B11.23 # Infreq
-        xorl      %eax, %eax                                    #4718.12
-..___tag_value_eval_4na_64.605:                                 #4718.12
-        popq      %rbx                                          #4718.12
-..___tag_value_eval_4na_64.607:                                 #
-        popq      %r12                                          #4718.12
-..___tag_value_eval_4na_64.609:                                 #
-        popq      %r13                                          #4718.12
-..___tag_value_eval_4na_64.611:                                 #
-        popq      %r14                                          #4718.12
-..___tag_value_eval_4na_64.613:                                 #
-        popq      %r15                                          #4718.12
-..___tag_value_eval_4na_64.615:                                 #
-        ret                                                     #4718.12
-..___tag_value_eval_4na_64.616:                                 #
-                                # LOE
-..B11.34:                       # Preds ..B11.13 ..B11.19 ..B11.17 ..B11.15 # Infreq
-        movl      $1, %eax                                      #4651.63
-..___tag_value_eval_4na_64.622:                                 #4651.63
-        popq      %rbx                                          #4651.63
-..___tag_value_eval_4na_64.624:                                 #
-        popq      %r12                                          #4651.63
-..___tag_value_eval_4na_64.626:                                 #
-        popq      %r13                                          #4651.63
-..___tag_value_eval_4na_64.628:                                 #
-        popq      %r14                                          #4651.63
-..___tag_value_eval_4na_64.630:                                 #
-        popq      %r15                                          #4651.63
-..___tag_value_eval_4na_64.632:                                 #
-        ret                                                     #4651.63
-        .align    16,0x90
-..___tag_value_eval_4na_64.633:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_4na_64, at function
-	.size	eval_4na_64,.-eval_4na_64
-	.data
-# -- End  eval_4na_64
-	.text
-# -- Begin  eval_2na_64
-# mark_begin;
-       .align    16,0x90
-eval_2na_64:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %edx
-# parameter 4: %ecx
-..B12.1:                        # Preds ..B12.0
-..___tag_value_eval_2na_64.634:                                 #3075.1
-        pushq     %r15                                          #3075.1
-..___tag_value_eval_2na_64.636:                                 #
-        pushq     %r14                                          #3075.1
-..___tag_value_eval_2na_64.638:                                 #
-        pushq     %r13                                          #3075.1
-..___tag_value_eval_2na_64.640:                                 #
-        pushq     %r12                                          #3075.1
-..___tag_value_eval_2na_64.642:                                 #
-        pushq     %rbp                                          #3075.1
-..___tag_value_eval_2na_64.644:                                 #
-        pushq     %rbx                                          #3075.1
-..___tag_value_eval_2na_64.646:                                 #
-        lea       (%rdx,%rcx), %r15d                            #3113.5
-        movl      %edx, %eax                                    #3116.49
-        shrl      $2, %eax                                      #3116.49
-        subl      4(%rdi), %r15d                                #3119.12
-        lea       (%rsi,%rax), %r8                              #3116.30
-        lea       3(%rdx,%rcx), %r14d                           #3122.50
-        shrl      $2, %r14d                                     #3122.57
-        addq      %rsi, %r14                                    #3122.30
-        testq     $15, %r8                                      #3125.14
-        jne       ..B12.3       # Prob 50%                      #3125.14
-                                # LOE rax rbx rbp rsi rdi r8 r12 r13 r14 edx r15d
-..B12.2:                        # Preds ..B12.1
-        movdqa    (%r8), %xmm0                                  #3125.14
-        jmp       ..B12.4       # Prob 100%                     #3125.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B12.3:                        # Preds ..B12.1
-        movdqu    (%r8), %xmm0                                  #3125.14
-                                # LOE rax rbx rbp rsi rdi r12 r13 r14 edx r15d xmm0
-..B12.4:                        # Preds ..B12.2 ..B12.3
-        lea       16(%rsi,%rax), %r8                            #3126.5
-        movq      %r8, %rsi                                     #3126.5
-        cmpq      %r14, %r8                                     #3131.16
-        jae       ..B12.6       # Prob 12%                      #3131.16
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B12.5:                        # Preds ..B12.4
-        movzbl    -1(%r8), %ecx                                 #3132.24
-        shll      $8, %ecx                                      #3132.38
-                                # LOE rbx rbp rsi rdi r8 r12 r13 r14 edx ecx r15d xmm0
-..B12.6:                        # Preds ..B12.5 ..B12.4
-        movdqa    16(%rdi), %xmm8                               #3136.5
-        movdqa    32(%rdi), %xmm7                               #3136.5
-        movdqa    48(%rdi), %xmm6                               #3136.5
-        movdqa    64(%rdi), %xmm5                               #3136.5
-        movdqa    80(%rdi), %xmm4                               #3136.5
-        movdqa    96(%rdi), %xmm3                               #3136.5
-        movdqa    112(%rdi), %xmm2                              #3136.5
-        movdqa    128(%rdi), %xmm1                              #3136.5
-        xorl      %r10d, %r10d                                  #3139.15
-        xorl      %r11d, %r11d                                  #3139.10
-        xorl      %r9d, %r9d                                    #3139.5
-        movl      $8, %edi                                      #3143.5
-        movl      %edx, %eax                                    #3148.20
-        andl      $3, %eax                                      #3148.20
-        je        ..B12.38      # Prob 20%                      #3148.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.7:                        # Preds ..B12.6
-        cmpl      $1, %eax                                      #3148.20
-        je        ..B12.14      # Prob 25%                      #3148.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.8:                        # Preds ..B12.7
-        cmpl      $2, %eax                                      #3148.20
-        je        ..B12.15      # Prob 33%                      #3148.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 eax edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.9:                        # Preds ..B12.8
-        cmpl      $3, %eax                                      #3148.20
-        je        ..B12.16      # Prob 50%                      #3148.20
-        jmp       ..B12.34      # Prob 100%                     #3148.20
-                                # LOE rbx rbp rsi r8 r12 r13 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.14:                       # Preds ..B12.7 ..B12.38
-        movdqa    %xmm0, %xmm9                                  #3171.22
-        pand      %xmm5, %xmm9                                  #3171.22
-        pcmpeqd   %xmm6, %xmm9                                  #3172.22
-        pmovmskb  %xmm9, %r11d                                  #3173.22
-        movl      %r11d, %ebx                                   #3174.17
-        andl      $3855, %ebx                                   #3174.17
-        shll      $4, %ebx                                      #3174.17
-        andl      %ebx, %r11d                                   #3174.17
-        movl      %r11d, %ebp                                   #3174.17
-        shrl      $4, %ebp                                      #3174.17
-        orl       %ebp, %r11d                                   #3174.17
-                                # LOE rsi r8 r14 edx ecx edi r9d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.15:                       # Preds ..B12.8 ..B12.14
-        movdqa    %xmm0, %xmm9                                  #3177.22
-        pand      %xmm3, %xmm9                                  #3177.22
-        pcmpeqd   %xmm4, %xmm9                                  #3178.22
-        pmovmskb  %xmm9, %r10d                                  #3179.22
-        movl      %r10d, %ebx                                   #3180.17
-        andl      $3855, %ebx                                   #3180.17
-        shll      $4, %ebx                                      #3180.17
-        andl      %ebx, %r10d                                   #3180.17
-        movl      %r10d, %ebp                                   #3180.17
-        shrl      $4, %ebp                                      #3180.17
-        orl       %ebp, %r10d                                   #3180.17
-                                # LOE rsi r8 r14 edx ecx edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.16:                       # Preds ..B12.9 ..B12.15
-        movdqa    %xmm0, %xmm9                                  #3183.22
-        pand      %xmm1, %xmm9                                  #3183.22
-        pcmpeqd   %xmm2, %xmm9                                  #3184.22
-        pmovmskb  %xmm9, %ebp                                   #3185.22
-        movl      %ebp, %ebx                                    #3186.17
-        andl      $3855, %ebx                                   #3186.17
-        shll      $4, %ebx                                      #3186.17
-        andl      %ebx, %ebp                                    #3186.17
-        movl      %ebp, %r12d                                   #3186.17
-        shrl      $4, %r12d                                     #3186.17
-        orl       %r12d, %ebp                                   #3186.17
-        movl      %edx, %ebx                                    #3190.17
-        andl      $-4, %ebx                                     #3190.17
-        movl      %r9d, %edx                                    #3193.29
-        orl       %r11d, %edx                                   #3193.29
-        orl       %r10d, %edx                                   #3193.34
-        orl       %ebp, %edx                                    #3193.39
-        je        ..B12.25      # Prob 78%                      #3193.47
-                                # LOE rsi r8 r14 ecx ebx ebp edi r9d r10d r11d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.17:                       # Preds ..B12.16
-        movl      %r9d, %eax                                    #3211.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3211.30
-        movswq    %ax, %r13                                     #3211.30
-        movl      %r11d, %eax                                   #3212.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3212.30
-        movswq    %ax, %r12                                     #3212.30
-        movl      %r10d, %eax                                   #3213.30
-        shll      $2, %r13d                                     #3219.34
-        shll      $2, %r12d                                     #3220.34
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3213.30
-        movswq    %ax, %rdx                                     #3213.30
-        movl      %ebp, %eax                                    #3214.30
-# Begin ASM
-        bsf %ax, %ax;jnz .+6;xor %eax, %eax;dec %eax;
-# End ASM                                                       #3214.30
-        movswq    %ax, %rax                                     #3214.30
-        shll      $2, %edx                                      #3221.34
-        shll      $2, %eax                                      #3222.34
-        testl     %r9d, %r9d                                    #3226.32
-        je        ..B12.19      # Prob 50%                      #3226.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r13d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.18:                       # Preds ..B12.17
-        addl      %ebx, %r13d                                   #3226.43
-        cmpl      %r13d, %r15d                                  #3226.49
-        jae       ..B12.43      # Prob 20%                      #3226.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r11d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.19:                       # Preds ..B12.18 ..B12.17
-        testl     %r11d, %r11d                                  #3227.32
-        je        ..B12.21      # Prob 50%                      #3227.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r12d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.20:                       # Preds ..B12.19
-        lea       1(%rbx,%r12), %r9d                            #3227.43
-        cmpl      %r9d, %r15d                                   #3227.49
-        jae       ..B12.43      # Prob 20%                      #3227.49
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r10d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.21:                       # Preds ..B12.20 ..B12.19
-        testl     %r10d, %r10d                                  #3228.32
-        je        ..B12.23      # Prob 50%                      #3228.32
-                                # LOE rsi r8 r14 eax edx ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.22:                       # Preds ..B12.21
-        lea       2(%rbx,%rdx), %edx                            #3228.43
-        cmpl      %edx, %r15d                                   #3228.49
-        jae       ..B12.43      # Prob 20%                      #3228.49
-                                # LOE rsi r8 r14 eax ecx ebx ebp edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.23:                       # Preds ..B12.22 ..B12.21
-        testl     %ebp, %ebp                                    #3229.32
-        je        ..B12.25      # Prob 50%                      #3229.32
-                                # LOE rsi r8 r14 eax ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.24:                       # Preds ..B12.23
-        lea       3(%rbx,%rax), %eax                            #3229.43
-        cmpl      %eax, %r15d                                   #3229.49
-        jae       ..B12.43      # Prob 20%                      #3229.49
-                                # LOE rsi r8 r14 ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.25:                       # Preds ..B12.24 ..B12.23 ..B12.16
-        lea       4(%rbx), %edx                                 #3234.17
-        cmpl      %r15d, %edx                                   #3237.28
-        ja        ..B12.40      # Prob 20%                      #3237.28
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.26:                       # Preds ..B12.25
-        decl      %edi                                          #3241.25
-        jne       ..B12.35      # Prob 50%                      #3241.39
-                                # LOE rsi r8 r14 edx ecx ebx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.27:                       # Preds ..B12.26
-        cmpq      %r14, %r8                                     #3262.25
-        jae       ..B12.40      # Prob 4%                       #3262.25
-                                # LOE r8 r14 ecx ebx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.28:                       # Preds ..B12.27
-        lea       36(%rbx), %edx                                #3266.13
-        cmpl      %r15d, %edx                                   #3267.24
-        ja        ..B12.40      # Prob 4%                       #3267.24
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.29:                       # Preds ..B12.28
-        testq     $15, %r8                                      #3272.22
-        jne       ..B12.31      # Prob 50%                      #3272.22
-                                # LOE r8 r14 edx ecx r15d xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.30:                       # Preds ..B12.29
-        movdqa    (%r8), %xmm0                                  #3272.22
-        jmp       ..B12.32      # Prob 100%                     #3272.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.31:                       # Preds ..B12.29
-        movdqu    (%r8), %xmm0                                  #3272.22
-                                # LOE r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.32:                       # Preds ..B12.30 ..B12.31
-        addq      $16, %r8                                      #3350.13
-        movq      %r8, %rsi                                     #3350.13
-        cmpq      %r14, %r8                                     #3353.24
-        jae       ..B12.34      # Prob 12%                      #3353.24
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.33:                       # Preds ..B12.32
-        movzbl    -1(%r8), %ecx                                 #3354.32
-        shll      $8, %ecx                                      #3354.46
-                                # LOE rsi r8 r14 edx ecx r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.34:                       # Preds ..B12.9 ..B12.32 ..B12.33
-        movl      $8, %edi                                      #3155.13
-        jmp       ..B12.38      # Prob 100%                     #3155.13
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.35:                       # Preds ..B12.26
-        psrldq    $1, %xmm0                                     #3246.26
-        cmpq      %r14, %rsi                                    #3249.26
-        jae       ..B12.37      # Prob 19%                      #3249.26
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.36:                       # Preds ..B12.35
-        movzbl    (%rsi), %eax                                  #3252.37
-        sarl      $8, %ecx                                      #3251.21
-        shll      $8, %eax                                      #3252.48
-        orl       %eax, %ecx                                    #3252.21
-        pinsrw    $7, %ecx, %xmm0                               #3253.30
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.37:                       # Preds ..B12.36 ..B12.35
-        incq      %rsi                                          #3257.20
-                                # LOE rsi r8 r14 edx ecx edi r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.38:                       # Preds ..B12.6 ..B12.34 ..B12.37
-        movdqa    %xmm0, %xmm9                                  #3165.22
-        pand      %xmm7, %xmm9                                  #3165.22
-        pcmpeqd   %xmm8, %xmm9                                  #3166.22
-        pmovmskb  %xmm9, %r9d                                   #3167.22
-        movl      %r9d, %ebx                                    #3168.17
-        andl      $3855, %ebx                                   #3168.17
-        shll      $4, %ebx                                      #3168.17
-        andl      %ebx, %r9d                                    #3168.17
-        movl      %r9d, %ebp                                    #3168.17
-        shrl      $4, %ebp                                      #3168.17
-        orl       %ebp, %r9d                                    #3168.17
-        jmp       ..B12.14      # Prob 100%                     #3168.17
-                                # LOE rsi r8 r14 edx ecx edi r9d r15d xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8
-..B12.40:                       # Preds ..B12.25 ..B12.27 ..B12.28 # Infreq
-        xorl      %eax, %eax                                    #3363.12
-..___tag_value_eval_2na_64.649:                                 #3363.12
-        popq      %rbx                                          #3363.12
-..___tag_value_eval_2na_64.651:                                 #
-        popq      %rbp                                          #3363.12
-..___tag_value_eval_2na_64.653:                                 #
-        popq      %r12                                          #3363.12
-..___tag_value_eval_2na_64.655:                                 #
-        popq      %r13                                          #3363.12
-..___tag_value_eval_2na_64.657:                                 #
-        popq      %r14                                          #3363.12
-..___tag_value_eval_2na_64.659:                                 #
-        popq      %r15                                          #3363.12
-..___tag_value_eval_2na_64.661:                                 #
-        ret                                                     #3363.12
-..___tag_value_eval_2na_64.662:                                 #
-                                # LOE
-..B12.43:                       # Preds ..B12.22 ..B12.20 ..B12.18 ..B12.24 # Infreq
-        movl      $1, %eax                                      #3229.63
-..___tag_value_eval_2na_64.669:                                 #3229.63
-        popq      %rbx                                          #3229.63
-..___tag_value_eval_2na_64.671:                                 #
-        popq      %rbp                                          #3229.63
-..___tag_value_eval_2na_64.673:                                 #
-        popq      %r12                                          #3229.63
-..___tag_value_eval_2na_64.675:                                 #
-        popq      %r13                                          #3229.63
-..___tag_value_eval_2na_64.677:                                 #
-        popq      %r14                                          #3229.63
-..___tag_value_eval_2na_64.679:                                 #
-        popq      %r15                                          #3229.63
-..___tag_value_eval_2na_64.681:                                 #
-        ret                                                     #3229.63
-        .align    16,0x90
-..___tag_value_eval_2na_64.682:                                 #
-                                # LOE
-# mark_end;
-	.type	eval_2na_64, at function
-	.size	eval_2na_64,.-eval_2na_64
-	.data
-# -- End  eval_2na_64
-	.text
-# -- Begin  NucStrstrMake
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrMake
-NucStrstrMake:
-# parameter 1: %rdi
-# parameter 2: %esi
-# parameter 3: %rdx
-# parameter 4: %ecx
-..B13.1:                        # Preds ..B13.0
-..___tag_value_NucStrstrMake.683:                               #1539.1
-        pushq     %r15                                          #1539.1
-..___tag_value_NucStrstrMake.685:                               #
-        pushq     %r14                                          #1539.1
-..___tag_value_NucStrstrMake.687:                               #
-        pushq     %r13                                          #1539.1
-..___tag_value_NucStrstrMake.689:                               #
-        pushq     %r12                                          #1539.1
-..___tag_value_NucStrstrMake.691:                               #
-        pushq     %rbp                                          #1539.1
-..___tag_value_NucStrstrMake.693:                               #
-        pushq     %rbx                                          #1539.1
-..___tag_value_NucStrstrMake.695:                               #
-        subq      $24, %rsp                                     #1539.1
-..___tag_value_NucStrstrMake.697:                               #
-        movl      %ecx, %r13d                                   #1539.1
-        movq      %rdx, %r12                                    #1539.1
-        movl      %esi, %ebp                                    #1539.1
-        movq      %rdi, %rbx                                    #1539.1
-        testq     %rbx, %rbx                                    #1540.17
-        je        ..B13.12      # Prob 6%                       #1540.17
-                                # LOE rbx r12 ebp r13d
-..B13.2:                        # Preds ..B13.1
-        testq     %r12, %r12                                    #1542.23
-        je        ..B13.11      # Prob 6%                       #1542.23
-                                # LOE rbx r12 ebp r13d
-..B13.3:                        # Preds ..B13.2
-        testl     %r13d, %r13d                                  #1542.38
-        je        ..B13.11      # Prob 28%                      #1542.38
-                                # LOE rbx r12 ebp r13d
-..B13.4:                        # Preds ..B13.3
-        movl      $0, 16(%rsp)                                  #1544.24
-        lea       fasta_2na_map.0(%rip), %rax                   #1547.18
-        movsbl    (%rax), %edx                                  #1547.18
-        testl     %edx, %edx                                    #1547.41
-        je        ..B13.13      # Prob 5%                       #1547.41
-                                # LOE rbx r12 ebp r13d
-..B13.5:                        # Preds ..B13.35 ..B13.4
-        lea       16(%rsp), %rcx                                #1551.21
-        movl      %r13d, %r13d                                  #1550.19
-        addq      %r12, %r13                                    #1550.19
-        movq      %r12, %rdi                                    #1551.21
-        movq      %r13, %rsi                                    #1551.21
-        movq      %rbx, %rdx                                    #1551.21
-        movl      %ebp, %r8d                                    #1551.21
-        call      nss_expr at PLT                                  #1551.21
-                                # LOE rax rbx r13
-..B13.6:                        # Preds ..B13.5
-        movl      16(%rsp), %ebp                                #1552.18
-        testl     %ebp, %ebp                                    #1552.28
-        jne       ..B13.9       # Prob 10%                      #1552.28
-                                # LOE rax rbx r13 ebp
-..B13.7:                        # Preds ..B13.6
-        cmpq      %r13, %rax                                    #1554.31
-        je        ..B13.37      # Prob 12%                      #1554.31
-                                # LOE rbx
-..B13.8:                        # Preds ..B13.7
-        movl      $22, 16(%rsp)                                 #1557.17
-        movl      $22, %ebp                                     #1557.17
-                                # LOE rbx ebp
-..B13.9:                        # Preds ..B13.6 ..B13.8
-        movq      (%rbx), %rdi                                  #1560.13
-        call      NucStrstrWhack at PLT                            #1560.13
-                                # LOE rbx ebp
-..B13.10:                       # Preds ..B13.9
-        movq      $0, (%rbx)                                    #1561.13
-        movl      %ebp, %eax                                    #1562.20
-        addq      $24, %rsp                                     #1562.20
-..___tag_value_NucStrstrMake.698:                               #
-        popq      %rbx                                          #1562.20
-..___tag_value_NucStrstrMake.700:                               #
-        popq      %rbp                                          #1562.20
-..___tag_value_NucStrstrMake.702:                               #
-        popq      %r12                                          #1562.20
-..___tag_value_NucStrstrMake.704:                               #
-        popq      %r13                                          #1562.20
-..___tag_value_NucStrstrMake.706:                               #
-        popq      %r14                                          #1562.20
-..___tag_value_NucStrstrMake.708:                               #
-        popq      %r15                                          #1562.20
-..___tag_value_NucStrstrMake.710:                               #
-        ret                                                     #1562.20
-..___tag_value_NucStrstrMake.711:                               #
-                                # LOE
-..B13.11:                       # Preds ..B13.3 ..B13.2
-        movq      $0, (%rbx)                                    #1565.9
-                                # LOE
-..B13.12:                       # Preds ..B13.1 ..B13.11
-        movl      $22, %eax                                     #1567.12
-        addq      $24, %rsp                                     #1567.12
-..___tag_value_NucStrstrMake.718:                               #
-        popq      %rbx                                          #1567.12
-..___tag_value_NucStrstrMake.720:                               #
-        popq      %rbp                                          #1567.12
-..___tag_value_NucStrstrMake.722:                               #
-        popq      %r12                                          #1567.12
-..___tag_value_NucStrstrMake.724:                               #
-        popq      %r13                                          #1567.12
-..___tag_value_NucStrstrMake.726:                               #
-        popq      %r14                                          #1567.12
-..___tag_value_NucStrstrMake.728:                               #
-        popq      %r15                                          #1567.12
-..___tag_value_NucStrstrMake.730:                               #
-        ret                                                     #1567.12
-..___tag_value_NucStrstrMake.731:                               #
-                                # LOE
-..B13.13:                       # Preds ..B13.4                 # Infreq
-        lea       fasta_2na_map.0(%rip), %rdx                   #1548.17
-        movl      $-1, %eax                                     #1548.17
-        movd      %eax, %xmm0                                   #1548.17
-        pshufd    $0, %xmm0, %xmm1                              #1548.17
-        movaps    %xmm1, (%rdx)                                 #1548.17
-        movaps    %xmm1, 16(%rdx)                               #1548.17
-        movaps    %xmm1, 32(%rdx)                               #1548.17
-        movaps    %xmm1, 48(%rdx)                               #1548.17
-        movaps    %xmm1, 64(%rdx)                               #1548.17
-        movaps    %xmm1, 80(%rdx)                               #1548.17
-        movaps    %xmm1, 96(%rdx)                               #1548.17
-        movaps    %xmm1, 112(%rdx)                              #1548.17
-                                # LOE rbx r12 ebp r13d
-..B13.14:                       # Preds ..B13.13                # Infreq
-        lea       fasta_4na_map.0(%rip), %rdx                   #1548.17
-        movl      $-1, %eax                                     #1548.17
-        movd      %eax, %xmm0                                   #1548.17
-        pshufd    $0, %xmm0, %xmm1                              #1548.17
-        movaps    %xmm1, (%rdx)                                 #1548.17
-        movaps    %xmm1, 16(%rdx)                               #1548.17
-        movaps    %xmm1, 32(%rdx)                               #1548.17
-        movaps    %xmm1, 48(%rdx)                               #1548.17
-        movaps    %xmm1, 64(%rdx)                               #1548.17
-        movaps    %xmm1, 80(%rdx)                               #1548.17
-        movaps    %xmm1, 96(%rdx)                               #1548.17
-        movaps    %xmm1, 112(%rdx)                              #1548.17
-                                # LOE rbx r12 ebp r13d
-..B13.15:                       # Preds ..B13.14                # Infreq
-        xorl      %r15d, %r15d                                  #1548.17
-        lea       _2__STRING.0.0(%rip), %rax                    #1548.17
-        movsbl    (%rax), %edx                                  #1548.17
-        movl      %edx, (%rsp)                                  #1548.17
-        lea       1+_2__STRING.0.0(%rip), %r14                  #
-        call      __ctype_tolower_loc at PLT                       #1548.17
-                                # LOE rbx r12 r14 ebp r13d r15d
-..B13.43:                       # Preds ..B13.15                # Infreq
-        movl      %r13d, 8(%rsp)                                #
-        movl      (%rsp), %r13d                                 #
-                                # LOE rbx r12 r14 ebp r13d r15d
-..B13.21:                       # Preds ..B13.43 ..B13.22       # Infreq
-        movl      %r13d, %edi                                   #1548.17
-        call      tolower at PLT                                   #1548.17
-                                # LOE rbx r12 r14 eax ebp r13d r15d
-..B13.41:                       # Preds ..B13.21                # Infreq
-        movslq    %eax, %rdx                                    #1548.17
-                                # LOE rdx rbx r12 r14 ebp r13d r15d
-..B13.22:                       # Preds ..B13.41                # Infreq
-        lea       fasta_2na_map.0(%rip), %rax                   #1548.17
-        movb      %r15b, (%rax,%rdx)                            #1548.17
-        movslq    %r13d, %rdx                                   #1548.17
-        movb      %r15b, (%rax,%rdx)                            #1548.17
-        movsbl    (%r14), %r13d                                 #1548.17
-        incl      %r15d                                         #1548.17
-        incq      %r14                                          #1548.17
-        testl     %r13d, %r13d                                  #1548.17
-        jne       ..B13.21      # Prob 82%                      #1548.17
-                                # LOE rbx r12 r14 ebp r13d r15d
-..B13.23:                       # Preds ..B13.22                # Infreq
-        xorl      %eax, %eax                                    #1548.17
-        lea       _2__STRING.1.0(%rip), %rdx                    #1548.17
-        movsbl    (%rdx), %r14d                                 #1548.17
-        lea       1+_2__STRING.1.0(%rip), %r15                  #
-        movl      %eax, %r13d                                   #1548.17
-                                # LOE rbx r12 r15 ebp r13d r14d
-..B13.29:                       # Preds ..B13.23 ..B13.30       # Infreq
-        movl      %r14d, %edi                                   #1548.17
-        call      tolower at PLT                                   #1548.17
-                                # LOE rbx r12 r15 eax ebp r13d r14d
-..B13.42:                       # Preds ..B13.29                # Infreq
-        movslq    %eax, %rcx                                    #1548.17
-                                # LOE rcx rbx r12 r15 ebp r13d r14d
-..B13.30:                       # Preds ..B13.42                # Infreq
-        lea       fasta_4na_map.0(%rip), %rdx                   #1548.17
-        movb      %r13b, (%rdx,%rcx)                            #1548.17
-        movslq    %r14d, %rcx                                   #1548.17
-        movb      %r13b, (%rdx,%rcx)                            #1548.17
-        movsbl    (%r15), %r14d                                 #1548.17
-        incl      %r13d                                         #1548.17
-        incq      %r15                                          #1548.17
-        testl     %r14d, %r14d                                  #1548.17
-        jne       ..B13.29      # Prob 82%                      #1548.17
-                                # LOE rbx r12 r15 ebp r13d r14d
-..B13.31:                       # Preds ..B13.30                # Infreq
-        movl      8(%rsp), %r13d                                #
-        xorl      %edx, %edx                                    #1548.17
-        xorl      %eax, %eax                                    #1548.17
-                                # LOE rdx rbx r12 eax ebp r13d
-..B13.32:                       # Preds ..B13.35 ..B13.31       # Infreq
-        lea       expand_2na.0(%rip), %rcx                      #1548.17
-        movzwl    (%rcx,%rdx,2), %ecx                           #1548.17
-                                # LOE rdx rbx r12 eax ecx ebp r13d
-..B13.34:                       # Preds ..B13.32                # Infreq
-        rorw      $8, %cx                                       #1548.17
-                                # LOE rdx rbx r12 eax ecx ebp r13d
-..B13.35:                       # Preds ..B13.34                # Infreq
-        lea       expand_2na.0(%rip), %rsi                      #1548.17
-        movw      %cx, (%rsi,%rdx,2)                            #1548.17
-        incl      %eax                                          #1548.17
-        movl      %eax, %edx                                    #1548.17
-        movl      %edx, %eax                                    #1548.17
-        cmpl      $256, %eax                                    #1548.17
-        jb        ..B13.32      # Prob 99%                      #1548.17
-        jmp       ..B13.5       # Prob 100%                     #1548.17
-                                # LOE rdx rbx r12 eax ebp r13d
-..B13.37:                       # Preds ..B13.7                 # Infreq
-        xorl      %eax, %eax                                    #1555.28
-        addq      $24, %rsp                                     #1555.28
-..___tag_value_NucStrstrMake.738:                               #
-        popq      %rbx                                          #1555.28
-..___tag_value_NucStrstrMake.740:                               #
-        popq      %rbp                                          #1555.28
-..___tag_value_NucStrstrMake.742:                               #
-        popq      %r12                                          #1555.28
-..___tag_value_NucStrstrMake.744:                               #
-        popq      %r13                                          #1555.28
-..___tag_value_NucStrstrMake.746:                               #
-        popq      %r14                                          #1555.28
-..___tag_value_NucStrstrMake.748:                               #
-        popq      %r15                                          #1555.28
-..___tag_value_NucStrstrMake.750:                               #
-        ret                                                     #1555.28
-        .align    16,0x90
-..___tag_value_NucStrstrMake.751:                               #
-                                # LOE
-# mark_end;
-	.type	NucStrstrMake, at function
-	.size	NucStrstrMake,.-NucStrstrMake
-	.data
-# -- End  NucStrstrMake
-	.text
-# -- Begin  NucStrstrWhack
-# mark_begin;
-       .align    16,0x90
-	.globl NucStrstrWhack
-NucStrstrWhack:
-# parameter 1: %rdi
-..B14.1:                        # Preds ..B14.0
-..___tag_value_NucStrstrWhack.752:                              #1574.1
-        pushq     %r14                                          #1574.1
-..___tag_value_NucStrstrWhack.754:                              #
-        movq      %rdi, %r14                                    #1574.1
-        testq     %r14, %r14                                    #1575.18
-        je        ..B14.22      # Prob 12%                      #1575.18
-                                # LOE rbx rbp r12 r13 r14 r15
-..B14.2:                        # Preds ..B14.1
-        movl      (%r14), %eax                                  #1577.18
-        cmpl      $12, %eax                                     #1577.9
-        ja        ..B14.21      # Prob 50%                      #1577.9
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B14.3:                        # Preds ..B14.2
-        movl      %eax, %eax                                    #1577.9
-        lea       ..1..TPKT.18_0.0.16(%rip), %rdx               #1577.9
-        movq      (%rdx,%rax,8), %rcx                           #1577.9
-        jmp       *%rcx                                         #1577.9
-                                # LOE rbx rbp r12 r13 r14 r15
-..1.18_0.TAG.0c.0.16:
-..B14.5:                        # Preds ..B14.3
-        movq      8(%r14), %rdi                                 #1601.13
-        call      NucStrstrWhack at PLT                            #1601.13
-        jmp       ..B14.21      # Prob 100%                     #1601.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..1.18_0.TAG.0b.0.16:
-..B14.7:                        # Preds ..B14.3
-        movq      8(%r14), %rdi                                 #1597.13
-        call      NucStrstrWhack at PLT                            #1597.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..B14.8:                        # Preds ..B14.7
-        movq      16(%r14), %rdi                                #1598.13
-        call      NucStrstrWhack at PLT                            #1598.13
-        jmp       ..B14.21      # Prob 100%                     #1598.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..1.18_0.TAG.0a.0.16:
-..1.18_0.TAG.09.0.16:
-..1.18_0.TAG.08.0.16:
-..1.18_0.TAG.07.0.16:
-..1.18_0.TAG.06.0.16:
-..1.18_0.TAG.05.0.16:
-..1.18_0.TAG.04.0.16:
-..1.18_0.TAG.03.0.16:
-..1.18_0.TAG.02.0.16:
-..1.18_0.TAG.01.0.16:
-..1.18_0.TAG.00.0.16:
-..B14.20:                       # Preds ..B14.3 ..B14.3 ..B14.3 ..B14.3 ..B14.3
-                                #       ..B14.3 ..B14.3 ..B14.3 ..B14.3 ..B14.3
-                                #       ..B14.3
-        movq      8(%r14), %r14                                 #1593.20
-                                # LOE rbx rbp r12 r13 r14 r15
-..B14.21:                       # Preds ..B14.5 ..B14.8 ..B14.20 ..B14.2
-        movq      %r14, %rdi                                    #1604.9
-        xorl      %eax, %eax                                    #1604.9
-        call      free at PLT                                      #1604.9
-                                # LOE rbx rbp r12 r13 r15
-..B14.22:                       # Preds ..B14.21 ..B14.1
-..___tag_value_NucStrstrWhack.757:                              #1606.1
-        popq      %r14                                          #1606.1
-..___tag_value_NucStrstrWhack.758:                              #
-        ret                                                     #1606.1
-        .align    16,0x90
-..___tag_value_NucStrstrWhack.759:                              #
-                                # LOE
-# mark_end;
-	.type	NucStrstrWhack, at function
-	.size	NucStrstrWhack,.-NucStrstrWhack
-	.section .data1, "wa"
-	.space 24	# pad
-	.align 32
-..1..TPKT.18_0.0.16:
-	.quad	..1.18_0.TAG.00.0.16
-	.quad	..1.18_0.TAG.01.0.16
-	.quad	..1.18_0.TAG.02.0.16
-	.quad	..1.18_0.TAG.03.0.16
-	.quad	..1.18_0.TAG.04.0.16
-	.quad	..1.18_0.TAG.05.0.16
-	.quad	..1.18_0.TAG.06.0.16
-	.quad	..1.18_0.TAG.07.0.16
-	.quad	..1.18_0.TAG.08.0.16
-	.quad	..1.18_0.TAG.09.0.16
-	.quad	..1.18_0.TAG.0a.0.16
-	.quad	..1.18_0.TAG.0b.0.16
-	.quad	..1.18_0.TAG.0c.0.16
-	.data
-# -- End  NucStrstrWhack
-	.text
-# -- Begin  nss_unary_expr
-# mark_begin;
-       .align    16,0x90
-nss_unary_expr:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %rdx
-# parameter 4: %rcx
-# parameter 5: %r8d
-..B15.1:                        # Preds ..B15.0
-..___tag_value_nss_unary_expr.760:                              #1361.1
-        pushq     %r15                                          #1361.1
-..___tag_value_nss_unary_expr.762:                              #
-        pushq     %r14                                          #1361.1
-..___tag_value_nss_unary_expr.764:                              #
-        pushq     %r13                                          #1361.1
-..___tag_value_nss_unary_expr.766:                              #
-        pushq     %r12                                          #1361.1
-..___tag_value_nss_unary_expr.768:                              #
-        pushq     %rbp                                          #1361.1
-..___tag_value_nss_unary_expr.770:                              #
-        pushq     %rbx                                          #1361.1
-..___tag_value_nss_unary_expr.772:                              #
-        pushq     %rsi                                          #1361.1
-..___tag_value_nss_unary_expr.774:                              #
-        movl      %r8d, %r14d                                   #1361.1
-        movq      %rcx, %r13                                    #1361.1
-        movq      %rdx, %r12                                    #1361.1
-        movq      %rsi, %rbp                                    #1361.1
-        movq      %rdi, %rbx                                    #1361.1
-        call      __ctype_b_loc at PLT                             #1364.16
-                                # LOE rax rbx rbp r12 r13 r14d
-..B15.60:                       # Preds ..B15.1
-        movq      %rax, %r15                                    #1364.16
-        jmp       ..B15.2       # Prob 100%                     #1364.16
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.48:                       # Preds ..B15.47
-        movl      $12, (%rax)                                   #1384.13
-        movl      $13, 4(%rax)                                  #1385.13
-        movq      $0, 8(%rax)                                   #1386.13
-        movq      %rax, (%r12)                                  #1387.13
-        lea       8(%rax), %r12                                 #1389.44
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.2:                        # Preds ..B15.48 ..B15.60
-        movsbl    (%rbx), %eax                                  #1363.12
-        cmpl      $33, %eax                                     #1363.17
-        je        ..B15.38      # Prob 33%                      #1363.17
-                                # LOE rbx rbp r12 r13 r15 eax r14d
-..B15.3:                        # Preds ..B15.2
-        cmpl      $94, %eax                                     #1364.16
-        jne       ..B15.15      # Prob 67%                      #1364.16
-                                # LOE rbx rbp r12 r13 r15 eax r14d
-..B15.4:                        # Preds ..B15.3
-        movl      $16, %edi                                     #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE rax rbx rbp r12 r13 r15 r14d
-..B15.5:                        # Preds ..B15.4
-        testq     %rax, %rax                                    #1364.16
-        jne       ..B15.7       # Prob 68%                      #1364.16
-                                # LOE rax rbx rbp r12 r13 r15 r14d
-..B15.6:                        # Preds ..B15.5
-        call      __errno_location at PLT                          #1364.16
-                                # LOE rax rbx r13
-..B15.62:                       # Preds ..B15.6
-        movl      (%rax), %edx                                  #1364.16
-        movl      %edx, (%r13)                                  #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.7:                        # Preds ..B15.5
-        movl      $12, (%rax)                                   #1364.16
-        lea       1(%rbx), %rdi                                 #1364.16
-        xorl      %r8d, %r8d                                    #1364.16
-        cmpq      %rbp, %rdi                                    #1364.16
-        movl      $14, 4(%rax)                                  #1364.16
-        movq      $0, 8(%rax)                                   #1364.16
-        movq      %rax, (%r12)                                  #1364.16
-        jae       ..B15.12      # Prob 2%                       #1364.16
-                                # LOE rax rbx rbp rdi r8 r13 r15 r14d
-..B15.8:                        # Preds ..B15.7
-        movq      (%r15), %rsi                                  #1364.16
-        movq      %rbp, %rcx                                    #1361.1
-        subq      %rbx, %rcx                                    #1361.1
-        decq      %rcx                                          #1361.1
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14d
-..B15.9:                        # Preds ..B15.10 ..B15.8
-        movzbl    1(%r8,%rbx), %r9d                             #1364.16
-        movzwl    (%rsi,%r9,2), %r10d                           #1364.16
-        testl     $8192, %r10d                                  #1364.16
-        je        ..B15.12      # Prob 20%                      #1364.16
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14d
-..B15.10:                       # Preds ..B15.9
-        lea       2(%r8,%rbx), %rdi                             #1364.16
-        incq      %r8                                           #1364.16
-        cmpq      %rcx, %r8                                     #1364.16
-        jb        ..B15.9       # Prob 1%                       #1364.16
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14d
-..B15.12:                       # Preds ..B15.9 ..B15.10 ..B15.7
-        addq      $8, %rax                                      #1364.16
-        movq      %rbp, %rsi                                    #1364.16
-        movq      %rax, %rdx                                    #1364.16
-        movq      %r13, %rcx                                    #1364.16
-        movl      %r14d, %r8d                                   #1364.16
-        call      nss_fasta_expr at PLT                            #1364.16
-                                # LOE rax
-..B15.63:                       # Preds ..B15.12
-        movq      %rax, %rbx                                    #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.15:                       # Preds ..B15.3
-        cmpl      $40, %eax                                     #1364.16
-        jne       ..B15.27      # Prob 50%                      #1364.16
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.16:                       # Preds ..B15.15
-        movl      $16, %edi                                     #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE rax rbx rbp r12 r13 r14d
-..B15.64:                       # Preds ..B15.16
-        movq      %rax, %r15                                    #1364.16
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.17:                       # Preds ..B15.64
-        testq     %r15, %r15                                    #1364.16
-        jne       ..B15.19      # Prob 68%                      #1364.16
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.18:                       # Preds ..B15.17
-        call      __errno_location at PLT                          #1364.16
-                                # LOE rax rbx r13
-..B15.65:                       # Preds ..B15.18
-        movl      (%rax), %edx                                  #1364.16
-        movl      %edx, (%r13)                                  #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.19:                       # Preds ..B15.17
-        movl      $12, (%r15)                                   #1364.16
-        incq      %rbx                                          #1364.16
-        lea       8(%r15), %rdx                                 #1364.16
-        movq      %rbx, %rdi                                    #1364.16
-        movl      $0, 4(%r15)                                   #1364.16
-        movq      %r15, (%r12)                                  #1364.16
-        movq      %rbp, %rsi                                    #1364.16
-        movq      %r13, %rcx                                    #1364.16
-        movl      %r14d, %r8d                                   #1364.16
-        call      nss_expr at PLT                                  #1364.16
-                                # LOE rax rbp r13 r15
-..B15.66:                       # Preds ..B15.19
-        movq      %rax, %rbx                                    #1364.16
-                                # LOE rbx rbp r13 r15
-..B15.20:                       # Preds ..B15.66
-        movl      (%r13), %eax                                  #1364.16
-        testl     %eax, %eax                                    #1364.16
-        jne       ..B15.37      # Prob 50%                      #1364.16
-                                # LOE rbx rbp r13 r15
-..B15.21:                       # Preds ..B15.20
-        movq      8(%r15), %rax                                 #1364.16
-        testq     %rax, %rax                                    #1364.16
-        je        ..B15.50      # Prob 12%                      #1364.16
-                                # LOE rbx rbp r13
-..B15.22:                       # Preds ..B15.21
-        cmpq      %rbp, %rbx                                    #1364.16
-        je        ..B15.50      # Prob 12%                      #1364.16
-                                # LOE rbx r13
-..B15.23:                       # Preds ..B15.22
-        movsbl    (%rbx), %eax                                  #1364.16
-        cmpl      $41, %eax                                     #1364.16
-        je        ..B15.25      # Prob 16%                      #1364.16
-                                # LOE rbx r13
-..B15.24:                       # Preds ..B15.23
-        movl      $22, (%r13)                                   #1364.16
-        incq      %rbx                                          #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.25:                       # Preds ..B15.23
-        incq      %rbx                                          #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.27:                       # Preds ..B15.15
-        movq      %rbx, %rdi                                    #1364.16
-        movq      %rbp, %rsi                                    #1364.16
-        movq      %r12, %rdx                                    #1364.16
-        movq      %r13, %rcx                                    #1364.16
-        movl      %r14d, %r8d                                   #1364.16
-        call      nss_fasta_expr at PLT                            #1364.16
-                                # LOE rax rbp r12 r13 r15
-..B15.28:                       # Preds ..B15.27
-        movl      (%r13), %edx                                  #1364.16
-        movq      %rax, %rbx                                    #1364.16
-        testl     %edx, %edx                                    #1364.16
-        jne       ..B15.37      # Prob 50%                      #1364.16
-                                # LOE rax rbx rbp r12 r13 r15
-..B15.29:                       # Preds ..B15.28
-        cmpq      %rbp, %rax                                    #1364.16
-        jae       ..B15.37      # Prob 33%                      #1364.16
-                                # LOE rax rbx rbp r12 r13 r15
-..B15.30:                       # Preds ..B15.29
-        movq      (%r15), %rsi                                  #1364.16
-        movq      %rax, %rbx                                    #1364.16
-        xorl      %edx, %edx                                    #1364.16
-        movq      %rbp, %rcx                                    #1361.1
-        subq      %rax, %rcx                                    #1361.1
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13
-..B15.31:                       # Preds ..B15.30 ..B15.32
-        movzbl    (%rdx,%rax), %edi                             #1364.16
-        movzwl    (%rsi,%rdi,2), %r8d                           #1364.16
-        testl     $8192, %r8d                                   #1364.16
-        je        ..B15.34      # Prob 20%                      #1364.16
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13
-..B15.32:                       # Preds ..B15.31
-        lea       1(%rdx,%rax), %rbx                            #1364.16
-        incq      %rdx                                          #1364.16
-        cmpq      %rcx, %rdx                                    #1364.16
-        jb        ..B15.31      # Prob 1%                       #1364.16
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13
-..B15.34:                       # Preds ..B15.31 ..B15.32
-        cmpq      %rbp, %rbx                                    #1364.16
-        jae       ..B15.37      # Prob 12%                      #1364.16
-                                # LOE rbx r12 r13
-..B15.35:                       # Preds ..B15.34
-        movsbl    (%rbx), %eax                                  #1364.16
-        cmpl      $36, %eax                                     #1364.16
-        je        ..B15.51      # Prob 5%                       #1364.16
-                                # LOE rbx r12 r13
-..B15.37:                       # Preds ..B15.28 ..B15.29 ..B15.34 ..B15.35 ..B15.53
-                                #       ..B15.70 ..B15.20 ..B15.50 ..B15.65 ..B15.62
-                                #       ..B15.63 ..B15.24 ..B15.25
-        movq      %rbx, %rax                                    #1364.16
-        popq      %rcx                                          #1364.16
-..___tag_value_nss_unary_expr.775:                              #
-        popq      %rbx                                          #1364.16
-..___tag_value_nss_unary_expr.777:                              #
-        popq      %rbp                                          #1364.16
-..___tag_value_nss_unary_expr.779:                              #
-        popq      %r12                                          #1364.16
-..___tag_value_nss_unary_expr.781:                              #
-        popq      %r13                                          #1364.16
-..___tag_value_nss_unary_expr.783:                              #
-        popq      %r14                                          #1364.16
-..___tag_value_nss_unary_expr.785:                              #
-        popq      %r15                                          #1364.16
-..___tag_value_nss_unary_expr.787:                              #
-        ret                                                     #1364.16
-..___tag_value_nss_unary_expr.788:                              #
-                                # LOE
-..B15.38:                       # Preds ..B15.2
-        incq      %rbx                                          #1374.19
-        movq      %rbx, %rsi                                    #1374.9
-        xorl      %ecx, %ecx                                    #1374.9
-        cmpq      %rbp, %rbx                                    #1374.9
-        jae       ..B15.43      # Prob 2%                       #1374.9
-                                # LOE rcx rbx rbp rsi r12 r13 r15 r14d
-..B15.39:                       # Preds ..B15.38
-        movq      (%r15), %rdx                                  #1374.9
-        movq      %rbp, %rax                                    #1361.1
-        subq      %rbx, %rax                                    #1361.1
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13 r15 r14d
-..B15.40:                       # Preds ..B15.41 ..B15.39
-        movzbl    (%rcx,%rsi), %edi                             #1374.9
-        movzwl    (%rdx,%rdi,2), %r8d                           #1374.9
-        testl     $8192, %r8d                                   #1374.9
-        je        ..B15.43      # Prob 20%                      #1374.9
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13 r15 r14d
-..B15.41:                       # Preds ..B15.40
-        lea       1(%rcx,%rsi), %rbx                            #1374.9
-        incq      %rcx                                          #1374.9
-        cmpq      %rax, %rcx                                    #1374.9
-        jb        ..B15.40      # Prob 16%                      #1374.9
-                                # LOE rax rdx rcx rbx rbp rsi r12 r13 r15 r14d
-..B15.43:                       # Preds ..B15.40 ..B15.41 ..B15.38
-        cmpq      %rbp, %rbx                                    #1375.15
-        jne       ..B15.46      # Prob 68%                      #1375.15
-                                # LOE rbx rbp r12 r13 r15 r14d
-..B15.44:                       # Preds ..B15.43
-        movl      $22, (%r13)                                   #1376.9
-                                # LOE rbx
-..B15.45:                       # Preds ..B15.44 ..B15.71
-        movq      %rbx, %rax                                    #1393.12
-        popq      %rcx                                          #1393.12
-..___tag_value_nss_unary_expr.795:                              #
-        popq      %rbx                                          #1393.12
-..___tag_value_nss_unary_expr.797:                              #
-        popq      %rbp                                          #1393.12
-..___tag_value_nss_unary_expr.799:                              #
-        popq      %r12                                          #1393.12
-..___tag_value_nss_unary_expr.801:                              #
-        popq      %r13                                          #1393.12
-..___tag_value_nss_unary_expr.803:                              #
-        popq      %r14                                          #1393.12
-..___tag_value_nss_unary_expr.805:                              #
-        popq      %r15                                          #1393.12
-..___tag_value_nss_unary_expr.807:                              #
-        ret                                                     #1393.12
-..___tag_value_nss_unary_expr.808:                              #
-                                # LOE
-..B15.46:                       # Preds ..B15.43
-        movl      $16, %edi                                     #1379.25
-        call      malloc at PLT                                    #1379.25
-                                # LOE rax rbx rbp r12 r13 r15 r14d
-..B15.47:                       # Preds ..B15.46
-        testq     %rax, %rax                                    #1380.19
-        je        ..B15.56      # Prob 1%                       #1380.19
-        jmp       ..B15.48      # Prob 100%                     #1380.19
-                                # LOE rax rbx rbp r12 r13 r15 r14d
-..B15.50:                       # Preds ..B15.21 ..B15.22       # Infreq
-        movl      $22, (%r13)                                   #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.51:                       # Preds ..B15.35                # Infreq
-        incq      %rbx                                          #1364.16
-        movl      $16, %edi                                     #1364.16
-        call      malloc at PLT                                    #1364.16
-                                # LOE rax rbx r12 r13
-..B15.52:                       # Preds ..B15.51                # Infreq
-        testq     %rax, %rax                                    #1364.16
-        je        ..B15.54      # Prob 12%                      #1364.16
-                                # LOE rax rbx r12 r13
-..B15.53:                       # Preds ..B15.52                # Infreq
-        movl      $12, (%rax)                                   #1364.16
-        movl      $15, 4(%rax)                                  #1364.16
-        movq      (%r12), %rdx                                  #1364.16
-        movq      %rdx, 8(%rax)                                 #1364.16
-        movq      %rax, (%r12)                                  #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.54:                       # Preds ..B15.52                # Infreq
-        call      __errno_location at PLT                          #1364.16
-                                # LOE rax rbx r13
-..B15.70:                       # Preds ..B15.54                # Infreq
-        movl      (%rax), %edx                                  #1364.16
-        movl      %edx, (%r13)                                  #1364.16
-        jmp       ..B15.37      # Prob 100%                     #1364.16
-                                # LOE rbx
-..B15.56:                       # Preds ..B15.47                # Infreq
-        call      __errno_location at PLT                          #1381.24
-                                # LOE rax rbx r13
-..B15.71:                       # Preds ..B15.56                # Infreq
-        movl      (%rax), %edx                                  #1381.24
-        movl      %edx, (%r13)                                  #1381.13
-        jmp       ..B15.45      # Prob 100%                     #1381.13
-        .align    16,0x90
-..___tag_value_nss_unary_expr.815:                              #
-                                # LOE rbx
-# mark_end;
-	.type	nss_unary_expr, at function
-	.size	nss_unary_expr,.-nss_unary_expr
-	.data
-# -- End  nss_unary_expr
-	.text
-# -- Begin  nss_fasta_expr
-# mark_begin;
-       .align    16,0x90
-nss_fasta_expr:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %rdx
-# parameter 4: %rcx
-# parameter 5: %r8d
-..B16.1:                        # Preds ..B16.0
-..___tag_value_nss_fasta_expr.816:                              #1234.1
-        pushq     %r14                                          #1234.1
-..___tag_value_nss_fasta_expr.818:                              #
-        pushq     %r12                                          #1234.1
-..___tag_value_nss_fasta_expr.820:                              #
-        pushq     %rbx                                          #1234.1
-..___tag_value_nss_fasta_expr.822:                              #
-        movq      %rcx, %r12                                    #1234.1
-        movq      %rsi, %rbx                                    #1234.1
-        movq      %rdi, %rax                                    #1234.1
-        movsbl    (%rax), %ecx                                  #1236.16
-        cmpl      $39, %ecx                                     #1236.16
-        jne       ..B16.11      # Prob 67%                      #1236.16
-                                # LOE rax rdx rbx rbp r12 r13 r15 ecx r8d
-..B16.2:                        # Preds ..B16.1
-        incq      %rax                                          #1239.30
-        movq      %rax, %r14                                    #1239.30
-        cmpq      %rbx, %rax                                    #1239.13
-        jb        ..B16.4       # Prob 56%                      #1239.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d
-..B16.3:                        # Preds ..B16.56 ..B16.38 ..B16.2
-        movl      $22, (%r12)                                   #1239.13
-..___tag_value_nss_fasta_expr.825:                              #1239.13
-        popq      %rbx                                          #1239.13
-..___tag_value_nss_fasta_expr.826:                              #
-        popq      %r12                                          #1239.13
-..___tag_value_nss_fasta_expr.828:                              #
-        popq      %r14                                          #1239.13
-..___tag_value_nss_fasta_expr.830:                              #
-        ret                                                     #1239.13
-..___tag_value_nss_fasta_expr.831:                              #
-                                # LOE rax rbp r13 r15
-..B16.4:                        # Preds ..B16.2
-        xorl      %r9d, %r9d                                    #1239.13
-        lea       fasta_2na_map.0(%rip), %rcx                   #1239.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.5:                        # Preds ..B16.7 ..B16.4
-        movsbl    (%r14), %r10d                                 #1239.13
-        testl     %r10d, %r10d                                  #1239.13
-        jl        ..B16.9       # Prob 20%                      #1239.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.6:                        # Preds ..B16.5
-        movzbl    (%r14), %r10d                                 #1239.13
-        movsbl    (%r10,%rcx), %r11d                            #1239.13
-        testl     %r11d, %r11d                                  #1239.13
-        jl        ..B16.44      # Prob 16%                      #1239.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.7:                        # Preds ..B16.46 ..B16.6
-        incq      %r14                                          #1239.13
-        cmpq      %rbx, %r14                                    #1239.13
-        jb        ..B16.5       # Prob 82%                      #1239.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.9:                        # Preds ..B16.45 ..B16.44 ..B16.5 ..B16.7
-        cmpq      %rax, %r14                                    #1239.13
-        ja        ..B16.32      # Prob 12%                      #1239.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.10:                       # Preds ..B16.9
-        movl      $22, (%r12)                                   #1239.13
-        movq      %r14, %rax                                    #1239.13
-..___tag_value_nss_fasta_expr.835:                              #1239.13
-        popq      %rbx                                          #1239.13
-..___tag_value_nss_fasta_expr.836:                              #
-        popq      %r12                                          #1239.13
-..___tag_value_nss_fasta_expr.838:                              #
-        popq      %r14                                          #1239.13
-..___tag_value_nss_fasta_expr.840:                              #
-        ret                                                     #1239.13
-..___tag_value_nss_fasta_expr.841:                              #
-                                # LOE rax rbp r13 r15
-..B16.11:                       # Preds ..B16.1
-        cmpl      $34, %ecx                                     #1236.16
-        jne       ..B16.22      # Prob 50%                      #1236.16
-                                # LOE rax rdx rbx rbp r12 r13 r15 r8d
-..B16.12:                       # Preds ..B16.11
-        incq      %rax                                          #1244.30
-        movq      %rax, %r14                                    #1244.30
-        cmpq      %rbx, %rax                                    #1244.13
-        jb        ..B16.14      # Prob 56%                      #1244.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d
-..B16.13:                       # Preds ..B16.12
-        movl      $22, (%r12)                                   #1244.13
-..___tag_value_nss_fasta_expr.845:                              #1244.13
-        popq      %rbx                                          #1244.13
-..___tag_value_nss_fasta_expr.846:                              #
-        popq      %r12                                          #1244.13
-..___tag_value_nss_fasta_expr.848:                              #
-        popq      %r14                                          #1244.13
-..___tag_value_nss_fasta_expr.850:                              #
-        ret                                                     #1244.13
-..___tag_value_nss_fasta_expr.851:                              #
-                                # LOE rax rbp r13 r15
-..B16.14:                       # Preds ..B16.12
-        xorl      %r9d, %r9d                                    #1244.13
-        lea       fasta_2na_map.0(%rip), %rcx                   #1244.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.15:                       # Preds ..B16.17 ..B16.14
-        movsbl    (%r14), %r10d                                 #1244.13
-        testl     %r10d, %r10d                                  #1244.13
-        jl        ..B16.19      # Prob 20%                      #1244.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.16:                       # Preds ..B16.15
-        movzbl    (%r14), %r10d                                 #1244.13
-        movsbl    (%r10,%rcx), %r11d                            #1244.13
-        testl     %r11d, %r11d                                  #1244.13
-        jl        ..B16.62      # Prob 16%                      #1244.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.17:                       # Preds ..B16.64 ..B16.16
-        incq      %r14                                          #1244.13
-        cmpq      %rbx, %r14                                    #1244.13
-        jb        ..B16.15      # Prob 82%                      #1244.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.19:                       # Preds ..B16.63 ..B16.62 ..B16.15 ..B16.17
-        cmpq      %rax, %r14                                    #1244.13
-        ja        ..B16.50      # Prob 12%                      #1244.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.20:                       # Preds ..B16.19
-        movl      $22, (%r12)                                   #1244.13
-        movq      %r14, %rax                                    #1244.13
-                                # LOE rax rbp r13 r15
-..B16.21:                       # Preds ..B16.20
-..___tag_value_nss_fasta_expr.855:                              #1252.12
-        popq      %rbx                                          #1252.12
-..___tag_value_nss_fasta_expr.856:                              #
-        popq      %r12                                          #1252.12
-..___tag_value_nss_fasta_expr.858:                              #
-        popq      %r14                                          #1252.12
-..___tag_value_nss_fasta_expr.860:                              #
-        ret                                                     #1252.12
-..___tag_value_nss_fasta_expr.861:                              #
-                                # LOE
-..B16.22:                       # Preds ..B16.11
-        movq      %rax, %r14                                    #1234.1
-        cmpq      %rbx, %rax                                    #1249.16
-        jae       ..B16.30      # Prob 44%                      #1249.16
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d
-..B16.24:                       # Preds ..B16.22
-        xorl      %r9d, %r9d                                    #1249.16
-        lea       fasta_2na_map.0(%rip), %rcx                   #1249.16
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.25:                       # Preds ..B16.27 ..B16.24
-        movsbl    (%r14), %r10d                                 #1249.16
-        testl     %r10d, %r10d                                  #1249.16
-        jl        ..B16.29      # Prob 20%                      #1249.16
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.26:                       # Preds ..B16.25
-        movzbl    (%r14), %r10d                                 #1249.16
-        movsbl    (%r10,%rcx), %r11d                            #1249.16
-        testl     %r11d, %r11d                                  #1249.16
-        jl        ..B16.73      # Prob 16%                      #1249.16
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.27:                       # Preds ..B16.75 ..B16.26
-        incq      %r14                                          #1249.16
-        cmpq      %rbx, %r14                                    #1249.16
-        jb        ..B16.25      # Prob 82%                      #1249.16
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.29:                       # Preds ..B16.74 ..B16.73 ..B16.25 ..B16.27
-        cmpq      %rax, %r14                                    #1249.16
-        ja        ..B16.68      # Prob 12%                      #1249.16
-                                # LOE rax rdx rbp r12 r13 r14 r15 r8d r9d
-..B16.30:                       # Preds ..B16.22 ..B16.29
-        movl      $22, (%r12)                                   #1249.16
-                                # LOE rbp r13 r14 r15
-..B16.31:                       # Preds ..B16.30 ..B16.70 ..B16.72
-        movq      %r14, %rax                                    #1249.16
-..___tag_value_nss_fasta_expr.865:                              #1249.16
-        popq      %rbx                                          #1249.16
-..___tag_value_nss_fasta_expr.866:                              #
-        popq      %r12                                          #1249.16
-..___tag_value_nss_fasta_expr.868:                              #
-        popq      %r14                                          #1249.16
-..___tag_value_nss_fasta_expr.870:                              #
-        ret                                                     #1249.16
-..___tag_value_nss_fasta_expr.871:                              #
-                                # LOE
-..B16.32:                       # Preds ..B16.9                 # Infreq
-        testl     %r9d, %r9d                                    #1239.13
-        jne       ..B16.35      # Prob 50%                      #1239.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d
-..B16.33:                       # Preds ..B16.32                # Infreq
-        movq      %r14, %rcx                                    #1239.13
-        subq      %rax, %rcx                                    #1239.13
-        movq      %rdx, %rdi                                    #1239.13
-        movl      %r8d, %esi                                    #1239.13
-        movq      %rax, %rdx                                    #1239.13
-        call      NucStrFastaExprMake2 at PLT                      #1239.13
-        jmp       ..B16.82      # Prob 100%                     #1239.13
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B16.35:                       # Preds ..B16.32                # Infreq
-        movq      %r14, %rcx                                    #1239.13
-        subq      %rax, %rcx                                    #1239.13
-        movq      %rdx, %rdi                                    #1239.13
-        movl      %r8d, %esi                                    #1239.13
-        movq      %rax, %rdx                                    #1239.13
-        call      NucStrFastaExprMake4 at PLT                      #1239.13
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B16.82:                       # Preds ..B16.33 ..B16.35       # Infreq
-        movl      %eax, %esi                                    #1239.13
-                                # LOE rbx rbp r12 r13 r14 r15 esi
-..B16.37:                       # Preds ..B16.82                # Infreq
-        movq      %r14, %rax                                    #1239.13
-        testl     %esi, %esi                                    #1240.26
-        jne       ..B16.41      # Prob 50%                      #1240.26
-                                # LOE rax rbx rbp r12 r13 r14 r15 esi
-..B16.38:                       # Preds ..B16.37                # Infreq
-        cmpq      %rbx, %r14                                    #1240.38
-        je        ..B16.3       # Prob 12%                      #1240.38
-                                # LOE rax rbp r12 r13 r14 r15 esi
-..B16.39:                       # Preds ..B16.38                # Infreq
-        movsbl    (%r14), %ecx                                  #1240.47
-        lea       1(%r14), %rax                                 #1240.47
-        cmpl      $39, %ecx                                     #1240.55
-        je        ..B16.41      # Prob 16%                      #1240.55
-                                # LOE rax rbp r12 r13 r15 esi
-..B16.40:                       # Preds ..B16.39                # Infreq
-        movl      $22, (%r12)                                   #1241.13
-..___tag_value_nss_fasta_expr.875:                              #1241.13
-        popq      %rbx                                          #1241.13
-..___tag_value_nss_fasta_expr.876:                              #
-        popq      %r12                                          #1241.13
-..___tag_value_nss_fasta_expr.878:                              #
-        popq      %r14                                          #1241.13
-..___tag_value_nss_fasta_expr.880:                              #
-        ret                                                     #1241.13
-..___tag_value_nss_fasta_expr.881:                              #
-                                # LOE rax rbp r13 r15
-..B16.41:                       # Preds ..B16.55 ..B16.57 ..B16.37 ..B16.39 # Infreq
-        movl      %esi, (%r12)                                  #1241.13
-..___tag_value_nss_fasta_expr.885:                              #1241.13
-        popq      %rbx                                          #1241.13
-..___tag_value_nss_fasta_expr.886:                              #
-        popq      %r12                                          #1241.13
-..___tag_value_nss_fasta_expr.888:                              #
-        popq      %r14                                          #1241.13
-..___tag_value_nss_fasta_expr.890:                              #
-        ret                                                     #1241.13
-..___tag_value_nss_fasta_expr.891:                              #
-                                # LOE rax rbp r13 r15
-..B16.44:                       # Preds ..B16.6                 # Infreq
-        lea       fasta_4na_map.0(%rip), %r11                   #1239.13
-        cmpq      %r11, %rcx                                    #1239.13
-        je        ..B16.9       # Prob 20%                      #1239.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.45:                       # Preds ..B16.44                # Infreq
-        movl      %r10d, %r10d                                  #1239.13
-        lea       fasta_4na_map.0(%rip), %rcx                   #1239.13
-        movsbl    (%rcx,%r10), %r11d                            #1239.13
-        testl     %r11d, %r11d                                  #1239.13
-        jl        ..B16.9       # Prob 20%                      #1239.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.46:                       # Preds ..B16.45                # Infreq
-        movl      $1, %r9d                                      #1239.13
-        lea       fasta_4na_map.0(%rip), %rcx                   #1239.13
-        jmp       ..B16.7       # Prob 100%                     #1239.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.50:                       # Preds ..B16.19                # Infreq
-        testl     %r9d, %r9d                                    #1244.13
-        jne       ..B16.53      # Prob 50%                      #1244.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d
-..B16.51:                       # Preds ..B16.50                # Infreq
-        movq      %r14, %rcx                                    #1244.13
-        subq      %rax, %rcx                                    #1244.13
-        movq      %rdx, %rdi                                    #1244.13
-        movl      %r8d, %esi                                    #1244.13
-        movq      %rax, %rdx                                    #1244.13
-        call      NucStrFastaExprMake2 at PLT                      #1244.13
-        jmp       ..B16.84      # Prob 100%                     #1244.13
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B16.53:                       # Preds ..B16.50                # Infreq
-        movq      %r14, %rcx                                    #1244.13
-        subq      %rax, %rcx                                    #1244.13
-        movq      %rdx, %rdi                                    #1244.13
-        movl      %r8d, %esi                                    #1244.13
-        movq      %rax, %rdx                                    #1244.13
-        call      NucStrFastaExprMake4 at PLT                      #1244.13
-                                # LOE rbx rbp r12 r13 r14 r15 eax
-..B16.84:                       # Preds ..B16.51 ..B16.53       # Infreq
-        movl      %eax, %esi                                    #1244.13
-                                # LOE rbx rbp r12 r13 r14 r15 esi
-..B16.55:                       # Preds ..B16.84                # Infreq
-        movq      %r14, %rax                                    #1244.13
-        testl     %esi, %esi                                    #1245.26
-        jne       ..B16.41      # Prob 50%                      #1245.26
-                                # LOE rax rbx rbp r12 r13 r14 r15 esi
-..B16.56:                       # Preds ..B16.55                # Infreq
-        cmpq      %rbx, %r14                                    #1245.38
-        je        ..B16.3       # Prob 12%                      #1245.38
-                                # LOE rax rbp r12 r13 r14 r15 esi
-..B16.57:                       # Preds ..B16.56                # Infreq
-        movsbl    (%r14), %ecx                                  #1245.47
-        lea       1(%r14), %rax                                 #1245.47
-        cmpl      $34, %ecx                                     #1245.55
-        je        ..B16.41      # Prob 16%                      #1245.55
-                                # LOE rax rbp r12 r13 r15 esi
-..B16.58:                       # Preds ..B16.57                # Infreq
-        movl      $22, (%r12)                                   #1246.13
-..___tag_value_nss_fasta_expr.895:                              #1246.13
-        popq      %rbx                                          #1246.13
-..___tag_value_nss_fasta_expr.896:                              #
-        popq      %r12                                          #1246.13
-..___tag_value_nss_fasta_expr.898:                              #
-        popq      %r14                                          #1246.13
-..___tag_value_nss_fasta_expr.900:                              #
-        ret                                                     #1246.13
-..___tag_value_nss_fasta_expr.901:                              #
-                                # LOE rax rbp r13 r15
-..B16.62:                       # Preds ..B16.16                # Infreq
-        lea       fasta_4na_map.0(%rip), %r11                   #1244.13
-        cmpq      %r11, %rcx                                    #1244.13
-        je        ..B16.19      # Prob 20%                      #1244.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.63:                       # Preds ..B16.62                # Infreq
-        movl      %r10d, %r10d                                  #1244.13
-        lea       fasta_4na_map.0(%rip), %rcx                   #1244.13
-        movsbl    (%rcx,%r10), %r11d                            #1244.13
-        testl     %r11d, %r11d                                  #1244.13
-        jl        ..B16.19      # Prob 20%                      #1244.13
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.64:                       # Preds ..B16.63                # Infreq
-        movl      $1, %r9d                                      #1244.13
-        lea       fasta_4na_map.0(%rip), %rcx                   #1244.13
-        jmp       ..B16.17      # Prob 100%                     #1244.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.68:                       # Preds ..B16.29                # Infreq
-        testl     %r9d, %r9d                                    #1249.16
-        jne       ..B16.71      # Prob 50%                      #1249.16
-                                # LOE rax rdx rbp r12 r13 r14 r15 r8d
-..B16.69:                       # Preds ..B16.68                # Infreq
-        movq      %r14, %rcx                                    #1249.16
-        subq      %rax, %rcx                                    #1249.16
-        movq      %rdx, %rdi                                    #1249.16
-        movl      %r8d, %esi                                    #1249.16
-        movq      %rax, %rdx                                    #1249.16
-        call      NucStrFastaExprMake2 at PLT                      #1249.16
-                                # LOE rbp r12 r13 r14 r15 eax
-..B16.70:                       # Preds ..B16.69                # Infreq
-        movl      %eax, (%r12)                                  #1249.16
-        jmp       ..B16.31      # Prob 100%                     #1249.16
-                                # LOE rbp r13 r14 r15
-..B16.71:                       # Preds ..B16.68                # Infreq
-        movq      %r14, %rcx                                    #1249.16
-        subq      %rax, %rcx                                    #1249.16
-        movq      %rdx, %rdi                                    #1249.16
-        movl      %r8d, %esi                                    #1249.16
-        movq      %rax, %rdx                                    #1249.16
-        call      NucStrFastaExprMake4 at PLT                      #1249.16
-                                # LOE rbp r12 r13 r14 r15 eax
-..B16.72:                       # Preds ..B16.71                # Infreq
-        movl      %eax, (%r12)                                  #1249.16
-        jmp       ..B16.31      # Prob 100%                     #1249.16
-                                # LOE rbp r13 r14 r15
-..B16.73:                       # Preds ..B16.26                # Infreq
-        lea       fasta_4na_map.0(%rip), %r11                   #1249.16
-        cmpq      %r11, %rcx                                    #1249.16
-        je        ..B16.29      # Prob 20%                      #1249.16
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d r10d
-..B16.74:                       # Preds ..B16.73                # Infreq
-        movl      %r10d, %r10d                                  #1249.16
-        lea       fasta_4na_map.0(%rip), %rcx                   #1249.16
-        movsbl    (%rcx,%r10), %r11d                            #1249.16
-        testl     %r11d, %r11d                                  #1249.16
-        jl        ..B16.29      # Prob 20%                      #1249.16
-                                # LOE rax rdx rbx rbp r12 r13 r14 r15 r8d r9d
-..B16.75:                       # Preds ..B16.74                # Infreq
-        movl      $1, %r9d                                      #1249.16
-        lea       fasta_4na_map.0(%rip), %rcx                   #1249.16
-        jmp       ..B16.27      # Prob 100%                     #1249.16
-        .align    16,0x90
-..___tag_value_nss_fasta_expr.905:                              #
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15 r8d r9d
-# mark_end;
-	.type	nss_fasta_expr, at function
-	.size	nss_fasta_expr,.-nss_fasta_expr
-	.data
-# -- End  nss_fasta_expr
-	.text
-# -- Begin  NucStrFastaExprMake2
-# mark_begin;
-       .align    16,0x90
-NucStrFastaExprMake2:
-# parameter 1: %rdi
-# parameter 2: %esi
-# parameter 3: %rdx
-# parameter 4: %rcx
-..B17.1:                        # Preds ..B17.0
-..___tag_value_NucStrFastaExprMake2.906:                        #838.1
-        pushq     %r13                                          #838.1
-..___tag_value_NucStrFastaExprMake2.908:                        #
-        pushq     %r12                                          #838.1
-..___tag_value_NucStrFastaExprMake2.910:                        #
-        pushq     %rbp                                          #838.1
-..___tag_value_NucStrFastaExprMake2.912:                        #
-        pushq     %rbx                                          #838.1
-..___tag_value_NucStrFastaExprMake2.914:                        #
-        subq      $40, %rsp                                     #838.1
-..___tag_value_NucStrFastaExprMake2.916:                        #
-        movq      %rcx, %r12                                    #838.1
-        movq      %rdx, %rbp                                    #838.1
-        movl      %esi, %r13d                                   #838.1
-        movq      %rdi, %rbx                                    #838.1
-        cmpq      $61, %r12                                     #844.17
-        jbe       ..B17.3       # Prob 43%                      #844.17
-                                # LOE rbx rbp r12 r14 r15 r13d
-..B17.2:                        # Preds ..B17.1
-        movl      $7, %eax                                      #845.16
-        addq      $40, %rsp                                     #845.16
-..___tag_value_NucStrFastaExprMake2.917:                        #
-        popq      %rbx                                          #845.16
-..___tag_value_NucStrFastaExprMake2.919:                        #
-        popq      %rbp                                          #845.16
-..___tag_value_NucStrFastaExprMake2.921:                        #
-        popq      %r12                                          #845.16
-..___tag_value_NucStrFastaExprMake2.923:                        #
-        popq      %r13                                          #845.16
-..___tag_value_NucStrFastaExprMake2.925:                        #
-        ret                                                     #845.16
-..___tag_value_NucStrFastaExprMake2.926:                        #
-                                # LOE
-..B17.3:                        # Preds ..B17.1
-        movl      $160, %edi                                    #847.9
-        call      malloc at PLT                                    #847.9
-                                # LOE rax rbx rbp r12 r14 r15 r13d
-..B17.4:                        # Preds ..B17.3
-        testq     %rax, %rax                                    #847.9
-        je        ..B17.44      # Prob 12%                      #847.9
-                                # LOE rax rbx rbp r12 r14 r15 r13d
-..B17.5:                        # Preds ..B17.4
-        lea       15(%rax), %rdx                                #847.9
-        andq      $-16, %rdx                                    #847.9
-        movq      %rax, 8(%rdx)                                 #847.9
-        je        ..B17.44      # Prob 5%                       #848.15
-                                # LOE rdx rbx rbp r12 r14 r15 r13d
-..B17.6:                        # Preds ..B17.5
-        movq      %rdx, (%rbx)                                  #851.5
-        movl      %r12d, 4(%rdx)                                #852.5
-        xorl      %esi, %esi                                    #856.11
-        testq     %r12, %r12                                    #856.22
-        jbe       ..B17.17      # Prob 16%                      #856.22
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.8:                        # Preds ..B17.6 ..B17.15
-        movsbq    (%rsi,%rbp), %rcx                             #858.48
-        lea       fasta_2na_map.0(%rip), %rax                   #858.24
-        movzbl    (%rax,%rcx), %ecx                             #858.24
-        movq      %rsi, %rax                                    #859.22
-        andq      $3, %rax                                      #859.22
-        je        ..B17.43      # Prob 20%                      #859.22
-                                # LOE rax rdx rbp rsi r12 r14 r15 ecx r13d
-..B17.9:                        # Preds ..B17.8
-        cmpq      $1, %rax                                      #859.22
-        je        ..B17.14      # Prob 25%                      #859.22
-                                # LOE rax rdx rbp rsi r12 r14 r15 ecx r13d
-..B17.10:                       # Preds ..B17.9
-        cmpq      $2, %rax                                      #859.22
-        jne       ..B17.12      # Prob 67%                      #859.22
-                                # LOE rax rdx rbp rsi r12 r14 r15 ecx r13d
-..B17.11:                       # Preds ..B17.10
-        movq      %rsi, %rax                                    #870.32
-        shrq      $2, %rax                                      #870.32
-        shll      $2, %ecx                                      #870.47
-        orb       %cl, (%rsp,%rax)                              #870.13
-        orb       $12, 16(%rsp,%rax)                            #871.13
-        jmp       ..B17.15      # Prob 100%                     #871.13
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.12:                       # Preds ..B17.10
-        cmpq      $3, %rax                                      #859.22
-        jne       ..B17.15      # Prob 50%                      #859.22
-                                # LOE rdx rbp rsi r12 r14 r15 ecx r13d
-..B17.13:                       # Preds ..B17.12
-        movq      %rsi, %rax                                    #874.32
-        shrq      $2, %rax                                      #874.32
-        orb       %cl, (%rsp,%rax)                              #874.13
-        orb       $3, 16(%rsp,%rax)                             #875.13
-        jmp       ..B17.15      # Prob 100%                     #875.13
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.14:                       # Preds ..B17.9
-        movq      %rsi, %rax                                    #866.32
-        shrq      $2, %rax                                      #866.32
-        shll      $4, %ecx                                      #866.47
-        orb       %cl, (%rsp,%rax)                              #866.13
-        orb       $48, 16(%rsp,%rax)                            #867.13
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.15:                       # Preds ..B17.12 ..B17.43 ..B17.14 ..B17.11 ..B17.13
-                                #      
-        incq      %rsi                                          #856.31
-        cmpq      %r12, %rsi                                    #856.22
-        jb        ..B17.8       # Prob 82%                      #856.22
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.17:                       # Preds ..B17.15 ..B17.6
-        addq      $3, %rsi                                      #881.21
-        shrq      $2, %rsi                                      #881.28
-        cmpq      $16, %rsi                                     #881.35
-        jae       ..B17.30      # Prob 50%                      #881.35
-                                # LOE rdx rsi r12 r14 r15 r13d
-..B17.18:                       # Preds ..B17.17
-        lea       (%rsp), %rax                                  #883.9
-        movq      %rsi, %rbp                                    #881.5
-        negq      %rbp                                          #881.5
-        addq      $16, %rbp                                     #881.5
-        lea       (%rax,%rsi), %rbx                             #881.5
-        movq      %rbx, %rax                                    #881.5
-        andq      $15, %rax                                     #881.5
-        movq      %rax, %rcx                                    #881.5
-        negq      %rcx                                          #881.5
-        addq      $16, %rcx                                     #881.5
-        cmpq      $0, %rax                                      #881.5
-        cmovne    %rcx, %rax                                    #881.5
-        lea       16(%rax), %r8                                 #881.5
-        cmpq      %r8, %rbp                                     #881.5
-        jl        ..B17.42      # Prob 10%                      #881.5
-                                # LOE rax rdx rbx rbp rsi r12 r14 r15 r13d
-..B17.19:                       # Preds ..B17.18
-        movq      %rbp, %rcx                                    #881.5
-        subq      %rax, %rcx                                    #881.5
-        andq      $15, %rcx                                     #881.5
-        negq      %rcx                                          #881.5
-        addq      %rbp, %rcx                                    #881.5
-        xorl      %r9d, %r9d                                    #881.5
-        testq     %rax, %rax                                    #881.5
-        jbe       ..B17.23      # Prob 10%                      #881.5
-                                # LOE rax rdx rcx rbx rbp rsi r9 r12 r14 r15 r13d
-..B17.20:                       # Preds ..B17.19
-        lea       16(%rsp), %r8                                 #884.9
-        addq      %rsi, %r8                                     #
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r12 r14 r15 r13d
-..B17.21:                       # Preds ..B17.21 ..B17.20
-        xorl      %r10d, %r10d                                  #883.9
-        movb      %r10b, (%r9,%rbx)                             #883.9
-        movb      %r10b, (%r9,%r8)                              #884.9
-        incq      %r9                                           #881.5
-        cmpq      %rax, %r9                                     #881.5
-        jb        ..B17.21      # Prob 82%                      #881.5
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r12 r14 r15 r13d
-..B17.23:                       # Preds ..B17.21 ..B17.19
-        lea       (%rsp), %r9                                   #883.9
-        lea       16(%rsp), %r8                                 #884.9
-        addq      %rsi, %r9                                     #
-        addq      %rsi, %r8                                     #
-        pxor      %xmm0, %xmm0                                  #883.29
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r12 r14 r15 r13d xmm0
-..B17.24:                       # Preds ..B17.24 ..B17.23
-        movdqa    %xmm0, (%rax,%r9)                             #883.9
-        movdqa    %xmm0, (%rax,%r8)                             #884.9
-        addq      $16, %rax                                     #881.5
-        cmpq      %rcx, %rax                                    #881.5
-        jb        ..B17.24      # Prob 82%                      #881.5
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r12 r14 r15 r13d xmm0
-..B17.26:                       # Preds ..B17.24 ..B17.42
-        cmpq      %rbp, %rcx                                    #881.5
-        jae       ..B17.30      # Prob 10%                      #881.5
-                                # LOE rdx rcx rbx rbp rsi r12 r14 r15 r13d
-..B17.27:                       # Preds ..B17.26
-        lea       16(%rsp), %rax                                #884.9
-        addq      %rax, %rsi                                    #
-                                # LOE rdx rcx rbx rbp rsi r12 r14 r15 r13d
-..B17.28:                       # Preds ..B17.28 ..B17.27
-        xorl      %eax, %eax                                    #883.9
-        movb      %al, (%rcx,%rbx)                              #883.9
-        movb      %al, (%rcx,%rsi)                              #884.9
-        incq      %rcx                                          #881.5
-        cmpq      %rbp, %rcx                                    #881.5
-        jb        ..B17.28      # Prob 82%                      #881.5
-                                # LOE rdx rcx rbx rbp rsi r12 r14 r15 r13d
-..B17.30:                       # Preds ..B17.28 ..B17.26 ..B17.17
-        testl     %r13d, %r13d                                  #890.10
-        je        ..B17.32      # Prob 50%                      #890.10
-                                # LOE rdx r12 r14 r15
-..B17.31:                       # Preds ..B17.30
-        movl      $9, (%rdx)                                    #892.9
-        jmp       ..B17.41      # Prob 100%                     #892.9
-                                # LOE rdx r14 r15
-..B17.32:                       # Preds ..B17.30
-        cmpq      $2, %r12                                      #896.22
-        jae       ..B17.34      # Prob 50%                      #896.22
-                                # LOE rdx r12 r14 r15
-..B17.33:                       # Preds ..B17.32
-        movzbl    (%rsp), %eax                                  #898.29
-        movzbl    16(%rsp), %esi                                #903.26
-        movl      $2, (%rdx)                                    #908.9
-        movb      %al, 1(%rsp)                                  #898.9
-        movzwl    (%rsp), %ecx                                  #899.29
-        movw      %cx, 2(%rsp)                                  #899.9
-        movl      (%rsp), %ebx                                  #900.29
-        movl      (%rsp), %ebp                                  #901.29
-        movl      %ebx, 4(%rsp)                                 #900.9
-        movb      %sil, 17(%rsp)                                #903.9
-        movzwl    16(%rsp), %r8d                                #904.26
-        movw      %r8w, 18(%rsp)                                #904.9
-        movl      16(%rsp), %r9d                                #905.26
-        movl      16(%rsp), %r10d                               #906.26
-        movl      %r9d, 20(%rsp)                                #905.9
-        movl      %ebx, %ebx                                    #900.9
-        shlq      $32, %rbx                                     #901.29
-        movl      %r9d, %r9d                                    #905.9
-        shlq      $32, %r9                                      #906.26
-        orq       %rbp, %rbx                                    #901.29
-        movq      %rbx, 8(%rsp)                                 #901.9
-        orq       %r10, %r9                                     #906.26
-        movq      %r9, 24(%rsp)                                 #906.9
-        jmp       ..B17.41      # Prob 100%                     #906.9
-                                # LOE rdx r14 r15
-..B17.34:                       # Preds ..B17.32
-        cmpq      $6, %r12                                      #910.22
-        jae       ..B17.36      # Prob 50%                      #910.22
-                                # LOE rdx r12 r14 r15
-..B17.35:                       # Preds ..B17.34
-        movzwl    (%rsp), %eax                                  #912.29
-        movzwl    16(%rsp), %ebp                                #916.26
-        movl      $3, (%rdx)                                    #920.9
-        movw      %ax, 2(%rsp)                                  #912.9
-        movl      (%rsp), %ecx                                  #913.29
-        movl      (%rsp), %ebx                                  #914.29
-        movl      %ecx, 4(%rsp)                                 #913.9
-        movw      %bp, 18(%rsp)                                 #916.9
-        movl      16(%rsp), %esi                                #917.26
-        movl      16(%rsp), %r8d                                #918.26
-        movl      %esi, 20(%rsp)                                #917.9
-        movl      %ecx, %ecx                                    #913.9
-        shlq      $32, %rcx                                     #914.29
-        movl      %esi, %esi                                    #917.9
-        shlq      $32, %rsi                                     #918.26
-        orq       %rbx, %rcx                                    #914.29
-        movq      %rcx, 8(%rsp)                                 #914.9
-        orq       %r8, %rsi                                     #918.26
-        movq      %rsi, 24(%rsp)                                #918.9
-        jmp       ..B17.41      # Prob 100%                     #918.9
-                                # LOE rdx r14 r15
-..B17.36:                       # Preds ..B17.34
-        cmpq      $14, %r12                                     #922.22
-        jae       ..B17.38      # Prob 50%                      #922.22
-                                # LOE rdx r12 r14 r15
-..B17.37:                       # Preds ..B17.36
-        movl      (%rsp), %eax                                  #924.29
-        movl      (%rsp), %ecx                                  #925.29
-        movl      16(%rsp), %ebx                                #927.26
-        movl      16(%rsp), %ebp                                #928.26
-        movl      %eax, 4(%rsp)                                 #924.9
-        movl      $4, (%rdx)                                    #930.9
-        movl      %eax, %eax                                    #924.9
-        shlq      $32, %rax                                     #925.29
-        movl      %ebx, 20(%rsp)                                #927.9
-        movl      %ebx, %ebx                                    #927.9
-        shlq      $32, %rbx                                     #928.26
-        orq       %rcx, %rax                                    #925.29
-        movq      %rax, 8(%rsp)                                 #925.9
-        orq       %rbp, %rbx                                    #928.26
-        movq      %rbx, 24(%rsp)                                #928.9
-        jmp       ..B17.41      # Prob 100%                     #928.9
-                                # LOE rdx r14 r15
-..B17.38:                       # Preds ..B17.36
-        cmpq      $30, %r12                                     #932.22
-        jae       ..B17.40      # Prob 50%                      #932.22
-                                # LOE rdx r14 r15
-..B17.39:                       # Preds ..B17.38
-        movq      (%rsp), %rax                                  #934.29
-        movq      16(%rsp), %rcx                                #935.26
-        movl      $0, (%rdx)                                    #937.9
-        movq      %rax, 8(%rsp)                                 #934.9
-        movq      %rcx, 24(%rsp)                                #935.9
-        jmp       ..B17.41      # Prob 100%                     #935.9
-                                # LOE rdx r14 r15
-..B17.40:                       # Preds ..B17.38
-        movl      $5, (%rdx)                                    #941.9
-                                # LOE rdx r14 r15
-..B17.41:                       # Preds ..B17.31 ..B17.33 ..B17.35 ..B17.37 ..B17.39
-                                #       ..B17.40
-        movq      (%rsp), %rcx                                  #944.42
-        lea       (%rsp), %rdi                                  #948.5
-        movq      %rcx, 16(%rdx)                                #944.42
-        movq      8(%rsp), %r8                                  #944.42
-        movq      %r8, 24(%rdx)                                 #944.42
-        movl      $2, %esi                                      #952.5
-        movq      16(%rsp), %r9                                 #945.39
-        movq      %r9, 32(%rdx)                                 #945.39
-        movq      24(%rsp), %r10                                #945.39
-        movq      %r10, 40(%rdx)                                #945.39
-        movq      (%rdi), %rax                                  #948.5
-        movq      8(%rdi), %rcx                                 #948.5
-        bswap     %rax                                          #948.5
-        bswap     %rcx                                          #948.5
-        movq      %rax, 8(%rdi)                                 #948.5
-        movq      %rcx, (%rdi)                                  #948.5
-        lea       16(%rsp), %rdi                                #949.5
-        movq      (%rdi), %rax                                  #949.5
-        movq      8(%rdi), %rcx                                 #949.5
-        bswap     %rax                                          #949.5
-        bswap     %rcx                                          #949.5
-        movq      %rax, 8(%rdi)                                 #949.5
-        movq      %rcx, (%rdi)                                  #949.5
-        lea       (%rsp), %rdi                                  #952.5
-        movl      %esi, %ecx                                    #952.5
-        movq      8(%rdi), %rax                                 #952.5
-        shrdq     %cl, %rax, (%rdi)                             #952.5
-        shrq      %cl, %rax                                     #952.5
-        movq      %rax, 8(%rdi)                                 #952.5
-        lea       16(%rsp), %rdi                                #953.5
-        movl      %esi, %ecx                                    #953.5
-        movq      8(%rdi), %rax                                 #953.5
-        shrdq     %cl, %rax, (%rdi)                             #953.5
-        shrq      %cl, %rax                                     #953.5
-        movq      %rax, 8(%rdi)                                 #953.5
-        lea       (%rsp), %rsi                                  #956.5
-        lea       48(%rdx), %rdi                                #956.5
-        movq      (%rsi), %rax                                  #956.5
-        movq      8(%rsi), %rcx                                 #956.5
-        bswap     %rax                                          #956.5
-        bswap     %rcx                                          #956.5
-        movq      %rax, 8(%rdi)                                 #956.5
-        movq      %rcx, (%rdi)                                  #956.5
-        lea       16(%rsp), %rsi                                #957.5
-        lea       64(%rdx), %rdi                                #957.5
-        movq      (%rsi), %rax                                  #957.5
-        movq      8(%rsi), %rcx                                 #957.5
-        bswap     %rax                                          #957.5
-        bswap     %rcx                                          #957.5
-        movq      %rax, 8(%rdi)                                 #957.5
-        movq      %rcx, (%rdi)                                  #957.5
-        lea       (%rsp), %rdi                                  #959.5
-        movl      $2, %esi                                      #959.5
-        movl      %esi, %ecx                                    #959.5
-        movq      8(%rdi), %rax                                 #959.5
-        shrdq     %cl, %rax, (%rdi)                             #959.5
-        shrq      %cl, %rax                                     #959.5
-        movq      %rax, 8(%rdi)                                 #959.5
-        lea       16(%rsp), %rdi                                #960.5
-        movl      %esi, %ecx                                    #960.5
-        movq      8(%rdi), %rax                                 #960.5
-        shrdq     %cl, %rax, (%rdi)                             #960.5
-        shrq      %cl, %rax                                     #960.5
-        movq      %rax, 8(%rdi)                                 #960.5
-        lea       (%rsp), %rsi                                  #962.5
-        lea       80(%rdx), %rdi                                #962.5
-        movq      (%rsi), %rax                                  #962.5
-        movq      8(%rsi), %rcx                                 #962.5
-        bswap     %rax                                          #962.5
-        bswap     %rcx                                          #962.5
-        movq      %rax, 8(%rdi)                                 #962.5
-        movq      %rcx, (%rdi)                                  #962.5
-        lea       16(%rsp), %rsi                                #963.5
-        lea       96(%rdx), %rdi                                #963.5
-        movq      (%rsi), %rax                                  #963.5
-        movq      8(%rsi), %rcx                                 #963.5
-        bswap     %rax                                          #963.5
-        bswap     %rcx                                          #963.5
-        movq      %rax, 8(%rdi)                                 #963.5
-        movq      %rcx, (%rdi)                                  #963.5
-        lea       (%rsp), %rdi                                  #965.5
-        movl      $2, %esi                                      #965.5
-        movl      %esi, %ecx                                    #965.5
-        movq      8(%rdi), %rax                                 #965.5
-        shrdq     %cl, %rax, (%rdi)                             #965.5
-        shrq      %cl, %rax                                     #965.5
-        movq      %rax, 8(%rdi)                                 #965.5
-        lea       16(%rsp), %rdi                                #966.5
-        movl      %esi, %ecx                                    #966.5
-        movq      8(%rdi), %rax                                 #966.5
-        shrdq     %cl, %rax, (%rdi)                             #966.5
-        shrq      %cl, %rax                                     #966.5
-        movq      %rax, 8(%rdi)                                 #966.5
-        lea       (%rsp), %rsi                                  #968.5
-        lea       112(%rdx), %rdi                               #968.5
-        addq      $128, %rdx                                    #969.5
-        movq      (%rsi), %rax                                  #968.5
-        movq      8(%rsi), %rcx                                 #968.5
-        bswap     %rax                                          #968.5
-        bswap     %rcx                                          #968.5
-        movq      %rax, 8(%rdi)                                 #968.5
-        movq      %rcx, (%rdi)                                  #968.5
-        lea       16(%rsp), %rsi                                #969.5
-        movq      %rdx, %rdi                                    #969.5
-        movq      (%rsi), %rax                                  #969.5
-        movq      8(%rsi), %rcx                                 #969.5
-        bswap     %rax                                          #969.5
-        bswap     %rcx                                          #969.5
-        movq      %rax, 8(%rdi)                                 #969.5
-        movq      %rcx, (%rdi)                                  #969.5
-        xorl      %eax, %eax                                    #1011.12
-        addq      $40, %rsp                                     #1011.12
-..___tag_value_NucStrFastaExprMake2.931:                        #
-        popq      %rbx                                          #1011.12
-..___tag_value_NucStrFastaExprMake2.933:                        #
-        popq      %rbp                                          #1011.12
-..___tag_value_NucStrFastaExprMake2.935:                        #
-        popq      %r12                                          #1011.12
-..___tag_value_NucStrFastaExprMake2.937:                        #
-        popq      %r13                                          #1011.12
-..___tag_value_NucStrFastaExprMake2.939:                        #
-        ret                                                     #1011.12
-..___tag_value_NucStrFastaExprMake2.940:                        #
-                                # LOE
-..B17.42:                       # Preds ..B17.18                # Infreq
-        xorl      %ecx, %ecx                                    #881.5
-        jmp       ..B17.26      # Prob 100%                     #881.5
-                                # LOE rdx rcx rbx rbp rsi r12 r14 r15 r13d
-..B17.43:                       # Preds ..B17.8                 # Infreq
-        movq      %rsi, %rax                                    #862.32
-        shrq      $2, %rax                                      #862.32
-        shll      $6, %ecx                                      #862.46
-        movb      %cl, (%rsp,%rax)                              #862.13
-        movb      $192, 16(%rsp,%rax)                           #863.13
-        jmp       ..B17.15      # Prob 100%                     #863.13
-                                # LOE rdx rbp rsi r12 r14 r15 r13d
-..B17.44:                       # Preds ..B17.4 ..B17.5         # Infreq
-        call      __errno_location at PLT                          #849.16
-                                # LOE rax r14 r15
-..B17.48:                       # Preds ..B17.44                # Infreq
-        movl      (%rax), %eax                                  #849.16
-        addq      $40, %rsp                                     #849.16
-..___tag_value_NucStrFastaExprMake2.945:                        #
-        popq      %rbx                                          #849.16
-..___tag_value_NucStrFastaExprMake2.947:                        #
-        popq      %rbp                                          #849.16
-..___tag_value_NucStrFastaExprMake2.949:                        #
-        popq      %r12                                          #849.16
-..___tag_value_NucStrFastaExprMake2.951:                        #
-        popq      %r13                                          #849.16
-..___tag_value_NucStrFastaExprMake2.953:                        #
-        ret                                                     #849.16
-        .align    16,0x90
-..___tag_value_NucStrFastaExprMake2.954:                        #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake2, at function
-	.size	NucStrFastaExprMake2,.-NucStrFastaExprMake2
-	.data
-# -- End  NucStrFastaExprMake2
-	.text
-# -- Begin  NucStrFastaExprMake4
-# mark_begin;
-       .align    16,0x90
-NucStrFastaExprMake4:
-# parameter 1: %rdi
-# parameter 2: %esi
-# parameter 3: %rdx
-# parameter 4: %rcx
-..B18.1:                        # Preds ..B18.0
-..___tag_value_NucStrFastaExprMake4.955:                        #1017.1
-        pushq     %r15                                          #1017.1
-..___tag_value_NucStrFastaExprMake4.957:                        #
-        pushq     %r14                                          #1017.1
-..___tag_value_NucStrFastaExprMake4.959:                        #
-        pushq     %r13                                          #1017.1
-..___tag_value_NucStrFastaExprMake4.961:                        #
-        pushq     %rbx                                          #1017.1
-..___tag_value_NucStrFastaExprMake4.963:                        #
-        subq      $40, %rsp                                     #1017.1
-..___tag_value_NucStrFastaExprMake4.965:                        #
-        movq      %rcx, %r14                                    #1017.1
-        movq      %rdx, %r13                                    #1017.1
-        movl      %esi, %r15d                                   #1017.1
-        movq      %rdi, %rbx                                    #1017.1
-        cmpq      $29, %r14                                     #1023.17
-        jbe       ..B18.3       # Prob 43%                      #1023.17
-                                # LOE rbx rbp r12 r13 r14 r15d
-..B18.2:                        # Preds ..B18.1
-        movl      $7, %eax                                      #1024.16
-        addq      $40, %rsp                                     #1024.16
-..___tag_value_NucStrFastaExprMake4.966:                        #
-        popq      %rbx                                          #1024.16
-..___tag_value_NucStrFastaExprMake4.968:                        #
-        popq      %r13                                          #1024.16
-..___tag_value_NucStrFastaExprMake4.970:                        #
-        popq      %r14                                          #1024.16
-..___tag_value_NucStrFastaExprMake4.972:                        #
-        popq      %r15                                          #1024.16
-..___tag_value_NucStrFastaExprMake4.974:                        #
-        ret                                                     #1024.16
-..___tag_value_NucStrFastaExprMake4.975:                        #
-                                # LOE
-..B18.3:                        # Preds ..B18.1
-        movl      $160, %edi                                    #1026.9
-        call      malloc at PLT                                    #1026.9
-                                # LOE rax rbx rbp r12 r13 r14 r15d
-..B18.4:                        # Preds ..B18.3
-        testq     %rax, %rax                                    #1026.9
-        je        ..B18.42      # Prob 12%                      #1026.9
-                                # LOE rax rbx rbp r12 r13 r14 r15d
-..B18.5:                        # Preds ..B18.4
-        lea       15(%rax), %rdx                                #1026.9
-        andq      $-16, %rdx                                    #1026.9
-        movq      %rax, 8(%rdx)                                 #1026.9
-        je        ..B18.42      # Prob 5%                       #1027.15
-                                # LOE rdx rbx rbp r12 r13 r14 r15d
-..B18.6:                        # Preds ..B18.5
-        movq      %rdx, (%rbx)                                  #1030.5
-        movl      %r14d, 4(%rdx)                                #1031.5
-        xorl      %r8d, %r8d                                    #1035.11
-        testq     %r14, %r14                                    #1035.22
-        jbe       ..B18.17      # Prob 16%                      #1035.22
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.8:                        # Preds ..B18.6 ..B18.15
-        movsbq    (%r8,%r13), %rcx                              #1037.49
-        lea       fasta_4na_map.0(%rip), %rax                   #1037.25
-        movsbl    (%rax,%rcx), %ebx                             #1037.25
-        movq      %r8, %rax                                     #1038.22
-        andq      $3, %rax                                      #1038.22
-        je        ..B18.41      # Prob 20%                      #1038.22
-                                # LOE rax rdx rbp r8 r12 r13 r14 ebx r15d
-..B18.9:                        # Preds ..B18.8
-        cmpq      $1, %rax                                      #1038.22
-        je        ..B18.14      # Prob 25%                      #1038.22
-                                # LOE rax rdx rbp r8 r12 r13 r14 ebx r15d
-..B18.10:                       # Preds ..B18.9
-        cmpq      $2, %rax                                      #1038.22
-        jne       ..B18.12      # Prob 67%                      #1038.22
-                                # LOE rax rdx rbp r8 r12 r13 r14 ebx r15d
-..B18.11:                       # Preds ..B18.10
-        movq      %r8, %rcx                                     #1049.32
-        shrq      $2, %rcx                                      #1049.32
-        movzwl    16(%rsp,%rcx,2), %eax                         #1050.13
-        shll      $12, %ebx                                     #1049.47
-        orl       $-4096, %eax                                  #1050.13
-        orw       %bx, (%rsp,%rcx,2)                            #1049.13
-        movw      %ax, 16(%rsp,%rcx,2)                          #1050.13
-        jmp       ..B18.15      # Prob 100%                     #1050.13
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.12:                       # Preds ..B18.10
-        cmpq      $3, %rax                                      #1038.22
-        jne       ..B18.15      # Prob 50%                      #1038.22
-                                # LOE rdx rbp r8 r12 r13 r14 ebx r15d
-..B18.13:                       # Preds ..B18.12
-        movq      %r8, %rcx                                     #1053.32
-        shrq      $2, %rcx                                      #1053.32
-        movzwl    16(%rsp,%rcx,2), %eax                         #1054.13
-        shll      $8, %ebx                                      #1053.47
-        orl       $-61696, %eax                                 #1054.13
-        orw       %bx, (%rsp,%rcx,2)                            #1053.13
-        movw      %ax, 16(%rsp,%rcx,2)                          #1054.13
-        jmp       ..B18.15      # Prob 100%                     #1054.13
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.14:                       # Preds ..B18.9
-        movq      %r8, %rcx                                     #1045.32
-        shrq      $2, %rcx                                      #1045.32
-        movzwl    16(%rsp,%rcx,2), %eax                         #1046.13
-        orl       $15, %eax                                     #1046.13
-        orw       %bx, (%rsp,%rcx,2)                            #1045.13
-        movw      %ax, 16(%rsp,%rcx,2)                          #1046.13
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.15:                       # Preds ..B18.12 ..B18.41 ..B18.14 ..B18.11 ..B18.13
-                                #      
-        incq      %r8                                           #1035.31
-        cmpq      %r14, %r8                                     #1035.22
-        jb        ..B18.8       # Prob 82%                      #1035.22
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.17:                       # Preds ..B18.15 ..B18.6
-        addq      $3, %r8                                       #1060.21
-        shrq      $2, %r8                                       #1060.28
-        cmpq      $8, %r8                                       #1060.35
-        jae       ..B18.30      # Prob 50%                      #1060.35
-                                # LOE rdx rbp r8 r12 r14 r15d
-..B18.18:                       # Preds ..B18.17
-        lea       (%rsp,%r8,2), %rbx                            #1060.5
-        movq      %r8, %rsi                                     #1060.5
-        negq      %rsi                                          #1060.5
-        addq      $8, %rsi                                      #1060.5
-        movq      %rbx, %rax                                    #1060.5
-        andq      $15, %rax                                     #1060.5
-        movq      %rax, %rcx                                    #1060.5
-        negq      %rcx                                          #1060.5
-        addq      $16, %rcx                                     #1060.5
-        shrq      $1, %rcx                                      #1060.5
-        cmpq      $0, %rax                                      #1060.5
-        cmovne    %rcx, %rax                                    #1060.5
-        lea       8(%rax), %r9                                  #1060.5
-        cmpq      %r9, %rsi                                     #1060.5
-        jl        ..B18.40      # Prob 10%                      #1060.5
-                                # LOE rax rdx rbx rbp rsi r8 r12 r14 r15d
-..B18.19:                       # Preds ..B18.18
-        movq      %rsi, %rcx                                    #1060.5
-        subq      %rax, %rcx                                    #1060.5
-        andq      $7, %rcx                                      #1060.5
-        negq      %rcx                                          #1060.5
-        addq      %rsi, %rcx                                    #1060.5
-        xorl      %r10d, %r10d                                  #1060.5
-        testq     %rax, %rax                                    #1060.5
-        jbe       ..B18.23      # Prob 10%                      #1060.5
-                                # LOE rax rdx rcx rbx rbp rsi r8 r10 r12 r14 r15d
-..B18.20:                       # Preds ..B18.19
-        lea       16(%rsp,%r8,2), %r9                           #
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r10 r12 r14 r15d
-..B18.21:                       # Preds ..B18.21 ..B18.20
-        xorl      %r11d, %r11d                                  #1062.9
-        movw      %r11w, (%rbx,%r10,2)                          #1062.9
-        movw      %r11w, (%r9,%r10,2)                           #1063.9
-        incq      %r10                                          #1060.5
-        cmpq      %rax, %r10                                    #1060.5
-        jb        ..B18.21      # Prob 82%                      #1060.5
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r10 r12 r14 r15d
-..B18.23:                       # Preds ..B18.21 ..B18.19
-        lea       16(%rsp,%r8,2), %r10                          #
-        lea       (%rsp,%r8,2), %r9                             #
-        pxor      %xmm0, %xmm0                                  #1062.29
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r10 r12 r14 r15d xmm0
-..B18.24:                       # Preds ..B18.24 ..B18.23
-        movdqa    %xmm0, (%r9,%rax,2)                           #1062.9
-        movdqa    %xmm0, (%r10,%rax,2)                          #1063.9
-        addq      $8, %rax                                      #1060.5
-        cmpq      %rcx, %rax                                    #1060.5
-        jb        ..B18.24      # Prob 82%                      #1060.5
-                                # LOE rax rdx rcx rbx rbp rsi r8 r9 r10 r12 r14 r15d xmm0
-..B18.26:                       # Preds ..B18.24 ..B18.40
-        cmpq      %rsi, %rcx                                    #1060.5
-        jae       ..B18.30      # Prob 10%                      #1060.5
-                                # LOE rdx rcx rbx rbp rsi r8 r12 r14 r15d
-..B18.27:                       # Preds ..B18.26
-        lea       16(%rsp,%r8,2), %rax                          #
-                                # LOE rax rdx rcx rbx rbp rsi r12 r14 r15d
-..B18.28:                       # Preds ..B18.28 ..B18.27
-        xorl      %r8d, %r8d                                    #1062.9
-        movw      %r8w, (%rbx,%rcx,2)                           #1062.9
-        movw      %r8w, (%rax,%rcx,2)                           #1063.9
-        incq      %rcx                                          #1060.5
-        cmpq      %rsi, %rcx                                    #1060.5
-        jb        ..B18.28      # Prob 82%                      #1060.5
-                                # LOE rax rdx rcx rbx rbp rsi r12 r14 r15d
-..B18.30:                       # Preds ..B18.28 ..B18.26 ..B18.17
-        testl     %r15d, %r15d                                  #1068.10
-        je        ..B18.32      # Prob 50%                      #1068.10
-                                # LOE rdx rbp r12 r14
-..B18.31:                       # Preds ..B18.30
-        movl      $10, (%rdx)                                   #1070.9
-        jmp       ..B18.39      # Prob 100%                     #1070.9
-                                # LOE rdx rbp r12
-..B18.32:                       # Preds ..B18.30
-        cmpq      $2, %r14                                      #1072.22
-        jae       ..B18.34      # Prob 50%                      #1072.22
-                                # LOE rdx rbp r12 r14
-..B18.33:                       # Preds ..B18.32
-        movzwl    (%rsp), %eax                                  #1074.29
-        movzwl    16(%rsp), %esi                                #1078.26
-        movl      $6, (%rdx)                                    #1082.9
-        movw      %ax, 2(%rsp)                                  #1074.9
-        movl      (%rsp), %ecx                                  #1075.29
-        movl      (%rsp), %ebx                                  #1076.29
-        movl      %ecx, 4(%rsp)                                 #1075.9
-        movw      %si, 18(%rsp)                                 #1078.9
-        movl      16(%rsp), %r8d                                #1079.26
-        movl      16(%rsp), %r9d                                #1080.26
-        movl      %r8d, 20(%rsp)                                #1079.9
-        movl      %ecx, %ecx                                    #1075.9
-        shlq      $32, %rcx                                     #1076.29
-        movl      %r8d, %r8d                                    #1079.9
-        shlq      $32, %r8                                      #1080.26
-        orq       %rbx, %rcx                                    #1076.29
-        movq      %rcx, 8(%rsp)                                 #1076.9
-        orq       %r9, %r8                                      #1080.26
-        movq      %r8, 24(%rsp)                                 #1080.9
-        jmp       ..B18.39      # Prob 100%                     #1080.9
-                                # LOE rdx rbp r12
-..B18.34:                       # Preds ..B18.32
-        cmpq      $6, %r14                                      #1084.22
-        jae       ..B18.36      # Prob 50%                      #1084.22
-                                # LOE rdx rbp r12 r14
-..B18.35:                       # Preds ..B18.34
-        movl      (%rsp), %eax                                  #1086.29
-        movl      (%rsp), %ecx                                  #1087.29
-        movl      16(%rsp), %ebx                                #1089.26
-        movl      16(%rsp), %esi                                #1090.26
-        movl      %eax, 4(%rsp)                                 #1086.9
-        movl      $7, (%rdx)                                    #1092.9
-        movl      %eax, %eax                                    #1086.9
-        shlq      $32, %rax                                     #1087.29
-        movl      %ebx, 20(%rsp)                                #1089.9
-        movl      %ebx, %ebx                                    #1089.9
-        shlq      $32, %rbx                                     #1090.26
-        orq       %rcx, %rax                                    #1087.29
-        movq      %rax, 8(%rsp)                                 #1087.9
-        orq       %rsi, %rbx                                    #1090.26
-        movq      %rbx, 24(%rsp)                                #1090.9
-        jmp       ..B18.39      # Prob 100%                     #1090.9
-                                # LOE rdx rbp r12
-..B18.36:                       # Preds ..B18.34
-        cmpq      $14, %r14                                     #1094.22
-        jae       ..B18.38      # Prob 50%                      #1094.22
-                                # LOE rdx rbp r12
-..B18.37:                       # Preds ..B18.36
-        movq      (%rsp), %rax                                  #1096.29
-        movq      16(%rsp), %rcx                                #1097.26
-        movl      $1, (%rdx)                                    #1099.9
-        movq      %rax, 8(%rsp)                                 #1096.9
-        movq      %rcx, 24(%rsp)                                #1097.9
-        jmp       ..B18.39      # Prob 100%                     #1097.9
-                                # LOE rdx rbp r12
-..B18.38:                       # Preds ..B18.36
-        movl      $8, (%rdx)                                    #1103.9
-                                # LOE rdx rbp r12
-..B18.39:                       # Preds ..B18.31 ..B18.33 ..B18.35 ..B18.37 ..B18.38
-                                #      
-        movq      (%rsp), %rcx                                  #1106.42
-        lea       (%rsp), %rdi                                  #1110.5
-        movq      %rcx, 16(%rdx)                                #1106.42
-        movq      8(%rsp), %r8                                  #1106.42
-        movq      %r8, 24(%rdx)                                 #1106.42
-        movl      $4, %esi                                      #1114.5
-        movq      16(%rsp), %r9                                 #1107.39
-        movq      %r9, 32(%rdx)                                 #1107.39
-        movq      24(%rsp), %r10                                #1107.39
-        movq      %r10, 40(%rdx)                                #1107.39
-        movq      (%rdi), %rax                                  #1110.5
-        movq      8(%rdi), %rcx                                 #1110.5
-        bswap     %rax                                          #1110.5
-        bswap     %rcx                                          #1110.5
-        movq      %rax, 8(%rdi)                                 #1110.5
-        movq      %rcx, (%rdi)                                  #1110.5
-        lea       16(%rsp), %rdi                                #1111.5
-        movq      (%rdi), %rax                                  #1111.5
-        movq      8(%rdi), %rcx                                 #1111.5
-        bswap     %rax                                          #1111.5
-        bswap     %rcx                                          #1111.5
-        movq      %rax, 8(%rdi)                                 #1111.5
-        movq      %rcx, (%rdi)                                  #1111.5
-        lea       (%rsp), %rdi                                  #1114.5
-        movl      %esi, %ecx                                    #1114.5
-        movq      8(%rdi), %rax                                 #1114.5
-        shrdq     %cl, %rax, (%rdi)                             #1114.5
-        shrq      %cl, %rax                                     #1114.5
-        movq      %rax, 8(%rdi)                                 #1114.5
-        lea       16(%rsp), %rdi                                #1115.5
-        movl      %esi, %ecx                                    #1115.5
-        movq      8(%rdi), %rax                                 #1115.5
-        shrdq     %cl, %rax, (%rdi)                             #1115.5
-        shrq      %cl, %rax                                     #1115.5
-        movq      %rax, 8(%rdi)                                 #1115.5
-        lea       (%rsp), %rsi                                  #1118.5
-        lea       48(%rdx), %rdi                                #1118.5
-        movq      (%rsi), %rax                                  #1118.5
-        movq      8(%rsi), %rcx                                 #1118.5
-        bswap     %rax                                          #1118.5
-        bswap     %rcx                                          #1118.5
-        movq      %rax, 8(%rdi)                                 #1118.5
-        movq      %rcx, (%rdi)                                  #1118.5
-        lea       16(%rsp), %rsi                                #1119.5
-        lea       64(%rdx), %rdi                                #1119.5
-        movq      (%rsi), %rax                                  #1119.5
-        movq      8(%rsi), %rcx                                 #1119.5
-        bswap     %rax                                          #1119.5
-        bswap     %rcx                                          #1119.5
-        movq      %rax, 8(%rdi)                                 #1119.5
-        movq      %rcx, (%rdi)                                  #1119.5
-        lea       (%rsp), %rdi                                  #1121.5
-        movl      $4, %esi                                      #1121.5
-        movl      %esi, %ecx                                    #1121.5
-        movq      8(%rdi), %rax                                 #1121.5
-        shrdq     %cl, %rax, (%rdi)                             #1121.5
-        shrq      %cl, %rax                                     #1121.5
-        movq      %rax, 8(%rdi)                                 #1121.5
-        lea       16(%rsp), %rdi                                #1122.5
-        movl      %esi, %ecx                                    #1122.5
-        movq      8(%rdi), %rax                                 #1122.5
-        shrdq     %cl, %rax, (%rdi)                             #1122.5
-        shrq      %cl, %rax                                     #1122.5
-        movq      %rax, 8(%rdi)                                 #1122.5
-        lea       (%rsp), %rsi                                  #1124.5
-        lea       80(%rdx), %rdi                                #1124.5
-        movq      (%rsi), %rax                                  #1124.5
-        movq      8(%rsi), %rcx                                 #1124.5
-        bswap     %rax                                          #1124.5
-        bswap     %rcx                                          #1124.5
-        movq      %rax, 8(%rdi)                                 #1124.5
-        movq      %rcx, (%rdi)                                  #1124.5
-        lea       16(%rsp), %rsi                                #1125.5
-        lea       96(%rdx), %rdi                                #1125.5
-        movq      (%rsi), %rax                                  #1125.5
-        movq      8(%rsi), %rcx                                 #1125.5
-        bswap     %rax                                          #1125.5
-        bswap     %rcx                                          #1125.5
-        movq      %rax, 8(%rdi)                                 #1125.5
-        movq      %rcx, (%rdi)                                  #1125.5
-        lea       (%rsp), %rdi                                  #1127.5
-        movl      $4, %esi                                      #1127.5
-        movl      %esi, %ecx                                    #1127.5
-        movq      8(%rdi), %rax                                 #1127.5
-        shrdq     %cl, %rax, (%rdi)                             #1127.5
-        shrq      %cl, %rax                                     #1127.5
-        movq      %rax, 8(%rdi)                                 #1127.5
-        lea       16(%rsp), %rdi                                #1128.5
-        movl      %esi, %ecx                                    #1128.5
-        movq      8(%rdi), %rax                                 #1128.5
-        shrdq     %cl, %rax, (%rdi)                             #1128.5
-        shrq      %cl, %rax                                     #1128.5
-        movq      %rax, 8(%rdi)                                 #1128.5
-        lea       (%rsp), %rsi                                  #1130.5
-        lea       112(%rdx), %rdi                               #1130.5
-        addq      $128, %rdx                                    #1131.5
-        movq      (%rsi), %rax                                  #1130.5
-        movq      8(%rsi), %rcx                                 #1130.5
-        bswap     %rax                                          #1130.5
-        bswap     %rcx                                          #1130.5
-        movq      %rax, 8(%rdi)                                 #1130.5
-        movq      %rcx, (%rdi)                                  #1130.5
-        lea       16(%rsp), %rsi                                #1131.5
-        movq      %rdx, %rdi                                    #1131.5
-        movq      (%rsi), %rax                                  #1131.5
-        movq      8(%rsi), %rcx                                 #1131.5
-        bswap     %rax                                          #1131.5
-        bswap     %rcx                                          #1131.5
-        movq      %rax, 8(%rdi)                                 #1131.5
-        movq      %rcx, (%rdi)                                  #1131.5
-        xorl      %eax, %eax                                    #1173.12
-        addq      $40, %rsp                                     #1173.12
-..___tag_value_NucStrFastaExprMake4.980:                        #
-        popq      %rbx                                          #1173.12
-..___tag_value_NucStrFastaExprMake4.982:                        #
-        popq      %r13                                          #1173.12
-..___tag_value_NucStrFastaExprMake4.984:                        #
-        popq      %r14                                          #1173.12
-..___tag_value_NucStrFastaExprMake4.986:                        #
-        popq      %r15                                          #1173.12
-..___tag_value_NucStrFastaExprMake4.988:                        #
-        ret                                                     #1173.12
-..___tag_value_NucStrFastaExprMake4.989:                        #
-                                # LOE
-..B18.40:                       # Preds ..B18.18                # Infreq
-        xorl      %ecx, %ecx                                    #1060.5
-        jmp       ..B18.26      # Prob 100%                     #1060.5
-                                # LOE rdx rcx rbx rbp rsi r8 r12 r14 r15d
-..B18.41:                       # Preds ..B18.8                 # Infreq
-        movq      %r8, %rax                                     #1041.32
-        shrq      $2, %rax                                      #1041.32
-        shll      $4, %ebx                                      #1041.46
-        movw      %bx, (%rsp,%rax,2)                            #1041.13
-        movl      $240, %ebx                                    #1042.13
-        movw      %bx, 16(%rsp,%rax,2)                          #1042.13
-        jmp       ..B18.15      # Prob 100%                     #1042.13
-                                # LOE rdx rbp r8 r12 r13 r14 r15d
-..B18.42:                       # Preds ..B18.4 ..B18.5         # Infreq
-        call      __errno_location at PLT                          #1028.16
-                                # LOE rax rbp r12
-..B18.46:                       # Preds ..B18.42                # Infreq
-        movl      (%rax), %eax                                  #1028.16
-        addq      $40, %rsp                                     #1028.16
-..___tag_value_NucStrFastaExprMake4.994:                        #
-        popq      %rbx                                          #1028.16
-..___tag_value_NucStrFastaExprMake4.996:                        #
-        popq      %r13                                          #1028.16
-..___tag_value_NucStrFastaExprMake4.998:                        #
-        popq      %r14                                          #1028.16
-..___tag_value_NucStrFastaExprMake4.1000:                       #
-        popq      %r15                                          #1028.16
-..___tag_value_NucStrFastaExprMake4.1002:                       #
-        ret                                                     #1028.16
-        .align    16,0x90
-..___tag_value_NucStrFastaExprMake4.1003:                       #
-                                # LOE
-# mark_end;
-	.type	NucStrFastaExprMake4, at function
-	.size	NucStrFastaExprMake4,.-NucStrFastaExprMake4
-	.data
-# -- End  NucStrFastaExprMake4
-	.text
-# -- Begin  nss_expr
-# mark_begin;
-       .align    16,0x90
-nss_expr:
-# parameter 1: %rdi
-# parameter 2: %rsi
-# parameter 3: %rdx
-# parameter 4: %rcx
-# parameter 5: %r8d
-..B19.1:                        # Preds ..B19.0
-..___tag_value_nss_expr.1004:                                   #1406.1
-        pushq     %r15                                          #1406.1
-..___tag_value_nss_expr.1006:                                   #
-        pushq     %r14                                          #1406.1
-..___tag_value_nss_expr.1008:                                   #
-        pushq     %r13                                          #1406.1
-..___tag_value_nss_expr.1010:                                   #
-        pushq     %r12                                          #1406.1
-..___tag_value_nss_expr.1012:                                   #
-        pushq     %rbp                                          #1406.1
-..___tag_value_nss_expr.1014:                                   #
-        pushq     %rbx                                          #1406.1
-..___tag_value_nss_expr.1016:                                   #
-        subq      $24, %rsp                                     #1406.1
-..___tag_value_nss_expr.1018:                                   #
-        movl      %r8d, (%rsp)                                  #1406.1
-        movq      %rcx, %rbx                                    #1406.1
-        movq      %rdx, %r14                                    #1406.1
-        movq      %rsi, %r15                                    #1406.1
-        movq      %rdi, %r12                                    #1406.1
-        call      __errno_location at PLT                          #1454.32
-                                # LOE rax rbx r12 r13 r14 r15
-..B19.95:                       # Preds ..B19.1
-        movq      %rax, %rbp                                    #1454.32
-        call      __ctype_b_loc at PLT                             #1409.9
-                                # LOE rax rbx rbp r12 r13 r14 r15
-..B19.96:                       # Preds ..B19.95
-        movq      %rbp, 8(%rsp)                                 #1409.9
-        movq      %r14, %r13                                    #1409.9
-        movq      %rax, %r14                                    #1409.9
-        jmp       ..B19.2       # Prob 100%                     #1409.9
-                                # LOE rbx r12 r13 r14 r15
-..B19.74:                       # Preds ..B19.73
-        movl      $11, (%rax)                                   #1458.17
-        movl      %ebp, 4(%rax)                                 #1459.17
-        movq      (%r13), %rdx                                  #1460.41
-        movq      %rdx, 8(%rax)                                 #1460.17
-        movq      %rax, (%r13)                                  #1461.17
-        lea       16(%rax), %r13                                #1464.42
-                                # LOE rbx r12 r13 r14 r15
-..B19.2:                        # Preds ..B19.74 ..B19.96
-        movq      $0, (%r13)                                    #1407.5
-        movq      %r12, %rbp                                    #1407.5
-        xorl      %esi, %esi                                    #1409.9
-        cmpq      %r15, %r12                                    #1409.9
-        jae       ..B19.7       # Prob 2%                       #1409.9
-                                # LOE rbx rbp rsi r12 r13 r14 r15
-..B19.3:                        # Preds ..B19.2
-        movq      (%r14), %rcx                                  #1409.9
-        movq      %r15, %rdx                                    #1406.1
-        subq      %r12, %rdx                                    #1406.1
-                                # LOE rdx rcx rbx rbp rsi r12 r13 r14 r15
-..B19.4:                        # Preds ..B19.5 ..B19.3
-        movzbl    (%rsi,%r12), %edi                             #1409.9
-        movzwl    (%rcx,%rdi,2), %r8d                           #1409.9
-        testl     $8192, %r8d                                   #1409.9
-        je        ..B19.7       # Prob 20%                      #1409.9
-                                # LOE rdx rcx rbx rbp rsi r12 r13 r14 r15
-..B19.5:                        # Preds ..B19.4
-        lea       1(%rsi,%r12), %rbp                            #1409.9
-        incq      %rsi                                          #1409.9
-        cmpq      %rdx, %rsi                                    #1409.9
-        jb        ..B19.4       # Prob 82%                      #1409.9
-                                # LOE rdx rcx rbx rbp rsi r12 r13 r14 r15
-..B19.7:                        # Preds ..B19.4 ..B19.5 ..B19.2
-        cmpq      %r15, %rbp                                    #1410.15
-        je        ..B19.78      # Prob 16%                      #1410.15
-                                # LOE rbx rbp r13 r14 r15
-..B19.8:                        # Preds ..B19.7
-        movsbl    (%rbp), %edx                                  #1412.13
-        cmpl      $33, %edx                                     #1412.13
-        je        ..B19.44      # Prob 33%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.9:                        # Preds ..B19.8
-        cmpl      $94, %edx                                     #1412.13
-        jne       ..B19.21      # Prob 67%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.10:                       # Preds ..B19.9
-        movl      $16, %edi                                     #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE rax rbx rbp r13 r14 r15
-..B19.11:                       # Preds ..B19.10
-        testq     %rax, %rax                                    #1412.13
-        jne       ..B19.13      # Prob 68%                      #1412.13
-                                # LOE rax rbx rbp r13 r14 r15
-..B19.12:                       # Preds ..B19.82 ..B19.11
-        movq      8(%rsp), %rdx                                 #1412.13
-        movl      (%rdx), %edx                                  #1412.13
-        movl      %edx, (%rbx)                                  #1412.13
-        jmp       ..B19.43      # Prob 100%                     #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.13:                       # Preds ..B19.11
-        movl      $12, (%rax)                                   #1412.13
-        incq      %rbp                                          #1412.13
-        movq      %rbp, %r8                                     #1412.13
-        xorl      %edi, %edi                                    #1412.13
-        movl      $14, 4(%rax)                                  #1412.13
-        cmpq      %r15, %r8                                     #1412.13
-        movq      $0, 8(%rax)                                   #1412.13
-        movq      %rax, (%r13)                                  #1412.13
-        jae       ..B19.18      # Prob 2%                       #1412.13
-                                # LOE rax rbx rbp rdi r8 r13 r14 r15
-..B19.14:                       # Preds ..B19.13
-        movq      (%r14), %rsi                                  #1412.13
-        movq      %r15, %rcx                                    #1406.1
-        subq      %rbp, %rcx                                    #1406.1
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14 r15
-..B19.15:                       # Preds ..B19.16 ..B19.14
-        movzbl    (%rdi,%r8), %r9d                              #1412.13
-        movzwl    (%rsi,%r9,2), %r10d                           #1412.13
-        testl     $8192, %r10d                                  #1412.13
-        je        ..B19.18      # Prob 20%                      #1412.13
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14 r15
-..B19.16:                       # Preds ..B19.15
-        lea       1(%rdi,%r8), %rbp                             #1412.13
-        incq      %rdi                                          #1412.13
-        cmpq      %rcx, %rdi                                    #1412.13
-        jb        ..B19.15      # Prob 1%                       #1412.13
-                                # LOE rax rcx rbx rbp rsi rdi r8 r13 r14 r15
-..B19.18:                       # Preds ..B19.15 ..B19.16 ..B19.13
-        movl      (%rsp), %r8d                                  #1412.13
-        addq      $8, %rax                                      #1412.13
-        movq      %rbp, %rdi                                    #1412.13
-        movq      %r15, %rsi                                    #1412.13
-        movq      %rax, %rdx                                    #1412.13
-        movq      %rbx, %rcx                                    #1412.13
-        call      nss_fasta_expr at PLT                            #1412.13
-                                # LOE rax rbx r13 r14 r15
-..B19.98:                       # Preds ..B19.18
-        movq      %rax, %rbp                                    #1412.13
-                                # LOE rbx rbp r13 r14 r15
-..B19.19:                       # Preds ..B19.98
-        movl      (%rbx), %edx                                  #1413.16
-        jmp       ..B19.43      # Prob 100%                     #1413.16
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.21:                       # Preds ..B19.9
-        cmpl      $40, %edx                                     #1412.13
-        jne       ..B19.33      # Prob 50%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15
-..B19.22:                       # Preds ..B19.21
-        movl      $16, %edi                                     #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE rax rbx rbp r13 r14 r15
-..B19.99:                       # Preds ..B19.22
-        movq      %rax, %r12                                    #1412.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.23:                       # Preds ..B19.99
-        testq     %r12, %r12                                    #1412.13
-        jne       ..B19.25      # Prob 68%                      #1412.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.24:                       # Preds ..B19.23
-        movq      8(%rsp), %rdx                                 #1412.13
-        movl      (%rdx), %edx                                  #1412.13
-        movl      %edx, (%rbx)                                  #1412.13
-        jmp       ..B19.43      # Prob 100%                     #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.25:                       # Preds ..B19.23
-        movl      (%rsp), %r8d                                  #1412.13
-        movl      $12, (%r12)                                   #1412.13
-        incq      %rbp                                          #1412.13
-        lea       8(%r12), %rdx                                 #1412.13
-        movl      $0, 4(%r12)                                   #1412.13
-        movq      %r12, (%r13)                                  #1412.13
-        movq      %rbp, %rdi                                    #1412.13
-        movq      %r15, %rsi                                    #1412.13
-        movq      %rbx, %rcx                                    #1412.13
-        call      nss_expr at PLT                                  #1412.13
-                                # LOE rax rbx r12 r13 r14 r15
-..B19.100:                      # Preds ..B19.25
-        movq      %rax, %rbp                                    #1412.13
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.26:                       # Preds ..B19.100
-        movl      (%rbx), %edx                                  #1412.13
-        testl     %edx, %edx                                    #1412.13
-        jne       ..B19.43      # Prob 50%                      #1412.13
-                                # LOE rbx rbp r12 r13 r14 r15 edx
-..B19.27:                       # Preds ..B19.26
-        movq      8(%r12), %rcx                                 #1412.13
-        testq     %rcx, %rcx                                    #1412.13
-        je        ..B19.31      # Prob 12%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.28:                       # Preds ..B19.27
-        cmpq      %r15, %rbp                                    #1412.13
-        je        ..B19.31      # Prob 12%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.29:                       # Preds ..B19.28
-        movsbl    (%rbp), %ecx                                  #1412.13
-        cmpl      $41, %ecx                                     #1412.13
-        je        ..B19.80      # Prob 16%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.30:                       # Preds ..B19.29
-        incq      %rbp                                          #1412.13
-                                # LOE rbx rbp r13 r14 r15
-..B19.31:                       # Preds ..B19.30 ..B19.28 ..B19.27
-        movl      $22, (%rbx)                                   #1412.13
-        movl      $22, %edx                                     #1412.13
-        jmp       ..B19.43      # Prob 100%                     #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.33:                       # Preds ..B19.21
-        movl      (%rsp), %r8d                                  #1412.13
-        movq      %rbp, %rdi                                    #1412.13
-        movq      %r15, %rsi                                    #1412.13
-        movq      %r13, %rdx                                    #1412.13
-        movq      %rbx, %rcx                                    #1412.13
-        call      nss_fasta_expr at PLT                            #1412.13
-                                # LOE rax rbx r13 r14 r15
-..B19.34:                       # Preds ..B19.33
-        movl      (%rbx), %edx                                  #1412.13
-        movq      %rax, %rbp                                    #1412.13
-        testl     %edx, %edx                                    #1412.13
-        jne       ..B19.43      # Prob 50%                      #1412.13
-                                # LOE rax rbx rbp r13 r14 r15 edx
-..B19.35:                       # Preds ..B19.34
-        cmpq      %r15, %rax                                    #1412.13
-        jae       ..B19.43      # Prob 33%                      #1412.13
-                                # LOE rax rbx rbp r13 r14 r15 edx
-..B19.36:                       # Preds ..B19.35
-        movq      (%r14), %rdi                                  #1412.13
-        movq      %rax, %rbp                                    #1412.13
-        xorl      %ecx, %ecx                                    #1412.13
-        movq      %r15, %rsi                                    #1406.1
-        subq      %rax, %rsi                                    #1406.1
-                                # LOE rax rcx rbx rbp rsi rdi r13 r14 r15 edx
-..B19.37:                       # Preds ..B19.36 ..B19.38
-        movzbl    (%rcx,%rax), %r8d                             #1412.13
-        movzwl    (%rdi,%r8,2), %r9d                            #1412.13
-        testl     $8192, %r9d                                   #1412.13
-        je        ..B19.40      # Prob 20%                      #1412.13
-                                # LOE rax rcx rbx rbp rsi rdi r13 r14 r15 edx
-..B19.38:                       # Preds ..B19.37
-        lea       1(%rcx,%rax), %rbp                            #1412.13
-        incq      %rcx                                          #1412.13
-        cmpq      %rsi, %rcx                                    #1412.13
-        jb        ..B19.37      # Prob 1%                       #1412.13
-                                # LOE rax rcx rbx rbp rsi rdi r13 r14 r15 edx
-..B19.40:                       # Preds ..B19.37 ..B19.38
-        cmpq      %r15, %rbp                                    #1412.13
-        jae       ..B19.43      # Prob 12%                      #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.41:                       # Preds ..B19.40
-        movsbl    (%rbp), %ecx                                  #1412.13
-        cmpl      $36, %ecx                                     #1412.13
-        je        ..B19.81      # Prob 5%                       #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.43:                       # Preds ..B19.34 ..B19.35 ..B19.40 ..B19.41 ..B19.83
-                                #       ..B19.26 ..B19.31 ..B19.24 ..B19.19 ..B19.12
-                                #       ..B19.80
-        movq      %rbp, %r12                                    #1412.13
-        jmp       ..B19.56      # Prob 100%                     #1412.13
-                                # LOE rbx r12 r13 r14 r15 edx
-..B19.44:                       # Preds ..B19.8
-        lea       1(%rbp), %r12                                 #1412.13
-        xorl      %ecx, %ecx                                    #1412.13
-        cmpq      %r15, %r12                                    #1412.13
-        jae       ..B19.49      # Prob 2%                       #1412.13
-                                # LOE rcx rbx rbp r12 r13 r14 r15
-..B19.45:                       # Preds ..B19.44
-        movq      (%r14), %rdx                                  #1412.13
-        movq      %r15, %rax                                    #1406.1
-        subq      %rbp, %rax                                    #1406.1
-        decq      %rax                                          #1406.1
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.46:                       # Preds ..B19.47 ..B19.45
-        movzbl    1(%rcx,%rbp), %esi                            #1412.13
-        movzwl    (%rdx,%rsi,2), %edi                           #1412.13
-        testl     $8192, %edi                                   #1412.13
-        je        ..B19.49      # Prob 20%                      #1412.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.47:                       # Preds ..B19.46
-        lea       2(%rcx,%rbp), %r12                            #1412.13
-        incq      %rcx                                          #1412.13
-        cmpq      %rax, %rcx                                    #1412.13
-        jb        ..B19.46      # Prob 1%                       #1412.13
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.49:                       # Preds ..B19.46 ..B19.47 ..B19.44
-        cmpq      %r15, %r12                                    #1412.13
-        jne       ..B19.51      # Prob 68%                      #1412.13
-                                # LOE rbx r12 r13 r14 r15
-..B19.50:                       # Preds ..B19.49
-        movl      $22, (%rbx)                                   #1412.13
-        movl      $22, %edx                                     #1412.13
-        jmp       ..B19.56      # Prob 100%                     #1412.13
-                                # LOE rbx r12 r13 r14 r15 edx
-..B19.51:                       # Preds ..B19.49
-        movl      $16, %edi                                     #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE rax rbx r12 r13 r14 r15
-..B19.52:                       # Preds ..B19.51
-        testq     %rax, %rax                                    #1412.13
-        je        ..B19.88      # Prob 1%                       #1412.13
-                                # LOE rax rbx r12 r13 r14 r15
-..B19.53:                       # Preds ..B19.52
-        movl      (%rsp), %r8d                                  #1412.13
-        movl      $12, (%rax)                                   #1412.13
-        movq      %r12, %rdi                                    #1412.13
-        movq      %r15, %rsi                                    #1412.13
-        movl      $13, 4(%rax)                                  #1412.13
-        movq      %rbx, %rcx                                    #1412.13
-        movq      $0, 8(%rax)                                   #1412.13
-        movq      %rax, (%r13)                                  #1412.13
-        addq      $8, %rax                                      #1412.13
-        movq      %rax, %rdx                                    #1412.13
-        call      nss_unary_expr at PLT                            #1412.13
-                                # LOE rax rbx r13 r14 r15
-..B19.103:                      # Preds ..B19.53
-        movq      %rax, %r12                                    #1412.13
-                                # LOE rbx r12 r13 r14 r15
-..B19.54:                       # Preds ..B19.103
-        movl      (%rbx), %edx                                  #1413.16
-                                # LOE rbx r12 r13 r14 r15 edx
-..B19.56:                       # Preds ..B19.54 ..B19.88 ..B19.50 ..B19.43
-        testl     %edx, %edx                                    #1413.26
-        jne       ..B19.77      # Prob 58%                      #1413.26
-                                # LOE rbx r12 r13 r14 r15
-..B19.57:                       # Preds ..B19.56
-        movq      %r12, %rbp                                    #1413.9
-        xorl      %ecx, %ecx                                    #1415.17
-        cmpq      %r15, %r12                                    #1415.17
-        jae       ..B19.62      # Prob 2%                       #1415.17
-                                # LOE rcx rbx rbp r12 r13 r14 r15
-..B19.58:                       # Preds ..B19.57
-        movq      (%r14), %rdx                                  #1415.17
-        movq      %r15, %rax                                    #1406.1
-        subq      %r12, %rax                                    #1406.1
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.59:                       # Preds ..B19.60 ..B19.58
-        movzbl    (%rcx,%r12), %esi                             #1415.17
-        movzwl    (%rdx,%rsi,2), %edi                           #1415.17
-        testl     $8192, %edi                                   #1415.17
-        je        ..B19.62      # Prob 20%                      #1415.17
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.60:                       # Preds ..B19.59
-        lea       1(%rcx,%r12), %rbp                            #1415.17
-        incq      %rcx                                          #1415.17
-        cmpq      %rax, %rcx                                    #1415.17
-        jb        ..B19.59      # Prob 17%                      #1415.17
-                                # LOE rax rdx rcx rbx rbp r12 r13 r14 r15
-..B19.62:                       # Preds ..B19.59 ..B19.60 ..B19.57
-        cmpq      %r15, %rbp                                    #1416.23
-        je        ..B19.78      # Prob 4%                       #1416.23
-                                # LOE rbx rbp r13 r14 r15
-..B19.63:                       # Preds ..B19.62
-        movsbl    (%rbp), %edx                                  #1422.28
-        lea       1(%rbp), %r12                                 #1422.28
-        cmpl      $41, %edx                                     #1422.28
-        je        ..B19.78      # Prob 25%                      #1422.28
-                                # LOE rbx rbp r12 r13 r14 r15 edx
-..B19.64:                       # Preds ..B19.63
-        cmpl      $38, %edx                                     #1422.28
-        jne       ..B19.68      # Prob 67%                      #1422.28
-                                # LOE rbx rbp r12 r13 r14 r15 edx
-..B19.65:                       # Preds ..B19.64
-        cmpq      %r15, %r12                                    #1427.30
-        jae       ..B19.67      # Prob 12%                      #1427.30
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.66:                       # Preds ..B19.65
-        movsbl    (%r12), %edx                                  #1427.39
-        addq      $2, %rbp                                      #1428.28
-        cmpl      $38, %edx                                     #1428.28
-        cmove     %rbp, %r12                                    #1428.28
-                                # LOE rbx r12 r13 r14 r15
-..B19.67:                       # Preds ..B19.66 ..B19.65
-        movl      $16, %ebp                                     #1429.21
-        jmp       ..B19.72      # Prob 100%                     #1429.21
-                                # LOE rbx r12 r13 r14 r15 ebp
-..B19.68:                       # Preds ..B19.64
-        cmpl      $124, %edx                                    #1422.28
-        jne       ..B19.75      # Prob 50%                      #1422.28
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.69:                       # Preds ..B19.68
-        cmpq      %r15, %r12                                    #1432.30
-        jae       ..B19.71      # Prob 12%                      #1432.30
-                                # LOE rbx rbp r12 r13 r14 r15
-..B19.70:                       # Preds ..B19.69
-        movsbl    (%r12), %edx                                  #1432.39
-        addq      $2, %rbp                                      #1433.28
-        cmpl      $124, %edx                                    #1433.28
-        cmove     %rbp, %r12                                    #1433.28
-                                # LOE rbx r12 r13 r14 r15
-..B19.71:                       # Preds ..B19.70 ..B19.69
-        movl      $17, %ebp                                     #1434.21
-                                # LOE rbx r12 r13 r14 r15 ebp
-..B19.72:                       # Preds ..B19.67 ..B19.71
-        movl      $24, %edi                                     #1451.21
-        call      malloc at PLT                                    #1451.21
-                                # LOE rax rbx r12 r13 r14 r15 ebp
-..B19.73:                       # Preds ..B19.72
-        testq     %rax, %rax                                    #1452.27
-        je        ..B19.92      # Prob 1%                       #1452.27
-        jmp       ..B19.74      # Prob 100%                     #1452.27
-                                # LOE rax rbx r12 r13 r14 r15 ebp
-..B19.75:                       # Preds ..B19.68
-        movl      $22, (%rbx)                                   #1438.21
-        movq      %rbp, %rax                                    #1439.32
-        addq      $24, %rsp                                     #1439.32
-..___tag_value_nss_expr.1019:                                   #
-        popq      %rbx                                          #1439.32
-..___tag_value_nss_expr.1021:                                   #
-        popq      %rbp                                          #1439.32
-..___tag_value_nss_expr.1023:                                   #
-        popq      %r12                                          #1439.32
-..___tag_value_nss_expr.1025:                                   #
-        popq      %r13                                          #1439.32
-..___tag_value_nss_expr.1027:                                   #
-        popq      %r14                                          #1439.32
-..___tag_value_nss_expr.1029:                                   #
-        popq      %r15                                          #1439.32
-..___tag_value_nss_expr.1031:                                   #
-        ret                                                     #1439.32
-..___tag_value_nss_expr.1032:                                   #
-                                # LOE
-..B19.77:                       # Preds ..B19.56
-        movq      %r12, %rbp                                    #1413.9
-                                # LOE rbp r13
-..B19.78:                       # Preds ..B19.63 ..B19.7 ..B19.62 ..B19.77
-        movq      %rbp, %rax                                    #1470.12
-        addq      $24, %rsp                                     #1470.12
-..___tag_value_nss_expr.1039:                                   #
-        popq      %rbx                                          #1470.12
-..___tag_value_nss_expr.1041:                                   #
-        popq      %rbp                                          #1470.12
-..___tag_value_nss_expr.1043:                                   #
-        popq      %r12                                          #1470.12
-..___tag_value_nss_expr.1045:                                   #
-        popq      %r13                                          #1470.12
-..___tag_value_nss_expr.1047:                                   #
-        popq      %r14                                          #1470.12
-..___tag_value_nss_expr.1049:                                   #
-        popq      %r15                                          #1470.12
-..___tag_value_nss_expr.1051:                                   #
-        ret                                                     #1470.12
-..___tag_value_nss_expr.1052:                                   #
-                                # LOE
-..B19.80:                       # Preds ..B19.29                # Infreq
-        incq      %rbp                                          #1412.13
-        jmp       ..B19.43      # Prob 100%                     #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.81:                       # Preds ..B19.41                # Infreq
-        incq      %rbp                                          #1412.13
-        movl      $16, %edi                                     #1412.13
-        call      malloc at PLT                                    #1412.13
-                                # LOE rax rbx rbp r13 r14 r15
-..B19.82:                       # Preds ..B19.81                # Infreq
-        testq     %rax, %rax                                    #1412.13
-        je        ..B19.12      # Prob 12%                      #1412.13
-                                # LOE rax rbx rbp r13 r14 r15
-..B19.83:                       # Preds ..B19.82                # Infreq
-        movl      $12, (%rax)                                   #1412.13
-        movl      $15, 4(%rax)                                  #1412.13
-        movq      (%r13), %rdx                                  #1412.13
-        movq      %rdx, 8(%rax)                                 #1412.13
-        movl      (%rbx), %edx                                  #1413.16
-        movq      %rax, (%r13)                                  #1412.13
-        jmp       ..B19.43      # Prob 100%                     #1412.13
-                                # LOE rbx rbp r13 r14 r15 edx
-..B19.88:                       # Preds ..B19.52                # Infreq
-        movq      8(%rsp), %rdx                                 #1412.13
-        movl      (%rdx), %edx                                  #1412.13
-        movl      %edx, (%rbx)                                  #1412.13
-        jmp       ..B19.56      # Prob 100%                     #1412.13
-                                # LOE rbx r12 r13 r14 r15 edx
-..B19.92:                       # Preds ..B19.73                # Infreq
-        movq      8(%rsp), %rbp                                 #
-        movl      (%rbp), %edx                                  #1454.32
-        movl      %edx, (%rbx)                                  #1454.21
-        movq      %r12, %rax                                    #1455.28
-        addq      $24, %rsp                                     #1455.28
-..___tag_value_nss_expr.1059:                                   #
-        popq      %rbx                                          #1455.28
-..___tag_value_nss_expr.1061:                                   #
-        popq      %rbp                                          #1455.28
-..___tag_value_nss_expr.1063:                                   #
-        popq      %r12                                          #1455.28
-..___tag_value_nss_expr.1065:                                   #
-        popq      %r13                                          #1455.28
-..___tag_value_nss_expr.1067:                                   #
-        popq      %r14                                          #1455.28
-..___tag_value_nss_expr.1069:                                   #
-        popq      %r15                                          #1455.28
-..___tag_value_nss_expr.1071:                                   #
-        ret                                                     #1455.28
-        .align    16,0x90
-..___tag_value_nss_expr.1072:                                   #
-                                # LOE
-# mark_end;
-	.type	nss_expr, at function
-	.size	nss_expr,.-nss_expr
-	.data
-# -- End  nss_expr
-	.bss
-	.align 32
-	.align 32
-fasta_2na_map.0:
-	.type	fasta_2na_map.0, at object
-	.size	fasta_2na_map.0,128
-	.space 128	# pad
-	.align 32
-fasta_4na_map.0:
-	.type	fasta_4na_map.0, at object
-	.size	fasta_4na_map.0,128
-	.space 128	# pad
-	.data
-	.align 32
-	.align 32
-expand_2na.0:
-	.word	4369
-	.word	4370
-	.word	4372
-	.word	4376
-	.word	4385
-	.word	4386
-	.word	4388
-	.word	4392
-	.word	4417
-	.word	4418
-	.word	4420
-	.word	4424
-	.word	4481
-	.word	4482
-	.word	4484
-	.word	4488
-	.word	4625
-	.word	4626
-	.word	4628
-	.word	4632
-	.word	4641
-	.word	4642
-	.word	4644
-	.word	4648
-	.word	4673
-	.word	4674
-	.word	4676
-	.word	4680
-	.word	4737
-	.word	4738
-	.word	4740
-	.word	4744
-	.word	5137
-	.word	5138
-	.word	5140
-	.word	5144
-	.word	5153
-	.word	5154
-	.word	5156
-	.word	5160
-	.word	5185
-	.word	5186
-	.word	5188
-	.word	5192
-	.word	5249
-	.word	5250
-	.word	5252
-	.word	5256
-	.word	6161
-	.word	6162
-	.word	6164
-	.word	6168
-	.word	6177
-	.word	6178
-	.word	6180
-	.word	6184
-	.word	6209
-	.word	6210
-	.word	6212
-	.word	6216
-	.word	6273
-	.word	6274
-	.word	6276
-	.word	6280
-	.word	8465
-	.word	8466
-	.word	8468
-	.word	8472
-	.word	8481
-	.word	8482
-	.word	8484
-	.word	8488
-	.word	8513
-	.word	8514
-	.word	8516
-	.word	8520
-	.word	8577
-	.word	8578
-	.word	8580
-	.word	8584
-	.word	8721
-	.word	8722
-	.word	8724
-	.word	8728
-	.word	8737
-	.word	8738
-	.word	8740
-	.word	8744
-	.word	8769
-	.word	8770
-	.word	8772
-	.word	8776
-	.word	8833
-	.word	8834
-	.word	8836
-	.word	8840
-	.word	9233
-	.word	9234
-	.word	9236
-	.word	9240
-	.word	9249
-	.word	9250
-	.word	9252
-	.word	9256
-	.word	9281
-	.word	9282
-	.word	9284
-	.word	9288
-	.word	9345
-	.word	9346
-	.word	9348
-	.word	9352
-	.word	10257
-	.word	10258
-	.word	10260
-	.word	10264
-	.word	10273
-	.word	10274
-	.word	10276
-	.word	10280
-	.word	10305
-	.word	10306
-	.word	10308
-	.word	10312
-	.word	10369
-	.word	10370
-	.word	10372
-	.word	10376
-	.word	16657
-	.word	16658
-	.word	16660
-	.word	16664
-	.word	16673
-	.word	16674
-	.word	16676
-	.word	16680
-	.word	16705
-	.word	16706
-	.word	16708
-	.word	16712
-	.word	16769
-	.word	16770
-	.word	16772
-	.word	16776
-	.word	16913
-	.word	16914
-	.word	16916
-	.word	16920
-	.word	16929
-	.word	16930
-	.word	16932
-	.word	16936
-	.word	16961
-	.word	16962
-	.word	16964
-	.word	16968
-	.word	17025
-	.word	17026
-	.word	17028
-	.word	17032
-	.word	17425
-	.word	17426
-	.word	17428
-	.word	17432
-	.word	17441
-	.word	17442
-	.word	17444
-	.word	17448
-	.word	17473
-	.word	17474
-	.word	17476
-	.word	17480
-	.word	17537
-	.word	17538
-	.word	17540
-	.word	17544
-	.word	18449
-	.word	18450
-	.word	18452
-	.word	18456
-	.word	18465
-	.word	18466
-	.word	18468
-	.word	18472
-	.word	18497
-	.word	18498
-	.word	18500
-	.word	18504
-	.word	18561
-	.word	18562
-	.word	18564
-	.word	18568
-	.word	33041
-	.word	33042
-	.word	33044
-	.word	33048
-	.word	33057
-	.word	33058
-	.word	33060
-	.word	33064
-	.word	33089
-	.word	33090
-	.word	33092
-	.word	33096
-	.word	33153
-	.word	33154
-	.word	33156
-	.word	33160
-	.word	33297
-	.word	33298
-	.word	33300
-	.word	33304
-	.word	33313
-	.word	33314
-	.word	33316
-	.word	33320
-	.word	33345
-	.word	33346
-	.word	33348
-	.word	33352
-	.word	33409
-	.word	33410
-	.word	33412
-	.word	33416
-	.word	33809
-	.word	33810
-	.word	33812
-	.word	33816
-	.word	33825
-	.word	33826
-	.word	33828
-	.word	33832
-	.word	33857
-	.word	33858
-	.word	33860
-	.word	33864
-	.word	33921
-	.word	33922
-	.word	33924
-	.word	33928
-	.word	34833
-	.word	34834
-	.word	34836
-	.word	34840
-	.word	34849
-	.word	34850
-	.word	34852
-	.word	34856
-	.word	34881
-	.word	34882
-	.word	34884
-	.word	34888
-	.word	34945
-	.word	34946
-	.word	34948
-	.word	34952
-	.type	expand_2na.0, at object
-	.size	expand_2na.0,512
-	.section .rodata.str1.4, "aMS", at progbits,1
-	.align 4
-	.align 4
-_2__STRING.0.0:
-	.byte	65
-	.byte	67
-	.byte	71
-	.byte	84
-	.byte	0
-	.type	_2__STRING.0.0, at object
-	.size	_2__STRING.0.0,5
-	.space 3	# pad
-	.align 4
-_2__STRING.1.0:
-	.byte	45
-	.byte	65
-	.byte	67
-	.byte	77
-	.byte	71
-	.byte	82
-	.byte	83
-	.byte	86
-	.byte	84
-	.byte	87
-	.byte	89
-	.byte	72
-	.byte	75
-	.byte	68
-	.byte	66
-	.byte	78
-	.byte	0
-	.type	_2__STRING.1.0, at object
-	.size	_2__STRING.1.0,17
-	.data
-	.section .note.GNU-stack, ""
-// -- Begin DWARF2 SEGMENT .eh_frame
-	.section .eh_frame,"a", at progbits
-.eh_frame_seg:
-	.align 1
-	.4byte 0x00000014
-	.4byte 0x00000000
-	.byte 0x01
-	.2byte 0x527a
-	.byte 0x00
-	.byte 0x01
-	.byte 0x78
-	.byte 0x10
-	.byte 0x01
-	.4byte 0x08070c1b
-	.2byte 0x0190
-	.2byte 0x0000
-	.4byte 0x0000045c
-	.4byte 0x0000001c
-	.4byte ..___tag_value_NucStrstrSearch.1-.
-	.4byte ..___tag_value_NucStrstrSearch.194-..___tag_value_NucStrstrSearch.1
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.3-..___tag_value_NucStrstrSearch.1
-	.byte 0x83
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.5-..___tag_value_NucStrstrSearch.3
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.6-..___tag_value_NucStrstrSearch.5
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.7-..___tag_value_NucStrstrSearch.6
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.8-..___tag_value_NucStrstrSearch.7
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.9-..___tag_value_NucStrstrSearch.8
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.10-..___tag_value_NucStrstrSearch.9
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.11-..___tag_value_NucStrstrSearch.10
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.12-..___tag_value_NucStrstrSearch.11
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.13-..___tag_value_NucStrstrSearch.12
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.14-..___tag_value_NucStrstrSearch.13
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.18-..___tag_value_NucStrstrSearch.14
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.20-..___tag_value_NucStrstrSearch.18
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.21-..___tag_value_NucStrstrSearch.20
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.23-..___tag_value_NucStrstrSearch.21
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.24-..___tag_value_NucStrstrSearch.23
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.25-..___tag_value_NucStrstrSearch.24
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.26-..___tag_value_NucStrstrSearch.25
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.27-..___tag_value_NucStrstrSearch.26
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.31-..___tag_value_NucStrstrSearch.27
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.32-..___tag_value_NucStrstrSearch.31
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.33-..___tag_value_NucStrstrSearch.32
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.34-..___tag_value_NucStrstrSearch.33
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.35-..___tag_value_NucStrstrSearch.34
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.39-..___tag_value_NucStrstrSearch.35
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.41-..___tag_value_NucStrstrSearch.39
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.42-..___tag_value_NucStrstrSearch.41
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.44-..___tag_value_NucStrstrSearch.42
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.45-..___tag_value_NucStrstrSearch.44
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.46-..___tag_value_NucStrstrSearch.45
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.47-..___tag_value_NucStrstrSearch.46
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.48-..___tag_value_NucStrstrSearch.47
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.52-..___tag_value_NucStrstrSearch.48
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.54-..___tag_value_NucStrstrSearch.52
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.55-..___tag_value_NucStrstrSearch.54
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.57-..___tag_value_NucStrstrSearch.55
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.58-..___tag_value_NucStrstrSearch.57
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.59-..___tag_value_NucStrstrSearch.58
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.60-..___tag_value_NucStrstrSearch.59
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.61-..___tag_value_NucStrstrSearch.60
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.65-..___tag_value_NucStrstrSearch.61
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.67-..___tag_value_NucStrstrSearch.65
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.68-..___tag_value_NucStrstrSearch.67
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.70-..___tag_value_NucStrstrSearch.68
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.71-..___tag_value_NucStrstrSearch.70
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.72-..___tag_value_NucStrstrSearch.71
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.73-..___tag_value_NucStrstrSearch.72
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.74-..___tag_value_NucStrstrSearch.73
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.78-..___tag_value_NucStrstrSearch.74
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.80-..___tag_value_NucStrstrSearch.78
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.81-..___tag_value_NucStrstrSearch.80
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.83-..___tag_value_NucStrstrSearch.81
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.84-..___tag_value_NucStrstrSearch.83
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.85-..___tag_value_NucStrstrSearch.84
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.86-..___tag_value_NucStrstrSearch.85
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.87-..___tag_value_NucStrstrSearch.86
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.91-..___tag_value_NucStrstrSearch.87
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.93-..___tag_value_NucStrstrSearch.91
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.94-..___tag_value_NucStrstrSearch.93
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.96-..___tag_value_NucStrstrSearch.94
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.97-..___tag_value_NucStrstrSearch.96
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.98-..___tag_value_NucStrstrSearch.97
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.99-..___tag_value_NucStrstrSearch.98
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.100-..___tag_value_NucStrstrSearch.99
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.104-..___tag_value_NucStrstrSearch.100
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.106-..___tag_value_NucStrstrSearch.104
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.107-..___tag_value_NucStrstrSearch.106
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.109-..___tag_value_NucStrstrSearch.107
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.110-..___tag_value_NucStrstrSearch.109
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.111-..___tag_value_NucStrstrSearch.110
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.112-..___tag_value_NucStrstrSearch.111
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.113-..___tag_value_NucStrstrSearch.112
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.117-..___tag_value_NucStrstrSearch.113
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.119-..___tag_value_NucStrstrSearch.117
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.120-..___tag_value_NucStrstrSearch.119
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.122-..___tag_value_NucStrstrSearch.120
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.123-..___tag_value_NucStrstrSearch.122
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.124-..___tag_value_NucStrstrSearch.123
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.125-..___tag_value_NucStrstrSearch.124
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.126-..___tag_value_NucStrstrSearch.125
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.130-..___tag_value_NucStrstrSearch.126
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.132-..___tag_value_NucStrstrSearch.130
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.133-..___tag_value_NucStrstrSearch.132
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.135-..___tag_value_NucStrstrSearch.133
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.136-..___tag_value_NucStrstrSearch.135
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.137-..___tag_value_NucStrstrSearch.136
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.138-..___tag_value_NucStrstrSearch.137
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.139-..___tag_value_NucStrstrSearch.138
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.143-..___tag_value_NucStrstrSearch.139
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.145-..___tag_value_NucStrstrSearch.143
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.146-..___tag_value_NucStrstrSearch.145
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.148-..___tag_value_NucStrstrSearch.146
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.149-..___tag_value_NucStrstrSearch.148
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.150-..___tag_value_NucStrstrSearch.149
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.151-..___tag_value_NucStrstrSearch.150
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.152-..___tag_value_NucStrstrSearch.151
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.156-..___tag_value_NucStrstrSearch.152
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.158-..___tag_value_NucStrstrSearch.156
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.159-..___tag_value_NucStrstrSearch.158
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.161-..___tag_value_NucStrstrSearch.159
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.162-..___tag_value_NucStrstrSearch.161
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.163-..___tag_value_NucStrstrSearch.162
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.164-..___tag_value_NucStrstrSearch.163
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.165-..___tag_value_NucStrstrSearch.164
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.169-..___tag_value_NucStrstrSearch.165
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.171-..___tag_value_NucStrstrSearch.169
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.172-..___tag_value_NucStrstrSearch.171
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.178-..___tag_value_NucStrstrSearch.172
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.180-..___tag_value_NucStrstrSearch.178
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.181-..___tag_value_NucStrstrSearch.180
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x02
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x05
-	.byte 0x8f
-	.byte 0x06
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.187-..___tag_value_NucStrstrSearch.181
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.188-..___tag_value_NucStrstrSearch.187
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.189-..___tag_value_NucStrstrSearch.188
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.190-..___tag_value_NucStrstrSearch.189
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.191-..___tag_value_NucStrstrSearch.190
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrSearch.193-..___tag_value_NucStrstrSearch.191
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000018c
-	.4byte 0x0000047c
-	.4byte ..___tag_value_eval_4na_pos.195-.
-	.4byte ..___tag_value_eval_4na_pos.255-..___tag_value_eval_4na_pos.195
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.197-..___tag_value_eval_4na_pos.195
-	.byte 0x8c
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.199-..___tag_value_eval_4na_pos.197
-	.byte 0x86
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.201-..___tag_value_eval_4na_pos.199
-	.byte 0x83
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.204-..___tag_value_eval_4na_pos.201
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.206-..___tag_value_eval_4na_pos.204
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.208-..___tag_value_eval_4na_pos.206
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.210-..___tag_value_eval_4na_pos.208
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.211-..___tag_value_eval_4na_pos.210
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x03
-	.byte 0x8c
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.215-..___tag_value_eval_4na_pos.211
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.217-..___tag_value_eval_4na_pos.215
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.219-..___tag_value_eval_4na_pos.217
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.221-..___tag_value_eval_4na_pos.219
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.222-..___tag_value_eval_4na_pos.221
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x03
-	.byte 0x8c
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.226-..___tag_value_eval_4na_pos.222
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.228-..___tag_value_eval_4na_pos.226
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.230-..___tag_value_eval_4na_pos.228
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.232-..___tag_value_eval_4na_pos.230
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.233-..___tag_value_eval_4na_pos.232
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x03
-	.byte 0x8c
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.237-..___tag_value_eval_4na_pos.233
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.239-..___tag_value_eval_4na_pos.237
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.241-..___tag_value_eval_4na_pos.239
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.243-..___tag_value_eval_4na_pos.241
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.244-..___tag_value_eval_4na_pos.243
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x86
-	.byte 0x03
-	.byte 0x8c
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.248-..___tag_value_eval_4na_pos.244
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.250-..___tag_value_eval_4na_pos.248
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.252-..___tag_value_eval_4na_pos.250
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_pos.254-..___tag_value_eval_4na_pos.252
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x000001a4
-	.4byte 0x0000060c
-	.4byte ..___tag_value_eval_2na_pos.256-.
-	.4byte ..___tag_value_eval_2na_pos.332-..___tag_value_eval_2na_pos.256
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.258-..___tag_value_eval_2na_pos.256
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.260-..___tag_value_eval_2na_pos.258
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.262-..___tag_value_eval_2na_pos.260
-	.byte 0x86
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.264-..___tag_value_eval_2na_pos.262
-	.byte 0x83
-	.byte 0x05
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.267-..___tag_value_eval_2na_pos.264
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.269-..___tag_value_eval_2na_pos.267
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.271-..___tag_value_eval_2na_pos.269
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.273-..___tag_value_eval_2na_pos.271
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.275-..___tag_value_eval_2na_pos.273
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.276-..___tag_value_eval_2na_pos.275
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.281-..___tag_value_eval_2na_pos.276
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.283-..___tag_value_eval_2na_pos.281
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.285-..___tag_value_eval_2na_pos.283
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.287-..___tag_value_eval_2na_pos.285
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.289-..___tag_value_eval_2na_pos.287
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.290-..___tag_value_eval_2na_pos.289
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.295-..___tag_value_eval_2na_pos.290
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.297-..___tag_value_eval_2na_pos.295
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.299-..___tag_value_eval_2na_pos.297
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.301-..___tag_value_eval_2na_pos.299
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.303-..___tag_value_eval_2na_pos.301
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.304-..___tag_value_eval_2na_pos.303
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.309-..___tag_value_eval_2na_pos.304
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.311-..___tag_value_eval_2na_pos.309
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.313-..___tag_value_eval_2na_pos.311
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.315-..___tag_value_eval_2na_pos.313
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.317-..___tag_value_eval_2na_pos.315
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.318-..___tag_value_eval_2na_pos.317
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.323-..___tag_value_eval_2na_pos.318
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.325-..___tag_value_eval_2na_pos.323
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.327-..___tag_value_eval_2na_pos.325
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.329-..___tag_value_eval_2na_pos.327
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_pos.331-..___tag_value_eval_2na_pos.329
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x00
-	.4byte 0x000000ec
-	.4byte 0x000007b4
-	.4byte ..___tag_value_eval_4na_128.333-.
-	.4byte ..___tag_value_eval_4na_128.361-..___tag_value_eval_4na_128.333
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.335-..___tag_value_eval_4na_128.333
-	.byte 0x86
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.337-..___tag_value_eval_4na_128.335
-	.byte 0x83
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.340-..___tag_value_eval_4na_128.337
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.342-..___tag_value_eval_4na_128.340
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.344-..___tag_value_eval_4na_128.342
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.345-..___tag_value_eval_4na_128.344
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x83
-	.byte 0x03
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.348-..___tag_value_eval_4na_128.345
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.350-..___tag_value_eval_4na_128.348
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.352-..___tag_value_eval_4na_128.350
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.353-..___tag_value_eval_4na_128.352
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x83
-	.byte 0x03
-	.byte 0x86
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.356-..___tag_value_eval_4na_128.353
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.358-..___tag_value_eval_4na_128.356
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_128.360-..___tag_value_eval_4na_128.358
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.2byte 0x0000
-	.4byte 0x00000124
-	.4byte 0x000008a4
-	.4byte ..___tag_value_eval_4na_32.362-.
-	.4byte ..___tag_value_eval_4na_32.403-..___tag_value_eval_4na_32.362
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.364-..___tag_value_eval_4na_32.362
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.366-..___tag_value_eval_4na_32.364
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.368-..___tag_value_eval_4na_32.366
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.370-..___tag_value_eval_4na_32.368
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.372-..___tag_value_eval_4na_32.370
-	.byte 0x83
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.375-..___tag_value_eval_4na_32.372
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.377-..___tag_value_eval_4na_32.375
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.379-..___tag_value_eval_4na_32.377
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.381-..___tag_value_eval_4na_32.379
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.383-..___tag_value_eval_4na_32.381
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.385-..___tag_value_eval_4na_32.383
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.386-..___tag_value_eval_4na_32.385
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.392-..___tag_value_eval_4na_32.386
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.394-..___tag_value_eval_4na_32.392
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.396-..___tag_value_eval_4na_32.394
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.398-..___tag_value_eval_4na_32.396
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.400-..___tag_value_eval_4na_32.398
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_32.402-..___tag_value_eval_4na_32.400
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000cc
-	.4byte 0x000009cc
-	.4byte ..___tag_value_eval_4na_16.404-.
-	.4byte ..___tag_value_eval_4na_16.431-..___tag_value_eval_4na_16.404
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.406-..___tag_value_eval_4na_16.404
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.408-..___tag_value_eval_4na_16.406
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.410-..___tag_value_eval_4na_16.408
-	.byte 0x83
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.413-..___tag_value_eval_4na_16.410
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.415-..___tag_value_eval_4na_16.413
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.417-..___tag_value_eval_4na_16.415
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.419-..___tag_value_eval_4na_16.417
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.420-..___tag_value_eval_4na_16.419
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.424-..___tag_value_eval_4na_16.420
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.426-..___tag_value_eval_4na_16.424
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.428-..___tag_value_eval_4na_16.426
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_16.430-..___tag_value_eval_4na_16.428
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.4byte 0x00000000
-	.byte 0x00
-	.4byte 0x000000d4
-	.4byte 0x00000a9c
-	.4byte ..___tag_value_eval_2na_128.432-.
-	.4byte ..___tag_value_eval_2na_128.467-..___tag_value_eval_2na_128.432
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.434-..___tag_value_eval_2na_128.432
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.436-..___tag_value_eval_2na_128.434
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.438-..___tag_value_eval_2na_128.436
-	.byte 0x83
-	.byte 0x04
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.441-..___tag_value_eval_2na_128.438
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.442-..___tag_value_eval_2na_128.441
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.444-..___tag_value_eval_2na_128.442
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.446-..___tag_value_eval_2na_128.444
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.447-..___tag_value_eval_2na_128.446
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.451-..___tag_value_eval_2na_128.447
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.452-..___tag_value_eval_2na_128.451
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.454-..___tag_value_eval_2na_128.452
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.456-..___tag_value_eval_2na_128.454
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.457-..___tag_value_eval_2na_128.456
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.461-..___tag_value_eval_2na_128.457
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.462-..___tag_value_eval_2na_128.461
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.464-..___tag_value_eval_2na_128.462
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_128.466-..___tag_value_eval_2na_128.464
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000134
-	.4byte 0x00000b74
-	.4byte ..___tag_value_eval_2na_32.468-.
-	.4byte ..___tag_value_eval_2na_32.516-..___tag_value_eval_2na_32.468
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.470-..___tag_value_eval_2na_32.468
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.472-..___tag_value_eval_2na_32.470
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.474-..___tag_value_eval_2na_32.472
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.476-..___tag_value_eval_2na_32.474
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.478-..___tag_value_eval_2na_32.476
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.480-..___tag_value_eval_2na_32.478
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.483-..___tag_value_eval_2na_32.480
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.485-..___tag_value_eval_2na_32.483
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.487-..___tag_value_eval_2na_32.485
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.489-..___tag_value_eval_2na_32.487
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.491-..___tag_value_eval_2na_32.489
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.493-..___tag_value_eval_2na_32.491
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.495-..___tag_value_eval_2na_32.493
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.496-..___tag_value_eval_2na_32.495
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.503-..___tag_value_eval_2na_32.496
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.505-..___tag_value_eval_2na_32.503
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.507-..___tag_value_eval_2na_32.505
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.509-..___tag_value_eval_2na_32.507
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.511-..___tag_value_eval_2na_32.509
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.513-..___tag_value_eval_2na_32.511
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_32.515-..___tag_value_eval_2na_32.513
-	.byte 0x0c
-	.2byte 0x0007
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000134
-	.4byte 0x00000cac
-	.4byte ..___tag_value_eval_2na_16.517-.
-	.4byte ..___tag_value_eval_2na_16.565-..___tag_value_eval_2na_16.517
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.519-..___tag_value_eval_2na_16.517
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.521-..___tag_value_eval_2na_16.519
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.523-..___tag_value_eval_2na_16.521
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.525-..___tag_value_eval_2na_16.523
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.527-..___tag_value_eval_2na_16.525
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.529-..___tag_value_eval_2na_16.527
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.532-..___tag_value_eval_2na_16.529
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.534-..___tag_value_eval_2na_16.532
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.536-..___tag_value_eval_2na_16.534
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.538-..___tag_value_eval_2na_16.536
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.540-..___tag_value_eval_2na_16.538
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.542-..___tag_value_eval_2na_16.540
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.544-..___tag_value_eval_2na_16.542
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.545-..___tag_value_eval_2na_16.544
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.552-..___tag_value_eval_2na_16.545
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.554-..___tag_value_eval_2na_16.552
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.556-..___tag_value_eval_2na_16.554
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.558-..___tag_value_eval_2na_16.556
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.560-..___tag_value_eval_2na_16.558
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.562-..___tag_value_eval_2na_16.560
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_16.564-..___tag_value_eval_2na_16.562
-	.byte 0x0c
-	.2byte 0x0007
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x000000a4
-	.4byte 0x00000de4
-	.4byte ..___tag_value_eval_2na_8.566-.
-	.4byte ..___tag_value_eval_2na_8.591-..___tag_value_eval_2na_8.566
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.568-..___tag_value_eval_2na_8.566
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.570-..___tag_value_eval_2na_8.568
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.572-..___tag_value_eval_2na_8.570
-	.byte 0x83
-	.byte 0x04
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.575-..___tag_value_eval_2na_8.572
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.576-..___tag_value_eval_2na_8.575
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.578-..___tag_value_eval_2na_8.576
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.580-..___tag_value_eval_2na_8.578
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.581-..___tag_value_eval_2na_8.580
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.585-..___tag_value_eval_2na_8.581
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.586-..___tag_value_eval_2na_8.585
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.588-..___tag_value_eval_2na_8.586
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_8.590-..___tag_value_eval_2na_8.588
-	.byte 0x0c
-	.2byte 0x0807
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000124
-	.4byte 0x00000e8c
-	.4byte ..___tag_value_eval_4na_64.592-.
-	.4byte ..___tag_value_eval_4na_64.633-..___tag_value_eval_4na_64.592
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.594-..___tag_value_eval_4na_64.592
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.596-..___tag_value_eval_4na_64.594
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.598-..___tag_value_eval_4na_64.596
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.600-..___tag_value_eval_4na_64.598
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.602-..___tag_value_eval_4na_64.600
-	.byte 0x83
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.605-..___tag_value_eval_4na_64.602
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.607-..___tag_value_eval_4na_64.605
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.609-..___tag_value_eval_4na_64.607
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.611-..___tag_value_eval_4na_64.609
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.613-..___tag_value_eval_4na_64.611
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.615-..___tag_value_eval_4na_64.613
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.616-..___tag_value_eval_4na_64.615
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x83
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.622-..___tag_value_eval_4na_64.616
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.624-..___tag_value_eval_4na_64.622
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.626-..___tag_value_eval_4na_64.624
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.628-..___tag_value_eval_4na_64.626
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.630-..___tag_value_eval_4na_64.628
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_4na_64.632-..___tag_value_eval_4na_64.630
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000134
-	.4byte 0x00000fb4
-	.4byte ..___tag_value_eval_2na_64.634-.
-	.4byte ..___tag_value_eval_2na_64.682-..___tag_value_eval_2na_64.634
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.636-..___tag_value_eval_2na_64.634
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.638-..___tag_value_eval_2na_64.636
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.640-..___tag_value_eval_2na_64.638
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.642-..___tag_value_eval_2na_64.640
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.644-..___tag_value_eval_2na_64.642
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.646-..___tag_value_eval_2na_64.644
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.649-..___tag_value_eval_2na_64.646
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.651-..___tag_value_eval_2na_64.649
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.653-..___tag_value_eval_2na_64.651
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.655-..___tag_value_eval_2na_64.653
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.657-..___tag_value_eval_2na_64.655
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.659-..___tag_value_eval_2na_64.657
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.661-..___tag_value_eval_2na_64.659
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.662-..___tag_value_eval_2na_64.661
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.669-..___tag_value_eval_2na_64.662
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.671-..___tag_value_eval_2na_64.669
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.673-..___tag_value_eval_2na_64.671
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.675-..___tag_value_eval_2na_64.673
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.677-..___tag_value_eval_2na_64.675
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.679-..___tag_value_eval_2na_64.677
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_eval_2na_64.681-..___tag_value_eval_2na_64.679
-	.byte 0x0c
-	.2byte 0x0007
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000019c
-	.4byte 0x000010ec
-	.4byte ..___tag_value_NucStrstrMake.683-.
-	.4byte ..___tag_value_NucStrstrMake.751-..___tag_value_NucStrstrMake.683
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffc007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.685-..___tag_value_NucStrstrMake.683
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffc807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.687-..___tag_value_NucStrstrMake.685
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.689-..___tag_value_NucStrstrMake.687
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.691-..___tag_value_NucStrstrMake.689
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.693-..___tag_value_NucStrstrMake.691
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.695-..___tag_value_NucStrstrMake.693
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.697-..___tag_value_NucStrstrMake.695
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.698-..___tag_value_NucStrstrMake.697
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.700-..___tag_value_NucStrstrMake.698
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.702-..___tag_value_NucStrstrMake.700
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.704-..___tag_value_NucStrstrMake.702
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.706-..___tag_value_NucStrstrMake.704
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.708-..___tag_value_NucStrstrMake.706
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.710-..___tag_value_NucStrstrMake.708
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.711-..___tag_value_NucStrstrMake.710
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.718-..___tag_value_NucStrstrMake.711
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.720-..___tag_value_NucStrstrMake.718
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.722-..___tag_value_NucStrstrMake.720
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.724-..___tag_value_NucStrstrMake.722
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.726-..___tag_value_NucStrstrMake.724
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.728-..___tag_value_NucStrstrMake.726
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.730-..___tag_value_NucStrstrMake.728
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.731-..___tag_value_NucStrstrMake.730
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.738-..___tag_value_NucStrstrMake.731
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.740-..___tag_value_NucStrstrMake.738
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.742-..___tag_value_NucStrstrMake.740
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.744-..___tag_value_NucStrstrMake.742
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.746-..___tag_value_NucStrstrMake.744
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.748-..___tag_value_NucStrstrMake.746
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrMake.750-..___tag_value_NucStrstrMake.748
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x00000034
-	.4byte 0x0000128c
-	.4byte ..___tag_value_NucStrstrWhack.752-.
-	.4byte ..___tag_value_NucStrstrWhack.759-..___tag_value_NucStrstrWhack.752
-	.byte 0x00
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.754-..___tag_value_NucStrstrWhack.752
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.757-..___tag_value_NucStrstrWhack.754
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrstrWhack.758-..___tag_value_NucStrstrWhack.757
-	.byte 0x0c
-	.2byte 0x0807
-	.4byte 0x00000000
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000014c
-	.4byte 0x000012c4
-	.4byte ..___tag_value_nss_unary_expr.760-.
-	.4byte ..___tag_value_nss_unary_expr.815-..___tag_value_nss_unary_expr.760
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.762-..___tag_value_nss_unary_expr.760
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.764-..___tag_value_nss_unary_expr.762
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.766-..___tag_value_nss_unary_expr.764
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.768-..___tag_value_nss_unary_expr.766
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.770-..___tag_value_nss_unary_expr.768
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.772-..___tag_value_nss_unary_expr.770
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.774-..___tag_value_nss_unary_expr.772
-	.byte 0x0c
-	.2byte 0x4007
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.775-..___tag_value_nss_unary_expr.774
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.777-..___tag_value_nss_unary_expr.775
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.779-..___tag_value_nss_unary_expr.777
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.781-..___tag_value_nss_unary_expr.779
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.783-..___tag_value_nss_unary_expr.781
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.785-..___tag_value_nss_unary_expr.783
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.787-..___tag_value_nss_unary_expr.785
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.788-..___tag_value_nss_unary_expr.787
-	.byte 0x0c
-	.2byte 0x4007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.795-..___tag_value_nss_unary_expr.788
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.797-..___tag_value_nss_unary_expr.795
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.799-..___tag_value_nss_unary_expr.797
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.801-..___tag_value_nss_unary_expr.799
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.803-..___tag_value_nss_unary_expr.801
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.805-..___tag_value_nss_unary_expr.803
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.807-..___tag_value_nss_unary_expr.805
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_unary_expr.808-..___tag_value_nss_unary_expr.807
-	.byte 0x0c
-	.2byte 0x4007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.4byte 0x00000000
-	.2byte 0x0000
-	.4byte 0x000001e4
-	.4byte 0x00001414
-	.4byte ..___tag_value_nss_fasta_expr.816-.
-	.4byte ..___tag_value_nss_fasta_expr.905-..___tag_value_nss_fasta_expr.816
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.818-..___tag_value_nss_fasta_expr.816
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xfffffffffffff807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.820-..___tag_value_nss_fasta_expr.818
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.2byte 0x0007
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.822-..___tag_value_nss_fasta_expr.820
-	.byte 0x83
-	.byte 0x04
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.825-..___tag_value_nss_fasta_expr.822
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.826-..___tag_value_nss_fasta_expr.825
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.828-..___tag_value_nss_fasta_expr.826
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.830-..___tag_value_nss_fasta_expr.828
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.831-..___tag_value_nss_fasta_expr.830
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.835-..___tag_value_nss_fasta_expr.831
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.836-..___tag_value_nss_fasta_expr.835
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.838-..___tag_value_nss_fasta_expr.836
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.840-..___tag_value_nss_fasta_expr.838
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.841-..___tag_value_nss_fasta_expr.840
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.845-..___tag_value_nss_fasta_expr.841
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.846-..___tag_value_nss_fasta_expr.845
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.848-..___tag_value_nss_fasta_expr.846
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.850-..___tag_value_nss_fasta_expr.848
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.851-..___tag_value_nss_fasta_expr.850
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.855-..___tag_value_nss_fasta_expr.851
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.856-..___tag_value_nss_fasta_expr.855
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.858-..___tag_value_nss_fasta_expr.856
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.860-..___tag_value_nss_fasta_expr.858
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.861-..___tag_value_nss_fasta_expr.860
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.865-..___tag_value_nss_fasta_expr.861
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.866-..___tag_value_nss_fasta_expr.865
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.868-..___tag_value_nss_fasta_expr.866
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.870-..___tag_value_nss_fasta_expr.868
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.871-..___tag_value_nss_fasta_expr.870
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.875-..___tag_value_nss_fasta_expr.871
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.876-..___tag_value_nss_fasta_expr.875
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.878-..___tag_value_nss_fasta_expr.876
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.880-..___tag_value_nss_fasta_expr.878
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.881-..___tag_value_nss_fasta_expr.880
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.885-..___tag_value_nss_fasta_expr.881
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.886-..___tag_value_nss_fasta_expr.885
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.888-..___tag_value_nss_fasta_expr.886
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.890-..___tag_value_nss_fasta_expr.888
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.891-..___tag_value_nss_fasta_expr.890
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.895-..___tag_value_nss_fasta_expr.891
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.896-..___tag_value_nss_fasta_expr.895
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.898-..___tag_value_nss_fasta_expr.896
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.900-..___tag_value_nss_fasta_expr.898
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_fasta_expr.901-..___tag_value_nss_fasta_expr.900
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x83
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8e
-	.byte 0x02
-	.byte 0x00
-	.4byte 0x0000012c
-	.4byte 0x000015fc
-	.4byte ..___tag_value_NucStrFastaExprMake2.906-.
-	.4byte ..___tag_value_NucStrFastaExprMake2.954-..___tag_value_NucStrFastaExprMake2.906
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffc007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.908-..___tag_value_NucStrFastaExprMake2.906
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffc807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.910-..___tag_value_NucStrFastaExprMake2.908
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.912-..___tag_value_NucStrFastaExprMake2.910
-	.byte 0x86
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.914-..___tag_value_NucStrFastaExprMake2.912
-	.byte 0x83
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.916-..___tag_value_NucStrFastaExprMake2.914
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.917-..___tag_value_NucStrFastaExprMake2.916
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.919-..___tag_value_NucStrFastaExprMake2.917
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.921-..___tag_value_NucStrFastaExprMake2.919
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.923-..___tag_value_NucStrFastaExprMake2.921
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.925-..___tag_value_NucStrFastaExprMake2.923
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.926-..___tag_value_NucStrFastaExprMake2.925
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.931-..___tag_value_NucStrFastaExprMake2.926
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.933-..___tag_value_NucStrFastaExprMake2.931
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.935-..___tag_value_NucStrFastaExprMake2.933
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.937-..___tag_value_NucStrFastaExprMake2.935
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.939-..___tag_value_NucStrFastaExprMake2.937
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.940-..___tag_value_NucStrFastaExprMake2.939
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x05
-	.byte 0x86
-	.byte 0x04
-	.byte 0x8c
-	.byte 0x03
-	.byte 0x8d
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.945-..___tag_value_NucStrFastaExprMake2.940
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.947-..___tag_value_NucStrFastaExprMake2.945
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.949-..___tag_value_NucStrFastaExprMake2.947
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.951-..___tag_value_NucStrFastaExprMake2.949
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake2.953-..___tag_value_NucStrFastaExprMake2.951
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000012c
-	.4byte 0x0000172c
-	.4byte ..___tag_value_NucStrFastaExprMake4.955-.
-	.4byte ..___tag_value_NucStrFastaExprMake4.1003-..___tag_value_NucStrFastaExprMake4.955
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffc007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.957-..___tag_value_NucStrFastaExprMake4.955
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffc807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.959-..___tag_value_NucStrFastaExprMake4.957
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.961-..___tag_value_NucStrFastaExprMake4.959
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.963-..___tag_value_NucStrFastaExprMake4.961
-	.byte 0x83
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.965-..___tag_value_NucStrFastaExprMake4.963
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.966-..___tag_value_NucStrFastaExprMake4.965
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.968-..___tag_value_NucStrFastaExprMake4.966
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.970-..___tag_value_NucStrFastaExprMake4.968
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.972-..___tag_value_NucStrFastaExprMake4.970
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.974-..___tag_value_NucStrFastaExprMake4.972
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.975-..___tag_value_NucStrFastaExprMake4.974
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.980-..___tag_value_NucStrFastaExprMake4.975
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.982-..___tag_value_NucStrFastaExprMake4.980
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.984-..___tag_value_NucStrFastaExprMake4.982
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.986-..___tag_value_NucStrFastaExprMake4.984
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.988-..___tag_value_NucStrFastaExprMake4.986
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.989-..___tag_value_NucStrFastaExprMake4.988
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.994-..___tag_value_NucStrFastaExprMake4.989
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.996-..___tag_value_NucStrFastaExprMake4.994
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.998-..___tag_value_NucStrFastaExprMake4.996
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.1000-..___tag_value_NucStrFastaExprMake4.998
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_NucStrFastaExprMake4.1002-..___tag_value_NucStrFastaExprMake4.1000
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-	.4byte 0x0000019c
-	.4byte 0x0000185c
-	.4byte ..___tag_value_nss_expr.1004-.
-	.4byte ..___tag_value_nss_expr.1072-..___tag_value_nss_expr.1004
-	.byte 0x00
-	.byte 0x0c
-	.8byte 0xffffffffffffc007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1006-..___tag_value_nss_expr.1004
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x0c
-	.8byte 0xffffffffffffc807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1008-..___tag_value_nss_expr.1006
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x0c
-	.8byte 0xffffffffffffd007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1010-..___tag_value_nss_expr.1008
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x0c
-	.8byte 0xffffffffffffd807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1012-..___tag_value_nss_expr.1010
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x0c
-	.8byte 0xffffffffffffe007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1014-..___tag_value_nss_expr.1012
-	.byte 0x86
-	.byte 0x06
-	.byte 0x0c
-	.8byte 0xffffffffffffe807
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1016-..___tag_value_nss_expr.1014
-	.byte 0x83
-	.byte 0x07
-	.byte 0x0c
-	.8byte 0xfffffffffffff007
-	.2byte 0xffff
-	.byte 0x01
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1018-..___tag_value_nss_expr.1016
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1019-..___tag_value_nss_expr.1018
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1021-..___tag_value_nss_expr.1019
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1023-..___tag_value_nss_expr.1021
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1025-..___tag_value_nss_expr.1023
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1027-..___tag_value_nss_expr.1025
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1029-..___tag_value_nss_expr.1027
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1031-..___tag_value_nss_expr.1029
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1032-..___tag_value_nss_expr.1031
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1039-..___tag_value_nss_expr.1032
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1041-..___tag_value_nss_expr.1039
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1043-..___tag_value_nss_expr.1041
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1045-..___tag_value_nss_expr.1043
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1047-..___tag_value_nss_expr.1045
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1049-..___tag_value_nss_expr.1047
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1051-..___tag_value_nss_expr.1049
-	.byte 0x0c
-	.2byte 0x0807
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1052-..___tag_value_nss_expr.1051
-	.byte 0x0c
-	.2byte 0x5007
-	.byte 0x83
-	.byte 0x07
-	.byte 0x86
-	.byte 0x06
-	.byte 0x8c
-	.byte 0x05
-	.byte 0x8d
-	.byte 0x04
-	.byte 0x8e
-	.byte 0x03
-	.byte 0x8f
-	.byte 0x02
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1059-..___tag_value_nss_expr.1052
-	.byte 0x0c
-	.2byte 0x3807
-	.byte 0x09
-	.2byte 0x0303
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1061-..___tag_value_nss_expr.1059
-	.byte 0x0c
-	.2byte 0x3007
-	.byte 0x09
-	.2byte 0x0606
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1063-..___tag_value_nss_expr.1061
-	.byte 0x0c
-	.2byte 0x2807
-	.byte 0x09
-	.2byte 0x0c0c
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1065-..___tag_value_nss_expr.1063
-	.byte 0x0c
-	.2byte 0x2007
-	.byte 0x09
-	.2byte 0x0d0d
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1067-..___tag_value_nss_expr.1065
-	.byte 0x0c
-	.2byte 0x1807
-	.byte 0x09
-	.2byte 0x0e0e
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1069-..___tag_value_nss_expr.1067
-	.byte 0x0c
-	.2byte 0x1007
-	.byte 0x09
-	.2byte 0x0f0f
-	.byte 0x04
-	.4byte ..___tag_value_nss_expr.1071-..___tag_value_nss_expr.1069
-	.byte 0x0c
-	.2byte 0x0807
-	.2byte 0x0000
-	.byte 0x00
-# End
diff --git a/libs/search/nucstrstr.c b/libs/search/nucstrstr.c
deleted file mode 100644
index 0d2e3e6..0000000
--- a/libs/search/nucstrstr.c
+++ /dev/null
@@ -1,5313 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <search/nucstrstr.h>
-#include <arch-impl.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
-#include <byteswap.h>
-
-#define TRACE_OPERATIONS 0
-#define TRACE_PARSE 1
-#define TRACE_HEADER 1
-#define TRACE_RESULT 1
-#define TRACE_PATMASK 1
-
-#if __INTEL_COMPILER || defined __SSE2__
-
-#include <emmintrin.h>
-#define INTEL_INTRINSICS 1
-#define NEVER_MATCH 0
-#define RETURN_LOCATION 1
-#define USE_MEMALIGN 0
-
-#endif
-
-#if INTEL_INTRINSICS
-
-#if USE_MEMALIGN
-#include <malloc.h>
-#endif
-
-#define RELOAD_BUFFER 1
-#define NA2_LIMIT 61
-#define NA4_LIMIT 29
-typedef __m128i nucreg_t;
-typedef union
-{
-    uint8_t b [ 16 ];
-    uint16_t w [ 8 ];
-    uint32_t i [ 4 ];
-    uint64_t l [ 2 ];
-    uint128_t s;
-} nucpat_t;
-
-#else
-
-#define NA2_LIMIT 29
-#define NA4_LIMIT 13
-typedef uint64_t nucreg_t;
-typedef union
-{
-    uint8_t b [ 8 ];
-    uint16_t w [ 4 ];
-    uint32_t i [ 2 ];
-    uint64_t l;
-} nucpat_t;
-
-#endif
-
-
-static int8_t fasta_2na_map [ 128 ];
-static int8_t fasta_4na_map [ 128 ];
-static uint16_t expand_2na [ 256 ] =
-   /* AAAA    AAAC    AAAG    AAAT    AACA    AACC    AACG    AACT */
-{   0x1111, 0x1112, 0x1114, 0x1118, 0x1121, 0x1122, 0x1124, 0x1128,
-   /* AAGA    AAGC    AAGG    AAGT    AATA    AATC    AATG    AATT */
-    0x1141, 0x1142, 0x1144, 0x1148, 0x1181, 0x1182, 0x1184, 0x1188,
-   /* ACAA    ACAC    ACAG    ACAT    ACCA    ACCC    ACCG    ACCT */
-    0x1211, 0x1212, 0x1214, 0x1218, 0x1221, 0x1222, 0x1224, 0x1228,
-   /* ACGA    ACGC    ACGG    ACGT    ACTA    ACTC    ACTG    ACTT */
-    0x1241, 0x1242, 0x1244, 0x1248, 0x1281, 0x1282, 0x1284, 0x1288,
-   /* AGAA    AGAC    AGAG    AGAT    AGCA    AGCC    AGCG    AGCT */
-    0x1411, 0x1412, 0x1414, 0x1418, 0x1421, 0x1422, 0x1424, 0x1428,
-   /* AGGA    AGGC    AGGG    AGGT    AGTA    AGTC    AGTG    AGTT */
-    0x1441, 0x1442, 0x1444, 0x1448, 0x1481, 0x1482, 0x1484, 0x1488,
-   /* ATAA    ATAC    ATAG    ATAT    ATCA    ATCC    ATCG    ATCT */
-    0x1811, 0x1812, 0x1814, 0x1818, 0x1821, 0x1822, 0x1824, 0x1828,
-   /* ATGA    ATGC    ATGG    ATGT    ATTA    ATTC    ATTG    ATTT */
-    0x1841, 0x1842, 0x1844, 0x1848, 0x1881, 0x1882, 0x1884, 0x1888,
-   /* CAAA    CAAC    CAAG    CAAT    CACA    CACC    CACG    CACT */
-    0x2111, 0x2112, 0x2114, 0x2118, 0x2121, 0x2122, 0x2124, 0x2128,
-   /* CAGA    CAGC    CAGG    CAGT    CATA    CATC    CATG    CATT */
-    0x2141, 0x2142, 0x2144, 0x2148, 0x2181, 0x2182, 0x2184, 0x2188,
-   /* CCAA    CCAC    CCAG    CCAT    CCCA    CCCC    CCCG    CCCT */
-    0x2211, 0x2212, 0x2214, 0x2218, 0x2221, 0x2222, 0x2224, 0x2228,
-   /* CCGA    CCGC    CCGG    CCGT    CCTA    CCTC    CCTG    CCTT */
-    0x2241, 0x2242, 0x2244, 0x2248, 0x2281, 0x2282, 0x2284, 0x2288,
-   /* CGAA    CGAC    CGAG    CGAT    CGCA    CGCC    CGCG    CGCT */
-    0x2411, 0x2412, 0x2414, 0x2418, 0x2421, 0x2422, 0x2424, 0x2428,
-   /* CGGA    CGGC    CGGG    CGGT    CGTA    CGTC    CGTG    CGTT */
-    0x2441, 0x2442, 0x2444, 0x2448, 0x2481, 0x2482, 0x2484, 0x2488,
-   /* CTAA    CTAC    CTAG    CTAT    CTCA    CTCC    CTCG    CTCT */
-    0x2811, 0x2812, 0x2814, 0x2818, 0x2821, 0x2822, 0x2824, 0x2828,
-   /* CTGA    CTGC    CTGG    CTGT    CTTA    CTTC    CTTG    CTTT */
-    0x2841, 0x2842, 0x2844, 0x2848, 0x2881, 0x2882, 0x2884, 0x2888,
-   /* GAAA    GAAC    GAAG    GAAT    GACA    GACC    GACG    GACT */
-    0x4111, 0x4112, 0x4114, 0x4118, 0x4121, 0x4122, 0x4124, 0x4128,
-   /* GAGA    GAGC    GAGG    GAGT    GATA    GATC    GATG    GATT */
-    0x4141, 0x4142, 0x4144, 0x4148, 0x4181, 0x4182, 0x4184, 0x4188,
-   /* GCAA    GCAC    GCAG    GCAT    GCCA    GCCC    GCCG    GCCT */
-    0x4211, 0x4212, 0x4214, 0x4218, 0x4221, 0x4222, 0x4224, 0x4228,
-   /* GCGA    GCGC    GCGG    GCGT    GCTA    GCTC    GCTG    GCTT */
-    0x4241, 0x4242, 0x4244, 0x4248, 0x4281, 0x4282, 0x4284, 0x4288,
-   /* GGAA    GGAC    GGAG    GGAT    GGCA    GGCC    GGCG    GGCT */
-    0x4411, 0x4412, 0x4414, 0x4418, 0x4421, 0x4422, 0x4424, 0x4428,
-   /* GGGA    GGGC    GGGG    GGGT    GGTA    GGTC    GGTG    GGTT */
-    0x4441, 0x4442, 0x4444, 0x4448, 0x4481, 0x4482, 0x4484, 0x4488,
-   /* GTAA    GTAC    GTAG    GTAT    GTCA    GTCC    GTCG    GTCT */
-    0x4811, 0x4812, 0x4814, 0x4818, 0x4821, 0x4822, 0x4824, 0x4828,
-   /* GTGA    GTGC    GTGG    GTGT    GTTA    GTTC    GTTG    GTTT */
-    0x4841, 0x4842, 0x4844, 0x4848, 0x4881, 0x4882, 0x4884, 0x4888,
-   /* TAAA    TAAC    TAAG    TAAT    TACA    TACC    TACG    TACT */
-    0x8111, 0x8112, 0x8114, 0x8118, 0x8121, 0x8122, 0x8124, 0x8128,
-   /* TAGA    TAGC    TAGG    TAGT    TATA    TATC    TATG    TATT */
-    0x8141, 0x8142, 0x8144, 0x8148, 0x8181, 0x8182, 0x8184, 0x8188,
-   /* TCAA    TCAC    TCAG    TCAT    TCCA    TCCC    TCCG    TCCT */
-    0x8211, 0x8212, 0x8214, 0x8218, 0x8221, 0x8222, 0x8224, 0x8228,
-   /* TCGA    TCGC    TCGG    TCGT    TCTA    TCTC    TCTG    TCTT */
-    0x8241, 0x8242, 0x8244, 0x8248, 0x8281, 0x8282, 0x8284, 0x8288,
-   /* TGAA    TGAC    TGAG    TGAT    TGCA    TGCC    TGCG    TGCT */
-    0x8411, 0x8412, 0x8414, 0x8418, 0x8421, 0x8422, 0x8424, 0x8428,
-   /* TGGA    TGGC    TGGG    TGGT    TGTA    TGTC    TGTG    TGTT */
-    0x8441, 0x8442, 0x8444, 0x8448, 0x8481, 0x8482, 0x8484, 0x8488,
-   /* TTAA    TTAC    TTAG    TTAT    TTCA    TTCC    TTCG    TTCT */
-    0x8811, 0x8812, 0x8814, 0x8818, 0x8821, 0x8822, 0x8824, 0x8828,
-   /* TTGA    TTGC    TTGG    TTGT    TTTA    TTTC    TTTG    TTTT */
-    0x8841, 0x8842, 0x8844, 0x8848, 0x8881, 0x8882, 0x8884, 0x8888
-};
-
-
-/*--------------------------------------------------------------------------
- * debugging printf
- */
-#if TRACE_OPERATIONS
-
-#if INTEL_INTRINSICS
-
-#define COPY_NUCREG( to, from ) \
-    _mm_storeu_si128 ( ( __m128i* ) ( to ) . b, ( from ) )
-
-#else
-
-#define COPY_NUCREG( to, from ) \
-    ( ( to ) . b [ 0 ] = ( uint8_t ) ( ( from ) >> 56 ), \
-      ( to ) . b [ 1 ] = ( uint8_t ) ( ( from ) >> 48 ), \
-      ( to ) . b [ 2 ] = ( uint8_t ) ( ( from ) >> 40 ), \
-      ( to ) . b [ 3 ] = ( uint8_t ) ( ( from ) >> 32 ), \
-      ( to ) . b [ 4 ] = ( uint8_t ) ( ( from ) >> 24 ), \
-      ( to ) . b [ 5 ] = ( uint8_t ) ( ( from ) >> 16 ), \
-      ( to ) . b [ 6 ] = ( uint8_t ) ( ( from ) >>  8 ), \
-      ( to ) . b [ 7 ] = ( uint8_t ) ( ( from ) >>  0 ) )
-
-#endif
-
-/* sprintf_2na
- *  print 2na sequence
- */
-static
-const char *sprintf_2na ( char *str, size_t ssize, nucreg_t nr )
-{
-    int b, i, j;
-    nucpat_t np;
-    const char *ncbi2na = "ACGT";
-
-    if ( ssize <= sizeof np * 4 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( np, nr );
-
-    for ( i = j = 0; i < sizeof np . b; j += 4, ++ i )
-    {
-        b = np . b [ i ];
-        str [ j + 0 ] = ncbi2na [ ( b >> 6 ) & 3 ];
-        str [ j + 1 ] = ncbi2na [ ( b >> 4 ) & 3 ];
-        str [ j + 2 ] = ncbi2na [ ( b >> 2 ) & 3 ];
-        str [ j + 3 ] = ncbi2na [ ( b >> 0 ) & 3 ];
-    }
-
-    str [ sizeof np * 4 ] = 0;
-
-    return str;
-}
-
-/* sprintf_4na
- *  print 4na sequence
- */
-static
-const char *sprintf_4na ( char *str, size_t ssize, nucreg_t nr )
-{
-    int b, i, j;
-    nucpat_t np;
-    const char *ncbi4na = "-ACMGRSVTWYHKDBN";
-
-    if ( ssize <= sizeof np * 2 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( np, nr );
-
-    for ( i = j = 0; i < sizeof np . b; j += 2, ++ i )
-    {
-        b = np . b [ i ];
-        str [ j + 0 ] = ncbi4na [ ( b >> 4 ) & 15 ];
-        str [ j + 1 ] = ncbi4na [ ( b >> 0 ) & 15 ];
-    }
-
-    str [ sizeof np * 2 ] = 0;
-
-    return str;
-}
-
-/* sprintf_m2na
- *  print 2na mask
- */
-static
-const char *sprintf_m2na ( char *str, size_t ssize, nucreg_t mask )
-{
-    int b, i, j;
-    nucpat_t mp;
-    const char *amask = " ??x";
-
-    if ( ssize <= sizeof mp * 4 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( mp, mask );
-
-    for ( i = j = 0; i < mp . b; j += 4, ++ i )
-    {
-        b = mp . b [ i ];
-        str [ j + 0 ] = amask [ ( b >> 6 ) & 3 ];
-        str [ j + 1 ] = amask [ ( b >> 4 ) & 3 ];
-        str [ j + 2 ] = amask [ ( b >> 2 ) & 3 ];
-        str [ j + 3 ] = amask [ ( b >> 0 ) & 3 ];
-    }
-
-    str [ sizeof mp * 4 ] = 0;
-
-    return str;
-}
-
-/* sprintf_m4na
- *  print 4na mask
- */
-static
-const char *sprintf_m4na ( char *str, size_t ssize, nucreg_t mask )
-{
-    int b, i, j;
-    nucpat_t mp;
-    const char *amask = " ??????????????x";
-
-    if ( ssize <= sizeof mp * 2 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( mp, mask );
-
-    for ( i = j = 0; i < sizeof mp . b; j += 2, ++ i )
-    {
-        b = mp . b [ i ];
-        str [ j + 0 ] = amask [ ( b >> 4 ) & 15 ];
-        str [ j + 1 ] = amask [ ( b >> 0 ) & 15 ];
-    }
-
-    str [ sizeof mp * 2 ] = 0;
-
-    return str;
-}
-
-/* sprintf_a2na
- *  print 2na alignment, where buffer has source,
- *  pattern has some set of valid pattern bases,
- *  and mask defines which parts are valid
- */
-static
-const char *sprintf_a2na ( char *str, size_t ssize,
-    nucreg_t buffer, nucreg_t pattern, nucreg_t mask )
-{
-    nucpat_t bp, pp, mp;
-    int s, b, m, i, j, k, l, s_ch, b_ch;
-    const char *ncbi2na = "    ????????ACGT";
-
-    if ( ssize <= sizeof bp * 4 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( bp, buffer );
-    COPY_NUCREG ( pp, pattern );
-    COPY_NUCREG ( mp, mask );
-
-    for ( i = j = 0; i < sizeof bp . b; j += 4, ++ i )
-    {
-        s = bp . b [ i ];
-        b = pp . b [ i ];
-        m = ( int ) mp . b [ i ] << 2;
-
-        for ( k = 0, l = 6; k < 4; l -= 2, ++ k )
-        {
-            s_ch = ncbi2na [ 12 | ( ( s >> l ) & 3 ) ];
-            b_ch = ncbi2na [ ( ( m >> l ) & 12 ) | ( ( b >> l ) & 3 ) ];
-            str [ j + k ] = ( s_ch == b_ch ) ? ( char ) b_ch : ( char ) tolower ( b_ch );
-        }
-    }
-
-    str [ sizeof bp * 4 ] = 0;
-
-    return str;
-}
-
-/* sprintf_a4na
- *  print 4na alignment, where buffer has source,
- *  pattern has some set of valid pattern bases,
- *  and mask defines which parts are valid
- */
-static
-const char *sprintf_a4na ( char *str, size_t ssize,
-    nucreg_t buffer, nucreg_t pattern, nucreg_t mask )
-{
-    nucpat_t bp, pp, mp;
-    int s, b, m, i, j, k, l, s_ch, b_ch;
-    const char *ncbi4na =
-        "                ????????????????????????????????????????????????"
-        "????????????????????????????????????????????????????????????????"
-        "????????????????????????????????????????????????????????????????"
-        "????????????????????????????????????????????????""-ACMGRSVTWYHKDBN";
-    /* the odd ??""- is to prevent a ??- trigraph for ~ */
-
-    if ( ssize <= sizeof bp * 2 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( bp, buffer );
-    COPY_NUCREG ( pp, pattern );
-    COPY_NUCREG ( mp, mask );
-
-    for ( i = j = 0; i < sizeof bp . b; j += 2, ++ i )
-    {
-        s = bp . b [ i ];
-        b = pp . b [ i ];
-        m = ( int ) mp . b [ i ] << 4;
-
-        for ( k = 0, l = 4; k < 2; l -= 4, ++ k )
-        {
-#if INTEL_INTRINSICS
-            s_ch = ncbi4na [ ( ( m >> l ) & 0xF0 ) | ( ( s >> l ) & 15 ) ];
-#else
-            s_ch = ncbi4na [ 0xF0 | ( ( s >> l ) & 15 ) ];
-#endif
-            b_ch = ncbi4na [ ( ( m >> l ) & 0xF0 ) | ( ( b >> l ) & 15 ) ];
-            str [ j + k ] =
-                ( ( fasta_4na_map [ s_ch ] & fasta_4na_map [ b_ch ] ) != 0 ) ?
-                ( char ) s_ch : ( char ) tolower ( b_ch );
-        }
-    }
-
-    str [ sizeof bp * 2 ] = 0;
-
-    return str;
-}
-
-/* sprintf_r2na
- *  print results of 2na comparison
- */
-static
-const char *sprintf_r2na ( char *str, size_t ssize, nucreg_t result, nucreg_t mask )
-{
-    nucpat_t rp;
-    int b, i, j;
-    const char *amask = " ??x";
-
-    if ( ssize <= sizeof rp * 4 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( rp, result );
-
-    for ( i = j = 0; i < sizeof rp . b; j += 4, ++ i )
-    {
-        b = rp . b [ i ];
-        str [ j + 0 ] = amask [ ( b >> 6 ) & 3 ];
-        str [ j + 1 ] = amask [ ( b >> 4 ) & 3 ];
-        str [ j + 2 ] = amask [ ( b >> 2 ) & 3 ];
-        str [ j + 3 ] = amask [ ( b >> 0 ) & 3 ];
-    }
-
-    str [ sizeof rp * 4 ] = 0;
-
-    return str;
-}
-
-static
-const char *sprintf_r4na ( char *str, size_t ssize, nucreg_t result, nucreg_t mask )
-{
-    int b, i, j;
-    nucpat_t rp;
-    const char *amask = " ??????????????x";
-
-    if ( ssize <= sizeof rp * 2 )
-        return "** BUFFER TOO SMALL **";
-
-    COPY_NUCREG ( rp, result );
-
-    for ( i = j = 0; i < sizeof rp . b; j += 2, ++ i )
-    {
-        b = rp . b [ i ];
-        str [ j + 0 ] = amask [ ( b >> 4 ) & 15 ];
-        str [ j + 1 ] = amask [ ( b >> 0 ) & 15 ];
-    }
-
-    str [ sizeof rp * 2 ] = 0;
-
-    return str;
-}
-
-#endif
-
-#if TRACE_OPERATIONS && TRACE_PARSE
-static
-void PARSE_2NA_PATTERN ( const char *fasta, size_t size,
-    nucpat_t pattern, nucpat_t mask )
-{
-#if INTEL_INTRINSICS
-    char str [ 65 ];
-    nucreg_t nr = _mm_loadu_si128 ( ( const __m128i* ) pattern . b );
-    nucreg_t nm = _mm_loadu_si128 ( ( const __m128i* ) mask . b );
-#else
-    char str [ 33 ];
-    nucreg_t nr = pattern;
-    nucreg_t nm = mask;
-#endif
-
-    assert ( size < sizeof str );
-    memcpy ( str, fasta, size );
-    str [ size ] = 0;
-
-    printf ( "  %s - original FASTA\n", str );
-    printf ( "  %s - pattern\n", sprintf_2na ( str, sizeof str, nr ) );
-    printf ( "  %s - mask\n", sprintf_m2na ( str, sizeof str, nm ) );
-}
-
-static
-void PARSE_4NA_PATTERN ( const char *fasta, size_t size,
-    nucpat_t pattern, nucpat_t mask )
-{
-#if INTEL_INTRINSICS
-    char str [ 33 ];
-    nucreg_t nr = _mm_loadu_si128 ( ( const __m128i* ) pattern . b );
-    nucreg_t nm = _mm_loadu_si128 ( ( const __m128i* ) mask . b );
-#else
-    char str [ 17 ];
-    nucreg_t nr = pattern;
-    nucreg_t nm = mask;
-#endif
-
-    assert ( size < sizeof str );
-    memcpy ( str, fasta, size );
-    str [ size ] = 0;
-
-    printf ( "  %s - original FASTA\n", str );
-    printf ( "  %s - pattern\n", sprintf_4na ( str, sizeof str, nr ) );
-    printf ( "  %s - mask\n", sprintf_m4na ( str, sizeof str, nm ) );
-}
-
-static
-void PARSE_2NA_SHIFT ( unsigned int idx, nucpat_t pattern, nucpat_t mask )
-{
-#if INTEL_INTRINSICS
-    char str [ 65 ];
-    nucreg_t nr = _mm_loadu_si128 ( ( const __m128i* ) pattern . b );
-    nucreg_t nm = _mm_loadu_si128 ( ( const __m128i* ) mask . b );
-#else
-    char str [ 33 ];
-    nucreg_t nr = pattern;
-    nucreg_t nm = mask;
-#endif
-
-    printf ( "  %s - pattern [ %u ]\n", sprintf_2na ( str, sizeof str, nr ), idx );
-    printf ( "  %s - mask [ %u ]\n", sprintf_m2na ( str, sizeof str, nm ), idx );
-}
-
-static
-void PARSE_4NA_SHIFT ( unsigned int idx, nucpat_t pattern, nucpat_t mask )
-{
-#if INTEL_INTRINSICS
-    char str [ 33 ];
-    nucreg_t nr = _mm_loadu_si128 ( ( const __m128i* ) pattern . b );
-    nucreg_t nm = _mm_loadu_si128 ( ( const __m128i* ) mask . b );
-#else
-    char str [ 17 ];
-    nucreg_t nr = pattern;
-    nucreg_t nm = mask;
-#endif
-
-    printf ( "  %s - pattern [ %u ]\n", sprintf_4na ( str, sizeof str, nr ), idx );
-    printf ( "  %s - mask [ %u ]\n", sprintf_m4na ( str, sizeof str, nm ), idx );
-}
-#else
-
-#define PARSE_2NA_PATTERN( fasta, size, pattern, mask ) \
-    ( void ) 0
-
-#define PARSE_4NA_PATTERN( fasta, size, pattern, mask ) \
-    ( void ) 0
-
-#define PARSE_2NA_SHIFT( idx, pattern, mask ) \
-    ( void ) 0
-
-#define PARSE_4NA_SHIFT( idx, pattern, mask ) \
-    ( void ) 0
-
-#endif
-
-#if TRACE_OPERATIONS && TRACE_HEADER
-
-static
-void ALIGN_2NA_HEADER ( nucreg_t buffer, unsigned int pos, unsigned int len )
-{
-    unsigned int i, j;
-#if INTEL_INTRINSICS
-    char str [ 65 ];
-    unsigned int end = pos + 63;
-    str [ 64 ] = 0;
-#else
-    char str [ 33 ];
-    unsigned int end = pos + 31;
-    str [ 32 ] = 0;
-#endif
-
-    /* line separator */
-    putchar ( '\n' );
-
-    /* print a position with vertical numerals */
-    if ( end >= 1000 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( i / 1000 );
-        printf ( "  %s\n", str );
-    }
-    if ( end >= 100 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( ( i / 100 ) % 10 );
-        printf ( "  %s\n", str );
-    }
-    if ( end >= 10 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( ( i / 10 ) % 10 );
-        printf ( "  %s\n", str );
-    }
-
-    for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-        str [ j ] = '0' + ( char) ( i % 10 );
-    printf ( "  %s\n", str );
-
-    /* now dump the buffer */
-    printf ( "  %s - buffer\n", sprintf_2na ( str, sizeof str, buffer ) );
-}
-
-static
-void ALIGN_4NA_HEADER ( nucreg_t buffer, unsigned int pos, unsigned int len )
-{
-    unsigned int i, j;
-#if INTEL_INTRINSICS
-    char str [ 33 ];
-    unsigned int end = pos + 31;
-    str [ 32 ] = 0;
-#else
-    char str [ 17 ];
-    unsigned int end = pos + 15;
-    str [ 16 ] = 0;
-#endif
-
-    /* line separator */
-    putchar ( '\n' );
-
-    /* print a position with vertical numerals */
-    if ( end >= 1000 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( i / 1000 );
-        printf ( "  %s\n", str );
-    }
-    if ( end >= 100 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( ( i / 100 ) % 10 );
-        printf ( "  %s\n", str );
-    }
-    if ( end >= 10 )
-    {
-        for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-            str [ j ] = '0' + ( char) ( ( i / 10 ) % 10 );
-        printf ( "  %s\n", str );
-    }
-
-    for ( i = pos, j = 0; i <= end; ++ j, ++ i )
-        str [ j ] = '0' + ( char) ( i % 10 );
-    printf ( "  %s\n", str );
-
-    /* now dump the buffer */
-    printf ( "  %s - buffer\n", sprintf_4na ( str, sizeof str, buffer ) );
-}
-
-#else
-
-#define ALIGN_2NA_HEADER( buffer, pos, len ) \
-    ( void ) 0
-
-#define ALIGN_4NA_HEADER( buffer, pos, len ) \
-    ( void ) 0
-
-#endif
-
-#if TRACE_OPERATIONS && TRACE_RESULT
-
-#if INTEL_INTRINSICS
-static
-void ALIGN_2NA_RESULT ( nucreg_t buffer, nucreg_t pat, nucreg_t mask,
-    nucreg_t cmp, int bits )
-{
-    unsigned int i;
-    char str [ 65 ];
-
-    char bstr [ 17 ];
-    for ( i = 0; i < 16; bits >>= 1, ++ i )
-        bstr [ i ] = '0' + ( bits & 1 );
-    bstr [ 16 ] = 0;
-
-#if TRACE_PATMASK
-    printf ( "  %s - pattern\n", sprintf_2na ( str, sizeof str, pat ) );
-    printf ( "  %s - mask\n", sprintf_m2na ( str, sizeof str, mask ) );
-#endif
-
-    /* dump alignment and re-compare */
-    printf ( "  %s - alignment\n", sprintf_a2na ( str, sizeof str, buffer, pat, mask ) );
-    printf ( "  %s ( 0b%s )\n", sprintf_r2na ( str, sizeof str, cmp, mask ), bstr );
-}
-
-static
-void ALIGN_4NA_RESULT ( nucreg_t buffer, nucreg_t pat, nucreg_t mask,
-    nucreg_t cmp, int bits )
-{
-    unsigned int i;
-    char str [ 33 ];
-
-    char bstr [ 17 ];
-    for ( i = 0; i < 16; bits >>= 1, ++ i )
-        bstr [ i ] = '0' + ( bits & 1 );
-    bstr [ 16 ] = 0;
-
-#if TRACE_PATMASK
-    printf ( "  %s - pattern\n", sprintf_4na ( str, sizeof str, pat ) );
-    printf ( "  %s - mask\n", sprintf_m4na ( str, sizeof str, mask ) );
-#endif
-
-    /* dump alignment and re-compare */
-    printf ( "  %s - alignment\n", sprintf_a4na ( str, sizeof str, buffer, pat, mask ) );
-    printf ( "  %s ( 0b%s )\n", sprintf_r4na ( str, sizeof str, cmp, mask ), bstr );
-}
-#else
-static
-void ALIGN_2NA_RESULT ( nucreg_t buffer, nucreg_t pat, nucreg_t mask, nucreg_t bits )
-{
-    char str [ 33 ];
-
-#if TRACE_PATMASK
-    printf ( "  %s - pattern\n", sprintf_2na ( str, sizeof str, pat ) );
-    printf ( "  %s - mask\n", sprintf_m2na ( str, sizeof str, mask ) );
-#endif
-
-    printf ( "  %s\n", sprintf_a2na ( str, sizeof str, buffer, pat, mask ) );
-    printf ( "  %s\n", sprintf_r2na ( str, sizeof str, bits, mask ) );
-}
-
-static
-void ALIGN_4NA_RESULT ( nucreg_t buffer, nucreg_t pat, nucreg_t mask, nucreg_t bits )
-{
-    char str [ 17 ];
-
-#if TRACE_PATMASK
-    printf ( "  %s - pattern\n", sprintf_4na ( str, sizeof str, pat ) );
-    printf ( "  %s - mask\n", sprintf_m4na ( str, sizeof str, mask ) );
-#endif
-
-    printf ( "  %s\n", sprintf_a4na ( str, sizeof str, buffer, pat, mask ) );
-    printf ( "  %s\n", sprintf_r4na ( str, sizeof str, bits, mask ) );
-}
-#endif
-
-#else
-
-#if INTEL_INTRINSICS
-#define ALIGN_2NA_RESULT( buffer, pat, mask, cmp, bits ) \
-    ( void ) 0
-#define ALIGN_4NA_RESULT( buffer, pat, mask, cmp, bits ) \
-    ( void ) 0
-#else
-#define ALIGN_2NA_RESULT( buffer, pat, mask, bits ) \
-    ( void ) 0
-#define ALIGN_4NA_RESULT( buffer, pat, mask, bits ) \
-    ( void ) 0
-#endif
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * NucStrExpr
- *  an expression
- */
-typedef NucStrstr NucStrExpr;
-
-enum
-{
-    type_2na_64,
-    type_4na_64,
-#if INTEL_INTRINSICS
-    type_2na_8,
-    type_2na_16,
-    type_2na_32,
-    type_2na_128,
-    type_4na_16,
-    type_4na_32,
-    type_4na_128,
-#endif
-    type_2na_pos,
-    type_4na_pos,
-    type_OP,
-    type_EXPR,
-
-    op_NOT,
-    op_HEAD,
-    op_TAIL,
-    op_AND,
-    op_OR
-};
-
-typedef struct NucStrFastaExpr NucStrFastaExpr;
-struct NucStrFastaExpr
-{
-    int32_t type;
-    uint32_t size;
-#if INTEL_INTRINSICS && ! USE_MEMALIGN
-    union
-    {
-        /* actual allocation for freeing
-           since struct pointer will be
-           16 byte aligned by code */
-        void *outer;
-        uint64_t align;
-    } u;
-#endif
-    struct
-    {
-        nucpat_t pattern;
-        nucpat_t mask;
-    } query [ 4 ];
-};
-
-#if USE_MEMALIGN
-#define NucStrFastaExprAlloc( sz ) \
-    memalign ( 16, sz )
-#elif INTEL_INTRINSICS
-static
-void *NucStrFastaExprAlloc ( size_t sz )
-{
-    void *outer = malloc ( sz + 16 );
-    if ( outer != NULL )
-    {
-        NucStrFastaExpr *e = ( void* )
-            ( ( ( size_t ) outer + 15 ) & ~ ( size_t ) 15 );
-        e -> u . outer = outer;
-        assert ( ( ( size_t ) & e -> query [ 0 ] . pattern & 15 ) == 0 );
-        assert ( ( ( size_t ) & e -> query [ 0 ] . mask & 15 ) == 0 );
-        return e;
-    }
-    return NULL;
-}
-#else
-#define NucStrFastaExprAlloc( sz ) \
-    malloc ( sz )
-#endif
-
-typedef struct NucStrOpExpr NucStrOpExpr;
-struct NucStrOpExpr
-{
-    int32_t type;
-    int32_t op;
-    NucStrExpr *left;
-    NucStrExpr *right;
-};
-
-typedef struct NucStrSubExpr NucStrSubExpr;
-struct NucStrSubExpr
-{
-    int32_t type;
-    int32_t op;
-    NucStrExpr *expr;
-};
-
-union  NucStrstr
-{
-    NucStrFastaExpr fasta;
-    NucStrOpExpr boolean;
-    NucStrSubExpr sub;
-};
-
-/* NucStrFastaExprMake
- *  initializes for comparison based upon type
- */
-static
-int NucStrFastaExprMake2 ( NucStrExpr **expr, int positional,
-    const char *fasta, size_t size )
-{
-    size_t i;
-    NucStrExpr *e;
-    nucpat_t pattern, mask;
-
-    /* still limiting bases */
-    if ( size > NA2_LIMIT )
-        return E2BIG;
-
-    e = NucStrFastaExprAlloc ( sizeof * e );
-    if ( e == NULL )
-        return errno;
-
-    * expr = e;
-    e -> fasta . size = ( uint32_t ) size;
-
-#if INTEL_INTRINSICS
-    /* translate FASTA to 2na */
-    for ( i = 0; i < size; ++ i )
-    {
-        uint8_t base = fasta_2na_map [ ( int ) fasta [ i ] ];
-        switch ( i & 3 )
-        {
-        case 0:
-            pattern . b [ i >> 2 ] = base << 6;
-            mask . b [ i >> 2 ] = 3 << 6;
-            break;
-        case 1:
-            pattern . b [ i >> 2 ] |= base << 4;
-            mask . b [ i >> 2 ] |= 3 << 4;
-            break;
-        case 2:
-            pattern . b [ i >> 2 ] |= base << 2;
-            mask . b [ i >> 2 ] |= 3 << 2;
-            break;
-        case 3:
-            pattern . b [ i >> 2 ] |= base;
-            mask . b [ i >> 2 ] |= 3;
-            break;
-        }
-    }
-
-    /* fill trailing with zeros */
-    for ( i = ( i + 3 ) >> 2; i < 16; ++ i )
-    {
-        pattern . b [ i ] = 0;
-        mask . b [ i ] = 0;
-    }
-
-    PARSE_2NA_PATTERN ( fasta, size, pattern, mask );
-
-    /* treat positional types specially */
-    if ( positional )
-    {
-        e -> fasta . type = type_2na_pos;
-    }
-
-    /* replicate for shorter queries */
-    else if ( size < 2 )
-    {
-        pattern . b [ 1 ] = pattern . b [ 0 ];
-        pattern . w [ 1 ] = pattern . w [ 0 ];
-        pattern . i [ 1 ] = pattern . i [ 0 ];
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-            
-        mask . b [ 1 ] = mask . b [ 0 ];
-        mask . w [ 1 ] = mask . w [ 0 ];
-        mask . i [ 1 ] = mask . i [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-            
-        e -> fasta . type = type_2na_8;
-    }
-    else if ( size < 6 )
-    {
-        pattern . w [ 1 ] = pattern . w [ 0 ];
-        pattern . i [ 1 ] = pattern . i [ 0 ];
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-            
-        mask . w [ 1 ] = mask . w [ 0 ];
-        mask . i [ 1 ] = mask . i [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-            
-        e -> fasta . type = type_2na_16;
-    }
-    else if ( size < 14 )
-    {
-        pattern . i [ 1 ] = pattern . i [ 0 ];
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-            
-        mask . i [ 1 ] = mask . i [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-            
-        e -> fasta . type = type_2na_32;
-    }
-    else if ( size < 30 )
-    {
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-            
-        e -> fasta . type = type_2na_64;
-    }
-    else
-    {
-        e -> fasta . type = type_2na_128;
-    }
-
-    e -> fasta . query [ 0 ] . pattern = pattern;
-    e -> fasta . query [ 0 ] . mask = mask;
-
-    /* byte swap the pattern and mask */
-    uint128_bswap ( & pattern . s );
-    uint128_bswap ( & mask . s );
-
-    /* now shifts should work as imagined */
-    uint128_shr ( & pattern . s, 2 );
-    uint128_shr ( & mask . s, 2 );
-        
-    /* restore the byte order for sse */
-    uint128_bswap_copy ( & e -> fasta . query [ 1 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 1 ] . mask . s, & mask . s );
-
-    uint128_shr ( & pattern . s, 2 );
-    uint128_shr ( & mask . s, 2 );
-        
-    uint128_bswap_copy ( & e -> fasta . query [ 2 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 2 ] . mask . s, & mask . s );
-
-    uint128_shr ( & pattern . s, 2 );
-    uint128_shr ( & mask . s, 2 );
-        
-    uint128_bswap_copy ( & e -> fasta . query [ 3 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 3 ] . mask . s, & mask . s );
-        
-#else
-    e -> fasta . type = positional ? type_2na_pos : type_2na_64;
-
-    for ( pattern . l = 0, i = 0; i < size; ++ i )
-    {
-        pattern . l <<= 2;
-
-        assert ( fasta [ i ] >= 0 );
-        assert ( fasta_2na_map [ ( int ) fasta [ i ] ] >= 0 );
-
-        pattern . l |= fasta_2na_map [ ( int ) fasta [ i ] ];
-    }
-
-    mask . l = ~ 0;
-    pattern . l <<= 64 - size - size;
-    mask . l <<= 64 - size - size;
-
-    PARSE_2NA_PATTERN ( fasta, size, pattern, mask );
-
-    e -> fasta . query [ 0 ] . pattern = pattern;
-    e -> fasta . query [ 1 ] . pattern . l = pattern . l >> 2;
-    e -> fasta . query [ 2 ] . pattern . l = pattern . l >> 4;
-    e -> fasta . query [ 3 ] . pattern . l = pattern . l >> 6;
-
-    e -> fasta . query [ 0 ] . mask = mask;
-    e -> fasta . query [ 1 ] . mask . l = mask . l >> 2;
-    e -> fasta . query [ 2 ] . mask . l = mask . l >> 4;
-    e -> fasta . query [ 3 ] . mask . l = mask . l >> 6;
-
-#endif
-
-    PARSE_2NA_SHIFT ( 0, e -> fasta . query [ 0 ] . pattern,
-        e -> fasta . query [ 0 ] . mask );
-    PARSE_2NA_SHIFT ( 1, e -> fasta . query [ 1 ] . pattern,
-        e -> fasta . query [ 1 ] . mask );
-    PARSE_2NA_SHIFT ( 2, e -> fasta . query [ 2 ] . pattern,
-        e -> fasta . query [ 2 ] . mask );
-    PARSE_2NA_SHIFT ( 3, e -> fasta . query [ 3 ] . pattern,
-        e -> fasta . query [ 3 ] . mask );
-
-    return 0;
-}
-
-static
-int NucStrFastaExprMake4 ( NucStrExpr **expr, int positional,
-    const char *fasta, size_t size )
-{
-    size_t i;
-    NucStrExpr *e;
-    nucpat_t pattern, mask;
-
-    /* still limiting bases */
-    if ( size > NA4_LIMIT )
-        return E2BIG;
-
-    e = NucStrFastaExprAlloc ( sizeof * e );
-    if ( e == NULL )
-        return errno;
-
-    * expr = e;
-    e -> fasta . size = ( uint32_t ) size;
-
-#if INTEL_INTRINSICS
-    /* translate FASTA to 4na */
-    for ( i = 0; i < size; ++ i )
-    {
-        uint16_t base = fasta_4na_map [ ( int ) fasta [ i ] ];
-        switch ( i & 3 )
-        {
-        case 0:
-            pattern . w [ i >> 2 ] = base << 4;
-            mask . w [ i >> 2 ] = 15 << 4;
-            break;
-        case 1:
-            pattern . w [ i >> 2 ] |= base << 0;
-            mask . w [ i >> 2 ] |= 15 << 0;
-            break;
-        case 2:
-            pattern . w [ i >> 2 ] |= base << 12;
-            mask . w [ i >> 2 ] |= 15 << 12;
-            break;
-        case 3:
-            pattern . w [ i >> 2 ] |= base << 8;
-            mask . w [ i >> 2 ] |= 15 << 8;
-            break;
-        }
-    }
-
-    /* fill trailing with zeros */
-    for ( i = ( i + 3 ) >> 2; i < 8; ++ i )
-    {
-        pattern . w [ i ] = 0;
-        mask . w [ i ] = 0;
-    }
-
-    PARSE_4NA_PATTERN ( fasta, size, pattern, mask );
-
-    if ( positional )
-    {
-        e -> fasta . type = type_4na_pos;
-    }
-    else if ( size < 2 )
-    {
-        pattern . w [ 1 ] = pattern . w [ 0 ];
-        pattern . i [ 1 ] = pattern . i [ 0 ];
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-            
-        mask . w [ 1 ] = mask . w [ 0 ];
-        mask . i [ 1 ] = mask . i [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-
-        e -> fasta . type = type_4na_16;
-    }
-    else if ( size < 6 )
-    {
-        pattern . i [ 1 ] = pattern . i [ 0 ];
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-            
-        mask . i [ 1 ] = mask . i [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-
-        e -> fasta . type = type_4na_32;
-    }
-    else if ( size < 14 )
-    {
-        pattern . l [ 1 ] = pattern . l [ 0 ];
-        mask . l [ 1 ] = mask . l [ 0 ];
-
-        e -> fasta . type = type_4na_64;
-    }
-    else
-    {
-        e -> fasta . type = type_4na_128;
-    }
-
-    e -> fasta . query [ 0 ] . pattern = pattern;
-    e -> fasta . query [ 0 ] . mask = mask;
-
-    /* byte swap the pattern and mask */
-    uint128_bswap ( & pattern . s );
-    uint128_bswap ( & mask . s );
-
-    /* now shifts should work as imagined */
-    uint128_shr ( & pattern . s, 4 );
-    uint128_shr ( & mask . s, 4 );
-        
-    /* restore the byte order for sse */
-    uint128_bswap_copy ( & e -> fasta . query [ 1 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 1 ] . mask . s, & mask . s );
-
-    uint128_shr ( & pattern . s, 4 );
-    uint128_shr ( & mask . s, 4 );
-        
-    uint128_bswap_copy ( & e -> fasta . query [ 2 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 2 ] . mask . s, & mask . s );
-
-    uint128_shr ( & pattern . s, 4 );
-    uint128_shr ( & mask . s, 4 );
-        
-    uint128_bswap_copy ( & e -> fasta . query [ 3 ] . pattern . s, & pattern . s );
-    uint128_bswap_copy ( & e -> fasta . query [ 3 ] . mask . s, & mask . s );
-
-#else
-    e -> fasta . type = positional ? type_4na_pos : type_4na_64;
-
-    for ( pattern . l = 0, i = 0; i < size; ++ i )
-    {
-        pattern . l <<= 4;
-
-        assert ( fasta [ i ] >= 0 );
-        assert ( fasta_4na_map [ ( int ) fasta [ i ] ] >= 0 );
-
-        pattern . l |= fasta_4na_map [ ( int ) fasta [ i ] ];
-    }
-
-    mask . l = ~ 0;
-    pattern . l <<= 64 - ( size << 2 );
-    mask . l <<= 64 - ( size << 2 );
-
-    PARSE_4NA_PATTERN ( fasta, size, pattern, mask );
-
-    e -> fasta . query [ 0 ] . pattern = pattern;
-    e -> fasta . query [ 1 ] . pattern . l = pattern . l >> 4;
-    e -> fasta . query [ 2 ] . pattern . l = pattern . l >> 8;
-    e -> fasta . query [ 3 ] . pattern . l = pattern . l >> 12;
-
-    e -> fasta . query [ 0 ] . mask = mask;
-    e -> fasta . query [ 1 ] . mask . l = mask . l >> 4;
-    e -> fasta . query [ 2 ] . mask . l = mask . l >> 8;
-    e -> fasta . query [ 3 ] . mask . l = mask . l >> 12;
-
-#endif
-
-    PARSE_4NA_SHIFT ( 0, e -> fasta . query [ 0 ] . pattern,
-        e -> fasta . query [ 0 ] . mask );
-    PARSE_4NA_SHIFT ( 1, e -> fasta . query [ 1 ] . pattern,
-        e -> fasta . query [ 1 ] . mask );
-    PARSE_4NA_SHIFT ( 2, e -> fasta . query [ 2 ] . pattern,
-        e -> fasta . query [ 2 ] . mask );
-    PARSE_4NA_SHIFT ( 3, e -> fasta . query [ 3 ] . pattern,
-        e -> fasta . query [ 3 ] . mask );
-
-    return 0;
-}
-
-
-/* nss_sob
- */
-static
-const char *nss_sob ( const char *p, const char *end )
-{
-    while ( p < end && isspace ( * ( const uint8_t* ) p ) )
-        ++ p;
-    return p;
-}
-
-/* nss_FASTA_expr
- */
-static
-const char *nss_FASTA_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    if ( p >= end )
-        * status = EINVAL;
-    else
-    {
-        const char *start = p;
-
-        int32_t type = type_2na_64;
-        const int8_t *map = fasta_2na_map;
-        do
-        {
-            if ( * p < 0 )
-                break;
-
-            if ( map [ * ( const uint8_t* ) p ] < 0 )
-            {
-                if ( map == fasta_4na_map )
-                    break;
-                if ( fasta_4na_map [ * ( const uint8_t* ) p ] < 0 )
-                    break;
-                type = type_4na_64;
-                map = fasta_4na_map;
-            }
-        }
-        while ( ++ p < end );
-
-        if ( p <= start )
-            * status = EINVAL;
-        else if ( type == type_2na_64 )
-            * status = NucStrFastaExprMake2 ( expr, positional, start, p - start );
-        else
-            * status = NucStrFastaExprMake4 ( expr, positional, start, p - start );
-    }
-
-    return p;
-}
-
-/* nss_fasta_expr
- */
-static
-const char *nss_fasta_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    assert ( p < end );
-    switch ( * p )
-    {
-    case '\'':
-        p = nss_FASTA_expr ( p + 1, end, expr, status, positional );
-        if ( * status == 0 && ( p == end || * p ++ != '\'' ) )
-            * status = EINVAL;
-        break;
-    case '"':
-        p = nss_FASTA_expr ( p + 1, end, expr, status, positional );
-        if ( * status == 0 && ( p == end || * p ++ != '"' ) )
-            * status = EINVAL;
-        break;
-    default:
-        return nss_FASTA_expr ( p, end, expr, status, positional );
-    }
-
-    return p;
-}
-
-/* nss_position_expr
- */
-#if ENABLE_AT_EXPR
-static
-const char *nss_position_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    assert ( p < end );
-    if ( * p == '@' )
-    {
-        p = nss_sob ( p + 1, end );
-        if ( p == end )
-        {
-            * status = EINVAL;
-            return p;
-        }
-        positional = 1;
-    }
-
-    return nss_fasta_expr ( p, end, expr, status, positional );
-}
-#else
-#define nss_position_expr( p, end, expr, status, positional ) \
-    nss_fasta_expr ( p, end, expr, status, positional )
-#endif
-
-/* forward */
-static
-const char *nss_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional );
-
-/* nss_primary_expr
- */
-static
-const char *nss_primary_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    NucStrExpr *e;
-
-    assert ( p < end );
-    switch ( * p )
-    {
-    case '^':
-        e = malloc ( sizeof e -> sub );
-        if ( e == NULL )
-            * status = errno;
-        else
-        {
-            e -> sub . type = type_EXPR;
-            e -> sub . op = op_HEAD;
-            e -> sub . expr = NULL;
-            * expr = e;
-
-            p = nss_sob ( p + 1, end );
-            p = nss_position_expr ( p, end, & e -> sub . expr, status, positional );
-        }
-        return p;
-    case '(':
-        e = malloc ( sizeof e -> sub );
-        if ( e == NULL )
-            * status = errno;
-        else
-        {
-            e -> sub . type = type_EXPR;
-            e -> sub . op = 0;
-            * expr = e;
-
-            p = nss_expr ( p + 1, end, & e -> sub . expr, status, positional );
-            if ( * status == 0 )
-            {
-                if ( e -> sub . expr == NULL || p == end || * p ++ != ')' )
-                    * status = EINVAL;
-            }
-        }
-        return p;
-    }
-
-    p = nss_position_expr ( p, end, expr, status, positional );
-    if ( * status == 0 && p < end )
-    {
-        p = nss_sob ( p, end );
-        if ( p < end && * p == '$' )
-        {
-            ++ p;
-
-            e = malloc ( sizeof e -> sub );
-            if ( e == NULL )
-                * status = errno;
-            else
-            {
-                e -> sub . type = type_EXPR;
-                e -> sub . op = op_TAIL;
-                e -> sub . expr = * expr;
-                * expr = e;
-            }
-        }
-    }
-
-    return p;
-}
-
-/* nss_unary_expr
- */
-static
-const char *nss_unary_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    assert ( p < end );
-    if ( * p != '!' )
-        return nss_primary_expr ( p, end, expr, status, positional );
-
-#if ! ALLOW_POSITIONAL_OPERATOR_MIX
-    if ( positional )
-    {
-        * status = EINVAL;
-        return p;
-    }
-#endif
-
-    p = nss_sob ( p + 1, end );
-    if ( p == end )
-        * status = EINVAL;
-    else
-    {
-        NucStrExpr *e = malloc ( sizeof e -> sub );
-        if ( e == NULL )
-            * status = errno;
-        else
-        {
-            e -> sub . type = type_EXPR;
-            e -> sub . op = op_NOT;
-            e -> sub . expr = NULL;
-            * expr = e;
-            
-            p = nss_unary_expr ( p, end, & e -> sub . expr, status, positional );
-            assert ( * status != 0 || e -> sub . expr != NULL );
-        }
-    }
-    return p;
-}
-
-/* nss_expr
- *
- *   expr        : <unary_expr>
- *               | <unary_expr> <boolean_op> <expr>
- *
- *   boolean_op  : '&', '|', '&&', '||'
- */
-static
-const char *nss_expr ( const char *p, const char *end,
-    NucStrExpr **expr, int *status, int positional )
-{
-    * expr = NULL;
-
-    p = nss_sob ( p, end );
-    if ( p != end )
-    {
-        p = nss_unary_expr ( p, end, expr, status, positional );
-        if ( * status == 0 )
-        {
-            p = nss_sob ( p, end );
-            if ( p != end )
-            {
-                int32_t op;
-                NucStrExpr *e;
-                assert ( * expr != NULL );
-
-                switch ( * p ++ )
-                {
-                case ')':
-                    return p - 1;
-                case '&':
-                    if ( p < end && * p == '&' )
-                        ++ p;
-                    op = op_AND;
-                    break;
-                case '|':
-                    if ( p < end && * p == '|' )
-                        ++ p;
-                    op = op_OR;
-                    break;
-                default:
-                    /* unrecognized or missing operator */
-                    * status = EINVAL;
-                    return p - 1;
-                }
-
-#if ! ALLOW_POSITIONAL_OPERATOR_MIX
-                /* boolean operators do not work in positional mode */
-                if ( positional )
-                {
-                    * status = EINVAL;
-                    return p - 1;
-                }
-#endif
-
-                e = malloc ( sizeof e -> boolean );
-                if ( e == NULL )
-                {
-                    * status = errno;
-                    return p;
-                }
-
-                e -> boolean . type = type_OP;
-                e -> boolean . op = op;
-                e -> boolean . left = * expr;
-                * expr = e;
-
-                /* evaluate right-hand */
-                p = nss_expr ( p, end, & e -> boolean . right, status, positional );
-                assert ( * status != 0 || e -> boolean . right != NULL );
-            }
-        }
-    }
-
-    return p;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * NucStrstr
- *  prepared handle for nucleotide k-mer strstr expression
- */
-
-/* NucStrstrInit
- */
-static
-void NucStrstrInit ( void )
-{
-    int ch;
-    unsigned int i;
-    const char *p, *ncbi2na = "ACGT";
-    const char *ncbi4na = "-ACMGRSVTWYHKDBN";
-
-    /* illegal under most conditions */
-    memset ( fasta_2na_map, -1, sizeof fasta_2na_map );
-    memset ( fasta_4na_map, -1, sizeof fasta_4na_map );
-        
-    /* legal ncbi2na alphabet */
-    for ( i = 0, p = ncbi2na; p [ 0 ] != 0; ++ i, ++ p )
-    {
-        ch = p [ 0 ];
-        fasta_2na_map [ ch ] = fasta_2na_map [ tolower ( ch ) ] = ( int8_t ) i;
-    }
-        
-    /* legal ncbi4na alphabet */
-    for ( i = 0, p = ncbi4na; p [ 0 ] != 0; ++ i, ++ p )
-    {
-        ch = p [ 0 ];
-        fasta_4na_map [ ch ] = fasta_4na_map [ tolower ( ch ) ] = ( int8_t ) i;
-    }
-
-#if INTEL_INTRINSICS
-    /* byte swap the 2na expand map */
-    for ( i = 0; i < 256; ++ i )
-        expand_2na [ i ] = bswap_16 ( expand_2na [ i ] );
-#endif
-}
-
-/* NucStrstrMake
- *  prepares search by parsing expression query string
- *  returns error if conversion was not possible.
- *
- *  "nss" [ OUT ] - return parameter for one-time search handle
- *
- *  "positional" [ IN ] - if non-zero, build an expression tree
- *  to return found position rather than simply a Boolean found.
- *  see NucStrstrSearch.
- *
- *  "query" [ IN ] and "len" [ IN ] - query string expression, such that:
- *       expr           : <primary_expr>
- *                      | <primary_expr> <boolean_op> <expr>
- *       primary_expr   : FASTA
- *                      | "'" FASTA "'"
- *                      | '"' FASTA '"'
- *                      | '(' <expr> ')'
- *       boolean_op     : '&', '|', '&&', '||'
- *
- *  return values:
- *    EINVAL - invalid parameter or invalid expression
- */
-LIB_EXPORT int CC NucStrstrMake ( NucStrstr **nss, int positional,
-    const char *query, unsigned int len )
-{
-    if ( nss != NULL )
-    {
-        if ( query != NULL && len != 0 )
-        {
-            int status = 0;
-            const char *end;
-
-            if ( fasta_2na_map [ 0 ] == 0 )
-                NucStrstrInit ();
-
-            end = query + len;
-            query = nss_expr ( query, end, nss, & status, positional );
-            if ( status == 0 )
-            {
-                if ( query == end )
-                    return 0;
-
-                status = EINVAL;
-            }
-
-            NucStrstrWhack ( * nss );
-            * nss = NULL;
-            return status;
-        }
-
-        * nss = NULL;
-    }
-    return EINVAL;
-}
-
-/* NucStrstrWhack
- *  discard structure when no longer needed
- */
-LIB_EXPORT void CC NucStrstrWhack ( NucStrstr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> fasta . type )
-        {
-        case type_2na_64:
-        case type_4na_64:
-#if INTEL_INTRINSICS
-        case type_2na_8:
-        case type_2na_16:
-        case type_2na_32:
-        case type_2na_128:
-        case type_4na_16:
-        case type_4na_32:
-        case type_4na_128:
-#endif
-        case type_2na_pos:
-        case type_4na_pos:
-#if INTEL_INTRINSICS && ! USE_MEMALIGN
-            self = self -> fasta . u . outer;
-#endif
-            break;
-        case type_OP:
-            NucStrstrWhack ( self -> boolean . left );
-            NucStrstrWhack ( self -> boolean . right );
-            break;
-        case type_EXPR:
-            NucStrstrWhack ( self -> sub . expr );
-        }
-
-        free ( self );
-    }
-}
-
-
-                        
-/*--------------------------------------------------------------------------
- * expression evaluation
- */
-#if ! INTEL_INTRINSICS
-static
-int eval_2na_64 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-    int count;
-    uint64_t ra, rb, rc, rd;
-
-#if ENDLESS_BUFFER
-    uint64_t buffer;
-#else
-    nucpat_t bp;
-#define buffer bp.l
-    const uint8_t *end;
-#endif
-    const uint8_t *src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-#if TRACE_OPERATIONS
-    unsigned int tpos = pos & ~ 3;
-    unsigned int align_len = len + ( pos & 3 );
-#endif
-
-    if ( len < self -> size )
-        return 0;
-
-#if ENDLESS_BUFFER
-    /* prime source buffer */
-    buffer = bswap_64 ( * ( const uint64_t* ) src );
-#else
-    /* accumulate entry position into length */
-    end = src + ( ( len + ( pos & 3 ) + 3 ) >> 2 );
-
-    /* prime source buffer */
-    bp . l = 0; /* defined above as "buffer" */
-    switch ( end - src )
-    {
-    default:
-        bp . b [ 0 ] = src [ 7 ];
-    case 7:
-        bp . b [ 1 ] = src [ 6 ];
-    case 6:
-        bp . b [ 2 ] = src [ 5 ];
-    case 5:
-        bp . b [ 3 ] = src [ 4 ];
-    case 4:
-        bp . b [ 4 ] = src [ 3 ];
-    case 3:
-        bp . b [ 5 ] = src [ 2 ];
-    case 2:
-        bp . b [ 6 ] = src [ 1 ];
-    case 1:
-        bp . b [ 7 ] = src [ 0 ];
-    }
-#endif
-
-    /* prime compare results */
-    ra = rb = rc = ~ 0;
-
-    /* position src at buffer end for loop */
-    src += 8;
-
-    /* evaluate at initial position */
-    ALIGN_2NA_HEADER ( buffer, tpos, align_len );
-    switch ( pos & 3 )
-    {
-    case 0:
-        ra = ( buffer ^ self -> query [ 0 ] . pattern . l ) & self -> query [ 0 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-    case 1:
-        rb = ( buffer ^ self -> query [ 1 ] . pattern . l ) & self -> query [ 1 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-    case 2:
-        rc = ( buffer ^ self -> query [ 2 ] . pattern . l ) & self -> query [ 2 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-    case 3:
-        rd = ( buffer ^ self -> query [ 3 ] . pattern . l ) & self -> query [ 3 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    /* loop on the number of shifts */
-    for ( count = ( int ) ( len - self -> size ); count >= 3; count -= 4 )
-    {
-        /* exit condition within sequence */
-        if ( ( ra & rb & rc & rd ) == 0 )
-            return 1;
-
-        /* get next 2na byte */
-        buffer <<= 8;
-#if ENDLESS_BUFFER
-        buffer |= * src ++;
-#else
-        if ( src < end )
-            bp . b [ 0 ] = * src ++;
-#endif
-
-#if TRACE_OPERATIONS
-        tpos = ( tpos + 4 ) & ~ 3;
-        ALIGN_2NA_HEADER ( buffer, tpos, align_len );
-#endif
-
-        /* test at this position */
-        ra = ( buffer ^ self -> query [ 0 ] . pattern . l ) & self -> query [ 0 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-        rb = ( buffer ^ self -> query [ 1 ] . pattern . l ) & self -> query [ 1 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-        rc = ( buffer ^ self -> query [ 2 ] . pattern . l ) & self -> query [ 2 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-        rd = ( buffer ^ self -> query [ 3 ] . pattern . l ) & self -> query [ 3 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    switch ( ( pos + count ) & 3 )
-    {
-    case 2:
-        if ( ! rc ) return 1;
-    case 1:
-        if ( ! rb ) return 1;
-    case 0:
-        if ( ! ra ) return 1;
-    }
-
-    return 0;
-
-#undef buffer
-}
-
-static
-int eval_2na_pos ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-    int i, count;
-    uint64_t ra, rb, rc, rd;
-
-#if ENDLESS_BUFFER
-    uint64_t buffer;
-#else
-    nucpat_t bp;
-#define buffer bp.l
-    const uint8_t *end;
-#endif
-    const uint8_t *src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-#if TRACE_OPERATIONS
-    unsigned int tpos = pos & ~ 3;
-    unsigned int align_len = len + ( pos & 3 );
-#endif
-
-    if ( len < self -> size )
-        return 0;
-
-#if ENDLESS_BUFFER
-    /* prime source buffer */
-    buffer = bswap_64 ( * ( const uint64_t* ) src );
-#else
-    /* accumulate entry position into length */
-    end = src + ( ( len + ( pos & 3 ) + 3 ) >> 2 );
-
-    /* prime source buffer */
-    bp . l = 0; /* defined above as "buffer" */
-    switch ( end - src )
-    {
-    default:
-        bp . b [ 0 ] = src [ 7 ];
-    case 7:
-        bp . b [ 1 ] = src [ 6 ];
-    case 6:
-        bp . b [ 2 ] = src [ 5 ];
-    case 5:
-        bp . b [ 3 ] = src [ 4 ];
-    case 4:
-        bp . b [ 4 ] = src [ 3 ];
-    case 3:
-        bp . b [ 5 ] = src [ 2 ];
-    case 2:
-        bp . b [ 6 ] = src [ 1 ];
-    case 1:
-        bp . b [ 7 ] = src [ 0 ];
-    }
-#endif
-
-    /* prime compare results */
-    ra = rb = rc = ~ 0;
-
-    /* position src at buffer end for loop */
-    src += 8;
-
-    /* evaluate at initial position */
-    ALIGN_2NA_HEADER ( buffer, tpos, align_len );
-    i = 0 - ( int ) ( pos & 3 );
-    switch ( pos & 3 )
-    {
-    case 0:
-        ra = ( buffer ^ self -> query [ 0 ] . pattern . l ) & self -> query [ 0 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-    case 1:
-        rb = ( buffer ^ self -> query [ 1 ] . pattern . l ) & self -> query [ 1 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-    case 2:
-        rc = ( buffer ^ self -> query [ 2 ] . pattern . l ) & self -> query [ 2 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-    case 3:
-        rd = ( buffer ^ self -> query [ 3 ] . pattern . l ) & self -> query [ 3 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    /* loop on the number of shifts */
-    for ( count = ( int ) ( len - self -> size ); count >= 3; i += 4, count -= 4 )
-    {
-        /* exit condition within sequence */
-        if ( ! ra )
-            return i + 1;
-        if ( ! rb )
-            return i + 2;
-        if ( ! rc )
-            return i + 3;
-        if ( ! rd )
-            return i + 4;
-
-        /* get next 2na byte */
-        buffer <<= 8;
-#if ENDLESS_BUFFER
-        buffer |= * src ++;
-#else
-        if ( src < end )
-            bp . b [ 0 ] = * src ++;
-#endif
-
-#if TRACE_OPERATIONS
-        tpos = ( tpos + 4 ) & ~ 3;
-        ALIGN_2NA_HEADER ( buffer, tpos, align_len );
-#endif
-
-        /* test at this position */
-        ra = ( buffer ^ self -> query [ 0 ] . pattern . l ) & self -> query [ 0 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-        rb = ( buffer ^ self -> query [ 1 ] . pattern . l ) & self -> query [ 1 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-        rc = ( buffer ^ self -> query [ 2 ] . pattern . l ) & self -> query [ 2 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-        rd = ( buffer ^ self -> query [ 3 ] . pattern . l ) & self -> query [ 3 ] . mask . l;
-        ALIGN_2NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    switch ( ( pos + count ) & 3 )
-    {
-    case 0:
-        if ( ! ra ) return i + 1;
-        break;
-    case 1:
-        if ( ! ra ) return i + 1;
-        if ( ! rb ) return i + 2;
-        break;
-    case 2:
-        if ( ! ra ) return i + 1;
-        if ( ! rb ) return i + 2;
-        if ( ! rc ) return i + 3;
-    }
-
-    return 0;
-
-#undef buffer
-}
-
-static
-int eval_4na_64 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-    int count;
-    uint64_t buffer;
-    uint64_t ra, rb, rc, rd;
-#if ! ENDLESS_BUFFER
-    const uint8_t *end;
-#endif
-    const uint8_t *src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-#if TRACE_OPERATIONS
-    unsigned int tpos = pos & ~ 3;
-    unsigned int align_len = len + ( pos & 3 );
-#endif
-
-    if ( len < self -> size )
-        return 0;
-
-#if ENDLESS_BUFFER
-    buffer = expand_2na [ src [ 3 ] ];
-    buffer |= ( uint32_t ) expand_2na [ src [ 2 ] ] << 16;
-    buffer |= ( uint64_t ) expand_2na [ src [ 1 ] ] << 32;
-    buffer |= ( uint64_t ) expand_2na [ src [ 0 ] ] << 48;
-#else
-    /* accumulate entry position into length */
-    end = src + ( ( len + ( pos & 3 ) + 3 ) >> 2 );
-
-    /* prime source buffer */
-    buffer = 0;
-    switch ( end - src )
-    {
-    default:
-        buffer |= expand_2na [ src [ 3 ] ];
-    case 3:
-        buffer |= ( uint32_t ) expand_2na [ src [ 2 ] ] << 16;
-    case 2:
-        buffer |= ( uint64_t ) expand_2na [ src [ 1 ] ] << 32;
-    case 1:
-        buffer |= ( uint64_t ) expand_2na [ src [ 0 ] ] << 48;
-    }
-#endif
-
-    /* prime compare results */
-    ra = rb = rc = rd = ~ 0;
-
-    /* position src at buffer end for loop */
-    src += 4;
-
-    /* evaluate at initial position */
-    ALIGN_4NA_HEADER ( buffer, tpos, align_len );
-    switch ( pos & 3 )
-    {
-    case 0:
-        ra = ( buffer & self -> query [ 0 ] . pattern . l )
-            ^ ( buffer & self -> query [ 0 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-    case 1:
-        rb = ( buffer & self -> query [ 1 ] . pattern . l )
-            ^ ( buffer & self -> query [ 1 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-    case 2:
-        rc = ( buffer & self -> query [ 2 ] . pattern . l )
-            ^ ( buffer & self -> query [ 2 ] . mask . l ) ;
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-    case 3:
-        rd = ( buffer & self -> query [ 3 ] . pattern . l )
-            ^ ( buffer & self -> query [ 3 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    for ( count = ( int ) ( len - self -> size ); count >= 3; count -= 4 )
-    {
-        /* exit condition within sequence */
-        if ( ( ra & rb & rc & rd ) == 0 )
-            return 1;
-
-        /* shuffle in next byte in 4na */
-        buffer <<= 16;
-#if ! ENDLESS_BUFFER
-        if ( src < end )
-#endif
-            buffer |= expand_2na [ * src ++ ];
-
-#if TRACE_OPERATIONS
-        tpos = ( tpos + 4 ) & ~ 3;
-        ALIGN_4NA_HEADER ( buffer, tpos, align_len );
-#endif
-
-        /* test at this position */
-        ra = ( buffer & self -> query [ 0 ] . pattern . l )
-            ^ ( buffer & self -> query [ 0 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-        rb = ( buffer & self -> query [ 1 ] . pattern . l )
-            ^ ( buffer & self -> query [ 1 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-        rc = ( buffer & self -> query [ 2 ] . pattern . l )
-            ^ ( buffer & self -> query [ 2 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-        rd = ( buffer & self -> query [ 3 ] . pattern . l )
-            ^ ( buffer & self -> query [ 3 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    switch ( ( pos + count ) & 3 )
-    {
-    case 2:
-        if ( ! rc ) return 1;
-    case 1:
-        if ( ! rb ) return 1;
-    case 0:
-        if ( ! ra ) return 1;
-    }
-
-    return 0;
-}
-
-static
-int eval_4na_pos ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-    int i, count;
-    uint64_t buffer;
-    uint64_t ra, rb, rc, rd;
-#if ! ENDLESS_BUFFER
-    const uint8_t *end;
-#endif
-    const uint8_t *src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-#if TRACE_OPERATIONS
-    unsigned int tpos = pos & ~ 3;
-    unsigned int align_len = len + ( pos & 3 );
-#endif
-
-    if ( len < self -> size )
-        return 0;
-
-#if ENDLESS_BUFFER
-    buffer = expand_2na [ src [ 3 ] ];
-    buffer |= ( uint32_t ) expand_2na [ src [ 2 ] ] << 16;
-    buffer |= ( uint64_t ) expand_2na [ src [ 1 ] ] << 32;
-    buffer |= ( uint64_t ) expand_2na [ src [ 0 ] ] << 48;
-#else
-    /* accumulate entry position into length */
-    end = src + ( ( len + ( pos & 3 ) + 3 ) >> 2 );
-
-    /* prime source buffer */
-    buffer = 0;
-    switch ( end - src )
-    {
-    default:
-        buffer |= expand_2na [ src [ 3 ] ];
-    case 3:
-        buffer |= ( uint32_t ) expand_2na [ src [ 2 ] ] << 16;
-    case 2:
-        buffer |= ( uint64_t ) expand_2na [ src [ 1 ] ] << 32;
-    case 1:
-        buffer |= ( uint64_t ) expand_2na [ src [ 0 ] ] << 48;
-    }
-#endif
-
-    /* prime compare results */
-    ra = rb = rc = rd = ~ 0;
-
-    /* position src at buffer end for loop */
-    src += 4;
-
-    /* evaluate at initial position */
-    ALIGN_4NA_HEADER ( buffer, tpos, align_len );
-    i = 0 - ( int ) ( pos & 3 );
-    switch ( pos & 3 )
-    {
-    case 0:
-        ra = ( buffer & self -> query [ 0 ] . pattern . l )
-            ^ ( buffer & self -> query [ 0 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-    case 1:
-        rb = ( buffer & self -> query [ 1 ] . pattern . l )
-            ^ ( buffer & self -> query [ 1 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-    case 2:
-        rc = ( buffer & self -> query [ 2 ] . pattern . l )
-            ^ ( buffer & self -> query [ 2 ] . mask . l ) ;
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-    case 3:
-        rd = ( buffer & self -> query [ 3 ] . pattern . l )
-            ^ ( buffer & self -> query [ 3 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    for ( count = ( int ) ( len - self -> size ); count >= 3; i += 4, count -= 4 )
-    {
-        /* exit condition within sequence */
-        if ( ! ra )
-            return i + 1;
-        if ( ! rb )
-            return i + 2;
-        if ( ! rc )
-            return i + 3;
-        if ( ! rd )
-            return i + 4;
-
-        /* shuffle in next byte in 4na */
-        buffer <<= 16;
-#if ! ENDLESS_BUFFER
-        if ( src < end )
-#endif
-            buffer |= expand_2na [ * src ++ ];
-
-#if TRACE_OPERATIONS
-        tpos = ( tpos + 4 ) & ~ 3;
-        ALIGN_4NA_HEADER ( buffer, tpos, align_len );
-#endif
-
-        /* test at this position */
-        ra = ( buffer & self -> query [ 0 ] . pattern . l )
-            ^ ( buffer & self -> query [ 0 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 0 ] . pattern . l, self -> query [ 0 ] . mask . l, ra );
-        rb = ( buffer & self -> query [ 1 ] . pattern . l )
-            ^ ( buffer & self -> query [ 1 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 1 ] . pattern . l, self -> query [ 1 ] . mask . l, rb );
-        rc = ( buffer & self -> query [ 2 ] . pattern . l )
-            ^ ( buffer & self -> query [ 2 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 2 ] . pattern . l, self -> query [ 2 ] . mask . l, rc );
-        rd = ( buffer & self -> query [ 3 ] . pattern . l )
-            ^ ( buffer & self -> query [ 3 ] . mask . l );
-        ALIGN_4NA_RESULT ( buffer, self -> query [ 3 ] . pattern . l, self -> query [ 3 ] . mask . l, rd );
-    }
-
-    switch ( ( pos + count ) & 3 )
-    {
-    case 0:
-        if ( ! ra ) return i + 1;
-        break;
-    case 1:
-        if ( ! ra ) return i + 1;
-        if ( ! rb ) return i + 2;
-        break;
-    case 2:
-        if ( ! ra ) return i + 1;
-        if ( ! rb ) return i + 2;
-        if ( ! rc ) return i + 3;
-    }
-
-    return 0;
-}
-
-#else /* INTEL_INTRINSICS */
-
-#if ENDLESS_BUFFER
-static __inline__
-__m128i prime_buffer_2na ( const uint8_t *src, const uint8_t *ignore )
-{
-    __m128i buffer;
-    ( void ) ignore;
-    if ( ( ( size_t ) src & 15 ) == 0 )
-        buffer = _mm_load_si128 ( ( const __m128i* ) src );
-    else
-        buffer = _mm_loadu_si128 ( ( const __m128i* ) src );
-    return buffer;
-}
-#else
-static __inline__
-__m128i prime_buffer_2na ( const uint8_t *src, const uint8_t *end )
-{
-    size_t bytes;
-    __m128i buffer;
-
-    if ( ( bytes = end - src ) >= 16 )
-    {
-        if ( ( ( size_t ) src & 15 ) == 0 )
-            buffer = _mm_load_si128 ( ( const __m128i* ) src );
-        else
-            buffer = _mm_loadu_si128 ( ( const __m128i* ) src );
-    }
-    else
-    {
-        nucpat_t tmp;
-
-        /* common for Solexa */
-        if ( bytes == 7 )
-        {
-            tmp . b [ 0 ] = src [ 0 ];
-            tmp . b [ 1 ] = src [ 1 ];
-            tmp . b [ 2 ] = src [ 2 ];
-            tmp . b [ 3 ] = src [ 3 ];
-            tmp . b [ 4 ] = src [ 4 ];
-            tmp . b [ 5 ] = src [ 5 ];
-            tmp . b [ 6 ] = src [ 6 ];
-            tmp . b [ 7 ] = 0;
-            tmp . l [ 1 ] = 0;
-        }
-
-        /* currently only seen for 454 */
-        else
-        {
-            memcpy ( tmp . b, src, bytes );
-            memset ( & tmp . b [ bytes ], 0, sizeof tmp . b - bytes );
-        }
-
-        buffer = _mm_loadu_si128 ( ( const __m128i* ) tmp . b );
-    }
-    return buffer;
-}
-#endif
-
-#define prime_registers( self ) \
-    p0 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 0 ] . pattern . b ); \
-    m0 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 0 ] . mask . b ); \
-    p1 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 1 ] . pattern . b ); \
-    m1 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 1 ] . mask . b ); \
-    p2 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 2 ] . pattern . b ); \
-    m2 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 2 ] . mask . b ); \
-    p3 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 3 ] . pattern . b ); \
-    m3 = _mm_load_si128 ( ( const __m128i* ) self -> query [ 3 ] . mask . b )
-
-static
-int eval_2na_8 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 1
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi8 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( void ) 0 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_2na_16 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 2
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi16 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( void ) 0 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_2na_32 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 4
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( void ) 0 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_2na_64 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 8
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) &= ( ( res ) & 0x0F0F ) << 4, \
-      ( res ) |= ( res ) >> 4 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_2na_128 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 16
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) = - ( ( ( res ) + 1 ) >> 16 ) )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_2na_pos ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define positional 1
-#define qbytes 16
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) = - ( ( ( res ) + 1 ) >> 16 ) )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* used to hold entry position */
-#if positional
-    unsigned int start;
-#endif
-
-    /* kludge for streaming in a byte at a time
-       only needed when qbytes > 1 */
-#if qbytes > 1
-    int slam;
-    const uint8_t *p;
-#endif
-
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* hold starting position */
-#if positional
-    start = pos;
-#endif
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_2na ( src, end );
-    src += 16;
-#if qbytes > 1
-    p = src;
-
-    /* pre-load slam for single byte streaming */
-    if ( src < end )
-        slam = ( int ) src [ -1 ] << 8;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#else
-    num_passes = qbytes;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_2NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_2NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, p0 );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_2NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, p1 );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_2NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, p2 );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_2NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, p3 );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_2NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if positional
-                    switch ( stop - pos )
-                    {
-                    case 0:
-                        if ( ra != 0 ) return pos - start + 1;
-                        break;
-                    case 1:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        break;
-                    case 2:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        if ( rc != 0 ) return pos - start + 3;
-                        break;
-                    default:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        if ( rc != 0 ) return pos - start + 3;
-                        if ( rd != 0 ) return pos - start + 4;
-                    }
-                    return 0;
-#elif qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 2 ) + 0;
-                    fb = ( fb << 2 ) + 1;
-                    fc = ( fc << 2 ) + 2;
-                    fd = ( fd << 2 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 1
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 1 );
-
-                /* bring in new byte */
-                if ( p < end )
-                {
-                    slam >>= 8;
-                    slam |= ( int ) p [ 0 ] << 8;
-                    buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                }
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 16 - qbytes ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if RELOAD_BUFFER || qbytes == 1
-            buffer = prime_buffer_2na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_2na ( src, end );
-            else
-            {
-                if ( ( ( size_t ) ( p - src ) & 1 ) != 0 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 1 );
-                    if ( p < end )
-                    {
-                        slam >>= 8;
-                        slam |= ( int ) p [ 0 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                    ++ p;
-                }
-
-                if ( src + 16 <= end ) switch ( p - src )
-                {
-                case 4:
-                    buffer = _mm_srli_si128 ( buffer, 12 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 5 ], 7 );
-                    break;
-                case 6:
-                    buffer = _mm_srli_si128 ( buffer, 10 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 3 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 4 ], 7 );
-                    break;
-                case 8:
-                    buffer = _mm_srli_si128 ( buffer, 8 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 3 ], 7 );
-                    break;
-                case 10:
-                    buffer = _mm_srli_si128 ( buffer, 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 5 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 2 ], 7 );
-                    break;
-                case 12:
-                    buffer = _mm_srli_si128 ( buffer, 4 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 6 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 1 ], 7 );
-                    break;
-                case 14:
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    buffer = _mm_insert_epi16 ( buffer, ( ( const uint16_t* ) p ) [ 0 ], 7 );
-                    break;
-                }
-
-                else for ( ; p - src < 16; p += 2 )
-                {
-                    buffer = _mm_srli_si128 ( buffer, 2 );
-                    if ( p < end )
-                    {
-                        slam = p [ 0 ];
-                        if ( p + 1 < end )
-                            slam |= ( int ) p [ 1 ] << 8;
-                        buffer = _mm_insert_epi16 ( buffer, slam, 7 );
-                    }
-                }
-            }
-#endif
-
-            /* adjust pointers */
-            src += 16;
-#if qbytes > 1
-            p = src;
-            if ( src < end )
-                slam = ( int ) src [ -1 ] << 8;
-#endif
-        }
-    }
-
-#undef positional
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-
-#if ENDLESS_BUFFER
-static __inline__
-__m128i prime_buffer_4na ( const uint8_t *src, const uint8_t *ignore )
-{
-    nucpat_t tmp;
-    __m128i buffer;
-
-    ( void ) ignore;
-
-    tmp . w [ 0 ] = expand_2na [ src [ 0 ] ];
-    tmp . w [ 1 ] = expand_2na [ src [ 1 ] ];
-    tmp . w [ 2 ] = expand_2na [ src [ 2 ] ];
-    tmp . w [ 3 ] = expand_2na [ src [ 3 ] ];
-    tmp . w [ 4 ] = expand_2na [ src [ 4 ] ];
-    tmp . w [ 5 ] = expand_2na [ src [ 5 ] ];
-    tmp . w [ 6 ] = expand_2na [ src [ 6 ] ];
-    tmp . w [ 7 ] = expand_2na [ src [ 7 ] ];
-
-    buffer = _mm_loadu_si128 ( ( const __m128i* ) tmp . b );
-    return buffer;
-}
-#else
-static __inline__
-__m128i prime_buffer_4na ( const uint8_t *src, const uint8_t *end )
-{
-    nucpat_t tmp;
-    __m128i buffer;
-
-    if ( end - src >= 8 )
-    {
-        tmp . w [ 0 ] = expand_2na [ src [ 0 ] ];
-        tmp . w [ 1 ] = expand_2na [ src [ 1 ] ];
-        tmp . w [ 2 ] = expand_2na [ src [ 2 ] ];
-        tmp . w [ 3 ] = expand_2na [ src [ 3 ] ];
-        tmp . w [ 4 ] = expand_2na [ src [ 4 ] ];
-        tmp . w [ 5 ] = expand_2na [ src [ 5 ] ];
-        tmp . w [ 6 ] = expand_2na [ src [ 6 ] ];
-        tmp . w [ 7 ] = expand_2na [ src [ 7 ] ];
-    }
-    else
-    {
-        tmp . l [ 0 ] = tmp . l [ 1 ] = 0;
-        switch ( end - src )
-        {
-        default:
-            tmp . w [ 6 ] = expand_2na [ src [ 6 ] ];
-        case 6:
-            tmp . w [ 5 ] = expand_2na [ src [ 5 ] ];
-        case 5:
-            tmp . w [ 4 ] = expand_2na [ src [ 4 ] ];
-        case 4:
-            tmp . w [ 3 ] = expand_2na [ src [ 3 ] ];
-        case 3:
-            tmp . w [ 2 ] = expand_2na [ src [ 2 ] ];
-        case 2:
-            tmp . w [ 1 ] = expand_2na [ src [ 1 ] ];
-        case 1:
-            tmp . w [ 0 ] = expand_2na [ src [ 0 ] ];
-            break;
-        }
-    }
-
-    buffer = _mm_loadu_si128 ( ( const __m128i* ) tmp . b );
-    return buffer;
-}
-#endif
-
-static
-int eval_4na_16 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 2
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi16 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( void ) 0 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri, rj;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-#if qbytes > 2
-    const uint8_t *p;
-#endif
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_4na ( src, end );
-    src += 8;
-#if qbytes > 2
-    p = src;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#elif qbytes == 1
-#error "4na requires at least 2 qbytes"
-#else
-    num_passes = qbytes / 2;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_4NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes / 2;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_4NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, p0 );
-                rj = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_4NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, p1 );
-                rj = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_4NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, p2 );
-                rj = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_4NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, p3 );
-                rj = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_4NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 1 ) + 0;
-                    fb = ( fb << 1 ) + 1;
-                    fc = ( fc << 1 ) + 2;
-                    fd = ( fd << 1 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 2
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 2 );
-
-                /* bring in new byte */
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 8 - qbytes / 2 ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if ENDLESS_BUFFER || qbytes == 2
-            buffer = prime_buffer_4na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_4na ( src, end );
-            else for ( ; p - src < 8; ++ p )
-            {
-                buffer = _mm_srli_si128 ( buffer, 2 );
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-            }
-#endif
-
-            /* adjust pointers */
-            src += 8;
-#if qbytes > 2
-            p = src;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_4na_32 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 4
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( void ) 0 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri, rj;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-#if qbytes > 2
-    const uint8_t *p;
-#endif
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_4na ( src, end );
-    src += 8;
-#if qbytes > 2
-    p = src;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#elif qbytes == 1
-#error "4na requires at least 2 qbytes"
-#else
-    num_passes = qbytes / 2;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_4NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes / 2;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_4NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, p0 );
-                rj = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_4NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, p1 );
-                rj = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_4NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, p2 );
-                rj = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_4NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, p3 );
-                rj = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_4NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 1 ) + 0;
-                    fb = ( fb << 1 ) + 1;
-                    fc = ( fc << 1 ) + 2;
-                    fd = ( fd << 1 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 2
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 2 );
-
-                /* bring in new byte */
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 8 - qbytes / 2 ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if ENDLESS_BUFFER || qbytes == 2
-            buffer = prime_buffer_4na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_4na ( src, end );
-            else for ( ; p - src < 8; ++ p )
-            {
-                buffer = _mm_srli_si128 ( buffer, 2 );
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-            }
-#endif
-
-            /* adjust pointers */
-            src += 8;
-#if qbytes > 2
-            p = src;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_4na_64 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 8
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) &= ( ( res ) & 0x0F0F ) << 4, \
-      ( res ) |= ( res ) >> 4 )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri, rj;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-#if qbytes > 2
-    const uint8_t *p;
-#endif
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_4na ( src, end );
-    src += 8;
-#if qbytes > 2
-    p = src;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#elif qbytes == 1
-#error "4na requires at least 2 qbytes"
-#else
-    num_passes = qbytes / 2;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_4NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes / 2;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_4NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, p0 );
-                rj = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_4NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, p1 );
-                rj = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_4NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, p2 );
-                rj = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_4NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, p3 );
-                rj = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_4NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 1 ) + 0;
-                    fb = ( fb << 1 ) + 1;
-                    fc = ( fc << 1 ) + 2;
-                    fd = ( fd << 1 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 2
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 2 );
-
-                /* bring in new byte */
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 8 - qbytes / 2 ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if ENDLESS_BUFFER || qbytes == 2
-            buffer = prime_buffer_4na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_4na ( src, end );
-            else for ( ; p - src < 8; ++ p )
-            {
-                buffer = _mm_srli_si128 ( buffer, 2 );
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-            }
-#endif
-
-            /* adjust pointers */
-            src += 8;
-#if qbytes > 2
-            p = src;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_4na_128 ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define qbytes 16
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) = - ( ( ( res ) + 1 ) >> 16 ) )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri, rj;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-#if qbytes > 2
-    const uint8_t *p;
-#endif
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_4na ( src, end );
-    src += 8;
-#if qbytes > 2
-    p = src;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#elif qbytes == 1
-#error "4na requires at least 2 qbytes"
-#else
-    num_passes = qbytes / 2;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_4NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes / 2;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_4NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, p0 );
-                rj = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_4NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, p1 );
-                rj = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_4NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, p2 );
-                rj = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_4NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, p3 );
-                rj = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_4NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 1 ) + 0;
-                    fb = ( fb << 1 ) + 1;
-                    fc = ( fc << 1 ) + 2;
-                    fd = ( fd << 1 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 2
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 2 );
-
-                /* bring in new byte */
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 8 - qbytes / 2 ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if ENDLESS_BUFFER || qbytes == 2
-            buffer = prime_buffer_4na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_4na ( src, end );
-            else for ( ; p - src < 8; ++ p )
-            {
-                buffer = _mm_srli_si128 ( buffer, 2 );
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-            }
-#endif
-
-            /* adjust pointers */
-            src += 8;
-#if qbytes > 2
-            p = src;
-#endif
-        }
-    }
-
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-
-static
-int eval_4na_pos ( const NucStrFastaExpr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len )
-{
-#define positional 1
-#define qbytes 16
-#define _mm_cmpeq_epi( a, b ) \
-    _mm_cmpeq_epi32 ( a, b )
-#if NEVER_MATCH
-#define res_adj( res ) \
-    res = 0
-#else
-#define res_adj( res ) \
-    ( ( res ) = - ( ( ( res ) + 1 ) >> 16 ) )
-#endif
-
-    /* SSE registers */
-    nucreg_t buffer, ri, rj;
-    nucreg_t p0, p1, p2, p3, m0, m1, m2, m3;
-
-    /* result registers */
-    int ra, rb, rc, rd;
-
-    /* used for shifting buffer, testing exit */
-    unsigned int num_passes, stop;
-
-    /* used to hold entry position */
-#if positional
-    unsigned int start;
-#endif
-
-#if qbytes > 2
-    const uint8_t *p;
-#endif
-    const uint8_t *end, *src;
-    unsigned int qlen = self -> size;
-
-    /* this test is performed outside */
-    assert ( len >= qlen );
-
-    /* the effective length of the sequence,
-       including leading bases we'll ignore */
-    len += pos;
-
-    /* hold starting position */
-#if positional
-    start = pos;
-#endif
-
-    /* convert source pointer */
-    src = ( const uint8_t* ) ncbi2na + ( pos >> 2 );
-
-    /* stop testing when position passes this point */
-    stop = len - qlen;
-
-    /* the sequence end pointer */
-    end = ( const uint8_t* ) ncbi2na + ( ( len + 3 ) >> 2 );
-
-    /* prime the buffer */
-    buffer = prime_buffer_4na ( src, end );
-    src += 8;
-#if qbytes > 2
-    p = src;
-#endif
-
-    /* prime the registers */
-    prime_registers ( self );
-
-    /* enter the loop at an appropriate offset */
-    ra = rb = rc = 0;
-#if qbytes == 16
-    num_passes = ( stop - pos + 7 ) >> 2;
-#elif qbytes == 1
-#error "4na requires at least 2 qbytes"
-#else
-    num_passes = qbytes / 2;
-#endif
-
-    /* for reporting - give a buffer alignment */
-    ALIGN_4NA_HEADER ( buffer, pos & ~ 3, len );
-    switch ( pos & 3 )
-    {
-    default:
-
-        /* outer loop - performs whole buffer loads */
-        while ( 1 )
-        {
-            num_passes = qbytes / 2;
-
-            /* inner loop - shifts in one byte at a time */
-            while ( 1 )
-            {
-                /* for reporting - give a buffer alignment */
-                ALIGN_4NA_HEADER ( buffer, pos, len );
-
-                /* perform comparisons */
-    case 0:
-                ri = _mm_and_si128 ( buffer, p0 );
-                rj = _mm_and_si128 ( buffer, m0 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                ra = _mm_movemask_epi8 ( ri );
-                res_adj ( ra );
-                ALIGN_4NA_RESULT ( buffer, p0, m0, ri, ra );
-    case 1:
-                ri = _mm_and_si128 ( buffer, p1 );
-                rj = _mm_and_si128 ( buffer, m1 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rb = _mm_movemask_epi8 ( ri );
-                res_adj ( rb );
-                ALIGN_4NA_RESULT ( buffer, p1, m1, ri, rb );
-    case 2:
-                ri = _mm_and_si128 ( buffer, p2 );
-                rj = _mm_and_si128 ( buffer, m2 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rc = _mm_movemask_epi8 ( ri );
-                res_adj ( rc );
-                ALIGN_4NA_RESULT ( buffer, p2, m2, ri, rc );
-    case 3:
-                ri = _mm_and_si128 ( buffer, p3 );
-                rj = _mm_and_si128 ( buffer, m3 );
-                ri = _mm_cmpeq_epi ( ri, rj );
-                rd = _mm_movemask_epi8 ( ri );
-                res_adj ( rd );
-                ALIGN_4NA_RESULT ( buffer, p3, m3, ri, rd );
-
-                /* adjust pos */
-                pos &= ~ 3;
-
-                /* test for any promising results */
-                if ( ( ra | rb | rc | rd ) != 0 )
-                {
-#if positional
-                    switch ( stop - pos )
-                    {
-                    case 0:
-                        if ( ra != 0 ) return pos - start + 1;
-                        break;
-                    case 1:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        break;
-                    case 2:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        if ( rc != 0 ) return pos - start + 3;
-                        break;
-                    default:
-                        if ( ra != 0 ) return pos - start + 1;
-                        if ( rb != 0 ) return pos - start + 2;
-                        if ( rc != 0 ) return pos - start + 3;
-                        if ( rd != 0 ) return pos - start + 4;
-                    }
-                    return 0;
-#elif qbytes == 16
-                    switch ( stop - pos )
-                    {
-                    default:
-                        return 1;
-                    case 2:
-                        if ( rc != 0 ) return 1;
-                    case 1:
-                        if ( rb != 0 ) return 1;
-                    case 0:
-                        if ( ra != 0 ) return 1;
-                    }
-                    return 0;
-#else
-                    /* extract first non-zero bit from results
-                       where result is all zeros, bit will be -1 */
-                    int fa = uint16_lsbit ( ( uint16_t ) ra );
-                    int fb = uint16_lsbit ( ( uint16_t ) rb );
-                    int fc = uint16_lsbit ( ( uint16_t ) rc );
-                    int fd = uint16_lsbit ( ( uint16_t ) rd );
-
-                    /* convert bit number into number of bases
-                       from current position. undefined where
-                       bit is negative, but unimportant also */
-                    fa = ( fa << 1 ) + 0;
-                    fb = ( fb << 1 ) + 1;
-                    fc = ( fc << 1 ) + 2;
-                    fd = ( fd << 1 ) + 3;
-
-                    /* test for any case where result was non-zero
-                       and the resultant base index is within range */
-                    if ( ra != 0 && pos + fa <= stop ) return 1;
-                    if ( rb != 0 && pos + fb <= stop ) return 1;
-                    if ( rc != 0 && pos + fc <= stop ) return 1;
-                    if ( rd != 0 && pos + fd <= stop ) return 1;
-#endif
-                }
-
-                /* advance pos */
-                pos += 4;
-
-                /* if no further comparisons are possible */
-                if ( pos > stop )
-                    return 0;
-
-                /* if all shifting passes are complete */
-                if ( -- num_passes == 0 )
-                    break;
-
-#if qbytes > 2
-                /* shift buffer */
-                buffer = _mm_srli_si128 ( buffer, 2 );
-
-                /* bring in new byte */
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-                
-                /* always increment source */
-                ++ p;
-#endif
-            }
-
-            /* want to reload buffer */
-            if ( src >= end )
-                break;
-
-            /* advance position */
-            pos += ( 8 - qbytes / 2 ) << 2;
-            if ( pos > stop )
-                break;
-
-            /* reload buffer */
-#if ENDLESS_BUFFER || qbytes == 2
-            buffer = prime_buffer_4na ( src, end );
-#elif qbytes == 16
-            assert ( 0 );
-#else
-            if ( p - src < 3 )
-                buffer = prime_buffer_4na ( src, end );
-            else for ( ; p - src < 8; ++ p )
-            {
-                buffer = _mm_srli_si128 ( buffer, 2 );
-                if ( p < end )
-                    buffer = _mm_insert_epi16 ( buffer, expand_2na [ * p ], 7 );
-            }
-#endif
-
-            /* adjust pointers */
-            src += 8;
-#if qbytes > 2
-            p = src;
-#endif
-        }
-    }
-
-#undef positional
-#undef qbytes
-#undef _mm_cmpeq_epi
-#undef res_adj
-
-    return 0;
-}
-#endif /* INTEL_INTRINSICS */
-
-
-/* NucStrstrSearch
- *  search buffer from starting position
- *
- *  "ncbi2na" [ IN ] - pointer to 2na data
- *
- *  "pos" [ IN ] - starting base position for search,
- *  relative to "ncbi2na". may be >= 4.
- *
- *  "len" [ IN ] - the number of bases to include in
- *  the search, relative to "pos".
- *
- *  return values:
- *    ! 0 if the pattern was found
- */
-LIB_EXPORT int CC NucStrstrSearch ( const NucStrstr *self,
-    const void *ncbi2na, unsigned int pos, unsigned int len , unsigned int * selflen )
-{
-    if ( self != NULL && ncbi2na != NULL && len != 0 )
-    {
-        int found;
-        unsigned int fasta_len;
-
-        switch ( self -> fasta . type )
-        {
-        case type_2na_64:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_64 ( & self -> fasta, ncbi2na, pos, len );
-        case type_4na_64:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_4na_64 ( & self -> fasta, ncbi2na, pos, len );
-#if INTEL_INTRINSICS
-        case type_2na_8:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_8 ( & self -> fasta, ncbi2na, pos, len );
-        case type_2na_16:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_16 ( & self -> fasta, ncbi2na, pos, len );
-        case type_2na_32:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_32 ( & self -> fasta, ncbi2na, pos, len );
-        case type_2na_128:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_128 ( & self -> fasta, ncbi2na, pos, len );
-        case type_4na_16:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_4na_16 ( & self -> fasta, ncbi2na, pos, len );
-        case type_4na_32:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_4na_32 ( & self -> fasta, ncbi2na, pos, len );
-        case type_4na_128:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_4na_128 ( & self -> fasta, ncbi2na, pos, len );
-#endif
-        case type_2na_pos:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_2na_pos ( & self -> fasta, ncbi2na, pos, len );
-        case type_4na_pos:
-            if ( len < self -> fasta . size ) return 0;
-	    if(selflen) *selflen=self -> fasta . size;
-            return eval_4na_pos ( & self -> fasta, ncbi2na, pos, len );
-        case type_OP:
-            found = NucStrstrSearch ( self -> boolean . left, ncbi2na, pos, len, selflen);
-            switch ( self -> boolean . op )
-            {
-            case op_OR:
-                if ( found != 0 )
-                    return found;
-                break;
-            case op_AND:
-                if ( found == 0 )
-                    return found;
-                break;
-            }
-            return NucStrstrSearch ( self -> boolean . right, ncbi2na, pos, len, selflen);
-        case type_EXPR:
-            switch ( self -> sub . op )
-            {
-            case 0:
-            case op_NOT:
-                found = NucStrstrSearch ( self -> sub . expr, ncbi2na, pos, len, selflen);
-                if ( self -> sub . op == 0 )
-                    return found;
-                if ( found == 0 )
-                    return 1;
-                break;
-            case op_HEAD:
-                fasta_len = self -> sub . expr -> fasta . size;
-                if ( fasta_len > len )
-                    return 0;
-                return NucStrstrSearch ( self -> sub . expr, ncbi2na, pos, fasta_len, selflen );
-            case op_TAIL:
-                fasta_len = self -> sub . expr -> fasta . size;
-                if ( fasta_len > len )
-                    return 0;
-                return NucStrstrSearch ( self -> sub . expr, ncbi2na,
-                    pos + len - fasta_len, fasta_len, selflen );
-            }
-            break;
-        }
-    }
-    return 0;
-}
diff --git a/libs/search/search-priv.h b/libs/search/search-priv.h
deleted file mode 100644
index ff8a376..0000000
--- a/libs/search/search-priv.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_search_priv_
-#define _h_search_priv_
-
-#include <search/grep.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <compiler.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct FgrepDumbParams FgrepDumbParams;
-typedef struct FgrepBoyerParams FgrepBoyerParams;
-typedef struct FgrepAhoParams FgrepAhoParams;
-typedef struct AgrepWuParams AgrepWuParams;
-typedef struct DPParams DPParams;
-typedef struct MyersSearch MyersSearch;
-typedef struct MyersUnlimitedSearch MyersUnlimitedSearch;
-
-void FgrepDumbSearchMake(FgrepDumbParams **self, const char *strings[], uint32_t numstrings);
-void FgrepDumbSearchFree(FgrepDumbParams *self);
-
-void FgrepBoyerSearchMake(FgrepBoyerParams **self, const char *strings[], uint32_t numstrings);
-void FgrepBoyerSearchFree(FgrepBoyerParams *self);
-
-void FgrepAhoMake(FgrepAhoParams **self, const char *strings[], uint32_t numstrings);
-void FgrepAhoFree(FgrepAhoParams *self);
-
-uint32_t FgrepDumbFindFirst(FgrepDumbParams *self, const char *buf, size_t len, FgrepMatch *match);
-uint32_t FgrepBoyerFindFirst( FgrepBoyerParams *self, const char *buf, size_t len, FgrepMatch *match);
-uint32_t FgrepAhoFindFirst( FgrepAhoParams *self, const char *buf, size_t len, FgrepMatch *match);
-
-void AgrepWuFree(AgrepWuParams *self);
-void MyersUnlimitedFree(MyersUnlimitedSearch *self);
-void AgrepDPFree(DPParams *self);
-void AgrepMyersFree(MyersSearch *self);
-
-uint32_t MyersUnlimitedFindFirst(MyersUnlimitedSearch *self, int32_t threshold, const char* text, size_t n, AgrepMatch *match);
-uint32_t MyersFindFirst(MyersSearch *self, int32_t threshold, 
-                   const char* text, size_t n,
-                       AgrepMatch *match);
-uint32_t AgrepWuFindFirst(const AgrepWuParams *self, int32_t threshold, const char *buf, int32_t buflen, AgrepMatch *match);
-uint32_t AgrepDPFindFirst(const DPParams *self, int32_t threshold, AgrepFlags mode, const char *buf, int32_t buflen, AgrepMatch *match);
-
-void AgrepDPFindAll(const AgrepCallArgs *args);
-void MyersFindAll(const AgrepCallArgs *args);
-void MyersUnlimitedFindAll(const AgrepCallArgs *args);
-void AgrepWuFindAll(const AgrepCallArgs *args);
-int32_t FgrepAhoFindAll(FgrepAhoParams *self, char *buf, int32_t len, int32_t *whichpattern);
-void FgrepBoyerFindAll(FgrepBoyerParams *self, char *buf, int32_t len, FgrepMatchCallback cb, void *cbinfo);
-void FgrepDumbFindAll(FgrepDumbParams *self, char *buf, int32_t len, 
-                      FgrepMatchCallback cb, void *cbinfo);
-
-
-rc_t AgrepDPMake(DPParams **self, AgrepFlags mode, const char *pattern);
-rc_t AgrepMyersMake(MyersSearch **self, AgrepFlags mode, const char *pattern);
-rc_t MyersUnlimitedMake(MyersUnlimitedSearch **self, AgrepFlags mode, const char *pattern);
-rc_t AgrepWuMake(AgrepWuParams **self, AgrepFlags mode, const char *pattern);
-
-
-struct Fgrep {
-    struct FgrepDumbParams *dumb;
-    struct FgrepBoyerParams *boyer;
-    struct FgrepAhoParams *aho;
-    FgrepFlags mode;
-};
-
-typedef struct Fgrep FgrepParams;
-
-/* 
-We actually need to have multiple (non-union) for Myers and DP parameters,
-since the myers code uses the DP parameters.
-Some of the others could be unioned.
-*/
-struct Agrep
-{
-    struct AgrepWuParams *wu;
-    struct MyersSearch *myers;
-    struct MyersUnlimitedSearch *myersunltd;
-    struct DPParams *dp;
-    AgrepFlags mode;
-};
-
-typedef struct Agrep AgrepParams;
-
-extern const unsigned char* IUPAC_decode[256];
-rc_t na4_set_bits(const AgrepFlags mode, uint64_t* arr, const unsigned char c, const uint64_t val);
-
-/* Internal definitions */
-
-rc_t CC dp_end_callback( const void *cbinfo, const AgrepMatch *match, AgrepContinueFlag *flag );
-
-static __inline__
-char *substring ( const char *src, uint32_t sz )
-{
-    char *ret = malloc ( sz + 1 );
-    strncpy ( ret, src, sz );
-    ret [ sz ] = 0;
-    return ret;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_search_priv_ */
diff --git a/libs/search/search.c b/libs/search/search.c
deleted file mode 100644
index a516e8f..0000000
--- a/libs/search/search.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <search/extern.h>
-#include <sysalloc.h>
-#include "search-priv.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-const unsigned char* IUPAC_decode[256] = { (const unsigned char*)0xFFFF };
-
-static
-void IUPAC_init(void)
-{
-    if( IUPAC_decode[0] != NULL ) {
-        const char** t = (const char**)IUPAC_decode;
-
-        memset(t, 0, sizeof(t));
-        t['A'] = t['a'] = "Aa";
-        t['C'] = t['c'] = "Cc";
-        t['G'] = t['g'] = "Gg";
-        t['T'] = t['t'] = "Tt";
-        t['U'] = t['u'] = "Uu";
-        t['M'] = t['m'] = "AaCc";
-        t['R'] = t['r'] = "AaGg";
-        t['S'] = t['s'] = "CcGg";
-        t['V'] = t['v'] = "AaCcGg";
-        t['W'] = t['w'] = "AaTtUu";
-        t['Y'] = t['y'] = "CcTtUu";
-        t['K'] = t['k'] = "GgTtUu";
-        t['B'] = t['b'] = "CcGgTtUu";
-        t['D'] = t['d'] = "AaGgTtUu";
-        t['H'] = t['h'] = "AaCcTtUu";
-        t['N'] = t['n'] = t['.'] = "AaCcGgTtUuNn.-";
-    }
-}
-
-rc_t na4_set_bits(const AgrepFlags mode, uint64_t* arr, const unsigned char c, const uint64_t val)
-{
-    if( mode & AGREP_PATTERN_4NA ) {
-        const unsigned char* tr;
-        tr = IUPAC_decode[c];
-        if( tr == NULL ) {
-            if( (mode & AGREP_ANYTHING_ELSE_IS_N) && (c == '.' || c == '-') ) {
-                tr = IUPAC_decode['N'];
-            }
-            if( tr == NULL ) {
-                return RC(rcText, rcString, rcSearching, rcConstraint, rcOutofrange);
-            }
-        }
-        while( *tr != '\0' ) {
-            if( mode & AGREP_TEXT_EXPANDED_2NA ) {
-                switch(*tr) {
-                    case 'A':
-                        arr[0] |= val;
-                        break;
-                    case 'C':
-                        arr[1] |= val;
-                        break;
-                    case 'G':
-                        arr[2] |= val;
-                        break;
-                    case 'T':
-                    case 'U':
-                        arr[3] |= val;
-                        break;
-                    case 'N':
-                        arr[4] |= val;
-                        break;
-                }
-            }
-            arr[*tr++] |= val;
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT void CC FgrepFree( FgrepParams *self )
-{
-    if (self->dumb != NULL)
-        FgrepDumbSearchFree(self->dumb);
-    if (self->boyer != NULL)
-        FgrepBoyerSearchFree(self->boyer);
-    if (self->aho != NULL)
-        FgrepAhoFree(self->aho);
-    free(self);
-}
-
-
-LIB_EXPORT rc_t CC FgrepMake( FgrepParams **self, FgrepFlags mode, const char *strings[], uint32_t numstrings )
-{
-    *self = malloc(sizeof(FgrepParams));
-    memset(*self, 0, sizeof(FgrepParams));
-    (*self)->mode = mode;
-    if (mode & FGREP_ALG_DUMB) {
-        FgrepDumbSearchMake(&(*self)->dumb, strings, numstrings);
-    }
-    if (mode & FGREP_ALG_BOYERMOORE) {
-        FgrepBoyerSearchMake(&(*self)->boyer, strings, numstrings);
-    }
-    if (mode & FGREP_ALG_AHOCORASICK) {
-        FgrepAhoMake(&(*self)->aho, strings, numstrings);
-    }
-    return 0;
-}
-
-LIB_EXPORT uint32_t CC FgrepFindFirst( const FgrepParams *self, const char *buf, size_t len, FgrepMatch *match )
-{
-    if (self->mode & FGREP_ALG_DUMB) {
-        return FgrepDumbFindFirst(self->dumb, buf, len, match);
-    }
-    if (self->mode & FGREP_ALG_BOYERMOORE) {
-        return FgrepBoyerFindFirst(self->boyer, buf, len, match);
-    }
-    if (self->mode & FGREP_ALG_AHOCORASICK) {
-        return FgrepAhoFindFirst(self->aho, buf, len, match);
-    }
-    /* Should maybe return error code, not 1/0 */
-    return 0;
-}
-
-LIB_EXPORT rc_t CC AgrepMake( AgrepParams **self, AgrepFlags mode, const char *pattern )
-{
-    rc_t rc = 0;
-
-    if( self == NULL || pattern == NULL ) {
-        rc = RC(rcText, rcString, rcSearching, rcParam, rcNull);
-    } else if( (*self = malloc(sizeof(AgrepParams))) == NULL ) {
-        rc = RC(rcText, rcString, rcSearching, rcMemory, rcExhausted);
-    } else {
-        memset((*self), 0, sizeof(**self));
-        (*self)->mode = mode;
-        if( mode & AGREP_PATTERN_4NA ) {
-            size_t i, l = strlen(pattern);
-            if( IUPAC_decode[0] != NULL ) {
-                IUPAC_init();
-            }
-            if( l == 0 ) {
-                rc = RC(rcText, rcString, rcSearching, rcParam, rcOutofrange);
-            }
-            for(i = 0; rc == 0 && i < l; i++) {
-                if( IUPAC_decode[(signed char)(pattern[i])] == NULL ) {
-                    rc = RC(rcText, rcString, rcSearching, rcParam, rcOutofrange);
-                }
-            }
-        } else if( !(mode & AGREP_MODE_ASCII) ) {
-            rc = RC(rcText, rcString, rcSearching, rcParam, rcUnsupported);
-        }
-        if( rc == 0 ) {
-            if(mode & AGREP_ALG_WUMANBER) {
-                if( (rc = AgrepWuMake(&(*self)->wu, mode, pattern)) == 0 ) {
-                    rc = AgrepDPMake(&(*self)->dp, mode, pattern);
-                }
-            } else if(mode & AGREP_ALG_MYERS) {
-                if( (rc = AgrepMyersMake(&(*self)->myers, mode, pattern)) == 0 ) {
-                    rc = AgrepDPMake(&(*self)->dp, mode, pattern);
-                }
-            } else if(mode & AGREP_ALG_MYERS_UNLTD) {
-                if( (rc = MyersUnlimitedMake(&(*self)->myersunltd, mode, pattern)) == 0 ) {
-                    rc = AgrepDPMake(&(*self)->dp, mode, pattern);
-                }
-            } else if(mode & AGREP_ALG_DP) {
-                rc = AgrepDPMake(&(*self)->dp, mode, pattern);
-            } else {
-                rc = RC(rcText, rcString, rcSearching, rcParam, rcInvalid);
-            }
-        }
-    }
-    if( rc != 0 ) {
-        AgrepWhack(*self);
-    }
-    return rc;
-}
-
-LIB_EXPORT void CC AgrepWhack( AgrepParams *self )
-{
-    if( self != NULL ) {
-        if( self->wu ) {
-            AgrepWuFree(self->wu);
-        }
-        if( self->myers ) {
-            AgrepMyersFree(self->myers);
-        }
-        if( self->myersunltd ) {
-            MyersUnlimitedFree(self->myersunltd);
-        }
-        if( self->dp ) {
-            AgrepDPFree(self->dp);
-        }
-        free(self);
-    }
-}
-
-LIB_EXPORT void CC AgrepFindAll( const AgrepCallArgs *args )
-{
-    if( args != NULL ) {
-        const AgrepParams *self = args->self;
-
-        if(self->mode & AGREP_ALG_WUMANBER) {
-            AgrepWuFindAll(args);
-        } else if(self->mode & AGREP_ALG_MYERS) {
-            MyersFindAll(args);
-        } else if(self->mode & AGREP_ALG_MYERS_UNLTD) {
-            MyersUnlimitedFindAll(args);
-        } else if (self->mode & AGREP_ALG_DP) {
-            AgrepDPFindAll(args);
-        }
-    }
-}
-
-LIB_EXPORT uint32_t CC AgrepFindFirst( const AgrepParams *self, int32_t threshold, const char *buf, size_t len, AgrepMatch *match )
-{
-    if( self != NULL && buf != NULL && match != NULL ) {
-        if (self->mode & AGREP_ALG_WUMANBER) {
-            return AgrepWuFindFirst(self->wu, threshold, buf, (int32_t)len, match);
-        }
-        if (self->mode & AGREP_ALG_MYERS) {
-            return MyersFindFirst(self->myers, threshold, buf, len, match);
-        }
-        if (self->mode & AGREP_ALG_MYERS_UNLTD) {
-            return MyersUnlimitedFindFirst(self->myersunltd, threshold, buf, len, match);
-        }
-        if (self->mode & AGREP_ALG_DP) {
-            return AgrepDPFindFirst(self->dp, threshold, self->mode, buf, (int32_t)len, match);
-        }
-    }
-    /* Not sure this is the right thing to return. */
-    return 0;
-}
-
-static 
-rc_t CC AgrepFindBestCallback(const void *cbinfo, const AgrepMatch *matchinfo, AgrepContinueFlag *flag)
-{
-    AgrepMatch *best = (AgrepMatch *)cbinfo;
-    if (best->score == -1 || best->score > matchinfo->score) {
-        *best = *matchinfo;
-    }
-    return 0;
-}
-
-LIB_EXPORT uint32_t CC AgrepFindBest( const AgrepParams *self, int32_t threshold, const char *buf, int32_t len, AgrepMatch *match )
-{
-    if( self != NULL && buf != NULL && match != NULL ) {
-        AgrepCallArgs args;
-
-        args.self = self;
-        args.threshold = threshold;
-        args.buf = buf;
-        args.buflen = len;
-        args.cb = AgrepFindBestCallback;
-        args.cbinfo = match;
-
-        match->score = -1;
-        
-        AgrepFindAll(&args);
-        if (match->score != -1) {
-            return 1;
-        }
-    }
-    return 0;
-}
diff --git a/libs/sra/Makefile b/libs/sra/Makefile
deleted file mode 100644
index 26a5081..0000000
--- a/libs/sra/Makefile
+++ /dev/null
@@ -1,234 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/sra
-
-INT_LIBS = \
-	libsraschema \
-	libwsraschema \
-	libsradb \
-	libwsradb \
-	libsrareader
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-VPATH += $(OBJDIR)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f $(ILIBDIR)/libsra-schema.* $(ILIBDIR)/libwsra-schema.* $(ILIBDIR)/sra-dflt-schema*
-	@ rm -f $(BINDIR)/libsra-schema.* $(BINDIR)/libwsra-schema.*
-
-.PHONY: clean
-
-
-#-------------------------------------------------------------------------------
-# sradb embedded schema
-#
-$(ILIBDIR)/libsraschema: $(ILIBDIR)/libsraschema.$(LIBX)
-
-$(ILIBDIR)/libwsraschema: $(ILIBDIR)/libwsraschema.$(LIBX)
-
-SRA_DFLT_SCHEMA_LIBS = \
-	-skapp \
-	-svdb \
-	$(ALWAYS_STATIC_SCHEMA_LIBS) \
-	-salign-reader \
-	-skdb \
-	-svfs \
-	-skurl \
-	-sksrch \
-	-skrypto \
-	-skfg \
-	-skfs \
-	-sksproc \
-	-sklib
-
-SRA_DFLT_SCHEMA_OS_LIBS = \
-	-ldl \
-	-sz \
-	-sbz2 \
-	-lm
-
-# set workdir for RUN_REMOTELY in rwin mode 
-RWORKDIR=$(OBJDIR)
-
-$(ILIBDIR)/sra-dflt-schema: sra-dflt-schema.$(OBJX)
-	$(LD) --exe -o $@ $^ $(SRA_DFLT_SCHEMA_LIBS) $(SRA_DFLT_SCHEMA_OS_LIBS)
-
-sra-schema.c: $(ILIBDIR)/sra-dflt-schema $(SRCDIR)/built-in.vschema $(TOP)/build/sra-dflt-schema.sh
-	@ $(TOP)/build/sra-dflt-schema.sh $(BUILD_OS) "$(RUN_REMOTELY) $(ILIBDIR)/sra-dflt-schema" -o$@ -I$(TOP)/interfaces -T$(OBJDIR)/$@.d $(SRCDIR)/built-in.vschema
-	cp $@ $(SRCDIR)
-    
-SRA_SCHEMA_SRC = \
-	sraschema \
-	sra-schema
-
-SRA_SCHEMA_OBJ = \
-	$(addsuffix .$(LOBX),$(SRA_SCHEMA_SRC))
-
-WSRA_SCHEMA_OBJ = \
-	$(addsuffix .$(LOBX),$(SRA_SCHEMA_SRC))
-
-SRA_SCHEMA_LIB = \
-	-dvdb \
-	-dklib
-
-WSRA_SCHEMA_LIB = \
-	-dwvdb \
-	-dklib
-
-SRASCHEMA_SRC = \
-	sraschema-stub \
-
-WSRASCHEMA_SRC = \
-	wsraschema-stub
-
-SRASCHEMA_SRC += $(SRA_SCHEMA_SRC)
-WSRASCHEMA_SRC += $(SRA_SCHEMA_SRC)
-
-SRASCHEMA_OBJ = \
-	$(addsuffix .$(LOBX),$(SRASCHEMA_SRC))
-
-WSRASCHEMA_OBJ = \
-	$(addsuffix .$(LOBX),$(WSRASCHEMA_SRC))
-
-$(ILIBDIR)/libsraschema.$(LIBX): $(SRASCHEMA_OBJ) $(SRASCHEMA_DEPS)
-	$(LD) --slib -o $@ $(SRASCHEMA_OBJ) $(SRA_SCHEMA_LIB)
-
-$(ILIBDIR)/libwsraschema.$(LIBX): $(WSRASCHEMA_OBJ) $(WSRASCHEMA_DEPS)
-	$(LD) --slib -o $@ $(WSRASCHEMA_OBJ) $(WSRA_SCHEMA_LIB)
-
-
-#-------------------------------------------------------------------------------
-# sradb library
-#
-$(ILIBDIR)/libsradb: $(addprefix $(ILIBDIR)/libsradb.,$(ILIBEXT))
-
-SRADBCMN_SRC = \
-	sramgr-cmn \
-	sratbl-cmn \
-	sracol \
-	types \
-    sracache
-
-SRADB_SRC = \
-	$(SRADBCMN_SRC) \
-	sramgr \
-	sratbl
-
-SRADB_OBJ = \
-	$(addsuffix .$(LOBX),$(SRADB_SRC))
-
-SRADB_LIB = \
-	-ssraschema \
-	-dvdb \
-	-dkdb \
-	-dvfs \
-	-dkfs \
-	-lkfg \
-	-dkproc \
-	-dklib
-
-$(ILIBDIR)/libsradb.$(LIBX): $(SRADB_OBJ)
-	$(LD) --slib -o $@ $^ $(SRADB_LIB)
-
-
-#-------------------------------------------------------------------------------
-# update version
-#
-$(ILIBDIR)/libwsradb: $(addprefix $(ILIBDIR)/libwsradb.,$(ILIBEXT))
-
-WSRADB_SRC = \
-	$(SRADBCMN_SRC) \
-	wsramgr \
-	wsratbl
-
-WSRADB_OBJ = \
-	$(addsuffix .$(LOBX),$(WSRADB_SRC))
-
-WSRADB_LIB = \
-	-swsraschema \
-	-dwvdb \
-	-dwkdb \
-	-dvfs \
-	-dkfs \
-	-lkfg \
-	-dkproc \
-	-dklib
-
-$(ILIBDIR)/libwsradb.$(LIBX): $(WSRADB_OBJ)
-	$(LD) --slib -o $@ $^ $(WSRADB_LIB)
-
-
-#-------------------------------------------------------------------------------
-# libsrareader
-#
-$(ILIBDIR)/libsrareader: $(addprefix $(ILIBDIR)/libsrareader.,$(ILIBEXT))
-
-SRAREADER_SRC = \
-	reader-cmn \
-	reader-fastq \
-	reader-sff \
-	reader-illumina \
-	reader-abi
-
-SRAREADER_OBJ = \
-	$(addsuffix .$(LOBX),$(SRAREADER_SRC))
-
-SRAREADER_LIB = \
-	-dsradb \
-	-dkdb \
-	-dklib
-
-$(ILIBDIR)/libsrareader.$(LIBX): $(SRAREADER_OBJ)
-	$(LD) --slib -o $@ $^ $(SRAREADER_LIB)
diff --git a/libs/sra/built-in.vschema b/libs/sra/built-in.vschema
deleted file mode 100644
index 3250879..0000000
--- a/libs/sra/built-in.vschema
+++ /dev/null
@@ -1,580 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/*==========================================================================
- * libsradb (and libwsradb) built-in schema
- */
-version 1;
-
-include 'ncbi/ncbi.vschema';
-include 'sra/454.vschema';
-include 'sra/illumina.vschema';
-include 'sra/abi.vschema';
-include 'sra/helicos.vschema';
-include 'sra/ion-torrent.vschema';
-
-/*--------------------------------------------------------------------------
- * functions
- */
-
-/* read_seg_from_readn
- *  reads in old READ_<N> read descriptors
- *  returns segmentation information for both reads and label in vector
- *
- *  "nreads" [ DATA ] - a per-spot value that should generally equal
- *  the number of READ_N descriptors found during function instantiation
- *
- *  "spot_len" [ DATA ] - calculated length of spot, used for dynamic
- *  read-length calculations
- */
-const U32 NCBI:SRA:readn:read_type   = 0;
-const U32 NCBI:SRA:readn:read_start  = 1;
-const U32 NCBI:SRA:readn:read_len    = 2;
-const U32 NCBI:SRA:readn:label_start = 3;
-const U32 NCBI:SRA:readn:label_len   = 4;
-
-extern function
-U32 [ 5 ] NCBI:SRA:read_seg_from_readn #1 ( U8 nreads, U32 spot_len );
-
-
-/* rewrite_spot_name
- *  given an old spotname directly from skey
- *  write according to platform rules, optionally with a prefix
- *
- *  "platform" [ CONST ] - which platform rules to use
- *
- *  "skey" [ DATA ] - skey string for row
- *
- *  "prefix" [ DATA, OPTIONAL ] - prefix for spot
- */
-extern function
-ascii NCBI:SRA:rewrite_spot_name #1 < INSDC:SRA:platform_id platform > ( ascii skey * ascii prefix );
-
-/* extract coordinates
- *  given a spotname with encoded coordinates
- *  extract them in reverse order into a vector
- *
- *  "platform" [ CONST ] - which platform rules to use
- *
- *  "skey" [ DATA ] - skey string for row
- */
-const U32 NCBI:SRA:coord:y      = 0;
-const U32 NCBI:SRA:coord:x      = 1;
-const U32 NCBI:SRA:coord:tile   = 2;
-const U32 NCBI:SRA:coord:lane   = 3;
-const U32 NCBI:SRA:coord:region = 2;
-const U32 NCBI:SRA:coord:panel  = 2;
-
-extern function
-INSDC:coord:val [ * ] NCBI:SRA:extract_coordinates #1 < INSDC:SRA:platform_id platform > ( ascii skey );
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:_454_:legacy
- *  produced by all loaders prior to v2
- */
-table NCBI:SRA:_454_:legacy #1 = NCBI:SRA:tbl:sra_nopos #1,
-    NCBI:tbl:base_space_nocol #1, NCBI:tbl:phred_quality_nocol #1,
-    NCBI:SRA:tbl:skeyname #1, NCBI:SRA:_454_:common #1
-{
-    /* COORDINATES
-     *  in addition to X and Y,
-     *  454 has REGION
-     */
-    INSDC:coord:val out_y_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:y > ( coords_from_skey );
-    INSDC:coord:val out_x_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:x > ( coords_from_skey );
-    readonly column INSDC:coord:val REGION = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:region > ( coords_from_skey );
-    I32 [ 3 ] coords_from_skey
-        = NCBI:SRA:extract_coordinates < SRA_PLATFORM_454 > ( out_skey );
-}
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:_454_:tbl:v0
- *  produced by original loader before the days of schema
- */
-extern function
-__untyped NCBI:SRA:_454_:untyped_0 ();
-
-extern function U16 NCBI:SRA:decode:CLIP #1 ( opaque in );
-physical __no_header U16 NCBI:SRA:_454_:encoding:CLIP #1 =
-{ return NCBI:SRA:decode:CLIP #1 ( @ ); }
-
-extern function NCBI:SRA:pos16 NCBI:SRA:decode:POSITION #1 ( opaque in );
-physical __no_header NCBI:SRA:pos16 NCBI:SRA:_454_:encoding:POSITION #1 =
-{ return NCBI:SRA:decode:POSITION #1 ( @ ); }
-
-extern function INSDC:2na:packed NCBI:SRA:decode:READ #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header INSDC:2na:packed NCBI:SRA:_454_:encoding:READ #1 =
-{ return NCBI:SRA:decode:READ #1 < SRA_PLATFORM_454 > ( @ ); }
-
-extern function any NCBI:SRA:decode:QUALITY #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header NCBI:quality:n_encoded:phred NCBI:SRA:_454_:encoding:QUALITY #1 =
-{ return NCBI:SRA:decode:QUALITY #1 < SRA_PLATFORM_454 > ( @ ); }
-
-extern function any NCBI:SRA:decode:SIGNAL #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header NCBI:isamp1 NCBI:SRA:_454_:encoding:SIGNAL #1 =
-{ return NCBI:SRA:decode:SIGNAL #1 < SRA_PLATFORM_454 > ( @ ); }
-
-extern function
-NCBI:SRA:pos16 NCBI:SRA:_454_:process_position #1 ( U16 position,
-    * INSDC:SRA:read_filter rd_filt, NCBI:isamp1 sig );
-
-table NCBI:SRA:_454_:tbl:v0 #1 = NCBI:SRA:_454_:legacy #1
-{
-    // recognize original loader
-    __untyped = NCBI:SRA:_454_:untyped_0 ();
-
-    // platform in binary
-    INSDC:SRA:platform_id out_platform
-        = < INSDC:SRA:platform_id > echo < SRA_PLATFORM_454 > ();
-
-    // bases and quality
-    INSDC:2na:packed out_2na_packed = .READ;
-    INSDC:quality:phred out_qual_phred = .QUALITY;
-
-    // synthesized label
-    ascii out_label
-        = < ascii > exists < "AdapterMate1LinkerMate2" > ( out_linker_sequence )
-        | < ascii > echo < "AdapterFragment" > ();
-    INSDC:coord:zero out_label_start
-        = < INSDC:coord:zero > exists < [ 0, 7, 12, 18 ] > ( out_linker_sequence )
-        | < INSDC:coord:zero > echo < [ 0, 7 ] > ();
-    INSDC:coord:len out_label_len
-        = < INSDC:coord:len > exists < [ 7, 5, 6, 5 ] > ( out_linker_sequence )
-        | < INSDC:coord:len > echo < [ 7, 8 ] > ();
-
-    // special sequences
-    INSDC:dna:text out_flow_chars
-        = < INSDC:dna:text > meta:read < "MSC454_FLOW_CHARS" > ();
-    INSDC:dna:text out_key_sequence
-        = < INSDC:dna:text > meta:read < "MSC454_KEY_SEQUENCE" > ();
-    INSDC:dna:text out_linker_sequence
-        = < INSDC:dna:text > meta:read < "MSC454_LINKER_SEQUENCE" > ();
-
-    // position column may be read directly
-    NCBI:SRA:pos16 out_position16
-        = NCBI:SRA:_454_:process_position #1 ( .POSITION, .RD_FILTER, .SIGNAL )
-        | NCBI:SRA:_454_:process_position #1 ( .POSITION, .RD_FILTER )
-        | NCBI:SRA:_454_:process_position #1 ( .POSITION );
-    INSDC:position:one out_position
-        = cast ( out_position16 );
-
-
-    /* READ DESCRIPTION
-     *  this version of 454 always has a key sequence
-     *  and may or may not have a linker
-     *  in the former case, the spot is well defined
-     *  in the latter, the linker must be dynamically located
-     */
-
-    // special function to generate reads
-    U32 [ 3 ] dynamic_read_desc
-        = NCBI:SRA:_454_:dynamic_read_desc < 4 > ( out_2na_bin, out_key_sequence, out_linker_sequence )
-        | NCBI:SRA:_454_:dynamic_read_desc ( out_2na_bin, out_key_sequence );
-
-    // fabricate nreads
-    U8 out_nreads
-        = < U8 > exists < 4 > ( out_linker_sequence )
-        | < U8 > echo < 2 > ();
-
-
-    // read_type
-    U32 read_type32
-        = < U32 > cut < NCBI:SRA:_454_:dyn_read_type > ( dynamic_read_desc );
-    INSDC:SRA:read_type out_read_type = cast ( read_type32 );
-
-    // read_seg and read_len
-    U32 uread_start
-        = < U32 > cut < NCBI:SRA:_454_:dyn_read_start > ( dynamic_read_desc );
-    INSDC:coord:zero out_read_start
-        = ( INSDC:coord:zero ) uread_start;
-    INSDC:coord:len out_read_len = ( INSDC:coord:len )
-        < U32 > cut < NCBI:SRA:_454_:dyn_read_len > ( dynamic_read_desc );
-
-    // read_filter
-    INSDC:SRA:read_filter out_rd_filter
-        = .RD_FILTER
-        | < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ( dynamic_read_desc );
-
-
-    /* clips - all may be absent although CQR is expected */
-    physical column NCBI:SRA:_454_:encoding:CLIP #1 .CLIP_ADAPTER_LEFT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #1 .CLIP_ADAPTER_RIGHT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #1 .CLIP_QUALITY_LEFT;
-    physical column NCBI:SRA:_454_:encoding:CLIP #1 .CLIP_QUALITY_RIGHT;
-
-    /* bases */
-    physical column NCBI:SRA:_454_:encoding:READ #1 .READ;
-    physical column NCBI:SRA:_454_:encoding:QUALITY #1 .QUALITY;
-
-    /* signal and base position */
-    physical column NCBI:SRA:_454_:encoding:SIGNAL #1 .SIGNAL;
-    physical column NCBI:SRA:_454_:encoding:POSITION #1 .POSITION;
-};
-
-
-/* NCBI:SRA:_454_:tbl:v1 #1
- *  written with implicit table schema
- *  columns have stored schema
- */
-table NCBI:SRA:_454_:tbl:v1 #1 = NCBI:SRA:_454_:legacy #1, NCBI:SRA:tbl:spotdesc_nophys #1
-{
-    // platform in binary
-    INSDC:SRA:platform_id out_platform
-        = .PLATFORM
-        | < INSDC:SRA:platform_id > echo < SRA_PLATFORM_454 > ();
-
-    // bases and quality
-    INSDC:2na:packed out_2na_packed = .READ;
-    INSDC:quality:phred out_qual_phred = .QUALITY;
-
-    // special sequences
-    INSDC:dna:text out_flow_chars = .FLOW_CHARS;
-    INSDC:dna:text out_key_sequence = .KEY_SEQUENCE;
-    // linker handled by sub-table
-
-    // position needs special processing
-    NCBI:SRA:pos16 out_position16
-        = NCBI:SRA:_454_:process_position #1 ( .POSITION, .RD_FILTER, .SIGNAL )
-        | NCBI:SRA:_454_:process_position #1 ( .POSITION, .RD_FILTER )
-        | NCBI:SRA:_454_:process_position #1 ( .POSITION );
-    INSDC:position:one out_position
-        = cast ( out_position16 );
-};
-
-
-/* NCBI:SRA:_454_:tbl:v1_2 #1
- *  no stored schema
- *  linker ignored if present
- */
-extern function
-__untyped NCBI:SRA:_454_:untyped_1_2a ();
-
-table NCBI:SRA:_454_:tbl:v1_2a #1 = NCBI:SRA:_454_:tbl:v1 #1
-{
-    // single linker present
-    __untyped = NCBI:SRA:_454_:untyped_1_2a ();
-
-    INSDC:dna:text out_linker_sequence = .LINKER_SEQUENCE;
-};
-
-extern function
-__untyped NCBI:SRA:_454_:untyped_1_2b ();
-
-table NCBI:SRA:_454_:tbl:v1_2b #1 = NCBI:SRA:_454_:tbl:v1 #1
-{
-    // linker missing or empty
-    __untyped = NCBI:SRA:_454_:untyped_1_2b ();
-};
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:Illumina:legacy
- *  produced by all loaders prior to v2
- */
-table NCBI:SRA:Illumina:legacy #1 = NCBI:SRA:tbl:sra #1,
-    NCBI:tbl:base_space_nocol #1, NCBI:SRA:Illumina:common #1
-{
-    // signal
-    column NCBI:fsamp4 SIGNAL
-        = ( NCBI:fsamp4 ) < NCBI:SRA:swapped_fsamp4 > NCBI:SRA:swap ( out_signal, out_x2na_bin )
-        | ( NCBI:fsamp4 ) < NCBI:SRA:rotated_fsamp4 > NCBI:SRA:rotate < false > ( out_signal, out_x2na_bin );
-
-    // intensity
-    column NCBI:fsamp4 INTENSITY
-        = < NCBI:fsamp4 > NCBI:SRA:denormalize ( out_norm_intensity, out_x2na_bin );
-    NCBI:fsamp4 out_norm_intensity
-        = ( NCBI:fsamp4 ) < NCBI:SRA:swapped_fsamp4 > NCBI:SRA:swap ( out_intensity, out_x2na_bin )
-        | ( NCBI:fsamp4 ) < NCBI:SRA:rotated_fsamp4 > NCBI:SRA:rotate < false > ( out_intensity, out_x2na_bin );
-
-    // noise
-    column NCBI:fsamp4 NOISE = out_noise;
-};
-
-/* NCBI:SRA:Illumina:tbl:v0
- *  produced by original loader before the days of schema
- */
-extern function INSDC:2na:packed NCBI:SRA:decode:READ #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header INSDC:2na:packed NCBI:SRA:Illumina:encoding:READ #1 =
-{ return NCBI:SRA:decode:READ #1 < SRA_PLATFORM_ILLUMINA > ( @ ); }
-
-extern function any NCBI:SRA:decode:QUALITY #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header NCBI:SRA:rotated_qual4 NCBI:SRA:Illumina:encoding:QUALITY #1 =
-{ return NCBI:SRA:decode:QUALITY #1 < SRA_PLATFORM_ILLUMINA > ( @ ); }
-physical __no_header NCBI:qual1 NCBI:SRA:Illumina:encoding:QUALITY2 #1 =
-{ return NCBI:SRA:decode:QUALITY #1 < SRA_PLATFORM_ILLUMINA > ( @ ); }
-
-extern function any NCBI:SRA:decode:SIGNAL #1 < INSDC:SRA:platform_id platform > ( opaque in );
-physical __no_header NCBI:SRA:rotated_fsamp4 NCBI:SRA:Illumina:encoding:SIGNAL #1 =
-{ return NCBI:SRA:decode:SIGNAL #1 < SRA_PLATFORM_ILLUMINA > ( @ ); }
-
-extern function any NCBI:SRA:decode:INTENSITY #1 ( opaque in );
-physical __no_header NCBI:SRA:rotated_fsamp4 NCBI:SRA:Illumina:encoding:INTENSITY #1 =
-{ return NCBI:SRA:decode:INTENSITY #1 ( @ ); }
-
-extern function any NCBI:SRA:decode:NOISE #1 ( opaque in );
-physical __no_header NCBI:fsamp4 NCBI:SRA:Illumina:encoding:NOISE #1 =
-{ return NCBI:SRA:decode:NOISE #1 ( @ ); }
-
-table NCBI:SRA:Illumina:tbl:v0 #1 = NCBI:SRA:Illumina:legacy #1, NCBI:SRA:tbl:skeyname #1
-{
-    // platform in binary
-    INSDC:SRA:platform_id out_platform
-        = < INSDC:SRA:platform_id > echo < SRA_PLATFORM_ILLUMINA > ();
-
-    // generate rewritten spot_name
-    ascii out_slx_prefix
-        = < ascii > meta:read < 'SLX_PREFIX' > ()
-        | < ascii > echo < '' > ();
-    ascii rewritten_spot_name
-        = NCBI:SRA:rewrite_spot_name < SRA_PLATFORM_ILLUMINA > ( out_skey, out_slx_prefix );
-
-    // coordinates
-    INSDC:coord:val out_y_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:y > ( coords_from_skey );
-    INSDC:coord:val out_x_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:x > ( coords_from_skey );
-    INSDC:coord:val out_tile_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:tile > ( coords_from_skey );
-    INSDC:coord:val out_lane_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:lane > ( coords_from_skey );
-    I32 [ 4 ] coords_from_skey
-        = NCBI:SRA:extract_coordinates < SRA_PLATFORM_ILLUMINA > ( out_skey );
-
-    // bases
-    INSDC:2na:packed out_2na_packed = .READ;
-
-    // fixed_spot_len
-    INSDC:coord:len static_fixed_spot_len = spot_len;
-
-    // nreads
-    U8 out_nreads
-        = < U8 > meta:value < 'NREADS' > ()
-        | < U8 > echo < 1 > ();
-
-    // read_start, read_len
-    INSDC:coord:zero out_read_start
-        = ( INSDC:coord:zero ) < U32 > cut < NCBI:SRA:readn:read_start > ( read_seg_from_readn )
-        | < INSDC:coord:zero > echo < 0 > ();
-    INSDC:coord:len out_read_len
-        = ( INSDC:coord:len ) < U32 > cut < NCBI:SRA:readn:read_len > ( read_seg_from_readn )
-        | spot_len;
-    U32 [ 5 ] read_seg_from_readn
-        = NCBI:SRA:read_seg_from_readn ( out_nreads, spot_len );
-
-    // read_type
-    U32 read_type_from_read_seg
-        = < U32 > cut < NCBI:SRA:readn:read_type > ( read_seg_from_readn );
-    INSDC:SRA:read_type out_read_type
-        = cast ( read_type_from_read_seg )
-        | ( INSDC:SRA:read_type ) < INSDC:SRA:xread_type > echo < SRA_READ_TYPE_BIOLOGICAL > ();
-
-    NCBI:SRA:rotated_fsamp4 out_signal = .SIGNAL;
-    NCBI:SRA:rotated_fsamp4 out_intensity = .INTENSITY;
-    NCBI:fsamp4 out_noise = .NOISE;
-
-    /* bases */
-    physical column NCBI:SRA:Illumina:encoding:READ #1 .READ;
-
-    /* signal, intensity and noise */
-    physical column NCBI:SRA:Illumina:encoding:SIGNAL #1 .SIGNAL;
-    physical column NCBI:SRA:Illumina:encoding:INTENSITY #1 .INTENSITY;
-    physical column NCBI:SRA:Illumina:encoding:NOISE #1 .NOISE;
-};
-
-
-extern function
-__untyped NCBI:SRA:Illumina:untyped_0a ();
-
-table NCBI:SRA:Illumina:tbl:v0a #1 = NCBI:SRA:Illumina:tbl:v0 #1, NCBI:SRA:Illumina:qual4_nocol #1
-{
-    __untyped = NCBI:SRA:Illumina:untyped_0a ();
-
-    // quality
-    NCBI:SRA:rotated_qual4 out_qual4_rotated = .QUALITY;
-    physical column NCBI:SRA:Illumina:encoding:QUALITY #1 .QUALITY;
-
-    INSDC:quality:phred out_qual2_phred = .QUALITY2;
-    physical column NCBI:SRA:Illumina:encoding:QUALITY2 #1 .QUALITY2;
-
-	/* INSDC:SRA:tbl:spotname inherited virtual productions
-	 *  virtual out_name_fmt = 0;
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited virtual productions
-	 *  virtual out_label = 0;
-	 *  virtual out_label_len = 0;
-	 *  virtual out_rd_filter = 0;
-	 *  virtual out_label_start = 0;
-	 */
-};
-
-extern function
-__untyped NCBI:SRA:Illumina:untyped_0b ();
-
-table NCBI:SRA:Illumina:tbl:v0b #1 = NCBI:SRA:Illumina:tbl:v0 #1, NCBI:tbl:phred_quality_nocol #1
-{
-    __untyped = NCBI:SRA:Illumina:untyped_0b ();
-
-    // quality
-    INSDC:quality:phred out_qual_phred
-        = .QUALITY
-        | .QUALITY2;
-
-    physical column NCBI:SRA:Illumina:encoding:QUALITY2 #1 .QUALITY;
-    physical column NCBI:SRA:Illumina:encoding:QUALITY2 #1 .QUALITY2;
-
-	/* INSDC:SRA:tbl:spotname inherited virtual productions
-	 *  virtual out_name_fmt = 0;
-	 */
-
-	/* INSDC:SRA:tbl:spotdesc inherited virtual productions
-	 *  virtual out_label = 0;
-	 *  virtual out_label_len = 0;
-	 *  virtual out_rd_filter = 0;
-	 *  virtual out_label_start = 0;
-	 */
-
-	/* INSDC:SRA:tbl:stats inherited virtual productions
-	 *  virtual max_spot_id = 0;
-	 *  virtual min_spot_id = 0;
-	 *  virtual in_stats_bin = 0;
-	 *  virtual bio_base_count = 0;
-	 */
-};
-
-table NCBI:SRA:Illumina:tbl:v1 #1 = NCBI:SRA:Illumina:legacy #1,
-    NCBI:SRA:tbl:spotdesc_nophys #1, NCBI:SRA:tbl:skeyname_nocol #2
-{
-    // platform in binary
-    INSDC:SRA:platform_id out_platform
-        = .PLATFORM
-        | < INSDC:SRA:platform_id > echo < SRA_PLATFORM_ILLUMINA > ();
-
-    // coordinates
-    INSDC:coord:val out_tile_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:tile > ( coords_from_spotname );
-    INSDC:coord:val out_lane_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:lane > ( coords_from_spotname );
-    I32 [ 4 ] coords_from_spotname
-        = NCBI:SRA:extract_coordinates < SRA_PLATFORM_ILLUMINA > ( _out_name );
-
-    // bases
-    INSDC:2na:packed out_2na_packed = .READ;
-
-    // quality2
-    INSDC:quality:phred out_qual2_phred = .QUALITY2;
-
-    // fixed_spot_len
-    INSDC:coord:len static_fixed_spot_len = spot_len;
-
-    NCBI:SRA:swapped_fsamp4 out_signal = .SIGNAL;
-    NCBI:SRA:swapped_fsamp4 out_intensity = .INTENSITY;
-    NCBI:fsamp4 out_noise = .NOISE;
-
-    // stray compatibility columns
-    physical column INSDC:dna:text .FLOW_CHARS;
-    physical column INSDC:dna:text .KEY_SEQUENCE;
-    physical column INSDC:dna:text .LINKER_SEQUENCE;
-};
-
-extern function
-__untyped NCBI:SRA:Illumina:untyped_1a ();
-
-alias NCBI:SRA:encoded_qual4 NCBI:SRA:comp_qual4;
-
-extern function
-NCBI:SRA:swapped_qual4 NCBI:SRA:qual4_decompress_v1 #1 ( any in );
-
-table NCBI:SRA:Illumina:tbl:v1a #1 = NCBI:SRA:Illumina:tbl:v1 #1, NCBI:SRA:Illumina:qual4_nocol #1
-{
-    __untyped = NCBI:SRA:Illumina:untyped_1a ();
-
-    // 4-channel quality
-    NCBI:SRA:swapped_qual4 out_qual4_swapped = .QUALITY;
-};
-
-extern function
-__untyped NCBI:SRA:Illumina:untyped_1b ();
-
-table NCBI:SRA:Illumina:tbl:v1b #1 = NCBI:SRA:Illumina:tbl:v1 #1, NCBI:tbl:phred_quality_nocol #1
-{
-    __untyped = NCBI:SRA:Illumina:untyped_1b ();
-
-    // single-channel quality
-    INSDC:quality:phred out_qual_phred = .QUALITY;
-};
-
-
-/*--------------------------------------------------------------------------
- * NCBI:SRA:ABI:legacy
- *  produced by all loaders prior to v2
- */
-table NCBI:SRA:ABI:legacy #1 = NCBI:SRA:tbl:sra #1,
-    NCBI:tbl:phred_quality_nocol #1, NCBI:SRA:ABI:common #1
-{
-};
-
-extern function
-__untyped NCBI:SRA:ABI:untyped_1 ();
-
-table NCBI:SRA:ABI:tbl:v1 #1 = NCBI:SRA:ABI:legacy #1,
-    NCBI:tbl:color_space_nocol #1, NCBI:SRA:tbl:spotdesc_nophys #1,
-    NCBI:SRA:tbl:skeyname_nocol #2
-{
-    __untyped = NCBI:SRA:ABI:untyped_1 ();
-
-    // platform in binary
-    INSDC:SRA:platform_id out_platform
-        = .PLATFORM
-        | < INSDC:SRA:platform_id > echo < SRA_PLATFORM_ABSOLID > ();
-
-    // coordinates
-    INSDC:coord:val out_panel_coord = ( INSDC:coord:val )
-        < I32 > cut < NCBI:SRA:coord:panel > ( coords_from_spotname );
-    I32 [ 4 ] coords_from_spotname
-        = NCBI:SRA:extract_coordinates < SRA_PLATFORM_ABSOLID > ( out_spot_name );
-    ascii out_spot_name
-        = INSDC:SRA:format_spot_name ( out_name_fmt, out_x_coord, out_y_coord );
-
-    // bases and quality
-    INSDC:2cs:packed out_2cs_packed = .CSREAD;
-    INSDC:dna:text out_cs_key = .CS_KEY;
-    INSDC:quality:phred out_qual_phred = .QUALITY;
-
-    // fixed_spot_len
-    INSDC:coord:len static_fixed_spot_len = spot_len;
-
-    NCBI:SRA:swapped_fsamp4 out_signal_swapped = .SIGNAL;
-
-    // stray compatibility columns
-    physical column INSDC:dna:text .FLOW_CHARS;
-    physical column INSDC:dna:text .KEY_SEQUENCE;
-    physical column INSDC:dna:text .LINKER_SEQUENCE;
-};
diff --git a/libs/sra/libsra-schema.vers b/libs/sra/libsra-schema.vers
deleted file mode 100644
index 9084fa2..0000000
--- a/libs/sra/libsra-schema.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.0
diff --git a/libs/sra/libsradb.vers b/libs/sra/libsradb.vers
deleted file mode 100644
index 55f20a1..0000000
--- a/libs/sra/libsradb.vers
+++ /dev/null
@@ -1 +0,0 @@
-3.1.13
diff --git a/libs/sra/libsradb.vers.h b/libs/sra/libsradb.vers.h
deleted file mode 100644
index 5c564cb..0000000
--- a/libs/sra/libsradb.vers.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define LIBSRADB_VERS 0x0301000D
diff --git a/libs/sra/libsrareader.vers b/libs/sra/libsrareader.vers
deleted file mode 100644
index 0664a8f..0000000
--- a/libs/sra/libsrareader.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.6
diff --git a/libs/sra/libsraschema.vers b/libs/sra/libsraschema.vers
deleted file mode 100644
index 9084fa2..0000000
--- a/libs/sra/libsraschema.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.0
diff --git a/libs/sra/libwsra-schema.vers b/libs/sra/libwsra-schema.vers
deleted file mode 100644
index ee90284..0000000
--- a/libs/sra/libwsra-schema.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.4
diff --git a/libs/sra/libwsradb.vers b/libs/sra/libwsradb.vers
deleted file mode 100644
index 55f20a1..0000000
--- a/libs/sra/libwsradb.vers
+++ /dev/null
@@ -1 +0,0 @@
-3.1.13
diff --git a/libs/sra/libwsraschema.vers b/libs/sra/libwsraschema.vers
deleted file mode 100644
index 9084fa2..0000000
--- a/libs/sra/libwsraschema.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.0
diff --git a/libs/sra/reader-abi.c b/libs/sra/reader-abi.c
deleted file mode 100644
index c48f541..0000000
--- a/libs/sra/reader-abi.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <sra/rd-extern.h>
-
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <sra/abi.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include <klib/text.h>
-
-#include "reader-cmn.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-typedef enum AbsolidReaderOptions_enum {
-    eOrigFormat  = 0x02,
-    eSignal      = 0x04,
-    eClipQual    = 0x08
-} AbsolidReaderOptions;
-
-/* column order is important here: see Init function below!!! */
-static
-const SRAReaderColumn AbsolidReader_master_columns_desc[] = {
-    {SRAREADER_COL_MANDATORY, "CSREAD", insdc_csfasta_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "CS_KEY", insdc_fasta_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "QUALITY", insdc_phred_t, NULL, NULL, 0},
-    {eClipQual, "TRIM_START", "INSDC:coord:zero", NULL, NULL, 0},
-    {eClipQual, "TRIM_LEN", "INSDC:coord:len", NULL, NULL, 0},
-    {eSignal | SRAREADER_COL_OPTIONAL, "SIGNAL", ncbi_fsamp4_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, NULL, NULL, NULL, NULL, 0} /* terminator */
-};
-
-struct AbsolidReader {
-    /* SRAReader always must be a first member! */
-    SRAReader dad;
-    uint32_t minReadLen;
-    /* current spot data shortcuts */
-    const SRAReaderColumn* csread;
-    const char** cs_key;
-    const SRAReaderColumn* qual1;
-    const INSDC_coord_zero** trim_start;
-    const INSDC_coord_len** trim_len;
-    const float** signal;
-    char prefix_buf[1024];
-    size_t prefix_sz;
-};
-
-static
-rc_t AbsolidReaderInit(const AbsolidReader* self,
-                       bool origFormat, bool noClip, uint32_t minReadLen, bool signal)
-{
-    rc_t rc = 0;
-    int options = origFormat ? eOrigFormat : 0;
-
-    CHECK_SELF(AbsolidReader);
-
-    options |= signal ? eSignal : 0;
-    options |= noClip ? 0 : eClipQual;
-    me->minReadLen = minReadLen;
-
-    if( (rc = SRAReaderInit(&self->dad, options, AbsolidReader_master_columns_desc)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[0], &me->csread, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[1], NULL, (const void***)&self->cs_key)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[2], &me->qual1, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[3], NULL, (const void***)&self->trim_start)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[4], NULL, (const void***)&self->trim_len)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &AbsolidReader_master_columns_desc[5], NULL, (const void***)&self->signal)) == 0 ) {
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderMake(const AbsolidReader** self, const SRATable* table,
-                                     const char* accession, bool origFormat,
-                                     bool noClip, uint32_t minReadLen,
-                                     spotid_t minSpotId, spotid_t maxSpotId, bool signal)
-{
-    rc_t rc = SRAReaderMake((const SRAReader**)self, sizeof **self, table, accession, minSpotId, maxSpotId);
-
-    if( rc == 0 ) {
-        rc = AbsolidReaderInit(*self, origFormat, noClip, minReadLen, signal);
-    }
-    if( rc != 0 ) {
-        AbsolidReaderWhack(*self);
-        *self = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderWhack(const AbsolidReader* self)
-{
-    return SRAReaderWhack(&self->dad);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderFirstSpot(const AbsolidReader* self)
-{
-    return SRAReaderFirstSpot(&self->dad);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSeekSpot(const AbsolidReader* self, spotid_t spot)
-{
-    return SRAReaderSeekSpot(&self->dad, spot);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderNextSpot(const AbsolidReader* self)
-{
-    return SRAReaderNextSpot(&self->dad);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderCurrentSpot(const AbsolidReader* self, spotid_t* spot)
-{
-    return SRAReaderCurrentSpot(&self->dad, spot);
-}
-
-LIB_EXPORT rc_t CC AbsolidReader_SpotInfo(const AbsolidReader* self,
-                                          const char** spotname, size_t* spotname_sz,
-                                          uint32_t* spot_len, uint32_t* num_reads)
-{
-    rc_t rc = SRAReader_SpotInfo(&self->dad, spotname, spotname_sz, spot_len, num_reads);
-    if( rc == 0 ) {
-        if( spot_len ) {
-            if( self->dad.options & eClipQual ) {
-                *spot_len = **self->trim_len;
-            }
-            if( *spot_len < self->minReadLen ) {
-                *spot_len = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSpotName(const AbsolidReader* self,
-                                         const char** prefix, size_t* prefix_sz,
-                                         const char** suffix, size_t* suffix_sz)
-{
-    rc_t rc = 0;
-    const char* spotname;
-    size_t spotname_sz;
-
-    CHECK_SELF(AbsolidReader);
-
-    rc = SRAReader_SpotInfo(&self->dad, &spotname, &spotname_sz, NULL, NULL);
-    if( rc == 0 ) {
-        if( !self->prefix_sz || self->prefix_sz > spotname_sz || strncmp(spotname, self->prefix_buf, self->prefix_sz) != 0 ) {
-            if( spotname_sz == 0 ) {
-                me->prefix_sz = 0;
-            } else {
-                int k = 0;
-                size_t psz = spotname_sz;
-                while( psz > 0 && k < 4 ) {
-                    /* take out PLATE_X_Y and optional label _(F|R)3 */
-                    while( psz > 0 && isdigit(*(spotname + psz)) ) {
-                        psz--;
-                    }
-                    if(*(spotname + psz) == 'F' || *(spotname + psz) == 'R') {
-                        if( --psz > 0 && !isdigit(*(spotname + psz)) ) {
-                            psz--;
-                        }
-                        continue;
-                    } else if( psz > 0 ) {
-                        psz--;
-                        k++;
-                    }
-                }
-                if( psz > 0 ) {
-                    me->prefix_sz = psz + 2;
-                    string_copy(me->prefix_buf, sizeof(me->prefix_buf), spotname, me->prefix_sz);
-                } else {
-                    me->prefix_sz = 0;
-                }
-            }
-            me->prefix_buf[me->prefix_sz] = '\0';
-        }
-        if( suffix ) {
-            *suffix = &spotname[self->prefix_sz];
-        }
-        if( suffix_sz ) {
-            *suffix_sz = spotname_sz - self->prefix_sz;
-        }
-        if( prefix ) {
-            *prefix = self->prefix_buf;
-        }
-        if( prefix_sz ) {
-            *prefix_sz = self->prefix_sz;
-        }
-    }
-    return rc;
-
-}
-
-LIB_EXPORT rc_t CC AbsolidReader_SpotReadInfo(const AbsolidReader* self, uint32_t readId, SRAReadTypes* read_type, 
-                                              const char** read_label, INSDC_coord_len* read_label_sz,
-                                              INSDC_coord_zero* read_start, INSDC_coord_len* read_len)
-{
-    INSDC_coord_zero rs;
-    INSDC_coord_len rl;
-
-    rc_t rc = SRAReader_SpotReadInfo(&self->dad, readId, read_type, read_label, read_label_sz, &rs, &rl);
-    if( rc == 0 ) {
-        if( read_start || read_len ) {
-            if( self->dad.options & eClipQual ) {
-                INSDC_coord_zero end = rs + rl - 1;
-                INSDC_coord_zero trim_end = ((**self->trim_start) + (**self->trim_len)) - 1;
-                if( end < (**self->trim_start) || rs > trim_end ) {
-                    rl = 0;
-                } else {
-                    if( (**self->trim_start) > rs && (**self->trim_start) <= end ) {
-                        rl -= (**self->trim_start) - rs;
-                        rs = (**self->trim_start);
-                    }
-                    if( end > trim_end ) {
-                        rl = trim_end - rs + 1;
-                    }
-                }
-            }
-            if( rl < self->minReadLen ) {
-                rl = 0;
-            }
-            if( read_start ) {
-                *read_start = rl ? rs : 0;
-            }
-            if( read_len ) {
-                *read_len = rl;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderHeader(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    int ret = 0;
-
-    const char* spotname;
-    size_t x;
-    int spotname_sz;
-    INSDC_coord_len read_label_sz = 0;
-    const char* read_label;
-
-    CHECK_SELF(AbsolidReader);
-    CHECK_SPOT(self->dad);
-
-    if( (rc = AbsolidReaderSpotName(me, NULL, NULL, &spotname, &x)) != 0 ) {
-        return rc;
-    }
-    spotname_sz = (int)x;
-    if( readId > 0 ) {
-        if( (rc = AbsolidReader_SpotReadInfo(self, readId, NULL, &read_label, &read_label_sz, NULL, NULL)) != 0 ) {
-            return rc;
-        }
-    }
-    if( self->dad.options & eOrigFormat ) {
-        char tmp[1024];
-        if( spotname_sz == 0 ) {
-            spotname_sz = snprintf(tmp, sizeof(tmp) - 1, "%s.%u", self->dad.accession, self->dad.spot);
-            if ( spotname_sz < 0 )
-                return RC ( rcSRA, rcString, rcConstructing, rcData, rcCorrupt );
-            spotname = tmp;
-        }
-        if( readId > 0 && read_label_sz > 0 ) {
-            ret = snprintf(data, dsize, ">%.*s%s%.*s", spotname_sz, spotname, spotname_sz ? "_" : "", read_label_sz, read_label);
-        } else {
-            ret = snprintf(data, dsize, ">%.*s", spotname_sz, spotname);
-        }
-    } else {
-        if( readId > 0 && read_label_sz > 0 ) {
-            ret = snprintf(data, dsize, ">%s.%u %.*s%s%.*s",
-                self->dad.accession, self->dad.spot, spotname_sz, spotname, spotname_sz ? "_" : "", read_label_sz, read_label);
-        } else {
-            ret = snprintf(data, dsize, ">%s.%u %.*s",
-                           self->dad.accession, self->dad.spot, spotname_sz, spotname);
-        }
-    }
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-    if( ret < 0 ) {
-        ret = 0;
-        rc = RC(rcSRA, rcString, rcConstructing, rcMessage, rcUnknown);
-    } else if( ret >= (int)dsize ) {
-#else
-    if( ret < 0 || ret >= (int)dsize ) {
-#endif
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    if( written != NULL ) {
-        *written = ret;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderBase(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    INSDC_coord_zero read_start = 0;
-    INSDC_coord_len read_len = 0;
-
-    CHECK_SELF(AbsolidReader);
-    CHECK_SPOT(self->dad);
-
-    if( readId > 0 ) {
-        if( (rc = AbsolidReader_SpotReadInfo(self, readId--, NULL, NULL, NULL, &read_start, &read_len)) != 0 ) {
-            return rc;
-        }
-    } else {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcFormat, rcUnsupported);
-    }
-    if( read_len < self->minReadLen ) {
-        read_len = 0;
-    }
-    /* for cs_key */
-    read_len++;
-    if( written != NULL ) {
-        *written = read_len;
-    }
-    if( read_len >= dsize ) {
-        return RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        const char* b = self->csread->base;
-        data[0] = (*me->cs_key)[readId];
-        memcpy(&data[1], &b[read_start], read_len - 1);
-    }
-    data[read_len] = '\0';
-    return rc;
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderQuality(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    INSDC_coord_zero read_start = 0;
-    INSDC_coord_len j = 0, read_len = 0;
-
-    CHECK_SELF(AbsolidReader);
-    CHECK_SPOT(self->dad);
-
-    if( readId > 0 ) {
-        if( (rc = AbsolidReader_SpotReadInfo(self, readId, NULL, NULL, NULL, &read_start, &read_len)) != 0 ) {
-            return rc;
-        }
-    } else {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcFormat, rcUnsupported);
-    }
-    if( read_len >= self->minReadLen && me->qual1->size ) {
-        const int8_t* q = me->qual1->base;
-        char* d = data;
-        INSDC_coord_len i;
-
-        /* read end */
-        read_len += read_start;
-        for(i = read_start; i < read_len; i++) {
-            int x;
-            if( j + 2 > dsize ) {
-                /* do not overflow buffer in case it's too small */
-                d = data;
-            }
-            x = snprintf(d, dsize - j, "%i ", (int)(q[i]));
-            if ( x < 0 )
-                return RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-            d += x;
-            j += x;
-        }
-        j--;
-        d[j] = '\0';
-    }
-    if( written != NULL ) {
-        *written = j;
-    }
-    if( j >= dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-}
-
-static
-rc_t AbsolidReaderSignal(const AbsolidReader* self, uint32_t readId, int idx, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    INSDC_coord_len j = 0;
-
-    CHECK_SELF(AbsolidReader);
-    CHECK_SPOT(self->dad);
-
-    if( me->signal != NULL ) {
-        INSDC_coord_zero read_start = 0;
-        INSDC_coord_len read_len = 0;
-        if( readId > 0 ) {
-            if( (rc = AbsolidReader_SpotReadInfo(self, readId, NULL, NULL, NULL, &read_start, &read_len)) != 0 ) {
-                return rc;
-            }
-        } else {
-            return RC(rcSRA, rcFormatter, rcConstructing, rcFormat, rcUnsupported);
-        }
-        if( read_len >= self->minReadLen ) {
-            const float* s = *me->signal;
-            char* d = data;
-            INSDC_coord_len i;
-
-            /* read end */
-            read_len += read_start;
-            for(i = read_start; i < read_len; i++) {
-                int x;
-                if( j + 9 > dsize ) {
-                    /* do not overflow buffer in case it's too small */
-                    d = data;
-                }
-                x = snprintf(d, dsize - j, "%.6g ", s[i * 4 + idx]);
-                if ( x < 0 )
-                    return RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-                d += x;
-                j += x;
-            }
-            *d = '\0';
-            --j;
-        }
-    }
-    if( written != NULL ) {
-        *written = j;
-    }
-    if( j >= dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSignalFTC(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    return AbsolidReaderSignal(self, readId, 0, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSignalCY3(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    return AbsolidReaderSignal(self, readId, 1, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSignalTXR(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    return AbsolidReaderSignal(self, readId, 2, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC AbsolidReaderSignalCY5(const AbsolidReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    return AbsolidReaderSignal(self, readId, 3, data, dsize, written);
-}
diff --git a/libs/sra/reader-cmn.c b/libs/sra/reader-cmn.c
deleted file mode 100644
index dff7544..0000000
--- a/libs/sra/reader-cmn.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <sra/extern.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sra/types.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "sra-debug.h"
-#include "reader-cmn.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-/* mandatory columns used by generic reader */
-/* column order is IMPORTANT here: see Init function below!!! */
-static
-const SRAReaderColumn SRAReader_mandatory_cols[] = {
-    {SRAREADER_COL_OPTIONAL, "NAME", "ascii", NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "SPOT_LEN", "INSDC:coord:len", NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "READ_START", "INSDC:coord:zero", NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "READ_LEN", "INSDC:coord:len", NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "READ_TYPE", sra_read_type_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "LABEL", vdb_ascii_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "LABEL_START", "INSDC:coord:zero", NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "LABEL_LEN", "INSDC:coord:len", NULL, NULL, 0},
-};
-
-static
-rc_t SRAReader_ColumnsOpen(SRAReader *self)
-{
-    rc_t rc = 0;
-    int i = 0;
-
-    while(self->cols[i].name != NULL) {
-        if( self->cols[i].opt == SRAREADER_COL_MANDATORY || (self->options & self->cols[i].opt) ) {
-            rc = SRATableOpenColumnRead(self->table, &self->cols[i].col, self->cols[i].name, self->cols[i].datatype);
-            if( rc != 0 ) {
-                if( ((self->cols[i].opt & SRAREADER_COL_OPTIONAL) && GetRCState(rc) == rcNotFound) ) {
-                    PLOGERR(klogInfo, (klogWarn, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
-                    rc = 0;
-                } else if( GetRCState(rc) == rcExists ) {
-                    rc = 0;
-                } else {
-                    PLOGERR(klogInfo, (klogErr, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
-                    break;
-                }
-            }
-        }
-        i++;
-    }
-    return rc;
-}
-
-static rc_t SRAReader_ColumnsRead( SRAReader * self )
-{
-    rc_t rc = 0;
-    int i = 0;
-
-    while ( self->cols[ i ].name != NULL )
-    {
-        if ( self->cols[ i ].col != NULL )
-        {
-            bitsz_t bitofs = 0;
-            rc = SRAColumnRead( self->cols[ i ].col, self->spot, &self->cols[ i ].base, &bitofs, &self->cols[ i ].size );
-            if ( rc != 0 || bitofs != 0 )
-            {
-                SRADBG (( "%s: read column %s spot %u %R\n", __func__, self->cols[i].name, self->spot, rc ));
-                break;
-            }
-        }
-        self->cols[ i ].size /= 8;
-        i++;
-    }
-    return rc;
-}
-
-static
-void SRAReader_ColumnsRelease(SRAReader *self)
-{
-    rc_t rc = 0;
-    int i = 0;
-
-    while(self->cols[i].name != NULL) {
-        if(self->cols[i].col != NULL && (rc = SRAColumnRelease(self->cols[i].col)) != 0) {
-            SRADBG (("%s: release column %s %R\n",
-                     __func__, self->cols[i].name, rc));
-        }
-        self->cols[i++].col = NULL;
-    }
-}
-
-static
-rc_t SRAReaderAlloc(SRAReader** reader, size_t size, const char* accession)
-{
-    if( reader == NULL || size < sizeof(**reader) || accession == NULL || accession[0] == '\0' ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    *reader = calloc(1, size);
-    if( *reader == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else {
-		(*reader)->accession = strdup(accession);
-        if( (*reader)->accession == NULL ) {
-            free(*reader);
-            *reader = NULL;
-            return RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        }
-    }
-    return 0;
-}
-
-rc_t SRAReaderInit(const SRAReader* self, int options, const SRAReaderColumn* const cols)
-{
-    rc_t rc = 0;
-    int i = 0, j = 0, m = sizeof(SRAReader_mandatory_cols) / sizeof(SRAReaderColumn);
-    const SRAReaderColumn* col_read_len;
-
-    CHECK_SELF(SRAReader);
-    if( cols == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    me->options = SRAREADER_COL_OPTIONAL | options; /* always try to open optional cols */
-    /* copy mandatory columns */
-    memcpy(me->cols, SRAReader_mandatory_cols, sizeof(SRAReader_mandatory_cols));
-    /* copy reader specific columns */
-    for(i = 0; cols[i].name != NULL && m < 64; i++, m++) {
-        for(j = 0; j < m; j++) {
-            if( strcmp(cols[i].name, self->cols[j].name) == 0 &&
-                strcmp(cols[i].datatype, self->cols[j].datatype) == 0 ) {
-                return RC(rcSRA, rcFormatter, rcConstructing, rcData, rcDuplicate);
-            }
-        }
-        memcpy(&me->cols[m], &cols[i], sizeof(SRAReaderColumn));
-    }
-    if( (rc = SRAReader_ColumnsOpen(me)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[0], &me->spot_name, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[1], NULL, (const void***)&self->spot_len)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[2], NULL, (const void***)&self->read_start)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[3], NULL, (const void***)&self->read_len)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[3], &col_read_len, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[4], NULL, (const void***)&self->read_type)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[5], NULL, (const void***)&self->label)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[6], NULL, (const void***)&self->label_start)) == 0 &&
-        (rc = SRAReader_FindColData(me, &SRAReader_mandatory_cols[7], NULL, (const void***)&self->label_len)) == 0 ) {
-        ((SRAReader*)self)->read_len_size = &col_read_len->size;
-    }
-    return rc;
-}
-
-rc_t SRAReaderMake(const SRAReader** self, size_t size, const SRATable* table,
-                   const char* accession, spotid_t minSpotId, spotid_t maxSpotId)
-{
-    rc_t rc = 0;
-    SRAReader* me = NULL;
-
-    if( table == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    } else {
-        if( (rc = SRAReaderAlloc(&me, size, accession)) == 0 ) {
-            me->table = table;
-            if( (rc = SRATableMinSpotId(me->table, &me->minSpotId)) == 0 &&
-                (rc = SRATableMaxSpotId(me->table, &me->maxSpotId)) == 0 ) {
-                if( rc == 0 && minSpotId > 0 && (rc = SRAReaderSeekSpot(me, minSpotId)) == 0 ) {
-                    me->minSpotId = minSpotId;
-                }
-                if( rc == 0 && maxSpotId > 0 && (rc = SRAReaderSeekSpot(me, maxSpotId)) == 0 ) {
-                    me->maxSpotId = maxSpotId;
-                }
-            }
-            /* reset after seekspot to initial state */
-            me->spot = 0;
-        }
-    }
-    if( rc != 0 ) {
-        SRAReaderWhack(me);
-    } else {
-        *self = me;
-    }
-    return rc;
-}
-
-rc_t SRAReaderWhack ( const SRAReader* self )
-{
-    if( self != NULL) {
-        SRAReader* me = (SRAReader*)self;
-        SRAReader_ColumnsRelease(me);
-        free(me->accession);
-        free(me);
-    }
-    return 0;
-}
-
-rc_t SRAReader_FindColData ( const SRAReader* self,
-        const SRAReaderColumn* definition, const SRAReaderColumn** col, const void*** base )
-{
-    int i;
-
-    CHECK_SELF(SRAReader);
-    if( definition == NULL || (col == NULL && base == NULL) ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    }
-    if( definition->opt != 0 && !(self->options & definition->opt) ) {
-        return 0;
-    }
-    for(i = 0; me->cols[i].name != NULL; i++) {
-        if( self->cols[i].col != NULL &&
-            strcmp(self->cols[i].name, definition->name) == 0 &&
-            strcmp(self->cols[i].datatype, definition->datatype) == 0 ) {
-            if( col != NULL ) {
-                *col = &self->cols[i];
-            } else {
-                *base = (const void**)&self->cols[i].base;
-            }
-            return 0;
-        }
-    }
-    return (definition->opt & SRAREADER_COL_OPTIONAL) ? 0 : RC(rcSRA, rcFormatter, rcAccessing, rcColumn, rcNotFound);
-}
-
-rc_t SRAReaderFirstSpot ( const SRAReader* self )
-{
-    CHECK_SELF(SRAReader);
-    return SRAReaderSeekSpot(me, self->minSpotId);
-}
-
-rc_t SRAReaderSeekSpot ( const SRAReader* self, spotid_t spot )
-{
-    rc_t rc = 0;
-
-    CHECK_SELF(SRAReader);
-
-    if( spot < self->minSpotId ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcRow, rcTooShort);
-    }
-    if( spot > self->maxSpotId ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcRow, rcTooBig);
-    }
-    if( me->spot != spot ) {
-        me->spot = spot;
-        if( (rc = SRAReader_ColumnsRead(me)) != 0 ) {
-            me->spot = 0;
-        }
-    }
-    return rc;
-}
-
-rc_t SRAReaderNextSpot( const SRAReader* self )
-{
-    rc_t rc = 0;
-
-    CHECK_SELF(SRAReader);
-    CHECK_SPOT(*self);
-
-    me->spot++;
-    while( me->spot <= self->maxSpotId ) {
-        if( (rc = SRAReader_ColumnsRead(me)) == 0 ) {
-            return 0;
-        }
-        if( GetRCState(rc) != rcNotFound ) {
-            me->spot = 0;
-            return rc;
-        }
-        me->spot++;
-    }
-    CHECK_SPOT(*self);
-    return 0;
-}
-
-rc_t SRAReaderCurrentSpot( const SRAReader* self, spotid_t* spot)
-{
-    CHECK_SELF(SRAReader);
-    if( spot == NULL ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    }
-    CHECK_SPOT(*self);
-    *spot = me->spot;
-    return 0;
-}
-
-rc_t SRAReader_SpotInfo( const SRAReader* self, const char** spotname, size_t* spotname_sz,
-                                                uint32_t* spot_len, uint32_t* num_reads )
-{
-    CHECK_SELF(SRAReader);
-    CHECK_SPOT(*self);
-
-    if( spotname && !spotname_sz ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcInvalid);
-    }
-    if( spotname ) {
-        if( me->spot_name ) {
-            *spotname = me->spot_name->base;
-            *spotname_sz = me->spot_name->size;
-	        if( *spotname && *spotname_sz && (*spotname)[*spotname_sz - 1] == '\0' ) {
-	            /* Consider zero-padded spotname */
-	            *spotname_sz = strlen(*spotname);
-	        }
-        } else {
-            *spotname = "";
-            *spotname_sz = 0;
-        }
-    }
-    if( spot_len ) {
-        *spot_len = **self->spot_len;
-    }
-    if( num_reads ) {
-        *num_reads = (*self->read_len_size) / sizeof(**self->read_len);
-    }
-    return 0;
-}
-
-rc_t SRAReader_SpotReadInfo( const SRAReader* self, uint32_t readId, SRAReadTypes* read_type,
-                             const char** read_label, INSDC_coord_len* read_label_sz,
-                             INSDC_coord_zero* read_start, INSDC_coord_len* read_len )
-{
-    CHECK_SELF(SRAReader);
-    CHECK_SPOT(*self);
-
-    if( read_label && !read_label_sz ) {
-        return RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcInvalid);
-    }
-    if( readId < 1 || readId > ((*(me->read_len_size)) / sizeof(**self->read_len)) ) {
-        return RC(rcSRA, rcTable, rcReading, rcId, rcInvalid);
-    }
-    --readId;
-    if( read_start ) {
-        *read_start = (*self->read_start)[readId];
-    }
-    if( read_len ) {
-        *read_len = (*self->read_len)[readId];
-    }
-    if( read_type ) {
-        *read_type = (*self->read_type)[readId];
-    }
-    if( read_label ) {
-        if( self->label && self->label_start && self->label_len ) {
-            *read_label = &((*self->label)[(*self->label_start)[readId]]);
-            *read_label_sz = (*self->label_len)[readId];
-        } else {
-            *read_label = "";
-            *read_label_sz = 0;
-        }
-    }
-    return 0;
-}
-
-rc_t SRAReader_GetCurrentSpotData( const SRAReader* self, char *data, size_t dsize, size_t* written )
-{
-    return RC(rcSRA, rcFormatter, rcReading, rcInterface, rcIncomplete);
-}
-
-rc_t SRAReader_GetNextSpotData( const SRAReader* self, char *data, size_t dsize, size_t* written )
-{
-    return RC(rcSRA, rcFormatter, rcReading, rcInterface, rcIncomplete);
-}
diff --git a/libs/sra/reader-cmn.h b/libs/sra/reader-cmn.h
deleted file mode 100644
index 21a5b9e..0000000
--- a/libs/sra/reader-cmn.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sra_reader_
-#define _h_sra_reader_
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#define SRAREADER_COL_MANDATORY 0x00
-#define SRAREADER_COL_OPTIONAL 0x01
-
-typedef struct SRAReaderColumn_struct {
-    uint32_t opt;
-    const char* name;
-    const char* datatype;
-    const SRAColumn* col;
-    const void* base;
-    bitsz_t size;
-} SRAReaderColumn;
-
-typedef struct SRAReader_struct {
-    char* accession;
-    const SRATable* table;
-    spotid_t minSpotId;
-    spotid_t maxSpotId;
-    uint32_t options;
-    SRAReaderColumn cols[64]; /* max of 64 columns, must be enough, last one must have NULL name */
-    /* current spot data */
-    spotid_t spot;
-    const SRAReaderColumn* spot_name;
-    const INSDC_coord_len** spot_len;
-    const INSDC_coord_zero** read_start;
-    const INSDC_coord_len** read_len;
-    const bitsz_t* read_len_size;
-    const SRAReadTypes** read_type;
-    const char** label;
-    const INSDC_coord_zero** label_start;
-    const INSDC_coord_len** label_len;
-} SRAReader;
-
-/* Common macro for self pointer and current spot state validation */
-#define CHECK_SELF(ObjType) \
-                   ObjType* me = (ObjType*)self; \
-                   if(self == NULL) { \
-                       return RC(rcSRA, rcFormatter, rcAccessing, rcSelf, rcNull); \
-                   }
-
-#define CHECK_SPOT(Obj) \
-                   if( (Obj).spot < (Obj).minSpotId ) { \
-                       return RC(rcSRA, rcFormatter, rcAccessing, rcRow, rcUnknown); \
-                   } \
-                   if( (Obj).spot > (Obj).maxSpotId ) { \
-                       return RC(rcSRA, rcFormatter, rcAccessing, rcRow, rcExhausted); \
-                   }
-
-rc_t SRAReaderMake(const SRAReader** self, size_t size, const SRATable* table,
-                   const char* accession, spotid_t minSpotId, spotid_t maxSpotId);
-
-rc_t SRAReaderInit(const SRAReader* self, int options, const SRAReaderColumn* const cols);
-
-/* Whack
- *  releases object obtained from SRAReaderMake
- *  or AddRef ( see above )
- */
-rc_t SRAReaderWhack(const SRAReader *self);
-
-/* FindColData
- * find OPENED column by it's definition and return it's base pointer or col struct
- */
-rc_t SRAReader_FindColData(const SRAReader* self, const SRAReaderColumn* definition, const SRAReaderColumn** col, const void*** base);
-
-/* FirstSpot
- *  set current spot to first in the run
- */
-rc_t SRAReaderFirstSpot(const SRAReader* self);
-
-/* SeekSpot
- *  set current spot
- * if error occured current spot position becomes 0
- */
-rc_t SRAReaderSeekSpot(const SRAReader* self, spotid_t spot);
-
-/* NextSpot
- *  Seek to next spot from current
- */
-rc_t SRAReaderNextSpot(const SRAReader* self);
-
-/* CurrentSpot
- *  Get current spot
- *  sopt [OUT] - pointer to assign value of the current spot
- * returns GetRCState(rc) == rcExhausted when out of spots
- */
-rc_t SRAReaderCurrentSpot(const SRAReader* self, spotid_t* spot);
-
-/* SpotInfo
- *  Get current spot information
- *  spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
- *  spotname_sz [OUT] - pointer to assign value of the length of the spot name (can be NULL)
- *  spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
- *  num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
- */
-rc_t SRAReader_SpotInfo(const SRAReader* self, const char** spotname, size_t* spotname_sz,
-                                               uint32_t* spot_len, uint32_t* num_reads);
-
-/* SpotReadInfo
- *  Get read information for current spot
- *  readid    [IN]  - 1-based read id
- *  read_type [OUT] - pointer to assign value of the read type (can be NULL)
- *  read_label[OUT] - pointer to assign value of the read label (can be NULL)
- *  read_label_sz [OUT] - pointer to assign value of the length of the read label (can be NULL)
- *  read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
- *  read_len  [OUT] - pointer to assign value of the read length (can be NULL)
- *  if start and len is == 0 read is empty
- */
-rc_t SRAReader_SpotReadInfo(const SRAReader* self, uint32_t readId, SRAReadTypes* read_type,
-                            const char** read_label, INSDC_coord_len* read_label_sz,
-                            INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
-
-/* GetCurrentSpotData
- *  retrieve current spot data as a blob
- *  data   [IN] - pointer to buffer for printing
- *  dsize  [IN] - data buffer size
- *  written [IN,OUT] - optional number of bytes occupied by buffer, may by more than dsize
- *  MUST BE SEPARATELY DEFINED for each reader format
- */
-rc_t SRAReader_GetCurrentSpotData(const SRAReader* self, char *data, size_t dsize, size_t* written);
-
-/* GetNextSpotData (streaming function)
- *  move to the next spot and retrieve current spot data as a blob
- *  data   [IN] - pointer to buffer for printing
- *  dsize  [IN] - data buffer size
- *  written [IN,OUT] - optional number of bytes occupied by buffer, may by more than dsize
- *  MUST BE SEPARATELY DEFINED for each reader format
- */
-rc_t SRAReader_GetNextSpotData(const SRAReader* self, char *data, size_t dsize, size_t* written);
-
-#endif /* _h_sra_reader_ */
diff --git a/libs/sra/reader-fastq.c b/libs/sra/reader-fastq.c
deleted file mode 100644
index 11bd156..0000000
--- a/libs/sra/reader-fastq.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <sra/rd-extern.h>
-
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <sra/fastq.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "reader-cmn.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-typedef enum FastqReaderOptions_enum {
-    eBaseSpace   = 0x02,
-    eColorSpace  = 0x04,
-    eOrigFormat  = 0x08,
-    ePrintLabel  = 0x10,
-    ePrintReadId = 0x20,
-    eClipQual    = 0x40,
-    eUseQual     = 0x80
-} FastqReaderOptions;
-
-/* column order is important here: see Init function below!!! */
-static
-const SRAReaderColumn FastqReader_master_columns_desc[] = {
-    {eBaseSpace, "READ", insdc_fasta_t, NULL, NULL, 0},
-    {eColorSpace, "CSREAD", insdc_csfasta_t, NULL, NULL, 0},
-    {eColorSpace, "CS_KEY", insdc_fasta_t, NULL, NULL, 0},
-    {eUseQual, "QUALITY", insdc_phred_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "SPOT_GROUP", vdb_ascii_t, NULL, NULL, 0},
-    {eClipQual, "TRIM_START", "INSDC:coord:zero", NULL, NULL, 0},
-    {eClipQual, "TRIM_LEN", "INSDC:coord:len", NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, NULL, NULL, NULL, NULL, 0} /* terminator */
-};
-
-struct FastqReader {
-    /* SRAReader always must be a first member! */
-    SRAReader dad;
-    uint32_t minReadLen;
-    int offset;
-    char csKey;
-    /* current spot data shortcuts */
-    const SRAReaderColumn* read;
-    const SRAReaderColumn* csread;
-    const char** cs_key;
-    const uint8_t** qual1;
-    const SRAReaderColumn* spot_group;
-    const INSDC_coord_zero** trim_start;
-    const INSDC_coord_len** trim_len;
-    /* quality conversion table */
-    char q2ascii[256];
-};
-
-static
-rc_t FastqReaderInit(const FastqReader* self,
-                     bool colorSpace, bool origFormat, bool fasta, bool printLabel, bool printReadId,
-                     bool noClip, uint32_t minReadLen, int offset, char csKey)
-{
-    rc_t rc = 0;
-    int options = colorSpace ? eColorSpace : eBaseSpace;
-
-    CHECK_SELF(FastqReader);
-
-    options |= origFormat ? eOrigFormat : 0;
-    options |= printLabel ? ePrintLabel : 0;
-    options |= printReadId ? ePrintReadId : 0;
-    options |= noClip ? 0 : eClipQual;
-    options |= fasta ? 0 : eUseQual;
-    me->minReadLen = minReadLen;
-    me->offset = offset > 0 ? offset : 33;
-    me->csKey = csKey;
-
-    if( (rc = SRAReaderInit(&self->dad, options, FastqReader_master_columns_desc)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[0], &me->read, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[1], &me->csread, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[2], NULL, (const void***)&self->cs_key)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[3], NULL, (const void***)&self->qual1)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[4], &me->spot_group, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[5], NULL, (const void***)&self->trim_start)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &FastqReader_master_columns_desc[6], NULL, (const void***)&self->trim_len)) == 0 ) {
-        memset(me->q2ascii, '~', sizeof(self->q2ascii));
-        for(options = 0; options < 256; options++) {
-            me->q2ascii[options] = options + self->offset;
-            if( self->q2ascii[options] == '~' ) {
-                break;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReaderMake(const FastqReader** self, const SRATable* table, const char* accession,
-                                   bool colorSpace, bool origFormat, bool fasta, bool printLabel, bool printReadId,
-                                   bool noClip, uint32_t minReadLen, char offset, char csKey,
-                                   spotid_t minSpotId, spotid_t maxSpotId)
-{
-    rc_t rc = SRAReaderMake((const SRAReader**)self, sizeof **self, table, accession, minSpotId, maxSpotId);
-
-    if( rc == 0 ) {
-        rc = FastqReaderInit(*self, colorSpace, origFormat, fasta,
-                             printLabel, printReadId, noClip, minReadLen, offset, csKey);
-    }
-    if( rc != 0 ) {
-        FastqReaderWhack(*self);
-        *self = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReaderWhack(const FastqReader* self)
-{
-    return SRAReaderWhack(&self->dad);
-}
-
-LIB_EXPORT rc_t CC FastqReaderFirstSpot(const FastqReader* self)
-{
-    return SRAReaderFirstSpot(&self->dad);
-}
-
-LIB_EXPORT rc_t CC FastqReaderSeekSpot(const FastqReader* self, spotid_t spot)
-{
-    return SRAReaderSeekSpot(&self->dad, spot);
-}
-
-LIB_EXPORT rc_t CC FastqReaderNextSpot(const FastqReader* self)
-{
-    return SRAReaderNextSpot(&self->dad);
-}
-
-LIB_EXPORT rc_t CC FastqReaderCurrentSpot(const FastqReader* self, spotid_t* spot)
-{
-    return SRAReaderCurrentSpot(&self->dad, spot);
-}
-
-LIB_EXPORT rc_t CC FastqReader_SpotInfo(const FastqReader* self,
-                                        const char** spotname, size_t* spotname_sz,
-                                        const char** spotgroup, size_t* spotgroup_sz,
-                                        uint32_t* spot_len, uint32_t* num_reads)
-{
-    rc_t rc = SRAReader_SpotInfo(&self->dad, spotname, spotname_sz, spot_len, num_reads);
-    if( rc == 0 ) {
-        if( spotgroup && !spotgroup_sz ) {
-            return RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcInvalid);
-        }
-        if( spot_len ) {
-            if( self->dad.options & eClipQual ) {
-                *spot_len = **self->trim_len;
-            }
-            if( *spot_len < self->minReadLen ) {
-                *spot_len = 0;
-            }
-        }
-        if( spotgroup ) {
-            if( self->spot_group != NULL ) {
-                *spotgroup = self->spot_group->base;
-                *spotgroup_sz = self->spot_group->size;
-                if(*spotgroup && *spotgroup_sz && (*spotgroup)[*spotgroup_sz - 1] == '\0' ) {
-                    /* Consider zero-padded spotgroup */
-                    *spotgroup_sz = strlen(*spotgroup);
-                }
-            } else {
-                *spotgroup = NULL;
-                *spotgroup_sz = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReader_SpotReadInfo(const FastqReader* self, uint32_t readId, SRAReadTypes* read_type, 
-                                            const char** read_label, INSDC_coord_len* read_label_sz,
-                                            INSDC_coord_zero* read_start, INSDC_coord_len* read_len)
-{
-    INSDC_coord_zero rs;
-    INSDC_coord_len rl;
-
-    rc_t rc = SRAReader_SpotReadInfo(&self->dad, readId, read_type, read_label, read_label_sz, &rs, &rl);
-    if( rc == 0 ) {
-        if( read_start || read_len ) {
-            if( self->dad.options & eClipQual ) {
-                INSDC_coord_zero end = rs + rl - 1;
-                INSDC_coord_zero trim_end = ((**self->trim_start) + (**self->trim_len)) - 1;
-                if( end < (**self->trim_start) || rs > trim_end ) {
-                    rl = 0;
-                } else {
-                    if( (**self->trim_start) > rs && (**self->trim_start) <= end ) {
-                        rl -= (**self->trim_start) - rs;
-                        rs = (**self->trim_start);
-                    }
-                    if( end > trim_end ) {
-                        rl = trim_end - rs + 1;
-                    }
-                }
-            }
-            if( rl < self->minReadLen ) {
-                rl = 0;
-            }
-            if( read_start ) {
-                *read_start = rl ? rs : 0;
-            }
-            if( read_len ) {
-                *read_len = rl;
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t FastqReader_Header(const FastqReader* self, bool* label, 
-                        char* buf, size_t maxlen, size_t* written,
-                        char prefix, int readId)
-{
-    rc_t rc = 0;
-    int ret = 0;
-
-    const char* spotname;
-    size_t x;
-    int spotname_sz;
-    uint32_t spot_len;
-    uint32_t num_reads;
-    INSDC_coord_len read_len, read_label_sz = 0;
-    const char* read_label;
-    bool addLabel = label ? *label : (self->dad.options & ePrintLabel);
-
-    if( (rc = FastqReader_SpotInfo(self, &spotname, &x, NULL, NULL, &spot_len, &num_reads)) != 0 ) {
-        return rc;
-    }
-    spotname_sz = (int)x;
-    if( readId > 0 ) {
-        if( (rc = FastqReader_SpotReadInfo(self, readId, NULL, &read_label, &read_label_sz, NULL, &read_len)) != 0 ) {
-            return rc;
-        }
-    }
-    /* do not add empty labels */
-    addLabel = read_label_sz > 0 ? addLabel : false;
-
-    if( self->dad.options & eOrigFormat ) {
-        char tmp[1024];
-        if( spotname_sz == 0 ) {
-            ret = snprintf(tmp, sizeof(tmp) - 1, "%s.%u", self->dad.accession, self->dad.spot);
-            if ( ret < 0 )
-                return RC ( rcSRA, rcString, rcConstructing, rcData, rcCorrupt );
-            spotname = tmp;
-            spotname_sz = ret;
-        }
-        if( addLabel && readId > 0 ) {
-            ret = snprintf(buf, maxlen, "%c%.*s_%.*s", prefix, spotname_sz, spotname, read_label_sz, read_label);
-        } else {
-            ret = snprintf(buf, maxlen, "%c%.*s", prefix, spotname_sz, spotname);
-        }
-    } else {
-        const char* sep = spotname_sz ? " " : "";
-        if( addLabel && readId > 0 ) {
-            sep = spotname_sz ? "_" : "";
-            if( self->dad.options & ePrintReadId ) {
-                ret = snprintf(buf, maxlen, "%c%s.%u.%d %.*s%s%.*s length=%d",
-                    prefix, self->dad.accession, self->dad.spot, readId, spotname_sz, spotname, sep, read_label_sz, read_label, read_len);
-            } else {
-                ret = snprintf(buf, maxlen, "%c%s.%u %.*s%s%.*s length=%d",
-                    prefix, self->dad.accession, self->dad.spot, spotname_sz, spotname, sep, read_label_sz, read_label, read_len);
-            }
-        } else if( readId > 0 ) {
-            if( self->dad.options & ePrintReadId ) {
-                ret = snprintf(buf, maxlen, "%c%s.%u.%d %.*s%slength=%d",
-                    prefix, self->dad.accession, self->dad.spot, readId, spotname_sz, spotname, sep, read_len);
-            } else {
-                ret = snprintf(buf, maxlen, "%c%s.%u %.*s%slength=%d",
-                    prefix, self->dad.accession, self->dad.spot, spotname_sz, spotname, sep, read_len);
-            }
-        } else {
-            ret = snprintf(buf, maxlen, "%c%s.%u %.*s%slength=%u",
-                prefix, self->dad.accession, self->dad.spot, spotname_sz, spotname, sep, spot_len);
-        }
-    }
-
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-    if( ret < 0 ) {
-        ret = 0;
-        rc = RC(rcSRA, rcString, rcConstructing, rcMessage, rcUnknown);
-    } else if( ret >= (int)maxlen ) {
-#else
-    if( ret < 0 || ret >= (int)maxlen ) {
-#endif
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    if( written != NULL ) {
-        *written = ret;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReaderBaseName(const FastqReader* self, uint32_t readId,
-                                       bool* label, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(self->dad);
-    rc = FastqReader_Header(me, label, data, dsize, written, '@', readId);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReaderQualityName(const FastqReader* self, uint32_t readId,
-                                          bool* label, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(self->dad);
-    if( self->qual1 == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMode, rcNotAvailable);
-    } else {
-        rc = FastqReader_Header(me, label, data, dsize, written, '+', readId);
-    }
-    return rc;
-}
-
-
-#if _DEBUGGING && defined __GNUC__
-#pragma message "TBD determine if we need conversions between color spaces at all"
-#endif
-
-static
-rc_t FastqReader_CSconvert(char from, char to, char* first)
-{
-#define CSKEY2IDX(k) (k == 'A' ? 0 : (k == 'C' ? 1 : (k == 'G' ? 2 : (k == 'T' ? 3 : -1))))
-
-    const char* x[4][4] = {
-        /*   TO:      A       C       G       T   */
-        /* F: A */ {"0123", "1032", "2301", "3210"},
-        /* R: C */ {"1032", "0123", "3210", "2301"},
-        /* O: G */ {"2301", "3210", "0123", "1032"},
-        /* M: T */ {"3210", "2301", "1032", "0123"}};
-
-    if( to != '\0' && *first != '.' && toupper(*first) != 'N' ) {
-        int ifrom = CSKEY2IDX(toupper(from));
-        int ito = CSKEY2IDX(toupper(to));
-        int ifirst = *first - '0';
-
-        if( ifrom < 0 || ito < 0 || ifirst < 0 || ifirst > 3 ) {
-            return RC(rcSRA, rcString, rcConverting, rcParam, rcInvalid);
-        }
-        *first = x[ifrom][ito][ifirst];
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC FastqReaderBase(const FastqReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    uint32_t num_reads;
-    INSDC_coord_zero read_start = 0;
-    INSDC_coord_len read_len = 0;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(self->dad);
-
-    if( readId > 0 ) {
-        if( (rc = FastqReader_SpotReadInfo(self, readId--, NULL, NULL, NULL, &read_start, &read_len)) != 0 ) {
-            return rc;
-        }
-    } else if( (rc = FastqReader_SpotInfo(self, NULL, NULL, NULL, NULL, &read_len, &num_reads)) != 0 ) {
-        return rc;
-    } else if( (me->dad.options & eColorSpace) && num_reads > 2 ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcFormat, rcUnsupported);
-    }
-    if( me->dad.options & eColorSpace ) {
-        read_len++;
-    }
-    if( written != NULL ) {
-        *written = read_len;
-    }
-    if( read_len >= dsize ) {
-        return RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    if( me->dad.options & eColorSpace ) {
-        const char* b = self->csread->base;
-        data[0] = me->csKey == '\0' ? (*self->cs_key)[readId] : me->csKey;
-        memcpy(&data[1], &b[read_start], read_len - 1);
-        if( read_len > 1 ) {
-            rc = FastqReader_CSconvert((*self->cs_key)[readId], data[0], &data[1]);
-        }
-    } else {
-        const char* b = self->read->base;
-        memcpy(data, &b[read_start], read_len);
-    }
-    data[read_len] = '\0';
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReaderQuality(const FastqReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    INSDC_coord_zero read_start = 0;
-    INSDC_coord_len read_len = 0;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(self->dad);
-
-    if( self->qual1 == NULL ) {
-        return RC(rcSRA, rcString, rcConstructing, rcMode, rcNotAvailable);
-    }
-    if( readId > 0 ) {
-        if( (rc = FastqReader_SpotReadInfo(self, readId, NULL, NULL, NULL, &read_start, &read_len)) != 0 ) {
-            return rc;
-        }
-    } else if( (rc = FastqReader_SpotInfo(self, NULL, NULL, NULL, NULL, &read_len, NULL)) != 0 ) {
-        return rc;
-    }
-
-    if( read_len < self->minReadLen ) {
-        read_len = 0;
-    }
-    if( me->dad.options & eColorSpace ) {
-        read_len++;
-    }
-    if( written != NULL ) {
-        *written = read_len;
-    }
-    if( read_len >= dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        const uint8_t* q = *self->qual1;
-        char* d = data;
-        INSDC_coord_len i, j;
-
-        if( me->dad.options & eColorSpace ) {
-            *d++ = me->offset;
-            --read_len;
-        }
-        /* read end */
-        read_len += read_start;
-        for(j = 0, i = read_start; i < read_len; i++, j++) {
-            d[j] = self->q2ascii[q[i]];
-        }
-        d[j] = '\0';
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReader_GetCurrentSpotData(const FastqReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t len = 0, left = dsize, w = 0;
-    char* b = data;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(me->dad);
-
-    rc = FastqReaderBaseName(self, 0, NULL, b, left, &w);
-    len += ++w;
-    if( rc != 0 ) {
-        if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-            return rc;
-        }
-        b = data, left = dsize;
-    } else {
-        b[w - 1] = '\n'; b += w; left -= w;
-    }
-
-    rc = FastqReaderBase(self, 0, b, left, &w);
-    len += ++w;
-    if( rc != 0 ) {
-        if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-            return rc;
-        }
-        b = data, left = dsize;
-    } else {
-        b[w - 1] = '\n'; b += w; left -= w;
-    }
-    if( self->qual1 != NULL ) {
-        rc = FastqReaderQualityName(self, 0, NULL, b, left, &w);
-        len += ++w;
-        if( rc != 0 ) {
-            if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-                return rc;
-            }
-            b = data, left = dsize;
-        } else {
-            b[w - 1] = '\n'; b += w; left -= w;
-        }
-        rc = FastqReaderQuality(self, 0, b, left, &w);
-        len += ++w; b[w - 1] = '\n';
-        if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-            return rc;
-        }
-    }
-    if( written != NULL ) {
-        *written = len;
-    }
-    if( len > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReader_GetCurrentSpotSplitData(const FastqReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t len = 0, left = dsize, w = 0;
-    char* b = data;
-    uint32_t r, num_reads;
-
-    CHECK_SELF(FastqReader);
-    CHECK_SPOT(me->dad);
-
-    if( (rc = FastqReader_SpotInfo(self, NULL, NULL, NULL, NULL, NULL, &num_reads)) != 0 ) {
-        return rc;
-    }
-    for(r = 1; r <= num_reads; r++) {
-        rc = FastqReaderBaseName(self, r, NULL, b, left, &w);
-        len += ++w;
-        if( rc != 0 ) {
-            if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-                return rc;
-            }
-            b = data, left = dsize;
-        } else {
-            b[w - 1] = '\n'; b += w; left -= w;
-        }
-        rc = FastqReaderBase(self, r, b, left, &w);
-        len += ++w;
-        if( rc != 0 ) {
-            if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-                return rc;
-            }
-            b = data, left = dsize;
-        } else {
-            b[w - 1] = '\n'; b += w; left -= w;
-        }
-        if( self->qual1 != NULL ) {
-            rc = FastqReaderQualityName(self, r, NULL, b, left, &w);
-            len += ++w;
-            if( rc != 0 ) {
-                if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-                    return rc;
-                }
-                b = data, left = dsize;
-            } else {
-                b[w - 1] = '\n'; b += w; left -= w;
-            }
-            rc = FastqReaderQuality(self, r, b, left, &w);
-            len += ++w;
-            if( rc != 0 ) {
-                if( rc != 0 && !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-                    return rc;
-                }
-                b = data, left = dsize;
-            } else {
-                b[w - 1] = '\n'; b += w; left -= w;
-            }
-        }
-    }
-
-    if( written != NULL ) {
-        *written = len;
-    }
-    if( len > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReader_GetNextSpotData(const FastqReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = FastqReaderNextSpot(self);
-    if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcUnknown ) {
-        rc = FastqReaderFirstSpot(self);
-    }
-    if( rc == 0 ) {
-        rc = FastqReader_GetCurrentSpotData(self, data, dsize, written);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC FastqReader_GetNextSpotSplitData(const FastqReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = FastqReaderNextSpot(self);
-    if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcUnknown ) {
-        rc = FastqReaderFirstSpot(self);
-    }
-    if( rc == 0 ) {
-        rc = FastqReader_GetCurrentSpotSplitData(self, data, dsize, written);
-    }
-    return rc;
-}
diff --git a/libs/sra/reader-illumina.c b/libs/sra/reader-illumina.c
deleted file mode 100644
index 4c4e6d3..0000000
--- a/libs/sra/reader-illumina.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <sra/rd-extern.h>
-
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <sra/illumina.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include <va_copy.h>
-
-#include "reader-cmn.h"
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-typedef enum IlluminaReaderOptions_enum {
-    eRead = 0x02,
-    eQual1 = 0x04,
-    eQual4 = 0x08,
-    eIntensity = 0x10,
-    eNoise = 0x20,
-    eSignal = 0x40,
-    eQSeq  = 0x80
-} IlluminaReaderOptions;
-
-/* column order is important here: see Init function below!!! */
-static
-const SRAReaderColumn IlluminaReader_master_columns_desc[] = {
-    {SRAREADER_COL_OPTIONAL, "LANE", vdb_int32_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "TILE", vdb_int32_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "X", vdb_int32_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "Y", vdb_int32_t, NULL, NULL, 0},
-    {eRead | eQSeq, "READ", insdc_fasta_t, NULL, NULL, 0},
-    {eQual1 | eQSeq, "QUALITY", insdc_phred_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eQual4, "QUALITY", ncbi_qual4_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eSignal, "SIGNAL", ncbi_fsamp4_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eNoise, "NOISE", ncbi_fsamp4_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eIntensity, "INTENSITY", ncbi_fsamp4_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eQSeq, "READ_FILTER", sra_read_filter_t, NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL | eQSeq , "SPOT_GROUP", vdb_ascii_t, NULL, NULL, 0},
-    {0, NULL, NULL, NULL, NULL, 0} /* terminator */
-};
-
-struct IlluminaReader {
-    /* SRAReader always must be a first member! */
-    SRAReader dad;
-    unsigned char phred2logodds_printable[256];
-    /* current spot data shortcuts */
-    const int32_t** lane;
-    const int32_t** tile;
-    const int32_t** x;
-    const int32_t** y;
-    const SRAReaderColumn* read;
-    const SRAReaderColumn* qual1;
-    const signed char** qual4;
-    const float** signal;
-    const float** noise;
-    const float** intensity;
-    const uint8_t** rfilter;
-    const SRAReaderColumn* spot_group;
-};
-
-static
-rc_t IlluminaReaderInit(const IlluminaReader* self, bool read, bool qual1, bool qual4, bool intensity, bool noise, bool signal, bool qseq)
-{
-    rc_t rc = 0;
-    int options = read ? eRead : 0;
-
-    CHECK_SELF(IlluminaReader);
-
-    options |= qual1 ? eQual1 : 0;
-    options |= qual4 ? eQual4 : 0;
-    options |= intensity ? eIntensity : 0;
-    options |= noise ? eNoise : 0;
-    options |= signal ? eSignal : 0;
-    options |= qseq ? eQSeq : 0;
-
-    if( (rc = SRAReaderInit(&self->dad, options, IlluminaReader_master_columns_desc)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[0], NULL, (const void***)&self->lane)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[1], NULL, (const void***)&self->tile)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[2], NULL, (const void***)&self->x)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[3], NULL, (const void***)&self->y)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[4], &me->read, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[5], &me->qual1, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[6], NULL, (const void***)&self->qual4)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[7], NULL, (const void***)&self->signal)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[8], NULL, (const void***)&self->noise)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[9], NULL, (const void***)&self->intensity)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[10], NULL, (const void***)&self->rfilter)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &IlluminaReader_master_columns_desc[11], &me->spot_group, NULL)) == 0) {
-    }
-    if( self->qual1 != NULL ) {
-        int i;
-        const float offset = (float)64.499;
-        me->phred2logodds_printable[0] = (unsigned char)offset;
-        for(i = 1; i < 256; i++) {
-            me->phred2logodds_printable[i] = (unsigned char)(10 * log(pow(10, i / 10.0) - 1) / log(10) + offset);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderMake(const IlluminaReader** self, const SRATable* table, const char* accession,
-                          bool read, bool qual1, bool qual4, bool intensity, bool noise, bool signal, bool qseq,
-                          spotid_t minSpotId, spotid_t maxSpotId)
-{
-    rc_t rc = SRAReaderMake((const SRAReader**)self, sizeof **self, table, accession, minSpotId, maxSpotId);
-    if( rc == 0 ) {
-        rc = IlluminaReaderInit(*self, read, qual1, qual4, intensity, noise, signal, qseq);
-    }
-    if( rc != 0 ) {
-        IlluminaReaderWhack(*self);
-        *self = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderWhack(const IlluminaReader* self)
-{
-    return SRAReaderWhack( &self->dad );
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderFirstSpot(const IlluminaReader* self)
-{
-    return SRAReaderFirstSpot( &self->dad );
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderSeekSpot(const IlluminaReader* self, spotid_t spot)
-{
-    return SRAReaderSeekSpot( &self->dad, spot );
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderNextSpot(const IlluminaReader* self)
-{
-    return SRAReaderNextSpot( &self->dad );
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderCurrentSpot(const IlluminaReader* self, spotid_t* spot)
-{
-    return SRAReaderCurrentSpot( &self->dad, spot );
-}
-
-LIB_EXPORT rc_t CC IlluminaReader_SpotInfo(const IlluminaReader* self,
-                                           const char** spotname, size_t* spotname_sz,
-                                           INSDC_coord_val* lane, INSDC_coord_val* tile, 
-                                           INSDC_coord_val* x, INSDC_coord_val* y,
-                                           uint32_t* spot_len, uint32_t* num_reads)
-{
-    rc_t rc = SRAReader_SpotInfo(&self->dad, spotname, spotname_sz, spot_len, num_reads);
-    if( rc == 0 ) {
-        if( lane ) {
-            *lane = (self->lane && *self->lane) ? **self->lane : 0;
-        }
-        if( tile ) {
-            *tile = (self->tile && *self->tile) ? **self->tile : ((self->dad.spot / 10001) + 1);
-        }
-        if( x ) {
-            *x = (self->x && *self->x) ? **self->x : 0;
-        }
-        if( y ) {
-            *y = (self->y && *self->y) ? **self->y : self->dad.spot;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReader_SpotReadInfo(const IlluminaReader* self, uint32_t readId, SRAReadTypes* read_type,
-                                               const char** read_label, INSDC_coord_len* read_label_sz,
-                                               INSDC_coord_zero* read_start, INSDC_coord_len* read_len)
-{
-    return SRAReader_SpotReadInfo(&self->dad, readId, read_type,
-                                  read_label, read_label_sz, read_start, read_len);
-}
-
-static
-int kludge_snprintf ( char *buff, size_t bsize, const char *fmt, ... )
-{
-    int status;
-    va_list args, args2;
-
-    va_start ( args, fmt );
-    va_copy ( args2, args );
-
-    status = vsnprintf ( buff, bsize, fmt, args );
-    if ( status < 0 )
-    {
-        size_t kludge_size = 64 * 1024;
-        void *kludge = malloc ( kludge_size );
-        if ( kludge != NULL )
-        {
-            status = vsnprintf ( kludge, kludge_size, fmt, args2 );
-            if ( status >= 0 )
-            {
-                memcpy ( buff, kludge, ( size_t ) status > bsize ? bsize : ( size_t ) status );
-                if ( ( size_t ) status < bsize )
-                    buff [ status ] = 0;
-            }
-            free ( kludge );
-        }
-    }
-
-    va_end ( args2 );
-    va_end ( args );
-
-    return status;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderBase(const IlluminaReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    int sz = 0;
-    uint32_t spot_len;
-    INSDC_coord_val lane, tile, x, y;
-
-    CHECK_SELF(IlluminaReader);
-    CHECK_SPOT(me->dad);
-
-    if( data == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcNull);
-    } else if( !(self->dad.options & eRead) ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMessage, rcUnexpected);
-    } else if( (rc = IlluminaReader_SpotInfo(self, NULL, NULL, &lane, &tile, &x, &y, &spot_len, NULL)) == 0 ) {
-        sz = snprintf(data, dsize, "%d\t%d\t%d\t%d\t", lane, tile, x, y);
-        if( sz < 0 ) {
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-            rc = RC(rcSRA, rcString, rcConstructing, rcNoObj, rcUnknown);
-#else
-            /* both approaches are wrong - the error code is rcBuffer, rcInsufficient */
-            rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-#endif
-        } else {
-            sz += spot_len;
-            if( sz >= (int)dsize ) {
-                rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-            } else {
-                size_t len = 0;
-                sz -= spot_len;
-                while(len < spot_len) {
-                    const char* b = self->read->base;
-                    data[sz + len] = b[len];
-                    if( data[sz + len] == 'N' ) {
-                        data[sz + len] = '.';
-                    }
-                    ++len;
-                }
-                sz += spot_len;
-                data[sz] = '\0';
-            }
-        }
-    }
-    if( written != NULL ) {
-        *written = sz;
-    }
-    return rc;
-}
-
-static
-rc_t IlluminaReader_4floats(const IlluminaReader* self, const float** col_data, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    int sz = 0;
-    const float* f = NULL;
-    uint32_t i, spot_len;
-    INSDC_coord_val lane, tile, x, y;
-
-    CHECK_SELF(IlluminaReader);
-    CHECK_SPOT(me->dad);
-
-    if( data == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcNull);
-    } else if( (rc = IlluminaReader_SpotInfo(self, NULL, NULL, &lane, &tile, &x, &y, &spot_len, NULL)) == 0 ) {
-        if( col_data == NULL || *col_data == NULL ) {
-            /* optional column is missing */
-            if( written != NULL ) {
-                *written = 0;
-            }
-            data[0] = '\0';
-        } else {
-            f = *col_data;
-            sz = snprintf(data, dsize, "%d\t%d\t%d\t%d", lane, tile, x, y);
-            if( sz < 0 ) {
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-                rc = RC(rcSRA, rcString, rcConstructing, rcNoObj, rcUnknown);
-#else
-                rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-#endif
-            } else {
-                for(i = 0; rc == 0 && i < spot_len; i++, f += 4) {
-                    int x = sz >= (int)dsize ? 0 : sz;
-                    x = snprintf(&data[x], dsize - x, "\t%.*f %.*f %.*f %.*f", f[0] ? 1 : 0, f[0], f[1] ? 1 : 0, f[1],
-                                 f[2] ? 1 : 0,  f[2], f[3] ? 1 : 0,  f[3]);
-                    if( x < 0 ) {
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-                        rc = RC(rcSRA, rcString, rcConstructing, rcNoObj, rcUnknown);
-#else
-                        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-#endif
-                    }
-                    sz += x;
-                }
-                if( rc == 0 && written != NULL ) {
-                    *written = sz;
-                }
-            }
-        }
-    }
-    if( rc == 0 && sz >= (int)dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderNoise(const IlluminaReader* self, char* data, size_t dsize, size_t* written)
-{
-    return IlluminaReader_4floats(self, self->noise, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderIntensity(const IlluminaReader* self, char* data, size_t dsize, size_t* written)
-{
-    return IlluminaReader_4floats(self, self->intensity, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderSignal(const IlluminaReader* self, char* data, size_t dsize, size_t* written)
-{
-    return IlluminaReader_4floats(self, self->signal, data, dsize, written);
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderQuality1(const IlluminaReader* self, uint32_t readId, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t sz = 0;
-    const uint8_t* p = NULL;
-
-    CHECK_SELF(IlluminaReader);
-    CHECK_SPOT(me->dad);
-
-    if( data == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcNull);
-    } else if( !(self->dad.options & eQual1) ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMessage, rcUnexpected);
-    } else if( self->qual1 == NULL || self->qual1->size == 0 ) {
-        /* empty value */
-    } else if( readId > 0 ) {
-        INSDC_coord_zero read_start;
-        INSDC_coord_len read_len;
-        if( (rc = IlluminaReader_SpotReadInfo(self, readId, NULL, NULL, NULL, &read_start, &read_len)) == 0 ) {
-            sz = read_len;
-            p = self->qual1->base;
-            p += read_start;
-        }
-    } else {
-        uint32_t spot_len;
-        if( (rc = IlluminaReader_SpotInfo(self, NULL, NULL, NULL, NULL, NULL, NULL, &spot_len, NULL)) == 0 ) {
-            sz = spot_len;
-            p = self->qual1->base;
-        }
-    }
-    if( rc == 0 ) {
-        if( sz >= dsize ) {
-            rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-        } else {
-            size_t i;
-            for(i = 0; i < sz; i++) {
-                data[i] = self->phred2logodds_printable[p[i]];
-            }
-            data[sz] = '\0';
-        }
-    }
-    if( written != NULL ) {
-        *written = sz;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderQuality4(const IlluminaReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    uint32_t spot_len;
-
-    CHECK_SELF(IlluminaReader);
-    CHECK_SPOT(me->dad);
-
-    if( data == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcNull);
-    } else if( self->qual4 == NULL ) {
-        /* optional column is missing */
-        if( written != NULL ) {
-            *written = 0;
-        }
-        data[0] = '\0';
-    } else if( (rc = IlluminaReader_SpotInfo(self, NULL, NULL, NULL, NULL, NULL, NULL, &spot_len, NULL)) == 0 ) {
-        int sz = spot_len * 20 - 1; /* no \t at line start */
-        if( written != NULL ) {
-            *written = sz;
-        }
-        if( sz >= (int)dsize ) {
-            rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-        } else {
-            const signed char* q4 = *self->qual4;
-            int x;
-            uint32_t len = 0;
-            for(sz = 0; rc == 0 && len < spot_len; len++, q4 += 4) {
-                x = snprintf(&data[sz], dsize - sz, "%s%4d %4d %4d %4d", len > 0 ? "\t" : "", q4[0], q4[1], q4[2], q4[3]);
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-                if( x < 0 ) {
-                    rc = RC(rcSRA, rcString, rcConstructing, rcNoObj, rcUnknown);
-#else
-                if( x < 0 || ( size_t ) sz + x >= dsize ) {
-                    rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-#endif
-                }
-                sz += x;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC IlluminaReaderQSeq(const IlluminaReader* self, uint32_t readId, bool spot_group,
-                                      char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    const char* spotname;
-    size_t spotname_sz;
-    uint32_t nreads, spotlen;
-    INSDC_coord_val lane, tile, x, y;
-    int sz = 0;
-
-    CHECK_SELF(IlluminaReader);
-    CHECK_SPOT(me->dad);
-
-    if( data == NULL ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcNull);
-    } else if( !(self->dad.options & eQSeq) ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMessage, rcUnexpected);
-    } else if( (rc = IlluminaReader_SpotInfo(self, &spotname, &spotname_sz, &lane, &tile, &x, &y, &spotlen, &nreads)) == 0 ) {
-        INSDC_coord_zero read_start = 0;
-        INSDC_coord_len read_len = spotlen;
-        if( readId > 0 ) {
-            rc = IlluminaReader_SpotReadInfo(self, readId, NULL, NULL, NULL, &read_start, &read_len);
-        }
-        if( rc == 0 ) {
-            const char* sg = "0";
-            int sg_sz = 1;
-            const char* runid = "0";
-            size_t runid_sz = 1;
-            int i = 0;
-
-            if( spotname_sz > 0 ) {
-                const char* c = spotname + spotname_sz;
-                while( i < 4 && c != NULL ) {
-                    c = memrchr(spotname, ':', c - spotname);
-                    if( c != NULL ) {
-                        i++;
-                    }
-                }
-                if( i == 4 ) {
-                    spotname_sz = c - spotname;
-                    c = memrchr(spotname, '_', spotname_sz);
-                    if( c != NULL ) {
-                        runid = c + 1;
-                        runid_sz = spotname_sz - (c - spotname) - 1;
-                        spotname_sz = c - spotname;
-                    }
-                } else {
-                    spotname_sz = 0;
-                }
-            }
-            if( spotname_sz == 0 ) {
-                spotname = self->dad.accession;
-                spotname_sz = strlen(spotname);
-            }
-            if( spot_group && self->spot_group && self->spot_group->size > 0 ) {
-                sg = self->spot_group->base;
-                sg_sz = self->spot_group->size;
-            }
-            i = snprintf(data, dsize, "%.*s\t%.*s\t%d\t%d\t%d\t%d\t%.*s\t%d\t",
-                (int)spotname_sz, spotname, (int)runid_sz, runid, lane, tile, x, y, sg_sz, sg, readId > 0 ? readId : 1);
-#if SNPRINTF_ACTUALLY_WORKED_THE_WAY_YOU_THINK
-            if( i < 0 ) {
-                rc = RC(rcSRA, rcString, rcConstructing, rcNoObj, rcUnknown);
-#else
-            if( i < 0 || ( size_t ) i >= dsize ) {
-                rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-#endif
-            } else {
-                sz += i;
-                i = sz; /* save length of initial part */
-
-                /* precalc full line length: seq\tqual\tflt */
-                sz += 2 * (read_len + 1) + 1;
-                if( sz >= (int)dsize ) {
-                    rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-                } else {
-                    char flt = '1';
-                    const char* b = self->read->base;
-
-                    /* reverse back to initial part length */
-                    sz = i;
-                    if( *self->rfilter != NULL ) {
-                        if( readId > 0 && (*self->rfilter)[readId - 1] != SRA_READ_FILTER_PASS ) {
-                            flt = '0';
-                        } else {
-                            for(i = 0; i < nreads; i++) {
-                                if( (*self->rfilter)[i] != SRA_READ_FILTER_PASS ) {
-                                    flt = '0';
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    for(i = 0; i < read_len; i++) {
-                        data[sz + i] = b[read_start + i];
-                        if( data[sz + i] == 'N' ) {
-                            data[sz + i] = '.';
-                        }
-                    }
-                    sz += read_len;
-                    data[sz++] = '\t';
-                    if( self->qual1 && self->qual1->size ) {
-                        const uint8_t* p = self->qual1->base;
-                        for(i = 0; i < read_len; i++) {
-                            data[sz + i] = p[read_start + i] + 64;
-                        }
-                        sz += read_len;
-                    }
-                    data[sz++] = '\t';
-                    data[sz++] = flt;
-                    data[sz] = '\0';
-                }
-            }
-        }
-    }
-    if( written != NULL ) {
-        *written = sz;
-    }
-    return rc;
-}
diff --git a/libs/sra/reader-sff.c b/libs/sra/reader-sff.c
deleted file mode 100644
index eba2632..0000000
--- a/libs/sra/reader-sff.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <sra/rd-extern.h>
-
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <sra/sff.h>
-#include <sra/sff-file.h>
-#include <sysalloc.h>
-
-#include "reader-cmn.h"
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#   include <byteswap.h>
-#else
-#   define bswap_16(x) (x)
-#   define bswap_32(x) (x)
-#endif
-#include <string.h>
-
-/* column order is important here: see Init function below!!! */
-static
-const SRAReaderColumn SFFReader_master_columns_desc[] = {
-    {SRAREADER_COL_MANDATORY, "FLOW_CHARS", insdc_fasta_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "KEY_SEQUENCE", insdc_fasta_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "READ", insdc_fasta_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "QUALITY", insdc_phred_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "SIGNAL", ncbi_isamp1_t, NULL, NULL, 0},
-    {SRAREADER_COL_MANDATORY, "POSITION", "INSDC:position:one", NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "CLIP_QUALITY_LEFT", "INSDC:coord:one", NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "CLIP_QUALITY_RIGHT", "INSDC:coord:one", NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "CLIP_ADAPTER_LEFT", "INSDC:coord:one", NULL, NULL, 0},
-    {SRAREADER_COL_OPTIONAL, "CLIP_ADAPTER_RIGHT", "INSDC:coord:one", NULL, NULL, 0},
-    {0, NULL, NULL, NULL, NULL, 0} /* terminator */
-};
-
-struct SFFReader {
-    /* SRAReader always must be a first member! */
-    SRAReader dad;
-    /* current spot data shortcuts */
-    const SRAReaderColumn* flow_chars;
-    const SRAReaderColumn* key_seq;
-    const SRAReaderColumn* read;
-    const SRAReaderColumn* qual1;
-    const SRAReaderColumn* signal;
-    const SRAReaderColumn* position;
-    const INSDC_coord_one** clip_q_left;
-    const INSDC_coord_one** clip_q_right;
-    const INSDC_coord_one** clip_adapter_left;
-    const INSDC_coord_one** clip_adapter_right;
-};
-
-static
-rc_t SFFReaderInit(const SFFReader* self)
-{
-    rc_t rc = 0;
-
-    CHECK_SELF(SFFReader);
-    rc = SRAReaderInit(&self->dad, 0, SFFReader_master_columns_desc);
-    if( GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcColumn ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-    } else if( rc == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[0], &me->flow_chars, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[1], &me->key_seq, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[2], &me->read, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[3], &me->qual1, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[4], &me->signal, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[5], &me->position, NULL)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[6], NULL, (const void***)&self->clip_q_left)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[7], NULL, (const void***)&self->clip_q_right)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[8], NULL, (const void***)&self->clip_adapter_left)) == 0 &&
-        (rc = SRAReader_FindColData(&self->dad, &SFFReader_master_columns_desc[9], NULL, (const void***)&self->clip_adapter_right)) == 0 ) {
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReaderMake(const SFFReader** self, const SRATable* table,
-                   const char* accession, spotid_t minSpotId, spotid_t maxSpotId )
-{
-    rc_t rc = SRAReaderMake((const SRAReader**)self, sizeof **self, table, accession, minSpotId, maxSpotId);
-
-    if( rc == 0 ) {
-        rc = SFFReaderInit(*self);
-    }
-    if( rc != 0 ) {
-        SFFReaderWhack(*self);
-        *self = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReaderWhack(const SFFReader *self)
-{
-    return SRAReaderWhack( &self->dad );
-}
-
-LIB_EXPORT rc_t CC SFFReaderFirstSpot(const SFFReader* self)
-{
-    return SRAReaderFirstSpot( &self->dad );
-}
-
-LIB_EXPORT rc_t CC SFFReaderSeekSpot(const SFFReader* self, spotid_t spot)
-{
-    return SRAReaderSeekSpot( &self->dad, spot );
-}
-
-LIB_EXPORT rc_t CC SFFReaderNextSpot(const SFFReader* self)
-{
-    return SRAReaderNextSpot( &self->dad );
-}
-
-LIB_EXPORT rc_t CC SFFReaderCurrentSpot(const SFFReader* self, spotid_t* spot)
-{
-    return SRAReaderCurrentSpot( &self->dad, spot );
-}
-
-LIB_EXPORT rc_t CC SFFReader_SpotInfo(const SFFReader* self, const char** spotname, size_t* spotname_sz,
-                                      uint32_t* spot_len, uint32_t* num_reads)
-{
-    return SRAReader_SpotInfo( &self->dad, spotname, spotname_sz, spot_len, num_reads );
-}
-
-LIB_EXPORT rc_t CC SFFReader_SpotReadInfo(const SFFReader* self, uint32_t readId, SRAReadTypes* read_type,
-                                          const char** read_label, INSDC_coord_len* read_label_sz,
-                                          INSDC_coord_zero* read_start, INSDC_coord_len* read_len)
-{
-    return SRAReader_SpotReadInfo(&self->dad, readId, read_type,
-                                  read_label, read_label_sz, read_start, read_len);
-}
-
-LIB_EXPORT rc_t CC SFFReaderHeader(const SFFReader* self, spotid_t spots, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    SFFCommonHeader h;
-
-    CHECK_SELF(SFFReader);
-
-    /* we need to read 1st spot in order to get to flow and key seq col data */
-    if( me->dad.spot == 0 && (rc = SFFReaderSeekSpot(self, me->dad.minSpotId)) != 0 ) {
-        return rc;
-    }
-    memset(&h, 0, sizeof(SFFCommonHeader));
-    memcpy(&h, ".sff\0\0\0\1", 8);
-    h.number_of_reads = spots != 0 ? spots : (self->dad.maxSpotId - me->dad.minSpotId + 1);
-    h.key_length = (uint16_t)self->key_seq->size;
-    h.num_flows_per_read = (uint16_t)self->flow_chars->size;
-    h.flowgram_format_code = SFFFormatCodeUI16Hundreths;
-
-    h.header_length = SFFCommonHeader_size + h.key_length + h.num_flows_per_read;
-    /* 8-byte pad */
-    h.header_length += (h.header_length % 8) ? (8 - (h.header_length % 8)) : 0;
-    if( written != NULL ) {
-        *written = h.header_length;
-    }
-    if( h.header_length > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        uint16_t len = h.header_length;
-
-        h.number_of_reads = bswap_32( h.number_of_reads );
-        h.header_length = bswap_16( h.header_length );
-        h.key_length = bswap_16( h.key_length );
-        h.num_flows_per_read = bswap_16( h.num_flows_per_read );
-
-        memset(data, 0, len);
-        memcpy(data, &h, SFFCommonHeader_size);
-        memcpy(&data[SFFCommonHeader_size], self->flow_chars->base, self->flow_chars->size);
-        memcpy(&data[SFFCommonHeader_size + self->flow_chars->size], self->key_seq->base, self->key_seq->size);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReaderReadHeader(const SFFReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t spotname_sz;
-    const char* spotname;
-    uint32_t spot_len;
-    SFFReadHeader h;
-
-    CHECK_SELF(SFFReader);
-    CHECK_SPOT(me->dad);
-
-    memset(&h, 0, sizeof(SFFReadHeader));
-
-    if( (rc = SFFReader_SpotInfo(self, &spotname, &spotname_sz, &spot_len, NULL)) != 0 ) {
-        return rc;
-    }
-    if( self->clip_q_left != NULL && *self->clip_q_left != NULL ) {
-        h.clip_quality_left = **self->clip_q_left;
-    }
-    if( self->clip_q_right != NULL && *self->clip_q_right != NULL ) {
-        h.clip_quality_right = **self->clip_q_right;
-    }
-    if( self->clip_adapter_left != NULL && *self->clip_adapter_left != NULL ) {
-        h.clip_adapter_left = **self->clip_adapter_left;
-    }
-    if( self->clip_adapter_right != NULL && *self->clip_adapter_right != NULL ) {
-        h.clip_adapter_right = **self->clip_adapter_right;
-    }
-    if( spotname_sz == 0 ) {
-        spotname = self->dad.accession;
-        spotname_sz = strlen(spotname);
-    }
-    h.name_length = (uint16_t)spotname_sz;
-    h.number_of_bases = spot_len;
-    h.header_length = (uint16_t)( SFFReadHeader_size + spotname_sz );
-    /* 8-byte pad */
-    h.header_length += (h.header_length % 8) ? (8 - (h.header_length % 8)) : 0;
-    if( written != NULL ) {
-        *written = h.header_length;
-    }
-    if( h.header_length > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        uint16_t len = h.header_length;
-
-        h.header_length = bswap_16(h.header_length);
-        h.name_length = bswap_16(h.name_length);
-        h.number_of_bases = bswap_32(h.number_of_bases);
-        h.clip_quality_right = bswap_16(h.clip_quality_right);
-        h.clip_quality_left = bswap_16(h.clip_quality_left);
-        h.clip_adapter_left = bswap_16(h.clip_adapter_left);
-        h.clip_adapter_right = bswap_16(h.clip_adapter_right);
-
-        memset(data, 0, len);
-        memcpy(data, &h, SFFReadHeader_size);
-        memcpy(&data[SFFReadHeader_size], spotname, spotname_sz);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReaderReadData(const SFFReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t flows, len, padding;
-    uint32_t spot_len;
-    /* SFF type defining vars, not used */
-    const uint16_t sff_signal;
-    const uint8_t sff_position;
-    const char sff_bases;
-    const uint8_t sff_quality;
-
-    CHECK_SELF(SFFReader);
-    CHECK_SPOT(me->dad);
-
-    /* if for some reason READ, QUAL and POSITION rows are uneqaul in size,
-       base their length on actual READ size */
-    spot_len = self->read->size / sizeof(INSDC_dna_text);
-    /* this size if fixed across the file */
-    flows = self->flow_chars->size / sizeof(INSDC_dna_text);
-
-    /* read data section size: per SFF spec types sizes + 8-byte padding */
-    len = flows * sizeof(sff_signal) + spot_len * (sizeof(sff_position) + sizeof(sff_bases) + sizeof(sff_quality));
-    padding = (len % 8) ? (8 - (len % 8)) : 0;
-    len += padding;
-
-    if( written != NULL ) {
-        *written = len;
-    }
-    if( len > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    } else {
-        size_t qty;
-        INSDC_position_one ppos;
-        const uint16_t* signal = self->signal->base;
-        uint16_t* dst_sig = (uint16_t*)data;
-        const INSDC_position_one* position = self->position->base;
-
-        qty = self->signal->size / sizeof(*signal);
-        if( qty > flows ) {
-            qty = flows;
-        }
-        for(len = 0; len < qty; len++) {
-            dst_sig[len] = bswap_16(signal[len]);
-        }
-        if( qty < flows ) {
-            memset(&data[qty * sizeof(sff_signal)], 0, (flows - qty) * sizeof(sff_signal));
-        }
-        data += flows * sizeof(sff_signal);
-
-        qty = self->position->size / sizeof(*position);
-        if( qty > spot_len ) {
-            qty = spot_len;
-        }
-        for(ppos = 0, len = 0; len < qty; len++) {
-            data[len] = (uint8_t)(position[len] - ppos);
-            ppos = position[len];
-        }
-        if( qty < spot_len ) {
-            memset(&data[qty], 0, (spot_len - qty) * sizeof(sff_position));
-        }
-        data += spot_len;
-
-        /* this are guaranteed above to be same length */
-        memcpy(data, self->read->base, spot_len);
-        data += spot_len;
-
-        qty = self->qual1->size / sizeof(INSDC_quality_phred);
-        if( qty > spot_len ) {
-            qty = spot_len;
-        }
-        memcpy(data, self->qual1->base, qty);
-        if( qty < spot_len ) {
-            memset(&data[qty], 0, (spot_len - qty) * sizeof(sff_quality));
-        }
-        if( padding > 0 ) {
-            memset(&data[spot_len], 0, padding);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReader_GetCurrentSpotData(const SFFReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = 0;
-    size_t len = 0, left = dsize, w = 0;
-    char* b = data;
-
-    CHECK_SELF(SFFReader);
-    CHECK_SPOT(me->dad);
-
-    rc = SFFReaderReadHeader(me, b, left, &w);
-    len += w, b += w, left -= w;
-    if( rc != 0 ) {
-        if( !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-            return rc;
-        }
-        b = data, left = dsize;
-    }
-    rc = SFFReaderReadData(self, b, left, &w);
-    len += w, b += w, left -= w;
-    if( rc != 0 ) {
-        if( !(GetRCObject(rc) == rcMemory && GetRCState(rc) == rcInsufficient) ) {
-            return rc;
-        }
-    }
-    if( written != NULL ) {
-        *written = len;
-    }
-    if( len > dsize ) {
-        rc = RC(rcSRA, rcString, rcConstructing, rcMemory, rcInsufficient);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SFFReader_GetNextSpotData(const SFFReader* self, char* data, size_t dsize, size_t* written)
-{
-    rc_t rc = SFFReaderNextSpot(self);
-    if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcUnknown ) {
-        rc = SFFReaderFirstSpot(self);
-    }
-    if( rc == 0 ) {
-        rc = SFFReader_GetCurrentSpotData(self, data, dsize, written);
-    }
-    return rc;
-}
diff --git a/libs/sra/sra-debug.h b/libs/sra/sra-debug.h
deleted file mode 100644
index bfb7de4..0000000
--- a/libs/sra/sra-debug.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_debug_
-#define _h_sra_debug_
-
-#include <klib/debug.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SRADBG(msg) DBGMSG(DBG_SRA,DBG_FLAG(DBG_SRA_INFO),msg)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _sra_debug_ */
diff --git a/libs/sra/sra-dflt-schema.c b/libs/sra/sra-dflt-schema.c
deleted file mode 100644
index cbaacf7..0000000
--- a/libs/sra/sra-dflt-schema.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#define WITH_DNA
-
-#define DEPENDENCY_EXTENSION "d"
-
-ver_t CC KAppVersion ( void )
-{
-    return 0x1000000;
-}
-
-
-/********************************************************************
-helper function to display failure or success message
-********************************************************************/
-static void display_rescode( const rc_t rc, const char* failure, const char* success )
-{
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, failure );
-    else
-        if ( success ) LOGMSG( klogInfo, success );
-}
-
-typedef struct context
-{
-    const char *output_file;
-    char *dependency_file;
-    VNamelist *include_files;
-    VNamelist *src_files;
-} context;
-typedef context* p_context;
-
-static void context_set_str( char **dst, const char *src )
-{
-    size_t len;
-    if ( dst == NULL ) return;
-    if ( *dst != NULL ) free( *dst );
-    if ( src == NULL ) return;
-    len = strlen( src );
-    if ( len == 0 ) return;
-    *dst = (char*)malloc( len + 1 );
-    strcpy( *dst, src );
-}
-
-static bool context_init( context **ctx )
-{
-    bool res = false;
-    if ( ctx != NULL )
-    {
-        (*ctx) = malloc( sizeof( context ) );
-        if ( *ctx )
-        {
-            (*ctx)->output_file = NULL;
-            (*ctx)->dependency_file = NULL;
-            VNamelistMake( &( (*ctx)->include_files ), 5 );
-            VNamelistMake( &( (*ctx)->src_files ), 5 );
-            res = true;
-        }
-    }
-    return res;
-}
-
-static void context_destroy( p_context ctx )
-{
-    if ( ctx == NULL ) return;
-    free( (char*)ctx->output_file );
-    free( (char*)ctx->dependency_file );
-    VNamelistRelease( ctx->include_files );
-    VNamelistRelease( ctx->src_files );
-    free( ctx );
-}
-
-const char UsageDefaultName [] = "sra-dflt-schema";
-
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s src1 src2 -Iinclude1 -Iinclude2 -ooutput -Tdependency\n",
-                    progname);
-}
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("%s src1 src2 -Iinclude1 -Iinclude2 -ooutput -Tdependency\n"
-             "    src1, src2 ..........schema source-files  (mandatory))\n"
-             " -I include1, include2 ..schema include-files (optional))\n"
-             " -o output-file .........schema output (optional)) if none --> stdout\n"
-             " -T dependency-file .....list of includes in make-syntax (optional))\n",
-             progname);
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return 0;
-}
-
-
-/* pass the new extension without a leading dot!
-   assumes that the filename is not static, but made via malloc */
-void change_extension( char **filename, const char *new_extension )
-{
-    char *temp, *buf;
-    size_t src_len, ext_len;
-
-    if ( filename == NULL ) return;
-    if ( (*filename) == NULL ) return;
-    if ( new_extension == NULL ) return;
-    src_len = strlen( *filename );
-    if ( src_len < 1 ) return;
-    ext_len = strlen( new_extension );
-    if ( ext_len < 1 ) return;
-    buf = malloc( src_len + ext_len + 2 );
-    temp = strrchr( *filename, '.' );
-    if ( temp != NULL ) *temp = 0; /* terminate */
-    sprintf( buf, "%s.%s", *filename, new_extension );
-    temp = *filename;
-    *filename = buf;
-    free( temp );
-}
-
-#define OPTION_INCLUDE "include"
-#define OPTION_DEPENDENCY "dependency"
-#define OPTION_OUTPUT "output"
-#define ALIAS_INCLUDE "I"
-#define ALIAS_DEPENDENCY "T"
-#define ALIAS_OUTPUT "o"
-
-const char * include_usage[] = { "include schema", NULL };
-const char * dependency_usage[] = { "dependency", NULL };
-const char * output_usage[] = { "output", NULL };
-
-OptDef Options[] =
-{
-/* is their a real reason for a limit of 10? */
-    { OPTION_INCLUDE, ALIAS_INCLUDE, NULL, include_usage, 10, true, false },
-    { OPTION_DEPENDENCY, ALIAS_DEPENDENCY, NULL, dependency_usage, 1, true, false },
-    { OPTION_OUTPUT, ALIAS_OUTPUT, NULL, output_usage, 1, true, false }
-};
-
-static const char* get_str_option( const Args *my_args, const char *name )
-{
-    const char* res = NULL;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        ArgsOptionValue( my_args, name, 0, &res );
-    }
-    return res;
-}
-
-static void append_str_options( const Args *my_args, const char *name, VNamelist *dst )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        uint32_t idx;
-        for ( idx=0; idx<count; ++idx )
-        {
-            const char* s;
-            if ( ArgsOptionValue( my_args, name, idx, &s ) == 0 )
-                VNamelistAppend( dst, s );
-        }
-    }
-}
-
-static void append_str_arguments( const Args *my_args, VNamelist *dst )
-{
-    uint32_t count;
-    rc_t rc = ArgsParamCount( my_args, &count );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        uint32_t idx;
-        for ( idx=0; idx<count; ++idx )
-        {
-            const char* s;
-            if ( ArgsParamValue( my_args, idx, &s ) == 0 )
-                VNamelistAppend( dst, s );
-        }
-    }
-}
-
-static void evaluate_options( const Args *my_args, context *ctx )
-{
-    context_set_str( (char**)&(ctx->output_file),
-                     get_str_option( my_args, OPTION_OUTPUT ) );
-    context_set_str( (char**)&(ctx->dependency_file),
-                     get_str_option( my_args, OPTION_DEPENDENCY ) );
-    append_str_options( my_args, OPTION_INCLUDE, ctx->include_files );
-    append_str_arguments( my_args, ctx->src_files );
-}
-
-static rc_t capture_arguments_and_options( Args * args, context *ctx )
-{
-    evaluate_options( args, ctx );
-    change_extension( &(ctx->dependency_file), DEPENDENCY_EXTENSION );
-
-    return 0;
-}
-
-typedef rc_t (*name_fkt)( void *data, const char *my_name );
-
-static rc_t for_each_v_name( VNamelist *names, void *data, const name_fkt f )
-{
-    KNamelist *knames;
-    uint32_t count, idx;
-    rc_t rc = VNamelistToNamelist( names, (KNamelist **)&knames );
-    display_rescode( rc, "VNamelistToNamelist failed", NULL );
-    if ( rc == 0 )
-    {
-        rc = KNamelistCount( knames, &count );
-        display_rescode( rc, "KNamelistCount failed", NULL );
-        if ( rc == 0 )
-        {
-            for ( idx=0; idx<count; ++idx )
-            {
-                const char *my_path;
-                rc = KNamelistGet( knames, idx, &my_path );
-                display_rescode( rc, "KNamelistGet failed", NULL );
-                if ( rc == 0 )
-                    rc = f( data, my_path );
-            }
-        }
-        KNamelistRelease( knames );
-    }
-    return rc;
-}
-
-static rc_t for_each_k_name( KNamelist *names, void *data, const name_fkt f )
-{
-    uint32_t count, idx;
-    rc_t rc = KNamelistCount( names, &count );
-    display_rescode( rc, "KNamelistCount failed", NULL );
-    if ( rc == 0 )
-    {
-        for ( idx=0; idx<count; ++idx )
-        {
-            const char *my_path;
-            rc = KNamelistGet( names, idx, &my_path );
-            display_rescode( rc, "KNamelistGet failed", NULL );
-            if ( rc == 0 )
-                rc = f( data, my_path );
-        }
-    }
-    return rc;
-}
-
-static uint32_t namelistcount( VNamelist *names )
-{
-    KNamelist *knames;
-    uint32_t count = 0;
-
-    if ( VNamelistToNamelist( names, (KNamelist **)&knames ) == 0 )
-        KNamelistCount( knames, &count );
-    return count;
-}
-
-static rc_t add_include( void *data, const char *my_name )
-{
-    VSchema *my_schema = (VSchema*)data;
-    rc_t rc = VSchemaAddIncludePath( my_schema, my_name );
-    display_rescode( rc, "VSchemaAddIncludePath failed", NULL );
-    return rc;
-}
-
-static rc_t add_source( void *data, const char *my_name )
-{
-    VSchema *my_schema = (VSchema*)data;
-    rc_t rc = VSchemaParseFile( my_schema, my_name );
-    display_rescode( rc, "VSchemaParseFile failed", NULL );
-    return rc;
-}
-
-struct schema_dumper_state_t {
-    FILE *fp;
-    unsigned line_pos;
-    uint32_t out_size;
-    char line_buf[255];
-};
-
-static void schema_dumper_state_write_line(struct schema_dumper_state_t *st) {
-    st->line_buf[st->line_pos] = '\n';
-    fwrite(st->line_buf, 1, st->line_pos + 1, st->fp);
-    st->line_pos = 0;
-}
-
-/********************************************************************
-helper function needed by schema-dump
-********************************************************************/
-static rc_t CC my_flush ( void *dst, const void *buffer, size_t bsize )
-{
-    struct schema_dumper_state_t *st = (struct schema_dumper_state_t *)dst;
-    size_t i;
-    
-    st->out_size += bsize;
-    for (i = 0; i != bsize; ++i) {
-        int n;
-        int c = ((const char *)buffer)[i];
-        
-        if (st->line_pos > 80)
-            schema_dumper_state_write_line(st);
-
-        if (c == '\'' || c == '\\')
-            n = sprintf(st->line_buf + st->line_pos, " '\\%c',", c);
-        else
-            n = sprintf(st->line_buf + st->line_pos, " '%c',", c);
-        st->line_pos += n;
-    }
-    return 0;
-}
-
-static rc_t Write1Dependency( void* data, const char* name )
-{
-    FILE *my_file = (FILE*)data;
-    char prefix[] = { " \\\n  " };
-    size_t to_write;
-
-    if ( my_file == NULL ) return 0;
-    if ( name == NULL ) return 0;
-    to_write = strlen( name );
-    if ( to_write == 0 ) return 0;
-    fwrite( prefix, sizeof(char), strlen(prefix), my_file );
-    fwrite( name, sizeof(char), to_write, my_file );
-    return 0;
-}
-
-static rc_t WriteDependency( VSchema *my_schema, const context *ctx )
-{
-    rc_t rc = 0;
-    FILE *my_file;
-    const KNamelist *knames;
-
-    if ( ctx->dependency_file == NULL ) return rc;
-    if ( ctx->output_file == NULL ) return rc;
-    rc = VSchemaIncludeFiles( my_schema, &knames );
-    display_rescode( rc, "VSchemaIncludeFiles failed", NULL );
-    if ( rc == 0 )
-    {
-        my_file = fopen( ctx->dependency_file, "w" );
-        if ( my_file != NULL )
-        {
-            char buf[512];
-            int len = snprintf( buf, sizeof(buf), "%s:", ctx->output_file );
-            if ( ( len < 0 )||( len >= sizeof(buf) ) )
-            {
-                rc = -1;
-            }
-            else
-            {
-                fwrite( buf, sizeof(char), len, my_file );
-                for_each_k_name( (void*)knames, my_file, Write1Dependency );
-            }
-            fclose( my_file );
-        }
-        KNamelistRelease( knames );
-    }
-    return rc;
-}
-
-static rc_t DumpSchema_to( VSchema *my_schema, const context *ctx )
-{
-    struct schema_dumper_state_t st;
-    rc_t rc = 0;
-    unsigned i;
-
-    static const char *preamble[] = {
-        "/*===========================================================================",
-        "*",
-        "*                             PUBLIC DOMAIN NOTICE",
-        "*                National Center for Biotechnology Information",
-        "*",
-        "*   This software/database is a \"United States Government Work\" under the",
-        "*   terms of the United States Copyright Act.  It was written as part of",
-        "*   the author's official duties as a United States Government employee and",
-        "*   thus cannot be copyrighted.  This software/database is freely available",
-        "*   to the public for use. The National Library of Medicine and the U.S.",
-        "*   Government have not placed any restriction on its use or reproduction.",
-        "*",
-        "*   Although all reasonable efforts have been taken to ensure the accuracy",
-        "*   and reliability of the software and data, the NLM and the U.S.",
-        "*   Government do not and cannot warrant the performance or results that",
-        "*   may be obtained by using this software or data. The NLM and the U.S.",
-        "*   Government disclaim all warranties, express or implied, including",
-        "*   warranties of performance, merchantability or fitness for any particular",
-        "*   purpose.",
-        "*",
-        "*   Please cite the author in any work or product based on this material.",
-        "*",
-        "* ===========================================================================",
-        "*",
-        "* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT",
-        "*/",
-
-        "#include \"sraschema-priv.h\"",
-        "const char sra_schema_text[] = {"
-    };
-    static const char *postamble[] = {
-        "};",
-        "const size_t sra_schema_size =",
-    };
-    
-    memset(&st, 0, sizeof(st));
-    
-    st.fp = ctx->output_file ? fopen(ctx->output_file, "w") : stdout;
-    
-    if (st.fp == NULL)
-        return RC(rcSRA, rcSchema, rcFormatting, rcFile, rcNotOpen);
-
-    for ( i = 0; i != sizeof(preamble) / sizeof(preamble[0]); ++i)
-        fprintf(st.fp, "%s\n", preamble[i]);
-    
-    rc = VSchemaDump( my_schema, sdmCompact, NULL, my_flush, &st );
-    if (rc == 0) {
-        if (st.line_pos != 0)
-            schema_dumper_state_write_line(&st);
-        fprintf(st.fp, "%s\n", postamble[0]);
-        fprintf(st.fp, "%s %u;\n", postamble[1], st.out_size);
-    }
-    if (st.fp != stdout)
-        fclose(st.fp);
-    return rc;
-}
-
-static rc_t DumpSchema( const context *ctx )
-{
-    KDirectory *my_dir;
-    rc_t rc = KDirectoryNativeDir ( &my_dir );
-    display_rescode( rc, "failed to open native dir", NULL );
-    if ( rc == 0 )
-    {
-        const VDBManager *my_manager;
-        rc = VDBManagerMakeRead ( &my_manager, my_dir );
-        display_rescode( rc, "failed to make manager", NULL );
-        if ( rc == 0 )
-        {
-            VSchema *my_schema;
-            rc = VDBManagerMakeSchema( my_manager, &my_schema );
-            display_rescode( rc, "failed to make schema", NULL );
-            if ( rc == 0 )
-            {
-                rc = for_each_v_name( ctx->include_files, my_schema, add_include );
-                if ( rc == 0 )
-                {
-                    rc = for_each_v_name( ctx->src_files, my_schema, add_source );
-                    if ( rc == 0 )
-                    {
-                        rc = DumpSchema_to( my_schema, ctx );
-                        if ( rc == 0 )
-                            rc = WriteDependency( my_schema, ctx );
-                    }
-                }
-                VSchemaRelease( my_schema );
-            }
-            VDBManagerRelease( my_manager );
-        }
-        KDirectoryRelease( my_dir );
-    }
-    return rc;
-}
-
-/****************************************************************************************
- ***************************************************************************************/
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * my_args;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle (&my_args, argc, argv, 1, 
-                            Options, sizeof (Options) / sizeof (OptDef));
-    if (rc == 0)
-    {
-        context *ctx;
-
-        context_init( &ctx );
-
-        rc = capture_arguments_and_options( my_args, ctx );
-        if ( rc == 0 )
-        {
-            if ( namelistcount( ctx->src_files ) > 0 )
-            {
-                rc = DumpSchema( ctx );
-            }
-            else
-            {
-                MiniUsage (my_args);
-            }
-        }
-        context_destroy( ctx );
-
-        ArgsWhack( my_args );
-    }
-    return rc;
-}
diff --git a/libs/sra/sra-priv.h b/libs/sra/sra-priv.h
deleted file mode 100644
index c5798c5..0000000
--- a/libs/sra/sra-priv.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_priv_
-#define _h_sra_priv_
-
-#ifndef _h_sra_sradb_
-#include <sra/sradb.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef KONST
-#define KONST const
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMetadata;
-struct VDBManager;
-struct VSchema;
-struct VTable;
-struct VCursor;
-struct VTypedecl;
-struct VTypedef;
-struct VResolver;
-struct SRACache;
-
-#define CSRA_EXT(lite) (lite ? ".lite.sra" : ".sra")
-#define SRA_EXT(lite) (lite ? ".lite.sra" : ".sra")
-
-/*--------------------------------------------------------------------------
- * SRAMgr
- */
-struct SRAMgr
-{
-    struct VDBManager KONST *vmgr;
-    struct VSchema const *schema;
-#if OLD_SRAPATH_MGR
-    struct SRAPath volatile *_pmgr;
-#else
-    struct VResolver volatile *_pmgr;
-#endif
-    struct SRACache* cache;
-    KRefcount refcount;
-    KCreateMode mode;
-    bool read_only;
-};
-
-/* SRAMgrMake
- */
-rc_t SRAMgrMake ( SRAMgr **mgr,
-    struct VDBManager const *vmgr, struct KDirectory const *wd );
-
-/* Attach
- * Sever
- */
-SRAMgr *SRAMgrAttach ( const SRAMgr *self );
-rc_t SRAMgrSever ( const SRAMgr *self );
-
-
-/* AccessSRAPath
- *  returns a new reference to SRAPath
- *  do NOT access "pmgr" directly
- */
-struct SRAPath *SRAMgrAccessSRAPath ( const SRAMgr *self );
-
-/*--------------------------------------------------------------------------
- * SRATable
- */
-struct SRATable
-{
-    KONST SRAMgr *mgr;
-    struct VTable KONST *vtbl;
-    struct VCursor KONST *curs;
-    struct KMetadata KONST *meta;
-
-    Vector wcol;
-
-    KRefcount refcount;
-
-    uint32_t metavers;
-
-    KCreateMode mode;
-    bool curs_open;
-    bool read_only;
-
-    uint64_t spot_count;
-    uint64_t base_count;
-    int64_t min_spot_id;
-    int64_t max_spot_id;
-};
-
-/* Whack
- * Destroy
- */
-rc_t SRATableWhack ( SRATable *self );
-void SRATableDestroy ( SRATable *self );
-
-/* Attach
- * Sever
- */
-SRATable *SRATableAttach ( const SRATable *self );
-rc_t SRATableSever ( const SRATable *self );
-
-/* SRATableRead
- */
-rc_t SRATableRead ( const SRATable *self, spotid_t id,
-    uint32_t cid, const void **base, bitsz_t *offset, bitsz_t *size );
-
-/* SRATableColDatatype
- */
-rc_t SRATableColDatatype ( const SRATable *self, uint32_t idx,
-    struct VTypedecl *type, struct VTypedef *def );
-
-/* SRATableGetIdRange
- */
-rc_t SRATableGetIdRange ( const SRATable *self, uint32_t idx,
-    spotid_t id, spotid_t *pfirst, spotid_t *last );
-
-rc_t ResolveTablePath ( const SRAMgr *mgr, char *path, size_t psize, const char *spec, va_list args );
-
-rc_t SRATableFillOut ( SRATable *self, bool update );
-    
-/*--------------------------------------------------------------------------
- * SRAColumn
- */
-struct SRAColumn
-{
-    const SRATable *tbl;
-    KRefcount refcount;
-    uint32_t idx;
-    uint32_t elem_bits;
-    bool read_only;
-};
-
-
-/* Whackity whack
- */
-rc_t SRAColumnWhack ( SRAColumn *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _sra_priv_ */
diff --git a/libs/sra/sra-schema.c b/libs/sra/sra-schema.c
deleted file mode 100644
index 8087365..0000000
--- a/libs/sra/sra-schema.c
+++ /dev/null
@@ -1,4083 +0,0 @@
-/*===========================================================================
-*
-*                             PUBLIC DOMAIN NOTICE
-*                National Center for Biotechnology Information
-*
-*   This software/database is a "United States Government Work" under the
-*   terms of the United States Copyright Act.  It was written as part of
-*   the author's official duties as a United States Government employee and
-*   thus cannot be copyrighted.  This software/database is freely available
-*   to the public for use. The National Library of Medicine and the U.S.
-*   Government have not placed any restriction on its use or reproduction.
-*
-*   Although all reasonable efforts have been taken to ensure the accuracy
-*   and reliability of the software and data, the NLM and the U.S.
-*   Government do not and cannot warrant the performance or results that
-*   may be obtained by using this software or data. The NLM and the U.S.
-*   Government disclaim all warranties, express or implied, including
-*   warranties of performance, merchantability or fitness for any particular
-*   purpose.
-*
-*   Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT
-*/
-#include "sraschema-priv.h"
-const char sra_schema_text[] = {
- 'v', 'e', 'r', 's', 'i', 'o', 'n', ' ', '1', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'I', '6', '4', ' ', 'v', 'd', 'b', ':', 'r', 'o', 'w', '_', 'i', 'd', '_', 'r',
- 'a', 'n', 'g', 'e', '[', '2', ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U',
- '1', '6', ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', '[', '3', ']', ';',
- 'a', 'l', 'i', 'a', 's', ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '_', 't', 'o', 'k', 'e', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'a',
- 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'f', 'a', 's', 't',
- 'a', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'B', '1', ' ', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c',
- 'k', 'e', 'd', '[', '4', ']', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', '4', 'n', 'a', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n',
- ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'B', '1', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c',
- 'k', 'e', 'd', '[', '2', ']', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', '2', 'n', 'a', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'N',
- 'C', 'B', 'I', ':', '2', 'n', 'a', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'a',
- 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':',
- 't', 'e', 'x', 't', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n', ';', 't', 'y', 'p', 'e',
- 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's',
- ':', 'b', 'i', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'B', '1', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', '[', '2',
- ']', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's',
- ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l',
- 'o', 'r', ':', '2', 'c', 's', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'N', 'C', 'B', 'I',
- ':', '2', 'c', 's', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'a', 's', 'c', 'i',
- 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't',
- 'e', 'x', 't', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e',
- 'f', ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'p', 'h', 'r', 'e', 'd', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ',
- 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '1', ';', 't', 'y', 'p', 'e', 'd', 'e',
- 'f', ' ', 'I', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ';', 't', 'y', 'p', 'e', 'd', 'e',
- 'f', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':', 'p', 'h', 'r', 'e', 'd', '_', '3',
- '3', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't',
- ':', 'p', 'h', 'r', 'e', 'd', '_', '6', '4', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's',
- '_', '6', '4', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', '3', '2', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ';', 't', 'y',
- 'p', 'e', 'd', 'e', 'f', ' ', 'U', '3', '2', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ';', 't',
- 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'v', 'a', 'l', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'o', 'n', 'e', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'z', 'e', 'r', 'o', ';', 't',
- 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'o', 'n', 'e', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't',
- 'i', 'o', 'n', ':', 'o', 'n', 'e', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e',
- 'd', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'n', '_',
- 'e', 'n', 'c', 'o', 'd', 'e', 'd', ':', 'p', 'h', 'r', 'e', 'd', ';', 'a', 'l', 'i',
- 'a', 's', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'n',
- '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'n', 'c', '_', 'q', 'u', 'a', 'l', '1', ';',
- 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'N', 'C', 'B',
- 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd',
- 'e', 'd', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ';', 't', 'y', 'p', 'e', 'd',
- 'e', 'f', ' ', 'I', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p',
- '1', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'F', '3', '2', ' ', 'N', 'C', 'B',
- 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ',
- 'F', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', '[', '4',
- ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'B', '8', ' ', 'N', 'C', 'B', 'I',
- ':', 'a', 's', 'n', ':', 'b', 'i', 'n', 'a', 'r', 'y', ';', 't', 'y', 'p', 'e', 'd',
- 'e', 'f', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'a', 's', 'n',
- ':', 't', 'e', 'x', 't', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '6', '4',
- ' ', 'N', 'C', 'B', 'I', ':', 'g', 'i', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ',
- 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 't', 'a', 'x', 'i', 'd', ';', 't', 'y',
- 'p', 'e', 'd', 'e', 'f', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'g', 'b',
- '_', 's', 't', 'a', 't', 'e', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '3',
- '2', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i',
- 'd', '_', 't', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '6', '4', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's',
- '_', 'f', 'o', 'u', 'n', 'd', '[', '4', ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a',
- 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't',
- 'e', 'r', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_',
- 'f', 'i', 'l', 't', 'e', 'r', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'U', '8',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_',
- 't', 'y', 'p', 'e', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', ';', 'a', 'l', 'i', 'a', 's', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R',
- 'A', ':', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ';', 't', 'y', 'p',
- 'e', 'd', 'e', 'f', ' ', 'U', '8', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A',
- ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ';', 'a', 'l', 'i', 'a',
- 's', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '_', 'i', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p',
- 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ';', 't', 'y', 'p', 'e', 'd', 'e',
- 'f', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'S', 'e',
- 'g', 'm', 'e', 'n', 't', '[', '2', ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ',
- 'B', '8', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'S', 'p', 'o', 't', 'D',
- 'e', 's', 'c', '[', '1', '6', ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'B',
- '8', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'R', 'e', 'a', 'd', 'D', 'e',
- 's', 'c', '[', '8', '0', ']', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'N', 'C',
- 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ';',
- 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm',
- 'p', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p',
- 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f',
- ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's',
- '1', '6', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ',
- 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', '[', '4', ']', ';', 't', 'y', 'p',
- 'e', 'd', 'e', 'f', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'q',
- 'u', 'a', 'l', '4', ';', 't', 'y', 'p', 'e', 'd', 'e', 'f', ' ', 'N', 'C', 'B', 'I',
- ':', 'q', 'u', 'a', 'l', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's',
- 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ';', 't', 'y', 'p', 'e',
- 'd', 'e', 'f', ' ', 'B', '8', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e',
- 'n', 'c', 'o', 'd', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ';', 'a', 'l', 'i', 'a',
- 's', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'n', 'c', 'o', 'd', 'e',
- 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'c', 'o', 'm', 'p', '_', 'q', 'u', 'a', 'l', '4', ';', 't', 'y', 'p', 'e', 's', 'e',
- 't', ' ', 'i', 'n', 't', 'e', 'g', 'e', 'r', '_', 's', 'e', 't', '{', 'U', '8', ',',
- 'U', '1', '6', ',', 'U', '3', '2', ',', 'U', '6', '4', ',', 'I', '8', ',', 'I', '1',
- '6', ',', 'I', '3', '2', ',', 'I', '6', '4', '}', ';', 't', 'y', 'p', 'e', 's', 'e',
- 't', ' ', 'f', 'l', 'o', 'a', 't', '_', 's', 'e', 't', '{', 'F', '3', '2', ',', 'F',
- '6', '4', '}', ';', 't', 'y', 'p', 'e', 's', 'e', 't', ' ', 'n', 'u', 'm', 'e', 'r',
- 'i', 'c', '_', 's', 'e', 't', '{', 'U', '8', ',', 'U', '1', '6', ',', 'U', '3', '2',
- ',', 'U', '6', '4', ',', 'I', '8', ',', 'I', '1', '6', ',', 'I', '3', '2', ',', 'I',
- '6', '4', ',', 'F', '3', '2', ',', 'F', '6', '4', '}', ';', 't', 'y', 'p', 'e', 's',
- 'e', 't', ' ', 't', 'e', 'x', 't', '_', 's', 'e', 't', '{', 'u', 't', 'f', '8', ',',
- 'u', 't', 'f', '1', '6', ',', 'u', 't', 'f', '3', '2', ',', 'a', 's', 'c', 'i', 'i',
- '}', ';', 't', 'y', 'p', 'e', 's', 'e', 't', ' ', 't', 'e', 'x', 't', '8', '_', 's',
- 'e', 't', '{', 'u', 't', 'f', '8', ',', 'a', 's', 'c', 'i', 'i', '}', ';', 't', 'y',
- 'p', 'e', 's', 'e', 't', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', '_', 's',
- 'e', 't', '{', 'B', '8', ',', 'B', '1', '6', ',', 'B', '3', '2', ',', 'B', '6', '4',
- '}', ';', 't', 'y', 'p', 'e', 's', 'e', 't', ' ', 'p', 'a', 'c', 'k', '_', 's', 'e',
- 't', '{', 'B', '8', ',', 'B', '1', '6', ',', 'B', '3', '2', ',', 'B', '6', '4', ',',
- 'U', '8', ',', 'U', '1', '6', ',', 'U', '3', '2', ',', 'U', '6', '4', ',', 'I', '8',
- ',', 'I', '1', '6', ',', 'I', '3', '2', ',', 'I', '6', '4', '}', ';', 't', 'y', 'p',
- 'e', 's', 'e', 't', ' ', 'i', 'z', 'i', 'p', '_', 's', 'e', 't', '{', 'U', '8', ',',
- 'U', '1', '6', ',', 'U', '3', '2', ',', 'U', '6', '4', ',', 'I', '8', ',', 'I', '1',
- '6', ',', 'I', '3', '2', ',', 'I', '6', '4', '}', ';', 't', 'y', 'p', 'e', 's', 'e',
- 't', ' ', 'f', 'z', 'i', 'p', '_', 's', 'e', 't', '{', 'F', '3', '2', '}', ';', 't',
- 'y', 'p', 'e', 's', 'e', 't', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's',
- 't', 'a', 't', 's', ':', 'q', 'u', 'a', 'l', '_', 't', 'y', 'p', 'e', '{', 'I', 'N',
- 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd',
- ',', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', ',', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '[', '4', ']', '}', ';',
- 't', 'y', 'p', 'e', 's', 'e', 't', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- '_', '4', '5', '4', '_', ':', 'd', 'r', 'd', 'p', 'a', 'r', 'a', 'm', '_', 's', 'e',
- 't', '{', 'U', '8', ',', 'a', 's', 'c', 'i', 'i', ',', 'I', 'N', 'S', 'D', 'C', ':',
- '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', '}', ';', 'f', 'm', 't', 'd', 'e',
- 'f', ' ', 'm', 'e', 'r', 'g', 'e', 'd', '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd',
- 'e', 'f', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', 'd', '_', 'f', 'm', 't',
- ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e',
- 'r', 'a', 'g', 'e', 'd', '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ',
- 'i', 'z', 'i', 'p', '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'f',
- 'z', 'i', 'p', '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'r', 'l',
- 'e', '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'z', 'l', 'i', 'b',
- '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'b', 'z', 'i', 'p', '2',
- '_', 'f', 'm', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'm', 'e', 'r', 'g', 'e',
- 'd', '_', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'f', 'p', '_', 'e', 'n', 'c',
- 'o', 'd', 'e', 'd', '_', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'r', 'l', '_',
- 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ',
- 'N', 'C', 'B', 'I', ':', 'z', 'l', 'i', 'b', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd',
- '_', 't', ';', 'f', 'm', 't', 'd', 'e', 'f', ' ', 'N', 'C', 'B', 'I', ':', 'f', 'p',
- '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ';', 'c', 'o', 'n', 's', 't', ' ',
- 'U', '8', ' ', 'A', 'L', 'I', 'G', 'N', '_', 'L', 'E', 'F', 'T', '=', '0', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'U', '8', ' ', 'A', 'L', 'I', 'G', 'N', '_', 'R', 'I', 'G',
- 'H', 'T', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_',
- 'F', 'I', 'L', 'T', 'E', 'R', 'E', 'D', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ',
- 'I', '3', '2', ' ', 'Z', '_', 'H', 'U', 'F', 'F', 'M', 'A', 'N', '_', 'O', 'N', 'L',
- 'Y', '=', '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_', 'R',
- 'L', 'E', '=', '3', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_',
- 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'T', 'R', 'A', 'T', 'E', 'G', 'Y', '=',
- '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_', 'N', 'O', '_',
- 'C', 'O', 'M', 'P', 'R', 'E', 'S', 'S', 'I', 'O', 'N', '=', '0', ';', 'c', 'o', 'n',
- 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_', 'B', 'E', 'S', 'T', '_', 'S', 'P', 'E',
- 'E', 'D', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_',
- 'B', 'E', 'S', 'T', '_', 'C', 'O', 'M', 'P', 'R', 'E', 'S', 'S', 'I', 'O', 'N', '=',
- '9', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', '3', '2', ' ', 'Z', '_', 'D', 'E', 'F',
- 'A', 'U', 'L', 'T', '_', 'C', 'O', 'M', 'P', 'R', 'E', 'S', 'S', 'I', 'O', 'N', '=',
- '-', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n',
- 'a', ':', 'b', 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'm',
- 'a', 'p', ':', 'B', 'I', 'N', 'S', 'E', 'T', '=', '[', '0', ',', '1', ',', '2', ',',
- '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9', ',', '1', '0', ',',
- '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ']', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'm', 'a', 'p', ':',
- 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', '.', 'A', 'C', 'M', 'G', 'R', 'S',
- 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'a', 'c', 'c', 'e', 'p', 't', ':', 'C',
- 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', '.', 'A', 'C', 'M', 'G', 'R', 'S', 'V',
- 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N', 'a', 'c', 'm', 'g', 'r', 's', 'v', 't', 'w',
- 'y', 'h', 'k', 'd', 'b', 'n', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', '2', 'n', 'a', ':', 'm', 'a', 'p', ':', 'B', 'I', 'N', 'S', 'E', 'T', '=', '[',
- '0', ',', '1', ',', '2', ',', '3', ']', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'n', 'a', ':', 'm', 'a', 'p', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T',
- '=', '\'', 'A', 'C', 'G', 'T', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'n', 'a', ':', 'a', 'c', 'c', 'e', 'p', 't', ':', 'C', 'H', 'A', 'R',
- 'S', 'E', 'T', '=', '\'', 'A', 'C', 'G', 'T', 'a', 'c', 'g', 't', '\'', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b',
- 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'm', 'a', 'p',
- ':', 'B', 'I', 'N', 'S', 'E', 'T', '=', '[', '0', ',', '1', ',', '2', ',', '3', ',',
- '4', ']', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a',
- ':', 'm', 'a', 'p', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', 'A', 'C',
- 'G', 'T', 'N', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x',
- '2', 'n', 'a', ':', 'a', 'c', 'c', 'e', 'p', 't', ':', 'C', 'H', 'A', 'R', 'S', 'E',
- 'T', '=', '\'', 'A', 'C', 'G', 'T', 'N', 'a', 'c', 'g', 't', 'n', '.', '\'', ';',
- 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b',
- 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'm', 'a', 'p', ':',
- 'B', 'I', 'N', 'S', 'E', 'T', '=', '[', '0', ',', '1', ',', '2', ',', '3', ']', ';',
- 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r',
- ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'm',
- 'a', 'p', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', '0', '1', '2', '3',
- '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'l', 'o', 'r', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c',
- 's', ':', 'a', 'c', 'c', 'e', 'p', 't', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=',
- '\'', '0', '1', '2', '3', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'x', '2', 'c', 's', ':', 'm', 'a', 'p', ':', 'B', 'I', 'N', 'S', 'E', 'T', '=',
- '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'm', 'a', 'p', ':', 'C',
- 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', '0', '1', '2', '3', '.', '\'', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':',
- 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'a',
- 'c', 'c', 'e', 'p', 't', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', '0',
- '1', '2', '3', '.', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '8', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 'd', 'e', 'f', 'a', 'u', 'l',
- 't', '_', 'm', 'a', 't', 'r', 'i', 'x', '=', '[', '0', ',', '1', ',', '2', ',', '3',
- ',', '4', ',', '1', ',', '0', ',', '3', ',', '2', ',', '4', ',', '2', ',', '3', ',',
- '0', ',', '1', ',', '4', ',', '3', ',', '2', ',', '1', ',', '0', ',', '4', ',', '4',
- ',', '4', ',', '4', ',', '4', ',', '4', ']', ';', 'c', 'o', 'n', 's', 't', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'a', 'a', ':', 'm', 'a', 'p', ':', 'B', 'I', 'N', 'S', 'E', 'T', '=', '[', '1',
- ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9', ',',
- '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5',
- ',', '1', '6', ',', '1', '7', ',', '1', '8', ',', '1', '9', ',', '2', '0', ',', '2',
- '1', ',', '2', '2', ',', '2', '3', ',', '2', '4', ',', '2', '5', ']', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n',
- ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'm', 'a',
- 'p', ':', 'C', 'H', 'A', 'R', 'S', 'E', 'T', '=', '\'', 'A', 'B', 'C', 'D', 'E',
- 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y',
- 'Z', 'U', '*', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't', 'e', 'x', 't', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'a', 'a', ':', 'a', 'c', 'c', 'e', 'p', 't', ':', 'C', 'H', 'A', 'R',
- 'S', 'E', 'T', '=', '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L',
- 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'U', '*', 'a', 'b', 'c',
- 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w',
- 'x', 'y', 'z', 'u', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r',
- ' ', 'S', 'R', 'A', '_', 'R', 'E', 'A', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', '_',
- 'P', 'A', 'S', 'S', '=', '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r',
- ' ', 'S', 'R', 'A', '_', 'R', 'E', 'A', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', '_',
- 'R', 'E', 'J', 'E', 'C', 'T', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't',
- 'e', 'r', ' ', 'S', 'R', 'A', '_', 'R', 'E', 'A', 'D', '_', 'F', 'I', 'L', 'T', 'E',
- 'R', '_', 'C', 'R', 'I', 'T', 'E', 'R', 'I', 'A', '=', '2', ';', 'c', 'o', 'n', 's',
- 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_',
- 'f', 'i', 'l', 't', 'e', 'r', ' ', 'S', 'R', 'A', '_', 'R', 'E', 'A', 'D', '_', 'F',
- 'I', 'L', 'T', 'E', 'R', '_', 'R', 'E', 'D', 'A', 'C', 'T', 'E', 'D', '=', '3', ';',
- 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x',
- 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'S', 'R', 'A', '_', 'R', 'E', 'A',
- 'D', '_', 'T', 'Y', 'P', 'E', '_', 'T', 'E', 'C', 'H', 'N', 'I', 'C', 'A', 'L', '=',
- '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A',
- ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'S', 'R', 'A', '_', 'R',
- 'E', 'A', 'D', '_', 'T', 'Y', 'P', 'E', '_', 'B', 'I', 'O', 'L', 'O', 'G', 'I', 'C',
- 'A', 'L', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'S', 'R',
- 'A', '_', 'R', 'E', 'A', 'D', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'O', 'R', 'W', 'A',
- 'R', 'D', '=', '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'S', 'R',
- 'A', '_', 'R', 'E', 'A', 'D', '_', 'T', 'Y', 'P', 'E', '_', 'R', 'E', 'V', 'E', 'R',
- 'S', 'E', '=', '4', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S',
- 'R', 'A', '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'U', 'N', 'D', 'E', 'F',
- 'I', 'N', 'E', 'D', '=', '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd',
- ' ', 'S', 'R', 'A', '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', '4', '5', '4',
- '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R',
- 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R', 'A',
- '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'I', 'L', 'L', 'U', 'M', 'I', 'N',
- 'A', '=', '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R',
- 'A', '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'A', 'B', 'S', 'O', 'L', 'I',
- 'D', '=', '3', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R',
- 'A', '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'C', 'O', 'M', 'P', 'L', 'E',
- 'T', 'E', '_', 'G', 'E', 'N', 'O', 'M', 'I', 'C', 'S', '=', '4', ';', 'c', 'o', 'n',
- 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't',
- 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R', 'A', '_', 'P', 'L', 'A', 'T', 'F',
- 'O', 'R', 'M', '_', 'H', 'E', 'L', 'I', 'C', 'O', 'S', '=', '5', ';', 'c', 'o', 'n',
- 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't',
- 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R', 'A', '_', 'P', 'L', 'A', 'T', 'F',
- 'O', 'R', 'M', '_', 'P', 'A', 'C', 'B', 'I', 'O', '_', 'S', 'M', 'R', 'T', '=', '6',
- ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S', 'R', 'A', '_', 'P',
- 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'I', 'O', 'N', '_', 'T', 'O', 'R', 'R', 'E',
- 'N', 'T', '=', '7', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'S',
- 'R', 'A', '_', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '_', 'S', 'A', 'N', 'G', 'E',
- 'R', '=', '8', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q',
- 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'N',
- 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'f', 'r', 'o', 'm', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '=', '[', '-', '6', ',', '-', '5', ',', '-',
- '4', ',', '-', '3', ',', '-', '2', ',', '-', '1', ',', '0', ',', '1', ',', '2', ',',
- '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9', ',', '1', '0', ',',
- '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ',', '1', '6',
- ',', '1', '7', ',', '1', '8', ',', '1', '9', ',', '2', '0', ',', '2', '1', ',', '2',
- '2', ',', '2', '3', ',', '2', '4', ',', '2', '5', ',', '2', '6', ',', '2', '7', ',',
- '2', '8', ',', '2', '9', ',', '3', '0', ',', '3', '1', ',', '3', '2', ',', '3', '3',
- ',', '3', '4', ',', '3', '5', ',', '3', '6', ',', '3', '7', ',', '3', '8', ',', '3',
- '9', ',', '4', '0', ']', ';', 'c', 'o', 'n', 's', 't', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'N', 'C',
- 'B', 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'o', ':', 'p', 'h', 'r',
- 'e', 'd', '=', '[', '0', ',', '1', ',', '1', ',', '2', ',', '2', ',', '3', ',', '3',
- ',', '4', ',', '4', ',', '5', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9', ',',
- '1', '0', ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4',
- ',', '1', '5', ',', '1', '6', ',', '1', '7', ',', '1', '8', ',', '1', '9', ',', '2',
- '0', ',', '2', '1', ',', '2', '2', ',', '2', '3', ',', '2', '4', ',', '2', '5', ',',
- '2', '6', ',', '2', '7', ',', '2', '8', ',', '2', '9', ',', '3', '0', ',', '3', '1',
- ',', '3', '2', ',', '3', '3', ',', '3', '4', ',', '3', '5', ',', '3', '6', ',', '3',
- '7', ',', '3', '8', ',', '3', '9', ',', '4', '0', ']', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm',
- 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'u', 'n', 'r', 'e', 'c', 'o', 'g', 'n', 'i',
- 'z', 'e', 'd', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e',
- 'n', ':', 'r', 'e', 'c', 'o', 'g', 'n', 'i', 'z', 'e', 'd', '=', '2', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'Q', '=', '3', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'X', '=', '4', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'Y', '=', '5', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'T', '=', '6', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'L', '=', '7', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 's', 'i', 'g', 'n', 'e', 'd',
- ':', 'X', '=', '8', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n',
- ':', 's', 'i', 'g', 'n', 'e', 'd', ':', 'Y', '=', '9', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm',
- 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 's', 'i', 'g', 'n', 'e', 'd', ':', 'T', '=',
- '1', '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 's',
- 'i', 'g', 'n', 'e', 'd', ':', 'L', '=', '1', '1', ';', 'c', 'o', 'n', 's', 't', ' ',
- 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e',
- '_', 't', 'o', 'k', 'e', 'n', ':', 'o', 'c', 't', 'a', 'l', ':', 'X', '=', '1', '2',
- ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'o', 'c', 't',
- 'a', 'l', ':', 'Y', '=', '1', '3', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o',
- 'k', 'e', 'n', ':', 'o', 'c', 't', 'a', 'l', ':', 'T', '=', '1', '4', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'o', 'c', 't', 'a', 'l', ':',
- 'L', '=', '1', '5', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n',
- ':', 'h', 'e', 'x', ':', 'u', 'p', 'p', 'e', 'r', ':', 'X', '=', '1', '6', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'h', 'e', 'x', ':', 'u',
- 'p', 'p', 'e', 'r', ':', 'Y', '=', '1', '7', ';', 'c', 'o', 'n', 's', 't', ' ', 'U',
- '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_',
- 't', 'o', 'k', 'e', 'n', ':', 'h', 'e', 'x', ':', 'u', 'p', 'p', 'e', 'r', ':', 'T',
- '=', '1', '8', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':',
- 'h', 'e', 'x', ':', 'u', 'p', 'p', 'e', 'r', ':', 'L', '=', '1', '9', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'h', 'e', 'x', ':', 'l', 'o',
- 'w', 'e', 'r', ':', 'X', '=', '2', '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1',
- '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't',
- 'o', 'k', 'e', 'n', ':', 'h', 'e', 'x', ':', 'l', 'o', 'w', 'e', 'r', ':', 'Y', '=',
- '2', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'h',
- 'e', 'x', ':', 'l', 'o', 'w', 'e', 'r', ':', 'T', '=', '2', '2', ';', 'c', 'o', 'n',
- 's', 't', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 't', 'o', 'k', 'e', 'n', ':', 'h', 'e', 'x', ':', 'l', 'o', 'w',
- 'e', 'r', ':', 'L', '=', '2', '3', ';', 'c', 'o', 'n', 's', 't', ' ', 'a', 's', 'c',
- 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_',
- 's', 'y', 'm', 'b', 'o', 'l', ':', 'Q', '=', '\'', '$', 'Q', '\'', ';', 'c', 'o',
- 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'X', '=', '\'',
- '$', 'X', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y', 'm',
- 'b', 'o', 'l', ':', 'Y', '=', '\'', '$', 'Y', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'T', '=', '\'', '$', 'T',
- '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o',
- 'l', ':', 'L', '=', '\'', '$', 'L', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'a',
- 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm',
- 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'o', 'c', 't', 'a', 'l', ':', 'X', '=',
- '\'', '$', 'a', '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y',
- 'm', 'b', 'o', 'l', ':', 'o', 'c', 't', 'a', 'l', ':', 'Y', '=', '\'', '$', 'b',
- '\'', ';', 'c', 'o', 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o',
- 'l', ':', 'o', 'c', 't', 'a', 'l', ':', 'T', '=', '\'', '$', 'c', '\'', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'n', 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'o', 'c',
- 't', 'a', 'l', ':', 'L', '=', '\'', '$', 'd', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'u', 'p',
- 'p', 'e', 'r', ':', 'X', '=', '\'', '$', 'e', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'u', 'p',
- 'p', 'e', 'r', ':', 'Y', '=', '\'', '$', 'f', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'u', 'p',
- 'p', 'e', 'r', ':', 'T', '=', '\'', '$', 'g', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'u', 'p',
- 'p', 'e', 'r', ':', 'L', '=', '\'', '$', 'h', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'l', 'o',
- 'w', 'e', 'r', ':', 'X', '=', '\'', '$', 'x', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'l', 'o',
- 'w', 'e', 'r', ':', 'Y', '=', '\'', '$', 'y', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'l', 'o',
- 'w', 'e', 'r', ':', 'T', '=', '\'', '$', 't', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n',
- 'a', 'm', 'e', '_', 's', 'y', 'm', 'b', 'o', 'l', ':', 'h', 'e', 'x', ':', 'l', 'o',
- 'w', 'e', 'r', ':', 'L', '=', '\'', '$', 'l', '\'', ';', 'c', 'o', 'n', 's', 't',
- ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5',
- '4', '_', ':', 'd', 'y', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '=',
- '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'y', 'n', '_', 'r', 'e', 'a',
- 'd', '_', 's', 't', 'a', 'r', 't', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'U',
- '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_',
- ':', 'd', 'y', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', '=', '2', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'r', 'e', 'a', 'd', 'n', ':', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '=',
- '0', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', 'n', ':', 'r', 'e', 'a', 'd', '_', 's', 't',
- 'a', 'r', 't', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', 'n', ':', 'r', 'e', 'a',
- 'd', '_', 'l', 'e', 'n', '=', '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', 'n', ':', 'l',
- 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', '=', '3', ';', 'c', 'o', 'n', 's',
- 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e',
- 'a', 'd', 'n', ':', 'l', 'a', 'b', 'e', 'l', '_', 'l', 'e', 'n', '=', '4', ';', 'c',
- 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'y', '=', '0', ';', 'c', 'o', 'n', 's', 't', ' ',
- 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'x', '=', '1', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'c', 'o', 'o', 'r', 'd', ':', 't', 'i', 'l',
- 'e', '=', '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'a', 'n', 'e', '=',
- '3', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'c', 'o', 'o', 'r', 'd', ':', 'r', 'e', 'g', 'i', 'o', 'n', '=',
- '2', ';', 'c', 'o', 'n', 's', 't', ' ', 'U', '3', '2', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'c', 'o', 'o', 'r', 'd', ':', 'p', 'a', 'n', 'e', 'l', '=', '2',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- 'a', 'n', 'y', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n',
- ')', '=', 'v', 'd', 'b', ':', 'c', 'a', 's', 't', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', ' ', 'b', 'i', 't', '_', 'o', 'r', '#', '1', '<', 'U', '8', ' ', 'a', 'l',
- 'i', 'g', 'n', '>', '(', 'T', ' ', 'A', ',', 'T', ' ', 'B', ')', '=', 'v', 'd', 'b',
- ':', 'b', 'i', 't', '_', 'o', 'r', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ',
- 't', 'r', 'i', 'm', '#', '1', '<', 'U', '8', ' ', 'a', 'l', 'i', 'g', 'n', ',', 'T',
- ' ', 'v', 'a', 'l', '>', '(', 'T', ' ', 'A', ')', '=', 'v', 'd', 'b', ':', 't', 'r',
- 'i', 'm', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'a', 'n', 'y', ' ', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
- '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'r', 'e',
- 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', '6', '4', ' ', 'r', 'o', 'w', '_',
- 'i', 'd', '#', '1', '(', ')', '=', 'v', 'd', 'b', ':', 'r', 'o', 'w', '_', 'i', 'd',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- 'U', '3', '2', ' ', 'r', 'o', 'w', '_', 'l', 'e', 'n', '#', '1', '(', 'a', 'n', 'y',
- ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'r', 'o', 'w', '_', 'l', 'e', 'n', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'U',
- '3', '2', ' ', 'f', 'i', 'x', 'e', 'd', '_', 'r', 'o', 'w', '_', 'l', 'e', 'n', '#',
- '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'f', 'i', 'x',
- 'e', 'd', '_', 'r', 'o', 'w', '_', 'l', 'e', 'n', ';', 'v', 'a', 'l', 'i', 'd', 'a',
- 't', 'e', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e',
- ' ', 'T', '>', 'v', 'o', 'i', 'd', ' ', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1',
- '<', '*', 'U', '3', '2', ' ', 's', 'i', 'g', '_', 'b', 'i', 't', 's', '>', '(', 'T',
- ' ', 's', 'r', 'c', ',', 'T', ' ', 'c', 'm', 'p', ')', '=', 'v', 'd', 'b', ':', 'c',
- 'o', 'm', 'p', 'a', 'r', 'e', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', ' ', 'f',
- 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'v',
- 'o', 'i', 'd', ' ', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(',
- 'T', ' ', 's', 'r', 'c', ',', 'T', ' ', 'c', 'm', 'p', ')', '=', 'v', 'd', 'b', ':',
- 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', ' ', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
- '#', '1', '<', 'T', ' ', 'l', 'o', 'w', 'e', 'r', ',', 'T', ' ', 'u', 'p', 'p', 'e',
- 'r', '>', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'r', 'a', 'n', 'g',
- 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', ' ', 's', 'e', 'l', 'e', 'c', 't', '#', '1', '(', 'T', ' ', 'f', 'i', 'r',
- 's', 't', ',', 'T', ' ', 's', 'e', 'c', 'o', 'n', 'd', ',', '.', '.', '.', ')', '=',
- 'v', 'd', 'b', ':', 's', 'e', 'l', 'e', 'c', 't', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o',
- 's', 'e', 'd', '_', 'f', 'm', 't', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e',
- '#', '1', '(', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', '_', 's', 'e', 't', ' ',
- 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', '_', 's', 'e', 't', ' ', 'd', 'e', 't',
- 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', '#', '1', '(', 't', 'r', 'a', 'n', 's', 'p',
- 'o', 's', 'e', 'd', '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':',
- 'd', 'e', 't', 'r', 'a', 'n', 's', 'p', 'o', 's', 'e', ';', 'e', 'x', 't', 'e', 'r',
- 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'd', 'e', 'l', 't', 'a', '_',
- 'a', 'v', 'e', 'r', 'a', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 'd', 'e', 'l', 't',
- 'a', '_', 'a', 'v', 'e', 'r', 'a', 'g', 'e', '#', '1', '(', 'a', 'n', 'y', ' ', 'i',
- 'n', ')', '=', 'v', 'd', 'b', ':', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e', 'r',
- 'a', 'g', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'u', 'n', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v',
- 'e', 'r', 'a', 'g', 'e', '#', '1', '(', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e',
- 'r', 'a', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b',
- ':', 'u', 'n', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e', 'r', 'a', 'g', 'e', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'm',
- 'e', 'r', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 'm', 'e', 'r', 'g', 'e', '#', '1',
- '(', 'a', 'n', 'y', ' ', 'i', 'n', ',', '.', '.', '.', ')', '=', 'v', 'd', 'b', ':',
- 'm', 'e', 'r', 'g', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 's', 'p', 'l', 'i', 't', '#', '1', '<',
- 'U', '3', '2', ' ', 'i', 'd', 'x', '>', '(', 'm', 'e', 'r', 'g', 'e', 'd', '_', 'f',
- 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 's', 'p', 'l', 'i', 't', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<',
- 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'm', 'e', 't', 'a', ':', 'r', 'e', 'a',
- 'd', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'o', 'd', 'e', '*', 'b', 'o',
- 'o', 'l', ' ', 'd', 'e', 't', 'e', 'r', 'm', 'i', 'n', 'i', 's', 't', 'i', 'c', '>',
- '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'm', 'e', 't', 'a', ':',
- 'v', 'a', 'l', 'u', 'e', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'o', 'd',
- 'e', '*', 'b', 'o', 'o', 'l', ' ', 'd', 'e', 't', 'e', 'r', 'm', 'i', 'n', 'i', 's',
- 't', 'i', 'c', '>', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'm',
- 'e', 't', 'a', ':', 'w', 'r', 'i', 't', 'e', '#', '1', '<', 'a', 's', 'c', 'i', 'i',
- ' ', 'n', 'o', 'd', 'e', '>', '(', 'T', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e',
- 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 's', 'c', 'i', 'i',
- ' ', 'm', 'e', 't', 'a', ':', 'a', 't', 't', 'r', ':', 'r', 'e', 'a', 'd', '#', '1',
- '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'o', 'd', 'e', ',', 'a', 's', 'c', 'i', 'i',
- ' ', 'a', 't', 't', 'r', '*', 'b', 'o', 'o', 'l', ' ', 'd', 'e', 't', 'e', 'r', 'm',
- 'i', 'n', 'i', 's', 't', 'i', 'c', '>', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'm',
- 'e', 't', 'a', ':', 'a', 't', 't', 'r', ':', 'w', 'r', 'i', 't', 'e', '#', '1', '<',
- 'a', 's', 'c', 'i', 'i', ' ', 'n', 'o', 'd', 'e', ',', 'a', 's', 'c', 'i', 'i', ' ',
- 'a', 't', 't', 'r', '>', '(', 'a', 's', 'c', 'i', 'i', ' ', 'i', 'n', ')', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e',
- 'x', 't', '8', '_', 's', 'e', 't', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
- ':', 'r', 'e', 'a', 'd', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm',
- 'e', '*', 'b', 'o', 'o', 'l', ' ', 'd', 'e', 't', 'e', 'r', 'm', 'i', 'n', 'i', 's',
- 't', 'i', 'c', '>', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 't', 'e', 'x', 't', '8', '_', 's', 'e', 't', ' ', 'e',
- 'n', 'v', 'i', 'r', 'o', 'n', 'm', 'e', 'n', 't', ':', 'r', 'e', 'a', 'd', '#', '1',
- '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', '>', '(', ')', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e', 'x',
- 't', '8', '_', 's', 'e', 't', ' ', 'i', 'd', 'x', ':', 't', 'e', 'x', 't', ':', 'p',
- 'r', 'o', 'j', 'e', 'c', 't', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'i', 'n',
- 'd', 'e', 'x', '_', 'n', 'a', 'm', 'e', '>', '(', '*', 't', 'e', 'x', 't', '8', '_',
- 's', 'e', 't', ' ', 's', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', ')', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e',
- 'x', 't', '8', '_', 's', 'e', 't', ' ', 'i', 'd', 'x', ':', 't', 'e', 'x', 't', ':',
- 'i', 'n', 's', 'e', 'r', 't', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'i', 'n',
- 'd', 'e', 'x', '_', 'n', 'a', 'm', 'e', '>', '(', 't', 'e', 'x', 't', '8', '_', 's',
- 'e', 't', ' ', 'k', 'e', 'y', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', 'v', 'd', 'b', ':', 'r', 'o', 'w', '_', 'i', 'd',
- '_', 'r', 'a', 'n', 'g', 'e', ' ', 'i', 'd', 'x', ':', 't', 'e', 'x', 't', ':', 'l',
- 'o', 'o', 'k', 'u', 'p', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'i', 'n', 'd',
- 'e', 'x', '_', 'n', 'a', 'm', 'e', ',', 'a', 's', 'c', 'i', 'i', ' ', 'q', 'u', 'e',
- 'r', 'y', '_', 'b', 'y', '_', 'n', 'a', 'm', 'e', '>', '(', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p',
- 'e', ' ', 'T', '>', 'T', ' ', 'e', 'c', 'h', 'o', '#', '1', '<', 'T', ' ', 'v', 'a',
- 'l', '>', '(', '*', 'a', 'n', 'y', ' ', 'r', 'o', 'w', '_', 'l', 'e', 'n', ')', '=',
- 'v', 'd', 'b', ':', 'e', 'c', 'h', 'o', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f',
- 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T',
- ' ', 'e', 'x', 'i', 's', 't', 's', '#', '1', '<', '*', 'T', ' ', 'c', 'v', 'a', 'l',
- '>', '(', 'a', 'n', 'y', ' ', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '*', 'T',
- ' ', 'd', 'v', 'a', 'l', ')', '=', 'v', 'd', 'b', ':', 'e', 'x', 'i', 's', 't', 's',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- '<', 't', 'y', 'p', 'e', ' ', 'A', ',', 't', 'y', 'p', 'e', ' ', 'B', '>', 'B', ' ',
- 'm', 'a', 'p', '#', '1', '<', 'A', ' ', 'f', 'r', 'o', 'm', ',', 'B', ' ', 't', 'o',
- '>', '(', 'A', ' ', 'i', 'n', '*', 'B', ' ', 's', 'r', 'c', ')', '=', 'v', 'd', 'b',
- ':', 'm', 'a', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't',
- 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'c', 'l', 'i',
- 'p', '#', '1', '<', 'T', ' ', 'l', 'o', 'w', 'e', 'r', ',', 'T', ' ', 'u', 'p', 'p',
- 'e', 'r', '>', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'c', 'l', 'i',
- 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', ',', 'U', '3', '2', ' ', 'd', 'i', 'm', '>',
- 'T', '[', 'd', 'i', 'm', ']', ' ', 'v', 'c', 'l', 'i', 'p', '#', '1', '<', 'T', ' ',
- 'l', 'o', 'w', 'e', 'r', ',', 'T', ' ', 'u', 'p', 'p', 'e', 'r', '>', '(', 'T', '[',
- 'd', 'i', 'm', ']', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'c', 'l', 'i', 'p',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- 'n', 'u', 'm', 'e', 'r', 'i', 'c', '_', 's', 'e', 't', ' ', 'c', 'e', 'i', 'l', '#',
- '1', '(', 'f', 'l', 'o', 'a', 't', '_', 's', 'e', 't', ' ', 'i', 'n', ')', '=', 'v',
- 'd', 'b', ':', 'c', 'e', 'i', 'l', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', 'n', 'u', 'm', 'e', 'r', 'i', 'c', '_', 's', 'e',
- 't', ' ', 'f', 'l', 'o', 'o', 'r', '#', '1', '(', 'f', 'l', 'o', 'a', 't', '_', 's',
- 'e', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'f', 'l', 'o', 'o', 'r', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'n',
- 'u', 'm', 'e', 'r', 'i', 'c', '_', 's', 'e', 't', ' ', 'r', 'o', 'u', 'n', 'd', '#',
- '1', '(', 'f', 'l', 'o', 'a', 't', '_', 's', 'e', 't', ' ', 'i', 'n', ')', '=', 'v',
- 'd', 'b', ':', 'r', 'o', 'u', 'n', 'd', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f',
- 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'n', 'u', 'm', 'e', 'r', 'i', 'c', '_', 's',
- 'e', 't', ' ', 't', 'r', 'u', 'n', 'c', '#', '1', '(', 'f', 'l', 'o', 'a', 't', '_',
- 's', 'e', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 't', 'r', 'u', 'n', 'c',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'm', 'i', 'n', '#', '1', '(', 'T',
- ' ', 'a', ',', 'T', ' ', 'b', ')', '=', 'v', 'd', 'b', ':', 'm', 'i', 'n', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't',
- 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'm', 'a', 'x', '#', '1', '(', 'T', ' ', 'a',
- ',', 'T', ' ', 'b', ')', '=', 'v', 'd', 'b', ':', 'm', 'a', 'x', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p',
- 'e', ' ', 'T', '>', 'T', ' ', 's', 'u', 'm', '#', '1', '<', '*', 'T', ' ', 'k', '>',
- '(', 'T', ' ', 'a', ',', '.', '.', '.', ')', '=', 'v', 'd', 'b', ':', 's', 'u', 'm',
- ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ',
- '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'd', 'i', 'f', 'f', '#', '1', '<',
- '*', 'T', ' ', 'k', '>', '(', 'T', ' ', 'a', '*', 'T', ' ', 'b', ')', '=', 'v', 'd',
- 'b', ':', 'd', 'i', 'f', 'f', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'd',
- 'e', 'r', 'i', 'v', '#', '1', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':',
- 'd', 'e', 'r', 'i', 'v', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'i', 'n',
- 't', 'e', 'g', 'r', 'a', 'l', '#', '1', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd',
- 'b', ':', 'i', 'n', 't', 'e', 'g', 'r', 'a', 'l', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', ' ', 'i', 'n', 't', 'e', 'g', 'r', 'a', 'l', '_', '0', '#', '1', '(', 'T',
- ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'i', 'n', 't', 'e', 'g', 'r', 'a', 'l',
- '_', '0', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'd', 'e', 'l', 't', 'a',
- '#', '1', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'd', 'e', 'l', 't',
- 'a', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'u', 'n', 'd', 'e', 'l', 't',
- 'a', '#', '1', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'u', 'n', 'd',
- 'e', 'l', 't', 'a', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't',
- 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'o', 'u', 't',
- 'l', 'i', 'e', 'r', '_', 'e', 'n', 'c', 'o', 'd', 'e', '#', '1', '<', 'T', ' ', 'o',
- 'u', 't', 'l', 'i', 'e', 'r', '>', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b',
- ':', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'e', 'n', 'c', 'o', 'd', 'e', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't',
- 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd',
- 'e', 'c', 'o', 'd', 'e', '#', '1', '<', 'T', ' ', 'o', 'u', 't', 'l', 'i', 'e', 'r',
- '>', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'o', 'u', 't', 'l', 'i',
- 'e', 'r', '_', 'd', 'e', 'c', 'o', 'd', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>',
- 'T', ' ', 'a', 'd', 'd', '_', 'r', 'o', 'w', '_', 'i', 'd', '#', '1', '(', 'T', ' ',
- 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'a', 'd', 'd', '_', 'r', 'o', 'w', '_', 'i',
- 'd', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 's', 'u', 'b', '_', 'r', 'o',
- 'w', '_', 'i', 'd', '#', '1', '(', 'T', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':',
- 's', 'u', 'b', '_', 'r', 'o', 'w', '_', 'i', 'd', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', '[', '*', ']', ' ', 'c', 'u', 't', '#', '1', '<', 'U', '3', '2', ' ', 'i',
- 'd', 'x', ',', '.', '.', '.', '>', '(', 'T', '[', '*', ']', ' ', 'i', 'n', ')', '=',
- 'v', 'd', 'b', ':', 'c', 'u', 't', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', '[',
- '*', ']', ' ', 'p', 'a', 's', 't', 'e', '#', '1', '(', 'T', '[', '*', ']', ' ', 'i',
- 'n', ',', '.', '.', '.', ')', '=', 'v', 'd', 'b', ':', 'p', 'a', 's', 't', 'e', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<',
- 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'v', 'e', 'c', '_', 's', 'u', 'm', '#',
- '1', '(', 'T', '[', '*', ']', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'v', 'e',
- 'c', '_', 's', 'u', 'm', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'f', 'i',
- 'x', 'e', 'd', '_', 'v', 'e', 'c', '_', 's', 'u', 'm', '#', '1', '(', 'T', '[', '*',
- ']', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'f', 'i', 'x', 'e', 'd', '_', 'v',
- 'e', 'c', '_', 's', 'u', 'm', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'b', 'o', 'o', 'l', ' ', 'c', 'h', 'e', 'c', 'k', 's',
- 'u', 'm', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'o', 'd', 'e', ',', 'a',
- 's', 'c', 'i', 'i', ' ', 'a', 'l', 'g', 'o', 'r', 'i', 't', 'h', 'm', '>', '(', 'B',
- '8', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'c', 'h', 'e', 'c', 'k', 's', 'u',
- 'm', ';', 's', 'c', 'h', 'e', 'm', 'a', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 'b', 'o', 'o', 'l', ' ', 'm', 'd', '5', 's', 'u', 'm', '#', '1', '<', 'a', 's',
- 'c', 'i', 'i', ' ', 'n', 'o', 'd', 'e', '>', '(', 'B', '8', ' ', 'i', 'n', ')', '{',
- 'r', 'e', 't', 'u', 'r', 'n', ' ', 'c', 'h', 'e', 'c', 'k', 's', 'u', 'm', '#', '1',
- '<', 'n', 'o', 'd', 'e', ',', '\'', 'm', 'd', '5', '\'', '>', '(', 'i', 'n', ')',
- ';', '}', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 'B', '1', '[', '*', ']', ' ', 'p', 'a', 'c', 'k', '#', '1', '(', 'p', 'a', 'c',
- 'k', '_', 's', 'e', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'p', 'a', 'c',
- 'k', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 'p', 'a', 'c', 'k', '_', 's', 'e', 't', ' ', 'u', 'n', 'p', 'a', 'c', 'k', '#',
- '1', '(', 'B', '1', '[', '*', ']', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'u',
- 'n', 'p', 'a', 'c', 'k', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'i', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ', 'i', 'z', 'i',
- 'p', '#', '2', '.', '1', '(', 'i', 'z', 'i', 'p', '_', 's', 'e', 't', ' ', 'i', 'n',
- ')', '=', 'v', 'd', 'b', ':', 'i', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'i', 'z', 'i', 'p', '_', 's', 'e',
- 't', ' ', 'i', 'u', 'n', 'z', 'i', 'p', '#', '2', '.', '1', '(', 'i', 'z', 'i', 'p',
- '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'i', 'u', 'n', 'z',
- 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'f', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ', 'f', 'z', 'i', 'p', '#', '1',
- '<', 'U', '3', '2', ' ', 'm', 'a', 'n', 't', 'i', 's', 's', 'a', '>', '(', 'f', 'z',
- 'i', 'p', '_', 's', 'e', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'f', 'z',
- 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'f', 'z', 'i', 'p', '_', 's', 'e', 't', ' ', 'f', 'u', 'n', 'z', 'i', 'p',
- '#', '1', '(', 'f', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v',
- 'd', 'b', ':', 'f', 'u', 'n', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'l', 'e', '_', 'f', 'm', 't', ' ',
- 'r', 'l', 'e', 'n', 'c', 'o', 'd', 'e', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n',
- ')', '=', 'v', 'd', 'b', ':', 'r', 'l', 'e', 'n', 'c', 'o', 'd', 'e', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y',
- ' ', 'r', 'l', 'd', 'e', 'c', 'o', 'd', 'e', '#', '1', '(', 'r', 'l', 'e', '_', 'f',
- 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'r', 'l', 'd', 'e', 'c', 'o',
- 'd', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'z', 'l', 'i', 'b', '_', 'f', 'm', 't', ' ', 'z', 'i', 'p', '#', '1', '<',
- '*', 'I', '3', '2', ' ', 's', 't', 'r', 'a', 't', 'e', 'g', 'y', ',', 'I', '3', '2',
- ' ', 'l', 'e', 'v', 'e', 'l', '>', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v',
- 'd', 'b', ':', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'u', 'n', 'z', 'i', 'p', '#', '1',
- '(', 'z', 'l', 'i', 'b', '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b',
- ':', 'u', 'n', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'b', 'z', 'i', 'p', '2', '_', 'f', 'm', 't', ' ', 'b',
- 'z', 'i', 'p', '#', '1', '<', '*', 'U', '3', '2', ' ', 'b', 'l', 'o', 'c', 'k', 'S',
- 'i', 'z', 'e', '1', '0', '0', 'k', ',', 'U', '3', '2', ' ', 'w', 'o', 'r', 'k', 'F',
- 'a', 'c', 't', 'o', 'r', '>', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v', 'd',
- 'b', ':', 'b', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'b', 'u', 'n', 'z', 'i', 'p', '#',
- '1', '(', 'b', 'z', 'i', 'p', '2', '_', 'f', 'm', 't', ' ', 'i', 'n', ')', '=', 'v',
- 'd', 'b', ':', 'b', 'u', 'n', 'z', 'i', 'p', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>',
- 'T', ' ', 's', 'i', 'm', 'p', 'l', 'e', '_', 's', 'u', 'b', '_', 's', 'e', 'l', 'e',
- 'c', 't', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 't', 'b', 'l', ',', 'a', 's',
- 'c', 'i', 'i', ' ', 'c', 'o', 'l', '>', '(', 'I', '6', '4', ' ', 'r', 'o', 'w', '*',
- 'I', '3', '2', ' ', 'i', 'd', 'x', ')', '=', 'v', 'd', 'b', ':', 's', 'i', 'm', 'p',
- 'l', 'e', '_', 's', 'u', 'b', '_', 's', 'e', 'l', 'e', 'c', 't', '_', '1', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e',
- 'x', 't', '_', 's', 'e', 't', ' ', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 't', 'o',
- 'k', 'e', 'n', '#', '1', '<', 'U', '3', '2', ' ', 'i', 'd', 'x', '>', '(', 't', 'e',
- 'x', 't', '_', 's', 'e', 't', ' ', 's', 't', 'r', ',', 't', 'e', 'x', 't', ':', 't',
- 'o', 'k', 'e', 'n', ' ', 't', 'o', 'k', ')', '=', 'v', 'd', 'b', ':', 'e', 'x', 't',
- 'r', 'a', 'c', 't', '_', 't', 'o', 'k', 'e', 'n', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'n', 'u', 'm', 'e', 'r', 'i', 'c',
- '_', 's', 'e', 't', ' ', 's', 't', 'r', 't', 'o', 'n', 'u', 'm', '#', '1', '<', '*',
- 'U', '3', '2', ' ', 'r', 'a', 'd', 'i', 'x', '>', '(', 't', 'e', 'x', 't', '_', 's',
- 'e', 't', ' ', 's', 't', 'r', ')', '=', 'v', 'd', 'b', ':', 's', 't', 'r', 't', 'o',
- 'n', 'u', 'm', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', 't', 'e', 'x', 't', '_', 's', 'e', 't', ' ', 's', 'p', 'r', 'i', 'n',
- 't', 'f', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'f', 'm', 't', '>', '(', 'a',
- 'n', 'y', ' ', 'p', '1', ',', '.', '.', '.', ')', '=', 'v', 'd', 'b', ':', 's', 'p',
- 'r', 'i', 'n', 't', 'f', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'm', 'e', 'r', 'g', 'e', 'd', '_', 't', ' ', 'N', 'C', 'B',
- 'I', ':', 'm', 'e', 'r', 'g', 'e', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ',',
- '.', '.', '.', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't',
- 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 's', 'p', 'l', 'i',
- 't', '#', '1', '<', 'U', '3', '2', ' ', 'i', 'd', 'x', '>', '(', 'm', 'e', 'r', 'g',
- 'e', 'd', '_', 't', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 's', 'p', 'l', 'i',
- 't', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'c', 'u', 't', '#', '1', '<', 'U',
- '3', '2', ' ', 'i', 'd', 'x', ',', '.', '.', '.', '>', '(', 'a', 'n', 'y', ' ', 'i',
- 'n', ')', '=', 'v', 'd', 'b', ':', 'c', 'u', 't', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B',
- 'I', ':', 'p', 'a', 's', 't', 'e', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ',',
- '.', '.', '.', ')', '=', 'v', 'd', 'b', ':', 'p', 'a', 's', 't', 'e', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y',
- ' ', 'N', 'C', 'B', 'I', ':', 'p', 'a', 'c', 'k', '#', '1', '<', 'U', '3', '2', ' ',
- 'f', 'r', 'o', 'm', ',', 'U', '3', '2', ' ', 't', 'o', '>', '(', 'a', 'n', 'y', ' ',
- 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'u', 'n', 'p', 'a', 'c',
- 'k', '#', '1', '<', 'U', '3', '2', ' ', 'f', 'r', 'o', 'm', ',', 'U', '3', '2', ' ',
- 't', 'o', '>', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r',
- 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C',
- 'B', 'I', ':', 'f', 'p', '_', 'd', 'e', 'c', 'o', 'd', 'e', '#', '1', '(', 'f', 'p',
- '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'i', 'n', ')', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y',
- ' ', 'N', 'C', 'B', 'I', ':', 'f', 'p', '_', 'e', 'x', 't', 'e', 'n', 'd', '#', '1',
- '<', 'U', '3', '2', ' ', 'b', 'i', 't', 's', '>', '(', 'N', 'C', 'B', 'I', ':', 'f',
- 'p', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'i', 'n', ')', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'r', 'l',
- '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'N', 'C', 'B', 'I', ':', 'r',
- 'u', 'n', '_', 'l', 'e', 'n', 'g', 't', 'h', '_', 'e', 'n', 'c', 'o', 'd', 'e', '#',
- '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'r', 'l', 'e',
- 'n', 'c', 'o', 'd', 'e', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'r', 'u', 'n',
- '_', 'l', 'e', 'n', 'g', 't', 'h', '_', 'd', 'e', 'c', 'o', 'd', 'e', '#', '1', '(',
- 'r', 'l', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'i', 'n', ')', '=',
- 'v', 'd', 'b', ':', 'r', 'l', 'd', 'e', 'c', 'o', 'd', 'e', ';', 'e', 'x', 't', 'e',
- 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'z', 'l', 'i', 'b', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'N', 'C',
- 'B', 'I', ':', 'z', 'l', 'i', 'b', '#', '1', '<', '*', 'I', '3', '2', ' ', 's', 't',
- 'r', 'a', 't', 'e', 'g', 'y', ',', 'I', '3', '2', ' ', 'l', 'e', 'v', 'e', 'l', '>',
- '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '=', 'v', 'd', 'b', ':', 'z', 'i', 'p', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a',
- 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', 'N',
- 'C', 'B', 'I', ':', 'z', 'l', 'i', 'b', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_',
- 't', ' ', 'i', 'n', ')', ';', 'a', 'l', 'i', 'a', 's', ' ', 'N', 'C', 'B', 'I', ':',
- 'u', 'n', 'z', 'i', 'p', ' ', 'N', 'C', 'B', 'I', ':', 'z', 'l', 'i', 'b', '_', 'd',
- 'e', 'c', 'o', 'm', 'p', 'r', 'e', 's', 's', ';', 's', 'c', 'h', 'e', 'm', 'a', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'z', 'l', 'i',
- 'b', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'N', 'C', 'B', 'I', ':',
- 'z', 'l', 'i', 'b', '_', 'h', 'u', 'f', 'f', 'm', 'a', 'n', '_', 'c', 'o', 'm', 'p',
- 'r', 'e', 's', 's', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n', ')', '{', 'r', 'e',
- 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'z', 'l', 'i', 'b', '#', '1', '<',
- '3', '>', '(', 'i', 'n', ')', ';', '}', 's', 'c', 'h', 'e', 'm', 'a', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'z', 'l', 'i', 'b', '_',
- 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 't', ' ', 'N', 'C', 'B', 'I', ':', 'z', 'l',
- 'i', 'b', '_', 'c', 'o', 'm', 'p', 'r', 'e', 's', 's', '#', '1', '(', 'a', 'n', 'y',
- ' ', 'i', 'n', ')', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'z', 'l', 'i', 'b', '#', '1', '<', '0', '>', '(', 'i', 'n', ')', ';', '}', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'E', 'Q', ':', 'r', 'a', 'n', 'd', '_', '4', 'n', 'a', '_', '2', 'n', 'a', '#',
- '1', '(', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'r',
- 'd', '_', 'b', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e',
- '_', 'f', 'm', 't', ',', 'I', '3', '2', ' ', 'X', ',', 'I', '3', '2', ' ', 'Y', '*',
- 'a', 's', 'c', 'i', 'i', ' ', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', ')', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a',
- 's', 'c', 'i', 'i', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'f', 'o',
- 'r', 'm', 'a', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 'n', 'o',
- '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a',
- 'm', 'e', '_', 'f', 'm', 't', '*', 'a', 's', 'c', 'i', 'i', ' ', 's', 'p', 'o', 't',
- '_', 'n', 'a', 'm', 'e', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':',
- 'b', 'i', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'c', 'o', 'l', 'o', 'r', '_', 'f', 'r',
- 'o', 'm', '_', 'd', 'n', 'a', '#', '1', '(', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2',
- 'n', 'a', ':', 'b', 'i', 'n', ' ', 'b', 'i', 'n', '_', 'x', '2', 'n', 'a', ',', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'r',
- 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n',
- ',', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'c',
- 's', '_', 'k', 'e', 'y', ',', 'U', '8', ' ', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a',
- 't', 'r', 'i', 'x', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b',
- 'i', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'd', 'n', 'a', '_', 'f', 'r', 'o', 'm', '_',
- 'c', 'o', 'l', 'o', 'r', '#', '1', '(', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c',
- 's', ':', 'b', 'i', 'n', ' ', 'c', 'o', 'l', 'o', 'r', '_', 'b', 'i', 'n', ',', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'r',
- 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n',
- ',', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'c',
- 's', '_', 'k', 'e', 'y', ',', 'U', '8', ' ', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a',
- 't', 'r', 'i', 'x', ')', ';', 's', 'c', 'h', 'e', 'm', 'a', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', '_', 't', 'o', '_', 'p', 'h', 'r', 'e', 'd', '#', '1', '(', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', ' ', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', ')', '{', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's',
- '_', 'c', 'l', 'i', 'p', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '>', 'c', 'l', 'i', 'p',
- '#', '1', '<', '-', '6', ',', '4', '0', '>', '(', 'q', 'u', 'a', 'l', '_', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', ',', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'p', 'h', 'r', 'e', 'd', '>', 'm', 'a', 'p', '#', '1', '<', '[', '-', '6',
- ',', '-', '5', ',', '-', '4', ',', '-', '3', ',', '-', '2', ',', '-', '1', ',', '0',
- ',', '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',',
- '9', ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',',
- '1', '5', ',', '1', '6', ',', '1', '7', ',', '1', '8', ',', '1', '9', ',', '2', '0',
- ',', '2', '1', ',', '2', '2', ',', '2', '3', ',', '2', '4', ',', '2', '5', ',', '2',
- '6', ',', '2', '7', ',', '2', '8', ',', '2', '9', ',', '3', '0', ',', '3', '1', ',',
- '3', '2', ',', '3', '3', ',', '3', '4', ',', '3', '5', ',', '3', '6', ',', '3', '7',
- ',', '3', '8', ',', '3', '9', ',', '4', '0', ']', ',', '[', '0', ',', '1', ',', '1',
- ',', '2', ',', '2', ',', '3', ',', '3', ',', '4', ',', '4', ',', '5', ',', '5', ',',
- '6', ',', '7', ',', '8', ',', '9', ',', '1', '0', ',', '1', '0', ',', '1', '1', ',',
- '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ',', '1', '6', ',', '1', '7',
- ',', '1', '8', ',', '1', '9', ',', '2', '0', ',', '2', '1', ',', '2', '2', ',', '2',
- '3', ',', '2', '4', ',', '2', '5', ',', '2', '6', ',', '2', '7', ',', '2', '8', ',',
- '2', '9', ',', '3', '0', ',', '3', '1', ',', '3', '2', ',', '3', '3', ',', '3', '4',
- ',', '3', '5', ',', '3', '6', ',', '3', '7', ',', '3', '8', ',', '3', '9', ',', '4',
- '0', ']', '>', '(', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'c', 'l', 'i', 'p',
- ')', ';', '}', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e',
- '#', '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ',', 't', 'e', 'x',
- 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 't', 'o', 'k', ')', ';', 'e', 'x', 't', 'e',
- 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 's', 'c', 'i', 'i',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't',
- '_', 'n', 'a', 'm', 'e', '_', 'f', 'm', 't', '#', '1', '<', 'a', 's', 'c', 'i', 'i',
- ' ', 'i', 'd', 'x', '>', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ',',
- 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 't', 'o', 'k', ')', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm',
- 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', 'U', '1', '6', ' ', 'c', 'o', 'o',
- 'r', 'd', '>', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ',', 't', 'e',
- 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 't', 'o', 'k', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o',
- 'u', 'n', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'l', 'o', 'o', 'k',
- 'u', 'p', '#', '1', '<', 'a', 's', 'c', 'i', 'i', ' ', 'i', 'n', 'd', 'e', 'x', '_',
- 'n', 'a', 'm', 'e', ',', 'a', 's', 'c', 'i', 'i', ' ', 'q', 'u', 'e', 'r', 'y', '_',
- 'b', 'y', '_', 'n', 'a', 'm', 'e', ',', 'U', '8', ' ', 'n', 'a', 'm', 'e', '_', 'f',
- 'm', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '>', '(', '*', 'a', 's', 'c', 'i',
- 'i', ' ', 'n', 'a', 'm', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', ')', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'U', '8', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 't', 'a', 't', 's', '_', 't', 'r',
- 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'U', '8', ' ', 'r', 'e', 'a', 'd', '_', 'b',
- 'i', 'n', ',', 'U', '3', '2', ' ', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', ' ', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '*', 'a', 's', 'c', 'i',
- 'i', ' ', 's', 'p', 'o', 't', '_', 'g', 'r', 'o', 'u', 'p', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'U', '8', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'c', 'm', 'p', '_', 's', 't', 'a', 't', 's',
- '_', 't', 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'B', '8', ' ', 'c', 'm', 'p',
- '_', 'r', 'e', 'a', 'd', '_', 'b', 'i', 'n', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 's', 't', 'a', 't', 's', ':', 'q', 'u', 'a', 'l', '_', 't', 'y', 'p', 'e',
- ' ', 'q', 'u', 'a', 'l', '_', 'b', 'i', 'n', ',', 'U', '3', '2', ' ', 'r', 'e', 'a',
- 'd', '_', 'l', 'e', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x',
- 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', '*', 'a', 's', 'c', 'i', 'i', ' ', 's', 'p', 'o', 't', '_', 'g', 'r', 'o',
- 'u', 'p', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', 'U', '8', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'c', 'm',
- 'p', 'f', '_', 's', 't', 'a', 't', 's', '_', 't', 'r', 'i', 'g', 'g', 'e', 'r', '#',
- '1', '(', 'B', '8', ' ', 'c', 'm', 'p', '_', 'r', 'e', 'a', 'd', '_', 'b', 'i', 'n',
- ',', 'U', '3', '2', ' ', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',', 'U', '3', '2',
- ' ', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'r', 'e', 'a',
- 'd', '_', 't', 'y', 'p', 'e', '*', 'a', 's', 'c', 'i', 'i', ' ', 's', 'p', 'o', 't',
- '_', 'g', 'r', 'o', 'u', 'p', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', 'U', '8', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'p', 'h', 'r', 'e', 'd', '_', 's', 't', 'a', 't', 's', '_', 't', 'r', 'i',
- 'g', 'g', 'e', 'r', '#', '1', '(', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'q', 'u', 'a', 'l', '_', 'b', 'i',
- 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r',
- 'o', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'b', 'i', 'o', '_', 's', 't',
- 'a', 'r', 't', '#', '1', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'z', 'e', 'r', 'o', ' ', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't',
- 'y', 'p', 'e', ' ', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', ';', 'e', 'x',
- 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', '[', '2', ']', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 'i', 'x', '_', 'r', 'e', 'a', 'd', '_',
- 's', 'e', 'g', '#', '1', '(', 'U', '1', '6', '[', '2', ']', ' ', 'r', 'd', '_', 's',
- 'e', 'g', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e',
- 'n', ' ', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ')', ';', 'e', 'x', 't', 'e', 'r',
- 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'S', 'p', 'o', 't', 'D', 'e', 's', 'c', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 's', 'p', 'o', 't', '_', 'd', 'e', 's',
- 'c', '#', '1', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l',
- 'e', 'n', ' ', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'f', 'i', 'x', 'e', 'd', '_',
- 'l', 'e', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l',
- 'e', 'n', ' ', 's', 'i', 'g', '_', 'l', 'e', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 't', 'r', 'i', 'm', '_', 's',
- 't', 'a', 'r', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'l', 'e', 'n', ' ', 't', 'r', 'i', 'm', '_', 'l', 'e', 'n', ',', 'U', '8', ' ', 'n',
- 'u', 'm', '_', 'r', 'e', 'a', 'd', 's', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'R', 'e', 'a', 'd', 'D', 'e', 's', 'c', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'm', 'a', 'k', 'e', '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', '#',
- '1', '(', 'U', '8', ' ', 'n', 'u', 'm', '_', 'r', 'e', 'a', 'd', 's', ',', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'r', 'e',
- 'a', 'd', '_', 's', 't', 'a', 'r', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't',
- 'y', 'p', 'e', ' ', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ',', 'I', 'N', 'S',
- 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e',
- 'r', ' ', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', ',', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'c', 's', '_', 'k', 'e', 'y', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ',
- 'l', 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', ',', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'l', 'a', 'b', 'e', 'l', '_',
- 'l', 'e', 'n', ',', 'a', 's', 'c', 'i', 'i', ' ', 'l', 'a', 'b', 'e', 'l', ')', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<',
- 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'r', 'o', 't', 'a', 't', 'e', '#', '1', '<', 'b', 'o', 'o', 'l', ' ', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', '>', '(', 'T', ' ', 'i', 'n', ',', 'U', '8', ' ', 'c',
- 'a', 'l', 'l', 'e', 'd', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'T', ' ',
- 'i', 'n', ',', 'U', '8', ' ', 'c', 'a', 'l', 'l', 'e', 'd', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't', 'y', 'p',
- 'e', ' ', 'T', '>', 'T', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'o',
- 'r', 'm', 'a', 'l', 'i', 'z', 'e', '#', '1', '(', 'T', ' ', 'i', 'n', 't', 'e', 'n',
- 's', 'i', 't', 'y', ',', 'U', '8', ' ', 'c', 'a', 'l', 'l', 'e', 'd', ')', ';', 'e',
- 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '<', 't',
- 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'd', 'e', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', '#', '1', '(', 'T', ' ', 'i',
- 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'U', '8', ' ', 'c', 'a', 'l', 'l', 'e',
- 'd', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n',
- '#', '1', '<', 'T', ' ', 's', 't', 'a', 'r', 't', '>', '(', 'a', 'n', 'y', ' ', 'b',
- 'a', 's', 'e', 's', ')', ';', 's', 'c', 'h', 'e', 'm', 'a', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a',
- 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'd', 'e', 'c', 'o', 'd', 'e',
- '#', '2', '(', 'm', 'e', 'r', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 'i', 'n', ')',
- '{', 'f', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ', 'c', 'm', 'p', '0', '=', 's', 'p',
- 'l', 'i', 't', '#', '1', '<', '0', '>', '(', 'i', 'n', ')', ';', 'f', 'z', 'i', 'p',
- '_', 'f', 'm', 't', ' ', 'c', 'm', 'p', '1', '2', '3', '=', 's', 'p', 'l', 'i', 't',
- '#', '1', '<', '1', '>', '(', 'i', 'n', ')', ';', 'F', '3', '2', ' ', 'c', 'h', '0',
- '=', 'f', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', 'c', 'm', 'p', '0', ')', ';', 'F',
- '3', '2', ' ', 'c', 'h', '1', '2', '3', 'a', '=', 'f', 'u', 'n', 'z', 'i', 'p', '#',
- '1', '(', 'c', 'm', 'p', '1', '2', '3', ')', ';', 'F', '3', '2', '[', '3', ']', ' ',
- 'c', 'h', '1', '2', '3', '=', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
- '#', '1', '(', 'c', 'h', '1', '2', '3', 'a', ')', ';', 'r', 'e', 't', 'u', 'r', 'n',
- ' ', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e',
- 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'F', '3', '2', '>', 'p', 'a', 's',
- 't', 'e', '#', '1', '(', 'c', 'h', '0', ',', 'c', 'h', '1', '2', '3', ')', ';', '}',
- 's', 'c', 'h', 'e', 'm', 'a', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'm',
- 'e', 'r', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'e', 'n', 'c', 'o', 'd', 'e', '#', '2',
- '<', 'U', '3', '2', ' ', 'c', 'a', 'l', 'l', 'e', 'd', ',', 'U', '3', '2', ' ', 'a',
- 'l', 't', '>', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p',
- 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'i', 'n', ')', '{', 'F', '3',
- '2', ' ', 'c', 'h', '0', '=', '<', 'F', '3', '2', '>', 'c', 'u', 't', '#', '1', '<',
- '0', '>', '(', 'i', 'n', ')', ';', 'F', '3', '2', '[', '3', ']', ' ', 'c', 'h', '1',
- '2', '3', '=', '<', 'F', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '1', ',', '2',
- ',', '3', '>', '(', 'i', 'n', ')', ';', 'f', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ',
- 'c', 'm', 'p', '0', '=', 'f', 'z', 'i', 'p', '#', '1', '<', 'c', 'a', 'l', 'l', 'e',
- 'd', '>', '(', 'c', 'h', '0', ')', ';', 'F', '3', '2', ' ', 'c', 'h', '1', '2', '3',
- 'a', '=', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n', '#', '1', '(', 'c',
- 'h', '1', '2', '3', ')', ';', 'f', 'z', 'i', 'p', '_', 'f', 'm', 't', ' ', 'c', 'm',
- 'p', '1', '2', '3', '=', 'f', 'z', 'i', 'p', '#', '1', '<', 'a', 'l', 't', '>', '(',
- 'c', 'h', '1', '2', '3', 'a', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'm', 'e',
- 'r', 'g', 'e', '#', '1', '(', 'c', 'm', 'p', '0', ',', 'c', 'm', 'p', '1', '2', '3',
- ')', ';', '}', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', 'U', '3', '2', '[', '3', ']', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', '_', '4', '5', '4', '_', ':', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r', 'e',
- 'a', 'd', '_', 'd', 'e', 's', 'c', '#', '1', '<', '*', 'U', '3', '2', ' ', 'e', 'd',
- 'i', 't', '_', 'd', 'i', 's', 't', 'a', 'n', 'c', 'e', '>', '(', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'r', 'd', 'p', 'a', 'r',
- 'a', 'm', '_', 's', 'e', 't', ' ', 's', 'p', 'o', 't', ',', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'r', 'd', 'p', 'a', 'r', 'a',
- 'm', '_', 's', 'e', 't', ' ', 'k', 'e', 'y', '*', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'r', 'd', 'p', 'a', 'r', 'a', 'm', '_',
- 's', 'e', 't', ' ', 'l', 'i', 'n', 'k', 'e', 'r', ')', ';', 'e', 'x', 't', 'e', 'r',
- 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e', 'x', 't', ':', 't',
- 'o', 'k', 'e', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5',
- '4', '_', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e',
- ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'o', 'k', 'e',
- 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(',
- 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ')', ';', 'e', 'x', 't', 'e', 'r',
- 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'q', 'u', 'a', 'l', '4', '_', 'd', 'e',
- 'c', 'o', 'd', 'e', '#', '1', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e',
- 'n', 'c', 'o', 'd', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'i', 'n', ')', ';',
- 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 'q',
- 'u', 'a', 'l', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'q', 'u', 'a',
- 'l', '4', '_', 'e', 'n', 'c', 'o', 'd', 'e', '#', '1', '(', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4',
- ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't',
- 'i', 'o', 'n', ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 't', 'o', 'k', 'e', 'n', 'i',
- 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', 'a', 's',
- 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k',
- 'e', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'H', 'e', 'l', 'i', 'c',
- 'o', 's', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e',
- ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'o', 'n', 'T', 'o', 'r', 'r', 'e', 'n', 't', ':', 't', 'o',
- 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#',
- '1', '(', 'a', 's', 'c', 'i', 'i', ' ', 'n', 'a', 'm', 'e', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'U', '3', '2', '[',
- '5', ']', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_',
- 's', 'e', 'g', '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', 'n', '#', '1', '(',
- 'U', '8', ' ', 'n', 'r', 'e', 'a', 'd', 's', ',', 'U', '3', '2', ' ', 's', 'p', 'o',
- 't', '_', 'l', 'e', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '>', '(', 'a', 's', 'c', 'i', 'i', ' ', 's', 'k', 'e', 'y', '*', 'a',
- 's', 'c', 'i', 'i', ' ', 'p', 'r', 'e', 'f', 'i', 'x', ')', ';', 'e', 'x', 't', 'e',
- 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', '[', '*', ']', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'c', 'o', 'o',
- 'r', 'd', 'i', 'n', 'a', 't', 'e', 's', '#', '1', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'p',
- 'l', 'a', 't', 'f', 'o', 'r', 'm', '>', '(', 'a', 's', 'c', 'i', 'i', ' ', 's', 'k',
- 'e', 'y', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'u', 'n', 't', 'y', 'p', 'e',
- 'd', '_', '0', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c',
- 't', 'i', 'o', 'n', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'C', 'L', 'I', 'P', '#', '1', '(', 'o', 'p',
- 'a', 'q', 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f',
- 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'p', 'o', 's', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e',
- 'c', 'o', 'd', 'e', ':', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '#', '1', '(', 'o',
- 'p', 'a', 'q', 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ',
- 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n',
- 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'R', 'E', 'A', 'D', '#', '1', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_',
- 'i', 'd', ' ', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '>', '(', 'o', 'p', 'a', 'q',
- 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n',
- 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '#',
- '1', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '_', 'i', 'd', ' ', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '>', '(',
- 'o', 'p', 'a', 'q', 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n',
- ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'S', 'I', 'G', 'N',
- 'A', 'L', '#', '1', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l',
- 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'p', 'l', 'a', 't', 'f', 'o', 'r',
- 'm', '>', '(', 'o', 'p', 'a', 'q', 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's', '_',
- 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '#', '1', '(', 'U', '1', '6', ' ', 'p', 'o',
- 's', 'i', 't', 'i', 'o', 'n', '*', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', ' ', 'r', 'd', '_', 'f', 'i',
- 'l', 't', ',', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', ' ', 's', 'i',
- 'g', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd',
- '_', '1', '_', '2', 'a', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'u', 'n',
- 't', 'y', 'p', 'e', 'd', '_', '1', '_', '2', 'b', '(', ')', ';', 'e', 'x', 't', 'e',
- 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'I', 'N',
- 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '#', '1', '(', 'o', 'p', 'a', 'q', 'u', 'e', ' ',
- 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i',
- 'o', 'n', ' ', 'a', 'n', 'y', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd',
- 'e', 'c', 'o', 'd', 'e', ':', 'N', 'O', 'I', 'S', 'E', '#', '1', '(', 'o', 'p', 'a',
- 'q', 'u', 'e', ' ', 'i', 'n', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a',
- ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '0', 'a', '(', ')', ';', 'e', 'x', 't',
- 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '_', '_', 'u', 'n',
- 't', 'y', 'p', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l',
- 'l', 'u', 'm', 'i', 'n', 'a', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '0', 'b',
- '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
- 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'u', 'n', 't', 'y',
- 'p', 'e', 'd', '_', '1', 'a', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f',
- 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'q', 'u', 'a', 'l', '4', '_', 'd', 'e', 'c', 'o', 'm',
- 'p', 'r', 'e', 's', 's', '_', 'v', '1', '#', '1', '(', 'a', 'n', 'y', ' ', 'i', 'n',
- ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n',
- ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'u', 'n', 't', 'y', 'p',
- 'e', 'd', '_', '1', 'b', '(', ')', ';', 'e', 'x', 't', 'e', 'r', 'n', ' ', 'f', 'u',
- 'n', 'c', 't', 'i', 'o', 'n', ' ', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 'u', 'n', 't', 'y',
- 'p', 'e', 'd', '_', '1', '(', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'i', 'z', 'i', 'p', '_', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r',
- 'e', 't', 'u', 'r', 'n', ' ', 'i', 'z', 'i', 'p', '#', '2', '.', '1', '(', '@', ')',
- ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', '(',
- 'T', ')', 'i', 'u', 'n', 'z', 'i', 'p', '#', '2', '.', '1', '(', '@', ')', ';', '}',
- '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T',
- '>', 'T', ' ', 'f', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#',
- '1', '<', 'U', '3', '2', ' ', 'm', 'a', 'n', 't', 'i', 's', 's', 'a', '>', '{', 'e',
- 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'f', 'z', 'i', 'p',
- '#', '1', '<', 'm', 'a', 'n', 't', 'i', 's', 's', 'a', '>', '(', '@', ')', ';', '}',
- 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'f', 'u', 'n',
- 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'z', 'i', 'p', '_',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '<', '*', 'I', '3', '2', ' ', 's',
- 't', 'r', 'a', 't', 'e', 'g', 'y', ',', 'I', '3', '2', ' ', 'l', 'e', 'v', 'e', 'l',
- '>', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'z',
- 'i', 'p', '#', '1', '<', 's', 't', 'r', 'a', 't', 'e', 'g', 'y', ',', 'l', 'e', 'v',
- 'e', 'l', '>', '(', '@', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e',
- 't', 'u', 'r', 'n', ' ', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', '}',
- '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'b', 'o', 'o', 'l', ' ', 'b', 'o',
- 'o', 'l', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{', 'e', 'n', 'c',
- 'o', 'd', 'e', '{', 'U', '8', ' ', 'l', 'i', 'm', '=', '<', 'U', '8', '>', 'c', 'l',
- 'i', 'p', '#', '1', '<', '0', ',', '1', '>', '(', '@', ')', ';', 'B', '1', ' ', 'b',
- 'i', 't', '=', 'p', 'a', 'c', 'k', '#', '1', '(', 'l', 'i', 'm', ')', ';', 'r', 'e',
- 't', 'u', 'r', 'n', ' ', 'z', 'i', 'p', '#', '1', '<', '3', ',', '1', '>', '(', 'b',
- 'i', 't', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'B', '1', ' ', 'b', 'i',
- 't', '=', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u',
- 'r', 'n', ' ', '(', 'b', 'o', 'o', 'l', ')', 'u', 'n', 'p', 'a', 'c', 'k', '#', '1',
- '(', 'b', 'i', 't', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T', ' ', 'd', 'e', 'l', 't', 'a', '_', 'i',
- 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{', 'e', 'n',
- 'c', 'o', 'd', 'e', '{', 'T', ' ', 'd', 'l', 't', '=', '<', 'T', '>', 'd', 'e', 'l',
- 't', 'a', '#', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'i', 'z',
- 'i', 'p', '#', '2', '.', '1', '(', 'd', 'l', 't', ')', ';', '}', 'd', 'e', 'c', 'o',
- 'd', 'e', '{', 'T', ' ', 'd', 'l', 't', '=', 'i', 'u', 'n', 'z', 'i', 'p', '#', '2',
- '.', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', '<', 'T', '>', 'u',
- 'n', 'd', 'e', 'l', 't', 'a', '#', '1', '(', 'd', 'l', 't', ')', ';', '}', '}', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '<', 't', 'y', 'p', 'e', ' ', 'T', '>', 'T',
- ' ', 'd', 'e', 'l', 't', 'a', '_', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', '#', '1', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'T', ' ', 'd', 'l', 't',
- '=', '<', 'T', '>', 'd', 'e', 'l', 't', 'a', '#', '1', '(', '@', ')', ';', 'r', 'e',
- 't', 'u', 'r', 'n', ' ', 'z', 'i', 'p', '#', '1', '<', '3', ',', '1', '>', '(', 'd',
- 'l', 't', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'T', ' ', 'd', 'l', 't',
- '=', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r',
- 'n', ' ', '<', 'T', '>', 'u', 'n', 'd', 'e', 'l', 't', 'a', '#', '1', '(', 'd', 'l',
- 't', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '<', 't', 'y',
- 'p', 'e', ' ', 'T', '>', 'T', ' ', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e', 'r',
- 'a', 'g', 'e', '_', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#',
- '1', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'd', 'e', 'l', 't', 'a', '_', 'a', 'v',
- 'e', 'r', 'a', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 't', '=', 'd', 'e', 'l', 't',
- 'a', '_', 'a', 'v', 'e', 'r', 'a', 'g', 'e', '#', '1', '(', '@', ')', ';', 'r', 'e',
- 't', 'u', 'r', 'n', ' ', 'z', 'i', 'p', '#', '1', '<', '3', ',', '1', '>', '(', 't',
- ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'd', 'e', 'l', 't', 'a', '_', 'a',
- 'v', 'e', 'r', 'a', 'g', 'e', 'd', '_', 'f', 'm', 't', ' ', 't', '=', 'u', 'n', 'z',
- 'i', 'p', '#', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'u', 'n',
- 'd', 'e', 'l', 't', 'a', '_', 'a', 'v', 'e', 'r', 'a', 'g', 'e', '#', '1', '(', 't',
- ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '<', 't', 'y', 'p',
- 'e', ' ', 'T', '>', 'T', ' ', 'b', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', '#', '1', '<', '*', 'U', '3', '2', ' ', 'b', 'l', 'o', 'c', 'k', 'S', 'i',
- 'z', 'e', '1', '0', '0', 'k', ',', 'U', '3', '2', ' ', 'w', 'o', 'r', 'k', 'F', 'a',
- 'c', 't', 'o', 'r', '>', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u',
- 'r', 'n', ' ', 'b', 'z', 'i', 'p', '#', '1', '<', 'b', 'l', 'o', 'c', 'k', 'S', 'i',
- 'z', 'e', '1', '0', '0', 'k', ',', 'w', 'o', 'r', 'k', 'F', 'a', 'c', 't', 'o', 'r',
- '>', '(', '@', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u',
- 'r', 'n', ' ', 'b', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', '}', '}',
- 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L',
- 'I', 'P', '#', '2', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r',
- 'n', ' ', 'i', 'z', 'i', 'p', '#', '2', '.', '1', '(', '@', ')', ';', '}', 'd', 'e',
- 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', '(', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ')', 'i', 'u', 'n', 'z', 'i',
- 'p', '#', '2', '.', '1', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '2', '{', 'e', 'n', 'c',
- 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'i', 'z', 'i', 'p', '#', '2',
- '.', '1', '(', '@', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't',
- 'u', 'r', 'n', ' ', '(', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', ')',
- 'i', 'u', 'n', 'z', 'i', 'p', '#', '2', '.', '1', '(', '@', ')', ';', '}', '}', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's',
- 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':',
- 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '#', '2', '{', 'e', 'n', 'c', 'o', 'd', 'e',
- '{', 'I', '3', '2', ' ', 'p', 'o', 's', '_', '1', 's', 't', '_', 'd', 'e', 'r', 'i',
- 'v', '=', '<', 'I', '3', '2', '>', 'd', 'e', 'r', 'i', 'v', '#', '1', '(', '@', ')',
- ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'i', 'z', 'i', 'p', '#', '2', '.', '1', '(',
- 'p', 'o', 's', '_', '1', 's', 't', '_', 'd', 'e', 'r', 'i', 'v', ')', ';', '}', 'd',
- 'e', 'c', 'o', 'd', 'e', '{', 'I', '3', '2', ' ', 'p', 'o', 's', '_', '1', 's', 't',
- '_', 'd', 'e', 'r', 'i', 'v', '=', 'i', 'u', 'n', 'z', 'i', 'p', '#', '2', '.', '1',
- '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ')', '<', 'I', '3',
- '2', '>', 'i', 'n', 't', 'e', 'g', 'r', 'a', 'l', '#', '1', '(', 'p', 'o', 's', '_',
- '1', 's', 't', '_', 'd', 'e', 'r', 'i', 'v', ')', ';', '}', '}', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a',
- 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'q', 'u', 'a', 'l', '4', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g',
- '#', '1', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'e', 'n', 'c', 'o', 'd', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'e',
- 'n', 'c', 'o', 'd', 'e', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'q',
- 'u', 'a', 'l', '4', '_', 'e', 'n', 'c', 'o', 'd', 'e', '#', '1', '(', '@', ')', ';',
- 'r', 'e', 't', 'u', 'r', 'n', ' ', 'z', 'i', 'p', '#', '1', '<', '3', ',', '1', '>',
- '(', 'e', 'n', 'c', 'o', 'd', 'e', 'd', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e',
- '{', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'n', 'c', 'o', 'd', 'e', 'd',
- '_', 'q', 'u', 'a', 'l', '4', ' ', 'u', 'n', 'z', 'i', 'p', 'p', 'e', 'd', '=', 'u',
- 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'q', 'u', 'a', 'l', '4', '_', 'd', 'e',
- 'c', 'o', 'd', 'e', '#', '1', '(', 'u', 'n', 'z', 'i', 'p', 'p', 'e', 'd', ')', ';',
- '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L',
- '#', '2', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'e',
- 'n', 'c', 'o', 'd', 'e', '#', '2', '<', '1', '4', ',', '1', '0', '>', '(', '@', ')',
- ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'd', 'e',
- 'c', 'o', 'd', 'e', '#', '2', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'N', 'O', 'I', 'S', 'E', '#', '2', '{',
- 'e', 'n', 'c', 'o', 'd', 'e', '{', 'F', '3', '2', ' ', 'n', 'c', 'm', 'p', '=', 'r',
- 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n', '#', '1', '(', '@', ')', ';', 'r',
- 'e', 't', 'u', 'r', 'n', ' ', 'f', 'z', 'i', 'p', '#', '1', '<', '1', '0', '>', '(',
- 'n', 'c', 'm', 'p', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'F', '3', '2',
- ' ', 'd', 'c', 'm', 'p', '=', 'f', 'u', 'n', 'z', 'i', 'p', '#', '1', '(', '@', ')',
- ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i',
- 'o', 'n', '#', '1', '(', 'd', 'c', 'm', 'p', ')', ';', '}', '}', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a',
- 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', ':', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '#', '2', '{',
- 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'e', 'n', 'c', 'o',
- 'd', 'e', '#', '2', '<', '1', '4', ',', '1', '0', '>', '(', '@', ')', ';', '}', 'd',
- 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':', 'd', 'e', 'c', 'o', 'd',
- 'e', '#', '2', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd',
- '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'A', 'B', 'I', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N',
- 'A', 'L', '#', '2', '{', 'e', 'n', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r',
- 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4',
- ':', 'e', 'n', 'c', 'o', 'd', 'e', '#', '2', '<', '1', '4', ',', '1', '0', '>', '(',
- '@', ')', ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 's', 'a', 'm', 'p', '4', ':',
- 'd', 'e', 'c', 'o', 'd', 'e', '#', '2', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y',
- 's', 'i', 'c', 'a', 'l', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't',
- 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'I', 'o', 'n', 'T', 'o', 'r', 'r', 'e', 'n', 't', ':', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', ':', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '#', '1', '{', 'e', 'n', 'c',
- 'o', 'd', 'e', '{', 'I', '3', '2', ' ', 'p', 'o', 's', '_', '1', 's', 't', '_', 'd',
- 'e', 'r', 'i', 'v', '=', '<', 'I', '3', '2', '>', 'd', 'e', 'r', 'i', 'v', '#', '1',
- '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'i', 'z', 'i', 'p', '#', '2',
- '.', '1', '(', 'p', 'o', 's', '_', '1', 's', 't', '_', 'd', 'e', 'r', 'i', 'v', ')',
- ';', '}', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'I', '3', '2', ' ', 'p', 'o', 's', '_',
- '1', 's', 't', '_', 'd', 'e', 'r', 'i', 'v', '=', 'i', 'u', 'n', 'z', 'i', 'p', '#',
- '2', '.', '1', '(', '@', ')', ';', 'r', 'e', 't', 'u', 'r', 'n', ' ', '(', 'I', 'N',
- 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ')',
- '<', 'I', '3', '2', '>', 'i', 'n', 't', 'e', 'g', 'r', 'a', 'l', '#', '1', '(', 'p',
- 'o', 's', '_', '1', 's', 't', '_', 'd', 'e', 'r', 'i', 'v', ')', ';', '}', '}', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd',
- 'e', 'r', ' ', 'U', '1', '6', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_',
- '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I',
- 'P', '#', '1', '{', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':',
- 'C', 'L', 'I', 'P', '#', '1', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', ':', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '#', '1', '{', 'd', 'e',
- 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'P', 'O', 'S', 'I', 'T', 'I',
- 'O', 'N', '#', '1', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a',
- 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', ':', 'R', 'E', 'A', 'D', '#', '1', '{', 'd', 'e', 'c', 'o', 'd', 'e',
- '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'd', 'e', 'c', 'o', 'd', 'e', ':', 'R', 'E', 'A', 'D', '#', '1', '<', '1', '>', '(',
- '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n',
- 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', ':', 'p', 'h',
- 'r', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4',
- '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A', 'L', 'I', 'T',
- 'Y', '#', '1', '{', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '#', '1', '<', '1', '>', '(', '@', ')', ';', '}',
- '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e',
- 'a', 'd', 'e', 'r', ' ', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '1', '{', 'd',
- 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'S', 'I', 'G', 'N', 'A',
- 'L', '#', '1', '<', '1', '>', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'R', 'E', 'A', 'D', '#', '1', '{', 'd',
- 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'R', 'E', 'A', 'D', '#',
- '1', '<', '2', '>', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a',
- 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'q', 'u', 'a',
- 'l', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', '#', '1', '{', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u',
- 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd',
- 'e', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '#', '1', '<', '2', '>', '(', '@', ')',
- ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_',
- 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', '#', '1', '{', 'd', 'e', 'c',
- 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y',
- '#', '1', '<', '2', '>', '(', '@', ')', ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'f', 's',
- 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l',
- 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I',
- 'G', 'N', 'A', 'L', '#', '1', '{', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't',
- 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o',
- 'd', 'e', ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '1', '<', '2', '>', '(', '@', ')',
- ';', '}', '}', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_',
- 'h', 'e', 'a', 'd', 'e', 'r', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r',
- 'o', 't', 'a', 't', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', ':', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '#',
- '1', '{', 'd', 'e', 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'I', 'N',
- 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '#', '1', '(', '@', ')', ';', '}', '}', 'p', 'h',
- 'y', 's', 'i', 'c', 'a', 'l', ' ', '_', '_', 'n', 'o', '_', 'h', 'e', 'a', 'd', 'e',
- 'r', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', ':', 'N', 'O', 'I', 'S', 'E', '#', '1', '{', 'd', 'e',
- 'c', 'o', 'd', 'e', '{', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'd', 'e', 'c', 'o', 'd', 'e', ':', 'N', 'O', 'I', 'S', 'E', '#',
- '1', '(', '@', ')', ';', '}', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.',
- '0', '.', '1', '{', 'd', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ',
- 'R', 'E', 'A', 'D', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'd', 'n', 'a',
- '_', 't', 'e', 'x', 't', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'c', 'o', 'm',
- 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n', '_', 'd', 'n', 'a', '_', 't', 'e', 'x',
- 't', ',', 'o', 'u', 't', '_', 'd', 'n', 'a', '_', 't', 'e', 'x', 't', ')', ';', '}',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':',
- 'b', 'i', 'n', ' ', 'R', 'E', 'A', 'D', ' ', '=', ' ', 'o', 'u', 't', '_', '4', 'n',
- 'a', '_', 'b', 'i', 'n', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'R', 'E', 'A', 'D',
- ' ', '=', ' ', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd',
- ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n',
- 'a', ':', 'b', 'i', 'n', ' ', 'R', 'E', 'A', 'D', ' ', '=', ' ', 'o', 'u', 't', '_',
- 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'R', 'E', 'A', 'D',
- ' ', '=', ' ', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ';', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a',
- 'c', 'k', 'e', 'd', ' ', 'R', 'E', 'A', 'D', ' ', '=', ' ', 'o', 'u', 't', '_', '2',
- 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', ';', 'd', 'e', 'f', 'a', 'u', 'l', 't',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l',
- 'o', 'r', ':', 't', 'e', 'x', 't', ' ', 'C', 'S', 'R', 'E', 'A', 'D', '{', 'r', 'e',
- 'a', 'd', '=', 'o', 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't',
- ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', '>', 'c', 'o', 'm', 'p', 'a', 'r',
- 'e', '#', '1', '(', 'i', 'n', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't',
- ',', 'o', 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't', ')', ';',
- '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c',
- 's', ':', 'b', 'i', 'n', ' ', 'C', 'S', 'R', 'E', 'A', 'D', ' ', '=', ' ', 'o', 'u',
- 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', ';', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'C', 'S',
- 'R', 'E', 'A', 'D', ' ', '=', ' ', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'b', 'i',
- 'n', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c',
- 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'C', 'S', 'R', 'E', 'A', 'D', ' ', '=',
- ' ', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', ';', 'r',
- 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'b', 'o',
- 'o', 'l', ' ', 'C', 'S', '_', 'N', 'A', 'T', 'I', 'V', 'E', ' ', '=', ' ', 'c', 's',
- '_', 'n', 'a', 't', 'i', 'v', 'e', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'C', 'S', '_', 'K',
- 'E', 'Y', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e',
- 'y', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'c', 'o', 'm', 'p', 'a', 'r', 'e',
- '#', '1', '(', 'i', 'n', '_', 'c', 's', '_', 'k', 'e', 'y', ',', 'o', 'u', 't', '_',
- 'c', 's', '_', 'k', 'e', 'y', ')', ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U',
- '8', ' ', 'C', 'O', 'L', 'O', 'R', '_', 'M', 'A', 'T', 'R', 'I', 'X', ' ', '=', ' ',
- 'o', 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', ';',
- 'd', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd',
- ' ', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u',
- 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't',
- ':', 'p', 'h', 'r', 'e', 'd', '_', '3', '3', ' ', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y',
- ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 't', 'e', 'x', 't', '_',
- 'p', 'h', 'r', 'e', 'd', '_', '3', '3', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', 'q',
- 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':', 'p', 'h', 'r', 'e', 'd',
- '_', '3', '3', ')', '<', 'B', '8', '>', 's', 'u', 'm', '#', '1', '<', '3', '3', '>',
- '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', ')', ';',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':', 'p', 'h', 'r', 'e', 'd', '_', '6', '4',
- ' ', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u',
- 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'p', 'h', 'r', 'e', 'd', '_', '6', '4', '|',
- '(', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'e',
- 'x', 't', ':', 'p', 'h', 'r', 'e', 'd', '_', '6', '4', ')', '<', 'B', '8', '>', 's',
- 'u', 'm', '#', '1', '<', '6', '4', '>', '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l',
- '_', 'p', 'h', 'r', 'e', 'd', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'l', 'e', 'n', ' ', 's', 'i', 'g', 'n', 'a', 'l', '_', 'l', 'e', 'n',
- '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n',
- ')', 'r', 'o', 'w', '_', 'l', 'e', 'n', '#', '1', '(', 'o', 'u', 't', '_', 's', 'i',
- 'g', 'n', 'a', 'l', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'l', 'e', 'n', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', ')',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l',
- ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', '#', '1', '{', 'd', 'e', 'f', 'a', 'u', 'l',
- 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r',
- 'o', 't', 'e', 'i', 'n', ':', 't', 'e', 'x', 't', ' ', 'P', 'R', 'O', 'T', 'E', 'I',
- 'N', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'p', 'r', 'o', 't', 'e', 'i',
- 'n', '_', 't', 'e', 'x', 't', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't', 'e', 'x',
- 't', '>', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n', '_', 'p', 'r',
- 'o', 't', 'e', 'i', 'n', '_', 't', 'e', 'x', 't', ',', 'o', 'u', 't', '_', 'p', 'r',
- 'o', 't', 'e', 'i', 'n', '_', 't', 'e', 'x', 't', ')', ';', '}', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ' ', 'P',
- 'R', 'O', 'T', 'E', 'I', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'a', 'a', '_', 'b',
- 'i', 'n', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'c', 'o', 'o', 'r', 'd', '#',
- '1', '{', 'd', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'X',
- ' ', '=', ' ', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ';', 'd', 'e',
- 'f', 'a', 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'Y', ' ', '=', ' ', 'o',
- 'u', 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', ';', 'r', 'e', 'a', 'd', 'o', 'n',
- 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'X', ' ', '=',
- ' ', 'c', 'a', 's', 't', '#', '1', '(', 'x', '_', 'c', 'l', 'i', 'p', '_', 'U', '1',
- '6', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'U', '1', '6', ' ', 'Y', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(',
- 'y', '_', 'c', 'l', 'i', 'p', '_', 'U', '1', '6', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'x', '_', 'c', 'l', 'i', 'p',
- '_', 'U', '1', '6', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'v', 'a', 'l', '>', 'c', 'l', 'i', 'p', '#', '1', '<', '0', ',', '6', '5', '5',
- '3', '5', '>', '(', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'y',
- '_', 'c', 'l', 'i', 'p', '_', 'U', '1', '6', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', '>', 'c', 'l', 'i', 'p', '#', '1', '<',
- '0', ',', '6', '5', '5', '3', '5', '>', '(', 'o', 'u', 't', '_', 'y', '_', 'c', 'o',
- 'o', 'r', 'd', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e',
- '#', '1', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'c', 'o', 'o', 'r', 'd', '#', '1', '{', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'N', 'A', 'M', 'E', ' ',
- '=', ' ', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n',
- 'd', ' ', 'S', 'P', 'O', 'T', '_', 'I', 'D', 'S', '_', 'F', 'O', 'U', 'N', 'D', ' ',
- '=', ' ', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', ';',
- 'a', 's', 'c', 'i', 'i', ' ', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', '=', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'f', 'o', 'r', 'm', 'a', 't', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', 'o', 'u', 't', '_', 'n', 'a',
- 'm', 'e', '_', 'f', 'm', 't', ',', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r',
- 'd', ',', 'o', 'u', 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', ',', 'o', 'u', 't',
- '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', ')', '|', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '(', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', '_', 'f',
- 'm', 't', ',', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ',', 'o', 'u',
- 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', ')', '|', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'p', 'o', 't', '_', 'n',
- 'a', 'm', 'e', '_', 'n', 'o', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '(', 'o', 'u',
- 't', '_', 'n', 'a', 'm', 'e', '_', 'f', 'm', 't', ')', '|', 'o', 'u', 't', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't',
- 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', '=', 'I', 'N', 'S', 'D', 'C', ':',
- 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.',
- '1', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '8', ' ', 'N', 'R', 'E', 'A', 'D',
- 'S', ' ', '=', ' ', 'o', 'u', 't', '_', 'n', 'r', 'e', 'a', 'd', 's', ';', 'r', 'e',
- 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'S', 'P', 'O', 'T',
- '_', 'L', 'E', 'N', ' ', '=', ' ', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ';', 'r',
- 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'F', 'I', 'X',
- 'E', 'D', '_', 'S', 'P', 'O', 'T', '_', 'L', 'E', 'N', ' ', '=', ' ', 'f', 'i', 'x',
- 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'T', 'R', 'I', 'M', '_', 'S',
- 'T', 'A', 'R', 'T', ' ', '=', ' ', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't',
- '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r',
- 'o', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', ')', ';', 'r', 'e', 'a',
- 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'T', 'R', 'I', 'M', '_',
- 'S', 'T', 'A', 'R', 'T', ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', ')', '<', 'I', '3', '2', '>', 's', 'u', 'm', '#',
- '1', '<', '1', '>', '(', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', ')', '|',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>',
- 'e', 'c', 'h', 'o', '#', '1', '<', '1', '>', '(', ')', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'T', 'R', 'I', 'M', '_', 'L', 'E',
- 'N', ' ', '=', ' ', 't', 'r', 'i', 'm', '_', 'l', 'e', 'n', '|', 's', 'p', 'o', 't',
- '_', 'l', 'e', 'n', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'a', 's', 'c', 'i', 'i',
- ' ', 'L', 'A', 'B', 'E', 'L', ' ', '=', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e',
- 'l', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'L', 'A', 'B', 'E', 'L', '_', 'S', 'T',
- 'A', 'R', 'T', ' ', '=', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's',
- 't', 'a', 'r', 't', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'L', 'A', 'B', 'E', 'L', '_',
- 'L', 'E', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 'l',
- 'e', 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'U', '1', '6', ' ', 'L', 'A', 'B', 'E', 'L', '_', 'S', 'T', 'A', 'R', 'T',
- ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'l', 'a', 'b',
- 'e', 'l', '_', 's', 't', 'a', 'r', 't', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l',
- 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'L', 'A', 'B', 'E',
- 'L', '_', 'L', 'E', 'N', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u',
- 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 'l', 'e', 'n', ')', ';', 'd', 'e', 'f', 'a',
- 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'R', 'E',
- 'A', 'D', '_', 'T', 'Y', 'P', 'E', ' ', '=', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a',
- 'd', '_', 't', 'y', 'p', 'e', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'R', 'E', 'A', 'D', '_', 'T', 'Y', 'P',
- 'E', ' ', '=', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e',
- '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd',
- '_', 't', 'y', 'p', 'e', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0',
- ',', '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ']', ',', '[',
- '0', ',', '1', ',', '0', ',', '1', ',', '0', ',', '1', ',', '0', ',', '1', ']', '>',
- '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', ';', 'd',
- 'e', 'f', 'a', 'u', 'l', 't', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'R', 'E', 'A',
- 'D', '_', 'S', 'T', 'A', 'R', 'T', ' ', '=', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a',
- 'd', '_', 's', 't', 'a', 'r', 't', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'R', 'E', 'A',
- 'D', '_', 'S', 'T', 'A', 'R', 'T', ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ')', '<', 'I', '3', '2', '>', 's', 'u',
- 'm', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's',
- 't', 'a', 'r', 't', ')', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'R', 'E', 'A', 'D', '_',
- 'L', 'E', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e',
- 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'U', '1', '6', ' ', 'R', 'E', 'A', 'D', '_', 'S', 'T', 'A', 'R', 'T', ' ', '=',
- ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_',
- 's', 't', 'a', 'r', 't', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'R', 'E', 'A', 'D', '_', 'L', 'E',
- 'N', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'r', 'e',
- 'a', 'd', '_', 'l', 'e', 'n', ')', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't',
- 'e', 'r', ' ', 'R', 'E', 'A', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ' ', '=', ' ',
- 'o', 'u', 't', '_', 'r', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '|', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't',
- 'e', 'r', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', 'o', 'u', 't', '_',
- 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ')', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', ' ', 'R',
- 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ' ', '=', ' ', 'o', 'u', 't', '_', 'r', 'd',
- '_', 'f', 'i', 'l', 't', 'e', 'r', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A',
- ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'i', 'n', '_', 'r', 'e',
- 'a', 'd', '_', 't', 'y', 'p', 'e', '=', 'R', 'E', 'A', 'D', '_', 'T', 'Y', 'P', 'E',
- '|', '_', 'a', 'l', 't', '_', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p',
- 'e', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n',
- ' ', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', '=', 'R', 'E', 'A', 'D',
- '_', 'L', 'E', 'N', '|', '_', 'a', 'l', 't', '_', 'i', 'n', '_', 'r', 'e', 'a', 'd',
- '_', 'l', 'e', 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'l', 'e', 'n', ' ', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', 'b', 'a', 's', 'e',
- '_', 's', 'p', 'a', 'c', 'e', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '|', 'c',
- 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 's', 'p', 'o', 't', '_', 'l',
- 'e', 'n', '|', 'a', 'l', 'i', 'g', 'n', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ',
- 'f', 'i', 'x', 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', 's', 't',
- 'a', 't', 'i', 'c', '_', 'f', 'i', 'x', 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l',
- 'e', 'n', '|', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_', 'f', 'i', 'x',
- 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '|', 'c', 'o', 'l', 'o', 'r',
- '_', 's', 'p', 'a', 'c', 'e', '_', 'f', 'i', 'x', 'e', 'd', '_', 's', 'p', 'o', 't',
- '_', 'l', 'e', 'n', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't', 's', '#', '1', '.',
- '1', '{', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd',
- '_', 't', ' ', 'M', 'I', 'N', '_', 'S', 'P', 'O', 'T', '_', 'I', 'D', ' ', '=', ' ',
- 'm', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'i', 'd', '|', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '1', '>', '(', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l',
- 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R',
- 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', ' ', 'M', 'A', 'X', '_', 'S', 'P',
- 'O', 'T', '_', 'I', 'D', ' ', '=', ' ', 'm', 'a', 'x', '_', 's', 'p', 'o', 't', '_',
- 'i', 'd', '|', 'c', 'a', 's', 't', '#', '1', '(', 's', 'p', 'o', 't', '_', 'c', 'o',
- 'u', 'n', 't', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'U', '6', '4', ' ', 'S', 'P', 'O', 'T', '_', 'C', 'O', 'U', 'N',
- 'T', ' ', '=', ' ', 's', 'p', 'o', 't', '_', 'c', 'o', 'u', 'n', 't', ';', 'r', 'e',
- 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '6', '4',
- ' ', 'B', 'A', 'S', 'E', '_', 'C', 'O', 'U', 'N', 'T', ' ', '=', ' ', 'b', 'a', 's',
- 'e', '_', 'c', 'o', 'u', 'n', 't', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '6', '4', ' ', 'B', 'I', 'O', '_', 'B', 'A',
- 'S', 'E', '_', 'C', 'O', 'U', 'N', 'T', ' ', '=', ' ', 'b', 'i', 'o', '_', 'b', 'a',
- 's', 'e', '_', 'c', 'o', 'u', 'n', 't', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '6', '4', ' ', 'C', 'M', 'P', '_', 'B',
- 'A', 'S', 'E', '_', 'C', 'O', 'U', 'N', 'T', ' ', '=', ' ', 'c', 'm', 'p', '_', 'b',
- 'a', 's', 'e', '_', 'c', 'o', 'u', 'n', 't', '|', 'b', 'a', 's', 'e', '_', 'c', 'o',
- 'u', 'n', 't', ';', 'U', '8', ' ', 's', 't', 'a', 't', 's', '_', 'd', 'u', 'm', 'm',
- 'y', '=', 'i', 'n', '_', 's', 't', 'a', 't', 's', '_', 'b', 'i', 'n', ';', '}', 't',
- 'a', 'b', 'l', 'e', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b',
- 'l', ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', '=', 'I', 'N', 'S', 'D', 'C',
- ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0',
- '.', '1', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':',
- 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', '#', '1', '.', '0', '.', '1', ',', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd',
- 'e', 's', 'c', '#', '1', '.', '0', '.', '2', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't', 's', '#', '1', '.', '1', '{',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'P', 'L', 'A', 'T', 'F',
- 'O', 'R', 'M', ' ', '=', ' ', '.', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '|', 'o',
- 'u', 't', '_', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ',
- 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', ' ', '=', ' ', 'p', 'l', 'a', 't', 'f', 'o',
- 'r', 'm', '_', 'n', 'a', 'm', 'e', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', ' ',
- 'S', 'P', 'O', 'T', '_', 'I', 'D', ' ', '=', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', '>', 'a', 'd', 'd', '_',
- 'r', 'o', 'w', '_', 'i', 'd', '#', '1', '(', '.', 'S', 'P', 'O', 'T', '_', 'I', 'D',
- ')', '|', 'c', 'a', 's', 't', '#', '1', '(', 'r', 'o', 'w', 'i', 'd', '_', '6', '4',
- ')', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'a', 's', 'c', 'i', 'i', ' ', 'S', 'P',
- 'O', 'T', '_', 'G', 'R', 'O', 'U', 'P', ' ', '=', ' ', 'o', 'u', 't', '_', 's', 'p',
- 'o', 't', '_', 'g', 'r', 'o', 'u', 'p', '|', '.', 'S', 'P', 'O', 'T', '_', 'G', 'R',
- 'O', 'U', 'P', '|', '<', 'a', 's', 'c', 'i', 'i', '>', 'e', 'c', 'h', 'o', '#', '1',
- '<', '\'', '\'', '>', '(', ')', ';', 'I', '6', '4', ' ', 'r', 'o', 'w', 'i', 'd',
- '_', '6', '4', '=', 'r', 'o', 'w', '_', 'i', 'd', '#', '1', '(', ')', ';', 'a', 's',
- 'c', 'i', 'i', ' ', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'g', 'r', 'o', 'u', 'p',
- '=', 'S', 'P', 'O', 'T', '_', 'G', 'R', 'O', 'U', 'P', ';', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', '>',
- 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'P',
- 'L', 'A', 'T', 'F', 'O', 'R', 'M', '=', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', ';',
- 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_',
- 't', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1',
- ' ', '.', 'S', 'P', 'O', 'T', '_', 'I', 'D', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', '>', 's', 'u', 'b', '_',
- 'r', 'o', 'w', '_', 'i', 'd', '#', '1', '(', 'S', 'P', 'O', 'T', '_', 'I', 'D', ')',
- ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- '<', 'a', 's', 'c', 'i', 'i', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', '#', '1', '<', '0', ',', '1', '>', ' ', '.', 'S', 'P', 'O', 'T', '_', 'G',
- 'R', 'O', 'U', 'P', '=', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'g', 'r', 'o', 'u',
- 'p', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{', 'U', '8', ' ',
- 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '_', 'd', 'u', 'm', 'm', 'y', '=',
- 'r', 'e', 'a', 'd', '_', 'u', 'n', 'p', 'a', 'c', 'k', '|', 'r', 'e', 'a', 'd', '_',
- 'n', 'd', 'e', 'c', 'o', 'd', 'e', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C',
- 'B', 'I', ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'l', 'o', 'c', '#', '1', '{', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', '<', 'a', 's', 'c', 'i', 'i', '>', 'z', 'i', 'p', '_',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', 'S', 'E', 'Q', '_', 'I', 'D',
- ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', '#', '1', ' ', 'S', 'E', 'Q', '_', 'S', 'T', 'A', 'R', 'T', ';',
- 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'S',
- 'E', 'Q', '_', 'S', 'T', 'A', 'R', 'T', ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'd', 'i', 'f', 'f', '#',
- '1', '<', '1', '>', '(', '.', 'S', 'E', 'Q', '_', 'S', 'T', 'A', 'R', 'T', ')', ';',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'l', 'e', 'n', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', '#', '1', ' ', 'S', 'E', 'Q', '_', 'L', 'E', 'N', ';', '}', 't', 'a',
- 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c', 'm', 'p',
- '_', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{', 'I', 'N', 'S',
- 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'd', 'c', 'm', 'p', '_',
- 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'p', 'r', 'o', 'd', 'u', 'c', 't', 'i', 'o',
- 'n', 's', '=', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '4', 'n', 'a', '_', 'b',
- 'i', 'n', '|', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', 'x', '2', 'n', 'a', '_',
- 'b', 'i', 'n', '|', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '2', 'n', 'a', '_',
- 'b', 'i', 'n', '|', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '2', 'n', 'a', '_',
- 'p', 'a', 'c', 'k', 'e', 'd', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_',
- 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', '=', 'I', 'N', 'S', 'D',
- 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.',
- '0', '.', '1', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', ',', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't',
- 's', '#', '1', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c',
- 'm', 'p', '_', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{', 'b',
- 'o', 'o', 'l', ' ', 'c', 's', '_', 'n', 'a', 't', 'i', 'v', 'e', '=', '<', 'b', 'o',
- 'o', 'l', '>', 'e', 'c', 'h', 'o', '#', '1', '<', 'f', 'a', 'l', 's', 'e', '>', '(',
- ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ',
- 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e', 'y', '=', '.', 'C', 'S', '_', 'K', 'E',
- 'Y', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't',
- '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'T', '\'', '>', '(', 'o', 'u', 't',
- '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', '|', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'e', 'c', 'h', 'o', '#', '1',
- '<', '\'', 'T', '\'', '>', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l',
- 'e', 'n', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'T', '\'', '>', '(', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'o', 'u',
- 't', '_', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c',
- 's', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',',
- '2', ',', '3', ',', '4', ']', ',', '[', '0', ',', '1', ',', '2', ',', '3', ',', '0',
- ']', '>', '(', 'o', 'u', 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't',
- '_', '2', 'n', 'a', '_', 'b', 'i', 'n', '=', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p',
- '_', '2', 'n', 'a', '_', 'b', 'i', 'n', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', '2',
- 'n', 'a', ':', 'b', 'i', 'n', ')', 'u', 'n', 'p', 'a', 'c', 'k', '#', '1', '(', 'o',
- 'u', 't', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_',
- 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '=', 'N', 'C', 'B', 'I', ':', 'c', 'o', 'l',
- 'o', 'r', '_', 'f', 'r', 'o', 'm', '_', 'd', 'n', 'a', '#', '1', '(', 'o', 'u', 't',
- '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ',', 'o', 'u', 't', '_', 'r', 'e', 'a',
- 'd', '_', 's', 't', 'a', 'r', 't', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_',
- 'l', 'e', 'n', ',', 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e', 'y', ',', 'o', 'u',
- 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o',
- 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '(', 'I', 'N',
- 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')', 'p', 'a',
- 'c', 'k', '#', '1', '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'b', 'i', 'n', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd',
- ' ', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '(',
- 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')',
- 'p', 'a', 'c', 'k', '#', '1', '(', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'b', 'i',
- 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e',
- 'x', 't', ' ', 'o', 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't',
- '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', '>',
- 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']',
- ',', '\'', '0', '1', '2', '3', '.', '\'', '>', '(', 'o', 'u', 't', '_', 'x', '2',
- 'c', 's', '_', 'b', 'i', 'n', ')', ';', 'U', '8', ' ', 'o', 'u', 't', '_', 'c', 'o',
- 'l', 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', '=', '<', 'U', '8', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ',', '1',
- ',', '0', ',', '3', ',', '2', ',', '4', ',', '2', ',', '3', ',', '0', ',', '1', ',',
- '4', ',', '3', ',', '2', ',', '1', ',', '0', ',', '4', ',', '4', ',', '4', ',', '4',
- ',', '4', ',', '4', ']', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c',
- 'e', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', 'r', 'o', 'w', '_', 'l', 'e',
- 'n', '#', '1', '(', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e',
- 'd', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e',
- 'n', ' ', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_', 'f', 'i', 'x', 'e',
- 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', 'f', 'i', 'x', 'e', 'd', '_',
- 'r', 'o', 'w', '_', 'l', 'e', 'n', '#', '1', '(', 'o', 'u', 't', '_', '2', 'n', 'a',
- '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N',
- 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c',
- 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '3', '=', 'N', 'C', 'B',
- 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_',
- 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1',
- '{', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o',
- 'u', 't', '_', 'd', 'n', 'a', '_', 't', 'e', 'x', 't', '=', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':',
- 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0',
- ',', '1', ',', '2', ',', '3', ',', '4', ']', ',', '\'', 'A', 'C', 'G', 'T', 'N',
- '\'', '>', '(', 'o', 'u', 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u',
- 't', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n',
- 'a', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',',
- '2', ',', '3', ',', '4', ']', ',', '[', '1', ',', '2', ',', '4', ',', '8', ',', '1',
- '5', ']', '>', '(', 'o', 'u', 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o',
- 'u', 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', '=', '(', 'I', 'N', 'S', 'D',
- 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ')', 'r', 'e', 'a', 'd', '_', 'n',
- 'd', 'e', 'c', 'o', 'd', 'e', ';', 'U', '8', ' ', 'r', 'e', 'a', 'd', '_', 'u', 'n',
- 'p', 'a', 'c', 'k', '=', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ';',
- '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b',
- 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '.', '0', '.', '3', '=', 'N',
- 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c',
- 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '3', '{', 'I', 'N', 'S',
- 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't',
- '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '.', 'R', 'E', 'A', 'D',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '#', '2', '.', '0', '.', '3', '=',
- 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a',
- 'c', 'e', '_', 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', ',', 'N',
- 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c', 'm', 'p', '_', 'b', 'a', 's', 'e',
- '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', ' ', 'i', 'n', '_', 'd', 'n', 'a', '_', 't', 'e', 'x',
- 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't',
- ',', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm',
- 'a', 'p', '#', '1', '<', '\'', '.', 'a', 'c', 'm', 'g', 'r', 's', 'v', 't', 'w',
- 'y', 'h', 'k', 'd', 'b', 'n', '\'', ',', '\'', 'N', 'A', 'C', 'M', 'G', 'R', 'S',
- 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N', '\'', '>', '(', 'R', 'E', 'A', 'D',
- ')', ';', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'i',
- 'n', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- '4', 'n', 'a', ':', 'b', 'i', 'n', '>', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l',
- 'i', 'd', 'a', 't', 'e', '#', '1', '<', '0', ',', '1', '5', '>', '(', 'R', 'E', 'A',
- 'D', ')', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n',
- ')', 'u', 'n', 'p', 'a', 'c', 'k', '#', '1', '(', 'i', 'n', '_', '4', 'n', 'a', '_',
- 'p', 'a', 'c', 'k', 'e', 'd', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':',
- 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '\'', '.', 'A', 'C', 'M', 'G',
- 'R', 'S', 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N', '\'', ',', '[', '0', ',',
- '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9',
- ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1',
- '5', ']', '>', '(', 'i', 'n', '_', 'd', 'n', 'a', '_', 't', 'e', 'x', 't', ')', '|',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I',
- 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#',
- '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']', ',', '[', '1', ',',
- '2', ',', '4', ',', '8', ',', '1', '5', ']', '>', '(', 'i', 'n', '_', 'x', '2', 'n',
- 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':',
- 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'i', 'n', '_', '4', 'n', 'a', '_', 'p', 'a', 'c',
- 'k', 'e', 'd', '=', 'R', 'E', 'A', 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2',
- 'n', 'a', ':', 'b', 'i', 'n', ' ', 'i', 'n', '_', 'x', '2', 'n', 'a', '_', 'b', 'i',
- 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n',
- '>', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '#', '1',
- '<', '0', ',', '4', '>', '(', 'R', 'E', 'A', 'D', ')', '|', '<', 'I', 'N', 'S', 'D',
- 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'x',
- '2', 'n', 'a', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',',
- '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9',
- ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1',
- '5', ']', ',', '[', '4', ',', '0', ',', '1', ',', '4', ',', '2', ',', '4', ',', '4',
- ',', '4', ',', '3', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ',',
- '4', ']', '>', '(', 'i', 'n', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'i', 'n', '_', '2',
- 'n', 'a', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a',
- ':', 'b', 'i', 'n', '>', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a',
- 't', 'e', '#', '1', '<', '0', ',', '3', '>', '(', 'R', 'E', 'A', 'D', ')', '|', '(',
- 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ')', 'u', 'n', 'p',
- 'a', 'c', 'k', '#', '1', '(', 'i', 'n', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k',
- 'e', 'd', ')', '|', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'E', 'Q', ':', 'r', 'a', 'n',
- 'd', '_', '4', 'n', 'a', '_', '2', 'n', 'a', '#', '1', '(', 'i', 'n', '_', '4', 'n',
- 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':',
- 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'i', 'n', '_', '2', 'n', 'a', '_', 'p', 'a', 'c',
- 'k', 'e', 'd', '=', 'R', 'E', 'A', 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n',
- 'a', ':', 'b', 'i', 'n', ' ', 'i', 'n', '_', 'a', 'l', 't', '_', '4', 'n', 'a', '_',
- 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i',
- 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', '>', 'm',
- 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ',', '5',
- ',', '6', ',', '7', ',', '8', ',', '9', ',', '1', '0', ',', '1', '1', ',', '1', '2',
- ',', '1', '3', ',', '1', '4', ',', '1', '5', ']', ',', '[', '1', '5', ',', '0', ',',
- '0', ',', '3', ',', '0', ',', '5', ',', '6', ',', '7', ',', '0', ',', '9', ',', '1',
- '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ']',
- '>', '(', 'i', 'n', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'U', '8', ' ',
- 'i', 'n', '_', 's', 't', 'a', 't', 's', '_', 'b', 'i', 'n', '=', 'i', 'n', '_', '2',
- 'n', 'a', '_', 'b', 'i', 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':',
- 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'p', 'a',
- 'c', 'k', 'e', 'd', '=', '.', 'R', 'E', 'A', 'D', '|', 'o', 'u', 't', '_', 'd', 'c',
- 'm', 'p', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', ';', 'I', 'N', 'S',
- 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', 'x',
- '2', 'n', 'a', '_', 'b', 'i', 'n', '=', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_',
- 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', '4',
- 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a',
- ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2',
- ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8', ',', '9', ',', '1', '0',
- ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ']', ',',
- '[', '4', ',', '0', ',', '1', ',', '4', ',', '2', ',', '4', ',', '4', ',', '4', ',',
- '3', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ']', '>',
- '(', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S',
- 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', '2', 'n',
- 'a', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- '2', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a',
- ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2',
- ',', '3', ']', ',', '[', '1', ',', '2', ',', '4', ',', '8', ']', '>', '(', 'o', 'u',
- 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'b',
- 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n',
- '>', 'b', 'i', 't', '_', 'o', 'r', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_',
- '2', 'n', 'a', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', ',', '.', 'A', 'L', 'T', 'R',
- 'E', 'A', 'D', ')', '|', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '4', 'n', 'a',
- '_', 'b', 'i', 'n', '|', 'o', 'u', 't', '_', '2', 'n', 'a', '_', '4', 'n', 'a', '_',
- 'b', 'i', 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x',
- 't', ' ', 'o', 'u', 't', '_', 'd', 'n', 'a', '_', 't', 'e', 'x', 't', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<',
- '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',',
- '8', ',', '9', ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1',
- '4', ',', '1', '5', ']', ',', '\'', '.', 'A', 'C', 'M', 'G', 'R', 'S', 'V', 'T',
- 'W', 'Y', 'H', 'K', 'D', 'B', 'N', '\'', '>', '(', 'o', 'u', 't', '_', '4', 'n',
- 'a', '_', 'b', 'i', 'n', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p',
- 'a', 'c', 'k', 'e', 'd', ' ', '.', 'R', 'E', 'A', 'D', '=', 'i', 'n', '_', '2', 'n',
- 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', '2',
- 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')', 'p', 'a', 'c', 'k', '#', '1', '(',
- 'i', 'n', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C',
- ':', '4', 'n', 'a', ':', 'b', 'i', 'n', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'A', 'L', 'T', 'R', 'E', 'A', 'D', '=', '<',
- 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', '>', 't', 'r', 'i',
- 'm', '#', '1', '<', '0', ',', '0', '>', '(', 'i', 'n', '_', 'a', 'l', 't', '_', '4',
- 'n', 'a', '_', 'b', 'i', 'n', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C',
- 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c', 'm', 'p', '_', 'c', 'o', 'l', 'o', 'r',
- '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', ' ', 'd', 'c', 'm', 'p', '_', 'v', 'i', 'r', 't', 'u',
- 'a', 'l', '_', 'p', 'r', 'o', 'd', 'u', 'c', 't', 'i', 'o', 'n', 's', '=', 'o', 'u',
- 't', '_', 'd', 'c', 'm', 'p', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '|', 'o',
- 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '2', 'c', 's', '_', 'b', 'i', 'n', '|', 'o',
- 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e',
- 'd', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 'c', 'o', 'm', 'm',
- 'o', 'n', '#', '1', '.', '0', '.', '3', '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b',
- 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.', '1', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o',
- 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', ',', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't', 's', '#', '1', '.',
- '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c', 'm', 'p', '_', 'c',
- 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{', 'b', 'o', 'o', 'l',
- ' ', 'c', 's', '_', 'n', 'a', 't', 'i', 'v', 'e', '=', '<', 'b', 'o', 'o', 'l', '>',
- 'e', 'c', 'h', 'o', '#', '1', '<', 't', 'r', 'u', 'e', '>', '(', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', '2',
- 'c', 's', '_', 'b', 'i', 'n', '=', 'o', 'u', 't', '_', 'd', 'c', 'm', 'p', '_', '2',
- 'c', 's', '_', 'b', 'i', 'n', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's',
- ':', 'b', 'i', 'n', ')', 'u', 'n', 'p', 'a', 'c', 'k', '#', '1', '(', 'o', 'u', 't',
- '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', '2', 'n', 'a',
- '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':',
- 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'b', 'i', 'n',
- '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4',
- ']', ',', '[', '0', ',', '1', ',', '2', ',', '3', ',', '0', ']', '>', '(', 'o', 'u',
- 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', '4', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', '4', 'n', 'a', '_',
- 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b',
- 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '4', 'n', 'a', ':', 'b', 'i', 'n', '>',
- 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']',
- ',', '[', '1', ',', '2', ',', '4', ',', '8', ',', '1', '5', ']', '>', '(', 'o', 'u',
- 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u', 't', '_', 'd', 'n', 'a',
- '_', 't', 'e', 'x', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a',
- ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3',
- ',', '4', ']', ',', '\'', 'A', 'C', 'G', 'T', 'N', '\'', '>', '(', 'o', 'u', 't',
- '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', 'x', '2', 'n', 'a',
- '_', 'b', 'i', 'n', '=', 'N', 'C', 'B', 'I', ':', 'd', 'n', 'a', '_', 'f', 'r', 'o',
- 'm', '_', 'c', 'o', 'l', 'o', 'r', '#', '1', '(', 'o', 'u', 't', '_', 'x', '2', 'c',
- 's', '_', 'b', 'i', 'n', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't',
- 'a', 'r', 't', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',',
- 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e', 'y', ',', 'o', 'u', 't', '_', 'c', 'o',
- 'l', 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't', '_', '2',
- 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':',
- '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')', 'p', 'a', 'c', 'k', '#', '1',
- '(', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S',
- 'D', 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't',
- '_', '4', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '(', 'I', 'N', 'S', 'D',
- 'C', ':', '4', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')', 'p', 'a', 'c', 'k',
- '#', '1', '(', 'o', 'u', 't', '_', '4', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', ' ', 'o',
- 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#',
- '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']', ',', '\'', '0',
- '1', '2', '3', '.', '\'', '>', '(', 'o', 'u', 't', '_', 'x', '2', 'c', 's', '_',
- 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'l', 'e', 'n', ' ', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 's',
- 'p', 'o', 't', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', 'r', 'o', 'w', '_', 'l', 'e', 'n', '#', '1',
- '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'c',
- 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 'f', 'i', 'x', 'e', 'd', '_',
- 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', 'f', 'i', 'x', 'e', 'd', '_', 'r', 'o',
- 'w', '_', 'l', 'e', 'n', '#', '1', '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p',
- 'a', 'c', 'k', 'e', 'd', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e',
- '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '3', '=', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_',
- 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1',
- '{', 'U', '8', ' ', 'o', 'u', 't', '_', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a', 't',
- 'r', 'i', 'x', '=', '<', 'U', '8', '>', 'm', 'e', 't', 'a', ':', 'r', 'e', 'a', 'd',
- '#', '1', '<', '\'', 'C', 'O', 'L', 'O', 'R', '_', 'M', 'A', 'T', 'R', 'I', 'X',
- '\'', '>', '(', ')', '|', '<', 'U', '8', '>', 'e', 'c', 'h', 'o', '#', '1', '<',
- '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ',', '1', ',', '0', ',', '3', ',',
- '2', ',', '4', ',', '2', ',', '3', ',', '0', ',', '1', ',', '4', ',', '3', ',', '2',
- ',', '1', ',', '0', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ',', '4', ']',
- '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i',
- 'n', ' ', 'o', 'u', 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '(', 'I',
- 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ')', 'r', 'e', 'a',
- 'd', '_', 'n', 'd', 'e', 'c', 'o', 'd', 'e', ';', 'U', '8', ' ', 'r', 'e', 'a', 'd',
- '_', 'u', 'n', 'p', 'a', 'c', 'k', '=', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'b',
- 'i', 'n', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b',
- 'l', ':', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '.', '0',
- '.', '3', '=', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o', 'r',
- '_', 's', 'p', 'a', 'c', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.',
- '3', '{', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ',
- 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e', 'y', '=', '.', 'C', 'S', '_', 'K', 'E',
- 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e',
- 'd', ' ', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=',
- '.', 'C', 'S', 'R', 'E', 'A', 'D', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C',
- 'B', 'I', ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c',
- 'e', '#', '2', '.', '1', '=', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'c', 'o',
- 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 'c', 'o', 'm', 'm', 'o', 'n', '#',
- '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'd', 'c',
- 'm', 'p', '_', 'c', 'o', 'l', 'o', 'r', '_', 's', 'p', 'a', 'c', 'e', '#', '1', '{',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', ' ',
- 'i', 'n', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't', '=', 'C', 'S', 'R',
- 'E', 'A', 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i',
- 'n', ' ', 'i', 'n', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', '>', 'r', 'a', 'n', 'g',
- 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '#', '1', '<', '0', ',', '4', '>',
- '(', 'C', 'S', 'R', 'E', 'A', 'D', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'l', 'o', 'r', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'x',
- '2', 'c', 's', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '\'', '0',
- '1', '2', '3', '.', '\'', ',', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4',
- ']', '>', '(', 'i', 'n', '_', 'c', 'o', 'l', 'o', 'r', '_', 't', 'e', 'x', 't', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'i', 'n',
- '_', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', '2',
- 'c', 's', ':', 'b', 'i', 'n', '>', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l', 'i',
- 'd', 'a', 't', 'e', '#', '1', '<', '0', ',', '3', '>', '(', 'C', 'S', 'R', 'E', 'A',
- 'D', ')', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':', 'b', 'i', 'n',
- ')', 'u', 'n', 'p', 'a', 'c', 'k', '#', '1', '(', 'i', 'n', '_', '2', 'c', 's', '_',
- 'p', 'a', 'c', 'k', 'e', 'd', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2',
- 'c', 's', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':',
- 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',',
- '3', ',', '4', ']', ',', '[', '0', ',', '1', ',', '2', ',', '3', ',', '0', ']', '>',
- '(', 'i', 'n', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';', 'I', 'N', 'S',
- 'D', 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'i', 'n', '_',
- '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', 'C', 'S', 'R', 'E', 'A', 'D',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'i',
- 'n', '_', 'a', 'l', 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ',', 'I', 'N', 'S',
- 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1',
- '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ']', ',', '[', '0', ',', '0',
- ',', '0', ',', '0', ',', '4', ']', '>', '(', 'i', 'n', '_', 'x', '2', 'c', 's', '_',
- 'b', 'i', 'n', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', ' ', 'i', 'n', '_', 'c', 's', '_', 'k', 'e', 'y', '=', '<', 'I', 'N', 'S',
- 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<', '\'',
- 'a', 'c', 'g', 't', '\'', ',', '\'', 'A', 'C', 'G', 'T', '\'', '>', '(', 'C', 'S',
- '_', 'K', 'E', 'Y', ')', ';', 'U', '8', ' ', 'i', 'n', '_', 'c', 'o', 'l', 'o', 'r',
- '_', 'm', 'a', 't', 'r', 'i', 'x', '=', '<', 'U', '8', '>', 'r', 'a', 'n', 'g', 'e',
- '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '#', '1', '<', '0', ',', '4', '>', '(',
- 'C', 'O', 'L', 'O', 'R', '_', 'M', 'A', 'T', 'R', 'I', 'X', ')', ';', 'U', '8', ' ',
- 'i', 'n', '_', 's', 't', 'a', 't', 's', '_', 'b', 'i', 'n', '=', 'i', 'n', '_', '2',
- 'c', 's', '_', 'b', 'i', 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':',
- 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a',
- 'c', 'k', 'e', 'd', '=', '.', 'C', 'S', 'R', 'E', 'A', 'D', '|', 'o', 'u', 't', '_',
- 'd', 'c', 'm', 'p', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ' ', 'o', 'u', 't',
- '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':',
- 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ')', '<', 'U', '8', '>', 'b', 'i', 't', '_',
- 'o', 'r', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'b',
- 'i', 'n', ',', '.', 'A', 'L', 'T', 'C', 'S', 'R', 'E', 'A', 'D', ')', '|', 'o', 'u',
- 't', '_', 'd', 'c', 'm', 'p', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', '|', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', ')', 'o', 'u',
- 't', '_', '2', 'c', 's', '_', 'b', 'i', 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd',
- 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u', 't', '_', 'c', 's', '_', 'k', 'e',
- 'y', '=', '.', 'C', 'S', '_', 'K', 'E', 'Y', ';', 'U', '8', ' ', 'o', 'u', 't', '_',
- 'c', 'o', 'l', 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', '=', '.', 'C', 'O', 'L',
- 'O', 'R', '_', 'M', 'A', 'T', 'R', 'I', 'X', '|', '<', 'U', '8', '>', 'e', 'c', 'h',
- 'o', '#', '1', '<', '[', '0', ',', '1', ',', '2', ',', '3', ',', '4', ',', '1', ',',
- '0', ',', '3', ',', '2', ',', '4', ',', '2', ',', '3', ',', '0', ',', '1', ',', '4',
- ',', '3', ',', '2', ',', '1', ',', '0', ',', '4', ',', '4', ',', '4', ',', '4', ',',
- '4', ',', '4', ']', '>', '(', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', '2', 'c', 's', ':',
- 'p', 'a', 'c', 'k', 'e', 'd', ' ', '.', 'C', 'S', 'R', 'E', 'A', 'D', '=', 'i', 'n',
- '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', '|', '(', 'I', 'N', 'S', 'D',
- 'C', ':', '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ')', 'p', 'a', 'c', 'k',
- '#', '1', '(', 'i', 'n', '_', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';', 'p', 'h',
- 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':', 'b', 'i', 'n', '>', 'z', 'i', 'p', '_',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'A', 'L', 'T', 'C', 'S',
- 'R', 'E', 'A', 'D', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'c', 's', ':',
- 'b', 'i', 'n', '>', 't', 'r', 'i', 'm', '#', '1', '<', '0', ',', '0', '>', '(', 'i',
- 'n', '_', 'a', 'l', 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'z', 'i', 'p',
- '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'S', '_', 'K',
- 'E', 'Y', '=', 'i', 'n', '_', 'c', 's', '_', 'k', 'e', 'y', ';', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'U', '8', '>', 'z',
- 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'O',
- 'L', 'O', 'R', '_', 'M', 'A', 'T', 'R', 'I', 'X', '=', 'i', 'n', '_', 'c', 'o', 'l',
- 'o', 'r', '_', 'm', 'a', 't', 'r', 'i', 'x', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', '#',
- '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l', ':', 'p', 'r', 'o', 't', 'e',
- 'i', 'n', '#', '1', '{', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i',
- 'n', ':', 't', 'e', 'x', 't', ' ', 'i', 'n', '_', 'p', 'r', 'o', 't', 'e', 'i', 'n',
- '_', 't', 'e', 'x', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't',
- 'e', 'i', 'n', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r',
- 'o', 't', 'e', 'i', 'n', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<',
- '\'', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'p', 'q',
- 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'u', '\'', ',', '\'', 'A', 'B', 'C', 'D',
- 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X',
- 'Y', 'Z', 'U', '\'', '>', '(', 'P', 'R', 'O', 'T', 'E', 'I', 'N', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ' ', 'i', 'n', '_', 'a', 'a',
- '_', 'b', 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i',
- 'n', '>', 'r', 'a', 'n', 'g', 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '#',
- '1', '<', '1', ',', '2', '5', '>', '(', 'P', 'R', 'O', 'T', 'E', 'I', 'N', ')', '|',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't', 'e',
- 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', '>', 'm',
- 'a', 'p', '#', '1', '<', '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K',
- 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'U', '*', '\'',
- ',', '[', '1', ',', '2', ',', '3', ',', '4', ',', '5', ',', '6', ',', '7', ',', '8',
- ',', '9', ',', '1', '0', ',', '1', '1', ',', '1', '2', ',', '1', '3', ',', '1', '4',
- ',', '1', '5', ',', '1', '6', ',', '1', '7', ',', '1', '8', ',', '1', '9', ',', '2',
- '0', ',', '2', '1', ',', '2', '2', ',', '2', '3', ',', '2', '4', ',', '2', '5', ']',
- '>', '(', 'i', 'n', '_', 'p', 'r', 'o', 't', 'e', 'i', 'n', '_', 't', 'e', 'x', 't',
- ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ' ', 'o', 'u',
- 't', '_', 'a', 'a', '_', 'b', 'i', 'n', '=', '.', 'P', 'R', 'O', 'T', 'E', 'I', 'N',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't', 'e',
- 'x', 't', ' ', 'o', 'u', 't', '_', 'p', 'r', 'o', 't', 'e', 'i', 'n', '_', 't', 'e',
- 'x', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', ',',
- 'I', 'N', 'S', 'D', 'C', ':', 'p', 'r', 'o', 't', 'e', 'i', 'n', ':', 't', 'e', 'x',
- 't', '>', 'm', 'a', 'p', '#', '1', '<', '[', '1', ',', '2', ',', '3', ',', '4', ',',
- '5', ',', '6', ',', '7', ',', '8', ',', '9', ',', '1', '0', ',', '1', '1', ',', '1',
- '2', ',', '1', '3', ',', '1', '4', ',', '1', '5', ',', '1', '6', ',', '1', '7', ',',
- '1', '8', ',', '1', '9', ',', '2', '0', ',', '2', '1', ',', '2', '2', ',', '2', '3',
- ',', '2', '4', ',', '2', '5', ']', ',', '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
- 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'U',
- '*', '\'', '>', '(', 'o', 'u', 't', '_', 'a', 'a', '_', 'b', 'i', 'n', ')', ';',
- 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'a', 'a', ':', 'b', 'i', 'n', '>', 'z', 'i', 'p', '_',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'P', 'R', 'O', 'T', 'E',
- 'I', 'N', '=', 'i', 'n', '_', 'a', 'a', '_', 'b', 'i', 'n', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd',
- '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.',
- '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q',
- 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':',
- 't', 'b', 'l', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{',
- 'U', '8', ' ', 'r', 'e', 'a', 'd', '_', 'n', 'd', 'e', 'c', 'o', 'd', 'e', '=', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r',
- 'e', 'd', ',', 'U', '8', '>', 'm', 'a', 'p', '#', '1', '<', '0', ',', '4', '>', '(',
- 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', ',', 'r', 'e',
- 'a', 'd', '_', 'u', 'n', 'p', 'a', 'c', 'k', ')', ';', '}', 't', 'a', 'b', 'l', 'e',
- ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q',
- 'u', 'a', 'l', 'i', 't', 'y', '#', '1', '.', '0', '.', '1', '=', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', '{', 'N', 'C', 'B',
- 'I', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd',
- 'e', 'd', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l',
- '_', 'p', 'h', 'r', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', '}',
- 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h',
- 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '#', '2', '.', '0', '.', '4',
- '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n',
- 'c', 'e', '#', '1', '.', '0', '.', '1', '{', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q',
- 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T',
- 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't',
- 'e', 'x', 't', ':', 'p', 'h', 'r', 'e', 'd', '_', '3', '3', ' ', 'i', 'n', '_', 'q',
- 'u', 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'p', 'h', 'r', 'e', 'd', '_', '3', '3',
- '=', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':', 'p', 'h', 'r', 'e', 'd', '_',
- '6', '4', ' ', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'p',
- 'h', 'r', 'e', 'd', '_', '6', '4', '=', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e',
- 'd', ' ', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', 'Q',
- 'U', 'A', 'L', 'I', 'T', 'Y', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ')', '<', 'B', '8', '>', 'd', 'i',
- 'f', 'f', '#', '1', '<', '3', '3', '>', '(', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_',
- 't', 'e', 'x', 't', '_', 'p', 'h', 'r', 'e', 'd', '_', '3', '3', ')', '|', '(', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e',
- 'd', ')', '<', 'B', '8', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '6', '4', '>', '(',
- 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'p', 'h', 'r', 'e',
- 'd', '_', '6', '4', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i',
- 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'i', 'n', '_', 's', 't', 'a', 't', 's',
- '_', 'q', 'u', 'a', 'l', '=', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r',
- 'e', 'd', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':',
- 'p', 'h', 'r', 'e', 'd', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n',
- 'g', '#', '1', ' ', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '=', 'i', 'n', '_', 'q',
- 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's',
- '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.',
- '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q',
- 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':',
- 't', 'b', 'l', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', '{',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', ';', 'U', '8', ' ', 'r', 'e', 'a', 'd', '_', 'n', 'd',
- 'e', 'c', 'o', 'd', 'e', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ',', 'U', '8', '>', 'm',
- 'a', 'p', '#', '1', '<', '-', '6', ',', '4', '>', '(', 'o', 'u', 't', '_', 'q', 'u',
- 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ',', 'r', 'e', 'a', 'd', '_',
- 'u', 'n', 'p', 'a', 'c', 'k', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u',
- 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l',
- '2', '_', 'p', 'h', 'r', 'e', 'd', '|', 'N', 'C', 'B', 'I', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', '_', 't', 'o', '_', 'p', 'h', 'r', 'e', 'd', '#', '1', '(', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ')',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '#',
- '1', '.', '0', '.', '1', '=', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o',
- 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', '{', 'N', 'C', 'B', 'I', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 'n', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'd', ':', 'l',
- 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_',
- 'n', 'o', 'c', 'o', 'l', '#', '2', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C',
- ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0',
- '.', '1', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q',
- 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'Q',
- 'U', 'A', 'L', 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l',
- '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q',
- 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_',
- 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', 'N', 'C', 'B', 'I', ':', 'l',
- 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 't', 'o', '_', 'p', 'h', 'r', 'e', 'd', '#',
- '1', '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd',
- 'd', 's', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 't',
- 'b', 'l', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i',
- 't', 'y', '#', '2', '.', '0', '.', '4', '=', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y',
- '_', 'n', 'o', 'c', 'o', 'l', '#', '2', '.', '0', '.', '1', '{', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':',
- 't', 'e', 'x', 't', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', '6', '4', ' ',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a',
- 'l', '_', 't', 'e', 'x', 't', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', '6',
- '4', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':',
- 't', 'e', 'x', 't', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', '6', '4', ')',
- '<', 'B', '8', '>', 's', 'u', 'm', '#', '1', '<', '6', '4', '>', '(', 'o', 'u', 't',
- '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g',
- '_', 'o', 'd', 'd', 's', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 't', 'e', 'x', 't', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', '6', '4', ' ', 'i', 'n', '_', 'q', 'u',
- 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_',
- '6', '4', '=', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ',
- 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '=',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ')', '<', 'B',
- '8', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '6', '4', '>', '(', 'i', 'n', '_', 'q',
- 'u', 'a', 'l', '_', 't', 'e', 'x', 't', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's',
- '_', '6', '4', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'i', 'n', '_', 's', 't', 'a',
- 't', 's', '_', 'q', 'u', 'a', 'l', '=', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 'l',
- 'o', 'g', '_', 'o', 'd', 'd', 's', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a',
- 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '>', 'z', 'i', 'p',
- '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', '=', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g', '_', 'o',
- 'd', 'd', 's', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'c', 'o', 'o', 'r', 'd', '#',
- '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'p', 'o', 't', 'c', 'o', 'o', 'r', 'd', '#', '1', '{', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'x', '_', 'c',
- 'o', 'o', 'r', 'd', '=', '.', 'X', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'y', '_', 'c', 'o', 'o', 'r',
- 'd', '=', '.', 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 't', '_', 'c', 'o', 'o', 'r', 'd', '=', '.',
- 'T', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l',
- ' ', 'o', 'u', 't', '_', 'l', '_', 'c', 'o', 'o', 'r', 'd', '=', '.', 'L', ';', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', '>', 'i', 'z',
- 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'X', '=',
- 'i', 'n', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', '|', 'i', 'n', '_', 'n', 'a', 'm',
- 'e', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a',
- 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c',
- 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'Y', '=', 'i', 'n', '_', 'y', '_', 'c',
- 'o', 'o', 'r', 'd', '|', 'i', 'n', '_', 'n', 'a', 'm', 'e', '_', 'y', '_', 'c', 'o',
- 'o', 'r', 'd', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v',
- 'a', 'l', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#',
- '1', ' ', '.', 'T', '=', 'i', 'n', '_', 't', '_', 'c', 'o', 'o', 'r', 'd', '|', 'i',
- 'n', '_', 'n', 'a', 'm', 'e', '_', 't', '_', 'c', 'o', 'o', 'r', 'd', ';', 'p', 'h',
- 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', '>', 'i', 'z', 'i',
- 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'L', '=', 'i',
- 'n', '_', 'l', '_', 'c', 'o', 'o', 'r', 'd', '|', 'i', 'n', '_', 'n', 'a', 'm', 'e',
- '_', 'l', '_', 'c', 'o', 'o', 'r', 'd', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'k', 'e', 'y', 'n',
- 'a', 'm', 'e', '#', '1', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', '#', '1',
- '.', '0', '.', '1', '{', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 's', 'k',
- 'e', 'y', '=', '(', 'a', 's', 'c', 'i', 'i', ')', 'i', 'd', 'x', ':', 't', 'e', 'x',
- 't', ':', 'p', 'r', 'o', 'j', 'e', 'c', 't', '#', '1', '<', '\'', 's', 'k', 'e',
- 'y', '\'', '>', '(', ')', ';', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_',
- 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '=', 'r', 'e', 'w', 'r', 'i', 't', 't',
- 'e', 'n', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '|', 'o', 'u', 't', '_',
- 's', 'k', 'e', 'y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p',
- 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', ' ', 's', 'p', 'o', 't',
- '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u',
- 'n', 'd', ')', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'l', 'o', 'o', 'k', 'u',
- 'p', '#', '1', '<', '\'', 's', 'k', 'e', 'y', '\'', ',', '\'', 'Q', 'U', 'E', 'R',
- 'Y', '_', 'B', 'Y', '_', 'N', 'A', 'M', 'E', '\'', ',', '1', '>', '(', 'o', 'u',
- 't', '_', 's', 'l', 'x', '_', 'p', 'r', 'e', 'f', 'i', 'x', ')', '|', '(', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_',
- 'f', 'o', 'u', 'n', 'd', ')', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'l', 'o',
- 'o', 'k', 'u', 'p', '#', '1', '<', '\'', 's', 'k', 'e', 'y', '\'', ',', '\'', 'Q',
- 'U', 'E', 'R', 'Y', '_', 'B', 'Y', '_', 'N', 'A', 'M', 'E', '\'', ',', '0', '>',
- '(', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 't', 'b', 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '_', 'n', 'o',
- 'c', 'o', 'l', '#', '2', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', '#', '1',
- '.', '0', '.', '1', '{', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 'n', 'a',
- 'm', 'e', '_', 'f', 'm', 't', '=', '(', 'a', 's', 'c', 'i', 'i', ')', 'i', 'd', 'x',
- ':', 't', 'e', 'x', 't', ':', 'p', 'r', 'o', 'j', 'e', 'c', 't', '#', '1', '<', '\'',
- 's', 'k', 'e', 'y', '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd',
- ' ', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', '=', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd',
- 's', '_', 'f', 'o', 'u', 'n', 'd', ')', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'l', 'o', 'o', 'k', 'u', 'p', '#', '1', '<', '\'', 's', 'k', 'e', 'y', '\'', ',',
- '\'', 'Q', 'U', 'E', 'R', 'Y', '_', 'B', 'Y', '_', 'N', 'A', 'M', 'E', '\'', ',',
- '2', '>', '(', 'o', 'u', 't', '_', 's', 'l', 'x', '_', 'p', 'r', 'e', 'f', 'i', 'x',
- ')', '|', '(', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't',
- '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', ')', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'l', 'o', 'o', 'k', 'u', 'p', '#', '1', '<', '\'', 's', 'k', 'e',
- 'y', '\'', ',', '\'', 'Q', 'U', 'E', 'R', 'Y', '_', 'B', 'Y', '_', 'N', 'A', 'M',
- 'E', '\'', ',', '2', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o',
- 'r', 'd', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'X', ')', ';', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_',
- 'y', '_', 'c', 'o', 'o', 'r', 'd', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'Y',
- ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 't', 'b', 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '#', '2', '.', '0',
- '.', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'k', 'e', 'y', 'n', 'a', 'm', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '2', '.', '0',
- '.', '1', '{', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a',
- 'l', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1',
- ' ', '.', 'X', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r',
- 'a', 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<',
- '4', '>', '(', 'N', 'A', 'M', 'E', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'n',
- 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'Y', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o',
- 'o', 'r', 'd', '#', '1', '<', '5', '>', '(', 'N', 'A', 'M', 'E', ',', 'i', 'n', '_',
- 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', '}', 't',
- 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '#', '3', '.', '0', '.', '1', '=', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't',
- 'n', 'a', 'm', 'e', '#', '1', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'c', 'o', 'o', 'r', 'd', '#',
- '1', '{', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '=', '.', 'S', 'P', 'O', 'T', '_', 'N', 'A', 'M', 'E', ';', 'a',
- 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', '_', 'f', 'm', 't',
- '=', '(', 'a', 's', 'c', 'i', 'i', ')', 'i', 'd', 'x', ':', 't', 'e', 'x', 't', ':',
- 'p', 'r', 'o', 'j', 'e', 'c', 't', '#', '1', '<', '\'', 's', 'k', 'e', 'y', '\'',
- '>', '(', '.', 'N', 'A', 'M', 'E', '_', 'F', 'M', 'T', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o',
- 'u', 'n', 'd', ' ', 's', 'p', 'o', 't', '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n',
- 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't',
- '_', 'i', 'd', 's', '_', 'f', 'o', 'u', 'n', 'd', ')', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'l', 'o', 'o', 'k', 'u', 'p', '#', '1', '<', '\'', 's', 'k', 'e',
- 'y', '\'', ',', '\'', 'Q', 'U', 'E', 'R', 'Y', '_', 'B', 'Y', '_', 'N', 'A', 'M',
- 'E', '\'', ',', '2', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'i', 'n', '_', 'n', 'a', 'm', 'e', '_', 'x',
- '_', 'c', 'o', 'o', 'r', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e',
- 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd',
- '#', '1', '<', '4', '>', '(', 'N', 'A', 'M', 'E', ',', 'i', 'n', '_', 's', 'p', 'o',
- 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'i', 'n', '_', 'n', 'a', 'm',
- 'e', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o',
- 'o', 'r', 'd', '#', '1', '<', '5', '>', '(', 'N', 'A', 'M', 'E', ',', 'i', 'n', '_',
- 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'i', 'n', '_',
- 'n', 'a', 'm', 'e', '_', 't', '_', 'c', 'o', 'o', 'r', 'd', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e',
- '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '6', '>', '(', 'N', 'A', 'M', 'E', ',',
- 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ',
- 'i', 'n', '_', 'n', 'a', 'm', 'e', '_', 'l', '_', 'c', 'o', 'o', 'r', 'd', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n',
- 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '7', '>', '(', 'N', 'A',
- 'M', 'E', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't',
- 'o', 'k', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', '<', 'a', 's', 'c', 'i', 'i', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c',
- 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'S', 'P', 'O', 'T', '_', 'N', 'A', 'M',
- 'E', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c',
- 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', 'N', 'A', 'M',
- 'E', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o',
- 'k', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', '<', 'a', 's', 'c', 'i', 'i', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'N', 'A', 'M', 'E', '_', 'F', 'M', 'T', '=',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_',
- 'n', 'a', 'm', 'e', '_', 'f', 'm', 't', '#', '1', '<', '\'', 's', 'k', 'e', 'y',
- '\'', '>', '(', 'N', 'A', 'M', 'E', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't',
- 's', '#', '1', '.', '2', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't',
- 'b', 'l', ':', 's', 't', 'a', 't', 's', '#', '1', '.', '1', ',', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '1', '.', '0',
- '.', '3', '{', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't',
- 'i', 'd', '_', 't', ' ', 'm', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'i', 'd', '=',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 's', 'p', 'o', 't', 'i', 'd',
- '_', 't', '>', 'm', 'e', 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'',
- 'S', 'T', 'A', 'T', 'S', '/', 'T', 'A', 'B', 'L', 'E', '/', 'S', 'P', 'O', 'T', '_',
- 'M', 'I', 'N', '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R',
- 'A', ':', 's', 'p', 'o', 't', 'i', 'd', '_', 't', ' ', 'm', 'a', 'x', '_', 's', 'p',
- 'o', 't', '_', 'i', 'd', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':',
- 's', 'p', 'o', 't', 'i', 'd', '_', 't', '>', 'm', 'e', 't', 'a', ':', 'v', 'a', 'l',
- 'u', 'e', '#', '1', '<', '\'', 'S', 'T', 'A', 'T', 'S', '/', 'T', 'A', 'B', 'L',
- 'E', '/', 'S', 'P', 'O', 'T', '_', 'M', 'A', 'X', '\'', '>', '(', ')', ';', 'U',
- '6', '4', ' ', 's', 'p', 'o', 't', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6',
- '4', '>', 'm', 'e', 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'',
- 'S', 'T', 'A', 'T', 'S', '/', 'T', 'A', 'B', 'L', 'E', '/', 'S', 'P', 'O', 'T', '_',
- 'C', 'O', 'U', 'N', 'T', '\'', '>', '(', ')', ';', 'U', '6', '4', ' ', 'b', 'a',
- 's', 'e', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6', '4', '>', 'm', 'e', 't',
- 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', 'S', 'T', 'A', 'T', 'S',
- '/', 'T', 'A', 'B', 'L', 'E', '/', 'B', 'A', 'S', 'E', '_', 'C', 'O', 'U', 'N', 'T',
- '\'', '>', '(', ')', ';', 'U', '6', '4', ' ', 'b', 'i', 'o', '_', 'b', 'a', 's',
- 'e', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6', '4', '>', 'm', 'e', 't', 'a',
- ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', 'S', 'T', 'A', 'T', 'S', '/',
- 'T', 'A', 'B', 'L', 'E', '/', 'B', 'I', 'O', '_', 'B', 'A', 'S', 'E', '_', 'C', 'O',
- 'U', 'N', 'T', '\'', '>', '(', ')', ';', 'U', '6', '4', ' ', 'c', 'm', 'p', '_',
- 'b', 'a', 's', 'e', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6', '4', '>', 'm',
- 'e', 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', 'S', 'T', 'A',
- 'T', 'S', '/', 'T', 'A', 'B', 'L', 'E', '/', 'C', 'M', 'P', '_', 'B', 'A', 'S', 'E',
- '_', 'C', 'O', 'U', 'N', 'T', '\'', '>', '(', ')', '|', 'b', 'a', 's', 'e', '_',
- 'c', 'o', 'u', 'n', 't', ';', 't', 'r', 'i', 'g', 'g', 'e', 'r', ' ', 'm', 'e', 't',
- 'a', '_', 's', 't', 'a', 't', 's', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 's', 't', 'a', 't', 's', '_', 't', 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'i',
- 'n', '_', 's', 't', 'a', 't', 's', '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 'r', 'e',
- 'a', 'd', '_', 'l', 'e', 'n', ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'g', 'r', 'o', 'u', 'p', ')',
- '|', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 't', 'a', 't', 's', '_', 't',
- 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 's', 't', 'a', 't', 's',
- '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',',
- 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', '|', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'c', 'm', 'p', '_', 's', 't', 'a', 't', 's', '_', 't',
- 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 'c', 'm', 'p', '_', 's',
- 't', 'a', 't', 's', '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 's', 't', 'a', 't', 's',
- '_', 'q', 'u', 'a', 'l', ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n',
- ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ',', 'i', 'n', '_',
- 's', 'p', 'o', 't', '_', 'g', 'r', 'o', 'u', 'p', ')', '|', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'c', 'm', 'p', '_', 's', 't', 'a', 't', 's', '_', 't', 'r', 'i',
- 'g', 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 'c', 'm', 'p', '_', 's', 't', 'a',
- 't', 's', '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 's', 't', 'a', 't', 's', '_', 'q',
- 'u', 'a', 'l', ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',', 'i',
- 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', '|', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'c', 'm', 'p', 'f', '_', 's', 't', 'a', 't', 's', '_', 't',
- 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 'c', 'm', 'p', '_', 's',
- 't', 'a', 't', 's', '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_',
- 'l', 'e', 'n', ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',', 'i',
- 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ',', 'i', 'n', '_', 's', 'p',
- 'o', 't', '_', 'g', 'r', 'o', 'u', 'p', ')', '|', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'c', 'm', 'p', 'f', '_', 's', 't', 'a', 't', 's', '_', 't', 'r', 'i', 'g',
- 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 'c', 'm', 'p', '_', 's', 't', 'a', 't',
- 's', '_', 'b', 'i', 'n', ',', 'i', 'n', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n',
- ',', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',', 'i', 'n', '_', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', ';', 't', 'r', 'i', 'g', 'g', 'e', 'r',
- ' ', 'q', 'u', 'a', 'l', '_', 's', 't', 'a', 't', 's', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'p', 'h', 'r', 'e', 'd', '_', 's', 't', 'a', 't', 's', '_', 't',
- 'r', 'i', 'g', 'g', 'e', 'r', '#', '1', '(', 'i', 'n', '_', 'q', 'u', 'a', 'l', '_',
- 'p', 'h', 'r', 'e', 'd', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's',
- 'c', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '2', '=', 'I', 'N', 'S',
- 'D', 'C', ':', 't', 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1',
- '.', '0', '.', '1', ',', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b',
- 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', '{',
- 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'S', 'e', 'g', 'm', 'e', 'n', 't', ' ', 'L',
- 'A', 'B', 'E', 'L', '_', 'S', 'E', 'G', ' ', '=', ' ', 'o', 'u', 't', '_', 'l', 'a',
- 'b', 'e', 'l', '_', 's', 'e', 'g', '|', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u',
- 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's', 'e', 'g', '3', '2', ')', '|', 'c', 'a',
- 's', 't', '#', '1', '(', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's',
- 'e', 'g', '3', '2', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'S', 'e', 'g',
- 'm', 'e', 'n', 't', ' ', 'R', 'E', 'A', 'D', '_', 'S', 'E', 'G', ' ', '=', ' ', 'o',
- 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '|', 'c', 'a', 's', 't', '#',
- '1', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '3', '2', ')',
- '|', 'c', 'a', 's', 't', '#', '1', '(', '_', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd',
- '_', 's', 'e', 'g', '3', '2', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'R',
- 'e', 'a', 'd', 'D', 'e', 's', 'c', ' ', 'R', 'E', 'A', 'D', '_', 'D', 'E', 'S', 'C',
- ' ', '=', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_',
- 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', '#', '1', '(', 'o', 'u', 't', '_', 'n',
- 'r', 'e', 'a', 'd', 's', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't',
- 'a', 'r', 't', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ',',
- 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ',', '_', 'o', 'u',
- 't', '_', 'r', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', ',', 'o', 'u', 't', '_', 'c',
- 's', '_', 'k', 'e', 'y', ',', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_',
- 's', 't', 'a', 'r', 't', ',', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_',
- 'l', 'e', 'n', ',', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', ')', ';', 'r',
- 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'S', 'p', 'o', 't', 'D', 'e', 's', 'c', ' ', 'S',
- 'P', 'O', 'T', '_', 'D', 'E', 'S', 'C', ' ', '=', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 's', 'p', 'o', 't', '_', 'd', 'e', 's', 'c',
- '#', '1', '(', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',', 'f', 'i', 'x', 'e', 'd',
- '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',', 's', 'i', 'g', 'n', 'a', 'l', '_',
- 'l', 'e', 'n', ',', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', ',', 't', 'r',
- 'i', 'm', '_', 'l', 'e', 'n', ',', 'o', 'u', 't', '_', 'n', 'r', 'e', 'a', 'd', 's',
- ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ',
- 'S', 'I', 'G', 'N', 'A', 'L', '_', 'L', 'E', 'N', ' ', '=', ' ', 's', 'i', 'g', 'n',
- 'a', 'l', '_', 'l', 'e', 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'S', 'I', 'G', 'N', 'A', 'L', '_',
- 'L', 'E', 'N', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 's', 'i', 'g', 'n',
- 'a', 'l', '_', 'l', 'e', 'n', ')', ';', 'U', '3', '2', ' ', '_', 'o', 'u', 't', '_',
- 'l', 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', 'U', '3', '2', '=', '(', 'U',
- '3', '2', ')', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r',
- 't', ';', 'U', '3', '2', '[', '2', ']', ' ', '_', 'o', 'u', 't', '_', 'l', 'a', 'b',
- 'e', 'l', '_', 's', 'e', 'g', '3', '2', '=', '<', 'U', '3', '2', '>', 'p', 'a', 's',
- 't', 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's',
- 't', 'a', 'r', 't', 'U', '3', '2', ',', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l',
- '_', 'l', 'e', 'n', ')', ';', 'U', '3', '2', ' ', '_', 'o', 'u', 't', '_', 'r', 'e',
- 'a', 'd', '_', 's', 't', 'a', 'r', 't', 'U', '3', '2', '=', '(', 'U', '3', '2', ')',
- 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ';', 'U', '3',
- '2', '[', '2', ']', ' ', '_', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 'e',
- 'g', '3', '2', '=', '<', 'U', '3', '2', '>', 'p', 'a', 's', 't', 'e', '#', '1', '(',
- '_', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', 'U', '3',
- '2', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l',
- 't', 'e', 'r', ' ', '_', 'o', 'u', 't', '_', 'r', 'd', '_', 'f', 'i', 'l', 't', 'e',
- 'r', '=', 'o', 'u', 't', '_', 'r', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '|', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i',
- 'l', 't', 'e', 'r', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', 'o', 'u',
- 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', ')', ';', 'a', 's', 'c',
- 'i', 'i', ' ', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '=', 'o', 'u', 't',
- '_', 'l', 'a', 'b', 'e', 'l', '|', '<', 'a', 's', 'c', 'i', 'i', '>', 'e', 'c', 'h',
- 'o', '#', '1', '<', '\'', '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', '_', 'o', 'u', 't', '_', 'l',
- 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', '=', 'o', 'u', 't', '_', 'l', 'a',
- 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', '|', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', '>', 'e', 'c', 'h', 'o', '#', '1',
- '<', '0', '>', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r',
- 't', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e',
- 'n', ' ', '_', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 'l', 'e', 'n', '=',
- 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 'l', 'e', 'n', '|', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', '>', 'e', 'c', 'h',
- 'o', '#', '1', '<', '0', '>', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's',
- 't', 'a', 'r', 't', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c',
- '_', 'n', 'o', 'p', 'h', 'y', 's', '#', '1', '.', '0', '.', '2', '=', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's',
- 'c', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '2', '{', 'U', '8', ' ',
- 'o', 'u', 't', '_', 'n', 'r', 'e', 'a', 'd', 's', '=', '.', 'N', 'R', 'E', 'A', 'D',
- 'S', ';', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l',
- '=', '.', 'L', 'A', 'B', 'E', 'L', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A',
- ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'o', 'u', 't', '_', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '=', '.', 'R', 'E', 'A', 'D', '_', 'T', 'Y',
- 'P', 'E', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd',
- '_', 'f', 'i', 'l', 't', 'e', 'r', ' ', 'o', 'u', 't', '_', 'r', 'd', '_', 'f', 'i',
- 'l', 't', 'e', 'r', '=', '.', 'R', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'o',
- 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's', 't', 'a', 'r', 't', '=', '.', 'L',
- 'A', 'B', 'E', 'L', '_', 'S', 'T', 'A', 'R', 'T', '|', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'U', '3', '2', '>',
- 'c', 'u', 't', '#', '1', '<', '0', '>', '(', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e',
- 'l', '_', 's', 'e', 'g', '3', '2', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l',
- '_', 'l', 'e', 'n', '=', '.', 'L', 'A', 'B', 'E', 'L', '_', 'L', 'E', 'N', '|', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', '<',
- 'U', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_',
- 'l', 'a', 'b', 'e', 'l', '_', 's', 'e', 'g', '3', '2', ')', ';', 'U', '3', '2', '[',
- '2', ']', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 's', 'e', 'g', '3',
- '2', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'L', 'A', 'B', 'E', 'L', '_', 'S',
- 'E', 'G', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z',
- 'e', 'r', 'o', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r',
- 't', '=', '.', 'R', 'E', 'A', 'D', '_', 'S', 'T', 'A', 'R', 'T', '|', '(', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'U',
- '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '0', '>', '(', 'o', 'u', 't', '_', 'r',
- 'e', 'a', 'd', '_', 's', 'e', 'g', '3', '2', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a',
- 'd', '_', 'l', 'e', 'n', '=', '.', 'R', 'E', 'A', 'D', '_', 'L', 'E', 'N', '|', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', '<',
- 'U', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_',
- 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '3', '2', ')', ';', 'U', '3', '2', '[', '2',
- ']', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '3', '2', '=',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'f', 'i', 'x', '_', 'r', 'e', 'a', 'd',
- '_', 's', 'e', 'g', '#', '1', '(', '.', 'R', 'E', 'A', 'D', '_', 'S', 'E', 'G', ',',
- 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't',
- 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', '=', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '_', 'n',
- 'o', 'p', 'h', 'y', 's', '#', '1', '.', '0', '.', '2', '{', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'U', '8', '>', 'z', 'i',
- 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'N', 'R', 'E',
- 'A', 'D', 'S', '=', 'N', 'R', 'E', 'A', 'D', 'S', ';', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'a', 's', 'c', 'i', 'i', '>',
- 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'L',
- 'A', 'B', 'E', 'L', '=', 'L', 'A', 'B', 'E', 'L', ';', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', '>', 'i', 'z', 'i', 'p', '_', 'e',
- 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'L', 'A', 'B', 'E', 'L', '_',
- 'S', 'T', 'A', 'R', 'T', '=', 'L', 'A', 'B', 'E', 'L', '_', 'S', 'T', 'A', 'R', 'T',
- ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', '>',
- 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.',
- 'L', 'A', 'B', 'E', 'L', '_', 'L', 'E', 'N', '=', 'L', 'A', 'B', 'E', 'L', '_', 'L',
- 'E', 'N', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e',
- 'r', 'o', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#',
- '1', ' ', '.', 'R', 'E', 'A', 'D', '_', 'S', 'T', 'A', 'R', 'T', '=', 'R', 'E', 'A',
- 'D', '_', 'S', 'T', 'A', 'R', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'l', 'e', 'n', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', '#', '1', ' ', '.', 'R', 'E', 'A', 'D', '_', 'L', 'E', 'N', '=', 'i',
- 'n', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', ';', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'S', 'R', 'A', ':', 'x', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '>', 'z', 'i',
- 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'R', 'E', 'A',
- 'D', '_', 'T', 'Y', 'P', 'E', '=', 'i', 'n', '_', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd',
- '_', 'f', 'i', 'l', 't', 'e', 'r', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', '#', '1', ' ', '.', 'R', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', '=',
- 'R', 'E', 'A', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ';', '}', 't', 'a', 'b', 'l',
- 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 'p', 'o',
- 's', '#', '1', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 't', 'b', 'l',
- ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.', '1', '{', 'I',
- 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e',
- ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', '>',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 'p', 'o', 's',
- 'i', 't', 'i', 'o', 'n', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', '2', 'n',
- 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', '>', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 'p', 'o', 's', 'i', 't', 'i', 'o',
- 'n', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a',
- 'c', 'k', 'e', 'd', ')', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o',
- 's', '1', '6', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '1',
- '6', '=', '<', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6',
- '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'm', 'a', 'k', 'e', '_', 'p', 'o',
- 's', 'i', 't', 'i', 'o', 'n', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', '2',
- 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', ')', '|', '<', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'm', 'a', 'k', 'e', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '#', '1',
- '<', '1', '>', '(', 'o', 'u', 't', '_', '2', 'c', 's', '_', 'p', 'a', 'c', 'k', 'e',
- 'd', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '_', 'n', 'o', 'p', 'o', 's', '#', '1',
- '.', '0', '.', '3', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b',
- 'l', ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '_',
- 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '2', '{', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':',
- 'o', 'n', 'e', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', 'o', 'u',
- 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n',
- 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'p', 'o', 's', '1', '6', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ',
- '=', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '1', '6', ';',
- 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'z', 'e', 'r',
- 'o', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', '(', 'I', 'N', 'S',
- 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'z', 'e', 'r', 'o', ')',
- '<', 'I', '3', '2', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1', '>', '(', 'o', 'u',
- 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ')', ';', 'U', '6', '4', ' ', 'b',
- 'a', 's', 'e', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6', '4', '>', 'm', 'e',
- 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', 'B', 'A', 'S', 'E',
- '_', 'C', 'O', 'U', 'N', 'T', '\'', '>', '(', ')', ';', 'U', '6', '4', ' ', 's',
- 'p', 'o', 't', '_', 'c', 'o', 'u', 'n', 't', '=', '<', 'U', '6', '4', '>', 'm', 'e',
- 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', '.', 's', 'e', 'q',
- '/', 's', 'p', 'o', 't', '\'', '>', '(', ')', '|', '<', 'U', '6', '4', '>', 'm',
- 'e', 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'', '.', 's', 'e',
- 'q', '\'', '>', '(', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '1', '.', '0',
- '.', '3', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'r', 'a', '_', 'n', 'o', 'p', 'o', 's', '#', '1', '.', '0', '.', '3', ',', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 'p', 'o', 's', '#', '1', '.',
- '0', '.', '1', '{', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '_', 'n', 'o', 'p', 'o', 's', '#',
- '2', '.', '1', '.', '3', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't',
- 'b', 'l', ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e',
- '#', '3', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't',
- 'b', 'l', ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2',
- ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a',
- 't', 's', '#', '1', '.', '2', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'P',
- 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'p', 'o', 's',
- 'i', 't', 'i', 'o', 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's',
- '1', '6', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', 'c', 'a', 's',
- 't', '#', '1', '(', '_', 'c', 'l', 'i', 'p', '_', 'p', 'o', 's', 'i', 't', 'i', 'o',
- 'n', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':',
- 'z', 'e', 'r', 'o', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'z', 'e',
- 'r', 'o', ')', '<', 'I', '3', '2', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1', '>',
- '(', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_',
- 'i', 'd', ' ', 'o', 'u', 't', '_', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '=', '.',
- 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', ';', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o',
- 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', '_', 'c', 'l', 'i', 'p', '_',
- 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'p',
- 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', '>', 'c', 'l', 'i', 'p', '#',
- '1', '<', '0', ',', '6', '5', '5', '3', '5', '>', '(', 'o', 'u', 't', '_', 'p', 'o',
- 's', 'i', 't', 'i', 'o', 'n', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '2', '.',
- '1', '.', '3', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '#', '3',
- '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 's', 'p', 'o', 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', ',', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 't', 'a', 't', 's',
- '#', '1', '.', '2', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 'p', 'o', 's', '#', '1', '.', '0', '.', '1', '{', 'r', 'e', 'a', 'd', 'o', 'n',
- 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p',
- 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'P', 'O', 'S', 'I', 'T',
- 'I', 'O', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o',
- 'n', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6', ' ', 'P',
- 'O', 'S', 'I', 'T', 'I', 'O', 'N', ' ', '=', ' ', 'o', 'u', 't', '_', 'p', 'o', 's',
- 'i', 't', 'i', 'o', 'n', '1', '6', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i',
- 't', 'i', 'o', 'n', ':', 'z', 'e', 'r', 'o', ' ', 'P', 'O', 'S', 'I', 'T', 'I', 'O',
- 'N', ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i',
- 'o', 'n', ':', 'z', 'e', 'r', 'o', ')', '<', 'I', '3', '2', '>', 'd', 'i', 'f', 'f',
- '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o',
- 'n', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 't', 'b', 'l', ':', 'c', 'l', 'i', 'p', '#', '1', '.', '0', '.', '2', '=',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o',
- 't', 'd', 'e', 's', 'c', '#', '1', '.', '0', '.', '2', '{', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e',
- ' ', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F',
- 'T', ' ', '=', ' ', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p',
- 't', '_', 'l', 'e', 'f', 't', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'C', 'L', 'I', 'P',
- '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T', ' ', '=', ' ',
- 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i',
- 'g', 'h', 't', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'C', 'L', 'I', 'P', '_', 'Q', 'U',
- 'A', 'L', 'I', 'T', 'Y', '_', 'L', 'E', 'F', 'T', ' ', '=', ' ', 'o', 'u', 't', '_',
- 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', ';', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'o', 'n', 'e', ' ', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_',
- 'R', 'I', 'G', 'H', 'T', ' ', '=', ' ', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_',
- 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', ';', 'r', 'e', 'a', 'd', 'o', 'n',
- 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'C', 'L', 'I',
- 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F', 'T', ' ', '=', ' ',
- '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F',
- 'T', '|', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p',
- '_', 'a', 'd', 'a', 'p', 't', '_', 'l', 'e', 'f', 't', ')', ';', 'r', 'e', 'a', 'd',
- 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U', '1', '6', ' ', 'C',
- 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T',
- ' ', '=', ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_',
- 'R', 'I', 'G', 'H', 'T', '|', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_',
- 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i', 'g', 'h', 't', ')',
- ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'U', '1', '6', ' ', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_',
- 'L', 'E', 'F', 'T', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't',
- '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', ')', ';',
- 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'U',
- '1', '6', ' ', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R',
- 'I', 'G', 'H', 'T', ' ', '=', ' ', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't',
- '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', ')',
- ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ',
- 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F', 'T',
- ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z',
- 'e', 'r', 'o', ')', '<', 'I', '3', '2', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1',
- '>', '(', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_',
- 'l', 'e', 'f', 't', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'z', 'e', 'r', 'o', ' ', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R',
- '_', 'R', 'I', 'G', 'H', 'T', ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'I', '3', '2', '>', 'd', 'i',
- 'f', 'f', '#', '1', '<', '1', '>', '(', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_',
- 'a', 'd', 'a', 'p', 't', '_', 'r', 'i', 'g', 'h', 't', ')', ';', 'r', 'e', 'a', 'd',
- 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'C', 'L', 'I', 'P', '_',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'L', 'E', 'F', 'T', ' ', '=', ' ', '(', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<',
- 'I', '3', '2', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1', '>', '(', 'l', 'i', 'm',
- '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', ')', ';',
- 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'C',
- 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'I', 'G', 'H', 'T',
- ' ', '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z',
- 'e', 'r', 'o', ')', '<', 'I', '3', '2', '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1',
- '>', '(', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'r',
- 'i', 'g', 'h', 't', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'o', 'n', 'e', ' ', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a',
- 'p', 't', '_', 'l', 'e', 'f', 't', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'C',
- 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F', 'T', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ',
- 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i',
- 'g', 'h', 't', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'C', 'L', 'I', 'P', '_',
- 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'o', 'u', 't',
- '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', '=', 'c',
- 'a', 's', 't', '#', '1', '(', '.', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I',
- 'T', 'Y', '_', 'L', 'E', 'F', 'T', ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '1',
- '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o',
- 'n', 'e', ' ', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_',
- 'r', 'i', 'g', 'h', 't', '=', 'c', 'a', 's', 't', '#', '1', '(', '.', 'C', 'L', 'I',
- 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'I', 'G', 'H', 'T', ')', '|',
- 'c', 'a', 's', 't', '#', '1', '(', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 's',
- 'p', 'o', 't', '_', 'r', 'i', 'g', 'h', 't', '=', '(', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ')', 's', 'p', 'o', 't', '_', 'l', 'e',
- 'n', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e',
- ' ', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'l',
- 'e', 'f', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'o', 'n', 'e', '>', 'c', 'l', 'i', 'p', '#', '1', '<', '1', ',', '2', '1', '4', '7',
- '4', '8', '3', '6', '4', '7', '>', '(', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_',
- 'a', 'd', 'a', 'p', 't', '_', 'l', 'e', 'f', 't', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'm', 'a', 'x', '_', 'c', 'l',
- 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i', 'g', 'h', 't', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ',', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'm', 'a', 'p',
- '#', '1', '<', '0', ',', '2', '1', '4', '7', '4', '8', '3', '6', '4', '7', '>', '(',
- 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i',
- 'g', 'h', 't', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'o', 'n', 'e', ' ', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p',
- 't', '_', 'r', 'i', 'g', 'h', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'm', 'i', 'n', '#', '1', '(', 's', 'p', 'o',
- 't', '_', 'r', 'i', 'g', 'h', 't', ',', 'm', 'a', 'x', '_', 'c', 'l', 'i', 'p', '_',
- 'a', 'd', 'a', 'p', 't', '_', 'r', 'i', 'g', 'h', 't', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'l', 'i', 'm', '_', 'c',
- 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'c', 'l', 'i',
- 'p', '#', '1', '<', '1', ',', '2', '1', '4', '7', '4', '8', '3', '6', '4', '7', '>',
- '(', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e',
- 'f', 't', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o',
- 'n', 'e', ' ', 'm', 'a', 'x', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_',
- 'r', 'i', 'g', 'h', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'o', 'n', 'e', ',', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'o', 'n', 'e', '>', 'm', 'a', 'p', '#', '1', '<', '0', ',', '2', '1', '4', '7',
- '4', '8', '3', '6', '4', '7', '>', '(', 'o', 'u', 't', '_', 'c', 'l', 'i', 'p', '_',
- 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'l', 'i', 'm', '_', 'c', 'l',
- 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'm', 'i', 'n',
- '#', '1', '(', 's', 'p', 'o', 't', '_', 'r', 'i', 'g', 'h', 't', ',', 'm', 'a', 'x',
- '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ',
- 'm', 'a', 'x', '_', 'c', 'l', 'i', 'p', '_', 'l', 'e', 'f', 't', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'm', 'a', 'x',
- '#', '1', '(', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't',
- '_', 'l', 'e', 'f', 't', ',', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u',
- 'a', 'l', '_', 'l', 'e', 'f', 't', ')', '|', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p',
- '_', 'a', 'd', 'a', 'p', 't', '_', 'l', 'e', 'f', 't', '|', 'l', 'i', 'm', '_', 'c',
- 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'l', 'e', 'f', 't', ';', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'm', 'a', 'x',
- '_', 'z', 'c', 'l', 'i', 'p', '_', 'l', 'e', 'f', 't', '=', '(', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'I', '3', '2',
- '>', 'd', 'i', 'f', 'f', '#', '1', '<', '1', '>', '(', 'm', 'a', 'x', '_', 'c', 'l',
- 'i', 'p', '_', 'l', 'e', 'f', 't', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', ' ', 'm', 'i', 'n', '_', 'c', 'l', 'i', 'p', '_',
- 'r', 'i', 'g', 'h', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'o', 'n', 'e', '>', 'm', 'i', 'n', '#', '1', '(', 'l', 'i', 'm', '_', 'c',
- 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't', '_', 'r', 'i', 'g', 'h', 't', ',', 'l',
- 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'q', 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h',
- 't', ')', '|', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'a', 'd', 'a', 'p', 't',
- '_', 'r', 'i', 'g', 'h', 't', '|', 'l', 'i', 'm', '_', 'c', 'l', 'i', 'p', '_', 'q',
- 'u', 'a', 'l', '_', 'r', 'i', 'g', 'h', 't', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'b', 'i', 'o', '_', 's', 't', 'a',
- 'r', 't', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'b', 'i', 'o', '_', 's',
- 't', 'a', 'r', 't', '#', '1', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's',
- 't', 'a', 'r', 't', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p',
- 'e', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e',
- 'r', 'o', ' ', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', '>', 'm', 'a',
- 'x', '#', '1', '(', 'b', 'i', 'o', '_', 's', 't', 'a', 'r', 't', ',', 'm', 'a', 'x',
- '_', 'z', 'c', 'l', 'i', 'p', '_', 'l', 'e', 'f', 't', ')', '|', 'b', 'i', 'o', '_',
- 's', 't', 'a', 'r', 't', ';', 'I', '3', '2', ' ', 't', 'r', 'i', 'm', '_', 's', 't',
- 'o', 'p', '=', '<', 'I', '3', '2', '>', 'm', 'a', 'x', '#', '1', '(', 'm', 'i', 'n',
- '_', 'c', 'l', 'i', 'p', '_', 'r', 'i', 'g', 'h', 't', ',', 't', 'r', 'i', 'm', '_',
- 's', 't', 'a', 'r', 't', ')', '|', 's', 'p', 'o', 't', '_', 'r', 'i', 'g', 'h', 't',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ',
- 't', 'r', 'i', 'm', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', '<', 'I', '3', '2', '>', 'd', 'i', 'f',
- 'f', '#', '1', '(', 't', 'r', 'i', 'm', '_', 's', 't', 'o', 'p', ',', 't', 'r', 'i',
- 'm', '_', 's', 't', 'a', 'r', 't', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'c', 'o', 'm',
- 'm', 'o', 'n', '#', '1', '.', '0', '.', '4', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', ',',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 'c', 'l', 'i', 'p',
- '#', '1', '.', '0', '.', '2', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'F', 'L', 'O', 'W', '_',
- 'C', 'H', 'A', 'R', 'S', ' ', '=', ' ', 'o', 'u', 't', '_', 'f', 'l', 'o', 'w', '_',
- 'c', 'h', 'a', 'r', 's', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'K', 'E', 'Y', '_', 'S', 'E',
- 'Q', 'U', 'E', 'N', 'C', 'E', ' ', '=', ' ', 'o', 'u', 't', '_', 'k', 'e', 'y', '_',
- 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'L', 'I', 'N',
- 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ' ', '=', ' ', 'o', 'u',
- 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e',
- ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm',
- 'p', '1', ' ', 'S', 'I', 'G', 'N', 'A', 'L', ' ', '=', ' ', 'o', 'u', 't', '_', 's',
- 'i', 'g', 'n', 'a', 'l', ';', 'a', 's', 'c', 'i', 'i', ' ', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '_', 'n', 'a', 'm', 'e', '=', '<', 'a', 's', 'c', 'i', 'i', '>', 'e',
- 'c', 'h', 'o', '#', '1', '<', '\'', '4', '5', '4', '\'', '>', '(', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'i', 'n', '_',
- 'f', 'l', 'o', 'w', '_', 'c', 'h', 'a', 'r', 's', '=', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'd',
- 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<', '\'', 'a',
- 'c', 'g', 't', 'n', '.', '\'', ',', '\'', 'A', 'C', 'G', 'T', 'N', 'N', '\'', '>',
- '(', 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A', 'R', 'S', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'i', 'n', '_', 'k', 'e', 'y',
- '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '=', '<', 'I', 'N', 'S', 'D', 'C', ':',
- 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<', '\'', 'a', 'c',
- 'g', 't', 'n', '.', '\'', ',', '\'', 'A', 'C', 'G', 'T', 'N', 'N', '\'', '>', '(',
- 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ')', ';', 'I', 'N', 'S',
- 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'i', 'n', '_', 'l', 'i',
- 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'a', 'p', '#', '1', '<',
- '\'', 'a', 'c', 'g', 't', 'n', '.', '\'', ',', '\'', 'A', 'C', 'G', 'T', 'N', 'N',
- '\'', '>', '(', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E', 'N',
- 'C', 'E', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i',
- 'n', ' ', 'o', 'u', 't', '_', 'f', 'l', 'o', 'w', '_', 'b', 'i', 'n', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S',
- 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1',
- '<', '\'', 'A', 'C', 'G', 'T', 'N', '\'', ',', '[', '0', ',', '1', ',', '2', ',',
- '3', ',', '4', ']', '>', '(', 'o', 'u', 't', '_', 'f', 'l', 'o', 'w', '_', 'c', 'h',
- 'a', 'r', 's', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b',
- 'i', 'n', ' ', 'o', 'u', 't', '_', 'k', 'e', 'y', '_', 'b', 'i', 'n', '=', '<', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ',', 'I', 'N', 'S',
- 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', '>', 'm', 'a', 'p', '#', '1',
- '<', '\'', 'A', 'C', 'G', 'T', 'N', '\'', ',', '[', '0', ',', '1', ',', '2', ',',
- '3', ',', '4', ']', '>', '(', 'o', 'u', 't', '_', 'k', 'e', 'y', '_', 's', 'e', 'q',
- 'u', 'e', 'n', 'c', 'e', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a',
- ':', 'b', 'i', 'n', ' ', 'o', 'u', 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 'b',
- 'i', 'n', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x',
- 't', ',', 'I', 'N', 'S', 'D', 'C', ':', 'x', '2', 'n', 'a', ':', 'b', 'i', 'n', '>',
- 'm', 'a', 'p', '#', '1', '<', '\'', 'A', 'C', 'G', 'T', 'N', '\'', ',', '[', '0',
- ',', '1', ',', '2', ',', '3', ',', '4', ']', '>', '(', 'o', 'u', 't', '_', 'l', 'i',
- 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ')', ';', 'N', 'C',
- 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', ' ', 'o', 'u', 't', '_', 's', 'i', 'g',
- 'n', 'a', 'l', '=', '.', 'S', 'I', 'G', 'N', 'A', 'L', ';', '}', 't', 'a', 'b', 'l',
- 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':',
- 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '7', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '_', 'n', 'o', 'p', 'o',
- 's', '#', '2', '.', '1', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '#', '2', '.', '0', '.', '3', ',',
- 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', '#', '2', '.', '0', '.', '4', ',', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'c', 'o', 'm', 'm', 'o', 'n', '#',
- '1', '.', '0', '.', '4', '{', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'v', 'a', 'l', ' ', 'R', 'E', 'G', 'I', 'O', 'N', ' ', '=', ' ', '(', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e',
- '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '6', '>', '(', '_', 'o', 'u', 't', '_',
- 'n', 'a', 'm', 'e', ',', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '_', 't', 'o', 'k', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n',
- ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o',
- 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':',
- 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', ')', ';', 't', 'e',
- 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'i', 'n', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', '_', '4', '5', '4', '_', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', 'N', 'A', 'M', 'E', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u',
- 't', '_', 'f', 'l', 'o', 'w', '_', 'c', 'h', 'a', 'r', 's', '=', '.', 'F', 'L', 'O',
- 'W', '_', 'C', 'H', 'A', 'R', 'S', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n',
- 'a', ':', 't', 'e', 'x', 't', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'T',
- 'A', 'C', 'G', '\'', '>', '(', '.', 'S', 'I', 'G', 'N', 'A', 'L', ')', '|', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '\'', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T',
- 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T',
- 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T',
- 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T',
- 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T',
- 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A',
- 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C',
- 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G',
- 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', 'T', 'A', 'C', 'G', '\'',
- '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x',
- 't', ' ', 'o', 'u', 't', '_', 'k', 'e', 'y', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c',
- 'e', '=', '.', 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', '|', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '\'', 'T', 'C', 'A', 'G', '\'', '>', '(', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u', 't',
- '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '=',
- '.', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n',
- 'e', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '=', '.', 'P',
- 'O', 'S', 'I', 'T', 'I', 'O', 'N', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a',
- ':', 't', 'e', 'x', 't', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n',
- 'g', '#', '1', ' ', '.', 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A', 'R', 'S', '=', 'i',
- 'n', '_', 'f', 'l', 'o', 'w', '_', 'c', 'h', 'a', 'r', 's', ';', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'z', 'i', 'p', '_', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'K', 'E', 'Y', '_', 'S', 'E', 'Q',
- 'U', 'E', 'N', 'C', 'E', '=', 'i', 'n', '_', 'k', 'e', 'y', '_', 's', 'e', 'q', 'u',
- 'e', 'n', 'c', 'e', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1',
- ' ', '.', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E',
- '=', 'i', 'n', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n',
- 'c', 'e', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N',
- '#', '2', ' ', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '=', 'P', 'O', 'S', 'I',
- 'T', 'I', 'O', 'N', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4',
- '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I', 'P', '#', '2',
- ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L', 'E',
- 'F', 'T', '=', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'L',
- 'E', 'F', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_',
- ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I', 'P', '#', '2', ' ',
- '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'R', 'I', 'G',
- 'H', 'T', '=', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T', 'E', 'R', '_', 'R',
- 'I', 'G', 'H', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4',
- '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I', 'P', '#', '2',
- ' ', '.', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'L', 'E',
- 'F', 'T', '=', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'L',
- 'E', 'F', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_',
- ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I', 'P', '#', '2', ' ',
- '.', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'I', 'G',
- 'H', 'T', '=', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R',
- 'I', 'G', 'H', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4',
- '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L',
- '#', '2', ' ', '.', 'S', 'I', 'G', 'N', 'A', 'L', '=', 'S', 'I', 'G', 'N', 'A', 'L',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'q', 'u', 'a', 'l', '4', '_', 'n', 'o',
- 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', '=', 'I', 'N', 'S', 'D', 'C', ':', 't',
- 'b', 'l', ':', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '#', '1', '.', '0', '.', '1',
- ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o', 'c', 'o', 'l', '#', '1',
- '.', '0', '.', '1', '{', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ', 'Q', 'U',
- 'A', 'L', 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4',
- ';', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ', 'o', 'u', 't', '_', 'q',
- 'u', 'a', 'l', '4', '=', '<', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', '>',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 's', 'w', 'a', 'p', 'p', 'e', 'd', ',',
- 'r', 'e', 'a', 'd', '_', 'u', 'n', 'p', 'a', 'c', 'k', ')', '|', '<', 'N', 'C', 'B',
- 'I', ':', 'q', 'u', 'a', 'l', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'r', 'o', 't', 'a', 't', 'e', '#', '1', '<', 'f', 'a', 'l', 's', 'e', '>', '(', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 'r', 'o', 't', 'a', 't', 'e', 'd', ',',
- 'r', 'e', 'a', 'd', '_', 'u', 'n', 'p', 'a', 'c', 'k', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '1', '_', 'c', 'h', '0', '=', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g',
- '_', 'o', 'd', 'd', 's', '>', 'c', 'u', 't', '#', '1', '<', '0', '>', '(', 'o', 'u',
- 't', '_', 'q', 'u', 'a', 'l', '4', '_', 's', 'w', 'a', 'p', 'p', 'e', 'd', ')', '|',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', '>', 'c', 'u', 't', '#', '1', '<', '0', '>', '(', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 'r', 'o', 't', 'a', 't', 'e', 'd', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o',
- 'g', '_', 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '1', '_',
- 'c', 'l', 'i', 'p', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i',
- 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '>', 'c', 'l', 'i', 'p', '#',
- '1', '<', '-', '5', ',', '1', '2', '7', '>', '(', 'o', 'u', 't', '_', 'q', 'u', 'a',
- 'l', '1', '_', 'c', 'h', '0', ')', ';', 'U', '3', '2', ' ', 'o', 'u', 't', '_', 'q',
- 'u', 'a', 'l', '4', '_', '3', '2', '=', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i',
- 'o', 'n', '#', '1', '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 's', 'w',
- 'a', 'p', 'p', 'e', 'd', ')', '|', 'r', 'e', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o',
- 'n', '#', '1', '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 'r', 'o', 't',
- 'a', 't', 'e', 'd', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i',
- 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q',
- 'u', 'a', 'l', '1', '_', 'f', 'i', 'v', 'e', 's', '=', '<', 'U', '3', '2', ',', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', '>', 'm', 'a', 'p', '#', '1', '<', '4', '2', '2', '7', '5', '9',
- '5', '2', '5', '9', ',', '-', '6', '>', '(', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l',
- '4', '_', '3', '2', ',', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '1', '_', 'c', 'l',
- 'i', 'p', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y',
- ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a',
- 'l', '1', '_', 'n', '=', '<', 'U', '8', ',', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '>', 'm', 'a',
- 'p', '#', '1', '<', '[', '1', ',', '2', ',', '3', ']', ',', '[', '0', ',', '0', ',',
- '0', ']', '>', '(', 'r', 'e', 'a', 'd', '_', 'u', 'n', 'p', 'a', 'c', 'k', ',', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '1', '_', 'f', 'i', 'v', 'e', 's', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_',
- 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'l', 'o', 'g',
- '_', 'o', 'd', 'd', 's', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l',
- 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ',', 'I', 'N', 'S', 'D',
- 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', '>', 'm', 'a', 'p', '#', '1', '<', '-', '6', ',', '-', '6', '>', '(', 'o', 'u',
- 't', '_', 'q', 'u', 'a', 'l', '1', '_', 'n', ',', 'o', 'u', 't', '_', 'q', 'u', 'a',
- 'l', '1', '_', 'c', 'l', 'i', 'p', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'q', 'u', 'a', 'l', '4', '#', '1', '.', '0', '.', '1', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'q', 'u', 'a', 'l',
- '4', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', '{', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a',
- 'l', '4', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 's', 'w', 'a', 'p',
- 'p', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 'q', 'u', 'a', 'l', '4', '#', '2', '.', '0', '.', '4', '=', 'N',
- 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c',
- 'e', '#', '2', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_',
- 'n', 'o', 'c', 'o', 'l', '#', '2', '.', '0', '.', '1', '{', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', ' ', '=', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', ';', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q',
- 'u', 'a', 'l', '4', ' ', 'i', 'n', '_', 'q', 'u', 'a', 'l', '4', '=', '(', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u',
- 'a', 'l', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', '>', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'Q', 'U',
- 'A', 'L', 'I', 'T', 'Y', ',', 'i', 'n', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n',
- ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p',
- 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'q', 'u',
- 'a', 'l', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p',
- '#', '1', '(', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ',', 'i', 'n', '_', '2', 'n', 'a',
- '_', 'b', 'i', 'n', ')', ';', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ',
- 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '=', '<', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', '>',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', '.',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ',', 'o', 'u', 't', '_', 'x', '2', 'n', 'a', '_',
- 'b', 'i', 'n', ')', ';', 'N', 'C', 'B', 'I', ':', 'q', 'u', 'a', 'l', '4', ' ', 'i',
- 'n', '_', 's', 't', 'a', 't', 's', '_', 'q', 'u', 'a', 'l', '=', 'i', 'n', '_', 'q',
- 'u', 'a', 'l', '4', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', ' ', 'o', 'u', 't', '_', 'q', 'u',
- 'a', 'l', '_', 'l', 'o', 'g', '_', 'o', 'd', 'd', 's', '=', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', '>', 'c', 'u', 't', '#', '1', '<', '0', '>', '(', '.', 'Q', 'U', 'A', 'L', 'I',
- 'T', 'Y', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'q', 'u', 'a', 'l', '4',
- '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', '=', 'i', 'n', '_', 'q', 'u', 'a', 'l', '4', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', '=',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a',
- '#', '1', '.', '0', '.', '3', '{', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'v', 'a', 'l', ' ', 'L', 'A', 'N', 'E', ' ', '=', ' ', 'o', 'u', 't', '_', 'l',
- 'a', 'n', 'e', '_', 'c', 'o', 'o', 'r', 'd', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l',
- 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'T', 'I', 'L', 'E', ' ', '=', ' ', 'o', 'u',
- 't', '_', 't', 'i', 'l', 'e', '_', 'c', 'o', 'o', 'r', 'd', ';', 'a', 's', 'c', 'i',
- 'i', ' ', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'n', 'a', 'm', 'e', '=', '<',
- 'a', 's', 'c', 'i', 'i', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'I', 'L',
- 'L', 'U', 'M', 'I', 'N', 'A', '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'b', 'i', 'o', '_', 's',
- 't', 'a', 'r', 't', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'b', 'i', 'o',
- '_', 's', 't', 'a', 'r', 't', '#', '1', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd',
- '_', 's', 't', 'a', 'r', 't', ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't',
- 'y', 'p', 'e', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'z', 'e', 'r', 'o', ' ', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', '=', 'b',
- 'i', 'o', '_', 's', 't', 'a', 'r', 't', ';', 'U', '3', '2', ' ', 't', 'r', 'i', 'm',
- '_', 'l', 'e', 'f', 't', '=', '(', 'U', '3', '2', ')', 't', 'r', 'i', 'm', '_', 's',
- 't', 'a', 'r', 't', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'l', 'e', 'n', ' ', 't', 'r', 'i', 'm', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', '<', 'U', '3', '2',
- '>', 'd', 'i', 'f', 'f', '#', '1', '(', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',',
- 't', 'r', 'i', 'm', '_', 'l', 'e', 'f', 't', ')', ';', '}', 't', 'a', 'b', 'l', 'e',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '4', '=', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '2', '.',
- '1', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e',
- '_', 's', 'p', 'a', 'c', 'e', '#', '2', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'c', 'o', 'm',
- 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'S', 'I', 'G', 'N', 'A',
- 'L', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l',
- ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'N', 'C', 'B', 'I', ':', 'f',
- 's', 'a', 'm', 'p', '4', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#',
- '1', '(', 'i', 'n', '_', 's', 'i', 'g', 'n', 'a', 'l', ',', 'o', 'u', 't', '_', 's',
- 'i', 'g', 'n', 'a', 'l', ')', ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'O', 'I', 'S', 'E', '{', 'r',
- 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'n', 'o', 'i', 's', 'e', ';', 'v', 'a', 'l',
- 'i', 'd', 'a', 't', 'e', '=', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p',
- '4', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n',
- '_', 'n', 'o', 'i', 's', 'e', ',', 'o', 'u', 't', '_', 'n', 'o', 'i', 's', 'e', ')',
- ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a',
- 'm', 'p', '4', ' ', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '{', 'r', 'e', 'a',
- 'd', '=', 'o', 'u', 't', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ';', 'v',
- 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a',
- 'm', 'p', '4', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(',
- 'i', 'n', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'o', 'u', 't', '_',
- 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ')', ';', '}', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'l', 'a',
- 'n', 'e', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o', 'o',
- 'r', 'd', '#', '1', '<', '7', '>', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e',
- ',', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o',
- 'k', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a',
- 'l', ' ', 'o', 'u', 't', '_', 't', 'i', 'l', 'e', '_', 'c', 'o', 'o', 'r', 'd', '=',
- '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_',
- 'n', 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '6', '>', '(', '_',
- 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', ',', 'o', 'u', 't', '_', 's', 'p', 'o', 't',
- '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 't', 'e', 'x', 't', ':', 't',
- 'o', 'k', 'e', 'n', ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l',
- 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'n',
- 'a', 'm', 'e', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'i',
- 'n', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '#', '1', '(', 'N', 'A', 'M', 'E', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', ' ', 'i', 'n', '_', 's', 'i', 'g', 'n', 'a', 'l', '=', 'S', 'I',
- 'G', 'N', 'A', 'L', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ',
- 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', '=', '<', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p',
- '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1',
- '(', '.', 'S', 'I', 'G', 'N', 'A', 'L', ',', 'o', 'u', 't', '_', 'x', '2', 'n', 'a',
- '_', 'b', 'i', 'n', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4',
- ' ', 'i', 'n', '_', 'n', 'o', 'i', 's', 'e', '=', 'N', 'O', 'I', 'S', 'E', ';', 'N',
- 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 'n', 'o',
- 'i', 's', 'e', '=', '.', 'N', 'O', 'I', 'S', 'E', ';', 'N', 'C', 'B', 'I', ':', 'f',
- 's', 'a', 'm', 'p', '4', ' ', 'i', 'n', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't',
- 'y', '=', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', ';', 'N', 'C', 'B', 'I', ':',
- 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 'i', 'n', 't', 'e', 'n', 's',
- 'i', 't', 'y', '=', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', '>',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'n', 'o', 'r', 'm', 'a', 'l',
- 'i', 'z', 'e', '#', '1', '(', 'o', 'u', 't', '_', 'n', 'o', 'r', 'm', '_', 'i', 'n',
- 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'o', 'u', 't', '_', 'x', '2', 'n', 'a', '_',
- 'b', 'i', 'n', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ',
- 'o', 'u', 't', '_', 'n', 'o', 'r', 'm', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't',
- 'y', '=', '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f',
- 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w',
- 'a', 'p', '#', '1', '(', '.', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', ',', 'o',
- 'u', 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'N', 'C', 'B', 'I',
- ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'i', 'n', '_', 'n', 'o', 'r', 'm', '_', 'i',
- 'n', 't', 'e', 'n', 's', 'i', 't', 'y', '=', '<', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'n', 'o', 'r',
- 'm', 'a', 'l', 'i', 'z', 'e', '#', '1', '(', 'i', 'n', '_', 'i', 'n', 't', 'e', 'n',
- 's', 'i', 't', 'y', ',', 'i', 'n', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')',
- '|', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', '#', '1',
- '(', 'i', 'n', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'i', 'n', '_',
- '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g',
- ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '2', ' ', '.', 'S', 'I', 'G', 'N', 'A', 'L',
- '=', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e',
- 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a',
- 'p', '#', '1', '(', 'i', 'n', '_', 's', 'i', 'g', 'n', 'a', 'l', ',', 'i', 'n', '_',
- 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4',
- ')', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'i', 'n', '_', 's',
- 'i', 'g', 'n', 'a', 'l', ',', 'i', 'n', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ')',
- ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a',
- ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'N', 'O', 'I', 'S', 'E', '#', '2',
- ' ', '.', 'N', 'O', 'I', 'S', 'E', '=', 'i', 'n', '_', 'n', 'o', 'i', 's', 'e', ';',
- 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T',
- 'Y', '#', '2', ' ', '.', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', '=', '(', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f',
- 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p',
- '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1',
- '(', 'i', 'n', '_', 'n', 'o', 'r', 'm', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't',
- 'y', ',', 'i', 'n', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', '|', '(', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f',
- 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p',
- '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1',
- '(', 'i', 'n', '_', 'n', 'o', 'r', 'm', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't',
- 'y', ',', 'i', 'n', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', '}', 't', 'a',
- 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u',
- 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'q', '4', ':', 'v', '2', '#', '1', '.',
- '0', '.', '4', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u',
- 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '4',
- ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 'q', 'u', 'a', 'l', '4', '#', '2', '.', '0', '.', '4', '{', '}', 't', 'a',
- 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u',
- 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'q', '1', ':', 'v', '2', '#', '1', '.',
- '0', '.', '4', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u',
- 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '4',
- ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'l', 'o', 'g', '_', 'o', 'd', 'd',
- 's', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '#', '2', '.', '0', '.', '4', '{', '}',
- 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l',
- 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', ':',
- 'v', '2', '#', '1', '.', '0', '.', '4', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '2', '#',
- '1', '.', '0', '.', '4', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h',
- 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '#', '2', '.', '0', '.', '4',
- '{', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'A', 'B', 'I', ':', 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', '=',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a',
- '#', '1', '.', '0', '.', '3', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'P', 'A', 'N', 'E',
- 'L', ' ', '=', ' ', 'o', 'u', 't', '_', 'p', 'a', 'n', 'e', 'l', '_', 'c', 'o', 'o',
- 'r', 'd', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', ' ', 'S', 'I', 'G', 'N', 'A', 'L', ' ', '=', ' ', 'o', 'u', 't',
- '_', 's', 'i', 'g', 'n', 'a', 'l', ';', 'a', 's', 'c', 'i', 'i', ' ', 'p', 'l', 'a',
- 't', 'f', 'o', 'r', 'm', '_', 'n', 'a', 'm', 'e', '=', '<', 'a', 's', 'c', 'i', 'i',
- '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'A', 'B', 'S', 'O', 'L', 'I', 'D',
- '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'z', 'e', 'r', 'o', ' ', 'b', 'i', 'o', '_', 's', 't', 'a', 'r', 't', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'b', 'i', 'o', '_', 's', 't', 'a', 'r', 't',
- '#', '1', '(', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't',
- ',', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 't',
- 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', '=', 'b', 'i', 'o', '_', 's', 't', 'a',
- 'r', 't', ';', 'U', '3', '2', ' ', 't', 'r', 'i', 'm', '_', 'l', 'e', 'f', 't', '=',
- '(', 'U', '3', '2', ')', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 't', 'r',
- 'i', 'm', '_', 'l', 'e', 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'l', 'e', 'n', ')', '<', 'U', '3', '2', '>', 'd', 'i', 'f', 'f', '#',
- '1', '(', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ',', 't', 'r', 'i', 'm', '_', 'l',
- 'e', 'f', 't', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ',
- 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', '=', '(', 'N', 'C', 'B', 'I', ':',
- 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'o', 'u', 't',
- '_', 's', 'i', 'g', 'n', 'a', 'l', '_', 's', 'w', 'a', 'p', 'p', 'e', 'd', ',', 'o',
- 'u', 't', '_', 'x', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 't',
- 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '4', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '2', '.', '1', '.', '3',
- ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o', 'r', '_', 's',
- 'p', 'a', 'c', 'e', '#', '2', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '#', '2', '.',
- '0', '.', '4', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':',
- 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '3', '{', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'F', 'T',
- 'C', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'f', 't', 'c', ';', 'v', 'a',
- 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'F', '3', '2', '>', 'n', 'o', '_', 'c', 'o',
- 'm', 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n', '_', 'f', 't', 'c', ',', 'o', 'u',
- 't', '_', 'f', 't', 'c', ')', ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'F', 'A', 'M', '{', 'r', 'e', 'a',
- 'd', '=', 'o', 'u', 't', '_', 'f', 'a', 'm', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't',
- 'e', '=', '<', 'F', '3', '2', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e',
- '#', '1', '(', 'i', 'n', '_', 'f', 'a', 'm', ',', 'o', 'u', 't', '_', 'f', 'a', 'm',
- ')', ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '1', ' ', 'C', 'Y', '3', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't',
- '_', 'c', 'y', '3', ';', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'F', '3',
- '2', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n',
- '_', 'c', 'y', '3', ',', 'o', 'u', 't', '_', 'c', 'y', '3', ')', ';', '}', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ',
- 'T', 'X', 'R', '{', 'r', 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 't', 'x', 'r', ';',
- 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '=', '<', 'F', '3', '2', '>', 'n', 'o', '_',
- 'c', 'o', 'm', 'p', 'a', 'r', 'e', '#', '1', '(', 'i', 'n', '_', 't', 'x', 'r', ',',
- 'o', 'u', 't', '_', 't', 'x', 'r', ')', ';', '}', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'C', 'Y', '5', '{', 'r',
- 'e', 'a', 'd', '=', 'o', 'u', 't', '_', 'c', 'y', '5', ';', 'v', 'a', 'l', 'i', 'd',
- 'a', 't', 'e', '=', '<', 'F', '3', '2', '>', 'n', 'o', '_', 'c', 'o', 'm', 'p', 'a',
- 'r', 'e', '#', '1', '(', 'i', 'n', '_', 'c', 'y', '5', ',', 'o', 'u', 't', '_', 'c',
- 'y', '5', ')', ';', '}', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'p', 'a', 'n', 'e', 'l', '_', 'c', 'o', 'o',
- 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v',
- 'a', 'l', ')', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a',
- 'c', 't', '_', 'n', 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '6',
- '>', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', ',', 'o', 'u', 't', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 't', 'e', 'x',
- 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'A', 'B', 'I', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o',
- 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm',
- 'e', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'i', 'n', '_',
- 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z',
- 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', 'N', 'A', 'M',
- 'E', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'i', 'n',
- '_', 'f', 't', 'c', '=', 'F', 'T', 'C', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a',
- 'm', 'p', '1', ' ', 'o', 'u', 't', '_', 'f', 't', 'c', '=', '(', 'N', 'C', 'B', 'I',
- ':', 'f', 's', 'a', 'm', 'p', '1', ')', '<', 'F', '3', '2', '>', 'c', 'u', 't', '#',
- '1', '<', '0', '>', '(', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', ')', ';',
- 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'i', 'n', '_', 'f', 'a',
- 'm', '=', 'F', 'A', 'M', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1',
- ' ', 'o', 'u', 't', '_', 'f', 'a', 'm', '=', '(', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '1', ')', '<', 'F', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '0',
- '>', '(', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', ')', ';', 'N', 'C', 'B',
- 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'i', 'n', '_', 'c', 'y', '3', '=', 'C',
- 'Y', '3', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'o', 'u',
- 't', '_', 'c', 'y', '3', '=', '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p',
- '1', ')', '<', 'F', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '1', '>', '(', 'o',
- 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', ')', ';', 'N', 'C', 'B', 'I', ':', 'f',
- 's', 'a', 'm', 'p', '1', ' ', 'i', 'n', '_', 't', 'x', 'r', '=', 'T', 'X', 'R', ';',
- 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'o', 'u', 't', '_', 't',
- 'x', 'r', '=', '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ')', '<',
- 'F', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '2', '>', '(', 'o', 'u', 't', '_',
- 's', 'i', 'g', 'n', 'a', 'l', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm',
- 'p', '1', ' ', 'i', 'n', '_', 'c', 'y', '5', '=', 'C', 'Y', '5', ';', 'N', 'C', 'B',
- 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ' ', 'o', 'u', 't', '_', 'c', 'y', '5', '=',
- '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '1', ')', '<', 'F', '3', '2',
- '>', 'c', 'u', 't', '#', '1', '<', '3', '>', '(', 'o', 'u', 't', '_', 's', 'i', 'g',
- 'n', 'a', 'l', ')', ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ',
- 'i', 'n', '_', 's', 'i', 'g', 'n', 'a', 'l', '=', 'S', 'I', 'G', 'N', 'A', 'L', '|',
- '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'F', '3', '2',
- '>', 'p', 'a', 's', 't', 'e', '#', '1', '(', 'i', 'n', '_', 'f', 't', 'c', ',', 'i',
- 'n', '_', 'c', 'y', '3', ',', 'i', 'n', '_', 't', 'x', 'r', ',', 'i', 'n', '_', 'c',
- 'y', '5', ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ')',
- '<', 'F', '3', '2', '>', 'p', 'a', 's', 't', 'e', '#', '1', '(', 'i', 'n', '_', 'f',
- 'a', 'm', ',', 'i', 'n', '_', 'c', 'y', '3', ',', 'i', 'n', '_', 't', 'x', 'r', ',',
- 'i', 'n', '_', 'c', 'y', '5', ')', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u',
- 't', '_', 's', 'i', 'g', 'n', 'a', 'l', '_', 's', 'w', 'a', 'p', 'p', 'e', 'd', '=',
- '.', 'S', 'I', 'G', 'N', 'A', 'L', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A',
- 'B', 'I', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A',
- 'L', '#', '2', ' ', '.', 'S', 'I', 'G', 'N', 'A', 'L', '=', '(', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm',
- 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', '>', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'i', 'n',
- '_', 's', 'i', 'g', 'n', 'a', 'l', ',', 'i', 'n', '_', 'x', '2', 'c', 's', '_', 'b',
- 'i', 'n', ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a',
- 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I',
- ':', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 's', 'w', 'a', 'p', '#', '1', '(', 'i', 'n', '_', 's', 'i', 'g', 'n', 'a', 'l', ',',
- 'i', 'n', '_', '2', 'c', 's', '_', 'b', 'i', 'n', ')', ';', '}', 't', 'a', 'b', 'l',
- 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'H', 'e', 'l', 'i', 'c', 'o',
- 's', ':', 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.', '4', '=', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '#', '2', '.',
- '1', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e',
- '_', 's', 'p', 'a', 'c', 'e', '#', '2', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', '#', '2', '.', '0', '.', '4', '{', 'r', 'e', 'a', 'd', 'o', 'n', 'l', 'y', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'v', 'a', 'l', ' ', 'C', 'H', 'A', 'N', 'N', 'E', 'L', ' ', '=', ' ', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n',
- 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '7', '>', '(', '_', 'o',
- 'u', 't', '_', 'n', 'a', 'm', 'e', ',', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l',
- 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'F', 'I', 'E', 'L', 'D', ' ', '=', ' ', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'n',
- 'a', 'm', 'e', '_', 'c', 'o', 'o', 'r', 'd', '#', '1', '<', '6', '>', '(', '_', 'o',
- 'u', 't', '_', 'n', 'a', 'm', 'e', ',', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', ')', ';', 'r', 'e', 'a', 'd', 'o', 'n', 'l',
- 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'C', 'A', 'M', 'E', 'R', 'A', ' ', '=', ' ',
- 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ';', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'P', 'O', 'S', ' ', '=', ' ', 'o',
- 'u', 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', ';', 'a', 's', 'c', 'i', 'i', ' ',
- 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'n', 'a', 'm', 'e', '=', '<', 'a', 's',
- 'c', 'i', 'i', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '\'', 'H', 'E', 'L', 'I',
- 'C', 'O', 'S', '\'', '>', '(', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k',
- 'e', 'n', ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_',
- 't', 'o', 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'H', 'e', 'l', 'i',
- 'c', 'o', 's', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't',
- '_', 'n', 'a', 'm', 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e',
- ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'i', 'n', '_', 's',
- 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'H', 'e', 'l', 'i', 'c', 'o', 's', ':', 't', 'o', 'k', 'e',
- 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(',
- 'N', 'A', 'M', 'E', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'z', 'e', 'r', 'o', ' ', 't', 'r', 'i', 'm', '_', 's', 't', 'a', 'r', 't', '=',
- '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o',
- '>', 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 't', 'r', 'i', 'm', '_',
- 'l', 'e', 'n', '=', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'o', 'n', 'T', 'o',
- 'r', 'r', 'e', 'n', 't', ':', 't', 'b', 'l', ':', 'v', '2', '#', '1', '.', '0', '.',
- '3', '=', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 't', 'b', 'l', ':', 's', 'r', 'a', '_', 'n', 'o', 'p', 'o', 's', '#', '2', '.',
- '1', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'b', 'a', 's', 'e',
- '_', 's', 'p', 'a', 'c', 'e', '#', '2', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I',
- ':', 't', 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't',
- 'y', '#', '2', '.', '0', '.', '4', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 't', 'b', 'l', ':', 'c', 'l', 'i', 'p', '#', '1', '.', '0', '.', '2', '{', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't',
- 'e', 'x', 't', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#',
- '1', ' ', 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A', 'R', 'S', ';', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x',
- 't', '>', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ',
- 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', '<', 'N', 'C', 'B', 'I', ':', 'i', 's', 'a', 'm', 'p', '1', '>', 'i',
- 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', 'S', 'I',
- 'G', 'N', 'A', 'L', ';', 'a', 's', 'c', 'i', 'i', ' ', 'p', 'l', 'a', 't', 'f', 'o',
- 'r', 'm', '_', 'n', 'a', 'm', 'e', '=', '<', 'a', 's', 'c', 'i', 'i', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '\'', 'I', 'O', 'N', '_', 'T', 'O', 'R', 'R', 'E', 'N',
- 'T', '\'', '>', '(', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n',
- ' ', 'o', 'u', 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o',
- 'k', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'o', 'n', 'T', 'o', 'r',
- 'r', 'e', 'n', 't', ':', 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o',
- 't', '_', 'n', 'a', 'm', 'e', '#', '1', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm',
- 'e', ')', ';', 't', 'e', 'x', 't', ':', 't', 'o', 'k', 'e', 'n', ' ', 'i', 'n', '_',
- 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '_', 't', 'o', 'k', '=', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'o', 'n', 'T', 'o', 'r', 'r', 'e', 'n', 't', ':',
- 't', 'o', 'k', 'e', 'n', 'i', 'z', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm',
- 'e', '#', '1', '(', 'N', 'A', 'M', 'E', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'p',
- 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'o', 'u', 't', '_', 'p',
- 'o', 's', 'i', 't', 'i', 'o', 'n', '=', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N',
- ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'o', 'n', 'T', 'o', 'r', 'r', 'e',
- 'n', 't', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'P', 'O', 'S', 'I', 'T',
- 'I', 'O', 'N', '#', '1', ' ', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', '=', 'P',
- 'O', 'S', 'I', 'T', 'I', 'O', 'N', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o',
- 'r', 'd', ':', 'o', 'n', 'e', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o', 'd',
- 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T',
- 'E', 'R', '_', 'L', 'E', 'F', 'T', '=', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P',
- 'T', 'E', 'R', '_', 'L', 'E', 'F', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'i', 'z', 'i', 'p', '_', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P',
- 'T', 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T', '=', 'C', 'L', 'I', 'P', '_', 'A', 'D',
- 'A', 'P', 'T', 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T', ';', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'i', 'z', 'i', 'p', '_', 'e',
- 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'Q',
- 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'L', 'E', 'F', 'T', '=', 'C', 'L', 'I', 'P', '_',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'L', 'E', 'F', 'T', ';', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'o', 'n', 'e', '>', 'i', 'z', 'i', 'p', '_',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_',
- 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'I', 'G', 'H', 'T', '=', 'C', 'L', 'I',
- 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'I', 'G', 'H', 'T', ';', '}',
- 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4',
- '5', '4', '_', ':', 'l', 'e', 'g', 'a', 'c', 'y', '#', '1', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'r', 'a', '_', 'n', 'o', 'p', 'o',
- 's', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':',
- 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#',
- '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h',
- 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o', 'c', 'o', 'l',
- '#', '1', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't',
- 'b', 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '#', '1', '.', '0', '.', '1',
- ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'c',
- 'o', 'm', 'm', 'o', 'n', '#', '1', '.', '0', '.', '4', '{', 'r', 'e', 'a', 'd', 'o',
- 'n', 'l', 'y', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'R', 'E', 'G', 'I', 'O', 'N', ' ',
- '=', ' ', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a',
- 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '2', '>', '(', 'c',
- 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'k', 'e', 'y', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o',
- 'u', 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c',
- 'u', 't', '#', '1', '<', '0', '>', '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r',
- 'o', 'm', '_', 's', 'k', 'e', 'y', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o',
- 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v',
- 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '1', '>', '(',
- 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'k', 'e', 'y', ')',
- ';', 'I', '3', '2', '[', '3', ']', ' ', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r',
- 'o', 'm', '_', 's', 'k', 'e', 'y', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'c', 'o', 'o', 'r', 'd', 'i', 'n', 'a', 't',
- 'e', 's', '#', '1', '<', '1', '>', '(', 'o', 'u', 't', '_', 's', 'k', 'e', 'y', ')',
- ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- '_', '4', '5', '4', '_', ':', 't', 'b', 'l', ':', 'v', '0', '#', '1', '=', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'l', 'e', 'g', 'a',
- 'c', 'y', '#', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', '=', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'u', 'n', 't', 'y',
- 'p', 'e', 'd', '_', '0', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A',
- ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'o', 'u', 't', '_',
- 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S',
- 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', '>', 'e', 'c',
- 'h', 'o', '#', '1', '<', '1', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', '2',
- 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't', '_', '2', 'n', 'a',
- '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '.', 'R', 'E', 'A', 'D', ';', 'I', 'N', 'S',
- 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ',
- 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', '.', 'Q',
- 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_',
- 'l', 'a', 'b', 'e', 'l', '=', '<', 'a', 's', 'c', 'i', 'i', '>', 'e', 'x', 'i', 's',
- 't', 's', '#', '1', '<', '\'', 'A', 'd', 'a', 'p', 't', 'e', 'r', 'M', 'a', 't',
- 'e', '1', 'L', 'i', 'n', 'k', 'e', 'r', 'M', 'a', 't', 'e', '2', '\'', '>', '(',
- 'o', 'u', 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n',
- 'c', 'e', ')', '|', '<', 'a', 's', 'c', 'i', 'i', '>', 'e', 'c', 'h', 'o', '#', '1',
- '<', '\'', 'A', 'd', 'a', 'p', 't', 'e', 'r', 'F', 'r', 'a', 'g', 'm', 'e', 'n',
- 't', '\'', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'z', 'e', 'r', 'o', ' ', 'o', 'u', 't', '_', 'l', 'a', 'b', 'e', 'l', '_',
- 's', 't', 'a', 'r', 't', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'z', 'e', 'r', 'o', '>', 'e', 'x', 'i', 's', 't', 's', '#', '1', '<', '[',
- '0', ',', '7', ',', '1', '2', ',', '1', '8', ']', '>', '(', 'o', 'u', 't', '_', 'l',
- 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ')', '|', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', '>',
- 'e', 'c', 'h', 'o', '#', '1', '<', '[', '0', ',', '7', ']', '>', '(', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 'o', 'u',
- 't', '_', 'l', 'a', 'b', 'e', 'l', '_', 'l', 'e', 'n', '=', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', '>', 'e', 'x', 'i', 's', 't',
- 's', '#', '1', '<', '[', '7', ',', '5', ',', '6', ',', '5', ']', '>', '(', 'o', 'u',
- 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e',
- ')', '|', '<', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e',
- 'n', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '[', '7', ',', '8', ']', '>', '(', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o',
- 'u', 't', '_', 'f', 'l', 'o', 'w', '_', 'c', 'h', 'a', 'r', 's', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'e', 't', 'a',
- ':', 'r', 'e', 'a', 'd', '#', '1', '<', '\'', 'M', 'S', 'C', '4', '5', '4', '_',
- 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A', 'R', 'S', '\'', '>', '(', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u', 't',
- '_', 'k', 'e', 'y', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', '=', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', '>', 'm', 'e', 't', 'a',
- ':', 'r', 'e', 'a', 'd', '#', '1', '<', '\'', 'M', 'S', 'C', '4', '5', '4', '_',
- 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', '\'', '>', '(', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o',
- 'u', 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c',
- 'e', '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't',
- '>', 'm', 'e', 't', 'a', ':', 'r', 'e', 'a', 'd', '#', '1', '<', '\'', 'M', 'S',
- 'C', '4', '5', '4', '_', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E',
- 'N', 'C', 'E', '\'', '>', '(', ')', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'p', 'o', 's', '1', '6', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i',
- 'o', 'n', '1', '6', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5',
- '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's', '_', 'p', 'o', 's', 'i', 't', 'i',
- 'o', 'n', '#', '1', '(', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ',', '.', 'R',
- 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ',', '.', 'S', 'I', 'G', 'N', 'A', 'L', ')',
- '|', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'p',
- 'r', 'o', 'c', 'e', 's', 's', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '#', '1',
- '(', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ',', '.', 'R', 'D', '_', 'F', 'I',
- 'L', 'T', 'E', 'R', ')', '|', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4',
- '5', '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's', '_', 'p', 'o', 's', 'i', 't',
- 'i', 'o', 'n', '#', '1', '(', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', ':', 'o', 'n',
- 'e', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '=', 'c', 'a',
- 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n',
- '1', '6', ')', ';', 'U', '3', '2', '[', '3', ']', ' ', 'd', 'y', 'n', 'a', 'm', 'i',
- 'c', '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'y', 'n', 'a', 'm', 'i', 'c',
- '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', '#', '1', '<', '4', '>', '(', 'o',
- 'u', 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ',', 'o', 'u', 't', '_', 'k', 'e',
- 'y', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ',', 'o', 'u', 't', '_', 'l', 'i',
- 'n', 'k', 'e', 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ')', '|', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'd', 'y', 'n', 'a',
- 'm', 'i', 'c', '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', '#', '1', '(', 'o',
- 'u', 't', '_', '2', 'n', 'a', '_', 'b', 'i', 'n', ',', 'o', 'u', 't', '_', 'k', 'e',
- 'y', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ')', ';', 'U', '8', ' ', 'o', 'u',
- 't', '_', 'n', 'r', 'e', 'a', 'd', 's', '=', '<', 'U', '8', '>', 'e', 'x', 'i', 's',
- 't', 's', '#', '1', '<', '4', '>', '(', 'o', 'u', 't', '_', 'l', 'i', 'n', 'k', 'e',
- 'r', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', ')', '|', '<', 'U', '8', '>', 'e',
- 'c', 'h', 'o', '#', '1', '<', '2', '>', '(', ')', ';', 'U', '3', '2', ' ', 'r', 'e',
- 'a', 'd', '_', 't', 'y', 'p', 'e', '3', '2', '=', '<', 'U', '3', '2', '>', 'c', 'u',
- 't', '#', '1', '<', '0', '>', '(', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r', 'e',
- 'a', 'd', '_', 'd', 'e', 's', 'c', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R',
- 'A', ':', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', ' ', 'o', 'u', 't', '_', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '=', 'c', 'a', 's', 't', '#', '1', '(', 'r',
- 'e', 'a', 'd', '_', 't', 'y', 'p', 'e', '3', '2', ')', ';', 'U', '3', '2', ' ', 'u',
- 'r', 'e', 'a', 'd', '_', 's', 't', 'a', 'r', 't', '=', '<', 'U', '3', '2', '>', 'c',
- 'u', 't', '#', '1', '<', '1', '>', '(', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r',
- 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a',
- 'd', '_', 's', 't', 'a', 'r', 't', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o',
- 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', 'u', 'r', 'e', 'a', 'd', '_', 's', 't',
- 'a', 'r', 't', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l',
- 'e', 'n', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e', 'n', '=', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ')', '<',
- 'U', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '2', '>', '(', 'd', 'y', 'n', 'a',
- 'm', 'i', 'c', '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't',
- 'e', 'r', ' ', 'o', 'u', 't', '_', 'r', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '=',
- '.', 'R', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', '|', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '>',
- 'e', 'c', 'h', 'o', '#', '1', '<', '0', '>', '(', 'd', 'y', 'n', 'a', 'm', 'i', 'c',
- '_', 'r', 'e', 'a', 'd', '_', 'd', 'e', 's', 'c', ')', ';', 'p', 'h', 'y', 's', 'i',
- 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g',
- ':', 'C', 'L', 'I', 'P', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A',
- 'P', 'T', 'E', 'R', '_', 'L', 'E', 'F', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a',
- 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C',
- 'L', 'I', 'P', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'A', 'D', 'A', 'P', 'T',
- 'E', 'R', '_', 'R', 'I', 'G', 'H', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L',
- 'I', 'P', '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T',
- 'Y', '_', 'L', 'E', 'F', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c',
- 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4',
- '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'C', 'L', 'I', 'P',
- '#', '1', ' ', '.', 'C', 'L', 'I', 'P', '_', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '_',
- 'R', 'I', 'G', 'H', 'T', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5',
- '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'R', 'E', 'A', 'D', '#',
- '1', ' ', '.', 'R', 'E', 'A', 'D', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ',
- 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_',
- '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A',
- 'L', 'I', 'T', 'Y', '#', '1', ' ', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'e', 'n', 'c', 'o',
- 'd', 'i', 'n', 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '1', ' ', '.', 'S', 'I',
- 'G', 'N', 'A', 'L', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4',
- '_', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'P', 'O', 'S', 'I', 'T', 'I',
- 'O', 'N', '#', '1', ' ', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ';', '}', 't',
- 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5',
- '4', '_', ':', 't', 'b', 'l', ':', 'v', '1', '#', '1', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'l', 'e', 'g', 'a', 'c', 'y', '#',
- '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p',
- 'o', 't', 'd', 'e', 's', 'c', '_', 'n', 'o', 'p', 'h', 'y', 's', '#', '1', '.', '0',
- '.', '2', '{', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't',
- 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'o', 'u', 't', '_', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '=', '.', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '|', '<', 'I', 'N',
- 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_',
- 'i', 'd', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '1', '>', '(', ')', ';', 'I', 'N',
- 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u',
- 't', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '.', 'R', 'E', 'A',
- 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p',
- 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r',
- 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u', 't', '_', 'f', 'l', 'o',
- 'w', '_', 'c', 'h', 'a', 'r', 's', '=', '.', 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A',
- 'R', 'S', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't',
- ' ', 'o', 'u', 't', '_', 'k', 'e', 'y', '_', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e',
- '=', '.', 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'p', 'o', 's', '1', '6', ' ', 'o', 'u', 't', '_',
- 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '1', '6', '=', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's', '_',
- 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '#', '1', '(', '.', 'P', 'O', 'S', 'I', 'T',
- 'I', 'O', 'N', ',', '.', 'R', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ',', '.', 'S',
- 'I', 'G', 'N', 'A', 'L', ')', '|', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_',
- '4', '5', '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's', '_', 'p', 'o', 's', 'i',
- 't', 'i', 'o', 'n', '#', '1', '(', '.', 'P', 'O', 'S', 'I', 'T', 'I', 'O', 'N', ',',
- '.', 'R', 'D', '_', 'F', 'I', 'L', 'T', 'E', 'R', ')', '|', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 'p', 'r', 'o', 'c', 'e', 's', 's',
- '_', 'p', 'o', 's', 'i', 't', 'i', 'o', 'n', '#', '1', '(', '.', 'P', 'O', 'S', 'I',
- 'T', 'I', 'O', 'N', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'p', 'o', 's', 'i', 't',
- 'i', 'o', 'n', ':', 'o', 'n', 'e', ' ', 'o', 'u', 't', '_', 'p', 'o', 's', 'i', 't',
- 'i', 'o', 'n', '=', 'c', 'a', 's', 't', '#', '1', '(', 'o', 'u', 't', '_', 'p', 'o',
- 's', 'i', 't', 'i', 'o', 'n', '1', '6', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 't', 'b',
- 'l', ':', 'v', '1', '_', '2', 'a', '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', '_', '4', '5', '4', '_', ':', 't', 'b', 'l', ':', 'v', '1', '#', '1', '{',
- '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', '_', '4', '5', '4', '_', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '1',
- '_', '2', 'a', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't',
- 'e', 'x', 't', ' ', 'o', 'u', 't', '_', 'l', 'i', 'n', 'k', 'e', 'r', '_', 's', 'e',
- 'q', 'u', 'e', 'n', 'c', 'e', '=', '.', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E',
- 'Q', 'U', 'E', 'N', 'C', 'E', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', '_', '4', '5', '4', '_', ':', 't', 'b', 'l', ':', 'v',
- '1', '_', '2', 'b', '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_',
- '4', '5', '4', '_', ':', 't', 'b', 'l', ':', 'v', '1', '#', '1', '{', '_', '_', 'u',
- 'n', 't', 'y', 'p', 'e', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', '_',
- '4', '5', '4', '_', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '1', '_', '2', 'b',
- '(', ')', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'l', 'e', 'g', 'a', 'c', 'y',
- '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'b', 'a', 's', 'e', '_', 's', 'p', 'a', 'c', 'e', '_', 'n', 'o', 'c', 'o', 'l',
- '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I',
- 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.',
- '0', '.', '3', '{', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f',
- 's', 'a', 'm', 'p', '4', ' ', 'S', 'I', 'G', 'N', 'A', 'L', ' ', '=', ' ', '(', 'N',
- 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p',
- '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1',
- '(', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', ',', 'o', 'u', 't', '_', 'x',
- '2', 'n', 'a', '_', 'b', 'i', 'n', ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'o',
- 't', 'a', 't', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', '#', '1', '<', 'f', 'a', 'l',
- 's', 'e', '>', '(', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', ',', 'o', 'u',
- 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'c', 'o', 'l', 'u', 'm',
- 'n', ' ', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'I', 'N', 'T',
- 'E', 'N', 'S', 'I', 'T', 'Y', ' ', '=', ' ', '<', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'd', 'e', 'n',
- 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', '#', '1', '(', 'o', 'u', 't', '_', 'n', 'o',
- 'r', 'm', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'o', 'u', 't', '_',
- 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', 'c', 'o', 'l', 'u', 'm', 'n', ' ',
- 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'N', 'O', 'I', 'S', 'E',
- ' ', '=', ' ', 'o', 'u', 't', '_', 'n', 'o', 'i', 's', 'e', ';', 'N', 'C', 'B', 'I',
- ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 'n', 'o', 'r', 'm', '_',
- 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', '=', '(', 'N', 'C', 'B', 'I', ':', 'f',
- 's', 'a', 'm', 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's',
- 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', '#', '1', '(', 'o', 'u', 't', '_',
- 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'o', 'u', 't', '_', 'x', '2', 'n',
- 'a', '_', 'b', 'i', 'n', ')', '|', '(', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm',
- 'p', '4', ')', '<', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a',
- 't', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', '>', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', '#', '1', '<', 'f', 'a', 'l', 's', 'e',
- '>', '(', 'o', 'u', 't', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', ',', 'o',
- 'u', 't', '_', 'x', '2', 'n', 'a', '_', 'b', 'i', 'n', ')', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '0', '#', '1', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'l', 'e', 'g',
- 'a', 'c', 'y', '#', '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b',
- 'l', ':', 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '#', '1', '.', '0', '.', '1', '{',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r',
- 'm', '_', 'i', 'd', ' ', 'o', 'u', 't', '_', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm',
- '=', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f',
- 'o', 'r', 'm', '_', 'i', 'd', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '2', '>', '(',
- ')', ';', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u', 't', '_', 's', 'l', 'x', '_', 'p',
- 'r', 'e', 'f', 'i', 'x', '=', '<', 'a', 's', 'c', 'i', 'i', '>', 'm', 'e', 't', 'a',
- ':', 'r', 'e', 'a', 'd', '#', '1', '<', '\'', 'S', 'L', 'X', '_', 'P', 'R', 'E',
- 'F', 'I', 'X', '\'', '>', '(', ')', '|', '<', 'a', 's', 'c', 'i', 'i', '>', 'e',
- 'c', 'h', 'o', '#', '1', '<', '\'', '\'', '>', '(', ')', ';', 'a', 's', 'c', 'i',
- 'i', ' ', 'r', 'e', 'w', 'r', 'i', 't', 't', 'e', 'n', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'w',
- 'r', 'i', 't', 'e', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '#', '1', '<',
- '2', '>', '(', 'o', 'u', 't', '_', 's', 'k', 'e', 'y', ',', 'o', 'u', 't', '_', 's',
- 'l', 'x', '_', 'p', 'r', 'e', 'f', 'i', 'x', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'y', '_', 'c',
- 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '0',
- '>', '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'k', 'e',
- 'y', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a',
- 'l', ' ', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I', '3',
- '2', '>', 'c', 'u', 't', '#', '1', '<', '1', '>', '(', 'c', 'o', 'o', 'r', 'd', 's',
- '_', 'f', 'r', 'o', 'm', '_', 's', 'k', 'e', 'y', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 't', 'i',
- 'l', 'e', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't',
- '#', '1', '<', '2', '>', '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm',
- '_', 's', 'k', 'e', 'y', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'l', 'a', 'n', 'e', '_', 'c', 'o',
- 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':',
- 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '3', '>',
- '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'k', 'e', 'y',
- ')', ';', 'I', '3', '2', '[', '4', ']', ' ', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f',
- 'r', 'o', 'm', '_', 's', 'k', 'e', 'y', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'c', 'o', 'o', 'r', 'd', 'i', 'n', 'a',
- 't', 'e', 's', '#', '1', '<', '2', '>', '(', 'o', 'u', 't', '_', 's', 'k', 'e', 'y',
- ')', ';', 'I', 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e',
- 'd', ' ', 'o', 'u', 't', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=',
- '.', 'R', 'E', 'A', 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd',
- ':', 'l', 'e', 'n', ' ', 's', 't', 'a', 't', 'i', 'c', '_', 'f', 'i', 'x', 'e', 'd',
- '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', 's', 'p', 'o', 't', '_', 'l', 'e',
- 'n', ';', 'U', '8', ' ', 'o', 'u', 't', '_', 'n', 'r', 'e', 'a', 'd', 's', '=', '<',
- 'U', '8', '>', 'm', 'e', 't', 'a', ':', 'v', 'a', 'l', 'u', 'e', '#', '1', '<', '\'',
- 'N', 'R', 'E', 'A', 'D', 'S', '\'', '>', '(', ')', '|', '<', 'U', '8', '>', 'e',
- 'c', 'h', 'o', '#', '1', '<', '1', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ' ', 'o', 'u', 't', '_', 'r', 'e',
- 'a', 'd', '_', 's', 't', 'a', 'r', 't', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', ')', '<', 'U', '3', '2', '>', 'c', 'u',
- 't', '#', '1', '<', '1', '>', '(', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '_', 'f',
- 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', 'n', ')', '|', '<', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'z', 'e', 'r', 'o', '>', 'e', 'c', 'h', 'o', '#',
- '1', '<', '0', '>', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r',
- 'd', ':', 'l', 'e', 'n', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 'l', 'e',
- 'n', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e',
- 'n', ')', '<', 'U', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '2', '>', '(', 'r',
- 'e', 'a', 'd', '_', 's', 'e', 'g', '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd',
- 'n', ')', '|', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ';', 'U', '3', '2', '[', '5',
- ']', ' ', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '_', 'f', 'r', 'o', 'm', '_', 'r',
- 'e', 'a', 'd', 'n', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a',
- 'd', '_', 's', 'e', 'g', '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', 'n', '#',
- '1', '(', 'o', 'u', 't', '_', 'n', 'r', 'e', 'a', 'd', 's', ',', 's', 'p', 'o', 't',
- '_', 'l', 'e', 'n', ')', ';', 'U', '3', '2', ' ', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', '=',
- '<', 'U', '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '0', '>', '(', 'r', 'e', 'a',
- 'd', '_', 's', 'e', 'g', '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', 'n', ')',
- ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 't',
- 'y', 'p', 'e', ' ', 'o', 'u', 't', '_', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e',
- '=', 'c', 'a', 's', 't', '#', '1', '(', 'r', 'e', 'a', 'd', '_', 't', 'y', 'p', 'e',
- '_', 'f', 'r', 'o', 'm', '_', 'r', 'e', 'a', 'd', '_', 's', 'e', 'g', ')', '|', '(',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'r', 'e', 'a', 'd', '_', 't', 'y',
- 'p', 'e', ')', '<', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'x', 'r', 'e',
- 'a', 'd', '_', 't', 'y', 'p', 'e', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '1', '>',
- '(', ')', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't',
- 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 's', 'i', 'g',
- 'n', 'a', 'l', '=', '.', 'S', 'I', 'G', 'N', 'A', 'L', ';', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p',
- '4', ' ', 'o', 'u', 't', '_', 'i', 'n', 't', 'e', 'n', 's', 'i', 't', 'y', '=', '.',
- 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', ';', 'N', 'C', 'B', 'I', ':', 'f', 's',
- 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 'n', 'o', 'i', 's', 'e', '=', '.', 'N',
- 'O', 'I', 'S', 'E', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u',
- 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'R', 'E', 'A',
- 'D', '#', '1', ' ', '.', 'R', 'E', 'A', 'D', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a',
- 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A',
- ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n',
- 'g', ':', 'S', 'I', 'G', 'N', 'A', 'L', '#', '1', ' ', '.', 'S', 'I', 'G', 'N', 'A',
- 'L', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'I', 'N', 'T', 'E', 'N', 'S',
- 'I', 'T', 'Y', '#', '1', ' ', '.', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y', ';',
- 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'N', 'O', 'I', 'S', 'E', '#', '1', ' ',
- '.', 'N', 'O', 'I', 'S', 'E', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b',
- 'l', ':', 'v', '0', 'a', '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':',
- 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '0', '#', '1',
- ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 'q', 'u', 'a', 'l', '4', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0',
- '.', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', '=', 'N', 'C', 'B', 'I',
- ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'u', 'n', 't',
- 'y', 'p', 'e', 'd', '_', '0', 'a', '(', ')', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'r', 'o', 't', 'a', 't', 'e', 'd', '_', 'q', 'u', 'a', 'l', '4', ' ', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 'r', 'o', 't', 'a', 't', 'e', 'd', '=',
- '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u',
- 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q',
- 'u', 'a', 'l', '2', '_', 'p', 'h', 'r', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I',
- 'T', 'Y', '2', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u',
- 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A', 'L',
- 'I', 'T', 'Y', '#', '1', ' ', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'p', 'h',
- 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n',
- 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', '#', '1',
- ' ', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', ';', '}', 't', 'a', 'b', 'l', 'e',
- ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n',
- 'a', ':', 't', 'b', 'l', ':', 'v', '0', 'b', '#', '1', '=', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':',
- 'v', '0', '#', '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'p', 'h', 'r',
- 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o', 'c', 'o', 'l', '#',
- '1', '.', '0', '.', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '0', 'b', '(', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r', 'e', 'd', ' ', 'o',
- 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd', '=', '.', 'Q', 'U',
- 'A', 'L', 'I', 'T', 'Y', '|', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', ';', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C',
- 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e',
- 'n', 'c', 'o', 'd', 'i', 'n', 'g', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', '#',
- '1', ' ', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'p', 'h', 'y', 's', 'i', 'c',
- 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R',
- 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'e', 'n', 'c', 'o', 'd', 'i',
- 'n', 'g', ':', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', '#', '1', ' ', '.', 'Q', 'U',
- 'A', 'L', 'I', 'T', 'Y', '2', ';', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b',
- 'l', ':', 'v', '1', '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I',
- 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'l', 'e', 'g', 'a', 'c', 'y', '#', '1', ',',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'p', 'o', 't',
- 'd', 'e', 's', 'c', '_', 'n', 'o', 'p', 'h', 'y', 's', '#', '1', '.', '0', '.', '2',
- ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's', 'k', 'e',
- 'y', 'n', 'a', 'm', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '2', '.', '0', '.', '1',
- '{', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o',
- 'r', 'm', '_', 'i', 'd', ' ', 'o', 'u', 't', '_', 'p', 'l', 'a', 't', 'f', 'o', 'r',
- 'm', '=', '.', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '|', '<', 'I', 'N', 'S', 'D',
- 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd',
- '>', 'e', 'c', 'h', 'o', '#', '1', '<', '2', '>', '(', ')', ';', 'I', 'N', 'S', 'D',
- 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 't',
- 'i', 'l', 'e', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':',
- 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u',
- 't', '#', '1', '<', '2', '>', '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o',
- 'm', '_', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', ')', ';', 'I', 'N', 'S', 'D', 'C',
- ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o', 'u', 't', '_', 'l', 'a',
- 'n', 'e', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I', '3', '2', '>', 'c', 'u', 't',
- '#', '1', '<', '3', '>', '(', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm',
- '_', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', ')', ';', 'I', '3', '2', '[', '4', ']',
- ' ', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'p', 'o', 't',
- 'n', 'a', 'm', 'e', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'e', 'x', 't',
- 'r', 'a', 'c', 't', '_', 'c', 'o', 'o', 'r', 'd', 'i', 'n', 'a', 't', 'e', 's', '#',
- '1', '<', '2', '>', '(', '_', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', ')', ';', 'I',
- 'N', 'S', 'D', 'C', ':', '2', 'n', 'a', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o',
- 'u', 't', '_', '2', 'n', 'a', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '.', 'R', 'E',
- 'A', 'D', ';', 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':',
- 'p', 'h', 'r', 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '2', '_', 'p',
- 'h', 'r', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', '2', ';', 'I', 'N',
- 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 's', 't', 'a',
- 't', 'i', 'c', '_', 'f', 'i', 'x', 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e',
- 'n', '=', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', ';', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4',
- ' ', 'o', 'u', 't', '_', 's', 'i', 'g', 'n', 'a', 'l', '=', '.', 'S', 'I', 'G', 'N',
- 'A', 'L', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p',
- 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_', 'i', 'n', 't',
- 'e', 'n', 's', 'i', 't', 'y', '=', '.', 'I', 'N', 'T', 'E', 'N', 'S', 'I', 'T', 'Y',
- ';', 'N', 'C', 'B', 'I', ':', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_',
- 'n', 'o', 'i', 's', 'e', '=', '.', 'N', 'O', 'I', 'S', 'E', ';', 'p', 'h', 'y', 's',
- 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C',
- ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', '.', 'F', 'L', 'O', 'W', '_', 'C',
- 'H', 'A', 'R', 'S', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l',
- 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x',
- 't', ' ', '.', 'K', 'E', 'Y', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';', 'p',
- 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N',
- 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', '.', 'L', 'I', 'N',
- 'K', 'E', 'R', '_', 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';', '}', 't', 'a', 'b',
- 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '1', 'a', '#', '1', '=', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 't', 'b',
- 'l', ':', 'v', '1', '#', '1', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I',
- 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':', 'q', 'u', 'a', 'l', '4', '_', 'n', 'o', 'c',
- 'o', 'l', '#', '1', '.', '0', '.', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p', 'e',
- 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i',
- 'n', 'a', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '1', 'a', '(', ')', ';', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w', 'a', 'p', 'p', 'e', 'd', '_', 'q',
- 'u', 'a', 'l', '4', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '4', '_', 's', 'w',
- 'a', 'p', 'p', 'e', 'd', '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', '}', 't',
- 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l',
- 'u', 'm', 'i', 'n', 'a', ':', 't', 'b', 'l', ':', 'v', '1', 'b', '#', '1', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm', 'i', 'n', 'a', ':',
- 't', 'b', 'l', ':', 'v', '1', '#', '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l',
- ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_', 'n', 'o',
- 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p',
- 'e', 'd', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'I', 'l', 'l', 'u', 'm',
- 'i', 'n', 'a', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd', '_', '1', 'b', '(', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r',
- 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd',
- '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', '}', 't', 'a', 'b', 'l', 'e', ' ',
- 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 'l', 'e', 'g', 'a',
- 'c', 'y', '#', '1', '=', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l',
- ':', 's', 'r', 'a', '#', '1', '.', '0', '.', '3', ',', 'N', 'C', 'B', 'I', ':', 't',
- 'b', 'l', ':', 'p', 'h', 'r', 'e', 'd', '_', 'q', 'u', 'a', 'l', 'i', 't', 'y', '_',
- 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0', '.', '1', ',', 'N', 'C', 'B', 'I', ':',
- 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 'c', 'o', 'm', 'm', 'o', 'n', '#', '1', '.',
- '0', '.', '3', '{', '}', 't', 'a', 'b', 'l', 'e', ' ', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'A', 'B', 'I', ':', 't', 'b', 'l', ':', 'v', '1', '#', '1', '=', 'N',
- 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 'l', 'e', 'g', 'a', 'c',
- 'y', '#', '1', ',', 'N', 'C', 'B', 'I', ':', 't', 'b', 'l', ':', 'c', 'o', 'l', 'o',
- 'r', '_', 's', 'p', 'a', 'c', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '1', '.', '0',
- '.', '3', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':', 's',
- 'p', 'o', 't', 'd', 'e', 's', 'c', '_', 'n', 'o', 'p', 'h', 'y', 's', '#', '1', '.',
- '0', '.', '2', ',', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 't', 'b', 'l', ':',
- 's', 'k', 'e', 'y', 'n', 'a', 'm', 'e', '_', 'n', 'o', 'c', 'o', 'l', '#', '2', '.',
- '0', '.', '1', '{', '_', '_', 'u', 'n', 't', 'y', 'p', 'e', 'd', '=', 'N', 'C', 'B',
- 'I', ':', 'S', 'R', 'A', ':', 'A', 'B', 'I', ':', 'u', 'n', 't', 'y', 'p', 'e', 'd',
- '_', '1', '(', ')', ';', 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l',
- 'a', 't', 'f', 'o', 'r', 'm', '_', 'i', 'd', ' ', 'o', 'u', 't', '_', 'p', 'l', 'a',
- 't', 'f', 'o', 'r', 'm', '=', '.', 'P', 'L', 'A', 'T', 'F', 'O', 'R', 'M', '|', '<',
- 'I', 'N', 'S', 'D', 'C', ':', 'S', 'R', 'A', ':', 'p', 'l', 'a', 't', 'f', 'o', 'r',
- 'm', '_', 'i', 'd', '>', 'e', 'c', 'h', 'o', '#', '1', '<', '3', '>', '(', ')', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ' ', 'o',
- 'u', 't', '_', 'p', 'a', 'n', 'e', 'l', '_', 'c', 'o', 'o', 'r', 'd', '=', '(', 'I',
- 'N', 'S', 'D', 'C', ':', 'c', 'o', 'o', 'r', 'd', ':', 'v', 'a', 'l', ')', '<', 'I',
- '3', '2', '>', 'c', 'u', 't', '#', '1', '<', '2', '>', '(', 'c', 'o', 'o', 'r', 'd',
- 's', '_', 'f', 'r', 'o', 'm', '_', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', ')', ';',
- 'I', '3', '2', '[', '4', ']', ' ', 'c', 'o', 'o', 'r', 'd', 's', '_', 'f', 'r', 'o',
- 'm', '_', 's', 'p', 'o', 't', 'n', 'a', 'm', 'e', '=', 'N', 'C', 'B', 'I', ':', 'S',
- 'R', 'A', ':', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 'c', 'o', 'o', 'r', 'd', 'i',
- 'n', 'a', 't', 'e', 's', '#', '1', '<', '3', '>', '(', 'o', 'u', 't', '_', 's', 'p',
- 'o', 't', '_', 'n', 'a', 'm', 'e', ')', ';', 'a', 's', 'c', 'i', 'i', ' ', 'o', 'u',
- 't', '_', 's', 'p', 'o', 't', '_', 'n', 'a', 'm', 'e', '=', 'I', 'N', 'S', 'D', 'C',
- ':', 'S', 'R', 'A', ':', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'p', 'o', 't', '_',
- 'n', 'a', 'm', 'e', '#', '1', '(', 'o', 'u', 't', '_', 'n', 'a', 'm', 'e', '_', 'f',
- 'm', 't', ',', 'o', 'u', 't', '_', 'x', '_', 'c', 'o', 'o', 'r', 'd', ',', 'o', 'u',
- 't', '_', 'y', '_', 'c', 'o', 'o', 'r', 'd', ')', ';', 'I', 'N', 'S', 'D', 'C', ':',
- '2', 'c', 's', ':', 'p', 'a', 'c', 'k', 'e', 'd', ' ', 'o', 'u', 't', '_', '2', 'c',
- 's', '_', 'p', 'a', 'c', 'k', 'e', 'd', '=', '.', 'C', 'S', 'R', 'E', 'A', 'D', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', 'o', 'u',
- 't', '_', 'c', 's', '_', 'k', 'e', 'y', '=', '.', 'C', 'S', '_', 'K', 'E', 'Y', ';',
- 'I', 'N', 'S', 'D', 'C', ':', 'q', 'u', 'a', 'l', 'i', 't', 'y', ':', 'p', 'h', 'r',
- 'e', 'd', ' ', 'o', 'u', 't', '_', 'q', 'u', 'a', 'l', '_', 'p', 'h', 'r', 'e', 'd',
- '=', '.', 'Q', 'U', 'A', 'L', 'I', 'T', 'Y', ';', 'I', 'N', 'S', 'D', 'C', ':', 'c',
- 'o', 'o', 'r', 'd', ':', 'l', 'e', 'n', ' ', 's', 't', 'a', 't', 'i', 'c', '_', 'f',
- 'i', 'x', 'e', 'd', '_', 's', 'p', 'o', 't', '_', 'l', 'e', 'n', '=', 's', 'p', 'o',
- 't', '_', 'l', 'e', 'n', ';', 'N', 'C', 'B', 'I', ':', 'S', 'R', 'A', ':', 's', 'w',
- 'a', 'p', 'p', 'e', 'd', '_', 'f', 's', 'a', 'm', 'p', '4', ' ', 'o', 'u', 't', '_',
- 's', 'i', 'g', 'n', 'a', 'l', '_', 's', 'w', 'a', 'p', 'p', 'e', 'd', '=', '.', 'S',
- 'I', 'G', 'N', 'A', 'L', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o',
- 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e',
- 'x', 't', ' ', '.', 'F', 'L', 'O', 'W', '_', 'C', 'H', 'A', 'R', 'S', ';', 'p', 'h',
- 'y', 's', 'i', 'c', 'a', 'l', ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S',
- 'D', 'C', ':', 'd', 'n', 'a', ':', 't', 'e', 'x', 't', ' ', '.', 'K', 'E', 'Y', '_',
- 'S', 'E', 'Q', 'U', 'E', 'N', 'C', 'E', ';', 'p', 'h', 'y', 's', 'i', 'c', 'a', 'l',
- ' ', 'c', 'o', 'l', 'u', 'm', 'n', ' ', 'I', 'N', 'S', 'D', 'C', ':', 'd', 'n', 'a',
- ':', 't', 'e', 'x', 't', ' ', '.', 'L', 'I', 'N', 'K', 'E', 'R', '_', 'S', 'E', 'Q',
- 'U', 'E', 'N', 'C', 'E', ';', '}',
-};
-const size_t sra_schema_size = 68751;
diff --git a/libs/sra/sracache.c b/libs/sra/sracache.c
deleted file mode 100644
index dd84389..0000000
--- a/libs/sra/sracache.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-#include <sra/sradb-priv.h>
-
-#include <klib/rc.h>
-#include <kproc/lock.h>
-#include <klib/refcount.h>
-#include <kfg/config.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <strtol.h>
-
-#include "sra-priv.h"
-
-/* some of the above #defines index on sun */
-#ifdef index
-    #undef index
-#endif
-
-/*================================== SRACacheMetrics ==================================*/
-static
-void 
-MetricsInit(SRACacheMetrics* self, const SRATable* table)
-{
-    self->bytes     = 0;/* TBD */
-    self->elements  = 1;
-    self->threads   = 0;/* TBD */
-    self->fds       = 0;/* TBD */
-}
-
-LIB_EXPORT
-bool CC
-SRACacheMetricsLessThan(const SRACacheMetrics* a, const SRACacheMetrics* b)
-{
-    if (a->bytes >= 0 && b->bytes >= 0 && a->bytes > b->bytes)
-        return false;
-    if (a->elements >= 0 && b->elements >= 0 && a->elements > b->elements)
-        return false;
-    if (a->threads >= 0 && b->threads >= 0 && a->threads > b->threads)
-        return false;
-    if (a->fds >= 0 && b->fds >= 0 && a->fds > b->fds)
-        return false;
-        
-    if (a->bytes    >= 0 && b->bytes    >= 0 && a->bytes    == b->bytes && 
-        a->elements >= 0 && b->elements >= 0 && a->elements == b->elements &&
-        a->threads  >= 0 && b->threads  >= 0 && a->threads  == b->threads &&
-        a->fds      >= 0 && b->fds      >= 0 && a->fds      == b->fds)
-        return false;
-        
-    return true;
-}
-
-static
-void 
-MetricsAdd(SRACacheMetrics* a, const SRACacheMetrics* b)
-{
-    a->bytes    += b->bytes;
-    a->elements += b->elements;
-    a->threads  += b->threads;
-    a->fds      += b->fds;
-}
-
-static
-void 
-MetricsSubtract(SRACacheMetrics* a, const SRACacheMetrics* b)
-{
-    a->bytes    -= b->bytes;
-    a->elements -= b->elements;
-    a->threads  -= b->threads;
-    a->fds      -= b->fds;
-}
-
-/*================================== SRACacheElement ==================================*/
-LIB_EXPORT rc_t CC SRACacheElementMake(SRACacheElement**        self, 
-                                       SRATable*                object, 
-                                       struct SRACacheIndex*    index, 
-                                       uint32_t                 key, 
-                                       const SRACacheMetrics*   metrics)
-{
-    rc_t rc = 0;
-    if ( self == NULL || object == NULL || index == NULL || metrics == NULL )
-        return RC( rcSRA, rcNode, rcConstructing, rcParam, rcNull );
-        
-    *self = malloc(sizeof(**self));
-    if (self == NULL)
-        rc = RC ( rcSRA, rcNode, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        (*self)->dad.next = NULL;
-        (*self)->dad.prev = NULL;
-        
-        (*self)->object = object;
-        rc = SRATableAddRef(object);
-        if ( rc != 0 )
-        {
-            free (*self);
-        }
-        else
-        {
-            (*self)->index = index;
-        
-            (*self)->key = key;
-        
-            memcpy(&(*self)->metrics, metrics, sizeof((*self)->metrics));
-        }
-    }
-        
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheElementDestroy(SRACacheElement* self)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        return RC( rcSRA, rcNode, rcDestroying, rcSelf, rcNull );
-        
-    rc = SRATableRelease(self->object);
-    
-    free(self);
-    
-    return rc;
-}
-
-/*================================== SRACacheIndex ==================================*/
-LIB_EXPORT rc_t CC SRACacheIndexMake(SRACacheIndex** self, String* prefix)
-{
-    rc_t rc = 0;
-    if ( self == NULL || prefix == NULL )
-        return RC( rcSRA, rcIndex, rcConstructing, rcParam, rcNull );
-        
-    *self = malloc(sizeof(**self));
-    if (self == NULL)
-        rc = RC ( rcSRA, rcIndex, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        memset(*self, 0, sizeof(**self));
-        rc = StringCopy((const String**)&(*self)->prefix, prefix);
-        if (rc == 0)
-        {
-            rc = KVectorMake(&(*self)->body);
-            if (rc != 0)
-                StringWhack((*self)->prefix);
-        }
-        
-        if (rc != 0)
-        {
-            free(*self);
-            *self = NULL;
-        }
-    }
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheIndexDestroy(SRACacheIndex* self)
-{
-    rc_t rc;
-    if ( self == NULL  )
-        return RC( rcSRA, rcIndex, rcDestroying, rcSelf, rcNull );
-        
-    rc = KVectorRelease(self->body);
-    StringWhack(self->prefix);
-    free(self);
-    return rc;
-}
-
-/*================================== SRACache ==================================*/
-static
-rc_t
-ReadValue(struct KConfig* kfg, const char* path, uint64_t* value, uint64_t dflt)
-{
-    rc_t rc = 0;
-    *value = dflt;
-    if ( kfg )
-    {   /* read configuration values */
-        const KConfigNode* node;
-        rc = KConfigOpenNodeRead( kfg, &node, path );
-        if (rc == 0)
-        {
-            uint64_t temp;
-            rc = KConfigNodeReadU64( node, &temp );
-            if (rc == 0)
-                *value = temp;
-            rc = KConfigNodeRelease ( node );
-        }
-        else if (rc == RC ( rcKFG, rcNode, rcOpening, rcPath, rcNotFound ))
-            rc = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheInit(SRACache** self, struct KConfig* kfg)
-{
-    rc_t rc = 0;
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcConstructing, rcSelf, rcNull );
-        
-    *self = malloc(sizeof(**self));
-    if (*self == NULL)
-        rc = RC ( rcSRA, rcData, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        uint64_t v;
-#define LOAD_VALUE(target, path, default)                       \
-        if (rc == 0)                                            \
-        {                                                       \
-            rc = ReadValue(kfg, path, &v, default);             \
-            if ( rc == 0 )                                      \
-                target = v;                                    \
-        }
-
-        LOAD_VALUE((*self)->softThreshold.bytes,    "/openserver/thresholds/soft/bytes",    SRACacheThresholdSoftBytesDefault);
-        LOAD_VALUE((*self)->softThreshold.elements, "/openserver/thresholds/soft/elements", SRACacheThresholdSoftElementsDefault);
-        LOAD_VALUE((*self)->softThreshold.threads,  "/openserver/thresholds/soft/threads",  SRACacheThresholdSoftThreadsDefault);
-        LOAD_VALUE((*self)->softThreshold.fds,      "/openserver/thresholds/soft/fds",      SRACacheThresholdSoftFdsDefault);
-            
-        LOAD_VALUE((*self)->hardThreshold.bytes,    "/openserver/thresholds/hard/bytes",    SRACacheThresholdHardBytesDefault);
-        LOAD_VALUE((*self)->hardThreshold.elements, "/openserver/thresholds/hard/elements", SRACacheThresholdHardElementsDefault);
-        LOAD_VALUE((*self)->hardThreshold.threads,  "/openserver/thresholds/hard/threads",  SRACacheThresholdHardThreadsDefault);
-        LOAD_VALUE((*self)->hardThreshold.fds,      "/openserver/thresholds/hard/fds",      SRACacheThresholdHardFdsDefault);
-#undef LOAD_VALUE
-    
-        if (rc == 0)
-        {
-            BSTreeInit( & (*self)->indexes );
-            DLListInit( & (*self)->lru );
-            
-            memset(&(*self)->current, 0, sizeof(*self)->current);
-            
-            (*self)->requests         = 0;
-            (*self)->hits             = 0;
-            (*self)->misses           = 0;
-            (*self)->busy             = 0;
-            
-            rc = KLockMake(&(*self)->mutex);
-        }
-    }        
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheGetSoftThreshold(SRACache* self, SRACacheMetrics* metrics)
-{
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-    if (metrics == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcParam, rcNull );
-    memcpy(metrics, &self->softThreshold, sizeof(self->softThreshold));
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRACacheSetSoftThreshold(SRACache* self, const SRACacheMetrics* metrics)
-{
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcUpdating, rcSelf, rcNull );
-    if (metrics == NULL)
-        return RC( rcSRA, rcData, rcUpdating, rcParam, rcNull );
-    memcpy(&self->softThreshold, metrics, sizeof(self->softThreshold));
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRACacheGetHardThreshold(SRACache* self, SRACacheMetrics* metrics)
-{
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-    if (metrics == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcParam, rcNull );
-    memcpy(metrics, &self->hardThreshold, sizeof(self->hardThreshold));
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRACacheSetHardThreshold(SRACache* self, const SRACacheMetrics* metrics)
-{
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcUpdating, rcSelf, rcNull );
-    if (metrics == NULL)
-        return RC( rcSRA, rcData, rcUpdating, rcParam, rcNull );
-    memcpy(&self->hardThreshold, metrics, sizeof(self->hardThreshold));
-    return 0;
-}
-
-static void CC SRACacheIndexDestructor(BSTNode *n, void *data)
-{
-    SRACacheIndexDestroy((SRACacheIndex*)n);
-}
-static void CC SRACacheElementDestructor(DLNode *n, void *data)
-{
-    SRACacheElementDestroy((SRACacheElement*)n);
-}
-
-LIB_EXPORT rc_t CC SRACacheWhack(SRACache* self)
-{
-    rc_t rc = 0;
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcDestroying, rcSelf, rcNull );
-
-    BSTreeWhack(&self->indexes, SRACacheIndexDestructor, NULL);
-    DLListWhack(&self->lru, SRACacheElementDestructor, NULL);
-    
-    rc = KLockRelease(self->mutex);
-    free(self);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheGetUsage(SRACache* self, SRACacheUsage* usage)
-{
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-    if (usage == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcParam, rcNull );
-    usage->soft_threshold   = self->softThreshold.elements;
-    usage->hard_threshold   = self->hardThreshold.elements;
-    usage->elements         = self->current.elements;
-    usage->requests         = self->requests;
-    usage->hits             = self->hits;
-    usage->misses           = self->misses;
-    usage->busy             = self->busy;
-    return 0;
-}
-
-static
-int CC IndexCmp (const BSTNode * item, const BSTNode * n)
-{
-    return StringCompare( ((const SRACacheIndex *)item)->prefix, ((const SRACacheIndex *)n)->prefix );
-}
-    
-static
-int CC PrefixCmp (const void * item, const BSTNode * n)
-{
-    return StringCompare( (const String*)item, ((const SRACacheIndex *)n)->prefix );
-}
-    
-static
-rc_t
-AddNewIndex(BSTree* indexes, String* prefix, SRACacheIndex** newIdx)
-{
-    rc_t rc = SRACacheIndexMake(newIdx, prefix);
-    if (rc == 0)
-    {
-        rc = BSTreeInsert(indexes, &(*newIdx)->dad, IndexCmp);
-        if (rc != 0)
-            SRACacheIndexDestroy(*newIdx);
-    }
-    return rc;
-}
-
-static
-rc_t
-ParseAccessionName(const char *acc, String* prefix, uint32_t* key)
-{
-    rc_t rc = 0;
-    
-    /*  extract the alphabetic prefix from the accession's name */
-    size_t prefLen = 0;
-    while (acc[prefLen] != 0 && isalpha(acc[prefLen]))
-        ++prefLen;
-    StringInit(prefix, acc, prefLen, prefLen);
-    
-    {   /* the numeric key will be the rest of the accession's name, if fully numeric */
-        char *end;
-        *key = strtou32 ( acc + prefLen, & end, 10 );
-        if ( end [ 0 ] != 0 )
-            rc = RC( rcSRA, rcData, rcAccessing, rcName, rcInvalid );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheAddTable(SRACache* self, const char* acc, SRATable* table)
-{ /* if crosses soft threshold, signal BG thread to wake up */
-    rc_t rc = 0;
-    String prefix;
-    uint32_t key;
-    
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-    if (acc == NULL || acc[0] == 0 || table == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcParam, rcNull );
-
-    rc = ParseAccessionName(acc, &prefix, &key);
-    if (rc == 0)
-    {
-        rc = KLockAcquire(self->mutex);
-        if (rc == 0)
-        {
-            SRACacheIndex* index = (SRACacheIndex*) BSTreeFind ( &self->indexes, &prefix, PrefixCmp );
-            if (index == NULL)
-                rc = AddNewIndex( &self->indexes, &prefix, &index );
-                
-            if (rc == 0)
-            {
-                SRACacheElement* elem = NULL;
-                rc = KVectorGetPtr ( index->body, key, (void**)&elem );   
-                if (rc == 0 && elem != NULL) /* table already in cache */
-                    rc = RC( rcSRA, rcData, rcInserting, rcParam, rcExists );
-                else if (GetRCState(rc) == rcNotFound)
-                {
-                    SRACacheMetrics metrics;
-                    MetricsInit(&metrics, table);
-                    rc = SRACacheElementMake(&elem, table, index, key, &metrics);
-                    if (rc == 0)
-                    {
-                        rc = KVectorSetPtr( index->body, key, elem );
-                        if (rc != 0)
-                            SRACacheElementDestroy(elem);
-                        else
-                        {   /* success - update global usage and time-sorted list */
-                            MetricsAdd(&self->current, &metrics);
-                            DLListPushTail( &self->lru, (DLNode*)elem );
-                        }
-                    }
-                }
-            }
-                
-            {
-                rc_t rc2 = KLockUnlock(self->mutex);
-                if (rc == 0)
-                    rc = rc2;
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheGetTable(SRACache* self, const char* acc, const SRATable** object)
-{
-    rc_t rc = 0;
-    String prefix;
-    uint32_t key;
-    
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-    if (acc == NULL || acc[0] == 0 || object == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcParam, rcNull );
-
-    *object = NULL;
-    
-    rc = ParseAccessionName(acc, &prefix, &key);
-    if (rc == 0)
-    {
-        ++ self->requests;
-        
-        rc = KLockAcquire(self->mutex);
-        if (rc == 0)
-        {
-            SRACacheIndex* index = (SRACacheIndex*) BSTreeFind ( &self->indexes, &prefix, PrefixCmp );
-            if (index != NULL)
-            {
-                SRACacheElement* elem = NULL;
-                rc = KVectorGetPtr ( index->body, key, (void**)&elem );   
-                if (rc == 0 && elem != NULL) 
-                {   
-                    if (elem->object->refcount.counter == 1)    /* onwed by cache, not used elsewhere */
-                    {
-                        ++ self->hits;
-                        
-                        /* move to the least recently used position */
-                        DLListUnlink    ( &self->lru, &elem->dad );
-                        DLListPushTail  ( &self->lru, &elem->dad );
-                        
-                        *object = elem->object;
-                        rc = SRATableAddRef(*object);
-                    }
-                    else
-                    {
-                        ++ self->busy;
-                        rc = RC( rcSRA, rcData, rcAccessing, rcParam, rcBusy);
-                    }
-                }
-                else if (GetRCState(rc) == rcNotFound || elem == NULL)
-                {
-                    ++ self->misses;
-                    rc = 0;
-                }
-            }
-            else
-                ++ self->misses;
-                
-            {
-                rc_t rc2 = KLockUnlock(self->mutex);
-                if (rc == 0)
-                {
-                    rc = rc2;
-                    if (rc != 0)
-                        SRATableRelease(*object);
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRACacheFlush(SRACache* self)
-{
-    rc_t rc = 0;
-    if (self == NULL)
-        return RC( rcSRA, rcData, rcAccessing, rcSelf, rcNull );
-        
-    rc = KLockAcquire(self->mutex);
-    if (rc == 0)
-    {
-        /* use the lower of the two thresholds */
-        const SRACacheMetrics* thr = &self->softThreshold;
-        if ( SRACacheMetricsLessThan( &self->hardThreshold, thr ) )
-            thr = &self->hardThreshold;
-            
-        while ( ! SRACacheMetricsLessThan( &self->current, thr ) )
-        {
-            SRACacheElement* toFlush = (SRACacheElement*) DLListPopHead( &self->lru );
-            if (toFlush == NULL)
-                break;
-            rc = KVectorUnset( toFlush->index->body, toFlush->key );
-            if (rc != 0)
-                break; /* something is badly wrong */
-            MetricsSubtract( &self->current, &toFlush->metrics );
-            rc = SRACacheElementDestroy(toFlush);
-            if (rc != 0)
-                break;
-        }
-        
-        {
-            rc_t rc2 = KLockUnlock(self->mutex);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/sra/sracol.c b/libs/sra/sracol.c
deleted file mode 100644
index ea931de..0000000
--- a/libs/sra/sracol.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-#include <sra/sradb.h>
-#include <sra/types.h>
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "sra-priv.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#define RC_MODULE (rcSRA)
-#define RC_TARGET (rcColumn)
-#define CLASS "SRAColumn"
-
-/* AddRef
- * Release
- *  see REFERENCE COUNTING, above
- */
-LIB_EXPORT rc_t CC SRAColumnAddRef( const SRAColumn *self ) {
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, CLASS ) )
-        {
-        case krefLimit:
-            return RC ( RC_MODULE, RC_TARGET, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-rc_t SRAColumnWhack ( SRAColumn *self )
-{
-    if ( self -> tbl != NULL )
-    {
-        rc_t rc = SRATableSever ( self -> tbl );
-        if ( ! self -> read_only )
-        {
-            self -> tbl = NULL;
-            return rc;
-        }
-    }
-
-    free ( self );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRAColumnRelease ( const SRAColumn *self )
-{
-    if ( self != NULL )
-    {
-        rc_t rc;
-
-        switch ( KRefcountDrop ( & self -> refcount, "SRAColumn" ) )
-        {
-        case krefWhack:
-            return SRAColumnWhack ( ( SRAColumn* ) self );
-
-        case krefNegative:
-            rc = RC ( RC_MODULE, RC_TARGET, rcDestroying, rcSelf, rcDestroyed );
-            PLOGERR (klogInt,(klogInt, rc, "Released a SRAColumn $(B) with no more references",
-                      PLOG_P(self)));
-            return rc;
-        }
-    }
-
-    return 0;
-}
-
-
-/* OpenColumnRead
- *  open a column for read
- *
- *  "col" [ OUT ] - return parameter for newly opened column
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
- *
- *  "datatype" [ IN, NULL OKAY ] - optional NUL terminated typedecl
- *  string describing fully qualified column data type, or if NULL
- *  the default type for column.
- */
-LIB_EXPORT rc_t CC SRATableOpenColumnRead( const SRATable *self,
-        const SRAColumn **rslt, const char *name, const char *datatype )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC(RC_MODULE, rcColumn, rcOpening, rcParam, rcNull);
-    else
-    {
-        if ( self == NULL )
-            rc = RC(RC_MODULE, rcTable, rcAccessing, rcSelf, rcNull);
-        else if ( name == NULL )
-            rc = RC(RC_MODULE, rcColumn, rcOpening, rcName, rcNull);
-        else if ( name [ 0 ] == 0 )
-            rc = RC(RC_MODULE, rcColumn, rcOpening, rcName, rcEmpty);
-        else
-        {
-            SRAColumn *col = malloc ( sizeof * col );
-            if ( col == NULL )
-                rc = RC(RC_MODULE, RC_TARGET, rcConstructing, rcMemory, rcExhausted);
-            else
-            {
-                rc = ( datatype != NULL && datatype [ 0 ] != 0 ) ?
-                    VCursorAddColumn ( self -> curs, & col -> idx, "(%s)%s", datatype, name ):
-                    VCursorAddColumn ( self -> curs, & col -> idx, name );
-                if ( rc == 0 || GetRCState ( rc ) == rcExists )
-                {
-                    KRefcountInit ( & col -> refcount, 1, CLASS, "OpenColumnRead", name );
-                    col -> tbl = SRATableAttach ( self );
-                    col -> read_only = true;
-                    *rslt = col;
-                    return 0;
-                }
-                else if ( GetRCState ( rc ) == rcUndefined )
-                {
-                    rc = RC ( rcSRA, rcTable, rcOpening, rcColumn, rcNotFound );
-                }
-
-                free ( col );
-            }
-        }
-
-        * rslt = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Datatype
- *  access data type
- *
- *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
- *
- *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
- *  returned in "type_decl"
- *
- * NB - one of "type" and "def" must be non-NULL
- */
-LIB_EXPORT rc_t CC SRAColumnDatatype( const SRAColumn *self,
-        VTypedecl *type, VTypedef *def )
-{
-    if (self != NULL)
-        return SRATableColDatatype(self->tbl, self->idx, type, def);
-
-    if ( type != NULL )
-        memset ( type, 0, sizeof * type );
-    if ( def != NULL )
-        memset ( def, 0, sizeof * def );
-
-    return RC(RC_MODULE, RC_TARGET, rcAccessing, rcSelf, rcNull);
-}
-
-
-/* GetRange
- *  get a contiguous range around a spot id, e.g. tile for Illumina
- *
- *  "id" [ IN ] - return parameter for 1-based spot id
- *
- *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-LIB_EXPORT rc_t CC SRAColumnGetRange( const SRAColumn *self,
-        spotid_t id, spotid_t *first, spotid_t *last )
-{
-    if (self != NULL)
-        return SRATableGetIdRange(self->tbl, self->idx, id, first, last);
-
-    if ( first != NULL )
-        * first = 0;
-    if ( last != NULL )
-        * last = 0;
-
-    return RC(RC_MODULE, RC_TARGET, rcAccessing, rcSelf, rcNull);
-}
-
-
-/* Read
- *  read row data
- *
- *  "id" [ IN ] - spot row id between 1 and max(spot id)
- *
- *  "base" [ OUT ] and "offset" [ OUT ] - pointer and bit offset
- *  to start of spot row data.
- *
- *  "size" [ OUT ] - size in bits of row data
- */
-LIB_EXPORT rc_t CC SRAColumnRead( const SRAColumn *self,
-        spotid_t id, const void **base, bitsz_t *offset, bitsz_t *size )
-{
-    if (self != NULL)
-        return SRATableRead(self->tbl, id, self->idx, base, offset, size);
-
-    if ( base != NULL )
-        * base = NULL;
-    if ( offset != NULL )
-        * offset = 0;
-    if ( size != NULL )
-        * size = 0;
-
-    return RC(RC_MODULE, RC_TARGET, rcAccessing, rcSelf, rcNull);
-}
diff --git a/libs/sra/sramgr-cmn.c b/libs/sra/sramgr-cmn.c
deleted file mode 100644
index dbce4b6..0000000
--- a/libs/sra/sramgr-cmn.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-
-#include <klib/namelist.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kfs/directory.h>
-#include <kfg/config.h>
-#include <vfs/manager.h>
-#include <vfs/resolver.h>
-#include <vfs/path.h>
-#include <kdb/manager.h>
-#include <kdb/kdb-priv.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <sra/sradb.h>
-#include <sra/sraschema.h>
-#include <sra/srapath.h>
-#include <sra/sradb-priv.h>
-#include <sysalloc.h>
-#include <atomic.h>
-
-#include "sra-priv.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* Whack
- *  will not refuse request, and ignores errors
- */
-static
-rc_t SRAMgrWhack ( const SRAMgr *that )
-{
-    SRAMgr *self = ( SRAMgr* ) that;
-
-    VSchemaRelease ( self -> schema );
-    VDBManagerRelease ( self -> vmgr );
-    SRACacheWhack ( self -> cache );
-    
-    /* must check here for NULL because
-       SRAPathRelease is weak-linked */
-    if ( self -> _pmgr != NULL )
-    {
-#if OLD_SRAPATH_MGR
-        SRAPathRelease ( self -> _pmgr );
-#else
-        VResolverRelease ( ( const VResolver* ) self -> _pmgr );
-#endif
-    }
-
-    free ( self );
-    return 0;
-}
-
-
-/* Release
- *  releases reference to object
- *  obtained from MakeRead, MakeUpdate,
- *  or AddRef(see above)
- */
-LIB_EXPORT rc_t CC SRAMgrRelease ( const SRAMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "SRAMgr" ) )
-        {
-        case krefWhack:
-            return SRAMgrWhack ( ( SRAMgr* ) self );
-        case krefNegative:
-            return RC ( rcSRA, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddRef
- *  attach a new reference to an existing object
- *  ( see above)
- */
-LIB_EXPORT rc_t CC SRAMgrAddRef ( const SRAMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "SRAMgr" ) )
-        {
-        case krefLimit:
-            return RC ( rcSRA, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- */
-SRAMgr *SRAMgrAttach ( const SRAMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "SRAMgr" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( SRAMgr* ) self;
-}
-
-rc_t SRAMgrSever ( const SRAMgr *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "SRAMgr" ) )
-        {
-        case krefWhack:
-            return SRAMgrWhack ( ( SRAMgr* ) self );
-        case krefNegative:
-            return RC ( rcSRA, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make
- */
-static
-rc_t SRAMgrInitPath ( SRAMgr *mgr, KConfig *kfg, const KDirectory *wd )
-{
-    VFSManager *vfs;
-    rc_t rc = VFSManagerMake ( & vfs );
-    if ( rc == 0 )
-    {
-        rc = VFSManagerMakeResolver ( vfs, ( VResolver** ) & mgr -> _pmgr, kfg );
-        VFSManagerRelease ( vfs );
-    }
-
-    if ( rc != 0 )
-        mgr -> _pmgr = NULL;
-
-    return 0;
-}
-
-rc_t SRAMgrMake ( SRAMgr **mgrp,
-    const VDBManager *vmgr, const KDirectory *wd )
-{
-    rc_t rc;
-
-    /* require sraschema object */
-    SRAMgr *mgr = malloc ( sizeof * mgr );
-    if ( mgr == NULL )
-        rc = RC ( rcSRA, rcMgr, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        VSchema *schema;
-        rc = VDBManagerMakeSRASchema ( vmgr, & schema );
-        if ( rc == 0 )
-        {
-            KConfig* kfg;
-            rc = KConfigMake ( & kfg, wd );
-            if ( rc == 0 )
-            {
-                rc = SRAMgrInitPath ( mgr, kfg, wd );
-                if ( rc == 0 )
-                {
-                    rc = SRACacheInit ( & mgr -> cache, kfg );
-                    if ( rc == 0 )
-                    {
-                        KRefcountInit ( & mgr -> refcount, 1, "SRAMgr", "SRAMgrMake", "sramgr" );
-                        mgr -> vmgr = vmgr;
-                        mgr -> schema = schema;
-                        mgr -> mode = kcmCreate; /* TBD - should this include parents? */
-                        mgr -> read_only = true;
-                        * mgrp = mgr;
-                        KConfigRelease ( kfg );
-                        return 0;
-                    }
-                }
-                KConfigRelease ( kfg );
-            }
-
-            VSchemaRelease ( schema );
-        }
-
-        free ( mgr );
-    }
-
-    * mgrp = NULL;
-    return rc;
-}
-
-
-/* Writable
- *  returns 0 if table is writable
- *  rcLocked if locked, rcReadonly if read-only
- *  other code upon error
- *
- *  "path" [ IN ] - NUL terminated table path
- */
-LIB_EXPORT rc_t CC SRAMgrVWritable ( const SRAMgr *self,
-        const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-    return VDBManagerVWritable ( self -> vmgr, path, args );
-}
-
-LIB_EXPORT rc_t CC SRAMgrWritable ( const SRAMgr *self,
-        const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = SRAMgrVWritable ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrResolve( const SRAMgr *self, const char* acc, char* buf, size_t buf_size )
-{
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcResolving, rcSelf, rcNull );
-    if ( acc == NULL || buf == NULL)
-        return RC ( rcSRA, rcMgr, rcResolving, rcParam, rcNull );
-    else
-    {
-        VFSManager *vfs;
-        rc_t rc = VFSManagerMake ( & vfs );
-        if (rc == 0)
-        {
-			rc_t rc2;
-            VPath* path;
-            rc = VFSManagerMakePath(vfs, &path, "ncbi-acc:%s", acc);
-            if (rc == 0)
-            {
-                const VPath* resolved;
-                rc = VResolverQuery ( (const struct VResolver*)self->_pmgr, eProtocolHttp, path, &resolved, NULL, NULL );
-                if (rc == 0)
-                {
-                    rc = VPathReadPath ( resolved, buf, buf_size, NULL );
-                    rc2 = VPathRelease(resolved);
-                    if (rc == 0)
-                        rc = rc2;
-                }
-                
-                rc2 = VPathRelease(path);
-                if (rc == 0)
-                    rc = rc2;
-            }
-            rc2 = VFSManagerRelease(vfs);
-            if (rc == 0)
-                rc = rc2;
-        }
-        
-        return rc;
-    }
-}
-
-LIB_EXPORT rc_t CC SRAMgrConfigReload( const SRAMgr *cself, const KDirectory *wd )
-{
-#if OLD_SRAPATH_MGR
-    SRAMgr *self = cself;
-
-    /* create a new SRAPath object */
-    SRAPath *pnew;
-    rc_t rc = SRAPathMake ( & pnew, wd );
-    if ( rc == 0 )
-    {
-        /* swap with the old guy */
-        SRAPath *pold = self -> _pmgr;
-        if ( atomic_test_and_set_ptr ( ( void *volatile* ) & self -> _pmgr, pnew, pold ) == ( void* ) pold )
-            SRAPathRelease ( pold );
-        else
-            SRAPathRelease ( pnew );
-    }
-
-    return rc;
-#else
-    return 0;
-#endif
-
-#if 0
-
-
-    /* do not reload VDBManager config for now
-       it cannot reload properly and grows in memory */
-    rc_t rc = 0;
-    /* (not thread) safely re-instanciate sra path config */
-    SRAMgr *self = (SRAMgr*)cself;
-    SRAPath* p = cself->_pmgr;
-    self->_pmgr = NULL;
-    if( (rc = SRAMgrInitPath(self, wd)) == 0 ) {
-        SRAPathRelease(p);
-    } else {
-        /* roll back */
-        self->_pmgr = p;
-    }
-    return rc;
-#endif
-
-}
-
-/* GetVDBManager
- *  returns a new reference to VDBManager used by SRAMgr
- */
-LIB_EXPORT rc_t CC SRAMgrGetVDBManagerRead ( const SRAMgr *self, const VDBManager **vmgr )
-{
-    rc_t rc;
-
-    if ( vmgr == NULL )
-        rc = RC ( rcSRA, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * vmgr = self -> vmgr;
-            return VDBManagerAddRef ( * vmgr );
-        }
-
-        * vmgr = NULL;
-    }
-
-    return rc;
-}
-
-/* GetKDBManager
- *  returns a new reference to KDBManager used indirectly by SRAMgr
- */
-LIB_EXPORT rc_t CC SRAMgrGetKDBManagerRead ( const SRAMgr *self,
-        struct KDBManager const **kmgr )
-{
-    rc_t rc;
-
-    if ( kmgr == NULL )
-        rc = RC ( rcSRA, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            return VDBManagerGetKDBManagerRead ( self -> vmgr, kmgr );
-        }
-
-        * kmgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* ModDate
- *  return a modification timestamp for table
- */
-LIB_EXPORT rc_t CC SRAMgrVGetTableModDate ( const SRAMgr *self,
-    KTime_t *mtime, const char *spec, va_list args )
-{
-    rc_t rc;
-
-    if ( mtime == NULL )
-        rc = RC ( rcSRA, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * mtime = 0;
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            char path[4096];
-            rc = ResolveTablePath(self, path, sizeof path, spec, args);
-            if( rc == 0 ) {
-                struct KDBManager const *kmgr;
-                rc = VDBManagerGetKDBManagerRead ( self -> vmgr, & kmgr );
-                if ( rc == 0 )
-                {
-                    rc = KDBManagerGetTableModDate(kmgr, mtime, path);
-                    KDBManagerRelease ( kmgr );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrGetTableModDate ( const SRAMgr *self,
-    KTime_t *mtime, const char *spec, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, spec );
-    rc = SRAMgrVGetTableModDate ( self, mtime, spec, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrSingleFileArchiveExt(const SRAMgr *self, const char* spec, const bool lightweight, const char** ext)
-{
-    rc_t rc;
-
-    if( self == NULL || spec == NULL || ext == NULL ) {
-        rc = RC(rcSRA, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        char buf[4096];
-        va_list args;
-
-        if( (rc = ResolveTablePath(self, buf, sizeof(buf), spec, args)) == 0 ) {
-            const KDBManager* kmgr;
-            if( (rc = SRAMgrGetKDBManagerRead(self, &kmgr)) == 0 ) {
-                int type = KDBManagerPathType(kmgr, buf) & ~kptAlias;
-                if( type == kptDatabase ) {
-                    *ext = CSRA_EXT(lightweight);
-                } else if( type == kptTable ) {
-                    *ext = SRA_EXT(lightweight);
-                } else {
-                    rc = RC(rcSRA, rcPath, rcResolving, rcType, rcUnknown);        
-                }
-                KDBManagerRelease(kmgr);
-            }
-        }
-    }
-    return rc;
-}
-
-/* 
- * FlushPath
- * FlushRun
- * RunBGTasks
- *  stubbed functions to manipulate a cache, if implemented
- */
-LIB_EXPORT rc_t CC SRAMgrGetCacheUsage( const SRAMgr *self, struct SRACacheUsage* stats )
-{
-    rc_t rc = 0;
-    if ( self == NULL || stats == NULL || self->cache == NULL)
-        rc = RC(rcSRA, rcMgr, rcAccessing, rcParam, rcNull);
-    else
-        rc = SRACacheGetUsage(self->cache, stats);
-    return rc;
-}
- 
-LIB_EXPORT rc_t CC SRAMgrFlush ( struct SRAMgr const *self, const struct SRACacheMetrics* thr )
-{
-    rc_t rc = 0;
-    if( self == NULL  || self->cache == NULL)
-        rc = RC(rcSRA, rcFile, rcProcessing, rcSelf, rcNull);
-    else if( thr == NULL )
-        rc = RC(rcSRA, rcFile, rcProcessing, rcParam, rcNull);
-    else 
-    {
-        SRACacheMetrics saved;
-        rc = SRACacheGetSoftThreshold(self->cache, &saved);
-        if (rc == 0)
-        {
-            rc = SRACacheSetSoftThreshold(self->cache, thr);
-            if (rc == 0)
-            {
-                rc_t rc2;
-                rc = SRACacheFlush(self->cache);
-                rc2 = SRACacheSetSoftThreshold(self->cache, &saved);
-                if (rc == 0)
-                    rc = rc2;
-            }
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrRunBGTasks ( const SRAMgr *self )
-{
-    rc_t rc;
-
-    if( self == NULL  )
-        rc = RC(rcSRA, rcMgr, rcProcessing, rcSelf, rcNull);
-        
-    rc = SRACacheFlush(self->cache);
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrConfigureCache( const SRAMgr *self,  int32_t soft_threshold, int32_t hard_threshold )
-{
-    rc_t rc = 0;
-    if( self == NULL  || self->cache == NULL)
-        rc = RC(rcSRA, rcFile, rcProcessing, rcSelf, rcNull);
-    else if( soft_threshold < -1  || hard_threshold < -1 )
-        rc = RC(rcSRA, rcFile, rcProcessing, rcParam, rcNull);
-    else 
-    {
-        if ( soft_threshold > -1 )
-        {
-            SRACacheMetrics metrics;
-            memset(&metrics, 0, sizeof(metrics));
-            metrics.elements = soft_threshold;
-            rc = SRACacheSetSoftThreshold(self->cache, &metrics);
-        }
-        if ( rc == 0 && hard_threshold > -1 )
-        {
-            SRACacheMetrics metrics;
-            memset(&metrics, 0, sizeof(metrics));
-            metrics.elements = hard_threshold;
-            rc = SRACacheSetHardThreshold(self->cache, &metrics);
-        }
-        /* if a new threshold is low enough to cause a flush, do it right away */
-        rc = SRACacheFlush(self->cache);
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * SRANamelist
- *  redirecting functions
- */
-
-
-LIB_EXPORT rc_t CC SRANamelistAddRef ( const SRANamelist *self )
-{
-    return KNamelistAddRef ( ( const KNamelist* ) self );
-}
-
-LIB_EXPORT rc_t CC SRANamelistRelease ( const SRANamelist *self )
-{
-    return KNamelistRelease ( ( const KNamelist* ) self );
-}
-
-LIB_EXPORT rc_t CC SRANamelistCount ( const SRANamelist *self, uint32_t *count )
-{
-    return KNamelistCount ( ( const KNamelist* ) self, count );
-}
-
-LIB_EXPORT rc_t CC SRANamelistGet ( const SRANamelist *self, uint32_t idx, const char **name )
-{
-    return KNamelistGet ( ( const KNamelist* ) self, idx, name );
-}
diff --git a/libs/sra/sramgr.c b/libs/sra/sramgr.c
deleted file mode 100644
index 912697d..0000000
--- a/libs/sra/sramgr.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-#include <sra/sradb.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-
-#include <klib/out.h>
-
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "libsradb.vers.h"
-#include "sra-priv.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* MakeRead
- *  create library reference for read-only access
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference
- *
- *  NB - not implemented in update libary
- *  and the read-only library may not be mixed with read/write
- */
-LIB_EXPORT rc_t CC SRAMgrMakeRead ( const SRAMgr **mgr )
-{
-    return SRAMgrMakeReadWithDir ( mgr, NULL );
-}
-
-LIB_EXPORT rc_t CC SRAMgrMakeReadWithDir ( const SRAMgr **mgrp,
-        struct KDirectory const *wd )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcSRA, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        const VDBManager *vmgr;
-        rc = VDBManagerMakeRead ( & vmgr, wd );
-        if ( rc == 0 )
-        {
-            SRAMgr *mgr;
-            rc = SRAMgrMake ( & mgr, vmgr, wd );
-            if ( rc == 0 )
-            {
-                * mgrp = mgr;
-                return 0;
-            }
-
-            VDBManagerRelease ( vmgr );
-        }
-
-        * mgrp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* GetSchema
- *  get a reference to the schema used to create new tables
- *
- *  "schema" [ OUT ] - return parameter for reference to SRA schema
- *
- * NB - returns a new reference that must be released via VSchemaRelease
- */
-LIB_EXPORT rc_t CC SRAMgrGetSchemaRead ( const SRAMgr *self,
-        const VSchema **schema )
-{
-    rc_t rc;
-
-    if ( schema == NULL )
-        rc = RC ( rcSRA, rcSchema, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VSchemaAddRef ( self -> schema );
-            if ( rc == 0 )
-            {
-                * schema = self -> schema;
-                return 0;
-            }
-        }
-
-        * schema = NULL;
-    }
-
-    return rc;
-}
-
-/* OpenDatatypes
- *  open datatype registry object for requested access
- *
- *  "dt" [ OUT ] - return parameter for datatypes object
- */
-LIB_EXPORT rc_t CC SRAMgrOpenDatatypesRead ( const SRAMgr *self,
-        struct VDatatypes const **dt )
-{
-    return SRAMgrGetSchemaRead ( self, ( const VSchema** ) dt );
-}
-
-
-/* UseSchema
- *  allows SRA schema to be entirely replaced
- *  affects creation/update of all subsequent tables
- *
- *  "schema" [ IN ] - new schema to be applied
- *
- * NB - manager will attach a new reference to schema object,
- *  you are still responsible for releasing it via VSchemaRelease
- */
-LIB_EXPORT rc_t CC SRAMgrUseSchemaRead ( const SRAMgr *self,
-        const VSchema *schema )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcSRA, rcMgr, rcUpdating, rcSelf, rcNull );
-    else if ( schema == NULL )
-        rc = RC ( rcSRA, rcMgr, rcUpdating, rcSchema, rcNull );
-    else if ( schema == self -> schema )
-        rc = 0;
-    else
-    {
-        rc = VSchemaAddRef ( schema );
-        if ( rc == 0 )
-        {
-            VSchemaRelease ( self -> schema );
-            ( ( SRAMgr* ) self ) -> schema = schema;
-        }
-    }
-
-    return rc;
-}
-
-
-/* Version
- *  returns the library version
- */
-LIB_EXPORT rc_t CC SRAMgrVersion ( const SRAMgr *self,
-        uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    * version = LIBSRADB_VERS;
-    return 0;
-}
diff --git a/libs/sra/sraschema-priv.h b/libs/sra/sraschema-priv.h
deleted file mode 100644
index aec84f9..0000000
--- a/libs/sra/sraschema-priv.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sraschema_priv_
-#define _h_sraschema_priv_
-
-#include <stddef.h>
-
-/* schema is built-in */
-extern const char sra_schema_text [];
-extern const size_t sra_schema_size;
-
-#endif /* _h_sraschema_priv_ */
diff --git a/libs/sra/sraschema-stub.c b/libs/sra/sraschema-stub.c
deleted file mode 100644
index 2cfdc97..0000000
--- a/libs/sra/sraschema-stub.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/sraschema.h>
-#include <sra/sradb-priv.h>
-#include <klib/rc.h>
-
-#include "sra-priv.h"
-
-/*--------------------------------------------------------------------------
- * SRASchema
- *  a schema object pre-loaded with default SRA schema
- */
-
-/* Make
- *  create an instance of the default SRA schema
- */
-rc_t CC VDBManagerMakeSRASchema ( struct VDBManager const *self, struct VSchema **schema )
-{
-    return SRASchemaMake ( schema, self );
-}
-
-rc_t CC SRAMgrMakeSRASchema ( const SRAMgr *self, struct VSchema **schema )
-{
-    if ( self != NULL )
-        return VDBManagerMakeSRASchema ( self -> vmgr, schema );
-    return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-}
diff --git a/libs/sra/sraschema.c b/libs/sra/sraschema.c
deleted file mode 100644
index 3d73cc6..0000000
--- a/libs/sra/sraschema.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/sch-extern.h>
-#include <sra/sradb-priv.h>
-#include <sra/sraschema.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "sraschema-priv.h"
-#include "sra-priv.h"
-
-
-/*--------------------------------------------------------------------------
- * SRASchema
- *  a schema object pre-loaded with default SRA schema
- */
-
-/* Make
- *  create an instance of the default SRA schema
- */
-
-LIB_EXPORT rc_t CC SRASchemaMake ( VSchema **schema, const VDBManager *mgr )
-{
-    rc_t rc;
-
-    if ( schema == NULL )
-        rc = RC ( rcVDB, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( mgr == NULL )
-            rc = RC ( rcVDB, rcMgr, rcCreating, rcSelf, rcNull );
-        else
-        {
-            rc = VDBManagerMakeSchema ( mgr, schema );
-            if ( rc == 0 )
-            {
-                rc = VSchemaParseText ( * schema, "sra-schema", sra_schema_text, sra_schema_size );
-                if ( rc == 0 )
-                    return 0;
-
-                VSchemaRelease ( * schema );
-            }
-        }
-
-        * schema = NULL;
-    }
-    return rc;
-}
diff --git a/libs/sra/sratbl-cmn.c b/libs/sra/sratbl-cmn.c
deleted file mode 100644
index 399660b..0000000
--- a/libs/sra/sratbl-cmn.c
+++ /dev/null
@@ -1,1397 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-
-#include <sra/sradb.h>
-#include <sra/srapath.h>
-#include <sra/types.h>
-#include <sra/sraschema.h>
-#include <sra/sradb-priv.h>
-#include <vdb/database.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/dependencies.h>
-#include <kdb/meta.h>
-#include <kdb/manager.h>
-#include <kdb/table.h>
-#include <kdb/database.h>
-#include <kdb/kdb-priv.h>
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <vfs/resolver.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <kfs/toc.h>
-#include <kfs/file.h>
-#include <sysalloc.h>
-
-#include "sra-priv.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-#include <va_copy.h>
-
-/* Destroy
- */
-static
-void CC column_release ( void *item, void *ignore )
-{
-    SRAColumn *self = item;
-    self -> tbl = NULL;
-    SRAColumnWhack ( self );
-}
-
-void SRATableDestroy ( SRATable *self )
-{
-    VectorWhack ( & self -> wcol, column_release, NULL );
-    VCursorRelease(self->curs);
-    KMetadataRelease ( self -> meta );
-    VTableRelease ( self -> vtbl );
-    SRAMgrSever ( self -> mgr );
-
-    memset(self, 0, sizeof *self);
-
-    free ( self );
-}
-
-/* AddRef
- * Release
- *  see REFERENCE COUNTING, above
- */
-LIB_EXPORT rc_t CC SRATableAddRef( const SRATable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "SRATable" ) )
-        {
-        case krefLimit:
-            return RC ( rcSRA, rcTable, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRATableRelease( const SRATable *self )
-{
-    rc_t rc = 0;
-    
-    if (self)
-    {
-        switch (KRefcountDrop(&self->refcount, "SRATable"))
-        {
-        case krefWhack:
-            return SRATableWhack ( ( SRATable* ) self );
-        case krefNegative:
-            rc = RC (rcSRA, rcTable, rcDestroying, rcSelf, rcDestroyed);
-            PLOGERR (klogInt,(klogInt, rc, "Released an SRATable $(B) with no more references",
-                      PLOG_P(self)));
-            break;
-        }
-    }
-    return rc;
-}
-
-/* Attach
- * Sever
- */
-SRATable *SRATableAttach ( const SRATable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "SRATable" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( SRATable* ) self;
-}
-
-rc_t SRATableSever ( const SRATable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "SRATable" ) )
-        {
-        case krefWhack:
-            return SRATableWhack ( ( SRATable* ) self );
-        case krefNegative:
-            return RC ( rcSRA, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* FillOutTableRead
- *  creates an empty cursor
- *  accesses metadata
- */
-static rc_t ReadSpotSequence_v1(SRATable *self)
-{
-    const KMDataNode *n;
-    rc_t rc = KMetadataOpenNodeRead(self->meta, &n, ".seq");
-    if (rc == 0)
-    {
-        rc = KMDataNodeReadAsU64(n, &self->spot_count);
-        KMDataNodeRelease(n);
-    }
-    return rc;
-}
-
-typedef enum {
-    eNotRead,
-    eNotFound,
-    eFailed,
-    eRead
-} EState;
-typedef struct {
-    EState state;
-    rc_t rc;
-} State;
-typedef struct {
-    uint64_t value;
-    State state;
-} U64;
-typedef struct {
-    uint32_t value;
-    State state;
-} U32;
-typedef struct {
-    U64 BASE_COUNT;
-    U32 MAX_SPOT_ID;
-    U32 MIN_SPOT_ID;
-    U64 SPOT_COUNT;
-} PseudoMeta;
-static
-rc_t VCursor_ReadPseudoMeta(rc_t rc, const VCursor *self,
-    const char *name, void *buffer, uint32_t blen, State *state)
-{
-    uint32_t idx = ~0;
-    uint32_t row_len = ~0;
-
-    assert(state);
-    state->rc = 0;
-
-    if (rc != 0)
-    {   return rc; }
-
-    state->state = eNotRead;
-
-    rc = VCursorAddColumn(self, &idx, name);
-
-    if (rc != 0) {
-        state->rc = rc;
-
-        if (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound) {
-            rc = 0;
-            state->state = eNotFound;
-        }
-        else {
-            state->state = eFailed;
-        }
-    }
-
-    if (state->rc == 0) {
-        rc = VCursorReadDirect(self, 1, idx, blen * 8, buffer, blen, &row_len);
-
-        state->rc = rc;
-
-        if (rc != 0)
-        {   state->state = eFailed; }
-        else
-        {   state->state = eRead; }
-
-    }
-
-    return rc;
-}
-
-static
-rc_t VCursor_ReadPseudoMetaU32(rc_t rc, const VCursor *self,
-    const char *name, U32 *val)
-{
-    assert(val);
-    return VCursor_ReadPseudoMeta(rc, self,
-        name, &val->value, sizeof val->value, &val->state);
-}
-
-static
-rc_t VCursor_ReadPseudoMetaU64(rc_t rc, const VCursor *self,
-    const char *name, U64 *val)
-{
-    assert(val);
-    return VCursor_ReadPseudoMeta(rc, self,
-        name, &val->value, sizeof val->value, &val->state);
-}
-
-static
-rc_t PseudoMetaInit(PseudoMeta *self, const VCursor *curs,
-    bool readSpotCount, uint64_t spot_count)
-{
-    rc_t rc = 0;
-
-    assert(self);
-
-    memset(self, 0, sizeof *self);
-
-    if (readSpotCount) {
-        rc =
-         VCursor_ReadPseudoMetaU64(rc, curs, "SPOT_COUNT", &self->SPOT_COUNT);
-    }
-    else {
-        self->SPOT_COUNT.value = spot_count;
-        self->SPOT_COUNT.state.state = eRead;
-    }
-
-    rc = VCursor_ReadPseudoMetaU64(rc, curs, "BASE_COUNT", &self->BASE_COUNT);
-
-    rc = VCursor_ReadPseudoMetaU32(rc, curs, "MIN_SPOT_ID", &self->MIN_SPOT_ID);
-
-    rc = VCursor_ReadPseudoMetaU32(rc, curs, "MAX_SPOT_ID", &self->MAX_SPOT_ID);
-
-    return rc;
-}
-
-static
-rc_t PseudoMetaFix(PseudoMeta *self)
-{
-    rc_t rc = 0;
-
-    assert(self);
-
-    if (self->MIN_SPOT_ID.state.state != eRead)
-    {   self->MIN_SPOT_ID.value = 1; }
-
-    if (self->SPOT_COUNT.state.state != eRead &&
-        self->MAX_SPOT_ID.state.state != eRead)
-    {
-        return self->SPOT_COUNT.state.rc;
-    }
-    else if (self->SPOT_COUNT.state.state == eRead) {
-        if (self->MAX_SPOT_ID.state.state != eRead) {
-            self->MAX_SPOT_ID.value
-                = self->MIN_SPOT_ID.value + self->SPOT_COUNT.value - 1;
-        }
-        else if (self->MAX_SPOT_ID.value >= self->MIN_SPOT_ID.value) {
-            if (self->SPOT_COUNT.value
-                > self->MAX_SPOT_ID.value - self->MIN_SPOT_ID.value + 1)
-            {
-                self->SPOT_COUNT.value
-                    = self->MAX_SPOT_ID.value - self->MIN_SPOT_ID.value + 1;
-            }
-        }
-    }
-    else {
-            self->SPOT_COUNT.value
-                = self->MAX_SPOT_ID.value - self->MIN_SPOT_ID.value - 1;
-    }
-
-    return rc;
-}
-
-static
-rc_t SRATableLoadMetadata(SRATable * self)
-{
-    rc_t rc = 0;
-    PseudoMeta meta;
-    bool readSpotCount = true;
-
-    assert(self && self->curs != NULL);
-    assert(self->curs_open == true);
-
-    readSpotCount = self->metavers > 1;
-    if (!readSpotCount) {
-        rc = ReadSpotSequence_v1(self);
-        if (rc != 0)
-        {   return rc; }
-    }
-
-    rc = PseudoMetaInit(&meta, self->curs, readSpotCount, self->spot_count);
-    if (rc != 0)
-    {   return rc; }
-
-    rc = PseudoMetaFix(&meta);
-    if (rc != 0)
-    {   return rc; }
-
-    self->spot_count = meta.SPOT_COUNT.value;
-    self->base_count = meta.BASE_COUNT.value;
-    self->min_spot_id = meta.MIN_SPOT_ID.value;
-    self->max_spot_id = meta.MAX_SPOT_ID.value;
-
-    return rc;
-}
-
-/* detect min and max spot-id from a temp. cursor */
-static rc_t SRATableGetMinMax( SRATable * self )
-{
-    const VCursor *temp_cursor;
-    rc_t rc;
-
-    assert( self != NULL );
-    assert( self->vtbl != NULL);
-    rc = VTableCreateCursorRead( self->vtbl, &temp_cursor );
-    if ( rc == 0 )
-    {
-        uint32_t idx;
-        rc = VCursorAddColumn ( temp_cursor, &idx, "READ" );
-        if ( rc == 0 )
-        {
-            rc = VCursorOpen( temp_cursor );
-            if ( rc == 0 )
-            {
-                int64_t  first;
-                uint64_t count;
-                rc = VCursorIdRange( temp_cursor, 0, &first, &count );
-                if ( rc == 0 )
-                {
-                    self->min_spot_id = first;
-                    self->max_spot_id = first + count;
-                    self->spot_count = count;
-                }
-            }
-        }
-        VCursorRelease( temp_cursor );
-    }
-    return rc;
-}
-
-rc_t SRATableFillOut ( SRATable *self, bool update )
-{
-    rc_t rc;
-    
-    /* require these operations to succeed */
-    rc = VCursorPermitPostOpenAdd( self->curs );
-    if ( rc != 0 )
-        return rc;
-    rc = VCursorOpen( self->curs );
-    if ( rc != 0 )
-        return rc;
-    self -> curs_open = true;
-    if ( ! update )
-    {
-        rc = SRATableLoadMetadata( self );
-        if ( rc != 0 )
-            rc = SRATableGetMinMax( self );
-    }
-    return rc;
-}
-
-
-/* ResolveTablePath
- *  takes either an accession or path
- *  substitutes any arguments
- *  resolves via SRAPath mgr if present
- */
-rc_t ResolveTablePath ( const SRAMgr *mgr,
-    char *path, size_t psize, const char *spec, va_list args )
-{
-#if OLD_SRAPATH_MGR
-    int len;
-    char tblpath [ 4096 ];
-    const SRAPath *pmgr = mgr -> _pmgr;
-
-    /* if no path manager or if the spec string has embedded path separators,
-       then this can't be an accession - just print it out */
-    if ( mgr -> _pmgr == NULL || strchr( spec, '/' ) != NULL )
-    {
-        len = vsnprintf ( path, psize, spec, args );
-        if ( len < 0 || ( size_t ) len >= psize )
-            return RC ( rcSRA, rcTable, rcOpening, rcPath, rcExcessive );
-        return 0;
-    }
-
-    /* create a copy - not likely to be too large */
-    len = vsnprintf ( tblpath, sizeof tblpath, spec, args );
-    if ( len < 0 || ( size_t ) len >= sizeof tblpath )
-        return RC ( rcSRA, rcTable, rcOpening, rcPath, rcExcessive );
-
-    /* test if the path exists in current directory, i.e. with assumed dot */
-    if ( ! SRAPathTest ( pmgr, tblpath ) )
-    {
-        rc_t rc = SRAPathFind ( pmgr, tblpath, path, psize );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    /* use the path given */
-    if ( ( size_t ) len >= psize )
-        return RC ( rcSRA, rcTable, rcOpening, rcBuffer, rcInsufficient );
-    strcpy ( path, tblpath );
-
-    return 0;
-#else
-    VFSManager *vfs;
-    rc_t rc = VFSManagerMake ( & vfs );
-    if ( rc == 0 )
-    {
-        VPath *accession;
-        const VPath *tblpath = NULL;
-        rc = VFSManagerMakePath ( vfs, & accession, spec, args );
-        if ( rc == 0 )
-        {
-            rc = VResolverLocal ( ( const VResolver* ) mgr -> _pmgr, accession, & tblpath );
-            if ( rc == 0 )
-            {
-                size_t size;
-                rc = VPathReadPath ( tblpath, path, psize, & size );
-                VPathRelease ( tblpath );
-            }
-            VPathRelease ( accession );
-        }
-
-        VFSManagerRelease ( vfs );
-    }
-    return rc;
-#endif
-}
-
-/* OpenRead
- *  open an existing table
- *
- *  "tbl" [ OUT ] - return parameter for table
- *
- *  "spec" [ IN ] - NUL terminated UTF-8 string giving path
- *  to table.
- */
-static
-rc_t CC SRAMgrVOpenAltTableRead ( const SRAMgr *self,
-    const SRATable **rslt, const char *altname, const char *spec, va_list args )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-        else if ( spec == NULL )
-            rc = RC ( rcSRA, rcTable, rcOpening, rcName, rcNull );
-        else if ( spec [ 0 ] == 0 )
-            rc = RC ( rcSRA, rcTable, rcOpening, rcName, rcEmpty );
-        else
-        {
-            SRATable *tbl = calloc ( 1, sizeof *tbl );
-            if ( tbl == NULL )
-                rc = RC ( rcSRA, rcTable, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                VSchema *schema = NULL;
-
-                rc = VDBManagerMakeSRASchema(self -> vmgr, & schema);
-                if ( rc == 0 ) 
-                {
-                    va_list args_copy;
-                    va_copy ( args_copy, args );
-                    rc = VDBManagerVOpenTableRead ( self -> vmgr, & tbl -> vtbl, schema, spec, args );
-                    if ( rc != 0 && GetRCObject ( rc ) == rcTable && GetRCState ( rc ) == rcIncorrect )
-                    {
-                        const VDatabase *db;
-                        rc_t rc2 = VDBManagerVOpenDBRead ( self -> vmgr, & db, schema, spec, args_copy );
-                        if ( rc2 == 0 )
-                        {
-                            rc2 = VDatabaseOpenTableRead ( db, & tbl -> vtbl, altname );
-                            if ( rc2 == 0 )
-                                rc = 0;
-
-                            VDatabaseRelease ( db );
-                        }
-                    }
-                    va_end ( args_copy );
-
-                    VSchemaRelease(schema);
-
-                    if ( rc == 0 )
-                    {
-                        rc = VTableOpenMetadataRead ( tbl -> vtbl, & tbl -> meta );
-                        if ( rc == 0 )
-                        {
-                            rc = KMetadataVersion ( tbl -> meta, & tbl -> metavers );
-                            if ( rc == 0 )
-                            {
-                                rc = VTableCreateCursorRead ( tbl -> vtbl, & tbl -> curs );
-                                if ( rc == 0 )
-                                {
-                                    tbl -> mode = self -> mode;
-                                    tbl -> read_only = true;
-                                    KRefcountInit ( & tbl -> refcount, 1, "SRATable", "OpenTableRead", spec );
-                                        
-                                    rc = SRATableFillOut ( tbl, false );
-                                    if ( rc == 0 )
-                                    {
-                                        * rslt = tbl;
-                                        return 0;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    
-                }
-                SRATableWhack ( tbl );
-            }
-        }
-
-        * rslt = NULL;
-    }
-    return rc;
-}
-
-/* OpenRead
- *  open an existing table
- *
- *  "tbl" [ OUT ] - return parameter for table
- *
- *  "spec" [ IN ] - NUL terminated UTF-8 string giving path
- *  to table.
- */
-LIB_EXPORT rc_t CC SRAMgrVOpenTableRead ( const SRAMgr *self,
-        const SRATable **crslt, const char *spec, va_list args )
-{
-    rc_t rc;
-    char tblpath [ 4096 ];
-    int num_writ = vsnprintf ( tblpath, sizeof tblpath, spec, args );
-    if ( num_writ < 0 || ( size_t ) num_writ >= sizeof tblpath )
-        rc = RC ( rcSRA, rcMgr, rcOpening, rcPath, rcExcessive );
-    else
-    {
-        SRATable **rslt = (SRATable **)crslt; /* to avoid "const_casts" below */
-        rc = SRACacheGetTable( self->cache, tblpath, crslt );
-        if  (rc == 0 )
-        {
-            if ( *crslt == NULL )
-            {
-                rc = SRAMgrOpenAltTableRead ( self, crslt, "SEQUENCE", tblpath );
-                if ( rc == 0 )
-                {
-                    rc = SRACacheAddTable( self->cache, tblpath, *rslt);
-                    if ( GetRCObject(rc) == rcParam && GetRCState(rc) == rcExists )
-                    {           /* the same object has appeared in the cache since our call to SRACacheGetTable above;  */
-                       rc = 0;  /* return the new object, never mind the cache */
-                    }
-                    else if ( ! SRACacheMetricsLessThan(&self->cache->current, &self->cache->hardThreshold) )
-                       rc = SRACacheFlush(self->cache);
-                }
-            }
-        }
-        else if ( (GetRCObject(rc) == rcName && GetRCState(rc) == rcInvalid) ||   /* accessions with irregular names are not cached */
-                  (GetRCObject(rc) == rcParam && GetRCState(rc) == rcBusy)    )   /* in cache but in use */
-        {    
-            rc = SRAMgrOpenAltTableRead ( self, crslt, "SEQUENCE", tblpath );
-            if (rc == 0)
-                (*rslt)->mgr = SRAMgrAttach(self);
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrOpenTableRead ( const SRAMgr *self,
-        const SRATable **tbl, const char *spec, ... )
-{
-    rc_t rc;
-    
-    va_list args;
-    va_start ( args, spec );
-
-    rc = SRAMgrVOpenTableRead ( self, tbl, spec, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Read - PRIVATE
- *  column message sent via table
- */
-rc_t SRATableRead ( const SRATable *self, spotid_t id, uint32_t idx,
-    const void **base, bitsz_t *offset, bitsz_t *size )
-{
-    rc_t rc;
-
-    if ( base == NULL || offset == NULL || size == NULL )
-        rc = RC ( rcSRA, rcColumn, rcReading, rcParam, rcNull );
-    else if ( self == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        rc = 0;
-
-        /* open cursor */
-        if ( ! self -> curs_open )
-        {
-            rc = VCursorOpen(self->curs);
-            if ( rc == 0 )
-                ((SRATable *)self)->curs_open = true;
-        }
-
-        if ( rc == 0 )
-        {
-            uint32_t elem_bits, elem_off, elem_cnt;
-            rc = VCursorCellDataDirect ( self -> curs, id, idx,
-                & elem_bits, base, & elem_off, & elem_cnt );
-            if ( rc == 0 )
-            {
-                * offset = elem_off * elem_bits;
-                * size   = elem_cnt * elem_bits;
-                return 0;
-            } else if( UIError(rc, NULL, self->vtbl) ) {
-                UITableLOGError(rc, self->vtbl, true);
-            }
-        }
-    }
-
-    if ( base != NULL )
-        * base = NULL;
-    if ( offset != NULL )
-        * offset = 0;
-    if ( size != NULL )
-        * size = 0;
-
-    return rc;
-}
-
-/* GetSpotId
- *  convert spot name to spot id
- *
- *  "id" [ OUT ] - return parameter for min(spot_id)-max(spot_id)
- *
- *  "spot_name" [ IN ] - external spot name string
- *  in platform canonical format.
- */
-LIB_EXPORT rc_t CC SRATableGetSpotId ( const SRATable *self,
-        spotid_t *rslt, const char *spot_name )
-{
-    rc_t rc;
-    if( self == NULL || spot_name == NULL){
-        rc=RC(rcSRA, rcTable, rcListing, rcSelf, rcName);
-    } else {
-        rc=VCursorParamsSet((struct VCursorParams*)self->curs,"QUERY_BY_NAME" ,spot_name);
-        if( rc == 0) {
-            struct {
-                uint64_t start_id;
-                uint64_t id_count;
-                int64_t x;
-                int64_t y;
-            } out;
-            uint32_t idx,len;
-            rc = VCursorAddColumn(self->curs, &idx, "SPOT_IDS_FOUND");
-            if( rc == 0 || GetRCState(rc) == rcExists){
-                rc = VCursorReadDirect(self->curs,1,idx,sizeof(out) * 8,&out, 1 , &len);
-                if ( rc == 0 ) {
-                    if(out.id_count==1) {
-                        if(rslt) *rslt=out.start_id;
-                        return 0;
-                    } else if(out.id_count > 1) { /*** doing table range scan in Name space - not relying on X and Y***/
-                        uint32_t x_idx;
-                        rc = VCursorAddColumn(self->curs, &x_idx, "X");
-                        if( rc == 0 || GetRCState(rc) == rcExists){
-                            uint32_t y_idx;
-                            rc = VCursorAddColumn(self->curs, &y_idx, "Y");
-                            if(rc == 0 || GetRCState(rc) == rcExists){
-                                spotid_t rowid;
-                                for(rowid = out.start_id; rowid < out.start_id + out.id_count; rowid ++){
-                                    int32_t x,y;
-                                    rc = VCursorReadDirect(self->curs,rowid,x_idx,32,&x,1, &len);
-                                    if(rc == 0){
-                                        rc = VCursorReadDirect(self->curs,rowid,y_idx,32,&y,1, &len);
-                                        if(rc == 0 && x==out.x && y==out.y){
-                                            if(rslt) *rslt=rowid;
-                                            return 0;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    rc = RC ( rcSRA, rcIndex, rcSearching, rcColumn, rcNotFound );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* ListCol
- *  returns a list of simple column names
- *  each name represents at least one typed column
- *
- *  "names" [ out ] - return parameter for names list
- */
-LIB_EXPORT rc_t CC SRATableListCol( const SRATable *self, SRANamelist **rslt ) {
-    if ( self != NULL )
-        return VTableListCol ( self -> vtbl, (KNamelist **)rslt );
-    return RC(rcSRA, rcTable, rcListing, rcSelf, rcName);
-}
-
-
-/* ColDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
- *  into "typedecls" of the default datatype for the named column
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- */
-LIB_EXPORT rc_t CC SRATableColDatatypes( const SRATable *self,
-        const char *col, uint32_t *dflt_idx, SRANamelist **rslt ) {
-    if ( self != NULL )
-        return VTableColumnDatatypes ( self -> vtbl, col, dflt_idx, (KNamelist **)rslt );
-    return RC(rcSRA, rcTable, rcListing, rcSelf, rcName);
-}
-
-rc_t SRATableColDatatype ( const SRATable *self,
-        uint32_t idx, VTypedecl *type, VTypedef *def )
-{
-    rc_t rc;
-    if ( type == NULL && def == NULL )
-        rc = RC ( rcSRA, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        union { VTypedecl td; VTypedef def; } dummy;
-        if ( type == NULL )
-            type = & dummy . td;
-        else if ( def == NULL )
-            def = & dummy . def;
-
-        if ( idx == 0 )
-            rc = RC ( rcSRA, rcColumn, rcAccessing, rcSelf, rcNull );
-        else if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            VTypedesc desc;
-            rc = VCursorDatatype ( self -> curs, idx, type, & desc );
-            if ( rc == 0 )
-            {
-                rc = VSchemaDescribeTypedef ( VCursorGetSchema(self -> curs), def, type -> type_id );
-                if ( rc == 0 )
-                    return 0;
-            }
-        }
-
-        memset ( type, 0, sizeof * type );
-        memset ( def, 0, sizeof * def );
-    }
-    return rc;
-}
-
-/* MetaRevision
- *  returns current revision number
- *  where 0(zero) means tip
- */
-LIB_EXPORT rc_t CC SRATableMetaRevision( const SRATable *self, uint32_t *rslt )
-{
-    if (self == NULL)
-        return RC(rcSRA, rcTable, rcAccessing, rcSelf, rcNull);
-    return KMetadataRevision (self->meta,rslt);
-}
-
-
-/* MaxRevision
- *  returns the maximum revision available
- */
-LIB_EXPORT rc_t CC SRATableMaxMetaRevision( const SRATable *self, uint32_t *rslt )
-{
-    if (self == NULL)
-        return RC(rcSRA, rcTable, rcAccessing, rcSelf, rcNull);
-    return KMetadataMaxRevision(self->meta,rslt);
-}
-
-/* UseMetaRevision
- *  opens indicated revision of metadata
- *  all non-zero revisions are read-only
- */
-LIB_EXPORT rc_t CC SRATableUseMetaRevision ( const SRATable *cself, uint32_t revision )
-{
-    rc_t rc;
-
-    if ( cself == NULL )
-        rc = RC ( rcSRA, rcTable, rcUpdating, rcSelf, rcNull );
-    else if ( cself -> read_only == false )
-        rc = RC ( rcSRA, rcTable, rcUpdating, rcMetadata, rcBusy );
-    else
-    {
-        uint32_t cur;
-        rc = KMetadataRevision ( cself -> meta, & cur );
-        if ( rc == 0 && cur != revision )
-        {
-            SRATable *self = ( SRATable* ) cself;
-            const KMetadata *meta;
-            rc = KMetadataOpenRevision ( self -> meta, & meta, revision );
-            if ( rc == 0 )
-            {
-                KMetadataRelease ( self -> meta );
-                self -> meta = meta;
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* OpenMDataNode
- *  open a metadata node
- *
- *  "node" [ OUT ] - return parameter for metadata node
- *
- *  "path" [ IN ] - simple or hierarchical NUL terminated
- *  path to node
- */
-LIB_EXPORT rc_t CC SRATableOpenMDataNodeRead( const SRATable *self, 
-        struct KMDataNode const **node, const char *path, ... ) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRATableVOpenMDataNodeRead(self, node, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableVOpenMDataNodeRead( const SRATable *self,
-        struct KMDataNode const **rslt, const char *path, va_list args ) {
-    if (self == NULL)
-        return RC(rcSRA, rcTable, rcAccessing, rcSelf, rcNull);
-    
-    return KMetadataVOpenNodeRead(self->meta, rslt, path, args);
-}
-
-/* private */
-rc_t SRATableGetIdRange ( const SRATable *self,
-        uint32_t idx, spotid_t id, spotid_t *pfirst, spotid_t *plast )
-{
-    rc_t rc;
-
-    if ( pfirst == NULL && plast == NULL )
-        rc = RC ( rcSRA, rcColumn, rcAccessing, rcParam, rcNull );
-    else
-    {
-        spotid_t dummy;
-        if ( pfirst == NULL )
-            pfirst = & dummy;
-        else if ( plast == NULL )
-            plast = & dummy;
-
-        if ( idx == 0 )
-            rc = RC ( rcSRA, rcColumn, rcAccessing, rcSelf, rcNull );
-        else if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            int64_t first, last;
-            rc = VCursorPageIdRange ( self -> curs, idx, id, & first, & last );
-            if ( rc == 0 )
-            {
-                * pfirst = ( spotid_t ) first;
-                * plast = ( spotid_t ) last;
-
-                if ( ( int64_t ) * pfirst == first && ( int64_t ) * plast == last )
-                    return 0;
-
-                rc = RC ( rcSRA, rcColumn, rcAccessing, rcRange, rcExcessive );
-            }
-        }
-
-        * pfirst = * plast = 0;
-    }
-
-    return rc;
-}
-
-/* semi-private for sra-dbcc */
-LIB_EXPORT rc_t CC SRATableGetVTableRead( const SRATable *self, const VTable **rslt )
-{
-    if (rslt == NULL)
-        return RC(rcSRA, rcTable, rcAccessing, rcParam, rcNull);
-    
-    if (self == NULL)
-    {
-        * rslt = NULL;
-        return RC(rcSRA, rcTable, rcAccessing, rcSelf, rcNull);
-    }
-
-    *rslt = self->vtbl;
-    return VTableAddRef(*rslt);
-}
-
-LIB_EXPORT rc_t CC SRATableGetKTableRead ( const SRATable *self, struct KTable const **ktbl )
-{
-    rc_t rc;
-
-    if ( ktbl == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            return VTableGetKTableRead ( self -> vtbl, ktbl );
-        }
-
-        * ktbl = NULL;
-    }
-
-    return rc;
-}
-
-/* Locked
- *  returns true if locked
- */
-LIB_EXPORT bool CC SRATableLocked( const SRATable *self )
-{
-    return self ? VTableLocked(self->vtbl) : false;
-}
-
-LIB_EXPORT struct VSchema const* CC SRATableGetSchema ( struct SRATable const *self )
-{
-        return self ? VCursorGetSchema( self->curs ) : NULL;
-}
-
-/* sfa_filter
- *  if a name is found in list, exclude it
- */
-#define DEBUG_SORT(msg) DBGMSG (DBG_SRA, DBG_FLAG(DBG_SRA_SORT), msg)
-
-/* sfa_sort
- *  reorders list
- */
-enum sfa_path_type_id
-{
-    sfa_not_set = -1,
-    sfa_exclude,
-    sfa_non_column,
-    sfa_required,
-    sfa_preferred,
-    sfa_optional
-};
-
-#if _DEBUGGING
-const char* sfa_path_type_id[] = {
-    "not_set",
-    "exclude",
-    "non_column",
-    "required",
-    "preferred",
-    "optional"
-};
-#endif
-
-typedef struct reorder_t_struct {
-    const char * path;
-    uint64_t     size;
-    enum sfa_path_type_id type_id;
-} reorder_t;
-
-typedef enum sfa_path_type_id (CC *sfa_path_type_func)( const char *path );
-
-static
-bool CC sfa_filter(const KDirectory *dir, const char *leaf, void* func)
-{
-    bool ret = true;
-    sfa_path_type_func f = (sfa_path_type_func)func;
-    enum sfa_path_type_id type = f(leaf);
-
-    ret = type >= sfa_non_column;
-    DEBUG_SORT(("%s: %s %s %s\n", __func__, leaf, sfa_path_type_id[type + 1], ret ? "keep" : "drop"));
-    return ret;
-}
-
-static
-bool CC sfa_filter_light(const KDirectory *dir, const char *leaf, void* func)
-{
-    bool ret = true;
-    sfa_path_type_func f = (sfa_path_type_func)func;
-
-    enum sfa_path_type_id type = f(leaf);
-
-    ret = type >= sfa_non_column && type < sfa_optional;
-    DEBUG_SORT(("%s: %s %s %s\n", __func__, leaf, sfa_path_type_id[type + 1], ret ? "keep" : "drop"));
-    return ret;
-}
-
-#define MATCH( ptr, str ) \
-    ( (memcmp(ptr, str, sizeof(str) - 2) == 0 && \
-       ((ptr)[sizeof(str) - 2] == '\0' || (ptr)[sizeof(str) - 2] == '/')) ? \
-        (ptr) += sizeof(str) - (((ptr)[sizeof(str) - 2] == '/') ? 1 : 2) : (const char*) 0)
-
-static
-enum sfa_path_type_id CC sfa_path_type_tbl( const char *path )
-{
-    /* use first character as distinguisher for match */
-    switch ( path [ 0 ] )
-    {
-    case 'c':
-        /* perhaps it's a column */
-        if ( MATCH ( path, "col/" ) )
-        {
-            switch ( path [ 0 ] )
-            {
-            case 'D':
-                if ( MATCH ( path, "DELETION_QV/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "DELETION_TAG/" ) )
-                    return sfa_optional;
-                break;
-            case 'H':
-                if ( MATCH ( path, "HOLE_NUMBER/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "HOLE_STATUS/" ) )
-                    return sfa_optional;
-                break;
-            case 'I':
-                if ( MATCH ( path, "INTENSITY/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "INSERTION_QV/" ) )
-                    return sfa_optional;
-                break;
-            case 'N':
-                if ( MATCH ( path, "NAME_FMT/" ) )
-                    return sfa_preferred;
-                if ( MATCH ( path, "NAME/" ) )
-                    return sfa_preferred;
-                if ( MATCH ( path, "NOISE/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "NUM_PASSES/" ) )
-                    return sfa_optional;
-                break;
-            case 'P':
-                if ( MATCH ( path, "POSITION/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "PRE_BASE_FRAMES/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "PULSE_INDEX/" ) )
-                    return sfa_optional;
-                break;
-            case 'Q':
-                if ( MATCH ( path, "QUALITY2/" ) )
-                    return sfa_optional;
-                break;
-            case 'S':
-                if ( MATCH ( path, "SIGNAL/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "SPOT_NAME/" ) )
-                    return sfa_preferred;
-                if ( MATCH ( path, "SUBSTITUTION_QV/" ) )
-                    return sfa_optional;
-                if ( MATCH ( path, "SUBSTITUTION_TAG/" ) )
-                    return sfa_optional;
-                break;
-            case 'W':
-                if ( MATCH ( path, "WIDTH_IN_FRAMES/" ) )
-                    return sfa_optional;
-                break;
-            case 'X':
-            case 'Y':
-                if ( path [ 1 ] == '/' )
-                    return sfa_preferred;
-                break;
-            }
-        }
-        return sfa_required;
-
-    case 'i':
-        /* look for skey index */
-        if ( MATCH ( path, "idx/skey" ) )
-            if ( path [ 0 ] == 0 || strcmp ( path, ".md5" ) == 0 )
-                return sfa_preferred;
-        if ( MATCH ( path, "idx/fuse-" ) )
-            return sfa_exclude;
-        break;
-
-    case 's':
-        /* look for old skey index */
-        if ( MATCH ( path, "skey" ) )
-            if ( path [ 0 ] == 0 || strcmp ( path, ".md5" ) == 0 )
-                return sfa_preferred;
-        break;
-    }
-    /* anything not recognized is non-column required */
-    return sfa_non_column;
-}
-
-static
-enum sfa_path_type_id CC sfa_path_type_db ( const char *path )
-{
-    /* use first character as distinguisher for match */
-    switch ( path [ 0 ] )
-    {
-    case 't':
-        /* perhaps it's a table */
-        if ( MATCH ( path, "tbl/" ) )
-        {
-            switch ( path [ 0 ] )
-            {
-            case 0:
-                return sfa_non_column;
-            case 'S':
-                if ( MATCH ( path, "SEQUENCE/" ) )
-                    return sfa_path_type_tbl(path);
-                break;
-            case 'C':
-                if ( MATCH ( path, "CONSENSUS/" ) )
-                    return sfa_path_type_tbl(path);
-                break;
-            case 'P':
-                if ( MATCH ( path, "PRIMARY_ALIGNMENT/" ) )
-                    return sfa_path_type_tbl(path);
-                break;
-            case 'R':
-                if ( MATCH ( path, "REFERENCE/" ) )
-                    return sfa_path_type_tbl(path);
-                break;
-            }
-            /* all other tables are optional */
-            return sfa_optional;
-        }
-    }
-    /* anything not recognized is non-column required */
-    return sfa_non_column;
-}
-#undef MATCH
-
-static
-int CC sfa_path_cmp ( const void **_a, const void **_b, void * ignored )
-{
-    const reorder_t * a = *_a;
-    const reorder_t * b = *_b;
-    int ret;
-
-    DEBUG_SORT(("%s enter\t%s %s %lu \t%s %s %lu", __func__, 
-                a->path, sfa_path_type_id[a->type_id + 1], a->size,
-                b->path, sfa_path_type_id[b->type_id + 1], b->size));
-
-    ret = a->type_id - b->type_id;
-    if (ret == 0)
-    {
-        if (a->size > b->size)
-            ret = 1;
-        else if (a->size < b->size)
-            ret = -1;
-        else
-            ret = strcmp (a->path, b->path);
-    }
-    DEBUG_SORT(("\t%d\n", ret));
-    return ret;
-}
-
-typedef
-struct to_nv_data_struct
-{
-    const KDirectory * d;
-    Vector * v;
-    rc_t rc;
-    sfa_path_type_func path_type;
-} to_nv_data;
-
-static
-void CC to_nv (void * _item, void * _data)
-{
-    const char* path = _item;
-    to_nv_data* data = _data;
-    reorder_t* obj;
-
-    if (data->rc == 0)
-    {
-        obj = malloc (sizeof (*obj));
-        if (obj == NULL)
-            data->rc = RC (rcSRA, rcVector, rcConstructing, rcMemory, rcExhausted);
-        else
-        {
-            rc_t rc = KDirectoryFileSize (data->d, &obj->size, path);
-            if (rc == 0)
-            {
-                obj->path = path;
-                obj->type_id = data->path_type(path);
-                rc = VectorAppend (data->v, NULL, obj);
-            }
-
-            if (rc)
-            {
-                free (obj);
-                data->rc = rc;
-            }
-        }
-    }
-}
-
-static
-void CC item_whack (void * item, void * ignored)
-{
-    free (item);
-}
-
-static
-rc_t CC sfa_sort( const KDirectory *dir, Vector *v, sfa_path_type_func func )
-{
-    /* assume "v" is a vector of paths - hopefully relative to "dir" */
-    Vector nv;
-    to_nv_data data;
-    uint32_t base;
-
-    DEBUG_SORT(("%s enter\n", __func__));
-
-    base = VectorStart (v);
-    VectorInit (&nv, base, VectorLength (v));
-    data.d = dir;
-    data.v = &nv;
-    data.rc = 0;
-    data.path_type = func;
-
-    VectorForEach (v, false, to_nv, &data);
-
-    if(data.rc == 0) {
-        uint32_t idx = 0;
-        uint32_t limit = VectorLength (v) + base;
-
-        VectorReorder(&nv, sfa_path_cmp, NULL);
-
-        for (idx = base; idx < limit; ++idx) {
-            const reorder_t * tmp;
-            void * ignore;
-
-            tmp = VectorGet (&nv, idx);
-            data.rc = VectorSwap (v, idx + base, tmp->path, &ignore);
-            if(data.rc) {
-                break;
-            }
-        }
-    }
-    VectorWhack (&nv, item_whack, NULL);
-    DEBUG_SORT(("%s exit %d %R\n", __func__, data.rc, data.rc));
-    return data.rc;
-}
-
-static
-rc_t CC sfa_sort_db( const KDirectory *dir, Vector *v )
-{
-    return sfa_sort(dir, v, sfa_path_type_db);
-}
-
-static
-rc_t CC sfa_sort_tbl( const KDirectory *dir, Vector *v )
-{
-    return sfa_sort(dir, v, sfa_path_type_tbl);
-}
-
-/* MakeSingleFileArchive
- *  makes a single-file-archive file from an SRA table
- *
- *  contents are ordered by frequency and necessity of access
- *
- *  "lightweight" [ IN ] - when true, include only those components
- *  required for read and quality operations.
- *
- *  "ext" [OUT,NULL] - optional file name extension to use for file
- */
-LIB_EXPORT rc_t CC SRATableMakeSingleFileArchive ( const SRATable *self, const KFile **sfa, bool lightweight, const char** ext)
-{
-    rc_t rc;
-
-    if( sfa == NULL ) {
-        rc = RC(rcSRA, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        *sfa = NULL;
-        if( self == NULL ) {
-            rc = RC(rcSRA, rcTable, rcAccessing, rcSelf, rcNull);
-        } else {
-            const VDatabase *db;
-            if( (rc = VTableOpenParentRead(self->vtbl, &db)) == 0 && db != NULL ) {
-                const KDatabase *kdb;
-                if ((rc = VDatabaseOpenKDatabaseRead(db, &kdb)) == 0) {
-                    const KDirectory *db_dir;
-                    if( (rc = KDatabaseOpenDirectoryRead(kdb, &db_dir)) == 0 ) {
-                        rc = KDirectoryOpenTocFileRead(db_dir, sfa,
-                            sraAlign4Byte,
-                            lightweight ? sfa_filter_light : sfa_filter,
-                            (void*)sfa_path_type_db, sfa_sort_db);
-                        KDirectoryRelease(db_dir);
-                        if( ext != NULL ) {
-                            *ext = CSRA_EXT(lightweight);
-                        }
-                    }
-                    KDatabaseRelease(kdb);
-                }
-                VDatabaseRelease(db);
-            } else {
-                const KTable *ktbl;
-                rc = SRATableGetKTableRead(self, &ktbl);
-                if( rc == 0 ) {
-                    const KDirectory *tbl_dir;
-                    rc = KTableGetDirectoryRead(ktbl, &tbl_dir);
-                    if( rc == 0 ) {
-                        rc = KDirectoryOpenTocFileRead(tbl_dir, sfa, sraAlign4Byte,
-                            lightweight ? sfa_filter_light : sfa_filter, (void*)sfa_path_type_tbl, sfa_sort_tbl);
-                        KDirectoryRelease(tbl_dir);
-                        if( ext != NULL ) {
-                            *ext = SRA_EXT(lightweight);
-                        }
-                    }
-                    KTableRelease(ktbl);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/* OpenAltTableRead
- *  opens a table within a database structure with a specific name
- */
-SRA_EXTERN rc_t CC SRAMgrOpenAltTableRead ( const SRAMgr *self,
-    const SRATable **tbl, const char *altname, const char *spec, ... )
-{
-    rc_t rc;
-    
-    va_list args;
-    va_start ( args, spec );
-
-    if ( altname == NULL || altname [ 0 ] == 0 ) {
-        altname = "SEQUENCE";
-    }
-    rc = SRAMgrVOpenAltTableRead ( self, tbl, altname, spec, args );
-
-    va_end ( args );
-    return rc;
-}
diff --git a/libs/sra/sratbl.c b/libs/sra/sratbl.c
deleted file mode 100644
index 3f474d2..0000000
--- a/libs/sra/sratbl.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-#include <vdb/cursor.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include "sra-priv.h"
-
-rc_t SRATableWhack ( SRATable *self )
-{
-    SRATableDestroy ( self );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRATableBaseCount ( const SRATable *self, uint64_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            *rslt = self->base_count;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableSpotCount ( const SRATable *self, uint64_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            *rslt = self->spot_count;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableMinSpotId ( const SRATable *self, spotid_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            *rslt = self->min_spot_id;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableMaxSpotId ( const SRATable *self, spotid_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            *rslt = self->max_spot_id;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
diff --git a/libs/sra/types.c b/libs/sra/types.c
deleted file mode 100644
index d40152d..0000000
--- a/libs/sra/types.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sra/extern.h>
-#include <klib/defs.h>
-#include <sra/types.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VTypedef
- */
-
-
-/* Sizeof
- *  returns the bit size of declared type
- *
- *  technically, this is self -> size * self -> dim.
- */
-#ifndef VTypedefSizeof
-LIB_EXPORT bitsz_t CC VTypedefSizeof ( const VTypedef *self )
-{
-    if ( self == NULL )
-        return 0;
-    return ( bitsz_t ) self -> type_size * self -> dim;
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * VDatatypes
- */
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC VDatatypesAddRef ( const VDatatypes *self )
-{
-    return VSchemaAddRef ( ( const VSchema* ) self );
-}
-
-LIB_EXPORT rc_t CC VDatatypesRelease ( const VDatatypes *self )
-{
-    return VSchemaRelease ( ( const VSchema* ) self );
-}
-
-
-/* ResolveTypedecl
- *  converts a typedecl string to type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved type declaration
- *
- *  "typedecl" [ IN ] - type declaration
- */
-LIB_EXPORT rc_t CC VDatatypesVResolveTypedecl ( const VDatatypes *self,
-    VTypedecl *resolved, const char *typedecl, va_list args )
-{
-    return VSchemaVResolveTypedecl ( ( const VSchema* ) self, resolved, typedecl, args );
-}
-
-LIB_EXPORT rc_t CC VDatatypesResolveTypedecl ( const VDatatypes *self,
-    VTypedecl *resolved, const char *typedecl, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, typedecl );
-    rc = VSchemaVResolveTypedecl ( ( const VSchema* ) self, resolved, typedecl, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-
-/* ResolveTypename
- *  convert a type id into its type definition
- *
- *  "resolved" [ OUT ] - resolved type definition
- *
- *  "typname" [ IN ] - NUL-terminated type name
- */
-LIB_EXPORT rc_t CC VDatatypesResolveTypename ( const VDatatypes *self,
-    VTypedef *resolved, const char *typname )
-{
-    rc_t rc;
-
-    if ( resolved == NULL )
-        rc = RC ( rcSRA, rcSchema, rcResolving, rcParam, rcNull );
-    else
-    {
-        VTypedecl td;
-        rc = VSchemaResolveTypedecl ( ( const VSchema* ) self, & td, typname );
-        if ( rc == 0 )
-        {
-            rc = VSchemaDescribeTypedef ( ( const VSchema* ) self, resolved, td . type_id );
-            if ( rc == 0 )
-                return rc;
-        }
-
-        memset ( resolved, 0, sizeof * resolved );
-    }
-    return rc;
-}
-
-
-/* ResolveTypeid
- *  convert a type id into its type definition
- *
- *  "resolved" [ OUT ] - resolved type definition
- *
- *  "type_id" [ IN ] - 1-based runtime type id
- */
-LIB_EXPORT rc_t CC VDatatypesResolveTypeid ( const VDatatypes *self,
-    VTypedef *resolved, uint32_t type_id )
-{
-    return VSchemaDescribeTypedef ( ( const VSchema* ) self, resolved, type_id );
-}
-
-
-/* SizeofTypedecl
- *  returns the bit size of type declaration
- */
-LIB_EXPORT rc_t CC VDatatypesSizeofTypedecl ( const VDatatypes *self,
-    bitsz_t *type_size, const VTypedecl *td )
-{
-    rc_t rc;
-    if ( type_size == NULL )
-        rc = RC ( rcSRA, rcSchema, rcAccessing, rcParam, rcNull );
-    else
-    {
-        VTypedesc desc;
-        rc = VSchemaDescribeTypedecl ( ( const VSchema* ) self, & desc, td );
-        if ( rc == 0 )
-        {
-            * type_size = VTypedescSizeof ( & desc );
-            return 0;
-        }
-
-        * type_size = 0;
-    }
-    return rc;
-}
-
-
-/* SizeofTypeid
- *  returns the bit size of typeid
- *
- *  "type_size" [ OUT ] - bit size of a type
- *
- *  "type_id" [ IN ] - numerical index of a type
- *
- *  "all_elements" [ IN ] - for multi-dimesional types
- *  return the sum of sizes, otherwise - only for a single element
- */
-LIB_EXPORT rc_t CC VDatatypesSizeofTypeid ( const VDatatypes *self,
-    bitsz_t *type_size, uint32_t type_id, bool all_elements )
-{
-    rc_t rc;
-
-    if ( type_size == NULL )
-        rc = RC ( rcVDB, rcType, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcType, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            VTypedef td;
-            rc = VDatatypesResolveTypeid ( self, & td, type_id );
-            if ( rc == 0 )
-            {
-                * type_size = td . type_size;
-                if ( all_elements )
-                    * type_size *=  td . dim;
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* MakeTypedecl
- *  convert a VTypedecl into canonical text
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated type declaration string
- *
- *  "typedecl" [ IN ] - binary representation of typedecl
- */
-LIB_EXPORT rc_t CC VDatatypesMakeTypedecl ( const VDatatypes *self,
-    char *buffer, size_t bsize, const VTypedecl *typedecl )
-{
-    return VTypedeclToText ( typedecl, ( const VSchema* ) self, buffer, bsize );
-}
-
-
-/* ToSupertype
- *  cast a typedecl to a size-equivalent supertype decl
- *  returns not-found and leaves "typedecl" unchanged
- *  if no supertype exists
- *
- *  "typedecl" [ IN, OUT ] - populated with a correct
- *  type id and vector dimension on input, will be updated
- *  to contain a supertype and equivalent dimension on
- *  output. e.g.:
- *
- *    IN -  { type_id NCBI:qual4, dim 1 }
- *    OUT - { type_id I8, dim 4 }
- */
-LIB_EXPORT rc_t CC VDatatypesToSupertype ( const VDatatypes *self, VTypedecl *typedecl )
-{
-    return VTypedeclToSupertype ( typedecl, ( const VSchema* ) self, typedecl );
-}
-
-
-/* ToIntrinsic - DEPRECATED
- *  cast a typedecl ( if necessary ) to a size-equivalent
- *  intrinsic typedecl.
- *
- *  returns not-found and leaves "typedecl" unchanged
- *  if no intrinsic supertype exists
- *
- *  leaves "typedecl" unchanged if it is already intrinsic.
- *
- *  "typedecl" [ IN, OUT ] - populated with a correct
- *  type id and vector dimension on input, will be updated
- *  to contain a supertype and equivalent dimension on
- *  output. e.g.:
- *
- *    IN -  { type_id NCBI:qual4, dim 1 }
- *    OUT - { type_id I8, dim 4 }
- */
-LIB_EXPORT rc_t CC VDatatypesToIntrinsic ( const VDatatypes *self, VTypedecl *typedecl )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcSRA, rcType, rcCasting, rcSelf, rcNull );
-    else if ( typedecl == NULL )
-        rc = RC ( rcSRA, rcType, rcCasting, rcParam, rcNull );
-    else
-    {
-        const VSchema *schema = ( const VSchema* ) self;
-        uint32_t last_intrinsic = VSchemaLastIntrinsicTypeId ( schema );
-        if ( last_intrinsic == 0 )
-            rc = RC ( rcSRA, rcType, rcCasting, rcSelf, rcInvalid );
-        else for ( rc = 0; typedecl -> type_id > last_intrinsic; )
-        {
-            if ( ! VTypedeclToSupertype ( typedecl, schema, typedecl ) )
-                break;
-        }
-    }
-
-    return rc;
-}
-
-
-/* ToAncestor
- *  cast a typedecl to a size-equivalent ancestor decl
- *  returns true if cast can be performed
- */
-LIB_EXPORT bool CC VDatatypesToAncestor ( const VDatatypes *self,
-    const VTypedecl *to, const VTypedecl *from )
-{
-    VTypedecl cast;
-    return VTypedeclToTypedecl ( from, ( const VSchema* ) self, to, & cast, NULL );
-}
diff --git a/libs/sra/wsramgr.c b/libs/sra/wsramgr.c
deleted file mode 100644
index 6c430bc..0000000
--- a/libs/sra/wsramgr.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-
-#include <sra/wsradb.h>
-#include <os-native.h>
-
-#define KONST
-#include "sra-priv.h"
-#include <sra/types.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-
-#include <stdlib.h>
-#include <sysalloc.h>
-
-#define RC_MODULE (rcSRA)
-#define RC_TARGET (rcMgr)
-#define CLASS "SRAMgr"
-
-
-/* MakeUpdate
- *  create library handle for read/write access
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- *
- *  NB - not implemented in read-only library,
- *  and the read-only library may not be mixed with read/write
- */
-LIB_EXPORT rc_t CC SRAMgrMakeUpdate ( SRAMgr **mgrp, struct KDirectory *wd )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcSRA, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        VDBManager *vmgr;
-        rc = VDBManagerMakeUpdate ( & vmgr, wd );
-        if ( rc == 0 )
-        {
-            SRAMgr *mgr;
-            rc = SRAMgrMake ( & mgr, vmgr , NULL );
-            if ( rc == 0 )
-            {
-                mgr -> read_only = false;
-                * mgrp = mgr;
-                return 0;
-            }
-
-            VDBManagerRelease ( vmgr );
-        }
-
-        * mgrp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Drop
- *  drop an existing table
- *
- *  "force" [ IN ] - if true, make every attempt to remove table
- *
- *  "path" [ IN ]  - NUL terminated table name
- */
-LIB_EXPORT rc_t CC SRAMgrDropTable( SRAMgr *self, bool force, const char *path, ... ) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRAMgrVDropTable(self, force, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrVDropTable( SRAMgr *self, bool force, const char *path, va_list args ) {
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcSelf, rcNull);
-    if (path == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcParam, rcNull);
-    return VDBManagerVDrop(self->vmgr, kptTable, path, args);
-}
-
-LIB_EXPORT rc_t CC SRAMgrVLock ( SRAMgr *self, const char *path, va_list args ) {
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcSelf, rcNull);
-    if (path == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcParam, rcNull);
-    return VDBManagerVLock(self->vmgr, path, args);
-}
-
-LIB_EXPORT rc_t CC SRAMgrLock ( SRAMgr *self, const char *path, ... ) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRAMgrVLock(self, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrVUnlock ( SRAMgr *self, const char *path, va_list args ) {
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcSelf, rcNull);
-    if (path == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcRemoving, rcParam, rcNull);
-    return VDBManagerVUnlock(self->vmgr, path, args);
-}
-
-LIB_EXPORT rc_t CC SRAMgrUnlock ( SRAMgr *self, const char *path, ... ) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRAMgrVUnlock(self, path, va);
-    va_end(va);
-    return rc;
-}
-
-
-/* SetMD5Mode
- *  sets default MD5 file mode for all objects
- *  opened for update under table
- */
-LIB_EXPORT rc_t CC SRAMgrSetMD5Mode( SRAMgr *self, bool useMD5 ) {
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcUpdating, rcSelf, rcNull);
-    self->mode = useMD5 ? (self->mode | kcmMD5) : (self->mode & ~kcmMD5);
-    return 0;
-}
diff --git a/libs/sra/wsraschema-stub.c b/libs/sra/wsraschema-stub.c
deleted file mode 100644
index 2cfdc97..0000000
--- a/libs/sra/wsraschema-stub.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/sraschema.h>
-#include <sra/sradb-priv.h>
-#include <klib/rc.h>
-
-#include "sra-priv.h"
-
-/*--------------------------------------------------------------------------
- * SRASchema
- *  a schema object pre-loaded with default SRA schema
- */
-
-/* Make
- *  create an instance of the default SRA schema
- */
-rc_t CC VDBManagerMakeSRASchema ( struct VDBManager const *self, struct VSchema **schema )
-{
-    return SRASchemaMake ( schema, self );
-}
-
-rc_t CC SRAMgrMakeSRASchema ( const SRAMgr *self, struct VSchema **schema )
-{
-    if ( self != NULL )
-        return VDBManagerMakeSRASchema ( self -> vmgr, schema );
-    return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-}
diff --git a/libs/sra/wsratbl.c b/libs/sra/wsratbl.c
deleted file mode 100644
index 945ae68..0000000
--- a/libs/sra/wsratbl.c
+++ /dev/null
@@ -1,649 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sra/extern.h>
-#include <sra/wsradb.h>
-#include <sra/types.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/meta.h>
-#include <klib/printf.h> /* string_vprintf */
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include "sra-debug.h"
-
-#define KONST
-#include "sra-priv.h"
-
-#define RC_MODULE (rcSRA)
-#define RC_TARGET (rcTable)
-#define CLASS "SRATable"
-
-/* Whack
- */
-
-rc_t SRATableWhack ( SRATable *self )
-{
-    SRATableDestroy( self );
-    return 0;
-}
-
-/* Create
- *  creates a new table
- *
- *  "tbl" [ OUT ] - return parameter for table
- *
- *  "path" [ IN ] - NUL terminated table name
- */
-LIB_EXPORT rc_t CC SRAMgrCreateTable(SRAMgr *self, SRATable **tbl, const char *typespec, const char *path, ...) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRAMgrVCreateTable(self, tbl, typespec, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrVCreateTable ( SRAMgr *self, SRATable **rslt,
-    const char *typespec, const char *spec, va_list args )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcConstructing, rcSelf, rcNull );
-        else if ( spec == NULL )
-            rc = RC ( rcSRA, rcTable, rcConstructing, rcString, rcNull );
-        else if ( spec [ 0 ] == 0 )
-            rc = RC ( rcSRA, rcTable, rcConstructing, rcString, rcEmpty );
-        else
-        {
-            char path [ 4097 ];
-            size_t act_size = 0;
-            
-            rc = string_vprintf(path, 4097, &act_size, spec, args);
-            path[act_size] = '\0';
-            if ( rc == 0 )
-            {
-                VTable *vtbl;
-                rc = VDBManagerCreateTable ( self -> vmgr, & vtbl, self -> schema,
-                    typespec, ( self -> mode & kcmBitMask ) | kcmCreate, path );
-                if ( rc == 0 )
-                {
-                    rc = VTableColumnCreateParams ( vtbl, kcmCreate, kcsCRC32, 0 );
-                    if ( rc == 0 )
-                    {
-                        SRATable *tbl = calloc ( 1, sizeof * tbl );
-                        if ( tbl == NULL )
-                            rc = RC ( rcSRA, rcTable, rcConstructing, rcMemory, rcExhausted );
-                        else
-                        {
-                            tbl -> vtbl = vtbl;
-
-                            rc = VTableOpenMetadataUpdate ( vtbl, & tbl -> meta );
-                            if ( rc == 0 )
-                                rc = KMetadataVersion ( tbl -> meta, & tbl -> metavers );
-                            if ( rc == 0 )
-                                rc = VTableCreateCursorWrite ( vtbl, & tbl -> curs, kcmInsert );
-                            if ( rc == 0 )
-                            {
-                                tbl -> mgr = SRAMgrAttach ( self );
-                                tbl -> mode = self -> mode;
-                                tbl -> read_only = false;
-                                KRefcountInit ( & tbl -> refcount, 1, "SRATable", "OpenTableUpdate", path );
-                                VectorInit ( & tbl -> wcol, 0, 16 );
-                                * rslt = tbl;
-                                return 0;
-                            }
-
-                            vtbl = NULL;
-                            SRATableWhack ( tbl );
-                        }
-                    }
-
-                    VTableRelease ( vtbl );
-                }
-            }
-        }
-
-        * rslt = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenUpdate
- *  open an existing table
- *
- *  "run" [ OUT ] - return parameter for table
- *
- *  "path" [ IN ] - NUL terminated table name
- */
-LIB_EXPORT rc_t CC SRAMgrOpenTableUpdate(SRAMgr *self, SRATable **tbl, const char *path, ...) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRAMgrVOpenTableUpdate(self, tbl, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRAMgrVOpenTableUpdate(SRAMgr *mgr, SRATable **rslt, const char *spec, va_list args) {
-    SRATable *self;
-    char path[4096];
-    rc_t rc;
-    
-    if (mgr == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcConstructing, rcSelf, rcNull);
-    if (spec == NULL || rslt == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcConstructing, rcParam, rcNull);
-    
-    *rslt = NULL;
-    
-    rc = ResolveTablePath(mgr, path, sizeof(path), spec, args);
-    if (rc)
-        return rc;
-    
-    self = calloc(1, sizeof(*self));
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcConstructing, rcMemory, rcExhausted);
-    
-    rc = VDBManagerOpenTableUpdate(mgr->vmgr, &self->vtbl, mgr->schema, path);
-    if (rc == 0) {
-        rc = VTableOpenMetadataUpdate(self->vtbl, &self->meta);
-        if (rc == 0) {
-            rc = KMetadataVersion(self->meta, &self->metavers);
-            if (rc == 0) {
-                rc = VTableCreateCursorWrite(self->vtbl, &self->curs, kcmInsert);
-                if (rc == 0) {
-                    self->mgr = SRAMgrAttach(mgr);
-                    self->mode = mgr->mode;
-                    self->read_only = false;
-                    KRefcountInit(&self->refcount, 1, "SRATable", "OpenTableUpdate", path);
-                    
-                    rc = SRATableFillOut ( self, true );
-                    if ( rc == 0 )
-                    {
-                        VectorInit ( & self -> wcol, 0, 16 );
-                    
-                        *rslt = self;
-                        return 0;
-                    }
-                }
-            }
-        }
-    }
-    SRATableWhack(self);
-    return rc;
-}
-
-/* NewSpot
- *  creates a new spot record,
- *  returning spot id.
- *
- *  "id" [ OUT ] - return parameter for id of newly created spot
- */
-LIB_EXPORT rc_t CC SRATableNewSpot( SRATable *self, spotid_t *id ) {
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcInserting, rcSelf, rcNull);
-    if (id == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcInserting, rcParam, rcNull);
-    
-    if (self->curs_open == false) {
-        SRADBG(("opening cursor\n"));
-        rc = VCursorOpen(self->curs);
-        if (rc)
-            return rc;
-        self->curs_open = true;
-    }
-    
-    rc = VCursorOpenRow(self->curs);
-    if (rc == 0) {
-        int64_t rowid;
-        if( (rc = VCursorRowId(self->curs, &rowid)) == 0 ) {
-            *id = rowid;
-        }
-    }
-    return rc;
-}
-
-/* OpenSpot
- *  opens an existing spot record from id
- *
- *  "id" [ IN ] - 1-based spot id
- */
-LIB_EXPORT rc_t CC SRATableOpenSpot( SRATable *self, spotid_t id ) {
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcSelf, rcNull);
-#if 0
-    /* TODO: translate spot id to row id */
-    rc = VCursorSetRowId(self->curs, id);
-    if (rc == 0) {
-        rc = VCursorOpenRow(self->curs);
-    }
-#else
-    rc = RC(RC_MODULE, RC_TARGET, rcOpening, rcFunction, rcUnsupported);
-#endif
-    return rc;
-}
-
-
-/* CloseSpot
- *  closes a spot opened with either NewSpot or OpenSpot
- */
-LIB_EXPORT rc_t CC SRATableCloseSpot( SRATable *self ) {
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcClosing, rcSelf, rcNull);
-    
-    rc = VCursorCommitRow(self->curs);
-    if (rc == 0)
-        return VCursorCloseRow(self->curs);
-    VCursorCloseRow(self->curs);
-    return rc;
-}
-
-
-/* Commit
- *  commit all changes
- */
-LIB_EXPORT rc_t CC SRATableCommit( SRATable *self ) {
-    rc_t rc;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcCommitting, rcSelf, rcNull);
-    rc = VCursorCommit(self->curs);
-    VCursorRelease(self->curs);
-    self->curs = NULL;
-    if (rc == 0)
-        rc = VTableReindex(self->vtbl);
-    return rc;
-}
-
-static int CC cmp_index( const void *A, const void *B ) {
-    return *(const uint32_t *)A - ((const SRAColumn *)B)->idx;
-}
-
-static bool find_by_index(const Vector *vec, uint32_t idx, uint32_t *cndx) {
-    uint32_t found;
-    
-    if ( VectorFind(vec, &idx, &found, cmp_index ) != NULL ) {
-        *cndx = found;
-        return true;
-    }
-    return false;
-}
-
-/* OpenColumnWrite
- *  open a column for write
- *
- *  "idx" [ OUT ] - return parameter for 1-based column index.
- *
- *  "col" [ OUT, NULL OKAY ] - optional return parameter for
- *  newly opened column.
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving column name
- *
- *  "datatype" [ IN ] - NUL terminated string in ASCII
- *   describing fully qualified column data type
- */
-LIB_EXPORT rc_t CC SRATableOpenColumnWrite ( SRATable *self,
-    uint32_t *idx, SRAColumn **col, const char *name, const char *datatype )
-{
-    rc_t rc;
-    SRAColumn *rslt;
-    uint32_t ndx, cndx;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcSelf, rcNull);
-    
-    if (name == NULL || idx == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcParam, rcNull);
-    
-    *idx = 0;
-    
-    if (datatype && datatype[0])
-    {
-        SRADBG(("adding column (%s)%s\n", datatype, name));
-        rc = VCursorAddColumn(self->curs, &ndx, "(%s)%s", datatype, name);
-    }
-    else
-    {
-        SRADBG(("adding column %s\n", name));
-        rc = VCursorAddColumn(self->curs, &ndx, name);
-    }
-    
-    if (rc != 0)
-    {
-        /* it's okay if the column is already there
-           any other rc is a hard error */
-        if (GetRCState ( rc ) != rcExists)
-            return rc;
-        
-        if ( ! find_by_index(&self->wcol, ndx, &cndx) )
-        {
-            /* severe internal error */
-            return RC ( RC_MODULE, RC_TARGET, rcOpening, rcNoObj, rcNotFound );
-        }
-
-        /* get the uncounted reference to column from table */
-        rslt = VectorGet(&self->wcol, cndx);
-    }
-    else
-    {
-        VTypedecl type;
-        VTypedesc desc;
-        
-        rslt = malloc(sizeof *rslt );
-        if (rslt == NULL)
-            return RC(RC_MODULE, rcColumn, rcConstructing, rcMemory, rcExhausted);
-        
-        rc = VCursorDatatype(self->curs, ndx, &type, &desc);
-        if (rc == 0)
-        {
-            /* this object will sit uncounted within the table
-               when the table goes away, it will douse the columns
-               without regard to their reference count. see below */
-            KRefcountInit(&rslt->refcount, 0, "SRAColumn", "OpenColumnWrite", name);
-
-            /* the column has no reference to the table, so after this
-               there will only be an uncounted reference from table to column */
-            rslt->tbl = NULL;
-            rslt->idx = ndx;
-            rslt->read_only = false;
-            rslt->elem_bits = VTypedescSizeof(&desc);
-
-            rc = VectorAppend(&self->wcol, &cndx, rslt);
-        }
-
-        if ( rc != 0 )
-        {
-            free ( rslt );
-            return rc;
-        }
-    }
-
-    /* see if user wants a reference */
-    if ( col != NULL )
-    {
-        /* the first column reference exported will take
-           the refcount from zero to one */
-        SRAColumnAddRef ( rslt );
-
-        /* the first exported reference will need to be reflected
-           to the table. this will ensure that the table never tries
-           to whack its columns as long as they are held externally,
-           because the table itself will be kept alive. when the last
-           column reference is released, it will also release the table */
-        if ( rslt -> tbl == NULL )
-            rslt -> tbl = SRATableAttach ( self );
-
-        *col = rslt;
-    }
-
-    *idx = cndx + 1;
-    return rc;
-}
-
-static
-rc_t lookup_and_validate(SRATable *self, const SRAColumn **rslt, uint32_t idx, const void *base, bitsz_t offset, bitsz_t size) {
-    const SRAColumn *col;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcWriting, rcSelf, rcNull);
-    
-    col = VectorGet(&self->wcol, idx - 1);
-    if (col == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcWriting, rcParam, rcInvalid);
-    
-    if (size % col->elem_bits != 0)
-        return RC(RC_MODULE, RC_TARGET, rcWriting, rcParam, rcInvalid);
-    
-    if (offset % col->elem_bits != 0)
-        return RC(RC_MODULE, RC_TARGET, rcWriting, rcParam, rcInvalid);
-    
-    *rslt = col;
-    return 0;
-}
-
-/* SetIdxColumnDefault
- *  give a default value for column
- *
- *  if no value gets written to a column within an open spot,
- *  this value is substituted.
- *
- *  "idx" [ IN ] - 1-based column index
- *
- *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
- *  to start of row data
- *
- *  "size" [ IN ] - size in bits of row data
- */
-LIB_EXPORT rc_t CC SRATableSetIdxColumnDefault ( SRATable *self,
-        uint32_t idx, const void *base, bitsz_t offset, bitsz_t size ) {
-    const SRAColumn *col;
-    rc_t rc;
-    
-    rc = lookup_and_validate(self, &col, idx, base, offset, size);
-    if (rc == 0)
-        rc = VCursorDefault(self->curs, col->idx, col->elem_bits, base, offset / col->elem_bits, size / col->elem_bits);
-    return rc;
-}
-
-
-/* WriteIdxColumn
- *  write row data to an indexed column
- *
- *  "idx" [ IN ] - 1-based column index
- *
- *  "base" [ IN ] and "offset" [ IN ] - pointer and bit offset
- *  to start of row data
- *
- *  "size" [ IN ] - size in bits of row data
- */
-LIB_EXPORT rc_t CC SRATableWriteIdxColumn ( SRATable *self,
-        uint32_t idx, const void *base, bitsz_t offset, bitsz_t size ) {
-    const SRAColumn *col;
-    rc_t rc;
-    
-    rc = lookup_and_validate(self, &col, idx, base, offset, size);
-    if (rc == 0)
-        rc = VCursorWrite(self->curs, col->idx, col->elem_bits, base, offset / col->elem_bits, size / col->elem_bits);
-    return rc;
-}
-
-
-/* MetaFreeze
- *  freezes current metadata revision
- *  further modification will begin on a copy
- */
-LIB_EXPORT rc_t CC SRATableMetaFreeze ( SRATable *self ) {
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcSelf, rcNull);
-    
-    return KMetadataFreeze(self->meta);
-}
-
-
-/* OpenMDataNode
- *  open a metadata node
- */
-LIB_EXPORT rc_t CC SRATableOpenMDataNodeUpdate ( SRATable *self, struct KMDataNode **node, const char *path, ... ) {
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, path);
-    rc = SRATableVOpenMDataNodeUpdate(self, node, path, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableVOpenMDataNodeUpdate ( SRATable *self, struct KMDataNode **node, const char *spec, va_list args ) {
-    rc_t rc;
-    char path[4096];
-    int n;
-    
-    if (self == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcSelf, rcNull);
-    if (spec == NULL)
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcParam, rcNull);
-    
-    n = vsnprintf(path, sizeof(path), spec, args);
-    if (n >= sizeof(path))
-        return RC(RC_MODULE, RC_TARGET, rcOpening, rcName, rcTooLong);
-    
-    rc = KMetadataOpenNodeUpdate(self->meta, node, path);
-    if (rc)
-    {
-        SRADBG(("failed to open table metadata node '%s' %R", path, rc));
-    }
-    return rc;
-}
-
-#define RD_COLVALUE(tbl, nm, var) \
-                SRATable_ReadColBack(tbl, nm, sizeof(var) * 8, (void*)&var, sizeof(var))
-
-static
-rc_t SRATable_ReadColBack(const VTable* tbl, const char* col_name, uint32_t elem_bits, void *buffer, uint32_t blen)
-{
-    rc_t rc = 0;
-    uint32_t idx;
-    const VCursor* curs = NULL;
-   
-    if( (rc = VTableCreateCursorRead(tbl, &curs)) == 0 &&
-        (rc = VCursorAddColumn(curs, &idx, col_name)) == 0 &&
-        (rc = VCursorOpen(curs)) == 0 ) {
-        uint32_t len;
-        rc = VCursorReadDirect(curs, 1, idx, elem_bits, buffer, blen, &len);
-    }
-    VCursorRelease(curs);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableBaseCount ( const SRATable *self, uint64_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            RD_COLVALUE(self->vtbl, "BASE_COUNT", self->base_count);
-            *rslt = self->base_count;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableSpotCount ( const SRATable *self, uint64_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            RD_COLVALUE(self->vtbl, "SPOT_COUNT", self->spot_count);
-            *rslt = self->spot_count;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableMinSpotId ( const SRATable *self, spotid_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            RD_COLVALUE(self->vtbl, "MIN_SPOT_ID", self->min_spot_id);
-            *rslt = self->min_spot_id;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC SRATableMaxSpotId ( const SRATable *self, spotid_t *rslt )
-{
-    rc_t rc;
-
-    if ( rslt == NULL )
-        rc = RC ( rcSRA, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcSRA, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            RD_COLVALUE(self->vtbl, "MAX_SPOT_ID", self->max_spot_id);
-            *rslt = self->max_spot_id;
-            return 0;
-        }
-        *rslt = 0;
-    }
-    return rc;
-}
diff --git a/libs/sraxf/Makefile b/libs/sraxf/Makefile
deleted file mode 100644
index f070061..0000000
--- a/libs/sraxf/Makefile
+++ /dev/null
@@ -1,143 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/sraxf
-
-INT_LIBS = \
-	libsraxf \
-	libwsraxf
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_LIBS): makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(TARGDIR)/,$(ALL_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sra transform library
-#
-$(TARGDIR)/libsraxf: $(addprefix $(ILIBDIR)/libsraxf.,$(ILIBEXT))
-
-SRAXF_SRC = \
-	untyped \
-	v0-decompress-init \
-	v0-decompress \
-	v0-funcs \
-	bio-start \
-	dynamic-454-read-descriptor \
-	format-spot-name \
-	extract-name_coord \
-	tokenize-spot_name-454 \
-	tokenize-spot_name-illumina \
-	tokenize-spot_name-abi \
-	tokenize-spot_name-helicos \
-	tokenize-spot_name-ion-torrent \
-	color-from-dna \
-	dna-from-color \
-	spot-desc \
-	read-desc \
-	rotate \
-	swap \
-	denormalize \
-	normalize \
-	qual4_decode \
-	read-seg-from-readn \
-	rewrite-spot-name \
-	make-position \
-	process-position \
-	extract-coordinates \
-	fpcodec \
-	index_lookup \
-	varloc
-
-SRAXF_OBJ = \
-	$(addsuffix .$(LOBX),$(SRAXF_SRC))
-
-SRAXF_LIB = \
-	-dksrch \
-	-dvdb \
-	-dkdb \
-	-dklib \
-	-dm \
-	-dz
-
-$(ILIBDIR)/libsraxf.$(LIBX): $(SRAXF_OBJ)
-	$(LD) --slib -o $@ $^ $(SRAXF_LIB)
-
-
-#-------------------------------------------------------------------------------
-# sra transform update library
-#
-$(TARGDIR)/libwsraxf: $(addprefix $(ILIBDIR)/libwsraxf.,$(ILIBEXT))
-
-WSRAXF_SRC = \
-	$(SRAXF_SRC) \
-	extract-name_fmt \
-	extract-spot_name \
-	stats \
-	stats_quality \
-	qual4_encode
-
-WSRAXF_OBJ = \
-	$(addsuffix .$(LOBX),$(WSRAXF_SRC))
-
-WSRAXF_LIB = \
-	-dwvdb \
-	-dwkdb \
-	-dksrch \
-	-dklib \
-	-dm \
-	-dz
-
-$(ILIBDIR)/libwsraxf.$(LIBX): $(WSRAXF_OBJ)
-	$(LD) --slib -o $@ $^ $(WSRAXF_LIB)
diff --git a/libs/sraxf/bio-start.c b/libs/sraxf/bio-start.c
deleted file mode 100644
index a3d41b0..0000000
--- a/libs/sraxf/bio-start.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-
-/* INSDC:coord:zero NCBI:SRA:bio_start #1
- *   ( INSDC:coord:zero read_start, INSDC:SRA:xread_type read_type );
- *
- *  searches through read_type vector
- *  returns the 0-based starting coordinate of first biological read
- *
- *  "read_start" [ DATA ] - vector of read start coordinates
- *
- *  "read_type" [ DATA ] - vector of read types
- */
-static
-rc_t CC sra_bio_start ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const uint8_t *src = argv [ 1 ] . u . data . base;
-    uint32_t i;
-    uint64_t count = argv [ 1 ] . u . data . elem_count;
-    for ( i = 0, src += argv [ 1 ] . u . data . first_elem; i < count; ++ i )
-    {
-        if ( ( src [ i ] & SRA_READ_TYPE_BIOLOGICAL ) != 0 )
-        {
-            rc_t rc;
-            int32_t bio_start;
-            KDataBuffer *dst = rslt -> data;
-
-            assert ( argv [ 0 ] . u . data . elem_count == argv [ 1 ] . u . data . elem_count );
-            assert ( argv [ 0 ] . u . data . elem_bits == sizeof bio_start * 8 );
-            bio_start = ( ( const int32_t* ) argv [ 0 ] . u . data . base )
-                [ argv [ 0 ] . u . data . first_elem + i ];
-
-            if ( dst -> elem_bits != sizeof bio_start * 8 )
-            {
-                rc = KDataBufferCast ( dst, dst, sizeof bio_start * 8, true );
-                if ( rc != 0 )
-                    return rc;
-            }
-
-            if ( dst -> elem_count != 1 )
-            {
-                rc = KDataBufferResize ( dst, 1 );
-                if ( rc != 0 )
-                    return rc;
-            }
-
-            * ( int32_t* ) dst -> base = bio_start;
-            rslt -> elem_count = 1;
-            return 0;
-        }
-    }
-
-    return RC ( rcSRA, rcFunction, rcSearching, rcData, rcNotFound );
-}
-
-VTRANSFACT_IMPL( NCBI_SRA_bio_start, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = sra_bio_start;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/sraxf/color-from-dna.c b/libs/sraxf/color-from-dna.c
deleted file mode 100644
index 435985c..0000000
--- a/libs/sraxf/color-from-dna.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-void color_from_dna(uint8_t csbin[], const uint8_t dnabin[], size_t n, uint8_t primer, const uint8_t conversion_matrix[]) {
-    uint8_t st;
-    size_t i;
-	
-    switch (primer) {
-    case 'A':
-        st = 0;
-        break;
-    case 'C':
-        st = 1;
-        break;
-    case 'G':
-        st = 2;
-        break;
-    case 'T':
-        st = 3;
-        break;
-    default:
-        st = 4;
-        break;
-    }
-	
-    for (i = 0; i != n; ++i) {
-        uint8_t tr = dnabin[i];
-		
-        csbin[i] = conversion_matrix[st * 5 + tr];
-        st = tr;
-    }
-}
-
-static
-rc_t CC color_from_dna_drvr ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint8_t *csbin;
-
-    uint32_t i;
-    uint64_t row_len = argv [ 0 ] . u . data . elem_count;
-    uint64_t out_len, nreads = argv [ 1 ] . u . data . elem_count;
-
-    const uint8_t *dnabin = argv [ 0 ] . u . data . base;
-    const uint32_t *read_start = argv [ 1 ] . u . data . base;
-    const uint32_t *read_len = argv [ 2 ] . u . data . base;
-    const uint8_t *cskey = argv [ 3 ] . u . data . base;
-    const uint8_t *cmatrx = argv [ 4 ] . u . data . base;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 32);
-    assert(argv[2].u.data.elem_bits == 32);
-    assert(argv[3].u.data.elem_bits == 8);
-    assert(argv[4].u.data.elem_bits == 8);
-
-    assert(argv[2].u.data.elem_count == nreads);
-    assert(argv[3].u.data.elem_count == nreads);
-
-    dnabin += argv [ 0 ] . u . data . first_elem;
-    read_start += argv [ 1 ] . u . data . first_elem;
-    read_len += argv [ 2 ] . u . data . first_elem;
-    cskey += argv [ 3 ] . u . data . first_elem;
-    cmatrx += argv [ 4 ] . u . data . first_elem;
-
-    /* safety check that read structure is within bounds */
-    for ( i = 0, out_len = 0; i < nreads; ++i )
-    {
-        if ( read_start [ i ] + read_len [ i ] > row_len )
-            return RC ( rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-        out_len += read_len [ i ];
-    }
-    
-    /* resize output row for the total number of reads */    
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, out_len );
-    if ( rc != 0 )
-        return rc;
-
-    /* huh? */
-    rslt -> data -> bit_offset = 0;
-
-    rslt -> elem_count = out_len;
-    csbin = rslt -> data -> base;
-
-    for ( i = 0, out_len = 0; i < nreads; ++i )
-    {
-        color_from_dna ( & csbin [ out_len ],
-            & dnabin [ read_start [ i ] ], read_len [ i ],
-            cskey [ i ], cmatrx );
-
-        out_len += read_len [ i ];
-    }
-    
-    return 0;
-}
-
-/* 
- * function
- * INSDC:color:bin NCBI:color_from_dna #1 ( INSDC:dna:bin dna_bin,
- *     INSDC:coord:zero read_start, U32 read_len,
- *     INSDC:dna:text cs_key, U8 color_matrix )
- */
-VTRANSFACT_IMPL ( NCBI_color_from_dna, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = color_from_dna_drvr;
-    rslt->variant = vftRow;
-    
-    return 0;
-}
diff --git a/libs/sraxf/denormalize.c b/libs/sraxf/denormalize.c
deleted file mode 100644
index 68acb2a..0000000
--- a/libs/sraxf/denormalize.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef void (*denorm_f)(void *dst, const void *src, const void *Cntrl, uint64_t vec_count);
-typedef struct self_t {
-    denorm_f f;
-} self_t;
-
-#define DENORM_0(A, B) do { (A).data[0] = (B).data[0]; (A).data[1] = (B).data[0] + (B).data[1]; (A).data[2] = (B).data[2]; (A).data[3] = (B).data[3]; } while (0)
-#define DENORM_1(A, B) A = B
-#define DENORM_2(A, B) do { (A).data[0] = (B).data[0]; (A).data[1] = (B).data[1]; (A).data[2] = (B).data[2]; (A).data[3] = (B).data[2] + (B).data[3]; } while (0)
-#define DENORM_3(A, B) A = B
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, const void *Src, const void *Cntrl, uint64_t count) { \
-    typedef struct { VALTYPE data[4]; } data4_t; \
-    data4_t *dst = (data4_t *)Dst; \
-    const data4_t *src = (const data4_t *)Src; \
-    const uint8_t *cntrl = (const uint8_t *)Cntrl; \
-    uint64_t i; \
-    \
-    for (i = 0; i != count; ++i) { \
-        switch(cntrl[i]) { \
-        default: \
-        case 0: \
-            DENORM_0(dst[i], src[i]); \
-            break; \
-        case 1: \
-            DENORM_1(dst[i], src[i]); \
-            break; \
-        case 2: \
-            DENORM_2(dst[i], src[i]); \
-            break; \
-        case 3: \
-            DENORM_3(dst[i], src[i]); \
-            break; \
-        }\
-    } \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC denormal_drvr (
-                void *Self,
-                const VXformInfo *info,
-                int64_t row_id,
-                VRowResult *rslt,
-                uint32_t argc,
-                const VRowData argv []
-) {
-    rc_t rc = 0;
-    const void *src;
-    const void *cntrl;
-    const self_t *self = (const self_t *)Self;
-    
-    assert(argv[0].u.data.elem_bits % 8 == 0);
-    assert(argv[1].u.data.elem_bits % 8 == 0);
-    
-    src   = &((const uint8_t *)argv[0].u.data.base)[(argv[0].u.data.first_elem * argv[0].u.data.elem_bits) / 8];
-    cntrl = &((const uint8_t *)argv[1].u.data.base)[(argv[1].u.data.first_elem * argv[1].u.data.elem_bits) / 8];
-    
-    rslt->elem_bits = rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rc = KDataBufferResize(rslt->data, argv[0].u.data.elem_count);
-    if (rc)
-        return rc;
-    rslt->elem_count = rslt->data->elem_count;
-    rslt->data->bit_offset = 0;
-    
-    self->f(rslt->data->base, src, cntrl, rslt->elem_count);
-    
-    return 0;
-}
-
-static
-void CC sraxf_denormalize_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- * function < type T > T [ 4 ] NCBI:SRA:denormalize #1 ( T [ 4 ] intensities, U8 called );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_denormalize, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self;
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-        break;
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(int8_t);
-                break;
-            case 16:
-                self->f = FUNC(int16_t);
-                break;
-            case 32:
-                self->f = FUNC(int32_t);
-                break;
-            case 64:
-                self->f = FUNC(int64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(uint8_t);
-                break;
-            case 16:
-                self->f = FUNC(uint16_t);
-                break;
-            case 32:
-                self->f = FUNC(uint32_t);
-                break;
-            case 64:
-                self->f = FUNC(uint64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                self->f = FUNC(float);
-                break;
-            case 64:
-                self->f = FUNC(double);
-                break;
-            default:
-                break;
-            }
-            break;
-        default:
-            break;
-        }
-        
-        rslt->self = self;
-        rslt->whack = sraxf_denormalize_free_wrapper;
-        rslt->u.rf = denormal_drvr;
-        rslt->variant = vftRow;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/sraxf/dna-from-color.c b/libs/sraxf/dna-from-color.c
deleted file mode 100644
index 7caee94..0000000
--- a/libs/sraxf/dna-from-color.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-void dna_from_color(uint8_t dnabin[], const uint8_t csbin[], size_t n, uint8_t primer, const uint8_t conversion_matrix[]) {
-    uint8_t st;
-    size_t i;
-	
-    switch (primer) {
-    case 'A':
-        st = 0;
-        break;
-    case 'C':
-        st = 1;
-        break;
-    case 'G':
-        st = 2;
-        break;
-    case 'T':
-        st = 3;
-        break;
-    default:
-        st = 4;
-        break;
-    }
-	
-    for (i = 0; i != n && st !=4; ++i) { /*** interrupt translation after the first ambiguity in color space ***/
-        uint8_t tr = csbin[i];
-		
-        st = dnabin[i] = conversion_matrix[st * 5 + tr];
-    }
-    if(i<n) memset(dnabin+i,4,n-i); /*** translation was interrupted - the remainder is ambiguity in base space ***/
-}
-
-static
-rc_t CC dna_from_color_drvr ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint8_t *dnabin;
-
-    uint32_t i, row_len = argv [ 0 ] . u . data . elem_count;
-    uint32_t out_len, nreads = argv [ 1 ] . u . data . elem_count;
-
-    const uint8_t *csbin = argv [ 0 ] . u . data . base;
-    const uint32_t *read_start = argv [ 1 ] . u . data . base;
-    const uint32_t *read_len = argv [ 2 ] . u . data . base;
-    const uint8_t *cskey = argv [ 3 ] . u . data . base;
-    const uint8_t *cmatrx = argv [ 4 ] . u . data . base;
-    
-    assert(argv[0].u.data.elem_bits == 8);
-    assert(argv[1].u.data.elem_bits == 32);
-    assert(argv[2].u.data.elem_bits == 32);
-    assert(argv[3].u.data.elem_bits == 8);
-    assert(argv[4].u.data.elem_bits == 8);
-
-    assert(argv[2].u.data.elem_count == nreads);
-    assert(argv[3].u.data.elem_count == nreads);
-
-    csbin += argv [ 0 ] . u . data . first_elem;
-    read_start += argv [ 1 ] . u . data . first_elem;
-    read_len += argv [ 2 ] . u . data . first_elem;
-    cskey += argv [ 3 ] . u . data . first_elem;
-    cmatrx += argv [ 4 ] . u . data . first_elem;
-
-    /* safety check that read structure is within bounds */
-    for ( i = out_len = 0; i < nreads; ++i )
-    {
-        if ( read_start [ i ] + read_len [ i ] > row_len )
-            return RC ( rcXF, rcFunction, rcExecuting, rcData, rcInvalid );
-        out_len += read_len [ i ];
-    }
-    
-    /* resize output row for the total number of reads */    
-    rslt -> data -> elem_bits = 8;
-    rc = KDataBufferResize ( rslt -> data, out_len );
-    if ( rc != 0 )
-        return rc;
-
-    /* huh? */
-    rslt -> data -> bit_offset = 0;
-
-    rslt -> elem_count = out_len;
-    dnabin = rslt -> data -> base;
-
-    for ( i = out_len = 0; i < nreads; ++i )
-    {
-        dna_from_color ( & dnabin [ out_len ],
-            & csbin [ read_start [ i ] ], read_len [ i ],
-            cskey [ i ], cmatrx );
-
-        out_len += read_len [ i ];
-    }
-    
-    return 0;
-}
-
-/* 
- * function
- * INSDC:color:bin NCBI:dna_from_color #1 ( INSDC:dna:bin dna_bin,
- *     INSDC:coord:zero read_start, U32 read_len,
- *     INSDC:dna:text cs_key, U8 color_matrix )
- */
-VTRANSFACT_IMPL ( NCBI_dna_from_color, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = dna_from_color_drvr;
-    rslt->variant = vftRow;
-    
-    return 0;
-}
diff --git a/libs/sraxf/dynamic-454-read-descriptor.c b/libs/sraxf/dynamic-454-read-descriptor.c
deleted file mode 100644
index 2520eed..0000000
--- a/libs/sraxf/dynamic-454-read-descriptor.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/index.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <search/grep.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* dynamic_read_desc
- *  uses inputs to determine read type and segmentation
- *
- *  "spot" [ DATA ] - bases for entire spot
- *
- *  "key" [ DATA, CONTROL ] - bases for key sequence. for version 1,
- *  the first base following key is taken as biological start
- *
- *  "linker" [ DATA, CONTROL, OPTIONAL ] - if present, is used to separate
- *  all bases following "key" into mate pair biological reads
- *
- *  returns a trio for each identified read, with read type, start and length
- */
-enum { dyn_read_type, dyn_read_start, dyn_read_len };
-
-typedef uint32_t dynamic_read_desc [ 3 ];
-
-static
-rc_t CC dynamic_read_desc_static ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    dynamic_read_desc *p;
-    KDataBuffer *dst = rslt -> data;
-
-    /* severe error if adapter is longer than spot */
-    if ( argv [ 0 ] . u . data . elem_count < argv [ 1 ] . u . data . elem_count )
-        return RC ( rcSRA, rcFunction, rcExecuting, rcData, rcCorrupt );
-
-    /* the buffer should have already been given the correct element size */
-    if ( dst -> elem_bits != 32 * 3 )
-    {
-        rc = KDataBufferCast ( dst, dst, 32 * 3, true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* we always produce 2 reads */
-    if ( dst -> elem_count != 2 )
-    {
-        rc = KDataBufferResize ( dst, 2 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    p = dst -> base;
-
-    /* adapter */
-    p [ 0 ] [ dyn_read_type ] = SRA_READ_TYPE_TECHNICAL;
-    p [ 0 ] [ dyn_read_start ] = 0;
-    assert(argv [ 1 ] . u . data . elem_count >> 32 == 0);
-    p [ 0 ] [ dyn_read_len ] = (uint32_t)argv [ 1 ] . u . data . elem_count;
-
-    /* fragment */
-    p [ 1 ] [ dyn_read_type ] = SRA_READ_TYPE_BIOLOGICAL;
-    p [ 1 ] [ dyn_read_start ] = p [ 0 ] [ dyn_read_len ];
-    assert(argv [ 0 ] . u . data . elem_count >> 32 == 0);
-    p [ 1 ] [ dyn_read_len ] = (uint32_t)(argv [ 0 ] . u . data . elem_count) - p [ 0 ] [ dyn_read_len ];
-
-    rslt -> elem_count = 2;
-    return 0;
-}
-
-
-/* dynamic_read_desc_with_linker
- */
-typedef struct linker_agrep linker_agrep;
-struct linker_agrep
-{
-    /* I suspect this should be unsigned... */
-    int32_t edit_distance;
-};
-
-int32_t debug_callback(void *cbinfo, AgrepMatch *match, AgrepContinueFlag *cont)
-{
-    printf("Match: pos %d len %d score %d\n", match->position, match->length,
-           match->score);
-    return 0;
-}
-
-
-static
-rc_t CC dynamic_read_desc_with_linker ( void *xself, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    dynamic_read_desc *p;
-    KDataBuffer *dst = rslt -> data;
-    const linker_agrep *self = ( const void* ) xself;
-
-    AgrepMatch match;
-    int32_t found;
-    AgrepFlags agrepflags;
-    Agrep *agrep;
-    /* AgrepCallArgs args; */
-    
-    const char *agreppattern;
-    char buf[4096];
-    const char *text;
-    uint32_t textlen;
-
-    /* severe error if adapter is longer than spot */
-    if ( argv [ 0 ] . u . data . elem_count < argv [ 1 ] . u . data . elem_count )
-        return RC ( rcSRA, rcFunction, rcExecuting, rcData, rcCorrupt );
-
-    /* the buffer should have already been given the correct element size */
-    if ( dst -> elem_bits != 32 * 3 )
-    {
-        rc = KDataBufferCast ( dst, dst, 32 * 3, true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* we always produce 4 reads for when the linker is present */
-    if ( dst -> elem_count != 4 )
-    {
-        rc = KDataBufferResize ( dst, 4 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* TBD - a mechanism for detecting when this has not changed
-       since typically it will be identical for every row in a table
-       but not necessarily so */
-    agreppattern = argv[2].u.data.base;
-    agreppattern += argv[2].u.data.first_elem; 
-    textlen = (uint32_t)string_copy(buf, sizeof buf, agreppattern, argv[2].u.data.elem_count);
-    if ( textlen >= sizeof buf )
-        return RC ( rcSRA, rcFunction, rcExecuting, rcData, rcExcessive );
-
-    text = argv[0].u.data.base;
-    text += argv[0].u.data.first_elem;
-
-    assert(argv[0].u.data.elem_count >> 32 == 0);
-    textlen = (uint32_t)argv[0].u.data.elem_count;
-
-    text += argv[1].u.data.elem_count;
-    textlen -= argv[1].u.data.elem_count;
-
-    agrepflags = AGREP_TEXT_EXPANDED_2NA 
-        | AGREP_PATTERN_4NA
-        | AGREP_EXTEND_BETTER
-        | AGREP_LEFT_MAINTAIN_SCORE
-        | AGREP_ANYTHING_ELSE_IS_N;
-
-    /* This might fail due to size restrictions. */
-    rc = AgrepMake(&agrep, agrepflags | AGREP_ALG_MYERS, buf);
-    if (rc == 0) {
-        /* fprintf(stderr, "Using myers.\n"); */
-    } else {
-        rc = AgrepMake(&agrep, agrepflags | AGREP_ALG_MYERS_UNLTD, buf);
-        /* Try one more time. */
-        if (rc) {
-            rc = AgrepMake(&agrep, agrepflags | AGREP_ALG_DP, buf);
-        }
-        if (rc)
-            return rc;
-    }
-
-    found = AgrepFindBest(agrep, self->edit_distance, text, textlen, &match);
-
-    if (found) {
-
-        p = dst -> base;
-        
-        /* adapter */
-        p [ 0 ] [ dyn_read_type ] = SRA_READ_TYPE_TECHNICAL;
-        p [ 0 ] [ dyn_read_start ] = 0;
-        assert(argv [ 1 ] . u . data . elem_count >> 32 == 0);
-        p [ 0 ] [ dyn_read_len ] = (uint32_t)argv [ 1 ] . u . data . elem_count;
-        
-        /* fragment */
-        p [ 1 ] [ dyn_read_type ] = SRA_READ_TYPE_BIOLOGICAL;
-        p [ 1 ] [ dyn_read_start ] = (uint32_t)argv [ 1 ] . u . data . elem_count;
-        p [ 1 ] [ dyn_read_len ] = match.position;
-
-        /* linker */
-        p [ 2 ] [ dyn_read_type ] = SRA_READ_TYPE_TECHNICAL;
-        p [ 2 ] [ dyn_read_start ] = match.position + (uint32_t)argv[1].u.data.elem_count;
-        p [ 2 ] [ dyn_read_len ] = match.length;
-        
-        /* fragment */
-        p [ 3 ] [ dyn_read_type ] = SRA_READ_TYPE_BIOLOGICAL;
-        p [ 3 ] [ dyn_read_start ] = match.position + match.length + (uint32_t)argv[1].u.data.elem_count;
-        p [ 3 ] [ dyn_read_len ] = (uint32_t)argv [ 0 ] . u . data . elem_count - match.position - match.length - (uint32_t)argv[1].u.data.elem_count;
-        
-        rslt -> elem_count = 4;
-
-    } else {
-
-        
-        p = dst -> base;
-        
-        /* adapter */
-        p [ 0 ] [ dyn_read_type ] = SRA_READ_TYPE_TECHNICAL;
-        p [ 0 ] [ dyn_read_start ] = 0;
-        assert(argv [ 1 ] . u . data . elem_count >> 32 == 0);
-        p [ 0 ] [ dyn_read_len ] = (uint32_t)argv [ 1 ] . u . data . elem_count;
-        
-        /* fragment */
-        p [ 1 ] [ dyn_read_type ] = SRA_READ_TYPE_BIOLOGICAL;
-        p [ 1 ] [ dyn_read_start ] = (uint32_t)argv [ 1 ] . u . data . elem_count;
-        p [ 1 ] [ dyn_read_len ] = (uint32_t)argv [ 0 ] . u . data . elem_count - (uint32_t)argv [ 1 ] . u . data . elem_count;
-
-        /* linker */
-        p [ 2 ] [ dyn_read_type ] = SRA_READ_TYPE_TECHNICAL;
-        p [ 2 ] [ dyn_read_start ] = (uint32_t)argv [ 0 ] . u . data . elem_count;
-        p [ 2 ] [ dyn_read_len ] = 0;
-        
-        /* fragment */
-        p [ 3 ] [ dyn_read_type ] = SRA_READ_TYPE_BIOLOGICAL;
-        p [ 3 ] [ dyn_read_start ] = (uint32_t)argv [ 0 ] . u . data . elem_count;
-        p [ 3 ] [ dyn_read_len ] = 0;
-
-        rslt -> elem_count = 4;
-
-    }
-
-    AgrepWhack(agrep);
-
-    return 0;
-}
-
-static
-void CC dyn_454_read_desc_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/*
- extern function U32 [ 3 ] NCBI:SRA:_454_:dynamic_read_desc #1 < * U32 edit_distance >
-    ( NCBI:SRA:_454_:drdparam_set spot, NCBI:SRA:_454_:drdparam_set key * NCBI:SRA:_454_:drdparam_set linker );
- */
-VTRANSFACT_IMPL ( NCBI_SRA__454__dynamic_read_desc, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    linker_agrep *xself;
-
-    if ( dp -> argc == 2 )
-    {
-        rslt -> u . ndf = dynamic_read_desc_static;
-        rslt -> variant = vftNonDetRow;
-        return 0;
-    }
-
-    xself = malloc ( sizeof * xself );
-    if ( xself == NULL )
-        return RC ( rcSRA, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    /* NB - this should be changed to unsigned */
-    xself -> edit_distance = 5;
-    if ( cp -> argc == 1 )
-        xself -> edit_distance = cp -> argv [ 0 ] . data . i32 [ 0 ];
-
-    rslt -> self = xself;
-    rslt -> whack = dyn_454_read_desc_free_wrapper;
-    rslt -> u . rf = dynamic_read_desc_with_linker;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/sraxf/extract-coordinates.c b/libs/sraxf/extract-coordinates.c
deleted file mode 100644
index 9dd71e8..0000000
--- a/libs/sraxf/extract-coordinates.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-#define SLX_COORD_LEN 10
-
-static
-int non_braindead_atoi ( const char *start, const char *end )
-{
-    int val = start [ 0 ] - '0';
-    uint32_t i, count = (uint32_t)( end - start );
-    for ( i = 1; i < count; ++ i )
-    {
-        val *= 10;
-        val += start [ i ] - '0';
-    }
-    return val;
-}
-
-static
-int scan_hex ( const char *str, int count )
-{
-    int i, val = str [ 0 ] - '0';
-    if ( val > 9 )
-        val = toupper ( str [ 0 ] ) - 'A' + 10;
-    for ( i = 1; i < count; ++ i )
-    {
-        int d = str [ i ] - '0';
-        if ( d > 9 )
-            d = toupper ( str [ i ] ) - 'A' + 10;
-        val = val << 4 | d;
-    }
-    return val;
-}
-
-static
-void common_extract_coordinates ( const char *skey, uint32_t slen, uint32_t coords [ 4 ] )
-{
-    unsigned int a, b, c, d;
-    uint32_t i, j, count = slen;
-
-    /* scan hex digits */
-    for ( i = count; i > 0; )
-    {
-        if ( ! isxdigit ( skey [ -- i ] ) )
-            break;
-    }
-
-    /* detect newer format */
-    if ( count - i < ( SLX_COORD_LEN - 1 ) )
-    {
-        const char *end = skey + count;
-
-        /* new format */
-        for ( d = 0, j = 0, i = count; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        d = non_braindead_atoi ( & skey [ j ], end );
-        for ( c = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        c = atoi ( & skey [ j ] );
-        for ( b = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        b = atoi ( & skey [ j ] );
-        for ( a = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        a = atoi ( & skey [ j ] );
-        if ( j > 0 )
-        {
-            if ( i > 0 )
-                -- i;
-            while ( isalpha ( skey [ i ] ) )
-                ++ i;
-        }
-    }
-    else
-    {
-        /* original format */
-        a = scan_hex ( skey, 1 );
-        b = scan_hex ( & skey [ 1 ], 3 );
-        c = scan_hex ( & skey [ 4 ], 3 );
-        d = scan_hex ( & skey [ 7 ], 3 );
-        if ( count > SLX_COORD_LEN )
-        {
-            i = count - SLX_COORD_LEN;
-        }
-    }
-
-    coords [ 3 ] = a;
-    coords [ 2 ] = b;
-    coords [ 1 ] = c;
-    coords [ 0 ] = d;
-}
-
-static
-rc_t CC illumina_extract_coordinates ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t *out;
-    KDataBuffer *dst = rslt -> data;
-
-    uint32_t coords [ 4 ];
-
-    const char *skey = argv [ 0 ] . u . data . base;
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    skey += argv [ 0 ] . u . data . first_elem;
-
-    common_extract_coordinates ( skey, count, coords );
-
-    /* count the number of output coordinates */
-    count = ( uint32_t ) ( size_t ) self;
-
-    /* produce however many elements are requested */
-    dst -> elem_bits = 32 * count;
-    rc = KDataBufferResize ( dst, 1 );
-    if ( rc != 0 )
-        return rc;
-
-    out = dst -> base;
-    switch ( count )
-    {
-    default:
-        for ( i = 4; i < count; ++ i )
-            out [ i ] = 0;
-    case 4:
-        out [ 3 ] = coords [ 3 ];
-    case 3:
-        out [ 2 ] = coords [ 2 ];
-    case 2:
-        out [ 1 ] = coords [ 1 ];
-    case 1:
-        out [ 0 ] = coords [ 0 ];
-    case 0:
-        break;
-    }
-
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-static
-rc_t CC abi_extract_coordinates ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t *out;
-    KDataBuffer *dst = rslt -> data;
-
-    uint32_t coords [ 4 ];
-
-    const char *skey = argv [ 0 ] . u . data . base;
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    skey += argv [ 0 ] . u . data . first_elem;
-
-    common_extract_coordinates ( skey, count, coords );
-
-    /* count the number of output coordinates */
-    count = ( uint32_t ) ( size_t ) self;
-
-    /* produce however many elements are requested */
-    dst -> elem_bits = 32 * count;
-    rc = KDataBufferResize ( dst, 1 );
-    if ( rc != 0 )
-        return rc;
-
-    out = dst -> base;
-    switch ( count )
-    {
-    default:
-        for ( i = 3; i < count; ++ i )
-            out [ i ] = 0;
-    case 3:
-        out [ 2 ] = coords [ 2 ];
-    case 2:
-        out [ 1 ] = coords [ 1 ];
-    case 1:
-        out [ 0 ] = coords [ 0 ];
-    case 0:
-        break;
-    }
-
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-static
-rc_t CC _454_extract_coordinates ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t *out;
-    unsigned int a, b, c;
-    KDataBuffer *dst = rslt -> data;
-
-    const char *skey = argv [ 0 ] . u . data . base;
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    skey += argv [ 0 ] . u . data . first_elem;
-
-    /* advance skey to coordinates */
-    if ( count < 7 )
-        return RC ( rcSRA, rcName, rcParsing, rcString, rcInsufficient );
-    skey += count - 7;
-
-    /* get region */
-    if ( ! isdigit ( skey [ 0 ] ) || ! isdigit ( skey [ 1 ] ) )
-        return RC ( rcSRA, rcName, rcParsing, rcString, rcCorrupt );
-    a = ( skey [ 0 ] - '0' ) * 10 + ( skey [ 1 ] - '0' );
-
-    /* get 'Q' - base-36 encoded x/y */
-    for ( c = 0, i = 2; i < 7; ++ i )
-    {
-        c *= 36;
-        if ( isdigit ( skey [ i ] ) )
-            c += skey [ i ] - '0' + 26;
-        else if ( ! isalpha ( skey [ i ] ) )
-            return RC ( rcSRA, rcName, rcParsing, rcString, rcCorrupt );
-        else
-        {
-            /* yes, the alphabetic symbols come BEFORE the numeric */
-            c += toupper ( skey [ i ] ) - 'A';
-        }
-    }
-
-    /* convert 'Q' to x and y */
-    b = c >> 12;
-    c &= 0xFFF;
-
-    /* count the number of output coordinates */
-    count = ( uint32_t ) ( size_t ) self;
-
-    /* produce however many elements are requested */
-    dst -> elem_bits = 32 * count;
-    rc = KDataBufferResize ( dst, 1 );
-    if ( rc != 0 )
-        return rc;
-
-    out = dst -> base;
-    switch ( count )
-    {
-    default:
-        for ( i = 3; i < count; ++ i )
-            out [ i ] = 0;
-    case 3:
-        out [ 2 ] = a;
-    case 2:
-        out [ 1 ] = b;
-    case 1:
-        out [ 0 ] = c;
-    case 0:
-        break;
-    }
-
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-/* extract coordinates
- *  given a spotname with encoded coordinates
- *  extract them in reverse order into a vector
- *
- *  "platform" [ CONST ] - which platform rules to use
- *
- *  "skey" [ DATA ] - skey string for row
- */
-VTRANSFACT_IMPL ( NCBI_SRA_extract_coordinates, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    const uint8_t *platform = cp -> argv [ 0 ] . data . u8;
-    switch ( platform [ 0 ] )
-    {
-    case SRA_PLATFORM_454:
-        rslt -> u . rf = _454_extract_coordinates;
-        break;
-    case SRA_PLATFORM_ILLUMINA:
-    case SRA_PLATFORM_HELICOS:
-        rslt -> u . rf = illumina_extract_coordinates;
-        break;
-    case SRA_PLATFORM_ABSOLID:
-        rslt -> u . rf = abi_extract_coordinates;
-        break;
-    default:
-        return RC ( rcSRA, rcFunction, rcConstructing, rcType, rcUnsupported );
-    }
-
-    assert ( info -> fdesc . desc . intrinsic_bits == 32 );
-    rslt -> self = ( void* ) ( size_t ) info -> fdesc . desc . intrinsic_dim;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/sraxf/extract-name_coord.c b/libs/sraxf/extract-name_coord.c
deleted file mode 100644
index f8058a5..0000000
--- a/libs/sraxf/extract-name_coord.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include "name-tokenizer.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* extract_name_coord
- *  generates inputs to .X and .Y and possibly other columns
- *
- *  if no tokens match "coord" constant, produces an empty row
- *  otherwise, produces binary coordinate value
- *  if multiple tokens match criteria, all values must be equivalent
- *  because only a single value will be output per row
- *
- *  "coord" [ CONST ] - either NCBI:SRA:name_token:X or NCBI:SRA:name_token:Y
- *  both of these values also match the token NCBI:SRA:name_token:Q and extract
- *  contents appropriately.
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
-function INSDC:coord:zero
-    NCBI:SRA:extract_name_coord #1 < U16 coord > ( ascii name, NCBI:SRA:spot_name_token tok );
-*/
-
-typedef struct self_t {
-    uint16_t coordinate;
-    int position;
-} self_t;
-
-/* return 0...failed, 1...success */
-
-MOD_EXPORT uint32_t CC parse_decimal ( int32_t* base, const char* src, const uint32_t length )
-{
-    /* coordinates are normally unsigned */
-    bool negate = false;
-
-    /* fetch initial character */
-    int32_t val = src [ 0 ];
-
-    /* assume loop starts with following character */
-    uint32_t i = 1;
-
-    /* detect explicit sign */
-    switch ( val )
-    {
-    case '-':
-        negate = true;
-    case '+':
-        val = src [ 1 ];
-        i = 2;
-        break;
-    }
-
-    if ( ! isdigit ( val ) )
-        return 0;
-
-    for ( val -= '0'; i < length; ++ i )
-    {
-        val *= 10;
-        if ( ! isdigit ( src [ i ] ) )
-            return 0;
-        val += src [ i ] - '0';
-    }
-
-    * base = negate ? - val : val;
-
-    return 1;
-}
-
-MOD_EXPORT uint32_t CC parse_Q ( uint32_t* base, const char* src,
-    const uint32_t length, const uint16_t what )
-{
-    uint32_t xy, i;
-    
-    if( length != 5 ) {
-        return 0;
-    }
-    for( xy = i = 0; i < length; ++ i )
-    {
-        char n = src[i];
-        xy *= 36;
-        if( isdigit ( n ) )
-        {
-            xy += n - '0' + 26;
-        }
-        else if ( isalpha ( n ) )
-        {
-            xy += toupper ( n ) - 'A';
-        } 
-        else
-        {
-            return 0;
-        }
-    }
-    if ( what == nt_X )
-    {
-        *base = xy >> 12;
-        return 1;
-    }
-    if ( what == nt_Y )
-    {
-        *base = xy & 0xFFF;
-        return 1;
-    }
-
-    return 0;
-}
- 
-static
-rc_t CC extract_name_coordinate ( void *Self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t i, j;
-    self_t* self = Self;
-
-    const char *name;
-    const spot_name_token_t* token;
-    uint32_t name_len, num_tokens;
-
-    assert( argc == 2 );
-
-    /* name string */
-    name = argv [ 0 ] . u . data . base;
-    name_len = argv [ 0 ] . u . data . elem_count;
-    name += argv [ 0 ] . u . data . first_elem;
-
-    /* tokens */
-    token = argv [ 1 ] . u . data . base;
-    num_tokens = argv [ 1 ] . u . data . elem_count;
-    token += argv [ 1 ] . u . data . first_elem;
-
-    for ( i = j = 0; i < num_tokens; ++ i )
-    {
-        if ( token [ i ] . s . token_type != self -> coordinate )
-        {
-            if ( token [ i ] . s . token_type != nt_Q )
-                continue;
-            switch ( self -> coordinate )
-            {
-            case nt_X:
-            case nt_Y:
-                break;
-            default:
-                continue;
-            }
-        }
-
-        if ( ++ j == self->position )
-        {
-            /* check bounds */
-            if ( (uint32_t)( token [ i ] . s . position + token [ i ] . s . length ) > name_len )
-                return 0;
-
-            /* convert token */
-            rc = KDataBufferResize( rslt->data, 1 );
-            if ( rc )
-                return rc;
-
-            switch ( token [ i ] . s . token_type )
-            {
-            case nt_X:
-            case nt_Y:
-            case nt_T:
-            case nt_L:
-                rslt->elem_count = parse_decimal ( rslt -> data -> base,
-                    name + token [ i ] . s . position, token [ i ] . s . length );
-                return 0;
-            case nt_Q : rslt->elem_count = parse_Q ( rslt -> data -> base,
-                    name + token [ i ] . s . position, token [ i ] . s . length,
-                    self -> coordinate );
-                return 0;
-            }
-        }
-    }
-
-    rslt->elem_count = 0;
-    return 0;
-}
-
-static
-void CC sraxf_extract_name_coord_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_extract_name_coord, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t* Self;
-
-    assert( cp->argc >= 1 );
-
-    Self = malloc( sizeof( self_t ) );
-    if ( Self == NULL ) return RC( rcSRA, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    Self->coordinate = cp->argv[0].data.u16[0];
-    Self->position = 1;
-    rslt->self = Self;
-    rslt->whack = sraxf_extract_name_coord_wrapper;
-
-    rslt->variant = vftRow;
-    rslt->u.rf = extract_name_coordinate;
-
-    return 0;
-}
diff --git a/libs/sraxf/extract-name_fmt.c b/libs/sraxf/extract-name_fmt.c
deleted file mode 100644
index b32a54a..0000000
--- a/libs/sraxf/extract-name_fmt.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/index.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include "name-tokenizer.h"
-
-#include <string.h>
-
-/* extract_name_fmt
- *  generates input to .NAME_FMT column and/or updates skey index
- *
- *  on NCBI:SRA:name_token:unrecognized, produces an empty row
- *  otherwise, it creates a temporary "name_fmt" string from name row
- *
- *  an attempt is made to insert name_fmt into indicated text index
- *  ( normally 'skey' ). if the insert succeeds, i.e. associates "name_fmt"
- *  with a row_id, then the output for the row is empty.
- *
- *  if the insert fails due to key duplication, an attempt is made to
- *  extend the id range of associated rows. depending upon the type of index,
- *  this may succeed or fail, e.g. if the existing row range for "name_fmt" is
- *  n..m where m = row_id - 1, the range can be extended to n..row_id and
- *  the update succeeds. if the index supports discontiguous id ranges, the
- *  update will also succeed. upon any success updating the index, the output
- *  row will be empty.
- *
- *  finally, if the temporary "name_fmt" cannot be inserted into the index
- *  nor the existing id range updated, the output for the row will be "name_fmt".
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
-function ascii
-    NCBI:SRA:extract_name_fmt #1 < ascii skey > ( ascii name, NCBI:SRA:spot_name_token tok );
- */
-
-static
-rc_t extract_name_fmt_2 (KIndex *ndx, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, const char *name, uint32_t namelen, const spot_name_token_t *tokens, uint32_t N )
-{
-    rc_t rc;
-    bool recognized;
-    uint32_t i, j, toksize, fmtsize, numtok;
-    char sbuf[4096], *name_fmt = sbuf;
-
-    for ( recognized = false, i = j = numtok = toksize = 0; i != N; ++i)
-    {
-        switch (tokens[i].s.token_type)
-        {
-        case nt_unrecognized:
-            /* should be a single token, but in any event we don't care */
-            return 0;
-        case nt_recognized:
-            /* should be a single token, but we'll check below */
-            recognized = true;
-            break;
-	case nt_Q:
-	case nt_X:
-	case nt_Y:
-            /* we should recognize the token */
-            if ( tokens [ i ] . s . token_type >= nt_max_token )
-                return RC ( rcSRA, rcToken, rcPositioning, rcName, rcOutofrange );
-
-            /* enforce serial order of tokens */
-            if ( tokens [ i ] . s . position < j )
-                return RC ( rcSRA, rcToken, rcPositioning, rcName, rcInvalid );
-            j = tokens [ i ] . s . position + tokens [ i ] . s . length;
-
-            /* accumulate total size to be removed */
-            toksize += tokens [ i ] . s . length;
-	    numtok++;
-
-            /* enforce that no token extends beyond end of name */
-            if ( j > namelen )
-                return RC ( rcSRA, rcToken, rcPositioning, rcName, rcOutofrange );
-	    break;
-        default: /*** exclude from computation ***/
-		break;
-        }
-    }
-
-    /* token stream cannot contain BOTH recognized and coordinates */
-    if ( recognized && toksize != 0 )
-        return RC ( rcSRA, rcToken, rcPositioning, rcName, rcInvalid );
-
-    /* token stream must contain at least recognized or a non-empty coordinate */
-    if ( ! recognized && toksize == 0 )
-        return RC ( rcSRA, rcToken, rcPositioning, rcName, rcInvalid );
-
-    /* calculate name_fmt buffer size */
-    fmtsize = ( recognized ? namelen : namelen - toksize + numtok + numtok ) + 1;
-
-    /* if local buffer is insufficient, allocate directly in output KDataBuffer */
-    rslt -> data -> elem_bits = 8;
-    if ( fmtsize > sizeof sbuf )
-    {
-        rc = KDataBufferResize ( rslt -> data, fmtsize );
-        if ( rc != 0 )
-            return rc;
-        name_fmt = rslt -> data -> base;
-    }
-
-    /* create NUL-terminated formatted string */
-    if ( recognized )
-        string_copy ( name_fmt, fmtsize --, name, namelen );
-    else
-    {
-        uint32_t total;
-        for ( i = j = total = 0; i < N; ++i )
-        {
-            switch( tokens[i].s.token_type ) {
-                case nt_Q:
-                case nt_X:
-                case nt_Y:
-                    {{
-                    uint32_t pos = tokens [ i ] . s . position;
-                    toksize = tokens [ i ] . s . length;
-
-                    /* detect unrecognized tokens to left */
-                    if ( pos > j )
-                    {
-                        /* copy them in, NUL-terminating */
-                        total += (uint32_t)string_copy ( & name_fmt [ total ],
-                            fmtsize - total, & name [ j ], pos - j );
-                    }
-
-                    /* move marker along */
-                    j = pos + toksize;
-
-                    /* insert symbol */
-                    name_fmt[total + 0] = '$';
-                    name_fmt[total + 1] = TOK_ALPHABET[tokens[i].s.token_type];
-                    name_fmt[total + 2] = 0;
-                    total += 2;
-                    }}
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        /* detect unrecognized tokens to right */
-        if ( j < namelen )
-        {
-            string_copy ( & name_fmt [ total ],
-                fmtsize - total, & name [ j ], namelen - j );
-        }
-    }
-
-    /* attempt to insert into index */
-    rc = KIndexInsertText ( ndx, false, name_fmt, row_id );
-    if ( rc != 0 )
-    {
-        /* insert failed for whatever reason - return name_fmt */
-        fmtsize = strlen(name_fmt);
-        if ( name_fmt == sbuf )
-        {
-            rc = KDataBufferResize ( rslt -> data, fmtsize );
-            if ( rc != 0 )
-                return rc;
-            memcpy ( rslt -> data -> base, name_fmt, fmtsize );
-        }
-
-        rslt -> elem_count = fmtsize;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC extract_name_fmt( void *self, const VXformInfo *info, int64_t row_id,
-                       VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const char *name;
-    uint32_t num_tokens, name_len;
-    const spot_name_token_t *tokens;
-
-    tokens = argv [ 1 ] . u . data . base;
-    num_tokens = argv [ 1 ] . u . data . elem_count;
-    tokens += argv [ 1 ] . u . data . first_elem;
-
-    rslt -> elem_count = 0;
-    if ( num_tokens == 0 )
-        return 0;
-
-    name = argv [ 0 ] . u . data . base;
-    name_len = argv [ 0 ] . u . data . elem_count;
-    name += argv [ 0 ] . u . data . first_elem;
-
-    return extract_name_fmt_2(self, info, row_id, rslt,
-        name, name_len, tokens, num_tokens);
-}    
-
-VTRANSFACT_IMPL ( NCBI_SRA_extract_name_fmt, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    KIndex *ndx;
-    
-    rc = VTableCreateIndex ( ( VTable* ) info -> tbl, &ndx, kitText | kitProj, kcmOpen,
-                             "%.*s", cp->argv[0].count, cp->argv[0].data.ascii );
-    if( rc == 0 ) {
-        rslt->self = ndx;
-        rslt->whack = ( void ( CC * ) ( void* ) ) KIndexRelease;
-        rslt->variant = vftNonDetRow;
-        rslt->u.ndf = extract_name_fmt;
-    }    
-    return rc;
-}
diff --git a/libs/sraxf/extract-spot_name.c b/libs/sraxf/extract-spot_name.c
deleted file mode 100644
index 9e53524..0000000
--- a/libs/sraxf/extract-spot_name.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include "name-tokenizer.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* extract_spot_name
- *  generates input to .SPOT_NAME column
- *
- *  on NCBI:SRA:name_token:unrecognized, produces the entire spot name row
- *  otherwise, produces an empty row
- *
- *  "name" [ DATA ] - raw spot names from NAME column
- *
- *  "tok" [ DATA ] - delimiting tokens produced by sub-table
-function ascii
-    NCBI:SRA:extract_spot_name #1 ( ascii name, NCBI:SRA:spot_name_token tok );
- */
-
-#define NAM 0
-#define TOK 1
-
-static
-rc_t CC extract_spot_name ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    uint32_t i;
-    bool name_copy;
-
-    const spot_name_token_t *token = argv [ TOK ] . u . data . base;
-    uint32_t num_tokens = argv [ TOK ] . u . data . elem_count;
-    token += argv [ TOK ] . u . data . first_elem;
-
-    for ( name_copy = false, i = 0; i < num_tokens; ++ i )
-    {
-        if ( token [ i ] . s . token_type == nt_unrecognized )
-        {
-            name_copy = true;
-            break;
-        }
-    }
-
-    rslt -> elem_count = 0;
-    rslt -> data -> elem_bits = 8;
-
-    if ( name_copy || num_tokens == 0 )
-    {
-        const char *name = argv [ NAM ] . u . data . base;
-        uint32_t name_len = argv [ NAM ] . u . data . elem_count;
-
-        rc_t rc = KDataBufferResize ( rslt -> data, name_len );
-        if ( rc != 0 )
-            return rc;
-
-        memcpy ( rslt -> data -> base, name += argv [ NAM ] . u . data . first_elem, name_len );
-        rslt -> elem_count = name_len;
-    }
-
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_extract_spot_name, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = extract_spot_name;
-    
-    return 0;
-}
diff --git a/libs/sraxf/fix_read_seg_impl.h b/libs/sraxf/fix_read_seg_impl.h
deleted file mode 100644
index 977485f..0000000
--- a/libs/sraxf/fix_read_seg_impl.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-/* READ_SEG was engineered to be capable of holding
-   any sort of read description, including out-of-order,
-   non-contiguous, gapped or overlapped segments.
-
-   This property was never used, and READ_SEG is by now
-   obsolete, so we can count on it being used as a sort
-   of READ_LEN where the starts represent an integration
-   of the lengths, i.e. all segments are in order and
-   contiguous. */
-#define READ_SEGS_ALWAYS_CONTIGUOUS 1
-
-static void fix_read_seg_impl(const uint16_t *rs_src, uint32_t nreads,
-    uint32_t spot_len, uint32_t * rs_dst)
-{
-    const uint32_t nreads2 = nreads + nreads;
-        uint32_t i, total;
-
-        assert(rs_src && rs_dst);
-
-#if READ_SEGS_ALWAYS_CONTIGUOUS
-        /* first, check the stated bases within the read-seg */
-        for ( i = 1, total = 0; i < nreads2; i += 2 )
-            total += rs_src [ i ];
-
-        /* if there are no bases reported, just divide the
-           spot_len by the number of reads and rewrite */
-        if ( total == 0 )
-        {
-            /* if there is a single read, fix it */
-            if ( nreads == 1 )
-            {
-                rs_dst [ 0 ] = 0;
-                rs_dst [ 1 ] = spot_len;
-            }
-            else
-            {
-                double fstart = 0;
-                double flen = ( double ) spot_len / nreads;
-                for ( i = total = 0; i < nreads2; fstart += flen, i += 2 )
-                {
-                    long int start = lround ( fstart );
-                    long int end = lround ( fstart + flen );
-                    if ( start >= ( long int ) spot_len )
-                    {
-                        rs_dst [ i ] = spot_len;
-                        rs_dst [ i + 1 ] = 0;
-                    }
-                    else
-                    {
-                        if ( end > ( long int ) spot_len )
-                            end = ( long int ) spot_len - start;
-                        else
-                            end -= start;
-
-                        rs_dst [ i ] = ( uint32_t ) start;
-                        rs_dst [ i + 1 ] = ( uint32_t ) end;
-                    }
-
-                    total += rs_dst [ i + 1 ];
-                }
-
-                assert ( total == spot_len );
-            }
-        }
-
-        /* have the right number of bases - just rewrite starts */
-        else if ( total == spot_len )
-        {
-            for ( i = total = 0; i < nreads2; i += 2 )
-            {
-                rs_dst [ i ] = total;
-                total += ( rs_dst [ i + 1 ] = rs_src [ i + 1 ] );
-            }
-        }
-
-        /* have too many bases - trust all up to limit */
-        else if ( total > spot_len )
-        {
-            for ( i = total = 0; i < nreads2; i += 2 )
-            {
-                rs_dst [ i ] = total;
-                total += ( rs_dst [ i + 1 ] = rs_src [ i + 1 ] );
-                if ( total > spot_len )
-                {
-                    total = spot_len;
-                    rs_dst [ i + 1 ] = total - rs_dst [ i ];
-                }
-            }
-        }
-
-        /* too few bases - trust all but last */
-        else
-        {
-            for ( i = 0; i < nreads2; i += 2 )
-                rs_dst [ i + 1 ] = rs_src [ i + 1 ];
-
-            for ( ; total < spot_len && i != 0; )
-            {
-                uint32_t remaining = spot_len - total;
-                i -= 2;
-                rs_dst [ i + 1 ] += remaining;
-                total += remaining;
-            }
-
-            for ( i = 0, total = 0; i < nreads2; i += 2 )
-            {
-                rs_dst [ i ] = total;
-                total += rs_dst [ i + 1 ];
-            }
-        }
-#else
-        /* loop increments by 2
-           where the read start is even, read length odd */
-        for ( i = total = 0; i < nreads2; i += 2 )
-        {
-            /* is start greater than max? */
-            if ( rs_src [ i ] >= spot_len )
-            {
-                /* clip start to end */
-                rs_dst [ i ] = spot_len;
-                /* zero length read */
-                rs_dst [ i + 1 ] = 0;
-            }
-            /* is end greater than max? */
-            else if ( rs_src [ i ] + rs_src [ i + 1 ] > spot_len )
-            {
-                /* keep start */
-                rs_dst [ i ] = rs_src [ i ];
-                /* clip length to end */
-                rs_dst [ i + 1 ] = spot_len - rs_src [ i ];
-            }
-            else
-            {
-                /* copy existing segment */
-                rs_dst [ i ]   = rs_src [ i ];
-                rs_dst [ i + 1 ] = rs_src [ i + 1 ];
-            }
-
-            /* sum total length */
-            total += rs_src [ i + 1 ];
-        }
-#endif
-}
diff --git a/libs/sraxf/format-spot-name.c b/libs/sraxf/format-spot-name.c
deleted file mode 100644
index 9859ed5..0000000
--- a/libs/sraxf/format-spot-name.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include "name-tokenizer.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-/* format_spot_name ( ascii name_fmt, I32 X, I32 Y * ascii spot_name );
- *  given a name format string, X, and Y
- *  produce a reconstructed spot name string
- *
- *  "name_fmt" [ DATA ] - name format string ( see format explanation below )
- *
- *  "X" [ DATA ] - X coordinate for spot
- *
- *  "Y" [ DATA ] - Y coordinate for spot
- *
- *  "spot_name" [ DATA, OPTIONAL ] - potential source of unformatted names
- *
- * SYNOPSIS:
- *  "name_fmt" may have any ASCII characters
- *  the special character '$' is an escape symbol
- *  when followed by a recognized format character,
- *  both the '$' and its format character will be
- *  replaced with a numeral generated from X and/or Y.
- *
- *  when "spot_name" is present and the "name_fmt" row is empty,
- *  output is taken verbatim from "spot_name"
- *
- * FORMAT:
- *  'X' ( or 'x' ) = substitute with a decimal representation for X
- *  'Y' ( or 'y' ) = substitute with a decimal representation for Y
- *  'Q' ( or 'q' ) = calculate 454-style base-36 representation
- *                   for both X and Y
- */
-static
-rc_t CC format_spot_name ( void *self,
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    char *name;
-    uint32_t elem_count;
-    KDataBuffer *dst = rslt -> data;
-
-    if ( dst -> elem_bits != 8 )
-    {
-        rc = KDataBufferCast ( dst, dst, 8, true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* check for NAME_FMT */
-    if ( argv [ 0 ] . u. data . elem_count != 0 )
-    {
-        size_t num_writ;
-        char sname[1024]; /** name on stack **/
-        const char *name_fmt = ((char*)argv[0].u.data.base) + argv[0].u.data.first_elem;
-        uint32_t i, j, x, y;
-        const uint32_t fmt_size = argv [ 0 ] . u . data . elem_count;
-
-        /* the coordinates to substitute */
-        x = ( ( const int32_t* ) argv [ 1 ] . u . data . base )
-            [ argv [ 1 ] . u . data . first_elem ];
-        y = ( ( const int32_t* ) argv [ 2 ] . u . data . base )
-            [ argv [ 2 ] . u . data . first_elem ];
-
-        for ( i=j=0; i < fmt_size -1;){
-            if( name_fmt [ i ] == '$' ){
-                switch( name_fmt [ i+1 ]){
-                case 'x': case 'X':
-                    if( j > sizeof(sname) - 11){
-    					return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-                    } else {
-                        i+=2;
-                        if( i < fmt_size -1 && name_fmt [ i ] == '%' && isdigit(name_fmt [ i+1 ])) {
-                            x += 24*1024*(name_fmt [ i+1 ]-'0');
-                            i+=2;
-                        }
-                        j+=sprintf(sname+j,"%d",x);
-                    }
-                    break;
-                case 'y': case 'Y':
-                    if( j > sizeof(sname) - 11){
-    					return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-                    } else {
-                        i+=2;
-                        if( i < fmt_size -1 && name_fmt [ i ] == '%' && isdigit(name_fmt [ i+1 ])) {
-                            y += 24*1024*(name_fmt [ i+1 ]-'0');
-                            i+=2;
-                        }
-                        j+=sprintf(sname+j,"%d",y);
-                    }
-                    break;
-                case 'q': case 'Q':
-                    if( j > sizeof(sname) - 5) {
-    					return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-                    } else if( y > 0xFFF) {
-                        return RC ( rcXF, rcFunction, rcDecoding, rcRange, rcTooBig);
-                    } else {
-                        uint32_t q= x << 12 | y;
-                        sname[j+4]=Q_ALPHABET[q % 36]; q /= 36;
-                        sname[j+3]=Q_ALPHABET[q % 36]; q /= 36;
-                        sname[j+2]=Q_ALPHABET[q % 36]; q /= 36;
-                        sname[j+1]=Q_ALPHABET[q % 36]; q /= 36;
-                        sname[j]  =Q_ALPHABET[q];
-                        j+=5;
-                        i+=2;
-                    }
-                    break;
-		 case 'r': case 'R':
-            rc = string_printf ( & sname [ j ], sizeof sname - j, & num_writ, "%ld", row_id );
-            assert ( rc == 0 );
-            j += ( uint32_t ) num_writ;
-		    i+=2;
-		    break;
-                default:
-                    sname[j++]=name_fmt[i++];
-                    break;
-                }
-            } else {
-                if(j < sizeof(sname)){
-                    sname[j++]=name_fmt[i++];
-                } else {
-                    return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-                }
-            }
-            if( j > sizeof(sname)-1){	
-                return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-            }
-        }
-        if(i==fmt_size -1) {
-            if(j < sizeof(sname)){
-                sname[j++]=name_fmt[i++];
-            } else {
-                return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-            }
-        }
-        
-        /* j is our new element count **/
-        elem_count = j;
-
-        /* resize output */
-        if ( dst -> elem_count <= elem_count )
-        {
-            rc = KDataBufferResize ( dst, elem_count);
-            if ( rc != 0 )
-                return rc;
-        }
-        
-        /* the output name */
-        name = dst -> base;
-        
-        memcpy ( name, sname, elem_count );
-        rslt -> elem_count = elem_count;
-        return 0;
-    }
-
-    /* check for NAME */
-    if( argc == 4 && argv[3].u.data.elem_count != 0 ) {
-        const char *sname = ((char*)argv[3].u.data.base) + argv[3].u.data.first_elem;
-        /* output size */
-        elem_count = argv[3].u.data.elem_count;
-
-        /* resize output */
-        if( dst -> elem_count <= elem_count ) {
-            rc = KDataBufferResize( dst, elem_count + 1 );
-            if( rc != 0 )
-                return rc;
-        }
-        name = dst->base;
-        memcpy(dst->base, sname, elem_count);
-        rslt->elem_count = elem_count;
-        name[elem_count] = 0;
-        return 0;
-    }
-
-    /* spot has no name */
-    return RC ( rcSRA, rcColumn, rcReading, rcRow, rcNull );
-}
-static
-rc_t CC format_spot_name_no_coord ( void *self,
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    char *name;
-    uint32_t elem_count;
-    KDataBuffer *dst = rslt -> data;
-
-    if ( dst -> elem_bits != 8 )
-    {
-        rc = KDataBufferCast ( dst, dst, 8, true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* check for NAME_FMT */
-    if ( argv [ 0 ] . u. data . elem_count != 0 )
-    {
-        size_t num_writ;
-        char sname[1024]; /** name on stack **/
-        const char *name_fmt = ((char*)argv[0].u.data.base) + argv[0].u.data.first_elem;
-        uint32_t i, j;
-        const uint32_t fmt_size = argv [ 0 ] . u . data . elem_count;
-
-        for ( i=j=0; i < fmt_size -1;){
-            if( name_fmt [ i ] == '$' ){
-                switch( name_fmt [ i+1 ]){
-		 case 'r': case 'R':
-            rc = string_printf ( & sname [ j ], sizeof sname - j, & num_writ, "%ld", row_id );
-            assert ( rc == 0 );
-		    j += ( uint32_t ) num_writ;
-		    i+=2;
-		    break;
-                default:
-                    sname[j++]=name_fmt[i++];
-                    break;
-                }
-            } else {
-                if(j < sizeof(sname)){
-                    sname[j++]=name_fmt[i++];
-                } else {
-                    return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-                }
-            }
-            if( j > sizeof(sname)-1){	
-                return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-            }
-        }
-        if(i==fmt_size -1) {
-            if(j < sizeof(sname)){
-                sname[j++]=name_fmt[i++];
-            } else {
-                return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-            }
-        }
-        
-        /* j is our new element count **/
-        elem_count = j;
-
-        /* resize output */
-        if ( dst -> elem_count <= elem_count )
-        {
-            rc = KDataBufferResize ( dst, elem_count);
-            if ( rc != 0 )
-                return rc;
-        }
-        
-        /* the output name */
-        name = dst -> base;
-        
-        memcpy ( name, sname, elem_count );
-        rslt -> elem_count = elem_count;
-        return 0;
-    }
-
-    /* check for NAME */
-    if( argc == 2 && argv[1].u.data.elem_count != 0 ) {
-        const char *sname = ((char*)argv[1].u.data.base) + argv[1].u.data.first_elem;
-        /* output size */
-        elem_count = argv[1].u.data.elem_count;
-
-        /* resize output */
-        if( dst -> elem_count <= elem_count ) {
-            rc = KDataBufferResize( dst, elem_count + 1 );
-            if( rc != 0 )
-                return rc;
-        }
-        name = dst->base;
-        memcpy(dst->base, sname, elem_count);
-        rslt->elem_count = elem_count;
-        name[elem_count] = 0;
-        return 0;
-    }
-
-    /* spot has no name */
-    return RC ( rcSRA, rcColumn, rcReading, rcRow, rcNull );
-}
-/*
- * extern function ascii INSDC:SRA:format_spot_name #1 ( ascii name_fmt, I32 X, I32 Y * ascii spot_name );
- */
-VTRANSFACT_IMPL ( INSDC_SRA_format_spot_name, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = format_spot_name;
-    rslt -> variant = vftRow;
-    return 0;
-}
-
-
-VTRANSFACT_IMPL ( INSDC_SRA_format_spot_name_no_coord, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = format_spot_name_no_coord;
-    rslt -> variant = vftRow;
-    return 0;
-}
-
diff --git a/libs/sraxf/fpcodec.c b/libs/sraxf/fpcodec.c
deleted file mode 100644
index 8cd643a..0000000
--- a/libs/sraxf/fpcodec.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include <klib/pack.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <string.h>
-#include <zlib.h>
-#include <assert.h>
-#include <math.h>
-
-static
-rc_t
-hufDecodeBytes_zlib(void *dst, size_t dsize, bitsz_t *psize, const void *src, bitsz_t ssize)
-{
-    int result;
-    rc_t rc;
-	z_stream c_stream; /* decompression stream */
-
-	memset(&c_stream,0,sizeof(c_stream));
-
-	c_stream.next_in   = (Bytef*)src;
-	c_stream.next_out  = (Bytef*)dst;
-	c_stream.avail_in  = (uInt)( ( ssize + 7 ) >> 3 );
-	c_stream.avail_out = (uInt)dsize;
-
-	if (psize)
-        *psize = 0;
-
-    result = inflateInit(&c_stream);
-    switch (result)
-    {
-    case Z_OK:
-            
-        result = inflate ( & c_stream, Z_FINISH );
-        switch (result)
-        {
-        case Z_STREAM_END:
-                
-            result = inflateEnd ( & c_stream );
-            if ( result == Z_OK )
-            {
-                if ( psize != NULL )
-                    * psize = c_stream.total_out << 3;
-                return 0;
-            }
-            return RC ( rcXF, rcFunction, rcDecoding, rcParam, rcInvalid );
-                
-        case Z_OK:
-        case Z_BUF_ERROR:
-            rc = RC (rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
-            break;
-
-        case Z_NEED_DICT:
-        case Z_DATA_ERROR:
-            rc = RC (rcXF, rcFunction, rcDecoding, rcData, rcCorrupt);
-            break;
-        
-        case Z_MEM_ERROR:
-            rc = RC(rcXF, rcFunction, rcDecoding, rcMemory, rcExhausted);
-            break;
-        
-        case Z_STREAM_ERROR:
-        default:
-            rc = RC (rcXF, rcFunction, rcDecoding, rcNoObj, rcUnexpected);
-            break;
-        }
-
-        inflateEnd ( & c_stream );
-        break;
-            
-    case Z_MEM_ERROR:
-        rc = RC(rcXF, rcFunction, rcDecoding, rcMemory, rcExhausted);
-        break;
-            
-    case Z_VERSION_ERROR:
-    default:
-        rc = RC (rcXF, rcFunction, rcDecoding, rcNoObj, rcUnexpected);
-        break;
-    }
-
-    return rc;
-}
-
-
-typedef struct {
-	uint8_t 	mbits;/* mantissa bits to keep */
-	uint8_t		sign; /* if set then mantissa is signed */
-	uint8_t		version;
-    uint8_t     exp_not_compressed;
-} fp_trunc_key;
-
-typedef struct {
-	uint32_t	count;
-	fp_trunc_key cmn;
-} fp_trunc_key_v0;
-
-typedef struct {
-	uint64_t	count;
-	fp_trunc_key cmn;
-} fp_trunc_key_v1;
-
-static
-rc_t CC fp_extend ( void *self, const VXformInfo *info,
-    VLegacyBlobResult *rslt, const KDataBuffer *in )
-{
-    rc_t rc;
-    bitsz_t bsize;
-    uint64_t i, count;
-    uint32_t count32;
-    size_t tmpsize, psize;
-
-    int32_t *dst;
-    int8_t  *dexp;
-
-    KDataBuffer *out = rslt -> dst;
-    uint32_t keep = ( uint32_t ) ( size_t ) self;
-
-    fp_trunc_key tkey;
-    size_t ssize = KDataBufferBytes ( in );
-    const uint8_t *src = in -> base;
-
-    if(ssize < sizeof(tkey))
-        return RC(rcXF, rcFunction, rcUnpacking, rcData, rcUnexpected);
-    ssize -= sizeof(tkey); 
-    memcpy(&tkey,src+ssize,sizeof(tkey));
-
-    if(tkey.mbits > 24 || tkey.mbits > keep) 
-        return RC(rcXF, rcFunction, rcUnpacking, rcData, rcUnexpected);
-
-    switch ( tkey . version )
-    {
-    case 0:
-        if ( ssize < sizeof count32 )
-            return RC(rcXF, rcFunction, rcUnpacking, rcData, rcUnexpected);
-        ssize -= sizeof count32;
-        memcpy ( & count32, src+ssize, sizeof count32 );
-        count = count32;
-        break;
-    case 1:
-        if ( ssize < sizeof count )
-            return RC(rcXF, rcFunction, rcUnpacking, rcData, rcUnexpected);
-        ssize -= sizeof count;
-        memcpy ( & count, src+ssize, sizeof count );
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcUnpacking, rcBlob, rcBadVersion );
-    }
-
-    psize = ( ( (size_t)count * tkey.mbits + 7 ) >> 3 );
-    if(psize > ssize)
-        return RC(rcXF, rcFunction, rcUnpacking, rcData, rcUnexpected);
-
-    out -> elem_bits = 32;
-    rc = KDataBufferResize ( out, (uint32_t)count );
-    if ( rc != 0 )
-        return rc;
-
-    dst = out -> base;    
-
-    /* unpack mantissa */
-    rc = Unpack ( tkey.mbits, 32, src, 0, (bitsz_t)( count * tkey.mbits ), 
-		          NULL, dst, KDataBufferBytes ( out ), & tmpsize );
-    if ( rc != 0 )
-        return rc;
-
-    assert ( KDataBufferBytes ( out ) == tmpsize );
-
-    rslt -> byte_order = vboNative;
-    ssize -= psize;
-        
-    dexp = malloc( (size_t)count );
-    if(dexp==NULL)
-        return RC(rcXF, rcFunction, rcUnpacking, rcMemory, rcExhausted);
-
-    if ( tkey.exp_not_compressed )
-        memcpy( dexp, src+psize, (size_t)count );
-    else
-        /*** uncompress the exponent ***/
-        rc = hufDecodeBytes_zlib( dexp, (size_t)count, &bsize, src+psize, ssize << 3 );
-
-    if(rc == 0)
-    {
-        float *fdst;
-
-        /* combine mantissa and exponent */
-        if(tkey.sign==0)
-        {
-            for (fdst=(float*)dst, i = 0; i < count; ++ i )
-                fdst[i]=ldexpf(dst[i],dexp[i]-tkey.mbits);/*** the highest bit is not a sign ***/
-        }
-        else
-        {
-            uint32_t sign_extend= ~((1<<(tkey.mbits-1))-1);
-            for (fdst=(float*)dst, i = 0; i < count; ++ i )
-            {
-                if(dst[i]&sign_extend)
-                {
-                    float m=(float)(int)(dst[i]|sign_extend);
-                    fdst[i]=ldexpf(m,dexp[i]-tkey.mbits+1);
-                }
-                else
-                {
-                    float m=(float)dst[i];
-                    fdst[i]=ldexpf(m,dexp[i]-tkey.mbits+1);
-                }
-            }
-        }
-    }
-
-    free(dexp);
-    
-    return rc;
-}
-
-/* F32 NCBI:fp_extend #1.0 < U32 bits > ( NCBI:fp_encoded_t in );
- */
-VTRANSFACT_IMPL ( NCBI_fp_extend, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VNoHdrBlobFunc f = fp_extend;
-
-    /* test bit range */
-    uint32_t bits = cp -> argv [ 0 ] . data . u32 [ 0 ];
-    if ( bits < 1 || bits > 23 )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcRange, rcIncorrect );
-
-    /* pass bits to function */
-    rslt -> self = ( void* ) ( size_t ) bits;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    return 0;
-}
diff --git a/libs/sraxf/index_lookup.c b/libs/sraxf/index_lookup.c
deleted file mode 100644
index fbafa89..0000000
--- a/libs/sraxf/index_lookup.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/index.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/pbstree.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <assert.h>
-
-typedef struct tag_self_t {
-    const       KIndex *ndx;
-    char        query_key[1024];
-    uint32_t    query_key_len;
-    uint8_t     name_fmt_version;
-    const struct VCursorParams * parms;
-    uint32_t    elem_bits;
-} self_t;
-
-static void CC self_whack( void *Self )
-{
-    self_t *self = Self;
-    
-    KIndexRelease( self->ndx );
-    free( self );
-}
-
-typedef struct FindFmtDataXtra{
-        int32_t x;
-        int32_t y;
-}FindFmtDataXtra;
-
-static int CC SRAPTNodeFindFmt ( const void *item, const struct PBSTNode *n, void *data )
-{
-    int i,j;
-    FindFmtDataXtra *u=(FindFmtDataXtra *)data;
-    /* compare the remainder of the key */
-    const String *rem = item;
-    const char* q=rem->addr; /** query **/
-    const char* db=n->data.addr; /** database **/
-
-    for(i=j=0;q[i]!=0 && db[j]!= 0;){
-        if(q[i] == db[j]){
-                i++;j++;
-        } else if(db[j] == '$'){
-                switch(db[j+1]){
-		 case 'q':
-                 case 'Q':
-		 {
-			int k;
-			uint32_t xy=0;
-			j+=2;
-			for(k=0;k<5 && q[i]!=0;k++,i++){
-				xy *= 36;
-				if(isdigit(q[i])){
-					xy += q[i] - '0' + 26;
-				} else if(isalpha(q[i])){
-					xy += toupper(q[i]) - 'A';
-				}
-			}
-			if(u){
-				u->x = xy >> 12;
-				u->y = xy &0xFFF;
-			}
-	       		break;
-		 }
-                 case 'x':
-                 case 'X':
-                        if(u) u->x=atoi(q+i);
-                        j+=2;
-                        while(isdigit(q[i]))i++;
-			if(q[i]=='%' && isdigit(q[i+1])){
-				u->x += 24*1024*(q[i+1]-'0');
-				j+=2;
-			}
-                        break;
-                 case 'y':
-                 case 'Y':
-                        if(u) u->y=atoi(q+i);
-                        j+=2;
-                        while(isdigit(q[i]))i++;
-			if(q[i]=='%' && isdigit(q[i+1])){
-				u->y += 24*1024*(q[i+1]-'0');
-				j+=2;
-			}
-                        break;
-                 default:
-                        return  q[i]-db[j];
-                        break;
-                }
-        } else {
-                break;
-        }
-    }
-    return  q[i]-db[j];
-}
-
-
-static
-rc_t CC index_lookup_impl(
-                          void *Self,
-                          const VXformInfo *info,
-                          int64_t row_id,
-                          VRowResult *rslt,
-                          uint32_t argc,
-                          const VRowData argv[]
-                          )
-{
-    rc_t rc;
-    const self_t *self = Self;
-    KDataBuffer *query_buf=NULL;
-    char	query[1024];
-    uint64_t id_count;
-    int64_t start_id;
-    FindFmtDataXtra fxdata={0,0};
-    struct {
-        uint64_t start_id;
-        uint64_t id_count;
-        uint64_t x;
-        uint64_t y;
-    } out;
-    
-    rc = VCursorParamsGet(self->parms,self->query_key,&query_buf);
-    if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcName) {
-	rslt->elem_count = 0;
-	rslt->no_cache = 1;
-	return 0;
-    }
-    if(rc == 0){
-        char    *qptr=((char*)query_buf->base)+(query_buf->bit_offset >>3);
-        uint32_t qlen=query_buf->elem_count;
-        
-        if(argc > 0){
-            char *   pptr=((char*)argv[0].u.data.base) + argv[0].u.data.first_elem;
-            uint32_t plen=argv[0].u.data.elem_count;
-            while(plen > 0 &&  qlen > 0 && *pptr == *qptr){
-                pptr++;
-                qptr++;
-                plen--;
-                qlen--;
-            }
-            if(plen > 0) rc = RC ( rcVDB,rcIndex,rcSearching,rcData,rcNotFound);
-        }
-        if( rc == 0){
-            memcpy(query,qptr,qlen);
-            query[query_buf->elem_count]='\0';
-            if( self -> name_fmt_version == 1){ /*** this is a strange slx format name - very first implementation ***/
-                int lane=-1,tile=-1,x=-1,y=-1;
-                qptr=query;
-                if(*qptr == ':'){ qptr++;qlen--;}
-                sscanf(qptr,"%d:%d:%d:%d",&lane,&tile,&x,&y);
-                if(lane < 0 || lane > 0xF || tile < 0 || tile > 0xFFF || x < 0 || x > 0xFFF || y < 0 || y > 0xFFF){
-                    rc = RC ( rcVDB,rcIndex,rcSearching,rcData,rcNotFound);
-                } else {
-                    sprintf(query,"%1X%03X%03X%03X",lane,tile,x,y);
-                }
-            }
-            if(rc == 0 ) {
-                if( self -> name_fmt_version  >= 2) /*** X and Y are present ***/
-                    rc = KIndexFindText(self->ndx, query, &start_id, &id_count,SRAPTNodeFindFmt,&fxdata);
-                else
-                    rc = KIndexFindText(self->ndx, query, &start_id, &id_count,NULL,NULL);
-                if(rc == 0){
-                    KDataBuffer *dst = rslt -> data;
-                    rc = KDataBufferResize ( dst, 1 );
-                    if( rc == 0) {
-                        out.start_id = start_id;
-                        out.id_count = id_count;
-                        out.x        = fxdata.x;
-                        out.y        = fxdata.y;
-                        memcpy(dst -> base,&out,sizeof(out));
-                        rslt -> elem_count = 1;
-                        rslt -> no_cache = 1; /***** This row should never be cached **/
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL(NCBI_SRA_lookup, 1, 0, 0) (
-                                           const void *Self,
-                                           const VXfactInfo *info,
-                                           VFuncDesc *rslt,
-                                           const VFactoryParams *cp,
-                                           const VFunctionParams *dp
-) {
-    rc_t rc;
-    const KIndex *ndx;
-    KIdxType type;
-    
-    rc = VTableOpenIndexRead(info->tbl, &ndx, "%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii);
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound )
-            PLOGERR (klogErr, (klogErr, rc, "Failed to open index '$(index)'", "index=%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii));
-        return rc;
-    }
-    
-    rc = KIndexType(ndx, &type);
-    if (rc == 0) {
-        if (type == kitProj + kitText) {
-            self_t *self;
-            
-            self = malloc(sizeof(*self));
-            if (self) {
-                self->ndx = ndx;
-                self->elem_bits = VTypedescSizeof(&info->fdesc.desc);
-		memcpy(self->query_key,cp->argv[1].data.ascii,cp->argv[1].count);
-		self->query_key_len = cp->argv[1].count;
-		self->query_key[self->query_key_len]='\0';
-		self->parms=info->parms;
-		self->name_fmt_version = *cp->argv[2].data.u8;
-/*** testing::: VCursorParamsSet(self->parms,"QUERY_BY_NAME" ,"EM7LVYS01C1LWG");***/
-		
-                rslt->self = self;
-                rslt->whack = self_whack;
-                rslt->variant = vftNonDetRow;
-                rslt->u.ndf = index_lookup_impl;
-                return 0;
-            }
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        }
-        else
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcIndex, rcIncorrect);
-    }
-    KIndexRelease(ndx);
-    return rc;
-}
diff --git a/libs/sraxf/libsraxf.vers b/libs/sraxf/libsraxf.vers
deleted file mode 100644
index e25d8d9..0000000
--- a/libs/sraxf/libsraxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.5
diff --git a/libs/sraxf/libwsraxf.vers b/libs/sraxf/libwsraxf.vers
deleted file mode 100644
index e25d8d9..0000000
--- a/libs/sraxf/libwsraxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.5
diff --git a/libs/sraxf/make-position.c b/libs/sraxf/make-position.c
deleted file mode 100644
index 4159911..0000000
--- a/libs/sraxf/make-position.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-/* make_position
- *  return a synthesized position row with 1-1 correspondence
- *
- *  "T" [ TYPE ] - position type being generated
- *
- *  "start" [ CONST ] - either 0 or 1, depending upon the coordinate system
- *
- *  "read" [ DATA ] - the actual row of bases. the output row
- *  will be the same length, but with synthesized data
- */
-static
-rc_t CC make_position ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt,  uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    KDataBuffer *dst = self;
-
-    if ( argv [ 0 ] . u . data . elem_count > dst -> elem_count )
-    {
-        uint32_t old = dst -> elem_count;
-        rc = KDataBufferResize ( dst, argv [ 0 ] . u . data . elem_count );
-        if ( rc != 0 )
-            return rc;
-        if ( dst -> elem_bits == 16 )
-        {
-            uint16_t i, *p = dst -> base;
-            uint16_t offset = p [ 0 ];
-            for ( i = old; i < dst -> elem_count; ++ i )
-                p [ i ] = i + offset;
-        }
-        else
-        {
-            int32_t i, *p = dst -> base;
-            int32_t offset = p [ 0 ];
-            for ( i = old; i < (int32_t)dst -> elem_count; ++ i )
-                p [ i ] = i + offset;
-        }
-    }
-
-    KDataBufferWhack ( rslt -> data );
-    rc = KDataBufferSub ( dst, rslt -> data, 0, argv [ 0 ] . u . data . elem_count );
-    if ( rc == 0 )
-        rslt -> elem_count = argv [ 0 ] . u . data . elem_count;
-
-    return rc;
-}
-
-static
-void CC whack_data_buffer ( void *data )
-{
-    KDataBufferWhack ( data );
-    free ( data );
-}
-
-VTRANSFACT_IMPL( NCBI_SRA_make_position, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    KDataBuffer *b = malloc ( sizeof * b );
-    if ( b == NULL )
-        return RC ( rcSRA, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    rc = KDataBufferMake ( b, info -> fdesc . desc . intrinsic_bits, 4096 );
-    if ( rc != 0 )
-    {
-        free ( b );
-        return rc;
-    }
-
-    if ( info -> fdesc . desc . intrinsic_bits == 16 )
-    {
-        uint16_t i, *dst = b -> base;
-        uint16_t offset = cp -> argv [ 0 ] . data . u16 [ 0 ];
-        for ( i = 0; i < 4096; ++ i )
-            dst [ i ] = i + offset;
-    }
-    else if ( info -> fdesc . desc . intrinsic_bits == 32 )
-    {
-        int32_t i, *dst = b -> base;
-        int32_t offset = cp -> argv [ 0 ] . data . i32 [ 0 ];
-        for ( i = 0; i < 4096; ++ i )
-            dst [ i ] = i + offset;
-    }
-    else
-    {
-        /* this shouldn't really be needed */
-        whack_data_buffer ( b );
-        return RC ( rcSRA, rcFunction, rcConstructing, rcType, rcUnsupported );
-    }
-
-    rslt -> self = b;
-    rslt -> whack = whack_data_buffer;
-    rslt -> u . rf = make_position;
-    rslt -> variant = vftRow;
-
-    return 0;
-}
diff --git a/libs/sraxf/name-tokenizer.h b/libs/sraxf/name-tokenizer.h
deleted file mode 100644
index dcebc27..0000000
--- a/libs/sraxf/name-tokenizer.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_name_tokenizer_
-#define _h_name_tokenizer_
-
-/* spot_name_token_t
- *  represents a single token
- *  the tokenizer should emit a row of zero or more of these
- */
-typedef union spot_name_token_t spot_name_token_t;
-union spot_name_token_t
-{
-    struct
-    {
-        uint16_t token_type;
-        uint16_t position;
-        uint16_t length;
-    } s;
-    uint16_t raw [ 3 ];
-};
-
-/* name_token
- *  token ids
- */
-enum name_token
-{
-    nt_unrecognized = 1,
-    nt_recognized,
-
-    nt_Q,
-
-    nt_X,
-    nt_Y,
-    nt_T,
-    nt_L,
-
-    nt_signed_X,
-    nt_signed_Y,
-    nt_signed_T,
-    nt_signed_L,
-
-    nt_octal_X,
-    nt_octal_Y,
-    nt_octal_T,
-    nt_octal_L,
-
-    nt_hex_upper_X,
-    nt_hex_upper_Y,
-    nt_hex_upper_T,
-    nt_hex_upper_L,
-
-    nt_hex_lower_X,
-    nt_hex_lower_Y,
-    nt_hex_lower_T,
-    nt_hex_lower_L,
-
-    nt_max_token
-};
-
-/* token_symbol
- *  substitution symbols
- */
-#define TOK_ALPHABET ("---QXYTLXYTLabcdefghxytl")
-
-enum token_symbol
-{
-    ts_Q          = 'Q',
-
-    ts_X          = 'X',
-    ts_Y          = 'Y',
-    ts_T          = 'T',
-    ts_L          = 'L',
-
-    ts_signed_X   = 'X',
-    ts_signed_Y   = 'Y',
-    ts_signed_T   = 'T',
-    ts_signed_L   = 'L',
-
-    ts_oct_X      = 'a',
-    ts_oct_Y      = 'b',
-    ts_oct_T      = 'c',
-    ts_oct_L      = 'd',
-
-    ts_hex_upr_X  = 'e',
-    ts_hex_upr_Y  = 'f',
-    ts_hex_upr_T  = 'g',
-    ts_hex_upr_L  = 'h',
-
-    ts_hex_lwr_X  = 'x',
-    ts_hex_lwr_Y  = 'y',
-    ts_hex_lwr_T  = 't',
-    ts_hex_lwr_L  = 'l'
-};
-
-#define Q_ALPHABET ("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
-
-#endif /* _h_name_tokenizer_ */
diff --git a/libs/sraxf/normalize.c b/libs/sraxf/normalize.c
deleted file mode 100644
index 8c40dc1..0000000
--- a/libs/sraxf/normalize.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sysalloc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef void (*norm_f)(void *dst, const void *src, const void *Cntrl, uint32_t vec_count);
-typedef struct self_t {
-    norm_f f;
-} self_t;
-
-#define NORM_0(A, B) do { \
-                            (A).data[0] = (B).data[0]; \
-                            (A).data[1] = (B).data[1] - (B).data[0]; \
-                            (A).data[2] = (B).data[2]; \
-                            (A).data[3] = (B).data[3]; \
-                        } while (0)
-#define NORM_1(A, B) A = B
-#define NORM_2(A, B) do { \
-                            (A).data[0] = (B).data[0]; \
-                            (A).data[1] = (B).data[1]; \
-                            (A).data[2] = (B).data[2]; \
-                            (A).data[3] = (B).data[3] - (B).data[2]; \
-                        } while (0)
-#define NORM_3(A, B) A = B
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, const void *Src, const void *Cntrl, uint32_t count) { \
-    typedef struct { VALTYPE data[4]; } data4_t; \
-    data4_t *dst = (data4_t *)Dst; \
-    const data4_t *src = (const data4_t *)Src; \
-    const uint8_t *cntrl = (const uint8_t *)Cntrl; \
-    uint32_t i; \
-    \
-    for (i = 0; i != count; ++i) { \
-        switch(cntrl[i]) { \
-        default: \
-        case 0: \
-            NORM_0(dst[i], src[i]); \
-            break; \
-        case 1: \
-            NORM_1(dst[i], src[i]); \
-            break; \
-        case 2: \
-            NORM_2(dst[i], src[i]); \
-            break; \
-        case 3: \
-            NORM_3(dst[i], src[i]); \
-            break; \
-        }\
-    } \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC normal_drvr (
-                void *Self,
-                const VXformInfo *info,
-                int64_t row_id,
-                VRowResult *rslt,
-                uint32_t argc,
-                const VRowData argv []
-) {
-    rc_t rc = 0;
-    const void *src;
-    const void *cntrl;
-    const self_t *self = (const self_t *)Self;
-    
-    assert(argv[0].u.data.elem_bits % 8 == 0);
-    assert(argv[1].u.data.elem_bits % 8 == 0);
-    
-    src   = &((const uint8_t *)argv[0].u.data.base)[(argv[0].u.data.first_elem * argv[0].u.data.elem_bits) / 8];
-    cntrl = &((const uint8_t *)argv[1].u.data.base)[(argv[1].u.data.first_elem * argv[1].u.data.elem_bits) / 8];
-    
-    rslt->elem_bits = rslt->data->elem_bits = argv[0].u.data.elem_bits;
-    rc = KDataBufferResize(rslt->data, argv[0].u.data.elem_count);
-    if (rc)
-        return rc;
-    rslt->elem_count = rslt->data->elem_count;
-    rslt->data->bit_offset = 0;
-    
-    self->f(rslt->data->base, src, cntrl, rslt->elem_count);
-    
-    return 0;
-}
-
-static
-void CC sraxf_normalize_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- * function < type T > T [ 4 ] NCBI:SRA:normalize #1 ( T [ 4 ] intensities, U8 called );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_normalize, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self;
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-        break;
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(int8_t);
-                break;
-            case 16:
-                self->f = FUNC(int16_t);
-                break;
-            case 32:
-                self->f = FUNC(int32_t);
-                break;
-            case 64:
-                self->f = FUNC(int64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(uint8_t);
-                break;
-            case 16:
-                self->f = FUNC(uint16_t);
-                break;
-            case 32:
-                self->f = FUNC(uint32_t);
-                break;
-            case 64:
-                self->f = FUNC(uint64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                self->f = FUNC(float);
-                break;
-            case 64:
-                self->f = FUNC(double);
-                break;
-            default:
-                break;
-            }
-            break;
-        default:
-            break;
-        }
-        
-        rslt->self = self;
-        rslt->whack = sraxf_normalize_free_wrapper;
-        rslt->u.rf = normal_drvr;
-        rslt->variant = vftRow;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/sraxf/prefix-tree-to-name.c b/libs/sraxf/prefix-tree-to-name.c
deleted file mode 100644
index 06a2e1b..0000000
--- a/libs/sraxf/prefix-tree-to-name.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sysalloc.h>
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/index.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-#include <assert.h>
-
-/* ascii NCBI:SRA:prefix_tree_to_name #1 < ascii idx > ( * ascii name );
- *  use prefix tree index data in reverse lookup
- *  as a substitute for physical NAME column
- *
- *  "idx" [ CONST ] - name of prefix-tree text index
- *
- *  "name" [ DATA, OPTIONAL ] - source of unindexed names
- *  when a reverse lookup on "idx" fails and this input is
- *  present, its row is returned.
- */
-static
-rc_t prefix_tree_to_name ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const KIndex *idx = ( const void* ) self;
-    KDataBuffer *dst = rslt -> data;
-
-    /* the buffer should have already been given the correct element size */
-    if ( dst -> elem_bits != 8 )
-    {
-        rc = KDataBufferCast ( dst, dst, 8, true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* the actual size depends upon whether the buffer is new or was resized very small */
-    if ( dst -> elem_count < 8 )
-    {
-        rc = KDataBufferResize ( dst, 4 * 1024 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* try to get the text with current size */
-    rc = KIndexProjectText ( idx, row_id, NULL, NULL, dst -> base, dst -> elem_count, NULL );
-    if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer )
-    {
-        /* go to 4K buffer - should never fail */
-        rc = KDataBufferResize ( dst, 4 * 1024 );
-        if ( rc == 0 )
-        {
-            rc = KIndexProjectText ( idx, row_id, NULL, NULL, dst -> base, dst -> elem_count, NULL );
-            if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer )
-            {
-                /* go to 16K buffer - this is absurd */
-                rc = KDataBufferResize ( dst, 16 * 1024 );
-                if ( rc == 0 )
-                {
-                    rc = KIndexProjectText ( idx, row_id, NULL, NULL, dst -> base, dst -> elem_count, NULL );
-                    if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer )
-
-                        /* reject this name, it is likely garbage */
-                        rc = RC ( rcSRA, rcIndex, rcProjecting, rcName, rcExcessive );
-                }
-            }
-        }
-    }
-
-    /* test to see if we got the name */
-    if ( rc == 0 )
-    {
-        rslt -> elem_count = (uint32_t)strlen ( ( const char* ) dst -> base );
-        return 0;
-    }
-
-    /* if id was not found, check for alternate input */
-    if ( GetRCState ( rc ) == rcNotFound && argc == 1 && argv [ 0 ] . u . data . elem_count != 0 )
-    {
-        if ( dst -> elem_count < argv [ 0 ] . u . data . elem_count )
-        {
-            rc = KDataBufferResize ( dst, argv [ 0 ] . u . data . elem_count );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        rc = 0;
-
-        string_copy ( dst -> base, dst -> elem_count,
-            argv [ 0 ] . u . data . base, argv [ 0 ] . u . data . elem_count );
-    }
-
-    return rc;
-}
-
-static
-void release_prefix_tree ( void *item )
-{
-    KIndexRelease ( ( const void* ) item );
-}
-
-VTRANSFACT_IMPL( NCBI_SRA_prefix_tree_to_name, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* the first thing to do is to open the prefix tree */
-    const KIndex *idx;
-    rc_t rc = VTableOpenIndexRead ( info -> tbl, & idx, "%.*s",
-        ( int ) cp -> argv [ 0 ] . count, cp -> argv [ 0 ] . data . ascii );
-    if ( rc == 0 )
-    {
-        KIdxType type;
-        rc = KIndexType ( idx, & type );
-        if ( rc == 0 )
-        {
-            if ( type == ( kitText | kitProj ) )
-            {
-                rslt -> self = ( void* ) idx;
-                rslt -> whack = release_prefix_tree;
-                rslt -> u . rf = prefix_tree_to_name;
-                rslt -> variant = vftRow;
-                return 0;
-            }
-
-            rc = RC ( rcSRA, rcFunction, rcConstructing, rcIndex, rcIncorrect );
-        }
-
-        KIndexRelease ( idx );
-    }
-    else {
-        OUTMSG("VTableOpenIndexRead failed: %R", rc);
-    }
-
-    return rc;
-}
diff --git a/libs/sraxf/process-position.c b/libs/sraxf/process-position.c
deleted file mode 100644
index e135ab7..0000000
--- a/libs/sraxf/process-position.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sysalloc.h>
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-void process_position ( uint16_t *dst, const uint16_t *src, uint32_t count )
-{
-    uint32_t i, cur, prev;
-
-    for ( prev = i = 0; i < count; prev = cur, ++ i )
-    {
-        cur = src [ i ];
-        if ( cur > 0x7FFF )
-            cur = ( uint8_t ) cur;
-        while ( prev > cur )
-            cur += 256;
-        dst [ i ] = cur;
-    }
-}
-
-static
-rc_t CC process_position1 ( void *self, const VXformInfo *info,
-    int64_t row_id, const VFixedRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    uint16_t *dst = rslt -> base;
-    const uint16_t *src = argv [ 0 ] . u . data . base;
-    uint32_t count = argv [ 0 ] . u . data . elem_count;
-
-    dst += rslt -> first_elem;
-    src += argv [ 0 ] . u . data . first_elem;
-
-    process_position ( dst, src, count );
-
-    return 0;
-}
-
-static
-rc_t CC process_position2 ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    /* position row data */
-    const uint16_t *src = argv [ 0 ] . u . data . base;
-    uint32_t count = argv [ 0 ] . u . data . elem_count;
-
-    /* filter row data */
-    const SRAReadFilter *rd_filt = argv [ 1 ] . u . data . base;
-    uint32_t i, nreads = argv [ 1 ] . u . data . elem_count;
-
-    /* output buffer */
-    uint16_t *dst;
-    rc_t rc = KDataBufferCast ( rslt -> data, rslt -> data, 16, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( rslt -> data, count );
-    if ( rc != 0 )
-        return rc;
-
-    /* adjust all pointers to start of row */
-    src += argv [ 0 ] . u . data . first_elem;
-    rd_filt += argv [ 1 ] . u . data . first_elem;
-    dst = rslt -> data -> base;
-
-    /* set output size */
-    rslt -> elem_count = count;
-    rslt -> elem_bits = 16;
-
-    /* walk input */
-    for ( i = 0; i < nreads; ++ i )
-    {
-        if ( rd_filt [ i ] == SRA_READ_FILTER_REDACTED )
-        {
-            memset ( dst, 0, count * sizeof * dst );
-            return 0;
-        }
-    }
-
-    process_position ( dst, src, count );
-
-    return 0;
-}
-
-static
-rc_t CC process_position3 ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    /* position row data */
-    const uint16_t *src = argv [ 0 ] . u . data . base;
-    uint32_t count = argv [ 0 ] . u . data . elem_count;
-
-    /* filter row data */
-    const SRAReadFilter *rd_filt = argv [ 1 ] . u . data . base;
-    uint32_t i, nreads = argv [ 1 ] . u . data . elem_count;
-
-    /* signal row data */
-    const uint16_t *sig = argv [ 2 ] . u . data . base;
-
-    /* output buffer */
-    uint16_t *dst;
-    rc_t rc = KDataBufferCast ( rslt -> data, rslt -> data, 16, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( rslt -> data, count );
-    if ( rc != 0 )
-        return rc;
-
-    /* adjust all pointers to start of row */
-    src += argv [ 0 ] . u . data . first_elem;
-    rd_filt += argv [ 1 ] . u . data . first_elem;
-    sig += argv [ 2 ] . u . data . first_elem;
-    dst = rslt -> data -> base;
-
-    /* set output size */
-    rslt -> elem_count = count;
-    rslt -> elem_bits = 16;
-
-    /* walk input */
-    for ( i = 0; i < nreads; ++ i )
-    {
-        if ( rd_filt [ i ] == SRA_READ_FILTER_REDACTED )
-        {
-            uint32_t scount = argv [ 2 ] . u . data . elem_count;
-            for ( i = 0; i < scount; ++ i )
-            {
-                if ( sig [ i ] != 0 )
-                    break;
-            }
-            if ( i == scount )
-            {
-                memset ( dst, 0, count * sizeof * dst );
-                return 0;
-            }
-            break;
-        }
-    }
-
-    process_position ( dst, src, count );
-
-    return 0;
-}
-
-
-/* process_position
- *  convert 8 bit integration into 16 bit
- */
-VTRANSFACT_IMPL ( NCBI_SRA__454__process_position, 1, 0, 0 ) ( const void *fself, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    if ( dp -> argc == 3 )
-    {
-        rslt -> u . rf = process_position3;
-        rslt -> variant = vftRow;
-        return 0;
-    }
-
-    if ( dp -> argc == 2 )
-    {
-        rslt -> u . rf = process_position2;
-        rslt -> variant = vftRow;
-        return 0;
-    }
-
-    rslt -> u . pf = process_position1;
-    rslt -> variant = vftFixedRow;
-    return 0;
-}
diff --git a/libs/sraxf/qual4_codec.h b/libs/sraxf/qual4_codec.h
deleted file mode 100644
index 9d2fd3f..0000000
--- a/libs/sraxf/qual4_codec.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef int8_t qual4[4];
-
-enum code_book {
-	known_bad = 81,
-	known_good,
-	pattern_a_1, /* val, -val, min, min */
-	pattern_a_2, /* val, min, -val, min */
-	pattern_a_3, /* val, min, min, -val */
-	pattern_b_1, /* val, -val + 1, min, min */
-	pattern_b_2, /* val, min, -val + 1, min */
-	pattern_b_3, /* val, min, min, -val + 1 */
-	pattern_c_1, /* val, -val - 1, min, min */
-	pattern_c_2, /* val, min, -val - 1, min */
-	pattern_c_3, /* val, min, min, -val - 1 */
-	cb_last
-};
-
diff --git a/libs/sraxf/qual4_decode.c b/libs/sraxf/qual4_decode.c
deleted file mode 100644
index b2ee301..0000000
--- a/libs/sraxf/qual4_decode.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include "qual4_codec.h"
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#include <assert.h>
-
-static size_t qual4_decode(
-                           qual4 *dst,
-                           size_t dcount,
-                           const uint8_t *src,
-                           size_t ssize,
-                           const int8_t qmin,
-                           const int8_t qmax
-) {
-	int st;
-	int st2;
-    size_t i;
-    size_t j;
-
-	static const qual4 all_bad = { -5,  -5,  -5,  -5 };
-
-    qual4 is_good;
-    is_good [ 0 ] = qmax;
-    is_good [ 1 ] = qmin;
-    is_good [ 2 ] = qmin;
-    is_good [ 3 ] = qmin;
-	
-	for (st = st2 = 0, j = i = 0; i != ssize && j < dcount; ++i) {
-        int val = src[i] - 40;
-        
-		switch (st) {
-		case 0:
-            if (src[i] < known_bad) {
-                dst[j][0] = val;
-                st = 1;
-            }
-            else if (src[i] == known_bad)
-                memcpy(&dst[j][0], all_bad, 4);
-            else if (src[i] == known_good)
-                memcpy(&dst[j][0], is_good, 4);
-            else {
-                st2 = src[i];
-                st = 4;
-            }
-			break;
-		case 1:
-			dst[j][1] = val;
-			++st;
-			break;
-		case 2:
-			dst[j][2] = val;
-			++st;
-			break;
-		case 3:
-			dst[j][3] = val;
-			st = 0;
-			break;
-        case 4:
-            switch (st2) {
-            case pattern_a_1:
-                dst[j][0] = val;
-				dst[j][1] = -val;
-				dst[j][2] = qmin;
-				dst[j][3] = qmin;
-                break;
-            case pattern_a_2:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = -val;
-				dst[j][3] = qmin;
-                break;
-            case pattern_a_3:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = qmin;
-				dst[j][3] = -val;
-                break;
-            case pattern_b_1:
-                dst[j][0] = val;
-				dst[j][1] = -val + 1;
-				dst[j][2] = qmin;
-				dst[j][3] = qmin;
-                break;
-            case pattern_b_2:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = -val + 1;
-				dst[j][3] = qmin;
-                break;
-            case pattern_b_3:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = qmin;
-				dst[j][3] = -val + 1;
-                break;
-            case pattern_c_1:
-                dst[j][0] = val;
-				dst[j][1] = -val - 1;
-				dst[j][2] = qmin;
-				dst[j][3] = qmin;
-                break;
-            case pattern_c_2:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = -val - 1;
-				dst[j][3] = qmin;
-                break;
-            case pattern_c_3:
-                dst[j][0] = val;
-				dst[j][1] = qmin;
-				dst[j][2] = qmin;
-				dst[j][3] = -val - 1;
-                break;
-            default:
-                return 0;
-            }
-            st = 0;
-            break;
-		}
-        if (st == 0)
-            ++j;
-	}
-	return j;
-}
-
-static
-rc_t CC qual4_decode_func(
-                       void *Self,
-                       const VXformInfo *info,
-                       VBlobResult *dst,
-                       const VBlobData *src,
-                       VBlobHeader *hdr
-) {
-    size_t rcount;
-    int qmin = -40;
-    int qmax = 40;
-    
-    if (hdr) {
-        rc_t rc;
-        uint8_t val;
-        
-        rc = VBlobHeaderOpPopHead(hdr, &val);
-        if (rc == 0) {
-            qmin = val - 40;
-            rc = VBlobHeaderOpPopHead(hdr, &val);
-            if (rc == 0) {
-                qmax = val - 40;
-            }
-        }
-    }
-    
-    rcount = qual4_decode( dst->data, dst->elem_count,
-                           src->data, 
-						   ( ( (size_t)src->elem_count * src->elem_bits + 7 ) >> 3 ),
-                           qmin, qmax );
-    
-    if (rcount == dst->elem_count) {
-        dst->byte_order = vboNone;
-        return 0;
-    }
-    return RC(rcSRA, rcFunction, rcExecuting, rcData, rcInvalid);
-}
-
-/*
- * function NCBI:SRA:swapped_qual4 NCBI:SRA:qual4_decode ( NCBI:SRA:encoded_qual4 in );
- */
-VTRANSFACT_IMPL(NCBI_SRA_qual4_decode, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = qual4_decode_func;
-
-    return 0;
-}
-
-static
-rc_t CC legacy_qual4_decode_func ( void *self, const VXformInfo *info, VLegacyBlobResult *rslt, const KDataBuffer *src )
-{
-    unsigned dbytes = *(uint32_t *)src->base;
-    
-#if __BYTE_ORDER == __BIG_ENDIAN
-    dbytes = bswap_32 (dbytes);
-#endif
-    if ((dbytes & 3) == 0) {
-        rc_t rc;
-        unsigned rcount;
-        
-        rslt->dst->elem_bits = 32;
-        rc = KDataBufferResize(rslt->dst, dbytes >> 2);
-        if (rc)
-            return rc;
-
-        rcount = (unsigned int)qual4_decode( rslt->dst->base, rslt->dst->elem_count,
-                               ( ( const uint8_t * )src->base ) + 4, 
-							   (unsigned int)( KDataBufferBytes( src ) - 4 ),
-                               -40, 40);
-        if (rcount == rslt->dst->elem_count) {
-            rslt->byte_order = vboNone;
-            return 0;
-        }
-    }
-    return RC(rcSRA, rcFunction, rcExecuting, rcData, rcInvalid);
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_qual4_decompress_v1, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VNoHdrBlobFunc f = legacy_qual4_decode_func;
-    rslt->variant = vftLegacyBlob;
-    rslt->u.bf = ( VBlobFunc ) f;
-
-    return 0;
-}
-
-#if TESTING
-int test_decode(const uint8_t src[], unsigned ssize, int8_t Y[], unsigned N) {
-    size_t n = qual4_decode(Y, N / 4, src, ssize, -40, 40);
-    
-    return 0;
-}
-#endif
diff --git a/libs/sraxf/qual4_encode.c b/libs/sraxf/qual4_encode.c
deleted file mode 100644
index 14fa16a..0000000
--- a/libs/sraxf/qual4_encode.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include "qual4_codec.h"
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#include <assert.h>
-
-static size_t qual4_encode(
-						   uint8_t *Dst,
-                           size_t dsize,
-						   const qual4 src [],
-						   size_t count,
-                           int8_t qmin,
-                           int8_t qmax
-                           )
-{
-	static const qual4 all_bad = { -5, -5, -5, -5 };
-	uint8_t *dst = Dst;
-    const uint8_t * const dend = & ( ( uint8_t* ) Dst ) [ dsize ];
-	int i;
-	qual4 
-        pat_a_1, pat_a_2, pat_a_3,
-        pat_b_1, pat_b_2, pat_b_3,
-        pat_c_1, pat_c_2, pat_c_3;
-    qual4 is_good;
-
-    is_good[0] = qmax;
-    is_good[1] = is_good[2] = is_good[3] = qmin;
-	
-	pat_a_1[2] = pat_a_1[3] = pat_a_2[1] = pat_a_2[3] = pat_a_3[1] = pat_a_3[2] = qmin;
-	pat_b_1[2] = pat_b_1[3] = pat_b_2[1] = pat_b_2[3] = pat_b_3[1] = pat_b_3[2] = qmin;
-	pat_c_1[2] = pat_c_1[3] = pat_c_2[1] = pat_c_2[3] = pat_c_3[1] = pat_c_3[2] = qmin;
-	
-	for (i = 0; i != count; ++i) {
-		qual4 in_val;
-		qual4 out_val;
-		int codes;
-		
-        memcpy(in_val, src + i, 4);
-		if (in_val[0] > qmax || in_val[0] < qmin ||
-            in_val[1] > qmax || in_val[1] < qmin ||
-            in_val[2] > qmax || in_val[2] < qmin ||
-            in_val[3] > qmax || in_val[3] < qmin)
-        {
-			if (in_val[0] + 40 < 0 || in_val[0] + 40 >= cb_last)
-				goto IS_BAD;
-			else
-				goto QUOTE_IT;
-		}
-		
-		do {
-			if (*(uint32_t *)in_val == *(uint32_t *)all_bad) {
-			IS_BAD:
-				codes = 1;
-				out_val[0] = known_bad;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)is_good) {
-				codes = 1;
-				out_val[0] = known_good;
-				break;
-			}
-			
-			codes = 2;
-			out_val[1] = in_val[0] + 40;
-			
-			pat_a_3[3] = pat_a_2[2] = pat_a_1[1] = -(pat_a_1[0] = pat_a_2[0] = pat_a_3[0] = in_val[0]);
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_a_1) {
-				out_val[0] = pattern_a_1;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_a_2) {
-				out_val[0] = pattern_a_2;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_a_3) {
-				out_val[0] = pattern_a_3;
-				break;
-			}
-			
-			pat_b_3[3] = pat_b_2[2] = pat_b_1[1] = -(pat_b_1[0] = pat_b_2[0] = pat_b_3[0] = in_val[0]) + 1;
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_b_1) {
-				out_val[0] = pattern_b_1;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_b_2) {
-				out_val[0] = pattern_b_2;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_b_3) {
-				out_val[0] = pattern_b_3;
-				break;
-			}
-			
-			pat_c_3[3] = pat_c_2[2] = pat_c_1[1] = -(pat_c_1[0] = pat_c_2[0] = pat_c_3[0] = in_val[0]) - 1;
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_c_1) {
-				out_val[0] = pattern_c_1;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_c_2) {
-				out_val[0] = pattern_c_2;
-				break;
-			}
-			if (*(uint32_t *)in_val == *(uint32_t *)pat_c_3) {
-				out_val[0] = pattern_c_3;
-				break;
-			}
-		QUOTE_IT:
-			codes = 4;
-			out_val[0] = in_val[0] + 40;
-			out_val[1] = in_val[1] + 40;
-			out_val[2] = in_val[2] + 40;
-			out_val[3] = in_val[3] + 40;
-		} while (0);
-        
-        if (dst + codes > dend)
-            return dst + codes - Dst;
-        
-        memcpy(dst, out_val, codes);
-		dst += codes;
-	}
-	return dst - Dst;
-}
-
-static
-rc_t CC qual4_encode_func(
-                       void *Self,
-                       const VXformInfo *info,
-                       VBlobResult *dst,
-                       const VBlobData *Src,
-                       VBlobHeader *hdr
-) {
-    size_t n;
-    unsigned i;
-    const int8_t *src = Src->data;
-    int qmin = src[0];
-    int qmax = src[0];
-    rc_t rc;
-    
-    n = ((size_t)Src->elem_count * Src->elem_bits + 7) >> 3;
-    for (i = 1; i < n; ++i) {
-        int val = src[i];
-        
-        if (val < -40 || val > 40)
-            continue;
-        
-        if (qmax < val)
-            qmax = val;
-        if (qmin > val)
-            qmin = val;
-    }
-    if (qmax > 40)
-        qmax = 40;
-    if (qmin < -40)
-        qmin = -40;
-    
-    rc = VBlobHeaderOpPushTail(hdr, qmin + 40);
-    if (rc == 0) {
-        rc = VBlobHeaderOpPushTail(hdr, qmax + 40);
-        if (rc == 0) {
-            n = qual4_encode(dst->data, (dst->elem_count * dst->elem_bits + 7) >> 3,
-                             (const qual4 *)src, 
-                             n / 4,
-                             qmin, qmax );
-            
-            if (n > (dst->elem_count * dst->elem_bits + 7) >> 3)
-                return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-
-            dst->elem_count = n * 8 / dst->elem_bits;
-            dst->byte_order = vboNone;
-            
-            return 0;
-        }
-    }
-    return rc;
-}
-
-/*
- * function NCBI:SRA:encoded_qual4 NCBI:SRA:qual4_encode #1 ( NCBI:SRA:swapped_qual4 in )
- */
-VTRANSFACT_IMPL(NCBI_SRA_qual4_encode, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = qual4_encode_func;
-
-    return 0;
-}
-
-#if TESTING
-int test_encode(const int8_t Y[], unsigned N, uint8_t dst[], unsigned dsize) {
-    size_t n = qual4_encode(dst, dsize, Y, N / 4, -40, 40);
-
-    return n <= N ? n : 0;
-}
-#endif
diff --git a/libs/sraxf/read-desc.c b/libs/sraxf/read-desc.c
deleted file mode 100644
index d3ce922..0000000
--- a/libs/sraxf/read-desc.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <string.h>
-
-static
-rc_t CC make_read_desc ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    SRAReadDesc *dst;
-
-    const uint8_t *num_reads              = argv[0].u.data.base;
-    const INSDC_coord_zero *read_start    = argv[1].u.data.base;
-    const INSDC_coord_len *read_len       = argv[2].u.data.base;
-    const INSDC_SRA_xread_type *read_type = argv[3].u.data.base;
-    const INSDC_SRA_read_filter *read_flt = argv[4].u.data.base;
-    const INSDC_dna_text *cs_key          = argv[5].u.data.base;
-    const INSDC_coord_zero *lbl_start     = argv[6].u.data.base;
-    const INSDC_coord_len *lbl_len        = argv[7].u.data.base;
-    const char *label                     = argv[8].u.data.base;
-    uint32_t label_max                    = argv[8].u.data.elem_count;
-
-    num_reads += argv[0].u.data.first_elem; /* valid for argv[0].u.data.elem_count */
-    assert( argv[0].u.data.elem_bits == (sizeof( *num_reads ) * 8 ) );
-
-    read_start += argv[1].u.data.first_elem; /* valid for argv[1].u.data.elem_count */
-    assert( argv[1].u.data.elem_bits == (sizeof( *read_start ) * 8 ) );
-    assert( argv[1].u.data.elem_count >= *num_reads ); /*** some old bug overspecified metadata **/
-
-    read_len += argv[2].u.data.first_elem; /* valid for argv[2].u.data.elem_count */
-    assert( argv[2].u.data.elem_bits == (sizeof( *read_len ) * 8 ) );
-    assert( argv[2].u.data.elem_count >= *num_reads );  /*** some old bug overspecified metadata **/
-
-    read_type += argv[3].u.data.first_elem; /* valid for argv[3].u.data.elem_count */
-    assert( argv[3].u.data.elem_bits == (sizeof( *read_type ) * 8 ) );
-    assert( argv[3].u.data.elem_count >= *num_reads );  /*** some old bug overspecified metadata **/
-
-    read_flt += argv[4].u.data.first_elem; /* valid for argv[4].u.data.elem_count */
-    assert( argv[4].u.data.elem_bits == (sizeof( *read_flt ) * 8 ) );
-    assert( argv[4].u.data.elem_count >= *num_reads );
-
-    cs_key += argv[5].u.data.first_elem; /* valid for argv[5].u.data.elem_count */
-    assert( argv[5].u.data.elem_bits == (sizeof( *cs_key ) * 8 ) );
-    assert( argv[5].u.data.elem_count >= *num_reads );
-
-    lbl_start += argv[6].u.data.first_elem; /* valid for argv[6].u.data.elem_count */
-    assert( argv[6].u.data.elem_bits == (sizeof( *lbl_start ) * 8 ) );
-    assert( argv[6].u.data.elem_count >= *num_reads );
-
-    lbl_len += argv[7].u.data.first_elem; /* valid for argv[7].u.data.elem_count */
-    assert( argv[7].u.data.elem_bits == (sizeof( *lbl_len ) * 8 ) );
-    assert( argv[7].u.data.elem_count >= *num_reads );
-
-    label += argv[8].u.data.first_elem; /* valid for argv[8].u.data.elem_count */
-    assert( argv[8].u.data.elem_bits >= (sizeof( *label ) * 8 ) );
-
-    rslt->data->elem_bits = sizeof(*dst) * 8;
-
-    rc = KDataBufferResize( rslt->data, *num_reads );
-    if ( rc == 0 )
-    {
-        uint32_t idx;
-        dst = rslt->data->base;
-        for ( idx = 0; idx < *num_reads; ++idx )
-        {
-            uint32_t label_start = lbl_start [ idx ];
-            uint32_t label_len = lbl_len [ idx ];
-            size_t   label_used;
-            if ( label_start + label_len > label_max )
-            {
-                if ( label_start > label_max )
-                    label_start = label_len = 0;
-                else
-                    label_len = label_max - label_start;
-            }
-
-            dst[idx].seg.start = (uint16_t)read_start[idx];
-            dst[idx].seg.len = (uint16_t)read_len[idx];
-            dst[idx].type = read_type[idx] & SRA_READ_TYPE_BIOLOGICAL;
-            dst[idx].cs_key = cs_key[idx];
-
-            label_used = string_copy( dst[idx].label, sizeof(dst[idx].label), 
-                                      & label [ label_start ], label_len );
-            /* Pad with NULs so that bitcmp sees fully initialized data */
-            memset( dst[idx].label + label_used, '\0',
-                    sizeof(dst[idx].label) - label_used );        
-        }
-
-        rslt->elem_bits = sizeof(*dst) * 8;
-        rslt->elem_count = *num_reads;
-
-    }
-
-    return rc;
-}
-
-/*
- * function NCBI:SRA:ReadDesc NCBI:SRA:make_read_desc #1.0 ( U8 num_reads,
-    INSDC:coord:zero read_start, U32 read_len, INSDC:SRA:read_type read_type,
-    INSDC:SRA:read_filter read_filt, INSDC:dna:text cs_key,
-    INSDC:coord:zero label_start, U32 label_len, ascii label );
-
- */
-VTRANSFACT_IMPL( NCBI_SRA_make_read_desc, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = make_read_desc;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/sraxf/read-seg-from-readn.c b/libs/sraxf/read-seg-from-readn.c
deleted file mode 100644
index 99bdf68..0000000
--- a/libs/sraxf/read-seg-from-readn.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-
-#include "fix_read_seg_impl.h"
-
-/* readn_read_desc
- *  "nreads" [ DATA ] - bases for entire spot
- */
-typedef struct readn_read_desc readn_read_desc;
-struct readn_read_desc
-{
-    uint32_t read_type;
-    uint32_t read_start;
-    uint32_t read_len;
-    uint32_t label_start;
-    uint32_t label_len;
-};
-
-static
-rc_t CC equal_reads_from_spot ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t i, end;
-    readn_read_desc *rdesc;
-    KDataBuffer *dst = rslt -> data;
-
-    const uint8_t *nreads = argv [ 0 ] . u . data . base;
-    const uint32_t *spot_len = argv [ 1 ] . u . data . base;
-    nreads += argv [ 0 ] . u . data . first_elem;
-    spot_len += argv [ 1 ] . u . data . first_elem;
-
-    dst -> elem_bits = sizeof * rdesc * 8;
-    rc = KDataBufferResize ( dst, * nreads );
-    if ( rc != 0 )
-        return rc;
-
-    rdesc = dst -> base;
-
-    assert ( * spot_len > 0 );
-    assert ( * nreads != 0 );
-
-    for ( i = end = 0; i < * nreads; ++ i )
-    {
-        uint32_t rem = * nreads - i;
-        uint32_t len = ( * spot_len - end + rem - 1 ) / rem;
-
-        rdesc [ i ] . read_type = SRA_READ_TYPE_BIOLOGICAL;
-        rdesc [ i ] . read_start = end;
-        rdesc [ i ] . read_len = len;
-        rdesc [ i ] . label_start = 0;
-        rdesc [ i ] . label_len = 0;
-
-        end += len;
-    }
-
-    rslt -> elem_count = * nreads;
-
-    return 0;
-}
-
-static
-rc_t CC read_seg_from_meta ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint8_t nreads;	
-    uint32_t spot_len;
-    const KDataBuffer *self = ( const void* ) data;
-    const readn_read_desc *rd_src = self->base;
-    KDataBuffer *dst = rslt -> data;
-    readn_read_desc *rd_dst;;
-
-    nreads   = ((uint8_t*) argv[0].u.data.base)[argv[0].u.data.first_elem];
-    spot_len = ((uint32_t*)argv[1].u.data.base)[argv[1].u.data.first_elem];
-    assert ( spot_len > 0 );
-    assert ( nreads > 0 );
-
-    rc = KDataBufferResize ( dst, nreads );
-    if(rc != 0)
-        return rc;
-
-    rd_dst = dst->base;
-
-    memcpy(rd_dst,rd_src,nreads*sizeof(*rd_dst));
-
-    /*** if not covered by equal_reads_from_spot() - valid for illumina consisting of bio reads only **/
-    if ( rd_dst[nreads-1].read_start+rd_dst[nreads-1].read_len==0)
-    {
-        int i;
-        rd_dst[0].read_start=0;
-        rd_dst[0].read_len=spot_len;
-        for(i=1;i<nreads;i++)
-        {
-            rd_dst[i].read_start=spot_len;
-            rd_dst[i].read_len=0;
-        }
-    }
-    /*** illumina stop reads before reaching designed cycles ***/
-    else if(rd_dst[nreads-1].read_start+rd_dst[nreads-1].read_len > spot_len)
-    {
-        int i;
-        for(i=0;i<nreads;i++)
-        {
-            if(rd_dst[i].read_start > spot_len)
-            {
-                rd_dst[i].read_start = spot_len;
-                rd_dst[i].read_len = 0;
-            }
-            else if(rd_dst[i].read_start + rd_dst[i].read_len > spot_len)
-            {
-                rd_dst[i].read_len = spot_len - rd_dst[i].read_start;
-            }
-        }
-    }
-    rslt -> elem_count = nreads;
-    return 0;
-}
-
-static
-rc_t parse_read_structure ( uint32_t idx, char *buf_val, readn_read_desc *rdesc )
-{
-    char    *rtype;
-    char    *pos;
-    int     fseqlen=0;
-    char    *ptr;
-    rc_t     rc;
-
-    memset(rdesc,0,sizeof(*rdesc));
-
-    pos = buf_val;
-
-    rtype = strsep( &pos, "|" );
-    if ( pos == NULL )
-    {
-        rc = RC ( rcSRA, rcTable, rcOpening, rcMetadata, rcCorrupt );
-        PLOGERR ( klogErr, ( klogErr, rc, "bad read struct '$(name)' = '$(value)'",
-                             "name=READ_%u,value=%s", idx, buf_val ));
-        return rc;
-    }
-
-    rdesc -> read_len = atoi ( pos );
-    strsep(&pos,"|");
-    if ( pos == NULL )
-    {
-        rc = RC ( rcSRA, rcTable, rcOpening, rcMetadata, rcCorrupt );
-        PLOGERR ( klogErr, ( klogErr, rc, "bad read struct '$(name)' = '$(value)'",
-                             "name=READ_%u,value=%s", idx, buf_val ));
-        return rc;
-    }
-
-    fseqlen = (int)strlen( pos );
-    if(fseqlen > 0)
-    {
-        if(pos[fseqlen-1]=='|') fseqlen--;
-        /* linker sequence is here */
-    }
-
-    switch ( rtype [ 0 ] )
-    {
-    case 'B':
-        rdesc -> read_type = SRA_READ_TYPE_BIOLOGICAL;
-        break;
-    case 'T':
-        rdesc -> read_type = SRA_READ_TYPE_TECHNICAL;
-        break;
-    default:
-        rc = RC ( rcSRA, rcTable, rcOpening, rcMetadata, rcCorrupt );
-        PLOGERR ( klogErr, ( klogErr, rc, "bad read struct '$(name)' = '$(value)'",
-                             "name=READ_%u,value=%s", idx, buf_val ));
-        return rc;
-    }
-    
-    pos=rtype;
-    ptr=strsep(&pos,":");
-    if( pos != NULL )
-    {
-        ptr=strsep(&pos,":");
-        /* label text is in ptr */
-        rdesc -> label_len = (uint32_t)strlen ( ptr );
-    }
-
-    return 0;
-}
-
-static
-void CC whack_data_buffer ( void *data )
-{
-    KDataBufferWhack ( data );
-    free ( data );
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_read_seg_from_readn, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    const KMetadata *meta;
-    rc_t rc = VTableOpenMetadataRead ( info -> tbl, & meta );
-    if ( rc == 0 )
-    {
-        KDataBuffer *fself;
-        readn_read_desc rd [ 16 ];
-        int32_t i, last, tech_read_cnt;
-
-        /* scan all metadata READ_N nodes */
-        for ( last = -1, i = 0; i < sizeof rd / sizeof rd [ 0 ] && rc ==0; ++ i )
-        {
-            const KMDataNode *node;
-
-            /* look for metadata descriptor */
-            rc = KMetadataOpenNodeRead ( meta, & node, "READ_%u", i );
-            if ( rc == 0 )
-            {
-                size_t bytes;
-                char str [ 4096 ];
-                rc = KMDataNodeReadCString ( node, str, sizeof str, & bytes );
-                KMDataNodeRelease ( node );
-                if ( rc == 0 )
-                {
-                    rc = parse_read_structure ( i, str, & rd [ i ] );
-                    if ( rc != 0 )
-                        break;
-                    last = i;
-                }
-            }
-
-        }
-
-        /* ignore all other errors */
-        rc = 0;
-
-        KMetadataRelease ( meta );
-
-        /* initial starts are always at 0 */
-        rd [ 0 ] . read_start = 0;
-        rd [ 0 ] . label_start = 0;
-
-        /* handle case when none-exist */
-        if ( last < 0 )
-        {
-            rslt -> u . ndf = equal_reads_from_spot;
-            rslt -> variant = vftNonDetRow;
-            return 0;
-        }
-
-        /* integrate lengths and count technical reads*/
-        for ( i = tech_read_cnt = 0; i < last; ++ i )
-        {
-            if ( rd [ i ] . read_type == SRA_READ_TYPE_TECHNICAL)
-                ++ tech_read_cnt;
-
-            rd [ i + 1 ] . read_start = rd [ i ] . read_start + rd [ i ] . read_len;
-            rd [ i + 1 ] . label_start = rd [ i ] . label_start + rd [ i ] . label_len;
-        }
-
-        /* temporary for cases where no read length has been given */
-        if ( tech_read_cnt == 0 && rd [ last ] . read_start + rd [ last ] . read_len == 0 )
-        {
-            rslt -> u . ndf = equal_reads_from_spot;
-            rslt -> variant = vftNonDetRow;
-            return 0;
-        }
-
-        /* now produce a static row */
-        fself = malloc ( sizeof * fself );
-        if ( fself == NULL )
-            rc = RC ( rcSRA, rcFunction, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KDataBufferMake ( fself, sizeof rd [ 0 ] * 8, ++ last );
-            if ( rc == 0 )
-            {
-                memcpy ( fself -> base, rd, last * sizeof rd [ 0 ] );
-                rslt -> self = fself;
-                rslt -> whack = whack_data_buffer;
-                rslt -> u . ndf = read_seg_from_meta;
-                rslt -> variant = vftNonDetRow;
-                return 0;
-            }
-
-            free ( fself );
-        }
-    }
-
-    return rc;
-}
-
-
-static
-rc_t CC fix_read_seg ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-
-    const uint16_t *rs_src = argv [ 0 ] . u . data . base;
-    const uint32_t nreads = argv [ 0 ] . u . data . elem_count;
-    const uint32_t *spot_lenp = argv [ 1 ] . u . data . base;
-    const uint32_t spot_len = spot_lenp [ argv [ 1 ] . u . data . first_elem ];
-
-    rs_src += argv [ 0 ] . u . data . first_elem;
-
-    assert ( spot_len > 0 );
-    assert ( nreads > 0);
-    
-    rc = KDataBufferResize ( rslt -> data, nreads );
-    if ( rc == 0 )
-    {
-        uint32_t * rs_dst = rslt -> data -> base;
-        fix_read_seg_impl(rs_src, nreads, spot_len, rs_dst);
-        rslt -> elem_count = nreads;
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_fix_read_seg, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> variant = vftRow;
-    rslt -> u . rf = fix_read_seg;
-    return 0;
-}
diff --git a/libs/sraxf/rewrite-spot-name.c b/libs/sraxf/rewrite-spot-name.c
deleted file mode 100644
index 7a20402..0000000
--- a/libs/sraxf/rewrite-spot-name.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-#define SLX_COORD_LEN 10
-
-static
-int non_braindead_atoi ( const char *start, const char *end )
-{
-    int val = start [ 0 ] - '0';
-    uint32_t i, count = (uint32_t)( end - start );
-    for ( i = 1; i < count; ++ i )
-    {
-        val *= 10;
-        val += start [ i ] - '0';
-    }
-    return val;
-}
-
-static
-int scan_hex ( const char *str, int count )
-{
-    int i, val = str [ 0 ] - '0';
-    if ( val > 9 )
-        val = toupper ( str [ 0 ] ) - 'A' + 10;
-    for ( i = 1; i < count; ++ i )
-    {
-        int d = str [ i ] - '0';
-        if ( d > 9 )
-            d = toupper ( str [ i ] ) - 'A' + 10;
-        val = val << 4 | d;
-    }
-    return val;
-}
-
-static
-rc_t CC illumina_rewrite_spot_name ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    char buffer [ 64];
-    uint32_t coord_len;
-    uint32_t prefix_len;
-    unsigned int a, b, c, d;
-    KDataBuffer *dst = rslt -> data;
-
-    const char *prefix;
-    const char *skey = argv [ 0 ] . u . data . base;
-    uint64_t i, j, count = argv [ 0 ] . u . data . elem_count;
-    
-    skey += argv [ 0 ] . u . data . first_elem;
-
-    /* find last hex portion */
-    for ( i = count; i > 0; )
-    {
-        if ( ! isxdigit ( skey [ -- i ] ) )
-            break;
-    }
-
-    if ( count - i < ( SLX_COORD_LEN - 1 ) )
-    {
-        const char *end = skey + count;
-
-        /* new format */
-        for ( d = 0, j = 0, i = count; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        d = non_braindead_atoi ( & skey [ j ], end );
-        for ( c = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        c = atoi ( & skey [ j ] );
-        for ( b = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        b = atoi ( & skey [ j ] );
-        for ( a = 0, j = 0; i > 0; )
-        {
-            if ( ! isdigit ( skey [ -- i ] ) )
-            {
-                j = i + 1;
-                break;
-            }
-        }
-        a = atoi ( & skey [ j ] );
-        if ( j > 0 )
-        {
-            if ( i > 0 )
-                -- i;
-            while ( isalpha ( skey [ i ] ) )
-                ++ i;
-        }
-    }
-    else
-    {
-        a = scan_hex ( skey, 1 );
-        b = scan_hex ( & skey [ 1 ], 3 );
-        c = scan_hex ( & skey [ 4 ], 3 );
-        d = scan_hex ( & skey [ 7 ], 3 );
-        if ( count > SLX_COORD_LEN )
-        {
-            i = count - SLX_COORD_LEN;
-        }
-    }
-
-    /* generate coordinates */
-    coord_len = sprintf ( buffer, ":%d:%d:%d:%d", a, b, c, d );
-
-    /* get size of prefix */
-    if ( argc == 1 )
-    {
-        prefix = "";
-        prefix_len = 0;
-    }
-    else
-    {
-        prefix = argv [ 1 ] . u . data . base;
-        assert(argv [ 1 ] . u . data . elem_count >> 32 == 0);
-        prefix_len = (uint32_t)argv [ 1 ] . u . data . elem_count;
-        prefix += argv [ 1 ] . u . data . first_elem;
-    }
-
-    /* resize output buffer for prefix, name stuff, coordinates */
-    if ( dst -> elem_bits != 8 )
-    {
-        rc = KDataBufferCast ( dst, dst, 8, true );
-        if ( rc != 0 )
-            return rc;
-    }
-    rc = KDataBufferResize ( dst, prefix_len + i + coord_len + 1 );
-    if ( rc != 0 )
-        return rc;
-
-    /* copy in prefix, name prefix, coordinates */
-    rslt -> elem_count = sprintf ( dst -> base, "%.*s%.*s%s"
-        , ( int ) prefix_len, prefix
-        , ( int ) i, skey
-        , buffer );
-
-    return 0;
-}
-
-/* rewrite_spot_name
- *  given an old spotname directly from skey
- *  write according to platform rules, optionally with a prefix
- *
- *  "platform" [ CONST ] - which platform rules to use
- *
- *  "skey" [ DATA ] - skey string for row
- *
- *  "prefix" [ DATA, OPTIONAL ] - prefix for spot
- */
-VTRANSFACT_IMPL ( NCBI_SRA_rewrite_spot_name, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    const uint8_t *platform = cp -> argv [ 0 ] . data . u8;
-    switch ( platform [ 0 ] )
-    {
-    case SRA_PLATFORM_ILLUMINA:
-        break;
-    default:
-        return RC ( rcSRA, rcFunction, rcConstructing, rcType, rcUnsupported );
-    }
-
-    rslt -> u . ndf = illumina_rewrite_spot_name;
-    rslt -> variant = vftNonDetRow;
-    return 0;
-}
diff --git a/libs/sraxf/rotate.c b/libs/sraxf/rotate.c
deleted file mode 100644
index bf9e0a7..0000000
--- a/libs/sraxf/rotate.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-typedef void (*rotate_f)(void *dst, uint64_t offset, const void *src, const void *Cntrl, uint64_t vec_count);
-typedef struct self_t {
-    rotate_f f;
-} self_t;
-
-#define ROT_0(A, B) A = B
-#define ROT_1(A, B) do { (A).data[0] = (B).data[1]; (A).data[1] = (B).data[2]; (A).data[2] = (B).data[3]; (A).data[3] = (B).data[0]; } while (0)
-#define ROT_2(A, B) do { (A).data[0] = (B).data[2]; (A).data[1] = (B).data[3]; (A).data[2] = (B).data[0]; (A).data[3] = (B).data[1]; } while (0)
-#define ROT_3(A, B) do { (A).data[0] = (B).data[3]; (A).data[1] = (B).data[0]; (A).data[2] = (B).data[1]; (A).data[3] = (B).data[2]; } while (0)
-
-#define UNFUNC(VALTYPE) UNF_ ## VALTYPE
-
-#define UNFUNC_DEF(VALTYPE) \
-static void UNFUNC(VALTYPE)(void *Dst, uint64_t offset, const void *Src, const void *Cntrl, uint64_t count) { \
-    typedef struct { VALTYPE data[4]; } data4_t; \
-    data4_t *dst = (data4_t *)Dst; \
-    const data4_t *src = (const data4_t *)Src; \
-    const uint8_t *cntrl = (const uint8_t *)Cntrl; \
-    uint64_t i; \
-    dst += offset; \
-    for (i = 0; i != count; ++i) { \
-        switch(cntrl[i]) { \
-        default: \
-        case 0: \
-            ROT_0(dst[i], src[i]); \
-            break; \
-        case 1: \
-            ROT_3(dst[i], src[i]); \
-            break; \
-        case 2: \
-            ROT_2(dst[i], src[i]); \
-            break; \
-        case 3: \
-            ROT_1(dst[i], src[i]); \
-            break; \
-        }\
-    } \
-}
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, uint64_t offset, const void *Src, const void *Cntrl, uint64_t count) { \
-    typedef struct { VALTYPE data[4]; } data4_t; \
-    data4_t *dst = (data4_t *)Dst; \
-    const data4_t *src = (const data4_t *)Src; \
-    const uint8_t *cntrl = (const uint8_t *)Cntrl; \
-    uint64_t i; \
-    dst += offset; \
-    for (i = 0; i != count; ++i) { \
-        switch(cntrl[i]) { \
-        default: \
-        case 0: \
-            ROT_0(dst[i], src[i]); \
-            break; \
-        case 1: \
-            ROT_1(dst[i], src[i]); \
-            break; \
-        case 2: \
-            ROT_2(dst[i], src[i]); \
-            break; \
-        case 3: \
-            ROT_3(dst[i], src[i]); \
-            break; \
-        }\
-    } \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-UNFUNC_DEF(float)
-UNFUNC_DEF(double)
-UNFUNC_DEF(uint8_t)
-UNFUNC_DEF(uint16_t)
-UNFUNC_DEF(uint32_t)
-UNFUNC_DEF(uint64_t)
-UNFUNC_DEF(int8_t)
-UNFUNC_DEF(int16_t)
-UNFUNC_DEF(int32_t)
-UNFUNC_DEF(int64_t)
-
-static
-rc_t CC rotate_drvr (
-                     void *Self,
-                     const VXformInfo *info,
-                     int64_t row_id,
-                     const VFixedRowResult *rslt,
-                     uint32_t argc,
-                     const VRowData argv []
-                     )
-{
-    const void *src;
-    const void *cntrl;
-    const self_t *self = (const self_t *)Self;
-    
-    assert(argv[0].u.data.elem_bits % 8 == 0);
-    assert(argv[1].u.data.elem_bits % 8 == 0);
-    
-    src   = &((const uint8_t *)argv[0].u.data.base)[(argv[0].u.data.first_elem * argv[0].u.data.elem_bits) / 8];
-    cntrl = &((const uint8_t *)argv[1].u.data.base)[(argv[1].u.data.first_elem * argv[1].u.data.elem_bits) / 8];
-    
-    self->f(rslt->base, rslt->first_elem, src, cntrl, rslt->elem_count);
-    
-    return 0;
-}
-
-static
-void CC sraxf_rotate_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- * function < type T > T [ 4 ] NCBI:SRA:rotate #1 < bool encode > ( T [ 4 ] in, U8 called );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_rotate, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self;
-    bool encode;
-    
-    assert(cp->argc == 1);
-    assert(cp->argv[0].desc.domain == vtdBool);
-    assert(cp->argv[0].count == 1);
-    encode = cp->argv[0].data.b[0];
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-        break;
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = encode ? FUNC(int8_t) : UNFUNC(int8_t);
-                break;
-            case 16:
-                self->f = encode ? FUNC(int16_t) : UNFUNC(int16_t);
-                break;
-            case 32:
-                self->f = encode ? FUNC(int32_t) : UNFUNC(int32_t);
-                break;
-            case 64:
-                self->f = encode ? FUNC(int64_t) : UNFUNC(int64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = encode ? FUNC(uint8_t) : UNFUNC(uint8_t);
-                break;
-            case 16:
-                self->f = encode ? FUNC(uint16_t) : UNFUNC(uint16_t);
-                break;
-            case 32:
-                self->f = encode ? FUNC(uint32_t) : UNFUNC(uint32_t);
-                break;
-            case 64:
-                self->f = encode ? FUNC(uint64_t) : UNFUNC(uint64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                self->f = encode ? FUNC(float) : UNFUNC(float);
-                break;
-            case 64:
-                self->f = encode ? FUNC(double) : UNFUNC(double);
-                break;
-            default:
-                break;
-            }
-            break;
-        default:
-            break;
-        }
-        
-        rslt->self = self;
-        rslt->whack = sraxf_rotate_free_wrapper;
-        rslt->u.pf = rotate_drvr;
-        rslt->variant = vftFixedRow;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/sraxf/spot-desc.c b/libs/sraxf/spot-desc.c
deleted file mode 100644
index 9a98fd0..0000000
--- a/libs/sraxf/spot-desc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <assert.h>
-
-static
-rc_t CC make_spot_desc ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const uint32_t *spot_len   = argv[0].u.data.base;
-    const uint32_t *fixed_len  = argv[1].u.data.base;
-    const uint32_t *sig_len    = argv[2].u.data.base;
-    const int32_t *trim_start  = argv[3].u.data.base;
-    const uint32_t *trim_len   = argv[4].u.data.base;
-    const uint8_t *num_reads   = argv[5].u.data.base;
-
-    SRASpotDesc *dst;
-
-    num_reads += argv[5].u.data.first_elem; /* valid for argv[0].u.data.elem_count */
-    assert( argv[5].u.data.elem_bits == (sizeof( *num_reads ) * 8 ) );
-
-    spot_len += argv[0].u.data.first_elem;
-    assert( argv[0].u.data.elem_bits == (sizeof( *spot_len ) * 8 ) );
-
-    fixed_len += argv[1].u.data.first_elem;
-    assert( argv[1].u.data.elem_bits == (sizeof( *fixed_len ) * 8 ) );
-
-    sig_len += argv[2].u.data.first_elem;
-    assert( argv[2].u.data.elem_bits == (sizeof( *sig_len ) * 8 ) );
-
-    trim_start += argv[3].u.data.first_elem;
-    assert( argv[3].u.data.elem_bits == (sizeof( *trim_start ) * 8 ) );
-
-    trim_len += argv[4].u.data.first_elem;
-    assert( argv[4].u.data.elem_bits == (sizeof( *trim_len ) * 8 ) );
-
-    rslt->data->elem_bits = sizeof(*dst) * 8;
-
-    rc = KDataBufferResize( rslt->data, 1 );
-    if ( rc == 0 )
-    {
-        dst = rslt->data->base;
-        dst->spot_len = (uint16_t)spot_len[0];
-        dst->fixed_len = (uint16_t)fixed_len[0];
-        dst->signal_len = (uint16_t)sig_len[0];
-        dst->clip_qual_right = (uint16_t)( trim_start[0]+trim_len[0] );
-        dst->num_reads = num_reads[0];
-
-        memset( dst->align, 0, sizeof( dst->align ) );
-        
-        rslt->elem_bits = sizeof(*dst) * 8;
-        rslt->elem_count = 1;
-    }
-
-    return rc;
-}
-
-/*
-  function NCBI:SRA:SpotDesc NCBI:SRA:make_spot_desc
-       ( U32 spot_len, U32 fixed_len,  U32 sig_len,
-        INSDC:coord:zero trim_start, U32 trim_len, U8 num_reads )
-
- */
-VTRANSFACT_IMPL( NCBI_SRA_make_spot_desc, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = make_spot_desc;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/sraxf/stats.c b/libs/sraxf/stats.c
deleted file mode 100644
index 0b53093..0000000
--- a/libs/sraxf/stats.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <os-native.h> /* strncasecmp */
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef struct sra_meta_stats_node_group_struct
-{
-    KMDataNode* node_spot_count;
-    KMDataNode* node_base_count;
-    KMDataNode* node_bio_base_count;
-    KMDataNode* node_cmp_base_count;
-    KMDataNode* node_spot_min;
-    KMDataNode* node_spot_max;
-} sra_meta_stats_node_group;
-
-typedef struct sra_meta_stats_data_struct
-{
-    KMetadata *meta;
-    bool compressed;
-    sra_meta_stats_node_group table;
-    sra_meta_stats_node_group dflt_grp;
-    char* last_grp_name;
-    uint64_t last_grp_name_len; /* strlen */
-    uint64_t last_grp_name_sz; /* buffer size */
-    sra_meta_stats_node_group last_grp;
-    uint32_t grp_qty;
-} sra_meta_stats_data;
-
-static
-rc_t sra_meta_stats_node_read(KMDataNode* node, void* value)
-{
-    rc_t rc = KMDataNodeReadAsU64(node, value);
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) == rcIncomplete && GetRCObject ( rc ) == rcTransfer )
-        {
-            * ( uint64_t* ) value = 0;
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t sra_meta_stats_node_group_update(sra_meta_stats_node_group* g,
-    const int64_t spot_id, const uint32_t spot_len,
-    const uint32_t bio_spot_len, const uint32_t cmp_spot_len)
-{
-    rc_t rc = 0;
-    uint64_t u64;
-    int64_t i64;
-
-    if( (rc = sra_meta_stats_node_read(g->node_spot_count, &u64)) == 0 ) {
-        if( u64 + 1 < u64 ) {
-            rc = RC(rcVDB, rcFunction, rcUpdating, rcMetadata, rcOutofrange);
-        } else {
-            if( spot_id != 0 ) {
-                ++u64;
-            }
-            rc = KMDataNodeWriteB64(g->node_spot_count, &u64);
-        }
-    }
-    if( (rc = sra_meta_stats_node_read(g->node_base_count, &u64)) == 0 ) {
-        if( u64 + 1 < u64 ) {
-            rc = RC(rcVDB, rcFunction, rcUpdating, rcMetadata, rcOutofrange);
-        } else {
-            u64 += spot_len;
-            rc = KMDataNodeWriteB64(g->node_base_count, &u64);
-        }
-    }
-    if( (rc = sra_meta_stats_node_read(g->node_bio_base_count, &u64)) == 0 ) {
-        if( u64 + bio_spot_len < u64 ) {
-            rc = RC(rcVDB, rcFunction, rcUpdating, rcMetadata, rcOutofrange);
-        } else {
-            u64 += bio_spot_len;
-            rc = KMDataNodeWriteB64(g->node_bio_base_count, &u64);
-        }
-    }
-    if( g->node_cmp_base_count != NULL ) {
-        if( (rc = sra_meta_stats_node_read(g->node_cmp_base_count, &u64)) == 0 ) {
-            if( u64 + cmp_spot_len < u64 ) {
-                rc = RC(rcVDB, rcFunction, rcUpdating, rcMetadata, rcOutofrange);
-            } else {
-                u64 += cmp_spot_len;
-                rc = KMDataNodeWriteB64(g->node_cmp_base_count, &u64);
-            }
-        }
-    }
-    if( (rc = sra_meta_stats_node_read(g->node_spot_max, &i64)) == 0 ) {
-        if( i64 == 0 || i64 < spot_id ) {
-            i64 = spot_id;
-            rc = KMDataNodeWriteB64(g->node_spot_max, &i64);
-        }
-    }
-    if( (rc = sra_meta_stats_node_read(g->node_spot_min, &i64)) == 0 ) {
-        if( i64 == 0 || i64 > spot_id ) {
-            i64 = spot_id;
-            rc = KMDataNodeWriteB64(g->node_spot_min, &i64);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t sra_meta_stats_node_group_open(KMDataNode* parent, sra_meta_stats_node_group* g, bool compressed)
-{
-    rc_t rc = 0;
-    assert(parent && g);
-
-    if( (rc = KMDataNodeOpenNodeUpdate(parent, &g->node_spot_count, "SPOT_COUNT")) == 0 &&
-        (rc = KMDataNodeOpenNodeUpdate(parent, &g->node_base_count, "BASE_COUNT")) == 0 &&
-        (rc = KMDataNodeOpenNodeUpdate(parent, &g->node_bio_base_count, "BIO_BASE_COUNT")) == 0 &&
-        (rc = KMDataNodeOpenNodeUpdate(parent, &g->node_spot_min, "SPOT_MIN")) == 0 &&
-        (rc = KMDataNodeOpenNodeUpdate(parent, &g->node_spot_max, "SPOT_MAX")) == 0 ) {
-        if( compressed ) { 
-            rc = KMDataNodeOpenNodeUpdate(parent, &g->node_cmp_base_count, "CMP_BASE_COUNT");
-        }
-    }
-    return rc;
-}
-
-static
-void sra_meta_stats_node_group_release(sra_meta_stats_node_group* g)
-{
-    if ( g != NULL )
-    {
-        KMDataNodeRelease(g->node_spot_count);
-        KMDataNodeRelease(g->node_base_count);
-        KMDataNodeRelease(g->node_bio_base_count);
-        KMDataNodeRelease(g->node_cmp_base_count);
-        KMDataNodeRelease(g->node_spot_min);
-        KMDataNodeRelease(g->node_spot_max);
-        memset ( g, 0, sizeof * g );
-    }
-}
-
-static
-void CC sra_meta_stats_whack( void *data )
-{
-    sra_meta_stats_data *self = data;
-    sra_meta_stats_node_group_release(&self->table);
-    sra_meta_stats_node_group_release(&self->dflt_grp);
-    free(self->last_grp_name);
-    sra_meta_stats_node_group_release(&self->last_grp);
-    KMetadataRelease(self->meta);
-    free(self);
-}
-
-static
-rc_t sra_meta_stats_make(sra_meta_stats_data** self, VTable* vtbl, bool has_spot_group, bool compressed)
-{
-    rc_t rc = 0;
-    sra_meta_stats_data* data = calloc(1, sizeof(*data));
-
-    assert(self != NULL && vtbl != NULL);
-
-    if( data == NULL ) {
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = VTableOpenMetadataUpdate(vtbl, &data->meta)) == 0 ) {
-        KMDataNode* node;
-        data->compressed = compressed;
-        if( (rc = KMetadataOpenNodeUpdate(data->meta, &node, "STATS/TABLE")) == 0 ) {
-            rc = sra_meta_stats_node_group_open(node, &data->table, compressed);
-            KMDataNodeRelease(node);
-        }
-        if( rc == 0 && has_spot_group ) {
-            if( (rc = KMetadataOpenNodeUpdate(data->meta, &node, "STATS/SPOT_GROUP/default")) == 0 ) {
-                rc = sra_meta_stats_node_group_open(node, &data->dflt_grp, compressed);
-                KMDataNodeRelease(node);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        *self = data;
-    } else {
-        sra_meta_stats_whack(data);
-    }
-    return rc;
-}
-
-static
-rc_t CC sra_meta_stats_update(sra_meta_stats_data* self,
-    const int64_t spot_id, const uint32_t spot_len,
-    const uint32_t bio_spot_len, const uint32_t cmp_spot_len,
-    bool has_grp, const char* grp, uint64_t grp_len)
-{
-    rc_t rc = 0;
-    const uint32_t max_grp_qty = 10000;
-
-    assert(self != NULL);
-
-    rc = sra_meta_stats_node_group_update(&self->table, spot_id, spot_len, bio_spot_len, cmp_spot_len);
-    if( has_grp && self->grp_qty <= max_grp_qty && rc == 0 )
-    {
-        /* an empty group is considered default */
-        if( grp_len == 0 || grp == NULL || grp[0] == '\0' ||
-            (grp_len == 7 && strncasecmp("default", grp, grp_len) == 0 ) )
-        {
-            rc = sra_meta_stats_node_group_update(&self->dflt_grp, spot_id, spot_len, bio_spot_len, cmp_spot_len);
-        }
-        else
-        {
-            size_t i;
-            KMDataNode* n;
-            const KMDataNode *cn;
-            bool new_group, unsafe;
-
-            /* look for cached node */
-            if ( self->last_grp_name != NULL &&
-                 self->last_grp_name_len == grp_len &&
-                 strncmp(self->last_grp_name, grp, grp_len) == 0 )
-            {
-                return sra_meta_stats_node_group_update(&self->last_grp, spot_id, spot_len, bio_spot_len, cmp_spot_len);
-            }
-
-            /* release cached group */
-            sra_meta_stats_node_group_release(&self->last_grp);
-
-            /* realloc cached name */
-            if ( self->last_grp_name == NULL || grp_len >= self->last_grp_name_sz )
-            {
-                char *p = realloc ( self -> last_grp_name, grp_len + 1 );
-                if ( p == NULL )
-                    return RC ( rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted );
-    
-                self -> last_grp_name = p;
-                self -> last_grp_name_sz = grp_len + 1;
-            }
-
-            /* sanitize name */
-            for ( unsafe = false, i = 0; i < grp_len; ++ i )
-            {
-                if ( ( self -> last_grp_name [ i ] = grp [ i ] ) == '/' )
-                {
-                    unsafe = true;
-                    self -> last_grp_name [ i ] = '\\';
-                }
-            }
-            self -> last_grp_name_len = i;
-            self -> last_grp_name [ i ] = 0;
-
-            /* look for new group */
-            new_group = true;
-            rc = KMetadataOpenNodeRead(self->meta, &cn, "STATS/SPOT_GROUP/%s", self->last_grp_name );
-            if ( rc == 0 )
-            {
-                new_group = false;
-                KMDataNodeRelease ( cn );
-            }
-
-            /* detect abusive quantity of nodes */
-            if ( new_group && ++self->grp_qty > max_grp_qty )
-            {
-                rc = KMetadataOpenNodeUpdate(self->meta, &n, "STATS");
-                if( rc == 0 )
-                {
-                    sra_meta_stats_node_group_release(&self->dflt_grp);
-                    KMDataNodeDropChild(n, "SPOT_GROUP");
-                    KMDataNodeRelease(n);
-                    free(self->last_grp_name);
-                    self->last_grp_name = NULL;
-                }
-                return rc;
-            }
-
-            /* create new or cache existing group */
-            rc = KMetadataOpenNodeUpdate(self->meta, &n, "STATS/SPOT_GROUP/%s", self->last_grp_name );
-            if ( rc == 0 )
-            {
-                rc = sra_meta_stats_node_group_open(n, &self->last_grp, self->compressed);
-                if (rc == 0 && new_group) {
-                    if (unsafe)
-                    {
-                        char value [ 512 ], *v = value;
-                        if ( grp_len >= sizeof value )
-                            v = malloc ( grp_len + 1 );
-                        if ( v == NULL )
-                            rc = RC ( rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted );
-                        else
-                        {
-                            rc = string_printf ( v, grp_len + 1, NULL, "%.*s", ( uint32_t ) grp_len, grp );
-                            assert ( rc == 0 );
-                            rc = KMDataNodeWriteAttr(n, "name", v);
-                            if ( rc == 0 )
-                                memcpy ( self->last_grp_name, grp, grp_len );
-                            if ( v != value )
-                                free ( v );
-                        }
-                    }
-                    if ( rc == 0 )
-                        rc = sra_meta_stats_node_group_update(&self->last_grp, 0, 0, 0, 0);
-                }
-                KMDataNodeRelease(n);
-
-                if( rc == 0 )
-                    rc = sra_meta_stats_node_group_update(&self->last_grp, spot_id, spot_len, bio_spot_len, cmp_spot_len);
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC sra_meta_stats_trigger(void *data, const VXformInfo *info, int64_t row_id,
-                               VRowResult *rslt, uint32_t argc, const VRowData argv[])
-{
-    uint32_t i, bio_spot_len;
-    const char* grp = NULL;
-    uint64_t len = 0;
-
-    uint32_t spot_len = argv[0].u.data.elem_count;
-    /* take nreads from read_len */
-    uint32_t nreads = argv[1].u.data.elem_count;
-    /* get read_len and read_type */
-    const INSDC_coord_len *read_len = argv[1].u.data.base;
-    const INSDC_SRA_xread_type *read_type = argv[2].u.data.base;
-    read_len += argv[1].u.data.first_elem;
-    read_type += argv[2].u.data.first_elem;
-
-    assert(argc >= 3 && argc <= 4);
-    assert(nreads == argv[2].u.data.elem_count);
-
-    for(i = bio_spot_len = 0; i < nreads; i++) {
-        if( (read_type[i] & SRA_READ_TYPE_BIOLOGICAL) != 0 ) {
-            bio_spot_len += read_len[i];
-        }
-    }
-    if( argc == 4 ) {
-        /* get group name and length */
-        grp = argv[3].u.data.base;
-        len = argv[3].u.data.elem_count;
-        grp += argv[3].u.data.first_elem;
-    }
-    return sra_meta_stats_update(data, row_id, spot_len, bio_spot_len, 0, argc == 4, grp, len);
-}
-
-static
-rc_t CC sra_meta_stats_cmp_trigger(void *data, const VXformInfo *info, int64_t row_id,
-                                   VRowResult *rslt, uint32_t argc, const VRowData argv[])
-{
-    uint32_t i, bio_spot_len;
-    const char* grp = NULL;
-    uint64_t len = 0;
-
-    uint32_t cmp_spot_len = argv[0].u.data.elem_count;
-    uint32_t spot_len = argv[1].u.data.elem_count;
-    /* take nreads from read_len */
-    uint32_t nreads = argv[2].u.data.elem_count;
-    /* get read_len and read_type */
-    const INSDC_coord_len *read_len = argv[2].u.data.base;
-    const INSDC_SRA_xread_type *read_type = argv[3].u.data.base;
-    read_len += argv[2].u.data.first_elem;
-    read_type += argv[3].u.data.first_elem;
-
-    assert(data != NULL);
-    assert(argc >= 4 && argc <= 5);
-    assert(nreads == argv[3].u.data.elem_count);
-
-    for(i = bio_spot_len = 0; i < nreads; i++) {
-        if( (read_type[i] & SRA_READ_TYPE_BIOLOGICAL) != 0 ) {
-            bio_spot_len += read_len[i];
-        }
-    }
-    if( argc == 5 ) {
-        /* get group name and length */
-        grp = argv[4].u.data.base;
-        len = argv[4].u.data.elem_count;
-        grp += argv[4].u.data.first_elem;
-    }
-    return sra_meta_stats_update(data, row_id, spot_len, bio_spot_len, cmp_spot_len, argc == 5, grp, len);
-}
-
-static
-rc_t CC sra_meta_stats_cmpf_trigger(void *data, const VXformInfo *info, int64_t row_id,
-                                   VRowResult *rslt, uint32_t argc, const VRowData argv[])
-{
-    uint32_t i, bio_spot_len;
-    const char* grp = NULL;
-    uint64_t len = 0;
-
-    uint32_t cmp_spot_len = argv[0].u.data.elem_count;
-    const uint32_t* spot_len = argv[1].u.data.base;
-    /* take nreads from read_len */
-    uint32_t nreads = argv[2].u.data.elem_count;
-    /* get read_len and read_type */
-    const INSDC_coord_len *read_len = argv[2].u.data.base;
-    const INSDC_SRA_xread_type *read_type = argv[3].u.data.base;
-    spot_len += argv[1].u.data.first_elem;
-    read_len += argv[2].u.data.first_elem;
-    read_type += argv[3].u.data.first_elem;
-
-    assert(data != NULL);
-    assert(argc >= 4 && argc <= 5);
-    assert(nreads == argv[3].u.data.elem_count);
-
-    for(i = bio_spot_len = 0; i < nreads; i++) {
-        if( (read_type[i] & SRA_READ_TYPE_BIOLOGICAL) != 0 ) {
-            bio_spot_len += read_len[i];
-        }
-    }
-    if( argc == 5 ) {
-        /* get group name and length */
-        grp = argv[4].u.data.base;
-        len = argv[4].u.data.elem_count;
-        grp += argv[4].u.data.first_elem;
-    }
-    return sra_meta_stats_update(data, row_id, *spot_len, bio_spot_len, cmp_spot_len, argc == 5, grp, len);
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_stats_trigger, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    sra_meta_stats_data *data;
-
-    assert(dp->argc >= 3 && dp->argc <= 4);
-
-    if( (rc = sra_meta_stats_make(&data, (VTable*)info->tbl, dp->argc > 3, false)) == 0 ) {
-        rslt->self = data;
-        rslt->whack = sra_meta_stats_whack;
-        rslt->variant = vftNonDetRow;
-        rslt->u.rf = sra_meta_stats_trigger;
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_cmp_stats_trigger, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    sra_meta_stats_data *data;
-
-    assert(dp->argc >= 4 && dp->argc <= 5);
-
-    if( (rc = sra_meta_stats_make(&data, (VTable*)info->tbl, dp->argc > 4, true)) == 0 ) {
-        rslt->self = data;
-        rslt->whack = sra_meta_stats_whack;
-        rslt->variant = vftNonDetRow;
-        rslt->u.rf = sra_meta_stats_cmp_trigger;
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_cmpf_stats_trigger, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    sra_meta_stats_data *data;
-
-    assert(dp->argc >= 4 && dp->argc <= 5);
-
-    if( (rc = sra_meta_stats_make(&data, (VTable*)info->tbl, dp->argc > 4, true)) == 0 ) {
-        rslt->self = data;
-        rslt->whack = sra_meta_stats_whack;
-        rslt->variant = vftNonDetRow;
-        rslt->u.rf = sra_meta_stats_cmpf_trigger;
-    }
-    return rc;
-}
diff --git a/libs/sraxf/stats_quality.c b/libs/sraxf/stats_quality.c
deleted file mode 100644
index ddc42a3..0000000
--- a/libs/sraxf/stats_quality.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#define MAX_QUALITY (256)
-
-typedef struct phred_stats_data_struct {
-    KMetadata* meta;
-    KMDataNode* root;
-    uint64_t count[MAX_QUALITY];
-} phred_stats_data;
-
-static
-void CC phred_stats_whack( void *data )
-{
-    uint32_t i;
-    phred_stats_data* self = data;
-
-    for(i = 0; i < MAX_QUALITY; i++) {
-        if( self->count[i] > 0 ) {
-            KMDataNode* node;
-            if( KMDataNodeOpenNodeUpdate(self->root, &node, "PHRED_%u", i) == 0 ) {
-                KMDataNodeWriteB64(node, &self->count[i]);
-                KMDataNodeRelease(node);
-            }
-        }
-    }
-    KMDataNodeRelease(self->root);
-    KMetadataRelease(self->meta);
-    free(self);
-}
-
-static
-rc_t phred_stats_make(phred_stats_data** self, VTable* vtbl)
-{
-    rc_t rc = 0;
-    phred_stats_data* data = calloc(1, sizeof(*data));
-
-    assert(self != NULL && vtbl != NULL);
-
-    if( data == NULL ) {
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = VTableOpenMetadataUpdate(vtbl, &data->meta)) == 0 ) {
-        rc = KMetadataOpenNodeUpdate(data->meta, &data->root, "STATS/QUALITY");
-    }
-    if( rc == 0 ) {
-        *self = data;
-    } else {
-        phred_stats_whack(data);
-    }
-    return rc;
-}
-
-static
-rc_t CC phred_stats_trigger(void *data, const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt, uint32_t argc, const VRowData argv[])
-{
-    rc_t rc = 0;
-    phred_stats_data* self = data;
-    uint64_t len;
-
-    assert(self != NULL);
-    assert(argc == 1);
-    assert(argv[0].u.data.elem_bits == (sizeof(INSDC_quality_phred) * 8));
-
-    len = argv[0].u.data.elem_count;
-    if( len > 0 ) {
-        const INSDC_quality_phred* q = argv[0].u.data.base;
-        assert(argv[0].u.data.base != NULL);
-        q += argv[0].u.data.first_elem;
-        do {
-            self->count[q[--len]]++;
-        } while( len > 0 );
-    }
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_phred_stats_trigger, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    phred_stats_data *data;
-
-    assert(dp->argc == 1);
-
-    if( (rc = phred_stats_make(&data, (VTable*)info->tbl)) == 0 ) {
-        rslt->self = data;
-        rslt->whack = phred_stats_whack;
-        rslt->variant = vftNonDetRow;
-        rslt->u.rf = phred_stats_trigger;
-    }
-    return rc;
-}
diff --git a/libs/sraxf/swap.c b/libs/sraxf/swap.c
deleted file mode 100644
index 221c195..0000000
--- a/libs/sraxf/swap.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-typedef void (*swap_f)(void *dst, uint64_t offset, const void *src, const void *Cntrl, uint64_t vec_count);
-typedef struct self_t {
-    swap_f f;
-} self_t;
-
-#define SWAP_0(A, B) A = B
-#define SWAP_1(A, B) do { (A).data[0] = (B).data[1]; (A).data[1] = (B).data[0]; (A).data[2] = (B).data[2]; (A).data[3] = (B).data[3]; } while (0)
-#define SWAP_2(A, B) do { (A).data[0] = (B).data[2]; (A).data[1] = (B).data[1]; (A).data[2] = (B).data[0]; (A).data[3] = (B).data[3]; } while (0)
-#define SWAP_3(A, B) do { (A).data[0] = (B).data[3]; (A).data[1] = (B).data[1]; (A).data[2] = (B).data[2]; (A).data[3] = (B).data[0]; } while (0)
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE)                                               \
-    static void FUNC(VALTYPE)(void *Dst, uint64_t offset, const void *Src, const void *Cntrl, uint64_t count) { \
-        typedef struct { VALTYPE data[4]; } data4_t;                    \
-        data4_t *dst = (data4_t *)Dst;                                  \
-        const data4_t *src = (const data4_t *)Src;                      \
-        const uint8_t *cntrl = (const uint8_t *)Cntrl;                  \
-        uint64_t i;                                                     \
-                                                                        \
-        dst += offset;                                                  \
-        for (i = 0; i != count; ++i) {                                  \
-            switch(cntrl[i]) {                                          \
-            default:                                                    \
-            case 0:                                                     \
-                SWAP_0(dst[i], src[i]);                                 \
-                break;                                                  \
-            case 1:                                                     \
-                SWAP_1(dst[i], src[i]);                                 \
-                break;                                                  \
-            case 2:                                                     \
-                SWAP_2(dst[i], src[i]);                                 \
-                break;                                                  \
-            case 3:                                                     \
-                SWAP_3(dst[i], src[i]);                                 \
-                break;                                                  \
-            }                                                           \
-        }                                                               \
-    }
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC swap_drvr (
-                void *Self,
-                const VXformInfo *info,
-                int64_t row_id,
-                const VFixedRowResult *rslt,
-                uint32_t argc,
-                const VRowData argv []
-) {
-    const uint8_t *src;
-    const uint8_t *cntrl;
-    const self_t *self = (const self_t *)Self;
-    
-    assert(argv[0].u.data.elem_bits % 8 == 0);
-    assert(argv[1].u.data.elem_bits % 8 == 0);
-    
-    src    = argv[0].u.data.base;
-    src   += (argv[0].u.data.first_elem * argv[0].u.data.elem_bits) / 8;
-
-    cntrl  = argv[1].u.data.base;
-    cntrl += (argv[1].u.data.first_elem * argv[1].u.data.elem_bits) / 8;
-    
-    self->f(rslt->base, rslt->first_elem, src, cntrl, rslt->elem_count);
-    
-    return 0;
-}
-
-static
-void CC sraxf_swap_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- * function < type T > T [ 4 ] NCBI:SRA:swap #1 ( T [ 4 ] in, U8 called );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_swap, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self;
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-            break;
-        }
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcInvalid);
-        break;
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(int8_t);
-                break;
-            case 16:
-                self->f = FUNC(int16_t);
-                break;
-            case 32:
-                self->f = FUNC(int32_t);
-                break;
-            case 64:
-                self->f = FUNC(int64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                self->f = FUNC(uint8_t);
-                break;
-            case 16:
-                self->f = FUNC(uint16_t);
-                break;
-            case 32:
-                self->f = FUNC(uint32_t);
-                break;
-            case 64:
-                self->f = FUNC(uint64_t);
-                break;
-            default:
-                break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                self->f = FUNC(float);
-                break;
-            case 64:
-                self->f = FUNC(double);
-                break;
-            default:
-                break;
-            }
-            break;
-        default:
-            break;
-        }
-        
-        rslt->self = self;
-        rslt->whack = sraxf_swap_free_wrapper;
-        rslt->u.pf = swap_drvr;
-        rslt->variant = vftFixedRow;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/sraxf/tokenize-spot_name-454.c b/libs/sraxf/tokenize-spot_name-454.c
deleted file mode 100644
index a801272..0000000
--- a/libs/sraxf/tokenize-spot_name-454.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "name-tokenizer.h"
-
-static
-rc_t CC tokenize_spot_name_454 ( void *self, const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *name;
-    unsigned region_start;
-    unsigned q_start;
-    unsigned i;
-    spot_name_token_t *spot_name_tok;
-    const int EXPECTED_NUMBER_OF_TOKENS = 2;
-    
-    assert(rslt->elem_bits == sizeof(spot_name_tok[0]) * 8);
-    rslt->data->elem_bits = sizeof(spot_name_tok[0]) * 8;
-    if( (rc = KDataBufferResize(rslt->data, EXPECTED_NUMBER_OF_TOKENS)) != 0 ) {
-        return rc;
-    }
-    
-    spot_name_tok = rslt->data->base;
-    
-    spot_name_tok[0].s.token_type = nt_unrecognized;
-    spot_name_tok[0].s.position = 0;
-    spot_name_tok[0].s.length = argv[0].u.data.elem_count;
-    rslt->elem_count = 1;
-    
-    /* /^(.{7})([0-9]{2})([A-Z0-9]{5})$/ = (name, region, XY_q) = ($1, $2, $3); */
-    if (argv[0].u.data.elem_count != 14 ) {
-        return 0;
-    }
-    
-    name = &((const char *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    q_start = argv[0].u.data.elem_count - 5;
-    region_start = q_start - 2;
-    
-    /* validate that XY_q =~ /[A-Z0-9]{5}/ */
-    for(i = 0; i != 5; i++) {
-        if(!((name[i + q_start] >= 'A' && name[i + q_start] <= 'Z') || (name[i + q_start] >= '0' && name[i + q_start] <= '9'))) {
-            return 0;
-        }
-    }
-    /* validate that region =~ /[0-9]{2}/ */
-    if( !(name[region_start] >= '0' && name[region_start] <= '9') ||
-        !(name[region_start + 1] >= '0' && name[region_start + 1] <= '9') ) {
-        return 0;
-    }
-    spot_name_tok[0].s.token_type = nt_T;
-    spot_name_tok[0].s.position = region_start;
-    spot_name_tok[0].s.length = 2;
-    
-    spot_name_tok[1].s.token_type = nt_Q;
-    spot_name_tok[1].s.position = q_start;
-    spot_name_tok[1].s.length = 5;
-
-    rslt->elem_count = EXPECTED_NUMBER_OF_TOKENS;
-    return 0;
-}
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
-
-typedef U16 NCBI:SRA:spot_name_token [ 3 ];
-const U16 NCBI:SRA:name_token:unrecognized = 1;
-const U16 NCBI:SRA:name_token:X            = 2;
-const U16 NCBI:SRA:name_token:Y            = 3;
-const U16 NCBI:SRA:name_token:Q            = 4;
-const U16 NCBI:SRA:name_token:T            = 5;
-const U16 NCBI:SRA:name_token:L            = 6;
-
-extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:_454_:tokenize_spot_name #1 ( ascii name );
- */
-VTRANSFACT_IMPL ( NCBI_SRA__454__tokenize_spot_name, 1, 0, 0 ) ( const void *self,
-                  const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = tokenize_spot_name_454;
-    
-    return 0;
-}
diff --git a/libs/sraxf/tokenize-spot_name-abi.c b/libs/sraxf/tokenize-spot_name-abi.c
deleted file mode 100644
index f9b459b..0000000
--- a/libs/sraxf/tokenize-spot_name-abi.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "name-tokenizer.h"
-
-static
-rc_t CC tokenize_spot_name_ABI ( void *self, const VXformInfo *info, int64_t row_id,
-                              VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *name, *end;
-    spot_name_token_t *spot_name_tok;
-    const int EXPECTED_NUMBER_OF_TOKENS = 3;
-    int tok = EXPECTED_NUMBER_OF_TOKENS;
-    const uint16_t types[3] = {nt_T, nt_X, nt_Y};
-    
-    assert(rslt->elem_bits == sizeof(spot_name_tok[0]) * 8);
-    rslt->data->elem_bits = sizeof(spot_name_tok[0]) * 8;
-    if( (rc = KDataBufferResize(rslt->data, EXPECTED_NUMBER_OF_TOKENS)) != 0 ) {
-        return rc;
-    }
-    
-    spot_name_tok = rslt->data->base;
-    
-    /* reverse line parse by format:
-     Dig is -> [-+0-9]
-       /^(.*+)(Dig+)!Dig+(Dig+)!Dig+(Dig+)$/ = (run_name, panel, x, y) = ($1, $2, $3, $4)
-    */
-#define is_signum(a) (isdigit(a) || a == '-' || a == '+')
-
-    name = &((const char *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    end = name + argv[0].u.data.elem_count;
-    while(rc == 0 && end > name && tok > 0) {
-        const char* c, *last_end;
-        do {
-            last_end = end--;
-        } while( tok != EXPECTED_NUMBER_OF_TOKENS && end != name && !is_signum(*end) );
-        while( end != name && is_signum(*end) ) {
-            end--;
-        }
-        c = end;
-        if( !is_signum(*c) ) {
-            c++;
-        }
-        if( c >= last_end ) {
-            /* empty token */
-            break;
-        } else if( *c == '-' ) {
-            /* keep explicit - '-000' */
-            if( last_end - c >= 2 && *(c + 1) == '0' ) {
-                c++;
-                while( *c == '0' && (c + 1) < last_end ) { c++; }
-                if( *c != '0' ) {
-                    /* cannot tokenize -0004 */
-                    break;
-                }
-            }
-        } else {
-            if( *c == '+' ) {
-                /* keep explicit + */
-                c++;
-            }
-            /* keep leading zeroes */
-            while(*c == '0' && (c + 1) < last_end ) { c++; }
-        }
-        tok--;
-        spot_name_tok[tok].s.token_type = types[tok];
-        spot_name_tok[tok].s.position = c - name;
-        spot_name_tok[tok].s.length = last_end - c;
-        if( spot_name_tok[tok].s.length == 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-        }
-        while(rc == 0 && c < last_end) {
-            if( *c < '0' || *c > '9' ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcId, rcOutofrange);
-            }
-            c++;
-        }
-    }
-    if( rc == 0 && tok != 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-    }
-    if( rc != 0 ) {
-        spot_name_tok[0].s.token_type = nt_unrecognized;
-        spot_name_tok[0].s.position = 0;
-        spot_name_tok[0].s.length = argv[0].u.data.elem_count;
-        rslt->elem_count = 1;
-    } else {
-        rslt->elem_count = EXPECTED_NUMBER_OF_TOKENS;
-    }
-    return 0;
-}
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
-
- extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:ABI:tokenize_spot_name #1 ( ascii name );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_ABI_tokenize_spot_name, 1, 0, 0 ) ( const void *self,
-                  const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = tokenize_spot_name_ABI;
-    
-    return 0;
-}
diff --git a/libs/sraxf/tokenize-spot_name-helicos.c b/libs/sraxf/tokenize-spot_name-helicos.c
deleted file mode 100644
index 7c5054d..0000000
--- a/libs/sraxf/tokenize-spot_name-helicos.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "name-tokenizer.h"
-
-static
-rc_t CC tokenize_spot_name_Helicos( void *self, const VXformInfo *info, int64_t row_id,
-                                    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *name, *end;
-    spot_name_token_t *spot_name_tok;
-    const int EXPECTED_NUMBER_OF_TOKENS = 4;
-    int tok = EXPECTED_NUMBER_OF_TOKENS;
-    const uint16_t types[4] = {nt_L, nt_T, nt_X, nt_Y };
-    
-    assert(rslt->elem_bits == sizeof(spot_name_tok[0]) * 8);
-    rslt->data->elem_bits = sizeof(spot_name_tok[0]) * 8;
-    if( (rc = KDataBufferResize(rslt->data, EXPECTED_NUMBER_OF_TOKENS)) != 0 ) {
-        return rc;
-    }
-    
-    spot_name_tok = rslt->data->base;
-    
-    /* reverse line parse by format:
-       /^(.+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)$/ = 
-        (name, channel, field, camera, position) = ($1, $2, $3, $4, $5)
-    */
-    name = &((const char *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    end = name + argv[0].u.data.elem_count;
-
-    while(rc == 0 && end > name && tok > 0 ) {
-        size_t l = 0;
-        while( isdigit(*--end) && end > name ) {
-            l++;
-        }
-        if( *end != '-' || l == 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcUnrecognized);
-        } else {
-            tok--;
-            spot_name_tok[tok].s.token_type = types[tok];
-            spot_name_tok[tok].s.position = end - name + 1;
-            spot_name_tok[tok].s.length = l;
-        }
-    }
-    if( rc == 0 && tok != 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-    }
-    if( rc != 0 ) {
-        spot_name_tok[0].s.token_type = nt_unrecognized;
-        spot_name_tok[0].s.position = 0;
-        spot_name_tok[0].s.length = argv[0].u.data.elem_count;
-        rslt->elem_count = 1;
-    } else {
-        rslt->elem_count = EXPECTED_NUMBER_OF_TOKENS;
-    }
-    return 0;
-}
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
-
- extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:Helicos:tokenize_spot_name #1 ( ascii name );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_Helicos_tokenize_spot_name, 1, 0, 0 ) ( const void *self,
-                  const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = tokenize_spot_name_Helicos;
-    
-    return 0;
-}
diff --git a/libs/sraxf/tokenize-spot_name-illumina.c b/libs/sraxf/tokenize-spot_name-illumina.c
deleted file mode 100644
index c408592..0000000
--- a/libs/sraxf/tokenize-spot_name-illumina.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "name-tokenizer.h"
-
-static
-rc_t CC tokenize_spot_name_Illumina ( void *self, const VXformInfo *info, int64_t row_id,
-                                   VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *name, *end;
-    spot_name_token_t *spot_name_tok;
-    bool saw_end_float = false;
-    const int EXPECTED_NUMBER_OF_TOKENS = 4;
-    int tok = EXPECTED_NUMBER_OF_TOKENS;
-    const uint16_t types[4] = {nt_L, nt_T, nt_X, nt_Y };
-    
-    assert(rslt->elem_bits == sizeof(spot_name_tok[0]) * 8);
-    rslt->data->elem_bits = sizeof(spot_name_tok[0]) * 8;
-    if( (rc = KDataBufferResize(rslt->data, EXPECTED_NUMBER_OF_TOKENS)) != 0 ) {
-        return rc;
-    }
-    
-    spot_name_tok = rslt->data->base;
-    
-    /* reverse line parse by format:
-       /^(.+)[_:|]([0-9]+)[_:|]([0-9]+)[_:|]([+-0-9]+)[_:|]([+-0-9]+)([_:|][0-9]+?\.[0-9]+)?$/ = 
-        (name, lane, tile, x, y, float?) = ($1, $2, $3, $4, $5, $6?)
-    */
-    name = &((const char *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    end = name + argv[0].u.data.elem_count;
-    while(rc == 0 && end > name && tok > 0 ) {
-        const char* last_end = end--;
-        bool not_numeric = false;
-        char has_sign = 0;
-        while( end >= name && strchr(":|_", *end) == NULL ) {
-            if( !isdigit(*end) ) {
-                not_numeric = true;
-                if( (*end == '-' || *end == '+') && !has_sign ) {
-                    has_sign = *end;
-                    not_numeric = false;
-                }
-            }
-            end--;
-        }
-        end++;
-        if( not_numeric ) {
-            if( !saw_end_float ) {
-                /* skip optional trailing not integer number */
-                saw_end_float = true;
-            } else {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-            }
-        } else {
-            const char* c = end;
-            if( *c == '-' ) {
-                /* keep explicit - '-000' */
-                if( last_end - c >= 2 && *(c + 1) == '0' ) {
-                    c++;
-                    while( *c == '0' && (c + 1) < last_end ) { c++; }
-                    if( *c != '0' ) {
-                        /* cannot tokenize -0004 */
-                        break;
-                    }
-                }
-            } else {
-                if( *c == '+' ) {
-                    /* keep explicit + */
-                    c++;
-                }
-                /* keep leading zeroes */
-                while(*c == '0' && (c + 1) < last_end ) { c++; }
-            }
-            tok--;
-            spot_name_tok[tok].s.token_type = types[tok];
-            spot_name_tok[tok].s.position = c - name;
-            spot_name_tok[tok].s.length = last_end - c;
-            if( spot_name_tok[tok].s.length == 0 ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-            }
-        }
-        /* back up to separator */
-        end--;
-    }
-    if( rc == 0 && tok != 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcName, rcInvalid);
-    }
-    if( rc != 0 ) {
-        spot_name_tok[0].s.token_type = nt_unrecognized;
-        spot_name_tok[0].s.position = 0;
-        spot_name_tok[0].s.length = argv[0].u.data.elem_count;
-        rslt->elem_count = 1;
-    } else {
-        rslt->elem_count = EXPECTED_NUMBER_OF_TOKENS;
-    }
-    return 0;
-}
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
-
- extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:Illumina:tokenize_spot_name #1 ( ascii name );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_Illumina_tokenize_spot_name, 1, 0, 0 ) ( const void *self,
-                  const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = tokenize_spot_name_Illumina;
-    
-    return 0;
-}
diff --git a/libs/sraxf/tokenize-spot_name-ion-torrent.c b/libs/sraxf/tokenize-spot_name-ion-torrent.c
deleted file mode 100644
index b7f6e98..0000000
--- a/libs/sraxf/tokenize-spot_name-ion-torrent.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "name-tokenizer.h"
-
-static
-rc_t CC tokenize_spot_name_IonTorrent( void *self, const VXformInfo *info, int64_t row_id,
-                                       VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *name, *end;
-    spot_name_token_t *spot_name_tok;
-    const int EXPECTED_NUMBER_OF_TOKENS = 2;
-    int tok = EXPECTED_NUMBER_OF_TOKENS;
-    const uint16_t types[4] = {nt_X, nt_Y};
-    
-    assert(rslt->elem_bits == sizeof(spot_name_tok[0]) * 8);
-    rslt->data->elem_bits = sizeof(spot_name_tok[0]) * 8;
-    rc = KDataBufferResize(rslt->data, EXPECTED_NUMBER_OF_TOKENS);
-    if( rc != 0 )
-        return rc;
-    
-    spot_name_tok = rslt->data->base;
-    
-    /* reverse line parse by format:
-       /^(.+):([0-9]+):([0-9]+)$/ = (name, x, x) = ($1, $2, $3)
-    */
-    name = argv[0].u.data.base;
-    name += argv[0].u.data.first_elem;
-    end = name + argv[0].u.data.elem_count;
-
-    while ( end > name && tok > 0 )
-    {
-        const char *num_start, *num_end = end;
-
-        /* examine least significant digit */
-        -- end;
-        if ( ! isdigit ( * end ) )
-            break;
-
-        /* any digit 0-9 is okay as least significant */
-        num_start = end;
-
-        /* examine remaining digits */
-        while ( end > name )
-        {
-            /* require 0-9 to stay within parse */
-            -- end;
-            if ( ! isdigit ( * end ) )
-                break;
-
-            /* only reset numeric start if not 0 */
-            if ( * end != '0' )
-                num_start = end;
-        }
-
-        /* should have stopped on ':' */
-        if ( *end != ':' )
-            break;
-
-        /* we have a numeric token
-           due to oddities, exclude leading zeros from numeral */
-        -- tok;
-        spot_name_tok[tok].s.token_type = types[tok];
-        spot_name_tok[tok].s.position = num_start - name;
-        spot_name_tok[tok].s.length = num_end - num_start;
-    }
-
-    /* if all tokens were seen, the parse was good */
-    if( tok == 0 )
-        rslt->elem_count = EXPECTED_NUMBER_OF_TOKENS;
-    else
-    {
-        /* otherwise, treat entire string as unrecognized */
-        spot_name_tok[0].s.token_type = nt_unrecognized;
-        spot_name_tok[0].s.position = 0;
-        spot_name_tok[0].s.length = argv[0].u.data.elem_count;
-        rslt->elem_count = 1;
-    }
-
-    return 0;
-}
-
-/* tokenize_spot_name
- *  scans name on input
- *  tokenizes into parts
-
- extern function NCBI:SRA:spot_name_token
-    NCBI:SRA:IonTorrent:tokenize_spot_name #1 ( ascii name );
- */
-VTRANSFACT_IMPL ( NCBI_SRA_IonTorrent_tokenize_spot_name, 1, 0, 0 ) ( const void *self,
-                  const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftRow;
-    rslt->u.rf = tokenize_spot_name_IonTorrent;
-    
-    return 0;
-}
diff --git a/libs/sraxf/untyped-priv.h b/libs/sraxf/untyped-priv.h
deleted file mode 100644
index d0c9ea2..0000000
--- a/libs/sraxf/untyped-priv.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_untyped_priv
-#define _h_untyped_priv
-
-/* 454_untyped_0
- *  recognizes all runs produced with v0 loader
- */
-bool NCBI_SRA__454__untyped_0 ( const KTable *tbl, const KMetadata *meta );
-
-
-/* 454_untyped_1_2a
- *  recognizes runs produced with v1.2 loader
- *  where the linker is present
- *  and a physical READ_SEG is present
- */
-bool NCBI_SRA__454__untyped_1_2a ( const KTable *tbl, const KMetadata *meta );
-
-
-/* 454_untyped_1_2b
- *  recognizes runs produced with v1.2 loader
- *  where the linker is missing or empty
- *  and a physical READ_SEG is present
- */
-bool NCBI_SRA__454__untyped_1_2b ( const KTable *tbl, const KMetadata *meta );
-
-
-/* Illumina_untyped_0a
- *  recognizes runs produced with v0 loader with 4-channel QUALITY
- */
-bool NCBI_SRA_Illumina_untyped_0a ( const KTable *tbl, const KMetadata *meta );
-
-
-/* Illumina_untyped_0b
- *  recognizes runs produced with v0 loader with single-channel QUALITY or QUALITY2
- */
-bool NCBI_SRA_Illumina_untyped_0b ( const KTable *tbl, const KMetadata *meta );
-
-
-/* Illumina_untyped_1a
- *  recognizes runs produced with v1 srf and native loaders
- *  having 4-channel qualities
- */
-bool NCBI_SRA_Illumina_untyped_1a ( const KTable *tbl, const KMetadata *meta );
-
-
-/* Illumina_untyped_1b
- *  recognizes runs produced with all v1 loaders
- *  having single-channel qualities
- */
-bool NCBI_SRA_Illumina_untyped_1b ( const KTable *tbl, const KMetadata *meta );
-
-
-/* ABI_untyped_1
- *  recognizes runs produced with all v1 loaders
- */
-bool NCBI_SRA_ABI_untyped_1 ( const KTable *tbl, const KMetadata *meta );
-
-#endif
diff --git a/libs/sraxf/untyped.c b/libs/sraxf/untyped.c
deleted file mode 100644
index 4b62869..0000000
--- a/libs/sraxf/untyped.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <kdb/table.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-static
-bool KMetadataStrEqual ( const KMetadata *meta, const char *path, const char *str )
-{
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, path );
-    if ( rc == 0 )
-    {
-        size_t num_read;
-        char buff [ 4096 ];
-        rc = KMDataNodeReadCString ( node, buff, sizeof buff, & num_read );
-        KMDataNodeRelease ( node );
-        if ( rc == 0 )
-        {
-            if ( strcmp ( buff, str ) == 0 )
-                return true;
-        }
-    }
-
-    return false;
-}
-
-static
-bool KMetadataNumEqual ( const KMetadata *meta, const char *path, int64_t num )
-{
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, path );
-    if ( rc == 0 )
-    {
-        int64_t i;
-        rc = KMDataNodeReadAsI64 ( node, & i );
-        KMDataNodeRelease ( node );
-        if ( rc == 0 )
-        {
-            if ( i == num )
-                return true;
-        }
-    }
-
-    return false;
-}
-
-static
-bool KMetadataVersEqual ( const KMetadata *meta, const char *name, const char *vers )
-{
-    bool equal = false;
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, "SOFTWARE/loader" );
-    if ( rc == 0 )
-    {
-        size_t num_read;
-        char attr [ 256 ];
-        rc = KMDataNodeReadAttr ( node, "name", attr, sizeof attr, & num_read );
-        if ( rc == 0 )
-        {
-            if ( memcmp ( attr, name, strlen ( name ) ) == 0 )
-            {
-                if ( vers == NULL || vers [ 0 ] == 0 )
-                    equal = true;
-                else
-                {
-                    rc = KMDataNodeReadAttr ( node, "vers", attr, sizeof attr, & num_read );
-                    if ( rc == 0 )
-                    {
-                        if ( memcmp ( attr, vers, strlen ( vers ) ) == 0 )
-                            equal = true;
-                    }
-                }
-            }
-        }
-
-        KMDataNodeRelease ( node );
-    }
-
-    return equal;
-}
-
-static
-bool KMetadataExists ( const KMetadata *meta, const char *path )
-{
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, path );
-    if ( rc != 0 )
-        return false;
-    KMDataNodeRelease ( node );
-    return true;
-}
-
-static
-bool KMetadataEmpty ( const KMetadata *meta, const char *path )
-{
-    size_t num_read, remaining;
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, path );
-    if ( rc != 0 )
-        return true;
-    rc = KMDataNodeRead ( node, 0, & num_read, 0, & num_read, & remaining );
-    KMDataNodeRelease ( node );
-    if ( rc == 0 && remaining != 0 )
-        return false;
-    return true;
-}
-
-static
-bool KColumnTypeEqual ( const KTable *tbl, const char *col, const char *type )
-{
-    /* TBD - this operation is expensive
-       should be addressed either by caching opened columns on table
-       or by introducing a path to open column metadata from table */
-    const KColumn *kcol;
-    rc_t rc = KTableOpenColumnRead ( tbl, & kcol, col );
-    if ( rc == 0 )
-    {
-        const KMetadata *meta;
-        rc = KColumnOpenMetadataRead ( kcol, & meta );
-        KColumnRelease ( kcol );
-        if ( rc == 0 )
-        {
-            /* this is a expected to be a v1 column
-               open its decoding node */
-            const KMDataNode *node;
-            rc = KMetadataOpenNodeRead ( meta, & node, "decoding" );
-            KMetadataRelease ( meta );
-            if ( rc == 0 )
-            {
-                /* read its type */
-                size_t size;
-                char type_expr [ 256 ];
-                rc = KMDataNodeReadAttr ( node, "type",
-                    type_expr, sizeof type_expr, & size );
-                KMDataNodeRelease ( node );
-                if ( rc == 0 )
-                {
-                    if ( memcmp ( type_expr, type, strlen ( type ) ) == 0 )
-                        return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-
-/* accept_untyped
- *  recognizes any table at all
- *  used by admin to correct corrupt tables
- */
-MOD_EXPORT
-bool CC NCBI_SRA_accept_untyped ( const KTable *tbl, const KMetadata *meta )
-{
-    return true;
-}
-
-
-/* 454_untyped_0
- *  recognizes all runs produced with v0 loader
- */
-MOD_EXPORT
-bool CC NCBI_SRA__454__untyped_0 ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "454" ) )
-    {
-        if ( ! KMetadataExists ( meta, "SOFTWARE" ) )
-        {
-            if ( KMetadataExists ( meta, "MSC454_FLOW_CHARS" ) &&
-                 KMetadataExists ( meta, "MSC454_KEY_SEQUENCE" ) )
-            {
-                /* don't bother looking at columns */
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-
-/* 454_untyped_1_2a
- *  recognizes runs produced with v1.2 loader
- *  where the linker is present
- *  and a physical READ_SEG is present
- */
-MOD_EXPORT
-bool CC NCBI_SRA__454__untyped_1_2a ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataVersEqual ( meta, "sff-load", "1" ) ||
-         KMetadataVersEqual ( meta, "sff-load", "0" ) )
-    {
-        if ( KMetadataExists ( meta, "col/NREADS" ) )
-        {
-            if ( ! KMetadataEmpty ( meta, "col/LINKER_SEQUENCE/row" ) )
-                return KTableExists ( tbl, kptColumn, "READ_SEG" );
-        }
-    }
-    return false;
-}
-
-
-/* 454_untyped_1_2b
- *  recognizes runs produced with v1.2 loader
- *  where the linker is missing or empty
- *  and a physical READ_SEG is present
- */
-MOD_EXPORT
-bool CC NCBI_SRA__454__untyped_1_2b ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataVersEqual ( meta, "sff-load", "1" ) ||
-         KMetadataVersEqual ( meta, "sff-load", "0" ) )
-    {
-        if ( KMetadataExists ( meta, "col/NREADS" ) )
-        {
-            if ( KMetadataEmpty ( meta, "col/LINKER_SEQUENCE/row" ) )
-                return KTableExists ( tbl, kptColumn, "READ_SEG" );
-        }
-    }
-    return false;
-}
-
-
-/* Illumina_untyped_0a
- *  recognizes runs produced with v0 loader with 4-channel QUALITY
- */
-MOD_EXPORT
-bool CC NCBI_SRA_Illumina_untyped_0a ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "SOLEXA" ) )
-    {
-        if ( ! KMetadataExists ( meta, "SOFTWARE" ) )
-        {
-            if ( KMetadataNumEqual ( meta, "NUMBER_PRB_CHANNELS", 4 ) ||
-                 KMetadataNumEqual ( meta, "NUMBER_PRB_CHANNELS_1", 4 ) )
-            {
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-
-/* Illumina_untyped_0b
- *  recognizes runs produced with v0 loader with single-channel QUALITY or QUALITY2
- */
-MOD_EXPORT
-bool CC NCBI_SRA_Illumina_untyped_0b ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "SOLEXA" ) )
-    {
-        if ( ! KMetadataExists ( meta, "SOFTWARE" ) )
-        {
-            if ( KMetadataNumEqual ( meta, "NUMBER_PRB_CHANNELS", 1 ) ||
-                 KMetadataNumEqual ( meta, "NUMBER_PRB_CHANNELS_1", 1 ) ||
-                 KMetadataNumEqual ( meta, "NUMBER_PRB_CHANNELS_2", 1 ) )
-            {
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-
-/* Illumina_untyped_1a
- *  recognizes runs produced with v1 srf and native loaders
- *  having 4-channel qualities
- */
-MOD_EXPORT
-bool CC NCBI_SRA_Illumina_untyped_1a ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "ILLUMINA" ) )
-    {
-        if ( KMetadataVersEqual ( meta, "illumina-load", "1" ) ||
-             KMetadataVersEqual ( meta, "srf-load", "1" ) )
-        {
-            return KColumnTypeEqual ( tbl, "QUALITY", "NCBI:SRA:swapped_qual4" );
-        }
-    }
-    return false;
-}
-
-
-/* Illumina_untyped_1b
- *  recognizes runs produced with all v1 loaders
- *  having single-channel qualities
- */
-MOD_EXPORT
-bool CC NCBI_SRA_Illumina_untyped_1b ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "ILLUMINA" ) )
-    {
-        if ( KMetadataVersEqual ( meta, "fastq-load", "1" ) ||
-             KMetadataVersEqual ( meta, "fastq-load", "0" ) )
-            return true;
-        if ( KMetadataVersEqual ( meta, "illumina-load", "1" ) ||
-             KMetadataVersEqual ( meta, "srf-load", "1" ) )
-        {
-            return ! KColumnTypeEqual ( tbl, "QUALITY", "NCBI:SRA:swapped_qual4" );
-        }
-    }
-    return false;
-}
-
-
-/* ABI_untyped_1
- *  recognizes runs produced with all v1 loaders
- */
-MOD_EXPORT
-bool CC NCBI_SRA_ABI_untyped_1 ( const KTable *tbl, const KMetadata *meta )
-{
-    if ( KMetadataStrEqual ( meta, "PLATFORM", "ABSOLID" ) )
-    {
-        if ( ! KMetadataExists ( meta, "SOFTWARE" ) ||
-             KMetadataVersEqual ( meta, "abi-load", "1" ) ||
-             KMetadataVersEqual ( meta, "srf-load", "1" ) )
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
-
-/* this is here simply to force the compiler to check
-   the function signatures listed above against a
-   typedef for the function used by vdb. */
-#if _DEBUGGING
-VUntypedFunc test_signature [] =
-{
-    NCBI_SRA__454__untyped_0,
-    NCBI_SRA__454__untyped_1_2a,
-    NCBI_SRA__454__untyped_1_2b,
-    NCBI_SRA_Illumina_untyped_0a,
-    NCBI_SRA_Illumina_untyped_0b,
-    NCBI_SRA_Illumina_untyped_1a,
-    NCBI_SRA_Illumina_untyped_1b,
-    NCBI_SRA_ABI_untyped_1
-};
-#endif
diff --git a/libs/sraxf/v0-decompress-init.c b/libs/sraxf/v0-decompress-init.c
deleted file mode 100644
index 94a19b9..0000000
--- a/libs/sraxf/v0-decompress-init.c
+++ /dev/null
@@ -1,2841 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include "v0-decompress.h"
-#include "v0-decompress-local.h"
-#include <sra/sradb.h> /* SRA_PLATFORM_... */
-#include <klib/sort.h>
-#include <sysalloc.h>
-
-/* globals
- */
-extern SRALocal     gv_local;
-extern SRALookup_t  gp_lookup;
-
-/* local prototypes
- */
-
-static void _s_init_sig_454_default (void);
-static void _s_init_prb_454_default (void);
-static void _s_init_pos_454_default (void);
-
-static void _s_init_seq_default     (void);
-
-static void _s_init_sig_slx_default (void);
-static void _s_init_int_slx_default (void);
-static void _s_init_nse_slx_default (void);
-static void _s_init_prb_slx_default (void);
-
-static void _s_init_slx_convqs4to1_default (void);
-
-
-/* initialize tables with default values
- */
-void sra_decompress_init (void)
-{ 
-  memset (&gv_local, 0, sizeof(struct SRALocal));
-
-  _s_init_sig_454_default (); 
-  _s_init_prb_454_default ();
-  _s_init_pos_454_default ();
-
-  _s_init_seq_default     ();
-
-  _s_init_sig_slx_default ();
-  _s_init_int_slx_default ();
-  _s_init_nse_slx_default ();
-  _s_init_prb_slx_default ();
-
-  _s_init_slx_convqs4to1_default ();
-}   
-
-/* local routines
- */
-static int CC _s_cmp_indexes (const void* a1, const void* a2, void *data)
-{
-  SRALookup_t plook = data;
-  uint32_t bits1    = plook[*(uint16_t*)a1].bits;
-  uint32_t bits2    = plook[*(uint16_t*)a2].bits;
-
-  if (bits1 < bits2) return -1;
-  if (bits1 > bits2) return  1;
-
-  return 0;
-}
-/*
- */
-static void _s_sort_lookup (const SRALookup_t plook, uint16_t* idx, uint16_t size)
-{
-  uint16_t i;
-  for (i=0; i<size; i++) *(idx+i) = i;
-
-  /* make sure it will sort a corect table
-   */
-  ksort ( idx, size, sizeof(uint16_t), _s_cmp_indexes, plook );
-}
-/*
- */
-/*
- */
-static void _s_init_slx_convqs4to1_default (void)
-{
-  gv_local.convqs4to1 [ 0] =  0;  gv_local.convqs4to1 [ 1] =  0;
-  gv_local.convqs4to1 [ 2] =  0;  gv_local.convqs4to1 [ 3] =  0;
-  gv_local.convqs4to1 [ 4] =  0;  gv_local.convqs4to1 [ 5] =  0;
-  gv_local.convqs4to1 [ 6] =  0;  gv_local.convqs4to1 [ 7] =  0;
-  gv_local.convqs4to1 [ 8] =  0;  gv_local.convqs4to1 [ 9] =  0;
-  gv_local.convqs4to1 [10] =  0;  gv_local.convqs4to1 [11] =  0;
-  gv_local.convqs4to1 [12] =  0;  gv_local.convqs4to1 [13] =  0;
-  gv_local.convqs4to1 [14] =  0;  gv_local.convqs4to1 [15] =  0;
-  gv_local.convqs4to1 [16] =  0;  gv_local.convqs4to1 [17] =  0;
-  gv_local.convqs4to1 [18] =  0;  gv_local.convqs4to1 [19] =  0;
-  gv_local.convqs4to1 [20] =  0;  gv_local.convqs4to1 [21] =  0;
-  gv_local.convqs4to1 [22] =  0;  gv_local.convqs4to1 [23] =  0;
-  gv_local.convqs4to1 [24] =  0;  gv_local.convqs4to1 [25] =  0;
-  gv_local.convqs4to1 [26] =  0;  gv_local.convqs4to1 [27] =  0;
-  gv_local.convqs4to1 [28] =  0;  gv_local.convqs4to1 [29] =  0;
-  gv_local.convqs4to1 [30] =  0;  gv_local.convqs4to1 [31] =  1;
-  gv_local.convqs4to1 [32] =  1;  gv_local.convqs4to1 [33] =  1;
-  gv_local.convqs4to1 [34] =  1;  gv_local.convqs4to1 [35] =  1;
-  gv_local.convqs4to1 [36] =  1;  gv_local.convqs4to1 [37] =  2;
-  gv_local.convqs4to1 [38] =  2;  gv_local.convqs4to1 [39] =  3;
-  gv_local.convqs4to1 [40] =  3;  gv_local.convqs4to1 [41] =  4;
-  gv_local.convqs4to1 [42] =  4;  gv_local.convqs4to1 [43] =  5;
-  gv_local.convqs4to1 [44] =  5;  gv_local.convqs4to1 [45] =  6;
-  gv_local.convqs4to1 [46] =  7;  gv_local.convqs4to1 [47] =  8;
-  gv_local.convqs4to1 [48] =  9;  gv_local.convqs4to1 [49] = 10;
-  gv_local.convqs4to1 [50] = 10;  gv_local.convqs4to1 [51] = 11;
-  gv_local.convqs4to1 [52] = 12;  gv_local.convqs4to1 [53] = 13;
-  gv_local.convqs4to1 [54] = 14;  gv_local.convqs4to1 [55] = 15;
-  gv_local.convqs4to1 [56] = 16;  gv_local.convqs4to1 [57] = 17;
-  gv_local.convqs4to1 [58] = 18;  gv_local.convqs4to1 [59] = 19;
-  gv_local.convqs4to1 [60] = 20;  gv_local.convqs4to1 [61] = 21;
-  gv_local.convqs4to1 [62] = 22;  gv_local.convqs4to1 [63] = 23;
-  gv_local.convqs4to1 [64] = 24;  gv_local.convqs4to1 [65] = 25;
-  gv_local.convqs4to1 [66] = 26;  gv_local.convqs4to1 [67] = 27;
-  gv_local.convqs4to1 [68] = 28;  gv_local.convqs4to1 [69] = 29;
-  gv_local.convqs4to1 [70] = 30;  gv_local.convqs4to1 [71] = 31;
-  gv_local.convqs4to1 [72] = 32;  gv_local.convqs4to1 [73] = 33;
-  gv_local.convqs4to1 [74] = 34;  gv_local.convqs4to1 [75] = 35;
-  gv_local.convqs4to1 [76] = 36;  gv_local.convqs4to1 [77] = 37;
-  gv_local.convqs4to1 [78] = 38;  gv_local.convqs4to1 [79] = 39;
-  gv_local.convqs4to1 [80] = 40;
-}
-/*
- */
-static void _s_init_prb_slx_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uchar_t  val;
-#endif
-
-  memset (gv_local.lookup_slx_prb, 0, sizeof(SRALookup)*PRB_SLX_HUFF_TREESIZE);
-
-  /*
-  // each bit is represented by two slashes or backslashes
-  //
-  // where / is 0
-  //      /
-  //
-  // and  \  is 1
-  //       \
-  //             1                   0 - 0000
-  //              \  /\              1 - 0100
-  //               \/  \    6        4 - 1000
-  //               /   /\  /         5 - 1010
-  //              /   /  \/   14     6 - 1100
-  //             0   /\   \  /      14 - 1110
-  //                /  \   \/       15 - 1111
-  //               4    5   \
-  //                         \
-  //                         15
-  //
-  */
-
-  gv_local.lookup_slx_prb[0].nbits = 2; gv_local.lookup_slx_prb[0].bits = 0x00000000;  /* 0: m_qmax  m_qmin  m_qmin m_qmin */
-  gv_local.lookup_slx_prb[1].nbits = 2; gv_local.lookup_slx_prb[1].bits = 0x40000000;  /* 1:     -5      -5      -5     -5 */
-  gv_local.lookup_slx_prb[2].nbits = 3; gv_local.lookup_slx_prb[2].bits = 0x80000000;  /* 2:      A      -A  m_qmin m_qmin */
-  gv_local.lookup_slx_prb[3].nbits = 3; gv_local.lookup_slx_prb[3].bits = 0xA0000000;  /* 3:      A  m_qmin      -A m_qmin */
-  gv_local.lookup_slx_prb[4].nbits = 3; gv_local.lookup_slx_prb[4].bits = 0xC0000000;  /* 4:      A  m_qmin  m_qmin     -A */
-  gv_local.lookup_slx_prb[5].nbits = 4; gv_local.lookup_slx_prb[5].bits = 0xE0000000;  /* 5: escape                        */
-  gv_local.lookup_slx_prb[6].nbits = 4; gv_local.lookup_slx_prb[6].bits = 0xF0000000;  /* 6: UNUSED                        */
-
-   _s_sort_lookup (gv_local.lookup_slx_prb, gv_local.idx_slx_prb, PRB_SLX_HUFF_TREESIZE);
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_slx_prb, 0, sizeof(uchar_t)*REV_HUFF_TREESIZE_08);
-
-  for (i=0; i<PRB_SLX_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_slx_prb[i].bits >> 24;
-    gv_local.rlookup_slx_prb [val] = (uchar_t) i;
-
-    for (j=1; j<=(0xFF>>gv_local.lookup_slx_prb[i].nbits); j++)
-      gv_local.rlookup_slx_prb [val+j] = (uchar_t) i;
-  }
-#endif
-
-  gv_local.lookup_slx_prb_initialized = 1;
-}
-/*
- */
-static void _s_init_sig_slx_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uint16_t val;
-#endif
-
-  memset (gv_local.lookup_slx_sig,  0, sizeof(SRALookup)*SIG_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_sig[  0].nbits = 13; gv_local.lookup_slx_sig[  0].bits = 0xB5180000;
-  gv_local.lookup_slx_sig[  1].nbits = 13; gv_local.lookup_slx_sig[  1].bits = 0x3D680000;
-  gv_local.lookup_slx_sig[  2].nbits = 13; gv_local.lookup_slx_sig[  2].bits = 0xBAA00000;
-  gv_local.lookup_slx_sig[  3].nbits = 13; gv_local.lookup_slx_sig[  3].bits = 0xB7D80000;
-  gv_local.lookup_slx_sig[  4].nbits = 13; gv_local.lookup_slx_sig[  4].bits = 0x59500000;
-  gv_local.lookup_slx_sig[  5].nbits = 13; gv_local.lookup_slx_sig[  5].bits = 0xB7080000;
-  gv_local.lookup_slx_sig[  6].nbits = 13; gv_local.lookup_slx_sig[  6].bits = 0xB8180000;
-  gv_local.lookup_slx_sig[  7].nbits = 13; gv_local.lookup_slx_sig[  7].bits = 0x8B980000;
-  gv_local.lookup_slx_sig[  8].nbits = 13; gv_local.lookup_slx_sig[  8].bits = 0xB7880000;
-  gv_local.lookup_slx_sig[  9].nbits = 13; gv_local.lookup_slx_sig[  9].bits = 0x5EE80000;
-  gv_local.lookup_slx_sig[ 10].nbits = 13; gv_local.lookup_slx_sig[ 10].bits = 0xC0A00000;
-  gv_local.lookup_slx_sig[ 11].nbits = 13; gv_local.lookup_slx_sig[ 11].bits = 0xB7980000;
-  gv_local.lookup_slx_sig[ 12].nbits = 13; gv_local.lookup_slx_sig[ 12].bits = 0x8B880000;
-  gv_local.lookup_slx_sig[ 13].nbits = 13; gv_local.lookup_slx_sig[ 13].bits = 0x8B900000;
-  gv_local.lookup_slx_sig[ 14].nbits = 13; gv_local.lookup_slx_sig[ 14].bits = 0xB7900000;
-  gv_local.lookup_slx_sig[ 15].nbits = 13; gv_local.lookup_slx_sig[ 15].bits = 0xC4400000;
-  gv_local.lookup_slx_sig[ 16].nbits = 13; gv_local.lookup_slx_sig[ 16].bits = 0xBA480000;
-  gv_local.lookup_slx_sig[ 17].nbits = 13; gv_local.lookup_slx_sig[ 17].bits = 0xC0A80000;
-  gv_local.lookup_slx_sig[ 18].nbits = 13; gv_local.lookup_slx_sig[ 18].bits = 0xBD700000;
-  gv_local.lookup_slx_sig[ 19].nbits = 13; gv_local.lookup_slx_sig[ 19].bits = 0xB8100000;
-  gv_local.lookup_slx_sig[ 20].nbits = 13; gv_local.lookup_slx_sig[ 20].bits = 0xC1A00000;
-  gv_local.lookup_slx_sig[ 21].nbits = 13; gv_local.lookup_slx_sig[ 21].bits = 0xBC700000;
-  gv_local.lookup_slx_sig[ 22].nbits = 13; gv_local.lookup_slx_sig[ 22].bits = 0xC4500000;
-  gv_local.lookup_slx_sig[ 23].nbits = 13; gv_local.lookup_slx_sig[ 23].bits = 0xC5200000;
-  gv_local.lookup_slx_sig[ 24].nbits = 13; gv_local.lookup_slx_sig[ 24].bits = 0xC5780000;
-  gv_local.lookup_slx_sig[ 25].nbits = 13; gv_local.lookup_slx_sig[ 25].bits = 0xC5380000;
-  gv_local.lookup_slx_sig[ 26].nbits = 13; gv_local.lookup_slx_sig[ 26].bits = 0xC9A00000;
-  gv_local.lookup_slx_sig[ 27].nbits = 13; gv_local.lookup_slx_sig[ 27].bits = 0xCBA00000;
-  gv_local.lookup_slx_sig[ 28].nbits = 13; gv_local.lookup_slx_sig[ 28].bits = 0xC5300000;
-  gv_local.lookup_slx_sig[ 29].nbits = 13; gv_local.lookup_slx_sig[ 29].bits = 0xC0B80000;
-  gv_local.lookup_slx_sig[ 30].nbits = 13; gv_local.lookup_slx_sig[ 30].bits = 0xC5700000;
-  gv_local.lookup_slx_sig[ 31].nbits = 13; gv_local.lookup_slx_sig[ 31].bits = 0xD6280000;
-  gv_local.lookup_slx_sig[ 32].nbits = 13; gv_local.lookup_slx_sig[ 32].bits = 0xC4480000;
-  gv_local.lookup_slx_sig[ 33].nbits = 13; gv_local.lookup_slx_sig[ 33].bits = 0xD6180000;
-  gv_local.lookup_slx_sig[ 34].nbits = 13; gv_local.lookup_slx_sig[ 34].bits = 0xC9C00000;
-  gv_local.lookup_slx_sig[ 35].nbits = 13; gv_local.lookup_slx_sig[ 35].bits = 0xCA680000;
-  gv_local.lookup_slx_sig[ 36].nbits = 13; gv_local.lookup_slx_sig[ 36].bits = 0xCEF80000;
-  gv_local.lookup_slx_sig[ 37].nbits = 13; gv_local.lookup_slx_sig[ 37].bits = 0xCCD00000;
-  gv_local.lookup_slx_sig[ 38].nbits = 12; gv_local.lookup_slx_sig[ 38].bits = 0x1AA00000;
-  gv_local.lookup_slx_sig[ 39].nbits = 12; gv_local.lookup_slx_sig[ 39].bits = 0x18800000;
-  gv_local.lookup_slx_sig[ 40].nbits = 13; gv_local.lookup_slx_sig[ 40].bits = 0xD6300000;
-  gv_local.lookup_slx_sig[ 41].nbits = 12; gv_local.lookup_slx_sig[ 41].bits = 0x18900000;
-  gv_local.lookup_slx_sig[ 42].nbits = 13; gv_local.lookup_slx_sig[ 42].bits = 0xCBA80000;
-  gv_local.lookup_slx_sig[ 43].nbits = 13; gv_local.lookup_slx_sig[ 43].bits = 0xD7E80000;
-  gv_local.lookup_slx_sig[ 44].nbits = 13; gv_local.lookup_slx_sig[ 44].bits = 0xC9C80000;
-  gv_local.lookup_slx_sig[ 45].nbits = 13; gv_local.lookup_slx_sig[ 45].bits = 0xD4F80000;
-  gv_local.lookup_slx_sig[ 46].nbits = 12; gv_local.lookup_slx_sig[ 46].bits = 0x1AB00000;
-  gv_local.lookup_slx_sig[ 47].nbits = 12; gv_local.lookup_slx_sig[ 47].bits = 0x2A800000;
-  gv_local.lookup_slx_sig[ 48].nbits = 12; gv_local.lookup_slx_sig[ 48].bits = 0x2F100000;
-  gv_local.lookup_slx_sig[ 49].nbits = 12; gv_local.lookup_slx_sig[ 49].bits = 0x1B600000;
-  gv_local.lookup_slx_sig[ 50].nbits = 12; gv_local.lookup_slx_sig[ 50].bits = 0x1C500000;
-  gv_local.lookup_slx_sig[ 51].nbits = 12; gv_local.lookup_slx_sig[ 51].bits = 0x29D00000;
-  gv_local.lookup_slx_sig[ 52].nbits = 12; gv_local.lookup_slx_sig[ 52].bits = 0x2A200000;
-  gv_local.lookup_slx_sig[ 53].nbits = 12; gv_local.lookup_slx_sig[ 53].bits = 0x39400000;
-  gv_local.lookup_slx_sig[ 54].nbits = 12; gv_local.lookup_slx_sig[ 54].bits = 0x33100000;
-  gv_local.lookup_slx_sig[ 55].nbits = 12; gv_local.lookup_slx_sig[ 55].bits = 0x29C00000;
-  gv_local.lookup_slx_sig[ 56].nbits = 12; gv_local.lookup_slx_sig[ 56].bits = 0x28700000;
-  gv_local.lookup_slx_sig[ 57].nbits = 12; gv_local.lookup_slx_sig[ 57].bits = 0x32200000;
-  gv_local.lookup_slx_sig[ 58].nbits = 12; gv_local.lookup_slx_sig[ 58].bits = 0x39700000;
-  gv_local.lookup_slx_sig[ 59].nbits = 12; gv_local.lookup_slx_sig[ 59].bits = 0x39500000;
-  gv_local.lookup_slx_sig[ 60].nbits = 12; gv_local.lookup_slx_sig[ 60].bits = 0x32800000;
-  gv_local.lookup_slx_sig[ 61].nbits = 12; gv_local.lookup_slx_sig[ 61].bits = 0x34300000;
-  gv_local.lookup_slx_sig[ 62].nbits = 12; gv_local.lookup_slx_sig[ 62].bits = 0x32300000;
-  gv_local.lookup_slx_sig[ 63].nbits = 12; gv_local.lookup_slx_sig[ 63].bits = 0x2A900000;
-  gv_local.lookup_slx_sig[ 64].nbits = 12; gv_local.lookup_slx_sig[ 64].bits = 0x3FA00000;
-  gv_local.lookup_slx_sig[ 65].nbits = 12; gv_local.lookup_slx_sig[ 65].bits = 0x39B00000;
-  gv_local.lookup_slx_sig[ 66].nbits = 12; gv_local.lookup_slx_sig[ 66].bits = 0x3F900000;
-  gv_local.lookup_slx_sig[ 67].nbits = 12; gv_local.lookup_slx_sig[ 67].bits = 0x3C300000;
-  gv_local.lookup_slx_sig[ 68].nbits = 12; gv_local.lookup_slx_sig[ 68].bits = 0x5E300000;
-  gv_local.lookup_slx_sig[ 69].nbits = 12; gv_local.lookup_slx_sig[ 69].bits = 0x3E800000;
-  gv_local.lookup_slx_sig[ 70].nbits = 12; gv_local.lookup_slx_sig[ 70].bits = 0x39E00000;
-  gv_local.lookup_slx_sig[ 71].nbits = 12; gv_local.lookup_slx_sig[ 71].bits = 0x3E500000;
-  gv_local.lookup_slx_sig[ 72].nbits = 12; gv_local.lookup_slx_sig[ 72].bits = 0x88F00000;
-  gv_local.lookup_slx_sig[ 73].nbits = 12; gv_local.lookup_slx_sig[ 73].bits = 0x88000000;
-  gv_local.lookup_slx_sig[ 74].nbits = 12; gv_local.lookup_slx_sig[ 74].bits = 0x88D00000;
-  gv_local.lookup_slx_sig[ 75].nbits = 12; gv_local.lookup_slx_sig[ 75].bits = 0x5EB00000;
-  gv_local.lookup_slx_sig[ 76].nbits = 12; gv_local.lookup_slx_sig[ 76].bits = 0x3FB00000;
-  gv_local.lookup_slx_sig[ 77].nbits = 12; gv_local.lookup_slx_sig[ 77].bits = 0x59100000;
-  gv_local.lookup_slx_sig[ 78].nbits = 12; gv_local.lookup_slx_sig[ 78].bits = 0x88C00000;
-  gv_local.lookup_slx_sig[ 79].nbits = 12; gv_local.lookup_slx_sig[ 79].bits = 0x88E00000;
-  gv_local.lookup_slx_sig[ 80].nbits = 12; gv_local.lookup_slx_sig[ 80].bits = 0x88100000;
-  gv_local.lookup_slx_sig[ 81].nbits = 12; gv_local.lookup_slx_sig[ 81].bits = 0xB6800000;
-  gv_local.lookup_slx_sig[ 82].nbits = 12; gv_local.lookup_slx_sig[ 82].bits = 0xB5200000;
-  gv_local.lookup_slx_sig[ 83].nbits = 12; gv_local.lookup_slx_sig[ 83].bits = 0x5E200000;
-  gv_local.lookup_slx_sig[ 84].nbits = 12; gv_local.lookup_slx_sig[ 84].bits = 0xB7C00000;
-  gv_local.lookup_slx_sig[ 85].nbits = 12; gv_local.lookup_slx_sig[ 85].bits = 0xB8000000;
-  gv_local.lookup_slx_sig[ 86].nbits = 12; gv_local.lookup_slx_sig[ 86].bits = 0xB9200000;
-  gv_local.lookup_slx_sig[ 87].nbits = 12; gv_local.lookup_slx_sig[ 87].bits = 0xB7300000;
-  gv_local.lookup_slx_sig[ 88].nbits = 12; gv_local.lookup_slx_sig[ 88].bits = 0xC1100000;
-  gv_local.lookup_slx_sig[ 89].nbits = 12; gv_local.lookup_slx_sig[ 89].bits = 0xBA500000;
-  gv_local.lookup_slx_sig[ 90].nbits = 12; gv_local.lookup_slx_sig[ 90].bits = 0xC0900000;
-  gv_local.lookup_slx_sig[ 91].nbits = 12; gv_local.lookup_slx_sig[ 91].bits = 0xC1900000;
-  gv_local.lookup_slx_sig[ 92].nbits = 12; gv_local.lookup_slx_sig[ 92].bits = 0xB8500000;
-  gv_local.lookup_slx_sig[ 93].nbits = 12; gv_local.lookup_slx_sig[ 93].bits = 0xC1800000;
-  gv_local.lookup_slx_sig[ 94].nbits = 12; gv_local.lookup_slx_sig[ 94].bits = 0xBAE00000;
-  gv_local.lookup_slx_sig[ 95].nbits = 12; gv_local.lookup_slx_sig[ 95].bits = 0xC9B00000;
-  gv_local.lookup_slx_sig[ 96].nbits = 12; gv_local.lookup_slx_sig[ 96].bits = 0xC0800000;
-  gv_local.lookup_slx_sig[ 97].nbits = 12; gv_local.lookup_slx_sig[ 97].bits = 0xC5D00000;
-  gv_local.lookup_slx_sig[ 98].nbits = 12; gv_local.lookup_slx_sig[ 98].bits = 0xC1000000;
-  gv_local.lookup_slx_sig[ 99].nbits = 12; gv_local.lookup_slx_sig[ 99].bits = 0xC0500000;
-  gv_local.lookup_slx_sig[100].nbits = 12; gv_local.lookup_slx_sig[100].bits = 0xC8100000;
-  gv_local.lookup_slx_sig[101].nbits = 12; gv_local.lookup_slx_sig[101].bits = 0xC1C00000;
-  gv_local.lookup_slx_sig[102].nbits = 12; gv_local.lookup_slx_sig[102].bits = 0xC8600000;
-  gv_local.lookup_slx_sig[103].nbits = 12; gv_local.lookup_slx_sig[103].bits = 0xCED00000;
-  gv_local.lookup_slx_sig[104].nbits = 12; gv_local.lookup_slx_sig[104].bits = 0xCC900000;
-  gv_local.lookup_slx_sig[105].nbits = 12; gv_local.lookup_slx_sig[105].bits = 0xCE400000;
-  gv_local.lookup_slx_sig[106].nbits = 12; gv_local.lookup_slx_sig[106].bits = 0xCC500000;
-  gv_local.lookup_slx_sig[107].nbits = 12; gv_local.lookup_slx_sig[107].bits = 0xCC400000;
-  gv_local.lookup_slx_sig[108].nbits = 12; gv_local.lookup_slx_sig[108].bits = 0xCBB00000;
-  gv_local.lookup_slx_sig[109].nbits = 12; gv_local.lookup_slx_sig[109].bits = 0xCA700000;
-  gv_local.lookup_slx_sig[110].nbits = 12; gv_local.lookup_slx_sig[110].bits = 0xD6000000;
-  gv_local.lookup_slx_sig[111].nbits = 12; gv_local.lookup_slx_sig[111].bits = 0xD5D00000;
-  gv_local.lookup_slx_sig[112].nbits = 12; gv_local.lookup_slx_sig[112].bits = 0xD4E00000;
-  gv_local.lookup_slx_sig[113].nbits = 12; gv_local.lookup_slx_sig[113].bits = 0xD5C00000;
-  gv_local.lookup_slx_sig[114].nbits = 12; gv_local.lookup_slx_sig[114].bits = 0xC9E00000;
-  gv_local.lookup_slx_sig[115].nbits = 12; gv_local.lookup_slx_sig[115].bits = 0xD5700000;
-  gv_local.lookup_slx_sig[116].nbits = 11; gv_local.lookup_slx_sig[116].bits = 0x1B400000;
-  gv_local.lookup_slx_sig[117].nbits = 12; gv_local.lookup_slx_sig[117].bits = 0xD7F00000;
-  gv_local.lookup_slx_sig[118].nbits = 11; gv_local.lookup_slx_sig[118].bits = 0x1CC00000;
-  gv_local.lookup_slx_sig[119].nbits = 11; gv_local.lookup_slx_sig[119].bits = 0x18A00000;
-  gv_local.lookup_slx_sig[120].nbits = 11; gv_local.lookup_slx_sig[120].bits = 0x19000000;
-  gv_local.lookup_slx_sig[121].nbits = 11; gv_local.lookup_slx_sig[121].bits = 0x1C600000;
-  gv_local.lookup_slx_sig[122].nbits = 11; gv_local.lookup_slx_sig[122].bits = 0x1E000000;
-  gv_local.lookup_slx_sig[123].nbits = 11; gv_local.lookup_slx_sig[123].bits = 0x1E200000;
-  gv_local.lookup_slx_sig[124].nbits = 11; gv_local.lookup_slx_sig[124].bits = 0x32A00000;
-  gv_local.lookup_slx_sig[125].nbits = 11; gv_local.lookup_slx_sig[125].bits = 0x32E00000;
-  gv_local.lookup_slx_sig[126].nbits = 11; gv_local.lookup_slx_sig[126].bits = 0x33400000;
-  gv_local.lookup_slx_sig[127].nbits = 11; gv_local.lookup_slx_sig[127].bits = 0x2E200000;
-  gv_local.lookup_slx_sig[128].nbits = 11; gv_local.lookup_slx_sig[128].bits = 0x2F200000;
-  gv_local.lookup_slx_sig[129].nbits = 11; gv_local.lookup_slx_sig[129].bits = 0x2E400000;
-  gv_local.lookup_slx_sig[130].nbits = 11; gv_local.lookup_slx_sig[130].bits = 0x2F400000;
-  gv_local.lookup_slx_sig[131].nbits = 11; gv_local.lookup_slx_sig[131].bits = 0x35A00000;
-  gv_local.lookup_slx_sig[132].nbits = 11; gv_local.lookup_slx_sig[132].bits = 0x3B400000;
-  gv_local.lookup_slx_sig[133].nbits = 11; gv_local.lookup_slx_sig[133].bits = 0x33200000;
-  gv_local.lookup_slx_sig[134].nbits = 11; gv_local.lookup_slx_sig[134].bits = 0x34A00000;
-  gv_local.lookup_slx_sig[135].nbits = 11; gv_local.lookup_slx_sig[135].bits = 0x33A00000;
-  gv_local.lookup_slx_sig[136].nbits = 11; gv_local.lookup_slx_sig[136].bits = 0x35C00000;
-  gv_local.lookup_slx_sig[137].nbits = 11; gv_local.lookup_slx_sig[137].bits = 0x3DA00000;
-  gv_local.lookup_slx_sig[138].nbits = 11; gv_local.lookup_slx_sig[138].bits = 0x39800000;
-  gv_local.lookup_slx_sig[139].nbits = 11; gv_local.lookup_slx_sig[139].bits = 0x3E600000;
-  gv_local.lookup_slx_sig[140].nbits = 11; gv_local.lookup_slx_sig[140].bits = 0x3F000000;
-  gv_local.lookup_slx_sig[141].nbits = 11; gv_local.lookup_slx_sig[141].bits = 0x3D000000;
-  gv_local.lookup_slx_sig[142].nbits = 11; gv_local.lookup_slx_sig[142].bits = 0x59200000;
-  gv_local.lookup_slx_sig[143].nbits = 11; gv_local.lookup_slx_sig[143].bits = 0x3D400000;
-  gv_local.lookup_slx_sig[144].nbits = 11; gv_local.lookup_slx_sig[144].bits = 0x88200000;
-  gv_local.lookup_slx_sig[145].nbits = 11; gv_local.lookup_slx_sig[145].bits = 0x5E000000;
-  gv_local.lookup_slx_sig[146].nbits = 11; gv_local.lookup_slx_sig[146].bits = 0x5E800000;
-  gv_local.lookup_slx_sig[147].nbits = 11; gv_local.lookup_slx_sig[147].bits = 0x8BA00000;
-  gv_local.lookup_slx_sig[148].nbits = 11; gv_local.lookup_slx_sig[148].bits = 0x5EC00000;
-  gv_local.lookup_slx_sig[149].nbits = 11; gv_local.lookup_slx_sig[149].bits = 0x5F400000;
-  gv_local.lookup_slx_sig[150].nbits = 11; gv_local.lookup_slx_sig[150].bits = 0x5E600000;
-  gv_local.lookup_slx_sig[151].nbits = 11; gv_local.lookup_slx_sig[151].bits = 0x5F600000;
-  gv_local.lookup_slx_sig[152].nbits = 11; gv_local.lookup_slx_sig[152].bits = 0xB6C00000;
-  gv_local.lookup_slx_sig[153].nbits = 11; gv_local.lookup_slx_sig[153].bits = 0xB6400000;
-  gv_local.lookup_slx_sig[154].nbits = 11; gv_local.lookup_slx_sig[154].bits = 0xB8200000;
-  gv_local.lookup_slx_sig[155].nbits = 11; gv_local.lookup_slx_sig[155].bits = 0xB6600000;
-  gv_local.lookup_slx_sig[156].nbits = 11; gv_local.lookup_slx_sig[156].bits = 0xBAC00000;
-  gv_local.lookup_slx_sig[157].nbits = 11; gv_local.lookup_slx_sig[157].bits = 0xBA600000;
-  gv_local.lookup_slx_sig[158].nbits = 11; gv_local.lookup_slx_sig[158].bits = 0xBCA00000;
-  gv_local.lookup_slx_sig[159].nbits = 11; gv_local.lookup_slx_sig[159].bits = 0xC0600000;
-  gv_local.lookup_slx_sig[160].nbits = 11; gv_local.lookup_slx_sig[160].bits = 0xC0200000;
-  gv_local.lookup_slx_sig[161].nbits = 11; gv_local.lookup_slx_sig[161].bits = 0xBD400000;
-  gv_local.lookup_slx_sig[162].nbits = 11; gv_local.lookup_slx_sig[162].bits = 0xC1200000;
-  gv_local.lookup_slx_sig[163].nbits = 11; gv_local.lookup_slx_sig[163].bits = 0xBBC00000;
-  gv_local.lookup_slx_sig[164].nbits = 11; gv_local.lookup_slx_sig[164].bits = 0xC1600000;
-  gv_local.lookup_slx_sig[165].nbits = 11; gv_local.lookup_slx_sig[165].bits = 0xC0000000;
-  gv_local.lookup_slx_sig[166].nbits = 11; gv_local.lookup_slx_sig[166].bits = 0xC5000000;
-  gv_local.lookup_slx_sig[167].nbits = 11; gv_local.lookup_slx_sig[167].bits = 0xC4600000;
-  gv_local.lookup_slx_sig[168].nbits = 11; gv_local.lookup_slx_sig[168].bits = 0xBCE00000;
-  gv_local.lookup_slx_sig[169].nbits = 11; gv_local.lookup_slx_sig[169].bits = 0xC0E00000;
-  gv_local.lookup_slx_sig[170].nbits = 11; gv_local.lookup_slx_sig[170].bits = 0xC5E00000;
-  gv_local.lookup_slx_sig[171].nbits = 11; gv_local.lookup_slx_sig[171].bits = 0xC9600000;
-  gv_local.lookup_slx_sig[172].nbits = 11; gv_local.lookup_slx_sig[172].bits = 0xC8400000;
-  gv_local.lookup_slx_sig[173].nbits = 11; gv_local.lookup_slx_sig[173].bits = 0xC9800000;
-  gv_local.lookup_slx_sig[174].nbits = 11; gv_local.lookup_slx_sig[174].bits = 0xCC600000;
-  gv_local.lookup_slx_sig[175].nbits = 11; gv_local.lookup_slx_sig[175].bits = 0xCB000000;
-  gv_local.lookup_slx_sig[176].nbits = 11; gv_local.lookup_slx_sig[176].bits = 0xCA400000;
-  gv_local.lookup_slx_sig[177].nbits = 11; gv_local.lookup_slx_sig[177].bits = 0xD4C00000;
-  gv_local.lookup_slx_sig[178].nbits = 11; gv_local.lookup_slx_sig[178].bits = 0xCCA00000;
-  gv_local.lookup_slx_sig[179].nbits = 11; gv_local.lookup_slx_sig[179].bits = 0xD5400000;
-  gv_local.lookup_slx_sig[180].nbits = 11; gv_local.lookup_slx_sig[180].bits = 0xD4800000;
-  gv_local.lookup_slx_sig[181].nbits = 11; gv_local.lookup_slx_sig[181].bits = 0xD5200000;
-  gv_local.lookup_slx_sig[182].nbits = 11; gv_local.lookup_slx_sig[182].bits = 0xD7600000;
-  gv_local.lookup_slx_sig[183].nbits = 10; gv_local.lookup_slx_sig[183].bits = 0x18400000;
-  gv_local.lookup_slx_sig[184].nbits = 11; gv_local.lookup_slx_sig[184].bits = 0xD5800000;
-  gv_local.lookup_slx_sig[185].nbits = 11; gv_local.lookup_slx_sig[185].bits = 0xD5E00000;
-  gv_local.lookup_slx_sig[186].nbits = 11; gv_local.lookup_slx_sig[186].bits = 0xD7C00000;
-  gv_local.lookup_slx_sig[187].nbits = 10; gv_local.lookup_slx_sig[187].bits = 0x1C000000;
-  gv_local.lookup_slx_sig[188].nbits = 10; gv_local.lookup_slx_sig[188].bits = 0x18C00000;
-  gv_local.lookup_slx_sig[189].nbits = 10; gv_local.lookup_slx_sig[189].bits = 0x1A400000;
-  gv_local.lookup_slx_sig[190].nbits = 10; gv_local.lookup_slx_sig[190].bits = 0x1B000000;
-  gv_local.lookup_slx_sig[191].nbits = 10; gv_local.lookup_slx_sig[191].bits = 0x28000000;
-  gv_local.lookup_slx_sig[192].nbits = 10; gv_local.lookup_slx_sig[192].bits = 0x29400000;
-  gv_local.lookup_slx_sig[193].nbits = 10; gv_local.lookup_slx_sig[193].bits = 0x29000000;
-  gv_local.lookup_slx_sig[194].nbits = 10; gv_local.lookup_slx_sig[194].bits = 0x1F400000;
-  gv_local.lookup_slx_sig[195].nbits = 10; gv_local.lookup_slx_sig[195].bits = 0x2EC00000;
-  gv_local.lookup_slx_sig[196].nbits = 10; gv_local.lookup_slx_sig[196].bits = 0x1F000000;
-  gv_local.lookup_slx_sig[197].nbits = 10; gv_local.lookup_slx_sig[197].bits = 0x29800000;
-  gv_local.lookup_slx_sig[198].nbits = 10; gv_local.lookup_slx_sig[198].bits = 0x32400000;
-  gv_local.lookup_slx_sig[199].nbits = 10; gv_local.lookup_slx_sig[199].bits = 0x33C00000;
-  gv_local.lookup_slx_sig[200].nbits = 10; gv_local.lookup_slx_sig[200].bits = 0x2E800000;
-  gv_local.lookup_slx_sig[201].nbits = 10; gv_local.lookup_slx_sig[201].bits = 0x34C00000;
-  gv_local.lookup_slx_sig[202].nbits = 10; gv_local.lookup_slx_sig[202].bits = 0x37C00000;
-  gv_local.lookup_slx_sig[203].nbits = 10; gv_local.lookup_slx_sig[203].bits = 0x37800000;
-  gv_local.lookup_slx_sig[204].nbits = 10; gv_local.lookup_slx_sig[204].bits = 0x37400000;
-  gv_local.lookup_slx_sig[205].nbits = 10; gv_local.lookup_slx_sig[205].bits = 0x39000000;
-  gv_local.lookup_slx_sig[206].nbits = 10; gv_local.lookup_slx_sig[206].bits = 0x3C400000;
-  gv_local.lookup_slx_sig[207].nbits = 10; gv_local.lookup_slx_sig[207].bits = 0x3FC00000;
-  gv_local.lookup_slx_sig[208].nbits = 10; gv_local.lookup_slx_sig[208].bits = 0x58400000;
-  gv_local.lookup_slx_sig[209].nbits = 10; gv_local.lookup_slx_sig[209].bits = 0x3EC00000;
-  gv_local.lookup_slx_sig[210].nbits = 10; gv_local.lookup_slx_sig[210].bits = 0x3E000000;
-  gv_local.lookup_slx_sig[211].nbits = 10; gv_local.lookup_slx_sig[211].bits = 0x3F400000;
-  gv_local.lookup_slx_sig[212].nbits = 10; gv_local.lookup_slx_sig[212].bits = 0x59800000;
-  gv_local.lookup_slx_sig[213].nbits = 10; gv_local.lookup_slx_sig[213].bits = 0x59C00000;
-  gv_local.lookup_slx_sig[214].nbits = 10; gv_local.lookup_slx_sig[214].bits = 0x8B400000;
-  gv_local.lookup_slx_sig[215].nbits = 10; gv_local.lookup_slx_sig[215].bits = 0x88400000;
-  gv_local.lookup_slx_sig[216].nbits = 10; gv_local.lookup_slx_sig[216].bits = 0xB4000000;
-  gv_local.lookup_slx_sig[217].nbits = 10; gv_local.lookup_slx_sig[217].bits = 0xB6000000;
-  gv_local.lookup_slx_sig[218].nbits = 10; gv_local.lookup_slx_sig[218].bits = 0xB9800000;
-  gv_local.lookup_slx_sig[219].nbits = 10; gv_local.lookup_slx_sig[219].bits = 0xB9C00000;
-  gv_local.lookup_slx_sig[220].nbits = 10; gv_local.lookup_slx_sig[220].bits = 0xBC000000;
-  gv_local.lookup_slx_sig[221].nbits = 10; gv_local.lookup_slx_sig[221].bits = 0xBDC00000;
-  gv_local.lookup_slx_sig[222].nbits = 10; gv_local.lookup_slx_sig[222].bits = 0xBD000000;
-  gv_local.lookup_slx_sig[223].nbits = 10; gv_local.lookup_slx_sig[223].bits = 0xC9000000;
-  gv_local.lookup_slx_sig[224].nbits = 10; gv_local.lookup_slx_sig[224].bits = 0xC5800000;
-  gv_local.lookup_slx_sig[225].nbits = 10; gv_local.lookup_slx_sig[225].bits = 0xCA000000;
-  gv_local.lookup_slx_sig[226].nbits = 10; gv_local.lookup_slx_sig[226].bits = 0xCB400000;
-  gv_local.lookup_slx_sig[227].nbits = 10; gv_local.lookup_slx_sig[227].bits = 0xCE000000;
-  gv_local.lookup_slx_sig[228].nbits = 10; gv_local.lookup_slx_sig[228].bits = 0xD7000000;
-  gv_local.lookup_slx_sig[229].nbits =  9; gv_local.lookup_slx_sig[229].bits = 0x1B800000;
-  gv_local.lookup_slx_sig[230].nbits =  9; gv_local.lookup_slx_sig[230].bits = 0x28800000;
-  gv_local.lookup_slx_sig[231].nbits =  9; gv_local.lookup_slx_sig[231].bits = 0x2F800000;
-  gv_local.lookup_slx_sig[232].nbits =  9; gv_local.lookup_slx_sig[232].bits = 0x36000000;
-  gv_local.lookup_slx_sig[233].nbits =  9; gv_local.lookup_slx_sig[233].bits = 0x3C800000;
-  gv_local.lookup_slx_sig[234].nbits =  9; gv_local.lookup_slx_sig[234].bits = 0x58800000;
-  gv_local.lookup_slx_sig[235].nbits =  9; gv_local.lookup_slx_sig[235].bits = 0xB4800000;
-  gv_local.lookup_slx_sig[236].nbits =  9; gv_local.lookup_slx_sig[236].bits = 0xB8800000;
-  gv_local.lookup_slx_sig[237].nbits =  9; gv_local.lookup_slx_sig[237].bits = 0xC4800000;
-  gv_local.lookup_slx_sig[238].nbits =  9; gv_local.lookup_slx_sig[238].bits = 0xCA800000;
-  gv_local.lookup_slx_sig[239].nbits =  9; gv_local.lookup_slx_sig[239].bits = 0xD6800000;
-  gv_local.lookup_slx_sig[240].nbits =  8; gv_local.lookup_slx_sig[240].bits = 0x2B000000;
-  gv_local.lookup_slx_sig[241].nbits =  8; gv_local.lookup_slx_sig[241].bits = 0x3A000000;
-  gv_local.lookup_slx_sig[242].nbits =  8; gv_local.lookup_slx_sig[242].bits = 0x8A000000;
-  gv_local.lookup_slx_sig[243].nbits =  8; gv_local.lookup_slx_sig[243].bits = 0xBE000000;
-  gv_local.lookup_slx_sig[244].nbits =  8; gv_local.lookup_slx_sig[244].bits = 0xCF000000;
-  gv_local.lookup_slx_sig[245].nbits =  7; gv_local.lookup_slx_sig[245].bits = 0x30000000;
-  gv_local.lookup_slx_sig[246].nbits =  7; gv_local.lookup_slx_sig[246].bits = 0x5A000000;
-  gv_local.lookup_slx_sig[247].nbits =  7; gv_local.lookup_slx_sig[247].bits = 0xC2000000;
-  gv_local.lookup_slx_sig[248].nbits =  6; gv_local.lookup_slx_sig[248].bits = 0x20000000;
-  gv_local.lookup_slx_sig[249].nbits =  6; gv_local.lookup_slx_sig[249].bits = 0x8C000000;
-  gv_local.lookup_slx_sig[250].nbits =  6; gv_local.lookup_slx_sig[250].bits = 0xD0000000;
-  gv_local.lookup_slx_sig[251].nbits =  5; gv_local.lookup_slx_sig[251].bits = 0x50000000;
-  gv_local.lookup_slx_sig[252].nbits =  5; gv_local.lookup_slx_sig[252].bits = 0xD8000000;
-  gv_local.lookup_slx_sig[253].nbits =  4; gv_local.lookup_slx_sig[253].bits = 0x90000000;
-  gv_local.lookup_slx_sig[254].nbits =  4; gv_local.lookup_slx_sig[254].bits = 0xF0000000;
-  gv_local.lookup_slx_sig[255].nbits =  3; gv_local.lookup_slx_sig[255].bits = 0x60000000;
-  gv_local.lookup_slx_sig[256].nbits =  4; gv_local.lookup_slx_sig[256].bits = 0xE0000000;
-  gv_local.lookup_slx_sig[257].nbits =  4; gv_local.lookup_slx_sig[257].bits = 0xA0000000;
-  gv_local.lookup_slx_sig[258].nbits =  4; gv_local.lookup_slx_sig[258].bits = 0x00000000;
-  gv_local.lookup_slx_sig[259].nbits =  5; gv_local.lookup_slx_sig[259].bits = 0x80000000;
-  gv_local.lookup_slx_sig[260].nbits =  5; gv_local.lookup_slx_sig[260].bits = 0x10000000;
-  gv_local.lookup_slx_sig[261].nbits =  6; gv_local.lookup_slx_sig[261].bits = 0xB0000000;
-  gv_local.lookup_slx_sig[262].nbits =  6; gv_local.lookup_slx_sig[262].bits = 0x24000000;
-  gv_local.lookup_slx_sig[263].nbits =  7; gv_local.lookup_slx_sig[263].bits = 0xC6000000;
-  gv_local.lookup_slx_sig[264].nbits =  7; gv_local.lookup_slx_sig[264].bits = 0x5C000000;
-  gv_local.lookup_slx_sig[265].nbits =  7; gv_local.lookup_slx_sig[265].bits = 0x2C000000;
-  gv_local.lookup_slx_sig[266].nbits =  8; gv_local.lookup_slx_sig[266].bits = 0xCD000000;
-  gv_local.lookup_slx_sig[267].nbits =  8; gv_local.lookup_slx_sig[267].bits = 0xBF000000;
-  gv_local.lookup_slx_sig[268].nbits =  8; gv_local.lookup_slx_sig[268].bits = 0x89000000;
-  gv_local.lookup_slx_sig[269].nbits =  8; gv_local.lookup_slx_sig[269].bits = 0x38000000;
-  gv_local.lookup_slx_sig[270].nbits =  8; gv_local.lookup_slx_sig[270].bits = 0x1D000000;
-  gv_local.lookup_slx_sig[271].nbits =  9; gv_local.lookup_slx_sig[271].bits = 0xD4000000;
-  gv_local.lookup_slx_sig[272].nbits =  9; gv_local.lookup_slx_sig[272].bits = 0xC8800000;
-  gv_local.lookup_slx_sig[273].nbits =  9; gv_local.lookup_slx_sig[273].bits = 0xBB000000;
-  gv_local.lookup_slx_sig[274].nbits =  9; gv_local.lookup_slx_sig[274].bits = 0xB5800000;
-  gv_local.lookup_slx_sig[275].nbits =  9; gv_local.lookup_slx_sig[275].bits = 0x5F800000;
-  gv_local.lookup_slx_sig[276].nbits =  9; gv_local.lookup_slx_sig[276].bits = 0x3B800000;
-  gv_local.lookup_slx_sig[277].nbits =  9; gv_local.lookup_slx_sig[277].bits = 0x35000000;
-  gv_local.lookup_slx_sig[278].nbits =  9; gv_local.lookup_slx_sig[278].bits = 0x1F800000;
-  gv_local.lookup_slx_sig[279].nbits =  9; gv_local.lookup_slx_sig[279].bits = 0x19800000;
-  gv_local.lookup_slx_sig[280].nbits = 10; gv_local.lookup_slx_sig[280].bits = 0xD6400000;
-  gv_local.lookup_slx_sig[281].nbits = 10; gv_local.lookup_slx_sig[281].bits = 0xCE800000;
-  gv_local.lookup_slx_sig[282].nbits = 10; gv_local.lookup_slx_sig[282].bits = 0xCBC00000;
-  gv_local.lookup_slx_sig[283].nbits = 10; gv_local.lookup_slx_sig[283].bits = 0xC4000000;
-  gv_local.lookup_slx_sig[284].nbits = 10; gv_local.lookup_slx_sig[284].bits = 0xBD800000;
-  gv_local.lookup_slx_sig[285].nbits = 10; gv_local.lookup_slx_sig[285].bits = 0xBB800000;
-  gv_local.lookup_slx_sig[286].nbits = 10; gv_local.lookup_slx_sig[286].bits = 0xB9400000;
-  gv_local.lookup_slx_sig[287].nbits = 10; gv_local.lookup_slx_sig[287].bits = 0xB5400000;
-  gv_local.lookup_slx_sig[288].nbits = 10; gv_local.lookup_slx_sig[288].bits = 0x88800000;
-  gv_local.lookup_slx_sig[289].nbits = 10; gv_local.lookup_slx_sig[289].bits = 0x5F000000;
-  gv_local.lookup_slx_sig[290].nbits = 10; gv_local.lookup_slx_sig[290].bits = 0x3DC00000;
-  gv_local.lookup_slx_sig[291].nbits = 10; gv_local.lookup_slx_sig[291].bits = 0x3B000000;
-  gv_local.lookup_slx_sig[292].nbits = 10; gv_local.lookup_slx_sig[292].bits = 0x36C00000;
-  gv_local.lookup_slx_sig[293].nbits = 10; gv_local.lookup_slx_sig[293].bits = 0x34400000;
-  gv_local.lookup_slx_sig[294].nbits = 10; gv_local.lookup_slx_sig[294].bits = 0x36800000;
-  gv_local.lookup_slx_sig[295].nbits = 10; gv_local.lookup_slx_sig[295].bits = 0x2A400000;
-  gv_local.lookup_slx_sig[296].nbits = 10; gv_local.lookup_slx_sig[296].bits = 0x1EC00000;
-  gv_local.lookup_slx_sig[297].nbits = 10; gv_local.lookup_slx_sig[297].bits = 0x2AC00000;
-  gv_local.lookup_slx_sig[298].nbits = 10; gv_local.lookup_slx_sig[298].bits = 0x1AC00000;
-  gv_local.lookup_slx_sig[299].nbits = 10; gv_local.lookup_slx_sig[299].bits = 0x1E400000;
-  gv_local.lookup_slx_sig[300].nbits = 11; gv_local.lookup_slx_sig[300].bits = 0xD7400000;
-  gv_local.lookup_slx_sig[301].nbits = 11; gv_local.lookup_slx_sig[301].bits = 0xD5A00000;
-  gv_local.lookup_slx_sig[302].nbits = 11; gv_local.lookup_slx_sig[302].bits = 0xD7A00000;
-  gv_local.lookup_slx_sig[303].nbits = 10; gv_local.lookup_slx_sig[303].bits = 0x18000000;
-  gv_local.lookup_slx_sig[304].nbits = 11; gv_local.lookup_slx_sig[304].bits = 0xCCE00000;
-  gv_local.lookup_slx_sig[305].nbits = 11; gv_local.lookup_slx_sig[305].bits = 0xC9400000;
-  gv_local.lookup_slx_sig[306].nbits = 11; gv_local.lookup_slx_sig[306].bits = 0xCB800000;
-  gv_local.lookup_slx_sig[307].nbits = 11; gv_local.lookup_slx_sig[307].bits = 0xCC200000;
-  gv_local.lookup_slx_sig[308].nbits = 11; gv_local.lookup_slx_sig[308].bits = 0xCC000000;
-  gv_local.lookup_slx_sig[309].nbits = 11; gv_local.lookup_slx_sig[309].bits = 0xC8200000;
-  gv_local.lookup_slx_sig[310].nbits = 11; gv_local.lookup_slx_sig[310].bits = 0xC5400000;
-  gv_local.lookup_slx_sig[311].nbits = 11; gv_local.lookup_slx_sig[311].bits = 0xC0C00000;
-  gv_local.lookup_slx_sig[312].nbits = 11; gv_local.lookup_slx_sig[312].bits = 0xC1E00000;
-  gv_local.lookup_slx_sig[313].nbits = 11; gv_local.lookup_slx_sig[313].bits = 0xBA800000;
-  gv_local.lookup_slx_sig[314].nbits = 11; gv_local.lookup_slx_sig[314].bits = 0xBCC00000;
-  gv_local.lookup_slx_sig[315].nbits = 11; gv_local.lookup_slx_sig[315].bits = 0xBC400000;
-  gv_local.lookup_slx_sig[316].nbits = 11; gv_local.lookup_slx_sig[316].bits = 0xBC800000;
-  gv_local.lookup_slx_sig[317].nbits = 11; gv_local.lookup_slx_sig[317].bits = 0xB9000000;
-  gv_local.lookup_slx_sig[318].nbits = 11; gv_local.lookup_slx_sig[318].bits = 0xB8600000;
-  gv_local.lookup_slx_sig[319].nbits = 11; gv_local.lookup_slx_sig[319].bits = 0xB7E00000;
-  gv_local.lookup_slx_sig[320].nbits = 11; gv_local.lookup_slx_sig[320].bits = 0xBA200000;
-  gv_local.lookup_slx_sig[321].nbits = 11; gv_local.lookup_slx_sig[321].bits = 0xB7600000;
-  gv_local.lookup_slx_sig[322].nbits = 11; gv_local.lookup_slx_sig[322].bits = 0xB7400000;
-  gv_local.lookup_slx_sig[323].nbits = 11; gv_local.lookup_slx_sig[323].bits = 0xB4600000;
-  gv_local.lookup_slx_sig[324].nbits = 11; gv_local.lookup_slx_sig[324].bits = 0x8BC00000;
-  gv_local.lookup_slx_sig[325].nbits = 11; gv_local.lookup_slx_sig[325].bits = 0xB6E00000;
-  gv_local.lookup_slx_sig[326].nbits = 11; gv_local.lookup_slx_sig[326].bits = 0xB4400000;
-  gv_local.lookup_slx_sig[327].nbits = 11; gv_local.lookup_slx_sig[327].bits = 0x8BE00000;
-  gv_local.lookup_slx_sig[328].nbits = 11; gv_local.lookup_slx_sig[328].bits = 0x58000000;
-  gv_local.lookup_slx_sig[329].nbits = 11; gv_local.lookup_slx_sig[329].bits = 0x58200000;
-  gv_local.lookup_slx_sig[330].nbits = 11; gv_local.lookup_slx_sig[330].bits = 0x3D800000;
-  gv_local.lookup_slx_sig[331].nbits = 11; gv_local.lookup_slx_sig[331].bits = 0x3EA00000;
-  gv_local.lookup_slx_sig[332].nbits = 11; gv_local.lookup_slx_sig[332].bits = 0x3F200000;
-  gv_local.lookup_slx_sig[333].nbits = 11; gv_local.lookup_slx_sig[333].bits = 0x59600000;
-  gv_local.lookup_slx_sig[334].nbits = 11; gv_local.lookup_slx_sig[334].bits = 0x37000000;
-  gv_local.lookup_slx_sig[335].nbits = 11; gv_local.lookup_slx_sig[335].bits = 0x3D200000;
-  gv_local.lookup_slx_sig[336].nbits = 11; gv_local.lookup_slx_sig[336].bits = 0x33800000;
-  gv_local.lookup_slx_sig[337].nbits = 11; gv_local.lookup_slx_sig[337].bits = 0x2E000000;
-  gv_local.lookup_slx_sig[338].nbits = 11; gv_local.lookup_slx_sig[338].bits = 0x3C000000;
-  gv_local.lookup_slx_sig[339].nbits = 11; gv_local.lookup_slx_sig[339].bits = 0x2AA00000;
-  gv_local.lookup_slx_sig[340].nbits = 11; gv_local.lookup_slx_sig[340].bits = 0x34800000;
-  gv_local.lookup_slx_sig[341].nbits = 11; gv_local.lookup_slx_sig[341].bits = 0x32C00000;
-  gv_local.lookup_slx_sig[342].nbits = 11; gv_local.lookup_slx_sig[342].bits = 0x34000000;
-  gv_local.lookup_slx_sig[343].nbits = 11; gv_local.lookup_slx_sig[343].bits = 0x2E600000;
-  gv_local.lookup_slx_sig[344].nbits = 11; gv_local.lookup_slx_sig[344].bits = 0x35E00000;
-  gv_local.lookup_slx_sig[345].nbits = 11; gv_local.lookup_slx_sig[345].bits = 0x32000000;
-  gv_local.lookup_slx_sig[346].nbits = 11; gv_local.lookup_slx_sig[346].bits = 0x2A000000;
-  gv_local.lookup_slx_sig[347].nbits = 11; gv_local.lookup_slx_sig[347].bits = 0x29E00000;
-  gv_local.lookup_slx_sig[348].nbits = 11; gv_local.lookup_slx_sig[348].bits = 0x1CA00000;
-  gv_local.lookup_slx_sig[349].nbits = 11; gv_local.lookup_slx_sig[349].bits = 0x1A200000;
-  gv_local.lookup_slx_sig[350].nbits = 11; gv_local.lookup_slx_sig[350].bits = 0x19400000;
-  gv_local.lookup_slx_sig[351].nbits = 12; gv_local.lookup_slx_sig[351].bits = 0xD5100000;
-  gv_local.lookup_slx_sig[352].nbits = 11; gv_local.lookup_slx_sig[352].bits = 0x1C800000;
-  gv_local.lookup_slx_sig[353].nbits = 11; gv_local.lookup_slx_sig[353].bits = 0x19600000;
-  gv_local.lookup_slx_sig[354].nbits = 12; gv_local.lookup_slx_sig[354].bits = 0xD7900000;
-  gv_local.lookup_slx_sig[355].nbits = 12; gv_local.lookup_slx_sig[355].bits = 0xD7800000;
-  gv_local.lookup_slx_sig[356].nbits = 12; gv_local.lookup_slx_sig[356].bits = 0xCEE00000;
-  gv_local.lookup_slx_sig[357].nbits = 12; gv_local.lookup_slx_sig[357].bits = 0xD5000000;
-  gv_local.lookup_slx_sig[358].nbits = 12; gv_local.lookup_slx_sig[358].bits = 0xCC800000;
-  gv_local.lookup_slx_sig[359].nbits = 12; gv_local.lookup_slx_sig[359].bits = 0xD4A00000;
-  gv_local.lookup_slx_sig[360].nbits = 12; gv_local.lookup_slx_sig[360].bits = 0xCB300000;
-  gv_local.lookup_slx_sig[361].nbits = 12; gv_local.lookup_slx_sig[361].bits = 0xCE700000;
-  gv_local.lookup_slx_sig[362].nbits = 12; gv_local.lookup_slx_sig[362].bits = 0xCE600000;
-  gv_local.lookup_slx_sig[363].nbits = 12; gv_local.lookup_slx_sig[363].bits = 0xCCC00000;
-  gv_local.lookup_slx_sig[364].nbits = 12; gv_local.lookup_slx_sig[364].bits = 0xC1D00000;
-  gv_local.lookup_slx_sig[365].nbits = 12; gv_local.lookup_slx_sig[365].bits = 0xC5600000;
-  gv_local.lookup_slx_sig[366].nbits = 12; gv_local.lookup_slx_sig[366].bits = 0xC8000000;
-  gv_local.lookup_slx_sig[367].nbits = 12; gv_local.lookup_slx_sig[367].bits = 0xC9F00000;
-  gv_local.lookup_slx_sig[368].nbits = 12; gv_local.lookup_slx_sig[368].bits = 0xC9D00000;
-  gv_local.lookup_slx_sig[369].nbits = 12; gv_local.lookup_slx_sig[369].bits = 0xC5C00000;
-  gv_local.lookup_slx_sig[370].nbits = 12; gv_local.lookup_slx_sig[370].bits = 0xBC600000;
-  gv_local.lookup_slx_sig[371].nbits = 12; gv_local.lookup_slx_sig[371].bits = 0xC1B00000;
-  gv_local.lookup_slx_sig[372].nbits = 12; gv_local.lookup_slx_sig[372].bits = 0xBBE00000;
-  gv_local.lookup_slx_sig[373].nbits = 12; gv_local.lookup_slx_sig[373].bits = 0xC1500000;
-  gv_local.lookup_slx_sig[374].nbits = 12; gv_local.lookup_slx_sig[374].bits = 0xBAB00000;
-  gv_local.lookup_slx_sig[375].nbits = 12; gv_local.lookup_slx_sig[375].bits = 0xC1400000;
-  gv_local.lookup_slx_sig[376].nbits = 12; gv_local.lookup_slx_sig[376].bits = 0xB8400000;
-  gv_local.lookup_slx_sig[377].nbits = 12; gv_local.lookup_slx_sig[377].bits = 0xBA000000;
-  gv_local.lookup_slx_sig[378].nbits = 12; gv_local.lookup_slx_sig[378].bits = 0xB7B00000;
-  gv_local.lookup_slx_sig[379].nbits = 12; gv_local.lookup_slx_sig[379].bits = 0xC0400000;
-  gv_local.lookup_slx_sig[380].nbits = 12; gv_local.lookup_slx_sig[380].bits = 0x59400000;
-  gv_local.lookup_slx_sig[381].nbits = 12; gv_local.lookup_slx_sig[381].bits = 0x8B300000;
-  gv_local.lookup_slx_sig[382].nbits = 12; gv_local.lookup_slx_sig[382].bits = 0xB6B00000;
-  gv_local.lookup_slx_sig[383].nbits = 12; gv_local.lookup_slx_sig[383].bits = 0xBA100000;
-  gv_local.lookup_slx_sig[384].nbits = 12; gv_local.lookup_slx_sig[384].bits = 0x5EF00000;
-  gv_local.lookup_slx_sig[385].nbits = 12; gv_local.lookup_slx_sig[385].bits = 0xB5000000;
-  gv_local.lookup_slx_sig[386].nbits = 12; gv_local.lookup_slx_sig[386].bits = 0xB7200000;
-  gv_local.lookup_slx_sig[387].nbits = 12; gv_local.lookup_slx_sig[387].bits = 0xB7A00000;
-  gv_local.lookup_slx_sig[388].nbits = 12; gv_local.lookup_slx_sig[388].bits = 0x8B200000;
-  gv_local.lookup_slx_sig[389].nbits = 12; gv_local.lookup_slx_sig[389].bits = 0x3F800000;
-  gv_local.lookup_slx_sig[390].nbits = 12; gv_local.lookup_slx_sig[390].bits = 0xB7100000;
-  gv_local.lookup_slx_sig[391].nbits = 12; gv_local.lookup_slx_sig[391].bits = 0x3E400000;
-  gv_local.lookup_slx_sig[392].nbits = 12; gv_local.lookup_slx_sig[392].bits = 0x5EA00000;
-  gv_local.lookup_slx_sig[393].nbits = 12; gv_local.lookup_slx_sig[393].bits = 0xB6A00000;
-  gv_local.lookup_slx_sig[394].nbits = 12; gv_local.lookup_slx_sig[394].bits = 0x39C00000;
-  gv_local.lookup_slx_sig[395].nbits = 12; gv_local.lookup_slx_sig[395].bits = 0x3E900000;
-  gv_local.lookup_slx_sig[396].nbits = 12; gv_local.lookup_slx_sig[396].bits = 0x8B100000;
-  gv_local.lookup_slx_sig[397].nbits = 12; gv_local.lookup_slx_sig[397].bits = 0x39D00000;
-  gv_local.lookup_slx_sig[398].nbits = 12; gv_local.lookup_slx_sig[398].bits = 0x3B600000;
-  gv_local.lookup_slx_sig[399].nbits = 12; gv_local.lookup_slx_sig[399].bits = 0x3C200000;
-  gv_local.lookup_slx_sig[400].nbits = 12; gv_local.lookup_slx_sig[400].bits = 0x39600000;
-  gv_local.lookup_slx_sig[401].nbits = 12; gv_local.lookup_slx_sig[401].bits = 0x3D700000;
-  gv_local.lookup_slx_sig[402].nbits = 12; gv_local.lookup_slx_sig[402].bits = 0x35900000;
-  gv_local.lookup_slx_sig[403].nbits = 12; gv_local.lookup_slx_sig[403].bits = 0x1E900000;
-  gv_local.lookup_slx_sig[404].nbits = 12; gv_local.lookup_slx_sig[404].bits = 0x34200000;
-  gv_local.lookup_slx_sig[405].nbits = 12; gv_local.lookup_slx_sig[405].bits = 0x2F700000;
-  gv_local.lookup_slx_sig[406].nbits = 12; gv_local.lookup_slx_sig[406].bits = 0x33700000;
-  gv_local.lookup_slx_sig[407].nbits = 12; gv_local.lookup_slx_sig[407].bits = 0x33000000;
-  gv_local.lookup_slx_sig[408].nbits = 12; gv_local.lookup_slx_sig[408].bits = 0x2F000000;
-  gv_local.lookup_slx_sig[409].nbits = 12; gv_local.lookup_slx_sig[409].bits = 0x37200000;
-  gv_local.lookup_slx_sig[410].nbits = 12; gv_local.lookup_slx_sig[410].bits = 0x1C400000;
-  gv_local.lookup_slx_sig[411].nbits = 12; gv_local.lookup_slx_sig[411].bits = 0x28500000;
-  gv_local.lookup_slx_sig[412].nbits = 12; gv_local.lookup_slx_sig[412].bits = 0x1CE00000;
-  gv_local.lookup_slx_sig[413].nbits = 12; gv_local.lookup_slx_sig[413].bits = 0x1A800000;
-  gv_local.lookup_slx_sig[414].nbits = 12; gv_local.lookup_slx_sig[414].bits = 0x1EB00000;
-  gv_local.lookup_slx_sig[415].nbits = 13; gv_local.lookup_slx_sig[415].bits = 0xCEC80000;
-  gv_local.lookup_slx_sig[416].nbits = 13; gv_local.lookup_slx_sig[416].bits = 0xD6100000;
-  gv_local.lookup_slx_sig[417].nbits = 13; gv_local.lookup_slx_sig[417].bits = 0xD7E00000;
-  gv_local.lookup_slx_sig[418].nbits = 12; gv_local.lookup_slx_sig[418].bits = 0x1A100000;
-  gv_local.lookup_slx_sig[419].nbits = 12; gv_local.lookup_slx_sig[419].bits = 0x19300000;
-  gv_local.lookup_slx_sig[420].nbits = 12; gv_local.lookup_slx_sig[420].bits = 0x1CF00000;
-  gv_local.lookup_slx_sig[421].nbits = 12; gv_local.lookup_slx_sig[421].bits = 0x2A300000;
-  gv_local.lookup_slx_sig[422].nbits = 13; gv_local.lookup_slx_sig[422].bits = 0xD4B00000;
-  gv_local.lookup_slx_sig[423].nbits = 13; gv_local.lookup_slx_sig[423].bits = 0xD6380000;
-  gv_local.lookup_slx_sig[424].nbits = 12; gv_local.lookup_slx_sig[424].bits = 0x1A000000;
-  gv_local.lookup_slx_sig[425].nbits = 13; gv_local.lookup_slx_sig[425].bits = 0xCB280000;
-  gv_local.lookup_slx_sig[426].nbits = 13; gv_local.lookup_slx_sig[426].bits = 0xD4F00000;
-  gv_local.lookup_slx_sig[427].nbits = 13; gv_local.lookup_slx_sig[427].bits = 0xD4B80000;
-  gv_local.lookup_slx_sig[428].nbits = 12; gv_local.lookup_slx_sig[428].bits = 0x1B700000;
-  gv_local.lookup_slx_sig[429].nbits = 13; gv_local.lookup_slx_sig[429].bits = 0xD5680000;
-  gv_local.lookup_slx_sig[430].nbits = 13; gv_local.lookup_slx_sig[430].bits = 0xCCD80000;
-  gv_local.lookup_slx_sig[431].nbits = 13; gv_local.lookup_slx_sig[431].bits = 0xCE500000;
-  gv_local.lookup_slx_sig[432].nbits = 13; gv_local.lookup_slx_sig[432].bits = 0xCEC00000;
-  gv_local.lookup_slx_sig[433].nbits = 13; gv_local.lookup_slx_sig[433].bits = 0xC9A80000;
-  gv_local.lookup_slx_sig[434].nbits = 13; gv_local.lookup_slx_sig[434].bits = 0xCB200000;
-  gv_local.lookup_slx_sig[435].nbits = 13; gv_local.lookup_slx_sig[435].bits = 0xBD780000;
-  gv_local.lookup_slx_sig[436].nbits = 13; gv_local.lookup_slx_sig[436].bits = 0xC8780000;
-  gv_local.lookup_slx_sig[437].nbits = 13; gv_local.lookup_slx_sig[437].bits = 0xBBF00000;
-  gv_local.lookup_slx_sig[438].nbits = 13; gv_local.lookup_slx_sig[438].bits = 0xBD600000;
-  gv_local.lookup_slx_sig[439].nbits = 13; gv_local.lookup_slx_sig[439].bits = 0xC8700000;
-  gv_local.lookup_slx_sig[440].nbits = 13; gv_local.lookup_slx_sig[440].bits = 0xB7D00000;
-  gv_local.lookup_slx_sig[441].nbits = 13; gv_local.lookup_slx_sig[441].bits = 0xC4580000;
-  gv_local.lookup_slx_sig[442].nbits = 13; gv_local.lookup_slx_sig[442].bits = 0xC5280000;
-  gv_local.lookup_slx_sig[443].nbits = 13; gv_local.lookup_slx_sig[443].bits = 0xC0B00000;
-  gv_local.lookup_slx_sig[444].nbits = 13; gv_local.lookup_slx_sig[444].bits = 0xB9300000;
-  gv_local.lookup_slx_sig[445].nbits = 13; gv_local.lookup_slx_sig[445].bits = 0xBC780000;
-  gv_local.lookup_slx_sig[446].nbits = 13; gv_local.lookup_slx_sig[446].bits = 0xB7000000;
-  gv_local.lookup_slx_sig[447].nbits = 13; gv_local.lookup_slx_sig[447].bits = 0xBD680000;
-  gv_local.lookup_slx_sig[448].nbits = 13; gv_local.lookup_slx_sig[448].bits = 0xC1A80000;
-  gv_local.lookup_slx_sig[449].nbits = 13; gv_local.lookup_slx_sig[449].bits = 0xBAA80000;
-  gv_local.lookup_slx_sig[450].nbits = 13; gv_local.lookup_slx_sig[450].bits = 0xB7800000;
-  gv_local.lookup_slx_sig[451].nbits = 13; gv_local.lookup_slx_sig[451].bits = 0xB9380000;
-  gv_local.lookup_slx_sig[452].nbits = 13; gv_local.lookup_slx_sig[452].bits = 0x5E480000;
-  gv_local.lookup_slx_sig[453].nbits = 13; gv_local.lookup_slx_sig[453].bits = 0xB6980000;
-  gv_local.lookup_slx_sig[454].nbits = 13; gv_local.lookup_slx_sig[454].bits = 0xBBF80000;
-  gv_local.lookup_slx_sig[455].nbits = 13; gv_local.lookup_slx_sig[455].bits = 0x8B000000;
-  gv_local.lookup_slx_sig[456].nbits = 13; gv_local.lookup_slx_sig[456].bits = 0xB6900000;
-  gv_local.lookup_slx_sig[457].nbits = 13; gv_local.lookup_slx_sig[457].bits = 0x8B800000;
-  gv_local.lookup_slx_sig[458].nbits = 13; gv_local.lookup_slx_sig[458].bits = 0x5E400000;
-  gv_local.lookup_slx_sig[459].nbits = 13; gv_local.lookup_slx_sig[459].bits = 0xB5100000;
-  gv_local.lookup_slx_sig[460].nbits = 13; gv_local.lookup_slx_sig[460].bits = 0xB5380000;
-  gv_local.lookup_slx_sig[461].nbits = 13; gv_local.lookup_slx_sig[461].bits = 0xBA400000;
-  gv_local.lookup_slx_sig[462].nbits = 13; gv_local.lookup_slx_sig[462].bits = 0xBAF00000;
-  gv_local.lookup_slx_sig[463].nbits = 13; gv_local.lookup_slx_sig[463].bits = 0xB5300000;
-  gv_local.lookup_slx_sig[464].nbits = 13; gv_local.lookup_slx_sig[464].bits = 0x3B700000;
-  gv_local.lookup_slx_sig[465].nbits = 13; gv_local.lookup_slx_sig[465].bits = 0xBAF80000;
-  gv_local.lookup_slx_sig[466].nbits = 13; gv_local.lookup_slx_sig[466].bits = 0x8B080000;
-  gv_local.lookup_slx_sig[467].nbits = 13; gv_local.lookup_slx_sig[467].bits = 0x5EE00000;
-  gv_local.lookup_slx_sig[468].nbits = 13; gv_local.lookup_slx_sig[468].bits = 0x59580000;
-  gv_local.lookup_slx_sig[469].nbits = 13; gv_local.lookup_slx_sig[469].bits = 0x5E580000;
-  gv_local.lookup_slx_sig[470].nbits = 13; gv_local.lookup_slx_sig[470].bits = 0x59080000;
-  gv_local.lookup_slx_sig[471].nbits = 13; gv_local.lookup_slx_sig[471].bits = 0x39A00000;
-  gv_local.lookup_slx_sig[472].nbits = 13; gv_local.lookup_slx_sig[472].bits = 0x39F00000;
-  gv_local.lookup_slx_sig[473].nbits = 13; gv_local.lookup_slx_sig[473].bits = 0x37300000;
-  gv_local.lookup_slx_sig[474].nbits = 13; gv_local.lookup_slx_sig[474].bits = 0x3D600000;
-  gv_local.lookup_slx_sig[475].nbits = 13; gv_local.lookup_slx_sig[475].bits = 0x39F80000;
-  gv_local.lookup_slx_sig[476].nbits = 13; gv_local.lookup_slx_sig[476].bits = 0x28480000;
-  gv_local.lookup_slx_sig[477].nbits = 13; gv_local.lookup_slx_sig[477].bits = 0x5E500000;
-  gv_local.lookup_slx_sig[478].nbits = 13; gv_local.lookup_slx_sig[478].bits = 0x28680000;
-  gv_local.lookup_slx_sig[479].nbits = 13; gv_local.lookup_slx_sig[479].bits = 0x3B780000;
-  gv_local.lookup_slx_sig[480].nbits = 13; gv_local.lookup_slx_sig[480].bits = 0x32980000;
-  gv_local.lookup_slx_sig[481].nbits = 13; gv_local.lookup_slx_sig[481].bits = 0x2F600000;
-  gv_local.lookup_slx_sig[482].nbits = 13; gv_local.lookup_slx_sig[482].bits = 0x37380000;
-  gv_local.lookup_slx_sig[483].nbits = 13; gv_local.lookup_slx_sig[483].bits = 0x39A80000;
-  gv_local.lookup_slx_sig[484].nbits = 13; gv_local.lookup_slx_sig[484].bits = 0x35880000;
-  gv_local.lookup_slx_sig[485].nbits = 13; gv_local.lookup_slx_sig[485].bits = 0x35800000;
-  gv_local.lookup_slx_sig[486].nbits = 13; gv_local.lookup_slx_sig[486].bits = 0x1E800000;
-  gv_local.lookup_slx_sig[487].nbits = 13; gv_local.lookup_slx_sig[487].bits = 0x1EA80000;
-  gv_local.lookup_slx_sig[488].nbits = 13; gv_local.lookup_slx_sig[488].bits = 0x33680000;
-  gv_local.lookup_slx_sig[489].nbits = 13; gv_local.lookup_slx_sig[489].bits = 0x1E880000;
-  gv_local.lookup_slx_sig[490].nbits = 13; gv_local.lookup_slx_sig[490].bits = 0x2F680000;
-  gv_local.lookup_slx_sig[491].nbits = 13; gv_local.lookup_slx_sig[491].bits = 0x33600000;
-  gv_local.lookup_slx_sig[492].nbits = 14; gv_local.lookup_slx_sig[492].bits = 0xCEF40000;
-  gv_local.lookup_slx_sig[493].nbits = 13; gv_local.lookup_slx_sig[493].bits = 0x59000000;
-  gv_local.lookup_slx_sig[494].nbits = 13; gv_local.lookup_slx_sig[494].bits = 0x19200000;
-  gv_local.lookup_slx_sig[495].nbits = 13; gv_local.lookup_slx_sig[495].bits = 0x1EA00000;
-  gv_local.lookup_slx_sig[496].nbits = 13; gv_local.lookup_slx_sig[496].bits = 0x1A900000;
-  gv_local.lookup_slx_sig[497].nbits = 13; gv_local.lookup_slx_sig[497].bits = 0x32900000;
-  gv_local.lookup_slx_sig[498].nbits = 13; gv_local.lookup_slx_sig[498].bits = 0x28600000;
-  gv_local.lookup_slx_sig[499].nbits = 14; gv_local.lookup_slx_sig[499].bits = 0xCE580000;
-  gv_local.lookup_slx_sig[500].nbits = 13; gv_local.lookup_slx_sig[500].bits = 0x1A980000;
-  gv_local.lookup_slx_sig[501].nbits = 14; gv_local.lookup_slx_sig[501].bits = 0xCA640000;
-  gv_local.lookup_slx_sig[502].nbits = 13; gv_local.lookup_slx_sig[502].bits = 0x19280000;
-  gv_local.lookup_slx_sig[503].nbits = 14; gv_local.lookup_slx_sig[503].bits = 0xD6240000;
-  gv_local.lookup_slx_sig[504].nbits = 14; gv_local.lookup_slx_sig[504].bits = 0xD5600000;
-  gv_local.lookup_slx_sig[505].nbits = 13; gv_local.lookup_slx_sig[505].bits = 0x28400000;
-  gv_local.lookup_slx_sig[506].nbits = 14; gv_local.lookup_slx_sig[506].bits = 0xD6200000;
-  gv_local.lookup_slx_sig[507].nbits = 14; gv_local.lookup_slx_sig[507].bits = 0xCE5C0000;
-  gv_local.lookup_slx_sig[508].nbits = 14; gv_local.lookup_slx_sig[508].bits = 0xD5640000;
-  gv_local.lookup_slx_sig[509].nbits = 14; gv_local.lookup_slx_sig[509].bits = 0xCEF00000;
-  gv_local.lookup_slx_sig[510].nbits = 14; gv_local.lookup_slx_sig[510].bits = 0xCA600000;
-  gv_local.lookup_slx_sig[511].nbits =  4; gv_local.lookup_slx_sig[511].bits = 0x40000000;
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_slx_sig, 0, sizeof(uint16_t)*REV_HUFF_TREESIZE_16);
-
-  for (i=0; i<SIG_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_slx_sig[i].bits >> 16;
-    gv_local.rlookup_slx_sig [val] = (uint16_t) i;
-    for (j=1; j<=(0xFFFF>>gv_local.lookup_slx_sig[i].nbits); j++)
-      gv_local.rlookup_slx_sig [val+j] = (uint16_t) i;
-  }
-#endif
-
-  _s_sort_lookup (gv_local.lookup_slx_sig, gv_local.idx_slx_sig, SIG_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_sig_initialized = 1;
-}
-/*
- */
-static void _s_init_int_slx_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uint16_t val;
-#endif
-
-  memset (gv_local.lookup_slx_int,  0, sizeof(SRALookup)*INT_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_int[   0].nbits = 13; gv_local.lookup_slx_int[   0].bits = 0x9DF80000;
-  gv_local.lookup_slx_int[   1].nbits = 13; gv_local.lookup_slx_int[   1].bits = 0x9DF00000;
-  gv_local.lookup_slx_int[   2].nbits = 13; gv_local.lookup_slx_int[   2].bits = 0xA4A00000;
-  gv_local.lookup_slx_int[   3].nbits = 13; gv_local.lookup_slx_int[   3].bits = 0xA7C00000;
-  gv_local.lookup_slx_int[   4].nbits = 13; gv_local.lookup_slx_int[   4].bits = 0xA4A80000;
-  gv_local.lookup_slx_int[   5].nbits = 13; gv_local.lookup_slx_int[   5].bits = 0xA7C80000;
-  gv_local.lookup_slx_int[   6].nbits = 13; gv_local.lookup_slx_int[   6].bits = 0xB6000000;
-  gv_local.lookup_slx_int[   7].nbits = 13; gv_local.lookup_slx_int[   7].bits = 0xAF600000;
-  gv_local.lookup_slx_int[   8].nbits = 13; gv_local.lookup_slx_int[   8].bits = 0xAF680000;
-  gv_local.lookup_slx_int[   9].nbits = 13; gv_local.lookup_slx_int[   9].bits = 0xBBA00000;
-  gv_local.lookup_slx_int[  10].nbits = 13; gv_local.lookup_slx_int[  10].bits = 0xB6080000;
-  gv_local.lookup_slx_int[  11].nbits = 13; gv_local.lookup_slx_int[  11].bits = 0xBBA80000;
-  gv_local.lookup_slx_int[  12].nbits = 13; gv_local.lookup_slx_int[  12].bits = 0xBDC80000;
-  gv_local.lookup_slx_int[  13].nbits = 13; gv_local.lookup_slx_int[  13].bits = 0xBDC00000;
-  gv_local.lookup_slx_int[  14].nbits = 13; gv_local.lookup_slx_int[  14].bits = 0xCA400000;
-  gv_local.lookup_slx_int[  15].nbits = 13; gv_local.lookup_slx_int[  15].bits = 0xC1F80000;
-  gv_local.lookup_slx_int[  16].nbits = 13; gv_local.lookup_slx_int[  16].bits = 0xC1F00000;
-  gv_local.lookup_slx_int[  17].nbits = 13; gv_local.lookup_slx_int[  17].bits = 0xCA480000;
-  gv_local.lookup_slx_int[  18].nbits = 13; gv_local.lookup_slx_int[  18].bits = 0xCF600000;
-  gv_local.lookup_slx_int[  19].nbits = 13; gv_local.lookup_slx_int[  19].bits = 0xD2C00000;
-  gv_local.lookup_slx_int[  20].nbits = 13; gv_local.lookup_slx_int[  20].bits = 0xCF680000;
-  gv_local.lookup_slx_int[  21].nbits = 13; gv_local.lookup_slx_int[  21].bits = 0xD2C80000;
-  gv_local.lookup_slx_int[  22].nbits = 13; gv_local.lookup_slx_int[  22].bits = 0xDA200000;
-  gv_local.lookup_slx_int[  23].nbits = 13; gv_local.lookup_slx_int[  23].bits = 0xDE900000;
-  gv_local.lookup_slx_int[  24].nbits = 13; gv_local.lookup_slx_int[  24].bits = 0xDA280000;
-  gv_local.lookup_slx_int[  25].nbits = 12; gv_local.lookup_slx_int[  25].bits = 0x02C00000;
-  gv_local.lookup_slx_int[  26].nbits = 13; gv_local.lookup_slx_int[  26].bits = 0xDE980000;
-  gv_local.lookup_slx_int[  27].nbits = 12; gv_local.lookup_slx_int[  27].bits = 0x02D00000;
-  gv_local.lookup_slx_int[  28].nbits = 12; gv_local.lookup_slx_int[  28].bits = 0x0C400000;
-  gv_local.lookup_slx_int[  29].nbits = 12; gv_local.lookup_slx_int[  29].bits = 0x0C500000;
-  gv_local.lookup_slx_int[  30].nbits = 12; gv_local.lookup_slx_int[  30].bits = 0x1A800000;
-  gv_local.lookup_slx_int[  31].nbits = 12; gv_local.lookup_slx_int[  31].bits = 0x1A900000;
-  gv_local.lookup_slx_int[  32].nbits = 12; gv_local.lookup_slx_int[  32].bits = 0x21300000;
-  gv_local.lookup_slx_int[  33].nbits = 12; gv_local.lookup_slx_int[  33].bits = 0x21100000;
-  gv_local.lookup_slx_int[  34].nbits = 12; gv_local.lookup_slx_int[  34].bits = 0x29900000;
-  gv_local.lookup_slx_int[  35].nbits = 12; gv_local.lookup_slx_int[  35].bits = 0x3C200000;
-  gv_local.lookup_slx_int[  36].nbits = 12; gv_local.lookup_slx_int[  36].bits = 0x3C000000;
-  gv_local.lookup_slx_int[  37].nbits = 12; gv_local.lookup_slx_int[  37].bits = 0x3E600000;
-  gv_local.lookup_slx_int[  38].nbits = 12; gv_local.lookup_slx_int[  38].bits = 0x4C000000;
-  gv_local.lookup_slx_int[  39].nbits = 12; gv_local.lookup_slx_int[  39].bits = 0x4F000000;
-  gv_local.lookup_slx_int[  40].nbits = 12; gv_local.lookup_slx_int[  40].bits = 0x4C400000;
-  gv_local.lookup_slx_int[  41].nbits = 12; gv_local.lookup_slx_int[  41].bits = 0x4F300000;
-  gv_local.lookup_slx_int[  42].nbits = 12; gv_local.lookup_slx_int[  42].bits = 0x58D00000;
-  gv_local.lookup_slx_int[  43].nbits = 12; gv_local.lookup_slx_int[  43].bits = 0x4F100000;
-  gv_local.lookup_slx_int[  44].nbits = 12; gv_local.lookup_slx_int[  44].bits = 0x5BA00000;
-  gv_local.lookup_slx_int[  45].nbits = 12; gv_local.lookup_slx_int[  45].bits = 0x6D000000;
-  gv_local.lookup_slx_int[  46].nbits = 12; gv_local.lookup_slx_int[  46].bits = 0x6F200000;
-  gv_local.lookup_slx_int[  47].nbits = 12; gv_local.lookup_slx_int[  47].bits = 0x7D800000;
-  gv_local.lookup_slx_int[  48].nbits = 12; gv_local.lookup_slx_int[  48].bits = 0x84800000;
-  gv_local.lookup_slx_int[  49].nbits = 12; gv_local.lookup_slx_int[  49].bits = 0x86600000;
-  gv_local.lookup_slx_int[  50].nbits = 12; gv_local.lookup_slx_int[  50].bits = 0x8DC00000;
-  gv_local.lookup_slx_int[  51].nbits = 12; gv_local.lookup_slx_int[  51].bits = 0x8DD00000;
-  gv_local.lookup_slx_int[  52].nbits = 12; gv_local.lookup_slx_int[  52].bits = 0x91100000;
-  gv_local.lookup_slx_int[  53].nbits = 12; gv_local.lookup_slx_int[  53].bits = 0x95000000;
-  gv_local.lookup_slx_int[  54].nbits = 12; gv_local.lookup_slx_int[  54].bits = 0x9CA00000;
-  gv_local.lookup_slx_int[  55].nbits = 12; gv_local.lookup_slx_int[  55].bits = 0x9DE00000;
-  gv_local.lookup_slx_int[  56].nbits = 12; gv_local.lookup_slx_int[  56].bits = 0x9CB00000;
-  gv_local.lookup_slx_int[  57].nbits = 12; gv_local.lookup_slx_int[  57].bits = 0xA3200000;
-  gv_local.lookup_slx_int[  58].nbits = 12; gv_local.lookup_slx_int[  58].bits = 0xA5E00000;
-  gv_local.lookup_slx_int[  59].nbits = 12; gv_local.lookup_slx_int[  59].bits = 0xA9500000;
-  gv_local.lookup_slx_int[  60].nbits = 12; gv_local.lookup_slx_int[  60].bits = 0xAF400000;
-  gv_local.lookup_slx_int[  61].nbits = 12; gv_local.lookup_slx_int[  61].bits = 0xAF700000;
-  gv_local.lookup_slx_int[  62].nbits = 12; gv_local.lookup_slx_int[  62].bits = 0xB6900000;
-  gv_local.lookup_slx_int[  63].nbits = 12; gv_local.lookup_slx_int[  63].bits = 0xB6100000;
-  gv_local.lookup_slx_int[  64].nbits = 12; gv_local.lookup_slx_int[  64].bits = 0xBBB00000;
-  gv_local.lookup_slx_int[  65].nbits = 12; gv_local.lookup_slx_int[  65].bits = 0xBD900000;
-  gv_local.lookup_slx_int[  66].nbits = 12; gv_local.lookup_slx_int[  66].bits = 0xC1A00000;
-  gv_local.lookup_slx_int[  67].nbits = 12; gv_local.lookup_slx_int[  67].bits = 0xC1E00000;
-  gv_local.lookup_slx_int[  68].nbits = 12; gv_local.lookup_slx_int[  68].bits = 0xC9400000;
-  gv_local.lookup_slx_int[  69].nbits = 12; gv_local.lookup_slx_int[  69].bits = 0xCA500000;
-  gv_local.lookup_slx_int[  70].nbits = 12; gv_local.lookup_slx_int[  70].bits = 0xCB600000;
-  gv_local.lookup_slx_int[  71].nbits = 12; gv_local.lookup_slx_int[  71].bits = 0xCB700000;
-  gv_local.lookup_slx_int[  72].nbits = 12; gv_local.lookup_slx_int[  72].bits = 0xCFF00000;
-  gv_local.lookup_slx_int[  73].nbits = 12; gv_local.lookup_slx_int[  73].bits = 0xD9900000;
-  gv_local.lookup_slx_int[  74].nbits = 12; gv_local.lookup_slx_int[  74].bits = 0xD9800000;
-  gv_local.lookup_slx_int[  75].nbits = 12; gv_local.lookup_slx_int[  75].bits = 0xDA300000;
-  gv_local.lookup_slx_int[  76].nbits = 11; gv_local.lookup_slx_int[  76].bits = 0x02800000;
-  gv_local.lookup_slx_int[  77].nbits = 11; gv_local.lookup_slx_int[  77].bits = 0x02A00000;
-  gv_local.lookup_slx_int[  78].nbits = 11; gv_local.lookup_slx_int[  78].bits = 0x0C600000;
-  gv_local.lookup_slx_int[  79].nbits = 11; gv_local.lookup_slx_int[  79].bits = 0x09800000;
-  gv_local.lookup_slx_int[  80].nbits = 11; gv_local.lookup_slx_int[  80].bits = 0x0D600000;
-  gv_local.lookup_slx_int[  81].nbits = 11; gv_local.lookup_slx_int[  81].bits = 0x11200000;
-  gv_local.lookup_slx_int[  82].nbits = 11; gv_local.lookup_slx_int[  82].bits = 0x1AA00000;
-  gv_local.lookup_slx_int[  83].nbits = 11; gv_local.lookup_slx_int[  83].bits = 0x27800000;
-  gv_local.lookup_slx_int[  84].nbits = 11; gv_local.lookup_slx_int[  84].bits = 0x29400000;
-  gv_local.lookup_slx_int[  85].nbits = 11; gv_local.lookup_slx_int[  85].bits = 0x29A00000;
-  gv_local.lookup_slx_int[  86].nbits = 11; gv_local.lookup_slx_int[  86].bits = 0x32800000;
-  gv_local.lookup_slx_int[  87].nbits = 11; gv_local.lookup_slx_int[  87].bits = 0x3C600000;
-  gv_local.lookup_slx_int[  88].nbits = 11; gv_local.lookup_slx_int[  88].bits = 0x42000000;
-  gv_local.lookup_slx_int[  89].nbits = 11; gv_local.lookup_slx_int[  89].bits = 0x42E00000;
-  gv_local.lookup_slx_int[  90].nbits = 11; gv_local.lookup_slx_int[  90].bits = 0x4C200000;
-  gv_local.lookup_slx_int[  91].nbits = 11; gv_local.lookup_slx_int[  91].bits = 0x4E400000;
-  gv_local.lookup_slx_int[  92].nbits = 11; gv_local.lookup_slx_int[  92].bits = 0x58600000;
-  gv_local.lookup_slx_int[  93].nbits = 11; gv_local.lookup_slx_int[  93].bits = 0x58400000;
-  gv_local.lookup_slx_int[  94].nbits = 11; gv_local.lookup_slx_int[  94].bits = 0x58A00000;
-  gv_local.lookup_slx_int[  95].nbits = 11; gv_local.lookup_slx_int[  95].bits = 0x63E00000;
-  gv_local.lookup_slx_int[  96].nbits = 11; gv_local.lookup_slx_int[  96].bits = 0x65800000;
-  gv_local.lookup_slx_int[  97].nbits = 11; gv_local.lookup_slx_int[  97].bits = 0x6D200000;
-  gv_local.lookup_slx_int[  98].nbits = 11; gv_local.lookup_slx_int[  98].bits = 0x6D400000;
-  gv_local.lookup_slx_int[  99].nbits = 11; gv_local.lookup_slx_int[  99].bits = 0x75C00000;
-  gv_local.lookup_slx_int[ 100].nbits = 11; gv_local.lookup_slx_int[ 100].bits = 0x75E00000;
-  gv_local.lookup_slx_int[ 101].nbits = 11; gv_local.lookup_slx_int[ 101].bits = 0x84A00000;
-  gv_local.lookup_slx_int[ 102].nbits = 11; gv_local.lookup_slx_int[ 102].bits = 0x87200000;
-  gv_local.lookup_slx_int[ 103].nbits = 11; gv_local.lookup_slx_int[ 103].bits = 0x87E00000;
-  gv_local.lookup_slx_int[ 104].nbits = 11; gv_local.lookup_slx_int[ 104].bits = 0x8DE00000;
-  gv_local.lookup_slx_int[ 105].nbits = 11; gv_local.lookup_slx_int[ 105].bits = 0x90400000;
-  gv_local.lookup_slx_int[ 106].nbits = 11; gv_local.lookup_slx_int[ 106].bits = 0x91E00000;
-  gv_local.lookup_slx_int[ 107].nbits = 11; gv_local.lookup_slx_int[ 107].bits = 0x9CC00000;
-  gv_local.lookup_slx_int[ 108].nbits = 11; gv_local.lookup_slx_int[ 108].bits = 0x9CE00000;
-  gv_local.lookup_slx_int[ 109].nbits = 11; gv_local.lookup_slx_int[ 109].bits = 0xA3000000;
-  gv_local.lookup_slx_int[ 110].nbits = 11; gv_local.lookup_slx_int[ 110].bits = 0xA3A00000;
-  gv_local.lookup_slx_int[ 111].nbits = 11; gv_local.lookup_slx_int[ 111].bits = 0xA4800000;
-  gv_local.lookup_slx_int[ 112].nbits = 11; gv_local.lookup_slx_int[ 112].bits = 0xA4E00000;
-  gv_local.lookup_slx_int[ 113].nbits = 11; gv_local.lookup_slx_int[ 113].bits = 0xA7E00000;
-  gv_local.lookup_slx_int[ 114].nbits = 11; gv_local.lookup_slx_int[ 114].bits = 0xAE000000;
-  gv_local.lookup_slx_int[ 115].nbits = 11; gv_local.lookup_slx_int[ 115].bits = 0xB1A00000;
-  gv_local.lookup_slx_int[ 116].nbits = 11; gv_local.lookup_slx_int[ 116].bits = 0xB3A00000;
-  gv_local.lookup_slx_int[ 117].nbits = 11; gv_local.lookup_slx_int[ 117].bits = 0xB6A00000;
-  gv_local.lookup_slx_int[ 118].nbits = 11; gv_local.lookup_slx_int[ 118].bits = 0xBD000000;
-  gv_local.lookup_slx_int[ 119].nbits = 11; gv_local.lookup_slx_int[ 119].bits = 0xBA600000;
-  gv_local.lookup_slx_int[ 120].nbits = 11; gv_local.lookup_slx_int[ 120].bits = 0xBF000000;
-  gv_local.lookup_slx_int[ 121].nbits = 11; gv_local.lookup_slx_int[ 121].bits = 0xBF200000;
-  gv_local.lookup_slx_int[ 122].nbits = 11; gv_local.lookup_slx_int[ 122].bits = 0xC1800000;
-  gv_local.lookup_slx_int[ 123].nbits = 11; gv_local.lookup_slx_int[ 123].bits = 0xC1C00000;
-  gv_local.lookup_slx_int[ 124].nbits = 11; gv_local.lookup_slx_int[ 124].bits = 0xC9600000;
-  gv_local.lookup_slx_int[ 125].nbits = 11; gv_local.lookup_slx_int[ 125].bits = 0xCA600000;
-  gv_local.lookup_slx_int[ 126].nbits = 11; gv_local.lookup_slx_int[ 126].bits = 0xCD000000;
-  gv_local.lookup_slx_int[ 127].nbits = 11; gv_local.lookup_slx_int[ 127].bits = 0xCF800000;
-  gv_local.lookup_slx_int[ 128].nbits = 11; gv_local.lookup_slx_int[ 128].bits = 0xCF400000;
-  gv_local.lookup_slx_int[ 129].nbits = 11; gv_local.lookup_slx_int[ 129].bits = 0xD2200000;
-  gv_local.lookup_slx_int[ 130].nbits = 11; gv_local.lookup_slx_int[ 130].bits = 0xD6800000;
-  gv_local.lookup_slx_int[ 131].nbits = 11; gv_local.lookup_slx_int[ 131].bits = 0xD6A00000;
-  gv_local.lookup_slx_int[ 132].nbits = 11; gv_local.lookup_slx_int[ 132].bits = 0xD9A00000;
-  gv_local.lookup_slx_int[ 133].nbits = 11; gv_local.lookup_slx_int[ 133].bits = 0xDBA00000;
-  gv_local.lookup_slx_int[ 134].nbits = 11; gv_local.lookup_slx_int[ 134].bits = 0xDBE00000;
-  gv_local.lookup_slx_int[ 135].nbits = 10; gv_local.lookup_slx_int[ 135].bits = 0x08400000;
-  gv_local.lookup_slx_int[ 136].nbits = 10; gv_local.lookup_slx_int[ 136].bits = 0x08C00000;
-  gv_local.lookup_slx_int[ 137].nbits = 10; gv_local.lookup_slx_int[ 137].bits = 0x0A000000;
-  gv_local.lookup_slx_int[ 138].nbits = 10; gv_local.lookup_slx_int[ 138].bits = 0x0C000000;
-  gv_local.lookup_slx_int[ 139].nbits = 10; gv_local.lookup_slx_int[ 139].bits = 0x0D000000;
-  gv_local.lookup_slx_int[ 140].nbits = 10; gv_local.lookup_slx_int[ 140].bits = 0x18000000;
-  gv_local.lookup_slx_int[ 141].nbits = 10; gv_local.lookup_slx_int[ 141].bits = 0x1AC00000;
-  gv_local.lookup_slx_int[ 142].nbits = 10; gv_local.lookup_slx_int[ 142].bits = 0x21400000;
-  gv_local.lookup_slx_int[ 143].nbits = 10; gv_local.lookup_slx_int[ 143].bits = 0x21800000;
-  gv_local.lookup_slx_int[ 144].nbits = 10; gv_local.lookup_slx_int[ 144].bits = 0x26000000;
-  gv_local.lookup_slx_int[ 145].nbits = 10; gv_local.lookup_slx_int[ 145].bits = 0x2B800000;
-  gv_local.lookup_slx_int[ 146].nbits = 10; gv_local.lookup_slx_int[ 146].bits = 0x32C00000;
-  gv_local.lookup_slx_int[ 147].nbits = 10; gv_local.lookup_slx_int[ 147].bits = 0x34800000;
-  gv_local.lookup_slx_int[ 148].nbits = 10; gv_local.lookup_slx_int[ 148].bits = 0x3CC00000;
-  gv_local.lookup_slx_int[ 149].nbits = 10; gv_local.lookup_slx_int[ 149].bits = 0x3E800000;
-  gv_local.lookup_slx_int[ 150].nbits = 10; gv_local.lookup_slx_int[ 150].bits = 0x49C00000;
-  gv_local.lookup_slx_int[ 151].nbits = 10; gv_local.lookup_slx_int[ 151].bits = 0x48C00000;
-  gv_local.lookup_slx_int[ 152].nbits = 10; gv_local.lookup_slx_int[ 152].bits = 0x49800000;
-  gv_local.lookup_slx_int[ 153].nbits = 10; gv_local.lookup_slx_int[ 153].bits = 0x4E800000;
-  gv_local.lookup_slx_int[ 154].nbits = 10; gv_local.lookup_slx_int[ 154].bits = 0x56400000;
-  gv_local.lookup_slx_int[ 155].nbits = 10; gv_local.lookup_slx_int[ 155].bits = 0x5BC00000;
-  gv_local.lookup_slx_int[ 156].nbits = 10; gv_local.lookup_slx_int[ 156].bits = 0x59400000;
-  gv_local.lookup_slx_int[ 157].nbits = 10; gv_local.lookup_slx_int[ 157].bits = 0x63800000;
-  gv_local.lookup_slx_int[ 158].nbits = 10; gv_local.lookup_slx_int[ 158].bits = 0x64C00000;
-  gv_local.lookup_slx_int[ 159].nbits = 10; gv_local.lookup_slx_int[ 159].bits = 0x6F400000;
-  gv_local.lookup_slx_int[ 160].nbits = 10; gv_local.lookup_slx_int[ 160].bits = 0x6FC00000;
-  gv_local.lookup_slx_int[ 161].nbits = 10; gv_local.lookup_slx_int[ 161].bits = 0x75400000;
-  gv_local.lookup_slx_int[ 162].nbits = 10; gv_local.lookup_slx_int[ 162].bits = 0x84C00000;
-  gv_local.lookup_slx_int[ 163].nbits = 10; gv_local.lookup_slx_int[ 163].bits = 0x86800000;
-  gv_local.lookup_slx_int[ 164].nbits = 10; gv_local.lookup_slx_int[ 164].bits = 0x87400000;
-  gv_local.lookup_slx_int[ 165].nbits = 10; gv_local.lookup_slx_int[ 165].bits = 0x87800000;
-  gv_local.lookup_slx_int[ 166].nbits = 10; gv_local.lookup_slx_int[ 166].bits = 0x8D800000;
-  gv_local.lookup_slx_int[ 167].nbits = 10; gv_local.lookup_slx_int[ 167].bits = 0x93C00000;
-  gv_local.lookup_slx_int[ 168].nbits = 10; gv_local.lookup_slx_int[ 168].bits = 0x95400000;
-  gv_local.lookup_slx_int[ 169].nbits = 10; gv_local.lookup_slx_int[ 169].bits = 0x9C000000;
-  gv_local.lookup_slx_int[ 170].nbits = 10; gv_local.lookup_slx_int[ 170].bits = 0xA2400000;
-  gv_local.lookup_slx_int[ 171].nbits = 10; gv_local.lookup_slx_int[ 171].bits = 0xA3C00000;
-  gv_local.lookup_slx_int[ 172].nbits = 10; gv_local.lookup_slx_int[ 172].bits = 0xA5000000;
-  gv_local.lookup_slx_int[ 173].nbits = 10; gv_local.lookup_slx_int[ 173].bits = 0xA7800000;
-  gv_local.lookup_slx_int[ 174].nbits = 10; gv_local.lookup_slx_int[ 174].bits = 0xAF000000;
-  gv_local.lookup_slx_int[ 175].nbits = 10; gv_local.lookup_slx_int[ 175].bits = 0xAF800000;
-  gv_local.lookup_slx_int[ 176].nbits = 10; gv_local.lookup_slx_int[ 176].bits = 0xB3C00000;
-  gv_local.lookup_slx_int[ 177].nbits = 10; gv_local.lookup_slx_int[ 177].bits = 0xB6C00000;
-  gv_local.lookup_slx_int[ 178].nbits = 10; gv_local.lookup_slx_int[ 178].bits = 0xBA000000;
-  gv_local.lookup_slx_int[ 179].nbits = 10; gv_local.lookup_slx_int[ 179].bits = 0xBF400000;
-  gv_local.lookup_slx_int[ 180].nbits = 10; gv_local.lookup_slx_int[ 180].bits = 0xC1000000;
-  gv_local.lookup_slx_int[ 181].nbits = 10; gv_local.lookup_slx_int[ 181].bits = 0xC5000000;
-  gv_local.lookup_slx_int[ 182].nbits = 10; gv_local.lookup_slx_int[ 182].bits = 0xCA000000;
-  gv_local.lookup_slx_int[ 183].nbits = 10; gv_local.lookup_slx_int[ 183].bits = 0xCB000000;
-  gv_local.lookup_slx_int[ 184].nbits = 10; gv_local.lookup_slx_int[ 184].bits = 0xD2400000;
-  gv_local.lookup_slx_int[ 185].nbits = 10; gv_local.lookup_slx_int[ 185].bits = 0xD3800000;
-  gv_local.lookup_slx_int[ 186].nbits = 10; gv_local.lookup_slx_int[ 186].bits = 0xD6C00000;
-  gv_local.lookup_slx_int[ 187].nbits = 10; gv_local.lookup_slx_int[ 187].bits = 0xDB000000;
-  gv_local.lookup_slx_int[ 188].nbits = 10; gv_local.lookup_slx_int[ 188].bits = 0xDEC00000;
-  gv_local.lookup_slx_int[ 189].nbits =  9; gv_local.lookup_slx_int[ 189].bits = 0x09000000;
-  gv_local.lookup_slx_int[ 190].nbits =  9; gv_local.lookup_slx_int[ 190].bits = 0x0C800000;
-  gv_local.lookup_slx_int[ 191].nbits =  9; gv_local.lookup_slx_int[ 191].bits = 0x18800000;
-  gv_local.lookup_slx_int[ 192].nbits =  9; gv_local.lookup_slx_int[ 192].bits = 0x1B800000;
-  gv_local.lookup_slx_int[ 193].nbits =  9; gv_local.lookup_slx_int[ 193].bits = 0x27000000;
-  gv_local.lookup_slx_int[ 194].nbits =  9; gv_local.lookup_slx_int[ 194].bits = 0x32000000;
-  gv_local.lookup_slx_int[ 195].nbits =  9; gv_local.lookup_slx_int[ 195].bits = 0x3D000000;
-  gv_local.lookup_slx_int[ 196].nbits =  9; gv_local.lookup_slx_int[ 196].bits = 0x49000000;
-  gv_local.lookup_slx_int[ 197].nbits =  9; gv_local.lookup_slx_int[ 197].bits = 0x4C800000;
-  gv_local.lookup_slx_int[ 198].nbits =  9; gv_local.lookup_slx_int[ 198].bits = 0x56800000;
-  gv_local.lookup_slx_int[ 199].nbits =  9; gv_local.lookup_slx_int[ 199].bits = 0x5B000000;
-  gv_local.lookup_slx_int[ 200].nbits =  9; gv_local.lookup_slx_int[ 200].bits = 0x64000000;
-  gv_local.lookup_slx_int[ 201].nbits =  9; gv_local.lookup_slx_int[ 201].bits = 0x74800000;
-  gv_local.lookup_slx_int[ 202].nbits =  9; gv_local.lookup_slx_int[ 202].bits = 0x7D000000;
-  gv_local.lookup_slx_int[ 203].nbits =  9; gv_local.lookup_slx_int[ 203].bits = 0x89000000;
-  gv_local.lookup_slx_int[ 204].nbits =  9; gv_local.lookup_slx_int[ 204].bits = 0x90800000;
-  gv_local.lookup_slx_int[ 205].nbits =  9; gv_local.lookup_slx_int[ 205].bits = 0x95800000;
-  gv_local.lookup_slx_int[ 206].nbits =  9; gv_local.lookup_slx_int[ 206].bits = 0xA2800000;
-  gv_local.lookup_slx_int[ 207].nbits =  9; gv_local.lookup_slx_int[ 207].bits = 0xA7000000;
-  gv_local.lookup_slx_int[ 208].nbits =  9; gv_local.lookup_slx_int[ 208].bits = 0xAE800000;
-  gv_local.lookup_slx_int[ 209].nbits =  9; gv_local.lookup_slx_int[ 209].bits = 0xB3000000;
-  gv_local.lookup_slx_int[ 210].nbits =  9; gv_local.lookup_slx_int[ 210].bits = 0xBB000000;
-  gv_local.lookup_slx_int[ 211].nbits =  9; gv_local.lookup_slx_int[ 211].bits = 0xBF800000;
-  gv_local.lookup_slx_int[ 212].nbits =  9; gv_local.lookup_slx_int[ 212].bits = 0xC5800000;
-  gv_local.lookup_slx_int[ 213].nbits =  9; gv_local.lookup_slx_int[ 213].bits = 0xCB800000;
-  gv_local.lookup_slx_int[ 214].nbits =  9; gv_local.lookup_slx_int[ 214].bits = 0xD3000000;
-  gv_local.lookup_slx_int[ 215].nbits =  9; gv_local.lookup_slx_int[ 215].bits = 0xD9000000;
-  gv_local.lookup_slx_int[ 216].nbits =  9; gv_local.lookup_slx_int[ 216].bits = 0xDE000000;
-  gv_local.lookup_slx_int[ 217].nbits =  8; gv_local.lookup_slx_int[ 217].bits = 0x0B000000;
-  gv_local.lookup_slx_int[ 218].nbits =  8; gv_local.lookup_slx_int[ 218].bits = 0x19000000;
-  gv_local.lookup_slx_int[ 219].nbits =  8; gv_local.lookup_slx_int[ 219].bits = 0x28000000;
-  gv_local.lookup_slx_int[ 220].nbits =  8; gv_local.lookup_slx_int[ 220].bits = 0x33000000;
-  gv_local.lookup_slx_int[ 221].nbits =  8; gv_local.lookup_slx_int[ 221].bits = 0x3F000000;
-  gv_local.lookup_slx_int[ 222].nbits =  8; gv_local.lookup_slx_int[ 222].bits = 0x4D000000;
-  gv_local.lookup_slx_int[ 223].nbits =  8; gv_local.lookup_slx_int[ 223].bits = 0x5A000000;
-  gv_local.lookup_slx_int[ 224].nbits =  8; gv_local.lookup_slx_int[ 224].bits = 0x6C000000;
-  gv_local.lookup_slx_int[ 225].nbits =  8; gv_local.lookup_slx_int[ 225].bits = 0x7C000000;
-  gv_local.lookup_slx_int[ 226].nbits =  8; gv_local.lookup_slx_int[ 226].bits = 0x88000000;
-  gv_local.lookup_slx_int[ 227].nbits =  8; gv_local.lookup_slx_int[ 227].bits = 0x94000000;
-  gv_local.lookup_slx_int[ 228].nbits =  8; gv_local.lookup_slx_int[ 228].bits = 0xA1000000;
-  gv_local.lookup_slx_int[ 229].nbits =  8; gv_local.lookup_slx_int[ 229].bits = 0xA8000000;
-  gv_local.lookup_slx_int[ 230].nbits =  8; gv_local.lookup_slx_int[ 230].bits = 0xB2000000;
-  gv_local.lookup_slx_int[ 231].nbits =  8; gv_local.lookup_slx_int[ 231].bits = 0xBC000000;
-  gv_local.lookup_slx_int[ 232].nbits =  8; gv_local.lookup_slx_int[ 232].bits = 0xC4000000;
-  gv_local.lookup_slx_int[ 233].nbits =  8; gv_local.lookup_slx_int[ 233].bits = 0xCC000000;
-  gv_local.lookup_slx_int[ 234].nbits =  8; gv_local.lookup_slx_int[ 234].bits = 0xD7000000;
-  gv_local.lookup_slx_int[ 235].nbits =  7; gv_local.lookup_slx_int[ 235].bits = 0x00000000;
-  gv_local.lookup_slx_int[ 236].nbits =  7; gv_local.lookup_slx_int[ 236].bits = 0x12000000;
-  gv_local.lookup_slx_int[ 237].nbits =  7; gv_local.lookup_slx_int[ 237].bits = 0x24000000;
-  gv_local.lookup_slx_int[ 238].nbits =  7; gv_local.lookup_slx_int[ 238].bits = 0x36000000;
-  gv_local.lookup_slx_int[ 239].nbits =  7; gv_local.lookup_slx_int[ 239].bits = 0x4A000000;
-  gv_local.lookup_slx_int[ 240].nbits =  7; gv_local.lookup_slx_int[ 240].bits = 0x60000000;
-  gv_local.lookup_slx_int[ 241].nbits =  7; gv_local.lookup_slx_int[ 241].bits = 0x76000000;
-  gv_local.lookup_slx_int[ 242].nbits =  7; gv_local.lookup_slx_int[ 242].bits = 0x8A000000;
-  gv_local.lookup_slx_int[ 243].nbits =  7; gv_local.lookup_slx_int[ 243].bits = 0x96000000;
-  gv_local.lookup_slx_int[ 244].nbits =  7; gv_local.lookup_slx_int[ 244].bits = 0xAA000000;
-  gv_local.lookup_slx_int[ 245].nbits =  7; gv_local.lookup_slx_int[ 245].bits = 0xB4000000;
-  gv_local.lookup_slx_int[ 246].nbits =  7; gv_local.lookup_slx_int[ 246].bits = 0xC2000000;
-  gv_local.lookup_slx_int[ 247].nbits =  7; gv_local.lookup_slx_int[ 247].bits = 0xD0000000;
-  gv_local.lookup_slx_int[ 248].nbits =  7; gv_local.lookup_slx_int[ 248].bits = 0xDC000000;
-  gv_local.lookup_slx_int[ 249].nbits =  6; gv_local.lookup_slx_int[ 249].bits = 0x14000000;
-  gv_local.lookup_slx_int[ 250].nbits =  6; gv_local.lookup_slx_int[ 250].bits = 0x2C000000;
-  gv_local.lookup_slx_int[ 251].nbits =  6; gv_local.lookup_slx_int[ 251].bits = 0x44000000;
-  gv_local.lookup_slx_int[ 252].nbits =  6; gv_local.lookup_slx_int[ 252].bits = 0x5C000000;
-  gv_local.lookup_slx_int[ 253].nbits =  6; gv_local.lookup_slx_int[ 253].bits = 0x70000000;
-  gv_local.lookup_slx_int[ 254].nbits =  6; gv_local.lookup_slx_int[ 254].bits = 0x80000000;
-  gv_local.lookup_slx_int[ 255].nbits =  6; gv_local.lookup_slx_int[ 255].bits = 0x98000000;
-  gv_local.lookup_slx_int[ 256].nbits =  6; gv_local.lookup_slx_int[ 256].bits = 0x78000000;
-  gv_local.lookup_slx_int[ 257].nbits =  6; gv_local.lookup_slx_int[ 257].bits = 0x68000000;
-  gv_local.lookup_slx_int[ 258].nbits =  6; gv_local.lookup_slx_int[ 258].bits = 0x50000000;
-  gv_local.lookup_slx_int[ 259].nbits =  6; gv_local.lookup_slx_int[ 259].bits = 0x38000000;
-  gv_local.lookup_slx_int[ 260].nbits =  6; gv_local.lookup_slx_int[ 260].bits = 0x1C000000;
-  gv_local.lookup_slx_int[ 261].nbits =  6; gv_local.lookup_slx_int[ 261].bits = 0x04000000;
-  gv_local.lookup_slx_int[ 262].nbits =  7; gv_local.lookup_slx_int[ 262].bits = 0xD4000000;
-  gv_local.lookup_slx_int[ 263].nbits =  7; gv_local.lookup_slx_int[ 263].bits = 0xC6000000;
-  gv_local.lookup_slx_int[ 264].nbits =  7; gv_local.lookup_slx_int[ 264].bits = 0xB8000000;
-  gv_local.lookup_slx_int[ 265].nbits =  7; gv_local.lookup_slx_int[ 265].bits = 0xAC000000;
-  gv_local.lookup_slx_int[ 266].nbits =  7; gv_local.lookup_slx_int[ 266].bits = 0x9E000000;
-  gv_local.lookup_slx_int[ 267].nbits =  7; gv_local.lookup_slx_int[ 267].bits = 0x8E000000;
-  gv_local.lookup_slx_int[ 268].nbits =  7; gv_local.lookup_slx_int[ 268].bits = 0x7E000000;
-  gv_local.lookup_slx_int[ 269].nbits =  7; gv_local.lookup_slx_int[ 269].bits = 0x66000000;
-  gv_local.lookup_slx_int[ 270].nbits =  7; gv_local.lookup_slx_int[ 270].bits = 0x54000000;
-  gv_local.lookup_slx_int[ 271].nbits =  7; gv_local.lookup_slx_int[ 271].bits = 0x40000000;
-  gv_local.lookup_slx_int[ 272].nbits =  7; gv_local.lookup_slx_int[ 272].bits = 0x30000000;
-  gv_local.lookup_slx_int[ 273].nbits =  7; gv_local.lookup_slx_int[ 273].bits = 0x22000000;
-  gv_local.lookup_slx_int[ 274].nbits =  7; gv_local.lookup_slx_int[ 274].bits = 0x0E000000;
-  gv_local.lookup_slx_int[ 275].nbits =  8; gv_local.lookup_slx_int[ 275].bits = 0xDF000000;
-  gv_local.lookup_slx_int[ 276].nbits =  8; gv_local.lookup_slx_int[ 276].bits = 0xD8000000;
-  gv_local.lookup_slx_int[ 277].nbits =  8; gv_local.lookup_slx_int[ 277].bits = 0xCE000000;
-  gv_local.lookup_slx_int[ 278].nbits =  8; gv_local.lookup_slx_int[ 278].bits = 0xC8000000;
-  gv_local.lookup_slx_int[ 279].nbits =  8; gv_local.lookup_slx_int[ 279].bits = 0xBE000000;
-  gv_local.lookup_slx_int[ 280].nbits =  8; gv_local.lookup_slx_int[ 280].bits = 0xB7000000;
-  gv_local.lookup_slx_int[ 281].nbits =  8; gv_local.lookup_slx_int[ 281].bits = 0xB0000000;
-  gv_local.lookup_slx_int[ 282].nbits =  8; gv_local.lookup_slx_int[ 282].bits = 0xA6000000;
-  gv_local.lookup_slx_int[ 283].nbits =  8; gv_local.lookup_slx_int[ 283].bits = 0xA0000000;
-  gv_local.lookup_slx_int[ 284].nbits =  8; gv_local.lookup_slx_int[ 284].bits = 0x92000000;
-  gv_local.lookup_slx_int[ 285].nbits =  8; gv_local.lookup_slx_int[ 285].bits = 0x8C000000;
-  gv_local.lookup_slx_int[ 286].nbits =  8; gv_local.lookup_slx_int[ 286].bits = 0x85000000;
-  gv_local.lookup_slx_int[ 287].nbits =  8; gv_local.lookup_slx_int[ 287].bits = 0x6E000000;
-  gv_local.lookup_slx_int[ 288].nbits =  8; gv_local.lookup_slx_int[ 288].bits = 0x62000000;
-  gv_local.lookup_slx_int[ 289].nbits =  8; gv_local.lookup_slx_int[ 289].bits = 0x57000000;
-  gv_local.lookup_slx_int[ 290].nbits =  8; gv_local.lookup_slx_int[ 290].bits = 0x43000000;
-  gv_local.lookup_slx_int[ 291].nbits =  8; gv_local.lookup_slx_int[ 291].bits = 0x35000000;
-  gv_local.lookup_slx_int[ 292].nbits =  8; gv_local.lookup_slx_int[ 292].bits = 0x2A000000;
-  gv_local.lookup_slx_int[ 293].nbits =  8; gv_local.lookup_slx_int[ 293].bits = 0x20000000;
-  gv_local.lookup_slx_int[ 294].nbits =  8; gv_local.lookup_slx_int[ 294].bits = 0x10000000;
-  gv_local.lookup_slx_int[ 295].nbits =  8; gv_local.lookup_slx_int[ 295].bits = 0x03000000;
-  gv_local.lookup_slx_int[ 296].nbits =  9; gv_local.lookup_slx_int[ 296].bits = 0xDA800000;
-  gv_local.lookup_slx_int[ 297].nbits =  9; gv_local.lookup_slx_int[ 297].bits = 0xD6000000;
-  gv_local.lookup_slx_int[ 298].nbits =  9; gv_local.lookup_slx_int[ 298].bits = 0xCD800000;
-  gv_local.lookup_slx_int[ 299].nbits =  9; gv_local.lookup_slx_int[ 299].bits = 0xC9800000;
-  gv_local.lookup_slx_int[ 300].nbits =  9; gv_local.lookup_slx_int[ 300].bits = 0xC0800000;
-  gv_local.lookup_slx_int[ 301].nbits =  9; gv_local.lookup_slx_int[ 301].bits = 0xBA800000;
-  gv_local.lookup_slx_int[ 302].nbits =  9; gv_local.lookup_slx_int[ 302].bits = 0xB1000000;
-  gv_local.lookup_slx_int[ 303].nbits =  9; gv_local.lookup_slx_int[ 303].bits = 0xA9800000;
-  gv_local.lookup_slx_int[ 304].nbits =  9; gv_local.lookup_slx_int[ 304].bits = 0xA4000000;
-  gv_local.lookup_slx_int[ 305].nbits =  9; gv_local.lookup_slx_int[ 305].bits = 0x9D000000;
-  gv_local.lookup_slx_int[ 306].nbits =  9; gv_local.lookup_slx_int[ 306].bits = 0x93000000;
-  gv_local.lookup_slx_int[ 307].nbits =  9; gv_local.lookup_slx_int[ 307].bits = 0x8D000000;
-  gv_local.lookup_slx_int[ 308].nbits =  9; gv_local.lookup_slx_int[ 308].bits = 0x84000000;
-  gv_local.lookup_slx_int[ 309].nbits =  9; gv_local.lookup_slx_int[ 309].bits = 0x74000000;
-  gv_local.lookup_slx_int[ 310].nbits =  9; gv_local.lookup_slx_int[ 310].bits = 0x65000000;
-  gv_local.lookup_slx_int[ 311].nbits =  9; gv_local.lookup_slx_int[ 311].bits = 0x59800000;
-  gv_local.lookup_slx_int[ 312].nbits =  9; gv_local.lookup_slx_int[ 312].bits = 0x4F800000;
-  gv_local.lookup_slx_int[ 313].nbits =  9; gv_local.lookup_slx_int[ 313].bits = 0x48000000;
-  gv_local.lookup_slx_int[ 314].nbits =  9; gv_local.lookup_slx_int[ 314].bits = 0x3D800000;
-  gv_local.lookup_slx_int[ 315].nbits =  9; gv_local.lookup_slx_int[ 315].bits = 0x34000000;
-  gv_local.lookup_slx_int[ 316].nbits =  9; gv_local.lookup_slx_int[ 316].bits = 0x26800000;
-  gv_local.lookup_slx_int[ 317].nbits =  9; gv_local.lookup_slx_int[ 317].bits = 0x1B000000;
-  gv_local.lookup_slx_int[ 318].nbits =  9; gv_local.lookup_slx_int[ 318].bits = 0x11800000;
-  gv_local.lookup_slx_int[ 319].nbits =  9; gv_local.lookup_slx_int[ 319].bits = 0x0A800000;
-  gv_local.lookup_slx_int[ 320].nbits =  9; gv_local.lookup_slx_int[ 320].bits = 0x02000000;
-  gv_local.lookup_slx_int[ 321].nbits = 10; gv_local.lookup_slx_int[ 321].bits = 0xDB400000;
-  gv_local.lookup_slx_int[ 322].nbits = 10; gv_local.lookup_slx_int[ 322].bits = 0xD9C00000;
-  gv_local.lookup_slx_int[ 323].nbits = 10; gv_local.lookup_slx_int[ 323].bits = 0xD2800000;
-  gv_local.lookup_slx_int[ 324].nbits = 10; gv_local.lookup_slx_int[ 324].bits = 0xCF000000;
-  gv_local.lookup_slx_int[ 325].nbits = 10; gv_local.lookup_slx_int[ 325].bits = 0xCD400000;
-  gv_local.lookup_slx_int[ 326].nbits = 10; gv_local.lookup_slx_int[ 326].bits = 0xCA800000;
-  gv_local.lookup_slx_int[ 327].nbits = 10; gv_local.lookup_slx_int[ 327].bits = 0xC5400000;
-  gv_local.lookup_slx_int[ 328].nbits = 10; gv_local.lookup_slx_int[ 328].bits = 0xC0000000;
-  gv_local.lookup_slx_int[ 329].nbits = 10; gv_local.lookup_slx_int[ 329].bits = 0xBD400000;
-  gv_local.lookup_slx_int[ 330].nbits = 10; gv_local.lookup_slx_int[ 330].bits = 0xBBC00000;
-  gv_local.lookup_slx_int[ 331].nbits = 10; gv_local.lookup_slx_int[ 331].bits = 0xB6400000;
-  gv_local.lookup_slx_int[ 332].nbits = 10; gv_local.lookup_slx_int[ 332].bits = 0xB1C00000;
-  gv_local.lookup_slx_int[ 333].nbits = 10; gv_local.lookup_slx_int[ 333].bits = 0xAFC00000;
-  gv_local.lookup_slx_int[ 334].nbits = 10; gv_local.lookup_slx_int[ 334].bits = 0xAE400000;
-  gv_local.lookup_slx_int[ 335].nbits = 10; gv_local.lookup_slx_int[ 335].bits = 0xA9000000;
-  gv_local.lookup_slx_int[ 336].nbits = 10; gv_local.lookup_slx_int[ 336].bits = 0xA5800000;
-  gv_local.lookup_slx_int[ 337].nbits = 10; gv_local.lookup_slx_int[ 337].bits = 0xA3400000;
-  gv_local.lookup_slx_int[ 338].nbits = 10; gv_local.lookup_slx_int[ 338].bits = 0xA2000000;
-  gv_local.lookup_slx_int[ 339].nbits = 10; gv_local.lookup_slx_int[ 339].bits = 0x9C400000;
-  gv_local.lookup_slx_int[ 340].nbits = 10; gv_local.lookup_slx_int[ 340].bits = 0x93800000;
-  gv_local.lookup_slx_int[ 341].nbits = 10; gv_local.lookup_slx_int[ 341].bits = 0x91800000;
-  gv_local.lookup_slx_int[ 342].nbits = 10; gv_local.lookup_slx_int[ 342].bits = 0x91400000;
-  gv_local.lookup_slx_int[ 343].nbits = 10; gv_local.lookup_slx_int[ 343].bits = 0x90000000;
-  gv_local.lookup_slx_int[ 344].nbits = 10; gv_local.lookup_slx_int[ 344].bits = 0x89800000;
-  gv_local.lookup_slx_int[ 345].nbits = 10; gv_local.lookup_slx_int[ 345].bits = 0x86C00000;
-  gv_local.lookup_slx_int[ 346].nbits = 10; gv_local.lookup_slx_int[ 346].bits = 0x86000000;
-  gv_local.lookup_slx_int[ 347].nbits = 10; gv_local.lookup_slx_int[ 347].bits = 0x7DC00000;
-  gv_local.lookup_slx_int[ 348].nbits = 10; gv_local.lookup_slx_int[ 348].bits = 0x75000000;
-  gv_local.lookup_slx_int[ 349].nbits = 10; gv_local.lookup_slx_int[ 349].bits = 0x6F800000;
-  gv_local.lookup_slx_int[ 350].nbits = 10; gv_local.lookup_slx_int[ 350].bits = 0x6DC00000;
-  gv_local.lookup_slx_int[ 351].nbits = 10; gv_local.lookup_slx_int[ 351].bits = 0x6D800000;
-  gv_local.lookup_slx_int[ 352].nbits = 10; gv_local.lookup_slx_int[ 352].bits = 0x65C00000;
-  gv_local.lookup_slx_int[ 353].nbits = 10; gv_local.lookup_slx_int[ 353].bits = 0x64800000;
-  gv_local.lookup_slx_int[ 354].nbits = 10; gv_local.lookup_slx_int[ 354].bits = 0x63000000;
-  gv_local.lookup_slx_int[ 355].nbits = 10; gv_local.lookup_slx_int[ 355].bits = 0x59000000;
-  gv_local.lookup_slx_int[ 356].nbits = 10; gv_local.lookup_slx_int[ 356].bits = 0x58000000;
-  gv_local.lookup_slx_int[ 357].nbits = 10; gv_local.lookup_slx_int[ 357].bits = 0x4F400000;
-  gv_local.lookup_slx_int[ 358].nbits = 10; gv_local.lookup_slx_int[ 358].bits = 0x4EC00000;
-  gv_local.lookup_slx_int[ 359].nbits = 10; gv_local.lookup_slx_int[ 359].bits = 0x56000000;
-  gv_local.lookup_slx_int[ 360].nbits = 10; gv_local.lookup_slx_int[ 360].bits = 0x4E000000;
-  gv_local.lookup_slx_int[ 361].nbits = 10; gv_local.lookup_slx_int[ 361].bits = 0x42800000;
-  gv_local.lookup_slx_int[ 362].nbits = 10; gv_local.lookup_slx_int[ 362].bits = 0x42400000;
-  gv_local.lookup_slx_int[ 363].nbits = 10; gv_local.lookup_slx_int[ 363].bits = 0x3EC00000;
-  gv_local.lookup_slx_int[ 364].nbits = 10; gv_local.lookup_slx_int[ 364].bits = 0x3E000000;
-  gv_local.lookup_slx_int[ 365].nbits = 10; gv_local.lookup_slx_int[ 365].bits = 0x3C800000;
-  gv_local.lookup_slx_int[ 366].nbits = 10; gv_local.lookup_slx_int[ 366].bits = 0x34C00000;
-  gv_local.lookup_slx_int[ 367].nbits = 10; gv_local.lookup_slx_int[ 367].bits = 0x2BC00000;
-  gv_local.lookup_slx_int[ 368].nbits = 10; gv_local.lookup_slx_int[ 368].bits = 0x2B400000;
-  gv_local.lookup_slx_int[ 369].nbits = 10; gv_local.lookup_slx_int[ 369].bits = 0x29000000;
-  gv_local.lookup_slx_int[ 370].nbits = 10; gv_local.lookup_slx_int[ 370].bits = 0x26400000;
-  gv_local.lookup_slx_int[ 371].nbits = 10; gv_local.lookup_slx_int[ 371].bits = 0x27C00000;
-  gv_local.lookup_slx_int[ 372].nbits = 10; gv_local.lookup_slx_int[ 372].bits = 0x21C00000;
-  gv_local.lookup_slx_int[ 373].nbits = 10; gv_local.lookup_slx_int[ 373].bits = 0x18400000;
-  gv_local.lookup_slx_int[ 374].nbits = 10; gv_local.lookup_slx_int[ 374].bits = 0x1A000000;
-  gv_local.lookup_slx_int[ 375].nbits = 10; gv_local.lookup_slx_int[ 375].bits = 0x11400000;
-  gv_local.lookup_slx_int[ 376].nbits = 10; gv_local.lookup_slx_int[ 376].bits = 0x0DC00000;
-  gv_local.lookup_slx_int[ 377].nbits = 10; gv_local.lookup_slx_int[ 377].bits = 0x0D800000;
-  gv_local.lookup_slx_int[ 378].nbits = 10; gv_local.lookup_slx_int[ 378].bits = 0x0A400000;
-  gv_local.lookup_slx_int[ 379].nbits = 10; gv_local.lookup_slx_int[ 379].bits = 0x09C00000;
-  gv_local.lookup_slx_int[ 380].nbits = 10; gv_local.lookup_slx_int[ 380].bits = 0x08800000;
-  gv_local.lookup_slx_int[ 381].nbits = 10; gv_local.lookup_slx_int[ 381].bits = 0x08000000;
-  gv_local.lookup_slx_int[ 382].nbits = 11; gv_local.lookup_slx_int[ 382].bits = 0xDEA00000;
-  gv_local.lookup_slx_int[ 383].nbits = 11; gv_local.lookup_slx_int[ 383].bits = 0xDBC00000;
-  gv_local.lookup_slx_int[ 384].nbits = 11; gv_local.lookup_slx_int[ 384].bits = 0xDA400000;
-  gv_local.lookup_slx_int[ 385].nbits = 11; gv_local.lookup_slx_int[ 385].bits = 0xDA600000;
-  gv_local.lookup_slx_int[ 386].nbits = 11; gv_local.lookup_slx_int[ 386].bits = 0xDA000000;
-  gv_local.lookup_slx_int[ 387].nbits = 11; gv_local.lookup_slx_int[ 387].bits = 0xD3C00000;
-  gv_local.lookup_slx_int[ 388].nbits = 11; gv_local.lookup_slx_int[ 388].bits = 0xD2E00000;
-  gv_local.lookup_slx_int[ 389].nbits = 11; gv_local.lookup_slx_int[ 389].bits = 0xD2000000;
-  gv_local.lookup_slx_int[ 390].nbits = 11; gv_local.lookup_slx_int[ 390].bits = 0xCFC00000;
-  gv_local.lookup_slx_int[ 391].nbits = 11; gv_local.lookup_slx_int[ 391].bits = 0xCD200000;
-  gv_local.lookup_slx_int[ 392].nbits = 11; gv_local.lookup_slx_int[ 392].bits = 0xCFA00000;
-  gv_local.lookup_slx_int[ 393].nbits = 11; gv_local.lookup_slx_int[ 393].bits = 0xCB400000;
-  gv_local.lookup_slx_int[ 394].nbits = 11; gv_local.lookup_slx_int[ 394].bits = 0xCAC00000;
-  gv_local.lookup_slx_int[ 395].nbits = 11; gv_local.lookup_slx_int[ 395].bits = 0xC9000000;
-  gv_local.lookup_slx_int[ 396].nbits = 11; gv_local.lookup_slx_int[ 396].bits = 0xC9200000;
-  gv_local.lookup_slx_int[ 397].nbits = 11; gv_local.lookup_slx_int[ 397].bits = 0xC1600000;
-  gv_local.lookup_slx_int[ 398].nbits = 11; gv_local.lookup_slx_int[ 398].bits = 0xC1400000;
-  gv_local.lookup_slx_int[ 399].nbits = 11; gv_local.lookup_slx_int[ 399].bits = 0xC0600000;
-  gv_local.lookup_slx_int[ 400].nbits = 11; gv_local.lookup_slx_int[ 400].bits = 0xBDE00000;
-  gv_local.lookup_slx_int[ 401].nbits = 11; gv_local.lookup_slx_int[ 401].bits = 0xBDA00000;
-  gv_local.lookup_slx_int[ 402].nbits = 11; gv_local.lookup_slx_int[ 402].bits = 0xBD200000;
-  gv_local.lookup_slx_int[ 403].nbits = 11; gv_local.lookup_slx_int[ 403].bits = 0xBB800000;
-  gv_local.lookup_slx_int[ 404].nbits = 11; gv_local.lookup_slx_int[ 404].bits = 0xBA400000;
-  gv_local.lookup_slx_int[ 405].nbits = 11; gv_local.lookup_slx_int[ 405].bits = 0xB3800000;
-  gv_local.lookup_slx_int[ 406].nbits = 11; gv_local.lookup_slx_int[ 406].bits = 0xB1800000;
-  gv_local.lookup_slx_int[ 407].nbits = 11; gv_local.lookup_slx_int[ 407].bits = 0xAE200000;
-  gv_local.lookup_slx_int[ 408].nbits = 11; gv_local.lookup_slx_int[ 408].bits = 0xA9600000;
-  gv_local.lookup_slx_int[ 409].nbits = 11; gv_local.lookup_slx_int[ 409].bits = 0xA5400000;
-  gv_local.lookup_slx_int[ 410].nbits = 11; gv_local.lookup_slx_int[ 410].bits = 0xA5C00000;
-  gv_local.lookup_slx_int[ 411].nbits = 11; gv_local.lookup_slx_int[ 411].bits = 0xA5600000;
-  gv_local.lookup_slx_int[ 412].nbits = 11; gv_local.lookup_slx_int[ 412].bits = 0xA4C00000;
-  gv_local.lookup_slx_int[ 413].nbits = 11; gv_local.lookup_slx_int[ 413].bits = 0xA3800000;
-  gv_local.lookup_slx_int[ 414].nbits = 11; gv_local.lookup_slx_int[ 414].bits = 0x9DA00000;
-  gv_local.lookup_slx_int[ 415].nbits = 11; gv_local.lookup_slx_int[ 415].bits = 0x9D800000;
-  gv_local.lookup_slx_int[ 416].nbits = 11; gv_local.lookup_slx_int[ 416].bits = 0x95200000;
-  gv_local.lookup_slx_int[ 417].nbits = 11; gv_local.lookup_slx_int[ 417].bits = 0x9C800000;
-  gv_local.lookup_slx_int[ 418].nbits = 11; gv_local.lookup_slx_int[ 418].bits = 0x90600000;
-  gv_local.lookup_slx_int[ 419].nbits = 11; gv_local.lookup_slx_int[ 419].bits = 0x91C00000;
-  gv_local.lookup_slx_int[ 420].nbits = 11; gv_local.lookup_slx_int[ 420].bits = 0x89E00000;
-  gv_local.lookup_slx_int[ 421].nbits = 11; gv_local.lookup_slx_int[ 421].bits = 0x89C00000;
-  gv_local.lookup_slx_int[ 422].nbits = 11; gv_local.lookup_slx_int[ 422].bits = 0x87000000;
-  gv_local.lookup_slx_int[ 423].nbits = 11; gv_local.lookup_slx_int[ 423].bits = 0x86400000;
-  gv_local.lookup_slx_int[ 424].nbits = 11; gv_local.lookup_slx_int[ 424].bits = 0x7DA00000;
-  gv_local.lookup_slx_int[ 425].nbits = 11; gv_local.lookup_slx_int[ 425].bits = 0x75A00000;
-  gv_local.lookup_slx_int[ 426].nbits = 11; gv_local.lookup_slx_int[ 426].bits = 0x75800000;
-  gv_local.lookup_slx_int[ 427].nbits = 11; gv_local.lookup_slx_int[ 427].bits = 0x6F000000;
-  gv_local.lookup_slx_int[ 428].nbits = 11; gv_local.lookup_slx_int[ 428].bits = 0x65A00000;
-  gv_local.lookup_slx_int[ 429].nbits = 11; gv_local.lookup_slx_int[ 429].bits = 0x63600000;
-  gv_local.lookup_slx_int[ 430].nbits = 11; gv_local.lookup_slx_int[ 430].bits = 0x63C00000;
-  gv_local.lookup_slx_int[ 431].nbits = 11; gv_local.lookup_slx_int[ 431].bits = 0x5B800000;
-  gv_local.lookup_slx_int[ 432].nbits = 11; gv_local.lookup_slx_int[ 432].bits = 0x58E00000;
-  gv_local.lookup_slx_int[ 433].nbits = 11; gv_local.lookup_slx_int[ 433].bits = 0x58800000;
-  gv_local.lookup_slx_int[ 434].nbits = 11; gv_local.lookup_slx_int[ 434].bits = 0x4E600000;
-  gv_local.lookup_slx_int[ 435].nbits = 11; gv_local.lookup_slx_int[ 435].bits = 0x4C600000;
-  gv_local.lookup_slx_int[ 436].nbits = 11; gv_local.lookup_slx_int[ 436].bits = 0x48A00000;
-  gv_local.lookup_slx_int[ 437].nbits = 11; gv_local.lookup_slx_int[ 437].bits = 0x42200000;
-  gv_local.lookup_slx_int[ 438].nbits = 11; gv_local.lookup_slx_int[ 438].bits = 0x42C00000;
-  gv_local.lookup_slx_int[ 439].nbits = 11; gv_local.lookup_slx_int[ 439].bits = 0x3E400000;
-  gv_local.lookup_slx_int[ 440].nbits = 11; gv_local.lookup_slx_int[ 440].bits = 0x3C400000;
-  gv_local.lookup_slx_int[ 441].nbits = 11; gv_local.lookup_slx_int[ 441].bits = 0x32A00000;
-  gv_local.lookup_slx_int[ 442].nbits = 11; gv_local.lookup_slx_int[ 442].bits = 0x29E00000;
-  gv_local.lookup_slx_int[ 443].nbits = 11; gv_local.lookup_slx_int[ 443].bits = 0x29C00000;
-  gv_local.lookup_slx_int[ 444].nbits = 11; gv_local.lookup_slx_int[ 444].bits = 0x29600000;
-  gv_local.lookup_slx_int[ 445].nbits = 11; gv_local.lookup_slx_int[ 445].bits = 0x27A00000;
-  gv_local.lookup_slx_int[ 446].nbits = 11; gv_local.lookup_slx_int[ 446].bits = 0x1A600000;
-  gv_local.lookup_slx_int[ 447].nbits = 11; gv_local.lookup_slx_int[ 447].bits = 0x1A400000;
-  gv_local.lookup_slx_int[ 448].nbits = 11; gv_local.lookup_slx_int[ 448].bits = 0x11000000;
-  gv_local.lookup_slx_int[ 449].nbits = 11; gv_local.lookup_slx_int[ 449].bits = 0x0D400000;
-  gv_local.lookup_slx_int[ 450].nbits = 11; gv_local.lookup_slx_int[ 450].bits = 0x09A00000;
-  gv_local.lookup_slx_int[ 451].nbits = 11; gv_local.lookup_slx_int[ 451].bits = 0x02E00000;
-  gv_local.lookup_slx_int[ 452].nbits = 12; gv_local.lookup_slx_int[ 452].bits = 0xDE800000;
-  gv_local.lookup_slx_int[ 453].nbits = 12; gv_local.lookup_slx_int[ 453].bits = 0xDB900000;
-  gv_local.lookup_slx_int[ 454].nbits = 12; gv_local.lookup_slx_int[ 454].bits = 0xDB800000;
-  gv_local.lookup_slx_int[ 455].nbits = 12; gv_local.lookup_slx_int[ 455].bits = 0xD3E00000;
-  gv_local.lookup_slx_int[ 456].nbits = 12; gv_local.lookup_slx_int[ 456].bits = 0xD3F00000;
-  gv_local.lookup_slx_int[ 457].nbits = 12; gv_local.lookup_slx_int[ 457].bits = 0xCFE00000;
-  gv_local.lookup_slx_int[ 458].nbits = 12; gv_local.lookup_slx_int[ 458].bits = 0xD2D00000;
-  gv_local.lookup_slx_int[ 459].nbits = 12; gv_local.lookup_slx_int[ 459].bits = 0xCF700000;
-  gv_local.lookup_slx_int[ 460].nbits = 12; gv_local.lookup_slx_int[ 460].bits = 0xCAF00000;
-  gv_local.lookup_slx_int[ 461].nbits = 12; gv_local.lookup_slx_int[ 461].bits = 0xCAE00000;
-  gv_local.lookup_slx_int[ 462].nbits = 12; gv_local.lookup_slx_int[ 462].bits = 0xC9500000;
-  gv_local.lookup_slx_int[ 463].nbits = 12; gv_local.lookup_slx_int[ 463].bits = 0xC1B00000;
-  gv_local.lookup_slx_int[ 464].nbits = 12; gv_local.lookup_slx_int[ 464].bits = 0xC0500000;
-  gv_local.lookup_slx_int[ 465].nbits = 12; gv_local.lookup_slx_int[ 465].bits = 0xC0400000;
-  gv_local.lookup_slx_int[ 466].nbits = 12; gv_local.lookup_slx_int[ 466].bits = 0xBDD00000;
-  gv_local.lookup_slx_int[ 467].nbits = 12; gv_local.lookup_slx_int[ 467].bits = 0xBD800000;
-  gv_local.lookup_slx_int[ 468].nbits = 12; gv_local.lookup_slx_int[ 468].bits = 0xB6800000;
-  gv_local.lookup_slx_int[ 469].nbits = 12; gv_local.lookup_slx_int[ 469].bits = 0xB6300000;
-  gv_local.lookup_slx_int[ 470].nbits = 12; gv_local.lookup_slx_int[ 470].bits = 0xB6200000;
-  gv_local.lookup_slx_int[ 471].nbits = 12; gv_local.lookup_slx_int[ 471].bits = 0xAF500000;
-  gv_local.lookup_slx_int[ 472].nbits = 12; gv_local.lookup_slx_int[ 472].bits = 0xA7D00000;
-  gv_local.lookup_slx_int[ 473].nbits = 12; gv_local.lookup_slx_int[ 473].bits = 0xA5F00000;
-  gv_local.lookup_slx_int[ 474].nbits = 12; gv_local.lookup_slx_int[ 474].bits = 0xA9400000;
-  gv_local.lookup_slx_int[ 475].nbits = 12; gv_local.lookup_slx_int[ 475].bits = 0xA4B00000;
-  gv_local.lookup_slx_int[ 476].nbits = 12; gv_local.lookup_slx_int[ 476].bits = 0xA3300000;
-  gv_local.lookup_slx_int[ 477].nbits = 12; gv_local.lookup_slx_int[ 477].bits = 0x9DD00000;
-  gv_local.lookup_slx_int[ 478].nbits = 12; gv_local.lookup_slx_int[ 478].bits = 0x9DC00000;
-  gv_local.lookup_slx_int[ 479].nbits = 12; gv_local.lookup_slx_int[ 479].bits = 0x95100000;
-  gv_local.lookup_slx_int[ 480].nbits = 12; gv_local.lookup_slx_int[ 480].bits = 0x91300000;
-  gv_local.lookup_slx_int[ 481].nbits = 12; gv_local.lookup_slx_int[ 481].bits = 0x91000000;
-  gv_local.lookup_slx_int[ 482].nbits = 12; gv_local.lookup_slx_int[ 482].bits = 0x91200000;
-  gv_local.lookup_slx_int[ 483].nbits = 12; gv_local.lookup_slx_int[ 483].bits = 0x87D00000;
-  gv_local.lookup_slx_int[ 484].nbits = 12; gv_local.lookup_slx_int[ 484].bits = 0x87C00000;
-  gv_local.lookup_slx_int[ 485].nbits = 12; gv_local.lookup_slx_int[ 485].bits = 0x86700000;
-  gv_local.lookup_slx_int[ 486].nbits = 12; gv_local.lookup_slx_int[ 486].bits = 0x7D900000;
-  gv_local.lookup_slx_int[ 487].nbits = 12; gv_local.lookup_slx_int[ 487].bits = 0x84900000;
-  gv_local.lookup_slx_int[ 488].nbits = 12; gv_local.lookup_slx_int[ 488].bits = 0x6F300000;
-  gv_local.lookup_slx_int[ 489].nbits = 12; gv_local.lookup_slx_int[ 489].bits = 0x6D700000;
-  gv_local.lookup_slx_int[ 490].nbits = 12; gv_local.lookup_slx_int[ 490].bits = 0x6D100000;
-  gv_local.lookup_slx_int[ 491].nbits = 12; gv_local.lookup_slx_int[ 491].bits = 0x6D600000;
-  gv_local.lookup_slx_int[ 492].nbits = 12; gv_local.lookup_slx_int[ 492].bits = 0x5BB00000;
-  gv_local.lookup_slx_int[ 493].nbits = 12; gv_local.lookup_slx_int[ 493].bits = 0x63500000;
-  gv_local.lookup_slx_int[ 494].nbits = 12; gv_local.lookup_slx_int[ 494].bits = 0x63400000;
-  gv_local.lookup_slx_int[ 495].nbits = 12; gv_local.lookup_slx_int[ 495].bits = 0x4C500000;
-  gv_local.lookup_slx_int[ 496].nbits = 12; gv_local.lookup_slx_int[ 496].bits = 0x58C00000;
-  gv_local.lookup_slx_int[ 497].nbits = 12; gv_local.lookup_slx_int[ 497].bits = 0x4F200000;
-  gv_local.lookup_slx_int[ 498].nbits = 12; gv_local.lookup_slx_int[ 498].bits = 0x48900000;
-  gv_local.lookup_slx_int[ 499].nbits = 12; gv_local.lookup_slx_int[ 499].bits = 0x48800000;
-  gv_local.lookup_slx_int[ 500].nbits = 12; gv_local.lookup_slx_int[ 500].bits = 0x3E700000;
-  gv_local.lookup_slx_int[ 501].nbits = 12; gv_local.lookup_slx_int[ 501].bits = 0x4C100000;
-  gv_local.lookup_slx_int[ 502].nbits = 12; gv_local.lookup_slx_int[ 502].bits = 0x3C100000;
-  gv_local.lookup_slx_int[ 503].nbits = 12; gv_local.lookup_slx_int[ 503].bits = 0x2B200000;
-  gv_local.lookup_slx_int[ 504].nbits = 12; gv_local.lookup_slx_int[ 504].bits = 0x3C300000;
-  gv_local.lookup_slx_int[ 505].nbits = 12; gv_local.lookup_slx_int[ 505].bits = 0x2B300000;
-  gv_local.lookup_slx_int[ 506].nbits = 12; gv_local.lookup_slx_int[ 506].bits = 0x2B000000;
-  gv_local.lookup_slx_int[ 507].nbits = 12; gv_local.lookup_slx_int[ 507].bits = 0x2B100000;
-  gv_local.lookup_slx_int[ 508].nbits = 12; gv_local.lookup_slx_int[ 508].bits = 0x29800000;
-  gv_local.lookup_slx_int[ 509].nbits = 12; gv_local.lookup_slx_int[ 509].bits = 0x21000000;
-  gv_local.lookup_slx_int[ 510].nbits = 12; gv_local.lookup_slx_int[ 510].bits = 0x21200000;
-  gv_local.lookup_slx_int[ 511].nbits =  3; gv_local.lookup_slx_int[ 511].bits = 0xE0000000;
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_slx_int, 0, sizeof(uint16_t)*REV_HUFF_TREESIZE_16);
-
-  for (i=0; i<INT_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_slx_int[i].bits >> 16;
-    gv_local.rlookup_slx_int [val] = (uint16_t) i;
-    for (j=1; j<=(0xFFFF>>gv_local.lookup_slx_int[i].nbits); j++)
-      gv_local.rlookup_slx_int [val+j] = (uint16_t) i;
-  }
-#endif
-
-  _s_sort_lookup (gv_local.lookup_slx_int, gv_local.idx_slx_int, INT_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_int_initialized = 1;
-}
-/*
- */
-static void _s_init_nse_slx_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uint16_t val;
-#endif
-
-  memset (gv_local.lookup_slx_nse,  0, sizeof(SRALookup)*NSE_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_nse[   0].nbits = 11; gv_local.lookup_slx_nse[   0].bits = 0x6FE00000;
-  gv_local.lookup_slx_nse[   1].nbits = 11; gv_local.lookup_slx_nse[   1].bits = 0x7AC00000;
-  gv_local.lookup_slx_nse[   2].nbits = 11; gv_local.lookup_slx_nse[   2].bits = 0x6FC00000;
-  gv_local.lookup_slx_nse[   3].nbits = 11; gv_local.lookup_slx_nse[   3].bits = 0x7AE00000;
-  gv_local.lookup_slx_nse[   4].nbits = 11; gv_local.lookup_slx_nse[   4].bits = 0xC6A00000;
-  gv_local.lookup_slx_nse[   5].nbits = 11; gv_local.lookup_slx_nse[   5].bits = 0xDFC00000;
-  gv_local.lookup_slx_nse[   6].nbits = 11; gv_local.lookup_slx_nse[   6].bits = 0xD7200000;
-  gv_local.lookup_slx_nse[   7].nbits = 11; gv_local.lookup_slx_nse[   7].bits = 0xE4E00000;
-  gv_local.lookup_slx_nse[   8].nbits = 11; gv_local.lookup_slx_nse[   8].bits = 0xDA000000;
-  gv_local.lookup_slx_nse[   9].nbits = 11; gv_local.lookup_slx_nse[   9].bits = 0xD0000000;
-  gv_local.lookup_slx_nse[  10].nbits = 11; gv_local.lookup_slx_nse[  10].bits = 0xE8000000;
-  gv_local.lookup_slx_nse[  11].nbits = 11; gv_local.lookup_slx_nse[  11].bits = 0xCE400000;
-  gv_local.lookup_slx_nse[  12].nbits = 11; gv_local.lookup_slx_nse[  12].bits = 0xD7000000;
-  gv_local.lookup_slx_nse[  13].nbits = 11; gv_local.lookup_slx_nse[  13].bits = 0xD5000000;
-  gv_local.lookup_slx_nse[  14].nbits = 11; gv_local.lookup_slx_nse[  14].bits = 0xDDE00000;
-  gv_local.lookup_slx_nse[  15].nbits = 11; gv_local.lookup_slx_nse[  15].bits = 0xF2C00000;
-  gv_local.lookup_slx_nse[  16].nbits = 11; gv_local.lookup_slx_nse[  16].bits = 0xF6600000;
-  gv_local.lookup_slx_nse[  17].nbits = 11; gv_local.lookup_slx_nse[  17].bits = 0xEE400000;
-  gv_local.lookup_slx_nse[  18].nbits = 11; gv_local.lookup_slx_nse[  18].bits = 0xE4C00000;
-  gv_local.lookup_slx_nse[  19].nbits = 10; gv_local.lookup_slx_nse[  19].bits = 0x0F000000;
-  gv_local.lookup_slx_nse[  20].nbits = 11; gv_local.lookup_slx_nse[  20].bits = 0xEBC00000;
-  gv_local.lookup_slx_nse[  21].nbits = 11; gv_local.lookup_slx_nse[  21].bits = 0xF7E00000;
-  gv_local.lookup_slx_nse[  22].nbits = 11; gv_local.lookup_slx_nse[  22].bits = 0xF7C00000;
-  gv_local.lookup_slx_nse[  23].nbits = 10; gv_local.lookup_slx_nse[  23].bits = 0x18000000;
-  gv_local.lookup_slx_nse[  24].nbits = 10; gv_local.lookup_slx_nse[  24].bits = 0x22800000;
-  gv_local.lookup_slx_nse[  25].nbits = 10; gv_local.lookup_slx_nse[  25].bits = 0x0A000000;
-  gv_local.lookup_slx_nse[  26].nbits = 10; gv_local.lookup_slx_nse[  26].bits = 0x0F400000;
-  gv_local.lookup_slx_nse[  27].nbits = 10; gv_local.lookup_slx_nse[  27].bits = 0x18400000;
-  gv_local.lookup_slx_nse[  28].nbits = 10; gv_local.lookup_slx_nse[  28].bits = 0x1D800000;
-  gv_local.lookup_slx_nse[  29].nbits = 10; gv_local.lookup_slx_nse[  29].bits = 0x3CC00000;
-  gv_local.lookup_slx_nse[  30].nbits = 10; gv_local.lookup_slx_nse[  30].bits = 0x46C00000;
-  gv_local.lookup_slx_nse[  31].nbits = 10; gv_local.lookup_slx_nse[  31].bits = 0x1DC00000;
-  gv_local.lookup_slx_nse[  32].nbits = 10; gv_local.lookup_slx_nse[  32].bits = 0x42C00000;
-  gv_local.lookup_slx_nse[  33].nbits = 10; gv_local.lookup_slx_nse[  33].bits = 0x3F800000;
-  gv_local.lookup_slx_nse[  34].nbits = 10; gv_local.lookup_slx_nse[  34].bits = 0x3FC00000;
-  gv_local.lookup_slx_nse[  35].nbits = 10; gv_local.lookup_slx_nse[  35].bits = 0x4B800000;
-  gv_local.lookup_slx_nse[  36].nbits = 10; gv_local.lookup_slx_nse[  36].bits = 0x4BC00000;
-  gv_local.lookup_slx_nse[  37].nbits = 10; gv_local.lookup_slx_nse[  37].bits = 0x27C00000;
-  gv_local.lookup_slx_nse[  38].nbits = 10; gv_local.lookup_slx_nse[  38].bits = 0x46400000;
-  gv_local.lookup_slx_nse[  39].nbits = 10; gv_local.lookup_slx_nse[  39].bits = 0x52000000;
-  gv_local.lookup_slx_nse[  40].nbits = 10; gv_local.lookup_slx_nse[  40].bits = 0x58400000;
-  gv_local.lookup_slx_nse[  41].nbits = 10; gv_local.lookup_slx_nse[  41].bits = 0x50800000;
-  gv_local.lookup_slx_nse[  42].nbits = 10; gv_local.lookup_slx_nse[  42].bits = 0x56800000;
-  gv_local.lookup_slx_nse[  43].nbits = 10; gv_local.lookup_slx_nse[  43].bits = 0x56000000;
-  gv_local.lookup_slx_nse[  44].nbits = 10; gv_local.lookup_slx_nse[  44].bits = 0x57000000;
-  gv_local.lookup_slx_nse[  45].nbits = 10; gv_local.lookup_slx_nse[  45].bits = 0x62400000;
-  gv_local.lookup_slx_nse[  46].nbits = 10; gv_local.lookup_slx_nse[  46].bits = 0x56C00000;
-  gv_local.lookup_slx_nse[  47].nbits = 10; gv_local.lookup_slx_nse[  47].bits = 0x57400000;
-  gv_local.lookup_slx_nse[  48].nbits = 10; gv_local.lookup_slx_nse[  48].bits = 0x63800000;
-  gv_local.lookup_slx_nse[  49].nbits = 10; gv_local.lookup_slx_nse[  49].bits = 0x62000000;
-  gv_local.lookup_slx_nse[  50].nbits = 10; gv_local.lookup_slx_nse[  50].bits = 0x5C000000;
-  gv_local.lookup_slx_nse[  51].nbits = 10; gv_local.lookup_slx_nse[  51].bits = 0x60800000;
-  gv_local.lookup_slx_nse[  52].nbits = 10; gv_local.lookup_slx_nse[  52].bits = 0x6B000000;
-  gv_local.lookup_slx_nse[  53].nbits = 10; gv_local.lookup_slx_nse[  53].bits = 0x6B400000;
-  gv_local.lookup_slx_nse[  54].nbits = 10; gv_local.lookup_slx_nse[  54].bits = 0x67C00000;
-  gv_local.lookup_slx_nse[  55].nbits = 10; gv_local.lookup_slx_nse[  55].bits = 0x66400000;
-  gv_local.lookup_slx_nse[  56].nbits = 10; gv_local.lookup_slx_nse[  56].bits = 0x6A400000;
-  gv_local.lookup_slx_nse[  57].nbits = 10; gv_local.lookup_slx_nse[  57].bits = 0x6F800000;
-  gv_local.lookup_slx_nse[  58].nbits = 10; gv_local.lookup_slx_nse[  58].bits = 0x77000000;
-  gv_local.lookup_slx_nse[  59].nbits = 10; gv_local.lookup_slx_nse[  59].bits = 0x76400000;
-  gv_local.lookup_slx_nse[  60].nbits = 10; gv_local.lookup_slx_nse[  60].bits = 0x69800000;
-  gv_local.lookup_slx_nse[  61].nbits = 10; gv_local.lookup_slx_nse[  61].bits = 0x70000000;
-  gv_local.lookup_slx_nse[  62].nbits = 10; gv_local.lookup_slx_nse[  62].bits = 0x6A000000;
-  gv_local.lookup_slx_nse[  63].nbits = 10; gv_local.lookup_slx_nse[  63].bits = 0x76000000;
-  gv_local.lookup_slx_nse[  64].nbits = 10; gv_local.lookup_slx_nse[  64].bits = 0x79400000;
-  gv_local.lookup_slx_nse[  65].nbits = 10; gv_local.lookup_slx_nse[  65].bits = 0x7CC00000;
-  gv_local.lookup_slx_nse[  66].nbits = 10; gv_local.lookup_slx_nse[  66].bits = 0x74800000;
-  gv_local.lookup_slx_nse[  67].nbits = 10; gv_local.lookup_slx_nse[  67].bits = 0x78C00000;
-  gv_local.lookup_slx_nse[  68].nbits = 10; gv_local.lookup_slx_nse[  68].bits = 0x7B000000;
-  gv_local.lookup_slx_nse[  69].nbits = 10; gv_local.lookup_slx_nse[  69].bits = 0x6C000000;
-  gv_local.lookup_slx_nse[  70].nbits = 10; gv_local.lookup_slx_nse[  70].bits = 0xC2000000;
-  gv_local.lookup_slx_nse[  71].nbits = 10; gv_local.lookup_slx_nse[  71].bits = 0x79000000;
-  gv_local.lookup_slx_nse[  72].nbits = 10; gv_local.lookup_slx_nse[  72].bits = 0x77800000;
-  gv_local.lookup_slx_nse[  73].nbits = 10; gv_local.lookup_slx_nse[  73].bits = 0xC4C00000;
-  gv_local.lookup_slx_nse[  74].nbits = 10; gv_local.lookup_slx_nse[  74].bits = 0x78800000;
-  gv_local.lookup_slx_nse[  75].nbits = 10; gv_local.lookup_slx_nse[  75].bits = 0x7C400000;
-  gv_local.lookup_slx_nse[  76].nbits = 10; gv_local.lookup_slx_nse[  76].bits = 0xC7C00000;
-  gv_local.lookup_slx_nse[  77].nbits = 10; gv_local.lookup_slx_nse[  77].bits = 0x7A800000;
-  gv_local.lookup_slx_nse[  78].nbits = 10; gv_local.lookup_slx_nse[  78].bits = 0xC1400000;
-  gv_local.lookup_slx_nse[  79].nbits = 10; gv_local.lookup_slx_nse[  79].bits = 0x7F400000;
-  gv_local.lookup_slx_nse[  80].nbits = 10; gv_local.lookup_slx_nse[  80].bits = 0xC9C00000;
-  gv_local.lookup_slx_nse[  81].nbits = 10; gv_local.lookup_slx_nse[  81].bits = 0xCC800000;
-  gv_local.lookup_slx_nse[  82].nbits = 10; gv_local.lookup_slx_nse[  82].bits = 0xC6C00000;
-  gv_local.lookup_slx_nse[  83].nbits = 10; gv_local.lookup_slx_nse[  83].bits = 0xC0C00000;
-  gv_local.lookup_slx_nse[  84].nbits = 10; gv_local.lookup_slx_nse[  84].bits = 0xC9000000;
-  gv_local.lookup_slx_nse[  85].nbits = 10; gv_local.lookup_slx_nse[  85].bits = 0xD2800000;
-  gv_local.lookup_slx_nse[  86].nbits = 10; gv_local.lookup_slx_nse[  86].bits = 0xD0C00000;
-  gv_local.lookup_slx_nse[  87].nbits = 10; gv_local.lookup_slx_nse[  87].bits = 0xC6400000;
-  gv_local.lookup_slx_nse[  88].nbits = 10; gv_local.lookup_slx_nse[  88].bits = 0xC1800000;
-  gv_local.lookup_slx_nse[  89].nbits = 10; gv_local.lookup_slx_nse[  89].bits = 0xCE000000;
-  gv_local.lookup_slx_nse[  90].nbits = 10; gv_local.lookup_slx_nse[  90].bits = 0xC3800000;
-  gv_local.lookup_slx_nse[  91].nbits = 10; gv_local.lookup_slx_nse[  91].bits = 0xCD400000;
-  gv_local.lookup_slx_nse[  92].nbits = 10; gv_local.lookup_slx_nse[  92].bits = 0xD3000000;
-  gv_local.lookup_slx_nse[  93].nbits = 10; gv_local.lookup_slx_nse[  93].bits = 0xD7800000;
-  gv_local.lookup_slx_nse[  94].nbits = 10; gv_local.lookup_slx_nse[  94].bits = 0xD8800000;
-  gv_local.lookup_slx_nse[  95].nbits = 10; gv_local.lookup_slx_nse[  95].bits = 0xCB400000;
-  gv_local.lookup_slx_nse[  96].nbits = 10; gv_local.lookup_slx_nse[  96].bits = 0xCE800000;
-  gv_local.lookup_slx_nse[  97].nbits = 10; gv_local.lookup_slx_nse[  97].bits = 0xCB800000;
-  gv_local.lookup_slx_nse[  98].nbits = 10; gv_local.lookup_slx_nse[  98].bits = 0xE1400000;
-  gv_local.lookup_slx_nse[  99].nbits = 10; gv_local.lookup_slx_nse[  99].bits = 0xD8400000;
-  gv_local.lookup_slx_nse[ 100].nbits = 10; gv_local.lookup_slx_nse[ 100].bits = 0xE1800000;
-  gv_local.lookup_slx_nse[ 101].nbits = 10; gv_local.lookup_slx_nse[ 101].bits = 0xDD400000;
-  gv_local.lookup_slx_nse[ 102].nbits = 10; gv_local.lookup_slx_nse[ 102].bits = 0xDF400000;
-  gv_local.lookup_slx_nse[ 103].nbits = 10; gv_local.lookup_slx_nse[ 103].bits = 0xCEC00000;
-  gv_local.lookup_slx_nse[ 104].nbits = 10; gv_local.lookup_slx_nse[ 104].bits = 0xDA800000;
-  gv_local.lookup_slx_nse[ 105].nbits = 10; gv_local.lookup_slx_nse[ 105].bits = 0xD7C00000;
-  gv_local.lookup_slx_nse[ 106].nbits = 10; gv_local.lookup_slx_nse[ 106].bits = 0xE3800000;
-  gv_local.lookup_slx_nse[ 107].nbits = 10; gv_local.lookup_slx_nse[ 107].bits = 0xDB000000;
-  gv_local.lookup_slx_nse[ 108].nbits = 10; gv_local.lookup_slx_nse[ 108].bits = 0xE0400000;
-  gv_local.lookup_slx_nse[ 109].nbits = 10; gv_local.lookup_slx_nse[ 109].bits = 0xE3C00000;
-  gv_local.lookup_slx_nse[ 110].nbits = 10; gv_local.lookup_slx_nse[ 110].bits = 0xDF800000;
-  gv_local.lookup_slx_nse[ 111].nbits = 10; gv_local.lookup_slx_nse[ 111].bits = 0xD9800000;
-  gv_local.lookup_slx_nse[ 112].nbits = 10; gv_local.lookup_slx_nse[ 112].bits = 0xDE000000;
-  gv_local.lookup_slx_nse[ 113].nbits = 10; gv_local.lookup_slx_nse[ 113].bits = 0xE5800000;
-  gv_local.lookup_slx_nse[ 114].nbits = 10; gv_local.lookup_slx_nse[ 114].bits = 0xD2C00000;
-  gv_local.lookup_slx_nse[ 115].nbits = 10; gv_local.lookup_slx_nse[ 115].bits = 0xED400000;
-  gv_local.lookup_slx_nse[ 116].nbits = 10; gv_local.lookup_slx_nse[ 116].bits = 0xE7C00000;
-  gv_local.lookup_slx_nse[ 117].nbits = 10; gv_local.lookup_slx_nse[ 117].bits = 0xD3800000;
-  gv_local.lookup_slx_nse[ 118].nbits = 10; gv_local.lookup_slx_nse[ 118].bits = 0xE9800000;
-  gv_local.lookup_slx_nse[ 119].nbits = 10; gv_local.lookup_slx_nse[ 119].bits = 0xDBC00000;
-  gv_local.lookup_slx_nse[ 120].nbits = 10; gv_local.lookup_slx_nse[ 120].bits = 0xEC800000;
-  gv_local.lookup_slx_nse[ 121].nbits = 10; gv_local.lookup_slx_nse[ 121].bits = 0xED000000;
-  gv_local.lookup_slx_nse[ 122].nbits = 10; gv_local.lookup_slx_nse[ 122].bits = 0xEF800000;
-  gv_local.lookup_slx_nse[ 123].nbits = 10; gv_local.lookup_slx_nse[ 123].bits = 0xEC000000;
-  gv_local.lookup_slx_nse[ 124].nbits = 10; gv_local.lookup_slx_nse[ 124].bits = 0xF0400000;
-  gv_local.lookup_slx_nse[ 125].nbits = 10; gv_local.lookup_slx_nse[ 125].bits = 0xE1000000;
-  gv_local.lookup_slx_nse[ 126].nbits = 10; gv_local.lookup_slx_nse[ 126].bits = 0xEE000000;
-  gv_local.lookup_slx_nse[ 127].nbits = 10; gv_local.lookup_slx_nse[ 127].bits = 0xEAC00000;
-  gv_local.lookup_slx_nse[ 128].nbits = 10; gv_local.lookup_slx_nse[ 128].bits = 0xF8800000;
-  gv_local.lookup_slx_nse[ 129].nbits = 10; gv_local.lookup_slx_nse[ 129].bits = 0xE6800000;
-  gv_local.lookup_slx_nse[ 130].nbits = 10; gv_local.lookup_slx_nse[ 130].bits = 0xE6C00000;
-  gv_local.lookup_slx_nse[ 131].nbits = 10; gv_local.lookup_slx_nse[ 131].bits = 0xEB800000;
-  gv_local.lookup_slx_nse[ 132].nbits = 10; gv_local.lookup_slx_nse[ 132].bits = 0xECC00000;
-  gv_local.lookup_slx_nse[ 133].nbits = 10; gv_local.lookup_slx_nse[ 133].bits = 0xF2400000;
-  gv_local.lookup_slx_nse[ 134].nbits = 10; gv_local.lookup_slx_nse[ 134].bits = 0xF0000000;
-  gv_local.lookup_slx_nse[ 135].nbits = 10; gv_local.lookup_slx_nse[ 135].bits = 0xF5C00000;
-  gv_local.lookup_slx_nse[ 136].nbits = 10; gv_local.lookup_slx_nse[ 136].bits = 0xF7000000;
-  gv_local.lookup_slx_nse[ 137].nbits = 10; gv_local.lookup_slx_nse[ 137].bits = 0xEDC00000;
-  gv_local.lookup_slx_nse[ 138].nbits = 10; gv_local.lookup_slx_nse[ 138].bits = 0xF2800000;
-  gv_local.lookup_slx_nse[ 139].nbits = 10; gv_local.lookup_slx_nse[ 139].bits = 0xE9000000;
-  gv_local.lookup_slx_nse[ 140].nbits = 10; gv_local.lookup_slx_nse[ 140].bits = 0xF9400000;
-  gv_local.lookup_slx_nse[ 141].nbits = 10; gv_local.lookup_slx_nse[ 141].bits = 0xFF400000;
-  gv_local.lookup_slx_nse[ 142].nbits = 10; gv_local.lookup_slx_nse[ 142].bits = 0xFA800000;
-  gv_local.lookup_slx_nse[ 143].nbits = 10; gv_local.lookup_slx_nse[ 143].bits = 0xF8400000;
-  gv_local.lookup_slx_nse[ 144].nbits = 10; gv_local.lookup_slx_nse[ 144].bits = 0xEFC00000;
-  gv_local.lookup_slx_nse[ 145].nbits = 10; gv_local.lookup_slx_nse[ 145].bits = 0xEF400000;
-  gv_local.lookup_slx_nse[ 146].nbits = 10; gv_local.lookup_slx_nse[ 146].bits = 0xF9000000;
-  gv_local.lookup_slx_nse[ 147].nbits =  9; gv_local.lookup_slx_nse[ 147].bits = 0x07000000;
-  gv_local.lookup_slx_nse[ 148].nbits = 10; gv_local.lookup_slx_nse[ 148].bits = 0xF7800000;
-  gv_local.lookup_slx_nse[ 149].nbits = 10; gv_local.lookup_slx_nse[ 149].bits = 0xFF000000;
-  gv_local.lookup_slx_nse[ 150].nbits =  9; gv_local.lookup_slx_nse[ 150].bits = 0x04800000;
-  gv_local.lookup_slx_nse[ 151].nbits =  9; gv_local.lookup_slx_nse[ 151].bits = 0x08800000;
-  gv_local.lookup_slx_nse[ 152].nbits = 10; gv_local.lookup_slx_nse[ 152].bits = 0xFEC00000;
-  gv_local.lookup_slx_nse[ 153].nbits = 10; gv_local.lookup_slx_nse[ 153].bits = 0xFC000000;
-  gv_local.lookup_slx_nse[ 154].nbits =  9; gv_local.lookup_slx_nse[ 154].bits = 0x16000000;
-  gv_local.lookup_slx_nse[ 155].nbits = 10; gv_local.lookup_slx_nse[ 155].bits = 0xFB400000;
-  gv_local.lookup_slx_nse[ 156].nbits =  9; gv_local.lookup_slx_nse[ 156].bits = 0x01000000;
-  gv_local.lookup_slx_nse[ 157].nbits =  9; gv_local.lookup_slx_nse[ 157].bits = 0x08000000;
-  gv_local.lookup_slx_nse[ 158].nbits =  9; gv_local.lookup_slx_nse[ 158].bits = 0x18800000;
-  gv_local.lookup_slx_nse[ 159].nbits =  9; gv_local.lookup_slx_nse[ 159].bits = 0x0C000000;
-  gv_local.lookup_slx_nse[ 160].nbits =  9; gv_local.lookup_slx_nse[ 160].bits = 0x10800000;
-  gv_local.lookup_slx_nse[ 161].nbits =  9; gv_local.lookup_slx_nse[ 161].bits = 0x15000000;
-  gv_local.lookup_slx_nse[ 162].nbits =  9; gv_local.lookup_slx_nse[ 162].bits = 0x0A800000;
-  gv_local.lookup_slx_nse[ 163].nbits =  9; gv_local.lookup_slx_nse[ 163].bits = 0x04000000;
-  gv_local.lookup_slx_nse[ 164].nbits =  9; gv_local.lookup_slx_nse[ 164].bits = 0x22000000;
-  gv_local.lookup_slx_nse[ 165].nbits =  9; gv_local.lookup_slx_nse[ 165].bits = 0x17000000;
-  gv_local.lookup_slx_nse[ 166].nbits =  9; gv_local.lookup_slx_nse[ 166].bits = 0x1E800000;
-  gv_local.lookup_slx_nse[ 167].nbits =  9; gv_local.lookup_slx_nse[ 167].bits = 0x26000000;
-  gv_local.lookup_slx_nse[ 168].nbits =  9; gv_local.lookup_slx_nse[ 168].bits = 0x0D800000;
-  gv_local.lookup_slx_nse[ 169].nbits =  9; gv_local.lookup_slx_nse[ 169].bits = 0x10000000;
-  gv_local.lookup_slx_nse[ 170].nbits =  9; gv_local.lookup_slx_nse[ 170].bits = 0x31800000;
-  gv_local.lookup_slx_nse[ 171].nbits =  9; gv_local.lookup_slx_nse[ 171].bits = 0x29000000;
-  gv_local.lookup_slx_nse[ 172].nbits =  9; gv_local.lookup_slx_nse[ 172].bits = 0x15800000;
-  gv_local.lookup_slx_nse[ 173].nbits =  9; gv_local.lookup_slx_nse[ 173].bits = 0x29800000;
-  gv_local.lookup_slx_nse[ 174].nbits =  9; gv_local.lookup_slx_nse[ 174].bits = 0x26800000;
-  gv_local.lookup_slx_nse[ 175].nbits =  9; gv_local.lookup_slx_nse[ 175].bits = 0x1F800000;
-  gv_local.lookup_slx_nse[ 176].nbits =  9; gv_local.lookup_slx_nse[ 176].bits = 0x2E800000;
-  gv_local.lookup_slx_nse[ 177].nbits =  9; gv_local.lookup_slx_nse[ 177].bits = 0x3E000000;
-  gv_local.lookup_slx_nse[ 178].nbits =  9; gv_local.lookup_slx_nse[ 178].bits = 0x1F000000;
-  gv_local.lookup_slx_nse[ 179].nbits =  9; gv_local.lookup_slx_nse[ 179].bits = 0x34000000;
-  gv_local.lookup_slx_nse[ 180].nbits =  9; gv_local.lookup_slx_nse[ 180].bits = 0x2E000000;
-  gv_local.lookup_slx_nse[ 181].nbits =  9; gv_local.lookup_slx_nse[ 181].bits = 0x40800000;
-  gv_local.lookup_slx_nse[ 182].nbits =  9; gv_local.lookup_slx_nse[ 182].bits = 0x28000000;
-  gv_local.lookup_slx_nse[ 183].nbits =  9; gv_local.lookup_slx_nse[ 183].bits = 0x49800000;
-  gv_local.lookup_slx_nse[ 184].nbits =  9; gv_local.lookup_slx_nse[ 184].bits = 0x4A000000;
-  gv_local.lookup_slx_nse[ 185].nbits =  9; gv_local.lookup_slx_nse[ 185].bits = 0x4A800000;
-  gv_local.lookup_slx_nse[ 186].nbits =  9; gv_local.lookup_slx_nse[ 186].bits = 0x45000000;
-  gv_local.lookup_slx_nse[ 187].nbits =  9; gv_local.lookup_slx_nse[ 187].bits = 0x51000000;
-  gv_local.lookup_slx_nse[ 188].nbits =  9; gv_local.lookup_slx_nse[ 188].bits = 0x48000000;
-  gv_local.lookup_slx_nse[ 189].nbits =  9; gv_local.lookup_slx_nse[ 189].bits = 0x49000000;
-  gv_local.lookup_slx_nse[ 190].nbits =  9; gv_local.lookup_slx_nse[ 190].bits = 0x4E000000;
-  gv_local.lookup_slx_nse[ 191].nbits =  9; gv_local.lookup_slx_nse[ 191].bits = 0x4E800000;
-  gv_local.lookup_slx_nse[ 192].nbits =  9; gv_local.lookup_slx_nse[ 192].bits = 0x53000000;
-  gv_local.lookup_slx_nse[ 193].nbits =  9; gv_local.lookup_slx_nse[ 193].bits = 0x4C800000;
-  gv_local.lookup_slx_nse[ 194].nbits =  9; gv_local.lookup_slx_nse[ 194].bits = 0x57800000;
-  gv_local.lookup_slx_nse[ 195].nbits =  9; gv_local.lookup_slx_nse[ 195].bits = 0x4F800000;
-  gv_local.lookup_slx_nse[ 196].nbits =  9; gv_local.lookup_slx_nse[ 196].bits = 0x54800000;
-  gv_local.lookup_slx_nse[ 197].nbits =  9; gv_local.lookup_slx_nse[ 197].bits = 0x52800000;
-  gv_local.lookup_slx_nse[ 198].nbits =  9; gv_local.lookup_slx_nse[ 198].bits = 0x59800000;
-  gv_local.lookup_slx_nse[ 199].nbits =  9; gv_local.lookup_slx_nse[ 199].bits = 0x5A000000;
-  gv_local.lookup_slx_nse[ 200].nbits =  9; gv_local.lookup_slx_nse[ 200].bits = 0x58800000;
-  gv_local.lookup_slx_nse[ 201].nbits =  9; gv_local.lookup_slx_nse[ 201].bits = 0x5E000000;
-  gv_local.lookup_slx_nse[ 202].nbits =  9; gv_local.lookup_slx_nse[ 202].bits = 0x5E800000;
-  gv_local.lookup_slx_nse[ 203].nbits =  9; gv_local.lookup_slx_nse[ 203].bits = 0x61800000;
-  gv_local.lookup_slx_nse[ 204].nbits =  9; gv_local.lookup_slx_nse[ 204].bits = 0x6A800000;
-  gv_local.lookup_slx_nse[ 205].nbits =  9; gv_local.lookup_slx_nse[ 205].bits = 0x65800000;
-  gv_local.lookup_slx_nse[ 206].nbits =  9; gv_local.lookup_slx_nse[ 206].bits = 0x68000000;
-  gv_local.lookup_slx_nse[ 207].nbits =  9; gv_local.lookup_slx_nse[ 207].bits = 0x64000000;
-  gv_local.lookup_slx_nse[ 208].nbits =  9; gv_local.lookup_slx_nse[ 208].bits = 0x5D800000;
-  gv_local.lookup_slx_nse[ 209].nbits =  9; gv_local.lookup_slx_nse[ 209].bits = 0x6F000000;
-  gv_local.lookup_slx_nse[ 210].nbits =  9; gv_local.lookup_slx_nse[ 210].bits = 0x6D000000;
-  gv_local.lookup_slx_nse[ 211].nbits =  9; gv_local.lookup_slx_nse[ 211].bits = 0x6D800000;
-  gv_local.lookup_slx_nse[ 212].nbits =  9; gv_local.lookup_slx_nse[ 212].bits = 0x71000000;
-  gv_local.lookup_slx_nse[ 213].nbits =  9; gv_local.lookup_slx_nse[ 213].bits = 0x76800000;
-  gv_local.lookup_slx_nse[ 214].nbits =  9; gv_local.lookup_slx_nse[ 214].bits = 0x74000000;
-  gv_local.lookup_slx_nse[ 215].nbits =  9; gv_local.lookup_slx_nse[ 215].bits = 0x72000000;
-  gv_local.lookup_slx_nse[ 216].nbits =  9; gv_local.lookup_slx_nse[ 216].bits = 0x78000000;
-  gv_local.lookup_slx_nse[ 217].nbits =  9; gv_local.lookup_slx_nse[ 217].bits = 0x7D800000;
-  gv_local.lookup_slx_nse[ 218].nbits =  9; gv_local.lookup_slx_nse[ 218].bits = 0x7E800000;
-  gv_local.lookup_slx_nse[ 219].nbits =  9; gv_local.lookup_slx_nse[ 219].bits = 0xC2800000;
-  gv_local.lookup_slx_nse[ 220].nbits =  9; gv_local.lookup_slx_nse[ 220].bits = 0x7D000000;
-  gv_local.lookup_slx_nse[ 221].nbits =  9; gv_local.lookup_slx_nse[ 221].bits = 0xC4000000;
-  gv_local.lookup_slx_nse[ 222].nbits =  9; gv_local.lookup_slx_nse[ 222].bits = 0xC3000000;
-  gv_local.lookup_slx_nse[ 223].nbits =  9; gv_local.lookup_slx_nse[ 223].bits = 0xCD800000;
-  gv_local.lookup_slx_nse[ 224].nbits =  9; gv_local.lookup_slx_nse[ 224].bits = 0xE2000000;
-  gv_local.lookup_slx_nse[ 225].nbits =  9; gv_local.lookup_slx_nse[ 225].bits = 0xD4000000;
-  gv_local.lookup_slx_nse[ 226].nbits =  9; gv_local.lookup_slx_nse[ 226].bits = 0xDC800000;
-  gv_local.lookup_slx_nse[ 227].nbits =  9; gv_local.lookup_slx_nse[ 227].bits = 0xD6000000;
-  gv_local.lookup_slx_nse[ 228].nbits =  9; gv_local.lookup_slx_nse[ 228].bits = 0xDE800000;
-  gv_local.lookup_slx_nse[ 229].nbits =  9; gv_local.lookup_slx_nse[ 229].bits = 0xE2800000;
-  gv_local.lookup_slx_nse[ 230].nbits =  9; gv_local.lookup_slx_nse[ 230].bits = 0xE0800000;
-  gv_local.lookup_slx_nse[ 231].nbits =  9; gv_local.lookup_slx_nse[ 231].bits = 0xE7000000;
-  gv_local.lookup_slx_nse[ 232].nbits =  9; gv_local.lookup_slx_nse[ 232].bits = 0xEB000000;
-  gv_local.lookup_slx_nse[ 233].nbits =  9; gv_local.lookup_slx_nse[ 233].bits = 0xF3000000;
-  gv_local.lookup_slx_nse[ 234].nbits =  9; gv_local.lookup_slx_nse[ 234].bits = 0xF5000000;
-  gv_local.lookup_slx_nse[ 235].nbits =  9; gv_local.lookup_slx_nse[ 235].bits = 0xF0800000;
-  gv_local.lookup_slx_nse[ 236].nbits =  9; gv_local.lookup_slx_nse[ 236].bits = 0xFA000000;
-  gv_local.lookup_slx_nse[ 237].nbits =  9; gv_local.lookup_slx_nse[ 237].bits = 0xF4000000;
-  gv_local.lookup_slx_nse[ 238].nbits =  9; gv_local.lookup_slx_nse[ 238].bits = 0xFF800000;
-  gv_local.lookup_slx_nse[ 239].nbits =  9; gv_local.lookup_slx_nse[ 239].bits = 0xFC800000;
-  gv_local.lookup_slx_nse[ 240].nbits =  8; gv_local.lookup_slx_nse[ 240].bits = 0x03000000;
-  gv_local.lookup_slx_nse[ 241].nbits =  8; gv_local.lookup_slx_nse[ 241].bits = 0x0E000000;
-  gv_local.lookup_slx_nse[ 242].nbits =  8; gv_local.lookup_slx_nse[ 242].bits = 0x11000000;
-  gv_local.lookup_slx_nse[ 243].nbits =  8; gv_local.lookup_slx_nse[ 243].bits = 0x1B000000;
-  gv_local.lookup_slx_nse[ 244].nbits =  8; gv_local.lookup_slx_nse[ 244].bits = 0x1A000000;
-  gv_local.lookup_slx_nse[ 245].nbits =  8; gv_local.lookup_slx_nse[ 245].bits = 0x19000000;
-  gv_local.lookup_slx_nse[ 246].nbits =  8; gv_local.lookup_slx_nse[ 246].bits = 0x2C000000;
-  gv_local.lookup_slx_nse[ 247].nbits =  8; gv_local.lookup_slx_nse[ 247].bits = 0x35000000;
-  gv_local.lookup_slx_nse[ 248].nbits =  8; gv_local.lookup_slx_nse[ 248].bits = 0x37000000;
-  gv_local.lookup_slx_nse[ 249].nbits =  8; gv_local.lookup_slx_nse[ 249].bits = 0x32000000;
-  gv_local.lookup_slx_nse[ 250].nbits =  8; gv_local.lookup_slx_nse[ 250].bits = 0x39000000;
-  gv_local.lookup_slx_nse[ 251].nbits =  8; gv_local.lookup_slx_nse[ 251].bits = 0x47000000;
-  gv_local.lookup_slx_nse[ 252].nbits =  8; gv_local.lookup_slx_nse[ 252].bits = 0x2F000000;
-  gv_local.lookup_slx_nse[ 253].nbits =  8; gv_local.lookup_slx_nse[ 253].bits = 0x3D000000;
-  gv_local.lookup_slx_nse[ 254].nbits =  8; gv_local.lookup_slx_nse[ 254].bits = 0x21000000;
-  gv_local.lookup_slx_nse[ 255].nbits =  8; gv_local.lookup_slx_nse[ 255].bits = 0xD1000000;
-  gv_local.lookup_slx_nse[ 256].nbits =  8; gv_local.lookup_slx_nse[ 256].bits = 0x25000000;
-  gv_local.lookup_slx_nse[ 257].nbits =  8; gv_local.lookup_slx_nse[ 257].bits = 0x2D000000;
-  gv_local.lookup_slx_nse[ 258].nbits =  8; gv_local.lookup_slx_nse[ 258].bits = 0x30000000;
-  gv_local.lookup_slx_nse[ 259].nbits =  8; gv_local.lookup_slx_nse[ 259].bits = 0x36000000;
-  gv_local.lookup_slx_nse[ 260].nbits =  8; gv_local.lookup_slx_nse[ 260].bits = 0x33000000;
-  gv_local.lookup_slx_nse[ 261].nbits =  8; gv_local.lookup_slx_nse[ 261].bits = 0x41000000;
-  gv_local.lookup_slx_nse[ 262].nbits =  8; gv_local.lookup_slx_nse[ 262].bits = 0x2B000000;
-  gv_local.lookup_slx_nse[ 263].nbits =  8; gv_local.lookup_slx_nse[ 263].bits = 0x43000000;
-  gv_local.lookup_slx_nse[ 264].nbits =  8; gv_local.lookup_slx_nse[ 264].bits = 0x3B000000;
-  gv_local.lookup_slx_nse[ 265].nbits =  8; gv_local.lookup_slx_nse[ 265].bits = 0x2A000000;
-  gv_local.lookup_slx_nse[ 266].nbits =  8; gv_local.lookup_slx_nse[ 266].bits = 0x38000000;
-  gv_local.lookup_slx_nse[ 267].nbits =  8; gv_local.lookup_slx_nse[ 267].bits = 0x20000000;
-  gv_local.lookup_slx_nse[ 268].nbits =  8; gv_local.lookup_slx_nse[ 268].bits = 0x24000000;
-  gv_local.lookup_slx_nse[ 269].nbits =  8; gv_local.lookup_slx_nse[ 269].bits = 0x09000000;
-  gv_local.lookup_slx_nse[ 270].nbits =  8; gv_local.lookup_slx_nse[ 270].bits = 0x13000000;
-  gv_local.lookup_slx_nse[ 271].nbits =  8; gv_local.lookup_slx_nse[ 271].bits = 0x02000000;
-  gv_local.lookup_slx_nse[ 272].nbits =  8; gv_local.lookup_slx_nse[ 272].bits = 0x12000000;
-  gv_local.lookup_slx_nse[ 273].nbits =  8; gv_local.lookup_slx_nse[ 273].bits = 0x1C000000;
-  gv_local.lookup_slx_nse[ 274].nbits =  8; gv_local.lookup_slx_nse[ 274].bits = 0x05000000;
-  gv_local.lookup_slx_nse[ 275].nbits =  8; gv_local.lookup_slx_nse[ 275].bits = 0x06000000;
-  gv_local.lookup_slx_nse[ 276].nbits =  9; gv_local.lookup_slx_nse[ 276].bits = 0xFD000000;
-  gv_local.lookup_slx_nse[ 277].nbits =  8; gv_local.lookup_slx_nse[ 277].bits = 0x00000000;
-  gv_local.lookup_slx_nse[ 278].nbits =  9; gv_local.lookup_slx_nse[ 278].bits = 0xFB800000;
-  gv_local.lookup_slx_nse[ 279].nbits =  9; gv_local.lookup_slx_nse[ 279].bits = 0xF9800000;
-  gv_local.lookup_slx_nse[ 280].nbits =  9; gv_local.lookup_slx_nse[ 280].bits = 0xF6800000;
-  gv_local.lookup_slx_nse[ 281].nbits =  9; gv_local.lookup_slx_nse[ 281].bits = 0xEE800000;
-  gv_local.lookup_slx_nse[ 282].nbits =  9; gv_local.lookup_slx_nse[ 282].bits = 0xF4800000;
-  gv_local.lookup_slx_nse[ 283].nbits =  9; gv_local.lookup_slx_nse[ 283].bits = 0xE5000000;
-  gv_local.lookup_slx_nse[ 284].nbits =  9; gv_local.lookup_slx_nse[ 284].bits = 0xEA000000;
-  gv_local.lookup_slx_nse[ 285].nbits =  9; gv_local.lookup_slx_nse[ 285].bits = 0xE4000000;
-  gv_local.lookup_slx_nse[ 286].nbits =  9; gv_local.lookup_slx_nse[ 286].bits = 0xE6000000;
-  gv_local.lookup_slx_nse[ 287].nbits =  9; gv_local.lookup_slx_nse[ 287].bits = 0xDC000000;
-  gv_local.lookup_slx_nse[ 288].nbits =  9; gv_local.lookup_slx_nse[ 288].bits = 0xD5800000;
-  gv_local.lookup_slx_nse[ 289].nbits =  9; gv_local.lookup_slx_nse[ 289].bits = 0xD4800000;
-  gv_local.lookup_slx_nse[ 290].nbits =  9; gv_local.lookup_slx_nse[ 290].bits = 0xC8800000;
-  gv_local.lookup_slx_nse[ 291].nbits =  9; gv_local.lookup_slx_nse[ 291].bits = 0xCA800000;
-  gv_local.lookup_slx_nse[ 292].nbits =  9; gv_local.lookup_slx_nse[ 292].bits = 0xCA000000;
-  gv_local.lookup_slx_nse[ 293].nbits =  9; gv_local.lookup_slx_nse[ 293].bits = 0xCF000000;
-  gv_local.lookup_slx_nse[ 294].nbits =  9; gv_local.lookup_slx_nse[ 294].bits = 0xC7000000;
-  gv_local.lookup_slx_nse[ 295].nbits =  9; gv_local.lookup_slx_nse[ 295].bits = 0xC0000000;
-  gv_local.lookup_slx_nse[ 296].nbits =  9; gv_local.lookup_slx_nse[ 296].bits = 0x7F800000;
-  gv_local.lookup_slx_nse[ 297].nbits =  9; gv_local.lookup_slx_nse[ 297].bits = 0x7B800000;
-  gv_local.lookup_slx_nse[ 298].nbits =  9; gv_local.lookup_slx_nse[ 298].bits = 0x75800000;
-  gv_local.lookup_slx_nse[ 299].nbits =  9; gv_local.lookup_slx_nse[ 299].bits = 0x75000000;
-  gv_local.lookup_slx_nse[ 300].nbits =  9; gv_local.lookup_slx_nse[ 300].bits = 0x79800000;
-  gv_local.lookup_slx_nse[ 301].nbits =  9; gv_local.lookup_slx_nse[ 301].bits = 0x70800000;
-  gv_local.lookup_slx_nse[ 302].nbits =  9; gv_local.lookup_slx_nse[ 302].bits = 0x73800000;
-  gv_local.lookup_slx_nse[ 303].nbits =  9; gv_local.lookup_slx_nse[ 303].bits = 0x72800000;
-  gv_local.lookup_slx_nse[ 304].nbits =  9; gv_local.lookup_slx_nse[ 304].bits = 0x64800000;
-  gv_local.lookup_slx_nse[ 305].nbits =  9; gv_local.lookup_slx_nse[ 305].bits = 0x6C800000;
-  gv_local.lookup_slx_nse[ 306].nbits =  9; gv_local.lookup_slx_nse[ 306].bits = 0x6B800000;
-  gv_local.lookup_slx_nse[ 307].nbits =  9; gv_local.lookup_slx_nse[ 307].bits = 0x6E000000;
-  gv_local.lookup_slx_nse[ 308].nbits =  9; gv_local.lookup_slx_nse[ 308].bits = 0x67000000;
-  gv_local.lookup_slx_nse[ 309].nbits =  9; gv_local.lookup_slx_nse[ 309].bits = 0x69000000;
-  gv_local.lookup_slx_nse[ 310].nbits =  9; gv_local.lookup_slx_nse[ 310].bits = 0x5F800000;
-  gv_local.lookup_slx_nse[ 311].nbits =  9; gv_local.lookup_slx_nse[ 311].bits = 0x61000000;
-  gv_local.lookup_slx_nse[ 312].nbits =  9; gv_local.lookup_slx_nse[ 312].bits = 0x62800000;
-  gv_local.lookup_slx_nse[ 313].nbits =  9; gv_local.lookup_slx_nse[ 313].bits = 0x66800000;
-  gv_local.lookup_slx_nse[ 314].nbits =  9; gv_local.lookup_slx_nse[ 314].bits = 0x60000000;
-  gv_local.lookup_slx_nse[ 315].nbits =  9; gv_local.lookup_slx_nse[ 315].bits = 0x5F000000;
-  gv_local.lookup_slx_nse[ 316].nbits =  9; gv_local.lookup_slx_nse[ 316].bits = 0x5C800000;
-  gv_local.lookup_slx_nse[ 317].nbits =  9; gv_local.lookup_slx_nse[ 317].bits = 0x5D000000;
-  gv_local.lookup_slx_nse[ 318].nbits =  9; gv_local.lookup_slx_nse[ 318].bits = 0x5B800000;
-  gv_local.lookup_slx_nse[ 319].nbits =  9; gv_local.lookup_slx_nse[ 319].bits = 0x5B000000;
-  gv_local.lookup_slx_nse[ 320].nbits =  9; gv_local.lookup_slx_nse[ 320].bits = 0x55800000;
-  gv_local.lookup_slx_nse[ 321].nbits =  9; gv_local.lookup_slx_nse[ 321].bits = 0x59000000;
-  gv_local.lookup_slx_nse[ 322].nbits =  9; gv_local.lookup_slx_nse[ 322].bits = 0x54000000;
-  gv_local.lookup_slx_nse[ 323].nbits =  9; gv_local.lookup_slx_nse[ 323].bits = 0x50000000;
-  gv_local.lookup_slx_nse[ 324].nbits =  9; gv_local.lookup_slx_nse[ 324].bits = 0x4F000000;
-  gv_local.lookup_slx_nse[ 325].nbits =  9; gv_local.lookup_slx_nse[ 325].bits = 0x51800000;
-  gv_local.lookup_slx_nse[ 326].nbits =  9; gv_local.lookup_slx_nse[ 326].bits = 0x53800000;
-  gv_local.lookup_slx_nse[ 327].nbits =  9; gv_local.lookup_slx_nse[ 327].bits = 0x4D800000;
-  gv_local.lookup_slx_nse[ 328].nbits =  9; gv_local.lookup_slx_nse[ 328].bits = 0x45800000;
-  gv_local.lookup_slx_nse[ 329].nbits =  9; gv_local.lookup_slx_nse[ 329].bits = 0x48800000;
-  gv_local.lookup_slx_nse[ 330].nbits =  9; gv_local.lookup_slx_nse[ 330].bits = 0x4B000000;
-  gv_local.lookup_slx_nse[ 331].nbits =  9; gv_local.lookup_slx_nse[ 331].bits = 0x3E800000;
-  gv_local.lookup_slx_nse[ 332].nbits =  9; gv_local.lookup_slx_nse[ 332].bits = 0x44000000;
-  gv_local.lookup_slx_nse[ 333].nbits =  9; gv_local.lookup_slx_nse[ 333].bits = 0x3A800000;
-  gv_local.lookup_slx_nse[ 334].nbits =  9; gv_local.lookup_slx_nse[ 334].bits = 0x40000000;
-  gv_local.lookup_slx_nse[ 335].nbits =  9; gv_local.lookup_slx_nse[ 335].bits = 0x3C000000;
-  gv_local.lookup_slx_nse[ 336].nbits =  9; gv_local.lookup_slx_nse[ 336].bits = 0x27000000;
-  gv_local.lookup_slx_nse[ 337].nbits =  9; gv_local.lookup_slx_nse[ 337].bits = 0x3F000000;
-  gv_local.lookup_slx_nse[ 338].nbits =  9; gv_local.lookup_slx_nse[ 338].bits = 0x1E000000;
-  gv_local.lookup_slx_nse[ 339].nbits =  9; gv_local.lookup_slx_nse[ 339].bits = 0x3A000000;
-  gv_local.lookup_slx_nse[ 340].nbits =  9; gv_local.lookup_slx_nse[ 340].bits = 0x31000000;
-  gv_local.lookup_slx_nse[ 341].nbits =  9; gv_local.lookup_slx_nse[ 341].bits = 0x28800000;
-  gv_local.lookup_slx_nse[ 342].nbits =  9; gv_local.lookup_slx_nse[ 342].bits = 0x1D000000;
-  gv_local.lookup_slx_nse[ 343].nbits =  9; gv_local.lookup_slx_nse[ 343].bits = 0x34800000;
-  gv_local.lookup_slx_nse[ 344].nbits =  9; gv_local.lookup_slx_nse[ 344].bits = 0x14000000;
-  gv_local.lookup_slx_nse[ 345].nbits =  9; gv_local.lookup_slx_nse[ 345].bits = 0x23000000;
-  gv_local.lookup_slx_nse[ 346].nbits =  9; gv_local.lookup_slx_nse[ 346].bits = 0x23800000;
-  gv_local.lookup_slx_nse[ 347].nbits =  9; gv_local.lookup_slx_nse[ 347].bits = 0x0F800000;
-  gv_local.lookup_slx_nse[ 348].nbits =  9; gv_local.lookup_slx_nse[ 348].bits = 0x0B000000;
-  gv_local.lookup_slx_nse[ 349].nbits =  9; gv_local.lookup_slx_nse[ 349].bits = 0x0D000000;
-  gv_local.lookup_slx_nse[ 350].nbits = 10; gv_local.lookup_slx_nse[ 350].bits = 0xFE400000;
-  gv_local.lookup_slx_nse[ 351].nbits = 10; gv_local.lookup_slx_nse[ 351].bits = 0xFD800000;
-  gv_local.lookup_slx_nse[ 352].nbits =  9; gv_local.lookup_slx_nse[ 352].bits = 0x16800000;
-  gv_local.lookup_slx_nse[ 353].nbits =  9; gv_local.lookup_slx_nse[ 353].bits = 0x17800000;
-  gv_local.lookup_slx_nse[ 354].nbits = 10; gv_local.lookup_slx_nse[ 354].bits = 0xF7400000;
-  gv_local.lookup_slx_nse[ 355].nbits =  9; gv_local.lookup_slx_nse[ 355].bits = 0x0C800000;
-  gv_local.lookup_slx_nse[ 356].nbits =  9; gv_local.lookup_slx_nse[ 356].bits = 0x07800000;
-  gv_local.lookup_slx_nse[ 357].nbits = 10; gv_local.lookup_slx_nse[ 357].bits = 0xFB000000;
-  gv_local.lookup_slx_nse[ 358].nbits = 10; gv_local.lookup_slx_nse[ 358].bits = 0xFC400000;
-  gv_local.lookup_slx_nse[ 359].nbits =  9; gv_local.lookup_slx_nse[ 359].bits = 0x0B800000;
-  gv_local.lookup_slx_nse[ 360].nbits = 10; gv_local.lookup_slx_nse[ 360].bits = 0xFAC00000;
-  gv_local.lookup_slx_nse[ 361].nbits = 10; gv_local.lookup_slx_nse[ 361].bits = 0xFE800000;
-  gv_local.lookup_slx_nse[ 362].nbits = 10; gv_local.lookup_slx_nse[ 362].bits = 0xF3800000;
-  gv_local.lookup_slx_nse[ 363].nbits = 10; gv_local.lookup_slx_nse[ 363].bits = 0xF5800000;
-  gv_local.lookup_slx_nse[ 364].nbits = 10; gv_local.lookup_slx_nse[ 364].bits = 0xF3C00000;
-  gv_local.lookup_slx_nse[ 365].nbits = 10; gv_local.lookup_slx_nse[ 365].bits = 0xF1400000;
-  gv_local.lookup_slx_nse[ 366].nbits = 10; gv_local.lookup_slx_nse[ 366].bits = 0xF8C00000;
-  gv_local.lookup_slx_nse[ 367].nbits = 10; gv_local.lookup_slx_nse[ 367].bits = 0xF8000000;
-  gv_local.lookup_slx_nse[ 368].nbits = 10; gv_local.lookup_slx_nse[ 368].bits = 0xF2000000;
-  gv_local.lookup_slx_nse[ 369].nbits = 10; gv_local.lookup_slx_nse[ 369].bits = 0xED800000;
-  gv_local.lookup_slx_nse[ 370].nbits = 10; gv_local.lookup_slx_nse[ 370].bits = 0xF1C00000;
-  gv_local.lookup_slx_nse[ 371].nbits = 10; gv_local.lookup_slx_nse[ 371].bits = 0xF1800000;
-  gv_local.lookup_slx_nse[ 372].nbits = 10; gv_local.lookup_slx_nse[ 372].bits = 0xEC400000;
-  gv_local.lookup_slx_nse[ 373].nbits = 10; gv_local.lookup_slx_nse[ 373].bits = 0xDE400000;
-  gv_local.lookup_slx_nse[ 374].nbits = 10; gv_local.lookup_slx_nse[ 374].bits = 0xF1000000;
-  gv_local.lookup_slx_nse[ 375].nbits = 10; gv_local.lookup_slx_nse[ 375].bits = 0xE9400000;
-  gv_local.lookup_slx_nse[ 376].nbits = 10; gv_local.lookup_slx_nse[ 376].bits = 0xE8800000;
-  gv_local.lookup_slx_nse[ 377].nbits = 10; gv_local.lookup_slx_nse[ 377].bits = 0xEA800000;
-  gv_local.lookup_slx_nse[ 378].nbits = 10; gv_local.lookup_slx_nse[ 378].bits = 0xEF000000;
-  gv_local.lookup_slx_nse[ 379].nbits = 10; gv_local.lookup_slx_nse[ 379].bits = 0xE1C00000;
-  gv_local.lookup_slx_nse[ 380].nbits = 10; gv_local.lookup_slx_nse[ 380].bits = 0xE8C00000;
-  gv_local.lookup_slx_nse[ 381].nbits = 10; gv_local.lookup_slx_nse[ 381].bits = 0xE7800000;
-  gv_local.lookup_slx_nse[ 382].nbits = 10; gv_local.lookup_slx_nse[ 382].bits = 0xF6000000;
-  gv_local.lookup_slx_nse[ 383].nbits = 10; gv_local.lookup_slx_nse[ 383].bits = 0xDB800000;
-  gv_local.lookup_slx_nse[ 384].nbits = 10; gv_local.lookup_slx_nse[ 384].bits = 0xDAC00000;
-  gv_local.lookup_slx_nse[ 385].nbits = 10; gv_local.lookup_slx_nse[ 385].bits = 0xD9C00000;
-  gv_local.lookup_slx_nse[ 386].nbits = 10; gv_local.lookup_slx_nse[ 386].bits = 0xDD000000;
-  gv_local.lookup_slx_nse[ 387].nbits = 10; gv_local.lookup_slx_nse[ 387].bits = 0xE8400000;
-  gv_local.lookup_slx_nse[ 388].nbits = 10; gv_local.lookup_slx_nse[ 388].bits = 0xE5C00000;
-  gv_local.lookup_slx_nse[ 389].nbits = 10; gv_local.lookup_slx_nse[ 389].bits = 0xE0000000;
-  gv_local.lookup_slx_nse[ 390].nbits = 10; gv_local.lookup_slx_nse[ 390].bits = 0xE3000000;
-  gv_local.lookup_slx_nse[ 391].nbits = 10; gv_local.lookup_slx_nse[ 391].bits = 0xD8C00000;
-  gv_local.lookup_slx_nse[ 392].nbits = 10; gv_local.lookup_slx_nse[ 392].bits = 0xCCC00000;
-  gv_local.lookup_slx_nse[ 393].nbits = 10; gv_local.lookup_slx_nse[ 393].bits = 0xD9000000;
-  gv_local.lookup_slx_nse[ 394].nbits = 10; gv_local.lookup_slx_nse[ 394].bits = 0xE4800000;
-  gv_local.lookup_slx_nse[ 395].nbits = 10; gv_local.lookup_slx_nse[ 395].bits = 0xE9C00000;
-  gv_local.lookup_slx_nse[ 396].nbits = 10; gv_local.lookup_slx_nse[ 396].bits = 0xE3400000;
-  gv_local.lookup_slx_nse[ 397].nbits = 10; gv_local.lookup_slx_nse[ 397].bits = 0xD7400000;
-  gv_local.lookup_slx_nse[ 398].nbits = 10; gv_local.lookup_slx_nse[ 398].bits = 0xD6800000;
-  gv_local.lookup_slx_nse[ 399].nbits = 10; gv_local.lookup_slx_nse[ 399].bits = 0xC9800000;
-  gv_local.lookup_slx_nse[ 400].nbits = 10; gv_local.lookup_slx_nse[ 400].bits = 0xCF800000;
-  gv_local.lookup_slx_nse[ 401].nbits = 10; gv_local.lookup_slx_nse[ 401].bits = 0xD0400000;
-  gv_local.lookup_slx_nse[ 402].nbits = 10; gv_local.lookup_slx_nse[ 402].bits = 0xD5400000;
-  gv_local.lookup_slx_nse[ 403].nbits = 10; gv_local.lookup_slx_nse[ 403].bits = 0xD0800000;
-  gv_local.lookup_slx_nse[ 404].nbits = 10; gv_local.lookup_slx_nse[ 404].bits = 0xDA400000;
-  gv_local.lookup_slx_nse[ 405].nbits = 10; gv_local.lookup_slx_nse[ 405].bits = 0xD2000000;
-  gv_local.lookup_slx_nse[ 406].nbits = 10; gv_local.lookup_slx_nse[ 406].bits = 0xD3400000;
-  gv_local.lookup_slx_nse[ 407].nbits = 10; gv_local.lookup_slx_nse[ 407].bits = 0xD3C00000;
-  gv_local.lookup_slx_nse[ 408].nbits = 10; gv_local.lookup_slx_nse[ 408].bits = 0xD8000000;
-  gv_local.lookup_slx_nse[ 409].nbits = 10; gv_local.lookup_slx_nse[ 409].bits = 0xC5000000;
-  gv_local.lookup_slx_nse[ 410].nbits = 10; gv_local.lookup_slx_nse[ 410].bits = 0xC9400000;
-  gv_local.lookup_slx_nse[ 411].nbits = 10; gv_local.lookup_slx_nse[ 411].bits = 0xD6C00000;
-  gv_local.lookup_slx_nse[ 412].nbits = 10; gv_local.lookup_slx_nse[ 412].bits = 0xCD000000;
-  gv_local.lookup_slx_nse[ 413].nbits = 10; gv_local.lookup_slx_nse[ 413].bits = 0xDF000000;
-  gv_local.lookup_slx_nse[ 414].nbits = 10; gv_local.lookup_slx_nse[ 414].bits = 0xC8400000;
-  gv_local.lookup_slx_nse[ 415].nbits = 10; gv_local.lookup_slx_nse[ 415].bits = 0xC4800000;
-  gv_local.lookup_slx_nse[ 416].nbits = 10; gv_local.lookup_slx_nse[ 416].bits = 0xD2400000;
-  gv_local.lookup_slx_nse[ 417].nbits = 10; gv_local.lookup_slx_nse[ 417].bits = 0xCC400000;
-  gv_local.lookup_slx_nse[ 418].nbits = 10; gv_local.lookup_slx_nse[ 418].bits = 0xC5800000;
-  gv_local.lookup_slx_nse[ 419].nbits = 10; gv_local.lookup_slx_nse[ 419].bits = 0xDD800000;
-  gv_local.lookup_slx_nse[ 420].nbits = 10; gv_local.lookup_slx_nse[ 420].bits = 0xC8000000;
-  gv_local.lookup_slx_nse[ 421].nbits = 10; gv_local.lookup_slx_nse[ 421].bits = 0xCFC00000;
-  gv_local.lookup_slx_nse[ 422].nbits = 10; gv_local.lookup_slx_nse[ 422].bits = 0xC3C00000;
-  gv_local.lookup_slx_nse[ 423].nbits = 10; gv_local.lookup_slx_nse[ 423].bits = 0xC6000000;
-  gv_local.lookup_slx_nse[ 424].nbits = 10; gv_local.lookup_slx_nse[ 424].bits = 0xD9400000;
-  gv_local.lookup_slx_nse[ 425].nbits = 10; gv_local.lookup_slx_nse[ 425].bits = 0xCB000000;
-  gv_local.lookup_slx_nse[ 426].nbits = 10; gv_local.lookup_slx_nse[ 426].bits = 0xCC000000;
-  gv_local.lookup_slx_nse[ 427].nbits = 10; gv_local.lookup_slx_nse[ 427].bits = 0x7C000000;
-  gv_local.lookup_slx_nse[ 428].nbits = 10; gv_local.lookup_slx_nse[ 428].bits = 0xCBC00000;
-  gv_local.lookup_slx_nse[ 429].nbits = 10; gv_local.lookup_slx_nse[ 429].bits = 0x77400000;
-  gv_local.lookup_slx_nse[ 430].nbits = 10; gv_local.lookup_slx_nse[ 430].bits = 0xC2400000;
-  gv_local.lookup_slx_nse[ 431].nbits = 10; gv_local.lookup_slx_nse[ 431].bits = 0xC7800000;
-  gv_local.lookup_slx_nse[ 432].nbits = 10; gv_local.lookup_slx_nse[ 432].bits = 0xC1C00000;
-  gv_local.lookup_slx_nse[ 433].nbits = 10; gv_local.lookup_slx_nse[ 433].bits = 0xC0800000;
-  gv_local.lookup_slx_nse[ 434].nbits = 10; gv_local.lookup_slx_nse[ 434].bits = 0xC5400000;
-  gv_local.lookup_slx_nse[ 435].nbits = 10; gv_local.lookup_slx_nse[ 435].bits = 0x7E400000;
-  gv_local.lookup_slx_nse[ 436].nbits = 10; gv_local.lookup_slx_nse[ 436].bits = 0x7E000000;
-  gv_local.lookup_slx_nse[ 437].nbits = 10; gv_local.lookup_slx_nse[ 437].bits = 0xC1000000;
-  gv_local.lookup_slx_nse[ 438].nbits = 10; gv_local.lookup_slx_nse[ 438].bits = 0xC5C00000;
-  gv_local.lookup_slx_nse[ 439].nbits = 10; gv_local.lookup_slx_nse[ 439].bits = 0x7A400000;
-  gv_local.lookup_slx_nse[ 440].nbits = 10; gv_local.lookup_slx_nse[ 440].bits = 0x7A000000;
-  gv_local.lookup_slx_nse[ 441].nbits = 10; gv_local.lookup_slx_nse[ 441].bits = 0x70400000;
-  gv_local.lookup_slx_nse[ 442].nbits = 10; gv_local.lookup_slx_nse[ 442].bits = 0x7F000000;
-  gv_local.lookup_slx_nse[ 443].nbits = 10; gv_local.lookup_slx_nse[ 443].bits = 0x73400000;
-  gv_local.lookup_slx_nse[ 444].nbits = 10; gv_local.lookup_slx_nse[ 444].bits = 0x7C800000;
-  gv_local.lookup_slx_nse[ 445].nbits = 10; gv_local.lookup_slx_nse[ 445].bits = 0x7B400000;
-  gv_local.lookup_slx_nse[ 446].nbits = 10; gv_local.lookup_slx_nse[ 446].bits = 0x74C00000;
-  gv_local.lookup_slx_nse[ 447].nbits = 10; gv_local.lookup_slx_nse[ 447].bits = 0x6E800000;
-  gv_local.lookup_slx_nse[ 448].nbits = 10; gv_local.lookup_slx_nse[ 448].bits = 0x77C00000;
-  gv_local.lookup_slx_nse[ 449].nbits = 10; gv_local.lookup_slx_nse[ 449].bits = 0x73000000;
-  gv_local.lookup_slx_nse[ 450].nbits = 10; gv_local.lookup_slx_nse[ 450].bits = 0x71800000;
-  gv_local.lookup_slx_nse[ 451].nbits = 10; gv_local.lookup_slx_nse[ 451].bits = 0x6C400000;
-  gv_local.lookup_slx_nse[ 452].nbits = 10; gv_local.lookup_slx_nse[ 452].bits = 0x68C00000;
-  gv_local.lookup_slx_nse[ 453].nbits = 10; gv_local.lookup_slx_nse[ 453].bits = 0x71C00000;
-  gv_local.lookup_slx_nse[ 454].nbits = 10; gv_local.lookup_slx_nse[ 454].bits = 0x68800000;
-  gv_local.lookup_slx_nse[ 455].nbits = 10; gv_local.lookup_slx_nse[ 455].bits = 0x69C00000;
-  gv_local.lookup_slx_nse[ 456].nbits = 10; gv_local.lookup_slx_nse[ 456].bits = 0x6EC00000;
-  gv_local.lookup_slx_nse[ 457].nbits = 10; gv_local.lookup_slx_nse[ 457].bits = 0x65000000;
-  gv_local.lookup_slx_nse[ 458].nbits = 10; gv_local.lookup_slx_nse[ 458].bits = 0x67800000;
-  gv_local.lookup_slx_nse[ 459].nbits = 10; gv_local.lookup_slx_nse[ 459].bits = 0x5C400000;
-  gv_local.lookup_slx_nse[ 460].nbits = 10; gv_local.lookup_slx_nse[ 460].bits = 0x56400000;
-  gv_local.lookup_slx_nse[ 461].nbits = 10; gv_local.lookup_slx_nse[ 461].bits = 0x63400000;
-  gv_local.lookup_slx_nse[ 462].nbits = 10; gv_local.lookup_slx_nse[ 462].bits = 0x60C00000;
-  gv_local.lookup_slx_nse[ 463].nbits = 10; gv_local.lookup_slx_nse[ 463].bits = 0x65400000;
-  gv_local.lookup_slx_nse[ 464].nbits = 10; gv_local.lookup_slx_nse[ 464].bits = 0x66000000;
-  gv_local.lookup_slx_nse[ 465].nbits = 10; gv_local.lookup_slx_nse[ 465].bits = 0x63C00000;
-  gv_local.lookup_slx_nse[ 466].nbits = 10; gv_local.lookup_slx_nse[ 466].bits = 0x5AC00000;
-  gv_local.lookup_slx_nse[ 467].nbits = 10; gv_local.lookup_slx_nse[ 467].bits = 0x55400000;
-  gv_local.lookup_slx_nse[ 468].nbits = 10; gv_local.lookup_slx_nse[ 468].bits = 0x63000000;
-  gv_local.lookup_slx_nse[ 469].nbits = 10; gv_local.lookup_slx_nse[ 469].bits = 0x5A800000;
-  gv_local.lookup_slx_nse[ 470].nbits = 10; gv_local.lookup_slx_nse[ 470].bits = 0x55000000;
-  gv_local.lookup_slx_nse[ 471].nbits = 10; gv_local.lookup_slx_nse[ 471].bits = 0x58000000;
-  gv_local.lookup_slx_nse[ 472].nbits = 10; gv_local.lookup_slx_nse[ 472].bits = 0x4D000000;
-  gv_local.lookup_slx_nse[ 473].nbits = 10; gv_local.lookup_slx_nse[ 473].bits = 0x50C00000;
-  gv_local.lookup_slx_nse[ 474].nbits = 10; gv_local.lookup_slx_nse[ 474].bits = 0x46800000;
-  gv_local.lookup_slx_nse[ 475].nbits = 10; gv_local.lookup_slx_nse[ 475].bits = 0x44800000;
-  gv_local.lookup_slx_nse[ 476].nbits = 10; gv_local.lookup_slx_nse[ 476].bits = 0x4C000000;
-  gv_local.lookup_slx_nse[ 477].nbits = 10; gv_local.lookup_slx_nse[ 477].bits = 0x52400000;
-  gv_local.lookup_slx_nse[ 478].nbits = 10; gv_local.lookup_slx_nse[ 478].bits = 0x4D400000;
-  gv_local.lookup_slx_nse[ 479].nbits = 10; gv_local.lookup_slx_nse[ 479].bits = 0x42400000;
-  gv_local.lookup_slx_nse[ 480].nbits = 10; gv_local.lookup_slx_nse[ 480].bits = 0x42000000;
-  gv_local.lookup_slx_nse[ 481].nbits = 10; gv_local.lookup_slx_nse[ 481].bits = 0x42800000;
-  gv_local.lookup_slx_nse[ 482].nbits = 10; gv_local.lookup_slx_nse[ 482].bits = 0x27800000;
-  gv_local.lookup_slx_nse[ 483].nbits = 10; gv_local.lookup_slx_nse[ 483].bits = 0x46000000;
-  gv_local.lookup_slx_nse[ 484].nbits = 10; gv_local.lookup_slx_nse[ 484].bits = 0x44C00000;
-  gv_local.lookup_slx_nse[ 485].nbits = 10; gv_local.lookup_slx_nse[ 485].bits = 0x3C800000;
-  gv_local.lookup_slx_nse[ 486].nbits = 10; gv_local.lookup_slx_nse[ 486].bits = 0x4C400000;
-  gv_local.lookup_slx_nse[ 487].nbits = 10; gv_local.lookup_slx_nse[ 487].bits = 0x14800000;
-  gv_local.lookup_slx_nse[ 488].nbits = 10; gv_local.lookup_slx_nse[ 488].bits = 0x22C00000;
-  gv_local.lookup_slx_nse[ 489].nbits = 11; gv_local.lookup_slx_nse[ 489].bits = 0xFE000000;
-  gv_local.lookup_slx_nse[ 490].nbits = 10; gv_local.lookup_slx_nse[ 490].bits = 0x0A400000;
-  gv_local.lookup_slx_nse[ 491].nbits = 11; gv_local.lookup_slx_nse[ 491].bits = 0xFDC00000;
-  gv_local.lookup_slx_nse[ 492].nbits = 10; gv_local.lookup_slx_nse[ 492].bits = 0x14C00000;
-  gv_local.lookup_slx_nse[ 493].nbits = 10; gv_local.lookup_slx_nse[ 493].bits = 0x01C00000;
-  gv_local.lookup_slx_nse[ 494].nbits = 11; gv_local.lookup_slx_nse[ 494].bits = 0xFE200000;
-  gv_local.lookup_slx_nse[ 495].nbits = 11; gv_local.lookup_slx_nse[ 495].bits = 0xFDE00000;
-  gv_local.lookup_slx_nse[ 496].nbits = 10; gv_local.lookup_slx_nse[ 496].bits = 0x01800000;
-  gv_local.lookup_slx_nse[ 497].nbits = 11; gv_local.lookup_slx_nse[ 497].bits = 0xF6400000;
-  gv_local.lookup_slx_nse[ 498].nbits = 11; gv_local.lookup_slx_nse[ 498].bits = 0xF2E00000;
-  gv_local.lookup_slx_nse[ 499].nbits = 11; gv_local.lookup_slx_nse[ 499].bits = 0xEE600000;
-  gv_local.lookup_slx_nse[ 500].nbits = 11; gv_local.lookup_slx_nse[ 500].bits = 0xEBE00000;
-  gv_local.lookup_slx_nse[ 501].nbits = 11; gv_local.lookup_slx_nse[ 501].bits = 0xCE600000;
-  gv_local.lookup_slx_nse[ 502].nbits = 11; gv_local.lookup_slx_nse[ 502].bits = 0xE8200000;
-  gv_local.lookup_slx_nse[ 503].nbits = 11; gv_local.lookup_slx_nse[ 503].bits = 0xDA200000;
-  gv_local.lookup_slx_nse[ 504].nbits = 11; gv_local.lookup_slx_nse[ 504].bits = 0xD0200000;
-  gv_local.lookup_slx_nse[ 505].nbits = 11; gv_local.lookup_slx_nse[ 505].bits = 0xDFE00000;
-  gv_local.lookup_slx_nse[ 506].nbits = 11; gv_local.lookup_slx_nse[ 506].bits = 0xDB600000;
-  gv_local.lookup_slx_nse[ 507].nbits = 11; gv_local.lookup_slx_nse[ 507].bits = 0xD5200000;
-  gv_local.lookup_slx_nse[ 508].nbits = 11; gv_local.lookup_slx_nse[ 508].bits = 0xDB400000;
-  gv_local.lookup_slx_nse[ 509].nbits = 11; gv_local.lookup_slx_nse[ 509].bits = 0xDDC00000;
-  gv_local.lookup_slx_nse[ 510].nbits = 11; gv_local.lookup_slx_nse[ 510].bits = 0xC6800000;
-  gv_local.lookup_slx_nse[ 511].nbits =  2; gv_local.lookup_slx_nse[ 511].bits = 0x80000000;
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_slx_nse, 0, sizeof(uint16_t)*REV_HUFF_TREESIZE_16);
-
-  for (i=0; i<NSE_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_slx_nse[i].bits >> 16;
-    gv_local.rlookup_slx_nse [val] = (uint16_t) i;
-    for (j=1; j<=(0xFFFF>>gv_local.lookup_slx_nse[i].nbits); j++)
-      gv_local.rlookup_slx_nse [val+j] = (uint16_t) i;
-  }
-#endif
-
-  _s_sort_lookup (gv_local.lookup_slx_nse, gv_local.idx_slx_nse, NSE_HUFF_TREESIZE);
-
-  gv_local.lookup_slx_nse_initialized = 1;
-}
-
-/*
- */
-static void _s_init_seq_default (void)
-{
-  memcpy (gv_local.conv2to4na[  0], "AAAA", 4);  memcpy (gv_local.conv2to4na[  1], "AAAC", 4);
-  memcpy (gv_local.conv2to4na[  2], "AAAG", 4);  memcpy (gv_local.conv2to4na[  3], "AAAT", 4);
-  memcpy (gv_local.conv2to4na[  4], "AACA", 4);  memcpy (gv_local.conv2to4na[  5], "AACC", 4);
-  memcpy (gv_local.conv2to4na[  6], "AACG", 4);  memcpy (gv_local.conv2to4na[  7], "AACT", 4);
-  memcpy (gv_local.conv2to4na[  8], "AAGA", 4);  memcpy (gv_local.conv2to4na[  9], "AAGC", 4);
-  memcpy (gv_local.conv2to4na[ 10], "AAGG", 4);  memcpy (gv_local.conv2to4na[ 11], "AAGT", 4);
-  memcpy (gv_local.conv2to4na[ 12], "AATA", 4);  memcpy (gv_local.conv2to4na[ 13], "AATC", 4);
-  memcpy (gv_local.conv2to4na[ 14], "AATG", 4);  memcpy (gv_local.conv2to4na[ 15], "AATT", 4);
-  memcpy (gv_local.conv2to4na[ 16], "ACAA", 4);  memcpy (gv_local.conv2to4na[ 17], "ACAC", 4);
-  memcpy (gv_local.conv2to4na[ 18], "ACAG", 4);  memcpy (gv_local.conv2to4na[ 19], "ACAT", 4);
-  memcpy (gv_local.conv2to4na[ 20], "ACCA", 4);  memcpy (gv_local.conv2to4na[ 21], "ACCC", 4);
-  memcpy (gv_local.conv2to4na[ 22], "ACCG", 4);  memcpy (gv_local.conv2to4na[ 23], "ACCT", 4);
-  memcpy (gv_local.conv2to4na[ 24], "ACGA", 4);  memcpy (gv_local.conv2to4na[ 25], "ACGC", 4);
-  memcpy (gv_local.conv2to4na[ 26], "ACGG", 4);  memcpy (gv_local.conv2to4na[ 27], "ACGT", 4);
-  memcpy (gv_local.conv2to4na[ 28], "ACTA", 4);  memcpy (gv_local.conv2to4na[ 29], "ACTC", 4);
-  memcpy (gv_local.conv2to4na[ 30], "ACTG", 4);  memcpy (gv_local.conv2to4na[ 31], "ACTT", 4);
-  memcpy (gv_local.conv2to4na[ 32], "AGAA", 4);  memcpy (gv_local.conv2to4na[ 33], "AGAC", 4);
-  memcpy (gv_local.conv2to4na[ 34], "AGAG", 4);  memcpy (gv_local.conv2to4na[ 35], "AGAT", 4);
-  memcpy (gv_local.conv2to4na[ 36], "AGCA", 4);  memcpy (gv_local.conv2to4na[ 37], "AGCC", 4);
-  memcpy (gv_local.conv2to4na[ 38], "AGCG", 4);  memcpy (gv_local.conv2to4na[ 39], "AGCT", 4);
-  memcpy (gv_local.conv2to4na[ 40], "AGGA", 4);  memcpy (gv_local.conv2to4na[ 41], "AGGC", 4);
-  memcpy (gv_local.conv2to4na[ 42], "AGGG", 4);  memcpy (gv_local.conv2to4na[ 43], "AGGT", 4);
-  memcpy (gv_local.conv2to4na[ 44], "AGTA", 4);  memcpy (gv_local.conv2to4na[ 45], "AGTC", 4);
-  memcpy (gv_local.conv2to4na[ 46], "AGTG", 4);  memcpy (gv_local.conv2to4na[ 47], "AGTT", 4);
-  memcpy (gv_local.conv2to4na[ 48], "ATAA", 4);  memcpy (gv_local.conv2to4na[ 49], "ATAC", 4);
-  memcpy (gv_local.conv2to4na[ 50], "ATAG", 4);  memcpy (gv_local.conv2to4na[ 51], "ATAT", 4);
-  memcpy (gv_local.conv2to4na[ 52], "ATCA", 4);  memcpy (gv_local.conv2to4na[ 53], "ATCC", 4);
-  memcpy (gv_local.conv2to4na[ 54], "ATCG", 4);  memcpy (gv_local.conv2to4na[ 55], "ATCT", 4);
-  memcpy (gv_local.conv2to4na[ 56], "ATGA", 4);  memcpy (gv_local.conv2to4na[ 57], "ATGC", 4);
-  memcpy (gv_local.conv2to4na[ 58], "ATGG", 4);  memcpy (gv_local.conv2to4na[ 59], "ATGT", 4);
-  memcpy (gv_local.conv2to4na[ 60], "ATTA", 4);  memcpy (gv_local.conv2to4na[ 61], "ATTC", 4);
-  memcpy (gv_local.conv2to4na[ 62], "ATTG", 4);  memcpy (gv_local.conv2to4na[ 63], "ATTT", 4);
-  memcpy (gv_local.conv2to4na[ 64], "CAAA", 4);  memcpy (gv_local.conv2to4na[ 65], "CAAC", 4);
-  memcpy (gv_local.conv2to4na[ 66], "CAAG", 4);  memcpy (gv_local.conv2to4na[ 67], "CAAT", 4);
-  memcpy (gv_local.conv2to4na[ 68], "CACA", 4);  memcpy (gv_local.conv2to4na[ 69], "CACC", 4);
-  memcpy (gv_local.conv2to4na[ 70], "CACG", 4);  memcpy (gv_local.conv2to4na[ 71], "CACT", 4);
-  memcpy (gv_local.conv2to4na[ 72], "CAGA", 4);  memcpy (gv_local.conv2to4na[ 73], "CAGC", 4);
-  memcpy (gv_local.conv2to4na[ 74], "CAGG", 4);  memcpy (gv_local.conv2to4na[ 75], "CAGT", 4);
-  memcpy (gv_local.conv2to4na[ 76], "CATA", 4);  memcpy (gv_local.conv2to4na[ 77], "CATC", 4);
-  memcpy (gv_local.conv2to4na[ 78], "CATG", 4);  memcpy (gv_local.conv2to4na[ 79], "CATT", 4);
-  memcpy (gv_local.conv2to4na[ 80], "CCAA", 4);  memcpy (gv_local.conv2to4na[ 81], "CCAC", 4);
-  memcpy (gv_local.conv2to4na[ 82], "CCAG", 4);  memcpy (gv_local.conv2to4na[ 83], "CCAT", 4);
-  memcpy (gv_local.conv2to4na[ 84], "CCCA", 4);  memcpy (gv_local.conv2to4na[ 85], "CCCC", 4);
-  memcpy (gv_local.conv2to4na[ 86], "CCCG", 4);  memcpy (gv_local.conv2to4na[ 87], "CCCT", 4);
-  memcpy (gv_local.conv2to4na[ 88], "CCGA", 4);  memcpy (gv_local.conv2to4na[ 89], "CCGC", 4);
-  memcpy (gv_local.conv2to4na[ 90], "CCGG", 4);  memcpy (gv_local.conv2to4na[ 91], "CCGT", 4);
-  memcpy (gv_local.conv2to4na[ 92], "CCTA", 4);  memcpy (gv_local.conv2to4na[ 93], "CCTC", 4);
-  memcpy (gv_local.conv2to4na[ 94], "CCTG", 4);  memcpy (gv_local.conv2to4na[ 95], "CCTT", 4);
-  memcpy (gv_local.conv2to4na[ 96], "CGAA", 4);  memcpy (gv_local.conv2to4na[ 97], "CGAC", 4);
-  memcpy (gv_local.conv2to4na[ 98], "CGAG", 4);  memcpy (gv_local.conv2to4na[ 99], "CGAT", 4);
-  memcpy (gv_local.conv2to4na[100], "CGCA", 4);  memcpy (gv_local.conv2to4na[101], "CGCC", 4);
-  memcpy (gv_local.conv2to4na[102], "CGCG", 4);  memcpy (gv_local.conv2to4na[103], "CGCT", 4);
-  memcpy (gv_local.conv2to4na[104], "CGGA", 4);  memcpy (gv_local.conv2to4na[105], "CGGC", 4);
-  memcpy (gv_local.conv2to4na[106], "CGGG", 4);  memcpy (gv_local.conv2to4na[107], "CGGT", 4);
-  memcpy (gv_local.conv2to4na[108], "CGTA", 4);  memcpy (gv_local.conv2to4na[109], "CGTC", 4);
-  memcpy (gv_local.conv2to4na[110], "CGTG", 4);  memcpy (gv_local.conv2to4na[111], "CGTT", 4);
-  memcpy (gv_local.conv2to4na[112], "CTAA", 4);  memcpy (gv_local.conv2to4na[113], "CTAC", 4);
-  memcpy (gv_local.conv2to4na[114], "CTAG", 4);  memcpy (gv_local.conv2to4na[115], "CTAT", 4);
-  memcpy (gv_local.conv2to4na[116], "CTCA", 4);  memcpy (gv_local.conv2to4na[117], "CTCC", 4);
-  memcpy (gv_local.conv2to4na[118], "CTCG", 4);  memcpy (gv_local.conv2to4na[119], "CTCT", 4);
-  memcpy (gv_local.conv2to4na[120], "CTGA", 4);  memcpy (gv_local.conv2to4na[121], "CTGC", 4);
-  memcpy (gv_local.conv2to4na[122], "CTGG", 4);  memcpy (gv_local.conv2to4na[123], "CTGT", 4);
-  memcpy (gv_local.conv2to4na[124], "CTTA", 4);  memcpy (gv_local.conv2to4na[125], "CTTC", 4);
-  memcpy (gv_local.conv2to4na[126], "CTTG", 4);  memcpy (gv_local.conv2to4na[127], "CTTT", 4);
-  memcpy (gv_local.conv2to4na[128], "GAAA", 4);  memcpy (gv_local.conv2to4na[129], "GAAC", 4);
-  memcpy (gv_local.conv2to4na[130], "GAAG", 4);  memcpy (gv_local.conv2to4na[131], "GAAT", 4);
-  memcpy (gv_local.conv2to4na[132], "GACA", 4);  memcpy (gv_local.conv2to4na[133], "GACC", 4);
-  memcpy (gv_local.conv2to4na[134], "GACG", 4);  memcpy (gv_local.conv2to4na[135], "GACT", 4);
-  memcpy (gv_local.conv2to4na[136], "GAGA", 4);  memcpy (gv_local.conv2to4na[137], "GAGC", 4);
-  memcpy (gv_local.conv2to4na[138], "GAGG", 4);  memcpy (gv_local.conv2to4na[139], "GAGT", 4);
-  memcpy (gv_local.conv2to4na[140], "GATA", 4);  memcpy (gv_local.conv2to4na[141], "GATC", 4);
-  memcpy (gv_local.conv2to4na[142], "GATG", 4);  memcpy (gv_local.conv2to4na[143], "GATT", 4);
-  memcpy (gv_local.conv2to4na[144], "GCAA", 4);  memcpy (gv_local.conv2to4na[145], "GCAC", 4);
-  memcpy (gv_local.conv2to4na[146], "GCAG", 4);  memcpy (gv_local.conv2to4na[147], "GCAT", 4);
-  memcpy (gv_local.conv2to4na[148], "GCCA", 4);  memcpy (gv_local.conv2to4na[149], "GCCC", 4);
-  memcpy (gv_local.conv2to4na[150], "GCCG", 4);  memcpy (gv_local.conv2to4na[151], "GCCT", 4);
-  memcpy (gv_local.conv2to4na[152], "GCGA", 4);  memcpy (gv_local.conv2to4na[153], "GCGC", 4);
-  memcpy (gv_local.conv2to4na[154], "GCGG", 4);  memcpy (gv_local.conv2to4na[155], "GCGT", 4);
-  memcpy (gv_local.conv2to4na[156], "GCTA", 4);  memcpy (gv_local.conv2to4na[157], "GCTC", 4);
-  memcpy (gv_local.conv2to4na[158], "GCTG", 4);  memcpy (gv_local.conv2to4na[159], "GCTT", 4);
-  memcpy (gv_local.conv2to4na[160], "GGAA", 4);  memcpy (gv_local.conv2to4na[161], "GGAC", 4);
-  memcpy (gv_local.conv2to4na[162], "GGAG", 4);  memcpy (gv_local.conv2to4na[163], "GGAT", 4);
-  memcpy (gv_local.conv2to4na[164], "GGCA", 4);  memcpy (gv_local.conv2to4na[165], "GGCC", 4);
-  memcpy (gv_local.conv2to4na[166], "GGCG", 4);  memcpy (gv_local.conv2to4na[167], "GGCT", 4);
-  memcpy (gv_local.conv2to4na[168], "GGGA", 4);  memcpy (gv_local.conv2to4na[169], "GGGC", 4);
-  memcpy (gv_local.conv2to4na[170], "GGGG", 4);  memcpy (gv_local.conv2to4na[171], "GGGT", 4);
-  memcpy (gv_local.conv2to4na[172], "GGTA", 4);  memcpy (gv_local.conv2to4na[173], "GGTC", 4);
-  memcpy (gv_local.conv2to4na[174], "GGTG", 4);  memcpy (gv_local.conv2to4na[175], "GGTT", 4);
-  memcpy (gv_local.conv2to4na[176], "GTAA", 4);  memcpy (gv_local.conv2to4na[177], "GTAC", 4);
-  memcpy (gv_local.conv2to4na[178], "GTAG", 4);  memcpy (gv_local.conv2to4na[179], "GTAT", 4);
-  memcpy (gv_local.conv2to4na[180], "GTCA", 4);  memcpy (gv_local.conv2to4na[181], "GTCC", 4);
-  memcpy (gv_local.conv2to4na[182], "GTCG", 4);  memcpy (gv_local.conv2to4na[183], "GTCT", 4);
-  memcpy (gv_local.conv2to4na[184], "GTGA", 4);  memcpy (gv_local.conv2to4na[185], "GTGC", 4);
-  memcpy (gv_local.conv2to4na[186], "GTGG", 4);  memcpy (gv_local.conv2to4na[187], "GTGT", 4);
-  memcpy (gv_local.conv2to4na[188], "GTTA", 4);  memcpy (gv_local.conv2to4na[189], "GTTC", 4);
-  memcpy (gv_local.conv2to4na[190], "GTTG", 4);  memcpy (gv_local.conv2to4na[191], "GTTT", 4);
-  memcpy (gv_local.conv2to4na[192], "TAAA", 4);  memcpy (gv_local.conv2to4na[193], "TAAC", 4);
-  memcpy (gv_local.conv2to4na[194], "TAAG", 4);  memcpy (gv_local.conv2to4na[195], "TAAT", 4);
-  memcpy (gv_local.conv2to4na[196], "TACA", 4);  memcpy (gv_local.conv2to4na[197], "TACC", 4);
-  memcpy (gv_local.conv2to4na[198], "TACG", 4);  memcpy (gv_local.conv2to4na[199], "TACT", 4);
-  memcpy (gv_local.conv2to4na[200], "TAGA", 4);  memcpy (gv_local.conv2to4na[201], "TAGC", 4);
-  memcpy (gv_local.conv2to4na[202], "TAGG", 4);  memcpy (gv_local.conv2to4na[203], "TAGT", 4);
-  memcpy (gv_local.conv2to4na[204], "TATA", 4);  memcpy (gv_local.conv2to4na[205], "TATC", 4);
-  memcpy (gv_local.conv2to4na[206], "TATG", 4);  memcpy (gv_local.conv2to4na[207], "TATT", 4);
-  memcpy (gv_local.conv2to4na[208], "TCAA", 4);  memcpy (gv_local.conv2to4na[209], "TCAC", 4);
-  memcpy (gv_local.conv2to4na[210], "TCAG", 4);  memcpy (gv_local.conv2to4na[211], "TCAT", 4);
-  memcpy (gv_local.conv2to4na[212], "TCCA", 4);  memcpy (gv_local.conv2to4na[213], "TCCC", 4);
-  memcpy (gv_local.conv2to4na[214], "TCCG", 4);  memcpy (gv_local.conv2to4na[215], "TCCT", 4);
-  memcpy (gv_local.conv2to4na[216], "TCGA", 4);  memcpy (gv_local.conv2to4na[217], "TCGC", 4);
-  memcpy (gv_local.conv2to4na[218], "TCGG", 4);  memcpy (gv_local.conv2to4na[219], "TCGT", 4);
-  memcpy (gv_local.conv2to4na[220], "TCTA", 4);  memcpy (gv_local.conv2to4na[221], "TCTC", 4);
-  memcpy (gv_local.conv2to4na[222], "TCTG", 4);  memcpy (gv_local.conv2to4na[223], "TCTT", 4);
-  memcpy (gv_local.conv2to4na[224], "TGAA", 4);  memcpy (gv_local.conv2to4na[225], "TGAC", 4);
-  memcpy (gv_local.conv2to4na[226], "TGAG", 4);  memcpy (gv_local.conv2to4na[227], "TGAT", 4);
-  memcpy (gv_local.conv2to4na[228], "TGCA", 4);  memcpy (gv_local.conv2to4na[229], "TGCC", 4);
-  memcpy (gv_local.conv2to4na[230], "TGCG", 4);  memcpy (gv_local.conv2to4na[231], "TGCT", 4);
-  memcpy (gv_local.conv2to4na[232], "TGGA", 4);  memcpy (gv_local.conv2to4na[233], "TGGC", 4);
-  memcpy (gv_local.conv2to4na[234], "TGGG", 4);  memcpy (gv_local.conv2to4na[235], "TGGT", 4);
-  memcpy (gv_local.conv2to4na[236], "TGTA", 4);  memcpy (gv_local.conv2to4na[237], "TGTC", 4);
-  memcpy (gv_local.conv2to4na[238], "TGTG", 4);  memcpy (gv_local.conv2to4na[239], "TGTT", 4);
-  memcpy (gv_local.conv2to4na[240], "TTAA", 4);  memcpy (gv_local.conv2to4na[241], "TTAC", 4);
-  memcpy (gv_local.conv2to4na[242], "TTAG", 4);  memcpy (gv_local.conv2to4na[243], "TTAT", 4);
-  memcpy (gv_local.conv2to4na[244], "TTCA", 4);  memcpy (gv_local.conv2to4na[245], "TTCC", 4);
-  memcpy (gv_local.conv2to4na[246], "TTCG", 4);  memcpy (gv_local.conv2to4na[247], "TTCT", 4);
-  memcpy (gv_local.conv2to4na[248], "TTGA", 4);  memcpy (gv_local.conv2to4na[249], "TTGC", 4);
-  memcpy (gv_local.conv2to4na[250], "TTGG", 4);  memcpy (gv_local.conv2to4na[251], "TTGT", 4);
-  memcpy (gv_local.conv2to4na[252], "TTTA", 4);  memcpy (gv_local.conv2to4na[253], "TTTC", 4);
-  memcpy (gv_local.conv2to4na[254], "TTTG", 4);  memcpy (gv_local.conv2to4na[255], "TTTT", 4);
-
-  memcpy (gv_local.conv2to4cs[  0], "0000", 4);  memcpy (gv_local.conv2to4cs[  1], "0001", 4);
-  memcpy (gv_local.conv2to4cs[  2], "0002", 4);  memcpy (gv_local.conv2to4cs[  3], "0003", 4);
-  memcpy (gv_local.conv2to4cs[  4], "0010", 4);  memcpy (gv_local.conv2to4cs[  5], "0011", 4);
-  memcpy (gv_local.conv2to4cs[  6], "0012", 4);  memcpy (gv_local.conv2to4cs[  7], "0013", 4);
-  memcpy (gv_local.conv2to4cs[  8], "0020", 4);  memcpy (gv_local.conv2to4cs[  9], "0021", 4);
-  memcpy (gv_local.conv2to4cs[ 10], "0022", 4);  memcpy (gv_local.conv2to4cs[ 11], "0023", 4);
-  memcpy (gv_local.conv2to4cs[ 12], "0030", 4);  memcpy (gv_local.conv2to4cs[ 13], "0031", 4);
-  memcpy (gv_local.conv2to4cs[ 14], "0032", 4);  memcpy (gv_local.conv2to4cs[ 15], "0033", 4);
-  memcpy (gv_local.conv2to4cs[ 16], "0100", 4);  memcpy (gv_local.conv2to4cs[ 17], "0101", 4);
-  memcpy (gv_local.conv2to4cs[ 18], "0102", 4);  memcpy (gv_local.conv2to4cs[ 19], "0103", 4);
-  memcpy (gv_local.conv2to4cs[ 20], "0110", 4);  memcpy (gv_local.conv2to4cs[ 21], "0111", 4);
-  memcpy (gv_local.conv2to4cs[ 22], "0112", 4);  memcpy (gv_local.conv2to4cs[ 23], "0113", 4);
-  memcpy (gv_local.conv2to4cs[ 24], "0120", 4);  memcpy (gv_local.conv2to4cs[ 25], "0121", 4);
-  memcpy (gv_local.conv2to4cs[ 26], "0122", 4);  memcpy (gv_local.conv2to4cs[ 27], "0123", 4);
-  memcpy (gv_local.conv2to4cs[ 28], "0130", 4);  memcpy (gv_local.conv2to4cs[ 29], "0131", 4);
-  memcpy (gv_local.conv2to4cs[ 30], "0132", 4);  memcpy (gv_local.conv2to4cs[ 31], "0133", 4);
-  memcpy (gv_local.conv2to4cs[ 32], "0200", 4);  memcpy (gv_local.conv2to4cs[ 33], "0201", 4);
-  memcpy (gv_local.conv2to4cs[ 34], "0202", 4);  memcpy (gv_local.conv2to4cs[ 35], "0203", 4);
-  memcpy (gv_local.conv2to4cs[ 36], "0210", 4);  memcpy (gv_local.conv2to4cs[ 37], "0211", 4);
-  memcpy (gv_local.conv2to4cs[ 38], "0212", 4);  memcpy (gv_local.conv2to4cs[ 39], "0213", 4);
-  memcpy (gv_local.conv2to4cs[ 40], "0220", 4);  memcpy (gv_local.conv2to4cs[ 41], "0221", 4);
-  memcpy (gv_local.conv2to4cs[ 42], "0222", 4);  memcpy (gv_local.conv2to4cs[ 43], "0223", 4);
-  memcpy (gv_local.conv2to4cs[ 44], "0230", 4);  memcpy (gv_local.conv2to4cs[ 45], "0231", 4);
-  memcpy (gv_local.conv2to4cs[ 46], "0232", 4);  memcpy (gv_local.conv2to4cs[ 47], "0233", 4);
-  memcpy (gv_local.conv2to4cs[ 48], "0300", 4);  memcpy (gv_local.conv2to4cs[ 49], "0301", 4);
-  memcpy (gv_local.conv2to4cs[ 50], "0302", 4);  memcpy (gv_local.conv2to4cs[ 51], "0303", 4);
-  memcpy (gv_local.conv2to4cs[ 52], "0310", 4);  memcpy (gv_local.conv2to4cs[ 53], "0311", 4);
-  memcpy (gv_local.conv2to4cs[ 54], "0312", 4);  memcpy (gv_local.conv2to4cs[ 55], "0313", 4);
-  memcpy (gv_local.conv2to4cs[ 56], "0320", 4);  memcpy (gv_local.conv2to4cs[ 57], "0321", 4);
-  memcpy (gv_local.conv2to4cs[ 58], "0322", 4);  memcpy (gv_local.conv2to4cs[ 59], "0323", 4);
-  memcpy (gv_local.conv2to4cs[ 60], "0330", 4);  memcpy (gv_local.conv2to4cs[ 61], "0331", 4);
-  memcpy (gv_local.conv2to4cs[ 62], "0332", 4);  memcpy (gv_local.conv2to4cs[ 63], "0333", 4);
-  memcpy (gv_local.conv2to4cs[ 64], "1000", 4);  memcpy (gv_local.conv2to4cs[ 65], "1001", 4);
-  memcpy (gv_local.conv2to4cs[ 66], "1002", 4);  memcpy (gv_local.conv2to4cs[ 67], "1003", 4);
-  memcpy (gv_local.conv2to4cs[ 68], "1010", 4);  memcpy (gv_local.conv2to4cs[ 69], "1011", 4);
-  memcpy (gv_local.conv2to4cs[ 70], "1012", 4);  memcpy (gv_local.conv2to4cs[ 71], "1013", 4);
-  memcpy (gv_local.conv2to4cs[ 72], "1020", 4);  memcpy (gv_local.conv2to4cs[ 73], "1021", 4);
-  memcpy (gv_local.conv2to4cs[ 74], "1022", 4);  memcpy (gv_local.conv2to4cs[ 75], "1023", 4);
-  memcpy (gv_local.conv2to4cs[ 76], "1030", 4);  memcpy (gv_local.conv2to4cs[ 77], "1031", 4);
-  memcpy (gv_local.conv2to4cs[ 78], "1032", 4);  memcpy (gv_local.conv2to4cs[ 79], "1033", 4);
-  memcpy (gv_local.conv2to4cs[ 80], "1100", 4);  memcpy (gv_local.conv2to4cs[ 81], "1101", 4);
-  memcpy (gv_local.conv2to4cs[ 82], "1102", 4);  memcpy (gv_local.conv2to4cs[ 83], "1103", 4);
-  memcpy (gv_local.conv2to4cs[ 84], "1110", 4);  memcpy (gv_local.conv2to4cs[ 85], "1111", 4);
-  memcpy (gv_local.conv2to4cs[ 86], "1112", 4);  memcpy (gv_local.conv2to4cs[ 87], "1113", 4);
-  memcpy (gv_local.conv2to4cs[ 88], "1120", 4);  memcpy (gv_local.conv2to4cs[ 89], "1121", 4);
-  memcpy (gv_local.conv2to4cs[ 90], "1122", 4);  memcpy (gv_local.conv2to4cs[ 91], "1123", 4);
-  memcpy (gv_local.conv2to4cs[ 92], "1130", 4);  memcpy (gv_local.conv2to4cs[ 93], "1131", 4);
-  memcpy (gv_local.conv2to4cs[ 94], "1132", 4);  memcpy (gv_local.conv2to4cs[ 95], "1133", 4);
-  memcpy (gv_local.conv2to4cs[ 96], "1200", 4);  memcpy (gv_local.conv2to4cs[ 97], "1201", 4);
-  memcpy (gv_local.conv2to4cs[ 98], "1202", 4);  memcpy (gv_local.conv2to4cs[ 99], "1203", 4);
-  memcpy (gv_local.conv2to4cs[100], "1210", 4);  memcpy (gv_local.conv2to4cs[101], "1211", 4);
-  memcpy (gv_local.conv2to4cs[102], "1212", 4);  memcpy (gv_local.conv2to4cs[103], "1213", 4);
-  memcpy (gv_local.conv2to4cs[104], "1220", 4);  memcpy (gv_local.conv2to4cs[105], "1221", 4);
-  memcpy (gv_local.conv2to4cs[106], "1222", 4);  memcpy (gv_local.conv2to4cs[107], "1223", 4);
-  memcpy (gv_local.conv2to4cs[108], "1230", 4);  memcpy (gv_local.conv2to4cs[109], "1231", 4);
-  memcpy (gv_local.conv2to4cs[110], "1232", 4);  memcpy (gv_local.conv2to4cs[111], "1233", 4);
-  memcpy (gv_local.conv2to4cs[112], "1300", 4);  memcpy (gv_local.conv2to4cs[113], "1301", 4);
-  memcpy (gv_local.conv2to4cs[114], "1302", 4);  memcpy (gv_local.conv2to4cs[115], "1303", 4);
-  memcpy (gv_local.conv2to4cs[116], "1310", 4);  memcpy (gv_local.conv2to4cs[117], "1311", 4);
-  memcpy (gv_local.conv2to4cs[118], "1312", 4);  memcpy (gv_local.conv2to4cs[119], "1313", 4);
-  memcpy (gv_local.conv2to4cs[120], "1320", 4);  memcpy (gv_local.conv2to4cs[121], "1321", 4);
-  memcpy (gv_local.conv2to4cs[122], "1322", 4);  memcpy (gv_local.conv2to4cs[123], "1323", 4);
-  memcpy (gv_local.conv2to4cs[124], "1330", 4);  memcpy (gv_local.conv2to4cs[125], "1331", 4);
-  memcpy (gv_local.conv2to4cs[126], "1332", 4);  memcpy (gv_local.conv2to4cs[127], "1333", 4);
-  memcpy (gv_local.conv2to4cs[128], "2000", 4);  memcpy (gv_local.conv2to4cs[129], "2001", 4);
-  memcpy (gv_local.conv2to4cs[130], "2002", 4);  memcpy (gv_local.conv2to4cs[131], "2003", 4);
-  memcpy (gv_local.conv2to4cs[132], "2010", 4);  memcpy (gv_local.conv2to4cs[133], "2011", 4);
-  memcpy (gv_local.conv2to4cs[134], "2012", 4);  memcpy (gv_local.conv2to4cs[135], "2013", 4);
-  memcpy (gv_local.conv2to4cs[136], "2020", 4);  memcpy (gv_local.conv2to4cs[137], "2021", 4);
-  memcpy (gv_local.conv2to4cs[138], "2022", 4);  memcpy (gv_local.conv2to4cs[139], "2023", 4);
-  memcpy (gv_local.conv2to4cs[140], "2030", 4);  memcpy (gv_local.conv2to4cs[141], "2031", 4);
-  memcpy (gv_local.conv2to4cs[142], "2032", 4);  memcpy (gv_local.conv2to4cs[143], "2033", 4);
-  memcpy (gv_local.conv2to4cs[144], "2100", 4);  memcpy (gv_local.conv2to4cs[145], "2101", 4);
-  memcpy (gv_local.conv2to4cs[146], "2102", 4);  memcpy (gv_local.conv2to4cs[147], "2103", 4);
-  memcpy (gv_local.conv2to4cs[148], "2110", 4);  memcpy (gv_local.conv2to4cs[149], "2111", 4);
-  memcpy (gv_local.conv2to4cs[150], "2112", 4);  memcpy (gv_local.conv2to4cs[151], "2113", 4);
-  memcpy (gv_local.conv2to4cs[152], "2120", 4);  memcpy (gv_local.conv2to4cs[153], "2121", 4);
-  memcpy (gv_local.conv2to4cs[154], "2122", 4);  memcpy (gv_local.conv2to4cs[155], "2123", 4);
-  memcpy (gv_local.conv2to4cs[156], "2130", 4);  memcpy (gv_local.conv2to4cs[157], "2131", 4);
-  memcpy (gv_local.conv2to4cs[158], "2132", 4);  memcpy (gv_local.conv2to4cs[159], "2133", 4);
-  memcpy (gv_local.conv2to4cs[160], "2200", 4);  memcpy (gv_local.conv2to4cs[161], "2201", 4);
-  memcpy (gv_local.conv2to4cs[162], "2202", 4);  memcpy (gv_local.conv2to4cs[163], "2203", 4);
-  memcpy (gv_local.conv2to4cs[164], "2210", 4);  memcpy (gv_local.conv2to4cs[165], "2211", 4);
-  memcpy (gv_local.conv2to4cs[166], "2212", 4);  memcpy (gv_local.conv2to4cs[167], "2213", 4);
-  memcpy (gv_local.conv2to4cs[168], "2220", 4);  memcpy (gv_local.conv2to4cs[169], "2221", 4);
-  memcpy (gv_local.conv2to4cs[170], "2222", 4);  memcpy (gv_local.conv2to4cs[171], "2223", 4);
-  memcpy (gv_local.conv2to4cs[172], "2230", 4);  memcpy (gv_local.conv2to4cs[173], "2231", 4);
-  memcpy (gv_local.conv2to4cs[174], "2232", 4);  memcpy (gv_local.conv2to4cs[175], "2233", 4);
-  memcpy (gv_local.conv2to4cs[176], "2300", 4);  memcpy (gv_local.conv2to4cs[177], "2301", 4);
-  memcpy (gv_local.conv2to4cs[178], "2302", 4);  memcpy (gv_local.conv2to4cs[179], "2303", 4);
-  memcpy (gv_local.conv2to4cs[180], "2310", 4);  memcpy (gv_local.conv2to4cs[181], "2311", 4);
-  memcpy (gv_local.conv2to4cs[182], "2312", 4);  memcpy (gv_local.conv2to4cs[183], "2313", 4);
-  memcpy (gv_local.conv2to4cs[184], "2320", 4);  memcpy (gv_local.conv2to4cs[185], "2321", 4);
-  memcpy (gv_local.conv2to4cs[186], "2322", 4);  memcpy (gv_local.conv2to4cs[187], "2323", 4);
-  memcpy (gv_local.conv2to4cs[188], "2330", 4);  memcpy (gv_local.conv2to4cs[189], "2331", 4);
-  memcpy (gv_local.conv2to4cs[190], "2332", 4);  memcpy (gv_local.conv2to4cs[191], "2333", 4);
-  memcpy (gv_local.conv2to4cs[192], "3000", 4);  memcpy (gv_local.conv2to4cs[193], "3001", 4);
-  memcpy (gv_local.conv2to4cs[194], "3002", 4);  memcpy (gv_local.conv2to4cs[195], "3003", 4);
-  memcpy (gv_local.conv2to4cs[196], "3010", 4);  memcpy (gv_local.conv2to4cs[197], "3011", 4);
-  memcpy (gv_local.conv2to4cs[198], "3012", 4);  memcpy (gv_local.conv2to4cs[199], "3013", 4);
-  memcpy (gv_local.conv2to4cs[200], "3020", 4);  memcpy (gv_local.conv2to4cs[201], "3021", 4);
-  memcpy (gv_local.conv2to4cs[202], "3022", 4);  memcpy (gv_local.conv2to4cs[203], "3023", 4);
-  memcpy (gv_local.conv2to4cs[204], "3030", 4);  memcpy (gv_local.conv2to4cs[205], "3031", 4);
-  memcpy (gv_local.conv2to4cs[206], "3032", 4);  memcpy (gv_local.conv2to4cs[207], "3033", 4);
-  memcpy (gv_local.conv2to4cs[208], "3100", 4);  memcpy (gv_local.conv2to4cs[209], "3101", 4);
-  memcpy (gv_local.conv2to4cs[210], "3102", 4);  memcpy (gv_local.conv2to4cs[211], "3103", 4);
-  memcpy (gv_local.conv2to4cs[212], "3110", 4);  memcpy (gv_local.conv2to4cs[213], "3111", 4);
-  memcpy (gv_local.conv2to4cs[214], "3112", 4);  memcpy (gv_local.conv2to4cs[215], "3113", 4);
-  memcpy (gv_local.conv2to4cs[216], "3120", 4);  memcpy (gv_local.conv2to4cs[217], "3121", 4);
-  memcpy (gv_local.conv2to4cs[218], "3122", 4);  memcpy (gv_local.conv2to4cs[219], "3123", 4);
-  memcpy (gv_local.conv2to4cs[220], "3130", 4);  memcpy (gv_local.conv2to4cs[221], "3131", 4);
-  memcpy (gv_local.conv2to4cs[222], "3132", 4);  memcpy (gv_local.conv2to4cs[223], "3133", 4);
-  memcpy (gv_local.conv2to4cs[224], "3200", 4);  memcpy (gv_local.conv2to4cs[225], "3201", 4);
-  memcpy (gv_local.conv2to4cs[226], "3202", 4);  memcpy (gv_local.conv2to4cs[227], "3203", 4);
-  memcpy (gv_local.conv2to4cs[228], "3210", 4);  memcpy (gv_local.conv2to4cs[229], "3211", 4);
-  memcpy (gv_local.conv2to4cs[230], "3212", 4);  memcpy (gv_local.conv2to4cs[231], "3213", 4);
-  memcpy (gv_local.conv2to4cs[232], "3220", 4);  memcpy (gv_local.conv2to4cs[233], "3221", 4);
-  memcpy (gv_local.conv2to4cs[234], "3222", 4);  memcpy (gv_local.conv2to4cs[235], "3223", 4);
-  memcpy (gv_local.conv2to4cs[236], "3230", 4);  memcpy (gv_local.conv2to4cs[237], "3231", 4);
-  memcpy (gv_local.conv2to4cs[238], "3232", 4);  memcpy (gv_local.conv2to4cs[239], "3233", 4);
-  memcpy (gv_local.conv2to4cs[240], "3300", 4);  memcpy (gv_local.conv2to4cs[241], "3301", 4);
-  memcpy (gv_local.conv2to4cs[242], "3302", 4);  memcpy (gv_local.conv2to4cs[243], "3303", 4);
-  memcpy (gv_local.conv2to4cs[244], "3310", 4);  memcpy (gv_local.conv2to4cs[245], "3311", 4);
-  memcpy (gv_local.conv2to4cs[246], "3312", 4);  memcpy (gv_local.conv2to4cs[247], "3313", 4);
-  memcpy (gv_local.conv2to4cs[248], "3320", 4);  memcpy (gv_local.conv2to4cs[249], "3321", 4);
-  memcpy (gv_local.conv2to4cs[250], "3322", 4);  memcpy (gv_local.conv2to4cs[251], "3323", 4);
-  memcpy (gv_local.conv2to4cs[252], "3330", 4);  memcpy (gv_local.conv2to4cs[253], "3331", 4);
-  memcpy (gv_local.conv2to4cs[254], "3332", 4);  memcpy (gv_local.conv2to4cs[255], "3333", 4);
-  gv_local.lookup_454_seq_initialized = 1;
-}
-/*
- */
-static void _s_init_pos_454_default (void)
-{
-  memset (gv_local.lookup_454_pos, 0, sizeof(SRALookup)*POS_454_HUFF_TREESIZE);
-
-  gv_local.lookup_454_pos[  0].nbits =  2; gv_local.lookup_454_pos[  0].bits = 0xC0000000;
-  gv_local.lookup_454_pos[  1].nbits =  3; gv_local.lookup_454_pos[  1].bits = 0x20000000;
-  gv_local.lookup_454_pos[  2].nbits =  2; gv_local.lookup_454_pos[  2].bits = 0x40000000;
-  gv_local.lookup_454_pos[  3].nbits =  2; gv_local.lookup_454_pos[  3].bits = 0x80000000;
-  gv_local.lookup_454_pos[  4].nbits =  4; gv_local.lookup_454_pos[  4].bits = 0x10000000;
-  gv_local.lookup_454_pos[  5].nbits =  6; gv_local.lookup_454_pos[  5].bits = 0x04000000;
-  gv_local.lookup_454_pos[  6].nbits = 11; gv_local.lookup_454_pos[  6].bits = 0x0E400000;
-  gv_local.lookup_454_pos[  7].nbits =  8; gv_local.lookup_454_pos[  7].bits = 0x0F000000;
-  gv_local.lookup_454_pos[  8].nbits =  7; gv_local.lookup_454_pos[  8].bits = 0x0C000000;
-  gv_local.lookup_454_pos[  9].nbits =  9; gv_local.lookup_454_pos[  9].bits = 0x08800000;
-  gv_local.lookup_454_pos[ 10].nbits = 12; gv_local.lookup_454_pos[ 10].bits = 0x0A000000;
-  gv_local.lookup_454_pos[ 11].nbits =  6; gv_local.lookup_454_pos[ 11].bits = 0x00000000;
-  gv_local.lookup_454_pos[ 12].nbits =  8; gv_local.lookup_454_pos[ 12].bits = 0x09000000;
-  gv_local.lookup_454_pos[ 13].nbits = 11; gv_local.lookup_454_pos[ 13].bits = 0x0AC00000;
-  gv_local.lookup_454_pos[ 14].nbits = 14; gv_local.lookup_454_pos[ 14].bits = 0x0E240000;
-  gv_local.lookup_454_pos[ 15].nbits =  9; gv_local.lookup_454_pos[ 15].bits = 0x0E800000;
-  gv_local.lookup_454_pos[ 16].nbits =  9; gv_local.lookup_454_pos[ 16].bits = 0x0B000000;
-  gv_local.lookup_454_pos[ 17].nbits = 12; gv_local.lookup_454_pos[ 17].bits = 0x0A300000;
-  gv_local.lookup_454_pos[ 18].nbits = 13; gv_local.lookup_454_pos[ 18].bits = 0x08580000;
-  gv_local.lookup_454_pos[ 19].nbits = 12; gv_local.lookup_454_pos[ 19].bits = 0x0E600000;
-  gv_local.lookup_454_pos[ 20].nbits = 10; gv_local.lookup_454_pos[ 20].bits = 0x0B800000;
-  gv_local.lookup_454_pos[ 21].nbits = 13; gv_local.lookup_454_pos[ 21].bits = 0x08400000;
-  gv_local.lookup_454_pos[ 22].nbits = 14; gv_local.lookup_454_pos[ 22].bits = 0x08540000;
-  gv_local.lookup_454_pos[ 23].nbits = 13; gv_local.lookup_454_pos[ 23].bits = 0x0E280000;
-  gv_local.lookup_454_pos[ 24].nbits = 10; gv_local.lookup_454_pos[ 24].bits = 0x0A400000;
-  gv_local.lookup_454_pos[ 25].nbits = 13; gv_local.lookup_454_pos[ 25].bits = 0x0E000000;
-  gv_local.lookup_454_pos[ 26].nbits = 14; gv_local.lookup_454_pos[ 26].bits = 0x0E180000;
-  gv_local.lookup_454_pos[ 27].nbits = 13; gv_local.lookup_454_pos[ 27].bits = 0x0E380000;
-  gv_local.lookup_454_pos[ 28].nbits = 10; gv_local.lookup_454_pos[ 28].bits = 0x08000000;
-  gv_local.lookup_454_pos[ 29].nbits = 14; gv_local.lookup_454_pos[ 29].bits = 0x0E0C0000;
-  gv_local.lookup_454_pos[ 30].nbits = 15; gv_local.lookup_454_pos[ 30].bits = 0x0AB40000;
-  gv_local.lookup_454_pos[ 31].nbits = 13; gv_local.lookup_454_pos[ 31].bits = 0x0AA00000;
-  gv_local.lookup_454_pos[ 32].nbits = 11; gv_local.lookup_454_pos[ 32].bits = 0x0A800000;
-  gv_local.lookup_454_pos[ 33].nbits = 14; gv_local.lookup_454_pos[ 33].bits = 0x084C0000;
-  gv_local.lookup_454_pos[ 34].nbits = 16; gv_local.lookup_454_pos[ 34].bits = 0x0AB60000;
-  gv_local.lookup_454_pos[ 35].nbits = 14; gv_local.lookup_454_pos[ 35].bits = 0x0E200000;
-  gv_local.lookup_454_pos[ 36].nbits = 12; gv_local.lookup_454_pos[ 36].bits = 0x0E700000;
-  gv_local.lookup_454_pos[ 37].nbits = 14; gv_local.lookup_454_pos[ 37].bits = 0x0ABC0000;
-  gv_local.lookup_454_pos[ 38].nbits = 15; gv_local.lookup_454_pos[ 38].bits = 0x0E080000;
-  gv_local.lookup_454_pos[ 39].nbits = 13; gv_local.lookup_454_pos[ 39].bits = 0x0AA80000;
-  gv_local.lookup_454_pos[ 40].nbits = 11; gv_local.lookup_454_pos[ 40].bits = 0x08600000;
-  gv_local.lookup_454_pos[ 41].nbits = 14; gv_local.lookup_454_pos[ 41].bits = 0x0AB00000;
-  gv_local.lookup_454_pos[ 42].nbits = 16; gv_local.lookup_454_pos[ 42].bits = 0x0E1E0000;
-  gv_local.lookup_454_pos[ 43].nbits = 14; gv_local.lookup_454_pos[ 43].bits = 0x08500000;
-  gv_local.lookup_454_pos[ 44].nbits = 12; gv_local.lookup_454_pos[ 44].bits = 0x0AF00000;
-  gv_local.lookup_454_pos[ 45].nbits = 14; gv_local.lookup_454_pos[ 45].bits = 0x0A1C0000;
-  gv_local.lookup_454_pos[ 46].nbits = 14; gv_local.lookup_454_pos[ 46].bits = 0x08480000;
-  gv_local.lookup_454_pos[ 47].nbits = 13; gv_local.lookup_454_pos[ 47].bits = 0x0E300000;
-  gv_local.lookup_454_pos[ 48].nbits = 12; gv_local.lookup_454_pos[ 48].bits = 0x0AE00000;
-  gv_local.lookup_454_pos[ 49].nbits = 14; gv_local.lookup_454_pos[ 49].bits = 0x0AB80000;
-  gv_local.lookup_454_pos[ 50].nbits = 16; gv_local.lookup_454_pos[ 50].bits = 0x0A1B0000;
-  gv_local.lookup_454_pos[ 51].nbits = 15; gv_local.lookup_454_pos[ 51].bits = 0x0A180000;
-  gv_local.lookup_454_pos[ 52].nbits = 12; gv_local.lookup_454_pos[ 52].bits = 0x0A200000;
-  gv_local.lookup_454_pos[ 53].nbits = 15; gv_local.lookup_454_pos[ 53].bits = 0x0E1C0000;
-  gv_local.lookup_454_pos[ 54].nbits = 16; gv_local.lookup_454_pos[ 54].bits = 0x0A1A0000;
-  gv_local.lookup_454_pos[ 55].nbits = 16; gv_local.lookup_454_pos[ 55].bits = 0x0E1F0000;
-  gv_local.lookup_454_pos[ 56].nbits = 13; gv_local.lookup_454_pos[ 56].bits = 0x0E100000;
-  gv_local.lookup_454_pos[ 57].nbits = 17; gv_local.lookup_454_pos[ 57].bits = 0x0AB78000;
-  gv_local.lookup_454_pos[ 58].nbits = 18; gv_local.lookup_454_pos[ 58].bits = 0x0AB70000;
-  gv_local.lookup_454_pos[ 59].nbits = 15; gv_local.lookup_454_pos[ 59].bits = 0x0E0A0000;
-  gv_local.lookup_454_pos[ 60].nbits = 13; gv_local.lookup_454_pos[ 60].bits = 0x0A100000;
-  gv_local.lookup_454_pos[ 61].nbits = 19; gv_local.lookup_454_pos[ 61].bits = 0x0AB76000;
-  gv_local.lookup_454_pos[ 62].nbits = 19; gv_local.lookup_454_pos[ 62].bits = 0x0AB74000;
-  gv_local.lookup_454_pos[ 63].nbits = 10; gv_local.lookup_454_pos[ 63].bits = 0x0BC00000;
-
-  _s_sort_lookup (gv_local.lookup_454_pos, gv_local.idx_454_pos, POS_454_HUFF_TREESIZE);
-
-  gv_local.lookup_454_pos_initialized = 1;
-}
-/*
- */
-static void _s_init_prb_454_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uint16_t val;
-#endif
-
-  memset (gv_local.lookup_454_prb, 0, sizeof(SRALookup)*PRB_454_HUFF_TREESIZE);
-  
-  gv_local.lookup_454_prb[  0].nbits = 10; gv_local.lookup_454_prb[  0].bits = 0xA0400000;
-  gv_local.lookup_454_prb[  1].nbits =  9; gv_local.lookup_454_prb[  1].bits = 0xA0800000;
-  gv_local.lookup_454_prb[  2].nbits =  9; gv_local.lookup_454_prb[  2].bits = 0xA8800000;
-  gv_local.lookup_454_prb[  3].nbits =  9; gv_local.lookup_454_prb[  3].bits = 0xA8000000;
-  gv_local.lookup_454_prb[  4].nbits =  9; gv_local.lookup_454_prb[  4].bits = 0xDA000000;
-  gv_local.lookup_454_prb[  5].nbits =  9; gv_local.lookup_454_prb[  5].bits = 0xDA800000;
-  gv_local.lookup_454_prb[  6].nbits =  8; gv_local.lookup_454_prb[  6].bits = 0xA4000000;
-  gv_local.lookup_454_prb[  7].nbits =  8; gv_local.lookup_454_prb[  7].bits = 0xBA000000;
-  gv_local.lookup_454_prb[  8].nbits =  8; gv_local.lookup_454_prb[  8].bits = 0xA5000000;
-  gv_local.lookup_454_prb[  9].nbits =  8; gv_local.lookup_454_prb[  9].bits = 0xD4000000;
-  gv_local.lookup_454_prb[ 10].nbits =  8; gv_local.lookup_454_prb[ 10].bits = 0xA9000000;
-  gv_local.lookup_454_prb[ 11].nbits =  8; gv_local.lookup_454_prb[ 11].bits = 0xBB000000;
-  gv_local.lookup_454_prb[ 12].nbits =  8; gv_local.lookup_454_prb[ 12].bits = 0xDB000000;
-  gv_local.lookup_454_prb[ 13].nbits =  8; gv_local.lookup_454_prb[ 13].bits = 0xD5000000;
-  gv_local.lookup_454_prb[ 14].nbits =  7; gv_local.lookup_454_prb[ 14].bits = 0x2A000000;
-  gv_local.lookup_454_prb[ 15].nbits =  7; gv_local.lookup_454_prb[ 15].bits = 0xD0000000;
-  gv_local.lookup_454_prb[ 16].nbits =  7; gv_local.lookup_454_prb[ 16].bits = 0xD6000000;
-  gv_local.lookup_454_prb[ 17].nbits =  6; gv_local.lookup_454_prb[ 17].bits = 0xAC000000;
-  gv_local.lookup_454_prb[ 18].nbits =  7; gv_local.lookup_454_prb[ 18].bits = 0xAA000000;
-  gv_local.lookup_454_prb[ 19].nbits =  7; gv_local.lookup_454_prb[ 19].bits = 0xA2000000;
-  gv_local.lookup_454_prb[ 20].nbits =  6; gv_local.lookup_454_prb[ 20].bits = 0x80000000;
-  gv_local.lookup_454_prb[ 21].nbits =  6; gv_local.lookup_454_prb[ 21].bits = 0x84000000;
-  gv_local.lookup_454_prb[ 22].nbits =  6; gv_local.lookup_454_prb[ 22].bits = 0xBC000000;
-  gv_local.lookup_454_prb[ 23].nbits =  5; gv_local.lookup_454_prb[ 23].bits = 0x88000000;
-  gv_local.lookup_454_prb[ 24].nbits =  5; gv_local.lookup_454_prb[ 24].bits = 0xB0000000;
-  gv_local.lookup_454_prb[ 25].nbits =  4; gv_local.lookup_454_prb[ 25].bits = 0x90000000;
-  gv_local.lookup_454_prb[ 26].nbits =  3; gv_local.lookup_454_prb[ 26].bits = 0x00000000;
-  gv_local.lookup_454_prb[ 27].nbits =  2; gv_local.lookup_454_prb[ 27].bits = 0x40000000;
-  gv_local.lookup_454_prb[ 28].nbits =  3; gv_local.lookup_454_prb[ 28].bits = 0xE0000000;
-  gv_local.lookup_454_prb[ 29].nbits =  8; gv_local.lookup_454_prb[ 29].bits = 0xA1000000;
-  gv_local.lookup_454_prb[ 30].nbits =  7; gv_local.lookup_454_prb[ 30].bits = 0xD2000000;
-  gv_local.lookup_454_prb[ 31].nbits =  6; gv_local.lookup_454_prb[ 31].bits = 0x2C000000;
-  gv_local.lookup_454_prb[ 32].nbits =  5; gv_local.lookup_454_prb[ 32].bits = 0x20000000;
-  gv_local.lookup_454_prb[ 33].nbits =  4; gv_local.lookup_454_prb[ 33].bits = 0x30000000;
-  gv_local.lookup_454_prb[ 34].nbits =  4; gv_local.lookup_454_prb[ 34].bits = 0xC0000000;
-  gv_local.lookup_454_prb[ 35].nbits =  7; gv_local.lookup_454_prb[ 35].bits = 0xD8000000;
-  gv_local.lookup_454_prb[ 36].nbits =  7; gv_local.lookup_454_prb[ 36].bits = 0xB8000000;
-  gv_local.lookup_454_prb[ 37].nbits =  6; gv_local.lookup_454_prb[ 37].bits = 0xDC000000;
-  gv_local.lookup_454_prb[ 38].nbits =  7; gv_local.lookup_454_prb[ 38].bits = 0x28000000;
-  gv_local.lookup_454_prb[ 39].nbits =  7; gv_local.lookup_454_prb[ 39].bits = 0xA6000000;
-  gv_local.lookup_454_prb[ 40].nbits = 15; gv_local.lookup_454_prb[ 40].bits = 0xA0000000;
-  gv_local.lookup_454_prb[ 41].nbits = 14; gv_local.lookup_454_prb[ 41].bits = 0xA03C0000;
-  gv_local.lookup_454_prb[ 42].nbits = 16; gv_local.lookup_454_prb[ 42].bits = 0xA0030000;
-  gv_local.lookup_454_prb[ 43].nbits = 16; gv_local.lookup_454_prb[ 43].bits = 0xA0020000;
-  gv_local.lookup_454_prb[ 44].nbits = 16; gv_local.lookup_454_prb[ 44].bits = 0xA0390000;
-  gv_local.lookup_454_prb[ 45].nbits = 16; gv_local.lookup_454_prb[ 45].bits = 0xA0380000;
-  gv_local.lookup_454_prb[ 46].nbits = 16; gv_local.lookup_454_prb[ 46].bits = 0xA03B0000;
-  gv_local.lookup_454_prb[ 47].nbits = 16; gv_local.lookup_454_prb[ 47].bits = 0xA03A0000;
-  gv_local.lookup_454_prb[ 48].nbits = 16; gv_local.lookup_454_prb[ 48].bits = 0xA00D0000;
-  gv_local.lookup_454_prb[ 49].nbits = 16; gv_local.lookup_454_prb[ 49].bits = 0xA00C0000;
-  gv_local.lookup_454_prb[ 50].nbits = 16; gv_local.lookup_454_prb[ 50].bits = 0xA00F0000;
-  gv_local.lookup_454_prb[ 51].nbits = 16; gv_local.lookup_454_prb[ 51].bits = 0xA00E0000;
-  gv_local.lookup_454_prb[ 52].nbits = 16; gv_local.lookup_454_prb[ 52].bits = 0xA0090000;
-  gv_local.lookup_454_prb[ 53].nbits = 16; gv_local.lookup_454_prb[ 53].bits = 0xA0080000;
-  gv_local.lookup_454_prb[ 54].nbits = 16; gv_local.lookup_454_prb[ 54].bits = 0xA00B0000;
-  gv_local.lookup_454_prb[ 55].nbits = 16; gv_local.lookup_454_prb[ 55].bits = 0xA00A0000;
-  gv_local.lookup_454_prb[ 56].nbits = 16; gv_local.lookup_454_prb[ 56].bits = 0xA0250000;
-  gv_local.lookup_454_prb[ 57].nbits = 16; gv_local.lookup_454_prb[ 57].bits = 0xA0240000;
-  gv_local.lookup_454_prb[ 58].nbits = 16; gv_local.lookup_454_prb[ 58].bits = 0xA0270000;
-  gv_local.lookup_454_prb[ 59].nbits = 16; gv_local.lookup_454_prb[ 59].bits = 0xA0260000;
-  gv_local.lookup_454_prb[ 60].nbits = 16; gv_local.lookup_454_prb[ 60].bits = 0xA0210000;
-  gv_local.lookup_454_prb[ 61].nbits = 16; gv_local.lookup_454_prb[ 61].bits = 0xA0200000;
-  gv_local.lookup_454_prb[ 62].nbits = 16; gv_local.lookup_454_prb[ 62].bits = 0xA0230000;
-  gv_local.lookup_454_prb[ 63].nbits = 16; gv_local.lookup_454_prb[ 63].bits = 0xA0220000;
-  gv_local.lookup_454_prb[ 64].nbits = 16; gv_local.lookup_454_prb[ 64].bits = 0xA02D0000;
-  gv_local.lookup_454_prb[ 65].nbits = 16; gv_local.lookup_454_prb[ 65].bits = 0xA02C0000;
-  gv_local.lookup_454_prb[ 66].nbits = 16; gv_local.lookup_454_prb[ 66].bits = 0xA02F0000;
-  gv_local.lookup_454_prb[ 67].nbits = 16; gv_local.lookup_454_prb[ 67].bits = 0xA02E0000;
-  gv_local.lookup_454_prb[ 68].nbits = 16; gv_local.lookup_454_prb[ 68].bits = 0xA0290000;
-  gv_local.lookup_454_prb[ 69].nbits = 16; gv_local.lookup_454_prb[ 69].bits = 0xA0280000;
-  gv_local.lookup_454_prb[ 70].nbits = 16; gv_local.lookup_454_prb[ 70].bits = 0xA02B0000;
-  gv_local.lookup_454_prb[ 71].nbits = 16; gv_local.lookup_454_prb[ 71].bits = 0xA02A0000;
-  gv_local.lookup_454_prb[ 72].nbits = 16; gv_local.lookup_454_prb[ 72].bits = 0xA0150000;
-  gv_local.lookup_454_prb[ 73].nbits = 16; gv_local.lookup_454_prb[ 73].bits = 0xA0140000;
-  gv_local.lookup_454_prb[ 74].nbits = 16; gv_local.lookup_454_prb[ 74].bits = 0xA0170000;
-  gv_local.lookup_454_prb[ 75].nbits = 16; gv_local.lookup_454_prb[ 75].bits = 0xA0160000;
-  gv_local.lookup_454_prb[ 76].nbits = 16; gv_local.lookup_454_prb[ 76].bits = 0xA0110000;
-  gv_local.lookup_454_prb[ 77].nbits = 16; gv_local.lookup_454_prb[ 77].bits = 0xA0100000;
-  gv_local.lookup_454_prb[ 78].nbits = 16; gv_local.lookup_454_prb[ 78].bits = 0xA0130000;
-  gv_local.lookup_454_prb[ 79].nbits = 16; gv_local.lookup_454_prb[ 79].bits = 0xA0120000;
-  gv_local.lookup_454_prb[ 80].nbits = 16; gv_local.lookup_454_prb[ 80].bits = 0xA01D0000;
-  gv_local.lookup_454_prb[ 81].nbits = 16; gv_local.lookup_454_prb[ 81].bits = 0xA01C0000;
-  gv_local.lookup_454_prb[ 82].nbits = 16; gv_local.lookup_454_prb[ 82].bits = 0xA01F0000;
-  gv_local.lookup_454_prb[ 83].nbits = 16; gv_local.lookup_454_prb[ 83].bits = 0xA01E0000;
-  gv_local.lookup_454_prb[ 84].nbits = 16; gv_local.lookup_454_prb[ 84].bits = 0xA0190000;
-  gv_local.lookup_454_prb[ 85].nbits = 16; gv_local.lookup_454_prb[ 85].bits = 0xA0180000;
-  gv_local.lookup_454_prb[ 86].nbits = 16; gv_local.lookup_454_prb[ 86].bits = 0xA01B0000;
-  gv_local.lookup_454_prb[ 87].nbits = 16; gv_local.lookup_454_prb[ 87].bits = 0xA01A0000;
-  gv_local.lookup_454_prb[ 88].nbits = 16; gv_local.lookup_454_prb[ 88].bits = 0xA0350000;
-  gv_local.lookup_454_prb[ 89].nbits = 16; gv_local.lookup_454_prb[ 89].bits = 0xA0340000;
-  gv_local.lookup_454_prb[ 90].nbits = 16; gv_local.lookup_454_prb[ 90].bits = 0xA0370000;
-  gv_local.lookup_454_prb[ 91].nbits = 16; gv_local.lookup_454_prb[ 91].bits = 0xA0360000;
-  gv_local.lookup_454_prb[ 92].nbits = 16; gv_local.lookup_454_prb[ 92].bits = 0xA0310000;
-  gv_local.lookup_454_prb[ 93].nbits = 16; gv_local.lookup_454_prb[ 93].bits = 0xA0300000;
-  gv_local.lookup_454_prb[ 94].nbits = 16; gv_local.lookup_454_prb[ 94].bits = 0xA0330000;
-  gv_local.lookup_454_prb[ 95].nbits = 16; gv_local.lookup_454_prb[ 95].bits = 0xA0320000;
-  gv_local.lookup_454_prb[ 96].nbits = 16; gv_local.lookup_454_prb[ 96].bits = 0xA0050000;
-  gv_local.lookup_454_prb[ 97].nbits = 16; gv_local.lookup_454_prb[ 97].bits = 0xA0040000;
-  gv_local.lookup_454_prb[ 98].nbits = 16; gv_local.lookup_454_prb[ 98].bits = 0xA0070000;
-  gv_local.lookup_454_prb[ 99].nbits = 16; gv_local.lookup_454_prb[ 99].bits = 0xA0060000;
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_454_prb, 0, sizeof(uint16_t)*REV_HUFF_TREESIZE_16);
-
-  for (i=0; i<PRB_454_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_454_prb[i].bits >> 16;
-    gv_local.rlookup_454_prb [val] = (uint16_t) i;
-    for (j=1; j<=(0xFFFF>>gv_local.lookup_454_prb[i].nbits); j++)
-      gv_local.rlookup_454_prb [val+j] = (uint16_t) i;
-  }
-#endif
-  _s_sort_lookup (gv_local.lookup_454_prb, gv_local.idx_454_prb, PRB_454_HUFF_TREESIZE);
-
-  gv_local.lookup_454_prb_initialized = 1;
-}
-/*
- */
-static void _s_init_sig_454_default (void)
-{
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  int      i, j;
-  uint16_t val;
-#endif
-
-  memset (gv_local.lookup_454_sig, 0, sizeof(SRALookup)*SIG_HUFF_TREESIZE);
-
-  gv_local.lookup_454_sig[  0].nbits =  7; gv_local.lookup_454_sig[  0].bits = 0x8C000000;
-  gv_local.lookup_454_sig[  1].nbits =  8; gv_local.lookup_454_sig[  1].bits = 0x65000000;
-  gv_local.lookup_454_sig[  2].nbits =  8; gv_local.lookup_454_sig[  2].bits = 0xCA000000;
-  gv_local.lookup_454_sig[  3].nbits =  7; gv_local.lookup_454_sig[  3].bits = 0x5A000000;
-  gv_local.lookup_454_sig[  4].nbits =  7; gv_local.lookup_454_sig[  4].bits = 0xBC000000;
-  gv_local.lookup_454_sig[  5].nbits =  6; gv_local.lookup_454_sig[  5].bits = 0x48000000;
-  gv_local.lookup_454_sig[  6].nbits =  6; gv_local.lookup_454_sig[  6].bits = 0x98000000;
-  gv_local.lookup_454_sig[  7].nbits =  6; gv_local.lookup_454_sig[  7].bits = 0xFC000000;
-  gv_local.lookup_454_sig[  8].nbits =  5; gv_local.lookup_454_sig[  8].bits = 0x68000000;
-  gv_local.lookup_454_sig[  9].nbits =  5; gv_local.lookup_454_sig[  9].bits = 0xA8000000;
-  gv_local.lookup_454_sig[ 10].nbits =  5; gv_local.lookup_454_sig[ 10].bits = 0xE0000000;
-  gv_local.lookup_454_sig[ 11].nbits =  4; gv_local.lookup_454_sig[ 11].bits = 0x00000000;
-  gv_local.lookup_454_sig[ 12].nbits =  4; gv_local.lookup_454_sig[ 12].bits = 0x10000000;
-  gv_local.lookup_454_sig[ 13].nbits =  5; gv_local.lookup_454_sig[ 13].bits = 0xE8000000;
-  gv_local.lookup_454_sig[ 14].nbits =  5; gv_local.lookup_454_sig[ 14].bits = 0xC0000000;
-  gv_local.lookup_454_sig[ 15].nbits =  5; gv_local.lookup_454_sig[ 15].bits = 0x78000000;
-  gv_local.lookup_454_sig[ 16].nbits =  5; gv_local.lookup_454_sig[ 16].bits = 0x38000000;
-  gv_local.lookup_454_sig[ 17].nbits =  6; gv_local.lookup_454_sig[ 17].bits = 0xCC000000;
-  gv_local.lookup_454_sig[ 18].nbits =  6; gv_local.lookup_454_sig[ 18].bits = 0x80000000;
-  gv_local.lookup_454_sig[ 19].nbits =  6; gv_local.lookup_454_sig[ 19].bits = 0x4C000000;
-  gv_local.lookup_454_sig[ 20].nbits =  7; gv_local.lookup_454_sig[ 20].bits = 0xDE000000;
-  gv_local.lookup_454_sig[ 21].nbits =  7; gv_local.lookup_454_sig[ 21].bits = 0xB0000000;
-  gv_local.lookup_454_sig[ 22].nbits =  7; gv_local.lookup_454_sig[ 22].bits = 0x76000000;
-  gv_local.lookup_454_sig[ 23].nbits =  7; gv_local.lookup_454_sig[ 23].bits = 0x52000000;
-  gv_local.lookup_454_sig[ 24].nbits =  8; gv_local.lookup_454_sig[ 24].bits = 0xF4000000;
-  gv_local.lookup_454_sig[ 25].nbits =  8; gv_local.lookup_454_sig[ 25].bits = 0xBB000000;
-  gv_local.lookup_454_sig[ 26].nbits =  8; gv_local.lookup_454_sig[ 26].bits = 0x8F000000;
-  gv_local.lookup_454_sig[ 27].nbits =  8; gv_local.lookup_454_sig[ 27].bits = 0x64000000;
-  gv_local.lookup_454_sig[ 28].nbits =  8; gv_local.lookup_454_sig[ 28].bits = 0x31000000;
-  gv_local.lookup_454_sig[ 29].nbits =  9; gv_local.lookup_454_sig[ 29].bits = 0xDD000000;
-  gv_local.lookup_454_sig[ 30].nbits =  9; gv_local.lookup_454_sig[ 30].bits = 0xC8000000;
-  gv_local.lookup_454_sig[ 31].nbits =  9; gv_local.lookup_454_sig[ 31].bits = 0x95000000;
-  gv_local.lookup_454_sig[ 32].nbits =  9; gv_local.lookup_454_sig[ 32].bits = 0x74800000;
-  gv_local.lookup_454_sig[ 33].nbits =  9; gv_local.lookup_454_sig[ 33].bits = 0x57800000;
-  gv_local.lookup_454_sig[ 34].nbits =  9; gv_local.lookup_454_sig[ 34].bits = 0x30000000;
-  gv_local.lookup_454_sig[ 35].nbits = 10; gv_local.lookup_454_sig[ 35].bits = 0xF0C00000;
-  gv_local.lookup_454_sig[ 36].nbits = 10; gv_local.lookup_454_sig[ 36].bits = 0xCB000000;
-  gv_local.lookup_454_sig[ 37].nbits = 10; gv_local.lookup_454_sig[ 37].bits = 0xA5400000;
-  gv_local.lookup_454_sig[ 38].nbits = 10; gv_local.lookup_454_sig[ 38].bits = 0x8E000000;
-  gv_local.lookup_454_sig[ 39].nbits = 10; gv_local.lookup_454_sig[ 39].bits = 0x70C00000;
-  gv_local.lookup_454_sig[ 40].nbits = 10; gv_local.lookup_454_sig[ 40].bits = 0x56400000;
-  gv_local.lookup_454_sig[ 41].nbits = 10; gv_local.lookup_454_sig[ 41].bits = 0x30C00000;
-  gv_local.lookup_454_sig[ 42].nbits = 11; gv_local.lookup_454_sig[ 42].bits = 0xF5400000;
-  gv_local.lookup_454_sig[ 43].nbits = 11; gv_local.lookup_454_sig[ 43].bits = 0xD0600000;
-  gv_local.lookup_454_sig[ 44].nbits = 11; gv_local.lookup_454_sig[ 44].bits = 0xB3800000;
-  gv_local.lookup_454_sig[ 45].nbits = 11; gv_local.lookup_454_sig[ 45].bits = 0x97400000;
-  gv_local.lookup_454_sig[ 46].nbits = 11; gv_local.lookup_454_sig[ 46].bits = 0x86200000;
-  gv_local.lookup_454_sig[ 47].nbits = 11; gv_local.lookup_454_sig[ 47].bits = 0x70600000;
-  gv_local.lookup_454_sig[ 48].nbits = 11; gv_local.lookup_454_sig[ 48].bits = 0x66400000;
-  gv_local.lookup_454_sig[ 49].nbits = 11; gv_local.lookup_454_sig[ 49].bits = 0x5DE00000;
-  gv_local.lookup_454_sig[ 50].nbits = 12; gv_local.lookup_454_sig[ 50].bits = 0xF0000000;
-  gv_local.lookup_454_sig[ 51].nbits = 12; gv_local.lookup_454_sig[ 51].bits = 0x75000000;
-  gv_local.lookup_454_sig[ 52].nbits = 12; gv_local.lookup_454_sig[ 52].bits = 0x74500000;
-  gv_local.lookup_454_sig[ 53].nbits = 12; gv_local.lookup_454_sig[ 53].bits = 0x74200000;
-  gv_local.lookup_454_sig[ 54].nbits = 12; gv_local.lookup_454_sig[ 54].bits = 0x70A00000;
-  gv_local.lookup_454_sig[ 55].nbits = 12; gv_local.lookup_454_sig[ 55].bits = 0x70500000;
-  gv_local.lookup_454_sig[ 56].nbits = 12; gv_local.lookup_454_sig[ 56].bits = 0x66700000;
-  gv_local.lookup_454_sig[ 57].nbits = 12; gv_local.lookup_454_sig[ 57].bits = 0x66100000;
-  gv_local.lookup_454_sig[ 58].nbits = 12; gv_local.lookup_454_sig[ 58].bits = 0x5DB00000;
-  gv_local.lookup_454_sig[ 59].nbits = 12; gv_local.lookup_454_sig[ 59].bits = 0x5D400000;
-  gv_local.lookup_454_sig[ 60].nbits = 12; gv_local.lookup_454_sig[ 60].bits = 0x5D100000;
-  gv_local.lookup_454_sig[ 61].nbits = 12; gv_local.lookup_454_sig[ 61].bits = 0x58600000;
-  gv_local.lookup_454_sig[ 62].nbits = 12; gv_local.lookup_454_sig[ 62].bits = 0x58300000;
-  gv_local.lookup_454_sig[ 63].nbits = 12; gv_local.lookup_454_sig[ 63].bits = 0x58700000;
-  gv_local.lookup_454_sig[ 64].nbits = 12; gv_local.lookup_454_sig[ 64].bits = 0x59800000;
-  gv_local.lookup_454_sig[ 65].nbits = 12; gv_local.lookup_454_sig[ 65].bits = 0x5D900000;
-  gv_local.lookup_454_sig[ 66].nbits = 12; gv_local.lookup_454_sig[ 66].bits = 0x70400000;
-  gv_local.lookup_454_sig[ 67].nbits = 12; gv_local.lookup_454_sig[ 67].bits = 0x84100000;
-  gv_local.lookup_454_sig[ 68].nbits = 12; gv_local.lookup_454_sig[ 68].bits = 0x94C00000;
-  gv_local.lookup_454_sig[ 69].nbits = 12; gv_local.lookup_454_sig[ 69].bits = 0xB3F00000;
-  gv_local.lookup_454_sig[ 70].nbits = 12; gv_local.lookup_454_sig[ 70].bits = 0xDBD00000;
-  gv_local.lookup_454_sig[ 71].nbits = 11; gv_local.lookup_454_sig[ 71].bits = 0x2A400000;
-  gv_local.lookup_454_sig[ 72].nbits = 11; gv_local.lookup_454_sig[ 72].bits = 0x5D600000;
-  gv_local.lookup_454_sig[ 73].nbits = 11; gv_local.lookup_454_sig[ 73].bits = 0x87200000;
-  gv_local.lookup_454_sig[ 74].nbits = 11; gv_local.lookup_454_sig[ 74].bits = 0xB2E00000;
-  gv_local.lookup_454_sig[ 75].nbits = 11; gv_local.lookup_454_sig[ 75].bits = 0xDA400000;
-  gv_local.lookup_454_sig[ 76].nbits = 10; gv_local.lookup_454_sig[ 76].bits = 0x28C00000;
-  gv_local.lookup_454_sig[ 77].nbits = 10; gv_local.lookup_454_sig[ 77].bits = 0x59C00000;
-  gv_local.lookup_454_sig[ 78].nbits = 10; gv_local.lookup_454_sig[ 78].bits = 0x84400000;
-  gv_local.lookup_454_sig[ 79].nbits = 10; gv_local.lookup_454_sig[ 79].bits = 0xB2800000;
-  gv_local.lookup_454_sig[ 80].nbits = 10; gv_local.lookup_454_sig[ 80].bits = 0xDA000000;
-  gv_local.lookup_454_sig[ 81].nbits =  9; gv_local.lookup_454_sig[ 81].bits = 0x28000000;
-  gv_local.lookup_454_sig[ 82].nbits =  9; gv_local.lookup_454_sig[ 82].bits = 0x59000000;
-  gv_local.lookup_454_sig[ 83].nbits =  9; gv_local.lookup_454_sig[ 83].bits = 0x84800000;
-  gv_local.lookup_454_sig[ 84].nbits =  9; gv_local.lookup_454_sig[ 84].bits = 0xA7800000;
-  gv_local.lookup_454_sig[ 85].nbits =  9; gv_local.lookup_454_sig[ 85].bits = 0xDA800000;
-  gv_local.lookup_454_sig[ 86].nbits =  8; gv_local.lookup_454_sig[ 86].bits = 0x29000000;
-  gv_local.lookup_454_sig[ 87].nbits =  8; gv_local.lookup_454_sig[ 87].bits = 0x5C000000;
-  gv_local.lookup_454_sig[ 88].nbits =  8; gv_local.lookup_454_sig[ 88].bits = 0x85000000;
-  gv_local.lookup_454_sig[ 89].nbits =  8; gv_local.lookup_454_sig[ 89].bits = 0xA6000000;
-  gv_local.lookup_454_sig[ 90].nbits =  8; gv_local.lookup_454_sig[ 90].bits = 0xD3000000;
-  gv_local.lookup_454_sig[ 91].nbits =  7; gv_local.lookup_454_sig[ 91].bits = 0x22000000;
-  gv_local.lookup_454_sig[ 92].nbits =  7; gv_local.lookup_454_sig[ 92].bits = 0x54000000;
-  gv_local.lookup_454_sig[ 93].nbits =  7; gv_local.lookup_454_sig[ 93].bits = 0x72000000;
-  gv_local.lookup_454_sig[ 94].nbits =  7; gv_local.lookup_454_sig[ 94].bits = 0x92000000;
-  gv_local.lookup_454_sig[ 95].nbits =  7; gv_local.lookup_454_sig[ 95].bits = 0xB8000000;
-  gv_local.lookup_454_sig[ 96].nbits =  7; gv_local.lookup_454_sig[ 96].bits = 0xD8000000;
-  gv_local.lookup_454_sig[ 97].nbits =  7; gv_local.lookup_454_sig[ 97].bits = 0xF6000000;
-  gv_local.lookup_454_sig[ 98].nbits =  6; gv_local.lookup_454_sig[ 98].bits = 0x2C000000;
-  gv_local.lookup_454_sig[ 99].nbits =  6; gv_local.lookup_454_sig[ 99].bits = 0x44000000;
-  gv_local.lookup_454_sig[100].nbits =  6; gv_local.lookup_454_sig[100].bits = 0xA0000000;
-  gv_local.lookup_454_sig[101].nbits =  6; gv_local.lookup_454_sig[101].bits = 0xF8000000;
-  gv_local.lookup_454_sig[102].nbits =  6; gv_local.lookup_454_sig[102].bits = 0xD4000000;
-  gv_local.lookup_454_sig[103].nbits =  6; gv_local.lookup_454_sig[103].bits = 0xB4000000;
-  gv_local.lookup_454_sig[104].nbits =  6; gv_local.lookup_454_sig[104].bits = 0x9C000000;
-  gv_local.lookup_454_sig[105].nbits =  6; gv_local.lookup_454_sig[105].bits = 0x88000000;
-  gv_local.lookup_454_sig[106].nbits =  6; gv_local.lookup_454_sig[106].bits = 0x60000000;
-  gv_local.lookup_454_sig[107].nbits =  6; gv_local.lookup_454_sig[107].bits = 0x40000000;
-  gv_local.lookup_454_sig[108].nbits =  7; gv_local.lookup_454_sig[108].bits = 0xF2000000;
-  gv_local.lookup_454_sig[109].nbits =  7; gv_local.lookup_454_sig[109].bits = 0xBE000000;
-  gv_local.lookup_454_sig[110].nbits =  7; gv_local.lookup_454_sig[110].bits = 0x90000000;
-  gv_local.lookup_454_sig[111].nbits =  7; gv_local.lookup_454_sig[111].bits = 0x5E000000;
-  gv_local.lookup_454_sig[112].nbits =  7; gv_local.lookup_454_sig[112].bits = 0x26000000;
-  gv_local.lookup_454_sig[113].nbits =  8; gv_local.lookup_454_sig[113].bits = 0xD1000000;
-  gv_local.lookup_454_sig[114].nbits =  8; gv_local.lookup_454_sig[114].bits = 0x96000000;
-  gv_local.lookup_454_sig[115].nbits =  8; gv_local.lookup_454_sig[115].bits = 0x67000000;
-  gv_local.lookup_454_sig[116].nbits =  8; gv_local.lookup_454_sig[116].bits = 0x34000000;
-  gv_local.lookup_454_sig[117].nbits =  9; gv_local.lookup_454_sig[117].bits = 0xDC000000;
-  gv_local.lookup_454_sig[118].nbits =  9; gv_local.lookup_454_sig[118].bits = 0xA5800000;
-  gv_local.lookup_454_sig[119].nbits =  9; gv_local.lookup_454_sig[119].bits = 0x75800000;
-  gv_local.lookup_454_sig[120].nbits =  9; gv_local.lookup_454_sig[120].bits = 0x51000000;
-  gv_local.lookup_454_sig[121].nbits = 10; gv_local.lookup_454_sig[121].bits = 0xF5800000;
-  gv_local.lookup_454_sig[122].nbits = 10; gv_local.lookup_454_sig[122].bits = 0xBA000000;
-  gv_local.lookup_454_sig[123].nbits = 10; gv_local.lookup_454_sig[123].bits = 0x86400000;
-  gv_local.lookup_454_sig[124].nbits = 10; gv_local.lookup_454_sig[124].bits = 0x56000000;
-  gv_local.lookup_454_sig[125].nbits = 11; gv_local.lookup_454_sig[125].bits = 0xF5200000;
-  gv_local.lookup_454_sig[126].nbits = 11; gv_local.lookup_454_sig[126].bits = 0xB3400000;
-  gv_local.lookup_454_sig[127].nbits = 11; gv_local.lookup_454_sig[127].bits = 0x87000000;
-  gv_local.lookup_454_sig[128].nbits = 11; gv_local.lookup_454_sig[128].bits = 0x58400000;
-  gv_local.lookup_454_sig[129].nbits = 11; gv_local.lookup_454_sig[129].bits = 0x2AA00000;
-  gv_local.lookup_454_sig[130].nbits = 12; gv_local.lookup_454_sig[130].bits = 0xF1800000;
-  gv_local.lookup_454_sig[131].nbits = 12; gv_local.lookup_454_sig[131].bits = 0xDBB00000;
-  gv_local.lookup_454_sig[132].nbits = 12; gv_local.lookup_454_sig[132].bits = 0xCBA00000;
-  gv_local.lookup_454_sig[133].nbits = 12; gv_local.lookup_454_sig[133].bits = 0xC9900000;
-  gv_local.lookup_454_sig[134].nbits = 12; gv_local.lookup_454_sig[134].bits = 0xB3700000;
-  gv_local.lookup_454_sig[135].nbits = 12; gv_local.lookup_454_sig[135].bits = 0xA5000000;
-  gv_local.lookup_454_sig[136].nbits = 12; gv_local.lookup_454_sig[136].bits = 0x94500000;
-  gv_local.lookup_454_sig[137].nbits = 12; gv_local.lookup_454_sig[137].bits = 0x8E500000;
-  gv_local.lookup_454_sig[138].nbits = 12; gv_local.lookup_454_sig[138].bits = 0x75700000;
-  gv_local.lookup_454_sig[139].nbits = 12; gv_local.lookup_454_sig[139].bits = 0x70B00000;
-  gv_local.lookup_454_sig[140].nbits = 12; gv_local.lookup_454_sig[140].bits = 0x66D00000;
-  gv_local.lookup_454_sig[141].nbits = 12; gv_local.lookup_454_sig[141].bits = 0x5D300000;
-  gv_local.lookup_454_sig[142].nbits = 12; gv_local.lookup_454_sig[142].bits = 0x51F00000;
-  gv_local.lookup_454_sig[143].nbits = 12; gv_local.lookup_454_sig[143].bits = 0x36B00000;
-  gv_local.lookup_454_sig[144].nbits = 12; gv_local.lookup_454_sig[144].bits = 0x33A00000;
-  gv_local.lookup_454_sig[145].nbits = 12; gv_local.lookup_454_sig[145].bits = 0x2A700000;
-  gv_local.lookup_454_sig[146].nbits = 12; gv_local.lookup_454_sig[146].bits = 0x24D00000;
-  gv_local.lookup_454_sig[147].nbits = 13; gv_local.lookup_454_sig[147].bits = 0xF5D00000;
-  gv_local.lookup_454_sig[148].nbits = 13; gv_local.lookup_454_sig[148].bits = 0xF1980000;
-  gv_local.lookup_454_sig[149].nbits = 13; gv_local.lookup_454_sig[149].bits = 0xF0600000;
-  gv_local.lookup_454_sig[150].nbits = 13; gv_local.lookup_454_sig[150].bits = 0xCB480000;
-  gv_local.lookup_454_sig[151].nbits = 13; gv_local.lookup_454_sig[151].bits = 0xA5300000;
-  gv_local.lookup_454_sig[152].nbits = 13; gv_local.lookup_454_sig[152].bits = 0xA7600000;
-  gv_local.lookup_454_sig[153].nbits = 13; gv_local.lookup_454_sig[153].bits = 0xA7680000;
-  gv_local.lookup_454_sig[154].nbits = 13; gv_local.lookup_454_sig[154].bits = 0xB3600000;
-  gv_local.lookup_454_sig[155].nbits = 13; gv_local.lookup_454_sig[155].bits = 0xA7700000;
-  gv_local.lookup_454_sig[156].nbits = 13; gv_local.lookup_454_sig[156].bits = 0xB3E00000;
-  gv_local.lookup_454_sig[157].nbits = 13; gv_local.lookup_454_sig[157].bits = 0xC9800000;
-  gv_local.lookup_454_sig[158].nbits = 13; gv_local.lookup_454_sig[158].bits = 0xC9E80000;
-  gv_local.lookup_454_sig[159].nbits = 13; gv_local.lookup_454_sig[159].bits = 0xCBB00000;
-  gv_local.lookup_454_sig[160].nbits = 13; gv_local.lookup_454_sig[160].bits = 0xDA680000;
-  gv_local.lookup_454_sig[161].nbits = 13; gv_local.lookup_454_sig[161].bits = 0xF0680000;
-  gv_local.lookup_454_sig[162].nbits = 13; gv_local.lookup_454_sig[162].bits = 0xF5E80000;
-  gv_local.lookup_454_sig[163].nbits = 12; gv_local.lookup_454_sig[163].bits = 0x28B00000;
-  gv_local.lookup_454_sig[164].nbits = 12; gv_local.lookup_454_sig[164].bits = 0x33B00000;
-  gv_local.lookup_454_sig[165].nbits = 12; gv_local.lookup_454_sig[165].bits = 0x51C00000;
-  gv_local.lookup_454_sig[166].nbits = 12; gv_local.lookup_454_sig[166].bits = 0x5DA00000;
-  gv_local.lookup_454_sig[167].nbits = 12; gv_local.lookup_454_sig[167].bits = 0x74600000;
-  gv_local.lookup_454_sig[168].nbits = 12; gv_local.lookup_454_sig[168].bits = 0x94000000;
-  gv_local.lookup_454_sig[169].nbits = 12; gv_local.lookup_454_sig[169].bits = 0x97700000;
-  gv_local.lookup_454_sig[170].nbits = 12; gv_local.lookup_454_sig[170].bits = 0xB3C00000;
-  gv_local.lookup_454_sig[171].nbits = 12; gv_local.lookup_454_sig[171].bits = 0xD0400000;
-  gv_local.lookup_454_sig[172].nbits = 12; gv_local.lookup_454_sig[172].bits = 0xF0200000;
-  gv_local.lookup_454_sig[173].nbits = 11; gv_local.lookup_454_sig[173].bits = 0x24E00000;
-  gv_local.lookup_454_sig[174].nbits = 11; gv_local.lookup_454_sig[174].bits = 0x36C00000;
-  gv_local.lookup_454_sig[175].nbits = 11; gv_local.lookup_454_sig[175].bits = 0x5DC00000;
-  gv_local.lookup_454_sig[176].nbits = 11; gv_local.lookup_454_sig[176].bits = 0x75400000;
-  gv_local.lookup_454_sig[177].nbits = 11; gv_local.lookup_454_sig[177].bits = 0x94A00000;
-  gv_local.lookup_454_sig[178].nbits = 11; gv_local.lookup_454_sig[178].bits = 0xB3200000;
-  gv_local.lookup_454_sig[179].nbits = 11; gv_local.lookup_454_sig[179].bits = 0xD0200000;
-  gv_local.lookup_454_sig[180].nbits = 11; gv_local.lookup_454_sig[180].bits = 0xF5000000;
-  gv_local.lookup_454_sig[181].nbits = 10; gv_local.lookup_454_sig[181].bits = 0x2AC00000;
-  gv_local.lookup_454_sig[182].nbits = 10; gv_local.lookup_454_sig[182].bits = 0x56800000;
-  gv_local.lookup_454_sig[183].nbits = 10; gv_local.lookup_454_sig[183].bits = 0x70000000;
-  gv_local.lookup_454_sig[184].nbits = 10; gv_local.lookup_454_sig[184].bits = 0x87800000;
-  gv_local.lookup_454_sig[185].nbits = 10; gv_local.lookup_454_sig[185].bits = 0xA4400000;
-  gv_local.lookup_454_sig[186].nbits = 10; gv_local.lookup_454_sig[186].bits = 0xC8C00000;
-  gv_local.lookup_454_sig[187].nbits = 10; gv_local.lookup_454_sig[187].bits = 0xDB400000;
-  gv_local.lookup_454_sig[188].nbits =  9; gv_local.lookup_454_sig[188].bits = 0x24000000;
-  gv_local.lookup_454_sig[189].nbits =  9; gv_local.lookup_454_sig[189].bits = 0x36000000;
-  gv_local.lookup_454_sig[190].nbits =  9; gv_local.lookup_454_sig[190].bits = 0x58800000;
-  gv_local.lookup_454_sig[191].nbits =  9; gv_local.lookup_454_sig[191].bits = 0x71000000;
-  gv_local.lookup_454_sig[192].nbits =  9; gv_local.lookup_454_sig[192].bits = 0x86800000;
-  gv_local.lookup_454_sig[193].nbits =  9; gv_local.lookup_454_sig[193].bits = 0x95800000;
-  gv_local.lookup_454_sig[194].nbits =  9; gv_local.lookup_454_sig[194].bits = 0xB2000000;
-  gv_local.lookup_454_sig[195].nbits =  9; gv_local.lookup_454_sig[195].bits = 0xC9000000;
-  gv_local.lookup_454_sig[196].nbits =  9; gv_local.lookup_454_sig[196].bits = 0xD2000000;
-  gv_local.lookup_454_sig[197].nbits =  9; gv_local.lookup_454_sig[197].bits = 0xDC800000;
-  gv_local.lookup_454_sig[198].nbits =  9; gv_local.lookup_454_sig[198].bits = 0xF1000000;
-  gv_local.lookup_454_sig[199].nbits =  8; gv_local.lookup_454_sig[199].bits = 0x20000000;
-  gv_local.lookup_454_sig[200].nbits =  8; gv_local.lookup_454_sig[200].bits = 0x2B000000;
-  gv_local.lookup_454_sig[201].nbits =  8; gv_local.lookup_454_sig[201].bits = 0x37000000;
-  gv_local.lookup_454_sig[202].nbits =  8; gv_local.lookup_454_sig[202].bits = 0x50000000;
-  gv_local.lookup_454_sig[203].nbits =  8; gv_local.lookup_454_sig[203].bits = 0x35000000;
-  gv_local.lookup_454_sig[204].nbits =  8; gv_local.lookup_454_sig[204].bits = 0x32000000;
-  gv_local.lookup_454_sig[205].nbits =  8; gv_local.lookup_454_sig[205].bits = 0x25000000;
-  gv_local.lookup_454_sig[206].nbits =  8; gv_local.lookup_454_sig[206].bits = 0x21000000;
-  gv_local.lookup_454_sig[207].nbits =  9; gv_local.lookup_454_sig[207].bits = 0xDD800000;
-  gv_local.lookup_454_sig[208].nbits =  9; gv_local.lookup_454_sig[208].bits = 0xD0800000;
-  gv_local.lookup_454_sig[209].nbits =  9; gv_local.lookup_454_sig[209].bits = 0xBA800000;
-  gv_local.lookup_454_sig[210].nbits =  9; gv_local.lookup_454_sig[210].bits = 0xA4800000;
-  gv_local.lookup_454_sig[211].nbits =  9; gv_local.lookup_454_sig[211].bits = 0x8E800000;
-  gv_local.lookup_454_sig[212].nbits =  9; gv_local.lookup_454_sig[212].bits = 0x71800000;
-  gv_local.lookup_454_sig[213].nbits =  9; gv_local.lookup_454_sig[213].bits = 0x57000000;
-  gv_local.lookup_454_sig[214].nbits =  9; gv_local.lookup_454_sig[214].bits = 0x33000000;
-  gv_local.lookup_454_sig[215].nbits = 10; gv_local.lookup_454_sig[215].bits = 0xF1C00000;
-  gv_local.lookup_454_sig[216].nbits = 10; gv_local.lookup_454_sig[216].bits = 0xCBC00000;
-  gv_local.lookup_454_sig[217].nbits = 10; gv_local.lookup_454_sig[217].bits = 0xA7000000;
-  gv_local.lookup_454_sig[218].nbits = 10; gv_local.lookup_454_sig[218].bits = 0x87C00000;
-  gv_local.lookup_454_sig[219].nbits = 10; gv_local.lookup_454_sig[219].bits = 0x66800000;
-  gv_local.lookup_454_sig[220].nbits = 10; gv_local.lookup_454_sig[220].bits = 0x51800000;
-  gv_local.lookup_454_sig[221].nbits = 10; gv_local.lookup_454_sig[221].bits = 0x24800000;
-  gv_local.lookup_454_sig[222].nbits = 11; gv_local.lookup_454_sig[222].bits = 0xD2E00000;
-  gv_local.lookup_454_sig[223].nbits = 11; gv_local.lookup_454_sig[223].bits = 0xB3A00000;
-  gv_local.lookup_454_sig[224].nbits = 11; gv_local.lookup_454_sig[224].bits = 0x94600000;
-  gv_local.lookup_454_sig[225].nbits = 11; gv_local.lookup_454_sig[225].bits = 0x74000000;
-  gv_local.lookup_454_sig[226].nbits = 11; gv_local.lookup_454_sig[226].bits = 0x56E00000;
-  gv_local.lookup_454_sig[227].nbits = 11; gv_local.lookup_454_sig[227].bits = 0x2A800000;
-  gv_local.lookup_454_sig[228].nbits = 12; gv_local.lookup_454_sig[228].bits = 0xF0700000;
-  gv_local.lookup_454_sig[229].nbits = 12; gv_local.lookup_454_sig[229].bits = 0xCB800000;
-  gv_local.lookup_454_sig[230].nbits = 12; gv_local.lookup_454_sig[230].bits = 0xA5100000;
-  gv_local.lookup_454_sig[231].nbits = 12; gv_local.lookup_454_sig[231].bits = 0x8E600000;
-  gv_local.lookup_454_sig[232].nbits = 12; gv_local.lookup_454_sig[232].bits = 0x70900000;
-  gv_local.lookup_454_sig[233].nbits = 12; gv_local.lookup_454_sig[233].bits = 0x58200000;
-  gv_local.lookup_454_sig[234].nbits = 12; gv_local.lookup_454_sig[234].bits = 0x30A00000;
-  gv_local.lookup_454_sig[235].nbits = 13; gv_local.lookup_454_sig[235].bits = 0xF5D80000;
-  gv_local.lookup_454_sig[236].nbits = 13; gv_local.lookup_454_sig[236].bits = 0xDA600000;
-  gv_local.lookup_454_sig[237].nbits = 13; gv_local.lookup_454_sig[237].bits = 0xC8980000;
-  gv_local.lookup_454_sig[238].nbits = 13; gv_local.lookup_454_sig[238].bits = 0xA4200000;
-  gv_local.lookup_454_sig[239].nbits = 13; gv_local.lookup_454_sig[239].bits = 0x8E480000;
-  gv_local.lookup_454_sig[240].nbits = 13; gv_local.lookup_454_sig[240].bits = 0x75600000;
-  gv_local.lookup_454_sig[241].nbits = 13; gv_local.lookup_454_sig[241].bits = 0x5D200000;
-  gv_local.lookup_454_sig[242].nbits = 13; gv_local.lookup_454_sig[242].bits = 0x36F00000;
-  gv_local.lookup_454_sig[243].nbits = 13; gv_local.lookup_454_sig[243].bits = 0x30880000;
-  gv_local.lookup_454_sig[244].nbits = 13; gv_local.lookup_454_sig[244].bits = 0x28800000;
-  gv_local.lookup_454_sig[245].nbits = 14; gv_local.lookup_454_sig[245].bits = 0xF5780000;
-  gv_local.lookup_454_sig[246].nbits = 14; gv_local.lookup_454_sig[246].bits = 0xF1900000;
-  gv_local.lookup_454_sig[247].nbits = 14; gv_local.lookup_454_sig[247].bits = 0xDA700000;
-  gv_local.lookup_454_sig[248].nbits = 14; gv_local.lookup_454_sig[248].bits = 0xDA780000;
-  gv_local.lookup_454_sig[249].nbits = 14; gv_local.lookup_454_sig[249].bits = 0xD2C80000;
-  gv_local.lookup_454_sig[250].nbits = 14; gv_local.lookup_454_sig[250].bits = 0xCB9C0000;
-  gv_local.lookup_454_sig[251].nbits = 14; gv_local.lookup_454_sig[251].bits = 0xC8B80000;
-  gv_local.lookup_454_sig[252].nbits = 14; gv_local.lookup_454_sig[252].bits = 0xCB500000;
-  gv_local.lookup_454_sig[253].nbits = 14; gv_local.lookup_454_sig[253].bits = 0xC9E40000;
-  gv_local.lookup_454_sig[254].nbits = 14; gv_local.lookup_454_sig[254].bits = 0xC8BC0000;
-  gv_local.lookup_454_sig[255].nbits = 14; gv_local.lookup_454_sig[255].bits = 0xCB740000;
-  gv_local.lookup_454_sig[256].nbits = 14; gv_local.lookup_454_sig[256].bits = 0xD0540000;
-  gv_local.lookup_454_sig[257].nbits = 14; gv_local.lookup_454_sig[257].bits = 0xD2C40000;
-  gv_local.lookup_454_sig[258].nbits = 14; gv_local.lookup_454_sig[258].bits = 0xDA7C0000;
-  gv_local.lookup_454_sig[259].nbits = 14; gv_local.lookup_454_sig[259].bits = 0xF0380000;
-  gv_local.lookup_454_sig[260].nbits = 14; gv_local.lookup_454_sig[260].bits = 0xF5700000;
-  gv_local.lookup_454_sig[261].nbits = 14; gv_local.lookup_454_sig[261].bits = 0xF5F00000;
-  gv_local.lookup_454_sig[262].nbits = 13; gv_local.lookup_454_sig[262].bits = 0x2A680000;
-  gv_local.lookup_454_sig[263].nbits = 13; gv_local.lookup_454_sig[263].bits = 0x33C00000;
-  gv_local.lookup_454_sig[264].nbits = 13; gv_local.lookup_454_sig[264].bits = 0x36F80000;
-  gv_local.lookup_454_sig[265].nbits = 13; gv_local.lookup_454_sig[265].bits = 0x5D280000;
-  gv_local.lookup_454_sig[266].nbits = 13; gv_local.lookup_454_sig[266].bits = 0x66680000;
-  gv_local.lookup_454_sig[267].nbits = 13; gv_local.lookup_454_sig[267].bits = 0x75100000;
-  gv_local.lookup_454_sig[268].nbits = 13; gv_local.lookup_454_sig[268].bits = 0x86180000;
-  gv_local.lookup_454_sig[269].nbits = 13; gv_local.lookup_454_sig[269].bits = 0x97200000;
-  gv_local.lookup_454_sig[270].nbits = 13; gv_local.lookup_454_sig[270].bits = 0xA7780000;
-  gv_local.lookup_454_sig[271].nbits = 13; gv_local.lookup_454_sig[271].bits = 0xB3E80000;
-  gv_local.lookup_454_sig[272].nbits = 13; gv_local.lookup_454_sig[272].bits = 0xCBB80000;
-  gv_local.lookup_454_sig[273].nbits = 13; gv_local.lookup_454_sig[273].bits = 0xF0100000;
-  gv_local.lookup_454_sig[274].nbits = 13; gv_local.lookup_454_sig[274].bits = 0xF5F80000;
-  gv_local.lookup_454_sig[275].nbits = 12; gv_local.lookup_454_sig[275].bits = 0x30B00000;
-  gv_local.lookup_454_sig[276].nbits = 12; gv_local.lookup_454_sig[276].bits = 0x51E00000;
-  gv_local.lookup_454_sig[277].nbits = 12; gv_local.lookup_454_sig[277].bits = 0x5D800000;
-  gv_local.lookup_454_sig[278].nbits = 12; gv_local.lookup_454_sig[278].bits = 0x74400000;
-  gv_local.lookup_454_sig[279].nbits = 12; gv_local.lookup_454_sig[279].bits = 0x87700000;
-  gv_local.lookup_454_sig[280].nbits = 12; gv_local.lookup_454_sig[280].bits = 0x97600000;
-  gv_local.lookup_454_sig[281].nbits = 12; gv_local.lookup_454_sig[281].bits = 0xB3100000;
-  gv_local.lookup_454_sig[282].nbits = 12; gv_local.lookup_454_sig[282].bits = 0xC9F00000;
-  gv_local.lookup_454_sig[283].nbits = 12; gv_local.lookup_454_sig[283].bits = 0xDBA00000;
-  gv_local.lookup_454_sig[284].nbits = 12; gv_local.lookup_454_sig[284].bits = 0xF5600000;
-  gv_local.lookup_454_sig[285].nbits = 11; gv_local.lookup_454_sig[285].bits = 0x2A200000;
-  gv_local.lookup_454_sig[286].nbits = 11; gv_local.lookup_454_sig[286].bits = 0x33E00000;
-  gv_local.lookup_454_sig[287].nbits = 11; gv_local.lookup_454_sig[287].bits = 0x58000000;
-  gv_local.lookup_454_sig[288].nbits = 11; gv_local.lookup_454_sig[288].bits = 0x66200000;
-  gv_local.lookup_454_sig[289].nbits = 11; gv_local.lookup_454_sig[289].bits = 0x75200000;
-  gv_local.lookup_454_sig[290].nbits = 11; gv_local.lookup_454_sig[290].bits = 0x87400000;
-  gv_local.lookup_454_sig[291].nbits = 11; gv_local.lookup_454_sig[291].bits = 0x94800000;
-  gv_local.lookup_454_sig[292].nbits = 11; gv_local.lookup_454_sig[292].bits = 0xA4000000;
-  gv_local.lookup_454_sig[293].nbits = 11; gv_local.lookup_454_sig[293].bits = 0xA7400000;
-  gv_local.lookup_454_sig[294].nbits = 11; gv_local.lookup_454_sig[294].bits = 0xBA600000;
-  gv_local.lookup_454_sig[295].nbits = 11; gv_local.lookup_454_sig[295].bits = 0xC9A00000;
-  gv_local.lookup_454_sig[296].nbits = 11; gv_local.lookup_454_sig[296].bits = 0xD0000000;
-  gv_local.lookup_454_sig[297].nbits = 11; gv_local.lookup_454_sig[297].bits = 0xD2A00000;
-  gv_local.lookup_454_sig[298].nbits = 11; gv_local.lookup_454_sig[298].bits = 0xDB000000;
-  gv_local.lookup_454_sig[299].nbits = 11; gv_local.lookup_454_sig[299].bits = 0xDB800000;
-  gv_local.lookup_454_sig[300].nbits = 11; gv_local.lookup_454_sig[300].bits = 0xF0400000;
-  gv_local.lookup_454_sig[301].nbits = 11; gv_local.lookup_454_sig[301].bits = 0xF1A00000;
-  gv_local.lookup_454_sig[302].nbits = 11; gv_local.lookup_454_sig[302].bits = 0xF0A00000;
-  gv_local.lookup_454_sig[303].nbits = 11; gv_local.lookup_454_sig[303].bits = 0xF0800000;
-  gv_local.lookup_454_sig[304].nbits = 11; gv_local.lookup_454_sig[304].bits = 0xDBE00000;
-  gv_local.lookup_454_sig[305].nbits = 11; gv_local.lookup_454_sig[305].bits = 0xDB200000;
-  gv_local.lookup_454_sig[306].nbits = 11; gv_local.lookup_454_sig[306].bits = 0xD2800000;
-  gv_local.lookup_454_sig[307].nbits = 11; gv_local.lookup_454_sig[307].bits = 0xC9C00000;
-  gv_local.lookup_454_sig[308].nbits = 11; gv_local.lookup_454_sig[308].bits = 0xBA400000;
-  gv_local.lookup_454_sig[309].nbits = 11; gv_local.lookup_454_sig[309].bits = 0xB2C00000;
-  gv_local.lookup_454_sig[310].nbits = 11; gv_local.lookup_454_sig[310].bits = 0x97000000;
-  gv_local.lookup_454_sig[311].nbits = 11; gv_local.lookup_454_sig[311].bits = 0x94200000;
-  gv_local.lookup_454_sig[312].nbits = 11; gv_local.lookup_454_sig[312].bits = 0x84200000;
-  gv_local.lookup_454_sig[313].nbits = 11; gv_local.lookup_454_sig[313].bits = 0x66E00000;
-  gv_local.lookup_454_sig[314].nbits = 11; gv_local.lookup_454_sig[314].bits = 0x59A00000;
-  gv_local.lookup_454_sig[315].nbits = 11; gv_local.lookup_454_sig[315].bits = 0x36800000;
-  gv_local.lookup_454_sig[316].nbits = 11; gv_local.lookup_454_sig[316].bits = 0x2A000000;
-  gv_local.lookup_454_sig[317].nbits = 12; gv_local.lookup_454_sig[317].bits = 0xF5C00000;
-  gv_local.lookup_454_sig[318].nbits = 12; gv_local.lookup_454_sig[318].bits = 0xD2D00000;
-  gv_local.lookup_454_sig[319].nbits = 12; gv_local.lookup_454_sig[319].bits = 0xC8800000;
-  gv_local.lookup_454_sig[320].nbits = 12; gv_local.lookup_454_sig[320].bits = 0xA4300000;
-  gv_local.lookup_454_sig[321].nbits = 12; gv_local.lookup_454_sig[321].bits = 0x8E700000;
-  gv_local.lookup_454_sig[322].nbits = 12; gv_local.lookup_454_sig[322].bits = 0x74700000;
-  gv_local.lookup_454_sig[323].nbits = 12; gv_local.lookup_454_sig[323].bits = 0x5D000000;
-  gv_local.lookup_454_sig[324].nbits = 12; gv_local.lookup_454_sig[324].bits = 0x33D00000;
-  gv_local.lookup_454_sig[325].nbits = 12; gv_local.lookup_454_sig[325].bits = 0x24C00000;
-  gv_local.lookup_454_sig[326].nbits = 13; gv_local.lookup_454_sig[326].bits = 0xF0300000;
-  gv_local.lookup_454_sig[327].nbits = 13; gv_local.lookup_454_sig[327].bits = 0xCB400000;
-  gv_local.lookup_454_sig[328].nbits = 13; gv_local.lookup_454_sig[328].bits = 0xA5280000;
-  gv_local.lookup_454_sig[329].nbits = 13; gv_local.lookup_454_sig[329].bits = 0x94E80000;
-  gv_local.lookup_454_sig[330].nbits = 13; gv_local.lookup_454_sig[330].bits = 0x84080000;
-  gv_local.lookup_454_sig[331].nbits = 13; gv_local.lookup_454_sig[331].bits = 0x66600000;
-  gv_local.lookup_454_sig[332].nbits = 13; gv_local.lookup_454_sig[332].bits = 0x51D80000;
-  gv_local.lookup_454_sig[333].nbits = 13; gv_local.lookup_454_sig[333].bits = 0x33900000;
-  gv_local.lookup_454_sig[334].nbits = 14; gv_local.lookup_454_sig[334].bits = 0xF5E40000;
-  gv_local.lookup_454_sig[335].nbits = 14; gv_local.lookup_454_sig[335].bits = 0xD2CC0000;
-  gv_local.lookup_454_sig[336].nbits = 14; gv_local.lookup_454_sig[336].bits = 0xC98C0000;
-  gv_local.lookup_454_sig[337].nbits = 14; gv_local.lookup_454_sig[337].bits = 0xB3000000;
-  gv_local.lookup_454_sig[338].nbits = 14; gv_local.lookup_454_sig[338].bits = 0x94F00000;
-  gv_local.lookup_454_sig[339].nbits = 14; gv_local.lookup_454_sig[339].bits = 0x87600000;
-  gv_local.lookup_454_sig[340].nbits = 14; gv_local.lookup_454_sig[340].bits = 0x66080000;
-  gv_local.lookup_454_sig[341].nbits = 14; gv_local.lookup_454_sig[341].bits = 0x66040000;
-  gv_local.lookup_454_sig[342].nbits = 14; gv_local.lookup_454_sig[342].bits = 0x51D40000;
-  gv_local.lookup_454_sig[343].nbits = 14; gv_local.lookup_454_sig[343].bits = 0x33CC0000;
-  gv_local.lookup_454_sig[344].nbits = 14; gv_local.lookup_454_sig[344].bits = 0x28AC0000;
-  gv_local.lookup_454_sig[345].nbits = 14; gv_local.lookup_454_sig[345].bits = 0x28A00000;
-  gv_local.lookup_454_sig[346].nbits = 15; gv_local.lookup_454_sig[346].bits = 0xF03E0000;
-  gv_local.lookup_454_sig[347].nbits = 15; gv_local.lookup_454_sig[347].bits = 0xF1940000;
-  gv_local.lookup_454_sig[348].nbits = 15; gv_local.lookup_454_sig[348].bits = 0xDBCA0000;
-  gv_local.lookup_454_sig[349].nbits = 15; gv_local.lookup_454_sig[349].bits = 0xDBC00000;
-  gv_local.lookup_454_sig[350].nbits = 15; gv_local.lookup_454_sig[350].bits = 0xC9E20000;
-  gv_local.lookup_454_sig[351].nbits = 15; gv_local.lookup_454_sig[351].bits = 0xA42C0000;
-  gv_local.lookup_454_sig[352].nbits = 15; gv_local.lookup_454_sig[352].bits = 0xA42A0000;
-  gv_local.lookup_454_sig[353].nbits = 15; gv_local.lookup_454_sig[353].bits = 0xA53E0000;
-  gv_local.lookup_454_sig[354].nbits = 15; gv_local.lookup_454_sig[354].bits = 0xB3D80000;
-  gv_local.lookup_454_sig[355].nbits = 15; gv_local.lookup_454_sig[355].bits = 0xA53C0000;
-  gv_local.lookup_454_sig[356].nbits = 15; gv_local.lookup_454_sig[356].bits = 0xC8900000;
-  gv_local.lookup_454_sig[357].nbits = 15; gv_local.lookup_454_sig[357].bits = 0xC9880000;
-  gv_local.lookup_454_sig[358].nbits = 15; gv_local.lookup_454_sig[358].bits = 0xC8A80000;
-  gv_local.lookup_454_sig[359].nbits = 15; gv_local.lookup_454_sig[359].bits = 0xCB700000;
-  gv_local.lookup_454_sig[360].nbits = 15; gv_local.lookup_454_sig[360].bits = 0xD2C00000;
-  gv_local.lookup_454_sig[361].nbits = 15; gv_local.lookup_454_sig[361].bits = 0xD2C20000;
-  gv_local.lookup_454_sig[362].nbits = 15; gv_local.lookup_454_sig[362].bits = 0xF01E0000;
-  gv_local.lookup_454_sig[363].nbits = 15; gv_local.lookup_454_sig[363].bits = 0xF01A0000;
-  gv_local.lookup_454_sig[364].nbits = 15; gv_local.lookup_454_sig[364].bits = 0xF5E00000;
-  gv_local.lookup_454_sig[365].nbits = 14; gv_local.lookup_454_sig[365].bits = 0x28A40000;
-  gv_local.lookup_454_sig[366].nbits = 14; gv_local.lookup_454_sig[366].bits = 0x33800000;
-  gv_local.lookup_454_sig[367].nbits = 14; gv_local.lookup_454_sig[367].bits = 0x36EC0000;
-  gv_local.lookup_454_sig[368].nbits = 14; gv_local.lookup_454_sig[368].bits = 0x51D00000;
-  gv_local.lookup_454_sig[369].nbits = 14; gv_local.lookup_454_sig[369].bits = 0x56D40000;
-  gv_local.lookup_454_sig[370].nbits = 14; gv_local.lookup_454_sig[370].bits = 0x5D540000;
-  gv_local.lookup_454_sig[371].nbits = 14; gv_local.lookup_454_sig[371].bits = 0x70840000;
-  gv_local.lookup_454_sig[372].nbits = 14; gv_local.lookup_454_sig[372].bits = 0x86080000;
-  gv_local.lookup_454_sig[373].nbits = 14; gv_local.lookup_454_sig[373].bits = 0x87640000;
-  gv_local.lookup_454_sig[374].nbits = 14; gv_local.lookup_454_sig[374].bits = 0x94180000;
-  gv_local.lookup_454_sig[375].nbits = 14; gv_local.lookup_454_sig[375].bits = 0x972C0000;
-  gv_local.lookup_454_sig[376].nbits = 14; gv_local.lookup_454_sig[376].bits = 0xB3040000;
-  gv_local.lookup_454_sig[377].nbits = 14; gv_local.lookup_454_sig[377].bits = 0xC8940000;
-  gv_local.lookup_454_sig[378].nbits = 14; gv_local.lookup_454_sig[378].bits = 0xCB980000;
-  gv_local.lookup_454_sig[379].nbits = 14; gv_local.lookup_454_sig[379].bits = 0xDA740000;
-  gv_local.lookup_454_sig[380].nbits = 14; gv_local.lookup_454_sig[380].bits = 0xDBC40000;
-  gv_local.lookup_454_sig[381].nbits = 14; gv_local.lookup_454_sig[381].bits = 0xF57C0000;
-  gv_local.lookup_454_sig[382].nbits = 13; gv_local.lookup_454_sig[382].bits = 0x28900000;
-  gv_local.lookup_454_sig[383].nbits = 13; gv_local.lookup_454_sig[383].bits = 0x28880000;
-  gv_local.lookup_454_sig[384].nbits = 13; gv_local.lookup_454_sig[384].bits = 0x30900000;
-  gv_local.lookup_454_sig[385].nbits = 13; gv_local.lookup_454_sig[385].bits = 0x36E00000;
-  gv_local.lookup_454_sig[386].nbits = 13; gv_local.lookup_454_sig[386].bits = 0x56C00000;
-  gv_local.lookup_454_sig[387].nbits = 13; gv_local.lookup_454_sig[387].bits = 0x56D80000;
-  gv_local.lookup_454_sig[388].nbits = 13; gv_local.lookup_454_sig[388].bits = 0x5D580000;
-  gv_local.lookup_454_sig[389].nbits = 13; gv_local.lookup_454_sig[389].bits = 0x66C00000;
-  gv_local.lookup_454_sig[390].nbits = 13; gv_local.lookup_454_sig[390].bits = 0x70880000;
-  gv_local.lookup_454_sig[391].nbits = 13; gv_local.lookup_454_sig[391].bits = 0x75680000;
-  gv_local.lookup_454_sig[392].nbits = 13; gv_local.lookup_454_sig[392].bits = 0x84000000;
-  gv_local.lookup_454_sig[393].nbits = 13; gv_local.lookup_454_sig[393].bits = 0x86100000;
-  gv_local.lookup_454_sig[394].nbits = 13; gv_local.lookup_454_sig[394].bits = 0x8E400000;
-  gv_local.lookup_454_sig[395].nbits = 13; gv_local.lookup_454_sig[395].bits = 0x94400000;
-  gv_local.lookup_454_sig[396].nbits = 13; gv_local.lookup_454_sig[396].bits = 0x94E00000;
-  gv_local.lookup_454_sig[397].nbits = 13; gv_local.lookup_454_sig[397].bits = 0x94F80000;
-  gv_local.lookup_454_sig[398].nbits = 13; gv_local.lookup_454_sig[398].bits = 0x94480000;
-  gv_local.lookup_454_sig[399].nbits = 13; gv_local.lookup_454_sig[399].bits = 0x97300000;
-  gv_local.lookup_454_sig[400].nbits = 13; gv_local.lookup_454_sig[400].bits = 0xB3D00000;
-  gv_local.lookup_454_sig[401].nbits = 13; gv_local.lookup_454_sig[401].bits = 0xD0580000;
-  gv_local.lookup_454_sig[402].nbits = 13; gv_local.lookup_454_sig[402].bits = 0xCB900000;
-  gv_local.lookup_454_sig[403].nbits = 13; gv_local.lookup_454_sig[403].bits = 0xCB680000;
-  gv_local.lookup_454_sig[404].nbits = 13; gv_local.lookup_454_sig[404].bits = 0xCB780000;
-  gv_local.lookup_454_sig[405].nbits = 13; gv_local.lookup_454_sig[405].bits = 0xCB580000;
-  gv_local.lookup_454_sig[406].nbits = 13; gv_local.lookup_454_sig[406].bits = 0xCB600000;
-  gv_local.lookup_454_sig[407].nbits = 13; gv_local.lookup_454_sig[407].bits = 0xC8B00000;
-  gv_local.lookup_454_sig[408].nbits = 13; gv_local.lookup_454_sig[408].bits = 0xC8A00000;
-  gv_local.lookup_454_sig[409].nbits = 13; gv_local.lookup_454_sig[409].bits = 0xB3680000;
-  gv_local.lookup_454_sig[410].nbits = 13; gv_local.lookup_454_sig[410].bits = 0xB3080000;
-  gv_local.lookup_454_sig[411].nbits = 13; gv_local.lookup_454_sig[411].bits = 0xA5200000;
-  gv_local.lookup_454_sig[412].nbits = 13; gv_local.lookup_454_sig[412].bits = 0x97380000;
-  gv_local.lookup_454_sig[413].nbits = 13; gv_local.lookup_454_sig[413].bits = 0x94D80000;
-  gv_local.lookup_454_sig[414].nbits = 13; gv_local.lookup_454_sig[414].bits = 0x94100000;
-  gv_local.lookup_454_sig[415].nbits = 13; gv_local.lookup_454_sig[415].bits = 0x86000000;
-  gv_local.lookup_454_sig[416].nbits = 13; gv_local.lookup_454_sig[416].bits = 0x74380000;
-  gv_local.lookup_454_sig[417].nbits = 13; gv_local.lookup_454_sig[417].bits = 0x66C80000;
-  gv_local.lookup_454_sig[418].nbits = 13; gv_local.lookup_454_sig[418].bits = 0x59980000;
-  gv_local.lookup_454_sig[419].nbits = 13; gv_local.lookup_454_sig[419].bits = 0x56C80000;
-  gv_local.lookup_454_sig[420].nbits = 13; gv_local.lookup_454_sig[420].bits = 0x36A00000;
-  gv_local.lookup_454_sig[421].nbits = 13; gv_local.lookup_454_sig[421].bits = 0x30800000;
-  gv_local.lookup_454_sig[422].nbits = 13; gv_local.lookup_454_sig[422].bits = 0x28980000;
-  gv_local.lookup_454_sig[423].nbits = 14; gv_local.lookup_454_sig[423].bits = 0xF5740000;
-  gv_local.lookup_454_sig[424].nbits = 14; gv_local.lookup_454_sig[424].bits = 0xDBCC0000;
-  gv_local.lookup_454_sig[425].nbits = 14; gv_local.lookup_454_sig[425].bits = 0xCB540000;
-  gv_local.lookup_454_sig[426].nbits = 14; gv_local.lookup_454_sig[426].bits = 0xB3DC0000;
-  gv_local.lookup_454_sig[427].nbits = 14; gv_local.lookup_454_sig[427].bits = 0xA5380000;
-  gv_local.lookup_454_sig[428].nbits = 14; gv_local.lookup_454_sig[428].bits = 0x97280000;
-  gv_local.lookup_454_sig[429].nbits = 14; gv_local.lookup_454_sig[429].bits = 0x876C0000;
-  gv_local.lookup_454_sig[430].nbits = 14; gv_local.lookup_454_sig[430].bits = 0x74340000;
-  gv_local.lookup_454_sig[431].nbits = 14; gv_local.lookup_454_sig[431].bits = 0x74300000;
-  gv_local.lookup_454_sig[432].nbits = 14; gv_local.lookup_454_sig[432].bits = 0x59900000;
-  gv_local.lookup_454_sig[433].nbits = 14; gv_local.lookup_454_sig[433].bits = 0x36A80000;
-  gv_local.lookup_454_sig[434].nbits = 14; gv_local.lookup_454_sig[434].bits = 0x30980000;
-  gv_local.lookup_454_sig[435].nbits = 15; gv_local.lookup_454_sig[435].bits = 0xF5F40000;
-  gv_local.lookup_454_sig[436].nbits = 15; gv_local.lookup_454_sig[436].bits = 0xF03C0000;
-  gv_local.lookup_454_sig[437].nbits = 15; gv_local.lookup_454_sig[437].bits = 0xF0180000;
-  gv_local.lookup_454_sig[438].nbits = 15; gv_local.lookup_454_sig[438].bits = 0xD0500000;
-  gv_local.lookup_454_sig[439].nbits = 15; gv_local.lookup_454_sig[439].bits = 0xC8AA0000;
-  gv_local.lookup_454_sig[440].nbits = 15; gv_local.lookup_454_sig[440].bits = 0xA4280000;
-  gv_local.lookup_454_sig[441].nbits = 15; gv_local.lookup_454_sig[441].bits = 0x94D20000;
-  gv_local.lookup_454_sig[442].nbits = 15; gv_local.lookup_454_sig[442].bits = 0x94D00000;
-  gv_local.lookup_454_sig[443].nbits = 15; gv_local.lookup_454_sig[443].bits = 0x860E0000;
-  gv_local.lookup_454_sig[444].nbits = 15; gv_local.lookup_454_sig[444].bits = 0x751A0000;
-  gv_local.lookup_454_sig[445].nbits = 15; gv_local.lookup_454_sig[445].bits = 0x70820000;
-  gv_local.lookup_454_sig[446].nbits = 15; gv_local.lookup_454_sig[446].bits = 0x660C0000;
-  gv_local.lookup_454_sig[447].nbits = 15; gv_local.lookup_454_sig[447].bits = 0x59940000;
-  gv_local.lookup_454_sig[448].nbits = 15; gv_local.lookup_454_sig[448].bits = 0x56D20000;
-  gv_local.lookup_454_sig[449].nbits = 15; gv_local.lookup_454_sig[449].bits = 0x36E80000;
-  gv_local.lookup_454_sig[450].nbits = 16; gv_local.lookup_454_sig[450].bits = 0xF1970000;
-  gv_local.lookup_454_sig[451].nbits = 16; gv_local.lookup_454_sig[451].bits = 0xD0520000;
-  gv_local.lookup_454_sig[452].nbits = 16; gv_local.lookup_454_sig[452].bits = 0xC8AC0000;
-  gv_local.lookup_454_sig[453].nbits = 16; gv_local.lookup_454_sig[453].bits = 0xC8930000;
-  gv_local.lookup_454_sig[454].nbits = 16; gv_local.lookup_454_sig[454].bits = 0xC9E00000;
-  gv_local.lookup_454_sig[455].nbits = 16; gv_local.lookup_454_sig[455].bits = 0xC98A0000;
-  gv_local.lookup_454_sig[456].nbits = 16; gv_local.lookup_454_sig[456].bits = 0xC8AE0000;
-  gv_local.lookup_454_sig[457].nbits = 16; gv_local.lookup_454_sig[457].bits = 0xC8920000;
-  gv_local.lookup_454_sig[458].nbits = 16; gv_local.lookup_454_sig[458].bits = 0xC8AD0000;
-  gv_local.lookup_454_sig[459].nbits = 16; gv_local.lookup_454_sig[459].bits = 0xC8AF0000;
-  gv_local.lookup_454_sig[460].nbits = 16; gv_local.lookup_454_sig[460].bits = 0xC98B0000;
-  gv_local.lookup_454_sig[461].nbits = 16; gv_local.lookup_454_sig[461].bits = 0xB3DA0000;
-  gv_local.lookup_454_sig[462].nbits = 16; gv_local.lookup_454_sig[462].bits = 0xCB720000;
-  gv_local.lookup_454_sig[463].nbits = 16; gv_local.lookup_454_sig[463].bits = 0xC9E10000;
-  gv_local.lookup_454_sig[464].nbits = 16; gv_local.lookup_454_sig[464].bits = 0xD0530000;
-  gv_local.lookup_454_sig[465].nbits = 16; gv_local.lookup_454_sig[465].bits = 0xB3DB0000;
-  gv_local.lookup_454_sig[466].nbits = 16; gv_local.lookup_454_sig[466].bits = 0xDBC80000;
-  gv_local.lookup_454_sig[467].nbits = 16; gv_local.lookup_454_sig[467].bits = 0xCB730000;
-  gv_local.lookup_454_sig[468].nbits = 16; gv_local.lookup_454_sig[468].bits = 0xDBC90000;
-  gv_local.lookup_454_sig[469].nbits = 16; gv_local.lookup_454_sig[469].bits = 0xF01D0000;
-  gv_local.lookup_454_sig[470].nbits = 16; gv_local.lookup_454_sig[470].bits = 0xF01C0000;
-  gv_local.lookup_454_sig[471].nbits = 16; gv_local.lookup_454_sig[471].bits = 0xF5E20000;
-  gv_local.lookup_454_sig[472].nbits = 16; gv_local.lookup_454_sig[472].bits = 0xF1960000;
-  gv_local.lookup_454_sig[473].nbits = 16; gv_local.lookup_454_sig[473].bits = 0xF5E30000;
-  gv_local.lookup_454_sig[474].nbits = 15; gv_local.lookup_454_sig[474].bits = 0x2A600000;
-  gv_local.lookup_454_sig[475].nbits = 15; gv_local.lookup_454_sig[475].bits = 0x309C0000;
-  gv_local.lookup_454_sig[476].nbits = 15; gv_local.lookup_454_sig[476].bits = 0x309E0000;
-  gv_local.lookup_454_sig[477].nbits = 15; gv_local.lookup_454_sig[477].bits = 0x2A620000;
-  gv_local.lookup_454_sig[478].nbits = 15; gv_local.lookup_454_sig[478].bits = 0x36EA0000;
-  gv_local.lookup_454_sig[479].nbits = 15; gv_local.lookup_454_sig[479].bits = 0x56D00000;
-  gv_local.lookup_454_sig[480].nbits = 15; gv_local.lookup_454_sig[480].bits = 0x59960000;
-  gv_local.lookup_454_sig[481].nbits = 15; gv_local.lookup_454_sig[481].bits = 0x5D520000;
-  gv_local.lookup_454_sig[482].nbits = 15; gv_local.lookup_454_sig[482].bits = 0x5D500000;
-  gv_local.lookup_454_sig[483].nbits = 15; gv_local.lookup_454_sig[483].bits = 0x66000000;
-  gv_local.lookup_454_sig[484].nbits = 15; gv_local.lookup_454_sig[484].bits = 0x66020000;
-  gv_local.lookup_454_sig[485].nbits = 15; gv_local.lookup_454_sig[485].bits = 0x660E0000;
-  gv_local.lookup_454_sig[486].nbits = 15; gv_local.lookup_454_sig[486].bits = 0x75180000;
-  gv_local.lookup_454_sig[487].nbits = 15; gv_local.lookup_454_sig[487].bits = 0x70800000;
-  gv_local.lookup_454_sig[488].nbits = 15; gv_local.lookup_454_sig[488].bits = 0x751C0000;
-  gv_local.lookup_454_sig[489].nbits = 15; gv_local.lookup_454_sig[489].bits = 0x860C0000;
-  gv_local.lookup_454_sig[490].nbits = 15; gv_local.lookup_454_sig[490].bits = 0x751E0000;
-  gv_local.lookup_454_sig[491].nbits = 15; gv_local.lookup_454_sig[491].bits = 0x876A0000;
-  gv_local.lookup_454_sig[492].nbits = 15; gv_local.lookup_454_sig[492].bits = 0x87680000;
-  gv_local.lookup_454_sig[493].nbits = 15; gv_local.lookup_454_sig[493].bits = 0x941C0000;
-  gv_local.lookup_454_sig[494].nbits = 15; gv_local.lookup_454_sig[494].bits = 0x94D60000;
-  gv_local.lookup_454_sig[495].nbits = 15; gv_local.lookup_454_sig[495].bits = 0x941E0000;
-  gv_local.lookup_454_sig[496].nbits = 15; gv_local.lookup_454_sig[496].bits = 0x94F60000;
-  gv_local.lookup_454_sig[497].nbits = 15; gv_local.lookup_454_sig[497].bits = 0x94F40000;
-  gv_local.lookup_454_sig[498].nbits = 15; gv_local.lookup_454_sig[498].bits = 0x94D40000;
-  gv_local.lookup_454_sig[499].nbits = 15; gv_local.lookup_454_sig[499].bits = 0xA42E0000;
-  gv_local.lookup_454_sig[500].nbits = 15; gv_local.lookup_454_sig[500].bits = 0xDBC20000;
-  gv_local.lookup_454_sig[501].nbits = 14; gv_local.lookup_454_sig[501].bits = 0x36AC0000;
-  gv_local.lookup_454_sig[502].nbits = 14; gv_local.lookup_454_sig[502].bits = 0x339C0000;
-  gv_local.lookup_454_sig[503].nbits = 14; gv_local.lookup_454_sig[503].bits = 0x33980000;
-  gv_local.lookup_454_sig[504].nbits = 14; gv_local.lookup_454_sig[504].bits = 0x33C80000;
-  gv_local.lookup_454_sig[505].nbits = 14; gv_local.lookup_454_sig[505].bits = 0x33840000;
-  gv_local.lookup_454_sig[506].nbits = 14; gv_local.lookup_454_sig[506].bits = 0x33880000;
-  gv_local.lookup_454_sig[507].nbits = 14; gv_local.lookup_454_sig[507].bits = 0x2A640000;
-  gv_local.lookup_454_sig[508].nbits = 14; gv_local.lookup_454_sig[508].bits = 0x338C0000;
-  gv_local.lookup_454_sig[509].nbits = 14; gv_local.lookup_454_sig[509].bits = 0x28A80000;
-  gv_local.lookup_454_sig[510].nbits = 15; gv_local.lookup_454_sig[510].bits = 0xF5F60000;
-  gv_local.lookup_454_sig[511].nbits =  9; gv_local.lookup_454_sig[511].bits = 0x97800000;
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  /* reverse huffman lookup table
-   */
-  memset (gv_local.rlookup_454_sig, 0, sizeof(uint16_t)*REV_HUFF_TREESIZE_16);
-
-  for (i=0; i<SIG_HUFF_TREESIZE; i++)
-  {
-    val = gv_local.lookup_454_sig[i].bits >> 16;
-    gv_local.rlookup_454_sig [val] = (uint16_t) i;
-    for (j=1; j<=(0xFFFF>>gv_local.lookup_454_sig[i].nbits); j++)
-      gv_local.rlookup_454_sig [val+j] = (uint16_t) i;
-  }
-#endif
-  _s_sort_lookup (gv_local.lookup_454_sig, gv_local.idx_454_sig, SIG_HUFF_TREESIZE);
-
-  gv_local.lookup_454_sig_initialized = 1;
-}
diff --git a/libs/sraxf/v0-decompress-local.h b/libs/sraxf/v0-decompress-local.h
deleted file mode 100644
index afffcdb..0000000
--- a/libs/sraxf/v0-decompress-local.h
+++ /dev/null
@@ -1,368 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _SRA_DECOMPRESS_LOCAL_HEADER
-#define _SRA_DECOMPRESS_LOCAL_HEADER
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SRA_DECOMPRESS_USE_REVERSE_LOOKUP 1
-
-#include <assert.h>
-#include <byteswap.h>
-#include <limits.h>
-#include <math.h> 
-/*#include <netinet/in.h>*/
-#include <search.h> 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-/*#include <unistd.h>*/
-#include <zlib.h>
-#include <stdint.h>
-
-#define SIG_HUFF_TREESIZE         512
-#define INT_HUFF_TREESIZE         512
-#define NSE_HUFF_TREESIZE         512
-#define PRB_SLX_HUFF_TREESIZE       7
-#define PRB_SLX_SPAN               81
-#define PRB_SLX_MIN                40
- 
-#define PRB_454_HUFF_TREESIZE     100
-#define POS_454_HUFF_TREESIZE      64
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-#define REV_HUFF_TREESIZE_16    65536
-#define REV_HUFF_TREESIZE_08      256
-#endif
-
-#define SIG_MID_POINT            (SIG_HUFF_TREESIZE/2-1)
-#define SIG_MAX_POINT            (SIG_HUFF_TREESIZE-1)
-#define INT_MID_POINT            (INT_HUFF_TREESIZE/2-1)
-#define INT_MAX_POINT            (INT_HUFF_TREESIZE-1)
-#define NSE_MID_POINT            (NSE_HUFF_TREESIZE/2-1)
-#define NSE_MAX_POINT            (NSE_HUFF_TREESIZE-1)
-#define PRB_SLX_MAX_POINT        (PRB_SLX_HUFF_TREESIZE-1)
-#define PRB_454_MAX_POINT        (PRB_454_HUFF_TREESIZE-1)
-#define POS_454_MAX_POINT        (POS_454_HUFF_TREESIZE-1) 
-
-#define LOG_MAIN_MULTIPLIER     2048
-#define LOG_SUB_MULTIPLIER       256
-
-#ifndef _UCHAR_DEFINED
-#define _UCHAR_DEFINED
-typedef unsigned char  uchar_t;
-#endif
-
-/* clearing malloc
- *  NB - in all cases, clearing memory before use
- *  is unnecessary, since the buffers are allocated
- *  to exact sizes and completely overwritten.
- */
-void* sra_zalloc (unsigned int);
-#define sra_zalloc( bytes ) \
-    malloc ( bytes )
-
-/*
- */
-struct SRALookup;
-struct SRALocal;
-
-typedef struct SRALookup* SRALookup_t;
-typedef struct SRALocal*  SRALocal_t;
-
-/* huffman lookup table
- */
-typedef struct SRALookup
-{
-  uchar_t   nbits; /* number of bits for an entry */
-  uint32_t  bits;  /* actual bits */
-} SRALookup;
-
-/* local data storage
- */
-typedef struct SRALocal
-{
-  SRALookup    lookup_slx_sig [SIG_HUFF_TREESIZE];
-  SRALookup    lookup_slx_int [INT_HUFF_TREESIZE];
-  SRALookup    lookup_slx_nse [NSE_HUFF_TREESIZE];
-  SRALookup    lookup_slx_prb [PRB_SLX_HUFF_TREESIZE];
-
-  SRALookup    lookup_454_sig [SIG_HUFF_TREESIZE];
-  SRALookup    lookup_454_prb [PRB_454_HUFF_TREESIZE];
-  SRALookup    lookup_454_pos [POS_454_HUFF_TREESIZE];
-
-  uint16_t     idx_454_sig [SIG_HUFF_TREESIZE];
-  uint16_t     idx_454_prb [PRB_454_HUFF_TREESIZE];
-  uint16_t     idx_454_pos [POS_454_HUFF_TREESIZE];
-
-  uint16_t     idx_slx_sig [SIG_HUFF_TREESIZE];
-  uint16_t     idx_slx_int [INT_HUFF_TREESIZE];
-  uint16_t     idx_slx_nse [NSE_HUFF_TREESIZE];
-  uint16_t     idx_slx_prb [PRB_SLX_HUFF_TREESIZE];
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t     rlookup_slx_sig [REV_HUFF_TREESIZE_16];
-  uint16_t     rlookup_slx_int [REV_HUFF_TREESIZE_16];
-  uint16_t     rlookup_slx_nse [REV_HUFF_TREESIZE_16];
-  uchar_t      rlookup_slx_prb [REV_HUFF_TREESIZE_08];
-
-  uint16_t     rlookup_454_sig [REV_HUFF_TREESIZE_16];
-  uint16_t     rlookup_454_prb [REV_HUFF_TREESIZE_16];
-#endif
-
-  /* sequence encoding/decoding tables
-   */
-  uchar_t      conv2to4na [256][4];  /* backward conversion to nucleotides */
-  uchar_t      conv2to4cs [256][4];  /* backward conversion to color space */
-  uchar_t      convqs4to1 [PRB_SLX_SPAN];
-
-  int          lookup_slx_sig_initialized;
-  int          lookup_slx_int_initialized;
-  int          lookup_slx_nse_initialized;
-  int          lookup_slx_prb_initialized;
-
-  int          lookup_454_sig_initialized;
-  int          lookup_454_prb_initialized;
-  int          lookup_454_pos_initialized;
-  int          lookup_454_seq_initialized;
-} SRALocal;
-
-
-/* some useful macros
- *
- */
-#define _put_short(data, dst, shift, bitpos) \
-  do { \
-    unsigned int   _shift =*(shift); \
-    unsigned int   _bitpos= (bitpos); \
-    unsigned char* _dst   = (unsigned char*)(dst); \
-    unsigned char  _byte; \
-    if(_bitpos) \
-    { \
-      _byte = (unsigned char)((data) >> 8); \
-      *(_dst+_shift)   |= (_byte >> _bitpos); \
-      *(_dst+_shift+1) |= (_byte << (8-_bitpos)); \
-      _byte = (unsigned char)((data) & 0xFF); \
-      *(_dst+_shift+1) |= (_byte >> _bitpos); \
-      *(_dst+_shift+2) |= (_byte << (8-_bitpos)); \
-    } \
-    else \
-    { \
-      _byte = (unsigned char)((data) >> 8); \
-      *(_dst+_shift)   = _byte; \
-      _byte = (unsigned char)((data) & 0xFF); \
-      *(_dst+_shift+1) = _byte; \
-    } \
-    *(shift)=_shift+2; \
-  } while(0)
-/*      
- */   
-#define _get_byte(src, shift, bitpos, byte, update) \
-  do { \
-    unsigned int _shift=*(shift); \
-    *(byte) = 0; \
-    if(bitpos) \
-    { \
-      *(byte)  = *((src)+_shift)<<(bitpos); \
-      *(byte) |= *((src)+_shift+1)>>(8-(bitpos)); \
-    } \
-    else *(byte) = *((src)+_shift); \
-    if(update) *(shift)=_shift+1; \
-  } while(0)
-
-/*
- */
-#define _get_short(src, shift, bitpos, data, update) \
-  do { \
-    unsigned int   _shift=*(shift); \
-    unsigned short _data =0; \
-    if(bitpos) \
-    { \
-      _data  = ((*((src)+_shift)<<(bitpos))<<8); \
-      _data |= ((*((src)+_shift+1)>>(8-(bitpos)))<<8); \
-      _data |= ((*((src)+_shift+1)<<(bitpos))); \
-      _data |= ((*((src)+_shift+2)>>(8-(bitpos)))); \
-    } \
-    else \
-    { \
-      _data  = (*((src)+_shift)<<8); \
-      _data |= (*((src)+_shift+1) & 0xFF); \
-    } \
-    *(data) = _data; \
-    if(update) *(shift)=_shift+2; \
-  } while(0)
-    
-/*
- */
-#if _DEBUGGING
-#define _get_long(src, nbits, shift, bitpos, ldata, update, max_bits)	\
-    do {								\
-        unsigned int   _shift =*(shift);				\
-        unsigned int   _bitpos=*(bitpos);				\
-        unsigned char* _src=(unsigned char*)(src);                      \
-        uint32_t _l = 0;						\
-        int _bits_done = 0;						\
-        int _nbits = nbits;						\
-                                                                        \
-        if (_bitpos + _nbits + (_shift << 3) > max_bits) {              \
-            fprintf(stderr, "legacy code trying to read %u bits beyond end of data at %s, line %d.\n", _bitpos + _nbits + (_shift << 3) - max_bits, __FILE__, __LINE__); \
-            _nbits = max_bits - (_bitpos + (_shift << 3));              \
-        }                                                               \
-        while (_nbits > 0) {                                            \
-            unsigned _bits;						\
-            int _bitsl;                                                 \
-                                                                        \
-            _bits = _src[_shift];					\
-            _bitsl = 8;                                                 \
-                                                                        \
-            if (_bitpos) {                                              \
-                _bits &= 0xFFu >> _bitpos;                              \
-                _bitsl = 8 - _bitpos;                                   \
-            }                                                           \
-                                                                        \
-            if (_bitsl > _nbits) {                                      \
-                _bits >>= _bitsl - _nbits;                              \
-                _bitsl = _nbits;                                        \
-            }                                                           \
-                                                                        \
-            _bitpos += _bitsl;                                          \
-                                                                        \
-            if (_bitpos == 8) {                                         \
-                _bitpos = 0;                                            \
-                _shift++;                                               \
-            }                                                           \
-                                                                        \
-            _l |= _bits << (32 - (_bits_done + _bitsl));		\
-                                                                        \
-            _bits_done += _bitsl;					\
-                                                                        \
-            _nbits -= _bitsl;                                           \
-        }								\
-                                                                        \
-        *ldata = _l;                                                    \
-                                                                        \
-        if(update) {                                                    \
-            *(shift) =_shift;                                           \
-            *(bitpos)=_bitpos;                                          \
-        }								\
-    } while(0)
-#else
-#define _get_long(src, nbits, shift, bitpos, ldata, update, max_bits)	\
-    do {								\
-        unsigned int   _shift =*(shift);				\
-        unsigned int   _bitpos=*(bitpos);				\
-        unsigned char* _src=(unsigned char*)(src);                      \
-        uint32_t _l = 0;						\
-        int _bits_done = 0;						\
-        int _nbits = nbits;						\
-                                                                        \
-        if (_bitpos + _nbits + (_shift << 3) > max_bits) {              \
-            _nbits = max_bits - (_bitpos + (_shift << 3));              \
-        }                                                               \
-        while (_nbits > 0) {                                            \
-            unsigned _bits;						\
-            int _bitsl;                                                 \
-                                                                        \
-            _bits = _src[_shift];					\
-            _bitsl = 8;                                                 \
-                                                                        \
-            if (_bitpos) {                                              \
-                _bits &= 0xFFu >> _bitpos;                              \
-                _bitsl = 8 - _bitpos;                                   \
-            }                                                           \
-                                                                        \
-            if (_bitsl > _nbits) {                                      \
-                _bits >>= _bitsl - _nbits;                              \
-                _bitsl = _nbits;                                        \
-            }                                                           \
-                                                                        \
-            _bitpos += _bitsl;                                          \
-                                                                        \
-            if (_bitpos == 8) {                                         \
-                _bitpos = 0;                                            \
-                _shift++;                                               \
-            }                                                           \
-                                                                        \
-            _l |= _bits << (32 - (_bits_done + _bitsl));		\
-                                                                        \
-            _bits_done += _bitsl;					\
-                                                                        \
-            _nbits -= _bitsl;                                           \
-        }								\
-                                                                        \
-        *ldata = _l;                                                    \
-                                                                        \
-        if(update) {                                                    \
-            *(shift) =_shift;                                           \
-            *(bitpos)=_bitpos;                                          \
-        }								\
-    } while(0)
-#endif
-
-/* various rotation routines
- */
-#define _rotate_1(type,array) \
-  do { \
-    type* _ptr = (type*)(array); \
-    type  _val = *(_ptr+0); \
-    *(_ptr+0) = *(_ptr+1); *(_ptr+1) = *(_ptr+2); \
-    *(_ptr+2) = *(_ptr+3); *(_ptr+3) = _val; \
-  } while(0)
-/*
- */
-#define _rotate_2(type,array) \
-  do { \
-    type* _ptr = (type*)(array); \
-    type  _val = *(_ptr+0); \
-    *(_ptr+0) = *(_ptr+2); *(_ptr+2) = _val; \
-    _val = *(_ptr+1); \
-    *(_ptr+1) = *(_ptr+3); *(_ptr+3) = _val; \
-  } while(0)
-/*
- */
-#define _rotate_3(type,array) \
-  do { \
-    type* _ptr = (type*)(array); \
-    type  _val = *(_ptr+3); \
-    *(_ptr+3) = *(_ptr+2); *(_ptr+2) = *(_ptr+1); \
-    *(_ptr+1) = *(_ptr+0); *(_ptr+0) = _val; \
-  } while(0)
-
-/*
- */
-#define _cmpbits(src1, src2, size, result) \
-  do { \
-    unsigned int _mask=0xFFFFFFFFL<<(32-(size)); \
-    if (((unsigned int)(src1)&_mask)^((unsigned int)(src2)&_mask)) *(result)=0; else *(result)=1; \
-  } while(0)
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/libs/sraxf/v0-decompress.c b/libs/sraxf/v0-decompress.c
deleted file mode 100644
index 16cdc99..0000000
--- a/libs/sraxf/v0-decompress.c
+++ /dev/null
@@ -1,1096 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include "v0-decompress.h"
-#include "v0-decompress-local.h"
-#include <klib/data-buffer.h>
-#include <klib/sort.h>
-#include <sysalloc.h>
-
-#include <math.h>
-
-/* local data
- */
-SRALocal     gv_local;
-
-static
-void *sra_alloc ( KDataBuffer *dst, KDataBuffer *alt, size_t bytes )
-{
-    rc_t rc;
-
-    /* whatever was in dst, put it in alt */
-    KDataBufferWhack ( alt );
-#if 0
-    *alt = *dst;
-#else
-    KDataBufferSub ( dst, alt, 0, UINT64_MAX );
-    KDataBufferWhack(dst);
-#endif
-
-    /* allocate a new space */
-    rc = (uint32_t)KDataBufferMakeBytes ( dst, (uint32_t)bytes );
-    if ( rc != 0 )
-        return NULL;
-
-#if 1
-#define BZERO_SIZE 256
-    if (bytes > BZERO_SIZE)
-        memset(&((char *)dst->base)[bytes-BZERO_SIZE], 0, BZERO_SIZE);
-    else
-        memset(dst->base, 0, bytes);
-#undef BZERO_SIZE
-#endif
-    
-    /* return a pointer to it just like malloc */
-    return dst -> base;
-}
-
-/*
- */
-static void _s_undelta_4_channel (int slen, int tlen, void* src, int ssize)
-{
-  int     i, j;
-  char*   cptr = (char*)src;
-  short*  sptr = (short*)src;
-  int*    iptr = (int*)src;
-
-  assert (tlen);
-  assert ((ssize&3) == 0); /* make sure we have all 4 channels in it */
-
-  for (i=0, j=0; i<ssize/tlen; i+=4, j++)
-  {
-    /* after each slen the actual data is stored as is,
-     * this shift happens at the begining as well
-     */
-    if (j%slen == 0) { i += 4; j++; }
-
-    switch (tlen)
-    {
-      case 4: *(iptr+i+0) += *(iptr+i-4);
-              *(iptr+i+1) += *(iptr+i-3);
-              *(iptr+i+2) += *(iptr+i-2);
-              *(iptr+i+3) += *(iptr+i-1);
-              break;
-
-      case 2: *(sptr+i+0) += *(sptr+i-4);
-              *(sptr+i+1) += *(sptr+i-3);
-              *(sptr+i+2) += *(sptr+i-2);
-              *(sptr+i+3) += *(sptr+i-1);
-              break;
-
-      default:
-      case 1: *(cptr+i+0) += *(cptr+i-4);
-              *(cptr+i+1) += *(cptr+i-3);
-              *(cptr+i+2) += *(cptr+i-2);
-              *(cptr+i+3) += *(cptr+i-1);
-              break;
-    }
-  }
-}
-
-/*
- */
-static void _s_exponent_4_channel (int slen, void* dst, int dsize, const void* src, int ssize, float sim, float snm)
-{
-  int     i;
-  float*  fptr = (float*)dst;
-  short*  sptr = (short*)src;
-
-  assert ((ssize&3) == 0); /* make sure we have all 4 channels in it */
-  assert (ssize*2 == dsize);
-
-  for (i=0; i<ssize>>1; i+=4) /* the source buffer is full of short values, therefore ssize>>1 */
-  {
-    *(fptr+i+0) = expf ((float)*(sptr+i+0)/LOG_MAIN_MULTIPLIER)/10 + sim;
-    *(fptr+i+1) = expf ((float)*(sptr+i+1)/LOG_SUB_MULTIPLIER )/10 + snm;
-    *(fptr+i+2) = expf ((float)*(sptr+i+2)/LOG_SUB_MULTIPLIER )/10 + snm;
-    *(fptr+i+3) = expf ((float)*(sptr+i+3)/LOG_SUB_MULTIPLIER )/10 + snm;
-  }
-}
-
-/*
- */
-static int _s_decompress_zlib ( void* dst, const void* src, int dsize, int ssize )
-{
-    z_stream c_stream; /* decompression stream */
-    
-    memset( &c_stream, 0, sizeof( c_stream ) );
-    c_stream.next_in   = ( Bytef* )src;
-    c_stream.next_out  = ( Bytef* )dst;
-    c_stream.avail_in  = ( uInt )ssize;
-    c_stream.avail_out = ( uInt )dsize;
-    
-    if ( Z_OK != inflateInit ( &c_stream ) )
-    {
-        inflateEnd ( &c_stream );
-        return 1; 
-    }
-    
-    if ( Z_STREAM_END != inflate ( &c_stream, Z_FINISH ) &&
-         Z_OK != inflateSync( &c_stream ) )
-    {
-        inflateEnd ( &c_stream );
-        return 1; 
-    }
-    
-    if ( Z_OK != inflateEnd ( &c_stream ) )
-    {
-        return 1;
-    }
-    
-    return 0;
-}
-
-/*
- */
-static int CC _s_cmp_key (const void* keyptr, const void* idxptr, void *data)
-{
-  SRALookup_t plook = data;
-  static uint32_t mask [33] = {0x00000000, 0x80000000, 0xC0000000, 0xE0000000,
-                               0xF0000000, 0xF8000000, 0xFC000000, 0xFE000000,
-                               0xFF000000, 0xFF800000, 0xFFC00000, 0xFFE00000,
-                               0xFFF00000, 0xFFF80000, 0xFFFC0000, 0xFFFE0000,
-                               0xFFFF0000, 0xFFFF8000, 0xFFFFC000, 0xFFFFE000,
-                               0xFFFFF000, 0xFFFFF800, 0xFFFFFC00, 0xFFFFFE00,
-                               0xFFFFFF00, 0xFFFFFF80, 0xFFFFFFC0, 0xFFFFFFE0,
-                               0xFFFFFFF0, 0xFFFFFFF8, 0xFFFFFFFC, 0xFFFFFFFE,
-                               0xFFFFFFFF};
-
-  uint16_t   index      = *(uint16_t*)idxptr;
-  uint32_t   keyBits    = *(uint32_t*)keyptr & mask[plook[index].nbits];
-  uint32_t   lookupBits = plook[index].bits;
-
-  if (keyBits < lookupBits) return -1;
-  if (keyBits > lookupBits) return  1;
-
-  return 0;
-}
-
-/*
- * decompresses positions for 454 platform, and restores their actual values
- *
- */
-int sra_decompress_pos ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;              /* compression type magic */
-  const uchar_t* pepos;              /* ptr to encoded positions */
-  uchar_t*       popos;              /* ptr to output positions */
-  uint16_t*      pspos;              /* ptr to short values after restoration */
-  uchar_t*       iptr;               /* ptr to index in lookup table */
-  uchar_t        indx;               /* actual index */
-  uint16_t       offset, shift, osize, pos, rbpos, nbits, i;
-  uint32_t       lval;               /* _get_long reads into it */
-
-  assert (gv_local.lookup_454_pos_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  pepos  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (pepos, &offset, rbpos, &magic, 1);
-  _get_short (pepos, &offset, rbpos, &osize, 1);
-
-  assert (magic == SRA_CT_ZLIB || magic == SRA_CT_HUFFMAN);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB) /* it is always applied on top of huffman */
-  {
-    shift = 3; /* magic + length */
-    popos = sra_alloc ( dst, alt, osize + 100 ); /* generosity */
-
-    if (_s_decompress_zlib(popos, pepos+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    pepos  = popos;
-    _get_byte  (pepos, &offset, rbpos, &magic, 1);
-    _get_short (pepos, &offset, rbpos, &osize, 1);
-    assert (magic == SRA_CT_HUFFMAN);
-    magic = SRA_CT_ZLIB; /* to make sure an extra allocated buffer will be destroyed */
-  }
-
-  popos = sra_alloc (dst, alt, osize );
-
-
-  /* decompress huffman
-   */
-  pos = 0;
-  while (pos < osize)
-  {
-    if (ssize-offset > 4) nbits = 32;
-    else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-    _get_long ( pepos, nbits, &offset, &rbpos, &lval, 0, (ssize << 3) );
-
-    iptr = (uchar_t*) kbsearch ( &lval, gv_local.idx_454_pos,
-                                 POS_454_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_454_pos );
-    assert (iptr);
-    indx = *iptr;
-
-    offset += ((rbpos+(uint16_t)gv_local.lookup_454_pos[indx].nbits) >> 3);
-    rbpos   = ((rbpos+(uint16_t)gv_local.lookup_454_pos[indx].nbits) &  7);
-
-    if (indx < POS_454_MAX_POINT)
-      *(popos+pos) = indx;
-    else
-    {
-      uchar_t val;
-      _get_byte (pepos, &offset, rbpos, &val, 1);
-      *(popos+pos) = val;
-    }
-    pos++;
-  }
-
-  /* undelta
-   */
-  pspos = sra_alloc ( dst, alt, (osize*sizeof(uint16_t)+3)&~3); /** align to 4-byte **/
-  assert (pspos);
-
-  *(pspos+0) = *(popos+0);
-  for (i=1; i<osize; i++)
-    *(pspos+i) = *(pspos+i-1) + *(popos+i);
-
-  /* set element size to 16 bits */
-  KDataBufferCast ( dst, dst, 16, true );
-
-  /* crop size to osize */
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-
-int sra_decompress_prb_454 ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* peprb;
-  uchar_t*       poprb;
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t*      iptr;
-#endif
-  uint16_t       offset, shift, osize, pos, rbpos, nbits;
-  uchar_t        indx;
-  uint32_t       lval;
-
-  assert (gv_local.lookup_454_prb_initialized);
-
-  rbpos  = 0; /* read bit position */
-  offset = 0;
-  peprb  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (peprb, &offset, rbpos, &magic, 1);
-  _get_short (peprb, &offset, rbpos, &osize, 1);
-
-  assert (magic == SRA_CT_ZLIB || magic == SRA_CT_HUFFMAN);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 3; /* magic + length */
-/****  HACK: in some runs osize was truncated/corrupted????  Giving it some more space *****/
-    poprb = sra_alloc ( dst, alt, osize+200 );
-
-    if (_s_decompress_zlib(poprb, peprb+shift, (int)osize + 200, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    peprb  = poprb;
-    _get_byte  (peprb, &offset, rbpos, &magic, 1);
-    _get_short (peprb, &offset, rbpos, &osize, 1);
-    assert (magic == SRA_CT_HUFFMAN);
-  }
-
-  poprb = sra_alloc (dst, alt, (osize+3)&~3); /** align to 4-byte boundary **/
-
-
-  /* decompress huffman
-   */
-  pos = 0;
-  while (pos < osize)
-  {
-    if (ssize-offset > 4) nbits = 32;
-    else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-    if ((offset > (uint32_t)ssize) || (nbits == 0))
-      return 1;
-
-    _get_long (peprb, nbits, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-    indx = gv_local.rlookup_454_prb [lval>>16];
-#else
-    iptr = (uint16_t*) kbsearch (&lval, gv_local.idx_454_prb,
-                                PRB_454_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_454_prb);
-    assert (iptr);
-    indx = *iptr;
-#endif
-
-    offset += ((rbpos+(uint16_t)gv_local.lookup_454_prb[indx].nbits) >> 3);
-    rbpos   = ((rbpos+(uint16_t)gv_local.lookup_454_prb[indx].nbits) &  7);
-
-    if (indx < PRB_454_MAX_POINT)
-      *(poprb+pos) = indx;
-    else
-    {
-      uchar_t val;
-      _get_byte (peprb, &offset, rbpos, &val, 1);
-      *(poprb+pos) = val;
-    }
-    pos++;
-  }
-
-  /* crop size to osize */
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-int sra_decompress_clp  ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* peclp;
-  uchar_t*       poclp;
-  uint32_t       osize, offset;
-  uint16_t       rbpos, shift;
-
-  rbpos  = 0;
-  offset = 0;
-  peclp  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (peclp,     &offset,  rbpos, &magic, 1);
-  _get_long  (peclp, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-  assert (magic == SRA_CT_ZLIB);
-
-  shift = 5; /* magic + length */
-  poclp = sra_alloc ( dst, alt, osize + 100 );
-
-  if (_s_decompress_zlib(poclp, peclp+shift, (int)osize + 100, ssize-shift))
-    return 1;
-
-  /* crop size to osize */
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-int sra_decompress_sig_454 ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* pesig;
-  uchar_t*       posig;
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t*      iptr;
-#endif
-  uint16_t       offset, shift, osize, pos, rbpos, wbpos, indx, nbits;
-  uint32_t       lval;
-
-  assert (gv_local.lookup_454_sig_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  pesig  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (pesig, &offset, rbpos, &magic, 1);
-  _get_short (pesig, &offset, rbpos, &osize, 1);
-
-  assert (magic == SRA_CT_ZLIB || magic == SRA_CT_HUFFMAN);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 3; /* magic + length */
-    posig = sra_alloc ( dst, alt, osize + 100 );
-
-    if (_s_decompress_zlib(posig, pesig+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    pesig  = posig;
-    _get_byte  (pesig, &offset, rbpos, &magic, 1);
-    _get_short (pesig, &offset, rbpos, &osize, 1);
-    assert (magic == SRA_CT_HUFFMAN);
-  }
- 
-  posig = sra_alloc ( dst, alt, osize );
-
-  /* decompress huffman
-   */
-  pos   = 0;
-  wbpos = 0; /* write bit position */
-  while (pos < osize)
-  {
-    if (ssize-offset > 4) nbits = 32;
-    else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-    _get_long (pesig, nbits, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-    indx = gv_local.rlookup_454_sig [lval>>16];
-#else
-    iptr = (uint16_t*) kbsearch (&lval, gv_local.idx_454_sig,
-                                SIG_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_454_sig);
-    assert (iptr);
-    indx = *iptr;
-#endif
-
-    offset += ((rbpos+(uint16_t)gv_local.lookup_454_sig[indx].nbits) >> 3);
-    rbpos   = ((rbpos+(uint16_t)gv_local.lookup_454_sig[indx].nbits) &  7);
-
-    if (indx < SIG_MAX_POINT)
-    {
-      indx = bswap_16 (indx);
-      _put_short (indx, posig, &pos, wbpos);
-    }
-    else
-    {
-      uint16_t val;
-      if ((int)nbits - (int)gv_local.lookup_454_sig[indx].nbits >= 16)
-      {
-        val = (uint16_t)((lval >> (16-gv_local.lookup_454_sig[indx].nbits)) & 0xFFFF);
-        offset += 2;
-      }
-      else
-        _get_short (pesig, &offset, rbpos, &val, 1);
-
-      val = bswap_16 (val);
-      _put_short (val, posig, &pos, wbpos);
-    }
-  }
-
-  /* crop size to osize */
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-int sra_decompress_prb_slx ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  char           byte;
-  char           qmin, qmax;
-  const uchar_t* peprb;
-  uchar_t*       poprb;
-  uint32_t       osize, offset, rbpos, pos;
-  uint16_t       fix_seq_len, shift;
-
-  assert (gv_local.lookup_slx_prb_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  peprb  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (peprb,     &offset,  rbpos, &magic, 1);
-  _get_long  (peprb, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-    
-  assert (magic == SRA_CT_ZLIB || magic == SRA_CT_HUFFMAN || magic == SRA_CT_UNCOMPRESSED);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 5; /* magic + length */
-    poprb = sra_alloc ( dst, alt, osize + 100);
-    if (_s_decompress_zlib(poprb, peprb+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0;
-    offset = 0;
-    ssize  = osize;
-    peprb  = poprb;
-    _get_byte  (peprb,     &offset,  rbpos, &magic, 1);
-    _get_long  (peprb, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-    assert (magic == SRA_CT_HUFFMAN || magic == SRA_CT_UNCOMPRESSED);
-  }
-    
-  _get_byte  (peprb, &offset,  rbpos, &qmin,        1);
-  _get_byte  (peprb, &offset,  rbpos, &qmax,        1);
-  _get_short (peprb, &offset,  rbpos, &fix_seq_len, 1);
-
-  poprb = sra_alloc (dst, alt, osize+100); /** huffman decode can read too much ***/
-
-  /* decompress huffman
-   */
-  if (magic ==  SRA_CT_HUFFMAN)
-  {
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-    uchar_t*   iptr;
-#endif
-    uchar_t    indx;
-    union      { char c[4]; uint32_t val; } uval;
-    uint32_t   lval;
-
-
-    pos = 0;
-    while (pos < osize)
-    {
-      if (offset > (uint32_t)ssize)
-        return 1;
-
-      _get_long (peprb, 4, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-      indx = gv_local.rlookup_slx_prb [lval>>24];
-#else
-      iptr = (uchar_t*) kbsearch (&lval, gv_local.idx_slx_prb,
-                                 PRB_SLX_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_slx_prb);
-      assert (iptr);
-      indx = *iptr;
-#endif
-
-      offset += ((rbpos+(uint16_t)gv_local.lookup_slx_prb[indx].nbits) >> 3);
-      rbpos   = ((rbpos+(uint16_t)gv_local.lookup_slx_prb[indx].nbits) &  7);
-
-      switch (indx)
-      {
-        case 0: /* max min min min */
-          uval.c[3] = uval.c[2] = uval.c[1] = qmin; uval.c[0] = qmax;
-          break;
-
-        case 1: /* -5 -5 -5 -5 */
-          uval.c[3] = uval.c[2] = uval.c[1] = uval.c[0] = -5;
-          break;
-
-        case 2: /* val -val min min */
-          _get_long (peprb, 6, &offset, &rbpos, &lval, 1, (ssize << 3));
-          byte = (char)(lval >> 26); /* only 6 bits are needed */
-          uval.c[3] = uval.c[2] = qmin; uval.c[1] = -byte; uval.c[0] = byte;
-          break;
-
-        case 3: /* val min -val min */
-          _get_long (peprb, 6, &offset, &rbpos, &lval, 1, (ssize << 3));
-          byte = (char)(lval >> 26); /* only 6 bits are needed */
-          uval.c[3] = uval.c[1] = qmin; uval.c[2] = -byte; uval.c[0] = byte;
-          break;
-
-        case 4: /* val min min -val */
-          _get_long (peprb, 6, &offset, &rbpos, &lval, 1, (ssize << 3));
-          byte = (char)(lval >> 26); /* only 6 bits are needed */
-          uval.c[2] = uval.c[1] = qmin; uval.c[3] = -byte; uval.c[0] = byte;
-          break;
-
-        case 5:
-        default:
-          _get_long (peprb, 32, &offset, &rbpos, (uint32_t *)&uval.c[0], 1, (ssize << 3));
-          /*uval.val = lval*/;
-          break;
-      }
-      memcpy (poprb+pos, &uval.c[0], sizeof(uint32_t));
-      pos += 4;
-    }
-  }
-  else
-  if (magic == SRA_CT_UNCOMPRESSED)
-  {
-      memcpy (poprb, peprb+9, osize);
-  }
-
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-static void _s_decode_slx (uchar_t magic, const uchar_t* pesig, uchar_t* posig, uint32_t osize, uint32_t offset, uint32_t rbpos, int ssize)
-{
-  uint32_t pos = 0;
-  uint16_t fix_seq_len;
-
-  if (magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_BASELINED)
-  {
-    int32_t  baseline = 0;
-    float    fval;
-    uint16_t uval;
-
-    _get_short (pesig,     &offset,  rbpos, &fix_seq_len,  1);
-    _get_long  (pesig, 32, &offset, &rbpos, &baseline,     1, (ssize << 3));
-
-    rbpos = 0; /* read bit position */
-
-
-    while (pos < osize)
-    {
-      uval = 0;
-      _get_short (pesig, &offset, rbpos, &uval, 1);
-      fval =     (float) (uval-baseline);
-      memcpy     (posig+pos, &fval, sizeof(float));
-      pos += sizeof(float);
-    }
-  }
-  else
-  if (magic == SRA_CT_NORMALIZED)
-  {
-    union  { float fval; uint32_t uval; } uf;
-    float  fval;
-    float  fmin;
-    short  sval;
-
-    _get_short (pesig,     &offset,  rbpos, &fix_seq_len,  1);
-    _get_short (pesig,     &offset,  rbpos, &sval,         1);
-    _get_long  (pesig, 32, &offset, &rbpos, &uf.uval,      1, (ssize << 3));
-
-    fmin = (float) sval;
-    rbpos = 0; /* read bit position */
-
-
-    while (pos < osize)
-    {
-      sval = 0;
-      fval = uf.fval;
-      _get_short (pesig, &offset, rbpos, &sval, 1);
-      fval *= sval; fval += fmin;
-      memcpy     (posig+pos, &fval, sizeof(float));
-      pos += sizeof(float);
-    }
-  }
-}
-
-int sra_decompress_sig_slx ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* pesig;
-  uchar_t*       posig;
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t*      iptr;
-#endif
-  uint16_t       indx, fix_seq_len, shift;
-  uint32_t       pos, rbpos, wbpos, nbits;
-  uint32_t       offset, osize, lval;
-  union { float fval; uint32_t uval; } sim, snm; /* minimum level of signal and noise */
-
-  assert (gv_local.lookup_slx_sig_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  pesig  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-  _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-  assert (magic == SRA_CT_ZLIB         || magic == SRA_CT_HUFFMAN ||
-          magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED ||
-          magic == SRA_CT_BASELINED);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 5; /* magic + length */
-    posig = sra_alloc ( dst, alt, osize + 100 );
-
-    if (_s_decompress_zlib(posig, pesig+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    pesig  = posig;
-    _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-    assert (magic == SRA_CT_HUFFMAN    || magic == SRA_CT_UNCOMPRESSED ||
-            magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED);
-  }
-
-  /* decompress huffman
-   */
-  if (magic == SRA_CT_HUFFMAN)
-  {
-    _get_short (pesig,     &offset,  rbpos, &fix_seq_len, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &sim.uval,    1, (ssize << 3));
-    _get_long  (pesig, 32, &offset, &rbpos, &snm.uval,    1, (ssize << 3));
-
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-
-    posig = sra_alloc (dst, alt, osize);
-
-    pos   = 0;
-    wbpos = 0; /* write bit position */
-
-    while (pos < osize)
-    {
-      if (ssize-offset > 4) nbits = 32;
-      else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-      if (offset > (uint32_t)ssize)
-        return 1;
-
-      _get_long (pesig, nbits, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-      indx = gv_local.rlookup_slx_sig [lval>>16];
-#else
-      iptr = (uint16_t*) kbsearch (&lval, gv_local.idx_slx_sig,
-                                  SIG_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_slx_sig);
-      assert (iptr);
-      indx = *iptr;
-#endif
-
-      offset += ((rbpos+(uint32_t)gv_local.lookup_slx_sig[indx].nbits) >> 3);
-      rbpos   = ((rbpos+(uint32_t)gv_local.lookup_slx_sig[indx].nbits)  & 7);
-
-      if (indx < SIG_MAX_POINT)
-      {
-        indx = bswap_16 ((uint16_t)(indx-SIG_MID_POINT));
-        _put_short (indx, posig, &pos, wbpos);
-      }
-      else
-      {
-        uint16_t val;
-        if ((int)nbits - (int)gv_local.lookup_slx_sig[indx].nbits >= 16)
-        {
-          val = (short)((lval >> (16-gv_local.lookup_slx_sig[indx].nbits)) & 0xFFFF);
-          offset += 2;
-        }
-        else
-          _get_short (pesig, &offset, rbpos, &val, 1);
-
-        val = bswap_16 (val);
-        _put_short (val, posig, &pos, wbpos);
-      }
-    }
-
-    _s_undelta_4_channel (fix_seq_len, sizeof(uint16_t), posig, osize);
-
-    pesig = posig;
-    ssize = osize;
-    osize = osize << 1;
-    posig = sra_alloc ( dst, alt, osize );
-
-    _s_exponent_4_channel (fix_seq_len, posig, osize, pesig, ssize, sim.fval, snm.fval);
-  }
-  else
-  if (magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED)
-  {
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-    osize *= 2;              /* desination size is 4 bytes per channel, but the original is 2 */
-
-    posig = sra_alloc ( dst, alt, osize );
-
-    _s_decode_slx (magic, pesig, posig, osize, offset, rbpos, ssize);
-  }
-
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-int sra_decompress_int ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* pesig;
-  uchar_t*       posig;
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t*      iptr;
-#endif
-  uint16_t       indx, fix_seq_len, shift;
-  uint32_t       pos, rbpos, wbpos, nbits;
-  uint32_t       offset, osize, lval;
-  union { float fval; uint32_t uval; } sim, snm; /* minimum level of signal and noise */
-
-  assert (gv_local.lookup_slx_int_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  pesig  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-  _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-  assert (magic == SRA_CT_ZLIB         || magic == SRA_CT_HUFFMAN ||
-          magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED ||
-          magic == SRA_CT_BASELINED);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 5; /* magic + length */
-    posig = sra_alloc ( dst, alt, osize + 100 );
-
-    if (_s_decompress_zlib(posig, pesig+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    pesig  = posig;
-    _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-    assert (magic == SRA_CT_HUFFMAN    || magic == SRA_CT_UNCOMPRESSED ||
-            magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED);
-  }
-
-  /* decompress huffman
-   */
-  if (magic == SRA_CT_HUFFMAN)
-  {
-    _get_short (pesig,     &offset,  rbpos, &fix_seq_len, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &sim.uval,    1, (ssize << 3));
-    _get_long  (pesig, 32, &offset, &rbpos, &snm.uval,    1, (ssize << 3));
-
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-
-    posig = sra_alloc (dst, alt, osize);
-
-    pos   = 0;
-    wbpos = 0; /* write bit position */
-
-    while (pos < osize)
-    {
-      if (ssize-offset > 4) nbits = 32;
-      else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-      if (offset > (uint32_t)ssize)
-        return 1;
-
-      _get_long (pesig, nbits, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-      indx = gv_local.rlookup_slx_int [lval>>16];
-#else
-      iptr = (uint16_t*) kbsearch (&lval, gv_local.idx_slx_int,
-                                  INT_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_slx_int);
-      assert (iptr);
-      indx = *iptr;
-#endif
-
-      offset += ((rbpos+(uint32_t)gv_local.lookup_slx_int[indx].nbits) >> 3);
-      rbpos   = ((rbpos+(uint32_t)gv_local.lookup_slx_int[indx].nbits)  & 7);
-
-      if (indx < INT_MAX_POINT)
-      {
-        indx = bswap_16 ((uint16_t)(indx-INT_MID_POINT));
-        _put_short (indx, posig, &pos, wbpos);
-      }
-      else
-      {
-        uint16_t val;
-        if ((int)nbits - (int)gv_local.lookup_slx_int[indx].nbits >= 16)
-        {
-          val = (short)((lval >> (16-gv_local.lookup_slx_int[indx].nbits)) & 0xFFFF);
-          offset += 2;
-        }
-        else
-          _get_short (pesig, &offset, rbpos, &val, 1);
-
-        val = bswap_16 (val);
-        _put_short (val, posig, &pos, wbpos);
-      }
-    }
-
-    _s_undelta_4_channel (fix_seq_len, sizeof(uint16_t), posig, osize);
-
-    pesig = posig;
-    ssize = osize;
-    osize = osize << 1;
-    posig = sra_alloc (dst, alt, osize);
-
-    _s_exponent_4_channel (fix_seq_len, posig, osize, pesig, ssize, sim.fval, snm.fval);
-  }
-  else
-  if (magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED)
-  {
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-    osize *= 2;              /* desination size is 4 bytes per channel, but the original is 2 */
-
-    posig = sra_alloc (dst, alt, osize);
-
-    _s_decode_slx (magic, pesig, posig, osize, offset, rbpos, ssize);
-  }
-
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
-int sra_decompress_nse ( KDataBuffer *dst, KDataBuffer *alt, const void* src, int ssize )
-{
-  uchar_t        magic;
-  const uchar_t* pesig;
-  uchar_t*       posig;
-#if !SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-  uint16_t*      iptr;
-#endif
-  uint16_t       indx, fix_seq_len, shift;
-  uint32_t       pos, rbpos, wbpos, nbits;
-  uint32_t       offset, osize, lval;
-  union { float fval; uint32_t uval; } sim, snm; /* minimum level of signal and noise */
-
-  assert (gv_local.lookup_slx_nse_initialized);
-
-  rbpos  = 0;
-  offset = 0;
-  pesig  = src;
-
-  /* get magic and size of data
-   */
-  _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-  _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-  assert (magic == SRA_CT_ZLIB         || magic == SRA_CT_HUFFMAN ||
-          magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED ||
-          magic == SRA_CT_BASELINED);
-
-  /* decompress zlib
-   */
-  if (magic == SRA_CT_ZLIB)
-  {
-    shift = 5; /* magic + length */
-    posig = sra_alloc ( dst, alt, osize + 100 );
-
-    if (_s_decompress_zlib(posig, pesig+shift, (int)osize + 100, ssize-shift))
-      return 1;
-
-    rbpos  = 0; /* read bit position */
-    offset = 0;
-    ssize  = osize;
-    pesig  = posig;
-    _get_byte  (pesig,     &offset,  rbpos, &magic, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &osize, 1, (ssize << 3));
-
-    assert (magic == SRA_CT_HUFFMAN    || magic == SRA_CT_UNCOMPRESSED ||
-            magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED);
-  }
-
-  /* decompress huffman
-   */
-  if (magic == SRA_CT_HUFFMAN)
-  {
-    _get_short (pesig,     &offset,  rbpos, &fix_seq_len, 1);
-    _get_long  (pesig, 32, &offset, &rbpos, &sim.uval,    1, (ssize << 3));
-    _get_long  (pesig, 32, &offset, &rbpos, &snm.uval,    1, (ssize << 3));
-
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-
-    posig = sra_alloc (dst, alt, osize);
-
-    /* decompress huffman
-     */
-    pos   = 0;
-    wbpos = 0; /* write bit position */
-
-    while (pos < osize)
-    {
-      if (ssize-offset > 4) nbits = 32;
-      else                  nbits = ((ssize-offset)==4?32:((ssize-offset)==3?24:((ssize-offset)==2?16:8)))-rbpos;
-
-      if (offset > (uint32_t)ssize)
-        return 1;
-
-      _get_long (pesig, nbits, &offset, &rbpos, &lval, 0, (ssize << 3));
-
-#if SRA_DECOMPRESS_USE_REVERSE_LOOKUP
-      indx = gv_local.rlookup_slx_nse [lval>>16];
-#else
-      iptr = (uint16_t*) kbsearch (&lval, gv_local.idx_slx_nse,
-                                  NSE_HUFF_TREESIZE, sizeof(uint16_t), _s_cmp_key, gv_local.lookup_slx_nse);
-      assert (iptr);
-      indx = *iptr;
-#endif
-
-      offset += ((rbpos+(uint32_t)gv_local.lookup_slx_nse[indx].nbits) >> 3);
-      rbpos   = ((rbpos+(uint32_t)gv_local.lookup_slx_nse[indx].nbits)  & 7);
-
-      if (indx < NSE_MAX_POINT)
-      {
-        indx = bswap_16 ((uint16_t)(indx-NSE_MID_POINT));
-        _put_short (indx, posig, &pos, wbpos);
-      }
-      else
-      {
-        uint16_t val;
-        if ((int)nbits - (int)gv_local.lookup_slx_int[indx].nbits >= 16)
-        {
-          val = (short)((lval >> (16-gv_local.lookup_slx_nse[indx].nbits)) & 0xFFFF);
-          offset += 2;
-        }
-        else
-          _get_short (pesig, &offset, rbpos, &val, 1);
-
-        val = bswap_16 (val);
-        _put_short (val, posig, &pos, wbpos);
-      }
-    }
-
-    _s_undelta_4_channel (fix_seq_len, sizeof(uint16_t), posig, osize);
-
-    pesig = posig;
-    ssize = osize;
-    osize = osize << 1;
-    posig = sra_alloc (dst, alt, osize);
-
-    _s_exponent_4_channel (fix_seq_len, posig, osize, pesig, ssize, sim.fval, snm.fval);
-  }
-  else
-  if (magic == SRA_CT_UNCOMPRESSED || magic == SRA_CT_NORMALIZED || magic == SRA_CT_BASELINED)
-  {
-    assert ((osize&3) == 0); /* make shure it can be devided by 4 */
-    osize *= 2;              /* desination size is 4 bytes per channel, but the original is 2 */
-
-    posig = sra_alloc (dst, alt, osize);
-
-    _s_decode_slx (magic, pesig, posig, osize, offset, rbpos, ssize);
-  }
-
-  assert ( osize <= dst -> elem_count );
-  KDataBufferResize ( dst, osize );
-
-  return 0;
-}
-
diff --git a/libs/sraxf/v0-decompress.h b/libs/sraxf/v0-decompress.h
deleted file mode 100644
index c144ce4..0000000
--- a/libs/sraxf/v0-decompress.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _SRA_DECOMPRESS_HEADER
-#define _SRA_DECOMPRESS_HEADER
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* sra compression types
- */
-#define SRA_CT_UNCOMPRESSED      0
-#define SRA_CT_HUFFMAN           1
-#define SRA_CT_ZLIB              2
-#define SRA_CT_NCBI2NA           3
-#define SRA_CT_NORMALIZED        4
-#define SRA_CT_BASELINED         5
-#define SRA_CT_PACKED            6
-#define SRA_CT_TRUNCATED         7
-#define SRA_CT_EXP10             8
-#define SRA_CT_TRANSLATE         9
-
-
-/* forward of KDataBuffer */
-struct KDataBuffer;
-
-
-/* blob header pseudo descriptions
- *  NB - all structs are single-byte aligned
- *
-struct HDR_454_POSITION
-{
-    uint8_t type;
-    uint16_t osize; -- double compressed, 2 headers total
-};
-
-struct HDR_454_READ
-{
-    uint8_t type;
-    uint16_t osize; -- 1 byte per base, i.e. row-length
-};
-
-struct HDR_454_QUALITY
-{
-    uint8_t type;
-    uint16_t osize; -- double compressed
-};
-
-struct HDR_454_CLIP
-{
-    uint8_t type;
-    uint32_t osize; -- zlib compressed
-};
-
-struct HDR_454_SIGNAL
-{
-    uint8_t type;
-    uint16_t osize; -- double compressed
-};
-
-struct HDR_SLX_ZLIB
-{
-    uint8_t type;
-    uint32_t osize; -- double compressed
-};
-
-struct HDR_SLX_QUALITY
-{
-    uint8_t type;
-    uint32_t osize;
-    uint8_t qmin;
-    uint8_t qmax;
-    uint16_t fixed_len;
-};
-
-struct HDR_SLX_READ
-{
-    uint8_t type;
-    uint32_t osize;
-    uint16_t fixed_len;
-};
-
-struct HDR_SLX_SIG_HUFFMAN
-{
-    uint8_t type;
-    uint32_t osize;
-    uint16_t fixed_len;
-    float sim;
-    float snm;
-};
-
-struct HDR_SLX_SIG_BASELINE -- or uncompressed
-{
-    uint8_t type;
-    uint32_t osize;
-    uint16_t fixed_len;
-    uint32_t baseline;
-};
-
-struct HDR_SLX_SIG_NORMALIZED
-{
-    uint8_t type;
-    uint32_t osize;
-    uint16_t fixed_len;
-    uint16_t min;
-    float scale;
-};
-
-*/
-
-/* decompression routines:
- * return a pointer to an allocated memory buffer and the size of the buffer in bytes
- * you would need to free(*dst) after its use
- *
- * parameters:
- *   platform = 1 (454), 2 (solexa)
- *   dst    - a pointer to a buffer into which an uncompressed data is written
- *   dsize  - the size of the incompressed data
- *   src    - compressed data source
- *   ssize  - size of compressed data
- *
- * return values: 0 - OK, 1 - error
- */
-void sra_decompress_init  (void);
-
-/* SIGNAL */
-int sra_decompress_sig_454(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-int sra_decompress_sig_slx(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-/* INTENSITY */
-int sra_decompress_int(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-/* NOISE */
-int sra_decompress_nse(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-/* QUALITY */
-int sra_decompress_prb_454(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-int sra_decompress_prb_slx(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-/* POSITION */
-int sra_decompress_pos(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-/* CLIP_QUALITY_ */
-int sra_decompress_clp(struct KDataBuffer *dst, struct KDataBuffer *alt, const void* src, int ssize);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libs/sraxf/v0-funcs.c b/libs/sraxf/v0-funcs.c
deleted file mode 100644
index 61b4a5b..0000000
--- a/libs/sraxf/v0-funcs.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <limits.h>
-
-#include <endian.h>
-#include <byteswap.h>
-
-#ifdef HTONL
-#undef HTONL
-#endif
-
-#ifdef HTONS
-#undef HTONS
-#endif
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define HTONL( x ) bswap_32 ( x )
-#define HTONS( x ) bswap_16 ( x )
-#else
-#define HTONL( x ) ( x )
-#define HTONS( x ) ( x )
-#endif
-
-#include "v0-decompress.h"
-
-static
-rc_t CC sra_read_decompress_454 ( void *self, const VXformInfo *info,
-    VLegacyBlobResult *rslt, const KDataBuffer *src )
-{
-    rc_t rc;
-    KDataBuffer *dst = rslt -> dst;
-    const uint8_t *p = src -> base;
-
-    uint32_t num_bases = HTONS ( * ( const uint16_t* ) & p [ 1 ] );
-    uint32_t hdr_size = 3;
-
-    /* make sub-buffer from input */
-    KDataBuffer tmp;
-    rc = KDataBufferCast ( src, & tmp, 8, false );
-    if ( rc == 0 )
-    {
-        KDataBufferWhack ( dst );
-        rc = KDataBufferSub ( & tmp, dst, hdr_size, UINT64_MAX );
-        if ( rc == 0 )
-        {
-            /* cast to 2na */
-            rc = KDataBufferCast ( dst, dst, 2, true );
-            if ( rc == 0 )
-            {
-                /* resize to actual number of bases */
-                assert ( num_bases <= dst -> elem_count );
-                rc = KDataBufferResize ( dst, num_bases );
-            }
-        }
-
-        KDataBufferWhack ( & tmp );
-    }
-
-    return rc;
-}
-
-static
-rc_t CC sra_read_decompress_slx ( void *self, const VXformInfo *info,
-    VLegacyBlobResult *rslt, const KDataBuffer *src )
-{
-    rc_t rc;
-    KDataBuffer tmp;
-    uint32_t hdr_size;
-    KDataBuffer *dst = rslt -> dst;
-    const uint8_t *p = src -> base;
-
-    uint32_t num_bases = HTONL ( * ( const uint32_t* ) & p [ 1 ] );
-    uint32_t row_len = HTONS ( * ( const uint16_t* ) & p [ 5 ] );
-    assert ( row_len != 0 );
-    assert ( num_bases % row_len == 0 );
-    hdr_size = 7;
-
-    /* make sub-buffer from input */
-    rc = KDataBufferCast ( src, & tmp, 8, false );
-    if ( rc == 0 )
-    {
-        KDataBufferWhack ( dst );
-        rc = KDataBufferSub ( & tmp, dst, hdr_size, UINT64_MAX );
-        if ( rc == 0 )
-        {
-            /* cast to 2na */
-            rc = KDataBufferCast ( dst, dst, 2, true );
-            if ( rc == 0 )
-            {
-                /* resize to actual number of bases */
-                assert ( num_bases <= dst -> elem_count );
-                rc = KDataBufferResize ( dst, num_bases );
-            }
-        }
-
-        KDataBufferWhack ( & tmp );
-    }
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_READ, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VNoHdrBlobFunc f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    switch ( cp -> argv [ 0 ] . data . u8 [ 0 ] )
-    {
-    case SRA_PLATFORM_454:
-        f = sra_read_decompress_454;
-        break;
-    case SRA_PLATFORM_ILLUMINA:
-        f = sra_read_decompress_slx;
-        break;
-    default:
-        return RC ( rcSRA, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    /* DO NOT CHANGE ASSIGNMENT FROM "f"
-       we want the compiler to catch type mismatches */
-    rslt -> u . bf = ( VBlobFunc ) f;
-
-    return 0;
-}
-
-/* all of the functions have this prototype */
-typedef int ( * legacy_decompress_func ) ( KDataBuffer*, KDataBuffer*, const void*, int );
-
-/* function ids */
-enum
-{
-    sra_prb_454,
-    sra_prb_slx,
-    sra_sig_454,
-    sra_sig_slx,
-    sra_int,
-    sra_nse,
-    sra_clip,
-    sra_pos
-};
-
-static
-legacy_decompress_func funcs [] =
-{
-    sra_decompress_prb_454,
-    sra_decompress_prb_slx,
-    sra_decompress_sig_454,
-    sra_decompress_sig_slx,
-    sra_decompress_int,
-    sra_decompress_nse,
-    sra_decompress_clp,
-    sra_decompress_pos
-};
-
-static
-rc_t CC sra_legacy_decompress ( void *self, const VXformInfo *info,
-    VLegacyBlobResult *rslt, const KDataBuffer *src )
-{
-    int failed;
-    KDataBuffer *dst = rslt -> dst;
-
-    /* an initially empty buffer */
-    KDataBuffer alt;
-    KDataBufferMakeBytes ( & alt, 0 );
-
-    assert(KDataBufferBytes ( src ) < INT_MAX);
-    /* invoke the decompression function */
-    failed = funcs [ ( size_t ) self ] ( dst, & alt, src -> base, (int)KDataBufferBytes ( src ) );
-
-    /* whack any double buffer */
-    KDataBufferWhack ( & alt );
-
-    /* return non-descript status */
-    if ( failed )
-        return RC ( rcSRA, rcBlob, rcUnpacking, rcNoObj, rcUnknown );
-    return 0;
-}
-
-static
-rc_t sra_legacy_init ( void )
-{
-    static bool done;
-    if ( ! done )
-    {
-        sra_decompress_init ();
-        done = true;
-    }
-
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_QUALITY, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    switch ( cp -> argv [ 0 ] . data . u8 [ 0 ] )
-    {
-    case SRA_PLATFORM_454:
-        rslt -> self = ( void* ) sra_prb_454;
-        break;
-    case SRA_PLATFORM_ILLUMINA:
-        rslt -> self = ( void* ) sra_prb_slx;
-        break;
-    default:
-        return RC ( rcSRA, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    return sra_legacy_init ();
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_SIGNAL, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    switch ( cp -> argv [ 0 ] . data . u8 [ 0 ] )
-    {
-    case SRA_PLATFORM_454:
-        rslt -> self = ( void* ) sra_sig_454;
-        break;
-    case SRA_PLATFORM_ILLUMINA:
-        rslt -> self = ( void* ) sra_sig_slx;
-        break;
-    default:
-        return RC ( rcSRA, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    return sra_legacy_init ();
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_INTENSITY, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    rslt -> self = ( void* ) sra_int;
-
-    return sra_legacy_init ();
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_NOISE, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    rslt -> self = ( void* ) sra_nse;
-
-    return sra_legacy_init ();
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_CLIP, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    rslt -> self = ( void* ) sra_clip;
-
-    return sra_legacy_init ();
-}
-
-VTRANSFACT_IMPL ( NCBI_SRA_decode_POSITION, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* DO NOT REMOVE THIS ASSIGNMENT
-       we want the compiler to catch type mismatches */
-    VNoHdrBlobFunc f = sra_legacy_decompress;
-    rslt -> u . bf = ( VBlobFunc ) f;
-    rslt -> variant = vftLegacyBlob;
-
-    /* the discriminator */
-    rslt -> self = ( void* ) sra_pos;
-
-    return sra_legacy_init ();
-}
diff --git a/libs/sraxf/varloc.c b/libs/sraxf/varloc.c
deleted file mode 100644
index 2698110..0000000
--- a/libs/sraxf/varloc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <insdc/insdc.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-/****************************** tokenize_var_id *******************************/
-/* typedef uint16_t text_token [ 3 ]; */
-
-static
-rc_t CC tokenize_var_id ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    int pos = 0;
-    unsigned const var_id_len = argv[0].u.data.elem_count;
-    struct
-    {
-        uint16_t token_type;
-        uint16_t position;
-        uint16_t length;
-    } *dst;
-    const char *var_id	= argv[0].u.data.base;
-    var_id += argv[0].u.data.first_elem;
-    
-    rslt->data->elem_bits = sizeof(dst[0]) * 8;
-    rc = KDataBufferResize( rslt -> data, 2 );
-    if ( rc != 0 ) return rc;
-    rslt -> elem_count = 2;
-    dst = rslt -> data -> base;
-    memset(dst, 0, 2 * sizeof *dst);
- 
-    /* ([A-Za-z]*)(\d*) */
-    if (var_id_len > 0) {
-        for (pos = var_id_len - 1; pos >= 0; --pos) {
-            if (var_id[pos] < '0' || var_id[pos] > '9') {
-                ++pos;
-                break;
-            }
-            if (pos == 0) { /* all numbers */
-                break;
-            }
-        }
-    }
-    dst [ 1 ] . position = pos;
-    dst [ 1 ] . length = var_id_len - pos;
-    dst [ 0 ] . length = var_id_len - dst [ 1 ] . length;
-
-    return rc;
-}
-
-/* 
- * tokenize_var_id
- *   splits into 2 tokens
- *   0 - prefix
- *   1 - suffix
- *
- * extern function
- * text:token NCBI:var:tokenize_var_id #1 ( ascii var_id );
- */
-VTRANSFACT_IMPL ( NCBI_var_tokenize_var_id, 1, 0, 0 ) ( const void *Self,
-    const VXfactInfo *info, VFuncDesc *rslt,
-    const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->u.rf = tokenize_var_id;
-    rslt->variant = vftRow;
-    return 0;
-}
diff --git a/libs/vdb/Makefile b/libs/vdb/Makefile
deleted file mode 100644
index e0ea319..0000000
--- a/libs/vdb/Makefile
+++ /dev/null
@@ -1,180 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/vdb
-
-INT_LIBS = \
-	libvdb \
-	libwvdb
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/all $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# virtual db library
-#
-$(ILIBDIR)/libvdb: $(addprefix $(ILIBDIR)/libvdb.,$(ILIBEXT))
-
-VDBCMN_SRC = \
-	dbmgr-cmn \
-	schema-tok \
-	schema-parse \
-	schema-type \
-	schema-func \
-	schema-prod \
-	schema-expr \
-	schema-eval \
-	schema-tbl \
-	schema-db \
-	schema-dump \
-	schema-int \
-	schema \
-	linker-int \
-	linker-cmn \
-	database-cmn \
-	database-depend \
-	database-load \
-	table-cmn \
-	table-load \
-	cursor-cmn \
-	column-cmn \
-	prod-cmn \
-	prod-expr \
-	prod-func \
-	phys-cmn \
-	phys-load \
-	blob \
-	blob-headers \
-	page-map \
-	row-id \
-	row-len \
-	fixed-row-len \
-	merge \
-	split \
-	compare \
-	meta-read \
-	meta-value \
-	meta-attr-read \
-	cast \
-	range-validate \
-	parameter-read \
-	redimension \
-	index_project \
-	index_lookup \
-	transpose \
-	delta_average \
-	report-vdb
-
-VDB_SRC = \
-	$(VDBCMN_SRC) \
-	dbmgr \
-	linker \
-	database \
-	table \
-	cursor \
-	column \
-	prod \
-	phys
-
-VDB_OBJ = \
-	$(addsuffix .$(LOBX),$(VDB_SRC))
-
-VDB_LIB = \
-	-dkdb \
-	-dvfs \
-	-dkfg \
-	-dkfs \
-	-dkproc \
-	-dklib \
-	-dz
-
-$(ILIBDIR)/libvdb.$(LIBX): $(VDB_OBJ)
-	$(LD) --slib -o $@ $^ $(VDB_LIB)
-
-#-------------------------------------------------------------------------------
-# update version
-#
-$(ILIBDIR)/libwvdb: $(addprefix $(ILIBDIR)/libwvdb.,$(ILIBEXT))
-
-WVDB_SRC = \
-	$(VDBCMN_SRC) \
-	wdbmgr \
-	wlinker \
-	wdatabase \
-	wtable \
-	wcursor \
-	wcolumn \
-	wprod \
-	wphys \
-	meta-write \
-	meta-attr-write \
-	meta-append \
-	index_insert
-
-WVDB_OBJ = \
-	$(addsuffix .$(LOBX),$(WVDB_SRC))
-
-WVDB_LIB = \
-	-dwkdb \
-	-dvfs \
-	-dkfg \
-	-dkfs \
-	-dkproc \
-	-dklib \
-	-dz
-
-$(ILIBDIR)/libwvdb.$(LIBX): $(WVDB_OBJ)
-	$(LD) --slib -o $@ $^ $(WVDB_LIB)
diff --git a/libs/vdb/blob-headers.c b/libs/vdb/blob-headers.c
deleted file mode 100644
index da2db3e..0000000
--- a/libs/vdb/blob-headers.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-#include <klib/rc.h>
-#include <klib/vlen-encode.h>
-#include <klib/data-buffer.h>
-#include "blob-headers.h"
-#include <vdb/xform.h>
-#include <atomic32.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
-#include <assert.h>
-
-struct VBlobHeaderData {
-    int64_t *args;
-    uint8_t *ops;
-    atomic32_t refcount;
-    uint32_t op_count;
-    uint32_t arg_count;
-    uint64_t osize;
-    uint8_t flags;
-    uint8_t version;
-    uint32_t fmt;
-    bool read_only;
-    bool args_alloc;
-    bool ops_alloc;
-};
-
-struct VBlobHeaderVT {
-    void ( * destroy )( struct VBlobHeader * );
-};
-
-struct VBlobHeader {
-    const struct VBlobHeaderVT *vt;
-    const struct BlobHeaders *parent;
-    const struct VBlobHeaderData *owned;
-    atomic32_t refcount;
-    int32_t op_head;
-    int32_t op_tail;
-    int32_t op_cap;
-    int32_t arg_head;
-    int32_t arg_tail;
-    int32_t arg_cap;
-};
-
-struct BlobHeaders {
-    struct VBlobHeaderData *data;
-    const BlobHeaders *link;
-    atomic32_t refcount;
-};
-
-struct BlobHeaderDummy {
-    struct VBlobHeader hdr;
-    struct BlobHeaders dummy;
-    struct VBlobHeaderData data;
-};
-
-static void VBlobHeaderDestroy( struct VBlobHeader * );
-static void VBlobHeaderDummyDestroy( struct VBlobHeader * );
-static const struct VBlobHeaderVT VBlobHeader_vt[] = { { VBlobHeaderDestroy }, { VBlobHeaderDummyDestroy } };
-
-static void VBlobHeaderDataWhack( struct VBlobHeaderData *that )
-{
-    if (that)
-    {
-        if (that->args_alloc)
-            free(that->args);
-        if (that->ops_alloc)
-            free(that->ops);
-        free(that);
-    }
-}
-
-static rc_t VBlobHeaderDataDestroy( struct VBlobHeaderData *that ) {
-    VBlobHeaderDataWhack(that);
-    return 0;
-}
-
-static rc_t VBlobHeaderDataRelease( const struct VBlobHeaderData *self ) {
-    if (self && atomic32_dec_and_test(&(((struct VBlobHeaderData *)self)->refcount)))
-        return VBlobHeaderDataDestroy((struct VBlobHeaderData *)self);
-    return 0;
-}
-
-#if 0
-static rc_t VBlobHeaderDataAddRef ( const struct VBlobHeaderData *self ) {
-    if (self)
-        atomic32_inc(&(((struct VBlobHeaderData *)self)->refcount));
-    return 0;
-}
-#endif
-
-static int VBlobHeaderDataGetExclusiveOwnership( struct VBlobHeaderData *self ) {
-    if (atomic32_read_and_add(&self->refcount, 1) == 1)
-        return 1;
-    return 0;    
-}
-
-static void BlobHeadersWhack( BlobHeaders *that ) {
-    free( that );
-}
-
-static rc_t BlobHeadersDestroy( BlobHeaders *that ) {
-    const BlobHeaders *link = that->link;
-    
-    VBlobHeaderDataRelease(that->data);
-    BlobHeadersWhack(that);
-    BlobHeadersRelease(link);
-    return 0;
-}
-
-rc_t BlobHeadersAddRef ( const BlobHeaders *self ) {
-    if (self)
-        atomic32_inc(&(((BlobHeaders *)self)->refcount));
-    return 0;
-}
-
-rc_t BlobHeadersRelease ( const BlobHeaders *self ) {
-    if (self && atomic32_dec_and_test(&(((BlobHeaders *)self)->refcount)))
-        return BlobHeadersDestroy((BlobHeaders *)self);
-    return 0;
-}
-
-#if 0
-static int BlobHeadersGetExclusiveOwnership( BlobHeaders *self ) {
-    if (atomic32_read_and_add(&self->refcount, 1) == 1)
-        return 1;
-    return 0;    
-}
-#endif
-
-static rc_t BlobHeadersCreateInternal ( BlobHeaders **lhs, unsigned ops, unsigned args ) {
-    BlobHeaders *y = calloc(1, sizeof *y);
-
-    *lhs = NULL;
-    if (y) {
-        atomic32_set(&y->refcount, 1);
-        y->data = calloc(1, sizeof(*y->data) + args * sizeof(y->data->args[0]) + ops);
-        if (y->data) {
-            atomic32_set(&y->data->refcount, 1);
-            if (args) {
-                y->data->args = (void *)(&y->data[1]);
-                if (ops) {
-                    y->data->ops = (void *)(&y->data->args[args]);
-                    y->data->op_count = ops;
-                }
-                y->data->arg_count = args;
-            }
-            else if (ops) {
-                y->data->ops = (void *)(&y->data[1]);
-                y->data->op_count = ops;
-            }
-            *lhs = y;
-            
-            return 0;
-        }
-        free(y);
-    }
-    return RC(rcVDB, rcHeader, rcConstructing, rcMemory, rcExhausted);
-}
-
-rc_t BlobHeadersCreate( BlobHeaders **lhs )
-{
-    return BlobHeadersCreateInternal( lhs, 0, 0 );
-}
-
-uint32_t BlobHeadersGetMaxBufferSize ( const BlobHeaders *self )
-{
-    uint32_t y = 1;
-    const BlobHeaders *x = self;
-    const uint32_t per_header = 25;
-    
-    while (x) {
-        y += per_header + x->data ? (x->data->op_count + x->data->arg_count * 10) : 0;
-        x = x->link;
-    }
-    return y;
-}
-
-static rc_t deserialize_v0(BlobHeaders **dst, const uint8_t *src, uint64_t ssize);
-
-rc_t BlobHeadersCreateFromData ( BlobHeaders **lhs, const uint8_t *src, uint64_t ssize )
-{
-    rc_t rc;
-    BlobHeaders *y;
-    
-    if (src == NULL)
-        return RC(rcVDB, rcHeader, rcConstructing, rcParam, rcNull);
-    if (ssize < 1)
-        return RC(rcVDB, rcHeader, rcConstructing, rcData, rcInsufficient);
-    
-    switch (*src) {
-    case 0:
-        rc = deserialize_v0(&y, src + 1, ssize - 1);
-        if (rc == 0)
-            *lhs = y;
-        break;
-    default:
-        rc = RC(rcVDB, rcHeader, rcConstructing, rcData, rcBadVersion);
-        break;
-    }
-    return rc;
-}
-
-static rc_t serialize1( const BlobHeaders *self, KDataBuffer *buffer, uint64_t offset, uint64_t *size ) {
-    uint8_t flags = 0;
-    uint8_t version = 0;
-    uint32_t fmt = 0;
-    uint64_t osize = 0;
-    uint32_t op_count = 0;
-    uint32_t arg_count = 0;
-    rc_t rc;
-    uint64_t sz;
-    uint8_t *dst;
-    uint64_t dsize;
-
-    if (self->data) {
-        version = self->data->version;
-        flags = self->data->flags;
-        fmt = self->data->fmt;
-        osize = self->data->osize;
-        op_count = self->data->op_count;
-        arg_count = self->data->arg_count;
-    }
-    sz = 2 + 4 * 5 + op_count + arg_count * 10;
-    rc = KDataBufferResize(buffer, sz + offset);
-    if (rc)
-        return rc;
-
-    dst = buffer->base;
-    dst += offset;
-    dsize = buffer->elem_count - offset;
-    
-    *dst++ = flags; --dsize;
-    *dst++ = version; --dsize;
-    
-    rc = vlen_encode1(dst, dsize, &sz, fmt);
-    if (rc)
-        return rc;
-    dst += sz; dsize -= sz;
-    
-    rc = vlen_encode1(dst, dsize, &sz, osize);
-    if (rc)
-        return rc;
-    dst += sz; dsize -= sz;
-    
-    rc = vlen_encode1(dst, dsize, &sz, op_count);
-    if (rc)
-        return rc;
-    dst += sz; dsize -= sz;
-    
-    rc = vlen_encode1(dst, dsize, &sz, arg_count);
-    if (rc)
-        return rc;
-    dst += sz; dsize -= sz;
-    
-    if (op_count > 0) {
-        memcpy(dst, self->data->ops, op_count);
-        dst += op_count;
-        dsize -= op_count;
-    }
-    if (arg_count > 0) {
-        rc = vlen_encode(dst, dsize, &sz, self->data->args, arg_count);
-        if (rc)
-            return rc;
-        dst += sz; /* dsize -= sz */;
-    }
-    *size = (uint64_t)( dst - (uint8_t *)buffer->base );
-    return 0;
-}
-
-static rc_t deserialize_v0( BlobHeaders **dst, const uint8_t *src, uint64_t ssize ) {
-    uint8_t flags;
-    uint8_t version;
-    uint32_t fmt;
-    uint64_t osize;
-    uint32_t op_count;
-    uint32_t arg_count;
-    int64_t x;
-    uint64_t sz;
-    rc_t rc;
-    BlobHeaders *y;
-
-    *dst = NULL;
-    
-    if (ssize < 2)
-        return RC(rcVDB, rcHeader, rcConstructing, rcData, rcInsufficient);
-
-    flags = *src++; --ssize;
-    version = *src++; --ssize;
-    
-    rc = vlen_decode1(&x, src, ssize, &sz);
-    if (rc)
-        return ResetRCContext(rc, rcVDB, rcHeader, rcConstructing);
-    src += sz; 
-	ssize -= sz;
-    fmt = (uint32_t)x;
-    
-    rc = vlen_decode1(&x, src, ssize, &sz);
-    if (rc)
-        return ResetRCContext(rc, rcVDB, rcHeader, rcConstructing);
-    src += sz; 
-	ssize -= sz;
-    osize = (uint32_t)x;
-    
-    rc = vlen_decode1(&x, src, ssize, &sz);
-    if (rc)
-        return ResetRCContext(rc, rcVDB, rcHeader, rcConstructing);
-    src += sz; 
-	ssize -= sz;
-    op_count = (uint32_t)x;
-    
-    rc = vlen_decode1(&x, src, ssize, &sz);
-    if (rc)
-        return ResetRCContext(rc, rcVDB, rcHeader, rcConstructing);
-    src += sz; 
-	ssize -= sz;
-    arg_count = (uint32_t)x;
-
-    rc = BlobHeadersCreateInternal(&y, op_count, arg_count);
-    if (rc)
-        return rc;
-    
-    y->data->flags = flags;
-    y->data->version = version;
-    y->data->fmt = fmt;
-    y->data->osize = osize;
-    y->data->read_only = true;
-
-    if (op_count > 0) {
-        if (ssize < op_count) {
-            BlobHeadersRelease(y);
-            return RC(rcVDB, rcHeader, rcConstructing, rcData, rcInsufficient);
-        }
-        memcpy(y->data->ops, src, op_count);
-        src += op_count; ssize -= op_count;
-    }        
-    if (arg_count > 0) {
-        rc = vlen_decode(y->data->args, arg_count, src, ssize, &sz);
-        if (rc) {
-            BlobHeadersRelease(y);
-            return ResetRCContext(rc, rcVDB, rcHeader, rcConstructing);
-        }
-        src += sz; ssize -= sz;
-    }
-    if (ssize) {
-        BlobHeaders *link;
-        
-        rc = deserialize_v0(&link, src, ssize);
-        if (rc) {
-            BlobHeadersRelease(y);
-            return rc;
-        }
-        y->link = link;
-    }
-    *dst = y;
-    return 0;
-}
-
-static rc_t serialize( const BlobHeaders *self, KDataBuffer *buffer, uint64_t offset, uint64_t *sz ) {
-    rc_t rc;
-
-    rc = serialize1(self, buffer, offset, sz);
-    if (rc == 0 && self->link)
-        rc = serialize(self->link, buffer, *sz, sz);
-    return rc;
-}
-
-rc_t BlobHeadersSerialize ( BlobHeaders *self, KDataBuffer *buffer,
-        uint64_t offset, uint64_t *psz )
-{
-    rc_t rc;
-    uint64_t sz = 0;
-    
-    assert(buffer->elem_bits == 8);
-    assert(buffer->bit_offset == 0);
-    
-    rc = KDataBufferResize(buffer, 1);
-    if (rc)
-        return rc;
-    ((uint8_t *)(buffer->base))[offset] = 0;
-    rc = serialize(self, buffer, offset + 1, &sz);
-    *psz = sz - offset;
-    return rc;
-}
-
-rc_t BlobHeadersCreateChild ( BlobHeaders *self, BlobHeaders **new_hdr ) 
-{
-    BlobHeaders *y;
-    rc_t rc;
-
-    *new_hdr = NULL;
-    rc = BlobHeadersCreate(&y);
-    if (rc == 0) {
-        y->link = self;
-        BlobHeadersAddRef(y->link);
-        *new_hdr = y;
-        return 0;
-    }
-    return rc;
-}
-
-VBlobHeader *BlobHeadersCreateDummyHeader ( uint8_t version, uint32_t fmt, uint8_t flags, uint64_t size )
-{
-    struct BlobHeaderDummy *y;
-    
-    y = calloc(1, sizeof(*y));
-    if (y) {
-        y->data.fmt = fmt;
-        y->data.version = version;
-        y->data.osize = size;
-        y->data.flags = flags;
-        atomic32_set(&y->data.refcount, 1);
-
-        y->dummy.data = &y->data;
-        atomic32_set(&y->dummy.refcount, 1);
-        
-        y->hdr.vt = &VBlobHeader_vt[1];
-        y->hdr.parent = &y->dummy;
-        atomic32_set(&y->hdr.refcount, 1);
-        
-        return &y->hdr;
-    }
-    return 0;
-}
-
-const BlobHeaders *BlobHeadersGetNextFrame( const BlobHeaders *cself ) {
-    return cself ? cself->link : 0;
-}
-
-const BlobHeaders *BlobHeadersPop( const BlobHeaders *cself ) {
-    const BlobHeaders *y = BlobHeadersGetNextFrame(cself);
-    BlobHeadersAddRef(y);
-    BlobHeadersRelease(cself);
-    return y;
-}
-
-VBlobHeader *BlobHeadersGetHeader ( const BlobHeaders *self )
-{
-    VBlobHeader *y = calloc(1, sizeof(*y));
-    
-    if (y) {
-        y->vt = &VBlobHeader_vt[0];
-        atomic32_set(&y->refcount, 1);
-        y->parent = self;
-        BlobHeadersAddRef(y->parent);
-        if (self->data) {
-            y->op_tail = self->data->op_count;
-            y->arg_tail = self->data->arg_count;
-        }
-    }
-    return y;
-}
-
-VBlobHeader *BlobHeadersGetHdrWrite ( BlobHeaders *self ) {
-    VBlobHeader *y = BlobHeadersGetHeader(self);
-    
-    if (y) {
-        if (self->data && !self->data->read_only) {
-            if (VBlobHeaderDataGetExclusiveOwnership(self->data)) {
-                y->owned = self->data;
-                return y;
-            }
-        }
-        VBlobHeaderRelease(y);
-    }
-    return NULL;
-}
-
-static void VBlobHeaderDummyDestroy( VBlobHeader *that ) {
-    free(that);
-}
-
-static void VBlobHeaderDestroy( VBlobHeader *that ) {
-    VBlobHeaderDataRelease(that->owned);
-    BlobHeadersRelease(that->parent);
-    free(that);
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderRelease ( const VBlobHeader *cself ) {
-    VBlobHeader *self = (VBlobHeader *)cself;
-    
-    if (self && atomic32_dec_and_test(&self->refcount))
-        self->vt->destroy(self);
-    return 0;
-}
-
-rc_t VBlobHeaderAddRef ( const VBlobHeader *self ) {
-    if (self)
-        atomic32_inc(&(((VBlobHeader *)self)->refcount));
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderCreateFork ( const VBlobHeader *self, VBlobHeader **rslt ) {
-    if (self == NULL)
-        return RC(rcVDB, rcHeader, rcCopying, rcSelf, rcNull);
-    
-    if (self->parent == NULL)
-        return RC(rcVDB, rcHeader, rcCopying, rcSelf, rcInvalid);
-    
-    if (rslt == NULL)
-        return RC(rcVDB, rcHeader, rcCopying, rcParam, rcNull);
-    
-    *rslt = BlobHeadersCreateDummyHeader(self->parent->data->version, self->parent->data->fmt, 0, self->parent->data->osize);
-    if (*rslt)
-        return 0;
-    return RC(rcVDB, rcHeader, rcCopying, rcMemory, rcInsufficient);
-}
-
-rc_t VBlobHeaderReplace( VBlobHeader *targ, const VBlobHeader *src ) {
-    BlobHeaders *parent;
-    struct VBlobHeaderData *data;
-    atomic32_t temp;
-    
-    if (src == NULL || targ == NULL)
-        return RC(rcVDB, rcHeader, rcCopying, rcParam, rcNull);
-
-    if (src->vt != &VBlobHeader_vt[1] || targ->vt != &VBlobHeader_vt[0])
-        return RC(rcVDB, rcHeader, rcCopying, rcParam, rcInvalid);
-    
-    if (atomic32_read(&targ->refcount) != 1)
-        return RC(rcVDB, rcHeader, rcCopying, rcParam, rcInvalid);
-    
-    data = calloc(1, sizeof(*data));
-    if (data == NULL)
-        return RC(rcVDB, rcHeader, rcCopying, rcMemory, rcExhausted);
-
-    *data = *src->parent->data;
-    atomic32_set(&data->refcount, 1);
-    
-    parent = (BlobHeaders *)targ->parent;
-    VBlobHeaderDataRelease(parent->data);
-    parent->data = data;
-    
-    atomic32_set(&temp, atomic32_read(&src->refcount));
-    *targ = *src;
-    atomic32_set(&targ->refcount, atomic32_read(&temp));
-    targ->parent = parent;
-    targ->vt = &VBlobHeader_vt[0];
-    
-    return 0;
-}
-
-rc_t VBlobHeaderOpPushHead ( VBlobHeader *self, uint8_t op )
-{
-    return RC(rcVDB, rcHeader, rcWriting, rcInterface, rcUnsupported);
-}
-
-rc_t VBlobHeaderArgPushHead ( VBlobHeader *self, int64_t arg )
-{
-    return RC(rcVDB, rcHeader, rcWriting, rcInterface, rcUnsupported);
-}
-
-#define MIN_ALLOC 16
-
-LIB_EXPORT rc_t CC VBlobHeaderOpPushTail ( VBlobHeader *self, uint8_t op )
-{
-    struct VBlobHeaderData *data;
-    
-    assert(self);
-    assert(self->parent);
-    data = self->parent->data;
-    assert(data);
-    assert(!data->read_only);
-    
-    if (data->ops == NULL) {
-        data->ops = malloc(MIN_ALLOC);
-        if (data->ops == NULL)
-            return RC(rcVDB, rcHeader, rcWriting, rcMemory, rcExhausted);
-        self->op_cap = MIN_ALLOC;
-    }
-    
-    assert(self->op_tail <= self->op_cap);
-    
-    if (self->op_tail == self->op_cap) {
-        uint32_t size = self->op_cap;
-        void *temp = realloc(data->ops, size += size);
-        
-        if (temp == NULL)
-            return RC(rcVDB, rcHeader, rcWriting, rcMemory, rcExhausted);
-        data->ops = temp;
-        self->op_cap = size;
-    }
-    data->ops[self->op_tail++] = op;
-    ++data->op_count;
-    data->ops_alloc = true;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderArgPushTail ( VBlobHeader *self, int64_t arg )
-{
-    struct VBlobHeaderData *data;
-    
-    assert(self);
-    assert(self->parent);
-    data = self->parent->data;
-    assert(data);
-    assert(!data->read_only);
-    
-    if (data->args == NULL) {
-        data->args = malloc(MIN_ALLOC * sizeof(data->args[0]));
-        if (data->args == NULL)
-            return RC(rcVDB, rcHeader, rcWriting, rcMemory, rcExhausted);
-        self->arg_cap = MIN_ALLOC;
-    }
-    
-    assert(self->arg_tail <= self->arg_cap);
-    
-    if (self->arg_tail == self->arg_cap) {
-        uint32_t size = self->arg_cap;
-        void *temp = realloc(data->args, (size += size) * sizeof(data->args[0]));
-        
-        if (temp == NULL)
-            return RC(rcVDB, rcHeader, rcWriting, rcMemory, rcExhausted);
-        data->args = temp;
-        self->arg_cap = size;
-    }
-    data->args[self->arg_tail++] = arg;
-    ++data->arg_count;
-    data->args_alloc = true;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderOpPopHead ( const VBlobHeader *self, uint8_t *op )
-{
-    if (self->op_head >= self->op_tail || self->op_head >= (int32_t)self->parent->data->op_count)
-        return RC(rcVDB, rcHeader, rcReading, rcData, rcExhausted);
-    *op = self->parent->data->ops[self->op_head];
-    ++((VBlobHeader *)self)->op_head;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderOpPopTail ( const VBlobHeader *self, uint8_t *op )
-{
-    if (self->op_tail < self->op_head || self->op_tail < 0)
-        return RC(rcVDB, rcHeader, rcReading, rcData, rcExhausted);
-    *op = self->parent->data->ops[self->op_tail];
-    --((VBlobHeader *)self)->op_tail;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderArgPopHead ( const VBlobHeader *self, int64_t *arg )
-{
-    if (self->arg_head >= self->arg_tail || self->arg_head >= (int32_t)self->parent->data->arg_count || self->parent->data->args == NULL)
-        return RC(rcVDB, rcHeader, rcReading, rcData, rcExhausted);
-    *arg = self->parent->data->args[self->arg_head];
-    ++((VBlobHeader *)self)->arg_head;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobHeaderArgPopTail ( const VBlobHeader *self, int64_t *arg )
-{
-    if (self->arg_tail < self->arg_head || self->arg_tail < 0 || self->parent->data->args == NULL)
-        return RC(rcVDB, rcHeader, rcReading, rcData, rcExhausted);
-    *(uint64_t *)arg = self->parent->data->args[self->arg_tail];
-    --((VBlobHeader *)self)->arg_tail;
-    return 0;
-}
-
-LIB_EXPORT uint8_t CC VBlobHeaderVersion ( const VBlobHeader *self )
-{
-    return self->parent->data->version;
-}
-
-LIB_EXPORT void CC VBlobHeaderSetVersion ( VBlobHeader *self, uint8_t version )
-{
-    self->parent->data->version = version;
-}
-
-uint8_t VBlobHeaderFlags ( const VBlobHeader *self )
-{
-    return self->parent->data->flags & 0x7F;
-}
-
-void VBlobHeaderSetFlags ( VBlobHeader *self, uint8_t flags )
-{
-    self->parent->data->flags = (self->parent->data->flags & 0x80) | (flags & 0x7F);
-}
-
-uint32_t VBlobHeaderFormat ( const VBlobHeader *self )
-{
-    return self->parent->data->fmt;
-}
-
-void VBlobHeaderSetFormat ( VBlobHeader *self, uint32_t fmt )
-{
-    self->parent->data->fmt = fmt;
-}
-
-uint64_t VBlobHeaderSourceSize ( const VBlobHeader *self )
-{
-    return self->parent->data->osize;
-}
-
-void VBlobHeaderSetSourceSize ( VBlobHeader *self, uint64_t ssize )
-{
-    self->parent->data->osize = ssize;
-}
diff --git a/libs/vdb/blob-headers.h b/libs/vdb/blob-headers.h
deleted file mode 100644
index 110bb4a..0000000
--- a/libs/vdb/blob-headers.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-struct KDataBuffer;
-typedef struct BlobHeaders BlobHeaders;
-
-/* add ref and release */
-rc_t BlobHeadersAddRef( const BlobHeaders *self );
-rc_t BlobHeadersRelease( const BlobHeaders *self );
-
-/* constructors */
-
-/* create a new header stack */
-rc_t BlobHeadersCreate( BlobHeaders **lhs );
-
-/* add a new header frame to the stack */
-rc_t BlobHeadersCreateChild( BlobHeaders *self, BlobHeaders **child );
-
-/* create header stack from serialization */
-rc_t BlobHeadersCreateFromData( BlobHeaders **lhs, const uint8_t *src, uint64_t ssize );
-
-/* move down the header stack
- * you will need to AddRef the result pointer
- * before releasing the argument pointer
- */
-const BlobHeaders *BlobHeadersGetNextFrame( const BlobHeaders *cself );
-
-/* this is a convenience function to
- * pop the current frame off the stack
- * returns the new current frame
- *  get next frame
- *  addref next frame
- *  release current frame
- *  return next frame
- *
- * The idea is to do
- *  headers = BlobHeadersPop(headers);
- */
-const BlobHeaders *BlobHeadersPop( const BlobHeaders *cself );
-
-/* a worst-case estimate of how many bytes
- * the serialization will take
- */
-uint32_t BlobHeadersGetMaxBufferSize( const BlobHeaders *self );
-
-/* serialize the whole stack
- *
- * Params:
- *  self: (in) top of the stack
- *  buffer: (in/out) the data buffer to write into
- *  offset: (in) number of bytes into buffer to start writing at
- */
-rc_t BlobHeadersSerialize( BlobHeaders *self, struct KDataBuffer *buffer, uint64_t offset, uint64_t *sz );
-
-/* get the header in the current frame */
-/* for read */
-struct VBlobHeader *BlobHeadersGetHeader( const BlobHeaders *self );
-struct VBlobHeader *BlobHeadersGetHdrWrite( BlobHeaders *self );
-struct VBlobHeader *BlobHeadersCreateDummyHeader( uint8_t version, uint32_t fmt, uint8_t flags, uint64_t size );
-
-
-/* VBlobHeader stuff */
-rc_t VBlobHeaderAddRef ( struct VBlobHeader const *self );
-
-#if NOT_DEFINED_IN_VDB_XFORM_H
-uint8_t VBlobHeaderVersion( const struct VBlobHeader *self );
-void VBlobHeaderSetVersion( struct VBlobHeader *self, uint8_t version );
-#endif
-
-uint8_t VBlobHeaderFlags( const struct VBlobHeader *self );
-void VBlobHeaderSetFlags( struct VBlobHeader *self, uint8_t flags );
-
-uint32_t VBlobHeaderFormatId( const struct VBlobHeader *self );
-void VBlobHeaderSetFormat( struct VBlobHeader *self, uint32_t fmt );
-
-uint64_t VBlobHeaderSourceSize( const struct VBlobHeader *self );
-void VBlobHeaderSetSourceSize( struct VBlobHeader *self, uint64_t ssize );
-
-
-/* Replace
- *  replace contents of "self" with the contents of "src"
- *
- *  after running multiple processes in parallel, one header must
- *  be chosen to associate with the output blob. use this function
- *  to set ...
- */
-rc_t VBlobHeaderReplace ( struct VBlobHeader *self, struct VBlobHeader const *src );
diff --git a/libs/vdb/blob-priv.h b/libs/vdb/blob-priv.h
deleted file mode 100644
index 625e979..0000000
--- a/libs/vdb/blob-priv.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_blob_priv_
-#define _h_blob_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_vdb_blob_
-#include <vdb/blob.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_klib_data_buffer_
-#include <klib/data-buffer.h>
-#endif
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#define TRACKING_BLOBS 0
-#if TRACKING_BLOBS
-#include <stdio.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    
-#if _DEBUGGING
-#define VBLOG_HAS_NAME 1
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct PageMap;
-struct BlobHeaders;
-struct VProduction;
-struct VBlobPageMapCache;
-
-typedef struct PageMapProcessRequest{
-    struct PageMap *pm;        /**** deserialized form **/
-    KDataBuffer data;   /**** serialized   form **/
-    uint32_t    row_count;
-    uint64_t    elem_count;
-    rc_t rc;            /**** results **/
-
-    volatile enum {
-        ePMPR_STATE_NONE=0,
-        ePMPR_STATE_SERIALIZE_REQUESTED,
-        ePMPR_STATE_DESERIALIZE_REQUESTED,
-        ePMPR_STATE_SERIALIZE_DONE,
-        ePMPR_STATE_DESERIALIZE_DONE,
-	ePMPR_STATE_EXIT
-    } state;            /**** request state      **/
-    struct KLock      *lock;
-    struct KCondition *cond;
-} PageMapProcessRequest;
-
-
-/*--------------------------------------------------------------------------
- * VBlob
- */
-struct VBlob
-{
-    int64_t start_id;
-    int64_t stop_id;
-    
-    struct PageMap *pm;
-    struct BlobHeaders *headers;
-    struct VBlobPageMapCache *spmc; /* cache for split */
-    KDataBuffer data;
-    KRefcount refcount;
-
-/*    uint32_t row_count; */ /* == stop_id + 1 - start_id */
-    bool no_cache;
-    VByteOrder byte_order;
-#if VBLOG_HAS_NAME
-    const char name[32];
-#endif
-};
-
-struct VBlobPageMapCache {
-    int n;
-    struct PageMap *pm[1];
-};
-
-#define BlobBufferBits(BLOB) ((uint64_t)KDataBufferBits(&(BLOB)->data))
-#define BlobBufferBytes(BLOB) ((size_t)(KDataBufferBytes(&(BLOB)->data)))
-#define BlobRowCount(BLOB) ((uint32_t)( (uint64_t)((BLOB)->stop_id - (BLOB)->start_id) == UINT64_MAX ? UINT32_MAX : (BLOB)->stop_id + 1 - (BLOB)->start_id ))
-
-#if TRACKING_BLOBS
-/* #define TRACK_BLOB(f,p) fprintf(stderr, "%s %p %d %s:%d:%s\n",#f,(void*)p,*(int*)(&p->refcount),__FILE__,__LINE__,__func__) */
-#define TRACK_BLOB(f,p) fprintf(stderr, "+++++ %s %p %d %s:%d\n",#f,(void*)(p),p?*(int*)(&(p)->refcount):0,__func__,__LINE__)
-#else
-#define TRACK_BLOB(f,p)
-#endif
-
-rc_t VBlobNew( VBlob **lhs, int64_t start_id, int64_t stop_id, const char *name );
-
-/* use inline-able addref and release on blobs
-   within the library for efficiency */
-#if 1
-#define VBlobAddRef( self ) \
-    ( ( ( self ) == NULL ) ? \
-      0 : ( atomic32_inc ( & ( self ) -> refcount ), 0 ) )
-#define VBlobRelease( self ) \
-    ( ( ( self ) == NULL || atomic32_read_and_add_gt ( & ( self ) -> refcount, -1, 1 ) > 1 ) ? \
-      0 : VBlobRelease ( self ) )
-#endif
-
-#if _DEBUGGING
-void VBlobCheckIntegrity ( const VBlob *self );
-#else
-#define VBlobCheckIntegrity( self ) \
-  ( void ) 0
-#endif
-
-rc_t VBlobCreateFromData(
-                         struct VBlob **lhs,
-                         int64_t start_id, int64_t stop_id,
-                         const KDataBuffer *src,
-                         uint32_t elem_bits,
-			 PageMapProcessRequest const *pmpr
-);
-
-rc_t VBlobCreateFromSingleRow(
-                              struct VBlob **lhs,
-                              int64_t start_id, int64_t stop_id,
-                              const KDataBuffer *src,
-                              VByteOrder byte_order
-);
-/*** VBlob as a new array; meaning fixed len,data_run(..)=1 **/
-rc_t VBlobNewAsArray(struct VBlob **lhs, int64_t start_id, int64_t stop_id, uint32_t rowlen, uint32_t elem_bits); 
-    
-rc_t VBlobSerialize( const VBlob *self, KDataBuffer *result );
-
-bool VBlobIsSingleRow( const VBlob *self );
-
-uint32_t VBlobFixedRowLength( const struct VBlob *self );
-
-rc_t VBlobAppend( struct VBlob *self, const struct VBlob *other );
-/**** finds start_id in a blob and builds sub-blob for the number or repetitions ***/
-rc_t VBlobSubblob( const struct VBlob *self,struct VBlob **sub, int64_t start_id );
-
-void VBlobPageMapOptimize( struct VBlob **self );
-
-#define LAST_BLOB_CACHE_SIZE 256
-
-
-typedef struct VBlobMRUCache VBlobMRUCache; /** forward declaration **/
-typedef  struct VBlobMRUCacheCursorContext {  /** to be used to pass cache context down to production level ***/
-	VBlobMRUCache * cache;
-	uint32_t	col_idx;
-} VBlobMRUCacheCursorContext;
-
-VBlobMRUCache * VBlobMRUCacheMake(uint64_t capacity );
-void VBlobMRUCacheDestroy( VBlobMRUCache *self );
-const VBlob* VBlobMRUCacheFind(const VBlobMRUCache *cself, uint32_t col_idx, int64_t row_id);
-rc_t VBlobMRUCacheSave(const VBlobMRUCache *cself, uint32_t col_idx, const VBlob *blob);
-
-
-rc_t PageMapProcessGetPagemap(const PageMapProcessRequest *self,struct PageMap **pm);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* _h_blob_priv_ */
diff --git a/libs/vdb/blob.c b/libs/vdb/blob.c
deleted file mode 100644
index e728390..0000000
--- a/libs/vdb/blob.c
+++ /dev/null
@@ -1,1573 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
- 
-#define TRACK_REFERENCES 0
-
-#include "page-map.h"
-#include "blob-headers.h"
-#include "blob.h"
-#include "blob-priv.h"
-#include <klib/rc.h>
-#include <klib/defs.h>
-#include <byteswap.h>
-#include <klib/data-buffer.h>
-#include <klib/container.h>
-#include <klib/vlen-encode.h>
-#include <kdb/btree.h>
-#include <vdb/schema.h>
-#include <vdb/xform.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <bitstr.h>
-
-#include <kproc/timeout.h>
-#include <kproc/lock.h>
-#include <kproc/cond.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <os-native.h>
-
-#include <stdio.h> /* temp for debugging */
-
-#if _DEBUGGING
-void VBlobCheckIntegrity ( const VBlob *self )
-{
-    if ( self != NULL )
-    {
-        rc_t rc = KDataBufferCheckIntegrity ( & self -> data );
-        if ( rc != 0 )
-        {
-            fprintf ( stderr, "AAAAAH!\n" );
-        }
-    }
-}
-#endif
-
-rc_t VBlobNew ( VBlob **lhs, int64_t start_id, int64_t stop_id, const char *name ) {
-    VBlob *y;
-    
-    if ( name == NULL )
-        name = "";
-#if VBLOG_HAS_NAME
-    *lhs = y = malloc(sizeof(*y) + strlen(name));
-#else
-    *lhs = y = calloc(1, sizeof(*y));
-#endif
-    if (y) {
-        KRefcountInit(&y->refcount, 1, "VBlob", "new", name);
-        y->start_id = start_id;
-        y->stop_id = stop_id;
-        y->data.elem_bits = 1;
-        y->byte_order = vboNative;
-#if VBLOG_HAS_NAME
-        y->pm = NULL;
-        y->headers = NULL;
-        y->spmc = NULL;
-        memset(&y->data, 0, sizeof(y->data));
-        y->no_cache = 0;
-        strcpy(&(((char *)y->name)[0]), name);
-#endif
-        
-        return 0;
-    }
-    return RC(rcVDB, rcBlob, rcConstructing, rcMemory, rcExhausted);
-}
-rc_t VBlobNewAsArray(struct VBlob **lhs, int64_t start_id, int64_t stop_id, uint32_t rowlen, uint32_t elem_bits)
-{
-	VBlob *y;
-	rc_t rc = VBlobNew(&y,start_id,stop_id,NULL);
-	if(rc == 0){
-		rc = KDataBufferMake(&y->data,elem_bits,rowlen*(stop_id-start_id+1));
-		if(rc == 0){
-			rc=PageMapNewFixedRowLength(&y->pm,stop_id-start_id+1,rowlen);
-			if(rc == 0){
-				*lhs = y;
-				return 0;
-			}
-			PageMapRelease(y->pm);
-		}
-		VBlobRelease(y);
-	}
-	return rc;
-}
-
-static rc_t VBlobDestroy( VBlob *that ) {
-    if (that->spmc) {
-        int i;
-        
-        for (i = 0; i != that->spmc->n; ++i)
-            PageMapRelease(that->spmc->pm[i]);
-        free(that->spmc);
-    }
-    KDataBufferWhack(&that->data);
-    BlobHeadersRelease(that->headers);
-    PageMapRelease(that->pm);
-    free(that);
-    return 0;
-}
-
-static rc_t decode_header_byte_v2(
-                                  uint8_t header_byte,
-                                  uint8_t *variant,
-                                  uint8_t *adjust,
-                                  VByteOrder *byte_order
-) {
-    *adjust = (8 - (header_byte & 7)) & 7; header_byte >>= 3;
-    *byte_order = (header_byte & 1) ? vboBigEndian : vboLittleEndian;
-    header_byte >>= 1;
-    *variant = header_byte & 3;
-    header_byte >>= 2;
-    return header_byte == 2 ? 0 : RC(rcVDB, rcBlob, rcReading, rcData, rcBadVersion);
-}
-
-static rc_t decode_header_v2_0(
-                               const uint8_t *src,
-                               uint64_t ssize,
-                               uint32_t *hdr_size,
-                               uint32_t *map_size,
-                               uint32_t *offset
-) {
-    *offset = 3;
-    if (ssize < *offset)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    *hdr_size = src[1];
-    *map_size = src[2];
-    return 0;
-}
-
-static rc_t decode_header_v2_1(
-                               const uint8_t *src,
-                               uint64_t ssize,
-                               uint32_t *hdr_size,
-                               uint32_t *map_size,
-                               uint32_t *offset
-) {
-    *offset = 4;
-    if (ssize < *offset)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    *hdr_size = src[1];
-    *map_size = (uint32_t)src[2] | ((uint32_t)src[3] << 8);
-    return 0;
-}
-
-static rc_t decode_header_v2_2(
-                               const uint8_t *src,
-                               uint64_t ssize,
-                               uint32_t *hdr_size,
-                               uint32_t *map_size,
-                               uint32_t *offset
-) {
-    *offset = 6;
-    if (ssize < *offset)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    *hdr_size = src[1];
-    *map_size = (uint32_t)src[2] | ((uint32_t)src[3] << 8) | ((uint32_t)src[4] << 16) | ((uint32_t)src[5] << 24);
-    return 0;
-}
-
-static rc_t decode_header_v2_3(
-                               const uint8_t *src,
-                               uint64_t ssize,
-                               uint32_t *hdr_size,
-                               uint32_t *map_size,
-                               uint32_t *offset
-) {
-    *offset = 9;
-    if (ssize < *offset)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    *hdr_size = (uint32_t)src[1] | ((uint32_t)src[2] << 8) | ((uint32_t)src[3] << 16) | ((uint32_t)src[4] << 24);
-    *map_size = (uint32_t)src[5] | ((uint32_t)src[6] << 8) | ((uint32_t)src[7] << 16) | ((uint32_t)src[8] << 24);
-    return 0;
-}
-
-static rc_t decode_header_v2(
-                             const uint8_t *src,
-                             uint64_t ssize,
-                             uint32_t *hdr_size,
-                             uint32_t *map_size,
-                             uint32_t *offset,
-                             uint8_t *adjust,
-                             VByteOrder *byte_order
-) {
-    rc_t rc;
-    uint8_t variant;
-    
-    if (ssize == 0)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-
-    rc = decode_header_byte_v2(src[0], &variant, adjust, byte_order);
-    if (rc)
-        return rc;
-
-    switch (variant) {
-    case 0:
-        return decode_header_v2_0(src, ssize, hdr_size, map_size, offset);
-    case 1:
-        return decode_header_v2_1(src, ssize, hdr_size, map_size, offset);
-    case 2:
-        return decode_header_v2_2(src, ssize, hdr_size, map_size, offset);
-    case 3:
-        return decode_header_v2_3(src, ssize, hdr_size, map_size, offset);
-    default:
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcBadVersion);
-    }
-}
-
-static rc_t encode_header_v1(
-                             uint8_t *dst,
-                             uint64_t dsize,
-                             uint64_t *used,
-                             uint32_t row_length,
-                             bitsz_t data_size,
-                             VByteOrder byte_order
-) {
-    /* byte-order goes in bits 0..1 */
-    uint8_t header_byte = byte_order & 3;
-    if ( header_byte == vboNative )
-    {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        header_byte = ( uint8_t) vboLittleEndian;
-#else
-        header_byte = ( uint8_t) vboBigEndian;
-#endif
-    }
-
-    /* blob size adjust goes in bits 2..4 */
-    header_byte |= ( ( 8 - ( data_size & 7 ) ) & 7 ) << 2;
-    
-    /* row-length code goes in bits 5..6 */
-    if ( row_length == 1 ) {
-        header_byte |= 3 << 5;
-        * used = 1;
-        if ( dsize < * used )
-            return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-        dst[0] = header_byte;
-    }
-    else if (row_length < 0x100) {
-        *used = 2;
-        if (dsize < *used)
-            return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-        dst[0] = header_byte;
-        dst[1] = ( uint8_t ) row_length;
-    }
-    else if (row_length < 0x10000) {
-        header_byte |= 1 << 5;
-        *used = 3;
-        if (dsize < *used)
-            return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-        dst[0] = header_byte;
-        dst[1] = ( uint8_t ) row_length;
-        dst[2] = ( uint8_t ) ( row_length >> 8 );
-    }
-    else {
-        header_byte |= 2 << 5;
-        *used = 5;
-        if (dsize < *used)
-            return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-        dst[0] = header_byte;
-        dst[1] = ( uint8_t ) row_length;
-        dst[2] = ( uint8_t ) ( row_length >> 8 );
-        dst[3] = ( uint8_t ) ( row_length >> 16 );
-        dst[4] = ( uint8_t ) ( row_length >> 24 );
-    }
-    return 0;
-}
-
-static rc_t encode_header_v2(
-                             uint8_t *dst,
-                             uint64_t dsize,
-                             uint64_t *used,
-                             uint64_t hdr_size,
-                             uint64_t map_size,
-                             bitsz_t data_size
-) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    uint8_t header_byte = 0x80 | ( (uint8_t)data_size & 7 );
-#else
-    uint8_t header_byte = 0x88 | ( (uint8_t)data_size & 7 );
-#endif
-    
-    assert(hdr_size >> 32 == 0);
-    assert(map_size >> 32 == 0);
-    
-    if ((hdr_size >> 8) == 0) {
-        if ((map_size >> 8) == 0) {
-            *used = 3;
-            if (dsize < *used)
-                return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-            
-            dst[0] = header_byte;
-            dst[1] = hdr_size;
-            dst[2] = map_size;
-        }
-        else if ((map_size >> 16) == 0) {
-            *used = 4;
-            if (dsize < *used)
-                return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-            
-            dst[0] = header_byte | 0x10;
-            dst[1] = hdr_size;
-            dst[2] = map_size;
-            dst[3] = map_size >> 8;
-        }
-        else {
-            *used = 6;
-            if (dsize < *used)
-                return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-
-            dst[0] = header_byte | 0x20;
-            dst[1] = hdr_size;
-            dst[2] = map_size;
-            dst[3] = map_size >> 8;
-            dst[4] = map_size >> 16;
-            dst[5] = map_size >> 24;
-        }
-    }
-    else {
-        *used = 9;
-        if (dsize < *used)
-            return RC(rcVDB, rcBlob, rcConstructing, rcBuffer, rcInsufficient);
-
-        dst[0] = header_byte | 0x30;
-
-        dst[1] = hdr_size;
-        dst[2] = hdr_size >> 8;
-        dst[3] = hdr_size >> 16;
-        dst[4] = hdr_size >> 24;
-
-        dst[5] = map_size;
-        dst[6] = map_size >> 8;
-        dst[7] = map_size >> 16;
-        dst[8] = map_size >> 24;
-    }
-    return 0;
-}
-
-static
-rc_t PageMapProcessRequestLock(PageMapProcessRequest *self)
-{
-	rc_t rc=RC(rcVDB,rcPagemap, rcConstructing, rcSelf, rcNull);
-	if(self){
-		struct timeout_t tm;
-		TimeoutInit(&tm,0);
-		TimeoutPrepare(&tm);
-		/*** no plans to wait here the thread should be relased by now ****/
-		rc = KLockTimedAcquire(self->lock,&tm);
-		if(rc == 0){
-			if(self->state != ePMPR_STATE_NONE){ /*** thread is not released yet **/
-				assert(0); /** should not happen ***/
-				KLockUnlock(self->lock);
-				rc=RC(rcVDB, rcPagemap, rcConstructing, rcThread, rcBusy);
-			}
-		}
-	}
-	return rc;
-}
-
-static
-void PageMapProcessRequestLaunch(PageMapProcessRequest *self)
-{
-	KLockUnlock(self -> lock);
-	KConditionSignal ( self -> cond );
-}
-
-rc_t PageMapProcessGetPagemap(const PageMapProcessRequest *cself,struct PageMap **pm)
-{
-	rc_t rc=RC(rcVDB,rcPagemap, rcConstructing, rcSelf, rcNull);
-        if(cself){
-	    PageMapProcessRequest *self=(PageMapProcessRequest*)cself;
-	    if(self->lock == NULL){
-		/** NOT LOCKABLE **/
-		rc=0;
-	    } else if((rc = KLockAcquire ( self->lock ))==0){
-CHECK_AGAIN:
-		switch(self->state){
-		 case ePMPR_STATE_DESERIALIZE_REQUESTED:
-			/*fprintf(stderr,"Waiting for pagemap %p\n",cself->lock);*/
-			rc = KConditionWait ( self -> cond, self -> lock );
-                        goto CHECK_AGAIN;
-		 case ePMPR_STATE_DESERIALIZE_DONE:
-			assert(self->pm);
-			/*fprintf(stderr,"Pagemap %p Used R:%6d|DR:%d|LR:%d\n",self->lock, self->pm->row_count,self->pm->data_recs,self->pm->leng_recs);*/
-			*pm=self->pm;
-			self->pm = NULL;
-			KDataBufferWhack(&self->data);
-			self->row_count = 0;
-			self->state = ePMPR_STATE_NONE;
-			KLockUnlock(self -> lock);
-			KConditionSignal(self->cond);
-			break;
-		case ePMPR_STATE_NONE: /* not requested */
-			KLockUnlock(self -> lock);
-		    rc = 0;
-		    break;
-		 default: /** should never happen ***/
-			assert(0);
-			KLockUnlock(self -> lock);
-			return RC(rcVDB, rcPagemap, rcConverting, rcParam, rcInvalid );
-		}
-	    }
-        }
-        return rc;
-}
-
-
-static
-rc_t VBlobCreateFromData_v2(
-                            VBlob **lhs,
-                            const KDataBuffer *data,
-                            int64_t start_id, int64_t stop_id,
-                            uint32_t elem_bits, PageMapProcessRequest *pmpr
-) {
-    uint64_t ssize = data->elem_count;
-    uint32_t hsize;
-    uint32_t msize;
-    uint32_t offset;
-    VByteOrder byte_order;
-    uint8_t adjust;
-    VBlob *y;
-    uint32_t data_offset;
-    uint32_t pagemap_offset;
-    bitsz_t databits;
-    uint32_t elem_count;
-    uint8_t *src = data->base;
-    rc_t rc;
-    
-    rc = decode_header_v2(src, ssize, &hsize, &msize, &offset, &adjust, &byte_order);
-    if (rc)
-        return rc;
-
-    if (ssize < offset + hsize + msize)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    pagemap_offset = offset + hsize;
-    data_offset = pagemap_offset + msize;
-    assert(data_offset <= ssize);
-    ssize -= data_offset;
-    databits = (ssize << 3) - adjust;
-    assert(databits % elem_bits == 0);
-    elem_count = (uint32_t)( databits / elem_bits );
-
-    rc = VBlobNew(&y, start_id, stop_id, NULL);
-    TRACK_BLOB (VBlobNew, y);
-    if (rc == 0) {
-        if (hsize)
-            rc = BlobHeadersCreateFromData(&y->headers, src+offset , hsize);
-        if (rc == 0) {
-            if (msize > 0) {
-                if(PageMapProcessRequestLock(pmpr)==0) {
-                    KDataBufferSub(data, &pmpr->data, pagemap_offset, msize);
-                    pmpr->row_count = BlobRowCount(y);
-                    pmpr->state = ePMPR_STATE_DESERIALIZE_REQUESTED;
-                    /*fprintf(stderr,"Pagemap %p Requested R:%6d|SZ:%d|%ld:%ld\n",pmpr->lock, pmpr->row_count,msize,start_id, stop_id);*/
-                    PageMapProcessRequestLaunch(pmpr);
-                }
-                else {
-                    KDataBuffer tdata;
-                    KDataBufferSub(data, &tdata, pagemap_offset, msize);
-                    rc = PageMapDeserialize(&y->pm, tdata.base,tdata.elem_count, BlobRowCount(y));
-                    KDataBufferWhack(&tdata);
-                }
-            }
-            if (rc == 0) {
-                KDataBufferSub(data, &y->data, data_offset, ssize);
-                y->data.elem_bits = elem_bits;
-                y->data.elem_count = elem_count;
-                y->byte_order = byte_order;
-                *lhs = y;
-                return 0;
-            }
-        }
-        (void)VBlobRelease(y);
-        TRACK_BLOB (VBlobRelease, y);
-    }
-    return rc;
-}
-
-static
-rc_t VBlobCreateFromData_v1(
-                            VBlob **lhs,
-                            const KDataBuffer *data,
-                            int64_t start_id, int64_t stop_id,
-                            uint32_t elem_bits
-) {
-    const uint8_t *src = data->base;
-    uint64_t ssize = data->elem_count;
-    uint8_t header;
-    rc_t rc;
-    VBlob *y;
-    VByteOrder byte_order;
-    uint32_t offset;
-    int adjust;
-    int rls; /* row length size */
-    uint64_t row_len;
-    bitsz_t databits;
-    
-    if (ssize == 0)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    
-    header = *src;
-    byte_order = header & 3; header >>= 2;
-    adjust = header & 7;
-    header >>= 3;
-    rls = header & 3;
-    
-    /* convert rls from a code to an actual length */
-    rls = "\x01\x02\x04\x00" [ rls ];
-
-    /* adjust offset */
-    offset = rls + 1;
-
-    /* handle special code where row length is implicitly 1 */
-    if ( rls == 0 )
-        row_len = 1;
-
-    /* ensure sufficient header bytes */
-    else if ( ssize < offset )
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-    else
-    {
-        /* produce little-endian 64-bit row-length */
-        row_len = 0;
-        memcpy ( & row_len, & src [ 1 ], rls );
-
-#if __BYTE_ORDER != __LITTLE_ENDIAN
-        /* correct for big-endian */
-        row_len = bswap_64 ( row_len );
-#endif
-    }
-
-    ssize -= offset;
-    databits = (ssize << 3) - adjust;
-    assert(databits % elem_bits == 0);
-
-    rc = VBlobNew(&y, start_id, stop_id, NULL);
-    TRACK_BLOB (VBLobNew, y);
-    if (rc == 0) {
-
-        uint64_t row_count = BlobRowCount ( y );
-
-        /* test for badly formed row-length */
-        if ( rls == 4 )
-        {
-            assert ( row_len != 0 );
-            if ( row_len * row_count != databits / elem_bits )
-            {
-                /* we can fix a length if we know the count */
-                if ( row_count != 0 )
-                    row_len = ( databits / elem_bits ) / row_count;
-                else
-                {
-                    /* rely on code to handle legacy blobs in prod-cmn.c:VFunctionProdCallByteswap */
-                    row_len = 0;
-                }
-            }
-        }
-
-        if ( row_len != 0 )
-            rc = PageMapNewFixedRowLength( &y->pm, row_count, row_len );
-        if (rc == 0) {
-            KDataBufferSub(data, &y->data, offset, ssize);
-            y->data.elem_bits = elem_bits;
-            y->data.elem_count = (uint32_t)( databits / elem_bits );
-            y->byte_order = byte_order;
-			
-            *lhs = y;
-            return 0;
-        }
-        /* like a call to VBlobRelease (y); */
-        TRACK_BLOB (VBlobRelease-free, y);
-        free(y);
-    }
-    return rc;
-}
-
-static void VBlobOptimize_UnRLE_uint8_t(VBlob **vblobp)
-{
-	VBlob   *sblob  = *vblobp;
-	VBlob *vblob;
-	rc_t rc = VBlobNewAsArray(&vblob,sblob -> start_id, sblob -> stop_id,sblob->pm->length[0],sblob->data.elem_bits);
-	if( rc == 0){
-		uint32_t i,j;
-		uint8_t *src=sblob->data.base;
-		uint8_t *dst=vblob->data.base;
-		for(i=j=0;i<sblob->pm->data_recs;i++){
-			row_count_t data_len=sblob->pm->data_run[i];
-			while(data_len > 0){
-				assert(j < sblob->pm->row_count);
-				dst[j++] = src[i];
-				data_len--;
-			}
-		}
-		vblob->pm->optimized = eBlobPageMapOptimizedSucceeded;
-		VBlobRelease(sblob);
-		(*vblobp) = vblob;
-	}
-}
-static void VBlobOptimize_UnRLE_uint16_t(VBlob **vblobp)
-{
-	VBlob   *sblob  = *vblobp;
-	VBlob *vblob;
-	rc_t rc = VBlobNewAsArray(&vblob,sblob -> start_id, sblob -> stop_id,sblob->pm->length[0],sblob->data.elem_bits);
-	if( rc == 0) {
-		uint32_t i,j;
-		uint16_t *src=sblob->data.base;
-		uint16_t *dst=vblob->data.base;
-		for(i=j=0;i<sblob->pm->data_recs;i++){
-			row_count_t data_len=sblob->pm->data_run[i];
-			while(data_len > 0){
-				assert(j < sblob->pm->row_count);
-				dst[j++] = src[i];
-				data_len--;
-			}
-		}
-		vblob->pm->optimized = eBlobPageMapOptimizedSucceeded;
-		VBlobRelease(sblob);
-		(*vblobp) = vblob;
-	}
-}
-static void VBlobOptimize_UnRLE_uint32_t(VBlob **vblobp)
-{
-	VBlob   *sblob  = *vblobp;
-	VBlob *vblob;
-	rc_t rc = VBlobNewAsArray(&vblob,sblob -> start_id, sblob -> stop_id,sblob->pm->length[0],sblob->data.elem_bits);
-	if( rc == 0) {
-		uint32_t i,j;
-		uint32_t *src=sblob->data.base;
-		uint32_t *dst=vblob->data.base;
-		for(i=j=0;i<sblob->pm->data_recs;i++){
-			row_count_t data_len=sblob->pm->data_run[i];
-			while(data_len > 0){
-				assert(j < sblob->pm->row_count);
-				dst[j++] = src[i];
-				data_len--;
-			}
-		}
-		vblob->pm->optimized = eBlobPageMapOptimizedSucceeded;
-		VBlobRelease(sblob);
-		(*vblobp) = vblob;
-	}
-}
-static void VBlobOptimize_UnRLE_uint64_t(VBlob **vblobp)
-{
-	VBlob   *sblob  = *vblobp;
-	VBlob *vblob;
-	rc_t rc = VBlobNewAsArray(&vblob,sblob -> start_id, sblob -> stop_id,sblob->pm->length[0],sblob->data.elem_bits);
-	if( rc == 0) {
-		uint32_t i,j;
-		uint64_t *src=sblob->data.base;
-		uint64_t *dst=vblob->data.base;
-		for(i=j=0;i<sblob->pm->data_recs;i++){
-			row_count_t data_len=sblob->pm->data_run[i];
-			while(data_len > 0){
-				assert(j < sblob->pm->row_count);
-				dst[j++] = src[i];
-				data_len--;
-			}
-		}
-		vblob->pm->optimized = eBlobPageMapOptimizedSucceeded;
-		VBlobRelease(sblob);
-		(*vblobp) = vblob;
-	}
-}
-
-
-void VBlobPageMapOptimize ( VBlob **vblobp)
-{
-	VBlob   *sblob  = *vblobp;
-	PageMap *pm     = sblob->pm;
-	if(pm->optimized != eBlobPageMapOptimizedNone) return; /* do not optimize previously optimized blobs */
-	pm->optimized = eBlobPageMapOptimizedFailed; /*** prevent future optimization if none of the algorithms succeeds ***/
-
-	if(pm->leng_recs == 1)
-    {
-		if( pm->length[0] * sblob->data.elem_bits == 8 /** 1 byte data ***/
-		    &&  pm->data_recs < pm->row_count       /** rle was used ***/
-		    &&  pm->data_recs * 6 > pm->row_count){ /** but not super efficiently **/
-			/*printf("OPTIMIZATION: UnRLE(8)\n");*/
-			VBlobOptimize_UnRLE_uint8_t(vblobp); 
-			return;
-		}
-		if( pm->length[0] * sblob->data.elem_bits == 16 /** 2 byte data ***/
-		    &&  pm->data_recs < pm->row_count       /** rle was used ***/
-		    &&  pm->data_recs * 2 > pm->row_count){ /** but not super efficiently **/
-			/*printf("OPTIMIZATION: UnRLE(16)\n");*/
-			VBlobOptimize_UnRLE_uint16_t(vblobp);
-			return;
-		}
-		if( pm->length[0] * sblob->data.elem_bits == 32 /** 4 byte data ***/
-		    &&  pm->data_recs < pm->row_count       /** rle was used ***/
-		    &&  pm->data_recs * 15 > pm->row_count * 10 ){ /** but not super efficiently **/
-			/*printf("OPTIMIZATION: UnRLE(32)\n");*/
-			VBlobOptimize_UnRLE_uint32_t(vblobp);
-			return;
-		}
-		if( pm->length[0] * sblob->data.elem_bits == 64 /** 8 byte data ***/
-		    &&  pm->data_recs < pm->row_count       /** rle was used ***/
-		    &&  pm->data_recs * 11 > pm->row_count * 10 ){ /** but not super efficiently **/
-			/*printf("OPTIMIZATION: UnRLE(64)\n");*/
-			VBlobOptimize_UnRLE_uint64_t(vblobp);
-			return;
-		}
-
-	}
-
-	if(pm->row_count > 1024 && (sblob->data.elem_bits & 7) == 0)
-    {
-		elem_count_t	minlen,maxlen;
-		elem_count_t	elem_sz = sblob->data.elem_bits/8;
-		rc_t rc = PageMapRowLengthRange(pm, &minlen,&maxlen);
-		if( rc == 0  && maxlen*elem_sz > 2 && maxlen*elem_sz <= 2048 /* do not optimize super large entries */){ 
-		/******* TRY dictionary **/
-			int64_t		limit_vocab_size;
-			uint32_t	vocab_cnt=0;
-			KBTree		*vocab_key2id = NULL;
-			bool		valid_data_run = (pm->row_count != pm->data_recs);
-			uint32_t	*data_offset = NULL;
-			KDataBuffer     new_data;
-
-			rc=KDataBufferMake(&new_data,sblob->data.elem_bits,0); /** no allocation - shoulf not fail at all **/
-			assert(rc==0);
-/*******************
-* another formula
-* the savings should not be less than the waste on pointers into data vocabulary
-* it is assumed that the data offsets will cost us not more than 2 bytes on disk
-* the nasty left part is the average number of bytes in a row
-* limit_vocab_size = ((int64_t)sblob->data.elem_count*elem_sz - 2*pm->row_count) * sblob->data.elem_count / pm->data_recs / elem_sz;
-****************/
-			limit_vocab_size = ((int64_t)sblob->data.elem_count*elem_sz +(valid_data_run?pm->data_recs*2:0) -  2*pm->row_count)
-					   * pm->data_recs / (int64_t)sblob->data.elem_count / elem_sz;
-			
-
-			if(limit_vocab_size <=1 ){
-				rc = RC(rcVDB, rcBlob, rcConstructing, rcId, rcOutofrange);
-			}
-			if(limit_vocab_size > pm->data_recs/4){
-				limit_vocab_size = pm->data_recs/4;  /* to limit the amount of work **/
-			}
-#define MAX_VOCAB_SIZE 2048
-			if(limit_vocab_size > MAX_VOCAB_SIZE) limit_vocab_size=MAX_VOCAB_SIZE;
-			if(rc == 0)
-				rc=KBTreeMakeUpdate(&vocab_key2id, NULL, 256*1024*1024,
-				      false, kbtOpaqueKey,
-				      minlen?minlen*elem_sz:1,maxlen*elem_sz, sizeof ( uint32_t ), NULL);
-			if(rc == 0){
-				uint32_t i,j;
-				uint8_t  *src;
-				uint32_t dst_offset;
-				uint32_t vocab_arr[MAX_VOCAB_SIZE];
-				data_offset = malloc(pm->data_recs * sizeof(*data_offset));
-				if(data_offset == NULL){
-					rc = RC(rcVDB, rcBlob, rcConstructing, rcMemory, rcExhausted);
-				}
-				for(i=j=0,src = sblob->data.base,dst_offset=0;i<pm->leng_recs && rc == 0 ;i++){
-					row_count_t leng_run = pm->leng_run[i];
-					if(pm->length[i] == 0){/*** trivial case, can point anywhere - no vocabulary**/
-						for(;leng_run > 0;j++){
-							row_count_t data_run = valid_data_run?pm->data_run[j]:1;
-							assert(leng_run >= data_run);
-							data_offset[j] = 0; /**  point to offset=0 **/
-							leng_run -=data_run;
-						}
-					} else for(;leng_run > 0 && rc == 0;j++){
-						row_count_t data_run = valid_data_run?pm->data_run[j]:1;
-						bool wasInserted;
-						uint64_t tmp_id = vocab_cnt;
-						assert(leng_run >= data_run);
-						leng_run -=data_run;
-						rc = KBTreeEntry(vocab_key2id, &tmp_id, &wasInserted, src, pm->length[i]*elem_sz);
-						if(rc == 0){
-							if(wasInserted){
-								vocab_cnt++;
-								if(vocab_cnt == limit_vocab_size) {
-									rc = RC(rcVDB, rcBlob, rcConstructing, rcId, rcTooBig);
-								} else {
-									vocab_arr[tmp_id] = dst_offset; /** save offset */
-									data_offset[j]    = dst_offset;
-									rc = KDataBufferResize(&new_data,dst_offset+pm->length[i]);
-									if(rc == 0){
-										memcpy((uint8_t*)new_data.base+dst_offset*elem_sz,src,pm->length[i]*elem_sz);
-										dst_offset += pm->length[i];
-									}
-								}
-							} else {
-								assert(vocab_arr[tmp_id] <= dst_offset);
-								data_offset[j] = vocab_arr[tmp_id]; /** retrieve offset **/
-							}
-						}
-						src +=pm->length[i]*elem_sz;
-						assert(src - (uint8_t*)sblob->data.base <= sblob->data.elem_count * elem_sz);
-					}
-				}
-				if(rc == 0 ){
-					PageMap *new_pm;
-					/*printf("OPTIMIZATION LEVEL REACHED: vocab:%d,rows:%d,data_recs:%d\n",vocab_cnt ,pm->row_count,pm->data_recs);*/
-					rc=PageMapToRandomAccess(&new_pm,pm,data_offset); 
-					if(rc == 0){
-						/** DONE ***/
-						VBlob *vblob;
-						rc=VBlobNew(&vblob, sblob->start_id, sblob->stop_id, NULL);
-						if(rc==0){
-							vblob->pm = new_pm;
-							vblob->pm->optimized = eBlobPageMapOptimizedSucceeded;
-							vblob->data = new_data;
-							VBlobRelease(sblob);
-							*vblobp=vblob;
-							free(data_offset);
-							KBTreeRelease(vocab_key2id);
-							return;
-						}
-						PageMapRelease(new_pm);
-						
-					}
-					KDataBufferWhack(&new_data);
-				} else {
-					/*printf("NO OPTIMIZATION: vocab:%d,rows:%d,data_recs:%d\n",vocab_cnt ,pm->row_count,pm->data_recs);*/
-					KDataBufferWhack(&new_data);
-				}
-				if(data_offset) free(data_offset);
-				if(vocab_key2id) KBTreeRelease  ( vocab_key2id );
-			}
-		}
-	}
-
-}
-
-
-rc_t VBlobSerialize ( const VBlob *self, KDataBuffer *result ) {
-    uint64_t sz;
-    rc_t rc;
-    bitsz_t data_bits = KDataBufferBits(&self->data);
-    uint64_t data_bytes = KDataBufferBytes(&self->data);
-    uint32_t row_length;
-    
-    if (self->headers == NULL && (row_length = PageMapHasSimpleStructure(self->pm)) != 0) {
-        rc = KDataBufferResize(result, 5 + data_bytes);
-        if (rc == 0) {
-
-#if _DEBUGGING && 1
-            /* temporary assert that we are setting byte_order properly
-               in the future, we may allow some functions to issue other
-               byte orders, although there is no conceivable reason to do so */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            assert ( self -> byte_order == vboNative || self -> byte_order == vboLittleEndian );
-#else
-            assert ( self -> byte_order == vboNative || self -> byte_order == vboBigEndian );
-#endif
-#endif
-            rc = encode_header_v1(result->base, result->elem_count, &sz, row_length, data_bits, self->byte_order);
-            if (rc == 0) {
-                memcpy(&((uint8_t *)result->base)[sz], self->data.base, data_bytes);
-                result->elem_count = sz + data_bytes;
-            }
-        }
-    }
-    else {
-        KDataBuffer headers;
-        KDataBuffer pagemap;
-        
-        rc = KDataBufferMakeBytes(&headers, 0);
-        if (rc == 0) {
-            if (self->headers)
-                rc = BlobHeadersSerialize(self->headers, &headers, 0, &sz);
-            else
-                sz = 0;
-            if (rc == 0) {
-                headers.elem_count = sz;
-                rc = KDataBufferMakeBytes(&pagemap, 0);
-                if (rc == 0) {
-                    if (self->pm)
-                        rc = PageMapSerialize(self->pm, &pagemap, 0, &sz);
-                    else
-                        sz = 0;
-                    if (rc == 0) {
-                        pagemap.elem_count = sz;
-                        rc = KDataBufferResize(result, 9 + data_bytes + headers.elem_count + pagemap.elem_count);
-                        if (rc == 0) {
-                            rc = encode_header_v2(result->base, result->elem_count, &sz, headers.elem_count, pagemap.elem_count, data_bits);
-                            if (rc == 0) {
-                                memcpy(&((uint8_t *)result->base)[sz], headers.base, headers.elem_count);
-                                sz += headers.elem_count;
-                                memcpy(&((uint8_t *)result->base)[sz], pagemap.base, pagemap.elem_count);
-                                sz += pagemap.elem_count;
-                                memcpy(&((uint8_t *)result->base)[sz], self->data.base, data_bytes);
-                                result->elem_count = sz + data_bytes;
-                            }
-                        }
-                    }
-                    KDataBufferWhack(&pagemap);
-                }
-            }
-        }
-        KDataBufferWhack(&headers);
-    }
-    
-    return rc;
-}
-
-rc_t VBlobCreateFromData ( struct VBlob **lhs,
-                         int64_t start_id, int64_t stop_id,
-                         const KDataBuffer *src,
-                         uint32_t elem_bits , PageMapProcessRequest const *pmpr)
-{
-    VBlob *y = NULL;
-    rc_t rc;
-    
-    assert(lhs);
-    assert(src);
-    assert(src->elem_bits == 8);
-    assert(src->bit_offset == 0);
-
-    *lhs = 0;
-
-    if ((((const uint8_t *)src->base)[0] & 0x80) == 0)
-        rc = VBlobCreateFromData_v1(&y, src, start_id, stop_id, elem_bits);
-    else
-        rc = VBlobCreateFromData_v2(&y, src, start_id, stop_id, elem_bits, (PageMapProcessRequest*)pmpr);
-
-    if (rc == 0)
-        *lhs = y;
-
-    return rc;
-}
-
-rc_t VBlobCreateFromSingleRow (
-			      struct VBlob **lhs,
-			      int64_t start_id, int64_t stop_id,
-			      const KDataBuffer *src,
-			      VByteOrder byte_order )
-{
-    VBlob *y;
-    rc_t rc;
-    
-    rc = VBlobNew(&y, start_id, stop_id, NULL);
-    TRACK_BLOB (VBlobNew, y);
-    if (rc == 0) {
-        assert(src->elem_count >> 32 == 0);
-        rc = PageMapNewSingle(&y->pm, BlobRowCount(y), (uint32_t)src->elem_count);
-        if (rc == 0) {
-            rc = KDataBufferSub(src, &y->data, 0, UINT64_MAX);
-            if (rc == 0) {
-                y->byte_order = byte_order;
-                *lhs = y;
-                return 0;
-            }
-        }
-        /* should add a release/free? */
-    }
-    return rc;
-}
-
-bool VBlobIsSingleRow( const struct VBlob *self ) {
-    return (self->pm && self->pm->data_recs==1) ? true : false;
-}
-
-uint32_t VBlobFixedRowLength( const struct VBlob *self ) {
-    return self->pm ? PageMapFixedRowLength(self->pm) : 0;
-}
-
-#define COMPARE(FORCE, BITS, DBASE, DOFF, SBASE, SOFF, LENGTH) \
-    (((FORCE == 0) || (BITS & 7) != 0) ? ( \
-        bitcmp(DBASE, DOFF * BITS + FORCE, SBASE, SOFF * BITS, LENGTH * BITS)) : ( \
-        memcmp(((const char *)DBASE)+((DOFF * BITS) >> 3), \
-               ((const char *)SBASE)+((SOFF * BITS) >> 3), \
-               ((LENGTH * BITS) >> 3))))
-
-#define COPY(FORCE, BITS, DBASE, DOFF, SBASE, SOFF, LENGTH) \
-    (((FORCE == 0) || (BITS & 7) != 0) ? ( \
-        bitcpy(DBASE, DOFF * BITS + FORCE, SBASE, SOFF * BITS, LENGTH * BITS)) : ( \
-        (void)memcpy(((      char *)DBASE)+((DOFF * BITS) >> 3), \
-               ((const char *)SBASE)+((SOFF * BITS) >> 3), \
-               ((LENGTH * BITS) >> 3))))
-
-rc_t VBlobAppendRow(VBlob *self,
-                    elem_count_t *last_offset,
-                    elem_count_t *last_length,
-                    const KDataBuffer *src,
-                    elem_count_t offset,
-                    elem_count_t length,
-                    row_count_t repeat_count
-                    )
-{
-    rc_t rc;
-    
-    if (!PageMapHasRows(self->pm) || length != *last_length ||
-        COMPARE(self->data.bit_offset, self->data.elem_bits,
-                self->data.base, *last_offset,
-                src->base, offset,
-                length) != 0
-        )
-    {
-        *last_offset = self->data.elem_count;
-        rc = KDataBufferResize(&self->data, *last_offset + length);
-        if (rc == 0) {
-            COPY(self->data.bit_offset, self->data.elem_bits,
-                 self->data.base, *last_offset,
-                 src->base, offset, length);
-            rc = PageMapAppendRows(self->pm, length, repeat_count, false);
-        }
-        *last_length = length;
-    }
-    else
-        rc = PageMapAppendRows(self->pm, length, repeat_count, true);
-    
-    return rc;
-}
-
-static rc_t VBlobGetLastRow(VBlob *self, elem_count_t *offset, elem_count_t *length) {
-    
-    *length = PageMapLastLength(self->pm);
-    *offset = self->data.elem_count - *length;
-
-    return 0;
-}
-
-rc_t VBlobAppend(VBlob *self, const VBlob *other) {
-    rc_t rc;
-    row_count_t offset;
-    row_count_t length;
-    
-    if (self->headers)
-        return RC(rcVDB, rcBlob, rcConcatenating, rcSelf, rcInconsistent);
-    if (other->headers)
-        return RC(rcVDB, rcBlob, rcConcatenating, rcParam, rcInvalid);
-
-    if (self->stop_id + 1 != other->start_id)
-        return RC(rcVDB, rcBlob, rcConcatenating, rcId, rcOutofrange);
-
-    if (other->data.elem_bits != self->data.elem_bits)
-        return RC(rcVDB, rcBlob, rcConcatenating, rcData, rcInvalid);
-
-#if 0
-    fprintf(stderr, "appending %u(%u) (length: %u) to %u(%u) (length: %u) %s\n",
-            (unsigned)other->start_id, (unsigned)BlobRowCount(other),
-            (unsigned)other->data.elem_count,
-            (unsigned)self->start_id, (unsigned)BlobRowCount(self),
-            (unsigned)self->data.elem_count,
-            self->name);
-#endif
-    
-    rc = VBlobGetLastRow(self, &offset, &length);
-    if (rc == 0) {
-        PageMapIterator iter;
-        
-        rc = PageMapNewIterator(other->pm, &iter, 0, -1);
-        if (rc == 0) {
-            KDataBuffer orig;
-            
-            rc = KDataBufferMakeWritable(&self->data , &orig);
-            if (rc == 0) {
-                row_count_t row_count;
-                KDataBufferWhack(&self->data);
-                self->data = orig;
-                do {
-                    row_count = PageMapIteratorRepeatCount(&iter);
-                    rc = VBlobAppendRow(self, &offset, &length, &other->data,
-                                        PageMapIteratorDataOffset(&iter),
-                                        PageMapIteratorDataLength(&iter),
-                                        row_count);
-                } while (rc == 0 && PageMapIteratorAdvance(&iter, row_count));
-                if (rc == 0) {
-                    self->stop_id = other->stop_id;
-                    self->no_cache |= other->no_cache;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t VBlobSubblob( const struct VBlob *self,struct VBlob **sub, int64_t start_id )
-{
-    rc_t rc;
-    KDataBuffer  kd;
-    PageMapIterator pmi;
-    
-    if (start_id < self->start_id || start_id > self->stop_id)
-        return RC(rcVDB, rcBlob, rcConverting, rcId, rcOutofrange);
-    
-    rc=PageMapNewIterator(self->pm,&pmi, 0, -1);
-    if(rc == 0){
-        if(PageMapIteratorAdvance(&pmi,start_id-self->start_id)){
-            row_count_t numrep = PageMapIteratorRepeatCount(&pmi);
-            elem_count_t offset = PageMapIteratorDataOffset(&pmi);
-            elem_count_t length = PageMapIteratorDataLength(&pmi);
-            
-#if 0
-            fprintf(stderr, "splitting %u(%u) (offset: %u, length: %u) from %s\n",
-                    (unsigned)start_id, (unsigned)numrep,
-                    (unsigned)offset, (unsigned)length,
-                    self->name);
-#endif
-            
-            rc = KDataBufferSub(&self->data, &kd, offset, length);
-            if(rc == 0){
-                int64_t	stop_id;
-
-                if(length > 0) stop_id = start_id + numrep - 1;
-                else           stop_id = start_id; /*** HACK - 0 sized data may be a sign that real data is somewhere else ***/
-
-                rc = VBlobCreateFromSingleRow(sub, start_id, stop_id, &kd, self->byte_order);
-                KDataBufferWhack(&kd);
-            }
-        } else {
-            rc = RC(rcVDB, rcBlob, rcConverting, rcId, rcOutofrange);
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VBlobIdRange ( const VBlob *self,
-    int64_t *first, uint64_t *count )
-{
-    rc_t rc;
-
-    if ( first == NULL && count == NULL )
-        rc = RC ( rcVDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcBlob, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            if ( first != NULL )
-                * first = self -> start_id;
-            if ( count != NULL )
-                * count = self -> stop_id + 1 - self -> start_id;
-            return 0;
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VBlobCellData ( const VBlob *self, int64_t row_id,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    rc_t rc;
-    uint32_t dummy;
-
-    if ( elem_bits == NULL )
-        elem_bits = & dummy;
-    if ( boff == NULL )
-        boff = & dummy;
-    if ( row_len == NULL )
-        row_len = & dummy;
-
-    if ( base == NULL )
-        rc = RC ( rcVDB, rcBlob, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcBlob, rcAccessing, rcSelf, rcNull );
-        else if ( row_id < self -> start_id || self -> stop_id < row_id )
-            rc = RC ( rcVDB, rcBlob, rcAccessing, rcRange, rcInvalid );
-        else
-        {
-            uint64_t start;
-
-            /* TBD - this may be wrong */
-            * elem_bits = self -> data . elem_bits;
-            * row_len = PageMapGetIdxRowInfo ( self -> pm, ( uint32_t ) ( row_id - self -> start_id ), boff );
-            start = ( uint64_t ) boff [ 0 ] * elem_bits [ 0 ];
-            * base = ( uint8_t* ) self -> data . base + ( start >> 3 );
-            * boff = ( uint32_t ) start & 7;
-
-            return 0;
-        }
-
-        * base = NULL;
-    }
-
-    * elem_bits = * boff = * row_len = 0;
-
-    return rc;
-}
-
-/* a copy of VCursorRead() */
-LIB_EXPORT rc_t CC VBlobRead ( const VBlob *self, int64_t row_id,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len )
-{
-    rc_t rc = 0;
-    const void* base = NULL;
-    uint32_t boff = 0;
-    uint32_t elem_size = 0;
-    uint64_t to_read = 0;
-    uint64_t bsize = 0;
-
-    if ( self == NULL )
-    {   return RC ( rcVDB, rcBlob, rcReading, rcSelf, rcNull ); }
-
-    if ( buffer == NULL || row_len == NULL )
-    {   return RC ( rcVDB, rcBlob, rcReading, rcParam, rcNull ); }
-
-    if ( elem_bits == 0 || ( elem_bits & 7 ) != 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcParam, rcInvalid ); }
-
-    rc = VBlobCellData ( self, row_id, &elem_size, &base, &boff, row_len );
-    if ( rc != 0 )
-    {   return rc; }
-    if ( elem_size < elem_bits && elem_bits % elem_size != 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent ); }
-    if ( elem_size > elem_bits && elem_size % elem_bits != 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent ); }
-    if ( * row_len == 0 )
-    {   return 0; }
-    if ( blen == 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient ); }
-
-    to_read = * row_len * elem_size;
-    bsize = blen * elem_bits;
-
-    /* always return the required buffer size */
-    * row_len = ( uint32_t ) ( to_read / elem_bits );
-
-    /* detect buffer too small */
-    if ( to_read > bsize ) {
-        rc = RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient );
-        to_read = bsize;
-    }
-
-    /* copy out data up to limit */
-    assert ( boff == 0 );
-    memcpy ( buffer, base, ( size_t ) ( to_read >> 3 ) );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VBlobReadBits ( const VBlob *self, int64_t row_id,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t off,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining )
-{
-    rc_t rc = 0;
-    const void* base = NULL;
-    uint32_t boff = 0;
-    uint32_t elem_size = 0;
-    uint64_t to_read = 0;
-    uint64_t bsize = 0;
-    uint32_t row_len = 0;
-    uint32_t dummy;
-    if ( remaining == NULL )
-    {   remaining = & dummy; }
-
-    if ( self == NULL )
-    {   return RC ( rcVDB, rcBlob, rcReading, rcSelf, rcNull ); }
-
-    if ( buffer == NULL || num_read == NULL )
-    {   return RC ( rcVDB, rcBlob, rcReading, rcParam, rcNull ); }
-
-    if ( elem_bits == 0 || ( elem_bits & 7 ) != 0  )
-    {   return RC ( rcVDB, rcBlob, rcReading, rcParam, rcInvalid ); }
-
-    rc = VBlobCellData ( self, row_id, &elem_size, &base, &boff, &row_len );
-    if ( rc != 0 )
-    {   return rc; }
-    if ( elem_size < elem_bits && elem_bits % elem_size != 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent ); }
-    if ( elem_size > elem_bits && elem_size % elem_bits != 0 )
-    {   return RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent ); }
-    if ( row_len == 0 ) {
-        * num_read = * remaining = 0;
-        return 0;
-    }
-    if ( * num_read == 0 )
-    {   return 0; }
-    to_read = row_len * elem_size;
-    bsize = blen * elem_bits;
-
-    if ( blen == 0 ) {
-        * num_read = 0;
-        * remaining = ( uint32_t ) ( to_read / elem_bits );
-        return 0;
-    }
-    bsize = blen * elem_size;
-    if ( to_read <= bsize )
-    {   * remaining = 0; }
-    else {
-        * remaining = (uint32_t)( ( to_read - bsize ) / elem_bits );
-        to_read = bsize;
-    }
-    bitcpy ( buffer, off, base, boff, ( bitsz_t ) to_read );
-    * num_read = ( uint32_t ) ( to_read / elem_bits );
-
-    return rc;
-}
-
-#undef VBlobAddRef
-#undef VBlobRelease
-
-LIB_EXPORT rc_t CC VBlobAddRef ( const VBlob *self )
-{
-    if ( self != NULL )
-        KRefcountAdd(&self->refcount, "VBlob");
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VBlobRelease ( const VBlob *self )
-{
-    rc_t rc = 0;
-
-    if ( self != 0 )
-    {
-        switch ( KRefcountDrop(&self->refcount, "VBlob") )
-        {
-        case krefWhack:
-            return VBlobDestroy ( (VBlob*) self );
-        case krefNegative:
-            rc = RC (rcVDB, rcBlob, rcDestroying, rcBlob, rcExcessive);
-            PLOGERR ( klogInt, (klogInt, rc, "Released a blob $(B) with no more references",
-                      PLOG_P(self)));
-            break;
-        }
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * VBlobCache
- */
-typedef struct VBlobCache VBlobCache;
-struct VBlobCache
-{
-    BSTNode bn;
-    DLNode ln;
-    size_t size;
-    const VBlob *blob;
-    uint32_t col_idx;
-};
-
-static
-void CC VBlobCacheWhack ( BSTNode *n, void *ignore )
-{
-    VBlobCache *self = ( VBlobCache* ) n;
-    VBlobRelease ( ( VBlob* ) self -> blob );
-    free ( self );
-}
-
-static
-rc_t VBlobCacheMake ( VBlobCache **bcp, const VBlob *blob, uint32_t col_idx, size_t blob_size )
-{
-    VBlobCache *bc = malloc ( sizeof * bc );
-    if ( bc == NULL )
-        return RC ( rcVDB, rcCursor, rcReading, rcMemory, rcExhausted );
-
-    bc -> size = blob_size;
-    bc -> blob = blob;
-    VBlobAddRef(blob);
-    bc -> col_idx = col_idx;
-    * bcp = bc;
-    return 0;
-}
-typedef struct VBlobCacheKey VBlobCacheKey;
-struct VBlobCacheKey
-{
-    int64_t row_id;
-    uint32_t col_idx;
-};
-
-static
-int CC VBlobCacheCmp ( const void *a, const BSTNode *b )
-{
-    const VBlobCacheKey * key = a;
-    const VBlobCache * node = ( const VBlobCache* ) b;
-
-    if ( key -> col_idx != node -> col_idx )
-        return ( int ) key -> col_idx - ( int ) node -> col_idx;
-
-    if ( key -> row_id < node -> blob -> start_id )
-        return -1;
-    return key -> row_id > node -> blob -> stop_id;
-}
-
-static
-int CC VBlobCacheSort ( const BSTNode *a, const BSTNode *b )
-{
-    const VBlobCache * item = ( const VBlobCache* ) a;
-    const VBlobCache * node = ( const VBlobCache* ) b;
-
-    if ( item -> col_idx != node -> col_idx )
-        return ( int ) item -> col_idx - ( int ) node -> col_idx;
-
-    if ( item -> blob -> stop_id < node -> blob -> start_id )
-        return -1;
-    return item -> blob -> start_id > node -> blob -> stop_id;
-}
-
-struct VBlobMRUCache { /* read-only blob cache */
-    BSTree cache;
-    DLList lru;
-    size_t capacity;
-    size_t contents;
-    /* last blob cache */
-    VBlob *last[LAST_BLOB_CACHE_SIZE]; /** last 4 blob to be cached per given col_idx, limiting col_idx  **/
-};
-
-
-VBlobMRUCache * VBlobMRUCacheMake(uint64_t capacity )
-{
-    VBlobMRUCache *self = NULL;
-    if(capacity > 0){
-	self = malloc(sizeof(*self));
-        if(self){
-		BSTreeInit ( & self -> cache);
-		DLListInit ( & self -> lru );
-		memset(self -> last,0,LAST_BLOB_CACHE_SIZE*sizeof(*self -> last));
-		self->capacity = capacity;
-		self->contents = 0;
-	}
-   }
-   return self;
-}
-
-void VBlobMRUCacheDestroy( VBlobMRUCache *self )
-{
-    if(self){
-	int i;
-	BSTreeWhack ( & self -> cache, VBlobCacheWhack, NULL );
-	DLListInit ( & self -> lru );
-	for(i=0;i<LAST_BLOB_CACHE_SIZE;i++){
-		if(self -> last[i]) {
-		    VBlobRelease(self -> last[i]);
-		    self->last[i] = NULL;
-		}
-	}
-	free(self);
-    }
-}
-
-const VBlob* VBlobMRUCacheFind(const VBlobMRUCache *cself, uint32_t col_idx, int64_t row_id)
-{
-    const VBlob* blob;
-    VBlobCache *bc;
-    VBlobCacheKey bck;
-    VBlobMRUCache *self = (VBlobMRUCache*)cself;
-
-    /* check MRU blob */
-    if(col_idx <= LAST_BLOB_CACHE_SIZE)
-    {
-	blob = self->last[col_idx-1];
-	if(blob && row_id >= blob->start_id && row_id <= blob->stop_id)
-	{
-	    return blob;
-		
-	}
-    }
-
-    /* check cache for entry */
-    bck . row_id = row_id;
-    bck . col_idx = col_idx;
-    bc = ( VBlobCache* ) BSTreeFind ( & self -> cache, & bck, VBlobCacheCmp );
-    if ( bc != NULL )
-    {
-        /* save in MRU */
-        if(col_idx <= LAST_BLOB_CACHE_SIZE)
-        {
-            if(self->last[col_idx-1])
-                VBlobRelease(self->last[col_idx-1]);
-            self->last[col_idx-1] = (VBlob*)bc->blob;
-            if(VBlobAddRef (self->last[col_idx-1])!=0)
-		return NULL;
-        }
-        /* maintain LRU */
-        DLListUnlink  (&self->lru,&bc->ln);
-        DLListPushHead(&self->lru,&bc->ln);
-        /* ask column to read from blob */
-        return bc->blob;
-    }
-    return NULL;
-}
-rc_t VBlobMRUCacheSave(const VBlobMRUCache *cself, uint32_t col_idx, const VBlob *blob)
-{
-    rc_t   rc;
-    size_t blob_size =sizeof(VBlobCache) + sizeof(VBlob);
-    VBlobCache *bc=NULL;
-    VBlobMRUCache *self = (VBlobMRUCache*)cself;
-
-    if(blob->no_cache) return 0;
-
-    blob_size  += KDataBufferBytes(&blob->data);
-    if (blob->pm != NULL) {
-        blob_size += 
-                  KDataBufferBytes(&blob->pm->cstorage)
-                + KDataBufferBytes(&blob->pm->dstorage)
-                + KDataBufferBytes(&blob->pm->istorage);
-    }
-    /** auto-raise capacity for large blob **/
-    if(blob_size > self -> capacity) self -> capacity = blob_size;
-
-    /* now cache the blob */
-    rc = VBlobCacheMake ( & bc, blob, col_idx, blob_size );
-    if ( rc == 0 ) {
-        /* attempt a unique insertion */
-        VBlobCache *existing;
-        rc = BSTreeInsertUnique ( &self -> cache, & bc -> bn, ( BSTNode** ) & existing, VBlobCacheSort );
-        if ( rc != 0 ){
-            VBlobCacheWhack ( & bc -> bn, NULL );
-	    rc = 0;
-        } else {
-            /* remember as last used  **/
-            if(col_idx <= LAST_BLOB_CACHE_SIZE)
-            {
-		if(self->last[col_idx-1])
-			VBlobRelease(self->last[col_idx-1]);
-		self->last[col_idx-1] = (VBlob*)bc->blob;
-		rc = VBlobAddRef (self->last[col_idx-1]);
-		if(rc != 0)
-		   return rc;
-	    }
-            /* perform accounting */
-            self -> contents += blob_size;
-            while ( self -> contents > self -> capacity )
-            {
-                /* get least recently used */
-                DLNode *last = DLListPopTail ( & self -> lru );
-                if ( last == NULL )
-                    break;
-
-                /* drop blob */
-                existing = ( VBlobCache* ) ( ( char* ) last - sizeof existing -> bn );
-
-                BSTreeUnlink ( & self -> cache, & existing -> bn );
-                self -> contents -= existing -> size;
-                VBlobCacheWhack ( & existing -> bn, NULL );
-            }
-
-            /* insert at head of list */
-            DLListPushHead ( & self -> lru, & bc -> ln );
-        }
-    }
-    return 0;
-}
-
diff --git a/libs/vdb/blob.h b/libs/vdb/blob.h
deleted file mode 100644
index 860e7c8..0000000
--- a/libs/vdb/blob.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_blob_
-#define _h_blob_
-
-#ifndef _h_vdb_extern_
- #include <vdb/extern.h>
-#endif
-
-#ifndef _h_blob_priv_
- #include "blob-priv.h"
-#endif
-
-struct VBlobBuffer;
-struct VRowBuffer;
-
-enum VBlobVariant_t {
-    vbvBlobbed,
-    vbvRowBuffer,
-    vbvSingleRow
-};
-
-
-/* Write the row lengths for the rows from start_id thru stop_id, inclusive
- */
-rc_t VBlobWritePageMap( VBlob *self, int64_t start_id, int64_t stop_id, const uint32_t row_length[] );
-
-/* Read (copy out) the row lengths for the rows from start_id thru stop_id, inclusive
- */
-rc_t VBlobReadPageMap( const VBlob *self, int64_t start_id, int64_t stop_id, uint32_t row_length[] );
-
-/* Change the shape of the databuffer.
- *
- * This function does not resize the buffer; it changes how it is
- * interpreted, i.e. it is a typecast.
- * The quantity ((bits per element) * (# elements)) remains the same.
- *
- * new bits = bits * bits_mult / bits_div
- * new #elements = #elements * bits_div / bits_mult
- * 
- */
-rc_t VBlobBufferReshape( struct VBlobBuffer *self, int bits_mult, int bits_div );
-
-/* Turn a raw blob into a page buffer
- *
- * This is essentially a type-cast.
- */
-rc_t VBlobMakeRowBuffer( struct VRowBuffer **lhs,
-                         const VBlob *cself
-);
-
-/* Serialize
- *
- * Get a blob serialized into a new data buffer.
- * Whack this when done with it.
- */
-rc_t VBlobSerialize(const VBlob *cself, KDataBuffer *result);
-
-
-#endif /* _h_blob_ */
diff --git a/libs/vdb/cast.c b/libs/vdb/cast.c
deleted file mode 100644
index 0718ec9..0000000
--- a/libs/vdb/cast.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h> 
-
-#include "xform-priv.h"
-#include "blob-priv.h"
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <arch-impl.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <float.h>
-#include <string.h>
-#include <assert.h>
-
-/* copy
- *  just perform an addref on input blob
- */
-static
-rc_t CC copy ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    * rslt = ( VBlob* ) argv [ 0 ];
-    (void)VBlobAddRef (*rslt );
-    return 0;
-}
-
-/* casting object
- *  uses a three-step process for converting:
- *  1. read source into canonical fmt
- *  2. convert domains as required
- *  3. write from canonical fmt to dest
- */
-typedef struct Cast Cast;
-struct Cast
-{
-    /* read source to canonical fmt */
-    union
-    {
-        int ( * num ) ( const void *src, void *dst );
-        int ( * chr ) ( uint32_t *ch, const void *begin, const void *end );
-    } read;
-
-    /* transform from one domain to another */
-    union
-    {
-        rc_t ( * num ) ( const void *src, void *dst );
-    } convert;
-
-    /* write from canonical fmt to destination */
-    union
-    {
-        int ( * num ) ( const void *src,  void *dst );
-        int ( * chr ) ( void *begin, void *end, uint32_t ch );
-    } write;
-
-    /* intrinsic dim of source */
-    uint32_t intrinsic_dim;
-
-    /* intrinsic sizes of src and dst */
-    uint32_t src_bits, dst_bits;
-};
-
-static
-rc_t CC cast_num ( void *data, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count )
-{
-    const Cast *self = ( const void* ) data;
-
-    /* since we are performing intrinsic-level operations,
-       convert the array length into intrinsic count */
-    uint32_t i;
-    uint64_t count = elem_count * self -> intrinsic_dim;
-
-    /* treat source and destination as byte pointers */
-    int bytes;
-    uint8_t *dp = dst;
-    const uint8_t *sp = src;
-
-    /* read and conversion buffers */
-    union { int64_t i64; uint64_t u64; double f64; } buff [ 2 ];
-
-    /* loop without conversion */
-    if ( self -> convert . num == NULL )
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            /* read into canonical fmt */
-            bytes = ( * self -> read . num ) ( sp, & buff [ 0 ] );
-            sp += bytes;
-
-            /* write into destination fmt */
-            bytes = ( * self -> write . num ) ( & buff [ 0 ], dp );
-            if ( bytes < 0 )
-                return RC ( rcVDB, rcType, rcCasting, rcRange, rcExcessive );
-            dp += bytes;
-        }
-    }
-
-    /* loop with conversion */
-    else
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            rc_t rc;
-
-            /* read into canonical fmt */
-            bytes = ( * self -> read . num ) ( sp, & buff [ 0 ] );
-            sp += bytes;
-
-            /* convert domains */
-            rc = ( * self -> convert . num ) ( & buff [ 0 ], & buff [ 1 ] );
-            if ( rc != 0 )
-                return rc;
-
-            /* write into destination fmt */
-            bytes = ( * self -> write . num ) ( & buff [ 1 ], dp );
-            if ( bytes < 0 )
-                return RC ( rcVDB, rcType, rcCasting, rcRange, rcExcessive );
-            dp += bytes;
-        }
-    }
-
-    return 0;
-}
-
-static
-rc_t resize_dst ( KDataBuffer *dst, uint8_t **dpos, uint8_t **dend,
-    const uint8_t *sbase, const uint8_t *spos, const uint8_t *send )
-{
-    size_t offset = * dpos - ( uint8_t* ) dst -> base;
-    double expand = ( double ) ( send - sbase ) / ( spos - sbase );
-    rc_t rc = KDataBufferResize ( dst, ( uint32_t ) ( expand * offset ) + 32 );
-    if ( rc == 0 )
-    {
-        * dpos = & ( ( uint8_t* ) dst -> base ) [ offset ];
-        * dend = & ( ( uint8_t* ) dst -> base ) [ dst -> elem_count ];
-    }
-    return rc;
-}
-
-static
-rc_t CC cast_chr ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const Cast *self = ( const void* ) data;
-
-    int bytes;
-    uint32_t buff [ 2 ];
-    uint8_t *dpos, *dend;
-    const uint8_t *sbase, *spos, *send;
-
-    /* determine source boundaries */
-    sbase = argv [ 0 ] . u . data . base;
-    sbase += (size_t)argv [ 0 ] . u . data . first_elem *
-        argv [ 0 ] . u . data . elem_bits >> 3;
-    send = & sbase [ (size_t)argv [ 0 ] . u . data . elem_count *
-        argv [ 0 ] . u . data . elem_bits >> 3 ];
-    spos = sbase;
-
-    /* resize the destination blob */
-    rc = KDataBufferCast ( rslt -> data, rslt -> data, 8, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( rslt -> data, (uint32_t)( send - sbase ) );
-    if ( rc != 0 )
-        return rc;
-
-    /* get the destination boundaries */
-    dpos = rslt -> data -> base;
-    dend = dpos + rslt -> data -> elem_count;
-    assert ( rslt -> data -> bit_offset == 0 );
-
-    while ( spos < send )
-    {
-        /* read into utf32 */
-        bytes = ( * self -> read . chr ) ( & buff [ 0 ], spos, send );
-        if ( bytes <= 0 )
-            return RC ( rcVDB, rcType, rcCasting, rcData, rcCorrupt );
-        spos += bytes;
-
-        /* write into destination */
-        bytes = ( * self -> write . chr ) ( dpos, dend, buff [ 0 ] );
-        if ( bytes <= 0 )
-        {
-            if ( bytes < 0 )
-                return RC ( rcVDB, rcType, rcCasting, rcData, rcCorrupt );
-            rc = resize_dst ( rslt -> data, & dpos, & dend, sbase, spos, send );
-            if ( rc != 0 )
-                return rc;
-        }
-        dpos += bytes;
-    }
-
-    /* return the number of elements and reset the data buffer */
-    rslt -> elem_count = ( uint32_t ) ( dpos - ( uint8_t* ) rslt -> data -> base );
-    if ( rslt -> elem_bits > 8 )
-        rslt -> elem_count /= rslt -> elem_bits >> 3;
-
-    return 0;
-}
-
-/* read_num
- *  numeric readers convert size
- */
-#define READ_NUM( S, D ) \
-static int read_ ## S ( const void *src, void *dst ) \
-{ * ( D* ) dst = * ( const S* ) src; return sizeof ( S ); }
-
-READ_NUM ( int8_t, int64_t )
-READ_NUM ( int16_t, int64_t )
-READ_NUM ( int32_t, int64_t )
-READ_NUM ( int64_t, int64_t )
-
-READ_NUM ( uint8_t, uint64_t )
-READ_NUM ( uint16_t, uint64_t )
-READ_NUM ( uint32_t, uint64_t )
-READ_NUM ( uint64_t, uint64_t )
-
-READ_NUM ( float, double )
-READ_NUM ( double, double )
-
-typedef int ( * read_num_func ) ( const void*, void* );
-static read_num_func read_num_tbl [] =
-{
-    read_uint8_t, read_uint16_t, read_uint32_t, read_uint64_t,
-    read_int8_t, read_int16_t, read_int32_t, read_int64_t,
-    NULL, NULL, read_float, read_double
-};
-
-/* write_num
- *  numeric writers convert size and check limit
- */
-#define WRITE_NUM( S, D ) \
-static int write_ ## D ( const void *src, void *dst ) \
-{ * ( D* ) dst = * ( const S* ) src; return sizeof ( D ); }
-
-#define WRITE_SNUM( S, D, PLIM, NLIM ) \
-static int write_ ## D ( const void *src, void *dst ) \
-{ \
-    S s = * ( const S* ) src; \
-    if ( s > PLIM || s < NLIM ) \
-        return -1; \
-    * ( D* ) dst = ( D )s; \
-    return sizeof ( D ); \
-}
-
-#define WRITE_UNUM( S, D, LIM ) \
-static int write_ ## D ( const void *src, void *dst ) \
-{ \
-    S s = * ( const S* ) src; \
-    if ( s > LIM ) \
-        return -1; \
-    * ( D* ) dst = ( D )s; \
-    return sizeof ( D ); \
-}
-
-WRITE_SNUM ( int64_t, int8_t, INT8_MAX, INT8_MIN )
-WRITE_SNUM ( int64_t, int16_t, INT16_MAX, INT16_MIN )
-WRITE_SNUM ( int64_t, int32_t, INT32_MAX, INT32_MIN )
-WRITE_NUM ( int64_t, int64_t )
-
-WRITE_UNUM ( uint64_t, uint8_t, UINT8_MAX )
-WRITE_UNUM ( uint64_t, uint16_t, UINT16_MAX )
-WRITE_UNUM ( uint64_t, uint32_t, UINT32_MAX )
-WRITE_NUM ( uint64_t, uint64_t )
-
-WRITE_SNUM ( double, float, FLT_MAX, FLT_MIN )
-WRITE_NUM ( double, double )
-
-typedef int ( * write_num_func ) ( const void*, void* );
-static write_num_func write_num_tbl [] =
-{
-    write_uint8_t, write_uint16_t, write_uint32_t, write_uint64_t,
-    write_int8_t, write_int16_t, write_int32_t, write_int64_t,
-    NULL, NULL, write_float, write_double
-};
-
-/* convert_num
- */
-static
-rc_t convert_int ( const void *src, void *dst )
-{
-    if ( ( * ( int64_t* ) dst = * ( const int64_t* ) src ) < 0 )
-        return RC ( rcVDB, rcType, rcCasting, rcRange, rcExcessive );
-    return 0;
-}
-
-static
-rc_t convert_int_float ( const void *src, void *dst )
-{ * ( double* ) dst = * ( const int64_t* ) src; return 0; }
-
-static
-rc_t convert_uint_float ( const void *src, void *dst )
-{ * ( double* ) dst = * ( const uint64_t* ) src; return 0; }
-
-static
-rc_t convert_float_int ( const void *src, void *dst )
-{
-    double d = * ( const double* ) src;
-    if ( d > INT64_MAX || d < INT64_MIN )
-        return RC ( rcVDB, rcType, rcCasting, rcRange, rcExcessive );
-    * ( int64_t* ) dst = ( int64_t ) d;
-    return 0;
-}
-
-static
-rc_t convert_float_uint ( const void *src, void *dst )
-{
-    double d = * ( const double* ) src;
-    if ( d > UINT64_MAX )
-        return RC ( rcVDB, rcType, rcCasting, rcRange, rcExcessive );
-    * ( uint64_t* ) dst = ( uint64_t ) d;
-    return 0;
-}
-
-typedef rc_t ( * convert_num_func ) ( const void*, void* );
-static convert_num_func convert_num_tbl [] =
-{
-    /* unsigned integer conversion */
-    NULL, convert_int, convert_uint_float,
-    /* signed integer conversion */
-    convert_int, NULL, convert_int_float,
-    /* floating point conversion */
-    convert_float_int, convert_float_uint, NULL
-};
-
-
-/* read_chr
- *  characters readers convert size and encoding
- */
-static int read_ascii ( uint32_t *ch,  const void *begin, const void *end )
-{
-    char s;
-    if ( ( const char* ) begin >= ( const char* ) end )
-        return 0;
-    s = * ( const char* ) begin;
-    if ( s < 0 )
-        return -1;
-    * ch = s;
-    return 1;
-}
-
-#define read_utf8 \
-    ( int ( * ) ( uint32_t*, const void*, const void* ) ) utf8_utf32
-
-static int read_utf16 ( uint32_t *ch, const void *begin, const void *end )
-{
-    if ( ( const uint16_t* ) begin >= ( const uint16_t* ) end )
-        return 0;
-    /* yes, I know this is wrong - but don't blame me
-       that the UNICODE folks can't produce a uni-code
-       character with 16 bits... ( GO, KLINGON! ) */
-    * ch = * ( const uint16_t* ) begin;
-    return 2;
-}
-
-static int read_utf32 ( uint32_t *ch, const void *begin, const void *end )
-{
-    if ( ( const uint32_t* ) begin >= ( const uint32_t* ) end )
-        return 0;
-    * ch = * ( const uint32_t* ) begin;
-    return 4;
-}
-
-typedef int ( * read_chr_func ) ( uint32_t*, const void*, const void* );
-static read_chr_func read_chr_tbl [] =
-{
-    /* ascii reads */
-    read_ascii, NULL, NULL,
-    /* unicode reads */
-    read_utf8, read_utf16, read_utf32
-};
-
-/* write_chr
- *  character writers convert size and encoding
- */
-static int write_ascii ( void *begin, void *end, uint32_t ch )
-{
-    if ( ( char* ) begin >= ( char* ) end )
-        return 0;
-    * ( char* ) begin = ( ch >= 128 ) ? '.' : ( char ) ch;
-    return 1;
-}
-
-#define write_utf8 \
-    ( int ( * ) ( void*, void*, uint32_t ) ) utf32_utf8
-
-static int write_utf16 ( void *begin, void *end, uint32_t ch )
-{
-    if ( ( uint16_t* ) begin >= ( uint16_t* ) end )
-        return 0;
-    if ( ch >= 0x10000 )
-        return -1;
-    * ( uint16_t* ) begin = ( uint16_t ) ch;
-    return 2;
-}
-
-static int write_utf32 ( void *begin, void *end, uint32_t ch )
-{
-    if ( ( uint32_t* ) begin >= ( uint32_t* ) end )
-        return 0;
-    * ( uint32_t* ) begin = ch;
-    return 4;
-}
-
-typedef int ( * write_chr_func ) ( void*, void*, uint32_t );
-static write_chr_func write_chr_tbl [] =
-{
-    /* ascii writes */
-    write_ascii, NULL, NULL,
-    /* unicode writes */
-    write_utf8, write_utf16, write_utf32
-};
-
-
-/* cast
- *  this operation is equivalent to a C forced cast, as it allows
- *  reinterpretation of data both in size and type, although
- *  it does not convert text to integer or vice-versa...
- */
-static
-rc_t make_self ( VFuncDesc *rslt, Cast **fself )
-{
-    * fself = calloc ( 1, sizeof ** fself );
-    if ( * fself == NULL )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    rslt -> self = * fself;
-    rslt -> whack = free;
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_cast, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    Cast *fself;
-    int32_t src_size_idx, dst_size_idx;
-
-    /* cast cannot change intrinsic dimension. it is tempting to
-       consider the ability to cast B1[8] to U8[1], but then what
-       would it mean to cast B1[1] to U8[1] or B1[8] to U8[8] ? */
-    if ( info -> fdesc . desc . intrinsic_dim != dp -> argv [ 0 ] . desc . intrinsic_dim )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* cast is often used to ensure a source has a given type
-       meaning that in many cases no cast is required */
-    if ( info -> fdesc . desc . domain == dp -> argv [ 0 ] . desc . domain )
-    {
-        if ( info -> fdesc . desc . intrinsic_bits == dp -> argv [ 0 ] . desc . intrinsic_bits )
-        {
-            /* input and output are already binary compatible */
-            rslt -> variant = vftBlobN;
-            VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = copy;
-            return 0;
-        }
-    }
-
-    src_size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits );
-    dst_size_idx = uint32_lsbit ( info -> fdesc . desc . intrinsic_bits );
-
-    /* numeric <-> numeric casts are supported */
-    if ( info -> fdesc . desc . domain >= vtdUint &&
-         info -> fdesc . desc . domain <= vtdFloat &&
-         dp -> argv [ 0 ] . desc . domain >= vtdUint &&
-         dp -> argv [ 0 ] . desc . domain <= vtdFloat )
-    {
-
-        /* byte-aligned offsets will be values 3..6
-           values < 3 are not byte-aligned
-           values > 6 are >= 128 bits and not handled */
-        if ( src_size_idx >= 3 && src_size_idx <= 6 &&
-             dst_size_idx >= 3 && dst_size_idx <= 6 )
-        {
-            rc = make_self ( rslt, & fself );
-            if ( rc != 0 )
-                return rc;
-
-            /* get reader */
-            fself -> read . num = read_num_tbl
-                [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + src_size_idx - 3 ];
-            if ( fself -> read . num != NULL )
-            {
-                /* get writer */
-                fself -> write . num = write_num_tbl
-                    [ ( info -> fdesc . desc . domain - vtdUint ) * 4 + dst_size_idx - 3 ];
-                if ( fself -> write . num != NULL )
-                {
-                    /* get optional converter */
-                    fself -> convert . num = convert_num_tbl
-                        [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * ( vtdFloat - vtdUint + 1 ) +
-                          info -> fdesc . desc . domain - vtdUint ];
-
-                    /* set intrinsic dimension */
-                    fself -> intrinsic_dim = info -> fdesc . desc . intrinsic_dim;
-
-                    /* done */
-                    rslt -> u . af = cast_num;
-                    rslt -> variant = vftArray;
-                    return 0;
-                }
-            }
-
-            free ( fself );
-            rslt -> whack = NULL;
-        }
-    }
-
-    /* text <-> text casts are supported */
-    if ( info -> fdesc . desc . domain >= vtdAscii &&
-         info -> fdesc . desc . domain <= vtdUnicode &&
-         dp -> argv [ 0 ] . desc . domain >= vtdAscii &&
-         dp -> argv [ 0 ] . desc . domain <= vtdUnicode )
-    {
-        if ( src_size_idx >= 3 && src_size_idx <= 5 &&
-             dst_size_idx >= 3 && dst_size_idx <= 5 )
-        {
-            rc = make_self ( rslt, & fself );
-            if ( rc != 0 )
-                return rc;
-
-            /* get reader */
-            fself -> read . chr = read_chr_tbl
-                [ ( dp -> argv [ 0 ] . desc . domain - vtdAscii ) * 3 + src_size_idx - 3 ];
-            if ( fself -> read . chr != NULL )
-            {
-                /* get writer */
-                fself -> write . chr = write_chr_tbl
-                    [ ( info -> fdesc . desc . domain - vtdAscii ) * 4 + dst_size_idx - 3 ];
-                if ( fself -> write . chr != NULL )
-                {
-                    /* set source and dest sizes */
-                    fself -> src_bits = 1 << src_size_idx;
-                    fself -> dst_bits = 1 << dst_size_idx;
-
-                    /* done */
-                    rslt -> u . rf = cast_chr;
-                    rslt -> variant = vftRow;
-                    return 0;
-                }
-            }
-
-            free ( fself );
-            rslt -> whack = NULL;
-        }
-    }
-
-    /* everything else is unsupported */
-    return RC ( rcVDB, rcFunction, rcConstructing, rcFunction, rcUnsupported );
-}
diff --git a/libs/vdb/column-cmn.c b/libs/vdb/column-cmn.c
deleted file mode 100644
index 5df824d..0000000
--- a/libs/vdb/column-cmn.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-#define USE_KURT 1
-
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "column-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "prod-priv.h"
-#include "blob-priv.h"
-#include "page-map.h"
-#undef KONST
-
-#include <vdb/manager.h>
-#include <kdb/column.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VColumn
- */
-
-/* Whack
- */
-void VColumnDestroy ( VColumn *self )
-{
-#if PROD_REFCOUNT && ! PROD_ALL_IN_CURSOR
-    PROD_TRACK_REFCOUNT (VProductionRelease,self->in);
-    VProductionRelease ( self -> in, NULL ); 
-#endif
-#if USE_KURT
-    VBlobRelease ( self -> cache );
-#endif
-    VSchemaSever ( self -> schema );
-}
-
-
-/* Cmp
- * Sort
- */
-int CC VColumnCmp ( const void *item, const void *n )
-{
-    const VColumn *b = n;
-    return SColumnSort ( item, b -> scol );
-}
-
-int CC VColumnSort ( const void *item, const void *n )
-{
-    const VColumn *a = item;
-    const VColumn *b = n;
-    return SColumnSort ( a -> scol, b -> scol );
-}
-
-
-/* IdRange
- *  returns id range for column or page
- */
-rc_t VColumnIdRangeRead ( const VColumn *self, int64_t *first, int64_t *last )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-    assert ( first != NULL && last != NULL );
-
-    if ( self -> in == NULL )
-        rc = RC ( rcVDB, rcColumn, rcAccessing, rcRange, rcNotOpen );
-    else
-    {
-        /* a little silly, but set max range in 64-bit
-           without complaints from 32-bit compilers */
-        * first = 1;
-        * first <<= 63;
-        * last = ~ * first;
-
-        /* now intersect this range with all physical sources */
-        rc = VProductionColumnIdRange ( self -> in, first, last );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    * first = * last = 0;
-
-    return rc;
-}
-
-rc_t VColumnPageIdRange ( const VColumn *self, int64_t id, int64_t *first, int64_t *last )
-{
-    rc_t rc;
-
-    assert ( self != NULL );
-    assert ( first != NULL && last != NULL );
-
-    if ( self -> in == NULL )
-        rc = RC ( rcVDB, rcColumn, rcAccessing, rcRange, rcNotOpen );
-    else
-    {
-        /* try to find page and get its range */
-        rc = VProductionPageIdRange ( self -> in, id, first, last );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    * first = * last = 0;
-
-    return rc;
-}
-
-
-/* Datatype
- *  returns typedecl and/or typedef for column data
- *
- *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
- *
- *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
- *  returned in "type_decl"
- *
- * NB - one of "type" and "def" must be non-NULL
- */
-rc_t VColumnDatatype ( const VColumn *self, VTypedecl *type, VTypedesc *desc )
-{
-    assert ( self != NULL );
-    assert ( type != NULL || desc != NULL );
-
-    if ( type != NULL )
-        * type = self -> td;
-
-    if ( desc != NULL )
-        * desc = self -> desc;
-
-    return 0;
-}
-
-/* Init - PRIVATE
- */
-rc_t VColumnInit ( VColumn *self, const VSchema *schema, const SColumn *scol )
-{
-    rc_t rc = VSchemaDescribeTypedecl ( schema, & self -> desc, & scol -> td );
-    if ( rc == 0 )
-    {
-        self -> schema = VSchemaAttach ( schema );
-        self -> scol = scol;
-        self -> td = scol -> td;
-        self -> read_only = scol -> read_only;
-    }
-    return rc;
-}
-
-
-/* Make - PRIVATE
- *  make a read column
- */
-rc_t VColumnMake ( VColumn **colp, const VSchema *schema, const SColumn *scol )
-{
-    rc_t rc;
-    VColumn *col;
-
-    assert ( colp != NULL );
-    assert ( schema != NULL );
-
-    col = calloc ( 1, sizeof * col );
-    if ( col == NULL )
-        rc = RC ( rcVDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = VColumnInit ( col, schema, scol );
-        if ( rc == 0 )
-        {
-            col -> read_only = true;
-            * colp = col;
-            return 0;
-        }
-
-        free ( col );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-rc_t VColumnReadCachedBlob ( const VColumn *self, const VBlob *vblob, int64_t row_id,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    uint64_t start;
-
-    * elem_bits = VTypedescSizeof ( & self -> desc );
-    * row_len = PageMapGetIdxRowInfo ( vblob -> pm, ( uint32_t ) ( row_id - vblob -> start_id ), boff );
-    start = ( uint64_t ) boff [ 0 ] * elem_bits [ 0 ];
-    * base = ( uint8_t* ) vblob -> data . base + ( start >> 3 );
-    * boff = ( uint32_t ) start & 7;
-
-    return 0;
-}
-
-rc_t VColumnReadBlob ( const VColumn *cself, const VBlob **vblobp, int64_t row_id,
-   uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len, VBlobMRUCacheCursorContext *cctx )
-{
-    rc_t rc;
-
-    if ( cself -> in == NULL )
-        rc = RC ( rcVDB, rcColumn, rcReading, rcColumn, rcNotOpen );
-    else
-    {
-        VBlob *vblob;
-        rc = VProductionReadBlob ( cself -> in, & vblob, row_id, 1, cctx );
-        if ( rc == 0 )
-        {
-            VColumn *self = ( VColumn* ) cself;
-            VColumnReadCachedBlob ( self, vblob, row_id, elem_bits, base, boff, row_len );
-
-#if USE_KURT
-            TRACK_BLOB ( VBlobRelease, self -> cache );
-            ( void ) VBlobRelease ( self -> cache );
-
-            if ( VBlobAddRef ( vblob ) != 0 )
-                self -> cache = NULL;
-            else
-                self -> cache = vblob;
-#endif
-
-            * vblobp = vblob;
-        }
-    }
-
-    return rc;
-}
-
-rc_t VColumnRead ( const VColumn *cself, int64_t row_id,
-   uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len,
-   VBlob **vblob)
-{
-    rc_t rc;
-    VBlob *dummy = NULL;
-    if (vblob == NULL)
-    {   vblob = &dummy; }
-
-    if ( cself -> in == NULL )
-        rc = RC ( rcVDB, rcColumn, rcReading, rcColumn, rcNotOpen );
-    else
-    {
-        rc = VProductionReadBlob ( cself -> in, vblob, row_id, 1, NULL );
-        if ( rc == 0 )
-        {
-            VColumn *self = ( VColumn* ) cself;
-            VColumnReadCachedBlob ( self, *vblob, row_id, elem_bits, base, boff, row_len );
-
-#if USE_KURT
-            TRACK_BLOB ( VBlobRelease, self -> cache );
-            ( void ) VBlobRelease ( self -> cache );
-            self -> cache = *vblob;
-#else
-            TRACK_BLOB ( VBlobRelease, *vblob );
-            ( void ) VBlobRelease ( *vblob );
-            *vblob = NULL;
-#endif
-        }
-    }
-
-    return rc;
-}
-
-/* IsStatic
- *  answers question: "does this column have the same value for every cell?"
- */
-rc_t VColumnIsStatic ( const VColumn *self, bool *is_static )
-{
-    if ( self != NULL )
-        return VProductionIsStatic ( self -> in, is_static );
-    
-    assert ( is_static != NULL );
-    * is_static = false;
-
-    return RC ( rcVDB, rcColumn, rcAccessing, rcSelf, rcNull );
-}
diff --git a/libs/vdb/column-priv.h b/libs/vdb/column-priv.h
deleted file mode 100644
index 2dd451f..0000000
--- a/libs/vdb/column-priv.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_column_priv_
-#define _h_column_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_data_buffer_
-#include <klib/data-buffer.h>
-#endif
-
-#include <os-native.h>
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VDBManager;
-struct VSchema;
-struct SColumn;
-struct SExpression;
-struct VProduction;
-struct VBlob;
-struct VBlobMRUCacheCursorContext;
-
-
-/*--------------------------------------------------------------------------
- * VColumn
- *  externally visible column object
- */
-typedef struct VColumn VColumn;
-struct VColumn
-{
-    /* for type queries */
-    struct VSchema const *schema;
-
-    /* typed column */
-    struct SColumn const *scol;
-
-    /* read production */
-    struct VProduction *in;
-
-    /* cached output */
-    struct VBlob *cache;
-
-    /* type information */
-    VTypedecl td;
-    VTypedesc desc;
-
-    /* vector ids */
-    uint32_t ord;
-
-    bool read_only;
-    uint8_t align [ 3 ];
-};
-
-void CC VColumnWhack ( void *item, void *curs );
-void VColumnDestroy ( VColumn *self );
-rc_t VColumnInit ( VColumn *self,
-    struct VSchema const *schema, struct SColumn const *scol );
-
-int CC VColumnCmp ( const void *item, const void *n );
-int CC VColumnSort ( const void *item, const void *n );
-
-rc_t VColumnMake ( VColumn **col,
-    struct VSchema const *schema, struct SColumn const *scol );
-
-rc_t VColumnIdRange ( const VColumn *self,
-    int64_t *first, int64_t *last );
-rc_t VColumnIdRangeRead ( const VColumn *self,
-    int64_t *first, int64_t *last );
-rc_t VColumnPageIdRange ( const VColumn *self,
-    int64_t id, int64_t *first, int64_t *last );
-
-rc_t VColumnDatatype ( const VColumn *self,
-    struct VTypedecl *type, struct VTypedesc *desc );
-
-rc_t VColumnRead ( const VColumn *self, int64_t row_id,
-   uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len,
-   struct VBlob **vblob );
-
-rc_t VColumnReadBlob ( const VColumn *self, struct VBlob const **blob, int64_t row_id,
-   uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len, struct VBlobMRUCacheCursorContext *cctx);
-
-rc_t VColumnReadCachedBlob ( const VColumn *self, struct VBlob const *blob, int64_t row_id,
-   uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len );
-
-rc_t VColumnIsStatic ( const VColumn *self, bool *is_static );
-
-/*--------------------------------------------------------------------------
- * WColumn
- *  column with input buffer
- */
-typedef struct WColumn WColumn;
-struct WColumn
-{
-    VColumn dad;
-
-    /* half-closed range of buffered rows */
-    int64_t start_id, end_id;
-
-    /* half-closed id for page cutoff */
-    int64_t cutoff_id;
-
-    /* alternate read production */
-    struct VProduction *alt;
-
-    /* validate production */
-    struct VProduction *val;
-
-    /* write production */
-    struct VProduction *out;
-
-    /* output page */
-    struct VBlob *page;
-
-    /* default row data */
-    KDataBuffer dflt;
-
-    /* accumulators */
-    KDataBuffer data, rowmap;
-
-    /* peak byte size history of data accumulator */
-    size_t data_peak_hist [ 16 ];
-    size_t data_peak;
-
-    /* total committed bits in buffer */
-    bitsz_t bits_in_buffer;
-
-    /* number of uncommitted bits in buffer */
-    bitsz_t row_len;
-
-    /* size ( in bytes ) to trigger page commit */
-    size_t trigger;
-
-    /* number of committed rows in buffer */
-    size_t num_rows;
-
-    /* peak history index */
-    uint8_t peak_hist_idx;
-
-    /* true if there is a default value */
-    bool have_dflt;
-
-    /* set upon any successful write */
-    bool row_written;
-
-    /* set if the last row written was default */
-    bool dflt_last;
-
-    /* set upon row commit */
-    bool row_committed;
-};
-
-/* WColumnRowMap
- */
-typedef struct WColumnRowMap WColumnRowMap;
-struct WColumnRowMap
-{
-    int64_t start_id;
-    uint64_t len, cnt;
-};
-
-rc_t WColumnMake ( VColumn **col, struct VSchema const *schema,
-    struct SColumn const *scol, struct SExpression const *dflt_limit,
-    struct VDBManager *mgr );
-
-rc_t WColumnSetDefault ( VColumn *self,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t len );
-rc_t WColumnWrite ( VColumn *self,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t len );
-
-/* OpenRow
- *  update state
- *
- *  "const_row_id" [ IN, CONST ] - id of row being opened. useful
- *  only on initial open when no other rows are buffered.
- */
-void CC WColumnOpenRow ( void *self, void *const_row_id );
-
-/* RowDefaults
- *  if a row has not been written but has a default value,
- *  that value is written to the row. if no default exists,
- *  an error is generated.
- *
- *  "rc" [ OUT, DEFAULT ZERO ] - preset to 0
- *
- *  returns true if any error occurs ( i.e. "*rc != 0" )
- */
-bool CC WColumnRowDefaults ( void *self, void *rc );
-
-/* CommitRow
- *  closes the row to further writes and accepts
- *  all data written so far as complete. if the accumulated
- *  page data trigger a flush, the flush parameter is set.
- *
- *  "end_id" [ IN/OUT ] - used to calculate the minimum
- *  end_id for pages. if the column decides that it has too
- *  much data in its buffer and wants a cutoff < current
- *  value, it can lower the id.
- *
- *  returns true if there was a memory error.
- */
-bool CC WColumnCommitRow ( void *self, void *end_id );
-
-/* RepeatRow
- *  go into the last row entry
- *  extend the count by count
- *  data points to this structure
- */
-typedef struct { int64_t end_id; uint64_t count; } WColumnRepeatRowData;
-void CC WColumnRepeatRow ( void *self, void *data );
-
-/* CloseRow
- *  discards uncommitted data
- *  update state
- */
-void CC WColumnCloseRow ( void *self, void *ignore );
-
-/* BufferPage
- *  captures page range
- *
- *  "end_id" [ IN, CONST ] - half-closed id of buffered range end
- *  column should capture this information for creating page
- *  id range either on demand, or pre-prepared.
- *
- *  returns true if there was a memory error.
- */
-bool CC WColumnBufferPage ( void *self, void *const_end_id );
-
-/* DropPage
- *  drops all rows associated with committed page
- */
-void CC WColumnDropPage ( void *self, void *ignore );
-
-/* ReadBlob
- *  reads an input blob
- *  returns a blob with all rows in commit range
- *
- *  "vblob" [ OUT ] - page to return
- *
- *  "id" [ IN ] - an id that must be within page range
- *  returns rcNotFound and NULL blob if id is not within range
- */
-rc_t WColumnReadBlob ( WColumn *self, struct VBlob **vblob, int64_t id );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_column_priv_ */
diff --git a/libs/vdb/column.c b/libs/vdb/column.c
deleted file mode 100644
index 4c4c741..0000000
--- a/libs/vdb/column.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "column-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "cursor-priv.h"
-#undef KONST
-
-#include <vdb/manager.h>
-#include <vdb/cursor.h>
-#include <kdb/column.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * VColumn
- */
-
-
-/* Whack
- *  perform read-only cleanup
- */
-void CC VColumnWhack ( void *item, void *data )
-{
-    VColumn *self = item;
-    VCursor *curs = data;
-
-    /* remove from cursor */
-    if ( curs != NULL )
-    {
-        VectorSwap ( & curs -> row, self -> ord, NULL, & item );
-        VCursorCacheSwap ( & curs -> col, & self -> scol -> cid, NULL, & item );
-    }
-
-    VColumnDestroy ( self );
-    free ( self );
-}
-
-
-/* IdRange
- *  returns id range for column or page
- */
-rc_t VColumnIdRange ( const VColumn *self, int64_t *first, int64_t *last )
-{
-    return VColumnIdRangeRead ( self, first, last );
-}
diff --git a/libs/vdb/compare.c b/libs/vdb/compare.c
deleted file mode 100644
index e72f374..0000000
--- a/libs/vdb/compare.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include "blob.h"
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "xform-priv.h"
-#include "prod-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/debug.h>
-#include <atomic32.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-
-#define RC_NOT_SAME RC(rcVDB, rcBlob, rcValidating, rcData, rcCorrupt)
-
-typedef struct float_compare_t {
-    unsigned sig_bits;
-} float_compare_t;
-
-static
-rc_t CC blob_compare(
-                  void *self,
-                  const VRowData *orig,
-                  const VRowData *test
-) {
-    const bitsz_t o_ofs = (size_t)orig->u.data.first_elem * orig->u.data.elem_bits;
-    const bitsz_t t_ofs = (size_t)test->u.data.first_elem * orig->u.data.elem_bits;
-    const bitsz_t bits = (size_t)orig->u.data.elem_count * orig->u.data.elem_bits;
-    int cmp;
-
-    if (orig->u.data.elem_bits % 8 == 0) {
-        cmp = memcmp(
-                   &((const char *)orig->u.data.base)[o_ofs >> 3],
-                   &((const char *)test->u.data.base)[t_ofs >> 3],
-                   bits >> 3
-            );
-    }
-    else {
-        cmp = bitcmp(orig->u.data.base, o_ofs, test->u.data.base, t_ofs, bits);
-    }
-    if(cmp)
-	return RC_NOT_SAME;
-    return 0;
-
-}
-static bool equal_f32( const float A[], const float B[], uint64_t elem_count, unsigned sig_bits ) {
-    unsigned i;
-    const int shift = 24 - sig_bits;
-    
-    assert(shift > 0);
-    
-    for (i = 0; i != elem_count; ++i) {
-        int expa;
-        int expb;
-        uint32_t mana;
-        uint32_t manb;
-        float a = A[i];
-        float b = B[i];
-        int diff;
-        
-        if (a < 0) {
-            a = -a;
-            b = -b;
-            if (b < 0)
-                return false;
-        }
-
-        a = frexpf(a, &expa);
-        b = frexpf(b, &expb);
-        
-        if (expa < expb) {
-            ++expa;
-            a /= 2.0;
-        }
-        else if (expb < expa) {
-            ++expb;
-            b /= 2.0;
-        }
-        if (expa != expb)
-            return false;
-        
-        mana = (uint32_t)ldexpf( a, 24 );
-        manb = (uint32_t)ldexpf( b, 24 );
-        
-        diff = (mana >> shift) - (manb >> shift);
-
-        if (-1 > diff || diff > 1)
-            return false;
-    }
-    return true;
-}
-
-static
-rc_t CC blob_compare_f32(
-                      void *Self,
-                      const VRowData *orig,
-                      const VRowData *test
-) {
-    float_compare_t *self = Self;
-    
-    if (!equal_f32(
-                   &((const float *)orig->u.data.base)[orig->u.data.first_elem],
-                   &((const float *)test->u.data.base)[test->u.data.first_elem],
-                   orig->u.data.elem_count,
-                   self->sig_bits
-               ))
-    {
-        return RC_NOT_SAME;
-    }
-    
-    return 0;
-}
-
-static
-void CC vfunc_free ( void * self )
-{
-    free (self);
-}
-
-VTRANSFACT_BUILTIN_IMPL(vdb_compare, 1, 0, 0) (
-                                       const void *self,
-                                       const VXfactInfo *info,
-                                       VFuncDesc *rslt,
-                                       const VFactoryParams *cp,
-                                       const VFunctionParams *dp
-) 
-{
-    VTypedesc type;
-    assert ( dp->argc == 2 );
-
-    rslt->variant = prodFuncBuiltInCompare;
-    
-#if 0
-    if (dp->argv[0].desc.domain != dp->argv[1].desc.domain ||
-        dp->argv[0].desc.intrinsic_dim != dp->argv[1].desc.intrinsic_dim ||
-        dp->argv[0].desc.intrinsic_bits != dp->argv[1].desc.intrinsic_bits
-    ) {
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-#endif
-    type = dp->argv[0].desc;
-    
-    if (type.domain == vtdFloat) {
-        if (cp->argc > 0) {
-            unsigned sig_bits = cp->argv[0].data.u32[0];
-
-            if (sig_bits == 0) {
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            switch (type.intrinsic_bits) {
-            case 32:
-                if (sig_bits < 24)
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->cf = blob_compare_f32;
-                break;
-            case 64:
-#if 0
-                if (sig_bits < 52)
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->cf = blob_compare_f64;
-#endif
-                break;
-            default:
-                break;
-            }
-            if (VFUNCDESC_INTERNAL_FUNCS(rslt)->cf) {
-                float_compare_t *Self;
-            
-                Self = malloc(sizeof *Self);
-                if (Self == NULL)
-                    return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-
-                Self->sig_bits = sig_bits;
-            
-                rslt->self = Self;
-                rslt->whack = vfunc_free;
-                return 0;
-            }
-        }
-        else {
-            VDB_DEBUG (("warning: using identity compare for floating point types won't work if using fzip\n"));
-        }
-    }
-    VFUNCDESC_INTERNAL_FUNCS(rslt)->cf = blob_compare;
-    return 0;
-}
-
-static
-rc_t CC true_func(
-                  void *self,
-                  const VRowData *orig,
-                  const VRowData *test
-) {
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL(vdb_no_compare, 1, 0, 0) (
-                                       const void *self,
-                                       const VXfactInfo *info,
-                                       VFuncDesc *rslt,
-                                       const VFactoryParams *cp,
-                                       const VFunctionParams *dp
-) 
-{
-    rslt->variant = prodFuncBuiltInCompare;
-    VFUNCDESC_INTERNAL_FUNCS(rslt)->cf = true_func;
-    return 0;
-}
diff --git a/libs/vdb/cursor-cmn.c b/libs/vdb/cursor-cmn.c
deleted file mode 100644
index 1ee550b..0000000
--- a/libs/vdb/cursor-cmn.c
+++ /dev/null
@@ -1,2437 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <va_copy.h>
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#define SKONST
-#include "cursor-priv.h"
-#include "dbmgr-priv.h"
-#include "linker-priv.h"
-#include "table-priv.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "column-priv.h"
-#include "phys-priv.h"
-#include "prod-priv.h"
-#include "prod-expr.h"
-#undef KONST
-#undef SKONST
-#include "blob-priv.h"
-#include "page-map.h"
-
-#include <vdb/cursor.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/table.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kfs/dyload.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/namelist.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <bitstr.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <kproc/lock.h>
-#include <kproc/cond.h>
-#include <kproc/thread.h>
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-#define PERMIT_POST_OPEN_ADD 1
-#define DISABLE_READ_CACHE 0
-
-/* normally false
-   can be set for certain applications using VDBManagerDisablePagemapThread
-*/
-static bool s_disable_pagemap_thread;
-
-
-/*--------------------------------------------------------------------------
- * VCursorCache
- */
-
-/* Whack
- */
-void VCursorCacheWhack ( VCursorCache *self,
-    void ( CC * whack ) ( void *item, void *data ), void *data )
-{
-    uint32_t i = VectorStart ( & self -> cache );
-    uint32_t end = VectorLength ( & self -> cache );
-    for ( end += i; i < end; ++ i )
-    {
-        Vector *ctx;
-        rc_t rc = VectorSwap ( & self -> cache, i, NULL, ( void** ) & ctx );
-        if ( rc == 0 && ctx != NULL )
-        {
-            VectorWhack ( ctx, whack, data );
-            free ( ctx );
-        }
-    }
-
-    VectorWhack ( & self -> cache, NULL, NULL );
-}
-
-
-/* Get
- *  retrieve object by cid
- */
-void *VCursorCacheGet ( const VCursorCache *self, const VCtxId *cid )
-{
-    const Vector *ctx = ( const void* ) VectorGet ( & self -> cache, cid -> ctx );
-    return VectorGet ( ctx, cid -> id );
-}
-
-/* Set
- *  set object by cid
- */
-rc_t VCursorCacheSet ( VCursorCache *self, const VCtxId *cid, const void *item )
-{
-    Vector *ctx = VectorGet ( & self -> cache, cid -> ctx );
-    if ( ctx == NULL )
-    {
-        rc_t rc;
-
-        ctx = malloc ( sizeof * ctx );
-        if ( ctx == NULL )
-            return RC ( rcVDB, rcVector, rcConstructing, rcMemory, rcExhausted );
-
-        rc = VectorSet ( & self -> cache, cid -> ctx, ctx );
-        if ( rc != 0 )
-        {
-            free ( ctx );
-            return rc;
-        }
-
-        VectorInit ( ctx, 0, 16 );
-    }
-
-    return VectorSet ( ctx, cid -> id, item );
-}
-
-/* Swap
- *  swap object by cid
- */
-rc_t VCursorCacheSwap ( VCursorCache *self, const VCtxId *cid, const void *item, void **prior )
-{
-    Vector *ctx = VectorGet ( & self -> cache, cid -> ctx );
-    if ( ctx == NULL )
-    {
-        * prior = NULL;
-        return VCursorCacheSet ( self, cid, item );
-    }
-    return VectorSwap ( ctx, cid -> id, item, prior );
-}
-
-
-/*--------------------------------------------------------------------------
- * NamedParamNode
- */
-
-typedef struct NamedParamNode NamedParamNode;
-struct NamedParamNode
-{
-    BSTNode n;
-    String name;
-    KDataBuffer value;
-};
-
-static
-void CC NamedParamNodeWhack ( BSTNode *n, void *ignore )
-{
-    NamedParamNode *self = ( NamedParamNode* ) n;
-    KDataBufferWhack ( & self -> value );
-    free ( self );
-}
-
-static
-int CC NamedParamComp ( const void *item, const BSTNode *n )
-{
-    const String *name = item;
-    const NamedParamNode *node = ( const NamedParamNode* ) n;
-
-    return StringOrderNoNullCheck ( name, & node -> name );
-}
-
-static
-int CC NamedParamNodeComp ( const BSTNode *A, const BSTNode *B )
-{
-    const NamedParamNode *a = (const NamedParamNode *) A;
-    const NamedParamNode *b = (const NamedParamNode *) B;
-
-    return StringOrderNoNullCheck ( & a -> name, & b -> name );
-}
-/*--------------------------------------------------------------------------
- * LinkedCursorNode
- */
-
-typedef struct LinkedCursorNode LinkedCursorNode;
-struct LinkedCursorNode
-{
-    BSTNode n;
-    char tbl[64];
-    VCursor *curs;
-};
-
-static
-void CC LinkedCursorNodeWhack ( BSTNode *n, void *ignore )
-{
-    LinkedCursorNode *self = ( LinkedCursorNode* ) n;
-    VCursorRelease (  self -> curs );
-    free ( self );
-}
-
-static
-int CC LinkedCursorComp ( const void *item, const BSTNode *n )
-{
-    const char *tbl = item;
-    const LinkedCursorNode *node = ( const LinkedCursorNode* ) n;
-
-    return strncmp ( tbl, node -> tbl, sizeof(node -> tbl) );
-}
-
-static
-int CC LinkedCursorNodeComp ( const BSTNode *A, const BSTNode *B )
-{
-    const LinkedCursorNode *a = (const LinkedCursorNode *) A;
-    const LinkedCursorNode *b = (const LinkedCursorNode *) B;
-
-    return strncmp ( a -> tbl, b -> tbl,sizeof(a->tbl) );
-}
-
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- *  a row cursor onto a VTable
- */
-
-static void CC VCursorVColumnWhack_checked( void *item, void *data )
-{
-    if ( item != NULL )
-        VColumnWhack( item, data );
-}
-
-/* Whack
- */
-rc_t VCursorDestroy ( VCursor *self )
-{
-    KRefcountWhack ( & self -> refcount, "VCursor" );
-    VBlobMRUCacheDestroy ( self->blob_mru_cache);
-    if ( self -> user_whack != NULL )
-        ( * self -> user_whack ) ( self -> user );
-    BSTreeWhack ( & self -> named_params, NamedParamNodeWhack, NULL );
-    BSTreeWhack ( & self -> linked_cursors, LinkedCursorNodeWhack, NULL );
-    VCursorCacheWhack ( & self -> col, NULL, NULL );
-    VCursorCacheWhack ( & self -> phys, VPhysicalWhack, NULL );
-    VCursorCacheWhack ( & self -> prod, NULL, NULL );
-    VectorWhack ( & self -> owned, VProductionWhack, NULL );
-    VectorWhack ( & self -> trig, NULL, NULL );
-    VectorWhack ( & self -> row, VCursorVColumnWhack_checked, NULL );
-
-    VSchemaRelease ( self -> schema );
-
-    VTableSever ( self -> tbl );
-
-    free ( self );
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC VCursorAddRef ( const VCursor *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VCursor" ) )
-        {
-        case krefLimit:
-            return RC ( rcVDB, rcCursor, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VCursorRelease ( const VCursor *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VCursor" ) )
-        {
-        case krefWhack:
-            return VCursorWhack ( ( VCursor* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcCursor, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Make - PRIVATE
- */
-rc_t VCursorMake ( VCursor **cursp, const VTable *tbl )
-{
-    rc_t rc;
-    VCursor *curs;
-
-    /* must have return param */
-    assert ( cursp != NULL );
-
-    /* must have parent tbl */
-    assert ( tbl != NULL );
-
-    /* create a structure */
-    curs = calloc ( 1, sizeof * curs );
-    if ( curs == NULL )
-        rc = RC ( rcVDB, rcCursor, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        /* create a separate schema object */
-        rc = VSchemaMake ( & curs -> schema, tbl -> schema );
-        if ( rc == 0 )
-        {
-            /* extend table schema to populate with implicits */
-            rc = STableCloneExtend ( tbl -> stbl, & curs -> stbl, curs -> schema );
-            if ( rc == 0 )
-            {
-                curs -> tbl = VTableAttach ( tbl );
-                VectorInit ( & curs -> row, 1, 16 );
-                VCursorCacheInit ( & curs -> col, 0, 16 );
-                VCursorCacheInit ( & curs -> phys, 0, 16 );
-                VCursorCacheInit ( & curs -> prod, 0, 16 );
-                VectorInit ( & curs -> owned, 0, 64 );
-                VectorInit ( & curs -> trig, 0, 64 );
-                KRefcountInit ( & curs -> refcount, 1, "VCursor", "make", "vcurs" );
-                curs -> state = vcConstruct;
-                curs -> permit_add_column = true;
-		curs -> suspend_triggers  = false;
-                * cursp = curs;
-                return 0;
-            }
-
-            VSchemaRelease ( curs -> schema );
-        }
-
-        free ( curs );
-    }
-
-    * cursp = NULL;
-
-    return rc;
-}
-
-/* SupplementSchema
- *  scan table for physical column names
- *  create transparent yet incomplete (untyped) columns for unknown names
- *  create incomplete (untyped) physical columns for forwarded names
- *  repeat process on static columns, except create complete (fully typed) objects
- */
-static
-rc_t VCursorSupplementName ( const KSymTable *tbl,
-    STable *stbl, const VTypedecl *td, const char *name )
-{
-    rc_t rc = 0;
-    char buffer [ 256 ];
-
-    /* create physical name string */
-    int len = snprintf ( buffer, sizeof buffer, ".%s", name );
-    if ( len < 0 || len >= sizeof buffer )
-        rc = RC ( rcVDB, rcCursor, rcConstructing, rcName, rcExcessive );
-    else
-    {
-        KSymbol *sym;
-
-        String pname, cname;
-        StringInit ( & pname, buffer, len, string_len ( buffer, len ) );
-
-        /* if physical name is known */
-        sym = KSymTableFind ( tbl, & pname );
-        if ( sym != NULL )
-        {
-            /* if it is being implemented here */
-            if ( sym -> type == eVirtual )
-                rc = STableImplicitPhysMember ( stbl, td, sym, & pname );
-            return rc;
-        }
-
-        /* if simple name is unknown, add implicit */
-        sym = KSymTableFind ( tbl, StringSubstr ( & pname, & cname, 1, 0 ) );
-        if ( sym == NULL )
-        {
-            /* create implicit physical */
-            rc = STableImplicitPhysMember ( stbl, td, sym, & pname );
-            if ( rc == 0 )
-                rc = STableImplicitColMember ( stbl, & cname, & pname );
-        }
-    }
-    return rc;
-}
-
-static
-rc_t VCursorSupplementPhysical ( const KSymTable *tbl, const VCursor *self )
-{
-    KNamelist *names;
-    rc_t rc = KTableListCol ( self -> tbl -> ktbl, & names );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( names, & count );
-        for ( i = 0; rc == 0 && i < count; ++ i )
-        {
-            const char *name;
-            rc = KNamelistGet ( names, i, & name );
-            if ( rc == 0 )
-                rc = VCursorSupplementName ( tbl, self -> stbl, NULL, name );
-        }
-        KNamelistRelease ( names );
-    }
-    return rc;
-}
-
-static
-rc_t VCursorSupplementStatic ( const KSymTable *tbl, const VCursor *self )
-{
-    rc_t rc;
-    KNamelist *names;
-
-    const KMDataNode *root = self -> tbl -> col_node;
-    if ( root == NULL )
-        return 0;
-
-    rc = KMDataNodeListChild ( root, & names );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( names, & count );
-        for ( i = 0; rc == 0 && i < count; ++ i )
-        {
-            const char *name;
-            rc = KNamelistGet ( names, i, & name );
-            if ( rc == 0 )
-            {
-                const KMDataNode *node;
-                rc = KMDataNodeOpenNodeRead ( root, & node, name );
-                if ( rc == 0 )
-                {
-                    size_t size;
-                    char typedecl [ 256 ];
-                    rc = KMDataNodeReadAttr ( node, "type", typedecl, sizeof typedecl, & size );
-                    if ( rc == 0 && size != 0 )
-                    {
-                        VTypedecl td;
-                        rc = VSchemaResolveTypedecl ( self -> schema, & td, typedecl );
-                        if ( rc == 0 )
-                            rc = VCursorSupplementName ( tbl, self -> stbl, & td, name );
-
-                        rc = 0; /*** don't care if name is not in the schema ***/
-		
-                    }
-
-                    KMDataNodeRelease ( node );
-                }
-            }
-        }
-
-        KNamelistRelease ( names );
-    }
-
-    return rc;
-}
-
-rc_t VCursorSupplementSchema ( const VCursor *self )
-{
-    KSymTable tbl;
-    rc_t rc = init_tbl_symtab ( & tbl, self -> schema, self -> stbl );
-    if ( rc == 0 )
-    {
-        rc = VCursorSupplementPhysical ( & tbl, self );
-        if ( rc == 0 )
-            rc = VCursorSupplementStatic ( & tbl, self );
-        KSymTableWhack ( & tbl );
-    }
-    return rc;
-}
-
-
-/* CreateCachedCursorRead
- *  creates a read cursor object onto table with a cache limit in bytes
- *
- *  AVAILABILITY: version 2.1
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- *
- *  "capacity" [ IN ] - the maximum bytes to cache on the cursor before
- *  dropping least recently used blobs
- */
-static rc_t VTableCreateCachedCursorReadImpl(const VTable *self, const VCursor **cursp, size_t capacity,bool create_pagemap_thread);
-LIB_EXPORT rc_t CC VTableCreateCachedCursorRead ( const VTable *self,
-    const VCursor **cursp, size_t capacity )
-{
-	return VTableCreateCachedCursorReadImpl(self,cursp,capacity,true);
-}
-/**
-*** VTableCreateCursorReadInternal is only visible in vdb and needed for schema resolutions
-****/
-rc_t  VTableCreateCursorReadInternal(const VTable *self, const VCursor **cursp)
-{
-	return VTableCreateCachedCursorReadImpl(self,cursp,0,false);
-}
-static rc_t VTableCreateCachedCursorReadImpl ( const VTable *self,
-    const VCursor **cursp, size_t capacity, bool create_pagemap_thread  )
-{
-    rc_t rc;
-#if DISABLE_READ_CACHE
-    capacity = 0;
-#endif
-    if ( cursp == NULL )
-        rc = RC ( rcVDB, rcTable, rcOpening, rcParam, rcNull );
-    else {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcOpening, rcSelf, rcNull );
-        else {
-            VCursor *curs;
-#if LAZY_OPEN_COL_NODE
-            if ( self -> col_node == NULL )
-                KMetadataOpenNodeRead ( self -> meta, & ( ( VTable* ) self ) -> col_node, "col" );
-#endif
-            rc = VCursorMake ( & curs, self );
-            if ( rc == 0 ) {
-                curs -> blob_mru_cache = VBlobMRUCacheMake(capacity);
-                curs -> read_only = true;
-                rc = VCursorSupplementSchema ( curs );
-               
-#if 0  
-                if(create_pagemap_thread && capacity > 0 && rc == 0 )
-                    rc = VCursorLaunchPagemapThread ( curs );
-#endif
-                if ( rc == 0 )
-                {
-                    if(capacity > 0)
-                        curs->launch_cnt = 5;
-                    else
-                        curs->launch_cnt=200;
-                    * cursp = curs;
-                    return 0;
-                }
-                VCursorRelease ( curs );
-            }
-        }
-        * cursp = NULL;
-    }
-    return rc;
-}
-
-/* CreateCursor
- *  creates a cursor object onto table
- *  multiple read cursors are allowed
- *  only a single write cursor is allowed
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- */
-LIB_EXPORT rc_t CC VTableCreateCursorRead ( const VTable *self, const VCursor **curs )
-{
-    /* will be deprecated in the future */
-    return VTableCreateCachedCursorRead ( self, curs, 0 );
-}
-
-/* PermitPostOpenAdd
- *  allows columns to be added to open cursor
- *  for write cursor, the effect lasts until the first row commit
- */
-LIB_EXPORT rc_t CC VCursorPermitPostOpenAdd ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcSelf, rcNull );
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcInvalid );
-    else if ( self -> state != vcConstruct )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcOpen );
-    else
-    {
-        self -> permit_post_open_add = true;
-        rc = 0;
-    }
-
-    return rc;
-}
-/*  SuspendTriggers
- *  blocks resolution of schema-based triggers
- *  
- */
-LIB_EXPORT rc_t CC VCursorSuspendTriggers ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcSelf, rcNull );
-    else
-    {
-        self -> suspend_triggers = true;
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* AddSColumn
- */
-static
-rc_t VCursorAddSColumn ( VCursor *self, uint32_t *idx, const SColumn *scol, const VTypedecl *cast )
-{
-    rc_t rc;
-    VColumn *col;
-
-    if ( self -> read_only )
-    {
-        /* must be readable */
-        if ( scol -> read == NULL )
-            return RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcWriteonly );
-    }
-    else
-    {
-        /* must be writable */
-        if ( scol -> read_only || ( scol -> read == NULL && scol -> validate == NULL ) )
-            return RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcReadonly );
-    }
-
-    /* must not already be there - benign error */
-    col = VCursorCacheGet ( & self -> col, & scol -> cid );
-    if ( col != NULL )
-    {
-        * idx = col -> ord;
-        return RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcExists );
-    }
-
-    /* make object */
-    rc = VCursorMakeColumn ( self, & col, scol );
-    if ( rc == 0 )
-    {
-        /* insert it into vectors */
-        rc = VectorAppend ( & self -> row, & col -> ord, col );
-        if ( rc == 0 )
-        {
-            void *ignore;
-            rc = VCursorCacheSet ( & self -> col, & scol -> cid, col );
-            if ( rc == 0 )
-            {
-                /* open column if cursor open or type unknown */
-                if ( self -> state >= vcReady || scol -> td . type_id == 0 )
-                {
-                    rc = VCursorPostOpenAdd ( self, col );
-                    assert ( rc != 0 || scol -> td . type_id != 0 );
-                }
-                if ( rc == 0 )
-                {
-                    /* check cast of SColumn against requested type
-                       this is to handle the case where the column
-                       was created incomplete, i.e. with unknown type */
-                    if ( cast == NULL || VTypedeclToTypedecl ( & scol -> td,
-                             self -> schema, cast, & col -> td, NULL ) )
-                    {
-                        /* has been entered */
-                        * idx = col -> ord;
-                        return 0;
-                    }
-                }
-
-                /* bail out */
-                VCursorCacheSwap ( & self -> col, & scol -> cid, NULL, & ignore );
-            }
-
-            VectorSwap ( & self -> row, col -> ord, NULL, & ignore );
-        }
-
-        VColumnWhack ( col, NULL );
-    }
-
-    return rc;
-}
-
-
-/* AddColspec
- *  a "colspec" is either a simple column name or a typed name expression
- *  uses STable to evaluate colspec and find an SColumn
- */
-static
-rc_t VCursorAddColspec ( VCursor *self, uint32_t *idx, const char *colspec )
-{
-    rc_t rc;
-
-    /* find an appropriate column in schema */
-    uint32_t type;
-    VTypedecl cast;
-    const SNameOverload *name;
-    const SColumn *scol = STableFind ( self -> tbl -> stbl, self -> schema,
-        & cast, & name, & type, colspec, "VCursorAddColspec", true );
-    if ( scol == NULL || type != eColumn )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcNotFound );
-    else
-        rc = VCursorAddSColumn ( self, idx, scol, & cast );
-
-    return rc;
-}
-
-
-/* AddColumn
- *  add a column to an unopened cursor
- *
- *  "idx" [ OUT ] - return parameter for column index
- *
- *  "name" [ IN ] - NUL terminated column name spec.
- *  to identify a column by name, provide the column name
- *  by itself. if there are multiple types available under
- *  that name, the default type for that column will be
- *  selected. to select a specific type, the name may
- *  be cast to that type using a cast expression, e.g.
- *    "( type ) name"
- *  the special name "*" may be added to a read cursor.
- */
-LIB_EXPORT rc_t CC VCursorVAddColumn ( const VCursor *cself,
-    uint32_t *idx, const char *name, va_list args )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( idx == NULL )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcParam, rcNull );
-    else
-    {
-        * idx = 0;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcUpdating, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcVDB, rcCursor, rcUpdating, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcCursor, rcUpdating, rcName, rcEmpty );
-        else if ( self -> state == vcFailed )
-            rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcInvalid );
-        else if ( self -> state != vcConstruct && ! self -> permit_add_column )
-            rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcLocked );
-        else
-        {
-            char colspec [ 1024 ];
-            int len = vsnprintf ( colspec, sizeof colspec, name, args );
-            if ( len < 0 || len >= sizeof colspec )
-                rc = RC ( rcVDB, rcCursor, rcUpdating, rcName, rcExcessive );
-            else
-            {
-                rc = VCursorAddColspec ( self, idx, colspec );
-                if ( rc == 0 || GetRCState ( rc ) == rcExists )
-                    return rc;
-            }
-
-            if ( ! self -> permit_add_column )
-            {
-                PLOGERR ( klogErr, ( klogErr, rc, "failed to add column '$(spec)' to cursor",
-                                     "spec=%s", colspec ));
-            }
-            return rc;
-        }
-    }
-
-    LOGERR ( klogErr, rc, "failed to add column" );
-
-    return rc;
-}
-
-
-/* AddColumn
- *  add a column to an unopened cursor
- *
- *  "idx" [ OUT ] - return parameter for column index
- *
- *  "name" [ IN ] - NUL terminated column name spec.
- *  to identify a column by name, provide the column name
- *  by itself. if there are multiple types available under
- *  that name, the default type for that column will be
- *  selected. to select a specific type, the name may
- *  be cast to that type using a cast expression, e.g.
- *    "( type ) name"
- *  the special name "*" may be added to a read cursor.
- */
-LIB_EXPORT rc_t CC VCursorAddColumn ( const VCursor *self,
-    uint32_t *idx, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VCursorVAddColumn ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* GetColspec
- *  a "colspec" is either a simple column name or a typed name expression
- *  uses STable to evaluate colspec and find an SColumn
- */
-static
-rc_t VCursorGetColspec ( const VCursor *self, uint32_t *idx, const char *colspec )
-{
-    rc_t rc;
-
-    /* find an appropriate column in schema */
-    uint32_t type;
-    VTypedecl cast;
-    const SNameOverload *name;
-    const SColumn *scol = STableFind ( self -> tbl -> stbl, self -> schema,
-        & cast, & name, & type, colspec, "VCursorAddColspec", true );
-    if ( scol == NULL || type != eColumn )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcNotFound );
-    else
-    {
-        /* if the column-spec gave us the exact column, return it */
-        VColumn *col = VCursorCacheGet ( & self -> col, & scol -> cid );
-        if ( col != NULL )
-        {
-            * idx = col -> ord;
-            return 0;
-        }
-
-        /* prepare for failure */
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcNotFound );
-
-        /* there should be a name overload object */
-        if ( name != NULL )
-        {
-            uint32_t count, i = VectorStart ( & name -> items );
-            uint32_t end = VectorLength ( & name -> items );
-            for ( end += i, count = 0; i < end; ++ i )
-            {
-                scol = ( const void* ) VectorGet ( & name -> items, i );
-                if ( scol != NULL )
-                {
-                    col = VCursorCacheGet ( & self -> col, & scol -> cid );
-                    if ( col != NULL )
-                    {
-                        * idx = col -> ord;
-                        ++ count;
-                    }
-                }
-            }
-
-            if ( count == 1 )
-                return 0;
-            if ( count != 0 )
-                return RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcAmbiguous );
-        }
-    }
-
-    return rc;
-}
-
-
-/* GetColumnIdx
- *  retrieve column index by name spec
- *
- *  "idx" [ OUT ] - return parameter for column index
- *
- *  "name" [ IN ] - NUL terminated column name spec.
- */
-LIB_EXPORT rc_t CC VCursorVGetColumnIdx ( const VCursor *self,
-    uint32_t *idx, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( idx == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * idx = 0;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else if ( name == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcName, rcNull );
-        else if ( name [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcName, rcEmpty );
-        else if ( self -> state == vcFailed )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcCursor, rcInvalid );
-        else
-        {
-            char colspec [ 1024 ];
-            int len = vsnprintf ( colspec, sizeof colspec, name, args );
-            if ( len < 0 || len >= sizeof colspec )
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcName, rcExcessive );
-            else
-            {
-                rc = VCursorGetColspec ( self, idx, colspec );
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorGetColumnIdx ( const VCursor *self, uint32_t *idx, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VCursorVGetColumnIdx ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Datatype
- *  returns typedecl and/or typedef for column data
- *
- *  "idx" [ IN ] - column index
- *
- *  "type" [ OUT, NULL OKAY ] - returns the column type declaration
- *
- *  "def" [ OUT, NULL OKAY ] - returns the definition of the type
- *  returned in "type_decl"
- *
- * NB - one of "type" and "def" must be non-NULL
- */
-LIB_EXPORT rc_t CC VCursorDatatype ( const VCursor *self, uint32_t idx,
-    struct VTypedecl *type, struct VTypedesc *desc )
-{
-    rc_t rc;
-
-    if ( type == NULL && desc == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const VColumn *vcol = ( const VColumn* ) VectorGet ( & self -> row, idx );
-            if ( vcol == NULL )
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcNotFound );
-            else
-                return VColumnDatatype ( vcol, type, desc );
-        }
-
-        if ( type != NULL )
-            memset ( type, 0, sizeof * type );
-        if ( desc != NULL )
-            memset ( desc, 0, sizeof * desc );
-    }
-
-    return rc;
-}
-
-
-/* IdRange
- *  returns id range for column
- *
- *  "idx" [ IN ] - column index
- *
- *  "id" [ IN ] - page containing this row id is target
- *
- *  "first" [ OUT, NULL OKAY ] and "last" [ OUT, NULL OKAY ] -
- *  id range is returned in these output parameters, where
- *  at least ONE must be NOT-NULL
- */
-typedef struct VCursorIdRangeData VCursorIdRangeData;
-struct VCursorIdRangeData
-{
-    int64_t first, last;
-    rc_t rc;
-};
-
-static
-bool CC column_id_range ( void *item, void *data )
-{
-    if ( ( size_t ) item > 8 )
-    {
-        int64_t first, last;
-        VCursorIdRangeData *pb = data;
-
-        rc_t rc = VColumnIdRange ( ( const void* ) item, & first, & last );
-
-        if ( GetRCState ( rc ) == rcEmpty )
-            return false;
-
-        if ( ( pb -> rc = rc ) != 0 )
-            return true;
-
-        if ( first < pb -> first )
-            pb -> first = first;
-        if ( last > pb -> last )
-            pb -> last = last;
-    }
-
-    return false;
-}
-
-LIB_EXPORT rc_t CC VCursorIdRange ( const VCursor *self, uint32_t idx,
-    int64_t *first, uint64_t *count )
-{
-    rc_t rc;
-
-    if ( first == NULL && count == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        int64_t dummy;
-        uint64_t dummy_count;
-
-        if ( first == NULL )
-            first = & dummy;
-        else if ( count == NULL )
-            count = & dummy_count;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else if ( self -> state < vcReady )
-        {
-            if ( self -> state == vcFailed )
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcCursor, rcInvalid );
-            else
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcCursor, rcNotOpen );
-        }
-        else if ( idx == 0 )
-        {
-            VCursorIdRangeData pb;
-
-            pb . first = INT64_MAX;
-            pb . last = INT64_MIN;
-            pb . rc = RC ( rcVDB, rcCursor, rcAccessing, rcRange, rcEmpty );
-
-            if ( ! VectorDoUntil ( & self -> row, false, column_id_range, & pb ) )
-            {
-                * first = pb . first;
-                * count = pb . last >= pb . first ? pb . last + 1 - pb . first : 0;
-                return pb . rc;
-            }
-
-            rc = pb . rc;
-        }
-        else
-        {
-            const VColumn *vcol = ( const VColumn* ) VectorGet ( & self -> row, idx );
-            if ( vcol == NULL )
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcNotFound );
-            else {
-                int64_t last;
-
-                rc = VColumnIdRange ( vcol, first, &last );
-                if (rc == 0)
-                    *count = last + 1 - *first;
-                return rc;
-            }
-        }
-
-        * first = * count = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorPageIdRange ( struct VCursor const *self,
-    uint32_t idx, int64_t id, int64_t *first, int64_t *last )
-{
-    rc_t rc;
-
-    if ( first == NULL && last == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        int64_t dummy;
-        if ( first == NULL )
-            first = & dummy;
-        else if ( last == NULL )
-            last = & dummy;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const VColumn *vcol = ( const VColumn* ) VectorGet ( & self -> row, idx );
-            if ( vcol == NULL )
-                rc = RC ( rcVDB, rcCursor, rcAccessing, rcColumn, rcNotFound );
-            else
-                return VColumnPageIdRange ( vcol, id, first, last );
-        }
-
-        * first = * last = 0;
-    }
-
-    return rc;
-}
-
-
-/* Open
- *  open cursor, resolving schema
- *  for the set of opened columns
- *
- *  NB - there is no corresponding "Close"
- *  use "Release" instead.
- */
-typedef struct VProdResolveData VProdResolveData;
-struct VProdResolveData
-{
-    VProdResolve pr;
-    rc_t rc;
-};
-
-
-static
-bool CC VCursorResolveColumn ( void *item, void *data )
-{
-    if ( item != NULL )
-    {
-        void *ignore;
-        VCursor *self;
-
-        VColumn *col = item;
-        VProdResolveData *pb = data;
-        SColumn *scol = ( SColumn* ) col -> scol;
-
-        VProduction *src = NULL;
-        pb -> rc = VProdResolveColumnRoot ( & pb -> pr, & src, scol );
-        if ( pb -> rc == 0 )
-        {
-            if ( src > FAILED_PRODUCTION )
-            {
-                /* repair for incomplete implicit column decl */
-                if ( scol -> td . type_id == 0 )
-                    scol -> td = src -> fd . td;
-
-                return false;
-            }
-
-            pb -> rc = RC ( rcVDB, rcCursor, rcOpening, rcColumn, rcUndefined );
-        }
-
-        /* check for tolerance */
-        self = pb -> pr . curs;
-        if ( ! pb -> pr . ignore_column_errors )
-        {
-            if ( ! self -> permit_post_open_add )
-            {
-                PLOGERR ( klogErr, ( klogErr, pb -> rc, "failed to resolve column '$(name)' idx '$(idx)'",
-                                     "name=%.*s,idx=%u"
-                                     , ( int ) scol -> name -> name . size
-                                     , scol -> name -> name . addr
-                                     , col -> ord ));
-            }
-
-            return true;
-        }
-
-        /* remove from row and cache */
-        VectorSwap ( & self -> row, col -> ord, NULL, & ignore );
-        VCursorCacheSwap ( & self -> col, & scol -> cid, NULL, & ignore );
-
-        /* dump the VColumn */
-        VColumnWhack ( col, NULL );
-
-        /* return no-error */
-        pb -> rc = 0;
-    }
-
-    return false;
-}
-
-static
-rc_t VCursorOpenColumn ( const VCursor *cself, VColumn *col )
-{
-    KDlset *libs;
-    VCursor *self = ( VCursor* ) cself;
-
-    VProdResolveData pb;
-    pb . pr . schema = self -> schema;
-    pb . pr . ld = self -> tbl -> linker;
-    pb . pr . stbl = self -> stbl;
-    pb . pr . curs = self;
-    pb . pr . cache = & self -> prod;
-    pb . pr . owned = & self -> owned;
-    pb . pr . chain = chainDecoding;
-    pb . pr . blobbing = false;
-    pb . pr . ignore_column_errors = false;
-    pb . pr . discover_writable_columns = false;
-
-    pb . rc = VLinkerOpen ( pb . pr . ld, & libs );
-    if ( pb . rc == 0 )
-    {
-        pb . pr . libs = libs;
-        VCursorResolveColumn ( col, & pb );
-        KDlsetRelease ( libs );
-    }
-
-    return pb . rc;
-}
-
-/* PostOpenAdd
- *  handle opening of a column after the cursor is opened
- */
-rc_t VCursorPostOpenAddRead ( VCursor *self, VColumn *col )
-{
-    return VCursorOpenColumn ( self, col );
-}
-
-
-static
-rc_t VCursorResolveColumnProductions ( VCursor *self,
-    const KDlset *libs, bool ignore_failures )
-{
-    VProdResolveData pb;
-    pb . pr . schema = self -> schema;
-    pb . pr . ld = self -> tbl -> linker;
-    pb . pr . libs = libs;
-    pb . pr . stbl = self -> stbl;
-    pb . pr . curs = self;
-    pb . pr . cache = & self -> prod;
-    pb . pr . owned = & self -> owned;
-    pb . pr . chain = chainDecoding;
-    pb . pr . blobbing = false;
-    pb . pr . ignore_column_errors = ignore_failures;
-    pb . pr . discover_writable_columns = false;
-    pb . rc = 0;
-
-    if ( VectorDoUntil ( & self -> row, false, VCursorResolveColumn, & pb ) )
-        return pb . rc;
-
-    return 0;
-}
-
-rc_t VCursorOpenRead ( VCursor *self, const KDlset *libs )
-{
-    rc_t rc;
-
-    if ( self -> state >= vcReady )
-        rc = 0;
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcCursor, rcInvalid );
-    else
-    {
-        rc = VCursorResolveColumnProductions ( self, libs, false );
-        if ( rc == 0 )
-        {
-            self -> row_id = self -> start_id = self -> end_id = 1;
-            self -> state = vcReady;
-            return 0;
-        }
-
-        self -> state = vcFailed;
-    }
-
-    return rc;
-}
-
-static
-rc_t VCursorOpenForListing ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    VLinker *ld = self -> tbl -> linker;
-
-    KDlset *libs;
-    rc = VLinkerOpen ( ld, & libs );
-    if ( rc == 0 )
-    {
-        rc = VCursorResolveColumnProductions ( self, libs, true );
-        KDlsetRelease ( libs );
-    }
-    return rc;
-}
-
-
-
-/* RowId
- *  return id from row cursor within open blob
- *
- *  "id" [ OUT ] - current row id
- */
-LIB_EXPORT rc_t CC VCursorRowId ( const VCursor *self, int64_t *id )
-{
-    rc_t rc;
-    if ( id == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * id = self -> row_id;
-            return 0;
-        }
-
-        * id = 0;
-    }
-
-    return rc;
-}
-
-
-/* SetRowIdRead - PRIVATE
- *  seek to given row id
- *
- *  "row_id" [ IN ] - row id to select
- */
-rc_t VCursorSetRowIdRead ( VCursor *self, int64_t row_id )
-{
-    assert ( self != NULL );
-
-    self -> row_id = row_id;
-    return 0;
-}
-
-
-/* OpenRowRead
- * CloseRowRead
- */
-rc_t VCursorOpenRowRead ( VCursor *self )
-{
-    assert ( self != NULL );
-
-    self -> state = vcRowOpen;
-    return 0;
-}
-
-rc_t VCursorCloseRowRead ( VCursor *self )
-{
-    assert ( self != NULL );
-
-    ++ self -> row_id;
-    self -> state = vcReady;
-    return 0;
-}
-
-
-/* Read
- *  read entire single row of byte-aligned data into a buffer
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required
- *  to be compatible with the actual element size, and be a multiple
- *  of 8 ( byte-aligned ). for non-byte-aligned data, see ReadBits
- *
- *  "buffer" [ OUT ] and "blen" [ IN ] - return buffer for row data
- *  where "blen" gives buffer capacity in elements. the total buffer
- *  size in bytes == ( "elem_bits" * "blen" + 7 ) / 8.
- *
- *  "row_len" [ OUT ] - return parameter for the number of elements
- *  in the requested row.
- *
- *  when the return code is 0, "row_len" will contain the number of
- *  elements read into buffer. if the return code indicates that the
- *  buffer is too small, "row_len" will give the required buffer length.
- */
-static
-rc_t VCursorReadColumnDirectInt ( const VCursor *cself, int64_t row_id, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len,
-    const VBlob **rslt )
-{
-    rc_t rc,rc_cache=0;
-    const VColumn *col;
-    const VBlob *blob;
-
-    col = ( const void* ) VectorGet ( & cself -> row, col_idx );
-    if ( col == NULL )
-        return RC ( rcVDB, rcCursor, rcReading, rcColumn, rcInvalid );
-
-    /* 2.0 behavior if not caching */
-    if ( cself -> blob_mru_cache == NULL )
-        return VColumnRead ( col, row_id, elem_bits, base, boff, row_len, (VBlob**) rslt );
-
-    /* check MRU blob */
-    blob = VBlobMRUCacheFind(cself->blob_mru_cache,col_idx,row_id);
-    if(blob){
-        /* ask column to read from blob */
-	assert(row_id >= blob->start_id && row_id <= blob->stop_id);
-        return VColumnReadCachedBlob ( col, blob, row_id, elem_bits, base, boff, row_len);
-    }
-    { /* ask column to produce a blob to be cached */
-	VBlobMRUCacheCursorContext cctx;
-	cctx.cache=cself -> blob_mru_cache;
-	cctx.col_idx = col_idx;
-	rc = VColumnReadBlob(col,&blob,row_id,elem_bits,base,boff,row_len,&cctx);
-    }
-    if ( rc != 0 || blob == NULL ){
-	if(rslt) *rslt = NULL;
-        return rc;
-    }
-    if(blob->stop_id > blob->start_id + 4)
-	    rc_cache=VBlobMRUCacheSave(cself->blob_mru_cache, col_idx, blob);
-    if(rslt==NULL){ /** user does not care about the blob ***/
-	if( rc_cache == 0){
-		VBlobRelease((VBlob*)blob);
-	} /** else the memory will leak **/
-    } else {
-	*rslt=blob;
-    }
-    return 0;
-}
-
-/* GetBlob
- *  retrieve a blob of data containing the current row id
- * GetBlobDirect
- *  retrieve a blob of data containing the requested row id
- *
- *  "blob" [ OUT ] - return parameter for a new reference
- *  to VBlob containing requested cell. NB - must be released
- *  via VBlobRelease when no longer needed.
- *
- *  "row_id" [ IN ] - allows ReadDirect random access to any cell
- *  in column
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- */
-LIB_EXPORT rc_t CC VCursorGetBlob ( const VCursor *self,
-    const VBlob **blob, uint32_t col_idx )
-{
-    rc_t rc;
-
-    if ( blob == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else if ( ! self -> read_only )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcWriteonly );
-        else
-        {
-            const void *base;
-            uint32_t elem_bits, boff, row_len;
-
-            switch ( self -> state )
-            {
-            case vcConstruct:
-                rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcNotOpen );
-                break;
-            case vcReady:
-                rc = RC ( rcVDB, rcCursor, rcReading, rcRow, rcNotOpen );
-                break;
-            case vcRowOpen:
-                rc = VCursorReadColumnDirectInt
-                    ( self, self -> row_id, col_idx, &elem_bits, &base, &boff, &row_len, blob );
-                if ( rc == 0 )
-                {
-                    rc = VBlobAddRef ( ( VBlob* ) *blob );
-                    if ( rc == 0 )
-                        return 0;
-                }
-                break;
-            default:
-                rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcInvalid );
-            }
-        }
-
-        * blob = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorGetBlobDirect ( const VCursor *self,
-    const VBlob **blob, int64_t row_id, uint32_t col_idx )
-{
-    rc_t rc;
-
-    if ( blob == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else if ( ! self -> read_only )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcWriteonly );
-        else
-        {
-            const void *base;
-            uint32_t elem_bits, boff, row_len;
-
-            switch ( self -> state )
-            {
-            case vcConstruct:
-                rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcNotOpen );
-                break;
-            case vcReady:
-            case vcRowOpen:
-                rc = VCursorReadColumnDirectInt
-                    ( self, row_id, col_idx, &elem_bits, &base, &boff, &row_len, blob );
-                if ( rc == 0 )
-                {
-                    rc = VBlobAddRef ( ( VBlob* ) *blob );
-                    if ( rc == 0 )
-                        return 0;
-                }
-                break;
-            default:
-                rc = RC ( rcVDB, rcCursor, rcReading, rcCursor, rcInvalid );
-            }
-        }
-
-        * blob = NULL;
-    }
-    return rc;
-}
-
-static
-rc_t VCursorReadColumnDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    if ( ! self -> read_only )
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcWriteonly );
-
-    switch ( self -> state )
-    {
-    case vcConstruct:
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcNotOpen );
-    case vcReady:
-    case vcRowOpen:
-        break;
-    default:
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcInvalid );
-    }
-
-    return VCursorReadColumnDirectInt
-        ( self, row_id, col_idx, elem_bits, base, boff, row_len, NULL );
-}
-
-
-static
-rc_t VCursorReadColumn ( const VCursor *self, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    if ( ! self -> read_only )
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcWriteonly );
-
-    switch ( self -> state )
-    {
-    case vcConstruct:
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcNotOpen );
-    case vcReady:
-        return RC ( rcVDB, rcCursor, rcReading, rcRow, rcNotOpen );
-    case vcRowOpen:
-        break;
-    default:
-        return RC ( rcVDB, rcCursor, rcReading, rcCursor, rcInvalid );
-    }
-
-    return VCursorReadColumnDirectInt
-        ( self, self -> row_id, col_idx, elem_bits, base, boff, row_len, NULL );
-}
-
-static __inline__
-bool bad_elem_bits ( uint32_t elem_size, uint32_t elem_bits )
-{
-    if ( elem_size != elem_bits )
-    {
-        if ( elem_size < elem_bits && elem_bits % elem_size != 0 )
-            return true;
-        return ( elem_size % elem_bits != 0 );
-    }
-    return false;
-}
-
-LIB_EXPORT rc_t CC VCursorRead ( const VCursor *self, uint32_t col_idx,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len )
-{
-    rc_t rc;
-
-    if ( row_len == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else if ( elem_bits == 0 || ( elem_bits & 7 ) != 0 )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcInvalid );
-        else
-        {
-            uint32_t elem_size; const void *base; uint32_t boff;
-            rc = VCursorReadColumn ( self, col_idx, & elem_size,
-                & base, & boff, row_len );
-            if ( rc == 0 )
-            {
-                if ( bad_elem_bits ( elem_size, elem_bits ) )
-                    rc = RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent );
-                else if ( * row_len != 0 )
-                {
-                    if ( blen == 0 )
-                        return RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient );
-                    if ( buffer == NULL )
-                        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-                    else
-                    {
-                        uint64_t to_read = * row_len * elem_size;
-                        uint64_t bsize = blen * elem_bits;
-
-                        /* always return the required buffer size */
-                        * row_len = ( uint32_t ) ( to_read / elem_bits );
-
-                        /* detect buffer too small */
-                        if ( to_read > bsize )
-                        {
-                            rc = RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient );
-                            to_read = bsize;
-                        }
-
-                        /* copy out data up to limit */
-                        assert ( boff == 0 );
-                        memcpy ( buffer, base, ( size_t ) ( to_read >> 3 ) );
-
-                        return rc;
-                    }
-                }
-            }
-        }
-
-        * row_len = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorReadDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t elem_bits, void *buffer, uint32_t blen, uint32_t *row_len )
-{
-    rc_t rc;
-
-    if ( row_len == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else if ( elem_bits == 0 || ( elem_bits & 7 ) != 0 )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcInvalid );
-        else
-        {
-            uint32_t elem_size; const void *base; uint32_t boff;
-            rc = VCursorReadColumnDirect ( self, row_id, col_idx,
-                & elem_size, & base, & boff, row_len );
-            if ( rc == 0 )
-            {
-                if ( bad_elem_bits ( elem_size, elem_bits ) )
-                    rc = RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent );
-                else if ( * row_len != 0 )
-                {
-                    if ( blen == 0 )
-                        return RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient );
-                    if ( buffer == NULL )
-                        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-                    else
-                    {
-                        uint64_t to_read = * row_len * elem_size;
-                        uint64_t bsize = blen * elem_bits;
-
-                        /* always return the required buffer size */
-                        * row_len = ( uint32_t ) ( to_read / elem_bits );
-
-                        /* detect buffer too small */
-                        if ( to_read > bsize )
-                        {
-                            rc = RC ( rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient );
-                            to_read = bsize;
-                        }
-
-                        /* copy out data up to limit */
-                        assert ( boff == 0 );
-                        memcpy ( buffer, base, ( size_t ) ( to_read >> 3 ) );
-
-                        return rc;
-                    }
-                }
-            }
-        }
-
-        * row_len = 0;
-    }
-
-    return rc;
-}
-
-
-/* ReadBits
- *  read single row of potentially bit-aligned column data into a buffer
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - expected element size in bits, required to be
- *  compatible with the actual element size, and may ( or may not ) be
- *  a multiple of 8 ( byte aligned ).
- *
- *  "start" [ IN ] - zero-based starting index to first element,
- *  valid from 0 .. row_len - 1
- *
- *  "buffer" [ IN ], "boff" [ IN ] and "blen" [ IN ] -
- *  return buffer for row data, where "boff" is in BITS
- *  and "blen" is in ELEMENTS.
- *
- *  "num_read" [ OUT ] - return parameter for the number of elements
- *  read, which is <= "blen"
- *
- *  "remaining" [ OUT, NULL OKAY ] - optional return parameter for
- *  the number of elements remaining to be read. specifically,
- *  "start" + "num_read" + "remaining" == row length, assuming that
- *  "start" <= row length.
- */
-LIB_EXPORT rc_t CC VCursorReadBits ( const VCursor *self, uint32_t col_idx,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t off,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining )
-{
-    rc_t rc;
-
-    uint32_t dummy;
-    if ( remaining == NULL )
-        remaining = & dummy;
-
-    if ( num_read == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else if ( elem_bits == 0 )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcInvalid );
-        else
-        {
-            uint32_t elem_size; const void *base; uint32_t boff;
-            rc = VCursorReadColumn ( self, col_idx, & elem_size,
-                & base, & boff, num_read );
-            if ( rc == 0 )
-            {
-                if ( bad_elem_bits ( elem_size, elem_bits ) )
-                    rc = RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent );
-                else if ( * num_read != 0 )
-                {
-                    uint64_t to_read = * num_read * elem_size;
-                    uint64_t doff = start * elem_bits;
-                    to_read = to_read > doff ? to_read - doff : 0;
-                    if ( blen == 0 )
-                    {
-                        * num_read = 0;
-                        * remaining = ( uint32_t ) ( to_read / elem_bits );
-                        return 0;
-                    }
-
-                    if ( buffer == NULL )
-                        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-                    else
-                    {
-                        uint64_t bsize = blen * elem_size;
-                        if ( to_read <= bsize )
-                            * remaining = 0;
-                        else
-                        {
-                            * remaining = (uint32_t)( ( to_read - bsize ) / elem_bits );
-                            to_read = bsize;
-                        }
-                        bitcpy ( buffer, off, base, boff + doff, ( bitsz_t ) to_read );
-                        * num_read = ( uint32_t ) ( to_read / elem_bits );
-                        return 0;
-                    }
-                }
-            }
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorReadBitsDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t elem_bits, uint32_t start, void *buffer, uint32_t off,
-    uint32_t blen, uint32_t *num_read, uint32_t *remaining )
-{
-    rc_t rc;
-
-    uint32_t dummy;
-    if ( remaining == NULL )
-        remaining = & dummy;
-
-    if ( num_read == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else if ( elem_bits == 0 )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcInvalid );
-        else
-        {
-            uint32_t elem_size; const void *base; uint32_t boff;
-            rc = VCursorReadColumnDirect ( self, row_id, col_idx,
-                & elem_size, & base, & boff, num_read );
-            if ( rc == 0 )
-            {
-                if ( bad_elem_bits ( elem_size, elem_bits ) )
-                    rc = RC ( rcVDB, rcCursor, rcReading, rcType, rcInconsistent );
-                else if ( * num_read != 0 )
-                {
-                    uint64_t to_read = * num_read * elem_size;
-                    uint64_t doff = start * elem_bits;
-                    to_read = to_read > doff ? to_read - doff : 0;
-                    if ( blen == 0 )
-                    {
-                        * num_read = 0;
-                        * remaining = ( uint32_t ) ( to_read / elem_bits );
-                        return 0;
-                    }
-
-                    if ( buffer == NULL )
-                        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-                    else
-                    {
-                        uint64_t bsize = blen * elem_size;
-                        if ( to_read <= bsize )
-                            * remaining = 0;
-                        else
-                        {
-                            * remaining = (uint32_t)( ( to_read - bsize ) / elem_bits );
-                            to_read = bsize;
-                        }
-                        bitcpy ( buffer, off, base, boff + doff, ( bitsz_t ) to_read );
-                        * num_read = ( uint32_t ) ( to_read / elem_bits );
-                        return 0;
-                    }
-                }
-            }
-        }
-
-        * num_read = 0;
-    }
-
-    * remaining = 0;
-
-    return rc;
-}
-
-
-/* CellData
- *  access pointer to single cell of potentially bit-aligned column data
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ OUT, NULL OKAY ] - optional return parameter for
- *  element size in bits
- *
- *  "base" [ OUT ] and "boff" [ OUT, NULL OKAY ] -
- *  compound return parameter for pointer to row starting bit
- *  where "boff" is in BITS
- *
- *  "row_len" [ OUT, NULL OKAY ] - the number of elements in row
- */
-LIB_EXPORT rc_t CC VCursorCellData ( const VCursor *self, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    rc_t rc;
-
-    uint32_t dummy1, dummy2, dummy3;
-    if ( row_len == NULL )
-        row_len = & dummy1;
-    if ( boff == NULL )
-        boff = & dummy2;
-    if ( elem_bits == NULL )
-        elem_bits = & dummy3;
-
-    if ( base == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else
-        {
-            rc = VCursorReadColumn ( self, col_idx,
-                elem_bits, base, boff, row_len );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * base = NULL;
-    }
-
-    * elem_bits = 0;
-    * boff = 0;
-    * row_len = 0;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorCellDataDirect ( const VCursor *self, int64_t row_id, uint32_t col_idx,
-    uint32_t *elem_bits, const void **base, uint32_t *boff, uint32_t *row_len )
-{
-    rc_t rc;
-
-    uint32_t dummy1, dummy2, dummy3;
-    if ( row_len == NULL )
-        row_len = & dummy1;
-    if ( boff == NULL )
-        boff = & dummy2;
-    if ( elem_bits == NULL )
-        elem_bits = & dummy3;
-
-    if ( base == NULL )
-        rc = RC ( rcVDB, rcCursor, rcReading, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcReading, rcSelf, rcNull );
-        else
-        {
-            rc = VCursorReadColumnDirect ( self, row_id, col_idx,
-                elem_bits, base, boff, row_len );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * base = NULL;
-    }
-
-    * elem_bits = 0;
-    * boff = 0;
-    * row_len = 0;
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VCursorOpenParentRead ( const VCursor *self, const VTable **tbl )
-{
-    rc_t rc;
-
-    if ( tbl == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VTableAddRef ( self -> tbl );
-            if ( rc == 0 )
-            {
-                * tbl = self -> tbl;
-                return 0;
-            }
-        }
-
-        * tbl = NULL;
-    }
-
-    return rc;
-}
-
-
-static
-void CC insert_overloaded_scolumns ( void *item, void *data )
-{
-    VCursor *curs = data;
-    const SColumn *scol = ( const void* ) item;
-
-    uint32_t ignore;
-    VCursorAddSColumn ( curs, & ignore, scol, NULL );
-}
-
-static
-void VCursorListCol_walk_through_columns_and_add_to_cursor ( VCursor *self )
-{
-    uint32_t idx = VectorStart ( & self -> stbl -> cname );
-    uint32_t end = VectorLength ( & self -> stbl -> cname );
-    for ( end += idx; idx < end; ++idx )
-    {
-        /* look at the table column name guy */
-        const SNameOverload* ol_entry = ( const SNameOverload* ) VectorGet ( & self -> stbl -> cname, idx );
-        if ( ol_entry != NULL )
-            VectorForEach ( & ol_entry -> items, false, insert_overloaded_scolumns, self );
-    }
-}
-
-static
-rc_t VCursorListCol_consolidate_and_insert( const VCursor *self, BSTree *columns )
-{
-    rc_t rc = VCursorOpenForListing ( self );
-    if ( rc == 0 )
-    {
-        uint32_t idx = VectorStart ( & self -> row );
-        uint32_t end = VectorLength ( & self -> row );
-
-        for ( end += idx; idx < end; ++idx )
-        {
-            const VColumn* vcol = ( const VColumn* ) VectorGet ( & self -> row, idx );
-            if ( vcol != NULL )
-            {
-                VColumnRef *cref;
-                rc = VColumnRefMake ( & cref, self -> schema, vcol -> scol );
-                if ( rc != 0 )
-                    break;
-
-                rc = BSTreeInsert ( columns, & cref -> n, VColumnRefSort );
-                assert ( rc == 0 );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* ListReadableColumns
- *  performs an insert of '*' to cursor
- *  attempts to resolve all read rules
- *  records all SColumns that successfully resolved
- *  populates BTree with VColumnRef objects
- */
-rc_t VCursorListReadableColumns ( VCursor *self, BSTree *columns )
-{
-    /* add '*' to cursor */
-    VCursorListCol_walk_through_columns_and_add_to_cursor ( self );
-
-    /* insert all columns into tree */
-    return VCursorListCol_consolidate_and_insert ( self, columns );
-}
-
-
-/* GetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ OUT ] - return parameter for getting data
- */
-LIB_EXPORT rc_t CC VCursorGetUserData ( const VCursor *self, void **data )
-{
-    rc_t rc;
-
-    if ( data == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * data = self -> user;
-            return 0;
-        }
-
-        * data = NULL;
-    }
-
-    return rc;
-}
-
-/* SetUserData
- *  store/retrieve an opaque pointer to user data
- *
- *  "data" [ IN ] - parameter for setting data
- *
- *  "destroy" [ IN, NULL OKAY ] - optional destructor param
- *  invoked from destructor of "self"
- */
-LIB_EXPORT rc_t CC VCursorSetUserData ( const VCursor *cself,
-    void *data, void ( CC * destroy ) ( void *data ) )
-{
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        return RC ( rcVDB, rcCursor, rcUpdating, rcSelf, rcNull );
-
-    self -> user = data;
-    self -> user_whack = destroy;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VCursorLinkedCursorGet(const VCursor *cself,const char *tbl,VCursor const **curs)
-{
-    LinkedCursorNode *node;
-    VCursor *self = (VCursor *)cself;
-
-    if(cself == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcSelf, rcNull);
-    if(tbl == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNull);
-    if(tbl[0] == '\0')
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcEmpty);
-    node = (LinkedCursorNode *)BSTreeFind(&self->linked_cursors, tbl, LinkedCursorComp);
-    if (node == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNotFound);
-
-    *curs = node->curs;
-    return 0;
-}
-LIB_EXPORT rc_t CC VCursorLinkedCursorSet(const VCursor *cself,const char *tbl,VCursor const *curs)
-{
-    LinkedCursorNode *node;
-    VCursor *self = (VCursor *)cself;
-    rc_t rc;
-
-    if(cself == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcSelf, rcNull);
-    if(tbl == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNull);
-    if(tbl[0] == '\0')
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcEmpty);
-
-    node = malloc(sizeof(*node));
-    if (node == NULL)
-            return RC(rcVDB, rcCursor, rcAccessing, rcMemory, rcExhausted);
-    strncpy(node->tbl,tbl,sizeof(node->tbl));
-    node->curs=(VCursor*)curs;
-    rc = BSTreeInsertUnique(&self->linked_cursors, (BSTNode *)node, NULL, LinkedCursorNodeComp);
-    if (rc)
-       free(node); 
-    else 
-	VCursorAddRef(curs);
-    return rc;
-}
-
-
-/* private */
-LIB_EXPORT rc_t CC VCursorParamsGet( struct VCursorParams const *cself,
-    const char *Name, KDataBuffer **value )
-{
-    NamedParamNode *node;
-    String name;
-    VCursor *self = (VCursor *)cself;
-    
-    if (cself == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcSelf, rcNull);
-    
-    if (Name == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNull);
-    
-    if (Name[0] == '\0')
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcEmpty);
-    
-    StringInitCString(&name, Name);
-    node = (NamedParamNode *)BSTreeFind(&self->named_params, &name, NamedParamComp);
-    if (node == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNotFound);
-        
-    *value = &node->value;
-    return 0;
-}
-
-/* private */
-static rc_t VCursorParamsLookupOrCreate(struct VCursorParams const *cself,
-                         const char *Name, KDataBuffer **value)
-{
-    NamedParamNode *node;
-    String name;
-    VCursor *self = (VCursor *)cself;
-    rc_t rc;
-    
-    StringInitCString(&name, Name);
-    node = (NamedParamNode *)BSTreeFind(&self->named_params, &name, NamedParamComp);
-    if (node == NULL) {
-        node = malloc(sizeof(*node) + StringSize(&name) + 1);
-        if (node == NULL)
-            return RC(rcVDB, rcCursor, rcAccessing, rcMemory, rcExhausted);
-        
-        strcpy((char *)(&node[1]), Name);
-        StringInit ( & node -> name, (const char *)(&node[1]), name . size, name . len );
-        
-        memset ( & node -> value, 0, sizeof node -> value );
-        node -> value . elem_bits = 8;
-        
-        rc = BSTreeInsertUnique(&self->named_params, (BSTNode *)node, NULL, NamedParamNodeComp);
-        assert(rc == 0);
-    }
-    *value = &node->value;
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VCursorParamsVSet(struct VCursorParams const *cself, 
-    const char *Name, const char *fmt, va_list args )
-{
-    KDataBuffer *value;
-    rc_t rc;
-
-    if (cself == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcSelf, rcNull);
-
-    if (Name == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcNull);
-
-    if (Name[0] == '\0')
-        return RC(rcVDB, rcCursor, rcAccessing, rcName, rcEmpty);
-
-    rc = VCursorParamsLookupOrCreate(cself, Name, &value);
-    if (rc == 0) {
-        int n;
-        char dummy[1];
-
-        va_list copy;
-        va_copy(copy, args);
-
-        /* optimistic printf */
-        n = vsnprintf ( ( value -> base == NULL ) ?
-            dummy : value -> base, value -> elem_count, fmt, copy );
-        va_end(copy);
-
-        if ( n < 0 || n >= (int)value -> elem_count )
-        {
-            rc = KDataBufferResize ( value, ( n < 0 ) ? 4000 : n + 1 );
-            if (rc == 0)
-            {
-                n = vsnprintf(value->base, value->elem_count, fmt, args);
-                if ( n < 0 || n >= (int)value->elem_count )
-                {
-                    rc = RC ( rcVDB, rcCursor, rcUpdating, rcParam, rcInvalid );
-                    KDataBufferWhack ( value );
-                }
-            }
-        }
-
-        if ( rc == 0 )
-            value -> elem_count = n;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorParamsSet( struct VCursorParams const *cself, 
-    const char *name, const char *fmt, ... )
-{
-    va_list va;
-    rc_t rc;
-
-    va_start(va, fmt);
-    rc = VCursorParamsVSet(cself, name, fmt, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorParamsUnset( struct VCursorParams const *cself, const char *Name ) {
-    KDataBuffer *value;
-    rc_t rc;
-
-    if (cself == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcSelf, rcNull);
-
-    if (Name == NULL)
-        return RC(rcVDB, rcCursor, rcAccessing, rcParam, rcNull);
-
-    if (Name[0] == '\0')
-        return RC(rcVDB, rcCursor, rcAccessing, rcParam, rcInvalid);
-
-    rc = VCursorParamsGet(cself, Name, &value);
-    if (rc == 0)
-        KDataBufferWhack(value);
-
-    return rc;
-}
-
-/*  VCursorGetSchema
- *  returns current schema of the open cursor
- */
-LIB_EXPORT struct VSchema const * CC VCursorGetSchema ( struct VCursor const *self )
-{
-    return self ? self->schema : NULL;
-}
-
-
-static rc_t run_pagemap_thread ( const KThread *t, void *data )
-{
-    rc_t rc;
-    VCursor *self = data;
-    /* acquire lock */
-    MTCURSOR_DBG (( "run_pagemap_thread: acquiring lock\n" ));
-    while((rc = KLockAcquire ( self -> pmpr.lock ))==0){
-CHECK_AGAIN:
-	switch(self->pmpr.state){
-	 case ePMPR_STATE_NONE: 		/* wait for new request */
-	 case ePMPR_STATE_SERIALIZE_DONE: 	/* wait for result pickup **/
-	 case ePMPR_STATE_DESERIALIZE_DONE:	/* wait for result pickup **/
-		MTCURSOR_DBG (( "run_pagemap_thread: waiting for new request\n" ));
-		rc = KConditionWait ( self -> pmpr.cond, self -> pmpr.lock );
-		goto CHECK_AGAIN;
-	 case ePMPR_STATE_EXIT: /** exit requested ***/
-		MTCURSOR_DBG (( "run_pagemap_thread: exit by request\n" ));
-		KLockUnlock(self -> pmpr.lock);
-		return 0;
-	 case ePMPR_STATE_DESERIALIZE_REQUESTED:
-		MTCURSOR_DBG (( "run_pagemap_thread: request to deserialize\n" ));
-		self->pmpr.rc = PageMapDeserialize(&self->pmpr.pm,self->pmpr.data.base,self->pmpr.data.elem_count,self->pmpr.row_count);
-		if(self->pmpr.rc == 0){
-			self->pmpr.rc=PageMapExpandFull(self->pmpr.pm);
-			/*self->pmpr.rc=PageMapExpand(self->pmpr.pm,self->pmpr.row_count<2048?self->pmpr.row_count-1:2048);*/
-			assert(self->pmpr.rc == 0);
-		}
-		self->pmpr.state = ePMPR_STATE_DESERIALIZE_DONE;
-		/*fprintf(stderr,"Pagemap %p Done R:%6d|DR:%d|LR:%d\n",self->pmpr.lock, self->pmpr.pm->row_count,self->pmpr.pm->data_recs,self->pmpr.pm->leng_recs);*/
-		KLockUnlock(self -> pmpr.lock);
-		KConditionSignal ( self -> pmpr.cond );
-		break;
-	 case ePMPR_STATE_SERIALIZE_REQUESTED:
-		MTCURSOR_DBG (( "run_pagemap_thread: request to serialize\n" ));
-		self->pmpr.rc = PageMapSerialize(self->pmpr.pm,&self->pmpr.data,0,&self->pmpr.elem_count);
-		self->pmpr.state = ePMPR_STATE_SERIALIZE_DONE;
-		KLockUnlock(self -> pmpr.lock);
-		KConditionSignal ( self -> pmpr.cond );
-		break;
-	 default:
-		assert(0);
-		KLockUnlock(self -> pmpr.lock);
-		return RC(rcVDB, rcPagemap, rcConverting, rcParam, rcInvalid );
-	 
-	}
-    }
-    MTCURSOR_DBG (( "run_pagemap_thread: exit\n" ));
-    return rc;
-}
-
-rc_t VCursorLaunchPagemapThread(VCursor *curs)
-{
-	rc_t rc;
-
-    assert ( curs != NULL );
-	curs -> pagemap_thread = NULL; /** if fails - will not use **/
-
-    if ( s_disable_pagemap_thread )
-        return RC ( rcVDB, rcCursor, rcExecuting, rcThread, rcNotAvailable );
-
-	rc = KLockMake ( & curs -> pmpr.lock );
-	if(rc == 0)
-    {
-		rc = KConditionMake ( & curs -> pmpr.cond );
-        if(rc == 0)
-        {
-            rc = KThreadMake ( & curs -> pagemap_thread, run_pagemap_thread, curs );
-            if ( rc == 0 )
-                return 0;
-
-            KConditionRelease ( curs -> pmpr . cond );
-            curs -> pmpr . cond = NULL;
-        }
-
-        KLockRelease ( curs -> pmpr . lock );
-        curs -> pmpr . lock = NULL;
-    }
-
-	return rc;
-}
-
-rc_t VCursorTerminatePagemapThread(VCursor *self)
-{
-	rc_t rc=0;
-
-    assert ( self != NULL );
-
-	if(self -> pagemap_thread != NULL)
-    {
-		rc = KLockAcquire ( self -> pmpr.lock );
-		if ( rc == 0 )
-        {
-			self -> pmpr.state = ePMPR_STATE_EXIT;
-			KConditionSignal ( self -> pmpr.cond );
-			KLockUnlock ( self -> pmpr.lock );
-		}
-		KThreadWait ( self -> pagemap_thread, NULL );
-	}
-
-	KThreadRelease ( self -> pagemap_thread );
-	KConditionRelease ( self -> pmpr.cond );
-	KLockRelease ( self -> pmpr.lock );
-
-    self -> pagemap_thread = NULL;
-    self -> pmpr . cond = NULL;
-    self -> pmpr . lock = NULL;
-
-	return rc;
-}
-
-/* DisablePagemapThread
- *  this can cause difficulties for some clients
- */
-LIB_EXPORT rc_t CC VDBManagerDisablePagemapThread ( struct VDBManager const *self )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcUpdating, rcSelf, rcNull );
-    s_disable_pagemap_thread = true;
-    return 0;
-}
-
-
-/* IsStaticColumn
- *  answers question: "does this column have the same value for every cell?"
- */
-LIB_EXPORT rc_t CC VCursorIsStaticColumn ( const VCursor *self, uint32_t col_idx, bool *is_static )
-{
-    rc_t rc;
-
-    if ( is_static == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            uint32_t start = VectorStart ( & self -> row );
-            uint32_t end = start + VectorLength ( & self -> row );
-            if ( col_idx < start || col_idx > end )
-                rc = RC ( rcVDB, rcCursor, rcSelecting, rcId, rcInvalid );
-            else
-            {
-                VColumn *col = VectorGet ( & self -> row, col_idx );
-                return VColumnIsStatic ( col, is_static );
-            }
-        }
-
-        * is_static = false;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/cursor-priv.h b/libs/vdb/cursor-priv.h
deleted file mode 100644
index ec91798..0000000
--- a/libs/vdb/cursor-priv.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_cursor_priv_
-#define _h_cursor_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifndef SKONST
-#define SKONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "blob-priv.h"
-
-#define MTCURSOR_DBG( msg ) DBGMSG ( DBG_VDB, DBG_FLAG ( DBG_VDB_MTCURSOR ), msg )
-
-
-
-#define VCURSOR_WRITE_MODES_SUPPORTED 0
-
-/* temporary - until the full kproc for Windows is operational */
-#if WINDOWS
-#define VCURSOR_FLUSH_THREAD 0
-#else
-#define VCURSOR_FLUSH_THREAD 1
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KLock;
-struct KCondition;
-struct KThread;
-struct KNamelist;
-struct KDlset;
-struct VTable;
-struct VCtxId;
-struct VSchema;
-struct SColumn;
-struct VColumn;
-struct VPhysical;
-
-
-/*--------------------------------------------------------------------------
- * VCursorCache
- *  a dual-level vector
- */
-typedef struct VCursorCache VCursorCache;
-struct VCursorCache
-{
-    Vector cache;
-};
-
-
-/* Init
- */
-#define VCursorCacheInit( self, start, block ) \
-    VectorInit ( & ( self ) -> cache, start, block )
-
-/* Whack
- */
-void VCursorCacheWhack ( VCursorCache *self,
-    void ( CC * whack ) ( void *item, void *data ), void *data );
-
-/* Get
- *  retrieve object by cid
- */
-void *VCursorCacheGet ( const VCursorCache *self, struct VCtxId const *cid );
-
-/* Set
- *  set object by cid
- */
-rc_t VCursorCacheSet ( VCursorCache *self,
-    struct VCtxId const *cid, const void *item );
-
-/* Swap
- *  swap object by cid
- */
-rc_t VCursorCacheSwap ( VCursorCache *self,
-    struct VCtxId const *cid, const void *item, void **prior );
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- */
-enum
-{
-    vcConstruct,
-    vcFailed,
-    vcReady,
-    vcRowOpen,
-    vcRowCommitted,
-    vcPageCommit
-};
-
-enum
-{
-    vfReady,
-    vfBusy,
-    vfFgErr,
-    vfBgErr,
-    vfExit
-};
-
-
-struct VCursor
-{
-    /* row id */
-    int64_t row_id;
-
-    /* half-closed page range */
-    int64_t start_id, end_id;
-
-    /* starting id for flush */
-    volatile int64_t flush_id;
-
-    /* attached reference to table */
-    struct VTable KONST *tbl;
-
-    /* cursor-specific schema and table */
-    struct VSchema SKONST *schema;
-    struct STable SKONST *stbl;
-
-    /* background flush thread objects */
-    int64_t   launch_cnt;
-    struct KThread *flush_thread;
-    struct KLock *flush_lock;
-    struct KCondition *flush_cond;
-
-    /* background pagemap conversion objects */
-    struct KThread *pagemap_thread;
-    PageMapProcessRequest pmpr;
-
-    /* user data */
-    void *user;
-    void ( CC * user_whack ) ( void *data );
-
-    /* external named cursor parameters */    
-    BSTree named_params;
-    /* linked cursors */
-    BSTree linked_cursors;
-
-    /* read-only blob cache */
-    VBlobMRUCache *blob_mru_cache;
-
-    /* external row of VColumn* by ord ( owned ) */
-    Vector row;
-
-    /* column objects by cid ( not-owned ) */
-    VCursorCache col;
-
-    /* physical columns by cid ( owned ) */
-    VCursorCache phys;
-    uint32_t	phys_cnt;
-
-    /* productions by cid ( not-owned ) */
-    VCursorCache prod;
-
-    /* intermediate productions ( owned ) */
-    Vector owned;
-
-    /* trigger productions ( not-owned ) */
-    Vector trig;
-
-    KRefcount refcount;
-
-    volatile uint32_t flush_cnt;
-
-    /* foreground state */
-    uint8_t state;
-
-    /* flush_state */
-    volatile uint8_t flush_state;
-
-    bool read_only;
-
-    /* support for sradb-v1 API */
-    bool permit_add_column;
-    bool permit_post_open_add;
-    /* support suspension of schema-declared triggers **/
-    bool suspend_triggers;
-};
-
-
-/* Make
- */
-rc_t VCursorMake ( struct VCursor **cursp, struct VTable const *tbl );
-
-rc_t VTableCreateCursorWriteInt ( struct VTable *self, struct VCursor **cursp, KCreateMode mode, bool create_thread );
-
-/* Whack
- * Destroy
- */
-rc_t VCursorWhack ( struct VCursor *self );
-rc_t VCursorDestroy ( struct VCursor *self );
-
-/* SupplementSchema
- *  scan table for physical column names
- *  create transparent yet incomplete (untyped) columns for unknown names
- *  create incomplete (untyped) physical columns for forwarded names
- *  repeat process on static columns, except create complete (fully typed) objects
- */
-rc_t VCursorSupplementSchema ( struct VCursor const *self );
-
-/* MakeColumn
- */
-rc_t VCursorMakeColumn ( struct VCursor *self,
-    struct VColumn **col, struct SColumn const *scol );
-
-/* SetRowIdRead - PRIVATE
- *  seek to given row id
- *
- *  "row_id" [ IN ] - row id to select
- */
-rc_t VCursorSetRowIdRead ( struct VCursor *self, int64_t row_id );
-
-/* Open
- */
-rc_t VCursorOpenRead ( struct VCursor *self, struct KDlset const *libs );
-/**
-*** VTableCreateCursorReadInternal is only visible in vdb and needed for schema resolutions
-****/
-rc_t  VTableCreateCursorReadInternal(const struct VTable *self, const struct VCursor **cursp);
-
-
-/* ListReadableColumns
- *  performs an insert of '*' to cursor
- *  attempts to resolve all read rules
- *  records all SColumns that successfully resolved
- *  populates BTree with VColumnRef objects
- */
-rc_t VCursorListReadableColumns ( struct VCursor *self, BSTree *columns );
-
-/* ListWritableColumns
- *  walks list of SPhysicals and trigger SProductions
- *  attempts to resolve all write rules
- *  records any SColumn that can be reached
- *  populates BTree with VColumnRef objects
- */
-rc_t VCursorListWritableColumns ( struct VCursor *self, BSTree *columns );
-rc_t VCursorListSeededWritableColumns ( struct VCursor *self, BSTree *columns, struct KNamelist const *seed );
-
-/* PostOpenAdd
- *  handle opening of a column after the cursor is opened
- */
-rc_t VCursorPostOpenAdd ( struct VCursor *self, struct VColumn *col );
-rc_t VCursorPostOpenAddRead ( struct VCursor *self, struct VColumn *col );
-
-/* OpenRowRead
- * CloseRowRead
- */
-rc_t VCursorOpenRowRead ( struct VCursor *self );
-rc_t VCursorCloseRowRead ( struct VCursor *self );
-
-
-/** pagemap supporting thread **/
-rc_t VCursorLaunchPagemapThread(struct VCursor *self);
-rc_t VCursorTerminatePagemapThread(struct VCursor *self);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_cursor_priv_ */
diff --git a/libs/vdb/cursor.c b/libs/vdb/cursor.c
deleted file mode 100644
index 4786fef..0000000
--- a/libs/vdb/cursor.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "cursor-priv.h"
-#include "dbmgr-priv.h"
-#include "linker-priv.h"
-#include "schema-priv.h"
-#include "table-priv.h"
-#include "column-priv.h"
-#undef KONST
-
-#include <vdb/cursor.h>
-#include <vdb/table.h>
-#include <kfs/dyload.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- *  a row cursor onto a VTable
- */
-
-
-/* Whack
- */
-rc_t VCursorWhack ( VCursor *self )
-{
-    VCursorTerminatePagemapThread(self);
-    return VCursorDestroy ( self );
-}
-
-
-/* MakeColumn
- */
-rc_t VCursorMakeColumn ( VCursor *self, VColumn **col, const SColumn *scol )
-{
-    return VColumnMake ( col, self -> schema, scol );
-}
-
-/* PostOpenAdd
- *  handle opening of a column after the cursor is opened
- */
-rc_t VCursorPostOpenAdd ( VCursor *self, VColumn *col )
-{
-    return VCursorPostOpenAddRead ( self, col );
-}
-
-/* Open
- *  open cursor, resolving schema
- *  for the set of opened columns
- *
- *  NB - there is no corresponding "Close"
- *  use "Release" instead.
- */
-LIB_EXPORT rc_t CC VCursorOpen ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcSelf, rcNull );
-    else
-    {
-        VLinker *ld = self -> tbl -> linker;
-
-        KDlset *libs;
-        rc = VLinkerOpen ( ld, & libs );
-        if ( rc == 0 )
-        {
-            rc = VCursorOpenRead ( self, libs );
-            if ( rc == 0 )
-            {
-                int64_t first;
-                uint64_t count;
-                
-                rc = VCursorIdRange ( self, 0, & first, & count );
-                if ( rc != 0 )
-                {
-                    /* permit empty open when run from sradb */
-                    if ( GetRCState ( rc ) == rcEmpty && GetRCObject ( rc ) == rcRange &&
-                         self -> permit_add_column && VectorLength ( & self -> row ) == 0 )
-                    {
-                        rc = 0;
-                    }
-                }
-                else if ( count != 0 )
-                {
-                    /* set initial row id to starting row */
-                    self -> start_id = self -> end_id = self -> row_id = first;
-                }
-
-                if ( rc != 0 )
-                    self -> state = vcFailed;
-            }
-
-            KDlsetRelease ( libs );
-        }
-    }
-
-    return rc;
-}
-
-
-/* SetRowId
- *  seek to given row id
- *
- *  "row_id" [ IN ] - row id to select
- */
-LIB_EXPORT rc_t CC VCursorSetRowId ( const VCursor *cself, int64_t row_id )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcPositioning, rcSelf, rcNull );
-    else if ( self -> state > vcReady )
-        rc = RC ( rcVDB, rcCursor, rcPositioning, rcCursor, rcBusy );
-    else
-        rc = VCursorSetRowIdRead ( self, row_id );
-
-    return rc;
-}
-
-
-/* OpenRow
- *  open currently closed row indicated by row id
- */
-LIB_EXPORT rc_t CC VCursorOpenRow ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcSelf, rcNull );
-    else if ( self -> state < vcReady )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcRow, rcIncomplete );
-    else if ( self -> state > vcReady )
-        rc = 0;
-    else
-        rc = VCursorOpenRowRead ( self );
-
-    return rc;
-}
-
-/* CloseRow
- *  balances OpenRow message
- *  if there are uncommitted modifications,
- *  discard all changes. otherwise,
- *  advance to next row
- */
-LIB_EXPORT rc_t CC VCursorCloseRow ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcClosing, rcSelf, rcNull );
-    else if ( self -> state < vcRowOpen )
-        rc = 0;
-    else
-        rc = VCursorCloseRowRead ( self );
-
-    return rc;
-}
diff --git a/libs/vdb/database-cmn.c b/libs/vdb/database-cmn.c
deleted file mode 100644
index b8ce8d7..0000000
--- a/libs/vdb/database-cmn.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#undef KONST
-
-#include "schema-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <klib/debug.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VDatabase
- *  opaque connection to a database within file system
- */
-
-
-/* Whack
- */
-rc_t CC VDatabaseWhack ( VDatabase *self )
-{
-    rc_t rc = 0;
-
-    KRefcountWhack ( & self -> refcount, "VDatabase" );
-
-    /* release user data */
-    if ( self -> user != NULL && self -> user_whack != NULL )
-    {
-        ( * self -> user_whack ) ( self -> user );
-        self -> user = NULL;
-        self -> user_whack = NULL;
-    }
-
-    /* release dad */
-    if ( self -> dad != NULL )
-    {
-        rc = VDatabaseSever ( self -> dad );
-        if ( rc == 0 )
-            self -> dad = NULL;
-    }
-
-    /* remove from mgr */
-    if ( rc == 0 )
-        rc = VDBManagerSever ( self -> mgr );
-
-    if ( rc == 0 )
-    {
-        /* complete */
-        KMetadataRelease ( self -> meta );
-        KDatabaseRelease ( self -> kdb );
-        VSchemaRelease ( self -> schema );
-
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "VDatabase", "whack", "vdb" );
-    return rc;
-}
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC VDatabaseAddRef ( const VDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VDatabase" ) )
-        {
-        case krefLimit:
-            return RC ( rcVDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VDatabaseRelease ( const VDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VDatabase" ) )
-        {
-        case krefWhack:
-            return VDatabaseWhack ( ( VDatabase* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- *  internal reference management
- */
-VDatabase *VDatabaseAttach ( const VDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "VDatabase" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( VDatabase* ) self;
-}
-
-rc_t VDatabaseSever ( const VDatabase *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "VDatabase" ) )
-        {
-        case krefWhack:
-            return VDatabaseWhack ( ( VDatabase* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make - PRIVATE
- *  creates an initialized database object
- *  expects a mgr and optionally a parent db,
- *  enforces schema validity according to some rules,
- */
-rc_t VDatabaseMake ( VDatabase **dbp,
-    const VDBManager *mgr, const VDatabase *dad, const VSchema *schema )
-{
-    rc_t rc;
-
-    /* create a structure */
-    VDatabase *db = calloc ( 1, sizeof * db );
-    if ( db == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        /* create a modifiable schema */
-        rc = VSchemaMake ( ( VSchema** ) & db -> schema, schema );
-        if ( rc == 0 )
-        {
-            db -> mgr = VDBManagerAttach ( mgr );
-            db -> dad = VDatabaseAttach ( dad );
-            KRefcountInit ( & db -> refcount, 1, "VDatabase", "make", "vdb" );
-
-            db -> cmode = ( uint8_t ) kcmOpen;
-            db -> checksum = ( uint8_t ) kcsNone;
-
-            * dbp = db;
-            return 0;
-        }
-
-        VDatabaseWhack ( db );
-    }
-
-    * dbp = NULL;
-
-    return rc;
-}
-
-
-/* OpenRead
- *  finish opening a db for read
- */
-static
-rc_t CC VDatabaseOpenRead ( VDatabase *self )
-{
-    /* open metadata */
-    rc_t rc = KDatabaseOpenMetadataRead ( self -> kdb, & self -> meta );
-    if ( rc == 0 )
-    {
-        /* fetch stored schema */
-        rc = VDatabaseLoadSchema ( self );
-        if ( rc == 0 && self -> sdb == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcSchema, rcNotFound );
-    }
-
-    DBGMSG(DBG_VDB, DBG_FLAG(DBG_VDB_VDB), ("VDatabaseOpenRead = %d\n", rc));
-
-    return rc;
-}
-
-
-/* OpenDBRead
- * VOpenDBRead
- *  open a database for read
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "schema" [ IN, NULL OKAY ] - schema object containg database
- *  declaration to be used in creating db.
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-LIB_EXPORT rc_t CC VDBManagerVOpenDBRead ( const VDBManager *self,
-    const VDatabase **dbp, const VSchema *schema,
-    const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSelf, rcNull );
-        else
-        {
-            VDatabase *db;
-
-            if ( schema == NULL )
-                schema = self -> schema;
-
-            rc = VDatabaseMake ( & db, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                db -> read_only = true;
-
-                rc = KDBManagerVOpenDBRead ( self -> kmgr, & db -> kdb, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenRead ( db );
-                    if ( rc == 0 )
-                    {
-                        * dbp = db;
-                        return 0;
-                    }
-                }
-
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerOpenDBRead ( const VDBManager *self,
-    const VDatabase **db, const VSchema *schema,
-    const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVOpenDBRead ( self, db, schema, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVOpenDBRead ( const VDatabase *self,
-    const VDatabase **dbp, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcSelf, rcNull );
-        else
-        {
-            VDatabase *db;
-            rc = VDatabaseMake ( & db, self -> mgr, self, self -> schema );
-            if ( rc == 0 )
-            {
-                db -> read_only = true;
-
-                rc = KDatabaseVOpenDBRead ( self -> kdb, & db -> kdb, name, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenRead ( db );
-                    if ( rc == 0 )
-                    {
-                        * dbp = db;
-                        return 0;
-                    }
-                }
-
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseOpenDBRead ( const VDatabase *self,
-    const VDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VDatabaseVOpenDBRead ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Locked
- *  returns true if locked
- */
-LIB_EXPORT bool CC VDatabaseLocked ( const VDatabase *self )
-{
-    /* TBD - no concept of virtual database locking
-       other than physical database locking */
-    if ( self != NULL )
-        return KDatabaseLocked ( self -> kdb );
-    return false;
-}
-
-
-/* IsAlias
- *  returns true if object name is an alias
- *  returns path to fundamental name if it was aliased
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
- *  for fundamenta object name if "alias" is not a fundamental name, 
- *
- *  "name" [ IN ] - NUL terminated object name
- */
-LIB_EXPORT bool CC VDatabaseIsAlias ( const VDatabase *self, uint32_t type,
-    char *resolved, size_t rsize, const char *name )
-{
-    if ( self != NULL )
-        return KDatabaseIsAlias ( self -> kdb, type, resolved, rsize, name );
-
-    if ( resolved != NULL && rsize != 0 )
-        * resolved = 0;
-
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDatabaseVWritable ( const VDatabase *self, uint32_t type, 
-        const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-    else
-        rc = KDatabaseVWritable ( self -> kdb, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseWritable ( const VDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VDatabaseVWritable ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* OpenMetadataRead
- *  opens metadata for read
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-LIB_EXPORT rc_t CC VDatabaseOpenMetadataRead ( const VDatabase *self, const KMetadata **meta )
-{
-    rc_t rc;
-    if ( meta == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * meta = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            /* we operate under the notion of
-               single-threaded operation, so hand out
-               read or update capable object */
-            rc = KMetadataAddRef ( self -> meta );
-            if ( rc == 0 )
-                * meta = self -> meta;
-        }
-    }
-
-    return rc;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VDatabaseOpenManagerRead ( const VDatabase *self, const VDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VDatabaseOpenParentRead ( const VDatabase *self, const VDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenSchema
- *  duplicate reference to table schema
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VDatabaseOpenSchema ( const VDatabase *self, const VSchema **schema )
-{
-    rc_t rc;
-
-    if ( schema == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VSchemaAddRef ( self -> schema );
-            if ( rc == 0 )
-            {
-                * schema = self -> schema;
-                return 0;
-            }
-        }
-
-        * schema = NULL;
-    }
-
-    return rc;
-}
-
-
-/* lists the tables of the database
- * 
- * "names" [ OUT ] - return parameter for tables 
- */
-LIB_EXPORT rc_t CC VDatabaseListTbl ( const VDatabase *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcListing, rcSelf, rcNull );
-        else
-        {
-            if ( self->kdb == NULL )
-                rc = RC ( rcVDB, rcDatabase, rcListing, rcParam, rcNull );
-            else
-            {
-                return KDatabaseListTbl ( self->kdb, names );
-            }
-        }
-        *names = NULL;
-    }
-    return rc;
-}
-
-/* lists the sub-databases of the database
- * 
- * "names" [ OUT ] - return parameter for databases 
- */
-LIB_EXPORT rc_t CC VDatabaseListDB ( const VDatabase *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcListing, rcSelf, rcNull );
-        else
-        {
-            if ( self->kdb == NULL )
-                rc = RC ( rcVDB, rcDatabase, rcListing, rcParam, rcNull );
-            else
-            {
-                return KDatabaseListDB ( self->kdb, names );
-            }
-        }
-        *names = NULL;
-    }
-    return rc;
-}
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- */
-LIB_EXPORT rc_t CC VDatabaseGetUserData ( const VDatabase *self, void **data )
-{
-    rc_t rc;
-
-    if ( data == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * data = self -> user;
-            return 0;
-        }
-
-        * data = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseSetUserData ( const VDatabase *cself,
-    void *data, void ( CC * destroy ) ( void *data ) )
-{
-    VDatabase *self = ( VDatabase* ) cself;
-    if ( cself == NULL )
-        return RC ( rcVDB, rcDatabase, rcUpdating, rcSelf, rcNull );
-
-    self -> user = data;
-    self -> user_whack = destroy;
-
-    return 0;
-}
-
-
-/* OpenKDatabase
- *  returns a new reference to underlying KDatabase
- */
-LIB_EXPORT rc_t CC VDatabaseOpenKDatabaseRead ( const VDatabase *self, const KDatabase **kdb )
-{
-    rc_t rc;
-
-    if ( kdb == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> kdb );
-            if ( rc == 0 )
-            {
-                * kdb = self -> kdb;
-                return 0;
-            }
-        }
-
-        * kdb = NULL;
-    }
-
-    return rc;
-}
-
-
-
-/* Typespec
- *  retrieve db typespec
- *
- *  AVAILABILITY: version 2.2
- *
- *  "ts_buff" [ IN ] and "ts_size" [ IN ] - buffer for return of NUL-terminated
- *  db typespec, e.g. 'NCBI:db:abc#1.1'
- */
-LIB_EXPORT rc_t CC VDatabaseTypespec ( const VDatabase *self, char *ts_buff, size_t ts_size )
-{
-    rc_t rc;
-
-    if ( ts_size == 0 )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcBuffer, rcInsufficient );
-    else if ( ts_buff == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcBuffer, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc_t rc2;
-            rc2 = string_printf ( ts_buff, ts_size, NULL, "%N#%V", self -> sdb -> name, self -> sdb -> version );
-            if ( rc2 == 0 )
-                return 0;
-            rc = rc2;
-        }
-
-        ts_buff [ 0 ] = 0;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/database-depend.c b/libs/vdb/database-depend.c
deleted file mode 100644
index 1b010db..0000000
--- a/libs/vdb/database-depend.c
+++ /dev/null
@@ -1,1802 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <vdb/vdb-priv.h> /* VDBManagerGetKDBManagerRead */
-#include <vdb/manager.h> /* VDBManagerRelease */
-#include <vdb/cursor.h>
-#include <vdb/table.h>
-#include <vdb/database.h>
-#include <vdb/dependencies.h>
-
-#include <kdb/kdb-priv.h> /* KDBManagerGetVFSManager */
-#include <kdb/manager.h>
-
-#include <vfs/manager.h> /* VFSManager */
-#include <vfs/resolver.h> /* VResolver */
-#include <vfs/path.h>
-
-#include <kfg/config.h>
-
-#include <klib/container.h>
-#include <klib/printf.h> /* string_printf */
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include "cursor-priv.h"
-
-/* missing macros/function from klib/rc.h
- */
-#define GetRCSTATE( rc ) \
-    ( ( rc ) & 0x00003FFF )
-#define RC_STATE( obj, state)                         \
-    ( rc_t ) ( ( ( rc_t ) ( obj ) << 6 ) |            \
-               ( ( rc_t ) ( state ) ) )
-
-#include <assert.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-static bool OLD = true;
-
-typedef struct {
-    /* deprecated way */
-    char ref[PATH_MAX + 1];
-
-    /* new way */
-    const String *local;
-    const String *remote;
-    const String *cache;
-
-    uint32_t count;
-    rc_t rc;
-} Resolved;
-typedef struct {
-    BSTNode n;
-
-    bool circular;
-    char* name;
-    uint32_t readLen;
-    char* seqId;
-    bool local;
-
-    Resolved resolved;
-} RefNode;
-static rc_t _ResolvedRelease(Resolved *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    free((void*)self->local);
-    free((void*)self->cache);
-    free((void*)self->remote);
-
-    memset(self, 0, sizeof *self);
-
-    return rc;
-}
-
-
-static void CC bstWhack( BSTNode* n, void* ignore )
-{
-    RefNode* sn = (RefNode*) n;
-
-    assert( sn );
-
-    free( sn->name );
-
-    free( sn->seqId );
-
-    _ResolvedRelease( &sn->resolved );
-
-    memset( sn, 0, sizeof *sn );
-
-    free( sn );
-}
-
-static
-int CC bstCmpBySeqId(const void* item, const BSTNode* n)
-{
-    const char* s1 = item;
-    const RefNode* sn = (const RefNode*) n;
-
-    assert(s1 && sn);
-
-    return strcmp(s1, sn->seqId);
-}
-
-static int CC bstCmpByRemote(const void* item, const BSTNode* n)
-{
-    const String* s1 = item;
-    const RefNode* sn = (const RefNode*) n;
-
-    assert(sn);
-
-    if (s1 == NULL) {
-        return sn->resolved.remote != NULL;
-    }
-    else {
-        int min = s1->size < sn->resolved.remote->size
-            ? s1->size : sn->resolved.remote->size;
-        return strncmp(s1->addr, sn->resolved.remote->addr, min);
-    }
-}
-
-static
-int CC bstSortBySeqId(const BSTNode* item, const BSTNode* n)
-{
-    const RefNode* sn = (const RefNode*) item;
-
-    return bstCmpBySeqId(sn->seqId, n);
-}
-
-static
-int CC bstSortByRemote(const BSTNode* item, const BSTNode* n)
-{
-    const RefNode* sn = (const RefNode*) item;
-
-    return bstCmpByRemote(sn->resolved.remote, n);
-}
-
-typedef struct Column {
-    uint32_t idx;
-    const char* name;
-    uint32_t expected;
-    uint32_t elem_bits;
-} Column;
-
-static
-rc_t AddColumn(rc_t rc, const VCursor* curs, Column* col)
-{
-    if (rc == 0) {
-        assert(curs && col);
-
-        rc = VCursorAddColumn(curs, &col->idx, col->name);
-    }
-
-    return rc;
-}
-
-/* Read a column data from a Cursor */
-static
-rc_t CursorRead(rc_t rc, const VCursor* curs, int64_t row_id,
-    const Column* col, void* buffer, uint32_t blen, uint32_t* row_len)
-{
-    assert(curs);
-
-    if (rc == 0) {
-        uint32_t elem_bits = col->elem_bits;
-        uint32_t expected = col->expected;
-        assert(col);
-
-        if (blen == 0) {
-            assert(buffer == NULL);
-            ++blen;
-        }
-
-        rc = VCursorReadDirect
-            (curs, row_id, col->idx, elem_bits, buffer, blen - 1, row_len);
-
-        if (rc != 0) {
-            if (buffer == NULL &&
-                rc == RC(rcVDB, rcCursor, rcReading, rcBuffer, rcInsufficient))
-            {
-                rc = 0;
-            }
-        }
-        else {
-            if (expected > 0 && *row_len != expected) {
-                rc = RC(rcVDB, rcCursor, rcReading, rcData, rcUnexpected);
-            }
-            if (buffer != NULL && expected == 0)
-            {   ((char*)buffer)[*row_len] = '\0'; }
-        }
-    }
-
-    return rc;
-}
-
-#if 0
-/* Read a String from Configuration into "value" buffer */
-static rc_t ReadCfgStr
-(const KConfig* kfg, const char* path, char* value, size_t value_sz)
-{
-    rc_t rc = 0;
-    const KConfigNode *node = NULL;
-
-    rc = KConfigOpenNodeRead(kfg, &node, path);
-    if (rc == 0) {
-        size_t num_read = 0;
-        size_t remaining = 0;
-        rc = KConfigNodeRead
-            (node, 0, value, value_sz - 1, &num_read, &remaining);
-        if (rc == 0) {
-            if (remaining != 0)
-            {   rc = RC(rcVDB, rcString, rcReading, rcSize, rcExcessive); }
-/* TODO: make sure check value[num_read] assignment is valid
-         when remaining == 0 */
-            else { value[num_read] = '\0'; }
-        }
-    }
-
-    RELEASE(KConfigNode, node);
-
-    return rc;
-}
-#endif
-
-#define SIZE 4096
-
-/* Ctx struct is used to find a file using KConfig "refseq" parameters */
-typedef struct {
-    KDirectory* dir;
-
-    char servers[SIZE];
-    char volumes[SIZE];
-    char paths[SIZE];
-
-    VResolver* resolver;
-
-    const Resolved* last;
-    bool hasDuplicates;
-} Ctx;
-static rc_t CtxInit(Ctx* self, const VDatabase *db) {
-    rc_t rc = 0;
-    KConfig* cfg = NULL;
-
-    assert(self && db);
-
-    memset(self, 0, sizeof *self);
-
-    if (rc == 0) {
-        rc = KConfigMake(&cfg, NULL);
-        if (rc == 0) {
-            const KConfigNode *node = NULL;
-            rc = KConfigOpenNodeRead(cfg, &node, "repository");
-            if (rc == 0) {
-                OLD = false;
-                LOGMSG(klogInfo, "KConfig(repository) found: using VResolver");
-            }
-            else {
-                OLD = true;
-                LOGMSG(klogInfo,
-                    "KConfig(repository) not found: not using VResolver");
-            }
-            RELEASE(KConfigNode, node);
-        }
-    }
-
-#if 0
-    if (OLD) {
-        if (self->dir != NULL) {
-            return rc;
-        }
-
-        rc = KDirectoryNativeDir(&self->dir);
-
-        if (rc == 0) {
-            const char path[] = "refseq/servers";
-            rc = ReadCfgStr(cfg, path, self->servers, sizeof self->servers);
-            if (rc != 0) {
-                if (GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-            }
-            else {
-                const char path[] = "refseq/volumes";
-                rc = ReadCfgStr(cfg, path, self->volumes, sizeof self->volumes);
-                if (rc != 0) {
-                    if (GetRCState(rc) == rcNotFound)
-                    {   rc = 0; }
-                }
-            }
-
-            if (rc == 0) {
-                const char path[] = "refseq/paths";
-                rc = ReadCfgStr(cfg, path, self->paths, sizeof self->paths);
-                if (rc != 0) {
-                    if (GetRCState(rc) == rcNotFound)
-                    {   rc = 0; }
-                }
-            }
-        }
-    }
-    else
-#endif
-    {
-        const VDBManager *mgr = NULL;
-        const VFSManager* vfsmgr = NULL;
-        const KDBManager* kmgr = NULL;
-
-        if (rc == 0) {
-            rc = VDatabaseOpenManagerRead(db, &mgr);
-        }
-
-        if (rc == 0) {
-            rc = VDBManagerGetKDBManagerRead(mgr, &kmgr);
-        }
-
-        if (rc == 0) {
-            rc = KDBManagerGetVFSManager(kmgr, &vfsmgr);
-        }
-
-        if (rc == 0) {
-            rc = VFSManagerGetResolver(vfsmgr, &self->resolver);
-        }
-
-        RELEASE(VFSManager, vfsmgr);
-        RELEASE(KDBManager, kmgr);
-        RELEASE(VDBManager, mgr);
-    }
-
-    RELEASE(KConfig, cfg);
-
-    return rc;
-}
-
-static rc_t CtxDestroy(Ctx* self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    RELEASE(KDirectory, self->dir);
-    RELEASE(VResolver, self->resolver);
-
-    memset(self, 0, sizeof *self);
-
-    return rc;
-}
-
-typedef struct {
-    const char* file;
-    bool found;
-} FindRefseq;
-#if 0
-static rc_t CC is_file_in_dir(const KDirectory* dir,
-    uint32_t type, const char* name, void* data)
-{
-    rc_t rc = 0;
-
-    FindRefseq* t = data;
-
-    assert(dir && name && data && t->file);
-
-    if (strcmp(t->file, name) == 0) {
-        uint64_t size = 0;
-        rc = KDirectoryFileSize(dir, &size, name);
-        if (rc == 0 && size > 0) {
-            /* compensate configuration-assistant.perl behavior:
-               it used to create an empty refseq file
-               when failed to download it */
-            t->found = true;
-        }
-    }
-
-    return rc;
-}
-/* Find file within srv/vol. If found then copy complete path to buf.
- * Return true if found
- */
-static bool FindInDir(rc_t* aRc, const KDirectory* native, const char* srv,
-    const char* vol, const char* file, char* buf, size_t blen)
-{
-    rc_t rc = 0;
-
-    const KDirectory* dir = NULL;
-
-    FindRefseq t;
-
-    assert(aRc && native && srv && file && buf && blen);
-
-    rc = *aRc;
-
-    if (rc != 0)
-    {   return false; }
-
-    if (vol)
-    {   rc = KDirectoryOpenDirRead(native, &dir, false, "%s/%s", srv, vol); }
-    else
-    {   rc = KDirectoryOpenDirRead(native, &dir, false, srv); }
-
-    if (rc == 0) {
-        memset(&t, 0, sizeof t);
-        t.file = file;
-        rc = KDirectoryVVisit(dir, false, is_file_in_dir, &t, ".", NULL);
-        if (GetRCObject(rc) == rcDirectory && GetRCState(rc) == rcUnauthorized)
-        {   rc = 0; }
-
-        if (rc == 0 && t.found) {
-            if (vol) {
-                rc = KDirectoryResolvePath(native,
-                    true, buf, blen, "%s/%s/%s", srv, vol, file);
-            }
-            else {
-                rc = KDirectoryResolvePath(native,
-                    true, buf, blen, "%s/%s", srv, file);
-            }
-        }
-    }
-    else if (rc == SILENT_RC(rcFS,
-        rcDirectory, rcOpening, rcPath, rcIncorrect))
-    {
-        /* ignored nonexistent directory */
-        rc = 0;
-    }
-
-    RELEASE(KDirectory, dir);
-
-    *aRc = rc;
-
-    return t.found;
-}
-#endif
-#define rcResolver   rcTree
-static bool NotFoundByResolver(rc_t rc) {
-    if (GetRCModule(rc) == rcVFS) {
-        if (GetRCTarget(rc) == rcResolver) {
-            if (GetRCContext(rc) == rcResolving) {
-                if (GetRCState(rc) == rcNotFound) {
-                    return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-/* find remote reference using VResolver */
-static rc_t FindRef(Ctx* ctx, const char* seqId, Resolved* resolved,
-    int cacheState)
-{
-    rc_t rc = 0;
-
-    VPath* acc = NULL;
-    const VPath *remote = NULL;
-    size_t num_writ = 0;
-    char ncbiAcc[512] = "";
-
-    assert(ctx && resolved);
-
-    if (cacheState != -1) {
-        VResolverCacheEnable(ctx->resolver, cacheState);
-    }
-
-    if (rc == 0) {
-        rc = string_printf(ncbiAcc, sizeof ncbiAcc, &num_writ,
-            "ncbi-acc:%s?vdb-ctx=refseq", seqId);
-        if (rc == 0 && num_writ > sizeof ncbiAcc) {
-            return RC(rcExe, rcFile, rcCopying, rcBuffer, rcInsufficient);
-        }
-    }
-
-    if (rc == 0)
-    {
-        VFSManager *mgr;
-        rc = VFSManagerMake ( & mgr );
-        if ( rc == 0 )
-        {
-            rc = VFSManagerMakePath ( mgr, &acc, ncbiAcc);
-            VFSManagerRelease ( mgr );
-        }
-    }
-
-    if (rc == 0) {
-        bool remoteNotFound = false;
-        const VPath *local = NULL;
-        rc = VResolverLocal(ctx->resolver, acc, &local);
-        if (rc == 0) {
-            rc = VPathMakeString(local, &resolved->local);
-            RELEASE(VPath, local);
-        }
-        else if (NotFoundByResolver(rc)) {
-            rc = 0;
-        }
-
-        if (rc == 0) {
-            rc = VResolverRemote(ctx->resolver, eProtocolHttp, acc, &remote, NULL);
-            if (rc == 0) {
-                rc = VPathMakeString(remote, &resolved->remote);
-                if (rc == 0) {
-                    char *fragment = string_chr(resolved->remote->addr,
-                        resolved->remote->size, '#');
-                    if (fragment != NULL) {
-                        *fragment = '\0';
-                    }
-                }
-            }
-            else if (NotFoundByResolver(rc)) {
-                remoteNotFound = true;
-                rc = 0;
-            }
-        }
-
-        if (rc == 0 && !remoteNotFound) {
-            uint64_t file_size = 0;
-            const VPath *cache = NULL;
-            rc = VResolverCache(ctx->resolver, remote, &cache, file_size);
-            if (rc == 0) {
-                rc = VPathMakeString(cache, &resolved->cache);
-            }
-            else if (NotFoundByResolver(rc)) {
-                rc = 0;
-            }
-            RELEASE(VPath, cache);
-        }
-
-        if (rc == 0) {
-            if (ctx->last == NULL) {
-                ctx->last = resolved;
-            }
-            else {
-                const String *last = ctx->last->remote;
-                const String *crnt = resolved->remote;
-                if (last != NULL && crnt != NULL &&
-                    last->addr != NULL && crnt->addr != NULL)
-                {
-                    int min = crnt->size < last->size ? crnt->size : last->size;
-                    if (strncmp(last->addr, crnt->addr, min) == 0) {
-                        ctx->hasDuplicates = true;
-                    }
-                }
-            }
-        }
-    }
-
-    RELEASE(VPath, remote);
-    RELEASE(VPath, acc);
-
-    if (cacheState != -1) {
-        VResolverCacheEnable(ctx->resolver, vrAlwaysDisable);
-    }
-
-    return rc;
-}
-#if 0
-/* find remote reference using KConfig values */
-static
-rc_t DeprecatedFindRef(Ctx* ctx, const char* seqId, Resolved* resolved)
-{
-    rc_t rc = 0;
-    bool found = false;
-
-    int i = ~0;
-
-    char* buf = NULL;
-    size_t blen = 0;
-
-    assert(ctx && seqId && resolved);
-
-    memset(resolved, 0, sizeof *resolved);
-    buf = resolved->ref;
-    blen = sizeof resolved->ref;
-
-    for (i = 0; i < 2 && !found; ++i) {
-        char prefix[7] = "";
-        if (i > 0) {
-            if (strlen(seqId) > 6) {
-                strncpy(prefix, seqId, 6);
-                prefix[6] = '\0';
-                seqId = prefix;
-            }
-            else {
-                break;
-            }
-        }
-        if (rc == 0 && ctx->dir != NULL) {
-            if (FindInDir(&rc, ctx->dir, ".", NULL, seqId, buf, blen)) {
-                found = true;
-            }
-            else {
-                if (ctx->paths[0]) {
-                    char paths[SIZE];
-                    char* path_rem = paths;
-                    char* path_sep = NULL;
-                    strcpy(paths, ctx->paths);
-                    do {
-                        char const* path = path_rem;
-                        path_sep = strchr(path, ':');
-                        if (path_sep) {
-                            path_rem = path_sep + 1;
-                            *path_sep = 0;
-                        }
-                        if (FindInDir(&rc, ctx->dir, path, NULL,
-                            seqId, buf, blen))
-                        {
-                            found = true;
-                            break;
-                        }
-                    } while(path_sep && rc == 0);
-                }
-                if (!found && ctx->servers[0] && ctx->volumes[0]) {
-                    char server[SIZE];
-                    char vol[SIZE];
-                    char* srv_sep = NULL;
-                    char* srv_rem = server;
-                    strcpy(server, ctx->servers);
-    /* TODO check for multiple servers/volumes */
-                    do {
-                        char* vol_rem = vol;
-                        char* vol_sep = NULL;
-                        strcpy(vol, ctx->volumes);
-                        srv_sep = strchr(server, ':');
-                        if (srv_sep) {
-                            srv_rem = srv_sep + 1;
-                            *srv_sep = '\0';
-                        }
-                        do {
-                            char const* volume = vol_rem;
-                            vol_sep = strchr(volume, ':');
-                            if (vol_sep) {
-                                vol_rem = vol_sep + 1;
-                                *vol_sep = 0;
-                            }
-                            if (FindInDir(&rc, ctx->dir, server, volume,
-                                seqId, buf, blen))
-                            {
-                                found = true;
-                                break;
-                            }
-                        } while (vol_sep && rc == 0);
-                    } while (!found && srv_sep && rc == 0);
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-#endif
-typedef struct {
-/* row values */
-    uint32_t readLen;
-    char circular[8];
-    char name[256];
-    char seqId[256];
-
-/* we do not read CMP_READ value, just its row_len */
-    uint32_t row_lenCMP_READ;
-} Row;
-/* Add a REFERENCE table Row to BSTree */
-static
-rc_t AddRow(BSTree* tr, Row* data, Ctx* ctx, int cacheState)
-{
-    rc_t rc = 0;
-    bool newRemote = false;
-    RefNode* sn = NULL;
-
-    assert(tr && data && ctx);
-
-    sn = (RefNode*) BSTreeFind(tr, data->seqId, bstCmpBySeqId);
-    if (sn == NULL) {
-        sn = calloc(1, sizeof *sn);
-        if (sn == NULL) {
-            return RC
-                (rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-        sn->seqId = string_dup_measure(data->seqId, NULL);
-        if (sn->seqId == NULL) {
-            bstWhack((BSTNode*) sn, NULL);
-            sn = NULL;
-            return RC
-                (rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-
-        sn->name = string_dup_measure(data->name, NULL);
-        if (sn->name == NULL) {
-            bstWhack((BSTNode*) sn, NULL);
-            sn = NULL;
-            return RC
-                (rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        }
-
-        sn->circular = data->circular[0];
-        sn->readLen = data->readLen;
-        sn->local = (data->row_lenCMP_READ != 0);
-        newRemote = ! sn->local;
-
-        BSTreeInsert(tr, (BSTNode*)sn, bstSortBySeqId);
-    }
-    else {
-        if (data->row_lenCMP_READ != 0) {
-            sn->local = true;
-        }
-        if (strcmp(sn->name, data->name) || sn->circular != data->circular[0]) {
-            return RC(rcVDB, rcCursor, rcReading, rcData, rcInconsistent);
-        }
-        sn->readLen += data->readLen;
-    }
-
-    if (rc == 0 && newRemote) {
-/*      if (OLD) {
-            rc = DeprecatedFindRef(ctx, sn->seqId, &sn->resolved);
-        }
-        else { */
-            rc = FindRef(ctx, sn->seqId, &sn->resolved, cacheState);
-/*      } */
-    }
-
-    return rc;
-}
-
-struct VDBDependencies {
-    uint32_t count;
-    RefNode** dependencies;
-
-    BSTree* tr;
-
-    /* open references */
-    KRefcount refcount;
-};
-typedef struct Initializer {
-    bool all;            /* IN: when false: process just missed */
-    bool fill;           /* IN:
-                          false: count(fill count); true: fill dep(use count) */
-    uint32_t count;      /* IO: all/missed count */
-    VDBDependencies* dep;/* OUT: to be filled */
-    uint32_t i;          /* PRIVATE: index in dep */
-    rc_t rc;             /* OUT */
-} Initializer;
-/* Work function to process dependencies tree
- * Input parameters are in Initializer:
- *  all (true: all dependencies, false: just missing)
- *  fill(false: count dependencies, true: fill dependencies array
- */
-static void CC bstProcess(BSTNode* n, void* data) {
-    RefNode* elm = (RefNode*) n;
-    Initializer* obj = (Initializer*) data;
-    bool go = false;
-
-    assert(elm && obj);
-
- /* remore reference && refseq table not found */
-    if (obj->all) {
-        go = true;
-    }
-    else if (!elm->local) {
-        if (OLD) {
-            if (elm->resolved.ref[0] == '\0') {
-                go = true;
-            }
-        }
-        else {
-            if (elm->resolved.local == NULL) {
-                go = true;
-            }
-        }
-    }
-
-    if (!go) {
-        return;
-    }
-
-    if (!obj->fill) {
-        ++obj->count;
-    }
-    else {
-        if (obj->dep == NULL || obj->dep->dependencies == NULL) {
-            return;
-        }
-        if (obj->i < obj->count) {
-            *(obj->dep->dependencies + ((obj->i)++)) = elm;
-        }
-        else {
-            obj->rc = RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcCorrupt);
-        }
-    }
-}
-
-/* Read REFERENCE table; fill in BSTree */
-static
-rc_t CC VDatabaseDependencies(const VDatabase *self, BSTree* tr,
-    bool* has_no_REFERENCE, bool* hasDuplicates, bool disableCaching)
-{
-    rc_t rc = 0;
-
-    int64_t i = 0;
-    int64_t firstId = 0;
-    int64_t lastId = 0;
-
-    Column CIRCULAR = { 0, "CIRCULAR", 1,  8 };
-    Column CMP_READ = { 0, "CMP_READ", 0,  8 };
-    Column NAME     = { 0, "NAME"    , 0,  8 };
-    Column READ_LEN = { 0, "READ_LEN", 1, 32 };
-    Column SEQ_ID   = { 0, "SEQ_ID",   0,  8 };
-
-    const VTable* tbl = NULL;
-    const VCursor* curs = NULL;
-
-    int cacheState = -1;
-
-    Ctx ctx;
-
-    assert(self && tr && has_no_REFERENCE);
-
-    *has_no_REFERENCE = false;
-
-    if (rc == 0) {
-        rc = CtxInit(&ctx, self);
-    }
-
-    if (rc == 0 && disableCaching) {
-        cacheState = VResolverCacheEnable(ctx.resolver, vrAlwaysDisable);
-    }
-
-
-    if (rc == 0) {
-        rc = VDatabaseOpenTableRead(self, &tbl, "REFERENCE");
-        if (GetRCState(rc) == rcNotFound) {
-            *has_no_REFERENCE = true;
-        }
-    }
-    if (rc == 0) {
-        rc = VTableCreateCursorReadInternal(tbl, &curs);
-    }
-
-    rc = AddColumn(rc, curs, &CIRCULAR);
-    rc = AddColumn(rc, curs, &CMP_READ);
-    rc = AddColumn(rc, curs, &NAME    );
-    rc = AddColumn(rc, curs, &READ_LEN);
-    rc = AddColumn(rc, curs, &SEQ_ID  );
-
-    if (rc == 0) {
-        rc = VCursorOpen(curs);
-    }
-    if (rc == 0) {
-        uint64_t count = 0;
-        rc = VCursorIdRange(curs, 0, &firstId, &count);
-        lastId = firstId + count - 1;
-    }
-
-    for (i = firstId; i <= lastId && rc == 0; ++i) {
-        uint32_t row_len = 0;
-        Row data;
-        if (rc == 0) {
-            rc = CursorRead(rc, curs, i, &CIRCULAR,
-                data.circular, sizeof data.circular, &row_len);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "failed to read cursor(col='CIRCULAR', spot='$(id)')",
-                    "id=%ld", i));
-            }
-        }
-        if (rc == 0) {
-            rc = CursorRead(rc, curs, i, &CMP_READ,
-                NULL, 0, &data.row_lenCMP_READ);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "failed to read cursor(col='CMP_READ', spot='$(id)')",
-                    "id=%ld", i));
-            }
-        }
-        if (rc == 0) {
-            rc = CursorRead(rc, curs, i, &NAME,
-                data.name, sizeof data.name, &row_len);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "failed to read cursor(col='NAME', spot='$(id)')",
-                    "id=%ld", i));
-            }
-        }
-        if (rc == 0) {
-            rc = CursorRead(rc, curs, i, &READ_LEN,
-                &data.readLen, sizeof data.readLen, &row_len);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "failed to read cursor(col='READ_LEN', spot='$(id)')",
-                    "id=%ld", i));
-            }
-        }
-        if (rc == 0) {
-            rc = CursorRead(rc, curs, i, &SEQ_ID,
-                data.seqId, sizeof data.seqId, &row_len);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "failed to read cursor(col='SEQ_ID', spot='$(id)')",
-                    "id=%ld", i));
-            }
-        }
-        if (rc == 0) {
-            rc = AddRow(tr, &data, &ctx, cacheState);
-        }
-    }
-
-    if (rc == 0 && hasDuplicates != NULL) {
-        *hasDuplicates = ctx.hasDuplicates;
-    }
-
-    if (*has_no_REFERENCE) {
-        rc = 0;
-    }
-
-    if (cacheState != -1) {
-        VResolverCacheEnable(ctx.resolver, cacheState);
-    }
-
-    {
-        rc_t rc2 = CtxDestroy(&ctx);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    RELEASE(VCursor, curs);
-    RELEASE(VTable, tbl);
-
-    return rc;
-}
-
-/* Get dependency number "idx" */
-static
-rc_t VDBDependenciesGet(const VDBDependencies* self,
-    RefNode** dep, uint32_t idx)
-{
-    rc_t rc = 0;
-
-    assert(dep);
-
-    if (self == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull);
-    }
-
-    if (idx >= self->count) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcExcessive);
-    }
-
-    *dep = *(self->dependencies + idx);
-    if (*dep == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcCorrupt);
-    }
-
-    return rc;
-}
-
-/* Count
- *  retrieve the number of dependencies
- *
- *  "count" [ OUT ] - return parameter for dependencies count
- */
-LIB_EXPORT rc_t CC VDBDependenciesCount(const VDBDependencies* self,
-    uint32_t* count)
-{
-    if (self == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull);
-    }
-
-    if (count == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    *count = self->count;
-
-    return 0;
-}
-
-/* Circular */
-LIB_EXPORT rc_t CC VDBDependenciesCircular(const VDBDependencies* self,
-    bool* circular, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (circular == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        *circular = dep->circular;
-    }
-
-    return rc;
-}
-
-/* Local
- *  retrieve local property
- *
- *  "local" [ OUT ] - true if object is stored internally
- *
- *  "idx" [ IN ] - zero-based index of dependency
- */
-LIB_EXPORT rc_t CC VDBDependenciesLocal(const VDBDependencies* self,
-    bool* local, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (local == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        *local = dep->local;
-    }
-
-    return rc;
-}
-
-/* Name
- *
- * "name" [ OUT ] - returned pointed should not be released.
- *                  it becomes invalid after VDBDependenciesRelease
- */
-LIB_EXPORT rc_t CC VDBDependenciesName(const VDBDependencies* self,
-    const char** name, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (name == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        *name = dep->name;
-    }
-
-    return rc;
-}
-
-static rc_t VDBDependencyGetPath(const String* from, const char** to) {
-    assert(to);
-
-    *to = NULL;
-
-    if (OLD) {
-        return 0;
-    }
-
-    if (from == NULL) {
-        return 0;
-    }
-
-    if (from->addr != NULL && from->size > 0 &&
-        from->addr[from->size - 1] != '\0' &&
-        from->addr[from->size] != '\0')
-    {
-        return RC(rcVDB, rcString, rcValidating, rcChar, rcInvalid);
-    }
-
-    *to = from->addr;
-    return 0;
-}
-
-/* Path
- *  for remote dependencies: returns:
- *                              path for resolved dependency,
- *                              NULL for missing dependency.
- *  returns NULL for local dependencies
- *
- * "path" [ OUT ] - returned pointed should not be released.
- *                  it becomes invalid after VDBDependenciesRelease
- */
-LIB_EXPORT rc_t CC VDBDependenciesPath(const VDBDependencies* self,
-    const char** path, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (path == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        if (dep->local) {
-            *path = NULL;
-        }
-        else {
-            if (OLD) {
-                *path = dep->resolved.ref;
-            }
-            else {
-                rc = VDBDependencyGetPath(dep->resolved.local, path);
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBDependenciesPathRemote(const VDBDependencies* self,
-    const char** path, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (path == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        rc = VDBDependencyGetPath(dep->resolved.remote, path);
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBDependenciesPathCache(const VDBDependencies* self,
-    const char** path, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (path == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        rc = VDBDependencyGetPath(dep->resolved.cache, path);
-    }
-
-    return rc;
-}
-
-/* SeqId
- *
- * "seq_id" [ OUT ] - returned pointed should not be released.
- *                    it becomes invalid after VDBDependenciesRelease
- */
-LIB_EXPORT rc_t CC VDBDependenciesSeqId(const VDBDependencies* self,
-    const char** seq_id, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (seq_id == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        *seq_id = dep->seqId;
-    }
-
-    return rc;
-}
-
-/* Type
- *
- * "type" [ OUT ] - a KDBPathType from kdb/manager.h
- */
-LIB_EXPORT rc_t CC VDBDependenciesType(const VDBDependencies* self,
-    uint32_t* type, uint32_t idx)
-{
-    rc_t rc = 0;
-    RefNode* dep = NULL;
-
-    if (type == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    rc = VDBDependenciesGet(self, &dep, idx);
-
-    if (rc == 0) {
-        *type = kptTable;
-    }
-
-    return rc;
-}
-
-#define CLSNAME "VDBDependencies"
-
-VDB_EXTERN rc_t CC VDBDependenciesAddRef(const VDBDependencies* self ) {
-    if (self != NULL) {
-        switch (KRefcountAdd(&self->refcount, CLSNAME)) {
-            case krefLimit:
-                return RC(rcVDB, rcDatabase, rcAttaching, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-static rc_t VDBDependenciesWhack(VDBDependencies* self) {
-    if (self == NULL) {
-        return 0;
-    }
-
-    KRefcountWhack(&self->refcount, CLSNAME);
-
-    BSTreeWhack(self->tr, bstWhack, NULL);
-    free(self->tr);
-
-    free(self->dependencies);
-
-    memset(self, 0, sizeof *self);
-
-    free(self);
-
-    return 0;
-}
-
-/* Release
- *  (objects ARE NOT reference counted)
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC VDBDependenciesRelease(const VDBDependencies* self) {
-    if (self != NULL) {
-        switch (KRefcountDrop(&self->refcount, CLSNAME)) {
-        case krefWhack:
-            return VDBDependenciesWhack((VDBDependencies*)self);
-        case krefNegative:
-            return RC(rcVDB, rcDatabase, rcReleasing, rcRange, rcExcessive);
-        }
-    }
-
-    return 0;
-}
-
-typedef struct {
-    BSTree* tr;
-    int count;
-    bool all;
-} SBstCopy;
-static void CC bstCopy(BSTNode* n, void* data) {
-    RefNode* sn = NULL;
-    RefNode* elm = (RefNode*) n;
-    SBstCopy* x = (SBstCopy*)data;
-    BSTree* tr = x->tr;
-    bool go = false;
-    assert(elm && tr);
-
-    if (x->all) {
-        go = true;
-    } else if (!elm->local) {
-        assert(!OLD);
-        if (elm->resolved.local == NULL) {
-            go = true;
-        }
-    }
-
-    if (!go) {
-        return;
-    }
-
-    sn = (RefNode*) BSTreeFind(tr, elm->resolved.remote, bstCmpByRemote);
-    if (sn == NULL) {
-        sn = calloc(1, sizeof *sn);
-        if (sn == NULL) {
-/* TODO: generate error message */
-            return;
-        }
-
-        sn->seqId = string_dup_measure(elm->seqId, NULL);
-        if (sn->seqId == NULL) {
-            bstWhack((BSTNode*) sn, NULL);
-            return;
-        }
-
-        sn->name = string_dup_measure(elm->name, NULL);
-        if (sn->name == NULL) {
-            bstWhack((BSTNode*) sn, NULL);
-            return;
-        }
-
-        sn->circular = elm->circular;
-        sn->readLen = elm->readLen;
-        sn->local = elm->local;
-
-        sn->resolved.count = 1;
-
-        sn->resolved.local = elm->resolved.local;
-        elm->resolved.local = NULL;
-
-        sn->resolved.remote = elm->resolved.remote;
-        elm->resolved.remote = NULL;
-
-        sn->resolved.cache = elm->resolved.cache;
-        elm->resolved.cache = NULL;
-
-        BSTreeInsert(tr, (BSTNode*)sn, bstSortByRemote);
-        ++x->count;
-    }
-    else {
-        bool archived = false;
-        if (sn->resolved.rc != 0) {
-            return;
-        }
-        else if (sn->circular != elm->circular) {
-            sn->resolved.rc
-                = RC(rcVDB, rcNumeral, rcComparing, rcData, rcInvalid);
-        }
-        else if ((sn->name == NULL && elm->name != NULL)
-            || (sn->name != NULL && elm->name == NULL))
-        {
-            sn->resolved.rc
-                = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-        }
-        else if (strcmp(sn->name, elm->name) != 0) {
-            if (strncmp(sn->name, elm->name, 6) == 0) {
-                archived = true;
-            }
-            else {
-                sn->resolved.rc
-                    = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-            }
-        }
-
-        if (sn->resolved.rc != 0) {
-        }
-        else if (sn->readLen != elm->readLen && !archived) {
-            sn->resolved.rc
-                = RC(rcVDB, rcNumeral, rcComparing, rcData, rcInvalid);
-        }
-        else if (sn->seqId == NULL || elm->seqId == NULL) {
-            sn->resolved.rc
-                = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-        }
-        else if (sn->local != elm->local) {
-            sn->resolved.rc
-                = RC(rcVDB, rcNumeral, rcComparing, rcData, rcInvalid);
-        }
-        else if (sn->resolved.ref[0] != '\0' || elm->resolved.ref[0] != '\0') {
-            sn->resolved.rc
-                = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-        }
-        else if (sn->resolved.local != NULL || elm->resolved.local != NULL) {
-            sn->resolved.rc
-                = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-        }
-        else if (StringCompare(sn->resolved.remote, elm->resolved.remote) != 0)
-        {
-            int min = sn->resolved.remote->size < elm->resolved.remote->size
-                ? sn->resolved.remote->size : elm->resolved.remote->size;
-            if (!archived || strncmp(sn->resolved.remote->addr,
-                                elm->resolved.remote->addr, min) != 0)
-            {
-                sn->resolved.rc
-                    = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-            }
-        }
-
-        if (sn->resolved.rc != 0) {
-        }
-        else if (StringCompare(sn->resolved.cache, elm->resolved.cache) != 0)
-        {
-            sn->resolved.rc
-                = RC(rcVDB, rcString, rcComparing, rcData, rcInvalid);
-        }
-        else {
-            if (archived) {
-                int i = 0;
-                bool tail = false;
-                for (;;++i) {
-                    char* c1 = &sn->seqId[i];
-                    const char c2 = elm->seqId[i];
-                    if (*c1 == '\0') {
-                        break;
-                    }
-                    if (!tail && (c2 == '\0' || *c1 != c2)) {
-                        tail = true;
-                    }
-                    if (tail) {
-     /* incorrect:
-        we keep at least one seqid for archived refseqs to be able to resolve them
-                        *c1 = '.'; */
-                    }
-                }
-            }
-            ++sn->resolved.count;
-        }
-    }
-}
-
-/* ListDependencies
- *  create a dependencies object: list all dependencies
- *
- *  "dep" [ OUT ] - return for VDBDependencies object
- *
- *  "missing" [ IN ] - if true, list only missing dependencies
- *  otherwise, list all dependencies
- *
- * N.B. If missing == true then
- *     just one refseq dependency will be returned for 'container' Refseq files.
- */
-static rc_t VDatabaseListDependenciesImpl(const VDatabase* self,
-    const VDBDependencies** dep, bool missing, bool disableCaching)
-{
-    rc_t rc = 0;
-    VDBDependencies* obj = NULL;
-    bool all = ! missing;
-    bool has_no_REFERENCE = false;
-    bool hasDuplicates = false;
-
-    if (self == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull);
-    }
-    if (dep == NULL) {
-        return RC(rcVDB, rcDatabase, rcAccessing, rcParam, rcNull);
-    }
-
-    obj = calloc(1, sizeof *obj);
-    if (obj == NULL) {
-        return RC(rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    obj->tr = malloc(sizeof *obj->tr);
-    if (obj->tr == NULL) {
-        free(obj);
-        return RC(rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-    BSTreeInit(obj->tr);
-
-    /* initialize dependencie tree */
-    rc = VDatabaseDependencies(self, obj->tr,
-        &has_no_REFERENCE, &hasDuplicates, disableCaching);
-    if (rc == 0 && has_no_REFERENCE) {
-        KRefcountInit(&obj->refcount, 1, CLSNAME, "make", "nodep");
-        *dep = obj;
-        return rc;
-    }
-
-    if (rc == 0) {
-        Initializer init;
-        memset(&init, 0, sizeof init);
-
-        /* count all/missing dependencies */
-        init.all = all;
-        init.fill = false;
-        BSTreeForEach(obj->tr, false, bstProcess, &init);
-     /* now init.count = number of (all == true ? 'all' : 'missed') references*/
-
-        rc = init.rc;
-        if (rc == 0) {
-            obj->count = init.count;
-        }
-
-        if (rc == 0 && missing && hasDuplicates) {
-            /* references have duplicates. e.g. AAAB01... */
-            SBstCopy x;
-            BSTree* tr = malloc(sizeof *tr);
-            if (tr == NULL) {
-                rc = RC(rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                return rc;
-            }
-            BSTreeInit(tr);
-            x.count = 0;
-            x.tr = tr;
-            x.all = all;
-
-         /* compact obj->tr into tr, skip duplicates
-            x.count is the number of all references from obj.tr */
-            BSTreeForEach(obj->tr, false, bstCopy, &x);
-            BSTreeWhack(obj->tr, bstWhack, NULL);
-            free(obj->tr);
-            obj->tr = tr;
-            obj->count = init.count = x.count;
-        }
-
-        if (rc == 0) {
-            /* initialize dependencies array with pointers to tree values */
-            if (obj->count > 0) {
-                obj->dependencies
-                    = calloc(obj->count, sizeof obj->dependencies);
-                if (obj->dependencies == NULL) {
-                    free(obj);
-                    return RC
-                        (rcVDB, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                }
-                init.fill = true;
-                init.dep = obj;
-                BSTreeForEach(obj->tr, false, bstProcess, &init);
-                rc = init.rc;
-                if (rc == 0 && init.i != init.count) {
-                    rc = RC(rcVDB, rcDatabase, rcAccessing, rcSelf, rcCorrupt);
-                }
-            }
-        }
-    }
-
-    if (rc == 0) {
-        KRefcountInit(&obj->refcount, 1, CLSNAME, "make", "dep");
-        *dep = obj;
-    }
-    else {
-        VDBDependenciesRelease(obj);
-    }
-
-    return rc;
-}
-
-
-/* ListDependencies
- *  create a dependencies object: list all dependencies
- *
- *  "dep" [ OUT ] - return for VDBDependencies object
- *
- *  "missing" [ IN ] - if true, list only missing dependencies
- *  otherwise, list all dependencies
- *
- * N.B. If missing == true then
- *     just one refseq dependency will be returned for 'container' Refseq files.
- */
-LIB_EXPORT rc_t CC VDatabaseListDependencies(const VDatabase* self,
-    const VDBDependencies** dep, bool missing)
-{
-    return VDatabaseListDependenciesImpl(self, dep, missing, false);
-}
-
-
-/* ListDependenciesWithCaching
- *  create dependencies object: list dependencies
- *
- *  Call VResolverCacheEnable(cacheState) before reading VDatabase.
- *  It allows to control cache update inside the function.
- *
- *  "dep" [ OUT ] - return for VDBDependencies object
- *
- *  "missing" [ IN ] - if true, list only missing dependencies
- *  otherwise, list all dependencies
- *
- *  "disableCaching" [ IN ] - if true, disable caching inside of the function
- *  otherwise, do not change the caching state
- */
-LIB_EXPORT rc_t CC VDatabaseListDependenciesWithCaching (
-    struct VDatabase const *self,
-    const VDBDependencies **dep, bool missing,
-    bool disableCaching )
-{
-    return VDatabaseListDependenciesImpl(self, dep, missing, disableCaching);
-}
-
-
-static bool DependenciesError(rc_t rc) {
-    return GetRCModule(rc) == rcAlign && GetRCObject(rc) == rcTable
-          && GetRCState(rc) == rcNotFound;
-}
-
-typedef enum ErrType {
-    eUnknown,
-    eNoEncInKfg,
-    ePwdFileNotFound,
-    eBadPwdFile,
-    eBadEncKey
-} ErrType;
-static ErrType DependenciesType(rc_t rc) {
-    if (GetRCTarget(rc) == rcEncryptionKey)
-    {
-        switch (GetRCSTATE(rc))
-        {
-            /* no configuration or environment */
-        case RC_STATE(rcFile, rcUnknown):
-            return eNoEncInKfg;
-
-            /* no file where told to look */
-        case RC_STATE(rcFile, rcNotFound):
-            return ePwdFileNotFound;
-
-            /* after decryption the file wasn't a database object */
-        case RC_STATE(rcEncryption, rcIncorrect):
-            return eBadEncKey;
-
-        default:
-            break;
-        }
-    }
-    else if (GetRCTarget(rc) == rcMgr)
-    {
-        switch (GetRCSTATE(rc))
-        {
-        case RC_STATE(rcEncryptionKey, rcTooShort): /* too short */
-        case RC_STATE(rcEncryptionKey, rcTooLong): /* too long */
-            return eBadPwdFile;
-
-        default:
-            break;
-        }
-    }
-    return eUnknown;
-}
-
-LIB_EXPORT bool CC UIError( rc_t rc,
-    const VDatabase* db, const VTable* table)
-{
-    bool retval = false;
-    if( db != NULL || table != NULL ) {
-      if( DependenciesError(rc) ) {
-        if( db != NULL ) {
-            VDatabaseAddRef(db);
-        } else if( VTableOpenParentRead(table, &db) != 0 ) {
-            db = NULL;
-        }
-        if( db != NULL ) {
-            const VTable* ref;
-            if( VDatabaseOpenTableRead(db, &ref, "REFERENCE") == 0 ) {
-                const VCursor* c;
-                if( VTableCreateCachedCursorRead(ref, &c, 0) == 0 ) {
-                    uint32_t i;
-                    retval = VCursorAddColumn(c, &i, "CIRCULAR") == 0
-                        && VCursorOpen(c) == 0;
-                    VCursorRelease(c);
-                }
-                VTableRelease(ref);
-            }
-            VDatabaseRelease(db);
-        }
-      }
-    }
-    else if (db == NULL && table == NULL) {
-        ErrType type = DependenciesType(rc);
-        if (type != eUnknown) {
-            retval = true;
-        }
-    }
-    return retval;
-}
-
-static
-void CC VDBDependenciesLOGMissing( rc_t rc,
-    const VDatabase* db, bool log_list )
-{
-    static bool once = false;
-    if( !once ) {
-      KWrtHandler handler;
-
-      once = true;
-
-      handler.writer = KOutWriterGet();
-      handler.data = KOutDataGet();
-      KOutHandlerSetStdErr();
-
-      if (DependenciesError(rc)) {
-        OUTMSG(("This operation requires access to external"
-            " reference sequence(s) that could not be located\n"));
-        if (db && log_list) {
-            const VDBDependencies* dep = NULL;
-            uint32_t i, count = 0;
-            if( VDatabaseListDependencies(db, &dep, true) == 0 &&
-                VDBDependenciesCount(dep, &count) == 0 ) {
-                for(i = 0; i < count; i++) {
-                    const char* name = NULL, *seqId = NULL;
-                    if (VDBDependenciesName(dep, &name, i) == 0
-                            && VDBDependenciesSeqId(dep, &seqId, i) == 0)
-                    {
-                        OUTMSG(("Reference sequence %s %s was not found\n",
-                                seqId, name));
-                    }
-                }
-                VDBDependenciesRelease(dep);
-            }
-        }
-        OUTMSG((
-              "Please run \"perl configuration-assistant.perl\" and try again\n"
-            ));
-      }
-      else {
-        switch (DependenciesType(rc)) {
-            case eNoEncInKfg:
-                OUTMSG((
-"The file you are trying to open is encrypted,\n"
-"but no decryption password could be located.\n"
-"To set up a password,\n"
-"run the 'configuration-assistant.perl' script provided with the toolkit.\n"));
-                break;
-            case ePwdFileNotFound:
-                OUTMSG((
-"The file you are trying to open is encrypted,\n"
-"but no decryption password could be obtained\n"
-"from the path given in configuration.\n"
-"To set up or change a password,\n"
-"run the 'configuration-assistant.perl' script provided with the toolkit.\n"));
-                break;
-            case eBadEncKey:
-                OUTMSG((
-"The file you are trying to open is encrypted, but could not be opened.\n"
-"Either your password is incorrect or the downloaded file is corrupt.\n"
-"To set up or change a password,\n"
-"run the 'configuration-assistant.perl' script provided with the toolkit.\n"
-"To test the file for corruption,\n"
-"run the 'nencvalid' tool provided with the toolkit.\n"));
-                break;
-        case eBadPwdFile:
-                OUTMSG((
-"The file you are trying to open is encrypted, but could not be opened.\n"
-"The password in the password file in unusable either from being 0 bytes\n"
-"or more than 4096 bytes long. The password starts at the beginning of\n"
-"the file and ends with the first CR (\\r) pr LF (\\n) or at the end of\n"
-"the file.\n"
-"To set up or change a password,\n"
-"run the 'configuration-assistant.perl' script provided with the toolkit.\n"));
-                break;
-            default:
-                assert(0);
-        }
-      }
-
-      OUTMSG(("\n"));
-      KOutHandlerSet(handler.writer, handler.data);
-    }
-}
-
-LIB_EXPORT const char* CC UIDatabaseGetErrorString(rc_t rc)
-{
-    if (DependenciesError(rc)) {
-        return "This operation requires access to external"
-            " reference sequence(s) that could not be located";
-    }
-    else {
-        switch (DependenciesType(rc)) {
-            case eNoEncInKfg:
-                return "The file is encrypted, "
-                    "but no decryption password could be located";
-            case ePwdFileNotFound:
-                return "The file is encrypted, "
-                    "but no decryption password could be obtained "
-                    "from the path given in configuration";
-            case eBadEncKey:
-                return "The file is encrypted, but could not be opened. "
-                    "Either the password is incorrect or the file is corrupt";
-            case eBadPwdFile:
-                return "The file is encrypted, but could not be opened. "
-                    "The password in the password file in unusable";
-            default:
-                assert(0);
-                return "Unexpected Dependency Type";
-        }
-    }
-}
-
-LIB_EXPORT void CC UIDatabaseLOGError( rc_t rc,
-    const VDatabase* db, bool log_list )
-{
-    VDBDependenciesLOGMissing(rc, db, log_list);
-}
-
-LIB_EXPORT void CC UITableLOGError( rc_t rc,
-    const VTable* table, bool log_list )
-{
-    const VDatabase* db;
-    if( table == NULL ) {
-        VDBDependenciesLOGMissing(rc, NULL, log_list);
-    }
-    else if( VTableOpenParentRead(table, &db) == 0 && db != NULL ) {
-        VDBDependenciesLOGMissing(rc, db, log_list);
-        VDatabaseRelease(db);
-    }
-}
diff --git a/libs/vdb/database-load.c b/libs/vdb/database-load.c
deleted file mode 100644
index c36975e..0000000
--- a/libs/vdb/database-load.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#define SKONST
-
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-parse.h"
-
-#undef KONST
-#undef SKONST
-
-#include "schema-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/meta.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VDatabase
- *  opaque connection to a database within file system
- */
-
-
-/* LoadSchema
- */
-
-rc_t VDatabaseLoadSchema ( VDatabase *self )
-{
-    /* try to get schema text */
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( self -> meta, & node, "schema" );
-    if ( rc == 0 )
-    {
-        /* the node is probably within our 4K buffer,
-           but by using the callback mechanism we don't
-           have buffer or allocation issues. */
-        KMDataNodeSchemaFillData pb;
-        pb . node = node;
-        pb . pos = 0;
-        pb . add_v0 = false;
-
-        /* add in schema text. it is not mandatory, but it is
-           the design of the system to store object schema with
-           the object so that it is capable of standing alone */
-        rc = VSchemaParseTextCallback ( self -> schema,
-            "VDatabaseLoadSchema", KMDataNodeFillSchema, & pb );
-        if ( rc == 0 )
-        {
-            /* determine database type */
-            rc = KMDataNodeReadAttr ( node, "name",
-                pb . buff, sizeof pb . buff, & pb . pos );
-            if ( rc == 0 )
-            {
-                uint32_t type;
-                const SNameOverload *name;
-
-                /* find the sdb if possible */
-                self -> sdb = VSchemaFind ( self -> schema,
-                    & name, & type, pb . buff, "VDatabaseLoadSchema", false );
-
-                /* the schema must be found in this case */
-                if ( self -> sdb == NULL || type != eDatabase )
-                {
-                    self -> sdb = NULL;
-                    rc = RC ( rcVDB, rcDatabase, rcLoading, rcSchema, rcCorrupt );
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to establish database type from '$(expr)'",
-                                         "expr=%s", pb . buff ));
-                }
-            }
-        }
-
-        KMDataNodeRelease ( node );
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        /* the database may be under creation */
-        if ( ! self -> read_only )
-            rc = 0;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/database-priv.h b/libs/vdb/database-priv.h
deleted file mode 100644
index e3e9c88..0000000
--- a/libs/vdb/database-priv.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_database_priv_
-#define _h_database_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_vdb_database_
-#include <vdb/database.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifndef SKONST
-#define SKONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VSchema;
-struct KDatabase;
-struct SDatabase;
-struct KMetadata;
-struct VDBManager;
-
-/*--------------------------------------------------------------------------
- * VDatabase
- *  interface to physical database
- */
-struct VDatabase
-{
-    /* creating manager */
-    struct VDBManager KONST *mgr;
-
-    /* enclosing database - NULL OKAY */
-    KONST VDatabase *dad;
-
-    /* schema and db description */
-    struct VSchema SKONST *schema;
-    struct SDatabase const *sdb;
-
-    /* underlying physical layer database */
-    struct KDatabase KONST *kdb;
-
-    /* open database metadata */
-    struct KMetadata KONST *meta;
-
-    /* user data */
-    void *user;
-    void ( CC * user_whack ) ( void *data );
-#if 0
-    /* externally visible names */
-    BSTree scope;
-#endif
-    /* page size for creating columns */
-    size_t pgsize;
-
-    /* open references */
-    KRefcount refcount;
-
-    /* create and checksum modes for columns */
-    uint8_t cmode;
-    uint8_t checksum;
-
-    /* open mode */
-    bool read_only;
-};
-
-
-/* Whack
- */
-rc_t CC VDatabaseWhack ( VDatabase *self );
-
-
-/* Attach
- * Sever
- *  internal reference management
- */
-VDatabase *VDatabaseAttach ( const VDatabase *self );
-rc_t VDatabaseSever ( const VDatabase *self );
-
-
-/* Make
- *  creates an initialized database object
- *  expects either a mgr or a parent db,
- *  enforces schema validity according to some rules,
- */
-rc_t VDatabaseMake ( VDatabase **db,
-    struct VDBManager const *mgr,
-    const VDatabase *dad,
-    struct VSchema const *schema );
-
-
-/* LoadSchema
- *  looks in metadata for stored schema
- */
-rc_t VDatabaseLoadSchema ( VDatabase *self );
-
-/* StoreSchema
- *  stores schema definition in metadata
- */
-rc_t VDatabaseStoreSchema ( VDatabase *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_database_priv_ */
diff --git a/libs/vdb/database.c b/libs/vdb/database.c
deleted file mode 100644
index 1e52034..0000000
--- a/libs/vdb/database.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define KONST const
-#include "database-priv.h"
-#undef KONST
diff --git a/libs/vdb/dbmgr-cmn.c b/libs/vdb/dbmgr-cmn.c
deleted file mode 100644
index 2cb0bf6..0000000
--- a/libs/vdb/dbmgr-cmn.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-/* should match dbmgr.c and/or wdbmgr.c */
-
-#define KONST const
-#include "dbmgr-priv.h"
-#undef KONST
-
-#include "schema-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/meta.h>
-#include <kfg/config.h>
-#include <kfs/directory.h>
-#include <kfs/dyload.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#if 1
-#define DEBUG_PRINT( fmt, ... ) ( void ) 0
-#else
-#define DEBUG_PRINT(fmt, ...) fprintf(stderr, "%s - " fmt "\n", __func__, __VA_ARGS__)
-#endif
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  opaque handle to library
- */
-
-/* Whack
- */
-static
-rc_t VDBManagerWhack ( VDBManager *self )
-{
-    rc_t rc;
-
-    KRefcountWhack ( & self -> refcount, "VDBManager" );
-
-    rc = KDBManagerRelease ( self -> kmgr );
-    if ( rc == 0 )
-    {
-        /* release user data */
-        if ( self -> user != NULL && self -> user_whack != NULL )
-        {
-            ( * self -> user_whack ) ( self -> user );
-            self -> user = NULL;
-            self -> user_whack = NULL;
-        }
-
-        VSchemaRelease ( self -> schema );
-        VLinkerRelease ( self -> linker );
-        free ( self );
-        return 0;
-    }
-
-    KRefcountInit ( & self -> refcount, 1, "VDBManager", "whack", "vmgr" );
-    return rc;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC VDBManagerAddRef ( const VDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VDBManager" ) )
-        {
-        case krefLimit:
-            return RC ( rcVDB, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VDBManagerRelease ( const VDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VDBManager" ) )
-        {
-        case krefWhack:
-            return VDBManagerWhack ( ( VDBManager* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- *  internal reference management
- */
-VDBManager *VDBManagerAttach ( const VDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "VDBManager" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( VDBManager* ) self;
-}
-
-rc_t VDBManagerSever ( const VDBManager *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "VDBManager" ) )
-        {
-        case krefWhack:
-            return VDBManagerWhack ( ( VDBManager* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDBManagerVWritable ( const VDBManager *self, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-    return KDBManagerVWritable ( self -> kmgr, path, args );
-}
-
-LIB_EXPORT rc_t CC VDBManagerWritable ( const VDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = VDBManagerVWritable ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* AddSchemaIncludePath
- *  add an include path to schema for locating input files
- */
-LIB_EXPORT rc_t CC VDBManagerVAddSchemaIncludePath ( const VDBManager *self, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return VSchemaVAddIncludePath ( self -> schema, path, args );
-
-    return RC ( rcVDB, rcMgr, rcUpdating, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC VDBManagerAddSchemaIncludePath ( const VDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVAddSchemaIncludePath ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* AddLoadLibraryPath
- *  add a path[s] to loader for locating dynamic libraries
- */
-LIB_EXPORT rc_t CC VDBManagerVAddLoadLibraryPath ( const VDBManager *self, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return VLinkerVAddLoadLibraryPath ( self -> linker, path, args );
-
-    return RC ( rcVDB, rcMgr, rcUpdating, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC VDBManagerAddLoadLibraryPath ( const VDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVAddLoadLibraryPath ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ConfigFromKfg
- */
-static
-rc_t VDBManagerGetKfgPath ( const KConfig *kfg, const char *path, char *value, size_t value_size, size_t *num_read )
-{
-    /* open node */
-    const KConfigNode *node;
-    rc_t rc = KConfigOpenNodeRead ( kfg, & node, path );
-    if ( rc == 0 )
-    {
-        size_t remaining;
-        rc = KConfigNodeRead ( node, 0, value, value_size, num_read, & remaining );
-        if ( rc == 0 )
-        {
-            if ( remaining != 0 )
-                rc = RC ( rcVDB, rcMgr, rcConstructing, rcPath, rcExcessive );
-            else if ( string_chr ( value, * num_read, '%' ) != NULL )
-                rc = RC ( rcVDB, rcMgr, rcConstructing, rcPath, rcInvalid );
-        }
-
-        KConfigNodeRelease ( node );
-    }
-    return rc;
-}
-
-static
-rc_t VDBManagerConfigFromKfg ( VDBManager *self, bool update )
-{
-    size_t num_read;
-    char full [ 4096 ];
-
-    /* open configuration manager */
-    KConfig *kfg;
-    rc_t rc = KConfigMake ( & kfg, NULL );
-    if ( rc != 0 )
-        rc = 0;
-    else
-    {
-        /* look for load library paths */
-        rc = VDBManagerGetKfgPath ( kfg, update ?
-            "vdb/wmodule/paths": "vdb/module/paths",
-            full, sizeof full, & num_read );
-        if ( rc != 0 )
-            rc = 0;
-        else
-        {
-            /* split by ':' */
-            const char * path = full;
-            const char *colon = string_chr ( full, num_read, ':' );
-            while ( colon != NULL )
-            {
-                /* add path between "path" and "colon" */
-                rc = VDBManagerAddLoadLibraryPath ( self, "%.*s", ( int ) ( colon - path ), path );
-                if ( rc != 0 )
-                    break;
-                num_read -= ( colon - path ) - 1;
-                path = colon + 1;
-                colon = string_chr ( path, num_read, ':' );
-            }
-
-            /* add in last portion */
-            if ( rc == 0 && num_read != 0 )
-                rc = VDBManagerAddLoadLibraryPath ( self, "%.*s", ( int ) ( num_read ), path );
-        }
-
-        /* look for schema paths */
-        if ( rc == 0 )
-            rc = VDBManagerGetKfgPath ( kfg, "vdb/schema/paths", full, sizeof full, & num_read );
-        if ( rc != 0 )
-            rc = 0;
-        else
-        {
-            /* split by ':' */
-            const char * path = full;
-            const char *colon = string_chr ( full, num_read, ':' );
-            while ( colon != NULL )
-            {
-                /* add path between "path" and "colon" */
-                rc = VDBManagerAddSchemaIncludePath ( self, "%.*s", ( int ) ( colon - path ), path );
-                if ( rc != 0 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "schema path '$(path)' was rejected",
-                                          "path=%.*s", ( int ) ( colon - path ), path ) );
-                    rc = 0;
-                }
-                num_read -= colon - path + 1;
-                path = colon + 1;
-                colon = string_chr ( path, num_read, ':' );
-            }
-
-            /* add in last portion */
-            if ( rc == 0 && num_read != 0 )
-            {
-                rc = VDBManagerAddSchemaIncludePath ( self, "%.*s", ( int ) ( num_read ), path );
-                if ( rc != 0 )
-                {
-                    PLOGERR ( klogWarn, ( klogWarn, rc, "schema path '$(path)' was rejected",
-                                          "path=%.*s", ( int ) num_read, path ) );
-                    rc = 0;
-                }
-            }
-        }
-
-        KConfigRelease ( kfg );
-    }
-
-    return rc;
-}
-
-/* ConfigFromLibPath
- *  trace this library back to file system
- *  attempt to locate relative paths
- *  add them to library and schema path lists
- */
-static
-rc_t VDBManagerConfigFromLibPath ( VDBManager *self, bool update )
-{
-    KDyld *dlmgr;
-    rc_t rc = KDyldMake ( & dlmgr );
-    if ( rc == 0 )
-    {
-        const KDirectory *home;
-        rc = KDyldHomeDirectory ( dlmgr, & home, ( fptr_t ) VDBManagerConfigPaths );
-        if ( rc == 0 )
-        {
-            char full [ 4096 ];
-
-            /* paths to modules */
-            const char *mod_paths [] =
-            {
-                "ncbi/mod",
-                "vdb/mod",
-                "../mod"
-            };
-            const char *wmod_paths [] =
-            {
-                "ncbi/wmod",
-                "vdb/wmod",
-                "../wmod"
-            };
-
-            /* paths to schema */
-            const char *schema_paths [] =
-            {
-                "ncbi/schema",
-                "vdb/schema",
-                "../schema"
-            };
-
-            /* test for a few possible module paths */
-            uint32_t i;
-            const char **paths = update ? wmod_paths : mod_paths;
-            for ( i = 0; rc == 0 && i < sizeof mod_paths / sizeof mod_paths [ 0 ]; ++ i )
-            {
-                uint32_t type = KDirectoryPathType ( home, "%s%u", paths [ i ], sizeof ( void* ) * 8 );
-                if ( ( type & ~ kptAlias ) == kptDir )
-                {
-                    /* add full path */
-                    rc = KDirectoryResolvePath ( home, true, full, sizeof full, "%s%u", paths [ i ], sizeof ( void* ) * 8 );
-                    if ( rc == 0 )
-                        rc = VDBManagerAddLoadLibraryPath ( self, full );
-                }
-            }
-
-            for ( i = 0; rc == 0 && i < sizeof mod_paths / sizeof mod_paths [ 0 ]; ++ i )
-            {
-                uint32_t type = KDirectoryPathType ( home, paths [ i ] );
-                if ( ( type & ~ kptAlias ) == kptDir )
-                {
-                    /* add full path */
-                    rc = KDirectoryResolvePath ( home, true, full, sizeof full, paths [ i ] );
-                    if ( rc == 0 )
-                        rc = VDBManagerAddLoadLibraryPath ( self, full );
-                }
-            }
-
-            for ( i = 0; rc == 0 && i < sizeof schema_paths / sizeof schema_paths [ 0 ]; ++ i )
-            {
-                uint32_t type = KDirectoryPathType ( home, schema_paths [ i ] );
-                if ( ( type & ~ kptAlias ) == kptDir )
-                {
-                    /* add full path */
-                    rc = KDirectoryResolvePath ( home, true, full, sizeof full, schema_paths [ i ] );
-                    if ( rc == 0 )
-                        rc = VDBManagerAddSchemaIncludePath ( self, full );
-                }
-            }
-
-            KDirectoryRelease ( home );
-        }
-
-        KDyldRelease ( dlmgr );
-    }
-    return rc;
-}
-
-/* ConfigPaths
- *  looks for configuration information to set
- *  include paths for schema parser and
- *  load paths for linker
- */
-rc_t VDBManagerConfigPaths ( VDBManager *self, bool update )
-{
-    rc_t rc = VDBManagerConfigFromKfg ( self, update );
-    if ( rc == 0 )
-        rc = VDBManagerConfigFromLibPath ( self, update );
-    return rc;
-}
-
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- */
-LIB_EXPORT rc_t CC VDBManagerGetUserData ( const VDBManager *self, void **data )
-{
-    rc_t rc;
-
-    if ( data == NULL )
-        rc = RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * data = self -> user;
-            return 0;
-        }
-
-        * data = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerSetUserData ( const VDBManager *cself,
-    void *data, void ( CC * destroy ) ( void *data ) )
-{
-    VDBManager *self = ( VDBManager* ) cself;
-    if ( cself == NULL )
-        return RC ( rcVDB, rcMgr, rcUpdating, rcSelf, rcNull );
-
-    self -> user = data;
-    self -> user_whack = destroy;
-
-    return 0;
-}
-
-/* OpenKDBManager
- *  returns a new reference to KDBManager used by VDBManager
- */
-LIB_EXPORT rc_t CC VDBManagerOpenKDBManagerRead ( const VDBManager *self, const KDBManager **kmgr )
-{
-    rc_t rc;
-
-    if ( kmgr == NULL )
-        rc = RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> kmgr );
-            if ( rc == 0 )
-            {
-                * kmgr = self -> kmgr;
-                return 0;
-            }
-        }
-
-        * kmgr = NULL;
-    }
-
-    return rc;
-}
-
-
-static
-ver_t VDBManagerGetLoaderVersFromMeta ( const KMetadata * meta )
-{
-    const KMDataNode *node = NULL;
-    rc_t rc = KMetadataOpenNodeRead ( meta, & node, "SOFTWARE/loader" );
-    KMDataNodeRelease ( node );
-    if ( rc == 0 )
-    {
-        size_t num_read;
-        char vers_string [ 64 ];
-        rc = KMDataNodeReadAttr ( node, "vers", vers_string, sizeof vers_string, & num_read );
-        if ( rc == 0 )
-        {
-            char *end, *start = vers_string;
-            unsigned long maj = strtoul ( start, & end, 10 );
-
-            KMDataNodeRelease ( node );
-
-            if ( end > start && end [ 0 ] == '.' )
-            {
-                unsigned long min = strtoul ( start = end + 1, & end, 10 );
-                if ( end > start && end [ 0 ] == '.' )
-                {
-                    unsigned long rel = strtoul ( start = end + 1, & end, 10 );
-                    if ( end > start )
-                        return ( maj << 24 ) | ( min << 16 ) | rel;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-
-/* VDBManagerGetVersFromMeta
- *  helper-function for VDBManagerGetObjVersion
- */
-static
-ver_t VDBManagerGetVersFromMeta ( const KMetadata * meta, bool is_db )
-{
-    rc_t rc = 0;
-    uint32_t meta_vers;
-    const KMDataNode *node;
-
-    /* look for loader version as first clue */
-    ver_t version = VDBManagerGetLoaderVersFromMeta ( meta );
-    if ( VersionGetMajor ( version ) >= 2 ) {
-        return version;
-    }
-
-    /* was the run vdb-copied? */
-    rc = KMetadataOpenNodeRead ( meta, & node, "SOFTWARE/update" );
-    if ( rc == 0 ) {
-        KMDataNodeRelease ( node );
-        return 0x2000000;
-    }
-
-    /* If SOFTWARE/loader/@vers exists but SOFTWARE/update does not
-     * then return the former */
-    if ( version != 0 ) {
-        return version;
-    }
-
-    /* THE PRINCIPAL DESCRIPTION OF SOFTWARE VERSION
-       WAS NOT FOUND. USE HEURISTICS TO DETERMINE VERSION
-       FROM THIS POINT FORWARD. */
-
-    /* look at the version of the metadata file itself
-       metdata version 1 means pre-vdb, i.e. v0 */
-    rc = KMetadataVersion ( meta, & meta_vers );
-    if ( rc == 0 && meta_vers < 2 )
-        return 0;
-
-    /* assume all databases are v2 */
-    if ( is_db )
-        return 0x2000000;
-
-
-    /* AT THIS POINT, WE KNOW WE MUST HAVE A TABLE,
-       BUT WE DON'T HAVE PERFECT EVIDENCE OF VERSION,
-       SINCE THE SOFTWARE NODE IS NOT MANDATORY. */
-
-    /* if "schema" exists, it's v2 */
-    rc = KMetadataOpenNodeRead ( meta, & node, "schema" );
-    if ( rc == 0 )
-    {
-        KMDataNodeRelease ( node );
-        return 0x2000000;
-    }
-
-    /* if "col" exists, it's v1 */
-    rc = KMetadataOpenNodeRead ( meta, &node, "col" );
-    if ( rc == 0 )
-    {
-        KMDataNodeRelease ( node );
-        return 0x1000000;
-    }
-
-    /* appears to be v0 */
-    return 0;
-}
-
-
-/* VDBManagerGetObjVersion
- *  returns the vdb-version of the given object
- */
-LIB_EXPORT rc_t CC VDBManagerGetObjVersion ( const VDBManager *self, ver_t * version, const char *path )
-{
-    rc_t rc;
-
-    if ( version == NULL )
-        rc = RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-        else if ( path == NULL )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcPath, rcNull );
-        else if ( path [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcPath, rcEmpty );
-        else
-        {
-            const KTable *tbl;
-            const KDatabase *db;
-            const KMetadata *meta;
-
-            int path_type = KDBManagerPathType ( self -> kmgr, path ) & ~ kptAlias;
-            switch ( path_type )
-            {
-            case kptDatabase:
-                rc = KDBManagerOpenDBRead ( self -> kmgr, & db, path );
-                if ( rc == 0 )
-                {
-                    rc = KDatabaseOpenMetadataRead ( db, & meta );
-                    KDatabaseRelease ( db );
-                }
-                break;
-            case kptTable:
-                rc = KDBManagerOpenTableRead ( self -> kmgr, & tbl, path );
-                if ( rc == 0 )
-                {
-                    rc = KTableOpenMetadataRead ( tbl, & meta );
-                    KTableRelease ( tbl );
-                }
-                break;
-
-            case kptPrereleaseTbl:
-                * version = 0;
-                return 0;
-
-            default:
-                rc = RC ( rcVDB, rcMgr, rcAccessing, rcPath, rcIncorrect );
-            }
-
-            if ( rc == 0 )
-            {
-                * version = VDBManagerGetVersFromMeta ( meta, path_type == kptDatabase );
-                KMetadataRelease ( meta );
-                return 0;
-            }
-        }
-
-        * version = 0;
-    }
-
-    return rc;
-}
-
-
-/* ListExternalSchemaModules
- */
-LIB_EXPORT rc_t CC VDBManagerListExternalSchemaModules ( const VDBManager *self, KNamelist **listp )
-{
-    rc_t rc;
-
-    if ( listp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcListing, rcSelf, rcNull );
-        else
-        {
-            rc = VLinkerListExternalSchemaModules ( self -> linker, listp );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        * listp = NULL;
-    }
-
-    return rc;
-}
-
-
-/* PathType
- *  check the path type of an object/directory path.
- *
- *  this is an extension of the KDirectoryPathType ( see <kdb/manager.h> )
- *  and will return the KDirectory values if a path type is not specifically
- *  a VDB or KDB object.
- */
-LIB_EXPORT int CC VDBManagerPathType ( const VDBManager * self,
-    const char *path, ... )
-{
-    int type;
-
-    va_list args;
-    va_start ( args, path );
-
-    type = VDBManagerVPathType ( self, path, args );
-
-    va_end ( args );
-
-    return type;
-}
-
-LIB_EXPORT int CC VDBManagerVPathType ( const VDBManager * self,
-    const char *path, va_list args )
-{
-    if ( self != NULL )
-        return KDBManagerVPathType ( self -> kmgr, path, args );
-
-    return kptBadPath;
-}
diff --git a/libs/vdb/dbmgr-priv.h b/libs/vdb/dbmgr-priv.h
deleted file mode 100644
index aa1b36b..0000000
--- a/libs/vdb/dbmgr-priv.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_dbmgr_priv_
-#define _h_dbmgr_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_vdb_manager_
-#include <vdb/manager.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDBManager;
-struct VSchema;
-struct VLinker;
-
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  handle to library
- */
-struct VDBManager
-{
-    /* underlying physical layer manager */
-    struct KDBManager KONST *kmgr;
-
-    /* intrinsic schema elements */
-    struct VSchema *schema;
-
-    /* intrinsic functions */
-    struct VLinker *linker;
-
-    /* user data */
-    void *user;
-    void ( CC * user_whack ) ( void *data );
-
-    /* open references */
-    KRefcount refcount;
-};
-
-/* Attach
- * Sever
- *  internal reference management
- */
-VDBManager *VDBManagerAttach ( const VDBManager *self );
-rc_t VDBManagerSever ( const VDBManager *self );
-
-
-/* ConfigPaths
- *  looks for configuration information to set
- *  include paths for schema parser and
- *  load paths for linker
- */
-rc_t VDBManagerConfigPaths ( VDBManager *self, bool update );
-
-
-/*--------------------------------------------------------------------------
- * generic whackers
- */
-void CC VectMbrWhack ( void *item, void *ignore );
-void CC BSTreeMbrWhack ( BSTNode *n, void *ignore );
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_dbmgr_priv_ */
diff --git a/libs/vdb/dbmgr.c b/libs/vdb/dbmgr.c
deleted file mode 100644
index 3ad07a1..0000000
--- a/libs/vdb/dbmgr.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-/* should match dbmgr-cmn.c */
-
-#include "libvdb.vers.h"
-
-#define KONST const
-#include "dbmgr-priv.h"
-#undef KONST
-
-#include "schema-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <kdb/kdb-priv.h> /* KDBManagerMakeReadWithVFSManager */
-#include <kdb/manager.h>
-#include <kfs/directory.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  opaque handle to library
- */
-
-
-/* MakeRead
- * MakeReadWithVFSManager
- *  create library handle for specific use
- *  NB - only one of the functions will be implemented
- *
- *  "wd" [ IN, NULL OKAY ] - optional working directory for
- *  accessing the file system. mgr will attach its own reference.
- */
-LIB_EXPORT rc_t CC VDBManagerMakeRead ( const VDBManager **mgrp, const KDirectory *wd )
-{
-    return VDBManagerMakeReadWithVFSManager(mgrp, wd, NULL);
-}
-
-LIB_EXPORT rc_t CC VDBManagerMakeReadWithVFSManager ( const VDBManager **mgrp,
-    const KDirectory *wd, struct VFSManager *vmgr )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        VDBManager *mgr = malloc ( sizeof * mgr );
-        if ( mgr == NULL )
-            rc = RC ( rcVDB, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KDBManagerMakeReadWithVFSManager ( & mgr -> kmgr, wd, vmgr );
-            if ( rc == 0 )
-            {
-                rc = VSchemaMakeIntrinsic ( & mgr -> schema );
-                if ( rc == 0 )
-                {
-                    rc = VLinkerMakeIntrinsic ( & mgr -> linker );
-                    if ( rc == 0 )
-                    {
-                        rc = VDBManagerConfigPaths ( mgr, false );
-                        if ( rc == 0 )
-                        {
-                            mgr -> user = NULL;
-                            mgr -> user_whack = NULL;
-                            KRefcountInit ( & mgr -> refcount, 1, "VDBManager", "make-read", "vmgr" );
-                            * mgrp = mgr;
-                            return 0;
-                        }
-
-                        VLinkerRelease ( mgr -> linker );
-                    }
-
-                    VSchemaRelease ( mgr -> schema );
-                }
-
-                KDBManagerRelease ( mgr -> kmgr );
-            }
-
-            free ( mgr );
-        }
-
-        * mgrp = NULL;
-    }
-    return rc;
-}
-
-
-/* Version
- *  returns the library version
- */
-LIB_EXPORT rc_t CC VDBManagerVersion ( const VDBManager *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    * version = LIBVDB_VERS;
-    return 0;
-}
-
-
-/* RunPeriodicTasks
- *  executes periodic tasks, such as cache flushing
- */
-LIB_EXPORT rc_t CC VDBManagerRunPeriodicTasks ( const VDBManager *self )
-{
-    if ( self != NULL )
-        return KDBManagerRunPeriodicTasks ( self -> kmgr );
-
-    return RC ( rcVDB, rcMgr, rcExecuting, rcSelf, rcNull );
-}
diff --git a/libs/vdb/delta_average.c b/libs/vdb/delta_average.c
deleted file mode 100644
index 2afd8e5..0000000
--- a/libs/vdb/delta_average.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <klib/rc.h>
-
-#include "xform-priv.h"
-#include "blob-priv.h"
-#include "blob-headers.h"
-#include "blob.h"
-#include "page-map.h"
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-
-/* Create
- *
- * Create a new blob.  A new data buffer is sized to
- * 'element_count' * sizeof datatype; its contents are
- * uninitialized.
- */
-static
-rc_t VBlobCreateEncode ( VBlob **blobp, const VBlob *in, uint32_t max_rl_bytes,uint8_t *avg, uint32_t elem_bytes )
-{
-    rc_t rc = VBlobNew ( blobp, in -> start_id, in -> stop_id, "delta_average" );
-    if ( rc == 0 )
-    {
-        VBlob *blob = * blobp;
-        rc = PageMapAddRef ( in -> pm );
-	if(rc == 0) {
-		blob->pm = in -> pm ;
-		if(max_rl_bytes > 0){
-			rc = KDataBufferMake ( & blob -> data, in -> data . elem_bits, in -> data . elem_count );
-		} else {
-			rc = KDataBufferSub(&in->data, &blob->data, 0, UINT64_MAX);
-		}
-		if ( rc == 0 ){
-			rc = BlobHeadersCreateChild(in->headers, &blob->headers);
-			if ( rc == 0) {
-				VBlobHeader *hdr = BlobHeadersGetHdrWrite(blob->headers);
-				assert(hdr!=NULL);
-				if(hdr != 0){
-					int i;
-					VBlobHeaderSetVersion (hdr, 1);
-					rc = VBlobHeaderArgPushTail(hdr, max_rl_bytes);
-					assert(rc == 0);
-					rc = VBlobHeaderArgPushTail(hdr, elem_bytes);
-                                        assert(rc == 0);
-					for(i=0; i< max_rl_bytes; i++){
-						rc = VBlobHeaderOpPushTail(hdr,avg[i]);
-						assert(rc==0);
-					}
-					blob -> byte_order = in -> byte_order;
-					VBlobHeaderRelease(hdr);
-					return 0;
-				}
-			}
-		}
-		PageMapRelease( blob->pm);
-        }
-	VBlobRelease ( blob );
-        * blobp = NULL;
-    }
-    return rc;
-}
-
-static
-rc_t VBlobCreateDecode ( VBlob **blobp, const VBlob *in, uint32_t *max_rl_bytes,uint8_t **avg, uint32_t *elem_bytes)
-{
-    rc_t rc = VBlobNew ( blobp, in -> start_id, in -> stop_id, "undelta_average" );
-    if ( rc == 0 )
-    {
-        VBlob *blob = * blobp;
-        rc = PageMapAddRef ( in -> pm );
-	if(rc == 0) {
-		VBlobHeader *hdr;
-		blob->pm = in -> pm ;
-                blob->headers = (BlobHeaders *)BlobHeadersGetNextFrame(in->headers);
-		BlobHeadersAddRef(blob->headers);
-		hdr = BlobHeadersGetHeader(in->headers);
-		if(hdr || VBlobHeaderVersion(hdr)!=1) {
-			int64_t len;
-			int64_t eb;
-			rc = VBlobHeaderArgPopHead(hdr, &len);
-			if( rc == 0)
-				rc = VBlobHeaderArgPopHead(hdr, &eb);
-			if( rc == 0){
-				*max_rl_bytes=len;
-				*elem_bytes = eb;
-				if(len > 0){
-					rc = KDataBufferMake ( & blob -> data, in -> data . elem_bits, in -> data . elem_count );
-					if ( rc == 0){
-						*avg=malloc(len);
-						if(*avg){
-							int i;
-							for(i=0;i<len && rc == 0;i++){
-								rc = VBlobHeaderOpPopHead(hdr,(*avg)+i);
-							}
-							if(rc == 0){
-								VBlobHeaderRelease(hdr);
-								return 0;
-							} else {
-								rc =  RC(rcVDB, rcFunction, rcExecuting, rcHeader, rcCorrupt) ;
-							}
-						} else {
-							rc =  RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted) ;
-						}
-					}
-				} else {
-					rc = KDataBufferSub(&in->data, &blob->data, 0, UINT64_MAX);
-					if(rc == 0){
-						VBlobHeaderRelease(hdr);
-						return 0;
-					}
-				}
-				VBlobHeaderRelease(hdr);
-			} else {
-				rc =  RC(rcVDB, rcFunction, rcExecuting, rcHeader, rcCorrupt) ;
-			}
-		} else {
-			rc =  RC(rcVDB, rcFunction, rcExecuting, rcHeader, rcCorrupt) ;
-		}
-		PageMapRelease( blob->pm);
-        }
-	VBlobRelease ( blob );
-        * blobp = NULL;
-    }
-    return rc;
-}
-
-static
-rc_t CC undelta_average ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    uint32_t  max_rl_bytes = 0;
-    uint8_t   *avg = NULL;
-    uint32_t elem_bytes = 0;
-    /* input blob - schema assures us that it is ready to go */
-    const VBlob *in = argv [ 0 ];
-  /* allocate output blob of same size */
-    rc_t rc = VBlobCreateDecode ( rslt, in,&max_rl_bytes,&avg,&elem_bytes );
-    if(rc == 0 && max_rl_bytes > 0){
-	uint8_t *dst = (*rslt)->data.base; /** destination pointer **/
-	uint8_t *src = in -> data.base;
-	int	i,j,k;
-	PageMap *pm  = in->pm;
-
-	for(i=j=0,src = in -> data.base;i<pm->leng_recs;i++){
-                row_count_t leng_run=pm->leng_run[i];
-                elem_count_t len = pm->length[i];
-                assert(len<=max_rl_bytes);
-                while(leng_run > 0){
-                        for(k=0;k<len*elem_bytes;k++,src++,dst++){
-                                dst[0] = avg[k] - src[0]; /** symmetrical to encode **/
-                        }
-                        assert(leng_run >= (pm->data_run?pm->data_run[j]:1));
-                        leng_run -= pm->data_run?pm->data_run[j]:1;
-			j++;
-                }
-        }
-
-    }
-    if(avg) free(avg);
-    return rc;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_undelta_average, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = undelta_average;
-    rslt -> variant = vftBlobN;
-    return 0;
-}
-
-static
-rc_t CC delta_average ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    rc_t rc;
-    /* input blob - schema assures us that it is ready to go */
-    const VBlob *in = argv [ 0 ];
-    const PageMap *pm = in->pm; 
-    uint8_t     *src;
-    elem_count_t   min_row_len,max_row_len;
-    uint64_t	min_rl_bytes,max_rl_bytes;
-    uint32_t    *cnts;
-    uint32_t    elem_bytes;
-    int         i,j,k;
-    uint8_t	*avg=NULL;
-    uint64_t    sum_rle;
-    uint8_t	last;
-
-    if(pm->row_count < 256 || (in->data.elem_bits & 7)!=0){
-	return VBlobCreateEncode ( rslt, in, 0,NULL,0 );
-    }
-    elem_bytes = in->data.elem_bits >> 3;
-    PageMapRowLengthRange(pm,&min_row_len,&max_row_len);
-    if(max_row_len > 1024){
-	return VBlobCreateEncode ( rslt, in, 0,NULL,0 );
-    }
-    /*** rescale to bytes **/
-    min_rl_bytes = (min_row_len * in->data.elem_bits) >> 3;
-    max_rl_bytes = (max_row_len * in->data.elem_bits) >> 3;
-
-    cnts=calloc(sizeof(*cnts),256*max_rl_bytes); /** computing counts of values **/
-    avg=malloc(max_rl_bytes);
-
-    /** collect sums and averages ***/
-    /** using tight loop instead of iterators **/
-    for(i=j=0,src = in -> data.base, sum_rle=0,last=0;i<pm->leng_recs;i++){
-	row_count_t leng_run=pm->leng_run[i];
-	elem_count_t len = pm->length[i];
-	assert(len<=max_rl_bytes);
-	while(leng_run > 0){
-		for(k=0;k<len*elem_bytes;k++,src++){
-			if(last==src[0]) sum_rle++;
-			cnts[256*k+src[0]]++;
-			last=src[0];
-		}
-		assert(leng_run >= (pm->data_run?pm->data_run[j]:1));
-		leng_run -= pm->data_run?pm->data_run[j]:1;
-		j++;
-	}
-    }
-    if(sum_rle * 10 > elem_bytes * in->data.elem_count * 3){/** total number of repetitions is high - leave it for zlib RLE ***/
-        free(cnts);
-        free(avg);
-        return VBlobCreateEncode(rslt,in,0,NULL,0);
-    }
-
-    for(i=0;i<max_rl_bytes;i++){
-	avg[i] = 0;
-	for(j=1;j<256;j++){
-		if(cnts[256*i+j] > cnts[256*i+avg[i]]){
-			avg[i]=j; 
-		}
-	}
-    }
-    rc = VBlobCreateEncode ( rslt, in, max_rl_bytes,avg,elem_bytes );
-    if (rc == 0 ){
-	uint8_t *dst = (*rslt)->data.base; /** destination pointer **/
-	for(i=j=0,src = in -> data.base;i<pm->leng_recs;i++){
-		row_count_t leng_run=pm->leng_run[i];
-		elem_count_t len = pm->length[i];
-		assert(len<=max_rl_bytes);
-		while(leng_run > 0){
-			for(k=0;k < len*elem_bytes;k++,src++,dst++){
-				dst[0] = avg[k] - src[0]; /** will do it in this direction **/
-			}
-			assert(leng_run >= (pm->data_run?pm->data_run[j]:1));
-			leng_run -= pm->data_run?pm->data_run[j]:1;
-			j++;
-		}
-	}
-     }
-    if(cnts) free(cnts);
-    if(avg)  free(avg);
-    return rc;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_delta_average, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = delta_average;
-    rslt -> variant = vftBlobN;
-    return 0;
-}
diff --git a/libs/vdb/environment-read.c b/libs/vdb/environment-read.c
deleted file mode 100644
index 6809da2..0000000
--- a/libs/vdb/environment-read.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <vdb/vdb-priv.h>
-#include <sysalloc.h>
-
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-rc_t CC environment_read_func(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    const KDataBuffer *value = Self;
-    rc_t rc = 0;
-    
-    rslt->data->elem_bits = value->elem_bits;
-    rslt->data->elem_count = 0;
-    rc = KDataBufferResize(rslt->data, value->elem_count);
-    if (rc == 0) {
-        memcpy(rslt->data->base, value->base, KDataBufferBytes(value));
-        rc = KDataBufferCast(rslt->data, rslt->data, rslt->elem_bits, true);
-        if (rc == 0)
-            rslt->elem_count = rslt->data->elem_count;
-    }
-    return rc;
-}
-
-static rc_t CC get_databuffer( KDataBuffer **rslt, const char *Name, size_t len ) {
-    char name[4096];
-    char *x;
-    rc_t rc;
-    
-    if (len >= sizeof(name))
-        return RC(rcVDB, rcFunction, rcConstructing, rcName, rcTooLong);
-    
-    memcpy(name, Name, len);
-    name[len] = '\0';
-    
-    x = getenv(name);
-    rc = KDataBufferMake( *rslt, 8, (uint32_t)( len = strlen( x ) ) );
-    if (rc)
-        return rc;
-    memcpy((**rslt).base, x, len);
-    return 0;
-}
-
-/* 
- function utf8 environment:read #1.0 < ascii name > ();
- */
-VTRANSFACT_BUILTIN_IMPL(environment_read, 1, 0, 0)
-    (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp
-) {
-    rc_t rc;
-    KDataBuffer *value;
-            
-    rc = get_databuffer(&value, cp->argv[0].data.ascii, cp->argv[0].count);
-    if (rc == 0) {
-        rslt->self = value;
-        rslt->whack = (void (*)(void *))KDataBufferWhack;
-        
-        rslt->variant = vftRow;
-        rslt->u.rf = environment_read_func;
-    }
-
-	return rc;
-}
diff --git a/libs/vdb/fixed-row-len.c b/libs/vdb/fixed-row-len.c
deleted file mode 100644
index 440a10c..0000000
--- a/libs/vdb/fixed-row-len.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include "prod-priv.h"
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-static
-rc_t CC fixed_row_len_func ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData in[] )
-{
-    assert ( rslt -> data -> elem_bits == 32 );
-    if ( rslt -> data -> elem_count == 0 )
-    {
-        rc_t rc = KDataBufferResize ( rslt -> data, 1 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    * ( uint32_t* ) rslt -> data -> base = VProductionFixedRowLength ( info -> prod, row_id, true );
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_fixed_row_len, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> variant = vftRow;
-    rslt -> u . rf = fixed_row_len_func;
-    return 0;
-}
diff --git a/libs/vdb/index_insert.c b/libs/vdb/index_insert.c
deleted file mode 100644
index 5929ccd..0000000
--- a/libs/vdb/index_insert.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#include <sra/sradb.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/index.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-struct self_t {
-    KIndex *ndx;
-    char *key_buf;
-    size_t key_buf_size;
-};
-
-/*
- function utf8 idx:text:insert #1.0 < ascii index_name > ( utf8 key );
- */
-
-static
-rc_t CC index_insert( void *Self, const VXformInfo *info, int64_t row_id,
-                       VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    struct self_t *self = Self;
-    rc_t rc;
-    const char *x;
-    char skey[4096];
-    char *key = skey;
-    uint32_t key_len;
-
-    rslt -> elem_count = 0;
-
-    x = argv [ 0 ] . u . data . base;
-    key_len = argv [ 0 ] . u . data . elem_count;
-    x += argv [ 0 ] . u . data . first_elem;
-    
-    if (key_len + 1 >= sizeof(skey)) {
-        if (key_len + 1 >= self->key_buf_size) {
-            void *temp = realloc(self->key_buf, key_len + 1);
-            if (temp == NULL)
-                return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            self->key_buf = temp;
-            self->key_buf_size = key_len + 1;
-        }
-        key = self->key_buf;
-    }
-    memcpy(key, x, key_len);
-    key[key_len] = 0;
-
-    /* attempt to insert into index */
-    rc = KIndexInsertText ( self->ndx, false, key, row_id );
-    if ( rc != 0 )
-    {
-        /* insert failed for whatever reason - return key */
-        rc = KDataBufferResize ( rslt -> data, key_len );
-        if ( rc != 0 )
-            return rc;
-        memcpy ( rslt -> data -> base, key, key_len );
-        
-        rslt -> elem_count = key_len;
-    }
-    
-    return 0;
-}    
-
-static void CC self_whack(void *Self) {
-    struct self_t *self = Self;
-    KIndexRelease(self->ndx);
-    if (self->key_buf)
-        free(self->key_buf);
-    free(Self);
-}
-
-VTRANSFACT_IMPL ( idx_text_insert, 1, 0, 0 ) ( const void *Self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    struct self_t *self;
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        rc_t rc;
-        
-        rc = VTableCreateIndex ( ( VTable* ) info -> tbl, &self->ndx, kitText | kitProj, kcmOpen,
-                                "%.*s", cp->argv[0].count, cp->argv[0].data.ascii );
-        if( rc == 0 ) {
-            rslt->self = self;
-            rslt->whack = self_whack;
-            rslt->variant = vftNonDetRow;
-            rslt->u.ndf = index_insert;
-            self->key_buf = NULL;
-            self->key_buf_size = 0;
-            return 0;
-        }
-        free(self);
-        return rc;
-    }
-    else
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/vdb/index_lookup.c b/libs/vdb/index_lookup.c
deleted file mode 100644
index 4589609..0000000
--- a/libs/vdb/index_lookup.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "blob.h"
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "xform-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/index.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/pbstree.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <assert.h>
-
-typedef struct tag_self_t {
-    const       KIndex *ndx;
-    char        query_key[1024];
-    uint32_t    query_key_len;
-    const struct VCursorParams * parms;
-    uint32_t    elem_bits;
-} self_t;
-
-static void CC self_whack( void *Self )
-{
-    self_t *self = Self;
-    
-    KIndexRelease( self->ndx );
-    free( self );
-}
-
-
-static
-rc_t CC index_lookup_impl(
-                          void *Self,
-                          const VXformInfo *info,
-                          int64_t row_id,
-                          VRowResult *rslt,
-                          uint32_t argc,
-                          const VRowData argv[]
-                          )
-{
-    rc_t rc;
-    const self_t *self = Self;
-    KDataBuffer *query_buf = NULL;
-    
-    rslt->elem_count = 0;
-    rslt->no_cache = 1;
-    
-    rc = VCursorParamsGet(self->parms, self->query_key, &query_buf);
-    if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcName) {
-        rc = KDataBufferResize(rslt->data, 0);
-        return rc;
-    }
-    if (rc == 0) {
-        char  squery[4096];
-        char *hquery = NULL;
-        char *query = squery;
-        uint64_t id_count;
-        int64_t start_id;
-        
-        if (query_buf->elem_count >= sizeof(squery)) {
-            hquery = malloc(query_buf->elem_count + 1);
-            if (hquery == NULL)
-                return RC(rcVDB, rcIndex, rcReading, rcMemory, rcExhausted);
-            query = hquery;
-        }
-        memcpy(query, query_buf->base, query_buf->elem_count);
-        query[query_buf->elem_count] = '\0';
-        rc = KIndexFindText(self->ndx, query, &start_id, &id_count,NULL,NULL);
-        if (hquery)
-            free(hquery);
-        if (rc == 0) {
-            rc = KDataBufferResize ( rslt -> data, 1 );
-            if( rc == 0) {
-                int64_t *out = rslt -> data->base;
-                
-                out[0] = start_id;
-                out[1] = start_id + id_count - 1;
-
-                rslt -> elem_count = 1;
-                rslt -> no_cache = 1; /***** This row should never be cached **/
-            }
-        }
-    }
-    return rc;
-}
-
-/*
- * function vdb:row_id_range  idx:text:lookup #1 < ascii index_name , ascii query_by_name > ();
- */
-VTRANSFACT_BUILTIN_IMPL(idx_text_lookup, 1, 0, 0) (
-                                           const void *Self,
-                                           const VXfactInfo *info,
-                                           VFuncDesc *rslt,
-                                           const VFactoryParams *cp,
-                                           const VFunctionParams *dp
-) {
-    rc_t rc;
-    const KIndex *ndx;
-    KIdxType type;
-    
-    rc = VTableOpenIndexRead(info->tbl, &ndx, "%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii);
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound )
-            PLOGERR (klogErr, (klogErr, rc, "Failed to open index '$(index)'", "index=%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii));
-        return rc;
-    }
-    
-    rc = KIndexType(ndx, &type);
-    if (rc == 0) {
-        if (type == kitProj + kitText) {
-            self_t *self;
-            
-            self = malloc(sizeof(*self));
-            if (self) {
-                self->ndx = ndx;
-                self->elem_bits = VTypedescSizeof(&info->fdesc.desc);
-                memcpy(self->query_key,cp->argv[1].data.ascii,cp->argv[1].count);
-                self->query_key_len = cp->argv[1].count;
-                self->query_key[self->query_key_len] = '\0';
-                self->parms = info->parms;
-                
-                rslt->self = self;
-                rslt->whack = self_whack;
-                rslt->variant = vftNonDetRow;
-                rslt->u.ndf = index_lookup_impl;
-                return 0;
-            }
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        }
-        else
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcIndex, rcIncorrect);
-    }
-    KIndexRelease(ndx);
-    return rc;
-}
diff --git a/libs/vdb/index_project.c b/libs/vdb/index_project.c
deleted file mode 100644
index 2d8a7c6..0000000
--- a/libs/vdb/index_project.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "blob.h"
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "xform-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <kdb/index.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-typedef struct tag_self_t {
-    const KIndex *ndx;
-    uint32_t elem_bits;
-} self_t;
-
-static void CC self_whack( void *Self )
-{
-    self_t *self = Self;
-    
-    KIndexRelease( self->ndx );
-    free( self );
-}
-
-#include <stdio.h>
-
-static
-rc_t CC index_project_impl(
-                            void *Self,
-                            const VXformInfo *info,
-                            int64_t row_id,
-                            VBlob **rslt,
-                            uint32_t argc, const VBlob *argv[]
-) {
-    rc_t rc;
-    const self_t *self = Self;
-    KDataBuffer temp;
-    uint64_t id_count;
-    int64_t start_id;
-    char key_buf[1024];
-    char *key = key_buf;
-    size_t sz = sizeof(key_buf) - 1;
-
-    for ( ; ; ) {
-        rc = KIndexProjectText(self->ndx, row_id, &start_id, &id_count, key, sz + 1, &sz);
-        if ((GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcId) || sz==0 ){
-/*          fprintf(stderr, "row %u not in index\n", (unsigned)row_id); */
-            if (argc > 0 && argv[0] != NULL) { 
-                /*** this types of blobs may have holes in them ***/
-                rc = VBlobSubblob(argv[0],rslt,row_id );
-            }
-            else
-                rc = RC(rcVDB, rcFunction, rcExecuting, rcRow, rcNotFound);
-            break;
-        }
-        if (GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcBuffer && key == key_buf) {
-            rc = KDataBufferMakeBytes( &temp, (uint32_t)( sz + 1 ) );
-            if (rc) {
-                key = temp.base;
-                continue;
-            }
-        }
-        if (rc == 0) {
-            VBlob *y;
-        
-            /* it seems old index returns length including \0 so we have to adjust */
-            while (sz > 0 && key[sz - 1] == '\0')
-                --sz;
-
-            rc = VBlobNew(&y, start_id, start_id + id_count - 1, "vdb:index:project");
-            if (rc == 0) {
-                rc = PageMapNewSingle( &y->pm, (uint32_t)id_count, (uint32_t)sz );
-                if (rc == 0) {
-                    if (key == key_buf) {
-                        rc = KDataBufferMakeBytes( &y->data, (uint32_t)sz );
-                        if (rc == 0)
-                            memcpy(y->data.base, key, sz);
-                    }
-                    else
-                        KDataBufferSub( &temp, &y->data, 0, (uint32_t)sz );
-                }
-                if (rc == 0) 
-                    *rslt = y;
-                else {
-                    TRACK_BLOB( VBlobRelease, ((VBlob*)y) );
-                    (void)VBlobRelease(y);
-                }
-            }
-        }
-        break;
-    }
-    if (key != key_buf)
-        KDataBufferWhack(&temp);
-    return rc;
-}
-
-VTRANSFACT_BUILTIN_IMPL(idx_text_project, 1, 0, 0) (
-                                           const void *Self,
-                                           const VXfactInfo *info,
-                                           VFuncDesc *rslt,
-                                           const VFactoryParams *cp,
-                                           const VFunctionParams *dp
-) {
-    rc_t rc;
-    const KIndex *ndx;
-    KIdxType type;
-    
-    rc = VTableOpenIndexRead(info->tbl, &ndx, "%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii);
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound )
-            PLOGERR (klogErr, (klogErr, rc, "Failed to open index '$(index)'", "index=%.*s", (int)cp->argv[0].count, cp->argv[0].data.ascii));
-        return rc;
-    }
-    
-    rc = KIndexType(ndx, &type);
-    if (rc == 0) {
-        if (type == kitProj + kitText) {
-            self_t *self;
-            
-            self = malloc(sizeof(*self));
-            if (self) {
-                self->ndx = ndx;
-                self->elem_bits = VTypedescSizeof(&info->fdesc.desc);
-                rslt->self = self;
-                rslt->whack = self_whack;
-                rslt->variant = vftBlobN;
-                VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = index_project_impl;
-                return 0;
-            }
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        }
-        else
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcIndex, rcIncorrect);
-    }
-    KIndexRelease(ndx);
-    return rc;
-}
diff --git a/libs/vdb/libvdb.vers b/libs/vdb/libvdb.vers
deleted file mode 100644
index 2714f53..0000000
--- a/libs/vdb/libvdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.6.4
diff --git a/libs/vdb/libvdb.vers.h b/libs/vdb/libvdb.vers.h
deleted file mode 100644
index c423f0c..0000000
--- a/libs/vdb/libvdb.vers.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define LIBVDB_VERS 0x02060004
diff --git a/libs/vdb/libwvdb.vers b/libs/vdb/libwvdb.vers
deleted file mode 100644
index 2714f53..0000000
--- a/libs/vdb/libwvdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.6.4
diff --git a/libs/vdb/libwvdb.vers.h b/libs/vdb/libwvdb.vers.h
deleted file mode 100644
index 6f33e03..0000000
--- a/libs/vdb/libwvdb.vers.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define LIBWVDB_VERS 0x02060004
diff --git a/libs/vdb/linker-cmn.c b/libs/vdb/linker-cmn.c
deleted file mode 100644
index 73c87ec..0000000
--- a/libs/vdb/linker-cmn.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "linker-priv.h"
-#include "schema-priv.h"
-#include "dbmgr-priv.h"
-
-#include <kfs/directory.h>
-#include <kfs/dyload.h>
-#include <kfs/kfs-priv.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * LFactory
- *  describes an external C function factory
- */
-
-/* Whack
- */
-void CC LFactoryWhack ( void *item, void *ignore )
-{
-    LFactory *self = item;
-
-    /* whack the guy's factory object */
-    if ( self -> desc . whack != NULL )
-        ( * self -> desc . whack ) ( self -> desc . fself );
-
-    /* douse the dynamic library */
-    KSymAddrRelease ( self -> addr );
-
-    /* gone */
-    free ( self );
-}
-
-
-/*--------------------------------------------------------------------------
- * LSpecial
- *  describes an external C table recognition function
- */
-
-/* Whack
- */
-void CC LSpecialWhack ( void *item, void *ignore )
-{
-    LSpecial *self = item;
-    KSymAddrRelease ( self -> addr );
-    free ( self );
-}
-
-
-/*--------------------------------------------------------------------------
- * VLinker
- */
-
-/* Whack
- */
-static
-rc_t CC VLinkerWhack ( VLinker *self )
-{
-    KRefcountWhack ( & self -> refcount, "VLinker" );
-
-    VectorWhack ( & self -> fact, LFactoryWhack, NULL );
-    VectorWhack ( & self -> special, LSpecialWhack, NULL );
-    BSTreeWhack ( & self -> scope, KSymbolWhack, NULL );
-
-    KDyldRelease ( self -> dl );
-    VLinkerSever ( self -> dad );
-
-    free ( self );
-
-    return 0;
-}
-
-
-/* StartIdx
- *  returns starting index
- */
-#define VLinkerStartIdx( dad, vect, starting ) \
-    ( ( ( dad ) == NULL ) ? ( starting ) : \
-      ( VectorStart ( & ( dad ) -> vect ) + \
-        VectorLength ( & ( dad ) -> vect ) ) )
-
-/* VectorInit
- *  performs vector initialization
- */
-#define VLinkerVectorInit( linker, dad, vect, starting, block ) \
-    VectorInit ( & ( linker ) -> vect, VLinkerStartIdx ( dad, vect, starting ), block )
-
-/* Make
- *  creates an empty linker
- */
-rc_t VLinkerMake ( VLinker **lp, const VLinker *dad, struct KDyld *dl )
-{
-    rc_t rc;
-
-    VLinker *linker = malloc ( sizeof * linker );
-    if ( linker == NULL )
-        return RC ( rcVDB, rcMgr, rcConstructing, rcMemory, rcExhausted );
-
-    rc = KDyldAddRef ( linker -> dl = dl );
-    if ( rc == 0 )
-    {
-        linker -> dad = VLinkerAttach ( dad );
-        BSTreeInit ( & linker -> scope );
-
-        VLinkerVectorInit ( linker, dad, fact, 1, 64 );
-        VLinkerVectorInit ( linker, dad, special, 1, 8 );
-
-        KRefcountInit ( & linker -> refcount, 1, "VLinker", "make", "vld" );
-    
-        * lp = linker;
-        return 0;
-    }
-
-    free ( linker );
-    return rc;
-}
-
-/* Release
- */
-rc_t VLinkerRelease ( const VLinker *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VLinker" ) )
-        {
-        case krefWhack:
-            return VLinkerWhack ( ( VLinker* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- */
-VLinker *VLinkerAttach ( const VLinker *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "VLinker" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( VLinker* ) self;
-}
-
-rc_t VLinkerSever ( const VLinker *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "VLinker" ) )
-        {
-        case krefWhack:
-            return VLinkerWhack ( ( VLinker* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* AddLoadLibraryPath
- *  add a path[s] to loader for locating dynamic libraries
- */
-rc_t VLinkerVAddLoadLibraryPath ( const VLinker *self, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return KDyldVAddSearchPath ( self -> dl, path, args );
-
-    return RC ( rcVDB, rcMgr, rcUpdating, rcSelf, rcNull );
-}
-
-
-/* Open
- *  opens libraries for search
- */
-rc_t VLinkerOpen ( const VLinker *self, struct KDlset **libs )
-{
-    rc_t rc = KDyldMakeSet ( self -> dl, libs );
-    if ( rc == 0 )
-    {
-        KDlset *set = * libs;
-
-        rc = KDlsetAddAll ( set );
-        if ( rc == 0 )
-            return 0;
-
-        KDlsetRelease ( set );
-        * libs = NULL;
-    }
-    return rc;
-}
-
-
-/* EnterIntoScope
- *  pushes linker symbol tables into scope
- */
-static
-rc_t CC VLinkerEnterIntoScope ( const VLinker *self, KSymTable *tbl )
-{
-    rc_t rc;
-
-    if ( self -> dad == NULL )
-        rc = KSymTableInit ( tbl, NULL );
-    else
-        rc = VLinkerEnterIntoScope ( self -> dad, tbl );
-
-    if ( rc == 0 )
-        rc = KSymTablePushScope ( tbl, & ( ( VLinker* ) self ) -> scope );
-
-    return rc;
-}
-
-
-/* MakeFQN
- */
-static
-size_t CC VLinkerMakeFQN ( char *buffer, size_t bsize, const KSymbol *name )
-{
-    size_t sz = 0;
-
-    if ( name -> dad != NULL )
-    {
-        sz = VLinkerMakeFQN ( buffer, bsize, name -> dad );
-        if ( sz < bsize )
-            buffer [ sz ++ ] = '_';
-    }
-
-    if ( sz < bsize )
-    {
-        sz += string_copy ( & buffer [ sz ], bsize - sz,
-            name -> name . addr, name -> name . size );
-    }
-
-    return sz;
-}
-
-/* ScanFactory
- *  scans code modules for all named entrypoints
- *  compares version numbers, retaining the highest
- *  that satisfies stated functional interface
- */
-typedef struct VLinkerFactoryMatchData VLinkerFactoryMatchData;
-struct VLinkerFactoryMatchData
-{
-    VTransDesc desc;
-    uint32_t version;
-};
-
-static
-bool CC VLinkerBestMatch ( const KSymAddr *sym, void *data )
-{
-    VLinkerFactoryMatchData *pb = data;
-
-    rc_t rc;
-    VTransDesc desc;
-
-    rc_t ( CC * f ) ( VTransDesc* );
-    KSymAddrAsFunc ( sym, ( fptr_t* ) & f );
-
-    memset ( & desc, 0, sizeof desc );
-    rc = ( * f ) ( & desc );
-    if ( rc == 0 )
-    {
-        /* we don't actually expect to see two versions
-           of a factory at all, much less with the same
-           major interface version */
-        uint32_t maj = desc . itf_version >> 24;
-        if ( maj != 0 && maj == ( pb -> desc . itf_version >> 24 ) )
-        {
-            /* TBD - issue warning */
-        }
-
-        /* prototype should have been declared with a version,
-           but if not, then any version will do */
-        if ( pb -> version == 0 ||
-             ( maj == ( pb -> version >> 24 ) &&
-               desc . itf_version >= pb -> version ) )
-        {
-            /* accept latest version */
-            if ( desc . itf_version > pb -> desc . itf_version )
-            {
-                pb -> desc = desc;
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-static
-rc_t VLinkerScanFactory ( VLinker *self, const KDlset *libs,
-    KSymTable *tbl, const KSymbol **symp, const KSymbol *name,
-    uint32_t version )
-{
-    rc_t rc;
-
-    /* convert schema fqn into legal C identifier */
-    char fqn [ 1024 ];
-    size_t sz = VLinkerMakeFQN ( fqn, sizeof fqn, name );
-    if ( sz >= sizeof fqn )
-        rc = RC ( rcVDB, rcMgr, rcResolving, rcName, rcExcessive );
-    else
-    {
-        KSymAddr *entrypoint;
-        VLinkerFactoryMatchData pb;
-        memset ( & pb, 0, sizeof pb );
-        pb . version = version;
-
-        /* ask loader to locate fqn in library search path */
-        rc = KDlsetLastSymbol ( libs, & entrypoint,
-            fqn, VLinkerBestMatch, & pb );
-        if ( rc == 0 )
-        {
-            /* allocate factory object */
-            LFactory *fact = malloc ( sizeof * fact );
-            if ( fact == NULL )
-                rc = RC ( rcVDB, rcMgr, rcResolving, rcMemory, rcExhausted );
-            else
-            {
-                /* give it the exact schema name */
-                rc = KSymTableDupSymbol ( tbl,
-                    ( KSymbol** ) & fact -> name, name, ltFactory, fact );
-                if ( rc == 0 )
-                {
-                    /* finally, insert the symbol into our vector */
-                    rc = VectorAppend ( & self -> fact, & fact -> id, fact );
-                    if ( rc == 0 )
-                    {
-                        /* done */
-                        fact -> addr = entrypoint;
-                        fact -> desc = pb . desc;
-                        fact -> external = true;
-                        * symp = fact -> name;
-                        return 0;
-                    }
-
-                    KSymTableRemoveSymbol ( tbl, fact -> name );
-                }
-
-                free ( fact );
-            }
-
-            KSymAddrRelease ( entrypoint );
-        }
-    }
-
-    return rc;
-}
-
-/* ScanSpecial
- *  scans code modules for the first named entrypoint
- */
-static
-rc_t CC VLinkerScanSpecial ( VLinker *self, const KDlset *libs,
-    KSymTable *tbl, const KSymbol **symp, const KSymbol *name, uint32_t type )
-{
-    rc_t rc;
-
-    /* convert schema fqn into legal C identifier */
-    char fqn [ 1024 ];
-    size_t sz = VLinkerMakeFQN ( fqn, sizeof fqn, name );
-    if ( sz >= sizeof fqn )
-        rc = RC ( rcVDB, rcMgr, rcResolving, rcName, rcExcessive );
-    else
-    {
-        /* ask loader to locate fqn in open library set */
-        KSymAddr *entrypoint;
-        rc = KDlsetSymbol ( libs, & entrypoint, fqn );
-        if ( rc == 0 )
-        {
-            /* allocate special function object */
-            LSpecial *special = malloc ( sizeof * special );
-            if ( special == NULL )
-                rc = RC ( rcVDB, rcMgr, rcResolving, rcMemory, rcExhausted );
-            else
-            {
-                special -> func = NULL;
-
-                /* give it the exact schema name */
-                rc = KSymTableDupSymbol ( tbl,
-                    ( KSymbol** ) & special -> name, name, type, special );
-                if ( rc == 0 )
-                {
-                    /* finally, insert the symbol into our vector */
-                    rc = VectorAppend ( & self -> special, & special -> id, special );
-                    if ( rc == 0 )
-                    {
-                        /* done */
-                        special -> addr = entrypoint;
-                        * symp = special -> name;
-                        return 0;
-                    }
-
-                    KSymTableRemoveSymbol ( tbl, special -> name );
-                }
-
-                free ( special );
-            }
-
-            KSymAddrRelease ( entrypoint );
-        }
-    }
-
-    return rc;
-}
-
-/* Find
- *  find a named symbol
- *
- *  "func" [ OUT ] - return parameter for func pointer
- *
- *  "proto" [ IN ] - function prototype from schema
- *
- *  "external" [ OUT ] - tells whether factory is built-in or external
- */
-rc_t VLinkerFindFactory ( VLinker *self, const KDlset *libs,
-    VTransDesc *desc, const SFunction *proto, bool *external )
-{
-    KSymTable tbl;
-    rc_t rc = VLinkerEnterIntoScope ( self, & tbl );
-    if ( rc == 0 )
-    {
-        /* factory name if explicit */
-        const KSymbol *sym, *name = proto -> u . ext . fact;
-
-        /* use simple function name as implicit factory name */
-        if ( name == NULL )
-            name = proto -> name;
-
-        /* look for the symbol by name -
-           factory names do not support version overloading */
-        sym = KSymTableFindSymbol ( & tbl, name );
-
-        /* if not found, search for best match */
-        if ( sym == NULL )
-            rc = VLinkerScanFactory ( self, libs, & tbl, & sym, name, proto -> version );
-
-        /* otherwise ensure the found name is in fact a factory */
-        else if ( sym -> type != ltFactory )
-            rc = RC ( rcVDB, rcMgr, rcResolving, rcName, rcIncorrect );
-
-        /* examine results */
-        if ( rc == 0 )
-        {
-            const LFactory *fact = sym -> u . obj;
-
-            /* test for incompatible version */
-            if ( ( fact -> desc . itf_version >> 24 ) != ( proto -> version >> 24 ) )
-                rc = RC ( rcVDB, rcMgr, rcResolving, rcInterface, rcIncorrect );
-            else if ( fact -> desc . itf_version < proto -> version )
-                rc = RC ( rcVDB, rcMgr, rcResolving, rcInterface, rcIncorrect );
-            else
-            {
-                * desc = fact -> desc;
-                * external = fact -> external;
-            }
-        }
-
-        KSymTableWhack ( & tbl );
-    }
-    return rc;
-}
-
-static
-void CC VLinkerNameWhackSymbol ( KSymbol *sym )
-{
-    if ( sym != NULL )
-    {
-        VLinkerNameWhackSymbol ( sym -> dad );
-        free ( sym );
-    }
-}
-
-static
-KSymbol *VLinkerNameToSymbol ( String *name )
-{
-    KSymbol *sym, *dad = NULL;
-    const char *end = string_rchr ( name -> addr, name -> size, ':' );
-    if ( end != 0 )
-    {
-        String sub;
-        StringSubstr ( name, & sub, 0, string_len ( name -> addr, end - name -> addr ) );
-        dad = VLinkerNameToSymbol ( & sub );
-        if ( dad == NULL )
-            return NULL;
-
-        BSTreeInit ( & dad -> u . scope );
-
-        name -> addr += sub . size + 1;
-        name -> size -= sub . size + 1;
-        name -> len -= sub . len + 1;
-    }
-
-    sym = malloc ( sizeof * sym );
-    if ( sym == NULL )
-    {
-        VLinkerNameWhackSymbol ( dad );
-        return NULL;
-    }
-
-    sym -> u . obj = NULL;
-    sym -> dad = dad;
-    sym -> name = * name;
-    sym -> type = 0;
-
-    if ( dad != NULL )
-        BSTreeInsert ( & dad -> u . scope, & sym -> n, KSymbolSort );
-
-    return sym;
-}
-
-rc_t VLinkerFindNamedFactory ( VLinker *self, const KDlset *libs,
-    VTransDesc *desc, const char *fact_name )
-{
-    KSymTable tbl;
-    rc_t rc = VLinkerEnterIntoScope ( self, & tbl );
-    if ( rc == 0 )
-    {
-        KSymbol *name;
-        const KSymbol *sym;
-
-        String str;
-        StringInitCString ( & str, fact_name );
-        name = VLinkerNameToSymbol ( & str );
-
-        /* look for the symbol by name -
-           factory names do not support version overloading */
-        sym = KSymTableFindSymbol ( & tbl, name );
-        
-        /* if not found, search for best match */
-        if ( sym == NULL )
-            rc = VLinkerScanFactory ( self, libs, & tbl, & sym, name, 0 );
-
-        /* otherwise ensure the found name is in fact a factory */
-        else if ( sym -> type != ltFactory )
-            rc = RC ( rcVDB, rcMgr, rcResolving, rcName, rcIncorrect );
-
-        VLinkerNameWhackSymbol ( name );
-
-        /* examine results */
-        if ( rc == 0 )
-        {
-            const LFactory *fact = sym -> u . obj;
-            * desc = fact -> desc;
-        }
-
-        KSymTableWhack ( & tbl );
-    }
-    return rc;
-}
-
-
-rc_t VLinkerFindUntyped ( VLinker *self, const KDlset *libs,
-    VUntypedTableTest *func, const SFunction *proto )
-{
-    KSymTable tbl;
-    rc_t rc = VLinkerEnterIntoScope ( self, & tbl );
-    if ( rc == 0 )
-    {
-        /* untyped functions do not have factories */
-        const KSymbol *sym = KSymTableFindSymbol ( & tbl, proto -> name );
-
-        /* if not found, search for it */
-        if ( sym == NULL )
-            rc = VLinkerScanSpecial ( self, libs, & tbl, & sym, proto -> name, ltUntyped );
-
-        /* otherwise ensure the found name is in fact untyped */
-        else if ( sym -> type != ltUntyped )
-            rc = RC ( rcVDB, rcMgr, rcResolving, rcName, rcIncorrect );
-
-        /* return results */
-        if ( rc == 0 )
-        {
-            const LSpecial *untyped = sym -> u . obj;
-            if ( untyped -> addr == NULL )
-                * func = untyped -> func;
-            else
-                KSymAddrAsFunc ( untyped -> addr, ( fptr_t* ) func );
-        }
-
-        KSymTableWhack ( & tbl );
-    }
-    return rc;
-}
-
-
-/* ListExternalSchemaModules
- */
-rc_t VLinkerListExternalSchemaModules ( const VLinker *self, struct KNamelist **listp )
-{
-    rc_t rc;
-
-    assert ( listp != NULL );
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcDylib, rcListing, rcSelf, rcNull );
-    else
-    {
-        KDlset *libs;
-        rc = VLinkerOpen ( self, & libs );
-        if ( rc == 0 )
-        {
-            rc = KDlsetList ( libs, listp );
-            KDlsetRelease ( libs );
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/linker-int.c b/libs/vdb/linker-int.c
deleted file mode 100644
index 35d1875..0000000
--- a/libs/vdb/linker-int.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "linker-priv.h"
-#include "schema-parse.h"
-#include "xform-priv.h"
-
-#include <kfs/dyload.h>
-#include <klib/token.h>
-#include <klib/symtab.h>
-#include <klib/symbol.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <byteswap.h>
-#include <assert.h>
-
-extern VTRANSFACT_DECL ( vdb_cast );
-extern VTRANSFACT_DECL ( vdb_redimension );
-extern VTRANSFACT_DECL ( vdb_row_id );
-extern VTRANSFACT_DECL ( vdb_row_len );
-extern VTRANSFACT_DECL ( vdb_fixed_row_len );
-extern VTRANSFACT_DECL ( vdb_compare );
-extern VTRANSFACT_DECL ( vdb_no_compare );
-extern VTRANSFACT_DECL ( vdb_range_validate );
-extern VTRANSFACT_DECL ( vdb_merge );
-extern VTRANSFACT_DECL ( vdb_split );
-extern VTRANSFACT_DECL ( vdb_transpose );
-extern VTRANSFACT_DECL ( vdb_detranspose );
-extern VTRANSFACT_DECL ( vdb_delta_average );
-extern VTRANSFACT_DECL ( vdb_undelta_average );
-extern VTRANSFACT_DECL ( meta_read );
-extern VTRANSFACT_DECL ( meta_value );
-extern VTRANSFACT_DECL ( meta_attr_read );
-extern VTRANSFACT_DECL ( idx_text_project );
-extern VTRANSFACT_DECL ( idx_text_lookup );
-extern VTRANSFACT_DECL ( parameter_read );
-extern VTRANSFACT_DECL ( environment_read );
-
-/* newly imported things */
-extern VTRANSFACT_DECL ( ALIGN_align_restore_read );
-extern VTRANSFACT_DECL ( ALIGN_cigar );
-extern VTRANSFACT_DECL ( ALIGN_cigar_2 );
-extern VTRANSFACT_DECL ( ALIGN_generate_has_mismatch );
-extern VTRANSFACT_DECL ( ALIGN_generate_mismatch );
-extern VTRANSFACT_DECL ( ALIGN_generate_mismatch_qual );
-extern VTRANSFACT_DECL ( ALIGN_project_from_sequence );
-extern VTRANSFACT_DECL ( ALIGN_raw_restore_read );
-extern VTRANSFACT_DECL ( ALIGN_ref_restore_read );
-extern VTRANSFACT_DECL ( ALIGN_ref_sub_select );
-extern VTRANSFACT_DECL ( ALIGN_seq_restore_read );
-extern VTRANSFACT_DECL ( INSDC_SEQ_rand_4na_2na );
-extern VTRANSFACT_DECL ( INSDC_SRA_format_spot_name );
-extern VTRANSFACT_DECL ( INSDC_SRA_format_spot_name_no_coord );
-extern VTRANSFACT_DECL ( NCBI_SRA_ABI_tokenize_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_Helicos_tokenize_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_Illumina_tokenize_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_IonTorrent_tokenize_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA__454__dynamic_read_desc );
-extern VTRANSFACT_DECL ( NCBI_SRA__454__process_position );
-extern VTRANSFACT_DECL ( NCBI_SRA__454__tokenize_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_bio_start );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_CLIP );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_INTENSITY );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_NOISE );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_POSITION );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_QUALITY );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_READ );
-extern VTRANSFACT_DECL ( NCBI_SRA_decode_SIGNAL );
-extern VTRANSFACT_DECL ( NCBI_SRA_denormalize );
-extern VTRANSFACT_DECL ( NCBI_SRA_extract_coordinates );
-extern VTRANSFACT_DECL ( NCBI_SRA_extract_name_coord );
-extern VTRANSFACT_DECL ( NCBI_SRA_fix_read_seg );
-extern VTRANSFACT_DECL ( NCBI_SRA_linker_from_readn );
-extern VTRANSFACT_DECL ( NCBI_SRA_lookup );
-extern VTRANSFACT_DECL ( NCBI_SRA_make_position );
-extern VTRANSFACT_DECL ( NCBI_SRA_make_read_desc );
-extern VTRANSFACT_DECL ( NCBI_SRA_make_spot_desc );
-extern VTRANSFACT_DECL ( NCBI_SRA_normalize );
-#if HAVE_PREFIX_TREE_TO_NAME
-extern VTRANSFACT_DECL ( NCBI_SRA_prefix_tree_to_name );
-#endif
-extern VTRANSFACT_DECL ( NCBI_SRA_qual4_decode );
-extern VTRANSFACT_DECL ( NCBI_SRA_qual4_decompress_v1 );
-#if HAVE_READ_LEN_FROM_NREADS
-extern VTRANSFACT_DECL ( NCBI_SRA_read_len_from_nreads );
-extern VTRANSFACT_DECL ( NCBI_SRA_read_start_from_nreads );
-#endif
-extern VTRANSFACT_DECL ( NCBI_SRA_read_seg_from_readn );
-extern VTRANSFACT_DECL ( NCBI_SRA_rewrite_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_rotate );
-extern VTRANSFACT_DECL ( NCBI_SRA_swap );
-extern VTRANSFACT_DECL ( NCBI_WGS_build_read_type );
-extern VTRANSFACT_DECL ( NCBI_WGS_build_scaffold_qual );
-extern VTRANSFACT_DECL ( NCBI_WGS_build_scaffold_read );
-extern VTRANSFACT_DECL ( NCBI_WGS_tokenize_nuc_accession );
-extern VTRANSFACT_DECL ( NCBI_WGS_tokenize_prot_accession );
-extern VTRANSFACT_DECL ( NCBI_align_clip );
-extern VTRANSFACT_DECL ( NCBI_align_clip_2 );
-extern VTRANSFACT_DECL ( NCBI_align_compress_quality );
-extern VTRANSFACT_DECL ( NCBI_align_decompress_quality );
-extern VTRANSFACT_DECL ( NCBI_align_edit_distance );
-extern VTRANSFACT_DECL ( NCBI_align_edit_distance_2 );
-extern VTRANSFACT_DECL ( NCBI_align_generate_mismatch_qual_2 );
-extern VTRANSFACT_DECL ( NCBI_align_generate_preserve_qual );
-extern VTRANSFACT_DECL ( NCBI_align_get_clipped_cigar );
-extern VTRANSFACT_DECL ( NCBI_align_get_clipped_cigar_2 );
-extern VTRANSFACT_DECL ( NCBI_align_get_clipped_ref_offset );
-extern VTRANSFACT_DECL ( NCBI_align_get_left_soft_clip );
-extern VTRANSFACT_DECL ( NCBI_align_get_left_soft_clip_2 );
-extern VTRANSFACT_DECL ( NCBI_align_get_mate_align_id );
-extern VTRANSFACT_DECL ( NCBI_align_get_mismatch_read );
-extern VTRANSFACT_DECL ( NCBI_align_get_ref_delete );
-extern VTRANSFACT_DECL ( NCBI_align_get_ref_insert );
-extern VTRANSFACT_DECL ( NCBI_align_get_ref_len );
-extern VTRANSFACT_DECL ( NCBI_align_get_ref_mismatch );
-extern VTRANSFACT_DECL ( NCBI_align_get_ref_preserve_qual );
-extern VTRANSFACT_DECL ( NCBI_align_get_right_soft_clip );
-extern VTRANSFACT_DECL ( NCBI_align_get_right_soft_clip_2 );
-extern VTRANSFACT_DECL ( NCBI_align_get_right_soft_clip_3 );
-extern VTRANSFACT_DECL ( NCBI_align_get_right_soft_clip_4 );
-extern VTRANSFACT_DECL ( NCBI_align_get_sam_flags );
-extern VTRANSFACT_DECL ( NCBI_align_get_sam_flags_2 );
-extern VTRANSFACT_DECL ( NCBI_align_get_seq_preserve_qual );
-extern VTRANSFACT_DECL ( NCBI_align_local_ref_id );
-extern VTRANSFACT_DECL ( NCBI_align_local_ref_start );
-extern VTRANSFACT_DECL ( NCBI_align_make_cmp_read_desc );
-extern VTRANSFACT_DECL ( NCBI_align_make_read_start );
-extern VTRANSFACT_DECL ( NCBI_align_mismatch_restore_qual );
-extern VTRANSFACT_DECL ( NCBI_align_not_my_row );
-extern VTRANSFACT_DECL ( NCBI_align_raw_restore_qual );
-extern VTRANSFACT_DECL ( NCBI_align_ref_name );
-extern VTRANSFACT_DECL ( NCBI_align_ref_pos );
-extern VTRANSFACT_DECL ( NCBI_align_ref_seq_id );
-extern VTRANSFACT_DECL ( NCBI_align_ref_sub_select_preserve_qual );
-extern VTRANSFACT_DECL ( NCBI_align_seq_construct_read );
-extern VTRANSFACT_DECL ( NCBI_align_template_len );
-extern VTRANSFACT_DECL ( NCBI_color_from_dna );
-extern VTRANSFACT_DECL ( NCBI_dna_from_color );
-extern VTRANSFACT_DECL ( NCBI_fp_extend );
-extern VTRANSFACT_DECL ( NCBI_lower_case_tech_reads );
-extern VTRANSFACT_DECL ( NCBI_unpack );
-extern VTRANSFACT_DECL ( NCBI_unzip );
-extern VTRANSFACT_DECL ( NCBI_var_tokenize_var_id );
-extern VTRANSFACT_DECL ( vdb_add_row_id );
-extern VTRANSFACT_DECL ( vdb_bit_or );
-extern VTRANSFACT_DECL ( vdb_bunzip );
-extern VTRANSFACT_DECL ( vdb_ceil );
-extern VTRANSFACT_DECL ( vdb_clip );
-extern VTRANSFACT_DECL ( vdb_cut );
-extern VTRANSFACT_DECL ( vdb_delta );
-extern VTRANSFACT_DECL ( vdb_deriv );
-extern VTRANSFACT_DECL ( vdb_diff );
-extern VTRANSFACT_DECL ( vdb_echo );
-extern VTRANSFACT_DECL ( vdb_exists );
-extern VTRANSFACT_DECL ( vdb_extract_token );
-extern VTRANSFACT_DECL ( vdb_fixed_vec_sum );
-extern VTRANSFACT_DECL ( vdb_floor );
-extern VTRANSFACT_DECL ( vdb_funzip );
-extern VTRANSFACT_DECL ( vdb_integral );
-extern VTRANSFACT_DECL ( vdb_integral_0 );
-extern VTRANSFACT_DECL ( vdb_iunzip );
-extern VTRANSFACT_DECL ( vdb_izip );
-extern VTRANSFACT_DECL ( vdb_map );
-extern VTRANSFACT_DECL ( vdb_max );
-extern VTRANSFACT_DECL ( vdb_min );
-extern VTRANSFACT_DECL ( vdb_outlier_decode );
-extern VTRANSFACT_DECL ( vdb_outlier_encode );
-extern VTRANSFACT_DECL ( vdb_pack );
-extern VTRANSFACT_DECL ( vdb_paste );
-extern VTRANSFACT_DECL ( vdb_rldecode );
-extern VTRANSFACT_DECL ( vdb_round );
-extern VTRANSFACT_DECL ( vdb_simple_sub_select );
-extern VTRANSFACT_DECL ( vdb_simple_sub_select_1 );
-extern VTRANSFACT_DECL ( vdb_sprintf );
-extern VTRANSFACT_DECL ( vdb_strtonum );
-extern VTRANSFACT_DECL ( vdb_subtract_row_id );
-extern VTRANSFACT_DECL ( vdb_sum );
-extern VTRANSFACT_DECL ( vdb_trim );
-extern VTRANSFACT_DECL ( vdb_trunc );
-extern VTRANSFACT_DECL ( vdb_undelta );
-extern VTRANSFACT_DECL ( vdb_unpack );
-extern VTRANSFACT_DECL ( vdb_unzip );
-extern VTRANSFACT_DECL ( vdb_vec_sum );
-
-struct KTable;
-struct KMetadata;
-extern bool CC NCBI_SRA_accept_untyped ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA__454__untyped_0 ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA__454__untyped_1_2a ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA__454__untyped_1_2b ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA_Illumina_untyped_0a ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA_Illumina_untyped_0b ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA_Illumina_untyped_1a ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA_Illumina_untyped_1b ( struct KTable const *tbl, struct KMetadata const *meta );
-extern bool CC NCBI_SRA_ABI_untyped_1 ( struct KTable const *tbl, struct KMetadata const *meta );
-
-
-/* select is REALLY internal */
-static
-rc_t CC select_func ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_select, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* set function pointer to non-NULL */
-    rslt -> u . rf = select_func;
-    rslt -> variant = vftSelect;
-    return 0;
-}
-
-/* temporary silly stuff
- */
-
-static
-rc_t CC hello_func ( void *self, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char *func_hello = self;
-    OUTMSG (( "%s - row id %ld\n", func_hello, row_id ));
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_hello, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    const char *fact_hello = "vdb:hello factory";
-    const char *func_hello = "vdb:hello function";
-
-    if ( cp -> argc > 0 )
-    {
-        fact_hello = cp -> argv [ 0 ] . data . ascii;
-        if ( cp -> argc > 1 )
-            func_hello = cp -> argv [ 1 ] . data . ascii;
-    }
-
-    rslt -> self = malloc ( strlen ( func_hello ) + 1 );
-    if ( rslt -> self == NULL )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    strcpy ( rslt -> self, func_hello );
-    rslt -> whack = free;
-    rslt -> u . rf = hello_func;
-    rslt -> variant = vftRow;
-
-    OUTMSG (( "%s - %u factory params, %u function params\n", fact_hello, cp -> argc, dp -> argc ));
-    return 0;
-}
-
-/* InitFactories
- */
-static
-rc_t CC VLinkerEnterFactory ( KSymTable *tbl, const SchemaEnv *env,
-    LFactory *lfact, const char *name )
-{
-    rc_t rc;
-
-    KTokenSource src;
-    KTokenText tt;
-    KToken t;
-
-    KTokenTextInitCString ( & tt, name, "VLinkerEnterFactory" );
-    KTokenSourceInit ( & src, & tt );
-    next_token ( tbl, & src, & t );
-
-    rc = create_fqn ( tbl, & src, & t, env, ltFactory, lfact );
-    if ( rc == 0 )
-        lfact -> name = t . sym;
-
-    return rc;
-}
-
-
-rc_t VLinkerAddFactories ( VLinker *self,
-    const VLinkerIntFactory *fact, uint32_t count,
-    KSymTable *tbl, const SchemaEnv *env )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        rc_t rc;
-        LFactory *lfact = malloc ( sizeof * lfact );
-        if ( lfact == NULL )
-            return RC ( rcVDB, rcFunction, rcRegistering, rcMemory, rcExhausted );
-
-        /* invoke factory to get description */
-        rc = ( * fact [ i ] . f ) ( & lfact -> desc );
-        if ( rc != 0 )
-        {
-            free ( lfact );
-            return rc;
-        }
-
-        /* I am intrinsic and have no dl symbol */
-        lfact -> addr = NULL;
-        lfact -> name = NULL;
-        lfact -> external = false;
-
-        /* add to linker */
-        rc = VectorAppend ( & self -> fact, & lfact -> id, lfact );
-        if ( rc != 0 )
-        {
-            LFactoryWhack ( lfact, NULL );
-            return rc;
-        }
-
-        /* create name */
-        rc = VLinkerEnterFactory ( tbl, env, lfact, fact [ i ] . name );
-        if ( rc != 0 )
-        {
-            void *ignore;
-            VectorSwap ( & self -> fact, lfact -> id, NULL, & ignore );
-            LFactoryWhack ( lfact, NULL );
-            return rc;
-        }
-    }
-
-    return 0;
-}
-
-
-static
-rc_t CC VLinkerEnterSpecial ( KSymTable *tbl, const SchemaEnv *env,
-    LSpecial *lspec, const char *name )
-{
-    rc_t rc;
-
-    KTokenSource src;
-    KTokenText tt;
-    KToken t;
-
-    KTokenTextInitCString ( & tt, name, "VLinkerEnterSpecial" );
-    KTokenSourceInit ( & src, & tt );
-    next_token ( tbl, & src, & t );
-
-    rc = create_fqn ( tbl, & src, & t, env, ltUntyped, lspec );
-    if ( rc == 0 )
-        lspec -> name = t . sym;
-
-    return rc;
-}
-
-typedef struct VLinkerIntSpecial VLinkerIntSpecial;
-struct VLinkerIntSpecial
-{
-    bool ( CC * f ) ( struct KTable const *tbl, struct KMetadata const *meta );
-    const char *name;
-};
-
-static
-rc_t VLinkerAddUntyped ( VLinker *self,
-    const VLinkerIntSpecial *special, uint32_t count,
-    KSymTable *tbl, const SchemaEnv *env )
-{
-    uint32_t i;
-    for ( i = 0; i < count; ++ i )
-    {
-        rc_t rc;
-        LSpecial *lspec = malloc ( sizeof * lspec );
-        if ( lspec == NULL )
-            return RC ( rcVDB, rcFunction, rcRegistering, rcMemory, rcExhausted );
-
-        /* I am intrinsic and have no dl symbol */
-        lspec -> addr = NULL;
-        lspec -> name = NULL;
-        lspec -> func = special [ i ] . f;
-
-        /* add to linker */
-        rc = VectorAppend ( & self -> special, & lspec -> id, lspec );
-        if ( rc != 0 )
-        {
-            LSpecialWhack ( lspec, NULL );
-            return rc;
-        }
-
-        /* create name */
-        rc = VLinkerEnterSpecial ( tbl, env, lspec, special [ i ] . name );
-        if ( rc != 0 )
-        {
-            void *ignore;
-            VectorSwap ( & self -> special, lspec -> id, NULL, & ignore );
-            LSpecialWhack ( lspec, NULL );
-            return rc;
-        }
-    }
-
-    return 0;
-}
-
-/* InitFactories
- */
-rc_t VLinkerInitFactoriesRead ( VLinker *self,  KSymTable *tbl, const SchemaEnv *env )
-{
-    static VLinkerIntFactory fact [] =
-    {
-        { vdb_cast, "vdb:cast" },
-        { vdb_redimension, "vdb:redimension" },
-        { vdb_row_id, "vdb:row_id" },
-        { vdb_row_len, "vdb:row_len" },
-        { vdb_fixed_row_len, "vdb:fixed_row_len" },
-        { vdb_select, "vdb:select" },
-        { vdb_compare, "vdb:compare" },
-        { vdb_no_compare, "vdb:no_compare" },
-        { vdb_range_validate, "vdb:range_validate" },
-        { vdb_merge, "vdb:merge" },
-        { vdb_split, "vdb:split" },
-        { vdb_transpose, "vdb:transpose" },
-        { vdb_detranspose, "vdb:detranspose" },
-        { vdb_delta_average, "vdb:delta_average" },
-        { vdb_undelta_average, "vdb:undelta_average" },
-        { meta_read, "meta:read" },
-        { meta_value, "meta:value" },
-        { meta_attr_read, "meta:attr:read" },
-        { idx_text_project, "idx:text:project" },
-        { idx_text_lookup, "idx:text:lookup" },
-        { parameter_read, "parameter:read" },
-/*        { environment_read, "environment:read" }, */
-
-        { ALIGN_align_restore_read, "ALIGN:align_restore_read" },
-        { ALIGN_cigar, "ALIGN:cigar" },
-        { ALIGN_cigar_2, "ALIGN:cigar_2" },
-        { ALIGN_generate_has_mismatch, "ALIGN:generate_has_mismatch" },
-        { ALIGN_generate_mismatch, "ALIGN:generate_mismatch" },
-        { ALIGN_generate_mismatch_qual, "ALIGN:generate_mismatch_qual" },
-        { ALIGN_project_from_sequence, "ALIGN:project_from_sequence" },
-        { ALIGN_raw_restore_read, "ALIGN:raw_restore_read" },
-        { ALIGN_ref_restore_read, "ALIGN:ref_restore_read" },
-        { ALIGN_ref_sub_select, "ALIGN:ref_sub_select" },
-        { ALIGN_seq_restore_read, "ALIGN:seq_restore_read" },
-        { INSDC_SEQ_rand_4na_2na, "INSDC:SEQ:rand_4na_2na" },
-        { INSDC_SRA_format_spot_name, "INSDC:SRA:format_spot_name" },
-        { INSDC_SRA_format_spot_name_no_coord, "INSDC:SRA:format_spot_name_no_coord" },
-        { NCBI_SRA_ABI_tokenize_spot_name, "NCBI:SRA:ABI:tokenize_spot_name" },
-        { NCBI_SRA_Helicos_tokenize_spot_name, "NCBI:SRA:Helicos:tokenize_spot_name" },
-        { NCBI_SRA_Illumina_tokenize_spot_name, "NCBI:SRA:Illumina:tokenize_spot_name" },
-        { NCBI_SRA_IonTorrent_tokenize_spot_name, "NCBI:SRA:IonTorrent:tokenize_spot_name" },
-        { NCBI_SRA__454__dynamic_read_desc, "NCBI:SRA:_454_:dynamic_read_desc" },
-        { NCBI_SRA__454__process_position, "NCBI:SRA:_454_:process_position" },
-        { NCBI_SRA__454__tokenize_spot_name, "NCBI:SRA:_454_:tokenize_spot_name" },
-        { NCBI_SRA_bio_start, "NCBI:SRA:bio_start" },
-        { NCBI_SRA_decode_CLIP, "NCBI:SRA:decode:CLIP" },
-        { NCBI_SRA_decode_INTENSITY, "NCBI:SRA:decode:INTENSITY" },
-        { NCBI_SRA_decode_NOISE, "NCBI:SRA:decode:NOISE" },
-        { NCBI_SRA_decode_POSITION, "NCBI:SRA:decode:POSITION" },
-        { NCBI_SRA_decode_QUALITY, "NCBI:SRA:decode:QUALITY" },
-        { NCBI_SRA_decode_READ, "NCBI:SRA:decode:READ" },
-        { NCBI_SRA_decode_SIGNAL, "NCBI:SRA:decode:SIGNAL" },
-        { NCBI_SRA_denormalize, "NCBI:SRA:denormalize" },
-        { NCBI_SRA_extract_coordinates, "NCBI:SRA:extract_coordinates" },
-        { NCBI_SRA_extract_name_coord, "NCBI:SRA:extract_name_coord" },
-        { NCBI_SRA_fix_read_seg, "NCBI:SRA:fix_read_seg" },
-#if HAVE_LINKER_FROM_READN
-        { NCBI_SRA_linker_from_readn, "NCBI:SRA:linker_from_readn" },
-#endif
-        { NCBI_SRA_lookup, "NCBI:SRA:lookup" },
-        { NCBI_SRA_make_position, "NCBI:SRA:make_position" },
-        { NCBI_SRA_make_read_desc, "NCBI:SRA:make_read_desc" },
-        { NCBI_SRA_make_spot_desc, "NCBI:SRA:make_spot_desc" },
-        { NCBI_SRA_normalize, "NCBI:SRA:normalize" },
-#if HAVE_PREFIX_TREE_TO_NAME
-        { NCBI_SRA_prefix_tree_to_name, "NCBI:SRA:prefix_tree_to_name" },
-#endif
-        { NCBI_SRA_qual4_decode, "NCBI:SRA:qual4_decode" },
-        { NCBI_SRA_qual4_decompress_v1, "NCBI:SRA:qual4_decompress_v1" },
-#if HAVE_READ_LEN_FROM_NREADS
-        { NCBI_SRA_read_len_from_nreads, "NCBI:SRA:read_len_from_nreads" },
-        { NCBI_SRA_read_start_from_nreads, "NCBI:SRA:read_start_from_nreads" },
-#endif
-        { NCBI_SRA_read_seg_from_readn, "NCBI:SRA:read_seg_from_readn" },
-        { NCBI_SRA_rewrite_spot_name, "NCBI:SRA:rewrite_spot_name" },
-        { NCBI_SRA_rotate, "NCBI:SRA:rotate" },
-        { NCBI_SRA_swap, "NCBI:SRA:swap" },
-        { NCBI_WGS_build_read_type, "NCBI:WGS:build_read_type" },
-        { NCBI_WGS_build_scaffold_qual, "NCBI:WGS:build_scaffold_qual" },
-        { NCBI_WGS_build_scaffold_read, "NCBI:WGS:build_scaffold_read" },
-        { NCBI_WGS_tokenize_nuc_accession, "NCBI:WGS:tokenize_nuc_accession" },
-        { NCBI_WGS_tokenize_prot_accession, "NCBI:WGS:tokenize_prot_accession" },
-        { NCBI_align_clip, "NCBI:align:clip" },
-        { NCBI_align_clip_2, "NCBI:align:clip_2" },
-        { NCBI_align_compress_quality, "NCBI:align:compress_quality" },
-        { NCBI_align_decompress_quality, "NCBI:align:decompress_quality" },
-        { NCBI_align_edit_distance, "NCBI:align:edit_distance" },
-        { NCBI_align_edit_distance_2, "NCBI:align:edit_distance_2" },
-        { NCBI_align_generate_mismatch_qual_2, "NCBI:align:generate_mismatch_qual_2" },
-        { NCBI_align_generate_preserve_qual, "NCBI:align:generate_preserve_qual" },
-        { NCBI_align_get_clipped_cigar, "NCBI:align:get_clipped_cigar" },
-        { NCBI_align_get_clipped_cigar_2, "NCBI:align:get_clipped_cigar_2" },
-        { NCBI_align_get_clipped_ref_offset, "NCBI:align:get_clipped_ref_offset" },
-        { NCBI_align_get_left_soft_clip, "NCBI:align:get_left_soft_clip" },
-        { NCBI_align_get_left_soft_clip_2, "NCBI:align:get_left_soft_clip_2" },
-        { NCBI_align_get_mate_align_id, "NCBI:align:get_mate_align_id" },
-        { NCBI_align_get_mismatch_read, "NCBI:align:get_mismatch_read" },
-        { NCBI_align_get_ref_delete, "NCBI:align:get_ref_delete" },
-        { NCBI_align_get_ref_insert, "NCBI:align:get_ref_insert" },
-        { NCBI_align_get_ref_len, "NCBI:align:get_ref_len" },
-        { NCBI_align_get_ref_mismatch, "NCBI:align:get_ref_mismatch" },
-        { NCBI_align_get_ref_preserve_qual, "NCBI:align:get_ref_preserve_qual" },
-        { NCBI_align_get_seq_preserve_qual, "NCBI:align:get_seq_preserve_qual" },
-        { NCBI_align_get_right_soft_clip, "NCBI:align:get_right_soft_clip" },
-        { NCBI_align_get_right_soft_clip_2, "NCBI:align:get_right_soft_clip_2" },
-        { NCBI_align_get_right_soft_clip_3, "NCBI:align:get_right_soft_clip_3" },
-        { NCBI_align_get_right_soft_clip_4, "NCBI:align:get_right_soft_clip_4" },
-        { NCBI_align_get_sam_flags, "NCBI:align:get_sam_flags" },
-        { NCBI_align_get_sam_flags_2, "NCBI:align:get_sam_flags_2" },
-        { NCBI_align_local_ref_id, "NCBI:align:local_ref_id" },
-        { NCBI_align_local_ref_start, "NCBI:align:local_ref_start" },
-        { NCBI_align_make_cmp_read_desc, "NCBI:align:make_cmp_read_desc" },
-        { NCBI_align_make_read_start, "NCBI:align:make_read_start" },
-        { NCBI_align_mismatch_restore_qual, "NCBI:align:mismatch_restore_qual" },
-        { NCBI_align_not_my_row, "NCBI:align:not_my_row" },
-        { NCBI_align_raw_restore_qual, "NCBI:align:raw_restore_qual" },
-        { NCBI_align_ref_name, "NCBI:align:ref_name" },
-        { NCBI_align_ref_pos, "NCBI:align:ref_pos" },
-        { NCBI_align_ref_seq_id, "NCBI:align:ref_seq_id" },
-        { NCBI_align_ref_sub_select_preserve_qual, "NCBI:align:ref_sub_select_preserve_qual" },
-        { NCBI_align_seq_construct_read, "NCBI:align:seq_construct_read" },
-        { NCBI_align_template_len, "NCBI:align:template_len" },
-        { NCBI_color_from_dna, "NCBI:color_from_dna" },
-        { NCBI_dna_from_color, "NCBI:dna_from_color" },
-        { NCBI_fp_extend, "NCBI:fp_extend" },
-        { NCBI_lower_case_tech_reads, "NCBI:lower_case_tech_reads" },
-        { NCBI_unpack, "NCBI:unpack" },
-        { NCBI_unzip, "NCBI:unzip" },
-        { NCBI_var_tokenize_var_id, "NCBI:var:tokenize_var_id" },
-        { vdb_add_row_id, "vdb:add_row_id" },
-        { vdb_bit_or, "vdb:bit_or" },
-        { vdb_bunzip, "vdb:bunzip" },
-        { vdb_ceil, "vdb:ceil" },
-        { vdb_clip, "vdb:clip" },
-        { vdb_cut, "vdb:cut" },
-        { vdb_delta, "vdb:delta" },
-        { vdb_deriv, "vdb:deriv" },
-        { vdb_diff, "vdb:diff" },
-        { vdb_echo, "vdb:echo" },
-        { vdb_exists, "vdb:exists" },
-        { vdb_extract_token, "vdb:extract_token" },
-        { vdb_fixed_vec_sum, "vdb:fixed_vec_sum" },
-        { vdb_floor, "vdb:floor" },
-        { vdb_funzip, "vdb:funzip" },
-        { vdb_integral, "vdb:integral" },
-        { vdb_integral_0, "vdb:integral_0" },
-        { vdb_iunzip, "vdb:iunzip" },
-        { vdb_izip, "vdb:izip" },
-        { vdb_map, "vdb:map" },
-        { vdb_max, "vdb:max" },
-        { vdb_min, "vdb:min" },
-        { vdb_outlier_decode, "vdb:outlier_decode" },
-        { vdb_outlier_encode, "vdb:outlier_encode" },
-        { vdb_pack, "vdb:pack" },
-        { vdb_paste, "vdb:paste" },
-        { vdb_rldecode, "vdb:rldecode" },
-        { vdb_round, "vdb:round" },
-        { vdb_simple_sub_select_1, "vdb:simple_sub_select_1" },
-        { vdb_sprintf, "vdb:sprintf" },
-        { vdb_strtonum, "vdb:strtonum" },
-        { vdb_subtract_row_id, "vdb:subtract_row_id" },
-        { vdb_sum, "vdb:sum" },
-        { vdb_trim, "vdb:trim" },
-        { vdb_trunc, "vdb:trunc" },
-        { vdb_undelta, "vdb:undelta" },
-        { vdb_unpack, "vdb:unpack" },
-        { vdb_unzip, "vdb:unzip" },
-        { vdb_vec_sum, "vdb:vec_sum" },
-
-        { vdb_hello, "vdb:hello" }
-    };
-
-    static VLinkerIntSpecial special [] =
-    {
-        { NCBI_SRA_accept_untyped, "NCBI:SRA:accept_untyped" },
-        { NCBI_SRA__454__untyped_0, "NCBI:SRA:_454_:untyped_0" },
-        { NCBI_SRA__454__untyped_1_2a, "NCBI:SRA:_454_:untyped_1_2a" },
-        { NCBI_SRA__454__untyped_1_2b, "NCBI:SRA:_454_:untyped_1_2b" },
-        { NCBI_SRA_Illumina_untyped_0a, "NCBI:SRA:Illumina:untyped_0a" },
-        { NCBI_SRA_Illumina_untyped_0b, "NCBI:SRA:Illumina:untyped_0b" },
-        { NCBI_SRA_Illumina_untyped_1a, "NCBI:SRA:Illumina:untyped_1a" },
-        { NCBI_SRA_Illumina_untyped_1b, "NCBI:SRA:Illumina:untyped_1b" },
-        { NCBI_SRA_ABI_untyped_1, "NCBI:SRA:ABI:untyped_1" }
-    };
-
-    rc_t rc = VLinkerAddFactories ( self, fact, sizeof fact / sizeof fact [ 0 ], tbl, env );
-    if ( rc == 0 )
-        rc = VLinkerAddUntyped ( self, special, sizeof special / sizeof special [ 0 ], tbl, env );
-    return rc;
-}
-
-
-/* MakeIntrinsic
- *  creates an initial, intrinsic linker
- *  pre-loaded with intrinsic factories
- */
-rc_t VLinkerMakeIntrinsic ( VLinker **lp )
-{
-    KDyld *dl;
-    rc_t rc = KDyldMake ( & dl );
-    if ( rc == 0 )
-    {
-        rc = VLinkerMake ( lp, NULL, dl );
-        KDyldRelease ( dl );
-
-        if ( rc == 0 )
-        {
-            KSymTable tbl;
-            VLinker *self = * lp;
-
-            /* create symbol table with no intrinsic scope */
-            rc = KSymTableInit ( & tbl, NULL );
-            if ( rc == 0 )
-            {
-                SchemaEnv env;
-                SchemaEnvInit ( & env, EXT_SCHEMA_LANG_VERSION );
-
-                /* make intrinsic scope modifiable */
-                KSymTablePushScope ( & tbl, & self -> scope );
-
-                /* add intrinsic functions */
-                rc = VLinkerInitFactories ( self, & tbl, & env );
-                if ( rc == 0 )
-                {
-                    KSymTableWhack ( & tbl );
-                    return 0;
-                }
-
-                KSymTableWhack ( & tbl );
-            }
-
-            VLinkerRelease ( self );
-        }
-    }
-
-    * lp = NULL;
-
-    return rc;
-}
diff --git a/libs/vdb/linker-priv.h b/libs/vdb/linker-priv.h
deleted file mode 100644
index 141c8d7..0000000
--- a/libs/vdb/linker-priv.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_linker_priv_
-#define _h_linker_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_token_
-#include <klib/token.h>
-#endif
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#ifndef _h_vdb_vdb_priv_
-#include <vdb/vdb-priv.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSymbol;
-struct KSymTable;
-struct KNamelist;
-struct KDyld;
-struct KDlset;
-struct KSymAddr;
-struct SFunction;
-struct SchemaEnv;
-struct VTransDesc;
-
-
-/*--------------------------------------------------------------------------
- * linker symbol types
- */
-enum
-{
-    ltFactory = eNumSymtabIDs,
-    ltUntyped
-};
-
-
-/*--------------------------------------------------------------------------
- * VLinker
- *  responsible for performing runtime schema resolution
- *  and C factory/function management
- *
- *  a schema will be declared with conditional productions and
- *  references to C functions. at load time, all schema expressions
- *  will be evaluated, unused conditional productions pruned,
- *  function references resolved, function objects created,
- *  and all paths rejected due to errors of any sort eliminated,
- *  leaving the final runtime schema.
- *
- *  the current implementation
- */
-typedef struct VLinker VLinker;
-struct VLinker
-{
-    /* dynamic loader */
-    struct KDyld *dl;
-
-    /* parent loader */
-    const VLinker *dad;
-
-    /* global scope for functions */
-    BSTree scope;
-
-    /* factory objects */
-    Vector fact;
-
-    /* special funcs */
-    Vector special;
-
-    KRefcount refcount;
-};
-
-
-/* Make
- *  creates an empty linker
- */
-rc_t VLinkerMake ( VLinker **lp, const VLinker *dad, struct KDyld *dl );
-
-/* MakeIntrinsic
- *  creates an initial, intrinsic linker
- *  pre-loaded with intrinsic factories
- */
-rc_t VLinkerMakeIntrinsic ( VLinker **intrinsic );
-
-/* InitFactories
- *  initialize intrinsic factories
- *
- *  "tbl" [ IN ] - linker-scope symbol table
- *
- *  "env" [ IN ] - default schema parser environment
- */
-rc_t VLinkerInitFactories ( VLinker *self,
-    struct KSymTable *tbl, struct SchemaEnv const *env );
-rc_t VLinkerInitFactoriesRead ( VLinker *self,
-    struct KSymTable *tbl, struct SchemaEnv const *env );
-
-/* AddFactories
- *  add a list of intrinsic factories
- *
- *  "fact" [ IN ] and "count" [ IN ] - list of intrinsic factories to register
- *
- *  "tbl" [ IN ] - linker-scope symbol table
- *
- *  "env" [ IN ] - default schema parser environment
- */
-typedef struct VLinkerIntFactory VLinkerIntFactory;
-struct VLinkerIntFactory
-{
-    rc_t ( CC * f ) ( struct VTransDesc *desc );
-    const char *name;
-};
-
-rc_t VLinkerAddFactories ( VLinker *self,
-    const VLinkerIntFactory *fact, uint32_t count,
-    struct KSymTable *tbl, struct SchemaEnv const *env );
-
-
-/* Release
- */
-rc_t VLinkerRelease ( const VLinker *self );
-
-/* Attach
- * Sever
- */
-VLinker *VLinkerAttach ( const VLinker *self );
-rc_t VLinkerSever ( const VLinker *self );
-
-
-/* AddLoadLibraryPath
- *  add a path[s] to loader for locating dynamic libraries
- */
-rc_t VLinkerVAddLoadLibraryPath ( const VLinker *self,
-    const char *path, va_list args );
-
-
-/* Open
- *  opens libraries for search
- */
-rc_t VLinkerOpen ( const VLinker *self, struct KDlset **libs );
-
-
-/* Find
- *  find a named symbol
- *
- *  "libs" [ IN ] - set of open libraries to search
- *
- *  "desc" [ OUT ] - transform factory description
- *  "func" [ OUT ] - return parameter for func pointer
- *
- *  "proto" [ IN ] - function prototype from schema
- *
- *  "external" [ OUT ] - true if function is not built-in
- */
-rc_t VLinkerFindFactory ( VLinker *self, struct KDlset const *libs,
-    VTransDesc *desc, struct SFunction const *proto, bool *external );
-rc_t VLinkerFindNamedFactory ( VLinker *self, struct KDlset const *libs,
-    VTransDesc *desc, const char *fact_name );
-rc_t VLinkerFindUntyped ( VLinker *self, struct KDlset const *libs,
-    VUntypedTableTest *func, struct SFunction const *proto );
-
-
-/* ListExternalSchemaModules
- */
-rc_t VLinkerListExternalSchemaModules ( const VLinker *self,
-    struct KNamelist **list );
-
-
-/*--------------------------------------------------------------------------
- * LFactory
- *  describes an external C function factory
- */
-typedef struct LFactory LFactory;
-struct LFactory
-{
-    /* factory function address */
-    struct KSymAddr const *addr;
-
-    /* factory name */
-    struct KSymbol const *name;
-
-    /* factory description */
-    VTransDesc desc;
-
-    /* factory id */
-    uint32_t id;
-
-    /* externally supplied factory */
-    bool external;
-};
-
-/* Whack
- */
-void CC LFactoryWhack ( void *item, void *ignore );
-
-
-/*--------------------------------------------------------------------------
- * LSpecial
- *  describes an external C table recognition function
- *  or a row-length function
- */
-typedef struct LSpecial LSpecial;
-struct LSpecial
-{
-    /* function address */
-    struct KSymAddr const *addr;
-
-    /* func name */
-    struct KSymbol const *name;
-
-    /* for built-in address */
-    VUntypedFunc func;
-
-    /* func id */
-    uint32_t id;
-};
-
-/* Whack
- */
-void CC LSpecialWhack ( void *item, void *ignore );
-
-
-#endif /* _h_linker_priv_ */
diff --git a/libs/vdb/linker.c b/libs/vdb/linker.c
deleted file mode 100644
index 1351a61..0000000
--- a/libs/vdb/linker.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "linker-priv.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* InitFactories
- */
-rc_t VLinkerInitFactories ( VLinker *self, struct KSymTable *tbl, struct SchemaEnv const *env )
-{
-    return VLinkerInitFactoriesRead ( self, tbl, env );
-}
diff --git a/libs/vdb/merge.c b/libs/vdb/merge.c
deleted file mode 100644
index 918f24f..0000000
--- a/libs/vdb/merge.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "blob.h"
-
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "xform-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-static unsigned uniq_list( unsigned dst[], void **list, unsigned N ) {
-    unsigned i;
-    unsigned j;
-    unsigned n;
-    void *on_stack[16];
-    void **uniq = on_stack;
-    void **on_heap = 0;
-    
-    if (N > sizeof(on_stack) / sizeof(on_stack[0])) {
-        on_heap = malloc(N * sizeof(on_heap[0]));
-        uniq = on_heap;
-    }
-    for (i = 0, n = 0; i != N; ++i) {
-        for (j = 0; j != n; ++j) {
-            if (uniq[j] == list[i])
-                break;
-        }
-        dst[i] = j;
-        if (j == n) {
-            uniq[j] = list[i];
-            ++n;
-        }
-    }
-    memcpy(list, uniq, n * sizeof(list[0]));
-    if (on_heap)
-        free(on_heap);
-    return n;
-}
-
-static
-rc_t CC VBlobCreateMerged( VBlob **lhs, uint32_t num_inputs, const VBlob *input[] ) {
-    unsigned i;
-    KDataBuffer buffer;
-    BlobHeaders *headers;
-    VBlobHeader *hdr;
-    rc_t rc;
-    uint64_t sz = 0;
-    uint32_t bsize;
-    
-/*
-     headers:
-         args:
-             num_inputs
-             num_row_maps
-             row_map_number[num_inputs]
-             length(row_map)[num_row_maps]
-             length(header)[num_inputs]
-             length(data_blob)[num_inputs]
-     data:
-         row_map[num_row_maps]
-         header[num_inputs]
-         data_blob[num_inputs]
- */
-    
-    for (i = 1; i != num_inputs; ++i) {
-        if (input[0]->start_id != input[i]->start_id || input[0]->stop_id != input[i]->stop_id)
-            return RC(rcVDB, rcBlob, rcConstructing, rcParam, rcInvalid);
-    }
-    
-    rc = BlobHeadersCreate(&headers);
-    if (rc)
-        return rc;
-    
-    hdr = BlobHeadersGetHdrWrite(headers);
-    if (hdr == NULL) {
-        BlobHeadersRelease(headers);
-        return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    }
-    rc = KDataBufferMakeBytes(&buffer, bsize = 0);
-    if (rc) {
-        VBlobHeaderRelease(hdr);
-        BlobHeadersRelease(headers);
-        return rc;
-    }
-    VBlobHeaderSetFormat(hdr, 0); /* TBD: set format id to correct value for merged or do it in caller */
-    VBlobHeaderSetVersion(hdr, 1);
-    
-    VBlobHeaderArgPushTail(hdr, num_inputs);
-    
-    {
-        unsigned *v;
-        PageMap **pm;
-        unsigned n;
-		
-        v = malloc(num_inputs * sizeof(*v));
-        pm = malloc(num_inputs * sizeof(*pm));
-        for (i = 0; i != num_inputs; ++i) {
-            pm[i] = input[i]->pm;
-        }
-        n = uniq_list(v, (void **)pm, num_inputs);
-        VBlobHeaderArgPushTail(hdr, n);
-        for (i = 0; i != num_inputs; ++i)
-            VBlobHeaderArgPushTail(hdr, v[i]);
-        free(v);
-        for (i = 0; rc == 0 && i != n; ++i) {
-            rc = PageMapSerialize(pm[i], &buffer, bsize, &sz);
-            VBlobHeaderArgPushTail(hdr, sz);
-            bsize += sz;
-        }
-        free(pm);
-    }
-    
-    for (i = 0; rc == 0 && i != num_inputs; ++i) {
-        if (input[i]->headers) {
-            rc = BlobHeadersSerialize(input[i]->headers, &buffer, bsize, &sz);
-            VBlobHeaderArgPushTail(hdr, sz);
-            bsize += sz;
-        }
-        else
-            VBlobHeaderArgPushTail(hdr, 0);
-    }
-    
-    for (i = 0; rc == 0 && i != num_inputs; ++i) {
-        const VBlob *o = input[i];
-        
-        sz = (uint32_t)BlobBufferBits( o );
-        rc = VBlobHeaderArgPushTail( hdr, sz );
-        sz = (sz + 7) >> 3;
-        if (rc == 0) {
-            rc = KDataBufferResize(&buffer, bsize + sz);
-            if (rc == 0) {
-                memcpy((uint8_t *)buffer.base + bsize, o->data.base, sz);
-                bsize += sz;
-            }
-        }
-    }
-    VBlobHeaderRelease(hdr);
-    if (rc == 0) {
-        VBlob *y;
-        
-        rc = VBlobNew(&y, input[0]->start_id, input[0]->stop_id, "merge");
-        if (rc == 0) {
-            y->headers = headers;
-            KDataBufferSub(&buffer, &y->data, 0, UINT64_MAX);
-            
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            y->byte_order = vboLittleEndian;
-#else
-            y->byte_order = vboBigEndian;
-#endif
-            *lhs = y;
-	    KDataBufferWhack(&buffer);
-            return 0;
-        }
-        rc = RC(rcVDB, rcBlob, rcConstructing, rcMemory, rcExhausted);
-    }
-    KDataBufferWhack(&buffer);
-    BlobHeadersRelease(headers);
-    
-    return rc;
-}
-
-static
-rc_t CC vdb_merge_impl(
-                    void *self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VBlob **rslt,
-                    uint32_t argc, const VBlob *argv[]
-) {
-	return VBlobCreateMerged(rslt, argc, argv);
-}
-
-VTRANSFACT_BUILTIN_IMPL(vdb_merge, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-	rslt->variant = vftBlobN;
-    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = vdb_merge_impl;
-	return 0;
-}
diff --git a/libs/vdb/meta-append.c b/libs/vdb/meta-append.c
deleted file mode 100644
index 1ea05f4..0000000
--- a/libs/vdb/meta-append.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include "schema-priv.h"
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct self_t {
-    KMDataNode *node;
-    void ( * byte_swap ) ( void *dst, const void *src, uint64_t count );    
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KMDataNodeRelease( self->node );
-    free( vp );
-}
-
-static
-rc_t CC meta_append_func(
-                     void *Self,
-                     const VXformInfo *info,
-                     int64_t row_id,
-                     VRowResult *rslt,
-                     uint32_t argc,
-                     const VRowData argv[]
-) {
-    self_t *self = Self;
-    char sbuf[1024];
-    void *buf = sbuf;
-    void *hbuf = 0;
-    bitsz_t offset = (argv[0].u.data.first_elem * argv[0].u.data.elem_bits);
-    bitsz_t blen = argv[0].u.data.elem_count * argv[0].u.data.elem_bits;
-    size_t length = (blen + 7) >> 3;
-    rc_t rc = 0;
-    
-    if (length > sizeof(sbuf)) {
-        hbuf = malloc(length);
-        if (hbuf == NULL)
-            return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        buf = hbuf;
-    }
-    
-    if (self->byte_swap)
-        self->byte_swap(buf, ((const uint8_t *)argv[0].u.data.base) + offset, argv[0].u.data.elem_count);
-    else {
-        memset(buf, 0, length);
-        bitcpy(buf, 0, argv[0].u.data.base, offset, blen);
-    }
-    
-    rc = KMDataNodeAppend(self->node, buf, length);
-    if (hbuf)
-        free(hbuf);
-    
-    if (rc == 0) {
-        rslt->elem_count = argv[0].u.data.elem_count;
-        rslt->elem_bits = argv[0].u.data.elem_bits;
-        assert(rslt->data->elem_bits == rslt->elem_bits);
-        rc = KDataBufferResize(rslt->data, rslt->elem_count);
-        if (rc == 0)
-            bitcpy(rslt->data->base, 0, argv[0].u.data.base, offset, blen);
-    }
-    return rc;
-}
-
-/* 
- */
-VTRANSFACT_BUILTIN_IMPL(meta_append, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-    SDatatype *sdt;
-    bool need_byte_swap;
-    
-    sdt = VSchemaFindTypeid(info->schema, info->fdesc.fd.td.type_id);
-    assert(sdt != NULL);
-    
-	self = calloc(1, sizeof(self_t));
-	if (self) {
-        KMetadata *meta;
-        
-        rc = VTableOpenMetadataUpdate((VTable *)info->tbl, &meta);
-        if (rc == 0) {
-            rc = KMetadataOpenNodeUpdate(meta, &self->node, cp->argv[0].data.ascii);
-            KMetadataRelease(meta);
-            if (rc == 0) {
-                KMDataNodeByteOrder(self->node, &need_byte_swap);
-                if (need_byte_swap)
-                    self->byte_swap = sdt->byte_swap;
-                
-                rslt->self = self;
-                rslt->whack = self_whack;
-                
-                rslt->variant = vftNonDetRow;
-                rslt->u.ndf = meta_append_func;
-                
-                return 0;
-            }
-        }
-        self_whack(self);
-	}
-	else
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        return rc;
-}
diff --git a/libs/vdb/meta-attr-read.c b/libs/vdb/meta-attr-read.c
deleted file mode 100644
index cb0324f..0000000
--- a/libs/vdb/meta-attr-read.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <sysalloc.h>
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct self_t {
-    const KMDataNode *node;
-    char *name;
-    KDataBuffer value;
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KDataBufferWhack( &self->value );
-    free( self->name );
-    KMDataNodeRelease( self->node );
-    free( vp );
-}
-
-static
-rc_t CC meta_attr_read_cstring(
-                            void *Self,
-                            const VXformInfo *info,
-                            int64_t row_id,
-                            VRowResult *rslt,
-                            uint32_t argc,
-                            const VRowData argv[]
-) {
-    self_t *self = Self;
-    size_t length;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttr(self->node, self->name, 0, 0, &length);
-    if (rc)
-        return rc;
-    rc = KDataBufferResize( &self->value, (uint32_t)( length + 1 ) );
-    if (rc)
-        return rc;
-    rc = KMDataNodeReadAttr( self->node, self->name, self->value.base, self->value.elem_count, &length );
-    if (rc)
-        return rc;
-    KDataBufferWhack( rslt->data );
-    KDataBufferSub( &self->value, rslt->data, 0, (uint32_t)length );
-    rslt->elem_count = (uint32_t)length;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_bool(
-                       void *Self,
-                       const VXformInfo *info,
-                       int64_t row_id,
-                       VRowResult *rslt,
-                       uint32_t argc,
-                       const VRowData argv[]
-) {
-    const self_t *self = Self;
-    int16_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsI16(self->node, self->name, &value);
-    if (rc)
-        return rc;
-    *(bool *)self->value.base = value == 0 ? false : true;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_I8(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    int16_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsI16(self->node, self->name, &value);
-    if (rc)
-        return rc;
-    *(int8_t *)self->value.base = (int8_t)value;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_U8(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    uint16_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsU16(self->node, self->name, &value);
-    if (rc)
-        return rc;
-    *(uint8_t *)self->value.base = (int8_t)value;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_I16(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    int16_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsI16(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_U16(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    uint16_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsU16(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_I32(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    int32_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsI32(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_U32(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    uint32_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsU32(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_I64(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    int64_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsI64(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_U64(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    uint64_t *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsU64(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_F32(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    double value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsF64(self->node, self->name, &value);
-    if (rc)
-        return rc;
-    *(float *)self->value.base = (float)value;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_read_F64(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    const self_t *self = Self;
-    double *value = self->value.base;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAttrAsF64(self->node, self->name, value);
-    if (rc)
-        return rc;
-    KDataBufferWhack(rslt->data);
-    KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    rslt->elem_count = 1;
-	return 0;
-}
-
-/* 
- function ascii meta:attr:read #1.0 < ascii node, ascii attr, * bool deterministic > ();
- */
-VTRANSFACT_BUILTIN_IMPL(meta_attr_read, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-    bool variable = false;
-    rc_t ( CC * var_row_func )(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-                         );
-    bool deterministic = true;
-    
-    if (cp->argc > 2)
-        deterministic = cp->argv[2].data.b[0];
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdBool:
-        var_row_func = meta_attr_read_bool;
-        break;
-    case vtdInt:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            var_row_func = meta_attr_read_I8;
-            break;
-        case 16:
-            var_row_func = meta_attr_read_I16;
-            break;
-        case 32:
-            var_row_func = meta_attr_read_I32;
-            break;
-        case 64:
-            var_row_func = meta_attr_read_I64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            var_row_func = meta_attr_read_U8;
-            break;
-        case 16:
-            var_row_func = meta_attr_read_U16;
-            break;
-        case 32:
-            var_row_func = meta_attr_read_U32;
-            break;
-        case 64:
-            var_row_func = meta_attr_read_U64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-            var_row_func = meta_attr_read_F32;
-            break;
-        case 64:
-            var_row_func = meta_attr_read_F64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdAscii:
-        variable = true;
-        var_row_func = meta_attr_read_cstring;
-        break;
-    default:
-        return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    
-	self = calloc(1, sizeof(self_t));
-	if (self) {
-        self->name = malloc(cp->argv[1].count + 1);
-        if (self->name) {
-            string_copy(self->name, cp->argv[1].count + 1, cp->argv[1].data.ascii,cp->argv[1].count);
-            if (!variable)
-                rc = KDataBufferMake(&self->value, info->fdesc.desc.intrinsic_bits, 1);
-            else
-                self->value.elem_bits = 8;
-            if (rc == 0) {
-                const KMetadata *meta;
-                
-                rc = VTableOpenMetadataRead(info->tbl, &meta);
-                if (rc == 0) {
-                    rc = KMetadataOpenNodeRead(meta, &self->node, "*.*s", cp->argv[0].count, cp->argv[0].data.ascii);
-                    KMetadataRelease(meta);
-                    if (rc == 0) {
-                        rslt->self = self;
-                        rslt->whack = self_whack;
-                        
-                        rslt->variant = deterministic ? vftRow : vftNonDetRow;
-                        rslt->u.ndf = var_row_func;
-                        
-                        return 0;
-                    }
-                }
-            }
-        }
-        self_whack(self);
-	}
-	else
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-	return rc;
-}
diff --git a/libs/vdb/meta-attr-write.c b/libs/vdb/meta-attr-write.c
deleted file mode 100644
index 2a2421c..0000000
--- a/libs/vdb/meta-attr-write.c
+++ /dev/null
@@ -1,529 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-typedef struct self_t {
-    KMDataNode *node;
-    char name[1];
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KMDataNodeRelease( self->node );
-    free( vp );
-}
-
-static rc_t meta_attr_write_fmt( self_t *self, const char *fmt, ... )
-{
-    rc_t rc;
-    size_t n;
-    char sbuf[4096];
-
-    va_list va;
-    va_start(va, fmt);
-    rc = string_vprintf(sbuf, sizeof(sbuf), & n, fmt, va);
-    va_end(va);
-    
-    if ( rc == 0 )
-        rc = KMDataNodeWriteAttr(self->node, self->name, sbuf);
-
-    return rc;
-}
-
-static
-rc_t CC meta_attr_write_ascii(
-                             void *Self,
-                             const VXformInfo *info,
-                             int64_t row_id,
-                             VRowResult *rslt,
-                             uint32_t argc,
-                             const VRowData argv[]
-) {
-    self_t *self = Self;
-
-    char *value;
-    size_t length = argv[0].u.data.elem_count;
-
-    const char *src = argv[0].u.data.base;
-    
-    rc_t rc = KDataBufferResize( rslt->data, (uint32_t)( length + 1 ) );
-    if (rc)
-        return rc;
-    
-    value = rslt->data->base;
-    memcpy(value, & src [ argv[0].u.data.first_elem ], length);
-    value[length] = '\0';
-
-    rc = KMDataNodeWriteAttr(self->node, self->name, value);
-    if (rc)
-        return rc;
-
-    rslt->elem_count = (uint32_t)length;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_bool(
-                          void *Self,
-                          const VXformInfo *info,
-                          int64_t row_id,
-                          VRowResult *rslt,
-                          uint32_t argc,
-                          const VRowData argv[]                          
-) {
-    rc_t rc;
-    self_t *self = Self;
-    uint8_t value = ((const uint8_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-
-    /* TBD -this is not dependent upon C code, but upon schema.
-       we probably want a warning here rather than an assert */
-    assert(argv[0].u.data.elem_count == 1);
-
-    rc = KDataBufferResize(rslt -> data, 1);
-    if (rc)
-        return rc;
-
-    *(uint8_t *)rslt->data->base = value ? true : false;
-    rc = meta_attr_write_fmt(self, "%s", value ? "true" : "false");
-    if (rc)
-        return rc;
-
-    rslt->elem_count = 1;
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_I8(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    self_t *self = Self;
-    int8_t value = ((const int8_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(int8_t *)rslt->data ->base = value;
-    rc = meta_attr_write_fmt(self, "%d", (int)value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_U8(
-                        void *Self,
-                        const VXformInfo *info,
-                        int64_t row_id,
-                        VRowResult *rslt,
-                        uint32_t argc,
-                        const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint8_t value = ((const uint8_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(uint8_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%u", (int)value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_I16(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    int16_t value = ((const int16_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(int16_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%d", (int)value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_U16(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint16_t value = ((const uint16_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(uint16_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%u", (int)value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_I32(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    int32_t value = ((const int32_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(int32_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%d", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_U32(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint32_t value = ((const uint32_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(uint32_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%u", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_I64(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    int64_t value = ((const int64_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(int64_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%ld", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_U64(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint64_t value = ((const uint64_t *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(uint64_t *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%lu", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC meta_attr_write_F32(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    float value = ((const float *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(float *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%.8e", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-static
-rc_t CC CC meta_attr_write_F64(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    self_t *self = Self;
-    double value = ((const double *)argv[0].u.data.base)[argv[0].u.data.first_elem];
-    rc_t rc = 0;
-    
-    assert(argv[0].u.data.elem_count == 1);
-    
-    rc = KDataBufferResize(rslt->data, 1);
-    if (rc)
-        return rc;
-    
-    *(double *)rslt->data->base = value;
-    rc = meta_attr_write_fmt(self, "%.16e", value);
-    if (rc)
-        return rc;
-    
-    rslt->elem_count = 1;
-    
-	return 0;
-}
-
-/* 
- */
-VTRANSFACT_BUILTIN_IMPL(meta_attr_write, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-    bool variable = false;
-    rc_t ( CC * var_row_func )(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-                         );
-    
-    switch (dp->argv[0].desc.domain) {
-    case vtdBool:
-        var_row_func = meta_attr_write_bool;
-        break;
-    case vtdInt:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            var_row_func = meta_attr_write_I8;
-            break;
-        case 16:
-            var_row_func = meta_attr_write_I16;
-            break;
-        case 32:
-            var_row_func = meta_attr_write_I32;
-            break;
-        case 64:
-            var_row_func = meta_attr_write_I64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            var_row_func = meta_attr_write_U8;
-            break;
-        case 16:
-            var_row_func = meta_attr_write_U16;
-            break;
-        case 32:
-            var_row_func = meta_attr_write_U32;
-            break;
-        case 64:
-            var_row_func = meta_attr_write_U64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdFloat:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 32:
-            var_row_func = meta_attr_write_F32;
-            break;
-        case 64:
-            var_row_func = meta_attr_write_F64;
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-        }
-        break;
-    case vtdAscii:
-        variable = true;
-        var_row_func = meta_attr_write_ascii;
-        break;
-    default:
-        return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    
-	self = calloc(1, sizeof *self + cp->argv[1].count);
-	if (self == NULL)
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        KMetadata *meta;
-        strcpy(self->name, cp->argv[1].data.ascii);
-        rc = VTableOpenMetadataUpdate((VTable *)info->tbl, &meta);
-        if (rc == 0) {
-            rc = KMetadataOpenNodeUpdate(meta, &self->node, cp->argv[0].data.ascii);
-            KMetadataRelease(meta);
-            if (rc == 0) {
-                rslt->self = self;
-                rslt->whack = self_whack;
-                        
-                rslt->variant = vftNonDetRow;
-                rslt->u.ndf = var_row_func;
-                        
-                return 0;
-            }
-        }
-        self_whack(self);
-	}
-
-	return rc;
-}
diff --git a/libs/vdb/meta-read.c b/libs/vdb/meta-read.c
deleted file mode 100644
index 6876d13..0000000
--- a/libs/vdb/meta-read.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include "schema-priv.h"
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct self_t {
-    const KMDataNode *node;
-    void ( * byte_swap ) ( void *dst, const void *src, uint64_t count );
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KMDataNodeRelease( self->node );
-    free( vp );
-}
-
-static
-rc_t CC meta_read_func(
-                     void *Self,
-                     const VXformInfo *info,
-                     int64_t row_id,
-                     VRowResult *rslt,
-                     uint32_t argc,
-                     const VRowData argv[]
-) {
-    self_t *self = Self;
-    size_t length;
-    size_t read;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeRead(self->node, 0, 0, 0, &read, &length);
-    if (rc == 0) {
-        rslt->data->elem_bits = 8;
-        rslt->data->elem_count = 0; /* no usable data */
-        rc = KDataBufferResize( rslt->data, length );
-        if (rc)
-            return rc;
-        
-        rc = KMDataNodeRead( self->node, 0, rslt->data->base, length, &length, 0 );
-        if (rc == 0) {
-            rc = KDataBufferCast(rslt->data, rslt->data, rslt->elem_bits, true);
-            if (rc == 0) {
-                if (self->byte_swap)
-                    self->byte_swap(rslt->data->base, rslt->data->base, rslt->data->elem_count);
-                rslt->elem_count = rslt->data->elem_count;
-            }
-        }
-    }
-    return rc;
-}
-
-/* 
- function < type T > T meta:read #1.0 < ascii node, * bool deterministic > ();
- */
-VTRANSFACT_BUILTIN_IMPL ( meta_read, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-    SDatatype *sdt;
-    bool need_byte_swap;
-    bool deterministic = true;
-    
-    if (cp->argc > 1)
-        deterministic = cp->argv[1].data.b[0];
-        
-    sdt = VSchemaFindTypeid(info->schema, info->fdesc.fd.td.type_id);
-    assert(sdt != NULL);
-    
-	self = calloc(1, sizeof(self_t));
-	if (self == NULL)
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        const KMetadata *meta;
-        
-        rc = VTableOpenMetadataRead(info->tbl, &meta);
-        if (rc == 0) {
-            rc = KMetadataOpenNodeRead(meta, &self->node, "%.*s", cp->argv[0].count, cp->argv[0].data.ascii);
-            KMetadataRelease(meta);
-            if (rc == 0) {
-                KMDataNodeByteOrder(self->node, &need_byte_swap);
-                if (need_byte_swap)
-                    self->byte_swap = sdt->byte_swap;
-                
-                rslt->self = self;
-                rslt->whack = self_whack;
-                
-                rslt->variant = deterministic ? vftRow : vftNonDetRow;
-                rslt->u.ndf = meta_read_func;
-                
-                return 0;
-            }
-        }
-        self_whack(self);
-	}
-    return rc;
-}
diff --git a/libs/vdb/meta-value.c b/libs/vdb/meta-value.c
deleted file mode 100644
index c511b74..0000000
--- a/libs/vdb/meta-value.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct self_t {
-    const KMDataNode *node;
-    KDataBuffer value;
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KMDataNodeRelease( self->node );
-    KDataBufferWhack( &self->value );
-    free( vp );
-}
-
-static
-rc_t CC meta_value_U8(
-                   void *Self,
-                   const VXformInfo *info,
-                   int64_t row_id,
-                   VRowResult *rslt,
-                   uint32_t argc,
-                   const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsU64(self->node, &value);
-    if (rc == 0) {
-        ((uint8_t *)self->value.base)[0] = (uint8_t)value;
-        rslt->elem_bits = 8;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_U16(
-                   void *Self,
-                   const VXformInfo *info,
-                   int64_t row_id,
-                   VRowResult *rslt,
-                   uint32_t argc,
-                   const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsU64(self->node, &value);
-    if (rc == 0) {
-        ((uint16_t *)self->value.base)[0] = (uint16_t)value;
-        rslt->elem_bits = 16;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_U32(
-                   void *Self,
-                   const VXformInfo *info,
-                   int64_t row_id,
-                   VRowResult *rslt,
-                   uint32_t argc,
-                   const VRowData argv[]
-) {
-    self_t *self = Self;
-    uint64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsU64(self->node, &value);
-    if (rc == 0) {
-        ((uint32_t *)self->value.base)[0] = (uint32_t)value;
-        rslt->elem_bits = 32;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_U64(
-                   void *Self,
-                   const VXformInfo *info,
-                   int64_t row_id,
-                   VRowResult *rslt,
-                   uint32_t argc,
-                   const VRowData argv[]
-) {
-    self_t *self = Self;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsU64(self->node, (uint64_t *)self->value.base);
-    if (rc == 0) {
-        rslt->elem_bits = 64;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-
-static
-rc_t CC meta_value_I8(
-                   void *Self,
-                   const VXformInfo *info,
-                   int64_t row_id,
-                   VRowResult *rslt,
-                   uint32_t argc,
-                   const VRowData argv[]
-) {
-    self_t *self = Self;
-    int64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsI64(self->node, &value);
-    if (rc == 0) {
-        ((int8_t *)self->value.base)[0] = (int8_t)value;
-        rslt->elem_bits = 8;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_I16(
-                    void *Self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VRowResult *rslt,
-                    uint32_t argc,
-                    const VRowData argv[]
-) {
-    self_t *self = Self;
-    int64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsI64(self->node, &value);
-    if (rc == 0) {
-        ((int16_t *)self->value.base)[0] = (int16_t)value;
-        rslt->elem_bits = 16;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_I32(
-                    void *Self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VRowResult *rslt,
-                    uint32_t argc,
-                    const VRowData argv[]
-) {
-    self_t *self = Self;
-    int64_t value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsI64(self->node, &value);
-    if (rc == 0) {
-        ((int32_t *)self->value.base)[0] = (int32_t)value;
-        rslt->elem_bits = 32;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_I64(
-                    void *Self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VRowResult *rslt,
-                    uint32_t argc,
-                    const VRowData argv[]
-) {
-    self_t *self = Self;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsI64(self->node, (int64_t *)self->value.base);
-    if (rc == 0) {
-        rslt->elem_bits = 64;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_F32(
-                    void *Self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VRowResult *rslt,
-                    uint32_t argc,
-                    const VRowData argv[]
-) {
-    self_t *self = Self;
-    double value;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsF64(self->node, &value);
-    if (rc == 0) {
-        ((float *)self->value.base)[0] = (float)value;
-        rslt->elem_bits = 32;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-static
-rc_t CC meta_value_F64(
-                    void *Self,
-                    const VXformInfo *info,
-                    int64_t row_id,
-                    VRowResult *rslt,
-                    uint32_t argc,
-                    const VRowData argv[]
-) {
-    self_t *self = Self;
-    rc_t rc = 0;
-    
-    rc = KMDataNodeReadAsF64(self->node, (double *)self->value.base);
-    if (rc == 0) {
-        rslt->elem_bits = 64;
-        rslt->elem_count = 1;
-        KDataBufferWhack(rslt->data);
-        rc = KDataBufferSub(&self->value, rslt->data, 0, UINT64_MAX);
-    }
-    return rc;
-}
-
-/* 
- function < type T > T meta:value #1.0 < ascii node, * bool deterministic > ();
- */
-VTRANSFACT_BUILTIN_IMPL(meta_value, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-    bool deterministic = true;
-    
-    if (cp->argc > 1)
-        deterministic = cp->argv[1].data.b[0];
-
-    self = calloc(1, sizeof(self_t));
-	if (self) {
-        rc = KDataBufferMake(&self->value, info->fdesc.desc.intrinsic_bits, 1);
-        if (rc == 0) {
-            const KMetadata *meta;
-            
-            rc = VTableOpenMetadataRead(info->tbl, &meta);
-            if (rc == 0) {
-                rc = KMetadataOpenNodeRead(meta, &self->node, "%.*s", cp->argv[0].count, cp->argv[0].data.ascii);
-                KMetadataRelease(meta);
-                if (rc == 0) {
-                    rslt->self = self;
-                    rslt->whack = self_whack;
-                    
-                    rslt->variant = deterministic ? vftRow : vftNonDetRow;
-                    switch (info->fdesc.desc.domain) {
-                    case vtdFloat:
-                        switch (info->fdesc.desc.intrinsic_bits) {
-                        case 32:
-                            rslt->u.ndf = meta_value_F32;
-                            return 0;
-                        case 64:
-                            rslt->u.ndf = meta_value_F64;
-                            return 0;
-                        default:
-                            break;
-                        }
-                        break;
-                    case vtdInt:
-                        switch (info->fdesc.desc.intrinsic_bits) {
-                        case 8:
-                            rslt->u.ndf = meta_value_I8;
-                            return 0;
-                        case 16:
-                            rslt->u.ndf = meta_value_I16;
-                            return 0;
-                        case 32:
-                            rslt->u.ndf = meta_value_I32;
-                            return 0;
-                        case 64:
-                            rslt->u.ndf = meta_value_I64;
-                            return 0;
-                        default:
-                            break;
-                        }
-                        break;
-                    case vtdUint:
-                        switch (info->fdesc.desc.intrinsic_bits) {
-                        case 8:
-                            rslt->u.ndf = meta_value_U8;
-                            return 0;
-                        case 16:
-                            rslt->u.ndf = meta_value_U16;
-                            return 0;
-                        case 32:
-                            rslt->u.ndf = meta_value_U32;
-                            return 0;
-                        case 64:
-                            rslt->u.ndf = meta_value_U64;
-                            return 0;
-                        default:
-                            break;
-                        }
-                        break;
-                    default:
-                        break;
-                    }
-                    rc = RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-                }
-            }
-        }
-        self_whack(self);
-	}
-	else
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    return rc;
-}
diff --git a/libs/vdb/meta-write.c b/libs/vdb/meta-write.c
deleted file mode 100644
index a720cb9..0000000
--- a/libs/vdb/meta-write.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include "schema-priv.h"
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct self_t {
-    KMDataNode *node;
-    void ( * byte_swap ) ( void *dst, const void *src, uint64_t count );
-} self_t;
-
-static void CC self_whack( void *vp ) {
-    self_t *self = vp;
-    
-    KMDataNodeRelease( self->node );
-    free( vp );
-}
-
-static
-rc_t CC meta_write_func(
-                     void *Self,
-                     const VXformInfo *info,
-                     int64_t row_id,
-                     VRowResult *rslt,
-                     uint32_t argc,
-                     const VRowData argv[]
-) {
-    self_t *self = Self;
-
-    /* pointer to input page */
-    const uint8_t *sbuf = argv [ 0 ] . u . data . base;
-
-    /* bit offset to first element in row */
-    bitsz_t offset = (argv[0].u.data.first_elem * argv[0].u.data.elem_bits);
-
-    /* the number of bits in this row */
-    bitsz_t blen = argv[0].u.data.elem_count * argv[0].u.data.elem_bits;
-
-    /* row length in bytes */
-    size_t length = (blen + 7) >> 3;
-
-    /* set output buffer size */
-    rc_t rc = KDataBufferCast ( rslt -> data, rslt -> data, rslt -> elem_bits, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( rslt -> data, (uint32_t)( blen / rslt -> elem_bits ) );
-    if ( rc != 0 )
-        return rc;
-
-    /* copy data: if byte-swapping, then data are at least 16-bit aligned */
-    if ( ( blen & 7 ) != 0 )
-    {
-        /* ensure trailing bits of buffer are zero */
-        ( ( uint8_t* ) rslt -> data -> base ) [ length - 1 ] = 0;
-        bitcpy ( rslt -> data -> base, 0, sbuf, offset, blen );
-    }
-    else if ( self -> byte_swap != NULL )
-    {
-        ( * self -> byte_swap ) ( rslt -> data -> base,
-            & sbuf [ offset >> 3 ], argv[0].u.data.elem_count );
-    }
-    else
-    {
-        memcpy ( rslt -> data -> base, & sbuf [ offset >> 3 ], length );
-    }
-
-    /* write row to metadata-node */
-    rc = KMDataNodeWrite ( self -> node, rslt -> data -> base, length );
-    if ( rc == 0 )
-        rslt -> elem_count = rslt -> data -> elem_count;
-
-    return rc;
-}
-
-/* meta:write
- */
-VTRANSFACT_BUILTIN_IMPL(meta_write, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    self_t *self;
-    bool need_byte_swap;
-    
-    SDatatype *sdt = VSchemaFindTypeid(info->schema, dp->argv[0].fd.td.type_id);
-    assert(sdt != NULL);
-    
-	self = calloc(1, sizeof(self_t));
-	if (self == NULL)
-		rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    else
-    {
-        KMetadata *meta;
-
-        /* even if we cast away const on the table,
-           kdb will still prevent us from doing so if
-           it's actually read-only */
-        rc = VTableOpenMetadataUpdate((VTable *)info->tbl, &meta);
-        if (rc == 0) {
-            rc = KMetadataOpenNodeUpdate(meta, &self->node, cp->argv[0].data.ascii);
-            KMetadataRelease(meta);
-            if (rc == 0) {
-                KMDataNodeByteOrder(self->node, &need_byte_swap);
-                if (need_byte_swap)
-                    self->byte_swap = sdt->byte_swap;
-                
-                rslt->self = self;
-                rslt->whack = self_whack;
-                
-                rslt->variant = vftNonDetRow;
-                rslt->u.ndf = meta_write_func;
-                
-                return 0;
-            }
-        }
-        self_whack(self);
-	}
-
-	return rc;
-}
diff --git a/libs/vdb/page-map.c b/libs/vdb/page-map.c
deleted file mode 100644
index 08c0066..0000000
--- a/libs/vdb/page-map.c
+++ /dev/null
@@ -1,1721 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#define TRACK_REFERENCES 0
-
-#include <vdb/extern.h>
-#include <klib/rc.h>
-#include <atomic.h>
-
-#include <bitstr.h>
-
-#include <klib/pack.h>
-#include <klib/vlen-encode.h>
-#include <sysalloc.h>
-#include "page-map.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-
-#include <zlib.h>
-
-/* Page maps describe the layout of rows within a blob.
- * The data within a page map is run-length encoded.
- * I.e. if two identical rows are stored sequentially 
- */
-
-
-
-#define VALIDATE_PAGEMAPS 0
-#define PAGEMAP_STATISTICS 0
-#if PAGEMAP_STATISTICS
-static struct {
-    size_t currentFootprint;
-    size_t maxFootprint;
-    size_t currentWaste;
-    size_t maxWaste;
-    unsigned alive;
-    unsigned maxAlive;
-    unsigned create;
-    unsigned createStatic;
-    unsigned createFixedRow;
-    unsigned createSingle;
-    unsigned grows;
-    unsigned expands;
-    unsigned expandCalls;
-    unsigned appends;
-} pm_stats;
-#endif
-
-elem_count_t PageMapLastLength(const PageMap *cself) {
-    return cself->leng_recs > 0 ? cself->length[cself->leng_recs - 1] : 0;
-}
-
-
-
-static rc_t PageMapRegionExpand(PageMap *self,pm_expand_region_type_t TYPE,row_count_t numrows,elem_count_t length,elem_count_t data_offset)
-{
-	rc_t rc;
-	if(   self->exp_rgn_last == 0           /** not started **/
-	   || self->exp_rgn_last->type != TYPE 	/** another type **/
-           || (TYPE == PM_REGION_EXPAND_SAMEDATA && self->exp_rgn_last->data_offset != data_offset)  /** not the same data */
-           || (TYPE!=PM_REGION_EXPAND_FULL && self->exp_rgn_last->length != length) /** all non-full types are length-dependant**/
-		){ /** New region **/
-		self->exp_rgn_cnt++;
-		rc = KDataBufferResize(&self->istorage, self->exp_rgn_cnt);
-		if(rc) return rc;
-
-		self->exp_rgn_last = (PageMapRegion *)self->istorage.base + self->exp_rgn_cnt -1;
-		self->exp_rgn_last->type=TYPE;
-		self->exp_rgn_last->start_row=self->exp_row_last;
-		self->exp_rgn_last->data_offset = data_offset;
-		self->exp_rgn_last->length = length;
-		self->exp_rgn_last->numrows = numrows;
-		self->exp_rgn_last->expanded = false;
- 	} else { /** continue with existing region **/
-		if(TYPE == PM_REGION_EXPAND_FULL){
-			row_count_t i;
-			elem_count_t *base;
-			uint64_t old_cnt = self->dstorage.elem_count;
-			uint64_t new_cnt = old_cnt + 2*numrows;
-			if(!self->exp_rgn_last->expanded){/*** need to start expansion ***/
-				new_cnt += 2*self->exp_rgn_last->numrows; /*** need to catch up **/
-				rc = KDataBufferResize(&self->dstorage, new_cnt);
-				if(rc) return rc;
-				base = (elem_count_t *)self->dstorage.base + old_cnt;
-				for(i=0;i<self->exp_rgn_last->numrows;i++){
-					base[2*i] = self->exp_rgn_last->length;
-					base[2*i+1] = self->exp_rgn_last->data_offset;
-				}
-				self->exp_rgn_last->data_offset = old_cnt;
-				self->exp_rgn_last->expanded=true;
-			} else {
-				rc = KDataBufferResize(&self->dstorage, new_cnt);
-				if(rc) return rc;
-				base = (elem_count_t *)self->dstorage.base + self->exp_rgn_last->data_offset;
-			}
-			base += 2*self->exp_rgn_last->numrows;
-			for(i=0;i<numrows;i++){
-				base[2*i]   = length;
-				base[2*i+1] = data_offset;
-			}
-		} else if(TYPE == PM_REGION_EXPAND_SAMELEN){
-			 row_count_t i;
-                        elem_count_t *base;
-                        uint64_t old_cnt = self->dstorage.elem_count;
-                        uint64_t new_cnt = old_cnt + numrows;
-                        if(!self->exp_rgn_last->expanded){/*** need to start expansion ***/
-                                new_cnt += self->exp_rgn_last->numrows; /*** need to catch up **/
-                                rc = KDataBufferResize(&self->dstorage, new_cnt);
-                                if(rc) return rc;
-                                base = (elem_count_t *)self->dstorage.base + old_cnt;
-                                for(i=0;i<self->exp_rgn_last->numrows;i++){
-                                        base[i] = self->exp_rgn_last->data_offset;
-                                }
-                                self->exp_rgn_last->data_offset = old_cnt;
-				self->exp_rgn_last->expanded=true;
-                        } else {
-				rc = KDataBufferResize(&self->dstorage, new_cnt);
-				if(rc) return rc;
-                                base = (elem_count_t *)self->dstorage.base + self->exp_rgn_last->data_offset;
-                        }
-			base += self->exp_rgn_last->numrows;
-                        for(i=0;i<numrows;i++){
-                                base[i]   = data_offset;
-                        }
-		}
-		self->exp_rgn_last->numrows += numrows;
-	}
-	return 0;
-}
-
-rc_t PageMapPreExpandFull(const PageMap *cself, row_count_t upto) /*** mostly for use as a temporary pagemap ***/
-{
-	rc_t    rc=0;
-	if(upto > 0){
-		PageMap *self = (PageMap *)cself;
-		assert(self->exp_rgn_last == 0);
-		rc = KDataBufferResize(&self->istorage, 1); /** one and only one pagemap **/
-		if(rc) return rc;
-		
-		self->exp_rgn_last = (PageMapRegion *)self->istorage.base + self->exp_rgn_cnt;
-		self->exp_rgn_cnt = ++self->exp_dr_last;
-
-		self->exp_rgn_last->data_offset = 0;
-		rc=KDataBufferResize(&self->dstorage, upto*2);
-		if(rc) return rc;
-		self->exp_rgn_last->start_row   = 0;
-		self->exp_rgn_last->numrows = 0;
-		self->exp_rgn_last->type = PM_REGION_EXPAND_FULL;
-		self->exp_rgn_last->expanded = true;
-		self->pre_exp_row_count = upto;
-	}
-	return rc;
-}
-
-rc_t PageMapExpandFull(const PageMap *cself)
-{
-	rc_t rc;
-	PageMap *self = (PageMap *)cself;
-	if(self->leng_recs == 1){ 
-		if(   self->data_recs == 1  /* static */
-                   || self->random_access ){ 
-			return 0;
-		} else if(self->data_recs == self->row_count && !self->random_access){ /** equidistant **/
-			rc=PageMapRegionExpand(self,PM_REGION_EXPAND_EQUIDISTANT,self->row_count,self->length[0],0);
-			if(rc) return rc;
-			self->exp_data_offset_last += self->row_count*self->length[0];
-			self->exp_row_last = self->row_count ;
-			self->exp_dr_last =  self->row_count;
-			self->exp_lr_last =  1;
-			self->exp_lr_used =  self->row_count;
-			return  0;
-		}
-        }
-	return 0;
-/*** OTHER VARIANTS  ***
-	return PageMapExpand(cself, cself->row_count);
-	return PageMapExpand(cself, cself->row_count < 1024?cself->row_count:1024);
-******************/
-}
-
-rc_t PageMapExpand(const PageMap *cself, row_count_t upto)
-{
-	rc_t	rc;
-        PageMap *self = (PageMap *)cself;
-#define LENG_RUN_TRIGGER 8
-#define DATA_RUN_TRIGGER 8
-#define EQUI_RUN_TRIGGER 8
-	if( self->leng_recs == 1 && self->row_count > self->data_recs*12/10 && !self->random_access){ /*** Shortcut to make tight loop ***/
-
-		if(self->exp_rgn_last == 0){
-			rc = KDataBufferResize(&self->istorage, self->data_recs);
-			if(rc) return rc;
-		}
-		self->exp_rgn_last = (PageMapRegion *)self->istorage.base + self->exp_rgn_cnt;
-		while(self->exp_dr_last < self->data_recs && self->exp_row_last <= upto + 128){
-			self->exp_rgn_last->start_row   = self->exp_row_last;
-			self->exp_rgn_last->data_offset = self->length[0]*self->exp_dr_last;
-			self->exp_rgn_last->numrows = self->data_run?self->data_run[self->exp_dr_last]:1;
-			self->exp_row_last += self->data_run?self->data_run[self->exp_dr_last]:1;
-			self->exp_rgn_last->type = PM_REGION_EXPAND_SAMEDATA;
-			self->exp_rgn_last->length      = self->length[0];
-			self->exp_rgn_last->expanded = false;
-			self->exp_dr_last  ++;
-			self->exp_rgn_last ++;
-		}
-		self->exp_rgn_cnt = self->exp_dr_last;
-	} else for(;self->exp_lr_last < self->leng_recs && self->exp_dr_last < self->data_recs && self->exp_row_last <= upto + 128;){
-		row_count_t leng_run=self->leng_run[self->exp_lr_last] - self->exp_lr_used;
-		elem_count_t length =self->length[self->exp_lr_last];
-		if(leng_run == 0) {
-			self->exp_lr_last++;
-			self->exp_lr_used=0;
-			continue;
-		}
-		if(leng_run >= LENG_RUN_TRIGGER && !self->random_access){
-			while(leng_run > 0 && self->exp_row_last <= upto + 128){
-				row_count_t data_run=self->data_run?self->data_run[self->exp_dr_last]:1;
-				assert(leng_run >= data_run);/** data runs should have the same lengths **/
-				assert(data_run > 0);
-				if(data_run >= DATA_RUN_TRIGGER){
-					rc=PageMapRegionExpand(self,PM_REGION_EXPAND_SAMEDATA,data_run, length,self->exp_data_offset_last);
-					if(rc) return rc;
-					assert(leng_run >= data_run);
-					leng_run -= data_run;
-					self->exp_lr_used += data_run;
-					self->exp_row_last+= data_run; 
-					self->exp_dr_last++;
-					self->exp_data_offset_last += length;
-				} else if( /**** quick check if all remaining rows are equidistant ****/
-					     self->exp_lr_last == self->leng_recs - 1 /*** last leng_run ***/
-					  && self->row_count - self->exp_row_last == self->data_recs - self->exp_dr_last /*** all remaining data_runs are 1 ***/
-					  && self->row_count - self->exp_row_last > EQUI_RUN_TRIGGER){ 
-						assert( leng_run == self->row_count - self->exp_row_last);
-						assert(data_run == 1);
-						rc=PageMapRegionExpand(self,PM_REGION_EXPAND_EQUIDISTANT,leng_run, length,self->exp_data_offset_last);
-						if(rc) return rc;
-						self->exp_data_offset_last += leng_run*length;
-						self->exp_row_last = self->row_count ;
-						self->exp_dr_last =  self->data_recs;
-						self->exp_lr_last = self->leng_recs;
-						self->exp_lr_used += leng_run;
-						leng_run = 0;
-						
-				} else {
-					if( data_run == 1){
-						row_count_t data_run_unique;
-						for( data_run_unique =0;
-						     data_run_unique < leng_run && ((self->data_run==NULL)||self->data_run[self->exp_dr_last+data_run_unique]==1);
-						     data_run_unique++){}
-						if(data_run_unique >= EQUI_RUN_TRIGGER){
-							rc=PageMapRegionExpand(self,PM_REGION_EXPAND_EQUIDISTANT,data_run_unique,length,self->exp_data_offset_last);
-							self->exp_dr_last += data_run_unique;
-							self->exp_data_offset_last += data_run_unique*length;
-							assert(leng_run >= data_run_unique);
-							leng_run -= data_run_unique;
-						        self->exp_lr_used  += data_run_unique;
-							self->exp_row_last += data_run_unique;
-						} else while(data_run_unique){
-							rc=PageMapRegionExpand(self,PM_REGION_EXPAND_SAMELEN,data_run,length,self->exp_data_offset_last);
-							if(rc) return rc;
-							assert(leng_run > 0);
-							leng_run --;
-							self->exp_lr_used ++;
-							self->exp_row_last++;
-							self->exp_dr_last++;
-							self->exp_data_offset_last += length;
-							data_run_unique--;
-						}
-					} else {
-						rc=PageMapRegionExpand(self,PM_REGION_EXPAND_SAMELEN,data_run,length,self->exp_data_offset_last);
-						if(rc) return rc;
-						assert(leng_run >= data_run);
-						leng_run -= data_run;
-						self->exp_lr_used += data_run;
-						self->exp_row_last+= data_run;
-						self->exp_dr_last++;
-						self->exp_data_offset_last += length;
-					}
-				}
-			}
-			assert(self->exp_row_last <= self->row_count);
-		} else {
-			while(leng_run > 0){
-				row_count_t data_run=cself->data_run?cself->data_run[self->exp_dr_last]:1;
-				assert(leng_run >= data_run);/** data runs should have the same lengths **/
-				if(self->random_access){
-					rc=PageMapRegionExpand(self,PM_REGION_EXPAND_FULL,data_run,length,self->data_offset[self->exp_row_last]);
-					self->exp_data_offset_last  = self->data_offset[self->exp_row_last] + length;
-				} else {
-					rc=PageMapRegionExpand(self,PM_REGION_EXPAND_FULL,data_run,length,self->exp_data_offset_last);
-					self->exp_data_offset_last += length;
-				}
-				if(rc) return rc;
-				self->exp_row_last += data_run;
-				assert(leng_run >= data_run);
-				leng_run -= data_run;
-				self->exp_lr_used += data_run;
-				self->exp_dr_last++;
-			}
-		}
-	}
-	return 0;
-}
-
-static rc_t PageMapFindRegion(const PageMap *cself,uint64_t row,PageMapRegion **pmr)
-{
-	/*** in PageMap rows are 0-based **/
-	rc_t	rc;
-	pm_size_t left,right,i_rgn;
-	if(row >= cself->row_count )
-		return  RC (rcVDB, rcPagemap, rcSearching, rcRow, rcNotFound );
-	if(cself -> exp_row_last <= row){
-		rc=PageMapExpand(cself,row);
-		if(rc) return rc;
-	}
-
-	if(cself->exp_rgn_cnt > 1){
-		i_rgn = cself->i_rgn_last;
-		left = 0;
-		right = cself->exp_rgn_cnt - 1;
-		while(right > left){
-			PageMapRegion*  rgn=  (PageMapRegion*)cself->istorage.base + i_rgn;
-			assert(i_rgn < cself->exp_rgn_cnt);
-			if(row < rgn->start_row){
-				right = i_rgn-1;
-				i_rgn  = (left + right) / 2;
-			} else if(row == rgn->start_row + rgn->numrows){ /*** special case for positive sequentual scans ***/
-				i_rgn++;
-			} else if(row > rgn->start_row + rgn->numrows){
-				left = i_rgn+1;
-				i_rgn =  (left + right + 1) / 2;
-			} else {
-				break;
-			}
-		}
-	} else {
-		i_rgn = 0;
-	}
-	{
-		PageMap *self = (PageMap *)cself;
-		self->i_rgn_last = i_rgn;
-		self->rgn_last = (PageMapRegion*)self->istorage.base+cself->i_rgn_last;
-	}
-	assert(cself->rgn_last->start_row <= row);
-	assert(cself->rgn_last->start_row + cself->rgn_last->numrows > row);
-	if(pmr) *pmr=(PageMapRegion*)cself->istorage.base + i_rgn;
-	return 0;
-}
-
-static rc_t PageMapRegionGetData(const PageMapRegion *cself,const elem_count_t *exp_base,uint64_t row,uint32_t * data_offset,uint32_t * data_length,uint32_t * repeat_count)
-{
-	if(row < cself->start_row || row >= cself->start_row + cself->numrows)
-		return  RC (rcVDB, rcPagemap, rcSearching, rcRow, rcNotFound );
-
-	if(data_offset != NULL || data_length != NULL || repeat_count != NULL){
-		if(!cself->expanded){
-			if(data_length) *data_length=cself->length;
-			if(data_offset){
-				*data_offset=cself->data_offset;
-				if(cself->type == PM_REGION_EXPAND_EQUIDISTANT){
-					*data_offset += cself->length * (row - cself->start_row);
-				}
-			}
-			if(repeat_count) {
-				if(cself->type == PM_REGION_EXPAND_EQUIDISTANT) *repeat_count=1;
-				else *repeat_count = cself->numrows + cself->start_row - row;
-			}
-		} else switch(cself->type){
-			case PM_REGION_EXPAND_FULL:
-				{
-					row_count_t  i = row - cself->start_row;
-					exp_base += cself->data_offset;
-					if(data_length)  *data_length = exp_base[2*i];
-					if(data_offset)  *data_offset = exp_base[2*i+1];
-					if(repeat_count){
-						int j;
-						for(j=i+1;   j<cself->numrows
-							  && exp_base[2*i]   == exp_base[2*j]
-							  && exp_base[2*i+1] == exp_base[2*j+1];j++){}
-						*repeat_count = j-i;
-					}
-				}
-				break;
-			case PM_REGION_EXPAND_SAMELEN:
-				if(data_length) *data_length=cself->length;
-				if(data_offset || repeat_count){
-					row_count_t  i = row - cself->start_row;
-					exp_base += cself->data_offset;
-					if(data_offset) *data_offset = exp_base[i];
-					if(repeat_count){
-						int j;
-						for(j=i+1;j<cself->numrows && exp_base[i] == exp_base[j];j++){}
-						*repeat_count = j-i;
-					}
-				}
-				break;
-			default: /*** should not happen to anything but 2 above **/
-				return RC (rcVDB, rcPagemap, rcSearching, rcData, rcInconsistent ); 
-		}
-	}
-	return 0;
-}
-
-/*** This is a heavy-weight function which gets data by integration all the time - useful for debugging ****/
-static rc_t PageMapGetData_HW(const PageMap *cself,uint64_t row,uint32_t * data_offset,uint32_t * data_length,uint32_t * repeat_count)
-{
-	if(row >= cself->row_count)
-		return  RC (rcVDB, rcPagemap, rcSearching, rcRow, rcNotFound );
-	if(data_offset != NULL || data_length != NULL || repeat_count != NULL){
-		uint64_t i,j,r;
-		uint32_t dto,dtl,dtr;
-		uint32_t leng_run,data_run;
-		r=dto=i=j=0;
-		leng_run=cself->leng_run[0];
-		while(1){
-			dtl  = cself->length[i];
-			data_run=cself->data_run?cself->data_run[j]:1;
-			j++;
-			r+= data_run;
-			if(r > row){
-				dtr = r - row;
-				 break;
-			}
-			dto += dtl;
-			leng_run -= data_run;
-			if(leng_run == 0){
-				i++;
-				leng_run=cself->leng_run[i];
-			}
-		}
-		if(data_length)   *data_length=dtl;
-		if(data_offset)   *data_offset=dto;
-		if(repeat_count)  *repeat_count=dtr;
-	}
-	return 0;
-}
-/*** another function to help debugging ***/
-static int DEBUG_PageMapPrintSum(const PageMap *pm, uint32_t row)
-{
-	int i,r;
-	for(i=0,r=row; i < pm->data_recs && r > 0;r-=pm->data_run?pm->data_run[i]:1,i++){}
-	printf("Data recs= <%d>, rows_left = <%d>\n",i,r);
-	for(i=0,r=row; i < pm->leng_recs && r >0;r-=pm->leng_run[i++]){}
-	printf("Leng recs= <%d>, rows_left = <%d>\n",i,r);
-	return 0;
-}
-rc_t PageMapFindRow(const PageMap *cself,uint64_t row,uint32_t * data_offset,uint32_t * data_length,uint32_t * repeat_count)
-{
-	rc_t	rc=0;
-	PageMapRegion *pmr;
-
-	if(cself->data_recs == 1){ /** static **/
-		if(repeat_count) *repeat_count = UINT32_MAX;
-		if(data_offset)  *data_offset = 0;
-		if(data_length)  *data_length = cself->length[0];
-		return 0;
-        }
-	if(cself->random_access && cself->leng_recs == 1){
-		if(row >= cself->data_recs)
-			return RC(rcVDB, rcPagemap, rcAccessing, rcRow, rcOutofrange);
-		if(data_length)  *data_length = cself->length[0];
-		if(data_offset)  *data_offset =  cself->data_offset[row];
-		if(repeat_count){
-			uint64_t i;
-			for( i=row+1, repeat_count[0]=1; i < cself->data_recs &&  cself->data_offset[i] == cself->data_offset[row]; i++, repeat_count[0]++ ){}
-		}
-		return 0;
-	}
-
-	rc = PageMapFindRegion(cself,row,&pmr);
-	if(rc) return rc;
-
-        rc = PageMapRegionGetData(pmr,cself->dstorage.base,row,data_offset,data_length,repeat_count);
-	if(rc) return rc;
-
-#if _HEAVY_PAGEMAP_DEBUGGING
-	{
-		uint32_t dto,dtl,dtr;
-		rc = PageMapGetData_HW(cself,row,&dto,&dtl,&dtr);
-		assert(rc == 0);
-		if(data_length) assert(dtl==*data_length);
-		if(data_offset) assert(dto==*data_offset);
-		if(repeat_count)  assert(dtr==*repeat_count);
-	}
-#endif
-	return 0;
-}
-
-rc_t PageMapNewIterator(const PageMap *self, PageMapIterator *lhs, uint64_t first_row, uint64_t num_rows)
-{
-    rc_t rc;
-
-    if (first_row + num_rows > self->row_count)
-        num_rows = self->row_count - first_row;
-
-#if _DEBUGGING
-    if (self->data_recs > 1) {
-        assert(first_row == (row_count_t)first_row);
-        assert(num_rows == (row_count_t)num_rows);
-        assert(first_row + num_rows == (row_count_t)(first_row + num_rows));
-    }
-#endif
-    
-    memset(lhs, 0, sizeof(*lhs));
-
-#if _HEAVY_PAGEMAP_DEBUGGING
-    lhs->parent = self;
-#endif
-
-    lhs->last_row = first_row + num_rows;
-    lhs->cur_row = first_row;
-    if(self->data_recs == 1){
-	lhs->repeat_count  = (num_rows < UINT32_MAX)?num_rows:UINT32_MAX;
-	lhs->static_datalen = self->length[0];
-	return 0;
-    }
-    if(self->random_access && self->leng_recs == 1 && first_row < self->row_count){ /** simple random access - no explosion needed **/
-	lhs->static_datalen = self->length[0];
-	lhs->exp_base = &self->data_offset;
-	if(lhs->last_row > self->row_count) lhs->last_row = self->row_count;
-	return 0;
-    }
-    if( self->exp_row_last < lhs->last_row){
-	    rc = PageMapExpand(self,lhs->last_row-1);
-	    if(rc) return rc;
-    }
-    rc = PageMapFindRow(self,first_row,NULL,NULL,NULL);
-    if(rc) return rc;
-    lhs->rgns    = (PageMapRegion**) &self->istorage.base;
-    lhs->exp_base = (elem_count_t**) &self->dstorage.base;
-    lhs->cur_rgn  = self->i_rgn_last;
-    lhs->cur_rgn_row = lhs->cur_row - (*lhs->rgns)[self->i_rgn_last].start_row;
-    assert(lhs->cur_rgn_row < (*lhs->rgns)[self->i_rgn_last].numrows);
-    return  0;
-}
-
-static PageMap *new_PageMap(void) {
-
-    PageMap *y;
-    y = malloc(sizeof(*y));
-    if (y) {
-	memset(y,0,sizeof(*y));
-        KRefcountInit(&y->refcount, 1, "PageMap", "new", "");
-	y->istorage.elem_bits = sizeof(PageMapRegion)*8;
-	y->dstorage.elem_bits = sizeof(elem_count_t)*8;
-    }
-    return y;
-}
-
-static PageMap *new_StaticPageMap(unsigned length, unsigned data) {
-    union {
-        PageMap pm;
-        row_count_t rcnt;
-        elem_count_t ecnt;
-    } *y;
-    size_t const sz = sizeof(*y)
-                    + sizeof(y->pm.length[0]) * length
-                    + sizeof(y->pm.leng_run[0]) * length
-                    + sizeof(y->pm.data_run[0]) * data;
-    
-    y = malloc(sz);
-    if (y) {
-#if PAGEMAP_STATISTICS
-        ++pm_stats.createStatic;
-        ++pm_stats.alive;
-        if (pm_stats.maxAlive < pm_stats.alive)
-            pm_stats.maxAlive = pm_stats.alive;
-        pm_stats.currentFootprint += sz;
-        if (pm_stats.maxFootprint < pm_stats.currentFootprint)
-            pm_stats.maxFootprint = pm_stats.currentFootprint;
-#endif
-        memset(&y->pm, 0, sizeof(y->pm));
-        KRefcountInit(&y->pm.refcount, 1, "PageMap", "new_Static", "");
-        y->pm.length = (elem_count_t *)&y[1];
-        y->pm.leng_run = (row_count_t *)&y->pm.length[length];
-        y->pm.data_run = &y->pm.leng_run[length];
-        y->pm.reserve_leng = length;
-        y->pm.reserve_data = data;
-	y->pm.istorage.elem_bits = sizeof(PageMapRegion)*8;
-	y->pm.dstorage.elem_bits = sizeof(elem_count_t)*8;
-    }
-    return &y->pm;
-}
-
-static
-rc_t PageMapGrow(PageMap *self, uint32_t new_reserve_leng, uint32_t new_reserve_data) {
-    uint32_t sz;
-    PageMap temp = *self;
-    uint32_t reserve_data = self->reserve_data;
-    uint32_t reserve_leng = self->reserve_leng;
-    rc_t rc;
-
-#if PAGEMAP_STATISTICS
-    ++pm_stats.grows;
-#endif
-    if (new_reserve_leng > (1UL << 31) || new_reserve_data > (1UL << 31))
-        return RC(rcVDB, rcPagemap, rcAllocating, rcParam, rcExcessive);
-    
-    if (reserve_leng == 0)
-        reserve_leng = 1;
-    if (reserve_data == 0)
-        reserve_data = 1;
-#define MIN_KBUF_RESERVE_SIZE 256  
-    while (reserve_leng < new_reserve_leng)
-        reserve_leng <<= 1;
-    if (reserve_leng < MIN_KBUF_RESERVE_SIZE) reserve_leng = MIN_KBUF_RESERVE_SIZE;
-    while (reserve_data < new_reserve_data)
-        reserve_data <<= 1;
-    if (reserve_data < MIN_KBUF_RESERVE_SIZE) reserve_data = MIN_KBUF_RESERVE_SIZE;
-
-    sz = reserve_leng * 2 + reserve_data;
-#if PAGEMAP_STATISTICS
-    pm_stats.currentFootprint -= KDataBufferMemorySize(&self->estorage);
-#endif
-    {
-        KDataBuffer new_buffer;
-        
-        rc = KDataBufferMake(&new_buffer, 8 * sizeof(uint32_t), sz);
-        if (rc)
-            return rc;
-#if PAGEMAP_STATISTICS
-        pm_stats.currentFootprint += KDataBufferMemorySize(&self->estorage);
-        if (pm_stats.maxFootprint < pm_stats.currentFootprint)
-            pm_stats.maxFootprint = pm_stats.currentFootprint;
-#endif
-        self->cstorage = new_buffer;
-    }
-    self->length = self->cstorage.base;
-    self->leng_run = self->length + reserve_leng;
-    self->data_run = self->leng_run + reserve_leng;
-    self->start_valid = 0;
-    
-    if (self->leng_recs > 0 && temp.length != NULL) {
-        memcpy(self->length  , temp.length  , self->reserve_leng * sizeof(uint32_t));
-        memcpy(self->leng_run, temp.leng_run, self->reserve_leng * sizeof(uint32_t));
-    }
-    if (self->data_recs > 0 && temp.data_run != NULL)
-        memcpy(self->data_run, temp.data_run, self->reserve_data * sizeof(uint32_t));
-
-    self->reserve_leng = reserve_leng;
-    self->reserve_data = reserve_data;
-#if PAGEMAP_STATISTICS
-    pm_stats.currentWaste += (self->reserve_data - self->data_recs) * sizeof(self->data_run[0]) +
-                             (self->reserve_leng - self->leng_recs) * (sizeof(self->leng_run[0]) + sizeof(self->length[0]));
-    if (pm_stats.maxWaste < pm_stats.currentWaste)
-        pm_stats.maxWaste = pm_stats.currentWaste;
-#endif
-    KDataBufferWhack(&temp.cstorage);
-
-    return 0;
-}
-
-rc_t PageMapNew(PageMap **lhs, uint32_t reserve) {
-    PageMap *y = new_PageMap();
-
-    if (y == NULL)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-
-    if (reserve > 0) {
-        rc_t rc = PageMapGrow(y, reserve, reserve);
-        if (rc) {
-            free(y);
-            return rc;
-        }
-#if PAGEMAP_STATISTICS
-        --pm_stats.grows;
-#endif
-    }
-    *lhs = y;
-#if PAGEMAP_STATISTICS
-    ++pm_stats.create;
-    ++pm_stats.alive;
-    if (pm_stats.maxAlive < pm_stats.alive)
-        pm_stats.maxAlive = pm_stats.alive;
-    pm_stats.currentFootprint += sizeof(*y);
-    if (pm_stats.maxFootprint < pm_stats.currentFootprint)
-        pm_stats.maxFootprint = pm_stats.currentFootprint;
-#endif
-    return 0;
-}
-
-rc_t PageMapToRandomAccess(PageMap **rslt, PageMap * src,uint32_t *data_offset) /** data_offset should have dimension of data_run ***/
-{
-	rc_t rc;
-	bool simple = (src->row_count == src->data_recs);
-	PageMap *dst;
-	assert(src->row_count >= src->leng_recs);
-	rc = PageMapNew(&dst, 0);
-	if(rc == 0){
-		dst->leng_recs=src->leng_recs;
-		dst->row_count=src->row_count;
-		rc = KDataBufferMake(&dst->cstorage, 8 * sizeof(uint32_t), 2*dst->leng_recs+(data_offset?dst->row_count:0));
-		if(rc == 0){
-			dst->length = dst->cstorage.base;
-			dst->leng_run    = dst->length   + dst->leng_recs;
-			dst->data_recs = src->row_count;
-			memcpy(dst->length,  src->length,  sizeof(uint32_t)*dst->leng_recs);
-			memcpy(dst->leng_run,src->leng_run,sizeof(uint32_t)*dst->leng_recs);
-			if(data_offset){
-				dst->data_offset = dst->leng_run + dst->leng_recs;
-				if(simple){
-					memcpy(dst->data_offset,data_offset,sizeof(uint32_t)*dst->row_count);
-				} else {
-					uint32_t i,j;
-					for(i=j=0;i<src->data_recs;i++){
-						elem_count_t data_len=src->data_run[i];
-						while(data_len > 0){
-							assert(j < src->row_count);
-							dst->data_offset[j++] = data_offset[i];
-							data_len--;
-						}
-					}
-				}
-				dst->random_access=true;
-			} 
-			dst->reserve_leng = dst->leng_recs;
-			dst->reserve_data = dst->row_count;
-			dst->start_valid = dst->row_count;
-			*rslt = dst;
-			return 0;
-		}
-		PageMapRelease(dst);
-	}
-	return rc;
-}
-
-
-rc_t PageMapNewFixedRowLength(PageMap **lhs, uint64_t row_count, uint64_t row_len) {
-    PageMap *y;
-    rc_t rc;
-
-    if (row_count >> 32 != 0 || row_len >> 32 != 0)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcTooBig);
-    
-    rc = PageMapNew(&y, 0);
-#if PAGEMAP_STATISTICS
-    ++pm_stats.createFixedRow;
-    --pm_stats.create;
-#endif
-    if (rc)
-        return rc;
-    rc = PageMapGrow(y, 1, (uint32_t)row_count);
-#if PAGEMAP_STATISTICS
-    --pm_stats.grows;
-#endif
-    if (rc == 0) {
-	int i;
-        *lhs = y;
-        y->length[0] = (uint32_t)row_len;
-        y->leng_run[0] = (uint32_t)row_count;
-        y->leng_recs = 1;
-        y->data_recs = (uint32_t)row_count;
-        y->row_count = (uint32_t)row_count;
-        for (i = 0; i != (uint32_t)row_count; ++i) {
-            y->data_run[i] = 1;
-        }
-
-    }
-    if (rc)
-        PageMapRelease(y);
-    return rc;
-}
-
-rc_t PageMapNewSingle(PageMap **lhs, uint64_t row_count, uint64_t row_len) {
-    PageMap *y;
-    rc_t rc;
-    
-    if (row_count >> 32 != 0)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcTooBig);
-    
-    rc = PageMapNewFixedRowLength(&y, 1, row_len);
-    if (rc == 0) {
-#if PAGEMAP_STATISTICS
-        ++pm_stats.createSingle;
-        --pm_stats.createFixedRow;
-#endif
-        y->row_count = y->data_run[0] = y->leng_run[0] = (uint32_t)row_count;
-        *lhs = y;
-    }
-    return rc;
-}
-
-bool PageMapHasRows(const PageMap *self) {
-    return self->data_recs > 0;
-}
-
-uint32_t PageMapFixedRowLength (const PageMap *self) {
-    uint32_t rslt = 0;
-    
-    if (self->leng_recs == 1)
-        rslt = self->length[0];
-    return rslt;
-}
-
-rc_t PageMapRowLengthRange (const PageMap *self,elem_count_t *min,elem_count_t *max)
-{
-    int i;
-    *min = *max = self->length[0];
-    for(i=1;i<self->leng_recs;i++){
-	if      (self->length[i] < *min) *min = self->length[i];
-	else if (self->length[i] > *max) *max = self->length[i];
-    }
-    return 0;
-}
-
-
-uint32_t PageMapHasSimpleStructure(const PageMap *self) {
-    uint32_t rslt = PageMapFixedRowLength(self);
-    
-    if (rslt == 0)
-        return rslt;
-
-    if(self->data_recs != self->row_count) return 0;
-
-    return rslt;
-}
-
-#if 0
-static bool PageMapValidate(const PageMap *cself) {
-    unsigned i;
-    uint32_t n;
-    uint32_t m;
-        
-    for (m = 0, i = 0; i != cself->leng_recs; ++i) m += cself->leng_run[i];
-    for (n = 0, i = 0; i != cself->data_recs; ++i) n += cself->data_run[i];
-
-    return m == n ? true : false;
-}
-
-static
-rc_t PageMapAppendRun(PageMap *self, uint32_t run_length, uint32_t row_length) {
-    return -1;
-}
-#endif
-
-rc_t PageMapAppendRows(PageMap *self, uint64_t row_length, uint64_t run_length, bool same_data) {
-    rc_t rc;
-    uint32_t leng_cur = self->leng_recs - 1;
-    uint32_t data_cur = self->data_recs - 1;
-    
-    if ((uint32_t)row_length != row_length)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcTooBig);
-    
-    if ((uint32_t)run_length != run_length)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcTooBig);
-    
-    if (self->leng_recs && row_length == self->length[leng_cur])
-        self->leng_run[leng_cur] += run_length;
-    else {
-        same_data = false;
-        leng_cur = self->leng_recs;
-        ++self->leng_recs;
-
-#if PAGEMAP_STATISTICS
-        pm_stats.currentWaste -= sizeof(self->leng_run[0]) + sizeof(self->length[0]);
-#endif
-        
-        if (self->leng_recs >= self->reserve_leng) {
-            rc = PageMapGrow(self, self->leng_recs, 0);
-            if (rc)
-                return rc;
-        }
-        self->leng_run[leng_cur] = run_length;
-        self->length[leng_cur] = (uint32_t)row_length;
-    }
-    if (self->data_recs && same_data)
-        self->data_run[data_cur] += run_length;
-    else {
-        data_cur = self->data_recs;
-        ++self->data_recs;
-        
-#if PAGEMAP_STATISTICS
-        pm_stats.currentWaste -= sizeof(self->data_run[0]);
-#endif
-        
-        if (self->data_recs >= self->reserve_data) {
-            rc = PageMapGrow(self, 0, self->data_recs);
-            if (rc)
-                return rc;
-        }
-        self->data_run[data_cur] = run_length;
-    }
-    if(self->row_count < self->pre_exp_row_count){
-	int i;
-	elem_count_t *exp_base = self->dstorage.base;
-	elem_count_t data_offset;
-	if(same_data){
-		if(self->row_count == 0){
-			data_offset = 0;
-		} else {
-			data_offset = exp_base[2*self->row_count-1];
-		}
-	} else {
-		data_offset = self->exp_data_offset_last;
-		self->exp_data_offset_last += row_length;
-	}
-	for(i=self->row_count;i<run_length+self->row_count;i++){
-		exp_base[2*i]  =  row_length;
-		exp_base[2*i+1]=  data_offset;
-	}
-	self->exp_row_last += run_length;
-	self->exp_rgn_last->numrows += run_length;
-	
-    }
-    self->row_count += run_length;
-    return 0;
-}
-
-static rc_t serialize_lengths(
-                              KDataBuffer *Dst,
-                              uint64_t offset, 
-                              const uint32_t run[],
-                              unsigned runs,
-                              uint64_t *consumed
-) {
-    rc_t rc;
-    unsigned i;
-    uint64_t j;
-    uint64_t n;
-    uint8_t *dst = Dst->base;
-    
-    dst += offset;
-    *consumed = 0;
-    for (i = 0, j = 0, n = 0, rc = 0; rc == 0 && i != runs; ++i, j += n)
-        rc = vlen_encodeU1(dst + j, 5, &n, run[i]);
-    
-    if (rc == 0)
-        *consumed = j;
-    
-    return rc;
-}
-
-#if 0
-
-static rc_t deserialize_lengths(
-                                uint32_t run[],
-                                unsigned runs,
-                                uint8_t const src[],
-                                unsigned ssize,
-                                uint64_t *consumed
-) {
-    unsigned i;
-    unsigned j;
-    uint64_t n;
-    
-    *consumed = 0;
-    for (i = 0, j = 0; i != runs; ++i, j += (unsigned)n) {
-        uint64_t val;
-        rc_t rc = vlen_decodeU1(&val, src + j, ssize - j, &n);
-        
-        if (rc) return rc;
-        run[i] = (uint32_t)val;
-    }
-    *consumed = j;
-    return 0;
-}
-#else
-
-#if _ARCH_BITS == 32
-#define FLAG_64 0x8080808080808080ULL
-#define VAL_64  0x7F7F7F7F7F7F7F7FULL
-#else
-#define FLAG_64 0x8080808080808080UL
-#define VAL_64  0x7F7F7F7F7F7F7F7FUL
-#endif
-
-static rc_t deserialize_lengths(
-                                uint32_t run[],
-                                unsigned runs,
-                                uint8_t const src[],
-                                unsigned ssize,
-                                uint64_t *consumed
-) {
-    uint8_t	to_align = 16 - (((long)src)&15);/** alignmentto 16 bytes will make optimizer and cpu happy. don't care about loss in cast - we need the lowest byte **/
-    int		si=0;/**source index **/
-    int		di=0;/** destination index **/
-    int		pcnt = (ssize - to_align )/8; 
-
-    memset(run,0,runs*sizeof(*run));
-    if(pcnt){ /** does it make sense at all ***/
-	uint64_t    *ptr=(uint64_t*) (src + to_align);
-	int         pi;
-	
-	for(;si<to_align && di < runs ;si++){ /** align the pointer first **/
-		if(((int8_t)src[si]) < 0) {
-			run[di] += src[si] & 0x7F;
-			run[di] <<= 7;
-		} else {
-			run[di++] += src[si];
-		}
-	}	
-	assert((((long)ptr)&15) == 0);
-	for(pi = 0; pi < pcnt && di < runs; pi++){ /** do bulk staff **/
-		uint64_t flag = ptr[pi] & FLAG_64;
-		uint64_t  val = ptr[pi] & VAL_64;
-		int  i;
-		int8_t     *cf = (int8_t*)&flag;
-		uint8_t	   *cv = (uint8_t*)&val;
-		for(i=0;i<8 && di < runs;i++){ /** no endian problem - casting of ptr matches casting of flag & val **/
-			si++;
-			run[di] += cv[i];
-			if(cf[i] < 0){
-				run[di] <<= 7;
-			} else {
-				di++;
-			}
-		}
-	}
-    }
-   
-    for(;si < ssize && di < runs;si++){/** deal with tails **/
-	if(((int8_t)src[si]) < 0) {
-		run[di] += src[si] & 0x7F;
-		run[di] <<= 7;
-	} else {
-		run[di++] += src[si];
-	}
-    }
-    *consumed = si;
-    return 0;
-}
-
-#endif
-
-static
-rc_t serialize(const PageMap *self, KDataBuffer *buffer, uint64_t *size) {
-/*
- variant 0: fixed row length, data_run[..] == 1
-    vlencode(row_length)
- version 2: same as 0 but random access
-    adds serialize(data_offset)
-
- variant 1: fixed row length, variable data_run
-    vlencode(row_length)
-    vlencode(data_recs)
-    serialize(data_run)
-
- variant 2: variable row length, data_run[..] == 1
-    vlencode(leng_recs)
-    serialize(length)
-    serialize(leng_run)
- versuion 2: same as 2 but random access
-    adds serialize(data_offset)
- 
- variant 3: variable row length, variable data_run
-    vlencode(leng_recs)
-    vlencode(data_recs)
-    serialize(length)
-    serialize(leng_run)
-    serialize(data_run)
-
-  
-
- */
-    uint8_t version = self->random_access?2:1;
-    uint8_t variant = 0;
-    uint8_t header;
-    rc_t rc = 0;
-    uint64_t sz;
-    KDataBuffer compress;
-
-
-
-    memset(&compress, 0, sizeof(compress));
-
-    variant = ( (self->data_recs == self->row_count)? 0 : 1) | ((self->leng_recs == 1 ? 0 : 1) << 1);
-    header = (version << 2) | variant;
-    switch (variant) {
-    case 0:
-        rc = KDataBufferResize(buffer, 6);
-        if (rc == 0) {
-            ((uint8_t *)buffer->base)[0] = header;
-            vlen_encodeU1(((uint8_t *)buffer->base) + 1, 5, &sz, self->length[0]);
-	    buffer->elem_count = sz + 1;
-	    if(self->random_access){
-		rc = KDataBufferMakeBytes(&compress, 5*self->row_count);
-		if(rc == 0){
-			rc = serialize_lengths(&compress, 0, self->data_offset, self->row_count, &sz);
-			compress.elem_count = sz;
-		}
-	    }
-        }
-        break;
-    case 1:
-        rc = KDataBufferResize(buffer, 11);
-        if (rc == 0) {
-            rc = KDataBufferMakeBytes(&compress, 5 * self->data_recs);
-            if (rc == 0) {
-                ((uint8_t *)buffer->base)[0] = header;
-                vlen_encodeU1(((uint8_t *)buffer->base) + 1, 5, &sz, self->length[0]);
-                buffer->elem_count = sz + 1;
-                vlen_encodeU1(((uint8_t *)buffer->base) + 1 + sz, 5, &sz, self->data_recs);
-                buffer->elem_count += sz;
-                
-                rc = serialize_lengths(&compress, 0, self->data_run, self->data_recs, &sz);
-                compress.elem_count = sz;
-            }
-        }
-        break;
-    case 2:
-        rc = KDataBufferResize(buffer, 6);
-        if (rc == 0) {
-            rc = KDataBufferMakeBytes(&compress, 10 * self->leng_recs + (self->random_access?5*self->row_count:0));
-            if (rc == 0) {
-                ((uint8_t *)buffer->base)[0] = header;
-                vlen_encodeU1(((uint8_t *)buffer->base) + 1, 5, &sz, self->leng_recs);
-                buffer->elem_count = sz + 1;
-
-                rc = serialize_lengths(&compress, 0, self->length, self->leng_recs, &sz);
-                compress.elem_count = sz;
-                if (rc == 0) {
-                    rc = serialize_lengths(&compress, compress.elem_count, self->leng_run, self->leng_recs, &sz);
-                    compress.elem_count += sz;
-		    if(self->random_access && rc == 0) {
-                        rc = serialize_lengths(&compress, compress.elem_count, self->data_offset, self->row_count, &sz);
-                        compress.elem_count += sz;
-		    }
-                }
-            }
-        }
-	break;
-    case 3:
-        rc = KDataBufferResize(buffer, 11);
-        if (rc == 0) {
-            rc = KDataBufferMakeBytes(&compress, 10 * self->leng_recs + 5 * self->data_recs);
-            if (rc == 0) {
-                ((uint8_t *)buffer->base)[0] = header;
-                vlen_encodeU1(((uint8_t *)buffer->base) + 1, 5, &sz, self->leng_recs);
-                buffer->elem_count = sz + 1;
-                vlen_encodeU1(((uint8_t *)buffer->base) + 1 + sz, 5, &sz, self->data_recs);
-                buffer->elem_count += sz;
-                
-                rc = serialize_lengths(&compress, 0, self->length, self->leng_recs, &sz);
-                compress.elem_count = sz;
-                if (rc == 0) {
-                    rc = serialize_lengths(&compress, compress.elem_count, self->leng_run, self->leng_recs, &sz);
-                    compress.elem_count += sz;
-                    if (rc == 0) {
-                        rc = serialize_lengths(&compress, compress.elem_count, self->data_run, self->data_recs, &sz);
-                        compress.elem_count += sz;
-                    }
-                }
-            }
-        }
-        break;
-    }
-    if (rc == 0 && compress.base) {
-        uint64_t hsize = buffer->elem_count;
-        
-        rc = KDataBufferResize(buffer, hsize + compress.elem_count);
-        if (rc == 0) {
-            if (version == 0)
-                memcpy(((uint8_t *)buffer->base) + hsize, compress.base, compress.elem_count);
-            else {
-                z_stream zs;
-                int zr;
-                
-                memset(&zs, 0, sizeof(zs));
-                
-                assert(compress.elem_count >> 32 == 0);
-                
-                zs.next_out = ((Bytef *)buffer->base) + hsize;
-                zs.avail_out = (uInt)compress.elem_count;
-                
-                zs.next_in = compress.base;
-                zs.avail_in = (uInt)compress.elem_count;
-                
-                zr = deflateInit2(&zs, Z_BEST_SPEED, Z_DEFLATED, -15, 9, Z_DEFAULT_STRATEGY);
-                switch (zr) {
-                case Z_OK:
-                    for (; ;) {
-                        zr = deflate(&zs, Z_FINISH);
-                        if (zr == Z_OK) {
-                            unsigned const offset = (unsigned)(zs.next_out - (Bytef *)buffer->base);
-                            rc = KDataBufferResize(buffer, buffer->elem_count * 2);
-                            if (rc)
-                                break;
-                            zs.next_out = ((Bytef *)buffer->base) + offset;
-                            zs.avail_out = (uInt)(buffer->elem_count - offset);
-                        }
-                        else if (zr == Z_STREAM_END) {
-                            KDataBufferResize(buffer, zs.total_out + hsize);
-                            break;
-                        }
-                        else {
-                            rc = RC(rcVDB, rcPagemap, rcWriting, rcParam, rcInvalid);
-                            break;
-                        }
-                    }
-                    deflateEnd(&zs);
-                    break;
-                case Z_MEM_ERROR:
-                    rc = RC(rcVDB, rcPagemap, rcWriting, rcMemory, rcExhausted);
-                    break;
-                default:
-                    rc = RC(rcVDB, rcPagemap, rcWriting, rcParam, rcInvalid);
-                }
-            }
-        }
-    }
-    KDataBufferWhack(&compress);
-    if (rc == 0)
-        *size = buffer->elem_count;
-    
-    return rc;
-}
-
-rc_t PageMapSerialize (const PageMap *self, KDataBuffer *buffer, uint64_t offset, uint64_t *size) {
-    rc_t rc;
-    KDataBuffer temp;
-
-    assert(buffer->elem_bits == 8);
-    assert(buffer->bit_offset == 0);
-    
-    rc = KDataBufferMakeBytes(&temp, 0);
-    if (rc == 0) {
-        uint64_t sz;
-        
-        rc = serialize(self, &temp, &sz);
-        if (rc == 0) {
-            rc = KDataBufferResize(buffer, offset + sz);
-            if (rc == 0)
-                memcpy(&((char *)buffer->base)[offset], temp.base, sz);
-            *size = sz;
-        }
-        KDataBufferWhack(&temp);
-    }
-    return rc;
-}
-
-static
-rc_t PageMapDeserialize_v0(PageMap **lhs, uint8_t const src[], unsigned ssize, row_count_t row_count) {
-    uint8_t variant = src[0] & 3;
-    uint8_t version =src[0] >> 2;
-    unsigned cur = 1;
-    uint64_t row_len;
-    uint64_t data_recs;
-    uint64_t leng_recs;
-    uint64_t sz;
-    bool     random_access=(version==2?true:false);
-    rc_t rc = 0;
-    
-    switch (variant) {
-    case 0:
-        /*
-         variant 0: fixed row length, data_run[..] == 1
-         vlencode(row_length)
-         */
-        rc = vlen_decodeU1(&row_len, &src[cur], ssize - cur, &sz); if (rc) return rc;
-	cur += sz;
-        
-        *lhs = new_StaticPageMap(1, random_access?row_count:1);
-        if (*lhs == NULL)
-            return RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-        
-        (**lhs).data_recs = row_count;
-        (**lhs).leng_recs = 1;
-        
-        (**lhs).length[0] = (elem_count_t)row_len;
-        (**lhs).leng_run[0] = row_count;
-
-	if(random_access){
-		(**lhs).data_offset= (**lhs).data_run;
-		rc = deserialize_lengths((**lhs).data_offset, (unsigned)row_count, &src[cur], ssize - cur, &sz);
-	}
-	(**lhs).data_run = 0;
-        break;
-    case 1:
-        /*
-         variant 1: fixed row length, variable data_run
-         vlencode(row_length)
-         vlencode(data_recs)
-         serialize(data_run)
-         */
-        rc = vlen_decodeU1(&row_len, &src[cur], ssize - cur, &sz); if (rc) return rc;
-        cur += sz;
-        
-        rc = vlen_decodeU1(&data_recs, &src[cur], ssize - cur, &sz); if (rc) return rc;
-        cur += sz;
-        
-        *lhs = new_StaticPageMap(1, data_recs);
-        if (*lhs == NULL)
-            return RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-        
-        (**lhs).data_recs = data_recs;
-        (**lhs).leng_recs = 1;
-        
-        (**lhs).length[0] = (elem_count_t)row_len;
-        (**lhs).leng_run[0] = row_count;
-        
-        rc = deserialize_lengths((**lhs).data_run, (unsigned)data_recs, &src[cur], ssize - cur, &sz);
-        break;
-    case 2:
-        /*
-         variant 2: variable row length, data_run[..] == 1
-         vlencode(leng_recs)
-         serialize(length)
-         serialize(leng_run)
-         */
-        rc = vlen_decodeU1(&leng_recs, &src[cur], ssize - cur, &sz); if (rc) return rc;
-        cur += sz;
-        
-        *lhs = new_StaticPageMap((unsigned)leng_recs, random_access?row_count:1);
-        if (*lhs == NULL)
-            return RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-        
-        (**lhs).data_recs = row_count;
-        (**lhs).leng_recs = leng_recs;
-        
-#if 0  
-        rc = deserialize_lengths((**lhs).length, (unsigned)leng_recs, &src[cur], ssize - cur, &sz);
-        if (rc == 0) {
-            cur += sz;
-            rc = deserialize_lengths((**lhs).leng_run, (unsigned)leng_recs, &src[cur], ssize - cur, &sz);
-        }
-#else /** can use the fact that both length and leng_run a sequentually allocated ***/
-	rc = deserialize_lengths((**lhs).length, (unsigned)(2*leng_recs), &src[cur], ssize - cur, &sz);
-	if(rc == 0 && random_access){
-		cur+=sz;
-		(**lhs).data_offset= (**lhs).data_run;
-		rc = deserialize_lengths((**lhs).data_offset, (unsigned)row_count, &src[cur], ssize - cur, &sz);
-	}
-	(**lhs).data_run = 0;
-		
-#endif
-        break;
-    case 3:
-        /*
-         variant 3: variable row length, variable data_run
-         vlencode(leng_recs)
-         vlencode(data_recs)
-         serialize(length)
-         serialize(leng_run)
-         serialize(data_run)
-         */
-        rc = vlen_decodeU1(&leng_recs, &src[cur], ssize - cur, &sz);  if (rc) return rc;
-        cur += sz;
-        
-        rc = vlen_decodeU1(&data_recs, &src[cur], ssize - cur, &sz);  if (rc) return rc;
-        cur += sz;
-        
-        *lhs = new_StaticPageMap(leng_recs, data_recs);
-        if (*lhs == NULL)
-            return RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-        
-        (**lhs).data_recs = data_recs;
-        (**lhs).leng_recs = leng_recs;
-#if 0   
-        rc = deserialize_lengths((**lhs).length, leng_recs, &src[cur], ssize - cur, &sz);
-        if (rc == 0) {
-            cur += sz;
-            rc = deserialize_lengths((**lhs).leng_run, leng_recs, &src[cur], ssize - cur, &sz);
-            if (rc == 0) {
-                cur += sz;
-                rc = deserialize_lengths((*lhs)->data_run, data_recs, &src[cur], ssize - cur, &sz);
-            }
-        }
-#else /** can use the fact that both length and leng_run a sequentually allocated ***/
-	rc = deserialize_lengths((**lhs).length, (unsigned)(2*leng_recs+data_recs), &src[cur], ssize - cur, &sz);
-#endif
-        break;
-     default:
-	rc = RC(rcVDB, rcPagemap, rcConstructing, rcFormat, rcUnrecognized);
-    }
-    (**lhs).random_access = random_access;
-    return rc;
-}
-
-static
-rc_t PageMapDeserialize_v1(PageMap **lhs, const uint8_t *Src, uint64_t ssize, uint32_t row_count) {
-    const uint8_t *src = Src;
-    const uint8_t * const endp = src + ssize;
-    uint8_t variant = *src & 3;
-    uint64_t bsize;
-    uint64_t hsize;
-    uint64_t val;
-    uint64_t sz;
-    rc_t rc = 0;
-    KDataBuffer decompress;
-    z_stream zs;
-    int zr;
-    bool random_access = ((src[0]>>2)==2);
-    
-    switch (variant) {
-    case 0:
-	if(!random_access)
-		return PageMapDeserialize_v0(lhs, src, ssize, row_count);
-	++src;
-	rc = vlen_decodeU1(&val, src, endp - src, &sz);
-	if( rc == 0){
-		src += sz;
-		hsize = src - Src;
-		bsize = 5 * row_count;
-	}
-	break;
-    case 1:
-        ++src;
-        rc = vlen_decodeU1(&val, src, endp - src, &sz);
-        if (rc == 0) {
-            src += sz;
-            rc = vlen_decodeU1(&val, src, endp - src, &sz);
-            if (rc == 0) {
-                src += sz;
-                hsize = src - Src;
-                bsize = 5 * val;
-            }
-        }
-        break;
-    case 2:
-        ++src;
-        rc = vlen_decodeU1(&val, src, endp - src, &sz);
-        if (rc == 0) {
-            src += sz;
-            hsize = src - Src;
-            bsize = 10 * val;
-	    if(random_access){
-		bsize +=  5 * row_count;
-	    }
-        }
-        break;
-    case 3:
-        ++src;
-        rc = vlen_decodeU1(&val, src, endp - src, &sz);
-        if (rc == 0) {
-            src += sz;
-            bsize = 10 * val;
-            rc = vlen_decodeU1(&val, src, endp - src, &sz);
-            if (rc == 0) {
-                src += sz;
-                hsize = src - Src;
-                bsize += 5 * val;
-            }
-        }
-        break;
-    default:
-        return RC(rcVDB, rcPagemap, rcConstructing, rcData, rcInvalid);
-    }
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferMakeBytes(&decompress, hsize + bsize);
-    if (rc)
-        return rc;
-
-    memcpy(decompress.base, Src, hsize);
-    memset(&zs, 0, sizeof(zs));
-    
-    zs.next_in = (Bytef *)src;
-    assert((endp - src) == (uInt)(endp - src));
-    zs.avail_in = (uInt)(endp - src);
-    
-    zs.next_out = ((Bytef *)decompress.base) + hsize;
-    assert(bsize == (uInt)(bsize));
-    zs.avail_out = (uInt)bsize;
-    
-    zr = inflateInit2(&zs, -15);
-    if (zr == Z_OK) {
-        zr = inflate(&zs, Z_FINISH);
-        if (zr != Z_STREAM_END)
-            rc = RC(rcVDB, rcPagemap, rcConstructing, rcData, rcInvalid);
-        inflateEnd(&zs);
-    }
-    else
-        rc = RC(rcVDB, rcPagemap, rcConstructing, rcMemory, rcExhausted);
-    
-    if (rc == 0)
-        rc = PageMapDeserialize_v0(lhs, decompress.base, hsize + zs.total_out, row_count);
-    KDataBufferWhack(&decompress);
-    return rc;
-}
-
-rc_t PageMapDeserialize (PageMap **lhs, const void *src, uint64_t ssize, uint64_t row_count) {
-    rc_t rc;
-
-    if ((uint32_t)row_count != row_count)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcTooBig);
-        
-    if (lhs == NULL)
-        return RC(rcVDB, rcPagemap, rcConstructing, rcParam, rcNull);
-    
-    *lhs = NULL;
-    if (src == NULL || ssize == 0)
-        return 0;
-
-    switch (*(const uint8_t *)src >> 2) {
-    case 0:
-        rc = PageMapDeserialize_v0(lhs, src, ssize, (uint32_t)row_count);
-        break;
-    case 1:
-    case 2:
-        rc = PageMapDeserialize_v1(lhs, src, ssize, (uint32_t)row_count);
-        break;
-    default:
-        return RC(rcVDB, rcPagemap, rcConstructing, rcData, rcBadVersion);
-    }
-    if (rc == 0)
-        (**lhs).row_count = (uint32_t)row_count;
-    else
-        PageMapRelease(*lhs);
-    return rc;
-}
-
-static
-rc_t PageMapDestroy(PageMap *that)
-{
-#if PAGEMAP_STATISTICS
-    pm_stats.currentWaste -= (that->reserve_data - that->data_recs) * sizeof(that->data_run[0]) +
-                             (that->reserve_leng - that->leng_recs) * (sizeof(that->leng_run[0]) + sizeof(that->length[0]));
-    pm_stats.currentFootprint -= sizeof(*that) + that->reserve_data * sizeof(that->data_run[0]) +
-                                 that->reserve_leng * (sizeof(that->leng_run[0]) + sizeof(that->length[0]));
-    --pm_stats.alive;
-    if (pm_stats.alive == 0) {
-        fprintf(stderr, 
-                "PM Stats:\n"
-                "Footprint (cur/max): %u/%u\n"
-                "Waste (cur/max): %u/%u\n"
-                "Alive (cur/max): %u/%u\n"
-                "Created (static/fixed/single/total): %u/%u/%u/%u\n"
-                "Grows: %u\n"
-                "Expands (act/calls): %u/%u\n"
-                "Appends: %u\n\n",
-                (unsigned)pm_stats.currentFootprint,
-                (unsigned)pm_stats.maxFootprint,
-                (unsigned)pm_stats.currentWaste,
-                (unsigned)pm_stats.maxWaste,
-                pm_stats.alive,
-                pm_stats.maxAlive,
-                pm_stats.createStatic,
-                pm_stats.createFixedRow,
-                pm_stats.createSingle,
-                pm_stats.create + pm_stats.createStatic + pm_stats.createFixedRow + pm_stats.createSingle,
-                pm_stats.grows,
-                pm_stats.expands,
-                pm_stats.expandCalls,
-                pm_stats.appends
-                );
-    }
-#endif
-    KDataBufferWhack(&that->istorage);
-    KDataBufferWhack(&that->dstorage);
-    KDataBufferWhack(&that->cstorage);
-    free(that);
-    return 0;
-}
-
-rc_t PageMapRelease (const PageMap *self) {
-    if (self) {
-        if (KRefcountDrop(&self->refcount, "PageMap") == krefWhack)
-          return PageMapDestroy((PageMap *)self);
-    }
-    return 0;
-}
-
-rc_t PageMapAddRef (const PageMap *self) {
-    if (self)
-        KRefcountAdd(&self->refcount, "PageMap");
-    return 0;
-}
-
-uint32_t PageMapGetIdxRowInfo (const PageMap *cself, uint32_t idx, uint32_t *starting_element)
-{
-	rc_t rc=0;
-	uint32_t	len;
-
-	if (idx  < (cself->data_run?cself->data_run[0]:1) || cself->data_recs == 1) {
-		if (starting_element) *starting_element = 0;
-		if (cself->leng_recs == 0) len=0;
-		else  len = cself->length[0];
-		return cself->length[0];
-	} else {
-		rc = PageMapFindRow(cself,idx,starting_element,&len,NULL);
-		if(rc) len=0;
-	}
-	return len;
-}
-
-int PageMapCompare(const PageMap *a, const PageMap *b) {
-    unsigned ai;
-    unsigned bi;
-    unsigned ar; /* runs in a */
-    unsigned br; /* runs in b */
-    
-    if (
-        a == b || (
-        a->leng_recs == b->leng_recs &&
-        a->data_recs == b->data_recs &&
-        memcmp(a->length, b->length, sizeof(a->length[0]) * a->leng_recs) == 0 &&
-        memcmp(a->leng_run, b->leng_run, sizeof(a->leng_run[0]) * a->leng_recs) == 0 &&
-        memcmp(a->data_run, b->data_run, sizeof(a->data_run[0]) * a->data_recs) == 0
-    ))
-        return 2;
-    
-    ai = bi = 0;
-    ar = a->leng_run[0];
-    br = b->leng_run[0];
-    
-    while (ai < a->leng_recs && bi < b->leng_recs) {
-        if (a->length[ai] != b->length[bi])
-            return 0;
-        if (ar < br) {
-            br -= ar;
-            ar = a->leng_run[++ai];
-        }
-        else if (ar == br) {
-            ar = a->leng_run[++ai];
-            br = b->leng_run[++bi];
-        }
-        else {
-            ar -= br;
-            br = b->leng_run[++bi];
-        }
-    }
-    if (ai != a->leng_recs || bi != b->leng_recs)
-        return -1;
-    else
-        return 1;
-}
-
-int PageMapCompareStatic (const PageMap *a, const PageMap *b) {
-    if (
-	  a->data_recs != 1 ||
-	  a->leng_recs != 1 ||
-	  a->leng_run[0] != a->data_run[0]
-    )
-        return -1; /* *a is not static */
-    
-    if (a == b)
-        return 2; /* static and identical */
-
-    if (
-	  b->data_recs != 1 ||
-	  b->leng_recs != 1 ||
-	  b->leng_run[0] != b->data_run[0]
-    )
-        return -1; /* *b is not static */
-    
-    if (a->length[0] == b->length[0] && a->leng_run[0] <= b->leng_run[0])
-        /* static and compatible, but we want to prevent deeper inspection
-         * so we're lying and saying that they are identical */
-        return 2;
-
-    return 0;  /* not same */
-}
-
-rc_t PageMapAppend(PageMap *self, const PageMap *other) {
-    KDataBuffer cstorage;
-    rc_t rc;
-    
-    rc = KDataBufferMake(&cstorage, sizeof(self->length[0]) * 8, (self->leng_recs + other->leng_recs) * 2 + self->data_recs + other->data_recs);
-    if (rc == 0) {
-        uint32_t *const length = cstorage.base;
-        uint32_t *const leng_run = length + self->leng_recs + other->leng_recs;
-        uint32_t *const data_run = leng_run + self->leng_recs + other->leng_recs;
-        
-#if PAGEMAP_STATISTICS
-        ++pm_stats.appends;
-        pm_stats.currentWaste -= (self->reserve_data - self->data_recs) * sizeof(self->data_run[0]) +
-                                 (self->reserve_leng - self->leng_recs) * (sizeof(self->leng_run[0]) + sizeof(self->length[0]));
-        pm_stats.currentFootprint -= self->reserve_data * sizeof(self->data_run[0]) +
-                                     self->reserve_leng * (sizeof(self->leng_run[0]) + sizeof(self->length[0]));
-#endif
-        memcpy(length                  , self->length , self->leng_recs  * sizeof(length[0]));
-        memcpy(length + self->leng_recs, other->length, other->leng_recs * sizeof(length[0]));
-
-        memcpy(leng_run                  , self->leng_run , self->leng_recs  * sizeof(leng_run[0]));
-        memcpy(leng_run + self->leng_recs, other->leng_run, other->leng_recs * sizeof(leng_run[0]));
-        
-        memcpy(data_run                  , self->data_run , self->data_recs  * sizeof(data_run[0]));
-        memcpy(data_run + self->data_recs, other->data_run, other->data_recs * sizeof(data_run[0]));
-        
-        KDataBufferWhack(&self->cstorage);
-        self->cstorage = cstorage;
-
-        self->length = length;
-        self->leng_run = leng_run;
-        self->data_run = data_run;
-        
-        self->leng_recs += other->leng_recs;
-        self->data_recs += other->data_recs;
-        self->row_count += other->row_count;
-        self->reserve_leng = self->leng_recs;
-        self->reserve_data = self->data_recs;
-        
-#if PAGEMAP_STATISTICS
-        pm_stats.currentWaste += (self->reserve_data - self->data_recs) * sizeof(self->data_run[0]) +
-                                 (self->reserve_leng - self->leng_recs) * (sizeof(self->leng_run[0]) + sizeof(self->length[0]));
-        pm_stats.currentFootprint += self->reserve_data * sizeof(self->data_run[0]) +
-                                     self->reserve_leng * (sizeof(self->leng_run[0]) + sizeof(self->length[0]));
-        if (pm_stats.maxFootprint < pm_stats.currentFootprint)
-            pm_stats.maxFootprint = pm_stats.currentFootprint;
-#endif
-        return 0;
-    }
-    return rc;
-}
diff --git a/libs/vdb/page-map.h b/libs/vdb/page-map.h
deleted file mode 100644
index 427dc45..0000000
--- a/libs/vdb/page-map.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_page_map_
-#define _h_page_map_
-
-#include <assert.h>
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <klib/data-buffer.h>
-#include <klib/refcount.h>
-
-#if _DEBUGGING
-#define _HEAVY_PAGEMAP_DEBUGGING 0
-#endif
-
-struct KDataBuffer;
-
-typedef uint32_t pm_size_t;
-typedef uint32_t row_count_t;
-typedef uint32_t elem_count_t;
-
-typedef enum {  PM_REGION_EXPAND_UNKNOWN=0,     /** notset **/
-                PM_REGION_EXPAND_FULL,          /** full expansion     - 2 arrays: offset,length**/
-                PM_REGION_EXPAND_SAMELEN,       /** partial expansion  - 1 array: offset **/
-                PM_REGION_EXPAND_EQUIDISTANT,   /** data have same length and always unique - no expansion needed **/
-                PM_REGION_EXPAND_SAMEDATA       /** same data - no expansion needed ***/
-} pm_expand_region_type_t;
-
-typedef struct PageMapRegion {
-	row_count_t	start_row;
-	row_count_t	numrows;
-	elem_count_t	data_offset;/** for unexpanded regions first direct offset into data**/
-				    /** for expanded regions - offset into expanded storage **/
-	elem_count_t	length;	    /** first length of the region ***/
-	uint8_t		type;       /** one of the types from pm_expand_region_type_t*/
-	bool		expanded;   /** if expandable storage is being used ***/
-} PageMapRegion;
-
-
-
-
-typedef struct PageMap {
-    /* memory allocation object for length[], leng_run[], data_run[] */
-    KDataBuffer cstorage;
-
-    /* array of row lengths
-     * has leng_recs elements
-     * is sized to reserve_leng elements
-     * == storage.base
-     */
-    bool   random_access;
-    enum { eBlobPageMapOptimizedNone, eBlobPageMapOptimizedSucceeded, eBlobPageMapOptimizedFailed}  optimized;
-    elem_count_t *length;
-
-    /* array of run lengths of row lengths
-     * has leng_recs elements
-     * is sized to reserve_leng elements
-     * == length + reserve_leng
-     */
-    row_count_t *leng_run;
-
-    /* array of repeat counts of data
-     * has data_recs elements
-     * is sized to reserve_data elements
-     * == leng_run + reserve_leng
-     */
-    row_count_t *data_run;
-    /** expanded offsets into data - needed for random access ***/
-    /** only valid when random_access is true **/
-    elem_count_t *data_offset;
-
-/******* DYNAMIC EXPANSION CONTROL *****************/
-    PageMapRegion		*exp_rgn_last;
-    row_count_t			exp_row_last;   /* last row analyzed for region expansion */
-    row_count_t			exp_lr_used;    /* how much leng_run was used from the */
-    pm_size_t			exp_lr_last;	/* index of last leng_run expanded */
-    pm_size_t			exp_dr_last;	/* index of last data_run expanded */
-    pm_size_t			exp_rgn_cnt;    /* current number of expanded regions */
-    elem_count_t		exp_data_offset_last;/* last offset into data */
-    
-
-    KDataBuffer			istorage;	/* binary searchable storage for expansion regions */
-    KDataBuffer			dstorage;	/* storage for expanded data */
-/** LAST SEARCH CONTROL *****/
-    pm_size_t			i_rgn_last; 	/* region index found in previous lookup **/
-    PageMapRegion*		rgn_last; 	/* redundant - region found in previous lookup **/
-
-/****************************/
-
-    pm_size_t leng_recs;     /* number of valid elements in length[] and leng_run[] */
-    pm_size_t data_recs;     /* number of valid elements in data_run[] */
-    pm_size_t reserve_leng;  /* number of allocated elements in length[] and leng_run[] */
-    pm_size_t reserve_data;  /* number of allocated elements in data_run[] */
-    pm_size_t start_valid;   /* the expanded array contains valid data upto start_valid */
-    row_count_t row_count;   /* total number of rows in page map */
-    row_count_t pre_exp_row_count; /* number of rows pre-expanded */
-    KRefcount refcount;
-} PageMap;
-
-
-/* a pessimistic estimate - actual size will *always* be less than or equal */
-size_t PageMapGetMaxBufferSize(const PageMap *self);
-
-rc_t PageMapSerialize(const PageMap *self, struct KDataBuffer *buffer, uint64_t byte_offset, uint64_t *actual_bytes);
-
-rc_t PageMapDeserialize(PageMap **lhs, const void *src, uint64_t src_bytes, uint64_t row_count);
-
-rc_t PageMapRelease(const PageMap *self);
-
-rc_t PageMapAddRef(const PageMap *self);
-
-/*  PageMapGetIdxRowInfo
- *
- *  Get row length and starting element number for a row.
- *  This is a potentially expensive operation; the first time
- *  it is called for any page map, the memory used by the page
- *  map nearly doubles and an index is built on the row length
- *  runs and the data runs.  Subsequent calls are O(N log N).
- *  However, asking for the information about the first row
- *  (i.e. idx = 0) never causes allocation or indexing and is
- *  always O(1).
- *
- *  Params:
- *      self: [IN] the page map
- *      idx:  the row number starting from 0
- *      starting_element: [OUT, OPTIONAL]
- *
- *  Returns:
- *      the length of the row
- *      or 0 if not found
- */
-uint32_t PageMapGetIdxRowInfo(const PageMap *self, uint32_t idx, uint32_t *starting_element);
-
-rc_t PageMapNew(PageMap **lhs, uint32_t reserve);
-
-rc_t PageMapNewSingle(PageMap **lhs, uint64_t row_count, uint64_t row_length);
-
-rc_t PageMapNewFixedRowLength(PageMap **lhs, uint64_t row_count, uint64_t row_len);
-
-rc_t PageMapToRandomAccess(PageMap **rslt, PageMap * src,uint32_t *data_offset);
-
-uint32_t PageMapFixedRowLength(const PageMap *self);
-
-rc_t	PageMapRowLengthRange(const PageMap *self, elem_count_t *min,elem_count_t *max);
-
-uint32_t PageMapHasSimpleStructure(const PageMap *self);
-
-rc_t PageMapAppendRows(PageMap *self, uint64_t row_length, uint64_t run_length, bool same_data);
-
-#define PageMapAppendRow(SELF, ROW_LENGTH, SAME_DATA) (PageMapAppendRows((SELF), (ROW_LENGTH), 1, SAME_DATA))
-
-/* append some rows of the same data */
-#define PageMapAppendSomeRows(SELF, ROW_LENGTH, RUN_LENGTH) (PageMapAppendRows((SELF), (ROW_LENGTH), (RUN_LENGTH), false))
-
-/* concatenate two page maps */
-rc_t PageMapAppend(PageMap *self, const PageMap *other);
-
-/** Find data using pagemap ***/
-rc_t PageMapFindRow(const PageMap *cself,uint64_t row,uint32_t * data_offset,uint32_t * data_length,uint32_t * repeat_count);
-
-
-/*
- -1: error
- 0: not same
- 1: compatible (i.e. all rows same length)
- else: identical
- */
-int PageMapCompare(const PageMap *a, const PageMap *b);
-/* same but static columns */
-int PageMapCompareStatic(const PageMap *a, const PageMap *b);
-
-typedef struct PageMapIterator PageMapIterator;
-struct PageMapIterator {
-    row_count_t		last_row;
-    row_count_t		cur_row;
-    PageMapRegion**	rgns;	  /** all regions from the pagemap **/
-    pm_size_t		cur_rgn;  /** offset of the current region **/
-    row_count_t 	cur_rgn_row; /** row relative to offset of the region **/
-    elem_count_t	**exp_base; /*** exp buffer ***/
-    row_count_t		repeat_count; /** remaining repeat count **/
-    elem_count_t	static_datalen;
-#if _HEAVY_PAGEMAP_DEBUGGING
-    PageMap *parent;
-#endif
-};
-
-rc_t PageMapNewIterator(const PageMap *self, PageMapIterator *lhs, uint64_t first_row, uint64_t num_rows);
-
-static __inline__ bool PageMapIteratorAdvance(PageMapIterator *self, row_count_t rows)
-{
-    if (self->cur_row + rows < self->last_row) {
-	self->cur_row += rows;
-	self->cur_rgn_row += rows;
-	if(self->repeat_count > rows) self->repeat_count-= rows;
-	else self->repeat_count = 0;
-	if(self->rgns){/** non-static, non simple random access**/
-		while((*self->rgns)[self->cur_rgn].numrows <= self->cur_rgn_row){
-			self->cur_rgn_row -= (*self->rgns)[self->cur_rgn].numrows;
-			self->cur_rgn++;
-		}
-        }
-        return true;
-    }
-    return false;
-}
-
-#define PageMapIteratorNext(SELF) PageMapIteratorAdvance(SELF, 1)
-
-static __inline__ elem_count_t PageMapIteratorDataLength(const PageMapIterator *self)
-{
-    elem_count_t datalen=0;
-    if(self->rgns == NULL) {/* static or simple random-access*/
-	return  self->static_datalen;
-    }
-    switch ((*self->rgns)[self->cur_rgn].type){
-	case PM_REGION_EXPAND_FULL:
-		if((*self->rgns)[self->cur_rgn].expanded){
-			datalen = (*self->exp_base)[(*self->rgns)[self->cur_rgn].data_offset + 2*self->cur_rgn_row];
-		} else {
-			datalen = (*self->rgns)[self->cur_rgn].length;
-		}
-                break;
-	case PM_REGION_EXPAND_SAMELEN:
-	case PM_REGION_EXPAND_EQUIDISTANT:
-	case PM_REGION_EXPAND_SAMEDATA:
-		datalen = (*self->rgns)[self->cur_rgn].length;
-		break;
-	default:
-		assert(0);
-		break;
-   }
-#if _HEAVY_PAGEMAP_DEBUGGING
-   {
-	elem_count_t dtl,dto,dtr;
-	PageMapFindRow(self->parent,self->cur_row,&dto,&dtl,&dtr);
-	assert(dtl==datalen);
-   }
-#endif
-   /*printf("DATA_LEN=%d\n",datalen);*/
-   return datalen;
-}
-
-static __inline__ elem_count_t PageMapIteratorDataOffset(const PageMapIterator *self)
-{
-    elem_count_t dataoff=0;
-    if(self->rgns == NULL){ /** static or simple random **/
-	if(self->exp_base != NULL)  /** simple random access */
-		dataoff= (*self->exp_base)[self->cur_row];
-	return dataoff;
-    }
-    switch ((*self->rgns)[self->cur_rgn].type){
-        case PM_REGION_EXPAND_FULL:
-                if((*self->rgns)[self->cur_rgn].expanded){
-                        dataoff = (*self->exp_base)[(*self->rgns)[self->cur_rgn].data_offset + 2*self->cur_rgn_row + 1];
-                } else {
-                        dataoff = (*self->rgns)[self->cur_rgn].data_offset;
-                }
-                break;
-        case PM_REGION_EXPAND_SAMELEN:
-		if((*self->rgns)[self->cur_rgn].expanded){
-                        dataoff = (*self->exp_base)[(*self->rgns)[self->cur_rgn].data_offset + self->cur_rgn_row];
-                } else {
-                        dataoff = (*self->rgns)[self->cur_rgn].data_offset;
-                }
-                break;
-        case PM_REGION_EXPAND_EQUIDISTANT:
-		dataoff = (*self->rgns)[self->cur_rgn].data_offset + (*self->rgns)[self->cur_rgn].length * self->cur_rgn_row;
-		break;
-        case PM_REGION_EXPAND_SAMEDATA:
-                dataoff = (*self->rgns)[self->cur_rgn].data_offset;
-                break;
-        default:
-                assert(0);
-                break;
-    }
-#if _HEAVY_PAGEMAP_DEBUGGING
-   {
-        elem_count_t dtl,dto,dtr;
-        PageMapFindRow(self->parent,self->cur_row,&dto,&dtl,&dtr);
-        assert(dto==dataoff);
-   }
-#endif
-    return dataoff;
-}
-
-static __inline__ row_count_t PageMapIteratorRepeatCount(const PageMapIterator *cself)
-{
-    if(cself->repeat_count==0){
-	PageMapIterator *self = (PageMapIterator*) cself;
-	if(self->rgns==NULL){ /** must be simple random access **/
-		uint64_t i;
-		assert(*self->exp_base);
-		for(i=self->cur_row+1,self->repeat_count=1;
-                    i< self->last_row && (*self->exp_base)[i]==(*self->exp_base)[self->cur_row];
-                    i++,self->repeat_count++){}
-	} else {
-		switch ((*self->rgns)[self->cur_rgn].type){
-		 case PM_REGION_EXPAND_FULL:
-			if((*self->rgns)[self->cur_rgn].expanded){
-				int i;
-				elem_count_t* base = (*self->exp_base) + (*self->rgns)[self->cur_rgn].data_offset;
-				self->repeat_count = 1;
-				for(i=self->cur_rgn_row+1;i<(*self->rgns)[self->cur_rgn].numrows;i++){
-					if(base[2*self->cur_rgn_row]== base[2*i] && base[2*self->cur_rgn_row+1]== base[2*i+1]) self->repeat_count++;
-					else break;
-				}
-			} else {
-				self->repeat_count =  (*self->rgns)[self->cur_rgn].numrows - self->cur_rgn_row;
-			}
-			break;
-		 case PM_REGION_EXPAND_SAMELEN:
-			if((*self->rgns)[self->cur_rgn].expanded){
-				int i;
-				elem_count_t* base = (*self->exp_base) + (*self->rgns)[self->cur_rgn].data_offset;
-				self->repeat_count = 1;
-				for(i=self->cur_rgn_row+1;i<(*self->rgns)[self->cur_rgn].numrows;i++){
-					if(base[self->cur_rgn_row] == base[i]) self->repeat_count++;
-					else break;
-				}
-			} else {
-				self->repeat_count = (*self->rgns)[self->cur_rgn].numrows - self->cur_rgn_row;
-			}
-			break;
-		 case PM_REGION_EXPAND_EQUIDISTANT:
-			self->repeat_count = 1;
-			break;
-		 case PM_REGION_EXPAND_SAMEDATA:
-			self->repeat_count =  (*self->rgns)[self->cur_rgn].numrows - self->cur_rgn_row;
-			break;
-		 default:
-			assert(0);
-			break;
-		}
-	}
-    }
-#if _HEAVY_PAGEMAP_DEBUGGING
-   {
-        elem_count_t dtl,dto,dtr;
-        PageMapFindRow(cself->parent,cself->cur_row,&dto,&dtl,&dtr);
-        assert(dtr==cself->repeat_count);
-   }
-#endif
-    return cself->repeat_count;
-}
-
-elem_count_t PageMapLastLength(const PageMap *cself);
-bool PageMapHasRows(const PageMap *self);
-rc_t PageMapExpand(const PageMap *cself, row_count_t upto);
-rc_t PageMapExpandFull(const PageMap *cself);
-rc_t PageMapPreExpandFull(const PageMap *cself, row_count_t upto);
-
-#endif /* _h_page_map_ */
diff --git a/libs/vdb/parameter-read.c b/libs/vdb/parameter-read.c
deleted file mode 100644
index af9621c..0000000
--- a/libs/vdb/parameter-read.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include "xform-priv.h"
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/table.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <vdb/vdb-priv.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-rc_t CC parameter_read_func(
-                         void *Self,
-                         const VXformInfo *info,
-                         int64_t row_id,
-                         VRowResult *rslt,
-                         uint32_t argc,
-                         const VRowData argv[]
-) {
-    const KDataBuffer *value = Self;
-    rc_t rc = 0;
-    
-    rslt->data->elem_bits = value->elem_bits;
-    rslt->data->elem_count = 0;
-    rc = KDataBufferResize(rslt->data, value->elem_count);
-    if (rc == 0) {
-        memcpy(rslt->data->base, value->base, KDataBufferBytes(value));
-        rc = KDataBufferCast(rslt->data, rslt->data, rslt->elem_bits, true);
-        if (rc == 0)
-            rslt->elem_count = rslt->data->elem_count;
-    }
-	return rc;
-}
-
-static rc_t get_databuffer( KDataBuffer **rslt, struct VCursorParams const *params, const char *Name, size_t len ) {
-    char name[4096];
-    
-    if (len >= sizeof(name))
-        return RC(rcVDB, rcFunction, rcConstructing, rcName, rcTooLong);
-    
-    memcpy(name, Name, len);
-    name[len] = '\0';
-    
-    return VCursorParamsGet(params, name, rslt);
-}
-
-/* 
- function utf8 parameter:read #1.0 < ascii name, * bool deterministic > ();
- */
-VTRANSFACT_BUILTIN_IMPL(parameter_read, 1, 0, 0)
-    (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp
-) {
-    rc_t rc;
-    KDataBuffer *value;
-    bool deterministic = true;
-    
-    if (cp->argc > 1)
-        deterministic = cp->argv[1].data.b[0];
-
-    rc = get_databuffer(&value, info->parms, cp->argv[0].data.ascii, cp->argv[0].count);
-    if (rc == 0) {
-        rslt->self = value;
-        
-        rslt->variant = deterministic ? vftRow : vftNonDetRow;
-        rslt->u.ndf = parameter_read_func;
-    }
-
-	return rc;
-}
diff --git a/libs/vdb/phys-cmn.c b/libs/vdb/phys-cmn.c
deleted file mode 100644
index 1c39325..0000000
--- a/libs/vdb/phys-cmn.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "phys-priv.h"
-#include "schema-parse.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "prod-priv.h"
-#include "blob-priv.h"
-#undef KONST
-
-#include <vdb/cursor.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <endian.h>
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- */
-
-
-/* Addr
- *  reach into node and get address
- *  returns raw pointer and node size
- */
-rc_t CC KMDataNodeAddr ( const KMDataNode *self,
-    const void **addr, size_t *size );
-
-
-/*--------------------------------------------------------------------------
- * VPhysical
- */
-
-/* Destroy
- */
-void VPhysicalDestroy ( VPhysical *self )
-{
-
-#if PROD_REFCOUNT && ! PROD_ALL_IN_CURSOR
-    PROD_TRACK_REFCOUNT(VProductionRelease, self->out);
-    VProductionRelease ( self -> out, NULL );
-    PROD_TRACK_REFCOUNT(VProductionRelease, self->b2p);
-    VProductionRelease ( self -> b2p, NULL );
-    PROD_TRACK_REFCOUNT(VProductionRelease, self->b2s);
-    VProductionRelease ( self -> b2s, NULL ); 
-    PROD_TRACK_REFCOUNT(VProductionRelease, self->in);
-    VProductionRelease ( self -> in, NULL );
-#endif
-
-    KDataBufferWhack ( & self -> srow );
-
-    SExpressionWhack ( self -> enc );
-
-    KMDataNodeRelease ( self -> knode );
-
-    KMetadataRelease ( self -> meta );
-    KColumnRelease ( self -> kcol );
-    
-    free ( self );
-}
-
-/* Make
- */
-rc_t VPhysicalMake ( VPhysical **physp, const VCursor *curs, const SPhysMember *smbr )
-{
-    VPhysical *phys = calloc ( 1, sizeof * phys );
-
-    if ( phys == NULL )
-        return RC ( rcVDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-
-    phys -> curs = curs;
-    phys -> smbr = smbr;
-
-    * physp = phys;
-    return 0;
-}
-
-/* FinishKColumn
- */
-
-#if 0
-#include <stdio.h>
-static
-rc_t pstdout ( void *ignore, const void *buffer, size_t bsize )
-{
-    fwrite ( buffer, 1, bsize, stdout );
-    return 0;
-}
-#endif
-
-rc_t VPhysicalFinishKColumn ( VPhysical *self, VSchema *schema, const SPhysMember *smbr )
-{
-    /* determine its range of row ids */
-    uint64_t count;
-    rc_t rc = KColumnIdRange ( self -> kcol, & self -> kstart_id, & count );
-    self -> kstop_id = self -> kstart_id + count - 1;
-    if ( rc == 0 )
-    {
-        if ( self -> meta == NULL )
-        {
-            /* bring over "no_hdr" from SPhysical */
-            self -> no_hdr = ( ( const SPhysEncExpr* ) smbr -> type ) -> phys -> no_hdr;
-        }
-        else
-        {
-            /* read in metadata */
-            VTypedecl td;
-            rc = VPhysicalLoadMetadata ( self, & td, schema );
-            /*VSchemaDump ( schema, sdmPrint, NULL, pstdout, NULL );*/
-            if ( rc == 0 )
-            {
-                /* if member type is unknown, reset to actual type */
-                if ( smbr -> td . type_id == 0 )
-                {
-                    /* this member was introduced into cursor schema
-                       by the function VCursorSupplementPhysical with
-                       an unknown type - i.e. the schema compiler will
-                       not recognize "any" as a member type. essentially
-                       the member type setting was delayed until now */
-                    ( ( SPhysMember* ) smbr ) -> td = td;
-                }
-
-                /* validate that the physical column matches
-                   the schema member declaration type */
-                else if ( ! VTypedeclCommonAncestor ( & td, schema, & smbr -> td, NULL, NULL ) )
-                {
-                    rc = RC ( rcVDB, rcColumn, rcLoading, rcType, rcInconsistent );
-                    PLOGERR ( klogInt, ( klogInt, rc, "inconsistent schema and actual types for column '$(name)'"
-                               , "name=%.*s"
-                               , ( int ) smbr -> name -> name . size
-                               , smbr -> name -> name . addr ));
-                }
-            }
-        }
-    }
-
-    return rc;
- }
-
-/* FinishStatic
- */
-rc_t VPhysicalFinishStatic ( VPhysical *self, const VSchema *schema, const SPhysMember *smbr )
-{
-    /* see if data node actually exists */
-    const KMDataNode *node;
-    rc_t rc = KMDataNodeOpenNodeRead ( self -> knode, & node, "row" );
-    if ( rc  != 0 )
-        return rc;
-    KMDataNodeRelease ( node );
-
-    /* determine id range */
-    rc = KMDataNodeOpenNodeRead ( self -> knode, & node, "start_id" );
-    if ( rc == 0 )
-    {
-        /* modern static column */
-        rc = KMDataNodeReadAsI64 ( node, & self -> sstart_id );
-        KMDataNodeRelease ( node );
-        if ( rc == 0 )
-        {
-            rc = KMDataNodeOpenNodeRead ( self -> knode, & node, "row_count" );
-            if ( rc == 0 )
-            {
-                uint64_t row_count;
-                
-                rc = KMDataNodeReadAsU64 ( node, & row_count );
-                KMDataNodeRelease ( node );
-                assert(row_count != 0);
-                self -> sstop_id = self -> sstart_id + row_count - 1;
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        /* get the table metadata */
-        const KMetadata *tmeta = self -> curs -> tbl -> meta;
-
-        /* original static column with no range */
-        self -> sstart_id = 1;
-
-        /* work a little harder to correct this problem */
-        rc = KMetadataGetSequence ( tmeta, "spot", & self -> sstop_id );
-        if ( rc != 0 )
-            rc = KMetadataGetSequence ( tmeta, ".", & self -> sstop_id );
-        if ( rc != 0 )
-        {
-#if 0
-            /* set to infinite range */
-            self -> sstart_id <<= 63;
-            self -> sstop_id = ~ self -> sstart_id;
-#else
-            /* set to single row */
-            self -> sstart_id = 1;
-            self -> sstop_id = 1;
-#endif
-            rc = 0;
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        size_t size;
-        char type_expr [ 256 ];
-
-        /* read column type */
-        rc = KMDataNodeReadAttr ( self -> knode, "type",
-            type_expr, sizeof type_expr, & size );
-        if ( rc == 0 )
-        {
-            VTypedecl td;
-
-            /* resolve type */
-            rc = VSchemaResolveTypedecl ( schema, & td, type_expr );
-            if ( rc == 0 )
-            {
-                /* if member type is unknown, reset to actual type */
-                if ( smbr -> td . type_id == 0 )
-                {
-                    /* this member was introduced into cursor schema
-                       by the function VCursorSupplementPhysical with
-                       an unknown type - i.e. the schema compiler will
-                       not recognize "any" as a member type. essentially
-                       the member type setting was delayed until now */
-                    ( ( SPhysMember* ) smbr ) -> td = td;
-                }
-
-                /* validate that the physical column matches
-                   the schema member declaration type */
-                else if ( ! VTypedeclCommonAncestor ( & td, schema, & smbr -> td, NULL, NULL ) )
-                {
-                    rc = RC ( rcVDB, rcColumn, rcLoading, rcType, rcInconsistent );
-                    PLOGERR ( klogInt, ( klogInt, rc, "inconsistent schema and actual types for static column '$(name)'"
-                               , "name=%.*s"
-                               , ( int ) smbr -> name -> name . size
-                               , smbr -> name -> name . addr ));
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* Open
- *  open existing columns
- *  load schema definitions
- */
-rc_t VPhysicalOpenRead ( VPhysical *self, VSchema *schema, const VTable *tbl )
-{
-    rc_t rc;
-
-    /* physical member name from schema */
-    const SPhysMember *smbr = self -> smbr;
-    const KSymbol *name = smbr -> name;
-
-    /* mark physical as read-only */
-    self -> read_only = true;
-
-    /* open column for update */
-    rc = KTableOpenColumnRead ( tbl -> ktbl, & self -> kcol,
-        "%.*s", ( int ) name -> name . size - 1, name -> name . addr + 1 );
-    if ( rc == 0 )
-    { 
-        /* open its metadata */
-        rc = KColumnOpenMetadataRead ( self -> kcol, & self -> meta );
-        if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-        {
-            /* finish off common initialization */
-            rc = VPhysicalFinishKColumn ( self, schema, smbr );
-        }
-    }
-
-    /* it's okay if a column doesn't exist - it may exist as a static */
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = 0;
-    }
-
-    if ( rc == 0 && self -> kcol == NULL )
-    {
-        /* must have static col parent node */
-        if ( tbl -> col_node == NULL )
-            rc = RC ( rcVDB, rcTable, rcOpening, rcColumn, rcNotFound );
-        else
-        {
-            /* look for static */
-            const KMDataNode *node;
-            rc = KMDataNodeOpenNodeRead ( tbl -> col_node, & node,
-                "%.*s", ( int ) name -> name . size - 1, name -> name . addr + 1 );
-            if ( rc == 0 )
-            {
-                self -> knode = node;
-
-                /* finish off common initialization */
-                rc = VPhysicalFinishStatic ( self, schema, smbr );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/* ReadKColumn
- *  read a raw blob from kcolumn
- */
-static
-rc_t VPhysicalReadKColumn ( VPhysical *self, VBlob **vblob, int64_t id, uint32_t elem_bits )
-{
-    rc_t rc;
-    VBlob *blob;
-    const KColumnBlob *kblob;
-
-    /* check id against column contents */
-    if ( self -> kcol == NULL ||
-         id < self -> kstart_id || id > self -> kstop_id )
-    {
-        * vblob = NULL;
-        return RC ( rcVDB, rcColumn, rcReading, rcRow, rcNotFound );
-    }
-
-#if PROD_CACHE
-    /* check for recently written cache contents */
-    if ( self -> b2s != NULL && self -> b2s -> cache [ 0 ] != NULL )
-    {
-        VProduction *b2s = self -> b2s;
-
-        int i;
-        for ( i = 0; i < PROD_CACHE; ++ i )
-        {
-            blob = b2s -> cache [ i ];
-            if ( id >= blob -> start_id && id <= blob -> stop_id )
-            {
-                * vblob = blob;
-                rc = VBlobAddRef ( blob );
-                if ( rc != 0 )
-                    return rc;
-
-                TRACK_BLOB ( VBlobAddRef, blob );
-#if PROD_CACHE > 1
-                /* MRU cache */
-                if ( i > 0 )
-                {
-                    do
-                        b2s -> cache [ i ] = b2s -> cache [ i - 1 ];
-                    while ( -- i > 0 );
-                    b2s -> cache [ 0 ] = blob;
-                }
-#endif
-                return 0;
-            }
-        }
-    }
-#endif
-
-    /* find blob in KColumn
-       TBD - handle potential merge/update later */
-    rc = KColumnOpenBlobRead ( self -> kcol, & kblob, id );
-    if ( rc == 0 )
-    {
-        /* get blob size */
-        size_t num_read, remaining;
-        rc = KColumnBlobRead ( kblob, 0, NULL, 0, & num_read, & remaining );
-        if ( rc == 0 )
-        {
-            /* get blob id range */
-            uint32_t count;
-            int64_t start_id;
-            rc = KColumnBlobIdRange ( kblob, & start_id, & count );
-            if ( rc == 0 )
-            {
-                KDataBuffer buffer;
-
-                /* fabricate "stop_id" */
-                int64_t stop_id = start_id + count - 1;
-
-                /* if the encoding was marked __no_header */
-                if ( self -> no_hdr )
-                    num_read = 2;
-
-                /* create data buffer */
-                rc = KDataBufferMakeBytes ( & buffer, num_read + remaining );
-                if ( rc == 0 )
-                {
-                    /* read entire blob */
-                    uint8_t *p = buffer . base;
-                    rc = KColumnBlobRead ( kblob, 0,
-                        & p [ num_read ], remaining, & num_read, & remaining );
-                    if ( rc == 0 )
-                    {
-                        if ( self -> no_hdr )
-                        {
-                            /* create fake v1 header byte with fixed row-length:
-                               000ooobb where "o" is offset ( 0 ), and
-                               "b" is byte order ( always little-endian ) */
-                            p [ 0 ] = ( uint8_t ) vboLittleEndian;
-                            p [ 1 ] = 0;
-                        }
-
-                        /* create a proper blob */
-                        rc = VBlobNew ( vblob, start_id, stop_id, "readkcolumn" );
-                        TRACK_BLOB (VBlobNew, *vblob);
-                        if ( rc == 0 )
-                        {
-                            rc = KDataBufferSub ( & buffer, & ( * vblob ) -> data, 0, UINT64_MAX );
-                            assert ( rc == 0 );
-                        }
-                    }
-
-                    KDataBufferWhack ( & buffer );
-                }
-            }
-        }
-
-        KColumnBlobRelease ( kblob );
-    }
-
-    return rc;
-}
-
-/* Read
- *  read a blob from static data or decoding chain
- */
-static
-rc_t VPhysicalReadStatic ( VPhysical *self, VBlob **vblob, int64_t id, uint32_t elem_bits )
-{
-    bool reversed;
-    rc_t rc = KMDataNodeByteOrder ( self -> knode, & reversed );
-    if ( rc == 0 )
-    {
-        const KMDataNode *row;
-
-        /* detect non-native byte-order */
-        VByteOrder byte_order = vboNative;
-        if ( reversed )
-        {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-            byte_order = vboBigEndian;
-#else
-            byte_order = vboLittleEndian;
-#endif
-        }
-
-        /* open sub-node for row */
-        rc = KMDataNodeOpenNodeRead ( self -> knode, & row, "row" );
-        if ( rc == 0 )
-        {
-            /* get raw pointer and size in bytes */
-            size_t bytes;
-            const void *base;
-            rc = KMDataNodeAddr ( row, & base, & bytes );
-            if ( rc == 0 )
-            {
-                uint64_t row_bits;
-
-                /* if there's a "size" node, read size in bits */
-                const KMDataNode *size;
-                rc = KMDataNodeOpenNodeRead ( self -> knode, & size, "size" );
-                if ( rc == 0 )
-                {
-                    rc = KMDataNodeReadAsU64 ( size, & row_bits );
-                    KMDataNodeRelease ( size );
-                }
-                else if ( GetRCState ( rc ) == rcNotFound )
-                {
-                    row_bits = bytes << 3;
-                    rc = 0;
-                }
-
-                /* check that the row length is an integral number of elements */
-                assert ( elem_bits != 0 );
-                if ( rc == 0 && row_bits % elem_bits != 0 )
-                    rc = RC ( rcVDB, rcColumn, rcReading, rcRow, rcCorrupt );
-
-                /* go forth */
-                if ( rc == 0 )
-                {
-                    KDataBuffer buffer;
-                    rc = KDataBufferMake ( & buffer, elem_bits, ( uint32_t ) ( row_bits / elem_bits ) );
-                    if ( rc == 0 )
-                    {
-                        int64_t sstart_id = self -> sstart_id;
-                        int64_t sstop_id = self -> sstop_id;
-
-                        /* copy out single row */
-                        memcpy ( buffer . base, base, bytes );
-                        self->fixed_len = buffer.elem_count;
-
-                        /* limit row range */
-                        if ( ( ( sstop_id - sstart_id ) >> 32 ) != 0 )
-                        {
-                            sstart_id  =   ((id-1) &  ~0x7fffffffUL ) + 1;  /** Truncate to the nearest 2 billion **/
-                            if ( ( ( sstop_id - sstart_id ) >> 32 ) != 0 ) /** still not enough ***/
-                                sstop_id = sstart_id + 0x80000000UL ; /** leave only 2 billion */
-                        }
-
-                        rc = VBlobCreateFromSingleRow ( vblob,
-                            sstart_id, sstop_id, & buffer, byte_order );
-                        KDataBufferWhack( &buffer );
-                    }
-                }
-            }
-
-            KMDataNodeRelease ( row );
-        }
-    }
-
-    return rc;
-}
-
-rc_t VPhysicalReadBlob ( VPhysical *self, VBlob **vblob, int64_t id, uint32_t elem_bits )
-{
-    rc_t rc;
-
-    /* check for hit on static guy */
-    if ( self -> knode != NULL &&
-         id >= self -> sstart_id && id <= self -> sstop_id )
-    {
-        return VPhysicalReadStatic ( self, vblob, id, elem_bits );
-    }
-
-    /* need to read from kcolumn path */
-    rc = VProductionReadBlob ( self -> b2p, vblob, id , 1, NULL);
-	if ( rc == 0 )
-    {
-	    if((*vblob)->pm==NULL)
-        {
-            rc = PageMapProcessGetPagemap(&self->curs->pmpr,&(*vblob)->pm);
-	    }
-    }
-
-	return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * VPhysicalProd
- */
-
-rc_t VPhysicalProdMake ( VProduction **prodp, Vector *owned,
-    struct VCursor *curs, VPhysical *phys, int sub, const char *name,
-    const VFormatdecl *fd, const VTypedesc *desc )
-{
-#define PHYSPROD_INDEX_OFFSET 1000000000
-    VPhysicalProd *prod;
-    rc_t rc = VProductionMake ( prodp, owned, sizeof * prod,
-        prodPhysical, sub, name, fd, desc, NULL, chainDecoding );
-    if ( rc == 0 )
-    {
-        prod = ( VPhysicalProd* ) * prodp;
-
-        /* this class only knows how to redirect messages to VPhysical */
-        prod -> phys = phys;
-	if(sub == prodPhysicalOut){
-		(*prodp) -> cctx.cache   = curs->blob_mru_cache;
-		(*prodp) -> cctx.col_idx = PHYSPROD_INDEX_OFFSET + (++curs -> phys_cnt);
-	}
-    }
-    return rc;
-}
-
-
-void VPhysicalProdDestroy ( VPhysicalProd *self )
-{
-}
-
-
-/* Read
- */
-rc_t VPhysicalProdRead ( VPhysicalProd *self, VBlob **vblob, int64_t id, uint32_t cnt )
-{
-    uint32_t elem_bits;
-
-    if ( self == NULL )
-        return RC ( rcVDB, rcProduction, rcReading, rcSelf, rcNull );
-    if ( self -> phys == NULL )
-        return RC ( rcVDB, rcColumn, rcReading, rcSelf, rcNull );
-
-    elem_bits = VTypedescSizeof ( & self -> dad . desc );
-
-    switch ( self -> dad . sub )
-    {
-    case prodPhysicalOut:
-        return VPhysicalRead ( self -> phys, vblob, id, cnt, elem_bits );
-    case prodPhysicalKCol:
-        return VPhysicalReadKColumn ( self -> phys, vblob, id, elem_bits );
-    }
-
-    return RC ( rcVDB, rcProduction, rcReading, rcType, rcInvalid );
-}
-
-uint32_t VPhysicalProdFixedRowLength ( const VPhysicalProd *Self, int64_t row_id ) {
-    const VPhysical *self;
-    
-    if ( Self == NULL )
-        return 0;
-    self = Self->phys;
-    if ( self == NULL )
-        return 0;
-    return self->fixed_len;
-}
-
-rc_t VPhysicalProdColumnIdRange ( const VPhysicalProd *Self,
-                               int64_t *first, int64_t *last )
-{
-    const VPhysical *self;
-    
-    if ( Self == NULL )
-        return RC ( rcVDB, rcProduction, rcReading, rcSelf, rcNull );
-    self = Self->phys;
-    if ( self == NULL )
-        return RC ( rcVDB, rcColumn, rcReading, rcSelf, rcNull );
-    
-    if (self->knode) {
-        *first = self->sstart_id;
-        *last  = self->sstop_id;
-        return 0;
-    }
-    if (self->kcol) {
-        *first = self->kstart_id;
-        *last  = self->kstop_id;
-        return 0;
-    }
-    return RC ( rcVDB, rcColumn, rcReading, rcRange, rcEmpty );
-}
-
-
-/* IsStatic
- *  is this a static column
- */
-rc_t VPhysicalIsStatic ( const VPhysical *self, bool *is_static )
-{
-    assert ( is_static != NULL );
-
-    if ( self == NULL )
-    {
-        * is_static = false;
-        return RC ( rcVDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    }
-
-    * is_static = self -> knode != NULL;
-    return 0;
-}
diff --git a/libs/vdb/phys-load.c b/libs/vdb/phys-load.c
deleted file mode 100644
index d4197fa..0000000
--- a/libs/vdb/phys-load.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-
-#define KONST const
-#include "phys-priv.h"
-#include "schema-parse.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "cursor-priv.h"
-#include "prod-priv.h"
-#undef KONST
-
-#include <vdb/cursor.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <klib/symbol.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-#define ALLOW_V1_UPDATE 0
-
-/*--------------------------------------------------------------------------
- * VPhysical
- */
-
-/* LoadSchema
- *  looks in metadata for stored schema
- */
-static
-rc_t CC VPhysicalLoadV1Schema ( VPhysical *self,
-    VTypedecl *td, VSchema *schema, const KMDataNode *node )
-{
-    rc_t rc;
-
-    KMDataNodeSchemaFillData pb;
-    pb . node = node;
-    pb . pos = 0;
-    pb . add_v0 = true;
-
-    /* add stored declaration to cursor schema */
-    rc = VSchemaParseTextCallback ( schema,
-        "VPhysicalLoadV1Schema", KMDataNodeFillSchema, & pb );
-   if ( rc == 0 )
-    {
-        size_t size;
-        char type_expr [ 256 ];
-
-        /* retrieve and resolve "type" attribute */
-        rc = KMDataNodeReadAttr ( node, "type",
-            type_expr, sizeof type_expr, & size );
-        if ( rc == 0 )
-            rc = VSchemaResolveTypedecl ( schema, td, type_expr );
-
-        /* if a decoding schema exists */
-        if ( rc == 0 && pb . pos != 0 )
-        {
-            char sphysical_name [ 512 ];
-
-            /* preserve schema function expression */
-            size_t decoding_xsize;
-            char decoding_expr [ 256 ];
-            rc = KMDataNodeReadAttr ( node, "schema",
-                decoding_expr, sizeof decoding_expr, & decoding_xsize );
-            if ( rc == 0 )
-            {
-                /* look for "encoding" */
-                const KMDataNode *enc;
-                rc = KMetadataOpenNodeRead ( self -> meta, & enc, "encoding" );
-                if ( rc == 0 )
-                {
-#if ALLOW_V1_UPDATE
-                    if ( ! self -> read_only )
-                    {
-                        /* add stored declaration to cursor schema */
-                        pb . node = enc;
-                        pb . pos = 0;
-                        pb . add_v0 = true;
-                        rc = VSchemaParseTextCallback ( schema,
-                            "VPhysicalLoadV1Schema", KMDataNodeFillSchema, & pb );
-                    }
-                    if ( rc == 0 )
-#endif
-                    {
-                        /* preserve schema function expression */
-                        size_t encoding_xsize;
-                        char encoding_expr [ 256 ], enc_type [ 256 ];
-                        rc = KMDataNodeReadAttr ( enc, "schema",
-                            encoding_expr, sizeof encoding_expr, & encoding_xsize );
-                        if ( rc == 0 )
-                        {
-                            rc = KMDataNodeReadAttr ( enc, "type",
-                                enc_type, sizeof enc_type, & size );
-                        }
-                        if ( rc == 0 )
-                        {
-#if ALLOW_V1_UPDATE
-                            if ( self -> read_only )
-                            {
-#endif
-                                /* build sphysical name */
-                                sprintf ( sphysical_name, "%s_only", decoding_expr );
-
-                                /* build physical decl */
-                                pb . pos = sprintf ( pb . buff, "version 1;"
-                                                     "physical %s %s:phys#1"
-                                                     "{decode{%s k=@;return %s(k);}}"
-                                                     , type_expr
-                                                     , sphysical_name
-                                                     , enc_type
-                                                     , decoding_expr
-                                    );
-#if ALLOW_V1_UPDATE
-                            }
-                            else
-                            {
-                                /* strip off common namespace */
-                                size_t i, ns_size;
-                                string_match ( decoding_expr, decoding_xsize,
-                                    encoding_expr, encoding_xsize, -1, & ns_size );
-                                if ( ns_size != 0 )
-                                {
-                                    char *p = string_rchr ( decoding_expr, ns_size, ':' );
-                                    ns_size = ( p == NULL ) ? 0U : ( uint32_t ) ( p - decoding_expr ) + 1U;
-                                }
-
-                                /* build sphysical name */
-                                sprintf ( sphysical_name, "%s_%s", decoding_expr, & encoding_expr [ ns_size ] );
-                                for ( i = ns_size; sphysical_name [ i ] != 0; ++ i )
-                                {
-                                    if ( sphysical_name [ i ] == ':' )
-                                        sphysical_name [ i ] = '_';
-                                }
-
-                                /* build physical decl */
-                                pb . pos = sprintf ( pb . buff, "version 1;"
-                                                     "physical %s %s:phys#1"
-                                                     "{encode{return %s(@);}"
-                                                     "decode{%s k=@;return %s(k);}}"
-                                                     , type_expr
-                                                     , sphysical_name
-                                                     , encoding_expr
-                                                     , enc_type
-                                                     , decoding_expr
-                                    );
-                            }
-#endif
-                        }
-                    }
-
-                    KMDataNodeRelease ( enc );
-                }
-                else if ( GetRCState ( rc ) == rcNotFound )
-                {
-                    /* build sphysical name */
-                    sprintf ( sphysical_name, "%s_only", decoding_expr );
-
-                    /* build decode-only physical decl */
-                    pb . pos = sprintf ( pb . buff, "version 1;"
-                                         "physical %s %s:phys#1"
-                                         "{decode{opaque k=@;return %s(k);}}"
-                                         , type_expr
-                                         , sphysical_name
-                                         , decoding_expr
-                        );
-                    rc = 0;
-                }
-                if ( rc == 0 )
-                {
-                    /* parse synthesized schema into cursor VSchema */
-                    rc = VSchemaParseText ( schema,
-                        "VPhysicalLoadV1Schema", pb . buff, pb . pos );
-                    if ( rc == 0 )
-                    {
-                        VTypedecl etd;
-
-                        /* create a new expression object */
-                        sprintf ( pb . buff, "%s:phys#1", sphysical_name );
-                        rc = VSchemaImplicitPhysEncExpr ( schema, & etd,
-                            & self -> enc, pb . buff, "VPhysicalLoadV1Schema" );
-                        if ( rc != 0 )
-                        {
-                            PLOGERR ( klogInt, ( klogInt, rc, "failed to establish column type from '$(expr)'",
-                                       "expr=%s", pb . buff ));
-                        }
-                        else if ( self -> smbr != NULL && self -> smbr -> type == NULL )
-                        {
-                            /* back-patch schema */
-                            ( ( SPhysMember* ) self -> smbr ) -> type = self -> enc;
-                            atomic32_inc ( & ( ( SExpression* ) self -> enc ) -> refcount );
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    KMDataNodeRelease ( node );
-    return rc;
-}
-
-static
-rc_t CC VPhysicalLoadSchema ( VPhysical *self,
-    VTypedecl *td, VSchema *schema, const KMDataNode *node )
-{
-    rc_t rc;
-
-    KMDataNodeSchemaFillData pb;
-    pb . node = node;
-    pb . pos = 0;
-    pb . add_v0 = false;
-
-    /* add stored declaration to cursor schema */
-    rc = VSchemaParseTextCallback ( schema,
-        "VPhysicalLoadSchema", KMDataNodeFillSchema, & pb );
-    if ( rc == 0 )
-    {
-        /* retrieve fully-resolved type attribute */
-        rc = KMDataNodeReadAttr ( node, "type",
-            pb . buff, sizeof pb . buff, & pb . pos );
-        if ( rc == 0 )
-            rc = VSchemaResolveTypedecl ( schema, td, pb . buff );
-        if ( rc == 0 )
-        {
-            /* get encoding expression */
-            rc = KMDataNodeReadAttr ( node, "expr",
-                pb . buff, sizeof pb . buff, & pb . pos );
-            if ( rc == 0 )
-            {
-                VTypedecl etd;
-
-                /* create a new expression object */
-                rc = VSchemaImplicitPhysEncExpr ( schema, & etd,
-                    & self -> enc, pb . buff, "VPhysicalLoadSchema" );
-                if ( rc != 0 )
-                {
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to establish column type from '$(expr)'",
-                               "expr=%s", pb . buff ));
-                }
-
-                /* match SPhysical type against stated type */
-                else if ( ! VTypedeclToTypedecl ( & etd, schema, td, NULL, NULL ) )
-                {
-                    rc = RC ( rcVDB, rcColumn, rcLoading, rcType, rcInconsistent );
-                    PLOGERR ( klogInt, ( klogInt, rc, "inconsistent metadata for column '$(name)'"
-                               , "name=%.*s"
-                               , ( int ) self -> smbr -> name -> name . size
-                               , self -> smbr -> name -> name . addr ));
-                }
-            }
-            else if ( GetRCState ( rc ) == rcNotFound )
-            {
-                rc = 0;
-            }
-        }
-    }
-
-    KMDataNodeRelease ( node );
-    return rc;
-}
-
-rc_t VPhysicalLoadMetadata ( VPhysical *self, VTypedecl *td, VSchema *schema )
-{
-    /* capture fixed row length */
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( self -> meta, & node, "row-len" );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeReadAsU32 ( node, & self -> fixed_len );
-        KMDataNodeRelease ( node );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* look for "schema" root node */
-    rc = KMetadataOpenNodeRead ( self -> meta, & node, "schema" );
-    if ( rc == 0 )
-        return VPhysicalLoadSchema ( self, td, schema, node );
-    if ( GetRCState ( rc ) != rcNotFound )
-        return rc;
-
-    /* appears to be an older column */
-    self -> v01 = true;
-
-    /* look for "decoding" root node */
-    rc = KMetadataOpenNodeRead ( self -> meta, & node, "decoding" );
-    if ( rc == 0 )
-        return VPhysicalLoadV1Schema ( self, td, schema, node );
-    if ( GetRCState ( rc ) != rcNotFound )
-        return rc;
-
-    /* benign error for very old columns */
-    rc = RC ( rcVDB, rcColumn, rcLoading, rcSchema, rcNotFound );
-
-    DBGMSG(DBG_VDB, DBG_FLAG(DBG_VDB_VDB),
-        ("VPhysicalLoadMetadata = %d\n", rc));
-
-    return rc;
-}
diff --git a/libs/vdb/phys-priv.h b/libs/vdb/phys-priv.h
deleted file mode 100644
index b821b8b..0000000
--- a/libs/vdb/phys-priv.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_phys_priv_
-#define _h_phys_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_data_buffer_
-#include <klib/data-buffer.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KColumn;
-struct KMetadata;
-struct KMDataNode;
-struct VTypedecl;
-struct VSchema;
-struct VTable;
-struct VCursor;
-struct VBlob;
-struct SExpression;
-struct SPhysMember;
-struct VProduction;
-
-
-/*--------------------------------------------------------------------------
- * VPhysical
- *
- *  "?start_id" is a starting id for column
- *
- *  "?stop_id" is an INCLUSIVE stop id for column, where the apparent
- *  convention was to whine about using intervals at all due to legacy
- *  issues while at the same time using "stop" as a lame attempt at
- *  indicating fully-closed vs. "end" to indicate half-closed intervals.
- */
-typedef struct VPhysical VPhysical;
-struct VPhysical
-{
-    /* physical column */
-    int64_t kstart_id, kstop_id;
-    struct KColumn KONST *kcol;
-    struct KMetadata KONST *meta;
-
-    /* static column */
-    int64_t sstart_id, sstop_id;
-    struct KMDataNode KONST *knode;
-
-    /* owning cursor */
-    struct VCursor KONST *curs;
-
-    /* definition from schema */
-    struct SPhysMember const *smbr;
-
-    /* encoding expression */
-    struct SExpression const *enc;
-
-    /* read production
-       provides decompressed data,
-       with correct byte-order */
-    struct VProduction *out;
-
-    /* output of decompression schema */
-    struct VProduction *b2p;
-
-    /* output of compression schema */
-    struct VProduction *b2s;
-
-    /* write production
-       provides decompressed data
-       in native byte-order */
-    struct VProduction *in;
-
-    /* cached static row data */
-    KDataBuffer srow;
-
-    /* id */
-    uint32_t id;
-
-    /* fixed row length */
-    uint32_t fixed_len;
-
-    /* synthesize v1 blob header */
-    bool no_hdr;
-
-    /* v0 or v1 blobs */
-    bool v01;
-
-    /* recorded at create time */
-    bool read_only;
-};
-
-/* symbol for failed production */
-#define FAILED_PHYSICAL ( ( VPhysical* ) 1U )
-
-/* Make
- *  make an empty object
- */
-rc_t VPhysicalMake ( VPhysical **phys,
-    struct VCursor KONST *curs, struct SPhysMember const *smbr );
-
-/* Whack
- */
-void VPhysicalDestroy ( VPhysical *self );
-void CC VPhysicalWhack ( void *self, void *ignore );
-
-/* Open
- *  open existing columns
- *  load schema definitions
- */
-rc_t VPhysicalOpenWrite ( VPhysical *self,
-    struct VSchema *schema, struct VTable const *tbl );
-rc_t VPhysicalOpenRead ( VPhysical *self,
-    struct VSchema *schema, struct VTable const *tbl );
-
-/* Finish
- *  complete common open procedures
- */
-rc_t VPhysicalFinishKColumn ( VPhysical *self,
-    struct VSchema *schema, struct SPhysMember const *smbr );
-rc_t VPhysicalFinishStatic ( VPhysical *self,
-    struct VSchema const *schema, struct SPhysMember const *smbr );
-
-/* LoadMetadata
- *  looks in metadata for stored schema
- *  loads fixed row length
- */
-rc_t VPhysicalLoadMetadata ( VPhysical *self,
-    struct VTypedecl *td, struct VSchema *schema );
-
-/* Read
- *  get the blob
- */
-rc_t VPhysicalRead ( VPhysical *self,
-    struct VBlob **vblob, int64_t id, uint32_t cnt, uint32_t elem_bits );
-rc_t VPhysicalReadBlob ( VPhysical *self,
-    struct VBlob **vblob, int64_t id, uint32_t elem_bits );
-
-/* IsStatic
- *  is this a static column
- */
-rc_t VPhysicalIsStatic ( const VPhysical *self, bool *is_static );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_phys_priv_ */
diff --git a/libs/vdb/phys.c b/libs/vdb/phys.c
deleted file mode 100644
index 5e216f7..0000000
--- a/libs/vdb/phys.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#define SKONST const
-#include "phys-priv.h"
-#include "prod-priv.h"
-#include "blob-priv.h"
-#undef KONST
-#undef SKONST
-
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * VPhysical
- */
-
-
-/* Whack
- */
-void CC VPhysicalWhack ( void *item, void *ignore )
-{
-    VPhysical *self = item;
-    if ( self > FAILED_PHYSICAL )
-        VPhysicalDestroy ( self );
-}
-
-/* Read
- *  get the blob
- */
-rc_t VPhysicalRead ( VPhysical *self, VBlob **vblob, int64_t id, uint32_t cnt, uint32_t elem_bits )
-{
-    return VPhysicalReadBlob ( self, vblob, id, elem_bits );
-}
diff --git a/libs/vdb/prod-cmn.c b/libs/vdb/prod-cmn.c
deleted file mode 100644
index 466fe6f..0000000
--- a/libs/vdb/prod-cmn.c
+++ /dev/null
@@ -1,2311 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define USE_EUGENE 1
-
-
-#define TRACK_REFERENCES 1
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "linker-priv.h"
-#include "column-priv.h"
-#include "phys-priv.h"
-#include "blob-priv.h"
-#include "blob.h"
-#include "page-map.h"
-#include "blob-headers.h"
-#undef KONST
-
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <vdb/xform.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <bitstr.h>
-#include <stdio.h>
-#include <limits.h>
-
-#if ! WINDOWS
-#define LAUNCH_PAGEMAP_THREAD 1
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VBlob
- */
-
-
-static
-void CC vblob_release ( void *item, void *ignore )
-{
-    TRACK_BLOB ( VBlobRelease, ( VBlob* ) item );
-    VBlobRelease ( ( VBlob* ) item );
-}
-
-/*--------------------------------------------------------------------------
- * VProduction
- */
-
-
-/* Make
- *  allocation and parent initialization
- *  called from the "Make" functions below
- *
- *  "prod" [ OUT ] - returned production
- *
- *  "size" [ IN ] - sizeof sub-type
- *
- *  "owned" [ IN ] - vector to contain productions
- *
- *  "var" [ IN ] - variant code, e.g. prodSimple, prodFunc
- *
- *  "sub" [ IN ] - sub-variant code, e.g. prodSimplePage2Blob
- *
- *  "name" [ IN, NULL OKAY ] - optional object name, derived
- *  from schema if possible
- *
- *  "fd" [ IN ] and "desc" [ IN ] - production type description
- *
- *  "cid" [ IN ] - contextual ( two-level ) id
- *
- *  "chain" [ IN ] - which chain(s) are supported
- *    chainEncoding    - when going from input to physical
- *    chainDecoding    - when pulling from physical to output
- *    chainUncommitted - when resolving trigger and validation expressions
- */
-rc_t VProductionMake ( VProduction **prodp, Vector *owned, size_t size,
-    int var, int sub, const char *name, const VFormatdecl *fd,
-    const VTypedesc *desc, const VCtxId *cid, uint8_t chain )
-{
-    rc_t rc;
-    VProduction *prod;
-
-#if PROD_NAME
-    size_t psize = size;
-#endif
-
-    assert ( size >= sizeof * prod );
-
-#if PROD_NAME
-    if ( name != NULL )
-        size += strlen ( name );
-    size += 1;
-#endif
-
-    prod = calloc ( 1, size );
-    if ( prod == NULL )
-        rc = RC ( rcVDB, rcProduction, rcResolving, rcMemory, rcExhausted );
-    else
-    {
-        rc = VectorAppend ( owned, & prod -> oid, prod );
-        if ( rc != 0 )
-        {
-            free ( prod );
-            prod = NULL;
-        }
-        else
-        {
-#if PROD_NAME
-            prod -> name = ( ( const char* ) prod ) + psize;
-            strcpy ( ( char* ) prod -> name, name ? name : "" );
-#endif
-
-            if ( fd != NULL )
-                prod -> fd = * fd;
-            if ( desc != NULL )
-                prod -> desc = * desc;
-            if ( cid != NULL )
-                prod -> cid = * cid;
-
-            prod -> var = ( uint8_t ) var;
-            prod -> sub = ( uint8_t ) sub;
-            prod -> chain = chain;
-        }
-    }
-
-    * prodp = prod;
-    return rc;
-}
-
-#if PROD_CACHE
-static
-void VProductionFlushCacheDeep ( VProduction *self, const char *context )
-{
-    int i;
-    for ( i = 0; i < self -> cache_cnt; ++ i )
-    {
-#if TRACKING_BLOBS
-        if ( self -> cache [ i ] != NULL )
-        {
-            fprintf( stderr, "%p->%p(%d) dropped from cache on %s *** %s\n"
-                     , self
-                     , self -> cache [ i ]
-                     , atomic32_read ( & self -> cache -> refcount )
-                     , context
-                     , self -> name
-                );
-        }
-#endif
-        vblob_release ( self -> cache [ i ], NULL );
-        self -> cache [ i ] = NULL;
-    }
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VSimpleProd
- *  single input param
- */
-
-/* Make
- */
-rc_t VSimpleProdMake ( VProduction **prodp, Vector *owned, struct VCursor const *curs,
-   int sub, const char *name, const VFormatdecl *fd, const VTypedesc *desc,
-    const VCtxId *cid, VProduction *in, uint8_t chain )
-{
-    VSimpleProd *prod;
-    rc_t rc = VProductionMake ( prodp, owned, sizeof * prod,
-        prodSimple, sub, name, fd, desc, cid, chain );
-    if ( rc == 0 )
-    {
-        prod = ( VSimpleProd* ) * prodp;
-        prod -> in = in;
-        prod -> curs = curs;
-    }
-    return rc;
-}
-
-static
-rc_t VSimpleProdPage2Blob ( VSimpleProd *self, VBlob **rslt, int64_t id ,uint32_t cnt)
-{
-    return VProductionReadBlob(self->in, rslt, id, cnt, NULL);
-}
-
-static
-rc_t VSimpleProdSerial2Blob ( VSimpleProd *self, VBlob **rslt, int64_t id, uint32_t cnt )
-{
-    /* read serialized blob */
-    VBlob *sblob;
-    rc_t rc = VProductionReadBlob ( self -> in, &sblob, id, cnt, NULL );
-    if ( rc == 0 )
-    {
-        /* recast data to 8 bit */
-        KDataBuffer buffer;
-        rc = KDataBufferCast ( & sblob -> data, & buffer, 8, false );
-        if (rc == 0)
-        {
-            /* create a new, fluffy blob having rowmap and headers */
-            VBlob *y;
-#if LAUNCH_PAGEMAP_THREAD
-            if(self->curs->pagemap_thread == NULL){
-                VCursor *curs = (VCursor*) self->curs;
-                if(--curs->launch_cnt<=0){
-                    /* ignoring errors because we operate with or without thread */
-                    VCursorLaunchPagemapThread(curs);
-                }
-            }
-#endif
-		
-            rc = VBlobCreateFromData ( & y, sblob -> start_id, sblob -> stop_id,
-                & buffer, VTypedescSizeof ( & self -> dad . desc ), self->curs->pagemap_thread?&self->curs->pmpr:NULL );
-            KDataBufferWhack ( & buffer );
-
-            /* return on success */
-            if ( rc == 0 )
-                * rslt = y;
-        }
-
-	vblob_release(sblob, NULL);
-    }
-
-    return rc;
-}
-
-
-static
-rc_t VSimpleProdBlob2Serial( VSimpleProd *self, VBlob **rslt, int64_t id, uint32_t cnt )
-{
-    rc_t rc;
-    VBlob *sblob;
-    
-    rc = VProductionReadBlob(self->in, &sblob, id, cnt, NULL);
-    if (rc == 0) {
-        VBlob *y;
-        
-        rc = VBlobNew(&y, sblob->start_id, sblob->stop_id, "blob2serial");
-        TRACK_BLOB (VBlobNew, y);
-        if (rc == 0) {
-            rc = KDataBufferMakeBytes(&y->data, 0);
-            if (rc == 0) {
-                /* save a reference to the page map so that fixed row-length can be determined */
-                y->pm = sblob->pm;
-                PageMapAddRef(y->pm);
-                
-                rc = VBlobSerialize(sblob, &y->data);
-                if (rc == 0)
-                    * rslt = y;
-            }
-            if (rc)
-	      vblob_release(y, NULL);
-        }
-
-	vblob_release(sblob, NULL);
-    }
-    return rc;
-}
-
-/* Read
- *  return a blob containing row id
- */
-rc_t VSimpleProdRead ( VSimpleProd *self, VBlob **vblob, int64_t id, uint32_t cnt, VBlobMRUCacheCursorContext *cctx)
-{
-    rc_t rc;
-
-    switch ( self -> dad . sub )
-    {
-    case prodSimpleCast:
-        rc = VProductionReadBlob ( self -> in, vblob, id , cnt, cctx );
-        break;
-    case prodSimplePage2Blob:
-        return VSimpleProdPage2Blob(self, vblob, id, cnt);
-    case prodSimpleSerial2Blob:
-        return VSimpleProdSerial2Blob(self, vblob, id, cnt);
-    case prodSimpleBlob2Serial:
-        return VSimpleProdBlob2Serial(self, vblob, id, cnt);
-    default:
-        * vblob = NULL;
-        return RC ( rcVDB, rcProduction, rcReading, rcProduction, rcCorrupt );
-    }
-
-    if ( rc == 0 )
-    {
-        VBlob *blob = * vblob;
-
-        /* force data buffer to reflect element size */
-        if ( self -> dad . fd . fmt == 0 &&
-             self -> dad . fd . td . type_id > 2 )
-        {
-            uint32_t elem_bits = VTypedescSizeof ( & self -> dad . desc );
-            if ( elem_bits != 0 && blob -> data . elem_bits != elem_bits )
-            {
-                rc = KDataBufferCast ( & blob -> data, & blob -> data, elem_bits, true );
-                if ( rc != 0 )
-                {
-                    vblob_release ( blob, NULL );
-                    * vblob = NULL;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * VFunctionProd
- *  function input params are VProduction*
- *  extern C function pointer and self object
- */
-
-rc_t VFunctionProdMake ( VFunctionProd **prodp, Vector *owned,
-    const VCursor *curs, int sub, const char *name,
-    const VFormatdecl *fd, const VTypedesc *desc, uint8_t chain )
-{
-    VFunctionProd *prod;
-    rc_t rc = VProductionMake ( ( VProduction** ) prodp, owned,
-        sizeof * prod, prodFunc, sub, name, fd, desc, NULL, chain );
-    if ( rc == 0 )
-    {
-        prod = * prodp;
-        prod -> curs = curs;
-
-        if ( sub != prodFuncByteswap )
-            VectorInit ( & prod -> parms, 0, 4 );
-        else
-        {
-            SDatatype *dt = VSchemaFindTypeid ( curs -> schema, fd -> td . type_id );
-            assert ( dt != NULL );
-            prod -> u . bswap = dt -> byte_swap;
-            VectorInit ( & prod -> parms, 0, 1 );
-        }
-    }
-    return rc;
-}
-
-void VFunctionProdDestroy ( VFunctionProd *self )
-{
-    /* release input parameters */
-    VectorWhack ( & self -> parms, NULL, NULL );
-    if ( self -> whack != NULL )
-        ( * self -> whack ) ( self -> fself );
-}
-
-
-
-/* Read
- */
-
-#define VECTOR_ALLOC_ARRAY( ARGC, ARRAY, S_ARRAY, H_ARRAY )	\
-    do { \
-        (H_ARRAY) = NULL; \
-        (ARRAY) = &((S_ARRAY)[0]); \
-        if ((ARGC) > sizeof((S_ARRAY)) / sizeof((S_ARRAY)[0])) { \
-            (H_ARRAY) = malloc(argc * sizeof((H_ARRAY)[0])); \
-            if ((H_ARRAY) == NULL) \
-                return RC(rcVDB, rcProduction, rcReading, rcMemory, rcExhausted); \
-            (ARRAY) = &((H_ARRAY)[0]); \
-        } \
-    } while (0)
-
-#define VECTOR_COPY_TO_ARRAY( VECTOR, ARRAY )	\
-    do { \
-        int i, n; \
-        for (n = (i = VectorStart((VECTOR))) + VectorLength((VECTOR)); i != n; ++i) \
-            (ARRAY)[i] = VectorGet((VECTOR), i); \
-    } while (0)
-
-#define VECTOR_TO_ARRAY( ARGC, ARRAY, S_ARRAY, H_ARRAY, VECTOR )	\
-    do { \
-        VECTOR_ALLOC_ARRAY((ARGC), (ARRAY), (S_ARRAY), (H_ARRAY)); \
-        VECTOR_COPY_TO_ARRAY((VECTOR), (ARRAY)); \
-    } while (0)
-
-static
-rc_t VFunctionProdCallNDRowFunc(
-                                VFunctionProd *self,
-                                VBlob **prslt,
-                                int64_t row_id,
-                                const VXformInfo *info,
-                                Vector *args
-                                )
-{
-    rc_t rc;
-    
-    /* create output blob
-       TBD - try to used cached blob if available */
-#if PROD_NAME
-    rc = VBlobNew ( prslt, row_id, row_id, self->dad.name );
-#else
-    rc = VBlobNew ( prslt, row_id, row_id, "VFunctionProdCallNDRowFunc" );
-#endif
-    TRACK_BLOB ( VBlobNew, *prslt );
-    if ( rc == 0 )
-    {
-        VRowResult rslt;
-        VRowData on_stack [ 16 ], *on_heap, *argv;
-
-        VBlob *blob = * prslt;
-        uint32_t i, argc = VectorLength ( args );
-
-        /* create and populate array of input parameters */
-        VECTOR_ALLOC_ARRAY(argc, argv, on_stack, on_heap);
-        for ( i = 0; i < argc; ++ i )
-        {
-            const VBlob *in = VectorGet(args, i);
-            uint32_t first_elem;
-
-            /* always point to page base address */
-            argv [ i ] . u . data . base = in -> data . base;
-
-            /* get row length and starting element in one pass */
-            argv [ i ] . u . data . elem_count = PageMapGetIdxRowInfo ( in -> pm,
-                (uint32_t)( row_id - in -> start_id ), & first_elem );
-
-            argv [ i ] . u . data . first_elem = first_elem;
-            
-            /* finally set the element size */
-            argv [ i ] . u . data . elem_bits = in -> data . elem_bits;
-        }
-
-        /* fill out return param block
-           NB - the initially passed-in buffer
-           may be reallocated by external function */
-        rslt . data =  & blob -> data;
-        rslt . elem_count = 0;
-        rslt . elem_bits = blob -> data . elem_bits =
-            VTypedescSizeof ( & self -> dad . desc );
-        rslt.no_cache = 0;
-        
-        blob -> byte_order = vboNative;
-
-        /* invoke the row function */
-        rc = self -> u . ndf ( self -> fself, info, row_id, & rslt, argc, argv );
-        blob->no_cache = (rslt.no_cache ? true : false);
-
-        /* clean up input arguments */
-        if ( on_heap != NULL )
-            free ( on_heap );
-
-        /* take reallocated buffer */
-        if ( rslt . data != & blob -> data )
-        {
-            KDataBufferWhack ( & blob -> data );
-            KDataBufferSub ( rslt . data, & blob -> data, 0, UINT64_MAX );
-            KDataBufferWhack ( rslt . data );
-        }
-        blob->data.elem_count = rslt.elem_count;
-
-        /* if the function was successful incorporate row length */
-        if (rc == 0)
-        {
-            assert(rslt . elem_count >> 32 == 0);
-            rc = PageMapNewFixedRowLength ( & blob -> pm, 1, (uint32_t)rslt . elem_count );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        vblob_release ( blob, NULL );
-
-        *prslt = NULL;
-    }
-
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallRowFunc( VFunctionProd *self, VBlob **prslt, int64_t row_id, 
-    uint32_t row_count, const VXformInfo *info, Vector *args )
-{
-    rc_t rc;
-    uint32_t i, argc = VectorLength ( args );
-    VRowResult rslt;
-    VRowData args_os[16], *args_oh, *argv;
-    KDataBuffer scratch;
-    VBlob *blob;
-    const VBlob *in;
-    PageMapIterator iter_os[16], *iter_oh, *iter;
-    uint64_t last = 0;
-    uint32_t last_len = 0;
-    uint64_t  window;
-    
-    if (argc == 0) {
-        memset(&scratch, 0, sizeof(scratch));
-        memset(&args_os[0], 0, sizeof(args_os[0]));
-        rslt.data = &scratch;
-        rslt.elem_count = 0;
-        rslt.elem_bits = scratch.elem_bits = VTypedescSizeof(&self->dad.desc);
-        
-        rc = self->u.rf(self->fself, info, row_id, &rslt, 0, args_os);
-        if (rc == 0) {
-#if PROD_NAME
-            rc = VBlobNew ( &blob, -INT64_MAX - 1, INT64_MAX, self->dad.name );
-#else
-            rc = VBlobNew ( &blob, -INT64_MAX - 1, INT64_MAX, "VFunctionProdCallDetRowFunc" );
-#endif
-            if (rc == 0) {
-		        blob->byte_order = vboNative;
-                assert(rslt.elem_count <= UINT32_MAX);
-                KDataBufferSub(rslt.data, &blob->data, 0, rslt.elem_count);
-		if ( rslt.data != & scratch )
-		  KDataBufferWhack(rslt.data);
-                rc = PageMapNewSingle(&blob->pm, UINT32_MAX, (uint32_t)rslt.elem_count);
-                if (rc == 0)
-                    *prslt = blob;
-                else
-		  vblob_release(blob, NULL);
-            }
-        }
-        KDataBufferWhack(&scratch);
-        return rc;
-    }
-
-
-#define MAX_BLOB_REGROUP 256 /** max rows in blob for regrouping ***/
-    window=self->stop_id-self->start_id+1;/*** from previous fetch **/
-    if(row_id == self->stop_id+1){ /** sequentual io ***/
-	if( window < MAX_BLOB_REGROUP && (row_id%(4*window))==1){
-		window *=4;
-	}
-    } else {
-	window = 1;
-    } 
-
-    if(window == 1){
-	self->start_id=self->stop_id=row_id;
-	if(row_count > 0) self->stop_id += row_count-1;
-    } else { 
-      for (self->start_id=-INT64_MAX - 1,self->stop_id=INT64_MAX,i = 0; i != argc; ++ i) {
-          in = VectorGet(args, i);
-        if(self->start_id < in->start_id) self->start_id=in->start_id;
-        if(self->stop_id  > in->stop_id ) self->stop_id =in->stop_id;
-      }
-      assert(row_id >= self->start_id && row_id  + row_count -1 <= self->stop_id);
-      if(self->start_id==-INT64_MAX - 1 || self->stop_id==INT64_MAX){
-        self->start_id=self->stop_id=row_id;
-        if(row_count > 0) self->stop_id += row_count-1;
-      } else if (    row_count ==1 /*we are re-blobing */
-                  && self->stop_id - self->start_id > 2*window){
-	int64_t	n=(row_id-1)/window;
-	if(self->start_id <= n*window)      self->start_id=n*window+1;
-	if(self->stop_id > (n+1) * window) self->stop_id = (n+1)*window;
-      }
-    }
-    
-#if PROD_NAME
-    rc = VBlobNew ( &blob, self->start_id, self->stop_id, self->dad.name );
-#else
-    rc = VBlobNew ( &blob, self->start_id, self->stop_id, "VFunctionProdCallDetRowFunc" );
-#endif
-    TRACK_BLOB ( VBlobNew, blob );
-    if (rc)
-        return rc;
-    rc = PageMapNew(&blob->pm, BlobRowCount(blob));
-    if (rc == 0)
-	rc = PageMapPreExpandFull(blob->pm, BlobRowCount(blob));
-    if (rc) {
-      vblob_release(blob, NULL);
-        return rc;
-    }
-    
-    
-    memset(&scratch, 0, sizeof(scratch));
-    rslt.data = &scratch;
-    rslt.elem_bits = scratch.elem_bits = blob->data.elem_bits = VTypedescSizeof(&self->dad.desc);
-    blob->byte_order = vboNative;
-    
-    /* create and populate array of input parameters */
-    VECTOR_ALLOC_ARRAY(argc, argv, args_os, args_oh);
-    VECTOR_ALLOC_ARRAY(argc, iter, iter_os, iter_oh);
-    
-    for (i = 0; i != argc; ++ i) {
-        in = VectorGet(args, i);
-       
-	if(in->start_id == -INT64_MAX - 1 ) {
-		rc = PageMapNewIterator(in->pm, &iter[i],0,-1);
-	} else {
-		rc = PageMapNewIterator(in->pm, &iter[i], self->start_id-in->start_id, self->stop_id - self->start_id + 1);
-	}
-        if ( rc ) break;
-/*********
-        if ( !PageMapIteratorAdvance( &iter[i], (uint32_t)( start_id - in->start_id ) ) ) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcBlob, rcCorrupt);
-            break;
-        }
-**********/
-        memset(&argv[i], 0, sizeof(argv[i]));
-        argv[i].variant = vrdData;
-        argv[i].u.data.elem_bits = in->data.elem_bits;
-        argv[i].u.data.base = in->data.base;
-    }
-    
-    for (row_id = self->start_id; row_id <= self->stop_id && rc == 0; ) {
-        uint32_t row_count = 1;
-	if(self->dad.sub == vftRow ){
-		row_count = PageMapIteratorRepeatCount(&iter[0]);
-		
-		for (i = 1; i != argc; ++i) {
-		    uint32_t j = PageMapIteratorRepeatCount(&iter[i]);
-		    if (row_count > j)
-			row_count = j;
-		}
-		if (row_id + row_count > self->stop_id + 1)
-		    row_count = (uint32_t)( self->stop_id + 1 - row_id );
-	}
-			
-	for (i = 0; i != argc; ++i) {
-	    argv[i].u.data.elem_count = PageMapIteratorDataLength(&iter[i]);
-	    argv[i].u.data.first_elem = PageMapIteratorDataOffset(&iter[i]);
-	}
-        
-        rslt.elem_count = 0;
-        rc = self->u.rf(self->fself, info, row_id, &rslt, argc, argv);
-        if (rc) break;
-        
-        assert(rslt.elem_count >> 32 == 0);
-
-        if ( row_id == self->start_id || last_len != rslt.elem_count || 
-            bitcmp(blob->data.base, last * rslt.elem_bits,
-                   rslt.data->base, 0, rslt.elem_count * rslt.elem_bits) != 0)
-        {
-            last = blob->data.elem_count;
-            rc = KDataBufferResize(&blob->data, blob->data.elem_count + rslt.elem_count);
-            if (rc == 0) {
-                bitcpy(blob->data.base, last * rslt.elem_bits,
-                       rslt.data->base, 0, rslt.elem_count * rslt.elem_bits);
-                rc = PageMapAppendRows(blob->pm, rslt.elem_count, row_count, false);
-            }
-        }
-        else
-            rc = PageMapAppendRows(blob->pm, rslt.elem_count, row_count, true);
-        
-        /* drop any new buffer that was returned to us */
-        if (rslt.data != &scratch) {
-            KDataBufferWhack(rslt.data);
-        }
-        
-        if (rc) break;
-        
-        last_len = (uint32_t)rslt.elem_count;
-
-        for (i = 0; i != argc; ++i)
-            PageMapIteratorAdvance(&iter[i], row_count);
-        row_id += row_count;
-    }
-    KDataBufferWhack(&scratch);    
-    if (args_oh) free(args_oh);
-    if (iter_oh) free(iter_oh);
-
-    if (rc == 0) {
-        *prslt = blob;
-        return 0;
-    }
-    vblob_release(blob, NULL);
-    
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallArrayFunc( VFunctionProd *self, VBlob **prslt,
-    int64_t id, const VXformInfo *info, Vector *args ) {
-    VBlob *rslt = 0;
-    VBlob *sblob;
-    rc_t rc;
-    
-    sblob = VectorGet(args, 0);
-    assert(sblob);
-    
-#if PROD_NAME
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, self->dad.name);
-#else
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, "VFunctionProdCallArrayFunc");
-#endif
-    TRACK_BLOB( VBlobNew, rslt );
-    if (rc == 0) {
-        rslt->pm = sblob->pm;
-        PageMapAddRef(rslt->pm);
-        
-        if (sblob->headers) {
-            if ( self -> dad . chain == chainEncoding )
-                rc = BlobHeadersCreateChild(sblob->headers, &rslt->headers);
-            else {
-                rslt->headers = (BlobHeaders *)BlobHeadersGetNextFrame(sblob->headers);
-                BlobHeadersAddRef(rslt->headers);
-            }
-        }
-        if (rc == 0) {
-	    rc = KDataBufferMake(&rslt->data, VTypedescSizeof(&self->dad.desc), sblob->data.elem_count);
-            if (rc == 0) {
-                rc = self->u.af(
-                                self->fself,
-                                info,
-                                rslt->data.base,
-                                sblob->data.base,
-                                sblob->data.elem_count
-                                );
-                if (rc == 0) {
-                    *prslt = rslt;
-                    return 0;
-                }
-            }
-        }
-
-        vblob_release( rslt, NULL );
-    }
-    
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallPageFunc( VFunctionProd *self, VBlob **rslt, int64_t id, 
-    const VXformInfo *info, Vector *args )
-{
-    struct input_t {
-        const VBlob *blob;
-        bool	sb_input;
-        PageMapIterator cur_row;
-        bool at_end;
-    };
-    struct input_t on_stack[8];
-    struct input_t *on_heap;
-    struct input_t *argv;
-    
-    VRowData pb_stack[8];
-    VRowData *pb_heap;
-    VRowData *param;
-    
-    rc_t rc=0;
-    uint32_t i, argc = VectorLength(args);
-    int64_t start_id;
-    int64_t stop_id;
-    uint32_t elem_count;
-    uint32_t row_count;
-    int first_non_control_input;
-    int allInputsAreSingleRow;
-    VBlob *blob = NULL;
-    
-    VECTOR_ALLOC_ARRAY(argc, argv, on_stack, on_heap);
-    VECTOR_ALLOC_ARRAY(argc, param, pb_stack, pb_heap);
-
-    memset(argv, 0, sizeof(argv[0]) * argc);
-    
-    for (start_id = stop_id = 0,
-         first_non_control_input=-1,
-         allInputsAreSingleRow = true,
-         i = 0; i != argc ; ++i) {
-        const VBlob *b = (const VBlob *)VectorGet(args, i);
-        const VProduction *prod = (const VProduction *)VectorGet(&self->parms, i);
-
-
-        if(b->pm == NULL){
-            rc=PageMapProcessGetPagemap(&self->curs->pmpr,(PageMap**)(&b->pm));
-            if(rc != 0) return rc;
-        }
-        
-        if (prod->control) {
-            param[i].variant = vrdControl;
-            assert(0); /*** TBD: Not implemented ???? ***/
-        } else {
-            param[i].variant = vrdData;
-            argv[i].blob = b;
-            argv[i].sb_input = VBlobIsSingleRow(argv[i].blob);
-            allInputsAreSingleRow &= argv[i].sb_input;
-            
-            if(first_non_control_input < 0){
-                first_non_control_input = i;
-                start_id = argv[i].blob->start_id;
-                stop_id = argv[i].blob->stop_id;
-            } else {
-                if(start_id < argv[i].blob->start_id)
-                    start_id = argv[i].blob->start_id;
-                if(stop_id > argv[i].blob->stop_id)
-                    stop_id  = argv[i].blob->stop_id;
-            }
-        }
-    }
-    if ( allInputsAreSingleRow ) {
-	row_count = stop_id - start_id + 1;
-	if(row_count == 0 ) /*** case of static column **/
-		row_count=1;
-    } else {
-	row_count = stop_id - start_id + 1;
-    }
-    if (first_non_control_input < 0) /* no non-control inputs */
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcParam, rcInvalid);
-    else if (start_id > stop_id )
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcRange, rcEmpty);
-    
-    for ( elem_count = 0, i = 0; i != argc && rc ==0; ++i) {
-        rc = PageMapNewIterator(argv[i].blob->pm, &argv[i].cur_row, start_id - argv[i].blob->start_id ,row_count);
-        if(rc == 0){
-            PageMapIterator temp = argv[i].cur_row;
-            uint32_t ec = 0;
-            
-            if ( argv[i].sb_input ){
-                ec = PageMapIteratorDataLength(&temp) * row_count;
-            } else do {
-                ec+=PageMapIteratorDataLength(&temp);
-            } while (PageMapIteratorNext(&temp));
-            if(ec == 0){
-                rc = RC(rcVDB, rcFunction, rcExecuting, rcPagemap, rcInvalid); /* bad page map */
-            } else if (elem_count == 0){
-                elem_count=ec;
-            } else if (ec != elem_count){
-                rc = RC(rcVDB, rcFunction, rcExecuting, rcParam, rcInvalid); /* Pages have to have the same number of elements*/
-            }
-    	}
-    }
-    
-    while (rc == 0) /* not really while */ {
-#if PROD_NAME
-        rc = VBlobNew(&blob, start_id, stop_id, self->dad.name);
-#else
-        rc = VBlobNew(&blob, start_id, stop_id, "VFunctionProdCallPageFunc");
-#endif
-        if (rc) break;
-        
-        TRACK_BLOB(VBlobNew,blob);
-        
-        if (allInputsAreSingleRow) {
-            VFixedRowResult rslt;
-            uint32_t	row_element_count = PageMapIteratorDataLength(&argv[first_non_control_input].cur_row);
-            
-            rc = PageMapNewSingle(&blob->pm, row_count, row_element_count);
-            if (rc) break;
-            
-            rc = KDataBufferMake(&blob->data, VTypedescSizeof(&self->dad.desc), row_element_count);
-            if (rc) break;
-            
-            for (i = 0; i != argc; ++i) {
-                if (param[i].variant == vrdControl)
-                    continue;
-                if (argv[i].at_end) {
-                    rc = RC(rcVDB, rcFunction, rcExecuting, rcRow, rcNotFound);
-                    break;
-                }
-                
-                param[i].u.data.base = argv[i].blob->data.base;
-                param[i].u.data.elem_count = row_element_count;
-                param[i].u.data.first_elem = PageMapIteratorDataOffset(&argv[i].cur_row);
-                param[i].u.data.elem_bits = argv[i].blob->data.elem_bits;
-                
-                argv[i].at_end = PageMapIteratorNext(&argv[i].cur_row) ? false : true;
-            }
-            if (rc) break;
-            
-            rslt.base = blob->data.base;
-            rslt.first_elem = 0;
-            rslt.elem_count = row_element_count;
-            rslt.elem_bits = blob->data.elem_bits;
-            
-            rc = self->u.pf(self->fself, info, start_id, &rslt, argc, param);
-        } else {
-            uint32_t first_write;
-            int64_t row_id;
-            uint32_t last = 0;
-            uint32_t last_rowlen = 0;
-            
-            rc = PageMapNew(&blob->pm, row_count); /*** max number of rows - it may collapse some **/
-            if (rc) break;
-            rc = KDataBufferMake(&blob->data, VTypedescSizeof(&self->dad.desc), elem_count);
-            if (rc) break;
-            
-            for (first_write = 0, row_id = start_id; row_id <= stop_id; ++row_id) {
-                VFixedRowResult rslt;
-                
-                for (i = 0; i != argc; ++i) {
-                    if (param[i].variant == vrdControl)
-                        continue;
-                    if (argv[i].at_end) {
-                        rc = RC(rcVDB, rcFunction, rcExecuting, rcRow, rcNotFound);
-                        break;
-                    }
-                    
-                    param[i].u.data.base = argv[i].blob->data.base;
-                    param[i].u.data.elem_count = PageMapIteratorDataLength(&argv[i].cur_row);
-                    param[i].u.data.first_elem = PageMapIteratorDataOffset(&argv[i].cur_row);
-                    param[i].u.data.elem_bits = argv[i].blob->data.elem_bits;
-                    
-                    argv[i].at_end = PageMapIteratorNext(&argv[i].cur_row) ? false : true;
-                }
-                if (rc)
-                    break;
-                
-                rslt.base = blob->data.base;
-                rslt.first_elem = first_write;
-                rslt.elem_count = param[first_non_control_input].u.data.elem_count;
-                rslt.elem_bits = blob->data.elem_bits;
-                
-                rc = self->u.pf(self->fself, info, row_id, &rslt, argc, param);
-                if (rc)
-                    break;
-                
-                assert(rslt.elem_count >> 32 == 0);
-                if ( row_id != start_id && last_rowlen == rslt.elem_count &&
-                    memcmp(((char*)blob->data.base) + (last*rslt.elem_bits)/8,
-                           ((char*)blob->data.base) + (first_write*rslt.elem_bits)/8,
-                           (rslt.elem_count*rslt.elem_bits)/8) == 0)
-                {
-                    rc = PageMapAppendRow(blob->pm, (uint32_t)rslt.elem_count, true);
-                }
-                else {
-                    last = first_write;
-                    first_write += rslt.elem_count;
-                    rc = PageMapAppendRow(blob->pm, (uint32_t)rslt.elem_count, false);
-                }
-                if (rc)
-                    break;
-                last_rowlen = (uint32_t)rslt.elem_count;
-            }
-            if (rc)
-                break;
-            KDataBufferSub(&blob->data, &blob->data, 0, first_write);
-        }
-        *rslt = blob;
-        break;
-    }
-    if (rc != 0 && blob != NULL) vblob_release(blob, NULL);
-    if (on_heap) free(on_heap);
-    if (pb_heap) free(pb_heap);
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallBlobFuncEncoding( VFunctionProd *self, VBlob *rslt, int64_t id,
-    const VXformInfo *info, const VBlob *sblob ) {
-    VBlobData src;
-    VBlobResult dst;
-    VBlobHeader *hdr;
-    rc_t rc;
-    uint32_t elem_size = VTypedescSizeof(&self->dad.desc);
-    
-    rc = BlobHeadersCreateChild(sblob->headers, &rslt->headers);
-    if (rc == 0) {
-        hdr = BlobHeadersGetHdrWrite(rslt->headers);
-        if (hdr) {
-            bitsz_t sz = KDataBufferBits(&sblob->data);
-            
-            VBlobHeaderSetSourceSize(hdr, KDataBufferBytes(&sblob->data));
-            sz = (sz + elem_size - 1) / elem_size;
-            rc = KDataBufferMake( &rslt->data, elem_size, sz );
-        }
-        else
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    }
-    if (rc)
-        return rc;
-
-    dst.header = NULL;
-    
-    if ( sblob -> data.elem_count == 0)
-        goto SKIP_COMPRESSION;
-
-    src.data = sblob -> data.base;
-    src.elem_count = sblob -> data.elem_count;
-    src.elem_bits = sblob -> data.elem_bits;
-    src.byte_order = sblob -> byte_order;
-    
-    dst.data = rslt -> data.base;
-    dst.elem_count = rslt -> data.elem_count;
-    dst.elem_bits = rslt -> data.elem_bits;
-    dst.byte_order = sblob -> byte_order;
-    
-    rc = self->u.bf(self->fself, info, &dst, &src, hdr);
-    
-    if (rc == 0) {
-        if ( dst.header != NULL && dst.header != hdr ) {
-            VBlobHeaderReplace ( hdr, dst.header );
-            VBlobHeaderRelease ( dst.header );
-        }
-        rslt->data.elem_bits = dst.elem_bits;
-        rslt->data.elem_count = dst.elem_count;
-        rslt->byte_order = dst.byte_order;
-    }
-    else if (GetRCObject(rc) == rcBuffer && GetRCState(rc) == rcInsufficient) {
-    SKIP_COMPRESSION:
-        VBlobHeaderSetFlags(hdr, 1);
-        
-        KDataBufferWhack(&rslt->data);
-        if ( dst.header != NULL && dst.header != hdr )
-            VBlobHeaderRelease ( dst.header );
-        
-        /* compressors usually produce bits (elem_size == 1) or bytes (elem_size == 8)
-         * the cast to bits can never fail, so we will force the cast to bytes to also be
-         * infallible; casts to other sizes are allowed to fail to prevent data loss */
-        if (elem_size == 8) {
-            KDataBufferSub(&sblob->data, &rslt->data, 0, UINT64_MAX);
-            /* We can't shrink the data and KDataBufferCast won't increase the number of bits
-             * but we know that KDataBuffer can't allocate anything other than whole bytes
-             * so we're forcing the conversion to bytes manually. */
-            rslt->data.elem_count = KDataBufferBytes(&rslt->data);
-            rslt->data.elem_bits = 8;
-            rc = 0;
-        }
-        else /* if elem_size == 1 this will always work */
-            rc = KDataBufferCast(&sblob->data, &rslt->data, elem_size, false);
-    }
-    VBlobHeaderRelease(hdr);
-    
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallBlobFuncDecoding( VFunctionProd *self, VBlob *rslt,
-    int64_t id, const VXformInfo *info, const VBlob *sblob ) {
-    VBlobHeader *hdr;
-    rc_t rc;
-    uint32_t elem_size = VTypedescSizeof(&self->dad.desc);
-    
-    if (sblob->headers == NULL) {
-        /* v1 blobs don't have headers, but v1 blobs
-         * are fixed row-length so we know the data size
-         * we are relying on the blob deserialization code
-         * to set the page map up correctly */
-        if (sblob->pm == NULL) {
-            hdr = BlobHeadersCreateDummyHeader(0, 0, 0, (sblob->data.elem_bits * sblob->data.elem_count + 7) >> 3);
-        }
-        else
-            hdr = BlobHeadersCreateDummyHeader(0, 0, 0, BlobRowCount(sblob) * PageMapGetIdxRowInfo(sblob->pm, 0, 0));
-        /* leave rslt->headers null so that the next
-         * stage will also create a dummy header */
-    }
-    else {
-        /* rslt gets the headers for the next stage in decoding */
-        rslt->headers = (BlobHeaders *)BlobHeadersGetNextFrame(sblob->headers);
-        BlobHeadersAddRef(rslt->headers);
-        
-        /* get the headers for this stage in decoding */
-        hdr = BlobHeadersGetHeader(sblob->headers);
-    }
-    if ( hdr == NULL )
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    else if ((VBlobHeaderFlags(hdr) & 1) != 0)
-    {
-        /* compression was skipped */
-        VBlobHeaderRelease(hdr);
-        return KDataBufferCast(&sblob->data, &rslt->data, elem_size, true);
-    }
-    else
-    {
-        rc = KDataBufferMakeBytes(&rslt->data, VBlobHeaderSourceSize(hdr));
-        if (rc == 0) {
-            VBlobData src;
-            VBlobResult dst;
-            
-            dst.header = NULL;
-            
-            src.data = sblob -> data.base;
-            src.elem_count = sblob -> data.elem_count;
-            src.elem_bits = sblob -> data.elem_bits;
-            src.byte_order = sblob -> byte_order;
-            
-            dst.data = rslt -> data.base;
-            dst.elem_count = (rslt -> data.elem_count << 3) / elem_size;
-            dst.elem_bits = elem_size;
-            dst.byte_order = sblob -> byte_order;
-            
-            rc = self->u.bf(self->fself, info, &dst, &src, hdr);
-            
-            if (rc == 0) {
-                if ( dst.header != NULL && dst.header != hdr ) {
-                    /* only allow replacement of headers when encoding */
-                    VBlobHeaderRelease ( dst.header );
-                }
-                
-                rslt->data.elem_bits = dst.elem_bits;
-                rslt->data.elem_count = dst.elem_count;
-                rslt->byte_order = dst.byte_order;
-                
-                rc = KDataBufferCast(&rslt->data, &rslt->data, elem_size, true);
-            }
-        }
-        VBlobHeaderRelease(hdr);
-    }
-
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallBlobFunc( VFunctionProd *self, VBlob **prslt,
-    int64_t id, const VXformInfo *info, Vector *args ) {
-    VBlob *rslt = 0;
-    VBlob *sblob;
-    rc_t rc;
-    
-    sblob = VectorGet(args, 0);
-    assert(sblob);
-    if(self->dad.chain == chainEncoding){
-	VBlobAddRef(sblob);
-	if(sblob->headers==NULL)/**first in encryption chain***/
-		VBlobPageMapOptimize(&sblob); /** try to optimize the blob **/
-    }
-
-#if PROD_NAME
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, self->dad.name);
-#else
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, "VFunctionProdCallBlobFunc");
-#endif
-    if (rc)
-        return rc;
-    
-    TRACK_BLOB(VBlobNew,rslt);
-    
-    /* blob funcs are not allowed to change page maps */
-    rslt->pm = sblob->pm;
-    PageMapAddRef(rslt->pm);
-    
-    rslt->byte_order = sblob->byte_order;
-    
-    if (self->dad.chain == chainEncoding){
-        rc = VFunctionProdCallBlobFuncEncoding(self, rslt, id, info, sblob);
-	vblob_release( sblob, NULL );
-    } else {
-        rc = VFunctionProdCallBlobFuncDecoding(self, rslt, id, info, sblob);
-    }
-    
-    if (rc == 0) {
-        *prslt = rslt;
-        return 0;
-    }
-    vblob_release( rslt, NULL );
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallBlobNFunc( VFunctionProd *self, VBlob **rslt,
-    int64_t id, const VXformInfo *info, Vector *args ) {
-    const VBlob *on_stack[16];
-    const VBlob **on_heap;
-    const VBlob **argv;
-    int argc = VectorLength(args);
-    rc_t rc;
-    
-    VECTOR_TO_ARRAY(argc, argv, on_stack, on_heap, args);
-    {
-	int i;
-	for(i=0;i<argc;i++){
-		VBlob const *vb=argv[i];
-		if(vb->pm == NULL){
-			rc=PageMapProcessGetPagemap(&self->curs->pmpr,(PageMap**)(&vb->pm));
-			if(rc != 0) return rc;
-		}
-	}
-    }
-    rc = self->u.bfN(self->fself, info, id, rslt, argc, argv);
-    if ( on_heap )
-        free( (void*) on_heap );
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallLegacyBlobFunc( VFunctionProd *self, VBlob **prslt,
-    int64_t id, const VXformInfo *info, Vector *args ) {
-    VBlob *rslt = 0;
-    VBlob *sblob;
-    VNoHdrBlobFunc func = (VNoHdrBlobFunc)self->u.bf;
-    rc_t rc;
-    uint32_t elem_size = VTypedescSizeof(&self->dad.desc);
-    
-    sblob = VectorGet(args, 0);
-    assert(sblob);
-    
-#if PROD_NAME
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, self->dad.name);
-#else
-    rc = VBlobNew(&rslt, sblob->start_id, sblob->stop_id, "VFunctionProdCallLegacyBlobFunc");
-#endif
-    TRACK_BLOB(VBlobNew,rslt);
-    if (rc == 0) {
-        rc = KDataBufferMakeBytes(&rslt->data, 0);
-        if (rc == 0) {
-            VLegacyBlobResult dst;
-            dst.dst = & rslt -> data;
-            dst.byte_order = vboLittleEndian;
-            rc = func(self->fself,
-                      info,
-                      &dst,
-                      &sblob->data
-                      );
-            
-            if (rc == 0)
-            {
-                rslt->byte_order = dst.byte_order;
-
-                rc = KDataBufferCast(&rslt->data, &rslt->data, elem_size, true);
-                if (rc == 0) {
-                    rslt->pm = sblob->pm;
-                    PageMapAddRef(rslt->pm);
-
-                    *prslt = rslt;
-                    return 0;
-                }
-            }
-        }
-
-        vblob_release( rslt, NULL );
-    }
-    return rc;
-}
-
-static
-rc_t VFunctionProdCallByteswap ( VFunctionProd *self, VBlob **vblob,
-    int64_t id, const VXformInfo *info, Vector *args )
-{
-    /* get single input blob */
-    VBlob *blob = VectorFirst ( args );
-    rc_t rc;
-
-    assert ( blob != NULL );
-    
-#if PROD_CACHE
-    VProductionFlushCacheDeep ( & self -> dad, "byteswap" );
-#endif
-    
-    /* CAST */
-    rc = KDataBufferCast ( & blob->data, & blob->data, 
-                           self->dad.desc.intrinsic_bits * self->dad.desc.intrinsic_dim,
-                           false );
-    if ( rc == 0 )
-    {
-        /* legacy blob check
-         * repair missing pagemap
-         */
-        if (blob->pm == NULL) {
-            uint64_t row_count = BlobRowCount ( blob );
-            if ( row_count == 0 || blob->data.elem_count % row_count != 0)
-                rc = RC(rcVDB, rcBlob, rcReading, rcBlob, rcCorrupt);
-            else {
-                uint64_t row_len = blob->data.elem_count / row_count;
-                rc = PageMapNewFixedRowLength(&blob->pm, row_count, row_len);
-            }
-        }
-    }
-
-    if ( rc != 0)
-        return rc;
-
-    /* check for byteswapping function */
-    if ( self -> u.bswap != NULL )
-    {
-
-        if ( blob -> byte_order ==
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-             vboBigEndian
-#else
-             vboLittleEndian
-#endif
-            )
-        {
-            uint32_t int_size;
-            uint64_t blob_bits;
-
-            /* make writable */
-            KDataBuffer buffer;
-
-            rc = KDataBufferMakeWritable ( & blob -> data, & buffer );
-            if ( rc != 0 )
-                return rc;
-
-            /* invoke byte-swap function on input */
-            blob_bits = KDataBufferBits ( & buffer );
-            int_size = self -> dad.desc .intrinsic_bits;
-            ( * self -> u.bswap ) ( buffer.base, buffer.base,
-                ( uint32_t ) ( blob_bits / int_size ) );
-
-            /* poke bytes back into blob */
-            KDataBufferWhack ( & blob -> data );
-            blob -> data = buffer;
-        }
-    }
-
-    blob -> byte_order = vboNative;
-    *vblob = blob;
-
-    (void)VBlobAddRef ( blob );
-    TRACK_BLOB( VBlobAddRef, blob );
-
-    return 0;
-}
-
-#if _DEBUGGING
-#include <ctype.h>
-
-static
-rc_t VFunctionProdCallCompare1(VFunctionProd *self, VBlob **vblob, int64_t id, uint32_t cnt) {
-    VBlob *orig;
-    rc_t rc;
-    
-    *vblob = NULL;
-    assert(VectorLength(&self->parms) == 2);
-    rc = VProductionReadBlob((const VProduction *)VectorGet(&self->parms, 0), &orig, id, cnt, NULL);
-    if (rc == 0) {
-        int64_t i;
-        PageMapIterator oi;
-        VRowData orig_data;
-        const VProduction *test_prod = VectorGet(&self->parms, 1);
-
-        orig_data.u.data.base = orig->data.base;
-        orig_data.u.data.elem_bits = orig->data.elem_bits;
-        
-        PageMapNewIterator(orig->pm, &oi, 0, -1);
-        
-        for (i = orig->start_id; i <= orig->stop_id; ++i) {
-            VBlob *test;
-            uint32_t j;
-
-            j = PageMapIteratorDataLength(&oi);
-
-            rc = VProductionReadBlob(test_prod, &test, i, 1, NULL);
-            if (rc == 0) {
-                if (orig->data.elem_bits != test->data.elem_bits || orig->byte_order != test->byte_order)
-                    rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                else {
-                    PageMapIterator ti;
-                    VRowData test_data;
-
-                    test_data.u.data.base = test->data.base;
-                    test_data.u.data.elem_bits = test->data.elem_bits;
-                    
-                    PageMapNewIterator(test->pm, &ti, 0, -1);
-                    
-                    if (!PageMapIteratorAdvance(&ti, (uint32_t)(i - test->start_id))) {
-                        rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                    }
-                    else {
-                        uint32_t k = PageMapIteratorDataLength(&ti);
-                        orig_data.u.data.elem_count = test_data.u.data.elem_count = j;
-                        
-                        orig_data.u.data.first_elem = (orig->data.bit_offset / orig->data.elem_bits) + PageMapIteratorDataOffset(&oi);
-                        test_data.u.data.first_elem = (test->data.bit_offset / test->data.elem_bits) + PageMapIteratorDataOffset(&ti);
-
-                        if (j != k) {
-                            rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                        } else {
-                            rc = self->u.cf(self->fself, &orig_data, &test_data);
-                            if (rc) {
-                                rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                            }
-                        }
-                        if (rc) {
-                            const uint8_t *a = orig_data.u.data.base;
-                            const uint8_t *b = test_data.u.data.base;
-                            unsigned count;
-                            unsigned k;
-                            unsigned m;
-                            char f, ax[9 + 16 * 4 + 1], bx[9 + 16 * 4 + 1];
-                            char av[16], bv[16];
-
-                            a += (orig_data.u.data.first_elem * orig_data.u.data.elem_bits) >> 3;
-                            b += (test_data.u.data.first_elem * test_data.u.data.elem_bits) >> 3;
-                            /* show up to a row of data before */
-                            count = a - (const uint8_t*)orig_data.u.data.base;
-                            count = count < b - (const uint8_t*)orig_data.u.data.base ? count : b - (const uint8_t*)orig_data.u.data.base;
-                            count = count > 16 ? 16 : count;
-                            a -= count;
-                            b -= count;
-                            
-                            count += (j * orig->data.elem_bits + 7) >> 3;
-
-                            for (k = 0, m = 0; k != count; ++k) {
-                                if (m == 0) {
-                                    sprintf(ax, "%08X>", k);
-                                    sprintf(bx, "%08X<", k);
-                                }
-                                f = a[k] == b[k] ? ' ': '*';
-                                sprintf(ax + m * 4 + 9, " %02x%c", a[k], f);
-                                av[m] = isprint(a[k]) ? a[k] : '.';
-                                sprintf(bx + m * 4 + 9, " %02x%c", b[k], f);
-                                bv[m] = isprint(b[k]) ? b[k] : '.';
-                                m++;
-                                if(m == 16 || k == count - 1) {
-                                    DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%-73s '%.*s'\n%-73s '%.*s'\n\n", ax, m, av, bx, m, bv));
-                                    m = 0;
-                                }
-                            }
-                        }
-                    }
-                }
-                vblob_release(test, NULL);
-                if (rc)
-                    break; }
-            else
-                break;
-            PageMapIteratorAdvance(&oi, 1);
-        }
-        vblob_release(orig, NULL);
-    }
-    return rc;
-}
-#endif
-
-static
-rc_t VFunctionProdCallCompare( VFunctionProd *self, VBlob **vblob, int64_t id, uint32_t cnt ) {
-    VBlob *orig;
-    rc_t rc;
-    VProduction const *orig_prod;
-    
-    *vblob = NULL;
-    assert(VectorLength(&self->parms) == 2);
-    orig_prod = (const VProduction *)VectorGet(&self->parms, 0);
-    rc = VProductionReadBlob(orig_prod, &orig, id, cnt, NULL);
-    if (rc == 0) {
-        VBlob *test;
-        const VProduction *test_prod = VectorGet(&self->parms, 1);
-        
-        rc = VProductionReadBlob(test_prod, &test, id, cnt, NULL);
-        if (rc == 0) {
-            if (orig->data.elem_bits != test->data.elem_bits || orig->byte_order != test->byte_order){
-                rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-            } else if(   orig->pm->data_recs != 1				/*** catching static **/
-                      || test->pm->data_recs != 1				/*** trying quick comparison **/
-		      || orig->data.elem_count != test->data.elem_count
-                      || memcmp( orig->data.base, test->data.base, (orig->data.elem_bits*orig->data.elem_count+7)/8)){
-                uint64_t i;
-                PageMapIterator oi;
-                PageMapIterator ti;
-                VRowData orig_data;
-                VRowData test_data;
-                
-                orig_data.u.data.base = orig->data.base;
-                orig_data.u.data.elem_bits = orig->data.elem_bits;
-                
-                test_data.u.data.base = test->data.base;
-                test_data.u.data.elem_bits = test->data.elem_bits;
-                
-                PageMapNewIterator(orig->pm, &oi, 0, -1);
-                PageMapNewIterator(test->pm, &ti, 0, -1);
-                if (test->start_id < orig->start_id) {
-                    if ( !PageMapIteratorAdvance( &ti, (uint32_t)( orig->start_id - test->start_id ) ) ) {
-                        rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                        DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: page map mismatch at row %li\n", self->dad.name, id));
-                    }
-                }
-                
-                for (i = orig->start_id; rc == 0; ) {
-                    uint32_t elem_count;
-                    uint64_t prev_i = i;
-                    
-                    orig_data.u.data.first_elem = (orig->data.bit_offset / orig->data.elem_bits) + PageMapIteratorDataOffset(&oi);
-                    test_data.u.data.first_elem = (test->data.bit_offset / test->data.elem_bits) + PageMapIteratorDataOffset(&ti);
-
-                    for (elem_count = 0; ; ) {
-                        bool done = false;
-                        uint32_t j;
-                        uint32_t k;
-                        
-                        j = PageMapIteratorDataLength(&oi);
-                        k = PageMapIteratorDataLength(&ti);
-                        if (j != k) {
-                            rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                            DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: length mismatch at row %li ( original=%u, test=%u )\n", self->dad.name, i, j, k));
-                            break;
-                        }
-                        elem_count += j;
-                        
-                        j = PageMapIteratorRepeatCount(&oi);
-                        k = PageMapIteratorRepeatCount(&ti);
-                        if (j != k) {
-                            done = true;
-                            if (j > k)
-                                j = k;
-                        }
-                        if (PageMapIteratorAdvance(&ti, j) != PageMapIteratorAdvance(&oi, j)) {
-                            rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                            DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: page map corrupt at row %li\n", self->dad.name, i));
-                            break;
-                        }
-                        i += j;
-			if ( done || (int64_t)i > orig->stop_id || test->pm->random_access || orig->pm->random_access || !PageMapIteratorAdvance( &ti, 0 ) )
-                            break;
-                    }
-                    if (rc)
-                        break;
-                    if ( (int64_t)i > ( orig->stop_id + 1 ) ) {
-                        rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                        (void)prev_i; /* shut up warning when not printing debug msg */
-                        DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: page map has too many rows at row %li\n", self->dad.name, prev_i));
-                        break;
-                    }
-                    
-                    orig_data.u.data.elem_count = test_data.u.data.elem_count = elem_count;
-                    
-                    rc = self->u.cf(self->fself, &orig_data, &test_data);
-                    if (rc) {
-                        rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                        DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: data mismatch at row %li\n", self->dad.name, prev_i));
-                        break;
-                    }
-                    if ((int64_t)i > orig->stop_id )
-                        break;
-                    
-                    /* check to see if the test iterator is at end
-                     * and if so, fetch next blob */
-                    if (!PageMapIteratorAdvance(&ti, 0)) {
-                        VBlob *temp;
-                        
-                        rc = VProductionReadBlob(test_prod, &temp, i, orig->stop_id - i, NULL);
-                        if (rc == 0) {
-                            vblob_release(test, NULL);
-                            test = temp;
-                            test_data.u.data.base = test->data.base;
-                            PageMapNewIterator(test->pm, &ti, 0, -1);
-                            if ( test->start_id < (int64_t)i ) {
-                                if ( !PageMapIteratorAdvance( &ti, (uint32_t)( i - test->start_id ) ) ) {
-                                    rc = RC(rcVDB, rcBlob, rcValidating, rcBlob, rcCorrupt);
-                                    DBGMSG(DBG_VDB, DBG_VDB_COMPARE, ("%s: page map mismatch at row %li\n", self->dad.name, i));
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            vblob_release(test, NULL);
-        }
-        vblob_release(orig, NULL);
-    }
-    return rc;
-}
-
-typedef struct fetch_param_blob_data fetch_param_blob_data;
-struct fetch_param_blob_data
-{
-    int64_t id;
-    uint32_t cnt;
-    Vector *inputs;
-    VBlob *vblob;
-    rc_t rc;
-    bool no_cache;
-};
-
-static
-bool CC fetch_param_blob ( void *item, void *data )
-{
-    fetch_param_blob_data *pb = data;
-    VBlob *blob;
-    
-    pb -> rc = VProductionReadBlob ( item, & blob, pb -> id , pb -> cnt, NULL);
-    if ( pb -> rc == 0 )
-    {
-        pb -> rc = VectorAppend ( pb -> inputs, NULL, blob );
-        if ( pb -> rc == 0 ) {
-            pb->no_cache |= blob->no_cache;
-            return false;
-        }
-
-        vblob_release ( blob, NULL );
-    }
-
-    return true;
-}
-
-static
-bool CC fetch_first_param_blob ( void *item, void *data )
-{
-    fetch_param_blob_data *pb = data;
-    
-    pb -> rc = VProductionReadBlob ( item, &pb->vblob, pb -> id , pb -> cnt, NULL);
-    if (GetRCState(pb->rc) == rcNotFound)
-        return false;
-    if ( pb -> vblob -> data.elem_count == 0 )
-        return false;
-    return true;
-}
-
-static
-rc_t VFunctionProdSelect ( VFunctionProd *self, VBlob **vblob, int64_t id, uint32_t cnt ) {
-    fetch_param_blob_data pb;
-    
-    pb.id = id;
-    pb.cnt = cnt;
-    pb.rc = 0;
-    pb.vblob = NULL;
-    VectorDoUntil ( & self -> parms, false, fetch_first_param_blob, & pb );
-    * vblob = pb.vblob;
-    return pb.rc;
-}
-
-static rc_t VFunctionProdReadNormal ( VFunctionProd *self, VBlob **vblob, int64_t id ,uint32_t cnt )
-{
-    rc_t rc;
-    Vector inputs;
-    fetch_param_blob_data pb;
-    VBlob *vb=NULL;
-    int64_t	id_run;
-    int64_t     cnt_run;
-
-    /* fill out information for function to use */
-    const VCursor *curs = self -> curs;
-    VXformInfo info;
-
-    if(cnt == 0) cnt = 1;
-
-#if VMGR_PASSED_TO_XFORM
-    info . mgr = curs -> tbl -> mgr;
-#endif
-#if VSCHEMA_PASSED_TO_XFORM
-    info . schema = curs -> schema;
-#endif
-#if VTABLE_PASSED_TO_XFORM
-    info . tbl = curs -> tbl;
-#endif
-#if VPRODUCTION_PASSED_TO_XFORM
-    info . prod = & self -> dad;
-#endif
-    info . fdesc . fd = self -> dad . fd;
-    info . fdesc . desc = self -> dad . desc;
-    *vblob = NULL;
-
-    if (self->dad.sub == prodFuncBuiltInCompare) {
-        rc = VFunctionProdCallCompare(self, vblob, id, cnt);
-#if _DEBUGGING
-        if (rc != 0)
-            rc = VFunctionProdCallCompare1(self, vblob, id, cnt);
-#endif
-        return rc;
-    }
-
-    /* all other functions take some form of blob input */
-    VectorInit ( & inputs, 0, VectorLength ( & self -> parms ) );
-    pb . id = id;
-    pb . cnt = cnt;
-    pb . inputs = & inputs;
-    pb . vblob = NULL;
-    pb . rc = 0;
-    pb.no_cache = 0;
-    if ( VectorDoUntil ( & self -> parms, false, fetch_param_blob, & pb ) )
-        rc = pb . rc;
-    else for( id_run=id, cnt_run=cnt, rc=0; cnt_run > 0 && rc==0;) 
-    {
-        switch ( self -> dad . sub )
-        {
-        case vftLegacyBlob:
-            rc = VFunctionProdCallLegacyBlobFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case vftNonDetRow:
-            rc = VFunctionProdCallNDRowFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case vftRow:
-        case vftIdDepRow:
-            rc = VFunctionProdCallRowFunc ( self, &vb, id_run, cnt_run, & info, & inputs );
-            break;
-        case vftArray:
-            rc = VFunctionProdCallArrayFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case vftFixedRow:
-            rc = VFunctionProdCallPageFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case vftBlob:
-            rc = VFunctionProdCallBlobFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case vftBlobN:
-            rc = VFunctionProdCallBlobNFunc ( self, &vb, id_run, & info, & inputs );
-            break;
-        case prodFuncByteswap:
-            rc = VFunctionProdCallByteswap ( self, &vb, id_run, & info, & inputs );
-            break;
-        default:
-            rc = RC ( rcVDB, rcFunction, rcReading, rcProduction, rcCorrupt );
-        }
-        if (rc == 0){
-            if (vb == NULL) {
-                rc = RC ( rcVDB, rcFunction, rcReading, rcProduction, rcNull );
-            }
-            else {
-                if (vb -> start_id > id_run || vb -> stop_id < id_run) { /*** shoudn't happen ***/
-                    rc = RC ( rcVDB, rcBlob, rcReading, rcRange, rcInsufficient );
-                }
-                if (*vblob == NULL) {
-                    *vblob=vb;
-                }
-                else {
-                    if (vb -> start_id <= id) {/** new blob is not appendable, but can replace the current one **/
-                        vblob_release(*vblob, NULL);
-                        *vblob = vb;
-                    }
-                    else {
-                        /*** append here **/
-                        rc = VBlobAppend(*vblob, vb);
-                        vblob_release(vb, NULL);
-                    }
-                }
-                /* propagate dirty flag */
-                (*vblob)->no_cache |= pb.no_cache;
-                if( (*vblob) -> stop_id >= id + cnt - 1)
-                    break;
-
-                id_run  = (*vblob) -> stop_id + 1;
-                cnt_run = id + cnt - id_run;
-
-            }
-        }
-    }
-    /* drop input blobs */
-    VectorWhack ( & inputs, vblob_release, NULL );
-    return rc;
-}
-
-rc_t VFunctionProdRead ( VFunctionProd *self, VBlob **vblob, int64_t id , uint32_t cnt )
-{
-    if ( self -> dad . sub == vftSelect )
-        return VFunctionProdSelect ( self, vblob, id , cnt);
-    return VFunctionProdReadNormal(self, vblob, id, cnt);
-}    
-
-typedef struct fetch_param_IdRange_data fetch_param_IdRange_data;
-struct fetch_param_IdRange_data
-{
-    int64_t first;
-    int64_t last;
-    rc_t rc;
-    bool first_time;
-};
-
-static
-bool CC fetch_param_IdRange ( void *item, void *data )
-{
-    fetch_param_IdRange_data *pb = data;
-    int64_t first;
-    int64_t last;
-    rc_t rc;
-    
-    rc = VProductionColumnIdRange(item, &first, &last);
-    if (GetRCState(rc) == rcEmpty && GetRCObject(rc) == rcRange)
-        return false;
-
-    pb->rc = rc;
-    if (rc == 0 )
-    {
-        if (pb->first_time || first < pb->first)
-            pb->first = first;
-        if (pb->first_time || last > pb->last)
-            pb->last = last;
-        pb->first_time = false;
-        return false;
-    }
-    
-    return true;
-}
-
-LIB_EXPORT rc_t CC VFunctionProdColumnIdRange ( const VFunctionProd *self, int64_t *first, int64_t *last )
-{
-    fetch_param_IdRange_data pb;
-
-    pb.first_time = true;
-    pb . rc = 0;
-    pb.first = 1;
-    pb.last = 0;
-    
-    VectorDoUntil ( & self -> parms, false, fetch_param_IdRange, & pb );
-    if (pb.rc == 0) {
-        *first = pb.first;
-        *last = pb.last;
-    }
-    
-    return pb . rc;
-}
-
-typedef struct fetch_param_FixedRowLength_data fetch_param_FixedRowLength_data;
-struct fetch_param_FixedRowLength_data
-{
-    uint32_t length;
-    int64_t row_id;
-    bool first_time;
-};
-
-static
-bool CC fetch_param_FixedRowLength ( void *item, void *data )
-{
-    fetch_param_FixedRowLength_data *pb = data;
-    uint32_t length;
-    
-    if (((const VProduction *)item)->control == false) {
-        length = VProductionFixedRowLength(item, pb->row_id, false);
-
-        if (pb->first_time)
-            pb->length = length;
-
-        pb->first_time = false;
-        
-        if (length == 0 || length != pb->length)
-            return true;
-    }
-    return false;
-}
-
-static
-uint32_t VFunctionProdFixedRowLength ( const VFunctionProd *self, int64_t row_id,bool  ignore_self )
-{
-    if(ignore_self == false &&  (self->dad.sub == vftRow || self->dad.sub == vftNonDetRow || self->dad.sub == vftIdDepRow )){
-	return 0;
-    } else {
-	fetch_param_FixedRowLength_data pb;
-        pb.first_time = true;
-        pb.length = 0;
-        VectorDoUntil ( & self -> parms, false, fetch_param_FixedRowLength, & pb );
-        return pb.length;
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * VScriptProd
- */
-
-rc_t VScriptProdMake ( VScriptProd **prodp, Vector *owned, struct VCursor const *curs,
-    int sub, const char *name, const VFormatdecl *fd,
-    const VTypedesc *desc, uint8_t chain )
-{
-    VScriptProd *prod;
-    rc_t rc = VProductionMake ( ( VProduction** ) prodp, owned, sizeof * prod,
-        prodScript, sub, name, fd, desc, NULL, chain );
-    if ( rc == 0 )
-    {
-        prod = * prodp;
-        prod -> curs = curs;
-        VectorInit ( & prod -> owned, 0, 4 );
-    }
-    return rc;
-}
-
-void VScriptProdDestroy ( VScriptProd *self )
-{
-    VectorWhack ( & self -> owned, VProductionWhack, NULL );
-}
-
-
-/* Read
- */
-rc_t VScriptProdRead ( VScriptProd *self, VBlob **vblob, int64_t id,uint32_t cnt )
-{
-    return VProductionReadBlob ( self -> rtn, vblob, id , cnt, NULL);
-}
-
-static rc_t VScriptProdColumnIdRange ( const VScriptProd *self, int64_t *first, int64_t *last )
-{
-    return VProductionColumnIdRange(self->rtn, first, last);
-}
-
-static uint32_t VScriptProdFixedRowLength ( const VScriptProd *self, int64_t row_id )
-{
-    return VProductionFixedRowLength(self->rtn, row_id, false);
-}
-
-
-/*--------------------------------------------------------------------------
- * VProduction
- */
-
-/* Init
- *  parent initialization function
- *  called from the "Make" functions below
- */
-#if 0
-static
-void VProductionInit ( VProduction *self, int var, int sub, const char *name,
-                       const VFormatdecl *fd, const VTypedesc *desc,
-                       const VCtxId *cid, uint8_t chain )
-{
-    memset ( self, 0, sizeof * self );
-
-    if ( fd != NULL )
-        self -> fd = * fd;
-    if ( desc != NULL )
-        self -> desc = * desc;
-    if ( cid != NULL )
-        self -> cid = * cid;
-
-    self -> var = ( uint8_t ) var;
-    self -> sub = ( uint8_t ) sub;
-    self -> chain = chain;
-}
-#endif
-
-
-void CC VProductionWhack ( void *item, void *owned )
-{
-    VProduction * self = item;
-
-    if ( self != NULL )
-    {
-        if ( owned != NULL)
-        {
-            void *ignore;
-            VectorSwap ( owned, self -> oid, NULL, & ignore );
-            assert ( ( void* ) self == ignore );
-        }
-
-
-#if PROD_CACHE
-        VProductionFlushCacheDeep ( self, "whack" );
-#endif
-        switch ( self -> var )
-        {
-        case prodSimple:
-#if TRACKING_BLOBS
-            fprintf( stderr, "VSimpleProd %p being whacked *** %s\n", self, self->name );
-#endif
-            VSimpleProdDestroy ( ( VSimpleProd* ) self );
-            break;
-
-        case prodFunc:
-#if TRACKING_BLOBS
-            fprintf( stderr, "VFunctionProd %p being whacked *** %s\n", self, self->name );
-#endif
-            VFunctionProdDestroy ( ( VFunctionProd* ) self );
-            break;
-
-        case prodScript:
-#if TRACKING_BLOBS
-            fprintf( stderr, "VScriptProd %p being whacked *** %s\n", self, self->name );
-#endif
-            VScriptProdDestroy ( ( VScriptProd* ) self );
-            break;
-
-        case prodPhysical:
-#if TRACKING_BLOBS
-            fprintf( stderr, "VPhysicalProd %p being whacked *** %s\n", self, self->name );
-#endif
-            VPhysicalProdDestroy ( ( VPhysicalProd* ) self );
-            break;
-
-        case prodColumn:
-#if TRACKING_BLOBS
-            fprintf( stderr, "VColumnProd %p being whacked *** %s\n", self, self->name );
-#endif
-            VColumnProdDestroy ( ( VColumnProd* ) self );
-            break;
-        }
-
-        free ( self );
-    }
-}
-
-/* Cmp
- * Sort
- *  compare item is a VCtxId
- *  sort item is a VProduction
- *  n is always a VProduction
- */
-LIB_EXPORT int CC VProductionCmp ( const void *item, const void *n )
-{
-    const VCtxId *a = item;
-    const VProduction *b = n;
-    return VCtxIdCmp ( a, & b -> cid );
-}
-
-LIB_EXPORT int CC VProductionSort ( const void *item, const void *n )
-{
-    const VProduction *a = item;
-    const VProduction *b = n;
-    return VCtxIdCmp ( & a -> cid, & b -> cid );
-}
-
-
-/* IdRange
- *  obtains intersection of all physical sources
- *
- *  "first" [ IN/OUT ] and "last" [ IN/OUT ] - range to intersect
- */
-rc_t VProductionColumnIdRange ( const VProduction *self,
-    int64_t *first, int64_t *last )
-{
-    if ( self <= FAILED_PRODUCTION )
-        return 0;
-
-    switch ( self -> var )
-    {
-    case prodSimple:
-        return VProductionColumnIdRange ( ( ( const VSimpleProd* ) self ) -> in, first, last );
-    case prodFunc:
-        return VFunctionProdColumnIdRange((const VFunctionProd *)self, first, last);
-    case prodScript:
-        return VScriptProdColumnIdRange((const VScriptProd *)self, first, last);
-    case prodPhysical:
-        return VPhysicalProdColumnIdRange((const VPhysicalProd *)self, first, last);
-    case prodColumn:
-        return RC ( rcVDB, rcColumn, rcAccessing, rcRange, rcEmpty );
-    }
-    
-    return RC ( rcVDB, rcColumn, rcAccessing, rcType, rcUnknown );
-}
-
-rc_t VProductionPageIdRange ( VProduction *self,
-    int64_t id, int64_t *first, int64_t *last )
-{
-    VBlob *blob;
-    rc_t rc = VProductionReadBlob ( self, & blob, id , 1, NULL);
-    if ( rc == 0 )
-    {
-        * first = blob -> start_id;
-        * last = blob -> stop_id;
-
-        vblob_release ( blob, NULL );
-    }
-    return rc;
-}
-
-/* RowLength
- *  get row length for a particular row
- */
-uint32_t VProductionRowLength ( const VProduction *self, int64_t row_id )
-{
-    uint32_t row_len;
-
-    VBlob *blob;
-    rc_t rc = VProductionReadBlob ( self, & blob, row_id, 1, NULL );
-    if ( rc != 0 )
-        return 0;
-    
-    row_len = PageMapGetIdxRowInfo ( blob -> pm, (uint32_t)( row_id - blob -> start_id) , NULL );
-
-    vblob_release ( blob, NULL );
-    
-    return row_len;
-}
-
-/* FixedRowLength
- *  get fixed row length for entire column
- *  returns 0 if not fixed
- */
-uint32_t VProductionFixedRowLength ( const VProduction *self, int64_t row_id,bool ignore_self )
-{
-    switch ( self -> var )
-    {
-    case prodSimple:
-        return VProductionFixedRowLength ( ( ( const VSimpleProd* ) self ) -> in, row_id, ignore_self );
-    case prodFunc:
-        return VFunctionProdFixedRowLength((const VFunctionProd *)self, row_id, ignore_self);
-    case prodScript:
-        return VScriptProdFixedRowLength((const VScriptProd *)self, row_id);
-    case prodPhysical:
-        return VPhysicalProdFixedRowLength((const VPhysicalProd *)self, row_id);
-    }
-
-    return RC ( rcVDB, rcColumn, rcAccessing, rcType, rcUnknown );
-}
-
-
-/* ReadBlob
- */
-rc_t VProductionReadBlob ( const VProduction *cself, VBlob **vblob, int64_t id, uint32_t cnt, VBlobMRUCacheCursorContext *cctx )
-{
-    rc_t rc;
-    VProduction *self = ( VProduction* ) cself;
-
-#if PROD_CACHE
-    int i;
-    VBlob *blob;
-#endif
-
-    * vblob = NULL;
-
-    /* should not be possible, but safety is cheap */
-    if ( self == NULL )
-        return RC ( rcVDB, rcProduction, rcReading, rcSelf, rcNull );
-
-    /*** Cursor-level column blobs may be 1-to-1 with production blobs ***/
-    if(cctx != NULL && self->cctx.cache == NULL ){ /*** we are connected to read cursor **/
-	self->cctx = *cctx; /*** remember it ***/
-	/** No need to do anything else here - we are on "direct line" to the column ***/
-    } else if(self->cctx.cache != NULL){
-	/** somewhere else this production is connected to a cursor **/
-	/** lets try to get answers from the cursor **/
-	blob=(VBlob*) VBlobMRUCacheFind(self->cctx.cache,self->cctx.col_idx,id);
-	if(blob){
-		rc = VBlobAddRef ( blob );
-                if ( rc != 0 ) return rc;
-		*vblob=blob;
-		return 0;
-	}
-    }
-
-#if PROD_CACHE
-    /* check cache */
-    for ( i = 0; i < self -> cache_cnt; ++ i )
-    {
-        blob = self -> cache [ i ];
-        if ( self -> cache [ i ] != NULL )
-        {
-            /* check id range */
-            if (
-#if USE_EUGENE
-                /* NB - this is an approach where we always cache
-                   a blob after a read in order to keep it alive,
-                   but never allow a cache hit on retrieval */
-                ! blob -> no_cache &&
-#endif
-                id >= blob -> start_id &&
-                id <= blob -> stop_id )
-            {
-                rc = VBlobAddRef ( blob );
-                if ( rc != 0 )
-                    return rc;
-#if TRACKING_BLOBS
-                fprintf( stderr, "%p->%p(%d) new reference to cached blob *** %s\n"
-                         , self
-                         , blob
-                         , atomic32_read ( & blob -> refcount )
-                         , self->name
-                    );
-#endif
-                /* return new reference */
-                * vblob = blob;
-#if PROD_CACHE > 1
-                /* MRU cache */
-                if ( i > 0 )
-                {
-		    memmove(self -> cache +1,self -> cache,i*sizeof(*self->cache));
-                    self -> cache [ 0 ] = blob;
-		    if( i > self->cache_cnt_max / 2 -1 ){ /** this is how wash area is defined **/
-			self->cache_wash_access_cnt++; /** we are accessing  wash area of the cache **/
-		    }
-                }
-#endif
-                return 0;
-            }
-        }
-    }
-#endif /* PROD_CACHE */
-
-    /* dispatch */
-    switch ( self -> var )
-    {
-    case prodSimple:
-        rc = VSimpleProdRead ( ( VSimpleProd* ) self, vblob, id, cnt,cctx );
-        break;
-    case prodFunc:
-        rc = VFunctionProdRead ( ( VFunctionProd* ) self, vblob, id , cnt);
-#if _DEBUGGING && PROD_NAME
-        if ( rc != 0 )
-            DBGMSG ( DBG_VDB, DBG_VDB_FUNCTION, ( "%s: %R\n", self -> name, rc ) );
-#endif
-        break;
-    case prodScript:
-        rc = VScriptProdRead ( ( VScriptProd* ) self, vblob, id , cnt);
-        break;
-    case prodPhysical:
-        rc = VPhysicalProdRead ( ( VPhysicalProd* ) self, vblob, id, cnt );
-        break;
-    case prodColumn:
-        rc = VColumnProdRead ( ( VColumnProd* ) self, vblob, id );
-        break;
-    default:
-        return RC ( rcVDB, rcProduction, rcReading, rcType, rcUnknown );
-    }
-
-#if ! PROD_CACHE
-    return rc;
-#else
-    blob = * vblob;
-
-    if ( rc != 0 || * vblob == NULL )
-        return rc;
-
-#if ! USE_EUGENE
-         /* NB - there is another caching mechanism on VColumn
-            if a blob does not want to be cached, it is rejected here */
-    if ( ! blob -> no_cache )
-        return 0;
-#endif
-    if(cctx == NULL && self->cctx.cache != NULL && blob->stop_id > blob->start_id + 4){/** we will benefit from caching here **/
-	VBlobMRUCacheSave(self->cctx.cache,self->cctx.col_idx,blob);
-	return 0;
-    }
-
-    if(blob->pm == NULL) return 0;
-
-
-    /* cache output */
-    rc = VBlobAddRef ( blob );
-    if ( rc == 0 )
-    {
-        VBlobCheckIntegrity ( blob );
-        if(self -> cache_cnt_max == 0){ /*** set the cache size now ***/
-		self -> cache_cnt_max = PROD_CACHE;
-#if 0
-	} else if(   self->var==prodScript
-		  && self -> cache_cnt >= self -> cache_cnt_max
-		  && self -> cache_cnt_max/PROD_CACHE  < PROD_CACHE_MAX_EXTENTS
-		  && self -> cache_wash_access_cnt > PROD_CACHE_WASH_ACCESS_THRESHOLD){  /** try to extend the cache ***/
-			 self -> cache_cnt_max += PROD_CACHE;
-                         self -> cache_wash_access_cnt = 0;
-#endif
-	}
-	if(self -> cache_cnt < self -> cache_cnt_max){
-		if(self -> cache_cnt > 0 ){
-			memmove(self -> cache + 1, self -> cache , self -> cache_cnt * sizeof(*self -> cache));
-		}
-		self -> cache_cnt ++;
-	} else {
-		/* release whatever was there previously */
-        	/* drop LRU */
-		vblob_release ( self -> cache [ self -> cache_cnt - 1 ], NULL );
-		memmove(self -> cache + 1, self -> cache , (self -> cache_cnt -1) * sizeof(*self -> cache));
-        }
-        /* insert a head of list */
-        self -> cache [ 0 ] = blob;
-                
-#if TRACKING_BLOBS
-        fprintf( stderr, "%p->%p(%d) cached *** %s\n"
-                 , self
-                 , blob
-                 , atomic32_read ( & blob -> refcount )
-                 , self -> name
-            );
-#endif
-    }
-
-#if USE_EUGENE
-    /* this code requires the blob to be cached on the production */
-    return rc;
-#else
-    /* we don't care if the blob was not cached */
-    return 0;
-#endif
-
-#endif /* PROD_CACHE */
-}
-
-/* IsStatic
- *  trace all the way to a physical production
- */
-rc_t VProductionIsStatic ( const VProduction *self, bool *is_static )
-{
-    rc_t rc;
-
-    assert ( is_static != NULL );
-    * is_static = false;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcColumn, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        for ( rc = 0; self != NULL; )
-        {
-            switch ( self -> var )
-            {
-            case prodSimple:
-                self = ( ( const VSimpleProd*) self ) -> in;
-                break;
-            case prodFunc:
-            case prodScript:
-            {
-                const VFunctionProd *fp = ( const VFunctionProd* ) self;
-                uint32_t start = VectorStart ( & fp -> parms );
-                uint32_t end = VectorLength ( & fp -> parms );
-                for ( end += start; start < end; ++ start )
-                {
-                    self = ( const VProduction* ) VectorGet ( & fp -> parms, start );
-                    if ( self != NULL )
-                    {
-                        rc = VProductionIsStatic ( self, is_static );
-                        if ( rc != 0 || * is_static )
-                            break;
-                    }
-                }
-                return rc;
-            }
-            case prodPhysical:
-                return VPhysicalIsStatic ( ( ( const VPhysicalProd* ) self ) -> phys, is_static );
-            case prodColumn:
-                self = NULL;
-                break;
-            default:
-                return RC ( rcVDB, rcProduction, rcReading, rcType, rcUnknown );
-            }
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/prod-expr.c b/libs/vdb/prod-expr.c
deleted file mode 100644
index 07a3080..0000000
--- a/libs/vdb/prod-expr.c
+++ /dev/null
@@ -1,887 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "schema-parse.h"
-#include "cursor-priv.h"
-#include "column-priv.h"
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "phys-priv.h"
-#undef KONST
-
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <vdb/xform.h>
-#include <klib/symbol.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VProdResolve
- */
-
-/* CastExpr
- *  inserts an explicit cast operation
- *
- *  in "C" style languages ( okay, ALGOL style ), a cast expression is
- *  used as a means of coercing the rh expression type to a fixed type,
- *  which is then assigned to the lh side with normal typecasting rules.
- *  specifically, performs an intermediate assignment allowing truncation
- *  to reshape and potentially reformat the rh value ( e.g. float to char ).
- *
- *  in "C++" there were new cast operators introduced to indicate more nuance:
- *    static_cast      - permits up and down-casts with compiler check
- *    const_cast       - modifies cv qualifiers [ not applicable to VDB ]
- *    dynamic_cast     - permits up and down-casts with runtime check
- *    reinterpret_cast - permits casts between unrelated classes with
- *                       compatible binary forms ( a la "C" style ).
- *
- *  in "VDB", the compiler preserves lh and rh type information until
- *  productions are resolved. assignments always involve implicit casts
- *  that permit casting from sub to super-type. our explicit cast expression
- *  performs something analogous to the C++ "static_cast" in that it allows
- *  direct up and down casts, as well as sibling and cousin casts.
- *
- *  specifically, LH = ( T ) RH when T is a sub-type of LH and:
- *    a) RH is a sub-type of T [ implicit rule ]
- *    b) T is a sub-type of RH [ downcast ]
- *    c) T and RH share a common ancestor
- *  in all cases, LH, T and RH must all have identical element sizes
- *
- *  implicit typecasting rules allow LH or RH to be a typeset. the types
- *  are initially refined to the intersection between LH and RH
- *    a) TYPE    x TYPE
- *    b) TYPESET x TYPE
- *    c) TYPE    x TYPESET
- *    d) TYPESET x TYPESET
- *  in the latter case, the intersection may produce more than one possible
- *  result, which would incur an error when evaluating the expression. a
- *  cast operator will remove the ambiguity.
- *
- *  the rh expression may involve a column name, with type overloading. this
- *  creates the same effect as a TYPESET. a cast operator can clarify an ambigous
- *  assignment, and in the case of downcasts, make it possible.
- *
- * NB
- *  to perform a C++ style reinterpret_cast, use the "cast" function
- */
-static
-rc_t VProdResolveCastExpr ( const VProdResolve *self, VProduction **out, const SBinExpr *expr )
-{
-    /* extract cast type */
-    VFormatdecl cast;
-    rc_t rc = STypeExprResolveAsFormatdecl
-        ( ( const STypeExpr* ) expr -> left, self -> schema, & cast );
-    if ( rc == 0 )
-    {
-        /* resolve rh expression */
-        VTypedesc desc;
-        VFormatdecl fd = cast;
-        rc = VProdResolveExpr ( self, out, & desc,
-            & fd, expr -> right, true );
-        if ( rc != 0 || * out == NULL )
-            return rc;
-
-        /* casting mode allowed returned production to be:
-           a) identical type
-           b) sub-type
-           c) super-type
-           d) have common parent
-
-           in all cases, the sizeof rh production element
-           matches "cast" size */
-        rc = VSimpleProdMake ( out, self -> owned, self -> curs, prodSimpleCast,
-            "cast", & cast, & desc, NULL, * out, self -> chain );
-    }
-
-    return rc;
-}
-
-/* ParamExpr
- *  resolve a simple parameter by name
- */
-LIB_EXPORT rc_t CC VProdResolveParamExpr ( const VProdResolve *self, VProduction **out, const KSymbol *sym )
-{
-    const SProduction *sprod = sym -> u . obj;
-    VProduction *vprod = VCursorCacheGet ( self -> cache, & sprod -> cid );
-    if ( vprod != NULL )
-    {
-        * out = vprod;
-        return 0;
-    }
-
-    PLOGMSG ( klogWarn, ( klogWarn, "unknown parameter '$(param)' used in expression"
-                          , "param=%.*s"
-                          , ( int ) sprod -> name -> name . size
-                          , sprod -> name -> name . addr ));
-    return 0;
-}
-
-
-/* ProdExpr
- *  resolve a simple production by name
- *  create/return a VSimpleProd object
- */
-rc_t VProdResolveSProduction ( const VProdResolve *self, VProduction **out, const SProduction *sprod )
-{
-    rc_t rc;
-    VFormatdecl fd;
-
-    /* check cache */
-    VProduction *vprod = VCursorCacheGet ( self -> cache, & sprod -> cid );
-    if ( vprod != NULL )
-    {
-        /* return valid or failed production */
-        * out = vprod;
-        return 0;
-    }
-
-    /* pre-fail */
-    rc = VCursorCacheSet ( self -> cache, & sprod -> cid, FAILED_PRODUCTION );
-    if ( rc == 0 )
-    {
-        /* resolve production type */
-        if ( sprod -> trigger )
-            memset ( & fd, 0, sizeof fd );
-        else
-        {
-            rc = STypeExprResolveAsFormatdecl
-                ( ( const STypeExpr* ) sprod -> fd, self -> schema, & fd );
-        }
-    }
-    if ( rc == 0 )
-    {
-        /* resolve assignment expression */
-        VTypedesc desc;
-        rc = VProdResolveExpr ( self, out, & desc,
-            & fd, sprod -> expr, false );
-        if ( rc == 0 && * out != NULL )
-        {
-            const char *name = sprod -> name -> name . addr;
-            assert ( name [ sprod -> name -> name . size ] == 0 );
-            rc = VSimpleProdMake ( out, self -> owned, self -> curs, prodSimpleCast, 
-                name, & fd, & desc, & sprod -> cid, * out, self -> chain );
-            if ( rc == 0 )
-            {
-                void *ignore;
-                rc = VCursorCacheSwap ( self -> cache, & sprod -> cid, * out, & ignore );
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t VProdResolveProdExpr ( const VProdResolve *self, VProduction **out, const KSymbol *sym )
-{
-    const SProduction *sprod = sym -> u . obj;
-    if ( ! sprod -> trigger )
-        return VProdResolveSProduction ( self, out, sprod );
-
-    PLOGMSG ( klogWarn, ( klogWarn, "trigger production '$(trig)' used in expression"
-                          , "trig=%.*s"
-                          , ( int ) sym -> name . size
-                          , sym -> name . addr ));
-
-    return 0;
-}
-
-
-/* ColumnExpr
- *  the trick about resolving a column reference is in its type
- */
-typedef struct SColumnBestFit SColumnBestFit;
-struct SColumnBestFit
-{
-    BSTNode n;
-    const SColumn *scol;
-    VTypedecl td;
-    uint32_t distance;
-};
-
-static
-rc_t VProdResolveBestColumn ( const VProdResolve *self,
-    VProduction **out, const BSTree *ordered, bool alt )
-{
-    rc_t rc;
-
-    /* walk all candidtes */
-    const SColumnBestFit *n = ( const SColumnBestFit* ) BSTreeFirst ( ordered );
-    for ( rc = 0; n != NULL; n = ( const SColumnBestFit* ) BSTNodeNext ( & n -> n ) )
-    {
-        /* look for open column */
-        const SColumn *scol = n -> scol;
-
-        /* resolve the column as appropriate */
-        rc = VProdResolveColumn ( self, out, scol, alt );
-        if ( rc != 0 || * out != NULL )
-            break;
-    }
-
-    return rc;
-}
-
-static
-int CC order_column ( const BSTNode *item, const BSTNode *n )
-{
-    const SColumnBestFit *a = ( const SColumnBestFit* ) item;
-    const SColumnBestFit *b = ( const SColumnBestFit* ) n;
-    if ( a -> distance < b -> distance )
-        return -1;
-    if ( a -> distance > b -> distance )
-        return 1;
-    return VCtxIdCmp ( & a -> scol -> cid, & b -> scol -> cid );
-}
-
-static
-rc_t VProdResolveColExpr ( const VProdResolve *self, VProduction **out,
-    VFormatdecl *fd, const SSymExpr *x, bool casting )
-{
-    rc_t rc;
-    const SNameOverload *sname;
-    const KSymbol *sym = x -> _sym;
-
-    BSTree ordered;
-    uint32_t i, count;
-    SColumnBestFit buff [ 16 ], * nodes = buff;
-
-    /* fail if "fd" has a format */
-    if ( fd -> fmt != 0 )
-    {
-        PLOGMSG ( klogWarn, ( klogWarn, "illegal cast of column '$(name)'"
-                   , "name=%.*s"
-                   , ( int ) sym -> name . size
-                   , sym -> name . addr ));
-        return 0;
-    }
-
-    /* allocate nodes for indexing columns */
-    sname = sym -> u . obj;
-    count = VectorLength ( & sname -> items );
-    if ( count > sizeof buff / sizeof buff [ 0 ] )
-    {
-        nodes = malloc ( sizeof * nodes * count );
-        if ( nodes == NULL )
-            return RC ( rcVDB, rcProduction, rcResolving, rcMemory, rcExhausted );
-    }
-
-    /* insert columns into ordered tree */
-    BSTreeInit ( & ordered );
-    for ( i = VectorStart ( & sname -> items ), count += i; i < count; ++ i )
-    {
-        /* get SColumn */
-        nodes [ i ] . scol = ( const void* ) VectorGet ( & sname -> items, i );
-
-        /* perform type cast and measure distance */
-        if ( casting ?
-             VTypedeclCommonAncestor ( & nodes [ i ] . scol -> td, self -> schema,
-                 & fd -> td, & nodes [ i ] . td, & nodes [ i ] . distance ) :
-             VTypedeclToTypedecl ( & nodes [ i ] . scol -> td, self -> schema,
-                 & fd -> td, & nodes [ i ] . td, & nodes [ i ] . distance ) )
-        {
-            BSTreeInsert ( & ordered, & nodes [ i ] . n, order_column );
-        }
-    }
-
-    /* try to resolve each in order */
-    rc = VProdResolveBestColumn ( self, out, & ordered, x -> alt );
-
-    if ( nodes != buff )
-        free ( nodes );
-
-    return rc;
-}
-
-
-/* PhysExpr
- */
-rc_t VProdResolveSPhysMember ( const VProdResolve *self,
-    VProduction **out, const SPhysMember *smbr )
-{
-    rc_t rc;
-    VCursor *curs;
-    VPhysical *phys;
-
-    curs = self -> curs;
-    phys = VCursorCacheGet ( & curs -> phys, & smbr -> cid );
-    if ( phys != NULL )
-    {
-        /* this guy should be readable, but it is not guaranteed */
-        if ( phys != FAILED_PHYSICAL )
-            * out = phys -> out;
-        return 0;
-    }
-
-    /* pre-fail */
-    rc = VCursorCacheSet ( & curs -> phys, & smbr -> cid, FAILED_PHYSICAL );
-    if ( rc == 0 )
-    {
-        /* create physical object */
-        rc = VPhysicalMake ( & phys, curs, smbr );
-        if ( rc == 0 )
-        {
-            /* build physical */
-            rc = VProdResolvePhysical ( self, phys );
-            if ( rc == 0 && phys -> out > FAILED_PRODUCTION && phys -> b2p > FAILED_PRODUCTION )
-            {
-                /* set success */
-                void *ignore;
-                rc = VCursorCacheSwap ( & curs -> phys, & smbr -> cid, phys, & ignore );
-                if ( rc == 0 )
-                {
-                    * out = phys -> out;
-                    return 0;
-                }
-            }
-            if ( GetRCState ( rc ) == rcUndefined )
-                rc = 0;
-
-            VPhysicalWhack ( phys, NULL );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t VProdResolvePhysExpr ( const VProdResolve *self,
-    VProduction **out, const KSymbol *sym )
-{
-    if ( self -> chain == chainEncoding )
-    {
-        assert ( self -> curs -> read_only == false );
-        PLOGMSG ( klogWarn, ( klogWarn, "illegal access of physical column '$(name)'"
-                   , "name=%.*s"
-                   , ( int ) sym -> name . size
-                   , sym -> name . addr ));
-        return 0;
-    }
-
-    return VProdResolveSPhysMember ( self, out, sym -> u . obj );
-}
-
-
-/* FwdExpr
- *  handle a forwarded symbol in expression
- *  if the symbol is "virtual", check for its override
- *  map actual symbol type to expression handler
- */
-static
-rc_t VProdResolveFwdExpr ( const VProdResolve *self, VProduction **out,
-    VFormatdecl *fd, const SSymExpr *x, bool casting )
-{
-    /* virtual names that appear in parent table
-       expressions may be overridden in children */
-    const KSymbol *sym = x -> _sym;
-    if ( sym -> type == eVirtual )
-    {
-        /* most derived table class */
-        const STable *stbl = self -> stbl;
-        const KSymbol *sym2 = sym;
-        
-        sym = STableFindOverride ( stbl, ( const VCtxId* ) & sym -> u . fwd );
-        if ( sym == NULL )
-        {
-            PLOGMSG ( klogWarn, ( klogWarn, "virtual reference '$(fwd)' not found in overrides table"
-                       , "fwd=%.*s"
-                       , ( int ) sym2 -> name . size
-                       , sym2 -> name . addr ));
-            return 0;
-        }
-    }
-
-    /* test symbol type */
-    switch ( sym -> type )
-    {
-    case eProduction:
-        return VProdResolveProdExpr ( self, out, sym );
-    case ePhysMember:
-        return VProdResolvePhysExpr ( self, out, sym );
-    case eColumn:
-        return VProdResolveColExpr ( self, out, fd, x, casting );
-    }
-
-    VDB_DEBUG (("%s: unresolved forward reference '%S'",
-                 __func__, &sym->name));
-
-    return 0;
-}
-
-/* ResolveExpr
- *  resolves expression and returns resulting production object
- *
- *  "out" [ IN/OUT, INITIALLY NULL ] - return parameter for production.
- *  assmed to be preset to NULL on input.
- *  invalid on output with non-zero return code
- *  non-NULL on successful resolution with zero return code
- *
- *  "fd" [ IN/OUT ] - resultant type of assignment expression
- *  on input gives acceptance criteria, i.e. a fmtdecl, typeset or wildcard
- *  invalid on output with non-zero return code or NULL "out"
- *  otherwise, gives actual assigned type on output
- *
- *  "casting" [ IN ] - true if performing explicit type casting
- *  see VProdResolveCastExpr for rules
- *
- *  "desc" [ OUT, NULL OKAY ] - resultant type description of "out"
- *  invalid on non-zero return or NULL "out"
- *  contains description of fd->td on success
- *
- *  "cache" [ IN ] - modifiable vector of VProductions by id within
- *  a given scope: table or script function.
- *
- *  "param" [ IN, NULL OKAY ] - modifiable vector of VProduction params
- *  by id - only valid within script function
- *
- *  "expr" [ IN ] - expression to be evaluated
- *
- *  returns non-zero if a non-recoverable error occurs, 0 otherwise.
- *  resolution is only successful on zero return code and non-NULL out.
- */
-#if _DEBUGGING
-#include "schema-dump.h"
-
-static size_t xsz;
-static char xbuffer [ 4096 ];
-
-static
-rc_t CC VProdResolveCapture ( void *data, const void *buffer, size_t size )
-{
-    if ( xsz + size >= sizeof xbuffer )
-    {
-        LOGERR (klogFatal, -1, "( xsz + size >= sizeof xbuffer )");
-        return -1;
-    }
-    memcpy ( & xbuffer [ xsz ], buffer, size );
-    xsz += size;
-    return 0;
-}
-
-static
-const char *VProdResolvePrintExpr ( const VProdResolve *self, const SExpression *expr )
-{
-    SDumper dumper;
-    SDumperInit ( & dumper, self -> schema, sdmPrint, VProdResolveCapture, NULL );
-
-    xsz = 0;
-    SDumperPrint ( & dumper, "%E", expr );
-    SDumperWhack ( & dumper );
-
-    xbuffer [ xsz ] = 0;
-    return xbuffer;
-}
-
-static const char ispaces [] = "                                                                "
-                               "                                                                ";
-static int indent_level = 0;
-#endif
-
-rc_t VProdResolveExpr ( const VProdResolve *self,
-    VProduction **out, VTypedesc *desc, VFormatdecl *fd,
-    const SExpression *expr, bool casting )
-{
-    rc_t rc;
-    VProduction *prod;
-
-    if ( expr == NULL )
-    {
-        /* report NULL expression, but don't die */
-        PLOGMSG ( klogWarn, ( klogWarn, "NULL expression in '$(tbl)' table schema"
-                   , "tbl=%.*s"
-                   , ( int ) self -> stbl -> name -> name . size
-                   , self -> stbl -> name -> name . addr ));
-        return 0;
-    }
-
-    prod = NULL;
-    *out = NULL;
-
-#if _DEBUGGING
-    ++ indent_level;
-    VDB_DEBUG (( "%*cresolving expression '%s'\n", indent_level, ' ',
-                 VProdResolvePrintExpr ( self, expr ) ));
-#endif
-
-    switch ( expr -> var )
-    {
-    case eParamExpr:
-        /* a script function is making reference to a parameter */
-        rc = VProdResolveParamExpr ( self, & prod, ( ( const SSymExpr* ) expr ) -> _sym );
-    assert (rc != -1);
-        break;
-
-    case eProdExpr:
-        /* return a simple production */
-        rc = VProdResolveProdExpr ( self, & prod, ( ( const SSymExpr* ) expr ) -> _sym );
-    assert (rc != -1);
-        break;
-
-    case eFwdExpr:
-        /* handle an implicit or overridden reference */
-        rc = VProdResolveFwdExpr ( self, & prod, fd, ( const SSymExpr* ) expr, casting );
-    assert (rc != -1);
-        break;
-
-    case eColExpr:
-        /* return a column production */
-        rc = VProdResolveColExpr ( self, & prod, fd, ( const SSymExpr* ) expr, casting );
-    assert (rc != -1);
-        break;
-
-    case ePhysExpr:
-        /* return a physical production */
-        rc = VProdResolvePhysExpr ( self, & prod, ( ( const SSymExpr* ) expr ) -> _sym );
-    assert (rc != -1);
-        break;
-
-    case eScriptExpr:
-        /* create a script function */
-        rc = VProdResolveScriptExpr ( self, & prod, fd, ( const SFuncExpr* ) expr );
-    assert (rc != -1);
-        break;
-
-    case eFuncExpr:
-        /* create an external function */
-        rc = VProdResolveFuncExpr ( self, & prod, fd, ( const SFuncExpr* ) expr );
-    assert (rc != -1);
-        break;
-
-    case eCastExpr:
-        /* perform an explicit cast */
-        rc = VProdResolveCastExpr ( self, & prod, ( const SBinExpr* ) expr );
-    assert (rc != -1);
-        break;
-        
-    case eCondExpr:
-        /* run left and right expressions in order until exit condition */
-        rc = VProdResolveExpr ( self, out, desc, fd, ( ( const SBinExpr* ) expr ) -> left, casting );
-    assert (rc != -1);
-        if ( ( rc == 0 && * out == NULL ) || self -> discover_writable_columns )
-        {
-            rc = VProdResolveExpr ( self, out, desc, fd, ( ( const SBinExpr* ) expr ) -> right, casting );
-    assert (rc != -1);
-        }
-#if _DEBUGGING
-        -- indent_level;
-#endif
-        return rc;
-
-    default:
-        /* report bad expression, but don't die */
-        PLOGMSG ( klogWarn, ( klogWarn, "unrecognized expression in '$(tbl)' table schema"
-                   , "tbl=%.*s"
-                   , ( int ) self -> stbl -> name -> name . size
-                   , self -> stbl -> name -> name . addr ));
-#if _DEBUGGING
-        -- indent_level;
-#endif
-        return 0;
-    }
-
-    /* guard against returns of NULL or FAILED_PRODUCTION */
-    if ( rc == 0 && prod > FAILED_PRODUCTION )
-    {
-        VDB_DEBUG ( ("%*cresolved expression  '%s'\n", indent_level, ' ', VProdResolvePrintExpr ( self, expr ) ) );
-
-        /* returned production must be on requested chain */
-        if ( ( prod -> chain & self -> chain ) == 0 )
-        {
-            rc = RC ( rcVDB, rcProduction, rcResolving, rcSchema, rcInconsistent );
-            VDB_DEBUG ( ( "%*cPRODUCTION RESOLVED ON WRONG FORK: %R\n", indent_level, ' ', rc ) );
-        }
-        else
-        {
-            /* fix uncommitted production chain */
-            if ( prod -> chain == chainUncommitted )
-                prod -> chain = self -> chain;
-
-            /* test for type compatibility - modifies "fd" */
-            if ( casting ?
-                 VFormatdeclCommonAncestor ( & prod -> fd, self -> schema, fd, fd, NULL ) :
-                 VFormatdeclToFormatdecl ( & prod -> fd, self -> schema, fd, fd, NULL ) )
-            {
-                /* if no type description is requested, we're done */
-                if ( desc == NULL )
-                    * out = prod;
-                else
-                {
-                    /* otherwise, create a type description */
-                    rc = VSchemaDescribeTypedecl ( self -> schema, desc, & fd -> td );
-    assert (rc != -1);
-                    if ( rc != 0 )
-                        VDB_DEBUG ( ( "%*cREQUESTED TYPE CANNOT BE DESCRIBED: %R\n", indent_level, ' ', rc ) );
-                    else
-                        * out = prod;
-                }
-            }
-            else
-            {
-#if _DEBUGGING
-                char from [ 128 ] = "", to [ 128 ] = "";
-                VTypedeclToText ( & prod -> fd . td, self -> schema, from, sizeof from );
-                VTypedeclToText ( & fd -> td, self -> schema, to, sizeof to );
-                VDB_DEBUG ( ( "%*cexpression '%s' cannot be %s from '%s' to '%s'\n"
-                              , indent_level, ' '
-                              , VProdResolvePrintExpr ( self, expr )
-                              , casting ? "cast" : "typed"
-                              , from
-                              , to
-                             )
-                    );
-#endif
-            }
-        }
-    }
-    else if ( rc != 0 )
-    {
-        VDB_DEBUG ( ( "failed to resolve expression '%s' prod %p %R\n", VProdResolvePrintExpr ( self, expr ), prod, rc ) );
-    }
-    else if ( prod == NULL )
-    {
-        VDB_DEBUG ( ( "expression '%s' was not resolved\n", VProdResolvePrintExpr ( self, expr ) ) );
-    }
-    else
-    {
-        VDB_DEBUG ( ( "expression '%s' returned FAILED_PRODUCTION\n", VProdResolvePrintExpr ( self, expr ) ) );
-    }
-
-#if _DEBUGGING
-    -- indent_level;
-#endif
-
-    return rc;
-}
-
-
-/* ResolveColumn
- *  resolves a column from read/validate expression
- */
-rc_t VProdResolveColumnRead ( const VProdResolve *self,
-    VProduction **out, const SColumn *scol )
-{
-    rc_t rc;
-    VFormatdecl fd;
-    const char *name;
-    VCursor *curs;
-    VColumn *vcol;
-
-    VDB_DEBUG ( ( "resolving column '%N' read expression.\n", scol -> name ) );
-
-    /* potential error if self is NULL */
-    curs = self -> curs;
-    if ( out == NULL )
-    {
-        rc =  RC(rcVDB, rcProduction, rcResolving, rcParam, rcNull);
-        VDB_DEBUG ( ( "result NULL for column '%N'; no output can be produced by '%s' rc %R\n",
-                      scol -> name, __func__, rc ) );
-        return rc;
-    }
-    
-    /* fetch the column */
-    vcol = VCursorCacheGet ( & curs -> col, & scol -> cid );
-    if ( vcol == NULL )
-    {
-        VDB_DEBUG ( ( "failed to fetch NULL for column '%N'; no output was produced by '%s'\n",
-                      scol -> name, __func__ ) );
-        return 0;
-    }
-
-    /* if the read production is in place, return it */
-    if ( vcol -> in != NULL )
-    {
-        if ( vcol -> in != FAILED_PRODUCTION )
-            * out = vcol -> in;
-        return 0;
-    }
-
-    /* pre-fail */
-    vcol -> in = FAILED_PRODUCTION;
-
-    /* production resolution works with fmtdecl */
-    fd . td = scol -> td;
-    fd . fmt = 0;
-
-    /* resolve the expression */
-    rc = VProdResolveExpr ( self, out, & vcol -> desc, & fd, scol -> read, false );
-    assert (rc != -1);
-
-    if ( rc != 0 || *out == NULL )
-        return rc;
-
-    /* repair incomplete column declarations */
-    if ( scol -> td . type_id == 0 )
-    {
-        if ( fd . td . type_id == 0 )
-        {
-            rc = RC ( rcVDB, rcColumn, rcResolving, rcType, rcUndefined );
-            VDB_DEBUG (("failed to repair incomplete declaration for column '%N' rc %R\n",
-                        scol -> name, rc));
-            return rc;
-        }
-        ( ( SColumn* ) scol ) -> td = fd . td;
-    }
-
-    /* create a simple prod to manage fd and desc */
-    name = scol -> name -> name . addr;
-    assert ( name [ scol -> name -> name . size ] == 0 );
-    rc = VSimpleProdMake ( out, self -> owned, self->curs, prodSimpleCast,
-        name, & fd, & vcol -> desc, NULL, * out, self -> chain );
-
-    assert (rc != -1);
-    if ( rc != 0 )
-    {
-        VDB_DEBUG (("failed to create a simple prod to manage fd and desc for column '%N', rc %R\n",
-                    scol -> name, rc));
-        return rc;
-    }
-
-    /* return column input - this is input to the column
-       that is intended to be read from the cursor */
-    vcol -> in = * out;
-    return rc;
-}
-
-/* ResolvePhysical
- *  resolves a physical column
- */
-rc_t VProdResolvePhysicalRead ( const VProdResolve *self, VPhysical *phys )
-{
-    rc_t rc;
-    VTypedesc desc;
-    VFormatdecl fd;
-    VProduction *prod;
-    VFunctionProd *bs;
-    VCursor *curs = self -> curs;
-
-    const char *name;
-    const SExpression *enc;
-    const SPhysMember *smbr;
-
-    /* a write cursor would have opened this already */
-    if ( curs -> read_only )
-    {
-        /* open the physical column for read */
-        rc = VPhysicalOpenRead ( phys,
-            ( VSchema* ) self -> schema, curs -> tbl );
-        if ( rc != 0 )
-        {
-            /* trying to open a column that doesn't exist
-               is not an error, but it didn't resolve */
-            if ( GetRCState ( rc ) == rcNotFound )
-                return 0;
-
-            return rc;
-        }
-    }
-
-    /* should be completely resolved */
-    smbr = phys -> smbr;
-    if ( smbr -> td . type_id == 0 )
-        return 0;
-
-    /* production name */
-    name = smbr -> name -> name . addr;
-
-    /* type information */
-    fd . td = smbr -> td;
-    fd . fmt = 0;
-    rc = VSchemaDescribeTypedecl ( self -> schema, & desc, & fd . td );
-    if ( rc != 0 )
-        return rc;
-
-    /* create output adapter */
-    rc = VPhysicalProdMake ( & prod, self -> owned,
-        curs, phys, prodPhysicalOut, name, & fd, & desc );
-    if ( rc != 0 )
-        return rc;
-
-    /* create byte-swap function with transparent type information */
-    rc = VFunctionProdMake ( & bs, self -> owned,
-        curs, prodFuncByteswap, name, & fd, & desc, chainDecoding );
-    if ( rc != 0 )
-        return rc;
-
-    /* set adapter as input to byte swap */
-    rc = VectorAppend ( & bs -> parms, NULL, prod );
-    if ( rc != 0 )
-        return rc;
-
-    /* take byte-swap function as output */
-    phys -> out = & bs -> dad;
-
-    /* NB - we now have byte-order native output via an adapter
-       it remains to create a decoding path for physical blobs */
-
-
-    /* create adapter */
-    rc = VPhysicalProdMake ( & prod, self -> owned,
-        curs, phys, prodPhysicalKCol, name, & fd, & desc );
-    if ( rc != 0 )
-        return rc;
-
-    /* create serial-to-blob stage */
-    rc = VSimpleProdMake ( & prod, self -> owned, self->curs,
-        prodSimpleSerial2Blob, name, & fd, & desc, NULL, prod, chainDecoding );
-    if ( rc != 0 )
-        return rc;
-
-    /* determine physical encoding */
-    enc = phys -> enc;
-    if ( enc == NULL )
-        enc = smbr -> type;
-
-    /* if unencoded */
-    if ( enc == NULL )
-        phys -> b2p = prod;
-    else
-    {
-        /* the adapter type should be undefined */
-        memset ( & prod -> fd, 0, sizeof prod -> fd );
-        prod -> desc . intrinsic_bits = prod -> desc . intrinsic_dim = 1;
-        prod -> desc . domain = 0;
-
-        /* create decoding production */
-        rc = VProdResolveEncodingExpr ( self, & phys -> b2p,
-            prod, ( const SPhysEncExpr* ) enc );
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/prod-expr.h b/libs/vdb/prod-expr.h
deleted file mode 100644
index 9fbf04a..0000000
--- a/libs/vdb/prod-expr.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_prod_expr_
-#define _h_prod_expr_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_cursor_priv_
-#include "cursor-priv.h"
-#endif
-
-#ifndef _h_prod_priv_
-#include "prod-priv.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct BSTree;
-struct KDlset;
-struct VSchema;
-struct SProduction;
-struct SPhysMember;
-struct SColumn;
-struct SExpression;
-struct SFuncExpr;
-struct SPhysEncExpr;
-struct VLinker;
-struct VPhysical;
-
-
-/*--------------------------------------------------------------------------
- * VProduction
- */
-
-/* symbol for failed production */
-#define FAILED_PRODUCTION ( ( VProduction* ) 1U )
-
-
-/*--------------------------------------------------------------------------
- * VTypedecl
- */
-
-/* Resolve
- *  ensures typedecl is completely resolved
- */
-rc_t VTypedeclResolve ( const VTypedecl *self,
-    struct VSchema const *schema, VTypedecl *resolved );
-
-
-/*--------------------------------------------------------------------------
- * VProdResolve
- */
-typedef struct VProdResolve VProdResolve;
-struct VProdResolve
-{
-    /* source of type-related information, functions and structures */
-    struct VSchema const *schema;
-
-    /* source of factory functions */
-    struct VLinker *ld;
-    struct KDlset const *libs;
-
-    /* schema of table being resolved */
-    struct STable const *stbl;
-
-    /* cursor containing columns, physicals, productions, triggers */
-    struct VCursor *curs;
-
-    /* vector of cached named productions */
-    VCursorCache *cache;
-
-    /* vector of owned productions */
-    Vector *owned;
-
-    /* which chain is being resolved
-       chainEncoding    - when going from input to physical
-       chainDecoding    - when pulling from physical to output
-       chainUncommitted - when resolving trigger and validation expressions
-    */
-    uint8_t chain;
-
-    /* true if within blob realm */
-    bool blobbing;
-
-    /* true if column resolution errors should NOT halt cursor open */
-    bool ignore_column_errors;
-
-    /* true if discovering writable columns */
-    bool discover_writable_columns;
-};
-
-
-/* ResolveColumn
- *  resolves a column using read/validate expression
- */
-rc_t VProdResolveColumn ( const VProdResolve *self,
-    VProduction **out, struct SColumn const *scol, bool alt );
-rc_t VProdResolveColumnRoot ( const VProdResolve *self,
-    VProduction **out, struct SColumn const *scol );
-rc_t VProdResolveColumnRead ( const VProdResolve *self,
-    VProduction **out, struct SColumn const *scol );
-
-
-/* ResolvePhysical
- *  resolves a physical column
- */
-rc_t VProdResolvePhysical ( const VProdResolve *self,
-    struct VPhysical *phys );
-rc_t VProdResolvePhysicalRead ( const VProdResolve *self,
-    struct VPhysical *phys );
-
-
-/* ResolveExpr
- *  resolves expression and returns resulting production object
- *
- *  "out" [ IN/OUT, INITIALLY NULL ] - return parameter for production.
- *  assmed to be preset to NULL on input.
- *  invalid on output with non-zero return code
- *  non-NULL on successful resolution with zero return code
- *
- *  "fd" [ IN/OUT ] - resultant type of assignment expression
- *  on input gives acceptance criteria, i.e. a fmtdecl, typeset or wildcard
- *  invalid on output with non-zero return code or NULL "out"
- *  otherwise, gives actual assigned type on output
- *
- *  "desc" [ OUT, NULL OKAY ] - resultant type description of "out"
- *  invalid on non-zero return or NULL "out"
- *  contains description of fd->td on success
- *
- *  "expr" [ IN ] - expression to be evaluated
- *
- *  "casting" [ IN ] - true if performing explicit type casting
- *  see VProdResolveCastExpr for rules
- *
- *  returns non-zero if a non-recoverable error occurs, 0 otherwise.
- *  resolution is only successful on zero return code and non-NULL out.
- */
-rc_t VProdResolveExpr ( const VProdResolve *self,
-    VProduction **out, VTypedesc *desc, VFormatdecl *fd,
-    struct SExpression const *expr, bool casting );
-
-/* resolves any type of SProduction */
-rc_t VProdResolveSProduction ( const VProdResolve *self, VProduction **out,
-    struct SProduction const *sprod );
-
-/* resolves an SPhysMember symbol */
-rc_t VProdResolveSPhysMember ( const VProdResolve *self,
-    VProduction **out, struct SPhysMember const *smbr );
-
-/* resolves a script function */
-rc_t VProdResolveScriptExpr ( const VProdResolve *self, VProduction **out,
-    const VFormatdecl *lval_fd, struct SFuncExpr const *expr );
-
-/* resolves an external function */
-rc_t VProdResolveFuncExpr ( const VProdResolve *self, VProduction **out,
-    const VFormatdecl *lval_fd, struct SFuncExpr const *expr );
-
-/* resolves physical encoding/decoding expr */
-rc_t VProdResolveEncodingExpr ( const VProdResolve *self, VProduction **out,
-    VProduction *in, struct SPhysEncExpr const *expr );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_prod_expr_ */
diff --git a/libs/vdb/prod-func.c b/libs/vdb/prod-func.c
deleted file mode 100644
index 173bd09..0000000
--- a/libs/vdb/prod-func.c
+++ /dev/null
@@ -1,894 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define TRACK_REFERENCES 0
-
-#include <vdb/extern.h>
-
-#define KONST const
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "linker-priv.h"
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "column-priv.h"
-#include "phys-priv.h"
-#undef KONST
-
-#include <vdb/manager.h>
-#include <vdb/cursor.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * VProdResolve
- */
-
-static
-rc_t SFunctionPush ( const SFunction *self, const VSchema *schema,
-    const SFuncExpr *expr, Vector *schema_prior, Vector *fact_prior,
-    const VFormatdecl *lval_fd, VFormatdecl *fd, VTypedesc *desc )
-{
-    rc_t rc;
-
-    /* validate input parameter counts against formal list */
-    uint32_t count = VectorLength ( & expr -> pfunc );
-    if ( count < self -> func . mand ) {
-        rc = RC ( rcVDB, rcFunction, rcResolving, rcParam, rcInsufficient );
-        PLOGERR ( klogWarn, ( klogWarn, rc,
-                   "function '$(func)' requires $(mand) params but got $(count)",
-                   "func=%.*s,mand=%u,count=%u",
-                   self->name->name.len, self->name->name.addr,
-                   self->func.mand,
-                   count
-                 ));
-    }
-    else
-    {
-        uint32_t end = VectorLength ( & self -> func . parms );
-        if ( end < count && ! self -> func . vararg ) {
-            rc = RC ( rcVDB, rcFunction, rcResolving, rcParam, rcExcessive );
-            PLOGERR ( klogWarn, ( klogWarn, rc,
-                       "function '$(func)' requires $(mand) params but got $(count)",
-                       "func=%.*s,mand=%u,count=%u",
-                       self->name->name.len, self->name->name.addr,
-                       end,
-                       count
-                     ));
-        }
-        /* ensure this is not an untyped function */
-        else if ( ! self -> validate && self -> rt == NULL )
-            rc = RC ( rcVDB, rcFunction, rcResolving, rcFunction, rcIncorrect );
-        else
-        {
-            /* bind schema params */
-            rc = SFunctionBindSchemaParms ( self, schema_prior, & expr -> schem );
-            if ( rc == 0 )
-            {
-                /* resolve return type */
-                if ( self -> validate )
-                {
-                    /* set type to "void" */
-                    fd -> td . type_id = fd -> td . dim = 1;
-                    fd -> fmt = 0;
-                    memset ( desc, 0, sizeof * desc );
-                    desc -> intrinsic_bits = 1;
-                    desc -> intrinsic_dim = 1;
-                }
-                else
-                {
-                    rc = STypeExprResolveAsFormatdecl
-                        ( ( const STypeExpr* ) self -> rt, schema, fd );
-                    if ( rc == 0 )
-                    {
-                        /* pick up cast from lval when return type is "any" or typeset */
-                        if ( fd -> td . type_id == 0 ||
-                             fd -> td . type_id >= 0x40000000 )
-                        {
-                            VFormatdecl cast;
-
-                            if ( VFormatdeclCommonAncestor ( fd, schema, lval_fd, & cast, NULL ) )
-                                * fd = cast;
-                            else
-                            {
-                                const KSymbol *fd_name = NULL;
-                                const KSymbol *lval_name = NULL;
-                            
-                                const SDatatype *dt = VSchemaFindTypeid ( schema, lval_fd -> td . type_id );
-                                if ( dt != NULL )
-                                    lval_name = dt -> name;
-                                
-                                dt = VSchemaFindTypeid ( schema, fd -> td . type_id );
-                                if ( dt != NULL )
-                                    fd_name = dt -> name;
-                                else
-                                {
-                                    const STypeset *ts = VSchemaFindTypesetid ( schema, fd -> td . type_id );
-                                    if ( ts != NULL )
-                                        fd_name = ts->name;
-                                }
-
-                                if ( lval_name != NULL && fd_name != NULL ) 
-                                {
-                                    PLOGMSG ( klogWarn, ( klogWarn,
-                                               "function '$(func)' could not resolve return type '$(rtype)' in '$(typeset)'",
-                                               "func=%.*s,rtype=%.*s,typeset=%.*s",
-                                               self->name->name.len, self->name->name.addr,
-                                               lval_name->name.len, lval_name->name.addr,
-                                               fd_name->name.len, fd_name->name.addr
-                                                 ));
-                                }
-                                else
-                                {
-                                    PLOGMSG ( klogInt, ( klogInt,
-                                               "function '$(func)' could not resolve return type or type names!",
-                                               "func=%.*s",
-                                               self->name->name.len, self->name->name.addr
-                                                 ));
-                                }
-                            }
-                        }
-
-                        /* pick up cast from lval when return dimension is "*" */
-                        else if ( fd -> td . dim == 0 )
-                        {
-                            VTypedesc lh_desc, rh_desc;
-                            /* since rh type is T' and is cast to lh type T,
-                               missing dimension is sizeof ( T[dim] ) / sizeof ( T' ) */
-                            rc = VSchemaDescribeTypedecl ( schema, & lh_desc, & lval_fd -> td );
-                            if ( rc == 0 )
-                            {
-                                VTypedecl rh_td;
-                                rh_td . type_id = fd -> td . type_id;
-                                rh_td . dim = 1;
-                                rc = VSchemaDescribeTypedecl ( schema, & rh_desc, & rh_td );
-                                if ( rc == 0 )
-                                {
-                                    fd -> td . dim = VTypedescSizeof ( & lh_desc ) /
-                                        VTypedescSizeof ( & rh_desc );
-
-                                    /* force dimension "*" to be at least 1 */
-                                    if ( fd -> td . dim == 0 )
-                                        fd -> td . dim = 1;
-                                }
-                            }
-                        }
-
-                        /* evaluate type description */
-                        rc = VSchemaDescribeTypedecl ( schema, desc, & fd -> td );
-                    }
-                }
-                 
-                if ( rc == 0 )
-                {
-                    /* bind factory params */
-                    rc = SFunctionBindFactParms ( self, fact_prior, & expr -> pfact );
-                    if ( rc == 0 )
-                        return 0;
-                }
-
-                SFunctionRestSchemaParms ( self, schema_prior );
-            }
-        }
-    }
-
-    LOGERR ( klogWarn, rc, "failed to resolve function expression" );
-    return rc;
-}
-
-static
-void SFunctionPop ( const SFunction *self, Vector *schema_prior, Vector *fact_prior )
-{
-    SFunctionRestFactParms ( self, fact_prior );
-    SFunctionRestSchemaParms ( self, schema_prior );
-}
-
-static
-rc_t VProdResolveFuncParamExpr ( const VProdResolve *self, Vector *out,
-    VFormatdecl *fd, const SExpression *expr, const SProduction *sprod )
-{
-    /* Create a production to resolve the expression; also set its
-     * type description */
-    VTypedesc desc;
-    VProduction *prod = NULL;
-    rc_t rc = VProdResolveExpr ( self, & prod, & desc, fd, expr, false );
-    if ( rc == 0 )
-    {
-        if ( prod == NULL )
-            rc = RC ( rcVDB, rcFunction, rcResolving, rcProduction, rcIncomplete );
-        else
-        {
-            bool control;
-            const char *name;
-
-            if ( sprod == NULL )
-            {
-                control = false;
-                name = "vararg";
-            }
-            else
-            {
-                control = sprod -> control;
-                name = sprod -> name -> name . addr;
-                assert ( name [ sprod -> name -> name . size ] == 0 );
-            }
-
-            rc = VSimpleProdMake ( & prod, self -> owned, self-> curs,
-                prodSimpleCast, name,fd, & desc, NULL, prod, self -> chain);
-            if ( rc == 0 )
-            {
-                prod -> control = control;
-                rc = sprod ?
-                    VectorSet ( out, prod -> cid . id = sprod -> cid . id, prod ):
-                    VectorAppend ( out, & prod -> cid . id, prod );
-                if ( rc != 0 )
-                    VProductionWhack ( prod, self -> owned );
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t VProdResolveValidateFuncParams ( const VProdResolve *self, Vector *out,
-    const SFormParmlist *formal, const Vector *expr )
-{
-    rc_t rc;
-    VFormatdecl fd;
-    const SProduction *sprod;
-
-    uint32_t count = VectorLength ( expr );
-    uint32_t end = VectorLength ( & formal -> parms );
-    VectorInit ( out, 0, count );
-
-    /* formal param count must be 2 */
-    assert ( end == 2 );
-
-    /* input param count must equal formals */
-    if ( count != end )
-    {
-        if ( count > end )
-            return RC ( rcVDB, rcFunction, rcResolving, rcParam, rcExcessive );
-        return RC ( rcVDB, rcFunction, rcResolving, rcParam, rcInsufficient );
-    }
-
-    /* resolve production type */
-    sprod = ( const void* ) VectorGet ( & formal -> parms, 0 );
-    rc = STypeExprResolveAsFormatdecl
-        ( ( const STypeExpr* ) sprod -> fd, self -> schema, & fd );
-    if ( rc == 0 )
-    {
-        /* bring in source parameter */
-        const SExpression *pexpr = VectorGet ( expr, 0 );
-
-        /* create copy of resolve block and set to write side */
-        VProdResolve pr = * self;
-        pr . chain = chainEncoding;
-
-        /* resolve source parameter */
-        rc = VProdResolveFuncParamExpr ( & pr, out, & fd, pexpr, sprod );
-        if ( rc == 0 )
-        {
-            /* comparison formal */
-            sprod = ( const void* ) VectorGet ( & formal -> parms, 1 );
-            rc = STypeExprResolveAsFormatdecl
-                ( ( const STypeExpr* ) sprod -> fd, self -> schema, & fd );
-            if ( rc == 0 )
-            {
-                /* bring in comparison parameter */
-                pexpr = VectorGet ( expr, 1 );
-
-                /* evaluate on read side */
-                pr . chain = chainDecoding;
-
-                /* resolve comparison parameter */
-                rc = VProdResolveFuncParamExpr ( & pr, out, & fd, pexpr, sprod );
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t VProdResolveFuncParams ( const VProdResolve *self, Vector *out,
-     const SFormParmlist *formal, const Vector *expr )
-{
-    rc_t rc;
-    VFormatdecl fd, ffd;
-
-    uint32_t i, count = VectorLength ( expr );
-    uint32_t end = VectorLength ( & formal -> parms );
-    VectorInit ( out, 0, count );
-
-    /* assert that there is at least one formal param
-       or that we don't have varargs */
-    assert ( end != 0 || count == 0 );
-
-    /* resolve named parameters */
-    for ( rc = 0, i = 0; rc == 0 && i < count && i < end; ++ i )
-    {
-        /* resolve production type */
-        const SProduction *sprod = ( const void* ) VectorGet ( & formal -> parms, i );
-        rc = STypeExprResolveAsFormatdecl
-            ( ( const STypeExpr* ) sprod -> fd, self -> schema, & fd );
-        if ( rc == 0 )
-        {
-            /* bring in parameter */
-            const SExpression *pexpr = VectorGet ( expr, i );
-            ffd = fd;
-            rc = VProdResolveFuncParamExpr ( self, out, & fd, pexpr, sprod );
-        }
-    }
-
-    /* resolve vararg parameters */
-    for ( ; rc == 0 && i < count; ++ i )
-    {
-        
-        const SExpression *pexpr = VectorGet ( expr, i );
-
-#if 0
-        /* use type "any" */
-        memset ( & fd, 0, sizeof fd );
-#else
-        /* use last formal type */
-        fd = ffd;
-#endif
-
-        rc = VProdResolveFuncParamExpr ( self, out, & fd, pexpr, NULL );
-    }
-
-    return rc;
-}
-
-rc_t VProdResolveScriptExpr ( const VProdResolve *self,
-    VProduction **out, const VFormatdecl *lval_fd, const SFuncExpr *expr )
-{
-    const SFunction *func = expr -> func;
-
-    VTypedesc desc;
-    VFormatdecl fd;
-    Vector schema_prior, fact_prior;
-    rc_t rc = SFunctionPush ( func, self -> schema, expr,
-        & schema_prior, & fact_prior, lval_fd, & fd, & desc );
-    if ( rc == 0 )
-    {
-        Vector *inputs = malloc ( sizeof * inputs );
-        if ( inputs == NULL )
-            rc = RC ( rcVDB, rcVector, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = VProdResolveFuncParams ( self, inputs,
-                & func -> func, & expr -> pfunc );
-            if ( rc == 0 )
-            {
-                /* script name */
-                const char *name = expr -> func -> name -> name . addr;
-
-                /* by this time, we have bound all parameters */
-                VScriptProd *script;
-                rc = VScriptProdMake ( & script, self -> owned, self->curs,
-                    prodScriptFunction, name, & fd, & desc, self -> chain );
-                if ( rc == 0 )
-                {
-                    VCursorCache local;
-                    VCursorCacheInit ( & local, 0, 2 );
-
-                    rc = VectorAppend ( & local . cache, NULL, inputs );
-                    if ( rc == 0 )
-                    {
-                        /* create new structure */
-                        VProdResolve spr = * self;
-                        spr . cache = & local;
-                        spr . owned = & script -> owned;
-
-                        /* forget about the inputs */
-                        inputs = NULL;
-
-                        /* now evaluate the return expression */
-                        rc = VProdResolveExpr ( & spr, & script -> rtn, NULL, & fd,
-                            func -> u . script . rtn, false );
-                        if ( rc != 0 || script -> rtn == NULL )
-                            VProductionWhack ( & script -> dad, self -> owned );
-                        else
-                        {
-                            * out = & script -> dad;
-                        }
-                    }
-
-                    VCursorCacheWhack ( & local, NULL, NULL );
-                }
-            }
-            else if ( GetRCState ( rc ) == rcIncomplete )
-            {
-                /* reset errors when input parameters could not be resolved */
-                rc = 0;
-            }
-
-            if ( inputs != NULL )
-            {
-                VectorWhack ( inputs, NULL, NULL );
-                free ( inputs );
-            }
-        }
-
-        SFunctionPop ( func, & schema_prior, & fact_prior );
-    }
-
-    return rc;
-}
-
-static
-rc_t VFunctionProdMakeFactParms ( VFunctionProd *self, const VSchema *schema,
-    const SFormParmlist *pfact, VFactoryParams *fp, const SConstExpr **cxp )
-{
-    rc_t rc;
-    VTypedecl td;
-    uint32_t i, last = 0, count = fp -> argc;
-
-    for ( rc = 0, i = 0; rc == 0 && i < count; ++ i )
-    {
-        /* fetch the formal parameter, which can be NULL
-           when the factory parameters allow varargs */
-        const SIndirectConst *ic = ( const void* ) VectorGet ( & pfact -> parms, i );
-        if( ic == NULL ) {
-            assert( i != 0 );
-            /* just use the last parameter's type */
-            ic = ( const void* ) VectorGet ( & pfact -> parms, last );
-            assert(ic != NULL);
-        } else {
-            last = i;
-        }
-        /* TBD - nobody is using function pointer parameters yet */
-        if( ic -> td == NULL ) {
-            rc = RC ( rcVDB, rcFunction, rcConstructing, rcType, rcNull );
-            LOGERR ( klogFatal, rc, "function factory with function param" );
-            break;
-        }
-        /* evaluate constant typedecl */
-        rc = STypeExprResolveAsTypedecl ( ( const STypeExpr* ) ic -> td, schema, & td );
-
-        if ( rc == 0 ) {
-            rc = VSchemaDescribeTypedecl ( schema, & fp -> argv [ i ] . desc, & td );
-        }
-        if ( rc == 0 )
-        {
-            /* evaluate constant expression */
-            rc = eval_const_expr ( schema, & td, ic -> expr, ( SExpression** ) & cxp [ i ] );
-            if ( rc == 0 )
-            {
-                /* catch undefined factory parameters from outer script */
-                if ( cxp [ i ] -> dad . var == eIndirectExpr )
-                {
-                    if ( fp -> argc > i )
-                        fp -> argc = i;
-                }
-                else if ( cxp [ i ] -> dad . var != eConstExpr )
-                {
-                    rc = -1;
-                    LOGERR (klogFatal, rc, "(cxp[i]->dad.var != eConstExpr)");
-                    break;
-                }
-                else if ( i >= fp -> argc )
-                {
-                    rc = -1;
-                    LOGERR (klogFatal, rc, "(i >= fp->argc)");
-                    break;
-                }
-                else
-                {
-                    fp -> argv [ i ] . data . u8 = cxp [ i ] -> u . u8;
-                    fp -> argv [ i ] . count = cxp [ i ] -> td . dim;
-                }
-            }
-        }
-    }
-
-    for ( ; i < count; ++ i )
-        cxp [ i ] = NULL;
-
-    return rc;
-}
-
-static
-rc_t VProdResolveInvokeFactory ( const VProdResolve *self, const VXfactInfo *info,
-    VFunctionProd *fprod, const VFactoryParams *cp, const VFunctionParams *dp,
-    VTransDesc *td, bool external )
-{
-    rc_t rc;
-    VFuncDesc desc;
-    memset ( & desc, 0, sizeof desc );
-    rc = ( * td -> factory ) ( td -> fself, info, & desc, cp, dp );
-    assert (rc != -1);
-
-    /* clobber returned context */
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcConstructing );
-
-    /* TBD - validate the returned value */
-    else if ( external &&
-        ( desc . variant == vftInvalid ||
-          desc . variant > vftBlob ||
-          desc . u . bf == NULL ) )
-    {
-        rc = RC ( rcVDB, rcFunction, rcConstructing, rcType, rcInvalid );
-    }
-    else
-    {
-        fprod -> fself = desc . self;
-        fprod -> whack = desc . whack;
-        fprod -> u . rf = desc . u . rf;
-        fprod -> dad . sub = ( uint8_t ) desc . variant;
-    }
-
-    return rc;
-}
-
-static
-rc_t VProdResolveBuildFuncParms ( const VProdResolve *self, const VXfactInfo *info,
-    VFunctionProd *fprod, const VFactoryParams *cp, VTransDesc *td, bool external )
-{
-    rc_t rc;
-    uint32_t i, count;
-
-    /* create a block of function parameters
-       start with data on the stack */
-    VFunctionParams fpbuff, * fp = & fpbuff;
-    count = VectorLength ( & fprod -> parms );
-    if ( count > sizeof fpbuff . argv / sizeof fpbuff . argv [ 0 ] )
-    {
-        fp = malloc ( sizeof fpbuff -
-                      sizeof fpbuff . argv +
-                      count * sizeof fpbuff . argv [ 0 ] );
-        if ( fp == NULL )
-            return RC ( rcVDB, rcFunction, rcResolving, rcMemory, rcExhausted );
-    }
-
-    fp -> argc = count;
-
-    /* copy types */
-    for ( i = 0; i < count; ++ i )
-    {
-        const VProduction *vprod = ( const void* ) VectorGet ( & fprod -> parms, i );
-        fp -> argv [ i ] . fd = vprod -> fd;
-        fp -> argv [ i ] . desc = vprod -> desc;
-    }
-
-    rc = VProdResolveInvokeFactory ( self, info, fprod, cp, fp, td, external );
-
-    if ( fp != & fpbuff )
-        free ( fp );
-
-    return rc;
-}
-
-static
-rc_t VProdResolveBuildFactParms ( const VProdResolve *self, const VXfactInfo *info,
-    VFunctionProd *fprod, const SFormParmlist *pfact, uint32_t count, VTransDesc *td, bool external )
-{
-    rc_t rc;
-    uint32_t i;
-
-    /* create a block of factory parameters
-       start with data on the stack */
-    VFactoryParams fpbuff, * fp = & fpbuff;
-    const SConstExpr *cxbuff [ 16 ], **cxp = cxbuff;
-
-    if ( count > sizeof fpbuff . argv / sizeof fpbuff . argv [ 0 ] )
-    {
-        fp = malloc ( sizeof fpbuff -
-                      sizeof fpbuff . argv +
-                      count * ( sizeof fpbuff . argv [ 0 ] + sizeof cxbuff [ 0 ] ) );
-
-        if ( fp == NULL )
-            return RC ( rcVDB, rcFunction, rcResolving, rcMemory, rcExhausted );
-
-        cxp = ( const SConstExpr** ) & fp -> argv [ count ];
-    }
-
-    fp -> argc = count;
-    fp -> align = 0;
-
-    rc = VFunctionProdMakeFactParms ( fprod, self -> schema, pfact, fp, cxp );
-    assert (rc != -1);
-    if ( rc == 0 )
-        rc = VProdResolveBuildFuncParms ( self, info, fprod, fp, td, external );
-    assert (rc != -1);
-
-    for ( i = 0; i < count; ++ i )
-        SExpressionWhack ( & cxp [ i ] -> dad );
-    if ( fp != & fpbuff )
-        free ( fp );
-
-    return rc;
-}
-
-rc_t VProdResolveFuncExpr ( const VProdResolve *self,
-    VProduction **out, const VFormatdecl *lval_fd, const SFuncExpr *expr )
-{
-    const SFunction *sfunc = expr -> func;
-    const char *name = sfunc -> name -> name . addr;
-
-    VXfactInfo info;
-    Vector schema_prior, fact_prior;
-    rc_t rc = SFunctionPush ( sfunc, self -> schema, expr,
-        & schema_prior, & fact_prior, lval_fd, & info . fdesc . fd, & info . fdesc . desc );
-    assert (rc != -1);
-    if ( rc == 0 )
-    {
-        /* locate factory function */
-        bool external;
-        VTransDesc td;
-        rc = VLinkerFindFactory ( self -> ld, self -> libs, & td, sfunc, & external );
-    assert (rc != -1);
-        if ( rc == 0 )
-        {
-            VFunctionProd *fprod;
-            rc = VFunctionProdMake ( & fprod, self -> owned,
-                self -> curs, vftInvalid, name, & info . fdesc . fd,
-                & info . fdesc . desc, self -> chain );
-    assert (rc != -1);
-            if ( rc == 0 )
-            {
-                if ( sfunc -> validate )
-                {
-                    rc = VProdResolveValidateFuncParams ( self, & fprod -> parms,
-                        & sfunc -> func, & expr -> pfunc );
-    assert (rc != -1);
-                }
-                else
-                {
-                    rc = VProdResolveFuncParams ( self, & fprod -> parms,
-                        & sfunc -> func, & expr -> pfunc );
-    assert (rc != -1);
-                }
-                if ( rc == 0 )
-                {
-                    info . schema = self -> schema;
-                    info . tbl = self -> curs -> tbl;
-                    info . mgr = info . tbl -> mgr;
-                    info . parms = (struct VCursorParams *) self -> curs;
-
-                    rc = VProdResolveBuildFactParms ( self, & info,
-                        fprod, & sfunc -> fact, VectorLength ( & expr -> pfact ),
-                        & td, external );
-    assert (rc != -1);
-                    if ( rc == 0 )
-                    {
-                        * out = & fprod -> dad;
-                    }
-                }
-
-                if ( rc != 0 )
-                {
-                    /* reset errors when input parameters could not be resolved
-                       or if function factory returned an error */
-                    if ( GetRCState ( rc ) == rcIncomplete ||
-                         ( GetRCTarget ( rc ) == rcFunction && GetRCContext ( rc ) == rcConstructing ) )
-                    {
-                        rc = 0;
-                    }
-
-                    VProductionWhack ( & fprod -> dad, self -> owned );
-                }
-            }
-        }
-        else
-        {
-            /* TBD - perhaps report what went wrong, but if function
-               could not be resolved, don't stop the whole process */
-            VDB_DEBUG (("failed to find function '%S' rc %R",
-                        &sfunc->name->name, rc));
-            rc = 0;
-        }
-        
-        SFunctionPop ( sfunc, & schema_prior, & fact_prior );
-    }
-
-    return rc;
-}
-
-
-/* resolves physical encoding/decoding expr */
-rc_t VProdResolveEncodingExpr ( const VProdResolve *self,
-    VProduction **out, VProduction *in, const SPhysEncExpr *expr )
-{
-    const SPhysical *sphys = expr -> phys;
-
-    /* bind schema and factory params */
-    Vector schema_prior;
-    rc_t rc = SPhysicalBindSchemaParms ( sphys, & schema_prior, & expr -> schem );
-    if ( rc == 0 )
-    {
-        Vector fact_prior;
-        rc = SPhysicalBindFactParms ( sphys, & fact_prior, & expr -> pfact );
-        if ( rc == 0 )
-        {
-            /* create single input param vector */
-            Vector *inputs = malloc ( sizeof * inputs );
-            if ( inputs == NULL )
-                rc = RC ( rcVDB, rcVector, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                VectorInit ( inputs, 0, 1 );
-                rc = VectorAppend ( inputs, NULL, in );
-                if ( rc == 0 )
-                {
-                    VFormatdecl fd;
-
-                    if ( self -> chain == chainEncoding )
-                        memset ( & fd, 0, sizeof fd );
-                    else
-                    {
-                        rc = STypeExprResolveAsFormatdecl
-                            ( ( const STypeExpr* ) sphys -> td, self -> schema, & fd );
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        VScriptProd *script;
-                        const char *name = sphys -> name -> name . addr;
-                        rc = VScriptProdMake ( & script, self -> owned, self->curs,
-                            prodScriptFunction, name, & fd, NULL, self -> chain );
-                        if ( rc == 0 )
-                        {
-                            /* create a production cache for the encoding */
-                            VCursorCache local;
-                            VCursorCacheInit ( & local, 0, 2 );
-
-                            rc = VectorAppend ( & local . cache, NULL, inputs );
-                            if ( rc == 0 )
-                            {
-                                const SFunction *func = ( self -> chain == chainEncoding ) ?
-                                    & sphys -> encode : & sphys -> decode;
-
-                                VProdResolve spr = * self;
-                                spr . cache = & local;
-                                spr . owned = & script -> owned;
-
-                                /* forget about input vector */
-                                inputs = NULL;
-
-                                /* now evaluate the return expression */
-                                rc = VProdResolveExpr ( & spr, & script -> rtn,
-                                    & script -> dad . desc, & script -> dad . fd,
-                                    func -> u . script . rtn, false );
-                                if ( rc != 0 || script -> rtn == NULL )
-                                    VProductionWhack ( & script -> dad, self -> owned );
-                                else
-                                {
-                                    * out = & script -> dad;
-                                }
-                            }
-
-                            VCursorCacheWhack ( & local, NULL, NULL );
-                        }
-                    }
-                
-                    if ( inputs != NULL )
-                    {
-                        VectorWhack ( inputs, NULL, NULL );
-                        free ( inputs );
-                    }
-                }
-            }
-            
-            SPhysicalRestFactParms ( sphys, & fact_prior );
-        }
-
-        SPhysicalRestSchemaParms ( sphys, & schema_prior );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * VFunctionProd
- */
-
-/* BuiltInComparison
- */
-rc_t VFunctionProdMakeBuiltInComp ( VProduction **prodp, Vector *owned,
-    const char *name,  const VProdResolve *resolve, VProduction *orig, VProduction *test )
-{
-    /* locate factory */
-    VTransDesc td;
-    rc_t rc = VLinkerFindNamedFactory ( resolve -> ld,
-        resolve -> libs, & td, "vdb:compare" );
-    if ( rc == 0 )
-    {
-        const VCursor *curs = resolve -> curs;
-
-        /* build factory params */
-        VFuncDesc fd;
-        VXfactInfo info;
-        VFactoryParams cp;
-        VFunctionParams dp;
-
-        info . schema = curs -> schema;
-        info . tbl  = curs -> tbl;
-        info . mgr = curs -> tbl -> mgr;
-	info . parms = (struct VCursorParams*)curs;
-        info . fdesc . fd = orig -> fd;
-        info . fdesc . desc = orig -> desc;
-
-        memset ( & fd, 0, sizeof fd );
-
-        /* TBD - fill out % or epsilon for fp compare */
-        cp . argc = 0;
-
-        dp . argc = 2;
-        dp . argv [ 0 ] . desc = orig -> desc;
-        dp . argv [ 0 ] . fd = orig -> fd;
-        dp . argv [ 1 ] . desc = test -> desc;
-        dp . argv [ 1 ] . fd = test -> fd;
-
-        /* invoke factory */
-        rc = ( * td . factory ) ( td . fself, & info, & fd, & cp, & dp );
-        if ( rc == 0 )
-        {
-            VFunctionProd *prod;
-            rc = VFunctionProdMake ( & prod, owned, curs,
-                fd . variant, name, & orig -> fd, & orig -> desc, chainDecoding );
-            if ( rc == 0 )
-            {
-                prod -> fself = fd . self;
-                prod -> whack = fd . whack;
-                prod -> u . rf = fd . u . rf;
-
-                /* use orig and test as inputs */
-                rc = VectorAppend ( & prod -> parms, NULL, orig );
-                if ( rc == 0 )
-                {
-                    rc = VectorAppend ( & prod -> parms, NULL, test );
-                    if ( rc == 0 )
-                    {
-                        * prodp = & prod -> dad;
-                        return 0;
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/prod-priv.h b/libs/vdb/prod-priv.h
deleted file mode 100644
index 72feaa7..0000000
--- a/libs/vdb/prod-priv.h
+++ /dev/null
@@ -1,456 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_prod_priv_
-#define _h_prod_priv_
-
-#ifndef _h_vdb_extern_
-#include <vdb/extern.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_xform_priv_
-#include "xform-priv.h"
-#endif
-
-#ifndef _h_schema_priv_
-#include "schema-priv.h"
-#endif
-
-#ifndef _h_blob_priv_
-#include "blob-priv.h"
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define PROD_CACHE  	  2                   	/** default size of Production Cache ***/
-#define PROD_CACHE_MAX_EXTENTS  4		/** maximum multiplier for extending selected production caches when random io is detected ***/
-#define PROD_CACHE_WASH_ACCESS_THRESHOLD 10	/** number of accesses to wash part of the cache to trigger cache extension ***/
-						/** this is to determine random access pattern ***/
-
-/* IT IS A BAD IDEA TO USE EXTERN COLUMNS IN EXPRESSIONS
-   but it used to be okay in version 0 of the schema, so
-   it still occurs sometimes. We have allowed opening
-   columns from within schema but were afraid to alter the
-   row vector because this disturbs the serial allocation
-   of ids that could fool programmers trying to be clever.
-   Unfortunately, this resulted in a stray reference after
-   we shifted reference ownership to the row vector.
-
-   Setting this symbol to 1 will cause schema-opened columns
-   to be inserted into the row vector, disturbing the index
-   series passed out to clients, but not losing the reference. */
-#define OPEN_COLUMN_ALTERS_ROW 1
-
-#if _DEBUGGING
-#define PROD_NAME 1
-#endif
-
-#define VDB_DEBUG(msg) DBGMSG(DBG_VDB,DBG_FLAG(DBG_VDB_RESOLVE), msg )
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VBlob;
-struct VColumn;
-struct VPhysical;
-struct VProdResolve;
-struct VBlobMRUCacheCursorContext;
-
-
-/*--------------------------------------------------------------------------
- * VProduction
- */
-
-/* major production types */
-enum
-{
-    /* simple assignment from another production */
-    prodSimple,
-
-    /* function result and input parameters */
-    prodFunc,
-
-    /* a type of function with its own sub-productions */
-    prodScript,
-
-    /* an adapter production that references a VPhysical */
-    prodPhysical,
-
-    /* an adapter production referencing a VColumn */
-    prodColumn
-};
-
-/* read/write chain */
-enum
-{
-    chainInvalid,
-    chainEncoding,
-    chainDecoding,
-    chainUncommitted
-};
-
-#if ! VPRODUCTION_DECLARED_IN_XFORM_H
-typedef struct VProduction VProduction;
-#endif
-struct VProduction
-{
-#if PROD_NAME
-    const char *name;
-#endif
-#if PROD_CACHE
-    /* cached output */
-    struct VBlob *cache [ PROD_CACHE * PROD_CACHE_MAX_EXTENTS];
-    uint32_t cache_cnt_max;
-    uint32_t cache_cnt;
-    uint32_t cache_wash_access_cnt;
-#endif
-    /* format declaration and element type description */
-    VFormatdecl fd;
-    VTypedesc desc;
-
-    /* schema contextual id */
-    VCtxId cid;
-
-    /* owned vector id */
-    uint32_t oid;
-
-    /* production major variant ( enum see above ) */
-    uint8_t var;
-
-    /* production sub-variant ( specific to each major variant */
-    uint8_t sub;
-
-    /* indication of read/write chain */
-    uint8_t chain;
-
-    /* true if used as control parameter */
-    bool control;
-    /* is this production directly connected to a Column in a Cursor */
-    VBlobMRUCacheCursorContext cctx;
-};
-
-
-/* Make
- *  allocation and parent initialization
- *  called from the "Make" functions below
- *
- *  "prod" [ OUT ] - returned production
- *
- *  "size" [ IN ] - sizeof sub-type
- *
- *  "owned" [ IN ] - vector to contain productions
- *
- *  "var" [ IN ] - variant code, e.g. prodSimple, prodFunc
- *
- *  "sub" [ IN ] - sub-variant code, e.g. prodSimplePage2Blob
- *
- *  "name" [ IN, NULL OKAY ] - optional object name, derived
- *  from schema if possible
- *
- *  "fd" [ IN ] and "desc" [ IN ] - production type description
- *
- *  "cid" [ IN ] - contextual ( two-level ) id
- *
- *  "chain" [ IN ] - which chain(s) are supported
- *    chainEncoding    - when going from input to physical
- *    chainDecoding    - when pulling from physical to output
- *    chainUncommitted - when resolving trigger and validation expressions
- */
-rc_t VProductionMake ( VProduction **prod, Vector *owned, size_t size,
-    int var, int sub, const char *name, const VFormatdecl *fd,
-    const VTypedesc *desc, const VCtxId *cid, uint8_t chain );
-
-
-/* Whack
- *  virtual whacker
- *  calls variant specific "Destroy" function
- *  frees object
- *
- *  "owned" [ IN, NULL OKAY ] - a Vector owning production
- *  if not NULL, production will be removed from vector
- */
-void CC VProductionWhack ( void *item, void *owned );
-
-
-#if ! VPRODUCTION_DECLARED_IN_XFORM_H
-/* IdRange
- *  obtains intersection of all physical sources
- *
- *  "first" [ IN/OUT ] and "last" [ IN/OUT ] - range to intersect
- */
-rc_t VProductionColumnIdRange ( const VProduction *self,
-    int64_t *first, int64_t *last );
-rc_t VProductionPageIdRange ( VProduction *self,
-    int64_t id, int64_t *first, int64_t *last );
-
-/* RowLength
- *  get row length for a particular row
- */
-uint32_t VProductionRowLength ( const VProduction *self, int64_t row_id );
-
-/* FixedRowLength
- *  get fixed row length for entire column
- *  returns 0 if not fixed
- */
-uint32_t VProductionFixedRowLength ( const VProduction *self, int64_t row_id, bool ignore_self );
-
-#endif /* ! VPRODUCTION_DECLARED_IN_XFORM_H */
-
-/* ReadBlob
- *  fetch a blob containing at least the requested row
- *  returns a new reference
- */
-rc_t VProductionReadBlob ( const VProduction *self, struct VBlob **vblob, int64_t id , uint32_t cnt, struct VBlobMRUCacheCursorContext* cctx);
-
-/* IsStatic
- *  trace all the way to a physical production
- */
-rc_t VProductionIsStatic ( const VProduction *self, bool *is_static );
-
-
-/*--------------------------------------------------------------------------
- * VSimpleProd
- *  single input param
- */
-enum
-{
-    /* an implicit cast ( assignment ) or an explicit cast from schema */
-    prodSimpleCast,
-
-    /* perform blob class manipulation at page boundary */
-    prodSimplePage2Blob,
-
-    /* serialization interface at kcolumn boundary */
-    prodSimpleSerial2Blob,
-    prodSimpleBlob2Serial
-};
-
-typedef struct VSimpleProd VSimpleProd;
-struct VSimpleProd
-{
-    VProduction dad;
-    VProduction *in;
-    struct VCursor const *curs;
-};
-
-rc_t VSimpleProdMake ( VProduction **prod, Vector *owned,
-    struct VCursor const *curs,int sub, const char *name, const VFormatdecl *fd,
-    const VTypedesc *desc, const VCtxId *cid,
-    VProduction *in, uint8_t chain );
-
-#define VSimpleProdDestroy( self ) \
-    ( ( void ) 0 )
-
-/* Read
- *  return a blob containing row id
- */
-rc_t VSimpleProdRead ( VSimpleProd *self, struct VBlob **vblob, int64_t id, uint32_t cnt, struct VBlobMRUCacheCursorContext *cctx );
-
-
-/*--------------------------------------------------------------------------
- * VFunctionProd
- *  function input params are VProduction*
- *  extern C function pointer and self object
- */
-enum
-{
-    prodFuncExternal = vftLastFuncProto - 1,
-
-    /* internal types */
-    prodFuncBuiltInCompare,
-    prodFuncByteswap
-};
-
-typedef struct VFunctionProd VFunctionProd;
-struct VFunctionProd
-{
-    VProduction dad;
-
-    /* back-pointer to owning cursor
-       not a reference, not to be released */
-    struct VCursor const *curs;
-
-    /* object and optional destructor */
-    void *fself;
-    void ( CC * whack ) ( void *self );
-
-    /* runtime function */
-    union
-    {
-        /* public types */
-        VRowFunc rf;
-        VNonDetRowFunc ndf;
-        VArrayFunc af;
-        VFixedRowFunc pf;
-        VBlobFunc bf;
-
-        /* merge type */
-        VBlobFuncN bfN;
-        
-        /* compare type */
-        VBlobCompareFunc cf;
-
-        /* internal types */
-        void ( * bswap ) ( void*, const void*, uint64_t );
-
-    } u;
-
-    /* vector of VProduction input parameters */
-    Vector parms;
-
-    /* adaptive prefetch parameters */
-   int64_t start_id;
-   int64_t stop_id;
-};
-
-
-rc_t VFunctionProdMake ( VFunctionProd **prod, Vector *owned,
-    struct VCursor const *curs, int sub, const char *name,
-    const VFormatdecl *fd, const VTypedesc *desc, uint8_t chain );
-
-void VFunctionProdDestroy ( VFunctionProd *self );
-
-
-/* BuiltInComparison
- */
-rc_t VFunctionProdMakeBuiltInComp ( VProduction **prod, Vector *owned,
-    const char *name, struct VProdResolve const *resolve,
-    VProduction *orig, VProduction *test );
-
-
-/* Read
- */
-rc_t VFunctionProdRead ( VFunctionProd *self, struct VBlob **vblob, int64_t id , uint32_t cnt );
-
-
-/*--------------------------------------------------------------------------
- * VScriptProd
- *  function input params are VProduction*
- *  intermediate productions are also VProduction*
- */
-enum
-{
-    prodScriptFunction
-};
-
-typedef struct VScriptProd VScriptProd;
-struct VScriptProd
-{
-    VProduction dad;
-    VProduction *rtn;
-    Vector owned;
-    struct VCursor const *curs;
-};
-
-
-rc_t VScriptProdMake ( VScriptProd **prod, Vector *owned,
-    struct VCursor const *curs, int sub, const char *name, const VFormatdecl *fd,
-    const VTypedesc *desc, uint8_t chain );
-
-void VScriptProdDestroy ( VScriptProd *self );
-
-
-/* Read
- */
-rc_t VScriptProdRead ( VScriptProd *self,
-    struct VBlob **vblob, int64_t id, uint32_t cnt);
-
-
-/*--------------------------------------------------------------------------
- * VPhysicalProd
- *  adapts a VPhysical to VProduction
- */
-enum
-{
-    prodPhysicalOut,
-    prodPhysicalKCol
-};
-
-typedef struct VPhysicalProd VPhysicalProd;
-struct VPhysicalProd
-{
-    VProduction dad;
-    struct VPhysical *phys;
-};
-
-rc_t VPhysicalProdMake ( VProduction **prod, Vector *owned,
-    struct VCursor *curs, struct VPhysical *phys, int sub, const char *name,
-    const VFormatdecl *fd, const VTypedesc *desc );
-
-void VPhysicalProdDestroy ( VPhysicalProd *self );
-
-
-/* Read
- */
-rc_t VPhysicalProdRead ( VPhysicalProd *self,
-    struct VBlob **vblob, int64_t id, uint32_t cnt );
-
-rc_t VPhysicalProdColumnIdRange (const VPhysicalProd *self, int64_t *first, int64_t *last );
-
-uint32_t VPhysicalProdFixedRowLength(const VPhysicalProd *self, int64_t row_id );
-
-/*--------------------------------------------------------------------------
- * VColumnProd
- *  adapts a VColumn to VProduction
- */
-enum
-{
-    prodColumnOut
-};
-
-typedef struct VColumnProd VColumnProd;
-struct VColumnProd
-{
-    VProduction dad;
-    struct VColumn *col;
-};
-
-
-rc_t VColumnProdMake ( VProduction **prodp, Vector *owned,
-    struct VColumn *col, int sub, const char *name );
-
-void VColumnProdDestroy ( VColumnProd *self );
-
-
-/* Read
- */
-rc_t VColumnProdRead ( VColumnProd *self,
-    struct VBlob **vblob, int64_t id );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_prod_priv_ */
diff --git a/libs/vdb/prod.c b/libs/vdb/prod.c
deleted file mode 100644
index eb9730d..0000000
--- a/libs/vdb/prod.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "cursor-priv.h"
-#include "column-priv.h"
-#undef KONST
-
-#include <vdb/cursor.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * VProdResolve
- */
-
-/* ResolveColumn
- *  resolves a column using read expression
- */
-rc_t VProdResolveColumnRoot ( const VProdResolve *self,
-    VProduction **out, const SColumn *scol )
-{
-    rc_t rc = VProdResolveColumnRead ( self, out, scol );
-    if ( rc == 0 && * out <= FAILED_PRODUCTION )
-        return RC ( rcVDB, rcCursor, rcOpening, rcColumn, rcUndefined );
-    return rc;
-}
-
-rc_t VProdResolveColumn ( const VProdResolve *self,
-    VProduction **out, const SColumn *scol, bool alt )
-{
-    rc_t rc;
-    VColumn *vcol;
-    VCursor *curs = self -> curs;
-
-    if (alt) {
-        /* TODO: Generate warning message */
-        return RC(rcVDB, rcCursor, rcOpening, rcSchema, rcInvalid);
-    }
-    /* read-only cursor may add columns from schema */
-    vcol = VCursorCacheGet ( & curs -> col, & scol -> cid );
-    if ( vcol == NULL )
-    {
-        rc = VCursorMakeColumn ( curs, & vcol, scol );
-        if ( rc != 0 )
-            return rc;
-
-#if OPEN_COLUMN_ALTERS_ROW
-        rc = VectorAppend ( & curs -> row, & vcol -> ord, vcol );
-        if ( rc != 0 )
-        {
-            VColumnWhack ( vcol, NULL );
-            return rc;
-        }
-#endif
-        rc = VCursorCacheSet ( & curs -> col, & scol -> cid, vcol );
-        if ( rc != 0 )
-        {
-#if OPEN_COLUMN_ALTERS_ROW
-            void *ignore;
-            VectorSwap ( & curs -> row, vcol -> ord, NULL, & ignore );
-            vcol -> ord = 0;
-#endif
-            VColumnWhack ( vcol, NULL );
-            return rc;
-        }
-    }
-
-    /* resolve for read production */
-    return VProdResolveColumnRead ( self, out, scol );
-}
-
-rc_t VProdResolvePhysical ( const VProdResolve *self, struct VPhysical *phys )
-{
-    return VProdResolvePhysicalRead ( self, phys );
-}
-
-/*--------------------------------------------------------------------------
- * VColumnProd
- *  message redirect to VColumn
- */
-
-rc_t VColumnProdMake ( VProduction **prodp, Vector *owned,
-    VColumn *col, int sub, const char *name )
-{
-    return RC ( rcVDB, rcColumn, rcReading, rcSchema, rcInvalid );
-}
-
-void VColumnProdDestroy ( VColumnProd *self )
-{
-}
-
-/* Read
- */
-rc_t VColumnProdRead ( VColumnProd *self, struct VBlob **vblob, int64_t id )
-{
-    return RC ( rcVDB, rcColumn, rcReading, rcSchema, rcInvalid );
-}
diff --git a/libs/vdb/range-validate.c b/libs/vdb/range-validate.c
deleted file mode 100644
index 9585c64..0000000
--- a/libs/vdb/range-validate.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include "xform-priv.h"
-#include "blob.h"
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef union {
-    /* integer */
-    int8_t i8[2];
-    int16_t i16[2];
-    int32_t i32[2];
-    int64_t i64[2];
-    
-    /* unsigned integer */
-    uint8_t u8[2];
-    uint16_t u16[2];
-    uint32_t u32[2];
-    uint64_t u64[2];
-    
-    /* floating point */
-    float f32[2];
-    double f64[2];
-} self_t;
-
-#define VALID_FUNC(FUNC, TYPE, VAL) \
-static rc_t CC FUNC(void *Self, const VXformInfo *info, int64_t row_id, VBlob **rslt, uint32_t argc, const VBlob *argv[]) { \
-    const self_t *self = Self; \
-    TYPE lower = self->VAL[0]; \
-    TYPE upper = self->VAL[1]; \
-    const TYPE *src = argv[0]->data.base; \
-    unsigned i; \
-    uint64_t n = argv[0]->data.elem_count; \
-\
-    for (i = 0; i != n; ++i) { \
-        TYPE val = src[i]; \
-\
-        if (val < lower || val > upper) \
-	    return RC(rcVDB, rcFunction, rcExecuting, rcConstraint, rcViolated); \
-    } \
-    *rslt = (VBlob *)argv[0]; \
-    (void)VBlobAddRef(*rslt); \
-    return 0; \
-}
-
-VALID_FUNC(valid_U8, uint8_t, u8)
-VALID_FUNC(valid_I8, int8_t, i8)
-VALID_FUNC(valid_U16, uint16_t, u16)
-VALID_FUNC(valid_I16, int16_t, i16)
-VALID_FUNC(valid_U32, uint32_t, u32)
-VALID_FUNC(valid_I32, int32_t, i32)
-VALID_FUNC(valid_U64, uint64_t, u64)
-VALID_FUNC(valid_I64, int64_t, i64)
-VALID_FUNC(valid_F32, float, f32)
-VALID_FUNC(valid_F64, double, f64)
-
-/* range_validate
- *  function < type T > T range_validate #1.0 < T lower, T upper > ( T in )
- */
-static
-void CC vfunc_free ( void * self )
-{
-    free (self);
-}
-
-VTRANSFACT_BUILTIN_IMPL(vdb_range_validate, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-
-    /* check types */
-    switch (info->fdesc.desc.domain) {
-        case vtdInt:
-        case vtdUint:
-        case vtdFloat:
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self == NULL)
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    
-    rslt->self = self;
-    rslt->whack = vfunc_free;
-    rslt->variant = vftBlobN;
-    
-    switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 8:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_I8;
-                    self->i8[0] = *cp->argv[0].data.i8;
-                    self->i8[1] = *cp->argv[1].data.i8;
-                    break;
-                case 16:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_I16;
-                    self->i16[0] = *cp->argv[0].data.i16;
-                    self->i16[1] = *cp->argv[1].data.i16;
-                    break;
-                case 32:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_I32;
-                    self->i32[0] = *cp->argv[0].data.i32;
-                    self->i32[1] = *cp->argv[1].data.i32;
-                    break;
-                case 64:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_I64;
-                    self->i64[0] = *cp->argv[0].data.i64;
-                    self->i64[1] = *cp->argv[1].data.i64;
-                    break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 8:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_U8;
-                    self->u8[0] = *cp->argv[0].data.u8;
-                    self->u8[1] = *cp->argv[1].data.u8;
-                    break;
-                case 16:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_U16;
-                    self->u16[0] = *cp->argv[0].data.u16;
-                    self->u16[1] = *cp->argv[1].data.u16;
-                    break;
-                case 32:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_U32;
-                    self->u32[0] = *cp->argv[0].data.u32;
-                    self->u32[1] = *cp->argv[1].data.u32;
-                    break;
-                case 64:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_U64;
-                    self->u64[0] = *cp->argv[0].data.u64;
-                    self->u64[1] = *cp->argv[1].data.u64;
-                    break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 32:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_F32;
-                    self->f32[0] = *cp->argv[0].data.f32;
-                    self->f32[1] = *cp->argv[1].data.f32;
-                    break;
-                case 64:
-                    VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = valid_F64;
-                    self->f64[0] = *cp->argv[0].data.f64;
-                    self->f64[1] = *cp->argv[1].data.f64;
-                    break;
-            }
-            break;
-    }
-    return rc;
-}
diff --git a/libs/vdb/redimension.c b/libs/vdb/redimension.c
deleted file mode 100644
index 3e22dfe..0000000
--- a/libs/vdb/redimension.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include "blob.h"
-
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "xform-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-typedef struct self_t {
-    uint32_t elem_bits;
-} self_t;
-
-static
-rc_t CC redimension_drvr(
-                      void *Self,
-                      const VXformInfo *info,
-                      int64_t row_id,
-                      VBlob **rslt,
-                      uint32_t argc, const VBlob *argv[]
-) {
-    rc_t rc;
-    const self_t *self = (const self_t *)Self;
-    const VBlob *src = argv[0];
-    VBlob *y;
-    
-    rc = VBlobNew(&y, src->start_id, src->stop_id, "redimension");
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferCast(&src->data, &y->data, self->elem_bits, false);
-    if (rc == 0) {
-        y->byte_order = src->byte_order;
-        PageMapAddRef(y->pm = src->pm);
-	y->pm->optimized = eBlobPageMapOptimizedFailed; /** pagemap is no longer valid; prevent optimization ***/
-        BlobHeadersAddRef(y->headers = src->headers);
-        
-        *rslt = y;
-        return 0;
-    }
-	return rc;
-}
-static
-void CC vfunc_free ( void * self )
-{
-    free ( self );
-}
-
-#include <stdio.h>
-
-VTRANSFACT_BUILTIN_IMPL(vdb_redimension, 1, 0, 0) (
-                                           const void *Self,
-                                           const VXfactInfo *info,
-                                           VFuncDesc *rslt,
-                                           const VFactoryParams *cp,
-                                           const VFunctionParams *dp
-) {
-    self_t *self;
-    
-    self = malloc(sizeof(*self));
-    if (self) {
-        self->elem_bits = VTypedescSizeof(&info->fdesc.desc);
-        
-        rslt->self = self;
-        rslt->whack = vfunc_free;
-        rslt->variant = vftBlobN;
-        VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = redimension_drvr;
-        return 0;
-    }
-    return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/vdb/report-vdb.c b/libs/vdb/report-vdb.c
deleted file mode 100644
index a231dd7..0000000
--- a/libs/vdb/report-vdb.c
+++ /dev/null
@@ -1,856 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/report.h> /* ReportInit */
-#include <klib/time.h> /* KTime */
-#include <klib/namelist.h> /* KNamelistRelease */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/klib-priv.h> /* ReportFuncs */
-
-#include <vdb/report.h> /* ... */
-#include <vdb/manager.h> /* VDBManagerVersion */
-#include <vdb/vdb-priv.h> /* VTableOpenKTableRead */
-#include <vdb/database.h> /* VDatabaseRelease */
-#include <vdb/table.h> /* VTableOpenParentRead */
-#include <vdb/dependencies.h> /* VDBDependenciesRelease */
-
-#include <kdb/kdb-priv.h> /* KDatabaseGetPath */
-#include <kdb/manager.h> /* kptDatabase */
-#include <kdb/database.h> /* KDatabaseRelease */
-#include <kdb/table.h> /* KTableRelease */
-
-#include <kfs/dyload.h> /* KDyld */
-#include <kfs/file.h> /* KFileRead */
-#include <kfs/nullfile.h> /* KFileMakeNullUpdate */
-#include <kfs/md5.h> /* KMD5SumFmt */
-
-#include <atomic.h>
-
-#include <stdarg.h> /* va_start */
-#include <stdio.h> /* sprintf */
-#include <stdlib.h> /* malloc */
-#include <string.h> /* memset */
-#include <limits.h> /* PATH_MAX */
-#include <assert.h>
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-/*
- * An unrecoverable error happened.
- * We can help to solve it
- * by reporting information about known application execution environment.
- */
-
-typedef struct Report {
-    const VDBManager* mgr;
-    const VDatabase* db;
-    const VTable* table;
-} Report;
-
-static Report *report_singleton;
-
-static rc_t CC ReportRelease ( void )
-{
-    rc_t rc = 0;
-    Report *prev_report, *cur_report;
-
-    cur_report = report_singleton;
-    do
-    {
-        prev_report = cur_report;
-        cur_report = atomic_test_and_set_ptr ( ( void* volatile* ) & report_singleton, NULL, prev_report );
-    }
-    while ( cur_report != prev_report );
-
-    if ( cur_report != NULL )
-    {
-        /* cleanup */
-        VTableRelease ( cur_report -> table );
-        VDatabaseRelease ( cur_report -> db );
-        VDBManagerRelease ( cur_report -> mgr );
-        memset ( cur_report, 0, sizeof * cur_report );
-    }
-
-    return rc;
-}
-
-static rc_t CC ReportObj(const ReportFuncs *f, uint32_t indent,
-    const char *path, bool *wasDbOrTableSet);
-static rc_t CC ReportSOFTWARE ( const ReportFuncs *f, uint32_t indent, const char *argv_0, const char *date, ver_t tool_ver );
-
-static rc_t ReportGet(Report** self)
-{
-    rc_t rc = 0;
-
-    static bool latch;
-    if ( ! latch )
-    {
-        static Report self;
-
-        rc = ReportInitVDB ( ReportObj, ReportSOFTWARE, ReportRelease );
-        if ( rc == 0 )
-        {
-            report_singleton = & self;
-            latch = true;
-        }
-    }
-
-    * self = ( Report* ) report_singleton;
-
-    return rc;
-}
-
-#define report ( * f -> report )
-#define reportData ( * f -> reportData )
-#define reportData1 ( * f -> reportData1 )
-#define reportOpen ( * f -> reportOpen )
-#define reportOpen1 ( * f -> reportOpen1 )
-#define reportClose ( * f -> reportClose )
-#define reportClose1 ( * f -> reportClose1 )
-#define reportError ( * f -> reportError )
-#define reportErrorStr ( * f -> reportErrorStr )
-#define reportErrorStrImpl ( * f -> reportErrorStrImpl )
-#define reportErrorStrInt ( * f -> reportErrorStrInt )
-#define reportError3Str ( * f -> reportError3Str )
-
-static
-rc_t ReportBuild(const ReportFuncs *f, uint32_t indent, bool dynamic, const VDBManager* mgr)
-{
-    rc_t rc = 0;
-    if (!dynamic)
-    {   report(indent, "Build", 1, "static", 's', "true"); }
-    else {
-        KNamelist* list = NULL;
-        reportOpen(indent, "Build", 1, "static", 's', "false");
-        if (mgr) {
-            rc_t rc2 = VDBManagerListExternalSchemaModules(mgr, &list);
-            if (rc2 != 0) {
-                reportError
-                    (indent + 1, rc2, "VDBManagerListExternalSchemaModules");
-                if (rc == 0 && rc2 != 0)
-                {   rc = rc2; }
-            }
-            else {
-                uint32_t count = 0;
-                rc2 = KNamelistCount(list, &count);
-                if (rc2 != 0) {
-                    reportErrorStr(indent + 1, rc2, "KNamelistCount", "origin",
-                        "VDBManagerListExternalSchemaModules");
-                    if (rc == 0 && rc2 != 0)
-                    {   rc = rc2; }
-                }
-                else {
-                    int64_t i = 0;
-                    for (i = 0; i < count && rc2 == 0; ++i) {
-                        const char* name = NULL;
-                        rc2 = KNamelistGet(list, i, &name);
-                        if (rc2 != 0) {
-                            reportErrorStr(
-                                indent + 1, rc2, "KNamelistGet", "origin",
-                                "VDBManagerListExternalSchemaModules");
-                            if (rc == 0 && rc2 != 0)
-                            {   rc = rc2; }
-                        }
-                        else {
-                            report(indent + 1, "Module", 1, "name", 's', name);
-                        }
-                    }
-                }
-            }
-        }
-        RELEASE(KNamelist, list);
-        reportClose(indent, "Build");
-    }
-    return rc;
-}
-
-static rc_t VDBDependenciesReportDepend1(const VDBDependencies *self,
-    const ReportFuncs *f,
-    uint32_t count, uint32_t indent, bool toreport, uint32_t *missing)
-{
-    KDirectory *dir = NULL;
-    rc_t rc = 0;
-    uint32_t i = ~0;
-
-    assert(count && missing);
-
-    *missing = 0;
-
-    for (i = 0; i < count; ++i) {
-        bool isMissing = false;
-        bool local = false;
-        const char* seq_id = "";
-        const char* path = NULL;
-        rc = VDBDependenciesSeqId(self, &seq_id, i);
-        if (rc != 0 && toreport)
-            reportErrorStrInt(indent, rc, "VDBDependenciesSeqId",
-                "origin", "VDatabaseListDependencies", "idx", i);
-        if (rc == 0) {
-            rc = VDBDependenciesLocal(self, &local, i);
-            if (rc != 0 && toreport) {
-                reportErrorStrInt(indent, rc,
-                    "VDBDependenciesLocal",
-                    "origin", "VDatabaseListDependencies", "idx", i);
-            }
-        }
-        if (rc == 0) {
-            rc = VDBDependenciesPath(self, &path, i);
-            if (rc != 0 && toreport) {
-                reportErrorStrInt(indent, rc, "VDBDependenciesPath",
-                    "origin", "VDatabaseListDependencies", "idx", i);
-            }
-        }
-        if (rc == 0) {
-            if (!local && (path == NULL || path[0] == '\0')) {
-                isMissing = true;
-                ++*missing;
-            }
-            if (toreport) {
-                bool reported = false;
-                if (!isMissing && !local)  {
-                    rc_t rc = 0;
-                    bool readable = false;
-                    uint64_t size = ~0;
-                    KTime_t date = 0;
-                    bool ready = false;
-                    if (dir == NULL)
-                    {   rc = KDirectoryNativeDir(&dir); }
-                    assert(!local && path && path[0]);
-                    if (dir != NULL) {
-                        rc = KDirectoryFileSize(dir, &size, path);
-                        if (rc == 0)
-                        {   rc = KDirectoryDate(dir, &date, path); }
-                        if (rc == 0) {
-                            const KFile* f = NULL;
-                            rc = KDirectoryOpenFileRead(dir, &f, path);
-                            if (rc == 0) {
-                                char buffer[1024];
-                                size_t num_read = 0;
-                                size_t bsize =
-                                    size > sizeof buffer ? sizeof buffer : size;
-                                rc = KFileReadAll(f,
-                                    0, buffer, bsize, &num_read);
-                                if (rc == 0 && num_read != bsize) {
-                                    rc = RC(rcVDB, rcFile, rcReading,
-                                        rcBuffer, rcExcessive);
-                                }
-                                if (rc == 0)
-                                {   readable = true; }
-                            }
-                            KFileRelease(f);
-                        }
-                        if (rc == 0)
-                        {   ready = true; }
-                    }
-                    if (ready) {
-                        KTime kt;
-                        memset(&kt, 0, sizeof kt);
-                        KTimeLocal(&kt, date);
-                        report(indent, "Dependency", 7,
-                            "index", 'd', i,
-                            "seq_id", 's', seq_id,
-                            "local", 's', local ? "true" : "false",
-                            "path", 's', path,
-                            "size", 'u', size,
-                            "date", 'T', &kt,
-                            "readable", 's', readable ? "true" : "false");
-                        reported = true;
-                    }
-                    else {
-                        report(indent, "Dependency", 5,
-                            "index", 'd', i,
-                            "seq_id", 's', seq_id,
-                            "local", 's', local ? "true" : "false",
-                            "path", 's', path,
-                            "error", 'R', rc);
-                        reported = true;
-                    }
-                }
-                if (!reported) {
-                    report(indent, "Dependency", 4,
-                        "index", 'd', i,
-                        "seq_id", 's', seq_id,
-                        "local", 's', local ? "true" : "false",
-                        "path", 's', path == NULL ? "" : path);
-                }
-            }
-        }
-        if (rc != 0 && !toreport)
-        {   break; }
-    }
-
-    RELEASE(KDirectory, dir);
-
-    return rc;
-}
-
-static rc_t ReportDepend(const ReportFuncs *f,
-    uint32_t indent, const VDatabase* db)
-{
-    rc_t rc = 0;
-
-    const VDBDependencies* dep = NULL;
-
-    const char tag[] = "Dependencies";
-
-    assert(db);
-
-    reportOpen(indent, tag, 0);
-
-    rc = VDatabaseListDependencies(db, &dep, false);
-    if (rc != 0) {
-        reportError(indent + 1, rc, "VDatabaseListDependencies");
-    }
-    else {
-        uint32_t count = 0;
-        rc = VDBDependenciesCount(dep, &count);
-        if (rc != 0) { 
-            reportError(indent + 1, rc, "VDBDependenciesCount");
-        }
-        else {
-            uint32_t missing = 0;
-            const char tag[] = "List";
-            rc = VDBDependenciesReportDepend1(dep, f,
-                count, indent + 2, false, &missing);
-
-            if (rc == 0) {
-                reportOpen(indent + 1, tag, 2, "count", 'd', count,
-                    "missing", 'd', missing);
-            }
-            else {
-                reportOpen(indent + 1, tag, 1, "count", 'd', count);
-            }
-            
-            rc = VDBDependenciesReportDepend1(dep, f,
-                count, indent + 2, true, &missing);
-            reportClose(indent + 1, tag);
-        }
-    }
-
-    reportClose(indent, tag);
-
-    RELEASE(VDBDependencies, dep);
-
-    return rc;
-}
-
-typedef struct Total {
-    int64_t sz;
-    int64_t files;
-} Total;
-
-static rc_t CC visitor(const KDirectory* dir,
-    uint32_t type, const char* name, void* data)
-{
-    rc_t rc = 0;
-    Total* total = (Total*) data;
-    if (type & kptAlias)
-    {   return rc; }
-    assert(total);
-    switch (type) {
-        case kptFile: {
-            uint64_t size = 0;
-            rc = KDirectoryFileSize(dir, &size, name);
-            if (rc == 0) {
-                total->sz += size;
-            }
-            ++total->files;
-            break;
-        }
-        case kptDir: 
-            rc = KDirectoryVisit(dir, false, visitor, total, name);
-            break;
-        default:
-            rc = RC(rcVDB, rcDirectory, rcVisiting, rcType, rcUnexpected);
-            break;
-    }
-    return rc;
-}
-
-static rc_t ReportDir(const ReportFuncs *f, uint32_t indent, const KTable* tbl) {
-    rc_t rc = 0;
-    const KDirectory* dir = NULL;
-    if (tbl == NULL) {
-        report(indent, "Error", 1, "KTable" , 's', "NULL");
-        return rc;
-    }
-    rc = KTableOpenDirectoryRead(tbl, &dir);
-    if (rc != 0) {
-        reportError(indent, rc, "KTableOpenDirectoryRead");
-    }
-    else {
-        Total total;
-        memset(&total, 0, sizeof total);
-        rc = KDirectoryVisit(dir, false, visitor, &total, NULL);
-        report(indent, "Directory", 2,
-            "size", 'l', total.sz, "files", 'l', total.files);
-    }
-    RELEASE(KDirectory, dir);
-    return rc;
-}
-
-#define OBJ_OPEN(indent,count,path,type) reportOpen(indent, "Object", count, \
-    "path", 's', path, "type", 's', type
-#define OBJ_P_OPEN(indent,count,path,type,file_type) \
-    OBJ_OPEN(indent, count, path, type), "fs_type", 's', file_type
-
-#define OBJ(indent,path,type) \
-    OBJ_OPEN(indent, 2, path, type) )
-#define OBJ_P(indent,path,type,file_type) \
-    OBJ_P_OPEN(indent, 3, path, type, file_type) )
-#define OBJ_P_A(indent,path,type,file_type) \
-    OBJ_P_OPEN(indent, 4, path, type, file_type), "alias", 's', "true")
-#define OBJ_P_S(indent,path,type,file_type,size) \
-    OBJ_P_OPEN(indent, 4, path, type, file_type), "size", 'l', size)
-#define OBJ_P_S_A(indent,path,type,file_type,size) \
-    OBJ_P_OPEN(indent, 5, path, type, file_type), "size", 'l', size, \
-                                                  "alias", 's', "true")
-
-static rc_t CC ReportObj(const ReportFuncs *f, uint32_t indent,
-    const char *object, bool *wasDbOrTableSet)
-{
-    Report* self = NULL;
-    const char* fullpath = NULL;
-    const KDatabase* kdb = NULL;
-    const KTable* ktbl = NULL;
-    const VDatabase* db = NULL;
-    KPathType type = kptNotFound;
-    KPathType file_type = kptNotFound;
-    bool alias = false;
-    uint64_t size = 0;
-    bool size_unknown = true;
-
-    rc_t rc = ReportGet(&self);
-    assert(self);
-
-    if (wasDbOrTableSet != NULL) {
-        *wasDbOrTableSet = self->db != NULL || self->table != NULL;
-        return 0;
-    }
-
-    if (self->db != NULL) {
-        type = kptDatabase;
-        db = self->db;
-    }
-    else if (self->table != NULL) {
-        rc_t rc2 = VTableOpenParentRead(self->table, &db);
-        if (rc2)
-        {
-            if (rc == 0)
-            {
-                rc = rc2;
-            }
-        }
-        else if (!db)
-        {
-            type = kptTable;
-            rc2 = VTableGetKTableRead(self->table, &ktbl);
-            if (rc2)
-            {
-                if (rc == 0)
-                {
-                    rc = rc2;
-                }
-            }
-            else
-            {
-                rc2 = KTableGetPath(ktbl, &fullpath);
-            }
-        }
-    }
-
-    if (db) {
-        rc_t rc2 = VDatabaseOpenKDatabaseRead(db, &kdb);
-        type = kptDatabase;
-        if (rc2) {
-            if (rc == 0)
-            {   rc = rc2; }
-        }
-        else {
-            rc2 = KDatabaseGetPath(kdb, &fullpath);
-            if (rc2) {
-                if (rc == 0)
-                {   rc = rc2; }
-            }
-        }
-    }
-
-    if (fullpath) {
-        KDirectory* dir = NULL;
-        rc_t rc2 = KDirectoryNativeDir(&dir);
-        if (rc2) {
-            if (rc == 0)
-            {   rc = rc2; }
-        }
-        else {
-            file_type = KDirectoryPathType(dir, fullpath);
-            alias = file_type & kptAlias;
-            file_type &= ~kptAlias;
-            if (file_type == kptFile) {
-                rc2 = KDirectoryFileSize(dir, &size, fullpath);
-                if (rc2) {
-                    if (rc == 0)
-                    {   rc = rc2; }
-                }
-                else {  size_unknown = false; }
-            }
-        }
-        RELEASE(KDirectory, dir);
-    }
-
-    if (object || type != kptNotFound) {
-        const char* path
-            = fullpath ? fullpath : object ? object : "not set";
-        const char* stype = type == kptTable ? "table" : 
-            type == kptDatabase ? "database" : "unknown";
-        const char* sfile_type = file_type == kptFile ? "archive" : 
-            file_type == kptDir ? "dir" : "unexpected";
-
-        if (fullpath && !size_unknown) {
-            if (alias)
-            { OBJ_P_S_A(indent, path, stype, sfile_type, size); }
-            else
-            { OBJ_P_S  (indent, path, stype, sfile_type, size); }
-        }
-        else if (fullpath && size_unknown) {
-            if (alias)
-            { OBJ_P_A  (indent, path, stype, sfile_type); }
-            else
-            { OBJ_P    (indent, path, stype, sfile_type); }
-        }
-        else
-        {     OBJ      (indent, path, stype); }
-
-        if (!db)
-        {   db = self->db; }
-
-        if (db) {
-            rc_t rc2 = ReportDepend(f, indent + 1, db);
-            if (rc == 0)
-            {   rc = rc2; }
-        }
-        if (file_type == kptDir) {
-            rc_t rc2 = ReportDir(f, indent + 1, ktbl);
-            if (rc == 0)
-            {   rc = rc2; }
-        }
-
-        reportClose(indent, "Object");
-    }
-
-    if (db != self->db)
-    {   RELEASE(VDatabase, db); }
-    RELEASE(KTable, ktbl);
-    RELEASE(KDatabase, kdb);
-
-    return rc;
-}
-
-#ifdef _STATIC
-
-static
-rc_t md5(const char* path, uint8_t digest[16], const KDirectory* dir)
-{
-    const KFile* kf = NULL;
-    rc_t rc = KDirectoryOpenFileRead(dir, &kf, path);
-    if (rc == 0) {
-        KFile* fnull = NULL;
-        rc = KFileMakeNullUpdate(&fnull);
-        if (rc == 0) {
-            KMD5SumFmt* fmt = NULL;
-            rc = KMD5SumFmtMakeUpdate(&fmt, fnull);
-            if (rc == 0) {
-                const KFile* md5 = NULL;
-                rc = KFileMakeNewMD5Read(&md5, kf, fmt, path);
-                if (rc == 0) {
-                    uint64_t ps = 0;
-                    char buffer[512];
-                    size_t read = 0;
-                    do {
-                        rc = KFileRead(md5, ps, buffer, sizeof buffer, &read);
-                        if (rc == 0)
-                        {   ps += read; }
-                    } while (rc == 0 && read > 0);
-                    if (rc == 0) {
-                        bool bin;
-                        rc = KMD5SumFmtFind(fmt, path, digest, &bin);
-                    }
-                }
-                RELEASE(KFile, md5);
-            }
-            RELEASE(KMD5SumFmt, fmt);
-        }
-/*      RELEASE(KFile, fnull); fnull is released by KMD5SumFmt* fmt */
-    }
-/*  RELEASE(KFile, kf); kf is released by KFile* md5 */
-    return rc;
-}
-
-static
-rc_t ReportAlias(const ReportFuncs *f, uint32_t indent, const char* alias, const KDirectory* dir)
-{
-    char resolved[PATH_MAX + 1];
-    rc_t rc
-        = KDirectoryResolveAlias(dir, false, resolved, sizeof resolved, alias);
-    if (rc == 0) {
-        const char tag[] = "Alias";
-        uint32_t type = KDirectoryPathType(dir, resolved);
-        if (type & kptAlias) {
-            reportOpen(indent, tag, 1, "resolved", 's', resolved);
-            rc = ReportAlias(f, indent + 1, resolved, dir);
-            reportClose(indent, tag);
-        }
-        else
-        {   report(indent, tag, 1, "resolved", 's', resolved); }
-    }
-    return rc;
-}
-
-static rc_t ReportBinary(const ReportFuncs *f, uint32_t indent, const char* argv0) {
-    rc_t rc = 0;
-#ifdef _STATIC
-    KDyld *dyld = NULL;
-    assert(argv0);
-    rc = KDyldMake(&dyld);
-    if (rc != 0) {
-        reportError(indent + 1, rc, "KDyldMake");
-    }
-    else {
-        const KDirectory* dir = NULL;
-        rc = KDyldHomeDirectory(dyld, &dir, (fptr_t) ReportFinalize);
-        if (rc != 0) {
-            reportError(indent + 1, rc, "KDyldHomeDirectory");
-        }
-        else {
-            char binary[PATH_MAX + 1];
-            const char* name = strpbrk(argv0, "/\\");
-            const char* last_name = name;
-            if (last_name)
-            {   ++last_name; }
-            while (name) {
-                name = strpbrk(last_name, "/\\");
-                if (name) {
-                    last_name = name;
-                    if (last_name)
-                    {   ++last_name; }
-                }
-            }
-            name = last_name ? last_name : argv0;
-            rc = KDirectoryResolvePath(dir, true, binary, sizeof binary, name);
-            if (rc != 0) {
-                reportErrorStr(indent + 1, rc, "KDirectoryResolvePath",
-                    "origin", "KDyldHomeDirectory");
-            }
-            else {
-                bool found = false;
-                const char tag[] = "Binary";
-                const char* sType = NULL;
-                uint8_t digest[16];
-                uint32_t type = KDirectoryPathType(dir, binary);
-                switch (type & ~kptAlias) {
-                    case kptFile:
-                        sType = type & kptAlias ? "alias" : "file";
-                        found = true;
-                        break;
-                    case kptNotFound:
-                        sType = "not found";
-                        break;
-                    default:
-                        sType = "unknown";
-                        break;
-                }
-                if (found)
-                {   rc = md5(name, digest, dir); }
-                if (type & kptAlias) {
-                    if (found && rc == 0)  {
-                        reportOpen(indent, tag, 3, "path", 's', binary,
-                            "type", 's', sType, "md5", 'M', digest);
-                    }
-                    else {
-                        reportOpen(indent, tag, 2, "path", 's', binary,
-                            "type", 's', sType);
-                    }
-                    if (rc == 0 && type & kptAlias)
-                    {   rc = ReportAlias(f, indent + 1, name, dir); }
-                    reportClose(indent, tag);
-                }
-                else {
-                    if (found && rc == 0)  {
-                        report(indent, tag, 3, "path", 's', binary,
-                            "type", 's', sType, "md5", 'M', digest);
-                    }
-                    else {
-                        report(indent, tag, 2, "path", 's', binary,
-                            "type", 's', sType);
-                    }
-                }
-            }
-        }
-        RELEASE(KDirectory, dir);
-    }
-    RELEASE(KDyld, dyld);
-#endif
-    return rc;
-}
-#endif
-
-static rc_t CC ReportSOFTWARE(const ReportFuncs *f, uint32_t indent, const char *argv_0, const char *date, ver_t tool_ver ) {
-    rc_t rc = 0;
-
-    Report* self = NULL;
-    ReportGet(&self);
-    assert(self);
-
-    reportOpen(indent, "SOFTWARE", 0);
-
-    if (self->mgr) {
-        uint32_t version = 0;
-        rc = VDBManagerVersion(self->mgr, &version);
-        if (rc != 0) {
-            reportOpen(indent + 1, "Library", 0);
-            reportError(indent + 2, rc, "VDBManagerVersion");
-            reportClose(indent + 1, "Library");
-        }
-        else { report(indent + 1, "VDBLibrary", 1, "vers", 'V', version); }
-    }
-
-    {
-#ifdef _STATIC
-        bool dynamic = false;
-#else
-        bool dynamic = true;
-#endif
-
-        rc_t rc2 = ReportBuild(f, indent + 1, dynamic, self->mgr);
-        if (rc == 0 && rc2 != 0)
-        {   rc = rc2; }
-    }
-
-    if (argv_0) {
-        const char tag[] = "Tool";
-#ifdef _STATIC
-        reportOpen(indent + 1, tag, 3, "date", 's', date,
-                   "name", 's', argv_0, "vers", 'V', tool_ver);
-        {
-            rc_t rc2 = ReportBinary(f, indent + 2, argv_0);
-            if (rc == 0 && rc2 != 0)
-            {   rc = rc2; }
-        }
-        reportClose(indent + 1, tag);
-#else
-        report(indent + 1, tag, 3, "date", 's', date,
-                   "name", 's', argv_0, "vers", 'V', tool_ver);
-#endif
-    }
-
-    reportClose(indent, "SOFTWARE");
-
-    return rc;
-}
-
-
-
-/* SetVDBManager
- *  remember the manager in use
- */
-LIB_EXPORT rc_t CC ReportSetVDBManager(const VDBManager *mgr) {
-    rc_t rc = 0;
-
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-    {
-        rc = VDBManagerAddRef ( mgr );
-        if ( rc == 0 )
-        {
-            rc = VDBManagerRelease ( self -> mgr );
-            if ( rc != 0 )
-                VDBManagerRelease ( mgr );
-            else
-                self -> mgr = mgr;
-        }
-    }
-    return rc;
-}
-
-
-/* SetDatabase
- *  call it if you work with Database
- *
- *  "path" [ IN ] - path to the database that is used to access it
- */
-LIB_EXPORT rc_t CC ReportResetDatabase ( const char *path, const VDatabase *db )
-{
-    rc_t rc = 0;
-
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-    {
-        rc = VDatabaseAddRef ( db );
-        if ( rc == 0 )
-        {
-            VTableRelease ( self -> table ), self -> table = NULL;
-            VDatabaseRelease ( self -> db );
-            self -> db = db;
-        }
-    }
-
-    return rc;
-}
-
-
-/* SetTable
- *  call it if you work with Table
- *
- *  "path" [ IN ] - path to the table that is used to access it
- */
-LIB_EXPORT rc_t CC ReportResetTable ( const char *path, const VTable *tbl )
-{
-    rc_t rc = 0;
-
-    Report* self = NULL;
-    ReportGet(&self);
-    if ( self != NULL )
-    {
-        rc = VTableAddRef ( tbl );
-        if ( rc == 0 )
-        {
-            VDatabaseRelease ( self -> db ), self -> db = NULL;
-            VTableRelease ( self -> table );
-            self -> table = tbl;
-        }
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/row-id.c b/libs/vdb/row-id.c
deleted file mode 100644
index a5996f2..0000000
--- a/libs/vdb/row-id.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-static
-rc_t CC row_id_func ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData in [] )
-{
-    assert ( rslt -> data -> elem_bits == 64 );
-    if ( rslt -> data -> elem_count == 0 )
-    {
-        rc_t rc = KDataBufferResize ( rslt -> data, 1 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    * ( int64_t* ) rslt -> data -> base = row_id;
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_row_id, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> variant = vftNonDetRow;
-    rslt -> u . ndf = row_id_func;
-    return 0;
-}
diff --git a/libs/vdb/row-len.c b/libs/vdb/row-len.c
deleted file mode 100644
index e2a6484..0000000
--- a/libs/vdb/row-len.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include "xform-priv.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-static
-rc_t CC row_len_func ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData in[] )
-{
-    assert ( rslt -> data -> elem_bits == 32 );
-    if ( rslt -> data -> elem_count == 0 )
-    {
-        rc_t rc = KDataBufferResize ( rslt -> data, 1 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* for the moment row length are 32-bit */
-    * ( uint32_t* ) rslt -> data -> base = (uint32_t)in [ 0 ] . u . data . elem_count;
-    rslt -> elem_count = 1;
-
-    return 0;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_row_len, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> variant = vftRow;
-    rslt -> u . rf = row_len_func;
-    return 0;
-}
diff --git a/libs/vdb/schema-db.c b/libs/vdb/schema-db.c
deleted file mode 100644
index 5db6156..0000000
--- a/libs/vdb/schema-db.c
+++ /dev/null
@@ -1,746 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-dump.h"
-#include "dbmgr-priv.h"
-
-#include <klib/symbol.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * STblMember
- *  table member
- */
-
-/* Mark
- */
-static
-void CC STblMemberMark ( void * item, void * data )
-{
-    const STblMember * self = item;
-    if ( item != NULL )
-        STableMark ( ( void * )self -> tbl, data );
-}
-
-/* Dump
- */
-bool CC STblMemberDefDump ( void *item, void *dumper )
-{
-    SDumper *b = dumper;
-    STblMember *self = item;
-
-    b -> rc = SDumperPrint ( b, "\ttable " );
-    if ( b -> rc == 0 )
-        b -> rc = STableDump ( self -> tbl, b );
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, " %N;\n", self -> name );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-rc_t STblMemberDump ( const STblMember *self, SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-
-/*--------------------------------------------------------------------------
- * SDBMember
- *  sub-db member
- */
-
-/* Find
- */
-SDBMember * CC SDatabaseFindDB ( const SDatabase *self, const char *name );
-
-/* Mark
- */
-static
-void CC SDBMemberMark ( void * item, void * data )
-{
-    const SDBMember * self = item;
-    if ( self != NULL )
-        SDatabaseMark ( ( void * )self -> db, data );
-}
-
-/* Dump
- */
-bool CC SDBMemberDefDump ( void *item, void *dumper )
-{
-    SDumper *b = dumper;
-    SDBMember *self = item;
-
-    b -> rc = SDumperPrint ( b, "\tdatabase " );
-    if ( b -> rc == 0 )
-        b -> rc = SDatabaseDump ( self -> db, b );
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, " %N;\n", self -> name );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-rc_t SDBMemberDump ( const SDBMember *self, SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-
-/*--------------------------------------------------------------------------
- * SDatabase
- *  database declaration
- */
-
-#if SLVL >= 6
-
-/* Whack
- */
-void CC SDatabaseWhack ( void *item, void *ignore )
-{
-    SDatabase *self = item;
-
-    BSTreeWhack ( & self -> scope, KSymbolWhack, NULL );
-    VectorWhack ( & self -> db, SDBMemberWhack, NULL );
-    VectorWhack ( & self -> tbl, STblMemberWhack, NULL );
-
-    free ( self );
-}
-
-/* Cmp
- * Sort
- */
-int CC SDatabaseCmp ( const void *item, const void *n )
-{
-    const uint32_t *a = item;
-    const SDatabase *b = n;
-
-    if ( * a > b -> version )
-        return 1;
-    return ( int ) ( * a >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-int CC SDatabaseSort ( const void *item, const void *n )
-{
-    const SDatabase *a = item;
-    const SDatabase *b = n;
-
-    return ( int ) ( a -> version >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-static
-rc_t SDatabaseCompare ( const SDatabase *a, const SDatabase *b, const SDatabase **newer, bool exhaustive )
-{
-    assert ( ( a -> version >> 24 ) == ( b -> version >> 24 ) );
-
-    * newer = a -> version >= b -> version ? a : b;
-
-    /* TBD - more exhaustive comparison */
-
-    return 0;
-}
-
-/* Find
- *  generic object find within database scope
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void * SDatabaseFind ( const SDatabase *self,
-    const VSchema *schema, const SNameOverload **name,
-    uint32_t *type, const char *expr, const char *ctx )
-{
-    rc_t rc;
-    KSymTable tbl;
-
-    /* initialize to not-found */
-    const void *obj = NULL;
-    * name = NULL;
-    * type = 0;
-
-    /* build a symbol table for database */
-    rc = init_db_symtab ( & tbl, schema, self );
-    if ( rc == 0 )
-    {
-        obj = resolve_object ( & tbl, schema, NULL, name, type, expr, ctx, false );
-        KSymTableWhack ( & tbl );
-    }
-
-    return obj;
-}
-
-/* Extend
- */
-static
-void CC VectorTranslate ( Vector *v, const Vector *dad )
-{
-    uint32_t block = VectorBlock ( v );
-    uint32_t start = VectorStart ( dad ) + VectorLength ( dad );
-    VectorInit ( v, start, block );
-}
-
-static
-rc_t CC SDatabaseExtend ( SDatabase *self, const SDatabase *dad )
-{
-    self -> dad = dad;
-    VectorTranslate ( & self -> db, & dad -> db );
-    VectorTranslate ( & self -> tbl, & dad -> tbl );
-    return 0;
-}
-
-/* Mark
- */
-void CC SDatabaseClearMark ( void *item, void *ignore )
-{
-    SDatabase *self = item;
-    self -> marked = false;
-}
-
-
-void CC SDatabaseMark ( void * item, void * data )
-{
-    SDatabase * self = item;
-    if ( self != NULL && ! self -> marked )
-    {
-        self -> marked = true;
-        VectorForEach ( & self -> db, false, SDBMemberMark, data );
-        VectorForEach ( & self -> tbl, false, STblMemberMark, data );
-        SDatabaseMark ( ( void * )self -> dad, data );
-    }
-}
-
-void CC SDatabaseNameMark ( const SNameOverload *self, const VSchema *schema )
-{
-    if ( self != NULL )
-    {
-        VectorForEach ( & self -> items, false, SDatabaseMark, ( void* ) schema );
-    }
-}
-
-/* Dump
- *  dump "database" { }
- */
-rc_t SDatabaseDump ( const SDatabase *self, struct SDumper *d )
-{
-    d -> rc = FQNDump ( self != NULL ? self -> name : NULL, d );
-    if ( d -> rc == 0 && self != NULL )
-        d -> rc = SDumperVersion ( d, self -> version );
-    return d -> rc;
-}
-
-bool CC SDatabaseDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SDatabase *self = ( const void* ) item;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    b -> rc = SDumperPrint ( b, "\tdatabase %N", self -> name );
-
-    if ( b -> rc == 0 )
-        b -> rc = SDumperVersion ( b, self -> version );
-
-    /* TBD - need to overhaul inheritance of databases */
-    if ( b -> rc == 0 && self -> dad != NULL )
-        b -> rc = SDumperPrint ( b, "= %N", self -> dad -> name );
-
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, "\n\t{\n" );
-
-    SDumperIncIndentLevel ( b );
-
-    if ( b -> rc == 0 )
-        VectorDoUntil ( & self -> tbl, false, STblMemberDefDump, b );
-
-    if ( b -> rc == 0 )
-        VectorDoUntil ( & self -> db, false, SDBMemberDefDump, b );
-
-    SDumperDecIndentLevel ( b );
-
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, "\t}\n" );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-#if SLVL >= 6
-
-static
-rc_t CC db_dbmbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDBMember *m )
-{
-    rc_t rc ;
-    const SNameOverload *name;
-
-    /* look for database typename */
-    rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return KTokenFailure ( t, klogErr, rc, "database typename" );
-    if ( t -> id != eDatabase )
-        return KTokenExpected ( t, klogErr, "database typename" );
-    name = t -> sym -> u . obj;
-
-    /* look for version */
-    if ( next_token ( tbl, src, t ) -> id != eHash )
-        m -> db = VectorLast ( & name -> items );
-    else
-    {
-        uint32_t vers;
-        next_token ( tbl, src, t );
-        rc = maj_min_rel ( tbl, src, t, env, self, & vers, true );
-        if ( rc != 0 )
-            return rc;
-        m -> db = VectorFind ( & name -> items, & vers, NULL, SDatabaseCmp );
-    }
-    if ( m -> db == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcDatabase, rcNotFound );
-        return KTokenRCExplain ( t, klogErr, rc );
-    }
-
-    /* get member name */
-    if ( t -> sym != NULL )
-    {
-        KTokenSourceReturn ( src, t );
-        next_shallow_token ( tbl, src, t, true );
-    }
-
-    /* looking for undefined identifier */
-    if ( t -> id == eIdent )
-    {
-        rc = KSymTableCreateConstSymbol ( tbl, & m -> name, & t -> str, eDBMember, m );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-    else if ( t -> id == eDBMember )
-        return KTokenExpected ( t, klogErr, "undefined database member name" );
-    else if ( t -> id != eForward && t -> id != eVirtual )
-        return KTokenExpected ( t, klogErr, "database member name" );
-    else
-    {
-        m -> name = t -> sym;
-        ( ( KSymbol* ) t -> sym ) -> u . obj = m;
-        ( ( KSymbol* ) t -> sym ) -> type = eDBMember;
-    }
-
-    /* expect we're done */
-    return expect ( tbl, src, t, eSemiColon, ";", true );
-}
-
-static
-rc_t CC database_dbmbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDatabase *db, bool tmpl )
-{
-    rc_t rc;
-    SDBMember *m = malloc ( sizeof * m );
-    if ( m == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( m, 0, sizeof * m );
-        m -> tmpl = tmpl;
-
-        rc = db_dbmbr ( tbl, src, t, env, self, m );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & db -> db, & m -> cid . id, m );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        SDBMemberWhack ( m, NULL );
-    }
-    return rc;
-}
-
-static
-rc_t CC db_tblmbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STblMember *m )
-{
-    rc_t rc ;
-    const SNameOverload *name;
-
-    /* look for table typename */
-    rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return KTokenFailure ( t, klogErr, rc, "table typename" );
-    if ( t -> id != eTable )
-        return KTokenExpected ( t, klogErr, "table typename" );
-    name = t -> sym -> u . obj;
-
-    /* look for version */
-    if ( next_token ( tbl, src, t ) -> id != eHash )
-        m -> tbl = VectorLast ( & name -> items );
-    else
-    {
-        uint32_t vers;
-        next_token ( tbl, src, t );
-        rc = maj_min_rel ( tbl, src, t, env, self, & vers, true );
-        if ( rc != 0 )
-            return rc;
-        m -> tbl = VectorFind ( & name -> items, & vers, NULL, STableCmp );
-    }
-    if ( m -> tbl == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcNotFound );
-        return KTokenRCExplain ( t, klogErr, rc );
-    }
-
-    /* get member name */
-    if ( t -> sym != NULL )
-    {
-        KTokenSourceReturn ( src, t );
-        next_shallow_token ( tbl, src, t, true );
-    }
-
-    /* looking for undefined identifier */
-    if ( t -> id == eIdent )
-    {
-        rc = KSymTableCreateConstSymbol ( tbl, & m -> name, & t -> str, eTblMember, m );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-    else
-    {
-        if ( t -> id == eTblMember )
-            return KTokenExpected ( t, klogErr, "undefined table member name" );
-        if ( t -> id != eForward && t -> id != eVirtual )
-            return KTokenExpected ( t, klogErr, "table member name" );
-
-        m -> name = t -> sym;
-        ( ( KSymbol* ) t -> sym ) -> u . obj = m;
-        ( ( KSymbol* ) t -> sym ) -> type = eTblMember;
-    }
-
-    /* expect we're done */
-    return expect ( tbl, src, next_token ( tbl, src, t ), eSemiColon, ";", true );
-}
-
-static
-rc_t CC database_tblmbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDatabase *db, bool tmpl )
-{
-    rc_t rc;
-    STblMember *m = malloc ( sizeof * m );
-    if ( m == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( m, 0, sizeof * m );
-        m -> tmpl = tmpl;
-
-        rc = db_tblmbr ( tbl, src, t, env, self, m );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & db -> tbl, & m -> cid . id, m );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        STblMemberWhack ( m, NULL );
-    }
-    return rc;
-}
-
-/*
- * database-body      = '{' [ <database-mbrs> ] '}'
- * database-mbrs      = [ 'template' ] <database-mbr> [ <database-mbrs> ]
- * database-mbr       = 'database' <db-mbr>
- *                    | 'table' <table-mbr>
- *                    | ';'
- */
-static
-rc_t CC database_mbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDatabase *db )
-{
-    bool tmpl = false;
-
-    switch ( t -> id )
-    {
-    case  kw_template:
-        tmpl = true;
-        next_token ( tbl, src, t );
-        break;
-    case eSemiColon:
-        next_token ( tbl, src, t );
-        return 0;
-    }
-
-    switch ( t -> id )
-    {
-    case kw_database:
-        return database_dbmbr ( tbl, src,
-            next_token ( tbl, src, t ), env, self, db, tmpl );
-    case kw_table:
-        return database_tblmbr ( tbl, src,
-            next_token ( tbl, src, t ), env, self, db, tmpl );
-    }
-
-    return KTokenExpected ( t, klogErr, "table or database" );
-}
-
-static
-rc_t CC database_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDatabase *db )
-{
-    rc_t rc = expect ( tbl, src, t, eLeftCurly, "{", true );
-    if ( rc != 0 )
-        return rc;
-
-    while ( t -> id != eRightCurly )
-    {
-        rc = database_mbr ( tbl, src, t, env, self, db );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    return expect ( tbl, src, t, eRightCurly, "}", true );
-}
-
-
-/*
- * push-db-scope
- * pop-db-scope
- */
-rc_t push_db_scope ( KSymTable *tbl, const SDatabase *db )
-{
-    if ( db -> dad != NULL )
-    {
-        rc_t rc = push_db_scope ( tbl, db -> dad );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    return KSymTablePushScope ( tbl, ( BSTree* ) & db -> scope );
-}
-
-void pop_db_scope ( KSymTable *tbl, const SDatabase *db )
-{
-    while ( db != NULL )
-    {
-        KSymTablePopScope ( tbl );
-        db = db -> dad;
-    }
-}
-
-/*
- * init-db-symtab
- *  initializes "tbl"
- *  places db in scope
- *  must be balanced by KSymTableWhack
- */
-rc_t init_db_symtab ( KSymTable *tbl, const VSchema *schema, const SDatabase *db )
-{
-    rc_t rc = init_symtab ( tbl, schema );
-    if ( rc == 0 )
-    {
-        rc = push_db_scope ( tbl, db );
-        if ( rc == 0 )
-            return 0;
-
-        KSymTableWhack ( tbl );
-    }
-
-    return rc;
-}
-
-
-/*
- * database-decl      = 'database' <fqn> '#' <maj-min-rel>
- *                      [ '=' <database-name> ] <database-body>
- * database-body      = '{' [ <database-mbrs> ] '}'
- * database-mbrs      = <database-mbr> [ <database-mbrs> ]
- */
-static
-rc_t database_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SDatabase *db )
-{
-    /* db name */
-    rc_t rc = create_fqn ( tbl, src, t, env, eDatabase, NULL );
-    if ( rc != 0 && GetRCState ( rc ) != rcExists )
-        return KTokenFailure ( t, klogErr, rc, "database name" );
-    db -> name = t -> sym;
-
-    /* database version */
-    if ( next_token ( tbl, src, t ) -> id != eHash )
-        return KTokenExpected ( t, klogErr, "#" );
-    next_token ( tbl, src, t );
-    rc = maj_min_rel ( tbl, src, t, env, self, & db -> version, true );
-    if ( rc != 0 )
-        return rc;
-
-    /* prepare vectors */
-    VectorInit ( & db -> db, 0, 8 );
-    VectorInit ( & db -> tbl, 0, 8 );
-
-    /* look for inheritance */
-    if ( t -> id == eAssign )
-    {
-        const SDatabase *dad;
-        const SNameOverload *pname;
-
-        /* look for dad */
-        rc = next_fqn ( tbl, src, next_token ( tbl, src, t ), env );
-        if ( rc != 0 )
-            return KTokenFailure ( t, klogErr, rc, "database name" );
-
-        /* insist that dad be a database */
-        if ( t -> id != eDatabase )
-            return KTokenExpected ( t, klogErr, "database name" );
-        pname = t -> sym -> u . obj;
-
-        /* check for version */
-        if ( next_token ( tbl, src, t ) -> id != eHash )
-            dad = VectorLast ( & pname -> items );
-        else
-        {
-            uint32_t pvers;
-            next_token ( tbl, src, t );
-            rc = maj_min_rel ( tbl, src, t, env, self, & pvers, true );
-            if ( rc != 0 )
-                return rc;
-            dad = VectorFind ( & pname -> items, & pvers, NULL, SDatabaseCmp );
-        }
-
-        /* dad should be found */
-        if ( dad == NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcDatabase, rcNotFound );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        /* take the inheritance */
-        rc = SDatabaseExtend ( db, dad );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* enter database into scope */
-    rc = push_db_scope ( tbl, db );
-    if ( rc == 0 )
-    {
-        /* parse the definition */
-        rc = database_body ( tbl, src, t, env, self, db );
-
-        /* pop out of scope */
-        pop_db_scope ( tbl, db );
-    }
-
-    return rc;
-}
-
-rc_t database_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    rc_t rc;
-    void *ignore;
-
-    SDatabase *db = malloc ( sizeof * db );
-    if ( db == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    memset ( db, 0, sizeof * db );
-    rc = database_decl ( tbl, src, t, env, self, db );
-    if ( rc == 0 )
-    {
-        SNameOverload *name = ( void* ) db -> name -> u . obj;
-        if ( name == NULL )
-        {
-            rc = SNameOverloadMake ( & name, db -> name, 0, 4 );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( & self -> dname, & name -> cid . id, name );
-                if ( rc != 0 )
-                    SNameOverloadWhack ( name, NULL );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> db, & db -> id, db );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                rc = VectorInsertUnique ( & name -> items, db, & idx, SDatabaseSort );
-                if ( rc == 0 )
-                    return rc;
-
-                if ( GetRCState ( rc ) == rcExists )
-                {
-                    const SDatabase *newer;
-                    SDatabase *exist = VectorGet ( & name -> items, idx );
-                    rc = SDatabaseCompare ( exist, db, & newer, false );
-                    if ( rc == 0 && newer == db )
-                    {
-                        VectorSwap ( & name -> items, idx, db, & ignore );
-                        /* TBD - need to update parent/child relationships */
-                        return 0;
-                    }
-                }
-
-                VectorSwap ( & self -> db, db -> id, NULL, & ignore );
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        rc = 0;
-    }
-
-    SDatabaseWhack ( db, NULL );
-
-    return rc;
-}
-
-#endif
diff --git a/libs/vdb/schema-dump.c b/libs/vdb/schema-dump.c
deleted file mode 100644
index 5ef2ca3..0000000
--- a/libs/vdb/schema-dump.c
+++ /dev/null
@@ -1,683 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-dump.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SDumper
- */
-
-
-/* Init
- *  sets up block
- */
-void SDumperInit ( SDumper *self, const VSchema *schema, uint32_t mode,
-    rc_t ( CC * flush ) ( void *fd, const void *buffer, size_t size ), void *fd )
-{
-    self -> schema = schema;
-    self -> flush = flush;
-    self -> fd = fd;
-    self -> sep = "";
-    self -> rc = 0;
-    self -> indent = 0;
-    self -> mode = ( uint16_t ) mode;
-    self -> total = 0;
-}
-
-
-/* Flush
- */
-static
-rc_t SDumperFlush ( SDumper *self )
-{
-    rc_t rc = ( * self -> flush ) ( self -> fd, self -> buffer, self -> total );
-    if ( rc == 0 )
-        self -> total = 0;
-    return rc;
-}
-
-static
-rc_t SDumperFlushLine ( SDumper *self )
-{
-#if ! _DEBUGGING
-    if ( self -> total < sizeof self -> buffer / 2 )
-        return 0;
-#endif
-    return SDumperFlush ( self );
-}
-
-
-/* Whack
- *  flushes buffer if necessary
- */
-rc_t SDumperWhack ( SDumper *self )
-{
-    if ( self -> rc == 0 && self -> total != 0 )
-        return SDumperFlush ( self );
-    return 0;
-}
-
-
-/* Write
- *  writes data to buffer, flushes as necessary
- */
-rc_t SDumperWrite ( SDumper *self, const char *buffer, size_t size )
-{
-    rc_t rc;
-    size_t total, num_writ;
-
-    for ( rc = 0, total = 0; total < size; total += num_writ )
-    {
-        if ( self -> total == sizeof self -> buffer )
-        {
-            rc = SDumperFlush ( self );
-            if ( rc != 0 )
-                break;
-        }
-
-        num_writ = size - total;
-        if ( num_writ > sizeof self -> buffer - self -> total )
-            num_writ = sizeof self -> buffer - self -> total;
-
-        memcpy ( & self -> buffer [ self -> total ], & buffer [ total ], num_writ );
-        self -> total += num_writ;
-    }
-
-    return rc;
-}
-
-/* IndentLevel
- *  increase or decrease indentation level
- */
-void SDumperIncIndentLevel ( SDumper *self )
-{
-    ++ self -> indent;
-}
-
-void SDumperDecIndentLevel ( SDumper *self )
-{
-    if ( self -> indent > 0 )
-        -- self -> indent;
-}
-
-
-/* Indent
- *  writes indentation spacing
- */
-rc_t SDumperIndent ( SDumper *self )
-{
-    rc_t rc;
-    uint32_t total, num_writ;
-
-    /* use a tab */
-    const char *tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
-
-    for ( rc = 0, total = 0; total < self -> indent; total += num_writ )
-    {
-        num_writ = ( ( self -> indent - total - 1 ) & 0xF ) + 1;
-        rc = SDumperWrite ( self, tabs, num_writ );
-        if ( rc != 0 )
-            break;
-    }
-
-    return rc;
-}
-
-/* SepString
- *  sets separator string
- */
-void SDumperSepString ( SDumper *self, const char *sep )
-{
-    self -> sep = sep;
-}
-
-/* Sep
- *  write separator string
- */
-rc_t SDumperSep ( SDumper *self )
-{
-    if ( self -> sep == NULL )
-        return 0;
-
-    return SDumperWrite ( self, self -> sep, strlen ( self -> sep ) );
-}
-
-/* Print
- *  \t   - indent
- *  \n   - end of line
- *  \v   - separator
- *  %d   - int
- *  %u   - unsigned int
- *  %x   - unsigned int ( lower-case )
- *  %X   - unsigned int ( UPPER-case )
- *  %f   - double
- *  %ld  - int64_t
- *  %lu  - uint64_t
- *  %lx  - uint64_t ( lower-case )
- *  %lX  - uint64_t ( UPPER-case )
- *  %p   - pointer ( UPPER-case )
- *  %z   - size_t ( decimal )
- *  %s   - const char* ( NUL-terminated )
- *  %.*s - int, const char*
- *  %S   - const String*
- *  %N   - const KSymbol*
- *  %T   - const VTypedecl*
- *  %F   - const VFormatdecl*
- *  %V   - uint32_t version
- *  %E   - const SExpression*
- */
-rc_t SDumperVPrint ( SDumper *self, const char *fmt, va_list args )
-{
-    rc_t rc;
-    const char *start, *end;
-    for ( rc = 0, start = end = fmt; * end != 0; ++ end )
-    {
-        int len;
-        size_t size;
-        char buffer [ 256 ];
-
-        switch ( * end )
-        {
-        case '\t':
-            if ( end > start )
-                rc = SDumperWrite ( self, start, end - start );
-            if ( rc == 0 )
-                rc = SDumperIndent ( self );
-            start = end + 1;
-            break;
-        case '\n':
-            rc = SDumperWrite ( self, start, end - start + 1 );
-            if ( rc == 0 )
-                rc = SDumperFlushLine ( self );
-            start = end + 1;
-            break;
-        case '\v':
-            if ( end > start )
-                rc = SDumperWrite ( self, start, end - start );
-            if ( rc == 0 )
-                rc = SDumperSep ( self );
-            start = end + 1;
-            break;
-        case '%':
-            if ( end > start )
-            {
-                rc = SDumperWrite ( self, start, end - start );
-                if ( rc != 0 )
-                    break;
-            }
-            switch ( * ( ++ end ) )
-            {
-            case 'd':
-                len = sprintf ( buffer, "%d", va_arg ( args, int ) );
-                rc = SDumperWrite ( self, buffer, len );
-                break;
-            case 'u':
-                len = sprintf ( buffer, "%u", va_arg ( args, unsigned int ) );
-                rc = SDumperWrite ( self, buffer, len );
-                break;
-            case 'x':
-                len = sprintf ( buffer, "%x", va_arg ( args, unsigned int ) );
-                rc = SDumperWrite ( self, buffer, len );
-                break;
-            case 'X':
-                len = sprintf ( buffer, "%X", va_arg ( args, unsigned int ) );
-                rc = SDumperWrite ( self, buffer, len );
-                break;
-            case 'f':
-                len = sprintf ( buffer, "%f", va_arg ( args, double ) );
-                rc = SDumperWrite ( self, buffer, len );
-                break;
-            case 'l':
-                switch ( * ( ++ end ) )
-                {
-                case 'd':
-                    rc = string_printf ( buffer, sizeof buffer, & size, "%ld", va_arg ( args, int64_t ) );
-                    if ( rc == 0 )
-                        rc = SDumperWrite ( self, buffer, size );
-                    break;
-                case 'u':
-                    rc = string_printf ( buffer, sizeof buffer, & size, "%lu", va_arg ( args, uint64_t ) );
-                    if ( rc == 0 )
-                        rc = SDumperWrite ( self, buffer, size );
-                    break;
-                case 'x':
-                    rc = string_printf ( buffer, sizeof buffer, & size, "%lx", va_arg ( args, uint64_t ) );
-                    if ( rc == 0 )
-                        rc = SDumperWrite ( self, buffer, size );
-                    break;
-                case 'X':
-                    rc = string_printf ( buffer, sizeof buffer, & size, "%lX", va_arg ( args, uint64_t ) );
-                    if ( rc == 0 )
-                        rc = SDumperWrite ( self, buffer, size );
-                    break;
-                }
-                break;
-            case 'p':
-                rc = string_printf ( buffer, sizeof buffer, & size, "0x%p", va_arg ( args, size_t ) );
-                if ( rc == 0 )
-                    rc = SDumperWrite ( self, buffer, size );
-                break;
-            case 'z':
-                rc = string_printf ( buffer, sizeof buffer, & size, "%zu", va_arg ( args, size_t ) );
-                if ( rc == 0 )
-                    rc = SDumperWrite ( self, buffer, size );
-                break;
-            case 's':
-                len = snprintf ( buffer, sizeof buffer, "%s", va_arg ( args, const char* ) );
-                if ( len < 0 || len >= sizeof buffer )
-                    rc = RC ( rcVDB, rcSchema, rcWriting, rcString, rcExcessive );
-                else
-                    rc = SDumperWrite ( self, buffer, len );
-                break;
-            case '.':
-                if ( end [ 1 ] == '*' && end [ 2 ] == 's' )
-                {
-                    end += 2;
-                    len = va_arg ( args, int );
-                    if ( len >= sizeof buffer )
-                        rc = RC ( rcVDB, rcSchema, rcWriting, rcString, rcExcessive );
-                    else
-                    {
-                        len = sprintf ( buffer, "%.*s", len, va_arg ( args, const char* ) );
-                        rc = SDumperWrite ( self, buffer, len );
-                    }
-                    break;
-                }
-                /* not handling anything else */
-                rc = SDumperWrite ( self, "%.", 2 );
-                break;
-            case 'S':
-                rc = StringDump ( va_arg ( args, const String* ), self );
-                break;
-            case 'N':
-                rc = FQNDump ( va_arg ( args, const KSymbol* ), self );
-                break;
-#if SLVL >= 1
-            case 'T':
-                rc = VTypedeclDump ( va_arg ( args, struct VTypedecl const* ), self );
-                break;
-            case 'F':
-                rc = VFormatdeclDump ( va_arg ( args, struct VFormatdecl const* ), self );
-                break;
-#endif
-#if SLVL >= 2
-            case 'E':
-                rc = SExpressionDump ( va_arg ( args, const SExpression* ) , self );
-                break;
-#endif
-            case 'V':
-                rc = SDumperVersion ( self, va_arg ( args, uint32_t ) );
-                break;
-            case '%':
-                rc = SDumperWrite ( self, "%", 1 );
-                break;
-            }
-            start = end + 1;
-            break;
-        }
-
-        if ( rc != 0 )
-            break;
-    }
-
-    if ( rc == 0 && end > start )
-    {
-        rc = SDumperWrite ( self, start, end - start );
-        if ( rc == 0 )
-            rc = SDumperFlushLine ( self );
-    }
-
-    return rc;
-}
-
-rc_t SDumperPrint ( SDumper *self, const char *fmt, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, fmt );
-    rc = SDumperVPrint ( self, fmt, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * various types
- */
-
-/* Version
- */
-rc_t SDumperVersion ( SDumper *self, uint32_t version )
-{
-    const char *fmt;
-
-    if ( ( version & 0xFFFF ) != 0 )
-        fmt =" #%u.%u.%u";
-    else if ( ( version & 0xFF0000 ) != 0 )
-        fmt =" #%u.%u";
-    else
-        fmt =" #%u";
-
-    switch ( SDumperMode ( self ) )
-    {
-    case sdmCompact:
-        ++ fmt;
-        break;
-    }
-
-    return SDumperPrint ( self, fmt,
-                          ( version >> 24 ),
-                          ( version >> 16 ) & 0xFF,
-                          ( version & 0xFFFF ) );
-}
-
-/* String
- */
-rc_t StringDump ( const String *self, SDumper *b )
-{
-    return SDumperWrite ( b, self -> addr, self -> size );
-}
-
-/* KSymbol
- */
-rc_t KSymbolDump ( const KSymbol *self, SDumper *b )
-{
-    if ( self == NULL )
-        return SDumperWrite ( b, "NULL", 4 );
-
-    return StringDump ( & self -> name, b );
-}
-
-/* FQN
- *  writes fully qualified name in schema format
- */
-rc_t FQNDump ( const KSymbol *self, SDumper *b )
-{
-    rc_t rc = 0;
-
-    if ( self != NULL && self -> dad != NULL )
-    {
-        rc = FQNDump ( self -> dad, b );
-        if ( rc == 0 )
-            rc = SDumperWrite ( b, ":", 1 );
-    }
-
-    if ( rc == 0 )
-        rc = KSymbolDump ( self, b );
-
-    return rc;
-}
-
-/* Alias
- */
-LIB_EXPORT bool CC KSymbolDumpAlias ( void *item, void *data )
-{
-    SDumper *b = data;
-    const KSymbol *self = ( const KSymbol* ) item;
-    if ( self -> u . obj == b -> alias -> u . obj )
-    {
-        if ( SDumperMode ( b ) == sdmCompact )
-            b -> rc = SDumperPrint ( b, "alias %N %N;", b -> alias, self );
-        else
-            b -> rc = SDumperPrint ( b, "alias %N %N;\n", b -> alias, self );
-    }
-
-    return false;
-}
-
-rc_t AliasDump ( const KSymbol *self, SDumper *b )
-{
-    const VSchema *schema = b -> schema;
-    for ( b -> rc = 0, b -> alias = self; schema != NULL; schema = schema -> dad )
-    {
-        if ( VectorDoUntil ( & schema -> alias, false, KSymbolDumpAlias, b ) )
-            return b -> rc;
-    }
-    return 0;
-}
-
-/* VSchema
- */
-static
-bool VSchemaDumpInt ( const VSchema *self, SDumper *b, int dump_class )
-{
-    /* never dump intrinsic schema */
-    if ( self -> dad == NULL )
-    {
-#if SLVL >= 1
-        if ( SDumperMode ( b ) == sdmCompact )
-            SDumperPrint ( b, "version 1;" );
-        else
-            SDumperPrint ( b, "version 1;\n" );
-#endif
-        return false;
-    }
-
-    /* always dump parent */
-    if ( VSchemaDumpInt ( self -> dad, b, dump_class ) )
-        return true;
-
-    /* dump self */
-#if SLVL >= 1
-    if ( ( dump_class == 0 || dump_class == sdcTypes ) &&
-         VectorDoUntil ( & self -> dt, false, SDatatypeDefDump, b ) )
-        return true;
-
-    if ( ( dump_class == 0 || dump_class == sdcTypesets ) &&
-         VectorDoUntil ( & self -> ts, false, STypesetDefDump, b ) )
-        return true;
-#endif
-    if ( ( dump_class == 0 || dump_class == sdcFormats ) &&
-         VectorDoUntil ( & self -> fmt, false, SFormatDefDump, b ) )
-        return true;
-#if SLVL >= 2
-    if ( ( dump_class == 0 || dump_class == sdcConstants ) &&
-         VectorDoUntil ( & self -> cnst, false, SConstantDefDump, b ) )
-        return true;
-#endif
-#if SLVL >= 3
-    if ( ( dump_class == 0 || dump_class == sdcFunctions ) &&
-         VectorDoUntil ( & self -> func, false, SFunctionDeclDump, b ) )
-        return true;
-#endif
-#if SLVL >= 5
-    if ( ( dump_class == 0 || dump_class == sdcColumns ) &&
-         VectorDoUntil ( & self -> phys, false, SPhysicalDefDump, b ) )
-        return true;
-#endif
-#if SLVL >= 6
-    if ( ( dump_class == 0 || dump_class == sdcTables ) &&
-         VectorDoUntil ( & self -> tbl, false, STableDefDump, b ) )
-        return true;
-    if ( ( dump_class == 0 || dump_class == sdcDatabases ) &&
-         VectorDoUntil ( & self -> db, false, SDatabaseDefDump, b ) )
-        return true;
-#endif
-    return false;
-}
-
-LIB_EXPORT rc_t CC VSchemaDump ( const VSchema *self, uint32_t mode, const char *decl,
-    rc_t ( CC * flush ) ( void *fd, const void *buffer, size_t bsize ), void *fd )
-{
-    rc_t rc;
-    bool failed;
-    int dump_class = ( mode >> 8 ) & 0x7F;
-
-    SDumper b;
-    SDumperInit ( & b, self, mode & 0x80FF, flush, fd );
-
-    if ( decl != NULL && decl [ 0 ] != 0 )
-    {
-        uint32_t type;
-        const void *obj;
-        const SNameOverload *name;
-
-        b . mode |= MARKED_MODE;
-        VSchemaClearMark ( self );
-
-        obj = VSchemaFind ( self, & name, & type, decl, "VSchemaDump", false );
-
-        if ( obj != NULL ) switch ( type )
-        {
-        case eConstant:
-            SConstantMark ( obj );
-            break;
-        case eFormat:
-            SFormatMark ( obj );
-            break;
-        case eDatatype:
-            SDatatypeMark ( obj );
-            break;
-        case eTypeset:
-            STypesetMark ( obj, self );
-            break;
-        case eFunction:
-        case eUntypedFunc:
-        case eScriptFunc:
-            SFunctionMark ( ( void * )obj, ( void * )self );
-            break;
-        case ePhysical:
-            SPhysicalMark ( ( void * )obj, ( void * )self );
-            break;
-        case eTable:
-            STableMark ( ( void * )obj, ( void * )self );
-            break;
-        case eDatabase:
-            SDatabaseMark ( ( void * )obj, ( void * )self );
-            break;
-        }
-        else if ( name != NULL ) switch ( type )
-        {
-        case eFunction:
-        case eUntypedFunc:
-        case eScriptFunc:
-            SFuncNameMark ( name, self );
-            break;
-        case ePhysical:
-            SPhysNameMark ( name, self );
-            break;
-        case eTable:
-            STableNameMark ( name, self );
-            break;
-        case eDatabase:
-            SDatabaseNameMark ( name, self );
-            break;
-        }
-    }
-
-    failed = VSchemaDumpInt ( self, & b, dump_class );
-
-    rc = SDumperWhack ( & b );
-    return failed ? b . rc : rc;
-}
-
-static rc_t CC dump_to_stderr(void *dst, const void *buf, size_t sz)
-{
-    fwrite(buf, 1, sz, stderr);
-    return 0;
-}
-
-rc_t VSchemaDebugPrint ( const VSchema *self, const char *decl )
-{
-    return VSchemaDump ( self, sdmPrint, decl, dump_to_stderr, NULL );
-}
-
-/* ToText
- *  converts some object to textual representation
- */
-typedef struct VSchema2TextData VSchema2TextData;
-struct VSchema2TextData
-{
-    char *buff;
-    size_t bsize;
-    size_t total;
-};
-
-static
-rc_t CC flush_to_text ( void *data, const void *buffer, size_t size )
-{
-    VSchema2TextData *pb = data;
-    if ( size != 0 )
-    {
-        if ( pb -> total + size >= pb -> bsize )
-            return RC ( rcVDB, rcSchema, rcWriting, rcBuffer, rcInsufficient );
-
-        memcpy ( & pb -> buff [ pb -> total ], buffer, size );
-        pb -> total += size;
-    }
-    return 0;
-}
-
-rc_t VSchemaToText ( const VSchema *self,
-    char *buff, size_t bsize, size_t *num_writ, const char *fmt, ... )
-{
-    SDumper b;
-    rc_t rc, wrc;
-    VSchema2TextData pb;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    assert ( buff != NULL );
-    assert ( bsize != 0 );
-
-    SDumperInit ( & b, self, sdmCompact, flush_to_text, & pb );
-
-    pb . buff = buff;
-    pb . bsize = bsize;
-    pb . total = 0;
-
-    rc = SDumperVPrint ( & b, fmt, args );
-    wrc = SDumperWhack ( & b );
-
-    * num_writ = pb . total;
-
-    va_end ( args );
-    return rc != 0 ? rc : wrc;
-}
diff --git a/libs/vdb/schema-dump.h b/libs/vdb/schema-dump.h
deleted file mode 100644
index 9172fc9..0000000
--- a/libs/vdb/schema-dump.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_schema_dump_
-#define _h_schema_dump_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-struct KSymbol;
-struct VSchema;
-struct VTypedecl;
-struct VFormatdecl;
-
-
-/*--------------------------------------------------------------------------
- * SDumper
- */
-#define MARKED_MODE 0x8000
-
-enum VSchemaDumpClass
-{
-    sdcTypes = 1,
-    sdcTypesets,
-    sdcFormats,
-    sdcConstants,
-    sdcFunctions,
-    sdcColumns,
-    sdcTables,
-    sdcDatabases
-};
-
-typedef struct SDumper SDumper;
-struct SDumper
-{
-    struct VSchema const *schema;
-
-    struct KSymbol const *alias;
-
-    rc_t ( CC * flush ) ( void *fd, const void *buffer, size_t size );
-    void *fd;
-
-    const char *sep;
-
-    rc_t rc;
-    uint16_t indent;
-    uint16_t mode;
-
-    size_t total;
-    char buffer [ 4096 ];
-};
-
-/* Init
- *  sets up block
- */
-void SDumperInit ( SDumper *self, struct VSchema const *schema, uint32_t mode,
-    rc_t ( CC * flush ) ( void *fd, const void *buffer, size_t size ), void *fd );
-
-/* Whack
- *  flushes buffer if necessary
- */
-rc_t SDumperWhack ( SDumper *self );
-
-/* Write
- *  write some text to the dumper
- */
-rc_t SDumperWrite ( SDumper *self,
-    const char *buffer, size_t size );
-
-/* IndentLevel
- *  increase or decrease indentation level
- */
-void SDumperIncIndentLevel ( SDumper *self );
-void SDumperDecIndentLevel ( SDumper *self );
-
-/* Indent
- *  writes indentation spacing
- */
-rc_t SDumperIndent ( SDumper *self );
-
-/* SepString
- *  sets separator string
- */
-void SDumperSepString ( SDumper *self, const char *sep );
-
-/* Sep
- *  write separator string
- */
-rc_t SDumperSep ( SDumper *self );
-
-/* Print
- *  \t   - indent
- *  \n   - end of line
- *  \v   - separator
- *  %d   - int
- *  %u   - unsigned int
- *  %x   - unsigned int ( lower-case )
- *  %X   - unsigned int ( UPPER-case )
- *  %f   - double
- *  %ld  - int64_t
- *  %lu  - uint64_t
- *  %lx  - uint64_t ( lower-case )
- *  %lX  - uint64_t ( UPPER-case )
- *  %p   - pointer ( UPPER-case )
- *  %z   - size_t ( decimal )
- *  %s   - const char* ( NUL-terminated )
- *  %.*s - int, const char*
- *  %S   - const String*
- *  %N   - const KSymbol*
- *  %T   - const VTypedecl*
- *  %F   - const VFormatdecl*
- *  %V   - uint32_t version
- *  %E   - const SExpression*
- */
-rc_t SDumperPrint ( SDumper *self, const char *fmt, ... );
-rc_t SDumperVPrint ( SDumper *self, const char *fmt, va_list args );
-
-
-/* Mode
- *  get the dump mode
- */
-#define SDumperMode( self ) \
-    ( ( self ) -> mode & 0xFF )
-
-/* Class
- *  get the class of object to dump
- */
-#define SDumperClass( self ) \
-    ( ( ( self ) -> mode >> 8 ) & 0x7F )
-
-/* MarkedMode
- *  tells if only running in marked mode
- */
-#define SDumperMarkedMode( self ) \
-    ( ( self ) -> mode & MARKED_MODE )
-
-
-/*--------------------------------------------------------------------------
- * various types
- */
-
-/* Version
- */
-rc_t SDumperVersion ( SDumper *self, uint32_t version );
-
-/* String
- */
-rc_t StringDump ( struct String const *self, SDumper *d );
-
-/* KSymbol
- */
-rc_t KSymbolDump ( struct KSymbol const *self, SDumper *b );
-
-/* FQN
- *  writes fully qualified name in schema format
- */
-rc_t FQNDump ( struct KSymbol const *self, SDumper *b );
-
-/* Alias
- */
-rc_t AliasDump ( struct KSymbol const *self, SDumper *b );
-
-/* VTypedecl
- * VFormatdecl
- */
-rc_t VTypedeclDump ( struct VTypedecl const *self, SDumper *b );
-rc_t VFormatdeclDump ( struct VFormatdecl const *self, SDumper *b );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_schema_dump_ */
diff --git a/libs/vdb/schema-eval.c b/libs/vdb/schema-eval.c
deleted file mode 100644
index 07a54a0..0000000
--- a/libs/vdb/schema-eval.c
+++ /dev/null
@@ -1,1390 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <bitstr.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-
-/* CacheIntrinsicTypeId
- *  for id-caching
- *
- *  reads id atomically from "cache" and returns if non-zero
- *
- *  otherwise retrieves type id by name lookup, and sets
- *  value atomically in "cache" before returning.
- */
-uint32_t VSchemaCacheIntrinsicTypeId ( const VSchema *self,
-    atomic32_t *cache, const char *typename )
-{
-    uint32_t id;
-
-    assert ( self != NULL );
-    assert ( cache != NULL );
-    assert ( typename != NULL && typename [ 0 ] != 0 );
-
-    /* retrieve cached value */
-    id = atomic32_read ( cache );
-    if ( id == 0 )
-    {
-        String name;
-        uint32_t prev;
-        const KSymbol *sym;
-        const SDatatype *dt;
-
-        /* find intrinsic schema */
-        const VSchema *intrinsic = self;
-        while ( intrinsic -> dad != NULL )
-            intrinsic = intrinsic -> dad;
-
-        /* find datatype U32 */
-        StringInitCString ( & name, typename );
-        sym = ( const KSymbol* )
-            BSTreeFind ( & intrinsic -> scope, & name, KSymbolCmp );
-        assert ( sym != NULL );
-        dt = sym -> u . obj;
-
-        /* this SHOULD be idempotent */
-        prev = atomic32_test_and_set ( cache, ( int ) dt -> id, id );
-        assert ( prev == id || prev == dt -> id );
-
-        id = dt -> id;
-    }
-
-    return id;
-}
-
-
-/*--------------------------------------------------------------------------
- * constant numeric expressions
- *
- *  built-in typecasting allows for the chain
- *    bool => uint => int => float
- *
- *  built-in size promotion is automatic from 8 => 16 => 32 => 64 bits
- *
- *  constant size-demotion is allowed due to knowledge of constant value
- *
- *  explicit casts may reverse type promotion rules
- */
-
-
-/* 64 bit interchange union
- */
-typedef union nx nx;
-union nx
-{
-    uint64_t u64;
-    int64_t i64;
-    double f64;
-};
-
-
-/* readers
- *  access data in 8, 16, 32 or 64 bit form
- *  return data in 64 bit form
- *  advance data pointer
- */
-static
-const void *read_bool ( nx *data, const void *p )
-{
-    const bool *src = p;
-    data -> u64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_U8 ( nx *data, const void *p )
-{
-    const uint8_t *src = p;
-    data -> u64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_U16 ( nx *data, const void *p )
-{
-    const uint16_t *src = p;
-    data -> u64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_U32 ( nx *data, const void *p )
-{
-    const uint32_t *src = p;
-    data -> u64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_U64 ( nx *data, const void *p )
-{
-    const uint64_t *src = p;
-    data -> u64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_I8 ( nx *data, const void *p )
-{
-    const int8_t *src = p;
-    data -> i64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_I16 ( nx *data, const void *p )
-{
-    const int16_t *src = p;
-    data -> i64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_I32 ( nx *data, const void *p )
-{
-    const int32_t *src = p;
-    data -> i64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_I64 ( nx *data, const void *p )
-{
-    const int64_t *src = p;
-    data -> i64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_F32 ( nx *data, const void *p )
-{
-    const float *src = p;
-    data -> f64 = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_F64 ( nx *data, const void *p )
-{
-    const double *src = p;
-    data -> f64 = src [ 0 ];
-    return src + 1;
-}
-
-/* writers
- *  write data in 8, 16, 32, or 64 bit form
- *  receive data in 64 bit form
- *  advance pointers
- */
-static
-void *write_bool ( void *p, const nx *data )
-{
-    bool *dst = p;
-    dst [ 0 ] = data -> u64 ? true : false;
-    return dst + 1;
-}
-
-static
-void *write_U8 ( void *p, const nx *data )
-{
-    uint8_t *dst = p;
-    dst [ 0 ] = ( uint8_t ) data -> u64;
-    if ( ( uint64_t ) dst [ 0 ] != data -> u64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_U16 ( void *p, const nx *data )
-{
-    uint16_t *dst = p;
-    dst [ 0 ] = ( uint16_t ) data -> u64;
-    if ( ( uint64_t ) dst [ 0 ] != data -> u64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_U32 ( void *p, const nx *data )
-{
-    uint32_t *dst = p;
-    dst [ 0 ] = ( uint32_t ) data -> u64;
-    if ( ( uint64_t ) dst [ 0 ] != data -> u64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_U64 ( void *p, const nx *data )
-{
-    uint64_t *dst = p;
-    dst [ 0 ] = data -> u64;
-    return dst + 1;
-}
-
-static
-void *write_I8 ( void *p, const nx *data )
-{
-    int8_t *dst = p;
-    dst [ 0 ] = ( int8_t ) data -> i64;
-    if ( ( int64_t ) dst [ 0 ] != data -> i64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_I16 ( void *p, const nx *data )
-{
-    int16_t *dst = p;
-    dst [ 0 ] = ( int16_t ) data -> i64;
-    if ( ( int64_t ) dst [ 0 ] != data -> i64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_I32 ( void *p, const nx *data )
-{
-    int32_t *dst = p;
-    dst [ 0 ] = ( int32_t ) data -> i64;
-    if ( ( int64_t ) dst [ 0 ] != data -> i64 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_I64 ( void *p, const nx *data )
-{
-    int64_t *dst = p;
-    dst [ 0 ] = data -> i64;
-    return dst + 1;
-}
-
-static
-void *write_F32 ( void *p, const nx *data )
-{
-    double e;
-    float *dst = p;
-    dst [ 0 ] = ( float ) data -> f64;
-    e = ( double ) dst [ 0 ] - data -> f64;
-    if ( -1.0 < e || e > 1.0 )
-        return NULL;
-    return dst + 1;
-}
-
-static
-void *write_F64 ( void *p, const nx *data )
-{
-    double *dst = p;
-    dst [ 0 ] = data -> f64;
-    return dst + 1;
-}
-
-
-/* converters
- *  convert from one data type to another
- */
-static
-nx *null_cvt ( nx *data )
-{
-    return data;
-}
-
-static
-nx *uint_int ( nx *data )
-{
-    if ( data -> i64 < 0 )
-        return NULL;
-    return data;
-}
-
-static
-nx *uint_float ( nx *data )
-{
-    if ( data -> i64 < 0 )
-        return NULL;
-    data -> f64 = (double)data -> i64;
-    return data;
-}
-
-static
-nx *int_float ( nx *data )
-{
-    data -> f64 = (double)data -> i64;
-    return data;
-}
-
-static
-nx *float_int ( nx *data )
-{
-    data -> i64 = ( int64_t ) data -> f64;
-    return data;
-}
-
-static
-nx *float_uint ( nx *data )
-{
-    data -> i64 = ( int64_t ) data -> f64;
-    if ( data -> i64 < 0 )
-        return NULL;
-    return data;
-}
-
-static
-nx *int_uint ( nx *data )
-{
-    if ( data -> i64 < 0 )
-        return NULL;
-    return data;
-}
-
-/* eval-numeric-expr
- *  tries to evaluate a constant numeric expression against type
- *  returns non-zero error code if failed
- */
-#if SLVL >= 1
-LIB_EXPORT rc_t CC eval_numeric_expr ( const VSchema *self, const VTypedecl *td,
-    const SConstExpr *expr, SConstExpr **xp, bool force )
-{
-    SConstExpr *x;
-    uint32_t sbits, sdim;
-    uint32_t i, dbits, ddim;
-
-    void *dst;
-    const void *src;
-
-    const void* ( * reader ) ( nx*, const void* );
-    void* ( * writer ) ( void*, const nx* );
-    nx* ( * cvt ) ( nx* );
-
-    /* source and destination types of constant vector */
-    const SDatatype *sdt = VSchemaFindTypeid ( self, expr -> td . type_id );
-    const SDatatype *ddt = VSchemaFindTypeid ( self, td -> type_id );
-    if ( sdt == NULL || ddt == NULL )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcNotFound );
-
-    /* size of source and destination types */
-    sbits = sdt -> size;
-    dbits = ddt -> size;
-
-    /* regardless of how derived the specified types may be,
-       get their dimensions in terms of intrinsic types */
-    sdim = SDatatypeIntrinsicDim ( sdt );
-    ddim = SDatatypeIntrinsicDim ( ddt );
-
-    /* convert stated sizes to intrinsic element size */
-    assert ( sdim != 0 && ( sbits % sdim ) == 0 );
-    sbits /= sdim;
-    assert ( ddim != 0 && ( dbits % ddim ) == 0 );
-    dbits /= ddim;
-
-    /* test for cast compatibility */
-    if ( ! force ) switch ( ddt -> domain )
-    {
-    case ddBool:
-        /* only bool casts to bool */
-        if ( sdt -> domain != ddBool )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-        break;
-    case ddUint: case ddInt: case ddFloat:
-        if ( sdt -> domain > ddt -> domain )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-        break;
-    default:
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-    }
-
-    /* reset dimensions to account for explicit values */
-    sdim *= expr -> td . dim;
-    i = ddim * td -> dim;
-
-    /* destination dim must divide source dim evenly */
-    if ( i == 0 || sdim < i || ( sdim % i ) != 0 )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-
-    /* determine reader */
-    switch ( sdt -> domain )
-    {
-    case ddBool:
-        reader = read_bool; break;
-    case ddUint:
-        switch ( sbits )
-        {
-        case 8:  reader = read_U8; break;
-        case 16: reader = read_U16; break;
-        case 32: reader = read_U32; break;
-        case 64: reader = read_U64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    case ddInt:
-        switch ( sbits )
-        {
-        case 8:  reader = read_I8; break;
-        case 16: reader = read_I16; break;
-        case 32: reader = read_I32; break;
-        case 64: reader = read_I64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    case ddFloat:
-        switch ( sbits )
-        {
-        case 32: reader = read_F32; break;
-        case 64: reader = read_F64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    default:
-        /* here to quiet compiler complaints */
-        reader = NULL;
-    }
-
-    /* determine writer */
-    switch ( ddt -> domain )
-    {
-    case ddBool:
-        writer = write_bool; break;
-    case ddUint:
-        switch ( dbits )
-        {
-        case 8:  writer = write_U8; break;
-        case 16: writer = write_U16; break;
-        case 32: writer = write_U32; break;
-        case 64: writer = write_U64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    case ddInt:
-        switch ( dbits )
-        {
-        case 8:  writer = write_I8; break;
-        case 16: writer = write_I16; break;
-        case 32: writer = write_I32; break;
-        case 64: writer = write_I64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    case ddFloat:
-        switch ( dbits )
-        {
-        case 32: writer = write_F32; break;
-        case 64: writer = write_F64; break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-        break;
-    default:
-        writer = NULL;
-    }
-
-    /* determine converter */
-    if ( sdt -> domain == ddt -> domain )
-        cvt = null_cvt;
-    else switch ( ddt -> domain )
-    {
-    case ddBool:
-    case ddUint:
-        switch ( sdt -> domain )
-        {
-        case ddInt:
-            cvt = int_uint; break;
-        case ddFloat:
-            cvt = float_uint; break;
-        default:
-            cvt = null_cvt;
-        }
-        break;
-    case ddInt:
-        switch ( sdt -> domain )
-        {
-        case ddFloat:
-            cvt = float_int; break;
-        default:
-            cvt = uint_int; break;
-        }
-        break;
-    case ddFloat:
-        switch ( sdt -> domain )
-        {
-        case ddInt:
-            cvt = int_float; break;
-        default:
-            cvt = uint_float; break;
-        }
-        break;
-    default:
-        cvt = null_cvt;
-    }
-
-    /* create output object */
-    {
-	unsigned int alloc_size;
-
-	alloc_size=(((size_t)dbits * sdim + 7) >> 3);
-	if(alloc_size < sizeof(x->u)){ /** don't go below size of union ***/
-		alloc_size=sizeof(*x);	
-	} else { /** overallocate here ***/
-		alloc_size+=sizeof(*x)-sizeof(x->u);
-	}
-	alloc_size = (alloc_size+3)&~3; /** align to 4 bytes **/
-    	x = malloc ( alloc_size );
-	if ( x == NULL )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcMemory, rcExhausted );
-	memset(x,0,alloc_size);
-    }
-
-    /* copy, and perform type conversion */
-    src = & expr -> u;
-    dst = & x -> u;
-    for ( i = 0; i < sdim; ++ i )
-    {
-        nx data;
-        const nx *dp;
-
-        /* read element */
-        src = ( * reader ) ( & data, src );
-
-        /* type-promote */
-        dp = ( * cvt ) ( & data );
-        if ( dp == NULL )
-        {
-            free ( x );
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcConstraint, rcViolated );
-        }
-
-        /* write element */
-        dst = ( * writer ) ( dst, dp );
-        if ( dst == NULL )
-        {
-            free ( x );
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcConstraint, rcViolated );
-        }
-    }
-
-    /* it is done */
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . type_id = td -> type_id;
-    x -> td . dim = sdim / ddim;
-    * xp = x;
-    return 0;
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * constant textual expressions
- *
- *  built-in typecasting allows for the chain
- *    ascii => unicode
- *
- *  built-in size promotion is automatic from 8 => 16 => 32 bits
- *
- *  constant size-demotion is allowed due to knowledge of constant value
- *
- *  explicit casts may reverse type promotion rules
- */
-
-
-static
-const void *read_ascii ( uint32_t *ch, const void *p, const void *end )
-{
-    const char *src = p;
-    if ( src [ 0 ] < 0 )
-        return NULL;
-    * ch = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_utf8 ( uint32_t *ch, const void *p, const void *end )
-{
-    const char *src = p;
-    int len = utf8_utf32 ( ch, src, end );
-    if ( len <= 0 )
-        return NULL;
-    return src + len;
-}
-
-static
-const void *read_utf16 ( uint32_t *ch, const void *p, const void *end )
-{
-    const uint16_t *src = p;
-    * ch = src [ 0 ];
-    return src + 1;
-}
-
-static
-const void *read_utf32 ( uint32_t *ch, const void *p, const void *end )
-{
-    const uint32_t *src = p;
-    * ch = src [ 0 ];
-    return src + 1;
-}
-
-static
-void *write_ascii ( void *p, void *end, uint32_t ch )
-{
-    char *dst = p;
-    if ( ch >= 128 )
-        ch = '?';
-    dst [ 0 ] = ( char ) ch;
-    return dst + 1;
-}
-
-static
-void *write_utf8 ( void *p, void *end, uint32_t ch )
-{
-    char *dst = p;
-    int len = utf32_utf8 ( dst, end, ch );
-    if ( len <= 0 )
-        return NULL;
-    return dst + len;
-}
-
-static
-void *write_utf16 ( void *p, void *end, uint32_t ch )
-{
-    uint16_t *dst = p;
-    if ( ch > 0x10000 )
-        ch = '?';
-    dst [ 0 ] = ( uint16_t ) ch;
-    return dst + 1;
-}
-
-static
-void *write_utf32 ( void *p, void *end, uint32_t ch )
-{
-    uint32_t *dst = p;
-    dst [ 0 ] = ch;
-    return dst + 1;
-}
-
-#if SLVL >= 1
-LIB_EXPORT rc_t CC eval_text_expr ( const VSchema *self, const VTypedecl *td,
-    const SConstExpr *expr, SConstExpr **xp, bool force )
-{
-    size_t size;
-    uint32_t len;
-    SConstExpr *x;
-    uint32_t sbits, sdim;
-    uint32_t i, dbits, ddim;
-
-    void *dst, *dend;
-    const void *src, *send;
-    void* ( * writer ) ( void*, void*, uint32_t );
-    const void* ( * reader ) ( uint32_t*, const void*, const void* );
-
-    /* source and destination types of constant vector */
-    const SDatatype *sdt = VSchemaFindTypeid ( self, expr -> td . type_id );
-    const SDatatype *ddt = VSchemaFindTypeid ( self, td -> type_id );
-    if ( sdt == NULL || ddt == NULL )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcNotFound );
-
-    /* size of source and destination types */
-    sbits = sdt -> size;
-    dbits = ddt -> size;
-
-    /* regardless of how derived the specified types may be,
-       get their dimensions in terms of intrinsic types */
-    sdim = SDatatypeIntrinsicDim ( sdt );
-    ddim = SDatatypeIntrinsicDim ( ddt );
-
-    /* convert stated sizes to intrinsic element size */
-    assert ( sdim != 0 && ( sbits % sdim ) == 0 );
-    sbits /= sdim;
-    assert ( ddim != 0 && ( dbits % ddim ) == 0 );
-    dbits /= ddim;
-
-    /* test for cast compatibility */
-    if ( ! force ) switch ( ddt -> domain )
-    {
-    case ddAscii:
-        /* only ascii casts to ascii */
-        if ( sdt -> domain != ddAscii )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect ); 
-        break;
-    case ddUnicode:
-        if ( sdt -> domain < ddAscii || sdt -> domain > ddt -> domain )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-        break;
-    default:
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-    }
-
-    /* restore source dimension */
-    sdim *= expr -> td . dim;
-
-    /* determine reader and length */
-    len = sdim;
-    switch ( sdt -> domain )
-    {
-    case ddAscii:
-        reader = read_ascii; break;
-    default:
-        switch ( sbits )
-        {
-        case 8:
-            reader = read_utf8;
-            len = string_len ( expr -> u . utf8, sdim );
-            break;
-        case 16:
-            reader = read_utf16;
-            break;
-        case 32:
-            reader = read_utf32;
-            break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-    }
-
-    /* determine writer and size */
-    ddim = len;
-    switch ( ddt -> domain )
-    {
-    case ddAscii:
-        writer = write_ascii;
-        size = len;
-        break;
-    default:
-        switch ( sbits )
-        {
-        case 8:
-            writer = write_utf8;
-            switch ( dbits )
-            {
-            case 16:
-                utf16_cvt_string_len ( expr -> u . utf16, len << 1, & size );
-                break;
-            case 32:
-                utf32_cvt_string_len ( expr -> u . utf32, len << 2, & size );
-                break;
-            default:
-                size = sdim;
-            }
-            ddim = ( uint32_t ) size;
-            break;
-        case 16:
-            writer = write_utf16;
-            size = len << 1;
-            break;
-        case 32:
-            writer = write_utf32;
-            size = len << 2;
-            break;
-        default:
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnexpected );
-        }
-    }
-
-    /* create output object */
-    {
-	unsigned int alloc_size;
-
-	alloc_size=size;
-	if(alloc_size < sizeof(x->u)){ /** don't go below size of union ***/
-		alloc_size=sizeof(*x);	
-	} else { /** overallocate here ***/
-		alloc_size+=sizeof(*x)-sizeof(x->u);
-	}
-	alloc_size = (alloc_size+3)&~3; /** align to 4 bytes **/
-    	x = malloc ( alloc_size );
-	if ( x == NULL )
-		return RC ( rcVDB, rcExpression, rcEvaluating, rcMemory, rcExhausted );
-	memset(x,0,alloc_size);
-    }
-   
-
-    /* copy, and perform type conversion */
-    src = expr -> u . utf8;
-    send = & expr -> u . utf8 [ sdim ];
-    dst = x -> u . utf8;
-    dend = & x -> u . utf8 [ size ];
-    for ( i = 0; i < len; ++ i )
-    {
-        uint32_t ch;
-
-        /* read character */
-        src = ( * reader ) ( & ch, src, send );
-        if ( src == NULL )
-        {
-            free ( x );
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcData, rcCorrupt );
-        }
-
-        /* write character */
-        dst = ( * writer ) ( dst, dend, ch );
-        if ( dst == NULL )
-        {
-            free ( x );
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcData, rcCorrupt );
-        }
-    }
-
-    /* it is done */
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . type_id = td -> type_id;
-    x -> td . dim = ddim;
-    * xp = x;
-    return 0;
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SConstExpr
- */
-
-
-/* Resolve
- *  return constant expression as a vector of indicated type
- */
-rc_t SConstExprResolveAsBool ( const SConstExpr *self,
-    const VSchema *schema, bool *b, uint32_t capacity );
-rc_t SConstExprResolveAsI8 ( const SConstExpr *self,
-    const VSchema *schema, int8_t *i8, uint32_t capacity );
-rc_t SConstExprResolveAsI16 ( const SConstExpr *self,
-    const VSchema *schema, int16_t *i16, uint32_t capacity );
-rc_t SConstExprResolveAsI32 ( const SConstExpr *self,
-    const VSchema *schema, int32_t *i32, uint32_t capacity );
-rc_t SConstExprResolveAsI64 ( const SConstExpr *self,
-    const VSchema *schema, int64_t *i64, uint32_t capacity );
-rc_t SConstExprResolveAsU8 ( const SConstExpr *self,
-    const VSchema *schema, uint8_t *u8, uint32_t capacity );
-rc_t SConstExprResolveAsU16 ( const SConstExpr *self,
-    const VSchema *schema, uint16_t *u16, uint32_t capacity );
-
-rc_t SConstExprResolveAsU32 ( const SConstExpr *self,
-    const VSchema *schema, uint32_t *u32, uint32_t capacity )
-{
-    if ( capacity != 1 )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUnsupported );
-    return eval_uint_expr ( schema, ( const SExpression* ) self, u32 );
-}
-
-rc_t SConstExprResolveAsU64 ( const SConstExpr *self,
-    const VSchema *schema, uint32_t *u64, uint32_t capacity );
-rc_t SConstExprResolveAsF32 ( const SConstExpr *self,
-    const VSchema *schema, float *f32, uint32_t capacity );
-rc_t SConstExprResolveAsF64 ( const SConstExpr *self,
-    const VSchema *schema, double *f64, uint32_t capacity );
-rc_t SConstExprResolveAsAscii ( const SConstExpr *self,
-    const VSchema *schema, char *ascii, size_t capacity );
-rc_t SConstExprResolveAsUTF8 ( const SConstExpr *self,
-    const VSchema *schema, char *utf8, size_t bytes );
-rc_t SConstExprResolveAsUTF16 ( const SConstExpr *self,
-    const VSchema *schema, uint16_t *utf16, uint32_t capacity );
-rc_t SConstExprResolveAsUTF32 ( const SConstExpr *self,
-    const VSchema *schema, uint32_t *utf32, uint32_t capacity );
-
-
-/*--------------------------------------------------------------------------
- * STypeExpr
- */
-
-/* Resolve
- *  resolve type expression to either a VTypedecl or VFormatdecl
- */
-rc_t STypeExprResolveAsFormatdecl ( const STypeExpr *self,
-    const VSchema *schema, VFormatdecl *fd )
-{
-    rc_t rc;
-    uint32_t dim;
-
-    /* if self is resolved, then the format, type
-       and dimension are completely resolved */
-    if ( self -> resolved )
-    {
-        * fd = self -> fd;
-        return 0;
-    }
-
-#if SLVL < 3
-    return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-#else
-    /* the format is always completely resolved,
-       this leaves type and/or dimension */
-
-    if ( self -> id != NULL )
-    {
-        /* the type needs to be resolved */
-        const STypeExpr *type = ( const STypeExpr* ) self -> id -> type;
-        if ( type == NULL )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUndefined );
-        if ( type -> dad . var != eTypeExpr )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-        rc = STypeExprResolveAsFormatdecl ( type, schema, fd );
-        if ( rc != 0 )
-            return rc;
-
-        /* at this point, "fd" has some format - which we'll clobber,
-           a type and dim from the indirect type just resolved */
-    }
-    else
-    {
-        /* take known type and default dimension */
-        fd -> td . type_id = self -> fd . td . type_id;
-        fd -> td . dim = 1;
-    }
-
-    /* always take our format */
-    fd -> fmt = self -> fd . fmt;
-
-    /* test for unresolved dimension */
-    dim = self -> fd . td . dim;
-    if ( dim == 0 && self -> dim != NULL )
-    {
-        const SExpression *dx = self -> dim;
-        while ( dx != NULL )
-        {
-            const SIndirectConst *ic;
-
-            if ( dx -> var == eConstExpr )
-            {
-                rc = SConstExprResolveAsU32 ( ( const SConstExpr* ) dx, schema, & dim, 1 );
-                if ( rc != 0 )
-                    return rc;
-                break;
-            }
-
-            if ( dx -> var != eIndirectExpr )
-                return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-
-            ic = ( ( const SSymExpr* ) dx ) -> _sym -> u . obj;
-            assert ( ic != NULL );
-
-            dx = ic -> expr;
-        }
-
-        /* must have non-zero dim */
-        if ( dim == 0 )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcUndefined );
-    }
-
-    /* factor in our dimension */
-    fd -> td . dim *= dim;
-    return 0;
-#endif
-}
-
-rc_t STypeExprResolveAsTypedecl ( const STypeExpr *self,
-    const VSchema *schema, VTypedecl *td )
-{
-    VFormatdecl fd;
-    rc_t rc = STypeExprResolveAsFormatdecl ( self, schema, & fd );
-    if ( rc == 0 )
-    {
-        if ( fd . fmt != 0 )
-            return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-        * td = fd . td;
-    }
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * general constant expression evaluation
- */
-#if SLVL >= 1
-
-/* eval-type-expr
- *  should be able to boil things down to defined type vector
- */
-static
-rc_t eval_type_expr ( const VSchema *self, const VTypedecl *td,
-    const STypeExpr *expr, SExpression **xp )
-{
-    PLOGMSG( klogWarn, ( klogWarn, "TDB: $(msg)", "msg=handle type expression" ));
-    return -1;
-}
-
-/* eval-indirect-expr
- */
-static
-rc_t eval_indirect_expr ( const VSchema *self, const VTypedecl *td,
-    const SSymExpr *expr, SExpression **xp )
-{
-    const SIndirectConst *ic = expr -> _sym -> u . obj;
-
-    /* if the expression is there */
-    if ( ic -> expr != NULL )
-        return eval_const_expr ( self, td, ic -> expr, xp );
-
-    /* just return self */
-    * xp = & ( ( SSymExpr* ) expr ) -> dad;
-    atomic32_inc ( & ( ( SSymExpr* ) expr ) -> dad . refcount );
-    return 0;
-}
-
-
-/* eval-const-cast-expr
- */
-static
-rc_t eval_const_cast_expr ( const VSchema *self, const VTypedecl *td,
-    const SExpression *expr, SExpression **xp )
-{
-    PLOGMSG( klogWarn, ( klogWarn, "TDB: $(msg)", "msg=handle const cast expression" ));
-    return -1;
-}
-
-
-/* eval-func-param-expr
- */
-static
-rc_t eval_func_param_expr ( const VSchema *self, const VTypedecl *td,
-    const SExpression *expr, SExpression **xp )
-{
-    PLOGMSG( klogWarn, ( klogWarn, "TDB: $(msg)", "msg=handle function expression" ));
-    return -1;
-}
-
-struct eval_vector_param_expr_pb {
-    rc_t rc;
-    const VSchema *self;
-    const VTypedecl *td;
-    Vector v;
-};
-
-static
-void CC vector_free ( void *item, void *data )
-{
-    free ( item );
-}
-
-static
-bool CC do_eval_vector_param_expr ( void *item, void *data ) {
-    struct eval_vector_param_expr_pb *pb = (struct eval_vector_param_expr_pb *)data;
-    SExpression *rslt = 0;
-    
-    pb->rc = eval_const_expr(pb->self, pb->td, (struct SExpression const *)item, &rslt);
-    if (pb->rc)
-        return true;
-    switch (rslt->var) {
-    case eConstExpr:
-        VectorAppend(&pb->v, 0, rslt);
-        break;
-    case eVectorExpr:
-        free(rslt);
-        break;
-    default:
-        free(rslt);
-        pb->rc = RC ( rcVDB, rcExpression, rcEvaluating, rcExpression, rcUnexpected );
-        return true;
-    }
-
-    return false;
-}
-
-/* eval-vector-param-expr
- */
-static
-rc_t eval_vector_param_expr ( const VSchema *self,
-    const VTypedecl *td, const SVectExpr *expr, SExpression **xp )
-{
-    struct eval_vector_param_expr_pb pb;
-
-    *xp = NULL;
-    
-    pb.rc = 0;
-    pb.self = self;
-    pb.td = td;
-    VectorInit ( & pb . v, 0, 32 );
-    
-    VectorDoUntil ( & expr -> expr, 0, do_eval_vector_param_expr, & pb );
-    if ( pb . rc == 0 )
-    {
-        SConstExpr *rslt;
-        uint32_t elem_count = VectorLength ( & pb . v );
-        uint32_t elem_bits;
-        size_t alloc_size;
-        
-        {
-            const SDatatype *dt = VSchemaFindTypeid ( self, td -> type_id );
-            elem_bits = dt -> size;
-        }
-
-        alloc_size = ( ( ( size_t ) elem_bits * elem_count + 7 ) >> 3 );
-
-        /** don't go below size of union ***/
-        if ( alloc_size < sizeof rslt -> u )
-            alloc_size = sizeof * rslt;	
-        /** overallocate here ***/
-        else
-            alloc_size += sizeof * rslt - sizeof rslt -> u ;
-
-        /** align to 4 bytes **/
-        alloc_size = ( alloc_size + 3 ) & ~ 3;
-        rslt = calloc ( alloc_size, 1 );
-        if ( rslt == NULL )
-            pb . rc = RC ( rcVDB, rcExpression, rcEvaluating, rcMemory, rcExhausted );
-        else
-        {
-            uint32_t i;
-
-            rslt -> dad . var = eConstExpr;
-            atomic32_set ( & rslt -> dad . refcount, 1 );
-            rslt -> td = *td;
-            rslt -> td . dim = elem_count;
-            
-            for ( i = 0; i != elem_count; ++i )
-            {
-                const SConstExpr *y = VectorGet ( & pb . v, i );
-                bitcpy ( & rslt -> u, i * elem_bits, & y -> u, 0, elem_bits );
-            }
-
-            *xp = & rslt -> dad;
-        }
-    }
-
-    VectorWhack( & pb . v, vector_free, 0 );
-
-    return pb . rc;
-}
-
-
-/* eval-const-expr
- *  tries to evaluate a constant expression against type
- *  returns non-zero error code if failed
- */
-rc_t eval_const_expr ( const VSchema *self, const VTypedecl *td,
-    const SExpression *expr, SExpression **xp )
-{
-    rc_t rc;
-    const SConstExpr *s;
-
-    switch ( expr -> var )
-    {
-    case eTypeExpr:
-        return eval_type_expr ( self, td, ( const STypeExpr* ) expr, xp );
-    case eConstExpr:
-        s = ( const SConstExpr* ) expr;
-        break;
-#if SLVL >= 3
-    case eIndirectExpr:
-        return eval_indirect_expr ( self, td, ( const SSymExpr* ) expr, xp );
-#endif
-#if SLVL >= 4
-    case eFuncParamExpr:
-        return eval_func_param_expr ( self, td, expr, xp );
-#endif
-    case eCastExpr:
-        return eval_const_cast_expr ( self, td, expr, xp );
-    case eVectorExpr:
-        return eval_vector_param_expr(self, td, ( const SVectExpr* )expr, xp);
-    default:
-        *xp = NULL;
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcExpression, rcUnexpected );
-    }
-
-    /* try to evaluate as numeric */
-    rc = eval_numeric_expr ( self, td, s, ( SConstExpr** ) xp, false );
-
-    /* fall over to text */
-    if ( rc != 0 && GetRCState ( rc ) == rcUnexpected && GetRCObject ( rc ) == rcType )
-        rc = eval_text_expr ( self, td, s, ( SConstExpr** ) xp, false );
-
-    return rc;
-}
-
-/* eval-uint-expr
- *  special const expression evaluator for uint32_t
- */
-rc_t eval_uint_expr ( const VSchema *self,
-    const SExpression *expr, uint32_t *value )
-{
-    rc_t rc;
-    VTypedecl td;
-    SConstExpr *x;
-
-    /* capture runtime value for U32 */
-    static atomic32_t s_U32_id;
-    uint32_t U32_id = VSchemaCacheIntrinsicTypeId ( self, & s_U32_id, "U32" );
-
-    /* evaluate expression against type */
-    td . type_id = U32_id;
-    td . dim = 1;
-    rc = eval_const_expr ( self, & td, expr, ( SExpression** ) & x );
-    if ( rc != 0 )
-        return rc;
-
-    /* verify dimensionality */
-    assert ( x -> dad . var == eConstExpr );
-    if ( x -> td . dim != 1 )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-
-    /* got it */
-    * value = x -> u . u32 [ 0 ];
-    free ( x );
-    return 0;
-}
-
-
-/* eval-uint64-expr
- *  special const expression evaluator for uint32_t
- */
-rc_t eval_uint64_expr ( const VSchema *self,
-    const SExpression *expr, uint64_t *value )
-{
-    rc_t rc;
-    VTypedecl td;
-    SConstExpr *x;
-
-    /* capture runtime value for U64 */
-    static atomic32_t s_U64_id;
-    uint64_t U64_id = VSchemaCacheIntrinsicTypeId ( self, & s_U64_id, "U64" );
-
-    /* evaluate expression against type */
-    td . type_id = U64_id;
-    td . dim = 1;
-    rc = eval_const_expr ( self, & td, expr, ( SExpression** ) & x );
-    if ( rc != 0 )
-        return rc;
-
-    /* verify dimensionality */
-    assert ( x -> dad . var == eConstExpr );
-    if ( x -> td . dim != 1 )
-        return RC ( rcVDB, rcExpression, rcEvaluating, rcType, rcIncorrect );
-
-    /* got it */
-    * value = x -> u . u64 [ 0 ];
-    free ( x );
-    return 0;
-}
-
-
-/* eval-expr-syntax
- *  examine expression syntax
- *  fixes forward references
- */
-static
-bool CC eval_vect_expr_syntax ( void *item, void *data )
-{
-    rc_t *rc = data;
-    SExpression *x = item;
-    * rc = eval_expr_syntax ( x );
-    return ( * rc != 0 ) ? true : false;
-}
-
-static
-rc_t eval_type_expr_syntax ( const STypeExpr *expr )
-{
-    if ( expr -> dad . var != eTypeExpr )
-        return RC ( rcVDB, rcExpression, rcValidating, rcExpression, rcIncorrect );
-    return 0;
-}
-
-static
-rc_t eval_fwd_expr_syntax ( SSymExpr *expr )
-{
-    const KSymbol *sym = expr -> _sym;
-    assert ( sym != NULL );
-    switch ( sym -> type )
-    {
-    case eFuncParam:
-        expr -> dad . var = eParamExpr;
-        break;
-    case eProduction:
-        expr -> dad . var = eProdExpr;
-        break;
-    case eColumn:
-        expr -> dad . var = eColExpr;
-        break;
-    case ePhysMember:
-        expr -> dad . var = ePhysExpr;
-        break;
-    case eForward:
-        return RC ( rcVDB, rcSchema, rcValidating, rcName, rcUndefined );
-    case eVirtual:
-        break;
-
-    default:
-        return RC ( rcVDB, rcSchema, rcValidating, rcExpression, rcInvalid );
-    }
-
-    return 0;
-}
-
-rc_t eval_expr_syntax ( const SExpression *expr )
-{
-    rc_t rc;
-
-    if ( expr == NULL )
-        rc = RC ( rcVDB, rcExpression, rcValidating, rcSelf, rcNull );
-    else switch ( expr -> var )
-    {
-    case eFwdExpr:
-        rc = eval_fwd_expr_syntax ( ( SSymExpr* ) expr );
-        break;
-    case eCastExpr:
-        rc = eval_type_expr_syntax ( ( const STypeExpr* ) ( ( const SBinExpr* ) expr ) -> left );
-        if ( rc == 0 )
-            rc = eval_expr_syntax ( ( ( const SBinExpr* ) expr ) -> right );
-        break;
-    case eVectorExpr:
-        rc = 0;
-        VectorDoUntil ( & ( ( const SVectExpr* ) expr ) -> expr, false, eval_vect_expr_syntax, & rc );
-        break;
-    case eCondExpr:
-        rc = eval_expr_syntax ( ( ( const SBinExpr* ) expr ) -> left );
-        if ( rc == 0 )
-            rc = eval_expr_syntax ( ( ( const SBinExpr* ) expr ) -> right );
-        break;
-    default:
-        rc = 0;
-    }
-
-    return rc;
-}
-
-#endif
diff --git a/libs/vdb/schema-expr.c b/libs/vdb/schema-expr.c
deleted file mode 100644
index df73ba2..0000000
--- a/libs/vdb/schema-expr.c
+++ /dev/null
@@ -1,2169 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "schema-dump.h"
-
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SExpression
- */
-#if SLVL >= 1
-void SExpressionWhack ( const SExpression *cself )
-{
-    SExpression *self = ( SExpression* ) cself;
-    if ( self != NULL && atomic32_dec_and_test ( & self -> refcount ) )
-    {
-        switch ( self -> var )
-        {
-        case eTypeExpr:
-        {
-            STypeExpr *x = ( STypeExpr* ) self;
-            SExpressionWhack ( x -> dim );
-            break;
-        }
-        case eFuncExpr:
-        case eScriptExpr:
-        {
-            SFuncExpr *x = ( SFuncExpr* ) self;
-            VectorWhack ( & x -> schem, SExpressionVWhack, NULL );
-            VectorWhack ( & x -> pfact, SExpressionVWhack, NULL );
-            VectorWhack ( & x -> pfunc, SExpressionVWhack, NULL );
-            break;
-        }
-        case ePhysEncExpr:
-        {
-            SPhysEncExpr *x = ( SPhysEncExpr* ) self;
-            VectorWhack ( & x -> schem, SExpressionVWhack, NULL );
-            VectorWhack ( & x -> pfact, SExpressionVWhack, NULL );
-            break;
-        }
-        case eNegateExpr:
-        {
-            SUnaryExpr *x = ( SUnaryExpr* ) self;
-            SExpressionWhack ( x -> expr );
-            break;
-        }
-        case eCastExpr:
-        case eCondExpr:
-        {
-            SBinExpr *x = ( SBinExpr* ) self;
-            SExpressionWhack ( x -> left );
-            SExpressionWhack ( x -> right );
-            break;
-        }
-        case eVectorExpr:
-        {
-            SVectExpr *x = ( SVectExpr* ) self;
-            VectorWhack ( & x -> expr, SExpressionVWhack, NULL );
-            break;
-        }}
-
-        free ( self );
-    }
-}
-
-void CC SExpressionVWhack ( void *item, void *ignore )
-{
-    SExpression *self = item;
-    SExpressionWhack ( self );
-}
-#endif
-
-/* Mark
- */
-#if SLVL >= 1
-void CC SExpressionMark ( void * item, void * data )
-{
-    const SExpression * self = item;
-    const VSchema * schema = data;
-    if ( self != NULL ) switch ( self -> var )
-    {
-    case eTypeExpr:
-        STypeExprMark ( ( const STypeExpr* ) self, schema );
-        break;
-    case eConstExpr:
-        VSchemaTypeMark ( schema, ( ( const SConstExpr* ) self ) -> td . type_id );
-        break;
-    case eIndirectExpr:
-    case eParamExpr:
-    case eProdExpr:
-    case eFwdExpr:
-    case eFuncParamExpr:
-    case eColExpr:
-    case ePhysExpr:
-        SSymExprMark ( ( const SSymExpr* ) self, schema );
-        break;
-    case eFuncExpr:
-    case eScriptExpr:
-        SFuncExprMark ( ( const SFuncExpr* ) self, schema );
-        break;
-    case ePhysEncExpr:
-        SPhysEncExprMark ( ( const SPhysEncExpr* ) self, schema );
-        break;
-    case eNegateExpr:
-        SExpressionMark ( ( void * )( ( const SUnaryExpr* ) self ) -> expr, data );
-        break;
-    case eCastExpr:
-    case eCondExpr:
-        SExpressionMark ( ( void * )( ( const SBinExpr* ) self ) -> left, data );
-        SExpressionMark ( ( void * )( ( const SBinExpr* ) self ) -> right, data );
-        break;
-    case eVectorExpr:
-        VectorForEach ( & ( ( const SVectExpr* ) self ) -> expr, false,
-                        SExpressionMark, data );
-        break;
-    }
-}
-#endif
-
-/* Dump
- */
-#if SLVL >= 1
-bool CC SExpressionListDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SExpression *self = ( const void* ) item;
-
-    SDumperSep ( b );
-    b -> rc = SExpressionDump ( self, b );
-    SDumperSepString ( b, SDumperMode ( b ) == sdmCompact ? "," : ", " );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-rc_t SExpressionBracketListDump ( const Vector *expr, SDumper *b,
-    const char *begin, const char *end )
-{
-    SDumperSepString ( b, begin );
-    if ( VectorDoUntil ( expr, false, SExpressionListDump, b ) )
-        return b -> rc;
-    return SDumperPrint ( b, end );
-}
-
-static
-rc_t STypeExprDump ( const STypeExpr *self, SDumper *b )
-{
-    rc_t rc;
-    if ( self -> fmt != NULL )
-    {
-        rc = SFormatDump ( self -> fmt, b );
-        if ( rc != 0 )
-            return rc;
-
-        if ( self -> dt == NULL && self -> ts == NULL && self -> id == NULL )
-            return 0;
-
-        rc = SDumperWrite ( b, "/", 1 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    if ( self -> dt != NULL )
-        rc = SDatatypeDump ( self -> dt, b );
-    else if ( self -> ts != NULL )
-        rc = STypesetDump ( self -> ts, b );
-#if SLVL >= 3
-    else if ( self -> id != NULL )
-        rc = SIndirectTypeDump ( self -> id, b );
-#endif
-    else
-        rc = SDumperWrite ( b, "NULL", 4 );
-
-    if ( rc == 0 )
-    {
-        if ( SDumperMode ( b ) == sdmCompact )
-        {
-            if ( self -> dim != NULL )
-                rc = SDumperPrint ( b, "[%E]", self -> dim );
-            else if ( self -> fd . td . dim == 0 )
-                rc = SDumperPrint ( b, "[*]" );
-        }
-        else
-        {
-            if ( self -> dim != NULL )
-                rc = SDumperPrint ( b, " [ %E ]", self -> dim );
-            else if ( self -> fd . td . dim == 0 )
-                rc = SDumperPrint ( b, " [ * ]" );
-        }
-    }
-    
-    return rc;
-}
-
-static
-rc_t SConstExprDump ( const SConstExpr *self, SDumper *b )
-{
-    rc_t rc = 0;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-    const SDatatype *dt = VSchemaFindTypeid ( b -> schema, self -> td . type_id );
-    uint32_t bits = dt -> size;
-    uint32_t i, dim = SDatatypeIntrinsicDim ( dt );
-    assert ( dim != 0 && ( bits % dim ) == 0 );
-    bits /= dim;
-    dim *= self -> td . dim;
-
-    /* open a vector expression */
-    if ( dt -> domain < ddAscii && dim > 1 )
-    {
-        rc = SDumperPrint ( b, compact ? "[" : "[ " );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    SDumperSepString ( b, "" );
-
-    switch ( dt -> domain )
-    {
-    case ddBool:
-        for ( i = 0; i < dim; ++ i )
-        {
-            rc = SDumperPrint ( b, "\v%s", self -> u . b [ i ] ? "true" : "false" );
-            if ( rc != 0 )
-                return rc;
-            SDumperSepString ( b, compact ? "," : ", " );
-        }
-        break;
-    case ddUint:
-        switch ( bits )
-        {
-        case 8:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%u", self -> u . u8 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 16:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%u", self -> u . u16 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 32:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%u", self -> u . u32 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 64:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%lu", self -> u . u64 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        }
-        break;
-    case ddInt:
-        switch ( bits )
-        {
-        case 8:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%d", self -> u . i8 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 16:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%d", self -> u . i16 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 32:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%d", self -> u . i32 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 64:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%ld", self -> u . i64 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        }
-        break;
-    case ddFloat:
-        switch ( bits )
-        {
-        case 32:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%f", ( double ) self -> u . f32 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        case 64:
-            for ( i = 0; i < dim; ++ i )
-            {
-                rc = SDumperPrint ( b, "\v%f", self -> u . f64 [ i ] );
-                if ( rc != 0 )
-                    return rc;
-                SDumperSepString ( b, compact ? "," : ", " );
-            }
-            break;
-        }
-        break;
-    case ddAscii:
-    {
-        const char *end, *p;
-
-        rc = SDumperWrite ( b, "'", 1 );
-
-    do_ascii:
-        for ( p = self -> u . ascii, end = p + dim; rc == 0 && p < end; )
-        {
-            const char *start = p;
-            while ( p < end && isprint ( * p ) )
-                ++ p;
-            rc = SDumperWrite ( b, start, p - start );
-            if ( p == end )
-                break;
-
-            switch ( * p )
-            {
-            case '\n':
-                rc = SDumperWrite ( b, "\\n", 2 );
-                break;
-            case '\r':
-                rc = SDumperWrite ( b, "\\", 2 );
-                break;
-            case '\t':
-                rc = SDumperWrite ( b, "\\t", 2 );
-                break;
-            default:
-                rc = SDumperPrint ( b, "\\x%x%x", ( * ( uint8_t* ) p ) / 16, * p & 15 );
-            }
-            ++ p;
-        }
-        if ( rc == 0 )
-            rc = SDumperWrite ( b, "'", 1 );
-        return rc;
-    }
-    case ddUnicode:
-    {
-        rc = SDumperWrite ( b, "'", 1 );
-        if ( rc != 0 )
-            return rc;
-
-        if ( bits == 8 )
-            goto do_ascii;
-
-        for ( i = 0; i < dim; ++ i )
-        {
-            char buff [ 8 ];
-            uint32_t ch = ( bits == 16 ) ?
-                ( uint32_t )  self -> u . utf16 [ i ] :
-                self -> u . utf32 [ i ];
-
-            if ( ch >= 128 )
-                sprintf ( buff, "\\u%04x", ch );
-            else if ( isprint ( ( int ) ch ) )
-                buff [ 0 ] = ( char ) ch, buff [ 1 ] = 0;
-            else switch ( ch )
-            {
-            case '\n':
-                sprintf ( buff, "\\n" );
-                break;
-            case '\r':
-                sprintf ( buff, "\\r" );
-                break;
-            case '\t':
-                sprintf ( buff, "\\t" );
-                break;
-            default:
-                sprintf ( buff, "\\x%02x", ch );
-            }
-
-            rc = SDumperPrint ( b, buff );
-            if ( rc != 0 )
-                return rc;
-        }
-        if ( rc == 0 )
-            rc = SDumperWrite ( b, "'", 1 );
-        return rc;
-    }}
-
-    if ( rc == 0 && dim > 1 )
-        rc = SDumperPrint ( b, compact ? "]" : " ]" );
-
-    return rc;
-}
-
-#if SLVL >= 3
-static
-rc_t SFuncExprDump ( const SFuncExpr *self, SDumper *b )
-{
-    rc_t rc;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( VectorLength ( & self -> schem ) != 0 )
-    {
-        if ( compact )
-            rc = SExpressionBracketListDump ( & self -> schem, b, "<", ">" );
-        else
-            rc = SExpressionBracketListDump ( & self -> schem, b, "< ", " > " );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    rc = SFunctionDump ( self -> func, b );
-    if ( rc != 0 )
-        return rc;
-
-    rc = SDumperVersion ( b, self -> version_requested ?
-        self -> version : self -> func -> version );
-    if ( rc != 0 )
-        return rc;
-
-    if ( VectorLength ( & self -> pfact ) != 0 )
-    {
-        if ( compact )
-            rc = SExpressionBracketListDump ( & self -> pfact, b, "<", ">" );
-        else
-            rc = SExpressionBracketListDump ( & self -> pfact, b, " < ", " >" );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    if ( VectorLength ( & self -> pfunc ) == 0 )
-        rc = SDumperPrint ( b, compact ? "()" : " ()" );
-    else if ( compact )
-        rc = SExpressionBracketListDump ( & self -> pfunc, b, "(", ")" );
-    else
-        rc = SExpressionBracketListDump ( & self -> pfunc, b, " ( ", " )" );
-
-    return rc;
-}
-#endif
-
-#if SLVL >= 7
-static
-rc_t SPhysEncExprDump ( const SPhysEncExpr *self, SDumper *b )
-{
-    rc_t rc;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( VectorLength ( & self -> schem ) != 0 )
-    {
-        if ( compact )
-            rc = SExpressionBracketListDump ( & self -> schem, b, "<", ">" );
-        else
-            rc = SExpressionBracketListDump ( & self -> schem, b, "< ", " > " );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    rc = SPhysicalDump ( self -> phys, b );
-    if ( rc != 0 )
-        return rc;
-
-    if ( self -> version_requested )
-        rc = SDumperVersion ( b, self -> version );
-    else
-        rc = SDumperVersion ( b, self -> phys -> version );
-    if ( rc != 0 )
-        return rc;
-
-    if ( VectorLength ( & self -> pfact ) != 0 )
-    {
-        if ( compact )
-            rc = SExpressionBracketListDump ( & self -> pfact, b, "<", ">" );
-        else
-            rc = SExpressionBracketListDump ( & self -> pfact, b, " < ", " >" );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    return rc;
-}
-#endif
-
-rc_t SExpressionDump ( const SExpression *self, SDumper *b )
-{
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( self == NULL )
-        return SDumperWrite ( b, "NULL", 4 );
-
-    switch ( self -> var )
-    {
-    case eTypeExpr:
-        return STypeExprDump ( ( const STypeExpr* ) self, b );
-    case eConstExpr:
-        return SConstExprDump ( ( const SConstExpr* ) self, b );
-#if SLVL >= 3
-    case eIndirectExpr:
-    case eParamExpr:
-    case eProdExpr:
-    case eFwdExpr:
-    case eFuncParamExpr:
-    case eColExpr:
-    case ePhysExpr:
-    {
-        const SSymExpr *x = ( const SSymExpr* ) self;
-        if ( x -> alt )
-            return SDumperPrint ( b, "@%N", x -> _sym );
-        return KSymbolDump ( x -> _sym, b );
-    }
-    case eFuncExpr:
-#if SLVL >= 4
-    case eScriptExpr:
-#endif
-        return SFuncExprDump ( ( const SFuncExpr* ) self, b );
-#endif
-#if SLVL >= 7
-    case ePhysEncExpr:
-        return SPhysEncExprDump ( ( const SPhysEncExpr* ) self, b );
-#endif
-    case eNegateExpr:
-    {
-        const SUnaryExpr *x = ( const SUnaryExpr* ) self;
-        return SDumperPrint ( b, "-%E", x -> expr );
-    }
-    case eCastExpr:
-    {
-        const SBinExpr *x = ( const SBinExpr* ) self;
-        return SDumperPrint ( b, compact ? "(%E)%E" : "( %E ) %E", x -> left, x -> right );
-    }
-    case eCondExpr:
-    {
-        const SBinExpr *x = ( const SBinExpr* ) self;
-        return SDumperPrint ( b, compact ? "%E|%E" : "%E | %E", x -> left, x -> right );
-    }
-    case eVectorExpr:
-    {
-        const SVectExpr *x = ( const SVectExpr* ) self;
-        if ( compact )
-            return SExpressionBracketListDump ( & x -> expr, b, "[", "]" );
-        return SExpressionBracketListDump ( & x -> expr, b, "[ ", " ]" );
-    }}
-
-    return SDumperPrint ( b, "EXPR-UNKNOWN" );
-
-}
-
-bool SExpressionVDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SExpression *self = ( const void* ) item;
-
-    b -> rc = SExpressionDump ( self, b );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-#endif /* SLVL >= 1 */
-
-
-/*--------------------------------------------------------------------------
- * STypeExpr
- */
-
-/* Mark
- */
-void STypeExprMark ( const STypeExpr *self, const VSchema *schema )
-{
-    if ( self -> fmt != NULL )
-        SFormatMark ( self -> fmt );
-    if ( self -> dt != NULL )
-        SDatatypeMark ( self -> dt );
-    if ( self -> ts != NULL )
-        STypesetMark ( self -> ts, schema );
-    if ( self -> id != NULL )
-        SIndirectTypeMark ( ( void * )self -> id, ( void * )schema );
-    if ( self -> dim )
-        SExpressionMark ( ( void * )self -> dim, ( void * )schema );
-}
-
-
-/*--------------------------------------------------------------------------
- * SSymExpr
- */
-
-/* Make
- *  used when creating implicit expressions
- */
-rc_t SSymExprMake ( const SExpression **xp, const KSymbol *sym, uint32_t var )
-{
-    SSymExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    x -> dad . var = var;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> _sym = sym;
-    x -> alt = false;
-
-    * xp = & x -> dad;
-    return 0;
-}
-
-/* Mark
- */
-void SSymExprMark ( const SSymExpr *self, const VSchema *schema )
-{
-    switch ( self -> _sym -> type )
-    {
-    case eConstant:
-        SConstantMark ( self -> _sym -> u . obj );
-        break;
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * SFuncExpr
- */
-
-/* Mark
- */
-void SFuncExprMark ( const SFuncExpr *self, const VSchema *schema )
-{
-    SFunctionMark ( ( void * )self -> func, ( void * )schema );
-}
-
-
-/*--------------------------------------------------------------------------
- * SPhysEncExpr
- */
-
-/* ImplicitPhysEncExpr
- *  create expression object
- */
-rc_t VSchemaImplicitPhysEncExpr ( VSchema *self,
-    VTypedecl *td, const SExpression **expr, const char *text, const char *ctx )
-{
-    KSymTable tbl;
-    rc_t rc = init_symtab ( & tbl, self );
-    if ( rc == 0 )
-    {
-        KToken t;
-        KTokenText tt;
-        KTokenSource src;
-
-        SchemaEnv env;
-        SchemaEnvInit ( & env, EXT_SCHEMA_LANG_VERSION );
-
-        KTokenTextInitCString ( & tt, text, ctx );
-        KTokenSourceInit ( & src, & tt );
-        next_token ( & tbl, & src, & t );
-
-        rc = phys_encoding_expr ( & tbl, & src, & t, & env, self, td, expr );
-
-        KSymTableWhack ( & tbl );
-    }
-    return rc;
-}
-
-/* Mark
- */
-void SPhysEncExprMark ( const SPhysEncExpr *self, const VSchema *schema )
-{
-    SPhysicalMark ( ( void * )self -> phys, ( void * )schema );
-}
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-#if SLVL >= 1
-static
-rc_t const_vect_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SVectExpr **xp )
-{
-    rc_t rc;
-    SVectExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    x -> dad . var = eVectorExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    VectorInit ( & x -> expr, 0, 16 );
-
-    do
-    {
-        SExpression *vx;
-        rc = const_expr ( tbl, src, next_token ( tbl, src, t ),
-            env, self, ( const SExpression** ) & vx );
-        if ( rc != 0 )
-            break;
-
-        if ( vx -> var == eVectorExpr )
-        {
-            SExpressionWhack ( vx );
-            rc = KTokenExpected ( t, klogErr, "scalar constant" );
-            break;
-        }
-
-        rc = VectorAppend ( & x -> expr, NULL, vx );
-        if ( rc != 0 )
-        {
-            SExpressionWhack ( vx );
-            break;
-        }
-    }
-    while ( t -> id == eComma );
-
-    if ( rc != 0 )
-        SExpressionWhack ( & x -> dad );
-    else
-    {
-        * xp = x;
-        rc = expect ( tbl, src, t, eRightSquare, "]", true );
-    }
-
-    return rc;
-}
-#endif
-
-/*
- * const-expr         = <constname>
- *                    | CONST-VALUE
- */
-#if SLVL >= 1
-static
-rc_t negate_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **xp )
-{
-    rc_t rc = const_expr ( tbl, src, next_token ( tbl, src, t ), env, self, xp );
-    if ( rc == 0 )
-    {
-        SUnaryExpr *x;
-        SConstExpr *cx;
-        const SSymExpr *sx;
-        const SExpression *td;
-        const SDatatype *dt;
-
-        static atomic32_t s_I8_id;
-        static atomic32_t s_I16_id;
-        static atomic32_t s_I32_id;
-        static atomic32_t s_I64_id;
-
-        switch ( ( * xp ) -> var )
-        {
-        case eConstExpr:
-            cx = * ( SConstExpr** ) xp;
-            if ( cx -> td . dim < 2 )
-            {
-                dt = VSchemaFindTypeid ( self, cx -> td . type_id );
-                if ( dt != NULL ) switch ( dt -> domain )
-                {
-                case vtdUint:
-                    switch ( dt -> size )
-                    {
-                    case 8:
-                        cx -> td . type_id  = VSchemaCacheIntrinsicTypeId ( self, & s_I8_id, "I8" );
-                        break;
-                    case 16:
-                        cx -> td . type_id  = VSchemaCacheIntrinsicTypeId ( self, & s_I16_id, "I16" );
-                        break;
-                    case 32:
-                        cx -> td . type_id  = VSchemaCacheIntrinsicTypeId ( self, & s_I32_id, "I32" );
-                        break;
-                    case 64:
-                        cx -> td . type_id  = VSchemaCacheIntrinsicTypeId ( self, & s_I64_id, "I64" );
-                        break;
-                    }
-                    /* no break */
-                case vtdInt:
-                    switch ( dt -> size )
-                    {
-                    case 8:
-                        cx -> u . i8 [ 0 ] = - cx -> u . i8 [ 0 ];
-                        return 0;
-                    case 16:
-                        cx -> u . i16 [ 0 ] = - cx -> u . i16 [ 0 ];
-                        return 0;
-                    case 32:
-                        cx -> u . i32 [ 0 ] = - cx -> u . i32 [ 0 ];
-                        return 0;
-                    case 64:
-                        cx -> u . i64 [ 0 ] = - cx -> u . i64 [ 0 ];
-                        return 0;
-                    }
-                    break;
-                case vtdFloat:
-                    switch ( dt -> size )
-                    {
-                    case 32:
-                        cx -> u . f32 [ 0 ] = - cx -> u . f32 [ 0 ];
-                        return 0;
-                    case 64:
-                        cx -> u . f64 [ 0 ] = - cx -> u . f64 [ 0 ];
-                        return 0;
-                    }
-                    break;
-                }
-            }
-            break;
-
-        case eIndirectExpr:
-            /* if type is known, at least verify domain */
-            sx = * ( const SSymExpr** ) xp;
-            td = ( ( const SIndirectConst* ) sx -> _sym -> u . obj ) -> td;
-            if ( td != NULL )
-            {
-                const STypeExpr *tx = ( const STypeExpr* ) td;
-                if ( tx-> dad . var == eTypeExpr && tx -> resolved )
-                {
-                    /* cannot have formats, but this is verified elsewhere */
-                    if ( tx -> fd . fmt == 0 && tx -> fd . td . dim < 2 )
-                    {
-                        /* determine domain */
-                        dt = VSchemaFindTypeid ( self, tx -> fd . td . type_id );
-                        if ( dt != NULL ) switch ( dt -> domain )
-                        {
-                        case vtdUint:
-                            KTokenExpected ( t, klogWarn, "signed integer" );
-                        case vtdInt:
-                        case vtdFloat:
-                            goto introduce_negate_expr;
-                        }
-                    }
-                }
-
-                break;
-            }
-
-        introduce_negate_expr:
-            x = malloc ( sizeof * x );
-            if ( x == NULL )
-            {
-                SExpressionWhack ( & sx -> dad );
-                return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-            }
-
-            x -> dad . var = eNegateExpr;
-            atomic32_set ( & x -> dad . refcount, 1 );
-            x -> expr = & sx -> dad;
-            * xp = & x -> dad;
-            return 0;
-
-        case eNegateExpr:
-            /* double negate */
-            x = * ( SUnaryExpr** ) xp;
-            * xp = x -> expr;
-            free ( x );
-            return 0;
-
-        default:
-            SExpressionWhack ( * xp );
-            return KTokenExpected ( t, klogErr, "integer or floating point constant" );
-        }
-
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcType, rcIncorrect );
-        KTokenRCExplain ( t, klogErr, rc );
-    }
-
-    return rc;
-}
-
-static
-rc_t bool_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SConstExpr **xp )
-{
-    static atomic32_t s_bool_id;
-
-    SConstExpr *x = malloc ( sizeof * x - sizeof x -> u + sizeof x -> u . b [ 0 ] );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    assert ( t -> id == kw_true || t -> id == kw_false );
-    x -> u . b [ 0 ] = ( t -> id == kw_true );
-
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . type_id = VSchemaCacheIntrinsicTypeId ( self, & s_bool_id, "bool" );
-    x -> td . dim = 1;
-
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-static
-rc_t uint_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SConstExpr **xp )
-{
-    rc_t rc;
-    static atomic32_t s_U64_id;
-
-    SConstExpr *x = malloc ( sizeof * x - sizeof x -> u + sizeof x -> u . u64 [ 0 ] );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = KTokenToU64 ( t, & x -> u . u64 [ 0 ] );
-    if ( rc != 0 )
-    {
-        free ( x );
-        return rc;
-    }
-
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . type_id = VSchemaCacheIntrinsicTypeId ( self, & s_U64_id, "U64" );
-    x -> td . dim = 1;
-
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-static
-rc_t float_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SConstExpr **xp )
-{
-    rc_t rc;
-    static atomic32_t s_F64_id;
-
-    SConstExpr *x = malloc ( sizeof * x - sizeof x -> u + sizeof x -> u . f64 [ 0 ] );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = KTokenToF64 ( t, & x -> u . f64 [ 0 ] );
-    if ( rc != 0 )
-    {
-        free ( x );
-        return rc;
-    }
-
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . type_id = VSchemaCacheIntrinsicTypeId ( self, & s_F64_id, "F64" );
-    x -> td . dim = 1;
-
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-static
-rc_t string_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SConstExpr **xp )
-{
-    rc_t rc;
-
-    size_t size = t -> str . size + 1;
-    SConstExpr *x = malloc ( sizeof * x - sizeof x -> u + size );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = KTokenToString ( t, x -> u . utf8, size, & size );
-    if ( rc != 0 )
-    {
-        free ( x );
-        return rc;
-    }
-
-    x -> dad . var = eConstExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> td . dim = ( uint32_t ) size;
-
-    if ( t -> id == eString || ( size_t ) string_len ( x -> u . utf8, size ) == size )
-    {
-        static atomic32_t s_ascii_id;
-        x -> td . type_id = VSchemaCacheIntrinsicTypeId ( self, & s_ascii_id, "ascii" );
-    }
-    else
-    {
-        static atomic32_t s_utf8_id;
-        x -> td . type_id = VSchemaCacheIntrinsicTypeId ( self, & s_utf8_id, "utf8" );
-    }
-
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-static
-rc_t sym_const_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SConstExpr **xp )
-{
-    const KSymbol *sym = t -> sym;
-    const SConstant *cnst = sym -> u . obj;
-
-    assert ( cnst -> expr != NULL );
-    atomic32_inc ( & ( ( SExpression* ) cnst -> expr ) -> refcount );
-    * xp = ( SConstExpr* ) cnst -> expr;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-#endif /* SLVL >= 1 */
-
-
-#if SLVL >= 3
-LIB_EXPORT rc_t CC indirect_const_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **xp )
-{
-    SSymExpr *x = malloc ( sizeof *x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    x -> dad . var = eIndirectExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> _sym = t -> sym;
-    x -> alt = false;
-    * xp = & x -> dad;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-#endif /* SLVL >= 1 */
-
-/*
- * type-expr          = <typeset>
- *                    | <fmtdecl>
- *                    | <fmtname> '/' <typeset>
- */
-#if SLVL >= 1
-static
-rc_t type_expr_impl ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **fd, bool vardim )
-{
-    STypeExpr *x;
-
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    x = malloc ( sizeof *x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    x -> dad . var = eTypeExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> fmt = NULL;
-    x -> dt = NULL;
-    x -> ts = NULL;
-    x -> id = NULL;
-    x -> dim = NULL;
-    x -> fd . fmt = 0;
-    x -> fd . td . type_id = 0;
-    x -> fd . td . dim = 0;
-    x -> resolved = true;
-
-    if ( t -> id == eFormat )
-    {
-        x -> fmt = t -> sym -> u . obj;
-        x -> fd . fmt = x -> fmt -> id;
-        if ( next_token ( tbl, src, t ) -> id != eFwdSlash )
-        {
-            * fd = & x -> dad;
-            return 0;
-        }
-
-        rc = next_fqn ( tbl, src, next_token ( tbl, src, t ), env );
-        if ( rc != 0 )
-        {
-            free ( x );
-            return rc;
-        }
-    }
-
-    switch ( t -> id )
-    {
-    case eDatatype:
-        x -> dt = t -> sym -> u . obj;
-        x -> fd . td . type_id = x -> dt -> id;
-        break;
-    case eTypeset:
-        x -> ts = t -> sym -> u . obj;
-        x -> fd . td . type_id = x -> ts -> id;
-        break;
-#if SLVL >= 3
-    case eSchemaType:
-        x -> id = t -> sym -> u . obj;
-        x -> resolved = false;
-        break;
-#endif
-    default:
-        free ( x );
-        return KTokenExpected ( t, klogErr, "datatype or typeset" );
-    }
-
-    if ( next_token ( tbl, src, t ) -> id != eLeftSquare )
-        x -> fd . td . dim = 1;
-    else
-    {
-        if ( next_token ( tbl, src, t ) -> id == eAsterisk && vardim )
-            next_token ( tbl, src, t );
-        else
-        {
-            const SConstExpr *cx;
-
-            rc = const_expr ( tbl, src, t, env, self, & x -> dim );
-            if ( rc != 0 )
-            {
-                free ( x );
-                return rc;
-            }
-
-            switch ( x -> dim -> var )
-            {
-            case eConstExpr:
-                cx =  ( const SConstExpr* ) x -> dim;
-                if ( cx -> td . dim == 1 )
-                {
-                    const SDatatype *dt = VSchemaFindTypeid ( self, cx -> td . type_id );
-                    if ( dt != NULL && SDatatypeIntrinsicDim ( dt ) == 1 )
-                    {
-                        if ( dt -> domain == vtdUint )
-                        {
-                            switch ( dt -> size )
-                            {
-                            case 64:
-                                if ( cx -> u . u64 [ 0 ] <= 0xFFFFFFFF )
-                                    x -> fd . td . dim = ( uint32_t ) cx -> u . u64 [ 0 ];
-                                break;
-                            case 32:
-                                x -> fd . td . dim = cx -> u . u32 [ 0 ];
-                                break;
-                            case 16:
-                                x -> fd . td . dim = cx -> u . u16 [ 0 ];
-                                break;
-                            case 8:
-                                x -> fd . td . dim = cx -> u . u8 [ 0 ];
-                                break;
-                            }
-                        }
-                        else if ( dt -> domain ==  vtdInt )
-                        {
-                            switch ( dt -> size )
-                            {
-                            case 64:
-                                if ( cx -> u . i64 [ 0 ] > 0 && cx -> u . i64 [ 0 ] <= 0xFFFFFFFF )
-                                    x -> fd . td . dim = ( uint32_t ) cx -> u . i64 [ 0 ];
-                                break;
-                            case 32:
-                                if ( cx -> u . i32 [ 0 ] > 0 )
-                                    x -> fd . td . dim = cx -> u . i32 [ 0 ];
-                                break;
-                            case 16:
-                                if ( cx -> u . i16 [ 0 ] > 0 )
-                                    x -> fd . td . dim = cx -> u . i16 [ 0 ];
-                                break;
-                            case 8:
-                                if ( cx -> u . i8 [ 0 ] > 0 )
-                                    x -> fd . td . dim = cx -> u . i8 [ 0 ];
-                                break;
-                            }
-                        }
-
-                        if ( x -> fd . td . dim > 0 )
-                            break;
-                    }
-                }
-
-                SExpressionWhack ( & x -> dad );
-                return KTokenExpected ( t, klogErr, "constant integer expression" );
-
-            case eIndirectExpr:
-                x -> resolved = false;
-                break;
-            default:
-                SExpressionWhack ( & x -> dad );
-                return KTokenExpected ( t, klogErr, "constant integer expression" );
-            }
-        }
-
-        rc = expect ( tbl, src, t, eRightSquare, "]", true );
-        if ( rc != 0 )
-        {
-            SExpressionWhack ( & x -> dad );
-            return rc;
-        }
-    }
-    
-    * fd = & x -> dad;
-    return 0;
-}
-
-rc_t type_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **fd )
-{
-    return type_expr_impl ( tbl, src, t, env, self, fd, false );
-}
-
-rc_t vardim_type_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **fd )
-{
-    return type_expr_impl ( tbl, src, t, env, self, fd, true );
-}
-#endif /* SLVL >= 1 */
-
-
-/*
- * cast_expr          = '(' <type-expr> ')' <expression>
- */
-#if SLVL >= 1
-static
-rc_t cast_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SBinExpr **xp,
-    rc_t ( * expr ) ( KSymTable*, KTokenSource*, KToken*,
-        const SchemaEnv*, VSchema*, const SExpression** ) )
-{
-    rc_t rc;
-    SBinExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = type_expr ( tbl, src, next_token ( tbl, src, t ), env, self, & x -> left );
-    if ( rc == 0 )
-    {
-        rc = expect ( tbl, src, t, eRightParen, ")", true );
-        if ( rc == 0 )
-        {
-            rc = ( * expr ) ( tbl, src, t, env, self, & x -> right );
-            if ( rc == 0 )
-            {
-                x -> dad . var = eCastExpr;
-                atomic32_set ( & x -> dad . refcount, 1 );
-                * xp = x;
-                return 0;
-            }
-        }
-
-        SExpressionWhack ( x -> left );
-    }
-
-    free ( x );
-    return rc;
-}
-
-
-rc_t const_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, const SExpression **xp )
-{
-    switch ( t -> id )
-    {
-    case eDecimal:
-    case eHex:
-    case eOctal:
-        return uint_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eFloat:
-    case eExpFloat:
-        return float_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eString:
-    case eEscapedString:
-        return string_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eConstant:
-        return sym_const_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-#if SLVL >= 4
-    case eFactParam:
-#endif
-#if SLVL >= 3
-    case eSchemaParam:
-        return indirect_const_expr ( tbl, src, t, env, self, xp );
-#endif
-    case eLeftSquare:
-        return const_vect_expr ( tbl, src, t, env, self, ( const SVectExpr** ) xp );
-    case kw_false:
-    case kw_true:
-        return bool_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eLeftParen:
-        return cast_expr ( ( KSymTable* ) tbl, src, t, env,
-            ( VSchema* ) self, ( const SBinExpr** ) xp,
-            ( rc_t ( * ) ( KSymTable*, KTokenSource*, KToken*,
-              const SchemaEnv*, VSchema*, const SExpression** ) ) const_expr );
-    case eMinus:
-        /* unary minus sign */
-        return negate_expr ( tbl, src, t, env, self, xp );
-    case ePlus:
-        /* unary plus sign */
-        return const_expr ( tbl, src, next_token ( tbl, src, t ), env, self, xp );
-    }
-
-    return KTokenExpected ( t, klogErr, "boolean, integer, float, string or symbolic constant" );
-}
-#endif /* SLVL >= 1 */
-
-
-/*
- * func-param-expr    = <funcname>
- */
-#if SLVL >= 4
-static
-rc_t sym_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SSymExpr **xp, uint32_t var, bool alt )
-{
-    SSymExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    x -> dad . var = var;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> _sym = t -> sym;
-    x -> alt = alt;
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-#define func_param_expr( tbl, src, t, env, self, xp ) \
-    sym_expr ( tbl, src, t, env, self, xp, eFuncParamExpr, false )
-
-#endif
-
-
-/*
- * param-expr         = <func-param>
- * 
- */
-#if SLVL >= 4
-
-#define param_expr( tbl, src, t, env, self, xp ) \
-    sym_expr ( tbl, src, t, env, self, xp, eParamExpr, false )
-
-#endif
-
-
-/*
- * prod-expr          = <production>
- * 
- */
-#if SLVL >= 4
-
-#define prod_expr( tbl, src, t, env, self, xp ) \
-    sym_expr ( tbl, src, t, env, self, xp, eProdExpr, false )
-
-#endif
-
-
-/*
- * fwd-expr           = ID
- */
-#if SLVL >= 4
-static
-rc_t fwd_decl_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SSymExpr **xp, bool alt )
-{
-    rc_t rc;
-    SSymExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = KSymTableCreateConstSymbol ( tbl, & x -> _sym, & t -> str, eForward, NULL );
-    if ( rc != 0 )
-    {
-        free ( x );
-        return rc;
-    }
-
-    x -> dad . var = eFwdExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> alt = alt;
-    * xp = x;
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-#define fwd_ref_expr( tbl, src, t, env, self, xp, alt ) \
-    sym_expr ( tbl, src, t, env, self, xp, eFwdExpr, alt )
-
-#endif
-
-
-/*
- * column-expr        = <column>
- */
-#if SLVL >= 8
-
-#define column_expr( tbl, src, t, env, self, xp, alt ) \
-    sym_expr ( tbl, src, t, env, self, xp, eColExpr, alt )
-
-#endif
-
-
-/*
- * physical-expr      = KCOL
- */
-#if SLVL >= 7
-
-#define physical_expr( tbl, src, t, env, self, xp ) \
-    sym_expr ( tbl, src, t, env, self, xp, ePhysExpr, false )
-
-#endif
-
-
-/*
- * schema-parms       = <schema-param> [ ',' <schema-parms> ]
- * schema-param       = [ ID '=' ]  <schema-value>
- * schema-value       = <fmtdecl>
- *                    | <uint-expr>
- */
-#if SLVL >= 4
-static
-rc_t schema_value ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **v )
-{
-    /* could be a typename */
-    if ( t -> id == eNamespace )
-    {
-        rc_t rc = next_fqn ( tbl, src, t, env );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* param value */
-    switch ( t -> id )
-    {
-    /* type parameter */
-    case eFormat:
-    case eDatatype:
-    case eTypeset:
-    case eSchemaType:
-        return type_expr ( tbl, src, t, env, self, v );
-
-    /* manifest uint constant */
-    case eDecimal:
-    case eHex:
-    case eOctal:
-        return uint_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-
-    /* symbolic constant must be uint */
-    case eConstant:
-        return sym_const_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-
-    /* schema or factory constant must be uint
-       but may not yet be completely resolved */
-    case eSchemaParam:
-    case eFactParam:
-        return indirect_const_expr ( tbl, src, t, env, self, v );
-    }
-
-    return KTokenExpected ( t, klogErr, "data type or unsigned int constant" );
-}
-#endif
-
-/*
- * fact-parms         = <fact-param> [ ',' <fact-parms> ]
- * fact-param         = [ ID '=' ] <fact-value>
- * fact-value         = <func-name>
- *                    | '[' <fact-const-list> ']'
- */
-#if SLVL >= 4
-static
-rc_t fact_value ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **v )
-{
-    if ( t -> id == eNamespace )
-    {
-        rc_t rc = next_fqn ( tbl, src, t, env );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    switch ( t -> id )
-    {
-        /* const-expression */
-    case eDecimal:
-    case eHex:
-    case eOctal:
-        return uint_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eFloat:
-    case eExpFloat:
-        return float_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eString:
-    case eEscapedString:
-        return string_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eConstant:
-        return sym_const_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eSchemaParam:
-    case eFactParam:
-        return indirect_const_expr ( tbl, src, t, env, self, v );
-    case eLeftSquare:
-        return const_vect_expr ( tbl, src, t, env, self, ( const SVectExpr** ) v );
-    case kw_false:
-    case kw_true:
-        return bool_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-
-        /* cast expression */
-    case eLeftParen:
-        return cast_expr ( tbl, src, t, env, self, ( const SBinExpr** ) v, fact_value );
-
-        /* function name */
-    case eFunction:
-        return func_param_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v );
-
-    case eMinus:
-        /* unary minus sign */
-        return negate_expr ( tbl, src, t, env, self, v );
-    case ePlus:
-        /* unary plus sign */
-        return const_expr ( tbl, src, next_token ( tbl, src, t ), env, self, v );
-    }
-
-    return KTokenExpected ( t, klogErr, "constant, function param or cast operator" );
-}
-
-static
-rc_t old_fact_value ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **v )
-{
-    switch ( t -> id )
-    {
-        /* const-expression */
-    case eDecimal:
-    case eHex:
-    case eOctal:
-        return uint_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eFloat:
-    case eExpFloat:
-        return float_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eString:
-    case eEscapedString:
-        return string_expr ( tbl, src, t, env, self, ( const SConstExpr** ) v );
-    case eMinus:
-        return negate_expr ( tbl, src, t, env, self, v );
-    case ePlus:
-        return old_fact_value ( tbl, src, next_token ( tbl, src, t ), env, self, v );
-    }
-
-    return RC ( rcVDB, rcSchema, rcParsing, rcNoObj, rcNoErr );
-}
-#endif
-
-/*
- *    func-parms         = <func-param> [ ',' <func-parms> ]
- *    func-param         = <colname>
- *                       | <physname>
- *                       | <production>
- *                       | <parmname>
- */
-#if SLVL >= 4
-static
-rc_t param_value ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **v )
-{
-    KToken t2;
-    bool alt = false;
-
-    /* look for special modifiers */
-    switch ( t -> id )
-    {
-#if SLVL >= 7
-    case ePeriod:
-        /* detect special syntax for physical column names */
-        physical_name ( tbl, src, t, env );
-        break;
-#endif
-    case eAtSign:
-
-        /* detect alternate column source */
-        switch ( next_token ( tbl, src, & t2 ) -> id )
-        {
-#if SLVL >= 8
-        case eColumn:
-#endif
-        case eIdent:
-        case eForward:
-        case eVirtual:
-            * t = t2;
-            alt = true;
-            break;
-
-        default:
-            KTokenSourceReturn ( src, & t2 );
-        }
-        break;
-    }
-
-    switch ( t -> id )
-    {
-    /* handle function or script params, named productions */
-#if SLVL >= 5
-    case eAtSign:
-        t -> sym = KSymTableFind ( tbl, & t -> str );
-        if ( t -> sym == NULL )
-            break;
-        t -> id = t -> sym -> type;
-        /* no break */
-#endif
-    case eFuncParam:
-        return param_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v );
-    case eProduction:
-        return prod_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v );
-
-    /* forward reference */
-    case eIdent:
-        return fwd_decl_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v, alt );
-    case eForward:
-    case eVirtual:
-        return fwd_ref_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v, alt );
-#if SLVL >= 8
-    /* column expression */
-    case eColumn:
-        return column_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v, alt );
-#endif
-#if SLVL >= 7
-    /* physical column expression */
-    case ePhysMember:
-        return physical_expr ( tbl, src, t, env, self, ( const SSymExpr** ) v );
-#endif
-    /* cast expression */
-    case eLeftParen:
-        return cast_expr ( tbl, src, t, env, self, ( const SBinExpr** ) v, param_value );
-    }
-
-    return KTokenExpected ( t, klogErr, "column or production name or cast operator" );
-}
-
-static
-rc_t param_list ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, Vector *v,
-    rc_t ( * value ) ( KSymTable*, KTokenSource*, KToken*,
-        const SchemaEnv*, VSchema*, const SExpression** ) )
-{
-    rc_t rc;
-    const SExpression *x;
-
-    while ( 1 )
-    {
-        /* param value */
-        rc = ( * value ) ( tbl, src, t, env, self, & x );
-        if ( rc != 0 )
-            return rc;
-
-        /* record parameter */
-        rc = VectorAppend ( v, NULL, x );
-        if ( rc != 0 )
-        {
-            SExpressionWhack ( x );
-            return KTokenRCExplain ( t, klogInt, rc );
-        }
-
-        if ( t -> id != eComma )
-            break;
-
-        next_token ( tbl, src, t );
-    }
-
-    return 0;
-}
-
-static
-rc_t func_expression ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFuncExpr *fx, const KSymbol **sym )
-{
-    rc_t rc;
-
-    /* schema-parms */
-    if ( t -> id == eLeftAngle )
-    {
-        next_token ( tbl, src, t );
-        rc = param_list ( tbl, src, t, env, self, & fx -> schem, schema_value );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eRightAngle, ">", true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* locate function or schema */
-    rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    if ( t -> id != eScriptFunc && t -> id != eFunction )
-        return KTokenExpected ( t, klogErr, "function" );
-    * sym = t -> sym;
-
-    /* look for requested version */
-    if ( next_token ( tbl, src, t ) -> id == eHash )
-    {
-        fx -> version_requested = true;
-        rc = maj_min_rel ( tbl, src, next_token ( tbl, src, t ),
-            env, self,  & fx -> version, false );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* look for factory params */
-    if ( t -> id == eLeftAngle && ! env -> mixed_fact_param_list )
-    {
-        next_token ( tbl, src, t );
-        rc = param_list ( tbl, src, t, env, self, & fx -> pfact, fact_value );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eRightAngle, ">", true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* function params */
-    if ( t -> id != eLeftParen )
-        return KTokenExpected ( t, klogErr, "(" );
-    if ( next_token ( tbl, src, t ) -> id != eRightParen )
-    {
-        /* handle old-style fact params */
-        if ( env -> mixed_fact_param_list )
-        {
-            rc = param_list ( tbl, src, t, env, self, & fx -> pfact, old_fact_value );
-            if ( GetRCState ( rc ) == rcNoErr )
-                rc = 0;
-        }
-
-        /* handle normal function params */
-        if ( rc == 0 )
-            rc = param_list ( tbl, src, t, env, self, & fx -> pfunc, param_value );
-    }
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eRightParen, ")", true );
-
-    return rc;
-}
-
-static
-rc_t func_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SFuncExpr **xp )
-{
-    rc_t rc;
-    const KSymbol *sym = NULL;
-
-    SFuncExpr *fx = malloc ( sizeof * fx );
-    if ( fx == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    /* initialize */
-    fx -> dad . var = eFuncExpr;
-    atomic32_set ( & fx -> dad . refcount, 1 );
-    fx -> func = NULL;
-    VectorInit ( & fx -> schem, 0, 4 );
-    VectorInit ( & fx -> pfact, 0, 8 );
-    VectorInit ( & fx -> pfunc, 0, 8 );
-    fx -> version = 0;
-    fx -> version_requested = false;
-    fx -> untyped = false;
-
-    /* parse expression */
-    rc = func_expression ( tbl, src, t, env, self, fx, & sym );
-    if ( rc == 0 )
-    {
-        const SNameOverload *vf = sym -> u . obj;
-
-        /* match expression */
-        if ( vf -> name -> type == eScriptFunc )
-            fx -> dad . var = eScriptExpr;
-
-        if ( fx -> version_requested )
-        {
-            fx -> func =
-                VectorFind ( & vf -> items, & fx -> version, NULL, SFunctionCmp );
-        }
-        else
-        {
-            fx -> func = VectorLast ( & vf -> items );
-        }
-
-        * xp = fx;
-        return 0;
-    }
-
-    SExpressionWhack ( & fx -> dad );
-    return rc;
-}
-#endif /* SLVL >= 4 */
-
-/*
- * expression         = <param-value>
- *                    | <func-expr>
- *                    | '(' <type-expr> ')' <expression>
- */
-#if SLVL >= 4
-rc_t expression ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **xp )
-{
-    rc_t rc;
-
-    if ( t -> id == eNamespace )
-    {
-        rc = next_fqn ( tbl, src, t, env );
-        if ( rc != 0 )
-            return rc;
-    }
-
-#if SLVL >= 7
-    /* detect special syntax for physical column names */
-    if ( t -> id == ePeriod )
-        physical_name ( tbl, src, t, env );
-#endif
-
-    switch ( t -> id )
-    {
-    /* handle function or script params, named productions */
-#if SLVL >= 5
-    case eAtSign:
-        t -> sym = KSymTableFind ( tbl, & t -> str );
-        if ( t -> sym == NULL )
-            break;
-        t -> id = t -> sym -> type;
-        /* no break */
-#endif
-    case eFuncParam:
-        return param_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp );
-    case eProduction:
-        return prod_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp );
-
-    /* forward reference */
-    case eIdent:
-        return fwd_decl_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp, false );
-    case eForward:
-    case eVirtual:
-        return fwd_ref_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp, false );
-#if SLVL >= 8
-    /* column expression */
-    case eColumn:
-        return column_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp, false );
-#endif
-#if SLVL >= 7
-    /* physical column expression */
-    case ePhysMember:
-        return physical_expr ( tbl, src, t, env, self, ( const SSymExpr** ) xp );
-#endif
-    /* function expression */
-    case eLeftAngle:
-    case eFunction:
-    case eScriptFunc:
-        return func_expr ( tbl, src, t, env, self, ( const SFuncExpr** ) xp );
-
-    /* cast expression */
-    case eLeftParen:
-        return cast_expr ( tbl, src, t, env, self,
-            ( const SBinExpr** ) xp, expression );
-
-    /* type expression */
-    case eFormat:
-    case eDatatype:
-    case eTypeset:
-    case eSchemaType:
-        return type_expr ( tbl, src, t, env, self, xp );
-
-    /* in case expression gets used for const-expression */
-    case eDecimal:
-    case eHex:
-    case eOctal:
-        return uint_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eFloat:
-    case eExpFloat:
-        return float_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eString:
-    case eEscapedString:
-        return string_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eConstant:
-        return sym_const_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-    case eSchemaParam:
-    case eFactParam:
-        return indirect_const_expr ( tbl, src, t, env, self, xp );
-    case eLeftSquare:
-        return const_vect_expr ( tbl, src, t, env, self, ( const SVectExpr** ) xp );
-    case kw_false:
-    case kw_true:
-        return bool_expr ( tbl, src, t, env, self, ( const SConstExpr** ) xp );
-
-    case eMinus:
-        /* unary minus sign */
-        return negate_expr ( tbl, src, t, env, self, xp );
-    case ePlus:
-        /* unary plus sign */
-        return const_expr ( tbl, src, next_token ( tbl, src, t ), env, self, xp );
-    }
-
-    return KTokenExpected ( t, klogErr, "production name, column name, function or cast expression" );
-}
-#endif /* SLVL >= 4 */
-
-
-/*
- * cond-expr          = <expression> [ '|' <cond-expr> ]
- */
-#if SLVL >= 4
-rc_t cond_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **xp )
-{
-    rc_t rc = expression ( tbl, src, t, env, self, xp );
-    if ( rc != 0 )
-        return rc;
-
-    if ( t -> id == ePipe )
-    {
-        SBinExpr *x = malloc ( sizeof * x );
-        if ( x == NULL )
-        {
-            SExpressionWhack ( * xp ), * xp = NULL;
-            return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        }
-
-        x -> dad . var = eCondExpr;
-        atomic32_set ( & x -> dad . refcount, 1 );
-        x -> left = * xp;
-        x -> right = NULL;
-        * xp = & x -> dad;
-
-        rc = cond_expr ( tbl, src, next_token ( tbl, src, t ), env, self, & x -> right );
-        if ( rc != 0 )
-        {
-            SExpressionWhack ( & x -> dad );
-            * xp = NULL;
-        }
-    }
-
-    return rc;
-}
-#endif /* SLVL >= 4 */
-
-/*
- * untyped-expr       = <fmtdecl> | <untyped-func-name> '(' ')'
- */
-#if SLVL >= 6
-static
-rc_t untyped_func_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SFuncExpr **xp )
-{
-    rc_t rc;
-    const KSymbol *sym = t -> sym;
-
-    /* expect empty parameter list */
-    next_token ( tbl, src, t );
-    rc = expect ( tbl, src, t, eLeftParen, "(", true );
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eRightParen, ")", true );
-    if ( rc == 0 )
-    {
-        const SNameOverload *vf = sym -> u . obj;
-
-        SFuncExpr *fx = malloc ( sizeof * fx );
-        if ( fx == NULL )
-            return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-        /* initialize */
-        fx -> dad . var = eFuncExpr;
-        atomic32_set ( & fx -> dad . refcount, 1 );
-        VectorInit ( & fx -> schem, 0, 4 );
-        VectorInit ( & fx -> pfact, 0, 8 );
-        VectorInit ( & fx -> pfunc, 0, 8 );
-        fx -> version = 0;
-        fx -> version_requested = false;
-        fx -> untyped = true;
-
-        fx -> func = VectorLast ( & vf -> items );
-
-        * xp = fx;
-        return 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC untyped_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, const SExpression **xp )
-{
-    rc_t rc;
-
-    if ( t -> id == eNamespace )
-    {
-        rc = next_fqn ( tbl, src, t, env );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    switch ( t -> id )
-    {
-    /* function expression */
-    case eUntypedFunc:
-        return untyped_func_expr ( tbl, src, t, env, self, ( const SFuncExpr** ) xp );
-
-    /* type expression */
-    case eFormat:
-        return type_expr ( tbl, src, t, env, self, xp );
-    }
-
-    return KTokenExpected ( t, klogErr, "type or function expression" );
-}
-#endif /* SLVL >= 6 */
-
-
-/*
- * phys-encoding-expr = [ '<' <schema-parms> '>' ]
- *                      <phys-encoding-name> [ '#' <maj-min-rel> ]
- *                      [ '<' <fact-params> '>' ]
- */
-#if SLVL >= 7
-static
-rc_t phys_enc_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SPhysEncExpr *x, const KSymbol **sym )
-{
-    rc_t rc;
-
-    /* schema parms */
-    if ( t -> id == eLeftAngle )
-    {
-        next_token ( tbl, src, t );
-        rc = param_list ( tbl, src, t, env, self, & x -> schem, schema_value );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eRightAngle, ">", true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* phys-encoding-name */
-    rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    if ( t -> id != ePhysical )
-        return KTokenExpected ( t, klogErr, "physical encoding" );
-    * sym = t -> sym;
-
-
-    /* look for requested version */
-    if ( next_token ( tbl, src, t ) -> id == eHash )
-    {
-        x -> version_requested = true;
-        rc = maj_min_rel ( tbl, src, next_token ( tbl, src, t ),
-            env, self,  & x -> version, false );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* look for factory params */
-    if ( t -> id == eLeftAngle )
-    {
-        next_token ( tbl, src, t );
-        rc = param_list ( tbl, src, t, env, self, & x -> pfact, fact_value );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eRightAngle, ">", true );
-    }
-
-    return rc;
-}
-
-rc_t phys_encoding_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, VTypedecl *td, const SExpression **xp )
-{
-    rc_t rc;
-    const KSymbol *sym = NULL;
-
-    SPhysEncExpr *x = malloc ( sizeof * x );
-    if ( x == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    /* initialize */
-    x -> dad . var = ePhysEncExpr;
-    atomic32_set ( & x -> dad . refcount, 1 );
-    x -> phys = NULL;
-    VectorInit ( & x -> schem, 0, 4 );
-    VectorInit ( & x -> pfact, 0, 8 );
-    x -> version = 0;
-    x -> version_requested = false;
-
-    /* parse expression */
-    rc = phys_enc_expr ( tbl, src, t, env, self, x, & sym );
-    if ( rc == 0 )
-    {
-        const SNameOverload *name = sym -> u . obj;
-
-        if ( x -> version_requested )
-        {
-            x -> phys =
-                VectorFind ( & name -> items, & x -> version, NULL, SPhysicalCmp );
-        }
-        else
-        {
-            x -> phys = VectorLast ( & name -> items );
-        }
-
-        /* evaluate type expression */
-        if ( td != NULL )
-        {
-            /* bind schema parameters */
-            Vector prior;
-            rc = SPhysicalBindSchemaParms ( x -> phys, & prior, & x -> schem );
-            if ( rc == 0 )
-            {
-                const SExpression *tx = x -> phys -> td;
-                assert ( tx != NULL );
-                rc = STypeExprResolveAsTypedecl ( ( const STypeExpr* ) tx, self, td );
-                SPhysicalRestSchemaParms ( x -> phys, & prior );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            * xp = & x -> dad;
-            return 0;
-        }
-    }
-
-    SExpressionWhack ( & x -> dad );
-    return rc;
-}
-#endif
diff --git a/libs/vdb/schema-expr.h b/libs/vdb/schema-expr.h
deleted file mode 100644
index 40e9337..0000000
--- a/libs/vdb/schema-expr.h
+++ /dev/null
@@ -1,396 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_schema_expr_
-#define _h_schema_expr_
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#ifndef _h_atomic32_
-#include <atomic32.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KSymbol;
-struct VSchema;
-struct SFormat;
-struct SDatatype;
-struct STypeset;
-struct SIndirectType;
-struct SPhysical;
-struct SDumper;
-
-
-/*--------------------------------------------------------------------------
- * SExpression
- *  supertype of all expressions
- */
-enum
-{
-    /* a type expression */
-    eTypeExpr,
-
-    /* constant or indirect constant expr */
-    eConstExpr, eIndirectExpr,
-
-    /* functional param, schema or table production */
-    eParamExpr, eProdExpr, eFwdExpr,
-
-    /* a function passed as a parameter */
-    eFuncParamExpr,
-
-    /* extern or physical column expression */
-    eColExpr, ePhysExpr,
-
-    /* functional expression */
-    eFuncExpr, eScriptExpr,
-
-    /* physical encoding expression */
-    ePhysEncExpr,
-
-    /* cast operator expression */
-    eCastExpr,
-
-    /* unary negation */
-    eNegateExpr,
-
-    /* conditional expression */
-    eCondExpr,
-
-    /* vector expression */
-    eVectorExpr
-};
-
-typedef struct SExpression SExpression;
-struct SExpression
-{
-    uint32_t var;
-
-    /* this could be KRefcount */
-    atomic32_t refcount;
-};
-
-/* Whack
- */
-void SExpressionWhack ( const SExpression *self );
-void CC SExpressionVWhack ( void *item, void *ignore );
-
-/* Mark
- */
-void CC SExpressionMark ( void * item, void * data );
-
-/* Dump
- */
-rc_t SExpressionDump ( const SExpression *self, struct SDumper *d );
-bool SExpressionVDump ( void *item, void *dumper );
-bool CC SExpressionListDump ( void *item, void *dumper );
-rc_t SExpressionBracketListDump ( const Vector *expr, struct SDumper *d,
-    const char *begin, const char *end );
-
-
-/*--------------------------------------------------------------------------
- * STypeExpr
- *  handles general form of what has been called a typedecl,
- *  with an optional blob format, type, typeset, indirect type,
- *  and a const dimension expression.
- *
- *  when properly resolved, "fd" contains runtime values
- */
-typedef struct STypeExpr STypeExpr;
-struct STypeExpr
-{
-    SExpression dad;
-
-    struct SFormat const *fmt;
-    struct SDatatype const *dt;
-    struct STypeset const *ts;
-    struct SIndirectType const *id;
-    const SExpression *dim;
-
-    VFormatdecl fd;
-    bool resolved;
-};
-
-
-/* Resolve
- *  resolve type expression to either a VTypedecl or VFormatdecl
- */
-rc_t STypeExprResolveAsTypedecl ( const STypeExpr *self,
-    struct VSchema const *schema, VTypedecl *td );
-rc_t STypeExprResolveAsFormatdecl ( const STypeExpr *self,
-    struct VSchema const *schema, VFormatdecl *fd );
-
-/* Mark
- */
-void STypeExprMark ( const STypeExpr *self, struct VSchema const *schema );
-
-
-/*--------------------------------------------------------------------------
- * SConstExpr
- *  handles a vector of constant values
- *  evaluated from manifest or direct symbolic constants
- *
- *  "td" holds both an appropriate constant type
- *  as well as vector dimension
- *
- *  when td.type_id is utf8, dim gives
- *  the number of bytes rather than characters.
- */
-typedef struct SConstExpr SConstExpr;
-struct SConstExpr
-{
-    SExpression dad;
-
-    VTypedecl td;
-    union
-    {
-        /* bool */
-        bool b [ 8 ];
-
-        /* integer */
-        int8_t i8 [ 8 ];
-        int16_t i16 [ 4 ];
-        int32_t i32 [ 2 ];
-        int64_t i64 [ 1 ];
-
-        /* unsigned integer */
-        uint8_t u8 [ 8 ];
-        uint16_t u16 [ 4 ];
-        uint32_t u32 [ 2 ];
-        uint64_t u64 [ 1 ];
-
-        /* float */
-        float f32 [ 2 ];
-        double f64 [ 1 ];
-
-        /* ascii */
-        char ascii [ 8 ];
-
-        /* unicode */
-        char utf8 [ 8 ];
-        uint16_t utf16 [ 4 ];
-        uint32_t utf32 [ 2 ];
-
-    } u;
-};
-
-
-/* Resolve
- *  return constant expression as a vector of indicated type
- */
-rc_t SConstExprResolveAsBool ( const SConstExpr *self,
-    struct VSchema const *schema, bool *b, uint32_t capacity );
-rc_t SConstExprResolveAsI8 ( const SConstExpr *self,
-    struct VSchema const *schema, int8_t *i8, uint32_t capacity );
-rc_t SConstExprResolveAsI16 ( const SConstExpr *self,
-    struct VSchema const *schema, int16_t *i16, uint32_t capacity );
-rc_t SConstExprResolveAsI32 ( const SConstExpr *self,
-    struct VSchema const *schema, int32_t *i32, uint32_t capacity );
-rc_t SConstExprResolveAsI64 ( const SConstExpr *self,
-    struct VSchema const *schema, int64_t *i64, uint32_t capacity );
-rc_t SConstExprResolveAsU8 ( const SConstExpr *self,
-    struct VSchema const *schema, uint8_t *u8, uint32_t capacity );
-rc_t SConstExprResolveAsU16 ( const SConstExpr *self,
-    struct VSchema const *schema, uint16_t *u16, uint32_t capacity );
-rc_t SConstExprResolveAsU32 ( const SConstExpr *self,
-    struct VSchema const *schema, uint32_t *u32, uint32_t capacity );
-rc_t SConstExprResolveAsU64 ( const SConstExpr *self,
-    struct VSchema const *schema, uint32_t *u64, uint32_t capacity );
-rc_t SConstExprResolveAsF32 ( const SConstExpr *self,
-    struct VSchema const *schema, float *f32, uint32_t capacity );
-rc_t SConstExprResolveAsF64 ( const SConstExpr *self,
-    struct VSchema const *schema, double *f64, uint32_t capacity );
-rc_t SConstExprResolveAsAscii ( const SConstExpr *self,
-    struct VSchema const *schema, char *ascii, size_t capacity );
-rc_t SConstExprResolveAsUTF8 ( const SConstExpr *self,
-    struct VSchema const *schema, char *utf8, size_t bytes );
-rc_t SConstExprResolveAsUTF16 ( const SConstExpr *self,
-    struct VSchema const *schema, uint16_t *utf16, uint32_t capacity );
-rc_t SConstExprResolveAsUTF32 ( const SConstExpr *self,
-    struct VSchema const *schema, uint32_t *utf32, uint32_t capacity );
-
-
-/*--------------------------------------------------------------------------
- * SSymExpr
- *  holds a symbolic object reference
- *  used for productions and columns and indirect constants
- *  the productions and columns may be forward declarations,
- *  in which case the symbol will point to NULL when dereferenced.
- */
-typedef struct SSymExpr SSymExpr;
-struct SSymExpr
-{
-    SExpression dad;
-    struct KSymbol const *_sym;
-    bool alt;
-};
-
-/* Make
- *  used when creating implicit expressions
- */
-rc_t SSymExprMake ( const SExpression **xp,
-    struct KSymbol const *sym, uint32_t var );
-
-/* Mark
- */
-void SSymExprMark ( const SSymExpr *self, struct VSchema const *schema );
-
-
-/*--------------------------------------------------------------------------
- * SFuncExpr
- *  gathers schema, factory and functional parameter expressions
- *  locates and dereferences function or script by name and version
- */
-typedef struct SFuncExpr SFuncExpr;
-struct SFuncExpr
-{
-    SExpression dad;
-
-    /* some sort of expression */
-    struct SFunction const *func;
-
-    /* schema type and constant params */
-    Vector schem;
-
-    /* factory params */
-    Vector pfact;
-
-    /* function params */
-    Vector pfunc;
-
-    /* requested version */
-    uint32_t version;
-    bool version_requested;
-
-    /* for purposes of obtaining column info
-       in the absence of metadata */
-    bool untyped;
-};
-
-/* Mark
- */
-void SFuncExprMark ( const SFuncExpr *self, struct VSchema const *schema );
-
-
-/*--------------------------------------------------------------------------
- * SPhysEncExpr
- *  
- */
-typedef struct SPhysEncExpr SPhysEncExpr;
-struct SPhysEncExpr
-{
-    SExpression dad;
-
-    /* physical encoding */
-    struct SPhysical const *phys;
-
-    /* schema type and constant params */
-    Vector schem;
-
-    /* factory params */
-    Vector pfact;
-
-    /* requested version */
-    uint32_t version;
-    bool version_requested;
-};
-
-/* ImplicitPhysEncExpr
- *  create expression object
- */
-rc_t VSchemaImplicitPhysEncExpr ( VSchema *self, VTypedecl *td,
-    const SExpression **expr, const char *text, const char *ctx );
-
-/* Mark
- */
-void SPhysEncExprMark ( const SPhysEncExpr *self,
-    struct VSchema const *schema );
-
-
-/*--------------------------------------------------------------------------
- * SUnaryExpr
- *  applies a unary expression to further
- */
-typedef struct SUnaryExpr SUnaryExpr;
-struct SUnaryExpr
-{
-    SExpression dad;
-    const SExpression *expr;
-};
-
-
-/*--------------------------------------------------------------------------
- * SBinExpr
- *  connects two expression by means of an operator
- *  the operator is implicit in expression variant
- *
- *  e.g. eCastExpr where left = STypeExpr, right = SExpression
- */
-typedef struct SBinExpr SBinExpr;
-struct SBinExpr
-{
-    SExpression dad;
-    const SExpression *left;
-    const SExpression *right;
-};
-
-
-/*--------------------------------------------------------------------------
- * SVectExpr
- *  gathers multiple expressions connect by means of an operator
- *  the operator is implicit in expression variant
- *
- *  e.g. eCondExpr where operator is '|', or
- *  a constant vector where the operator is ','
- */
-typedef struct SVectExpr SVectExpr;
-struct SVectExpr
-{
-    SExpression dad;
-    Vector expr;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_schema_expr_ */
diff --git a/libs/vdb/schema-func.c b/libs/vdb/schema-func.c
deleted file mode 100644
index a29ee0f..0000000
--- a/libs/vdb/schema-func.c
+++ /dev/null
@@ -1,1520 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "schema-dump.h"
-
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SIndirectConst
- *  a parameterized constant
- */
-#if SLVL >= 3
-
-/* Whack
- */
-void CC SIndirectConstWhack ( void *item, void *ignore )
-{
-    SIndirectConst * self = item;
-    SExpressionWhack ( self -> expr );
-    SExpressionWhack ( self -> td );
-    free ( self );
-}
-
-/* Mark
- */
-void CC SIndirectConstMark ( void * item, void * data )
-{
-    const SIndirectConst * self = item;
-    if ( self != NULL )
-    {
-        SExpressionMark ( ( void * )self -> td, data );
-        SExpressionMark ( ( void * )self -> expr, data );
-    }
-}
-
-/* Dump
- *  dump "const", dump object
- */
-rc_t SIndirectConstDump ( const SIndirectConst *self, struct SDumper *d )
-{
-    return KSymbolDump ( self != NULL ? self -> name : NULL, d );
-}
-
-bool CC SIndirectConstDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SIndirectConst *self = ( const void* ) item;
-
-    /* check for this being a function */
-    if ( self -> td == NULL )
-        b -> rc = SDumperPrint ( b, "function %N", self -> name );
-    else
-        b -> rc = SDumperPrint ( b, "%E %N", self -> td, self -> name );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * SIndirectType
- */
-#if SLVL >= 3
-
-/* Whack
- */
-void CC SIndirectTypeWhack ( void *item, void *ignore )
-{
-    SIndirectType *self = item;
-    SExpressionWhack ( self -> type );
-    free ( self );
-}
-
-
-/* Find
- */
-SIndirectType *VSchemaFindITypeid ( const VSchema *self, uint32_t id )
-{
-    SIndirectType *pt = VectorGet ( & self -> pt, id );
-    while ( pt == NULL )
-    {
-        self = self -> dad;
-        if ( self == NULL )
-            break;
-        pt = VectorGet ( & self -> pt, id );
-    }
-    return pt;
-}
-
-
-/* Mark
- */
-void CC SIndirectTypeMark ( void * item, void * data )
-{
-    const SIndirectType * self = item;
-    if ( self != NULL )
-        SExpressionMark ( ( void * ) self -> type, data );
-}
-
-
-/* Dump
- */
-rc_t SIndirectTypeDump ( const SIndirectType *self, struct SDumper *d )
-{
-    return KSymbolDump ( self != NULL ? self -> name : NULL, d );
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * SFormParamlist
- */
-#if SLVL >= 3
-
-/* Whack
- */
-void SFormParmlistWhack ( SFormParmlist *self, void ( CC * pwhack ) ( void*, void* ) )
-{
-    VectorWhack ( & self -> parms, pwhack, NULL );
-}
-
-
-/* Mark
- */
-void SFormParmlistMark ( const SFormParmlist *self,
-    void ( CC * mark ) ( void*, void* ), const VSchema *schema )
-{
-    if ( self != NULL )
-        VectorForEach ( & self -> parms, false, mark, ( void* ) schema );
-}
-
-
-/* Dump
- *  dump param list
- */
-rc_t SFormParamlistDump ( const SFormParmlist *self, SDumper *b,
-    bool ( CC * dump ) ( void*, void* ),
-    const char *begin, const char *end, const char *empty )
-{
-    rc_t rc;
-    void *item;
-    uint32_t i, parm_cnt = VectorLength ( & self -> parms );
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    /* if the guy has no specific parameters */
-    if ( parm_cnt == 0 )
-    {
-        if ( self -> vararg )
-            return SDumperPrint ( b, "%s...%s", begin, end );
-        return SDumperPrint ( b, empty );
-    }
-
-    /* print mandatory params */
-    SDumperSepString ( b, begin );
-    for ( rc = 0, i = 0; i < ( uint32_t ) self -> mand; ++ i )
-    {
-        item = VectorGet ( & self -> parms, i );
-        rc = SDumperSep ( b );
-        if ( rc == 0 && ( * dump ) ( item, b ) )
-            rc = b -> rc;
-        SDumperSepString ( b, compact ? "," : ", " );
-    }
-    if ( rc != 0 )
-        return rc;
-
-    if ( i != 0 )
-        SDumperSepString ( b, compact ? "*" : " * " );
-    else
-    {
-        /* issue "begin" */
-        rc = SDumperSep ( b );
-        if ( rc != 0 )
-            return rc;
-
-        SDumperSepString ( b, compact ? "*" :  "* " );
-    }
-
-    /* print optional params */
-    for ( ; i < parm_cnt; ++ i )
-    {
-        item = VectorGet ( & self -> parms, i );
-        rc = SDumperSep ( b );
-        if ( rc == 0 && ( * dump ) ( item, b ) )
-            rc = b -> rc;
-        SDumperSepString ( b, compact ? "," : ", " );
-    }
-    if ( rc != 0 )
-        return rc;
-
-    /* print optional vararg */
-    if ( self -> vararg )
-        return SDumperPrint ( b, compact ? ",...%s" : ", ...%s", end );
-
-    /* close */
-    return SDumperPrint ( b, end );
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * SFunction
- */
-
-#if SLVL >= 3
-
-/* Whack
- */
-void SFunctionDestroy ( SFunction *self )
-{
-    SExpressionWhack ( self -> rt );
-#if SLVL >= 4
-    if ( self -> script )
-    {
-        SExpressionWhack ( self -> u . script . rtn );
-        VectorWhack ( & self -> u . script . prod, SProductionWhack, NULL );
-    }
-#endif
-    BSTreeWhack ( & self -> sscope, KSymbolWhack, NULL );
-    BSTreeWhack ( & self -> fscope, KSymbolWhack, NULL );
-    SFormParmlistWhack ( & self -> fact, SIndirectConstWhack );
-    SFormParmlistWhack ( & self -> func, SProductionWhack );
-    VectorWhack ( & self -> type, NULL, NULL );
-    VectorWhack ( & self -> schem, SIndirectConstWhack, NULL );
-}
-
-void CC SFunctionWhack ( void *self, void *ignore )
-{
-    SFunctionDestroy ( self );
-    free ( self );
-}
-
-/* Cmp
- * Sort
- */
-int CC SFunctionCmp ( const void *item, const void *n )
-{
-    const uint32_t *a = item;
-    const SFunction *b = n;
-
-    if ( * a > b -> version )
-        return 1;
-    return ( int ) ( * a >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-int CC SFunctionSort ( const void *item, const void *n )
-{
-    const SFunction *a = item;
-    const SFunction *b = n;
-
-    return ( int ) ( a -> version >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-/* Bind
- *  perform schema and factory param substitution
- *  returns prior param values
- */
-rc_t SFunctionBindSchemaParms ( const SFunction *self,
-    Vector *prior, const Vector *subst )
-{
-    rc_t rc = 0;
-    uint32_t i, count;
-
-    /* count input params */
-    count = VectorLength ( subst );
-
-    /* initialize return value */
-    VectorInit ( prior, 0, count );
-
-    /* determine total schema params */
-    i = VectorLength ( & self -> type ) + VectorLength ( & self -> schem );
-
-    /* param counts must match */
-    if ( count < i )
-        rc = RC ( rcVDB, rcFunction, rcEvaluating, rcParam, rcInsufficient );
-    else if ( count > i )
-        rc = RC ( rcVDB, rcFunction, rcEvaluating, rcParam, rcExcessive );
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogWarn, ( klogWarn, rc,
-                 "schema parameter count mismatch - function: '$(f)'; expected $(i), received $(count)",
-                 "f=%.*s,count=%u,i=%u",
-                 self -> name -> name . size, self -> name -> name . addr,
-                 count, i ));
-        return rc;
-    }
-
-    /* save prior types */
-    count = VectorLength ( & self -> type );
-    for ( i = 0; i < count; ++ i )
-    {
-        const SIndirectType *id = VectorGet ( & self -> type, i );
-        assert ( id != NULL );
-        rc = VectorSet ( prior, id -> pos, id -> type );
-        if ( rc != 0 )
-        {
-            VectorWhack ( prior, NULL, NULL );
-            return rc;
-        }
-    }
-
-    /* save prior constants */
-    count = VectorLength ( & self -> schem );
-    for ( i = 0 ; i < count; ++ i )
-    {
-        const SIndirectConst *ic = VectorGet ( & self -> schem, i );
-        assert ( ic != NULL );
-        rc = VectorSet ( prior, ic -> id, ic -> td ? ( void* ) ic -> expr : ( void* ) ic -> func );
-        if ( rc != 0 )
-        {
-            VectorWhack ( prior, NULL, NULL );
-            return rc;
-        }
-    }
-
-    /* set new values */
-    count = VectorLength ( & self -> type );
-    for ( i = 0; i < count; ++ i )
-    {
-        SIndirectType *id = VectorGet ( & self -> type, i );
-        id -> type = VectorGet ( subst, id -> pos );
-        assert ( id -> type != NULL );
-    }
-
-    count = VectorLength ( & self -> schem );
-    for ( i = 0; i < count; ++ i )
-    {
-        SIndirectConst *ic = VectorGet ( & self -> schem, i );
-        if ( ic -> td == NULL )
-        {
-            ic -> func = VectorGet ( subst, ic -> id );
-            assert ( ic -> func != NULL );
-        }
-        else
-        {
-            ic -> expr = VectorGet ( subst, ic -> id );
-            assert ( ic -> expr != NULL );
-        }
-    }
-
-    return 0;
-}
-
-rc_t SFunctionBindFactParms ( const SFunction *self,
-    Vector *prior, const Vector *subst )
-{
-    rc_t rc;
-    uint32_t i, count, act_count, form_count;
-    SIndirectConst *ic, *last;
-
-    /* count input params */
-    count = act_count = VectorLength ( subst );
-
-    VectorInit ( prior, 0, 0 );
-
-    /* must have minimum count */
-    if ( act_count < self -> fact . mand )
-    {
-        rc =  RC ( rcVDB, rcFunction, rcEvaluating, rcParam, rcInsufficient );
-        PLOGERR ( klogWarn, ( klogWarn, rc,
-                   "missing mandatory factory parameters - function: '$(func)'; expected $(mand), received $(count)",
-                   "func=%.*s,mand=%u,count=%u",
-                   self -> name -> name . size, self -> name -> name . addr,
-                   self -> fact . mand, act_count ));
-        return rc;
-    }
-    /* test against maximum count */
-    form_count = VectorLength ( & self -> fact . parms );
-    if ( act_count > form_count )
-    {
-        if ( ! self -> fact . vararg )
-        {
-            rc = RC ( rcVDB, rcFunction, rcEvaluating, rcParam, rcExcessive );
-            PLOGERR ( klogWarn, ( klogWarn, rc,
-                       "extra factory parameters - function: '$(func)'; expected $(mand), received $(count)",
-                       "func=%.*s,mand=%u,count=%u",
-                       self -> name -> name . size, self -> name -> name . addr,
-                       form_count, act_count ));
-            return rc;
-        }
-        count = form_count;
-    }
-
-    /* save prior constants */
-    VectorInit ( prior, 0, form_count );
-    for ( i = 0 ; i < form_count; ++ i )
-    {
-        ic = VectorGet ( & self -> fact . parms, i );
-        assert ( ic != NULL );
-        rc = VectorSet ( prior, ic -> id, ic -> td ? ( void* ) ic -> expr : ( void* ) ic -> func );
-        if ( rc != 0 )
-        {
-            VectorWhack ( prior, NULL, NULL );
-            return rc;
-        }
-    }
-
-    /* set new values */
-    for ( last = NULL, i = 0; i < count; last = ic, ++ i )
-    {
-        ic = VectorGet ( & self -> fact . parms, i );
-        if ( ic -> td == NULL )
-        {
-            ic -> func = VectorGet ( subst, ic -> id );
-            assert ( ic -> func != NULL );
-        }
-        else
-        {
-            ic -> expr = VectorGet ( subst, ic -> id );
-            assert ( ic -> expr != NULL );
-        }
-    }
-
-    /* set vararg values */
-    for ( rc = 0; i < act_count; ++ i )
-    {
-        ic = malloc(sizeof(*ic));
-        if (ic == NULL) {
-            rc = RC ( rcVDB, rcFunction, rcEvaluating, rcMemory, rcExhausted );
-            break;
-        }
-
-        /* not quite right - should have a temp name... */
-        * ic = * last;
-        ic->id = i;
-
-        if ( ic -> td == NULL )
-        {
-            ic -> func = VectorGet ( subst, ic -> id );
-            assert ( ic -> func != NULL );
-        }
-        else
-        {
-            ic -> expr = VectorGet ( subst, ic -> id );
-            assert ( ic -> expr != NULL );
-        }
-
-        rc = VectorSet ( ( Vector* ) & self -> fact . parms, i, ic );
-    }
-
-    if (rc != 0)
-        VectorWhack ( prior, NULL, NULL );
-
-    return rc;
-}
-
-/* Rest-ore
- *  restore schema and factory param substitution
- *  destroys prior param vector
- */
-void SFunctionRestSchemaParms ( const SFunction *self, Vector *prior )
-{
-    uint32_t i, count;
-
-    /* restore prior values */
-    count = VectorLength ( & self -> type );
-    for ( i = 0; i < count; ++ i )
-    {
-        SIndirectType *id = VectorGet ( & self -> type, i );
-        id -> type = VectorGet ( prior, id -> pos );
-    }
-
-    count = VectorLength ( & self -> schem );
-    for ( i = 0; i < count; ++ i )
-    {
-        SIndirectConst *ic = VectorGet ( & self -> schem, i );
-        if ( ic -> td == NULL )
-            ic -> func = VectorGet ( prior, ic -> id );
-        else
-            ic -> expr = VectorGet ( prior, ic -> id );
-    }
-
-    VectorWhack ( prior, NULL, NULL );
-}
-
-void SFunctionRestFactParms ( const SFunction *self, Vector *prior )
-{
-    uint32_t i, count;
-
-    /* whack extra fake params created with varargs - see above */
-    count = VectorLength ( &self->fact.parms );
-    for (i = VectorLength ( prior ); i < count; ) {
-        SIndirectConst *ic;
-
-        assert ( i != 0 );
-        VectorRemove ( ( Vector* ) & self -> fact . parms, -- count, ( void** ) & ic );
-        free ( ic );
-    }
-
-    assert ( VectorLength ( & self -> fact . parms ) == VectorLength ( prior ) );
-
-    /* restore prior values */
-    assert ( count == i );
-    for ( i = 0; i < count; ++ i )
-    {
-        SIndirectConst *ic = VectorGet ( & self -> fact . parms, i );
-        if ( ic -> td == NULL )
-            ic -> func = VectorGet ( prior, ic -> id );
-        else
-            ic -> expr = VectorGet ( prior, ic -> id );
-    }
-
-    VectorWhack ( prior, NULL, NULL );
-}
-
-
-/* Mark
- */
-void CC SFunctionClearMark ( void *item, void *ignore )
-{
-    SFunction *self = item;
-    self -> marked = false;
-}
-
-void CC SFunctionMark ( void * item, void * data )
-{
-    SFunction * self = item;
-    const VSchema * schema = data;
-    if ( self != NULL && ! self -> marked )
-    {
-        self -> marked = true;
-        SExpressionMark ( ( void * )self -> rt, data );
-        SFormParmlistMark ( & self -> fact, SIndirectConstMark, schema );
-        SFormParmlistMark ( & self -> func, SProductionMark, schema );
-        VectorForEach ( & self -> type, false, SIndirectTypeMark, data );
-        VectorForEach ( & self -> schem, false, SIndirectConstMark, data );
-
-        if ( self -> script )
-        {
-            SExpressionMark ( ( void * )self -> u . script . rtn, ( void * )schema );
-            VectorForEach ( & self -> u . script . prod, false, SProductionMark, data );
-        }
-    }
-}
-
-void SFuncNameMark ( const SNameOverload *self, const VSchema *schema )
-{
-    if ( self != NULL )
-    {
-        VectorForEach ( & self -> items, false, SFunctionMark, ( void * ) schema );
-    }
-}
-
-
-/* Dump
- */
-rc_t SFunctionDump ( const SFunction *self, struct SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-rc_t SFunctionDeclDumpSchemaParms ( const SFunction *self, SDumper *b )
-{
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    /* this first part is weird, because the types and
-       constants are kept separately, although they were
-       specified in a single list */
-    uint32_t i, j, sparm_cnt = VectorLength ( & self -> type ) +
-        VectorLength ( & self -> schem );
-    if ( sparm_cnt == 0 )
-        return 0;
-
-    SDumperSepString ( b, compact ? "<" : "< " );
-    for ( i = j = 0; i < sparm_cnt; ++ i )
-    {
-        const SIndirectType *id = VectorGet ( & self -> type, i - j );
-        rc_t rc = SDumperSep ( b );
-        if ( rc != 0 )
-            return rc;
-        if ( id != NULL && id -> pos == i )
-            rc = SDumperPrint ( b, "type %N", id -> name );
-        else
-        {
-            const SIndirectConst *ic = VectorGet ( & self -> schem, j );
-            assert ( id == NULL || id -> pos > i );
-            if ( ic == NULL )
-                rc = SDumperWrite ( b, "NULL", 4 );
-            else
-                SIndirectConstDefDump ( ( void* ) ic, b );
-        }
-        if ( rc != 0 )
-            return rc;
-        SDumperSepString ( b, compact ? "," : ", " );
-    }
-
-    return SDumperPrint ( b, compact ? ">" : " > " );
-}
-
-rc_t SFunctionDeclDumpFactParms ( const SFunction *self, SDumper *b )
-{
-    if ( SDumperMode ( b ) == sdmCompact )
-        return SFormParamlistDump ( & self -> fact, b, SIndirectConstDefDump, "<", ">", "" );
-    return SFormParamlistDump ( & self -> fact, b, SIndirectConstDefDump, " < ", " >", "" );
-}
-
-bool CC SFunctionDeclDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SFunction *self = ( const void* ) item;
-    const char *func_class = "extern";
-
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    if ( self -> script )
-        func_class = "schema";
-    else if ( self -> validate )
-        func_class = "validate";
-
-    /* a type of function */
-    b -> rc = SDumperPrint ( b, "%s function ", func_class );
-    if ( b -> rc == 0 )
-    {
-        if ( self -> untyped )
-            b -> rc = SDumperPrint ( b, compact ? "__untyped %N()" : "__untyped %N ()", self -> name );
-        else if ( self -> row_length )
-            b -> rc = SDumperPrint ( b, compact ? "__row_length %N()" : "__row_length %N ()", self -> name );
-        else
-        {
-            /* could have schema parameters */
-            b -> rc = SFunctionDeclDumpSchemaParms ( self, b );
-
-            /* a return type expression, followed by a function name */
-            if ( b -> rc == 0 )
-            {
-                if ( self -> validate )
-                    b -> rc = SDumperPrint ( b, "void %N", self -> name );
-                else
-                    b -> rc = SDumperPrint ( b, "%E %N", self -> rt, self -> name );
-            }
-
-            /* version should be given */
-            if ( b -> rc == 0 )
-                b -> rc = SDumperVersion ( b, self -> version );
-
-            /* factory parameters */
-            if ( b -> rc == 0 )
-                b -> rc = SFunctionDeclDumpFactParms ( self, b );
-
-            /* function parameters */
-            if ( b -> rc == 0 )
-            {
-                if ( compact )
-                    b -> rc = SFormParamlistDump ( & self -> func, b, SProductionDefDump, "(", ")", "()" );
-                else
-                    b -> rc = SFormParamlistDump ( & self -> func, b, SProductionDefDump, " ( ", " )", " ()" );
-            }
-        }
-    }
-
-    if ( b -> rc == 0 )
-    {
-#if SLVL >= 4
-        if ( self -> script )
-        {
-            if ( ! compact )
-                b -> rc = SDumperWrite ( b, "\n", 1 );
-            if ( b -> rc == 0 )
-                b -> rc = SFunctionBodyDump ( self, b );
-        }
-        else
-#endif
-        {
-            if ( self -> u . ext . fact != NULL )
-                b -> rc = SDumperPrint ( b, compact ? "=%N" : " = %N", self -> u . ext . fact );
-            if ( b -> rc == 0 )
-                b -> rc = SDumperPrint ( b, compact ? ";" : ";\n" );
-        }
-    }
-
-    if ( b -> rc == 0 )
-        b -> rc = AliasDump ( self -> name, b );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-#if SLVL >= 3
-
-/*
- * formal-symbol     = ID
- */
-static
-rc_t formal_symbol ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env,  uint32_t id, const void *obj )
-{
-    rc_t rc;
-
-    /* allow symbol redefines in current scope only */
-    if ( t -> sym != NULL )
-    {
-        KTokenSourceReturn ( src, t );
-        next_shallow_token ( tbl, src, t, true );
-    }
-
-    /* must have a parameter name */
-    if ( t -> id != eIdent )
-        return KTokenExpected ( t, klogErr, "undefined identifier" );
-
-    /* create the symbol in current scope */
-    rc = KSymTableCreateSymbol ( tbl, & t -> sym, & t -> str, id, obj );
-    if ( rc != 0 )
-        KTokenRCExplain ( t, klogInt, rc );
-
-    return rc;
-}
-
-
-/*
- * param-formal       = [ 'control' ] <typespec> ID
- */
-static
-rc_t param_formal ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig )
-{
-    rc_t rc;
-
-    /* create the factory formal parameter,
-       which is just a production awaiting an expr */
-    SProduction *param = malloc ( sizeof * param );
-    if ( param == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* finish initialization */
-    memset ( param, 0, sizeof * param );
-
-    /* accept 'control' keyword */
-    if ( t -> id == kw_control )
-    {
-        param -> control = true;
-        next_token ( tbl, src, t );
-    }
-
-    /* if parsing v0 text, then this is a persisted
-       column schema. it will have only a formal param
-       name, but no type. substitute "any" */
-    if ( env -> schema_param_types_absent )
-    {
-        KTokenSourceReturn ( src, t );
-        CONST_STRING ( & t -> str, "any" );
-        t -> sym = KSymTableFindIntrinsic ( tbl, & t -> str );
-        assert ( t -> sym != NULL );
-        t -> id = t -> sym -> type;
-    }
-
-    /* should start off with a type */
-    rc = vardim_type_expr ( tbl, src, t, env, self, & param -> fd );
-    if ( rc != 0 )
-    {
-        free ( param );
-        return rc;
-    }
-
-    /* create a name */
-    rc = formal_symbol ( tbl, src, t, env, eFuncParam, param );
-    if ( rc != 0 )
-    {
-        SProductionWhack ( param, NULL );
-        return rc;
-    }
-    param -> name = t -> sym;
-
-    /* append to param list */
-    rc = VectorAppend ( & sig -> parms, & param -> cid . id, param );
-    if ( rc != 0 )
-    {
-        SProductionWhack ( param, NULL );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-
-/*
- * fact-formals       = <fact-formal> [ ',' <fact-formals> ]
- * fact-formal        = <fact-typedecl> ID
- * fact-parmname      = ID
- */
-static
-rc_t fact_formal ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig )
-{
-    rc_t rc;
-    SIndirectConst *param = malloc ( sizeof * param );
-    if ( param == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    param -> expr = NULL;
-    param -> func = NULL;
-
-    /* type could be 'function' */
-    if ( t -> id == kw_function )
-    {
-        param -> td = NULL;
-        next_token ( tbl, src, t );
-    }
-
-    /* should be a typedecl */
-    else
-    {
-        rc = type_expr ( tbl, src, t, env, self, & param -> td );
-        if ( rc != 0 )
-        {
-            free ( param );
-            return KTokenFailure ( t, klogErr, rc, "function or data type" );
-        }
-    }
-
-    /* get its name */
-    rc = formal_symbol ( tbl, src, t, env, eFactParam, param );
-    if ( rc != 0 )
-    {
-        SIndirectConstWhack ( param, NULL );
-        return rc;
-    }
-    param -> name = t -> sym;
-
-    /* store as a parameter */
-    rc = VectorAppend ( & sig -> parms, & param -> id, param );
-    if ( rc != 0 )
-    {
-        SIndirectConstWhack ( param, NULL );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    next_token ( tbl, src, t );
-    return 0;
-}
-
-
-/*
- * formal-params     = <formal-param> [ ',' <formal-params> ]
- */
-static
-rc_t formal_params ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig,
-    rc_t ( * formal_param ) ( KSymTable*, KTokenSource*, KToken*,
-        const SchemaEnv*, const VSchema*, SFormParmlist* ) )
-{
-    while ( t -> sym != NULL || t -> id == eIdent )
-    {
-        rc_t rc = ( * formal_param ) ( tbl, src, t, env, self, sig );
-        if ( rc != 0 )
-            return rc;
-
-        if ( t -> id != eComma )
-            break;
-
-        next_token ( tbl, src, t );
-    }
-
-    return 0;
-}
-
-
-/*
- * formal-signature   = <formal-params> [ '*' <formal-params> ] [',' '...' ]
- *                    | '*' <formal-params> [',' '...' ]
- *                    | '...'
- */
-static
-rc_t formal_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig,
-    rc_t ( * formal_param ) ( KSymTable*, KTokenSource*, KToken*,
-        const SchemaEnv*, const VSchema*, SFormParmlist* ) )
-{
-    /* read mandatory parameters */
-    rc_t rc = formal_params ( tbl, src, t, env, self, sig, formal_param );
-
-    /* remember the number of mandatory params seen */
-    sig -> mand = VectorLength ( & sig -> parms );
-
-    /* read optional parameters */
-    if ( rc == 0 && t -> id == eAsterisk )
-    {
-        next_token ( tbl, src, t );
-        rc = formal_params ( tbl, src, t, env, self, sig, formal_param );
-        if ( rc == 0 && VectorLength ( & sig -> parms ) == sig -> mand )
-            KTokenExpected ( t, klogWarn, "optional parameter" );
-    }
-
-    /* accept '...' */
-    if ( t -> id == eEllipsis )
-    {
-        /* but only if there was at least one real parameter */
-        if ( VectorLength ( & sig -> parms ) == 0 )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcParam, rcInsufficient );
-            return KTokenFailure ( t, klogErr, rc, "vararg parameter requires at least one real parameter" );
-        }
-
-        sig -> vararg = true;
-        next_token ( tbl, src, t );
-    }
-
-    return 0;
-}
-
-/*
- * parm-signature     = <parm-formals> [ '*' <parm-formals> ] [',' '...' ]
- *                    | '*' <parm-formals> [',' '...' ]
- *                    | '...'
- */
-static
-rc_t parm_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig )
-{
-    /* open list */
-    rc_t rc = expect ( tbl, src, t, eLeftParen, "(", true );
-    if ( rc != 0 )
-        return rc;
-
-    /* parse list */
-    rc = formal_signature ( tbl, src, t, env, self, sig, param_formal );
-    if ( rc != 0 )
-        return 0;
-
-    /* expect close */
-    return expect ( tbl, src, t, eRightParen, ")", true );
-}
-
-/*
- * fact-signature     = <fact-formals> [ '*' <fact-formals> ] [ ',' '...' ]
- *                    | '*' <fact-formals> [ ',' '...' ]
- *                    | '...'
- */
-rc_t fact_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, SFormParmlist *sig )
-{
-    /* open list */
-    rc_t rc = expect ( tbl, src, t, eLeftAngle, "<", true );
-    if ( rc != 0 )
-        return rc;
-
-    /* parse list */
-    rc = formal_signature ( tbl, src, t, env, self, sig, fact_formal );
-    if ( rc != 0 )
-        return rc;
-
-    /* expect close */
-    return expect ( tbl, src, t, eRightAngle, ">", true );
-}
-
-
-/*
- * schema-signature   = <schema-formals>
- * schema-formals     = <schema-formal> [ ',' <schema-formals> ]
- * schema-formal      = <schema-typedecl> ID
- * schema-parmname    = ID
- */
-rc_t schema_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *sig )
-{
-    rc_t rc;
-
-    /* open list */
-    if ( t -> id != eLeftAngle )
-        return KTokenExpected ( t, klogErr, "<" );
-
-    /* gather schema parameters */
-    do
-    {
-        const SExpression *td;
-        const SDatatype *dt;
-
-        /* check parameter type */
-        switch ( next_token ( tbl, src, t ) -> id )
-        {
-        case kw_type:
-            td = NULL;
-            next_token ( tbl, src, t );
-            break;
-
-        case eDatatype:
-            dt = t -> sym -> u . obj;
-            if ( dt -> domain == ddUint )
-            {
-                /* evaluate the type expression */
-                rc = type_expr ( tbl, src, t, env, self, & td );
-                if ( rc != 0 )
-                    return KTokenFailure ( t, klogErr, rc, "unsigned integer datatype" );
-
-                /* the type should be totally resolved */
-                assert ( td != NULL && td -> var == eTypeExpr );
-                assert ( ( ( const STypeExpr* ) td ) -> resolved );
-                if ( ( ( const STypeExpr* ) td ) -> fd . td . dim == 1 )
-                    break;
-
-                SExpressionWhack ( td );
-                return KTokenExpected ( t, klogErr, "single dimensional unsigned integer datatype" );
-            }
-
-        default:
-            return KTokenExpected ( t, klogErr, "type keyword or unsigned integer datatype" );
-        }
-
-        /* get parameter name */
-        if ( t -> id != eIdent )
-        {
-            if ( td != NULL )
-                SExpressionWhack ( td );
-            return KTokenExpected ( t, klogErr, "parameter name" );
-        }
-
-        if ( td == NULL )
-        {
-            SIndirectType *formal = malloc ( sizeof * formal );
-            if ( formal == NULL )
-            {
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-
-            /* initialize to raw format,
-               undefined type, and no dimension */
-            formal -> type = NULL;
-
-            /* create symbol */
-            rc = KSymTableCreateConstSymbol ( tbl, & formal -> name,
-                & t -> str, eSchemaType, formal );
-            if ( rc == 0 )
-            {
-                /* record positional */
-                rc = VectorAppend ( & sig -> type, & formal -> pos, formal );
-                if ( rc == 0 )
-                {
-                    void *ignore;
-
-                    /* record formal */
-                    rc = VectorAppend ( & self -> pt, & formal -> id, formal );
-                    if ( rc != 0 )
-                        VectorSwap ( & sig -> type, formal -> pos, NULL, & ignore );
-                    else
-                        formal -> pos += VectorLength ( & sig -> schem );
-                }
-            }
-            if ( rc != 0 )
-            {
-                free ( formal );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-        }
-        else
-        {
-            SIndirectConst *formal = malloc ( sizeof * formal );
-            if ( formal == NULL )
-            {
-                SExpressionWhack ( td );
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-
-            /* initialize with no value or function */
-            formal -> expr = NULL;
-            formal -> func = NULL;
-            formal -> td = td;
-
-            /* create symbol */
-            rc = KSymTableCreateConstSymbol ( tbl, & formal -> name,
-                & t -> str, eSchemaParam, formal );
-            if ( rc == 0 )
-            {
-                /* record formal */
-                rc = VectorAppend ( & sig -> schem, & formal -> id, formal );
-                if ( rc == 0 )
-                    formal -> id += VectorLength ( & sig -> type );
-            }
-            if ( rc != 0 )
-            {
-                SIndirectConstWhack ( formal, NULL );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-        }
-    }
-    while ( next_token ( tbl, src, t ) -> id == eComma );
-
-    /* expect close */
-    return expect ( tbl, src, t, eRightAngle, ">", true );
-}
-
-static
-rc_t return_type_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *f )
-{
-    if ( f -> validate )
-        return expect ( tbl, src, t, kw_void, "void", true );
-    return vardim_type_expr ( tbl, src, t, env, self, & f -> rt );
-}
-
-
-static
-rc_t func_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *f, uint32_t type )
-{
-    rc_t rc;
-
-    /* check for __untyped or __row_length function */
-    if ( t -> id == kw___untyped || t -> id == kw___row_length )
-    {
-        uint32_t sym_type;
-
-        /* can't be a script function */
-        if ( type == eScriptFunc )
-            return KTokenExpected ( t, klogErr, "script function return type" );
-
-        /* can't be a validate function */
-        if ( f -> validate )
-            return KTokenExpected ( t, klogErr, "void return type" );
-
-        /* determine variant */
-        if ( t -> id == kw___untyped )
-        {
-            f -> untyped = true;
-            sym_type = eUntypedFunc;
-        }
-        else
-        {
-            f -> row_length = true;
-            sym_type = eRowLengthFunc;
-        }
-
-        /* treat keyword as a NULL return type */
-        next_token ( tbl, src, t );
-
-        /* create function name */
-        rc = create_fqn ( tbl, src, t, env, sym_type, NULL );
-        if ( rc != 0 )
-        {
-            if ( GetRCState ( rc ) == rcExists )
-                return rc;
-            return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-        }
-
-        /* record symbol */
-        f -> name = t -> sym;
-        next_token ( tbl, src, t );
-
-        /* consume empty param list */
-        rc = expect ( tbl, src, t, eLeftParen, "(", true );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eRightParen, ")", true );
-        return rc;
-    }
-
-
-    /* initialize vectors */
-    VectorInit ( & f -> fact . parms, 0, 8 );
-    VectorInit ( & f -> func . parms, 0, 8 );
-    VectorInit ( & f -> type, 0, 8 );
-    VectorInit ( & f -> schem, 0, 8 );
-
-    /* get schema signature */
-    if ( t -> id == eLeftAngle )
-    {
-        /* enter schema param scope */
-        rc = KSymTablePushScope ( tbl, & f -> sscope );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-
-        /* parse schema params */
-        rc = schema_signature ( tbl, src, t, env, self, f );
-
-        /* interpret return type within schema param scope */
-        if ( rc == 0 )
-        {
-            rc = return_type_expr ( tbl, src, t, env, self, f );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "return type" );
-        }
-
-        /* pop scope */
-        KSymTablePopScope ( tbl );
-
-        /* bail on problems */
-        if ( rc != 0 )
-            return rc;
-
-        /* "t" contains a lookahead token. while unlikely,
-           it could have matched something defined in schema
-           param scope. re-evaluate if possible */
-        if ( t -> sym != NULL ) switch ( t -> sym -> type )
-        {
-        case eSchemaType:
-        case eSchemaParam:
-            t -> id = eIdent;
-            t -> sym = KSymTableFind ( tbl, & t -> str );
-            if ( t -> sym != NULL )
-                t -> id = t -> sym -> type;
-            break;
-        }
-    }
-    else
-    {
-        /* get return type within global scope */
-        rc = return_type_expr ( tbl, src, t, env, self, f );
-        if ( rc != 0 )
-            return KTokenFailure ( t, klogErr, rc, "return type" );
-    }
-
-    /* get function name */
-    rc = create_fqn ( tbl, src, t, env, type, NULL );
-    if ( rc != 0 ) switch ( GetRCState ( rc ) )
-    {
-    case rcExists:
-        break;
-    case rcUnexpected:
-        if ( type == 0 && t -> sym != NULL )
-        {
-            if ( t -> sym -> type == eFunction || t -> sym -> type == eScriptFunc )
-                break;
-        }
-    default:
-        return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-    }
-
-    /* record symbol - new or redefined */
-    f -> name = t -> sym;
-
-    /* get version */
-    if ( next_token ( tbl, src, t ) -> id == eHash )
-    {
-        bool allow_release = ( f -> name -> type != eFunction ) ? true : false;
-        next_token ( tbl, src, t );
-        rc = maj_min_rel ( tbl, src, t, env, self, & f -> version, allow_release );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* parse formal parameters - enter schema scope */
-    rc = KSymTablePushScope ( tbl, & f -> sscope );
-    if ( rc != 0 )
-        KTokenRCExplain ( t, klogInt, rc );
-    else
-    {
-        /* enter function scope */
-        rc = KSymTablePushScope ( tbl, & f -> fscope );
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-        else
-        {
-            /* gather factory parameters */
-            if ( t -> id == eLeftAngle )
-                rc = fact_signature ( tbl, src, t, env, self, & f -> fact );
-
-            /* gather function parameters */
-            if ( rc == 0 )
-                rc = parm_signature ( tbl, src, t, env, self, & f -> func );
-
-            /* leave function scope */
-            KSymTablePopScope ( tbl );
-        }
-
-        /* leave schema scope */
-        KSymTablePopScope ( tbl );
-    }
-
-    /* go a bit further */
-    if ( rc == 0 )
-    {
-        /* detect script body */
-        if ( t -> id == eLeftCurly )
-        {
-#if SLVL >= 4
-            /* if user already specified extern function */
-            if ( type == eFunction )
-#endif
-                return KTokenExpected ( t, klogErr, "; or =" );
-#if SLVL >= 4
-            /* if no type was specified */
-            if ( type == 0 )
-            {
-                /* if name was previously defined as a function */
-                if ( f -> name -> type == eFunction )
-                    return KTokenExpected ( t, klogErr, "; or =" );
-
-                /* name is either undefined or script - clobber to script */
-                ( ( KSymbol* ) f -> name ) -> type = eScriptFunc;
-            }
-
-            /* parse remainder as script function */
-            return script_body ( tbl, src, t, env, self, f );
-#endif
-        }
-
-        /* detect case where should be script but isn't */
-        if ( f -> name -> type == eScriptFunc )
-            return KTokenExpected ( t, klogErr, "{" );
-
-        /* definitely an extern function */
-        if ( type == 0 )
-            ( ( KSymbol* ) f -> name ) -> type = eFunction;
-
-        /* process factory spec */
-        if ( t -> id == eAssign )
-        {
-            /* get factory name */
-            next_token ( tbl, src, t );
-            rc = create_fqn ( tbl, src, t, env, eFactory, NULL );
-            if ( rc != 0 ) switch ( GetRCState ( rc ) )
-            {
-            case rcExists:
-                break;
-            case rcUnexpected:
-                if ( t -> sym != NULL && t -> sym -> type == eFunction )
-                    break;
-            default:
-                return rc;
-            }
-
-            f -> u . ext . fact = t -> sym;
-            next_token ( tbl, src, t );
-        }
-
-        /* expect a semicolon */
-        rc = expect ( tbl, src, t, eSemiColon, ";", true );
-    }
-
-    return rc;
-}
-
-static
-rc_t function_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, uint32_t type, bool validate )
-{
-    rc_t rc;
-    void *ignore;
-
-    /* create object */
-    SFunction *f = malloc ( sizeof * f );
-    if ( f == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    memset ( f, 0, sizeof * f );
-    f -> validate = validate;
-
-    /* parse function decl */
-    rc = func_decl ( tbl, src, t, env, self, f, type );
-
-    /* check validation functions for exactly two parameters */
-    if ( f -> validate && ( rc == 0 || GetRCState ( rc ) == rcExists ) )
-    {
-        if ( f -> func . mand != 2 ||
-             f -> func . vararg != 0 ||
-             VectorLength ( & f -> func . parms ) != 2 )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcFunction, rcInvalid );
-            KTokenRCExplain ( t, klogInt, rc );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        /* need an overloaded name entry */
-        SNameOverload *name = ( void* ) f -> name -> u . obj;
-        if ( name == NULL )
-        {
-            /* create name */
-            rc = SNameOverloadMake ( & name, f -> name, 0, 4 );
-            if ( rc == 0 )
-            {
-                /* insert it - it's allowed to be empty */
-                rc = VectorAppend ( & self -> fname, & name -> cid . id, name );
-                if ( rc != 0 )
-                    SNameOverloadWhack ( name, NULL );
-            }
-        }
-
-        /* now need to record function */
-        if ( rc == 0 )
-        {
-            /* assume it's new in this schema */
-            rc = VectorAppend ( & self -> func, & f -> id, f );
-            if ( rc == 0 )
-            {
-                /* insert into name overload and exit on success */
-                uint32_t idx;
-                rc = VectorInsertUnique ( & name -> items, f, & idx, SFunctionSort );
-                if ( rc == 0 )
-                    return 0;
-
-                /* expected failure is that a function already exists */
-                if ( GetRCState ( rc ) != rcExists )
-                    VectorSwap ( & self -> func, f -> id, NULL, & ignore );
-                else
-                {
-                    /* see if new function trumps old */
-                    SFunction *exist = VectorGet ( & name -> items, idx );
-                    if ( f -> version > exist -> version )
-                    {
-                        /* insert our function in name overload */
-                        VectorSwap ( & name -> items, idx, f, & ignore );
-
-                        /* if existing is in another schema... */
-                        if ( ( const void* ) name != exist -> name -> u . obj )
-                            return 0;
-
-                        /* need to swap with old */
-                        assert ( exist -> id >= VectorStart ( & self -> func ) );
-                        assert ( exist -> id < f -> id );
-                        VectorSwap ( & self -> func, f -> id, NULL, & ignore );
-                        VectorSwap ( & self -> func, f -> id = exist -> id, f, & ignore );
-                        f = exist;
-                    }
-
-                    /* exists is not an error */
-                    rc = 0;
-                }
-
-                VectorSwap ( & self -> func, f -> id, NULL, & ignore );
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        rc = 0;
-    }
-    
-    SFunctionWhack ( f, NULL );
-    return rc;
-}
-
-/*
- * function-decl      = 'function' <ext-func-decl> ';'
- *                    | 'function' <script-func-decl>
- */
-rc_t function_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    return function_decl ( tbl, src, t, env, self,
-        env -> script_function_called_schema ? eFunction : 0, false );
-}
-
-/*
- * extern-func        = 'extern' 'function' <ext-function-decl> ';'
- */
-rc_t extfunc_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    return function_decl ( tbl, src, t, env, self, eFunction, false );
-}
-
-/*
- * validate-func      = 'validate' 'function' <validate-function-decl> ';'
- */
-rc_t valfunc_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    return function_decl ( tbl, src, t, env, self, eFunction, true );
-}
-
-#endif /* SLVL >= 3 */
-
-
-#if SLVL >= 4
-
-/*
- * script-decl        = 'schema' [ 'function' ] <script-func-decl>
- */
-rc_t script_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    if ( t -> id == kw_function )
-        next_token ( tbl, src, t );
-
-    return function_decl ( tbl, src, t, env, self, eScriptFunc, false );
-}
-
-#endif /* SLVL >= 4 */
diff --git a/libs/vdb/schema-int.c b/libs/vdb/schema-int.c
deleted file mode 100644
index d0204cf..0000000
--- a/libs/vdb/schema-int.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-
-#include <vdb/vdb-priv.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#define INTRINSIC_SUB_BYTE_MULTI_BIT_TYPES 0
-
-/* init_keywords
- *  create simple symbols with special ids
- */
-static
-rc_t init_keywords ( KSymTable *tbl )
-{
-    int i;
-    static struct
-    {
-        const char *keyword;
-        int id;
-    } kw [] =
-    {
-#define KEYWORD( word ) \
-        { # word, kw_ ## word }
-
-        KEYWORD ( alias ),
-        KEYWORD ( column ),
-        KEYWORD ( const ),
-        KEYWORD ( control ),
-        KEYWORD ( database ),
-        KEYWORD ( decode ),
-        KEYWORD ( default ),
-        KEYWORD ( encode ),
-        KEYWORD ( extern ),
-        KEYWORD ( false ),
-        KEYWORD ( fmtdef ),
-        KEYWORD ( function ),
-        KEYWORD ( include ),
-        KEYWORD ( index ),
-        KEYWORD ( limit ),
-        KEYWORD ( physical ),
-        KEYWORD ( read ),
-        KEYWORD ( readonly ),
-        KEYWORD ( return ),
-        KEYWORD ( schema ),
-        KEYWORD ( static ),
-        KEYWORD ( table ),
-        KEYWORD ( trigger ),
-        KEYWORD ( template ),
-        KEYWORD ( true ),
-        KEYWORD ( type ),
-        KEYWORD ( typedef ),
-        KEYWORD ( typeset ),
-        KEYWORD ( validate ),
-        KEYWORD ( version ),
-        KEYWORD ( view ),
-        KEYWORD ( virtual ),
-        KEYWORD ( void ),
-        KEYWORD ( writeonly ),
-        KEYWORD ( __untyped ),
-        KEYWORD ( __row_length ),
-        KEYWORD ( __no_header )
-
-#undef KEYWORD
-    };
-
-    /* define keywords */
-    for ( i = 0; i < sizeof kw / sizeof kw [ 0 ]; ++ i )
-    {
-        rc_t rc;
-
-        String name;
-        StringInitCString ( & name, kw [ i ] . keyword );
-        rc = KSymTableCreateSymbol ( tbl, NULL, & name, kw [ i ] . id, NULL );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    return 0;
-}
-
-
-/* byte swapping */
-static
-void byte_swap_16 ( void *dst, const void *src, uint64_t count )
-{
-    uint16_t *d = dst;
-    const uint16_t *s = src;
-
-    uint64_t i;
-    for ( i = 0; i < count; ++ i )
-        d [ i ] = bswap_16 ( s [ i ] );
-}
-
-static
-void byte_swap_32 ( void *dst, const void *src, uint64_t count )
-{
-    uint32_t *d = dst;
-    const uint32_t *s = src;
-
-    uint64_t i;
-    for ( i = 0; i < count; ++ i )
-        d [ i ] = bswap_32 ( s [ i ] );
-}
-
-static
-void byte_swap_64 ( void *dst, const void *src, uint64_t count )
-{
-    uint64_t *d = dst;
-    const uint64_t *s = src;
-
-    uint64_t i;
-    for ( i = 0; i < count; ++ i )
-        d [ i ] = bswap_64 ( s [ i ] );
-}
-
-#if SUPPORT_128_BIT
-static
-void byte_swap_128 ( void *dst, const void *src, uint64_t count )
-{
-    uint64_t i;
-    uint64_t *d = dst;
-    const uint64_t *s = src;
-
-    if ( ( const uint64_t* ) d != s )
-    {
-        for ( count += count, i = 0; i < count; i += 2 )
-        {
-            d [ i + 0 ] = bswap_64 ( s [ i + 1 ] );
-            d [ i + 1 ] = bswap_64 ( s [ i + 0 ] );
-        }
-    }
-    else
-    {
-        for ( count += count, i = 0; i < count; i += 2 )
-        {
-            uint64_t tmp = bswap_64 ( s [ i + 0 ] );
-            d [ i + 0 ] = bswap_64 ( s [ i + 1 ] );
-            d [ i + 1 ] = tmp;
-        }
-    }
-}
-#endif
-
-
-/* InitTypes
- *  set up intrinsic types
- */
-static
-rc_t VSchemaInitTypes ( VSchema *self, KSymTable *tbl )
-{
-    int i;
-    static struct
-    {
-        const char *newtype;
-        const char *supertype;
-        void ( * byte_swap ) ( void *dst, const void *src, uint64_t count );
-        uint8_t dim;
-        uint8_t domain;
-    } dt [] =
-    {
-        { "any", NULL, NULL, 1, 0 },
-        { "void", NULL, NULL, 1, 0 },
-        { "opaque", NULL, NULL, 1, 0 },
-
-        /* bundles of bits in machine native order */
-        { "B1", "opaque", NULL, 1, ddUint },
-        { "B8", "opaque", NULL, 8, ddUint },
-        { "B16", "opaque", byte_swap_16, 16, ddUint },
-        { "B32", "opaque", byte_swap_32, 32, ddUint },
-        { "B64", "opaque", byte_swap_64, 64, ddUint },
-
-        /* the basic unsigned integer types */
-        { "U1", "B1", NULL, 1, ddUint },
-        { "U8", "B8", NULL, 1, ddUint },
-        { "U16", "B16", byte_swap_16, 1, ddUint },
-        { "U32", "B32", byte_swap_32, 1, ddUint },
-        { "U64", "B64", byte_swap_64, 1, ddUint },
-
-        /* the basic signed integer types */
-        { "I8", "B8", NULL, 1, ddInt },
-        { "I16", "B16", byte_swap_16, 1, ddInt },
-        { "I32", "B32", byte_swap_32, 1, ddInt },
-        { "I64", "B64", byte_swap_64, 1, ddInt },
-
-#if INTRINSIC_SUB_BYTE_MULTI_BIT_TYPES
-        /* all the basic bit tuples are subtypes
-           of opaque, making them essentially atomic,
-           required due to native byte order issues */
-        { "B2", "opaque", NULL, 2, ddUint },
-        { "B4", "opaque", NULL, 4, ddUint },
-        { "U2", "B2", NULL, 1, ddUint },
-        { "U4", "B4", NULL, 1, ddUint },
-        { "I4", "B4", NULL, 1, ddInt },
-#endif
-
-#if SUPPORT_128_BIT
-        /* 128 bit types */
-        { "B128", "opaque", byte_swap_128, 128, ddUint },
-        { "U128", "B128", byte_swap_128, 1, ddUint },
-        { "I128", "B128", byte_swap_128, 1, ddInt },
-#endif
-
-        /* floating point */
-        { "F32", "B32", byte_swap_32, 1, ddFloat },
-        { "F64", "B64", byte_swap_64, 1, ddFloat },
-
-        /* bool is typed to reflect C/C++ */
-        { "bool", "U8", NULL, 1, ddBool },
-
-        /* default character set is UNICODE */
-        { "utf8", "B8", NULL, 1, ddUnicode },
-        { "utf16", "B16", byte_swap_16, 1, ddUnicode },
-        { "utf32", "B32", byte_swap_32, 1, ddUnicode },
-
-        /* contrary to sub-classing, which extends/expands
-           a class, sub-typing refines it, making ASCII
-           a sub-type of UTF-8 in our system */
-        { "ascii", "utf8", NULL, 1, ddAscii }
-    };
-
-    for ( i = 0; i < sizeof dt / sizeof dt [ 0 ]; ++ i )
-    {
-        rc_t rc;
-        String name;
-        SDatatype *newtype;
-        const SDatatype *super = NULL;
-
-        if ( dt [ i ] . supertype != NULL )
-        {
-            KSymbol *sym;
-
-            /* find supertype in symbol table */
-            StringInitCString ( & name, dt [ i ] . supertype );
-            sym = KSymTableFind ( tbl, & name );
-            assert ( sym != NULL );
-            assert ( sym -> type == eDatatype );
-            super = sym -> u . obj;
-        }
-
-        /* create datatype */
-        newtype = malloc ( sizeof * newtype );
-        if ( newtype == NULL )
-            return RC ( rcVDB, rcSchema, rcConstructing, rcMemory, rcExhausted );
-
-        /* initialize datatype */
-        newtype -> super = super;
-        newtype -> byte_swap = dt [ i ] . byte_swap;
-        newtype -> size = ( ( super != NULL ) ? super -> size : 1 ) * dt [ i ] . dim;
-        newtype -> dim = dt [ i ] . dim;
-        newtype -> domain = dt [ i ] . domain;
-
-        /* just to cover any lazy programming, take byte_swap
-           from super-type if not already specified */
-        if ( super != NULL && newtype -> byte_swap == NULL )
-            newtype -> byte_swap = super -> byte_swap;
-
-        /* create symbol for new type */
-        StringInitCString ( & name, dt [ i ] . newtype );
-        newtype -> name = KSymTableFind ( tbl, & name );
-        assert ( newtype -> name == NULL || i == 1 );
-        if ( newtype -> name == NULL )
-            rc = KSymTableCreateConstSymbol ( tbl, & newtype -> name, & name, eDatatype, newtype );
-        else
-            rc = 0;
-
-        /* add datatype */
-        if ( rc == 0 )
-            rc = VectorAppend ( & self -> dt, & newtype -> id, newtype );
-
-        if ( rc != 0 )
-        {
-            free ( newtype );
-            return rc;
-        }
-    }
-
-    return 0;
-}
-
-
-/* MakeIntrinsic
- *  initialize intrinsics
- */
-rc_t VSchemaMakeIntrinsic ( VSchema **sp )
-{
-    rc_t rc = VSchemaMake ( sp, NULL );
-    if ( rc == 0 )
-    {
-        KSymTable tbl;
-        VSchema *self = * sp;
-
-        /* create symbol table with no intrinsic scope */
-        rc = KSymTableInit ( & tbl, NULL );
-        if ( rc == 0 )
-        {
-            /* make intrinsic scope modifiable */
-            KSymTablePushScope ( & tbl, & self -> scope );
-
-            /* add keywords, which are only names */
-            rc = init_keywords ( & tbl );
-            if ( rc == 0 )
-            {
-                /* TBD - init intrinsic formats */
-                rc = VSchemaInitTypes ( self, & tbl );
-                if ( rc == 0 )
-                {
-                    KSymTableWhack ( & tbl );
-                    return 0;
-                }
-            }
-
-            KSymTableWhack ( & tbl );
-        }
-
-        VSchemaRelease ( self );
-    }
-
-    * sp = NULL;
-
-    return rc;
-}
-
-/* LastIntrinsicTypeId - PRIVATE
- *  used to allow cast to intrinsics
- */
-LIB_EXPORT uint32_t CC VSchemaLastIntrinsicTypeId ( const VSchema *self )
-{
-    uint32_t last;
-    for ( last = 0; self != NULL; self = self -> dad )
-    {
-        if ( self -> dad == NULL )
-        {
-            last = VectorStart ( & self -> dt ) + VectorLength ( & self -> dt );
-            if ( last != 0 )
-                -- last;
-            break;
-        }
-    }
-
-    return last;
-}
diff --git a/libs/vdb/schema-parse.c b/libs/vdb/schema-parse.c
deleted file mode 100644
index d36cd8b..0000000
--- a/libs/vdb/schema-parse.c
+++ /dev/null
@@ -1,855 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "schema-parse.h"
-#include "schema-dump.h"
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * SchemaEnv
- */
-
-/* Init - PRIVATE
- *  initialize to current version
- */
-static
-void SchemaEnvInitFeatures ( SchemaEnv *env )
-{
-    assert ( env != NULL );
-
-    switch ( env -> version >> 24 )
-    {
-    case 0:
-        env -> schema_param_types_absent = 1;
-        env -> mixed_fact_param_list = 1;
-        env -> script_function_called_schema = 1;
-        break;
-    case 1:
-        switch ( ( uint8_t ) ( env -> version >> 16 ) )
-        {
-        case 1:
-            env -> default_view_decl = 1;
-            env -> has_view_keyword = 1;
-            break;
-        }
-    }
-}
-
-void SchemaEnvInit ( SchemaEnv *env, uint32_t version )
-{
-    assert ( env != NULL );
-    memset ( env, 0, sizeof * env );
-
-    /* set version */
-    env -> version = version;
-    SchemaEnvInitFeatures ( env );
-}
-
-
-/*--------------------------------------------------------------------------
- * SConstant
- */
-#if SLVL >= 2
-
-/* Whack
- */
-void CC SConstantWhack ( void *item, void *ignore )
-{
-    SConstant *self = item;
-    SExpressionWhack ( self -> expr );
-    free ( self );
-}
-
-/* Mark
- */
-void CC SConstantClearMark ( void *item, void *ignore )
-{
-    SConstant *self = item;
-    self -> marked = false;
-}
-
-void SConstantMark ( const SConstant *cself )
-{
-    SConstant *self = ( SConstant* ) cself;
-    if ( self != NULL && ! self -> marked )
-        self -> marked = true;
-}
-
-/* Dump
- *  dump "const", dump object
- */
-rc_t SConstantDump ( const SConstant *self, struct SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-bool CC SConstantDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SConstant *self = ( const void* ) item;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    if ( SDumperMode ( b ) == sdmCompact )
-    {
-        return SDumperPrint ( b, "const %T %N=%E;",
-            & self -> td, self -> name, self -> expr );
-    }
-
-    return SDumperPrint ( b, "const %T %N = %E;\n",
-        & self -> td, self -> name, self -> expr );
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-
-/* resolve_object
- *  generic object find
- *
- *  "td" [ OUT, NULL OKAY ] - returns cast type expression
- *  if given or "any" if not
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  "dflt" [ IN ] - if true, resolve default value
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-static
-int CC SColumnSortByID ( const void **item, const void **n, void *ignore )
-{
-    const SColumn *a = * item;
-    const SColumn *b = * n;
-    return VCtxIdCmp ( & a -> cid, & b -> cid );
-}
-
-static
-void CC SColumnLastDefault ( void *item, void *data )
-{
-    const SColumn *self = ( const SColumn* ) item;
-    const SColumn **colp = ( const SColumn** ) data;
-
-    if ( self -> dflt || * colp == NULL )
-        * colp = self;
-}
-
-typedef struct column_best_fit_data column_best_fit_data;
-struct column_best_fit_data
-{
-    const SColumn *scol;
-    const VSchema *schema;
-    VTypedecl td;
-    uint32_t distance;
-};
-
-static
-void CC SColumnBestFit ( void *item, void *data )
-{
-    const SColumn *scol = ( const void * ) item;
-    if ( scol -> td . type_id != 0 )
-    {
-        uint32_t distance;
-        column_best_fit_data *pb = data;
-        if ( VTypedeclToTypedecl ( & scol -> td, pb -> schema, & pb -> td, NULL, & distance ) )
-        {
-            if ( pb -> scol == NULL || pb -> distance > distance )
-            {
-                pb -> scol = scol;
-                pb -> distance = distance;
-            }
-        }
-    }
-}
-
-const void *resolve_object ( const KSymTable *tbl,
-    const VSchema *self, VTypedecl *tdp, const SNameOverload **namep,
-     uint32_t *type, const char *expr, const char *ctx, bool dflt )
-{
-    rc_t rc;
-    const void *obj;
-    
-    VTypedecl td;
-    bool has_type = false;
-
-    KToken t;
-    KTokenText tt;
-    KTokenSource src;
-
-    SchemaEnv env;
-    SchemaEnvInit ( & env, EXT_SCHEMA_LANG_VERSION );
-
-    KTokenTextInitCString ( & tt, expr, ctx );
-    KTokenSourceInit ( & src, & tt );
-    next_token ( tbl, & src, & t );
-
-    /* initialize return values */
-    obj = NULL;
-
-    /* ready to go - can accept a typecast */
-    if ( t . id == eLeftParen )
-    {
-        has_type = true;
-        next_token ( tbl, & src, & t );
-        rc = typedecl ( tbl, & src, & t, & env, self, & td );
-        if ( rc == 0 )
-            rc = expect ( tbl, & src, & t, eRightParen, ")", true );
-        if ( tdp != NULL )
-            * tdp = td;
-    }
-
-    /* can also accept a physical name */
-    else 
-    {
-        if ( t . id == ePeriod )
-            physical_name ( tbl, & src, & t, & env );
-        if ( tdp != NULL )
-            memset ( tdp, 0, sizeof * tdp );
-        rc = 0;
-    }
-
-    /* we recognize a column name or
-       a fully-qualified name optionally followed by
-       a version to fully-qualify obj */
-    if ( rc == 0 )
-        rc = next_fqn ( tbl, & src, & t, & env );
-    if ( rc == 0 )
-    {
-        uint32_t vers;
-        KToken st = t;
-        bool has_vers = false;
-        bool needs_name = true;
-        const SNameOverload *name = NULL;
-
-        next_token ( tbl, & src, & t );
-        switch ( st . id )
-        {
-        case eConstant:
-        case eFormat:
-        case eDatatype:
-        case eTypeset:
-        case ePhysMember:
-        case eTblMember:
-        case eDBMember:
-            needs_name = false;
-            obj = st . sym -> u . obj;
-            break;
-        case eFunction:
-        case eScriptFunc:
-        case ePhysical:
-        case eTable:
-        case eDatabase:
-            if ( t . id == eHash )
-            {
-                next_token ( tbl, & src, & t );
-                rc = maj_min_rel ( tbl, & src, & t, & env, self, & vers, true );
-                if ( rc != 0 )
-                    break;
-                has_vers = true;
-            }
-        case eUntypedFunc:
-        case eColumn:
-            name = st . sym -> u . obj;
-            break;
-        }
-
-        /* check if we found anything at all */
-        if ( obj != NULL || name != NULL )
-        {
-            /* accept but don't require semi-colon */
-            if ( t . id == eSemiColon )
-                next_token ( tbl, & src, & t );
-
-            /* expect end of input or else we didn't recognize */
-            if ( t . id != eEndOfInput )
-            {
-                obj = NULL;
-                name = NULL;
-            }
-        }
-
-        /* if we have something */
-        if ( obj != NULL || name != NULL )
-        {
-            * type = st . id;
-
-            /* resolve by version */
-            if ( has_vers )
-            {
-                assert ( name != NULL );
-                switch ( st . id )
-                {
-                case eFunction:
-                case eScriptFunc:
-                    obj = VectorFind ( & name -> items, & vers, NULL, SFunctionCmp );
-                    break;
-                case ePhysical:
-                    obj = VectorFind ( & name -> items, & vers, NULL, SPhysicalCmp );
-                    break;
-                case eTable:
-                    obj = VectorFind ( & name -> items, & vers, NULL, STableCmp );
-                    break;
-                case eDatabase:
-                    obj = VectorFind ( & name -> items, & vers, NULL, SDatabaseCmp );
-                    break;
-                }
-
-                /* since a version was requested,
-                   don't allow a partial find */
-                if ( obj == NULL )
-                    name = NULL;
-            }
-
-            /* resolve by type or default */
-            else if ( needs_name )
-            {
-                assert ( name != NULL );
-                switch ( st . id )
-                {
-                case eColumn:
-                    if ( ! has_type )
-                    {
-                        Vector items;
-                        rc = VectorCopy ( & name -> items, & items );
-                        if ( rc != 0 )
-                            break;
-                        VectorReorder ( & items, SColumnSortByID, NULL );
-                        VectorForEach ( & items, false, SColumnLastDefault, (void*)& obj );
-                        VectorWhack ( & items, NULL, NULL );
-                    }
-                    else
-                    {
-                        column_best_fit_data pb;
-                        pb . scol = NULL;
-                        pb . schema = self;
-                        pb . td = td;
-                        pb . distance = -1;
-
-                        VectorForEach ( & name -> items, false, SColumnBestFit, & pb );
-                        obj = pb . scol;
-                        if ( obj == NULL )
-                        {
-                            /* if named column is incomplete, allow match */
-                            memset ( & td, 0, sizeof td );
-                            obj = VectorFind ( & name -> items, & td, NULL, SColumnCmp );
-
-                            /* if column could not be matched by type, forget it */
-                            if ( obj == NULL )
-                                name = NULL;
-                        }
-                    }
-                    break;
-
-                default:
-                    if ( dflt )
-                        obj = VectorLast ( & name -> items );
-                }
-            }
-
-            * namep = name;
-        }
-    }
-
-    return obj;
-}
-
-/* Find
- *  generic object find
- *
- *  "name" [ OUT ] - returns list of overloaded names if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - name expression identifying object
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *VSchemaFind ( const VSchema *self,
-    const SNameOverload **name, uint32_t *type,
-    const char *expr, const char *ctx, bool dflt )
-{
-    rc_t rc;
-    KSymTable tbl;
-
-    /* initialize to not-found */
-    const void *obj = NULL;
-    * name = NULL;
-    * type = 0;
-
-    /* build a symbol table for schema */
-    rc = init_symtab ( & tbl, self );
-    if ( rc == 0 )
-    {
-        obj = resolve_object ( & tbl, self, NULL, name, type, expr, ctx, dflt );
-        KSymTableWhack ( & tbl );
-    }
-
-    return obj;
-}
-
-
-/* next_token
- *  gets next token
- *  looks up any identifier in symbol table
- *  converts token id to found symbol type
- */
-KToken *next_token ( const KSymTable *tbl, KTokenSource *src, KToken *t )
-{
-    if ( KTokenizerNext ( kDefaultTokenizer, src, t ) -> id == eIdent )
-    {
-        KSymbol *sym = KSymTableFind ( tbl, & t -> str );
-        t -> sym = sym;
-        if ( sym != NULL )
-            t -> id = sym -> type;
-    }
-
-    return t;
-}
-
-KToken *next_shallow_token ( const KSymTable *tbl, KTokenSource *src, KToken *t, bool plus_intrinsic )
-{
-    if ( KTokenizerNext ( kDefaultTokenizer, src, t ) -> id == eIdent || t -> id == eName )
-    {
-        KSymbol *sym = KSymTableFindShallow ( tbl, & t -> str );
-        if ( sym == NULL && plus_intrinsic )
-            sym = KSymTableFindIntrinsic ( tbl, & t -> str );
-        t -> sym = sym;
-        if ( sym != NULL )
-            t -> id = sym -> type;
-    }
-
-    return t;
-}
-
-
-/* expect
- *  performs a comparison of t->id against id, and takes one of 3 actions:
- *  1) when ids match, advance to next token and return 0
- *  2) when ids don't match but the expected token is not required,
- *     issue a KTokenExpected warning using expected text and return 0
- *  3) when ids don't match and the expected token is required,
- *     issue a KTokenExpected error using expected text and return its rc_t
- */
-rc_t expect ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    int id, const char *expected, bool required )
-{
-    if ( t -> id == id )
-        next_token ( tbl, src, t );
-    else if ( ! required )
-        KTokenExpected ( t, klogWarn, expected );
-    else
-        return KTokenExpected ( t, klogErr, expected );
-    return 0;
-}
-
-
-/*
- * maj-min            = <uint-expr> [ '.' <uint-expr> ]
- * maj-min-rel        = <uint-expr> [ '.' <uint-expr> [ '.' <uint-expr> ] ]
- */
-
-#if SLVL >= 1
-rc_t maj_min_rel ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, uint32_t *version, bool accept_release )
-{
-    rc_t rc;
-
-    if ( ! accept_release && t -> id == eMajMinRel )
-        return KTokenExpected ( t, klogErr, "maj.min version" );
-
-    rc = KTokenToVersion ( t, version );
-    if ( rc != 0 )
-        KTokenExpected ( t, klogErr, "version spec" );
-
-    next_token ( tbl, src, t );
-    return rc;
-}
-#endif
-
-
-/*
- * const-definition   = 'const' <typedecl> <fqn> '=' <const-expr>
- */
-#if SLVL >= 2
-static
-rc_t const_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    rc_t rc;
-    SConstant *cnst = malloc ( sizeof * cnst );
-    if ( cnst == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    rc = typedecl ( tbl, src, t, env, self, & cnst -> td );
-    if ( rc == 0 )
-        rc = create_fqn ( tbl, src, t, env, eConstant, cnst );
-    if ( rc == 0 )
-    {
-        cnst -> name = t -> sym;
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-            rc = const_expr ( tbl, src, t, env, self, & cnst -> expr );
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        cnst -> name = t -> sym;
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-            rc = const_expr ( tbl, src, t, env, self, & cnst -> expr );
-        if ( rc == 0 )
-        {
-            /* TBD - compare expressions for equivalence */
-            SConstantWhack ( cnst, NULL );
-            return expect ( tbl, src, t, eSemiColon, ";", true );
-        }
-    }
-
-    if ( rc != 0 )
-    {
-        free ( cnst );
-        return rc;
-    }
-
-    rc = VectorAppend ( & self -> cnst, & cnst -> id, cnst );
-    if ( rc != 0 )
-    {
-        SConstantWhack ( cnst, NULL );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    return expect ( tbl, src, t, eSemiColon, ";", true );
-}
-#endif
-
-
-/*
- * alias-definition   = 'alias' SYMBOL <fqn>
- */
-static
-rc_t alias_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    const KSymbol *sym;
-
-    /* read symbol name */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-
-    /* remember symbol */
-    sym = t -> sym;
-
-    /* create new name */
-    rc = create_fqn ( tbl, src, next_token ( tbl, src, t ),
-        env, sym -> type, sym -> u . obj );
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcExists )
-            return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-
-        /* TBD - compare alias */
-        return expect ( tbl, src, next_token ( tbl, src, t ), eSemiColon, ";", true );
-    }
-
-    /* record alias */
-    rc = VectorAppend ( & self -> alias, NULL, t -> sym );
-    if ( rc != 0 )
-        return KTokenRCExplain ( t, klogErr, rc );
-
-    return expect ( tbl, src, next_token ( tbl, src, t ), eSemiColon, ";", true );
-}
-
-
-/*
- * extern-decl        = 'extern' 'function' <ext-function-decl> ';'
- */
-static
-rc_t extern_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    switch ( t -> id )
-    {
-#if SLVL >= 3
-    case kw_function:
-        return extfunc_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-    default:
-        break;
-    }
-
-    return KTokenExpected ( t, klogErr, "function" );
-}
-
-
-/*
- * validate-decl      = 'validate' 'function' <validate-function-decl> ';'
- */
-static
-rc_t validate_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    switch ( t -> id )
-    {
-#if SLVL >= 3
-    case kw_function:
-        return valfunc_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-    default:
-        break;
-    }
-
-    return KTokenExpected ( t, klogErr, "function" );
-}
-
-
-/*
- * include-stmt       = 'include' STRING ';'
- */
-static
-rc_t include_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    rc_t rc;
-
-    if ( t -> id != eString )
-        return KTokenExpected ( t, klogErr, "file path" );
-
-    rc = VSchemaParseFile ( self, "%.*s", ( int ) ( t -> str . size - 2 ), t -> str . addr + 1 );
-    if ( rc != 0 )
-        return KTokenRCExplain ( t, klogErr, rc );
-
-    return expect ( tbl, src, next_token ( tbl, src, t ), eSemiColon, ";", true );
-}
-
-
-/*
- * schema-decl        = <type-definition>
- *                    | <typeset-definition>
- *                    | <format-definition>
- *                    | <const-definition>
- *                    | <alias-definition>
- *                    | <extern-decl>
- *                    | <script-decl>
- *                    | <function-decl>
- *                    | <physical-decl>
- *                    | <table-decl>
- *                    | <database-decl>
- *                    | <include-stmt>
- *                    | ';'
- */
-static
-rc_t schema_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    /* expect a keyword */
-    switch ( t -> id )
-    {
-#if SLVL >= 1
-    case kw_typedef:
-        return type_definition ( tbl, src, next_token ( tbl, src, t ), env, self );
-    case kw_typeset:
-        return typeset_definition ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-    case kw_fmtdef:
-        return format_definition ( tbl, src, next_token ( tbl, src, t ), env, self );
-#if SLVL >= 2
-    case kw_const:
-        return const_definition ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-    case kw_alias:
-        return alias_definition ( tbl, src, next_token ( tbl, src, t ), env, self );
-
-    case kw_extern:
-        return extern_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#if SLVL >= 3
-    case kw_function:
-        return function_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-#if SLVL >= 4
-    case kw_schema:
-        return script_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-#if SLVL >= 5
-    case kw_physical:
-        return physical_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-#if SLVL >= 6
-    case kw_table:
-        return table_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-    case kw_database:
-        return database_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-#endif
-    case kw_include:
-        return include_stmt ( tbl, src, next_token ( tbl, src, t ), env, self );
-
-    case kw_validate:
-        return validate_declaration ( tbl, src, next_token ( tbl, src, t ), env, self );
-
-    case eSemiColon:
-        /* TBD - issue warning if desired */
-        next_token ( tbl, src, t );
-        return 0;
-    }
-
-    /* it wasn't the right thing */
-    return KTokenExpected ( t, klogErr,
-        "include, typedef, typeset, fmtdef, function, schema, database or table" );
-}
-
-/*
- * schema-version     = 'version' <maj-min>
- */
-#if SLVL >= 1
-static
-rc_t schema_version ( const KSymTable *tbl, KTokenSource *src, KToken *t, SchemaEnv *env )
-{
-    rc_t rc = maj_min_rel ( tbl, src, t, env, NULL, & env -> version, false );
-    if ( rc == 0 )
-        SchemaEnvInitFeatures ( env );
-    return rc;
-}
-#endif
-
-
-/* examine_schema_contents
- *  run a sanity check on schema contents
- */
-#if EXAMINE_SCHEMA_CONTENTS >= 1
-static
-rc_t examine_schema_contents ( const VSchema *self )
-{
-    rc_t rc = 0;
-
-    if ( self -> dad != NULL )
-    {
-        rc = examine_schema_contents ( self -> dad );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    if ( BSTreeDoUntil ( & self -> scope, false, KSymbolExamineContents, & rc ) )
-        return rc;
-
-    return 0;
-}
-#endif
-
-/*
- * schema             = [ <schema-version> ';' ] [ <schema-decl-list> ]
- *
- * schema-decl-list   = <schema-decl> [ <schema-decl-list> ]
- */
-rc_t init_symtab ( KSymTable *tbl, const VSchema *self )
-{
-    rc_t rc;
-
-    if ( self -> dad == NULL )
-        return KSymTableInit ( tbl, ( BSTree* ) & self -> scope );
-
-    rc = init_symtab ( tbl, self -> dad );
-    if ( rc == 0 )
-        rc = KSymTablePushScope ( tbl, ( BSTree* ) & self -> scope );
-
-    return rc;
-}
-
-rc_t schema ( KTokenSource *src, VSchema *self )
-{
-    /* push schema scope onto symbol table */
-    KSymTable tbl;
-    rc_t rc = init_symtab ( & tbl, self );
-    if ( rc == 0 )
-    {
-        KToken t;
-        SchemaEnv env;
-
-        /* prime token and look for version */
-        next_token ( & tbl, src, & t );
-#if SLVL >= 1
-        /* initialize default to v1 */
-        if ( t . id != kw_version )
-            SchemaEnvInit ( & env, 0x01000000 );
-        else
-        {
-            /* initialize explicit version */
-            memset ( & env, 0, sizeof env );
-            rc = schema_version ( & tbl, src, next_token ( & tbl, src, & t ), & env );
-            if ( rc == 0 )
-                rc = expect ( & tbl, src, & t, eSemiColon, ";", true );
-        }
-#endif
-        if ( rc == 0 && t . id != eEndOfInput )
-        {
-            /* implement optional schema-decl-list */
-            while ( rc == 0 && t . id != eEndOfInput )
-            {
-#if EXAMINE_SCHEMA_CONTENTS >= 1
-                rc = examine_schema_contents ( self );
-                if ( rc == 0 )
-#endif
-                rc = schema_decl ( & tbl, src, & t, & env, self );
-            }
-        }
-
-        KSymTableWhack ( & tbl );
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/schema-parse.h b/libs/vdb/schema-parse.h
deleted file mode 100644
index 2c955dc..0000000
--- a/libs/vdb/schema-parse.h
+++ /dev/null
@@ -1,607 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_schema_parse_
-#define _h_schema_parse_
-
-#ifndef _h_schema_priv_
-#include "schema-priv.h"
-#endif
-
-#ifndef _h_schema_tok_
-#include "schema-tok.h"
-#endif
-
-#ifndef _h_klib_symtab_
-#include <klib/symtab.h>
-#endif
-
-#ifndef _h_klib_debug_
-#include <klib/debug.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * defines
- */
-#define PARSE_DEBUG( msg ) \
-    DBGMSG ( DBG_VDB, DBG_FLAG ( DBG_VDB_PARSE ), msg )
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct SVector;
-struct STable;
-struct SDatabase;
-struct SFunction;
-struct SConstExpr;
-struct SFormParmlist;
-struct SExpression;
-struct STypeExpr;
-
-/*--------------------------------------------------------------------------
- * extension of token ids
- */
-enum
-{
-    /* a symbolic constant */
-    eConstant = eNumSymtabIDs,
-
-    /* format type */
-    eFormat,
-
-    /* dynamic data type */
-    eDatatype,
-
-    /* typeset */
-    eTypeset,
-
-    /* factory */
-    eFactory,
-
-    /* external C function */
-    eFunction,
-    eUntypedFunc,
-    eRowLengthFunc,
-
-    /* script function */
-    eScriptFunc,
-
-    /* schema type and param
-       a schema type is a templatized type, basically
-       a name without a completed definition
-
-       a schema param is a parameterized constant that
-       can be used in defining type vector dimensions */
-    eSchemaType,
-    eSchemaParam,
-
-    /* factory param and name
-       a factory param is a templatized constant, but
-       cannot be used to define type dimensions */
-    eFactParam,
-
-    /* function param */
-    eFuncParam,
-
-    /* intermediate production */
-    eProduction,
-
-    /* physical column */
-    ePhysical,
-
-    /* physical column member */
-    ePhysMember,
-
-    /* external column */
-    eColumn,
-
-    /* forward declaration */
-    eForward,
-
-    /* purely virtual production */
-    eVirtual,
-
-    /* table */
-    eTable,
-
-    /* table member */
-    eTblMember,
-
-    /* database */
-    eDatabase,
-
-    /* database member */
-    eDBMember,
-
-    /* keywords */
-    eFirstKeyword,
-
-    kw_alias = eFirstKeyword,
-    kw_column,
-    kw_const,
-    kw_control,
-    kw_database,
-    kw_decode,
-    kw_default,
-    kw_encode,
-    kw_extern,
-    kw_false,
-    kw_fmtdef,
-    kw_function,
-    kw_include,
-    kw_index,
-    kw_limit,
-    kw_physical,
-    kw_read,
-    kw_readonly,
-    kw_return,
-    kw_schema,
-    kw_static,
-    kw_table,
-    kw_template,
-    kw_trigger,
-    kw_true,
-    kw_type,
-    kw_typedef,
-    kw_typeset,
-    kw_validate,
-    kw_version,
-    kw_view,
-    kw_virtual,
-    kw_void,
-    kw_writeonly,
-
-    /* special keywords */
-    kw___untyped,
-    kw___row_length,
-    kw___no_header
-
-};
-
-/* SchemaEnv
- *  states the schema language version
- *  gives switches as to features, errors, warnings, etc.
- */
-typedef struct SchemaEnv SchemaEnv;
-struct SchemaEnv
-{
-    /* maj.min.rel format,
-       only maj.min supported */
-    uint32_t version;
-
-    /* V0 COMPATIBILITY SWITCHES */
-    uint32_t schema_param_types_absent : 1;
-    uint32_t mixed_fact_param_list : 1;
-    uint32_t script_function_called_schema : 1;
-
-    /* V1 SWITCHES */
-    uint32_t default_view_decl : 1;
-    uint32_t has_view_keyword : 1;
-};
-
-/* SCHEMA_LANG_VERSION
- *  version numbers of schema language
- */
-#define CUR_SCHEMA_LANG_VERSION 0x01000000
-#define EXT_SCHEMA_LANG_VERSION 0x01000000
-
-/* Init
- *  initialize to current version
- */
-void SchemaEnvInit ( SchemaEnv *env, uint32_t version );
-
-/*--------------------------------------------------------------------------
- * schema-parse.c
- */
-
-/*
- * schema             = [ <schema-version> ';' ] [ <schema-decl-list> ]
- *
- * schema-decl-list   = <schema-decl> [ <schema-decl-list> ]
- *
- * schema-decl        = <type-definition> ';'
- *                    | <typeset-definition> ';'
- *                    | <format-definition> ';'
- *                    | <function-decl> ';'
- *                    | <schema-decl>
- *                    | <table-decl>
- *
- * schema-version     = 'version' <maj-min>
- */
-rc_t schema ( KTokenSource *src, VSchema *self );
-
-/*
- * init_symtab
- *  initializes "tbl"
- *  places schema and parents into scope
- *  must be balanced by KSymTableWhack
- */
-rc_t init_symtab ( KSymTable *tbl, const VSchema *self );
-
-/* next_token
- *  gets next token
- *  looks up any identifier in symbol table
- *  converts token id to found symbol type
- * next_shallow_token
- *  only searches current scope, and optionally intrinsic scope
- */
-#define next_token vdb_next_token
-#define next_shallow_token vdb_next_shallow_token
-KToken *next_token ( const KSymTable *tbl, KTokenSource *src, KToken *t );
-KToken *next_shallow_token ( const KSymTable *tbl,
-    KTokenSource *src, KToken *t, bool plus_intrinsic );
-
-/* expect
- *  performs a comparison of t->id against id, and takes one of 3 actions:
- *  1) when ids match, advance to next token and return 0
- *  2) when ids don't match but the expected token is not required,
- *     issue a KTokenExpected warning using expected text and return 0
- *  3) when ids don't match and the expected token is required,
- *     issue a KTokenExpected error using expected text and return its rc_t
- */
-rc_t expect ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    int id, const char *expected, bool required );
-
-/*
- * maj-min            = <uint-expr> [ '.' <uint-expr> ]
- * maj-min-rel        = <uint-expr> [ '.' <uint-expr> [ '.' <uint-expr> ] ]
- */
-rc_t maj_min_rel ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, uint32_t *version, bool accept_release );
-
-rc_t next_uint ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, uint32_t *val );
-
-/* resolve_object
- *  generic object find
- *
- *  "td" [ OUT, NULL OKAY ] - returns cast type expression
- *  if given or "any" if not
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  "dflt" [ IN ] - if true, resolve default value
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *resolve_object ( const KSymTable *tbl,
-    const VSchema *self, VTypedecl *td, const SNameOverload **name,
-    uint32_t *type, const char *expr, const char *ctx, bool dflt );
-
-
-/*--------------------------------------------------------------------------
- * schema-type.c
- */
-
-
-/*
- * fqn                = ID [ <nested-name> ]
- * nested-name        = ':' NAME [ <nested-name> ]
- */
-rc_t next_fqn ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env );
-rc_t create_fqn ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t id, const void *obj );
-
-
-/*
- * dim                = '[' <uint-expr> ']'
- */
-rc_t dim ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, uint32_t *dim, bool required );
-
-/*
- * typename           = <fqn>
- * typedecl           = <typename> [ <dim> ]
- */
-rc_t typename ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t *id );
-rc_t typedecl ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VTypedecl *td );
-
-/*
- * typeset            = <fqn>
- * typespec           = <typedecl>
- *                    | <typeset> [ <dim> ]
- */
-rc_t typeset ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t *id );
-rc_t typespec ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VTypedecl *td );
-
-/*
- * fmtname            = <fqn>
- * fmtdecl            = <fmtname> [ '/' <typedecl> ]
- *                    | <typedecl>
- * fmtspec            = <fmtname> [ '/' <typedecl> ]
- *                    | <typespec>
- */
-rc_t fmtname ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t *id );
-rc_t fmtdecl ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VFormatdecl *fd );
-rc_t fmtspec ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VFormatdecl *fd );
-
-/*
- * type-definition    = 'typedef' <typename> <typedef-list>
- * typedef-list       = <typedef-decl> [ ',' <typedef-list> ]
- * typedef-decl       = <fqn> [ <dim> ]
- */
-rc_t type_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-/*
- * typeset-definition = 'typeset' <typeset> '{' <typespec-list> '}'
- * typespec-list      = <typespec> [ ',' <typespec-list> ]
- */
-rc_t typeset_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-/*
- * format-definition  = 'fmtdef' [ <fmtname> ] <fqn>
- */
-rc_t format_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-
-/*--------------------------------------------------------------------------
- * schema-func.c
- */
-
-/*
- * function-decl      = [ 'extern' ] 'function' <ext-function-decl> ';'
- *                    | 'validate' 'function' <validate-function-decl> ';'
- *                    | 'schema' [ 'function' ] <sch-func-decl>
- *                    | 'function' <ext-func-decl> ';'
- *                    | 'function' <sch-func-decl>
- */
-rc_t function_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-rc_t extfunc_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-rc_t valfunc_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-rc_t script_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-/*
- * schema-signature   = <schema-formals>
- * schema-formals     = <schema-formal> [ ',' <schema-formals> ]
- * schema-formal      = <schema-typedecl> ID
- * schema-parmname    = ID
- */
-rc_t schema_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, struct SFunction *sig );
-
-/*
- * fact-signature     = <fact-formals> [ '*' <fact-formals> ] [ ',' '...' ]
- *                    | '*' <fact-formals> [ ',' '...' ]
- *                    | '...'
- */
-rc_t fact_signature ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, struct SFormParmlist *sig );
-
-
-/*--------------------------------------------------------------------------
- * schema-prod.c
- */
-
-/*
- * production-stmt    = <func-fmtdecl> ID <assign-expr>
- *                    | 'trigger' ID <assign-expr>
- */
-rc_t production_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, struct Vector *v, uint32_t ptype );
-
-/*
- * script-body        = '{' <script-stmts> '}'
- */
-rc_t script_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, struct SFunction *f );
-
-/*
- * physical-decl      = 'physical' [ 'column' ] <typedecl>
- *                       <fqn> '#' <maj-min-rel> <phys-body>
- */
-rc_t physical_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-
-/*--------------------------------------------------------------------------
- * schema-expr.c
- */
-
-/*
- * dim-expr           = '[' <uint-expr> ']'
- */
-rc_t dim_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, struct SExpression const **dim, bool required );
-
-
-/*
- * cond-expr          = <expression> [ '|' <cond-expr> ]
- */
-rc_t cond_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, struct SExpression const **expr );
-
-/*
- * expression         = <param-value>
- *                    | <func-expr>
- *                    | '(' <func-fmtdecl> ')' <expression>
- */
-rc_t expression ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, struct SExpression const **expr );
-
-/*
- * type-expr          = <typeset>
- *                    | <fmtdecl>
- *                    | <fmtname> '/' <typeset>
- */
-rc_t type_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, struct SExpression const **fd );
-rc_t vardim_type_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, struct SExpression const **fd );
-
-/*
- * const-expr         = <constname>
- *                    | CONST-VALUE
- */
-rc_t const_expr ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, struct SExpression const **expr );
-
-/*
- * phys-encoding-expr = [ '<' <schema-parms> '>' ]
- *                      <phys-encoding-name> [ '#' <maj-min-rel> ]
- *                      [ '<' <fact-params> '>' ]
- */
-rc_t phys_encoding_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, VTypedecl *td, struct SExpression const **expr );
-
-
-/*--------------------------------------------------------------------------
- * schema-eval.c
- */
-
-/* eval-const-expr
- *  tries to evaluate a constant expression against type
- *  returns non-zero error code if failed
- */
-rc_t eval_const_expr ( const VSchema *self, const VTypedecl *td,
-    struct SExpression const *expr, struct SExpression **value );
-
-/* eval-uint-expr
- *  special const expression evaluator for uint32_t
- */
-rc_t eval_uint_expr ( const VSchema *self,
-    struct SExpression const *expr, uint32_t *value );
-
-/* eval-uint64-expr
- *  special const expression evaluator for uint64_t
- */
-rc_t eval_uint64_expr ( const VSchema *self,
-    struct SExpression const *expr, uint64_t *value );
-
-/* eval-expr-syntax
- *  examine expression syntax
- *  fixes forward references
- */
-rc_t eval_expr_syntax ( struct SExpression const *expr );
-
-
-/*--------------------------------------------------------------------------
- * schema-tbl.c
- */
-
-/*
- * physical-name      = '.' ID
- */
-void physical_name ( const KSymTable *tbl,
-    KTokenSource *src, KToken *t, const SchemaEnv *env );
-
-/*
- * push-tbl-scope
- * pop-tbl-scope
- */
-rc_t push_tbl_scope ( KSymTable *tbl, struct STable const *table );
-void pop_tbl_scope ( KSymTable *tbl, struct STable const *table );
-
-/*
- * init-tbl-symtab
- *  initializes "tbl"
- *  places table in scope
- *  must be balanced by KSymTableWhack
- */
-rc_t init_tbl_symtab ( KSymTable *tbl, const VSchema *schema, struct STable const *table );
-
-/*
- * table-decl         = 'table' <fqn> <table-def>
- * table-def          = [ <table-dad> ] <table-body>
- *                    | <table-dad> ';'
- *
- * table-dad          = '=' <table-name>
- *
- * table-body         = '{' [ <table-decl-list> ] '}'
- * table-decl-list    = <tbl-local-decl> ';' [ <table-decl-list> ]
- */
-rc_t table_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-
-/*--------------------------------------------------------------------------
- * schema-db.c
- */
-
-/*
- * push-db-scope
- * pop-db-scope
- */
-rc_t push_db_scope ( KSymTable *tbl, struct SDatabase const *db );
-void pop_db_scope ( KSymTable *tbl, struct SDatabase const *db );
-
-/*
- * init-db-symtab
- *  initializes "tbl"
- *  places db in scope
- *  must be balanced by KSymTableWhack
- */
-rc_t init_db_symtab ( KSymTable *tbl, const VSchema *schema, struct SDatabase const *db );
-
-/*
- * database-decl      = 'database' <fqn> <database-def>
- * database-def       = [ <database-dad> ] <database-body>
- *                    | <database-dad> ';'
- *
- * database-dad       = '=' <database-name>
- *
- * database-body      = '{' [ <db-decl-list> ] '}'
- * db-decl-list       = <database-decl>
- *                    | <table-decl>
- */
-rc_t database_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_schema_int_ */
diff --git a/libs/vdb/schema-priv.h b/libs/vdb/schema-priv.h
deleted file mode 100644
index dab6a6c..0000000
--- a/libs/vdb/schema-priv.h
+++ /dev/null
@@ -1,1308 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_schema_priv_
-#define _h_schema_priv_
-
-#ifndef _h_vdb_schema_
-#include <vdb/schema.h>
-#endif
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SLVL - schema development level
- *  used to bring schema together in an orderly fashion
- *
- *  level 0: include, fmtdef, alias
- *
- *  level 1: version, typedef, dim, typeset
- *           const-expr, type-expr
- *           eval-uint-expr, eval-type-expr
- *
- *  level 2: const, eval-const-expr
- *
- *  level 3: function, schema-param-decl, fact-param-decl, func-param-decl
- *           indirect-type-expr, indirect-const-expr, prod-expr
- *
- *  level 4: script, return-stmt, prod-stmt
- *           cond-expr, cast-expr, func-expr, name-expr
- *
- *  level 5: physical
- *
- *  level 6: database, table
- *
- *  level 7: physical members
- *
- *  level 8: columns
- */
-#ifndef SLVL
-#define SLVL 8
-#endif
-
-
-/*--------------------------------------------------------------------------
- * EXAMINE_SCHEMA_CONTENTS
- *  debugging setting for examining contents and detecting inconsistencies
- */
-#ifndef EXAMINE_SCHEMA_CONTENTS
-#if _DEBUGGING
-#define EXAMINE_SCHEMA_CONTENTS 0
-#else
-#define EXAMINE_SCHEMA_CONTENTS 0
-#endif
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct String;
-struct KSymbol;
-struct KTokenText;
-struct KMDataNode;
-struct SFunction;
-struct SDatabase;
-struct VDBManager;
-struct SExpression;
-struct SDumper;
-
-
-/*--------------------------------------------------------------------------
- * VCtxId
- *  id within a context
- *  made to be compatible with KSymbol.u.fwd
- */
-typedef struct VCtxId VCtxId;
-struct VCtxId
-{
-    uint32_t ctx;
-    uint32_t id;
-};
-
-/* Cmp
- */
-#define VCtxIdCmp( a, b ) \
-    ( ( ( a ) -> ctx != ( b ) -> ctx ) ? \
-      ( int ) ( a ) -> ctx - ( int ) ( b ) -> ctx : \
-      ( int ) ( a ) -> id - ( int ) ( b ) -> id )
-
-
-/*--------------------------------------------------------------------------
- * KSymbol
- */
-
-/* Copy
- *  deep copy a single symbol
- */
-rc_t KSymbolCopy ( BSTree *scope,
-    struct KSymbol **cp, struct KSymbol const *orig );
-
-/* CopyScope
- *  deep copy all symbols within a scope
- */
-bool CC KSymbolCopyScope ( BSTNode *sym, void *scope );
-
-
-/* ExamineContents
- *  not much to be done here
- */
-#if EXAMINE_SCHEMA_CONTENTS >= 1
-bool KSymbolExamineContents ( BSTNode *sym, void *rc );
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- */
-
-/* FillSchema
- *  a schema buffer fill function that reads from KMDataNode
- *
- * NB - preset "add_v0" to false for normal operation, "true"
- *  if the buffer should be prefixed with "version 0;" on first read
- */
-typedef struct KMDataNodeSchemaFillData KMDataNodeSchemaFillData;
-struct KMDataNodeSchemaFillData
-{
-    struct KMDataNode const *node;
-    size_t pos;
-    char buff [ 64 * 1024 - 1 ];
-    bool add_v0;
-};
-
-rc_t CC KMDataNodeFillSchema ( void *data, struct KTokenText *tt, size_t save );
-
-
-/*--------------------------------------------------------------------------
- * VTypedecl
- * VFormatdecl
- */
-
-/* CommonAncestor
- *  find a common ancestor between "self" and "peer"
- *  returns distance as sum of distances from each to "ancestor"
- */
-bool VFormatdeclCommonAncestor ( const VFormatdecl *self, const VSchema *schema,
-    const VFormatdecl *peer, VFormatdecl *ancestor, uint32_t distances [ 2 ] );
-
-
-/*--------------------------------------------------------------------------
- * SNameOverload
- *  describes an overloaded name
- *  used to implement versioning 
- */
-typedef struct SNameOverload SNameOverload;
-struct SNameOverload
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* overloaded items */
-    Vector items;
-
-    /* contextual id */
-    VCtxId cid;
-};
-
-/* Make
- */
-rc_t SNameOverloadMake ( SNameOverload **name,
-    struct KSymbol const *sym, uint32_t start, uint32_t len );
-
-/* Copy
- */
-rc_t SNameOverloadCopy ( BSTree *scope,
-    SNameOverload **cp, const SNameOverload *orig );
-rc_t SNameOverloadVectorCopy ( BSTree *scope,
-    const Vector *src, Vector *dest );
-
-/* Whack
- */
-void CC SNameOverloadWhack ( void *self, void *ignore );
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- *  a symbol scope
- *  data types, blob formats, function and sub-schema declarations
- *  database and table declarations
- */
-struct VSchema
-{
-    /* parent schema */
-    const VSchema *dad;
-
-    /* global scope for this schema */
-    BSTree scope;
-
-    /* paths of opened files */
-    BSTree paths;
-
-    /* include path - vector of KDirectory references
-       ordered by precedence */
-    Vector inc;
-
-    /* alias names - owned by scope, but recorded for dumping */
-    Vector alias;
-
-    /* formats - ids start at 1, where 0 is reserved for NULL */
-    Vector fmt;
-
-    /* datatypes - ids start at 0, which is reserved for 'any' */
-    Vector dt;
-
-    /* typesets - ids start at 0x40000000 */
-    Vector ts;
-
-    /* parameterized types, declared within function
-       signatures and defined within expressions
-       ids start at 0x80000001, where 0x80000000
-       is reserved for 'undefined' */
-    Vector pt;
-
-    /* symbolic constants */
-    Vector cnst;
-
-    /* extern and schema functions */
-    Vector func;
-    Vector fname;
-
-    /* physical columns */
-    Vector phys;
-    Vector pname;
-
-    /* tables */
-    Vector tbl;
-    Vector tname;
-
-    /* databases */
-    Vector db;
-    Vector dname;
-
-    KRefcount refcount;
-
-    uint32_t file_count;
-};
-
-
-/* Make
- *  creates an empty schema
- */
-rc_t VSchemaMake ( VSchema **sp, const VSchema *dad );
-
-
-/* MakeIntrinsic
- *  creates an initial, intrinsic schema
- */
-rc_t VSchemaMakeIntrinsic ( VSchema **intrinsic );
-
-
-/* Attach
- * Sever
- */
-VSchema *VSchemaAttach ( const VSchema *self );
-rc_t VSchemaSever ( const VSchema *self );
-
-
-/* ParseTextCallback
- *  parse schema text
- *  add productions to existing schema
- *
- *  "name" [ IN, NULL OKAY ] - optional name
- *  representing text, e.g. filename
- *
- *  "fill" [ IN ] and "data" [ IN, OPAQUE ] - for filling buffer
- */
-rc_t VSchemaParseTextCallback ( VSchema *self, const char *name,
-    rc_t ( CC * fill ) ( void *self, struct KTokenText *tt, size_t save ),
-    void *data );
-
-/* Find
- *  generic object find within schema global scope
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  "dflt" [ IN ] - if true, resolve default value
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *VSchemaFind ( const VSchema *self,
-    const SNameOverload **name, uint32_t *type,
-    const char *expr, const char *ctx, bool dflt );
-
-
-/* CacheIntrinsicTypeId
- *  for id-caching
- *
- *  reads id atomically from "cache" and returns if non-zero
- *
- *  otherwise retrieves type id by name lookup, and sets
- *  value atomically in "cache" before returning.
- */
-uint32_t VSchemaCacheIntrinsicTypeId ( const VSchema *self,
-    atomic32_t *cache, const char *typename );
-
-
-/* Marking
- */
-void VSchemaClearMark ( const VSchema *self );
-void VSchemaClearPhysMark ( const VSchema *self );
-void VSchemaTypeMark ( const VSchema *self, uint32_t type_id );
-
-
-/* ToText
- *  converts some object to textual representation
- */
-rc_t VSchemaToText ( struct VSchema const *self,
-    char *buff, size_t bsize, size_t *num_writ, const char *fmt, ... );
-
-#if _DEBUGGING
-/* ListSymtab
- *  lists contents of symbol table
- */
-void VSchemaListSymtab ( struct VSchema const *self );
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SFormat
- *  describes a blob format
- */
-typedef struct SFormat SFormat;
-struct SFormat
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* superfmt - i.e. current fmt extends superfmt
-       implying that super can be decoded by current */
-    const SFormat *super;
-
-    /* format id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-};
-
-/* Whack
- */
-#define SFormatWhack VectMbrWhack
-
-/* Find
- */
-SFormat *VSchemaFindFmtid ( const VSchema *self, uint32_t id );
-
-/* Mark
- */
-void CC SFormatClearMark ( void *item, void *ignore );
-void SFormatMark ( const SFormat *self );
-
-/* Dump
- *  dump "fmtdef", dump object
- */
-bool CC SFormatDefDump ( void *item, void *dumper );
-rc_t SFormatDump ( const SFormat *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SDatatype
- *  describes a registered datatype
- */
-enum
-{
-    /* these have been exported to <vdb/schema.h> */
-    ddBool = vtdBool,
-    ddUint = vtdUint,
-    ddInt = vtdInt,
-    ddFloat = vtdFloat,
-    ddAscii = vtdAscii,
-    ddUnicode = vtdUnicode
-};
-
-typedef struct SDatatype SDatatype;
-struct SDatatype
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* supertype */
-    const SDatatype *super;
-
-    /* special byte-swap function */
-    void ( * byte_swap ) ( void *dst, const void *src, uint64_t count );
-
-    /* type id */
-    uint32_t id;
-
-    /* number of parent elements, from declaration:
-       typedef super [ dim ] name; */
-    uint32_t dim;
-
-    /* element size, calculated as
-       super -> size * dim */
-    uint32_t size;
-
-    /* data domain */
-    uint16_t domain;
-
-    /* marking */
-    bool marked;
-};
-
-/* Whack
- */
-#define SDatatypeWhack VectMbrWhack
-
-/* IntrinsicDim
- */
-uint32_t SDatatypeIntrinsicDim ( const SDatatype *self );
-
-/* Find
- */
-SDatatype *VSchemaFindTypeid ( const VSchema *self, uint32_t id );
-
-/* Mark
- */
-void CC SDatatypeClearMark ( void *item, void *ignore );
-void SDatatypeMark ( const SDatatype *self );
-
-/* Dump
- */
-bool CC SDatatypeDefDump ( void *item, void *dumper );
-rc_t SDatatypeDump ( const SDatatype *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * STypeset
- *  describes a set of typedecls
- */
-typedef struct STypeset STypeset;
-struct STypeset
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* typeset id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-
-    /* fmtdecls */
-    uint16_t count;
-    VTypedecl td [ 1 ];
-};
-
-/* Whack
- */
-#define STypesetWhack VectMbrWhack
-
-/* Find
- */
-STypeset *VSchemaFindTypesetid ( const VSchema *self, uint32_t id );
-
-/* Mark
- */
-void CC STypesetClearMark ( void *item, void *ignore );
-void STypesetMark ( const STypeset *self, const VSchema *schema );
-
-/* Dump
- */
-bool CC STypesetDefDump ( void *item, void *dumper );
-rc_t STypesetDump ( const STypeset *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SIndirectType
- *  a parameterized typespec
- */
-typedef struct SIndirectType SIndirectType;
-struct SIndirectType
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* MUTABLE substitution typedecl
-       expression. may use indirect types */
-    struct SExpression const *type;
-
-    /* formal type id */
-    uint32_t id;
-
-    /* parameter position */
-    uint32_t pos;
-};
-
-/* Whack
- */
-void CC SIndirectTypeWhack ( void *item, void *ignore );
-
-/* Find
- */
-SIndirectType *VSchemaFindITypeid ( const VSchema *self, uint32_t id );
-
-/* Mark
- */
-void CC SIndirectTypeMark ( void * item, void * data );
-
-/* Dump
- */
-rc_t SIndirectTypeDump ( const SIndirectType *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SConstant
- *  describes a symbolic constant
- */
-typedef struct SConstant SConstant;
-struct SConstant
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* value */
-    struct SExpression const *expr;
-
-    /* type */
-    VTypedecl td;
-
-    /* id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-};
-
-/* Whack
- */
-void CC SConstantWhack ( void *item, void *ignore );
-
-/* Mark
- */
-void CC SConstantClearMark ( void *item, void *ignore );
-void SConstantMark ( const SConstant *self );
-
-/* Dump
- *  dump "const", dump object
- */
-bool CC SConstantDefDump ( void *item, void *dumper );
-rc_t SConstantDump ( const SConstant *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SIndirectConst
- *  a parameterized constant
- */
-typedef struct SIndirectConst SIndirectConst;
-struct SIndirectConst
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* MUTABLE constant value or function */
-    struct SExpression const *expr;
-    struct SFunction const *func;
-
-    /* formal typedecl or NULL if function */
-    struct SExpression const *td;
-
-    /* formal type id */
-    uint32_t id;
-};
-
-/* Whack
- */
-void CC SIndirectConstWhack ( void * item, void * ignore );
-
-/* Mark
- */
-void CC SIndirectConstMark ( void * item, void * data );
-
-/* Dump
- *  dump "const", dump object
- */
-bool CC SIndirectConstDefDump ( void *item, void *dumper );
-rc_t SIndirectConstDump ( const SIndirectConst *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SProduction
- *  a named production
- */
-typedef struct SProduction SProduction;
-struct SProduction
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* conditional expression */
-    struct SExpression const *expr;
-
-    /* formal fmtdecl */
-    struct SExpression const *fd;
-
-    /* contextual id */
-    VCtxId cid;
-
-    /* trigger production */
-    bool trigger;
-
-    /* control parameter */
-    bool control;
-};
-
-/* Whack
- */
-void CC SProductionWhack ( void * item, void * ignore );
-
-/* Mark
- */
-void CC SProductionMark ( void * itme, void * data );
-
-/* Dump
- *  dump production
- */
-bool CC SProductionDefDump ( void *item, void *dumper );
-rc_t SProductionDump ( const SProduction *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SFormParmlist
- *  zero or more formal parameters
- */
-typedef struct SFormParmlist SFormParmlist;
-struct SFormParmlist
-{
-    Vector parms;
-    uint16_t mand;
-    uint16_t vararg;
-};
-
-/* Whack
- */
-void SFormParmlistWhack ( SFormParmlist *self,
-    void ( CC * pwhack ) ( void*, void* ) );
-
-/* HasParams
- */
-#define SFormParmlistHasParams( self ) \
-    ( VectorLength ( & ( self ) -> parms ) != 0 || \
-      ( self ) -> varag != 0 )
-
-/* Mark
- */
-void SFormParmlistMark ( const SFormParmlist *self,
-    void ( CC * mark ) ( void*, void* ), const VSchema *schema );
-
-/* Dump
- *  dump param list
- */
-rc_t SFormParamlistDump ( const SFormParmlist *self, struct SDumper *d,
-    bool ( CC * dump ) ( void*, void* ),
-    const char *begin, const char *end, const char *empty );
-
-
-/*--------------------------------------------------------------------------
- * SFunction
- */
-typedef struct SFunction SFunction;
-struct SFunction
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* return type expression - NULL for untyped or row-length */
-    struct SExpression const *rt;
-
-    /* pointer to additional information */
-    union
-    {
-        struct
-        {
-            /* optional factory id */
-            struct KSymbol const *fact;
-
-        } ext;
-
-        struct
-        {
-            /* return statement conditional expression */
-            struct SExpression const *rtn;
-
-            /* schema productions */
-            Vector prod;
-
-            uint32_t align;
-
-        } script;
-
-    } u;
-
-    /* schema scope - i.e. indirect types and uint const */
-    BSTree sscope;
-
-    /* function scope - i.e. factory and func params, productions */
-    BSTree fscope;
-
-    /* factory parameters */
-    SFormParmlist fact;
-
-    /* function parameters */
-    SFormParmlist func;
-
-    /* schema types - indirect types, defined and owned by VSchema
-       held here for positional correlation */
-    Vector type;
-
-    /* declared version */
-    uint32_t version;
-
-    /* schema parameters - indirect uint constants */
-    Vector schem;
-
-    /* function id */
-    uint32_t id;
-
-    /* script or extern function */
-    bool script;
-
-    /* marking */
-    bool marked;
-
-    /* validate, untyped or row-length function */
-    bool validate;
-    bool untyped;
-    bool row_length;
-};
-
-/* Whack
- */
-void SFunctionDestroy ( SFunction *self );
-void CC SFunctionWhack ( void *self, void *ignore );
-
-/* Cmp
- * Sort
- */
-int CC SFunctionCmp ( const void *item, const void *n );
-int CC SFunctionSort ( const void *item, const void *n );
-
-/* Bind
- *  perform schema and factory param substitution
- *  returns prior param values
- */
-rc_t SFunctionBindSchemaParms ( const SFunction *self,
-    Vector *prior, const Vector *subst );
-rc_t SFunctionBindFactParms ( const SFunction *self,
-    Vector *prior, const Vector *subst );
-
-/* Rest-ore
- *  restore schema and factory param substitution
- *  destroys prior param vector
- */
-void SFunctionRestSchemaParms ( const SFunction *self, Vector *prior );
-void SFunctionRestFactParms ( const SFunction *self, Vector *prior );
-
-/* Mark
- */
-void CC SFunctionClearMark ( void * self, void * ignore );
-void CC SFunctionMark ( void * item, void * data );
-void SFuncNameMark ( const SNameOverload *self, const VSchema *schema );
-
-/* Dump
- */
-rc_t SFunctionDeclDumpSchemaParms ( const SFunction *self, struct SDumper *d );
-rc_t SFunctionDeclDumpFactParms ( const SFunction *self, struct SDumper *d );
-bool CC SFunctionDeclDump ( void *item, void *dumper );
-rc_t SFunctionBodyDump ( const SFunction *self, struct SDumper *d );
-rc_t SFunctionDump ( const SFunction *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SPhysical
- *  physical column declaration
- */
-typedef struct SPhysical SPhysical;
-struct SPhysical
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* optional function for determining row length */
-    const SFunction *row_length;
-
-    /* encoding scripts */
-    SFunction encode, decode;
-
-    /* column type */
-    struct SExpression const *td;
-
-    /* required version */
-    uint32_t version;
-
-    /* physical decl id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-
-    /* if only decode side exists */
-    bool read_only;
-
-    /* v0 blobs have no headers */
-    bool no_hdr;
-};
-
-/* Whack
- */
-void CC SPhysicalWhack ( void *self, void *ignore );
-
-/* Cmp
- * Sort
- */
-int CC SPhysicalCmp ( const void *item, const void *n );
-int CC SPhysicalSort ( const void *item, const void *n );
-
-/* Bind
- *  perform schema and factory param substitution
- *  returns prior param values
- */
-rc_t SPhysicalBindSchemaParms ( const SPhysical *self,
-    Vector *prior, const Vector *subst );
-rc_t SPhysicalBindFactParms ( const SPhysical *self,
-    Vector *prior, const Vector *subst );
-
-/* Rest-ore
- *  restore schema and factory param substitution
- *  destroys prior param vector
- */
-void SPhysicalRestSchemaParms ( const SPhysical *self, Vector *prior );
-void SPhysicalRestFactParms ( const SPhysical *self, Vector *prior );
-
-/* Mark
- */
-void CC SPhysicalClearMark ( void * self, void * ignore );
-void CC SPhysicalMark ( void * item, void * data );
-void SPhysNameMark ( const SNameOverload *self, const VSchema *schema );
-
-/* Dump
- */
-bool CC SPhysicalDefDump ( void *self, void *data );
-rc_t SPhysicalDump ( const SPhysical *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * STable
- *  table declaration
- */
-typedef struct STable STable;
-struct STable
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* optional function for determining table type */
-    const SFunction *untyped;
-
-    /* optional expression for limiting all columns' blob sizes */
-    struct SExpression const *limit;
-
-    /* optional default view declaration */
-    const String *dflt_view;
-
-    /* scope */
-    BSTree scope;
-
-    /* parents */
-    Vector parents;
-
-    /* overrides ( inherited virtual productions )
-       contents are grouped by introducing parent */
-    Vector overrides;
-
-    /* columns */
-    Vector col;
-    Vector cname;
-
-    /* explicitly declared physical column members */
-    Vector phys;
-
-    /* assignment statements */
-    Vector prod;
-
-    /* introduced virtual ( undefined ) productions
-       contents are unowned KSymbol pointers */
-    Vector vprods;
-
-    /* owned KSymbols that are not in scope */
-    Vector syms;
-
-    /* source file & line */
-    String src_file;
-    uint32_t src_line;
-
-    /* required version */
-    uint32_t version;
-
-    /* table id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-};
-
-/* Whack
- */
-void CC STableWhack ( void *self, void *ignore );
-
-/* CloneExtend
- *  creates an initially transparent table extension
- *  used by cursor to permit addition of implicit productions
- */
-rc_t STableCloneExtend ( const STable *self, STable **clone, VSchema *schema );
-
-/* Cmp
- * Sort
- */
-int CC STableCmp ( const void *item, const void *n );
-int CC STableSort ( const void *item, const void *n );
-
-/* Find
- *  generic object find within table scope
- *
- *  "td" [ OUT, NULL OKAY ] - returns cast type expression
- *  if given or "any" if not
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  "dflt" [ IN ] - if true, resolve default value
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *STableFind ( const STable *self,
-    const VSchema *schema, VTypedecl *td, const SNameOverload **name,
-    uint32_t *type, const char *expr, const char *ctx, bool dflt );
-
-
-/* FindOverride
- *  finds an inherited or introduced overridden symbol
- */
-struct KSymbol *STableFindOverride ( const STable *self, const VCtxId *cid );
-
-/* FindOrdAncestor
- *  finds a parent or grandparent by order
- */
-const STable *STableFindOrdAncestor ( const STable *self, uint32_t i );
-
-/* Mark
- */
-void CC STableClearMark ( void *self, void *ignore );
-/*
-void CC STableMark ( const STable *self, const VSchema *schema );
-*/
-void STableNameMark ( const SNameOverload *self, const VSchema *schema );
-
-/* Dump
- *  dump "table" { }
- */
-bool CC STableDefDump ( void *self, void *dumper );
-rc_t STableDump ( const STable *self, struct SDumper *d );
-
-rc_t VSchemaDumpTableName ( const VSchema *self, uint32_t mode, const STable *stbl,
-    rc_t ( CC * flush ) ( void *dst, const void *buffer, size_t bsize ), void *dst );
-rc_t VSchemaDumpTableDecl ( const VSchema *self, uint32_t mode, const STable *stbl,
-    rc_t ( CC * flush ) ( void *dst, const void *buffer, size_t bsize ), void *dst );
-
-
-/*--------------------------------------------------------------------------
- * SColumn
- *  column declaration
- */
-typedef struct SColumn SColumn;
-struct SColumn
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* read productions */
-    struct SExpression const *read;
-
-    /* validation productions */
-    struct SExpression const *validate;
-
-    /* page size limit */
-    struct SExpression const *limit;
-
-    /* physical type expression */
-    struct SExpression const *ptype;
-
-    /* typedecl */
-    VTypedecl td;
-
-    /* contextual id */
-    VCtxId cid;
-
-    /* if true, this column is default for name */
-    bool dflt;
-
-    /* if read-only, there must be a read expression */
-    bool read_only;
-
-    /* if no read or validate expression exists
-       and no corresponding physical member exists */
-    bool simple;
-};
-
-/* Whack
- */
-void CC SColumnWhack ( void *item, void *ignore );
-
-/* Cmp
- *  compare a const VTypedecl* against const SColumn*
- * Sort
- *  compare two const SColumn*
- */
-int CC SColumnCmp ( const void *item, const void *n );
-int CC SColumnSort ( const void *item, const void *n );
-
-
-/* ImplicitColMember
- *  adds an implicit column member of simple or incomplete type
- *
- *  "cname" [ IN ] - column name
- *
- *  "pname" [ IN ] - name of physical column
- */
-rc_t STableImplicitColMember ( STable *self,
-    struct String const *cname, struct String const *pname );
-
-/* Dump
- */
-bool CC SColumnDefDump ( void *item, void *dumper );
-rc_t SColumnDump ( const SColumn *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SPhysMember
- *  physical member
- */
-typedef struct SPhysMember SPhysMember;
-struct SPhysMember
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* column type expression */
-    struct SExpression const *type;
-
-    /* assignment expression */
-    struct SExpression const *expr;
-
-    /* column datatype */
-    VTypedecl td;
-
-    /* contextual id */
-    VCtxId cid;
-
-    /* if static, it is implemented in table metadata */
-    bool stat;
-
-    /* it simple, the member was implicitly declared */
-    bool simple;
-};
-
-/* Whack
- */
-void CC SPhysMemberWhack ( void *item, void *ignore );
-
-/* ImplicitPhysMember
- *  adds an implicit physical member of simple or incomplete type
- *
- *  "td" [ IN, NULL OKAY ] - type of member, if known
- *
- *  "sym" [ IN, NULL OKAY ] - optional symbol to be overridden
- *
- *  "name" [ IN ] - name of new symbol to be created if "sym" is NULL
- */
-rc_t STableImplicitPhysMember ( STable *self, const VTypedecl *td,
-    struct KSymbol *sym, struct String const *name );
-
-/* Mark
- */
-/*
-void CC SPhysMemberMark ( const SPhysMember *self, const VSchema *schema );
-*/
-
-/* Dump
- */
-bool CC SPhysMemberDefDump ( void *item, void *dumper );
-rc_t SPhysMemberDump ( const SPhysMember *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SDatabase
- *  database declaration
- */
-typedef struct SDatabase SDatabase;
-struct SDatabase
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* scope */
-    BSTree scope;
-
-    /* parents */
-    const SDatabase *dad;
-
-    /* databases */
-    Vector db;
-
-    /* tables */
-    Vector tbl;
-
-    /* required version */
-    uint32_t version;
-
-    /* database id */
-    uint32_t id;
-
-    /* marking */
-    bool marked;
-};
-
-/* Whack
- */
-void CC SDatabaseWhack ( void *self, void *ignore );
-
-/* Cmp
- * Sort
- */
-int CC SDatabaseCmp ( const void *item, const void *n );
-int CC SDatabaseSort ( const void *item, const void *n );
-
-/* Find
- *  generic object find within database scope
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *SDatabaseFind ( const SDatabase *self,
-    const VSchema *schema, const SNameOverload **name,
-    uint32_t *type, const char *expr, const char *ctx );
-
-/* Mark
- */
-void CC SDatabaseClearMark ( void *self, void *ignore );
-void CC SDatabaseMark ( void * item, void * data );
-void CC SDatabaseNameMark ( const SNameOverload *self, const VSchema *schema );
-
-/* Dump
- *  dump "database" { }
- */
-bool CC SDatabaseDefDump ( void *self, void *dumper );
-rc_t SDatabaseDump ( const SDatabase *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * STblMember
- *  table member
- */
-typedef struct STblMember STblMember;
-struct STblMember
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* table declaration */
-    const STable *tbl;
-
-    /* contextual id */
-    VCtxId cid;
-
-    /* is a template */
-    bool tmpl;
-};
-
-/* Whack
- */
-#define STblMemberWhack VectMbrWhack
-
-void CC STableMark ( void * item, void * data );
-
-/* Dump
- */
-bool CC STblMemberDefDump ( void *item, void *dumper );
-rc_t STblMemberDump ( const STblMember *self, struct SDumper *d );
-
-
-/*--------------------------------------------------------------------------
- * SDBMember
- *  sub-db member
- */
-typedef struct SDBMember SDBMember;
-struct SDBMember
-{
-    /* symbolic name */
-    struct KSymbol const *name;
-
-    /* database declaration */
-    const SDatabase *db;
-
-    /* contextual id */
-    VCtxId cid;
-
-    /* is a template */
-    bool tmpl;
-};
-
-/* Whack
- */
-#define SDBMemberWhack VectMbrWhack
-
-/* Dump
- */
-bool CC SDBMemberDefDump ( void *item, void *dumper );
-rc_t SDBMemberDump ( const SDBMember *self, struct SDumper *d );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_schema_priv_ */
diff --git a/libs/vdb/schema-prod.c b/libs/vdb/schema-prod.c
deleted file mode 100644
index ef507b1..0000000
--- a/libs/vdb/schema-prod.c
+++ /dev/null
@@ -1,1004 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "schema-dump.h"
-
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SProduction
- *  describes a schema production/statement
- */
-#if SLVL >= 3
-
-/* Whack
- */
-void CC SProductionWhack ( void *item, void *ignore )
-{
-    SProduction *s = item;
-    SExpressionWhack ( s -> expr );
-    SExpressionWhack ( s -> fd );
-    free ( s );
-}
-
-/* Mark
- */
-void CC SProductionMark ( void * item, void * data )
-{
-    const SProduction * self = item;
-    if ( self != NULL )
-    {
-        SExpressionMark ( ( void * )self -> fd, data );
-        SExpressionMark ( ( void * )self -> expr, data );
-    }
-}
-
-/* Dump
- *  dump production
- */
-rc_t SProductionDump ( const SProduction *self, struct SDumper *d )
-{
-    if ( self == NULL )
-        return KSymbolDump ( NULL, d );
-    if ( ! self -> control )
-        return KSymbolDump ( self -> name, d );
-    return SDumperPrint ( d, "control %N", self -> name );
-}
-
-bool CC SProductionDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SProduction *self = ( const void* ) item;
-
-    /* function params are waiting for an expression */
-    if ( self -> expr == NULL )
-        b -> rc = SDumperPrint ( b, "%E %N", self -> fd, self -> name );
-    else
-    {
-        bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-        if ( self -> trigger )
-        {
-            b -> rc = SDumperPrint ( b, compact ? "trigger %N=%E;" : "\ttrigger %N = %E;\n"
-                                     , self -> name
-                                     , self -> expr );
-        }
-        else
-        {
-            b -> rc = SDumperPrint ( b, compact ? "%E %N=%E;" : "\t%E %N = %E;\n"
-                                     , self -> fd
-                                     , self -> name
-                                     , self -> expr );
-        }
-    }
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SFunction
- *  describes a schema function
- */
-#if SLVL >= 4
-
-/* Dump
- */
-rc_t SFunctionBodyDump ( const SFunction *self, SDumper *b )
-{
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( VectorLength ( & self -> u . script . prod ) == 0 )
-    {
-        b -> rc = SDumperPrint ( b, compact ?
-            "{return %E;}" : "\t{ return %E; }\n",
-            self -> u . script . rtn );
-    }
-    else
-    {
-        b -> rc = SDumperPrint ( b, compact ? "{" : "\t{\n" );
-        if ( b -> rc == 0 )
-        {
-            if ( ! compact )
-                SDumperIncIndentLevel ( b );
-            if ( ! VectorDoUntil ( & self -> u . script . prod, false, SProductionDefDump, b ) )
-                b -> rc = SDumperPrint ( b, compact ? "return %E;" : "\treturn %E;\n", self -> u . script . rtn );
-            if ( ! compact )
-                SDumperDecIndentLevel ( b );
-        }
-        if ( b -> rc == 0 )
-            b -> rc = SDumperPrint ( b, compact ? "}" : "\t}\n" );
-    }
-
-    return b -> rc;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * SPhysical
- */
-
-#if SLVL >= 5
-
-/* Whack
- */
-void CC SPhysicalWhack ( void *n, void *ignore )
-{
-    SPhysical *self = n;
-
-    /* if any schema or factory parameters were given, the objects
-       have been shared between encode and decode schema funcs, and
-       the schema names are also shared between funcs. wipe out the
-       encode copy and leave ownership with decode */
-    BSTreeInit ( & self -> encode . sscope );
-    VectorInit ( & self -> encode . fact . parms, 0, 1 );
-    VectorInit ( & self -> encode . type, 0, 1 );
-    VectorInit ( & self -> encode . schem, 0, 1 );
-
-    /* now allow normal destruction to proceed */
-    SFunctionDestroy ( & self -> encode );
-    SFunctionDestroy ( & self -> decode );
-    SExpressionWhack ( self -> td );
-
-    free ( self );
-}
-
-/* Cmp
- * Sort
- */
-int CC SPhysicalCmp ( const void *item, const void *n )
-{
-    const uint32_t *a = item;
-    const SPhysical *b = n;
-
-    if ( * a > b -> version )
-        return 1;
-    return ( int ) ( * a >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-int CC SPhysicalSort ( const void *item, const void *n )
-{
-    const SPhysical *a = item;
-    const SPhysical *b = n;
-
-    return ( int ) ( a -> version >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-/* Bind
- *  perform schema and factory param substitution
- *  returns prior param values
- */
-rc_t SPhysicalBindSchemaParms ( const SPhysical *self,
-    Vector *prior, const Vector *subst )
-{
-    return SFunctionBindSchemaParms ( & self -> decode, prior, subst );
-}
-
-rc_t SPhysicalBindFactParms ( const SPhysical *self,
-    Vector *prior, const Vector *subst )
-{
-    return SFunctionBindFactParms ( & self -> decode, prior, subst );
-}
-
-/* Rest-ore
- *  restore schema and factory param substitution
- *  destroys prior param vector
- */
-void SPhysicalRestSchemaParms ( const SPhysical *self, Vector *prior )
-{
-    SFunctionRestSchemaParms ( & self -> decode, prior );
-}
-
-void SPhysicalRestFactParms ( const SPhysical *self, Vector *prior )
-{
-    SFunctionRestFactParms ( & self -> decode, prior );
-}
-
-/* Mark
- */
-void CC SPhysicalClearMark ( void *item, void *ignore )
-{
-    SPhysical *self = item;
-    self -> marked = false;
-    self -> encode . marked = false;
-    self -> decode . marked = false;
-}
-
-void VSchemaClearPhysMark ( const VSchema *self )
-{
-    if ( self -> dad != NULL )
-        VSchemaClearPhysMark ( self -> dad );
-    VectorForEach ( & self -> phys, false, SPhysicalClearMark, NULL );
-}
-
-void CC SPhysicalMark ( void * item, void * data )
-{
-    SPhysical *self = item;
-    if ( self != NULL && ! self -> marked )
-    {
-        self -> marked = true;
-        SExpressionMark ( ( void * )self -> td, data );
-        SFunctionMark ( ( void * )& self -> encode, data );
-        SFunctionMark ( ( void * )& self -> decode, data );
-    }
-}
-
-void SPhysNameMark ( const SNameOverload *self, const VSchema *schema )
-{
-    if ( self != NULL )
-    {
-        VectorForEach ( & self -> items, false, SPhysicalMark, ( void* ) schema );
-    }
-}
-
-/* Dump
- */
-rc_t SPhysicalDump ( const SPhysical *self, SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-bool CC SPhysicalDefDump ( void *n, void *data )
-{
-    SDumper *b = data;
-    const SPhysical *self = ( const void* ) n;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    /* a physical column */
-    b -> rc = SDumperPrint ( b, "physical " );
-
-    /* could have schema parameters */
-    if ( b -> rc == 0 )
-        b -> rc = SFunctionDeclDumpSchemaParms ( & self -> decode, b );
-
-    /* issue __no_header for v0 encodings */
-    if ( b -> rc == 0 && self -> no_hdr )
-        b -> rc = SDumperPrint ( b, "__no_header " );
-
-    /* a return type expression followed by column typename */
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, "%E %N", self -> td, self -> name );
-
-    /* versions are mandatory */
-    if ( b -> rc == 0 )
-        b -> rc = SDumperVersion ( b, self -> version );
-
-    /* could have factory parameters */
-    if ( b -> rc == 0 )
-        b -> rc = SFunctionDeclDumpFactParms ( & self -> decode, b );
-
-    /* physical body */
-    if ( b -> rc == 0 )
-    {
-        b -> rc = SDumperPrint ( b, compact ? "{" : "\n\t{\n" );
-        if ( b -> rc == 0 )
-        {
-            if ( ! compact )
-                SDumperIncIndentLevel ( b );
-
-            if ( self -> encode . u . script . rtn != NULL )
-            {
-                b -> rc = SDumperPrint ( b, compact ? "encode" : "\tencode\n" );
-                if ( b -> rc == 0 )
-                    b -> rc = SFunctionBodyDump ( & self -> encode, b );
-            }
-            if ( b -> rc == 0 )
-                b -> rc = SDumperPrint ( b, compact ? "decode" : "\tdecode\n" );
-            if ( b -> rc == 0 )
-                b -> rc = SFunctionBodyDump ( & self -> decode, b );
-
-            if ( ! compact )
-                SDumperDecIndentLevel ( b );
-        }
-        if ( b -> rc == 0 )
-            b -> rc = SDumperPrint ( b, compact ? "}" : "\t}\n" );
-    }
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-#if SLVL >= 4
-
-/*
- * production-stmt    = <func-fmtdecl> ID <assign-expr>
- *                    | 'trigger' ID <assign-expr>
- */
-rc_t production_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, Vector *v, uint32_t ptype )
-{
-    rc_t rc;
-    String id;
-    KSymbol *sym;
-
-    SProduction *prod = malloc ( sizeof *prod );
-    if ( prod == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    memset ( prod, 0, sizeof * prod );
-
-    /* look for trigger production */
-    if ( ptype == eTable && t -> id == kw_trigger )
-    {
-        prod -> trigger = true;
-        next_token ( tbl, src, t );
-    }
-    else
-    {
-        KToken t2 = * t;
-
-        /* variable type */
-        rc = type_expr ( tbl, src, t, env, self, & prod -> fd );
-        if ( rc != 0 )
-        {
-            free ( prod );
-            return KTokenExpected ( t, klogErr, "type declaration" );
-        }
-
-        /* disallow formatted types within table */
-        if ( ptype == eTable && ( ( const STypeExpr* ) prod -> fd ) -> fmt != NULL )
-        {
-            SExpressionWhack ( prod -> fd );
-            free ( prod );
-            return KTokenExpected ( & t2, klogErr, "unformatted type declaration" );
-        }
-    }
-
-    /* catch defined identifiers */
-    if ( t -> sym != NULL && t -> id != eForward && t -> id != eVirtual )
-    {
-        /* if this is not a table or the symbol is not a production */
-        if ( ptype != eTable || t -> id != eProduction )
-        {
-            /* re-interpret this token in schema and intrinsic scopes */
-            KTokenSourceReturn ( src, t );
-            next_shallow_token ( tbl, src, t, true );
-        }
-    }
-
-    /* require an identifier or a forward reference */
-    sym = NULL;
-    if ( t -> id == eForward || t -> id == eVirtual )
-        sym = t -> sym;
-    else if ( t -> id != eIdent )
-    {
-        SProductionWhack ( prod, NULL );
-        return KTokenExpected ( t, klogErr, "production name" );
-    }
-
-    /* remember identifier */
-    id = t -> str;
-
-    /* within the production, only '=' is accepted for assignment
-       this could certainly change in the future... */
-    if ( next_token ( tbl, src, t ) -> id != eAssign )
-    {
-        SProductionWhack ( prod, NULL );
-        return KTokenExpected ( t, klogErr, "=" );
-    }
-
-    /* parse conditional expression */
-    rc = cond_expr ( tbl, src, next_token ( tbl, src, t ),
-        env, self, & prod -> expr );
-    if ( rc == 0 )
-    {
-        /* create symbolic name for production and insert */
-        if ( sym == NULL )
-            rc = KSymTableCreateConstSymbol ( tbl, & prod -> name, & id, eProduction, prod );
-        else
-        {
-            /* convert forward reference or virtual to production */
-            sym -> type = eProduction;
-            sym -> u . obj = prod;
-            prod -> name = sym;
-        }
-        if ( rc == 0 )
-        {
-            /* ctx = 0 for params, ctx == 1 for productions */
-            prod -> cid . ctx = 1;
-            rc = VectorAppend ( v, & prod -> cid . id, prod );
-        }
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* cleanup */
-    if ( rc != 0 )
-        SProductionWhack ( prod, NULL );
-
-    return rc;
-}
-
-/*
- * schema-stmt        = 'return' <cond-expr>
- *                    | <production-stmt>
- */
-static
-rc_t script_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *f )
-{
-    rc_t rc;
-
-    if ( t -> id == kw_return )
-    {
-        /* disallow multiple return statements */
-        if ( f -> u . script . rtn != NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        /* just get a conditional expression */
-        rc = cond_expr ( tbl, src, next_token ( tbl, src, t ),
-            env, self, & f -> u . script . rtn );
-    }
-    else
-    {
-        rc = production_stmt ( tbl, src, t, env, self,
-            & f -> u . script . prod, eScriptFunc );
-    }
-
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eSemiColon, ";", true );
-
-    return rc;
-}
-
-
-/*
- * schema-body        = '{' <script-stmts> '}'
- *
- * script-stmts       = <script-stmt> ';' [ <script-stmts> ]
- */
-static
-rc_t schema_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *f )
-{
-    /* always open braces */
-    rc_t rc = expect ( tbl, src, t, eLeftCurly, "{", true );
-    if ( rc != 0 )
-        return rc;
-
-    /* expect at least one statement */
-    rc = script_stmt ( tbl, src, t, env, self, f );
-    if ( rc != 0 )
-        return rc;
-
-    /* handle statement list */
-    while ( t -> id != eRightCurly )
-    {
-        rc = script_stmt ( tbl, src, t, env, self, f );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* must have a return statement */
-    if ( f -> u . script . rtn  == NULL )
-        return KTokenExpected ( t, klogErr, "return statement" );
-
-    /* looks like a script function */
-    f -> script = true;
-
-    /* close braces */
-    return expect ( tbl, src, t, eRightCurly, "}", true );
-}
-
-static
-bool CC script_prod_syntax ( void *item, void *data )
-{
-    rc_t *rc = data;
-    SProduction *prod = item;
-
-    assert ( prod -> name != NULL );
-    assert ( prod -> name -> type == eProduction );
-
-    * rc = eval_expr_syntax ( prod -> fd );
-    if ( * rc == 0 )
-        * rc = eval_expr_syntax ( prod -> expr );
-
-    return ( * rc != 0 ) ? true : false;
-}
-
-static
-bool CC script_sym_syntax ( BSTNode *n, void *data )
-{
-    rc_t *rc = data;
-    KSymbol *sym = ( KSymbol* ) n;
-
-    if ( sym -> type == eForward )
-    {
-        * rc = RC ( rcVDB, rcSchema, rcParsing, rcName, rcUndefined );
-        return true;
-    }
-
-    return false;
-}
-
-static
-rc_t script_syntax ( const VSchema *self, SFunction *f )
-{
-    rc_t rc = eval_expr_syntax ( f -> u . script . rtn );
-    if ( rc == 0 )
-    {
-        BSTreeDoUntil ( & f -> fscope,
-            false, script_sym_syntax, & rc );
-    }
-    if ( rc == 0 )
-        VectorDoUntil ( & f -> u . script . prod, false, script_prod_syntax, & rc );
-    return rc;
-}
-
-/*
- * script-body        = '{' <script-stmts> '}'
- */
-rc_t script_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SFunction *f )
-{
-    /* enter schema scope */
-    rc_t rc = KSymTablePushScope ( tbl, & f -> sscope );
-    if ( rc != 0 )
-        KTokenRCExplain ( t, klogInt, rc );
-    else
-    {
-        /* enter function scope */
-        rc = KSymTablePushScope ( tbl, & f -> fscope );
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-        else
-        {
-            /* parse '{' statements; '}' */
-            VectorInit ( & f -> u . script . prod, 0, 8 );
-            rc = schema_body ( tbl, src, t, env, self, f );
-
-            /* leave function scope */
-            KSymTablePopScope ( tbl );
-        }
-
-        /* leave schema scope */
-        KSymTablePopScope ( tbl );
-    }
-
-    if ( rc == 0 )
-        rc = script_syntax ( self, f );
-
-    return rc;
-}
-
-#endif /* SLVL >= 4 */
-
-#if SLVL >= 5
-
-static
-rc_t rowlen_func_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SPhysical *p )
-{
-    const SNameOverload *name;
-
-    /* expecting a function assignment */
-    rc_t rc = expect ( tbl, src,
-        next_token ( tbl, src, t ), eAssign, "=", true );
-    if ( rc == 0 )
-        rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-    if ( t -> id != eRowLengthFunc )
-        return KTokenExpected ( t, klogErr, "row length function expression" );
-    name = t -> sym -> u . obj;
-
-    rc = expect ( tbl, src,
-        next_token ( tbl, src, t ), eLeftParen, "(", true );
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eRightParen, ")", true );
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eSemiColon, ";", true );
-
-    if ( rc == 0 )
-    {
-        p -> row_length = VectorLast ( & name -> items );
-        if ( p -> row_length == NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcFunction, rcNotFound );
-            KTokenRCExplain ( t, klogErr, rc );
-        }
-    }
-
-    return rc;
-}
-
-/*
- * physical-stmt      = 'encode' <script-body>
- *                    | 'decode' <script-body>
- */
-static
-rc_t physical_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SPhysical *p, bool encoding )
-{
-    rc_t rc;
-    String symstr;
-    SFunction *f = encoding ? & p -> encode : & p -> decode;
-
-    /* simulate a schema function signature */
-    SProduction *parm = malloc ( sizeof * parm );
-    if ( parm == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-    memset ( parm, 0, sizeof * parm );
-    VectorInit ( & f -> func . parms, 0, 1 );
-    rc = VectorAppend ( & f -> func . parms, & parm -> cid . id, parm );
-    if ( rc != 0 )
-    {
-        free ( parm );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* enter schema scope */
-    rc = KSymTablePushScope ( tbl, & f -> sscope );
-    if ( rc != 0 )
-        KTokenRCExplain ( t, klogInt, rc );
-    else
-    {
-        /* enter param scope */
-        rc = KSymTablePushScope ( tbl, & f -> fscope );
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-        else
-        {
-            /* create special input symbol */
-            CONST_STRING ( & symstr, "@" );
-            rc = KSymTableCreateConstSymbol ( tbl, & parm -> name,
-                & symstr, eFuncParam, parm );
-            if ( rc != 0 )
-                KTokenRCExplain ( t, klogInt, rc );
-            else
-            {
-                VectorInit ( & f -> u . script . prod, 0, 8 );
-                rc = schema_body ( tbl, src, t, env, self, f );
-            }
-
-            /* exit param scope */
-            KSymTablePopScope ( tbl );
-        }
-
-        /* exit schema scope */
-        KSymTablePopScope ( tbl );
-    }
-
-    return rc;
-}
-
-/*
- * physical-decl      = 'physical' [ 'column' ] <typedecl>
- *                       <fqn> '#' <maj-min-rel> <phys-body>
- * phys-body          =  '{' <physical-stmts> '}'
- * physical-stmt      = 'encode' <script-body>
- *                    | 'decode' <script-body>
- *                    | '__row_length = <func-expr>
- *                    | ';'
- */
-static
-rc_t physical_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SPhysical *p )
-{
-    rc_t rc;
-    const char *expected;
-
-    /* could have schema parameters */
-    if ( t -> id == eLeftAngle )
-    {
-        /* enter schema param scope */
-        rc = KSymTablePushScope ( tbl, & p -> decode . sscope );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-
-        /* parse schema params */
-        rc = schema_signature ( tbl, src, t, env, self, & p -> decode );
-
-        /* copy schema parameters to encode function
-           NB - must be cleared before destruction */
-        p -> encode . sscope = p -> decode . sscope;
-        p -> encode . type = p -> decode . type;
-        p -> encode . schem = p -> decode. schem;
-
-        /* interpret return type within schema param scope */
-        if ( rc == 0 )
-        {
-            rc = type_expr ( tbl, src, t, env, self, & p -> td );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "column typedecl" );
-        }
-
-        /* pop scope */
-        KSymTablePopScope ( tbl );
-
-        /* bail on problems */
-        if ( rc != 0 )
-            return rc;
-
-        /* "t" contains a lookahead token. while unlikely,
-           it could have matched something defined in schema
-           param scope. re-evaluate if possible */
-        if ( t -> sym != NULL ) switch ( t -> sym -> type )
-        {
-        case eSchemaType:
-        case eSchemaParam:
-            KTokenSourceReturn ( src, t );
-            next_token ( tbl, src, t );
-            break;
-        }
-    }
-    else
-    {
-        /* allow v0 columns to be declared with no blob header */
-        if ( t -> id == kw___no_header )
-        {
-            p -> no_hdr = true;
-            next_token ( tbl, src, t );
-        }
-
-        /* get column type expression */
-        rc = type_expr ( tbl, src, t, env, self, & p -> td );
-        if ( rc != 0 )
-            return KTokenExpected ( t, klogErr, "column typedecl" );
-    }
-
-    /* expect fully-qualified name */
-    rc = create_fqn ( tbl, src, t, env, ePhysical, NULL );
-    if ( rc != 0 && GetRCState ( rc ) != rcExists )
-        return KTokenFailure ( t, klogErr, rc, "column typename" );
-    p -> name = t -> sym;
-
-    /* must have a version */
-    if ( next_token ( tbl, src, t ) -> id != eHash )
-        return KTokenExpected ( t, klogErr, "#" );
-    next_token ( tbl, src, t );
-    rc = maj_min_rel ( tbl, src, t, env, self, & p -> version, false );
-    if ( rc != 0 )
-        return rc;
-
-    /* factory params */
-    if ( t -> id == eLeftAngle )
-    {
-        rc = KSymTablePushScope ( tbl, & p -> decode . sscope );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-        rc = KSymTablePushScope ( tbl, & p -> decode . fscope );
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-        else
-        {
-            rc = fact_signature ( tbl, src, t, env, self, & p -> decode . fact );
-            if ( rc == 0 )
-            {
-                /* copy factory parameters to encode function
-                   NB - must be cleared before destruction */
-                p -> encode . fact = p -> decode . fact;
-
-                /* clone factory parameter symbols */
-                if ( BSTreeDoUntil ( & p -> decode . fscope, false, KSymbolCopyScope, & p -> encode . fscope ) )
-                    rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-            }
-
-            KSymTablePopScope ( tbl );
-        }
-
-        KSymTablePopScope ( tbl );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* allow shorthand for decode-only */
-    if ( t -> id == eAssign )
-    {
-        next_token ( tbl, src, t );
-        rc = physical_stmt ( tbl, src, t, env, self, p, false );
-        if ( rc == 0 )
-            p -> read_only = true;
-        return rc;
-    }
-
-    /* open body */
-    rc = expect ( tbl, src, t, eLeftCurly, "{", true );
-    if ( rc != 0 )
-        return rc;
-
-    /* gather both parts */
-    expected = p -> no_hdr ? "decode" : "decode or encode";
-    while ( t -> id != eRightCurly )
-    {
-        if ( t -> id == eSemiColon )
-            next_token ( tbl, src, t );
-        else if ( t -> id == kw_decode && p -> decode . u . script . rtn == NULL )
-        {
-            next_token ( tbl, src, t );
-            rc = physical_stmt ( tbl, src, t, env, self, p, false );
-            if ( rc != 0 )
-                return rc;
-            expected = ( p -> encode . u . script . rtn == NULL ) ? "encode" : "}";
-        }
-        else if ( t -> id == kw_encode && p -> encode . u . script . rtn == NULL && ! p -> no_hdr )
-        {
-            next_token ( tbl, src, t );
-            rc = physical_stmt ( tbl, src, t, env, self, p, true );
-            if ( rc != 0 )
-                return rc;
-            expected = ( p -> decode . u . script . rtn == NULL ) ? "decode" : "}";
-        }
-        else if ( t -> id == kw___row_length && p -> row_length == NULL && p -> no_hdr )
-        {
-            rc = rowlen_func_expr ( tbl, src, t, env, self, p );
-            if ( rc != 0 )
-                return rc;
-        }
-        else
-        {
-            return KTokenExpected ( t, klogErr, expected );
-        }
-    }
-
-    /* must have at least a decoding */
-    if ( p -> decode . u . script . rtn == NULL )
-        return KTokenExpected ( t, klogErr, "decode" );
-
-    /* close */
-    rc = expect ( tbl, src, t, eRightCurly, "}", true );
-    if ( rc == 0 )
-    {
-        /* detect read-only decl */
-        if ( p -> encode . u . script . rtn == NULL )
-            p -> read_only = true;
-        else
-        {
-            /* patch up input parameter to encoding */
-            SProduction *parm = VectorGet ( & p -> encode . func . parms, 0 );
-            assert ( parm != NULL );
-            parm -> fd = p -> td;
-            atomic32_inc ( & ( ( SExpression* ) p -> td ) -> refcount );
-        }
-    }
-
-    return rc;
-}
-
-static
-void init_function ( SFunction *f )
-{
-    memset ( f, 0, sizeof * f );
-    f -> script = true;
-}
-
-rc_t physical_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    rc_t rc;
-    void *ignore;
-
-    SPhysical *p = malloc ( sizeof * p );
-    if ( p == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    p -> name = NULL;
-    p -> row_length = NULL;
-    init_function ( & p -> encode );
-    init_function ( & p -> decode );
-    p -> td = NULL;
-    p -> read_only = false;
-    p -> no_hdr = false;
-
-    if ( t -> id == kw_column )
-        next_token ( tbl, src, t );
-
-    rc = physical_decl ( tbl, src, t, env, self, p );
-    if ( rc == 0 )
-    {
-        SNameOverload *name = ( void* ) p -> name -> u . obj;
-        if ( name == NULL )
-        {
-            rc = SNameOverloadMake ( & name, p -> name, 0, 8 );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( & self -> pname, & name -> cid . id, name );
-                if ( rc != 0 )
-                    SNameOverloadWhack ( name, NULL );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> phys, & p -> id, p );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                rc = VectorInsertUnique ( & name -> items, p, & idx, SPhysicalSort );
-                if ( rc == 0 )
-                    return 0;
-                if ( GetRCState ( rc ) != rcExists )
-                    VectorSwap ( & self -> phys, p -> id, NULL, & ignore );
-                else
-                {
-                    SPhysical *exist = VectorGet ( & name -> items, idx );
-                    if ( p -> version > exist -> version )
-                    {
-                        VectorSwap ( & name -> items, idx, p, & ignore );
-                        if ( ( const void* ) name != exist -> name -> u . obj )
-                            return 0;
-                        assert ( exist -> id >= VectorStart ( & self -> phys ) );
-                        assert ( exist -> id < p -> id );
-                        VectorSwap ( & self -> phys, p -> id, NULL, & ignore );
-                        VectorSwap ( & self -> phys, p -> id = exist -> id, p, & ignore );
-                        p = exist;
-                    }
-
-                    /* exists is not an error */
-                    rc = 0;
-                }
-
-                VectorSwap ( & self -> phys, p -> id, NULL, & ignore );
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        rc = 0;
-    }
-    
-    SPhysicalWhack ( p, NULL );
-
-    return rc;
-}
-
-#endif /* SLVL >= 5 */
diff --git a/libs/vdb/schema-tbl.c b/libs/vdb/schema-tbl.c
deleted file mode 100644
index 2a0be41..0000000
--- a/libs/vdb/schema-tbl.c
+++ /dev/null
@@ -1,2928 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "schema-dump.h"
-#include "dbmgr-priv.h"
-
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* if non-zero, accept a typeset or a typedecl
-   for column. otherwise, only allow a typedecl */
-#define ALLOW_COLUMN_TYPESET 1
-
-/* make implicit physical expressions explicit on output */
-#define DUMP_EXPLICIT_PHYS_MEMBERS 0
-
-/* temporary v1 schema modification */
-#define ALLOW_DEFAULT_VIEW_DECL 1
-
-
-/*--------------------------------------------------------------------------
- * SColumn
- *  column declaration
- */
-
-#if SLVL >= 8
-
-/* Whack
- */
-void CC SColumnWhack ( void *item, void *ignore )
-{
-    SColumn *self = item;
-    SExpressionWhack ( self -> read );
-    SExpressionWhack ( self -> validate );
-    SExpressionWhack ( self -> limit );
-    SExpressionWhack ( self -> ptype );
-    free ( self );
-}
-
-/* Cmp
- * Sort
- */
-int CC SColumnCmp ( const void *item, const void *n )
-{
-    const VTypedecl *a = item;
-    const SColumn *b = n;
-
-    if ( a -> type_id != b -> td . type_id )
-        return ( int ) a -> type_id - ( int ) b -> td . type_id;
-    return ( int ) a -> dim - ( int ) b -> td . dim;
-}
-
-int CC SColumnSort ( const void *item, const void *n )
-{
-    const SColumn *a = item;
-    const SColumn *b = n;
-
-    if ( a -> td . type_id != b -> td . type_id )
-        return ( int ) a -> td . type_id - ( int ) b -> td . type_id;
-    return ( int ) a -> td . dim - ( int ) b -> td . dim;
-}
-
-/* Mark
- */
-static
-void CC SColumnMark ( void * item, void * data )
-{
-    const SColumn *self = item;
-    VSchema * schema = data;
-    if ( self != NULL )
-    {
-        SExpressionMark ( ( void * )self -> read, data );
-        SExpressionMark ( ( void * )self -> validate, data );
-        SExpressionMark ( ( void * )self -> limit, data );
-        VSchemaTypeMark ( schema, self -> td . type_id );
-    }
-}
-
-/* Dump
- */
-rc_t SColumnDump ( const SColumn *self, SDumper *d )
-{
-    return KSymbolDump ( self != NULL ? self -> name : NULL, d );
-}
-
-static
-rc_t SColumnDumpExpr ( SDumper *d, const SExpression *e )
-{
-    rc_t rc;
-    const SBinExpr *c;
-    bool compact = SDumperMode ( d ) == sdmCompact ? true : false;
-
-    if ( e -> var != eCondExpr )
-        return SDumperPrint ( d, compact ? "=%E;" : " = %E;\n", e );
-
-    c = ( const SBinExpr* ) e;
-
-    if ( ! compact )
-        SDumperIncIndentLevel ( d );
-    rc = SDumperPrint ( d, compact ? "=%E" : "\n\t= %E\n", c -> left );
-    while ( rc == 0 )
-    {
-        if ( c -> right -> var != eCondExpr )
-            break;
-        c = ( const SBinExpr* ) c -> right;
-        rc = SDumperPrint ( d, compact ? "|%E" : "\n\t| %E\n", c -> left );
-    }
-
-    rc = SDumperPrint ( d, compact ? "|%E" : "\n\t| %E\n", c -> right );
-    if ( ! compact )
-        SDumperDecIndentLevel ( d );
-    return rc;
-}
-
-bool CC SColumnDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SColumn *self = ( const void* ) item;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    /* handle simple cases first */
-    if ( self -> validate == NULL && self -> limit == NULL )
-    {
-        /* simple */
-#if ! DUMP_EXPLICIT_PHYS_MEMBERS
-        if ( self -> simple )
-        {
-            if ( self -> ptype != NULL )
-            {
-                b -> rc = SDumperPrint ( b, compact ? "column %E %N;" : "\tcolumn %E %N;\n"
-                                         , self -> ptype
-                                         , self -> name
-                    );
-            }
-            else
-            {
-                b -> rc = SDumperPrint ( b, compact ? "column %T %N;" : "\tcolumn %T %N;\n"
-                                         , & self -> td
-                                         , self -> name
-                    );
-            }
-        }
-        else
-#endif
-        {
-            assert ( self -> read != NULL );
-            b -> rc = SDumperPrint ( b, compact ? "%s%scolumn %T %N = %E;" : "\t%s%scolumn %T %N = %E;\n"
-                                     , self -> dflt ? "default " : ""
-                                     , self -> read_only ? "readonly " : ""
-                                     , & self -> td
-                                     , self -> name
-                                     , self -> read
-                );
-        }
-    }
-
-    /* canonical representation */
-    else
-    {
-#if ! DUMP_EXPLICIT_PHYS_MEMBERS
-        if ( self -> ptype != NULL )
-        {
-            b -> rc = SDumperPrint ( b, compact ? "%scolumn %E %N{" : "\t%scolumn %E %N\n\t{\n"
-                                     , self -> dflt ? "default " : ""
-                                     , self -> ptype
-                                     , self -> name
-                );
-        }
-        else
-#endif
-        {
-            b -> rc = SDumperPrint ( b, compact ? "%s%scolumn %T %N{" : "\t%s%scolumn %T %N\n\t{\n"
-                                     , self -> dflt ? "default " : ""
-                                     , self -> read_only ? "readonly " : ""
-                                     , & self -> td
-                                     , self -> name
-                );
-        }
-        if ( b -> rc == 0 )
-        {
-            if ( ! compact )
-                SDumperIncIndentLevel ( b );
-
-#if DUMP_EXPLICIT_PHYS_MEMBERS
-            if ( self -> read != NULL )
-#else
-            if ( ! self -> simple && self -> read != NULL )
-#endif
-            {
-                b -> rc = SDumperPrint ( b, compact ? "read" : "\tread" );
-                if ( b -> rc == 0 )
-                    b -> rc = SColumnDumpExpr ( b, self -> read );
-            }
-
-            if ( b -> rc == 0 && self -> validate != NULL )
-            {
-                b -> rc = SDumperPrint ( b, compact ? "validate" : "\tvalidate" );
-                if ( b -> rc == 0 )
-                    b -> rc = SColumnDumpExpr ( b, self -> validate );
-            }
-
-            if ( b -> rc == 0 && self -> limit != NULL )
-                b -> rc = SDumperPrint ( b, compact ? "limit = %E;" : "\tlimit = %E;\n", self -> limit );
-
-            if ( ! compact )
-                SDumperDecIndentLevel ( b );
-        }
-        if ( b -> rc == 0 )
-            b -> rc = SDumperPrint ( b, compact ? "}" : "\t}\n" );
-    }
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * SPhysMember
- *  column declaration
- */
-
-#if SLVL >= 7
-
-/* Whack
- */
-void CC SPhysMemberWhack ( void *item, void *ignore )
-{
-    SPhysMember *self = item;
-
-    SExpressionWhack ( self -> type );
-    SExpressionWhack ( self -> expr );
-    free ( self );
-}
-
-/* Mark
- */
-void CC SPhysMemberMark ( void * item, void * data )
-{
-    const SPhysMember * self = item;
-    const VSchema * schema = data;
-    if ( self != NULL )
-    {
-        SExpressionMark ( ( void * )self -> type, data );
-        SExpressionMark ( ( void * )self -> expr, data );
-        VSchemaTypeMark ( schema, self -> td . type_id );
-    }
-}
-
-/* Dump
- */
-rc_t SPhysMemberDump ( const SPhysMember *self, struct SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-bool CC SPhysMemberDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SPhysMember *self = ( const void* ) item;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-#if ! DUMP_EXPLICIT_PHYS_MEMBERS
-    if ( self -> simple )
-        return false;
-#endif
-
-    b -> rc = SDumperPrint ( b, compact ? "%s column " : "\t%s column "
-                             , self -> stat ? "static" : "physical"
-        );
-    if ( b -> rc == 0 )
-    {
-        if ( self -> type != NULL )
-            b -> rc = SExpressionDump ( self -> type, b );
-        else
-            b -> rc = SDumperPrint ( b, "%T", & self -> td );
-    }
-    if ( b -> rc == 0 )
-    {
-        if ( compact )
-        {
-            if ( self -> expr == NULL )
-                b -> rc = SDumperPrint ( b, " %N;", self -> name );
-            else
-                b -> rc = SDumperPrint ( b, " %N=%E;", self -> name, self -> expr );
-        }
-        else
-        {
-            if ( self -> expr == NULL )
-                b -> rc = SDumperPrint ( b, " %N;\n", self -> name );
-            else
-                b -> rc = SDumperPrint ( b, " %N = %E;\n", self -> name, self -> expr );
-        }
-    }
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * STableOverrides
- *  describes extended parent
- */
-
-#if SLVL >= 6
-typedef struct STableOverrides STableOverrides;
-struct STableOverrides
-{
-    const STable *dad;
-    Vector overrides;
-    uint32_t ctx;
-};
-
-/* Cmp
- * Sort
- */
-static
-int CC STableOverridesCmp ( const void *item, const void *n )
-{
-    const uint32_t *a = item;
-    const STableOverrides *b = n;
-
-    return ( int ) * a - ( int ) b -> ctx;
-}
-
-static
-int CC STableOverridesSort ( const void *item, const void *n )
-{
-    const STableOverrides *a = item;
-    const STableOverrides *b = n;
-
-    return ( int ) a -> ctx - ( int ) b -> ctx;
-}
-
-static
-int CC STableOverridesKSort ( const void **item, const void **n, void *ignore )
-{
-    return STableOverridesSort ( * item, * n );
-}
-
-/* Whack
- */
-static
-void CC STableOverridesWhack ( void *item, void *ignore )
-{
-    STableOverrides *self = item;
-    VectorWhack ( & self -> overrides, NULL, NULL );
-    free ( self );
-}
-
-/* Make
- */
-static
-rc_t STableOverridesMake ( Vector *parents, const STable *dad, const Vector *overrides )
-{
-    rc_t rc;
-    STableOverrides *to;
-
-    /* first question is whether parent exists */
-    if ( VectorFind ( parents, & dad -> id, NULL, STableOverridesCmp ) != NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcTable, rcExists );
-
-    /* create a new override object */
-    to = malloc ( sizeof * to );
-    if ( to == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    /* shallow clone */
-    rc = VectorCopy ( overrides, & to -> overrides );
-    if ( rc != 0 )
-    {
-        free ( to );
-        return rc;
-    }
-    to -> dad = dad;
-    to -> ctx = dad -> id;
-
-    /* insert into parent override vector */
-    rc = VectorInsert ( parents, to, NULL, STableOverridesSort );
-    if ( rc != 0 )
-    {
-        STableOverridesWhack ( to, NULL );
-        return rc;
-    }
-
-    return 0;
-}
-
-static
-bool CC STableOverridesClone ( void *item, void *data )
-{
-    const STableOverrides *self = ( const void* ) item;
-    rc_t rc = STableOverridesMake ( data, self -> dad, & self -> overrides );
-    return ( rc != 0 && GetRCState ( rc ) != rcExists ) ? true : false;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------
- * STable
- *  table declaration
- */
-
-#if SLVL >= 6
-
-/* Whack
- */
-void CC STableWhack ( void *item, void *ignore )
-{
-    STable *self = item;
-
-    if ( self -> dflt_view != NULL )
-        StringWhack ( self -> dflt_view );
-
-#if SLVL >= 8
-    VectorWhack ( & self -> col, SColumnWhack, NULL );
-    VectorWhack ( & self -> cname, SNameOverloadWhack, NULL );
-#endif
-#if SLVL >= 7
-    VectorWhack ( & self -> phys, SPhysMemberWhack, NULL );
-#endif
-    VectorWhack ( & self -> prod, SProductionWhack, NULL );
-    VectorWhack ( & self -> vprods, NULL, NULL );
-    VectorWhack ( & self -> syms, ( void ( CC * ) ( void*, void* ) ) KSymbolWhack, NULL );
-
-    VectorWhack ( & self -> parents, NULL, NULL );
-    VectorWhack ( & self -> overrides, STableOverridesWhack, NULL );
-
-    SExpressionWhack ( self -> limit );
-
-    BSTreeWhack ( & self -> scope, KSymbolWhack, NULL );
-
-    free ( self );
-}
-
-/* Cmp
- * Sort
- */
-int CC STableCmp ( const void *item, const void *n )
-{
-    const uint32_t *a = item;
-    const STable *b = n;
-
-    if ( * a > b -> version )
-        return 1;
-    return ( int ) ( * a >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-int CC STableSort ( const void *item, const void *n )
-{
-    const STable *a = item;
-    const STable *b = n;
-
-    return ( int ) ( a -> version >> 24 ) - ( int ) ( b -> version >> 24 );
-}
-
-
-/* Find
- *  generic object find within table scope
- *
- *  "td" [ OUT, NULL OKAY ] - returns cast type expression
- *  if given or "any" if not
- *
- *  "name" [ OUT ] - returns list of overloaded objects if found
- *
- *  "type" [ OUT ] - returns object type id, e.g.:
- *    eDatatype, eTypeset, eFormat, eFunction, ePhysical, eTable, ...
- *
- *  "expr" [ IN ] - NUL terminated name expression identifying object
- *
- *  "ctx" [ IN ] - NUL terminated context string for evaluation,
- *  substitutes for filename in logging reports
- *
- *  "dflt" [ IN ] - if true, resolve default value
- *
- *  returns principal object identified. if NULL but "name" is not
- *  NULL, then the object was only partially identified.
- */
-const void *STableFind ( const STable *self,
-    const VSchema *schema, VTypedecl *td, const SNameOverload **name,
-    uint32_t *type, const char *expr, const char *ctx, bool dflt )
-{
-    rc_t rc;
-    KSymTable tbl;
-
-    /* initialize to not-found */
-    const void *obj = NULL;
-    * name = NULL;
-    * type = 0;
-
-    /* build a symbol table for table */
-    rc = init_tbl_symtab ( & tbl, schema, self );
-    if ( rc == 0 )
-    {
-        obj = resolve_object ( & tbl, schema, td, name, type, expr, ctx, dflt );
-        KSymTableWhack ( & tbl );
-    }
-
-    return obj;
-}
-
-
-/* FindOverride
- *  finds an inherited or introduced overridden symbol
- */
-KSymbol *STableFindOverride ( const STable *self, const VCtxId *cid )
-{
-    const STableOverrides *to;
-
-    /* it may be on the existing table */
-    if ( cid -> ctx == self -> id )
-        return VectorGet ( & self -> vprods, cid -> id );
-
-    to = ( const void* ) VectorFind ( & self -> overrides,
-        & cid -> ctx, NULL, STableOverridesCmp );
-    if ( to == NULL )
-        return NULL;
-
-    return VectorGet ( & to -> overrides, cid -> id );
-}
-
-/* FindOrdAncestor
- *  finds a parent or grandparent by order
- */
-const STable *STableFindOrdAncestor ( const STable *self, uint32_t i )
-{
-    const STableOverrides *to = ( const void* ) VectorGet ( & self -> overrides, i );
-    if ( to == NULL )
-        return NULL;
-    return to -> dad;
-}
-
-
-/* Extend
- */
-static
-bool CC STableHasDad ( void *item, void *data )
-{
-    if ( item == data )
-        return true;
-    return false;
-}
-
-static
-bool STableTestForTypeCollision ( const SNameOverload *a, const SNameOverload *b )
-{
-    uint32_t ax, bx, ctx;
-
-    uint32_t aend = VectorLength ( & a -> items );
-    uint32_t bend = VectorLength ( & b -> items );
-
-    if ( aend == 0 || bend == 0 )
-        return false;
-
-    ctx = a -> cid . ctx;
-    ax = VectorStart ( & a -> items );
-    bx = VectorStart ( & b -> items );
-
-    for ( aend += ax, bend += bx; ax < aend && bx < bend; )
-    {
-        int diff;
-        const SColumn *acol = ( const void* ) VectorGet ( & a -> items, ax );
-        const SColumn *bcol = ( const void* ) VectorGet ( & b -> items, bx );
-        assert ( acol != NULL && bcol != NULL );
-
-        /* if they are both from some other shared parent
-           maybe they are even the same column */
-        if ( acol == bcol || acol -> cid . ctx == bcol -> cid . ctx )
-        {
-            ++ ax;
-            ++ bx;
-            continue;
-        }
-
-        /* don't bother comparing if either is from
-           originating table, as they are required
-           to appear in both lists */
-        if ( acol -> cid . ctx == ctx )
-        {
-            ++ ax;
-            continue;
-        }
-
-        if ( bcol -> cid . ctx == ctx )
-        {
-            ++ bx;
-            continue;
-        }
-
-        /* test the column types */
-        diff = SColumnSort ( acol, bcol );
-
-        /* if they are the same type, this is a collision */
-        if ( diff == 0 )
-            return true;
-
-        /* let it slide */
-        if ( diff < 0 )
-            ++ ax;
-        else
-            ++ bx;
-    }
-
-    return false;
-}
-
-static
-bool STableTestForSymCollision ( const KSymbol *sym, void *data )
-{
-    const KSymTable *tbl = ( const void* ) data;
-    const KSymbol *found = KSymTableFindSymbol ( tbl, sym );
-    if ( found != NULL && found != sym ) switch ( found -> type )
-    {
-    case eColumn:
-        if ( sym -> type == eColumn )
-        {
-            /* when colliding columns originated in the same
-               table, consider them to be compatible extensions */
-            const SNameOverload *found_col, *sym_col;
-            sym_col = sym -> u . obj;
-            found_col = found -> u . obj;
-            assert ( sym_col != NULL && found_col != NULL );
-            if ( sym_col -> cid . ctx == found_col -> cid . ctx )
-                return STableTestForTypeCollision ( sym_col, found_col );
-        }
-    case eProduction:
-    case ePhysMember:
-        PLOGMSG ( klogErr, ( klogErr, "duplicate symbol '$(sym)' in parent table hierarchy"
-                             , "sym=%S"
-                             , & sym -> name
-                      ));
-        return true;
-    }
-    return false;
-}
-
-static
-bool CC STableTestColCollisions ( void *item, void *data )
-{
-    const SNameOverload *no = ( const void* ) item;
-    return STableTestForSymCollision ( no -> name, data );
-}
-
-static
-bool CC STableTestPhysCollisions ( void *item, void *data )
-{
-    const SPhysMember *phys = ( const void* ) item;
-    return STableTestForSymCollision ( phys -> name, data );
-}
-
-static
-bool CC STableTestProdCollisions ( void *item, void *data )
-{
-    const SProduction *prod = ( const void* ) item;
-    return STableTestForSymCollision ( prod -> name, data );
-}
-
-static
-bool STableTestForCollisions ( void *item, void *data )
-{
-    const STable *self = ( const void* ) item;
-
-    /* test column names */
-    if ( VectorDoUntil ( & self -> cname, false, STableTestColCollisions, data ) )
-        return true;
-
-    /* test physical names */
-    if ( VectorDoUntil ( & self -> phys, false, STableTestPhysCollisions, data ) )
-        return true;
-
-    /* test production names */
-    if ( VectorDoUntil ( & self -> prod, false, STableTestProdCollisions, data ) )
-        return true;
-
-    return false;
-}
-
-static
-bool CC STableOverridesTestForCollisions ( void *item, void *data )
-{
-    const STableOverrides *to = ( const void* ) item;
-    return STableTestForCollisions ( ( void* ) to -> dad, data );
-}
-
-static
-bool CC STableCopyColumnNames ( void *item, void *data )
-{
-    rc_t rc;
-    STable *self= data;
-    SNameOverload *copy;
-    const SNameOverload *orig = ( const void* ) item;
-    const KSymbol *sym = ( const KSymbol* )
-        BSTreeFind ( & self -> scope, & orig -> name -> name, KSymbolCmp );
-    if ( sym == NULL )
-    {
-        rc = SNameOverloadCopy ( & self -> scope, & copy, orig );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> cname, & copy -> cid . id, copy );
-            if ( rc != 0 )
-                SNameOverloadWhack ( copy, NULL );
-        }
-    }
-    else
-    {
-        copy = ( void* ) sym -> u . obj;
-        assert ( copy -> cid . ctx == orig -> cid . ctx );
-        rc = VectorMerge ( & copy -> items, true, & orig -> items, SColumnSort );
-    }
-
-    return ( rc != 0 ) ? true : false;
-}
-
-static
-bool CC STableScanVirtuals ( void *item, void *data )
-{
-    KSymTable *tbl = data;
-    STableOverrides *to = item;
-    BSTree *scope = VectorLast ( & tbl -> stack );
-    uint32_t i = VectorStart ( & to -> overrides );
-    uint32_t end = VectorLength ( & to -> overrides );
-    for ( end += i; i < end; ++ i )
-    {
-        const KSymbol *orig = ( const void* ) VectorGet ( & to -> overrides, i );
-        assert ( orig != NULL );
-        if ( orig -> type == eVirtual )
-        {
-            void *ignore;
-
-            /* since the virtual productions in one parent could be
-               defined by another parent, test for the possibility */
-            const KSymbol *def = KSymTableFindSymbol ( tbl, orig );
-            if ( def != NULL )
-                VectorSwap ( & to -> overrides, i, def, & ignore );
-            else
-            {
-                /* copy the original */
-                KSymbol *copy;
-                rc_t rc = KSymbolCopy ( scope, & copy, orig );
-                if ( rc != 0 )
-                    return true;
-
-                /* replace the parent virtual with an updatable copy */
-                VectorSwap ( & to -> overrides, i, copy, & ignore );
-            }
-        }
-    }
-    return false;
-}
-
-static
-rc_t STableExtend ( KSymTable *tbl, STable *self, const STable *dad )
-{
-    rc_t rc;
-
-    /* reject if direct parent already there */
-    if ( VectorDoUntil ( & self -> parents, false, STableHasDad, ( void* ) dad ) )
-        return RC ( rcVDB, rcSchema, rcParsing, rcTable, rcExists );
-
-    /* if parent is already in ancestry, treat as redundant */
-    if ( VectorFind ( & self -> overrides, & dad -> id, NULL, STableOverridesCmp ) != NULL )
-        return VectorAppend ( & self -> parents, NULL, dad );
-
-    /* enter scope for this table */
-    rc = push_tbl_scope ( tbl, self );
-    if ( rc != 0 )
-        return rc;
-
-    /* test for any collisions */
-    if ( STableTestForCollisions ( ( void* ) dad, tbl ) ||
-         VectorDoUntil ( & dad -> overrides, false, STableOverridesTestForCollisions, tbl ) )
-    {
-        pop_tbl_scope ( tbl, self );
-        return RC ( rcVDB, rcSchema, rcParsing, rcName, rcExists );
-    }
-
-    /* pop table scope */
-    pop_tbl_scope ( tbl, self );
-
-    /* add "dad" to parent list */
-    rc = VectorAppend ( & self -> parents, NULL, dad );
-    if ( rc != 0 )
-        return rc;
-
-    /* copy column names from parent - should already contain all grandparents */
-    if ( VectorDoUntil ( & dad -> cname, false, STableCopyColumnNames, self ) )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    /* add "dad" to overrides */
-    rc = STableOverridesMake ( & self -> overrides, dad, & dad -> vprods );
-    if ( rc == 0 )
-    {
-        /* add all grandparents */
-        if ( VectorDoUntil ( & dad -> overrides, false, STableOverridesClone, & self -> overrides ) )
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        rc = 0;
-    }
-    return rc;
-}
-
-/* CloneExtend
- *  creates an initially transparent table extension
- *  used by cursor to permit addition of implicit productions
- */
-rc_t STableCloneExtend ( const STable *self, STable **clone, VSchema *schema )
-{
-    rc_t rc;
-    KSymTable tbl;
-
-    STable *table = malloc ( sizeof * table );
-    if ( table == NULL )
-        return RC ( rcVDB, rcSchema, rcUpdating, rcMemory, rcExhausted );
-
-    /* need to take a deep look at scope */
-    rc = init_symtab ( & tbl, schema );
-    if ( rc != 0 )
-        return rc;
-
-    /* this takes care of initializing "scope" */
-    memset ( table, 0, sizeof * table );
-
-    /* take name and version, since this is an anonymous extension */
-    table -> name = KSymTableFindSymbol ( & tbl, self -> name );
-    KSymTableWhack ( & tbl );
-    assert ( table -> name != NULL );
-    table -> src_file = self -> src_file;
-    table -> src_line = self -> src_line;
-    table -> version = self -> version;
-
-    /* take on table-wide blob limit */
-    if ( self -> limit != NULL )
-    {
-        table -> limit = self -> limit;
-        atomic32_inc ( & ( ( SExpression* ) table -> limit ) -> refcount );
-    }
-
-    /* initialize all vectors for single-inheritance */
-    VectorInit ( & table -> parents, 0, 1 );
-    VectorInit ( & table -> overrides, 0, VectorLength ( & self -> overrides ) + 1 );
-    VectorInit ( & table -> col, 0, 16 );
-    VectorInit ( & table -> cname, 0, 16 );
-    VectorInit ( & table -> phys, 0, 16 );
-    VectorInit ( & table -> prod, 0, 64 );
-    VectorInit ( & table -> vprods, 1, 16 );
-    VectorInit ( & table -> syms, 1, 32 );
-
-    rc = init_tbl_symtab ( & tbl, schema, table );
-    if ( rc == 0 )
-        rc = STableExtend ( & tbl, table, self );
-    if ( rc == 0 )
-    {
-        rc = push_tbl_scope ( & tbl, table );
-        if ( rc == 0 )
-        {
-            if ( VectorDoUntil ( & table -> overrides, false, STableScanVirtuals, & tbl ) )
-                rc = RC ( rcVDB, rcSchema, rcUpdating, rcMemory, rcExhausted );
-        }
-    }
-
-    KSymTableWhack ( & tbl );
-
-    if ( rc == 0 )
-    {
-        /* add table to schema */
-        rc = VectorAppend ( & schema -> tbl, & table -> id, table );
-        if ( rc == 0 )
-        {
-            void *dad;
-            uint32_t idx;
-            SNameOverload *name = ( void* ) table -> name -> u . obj;
-
-            /* find ourselves in table overloads */
-            dad = VectorFind ( & name -> items, & table -> version, & idx, STableCmp );
-            assert ( dad != NULL );
-            assert ( dad == ( void* ) self );
-
-            /* set clone in our place */
-            VectorSwap ( & name -> items, idx, table, & dad );
-
-            * clone = table;
-            return 0;
-        }
-    }
-
-    STableWhack ( table, NULL ), table = NULL;
-    return rc;
-}
-
-/* ImplicitPhysMember
- *  adds an implicit physical member
- */
-rc_t STableImplicitPhysMember ( STable *self,
-    const VTypedecl *td, KSymbol *sym, const String *name )
-{
-    rc_t rc;
-    SPhysMember *m = malloc ( sizeof * m );
-    if ( m == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( m, 0, sizeof * m );
-
-        /* if discovered as static column, give it a type */
-        if ( td != NULL )
-            m -> td = * td;
-
-        /* create name symbol as required */
-        if ( sym == NULL )
-        {
-            rc = KSymbolMake ( & sym, name, ePhysMember, m );
-            if ( rc == 0 )
-                BSTreeInsert ( & self -> scope, & sym -> n, KSymbolSort );
-        }
-        if ( sym != NULL )
-        {
-            /* complete handshake with symbol */
-            m -> name = sym;
-            sym -> u . obj = m;
-            sym -> type = ePhysMember;
-
-            /* add member to table */
-            m -> cid . ctx = self -> id;
-            rc = VectorAppend ( & self -> phys, & m -> cid . id, m );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        SPhysMemberWhack ( m, NULL );
-    }
-    return rc;
-}
-
-/* ImplicitColMember
- *  adds an implicit column member of simple or incomplete type
- *
- *  "cname" [ IN ] - column name
- *
- *  "pname" [ IN ] - name of physical column
- */
-rc_t STableImplicitColMember ( STable *self,
-    const String *cname, const String *pname )
-{
-    rc_t rc;
-
-    /* create SColumn */
-    SColumn *col = malloc ( sizeof * col );
-    if ( col == NULL )
-        rc = RC ( rcVDB, rcTable, rcUpdating, rcMemory, rcExhausted );
-    else
-    {
-        const KSymbol *psym;
-        memset ( col, 0, sizeof * col );
-
-        /* look up SPhysMember */
-        psym = ( const KSymbol* ) BSTreeFind ( & self -> scope, pname, KSymbolCmp );
-        if ( psym == NULL )
-            rc = RC ( rcVDB, rcTable, rcUpdating, rcColumn, rcNotFound );
-        else
-        {
-            KSymbol *csym;
-
-            /* create column symbol */
-            rc = KSymbolMake ( & csym, cname, eColumn, col );
-            if ( rc == 0 )
-            {
-                BSTNode *exist;
-
-                /* complete handshake with symbol */
-                col -> name = csym;
-
-                /* insert into table scope and reject on collision
-                   deep check should have been executed previously */
-                rc = BSTreeInsertUnique ( & self -> scope, & csym -> n, & exist, KSymbolSort );
-                if ( rc == 0 )
-                {
-                    /* take column typedecl ( if known ) from physical */
-                    SPhysMember *phys = ( void* ) psym -> u . obj;
-                    col -> td = phys -> td;
-
-                    /* cross-link the external and physical columns */
-                    rc = SSymExprMake ( & col -> read, psym, ePhysExpr );
-                    if ( rc == 0 )
-                        rc = SSymExprMake ( & phys -> expr, csym, eColExpr );
-                    if ( rc == 0 )
-                    {
-                        /* add column to table */
-                        col -> cid . ctx = self -> id;
-                        rc = VectorAppend ( & self -> col, & col -> cid . id, col );
-                        if ( rc == 0 )
-                        {
-                            void *ignore;
-                            SNameOverload *name;
-
-                            /* create a column name with a single typed column */
-                            rc = SNameOverloadMake ( & name, csym, 0, 1 );
-                            if ( rc == 0 )
-                            {
-                                /* being the only column, "col" may be simply
-                                   inserted rather than using a sorted insert */
-                                rc = VectorAppend ( & name -> items, NULL, col );
-                                if ( rc == 0 )
-                                {
-                                    /* finally, insert name into table */
-                                    rc = VectorAppend ( & self -> cname, & name -> cid . id, name );
-                                    if ( rc == 0 )
-                                    {
-                                        name -> cid . ctx = self -> id;
-                                        return 0;
-                                    }
-                                }
-
-                                SNameOverloadWhack ( name, NULL );
-                            }
-
-                            VectorSwap ( & self -> col, col -> cid . id, NULL, & ignore );
-                        }
-
-                        SExpressionWhack ( phys -> expr ), phys -> expr = NULL;
-                    }
-
-                    BSTreeUnlink ( & self -> scope, & csym -> n );
-                }
-
-                KSymbolWhack ( & csym -> n, NULL );
-            }
-        }
-
-        SColumnWhack ( col, NULL );
-    }
-    return rc;
-}
-
-
-/* Compare
- */
-static
-int KSymbolDeepCompare ( const KSymbol *a, const KSymbol *b )
-{
-    int diff;
-
-    /* the same symbol */
-    if ( a == b )
-        return 0;
-
-    /* parents are first */
-    if ( a -> dad != NULL )
-    {
-        if ( b -> dad != NULL )
-        {
-            /* both symbols have parents */
-            diff = KSymbolDeepCompare ( a -> dad, b -> dad );
-            if ( diff != 0 )
-                return diff;
-        }
-        else
-        {
-            /* "b" is a root */
-            diff = KSymbolDeepCompare ( a -> dad, b );
-            if ( diff != 0 )
-                return diff;
-            return 1;
-        }
-    }
-    else if ( b -> dad != NULL )
-    {
-        /* "a" is a root */
-        diff = KSymbolDeepCompare ( a, b -> dad );
-        if ( diff != 0 )
-            return diff;
-        return -1;
-    }
-
-    /* perform textual comparison */
-    return KSymbolSort ( & a -> n, & b -> n );
-}
-
-static
-int CC STableNameSort ( const void **a, const void **b, void *ignore )
-{
-    int diff;
-    const STable *tb = * b;
-    const STable *ta = * a;
-    if ( tb == NULL )
-        return ta != NULL;
-    if ( ta == NULL )
-        return -1;
-    diff = KSymbolDeepCompare ( ta -> name, tb -> name );
-    if ( diff != 0 )
-        return diff;
-    if ( ta -> version < tb -> version )
-        return -1;
-    if ( ta -> version > tb -> version )
-        return 1;
-    return 0;
-}
-
-enum
-{
-    stbl_cmp_insertion = 1 << 0,
-    stbl_cmp_deletion  = 1 << 1,
-    stbl_cmp_mismatch  = 1 << 2,
-    stbl_cmp_newer     = 1 << 3,
-    stbl_cmp_older     = 1 << 4
-};
-
-static
-rc_t STableCompare ( const STable *a, const STable *b, const STable **newer, bool exhaustive )
-{
-    rc_t stage_rc, cmp_rc = 0;
-    uint32_t stage_bits, cmp_bits = 0;
-
-    int diff;
-    Vector va, vb;
-    uint32_t ia, ib, ca, cb;
-
-    assert ( ( a -> version >> 24 ) == ( b -> version >> 24 ) );
-
-    PARSE_DEBUG (( "STableCompare: testing %N #%.3V against #%.3V\n",
-                   a -> name, a -> version, b -> version ));
-
-    /* guess the newer of the two based upon version alone */
-    * newer = a -> version >= b -> version ? a : b;
-
-    /* test #1 - immediate parents */
-    ca = VectorLength ( & a -> parents );
-    cb = VectorLength ( & b -> parents );
-    if ( ca != cb || ca != 0 )
-    {
-        /* make a copy */
-        cmp_rc = VectorCopy ( & a -> parents, & va );
-        if ( cmp_rc != 0 )
-            return cmp_rc;
-        cmp_rc = VectorCopy ( & b -> parents, & vb );
-        if ( cmp_rc != 0 )
-        {
-            VectorWhack ( & va, NULL, NULL );
-            return cmp_rc;
-        }
-        if ( ca > 1 )
-            VectorReorder ( & va, STableNameSort, NULL );
-        if ( cb > 1 )
-            VectorReorder ( & vb, STableNameSort, NULL );
-
-        for ( stage_bits = ia = ib = 0; ia < ca && ib < cb; )
-        {
-            const STable *pa = ( const void* ) VectorGet ( & va, ia );
-            const STable *pb = ( const void* ) VectorGet ( & vb, ib );
-            if ( pa == pb )
-            {
-                ++ ia, ++ ib;
-                continue;
-            }
-            diff = KSymbolDeepCompare ( pa -> name, pb -> name );
-            if ( diff < 0 )
-            {
-                stage_bits |= stbl_cmp_insertion;
-                ++ ia;
-            }
-            else if ( diff > 0 )
-            {
-                stage_bits |= stbl_cmp_deletion;
-                ++ ib;
-            }
-            else
-            {
-                if ( pa -> version > pb -> version )
-                    stage_bits |= stbl_cmp_newer;
-                else if ( pa -> version < pb -> version )
-                    stage_bits |= stbl_cmp_older;
-
-                ++ ia, ++ ib;
-            }
-        }
-
-        VectorWhack ( & va, NULL, NULL );
-        VectorWhack ( & vb, NULL, NULL );
-
-        PARSE_DEBUG (( "STableCompare: %N #%.3V vs. #%.3V - PARENT COMPARISON:\n%s%s%s%s%s"
-                       , a -> name, a -> version, b -> version
-                       , ( stage_bits == 0 )                 ? "  no differences detected\n" : ""
-                       , ( stage_bits & stbl_cmp_insertion ) ? "  insertion(s) detected\n" : ""
-                       , ( stage_bits & stbl_cmp_deletion )  ? "  deletion(s) detected\n" : ""
-                       , ( stage_bits & stbl_cmp_newer )     ? "  newer ancestor(s) detected\n" : ""
-                       , ( stage_bits & stbl_cmp_older )     ? "  older ancestor(s) detected\n" : ""
-            ));
-
-        if ( stage_bits != 0 )
-        {
-            /* if the table versions are the same, the parents should not have insertions or deletions */
-            if ( a -> version == b -> version && ( stage_bits & ( stbl_cmp_insertion | stbl_cmp_deletion ) ) != 0 )
-            {
-                stage_rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcInconsistent );
-                PLOGERR ( klogErr, ( klogErr, stage_rc, "STableCompare: illegal redeclaration of table '$(tbl)' - differing parents."
-                                     , "tbl=%N#%.3V"
-                                     , a -> name, b -> version ) );
-                if ( ! exhaustive )
-                    return stage_rc;
-                if ( cmp_rc == 0 )
-                    cmp_rc = stage_rc;
-            }
-
-            /* if the tables have same parent names but conflicting versions */
-            if ( ( stage_bits & ( stbl_cmp_newer | stbl_cmp_older ) ) == ( stbl_cmp_newer | stbl_cmp_older ) )
-            {
-                stage_rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcInconsistent );
-                PLOGERR ( klogErr, ( klogErr, stage_rc, "STableCompare: illegal redeclaration of table '$(tbl)' - both older and newer parent versions."
-                                     , "tbl=%N#%.3V"
-                                     , a -> name, b -> version ) );
-                if ( ! exhaustive )
-                    return stage_rc;
-                if ( cmp_rc == 0 )
-                    cmp_rc = stage_rc;
-            }
-            else
-            {
-                /* if "a" claims to be newer than "b" */
-                if ( a -> version > b -> version )
-                {
-                    if ( ( stage_bits & stbl_cmp_older ) != 0 )
-                    {
-                        stage_rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcInconsistent );
-                        PLOGERR ( klogErr, ( klogErr, stage_rc, "STableCompare: illegal redeclaration of table '$(tbl)' - version $(new_vers) has older parents than version $(old_vers)."
-                                             , "tbl=%N,new_vers=#%.3V,old_vers=#%.3V"
-                                             , a -> name, a -> version, b -> version ) );
-                        if ( ! exhaustive )
-                            return stage_rc;
-                        if ( cmp_rc == 0 )
-                            cmp_rc = stage_rc;
-                    }
-                }
-
-                /* if "b" claims to be newer than "a" */
-                else if ( a -> version < b -> version )
-                {
-                    if ( ( stage_bits & stbl_cmp_newer ) != 0 )
-                    {
-                        stage_rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcInconsistent );
-                        PLOGERR ( klogErr, ( klogErr, stage_rc, "STableCompare: illegal redeclaration of table '$(tbl)' - version $(old_vers) has newer parents than version $(new_vers)."
-                                             , "tbl=%N,new_vers=#%.3V,old_vers=#%.3V"
-                                             , a -> name, b -> version, a -> version ) );
-                        if ( ! exhaustive )
-                            return stage_rc;
-                        if ( cmp_rc == 0 )
-                            cmp_rc = stage_rc;
-                    }
-                }
-
-                /* they are the same - check parent versions */
-                else if ( ( stage_bits & ( stbl_cmp_newer | stbl_cmp_older ) ) != 0 )
-                {
-                    PLOGMSG ( klogInfo, ( klogInfo, "STableCompare: table '$(tbl)' differs in parent hierarchy"
-                                          " - latest declaration chosen automatically.", "tbl=%N#%.3V"
-                                          , a -> name, b -> version ));
-
-                    * newer = ( stage_bits & stbl_cmp_newer ) ? a : b;
-                }
-            }
-
-            cmp_bits |= stage_bits;
-        }
-    }
-
-    /* test #2 - immediate extern columns */
-    /* test #3 - immediate physical columns */
-    /* test #4 - immediate productions */
-    /* test #5 - immediate virtual productions */
-    /* test #6 - deep parents */
-    /* test #7 - deep extern columns */
-    /* test #8 - deep physical columns */
-    /* test #9 - deep productions */
-    /* test #10 - deep virtual productions */
-
-    return cmp_rc;
-}
-
-
-/* Mark
- */
-void CC STableClearMark ( void *item, void *ignore )
-{
-    STable *self = item;
-    self -> marked = false;
-}
-
-
-void CC STableMark ( void * item, void * data )
-{
-    STable * self = item;
-    if ( self != NULL && ! self -> marked )
-    {
-        self -> marked = true;
-        SFunctionMark ( ( void * )self -> untyped, data );
-        VectorForEach ( & self -> col, false, SColumnMark, data );
-        VectorForEach ( & self -> phys, false, SPhysMemberMark, data );
-        VectorForEach ( & self -> prod, false, SProductionMark, data );
-        VectorForEach ( & self -> parents, false, STableMark, data );
-    }
-}
-
-void STableNameMark ( const SNameOverload *self, const VSchema *schema )
-{
-    if ( self != NULL )
-    {
-        VectorForEach ( & self -> items, false, STableMark, ( void * )schema );
-    }
-}
-
-
-/* Dump
- *  dump "table" { }
- */
-rc_t STableDump ( const STable *self, struct SDumper *d )
-{
-    d -> rc = FQNDump ( self != NULL ? self -> name : NULL, d );
-    if ( d -> rc == 0 && self != NULL )
-        d -> rc = SDumperVersion ( d, self -> version );
-    return d -> rc;
-}
-
-#if _DEBUGGING
-static
-bool CC SProductionDumpVirtuals ( void *item, void *data )
-{
-    SDumper *b = data;
-    const KSymbol *sym = ( const void* ) item;
-
-    switch ( sym -> type )
-    {
-    case eVirtual:
-        b -> rc = SDumperPrint ( b, "\t *  virtual %N = 0;\n", sym );
-        break;
-    case eProduction:
-    {
-        const SProduction *prod = sym -> u . obj;
-        b -> rc = SDumperPrint ( b, "\t *  %E %N;\n", prod -> fd, sym );
-        break;
-    }
-    case eColumn:
-    {
-        b -> rc = SDumperPrint ( b, "\t *  column %N;\n", sym );
-        break;
-    }
-    case ePhysMember:
-    {
-        const SPhysMember *phys = sym -> u . obj;
-        if ( phys -> type != NULL )
-            b -> rc = SDumperPrint ( b, "\t *  physical %E %N;\n", phys -> type, sym );
-        else
-            b -> rc = SDumperPrint ( b, "\t *  physical %T %N;\n", & phys -> td, sym );
-        break;
-    }}
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-static
-bool CC SProductionDumpOverrides ( void *item, void *data )
-{
-    SDumper *b = data;
-    const STableOverrides *to = ( const void* ) item;
-    if ( VectorLength ( & to -> overrides ) == 0 )
-        return false;
-
-    b -> rc = SDumperPrint ( b, "\n\t/* %N inherited virtual productions\n", to -> dad -> name );
-    if ( b -> rc != 0 )
-        return true;
-    if ( VectorDoUntil ( & to -> overrides, false, SProductionDumpVirtuals, b ) )
-        return true;
-    b -> rc = SDumperPrint ( b, "\t */\n" );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-#endif
-
-static
-bool STableDumpBody ( const STable *self, SDumper *b )
-{
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( self -> untyped != NULL )
-    {
-        b -> rc = SDumperPrint ( b, compact ? "__untyped=%N();" : "\t__untyped = %N ();\n"
-                                 , self -> untyped -> name
-            );
-        if ( b -> rc != 0 )
-            return true;
-    }
-    if ( self -> limit != NULL )
-    {
-        b -> rc = SDumperPrint ( b, compact ? "column default limit=%E;" : "\tcolumn default limit = %E;\n"
-                                 , self -> limit
-            );
-        if ( b -> rc != 0 )
-            return true;
-    }
-#if SLVL >= 8
-    if ( VectorDoUntil ( & self -> col, false, SColumnDefDump, b ) )
-        return true;
-#endif
-    if ( VectorDoUntil ( & self -> prod, false, SProductionDefDump, b ) )
-        return true;
-#if SLVL >= 7
-    if ( VectorDoUntil ( & self -> phys, false, SPhysMemberDefDump, b ) )
-        return true;
-#endif
-#if _DEBUGGING
-    if ( SDumperMode ( b ) == sdmPrint )
-    {
-        if ( VectorDoUntil ( & self -> overrides, false, SProductionDumpOverrides, b ) )
-            return true;
-
-        if ( VectorLength ( & self -> vprods ) != 0 )
-        {
-            b -> rc = SDumperPrint ( b, "\n\t/* %N virtual productions\n", self -> name );
-            if ( b -> rc != 0 )
-                return true;
-            if ( VectorDoUntil ( & self -> vprods, false, SProductionDumpVirtuals, b ) )
-                return true;
-            b -> rc = SDumperPrint ( b, "\t */\n" );
-            if ( b -> rc != 0 )
-                return true;
-        }
-    }
-#endif
-
-    return false;
-}
-
-static
-bool CC STableDumpParents ( void *item, void *data )
-{
-    SDumper *b = data;
-    const STable *self = ( const void* ) item;
-
-    b -> rc = SDumperPrint ( b, "\v%N%V", self -> name, self -> version );
-
-    SDumperSepString ( b, SDumperMode ( b ) == sdmCompact ? "," : ", " );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-bool CC STableDefDump ( void *item, void *data )
-{
-    bool rtn;
-    SDumper *b = data;
-    const STable *self = ( const void* ) item;
-    bool compact = SDumperMode ( b ) == sdmCompact ? true : false;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    b -> rc = SDumperPrint ( b, compact ? "table %N" : "\ttable %N", self -> name );
-
-    if ( b -> rc == 0 )
-        b -> rc = SDumperVersion ( b, self -> version );
-
-    if ( b -> rc == 0 )
-    {
-        SDumperSepString ( b, compact ? "=" : " = " );
-        VectorDoUntil ( & self -> parents, false, STableDumpParents, b );
-    }
-
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, compact ? "{" : "\n\t{\n" );
-
-    if ( b -> rc != 0 )
-        return true;
-
-    if ( ! compact )
-        SDumperIncIndentLevel ( b );
-    rtn = STableDumpBody ( self, b );
-    if ( ! compact )
-        SDumperDecIndentLevel ( b );
-
-    if ( rtn )
-        return true;
-
-    b -> rc = SDumperPrint ( b, compact ? "}" : "\t}\n" );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-#if SLVL >= 7
-
-/*
- * physical-name      = '.' ID
- */
-void physical_name ( const KSymTable *tbl, KTokenSource *src, KToken *t, const SchemaEnv *env )
-{
-    KToken t2;
-    if ( KTokenizerNext ( kDefaultTokenizer, src, & t2 ) -> id != eIdent ||
-         t -> str . addr + 1 != t2 . str . addr )
-    {
-        /* this is just a dot */
-        KTokenSourceReturn ( src, & t2 );
-    }
-    else
-    {
-        /* this is a physical name */
-        t -> str . size += t2 . str . size;
-        t -> str . len += t2 . str . len;
-        t -> id = eIdent;
-        t -> sym = KSymTableFind ( tbl, & t -> str );
-        if ( t -> sym != NULL )
-            t -> id = t -> sym -> type;
-    }
-}
-
-/*
- *    physical-decl      = 'physical' [ 'column' ] KCOL '{' <physical-stmts> '}'
- *    physical-stmts     = <physical-stmt> ';' [ <physical-stmts> ]
- *    physical-stmt      = 'read' ( '=' | '+= ) <cond-expr>
- *                       | 'write' ( '=' | '+=' ) <cond-expr>
- *                       | '__untyped' '=' <untyped-expr>
- */
-static
-rc_t physical_mbr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SPhysMember *m )
-{
-    rc_t rc;
-
-    /* determine static flag */
-    if ( t -> id == kw_static )
-    {
-        next_token ( tbl, src, t );
-        m -> stat = true;
-    }
-
-    /* skip keywords */
-    if ( t -> id == kw_physical )
-        next_token ( tbl, src, t );
-    if ( t -> id == kw_column )
-        next_token ( tbl, src, t );
-
-    /* if member type begins with schema parameters... */
-    if ( t -> id == eLeftAngle )
-        rc = phys_encoding_expr ( tbl, src, t, env, self, & m -> td, & m -> type );
-    else
-    {
-        /* get either a typename or a physical column name */
-        rc = next_fqn ( tbl, src, t, env );
-        if ( rc == 0 )
-        {
-            /* column is probably based upon a physical structure */
-            if ( t -> id == ePhysical )
-                rc = phys_encoding_expr ( tbl, src, t, env, self, & m -> td, & m -> type );            
-            else if ( t -> id != eDatatype )
-                return KTokenExpected ( t, klogErr, "typename or physical column type" );
-            else
-                rc = typedecl ( tbl, src, t, env, self, & m -> td );
-        }
-    }
-    if ( rc != 0 )
-        return KTokenFailure ( t, klogErr, rc, "typename or physical column type" );
-
-    /* get name */
-    if ( t -> id != ePeriod )
-        return KTokenExpected ( t, klogErr, "physical name starting with period" );
-    physical_name ( tbl, src, t, env );
-    if ( t -> id == eIdent )
-    {
-        /* enter name into scope */
-        rc = KSymTableCreateConstSymbol ( tbl, & m -> name, & t -> str, ePhysMember, m );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-    else if ( t -> id == ePhysMember )
-        return KTokenExpected ( t, klogErr, "undefined physical member name" );
-    else if ( t -> id != eForward && t -> id != eVirtual )
-        return KTokenExpected ( t, klogErr, "physical member name" );
-    else
-    {
-        m -> name = t -> sym;
-        ( ( KSymbol* ) t -> sym ) -> u . obj = m;
-        ( ( KSymbol* ) t -> sym ) -> type = ePhysMember;
-    }
-
-
-    /* get the assignment expression */
-    if ( next_token ( tbl, src, t ) -> id == eAssign )
-    {
-        rc = cond_expr ( tbl, src, next_token ( tbl, src, t ), env, self, & m -> expr );
-        if ( rc != 0 )
-            return KTokenFailure ( t, klogErr, rc, "assignment expression" );
-    }
-
-    /* expect we're done */
-    return expect ( tbl, src, t, eSemiColon, ";", true );
-}
-
-static
-rc_t physical_member ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    rc_t rc;
-    SPhysMember *m = malloc ( sizeof * m );
-    if ( m == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    else
-    {
-        memset ( m, 0, sizeof * m );
-        rc = physical_mbr ( tbl, src, t, env, self, m );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & table -> phys, & m -> cid . id, m );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        SPhysMemberWhack ( m, NULL );
-    }
-    return rc;
-}
-
-static
-rc_t implicit_physical_member ( KSymTable *tbl, const SchemaEnv *env,
-    STable *table, SColumn *c, KSymbol *sym )
-{
-    rc_t rc;
-    SPhysMember *m = malloc ( sizeof * m );
-    if ( m == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    else
-    {
-        /* create initialized simple physical member */
-        memset ( m, 0, sizeof * m );
-        m -> simple = true;
-
-        /* capture type information */
-        m -> td = c -> td;
-        if ( c -> ptype != NULL )
-        {
-            m -> type = c -> ptype;
-            atomic32_inc ( & ( ( SExpression* ) c -> ptype ) -> refcount );
-        }
-
-        /* link up with name */
-        m -> name = sym;
-        sym -> u . obj = m;
-
-        /* now create simple input expression */
-        rc = SSymExprMake ( & m -> expr, c -> name, eColExpr );
-        if ( rc == 0 )
-            rc = SSymExprMake ( & c -> read, sym, ePhysExpr );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & table -> phys, & m -> cid . id, m );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        SPhysMemberWhack ( m, NULL );
-    }
-    return rc;
-}
-#endif
-
-#if SLVL >= 8
-/*
- * column-stmt        = 'read' '=' <cond-expr>
- *                    | 'validate' '=' <cond-expr>
- *                    | 'limit' '=' UINT_EXPR
- *                    | ';'
- */
-static
-rc_t column_stmt ( KSymTable *tbl, KTokenSource *src, KToken *t,
-     const SchemaEnv *env, VSchema *self, SColumn *c, const char **expected )
-{
-    rc_t rc;
-
-    switch ( t -> id )
-    {
-    case eSemiColon:
-        return 0;
-
-    case kw_read:
-
-        if ( c -> simple )
-            break;
-
-        if ( c -> read != NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcProduction, rcExists );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-        {
-            rc = cond_expr ( tbl, src, t, env, self, & c -> read );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "read expression" );
-            else
-            {
-                if ( c -> read_only )
-                    * expected = "}";
-                else if ( c -> validate == NULL && c -> limit == NULL )
-                    * expected = "validate or limit or }";
-                else if ( c -> validate == NULL )
-                    * expected = "validate or }";
-                else if ( c -> limit == NULL )
-                    * expected = "limit or }";
-                else
-                    * expected = "}";
-                return 0;
-            }
-        }
-        break;
-
-    case kw_validate:
-
-        if ( c -> read_only || c -> simple )
-            break;
-
-        if ( c -> validate != NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcProduction, rcExists );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-        {
-            rc = cond_expr ( tbl, src, t, env, self, & c -> validate );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "validate expression" );
-            else
-            {
-                if ( c -> read == NULL && c -> limit == NULL )
-                    * expected = "read or limit or }";
-                else if ( c -> read == NULL )
-                    * expected = "read or }";
-                else if ( c -> limit == NULL )
-                    * expected = "limit or }";
-                else
-                    * expected = "}";
-                return 0;
-            }
-        }
-        break;
-
-    case kw_limit:
-
-        if ( c -> read_only )
-            break;
-
-        if ( c -> limit != NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcConstraint, rcExists );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-        {
-            rc = const_expr ( tbl, src, t, env, self, & c -> limit );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "limit constraint" );
-            else
-            {
-                if ( c -> read == NULL && c -> validate == NULL )
-                    * expected = "read or validate or }";
-                else if ( c -> read == NULL )
-                    * expected = "read or }";
-                else if ( c -> validate == NULL )
-                    * expected = "validate or }";
-                else
-                    * expected = "}";
-                return 0;
-            }
-        }
-        break;
-    }
-
-    return KTokenExpected ( t, klogErr, * expected );
-}
-
-/*
- * column-body        = '{' <column-stmts> '}'
- * column-stmts       = <column-stmt> ';' [ <column-stmts> ]
- */
-static
-rc_t column_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, SColumn *c )
-{
-    const char *expected;
-
-    rc_t rc = expect ( tbl, src, t, eLeftCurly, "{", true );
-    if ( rc != 0 )
-        return rc;
-
-    expected = c -> read_only ? "read or }" :
-        ( c -> simple ? "limit or }" :  "read or validate or limit or }" );
-
-    while ( t -> id != eRightCurly )
-    {
-        rc = column_stmt ( tbl, src, t, env, self, c, & expected );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eSemiColon, ";", true );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    if ( c -> read == NULL && c -> validate == NULL )
-        c -> simple = true;
-
-    return expect ( tbl, src, t, eRightCurly, "}", true );
-}
-
-/*
- * column-decl        = <typedecl> ID <column-body>
- */
-static
-rc_t typed_column_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table, SColumn *c )
-{
-    rc_t rc = 0;
-
-    /* if column was forwarded, give it a type */
-    if ( t -> id == eForward || t -> id == eVirtual )
-    {
-        c -> name = t -> sym;
-        t -> sym -> type = eColumn;
-    }
-
-    /* catch case where column exists */
-    else if ( t -> id == eColumn )
-    {
-        const SNameOverload *name = t -> sym -> u . obj;
-        if ( VectorFind ( & name -> items, & c -> td, NULL, SColumnCmp ) != NULL )
-            return KTokenExpected ( t, klogErr, "new column name" );
-        c -> name = t -> sym;
-    }
-    else
-    {
-        /* allow names defined in scopes other than table and intrinsic */
-        if ( t -> sym != NULL )
-        {
-            KTokenSourceReturn ( src, t );
-            next_shallow_token ( tbl, src, t, true );
-        }
-
-        if ( t -> id != eIdent )
-            return KTokenExpected ( t, klogErr, "column name" );
-
-        rc = KSymTableCreateConstSymbol ( tbl, & c -> name, & t -> str, eColumn, NULL );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* we have "[ 'readonly' | ... ] 'column' TYPE ID" by now.
-       accept a simple assignment for read/validate,
-       or a semi-colon for implicit physical, or a compound
-       statement body for read/validate/limit statements */
-    switch ( next_token ( tbl, src, t ) -> id )
-    {
-    case eSemiColon:
-
-        /* acceptable unless readonly */
-        if ( c -> read_only )
-            rc = KTokenExpected ( t, klogErr, "= or {" );
-
-        /* this looks like a simple column */
-        c -> simple = true;
-        break;
-
-    case eAssign:
-
-        /* if a simple column ( implicit physical ),
-           then there cannot be a read expression */
-        if ( c -> simple )
-            rc = KTokenExpected ( t, klogErr, "; after simple column" );
-        else
-        {
-            /* simple read expression */
-            next_token ( tbl, src, t );
-            rc = cond_expr ( tbl, src, t, env, self, & c -> read );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "read expression" );
-            else
-                rc = expect ( tbl, src, t, eSemiColon, ";", true );
-        }
-        break;
-
-    case eLeftCurly:
-        /* this is a canonical-form column */
-        rc = column_body ( tbl, src, t, env, self, c );
-        break;
-
-    default:
-        rc = KTokenExpected ( t, klogErr, c -> read_only ? "= or {" : "; or = or {" );
-    }
-
-    /* check for a simple column */
-    if ( rc == 0 && c -> simple )
-    {
-        String physname;
-        char physnamebuff [ 256 ];
-
-        /* check for existence of corresponding physical member */
-        if ( c -> name -> name . size >= sizeof physnamebuff )
-        {
-            /* this is a very long column name... */
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcName, rcExcessive );
-            KTokenFailure ( t, klogErr, rc, "column name" );
-        }
-        else
-        {
-            KSymbol *sym;
-
-            /* tack a dot onto the beginning and look up the symbol */
-            physnamebuff [ 0 ] = '.';
-            memcpy ( & physnamebuff [ 1 ], c -> name -> name . addr, c -> name -> name . size );
-            StringInit ( & physname, physnamebuff, c -> name -> name . size + 1, c -> name -> name . len + 1 );
-            sym = KSymTableFind ( tbl, & physname );
-
-            /* if the symbol exists, then this CANNOT be a simple column */
-            if ( sym != NULL && ! ( sym -> type == eForward || sym -> type == eVirtual ) )
-            {
-                /* check for explicit physical type */
-                if ( c -> ptype != NULL )
-                {
-                    rc = RC ( rcVDB, rcSchema, rcParsing, rcName, rcExists );
-                    KTokenFailure ( t, klogErr, rc, "implicit physical column previously declared" );
-                }
-                else
-                {
-                    rc = RC ( rcVDB, rcSchema, rcParsing, rcExpression, rcNotFound );
-                    KTokenFailure ( t, klogErr, rc, "missing column read or validate expression" );
-                }
-            }
-            else if ( ( c -> td . type_id & 0xC0000000 ) != 0 )
-            {
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcType, rcIncorrect );
-                KTokenFailure ( t, klogErr, rc, "simple columns cannot have typeset as type" );
-            }
-            else
-            {
-                if ( sym != NULL )
-                    sym -> type = ePhysMember;
-                else
-                {
-                    rc = KSymTableCreateSymbol ( tbl, & sym, & physname, ePhysMember, NULL );
-                    if ( rc != 0 )
-                        KTokenFailure ( t, klogErr, rc, "failed to create symbol" );
-                }
-                if ( rc == 0 )
-                {
-                    rc = implicit_physical_member ( tbl, env, table, c, sym );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t column_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table, SColumn *c )
-{
-    rc_t rc;
-
-    /* intercept physical type unless marked read-only */
-    if ( ! c -> read_only )
-    {
-        switch ( t -> id )
-        {
-        case eNamespace:
-            rc = next_fqn ( tbl, src, t, env );
-            if ( rc != 0 )
-                return KTokenFailure ( t, klogErr, rc, "typename or physical column type" );
-            if ( t -> id != ePhysical )
-                break;
-        case ePhysical:
-        case eLeftAngle:
-            rc = phys_encoding_expr ( tbl, src, t, env, self, & c -> td, & c -> ptype );
-            if ( rc != 0 )
-                return KTokenFailure ( t, klogErr, rc, "typename or physical column type" );
-
-            /* this column MUST be simple */
-            c -> simple = true;
-            return typed_column_decl ( tbl, src, t, env, self, table, c );
-        }
-    }
-
-#if ALLOW_COLUMN_TYPESET
-    /* read typedecl or typeset */
-    rc = typespec ( tbl, src, t, env, self, & c -> td );
-#else
-    /* read hard typedecl */
-    rc = typedecl ( tbl, src, t, env, self, & c -> td );
-#endif
-    if ( rc != 0 )
-        return KTokenExpected ( t, klogErr, "column type" );
-
-    /* finish the parse with a normal type */
-    return typed_column_decl ( tbl, src, t, env, self, table, c );
-}
-
-static
-rc_t column_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    rc_t rc;
-    SColumn *c;
-    bool dflt, read_only;
-
-    /* parse 'virtual' and 'default' keywords */
-    for ( dflt = read_only = false;
-          t -> id != kw_column; next_token ( tbl, src, t ) )
-    {
-        switch ( t -> id )
-        {
-        case kw_default:
-            if ( dflt )
-                break;
-            dflt = true;
-            continue;
-
-        case kw_extern:
-            continue;
-
-        case kw_readonly:
-            if ( read_only )
-                break;
-            read_only = true;
-            continue;
-        }
-
-        return KTokenExpected ( t, klogErr, "column" );
-    }
-
-    /* consume 'column' keyword and look for 'default' or 'limit' */
-    switch ( next_token ( tbl, src, t ) -> id )
-    {
-    case kw_default:
-    {
-        KToken t2 = * t;
-        KTokenSource src2 = * src;
-        if ( next_token ( tbl, src, t ) -> id != kw_limit )
-        {
-            * t = t2;
-            * src = src2;
-            break;
-        }
-    }
-    case kw_limit:
-
-        if ( dflt || read_only )
-            break;
-
-        if ( table -> limit != NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcConstraint, rcExists );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eAssign, "=", true );
-        if ( rc == 0 )
-        {
-            rc = const_expr ( tbl, src, t, env, self, & table -> limit );
-            if ( rc != 0 )
-                KTokenFailure ( t, klogErr, rc, "limit constraint" );
-            else
-                rc = expect ( tbl, src, t, eSemiColon, ";", true );
-        }
-        return rc;
-    }
-
-    /* create column object */
-    c = malloc ( sizeof * c );
-    if ( c == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    memset ( c, 0, sizeof * c );
-    c -> dflt = dflt;
-    c -> read_only = read_only;
-
-    /* parse decl */
-    rc = column_decl ( tbl, src, t, env, self, table, c );
-    if ( rc == 0 )
-    {
-        /* give column its own id within table */
-        rc = VectorAppend ( & table -> col, & c -> cid . id, c );
-        if ( rc != 0 )
-            KTokenRCExplain ( t, klogInt, rc );
-        else
-        {
-            void *ignore;
-            SNameOverload *name = ( void* ) c -> name -> u . obj;
-            if ( name == NULL )
-            {
-                rc = SNameOverloadMake ( & name, c -> name, 0, 4 );
-                if ( rc == 0 )
-                {
-                    name -> cid . ctx = -1;
-                    rc = VectorAppend ( & table -> cname, & name -> cid . id, name );
-                    if ( rc != 0 )
-                        SNameOverloadWhack ( name, NULL );
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                rc = VectorInsertUnique ( & name -> items, c, NULL, SColumnSort );
-                if ( rc == 0 )
-                    return 0;
-            }
-
-            /* reverse column insertion */
-            VectorSwap ( & table -> col, c -> cid . id, NULL, & ignore );
-
-            /* what went wrong */
-            KTokenRCExplain ( t, klogInt, rc );
-        }
-    }
-
-    SColumnWhack ( c, NULL );
-    return rc;
-}
-#endif
-
-#if SLVL >= 6
-
-static
-rc_t untyped_tbl_expr ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    const SNameOverload *name;
-
-    /* expecting a function assignment */
-    rc_t rc = expect ( tbl, src,
-        next_token ( tbl, src, t ), eAssign, "=", true );
-    if ( rc == 0 )
-        rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-    if ( t -> id != eUntypedFunc )
-        return KTokenExpected ( t, klogErr, "untyped function expression" );
-    name = t -> sym -> u . obj;
-
-    rc = expect ( tbl, src,
-        next_token ( tbl, src, t ), eLeftParen, "(", true );
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eRightParen, ")", true );
-    if ( rc == 0 )
-        rc = expect ( tbl, src, t, eSemiColon, ";", true );
-
-    if ( rc == 0 )
-    {
-        table -> untyped = VectorLast ( & name -> items );
-        if ( table -> untyped == NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcFunction, rcNotFound );
-            KTokenRCExplain ( t, klogErr, rc );
-        }
-    }
-
-    return rc;
-}
-
-#if SLVL >= 8
-static
-rc_t default_view_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    rc_t rc;
-    bool string_too_long;
-
-    if ( next_token ( tbl, src, t ) -> id != eString )
-        return KTokenExpected ( t, klogErr, "default view declaration" );
-
-    string_too_long = false;
-    if ( t -> str . size >= 236 + 2 )
-    {
-        KTokenExpected ( t, klogWarn, "default view declaration less than 236 characters" );
-        string_too_long = true;
-    }
-
-    rc = expect ( tbl, src, t, eSemiColon, ";", true );
-    if ( rc == 0 && ! string_too_long )
-    {
-        String decl = t -> str;
-        ++ decl . addr;
-        decl . size -= 2;
-        decl . len -= 2;
-
-        if ( table -> dflt_view != NULL )
-            StringWhack ( table -> dflt_view );
-
-        rc = StringCopy ( & table -> dflt_view, & decl );
-    }
-
-    return rc;
-}
-#endif
-
-/*
- * table-local-decl   = [ 'virtual' ] 'column' <column-decl>
- *                    | 'physical' [ 'column' ] <physical-decl>
- *                    | <production_stmt>
- */
-static
-rc_t table_local_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    rc_t rc;
-
-    switch ( t -> id )
-    {
-#if SLVL >= 8
-    case kw_default:
-        if ( env -> default_view_decl )
-        {
-            KToken t2;
-            if ( next_token ( tbl, src, & t2 ) -> id == kw_view )
-                return default_view_decl ( tbl, src, t, env, self, table );
-             KTokenSourceReturn ( src, & t2 );
-        }
-        /* no break */
-    case kw_extern:
-    case kw_column:
-    case kw_readonly:
-        return column_declaration ( tbl, src, t, env, self, table );
-#endif
-#if SLVL >= 7
-    case kw_static:
-    case kw_physical:
-        return physical_member ( tbl, src, t, env, self, table );
-#endif
-    case kw___untyped:
-        return untyped_tbl_expr ( tbl, src, t, env, self, table );
-#if 0
-    case kw_index:
-        break;
-#endif
-    case eSemiColon:
-        next_token ( tbl, src, t );
-        rc = 0;
-        break;
-
-    default:
-        rc = production_stmt ( tbl, src, t, env, self, & table -> prod, eTable );
-        if ( rc == 0 )
-            rc = expect ( tbl, src, t, eSemiColon, ";", true );
-    }
-
-    return rc;
-}
-
-/*
- * table-body         = '{' [ <table-decl-list> ] '}'
- *
- * table-decl-list    = <tbl-local-decl> ';' [ <table-decl-list> ]
- */
-typedef struct STableScanData STableScanData;
-struct STableScanData
-{
-    STable *self;
-    rc_t rc;
-};
-
-static
-bool CC table_fwd_scan ( BSTNode *n, void *data )
-{
-    STableScanData *pb = data;
-    KSymbol *sym = ( KSymbol* ) n;
-    STable *self = pb -> self;
-
-    /* process forwarded symbols */
-    if ( sym -> type == eForward )
-    {
-        /* this symbol was introduced in THIS table */
-        sym -> u . fwd . ctx = self -> id;
-
-        /* add it to the introduced virtual productions and make it virtual */
-        pb -> rc = VectorAppend ( & self -> vprods, & sym -> u . fwd . id, sym );
-        if ( pb -> rc != 0 )
-            return true;
-        sym -> type = eVirtual;
-    }
-    /* symbols other than fwd or virtual are ignored */
-    else if ( sym -> type != eVirtual )
-    {
-        return false;
-    }
-
-    /* add symbol to vector to track ownership */
-    pb -> rc = VectorAppend ( & self -> syms, NULL, sym );
-    if ( pb -> rc != 0 )
-        return true;
-
-    /* remove from symbol table */
-    BSTreeUnlink ( & self -> scope, & sym -> n );
-    return false;
-}
-
-static
-rc_t table_body ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    rc_t rc = expect ( tbl, src, t, eLeftCurly, "{", true );
-    if ( rc != 0 )
-        return rc;
-
-    while ( t -> id != eRightCurly )
-    {
-        rc = table_local_decl ( tbl, src, t, env, self, table );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    rc = expect ( tbl, src, t, eRightCurly, "}", true );
-    if ( rc == 0 )
-    {
-        STableScanData pb;
-        pb . self = table;
-        pb . rc = 0;
-
-        /* scan table scope for unresolved forward references */
-        if ( BSTreeDoUntil ( & table -> scope, false, table_fwd_scan, & pb ) )
-            KTokenRCExplain ( t, klogInt, rc = pb . rc );
-    }
-
-    return rc;
-}
-
-/*
- * table-syntax
- */
-static
-bool CC table_prod_syntax ( void *item, void *data )
-{
-    rc_t *rc = data;
-    const SProduction *prod = ( const SProduction* ) item;
-
-    if ( ! prod -> trigger )
-        * rc = eval_expr_syntax ( prod -> fd );
-    if ( * rc == 0 )
-        * rc = eval_expr_syntax ( prod -> expr );
-
-    return ( * rc != 0 ) ? true : false;
-}
-
-static
-rc_t table_stmt_syntax ( const STable *table )
-{
-    rc_t rc = 0;
-    VectorDoUntil ( & table -> prod, false, table_prod_syntax, & rc );
-    return rc;
-}
-
-#if SLVL >= 8
-static
-bool CC table_typed_column_syntax ( void *item, void *data )
-{
-    rc_t *rc = data;
-    const SColumn *col = ( const SColumn* ) item;
-
-    if ( col -> read != NULL )
-        * rc = eval_expr_syntax ( col -> read );
-    if ( * rc == 0 && col -> validate != NULL )
-        * rc = eval_expr_syntax ( col -> validate );
-    if ( * rc == 0 && col -> limit != NULL )
-        * rc = eval_expr_syntax ( col -> limit );
-
-    return ( * rc != 0 ) ? true : false;
-}
-
-static
-rc_t table_column_syntax ( const STable *table )
-{
-    rc_t rc = 0;
-    VectorDoUntil ( & table -> col, false, table_typed_column_syntax, & rc );
-    return rc;
-}
-#endif
-
-#if SLVL >= 7
-static
-bool CC table_physcol_syntax ( void *item, void *data )
-{
-    rc_t *rc = data;
-    const SPhysMember *col = ( const SPhysMember* ) item;
-
-    if ( col -> expr == NULL )
-        return false;
-
-    * rc = eval_expr_syntax ( col -> expr );
-    return ( * rc != 0 ) ? true : false;
-}
-
-static
-rc_t table_physical_syntax ( const STable *table )
-{
-    rc_t rc = 0;
-    VectorDoUntil ( & table -> phys, false, table_physcol_syntax, & rc );
-    return rc;
-}
-#endif
-
-
-/*
- * push-tbl-scope
- * pop-tbl-scope
- */
-void pop_tbl_scope ( KSymTable *tbl, const STable *table )
-{
-    uint32_t i, count = VectorLength ( & table -> overrides );
-    for ( ++ count, i = 0; i < count; ++ i )
-        KSymTablePopScope ( tbl );
-}
-
-rc_t push_tbl_scope ( KSymTable *tbl, const STable *table )
-{
-    rc_t rc;
-    uint32_t i = VectorStart ( & table -> overrides );
-    uint32_t count = VectorLength ( & table -> overrides );
-    for ( count += i; i < count; ++ i )
-    {
-        const STableOverrides *to = ( const void* ) VectorGet ( & table -> overrides, i );
-        rc = KSymTablePushScope ( tbl, ( BSTree* ) & to -> dad -> scope );
-        if ( rc != 0 )
-        {
-            for ( count = VectorStart ( & table -> overrides ); i > count; -- i )
-                KSymTablePopScope ( tbl );
-            return rc;
-        }
-    }
-
-    rc = KSymTablePushScope ( tbl, ( BSTree* ) & table -> scope );
-    if ( rc != 0 )
-    {
-        for ( i = VectorStart ( & table -> overrides ); i < count; ++ i )
-            KSymTablePopScope ( tbl );
-    }
-
-    return rc;
-}
-
-/*
- * init-tbl-symtab
- *  initializes "tbl"
- *  places table in scope
- *  must be balanced by KSymTableWhack
- */
-rc_t init_tbl_symtab ( KSymTable *tbl, const VSchema *schema, const STable *table )
-{
-    rc_t rc = init_symtab ( tbl, schema );
-    if ( rc == 0 )
-    {
-        rc = push_tbl_scope ( tbl, table );
-        if ( rc == 0 )
-            return 0;
-
-        KSymTableWhack ( tbl );
-    }
-
-    return rc;
-}
-
-
-/*
- * table-decl         = 'table' <fqn> '#' <maj-min-rel>
- *                      [ '=' <table-name> ] <table-body>
- * table-body         = '{' [ <table-stmts> ] '}'
- * table-stmts        = <table-stmt> ';' [ <table-stmts> ]
- */
-static
-rc_t table_decl ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self, STable *table )
-{
-    /* table name */
-    rc_t rc = create_fqn ( tbl, src, t, env, eTable, NULL );
-    if ( rc != 0 && GetRCState ( rc ) != rcExists )
-        return KTokenFailure ( t, klogErr, rc, "table name" );
-    table -> name = t -> sym;
-    table -> src_file = t -> txt -> path;
-    table -> src_line = t -> lineno;
-
-    /* table version */
-    if ( next_token ( tbl, src, t ) -> id != eHash )
-        return KTokenExpected ( t, klogErr, "#" );
-    next_token ( tbl, src, t );
-    rc = maj_min_rel ( tbl, src, t, env, self, & table -> version, true );
-    if ( rc != 0 )
-        return rc;
-
-    /* prepare vectors */
-    VectorInit ( & table -> parents, 0, 4 );
-    VectorInit ( & table -> overrides, 0, 4 );
-    VectorInit ( & table -> col, 0, 16 );
-    VectorInit ( & table -> cname, 0, 16 );
-    VectorInit ( & table -> phys, 0, 16 );
-    VectorInit ( & table -> prod, 0, 64 );
-    VectorInit ( & table -> vprods, 1, 16 );
-    VectorInit ( & table -> syms, 1, 32 );
-
-    /* look for inheritance */
-    if ( t -> id == eAssign ) do
-    {
-        const STable *dad;
-        const SNameOverload *name;
-
-        /* look for dad */
-        rc = next_fqn ( tbl, src, next_token ( tbl, src, t ), env );
-        if ( rc != 0 )
-            return KTokenFailure ( t, klogErr, rc, "table name" );
-
-        /* insist that dad be a table */
-        if ( t -> id != eTable )
-            return KTokenExpected ( t, klogErr, "table name" );
-        name = t -> sym -> u . obj;
-
-        /* check for version */
-        if ( next_token ( tbl, src, t ) -> id != eHash )
-            dad = VectorLast ( & name -> items );
-        else
-        {
-            uint32_t vers;
-            next_token ( tbl, src, t );
-            rc = maj_min_rel ( tbl, src, t, env, self, & vers, true );
-            if ( rc != 0 )
-                return rc;
-            dad = VectorFind ( & name -> items, & vers, NULL, STableCmp );
-#if _DEBUGGING && 1
-            if ( dad != NULL && dad -> version > vers )
-            {
-                PLOGMSG ( klogInfo, ( klogInfo
-                                      , "table_decl: table '$(tbl)' specifies parent table '$(parent)' - should be $(actual_version)"
-                                      , "tbl=%N#%.3V,parent=%N#%.3V,actual_version=#%.3V"
-                                      , table -> name, table -> version
-                                      , dad -> name, vers
-                                      , dad -> version
-                              ));
-            }
-#endif
-        }
-
-        /* dad should be found */
-        if ( dad == NULL )
-        {
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcTable, rcNotFound );
-            return KTokenRCExplain ( t, klogErr, rc );
-        }
-
-        /* take the inheritance */
-        rc = STableExtend ( tbl, table, dad );
-        if ( rc != 0 )
-            return KTokenRCExplain ( t, klogInt, rc );
-    }
-    while ( t -> id == eComma );
-
-    /* enter table into scope */
-    rc = push_tbl_scope ( tbl, table );
-    if ( rc == 0 )
-    {
-        /* scan override tables for virtual symbols */
-        if ( VectorDoUntil ( & table -> overrides, false, STableScanVirtuals, tbl ) )
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-        /* parse the definition */
-        else
-            rc = table_body ( tbl, src, t, env, self, table );
-
-        /* pop out of scope */
-        pop_tbl_scope ( tbl, table );
-    }
-
-    /* fix forward references */
-    if ( rc == 0 )
-    {
-        rc = table_stmt_syntax ( table );
-#if SLVL >= 8
-        if ( rc == 0 )
-            rc = table_column_syntax ( table );
-#endif
-#if SLVL >= 7
-        if ( rc == 0 )
-            rc = table_physical_syntax ( table );
-#endif
-    }
-
-    return rc;
-}
-
-static
-void CC column_set_context ( void *item, void *data )
-{
-    SColumn *self = item;
-    self -> cid . ctx = * ( const uint32_t* ) data;
-}
-
-static
-void CC name_set_context ( void *item, void *data )
-{
-    SNameOverload *self = item;
-    if ( ( int32_t ) self -> cid . ctx < 0 )
-        self -> cid . ctx = * ( const uint32_t* ) data;
-}
-
-static
-void CC physical_set_context ( void *item, void *data )
-{
-    SPhysMember *self = item;
-    self -> cid . ctx = * ( const uint32_t* ) data;
-}
-
-static
-void CC production_set_context ( void *item, void *data )
-{
-    SProduction *self = item;
-    self -> cid . ctx = * ( const uint32_t* ) data;
-}
-
-static
-void CC symbol_set_context ( void *item, void *data )
-{
-    KSymbol *self = item;
-    self -> u . fwd . ctx = * ( const uint32_t* ) data;
-}
-
-static
-void table_set_context ( STable *self )
-{
-    VectorForEach ( & self -> col, false, column_set_context, & self -> id );
-    VectorForEach ( & self -> cname, false, name_set_context, & self -> id );
-    VectorForEach ( & self -> phys, false, physical_set_context, & self -> id );
-    VectorForEach ( & self -> prod, false, production_set_context, & self -> id );
-    VectorForEach ( & self -> vprods, false, symbol_set_context, & self -> id );
-}
-
-#if NO_UPDATE_TBL_REF || 0
-#define schema_update_tbl_ref( self, exist, table ) \
-    0
-#else
-typedef struct update_tbl_ref_data update_tbl_ref_data;
-struct update_tbl_ref_data
-{
-    const STable *exist, *table;
-    rc_t rc;
-};
-
-static
-bool CC table_update_tbl_ref ( void *item, void *data )
-{
-    STable *self = item;
-    update_tbl_ref_data *pb = data;
-
-    bool is_ancestor;
-
-    /* check for having this guy as an immediate parent */
-    uint32_t i = VectorStart ( & self -> parents );
-    uint32_t count = VectorLength ( & self -> parents );
-    for ( count += i; i < count; ++ i )
-    {
-        STable *dad = VectorGet ( & self -> parents, i );
-        if ( ( const STable* ) dad == pb -> exist )
-        {
-            void *ignore;
-            VectorSwap ( & self -> parents, i, pb -> table, & ignore );
-            PARSE_DEBUG (( "table_update_tbl_ref: replaced parent '%N#%.3V' with version #%.3V in table '%N#%.3V'.\n"
-                           , dad -> name, dad -> version
-                           , pb -> table -> version
-                           , self -> name, self -> version
-                ));
-            break;
-        }
-    }
-
-    /* check for having him in the ancestry somewhere */
-    i = VectorStart ( & self -> overrides );
-    count = VectorLength ( & self -> overrides );
-    for ( is_ancestor = false, count += i; i < count; ++ i )
-    {
-        STableOverrides *to = VectorGet ( & self -> overrides, i );
-        if ( to -> dad == pb -> exist )
-        {
-            is_ancestor = true;
-
-            /* rewrite overrides to have updated parent */
-            VectorWhack ( & to -> overrides, NULL, NULL );
-            pb -> rc = VectorCopy ( & pb -> table -> vprods, & to -> overrides );
-            if ( pb -> rc != 0 )
-                return true;
-            to -> dad = pb -> table;
-            to -> ctx = pb -> table -> id;
-            VectorReorder ( & self -> overrides, STableOverridesKSort, NULL );
-            PARSE_DEBUG (( "table_update_tbl_ref: replaced ancestor '%N#%.3V' with version #%.3V in table '%N#%.3V'.\n"
-                           , pb -> exist -> name, pb -> exist -> version
-                           , pb -> table -> version
-                           , self -> name, self -> version
-                ));
-        }
-    }
-
-    /* if he's not an ancestor, we're done */
-    if ( ! is_ancestor )
-        return false;
-
-    /* remove columns from old parent */
-    i = VectorStart ( & self -> cname );
-    count = VectorLength ( & self -> cname );
-    for ( count += i; i < count; ++ i )
-    {
-        Vector cv;
-        uint32_t cx, cnt;
-        SNameOverload *name = VectorGet ( & self -> cname, i );
-
-        /* names originating in existing parent get mapped */
-        if ( name -> cid . ctx == pb -> exist -> id )
-        {
-            name -> cid . ctx = pb -> table -> id;
-            PARSE_DEBUG (( "table_update_tbl_ref: updated context of column name '%N' from %u to %u.\n"
-                           , name -> name
-                           , pb -> exist -> id
-                           , pb -> table -> id
-                ));
-        }
-
-        /* now copy over columns, but eliminate all from old parent */
-        cx = VectorStart ( & name -> items );
-        cnt = VectorLength ( & name -> items );
-        VectorInit ( & cv, cx, cnt );
-        for ( cnt += cx; cx < cnt; ++ cx )
-        {
-            SColumn *c = VectorGet ( & name -> items, cx );
-            if ( c -> cid . ctx == pb -> exist -> id )
-            {
-                PARSE_DEBUG (( "table_update_tbl_ref: dropping column index %u from name '%N'.\n"
-                               , cx
-                               , name -> name
-                    ));
-            }
-            else
-            {
-                pb -> rc = VectorAppend ( & cv, NULL, c );
-                if ( pb -> rc != 0 )
-                    return true;
-            }
-        }
-        VectorWhack ( & name -> items, NULL, NULL );
-        name -> items = cv;
-    }
-
-    /* add in all columns from new parent */
-    if ( VectorDoUntil ( & pb -> table -> cname, false, STableCopyColumnNames, self ) )
-    {
-        pb -> rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return true;
-    }
-
-    return false;
-}
-
-static
-bool CC tblmbr_update_tbl_ref ( void *item, void *data )
-{
-    STblMember *self = item;
-    update_tbl_ref_data *pb = data;
-
-    if ( self -> tbl == pb -> exist )
-    {
-        PARSE_DEBUG (( "tblmbr_update_tbl_ref: updated table member '%N %N' from %V to %V.\n"
-                       , pb -> exist -> name
-                       , self -> name
-                       , pb -> exist -> version
-                       , pb -> table -> version
-                ));
-        self -> tbl = pb -> table;
-    }
-
-    return false;
-}
-
-static
-bool CC db_update_tbl_ref ( void *item, void *data )
-{
-    SDatabase *self = item;
-
-    /* update table members */
-    if ( VectorDoUntil ( & self -> tbl, false, tblmbr_update_tbl_ref, data ) )
-        return true;
-
-    return VectorDoUntil ( & self -> db, false, db_update_tbl_ref, data );
-}
-
-static
-rc_t schema_update_tbl_ref ( VSchema *self, const STable *exist, const STable *table )
-{
-    update_tbl_ref_data pb;
-    pb . exist = exist;
-    pb . table = table;
-    pb . rc = 0;
-
-    if ( ! VectorDoUntil ( & self -> tbl, false, table_update_tbl_ref, & pb ) )
-          VectorDoUntil ( & self -> db, false, db_update_tbl_ref, & pb );
-
-    return pb . rc;
-}
-#endif
-
-rc_t table_declaration ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    rc_t rc;
-    void *ignore;
-
-    STable *table = calloc ( 1, sizeof * table );
-    if ( table == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    rc = table_decl ( tbl, src, t, env, self, table );
-    if ( rc == 0 )
-    {
-        SNameOverload *name = ( void* ) table -> name -> u . obj;
-        if ( name == NULL )
-        {
-            rc = SNameOverloadMake ( & name, table -> name, 0, 4 );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( & self -> tname, & name -> cid . id, name );
-                if ( rc != 0 )
-                    SNameOverloadWhack ( name, NULL );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> tbl, & table -> id, table );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-
-                /* set the table id on all members */
-                table_set_context ( table );
-
-                /* add to named table overrides */
-                rc = VectorInsertUnique ( & name -> items, table, & idx, STableSort );
-                if ( rc == 0 )
-                    return 0;
-
-                if ( GetRCState ( rc ) == rcExists )
-                {
-                    const STable *newer;
-                    STable *exist = VectorGet ( & name -> items, idx );
-                    rc = STableCompare ( exist, table, & newer, false );
-                    if ( rc == 0 && newer == table )
-                    {
-                        /* put the new one in place of the existing */
-                        VectorSwap ( & name -> items, idx, table, & ignore );
-
-                        /* tell everyone to use new table */
-                        return schema_update_tbl_ref ( self, exist, table );
-                    }
-                }
-
-                VectorSwap ( & self -> tbl, table -> id, NULL, & ignore );
-            }
-        }
-    }
-    else if ( GetRCState ( rc ) == rcExists )
-    {
-        rc = 0;
-    }
-
-    STableWhack ( table, NULL );
-
-    return rc;
-}
-
-#endif
diff --git a/libs/vdb/schema-tok.c b/libs/vdb/schema-tok.c
deleted file mode 100644
index 94a456d..0000000
--- a/libs/vdb/schema-tok.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include "schema-tok.h"
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KToken
- */
-
-
-rc_t KTokenRCExplain ( const KToken *self, KLogLevel lvl, rc_t rc )
-{
-    if ( rc != 0 )
-    {
-        PLOGERR (lvl, ( lvl, rc, "$(file):$(lineno)", "file=%.*s,lineno=%u"
-                   , ( int ) self -> txt -> path . size, self -> txt -> path . addr
-                   , self -> lineno ));
-    }
-    return rc;
-}
-
-rc_t KTokenFailure ( const KToken *self, KLogLevel lvl, rc_t rc, const char *expected )
-{
-    if ( GetRCState ( rc ) != rcUnexpected )
-        return KTokenRCExplain ( self, lvl, rc );
-
-    PLOGMSG ( lvl, ( lvl, "$(file):$(lineno): "
-               "expected '$(expected)' but found '$(found)'",
-               "file=%.*s,lineno=%u,expected=%s,found=%.*s"
-               , ( int ) self -> txt -> path . size, self -> txt -> path . addr
-               , self -> lineno
-               , expected
-               , ( int ) self -> str . size, self -> str . addr ));
-
-    return rc;
-}
-
-rc_t KTokenExpected ( const KToken *self, KLogLevel lvl, const char *expected )
-{
-    return KTokenFailure ( self, lvl,
-        RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected ), expected );
-}
diff --git a/libs/vdb/schema-tok.h b/libs/vdb/schema-tok.h
deleted file mode 100644
index bdad9dd..0000000
--- a/libs/vdb/schema-tok.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_schema_tok_
-#define _h_schema_tok_
-
-#ifndef _h_klib_token_
-#include <klib/token.h>
-#endif
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-/*--------------------------------------------------------------------------
- * KToken
- *  a string with an id
- */
-
-
-/* common error reporting
- */
-rc_t KTokenExpected ( const KToken *self, KLogLevel lvl, const char *expected );
-rc_t KTokenFailure ( const KToken *self, KLogLevel lvl, rc_t rc, const char *expected );
-rc_t KTokenRCExplain ( const KToken *self, KLogLevel lvl, rc_t rc );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_schema_tok_ */
diff --git a/libs/vdb/schema-type.c b/libs/vdb/schema-type.c
deleted file mode 100644
index 0bb5186..0000000
--- a/libs/vdb/schema-type.c
+++ /dev/null
@@ -1,2582 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-expr.h"
-#include "schema-dump.h"
-#include "dbmgr-priv.h"
-
-#include <sra/types.h>
-#include <klib/symbol.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * SFormat
- */
-
-/* Find
- */
-SFormat *VSchemaFindFmtid ( const VSchema *self, uint32_t id )
-{
-    SFormat *fmt = VectorGet ( & self -> fmt, id );
-    while ( fmt == NULL )
-    {
-        self = self -> dad;
-        if ( self == NULL )
-            break;
-        fmt = VectorGet ( & self -> fmt, id );
-    }
-    return fmt;
-}
-
-/* Mark
- */
-void CC SFormatClearMark ( void *item, void *ignore )
-{
-    SFormat *self = item;
-    self -> marked = false;
-}
-
-void SFormatMark ( const SFormat *cself )
-{
-    SFormat *self = ( SFormat* ) cself;
-    if ( cself != NULL && ! cself -> marked )
-    {
-        self -> marked = true;
-        SFormatMark ( self -> super );
-    }
-}
-
-
-/* Dump
- *  dump "fmtdef", dump object
- */
-rc_t SFormatDump ( const SFormat *self, SDumper *b )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, b );
-}
-
-bool CC SFormatDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const SFormat *self = ( const void* ) item;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    if ( SDumperMode ( b ) == sdmCompact )
-    {
-        b -> rc = ( self -> super != NULL ) ?
-            SDumperPrint ( b, "fmtdef %N %N;", self -> super -> name, self -> name ):
-            SDumperPrint ( b, "fmtdef %N;", self -> name );
-    }
-    else
-    {
-        b -> rc = ( self -> super != NULL ) ?
-            SDumperPrint ( b, "fmtdef %N %N;\n", self -> super -> name, self -> name ):
-            SDumperPrint ( b, "fmtdef %N;\n", self -> name );
-    }
-
-    if ( b -> rc == 0 )
-        b -> rc = AliasDump ( self -> name, b );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-
-
-/*--------------------------------------------------------------------------
- * SDatatype
- */
-
-/* IntrinsicDim
- */
-#if SLVL >= 1
-uint32_t SDatatypeIntrinsicDim ( const SDatatype *self )
-{
-    uint32_t dim = 1;
-    while ( 1 )
-    {
-        /* if type has no supertype or supertype is opaque
-           then this is the base intrinsic type */
-        const SDatatype *super = self -> super;
-        if ( super == NULL || super -> domain == 0 )
-            break;
-
-        /* accumulate the vector dimension of this type */
-        dim *= self -> dim;
-        self = super;
-    }
-
-    return dim;
-}
-
-/* Find
- */
-SDatatype *VSchemaFindTypeid ( const VSchema *self, uint32_t id )
-{
-    SDatatype *dt = VectorGet ( & self -> dt, id );
-    while ( dt == NULL )
-    {
-        self = self -> dad;
-        if ( self == NULL )
-            break;
-        dt = VectorGet ( & self -> dt, id );
-    }
-    return dt;
-}
-
-
-/* DescribeTypedecl
- *  produce a description of typedecl properties
- */
-LIB_EXPORT rc_t CC VSchemaDescribeTypedecl ( const VSchema *self,
-    VTypedesc *desc, const VTypedecl *td )
-{
-    rc_t rc;
-    if ( desc == NULL )
-        rc = RC ( rcVDB, rcSchema, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcAccessing, rcSelf, rcNull );
-        else if ( td == NULL )
-            rc = RC ( rcVDB, rcSchema, rcAccessing, rcParam, rcNull );
-        else
-        {
-            const SDatatype *dt = VSchemaFindTypeid ( self, td -> type_id );
-            if ( dt == NULL )
-                rc = RC ( rcVDB, rcSchema, rcAccessing, rcType, rcNotFound );
-            else
-            {
-                /* initial dimension from typedecl itself */
-                desc -> intrinsic_dim = td -> dim ? td -> dim : 1;
-
-                /* domain comes from the original type */
-                desc -> domain = dt -> domain;
-
-                while ( 1 )
-                {
-                    const SDatatype *super = dt -> super;
-                    if ( super == NULL || super -> domain == 0 )
-                        break;
-
-                    /* become supertype */
-                    assert ( super != dt );
-                    desc -> intrinsic_dim *= dt -> dim;
-                    dt = super;
-                }
-
-                /* take size from intrinsic */
-                desc -> intrinsic_bits = dt -> size;
-                return 0;
-            }
-        }
-
-        memset ( desc, 0, sizeof * desc );
-    }
-    return rc;
-}
-
-
-/* DescribeTypedef - PRIVATE
- *  a type is defined as either:
- *
- *     'typedef' <type> ';'
- *  or
- *     'typedef' <supertype> <type> '[' <dim> ']' ';'
- */
-LIB_EXPORT rc_t CC VSchemaDescribeTypedef ( const VSchema *self,
-    VTypedef *def, uint32_t type_id )
-{
-    rc_t rc;
-    if ( def == NULL )
-        rc = RC ( rcVDB, rcSchema, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            const SDatatype *dt = VSchemaFindTypeid ( self, type_id );
-            if ( dt == NULL )
-                rc = RC ( rcVDB, rcSchema, rcAccessing, rcType, rcNotFound );
-            else
-            {
-                /* id of <type> */
-                def -> type_id = dt -> id;
-
-                /* check for supertype */
-                if ( dt -> super == NULL )
-                {
-                    /* null id */
-                    def -> super_id = 0;
-                    /* sizeof ( <type> ) in bits */
-                    def -> type_size = dt -> size;
-                    assert ( dt -> dim <= 1 );
-                }
-                else
-                {
-                    /* id of <supertype> */
-                    def -> super_id = dt -> super -> id;
-                    /* sizeof ( <super-type> ) in bits */
-                    def -> type_size = dt -> super -> size;
-                }
-
-                /* 'dim' from 'typedef <supertype> <type> [ dim ];' */
-                def -> dim = dt -> dim;
-
-                /* the only bit of domain information is whether the type is signed */
-                def -> sign = 0;
-                switch ( dt -> domain )
-                {
-                case vtdInt:
-                case vtdFloat:
-                    def -> sign = 1;
-                    break;
-                }
-
-                return 0;
-            }
-        }
-
-        memset ( def, 0, sizeof * def );
-    }
-
-    return rc;
-}
-
-/* Mark
- */
-void CC SDatatypeClearMark ( void *item, void *ignore )
-{
-    SDatatype *self = item;
-    self -> marked = false;
-}
-
-void SDatatypeMark ( const SDatatype *cself )
-{
-    SDatatype *self = ( SDatatype* ) cself;
-    if ( cself != NULL && ! cself -> marked )
-    {
-        self -> marked = true;
-        SDatatypeMark ( self -> super );
-    }
-}
-
-/* Dump
- */
-rc_t SDatatypeDump ( const SDatatype *self, SDumper *d )
-{
-    return FQNDump ( self != NULL ? self -> name : NULL, d );
-}
-
-bool CC SDatatypeDefDump ( void *item, void *data )
-{
-    SDumper *b = data;
-    const char *dimfmt;
-    const SDatatype *self = ( const void* ) item;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    switch ( SDumperMode ( b ) )
-    {
-    case sdmCompact:
-        dimfmt = "[%u]"; break;
-    default:
-        dimfmt = " [ %u ]";
-    }
-
-    b -> rc = SDumperPrint ( b, "typedef %N %N",
-        self -> super -> name, self -> name );
-    if ( b -> rc == 0 && self -> dim > 1 )
-        b -> rc = SDumperPrint ( b, dimfmt, self -> dim );
-    if ( b -> rc == 0 )
-    {
-        if ( SDumperMode ( b ) == sdmCompact )
-            b -> rc = SDumperWrite ( b, ";", 1 );
-        else
-        {
-#if _DEBUGGING && 1
-            b -> rc = SDumperPrint ( b, "; /* size %u */\n", self -> size );
-#else
-            b -> rc = SDumperWrite ( b, ";\n", 2 );
-#endif
-        }
-    }
-
-    if ( b -> rc == 0 )
-        b -> rc = AliasDump ( self -> name, b );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * STypesetMbr
- *  a typedecl that can be tested for uniqueness
- */
-typedef struct STypesetMbr STypesetMbr;
-struct STypesetMbr
-{
-    BSTNode n;
-    VTypedecl td;
-};
-
-/* Whack
- */
-#define STypesetMbrWhack BSTreeMbrWhack
-
-/* Cmp
- * Sort
- */
-static
-int VTypedeclCmp ( const VTypedecl *a, const VTypedecl *b )
-{
-    if ( a -> type_id != b -> type_id )
-        return ( int ) a -> type_id - ( int ) b -> type_id;
-    return ( int ) a -> dim - ( int ) b -> dim;
-}
-
-static
-int CC STypesetMbrSort ( const BSTNode *item, const BSTNode *n )
-{
-    const STypesetMbr *a = ( const STypesetMbr* ) item;
-    const STypesetMbr *b = ( const STypesetMbr* ) n;
-    return VTypedeclCmp ( & a -> td, & b -> td );
-}
-
-
-/*--------------------------------------------------------------------------
- * VTypedecl
- */
-
-#if SLVL >= 1
-
-/* ToText
- *  convert a VTypedecl into canonical text
- *
- *  "buffer" [ OUT ] and "bsize" [ IN ] - output buffer for
- *  NUL terminated type declaration string
- *
- *  "fmtdecl" [ IN ] - binary representation of fmtdecl
- */
-LIB_EXPORT rc_t CC VTypedeclToText ( const VTypedecl *self,
-    const VSchema *schema, char *buffer, size_t bsize )
-{
-    rc_t rc;
-
-    if ( bsize == 0 )
-        rc = RC ( rcVDB, rcType, rcConverting, rcBuffer, rcInsufficient );
-    else if ( buffer == NULL )
-        rc = RC ( rcVDB, rcType, rcConverting, rcBuffer, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcType, rcConverting, rcSelf, rcNull );
-        else if ( schema == NULL )
-            rc = RC ( rcVDB, rcType, rcConverting, rcSchema, rcNull );
-        else
-        {
-            size_t num_writ;
-            rc = VSchemaToText ( schema, buffer, bsize - 1, & num_writ, "%T", self );
-            if ( rc == 0 )
-            {
-                buffer [ num_writ ] = 0;
-                return 0;
-            }
-        }
-
-        buffer [ 0 ] = 0;
-    }
-
-    return rc;
-}
-
-
-/* ToSupertype
- *  attempt to cast a typedecl to a size-equivalent supertype decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "cast" [ OUT ] - return parameter for supertype decl
- *  valid only if function returns true.
- *
- *  returns true if cast succeeded
- */
-LIB_EXPORT bool CC VTypedeclToSupertype ( const VTypedecl *self,
-    const VSchema *schema, VTypedecl *cast )
-{
-    if ( self != NULL && schema != NULL )
-    {
-        const SDatatype *dt = VSchemaFindTypeid ( schema, self -> type_id );
-        if ( dt != NULL )
-        {
-            uint32_t dim = dt -> dim;
-            dt = dt -> super;
-            if ( dt != NULL && dt -> domain != 0 )
-            {
-                if ( cast != NULL )
-                {
-                    cast -> type_id = dt -> id;
-                    cast -> dim = self -> dim * dim;
-                }
-
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-
-/* ToTypedecl
- *  attempt to cast a typedecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target typedecl or typeset for cast
- *
- *  "cast" [ OUT, NULL ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" was a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
- *  generations. valid only if function returns true. a value of 0 means
- *  that "self" is a direct match with "ancestor", a value of 1 means that
- *  "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-static
-bool VTypedecl2Typedecl ( const VTypedecl *self,
-    const VSchema *schema, const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance )
-{
-    const SDatatype *src;
-    uint32_t i, type_id = self -> type_id;
-    uint32_t gramps = ancestor -> type_id;
-    uint32_t dim = self -> dim;
-
-    /* casting from "any" */
-    if ( type_id == 0 )
-    {
-        /* "any" to "any" isn't a cast... or is it? */
-        if ( gramps == 0 )
-            return false;
-
-        /* produce output */
-        if ( cast != NULL && ( const VTypedecl* ) cast != ancestor )
-            * cast = * ancestor;
-
-        /* record distance */
-        if ( distance != NULL )
-            * distance = 0;
-
-        return true;
-    }
-
-    /* casting to "any" */
-    if ( gramps == 0 )
-    {
-        /* produce output */
-        if ( cast != NULL && ( const VTypedecl* ) cast != self )
-            * cast = * self;
-
-        /* record distance */
-        if ( distance != NULL )
-            * distance = 0;
-
-        return true;
-    }
-
-    /* special case for identity */
-    if ( type_id == gramps )
-    {
-        /* detect variable dimension */
-        if ( dim == 0 )
-        {
-            dim = ancestor -> dim;
-            if ( ancestor -> dim == 0 )
-                return false;
-        }
-
-        /* if ancestor has variable dimension */
-        if ( ancestor -> dim == 0 )
-        {
-            if ( cast != NULL )
-            {
-                cast -> type_id = type_id;
-                cast -> dim = dim;
-            }
-        }
-        else
-        {
-            /* must have identical fixed dimension */
-            if ( dim != ancestor -> dim )
-                return false;
-
-            /* produce output */
-            if ( cast != NULL && ( const VTypedecl* ) cast != ancestor )
-                * cast = * ancestor;
-        }
-
-        /* record distance */
-        if ( distance != NULL )
-            * distance = 0;
-
-        return true;
-    }
-    /***** Temporary fix for duplicate types****/
-    {
-	char bufa[100];
-	char bufb[100];
-	if(   self->dim == ancestor->dim
-	   && VTypedeclToText(     self, schema, bufa, sizeof(bufa))== 0
-           && VTypedeclToText( ancestor, schema, bufb, sizeof(bufb))== 0
-           && strcmp(bufa,bufb) == 0){
-		if ( cast != NULL && ( const VTypedecl* ) cast != ancestor ) * cast = * ancestor;
-		if ( distance != NULL ) * distance = 0;
-		return true;
-        }
-    }
-	
-    /************************/
-
-    /* find type */
-    src = VSchemaFindTypeid ( schema, type_id );
-    if ( src == NULL )
-        return false;
-
-    /* cast toward gramps */
-    for ( i = 0; src -> id > gramps; ++ i )
-    {
-        dim *= src -> dim;
-        src = src -> super;
-        if ( src == NULL || src -> domain == 0 )
-            return false;
-    }
-
-    /* if not met */
-    if ( src -> id != gramps )
-        return false;
-
-    /* handle variable dimension */
-    if ( dim == 0 )
-    {
-        dim = ancestor -> dim;
-        if ( ancestor -> dim == 0 )
-            return false;
-    }
-    if ( ancestor -> dim == 0 )
-    {
-        if ( cast != NULL )
-        {
-            cast -> type_id = gramps;
-            cast -> dim = dim;
-        }
-    }
-    else
-    {
-        if ( dim != ancestor -> dim )
-            return false;
-        if ( cast != NULL && ( const VTypedecl* ) cast != ancestor )
-            * cast = * ancestor;
-    }
-
-    /* produce output */
-    if ( distance != NULL )
-        * distance = i;
-                            
-    return true;
-}
-
-static
-bool STypesetdecl2Typedecl ( const STypeset *self, uint32_t sdim,
-    const VSchema *schema,  const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance )
-{
-    bool early;
-    VTypedecl btd;
-    uint32_t i, count, best;
-
-    /* ambiguous if casting to "any" */
-    if ( ancestor -> type_id == 0 )
-        return false;
-
-    /* can exit early if only testing castability */
-    early = ( cast == NULL && distance == NULL ) ? true : false;
-
-    /* walk set */
-    for ( best = ~ 0U, count = self -> count, i = 0; i < count; ++ i )
-    {
-        uint32_t dist;
-
-        /* convert set member to vector */
-        VTypedecl td = self -> td [ i ];
-        td . dim *= sdim;
-
-        /* cast to ancestor */
-        if ( VTypedecl2Typedecl ( & td, schema, ancestor, & td, & dist ) )
-        {
-            /* if only testing castability */
-            if ( early )
-                return true;
-
-            /* if match is better */
-            if ( dist < best )
-            {
-                if ( distance != NULL )
-                    * distance = dist;
-                if ( dist == 0 )
-                {
-                    if ( cast != NULL )
-                        * cast = td;
-                    return true;
-                }
-
-                btd = td;
-                best = dist;
-            }
-        }
-    }
-
-    if ( ( int32_t ) best > 0 )
-    {
-        if ( cast != NULL )
-            * cast = btd;
-        return true;
-    }
-
-    return false;
-}
-
-static
-bool VTypedecl2STypesetdecl ( const VTypedecl *self,
-    const VSchema *schema, const STypeset *dst, uint32_t ddim,
-    VTypedecl *cast, uint32_t *distance )
-{
-    const SDatatype *src;
-    uint32_t i, j, count, type_id, sdim;
-
-    /* ambiguous if casting from "any" */
-    if ( self -> type_id == 0 )
-        return false;
-
-    /* find source type */
-    src = VSchemaFindTypeid ( schema, self -> type_id );
-    if ( src == NULL )
-        return false;
-
-    /* current dimension */
-    sdim = self -> dim;
-
-    /* perform cast */
-    for ( count = dst -> count, type_id = src -> id, i = 0; ; type_id = src -> id, ++ i )
-    {
-        /* scan set for type match */
-        for ( j = 0; j < count; ++ j )
-        {
-            if ( type_id == dst -> td [ j ] . type_id )
-            {
-                /* this is a hit on type */
-                if ( sdim == dst -> td [ j ] . dim * ddim )
-                {
-                    /* best match is first match */
-                    if ( distance != NULL )
-                        * distance = i;
-                    if ( cast != NULL )
-                    {
-                        cast -> type_id = type_id;
-                        cast -> dim = sdim;
-                    }
-                    return true;
-                }
-                break;
-            }
-        }
-
-        /* did not match any of them */
-        sdim *= src -> dim;
-        src = src -> super;
-        if ( src == NULL || src -> domain == 0 )
-            break;
-    }
-
-    return false;
-}
-
-static
-bool VTypesetdeclToTypedecl ( const VTypedecl *self,
-    const VSchema *schema,  const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance )
-{
-    /* find source typeset */
-    const STypeset *src = VSchemaFindTypesetid ( schema, self -> type_id );
-
-    /* not found or empty */
-    if ( src == NULL || src -> count == 0 )
-        return false;
-
-    /* if has single type */
-    if ( src -> count == 1 )
-    {
-        VTypedecl td = src -> td [ 0 ];
-        td . dim *= self -> dim;
-        return VTypedecl2Typedecl ( & td, schema, ancestor, cast, distance );
-    }
-
-    /* perform cast */
-    return STypesetdecl2Typedecl ( src, self -> dim, schema, ancestor, cast, distance );
-}
-
-static
-bool VTypedeclToTypesetdecl ( const VTypedecl *self,
-    const VSchema *schema,  const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance )
-{
-    /* find ancestor typeset */
-    const STypeset *dst = VSchemaFindTypesetid ( schema, ancestor -> type_id );
-
-    /* if not found or empty */
-    if ( dst == NULL || dst -> count == 0 )
-        return false;
-
-    /* if has a single type */
-    if ( dst -> count == 1 )
-    {
-        VTypedecl td = dst -> td [ 0 ];
-        td . dim *= ancestor -> dim;
-        return VTypedecl2Typedecl ( self, schema, & td, cast, distance );
-    }
-
-    /* find best match */
-    return VTypedecl2STypesetdecl ( self, schema, dst, ancestor -> dim, cast, distance );
-}
-
-static
-bool VTypesetdeclToTypesetdecl ( const VTypedecl *self,
-    const VSchema *schema,  const VTypedecl *ancestor,
-    VTypedecl *cast, uint32_t *distance )
-{
-    bool early;
-    VTypedecl btd, td;
-    uint32_t i, count, best;
-    const STypeset * src, *dst;
-
-    /* find source typeset */
-    src = VSchemaFindTypesetid ( schema, self -> type_id );
-
-    /* not found or empty */
-    if ( src == NULL || src -> count == 0 )
-        return false;
-
-    /* find ancestor typeset */
-    dst = VSchemaFindTypesetid ( schema, ancestor -> type_id );
-
-    /* if not found or empty */
-    if ( dst == NULL || dst -> count == 0 )
-        return false;
-
-    /* if has a single type */
-    if ( src -> count == 1 )
-    {
-        td = src -> td [ 0 ];
-        td . dim *= self -> dim;
-        if ( dst -> count == 1 )
-        {
-            btd = dst -> td [ 0 ];
-            btd . dim *= ancestor -> dim;
-            return VTypedecl2Typedecl ( & td, schema, & btd, cast, distance );
-        }
-        return VTypedecl2STypesetdecl ( & td, schema, dst, ancestor -> dim, cast, distance );
-    }
-    if ( dst -> count == 1 )
-    {
-        td = dst -> td [ 0 ];
-        td . dim *= ancestor -> dim;
-        return STypesetdecl2Typedecl ( src, self -> dim, schema, & td, cast, distance );
-    }
-
-    /* can exit early if only testing castability */
-    early = ( cast == NULL && distance == NULL ) ? true : false;
-
-    /* full matrix scan */
-    for ( best = ~ 0U, count = src -> count, i = 0; i < count; ++ i )
-    {
-        uint32_t dist;
-
-        td = src -> td [ i ];
-        td . dim *= self -> dim;
-
-        if ( VTypedecl2STypesetdecl ( & td, schema, dst, ancestor -> dim, & td, & dist ) )
-        {
-            if ( early )
-                return true;
-
-            if ( dist < best )
-            {
-                if ( distance != NULL )
-                    * distance = dist;
-                if ( dist == 0 )
-                {
-                    if ( cast != NULL )
-                        * cast = td;
-                    return true;
-                }
-                btd = td;
-                best = dist;
-            }
-        }
-    }
-
-    if ( ( int32_t ) best > 0 )
-    {
-        if ( cast != NULL )
-            * cast = btd;
-        return true;
-    }
-
-    return false;
-}
-
-LIB_EXPORT bool CC VTypedeclToTypedecl ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *ancestor, VTypedecl *cast, uint32_t *distance )
-{
-    if ( self == NULL || schema == NULL || ancestor == NULL )
-        return false;
-
-    /* source is typeset */
-    if ( self -> type_id >= 0x40000000 )
-    {
-        /* typeset => typeset */
-        if ( ancestor -> type_id >= 0x40000000 )
-            return VTypesetdeclToTypesetdecl ( self, schema, ancestor, cast, distance );
-
-        /* typeset => typedecl */
-        return VTypesetdeclToTypedecl ( self, schema, ancestor, cast, distance );
-    }
-
-    /* ancestor is typeset */
-    if ( ancestor -> type_id >= 0x40000000 )
-    {
-        /* typedecl => typeset */
-        return VTypedeclToTypesetdecl ( self, schema, ancestor, cast, distance );
-    }
-
-    /* typedecl => typedecl */
-    return VTypedecl2Typedecl ( self, schema, ancestor, cast, distance );
-}
-
-
-/* ToType
- *  attempt to cast a typedecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target type or typeset for cast
- *
- *  "cast" [ OUT ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" was a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distance" [ OUT, NULL OKAY ] - optional linear measure of casting
- *  generations. valid only if function returns true. a value of 0 means
- *  that "self" is a direct match with "ancestor", a value of 1 means that
- *  "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-static
-bool VTypedecl2Type ( const VTypedecl *self,
-    const VSchema *schema, uint32_t gramps,
-    VTypedecl *cast, uint32_t *distance )
-{
-    const SDatatype *src;
-    uint32_t i, dim, type_id = self -> type_id;
-
-    /* cannot produce a valid typedecl if self is "any" or dimension is variable */
-    if ( type_id == 0 || self -> dim == 0 )
-        return false;
-
-    /* casting to "any" or identity */
-    if ( gramps == 0 || type_id == gramps)
-    {
-        if ( cast != NULL && ( const VTypedecl* ) cast != self )
-            * cast = * self;
-        if ( distance != NULL )
-            * distance = 0;
-        return true;
-    }
-
-    /* find type */
-    src = VSchemaFindTypeid ( schema, type_id );
-    if ( src == NULL )
-        return false;
-
-    /* cast toward gramps */
-    for ( dim = self -> dim, i = 0; src -> id > gramps; ++ i )
-    {
-        dim *= src -> dim;
-        src = src -> super;
-        if ( src == NULL || src -> domain == 0 )
-            return false;
-    }
-
-    /* if not met */
-    if ( src -> id != gramps )
-        return false;
-
-    /* produce output */
-    if ( distance != NULL )
-        * distance = i;
-                            
-    if ( cast != NULL )
-    {
-        cast -> type_id = gramps;
-        cast -> dim = dim;
-    }
-
-    return true;
-}
-
-static
-bool STypesetdecl2Type ( const STypeset *self, uint32_t sdim,
-    const VSchema *schema, uint32_t gramps,
-    VTypedecl *cast, uint32_t *distance )
-{
-    bool early;
-    VTypedecl btd;
-    uint32_t i, count, best;
-
-    /* ambiguous if casting to "any" */
-    if ( gramps == 0 )
-        return false;
-
-    /* can exit early if only testing castability */
-    early = ( cast == NULL && distance == NULL ) ? true : false;
-
-    /* cast all to ancestor */
-    for ( best = ~ 0U, count = self -> count, i = 0; i < count; ++ i )
-    {
-        uint32_t dist;
-
-        VTypedecl td;
-        td = self -> td [ i ];
-        td . dim *= sdim;
-
-        if ( VTypedecl2Type ( & td, schema, gramps, & td, & dist ) )
-        {
-            /* if only testing castability */
-            if ( early )
-                return true;
-
-            /* if match is better */
-            if ( dist < best )
-            {
-                if ( distance != NULL )
-                    * distance = dist;
-                if ( dist == 0 )
-                {
-                    if ( cast != NULL )
-                        * cast = td;
-                    return true;
-                }
-                btd = td;
-                best = dist;
-            }
-        }
-    }
-
-    if ( ( int32_t ) best > 0 )
-    {
-        if ( cast != NULL )
-            * cast = btd;
-        return true;
-    }
-
-    return false;
-}
-
-static
-bool VTypesetdeclToType ( const VTypedecl *self, const VSchema *schema,
-    uint32_t gramps, VTypedecl *cast, uint32_t *distance )
-{
-    /* find source typeset */
-    const STypeset *src = VSchemaFindTypesetid ( schema, self -> type_id );
-
-    /* not found or empty */
-    if ( src == NULL || src -> count == 0 )
-        return false;
-
-    /* if has single type */
-    if ( src -> count == 1 )
-    {
-        VTypedecl td = src -> td [ 0 ];
-        td . dim *= self -> dim;
-        return VTypedecl2Type ( & td, schema, gramps, cast, distance );
-    }
-
-    /* perform cast */
-    return STypesetdecl2Type ( src, self -> dim, schema, gramps, cast, distance );
-}
-
-LIB_EXPORT bool CC VTypedeclToType ( const VTypedecl *self, const VSchema *schema,
-    uint32_t ancestor, VTypedecl *cast, uint32_t *distance )
-{
-    if ( self == NULL || schema == NULL )
-        return false;
-
-    /* if casting to typeset */
-    if ( ancestor >= 0x40000000 )
-    {
-        /* convert ancestor to VTypedecl,
-           since the operation will be identical
-           due to the fact that the typeset contents
-           will have dimension, i.e. dimensions must match */
-        VTypedecl td;
-        td . type_id = ancestor;
-        td . dim = 1;
-
-        /* typeset => typeset */
-        if ( self -> type_id >= 0x40000000 )
-            return VTypesetdeclToTypesetdecl ( self, schema, & td, cast, distance );
-
-        /* typedecl => typeset */
-        return VTypedeclToTypesetdecl ( self, schema, & td, cast, distance );
-    }
-
-    /* typeset => type */
-    if ( self -> type_id >= 0x40000000 )
-        return VTypesetdeclToType ( self, schema, ancestor, cast, distance );
-
-    /* typedecl => type */
-    return VTypedecl2Type ( self, schema, ancestor, cast, distance );
-}
-
-/* CommonAncestor
- *  find a common ancestor between "self" and "peer"
- *  returns distance as sum of distances from each to "ancestor"
- */
-static
-bool VTypedeclTypedeclCmn ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *peer, VTypedecl *ancestor, uint32_t *distance )
-{
-    const SDatatype *at, *bt;
-    uint32_t a, b, adim, bdim;
-
-    /* retrieve datatypes */
-    at = VSchemaFindTypeid ( schema, self -> type_id );
-    if ( at == NULL )
-        return false;
-
-    bt = VSchemaFindTypeid ( schema, peer -> type_id );
-    if ( bt == NULL )
-        return false;
-
-    /* walk each side toward parents */
-    for ( a = b = 0, adim = self -> dim, bdim = peer -> dim; at -> id != bt -> id; )
-    {
-        const SDatatype *dt;
-        if ( at -> id > bt -> id )
-        {
-            ++ a;
-            adim *= at -> dim;
-            dt = at = at -> super;
-        }
-        else
-        {
-            ++ b;
-            bdim *= bt -> dim;
-            dt = bt = bt -> super;
-        }
-        if ( dt == NULL || dt -> domain == 0 )
-            return false;
-    }
-
-    if ( adim == 0 )
-    {
-        if ( bdim == 0 )
-            return false;
-        adim = bdim;
-    }
-    else if ( bdim == 0 )
-    {
-        bdim = adim;
-    }
-
-    /* we have a common parent type, but dimensions must match */
-    if ( adim == bdim )
-    {
-        if ( distance != NULL )
-            * distance = a + b;
-        if ( ancestor != NULL )
-        {
-            ancestor -> type_id = at -> id;
-            ancestor -> dim = adim;
-        }
-        return true;
-    }
-
-    return false;
-}
-
-static
-bool VTypedeclSTypesetdeclCmn ( const VTypedecl *self, const VSchema *schema,
-    const STypeset *peer, uint32_t bdim, VTypedecl *ancestor, uint32_t *distance )
-{
-    bool early;
-    VTypedecl btd;
-    uint32_t i, count, best;
-
-    early = ( ancestor == NULL && distance == NULL ) ? true : false;
-
-    for ( best = ~ 0U, count = peer -> count, i = 0; i < count; ++ i )
-    {
-        uint32_t dist;
-
-        VTypedecl td = peer -> td [ i ];
-        td . dim *= bdim;
-
-        if ( VTypedeclTypedeclCmn ( self, schema, & td, & td, & dist ) )
-        {
-            if ( early )
-                return true;
-
-            if ( dist < best )
-            {
-                if ( distance != NULL )
-                    * distance = dist;
-                if ( dist == 0 )
-                {
-                    if ( ancestor != NULL )
-                        * ancestor = td;
-                    return true;
-                }
-                btd = td;
-                best = dist;
-            }
-        }
-    }
-
-    if ( ( int32_t ) best > 0 )
-    {
-        if ( ancestor != NULL )
-            * ancestor = btd;
-        return true;
-    }
-
-    return false;
-}
-
-static
-bool VTypedeclTypesetCmn ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *peer, VTypedecl *ancestor, uint32_t *distance )
-{
-    /* find peer typeset */
-    const STypeset *ts = VSchemaFindTypesetid ( schema, peer -> type_id );
-
-    /* if not found or empty */
-    if ( ts == NULL || ts -> count == 0 )
-        return false;
-
-    /* if has a single type */
-    if ( ts -> count == 1 )
-    {
-        VTypedecl td = ts -> td [ 0 ];
-        td . dim *= peer -> dim;
-        return VTypedeclTypedeclCmn ( self, schema, & td, ancestor, distance );
-    }
-
-    /* find best match */
-    return VTypedeclSTypesetdeclCmn ( self, schema, ts, peer -> dim, ancestor, distance );
-}
-
-static
-bool VTypesetTypesetCmn ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *peer, VTypedecl *ancestor, uint32_t *distance )
-{
-    bool early;
-    VTypedecl btd, td;
-    uint32_t i, count, best;
-    const STypeset *ats, *bts;
-
-    /* find self typeset */
-    ats = VSchemaFindTypesetid ( schema, self -> type_id );
-    if ( ats == NULL || ats -> count == 0 )
-        return false;
-
-    /* find peer typeset */
-    bts = VSchemaFindTypesetid ( schema, peer -> type_id );
-    if ( bts == NULL || bts -> count == 0 )
-        return false;
-
-    /* check for simple contents */
-    if ( ats -> count == 1 )
-    {
-        td = ats -> td [ 0 ];
-        td . dim *= self -> dim;
-        if ( bts -> count == 1 )
-        {
-            btd = bts -> td [ 0 ];
-            btd . dim *= peer -> dim;
-            return VTypedeclTypedeclCmn ( & td, schema, & btd, ancestor, distance );
-        }
-        return VTypedeclSTypesetdeclCmn ( & td, schema, bts, peer -> dim, ancestor, distance );
-    }
-    if ( bts -> count == 1 )
-    {
-        td = bts -> td [ 0 ];
-        td . dim *= peer -> dim;
-        return VTypedeclSTypesetdeclCmn ( & td, schema, ats, self -> dim, ancestor, distance );
-    }
-
-    early = ( ancestor == NULL && distance == NULL ) ? true : false;
-
-    for ( best = ~ 0U, count = ats -> count, i = 0; i < count; ++ i )
-    {
-        uint32_t dist = ~ 0;
-
-        td = ats -> td [ i ];
-        td . dim *= self -> dim;
-
-        if ( VTypedeclSTypesetdeclCmn ( & td, schema, bts, peer -> dim, & td, & dist ) )
-        {
-            if ( early )
-                return true;
-
-            if ( dist < best )
-            {
-                if ( distance != NULL )
-                    * distance = dist;
-                if ( dist == 0 )
-                {
-                    if ( ancestor != NULL )
-                        * ancestor = td;
-                    return true;
-                }
-                btd = td;
-                best = dist;
-            }
-        }
-    }
-
-    if ( ( int32_t ) best > 0 )
-    {
-        if ( ancestor != NULL )
-            * ancestor = btd;
-        return true;
-    }
-
-    return false;
-}
-
-LIB_EXPORT bool CC VTypedeclCommonAncestor ( const VTypedecl *self, const VSchema *schema,
-    const VTypedecl *peer, VTypedecl *ancestor, uint32_t *distance )
-{
-    if ( self == NULL || schema == NULL || peer == NULL )
-        return false;
-
-    /* wildcard make it hard to find common ancestor */
-    if ( self -> type_id == 0 || peer -> type_id == 0 )
-        return VTypedeclToTypedecl ( self, schema, peer, ancestor, distance );
-
-    /* rh type is typeset */
-    if ( self -> type_id >= 0x40000000 )
-    {
-        /* typeset, typeset => parent */
-        if ( peer -> type_id >= 0x40000000 )
-            return VTypesetTypesetCmn ( self, schema, peer, ancestor, distance );
-
-        /* typeset, typedecl => parent */
-        return VTypedeclTypesetCmn ( peer, schema, self, ancestor, distance );
-    }
-
-    /* typedecl, typeset => parent */
-    if ( peer -> type_id >= 0x40000000 )
-        return VTypedeclTypesetCmn ( self, schema, peer, ancestor, distance );
-
-    /* typedecl, typedecl => parent */
-    return VTypedeclTypedeclCmn ( self, schema, peer, ancestor, distance );
-}
-
-/* Dump
- */
-rc_t VTypedeclDump ( const VTypedecl *self, SDumper *b )
-{
-    rc_t rc;
-    uint32_t type_id = self -> type_id;
-    if ( type_id < 0x40000000 )
-    {
-        const SDatatype *dt = VSchemaFindTypeid ( b -> schema, type_id );
-        rc = SDatatypeDump ( dt, b );
-        if ( rc == 0 && dt != NULL && dt -> id == 0 )
-            return 0;
-    }
-    else if ( type_id < 0x80000000 )
-    {
-        const STypeset *ts = VSchemaFindTypesetid ( b -> schema, type_id );
-        rc = STypesetDump ( ts, b );
-    }
-    else
-    {
-#if SLVL >= 3
-        const SIndirectType *id = VSchemaFindITypeid ( b -> schema, type_id );
-        rc = SIndirectTypeDump ( id, b );
-#else
-        rc = RC ( rcVDB, rcSchema, rcWriting, rcType, rcUnrecognized );
-#endif
-    }
-
-    if ( rc == 0 && self -> dim != 1 )
-    {
-        const char *fmt;
-        switch ( SDumperMode ( b ) )
-        {
-        case sdmCompact:
-            fmt = self -> dim ? "[%u]" : "[*]"; break;
-        default:
-            fmt = self -> dim ? " [ %u ]" : " [ * ]";
-        }
-        rc = SDumperPrint ( b, fmt, self -> dim );
-    }
-
-    return rc;
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VTypedesc
- *  describes the fundamental properties of a VTypedecl
- *  replaces the deprecated structure VTypedef
- */
-
-/* Sizeof
- */
-LIB_EXPORT uint32_t CC VTypedescSizeof ( const VTypedesc *self )
-{
-    if ( self == NULL )
-        return 0;
-    return self -> intrinsic_bits * self -> intrinsic_dim;
-}
-
-
-/*--------------------------------------------------------------------------
- * VFormatdecl
- */
-#if SLVL >= 1
-LIB_EXPORT rc_t CC VFormatdeclToText ( const VFormatdecl *self,
-    const VSchema *schema, char *buffer, size_t bsize )
-{
-    PLOGMSG ( klogWarn, ( klogWarn, "TDB: $(msg)", "msg=handle VFormatdeclToText " ));    
-    return -1;
-}
-
-/* ToFormatdecl
- *  attempt to cast a fmtdecl to a size-equivalent ancestor decl
- *
- *  "schema" [ IN ] - schema object that would know about this type
- *
- *  "ancestor" [ IN ] - target fmtdecl or typespec for cast
- *
- *  "cast" [ OUT ] - return parameter for ancestor decl
- *  valid only if function returns true. if "ancestor" contained a typeset,
- *  the value of "cast" will be the closest matching ancestral type.
- *
- *  "distances" [ OUT, NULL OKAY ] - optional linear measure of independent
- *  casting generations for format ( 0 ) and type ( 1 ). valid only if function
- *  returns true. a value of 0 means that "self" is a direct match with "ancestor",
- *  a value of 1 means that "self" is an immediate subtype of "ancestor", etc.
- *
- *  returns true if cast succeeded
- */
-static
-bool VFormatdeclToFormatdeclInt ( const VFormatdecl *self, const VSchema *schema,
-    const VFormatdecl *ancestor, VFormatdecl *cast, uint32_t distances [ 2 ],
-    bool ( CC * td2td ) ( const VTypedecl*, const VSchema*, const VTypedecl*, VTypedecl*, uint32_t* ) )
-{
-    if ( self != NULL && schema != NULL && ancestor != NULL )
-    {
-        uint32_t i;
-        const SFormat *fmt;
-
-        /* just to handle common cases */
-        if ( distances != NULL )
-            distances [ 0 ] = distances [ 1 ] = 0;
-
-        /* no format on self */
-        if ( self -> fmt == 0 )
-        {
-            /* resulting format is ancestor's */
-            if ( cast != NULL )
-                cast -> fmt = ancestor -> fmt;
-
-            /* if no ancestor format, or if have type info, perform type cast */
-            if ( ancestor -> fmt == 0 || self -> td . type_id != 0 || ancestor -> td . type_id != 0 )
-            {
-                return ( * td2td ) ( & self -> td, schema,
-                    & ancestor -> td, & cast -> td, distances ? & distances [ 1 ] : NULL );
-            }
-
-            /* resultant type is undefined */
-            if ( cast != NULL )
-            {
-                cast -> td . type_id = 0;
-                cast -> td . dim = 1;
-            }
-
-            return true;
-        }
-
-        if ( ancestor -> fmt == 0 || ancestor -> fmt == self -> fmt )
-        {
-            /* resulting format is our own */
-            if ( cast != NULL )
-                cast -> fmt = self -> fmt;
-
-            /* if have type info, perform type cast */
-            if ( self -> td . type_id != 0 || ancestor -> td . type_id != 0 )
-            {
-                return ( * td2td ) ( & self -> td, schema,
-                    & ancestor -> td, & cast -> td, distances ? & distances [ 1 ] : NULL );
-            }
-
-            /* resultant type is undefined */
-            if ( cast != NULL )
-            {
-                cast -> td . type_id = 0;
-                cast -> td . dim = 1;
-            }
-
-            return true;
-        }
-
-        /* distinct formats involved */
-        fmt = VSchemaFindFmtid ( schema, self -> fmt );
-        for ( i = 0; fmt != NULL; ++ i, fmt = fmt -> super )
-        {
-            if ( fmt -> id == ancestor -> fmt )
-            {
-                /* successful cast to ancestor */
-                if ( cast != NULL )
-                    cast -> fmt = ancestor -> fmt;
-                if ( distances != NULL )
-                    distances [ 0 ] = i;
-
-                /* if have type info, perform type cast */
-                if ( self -> td . type_id != 0 || ancestor -> td . type_id != 0 )
-                {
-                    return ( * td2td ) ( & self -> td, schema,
-                        & ancestor -> td, & cast -> td, distances ? & distances [ 1 ] : NULL );
-                }
-
-                /* resultant type is undefined */
-                if ( cast != NULL )
-                {
-                    cast -> td . type_id = 0;
-                    cast -> td . dim = 1;
-                }
-
-                return true;
-            }
-        }
-    }
-
-    return false;
-}
-
-LIB_EXPORT bool CC VFormatdeclToFormatdecl ( const VFormatdecl *self,
-    const VSchema *schema, const VFormatdecl *ancestor,
-    VFormatdecl *cast, uint32_t distances [ 2 ] )
-{
-    return VFormatdeclToFormatdeclInt ( self, schema,
-        ancestor, cast, distances, VTypedeclToTypedecl );
-}
-
-
-/* CommonAncestor
- *  find a common ancestor between "self" and "peer"
- *  returns distance as sum of distances from each to "ancestor"
- */
-bool VFormatdeclCommonAncestor ( const VFormatdecl *self, const VSchema *schema,
-    const VFormatdecl *peer, VFormatdecl *ancestor, uint32_t distances [ 2 ] )
-{
-    return VFormatdeclToFormatdeclInt ( self, schema,
-        peer, ancestor, distances, VTypedeclCommonAncestor );
-}
-
-
-rc_t VFormatdeclDump ( const VFormatdecl *self, SDumper *b )
-{
-    rc_t rc;
-    uint32_t fmt_id = self -> fmt;
-
-    if ( fmt_id != 0 )
-    {
-        const SFormat *fmt = VSchemaFindFmtid ( b -> schema, fmt_id );
-        rc = SFormatDump ( fmt, b );
-        if ( rc != 0 || self -> td . type_id == 0 )
-            return rc;
-
-        rc = SDumperWrite ( b, "/", 1 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    return VTypedeclDump ( & self -> td, b );
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * STypeset
- */
-
-static
-void CC STypesetPopulate ( BSTNode *n, void *data )
-{
-    const STypesetMbr *mbr = ( const STypesetMbr* ) n;
-    STypeset *ts = data;
-    ts -> td [ ts -> count ++ ] = mbr -> td;
-}
-
-/* Find
- */
-STypeset *VSchemaFindTypesetid ( const VSchema *self, uint32_t id )
-{
-    STypeset *ts = VectorGet ( & self -> ts, id );
-    while ( ts == NULL )
-    {
-        self = self -> dad;
-        if ( self == NULL )
-            break;
-        ts = VectorGet ( & self -> ts, id );
-    }
-    return ts;
-}
-
-/* Mark
- */
-void CC STypesetClearMark ( void *item, void *ignore )
-{
-    STypeset *self = item;
-    self -> marked = false;
-}
-
-void VSchemaTypeMark ( const VSchema *self, uint32_t type_id )
-{
-    const SDatatype *dt;
-    const STypeset *ts;
-    const SIndirectType *pt;
-
-    switch ( type_id & 0xC0000000 )
-    {
-    case 0:
-        while ( type_id < VectorStart ( & self -> dt ) )
-        {
-            self = self -> dad;
-            if ( self -> dad == NULL )
-                return;
-        }
-
-        dt = VectorGet ( & self -> dt, type_id );
-        if ( dt != NULL )
-            SDatatypeMark ( dt );
-        break;
-
-    case 0x40000000:
-        while ( type_id < VectorStart ( & self -> ts ) )
-        {
-            self = self -> dad;
-            if ( self -> dad == NULL )
-                return;
-        }
-
-        ts = VectorGet ( & self -> ts, type_id );
-        if ( ts != NULL )
-            STypesetMark ( ts, self );
-        break;
-
-    default:
-        while ( type_id < VectorStart ( & self -> pt ) )
-        {
-            self = self -> dad;
-            if ( self -> dad == NULL )
-                return;
-        }
-
-        pt = VectorGet ( & self -> pt, type_id );
-        if ( pt != NULL )
-            SIndirectTypeMark ( ( void * )pt, ( void * )self );
-        break;
-    }
-}
-
-void STypesetMark ( const STypeset *cself, const VSchema *schema )
-{
-    STypeset *self = ( STypeset* ) cself;
-    if ( cself != NULL && ! cself -> marked )
-    {
-        uint32_t i, count = self -> count;
-        self -> marked = true;
-        for ( i = 0; i < count; ++ i )
-            VSchemaTypeMark ( schema, self -> td [ i ] . type_id );
-    }
-}
-
-/* Dump
- */
-rc_t STypesetDump ( const STypeset *self, struct SDumper *d )
-{
-    return FQNDump ( self -> name, d );
-}
-
-#if SLVL >= 1
-bool CC STypesetDefDump ( void *item, void *data )
-{
-    int i;
-
-    SDumper *b = data;
-    const char *tsfmt, *sep, *cls;
-    const STypeset *self = ( const void* ) item;
-
-    if ( SDumperMarkedMode ( b ) && ! self -> marked )
-        return false;
-
-    switch ( SDumperMode ( b ) )
-    {
-    case sdmCompact:
-        tsfmt = "typeset %N{";
-        sep = ",";
-        cls = "};";
-        break;
-    default:
-        tsfmt = "typeset %N { ";
-        sep = ", ";
-        cls = " };\n";
-    }
-
-
-    SDumperSepString ( b, "" );
-
-    b -> rc = SDumperPrint ( b, tsfmt, self -> name );
-    for ( i = 0; b -> rc == 0 && i < ( int ) self -> count; ++ i )
-    {
-        b -> rc = SDumperSep ( b );
-        if ( b -> rc == 0 )
-            b -> rc = VTypedeclDump ( & self -> td [ i ], b );
-        SDumperSepString ( b, sep );
-    }
-    if ( b -> rc == 0 )
-        b -> rc = SDumperPrint ( b, cls );
-
-    if ( b -> rc == 0 )
-        b -> rc = AliasDump ( self -> name, b );
-
-    return ( b -> rc != 0 ) ? true : false;
-}
-#endif
-
-/*--------------------------------------------------------------------------
- * VSchema
- */
-
-/*
- * fqn                = ID [ <nested-name> ]
- * nested-name        = ':' NAME [ <nested-name> ]
- */
-static
-rc_t nested_name ( const KSymTable *tbl, KTokenSource *src, KToken *t, const SchemaEnv *env )
-{
-    rc_t rc;
-    KSymbol *ns = t -> sym;
-
-    /* look for colon separator */
-    if ( next_token ( tbl, src, t ) -> id != eColon )
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcIncomplete );
-
-    /* push namespace onto stack */
-    rc = KSymTablePushNamespace ( tbl, ns );
-    if ( rc == 0 )
-    {
-        /* look for another namespace */
-        if ( next_shallow_token ( tbl, src, t, false ) -> id == eNamespace )
-            rc = nested_name ( tbl, src, t, env );
-
-        /* pop namespace */
-        KSymTablePopNamespace ( tbl );
-    }
-
-    return rc;
-}
-
-rc_t next_fqn ( const KSymTable *tbl, KTokenSource *src, KToken *t, const SchemaEnv *env )
-{
-    rc_t rc;
-    KToken t2;
-    KTokenSource src2;
-
-    /* looking for a symbolic name */
-    if ( t -> sym == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-
-    /* anything other than a namespace is what we want */
-    if ( t -> id != eNamespace )
-        return 0;
-
-    /* perform a lookahead */
-    t2 = * t;
-    src2 = * src;
-
-    /* requires ':' following namespace */
-    rc = nested_name ( tbl, & src2, & t2, env );
-    if ( rc == 0 )
-    {
-        KSymbol *ns;
-        uint32_t scope;
-
-        /* recognized patern (NS:)+TOKEN
-           check that TOKEN is a defined symbol within NS */
-        if ( t2 . sym != NULL )
-        {
-            * t = t2;
-            * src = src2;
-            return 0;
-        }
-
-        /* before returning an error, look harder.
-           extended VSchema can create symtab entries
-           for namespaces that opaque the parent schema */
-        for ( scope = 0, ns = t -> sym; ns != NULL; )
-        {
-            /* find a deeper symbol */
-            ns = KSymTableFindNext ( tbl, ns, & scope );
-            if ( ns != NULL && ns -> type == eNamespace )
-            {
-                t2 = * t;
-                src2 = * src;
-                t2 . sym = ns;
-                rc = nested_name ( tbl, & src2, & t2, env );
-                if ( rc != 0 )
-                    return rc;
-                if ( t2 . sym != NULL )
-                {
-                    * t = t2;
-                    * src = src2;
-                    return 0;
-                }
-            }
-        }
-
-        /* could not find anything */
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcIncomplete );
-    }
-    return rc;
-}
-
-static
-rc_t create_fqn_sym ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t id, const void *obj )
-{
-    KToken t2;
-    KTokenSource src2 = * src;
-
-    /* need to peek at next token */
-    if ( KTokenizerNext ( kDefaultTokenizer, & src2, & t2 ) -> id == eColon )
-    {
-        /* and again to find ident or name */
-        KTokenizerNext ( kDefaultTokenizer, & src2, & t2 );
-
-        /* allow reserved word "view" to be used in schemas <= 1.0 */
-        if ( t2 . id == kw_view && ! env -> has_view_keyword )
-            t2 . id = eIdent;
-
-        if ( t2 . id == eIdent || t2 . id == eName )
-        {
-            /* create a namespace and go in */
-            KSymbol *ns;
-            rc_t rc = KSymTableCreateNamespace ( tbl, & ns, & t -> str );
-            if ( rc == 0 )
-            {
-                rc = KSymTablePushNamespace ( tbl, ns );
-                if ( rc == 0 )
-                {
-                    /* accept ':' NS */
-                    * t = t2;
-                    * src = src2;
-
-                    /* recurse */
-                    rc = create_fqn_sym ( tbl, src, t, env, id, obj );
-
-                    /* exit namespace */
-                    KSymTablePopNamespace ( tbl );
-                }
-            }
-
-            /* always return */
-            return rc;
-        }
-    }
-
-    /* contents of "t" are a proper symbol */
-    assert ( t -> id == eIdent || t -> id == eName );
-    return KSymTableCreateSymbol ( tbl, & t -> sym, & t -> str, id, obj );
-}
-
-static
-rc_t enter_namespace ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t id, const void *obj )
-{
-    KSymbol *ns = t -> sym;
-    rc_t rc = KSymTablePushNamespace ( tbl, ns );
-    if ( rc == 0 )
-    {
-        if ( next_token ( tbl, src, t ) -> id != eColon )
-            rc = KTokenExpected ( t, klogErr, ":" );
-        else switch ( next_shallow_token ( tbl, src, t, false ) -> id )
-        {
-        case eNamespace:
-            rc = enter_namespace ( tbl, src, t, env, id, obj );
-            break;
-        case eIdent:
-        case eName:
-            rc = create_fqn_sym ( tbl, src, t, env, id, obj );
-            break;
-        case kw_view:
-            if ( ! env -> has_view_keyword )
-            {
-                rc = create_fqn_sym ( tbl, src, t, env, id, obj );
-                break;
-            }
-            /* no break */
-        default:
-            if ( t -> id == id )
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-            else
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-        }
-
-        KSymTablePopNamespace ( tbl );
-    }
-    return rc;
-}
-
-rc_t create_fqn ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t id, const void *obj )
-{
-    switch ( t -> id )
-    {
-    case eNamespace:
-        return enter_namespace ( tbl, src, t, env, id, obj );
-    case eIdent:
-        return create_fqn_sym ( tbl, src, t, env, id, obj );
-    default:
-        if ( t -> id == id )
-            return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-    }
-
-    return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-}
-
-
-/*
- * dim                = '[' <uint-expr> ']'
- */
-#if SLVL >= 1
-rc_t dim ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, uint32_t *dim, bool required )
-{
-    rc_t rc;
-
-    if ( ! required && t -> id != eLeftSquare )
-    {
-        * dim = 1;
-        return 0;
-    }
-
-    /* consume '[' */
-    rc = expect ( tbl, src, t, eLeftSquare, "[", true );
-    if ( rc == 0 )
-    {
-        /* assume manifest constant */
-        rc = KTokenToU32 ( t, dim );
-
-        /* otherwise, assume some sort of symbolic expression */
-        if ( rc != 0 )
-        {
-            const SExpression *x;
-            rc = const_expr ( tbl, src, t, env, self, & x );
-            if ( rc == 0 )
-            {
-                /* should have evaluated to a constant expression */
-                rc = eval_uint_expr ( self, x, dim );
-                SExpressionWhack ( x );
-            }
-            if ( rc != 0 )
-                return rc;
-        }
-    }
-
-    /* close brackets */
-    return expect ( tbl, src, next_token ( tbl, src, t ), eRightSquare, "]", true );
-}
-
-
-/*
- * typename           = <fqn>
- */
-rc_t typename ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t *id )
-{
-    const SDatatype *dt;
-    const SIndirectType *tp;
-
-    /* consume fully qualified name */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    /* the name must be defined as a data type */
-    switch ( t -> id )
-    {
-    case eDatatype:
-        dt = t -> sym -> u. obj;
-        * id = dt -> id;
-        break;
-    case eSchemaType:
-        tp = t -> sym -> u. obj;
-        * id = tp -> id;
-        break;
-    default:
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-    }
-
-    return 0;
-}
-
-
-/*
- * typedecl           = <typename> [ <dim> ]
- */
-rc_t typedecl ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VTypedecl *td )
-{
-    rc_t rc = typename ( tbl, src, t, env, & td -> type_id );
-    if ( rc != 0 )
-        return rc;
-
-    next_token ( tbl, src, t );
-    return dim ( tbl, src, t, env, self, & td -> dim, false );
-}
-
-
-/*
- * typeset            = <fqn>
- */
-rc_t typeset ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-   const SchemaEnv *env, uint32_t *id )
-{
-    const STypeset *ts;
-
-    /* consume fully qualified name */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    /* the name must be defined as a typeset */
-    if ( t -> id != eTypeset )
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-
-    /* retrieve the runtime type id */
-    assert ( t -> sym != NULL );
-    ts = t -> sym -> u . obj;
-    * id = ts -> id;
-
-    return 0;
-}
-
-/*
- * typespec           = <typedecl>
- *                    | <typeset> [ <dim> ]
- */
-rc_t typespec ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VTypedecl *td )
-{
-    const STypeset *ts;
-    const SDatatype *dt;
-    const SIndirectType *tp;
-
-    /* get a typename or typeset */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    switch ( t -> id )
-    {
-    case eDatatype:
-        dt = t -> sym -> u. obj;
-        td -> type_id = dt -> id;
-        break;
-    case eSchemaType:
-        tp = t -> sym -> u. obj;
-        td -> type_id = tp -> id;
-        break;
-    case eTypeset:
-        ts = t -> sym -> u. obj;
-        td -> type_id = ts -> id;
-        break;
-    default:
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-    }
-
-    next_token ( tbl, src, t );
-    return dim ( tbl, src, t, env, self, & td -> dim, false );
-}
-#endif
-
-
-/*
- * fmtname            = <fqn>
- */
-rc_t fmtname ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, uint32_t *id )
-{
-    const SFormat *fmt;
-
-    /* consume fully qualified name */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    /* the name must be defined as a format */
-    if ( t -> id != eFormat )
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-
-    /* retrieve the runtime fmt id */
-    assert ( t -> sym != NULL );
-    fmt = t -> sym -> u . obj;
-    * id = fmt -> id;
-
-    return 0;
-}
-
-/*
- * fmtdecl            = <fmtname> [ '/' <typedecl> ]
- *                    | <typedecl>
- */
-#if SLVL >= 1
-rc_t fmtdecl ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VFormatdecl *fd )
-{
-    const SDatatype *dt;
-    const SIndirectType *tp;
-
-    /* get a fmtname or typename */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    /* look first for fmtname */
-    if ( t -> id == eFormat )
-    {
-        const SFormat *fmt = t -> sym -> u . obj;
-        fd -> fmt = fmt -> id;
-
-        /* unless followed by '/', this is a simple format declaration */
-        if ( next_token ( tbl, src, t ) -> id != eFwdSlash )
-        {
-            fd -> td . type_id = 0;
-            fd -> td . dim = 0;
-            return 0;
-        }
-
-        /* expect a typename */
-        rc = next_fqn ( tbl, src, next_token ( tbl, src, t ), env );
-        if ( rc != 0 )
-            return rc;
-    }
-    else
-    {
-        fd -> fmt = 0;
-    }
-
-    switch ( t -> id )
-    {
-    case eDatatype:
-        dt = t -> sym -> u. obj;
-        fd -> td . type_id = dt -> id;
-        break;
-    case eSchemaType:
-        tp = t -> sym -> u. obj;
-        fd -> td . type_id = tp -> id;
-        break;
-    default:
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-    }
-
-    next_token ( tbl, src, t );
-    return dim ( tbl, src, t, env, self, & fd -> td . dim, false );
-}
-
-/*
- * fmtspec            = <typespec>
- *                    | <fmtname> [ '/' <typedecl> ]
- */
-rc_t fmtspec ( const KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, const VSchema *self, VFormatdecl *fd )
-{
-    const SFormat *fmt;
-    const STypeset *ts;
-    const SDatatype *dt;
-    const SIndirectType *tp;
-
-    /* get a fmtname, typename or typeset */
-    rc_t rc = next_fqn ( tbl, src, t, env );
-    if ( rc != 0 )
-        return rc;
-
-    fd -> fmt = 0;
-    switch ( t -> id )
-    {
-    case eDatatype:
-        dt = t -> sym -> u. obj;
-        fd -> td . type_id = dt -> id;
-        break;
-    case eSchemaType:
-        tp = t -> sym -> u. obj;
-        fd -> td . type_id = tp -> id;
-        break;
-    case eTypeset:
-        ts = t -> sym -> u. obj;
-        fd -> td . type_id = ts -> id;
-        break;
-    case eFormat:
-        fmt = t -> sym -> u . obj;
-        fd -> fmt = fmt -> id;
-
-        /* unless followed by '/', this is a simple format declaration */
-        if ( next_token ( tbl, src, t ) -> id != eFwdSlash )
-        {
-            fd -> td . type_id = 0;
-            fd -> td . dim = 0;
-            return 0;
-        }
-        return typedecl ( tbl, src, t, env, self, & fd -> td );
-
-    default:
-        return RC ( rcVDB, rcSchema, rcParsing, rcToken, rcUnexpected );
-    }
-
-    next_token ( tbl, src, t );
-    return dim ( tbl, src, t, env, self, & fd -> td . dim, false );
-}
-#endif
-
-
-/*
- * type-definition    = 'typedef' <typename> <typedef-list>
- * typedef-list       = <typedef-decl> [ ',' <typedef-list> ]
- * typedef-decl       = <fqn> [ <dim> ]
- */
-#if SLVL >= 1
-rc_t type_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    VTypedecl td;
-    uint32_t super_size;
-    const SDatatype *super;
-
-    /* expect a typename */
-    rc_t rc = typename ( tbl, src, t, env, & td . type_id );
-    if ( rc != 0 )
-        return KTokenFailure ( t, klogErr, rc, "type name" );
-    if ( td . type_id == 0 )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcType, rcIncorrect );
-        return KTokenFailure ( t, klogErr, rc, "illegal base type" );
-    }
-
-    /* capture supertype */
-    assert ( t -> sym != NULL );
-    assert ( t -> sym -> type == eDatatype );
-    super = t -> sym -> u . obj;
-
-    /* get supertype size */
-    super_size = super -> size;
-
-    do
-    {
-        KSymbol *sym;
-        SDatatype *dt;
-
-        /* expect a fully qualified name */
-        rc = create_fqn ( tbl, src, next_token ( tbl, src, t ), env, eDatatype, NULL );
-        if ( rc == 0 )
-        {
-            /* remember symbol */
-            sym = t -> sym;
-
-            /* get dimension */
-            next_token ( tbl, src, t );
-            rc = dim ( tbl, src, t, env, self, & td . dim, false );
-            if ( rc != 0 )
-                return KTokenFailure ( t, klogErr, rc, "vector dimension" );
-
-            /* allocate a datatype */
-            dt = malloc ( sizeof * dt );
-            if ( dt == NULL )
-            {
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-
-            /* fill it out from super-type */
-            dt -> super = super;
-            dt -> byte_swap = super -> byte_swap;
-            dt -> name = sym;
-            dt -> size = super_size * td . dim;
-            dt -> dim = td . dim;
-            dt -> domain = super -> domain;
-
-            /* insert into type vector */
-            rc = VectorAppend ( & self -> dt, & dt -> id, dt );
-            if ( rc != 0 )
-            {
-                free ( dt );
-                return KTokenRCExplain ( t, klogInt, rc );
-            }
-
-            /* connect symbol */
-            sym -> u . obj = dt;
-        }
-
-        /* allow a benign redefine */
-        else if ( GetRCState ( rc ) != rcExists )
-            return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-        else
-        {
-            /* remember this already defined name */
-            sym = t -> sym;
-            assert ( sym != NULL && sym -> type == eDatatype );
-
-            /* look for a dimension */
-            next_token ( tbl, src, t );
-            rc = dim ( tbl, src, t, env, self, & td . dim, false );
-            if ( rc != 0 )
-                return KTokenFailure ( t, klogErr, rc, "vector dimension" );
-
-            /* peek at existing definition */
-            dt = ( SDatatype* ) sym -> u . obj;
-            if ( dt -> super != super || dt -> dim != td . dim )
-            {
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-                return KTokenRCExplain ( t, klogErr, rc );
-            }
-        }
-    }
-    while ( t -> id == eComma );
-
-    return expect ( tbl, src, t, eSemiColon, ";", true );
-}
-#endif
-
-
-/*
- * format-definition  = 'fmtdef' [ <fmtname> ] <fqn>
- * fmtname            = <fqn>
- */
-rc_t format_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    KSymbol *sym;
-    SFormat *fmt;
-    const SFormat *super;
-
-    /* start with the assumption that the name needs to be created */
-    rc_t rc = create_fqn ( tbl, src, t, env, eFormat, NULL );
-    if ( rc == 0 )
-    {
-        super = NULL;
-        sym = t -> sym;
-        next_token ( tbl, src, t );
-    }
-    else if ( GetRCState ( rc ) != rcExists )
-        return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-    else
-    {
-        /* could be a superfmt or could be a redefine */
-        sym = t -> sym;
-        if ( next_token ( tbl, src, t ) -> id != eIdent && t -> sym == NULL )
-        {
-            /* we will assume it was a redefine of a simple format */
-            return expect ( tbl, src, t, eSemiColon, "fully qualified name or ;", true );
-        }
-
-        /* has a superfmt */
-        super = sym -> u . obj;
-
-        /* do it again */
-        rc = create_fqn ( tbl, src, t, env, eFormat, NULL );
-        if ( rc != 0 )
-        {
-            /* may have been a redefine of a path-based format */
-            if ( GetRCState ( rc ) != rcExists )
-                return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-
-            return expect ( tbl, src, next_token ( tbl, src, t ),
-                eSemiColon, "fully qualified name or ;", true );
-        }
-
-        sym = t -> sym;
-        next_token ( tbl, src, t );
-    }
-
-    /* create a format */
-    fmt = malloc ( sizeof * fmt );
-    if ( fmt == NULL )
-    {
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* superfmt */
-    fmt -> super = super;
-
-    /* link to name */
-    fmt -> name = sym;
-
-    /* insert into vector */
-    rc = VectorAppend ( & self -> fmt, & fmt -> id, fmt );
-    if ( rc != 0 )
-    {
-        free ( fmt );
-        return KTokenRCExplain ( t, klogInt, rc );
-    }
-
-    /* link symbol to fmt */
-    sym -> u . obj = fmt;
-
-    return expect ( tbl, src, t, eSemiColon, ";", true );
-}
-
-
-/*
- * typeset-definition = 'typeset' <typeset> '{' <typespec-list> '}'
- * typespec-list      = <typespec> [ ',' <typespec-list> ]
- */
-#if SLVL >= 1
-rc_t typeset_definition ( KSymTable *tbl, KTokenSource *src, KToken *t,
-    const SchemaEnv *env, VSchema *self )
-{
-    BSTree tree;
-    KSymbol *sym;
-    bool existing;
-    uint32_t i, count;
-
-    rc_t rc = create_fqn ( tbl, src, t, env, eTypeset, NULL );
-    if ( rc == 0 )
-    {
-        sym = t -> sym;
-        existing = false;
-    }
-    else if ( GetRCState ( rc ) != rcExists )
-        return KTokenFailure ( t, klogErr, rc, "fully qualified name" );
-    else
-    {
-        sym = t -> sym;
-        existing = true;
-    }
-
-    if ( next_token ( tbl, src, t ) -> id != eLeftCurly )
-        return KTokenExpected ( t, klogErr, "{" );
-
-    BSTreeInit ( & tree );
-    count = 0;
-
-    do
-    {
-        STypesetMbr *mbr, *exist;
-
-        /* read typepec */
-        VTypedecl td;
-        next_token ( tbl, src, t );
-        rc = typespec ( tbl, src, t, env, self, & td );
-        if ( rc != 0 )
-        {
-            KTokenFailure ( t, klogErr, rc, "type name, format name or typeset name" );
-            break;
-        }
-
-        /* if we got a typedecl, add it */
-        if ( td . type_id < 0x40000000 )
-        {
-            mbr = malloc ( sizeof * mbr );
-            if ( mbr == NULL )
-            {
-                rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-                KTokenRCExplain ( t, klogInt, rc );
-                break;
-            }
-
-            mbr -> td = td;
-
-            /* ignore/allow duplicates */
-            if ( BSTreeInsertUnique ( & tree, & mbr -> n,
-                 ( BSTNode** ) & exist, STypesetMbrSort ) != 0 )
-            {
-                free ( mbr );
-            }
-            else
-            {
-                ++ count;
-            }
-        }
-
-        /* got a typeset - add each of its members */
-        else
-        {
-            const STypeset *ts;
-            const VSchema *s = self;
-
-            do
-            {
-                ts = VectorGet ( & s -> ts, td . type_id );
-                if ( ts != NULL )
-                    break;
-                s = s -> dad;
-            }
-            while ( s != NULL );
-            assert ( ts != NULL );
-
-            for ( i = 0; i < ts -> count; ++ i )
-            {
-                mbr = malloc ( sizeof * mbr );
-                if ( mbr == NULL )
-                {
-                    rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-                    KTokenRCExplain ( t, klogInt, rc );
-                    break;
-                }
-
-                mbr -> td = ts -> td [ i ];
-
-                /* ignore/allow duplicates */
-                if ( BSTreeInsertUnique ( & tree, & mbr -> n,
-                     ( BSTNode** ) & exist, STypesetMbrSort ) != 0 )
-                {
-                    free ( mbr );
-                }
-                else
-                {
-                    ++ count;
-                }
-            }
-
-            if ( rc != 0 )
-                break;
-        }
-    }
-    while ( t -> id == eComma );
-
-    if ( rc != 0 )
-    {
-        BSTreeWhack ( & tree, BSTreeMbrWhack, NULL );
-        return rc;
-    }
-
-    if ( t -> id != eRightCurly )
-        rc = KTokenExpected ( t, klogErr, "}" );
-    else
-    {
-        /* we have a typeset */
-        STypeset *ts = malloc ( sizeof * ts - sizeof ts -> td + count * sizeof ts -> td [ 0 ] );
-        if ( ts == NULL )
-            rc = RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-        else
-        {
-            /* initialize */
-            ts -> name = sym;
-            ts -> count = 0;
-
-            /* copy fmtdecls */
-            BSTreeForEach ( & tree, false, STypesetPopulate, ts );
-            assert ( ts -> count == count );
-
-            /* have a new one */
-            if ( ! existing )
-            {
-                /* enter it into list */
-                sym -> u . obj = ts;
-                rc = VectorAppend ( & self -> ts, & ts -> id, ts );
-                if ( rc != 0 )
-                {
-                    free ( ts );
-                    KTokenRCExplain ( t, klogInt, rc );
-                }
-            }
-
-            /* allow benign redefine */
-            else
-            {
-                const STypeset *orig = sym -> u . obj;
-                if ( orig -> count != count )
-                {
-                    rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-                    KTokenRCExplain ( t, klogErr, rc );
-                }
-                else for ( i = 0; i < count; ++ i )
-                {
-                    if ( VTypedeclCmp ( & orig -> td [ i ], & ts -> td [ i ] ) != 0 )
-                    {
-                        rc = RC ( rcVDB, rcSchema, rcParsing, rcToken, rcExists );
-                        KTokenRCExplain ( t, klogErr, rc );
-                        break;
-                    }
-                }
-
-                free ( ts );
-            }
-        }
-    }
-
-    BSTreeWhack ( & tree, BSTreeMbrWhack, NULL );
-
-    if ( rc == 0 )
-        rc = expect ( tbl, src, next_token ( tbl, src, t ), eSemiColon, ";", false );
-
-    return rc;
-}
-#endif
diff --git a/libs/vdb/schema.c b/libs/vdb/schema.c
deleted file mode 100644
index ff38a0d..0000000
--- a/libs/vdb/schema.c
+++ /dev/null
@@ -1,1767 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "va_copy.h"
-
-#define KONST const
-#include "dbmgr-priv.h"
-#undef KONST
-
-#include "schema-priv.h"
-#include "schema-tok.h"
-#include "schema-parse.h"
-
-#include <kdb/meta.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/symbol.h>
-#include <klib/symtab.h>
-#include <klib/namelist.h>
-#include <klib/data-buffer.h>
-#include <klib/printf.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <os-native.h>      /* because of snprintf on windows */
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * KDirectory
- */
-static
-void CC KDirRefRelease ( void *item, void *ignore )
-{
-    KDirectoryRelease ( ( const void* ) item );
-}
-
-/*--------------------------------------------------------------------------
- * generic
- */
-
-void CC VectMbrWhack ( void *item, void *ignore )
-{
-    free ( item );
-}
-
-void CC BSTreeMbrWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/*--------------------------------------------------------------------------
- * KSymbol
- */
-rc_t KSymbolCopy ( BSTree *scope, KSymbol **cp, const KSymbol *orig )
-{
-    rc_t rc;
-    KSymbol *copy, *dad = NULL;
-
-    /* recursively copy namespaces */
-    if ( orig -> dad != NULL )
-    {
-        rc = KSymbolCopy ( scope, cp, orig -> dad );
-        if ( rc != 0 )
-            return rc;
-
-        /* copied dad becomes scope */
-        dad = * cp;
-        scope = & dad -> u . scope;
-    }
-
-#if COPY_SHARE_TEXT
-    /* create simple copy with no new space for text */
-    copy = malloc ( sizeof * copy );
-#else
-    copy = malloc ( sizeof (*copy) + orig->name.size + 1 );
-#endif
-    if ( copy == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    /* copy original, including pointer to string */
-    * copy = * orig;
-
-#if ! COPY_SHARE_TEXT
-
-    /* copy original including string */
-    string_copy ( ( char* ) ( copy + 1 ), orig -> name . size + 1,
-        orig -> name . addr, orig -> name . size );
-
-    /* fix up pointer to string */
-    copy -> name . addr = ( const char* ) ( copy + 1 );
-#endif
-    copy -> dad = dad;
-
-    /* if we just created a namespace, forget its children */
-    if ( copy -> type == eNamespace )
-    {
-        BSTreeInit ( & copy -> u . scope );
-        rc = BSTreeInsertUnique ( scope, & copy -> n, ( BSTNode** ) cp, KSymbolSort );
-        if ( rc != 0 )
-        {
-            free ( copy );
-            copy = * cp;
-            if ( copy -> type == eNamespace )
-                rc = 0;
-            else
-                copy = NULL;
-        }
-    }
-    else
-    {
-        rc = BSTreeInsertUnique ( scope, & copy -> n, ( BSTNode** ) cp, KSymbolSort );
-        if ( rc != 0 )
-        {
-            free ( copy );
-            copy = NULL;
-        }
-    }
-
-/*     if (*cp != copy) */
-/*      fprintf(stderr,"%p\t%30s %30.*s\tmalloc\t%d\n", (void*)copy,  */
-/*              __func__,(int)copy->name.size,copy->name.addr, copy->type); */
-
-    * cp = copy;
-    return rc;
-}
-
-bool CC KSymbolCopyScope ( BSTNode *n, void *scope )
-{
-    const KSymbol *sym = ( const KSymbol* ) n;
-
-    /* perform a deep copy of leaf symbols */
-    if ( sym -> type != eNamespace )
-    {
-        KSymbol *ignore;
-        rc_t rc = KSymbolCopy ( scope, & ignore, sym );
-        return ( rc != 0 ) ? true : false;
-    }
-
-    /* traverse namespaces to find leaves */
-    return BSTreeDoUntil ( & sym -> u . scope, false, KSymbolCopyScope, scope );
-}
-
-#if _DEBUGGING
-static
-void CC KSymbolList ( BSTNode *item, void *data )
-{
-    const KSymbol *self = ( const KSymbol* ) item;
-    const char *indent = ( const char* ) data;
-
-    OUTMSG (( "%s%.*s = %#p"
-             , indent
-             , ( int ) self -> name . size, self -> name . addr
-             , self
-        ));
-
-    if ( self -> type != eNamespace )
-        putchar ( '\n' );
-    else
-    {
-        printf ( " ( namespace ):\n" );
-        if ( indent [ -1 ] != '.' )
-            -- indent;
-
-        BSTreeForEach ( & self -> u . scope, false, KSymbolList, ( void* ) indent );
-    }
-}
-
-static
-void CC BSTreeListSymbols ( const BSTree *self, const char *indent )
-{
-    OUTMSG (( "%sscope = %#p\n"
-             , indent
-             , self
-        ));
-
-    if ( indent [ -1 ] != '.' )
-        -- indent;
-
-    BSTreeForEach ( self, false, KSymbolList, ( void* ) indent );
-}
-#endif
-
-
-
-/* ExamineContents
- *  not much to be done here
- */
-#if EXAMINE_SCHEMA_CONTENTS >= 1
-bool CC KSymbolExamineContents ( BSTNode *n, void *data )
-{
-    rc_t *rc = data;
-    const KSymbol *sym = ( const KSymbol* ) n;
-
-    /* can test heuristic that name is NULL-terminated,
-       that name size and length are identical */
-
-    /* can test that symbol type is a valid id type */
-    return false;
-}
-#endif
-
-
-
-
-/*--------------------------------------------------------------------------
- * KMDataNode
- */
-
-/* FillSchema
- *  a schema buffer fill function that reads from KMDataNode
- */
-rc_t CC KMDataNodeFillSchema ( void *data, KTokenText *tt, size_t save )
-{
-    rc_t rc;
-    size_t num_read;
-    KMDataNodeSchemaFillData *pb = data;
-
-     /* on very first fill, check for specifying v0 */
-    if ( pb -> add_v0 )
-    {
-        assert ( save == 0 );
-        CONST_STRING ( & tt -> str, "version 0;" );
-        pb -> add_v0 = false;
-        return 0;
-    }
-
-   /* save any characters not yet consumed */
-    if ( save != 0 )
-    {
-        assert ( save < sizeof pb -> buff );
-        memmove ( pb -> buff,
-            & tt -> str . addr [ tt -> str . size - save ], save );
-    }
-
-    /* read as many characters as are available */
-    rc = KMDataNodeRead ( pb -> node, pb -> pos,
-        & pb -> buff [ save ], sizeof pb -> buff - save, & num_read, NULL );
-    if ( rc == 0 )
-    {
-	/******** PROTECT FROM BUGS IN TOKENIZER ****/
-	if(num_read == sizeof (pb -> buff) - save){ /** not the last chunk ***/
-		int i;
-		for(i=num_read+save-1;i > save && (isalnum(pb -> buff[i]) || pb -> buff[i]=='_');i--){}
-		if(i > save && pb -> buff[i]=='.'){ /*** leave this physical column for the next buffer **/
-			num_read=i-save;
-		}
-	}
-	/********************************************/
-        /* reset the buffer in "tt" */
-        tt -> str . addr = pb -> buff;
-        tt -> str . size = save + num_read;
-        tt -> str . len = string_len ( pb -> buff, save + num_read );
-        pb -> pos += num_read;
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * SNameOverload
- */
-
-/* Whack
- */
-void CC SNameOverloadWhack ( void *item, void *ignore )
-{
-    SNameOverload *self = item;
-    VectorWhack ( & self -> items, NULL, NULL );
-    free ( self );
-}
-
-/* Make
- */
-rc_t SNameOverloadMake ( SNameOverload **np,
-    const KSymbol *sym, uint32_t start, uint32_t len )
-{
-    SNameOverload *name = malloc ( sizeof * name );
-    if ( name == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-
-    name -> name = sym;
-    ( ( KSymbol* ) sym ) -> u . obj = name;
-    VectorInit ( & name -> items, start, len );
-    name -> cid . ctx = 0;
-
-    * np = name;
-    return 0;
-}
-
-/* Copy
- */
-rc_t SNameOverloadCopy ( BSTree *scope,
-    SNameOverload **cp, const SNameOverload *orig )
-{
-    KSymbol *sym;
-    rc_t rc = KSymbolCopy ( scope, & sym, orig -> name );
-    if ( rc == 0 )
-    {
-        SNameOverload *copy;
-        rc = SNameOverloadMake ( & copy, sym, 0, 0 );
-        if ( rc == 0 )
-        {
-            /* copy contents */
-            rc = VectorCopy ( & orig -> items, & copy -> items );
-            if ( rc == 0 )
-            {
-                copy -> cid = orig -> cid;
-                * cp = copy;
-                return 0;
-            }
-
-            SNameOverloadWhack ( copy, NULL );
-        }
-
-        BSTreeUnlink ( scope, & sym -> n );
-        KSymbolWhack ( & sym -> n, NULL );
-    }
-
-    * cp = NULL;
-    return rc;
-}
-
-typedef struct SNameOverloadCopyData SNameOverloadCopyData;
-struct SNameOverloadCopyData
-{
-    BSTree *scope;
-    Vector *dest;
-    rc_t rc;
-};
-
-static
-bool CC SNameOverloadVectorCopyItem ( void *item, void *data )
-{
-    SNameOverloadCopyData *pb = data;
-
-    SNameOverload *copy;
-    pb -> rc = SNameOverloadCopy ( pb -> scope, & copy, ( const void* ) item );
-    if ( pb -> rc == 0 )
-        pb -> rc = VectorAppend ( pb -> dest, & copy -> cid . id, copy );
-
-    return ( pb -> rc != 0 ) ? true : false;
-}
-
-rc_t SNameOverloadVectorCopy ( BSTree *scope, const Vector *src, Vector *dest )
-{
-    SNameOverloadCopyData pb;
-    pb . scope = scope;
-    pb . dest = dest;
-    pb . rc = 0;
-
-    if ( VectorDoUntil ( src, false, SNameOverloadVectorCopyItem, & pb ) )
-        return pb . rc;
-
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * VIncludedPath
- */
-typedef struct VIncludedPath VIncludedPath;
-struct VIncludedPath
-{
-    BSTNode n;
-    uint32_t ord;
-    char path [ 1 ];
-};
-
-/* Cmp
- * Sort
- */
-static
-int CC VIncludedPathCmp ( const void *item, const BSTNode *n )
-{
-    const char *a = item;
-    const VIncludedPath *b = ( const VIncludedPath* ) n;
-    return strcmp ( a, b -> path );
-}
-
-static
-int CC VIncludedPathSort ( const BSTNode *item, const BSTNode *n )
-{
-    const VIncludedPath *a = ( const VIncludedPath* ) item;
-    const VIncludedPath *b = ( const VIncludedPath* ) n;
-    return strcmp ( a -> path, b -> path );
-}
-
-static
-int CC VIncludedPathSortByOrder ( const BSTNode *item, const BSTNode *n )
-{
-    const VIncludedPath *a = ( const VIncludedPath* ) item;
-    const VIncludedPath *b = ( const VIncludedPath* ) n;
-    return ( int ) a -> ord - ( int ) b -> ord;
-}
-
-/* Make
- */
-static
-rc_t CC VIncludedPathMake ( BSTree *paths, uint32_t *count, const char *path )
-{
-    VIncludedPath *p = malloc ( sizeof * p + strlen ( path ) );
-    if ( p == NULL )
-        return RC ( rcVDB, rcSchema, rcParsing, rcMemory, rcExhausted );
-    p -> ord = ( * count ) ++;
-    strcpy ( p -> path, path );
-    BSTreeInsert ( paths, & p -> n, VIncludedPathSort );
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * VSchema
- *  a symbol scope
- *  data types, blob formats, function and sub-schema declarations
- *  database and table declarations
- */
-
-
-#if _DEBUGGING
-/* Listing
- *  list symbol tables
- */
-void VSchemaListSymtab ( const VSchema *self )
-{
-    if ( self != NULL )
-    {
-        const char *indent = ".                ";
-        VSchemaListSymtab ( self -> dad );
-        BSTreeListSymbols ( & self -> scope, & indent [ 17 ] );
-        putchar ( '\n' );
-    }
-}
-#endif
-
-
-/* Marking
- */
-void VSchemaClearMark ( const VSchema *self )
-{
-    if ( self == NULL )
-        return;
-
-    VectorForEach ( & self -> fmt, false, SFormatClearMark, NULL );
-    VectorForEach ( & self -> dt, false, SDatatypeClearMark, NULL );
-    VectorForEach ( & self -> ts, false, STypesetClearMark, NULL );
-    VectorForEach ( & self -> cnst, false, SConstantClearMark, NULL );
-    VectorForEach ( & self -> func, false, SFunctionClearMark, NULL );
-    VectorForEach ( & self -> phys, false, SPhysicalClearMark, NULL );
-    VectorForEach ( & self -> tbl, false, STableClearMark, NULL );
-    VectorForEach ( & self -> db, false, SDatabaseClearMark, NULL );
-
-    if ( self -> dad != NULL )
-        VSchemaClearMark ( self -> dad );
-}
-
-
-/* Destroy
- */
-static
-void CC VSchemaDestroy ( VSchema *self )
-{
-    REFMSG ( "VSchema", "destroy", & self -> refcount );
-    
-    BSTreeWhack ( & self -> scope, KSymbolWhack, NULL );
-    BSTreeWhack ( & self -> paths, BSTreeMbrWhack, NULL );
-    VectorWhack ( & self -> inc, KDirRefRelease, NULL );
-    VectorWhack ( & self -> alias, NULL, NULL );
-    VectorWhack ( & self -> fmt, SFormatWhack, NULL );
-#if SLVL >= 1
-    VectorWhack ( & self -> dt, SDatatypeWhack, NULL );
-    VectorWhack ( & self -> ts, STypesetWhack, NULL );
-#endif
-#if SLVL >= 3
-    VectorWhack ( & self -> pt, SIndirectTypeWhack, NULL );
-#endif
-#if SLVL >= 2
-    VectorWhack ( & self -> cnst, SConstantWhack, NULL );
-#endif
-#if SLVL >= 3
-    VectorWhack ( & self -> func, SFunctionWhack, NULL );
-    VectorWhack ( & self -> fname, SNameOverloadWhack, NULL );
-#endif
-#if SLVL >= 5
-    VectorWhack ( & self -> phys, SPhysicalWhack, NULL );
-    VectorWhack ( & self -> pname, SNameOverloadWhack, NULL );
-#endif
-#if SLVL >= 6
-    VectorWhack ( & self -> tbl, STableWhack, NULL );
-    VectorWhack ( & self -> tname, SNameOverloadWhack, NULL );
-
-    VectorWhack ( & self -> db, SDatabaseWhack, NULL );
-    VectorWhack ( & self -> dname, SNameOverloadWhack, NULL );
-#endif
-
-    free ( self );
-}
-
-/* Whack
- */
-static
-rc_t CC VSchemaWhack ( VSchema *self )
-{
-    KRefcountWhack ( & self -> refcount, "VSchema" );
-
-    VSchemaSever ( self -> dad );
-    VSchemaDestroy ( self );
-
-    return 0;
-}
-
-
-/* AddRef
- * Release
- *  all objects are reference counted
- *  NULL references are ignored
- */
-LIB_EXPORT rc_t CC VSchemaAddRef ( const VSchema *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VSchema" ) )
-        {
-        case krefLimit:
-            return RC ( rcVDB, rcMgr, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VSchemaRelease ( const VSchema *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VSchema" ) )
-        {
-        case krefWhack:
-            return VSchemaWhack ( ( VSchema* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- */
-VSchema *VSchemaAttach ( const VSchema *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "VSchema" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( VSchema* ) self;
-}
-
-rc_t VSchemaSever ( const VSchema *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "VSchema" ) )
-        {
-        case krefWhack:
-            return VSchemaWhack ( ( VSchema* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcMgr, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* StartIdx
- *  returns starting index
- */
-#define VSchemaStartIdx( dad, vect, starting ) \
-    ( ( ( dad ) == NULL ) ? ( starting ) : \
-      ( VectorStart ( & ( dad ) -> vect ) + \
-        VectorLength ( & ( dad ) -> vect ) ) )
-
-/* VectorInit
- *  performs vector initialization
- */
-#define VSchemaVectorInit( schema, dad, vect, starting, block ) \
-    VectorInit ( & ( schema ) -> vect, VSchemaStartIdx ( dad, vect, starting ), block )
-
-
-/* MakeSchema
- *  make an empty schema
- */
-rc_t VSchemaMake ( VSchema **sp,  const VSchema *dad )
-{
-    VSchema *schema = malloc ( sizeof * schema );
-    if ( schema == NULL )
-        return RC ( rcVDB, rcMgr, rcConstructing, rcMemory, rcExhausted );
-
-    schema -> dad = VSchemaAttach ( dad );
-    BSTreeInit ( & schema -> scope );
-    BSTreeInit ( & schema -> paths );
-
-    /* datatypes, typesets and parameterized types all shared
-       the same type_id space from 0..0xFFFFFFFF. each is
-       assigned a range to avoid overlap:
-
-       datatypes = 0..0x3FFFFFFF
-       typesets = 0x40000000..0x7FFFFFFF
-       undefined parameterized type = 0x80000000
-       parameterized types = 0x80000001..0xFFFFFFFF
-    */
-    VSchemaVectorInit ( schema, dad, inc, 0, 4 );
-    VSchemaVectorInit ( schema, dad, alias, 0, 16 );
-    VSchemaVectorInit ( schema, dad, fmt, 1, 16 );
-    VSchemaVectorInit ( schema, dad, dt, 0, 128 );
-    VSchemaVectorInit ( schema, dad, ts, 0x40000000, 16 );
-    VSchemaVectorInit ( schema, dad, pt, 0x80000001, 32 );
-
-    VSchemaVectorInit ( schema, dad, cnst, 0, 32 );
-    VSchemaVectorInit ( schema, dad, func, 0, 64 );
-    VSchemaVectorInit ( schema, dad, phys, 0, 32 );
-    VSchemaVectorInit ( schema, dad, tbl, 0, 16 );
-    VSchemaVectorInit ( schema, dad, db, 0, 4 );
-
-    VectorInit ( & schema -> fname, 0, 64 );
-    VectorInit ( & schema -> pname, 0, 32 );
-    VectorInit ( & schema -> tname, 0, 16 );
-    VectorInit ( & schema -> dname, 0, 4 );
-
-    KRefcountInit ( & schema -> refcount, 1, "VSchema", "make", "vschema" );
-    schema -> file_count = 0;
-
-    /* copy the versioned name vectors and names */
-    if ( dad != NULL )
-    {
-        rc_t rc = SNameOverloadVectorCopy ( & schema -> scope, & dad -> fname, & schema -> fname );
-        if ( rc == 0 )
-            rc = SNameOverloadVectorCopy ( & schema -> scope, & dad -> pname, & schema -> pname );
-        if ( rc == 0 )
-            rc = SNameOverloadVectorCopy ( & schema -> scope, & dad -> tname, & schema -> tname );
-        if ( rc == 0 )
-            rc = SNameOverloadVectorCopy ( & schema -> scope, & dad -> dname, & schema -> dname );
-        if ( rc != 0 )
-        {
-            VSchemaWhack ( schema );
-            * sp = NULL;
-            return rc;
-        }
-    }
-    
-    * sp = schema;
-    return 0;
-}
-
-
-/* AddIncludePath
- *  add an include path to schema for locating input files
- */
-LIB_EXPORT rc_t CC VSchemaVAddIncludePath ( VSchema *self, const char *path, va_list args )
-{
-    KDirectory *wd;
-    rc_t rc = KDirectoryNativeDir ( & wd );
-    if ( rc == 0 )
-    {
-        const KDirectory *dir;
-        rc = KDirectoryVOpenDirRead ( wd, & dir, false, path, args );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> inc, NULL, dir );
-            if ( rc != 0 )
-                KDirectoryRelease ( dir );
-        }
-
-        KDirectoryRelease ( wd );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaAddIncludePath ( VSchema *self, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VSchemaVAddIncludePath ( self, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ParseText
- *  parse schema text
- *  add productions to existing schema
- *
- *  "name" [ IN, NULL OKAY ] - optional name
- *  representing text, e.g. filename
- *
- *  "text" [ IN ] and "bytes" [ IN ] - input buffer of text
- */
-static
-rc_t CC VSchemaParseTextInt ( VSchema *self,
-    const char *name, const char *text, size_t bytes )
-{
-    KTokenText tt;
-    KTokenSource src;
-    String str, path;
-    rc_t rc;
-    
-    if ( name == NULL || name [ 0 ] == 0 )
-        CONST_STRING ( & path, "<unnamed>" );
-    else
-        StringInitCString ( & path, name );
-
-    StringInit ( & str, text, bytes, string_len ( text, bytes ) );
-    KTokenTextInit ( & tt, & str, & path );
-    KTokenSourceInit ( & src, & tt );
-
-    rc = schema ( & src, self );
-    
-    if (rc == 0)
-        PARSE_DEBUG( ("Parsed schema from %s\n", name) );
-    else
-        PARSE_DEBUG( ("Failed to parse schema from %s\n", name) );
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaParseText ( VSchema *self, const char *name,
-    const char *text, size_t bytes )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcSelf, rcNull );
-    else if ( bytes == 0 )
-        rc = 0;
-    else if ( text == NULL )
-        rc = RC ( rcVDB, rcSchema, rcParsing, rcParam, rcNull );
-    else
-        rc = VSchemaParseTextInt ( self, name, text, bytes );
-
-    return rc;
-}
-
-
-/* ParseTextCallback
- *  parse schema text
- *  add productions to existing schema
- *
- *  "name" [ IN, NULL OKAY ] - optional name
- *  representing text, e.g. filename
- *
- *  "fill" [ IN ] and "data" [ IN, OPAQUE ] - for filling buffer
- */
-rc_t VSchemaParseTextCallback ( VSchema *self, const char *name,
-    rc_t ( CC * fill ) ( void *self, KTokenText *tt, size_t save ), void *data )
-{
-    KTokenText tt;
-    KTokenSource src;
-
-    KTokenTextInitCString ( & tt, "", name );
-    tt . read = fill;
-    tt . data = data;
-
-    KTokenSourceInit ( & src, & tt );
-
-    return schema ( & src, self );
-}
-
-
-/* OpenFile
- *  opens a file, using include paths
- */
-static
-rc_t CC VSchemaTryOpenFile ( const VSchema *self, const KDirectory *dir, const KFile **fp,
-    char *path, size_t path_max, const char *name, va_list args )
-{
-    rc_t rc;
-    va_list cpy_args;
-
-    va_copy ( cpy_args, args );
-    rc = KDirectoryVResolvePath ( dir, true, path, path_max, name, cpy_args );
-    va_end ( cpy_args );
-
-    if ( rc == 0 )
-    {
-        /* try to find file in already opened list */
-        if ( BSTreeFind ( & self -> paths, path, VIncludedPathCmp ) != NULL )
-        {
-            * fp = NULL;
-            return 0;
-        }
-    }
-
-    if ( rc == 0 )
-        rc = KDirectoryVOpenFileRead ( dir, fp, path, NULL );
-
-    return rc;
-}
-
-static
-rc_t CC VSchemaOpenFile ( const VSchema *self, const KFile **fp,
-    char *path, size_t path_max, const char *name, va_list args )
-{
-    const VSchema *schema;
-    for ( schema = self; schema != NULL; schema = schema -> dad )
-    {
-        uint32_t i, end;
-
-        for ( i = VectorStart ( & schema -> inc ), end = i + VectorLength ( & schema -> inc );
-              i < end; ++ i )
-        {
-            const KDirectory *dir = ( const KDirectory* ) VectorGet ( & schema -> inc, i );
-            if ( dir != NULL )
-            {
-                rc_t rc = VSchemaTryOpenFile ( self, dir, fp, path, path_max, name, args );
-                if ( rc == 0 || GetRCState ( rc ) != rcNotFound )
-                    return rc;
-            }
-        }
-    }
-
-    return RC ( rcVDB, rcSchema, rcOpening, rcPath, rcNotFound );
-}
-
-/* ParseFile
- *  parse schema file
- *  add productions to existing schema
- *
- *  "name" [ IN ] - filename, absolute or valid relative to
- *  working directory or within an include path
- */
-LIB_EXPORT rc_t CC VSchemaVParseFile ( VSchema *self, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcOpening, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcOpening, rcPath, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcOpening, rcPath, rcEmpty );
-    else
-    {
-        const KFile *f;
-        char path [ 4096 ];
-
-        /* open file using include paths */
-        rc = VSchemaOpenFile ( self, & f, path, sizeof path, name, args );
-
-        /* try to open the file according to current directory */
-        if ( rc != 0 )
-        {
-            KDirectory *wd;
-            rc = KDirectoryNativeDir ( & wd );
-            if ( rc == 0 )
-            {
-                rc = VSchemaTryOpenFile ( self, wd, & f, path, sizeof path, name, args );
-                KDirectoryRelease ( wd );
-            }
-        }
-
-        /* if the file was opened... */
-        if ( rc == 0 && f != NULL )
-        {
-            const KMMap *mm;
-            rc = KMMapMakeRead ( & mm, f );
-            if ( rc == 0 )
-            {
-                size_t size;
-                const void *addr;
-                rc = KMMapAddrRead ( mm, & addr );
-                if ( rc == 0 )
-                    rc = KMMapSize ( mm, & size );
-                if ( rc == 0 )
-                {
-                    rc = VIncludedPathMake ( & self -> paths, & self -> file_count, path );
-                    if ( rc == 0 )
-                        rc = VSchemaParseTextInt ( self, path, addr, size );
-                }
-            
-                KMMapRelease ( mm );
-            }
-        
-            KFileRelease ( f );
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaParseFile ( VSchema *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaVParseFile ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ResolveFmtdecl
- *  converts a fmtdecl string to fmt id, type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved fmtdecl
- *
- *  "fmtdecl" [ IN ] - type declaration
- */
-rc_t CC VSchemaVResolveFmtdecl ( const VSchema *self,
-    VFormatdecl *resolved, const char *decl, va_list args )
-{
-    rc_t rc;
-
-    if ( resolved == NULL )
-        rc = RC ( rcVDB, rcSchema, rcResolving, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcResolving, rcSelf, rcNull );
-        else if ( decl == NULL )
-            rc = RC ( rcVDB, rcSchema, rcResolving, rcType, rcNull );
-        else if ( decl [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcSchema, rcResolving, rcType, rcEmpty );
-        else
-        {
-            char buffer [ 256 ];
-            int len = vsnprintf ( buffer, sizeof buffer, decl, args );
-            if ( len < 0 || len >= sizeof buffer )
-                rc = RC ( rcVDB, rcSchema, rcResolving, rcType, rcExcessive );
-            else
-            {
-                KSymTable tbl;
-                rc = init_symtab ( & tbl, self );
-                if ( rc == 0 )
-                {
-                    KToken t;
-                    KTokenText tt;
-                    KTokenSource src;
-                    String text, path;
-
-                    SchemaEnv env;
-                    SchemaEnvInit ( & env, EXT_SCHEMA_LANG_VERSION );
-
-                    StringInit ( & text, buffer, len, string_len ( buffer, len ) );
-                    CONST_STRING ( & path, "VSchemaResolve" );
-                    KTokenTextInit ( & tt, & text, & path );
-                    KTokenSourceInit ( & src, & tt );
-
-                    rc = fmtspec ( & tbl, & src, next_token ( & tbl, & src, & t ),
-                        & env, self, resolved );
-
-                    KSymTableWhack ( & tbl );
-
-                    if ( rc == 0 )
-                        return 0;
-                }
-            }
-        }
-
-        resolved -> td . type_id = 0;
-        resolved -> td . dim = 0;
-        resolved -> fmt = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaResolveFmtdecl ( const VSchema *self,
-    VFormatdecl *resolved, const char *fmtdecl, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, fmtdecl );
-    rc = VSchemaVResolveFmtdecl ( self, resolved, fmtdecl, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ResolveTypespec
- *  converts a typespec string to fmt id, type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved fmtdecl
- *
- *  "typespec" [ IN ] - type specification
- */
-LIB_EXPORT rc_t CC VSchemaVResolveTypespec ( const VSchema *self,
-    VTypedecl *resolved, const char *decl, va_list args )
-{
-    rc_t rc;
-
-    if ( resolved == NULL )
-        rc = RC ( rcVDB, rcSchema, rcResolving, rcParam, rcNull );
-    else
-    {
-        VFormatdecl fd;
-        rc = VSchemaVResolveFmtdecl ( self, & fd, decl, args );
-        if ( rc == 0 )
-        {
-            if ( fd . fmt != 0 )
-                rc = RC ( rcVDB, rcSchema, rcResolving, rcType, rcIncorrect );
-            else
-            {
-                * resolved = fd . td;
-                return 0;
-            }
-        }
-
-        resolved -> type_id = 0;
-        resolved -> dim = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaResolveTypespec ( const VSchema *self,
-    VTypedecl *resolved, const char *typespec, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, typespec );
-    rc = VSchemaVResolveTypespec ( self, resolved, typespec, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* ResolveTypedecl
- *  converts a typedecl string to type id and vector dimension
- *
- *  "resolved" [ OUT ] - resolved type declaration
- *
- *  "typedecl" [ IN ] - type declaration
- */
-LIB_EXPORT rc_t CC VSchemaVResolveTypedecl ( const VSchema *self,
-    VTypedecl *resolved, const char *decl, va_list args )
-{
-    rc_t rc = VSchemaVResolveTypespec ( self, resolved, decl, args );
-    if ( rc == 0 )
-    {
-        if ( ( resolved -> type_id & 0xC0000000 ) == 0 )
-            return 0;
-
-        rc = RC ( rcVDB, rcSchema, rcResolving, rcType, rcIncorrect );
-        
-        resolved -> type_id = 0;
-        resolved -> dim = 0;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaResolveTypedecl ( const VSchema *self,
-    VTypedecl *resolved, const char *typedecl, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, typedecl );
-    rc = VSchemaVResolveTypedecl ( self, resolved, typedecl, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* IncludeFiles
- *  generates a list of paths to include file
- */
-static
-bool CC VIncludedPathList ( BSTNode *n, void *list )
-{
-    const VIncludedPath *p = ( const VIncludedPath* ) n;
-    rc_t rc = VNamelistAppend ( list, p -> path );
-    return ( rc != 0 ) ? true : false;
-}
-
-LIB_EXPORT rc_t CC VSchemaIncludeFiles ( const VSchema *self, const KNamelist **listp )
-{
-    rc_t rc;
-    if ( listp == NULL )
-        rc = RC ( rcVDB, rcSchema, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcSelf, rcNull );
-        else
-        {
-            /* create namelist */
-            VNamelist *list;
-            rc = VNamelistMake ( & list, self -> file_count );
-            if ( rc == 0 )
-            {
-                /* create a shallow copy */
-                BSTree paths = self -> paths;
-
-                /* sort by order rather than by path */
-                BSTreeResort ( & paths, VIncludedPathSortByOrder );
-
-                /* add paths to list */
-                if ( BSTreeDoUntil ( & paths, false, VIncludedPathList, list ) )
-                    rc = RC ( rcVDB, rcSchema, rcListing, rcMemory, rcExhausted );
-
-                /* restore path order */
-                BSTreeResort ( & paths, VIncludedPathSort );
-                assert ( paths . root == self -> paths . root );
-
-                /* cast list, creating a new reference */
-                if ( rc == 0 )
-                    rc = VNamelistToNamelist ( list, (KNamelist **)listp );
-
-                /* discard original reference */
-                VNamelistRelease ( list );
-
-                /* return list */
-                if ( rc == 0 )
-                    return 0;
-            }
-        }
-
-        * listp = NULL;
-    }
-    return rc;
-}
-
-
-/* ListLegacyTables - PRIVATE
- *  scan all tables defined in schema
- *  return the fully-qualified and versioned name of each legacy SRA table
- */
-typedef struct STableFindData STableFindData;
-struct STableFindData
-{
-    VNamelist *list;
-    rc_t rc;
-};
-
-static
-bool CC STableTestUntyped ( void *item, void *data )
-{
-    const STable *stbl = ( const void* ) item;
-    STableFindData *pb = data;
-
-    if ( stbl -> untyped != NULL )
-    {
-        char buffer [ 1024 ];
-
-        /* found a legacy table */
-        pb -> rc = string_printf ( buffer, sizeof buffer, NULL, "%N#%V", stbl -> name, stbl -> version );
-        if ( pb -> rc != 0 )
-        {
-            pb -> rc = RC ( rcVDB, rcSchema, rcListing, rcName, rcExcessive );
-            return true;
-        }
-
-        /* add it to the vector */
-        pb -> rc = VNamelistAppend ( pb -> list, buffer );
-        if ( pb -> rc != 0 )
-            return true;
-    }
-
-    return false;
-}
-
-static
-bool VSchemaFindUntyped ( const VSchema *self, STableFindData *pb )
-{
-    if ( self -> dad )
-    {
-        if ( VSchemaFindUntyped ( self -> dad, pb ) )
-            return true;
-    }
-
-    return VectorDoUntil ( & self -> tbl, false, STableTestUntyped, pb );
-}
-
-LIB_EXPORT rc_t CC VSchemaListLegacyTables ( const VSchema *self, KNamelist **listp )
-{
-    rc_t rc;
-
-    if ( listp == NULL )
-        rc = RC ( rcVDB, rcSchema, rcListing, rcParam, rcNull );
-    else
-    {
-        * listp = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcSelf, rcNull );
-        else
-        {
-            STableFindData pb;
-            rc = VNamelistMake ( & pb . list, 16 );
-            if ( rc == 0 )
-            {
-                pb . rc = 0;
-                if ( VSchemaFindUntyped ( self, & pb ) )
-                    rc = pb . rc;
-                else
-                    rc = VNamelistToNamelist ( pb . list, listp );
-                    
-                VNamelistRelease ( pb . list );
-            }
-        }
-    }
-
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * VDBManager
- */
-
-LIB_EXPORT rc_t CC VDBManagerMakeSchema ( const VDBManager *self, VSchema **schema )
-{
-    rc_t rc;
-    if ( schema == NULL )
-        rc = RC ( rcVDB, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcConstructing, rcSelf, rcNull );
-        else
-        {
-            rc = VSchemaMake ( schema, self -> schema );
-            if ( rc == 0 )
-                return rc;
-        }
-
-        * schema = NULL;
-    }
-
-    return rc;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * VSchemaRuntimeTable
- *  an object that represents a table ( or sub-table ) created at runtime
- *  that can be used to create a VTable object
- */
-struct VSchemaRuntimeTable
-{
-    VSchema *schema;
-    KDataBuffer text;
-    size_t bytes;
-};
-
-
-/* Print
- *  print schema text into buffer
- */
-static
-rc_t VSchemaRuntimeTablePrint ( VSchemaRuntimeTable *self, const char *fmt, ... )
-{
-    int status;
-    va_list args;
-
-    char *buffer;
-    size_t bsize;
-
-    /* make sure there's a bunch of room */
-    if ( self -> text . elem_count - self -> bytes < 4096 )
-    {
-        rc_t rc = KDataBufferResize ( & self -> text, self -> text . elem_count + 4096 );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* the output buffer for this print */
-    buffer = self -> text . base;
-    bsize = self -> text . elem_count - self -> bytes;
-
-    va_start ( args, fmt );
-    status = vsnprintf ( & buffer [ self -> bytes ], bsize, fmt, args );
-    va_end ( args );
-
-    if ( status < 0 || status >= bsize )
-        return RC ( rcVDB, rcSchema, rcConstructing, rcParam, rcExcessive );
-
-    self -> bytes += status;
-    return 0;
-}
-
-
-/* Make
- *  make a table in the schema provided
- *
- *  "tbl" [ OUT ] - return parameter for new schema table object
- *
- *  "typename" [ IN ] - NUL terminated string giving desired typename of table
- *   may include version spec
- *
- *  "supertype_spec" [ IN, NULL OKAY ] - optional supertype spec, giving
- *   either a single super-table type string or multiple comma-separated tables
- */
-LIB_EXPORT rc_t CC VSchemaMakeRuntimeTable ( VSchema *self,
-    VSchemaRuntimeTable **tblp, const char *typename, const char *supertype_spec )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcSchema, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcSchema, rcConstructing, rcSelf, rcNull );
-        else if ( typename == NULL )
-            rc = RC ( rcVDB, rcSchema, rcConstructing, rcType, rcNull );
-        else if ( typename [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcSchema, rcConstructing, rcType, rcEmpty );
-        else
-        {
-            VSchemaRuntimeTable *tbl = malloc ( sizeof * tbl );
-            if ( tbl == NULL )
-                rc = RC ( rcVDB, rcSchema, rcConstructing, rcMemory, rcExhausted );
-            else
-            {
-                rc = KDataBufferMakeBytes ( & tbl -> text, 4096 * 2 );
-                if ( rc == 0 )
-                {
-                    rc = VSchemaAddRef ( self );
-                    if ( rc == 0 )
-                    {
-                        const char *dflt_vers = "";
-                        if ( strchr ( typename, '#' ) == NULL )
-                            dflt_vers = "#1.0";
-
-                        tbl -> schema = self;
-                        tbl -> bytes = 0;
-
-                        /* open the table */
-                        rc = VSchemaRuntimeTablePrint ( tbl, "table %s%s", typename, dflt_vers );
-                        if ( rc == 0 )
-                        {
-                            if ( supertype_spec != NULL && supertype_spec [ 0 ] != 0 )
-                                rc = VSchemaRuntimeTablePrint ( tbl, " = %s", supertype_spec );
-                            if ( rc == 0 )
-                            {
-                                rc = VSchemaRuntimeTablePrint ( tbl, "\n{\n" );
-                                if ( rc == 0 )
-                                {
-                                    * tblp = tbl;
-                                    return 0;
-                                }
-                            }
-                        }
-
-                        VSchemaRelease ( tbl -> schema );
-                    }
-
-                    KDataBufferWhack ( & tbl -> text );
-                }
-
-                free ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-
-    return rc;
-}
-
-/* Close
- *  close the schema table handle
- *  discards any uncomitted data
- */
-LIB_EXPORT rc_t CC VSchemaRuntimeTableClose ( VSchemaRuntimeTable *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcClosing, rcSelf, rcNull );
-    else
-    {
-        rc = VSchemaRelease ( self -> schema );
-        if ( rc == 0 )
-        {
-            KDataBufferWhack ( & self -> text );
-            free ( self );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Commit
- *  commits table data
- *  closes object to further modification
- */
-LIB_EXPORT rc_t CC VSchemaRuntimeTableCommit ( VSchemaRuntimeTable *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcCommitting, rcSelf, rcNull );
-    else
-    {
-        const char *data = self -> text . base;
-        if ( self -> bytes == 0 )
-            rc = RC ( rcVDB, rcSchema, rcCommitting, rcSelf, rcEmpty );
-        else
-        {
-            rc = VSchemaRuntimeTablePrint ( self, "}\n" );
-            if ( rc == 0 )
-                rc = VSchemaParseText ( self -> schema, "runtime-table", data, self -> bytes );
-            KDataBufferWhack ( & self -> text );
-        }
-    }
-
-    return rc;
-}
-
-
-/* AddColumn
- *  add a simple column to the table
- *
- *  "td" [ IN ] - data type of column, obtained from schema object
- *
- *  "encoding" [ IN, NULL OKAY ] - optional compression/encoding type
- *  specified as a NUL-terminated string
- *
- *  "name" [ IN ] - NUL-terminated simple ASCII name
- *   conforming to column name requirements
- */
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddColumn ( VSchemaRuntimeTable *self, 
-    const VTypedecl *td, const char *encoding, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( td == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcType, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        char typedecl [ 256 ];
-        rc = VTypedeclToText ( td, self -> schema, typedecl, sizeof typedecl );
-        if ( rc == 0 )
-        {
-            rc = VSchemaRuntimeTablePrint ( self, "    extern column " );
-            if ( rc == 0 )
-            {
-                if ( encoding != NULL && encoding [ 0 ] != 0 )
-                    rc = VSchemaRuntimeTablePrint ( self, "%s ", encoding );
-                else
-                    rc = VSchemaRuntimeTablePrint ( self, "%s ", typedecl );
-            }
-            if ( rc == 0 )
-                rc = VSchemaRuntimeTablePrint ( self, name, args );
-            if ( rc == 0 )
-                rc = VSchemaRuntimeTablePrint ( self, ";\n" );
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddColumn ( VSchemaRuntimeTable *self, 
-    const VTypedecl *td, const char *encoding, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddColumn ( self, td, encoding, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* AddTypedColumn
- *  Gerber versions of AddColumn
- *
- *  AddBooleanColumn - simple boolean column with default compression
- *                     provides both packed ( single bit ) and byte versions
- *  AddIntegerColumn - sized integer column with appropriate sign, size and compression
- *  AddFloatColumn   - sized floating point column with lossy compression
- *  AddAsciiColumn   - 8-bit ASCII text column with standard compression
- *  AddUnicodeColumn - UTF8, UTF16, or UTF32 text column with standard compression
- */
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddBooleanColumn ( VSchemaRuntimeTable *self, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        VTypedecl td;
-        rc = VSchemaResolveTypedecl ( self -> schema, & td, "bool" );
-        if ( rc == 0 )
-            rc = VSchemaRuntimeTableVAddColumn ( self, & td, "bool_encoding", name, args );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddBooleanColumn ( VSchemaRuntimeTable *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddBooleanColumn ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddIntegerColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, bool has_sign,  const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        VTypedecl td;
-
-        char typedecl [ 256 ];
-        int status = snprintf ( typedecl, sizeof typedecl, "%c%u", has_sign ? 'I' : 'U', bits );
-        if ( status < 0 || status >= sizeof typedecl )
-            rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            rc = VSchemaResolveTypedecl ( self -> schema, & td, typedecl );
-            if ( rc != 0 && ( ( ( ( bits - 1 ) & bits ) != 0 ) || bits < 8 || bits > 64 ) )
-            {
-                status = snprintf ( typedecl, sizeof typedecl, "%c1 [ %u ]", ( bits < 4 ) ? 'B' : ( has_sign ? 'I' : 'U' ), bits );
-                if ( status < 0 || status >= sizeof typedecl )
-                    rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-                else
-                    rc = VSchemaResolveTypedecl ( self -> schema, & td, typedecl );
-            }
-            if ( rc == 0 )
-            {
-                char encoding [ 256 ];
-
-                status = snprintf ( encoding, sizeof encoding, "< %s > izip_encoding", typedecl );
-                if ( status < 0 || status >= sizeof encoding )
-                    rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-                else
-                    rc = VSchemaRuntimeTableVAddColumn ( self, & td, encoding, name, args );
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddIntegerColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, bool has_sign,  const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddIntegerColumn ( self, bits, has_sign, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddFloatColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, uint32_t significant_mantissa_bits,  const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        VTypedecl td;
-
-        char typedecl [ 256 ];
-        int status = snprintf ( typedecl, sizeof typedecl, "F%u", bits );
-        if ( status < 0 || status >= sizeof typedecl )
-            rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            rc = VSchemaResolveTypedecl ( self -> schema, & td, typedecl );
-            if ( rc == 0 )
-            {
-                char encoding [ 256 ];
-
-                if ( bits != 32 || significant_mantissa_bits >= bits )
-                {
-                    status = snprintf ( encoding, sizeof encoding,
-                        "< %s > zip_encoding", typedecl );
-                }
-                else
-                {
-                    status = snprintf ( encoding, sizeof encoding,
-                        "< %s > fzip_encoding < %u >", typedecl, significant_mantissa_bits );
-                }
-                if ( status < 0 || status >= sizeof encoding )
-                    rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-                else
-                    rc = VSchemaRuntimeTableVAddColumn ( self, & td, encoding, name, args );
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddFloatColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, uint32_t significant_mantissa_bits,  const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddFloatColumn ( self, bits, significant_mantissa_bits, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddAsciiColumn ( VSchemaRuntimeTable *self, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        VTypedecl td;
-        rc = VSchemaResolveTypedecl ( self -> schema, & td, "ascii" );
-        if ( rc == 0 )
-            rc = VSchemaRuntimeTableVAddColumn ( self, & td, "< ascii > zip_encoding", name, args );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddAsciiColumn ( VSchemaRuntimeTable *self, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddAsciiColumn ( self, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableVAddUnicodeColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcSelf, rcNull );
-    else if ( name == NULL )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcNull );
-    else if ( name [ 0 ] == 0 )
-        rc = RC ( rcVDB, rcSchema, rcUpdating, rcName, rcEmpty );
-    else
-    {
-        VTypedecl td;
-
-        char typedecl [ 256 ];
-        int status = snprintf ( typedecl, sizeof typedecl, "utf%u", bits );
-        if ( status < 0 || status >= sizeof typedecl )
-            rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-        else
-        {
-            rc = VSchemaResolveTypedecl ( self -> schema, & td, typedecl );
-            if ( rc == 0 )
-            {
-                char encoding [ 256 ];
-                status = snprintf ( encoding, sizeof encoding,
-                    "< %s > zip_encoding", typedecl );
-                if ( status < 0 || status >= sizeof encoding )
-                    rc = RC ( rcVDB, rcSchema, rcUpdating, rcBuffer, rcInsufficient );
-                else
-                    rc = VSchemaRuntimeTableVAddColumn ( self, & td, encoding, name, args );
-            }
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VSchemaRuntimeTableAddUnicodeColumn ( VSchemaRuntimeTable *self,
-    uint32_t bits, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VSchemaRuntimeTableVAddUnicodeColumn ( self, bits, name, args );
-    va_end ( args );
-
-    return rc;
-}
diff --git a/libs/vdb/split.c b/libs/vdb/split.c
deleted file mode 100644
index 14ebc12..0000000
--- a/libs/vdb/split.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-#include "blob.h"
-
-#include "blob-headers.h"
-#include "page-map.h"
-#include "blob-priv.h"
-#include "prod-priv.h"
-#include "xform-priv.h"
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-static
-int64_t read_64(const uint8_t **Src, const uint8_t *end, int scale, rc_t *rc) {
-	int64_t x = 0;
-	uint8_t c;
-	const uint8_t *src = *Src;
-	int n = 0;
-	
-	switch (scale) {
-	case 1:
-		scale = 2;
-		break;
-	case 2:
-		scale = 3;
-		break;
-	case 4:
-		scale = 5;
-		break;
-	case 8:
-		scale = 10;
-		break;
-	default:
-		return 0;
-	}
-	*rc = 0;
-	do {
-		if (src >= end) {
-			*rc = RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-			return 0;
-		}
-		if (++n > scale) {
-			*rc = RC(rcVDB, rcBlob, rcConstructing, rcData, rcInvalid);
-			return 0;
-		}
-		
-		c = *src++;
-		if ((c & 0x80) != 0)
-			break;
-		x <<= 7;
-		x |= c;
-	} while (1);
-    
-	c &= 0x7F;
-	if ((c & 0x40) != 0) {
-		c &= 0x3F;
-		x <<= 6;
-		x |= c;
-		x = -x;
-	}
-	else {
-		x <<= 6;
-		x |= c;
-	}
-	*Src = src;
-	return x;
-}
-
-static rc_t VBlobSplit_v1_validate_header(const uint8_t *inp, const uint8_t *in_end, unsigned n, const uint8_t **data) {
-    rc_t rc;
-    unsigned i;
-    
-    for (i = 0; i != n; ++i) {
-        read_64(&inp, in_end, 4, &rc);
-        if (rc != 0)
-            return rc;
-    }
-    *data = inp;
-    return 0;
-}
-
-static rc_t VBlobSplit_v1(VBlob **lhs, const VBlob *self, uint32_t index, uint32_t elem_bits) {
-    const uint8_t *inp;
-    const uint8_t *in_end;
-    const uint8_t *data;
-    size_t insize;
-    rc_t rc;
-    unsigned block_count;
-    unsigned i;
-    
-    inp = self->data.base;
-    assert(self->data.bit_offset == 0);
-    insize = KDataBufferBytes(&self->data);
-    assert(insize > 0);
-    in_end = inp + insize;
-    
-    block_count = (unsigned int)read_64(&inp, in_end, 1, &rc);
-    if (rc != 0)
-        return rc;
-    
-    rc = VBlobSplit_v1_validate_header(inp, in_end, block_count, &data);
-    if (rc != 0)
-        return rc;
-    
-    for (i = 0; i != block_count; ++i) {
-        unsigned block_size = (unsigned int)read_64(&inp, in_end, 4, &rc);
-        uint8_t bits;
-        uint8_t byte_order;
-        uint16_t row_len;
-        int64_t start_id;
-        uint32_t id_span;
-        const char *datatype;
-        
-        if (data >= in_end || data + 1 >= in_end)
-            return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-        bits = data[0];
-        byte_order = data[1];
-        data += 2;
-        
-        row_len = (uint16_t)read_64(&data, in_end, 2, &rc);
-        if (rc != 0)
-            return rc;
-        
-        start_id = read_64(&data, in_end, 8, &rc);
-        if (rc != 0)
-            return rc;
-        
-        id_span = (uint32_t)read_64(&data, in_end, 4, &rc);
-        if (rc != 0)
-            return rc;
-        
-        if (data + block_size >= in_end)
-            return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-        
-        datatype = (const char *)data;
-        data = memchr(datatype, 0, block_size);
-        if (data == NULL)
-            return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInvalid);
-        
-        ++data;
-        if (data >= in_end)
-            return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInsufficient);
-        
-        if (i == index) {
-            if (((block_size * 8) - bits) % elem_bits != 0)
-                rc = RC(rcVDB, rcBlob, rcConstructing, rcData, rcInvalid);
-            else {
-                VBlob *y;
-                
-                rc = VBlobNew(&y, start_id, start_id + id_span, "split");
-                if (rc == 0) {
-                    KDataBuffer temp;
-                    
-                    y->byte_order = byte_order;
-                    rc = KDataBufferCast(&self->data, &temp, 8, false);
-                    if (rc == 0) {
-                        KDataBufferSub(&temp, &temp, (uint32_t)( data - (const uint8_t *)self->data.base ), block_size);
-                        KDataBufferCast(&temp, &temp, 1, true);
-                        temp.elem_count -= bits;
-                        rc = KDataBufferCast(&temp, &y->data, elem_bits, false);
-                        KDataBufferWhack(&temp);
-                        if (rc == 0) {
-                            rc = PageMapNewFixedRowLength(&y->pm, BlobRowCount(y), row_len);
-                            if (rc == 0) {
-                                *lhs = y;
-                                return 0;
-                            }
-                        }
-                    }
-                    TRACK_BLOB( VBlobRelease, ((VBlob*)y) );
-                    (void)VBlobRelease(y);
-                }
-            }
-            return rc;
-        }
-        data += block_size;
-    }
-    return RC(rcVDB, rcBlob, rcConstructing, rcParam, rcInvalid);
-}
-
-static rc_t VBlobSplit_v2(VBlob **lhs, const VBlob *self, uint32_t index, uint32_t elem_bits, const VBlobHeader *hdr) {
-    unsigned doffset;
-    unsigned dlength;
-    unsigned num_inputs;
-    unsigned num_maps;
-    unsigned map;
-    unsigned i;
-    int64_t val;
-    rc_t rc;
-    VBlob *y;
-    PageMap *pm;
-    BlobHeaders *headers;
-    
-    rc = VBlobHeaderArgPopHead(hdr, &val);
-    if (rc)
-        return rc;
-    num_inputs = (unsigned)val;
-    
-    if ( (unsigned)index > num_inputs )
-        return RC(rcVDB, rcBlob, rcConstructing, rcParam, rcInvalid);
-    
-    rc = VBlobHeaderArgPopHead(hdr, &val);
-    if (rc)
-        return rc;
-    num_maps = (unsigned)val;
-    
-    for (map = 0, i = 0; i != num_inputs; ++i) {
-        rc = VBlobHeaderArgPopHead(hdr, &val);
-        if (rc)
-            break;
-        if (i == index)
-            map = (unsigned)val;
-    }
-    if (rc)
-        return rc;
-    if (map > num_maps || map < 0)
-        return RC(rcVDB, rcBlob, rcConstructing, rcData, rcInvalid);
-    
-    if (self->spmc == 0) {
-        ((VBlob *)self)->spmc = malloc(sizeof(*self->spmc) - sizeof(self->spmc->pm) + num_maps * sizeof(self->spmc->pm[0]));
-        if (self->spmc) {
-            self->spmc->n = num_maps;
-            for (doffset = i = 0; i != num_maps; ++i) {
-                rc = VBlobHeaderArgPopHead(hdr, &val);
-                if (rc)
-                    break;
-                rc = PageMapDeserialize(&self->spmc->pm[i], &((uint8_t *)self->data.base)[doffset], (uint32_t)val, BlobRowCount(self));
-                if (rc)
-                    break;
-                doffset += (unsigned)val;
-            }
-        }
-        else
-            return RC(rcVDB, rcBlob, rcConstructing, rcMemory, rcExhausted);
-    }
-    else {
-        for (doffset = i = 0; i != num_maps; ++i) {
-            rc = VBlobHeaderArgPopHead(hdr, &val);
-            if (rc)
-                break;
-            doffset += (unsigned)val;
-        }
-    }
-    if (rc)
-        return rc;
-    pm = self->spmc->pm[map];
-    
-    for (i = 0; rc == 0 && i != num_inputs; ++i) {
-        rc = VBlobHeaderArgPopHead(hdr, &val);
-        if ( rc )
-            break;
-        if ( i == index ) {
-            if (val)
-                rc = BlobHeadersCreateFromData(&headers, &((uint8_t *)self->data.base)[doffset], (uint32_t)val);
-            else
-                headers = NULL;
-        }
-        doffset += (unsigned)val;
-    }
-    
-    for (dlength = 0, i = 0; rc == 0 && i != num_inputs; ++i) {
-        rc = VBlobHeaderArgPopHead(hdr, &val);
-        if (rc)
-            break;
-        if (i == index) {
-            dlength = (unsigned)val;
-            break;
-        }
-        doffset += ( ( (unsigned)val + 7 ) >> 3 );
-    }
-    if (rc)
-        return rc;
-    assert(dlength != 0);
-    
-    rc = VBlobNew(&y, self->start_id, self->stop_id, "split");
-    if (rc == 0) {
-        KDataBuffer buffer;
-        
-        rc = KDataBufferCast(&self->data, &buffer, 8, false);
-        if (rc == 0) {
-            KDataBufferSub( &buffer, &buffer, (uint32_t)doffset, (uint32_t)( (dlength + 7) >> 3 ) );
-            KDataBufferCast(&buffer, &buffer, 1, true);
-            buffer.elem_count = (uint32_t)dlength;
-            rc = KDataBufferCast(&buffer, &y->data, elem_bits, false);
-            KDataBufferWhack(&buffer);
-            if (rc == 0) {
-                y->pm = pm;
-                PageMapAddRef(y->pm);
-                y->headers = (BlobHeaders *)headers;
-                
-                *lhs = y;
-                return 0;
-            }
-        }
-        TRACK_BLOB( VBlobRelease, ((VBlob*)y) );
-        (void)VBlobRelease(y);
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VBlobBufferSplit(VBlob **lhs, const VBlob *self, uint32_t index, uint32_t elem_bits) {
-    rc_t rc;
-    
-    if (self->headers) {
-        const VBlobHeader *hdr = BlobHeadersGetHeader(self->headers);
-		
-        if (hdr) {
-            switch (VBlobHeaderVersion(hdr)) {
-            case 1:
-                rc = VBlobSplit_v2(lhs, self, index, elem_bits, hdr);
-                break;
-            default:
-                rc = RC(rcVDB, rcBlob, rcConstructing, rcData, rcBadVersion);
-                break;
-            }
-            VBlobHeaderRelease(hdr);
-            return rc;
-        }
-        return RC(rcVDB, rcBlob, rcConstructing, rcMemory, rcExhausted);
-    }
-    else {
-        return VBlobSplit_v1(lhs, self, index, elem_bits);
-    }
-}
-
-typedef struct self_t {
-    uint32_t index;
-} self_t;
-
-/* split
- *  any split #1.0 < U32 idx > ( merged_fmt in );
- *  any NCBI:split #1.0 < U32 idx > ( merged_t in );
- */
-static
-rc_t CC split_impl( void *self,
-                const VXformInfo *info,
-                int64_t row_id,
-                VBlob **rslt,
-                uint32_t argc,
-                const VBlob *argv[] )
-{
-    return VBlobBufferSplit(rslt, argv[0], ((const self_t *)self)->index, VTypedescSizeof(&info->prod->desc));
-}
-
-static
-void CC vfunc_free ( void * self )
-{
-    free ( self );
-}
-
-VTRANSFACT_BUILTIN_IMPL(vdb_split, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->self = malloc(sizeof(self_t));
-    if (rslt->self) {
-        ((self_t *)rslt->self)->index = cp->argv[0].data.u32[0];
-        rslt->whack = vfunc_free;
-        rslt->variant = vftBlobN;
-        VFUNCDESC_INTERNAL_FUNCS(rslt)->bfN = split_impl;
-        return 0;
-    }
-    return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/vdb/table-cmn.c b/libs/vdb/table-cmn.c
deleted file mode 100644
index 009d399..0000000
--- a/libs/vdb/table-cmn.c
+++ /dev/null
@@ -1,1247 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#undef KONST
-
-#include "schema-priv.h"
-#include "schema-dump.h"
-#include "linker-priv.h"
-
-#include <vdb/vdb-priv.h>
-#include <vdb/cursor.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/index.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kdb/kdb-priv.h>
-#include <klib/symbol.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-
-/* Whack
- */
-rc_t VTableWhack ( VTable *self )
-{
-    KRefcountWhack ( & self -> refcount, "VTable" );
-
-    BSTreeWhack ( & self -> read_col_cache, VColumnRefWhack, NULL );
-    BSTreeWhack ( & self -> write_col_cache, VColumnRefWhack, NULL );
-
-    KMDataNodeRelease ( self -> col_node );
-    KMetadataRelease ( self -> meta );
-    KTableRelease ( self -> ktbl );
-    VSchemaRelease ( self -> schema );
-    VLinkerRelease ( self -> linker );
-    VDatabaseSever ( self -> db );
-    VDBManagerSever ( self -> mgr );
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- */
-LIB_EXPORT rc_t CC VTableAddRef ( const VTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VTable" ) )
-        {
-        case krefLimit:
-            return RC ( rcVDB, rcTable, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VTableRelease ( const VTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VTable" ) )
-        {
-        case krefWhack:
-            return VTableWhack ( ( VTable* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-/* Attach
- * Sever
- *  internal
- */
-VTable *VTableAttach ( const VTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAddDep ( & self -> refcount, "VTable" ) )
-        {
-        case krefLimit:
-            return NULL;
-        }
-    }
-    return ( VTable* ) self;
-}
-
-rc_t VTableSever ( const VTable *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDropDep ( & self -> refcount, "VTable" ) )
-        {
-        case krefWhack:
-            return VTableWhack ( ( VTable* ) self );
-        case krefNegative:
-            return RC ( rcVDB, rcTable, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-
-/* Make - PRIVATE
- */
-rc_t VTableMake ( VTable **tblp,
-    const VDBManager *mgr, const VDatabase *db, const VSchema *schema )
-{
-    rc_t rc;
-
-    /* create a structure */
-    VTable *tbl = calloc ( sizeof * tbl, 1 );
-    if ( tbl == NULL )
-        rc = RC ( rcVDB, rcTable, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        /* since the object has been zeroed, Whack will work properly */
-        rc = VSchemaMake ( ( VSchema** ) & tbl -> schema, schema );
-        if ( rc == 0 )
-        {
-            tbl -> mgr = VDBManagerAttach ( mgr );
-            tbl -> db = VDatabaseAttach ( db );
-
-            BSTreeInit ( & tbl -> read_col_cache );
-            BSTreeInit ( & tbl -> write_col_cache );
-
-            KRefcountInit ( & tbl -> refcount, 1, "VTable", "make", "vtbl" );
-
-            tbl -> cmode = ( uint8_t ) kcmOpen;
-            tbl -> checksum = ( uint8_t ) kcsNone;
-
-            rc = VLinkerMake ( & tbl -> linker, mgr -> linker, mgr -> linker -> dl );
-            if ( rc == 0 )
-            {
-                * tblp = tbl;
-                return 0;
-            }
-        }
-
-        VTableWhack ( tbl );
-    }
-
-    * tblp = NULL;
-
-    return rc;
-}
-
-
-/* OpenRead
- *  finish initialization on open for read
- */
-static
-rc_t VTableOpenRead ( VTable *self )
-{
-    /* open metadata */
-    rc_t rc = KTableOpenMetadataRead ( self -> ktbl, & self -> meta );
-    if ( rc == 0 )
-    {
-        /* open "col" node, if present */
-        rc = KMetadataOpenNodeRead ( self -> meta, & self -> col_node, "col" );
-        if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-        {
-            /* fetch stored schema */
-            rc = VTableLoadSchema ( self );
-            if ( rc == 0 && self -> stbl == NULL )
-                rc = RC ( rcVDB, rcTable, rcOpening, rcSchema, rcNotFound );
-        }
-    }
-
-    DBGMSG(DBG_VDB, DBG_FLAG(DBG_VDB_VDB), ("VTableOpenRead = %d\n", rc));
-
-    return rc;
-}
-
-
-/* OpenTableRead
- * VOpenTableRead
- *  open a table for read
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-LIB_EXPORT rc_t CC VDBManagerVOpenTableRead ( const VDBManager *self,
-    const VTable **tblp, const VSchema *schema,
-    const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSelf, rcNull );
-        else
-        {
-            VTable *tbl;
-
-            /* if no schema is given, always pass intrinsic */
-            if ( schema == NULL )
-                schema = self -> schema;
-
-            rc = VTableMake ( & tbl, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                tbl -> read_only = true;
-                rc = KDBManagerVOpenTableRead ( self -> kmgr, & tbl -> ktbl, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenRead ( tbl );
-                    if ( rc == 0 )
-                    {
-#if LAZY_OPEN_COL_NODE
-                        KMDataNodeRelease ( tbl -> col_node );
-                        tbl -> col_node = NULL;
-#endif
-                        * tblp = tbl;
-                        return 0;
-                    }
-                }
-                VTableWhack ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerOpenTableRead ( const VDBManager *self, const VTable **tbl,
-    const VSchema *schema, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVOpenTableRead ( self, tbl, schema, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVOpenTableRead ( const VDatabase *self,
-    const VTable **tblp, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcSelf, rcNull );
-        else
-        {
-            VTable *tbl;
-            rc = VTableMake ( & tbl, self -> mgr, self, self -> schema );
-            if ( rc == 0 )
-            {
-                tbl -> read_only = true;
-
-                rc = KDatabaseVOpenTableRead ( self -> kdb, & tbl -> ktbl, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenRead ( tbl );
-                    if ( rc == 0 )
-                    {
-                        * tblp = tbl;
-                        return 0;
-                    }
-                }
-
-                VTableWhack ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseOpenTableRead ( const VDatabase *self,
-    const VTable **tbl, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDatabaseVOpenTableRead ( self, tbl, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Locked
- *  returns true if locked
- */
-LIB_EXPORT bool CC VTableLocked ( const VTable *self )
-{
-    if ( self != NULL )
-        return KTableLocked ( self -> ktbl );
-    return false;
-}
-
-
-/* Writable
- *  returns 0 if object is writable
- *  or a reason why if not
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VTableVWritable ( const VTable *self, uint32_t type, const char * name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-    else
-        rc = KTableVWritable ( self -> ktbl, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableWritable ( const VTable *self, uint32_t type, const char * name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VTableVWritable ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenMetadataRead
- *  opens metadata file
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-LIB_EXPORT rc_t CC VTableOpenMetadataRead ( const VTable *self, struct KMetadata const **meta )
-{
-    rc_t rc;
-
-    if ( meta == NULL )
-        rc = RC ( rcVDB, rcTable, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcOpening, rcSelf, rcNull );
-        else
-        {
-            * meta = self -> meta;
-            return KMetadataAddRef ( self -> meta );
-        }
-
-        * meta = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenIndexRead
- * VOpenIndexRead
- *  open an index for read
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-LIB_EXPORT rc_t CC VTableVOpenIndexRead ( const VTable *self,
-    struct KIndex const **idx, const char *name, va_list args )
-{
-    rc_t rc;
-    KIdxType type;
-    uint32_t version;
-    const KMDataNode *node;
-
-    if ( self == NULL )
-    {
-        if ( idx == NULL )
-            return RC ( rcVDB, rcTable, rcOpening, rcParam, rcNull );
-        * idx = NULL;
-        return RC ( rcVDB, rcTable, rcOpening, rcSelf, rcNull );
-    }
-
-    /* open the requested index */
-    rc = KTableVOpenIndexRead ( self -> ktbl, idx, name, args );
-    if ( rc != 0 )
-        return rc;
-
-    /* get version and type */
-    rc = KIndexVersion ( * idx, & version );
-    if ( rc == 0 )
-        rc = KIndexType ( * idx, & type );
-    if ( rc != 0 )
-        return 0;
-
-    /* look for versions 2 or 3, type kitText or kitText with projection */
-    switch ( version )
-    {
-    case 2:
-    case 3:
-        switch ( type )
-        {
-        case kitText:
-        case kitText | kitProj:
-            break;
-        default:
-            return 0;
-        }
-        break;
-    default:
-        return 0;
-    }
-
-    /* look for a node in metadata for repairing maximum id */
-    rc = KMetadataOpenNodeRead ( self -> meta, & node, "/.seq/spot" );
-    if ( rc == 0 )
-    {
-        int64_t maxid;
-        rc = KMDataNodeReadAsI64 ( node, & maxid );
-        if ( rc == 0 )
-            KIndexSetMaxRowId ( * idx, maxid );
-        KMDataNodeRelease ( node );
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VTableOpenIndexRead ( const VTable *self,
-    struct KIndex const **idx, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VTableVOpenIndexRead ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* ListColumns
- *  list readable column names
- *
- *  "names" [ OUT ] - return parameter for namelist
- *
- *  availability: v2.1
- */
-static
-rc_t list_readable_columns ( const VTable *cself )
-{
-    VTable *self = ( VTable* ) cself;
-
-    VCursor *curs;
-    rc_t rc = VTableCreateCursorReadInternal ( self, ( const VCursor** ) & curs );
-    if (  rc == 0 )
-    {
-        /* let this private VCursor-function list the columns */
-        rc = VCursorListReadableColumns ( curs, & self -> read_col_cache );
-        VCursorRelease ( curs );
-        if ( rc == 0 )
-            self -> read_col_cache_valid = true;
-    }
-
-    return rc;
-}
-
-rc_t make_column_namelist ( const BSTree *columns, KNamelist **names )
-{
-    VNamelist *list;
-    rc_t rc = VNamelistMake ( & list, 8 );
-    if ( rc == 0 )
-    {
-        const String *last = NULL;
-        const VColumnRef *cref = ( const VColumnRef* )
-            BSTreeFirst ( columns );
-        while ( cref != NULL )
-        {
-            if ( last == NULL || ! StringEqual ( last, & cref -> name ) )
-            {
-                rc = VNamelistAppend ( list, cref -> name . addr );
-                if ( rc != 0 )
-                    break;
-
-                last = & cref -> name;
-            }
-
-            cref = ( const VColumnRef* )
-                BSTNodeNext ( & cref -> n );
-        }
-
-        if ( rc == 0 )
-            rc = VNamelistToNamelist ( list, names );
-
-        VNamelistRelease ( list );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableListReadableColumns ( const VTable *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else
-        {
-            if ( ! self -> read_col_cache_valid )
-                rc = list_readable_columns ( self );
-
-            if ( self -> read_col_cache_valid )
-                return make_column_namelist ( & self -> read_col_cache, names );
-        }
-
-        * names = NULL;
-    }
-    return rc;
-}
-
-/* v2.0 interface
- */
-LIB_EXPORT rc_t CC VTableListCol ( const VTable *cself, KNamelist **names )
-{
-    return VTableListReadableColumns ( cself, names );
-}
-
-
-
-/* ListPhysColumns
- *  avail: 2.4
- */
-LIB_EXPORT rc_t CC VTableListPhysColumns ( const VTable *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        * names = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else
-        {
-            KNamelist *kcol_names;
-            rc = KTableListCol ( self -> ktbl, & kcol_names );
-            if ( rc == 0 )
-            {
-                uint32_t kcol_count;
-                rc = KNamelistCount ( kcol_names, & kcol_count );
-                if ( rc == 0 )
-                {
-                    uint32_t scol_count = 0;
-                    KNamelist *scol_names = NULL;
-                    const KMDataNode *col_node = self -> col_node;
-
-#if LAZY_OPEN_COL_NODE
-                    if ( col_node == NULL )
-                    {
-                        rc = KMetadataOpenNodeRead ( self -> meta, & ( ( VTable* ) self ) -> col_node, "col" );
-                        if ( rc == 0 || GetRCState ( rc ) != rcNotFound )
-                            col_node = self -> col_node;
-                    }
-#endif
-                    if ( col_node != NULL )
-                    {
-                        rc = KMDataNodeListChildren ( col_node, & scol_names );
-                        if ( rc == 0 )
-                            rc = KNamelistCount ( scol_names, & scol_count );
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        VNamelist *vnames;
-                        rc = VNamelistMake ( & vnames, kcol_count + scol_count );
-                        if ( rc == 0 )
-                        {
-                            uint32_t i;
-                            const char *name;
-
-                            for ( i = 0; i < kcol_count && rc == 0; ++ i )
-                            {
-                                rc = KNamelistGet ( kcol_names, i, & name );
-                                if ( rc == 0 )
-                                    rc = VNamelistAppend ( vnames, name );
-                            }
-
-                            for ( i = 0; i < scol_count && rc == 0; ++ i )
-                            {
-                                rc = KNamelistGet ( scol_names, i, & name );
-                                if ( rc == 0 )
-                                    rc = VNamelistAppend ( vnames, name );
-                            }
-
-                            if ( rc == 0 )
-                            {
-                                rc = VNamelistToNamelist ( vnames, names );
-                                if ( rc == 0 )
-                                    VNamelistReorder ( vnames, false );
-                            }
-                        }
-
-                        VNamelistRelease ( vnames );
-                    }
-
-                    KNamelistRelease ( scol_names );
-                }
-
-                KNamelistRelease ( kcol_names );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* ListDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
- *  into "typedecls" of the default datatype for the named column
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- *
- *  availability: v2.1
- */
-
-rc_t make_column_typelist ( const BSTree *columns,
-    const char *col, uint32_t *dflt_idx, KNamelist **typedecls )
-{
-    VNamelist *list;
-    rc_t rc = VNamelistMake ( & list, 8 );
-    if ( rc == 0 )
-    {
-        uint32_t idx;
-        const VColumnRef *first;
-
-        String col_name;
-        StringInitCString ( & col_name, col );
-
-        first = ( const VColumnRef* )
-            BSTreeFind ( columns, & col_name, VColumnRefCmpString );
-        if ( first != NULL )
-        {
-            const VColumnRef *cref = ( const VColumnRef* ) BSTNodePrev ( & first -> n );
-            while ( cref != NULL && StringEqual ( & first -> name, & cref -> name ) )
-            {
-                first = cref;
-                cref = ( const VColumnRef* ) BSTNodePrev ( & cref -> n );
-            }
-
-            for ( cref = first, idx = 0; ; ++ idx )
-            {
-                rc = VNamelistAppend ( list, cref -> typedecl );
-                if ( rc != 0 )
-                    break;
-
-                if ( cref -> dflt )
-                    * dflt_idx = idx;
-
-                cref = ( const VColumnRef* ) BSTNodeNext ( & cref -> n );
-                if ( cref == NULL || ! StringEqual ( & first -> name, & cref -> name ) )
-                    break;
-            }
-        }
-
-        if ( rc == 0 )
-            rc = VNamelistToNamelist ( list, typedecls );
-
-        VNamelistRelease ( list );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableListReadableDatatypes ( const VTable *self,
-    const char *col, uint32_t *dflt_idx, KNamelist **typedecls )
-{
-    rc_t rc;
-
-    uint32_t dummy;
-    if ( dflt_idx == NULL )
-        dflt_idx = & dummy;
-
-    * dflt_idx = 0;
-
-    if ( typedecls == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else if ( col == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcName, rcNull );
-        else if ( col [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcTable, rcListing, rcName, rcEmpty );
-        else
-        {
-            if ( ! self -> read_col_cache_valid )
-                rc = list_readable_columns ( self );
-
-            if ( self -> read_col_cache_valid )
-                return make_column_typelist ( & self -> read_col_cache, col, dflt_idx, typedecls );
-        }
-
-        * typedecls = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableColumnDatatypes( const VTable *cself, const char *col,
-    uint32_t *dflt_idx, KNamelist **typedecls )
-{
-    return VTableListReadableDatatypes ( cself, col, dflt_idx, typedecls );
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VTableOpenManagerRead ( const VTable *self, const VDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VTableOpenParentRead ( const VTable *self, const VDatabase **db )
-{
-    rc_t rc;
-
-    if ( db == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDatabaseAddRef ( self -> db );
-            if ( rc == 0 )
-            {
-                * db = self -> db;
-                return 0;
-            }
-        }
-
-        * db = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenSchema
- *  duplicate reference to table schema
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VTableOpenSchema ( const VTable *self, const VSchema **schema )
-{
-    rc_t rc;
-
-    if ( schema == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VSchemaAddRef ( self -> schema );
-            if ( rc == 0 )
-            {
-                * schema = self -> schema;
-                return 0;
-            }
-        }
-
-        * schema = NULL;
-    }
-
-    return rc;
-}
-
-
-/* GetUserData
- * SetUserData
- *  store/retrieve an opaque pointer to user data
- */
-LIB_EXPORT rc_t CC VTableGetUserData ( const VTable *self, void **data )
-{
-    rc_t rc;
-
-    if ( data == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * data = self -> user;
-            return 0;
-        }
-
-        * data = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableSetUserData ( const VTable *cself,
-    void *data, void ( CC * destroy ) ( void *data ) )
-{
-    VTable *self = ( VTable* ) cself;
-    if ( cself == NULL )
-        return RC ( rcVDB, rcTable, rcUpdating, rcSelf, rcNull );
-
-    self -> user = data;
-    self -> user_whack = destroy;
-
-    return 0;
-}
-
-
-/* GetKTable
- *  returns a new reference to underlying KTable
- */
-LIB_EXPORT rc_t CC VTableGetKTableRead ( const VTable *self, const KTable **ktbl )
-{
-    rc_t rc;
-
-    if ( ktbl == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * ktbl = self -> ktbl;
-            return KTableAddRef ( * ktbl );
-        }
-
-        * ktbl = NULL;
-    }
-
-    return rc;
-}
-
-
-
-/* Typespec
- *  retrieve table typespec
- *
- *  AVAILABILITY: version 2.1
- *
- *  "ts_buff" [ IN ] and "ts_size" [ IN ] - buffer for return of NUL-terminated
- *  table typespec, e.g. 'NCBI:tbl:abc#1.1'
- */
-#define USE_SDUMPER 0
-
-#if USE_SDUMPER
-typedef struct flush_tblspec_pb flush_tblspec_pb;
-struct flush_tblspec_pb
-{
-    char *buff;
-    size_t size;
-    size_t bytes;
-};
-
-static
-rc_t CC flush_tbl_typespec ( void *data, const void *buffer, size_t size )
-{
-    flush_tblspec_pb *pb = data;
-    if ( pb -> bytes + size >= pb -> size )
-        return RC ( rcVDB, rcTable, rcAccessing, rcBuffer, rcInsufficient );
-    memcpy ( & pb -> buff [ pb -> bytes ], buffer, size );
-    pb -> bytes += size;
-    pb -> buff [ pb -> bytes ] = 0;
-    return 0;
-}
-#endif
-
-LIB_EXPORT rc_t CC VTableTypespec ( const VTable *self, char *ts_buff, size_t ts_size )
-{
-    rc_t rc;
-
-    if ( ts_size == 0 )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcBuffer, rcInsufficient );
-    else if ( ts_buff == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcBuffer, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc_t rc2;
-#if USE_SDUMPER
-            SDumper dumper;
-            flush_tblspec_pb pb;
-
-            /* initialize pb */
-            pb . buff = ts_buff;
-            pb . size = ts_size;
-            pb . bytes = 0;
-
-            /* initialize dumper for extracting name */
-            SDumperInit ( & dumper, self -> schema, sdmCompact, flush_tbl_typespec, & pb );
-
-            /* dump only the table name */
-            assert ( self -> stbl != NULL );
-            rc = SDumperPrint ( & dumper, "%N%V", self -> stbl -> name, self -> stbl -> version );
-
-            /* done */
-            rc2 = SDumperWhack ( & dumper );
-            if ( rc == 0 )
-            {
-                if ( rc2 == 0 )
-                    return 0;
-
-                rc = rc2;
-            }
-#else
-            rc2 = string_printf ( ts_buff, ts_size, NULL, "%N#%V", self -> stbl -> name, self -> stbl -> version );
-            if ( rc2 == 0 )
-                return 0;
-#endif
-        }
-
-        ts_buff [ 0 ] = 0;
-    }
-
-    return rc;
-}
-
-
-/* HasStaticColumn - PRIVATE
- *  given a physical column name, report whether it exists
- *  and is ( currently ) static
- *  avail: 2.5
- */
-LIB_EXPORT bool CC VTableHasStaticColumn ( const VTable *self, const char *name )
-{
-    if ( self != NULL && name != NULL && name [ 0 ] != 0 )
-    {
-        /* a full check of this might include testing that the column
-           can be opened for read or write, but the API is purposely
-           vague on what this means.
-
-           currently the meaning of this ( PRIVATE ) API is whether
-           there is a metadata column entry with this name - period. */
-        const KMDataNode *node;
-        rc_t rc = KMetadataOpenNodeRead ( self -> meta, & node, "/col/%s", name );
-        if ( rc == 0 )
-        {
-            KMDataNodeRelease ( node );
-            return true;
-        }
-    }
-
-    return false;
-}
-
-
-/*--------------------------------------------------------------------------
- * VColumnRef
- *  cache entry
- */
-
-/* Whack
- */
-void CC VColumnRefWhack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-
-/* Make
- *  make a column ref from an SColumn*
- */
-rc_t VColumnRefMake ( VColumnRef **rp, const VSchema *schema, const SColumn *scol )
-{
-    char text [ 256 ];
-    rc_t rc = VTypedeclToText ( & scol -> td, schema, text, sizeof text );
-    if ( rc == 0 )
-    {
-        size_t tdsize = strlen ( text );
-        const String *name = & scol -> name -> name;
-        VColumnRef *cref = malloc ( sizeof * cref + name -> size + tdsize );
-        if ( cref == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcMemory, rcExhausted );
-        else
-        {
-            strcpy ( cref -> typedecl, text );
-            string_copy ( & cref -> typedecl [ tdsize + 1 ], name -> size + 1, name -> addr, name -> size );
-            StringInit ( & cref -> name, & cref -> typedecl [ tdsize + 1 ], name -> size, name -> len );
-            cref -> td = scol -> td;
-            cref -> cid = scol -> cid;
-            cref -> dflt = scol -> dflt;
-
-            * rp = cref;
-        }
-    }
-
-    return rc;
-}
-
-
-/* CmpString
- *  compares by name only
- *  "item" is a const String*
- */
-int CC VColumnRefCmpString ( const void *item, const BSTNode *n )
-{
-    const VColumnRef *cref = ( const VColumnRef* ) n;
-    return StringCompare ( item, & cref -> name );
-}
-
-/* Sort
- *  compares by ( name, type ) pair
- */
-int CC VColumnRefSort ( const BSTNode *item, const BSTNode *n )
-{
-    const VColumnRef *a = ( const VColumnRef* ) item;
-    const VColumnRef *b = ( const VColumnRef* ) n;
-
-    /* sorted first by name - case sensitive ASCII alphabetically */
-    int diff = StringCompare ( & a -> name, & b -> name );
-    if ( diff != 0 )
-        return diff;
-
-    /* sort by cid */
-    return VCtxIdCmp ( & a -> cid, & b -> cid );
-}
-
-#if 0 /* more for later */
-static
-rc_t create_cursor_all_readable_columns(const VTable *self,
-                                        unsigned *ncol, uint32_t **idx,
-                                        const VCursor **curs)
-{
-    KNamelist *list;
-    rc_t rc = VTableListReadableColumns(self, &list);
-    
-    if (rc == 0) {
-        rc = VTableCreateCursorReadInternal(self, curs);
-        if (rc == 0) {
-            uint32_t n;
-            
-            rc = KNamelistCount(list, ncol);
-            if (rc == 0) {
-                n = *ncol;
-                *idx = malloc(n * sizeof(**idx));
-                if (idx) {
-                    unsigned i;
-                    
-                    for (i = 0; i != (unsigned)n; ++i) {
-                        const char *name;
-                        
-                        rc = KNamelistGet(list, i, &name);
-                        if (rc)
-                            break;
-                        rc = VCursorAddColumn(*curs, &(*idx)[i], name);
-                        if (rc)
-                            break;
-                    }
-                    if (rc)
-                        free(*idx);
-                }
-                else
-                    rc = RC(rcVDB, rcTable, rcValidating, rcMemory, rcExhausted);
-            }
-            if (rc)
-                VCursorRelease(*curs);
-        }
-        KNamelistRelease(list);
-    }
-    if (rc) {
-        *idx = NULL;
-        *curs = NULL;
-        *ncol = 0;
-    }
-    return rc;
-}
-
-static
-rc_t fetch_all_rows(const VCursor *curs, unsigned ncol, const uint32_t cid[/* ncol */])
-{
-    int64_t start;
-    int64_t stop;
-    int64_t row;
-    unsigned i;
-    rc_t rc;
-    
-    for (i = 0; i != ncol; ++i) {
-        int64_t cstart;
-        uint64_t ccount;
-        
-        rc = VCursorIdRange(curs, cid[i], &cstart, &ccount);
-        if (rc)
-            return rc;
-        if (i == 0) {
-            start = cstart;
-            stop = cstart + ccount;
-        }
-        else {
-            if (start > cstart)
-                start = cstart;
-            if (stop < cstart + ccount)
-                stop = cstart + ccount;
-        }
-    }
-    for (row = start; row != stop; ++row) {
-        for (i = 0; i != ncol; ++i) {
-            uint32_t elem_bits;
-            const void *base;
-            uint32_t offset;
-            uint32_t length;
-            
-            rc = VCursorCellDataDirect(curs, row, cid[i], &elem_bits,
-                                       &base, &offset, &length);
-            if (rc)
-                return rc;
-        }
-    }
-    return 0;
-}
-
-VDB_EXTERN
-rc_t CC VTableConsistencyCheck(const VTable *self, int level)
-{
-    uint32_t *cid;
-    unsigned ncol;
-    const VCursor *curs;
-    rc_t rc = create_cursor_all_readable_columns(self, &ncol, &cid, &curs);
-    
-    if (rc)
-        return rc;
-    rc = fetch_all_rows(curs, ncol, cid);
-    free(cid);
-    VCursorRelease(curs);
-    return rc;
-}
-#endif
diff --git a/libs/vdb/table-load.c b/libs/vdb/table-load.c
deleted file mode 100644
index 3c3638c..0000000
--- a/libs/vdb/table-load.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define KONST const
-#define SKONST
-
-#include "dbmgr-priv.h"
-#include "table-priv.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "linker-priv.h"
-
-#undef KONST
-#undef SKONST
-
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kfs/dyload.h>
-#include <klib/namelist.h>
-#include <klib/token.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* LoadSchema
- *  looks in metadata for stored schema
- *  or searches available definitions for match
- */
-typedef struct VTableFindData VTableFindData;
-struct VTableFindData
-{
-    VLinker *linker;
-    struct KDlset *libs;
-    const VTable *vtbl;
-    const STable *stbl;
-};
-
-static
-bool CC VTableTestUntyped ( void *item, void *data )
-{
-    VTableFindData *pb = data;
-    const STable *stbl = ( const void* ) item;
-
-    if ( stbl -> untyped != NULL )
-    {
-        /* get the function pointer */
-        VUntypedTableTest test = NULL;
-        rc_t rc = VLinkerFindUntyped ( pb -> linker, pb -> libs,
-            & test, stbl -> untyped );
-        if ( rc == 0 )
-        {
-            /* ask if it recognizes the table */
-            if ( ( * test ) ( pb -> vtbl -> ktbl, pb -> vtbl -> meta ) )
-            {
-                pb -> stbl = stbl;
-                return true;
-            }
-        }
-    }
-     
-    return false;
-}
-
-static
-bool VSchemaFindUntyped ( const VSchema *self, VTableFindData *pb )
-{
-    if ( self -> dad )
-    {
-        if ( VSchemaFindUntyped ( self -> dad, pb ) )
-            return true;
-    }
-    
-    return VectorDoUntil ( & self -> tbl, false, VTableTestUntyped, pb );
-}
-
-static
-rc_t VTableFindType ( VTable *self )
-{
-    rc_t rc;
-    VTableFindData pb;
-    
-    pb . linker = self -> linker;
-    
-    rc = VLinkerOpen ( pb . linker, & pb . libs );
-    if ( rc == 0 )
-    {
-        pb . vtbl = self;
-        pb . stbl = NULL;
-        
-        /* search schema */
-        VSchemaFindUntyped ( self -> schema, & pb );
-        
-        /* record stbl */
-        self -> stbl = pb . stbl;
-        KDlsetRelease ( pb . libs );
-    }
-    return rc;
-}
-
-static
-rc_t VTableLoadSchemaNode ( VTable *self, const KMDataNode *node )
-{
-    rc_t rc;
-    
-    /* the node is probably within our 4K buffer,
-     but by using the callback mechanism we don't
-     have buffer or allocation issues. */
-    KMDataNodeSchemaFillData pb;
-    pb . node = node;
-    pb . pos = 0;
-    pb . add_v0 = false;
-    
-    /* add in schema text. it is not mandatory, but it is
-     the design of the system to store object schema with
-     the object so that it is capable of standing alone */
-    rc = VSchemaParseTextCallback ( self -> schema,
-        "VTableLoadSchema", KMDataNodeFillSchema, & pb );
-    if ( rc == 0 )
-    {
-        /* determine table type */
-        rc = KMDataNodeReadAttr ( node, "name",
-            pb . buff, sizeof pb . buff, & pb . pos );
-        if ( rc == 0 )
-        {
-            uint32_t type;
-            const SNameOverload *name;
-            
-            /* find the stbl if possible */
-            self -> stbl = VSchemaFind ( self -> schema,
-                & name, & type, pb . buff, "VTableLoadSchema", false );
-            
-            /* the schema must be found in this case */
-            if ( self -> stbl == NULL || type != eTable )
-            {
-                self -> stbl = NULL;
-                rc = RC ( rcVDB, rcTable, rcLoading, rcSchema, rcCorrupt );
-                PLOGERR ( klogInt, ( klogInt, rc, "failed to establish table type from '$(expr)'",
-                                     "expr=%s", pb . buff ));
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t VTableLoadSchema ( VTable *self )
-{
-    /* try to get schema text */
-    const KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeRead ( self -> meta, & node, "schema" );
-    if ( rc == 0 )
-    {
-        rc = VTableLoadSchemaNode ( self, node );
-        KMDataNodeRelease ( node );
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        /* this is an older version. search schema
-         for a table having an untyped function */
-        rc = VTableFindType ( self );
-    }
-
-    return rc;
-}
-
-/* ExtendSchema
- *  discover all existing physical and static columns
- *  that are not represented in the table schema
- *  and add them in ( if possible )
- */
-static
-rc_t VTablePopulateStrayKColumn ( const VTable *self, const char *name )
-{
-    /* TBD - not returning error because the result of doing
-       nothing is simply to leave these columns inaccessible  */
-
-    /* open KColumn */
-    /* open KMetadata */
-    /* process v1 */
-    /* process v2 */
-    /* need to discover a datatype and schema information */
-    return 0;
-}
-
-static
-rc_t VTablePopulateStrayStatic ( const VTable *self,
-    const char *name, const KMDataNode *node )
-{
-    /* TBD - not returning error because the result of doing
-       nothing is simply to leave these columns inaccessible  */
-
-    /* need to discover a datatype */
-    return 0;
-}
-
-static
-bool VTableNameAvail ( const KSymTable *tbl, const char *name )
-{
-    String str;
-
-    /* build a physical name from simple name */
-    char pname [ 256 ];
-    int len = snprintf ( pname, sizeof pname, ".%s", name );
-    if ( len < 0 || len >= sizeof pname )
-        return false;
-
-    /* test for defined physical name */
-    StringInit ( & str, pname, len, len );
-    if ( KSymTableFind ( tbl, & str ) != NULL )
-        return false;
-
-    /* test for defined simple name */
-    StringSubstr ( & str, & str, 1, 0 );
-    if ( KSymTableFind ( tbl, & str ) != NULL )
-        return false;
-
-    /* name is available */
-    return true;
-}
-
-LIB_EXPORT rc_t CC VTableExtendSchema ( const VTable *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcTable, rcUpdating, rcSelf, rcNull );
-    else
-    {
-        /* create symbol table for STable */
-        KSymTable tbl;
-        rc = init_tbl_symtab ( & tbl, self -> schema, self -> stbl );
-        if ( rc == 0 )
-        {
-            KNamelist *names;
-            const char *name;
-            uint32_t i, count;
-
-            /* list all physical tables from KTable */
-            rc = KTableListCol ( self -> ktbl, & names );
-            if ( rc != 0 )
-                rc = 0;
-            else
-            {
-                rc = KNamelistCount ( names, & count );
-                for ( i = 0; rc == 0 && i < count; ++ i )
-                {
-                    /* if there are any stray columns, add them in */
-                    rc = KNamelistGet ( names, i, & name );
-                    if ( rc == 0 && VTableNameAvail ( & tbl, name ) )
-                        rc = VTablePopulateStrayKColumn ( self, name );
-                }
-
-                KNamelistRelease ( names );
-            }
-
-            if ( rc == 0 )
-            {
-                /* access table's static columns */
-                const KMDataNode *cols = self -> col_node;
-                if ( cols != NULL )
-                {
-                    /* list all columns */
-                    rc = KMDataNodeListChild ( cols, & names );
-                    if (rc == 0) {
-                        rc = KNamelistCount ( names, & count );
-                        for ( i = 0; rc == 0 && i < count; ++ i )
-                        {
-                            rc = KNamelistGet ( names, i, & name );
-                            if ( rc == 0 && VTableNameAvail ( & tbl, name ) )
-                            {
-                                const KMDataNode *node;
-                                rc = KMDataNodeOpenNodeRead ( cols, & node, name );
-                                if ( rc == 0 )
-                                {
-                                    /* add in static column */
-                                    rc = VTablePopulateStrayStatic ( self, name, node );
-                                    KMDataNodeRelease ( node );
-                                }
-                            }
-                        }
-                        KNamelistRelease ( names );
-                    }
-                }
-            }
-        }
-
-        KSymTableWhack ( & tbl );
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/table-priv.h b/libs/vdb/table-priv.h
deleted file mode 100644
index 4835628..0000000
--- a/libs/vdb/table-priv.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_table_priv_
-#define _h_table_priv_
-
-#ifndef _h_vdb_table_
-#include <vdb/table.h>
-#endif
-
-#ifndef _h_schema_priv_
-#include "schema-priv.h"
-#endif
-
-#ifndef _h_vdb_schema_
-#include <vdb/schema.h>
-#endif
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef KONST
-#define KONST
-#endif
-
-#ifndef SKONST
-#define SKONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LAZY_OPEN_COL_NODE 0
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KTable;
-struct STable;
-struct SColumn;
-struct VLinker;
-struct VDatabase;
-struct KMetadata;
-struct VDBManager;
-
-
-/*--------------------------------------------------------------------------
- * VTable
- *  represents a table
- *  normally implemented as a directory
- *  but may be a single archive file
- *  in either executable or streamable format
- */
-struct VTable
-{
-    /* creating manager */
-    struct VDBManager KONST *mgr;
-
-    /* enclosing database - NULL OKAY */
-    struct VDatabase KONST *db;
-
-    /* schema and table description
-       a new schema is created to house schema
-       obtained from existing table/column metadata */
-    VSchema SKONST *schema;
-    struct STable const *stbl;
-
-    /* intrinsic functions */
-    struct VLinker *linker;
-
-    /* underlying physical layer table */
-    struct KTable KONST *ktbl;
-
-    /* open table metadata */
-    struct KMetadata KONST *meta;
-
-    /* "col" subnode of metadata */
-    struct KMDataNode KONST *col_node;
-
-    /* caches of readable and writable columns */
-    BSTree read_col_cache;
-    BSTree write_col_cache;
-
-    /* user data */
-    void *user;
-    void ( CC * user_whack ) ( void *data );
-
-    /* page size for creating columns */
-    size_t pgsize;
-
-    /* open references */
-    KRefcount refcount;
-
-    /* create and checksum modes for columns */
-    uint8_t cmode;
-    uint8_t checksum;
-
-    /* open mode */
-    bool read_only;
-
-    /* cache validity */
-    bool read_col_cache_valid;
-    bool write_col_cache_valid;
-};
-
-
-/* Whack
- */
-rc_t VTableWhack ( VTable *self );
-
-
-/* Attach
- * Sever
- *  internal reference management
- */
-VTable *VTableAttach ( const VTable *self );
-rc_t VTableSever ( const VTable *self );
-
-
-/* Make
- *  creates an initialized table object
- *  expects either a mgr or a parent db,
- *  creates a modifiable schema
- */
-rc_t VTableMake ( VTable **tblp,
-    struct VDBManager const *mgr,
-    struct VDatabase const *db,
-    const VSchema *schema );
-
-
-/* LoadSchema
- *  looks in metadata for stored schema
- *  or searches available definitions for match
- */
-rc_t VTableLoadSchema ( VTable *self );
-
-/* StoreSchema
- *  stores schema definition in metadata
- */
-VDB_EXTERN rc_t VTableStoreSchema ( VTable *self );
-
-/* support for listing
- */
-rc_t make_column_namelist ( const BSTree *columns, struct KNamelist **names );
-rc_t make_column_typelist ( const BSTree *columns, const char *col,
-    uint32_t *dflt_idx, struct KNamelist **typedecls );
-
-
-/*--------------------------------------------------------------------------
- * VColumnRef
- *  cache entry
- */
-typedef struct VColumnRef VColumnRef;
-struct VColumnRef
-{
-    BSTNode n;
-    String name;
-    VTypedecl td;
-    VCtxId cid;
-    bool dflt;
-    char typedecl [ 2 ];
-};
-
-
-/* Whack
- *  for dropping a BSTree
- */
-void CC VColumnRefWhack ( BSTNode *n, void *ignore );
-
-
-/* Make
- *  make a column ref from an SColumn*
- */
-rc_t VColumnRefMake ( VColumnRef **cref,
-    const VSchema *schema, struct SColumn const *scol );
-
-
-/* CmpString
- *  compares by name only
- *  "item" is a const String*
- */
-int CC VColumnRefCmpString ( const void *item, const BSTNode *n );
-
-/* Sort
- *  compares by (name,type) pair
- */
-int CC VColumnRefSort ( const BSTNode *item, const BSTNode *n );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_table_priv_ */
diff --git a/libs/vdb/table.c b/libs/vdb/table.c
deleted file mode 100644
index ed2d71d..0000000
--- a/libs/vdb/table.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define KONST const
-#include "table-priv.h"
-#undef KONST
-
-#include <klib/namelist.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-/* List
- *  (moved from table-cmn.c to here, because needs access to VCursor...)
- *  create a namelist of all usable columns :
- *  columns, that can be added to a cursor - and the following cursor-open will not fail
- */
-LIB_EXPORT rc_t CC VTableListWritableColumns ( struct VTable *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else
-        {
-            VNamelist *list;
-            rc = VNamelistMake ( & list, 0 );
-            if ( rc == 0 )
-            {
-                rc = VNamelistToNamelist ( list, names );
-                VNamelistRelease ( list );
-                return rc;
-            }
-        }
-
-        * names = NULL;
-    }
-    return rc;
-}
-
-
-/* ListDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- *
- *  availability: v2.1
- */
-LIB_EXPORT rc_t CC VTableListWritableDatatypes ( struct VTable *self,
-    const char *col, KNamelist **typedecls )
-{
-    rc_t rc;
-    
-    if ( typedecls == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else if ( col == NULL )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcName, rcNull );
-        else if ( col [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcName, rcEmpty );
-        else
-        {
-            /* make eventually returned */
-            VNamelist *vlist;
-            rc = VNamelistMake ( &vlist, 0 );
-            if ( rc == 0 )
-            {
-                rc = VNamelistToNamelist ( vlist, typedecls );
-                VNamelistRelease ( vlist );
-                return rc;
-            }
-        }
-
-        * typedecls = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/transpose.c b/libs/vdb/transpose.c
deleted file mode 100644
index 3b585ab..0000000
--- a/libs/vdb/transpose.c
+++ /dev/null
@@ -1,720 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <klib/rc.h>
-
-#include "xform-priv.h"
-#include "blob-priv.h"
-#include "blob.h"
-#include "page-map.h"
-
-#include <assert.h>
-
-
-/* Create
- *
- * Create a new blob.  A new data buffer is sized to
- * 'element_count' * sizeof datatype; its contents are
- * uninitialized.
- */
-static
-rc_t VBlobCreate ( VBlob **blobp, const VBlob *in )
-{
-    rc_t rc = VBlobNew ( blobp, in -> start_id, in -> stop_id, "transpose" );
-    if ( rc == 0 )
-    {
-        VBlob *blob = * blobp;
-        rc = KDataBufferMake ( & blob -> data,
-            in -> data . elem_bits, in -> data . elem_count );
-        if ( rc != 0 )
-        {
-            VBlobRelease ( blob );
-            * blobp = NULL;
-        }
-        else
-        {
-            blob -> byte_order = in -> byte_order;
-        }
-    }
-    return rc;
-}
-
-
-/* detranspose
- *  pardoning the awful name, apply a transposition on the result
- *  of "transpose" to produce the original blob. "transpose"
- *  itself cannot be reused because of its signature.
- *
- *  see "transpose" below for an explanation
- */
-static
-rc_t CC transpose_formatted8 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    /* input blob - schema assures us that it is ready to go */
-    const VBlob *in = argv [ 0 ];
-
-    /* allocate output blob of same size */
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-
-        /* page-map iterator */
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-
-        /* create a new reference to the page map */
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-
-        /* last chance for failure */
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-
-            /* get source and destination pointers */
-            uint8_t *dst = out -> data . base;
-            const uint8_t *src = in -> data . base;
-
-            /* set page-map on out */
-            out -> pm = in -> pm;
-
-            /* perform the transformation
-               the first pass will determine maximum row length */
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-
-                if ( row_len != 0 )
-                {
-                    dst [ k ] = src [ j ];
-                    ++ j;
-                }
-
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-
-            /* perform transformation on the remainder */
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ k ] = src [ j ];
-                        ++ j;
-                    }
-
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_formatted16 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint16_t *dst = out -> data . base;
-            const uint16_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ k ] = src [ j ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ k ] = src [ j ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_formatted32 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint32_t *dst = out -> data . base;
-            const uint32_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ k ] = src [ j ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ k ] = src [ j ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_formatted64 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint64_t *dst = out -> data . base;
-            const uint64_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ k ] = src [ j ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ k ] = src [ j ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_detranspose, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    switch ( VTypedescSizeof ( & info -> fdesc . desc ) )
-    {
-    case 8:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_formatted8;
-        break;
-    case 16:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_formatted16;
-        break;
-    case 32:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_formatted32;
-        break;
-    case 64:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_formatted64;
-        break;
-    }
-
-    rslt -> variant = vftBlobN;
-    return 0;
-}
-
-/* transpose
- *  transpose a page of unformatted data
- *
- *  for example - convert a simple page of values,
- *  where vertical scale is row id and horizontal element index:
- *
- *        1   2   3
- *      +---+---+---+
- *    1 | a | b | c |
- *      +---+---+---+
- *    2 | d | e |
- *      +---+---+
- *    3 | f |
- *      +---+---+---+
- *    4 | g | h | i |
- *      +---+---+---+
- *
- *  into:
- *
- *        1   2   3   4
- *      +---+---+---+---+
- *    1 | a | d | f | g |
- *      +---+---+---+---+
- *    2 | b | e |   | h |
- *      +---+---+   +---+
- *    3 | c |       | i |
- *      +---+       +---+
- *
- *  or:
- *
- *      +---+---+---+---+---+---+---+---+---+
- *      | a | d | f | g | b | e | h | c | i |
- *      +---+---+---+---+---+---+---+---+---+
- *
- *  variable row-lengths are supported. The output blob is
- *  formatted, meaning that the result can no longer be addressed
- *  as a matrix, but the transposition has be applied to data.
- *
- *  "in" [ DATA ] - unformatted data to be transposed
- */
-static
-rc_t CC transpose_unformatted8 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    /* input blob - schema assures us that it is ready to go */
-    const VBlob *in = argv [ 0 ];
-
-    /* allocate output blob of same size */
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-
-        /* page-map iterator */
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-
-        /* create a new reference to the page map */
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-
-        /* last chance for failure */
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-
-            /* get source and destination pointers */
-            uint8_t *dst = out -> data . base;
-            const uint8_t *src = in -> data . base;
-
-            /* set page-map on out */
-            out -> pm = in -> pm;
-
-            /* perform the transformation
-               the first pass will determine maximum row length */
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-
-                if ( row_len != 0 )
-                {
-                    dst [ j ] = src [ k ];
-                    ++ j;
-                }
-
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-
-            /* perform transformation on the remainder */
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ j ] = src [ k ];
-                        ++ j;
-                    }
-
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_unformatted16 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint16_t *dst = out -> data . base;
-            const uint16_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ j ] = src [ k ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ j ] = src [ k ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_unformatted32 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint32_t *dst = out -> data . base;
-            const uint32_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ j ] = src [ k ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ j ] = src [ k ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC transpose_unformatted64 ( void *self, const VXformInfo *info, int64_t row_id,
-    VBlob **rslt, uint32_t argc, const VBlob *argv [] )
-{
-    const VBlob *in = argv [ 0 ];
-    rc_t rc = VBlobCreate ( rslt, in );
-    if ( rc != 0 )
-        rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-    else
-    {
-        VBlob *out = * rslt;
-        PageMapIterator it;
-        rc = PageMapNewIterator ( in -> pm, & it, 0, -1 );
-        if ( rc == 0 )
-            rc = PageMapAddRef ( in -> pm );
-        if ( rc != 0 )
-        {
-            rc = ResetRCContext ( rc, rcVDB, rcFunction, rcExecuting );
-            VBlobRelease ( out );
-            * rslt = NULL;
-        }
-        else
-        {
-            uint32_t j, k;
-            elem_count_t i, max_row_len, row_len, rpt_cnt;
-            uint64_t *dst = out -> data . base;
-            const uint64_t *src = in -> data . base;
-            out -> pm = in -> pm;
-            for ( max_row_len = 0, j = k = 0; ;  k += row_len )
-            {
-                row_len = PageMapIteratorDataLength ( & it );
-                if ( row_len > max_row_len )
-                    max_row_len = row_len;
-                if ( row_len != 0 )
-                {
-                    dst [ j ] = src [ k ];
-                    ++ j;
-                }
-                rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                    break;
-            }
-            for ( i = 1; i < max_row_len; ++ i )
-            {
-                it . cur_row = 0;
-                for ( k = i; ; k += row_len )
-                {
-                    row_len = PageMapIteratorDataLength ( & it );
-                    if ( row_len > i )
-                    {
-                        dst [ j ] = src [ k ];
-                        ++ j;
-                    }
-                    rpt_cnt = PageMapIteratorRepeatCount ( & it );
-                    if ( ! PageMapIteratorAdvance ( & it, rpt_cnt ) )
-                        break;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-VTRANSFACT_BUILTIN_IMPL ( vdb_transpose, 1, 0, 0 )
-    ( const void *self, const VXfactInfo *info, VFuncDesc *rslt,
-      const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* the TYPE of input has been validated by schema, but not the dimension */
-    switch ( VTypedescSizeof ( & dp -> argv [ 0 ] . desc ) )
-    {
-    case 8:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_unformatted8;
-        break;
-    case 16:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_unformatted16;
-        break;
-    case 32:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_unformatted32;
-        break;
-    case 64:
-        VFUNCDESC_INTERNAL_FUNCS ( rslt ) -> bfN = transpose_unformatted64;
-        break;
-    default:
-        return RC ( rcVDB, rcFunction, rcConstructing, rcType, rcUnsupported );
-    }
-
-    rslt -> variant = vftBlobN;
-    return 0;
-}
diff --git a/libs/vdb/wcolumn.c b/libs/vdb/wcolumn.c
deleted file mode 100644
index f454032..0000000
--- a/libs/vdb/wcolumn.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "klib/symbol.h"
-#include "column-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "schema-parse.h"
-#include "cursor-priv.h"
-#include "prod-priv.h"
-#include "blob-priv.h"
-#include "page-map.h"
-
-#include <vdb/manager.h>
-#include <vdb/cursor.h>
-#include <kdb/column.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-/* these constants MUST each be a power of two */
-#define INITIAL_DATA_PEAK ( 32 * 1024 )
-#define SINGLE_PAGE_SIZE ( 4 * 1024 )
-
-/* this is a fairly high value, useful for writing single tables
-   of data that are generally accessed serially. it's bad for random. */
-#define DFLT_TRIGGER ( 2 * 1024 * 1024 )
-
-/* debugging aid - Row-wise RunLengthEncoding ( repeated column
-   elimination ) can be disabled to check for errors it may introduce. */
-#define USE_RLE 1
-
-/* when defined, use as an additional condition for detecting
-   auto-commit cutoff points, with a limit in kilo-rows given below */
-#define ROW_COUNT_CUTOFFS 128
-
-#if ROW_COUNT_CUTOFFS
-#define MAX_ROW_COUNT ( ROW_COUNT_CUTOFFS * 1024 )
-#else
-#define MAX_ROW_COUNT 0x40000000
-#endif
-
-
-/*--------------------------------------------------------------------------
- * VColumn
- */
-
-static 
-void WColumnDestroy ( WColumn * self )
-{
-#if PROD_REFCOUNT && ! PROD_ALL_IN_CURSOR
-    PROD_TRACK_REFCOUNT ( VProductionRelease, self -> out );
-    VProductionRelease ( self -> out, NULL );
-    PROD_TRACK_REFCOUNT ( VProductionRelease, self -> val );
-    VProductionRelease ( self -> val, NULL );
-#endif
-}
-
-
-/* Whack
- *  perform read-only cleanup
- */
-void CC VColumnWhack ( void *item, void *data )
-{
-    VColumn *self = item;
-    VCursor *curs = data;
-
-    /* remove from cursor */
-    if ( curs != NULL )
-    {
-        VectorSwap ( & curs -> row, self -> ord, NULL, & item );
-        VCursorCacheSwap ( & curs -> col, & self -> scol -> cid, NULL, & item );
-    }
-
-    if ( ! self -> read_only )
-    {
-        WColumn *wself = ( WColumn* ) self;
-
-        if ( wself -> page != NULL )
-        {
-            TRACK_BLOB (VBlobRelease, wself->page);
-            VBlobRelease ( wself -> page );
-        }
-
-        KDataBufferWhack ( & wself -> dflt );
-        KDataBufferWhack ( & wself -> data );
-        KDataBufferWhack ( & wself -> rowmap );
-        WColumnDestroy ( wself );
-
-    }
-
-    VColumnDestroy ( self );
-    free ( self );
-}
-
-
-/* Make - PRIVATE
- *  make a write column
- */
-rc_t WColumnMake ( VColumn **colp, const VSchema *schema,
-    const SColumn *scol, const SExpression *blob_limit, VDBManager *mgr )
-{
-    rc_t rc;
-    WColumn *col;
-
-    assert ( colp != NULL );
-    assert ( schema != NULL );
-    assert ( scol != NULL );
-    assert ( mgr != NULL );
-
-    col = calloc ( 1, sizeof * col );
-    if ( col == NULL )
-        rc = RC ( rcVDB, rcColumn, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = VColumnInit ( & col -> dad, schema, scol );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-
-            /* initialize peak histories */
-            for ( i = 0; i < sizeof col -> data_peak_hist / sizeof col -> data_peak_hist [ 0 ]; ++ i )
-                col -> data_peak_hist [ i ] = INITIAL_DATA_PEAK;
-
-            /* initial current peak */
-            col -> data_peak = INITIAL_DATA_PEAK;
-
-            /* use column-specific expression if provided */
-            if ( scol -> limit != NULL )
-                blob_limit = scol -> limit;
-
-            /* evaluate blob cutoff limit expression */
-            if ( blob_limit == NULL )
-            {
-#ifdef DFLT_TRIGGER
-                /* use define */
-                col -> trigger = DFLT_TRIGGER;
-#else
-                /* produce max unsigned integer */
-                -- col -> trigger;
-#endif
-            }
-            else
-            {
-                /* evaluate column blob limit */
-                uint64_t trigger;
-                rc = eval_uint64_expr ( schema, blob_limit, & trigger );
-                col -> trigger = ( size_t ) trigger;
-            }
-
-            if ( rc == 0 )
-            {
-                * colp = & col -> dad;
-                return 0;
-            }
-        }
-
-        free ( col );
-    }
-
-    * colp = NULL;
-    return rc;
-}
-
-
-/* IdRange
- *  returns id range for column or page
- */
-rc_t VColumnIdRange ( const VColumn *vcol, int64_t *first, int64_t *last )
-{
-    rc_t rc;
-    const WColumn *self = ( const WColumn* ) vcol;
-
-    assert ( self != NULL );
-    assert ( first != NULL && last != NULL );
-
-    if ( self -> dad . in != NULL )
-        return VColumnIdRangeRead ( & self -> dad, first, last );
-
-    if ( self -> val == NULL )
-        rc = RC ( rcVDB, rcColumn, rcAccessing, rcRange, rcNotOpen );
-    else
-    {
-        /* a little silly, but set max range in 64-bit
-           without complaints from 32-bit compilers */
-        * first = 1;
-        * first <<= 63;
-        * last = ~ * first;
-
-        /* now intersect this range with all physical sources */
-        rc = VProductionColumnIdRange ( self -> val, first, last );
-        if ( rc == 0 )
-            return 0;
-    }
-
-    * first = * last = 0;
-
-    return rc;
-}
-
-/* SetDefault
- *  capture default row data
- */
-rc_t WColumnSetDefault ( VColumn *vcol,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t len )
-{
-    rc_t rc;
-    bitsz_t elem_size, to_copy;
-    WColumn *self = ( WColumn* ) vcol;
-
-    assert ( elem_bits != 0 );
-    assert ( buffer != NULL || ( boff == 0 && len == 0 ) );
-
-    /* test "compatibility" of elem_bits
-       this is used to interpret "len" */
-    elem_size = VTypedescSizeof ( & self -> dad . desc );
-    if ( elem_bits < elem_size && elem_size % elem_bits != 0 )
-        return RC ( rcVDB, rcColumn, rcUpdating, rcType, rcInconsistent );
-    if ( elem_bits > elem_size && elem_bits % elem_size != 0 )
-        return RC ( rcVDB, rcColumn, rcUpdating, rcType, rcInconsistent );
-
-    /* allow NULL setting */
-    if ( buffer == NULL )
-    {
-        KDataBufferWhack ( & self -> dflt );
-        memset ( & self -> dflt, 0, sizeof self -> dflt );
-        self -> have_dflt = true;
-        return 0;
-    }
-
-    /* set the element size */
-    rc = KDataBufferCast ( & self -> dflt, & self -> dflt, elem_bits, false );
-    if ( rc != 0 )
-        return rc;
-
-    /* set the length */
-    rc = KDataBufferResize ( & self -> dflt, len );
-    if ( rc != 0 )
-    {
-        assert ( KDataBufferWritable ( & self -> dflt ) );
-        return rc;
-    }
-
-    /* copy in the row */
-    to_copy = len * elem_bits;
-    if ( ( ( boff | to_copy ) & 7 ) != 0 )
-        bitcpy ( self -> dflt . base, 0, buffer, boff, to_copy );
-    else
-        memcpy ( self -> dflt . base, & ( ( const uint8_t* ) buffer ) [ boff >> 3 ], to_copy >> 3 );
-    self -> have_dflt = true;
-    return 0;
-}
-
-
-/* OpenRow
- *  update state
- *
- *  "const_row_id" [ IN, CONST ] - id of row being opened. useful
- *  only on initial open when no other rows are buffered.
- */
-void CC WColumnOpenRow ( void *item, void *const_row_id )
-{
-    WColumn *self = item;
-    if ( self != NULL )
-    {
-        int64_t row_id = * ( const int64_t* ) const_row_id;
-
-        assert ( ! self -> row_written );
-        if ( self -> start_id != self -> end_id )
-        {
-            assert ( row_id == self -> end_id );
-        }
-        else
-        {
-            /* capture row id */
-            self -> start_id = self -> end_id = self -> cutoff_id = row_id;
-            assert ( self -> bits_in_buffer == 0 );
-            assert ( self -> row_len == 0 );
-            assert ( self -> num_rows == 0 );
-            assert ( self -> dflt_last == false );
-        }
-    }
-}
-
-
-/* Write
- */
-rc_t WColumnWrite ( VColumn *cself,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t len )
-{
-    WColumn *self = ( WColumn* ) cself;
-
-    bitsz_t elem_size, num_bits, data_bits, doff;
-
-    assert ( elem_bits != 0 );
-    assert ( buffer != NULL || ( boff == 0 && len == 0 ) );
-
-    /* the number of bits to write */
-    num_bits = ( bitsz_t ) elem_bits * len;
-
-    /* test "compatibility" of elem_bits
-       this is used to interpret "len" */
-    elem_size = VTypedescSizeof ( & self -> dad . desc );
-    if ( elem_bits != elem_size )
-    {
-        if ( elem_bits < elem_size && elem_size % elem_bits != 0 )
-            return RC ( rcVDB, rcColumn, rcUpdating, rcType, rcInconsistent );
-        if ( elem_bits > elem_size && elem_bits % elem_size != 0 )
-            return RC ( rcVDB, rcColumn, rcUpdating, rcType, rcInconsistent );
-        if ( num_bits % elem_size != 0 )
-            return RC ( rcVDB, rcColumn, rcUpdating, rcType, rcInconsistent );
-    }
-
-    /* allow empty row */
-    if ( len == 0 )
-    {
-        self -> row_written = true;
-        self -> dflt_last = false;
-        return 0;
-    }
-
-    /* disallow any further modifications */
-    if ( self -> row_committed )
-        return RC ( rcVDB, rcColumn, rcUpdating, rcColumn, rcBusy );
-
-    /* total number of bits to be put into buffer */
-    doff = self -> bits_in_buffer + self -> row_len;
-    data_bits = doff + num_bits;
-
-    /* see if it fits into buffer */
-    if ( data_bits > KDataBufferBits ( & self -> data ) )
-    {
-        rc_t rc;
-
-        /* calculate needed bytes */
-        size_t new_size = ( ( size_t ) ( ( data_bits + 7 ) >> 3 ) + INITIAL_DATA_PEAK - 1 )
-            & ~ ( size_t ) ( INITIAL_DATA_PEAK - 1 );
-
-        /* need buffer memory */
-        if ( self -> data . elem_count == 0 )
-        {
-            /* always go with the peak size if larger */
-            if ( new_size < self -> data_peak )
-                new_size = self -> data_peak;
-
-            /* make initial buffer at most recent peak */
-            rc = KDataBufferMakeBytes ( & self -> data, new_size );
-            if ( rc != 0 )
-                return rc;
-        }
-        else
-        {
-            /* we have a new peak */
-            rc = KDataBufferResize ( & self -> data, new_size );
-            if ( rc != 0 )
-                return rc;
-        }
-    }
-
-    /* copy in data */
-    if ( ( ( boff | doff | num_bits ) & 7 ) != 0 )
-        bitcpy ( self -> data . base, doff, buffer, boff, num_bits );
-    else
-    {
-        memcpy ( & ( ( uint8_t* ) self -> data . base ) [ doff >> 3 ],
-                 & ( ( const uint8_t* ) buffer ) [ boff >> 3 ], num_bits >> 3 );
-    }
-
-    /* accept changes */
-    self -> row_len += num_bits;
-    self -> row_written = true;
-    self -> dflt_last = false;
-
-    return 0;
-}
-
-/* RowDefaults
- *  if a row has not been written but has a default value,
- *  that value is written to the row. if no default exists,
- *  an error is generated.
- *
- *  "rc" [ OUT, DEFAULT ZERO ] - preset to 0
- *
- *  returns true if any error occurs ( i.e. "*rc != 0" )
- */
-bool CC WColumnRowDefaults ( void *item, void *data )
-{
-    WColumn *self = item;
-    rc_t *rc = data;
-
-    /* nothing to do if row written */
-    if ( self == NULL || self -> row_written )
-        return false;
-
-    /* error if no default value */
-    if ( ! self -> have_dflt )
-    {
-        * rc = RC ( rcVDB, rcColumn, rcClosing, rcRow, rcIncomplete );
-        PLOGERR ( klogErr,
-                  ( klogErr, * rc, "Column: $(col)", "col=%.*s"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr )
-            );
-        return true;
-    }
-        
-    /* detect NULL row as default */
-    if ( self -> dflt . elem_bits == 0 )
-    {
-        * rc = RC ( rcVDB, rcColumn, rcClosing, rcRow, rcNull );
-        PLOGERR ( klogWarn,
-                  ( klogWarn, * rc, "Column: $(col)", "col=%.*s"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr )
-            );
-        return false;
-    }
-
-    /* if the last column written was default,
-       there is an opportunity for simply incrementing the repeat count */
-    if ( USE_RLE && self -> dflt_last )
-    {
-        WColumnRowMap *rm = self -> rowmap . base;
-        assert ( self -> num_rows != 0 );
-        ++ rm [ self -> num_rows - 1 ] . cnt;
-        return false;
-    }
-
-    /* write default data */
-    * rc = WColumnWrite ( & self -> dad, self -> dflt . elem_bits,
-        self -> dflt . base, 0, self -> dflt . elem_count );
-    if ( * rc != 0 )
-        return true;
-    
-    /* record the fact that this was default */
-    self -> dflt_last = true;
-    return false;
-}
-
-/* CommitRow
- *  closes the row to further writes and accepts
- *  all data written so far as complete. if the accumulated
- *  page data trigger a flush, the flush parameter is set.
- *
- *  "end_id" [ IN/OUT ] - used to calculate the minimum
- *  end_id for pages. if the column decides that it has too
- *  much data in its buffer and wants a cutoff < current
- *  value, it can lower the id.
- *
- *  returns true if there was a memory error.
- */
-static
-bool WColumnCommitRepeatedRow ( WColumn *self, WColumnRowMap *rm, int64_t end_id )
-{
-    /* if we've previously declared a cutoff id,
-       incorporate the repeated row into the range */
-    if ( ( self -> cutoff_id != self -> start_id ) && ( self -> cutoff_id + 1 == end_id ) )
-        self -> cutoff_id = end_id;
-
-    /* just account for the repeated row */
-    ++ rm -> cnt;
-
-    /* drop data */
-    self -> row_len = 0;
-
-    /* the row has been successfully committed */
-    self -> row_committed = true;
-
-    /* no error */
-    return false;
-}
-
-static
-bool WColumnCommitRowData ( WColumn *self, int64_t *end_id )
-{
-    size_t cur_size;
-    uint64_t row_len;
-    bitsz_t elem_bits;
-    WColumnRowMap *rm;
-
-    /* if no data were written and that's okay, ignore */
-    if ( ! self -> row_written )
-    {
-        assert ( self -> row_len == 0 );
-        self -> row_committed = true;
-        return false;
-    }
-
-    /* column's element size */
-    elem_bits = VTypedescSizeof ( & self -> dad . desc );
-    assert ( self -> row_len % elem_bits == 0 );
-    row_len = self -> row_len / elem_bits;
-
-    /* detect repeated row */
-    if ( USE_RLE && self -> num_rows != 0 )
-    {
-        rm = self -> rowmap . base;
-        rm += self -> num_rows - 1;
-
-        if ( rm -> len == row_len )
-        {
-            bitsz_t poff, coff;
-            const uint8_t *base;
-
-            if ( row_len == 0 )
-                return WColumnCommitRepeatedRow ( self, rm, * end_id );
-
-            base = ( const void* ) self -> data . base;
-            assert ( self -> bits_in_buffer >= self -> row_len );
-            coff = self -> bits_in_buffer;
-            poff = self -> bits_in_buffer - self -> row_len;
-
-            if ( ( ( poff | coff | self -> row_len ) & 7 ) != 0 )
-            {
-                if ( bitcmp ( base, poff, base, coff, self -> row_len ) == 0 )
-                    return WColumnCommitRepeatedRow ( self, rm, * end_id );
-            }
-            else
-            {
-                if ( memcmp ( & base [ poff >> 3 ], & base [ coff >> 3 ], self -> row_len >> 3 ) == 0 )
-                    return WColumnCommitRepeatedRow ( self, rm, * end_id );
-            }
-        }
-    }
-
-    /* need to add a new row */
-    if ( ( uint64_t ) self -> num_rows == self -> rowmap . elem_count )
-    {
-        /* need more memory */
-        rc_t rc;
-        self -> rowmap . elem_bits = sizeof * rm * 8;
-        rc = KDataBufferResize ( & self -> rowmap, self -> rowmap . elem_count + 16 * 1024 );
-        if ( rc != 0 )
-        {
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "Column: $(col) failed to resize row map", "col=%.*s"
-                        , self -> dad . scol -> name -> name . size
-                        , self -> dad . scol -> name -> name . addr )
-                );
-            return true;
-        }
-    }
-
-    rm = self -> rowmap . base;
-    rm += self -> num_rows;
-
-    rm -> start_id = self -> end_id;
-    rm -> len = row_len;
-    rm -> cnt = 1;
-
-    self -> bits_in_buffer += self -> row_len;
-    self -> row_len = 0;
-
-    ++ self -> num_rows;
-    self -> row_committed = true;
-
-    /* detect 1x blob cutoff */
-    cur_size = ( size_t ) ( self -> bits_in_buffer + 7 ) >> 3;
-    if ( cur_size >= self -> trigger )
-    {
-        /* if size just crossed the trigger boundary and 
-         * cutoff_id has not been advanced yet */
-        if ( self -> cutoff_id == self -> start_id )
-        {
-            self -> cutoff_id = * end_id;
-        }
-
-        /* or perhaps the buffer is too large */
-        else if ( ( cur_size + cur_size ) >= self -> trigger * 3 )
-        {
-            /* set to min of current end or our cutoff */
-            if ( self -> cutoff_id < * end_id )
-            {
-#if ROW_COUNT_CUTOFFS
-                /* the number of rows until our cutoff */
-                uint64_t row_count = self -> cutoff_id - self -> start_id;
-                if ( row_count != 0 )
-                {
-/*                  int64_t end; */
-                    uint64_t msb = row_count;
-
-                    /* adjust id to nearest power of two size
-                       that does not exceed current id */
-                    while ( ( msb & ( msb - 1 ) ) != 0 )
-                        msb &= msb - 1;
-
-                    /* add in rounding factor to row_count */
-                    row_count += ( msb >> 1 );
-
-                    /* truncate */
-                    row_count &= ~ ( msb - 1 );
-
-                    if ( row_count >= 1024 )
-                    {
-                        /* limit to current row */
-                        while ( row_count > 1024 && self -> start_id + row_count > * end_id )
-                            row_count >>= 1;
-
-                        if ( self -> start_id + row_count <= * end_id )
-                            self -> cutoff_id = self -> start_id + row_count;
-                    }
-                }
-#endif
-                * end_id = self -> cutoff_id;
-            }
-        }
-    }
-
-    return false;
-}
-
-bool CC WColumnCommitRow ( void *item, void *data )
-{
-    WColumn *self = item;
-    if ( self != NULL )
-    {
-        int64_t *end_id = data;
-
-        if ( WColumnCommitRowData ( self, end_id ) )
-            return true;
-
-        /* if the row range is too great */
-        if ( ( self -> end_id - self -> start_id ) >= MAX_ROW_COUNT )
-        {
-            /* if row range has just crossed the boundary and 
-             * cutoff_id has not been advanced yet */
-            if ( self -> cutoff_id == self -> start_id )
-            {
-                self -> cutoff_id = * end_id;
-            }
-
-            /* set to min of current end or our cutoff */
-            else if ( self -> cutoff_id < * end_id )
-            {
-                * end_id = self -> cutoff_id;
-            }
-        }
-    }
-
-    return false;
-}
-
-/* RepeatRow
- *  go into the last row entry
- *  extend the count by uint64_t
- */
-void CC WColumnRepeatRow ( void *item, void *data )
-{
-    WColumn *self = item;
-    const WColumnRepeatRowData *pb = data;
-
-    if ( self != NULL && self -> num_rows != 0 )
-    {
-        WColumnRowMap *rm = self -> rowmap . base;
-        rm += self -> num_rows - 1;
-
-        /* if we've previously declared a cutoff id,
-           incorporate the repeated row into the range */
-        if ( ( self -> cutoff_id != self -> start_id ) && ( self -> cutoff_id + 1 == pb -> end_id ) )
-            self -> cutoff_id = pb -> end_id + pb -> count;
-
-        /* just account for the repeated row */
-        rm -> cnt += pb -> count;
-        self -> end_id += pb -> count;
-    }
-}
-
-/* CloseRow
- *  discards uncommitted data
- *  update state
- */
-void CC WColumnCloseRow ( void *item, void *ignore )
-{
-    WColumn *self = item;
-    if ( self != NULL )
-    {
-        if ( self -> row_committed )
-            ++ self -> end_id;
-
-        self -> row_len = 0;
-        self -> row_written = false;
-        self -> row_committed = false;
-    }
-}
-
-/* BufferPage
- *  captures page range
- *
- *  "end_id" [ IN, CONST ] - half-closed id of buffered range end
- *  column should capture this information for creating page
- *  id range either on demand, or pre-prepared.
- *
- *  returns true if there was a memory error.
- */
-static
-bool WColumnSplitBuffer ( WColumn *self, int64_t end_id, size_t rm_idx )
-{
-    rc_t rc;
-    int64_t id;
-    VBlob *vblob;
-    bool splitting;
-    size_t i, data_cur;
-    uint64_t sum_elems;
-
-    const WColumnRowMap *rm = self -> rowmap . base;
-
-    uint64_t num_rows = rm [ rm_idx ] . start_id + rm [ rm_idx ] . cnt - self -> start_id;
-    assert ( rm [ 0 ] . start_id == self -> start_id );
-
-    /* adjust end_id [ TAKES CARE OF THEORETICAL ERROR CONDITION
-       NOT KNOWN TO EXIST ] and num_rows ( when splitting repeat ) */
-    id = end_id;
-    splitting = false;
-    if ( self -> start_id + num_rows <= id )
-        id = self -> start_id + num_rows;
-    else
-    {
-        num_rows = id - self -> start_id;
-        splitting = true;
-    }
-
-    /* release previous ( but unexpected ) cache if there */
-    if ( self -> page != NULL )
-    {
-        TRACK_BLOB ( VBlobRelease, self -> page );
-        VBlobRelease ( self -> page );
-        self -> page = NULL;
-    }
-
-    /* create new blob */
-    rc = VBlobNew ( & vblob,
-                    self -> start_id, id - 1,
-                    self -> dad . scol -> name -> name . addr );
-    TRACK_BLOB ( VBlobNew, vblob );
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogErr,
-                  ( klogErr, rc, "Column: $(col) failed to allocate page", "col=%.*s"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr )
-            );
-        return true;
-    }
-
-    /* create blob page map */
-    rc = PageMapNew ( & vblob -> pm, rm_idx + 1 ); /*** rm_idx tells many WColumnRowMap need to be added to PageMap ***/
-    if ( rc != 0 )
-    {
-        TRACK_BLOB ( VBlobRelease, vblob );
-        VBlobRelease ( vblob );
-
-        PLOGERR ( klogErr,
-                  ( klogErr, rc, "Column: $(col) failed to create page map", "col=%.*s"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr )
-            );
-        return true;
-    }
-
-    /* write page map up to ( but not including ) last entry */
-    for ( sum_elems = 0, i = 0; i < rm_idx; ++ i )
-    {
-        sum_elems += rm [ i ] . len;
-        rc = PageMapAppendSomeRows ( vblob -> pm, rm [ i ] . len, rm [ i ] . cnt );
-        if ( rc != 0 )
-        {
-            TRACK_BLOB ( VBlobRelease, vblob );
-            VBlobRelease ( vblob );
-
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "Column: $(col) failed to write page map", "col=%.*s"
-                        , self -> dad . scol -> name -> name . size
-                        , self -> dad . scol -> name -> name . addr )
-                );
-            return true;
-        }
-    }
-
-    sum_elems += rm [ i ] . len;
-    rc = PageMapAppendSomeRows ( vblob -> pm, rm [ i ] . len, id - rm [ i ] . start_id );
-    if ( rc != 0 )
-    {
-        TRACK_BLOB ( VBlobRelease, vblob );
-        VBlobRelease ( vblob );
-
-        PLOGERR ( klogErr,
-                  ( klogErr, rc, "Column: $(col) failed to write page map", "col=%.*s"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr )
-            );
-        return true;
-    }
-
-    /* determine current data buffer usage */
-    data_cur = ( size_t ) ( ( ( self -> bits_in_buffer + 7 ) >> 3 )
-        + SINGLE_PAGE_SIZE - 1 ) & ~ ( size_t ) ( SINGLE_PAGE_SIZE - 1 );
-
-    /* update peak history */
-    if ( self -> data_peak_hist [ self -> peak_hist_idx ] == self -> data_peak )
-    {
-        int j;
-        size_t data_peak = data_cur;
-
-        for ( j = ( self -> peak_hist_idx + 1 ) & 0xF;
-              j != self -> peak_hist_idx;
-              j = ( j + 1 ) & 0xF )
-        {
-            if ( self -> data_peak_hist [ j ] > data_peak )
-                data_peak = self -> data_peak_hist [ j ];
-        }
-
-        self -> data_peak = data_peak;
-    }
-    self -> data_peak_hist [ self -> peak_hist_idx ] = data_cur;
-    self -> peak_hist_idx = ( self -> peak_hist_idx + 1 ) & 0xF;
-    if ( data_cur > self -> data_peak )
-        self -> data_peak = data_cur;
-
-    /* hand data over to blob */
-    vblob -> data = self -> data;
-    vblob -> data . elem_bits = VTypedescSizeof ( & self -> dad . desc );
-    vblob -> data . elem_count = sum_elems;
-
-    /* handle residual data */
-    if ( splitting )
-        sum_elems -= rm [ rm_idx ] . len;
-    else
-        ++ rm_idx;
-
-    if ( rm_idx == self -> num_rows )
-    {
-        /* no residual data/rows */
-        memset ( & self -> data, 0, sizeof self -> data );
-        self -> bits_in_buffer = 0;
-        self -> num_rows = 0;
-        self -> start_id = self -> cutoff_id = end_id;
-    }
-    else
-    {
-        KDataBuffer data;
-        bitsz_t boff, to_copy;
-
-        /* allocate a new data buffer */
-        rc = KDataBufferMakeBytes ( & data, self -> data_peak );
-        if ( rc != 0 )
-        {
-            /* forget transfer of blob */
-            memset ( & vblob -> data, 0, sizeof vblob -> data );
-
-            TRACK_BLOB ( VBlobRelease, vblob );
-            VBlobRelease ( vblob );
-
-            PLOGERR ( klogErr,
-                      ( klogErr, rc, "Column: $(col) failed to split page", "col=%.*s"
-                        , self -> dad . scol -> name -> name . size
-                        , self -> dad . scol -> name -> name . addr )
-                );
-            return true;
-        }
-
-        /* copy data */
-        boff = ( rm_idx > 0 ) ?
-            sum_elems * vblob -> data . elem_bits : 0;
-        to_copy = self -> bits_in_buffer - boff;
-        if ( ( ( boff | to_copy ) & 7 ) != 0 )
-            bitcpy ( data . base, 0, self -> data . base, boff, to_copy );
-        else
-            memcpy ( data . base, & ( ( const uint8_t* ) self -> data . base ) [ boff >> 3 ], to_copy >> 3 );
-
-        self -> data = data;
-        self -> bits_in_buffer = to_copy;
-
-        /* copy row map */
-        memmove ( self -> rowmap . base, & rm [ rm_idx ], ( self -> num_rows -= rm_idx ) * sizeof * rm );
-
-        /* adjust starting id and repeat count if splitting single row */
-        if ( splitting )
-        {
-            WColumnRowMap *split = self -> rowmap . base;
-            split -> cnt = split -> start_id + split -> cnt - id;
-            split -> start_id = id;
-        }
-
-        self -> start_id = self -> cutoff_id = id;
-    }
-
-    self -> page = vblob;
-    self -> dflt_last = false;
-
-    return false;
-}
-
-static
-int WColumnRowMapCompare ( const WColumnRowMap *self, int64_t id )
-{
-    /* id is right-edge exclusive */
-    if ( self -> start_id >= id )
-        return -1;
-    return id > self -> start_id + self -> cnt;
-}
-
-bool CC WColumnBufferPage ( void *item, void *const_end_id )
-{
-    WColumn *self = item;
-    if ( self != NULL )
-    {
-        int64_t end_id = * ( const int64_t* ) const_end_id;
-
-        int diff;
-        const WColumnRowMap *rm = self -> rowmap . base;
-        size_t i, left, right = self -> num_rows;
-
-        /* find the entry mentioned */
-        if ( self -> num_rows == 0 )
-        {
-            PLOGMSG ( klogWarn,
-                      ( klogWarn, "Column: $(col) has no rows to buffer", "col=%.*s"
-                        , self -> dad . scol -> name -> name . size
-                        , self -> dad . scol -> name -> name . addr )
-                );
-            return true;
-        }
-
-        /* check last entry */
-        i = right - 1;
-        diff = WColumnRowMapCompare ( & rm [ i ], end_id );
-        if ( diff >= 0 )
-            return WColumnSplitBuffer ( self, end_id, i );
-
-        /* check that the id is within our range at all */
-        assert ( self -> start_id == rm [ 0 ] . start_id );
-        if ( end_id < self -> start_id )
-        {
-            PLOGMSG ( klogWarn,
-                      ( klogWarn, "Column: $(col) cutoff id $(id) is not within range"
-                        , "col=%.*s,id=%ld"
-                        , self -> dad . scol -> name -> name . size
-                        , self -> dad . scol -> name -> name . addr
-                        , end_id )
-                );
-            return true;
-        }
-
-        /* search rails are left ( inclusive ) at 0, right ( exclusive ) at num_rows */
-        left = 0;
-
-        /* perform arithmetic search for initial portion */
-        if ( right > 1000 )
-        {
-            double p = ( double ) ( end_id - rm [ left ] . start_id ) /
-                ( rm [ right - 1 ] . start_id + rm [ right - 1 ] . cnt - rm [ left ] . start_id );
-            assert ( p >= 0.0 && p <= 1.0 );
-
-            i = left + p * ( right - left );
-
-            diff = WColumnRowMapCompare ( & rm [ i ], end_id );
-            if ( diff == 0 )
-                return WColumnSplitBuffer ( self, end_id, i );
-            if ( diff < 0 )
-                right = i;
-            else
-                left = i + 1;
-
-            if ( left < right )
-            {
-                p = ( double ) ( end_id - rm [ left ] . start_id ) /
-                    ( rm [ right - 1 ] . start_id + rm [ right - 1 ] . cnt - rm [ left ] . start_id );
-                assert ( p >= 0.0 && p <= 1.0 );
-
-                i = left + p * ( right - left );
-
-                diff = WColumnRowMapCompare ( & rm [ i ], end_id );
-                if ( diff == 0 )
-                    return WColumnSplitBuffer ( self, end_id, i );
-                if ( diff < 0 )
-                    right = i;
-                else
-                    left = i + 1;
-            }
-        }
-
-        /* normal binary search */
-        while ( left < right )
-        {
-            i = ( left + right ) >> 1;
-
-            diff = WColumnRowMapCompare ( & rm [ i ], end_id );
-            if ( diff == 0 )
-                return WColumnSplitBuffer ( self, end_id, i );
-            if ( diff < 0 )
-                right = i;
-            else
-                left = i + 1;
-        }
-
-        PLOGMSG ( klogErr,
-                  ( klogErr, "Column: $(col) cutoff id $(id) is not within range"
-                    , "col=%.*s,id=%ld"
-                    , self -> dad . scol -> name -> name . size
-                    , self -> dad . scol -> name -> name . addr
-                    , end_id )
-            );
-    }
-
-    return true;
-}
-
-/* ReadBlob
- *  reads an input blob
- *  called as a result of commit page which reads the validation production
- */
-rc_t WColumnReadBlob ( WColumn *self, VBlob **vblob, int64_t id )
-{
-    if ( self -> page == NULL )
-        return RC ( rcVDB, rcColumn, rcReading, rcBuffer, rcNotFound );
-    if ( id < self -> page -> start_id || id > self -> page -> stop_id )
-        return RC ( rcVDB, rcColumn, rcReading, rcRow, rcNotFound );
-
-    * vblob = self -> page;
-    VBlobAddRef ( self -> page );
-    TRACK_BLOB ( VBlobAddRef, self -> page );
-
-    return 0;
-}
-
-/* DropPage
- *  drops any page buffers created
- */
-void CC WColumnDropPage ( void *item, void *ignore )
-{
-    WColumn *self = item;
-    if ( self != NULL && self -> page != NULL )
-    {
-        TRACK_BLOB ( VBlobRelease, self -> page );
-        VBlobRelease ( self -> page );
-        self -> page = NULL;
-    }
-}
diff --git a/libs/vdb/wcursor.c b/libs/vdb/wcursor.c
deleted file mode 100644
index 6c88983..0000000
--- a/libs/vdb/wcursor.c
+++ /dev/null
@@ -1,1194 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "cursor-priv.h"
-#include "dbmgr-priv.h"
-#include "linker-priv.h"
-#include "schema-priv.h"
-#include "table-priv.h"
-#include "column-priv.h"
-#include "phys-priv.h"
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "blob-priv.h"
-
-#include <vdb/cursor.h>
-#include <vdb/table.h>
-#include <kdb/meta.h>
-#include <kfs/dyload.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#if VCURSOR_FLUSH_THREAD
-
-#include <kproc/lock.h>
-#include <kproc/cond.h>
-#include <kproc/thread.h>
-
-#if _DEBUGGING
-/* set to 1 to trigger behavior to simulate
-   an error within flush thread */
-#define FORCE_FLUSH_ERROR_EXIT 0
-#endif
-
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VCursor
- *  a row cursor onto a VTable
- */
-
-/* forward
- *  to avoid reordering whole page
- */
-static
-rc_t VCursorFlushPageInt ( VCursor *self );
-
-
-/* Whack
- */
-rc_t VCursorWhack ( VCursor *self )
-{
-#if VCURSOR_FLUSH_THREAD
-    if ( self -> flush_thread != NULL )
-    {
-        rc_t rc = KLockAcquire ( self -> flush_lock );
-        if ( rc == 0 )
-        {
-            while ( self -> flush_state == vfBusy )
-            {
-                MTCURSOR_DBG (( "VCursorWhack: waiting for thread to process\n" ));
-                KConditionWait ( self -> flush_cond, self -> flush_lock );
-            }
-            self -> flush_state = vfExit;
-            KConditionSignal ( self -> flush_cond );
-            KLockUnlock ( self -> flush_lock );
-        }
-
-        MTCURSOR_DBG (( "VCursorWhack: waiting on thread to exit\n" ));
-        KThreadWait ( self -> flush_thread, NULL );
-    }
-
-    MTCURSOR_DBG (( "VCursorWhack: finishing\n" ));
-    KThreadRelease ( self -> flush_thread );
-    KConditionRelease ( self -> flush_cond );
-    KLockRelease ( self -> flush_lock );
-#endif
-    VCursorTerminatePagemapThread(self);
-    return VCursorDestroy ( self );
-}
-
-
-/* CreateCursor
- *  creates a cursor object onto table
- *  multiple read cursors are allowed
- *  only a single write cursor is allowed
- *
- *  "curs" [ OUT ] - return parameter for newly created cursor
- *
- *  "mode" [ IN ] - describes udate behavior
- *    kcmUpdate   : allow inserts or updates
- *    kcmReplace  : replace all existing rows with newly written rows
- *    kcmInsert   : allow only inserts, i.e. new rows
- */
-#if VCURSOR_FLUSH_THREAD
-static rc_t CC run_flush_thread ( const KThread *t, void *data );
-#endif
-
-rc_t VTableCreateCursorWriteInt ( VTable *self, VCursor **cursp, KCreateMode mode, bool create_thread )
-{
-    rc_t rc;
-
-    if ( cursp == NULL )
-        rc = RC ( rcVDB, rcCursor, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcVDB, rcCursor, rcCreating, rcTable, rcReadonly );
-#if VCURSOR_WRITE_MODES_SUPPORTED
-#error "expecting kcmInsert mode only"
-#else
-        else if ( mode != kcmInsert )
-            rc = RC ( rcVDB, rcCursor, rcCreating, rcMode, rcUnsupported );
-#endif
-        else
-        {
-            VCursor *curs;
-
-#if LAZY_OPEN_COL_NODE
-            if ( self -> col_node == NULL )
-                KMetadataOpenNodeUpdate ( self -> meta, & self -> col_node, "col" );
-#endif
-            rc = VCursorMake ( & curs, self );
-            if ( rc == 0 )
-            {
-                rc = VCursorSupplementSchema ( curs );
-#if VCURSOR_FLUSH_THREAD
-                if ( rc == 0 && create_thread )
-                {
-                    rc = KLockMake ( & curs -> flush_lock );
-                    if ( rc == 0 )
-                        rc = KConditionMake ( & curs -> flush_cond );
-                    if ( rc == 0 )
-                        rc = KThreadMake ( & curs -> flush_thread, run_flush_thread, curs );
-                }
-#endif
-                if(rc == 0)
-                    rc = VCursorLaunchPagemapThread(curs);
-                if ( rc == 0 )
-                {
-                    * cursp = curs;
-                    return 0;
-                }
-
-                VCursorRelease ( curs );
-            }
-        }
-
-        * cursp = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableCreateCursorWrite ( VTable *self, VCursor **cursp, KCreateMode mode )
-{
-    return VTableCreateCursorWriteInt ( self, cursp, mode, true );
-}
-
-
-/* MakeColumn
- */
-rc_t VCursorMakeColumn ( VCursor *self, VColumn **col, const SColumn *scol )
-{
-    VTable *vtbl;
-
-    if ( self -> read_only )
-        return VColumnMake ( col, self -> schema, scol );
-
-    vtbl = self -> tbl;
-    return WColumnMake ( col, self -> schema, scol, vtbl -> stbl -> limit, vtbl -> mgr );
-}
-
-
-/* PostOpenAdd
- *  handle opening of a column after the cursor is opened
- */
-rc_t VCursorPostOpenAdd ( VCursor *self, VColumn *col )
-{
-    rc_t rc = VCursorPostOpenAddRead ( self, col );
-
-    if ( ! self -> read_only && rc == 0 && self -> state == vcRowOpen )
-    {
-        int64_t row_id = self -> row_id;
-        WColumnOpenRow ( col, & row_id );
-    }
-
-    return rc;
-}
-
-/* Open
- *  open cursor, resolving schema
- *  for the set of opened columns
- *
- *  NB - there is no corresponding "Close"
- *  use "Release" instead.
- */
-static
-rc_t VProdResolveAddShallowTriggers ( const VProdResolve *self, const STable *stbl )
-{
-    rc_t rc;
-    VCursor *curs;
-    uint32_t i = VectorStart ( & stbl -> prod );
-    uint32_t end = i + VectorLength ( & stbl -> prod );
-
-    for ( rc = 0, curs = self -> curs; ( rc == 0 || self -> ignore_column_errors ) && i < end; ++ i )
-    {
-        SProduction *sprod = VectorGet ( & stbl -> prod, i );
-        if ( sprod != NULL && sprod -> trigger )
-        {
-            VProduction *prod = NULL;
-            rc = VProdResolveSProduction ( self, & prod, sprod );
-            if ( rc == 0 && prod != NULL )
-                rc = VectorAppend ( & curs -> trig, NULL, prod );
-        }
-    }
-
-    if ( self -> ignore_column_errors )
-        return 0;
-
-    return rc;
-}
-
-static
-rc_t VProdResolveAddTriggers ( const VProdResolve *self, const STable *stbl )
-{
-    uint32_t i = VectorStart ( & stbl -> overrides );
-    uint32_t end = VectorLength ( & stbl -> overrides );
-    for ( end += i; i < end; ++ i )
-    {
-        const STable *dad = STableFindOrdAncestor ( stbl, i );
-        rc_t rc = VProdResolveAddShallowTriggers ( self, dad );
-        if ( rc != 0 )
-            return rc;
-    }
-    return VProdResolveAddShallowTriggers ( self, stbl );
-}
-
-LIB_EXPORT rc_t CC VCursorOpen ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcSelf, rcNull );
-    else
-    {
-        VLinker *ld = self -> tbl -> linker;
-
-        KDlset *libs;
-        rc = VLinkerOpen ( ld, & libs );
-        if ( rc == 0 )
-        {
-            rc = VCursorOpenRead ( self, libs );
-            if ( rc == 0 )
-            {
-                if ( ! self -> read_only )
-                {
-                    VProdResolve pr;
-                    pr . schema = self -> schema;
-                    pr . ld = ld;
-                    pr . libs = libs;
-                    pr . stbl = self -> stbl;
-                    pr . curs = self;
-                    pr . cache = & self -> prod;
-                    pr . owned = & self -> owned;
-                    pr . chain = chainEncoding;
-                    pr . blobbing = false;
-                    pr . ignore_column_errors = false;
-                    pr . discover_writable_columns = false;
-
-		    if ( !self -> suspend_triggers )
-			    rc = VProdResolveAddTriggers ( & pr, self -> stbl );
-                }
-                if ( rc == 0 )
-                {
-                    /* TBD - warn if any input columns are unreferenced by schema */
-
-                    int64_t first;
-                    uint64_t count;
-                    
-                    rc = VCursorIdRange ( self, 0, & first, & count );
-                    if ( rc != 0 )
-                    {
-                        if ( GetRCState ( rc ) == rcEmpty )
-                        {
-                            /* writable cursors are expected to be empty */
-                            if ( ! self -> read_only ||
-                                 /* permit empty open when run from sradb */
-                                 ( GetRCObject ( rc ) == rcRange &&
-                                   self -> permit_add_column &&
-                                   VectorLength ( & self -> row ) == 0 ) )
-                            {
-                                rc = 0;
-                            }
-                        }
-                    }
-                    else if ( count != 0 )
-                    {
-                        if ( self -> read_only )
-                        {
-                            /* set initial row id to starting row */
-                            self -> start_id = self -> end_id = self -> row_id = first;
-                        }
-                        else
-                        {
-                            /* set initial row id to append */
-                            self -> start_id = self -> end_id = self -> row_id = first + count;
-                        }
-                    }
-                }
-
-                if ( rc != 0 )
-                    self -> state = vcFailed;
-            }
-
-            KDlsetRelease ( libs );
-        }
-    }
-
-    return rc;
-}
-
-
-/* ListWritableColumns
- *  walks list of SPhysicals and trigger SProductions
- *  attempts to resolve all write rules
- *  records any SColumn that can be reached
- *  populates BTree with VColumnRef objects
- */
-struct resolve_phys_data
-{
-    VProdResolve pr;
-    const KNamelist *seed;
-    uint32_t count;
-};
-
-static
-void CC resolve_writable_sphys ( void *item, void *data )
-{
-    struct resolve_phys_data *pb = data;
-    const SPhysMember *smbr = ( const void* ) item;
-    VProduction *out = NULL;
-
-    if ( pb -> seed == NULL )
-        VProdResolveSPhysMember ( & pb -> pr, & out, smbr );
-    else
-    {
-        uint32_t i;
-        const KSymbol *sym = smbr -> name;
-        const char *sname = sym -> name . addr;
-        size_t ssize = sym -> name . size;
-        if ( sname [ 0 ] == '.' )
-        {
-            ++ sname;
-            -- ssize;
-        }
-
-        /* TBD - this is not too speedy, but it is
-           very low frequency in all known cases */
-        for ( i = 0; i < pb -> count; ++ i )
-        {
-            const char *name;
-            rc_t rc = KNamelistGet ( pb -> seed, i, & name );
-            if ( rc == 0 )
-            {
-                if ( strlen ( name ) == ssize && memcmp ( sname, name, ssize ) == 0 )
-                {
-                    VProdResolveSPhysMember ( & pb -> pr, & out, smbr );
-                    break;
-                }
-            }
-        }
-    }
-}
-
-static
-void VProdResolveWritableColumns ( struct resolve_phys_data *pb, bool suspend_triggers )
-{
-    const STable *dad, *stbl = pb -> pr . stbl;
-
-    /* walk table schema looking for parents */
-    uint32_t i = VectorStart ( & stbl -> overrides );
-    uint32_t end = VectorLength ( & stbl -> overrides );
-    for ( end += i; i < end; ++ i )
-    {
-        dad = STableFindOrdAncestor ( stbl, i );
-        VectorForEach ( & dad -> phys, false, resolve_writable_sphys, pb );
-    }
-
-    /* walk current table */
-    VectorForEach ( & stbl -> phys, false, resolve_writable_sphys, pb );
-
-    /* add triggers */
-    if ( !suspend_triggers && pb -> seed == NULL )
-    {
-        pb -> pr . chain = chainUncommitted;
-        VProdResolveAddTriggers ( & pb -> pr, stbl );
-    }
-}
-
-rc_t VCursorListSeededWritableColumns ( VCursor *self, BSTree *columns, const KNamelist *seed )
-{
-    rc_t rc;
-    KDlset *libs;
-
-    struct resolve_phys_data pb;
-    pb . pr . schema = self -> schema;
-    pb . pr . ld = self -> tbl -> linker;
-    pb . pr . stbl = self -> stbl;
-    pb . pr . curs = self;
-    pb . pr . cache = & self -> prod;
-    pb . pr . owned = & self -> owned;
-    pb . pr . chain = chainEncoding;
-    pb . pr . blobbing = false;
-    pb . pr . ignore_column_errors = true;
-    pb . pr . discover_writable_columns = true;
-    pb . seed = seed;
-
-    if ( seed != NULL )
-    {
-        rc = KNamelistCount ( seed, & pb . count );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* open the dynamic linker libraries */
-    rc = VLinkerOpen ( pb . pr . ld, & libs );
-    if ( rc == 0 )
-    {
-        pb . pr . libs = libs;
-        VProdResolveWritableColumns ( & pb , self->suspend_triggers );
-        KDlsetRelease ( libs );
-
-        if ( rc == 0 )
-        {
-            /* add columns to list */
-            uint32_t idx = VectorStart ( & self -> row );
-            uint32_t end = VectorLength ( & self -> row );
-
-            for ( end += idx; idx < end; ++idx )
-            {
-                const VColumn* vcol = ( const VColumn* ) VectorGet ( & self -> row, idx );
-                if ( vcol != NULL )
-                {
-                    VColumnRef *cref;
-                    rc = VColumnRefMake ( & cref, self -> schema, vcol -> scol );
-                    if ( rc != 0 )
-                        break;
-
-                    rc = BSTreeInsert ( columns, & cref -> n, VColumnRefSort );
-                    assert ( rc == 0 );
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-rc_t VCursorListWritableColumns ( VCursor *self, BSTree *columns )
-{
-    return VCursorListSeededWritableColumns ( self, columns, NULL );
-}
-
-/* SetRowId
- *  seek to given row id
- *
- *  "row_id" [ IN ] - row id to select
- */
-LIB_EXPORT rc_t CC VCursorSetRowId ( const VCursor *cself, int64_t row_id )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcPositioning, rcSelf, rcNull );
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcPositioning, rcCursor, rcInvalid );
-    else if ( self -> state > vcReady || self -> start_id < self -> end_id )
-        rc = RC ( rcVDB, rcCursor, rcPositioning, rcCursor, rcBusy );
-    else if ( self -> read_only )
-        rc = VCursorSetRowIdRead ( self, row_id );
-    else
-    {
-        /* the test of start/end range above tells us that
-           no rows are buffered, so the row id can be simply set */
-        self -> start_id = self -> end_id = self -> row_id = row_id;
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* OpenRow
- *  open currently closed row indicated by row id
- */
-LIB_EXPORT rc_t CC VCursorOpenRow ( const VCursor *cself )
-{
-    rc_t rc;
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcOpening, rcSelf, rcNull );
-    else if ( self -> state != vcReady )
-    {
-        switch ( self -> state )
-        {
-        case vcConstruct:
-            rc = RC ( rcVDB, rcCursor, rcOpening, rcRow, rcIncomplete );
-            break;
-        case vcFailed:
-            rc = RC ( rcVDB, rcCursor, rcOpening, rcCursor, rcInvalid );
-            break;
-        case vcRowOpen:
-            rc = 0;
-            break;
-        default:
-            rc = RC ( rcVDB, rcCursor, rcOpening, rcRow, rcBusy );
-        }
-    }
-    else if ( self -> read_only )
-        rc = VCursorOpenRowRead ( self );
-    else
-    {
-        /* validate that all columns have the same starting row_id */
-        int64_t row_id = self -> row_id;
-        VectorForEach ( & self -> row, false, WColumnOpenRow, & row_id );
-        assert ( row_id == self -> row_id );
-        self -> state = vcRowOpen;
-        rc = 0;
-    }
-
-    return rc;
-}
-
-/* CommitRow
- *  commit row after writing
- *  prevents further writes
- */
-LIB_EXPORT rc_t CC VCursorCommitRow ( VCursor *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcCommitting, rcSelf, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcVDB, rcCursor, rcCommitting, rcCursor, rcReadonly );
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcCommitting, rcCursor, rcInvalid );
-    else if ( self -> state < vcRowOpen )
-        rc = RC ( rcVDB, rcCursor, rcCommitting, rcRow, rcNotOpen );
-    else if ( self -> state >= vcRowCommitted )
-        rc = 0;
-    else
-    {
-        self -> permit_add_column = self -> permit_post_open_add;
-
-        /* tell columns to slam in any default values */
-        rc = 0;
-        if ( VectorDoUntil ( & self -> row, false, WColumnRowDefaults, & rc ) )
-            return rc;
-
-        /* account for row just written */
-        self -> end_id = self -> row_id + 1;
-
-        /* tell columns to commit the row, and allow
-           each to return an earlier cutoff id ( half-closed ) */
-        if ( VectorDoUntil ( & self -> row, false, WColumnCommitRow, & self -> end_id ) )
-        {
-            self -> state = vcFailed;
-            return RC ( rcVDB, rcCursor, rcCommitting, rcMemory, rcExhausted );
-        }
-
-        /* returned result should never be <= start id */
-        assert ( self -> end_id > self -> start_id );
-
-        /* if returned result dips down into the range of buffered rows
-           then one or more columns has requested an automatic page commit */
-        self -> state = ( self -> end_id <= self -> row_id ) ? vcPageCommit : vcRowCommitted;
-    }
-
-    return rc;
-}
-
-/* RepeatRow
- *  repeats the current row by the count provided
- *  row must have been committed
- *
- *  AVAILABILITY: version 2.6
- *
- *  "count" [ IN ] - the number of times to repeat
- *  the current row.
- */
-LIB_EXPORT rc_t CC VCursorRepeatRow ( VCursor *self, uint64_t count )
-{
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcSelf, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcReadonly );
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcCursor, rcInvalid );
-    else if ( self -> state < vcRowOpen )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcRow, rcNotOpen );
-    else if ( self -> state < vcRowCommitted )
-        rc = RC ( rcVDB, rcCursor, rcUpdating, rcRow, rcInvalid );
-    else if ( count != 0 )
-    {
-        WColumnRepeatRowData pb;
-        pb . end_id = self -> row_id;
-        pb . count = count;
-
-        /* tell columns to commit the row, and allow
-           each to return an earlier cutoff id ( half-closed ) */
-        VectorForEach ( & self -> row, false, WColumnRepeatRow, & pb );
-
-        /* extend the current row-id */
-        if ( self -> end_id < self -> row_id )
-            self -> row_id += count;
-        else
-        {
-            self -> row_id += count;
-            self -> end_id += count;
-        }
-    }
-
-    return rc;
-}
-
-/* CloseRow
- *  balances OpenRow message
- *  if there are uncommitted modifications,
- *  discard all changes. otherwise,
- *  advance to next row
- */
-LIB_EXPORT rc_t CC VCursorCloseRow ( const VCursor *cself )
-{
-    rc_t rc = 0;        /* needed in case FlushPage isn't called */
-    VCursor *self = ( VCursor* ) cself;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcClosing, rcSelf, rcNull );
-    else if ( self -> state == vcFailed )
-        rc = RC ( rcVDB, rcCursor, rcClosing, rcCursor, rcInvalid );
-    else if ( self -> state < vcRowOpen )
-        rc = 0;
-    else if ( self -> read_only )
-        rc = VCursorCloseRowRead ( self );
-    else
-    {
-        /* tell each of the columns that no further data may be written
-           and to abandon any uncommitted writes */
-        VectorForEach ( & self -> row, false, WColumnCloseRow, NULL );
-
-        /* if the row was committed... */
-        if ( self -> state >= vcRowCommitted )
-        {
-            /* close off the page if so requested */
-            if ( self -> state == vcPageCommit )
-            {
-                rc = VCursorFlushPageInt ( self );
-                if ( rc )
-                {
-                    self -> state = vcFailed;
-                    return rc;
-                }
-            }
-
-            /* advance to next id */
-            ++ self -> row_id;
-        }
-
-        self -> state = vcReady;
-        rc = 0;
-    }
-
-    return rc;
-}
-
-
-/* Default
- *  give a default row value for column
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - stated element size in bits, required
- *  to be compatible with the actual element size
- *
- *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
- *  to start of default row data where "boff" is in BITS
- *
- *  "row_len" [ IN ] - the number of elements in default row
- */
-LIB_EXPORT rc_t CC VCursorDefault ( VCursor *self, uint32_t col_idx,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t row_len )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcSelf, rcNull );
-    else if ( buffer == NULL && ( boff != 0 || row_len != 0 ) )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcParam, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcCursor, rcReadonly );
-    else if ( elem_bits == 0 )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcParam, rcInvalid );
-    else
-    {
-        VColumn *col = VectorGet ( & self -> row, col_idx );
-        if ( col == NULL )
-            rc = RC ( rcVDB, rcCursor, rcWriting, rcColumn, rcInvalid );
-        else
-            rc = WColumnSetDefault ( col, elem_bits, buffer, boff, row_len );
-    }
-
-    return rc;
-}
-
-
-/* Write
- *  append bit-aligned column data to row
- *
- *  "col_idx" [ IN ] - index of column to be read, returned by "AddColumn"
- *
- *  "elem_bits" [ IN ] - stated element size in bits, required
- *  to be compatible with the actual element size
- *
- *  "buffer" [ IN ] and "boff" [ IN ] - compound pointer and offset
- *  to start of default row data where "boff" is in BITS
- *
- *  "count" [ IN ] - the number of elements to append
- */
-LIB_EXPORT rc_t CC VCursorWrite ( VCursor *self, uint32_t col_idx,
-    bitsz_t elem_bits, const void *buffer, bitsz_t boff, uint64_t count )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcSelf, rcNull );
-    else if ( buffer == NULL && count != 0 )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcParam, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcVDB, rcCursor, rcWriting, rcCursor, rcReadonly );
-    else if ( self -> state != vcRowOpen )
-    {
-        switch ( self -> state )
-        {
-        case vcConstruct:
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcCursor, rcNotOpen );
-            break;
-        case vcFailed:
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcCursor, rcInvalid );
-            break;
-        case vcReady:
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcRow, rcNotOpen );
-            break;
-        default:
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcRow, rcLocked );
-        }
-    }
-    else
-    {
-        VColumn *col = VectorGet ( & self -> row, col_idx );
-        if ( col == NULL )
-            rc = RC ( rcVDB, rcCursor, rcWriting, rcColumn, rcInvalid );
-        else
-            rc = WColumnWrite ( col, elem_bits, buffer, boff, count );
-    }
-
-    return rc;
-}
-
-
-/* FlushPage
- *  forces flush of all buffered page data
- *  fails if row is open
- *
- *  pages are normally auto-committed based upon
- *  size and column affinity
- */
-typedef struct run_trigger_prod_data run_trigger_prod_data;
-struct run_trigger_prod_data
-{
-    int64_t  id;
-    uint32_t cnt;
-    rc_t rc;
-};
-
-static
-bool CC run_trigger_prods ( void *item, void *data )
-{
-    run_trigger_prod_data *pb = data;
-    VProduction *prod = item;
-
-    VBlob *blob;
-    pb -> rc = VProductionReadBlob ( prod, & blob, pb -> id , pb -> cnt, NULL);
-    if ( pb -> rc != 0 )
-        return true;
-    if ( blob != NULL )
-        TRACK_BLOB ( VBlobRelease, blob );
-    ( void ) VBlobRelease ( blob );
-    return false;
-}
-
-#if VCURSOR_FLUSH_THREAD
-static
-rc_t CC run_flush_thread ( const KThread *t, void *data )
-{
-    rc_t rc;
-    VCursor *self = data;
-
-    /* acquire lock */
-    MTCURSOR_DBG (( "run_flush_thread: acquiring lock\n" ));
-    rc = KLockAcquire ( self -> flush_lock );
-    if ( rc == 0 )
-    {
-        do
-        {
-            bool failed;
-            run_trigger_prod_data pb;
-
-            /* wait for data */
-            if ( self -> flush_state == vfReady )
-            {
-                MTCURSOR_DBG (( "run_flush_thread: waiting for input\n" ));
-                rc = KConditionWait ( self -> flush_cond, self -> flush_lock );
-                if ( rc != 0 )
-                    break;
-            }
-
-            /* bail unless state is busy */
-            if ( self -> flush_state != vfBusy )
-            {
-                MTCURSOR_DBG (( "run_flush_thread: exiting\n" ));
-                break;
-            }
-
-            /* prepare param block */
-            pb . id = self -> flush_id;
-            pb . cnt = self -> flush_cnt;
-            pb . rc = 0;
-
-            MTCURSOR_DBG (( "run_flush_thread: unlocking and running\n" ));
-            KLockUnlock ( self -> flush_lock );
-
-            /* run productions from trigger roots */
-            failed = VectorDoUntil ( & self -> trig, false, run_trigger_prods, & pb );
-
-            /* drop page buffers */
-            MTCURSOR_DBG (( "run_flush_thread: dropping page buffers\n" ));
-            VectorForEach ( & self -> row, false, WColumnDropPage, NULL );
-
-            /* reacquire lock */
-            MTCURSOR_DBG (( "run_flush_thread: re-acquiring lock" ));
-            rc = KLockAcquire ( self -> flush_lock );
-            if ( rc != 0 )
-            {
-                self -> flush_state = vfBgErr;
-                LOGERR ( klogSys, rc, "run_flush_thread: re-acquiring lock failed - exit" );
-                return rc;
-            }
-
-#if FORCE_FLUSH_ERROR_EXIT
-            if ( ! failed )
-            {
-                pb . rc = RC ( rcVDB, rcCursor, rcFlushing, rcThread, rcCanceled );
-                failed = true;
-            }
-#endif
-            /* get out on failure */
-            if ( failed )
-            {
-                self -> flush_state = vfBgErr;
-                LOGERR ( klogInt, pb . rc, "run_flush_thread: run_trigger_prods failed - exit" );
-                KConditionSignal ( self -> flush_cond );
-                rc = pb . rc;
-            }
-
-            /* no longer busy */
-            else if ( self -> flush_state == vfBusy )
-            {
-                /* signal waiter */
-                self -> flush_state = vfReady;
-                MTCURSOR_DBG (( "run_flush_thread: signaling ready\n" ));
-                rc = KConditionSignal ( self -> flush_cond );
-                if ( rc != 0 )
-                    LOGERR ( klogSys, rc, "run_flush_thread: failed to signal foreground thread - exit" );
-            }
-        }
-        while ( rc == 0 );
-
-        MTCURSOR_DBG (( "run_flush_thread: unlocking\n" ));
-        KLockUnlock ( self -> flush_lock );
-    }
-
-    MTCURSOR_DBG (( "run_flush_thread: exit\n" ));
-    return rc;
-}
-#endif
-
-static
-rc_t VCursorFlushPageInt ( VCursor *self )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcCursor, rcFlushing, rcSelf, rcNull );
-    else if ( self -> read_only )
-        rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcReadonly );
-    else
-    {
-        int64_t end_id;
-#if ! VCURSOR_FLUSH_THREAD
-        run_trigger_prod_data pb;
-#endif
-        switch ( self -> state )
-        {
-        case vcConstruct:
-            rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcNotOpen );
-            break;
-        case vcFailed:
-            rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcInvalid );
-            break;
-        case vcRowOpen:
-            rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcBusy );
-            break;
-        default:
-
-            /* ignore request if there is no page to commit */
-            if ( self -> start_id == self -> end_id )
-            {
-                /* the cursor should be in unwritten state,
-                   where the row_id can be reset but drags
-                   along the other markers. */
-                assert ( self -> end_id == self -> row_id );
-                return 0;
-            }
-
-#if VCURSOR_FLUSH_THREAD
-            MTCURSOR_DBG (( "VCursorFlushPageInt: going to acquire lock\n" ));
-            /* get lock */
-            rc = KLockAcquire ( self -> flush_lock );
-            if ( rc != 0 )
-                return rc;
-
-            MTCURSOR_DBG (( "VCursorFlushPageInt: have lock\n" ));
-
-            /* make sure that background thread is ready */
-            while ( self -> flush_state == vfBusy )
-            {
-                MTCURSOR_DBG (( "VCursorFlushPageInt: waiting for background thread\n" ));
-                rc = KConditionWait ( self -> flush_cond, self -> flush_lock );
-                if ( rc != 0 )
-                {
-                    LOGERR ( klogSys, rc, "VCursorFlushPageInt: wait failed - exiting" );
-                    KLockUnlock ( self -> flush_lock );
-                    return rc;
-                }
-            }
-
-            if ( self -> flush_state != vfReady )
-            {
-                if ( self -> flush_state != vfBgErr )
-                    rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcInconsistent );
-                else
-                {
-                    rc_t rc2;
-                    MTCURSOR_DBG (( "VCursorFlushPageInt: waiting on thread to exit\n" ));
-                    rc = KThreadWait ( self -> flush_thread, & rc2 );
-                    if ( rc == 0 )
-                    {
-                        rc = rc2;
-                        MTCURSOR_DBG (( "VCursorFlushPageInt: releasing thread\n" ));
-                        KThreadRelease ( self -> flush_thread );
-                        self -> flush_thread = NULL;
-                    }
-                }
-
-                PLOGERR ( klogInt, (klogInt, rc, "VCursorFlushPageInt: not in ready state[$(state)] - exiting","state=%hu",self -> flush_state ));
-                KLockUnlock ( self -> flush_lock );
-                return rc;
-            }
-
-            MTCURSOR_DBG (( "VCursorFlushPageInt: running buffer page\n" ));
-#endif
-
-            /* first, tell all columns to bundle up their pages into buffers */
-            end_id = self -> end_id;
-            rc = RC ( rcVDB, rcCursor, rcFlushing, rcMemory, rcExhausted );
-            if ( VectorDoUntil ( & self -> row, false, WColumnBufferPage, & end_id ) )
-            {
-                VectorForEach ( & self -> row, false, WColumnDropPage, NULL );
-                self -> flush_state = vfFgErr;
-            }
-            else
-            {
-                /* supposed to be constant */
-                assert ( end_id == self -> end_id );
-#if VCURSOR_FLUSH_THREAD
-                MTCURSOR_DBG (( "VCursorFlushPageInt: pages buffered - capturing id and count\n" ));
-                self -> flush_id = self -> start_id;
-                self -> flush_cnt = self -> end_id - self -> start_id;
-
-                self -> start_id = self -> end_id;
-                self -> end_id = self -> row_id + 1;
-                self -> state = vcReady;
-
-                MTCURSOR_DBG (( "VCursorFlushPageInt: state set to busy - signaling bg thread\n" ));
-                self -> flush_state = vfBusy;
-                rc = KConditionSignal ( self -> flush_cond );
-                if ( rc != 0 )
-                    LOGERR ( klogSys, rc, "VCursorFlushPageInt: condition returned error on signal" );
-#else
-                /* run all validation and trigger productions */
-                pb . id = self -> start_id;
-                pb . cnt = self -> end_id - self -> start_id;
-                pb . rc = 0;
-                if ( ! VectorDoUntil ( & self -> trig, false, run_trigger_prods, & pb ) )
-                {
-                    self -> start_id = self -> end_id;
-                    self -> end_id = self -> row_id + 1;
-                    self -> state = vcReady;
-                }
-
-                rc = pb . rc;
-
-                /* drop page buffers */
-                VectorForEach ( & self -> row, false, WColumnDropPage, NULL );
-#endif
-            }
-
-#if VCURSOR_FLUSH_THREAD
-            MTCURSOR_DBG (( "VCursorFlushPageInt: unlocking\n" ));
-            KLockUnlock ( self -> flush_lock );
-#endif
-        }
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorFlushPage ( VCursor *self )
-{
-    rc_t rc = VCursorFlushPageInt ( self );
-    if ( rc == 0 )
-    {
-#if VCURSOR_FLUSH_THREAD
-        MTCURSOR_DBG (( "VCursorFlushPage: going to acquire lock\n" ));
-        /* get lock */
-        rc = KLockAcquire ( self -> flush_lock );
-        if ( rc != 0 )
-            return rc;
-
-        MTCURSOR_DBG (( "VCursorFlushPage: have lock\n" ));
-
-        /* wait until background thread has finished */
-        while ( self -> flush_state == vfBusy )
-        {
-            MTCURSOR_DBG (( "VCursorFlushPage: waiting for background thread\n" ));
-            rc = KConditionWait ( self -> flush_cond, self -> flush_lock );
-            if ( rc != 0 )
-            {
-                LOGERR ( klogSys, rc, "VCursorFlushPage: wait failed - exiting" );
-                KLockUnlock ( self -> flush_lock );
-                return rc;
-            }
-        }
-
-        /* what was the proper rc */
-        if ( self -> flush_state != vfReady )
-        {
-            if ( self -> flush_state != vfBgErr )
-                rc = RC ( rcVDB, rcCursor, rcFlushing, rcCursor, rcInconsistent );
-            else
-            {
-                rc_t rc2;
-                MTCURSOR_DBG (( "VCursorFlushPage: waiting on thread to exit\n" ));
-                rc = KThreadWait ( self -> flush_thread, & rc2 );
-                if ( rc == 0 )
-                {
-                    rc = rc2;
-                    MTCURSOR_DBG (( "VCursorFlushPage: releasing thread\n" ));
-                    KThreadRelease ( self -> flush_thread );
-                    self -> flush_thread = NULL;
-                }
-            }
-
-            PLOGERR ( klogInt, (klogInt, rc, "VCursorFlushPage: not in ready state[$(state)] - exiting",
-                                "state=%hu", self -> flush_state ));
-
-            KLockUnlock ( self -> flush_lock );
-            return rc;
-        }
-        KLockUnlock ( self -> flush_lock );
-#endif
-        assert ( self -> row_id == self -> start_id );
-        self -> end_id = self -> row_id;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VCursorCommit ( VCursor *self )
-{
-    rc_t rc = VCursorFlushPage ( self );
-    if ( rc == 0 )
-    {
-        VTable *tbl = self -> tbl;
-        if ( tbl -> read_col_cache_valid )
-        {
-            tbl -> read_col_cache_valid = false;
-            BSTreeWhack ( & tbl -> read_col_cache, VColumnRefWhack, NULL );
-        }
-        if ( tbl -> write_col_cache_valid )
-        {
-            tbl -> write_col_cache_valid = false;
-            BSTreeWhack ( & tbl -> write_col_cache, VColumnRefWhack, NULL );
-        }
-    }
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent table
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VCursorOpenParentUpdate ( VCursor *self, VTable **tbl )
-{
-    rc_t rc;
-
-    if ( tbl == NULL )
-        rc = RC ( rcVDB, rcCursor, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcSelf, rcNull );
-        else if ( self -> tbl -> read_only )
-            rc = RC ( rcVDB, rcCursor, rcAccessing, rcTable, rcReadonly );
-        else
-        {
-            rc = VTableAddRef ( self -> tbl );
-            if ( rc == 0 )
-            {
-                * tbl = self -> tbl;
-                return 0;
-            }
-        }
-
-        * tbl = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/wdatabase.c b/libs/vdb/wdatabase.c
deleted file mode 100644
index f2df4cb..0000000
--- a/libs/vdb/wdatabase.c
+++ /dev/null
@@ -1,661 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include "database-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "linker-priv.h"
-
-#include <kdb/kdb-priv.h>
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/meta.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VDatabase
- *  opaque connection to a database within file system
- */
-
-
-/* StoreSchema
- */
-rc_t VDatabaseStoreSchema ( VDatabase *self )
-{
-    /* open schema node */
-    KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeUpdate ( self -> meta, & node, "schema" );
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        char expr [ 256 ];
-        rc = VSchemaToText ( self -> schema, expr, sizeof expr - 1, & num_writ,
-            "%N%V", self -> sdb -> name, self -> sdb -> version );
-        if ( rc != 0 )
-            LOGERR ( klogInt, rc, "failed to determine database schema" );
-        else
-        {
-            expr [ num_writ ] = 0;
-            rc = KMDataNodeWriteAttr ( node, "name", expr );
-            if ( rc != 0 )
-                PLOGERR (klogInt, ( klogInt, rc, "failed to write database type '$(expr)'", "expr=%s", expr ));
-            else
-            {
-                /* truncate existing schema */
-                rc = KMDataNodeWrite ( node, "", 0 );
-                if ( rc == 0 )
-                {
-                    rc = VSchemaDump ( self -> schema, sdmCompact, expr,
-                        ( rc_t ( CC * ) ( void*, const void*, size_t ) ) KMDataNodeAppend, node );
-                }
-                if ( rc != 0 )
-                    PLOGERR (klogInt, ( klogInt, rc, "failed to write database schema '$(expr)'", "expr=%s", expr ));
-            }
-        }
-
-        KMDataNodeRelease ( node );
-    }
-    return rc;
-}
-
-
-/* OpenUpdate
- *  finish create operation
- */
-static
-rc_t VDatabaseOpenUpdate ( VDatabase *self, const char *decl )
-{
-    /* open metadata */
-    rc_t rc = KDatabaseOpenMetadataUpdate ( self -> kdb, & self -> meta );
-    if ( rc == 0 )
-    {
-        /* fetch stored schema */
-        rc = VDatabaseLoadSchema ( self );
-        if ( rc == 0 )
-        {
-            /* fetch requested schema */
-            const SDatabase *sdb = self -> sdb;
-            if ( decl != NULL && decl [ 0 ] != 0 )
-            {
-                uint32_t type;
-                const SNameOverload *name;
-                sdb = ( self -> dad != NULL ) ?
-                    SDatabaseFind ( self -> dad -> sdb, self -> schema,
-                        & name, & type, decl, "VDatabaseOpenUpdate" ):
-                    VSchemaFind ( self -> schema,
-                        & name, & type, decl, "VDatabaseOpenUpdate", true );
-                if ( sdb != NULL && type != eDatabase )
-                {
-                    PLOGMSG ( klogWarn, ( klogWarn, "expression '$(expr)' is not a database",
-                               "expr=%s", decl ));
-                    sdb = NULL;
-                }
-            }
-
-            /* error if the two definitions differ */
-            if ( sdb != NULL && self -> sdb != NULL && sdb != self -> sdb )
-                rc = RC ( rcVDB, rcDatabase, rcOpening, rcSchema, rcIncorrect );
-            else if ( sdb == NULL && self -> sdb == NULL )
-                rc = RC ( rcVDB, rcDatabase, rcOpening, rcSchema, rcNotFound );
-            else
-            {
-                if ( sdb != NULL )
-                    self -> sdb = sdb;
-
-                /* write schema to metadata */
-                rc = VDatabaseStoreSchema ( self );
-                if ( rc == 0 )
-                    return 0;
-            }
-        }
-    }
-
-    DBGMSG(DBG_VDB, DBG_FLAG(DBG_VDB_VDB), ("VDatabaseOpenUpdate = %d\n", rc));
-
-    return rc;
-}
-
-
-/* CreateDB
- * VCreateDB
- *  create a new or open an existing database
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "schema" [ IN ] - schema object containg database
- *  declaration to be used in creating db [ needed by manager ].
- *
- *  "decl" [ IN ] - type and optionally version of db schema
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-LIB_EXPORT rc_t CC VDBManagerVCreateDB ( VDBManager *self, VDatabase **dbp,
-    const VSchema *schema, const char *decl,
-    KCreateMode cmode, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcCreating, rcSelf, rcNull );
-        else if ( schema == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSchema, rcNull );
-        else if ( decl == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcNull );
-        else if ( decl [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcEmpty );
-        else
-        {
-            rc = VDatabaseMake ( dbp, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                VDatabase *db = * dbp;
-
-                rc = KDBManagerVCreateDB ( self -> kmgr, & db -> kdb, cmode, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenUpdate ( db, decl );
-                    if ( rc == 0 )
-                        return 0;
-
-                    rc = ResetRCContext ( rc, rcVDB, rcMgr, rcCreating );
-                }
-
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerCreateDB ( VDBManager *self, VDatabase **db,
-    const VSchema *schema, const char *decl,
-    KCreateMode cmode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVCreateDB ( self, db, schema, decl, cmode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVCreateDB ( VDatabase *self, VDatabase **dbp,
-    const char *decl, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcCreating, rcSelf, rcNull );
-        else if ( decl == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcNull );
-        else if ( decl [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcEmpty );
-        else if ( self -> read_only )
-            rc = RC ( rcVDB, rcDatabase, rcCreating, rcDatabase, rcReadonly );
-        else
-        {
-            rc = VDatabaseMake ( dbp, NULL, self, self -> schema );
-            if ( rc == 0 )
-            {
-                VDatabase *db = * dbp;
-
-                rc = KDatabaseVCreateDB ( self -> kdb, & db -> kdb, cmode, name, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenUpdate ( db, decl );
-                    if ( rc == 0 )
-                        return 0;
-
-                    rc = ResetRCContext ( rc, rcVDB, rcDatabase, rcCreating );
-                }
-
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseCreateDB ( VDatabase *self, VDatabase **db,
-    const char *decl, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VDatabaseVCreateDB ( self, db, decl, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVDropDB ( VDatabase *self,
-                                     const char *name, va_list args)
-{
-    return KDatabaseVDropDB(self->kdb, name, args);
-}
-
-LIB_EXPORT rc_t CC VDatabaseDropDB ( VDatabase *self,
-                                    const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-    
-    va_start ( args, name );
-    rc = VDatabaseVDropDB(self, name, args);
-    va_end ( args );
-    
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVDropTable ( VDatabase *self,
-                                    const char *name, va_list args)
-{
-    return KDatabaseVDropTable(self->kdb, name, args);
-}
-
-LIB_EXPORT rc_t CC VDatabaseDropTable ( VDatabase *self,
-                                      const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-    
-    va_start ( args, name );
-    rc = VDatabaseVDropTable(self, name, args);
-    va_end ( args );
-    
-    return rc;
-}
-
-
-/* OpenDBUpdate
- * VOpenDBUpdate
- *  open a database for read/write
- *
- *  "db" [ OUT ] - return parameter for newly opened database
- *
- *  "schema" [ IN, NULL OKAY ] - schema object containg database
- *  declaration to be used in creating db [ needed by manager ].
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to database
- */
-LIB_EXPORT rc_t CC VDBManagerVOpenDBUpdate ( VDBManager *self, VDatabase **dbp,
-    const VSchema *schema, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSelf, rcNull );
-        else
-        {
-            if ( schema == NULL )
-                schema = self -> schema;
-
-            rc = VDatabaseMake ( dbp, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                VDatabase *db = * dbp;
-
-                rc = KDBManagerVOpenDBUpdate ( self -> kmgr, & db -> kdb, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenUpdate ( db, NULL );
-                    if ( rc == 0 )
-                        return 0;
-                }
-                        
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerOpenDBUpdate ( VDBManager *self, VDatabase **db,
-    const VSchema *schema, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVOpenDBUpdate ( self, db, schema, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVOpenDBUpdate ( VDatabase *self, VDatabase **dbp,
-    const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( dbp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcDatabase, rcReadonly );
-        else
-        {
-            rc = VDatabaseMake ( dbp, NULL, self, self -> schema );
-            if ( rc == 0 )
-            {
-                VDatabase *db = * dbp;
-
-                rc = KDatabaseVOpenDBUpdate ( self -> kdb, & db -> kdb, name, args );
-                if ( rc == 0 )
-                {
-                    rc = VDatabaseOpenUpdate ( db, NULL );
-                    if ( rc == 0 )
-                        return 0;
-                }
-
-                VDatabaseWhack ( db );
-            }
-        }
-
-        * dbp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseOpenDBUpdate ( VDatabase *self, VDatabase **db, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VDatabaseVOpenDBUpdate ( self, db, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDatabaseVLock ( VDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcLocking, rcSelf, rcNull );
-    else
-        rc = KDatabaseVLock ( self -> kdb, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseLock ( VDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VDatabaseVLock ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptDatabase, kptTable and kptIndex
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDatabaseVUnlock ( VDatabase *self, uint32_t type, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcUnlocking, rcSelf, rcNull );
-    else
-        rc = KDatabaseVUnlock ( self -> kdb, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseUnlock ( VDatabase *self, uint32_t type, const char *name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VDatabaseVUnlock ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenMetadataUpdate
- *  opens metadata for update
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-LIB_EXPORT rc_t CC VDatabaseOpenMetadataUpdate ( VDatabase *self, KMetadata **meta )
-{
-    rc_t rc;
-    if ( meta == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        * meta = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            /* we operate under the notion of
-               single-threaded operation, so hand out
-               read or update capable object */
-            rc = KMetadataAddRef ( self -> meta );
-            if ( rc == 0 )
-                * meta = self -> meta;
-        }
-    }
-
-    return rc;
-}
-
-
-/* ColumnCreateParams
- *  sets the creation parameters for physical columns
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - the type of checksum information to
- *  apply when writing blobs
- *
- *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
- *  the default value is indicated by 0 ( zero ).
- *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
- */
-LIB_EXPORT rc_t CC VDatabaseColumnCreateParams ( VDatabase *self,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcTable, rcUpdating, rcSelf, rcNull );
-
-    self -> cmode = cmode;
-    self -> checksum = checksum;
-    self -> pgsize = pgsize;
-
-    return 0;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VDatabaseOpenManagerUpdate ( VDatabase *self, VDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VDatabaseOpenParentUpdate ( VDatabase *self, VDatabase **par )
-{
-    rc_t rc;
-
-    if ( par == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else if ( self -> dad != NULL && self -> dad -> read_only )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcDatabase, rcReadonly );
-        else
-        {
-            rc = VDatabaseAddRef ( self -> dad );
-            if ( rc == 0 )
-            {
-                * par = self -> dad;
-                return 0;
-            }
-        }
-
-        * par = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenKDatabase
- *  returns a new reference to underlying KDatabase
- */
-LIB_EXPORT rc_t CC VDatabaseOpenKDatabaseUpdate ( VDatabase *self, KDatabase **kdb )
-{
-    rc_t rc;
-
-    if ( kdb == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcSelf, rcNull );
-        else if ( self -> read_only )
-            rc = RC ( rcVDB, rcDatabase, rcAccessing, rcDatabase, rcReadonly );
-        else
-        {
-            rc = KDatabaseAddRef ( self -> kdb );
-            if ( rc == 0 )
-            {
-                * kdb = self -> kdb;
-                return 0;
-            }
-        }
-
-        * kdb = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/wdbmgr.c b/libs/vdb/wdbmgr.c
deleted file mode 100644
index f45a53f..0000000
--- a/libs/vdb/wdbmgr.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-/* should match dbmgr-cmn.c */
-
-#include "libwvdb.vers.h"
-
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <kfs/directory.h>
-#include <kproc/lock.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VDBManager
- *  opaque handle to library
- */
-
-
-/* MakeUpdate
- *  create library handle for specific use
- *  NB - only one of the functions will be implemented
- *
- */
-LIB_EXPORT rc_t CC VDBManagerMakeUpdate ( VDBManager **mgrp,  KDirectory *wd )
-{
-    rc_t rc;
-
-    if ( mgrp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        VDBManager *mgr = malloc ( sizeof * mgr );
-        if ( mgr == NULL )
-            rc = RC ( rcVDB, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            rc = KDBManagerMakeUpdate ( & mgr -> kmgr, wd );
-            if ( rc == 0 )
-            {
-                rc = VSchemaMakeIntrinsic ( & mgr -> schema );
-                if ( rc == 0 )
-                {
-                    rc = VLinkerMakeIntrinsic ( & mgr -> linker );
-                    if ( rc == 0 )
-                    {
-                        rc = VDBManagerConfigPaths ( mgr, true );
-                        if ( rc == 0 )
-                        {
-                            mgr -> user = NULL;
-                            mgr -> user_whack = NULL;
-                            KRefcountInit ( & mgr -> refcount, 1, "VDBManager", "make-update", "vmgr" );
-                            * mgrp = mgr;
-                            return 0;
-                        }
-
-                        VLinkerRelease ( mgr -> linker );
-                    }
-
-                    VSchemaRelease ( mgr -> schema );
-                }
-
-                KDBManagerRelease ( mgr -> kmgr );
-            }
-
-            free ( mgr );
-        }
-
-        * mgrp = NULL;
-    }
-    return rc;
-}
-
-
-/* Version
- *  returns the library version
- */
-LIB_EXPORT rc_t CC VDBManagerVersion ( const VDBManager *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    * version = LIBWVDB_VERS;
-    return 0;
-}
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDBManagerVLock ( VDBManager *self, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcLocking, rcSelf, rcNull );
-    return KDBManagerVLock ( self -> kmgr, path, args );
-}
-
-LIB_EXPORT rc_t CC VDBManagerLock ( VDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = VDBManagerVLock ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VDBManagerVUnlock ( VDBManager *self, const char *path, va_list args )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcUnlocking, rcSelf, rcNull );
-    return KDBManagerVUnlock ( self -> kmgr, path, args );
-}
-
-LIB_EXPORT rc_t CC VDBManagerUnlock ( VDBManager *self, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = VDBManagerVUnlock ( self, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Drop
- *  drop an object based on its path
- *
- *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to the vdb object
- */
-LIB_EXPORT rc_t CC VDBManagerVDrop ( VDBManager *self, uint32_t obj_type, const char *path, va_list args )
-{
-    if ( self != NULL )
-        return KDBManagerVDrop ( self -> kmgr, obj_type, path, args );
-
-    return RC ( rcVDB, rcMgr, rcRemoving, rcSelf, rcNull );
-}
-
-LIB_EXPORT rc_t CC VDBManagerDrop ( VDBManager *self, uint32_t obj_type, const char *path, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path );
-
-    rc = VDBManagerVDrop ( self, obj_type, path, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* VDBManagerRunPeriodicTasks
- *  executes periodic tasks, such as cache flushing
- */
-LIB_EXPORT rc_t CC VDBManagerRunPeriodicTasks ( const VDBManager *self )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcMgr, rcExecuting, rcSelf, rcNull );
-
-    return KDBManagerRunPeriodicTasks ( self -> kmgr );
-}
-
-/* OpenKDBManager
- *  returns a new reference to KDBManager used by VDBManager
- */
-LIB_EXPORT rc_t CC VDBManagerOpenKDBManagerUpdate ( VDBManager *self, KDBManager **kmgr )
-{
-    rc_t rc;
-
-    if ( kmgr == NULL )
-        rc = RC ( rcVDB, rcMgr, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = KDBManagerAddRef ( self -> kmgr );
-            if ( rc == 0 )
-            {
-                * kmgr = self -> kmgr;
-                return 0;
-            }
-        }
-
-        * kmgr = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vdb/wlinker.c b/libs/vdb/wlinker.c
deleted file mode 100644
index 3ce08c8..0000000
--- a/libs/vdb/wlinker.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#include "linker-priv.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-extern VTRANSFACT_DECL ( meta_write );
-extern VTRANSFACT_DECL ( meta_attr_write );
-
-/* newly imported things */
-extern VTRANSFACT_DECL ( NCBI_SRA_cmp_stats_trigger );
-extern VTRANSFACT_DECL ( NCBI_SRA_cmpf_stats_trigger );
-extern VTRANSFACT_DECL ( NCBI_SRA_extract_name_fmt );
-extern VTRANSFACT_DECL ( NCBI_SRA_extract_spot_name );
-extern VTRANSFACT_DECL ( NCBI_SRA_phred_stats_trigger );
-extern VTRANSFACT_DECL ( NCBI_SRA_qual4_encode );
-extern VTRANSFACT_DECL ( NCBI_SRA_stats_trigger );
-#if HAVE_ALIGN_STATS_TRIGGER
-extern VTRANSFACT_DECL ( NCBI_align_stats_trigger );
-extern VTRANSFACT_DECL ( NCBI_seq_stats_trigger );
-#endif
-extern VTRANSFACT_DECL ( NCBI_refSeq_stats );
-extern VTRANSFACT_DECL ( idx_text_insert );
-extern VTRANSFACT_DECL ( vdb_bzip );
-extern VTRANSFACT_DECL ( vdb_checksum );
-extern VTRANSFACT_DECL ( vdb_fzip );
-extern VTRANSFACT_DECL ( vdb_rlencode );
-extern VTRANSFACT_DECL ( vdb_zip );
-
-/* InitFactories
- */
-rc_t VLinkerInitFactories ( VLinker *self, struct KSymTable *tbl, struct SchemaEnv const *env )
-{
-    static VLinkerIntFactory fact [] =
-    {
-        { meta_write, "meta:write" },
-        { meta_attr_write, "meta:attr:write" },
-
-        { NCBI_SRA_cmp_stats_trigger, "NCBI:SRA:cmp_stats_trigger" },
-        { NCBI_SRA_cmpf_stats_trigger, "NCBI:SRA:cmpf_stats_trigger" },
-        { NCBI_SRA_extract_name_fmt, "NCBI:SRA:extract_name_fmt" },
-        { NCBI_SRA_extract_spot_name, "NCBI:SRA:extract_spot_name" },
-        { NCBI_SRA_phred_stats_trigger, "NCBI:SRA:phred_stats_trigger" },
-        { NCBI_SRA_qual4_encode, "NCBI:SRA:qual4_encode" },
-        { NCBI_SRA_stats_trigger, "NCBI:SRA:stats_trigger" },
-#if HAVE_ALIGN_STATS_TRIGGER
-        { NCBI_align_stats_trigger, "NCBI:align:stats_trigger" },
-        { NCBI_seq_stats_trigger, "NCBI:seq:stats_trigger" },
-#endif
-        { NCBI_refSeq_stats, "NCBI:refSeq:stats" },
-        { idx_text_insert, "idx:text:insert" },
-        { vdb_bzip, "vdb:bzip" },
-        { vdb_checksum, "vdb:checksum" },
-        { vdb_fzip, "vdb:fzip" },
-        { vdb_rlencode, "vdb:rlencode" },
-        { vdb_zip, "vdb:zip" }
-    };
-
-    rc_t rc = VLinkerInitFactoriesRead ( self, tbl, env );
-    if ( rc == 0 )
-        rc = VLinkerAddFactories ( self, fact, sizeof fact / sizeof fact [ 0 ], tbl, env );
-    return rc;
-}
diff --git a/libs/vdb/wphys.c b/libs/vdb/wphys.c
deleted file mode 100644
index e1f2d27..0000000
--- a/libs/vdb/wphys.c
+++ /dev/null
@@ -1,909 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <os-native.h>
-
-#define KONST
-#define SKONST
-#include "phys-priv.h"
-#include "schema-parse.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "blob-priv.h"
-#include "page-map.h"
-#undef KONST
-#undef SKONST
-
-#include <vdb/vdb-priv.h>
-#include <vdb/cursor.h>
-#include <kdb/manager.h>
-#include <kdb/table.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-#if VCURSOR_WRITE_MODES_SUPPORTED
-#error "only kcmInsert and kcmReplace modes supported"
-#else
-#define WHOLE_REPLACE_UPDATE 1
-#endif
-
-/*--------------------------------------------------------------------------
- * VPhysical
- */
-
-static
-rc_t VPhysicalConvertStatic ( VPhysical *self );
-
-
-/* Whack
- */
-void CC VPhysicalWhack ( void *item, void *ignore )
-{
-    VPhysical *self = item;
-    if ( self > FAILED_PHYSICAL )
-    {
-#if PROD_CACHE
-        /* detect close of static column */
-        if ( ! self -> read_only && self -> knode != NULL )
-        {
-            /* if the column is fairly large for metadata */
-            if ( KDataBufferBytes ( & self -> srow ) > 64 * 1024 )
-                /* convert it to a single blob */
-                VPhysicalConvertStatic ( self );
-        }
-#endif
-        if ( ! self -> read_only )
-        {
-            rc_t rc;
-            VCursor *curs = self -> curs;
-            VTable *tbl = curs -> tbl;
-
-            const String *name = & self -> smbr -> name -> name;
-
-            KMDataNode *col_node = tbl -> col_node;
-
-            /* create rename strings */
-            char buff [ 300 ];
-            char *oldname, *colname, *tmpname = buff;
-            int sz = snprintf ( buff, sizeof buff / 3, "%.*s.tmp",
-                ( int ) name -> size - 1, name -> addr + 1 );
-            if ( sz < 0 || sz > sizeof buff / 3 )
-            {
-                tmpname = malloc ( 3 * 4 * 1024 );
-                if ( tmpname == NULL )
-                {
-                    rc = RC ( rcVDB, rcColumn, rcClosing, rcMemory, rcInsufficient );
-                    PLOGERR ( klogSys, ( klogInt, rc, "failed to close column '$(colname)'",
-                        "colname=%.*s", ( int ) name -> size - 1, name -> addr + 1 ));
-                    return;
-                }
-
-                sz = snprintf ( tmpname, 4 * 1024, "%.*s.tmp",
-                    ( int ) name -> size - 1, name -> addr + 1 );
-                assert ( sz > 0 && sz < 4 * 1024 );
-            }
-            oldname = & tmpname [ ++ sz ];
-            colname = & oldname [ sz ];
-            sprintf ( oldname, "%.*s.old", ( int ) name -> size - 1, name -> addr + 1 );
-            sprintf ( colname, "%.*s", ( int ) name -> size - 1, name -> addr + 1 );
-
-            /* close and rename static column */
-            if ( self -> knode != NULL )
-            {
-                rc = KMDataNodeRelease ( self -> knode );
-                if ( rc != 0 )
-                {
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to release static node when closing column '$(colname)'",
-                                         "colname=%s", colname ));
-                }
-                else
-                {
-                    self -> knode = NULL;
-
-                    assert ( col_node != NULL );
-                    rc = KMDataNodeDropChild ( col_node, colname );
-                    if ( rc != 0 && GetRCState ( rc ) != rcNotFound )
-                    {
-                        PLOGERR ( klogInt, ( klogInt, rc, "failed to drop previous static node when closing column '$(colname)'",
-                                             "colname=%s", colname ));
-                    }
-                    else
-                    {
-                        rc = KMDataNodeRenameChild ( col_node, tmpname, colname );
-                        if ( rc != 0 )
-                        {
-                            PLOGERR ( klogInt, ( klogInt, rc, "failed to rename static node when closing column '$(colname)'",
-                                                 "colname=%s", colname ));
-                        }
-                        else
-                        {
-                            KTable *ktbl;
-                            rc = VTableOpenKTableUpdate ( tbl, & ktbl );
-                            if ( rc == 0 )
-                            {
-                                rc = KTableUnlock ( ktbl, kptColumn, colname );
-                                if ( rc == 0 || GetRCState ( rc ) == rcUnlocked )
-                                    rc = KTableDropColumn ( ktbl, colname );
-                                KTableRelease ( ktbl );
-                                rc = 0;
-                            }
-                        }
-                    }
-                }
-            }
-            else if ( self -> kcol != NULL )
-            {
-                KMDataNode *node;
-
-                /* write fixed length to column metadata */
-                if ( self -> fixed_len != 0 )
-                {
-                    rc = KMetadataOpenNodeUpdate ( self -> meta, & node, "row-len" );
-                    if ( rc != 0 )
-                    {
-                        PLOGERR ( klogInt, ( klogInt, rc, "failed to open '$(node)' node when closing column '$(colname)'",
-                            "node=row-len,colname=%s", colname ));
-                    }
-                    else
-                    {
-                        if ( self -> fixed_len < 0x100 )
-                        {
-                            uint8_t u8 = ( uint8_t ) self -> fixed_len;
-                            rc = KMDataNodeWriteB8 ( node, & u8 );
-                        }
-                        else if ( self -> fixed_len < 0x10000 )
-                        {
-                            uint16_t u16 = ( uint16_t ) self -> fixed_len;
-                            rc = KMDataNodeWriteB16 ( node, & u16 );
-                        }
-                        else
-                        {
-                            rc = KMDataNodeWriteB32 ( node, & self -> fixed_len );
-                        }
-                        if ( rc != 0 )
-                        {
-                            PLOGERR ( klogInt, ( klogInt, rc, "failed to update '$(node)' node when closing column '$(colname)'",
-                                "node=row-len,colname=%s", colname ));
-                        }
-
-                        KMDataNodeRelease ( node );
-                    }
-                }
-                else
-                {
-                    rc = KMetadataOpenNodeUpdate ( self -> meta, & node, NULL );
-                    if ( rc != 0 )
-                    {
-                        PLOGERR ( klogInt, ( klogInt, rc, "failed to open '$(node)' node when closing column '$(colname)'",
-                            "node=/,colname=%s", colname ));
-                    }
-                    else
-                    {
-                        rc = KMDataNodeDropChild ( node, "row-len" );
-                        if ( rc == 0 && GetRCState ( rc ) != rcNotFound )
-                        {
-                            PLOGERR ( klogInt, ( klogInt, rc, "failed to update '$(node)' node when closing column '$(colname)'",
-                                "node=row-len,colname=%s", colname ));
-                        }
-
-                        KMDataNodeRelease ( node );
-                    }
-                }
-
-                /* close column */
-                rc = KMetadataRelease ( self -> meta );
-                if ( rc != 0 )
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to release column '$(colname)'", "colname=%s", colname ));
-                else
-                {
-                    self -> meta = NULL;
-                    rc = KColumnRelease ( self -> kcol );
-                    if ( rc != 0 )
-                        PLOGERR ( klogInt, ( klogInt, rc, "failed to release column '$(colname)'", "colname=%s", colname ));
-                    else
-                    {
-                        KTable *ktbl;
-
-                        self -> kcol = NULL;
-
-                        /* access KTable */
-                        rc = VTableOpenKTableUpdate ( tbl, & ktbl );
-                        if ( rc != 0 )
-                        {
-                            PLOGERR ( klogInt, ( klogInt, rc, "failed to access physical table when closing column '$(colname)'",
-                                                 "colname=%s", colname ));
-                        }
-                        else
-                        {
-                            bool has_old;
-
-                            /* unlock existing */
-                            rc = KTableUnlock ( ktbl, kptColumn, colname );
-                            if ( rc == 0 || GetRCState ( rc ) == rcUnlocked )
-                            {
-                                has_old = true;
-
-                                /* rename existing */
-                                rc = KTableRenameColumn ( ktbl, true, colname, oldname );
-                                if ( rc != 0 )
-                                {
-                                    PLOGERR ( klogSys, ( klogInt, rc, "failed to rename previous column when closing '$(colname)'",
-                                                         "colname=%s", colname ));
-                                }
-                            }
-                            else if ( GetRCState ( rc ) == rcNotFound )
-                            {
-                                has_old = false;
-                                rc = 0;
-                            }
-                            if ( rc == 0 )
-                            {
-                                /* rename new column */
-                                rc = KTableRenameColumn ( ktbl, true, tmpname, colname );
-                                if ( rc != 0 )
-                                {
-                                    PLOGERR ( klogSys, ( klogInt, rc, "failed to rename previous column when closing '$(colname)'",
-                                                         "colname=%s", colname ));
-                                    if ( has_old )
-                                    {
-                                        rc = KTableRenameColumn ( ktbl, true, oldname, colname );
-                                        if ( rc != 0 )
-                                        {
-                                            PLOGERR ( klogSys, ( klogInt, rc, "failed to restore previous column when closing '$(colname)'",
-                                                                 "colname=%s", colname ));
-                                        }
-                                    }
-                                }
-                                else
-                                {
-                                    if ( has_old )
-                                    {
-                                        /* drop old column */
-                                        rc = KTableDropColumn ( ktbl, oldname );
-                                        if ( rc != 0 )
-                                        {
-                                            PLOGERR ( klogWarn, ( klogInt, rc, "preexisting column was not dropped when closing '$(colname)'",
-                                                                  "colname=%s", colname ));
-                                        }
-                                    }
-
-                                    KMDataNodeDropChild ( col_node, colname );
-                                }
-                            }
-
-                            KTableRelease ( ktbl );
-                        }
-                    }
-                }
-            }
-
-            if ( tmpname != buff )
-                free ( tmpname );
-        }
-
-        VPhysicalDestroy ( self );
-    }
-}
-
-/* Open
- *  open existing columns
- *  load schema definitions
- */
-rc_t VPhysicalOpenWrite ( VPhysical *self, VSchema *schema, const VTable *tbl )
-{
-#if WHOLE_REPLACE_UPDATE
-    return 0;
-#else
-    /* physical member name from schema */
-    const SPhysMember *smbr = self -> smbr;
-    const KSymbol *name = smbr -> name;
-
-    /* open column for update */
-    rc_t rc = KTableOpenColumnUpdate ( tbl -> ktbl, & self -> kcol,
-        "%.*s", ( int ) name -> name . size - 1, name -> name . addr + 1 );
-    if ( rc == 0 )
-    { 
-        /* open its metadata */
-        rc = KColumnOpenMetadataUpdate ( self -> kcol, & self -> meta );
-        if ( rc == 0 )
-        {
-            /* finish off common initialization */
-            rc = VPhysicalFinishKColumn ( self, schema, smbr );
-        }
-    }
-
-    /* it's okay if a column doesn't exist -
-       it'll either be created or will exist as a static */
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = 0;
-    }
-
-    if ( rc == 0 && self -> kcol == NULL )
-    {
-        /* look for static */
-        const KMDataNode *node;
-        assert ( tbl -> col_node != NULL );
-        rc = KMDataNodeOpenNodeRead ( tbl -> col_node, & node,
-            "%.*s", ( int ) name -> name . size - 1, name -> name . addr + 1 );
-        if ( rc == 0 )
-        {
-            /* reopen for update */
-            KMDataNodeRelease ( node );
-            rc = KMDataNodeOpenNodeUpdate ( tbl -> col_node, & self -> knode,
-                "%.*s", ( int ) name -> name . size - 1, name -> name . addr + 1 );
-            if ( rc == 0 )
-            {
-                /* finish off common initialization */
-                rc = VPhysicalFinishStatic ( self, schema, smbr );
-            }
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-        {
-            rc = 0;
-        }
-    }
-
-    return rc;
-#endif
-}
-
-static
-rc_t VPhysicalCreateStatic ( VPhysical *self, const VBlob *vblob )
-{
-    rc_t rc;
-    const String *name;
-
-    VCursor *curs = self -> curs;
-    VTable *tbl = curs -> tbl;
-
-    KMDataNode *col_node = tbl -> col_node;
-    assert ( col_node != NULL );
-
-    /* create node */
-    name = & self -> smbr -> name -> name;
-    rc = KMDataNodeOpenNodeUpdate ( col_node, & self -> knode,
-        "%.*s.tmp", ( int ) name -> size - 1, name -> addr + 1 );
-    if ( rc == 0 )
-    {
-        /* type */
-        char typedecl [ 256 ];
-        rc = VTypedeclToText ( & self -> smbr -> td,
-            curs -> schema, typedecl, sizeof typedecl );
-        if ( rc == 0 )
-            rc = KMDataNodeWriteAttr ( self -> knode, "type", typedecl );
-        if ( rc == 0 )
-        {
-            /* open row */
-            KMDataNode *row;
-            rc = KMDataNodeOpenNodeUpdate ( self -> knode, & row, "row" );
-            if ( rc == 0 )
-            {
-                /* keep a copy of the original */
-                rc = KDataBufferSub ( & vblob -> data, & self -> srow, 0, UINT64_MAX );
-                if ( rc == 0 )
-                {
-                    /* total bits in static row */
-                    uint64_t row_bits = KDataBufferBits ( & vblob -> data );
-
-                    /* check for need to reverse byte order */
-                    bool reverse;
-                    rc = KMDataNodeByteOrder ( row, & reverse );
-                    if ( rc == 0 )
-                    {
-                        KDataBuffer data;
-
-                        /* if the output metadata file is in native byte order */
-                        if ( ! reverse )
-                            rc = KDataBufferSub ( & vblob -> data, & data, 0, UINT64_MAX );
-                        else
-                        {
-                            /* find the datatype for static column */
-                            const SDatatype *dt = VSchemaFindTypeid ( curs -> schema,
-                                self -> smbr -> td . type_id );
-                            assert ( dt != NULL );
-
-                            /* if the type does not need swapping */
-                            if ( dt -> byte_swap == NULL )
-                                rc = KDataBufferSub ( & vblob -> data, & data, 0, UINT64_MAX );
-                            else
-                            {
-                                /* swap into a writable buffer */
-                                rc = KDataBufferMake ( & data, vblob -> data . elem_bits, vblob -> data . elem_count );
-                                if ( rc == 0 )
-                                {
-                                    ( * dt -> byte_swap ) ( data . base,
-                                        vblob -> data . base, ( uint32_t ) ( row_bits / dt -> size ) );
-                                }
-                            }
-                        }
-                        if ( rc == 0 )
-                        {
-                            /* write row */
-                            rc = KMDataNodeWrite ( row, data . base, ( size_t ) ( ( row_bits + 7 ) >> 3 ) );
-                            if ( rc == 0 )
-                            {
-                                /* if row-bits are not integral bytes */
-                                if ( ( row_bits & 7 ) != 0 )
-                                {
-                                    /* record them in a size node */
-                                    KMDataNode *size;
-                                    rc = KMDataNodeOpenNodeUpdate ( self -> knode, & size, "size" );
-                                    if ( rc == 0 )
-                                    {
-                                        rc = KMDataNodeWriteB64 ( size, & row_bits );
-                                        KMDataNodeRelease ( size );
-                                    }
-                                }
-                            }
-
-                            KDataBufferWhack ( & data );
-                        }
-                    }
-                }
-
-                KMDataNodeRelease ( row );
-            }
-        }
-
-        if ( rc != 0 )
-        {
-            KMDataNodeRelease ( self -> knode ), self -> knode = NULL;
-            KMDataNodeDropChild ( col_node, "%.*s", ( int ) name -> size - 1, name -> addr + 1 );
-            KDataBufferWhack ( & self -> srow );
-        }
-        else
-        {
-            self -> sstart_id = vblob -> start_id;
-            self -> sstop_id = vblob -> stop_id;
-            self -> fixed_len = PageMapGetIdxRowInfo ( vblob -> pm, 0, NULL );
-        }
-    }
-    
-    return rc;
-}
-
-static
-rc_t VPhysicalCreateKColumn ( VPhysical *self )
-{
-    rc_t rc;
-    VCursor *curs = self -> curs;
-    const SPhysMember *smbr = self -> smbr;
-    VTable *tbl = curs -> tbl;
-    const String *name = & smbr -> name -> name;
-
-    /* check for static designation */
-    if ( smbr -> stat )
-    {
-        rc = RC ( rcVDB, rcColumn, rcCreating, rcConstraint, rcViolated );
-        return rc;
-    }
-
-    /* create physical column */
-    rc = KTableCreateColumn ( tbl -> ktbl, & self -> kcol,
-        ( KCreateMode ) tbl -> cmode, ( KChecksum ) tbl -> checksum, tbl -> pgsize, 
-        "%.*s.tmp", ( int ) name -> size - 1, name -> addr + 1 );
-    if ( rc == 0 )
-    {
-        /* create its metadata */
-        rc = KColumnOpenMetadataUpdate ( self -> kcol, & self -> meta );
-        if ( rc == 0 )
-        {
-            /* print typedecl */
-            char buffer [ 256 ];
-            rc = VTypedeclToText ( & smbr -> td,
-                curs -> schema, buffer, sizeof buffer );
-            if ( rc == 0 )
-            {
-                /* create schema node */
-                KMDataNode *schema_node;
-                rc = KMetadataOpenNodeUpdate ( self -> meta, & schema_node, "schema" );
-                if ( rc == 0 )
-                {
-                    /* write column type */
-                    rc = KMDataNodeWriteAttr ( schema_node, "type", buffer );
-                    if ( rc == 0 )
-                    {
-                        /* going to write some schema */
-                        if ( smbr -> type == NULL )
-                        {
-                            /* buffer already contains datatype */
-                            if ( smbr -> td . dim != 1 )
-                            {
-                                /* get just the typename */
-                                VTypedecl td = smbr -> td;
-                                td . dim = 1;
-                                rc = VTypedeclToText ( & smbr -> td,
-                                    curs -> schema, buffer, sizeof buffer );
-                            }
-                        }
-                        else
-                        {
-                            size_t num_writ;
-
-                            /* get physical type expression */
-                            rc = VSchemaToText ( curs -> schema,
-                                buffer, sizeof buffer, & num_writ, "%E", smbr -> type );
-                            if ( rc == 0 )
-                            {
-                                buffer [ num_writ ] = 0;
-                                rc = KMDataNodeWriteAttr ( schema_node, "expr", buffer );
-                                if ( rc == 0 )
-                                {
-                                    const SPhysical *sphys = ( ( const SPhysEncExpr* ) smbr -> type ) -> phys;
-                                    rc = VSchemaToText ( curs -> schema,
-                                        buffer, sizeof buffer, & num_writ, "%N%V",
-                                        sphys -> name, sphys -> version );
-                                    if ( rc == 0 )
-                                        buffer [ num_writ ] = 0;
-                                }
-                            }
-                        }
-                    }
-                    if ( rc == 0 )
-                    {
-                        rc = VSchemaDump ( curs -> schema, sdmCompact, buffer,
-                           ( rc_t ( CC * ) ( void*, const void*, size_t ) ) KMDataNodeAppend, schema_node );
-                        if ( rc == 0 )
-                        {
-                            /* mark it empty */
-                            self -> kstart_id = 1;
-                            self -> kstop_id = 0;
-                        }
-                    }
-                }
-
-                KMDataNodeRelease ( schema_node );
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t VPhysicalWriteKColumn ( VPhysical *self, const VBlob *vblob )
-{
-    KColumnBlob *kblob;
-    rc_t rc = KColumnCreateBlob ( self -> kcol, & kblob );
-    if ( rc == 0 )
-    {
-        /* for now, row counts are 32-bit */
-        uint32_t count = (uint32_t)(vblob -> stop_id - vblob -> start_id + 1);
-        rc = KColumnBlobAssignRange ( kblob, vblob -> start_id, count );
-        if ( rc == 0 )
-        {
-            rc = KColumnBlobAppend ( kblob, vblob -> data . base, KDataBufferBytes ( & vblob -> data ) );
-            if ( rc == 0 )
-            {
-                rc = KColumnBlobCommit ( kblob );
-                if ( rc == 0 )
-                {
-                    /* get the fixed row-length of this blob */
-                    uint32_t blob_fixed = VBlobFixedRowLength ( vblob );
-
-                    /* detect if the column is truly fixed row length */
-                    if ( self -> kstart_id > self -> kstop_id )
-                        self -> fixed_len = blob_fixed;
-                    else if ( blob_fixed != self -> fixed_len )
-                        self -> fixed_len = 0;
-
-                    /* incorporate id range into our view of the world */
-                    if ( vblob -> start_id < self -> kstart_id )
-                        self -> kstart_id = vblob -> start_id;
-                    if ( vblob -> stop_id > self -> kstop_id )
-                        self -> kstop_id = vblob -> stop_id;
-                }
-            }
-        }
-
-        KColumnBlobRelease ( kblob );
-    }
-    return rc;
-}
-
-static
-rc_t VPhysicalConvertStatic ( VPhysical *self )
-{
-#if ! PROD_CACHE
-    return RC ( rcVDB, rcColumn, rcConverting, rcFunction, rcUnsupported );
-#else
-    rc_t rc = VPhysicalCreateKColumn ( self );
-    if ( rc == 0 )
-    {
-        int64_t sstart_id, sstop_id;
-
-        /* save incoming blob cache on stack */
-        VBlob *cache [ PROD_CACHE * PROD_CACHE_MAX_EXTENTS ];
-        assert ( sizeof cache == sizeof self -> in -> cache );
-        memcpy ( cache, self -> in -> cache, sizeof cache );
-
-        /* set incoming blob cache to empty */
-        memset ( self -> in -> cache, 0, sizeof self -> in -> cache );
-
-        for ( sstart_id = self -> sstart_id;
-              rc == 0 && sstart_id <= self -> sstop_id;
-              sstart_id = sstop_id + 1 )
-        {
-            /* 3G rows */
-            sstop_id = sstart_id + 0xC0000000;
-            assert ( sstop_id > sstart_id );
-
-            /* limit to actual end */
-            if ( sstop_id > self -> sstop_id )
-                sstop_id = self -> sstop_id;
-
-            /* don't create tiny additional blobs */
-            else if ( ( self -> sstop_id - sstop_id ) < 1000 )
-                sstop_id = self -> sstop_id;
-
-            /* recreate a VBlob from static that can be sent through encoding */
-            rc = VBlobCreateFromSingleRow ( & self -> in -> cache [ 0 ],
-                sstart_id, sstop_id, & self -> srow, vboNative );
-            if ( rc == 0 )
-            {
-                /* get an encoded version of static blob */
-                VBlob *vblob;
-                rc = VProductionReadBlob ( self -> b2s, & vblob, sstart_id, 1,NULL );
-                if ( rc == 0 )
-                {
-                    /* write encoded blob to physical */
-                    rc = VPhysicalWriteKColumn ( self, vblob );
-
-                    /* in all events, release blob */
-                    TRACK_BLOB ( VBlobRelease, vblob );
-                    ( void ) VBlobRelease ( vblob );
-                }
-            
-                /* release the blob from static */
-                TRACK_BLOB ( VBlobRelease, self -> in -> cache [ 0 ] );
-                ( void ) VBlobRelease ( self -> in -> cache [ 0 ] );
-            }
-        }
-
-        /* restore cache from stack */
-        memcpy ( self -> in -> cache, cache, sizeof self -> in -> cache );
-
-        if ( rc == 0 )
-        {
-            const String *name;
-            VCursor *curs = self -> curs;
-            VTable *tbl = curs -> tbl;
-
-            /* tear down static */
-            KMDataNodeRelease ( self -> knode );
-            self -> knode = NULL;
-
-            /* delete column from table */
-            name = & self -> smbr -> name -> name;
-            assert ( tbl -> col_node != NULL );
-            rc = KMDataNodeDropChild ( tbl -> col_node,
-                "%.*s.tmp", ( int ) name -> size - 1, name -> addr + 1 );
-        }
-    }
-
-    return rc;
-#endif
-}
-
-static
-rc_t KMDataNodeWriteId ( KMDataNode *self, int64_t id )
-{
-    int32_t i32;
-    
-    if ( id >= -128 && id < 128 )
-    {
-        int8_t i8 = ( int8_t ) id;
-        return KMDataNodeWriteB8 ( self, & i8 );
-    }
-    if ( id >= -32768 && id < 32768 )
-    {
-        int16_t i16 = ( int16_t ) id;
-        return KMDataNodeWriteB16 ( self, & i16 );
-    }
-    
-    i32 = ( int32_t ) id;
-    if ( ( int64_t ) i32 == id )
-        return KMDataNodeWriteB32 ( self, & i32 );
-    
-    return KMDataNodeWriteB64 ( self, & id );
-}
-
-static
-rc_t KMDataNodeWriteCount ( KMDataNode *self, uint64_t count )
-{
-    if ( count < 0x100 )
-    {
-        uint8_t i8 = ( uint8_t ) count;
-        return KMDataNodeWriteB8 ( self, & i8 );
-    }
-    if ( count < 0x10000 )
-    {
-        uint16_t i16 = ( uint16_t ) count;
-        return KMDataNodeWriteB16 ( self, & i16 );
-    }
-    if ( ( count >> 32 ) == 0 )
-    {
-        uint32_t i32 = ( uint32_t ) count;
-        return KMDataNodeWriteB32 ( self, & i32 );
-    }
-    return KMDataNodeWriteB64 ( self, & count );
-}
-
-static
-rc_t VPhysicalSetStaticId ( VPhysical *self )
-{
-    KMDataNode *node;
-    rc_t rc = KMDataNodeOpenNodeUpdate ( self -> knode, & node, "start_id" );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeWriteId ( node, self -> sstart_id );
-        KMDataNodeRelease ( node );
-
-        if ( rc == 0 )
-        {
-            rc = KMDataNodeOpenNodeUpdate ( self -> knode, & node, "row_count" );
-            if ( rc == 0 )
-            {
-                rc = KMDataNodeWriteCount ( node, self -> sstop_id - self -> sstart_id + 1 );
-                KMDataNodeRelease ( node );
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t VPhysicalWrite ( VPhysical *self, int64_t id, uint32_t cnt )
-{
-    /* read from page space */
-    VBlob *vblob;
-    rc_t rc = VProductionReadBlob ( self -> in, & vblob, id , cnt,NULL);
-    if ( rc == 0 )
-    {
-        /* test for single row in blob */
-        assert ( vblob != NULL );
-        if ( VBlobIsSingleRow ( vblob ) )
-        {
-            /* new column */
-            if ( self -> knode == NULL && self -> kcol == NULL )
-            {
-                rc = VPhysicalCreateStatic ( self, vblob );
-                TRACK_BLOB ( VBlobRelease, vblob );
-                ( void ) VBlobRelease ( vblob );
-                if ( rc == 0 )
-                    rc = VPhysicalSetStaticId ( self );
-                return rc;
-            }
-
-            /* existing static column */
-            if ( self -> knode != NULL )
-            {
-                /* not allowing both to be active at the same time */
-                assert ( self -> kcol == NULL );
-
-                /* overlapping or adjacent id ranges */
-                assert ( vblob -> start_id <= vblob -> stop_id );
-                if ( vblob -> stop_id + 1 >= self -> sstart_id &&
-                     vblob -> start_id <= self -> sstop_id + 1 )
-                {
-                    /* compare lengths */
-                    if ( self -> fixed_len == PageMapGetIdxRowInfo ( vblob -> pm, 0, NULL ) )
-                    {
-                        /* compare bits */
-                        assert ( KDataBufferBits ( & self -> srow ) == KDataBufferBits ( & vblob -> data ) );
-                        if ( bitcmp ( self -> srow . base, self -> srow . bit_offset,
-                                      vblob -> data . base, vblob -> data . bit_offset,
-                                      KDataBufferBits ( & self -> srow ) ) == 0 )
-                        {
-                            /* it's fine */
-                            if ( vblob -> start_id < self -> sstart_id )
-                                self -> sstart_id = vblob -> start_id;
-                            if ( vblob -> stop_id > self -> sstop_id )
-                                self -> sstop_id = vblob -> stop_id;
-
-                            TRACK_BLOB ( VBlobRelease, vblob );
-                            ( void ) VBlobRelease ( vblob );
-
-                            return VPhysicalSetStaticId ( self );
-                        }
-                    }
-                }
-            }
-        }
-
-        /* At this point we can no longer be a static row:
-         * the current blob might have been more than a single row, or
-         * it might have been unable to extend range of static as a single row */
-        if ( self -> knode != NULL )
-            rc = VPhysicalConvertStatic ( self );
-
-        /* need to write to KColumn */
-        if ( rc == 0 )
-        {
-            /* not allowing both knode and kcol to be active at the same time */
-            assert ( self -> knode == NULL );
-
-            /* create KColumn if necessary */
-            if ( self -> kcol == NULL )
-                rc = VPhysicalCreateKColumn ( self );
-
-            /* pull through encoding */
-            if ( rc == 0 )
-            {
-                TRACK_BLOB ( VBlobRelease, vblob );
-                ( void ) VBlobRelease ( vblob );
-                rc = VProductionReadBlob ( self -> b2s, & vblob, id, cnt,NULL );
-                if ( rc == 0 )
-                {
-                    /* write encoded blob to physical */
-                    rc = VPhysicalWriteKColumn ( self, vblob );
-                }
-            }
-        }
-
-        TRACK_BLOB ( VBlobRelease, vblob );
-        ( void ) VBlobRelease ( vblob );
-    }
-
-    return rc;
-}
-
-/* Read
- *  get the blob
- */
-rc_t VPhysicalRead ( VPhysical *self, VBlob **vblob, int64_t id, uint32_t cnt, uint32_t elem_bits )
-{
-    /* use this as the chance to read from input */
-    if ( self -> in != NULL )
-    {
-        rc_t rc = VPhysicalWrite ( self, id, cnt );
-        if ( rc != 0 )
-        {
-            * vblob = NULL;
-            return rc;
-        }
-    }
-
-    /* now let read-side do its work */
-    return VPhysicalReadBlob ( self, vblob, id, elem_bits );
-}
diff --git a/libs/vdb/wprod.c b/libs/vdb/wprod.c
deleted file mode 100644
index 41db5e9..0000000
--- a/libs/vdb/wprod.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#define TRACK_REFERENCES 0
-
-#define KONST const
-#include "prod-priv.h"
-#include "prod-expr.h"
-#include "schema-priv.h"
-#include "schema-expr.h"
-#include "cursor-priv.h"
-#include "column-priv.h"
-#include "phys-priv.h"
-#undef KONST
-
-#include <vdb/cursor.h>
-#include <klib/symbol.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * VProdResolve
- */
-
-/* ResolveColumn
- *  resolves a column using read/write expression
- */
-rc_t VProdResolveColumnRoot ( const VProdResolve *self,
-    VProduction **out, const SColumn *scol )
-{
-    rc_t rc;
-    WColumn *wcol;
-    VTypedesc desc;
-    const char *name;
-    VCursor *curs = self -> curs;
-    VProduction * in;
-
-    * out = NULL;
-
-    /* decide upon behavior */
-    if ( curs -> read_only )
-    {
-        rc = VProdResolveColumnRead ( self, out, scol );
-        if ( rc == 0 && * out <= FAILED_PRODUCTION )
-            return RC ( rcVDB, rcCursor, rcOpening, rcColumn, rcUndefined );
-        return rc;
-    }
-
-    /* write-only cursor must have existing column */
-    wcol = VCursorCacheGet ( & curs -> col, & scol -> cid );
-    if ( wcol == NULL )
-        return 0;
-
-    /* not intended to be reentrant */
-    assert ( wcol -> val == NULL );
-
-    /* evaluate input expression */
-    if ( scol -> validate == NULL )
-    {
-        /* use normal read expression */
-        rc = VProdResolveColumnRead ( self, &in, scol );
-    }
-    else
-    {
-        VFormatdecl fd;
-        
-        /* create fmtdecl from typedecl */
-        memset ( & fd, 0, sizeof fd );
-
-        VDB_DEBUG ( ( "resolving column '%N' validate expression.\n", scol -> name ) );
-
-        /* use validation expression */
-        rc = VProdResolveExpr ( self, &in, & desc, & fd, scol -> validate, false );
-    }
-
-    /* check failures */
-    if ( rc != 0 )
-    {
-        VDB_DEBUG ( ( "failed to resolve column '%N' - %R.\n", scol -> name, rc ) );
-        return rc;
-    }
-    if ( in <= FAILED_PRODUCTION )
-    {
-        VDB_DEBUG ( ( "failed to resolve column '%N' - NULL or failed production.\n", scol -> name ) );
-        return RC ( rcVDB, rcCursor, rcOpening, rcColumn, rcUndefined );
-    }
-
-    /* column name */
-    name = scol -> name -> name . addr;
-
-    /* pick up production */
-    if ( scol -> validate != NULL )
-    {
-        rc = VSimpleProdMake ( & wcol -> val, self -> owned, self -> curs,
-            prodSimpleCast, name, NULL, NULL, NULL, in, chainDecoding );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* create implicit comparison function */
-    else
-    {
-        /* need an output production */
-        if ( wcol -> out == NULL )
-        {
-            rc = VColumnProdMake ( & wcol -> out, self -> owned,
-                & wcol -> dad, prodColumnOut, name );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        /* create comparison func */
-        rc = VFunctionProdMakeBuiltInComp ( & wcol -> val, self -> owned,
-            name, self, wcol -> out, in );
-        if ( rc != 0 )
-            return rc;
-    }
-
-    /* install trigger */
-    rc = VectorAppend ( & curs -> trig, NULL, wcol -> val );
-    if ( rc == 0 )
-        * out = wcol -> val;
-
-    return rc;
-}
-
-rc_t VProdResolveColumn ( const VProdResolve *self,
-    VProduction **out, const SColumn *scol, bool alt )
-{
-    rc_t rc;
-    VColumn *vcol;
-    WColumn *wcol;
-    VCursor *curs = self -> curs;
-
-    /* decide upon behavior */
-    if ( curs -> read_only )
-    {
-        if ( alt )
-        {
-            /* TODO: Generate warning message */
-            return RC ( rcVDB, rcCursor, rcOpening, rcSchema, rcInvalid );
-        }
-        vcol = VCursorCacheGet ( & curs -> col, & scol -> cid );
-        if ( vcol == NULL )
-        {
-            rc = VCursorMakeColumn ( curs, & vcol, scol );
-            if ( rc != 0 )
-                return rc;
-
-#if OPEN_COLUMN_ALTERS_ROW
-            rc = VectorAppend ( & curs -> row, & vcol -> ord, vcol );
-            if ( rc != 0 )
-            {
-                VColumnWhack ( vcol, NULL );
-                return rc;
-            }
-#endif
-            rc = VCursorCacheSet ( & curs -> col, & scol -> cid, vcol );
-            if ( rc != 0 )
-            {
-#if OPEN_COLUMN_ALTERS_ROW
-                void *ignore;
-                VectorSwap ( & curs -> row, vcol -> ord, NULL, & ignore );
-                vcol -> ord = 0;
-#endif
-                VColumnWhack ( vcol, NULL );
-                return rc;
-            }
-        }
-
-        return VProdResolveColumnRead ( self, out, scol );
-    }
-
-    /* write cursor but read side */
-    if ( self -> chain == chainDecoding )
-    {
-        if ( alt )
-        {
-            /* TODO: Generate warning message */
-            return RC ( rcVDB, rcCursor, rcOpening, rcSchema, rcInvalid );
-        }
-
-        return VProdResolveColumnRead ( self, out, scol );
-    }
-
-    /* get existing column */
-    wcol = VCursorCacheGet ( & curs -> col, & scol -> cid );
-    if ( wcol == NULL )
-    {
-        /* normally write-only cursor must have existing column */
-        if ( ! self -> discover_writable_columns )
-            return 0;
-
-        /* auto-create writable column for purposes of discovery */
-        if ( scol -> read_only )
-            return 0;
-        rc = VCursorMakeColumn ( curs, & vcol, scol );
-        if ( rc != 0 )
-            return rc;
-
-        /* add it to the row as if user had done it */
-        rc = VectorAppend ( & curs -> row, & vcol -> ord, vcol );
-        if ( rc == 0 )
-        {
-            /* add it to the indexed vector */
-            rc = VCursorCacheSet ( & curs -> col, & scol -> cid, vcol );
-            if ( rc != 0 )
-            {
-                void *ignore;
-                VectorSwap ( & curs -> row, vcol -> ord, NULL, & ignore );
-                vcol -> ord = 0;
-            }
-        }
-
-        if ( rc != 0 )
-        {
-            VColumnWhack ( vcol, NULL );
-            return rc;
-        }
-
-        wcol = ( WColumn* ) vcol;
-    }
-
-    /* create output production as required */
-    if ( wcol -> out == NULL )
-    {
-        const char *name = scol -> name -> name . addr;
-        rc = VColumnProdMake ( & wcol -> out, self -> owned,
-            & wcol -> dad, prodColumnOut, name );
-        if ( rc != 0 )
-            return rc;
-    }
-    if ( alt )
-    {
-        * out = wcol -> dad . in;
-        assert ( * out != NULL );
-    }
-    else
-    {
-        * out = wcol -> out;
-    }
-    return 0;
-}
-
-/* ResolvePhysical
- *  resolves a physical column
- */
-static
-rc_t VProdResolvePhysicalWrite ( const VProdResolve *self, VPhysical *phys )
-{
-    VTypedesc desc;
-    VFormatdecl fd;
-    VProdResolve pr;
-    VProduction *prod;
-    VCursor *curs = self -> curs;
-
-    const char *name;
-    const SExpression *enc;
-    const SPhysMember *smbr;
-
-    /* open the physical column for write
-       load column metadata/schema, complete
-       physical member description. */
-    rc_t rc = VPhysicalOpenWrite ( phys,
-        ( VSchema* ) self -> schema, curs -> tbl );
-    if ( rc != 0 )
-        return rc;
-
-    /* there are two conditions under which a physical member
-       definition would be incommplete prior to opening the
-       column: 1) if the physical column were only forwarded
-       within table schema, or 2) if the column were added as
-       the result of a file system scan.
-
-       for the column to be writable, it must have had a complete
-       member definition from table schema, with a type and an
-       assignment expression, or it must have been added as the
-       result of an fs scan with a simple reciprocal expression.
-       the test for these two cases is for a resolved typedecl
-       and an assignment expression. */
-
-    /* nothing more to do if column does not exist
-       and member was undeclared, or is declared read-only */
-    smbr = phys -> smbr;
-    if ( smbr -> td . type_id == 0 || smbr -> expr == NULL )
-        return 0;
-
-    /* build fmtdecl */
-    fd . td = smbr -> td;
-    fd . fmt = 0;
-
-    /* shift to encode chain */
-    pr = * self;
-    pr . chain = chainEncoding;
-
-    /* resolve the input expression */
-    rc = VProdResolveExpr ( & pr, & phys -> in, & desc, & fd, smbr -> expr, false );
-    if ( rc == 0 && phys -> in == NULL )
-        return RC ( rcVDB, rcCursor, rcOpening, rcColumn, rcUndefined );
-
-    /* NB - at this point, fd and desc
-       represent the column's well-defined type */
-
-    /* member name */
-    name = smbr -> name -> name . addr;
-
-    /* physical encoding */
-    enc = phys -> enc;
-    if ( enc == NULL )
-        enc = smbr -> type;
-
-    /* build encoding schema in steps:
-         in <- page-to-blob
-    */
-    rc = VSimpleProdMake ( & prod, pr . owned,  self->curs,
-        prodSimplePage2Blob, name, & fd, & desc, NULL, phys -> in, chainEncoding );
-    if ( rc == 0 && enc != NULL )
-    {
-        /* in <- p2b <- encoding-func */
-        pr . blobbing = true;
-        rc = VProdResolveEncodingExpr ( & pr, & prod,
-            prod, ( const SPhysEncExpr* ) enc );
-        if ( rc == 0 )
-        {
-            fd = prod -> fd;
-            desc = prod -> desc;
-        }
-    }
-    if ( rc == 0 )
-    {
-        rc = VSimpleProdMake ( & phys -> b2s, pr . owned, self->curs,
-            prodSimpleBlob2Serial, name, & fd, & desc, NULL, prod, chainEncoding );
-    }
-
-    return rc;
-}
-
-rc_t VProdResolvePhysical ( const VProdResolve *self, VPhysical *phys )
-{
-    /* build encoding chain if writable cursor */
-    if ( ! self -> curs -> read_only )
-    {
-        rc_t rc = VProdResolvePhysicalWrite ( self, phys );
-        if ( rc != 0 || self -> discover_writable_columns )
-            return rc;
-    }
-
-    /* build decoding chain */
-    return VProdResolvePhysicalRead ( self, phys );
-}
-
-/*--------------------------------------------------------------------------
- * VColumnProd
- *  message redirect to VColumn
- */
-
-rc_t VColumnProdMake ( VProduction **prodp, Vector *owned,
-    VColumn *col, int sub, const char *name )
-{
-    const SColumn *scol = col -> scol;
-
-    /* why was this changed to get the column td from SColumn? */
-    VTypedesc desc;
-    rc_t rc = VSchemaDescribeTypedecl ( col -> schema,
-        & desc, & col -> scol -> td );
-    if ( rc != 0 )
-        * prodp = NULL;
-    else
-    {
-        VColumnProd *prod;
-
-        /* construct an fd because column does not have one */
-        VFormatdecl fd;
-        fd . td = scol -> td;
-        fd . fmt = 0;
-
-        rc = VProductionMake ( prodp, owned, sizeof * prod,
-            prodColumn, sub, name, & fd, & desc, NULL, chainEncoding );
-        if ( rc == 0 )
-        {
-            prod = ( VColumnProd* ) * prodp;
-            prod -> col = col;
-        }
-    }
-    return rc;
-}
-
-void VColumnProdDestroy ( VColumnProd *self )
-{
-}
-
-
-/* Read
- */
-rc_t VColumnProdRead ( VColumnProd *self, struct VBlob **vblob, int64_t id )
-{
-    WColumn *wcol = ( WColumn* ) self -> col;
-
-    switch ( self -> dad . sub )
-    {
-    case prodColumnOut:
-        return WColumnReadBlob ( wcol, vblob, id );
-    }
-
-    return RC ( rcVDB, rcColumn, rcReading, rcProduction, rcCorrupt );
-}
diff --git a/libs/vdb/wtable.c b/libs/vdb/wtable.c
deleted file mode 100644
index 6a6b2ef..0000000
--- a/libs/vdb/wtable.c
+++ /dev/null
@@ -1,987 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include "table-priv.h"
-#include "cursor-priv.h"
-#include "dbmgr-priv.h"
-#include "schema-priv.h"
-#include "schema-parse.h"
-#include "schema-dump.h"
-#include "database-priv.h"
-#include "linker-priv.h"
-
-#include <vdb/schema.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/index.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <klib/symbol.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/*--------------------------------------------------------------------------
- * VTable
- *  a collection of columns indexed by row id, metadata, indices
- */
-
-
-/* StoreSchema
- *  stores schema definition in metadata
- *
- *  <schema name="">...</schema>
- */
-LIB_EXPORT rc_t VTableStoreSchema ( VTable *self )
-{
-    /* open schema node */
-    KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeUpdate ( self -> meta, & node, "schema" );
-    if ( rc == 0 )
-    {
-        size_t num_writ;
-        char expr [ 256 ];
-        rc = VSchemaToText ( self -> schema, expr, sizeof expr - 1, & num_writ,
-            "%N%V", self -> stbl -> name, self -> stbl -> version );
-        if ( rc != 0 )
-            LOGERR ( klogInt, rc, "failed to determine table schema" );
-        else
-        {
-            expr [ num_writ ] = 0;
-
-            /* if table has a default view declaration,
-               store the table information under a new attribute */
-            if ( self -> stbl -> dflt_view != NULL )
-            {
-                uint32_t type;
-                const SNameOverload *name;
-                const STable *view = VSchemaFind ( self -> schema, & name, & type,
-                    self -> stbl -> dflt_view-> addr, __func__, false );
-                if ( view == NULL )
-                {
-                    rc = RC ( rcVDB, rcTable, rcUpdating, rcSchema, rcNotFound );
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to locate default view schema '$(expr)'",
-                                         "expr=%S", self -> stbl -> dflt_view ));
-                }
-                else
-                {
-                    rc = KMDataNodeWriteAttr ( node, "table", expr );
-                    if ( rc != 0 )
-                        PLOGERR ( klogInt, ( klogInt, rc, "failed to write table type '$(expr)'", "expr=%s", expr ));
-                    else
-                    {
-                        rc = VSchemaToText ( self -> schema, expr, sizeof expr - 1, & num_writ,
-                            "%N%V", view -> name, view -> version );
-                        if ( rc != 0 )
-                            LOGERR ( klogInt, rc, "failed to determine table default view schema" );
-                        else
-                            expr [ num_writ ] = 0;
-                    }
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                rc = KMDataNodeWriteAttr ( node, "name", expr );
-                if ( rc != 0 )
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to write table name '$(expr)'", "expr=%s", expr ));
-            }
-            if ( rc == 0 )
-            {
-                /* truncate existing schema */
-                rc = KMDataNodeWrite ( node, "", 0 );
-                if ( rc == 0 )
-                {
-                    rc = VSchemaDump ( self -> schema, sdmCompact, expr,
-                        ( rc_t ( CC * ) ( void*, const void*, size_t ) ) KMDataNodeAppend, node );
-                }
-                if ( rc != 0 )
-                    PLOGERR ( klogInt, ( klogInt, rc, "failed to write table schema '$(expr)'", "expr=%s", expr ));
-            }
-        }
-
-        KMDataNodeRelease ( node );
-    }
-    return rc;
-}
-
-
-/* OpenUpdate
- *  finish create operation
- */
-static
-rc_t VTableOpenUpdate ( VTable *self, const char *decl )
-{
-    /* open metadata */
-    rc_t rc = KTableOpenMetadataUpdate ( self -> ktbl, & self -> meta );
-    if ( rc == 0 )
-    {
-        /* open "col" node */
-        rc = KMetadataOpenNodeUpdate ( self -> meta, & self -> col_node, "col" );
-        if ( rc == 0 )
-        {
-            /* fetch stored schema */
-            rc = VTableLoadSchema ( self );
-            if ( rc == 0 )
-            {
-                /* fetch requested schema */
-                const STable *stbl = self -> stbl;
-                if ( decl != NULL && decl [ 0 ] != 0 )
-                {
-                    uint32_t type;
-                    const SNameOverload *name;
-
-                    if ( self -> db != NULL )
-                    {
-                        const STblMember *mbr = SDatabaseFind ( self -> db -> sdb,
-                            self -> schema, & name, & type, decl, "VTableOpenUpdate" );
-                        if ( mbr == NULL || type != eTblMember )
-                        {
-                            PLOGMSG ( klogWarn, ( klogWarn, "expression '$(expr)' is not a table member",
-                                       "expr=%s", decl ));
-                            stbl = NULL;
-                        }
-                        else
-                        {
-                            stbl = mbr -> tbl;
-                            assert ( stbl != NULL );
-                        }
-                    }
-                    else
-                    {
-                        stbl = VSchemaFind ( self -> schema,
-                            & name, & type, decl, "VTableOpenUpdate", true );
-                        if ( stbl != NULL && type != eTable )
-                        {
-                            PLOGMSG ( klogWarn, ( klogWarn, "expression '$(expr)' is not a table",
-                                       "expr=%s", decl ));
-                            stbl = NULL;
-                        }
-                    }
-                }
-
-                /* error if the two definitions differ */
-                if ( stbl != NULL && self -> stbl != NULL && stbl != self -> stbl )
-                    rc = RC ( rcVDB, rcTable, rcOpening, rcSchema, rcIncorrect );
-                else if ( stbl == NULL && self -> stbl == NULL )
-                    rc = RC ( rcVDB, rcTable, rcOpening, rcSchema, rcNotFound );
-                else if ( self -> stbl == NULL )
-                {
-
-                    /* write schema to metadata */
-                    self -> stbl = stbl;
-                    rc = VTableStoreSchema ( self );
-                }
-                else if ( stbl != NULL )
-                {
-                    /* use latest schema but don't overwrite in metadata */
-                    self -> stbl = stbl;
-                }
-            }
-        }
-    }
-
-    DBGMSG(DBG_VDB, DBG_FLAG(DBG_VDB_VDB), ("VTableOpenUpdate = %d\n", rc));
-
-    return rc;
-}
-
-
-/* CreateTable
- *  create a new or open an existing table using manager
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "schema" [ IN ] - schema object containg table
- *  declaration to be used in creating tbl.
- *
- *  "typespec" [ IN ] - type and optionally version of table schema,
- *  e.g. 'MY_NAMESPACE:MyTable' or 'MY_NAMESPACE:MyTable#1.1'
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "path" [ IN ] - NUL terminated string in
- *  wd-native character set giving path to table
- */
-LIB_EXPORT rc_t CC VDBManagerVCreateTable ( VDBManager *self, VTable **tblp,
-    const VSchema *schema, const char *typespec,
-    KCreateMode cmode, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcCreating, rcSelf, rcNull );
-        else if ( schema == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSchema, rcNull );
-        else if ( typespec == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcNull );
-        else if ( typespec [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcEmpty );
-        else
-        {
-            /* create object with new schema */
-            rc = VTableMake ( tblp, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                VTable *tbl = * tblp;
-
-                /* create physical object */
-                rc = KDBManagerVCreateTable ( self -> kmgr, & tbl -> ktbl, cmode, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenUpdate ( tbl, typespec );
-                    if ( rc == 0 )
-                    {
-#if LAZY_OPEN_COL_NODE
-                        KMDataNodeRelease ( tbl -> col_node );
-                        tbl -> col_node = NULL;
-#endif
-                        return 0;
-                    }
-
-                    rc = ResetRCContext ( rc, rcVDB, rcMgr, rcCreating );
-                }
-                VTableWhack ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerCreateTable ( VDBManager *self, VTable **tbl,
-    const VSchema *schema, const char *typespec,
-    KCreateMode cmode, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVCreateTable ( self, tbl, schema, typespec, cmode, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-/* CreateTable
- *  create a new or open an existing table under database
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "member" [ IN ] - name of table member template under database
- *  the named member is a table template rather than a named table.
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in
- *  db-native character set giving actual table name
- */
-LIB_EXPORT rc_t CC VDatabaseVCreateTable ( VDatabase *self, VTable **tblp,
-    const char *member, KCreateMode cmode, const char *name, va_list args )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcCreating, rcSelf, rcNull );
-        else if ( member == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcNull );
-        else if ( member [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcName, rcEmpty );
-        else if ( self -> read_only )
-            rc = RC ( rcVDB, rcDatabase, rcCreating, rcDatabase, rcReadonly );
-        else
-        {
-            rc = VTableMake ( tblp, self -> mgr, self, self -> schema );
-            if ( rc == 0 )
-            {
-                VTable *tbl = * tblp;
-
-                rc = KDatabaseVCreateTable ( self -> kdb, & tbl -> ktbl, cmode, name, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenUpdate ( tbl, member );
-                    if ( rc == 0 )
-                    {
-                        tbl -> pgsize = self -> pgsize;
-                        tbl -> cmode = self -> cmode;
-                        tbl -> checksum = self -> checksum;
-#if LAZY_OPEN_COL_NODE
-                        KMDataNodeRelease ( tbl -> col_node );
-                        tbl -> col_node = NULL;
-#endif
-                        return 0;
-                    }
-
-                    rc = ResetRCContext ( rc, rcVDB, rcDatabase, rcCreating );
-                }
-
-                VTableWhack ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseCreateTable ( VDatabase *self, VTable **tbl,
-    const char *member, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VDatabaseVCreateTable ( self, tbl, member, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenTableUpdate
- * VOpenTableUpdate
- *  open a table for read/write
- *
- *  "tbl" [ OUT ] - return parameter for newly opened table
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving name of table
- */
-LIB_EXPORT rc_t CC VDBManagerVOpenTableUpdate ( VDBManager *self, VTable **tblp,
-    const VSchema *schema, const char *path, va_list args )
-{
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcMgr, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcMgr, rcOpening, rcSelf, rcNull );
-        else
-        {
-            /* if no schema is given, always pass intrinsic */
-            if ( schema == NULL )
-                schema = self -> schema;
-
-            rc = VTableMake ( tblp, self, NULL, schema );
-            if ( rc == 0 )
-            {
-                VTable *tbl = * tblp;
-                rc = KDBManagerVOpenTableUpdate ( self -> kmgr, & tbl -> ktbl, path, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenUpdate ( tbl, NULL );
-                    if ( rc == 0 )
-                    {
-#if LAZY_OPEN_COL_NODE
-                        KMDataNodeRelease ( tbl -> col_node );
-                        tbl -> col_node = NULL;
-#endif
-                        return 0;
-                    }
-                }
-                VTableWhack ( tbl );
-            }
-        }
-        * tblp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDBManagerOpenTableUpdate ( VDBManager *self,
-    VTable **tbl, const VSchema *schema, const char *path, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, path );
-    rc = VDBManagerVOpenTableUpdate ( self, tbl, schema, path, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseVOpenTableUpdate ( VDatabase *self,
-    VTable **tblp, const char *name, va_list args )
-{ 
-    rc_t rc;
-
-    if ( tblp == NULL )
-        rc = RC ( rcVDB, rcDatabase, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcDatabase, rcOpening, rcSelf, rcNull );
-        else
-        {
-            rc = VTableMake ( tblp, self -> mgr, self, self -> schema );
-            if ( rc == 0 )
-            {
-                VTable *tbl = * tblp;
-
-                rc = KDatabaseVOpenTableUpdate ( self -> kdb, & tbl -> ktbl, name, args );
-                if ( rc == 0 )
-                {
-                    rc = VTableOpenUpdate ( tbl, NULL );
-                    if ( rc == 0 )
-                    {
-#if LAZY_OPEN_COL_NODE
-                        KMDataNodeRelease ( tbl -> col_node );
-                        tbl -> col_node = NULL;
-#endif
-                        return 0;
-                    }
-                }
-
-                VTableWhack ( tbl );
-            }
-        }
-
-        * tblp = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VDatabaseOpenTableUpdate ( VDatabase *self, VTable **tbl, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VDatabaseVOpenTableUpdate ( self, tbl, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Lock
- *  apply lock
- *
- *  if object is already locked, the operation is idempotent
- *  and returns an rc state of rcLocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VTableVLock ( VTable *self, uint32_t type, const char * name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcTable, rcLocking, rcSelf, rcNull );
-    else
-        rc = KTableVLock ( self -> ktbl, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableLock ( VTable *self, uint32_t type, const char * name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VTableVLock ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* Unlock
- *  remove lock
- *
- *  if object is already unlocked, the operation is idempotent
- *  and returns an rc state of rcUnlocked
- *
- *  "type" [ IN ] - a KDBPathType
- *  valid values are kptIndex and kptColumn
- *
- *  "path" [ IN ] - NUL terminated path
- */
-LIB_EXPORT rc_t CC VTableVUnlock ( VTable *self, uint32_t type,
-    const char * name, va_list args )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcTable, rcUnlocking, rcSelf, rcNull );
-    else
-        rc = KTableVUnlock ( self -> ktbl, type, name, args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableUnlock ( VTable *self, uint32_t type,
-    const char * name, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, name );
-
-    rc = VTableVUnlock ( self, type, name, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* OpenMetadataUpdate
- *  opens metadata file
- *
- *  "meta" [ OUT ] - return parameter for metadata
- */
-LIB_EXPORT rc_t CC VTableOpenMetadataUpdate ( VTable *self, struct KMetadata **meta )
-{
-    rc_t rc;
-    if ( meta == NULL )
-        rc = RC ( rcVDB, rcTable, rcOpening, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcOpening, rcSelf, rcNull );
-        else
-        {
-            * meta = self -> meta;
-            return KMetadataAddRef ( self -> meta );
-        }
-
-        * meta = NULL;
-    }
-
-    return rc;
-}
-
-
-/* CreateIndex
- * VCreateIndex
- *  create a new or open an existing index
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "type" [ IN ] - type of index to create
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-LIB_EXPORT rc_t CC VTableCreateIndex ( VTable *self, struct KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VTableVCreateIndex ( self, idx, type, cmode, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableVCreateIndex ( VTable *self, struct KIndex **idx,
-    KIdxType type, KCreateMode cmode, const char *name, va_list args )
-{
-    if ( self != NULL )
-        return KTableVCreateIndex ( self -> ktbl, idx, type, cmode, name, args );
-
-    if ( idx == NULL )
-        return RC ( rcVDB, rcTable, rcCreating, rcParam, rcNull );
-
-    return RC ( rcVDB, rcTable, rcCreating, rcSelf, rcNull );
-}
-
-
-/* OpenIndexUpdate
- * VOpenIndexUpdate
- *  open an index for read/write
- *
- *  "idx" [ OUT ] - return parameter for newly opened index
- *
- *  "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
- */
-
-LIB_EXPORT rc_t CC VTableOpenIndexUpdate ( VTable *self,
-    struct KIndex **idx, const char *name, ... )
-{
-    rc_t rc;
-    va_list args;
-
-    va_start ( args, name );
-    rc = VTableVOpenIndexUpdate ( self, idx, name, args );
-    va_end ( args );
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableVOpenIndexUpdate ( VTable *self,
-    struct KIndex **idx, const char *name, va_list args )
-{
-    if ( self != NULL )
-        return KTableVOpenIndexUpdate ( self -> ktbl, idx, name, args );
-
-    if ( idx == NULL )
-        return RC ( rcVDB, rcTable, rcOpening, rcParam, rcNull );
-
-    return RC ( rcVDB, rcTable, rcOpening, rcSelf, rcNull );
-}
-
-
-/* ListColumns
- *  list writable column names
- *
- *  "names" [ OUT ] - return parameter for namelist
- *
- *  availability: v2.1
- */
-static
-rc_t list_writable_columns ( VTable *self )
-{
-    rc_t rc;
-    VCursor *curs;
-
-    if ( self -> read_only )
-    {
-        self -> write_col_cache_valid = true;
-        return 0;
-    }
-
-    rc = VTableCreateCursorWriteInt ( self, & curs, kcmInsert, false );
-    if (  rc == 0 )
-    {
-	/* no need for schema-based triggers to fire **/
-	VCursorSuspendTriggers ( curs );
-        /* let this private VCursor-function list the columns */
-        rc = VCursorListWritableColumns ( curs, & self -> write_col_cache );
-        VCursorRelease ( curs );
-        if ( rc == 0 )
-            self -> write_col_cache_valid = true;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableListWritableColumns ( VTable *self, KNamelist **names )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else
-        {
-            if ( ! self -> write_col_cache_valid )
-                rc = list_writable_columns ( self );
-
-            if ( self -> write_col_cache_valid )
-                return make_column_namelist ( & self -> write_col_cache, names );
-        }
-
-        * names = NULL;
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableListSeededWritableColumns ( VTable *self,
-    KNamelist **names, const KNamelist *seed )
-{
-    rc_t rc;
-
-    if ( names == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        * names = NULL;
-
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else if ( seed == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-        else
-        {
-            BSTree cache;
-            BSTreeInit ( & cache );
-
-            rc = 0;
-
-            if ( ! self -> read_only )
-            {
-                VCursor *curs;
-                rc = VTableCreateCursorWriteInt ( self, & curs, kcmInsert, false );
-                if (  rc == 0 )
-                {
-                    /* let this private VCursor-function list the columns */
-                    rc = VCursorListSeededWritableColumns ( curs, & cache, seed );
-                    VCursorRelease ( curs );
-                }
-            }
-
-            if ( rc == 0 )
-                rc = make_column_namelist ( & cache, names );
-
-            BSTreeWhack ( & cache, VColumnRefWhack, NULL );
-        }
-    }
-
-    return rc;
-}
-
-
-/* ListDatatypes
- *  returns list of typedecls for named column
- *
- *  "col" [ IN ] - column name
- *
- *  "dflt_idx" [ OUT, NULL OKAY ] - returns the zero-based index
- *  into "typedecls" of the default datatype for the named column
- *
- *  "typedecls" [ OUT ] - list of datatypes available for named column
- *
- *  availability: v2.1
- */
-LIB_EXPORT rc_t CC VTableListWritableDatatypes ( VTable *self,
-    const char *col, KNamelist **typedecls )
-{
-    rc_t rc;
-    
-    if ( typedecls == NULL )
-        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
-        else if ( col == NULL )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcName, rcNull );
-        else if ( col [ 0 ] == 0 )
-            rc = RC ( rcVDB, rcSchema, rcListing, rcName, rcEmpty );
-        else
-        {
-            if ( ! self -> write_col_cache_valid )
-                rc = list_writable_columns ( self );
-
-            if ( self -> write_col_cache_valid )
-            {
-                uint32_t dummy;
-                return make_column_typelist ( & self -> write_col_cache, col, & dummy, typedecls );
-            }
-        }
-
-        * typedecls = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Reindex
- *  optimize column indices
- */
-LIB_EXPORT rc_t CC VTableReindex ( VTable *self )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcTable, rcReindexing, rcSelf, rcNull );
-
-    /* now allow the KTable to do its job */
-    return KTableReindex ( self -> ktbl );
-}
-
-
-/* ColumnCreateParams
- *  sets the creation parameters for physical columns
- *
- *  "cmode" [ IN ] - creation mode
- *
- *  "checksum" [ IN ] - the type of checksum information to
- *  apply when writing blobs
- *
- *  "pgsize" [ IN, DEFAULT ZERO ] - size of internal column "pages"
- *  the default value is indicated by 0 ( zero ).
- *  NB - CURRENTLY THE ONLY SUPPORTED PAGE SIZE IS 1 ( ONE ) BYTE.
- */
-LIB_EXPORT rc_t CC VTableColumnCreateParams ( struct VTable *self,
-    KCreateMode cmode, KChecksum checksum, size_t pgsize )
-{
-    if ( self == NULL )
-        return RC ( rcVDB, rcTable, rcUpdating, rcSelf, rcNull );
-
-    self -> cmode = cmode;
-    self -> checksum = checksum;
-    self -> pgsize = pgsize;
-
-    return 0;
-}
-
-
-/* OpenManager
- *  duplicate reference to manager
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VTableOpenManagerUpdate ( VTable *self, struct VDBManager **mgr )
-{
-    rc_t rc;
-
-    if ( mgr == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            rc = VDBManagerAddRef ( self -> mgr );
-            if ( rc == 0 )
-            {
-                * mgr = self -> mgr;
-                return 0;
-            }
-        }
-
-        * mgr = NULL;
-    }
-
-    return rc;
-}
-
-
-/* OpenParent
- *  duplicate reference to parent database
- *  NB - returned reference must be released
- */
-LIB_EXPORT rc_t CC VTableOpenParentUpdate ( VTable *self, struct VDatabase **db )
-{
-    rc_t rc;
-
-    if ( db == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else if ( self -> db != NULL && self -> db -> read_only )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcDatabase, rcReadonly );
-        else
-        {
-            rc = VDatabaseAddRef ( self -> db );
-            if ( rc == 0 )
-            {
-                * db = self -> db;
-                return 0;
-            }
-        }
-
-        * db = NULL;
-    }
-
-    return rc;
-}
-
-/* OpenKTable
- *  returns a new reference to underlying KTable
- */
-LIB_EXPORT rc_t CC VTableOpenKTableUpdate ( VTable *self, KTable **ktbl )
-{
-    rc_t rc;
-
-    if ( ktbl == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            * ktbl = self -> ktbl;
-            return KTableAddRef ( * ktbl );
-        }
-
-        * ktbl = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableVDropColumn(VTable *self, const char fmt[], va_list args)
-{
-    return KTableVDropColumn(self->ktbl, fmt, args);
-}
-
-LIB_EXPORT rc_t CC VTableDropColumn(VTable *self, const char fmt[], ...)
-{
-    va_list va;
-    rc_t rc;
-    
-    va_start(va, fmt);
-    rc = VTableVDropColumn(self, fmt, va);
-    va_end(va);
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VTableRenameColumn ( struct VTable *self, bool force,
-    const char *from, const char *to )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVDB, rcTable, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        rc = KTableRenameColumn ( self->ktbl, force, from, to );
-        if ( GetRCState(rc) == rcNotFound )
-           rc = KMDataNodeRenameChild( self->col_node, from, to );
-    }
-
-    return rc;
-}
-
diff --git a/libs/vdb/xform-priv.h b/libs/vdb/xform-priv.h
deleted file mode 100644
index aaa539b..0000000
--- a/libs/vdb/xform-priv.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*=======================================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_xform_priv_
-#define _h_xform_priv_
-
-#ifndef _h_vdb_xform_
-#include <vdb/xform.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* VBlobFuncN
- *  works on VBlob objects
- */
-struct VBlob;
-
-enum
-{
-    vftBlobN = vftBlob + 1,
-    vftSelect,
-
-    vftLastFuncProto
-};
-
-/* merge and other internal functions
- *
- * If you return one of your input blobs, ***** ADDREF ***** it.
- */
-typedef rc_t ( CC * VBlobFuncN ) ( void *self, const VXformInfo *info, int64_t row_id,
-    struct VBlob **rslt, uint32_t argc, struct VBlob const *argv [] );
-
-typedef rc_t ( CC * VBlobCompareFunc ) (void *self, const VRowData *input, const VRowData *read);
-
-typedef union VFuncDescInternalFuncs VFuncDescInternalFuncs;
-union VFuncDescInternalFuncs
-{
-    VRowFunc         rf;
-    VNonDetRowFunc   ndf;
-    VFixedRowFunc    pf;
-    VArrayFunc       af;
-    VBlobFunc        bf;
-    VBlobFuncN       bfN;
-    VBlobCompareFunc cf;
-};
-
-#define VFUNCDESC_INTERNAL_FUNCS( DESC ) \
-    ( ( union VFuncDescInternalFuncs * ) ( & ( DESC ) -> u ) )
-
-/* factory declaration with no self parameter */
-#define VTRANSFACT_BUILTIN_IMPL( fact, maj, min, rel ) \
-    VTRANSFACT_IMPL ( fact, maj, min, rel )
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_xform_priv_ */
diff --git a/libs/vfs/Makefile b/libs/vfs/Makefile
deleted file mode 100644
index 5fe9c6c..0000000
--- a/libs/vfs/Makefile
+++ /dev/null
@@ -1,101 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: all
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/vfs
-
-INT_LIBS = \
-	libvfs
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-TEST_TOOLS = \
-
-include $(TOP)/build/Makefile.env
-
-RWORKDIR=$(TOP)/$(MODULE)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(TEST_TOOLS): makedirs
-	@ $(MAKE_CMD) $(TEST_BINDIR)/$@
-
-.PHONY: all std $(ALL_LIBS) $(TEST_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(TEST_TOOLS)))
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vfs
-#
-$(ILIBDIR)/libvfs: $(addprefix $(ILIBDIR)/libvfs.,$(ILIBEXT))
-
-VFS_SRC_CMN = \
-	syspath \
-	manager  \
-	resolver \
-    keyring \
-    syskeyring
-
-VFS_SRC = \
-	path \
-	$(VFS_SRC_CMN)
-
-VFS_OBJ = \
-	$(addsuffix .$(LOBX),$(VFS_SRC))
-
-VFS_LIB = \
-	-lkns \
-	-lkurl \
-	-lkns \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lklib
-
-$(ILIBDIR)/libvfs.$(LIBX): $(VFS_OBJ)
-	$(LD) --slib -o $@ $^ $(VFS_LIB)
diff --git a/libs/vfs/keyring-priv.h b/libs/vfs/keyring-priv.h
deleted file mode 100644
index 42fb6a0..0000000
--- a/libs/vfs/keyring-priv.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_keyring_priv_
-#define _h_keyring_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct KStream;
-
-extern rc_t StartKeyRing(struct KStream** ipc);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_keyring_priv_ */
diff --git a/libs/vfs/keyring.c b/libs/vfs/keyring.c
deleted file mode 100644
index b64e7c8..0000000
--- a/libs/vfs/keyring.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "keyring.h"
-
-#include <klib/rc.h>
-#include <klib/refcount.h>
-
-#include <kns/stream.h>
-
-#include "keyring-priv.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
- 
-#define rcTarget rcNoTarg
-
-struct KKeyRing
-{
-    KRefcount refcount;
-
-    bool read_only;
-    
-    KStream* ipc;
-};
-
-static
-rc_t CC KKeyRingInit(KKeyRing* self)
-{
-    memset(self, 0, sizeof(KKeyRing));
-
-    KRefcountInit ( & self -> refcount, 1, "KKeyRing", "init", "" );
-    
-    return StartKeyRing(&self->ipc);
-}
-
-static
-rc_t CC KKeyRingWhack(KKeyRing* self)
-{
-    rc_t rc = KStreamRelease(self->ipc);
-    free(self);
-    return rc;
-}
-
-extern
-rc_t CC KKeyRingAddRef ( const KKeyRing *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "KKeyRing" ) )
-        {
-        case krefLimit:
-            return RC ( rcKFG, rcTarget, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-extern 
-rc_t CC KKeyRingRelease ( KKeyRing *self, bool shutdown_server )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "KKeyRing" ) )
-        {
-        case krefWhack:
-            return KKeyRingWhack ( ( KKeyRing* ) self );
-        break;
-        case krefLimit:
-            return RC ( rcKFG, rcTarget, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC KKeyRingMakeRead( const KKeyRing** cself )
-{
-    KKeyRing** self = (KKeyRing**)cself;
-    rc_t rc = KKeyRingMakeUpdate(self);
-    if (rc == 0)
-        (*self)->read_only = true;
-    return rc;
-}
-
-LIB_EXPORT 
-rc_t CC KKeyRingMakeUpdate(KKeyRing** self)
-{
-    KKeyRing* obj;
-    rc_t rc;
-    
-    if ( self == NULL )
-        rc = RC ( rcKFG, rcTarget, rcCreating, rcParam, rcNull );
-    else
-    {
-        obj = malloc(sizeof(KKeyRing));
-        if (obj == NULL)
-            rc = RC ( rcKFG, rcTarget, rcCreating, rcMemory, rcExhausted );
-        {
-            rc = KKeyRingInit(obj);
-            if (rc == 0)
-               *self = obj;
-            else
-                free(obj);
-        }
-    }
-    
-    return rc;
-}
-
diff --git a/libs/vfs/keyring.h b/libs/vfs/keyring.h
deleted file mode 100644
index fa9ca01..0000000
--- a/libs/vfs/keyring.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vfs_keyring_
-#define _h_vfs_keyring_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* 
- * API for clients of a client/server KeyRing implementation.
- * Client code can use this interface and fall back to using KKeyStore in some cases, e.g. to work with a project that has not been
- * added to the keyring. This can be done behind KKeyRing interface (would have to define an object naming scheme that is compatible 
- * with project-id/type/object-id), or explicitly in the client code.
- */
-typedef struct KKeyRing KKeyRing;
- 
- /* Make
- * Open an IPC connection to a keyring server. Will start the server if none is running.
- * KKeyRingMakeRead will reject Add/Delete operations 
- */
-VFS_EXTERN rc_t CC KKeyRingMakeRead( const KKeyRing** self );
-VFS_EXTERN rc_t CC KKeyRingMakeUpdate( KKeyRing** self );
-
- /* AddRef
- * Release
- *
- * shutdown_server [ IN ] - if this is the last reference, send a Shutdown message to server before closing the IPC connection.
- * This will not necessarily shut down the server immediately; if there are other active connections, the server will wait for them to close first.
- * Use KKeyRingIsServerRunning() to check it the server is down.
- */
-VFS_EXTERN rc_t CC KKeyRingAddRef ( const KKeyRing *self );
-VFS_EXTERN rc_t CC KKeyRingRelease ( KKeyRing *self, bool shutdown_server );
- 
-/* 
- * retrieving download/encyprtion keys
- */
-VFS_EXTERN rc_t CC KKeyRingGetDownloadTicket(const KKeyRing* self, const char* project_key, const char** dl_key);
-VFS_EXTERN rc_t CC KKeyRingGetProjectEncryptionKey(const KKeyRing* self, const char* project_key, const char** enc_key);
-
-/*
- * managing projects 
-*/                                                   
-VFS_EXTERN rc_t CC KKeyRingAddProject(KKeyRing* self, const char* project_key, const char* dl_key, const char* enc_key);
-VFS_EXTERN rc_t CC KKeyRingDeleteProject(KKeyRing* self, const char* project_key); /* will delete all associated objects */
-
-/*
- * managing objects
- */
-VFS_EXTERN rc_t CC KKeyRingAddObject(KKeyRing* self, 
-                                      const char* project_key, uint8_t object_type, const char* object_key,
-                                      const char* display_name, uint64_t size, const char* checksum);
-VFS_EXTERN rc_t CC KKeyRingDeleteObject(KKeyRing* self, 
-                                         const char* project_key, uint8_t object_type, const char* object_key);
-
-/* KKeyRingReencrypt
- * Server can refuse to reencrypt if it detects other active servers.
- */
-VFS_EXTERN rc_t CC KKeyRingReencrypt(KKeyRing** self, const char* new_passwd); 
-
- /* IsServerRunning
- * 
- */
-VFS_EXTERN bool CC KKeyRingIsServerRunning();
-
-/* 
- * private API for libkrypto 
- */
-
-VFS_EXTERN rc_t CC KKeyRingGetObjectEncryptionKey(const KKeyRing* self, const char* project_key, 
-                                                   uint8_t object_type, const char* object_key, const char** enc_key);
-
-                                                   
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_vfs_keyring_ */
diff --git a/libs/vfs/libsrapath.vers b/libs/vfs/libsrapath.vers
deleted file mode 100644
index e9bc149..0000000
--- a/libs/vfs/libsrapath.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.14
diff --git a/libs/vfs/libvfs.vers b/libs/vfs/libvfs.vers
deleted file mode 100644
index 59e9e60..0000000
--- a/libs/vfs/libvfs.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.11
diff --git a/libs/vfs/manager.c b/libs/vfs/manager.c
deleted file mode 100644
index ec38743..0000000
--- a/libs/vfs/manager.c
+++ /dev/null
@@ -1,2948 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vfs/extern.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <vfs/manager-priv.h> /* VFSManagerMakeFromKfg */
-
-#include "path-priv.h"
-
-#include <krypto/key.h>
-#include <krypto/encfile.h>
-#include <krypto/wgaencrypt.h>
-#include <krypto/ciphermgr.h>
-
-#include <kfg/config.h>
-#include <kfg/repository.h>
-#include <kfg/keystore.h>
-#include <kfg/keystore-priv.h>
-
-#include <vfs/resolver.h>
-#include <sra/srapath.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/sra.h>
-#include <kfs/tar.h>
-#include <kfs/dyload.h>
-#include <kfs/kfs-priv.h>
-#include <kfs/nullfile.h>
-#include <kfs/buffile.h>
-#include <kfs/quickmount.h>
-#include <kfs/cacheteefile.h>
-#include <kfs/lockfile.h>
-
-#include <kns/curl-file.h>
-#include <kxml/xml.h>
-#include <klib/refcount.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-#include <strtol.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-#ifdef _DEBUGGING
-#define MGR_DEBUG(msg) DBGMSG(DBG_VFS,DBG_FLAG(DBG_VFS_MGR), msg)
-#else
-#define MGR_DEBUG(msg)
-#endif
-
-
-#define DEFAULT_CACHE_BLOCKSIZE ( 32768 * 4 )
-#define DEFAULT_CACHE_CLUSTER 1
-
-#define ENV_KRYPTO_PWFILE "VDB_PWFILE"
-
-#define VFS_KRYPTO_PASSWORD_MAX_SIZE 4096
-
-/*--------------------------------------------------------------------------
- * VFSManager
- */
-
-/* currently expected to be a singleton and not use a vtable but
- * be fully fleshed out here */
-struct VFSManager
-{
-    KRefcount refcount;
-
-    /* the current directory in the eyes of the O/S when created */
-    KDirectory * cwd;
-
-    /* configuration manager */
-    KConfig * cfg;
-
-    /* krypto's cipher manager */
-    KCipherManager * cipher;
-
-    /* SRAPath will be replaced with a VResolver */
-    struct VResolver * resolver;
-
-    /* path to a global password file */
-    char *pw_env;
-    
-    /* encryption key storage */ 
-    struct KKeyStore* keystore;
-};
-
-static const char kfsmanager_classname [] = "VFSManager";
-
-static 
-VFSManager * singleton = NULL;
-
-
-/* Destroy
- *  destroy file
- */
-static rc_t VFSManagerDestroy ( VFSManager *self )
-{
-    if ( self == NULL )
-        return RC ( rcVFS, rcFile, rcDestroying, rcSelf, rcNull );
-
-    KRefcountWhack (&self->refcount, kfsmanager_classname);
-
-    KDirectoryRelease (self->cwd);
-
-    KConfigRelease (self->cfg);
-
-    KCipherManagerRelease (self->cipher);
-
-    VResolverRelease ( self->resolver );
-
-    free ( self -> pw_env );
-    
-    KKeyStoreRelease( self->keystore );
-
-    free (self);
-
-    singleton = NULL;
-    return 0;
-}
-
-/* AddRef
- *  creates a new reference
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC VFSManagerAddRef ( const VFSManager *self )
-{
-    if (self != NULL)
-    {
-        switch (KRefcountAdd (&self->refcount, kfsmanager_classname))
-        {
-        case krefOkay:
-            break;
-        case krefZero:
-            return RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcIncorrect);
-        case krefLimit:
-            return RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcExhausted);
-        case krefNegative:
-            return RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            return RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcUnknown);
-        }
-    }
-    return 0;
-}
-
-/* Release
- *  discard reference to file
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC VFSManagerRelease ( const VFSManager *self )
-{
-    rc_t rc = 0;
-    if (self != NULL)
-    {
-        switch (KRefcountDrop (&self->refcount, kfsmanager_classname))
-        {
-        case krefOkay:
-        case krefZero:
-            break;
-        case krefWhack:
-            rc = VFSManagerDestroy ((VFSManager*)self);
-            break;
-        case krefNegative:
-            return RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcInvalid);
-        default:
-            rc = RC (rcVFS, rcMgr, rcAttaching, rcRefcount, rcUnknown);
-            break;            
-        }
-    }
-    return rc;
-}
-
-
-
-/*--------------------------------------------------------------------------
- * VFSManagerMakeCurlFile
- */
-static
-rc_t VFSManagerMakeCurlFile( const VFSManager * self, const KFile **cfp,
-                             const char * url, const char * cache_location )
-{
-    rc_t rc = KCurlFileMake ( cfp, url, false );
-    if ( rc == 0 )
-    {
-        const KFile *temp_file;
-        rc_t rc2;
-        if ( cache_location == NULL )
-        {
-            /* there is no cache_location! just wrap the remote file in a buffer */
-            rc2 = KBufFileMakeRead ( & temp_file, * cfp, 128 * 1024 * 1024 );
-        }
-        else
-        {
-            /* we do have a cache_location! wrap the remote file in a cacheteefile */
-            rc2 = KDirectoryMakeCacheTee ( self->cwd, &temp_file, *cfp, NULL,
-                                           DEFAULT_CACHE_BLOCKSIZE, DEFAULT_CACHE_CLUSTER,
-                                           false, "%s", cache_location );
-        }
-        if ( rc2 == 0 )
-        {
-            KFileRelease ( * cfp );
-            * cfp = temp_file;
-        }
-    }
-    return rc;
-}
-
-static rc_t CC VFSManagerGetConfigPWFile (const VFSManager * self, char * b, size_t bz, size_t * pz)
-{
-    const char * env;
-    const KConfigNode * node;
-    size_t oopsy;
-    size_t z = 0;
-    rc_t rc;
-
-    if (pz)
-        *pz = 0;
-
-    env = getenv (ENV_KRYPTO_PWFILE);
-    if (!env)
-        env = self->pw_env;
-    if (env)
-    {
-        z = string_copy (b, bz, env, string_size (env));
-    
-        /* force a NUL that string_copy might have omitted 
-         * even if this truncates the path */
-        b[bz-1] = '\0';
-
-        if (pz)
-            *pz = z;
-       
-        return 0;
-    }
-    
-    rc = KConfigOpenNodeRead (self->cfg, &node, "krypto/pwfile");
-    if (rc)
-    {
-        /* if not found, change object from path to encryption key */
-        if (GetRCState(rc) == rcNotFound)
-            rc = RC (rcVFS, rcMgr, rcOpening, rcEncryptionKey, rcNotFound);
-    }
-    else
-    {
-        rc = KConfigNodeRead (node, 0, b, bz-1, &z, &oopsy);
-        if (rc == 0)
-        {
-            if (oopsy != 0)
-                rc = RC (rcKrypto, rcMgr, rcReading, rcBuffer, rcInsufficient);
-            else
-            {
-                b[z] = '\0';
-                *pz = z;
-            }
-        }
-        KConfigNodeRelease (node);
-    }
-    return rc;
-}
-
-static
-rc_t GetEncryptionKey(const VFSManager * self, const VPath * vpath, char* obuff, size_t buf_size, size_t *pwd_size)
-{
-    /* -----
-     * #if 0
-     * first check the insecure password on the command line hack 
-     * #endif 
-     *
-     * then check the option for pwfile in the VPath
-     * then check the option for pwfd
-     * then check the keystore. if necessary, keystore will 
-     *          check the environment      
-     *          check the configuration
-     */
-
-#if 0
-    /* obviously not used yet */
-    if (VPathOption (vpath, vpopt_temporary_pw_hack, obuff, buf_size, &z) == 0)
-    {
-        if (z < 1)
-            rc = RC (rcVFS, rcPath, rcConstructing, rcParam, rcInvalid);
-        else
-        {
-            size_t x = 0;
-            size_t y = 0;
-            int ch, h, l;
-
-            while (x < z)
-            {
-                h = tolower(obuff[x++]);
-                l = tolower(obuff[x++]);
-
-                if (!isxdigit(h) || !isxdigit(l))
-                    rc = RC (rcVFS, rcPath, rcConstructing, rcParam, rcInvalid);
-
-                if (isdigit(h))
-                    ch = (h - '0') << 4;
-                else
-                    ch = (h + 10 - 'a') << 4;
-                if (isdigit(l))
-                    ch |= (l - '0');
-                else
-                    ch |= (l + 10 - 'a');
-
-                /* added for compatibility with other passwords */
-                if ((ch == '\r') || (ch == '\n'))
-                    break;
-                obuff[y++] = (char)ch;
-            }
-            obuff[y] = '\0';
-            assert (z == x);
-            assert (z/2 == y);
-            z = y;
-            * pwd_size = z;
-        }
-    }
-#endif    
-
-    rc_t rc = 0;
-    rc_t rc2;
-    size_t z;
-
-    if (VPathOption (vpath, vpopt_pwpath, obuff, buf_size - 1, &z) == 0)
-    {
-        const KFile * pwfile;
-        obuff [z] = '\0';
-        rc = KDirectoryOpenFileRead(self->cwd, &pwfile, obuff);
-        if (rc == 0)
-        {
-            rc = KKeyStoreSetTemporaryKeyFromFile(self->keystore, pwfile);
-            rc2 = KFileRelease(pwfile);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    else if (VPathOption (vpath, vpopt_pwfd, obuff, buf_size - 1, &z) == 0)
-    {
-        /* -----
-         * pwfd is not fully a VPath at this point: we 
-         * should obsolete it
-         */
-        const KFile * pwfile;
-        obuff [z] = '\0';
-        rc = KFileMakeFDFileRead (&pwfile, atoi (obuff));
-        if (rc == 0)
-        {
-            rc = KKeyStoreSetTemporaryKeyFromFile(self->keystore, pwfile);
-            rc2 = KFileRelease(pwfile);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    
-    if (rc == 0)
-    {
-        KEncryptionKey* enc_key;
-        rc = KKeyStoreGetKey(self->keystore, NULL, &enc_key); /* here, we are only interested in global keys - at least for now */
-        if (rc == 0)
-        {
-            *pwd_size = string_copy(obuff, buf_size, enc_key->value.addr, enc_key->value.size);
-            if (*pwd_size != enc_key->value.size)
-                rc = RC(rcVFS, rcPath, rcReading, rcBuffer, rcInsufficient);
-            rc2 = KEncryptionKeyRelease(enc_key);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    
-    rc2 = KKeyStoreSetTemporaryKeyFromFile(self->keystore, NULL); /* forget the temp key if set */
-    if (rc == 0)
-        rc = rc2;
-    return rc;
-}
-
-/*
- * This is still hack - must match VFSManagerResolvePathRelativeDir()
- */
-LIB_EXPORT rc_t CC VFSManagerWGAValidateHack (const VFSManager * self, 
-                                              const KFile * file,
-                                              const char * path) /* we'll move this to a vpath */
-{
-    VPath * vpath;
-    rc_t rc = 0;
-
-    rc = VPathMake (&vpath, path);
-    if (rc == 0)
-    {
-        size_t z;
-        char obuff [VFS_KRYPTO_PASSWORD_MAX_SIZE + 2]; /* 1 for over-read and 1 for NUL */
-        rc = GetEncryptionKey(self, vpath, obuff, sizeof(obuff), &z);
-
-        if (rc == 0)
-        {
-            rc = WGAEncValidate (file, obuff, z);
-        }
-    }
-    return rc;
-}
-
-
-
-/* ResolvePath
- *
- * take a VPath and resolve to a final form apropriate for KDB
- *
- * that is take a relative path and resolve it against the CWD
- * or take an accession and resolve into the local or remote 
- * VResolver file based on config. It is just a single resolution percall
- */
-static rc_t VFSManagerResolvePathResolver (const VFSManager * self,
-                                           uint32_t flags,
-                                           const VPath * in_path,
-                                           VPath ** out_path)
-{
-    rc_t rc = 0;
-
-    *out_path = NULL;
-
-    /*
-     * this RC perculates up for ncbi-acc: schemes but not for
-     * no scheme uris
-     */
-    if ((flags & vfsmgr_rflag_no_acc) == vfsmgr_rflag_no_acc)
-    {
-        /* hack */
-        if ( VPathGetUri_t ( in_path ) == vpuri_none )
-            rc = SILENT_RC (rcVFS, rcMgr, rcResolving, rcSRA, rcNotAvailable);
-        else
-            rc = RC (rcVFS, rcMgr, rcResolving, rcSRA, rcNotAvailable);
-    }
-    else
-    {
-        bool not_done = true;
-
-        /*
-         * cast because we seem to have the restriction on the output from
-         * VResolver that seems too restrictive
-         */
-        if ((flags & vfsmgr_rflag_no_acc_local) == 0)
-        {
-            rc = VResolverLocal (self->resolver, in_path, (const VPath **)out_path);
-            if (rc == 0)
-                not_done = false;
-        }
-            
-        if (not_done && ((flags & vfsmgr_rflag_no_acc_remote) == 0))
-        {
-            rc = VResolverRemote (self->resolver, eProtocolHttp,
-                in_path, (const VPath **)out_path, NULL);
-        }
-    }
-    return rc;
-}
-
-
-static rc_t VFSManagerResolvePathInt (const VFSManager * self,
-                                      uint32_t flags,
-                                      const KDirectory * base_dir,
-                                      const VPath * in_path,
-                                      VPath ** out_path)
-{
-    rc_t rc;
-    char * pc;
-    VPUri_t uri_type;
-
-    assert (self);
-    assert (in_path);
-    assert (out_path);
-
-    uri_type = VPathGetUri_t ( in_path );
-    switch ( uri_type )
-    {
-    default:
-        rc = RC (rcVFS, rcMgr, rcResolving, rcPath, rcInvalid);
-        break;
-
-    case vpuri_not_supported:
-    case vpuri_ncbi_legrefseq:
-        rc = RC (rcVFS, rcMgr, rcResolving, rcPath, rcUnsupported);
-        break;
-
-    case vpuri_ncbi_acc:
-        rc = VFSManagerResolvePathResolver (self, flags, in_path, out_path);
-        break;
-
-    case vpuri_none:
-        /* for KDB purposes, no scheme might be an accession */
-        if (flags & vfsmgr_rflag_kdb_acc)
-        {
-             /* no '/' is permitted in an accession */
-            pc = string_chr (in_path->path.addr, in_path->path.size, '/');
-            if (pc == NULL)
-            {
-                rc = VFSManagerResolvePathResolver (self, flags, in_path, out_path);
-                if (rc == 0)
-                    break;
-            }
-        }
-        /* Fall through */
-    case vpuri_ncbi_vfs:
-    case vpuri_file:
-        /* check for relative versus full path : assumes no 'auth' not starting with '/' */
-        if (in_path->path.addr[0] == '/')
-        {
-            rc = VPathAddRef (in_path);
-            if (rc == 0)
-                *out_path = (VPath *)in_path; /* oh these const ptr are annoying */
-        }
-        else
-        {
-            /* not 'properly' handling query, fragment etc. for relative path
-             * assumes path within VPath is ASCIZ
-             */
-            size_t s;
-            VPath * v;
-            char u [32 * 1024];
-
-            switch ( uri_type )
-            {
-            default:
-                rc = RC (rcVFS, rcMgr, rcResolving, rcFunction, rcInvalid);
-                break;
-
-            case vpuri_ncbi_vfs:
-                string_printf ( u, sizeof u, & s, "%S:", & in_path -> scheme );
-                rc = KDirectoryResolvePath ( base_dir, true, & u [ s ], sizeof u - s,
-                    "%.*s", ( int ) in_path -> path . size, in_path -> path . addr );
-                if ( rc == 0 )
-                {
-                    s = string_size ( u );
-                    rc = string_printf ( & u [ s ], sizeof u - s, NULL,
-                        "%S%S", & in_path -> query, & in_path -> fragment );
-                }
-                if (rc == 0)
-                    rc = VPathMake (&v, u);
-                break;
-
-            case vpuri_none:
-            case vpuri_file:
-                rc = KDirectoryResolvePath ( base_dir, true, u, sizeof u,
-                    "%.*s", ( int ) in_path -> path . size, in_path -> path . addr );
-                rc = VPathMake (&v, u);
-                break;
-            }
-            if (rc == 0)
-                *out_path = v;
-        }
-        break;
-
-        /* these are considered fully resolved already */
-    case vpuri_http:
-    case vpuri_ftp:
-        rc = VPathAddRef (in_path);
-        if (rc == 0)
-            *out_path = (VPath*)in_path;
-        break;
-
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerResolvePath (const VFSManager * self,
-                                          uint32_t flags,
-                                          const VPath * in_path,
-                                          VPath ** out_path)
-{
-    if (out_path == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    *out_path = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcSelf, rcNull);
-
-    if (in_path == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    return VFSManagerResolvePathInt (self, flags, self->cwd, in_path, out_path);
-}
-
-LIB_EXPORT rc_t CC VFSManagerResolvePathRelative (const VFSManager * self,
-                                                  uint32_t flags,
-                                                  const struct  VPath * base_path,
-                                                  const struct  VPath * in_path,
-                                                  struct VPath ** out_path)
-{
-    const KDirectory * dir;
-    rc_t rc;
-
-    if (out_path == NULL)
-        rc = RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    *out_path = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcSelf, rcNull);
-
-    if (in_path == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    rc = VFSManagerOpenDirectoryRead (self, &dir, base_path);
-    if (rc == 0)
-        rc = VFSManagerResolvePathInt (self, flags, dir, in_path, out_path);
-
-    return rc;
-}
-
-/*
- * This is still hack - must match VFSManagerGetEncryptionKey()
- */
-
-LIB_EXPORT rc_t CC VFSManagerResolvePathRelativeDir (const VFSManager * self,
-                                                     uint32_t flags,
-                                                     const KDirectory * base_dir,
-                                                     const VPath * in_path,
-                                                     VPath ** out_path)
-{
-    if (out_path == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    *out_path = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcSelf, rcNull);
-
-    if (in_path == NULL)
-        return RC (rcVFS, rcMgr, rcResolving, rcParam, rcNull);
-
-    return VFSManagerResolvePathInt (self, flags, base_dir, in_path, out_path);
-}
-
-
-/* OpenFileRead
- *  opens an existing file with read-only access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-static
-rc_t VFSManagerOpenFileReadDecryption (const VFSManager *self,
-                                       const KDirectory * dir,
-                                       const KFile ** f,
-                                       const KFile * file,
-                                       const VPath * path,
-                                       bool force_decrypt,
-                                       bool * was_encrypted)
-{
-    rc_t rc = 0;
-    size_t z;
-    char obuff [VFS_KRYPTO_PASSWORD_MAX_SIZE + 2]; /* 1 for over-read and 1 for NUL */
-    bool has_enc_opt;
-
-    if (was_encrypted)
-        *was_encrypted = false;
-
-    /* -----
-     * at this point we have no fatal errors and we have the
-     * file opened but we have not seen if we have to decrypt
-     * or use other query options
-     */
-    has_enc_opt = (VPathOption (path, vpopt_encrypted, obuff,
-                                sizeof obuff, &z) == 0);
-
-    if ((has_enc_opt == false) &&
-        (force_decrypt == false))
-    {
-        /* if we are not told to decrypt, don't and we are done */
-        KFileAddRef (file);
-        *f = file;
-    }
-
-    else /* we are told to decrypt if possible */
-    {
-        /* -----
-         * pre-read 4kb from the 'encrypted file'
-         */
-        rc = KFileRandomAccess (file);
-        if (rc == 0)
-            ;
-        /* most common and easiest option is it has random
-         * access - a no-op here
-         */
-        else if (GetRCState(rc) == rcUnsupported)
-        {
-            const KFile * buffile;
-
-            rc = KBufFileMakeRead (&buffile, file, 32 * 2 * 1024);
-            if (rc)
-                ;
-            else
-            {
-                /* there is an extra reference to file now, but
-                 * it gets removed after this function returns
-                 */
-                file = buffile;
-            }
-        }
-        
-        if (rc == 0)
-        {
-            size_t tz;
-            char tbuff [4096];
-
-            /* we now have a file from which we can pre-read the
-             * possible encrypted format header */
-            rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-            if (rc == 0)
-            {
-                /* 
-                 * we've successfully read 4KB from the file,
-                 * now decide if is actually an encrypted file
-                 * format we support
-                 */
-                const KFile * encfile;
-
-                /* is this the header of an ecnrypted file? */
-                if (KFileIsEnc (tbuff, tz) == 0)
-                {
-                    if (was_encrypted)
-                        *was_encrypted = true;
-                    rc = GetEncryptionKey(self, path, obuff, sizeof(obuff), &z);
-                    if (rc == 0)
-                    {
-                        KKey key;
-
-                        /* create the AES Key */
-                        rc = KKeyInitRead (&key, kkeyAES128, obuff, z);
-                        if (rc)
-                            ;
-                        else
-                        {
-                            rc = KEncFileMakeRead (&encfile, file, &key);
-                            if (rc)
-                                ;
-                            else
-                            {
-                                const KFile * buffile;
-
-                                /*
-                                 * TODO: make the bsize a config item not a hard constant
-                                 */
-                                rc = KBufFileMakeRead (&buffile, encfile,
-                                                       256 * 1024 * 1024);
-                                if (rc == 0)
-                                {
-                                    *f = buffile;
-                                    /* *f keeps a reference to encfile, can release it here */
-                                    KFileRelease (encfile);
-                                    return 0;
-                                }
-                                KFileRelease (encfile);
-                            }
-                        }
-                    }
-                }
-                else if (KFileIsWGAEnc (tbuff, tz) == 0)
-                {
-                    if (was_encrypted)
-                        *was_encrypted = true;
-                    rc = GetEncryptionKey(self, path, obuff, sizeof(obuff), &z);
-                    if (rc == 0)
-                    {
-                        rc = KFileMakeWGAEncRead (&encfile, file, obuff, z);
-                        if (rc)
-                            ;
-                        else
-                        {
-                            /* we'll release anextra reference to file
-                             * after this function returns
-                             */
-                            *f = encfile;
-                            return 0;
-                        }
-                    }
-                }
-                else
-                {
-                    /* -----
-                     * not encrypted in a manner we can decrypt so 
-                     * give back the raw file (possibly buffered
-                     *
-                     * since file is released in the caller
-                     * we need another reference
-                     */
-                    KFileAddRef (file);
-                    *f = file;
-                    return 0;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/*
- * try to open the file as a regular file
- */
-static
-rc_t VFSManagerOpenFileReadRegularFile (char * pbuff, size_t z,
-                                        KFile const ** file,
-                                        const KDirectory * dir)
-{
-    rc_t rc;
-    char rbuff [8192];
-
-    assert ((pbuff) && (pbuff[0]));
-    assert (*file == NULL);
-
-    rc = KDirectoryResolvePath (dir, true, rbuff, sizeof rbuff,
-                                pbuff);
-    if (rc)
-        ; /* log? */
-    else
-    {
-        /* validate that the file system agrees the path refers
-         * to a regular file (even if through a link */
-        uint32_t type;
-
-        type = KDirectoryPathType (dir, rbuff);
-        switch (type & ~kptAlias)
-        {
-        case kptNotFound:
-            rc = RC (rcVFS, rcMgr, rcOpening, rcFile,
-                     rcNotFound);
-            break;
-
-        case kptBadPath:
-            rc = RC (rcVFS, rcMgr, rcOpening, rcFile,
-                     rcInvalid);
-            break;
-
-        case kptDir:
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-        case kptZombieFile:
-            rc = RC (rcVFS, rcMgr, rcOpening, rcFile,
-                     rcIncorrect);
-            break;
-
-        default:
-            rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcUnknown);
-            break;
-
-        case kptFile:
-            /*
-             * this is the good/successful path: open the file 
-             * as a const KFile
-             */
-            rc = KDirectoryOpenFileRead (dir, file, rbuff);
-            break;
-        }
-    }
-
-    return rc;
-}
-
-/*
- * if successful set *file to a usable KFile * and return 0
- * if unsuccessful but without error, set *file to NULL and return 0
- * if an error encountered set *file to NULL and return non-zero.
- */
-static
-rc_t VFSManagerOpenFileReadSpecial (char * pbuff, size_t z, KFile const ** file)
-{
-    rc_t rc;
-    static const char dev [] = "/dev/";
-    static const char dev_stdin [] = "/dev/stdin";
-    static const char dev_null [] = "/dev/null";
-
-    assert (pbuff);
-    assert (z);
-    assert (file);
-
-    *file = NULL;
-
-    /*
-     * Handle a few special case path names that are pre-opened
-     * 'file descriptors'
-     *
-     * This probably needs to be system specific eventually
-     *
-     * First check for the path being in the 'dev' directory in
-     * posix/unix terms
-     */
-    if (string_cmp (dev, sizeof dev - 1, pbuff, z, sizeof dev - 1) != 0)
-        rc = 0; /* we're done */
-
-    else
-    {
-        if (strcmp (dev_stdin, pbuff) == 0)
-            rc = KFileMakeStdIn (file);
-
-        else if (strcmp (dev_null, pbuff) == 0)
-            rc = KFileMakeNullRead (file);
-
-        else if (strncmp ("/dev/fd/", pbuff, sizeof "/dev/fd/" - 1) == 0)
-        {
-            char * pc;
-            size_t ix;
-
-            pc = pbuff + sizeof "/dev/fd/" - 1;
-
-            for (ix = 0; isdigit (pc[ix]); ++ix)
-                assert (ix <= z);
-
-            if ((ix > 0)&&(pc[ix] == '\0'))
-            {
-                int fd;
-
-                fd = atoi (pc);
-                rc = KFileMakeFDFileRead (file, fd);
-            }
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t VFSManagerOpenFileReadInt (const VFSManager *self,
-                                const KDirectory * dir,
-                                KFile const **f,
-                                const VPath * path,
-                                bool force_decrypt,
-                                bool * was_encrypted)
-{
-    /* -----
-     * this is a first pass that only opens files directory referenced from 
-     * the ced or have a sysdir root; that is it uses KSysDir and KSysFile
-     * only.
-     */
-    const KFile * file = NULL;
-    size_t num_read;
-    char pbuff [4096];
-    rc_t rc;
-
-    rc = VPathReadPath (path, pbuff, sizeof pbuff, &num_read);
-    if (rc)
-        ; /* log? */
-    else
-    {
-        /* -----
-         * try to open path as a special file if requested
-         *
-         * *file will be set or a usable file or to NULL and rc will reflect
-         * any error
-         */
-        rc = VFSManagerOpenFileReadSpecial (pbuff, num_read, &file);
-
-        if (rc == 0)
-        {
-            /* -----
-             * If we didn't open the file using the special
-             * logic above for special paths open the file and have no error,
-             * continue
-             */
-            if (file == NULL)
-                rc = VFSManagerOpenFileReadRegularFile (pbuff, num_read,
-                                                        &file, dir);
-            /*
-             * we either have an rc to return with or we have an open KFile:
-             * check for possible encryption that we are told to decrypt
-             */
-            if (rc == 0)
-            {
-                rc = VFSManagerOpenFileReadDecryption (self, dir, f, file, path,
-                                                       force_decrypt, was_encrypted);
-            }
-            /* release file if we are here and it is open */
-            KFileRelease (file);
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t VFSManagerOpenFileReadDirectoryRelativeInt (const VFSManager *self,
-                                                 const KDirectory * dir,
-                                                 KFile const **f,
-                                                 const VPath * path,
-                                                 bool force_decrypt,
-                                                 bool * was_encrypted)
-{
-    rc_t rc;
-
-    if (f == NULL)
-        rc = RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-    else
-    {
-        *f = NULL;
-
-        if ((f == NULL) || (path == NULL))
-            rc = RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-        else if (self == NULL)
-            rc = RC (rcVFS, rcMgr, rcOpening, rcSelf, rcNull);
-
-        else
-        {
-
-            rc = VFSManagerOpenFileReadInt (self, dir, f, path, force_decrypt, was_encrypted);
-        }
-    }
-    return rc;
-}
-
-
-/* we will create a KFile from a http or ftp url... */
-static rc_t VFSManagerOpenCurlFile ( const VFSManager *self,
-                                     KFile const **f,
-                                     const VPath * path )
-{
-    rc_t rc;
-/*    const char * url; */
-    const String * uri = NULL;
-
-    if ( f == NULL )
-        return RC( rcVFS, rcMgr, rcOpening, rcParam, rcNull );
-    *f = NULL;
-    if ( self == NULL )
-        return RC( rcVFS, rcMgr, rcOpening, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC( rcVFS, rcMgr, rcOpening, rcParam, rcNull );
-
-/*    url = path->path.addr; */
-    rc = VPathMakeString ( path, &uri );
-    if ( rc == 0 )
-    {
-        if ( self->resolver != NULL )
-        {
-            const VPath * local_cache;
-            /* find cache - vresolver call */
-            rc = VResolverCache ( self->resolver, path, &local_cache, 0 );
-            if ( rc == 0 )
-                /* we did find a place for local cache --> use it! */
-                rc = VFSManagerMakeCurlFile( self, f, uri->addr, local_cache->path.addr );
-            else
-                /* we did NOT find a place for local cache --> we are not caching! */
-                rc = VFSManagerMakeCurlFile( self, f, uri->addr, NULL );
-        }
-        else
-            rc = VFSManagerMakeCurlFile( self, f, uri->addr, NULL );
-        free( ( void * )uri );
-    }
-    return rc;
-}
-
-
-LIB_EXPORT
-rc_t CC VFSManagerOpenFileReadDirectoryRelative (const VFSManager *self,
-                                                 const KDirectory * dir,
-                                                 KFile const **f,
-                                                 const VPath * path)
-{
-    return VFSManagerOpenFileReadDirectoryRelativeInt (self, dir, f, path, false, NULL);
-}
-
-LIB_EXPORT
-rc_t CC VFSManagerOpenFileReadDirectoryRelativeDecrypt (const VFSManager *self,
-                                                        const KDirectory * dir,
-                                                        KFile const **f,
-                                                        const VPath * path) /*,
-                                                        bool force_decrypt) */
-{
-    return VFSManagerOpenFileReadDirectoryRelativeInt (self, dir, f, path, true, NULL);
-}
-
-
-static rc_t ResolveVPathByVResolver( struct VResolver * resolver, const VPath ** path )
-{
-    rc_t rc;
-
-    if ( resolver == NULL )
-        rc = RC ( rcVFS, rcFile, rcOpening, rcSRA, rcUnsupported );
-    else
-    {
-        const VPath * tpath;
-        rc = VResolverLocal ( resolver, *path, &tpath );
-        if ( rc == 0 )
-        {
-            VPathRelease ( *path );
-            *path = tpath;
-        }
-    }
-    return rc;
-}
-
-static rc_t ResolveVPathBySRAPath( const VPath ** path )
-{
-    * path = NULL;
-    return RC ( rcVFS, rcFile, rcOpening, rcSRA, rcUnsupported );
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerOpenFileRead ( const VFSManager *self,
-                                            KFile const **f,
-                                            const VPath * path_ )
-{
-    rc_t rc;
-
-    if ( f == NULL )
-        rc = RC (rcVFS, rcMgr, rcOpen, rcParam, rcNull);
-    else
-    {
-        *f = NULL;
-
-        if  (self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcOpen, rcSelf, rcNull );
-        else if ( f == NULL )
-            rc = RC ( rcVFS, rcMgr, rcOpen, rcParam, rcNull );
-        else
-        {
-            rc = VPathAddRef ( path_ );
-            if ( rc == 0 )
-            {
-                const VPath * path = path_;
-                VPUri_t uri_type = VPathGetUri_t ( path );
-
-                switch ( uri_type )
-                {
-                default:
-                case vpuri_invalid:
-                    rc = RC (rcVFS, rcFile, rcOpening, rcPath, rcInvalid);
-                    break;
-
-                case vpuri_not_supported:
-                    rc = RC (rcVFS, rcFile, rcOpening, rcPath, rcUnsupported);
-                    break;
-
-                case vpuri_ncbi_acc:
-                    if ( self->resolver != NULL )
-                        rc = ResolveVPathByVResolver( self->resolver, &path );
-                    else
-                        rc = ResolveVPathBySRAPath( &path );
-
-                    if ( rc != 0 )
-                        break;
-
-                /* !!! fall through !!! */
-
-                case vpuri_none:
-                case vpuri_ncbi_vfs:
-                case vpuri_file:
-                    rc = VFSManagerOpenFileReadDirectoryRelativeInt ( self, self->cwd, f, path, false, NULL );
-                    break;
-
-                case vpuri_ncbi_legrefseq:
-                    rc = RC ( rcVFS, rcFile, rcOpening, rcPath, rcIncorrect );
-                    break;
-
-                case vpuri_http:
-                case vpuri_ftp:
-                    rc = VFSManagerOpenCurlFile ( self, f, path );
-                    break;
-                }
-                VPathRelease (path);
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerOpenFileReadDecrypt (const VFSManager *self,
-                                                  KFile const **f,
-                                                  const VPath * path)
-{
-    return VFSManagerOpenFileReadDirectoryRelativeInt ( self, self->cwd, f, path, true, NULL );
-}
-
-LIB_EXPORT
-rc_t CC VFSManagerOpenDirectoryUpdateDirectoryRelative (const VFSManager *self,
-                                                        const KDirectory * dir,
-                                                        KDirectory **d,
-                                                        const VPath * path)
-{
-    rc_t rc;
-    VPUri_t uri_type;
-
-    if ((d == NULL) || (path == NULL))
-        return RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-    *d = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcOpening, rcSelf, rcNull);
-
-    uri_type = VPathGetUri_t ( path );
-    switch ( uri_type )
-    {
-    case vpuri_http :
-    case vpuri_ftp :
-        return RC( rcVFS, rcMgr, rcOpening, rcParam, rcWrongType );
-
-    default :
-        {
-            uint32_t type;
-
-            /* WHY NOT JUST TRY TO OPEN THE DIRECTORY,
-               AND LET KFS TELL US WHAT'S WRONG? */
-
-            type = KDirectoryPathType (dir, "%.*s", ( int ) path -> path . size, path -> path . addr );
-            switch (type & ~kptAlias)
-            {
-            case kptNotFound:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcDirectory, rcNotFound);
-                break;
-
-            case kptFile:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcDirectory, rcReadonly);
-                break;
-
-            case kptBadPath:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcDirectory, rcInvalid);
-                break;
-
-            case kptDir:
-                rc = KDirectoryOpenDirUpdate ((KDirectory*)dir, d, false, "%.*s", ( int ) path -> path . size, path -> path . addr);
-                return rc;
-
-            case kptCharDev:
-            case kptBlockDev:
-            case kptFIFO:
-            case kptZombieFile:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcDirectory, rcIncorrect);
-                break;
-
-            default:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcDirectory, rcUnknown);
-                break;
-            }
-        }
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerOpenDirectoryUpdate (const VFSManager *self,
-                                                  KDirectory **d,
-                                                  const VPath * path)
-{
-    return VFSManagerOpenDirectoryUpdateDirectoryRelative (self, self->cwd, d, path);
-}
-
-
-static
-rc_t TransformFileToDirectory(const KDirectory * dir,
-                              const KFile * file,
-                              KDirectory const **d,
-                              const char *path_str,
-                              bool was_encrypted)
-{
-    rc_t rc;
-
-    rc = KFileRandomAccess( file );
-    if (rc)
-        PLOGERR(klogErr,(klogErr, rc, "Can not use files without random access"
-                         " as database archives '$(P)'", "P=%s", path_str));
-    else
-    {
-        size_t tz;
-        char tbuff [4096];
-
-        rc = KFileReadAll (file, 0, tbuff, sizeof tbuff, &tz);
-        if ( rc )
-            LOGERR (klogErr, rc, "Error reading the head of an archive to use as a database object");
-        else
-        {
-            /* we only use KAR/SRA or tar files as archives so try to identify
-             * as our KAR/SRA file */
-            if ( KFileIsSRA( tbuff, tz ) == 0 )
-                /* if it was open it as a directory */
-                rc = KDirectoryOpenSraArchiveReadUnbounded_silent_preopened( dir, d, false, file, path_str );
-
-            else
-            {
-                rc = KDirectoryOpenTarArchiveRead_silent_preopened( dir, d, false, file, path_str );
-
-                /*
-                 * if RC here we did not have an SRA and did not have
-                 * a tar file we could use; assume the problem was decryption
-                 * if the file was encrypted
-                 */
-                if ( was_encrypted )
-                {
-                    rc = RC( rcVFS, rcEncryptionKey, rcOpening, rcEncryption,
-                             rcIncorrect );
-                    PLOGERR (klogErr, (klogErr, rc, "could not use '$(P)' as an "
-                                       "archive it was encrypted so the password"
-                                       " was possibly wrong", "P=%s", path_str));
-                }
-                else
-                    PLOGERR (klogInfo, (klogInfo, rc, "could not use '$(P)' as an "
-                                       "archive not identified as SRA or"
-                                       " TAR file", "P=%s", path_str));
-            }
-        }
-    }
-    return rc;
-}
-
-/* also handles ftp - if it cant we'll need another function */
-static
-rc_t VFSManagerOpenDirectoryReadHttp (const VFSManager *self,
-                                      const KDirectory * dir,
-                                      KDirectory const **d,
-                                      const VPath * path,
-                                      bool force_decrypt)
-{
-    rc_t rc;
-    const KFile * file = NULL;
-
-    rc = VFSManagerOpenCurlFile ( self, &file, path );
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogErr, ( klogErr, rc, "error with curl open '$(U)'",
-                             "U=%S:%S", & path -> scheme, & path -> path ) );
-    }
-    else
-    {
-        const char mountpointpath[] = "/";
-        const KDirectory * mountpoint;
-
-        rc = KQuickMountDirMake (self->cwd, &mountpoint, file,
-                                 mountpointpath, sizeof mountpointpath - 1, 
-                                 path->path.addr, path->path.size);
-        if (rc)
-        {
-            PLOGERR (klogErr, (klogErr, rc, "error creating mount "
-                               "'$(M)' for '$(F)", "M=%s,F=%S",
-                               mountpointpath, &path->path));
-        }
-        else
-        {
-            const KFile * f;
-            bool was_encrypted = false;
-
-            rc = VFSManagerOpenFileReadDecryption (self, mountpoint, &f,
-                                                   file, path,
-                                                   force_decrypt,
-                                                   &was_encrypted);
-            if (rc == 0)
-            {
-                    
-                rc = TransformFileToDirectory (mountpoint, f, d, 
-                                               path->path.addr,
-                                               was_encrypted);
-                /* hacking in the fragment bit */
-                if ((rc == 0) && (path->fragment . size > 1 ) )
-                {
-                    const KDirectory * tempd = * d;
-                    const char * fragment = path -> fragment . addr + 1;
-                    int frag_size = ( int ) path -> fragment . size - 1;
-
-                    assert ( fragment [ -1 ] == '#' );
-                        
-                    rc = KDirectoryOpenDirRead (tempd, d, false, "%.*s", frag_size, fragment );
-                    
-                    KDirectoryRelease (tempd);
-                }
-                KFileRelease (f);
-            }
-            KDirectoryRelease (mountpoint);
-        }
-        KFileRelease (file);
-    }
-    return rc;
-}
-
-
-static
-rc_t VFSManagerOpenDirectoryReadKfs (const VFSManager *self,
-                                     const KDirectory * dir,
-                                     KDirectory const **d,
-                                     const VPath * path,
-                                     bool force_decrypt)
-{
-    const KFile * file = NULL;
-    char rbuff[ 4096 ]; /* resolved path buffer */
-    rc_t rc;
-
-    assert (self);
-    assert (dir);
-    assert (d);
-    assert (path);
-    assert ((force_decrypt == false) || (force_decrypt == true));
-    assert (*d == NULL);
-
-    file = NULL;
-
-    rc = KDirectoryResolvePath( dir, true, rbuff, sizeof rbuff, "%.*s", ( int ) path -> path . size, path -> path . addr );
-    if ( rc == 0 )
-    {
-        uint32_t type;
-        bool was_encrypted;
-
-        type = KDirectoryPathType( dir, rbuff );
-        switch (type & ~kptAlias)
-        {
-        case kptNotFound:
-            rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcNotFound );
-            break;
-
-        case kptFile:
-            rc = VFSManagerOpenFileReadDirectoryRelativeInt (self, dir, 
-                                                             &file, path, 
-                                                             force_decrypt,
-                                                             &was_encrypted);
-            if (rc == 0)
-                rc = TransformFileToDirectory (dir, file, d, rbuff,
-                                               was_encrypted);
-            break;
-
-        case kptBadPath:
-            rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcInvalid );
-            break;
-
-        case kptDir:
-            rc = KDirectoryOpenDirRead( dir, d, false, rbuff );
-            return rc;
-
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-        case kptZombieFile:
-            rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcIncorrect );
-            break;
-
-        default:
-            rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcUnknown );
-            break;
-        }
-
-        /* hacking in the fragment bit */
-        /* the C grammar specifies order of precedence... */
-        if ((rc == 0) && (path->fragment.size > 1 ))
-        {
-            const KDirectory * tempd = * d;
-            const char * fragment = path -> fragment . addr + 1;
-            int frag_size = ( int ) path -> fragment . size - 1;
-
-            assert ( fragment [ -1 ] == '#' );
-            
-            rc = KDirectoryOpenDirRead (tempd, d, false, "%.*s", frag_size, fragment );
-            
-            KDirectoryRelease (tempd);
-        }
-    }
-
-    KFileRelease(file);
-
-    return rc;
-}
-
-
-static
-rc_t VFSManagerOpenDirectoryReadLegrefseq (const VFSManager *self,
-                                           const KDirectory * dir,
-                                           KDirectory const **d,
-                                           const VPath * path,
-                                           bool force_decrypt)
-{
-    const KFile * file;
-    const KDirectory * dd;
-    size_t num_read;
-    char pbuff [4096]; /* path buffer */
-    rc_t rc;
-
-    assert (self);
-    assert (dir);
-    assert (d);
-    assert (path);
-    assert ((force_decrypt == false) || (force_decrypt == true));
-    assert (*d == NULL);
-
-    file = NULL;
-    dd = NULL;
-
-    /* hier part only */
-    rc = VPathReadPath (path, pbuff, sizeof pbuff, &num_read);
-    if ( rc == 0 )
-    {
-        char rbuff[ 4096 ]; /* resolved path buffer */
-        rc = KDirectoryResolvePath( dir, true, rbuff, sizeof rbuff, pbuff );
-        if ( rc == 0 )
-        {
-            uint32_t type;
-            bool was_encrypted;
-
-            type = KDirectoryPathType( dir, rbuff );
-            switch (type & ~kptAlias)
-            {
-            case kptNotFound:
-                rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcNotFound );
-                break;
-
-            case kptFile:
-                rc = VFSManagerOpenFileReadDirectoryRelativeInt (self, dir, 
-                                                                 &file, path, 
-                                                                 force_decrypt,
-                                                                 &was_encrypted);
-                if (rc == 0)
-                    rc = TransformFileToDirectory (dir, file, &dd, rbuff,
-                                                   was_encrypted);
-                break;
-
-            case kptBadPath:
-                rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcInvalid );
-                break;
-
-            case kptDir:
-                rc = KDirectoryOpenDirRead( dir, &dd, false, rbuff );
-                break;
-
-            case kptCharDev:
-            case kptBlockDev:
-            case kptFIFO:
-            case kptZombieFile:
-                rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcIncorrect );
-                break;
-
-            default:
-                rc = RC( rcVFS, rcMgr, rcOpening, rcDirectory, rcUnknown );
-                break;
-            }
-
-            if (rc == 0)
-            {
-                if ( path -> fragment . size < 2 )
-                    rc = RC( rcVFS, rcMgr, rcOpening, rcPath, rcIncorrect );
-                else
-                {
-                    const char *fragment = path -> fragment . addr + 1;
-                    int frag_size = ( int ) path -> fragment . size - 1;
-                    assert ( fragment [ -1 ] == '#' );
-
-                    rc = KDirectoryOpenDirRead (dd, d, false, "%.*s", frag_size, fragment );
-
-                    KDirectoryRelease (dd);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t VFSManagerOpenDirectoryReadDirectoryRelativeInt (const VFSManager *self,
-                                                      const KDirectory * dir,
-                                                      KDirectory const **d,
-                                                      const VPath * path_,
-                                                      bool force_decrypt)
-{
-    rc_t rc;
-    do 
-    {
-        if (d == NULL)
-        {
-            rc =  RC (rcVFS, rcDirectory, rcOpening, rcParam, rcNull);
-            break;
-        }
-
-        *d = NULL;
-
-        if (self == NULL)
-        {
-            rc = RC (rcVFS, rcDirectory, rcOpening, rcSelf, rcNull);
-            break;
-        }
-
-        if ((dir == NULL) || (path_ == NULL))
-        {
-            rc = RC (rcVFS, rcDirectory, rcOpening, rcParam, rcNull);
-            break;
-        }
-
-        if ((force_decrypt != false) && (force_decrypt != true))
-        {
-            rc = RC (rcVFS, rcDirectory, rcOpening, rcParam, rcInvalid);
-            break;
-        }
-
-        rc = VPathAddRef (path_);
-        if ( rc )
-            break;
-        else
-        {
-            const VPath *path = path_;
-            VPUri_t uri_type = VPathGetUri_t ( path );
-
-            switch ( uri_type )
-            {
-            default:
-            case vpuri_invalid:
-                rc = RC (rcVFS, rcDirectory, rcOpening, rcPath, rcInvalid);
-                break;
-
-
-            case vpuri_not_supported:
-                rc = RC (rcVFS, rcDirectory, rcOpening, rcPath, rcUnsupported);
-                break;
-
-            case vpuri_ncbi_acc:
-                if ( self->resolver != NULL )
-                    rc = ResolveVPathByVResolver( self->resolver, &path );
-                else
-                    rc = ResolveVPathBySRAPath( &path );
-                if ( rc != 0 )
-                    break;
-
-            /* !!! fall through !!! */
-
-            case vpuri_none:
-            case vpuri_ncbi_vfs:
-            case vpuri_file:
-                rc = VFSManagerOpenDirectoryReadKfs ( self, dir, d, path, force_decrypt );
-                break;
-
-            case vpuri_ncbi_legrefseq:
-                rc = VFSManagerOpenDirectoryReadLegrefseq ( self, dir, d, path, force_decrypt );
-                break;
-
-            case vpuri_http:
-            case vpuri_ftp:
-                rc = VFSManagerOpenDirectoryReadHttp ( self, dir, d, path, force_decrypt );
-                break;
-            }
-            VPathRelease ( path ); /* same as path_ if not uri */
-        }
-    } while (0);
-    return rc;
-}
-
-
-LIB_EXPORT 
-rc_t CC VFSManagerOpenDirectoryReadDirectoryRelative (const VFSManager *self,
-                                                      const KDirectory * dir,
-                                                      KDirectory const **d,
-                                                      const VPath * path)
-{
-    return VFSManagerOpenDirectoryReadDirectoryRelativeInt (self, dir, d, path, false);
-}
-
-
-LIB_EXPORT 
-rc_t CC VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt (const VFSManager *self,
-                                                             const KDirectory * dir,
-                                                             KDirectory const **d,
-                                                             const VPath * path)
-{
-    return VFSManagerOpenDirectoryReadDirectoryRelativeInt (self, dir, d, path, true);
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerOpenDirectoryReadDecrypt (const VFSManager *self,
-                                                       KDirectory const **d,
-                                                       const VPath * path)
-{
-    return VFSManagerOpenDirectoryReadDirectoryRelativeInt (self, self->cwd, d, path, true);
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerOpenDirectoryRead (const VFSManager *self,
-                                                KDirectory const **d,
-                                                const VPath * path)
-{
-    return VFSManagerOpenDirectoryReadDirectoryRelativeInt (self, self->cwd, d, path, false);
-}
-
-
-/* OpenFileWrite
- *  opens an existing file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target file
- */
-LIB_EXPORT rc_t CC VFSManagerOpenFileWrite (const VFSManager *self,
-                                            KFile **f, bool update,
-                                            const VPath * path )
-{
-    /* -----
-     * this is a first pass that only opens files directory referenced from 
-     * the ced or have a sysdir root; that is it uses KSysDir and KSysFile
-     * only.
-     */
-    KFile * file = NULL;
-    size_t num_read;
-    char pbuff [4096];
-    rc_t rc;
-
-    if ((f == NULL) || (path == NULL))
-        return RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-    *f = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcOpening, rcSelf, rcNull);
-
-    rc = VPathReadPath (path, pbuff, sizeof pbuff, &num_read);
-    if (rc == 0)
-    {
-        /* handle a few special case path names
-         * This probably needs to be system specifica eventually
-         */
-        if (strncmp ("/dev/", pbuff, sizeof "/dev/" - 1) == 0)
-        {
-
-            if (strcmp ("/dev/stdout", pbuff) == 0)
-                rc = KFileMakeStdOut (&file);
-            else if (strcmp ("/dev/stderr", pbuff) == 0)
-                rc = KFileMakeStdErr (&file);
-            else if (strcmp ("/dev/null", pbuff) == 0)
-                rc = KFileMakeNullUpdate (&file);
-            else if (strncmp ("/dev/fd/", pbuff, sizeof "/dev/fd/" - 1) == 0)
-            {
-                char * pc;
-                size_t ix;
-
-                pc = pbuff + sizeof "/dev/fd/" - 1;
-
-                for (ix = 0; isdigit (pc[ix]); ++ix)
-                    ;
-
-                if ((ix > 0)&&(pc[ix] == '\0'))
-                {
-                    int fd = atoi (pc);
-
-                    rc = KFileMakeFDFileWrite (&file, update, fd);
-                }
-            }
-        }
-        if ((rc == 0)&&(file == NULL))
-        {
-            char rbuff [4096];
-
-            rc = KDirectoryResolvePath (self->cwd, true, rbuff, sizeof rbuff, pbuff);
-            if (rc == 0)
-            {
-                uint32_t type;
-
-                type = KDirectoryPathType (self->cwd, rbuff);
-                switch (type & ~kptAlias)
-                {
-                case kptNotFound:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcNotFound);
-                    break;
-
-                case kptFile:
-                    rc = KDirectoryOpenFileWrite (self->cwd, &file, update, rbuff);
-                    break;
-
-                case kptBadPath:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcInvalid);
-                    break;
-                case kptDir:
-                case kptCharDev:
-                case kptBlockDev:
-                case kptFIFO:
-                case kptZombieFile:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcIncorrect);
-                    break;
-
-                default:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcUnknown);
-                    break;
-                }
-            }
-        }
-    }
-    if (rc == 0)
-    {
-        size_t z;
-        char obuff [VFS_KRYPTO_PASSWORD_MAX_SIZE+2];
-
-        if (VPathOption (path, vpopt_encrypted, obuff, sizeof obuff, &z) == 0)
-        {
-            rc = GetEncryptionKey(self, path, obuff, sizeof(obuff), &z);
-            if (rc == 0)
-            {
-                KKey key;
-                KFile * encfile;
-            
-                rc = KKeyInitUpdate (&key, kkeyAES128, obuff, z);
-                if (rc == 0)
-                {
-                    rc = KEncFileMakeWrite (&encfile, file, &key);
-                    if (rc == 0)
-                    {
-                        KFileRelease (file); /* owned by encfile now */
-                        *f = encfile;
-                        return 0;
-                    }
-                }
-            }
-            if (rc)
-                KFileRelease (file);
-        }
-        else
-        {
-            *f = file;
-            return 0;
-        }
-    }
-    return rc;
-}
-
-
-/* CreateFile
- *  opens a file with write access
- *
- *  "f" [ OUT ] - return parameter for newly opened file
- *
- *  "update" [ IN ] - if true, open in read/write mode
- *  otherwise, open in write-only mode
- *
- *  "access" [ IN ] - standard Unix access mode, e.g. 0664
- *
- *  "mode" [ IN ] - a creation mode ( see explanation above ).
- *
- *  "path" [ IN ] VPath representing the path, URL or URN of the desired file
- */
-LIB_EXPORT rc_t CC VFSManagerCreateFile ( const VFSManager *self, KFile **f,
-                                          bool update, uint32_t access, KCreateMode mode, const VPath * path )
-{
-    /* -----
-     * this is a first pass that only opens files directory referenced from 
-     * the ced or have a sysdir root; that is it uses KSysDir and KSysFile
-     * only.
-     */
-    KFile * file = NULL;
-    size_t num_read;
-    rc_t rc;
-    bool file_created = false;
-    char pbuff [4096];
-    char rbuff [4096];
-
-    if ((f == NULL) || (path == NULL))
-        return RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-    *f = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcOpening, rcSelf, rcNull);
-
-    rc = VPathReadPath (path, pbuff, sizeof pbuff, &num_read);
-    if (rc == 0)
-    {
-
-        /* handle a few special case path names
-         * This probably needs to be system specifica eventually
-         */
-        if (strncmp ("/dev/", pbuff, sizeof "/dev/" - 1) == 0)
-        {
-
-            if (strcmp ("/dev/stdout", pbuff) == 0)
-                rc = KFileMakeStdOut (&file);
-            else if (strcmp ("/dev/stderr", pbuff) == 0)
-                rc = KFileMakeStdErr (&file);
-            else if (strcmp ("/dev/null", pbuff) == 0)
-                rc = KFileMakeNullUpdate (&file);
-            else if (strncmp ("/dev/fd/", pbuff, sizeof "/dev/fd/" - 1) == 0)
-            {
-                char * pc;
-                size_t ix;
-
-                pc = pbuff + sizeof "/dev/fd/" - 1;
-
-                for (ix = 0; isdigit (pc[ix]); ++ix)
-                    ;
-
-                if ((ix > 0)&&(pc[ix] == '\0'))
-                {
-                    int fd = atoi (pc);
-
-                    rc = KFileMakeFDFileWrite (&file, update, fd);
-                }
-            }
-        }
-        if ((rc == 0)&&(file == NULL))
-        {
-            rc = KDirectoryResolvePath (self->cwd, true, rbuff, sizeof rbuff, pbuff);
-            if (rc == 0)
-            {
-                uint32_t type;
-
-                type = KDirectoryPathType (self->cwd, rbuff);
-                switch (type & ~kptAlias)
-                {
-                case kptNotFound:
-                case kptFile:
-                    rc = KDirectoryCreateFile (self->cwd, &file, update, access, mode,
-                                               rbuff);
-                    if (rc == 0)
-                        file_created = true;
-                    break;
-
-                case kptBadPath:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcInvalid);
-                    break;
-                case kptDir:
-                case kptCharDev:
-                case kptBlockDev:
-                case kptFIFO:
-                case kptZombieFile:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcIncorrect);
-                    break;
-
-                default:
-                    rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcUnknown);
-                    break;
-                }
-            }
-        }
-    }
-    if (rc == 0)
-    {
-        size_t z;
-        char obuff [VFS_KRYPTO_PASSWORD_MAX_SIZE+2];
-
-        if (VPathOption (path, vpopt_encrypted, obuff, sizeof obuff, &z) == 0)
-        {
-            rc = GetEncryptionKey(self, path, obuff, sizeof(obuff), &z);
-            if (rc == 0)
-            {
-                KKey key;
-                KFile * encfile;
-                rc = KKeyInitUpdate (&key, kkeyAES128, obuff, z);
-
-                obuff[z] = '\0';
-
-                rc = KEncFileMakeWrite (&encfile, file, &key);
-                if (rc == 0)
-                {
-                    KFileRelease (file); /* now owned by encfile */
-                    *f = encfile;
-                    return 0;   
-                }
-            }
-            if (rc)
-                KFileRelease (file);
-        }
-        else
-        {
-            *f = file;
-            return 0;
-        }
-    }
-    if (rc && file_created)
-        KDirectoryRemove (self->cwd, true, rbuff);
-    return rc;
-}
-
-
-/* Remove
- *  remove an accessible object from its directory
- *
- *  "force" [ IN ] - if true and target is a directory,
- *  remove recursively
- *
- *  "path" [ IN ] - NUL terminated string in directory-native
- *  character set denoting target object
- */
-LIB_EXPORT rc_t CC VFSManagerRemove ( const VFSManager *self, bool force,
-                                      const VPath * path )
-{
-    /* -----
-     * this is a first pass that only opens files directory referenced from 
-     * the ced or have a sysdir root; that is it uses KSysDir and KSysFile
-     * only.
-     */
-    size_t num_read;
-    char pbuff [4096];
-    rc_t rc;
-
-    if (path == NULL)
-        return RC (rcVFS, rcMgr, rcOpening, rcParam, rcNull);
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcOpening, rcSelf, rcNull);
-
-    rc = VPathReadPath (path, pbuff, sizeof pbuff, &num_read);
-    if (rc == 0)
-    {
-        char rbuff [4096];
-    
-        rc = KDirectoryResolvePath (self->cwd, true, rbuff, sizeof rbuff, pbuff);
-        if (rc == 0)
-        {
-            uint32_t type;
-
-            type = KDirectoryPathType (self->cwd, rbuff);
-            switch (type & ~kptAlias)
-            {
-            case kptNotFound:
-                break;
-
-            case kptFile:
-            case kptDir:
-            case kptCharDev:
-            case kptBlockDev:
-            case kptFIFO:
-            case kptZombieFile:
-                rc = KDirectoryRemove (self->cwd, force, rbuff);
-                break;
-
-            case kptBadPath:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcInvalid);
-                break;
-/*                 rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcIncorrect); */
-/*                 break; */
-
-            default:
-                rc = RC (rcVFS, rcMgr, rcOpening, rcFile, rcUnknown);
-                break;
-            }
-        }
-    }
-    return rc;
-}
-
-/* Make
- */
-LIB_EXPORT rc_t CC VFSManagerMake ( VFSManager ** pmanager ) {
-    return VFSManagerMakeFromKfg(pmanager, NULL);
-}
-
-/* Make
- */
-LIB_EXPORT rc_t CC VFSManagerMakeFromKfg ( struct VFSManager ** pmanager,
-    struct KConfig * cfg)
-{
-    rc_t rc;
-
-    if (pmanager == NULL)
-        return RC (rcVFS, rcMgr, rcConstructing, rcParam, rcNull);
-
-    *pmanager = singleton;
-    if (singleton != NULL)
-    {
-        rc = VFSManagerAddRef ( singleton );
-        if ( rc != 0 )
-            *pmanager = NULL;
-    }
-    else
-    {
-        VFSManager * obj;
-
-        obj = calloc (1, sizeof (*obj));
-        if (obj == NULL)
-            rc = RC (rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted);
-        else
-        {
-            KRefcountInit (&obj->refcount, 1, kfsmanager_classname, "init", 
-                           kfsmanager_classname);
-
-            rc = KDirectoryNativeDir (&obj->cwd);
-            if (rc == 0)
-            {
-                {
-                    if (cfg == NULL) {
-                        rc = KConfigMake (&obj->cfg, NULL);
-                    }
-                    else {
-                        rc = KConfigAddRef(cfg);
-                        if (rc == 0) {
-                            obj->cfg = cfg;
-                        }
-                    }
-                    if ( rc == 0 )
-                    {
-                        rc = KCipherManagerMake (&obj->cipher);
-                        if ( rc == 0 )
-                        {
-                            rc = KKeyStoreMake ( &obj->keystore, obj->cfg );
-                            if ( rc == 0 )
-                            {
-                                rc = VFSManagerMakeResolver ( obj, &obj->resolver, obj->cfg );
-                                if ( rc != 0 )
-                                {
-                                    LOGERR ( klogWarn, rc, "could not build vfs-resolver" );
-                                    rc = 0;
-                                }
-
-                                *pmanager = singleton = obj;
-                                return rc;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        VFSManagerDestroy (obj);
-    }
-    return rc;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerGetCWD (const VFSManager * self, KDirectory ** cwd)
-{
-    rc_t rc;
-
-    if (cwd == NULL)
-        return RC (rcVFS, rcMgr, rcAccessing, rcParam, rcNull);
-
-    *cwd = NULL;
-
-    if (self == NULL)
-        return RC (rcVFS, rcMgr, rcAccessing, rcSelf, rcNull);
-
-    rc = KDirectoryAddRef ( self->cwd );
-    if (rc)
-        return rc;
-
-    *cwd = self->cwd;
-
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerGetResolver ( const VFSManager * self, struct VResolver ** resolver )
-{
-    if ( resolver == NULL )
-        return RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcNull );
-
-    *resolver = NULL;
-
-    if ( self == NULL )
-        return RC ( rcVFS, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    if ( self->resolver )
-    {
-        rc_t rc = VResolverAddRef ( self->resolver );
-        if ( rc != 0 )
-            return rc;
-    }
-    *resolver = self->resolver;
-    return 0;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerGetKryptoPassword (const VFSManager * self,
-                                                char * password,
-                                                size_t max_size,
-                                                size_t * size)
-{
-    rc_t rc;
-
-    if (self == NULL)
-        rc = RC (rcVFS, rcMgr, rcAccessing, rcSelf, rcNull);
-
-    else if ((password == NULL) || (max_size == 0) || (size == NULL))
-        rc = RC (rcVFS, rcMgr, rcAccessing, rcParam, rcNull);
-
-    else
-    {
-        size_t z;
-        char obuff [4096 + 16];
-
-        rc = VFSManagerGetConfigPWFile(self, obuff, sizeof obuff, &z);
-        if (rc == 0)
-        {
-            VPath * vpath;
-            rc_t rc2;
-            rc = VPathMake (&vpath, obuff);
-            if (rc == 0)
-                rc = GetEncryptionKey(self, vpath, password, max_size, size);
-            rc2 = VPathRelease (vpath);
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerUpdateKryptoPassword (const VFSManager * self, 
-                                                   const char * password,
-                                                   size_t size,
-                                                   char * pwd_dir,
-                                                   size_t pwd_dir_size)
-{
-    static const char temp_extension [] = ".tmp";
-    rc_t rc;
-
-    if (self == NULL)
-        rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcSelf, rcNull);
-
-    else if ((password == NULL) || (size == 0))
-        rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcParam, rcNull);
-
-    else if (size > VFS_KRYPTO_PASSWORD_MAX_SIZE)
-        rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcSize, rcExcessive);
-
-    else if ((string_chr (password, size, '\n') != NULL) ||
-             (string_chr (password, size, '\r') != NULL))
-        rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcEncryptionKey, rcInvalid);
-
-    else
-    {
-        size_t old_password_file_size;
-        char old_password_file [8193];
-        
-        rc = VFSManagerGetConfigPWFile (self, old_password_file,
-                                        sizeof old_password_file - 1,
-                                        &old_password_file_size);
-        if (rc) {
-            if (rc ==
-                SILENT_RC(rcKrypto, rcMgr, rcReading, rcBuffer, rcInsufficient))
-            {
-                rc =
-                    RC(rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcExcessive);
-            }
-            LOGERR (klogErr, rc, "failed to obtain configured path for password file");
-        }
-
-        else if (old_password_file_size >= (sizeof old_password_file - 1))
-        {
-            rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcExcessive);
-            PLOGERR (klogErr,
-                     (klogErr, rc, "configured path too long for function "
-                      "'$(P)' '${F}'", "P=%s,F=%s",
-                      old_password_file, __func__));
-        }
-        else
-        {
-            KPathType ftype;
-            bool old_exists;
-
-            old_password_file[old_password_file_size] = '\0';
-            ftype = KDirectoryPathType (self->cwd, old_password_file);
-
-            switch (ftype)
-            {
-            case kptNotFound:
-                old_exists = false;
-                break;
-
-            case kptBadPath:
-                rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcInvalid);
-                break;
-
-            case kptFile:
-                old_exists = true;
-                break;
-
-            case kptDir:
-            case kptCharDev:
-            case kptBlockDev:
-            case kptFIFO:
-            case kptZombieFile:
-            case kptDataset:
-            case kptDatatype:
-                rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcIncorrect);
-                break;
-
-            default:
-                rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcPath, rcCorrupt);
-                break;
-            }
-
-            if (rc)
-                PLOGERR (klogErr,
-                         (klogErr, rc, "cannot use configured path for "
-                          "password file '$(P)'", "P=%s", old_password_file));
-
-            else
-            {
-                VPath * vold;
-                size_t new_password_file_size;
-                char new_password_file [sizeof old_password_file + sizeof temp_extension];
-                size_t password_dir_size;
-                char password_dir [sizeof old_password_file];
-/*                 bool save_old_password; */
-                char * pc;
-
-                memcpy (password_dir, old_password_file, old_password_file_size);
-                memcpy (new_password_file, old_password_file, old_password_file_size);
-                memcpy (new_password_file + old_password_file_size, temp_extension, sizeof temp_extension);
-                new_password_file_size = old_password_file_size + sizeof temp_extension - 1;
-
-                pc = string_rchr (password_dir, old_password_file_size, '/');
-                if (pc == NULL)
-                {
-                    password_dir[0] = '.';
-                    pc = password_dir+1;
-                }
-                *pc = '\0';
-                password_dir_size = pc - password_dir;
-
-                if (pwd_dir && pwd_dir_size) {
-                    size_t n = string_copy(pwd_dir, pwd_dir_size,
-                                           password_dir, password_dir_size + 1);
-                    if (n >= pwd_dir_size) {
-                        int i = 0;
-                        size_t p = pwd_dir_size - 1;
-                        pwd_dir[p] = '\0';
-                        for (i = 0; i < 3; ++i) {
-                            if (p == 0)
-                            {   break; }
-                            pwd_dir[--p] = '.';
-                        }
-                        if (p != 0)
-                        {   pwd_dir[--p] = ' '; }
-                    }
-                }
-
-                rc = VPathMake (&vold, old_password_file);
-                if (rc)
-                    PLOGERR (klogErr,
-                             (klogErr, rc, "could not create vpath for "
-                              "password file '$(P)'", "P=%s",
-                              old_password_file));
-
-                else
-                {
-                    VPath * vnew;
-
-                    rc = VPathMake (&vnew, new_password_file);
-                    if (rc)
-                        PLOGERR (klogErr,
-                                 (klogErr, rc, "could not create vpath for "
-                                  "password file '$(P)'", "P=%s",
-                                  new_password_file));
-
-                    else
-                    {
-                        const KFile * fold = NULL;
-                        KFile * fnew = NULL;
-
-                        if (old_exists)
-                        {
-                            rc = VFSManagerOpenFileRead (self, &fold, vold);
-
-                            if (rc)
-                                PLOGERR (klogErr,
-                                         (klogErr, rc, "unable to open existing "
-                                          "password file '$(P)'", "P=%s",
-                                          old_password_file));
-                        }
-                        
-
-                        if (rc == 0)
-                        {
-                            rc = VFSManagerCreateFile (self, &fnew, false, 0600,
-                                                       kcmInit|kcmParents,
-                                                       vnew);
-                            if (rc)
-                                PLOGERR (klogErr,
-                                         (klogErr, rc, "unable to open temporary "
-                                          "password file '$(P)'", "P=%s",
-                                          new_password_file));
-
-                            else
-                            {
-                                uint64_t writ;
-                                size_t this_writ;
-
-                                rc = KFileWriteAll (fnew, 0, password, size, &this_writ);
-                                if (rc)
-                                    PLOGERR (klogErr,
-                                             (klogErr, rc, "unable to write "
-                                              "password to temporary password "
-                                              "file '$(P)'", "P=%s",
-                                              new_password_file));
-
-                                else if (this_writ != size)
-                                {
-                                    rc = RC (rcVFS, rcEncryptionKey, rcWriting,
-                                             rcFile, rcInsufficient);
-                                    PLOGERR (klogErr,
-                                             (klogErr, rc, "unable to write complete "
-                                              "password to temporary password "
-                                              "file '$(P)'", "P=%s",
-                                              new_password_file));
-                                }
-
-                                else
-                                {
-                                    writ = this_writ;
-
-                                    rc = KFileWriteAll (fnew, this_writ, "\n", 1, &this_writ);
-                                    if (rc)
-                                        PLOGERR (klogErr,
-                                                 (klogErr, rc, "unable to write "
-                                                  "password to temporary password "
-                                                  "file '$(P)'", "P=%s",
-                                                  new_password_file));
-
-                                    else if (this_writ != 1)
-                                    {
-                                        rc = RC (rcVFS, rcEncryptionKey, rcWriting,
-                                                 rcFile, rcInsufficient);
-                                        PLOGERR (klogErr,
-                                                 (klogErr, rc, "unable to write complete "
-                                                  "password to temporary password "
-                                                  "file '$(P)'", "P=%s",
-                                                  new_password_file));
-                                    }
-
-                                    else
-                                    {
-                                        bool do_rename;
-
-                                        do_rename = true;
-                                        ++writ;
-
-                                        if (old_exists)
-                                        {
-                                            uint64_t read;
-                                            size_t this_read;
-                                            char buffer [VFS_KRYPTO_PASSWORD_MAX_SIZE+4];
-
-                                            rc = KFileReadAll (fold, 0, buffer,
-                                                               sizeof buffer, &this_read);
-                                            if (rc)
-                                                ;
-
-                                            else
-                                            {
-                                                read = this_read;
-                                                /* look for duplicated password */
-                                                if (read > size)
-                                                {
-                                                    char cc;
-
-                                                    cc = buffer[size];
-                                                    if (((cc == '\n') || (cc == '\r')) &&
-                                                        (memcmp (buffer, password, size) == 0))
-                                                    {
-                                                        do_rename = false;
-                                                    }
-                                                }
-                                                if (read)
-                                                    rc = KFileWriteAll (fnew, writ, buffer, read, &this_writ);
-
-                                                if (rc)
-                                                    ;
-                                                else if (do_rename)
-                                                {
-                                                    writ += this_writ;
-
-                                                    do
-                                                    {
-                                                        rc = KFileReadAll (fold, read, buffer,
-                                                                           sizeof buffer, &this_read);
-                                                        if (rc)
-                                                            ;
-
-                                                        else if (this_read == 0)
-                                                            break;
-
-                                                        else
-                                                        {
-                                                            rc = KFileWriteAll (fnew, writ, buffer,
-                                                                                this_read, &this_writ);
-                                                            if (rc)
-                                                                ;
-
-                                                            else if (this_read != this_writ)
-                                                            {
-                                                                rc = RC (rcVFS, rcEncryptionKey, rcWriting,
-                                                                         rcFile, rcInsufficient);
-                                                                PLOGERR (klogErr,
-                                                                         (klogErr, rc,
-                                                                          "unable to write complete "
-                                                                          "password to temporary password "
-                                                                          "file '$(P)'", "P=%s",
-                                                                          new_password_file));
-                                                            }
-
-                                                            else
-                                                            {
-                                                                read += this_read;
-                                                                writ += this_writ;
-                                                            }
-                                                        }
-                                                    } while (rc == 0);
-                                                }
-                                            }
-                                            KFileRelease (fold);
-                                            fold = NULL;
-                                        }
-
-                                        KFileRelease (fnew);
-                                        fnew = NULL;
-
-                                        if (rc == 0)
-                                        {
-                                            if (do_rename)
-                                            {
-                                                rc = KDirectoryRename (self->cwd, true, 
-                                                                       new_password_file,
-                                                                       old_password_file);
-                                            }
-                                            else
-                                            {
-                                                KDirectoryRemove (self->cwd, true, new_password_file);
-                                            }
-
-#if !WINDOWS
-                                            if (rc == 0)
-                                            {
-                                                uint32_t access;
-
-                                                rc = KDirectoryAccess (self->cwd,
-                                                                       &access, password_dir);
-                                                if (rc)
-                                                    ;
-
-                                                else
-                                                {
-                                                    if (access & 0027)
-                                                        rc = RC (rcVFS, rcEncryptionKey, rcUpdating, rcDirectory, rcExcessive);
-                                                }
-                                            }
-#endif
-                                        }
-                                    }
-                                }
-                                KFileRelease (fnew);
-                            }
-                            KFileRelease (fold);
-                        }
-                        VPathRelease (vold);
-                    }
-                    VPathRelease (vnew);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * KConfig
- *  placing some KConfig code that relies upon VFS here
- */
-
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfig object
- * path [ IN ] - path to the node
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigReadVPath ( struct KConfig const* self, const char* path, struct VPath** result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        struct KConfigNode const *n;
-        rc = KConfigOpenNodeRead ( self, & n, path );
-        if ( rc == 0 )
-        {
-            rc = KConfigNodeReadVPath ( n, result );
-            KConfigNodeRelease ( n );
-            return rc;
-        }
-
-        * result = NULL;
-    }
-
-    return rc;
-}
-
-/* ReadVPath
- *  read a VPath node value
- *
- * self [ IN ] - KConfigNode object
- * result [ OUT ] - return value (rc != 0 if cannot be converted)
- *
- */
-LIB_EXPORT rc_t CC KConfigNodeReadVPath ( struct KConfigNode const *self, struct VPath** result )
-{
-    rc_t rc;
-
-    if ( result == NULL )
-        rc = RC ( rcKFG, rcNode, rcReading, rcParam, rcNull );
-    else
-    {
-        char buffer [ 4096 ];
-        size_t num_read, to_read;
-        rc = KConfigNodeRead ( self, 0, buffer, sizeof buffer, & num_read, & to_read );
-        if ( rc == 0 )
-        {
-            char *p;
-
-            if ( to_read == 0 && num_read < sizeof buffer )
-            {
-                buffer [ num_read ] = 0;
-                return VPathMake ( result, buffer );
-            }
-
-            p = malloc ( num_read + to_read + 1 );
-            if ( p == NULL )
-                rc = RC ( rcKFG, rcNode, rcReading, rcMemory, rcExhausted );
-            else
-            {
-                rc = KConfigNodeRead ( self, 0, p, num_read + to_read + 1, & num_read, & to_read );
-                if ( rc == 0 )
-                {
-                    p [ num_read ] = 0;
-                    rc = VPathMake ( result, p );
-                }
-
-                free ( p );
-                return rc;
-            }
-        }
-
-        * result = NULL;
-    }
-
-    return rc;
-}
-
-
-static rc_t VFSManagerResolveAcc( const VFSManager * self,
-                                  const struct VPath * source,
-                                  struct VPath ** path_to_build,
-                                  const struct KFile ** remote_file,
-                                  const struct VPath ** local_cache )
-{
-    rc_t rc;
-    const VPath * local, * remote;
-    
-    assert (self);
-    assert (source);
-    assert (path_to_build);
-    assert (remote_file);
-    assert (local_cache);
-
-#if 1
-    rc = VResolverQuery ( self -> resolver, eProtocolHttp, source, & local, & remote, local_cache );
-    if ( rc == 0 )
-    {
-        assert ( local != NULL || remote != NULL );
-        assert ( local == NULL || remote == NULL );
-        * path_to_build = ( VPath* ) ( ( local != NULL ) ? local : remote );
-    }
-#else
-
-    /* first try to find it localy */
-    rc = VResolverLocal ( self->resolver, source, (const VPath **)path_to_build );
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        /* if not found localy, try to find it remotely */
-        rc = VResolverRemote ( self->resolver, eProtocolHttp,
-            source, (const VPath **)path_to_build, remote_file );
-        if ( rc == 0 && remote_file != NULL && local_cache != NULL )
-        {
-            /* if found and the caller wants to know the location of a local cache file... */
-            uint64_t size_of_remote_file = 0;
-            if ( *remote_file != NULL )
-                rc = KFileSize ( *remote_file, &size_of_remote_file );
-            if ( rc ==  0 )
-                rc = VResolverCache ( self->resolver, *path_to_build, local_cache, size_of_remote_file );
-        }
-    }
-
-#endif
-    return rc;
-}
-
-
-static rc_t VFSManagerResolveLocal( const VFSManager * self,
-                                    const char * local_path,
-                                    struct VPath ** path_to_build )
-{
-    assert ( self != NULL );
-    assert ( local_path != NULL && local_path [ 0 ] != 0 );
-    assert ( path_to_build != NULL );
-
-    return VFSManagerMakePath ( self, path_to_build, "ncbi-file:%s", local_path );
-}
-
-static rc_t VFSManagerResolvePathOrAcc( const VFSManager * self,
-                                        const struct VPath * source,
-                                        struct VPath ** path_to_build,
-                                        const struct KFile ** remote_file,
-                                        const struct VPath ** local_cache,
-                                        bool resolve_acc )
-{
-    char buffer[ 4096 ];
-    size_t num_read;
-    rc_t rc = VPathReadPath ( source, buffer, sizeof buffer, &num_read );
-    if ( rc == 0 && num_read > 0 )
-    {
-        char * pos_of_slash = string_chr ( buffer, string_size( buffer ), '/' );
-        if ( pos_of_slash != NULL )
-        {
-            /* we can now assume that the source is a filesystem-path :
-               we build a new VPath and prepend with 'ncbi-file:' */
-            rc = VFSManagerResolveLocal( self, buffer, path_to_build );
-        }
-        else if ( resolve_acc )
-        {
-            /* we assume the source is an accession! */
-            rc = VFSManagerResolveAcc( self, source, path_to_build, remote_file, local_cache );
-            if ( GetRCState( rc ) == rcNotFound )
-            {
-                /* if we were not able to find the source as accession, we assume it is a local path */
-                rc = VFSManagerResolveLocal( self, buffer, path_to_build );
-            }
-        }
-        else
-        {
-            rc = RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcInvalid );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t VFSManagerResolveRemote( const VFSManager * self,
-                                     struct VPath ** source,
-                                     struct VPath ** path_to_build,
-                                     const struct KFile ** remote_file,
-                                     const struct VPath ** local_cache )
-{
-    rc_t rc = 0;
-    *path_to_build = *source;
-    if ( local_cache != NULL && remote_file != NULL && self->resolver != NULL )
-    {
-
-/*        VFS_EXTERN rc_t CC VPathMakeString ( const VPath * self, const String ** uri ); */
-        char full_url[ 4096 ];
-        size_t num_read;
-        rc = VPathReadPath ( *source, full_url, sizeof full_url, &num_read );
-        if ( rc == 0 && num_read > 0 )
-        {
-            rc = KCurlFileMake ( remote_file, full_url, false );
-            if ( rc == 0 )
-            {
-                uint64_t size_of_remote_file = 0;
-                rc = KFileSize ( *remote_file, &size_of_remote_file );
-                if ( rc == 0 )
-                    rc = VResolverCache ( self->resolver, *source, local_cache, size_of_remote_file );
-            }
-        }
-    }
-    *source = NULL;
-    return rc;
-}
-
-/* DEPRECATED */
-LIB_EXPORT rc_t CC VFSManagerResolveSpec ( const VFSManager * self,
-                                           const char * spec,
-                                           struct VPath ** path_to_build,
-                                           const struct KFile ** remote_file,
-                                           const struct VPath ** local_cache,
-                                           bool resolve_acc )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC ( rcVFS, rcMgr, rcAccessing, rcSelf, rcNull );
-    else if ( spec == NULL || path_to_build == NULL )
-        rc = RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcNull );
-    else if ( spec[ 0 ] == 0 )
-        rc = RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcEmpty );
-    else
-    {
-        VPath * temp;
-        *path_to_build = NULL;
-        if ( local_cache != NULL )
-            *local_cache = NULL;
-        if ( remote_file != NULL ) 
-            *remote_file = NULL;
-        rc = VPathMake ( &temp, spec );
-        if ( rc == 0 )
-        {
-            VPUri_t uri_type;
-            rc = VPathGetScheme_t( temp, &uri_type );
-            if ( rc == 0 )
-            {
-                switch ( uri_type )
-                {
-                default                  : /* !! fall through !! */
-                case vpuri_invalid       : rc = RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcInvalid );
-                                           break;
-
-                case vpuri_none          : /* !! fall through !! */
-                case vpuri_not_supported : rc = VFSManagerResolvePathOrAcc( self, temp, path_to_build, remote_file, local_cache, resolve_acc );
-                                           break;
-
-                case vpuri_ncbi_vfs      : /* !! fall through !! */
-                case vpuri_file          : *path_to_build = temp;
-                                           temp = NULL;
-                                           break;
-
-                case vpuri_ncbi_acc      : if ( resolve_acc )
-                                                rc = VFSManagerResolveAcc( self, temp, path_to_build, remote_file, local_cache );
-                                           else
-                                                rc = RC ( rcVFS, rcMgr, rcAccessing, rcParam, rcInvalid );
-                                           break;
-
-                case vpuri_http          : /* !! fall through !! */
-                case vpuri_ftp           : rc = VFSManagerResolveRemote( self, &temp, path_to_build, remote_file, local_cache );
-                                           break;
-
-                case vpuri_ncbi_legrefseq: /* ??? */
-                                           break;
-                }
-            }
-            if ( temp != NULL )
-                VPathRelease ( temp );
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT const struct KConfig* CC VFSManagerGetConfig(const struct VFSManager * self)
-{
-    if ( self == NULL )
-        return NULL;
-    return self->cfg;
-}
-
-/*
- * Object Id / Object name bindings for accessions and dbGaP files
- */
-
-#define MAX_OBJID_SIZE 20
-#define MAX_NAME_SIZE 4096
-
-LIB_EXPORT void VFSManagerSetBindingsFile(struct VFSManager * self, const char* path)
-{
-    if (self != NULL)
-        KKeyStoreSetBindingsFile( self->keystore, path);
-}
-
-LIB_EXPORT const char* VFSManagerGetBindingsFile(struct VFSManager * self)
-{
-    if (self == NULL)
-        return NULL;
-    return KKeyStoreGetBindingsFile(self->keystore);
-}
-
-LIB_EXPORT rc_t CC VFSManagerRegisterObject(struct VFSManager* self, uint32_t oid, const struct VPath* obj)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC ( rcVFS, rcMgr, rcRegistering, rcSelf, rcNull );
-    else if ( obj == NULL )
-        rc = RC ( rcVFS, rcMgr, rcRegistering, rcParam, rcNull );
-    else
-    {
-        const String* newName;
-        rc = VPathMakeString (obj, &newName);
-        if (rc == 0)
-        {
-            rc = KKeyStoreRegisterObject(self->keystore, oid, newName);
-            StringWhack(newName);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerGetObject(const struct VFSManager* self, uint32_t oid, struct VPath** obj)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC ( rcVFS, rcMgr, rcRetrieving, rcSelf, rcNull );
-    else if ( obj == NULL )
-        rc = RC ( rcVFS, rcMgr, rcRetrieving, rcParam, rcNull );
-    else
-    {
-        const String* objName;
-        rc = KKeyStoreGetObjectName(self->keystore, oid, &objName);
-        if (rc == 0)
-        {
-            rc = VFSManagerMakePath (self, obj, "%S", objName);
-            StringWhack(objName);
-        }
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerGetObjectId(const struct VFSManager* self, const struct VPath* obj, uint32_t* oid)
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-        rc = RC ( rcVFS, rcMgr, rcRetrieving, rcSelf, rcNull );
-    else if ( obj == NULL || oid == NULL)
-        rc = RC ( rcVFS, rcMgr, rcRetrieving, rcParam, rcNull );
-    else
-    {
-        const String* pathString;
-        rc = VPathMakeString(obj, &pathString);
-        if (rc == 0)
-        {
-            rc = VKKeyStoreGetObjectId(self->keystore, pathString, oid);
-            StringWhack(pathString);
-        }
-    }
-    return rc;
-}
-
diff --git a/libs/vfs/path-priv.h b/libs/vfs/path-priv.h
deleted file mode 100644
index ee7f142..0000000
--- a/libs/vfs/path-priv.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*===========================================================================
-*
-*                            Public Domain Notice
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_path_priv_
-#define _h_path_priv_
-
-#ifndef _h_vfs_extern_
-#include <vfs/extern.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-#ifndef _h_klib_data_buffer_
-#include <klib/data-buffer.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_vfs_path_
-#include <vfs/path.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * VPath
- */
-struct VPath
-{
-    KDataBuffer data;
-
-    String scheme;
-    String auth;
-    String host;
-    String portname;
-    String path;
-    String query;
-    String fragment;
-
-    KRefcount refcount;
-
-    uint32_t obj_id;
-    uint32_t acc_code;
-
-    uint32_t ipv4;
-    uint16_t ipv6 [ 8 ];
-    uint16_t portnum;
-
-    uint8_t scheme_type;
-    uint8_t host_type;
-    uint8_t path_type;
-
-    bool from_uri;
-    bool missing_port;
-};
-
-enum VPathVariant
-{
-    vpInvalid,
-    vpOID,
-    vpAccession,
-    vpNameOrOID,
-    vpNameOrAccession,
-    vpName,
-    vpRelPath,
-    vpUNCPath,
-    vpFullPath,
-    vpAuth,
-    vpHostName,
-    vpEndpoint
-};
-
-enum VHostVariant
-{
-    vhDNSName,
-    vhIPv4,
-    vhIPv6
-};
-
-/* legacy support */
-#define VPathMake LegacyVPathMake
-rc_t VPathMake ( VPath ** new_path, const char * posix_path );
-#define VPathMakeFmt LegacyVPathMakeFmt
-rc_t VPathMakeFmt ( VPath ** new_path, const char * fmt, ... );
-#define VPathMakeVFmt LegacyVPathMakeVFmt
-rc_t VPathMakeVFmt ( VPath ** new_path, const char * fmt, va_list args );
-#define VPathMakeSysPath LegacyVPathMakeSysPath
-rc_t VPathMakeSysPath ( VPath ** new_path, const char * sys_path );
-
-typedef enum eVPUri_t
-{
-    vpuri_invalid = -1,
-    vpuri_none, 
-    vpuri_not_supported,
-    vpuri_ncbi_file,
-    vpuri_ncbi_vfs = vpuri_ncbi_file,
-    vpuri_file,
-    vpuri_ncbi_acc,
-    vpuri_http,
-    vpuri_ftp,
-    vpuri_ncbi_legrefseq,
-    vpuri_ncbi_obj,     /* for dbGaP objects */
-    vpuri_fasp,         /* for Aspera downloads */
-    vpuri_count
-} VPUri_t;
-
-#define VPathGetScheme_t LegacyVPathGetScheme_t
-VFS_EXTERN rc_t CC VPathGetScheme_t ( const VPath * self, VPUri_t * uri_type );
-
-#define VPathGetUri_t LegacyVPathGetUri_t
-VPUri_t VPathGetUri_t (const VPath * self);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_path_priv_ */
diff --git a/libs/vfs/path.c b/libs/vfs/path.c
deleted file mode 100644
index ba010b5..0000000
--- a/libs/vfs/path.c
+++ /dev/null
@@ -1,3349 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vfs/extern.h>
-
-#include "path-priv.h"
-
-#include <vfs/manager.h>
-#include <vfs/resolver.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include <sysalloc.h>
-
-#define MAX_ACCESSION_LEN 20
-
-
-/*--------------------------------------------------------------------------
- * VPath
- */
-
-
-/* Whack
- */
-static
-void VPathWhack ( VPath * self )
-{
-    KDataBufferWhack ( & self -> data );
-    KRefcountWhack ( & self -> refcount, "VPath" );
-    free ( self );
-}
-
-/* ParseURI
- *  parse a flexible URI
- *  allowed to be a formal URI with scheme,
- *  a simple POSIX path, or a simple accession
- *
- * NB - the purpose is to parse, not to enforce correctness
- *  emphasis is placed on speed and leniency
- *
- *  url
- *      = accession
- *      | posix-path
- *      | scheme-spec '//' host-spec full-name-spec opt-query opt-fragment
- *      ;
- *
- *  accession
- *      = alpha-part digits-part opt-extensions
- *      | prefix alpha-part digits-part opt-extensions
- *      | prefix digits-part extensions opt-suffix
- *      ;
- *
- *  prefix
- *      = [A-Za-z]+ '_'
- *
- *  alpha-part
- *      = [A-Za-z]+
- *      ;
- *
- *  digits-part
- *      = [0-9]+
- *      ;
- *
- *  opt-extensions
- *      =
- *      | extensions
- *      ;
- *
- *  extensions
- *      = extension
- *      | extensions extension
- *      ;
- *
- *  extension
- *      = '.' [0-9]+
- *      ;
- *
- *  opt-suffix
- *      =
- *      | '_' [A-Za-z]+
- *      ;
- *
- *  obj-id
- *      = [0-9]+
- *      ;
- *
- *  posix-path
- *      = full-path
- *      | rel-path
- *      ;
- *
- *  full-path
- *      = '/' rel-path
- *      ;
- *
- *  rel-path
- *      = name
- *      | rel-path '/' name
- *      ;
- *
- *  name
- *      = [^?#/]+
- *      ;
- *
- *  scheme-spec
- *      = scheme ':'
- *      ;
- *
- *  scheme
- *      = [A-Za-z][-+A-Za-z0-9.]*
- *      ;
- *
- *  host-spec
- *      = dns-name
- *      | ipv4-spec
- *      | '[' ipv6-spec ']'
- *      ;
- *
- *  full-name-spec
- *      = '/' accession
- *      | full-path
- *      | '/' obj-id
- *      ;
- *
- *  opt-query
- *      =
- *      | '?' [^#]+
- *      ;
- *
- *  opt-fragment
- *      =
- *      | '#' any
- *      ;
- */
-typedef enum VPathParseState
-{
-    vppStart,
-    vppAccPrefixAlphaNamePathOrScheme,
-    vppAccAlphaNamePath,
-    vppAccDigitNamePathOrScheme,
-    vppAccDigitNamePath,
-    vppAccExtNamePathOrScheme,
-    vppAccExtNamePath,
-    vppAccSuffixNamePath,
-    vppAccDotNamePathOrScheme,
-    vppAccDotNamePath,
-    vppAccUnderNamePath,
-    vppNamePathOrScheme,
-    vppAccOidRelOrSlash,
-    vppAccPrefixAlphaRel,
-    vppAccAlphaRel,
-    vppAccDigitRel,
-    vppAccExtRel,
-    vppAccSuffixRel,
-    vppOidRel,
-    vppAccDotRel,
-    vppAccUnderRel,
-    vppSlash,
-    vppAuthHostSpec,
-    vppAuthHostNamePort,
-    vppHostSpec,
-    vppHostNamePort,
-    vppIPv4Port,
-    vppIPv4Dot,
-    vppIPv6Port,
-    vppIPv6Colon,
-    vppPortSpecOrFullPath,
-    vppPortSpec,
-    vppPortName,
-    vppPortNum,
-    vppNamePath,
-    vppUNCOrMalformedPOSIXPath,
-    vppFullOrUNCPath,
-    vppRelPath,
-    vppFullPath,
-    vppUNCPath,
-    vppParamName,
-    vppParamValue,
-    vppFragment
-}
-VPathParseState;
-
-static
-void VPathCaptureScheme ( VPath * self, const char * uri, size_t start, size_t end )
-{
-    size_t size = end - start;
-    StringInit ( & self -> scheme, & uri [ start ], size, ( uint32_t ) ( size ) );
-    self -> from_uri = true;
-
-    if ( size != 0 )
-    {
-        const char * scheme = & uri [ start ];
-        self -> scheme_type = vpuri_not_supported;
-
-        /* use size as a quick hash */
-        switch ( size )
-        {
-        case 3:
-            /* ftp */
-            if ( strcase_cmp (  scheme, 3, "ftp", 3, 3 ) == 0 )
-                self -> scheme_type = vpuri_ftp;
-            break;
-        case 4:
-            /* 4 character schemes */
-            switch (  uri [ 0 ] )
-            {
-            case 'f':
-            case 'F':
-                /* file */
-                if ( strcase_cmp (  scheme + 1, 3, "file" + 1, 3, 3 ) == 0 )
-                    self -> scheme_type = vpuri_file;
-                /* fasp */
-                else if ( strcase_cmp (  scheme + 1, 3, "fasp" + 1, 3, 3 ) == 0 )
-                    self -> scheme_type = vpuri_fasp;
-                break;
-            case 'h':
-            case 'H':
-                /* http */
-                if ( strcase_cmp (  scheme + 1, 3, "http" + 1, 3, 3 ) == 0 )
-                    self -> scheme_type = vpuri_http;
-                break;
-            }
-            break;
-            
-        case 8:
-            /* 8 character schemes starting with "ncbi-" */
-            if ( strcase_cmp (  scheme, 5, "ncbi-", 5, 5 ) != 0 )
-                break;
-            switch (  uri [ 5 ] )
-            {
-            case 'a':
-            case 'A':
-                /* ncbi-acc */
-                if ( strcase_cmp (  scheme + 5 + 1, 2, "acc" + 1, 2, 2 ) == 0 )
-                    self -> scheme_type = vpuri_ncbi_acc;
-                break;
-            case 'o':
-            case 'O':
-                /* ncbi-obj */
-                if ( strcase_cmp (  scheme + 5 + 1, 2, "obj" + 1, 2, 2 ) == 0 )
-                    self -> scheme_type = vpuri_ncbi_obj;
-                break;
-            }
-            break;
-            
-        case 9:
-            /* 9 character schemes starting with "ncbi-" */
-            if ( strcase_cmp (  scheme, 5, "ncbi-", 5, 5 ) != 0 )
-                break;
-            switch (  uri [ 5 ] )
-            {
-            case 'f':
-            case 'F':
-                /* ncbi-file */
-                if ( strcase_cmp (  scheme + 5 + 1, 3, "file" + 1, 3, 3 ) == 0 )
-                    self -> scheme_type = vpuri_ncbi_file;
-                break;
-            }
-            break;
-            
-        case 16:
-            /* 16 character schemes starting with "x-ncbi-" */
-            if ( strcase_cmp (  scheme, 7, "x-ncbi-", 7, 7 ) != 0 )
-                break;
-            switch (  uri [ 7 ] )
-            {
-            case 'l':
-            case 'L':
-                /* x-ncbi-legrefseq */
-                if ( strcase_cmp (  scheme + 7 + 1, 8, "legrefseq" + 1, 8, 8 ) == 0 )
-                    self -> scheme_type = vpuri_ncbi_legrefseq;
-                break;
-            }
-            break;
-        }
-    }
-}
-
-static
-void VPathCaptureAccession ( VPath * self, const char * uri, size_t start, size_t end )
-{
-    size_t size = end - start;
-    StringInit ( & self -> path, & uri [ start ], size, ( uint32_t ) size );
-
-    switch ( self -> scheme_type )
-    {
-    case vpuri_none:
-         self -> path_type = vpNameOrAccession;
-         break;
-    case vpuri_ncbi_acc:
-        if ( size < MAX_ACCESSION_LEN )
-        {
-            self -> path_type = vpAccession;
-            break;
-        }
-        /* no break */
-    default:
-         self -> path_type = vpName;
-    }
-}
-
-static
-void VPathCaptureAccCode ( VPath * self, uint32_t acc_prefix,
-    uint32_t acc_alpha, uint32_t acc_digit, uint32_t acc_ext, uint32_t acc_suffix )
-{
-    self -> acc_code
-        = ( acc_prefix << 16 )
-        | ( acc_alpha << 12 )
-        | ( acc_digit << 8 )
-        | ( acc_ext << 4 )
-        | ( acc_suffix << 0 )
-        ;
-
-    if ( self -> path_type == vpNameOrAccession )
-    {
-        switch ( self -> acc_code >> 8 )
-        {
-        case 0x015:
-        case 0x026:
-        case 0x106:
-        case 0x126:
-            /* refseq */
-            self -> path_type = vpAccession;
-            break;
-
-        case 0x109:
-            /* refseq or named annotation */
-            self -> path_type = vpAccession;
-            break;
-
-        case 0x036:
-        case 0x037:
-        case 0x038:
-        case 0x039:
-            /* sra */
-            break;
-
-        case 0x042:
-        case 0x048:
-        case 0x049:
-        case 0x142:
-        case 0x148:
-        case 0x149:
-            /* wgs */
-            self -> path_type = vpAccession;
-            break;
-
-        case 0x029:
-            if ( self -> acc_code == 0x02910 )
-            {
-                if ( self -> path . addr [ 0 ] == 'N' &&
-                     self -> path . addr [ 1 ] == 'A' )
-                {
-                    /* na */
-                    self -> path_type = vpAccession;
-                }
-            }
-            break;
-        }
-    }
-}
-
-static
-void VPathCaptureOid ( VPath * self, uint64_t oid, const char * uri, size_t start, size_t oid_start, size_t end )
-{
-    size_t oid_size = end - oid_start;
-
-    if ( oid == 0 || oid_size > 10 || oid > 0xFFFFFFFF )
-        self -> path_type = vpName;
-    else
-    {
-        self -> obj_id = ( uint32_t ) oid;
-
-        if ( self -> scheme_type == vpuri_ncbi_obj )
-        {
-            StringInit ( & self -> path, & uri [ oid_start ], oid_size, ( uint32_t ) oid_size );
-            self -> path_type = vpOID;
-            return;
-        }
-
-        self -> path_type = vpNameOrOID;
-    }
-
-    StringInit ( & self -> path, & uri [ start ], ( end - start ), ( uint32_t ) ( end - start ) );
-}
-
-static
-void VPathCaptureAuth ( VPath * self, const char * uri, size_t start, size_t end )
-{
-    StringInit ( & self -> auth, & uri [ start ], end - start, ( uint32_t ) ( end - start ) );
-    self -> path_type = vpAuth;
-}
-
-static
-void VPathCaptureHostName ( VPath * self, const char * uri, size_t start, size_t end )
-{
-    StringInit ( & self -> host, & uri [ start ], end - start, ( uint32_t ) ( end - start ) );
-    self -> path_type = vpHostName;
-}
-
-static
-rc_t VPathCaptureIPv4 ( VPath * self, const uint32_t ipv4 [ 4 ] )
-{
-    uint32_t i;
-
-    for ( i = 0; i < 4; ++ i )
-    {
-        if ( ipv4 [ i ] >= 256 )
-            return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-    }
-
-    self -> ipv4
-        = ( ipv4 [ 0 ] << 24 )
-        | ( ipv4 [ 1 ] << 16 )
-        | ( ipv4 [ 2 ] << 8 )
-        | ( ipv4 [ 3 ] << 0 )
-        ;
-
-    self -> path_type = vpEndpoint;
-    self -> host_type = vhIPv4;
-
-    return 0;
-}
-
-static
-rc_t VPathCaptureIPv6 ( VPath * self, const uint32_t ipv6 [ 8 ] )
-{
-    uint32_t i;
-
-    for ( i = 0; i < 8; ++ i )
-    {
-        if ( ipv6 [ i ] >= 0x10000 )
-            return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-
-        self -> ipv6 [ i ] = ( uint16_t ) ipv6 [ i ];
-    }
-
-    self -> path_type = vpEndpoint;
-    self -> host_type = vhIPv6;
-
-    return 0;
-}
-
-static
-void VPathCapturePortName ( VPath * self, const char * uri, size_t start, size_t end )
-{
-    StringInit ( & self -> portname, & uri [ start ], end - start, ( uint32_t ) ( end - start ) );
-    self -> path_type = vpEndpoint;
-}
-
-static
-rc_t VPathCapturePortNum ( VPath * self, uint32_t port )
-{
-    if ( port >= 0x10000 )
-        return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-
-    self -> portnum = ( uint16_t ) port;
-    self -> path_type = vpEndpoint;
-
-    return 0;
-}
-
-static
-void VPathCapturePath ( VPath * self, const char * uri, size_t start, size_t end, uint32_t count, uint32_t var )
-{
-    StringInit ( & self -> path, & uri [ start ], end - start, count );
-    self -> path_type = ( uint8_t ) var;
-}
-
-static
-void VPathCaptureQuery ( VPath * self, const char * uri, size_t start, size_t end, uint32_t count )
-{
-    StringInit ( & self -> query, & uri [ start ], end - start, count );
-}
-
-static
-void VPathCaptureFragment ( VPath * self, const char * uri, size_t start, size_t end, uint32_t count )
-{
-    StringInit ( & self -> fragment, & uri [ start ], end - start, count );
-}
-
-#define VPathParseResetAnchor( i ) \
-    do { anchor = ( i ); count = 0; } while ( 0 )
-
-static
-rc_t VPathParse ( VPath * self, const char * uri, size_t uri_size )
-{
-    rc_t rc;
-    int bytes;
-    uint32_t port;
-    size_t i, anchor;
-    uint32_t count, total;
-    VPathParseState state = vppStart;
-
-    /* for handling current accession schemes */
-    uint32_t acc_prefix = 0;
-    uint32_t acc_alpha = 0;
-    uint32_t acc_digit = 0;
-    uint32_t acc_ext = 0;
-    uint32_t acc_suffix = 0;
-
-    /* for accummulating ip addresses */
-    uint32_t ip;
-    uint32_t ipv4 [ 4 ];
-    uint32_t ipv6 [ 8 ];
-
-    /* for accumulating oid */
-    uint64_t oid;
-    uint32_t oid_anchor;
-
-    for ( i = anchor = 0, total = count = 0; i < uri_size; ++ total, ++ count, i += bytes )
-    {
-        /* read character */
-        uint32_t ch = uri [ i ];
-
-        /* assume ascii */
-        bytes = 1;
-        if ( ( char ) ch  < 0 )
-        {
-            uint32_t utf32;
-
-            /* read into UTF-32 */
-            bytes = utf8_utf32 ( & utf32, & uri [ i ], & uri [ uri_size ] );
-            if ( bytes <= 0 )
-            {
-                if ( bytes < 0 )
-                    return RC ( rcVFS, rcPath, rcParsing, rcChar, rcInvalid );
-                return RC ( rcVFS, rcPath, rcParsing, rcData, rcInsufficient );
-            }
-
-            ch = utf32;
-        }
-
-        /* enter state */
-        switch ( state )
-        {
-        case vppStart:
-
-            if ( ch >= 128 )
-                state = vppNamePath;
-            else if ( isalpha ( ch ) )
-            {
-                acc_alpha = 1;
-                state = vppAccPrefixAlphaNamePathOrScheme;
-            }
-            else if ( isdigit ( ch ) )
-                state = vppNamePath;
-            else switch ( ch )
-            {
-            case '/':
-                state = vppFullOrUNCPath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                state =vppNamePath;
-            }
-            break;
-
-        case vppAccPrefixAlphaNamePathOrScheme:
-
-            if ( ch >= 128 )
-            {
-                acc_alpha = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                ++ acc_alpha;
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_digit;
-                state = vppAccDigitNamePathOrScheme;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_alpha = 0;
-                state = vppRelPath;
-                break;
-
-            case '_':
-                acc_prefix = 1;
-                state = vppAccAlphaNamePath;
-                acc_alpha = 0;
-                break;
-
-            case '.':
-            case '+':
-            case '-':
-                acc_alpha = 0;
-                state = vppNamePathOrScheme;
-                break;
-
-            case ':':
-                acc_alpha = 0;
-                VPathCaptureScheme ( self, uri, anchor, i );
-                state = vppAccOidRelOrSlash;
-                break;
-
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_alpha = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccAlphaNamePath:
-
-            if ( ch >= 128 )
-            {
-                acc_prefix = acc_alpha = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                ++ acc_alpha;
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_digit;
-                state = vppAccDigitNamePath;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDigitNamePathOrScheme:
-
-            if ( ch >= 128 )
-            {
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePathOrScheme;
-            }
-            else if ( isdigit ( ch ) )
-                ++ acc_digit;
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppRelPath;
-                break;
-
-            case '.':
-                state = vppAccDotNamePathOrScheme;
-                break;
-
-            case '+':
-            case '-':
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePathOrScheme;
-                break;
-
-            case ':':
-                acc_prefix = acc_alpha = acc_digit = 0;
-                VPathCaptureScheme ( self, uri, anchor, i );
-                state = vppAccOidRelOrSlash;
-                break;
-
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDigitNamePath:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-                ++ acc_digit;
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppRelPath;
-                break;
-
-            case '.':
-                state = vppAccDotNamePath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccExtNamePathOrScheme:
-
-            if ( ch >= 128 )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePathOrScheme;
-            }
-            else if ( isdigit ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case '.':
-                state = vppAccDotNamePathOrScheme;
-                break;
-
-            case '+':
-            case '-':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePathOrScheme;
-                break;
-
-            case ':':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                VPathCaptureScheme ( self, uri, anchor, i );
-                state = vppAccOidRelOrSlash;
-                break;
-
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '_':
-                if ( acc_prefix != 0 && acc_alpha == 0 && acc_digit == 9 )
-                {
-                    state = vppAccUnderNamePath;
-                    break;
-                }
-
-                /* no break */
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccExtNamePath:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case '.':
-                state = vppAccDotNamePath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '_':
-                if ( acc_prefix != 0 && acc_alpha == 0 && acc_digit == 9 && acc_ext == 1 )
-                {
-                    state = vppAccUnderNamePath;
-                    break;
-                }
-
-                /* no break */
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccSuffixNamePath:
-
-            if ( ch >= 128 || isdigit ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = acc_suffix = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = acc_suffix = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = acc_suffix = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDotNamePathOrScheme:
-
-            if ( ch >= 128 )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePathOrScheme;
-            }
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_ext;
-                state = vppAccExtNamePathOrScheme;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case '.':
-            case '+':
-            case '-':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePathOrScheme;
-                break;
-
-            case ':':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                VPathCaptureScheme ( self, uri, anchor, i );
-                state = vppAccOidRelOrSlash;
-                break;
-
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDotNamePath:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_ext;
-                state = vppAccExtNamePath;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccUnderNamePath:
-
-            if ( ch >= 128 || isdigit ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-            {
-                ++ acc_suffix;
-                state = vppAccSuffixNamePath;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppNamePathOrScheme:
-
-            if ( ch >= 128 )
-                state = vppNamePath;
-            else if ( isalnum ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '/':
-                state = vppRelPath;
-                break;
-
-            case '.':
-            case '+':
-            case '-':
-                break;
-
-            case ':':
-                VPathCaptureScheme ( self, uri, anchor, i );
-                state = vppAccOidRelOrSlash;
-                break;
-
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccOidRelOrSlash:
-
-            VPathParseResetAnchor ( i );
-            acc_prefix = acc_digit = acc_ext = 0;
-
-            if ( ch >= 128 )
-                state = vppNamePath;
-
-            else if ( isalpha ( ch ) )
-            {
-                acc_alpha = 1;
-                state = vppAccPrefixAlphaRel;
-            }
-
-            else if ( isdigit ( ch ) )
-            {
-                state = vppOidRel;
-                oid = ch - '0';
-                oid_anchor = i;
-            }
-
-            else if ( ch != '/' )
-                state = vppNamePath;
-
-            else
-                state = vppSlash;
-
-            break;
-
-        case vppAccPrefixAlphaRel:
-
-            if ( ch >= 128 )
-            {
-                acc_alpha = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                ++ acc_alpha;
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_digit;
-                state = vppAccDigitRel;
-            }
-            else switch ( ch )
-            {
-            case '_':
-                acc_prefix = 1;
-                acc_alpha = 0;
-                state = vppAccAlphaRel;
-                break;
-
-            case '/':
-                acc_alpha = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_alpha = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccAlphaRel:
-
-            if ( ch >= 128 )
-            {
-                acc_prefix = acc_alpha = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                ++ acc_alpha;
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_digit;
-                state = vppAccDigitRel;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDigitRel:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-                ++ acc_digit;
-            else switch ( ch )
-            {
-            case '.':
-                state = vppAccDotRel;
-                break;
-
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccExtRel:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '.':
-                state = vppAccDotRel;
-                break;
-
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '_':
-                if ( acc_prefix != 0 && acc_alpha == 0 && acc_digit == 9 && acc_ext == 1 )
-                {
-                    state = vppAccUnderRel;
-                    break;
-                }
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccSuffixRel:
-
-            if ( ch >= 128 || isdigit ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = acc_suffix = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '.':
-                state = vppAccDotRel;
-                break;
-
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureAccession ( self, uri, anchor, i );
-                VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppOidRel:
-
-            if ( ch >= 128 )
-            {
-                oid = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-            {
-                if ( oid == 0 )
-                    oid_anchor = i;
-
-                oid *= 10;
-                oid += ch - '0';
-            }
-            else switch ( ch )
-            {
-            case '/':
-                oid = 0;
-                state = vppRelPath;
-                break;
-
-            case '?':
-                VPathCaptureOid ( self, oid, uri, anchor, oid_anchor, i );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCaptureOid ( self, oid, uri, anchor, oid_anchor, i );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                oid = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccDotRel:
-
-            if ( ch >= 128 || isalpha ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isdigit ( ch ) )
-            {
-                ++ acc_ext;
-                state = vppAccExtRel;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppAccUnderRel:
-
-            if ( ch >= 128 || isdigit ( ch ) )
-            {
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            else if ( isalpha ( ch ) )
-            {
-                ++ acc_suffix;
-                state = vppAccSuffixRel;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppRelPath;
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            default:
-                acc_prefix = acc_alpha = acc_digit = acc_ext = 0;
-                state = vppNamePath;
-            }
-            break;
-
-        case vppSlash:
-
-            switch ( ch )
-            {
-            case '/':
-                if ( self -> scheme_type == vpuri_ncbi_file )
-                    state = vppUNCOrMalformedPOSIXPath;
-                else
-                    state = vppAuthHostSpec;
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '?':
-                VPathCapturePath ( self, uri, anchor, i, count, vpFullPath );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCapturePath ( self, uri, anchor, i, count, vpFullPath );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                state = vppFullPath;
-            }
-            break;
-
-        case vppAuthHostSpec:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            VPathParseResetAnchor ( i );
-
-            if ( isalpha ( ch ) )
-                state = vppAuthHostNamePort;
-            else if ( isdigit ( ch ) )
-            {
-                ipv4 [ ip = 0 ] = ch - '0';
-                state = vppIPv4Port;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                state = vppFullPath;
-                break;
-            case '[':
-                ip = 0;
-                memset ( ipv6, 0, sizeof ipv6 );
-                state = vppIPv6Colon;
-                break;
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-
-            break;
-
-        case vppHostSpec:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            VPathParseResetAnchor ( i );
-
-            if ( isalpha ( ch ) )
-                state = vppHostNamePort;
-            else if ( isdigit ( ch ) )
-            {
-                ipv4 [ ip = 0 ] = ch - '0';
-                state = vppIPv4Port;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                state = vppFullPath;
-                break;
-            case '[':
-                ip = 0;
-                memset ( ipv6, 0, sizeof ipv6 );
-                state = vppIPv6Colon;
-                break;
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-
-            break;
-
-        case vppAuthHostNamePort:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            if ( isalnum ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '@':
-                VPathCaptureAuth ( self, uri, anchor, i );
-                state = vppHostSpec;
-                break;
-
-            case '.':
-            case '+':
-            case '-':
-            case '_':
-                break;
-
-            case ':':
-                VPathCaptureHostName ( self, uri, anchor, i );
-                state = vppPortSpec;
-                break;
-
-            case '/':
-                VPathCaptureHostName ( self, uri, anchor, i );
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-            break;
-
-        case vppHostNamePort:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            if ( isalnum ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '.':
-            case '+':
-            case '-':
-            case '_':
-                break;
-
-            case ':':
-                VPathCaptureHostName ( self, uri, anchor, i );
-                state = vppPortSpec;
-                break;
-
-            case '/':
-                VPathCaptureHostName ( self, uri, anchor, i );
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-            break;
-
-        case vppIPv4Port:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            if ( ipv4 [ ip ] >= 256 )
-                return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-            if ( isdigit ( ch ) )
-                ipv4 [ ip ] = ipv4 [ ip ] * 10 + ch - '0';
-            else if ( ++ ip == 4 )
-            {
-                switch ( ch )
-                {
-                case ':':
-                    rc = VPathCaptureIPv4 ( self, ipv4 );
-                    state = vppPortSpec;
-                    break;
-
-                case '/':
-                    rc = VPathCaptureIPv4 ( self, ipv4 );
-                    state = vppFullPath;
-                    VPathParseResetAnchor ( i );
-                    break;
-
-                default:
-                    return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-                }
-
-                if ( rc != 0 )
-                    return rc;
-            }
-            else if ( ch == '.' )
-                state = vppIPv4Dot;
-            else
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            break;
-
-        case vppIPv4Dot:
-
-            if ( ch >= 128 || ! isdigit ( ch ) )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            ipv4 [ ip ] = ch - '0';
-            state = vppIPv4Port;
-
-            break;
-
-        case vppIPv6Port:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            if ( ipv6 [ ip ] >= 0x10000 )
-                return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-            if ( isdigit ( ch ) )
-                ipv6 [ ip ] = ( ipv6 [ ip ] << 4 ) + ch - '0';
-            else if ( isxdigit ( ch ) )
-                ipv6 [ ip ] = ( ipv6 [ ip ] << 4 ) + toupper ( ch ) - 'A' + 10;
-            else
-            {
-                switch ( ch )
-                {
-                case ']':
-                    rc = VPathCaptureIPv6 ( self, ipv6 );
-                    state = vppPortSpecOrFullPath;
-                    break;
-
-                case ':':
-                    if ( ++ ip != 8 )
-                    {
-                        state = vppIPv6Colon;
-                        break;
-                    }
-
-                    /* no break */
-                default:
-                    return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-                }
-
-                if ( rc != 0 )
-                    return rc;
-            }
-            break;
-
-        case vppIPv6Colon:
-
-            if ( ch != ':' )
-            {
-                if ( ch >= 128 || ! isxdigit ( ch ) )
-                    return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-                if ( isdigit ( ch ) )
-                    ipv6 [ ip ] = ch - '0';
-                else
-                    ipv6 [ ip ] = toupper ( ch ) - 'A' + 10;
-            }
-
-            state = vppIPv6Port;
-
-            break;
-
-        case vppPortSpecOrFullPath:
-
-            switch ( ch )
-            {
-            case ':':
-                state = vppPortSpec;
-                break;
-
-            case '/':
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-
-            break;
-
-        case vppPortSpec:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            VPathParseResetAnchor ( i );
-
-            if ( isalpha ( ch ) )
-                state = vppPortName;
-            else if ( isdigit ( ch ) )
-            {
-                port = ch - '0';
-                state = vppPortNum;
-            }
-            else switch ( ch )
-            {
-            case '/':
-                self -> missing_port = true;
-                state = vppFullPath;
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-
-            break;
-
-        case vppPortName:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            if ( isalnum ( ch ) )
-                break;
-            else switch ( ch )
-            {
-            case '/':
-                VPathCapturePortName ( self, uri, anchor, i );
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-            break;
-
-        case vppPortNum:
-
-            if ( ch >= 128 )
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            if ( port >= 0x10000 )
-                return RC ( rcVFS, rcPath, rcParsing, rcData, rcExcessive );
-
-            if ( isdigit ( ch ) )
-                port = port * 10 + ch - '0';
-            else switch ( ch )
-            {
-            case '/':
-                rc = VPathCapturePortNum ( self, port );
-                if ( rc != 0 )
-                    return rc;
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-            break;
-
-        case vppNamePath:
-
-            switch ( ch )
-            {
-            case '/':
-                state = vppRelPath;
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '?':
-                VPathCapturePath ( self, uri, anchor, i, count, vpName );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCapturePath ( self, uri, anchor, i, count, vpName );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-            }
-
-            break;
-
-        case vppUNCOrMalformedPOSIXPath:
-
-            switch ( ch )
-            {
-            case '/':
-                state = vppFullPath;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '?':
-                VPathCapturePath ( self, uri, anchor, i, count, vpFullPath );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCapturePath ( self, uri, anchor, i, count, vpFullPath );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-
-            default:
-                state = vppUNCPath;
-            }
-
-            break;
-
-        case vppFullOrUNCPath:
-
-            if ( ch == '/' )
-            {
-                state = vppUNCOrMalformedPOSIXPath;
-                break;
-            }
-
-            state = vppFullPath;
-            /* no break */
-
-        case vppRelPath:
-        case vppFullPath:
-
-            switch ( ch )
-            {
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '?':
-                VPathCapturePath ( self, uri, anchor, i, count,
-                    ( state == vppRelPath ) ? vpRelPath : vpFullPath );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCapturePath ( self, uri, anchor, i, count,
-                    ( state == vppRelPath ) ? vpRelPath : vpFullPath );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-            }
-
-            break;
-
-        case vppUNCPath:
-
-            switch ( ch )
-            {
-            case ':':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '?':
-                VPathCapturePath ( self, uri, anchor, i, count, vpUNCPath );
-                state = vppParamName;
-                VPathParseResetAnchor ( i );
-                break;
-
-            case '#':
-                VPathCapturePath ( self, uri, anchor, i, count, vpUNCPath );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-            }
-
-            break;
-
-        case vppParamName:
-
-            switch ( ch )
-            {
-            case ':':
-            case '?':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '=':
-                state = vppParamValue;
-                break;
-
-            case '#':
-                VPathCaptureQuery ( self, uri, anchor, i, count );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-            }
-
-            break;
-
-        case vppParamValue:
-
-            switch ( ch )
-            {
-            case ':':
-            case '?':
-            case '=':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-
-            case '&':
-                state = vppParamName;
-                break;
-
-            case '#':
-                VPathCaptureQuery ( self, uri, anchor, i, count );
-                state = vppFragment;
-                VPathParseResetAnchor ( i );
-                break;
-            }
-
-            break;
-
-        case vppFragment:
-
-            switch ( ch )
-            {
-            case ':':
-            case '?':
-            case '#':
-                return RC ( rcVFS, rcPath, rcParsing, rcChar, rcUnexpected );
-            }
-
-            break;
-        }
-    }
-
-    switch ( state )
-    {
-    case vppStart:
-        return RC ( rcVFS, rcPath, rcParsing, rcString, rcEmpty );
-    case vppAccPrefixAlphaNamePathOrScheme:
-    case vppAccAlphaNamePath:
-    case vppAccDigitNamePathOrScheme:
-    case vppAccDigitNamePath:
-    case vppAccExtNamePathOrScheme:
-    case vppAccExtNamePath:
-    case vppAccSuffixNamePath:
-        VPathCaptureAccession ( self, uri, anchor, i );
-        VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-        break;
-    case vppAccDotNamePathOrScheme:
-    case vppAccDotNamePath:
-    case vppAccUnderNamePath:
-    case vppNamePathOrScheme:
-        VPathCapturePath ( self, uri, anchor, i, count, vpName );
-        break;
-    case vppAccOidRelOrSlash:
-        return RC ( rcVFS, rcPath, rcParsing, rcData, rcInsufficient );
-    case vppAccPrefixAlphaRel:
-    case vppAccAlphaRel:
-    case vppAccDigitRel:
-    case vppAccExtRel:
-    case vppAccSuffixRel:
-        VPathCaptureAccession ( self, uri, anchor, i );
-        VPathCaptureAccCode ( self, acc_prefix, acc_alpha, acc_digit, acc_ext, acc_suffix );
-        break;
-    case vppOidRel:
-        VPathCaptureOid ( self, oid, uri, anchor, oid_anchor, i );
-        break;
-    case vppAccDotRel:
-    case vppAccUnderRel:
-    case vppSlash:
-    case vppAuthHostSpec:
-    case vppHostSpec:
-        return RC ( rcVFS, rcPath, rcParsing, rcData, rcInsufficient );
-    case vppAuthHostNamePort:
-    case vppHostNamePort:
-        VPathCaptureHostName ( self, uri, anchor, i );
-        break;
-    case vppIPv4Port:
-        if ( ++ ip == 4 )
-            return VPathCaptureIPv4 ( self, ipv4 );
-    case vppIPv4Dot:
-    case vppIPv6Port:
-    case vppIPv6Colon:
-    case vppPortSpecOrFullPath:
-    case vppPortSpec:
-        return RC ( rcVFS, rcPath, rcParsing, rcData, rcInsufficient );
-    case vppPortName:
-        VPathCapturePortName ( self, uri, anchor, i );
-        break;
-    case vppPortNum:
-        return VPathCapturePortNum ( self, port );
-    case vppNamePath:
-        VPathCapturePath ( self, uri, anchor, i, count, vpName );
-        break;
-    case vppRelPath:
-        VPathCapturePath ( self, uri, anchor, i, count, vpRelPath );
-        break;
-    case vppUNCOrMalformedPOSIXPath:
-    case vppFullOrUNCPath:
-    case vppFullPath:
-        VPathCapturePath ( self, uri, anchor, i, count, vpFullPath );
-        break;
-    case vppUNCPath:
-        VPathCapturePath ( self, uri, anchor, i, count, vpUNCPath );
-        break;
-    case vppParamName:
-    case vppParamValue:
-        VPathCaptureQuery ( self, uri, anchor, i, count );
-        break;
-    case vppFragment:
-        VPathCaptureFragment ( self, uri, anchor, i, count );
-        break;
-    }
-
-    return 0;
-}
-
-
-/* MakeFromText
- *  could be anything...
- */
-static
-rc_t VPathMakeFromVText ( VPath ** ppath, const char * path_fmt, va_list args )
-{
-    rc_t rc;
-    KDataBuffer buffer;
-
-    /* initialize buffer */
-    memset ( & buffer, 0, sizeof buffer );
-    buffer . elem_bits = 8;
-
-    /* print into buffer */
-    rc = KDataBufferVPrintf ( & buffer, path_fmt, args );
-    if ( rc == 0 )
-    {
-        VPath * path = calloc ( 1, sizeof * path );
-        if ( path == NULL )
-            rc = RC ( rcVFS, rcPath, rcAllocating, rcMemory, rcExhausted );
-        else
-        {
-            /* straight copy to steal contents */
-            path -> data = buffer;
-
-            /* parse into portions */
-            rc = VPathParse ( path, buffer . base, ( size_t ) buffer . elem_count - 1 );
-            if ( rc == 0 )
-            {
-                KRefcountInit ( & path -> refcount, 1, "VPath", "make-from-text", buffer . base );
-                * ppath = path;
-                return 0;
-            }
-
-            free ( path );
-        }
-
-        KDataBufferWhack ( & buffer );
-    }
-
-    * ppath = NULL;
-
-    return rc;
-}
-
-static
-rc_t VPathMakeFromText ( VPath ** ppath, const char * text, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, text );
-
-    rc = VPathMakeFromVText ( ppath, text, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* AddRef
- * Release
- *  ignores NULL references
- */
-LIB_EXPORT rc_t CC VPathAddRef ( const VPath *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VPath" ) )
-        {
-        case krefLimit:
-            return RC ( rcVFS, rcPath, rcAttaching, rcRange, rcExcessive );
-        }
-    }
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VPathRelease ( const VPath *self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VPath" ) )
-        {
-        case krefWhack:
-            VPathWhack ( ( VPath* ) self );
-            break;
-        case krefNegative:
-            return RC ( rcVFS, rcPath, rcReleasing, rcRange, rcExcessive );
-        }
-    }
-
-    return 0;
-}
-
-
-/* IsFSCompatible
- *  asks if the path can be used with the OS' filesystems
- */
-LIB_EXPORT bool CC VPathIsFSCompatible ( const VPath * self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> path_type )
-        {
-        case vpNameOrAccession:
-        case vpName:
-        case vpRelPath:
-        case vpUNCPath:
-        case vpFullPath:
-            return true;
-        }
-    }
-    return false;
-}
-
-
-/* FromUri
- *  asks if the path was created from a formal URI
- */
-LIB_EXPORT bool CC VPathFromUri ( const VPath * self )
-{
-    if ( self != NULL )
-        return self -> from_uri;
-    return false;
-}
-
-
-/* Read*
- *  read the various parts
- *  copies out data into user-supplied buffer
- */
-static
-rc_t VPathSetInvalidReturn ( rc_t rc,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    if ( num_read != NULL )
-        * num_read = 0;
-    if ( buffer != NULL && buffer_size != 0 )
-        buffer [ 0 ] = 0;
-    return rc;
-}
-
-static
-rc_t VPathReadTestSelf ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc;
-
-    if ( self == NULL )
-        rc = RC ( rcVFS, rcPath, rcReading, rcSelf, rcNull );
-    else if ( self -> path_type == vpInvalid )
-        rc = RC ( rcVFS, rcPath, rcReading, rcSelf, rcInvalid );
-    else
-        return 0;
-
-    return VPathSetInvalidReturn ( rc, buffer, buffer_size, num_read );
-}
-
-static
-rc_t VPathReadMember ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read,
-    const String * mbr, uint32_t idx )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-        rc = string_printf ( buffer, buffer_size, num_read, "%:*-$S", idx, mbr );
-    return rc;
-}
-
-static
-rc_t VPathGetSchemeInt ( const VPath * self, String * scheme )
-{
-    if ( self -> scheme . size != 0 )
-        * scheme = self -> scheme;
-
-    else switch ( self -> path_type )
-    {
-    case vpOID:
-        CONST_STRING ( scheme, "ncbi-obj" );
-        break;
-    case vpAccession:
-        CONST_STRING ( scheme, "ncbi-acc" );
-        break;
-    case vpNameOrOID:
-    case vpNameOrAccession:
-    case vpName:
-    case vpRelPath:
-    case vpFullPath:
-        if ( self -> query . size != 0 || self -> fragment . size != 0 )
-            CONST_STRING ( scheme, "ncbi-file" );
-        else
-            CONST_STRING ( scheme, "file" );
-        break;
-    case vpUNCPath:
-        CONST_STRING ( scheme, "ncbi-file" );
-        break;
-    default:
-        return RC ( rcVFS, rcPath, rcReading, rcType, rcIncorrect );
-    }
-
-    return 0;
-}
-
-static
-rc_t VPathReadSchemeInt ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read,
-    const char * suffix, bool * fail )
-{
-    String scheme;
-    rc_t rc = VPathGetSchemeInt ( self, & scheme );
-    if ( rc != 0 )
-    {
-        * fail = true;
-        return rc;
-    }
-    return string_printf ( buffer, buffer_size, num_read, "%S%s", & scheme, suffix );
-}
-
-static
-rc_t VPathReadAuthInt ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read,
-    const char * prefix )
-{
-    rc_t rc = 0;
-
-    if ( self -> auth . size == 0 )
-        * num_read = 0;
-    else
-    {
-        rc = string_printf ( buffer, buffer_size, num_read,
-                             "%s%S", prefix, & self -> auth );
-    }
-
-    return rc;
-}
-
-static
-rc_t VPathReadHostInt ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read,
-    const char * prefix )
-{
-    rc_t rc = 0;
-    const char * lbrack, * rbrack;
-
-    switch ( self -> host_type )
-    {
-    case vhDNSName:
-
-        rc = string_printf ( buffer, buffer_size, num_read,
-                             "%s%S", prefix, & self -> host );
-        break;
-
-    case vhIPv4:
-
-        rc = string_printf ( buffer, buffer_size, num_read
-                             , "%s%u.%u.%u.%u"
-                             , prefix
-                             , ( self -> ipv4 >> 24 ) & 0xFF
-                             , ( self -> ipv4 >> 16 ) & 0xFF
-                             , ( self -> ipv4 >>  8 ) & 0xFF
-                             , ( self -> ipv4 >>  0 ) & 0xFF
-            );
-        break;
-
-    case vhIPv6:
-
-        lbrack = rbrack = "";
-        if ( prefix [ 0 ] != 0 )
-        {
-            lbrack = "[";
-            rbrack = "]";
-        }
-
-        rc = string_printf ( buffer, buffer_size, num_read
-                             , "%s%s%u:%u:%u:%u:%u:%u:%u:%u%s"
-                             , prefix
-                             , lbrack
-                             , self -> ipv6 [ 0 ]
-                             , self -> ipv6 [ 1 ]
-                             , self -> ipv6 [ 2 ]
-                             , self -> ipv6 [ 3 ]
-                             , self -> ipv6 [ 4 ]
-                             , self -> ipv6 [ 5 ]
-                             , self -> ipv6 [ 6 ]
-                             , self -> ipv6 [ 7 ]
-                             , rbrack
-            );
-        break;
-    }
-
-    return rc;
-}
-
-static
-rc_t VPathReadPathInt ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc;
-
-    /* print remainder */
-    switch ( self -> path_type )
-    {
-    case vpOID:
-            
-        rc = string_printf ( buffer, buffer_size, num_read
-                             , "%u"
-                             , self -> obj_id
-            );
-        break;
-
-    case vpAccession:
-    case vpNameOrOID:
-    case vpNameOrAccession:
-    case vpName:
-    case vpRelPath:
-    case vpUNCPath:
-    case vpFullPath:
-
-        assert ( self -> path . size != 0 );
-        rc = string_printf ( buffer, buffer_size, num_read
-                             , "%S"
-                             , & self -> path
-            );
-        break;
-
-    default:
-
-        if ( num_read != NULL )
-            * num_read = 0;
-
-        rc = 0;
-    }
-
-    return rc;
-}
-
-static
-rc_t VPathReadUriInt ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * total_read )
-{
-    rc_t rc;
-    const char * host_prefix;
-    size_t total, num_read, avail;
-    bool has_auth, has_host, fail = false;
-
-    /* print scheme plus preparation for host */
-    rc = VPathReadSchemeInt ( self, buffer, buffer_size, & num_read, ":", & fail );
-    if ( fail )
-        return VPathSetInvalidReturn ( rc, buffer, buffer_size, total_read );
-    total = num_read;
-    avail = ( rc == 0 ) ? buffer_size - total : 0;
-
-    /* print auth */
-    host_prefix = "//";
-    rc = VPathReadAuthInt ( self, & buffer [ total ], avail, & num_read, host_prefix );
-    total += num_read;
-    avail -= ( rc == 0 ) ? num_read : 0;
-    has_auth = num_read > 2;
-    if ( has_auth )
-        host_prefix = "@";
-
-    /* print host */
-    rc = VPathReadHostInt ( self, & buffer [ total ], avail, & num_read, host_prefix );
-    total += num_read;
-    avail -= ( rc == 0 ) ? num_read : 0;
-    has_host = num_read > ( 2 - has_auth );
-
-    /* print port */
-    if ( has_host )
-    {
-        if ( self -> portname . size != 0 )
-            rc = string_printf ( & buffer [ total ], avail, & num_read, ":%S", & self -> portname );
-        else if ( self -> portnum != 0 )
-            rc = string_printf ( & buffer [ total ], avail, & num_read, ":%u", self -> portnum );
-        else if ( self -> missing_port )
-            rc = string_printf ( & buffer [ total ], avail, & num_read, ":" );
-        else
-            num_read = 0;
-
-        total += num_read;
-        avail -= ( rc == 0 ) ? num_read : 0;
-    }
-
-    /* sanity check */
-    assert ( ! has_auth || has_host );
-    assert ( self -> path . size == 0 || self -> path . addr [ 0 ] == '/' || ! has_host );
-    assert ( self -> query . size == 0 || self -> query . addr [ 0 ] == '?' );
-    assert ( self -> fragment . size == 0 || self -> fragment . addr [ 0 ] == '#' );
-
-    /* print remainder */
-    switch ( self -> path_type )
-    {
-    case vpOID:
-
-        if ( ! has_host )
-        {
-            /* correct for empty host spec */
-            total -= 2;
-            avail += 2;
-        }
-
-        rc = string_printf ( & buffer [ total ], avail, & num_read
-                             , "%s%u%S%S"
-                             , has_host ? "/" : ""
-                             , self -> obj_id
-                             , & self -> query
-                             , & self -> fragment
-            );
-        break;
-
-    case vpAccession:
-    case vpNameOrOID:
-    case vpNameOrAccession:
-    case vpName:
-    case vpRelPath:
-    case vpUNCPath:
-
-        assert ( ! has_host );
-
-        /* correct for empty host spec */
-        total -= 2;
-        avail += 2;
-
-        /* no break */
-
-    case vpFullPath:
-
-        assert ( self -> path . size != 0 );
-        rc = string_printf ( & buffer [ total ], avail, & num_read
-                             , "%S%S%S"
-                             , & self -> path
-                             , & self -> query
-                             , & self -> fragment
-            );
-        break;
-    }
-
-    if ( total_read != NULL )
-        * total_read = total + num_read;
-
-    if ( rc != 0 && buffer != NULL && buffer_size != 0 )
-        buffer [ 0 ] = 0;
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadUri ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-        rc = VPathReadUriInt ( self, buffer, buffer_size, num_read );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadScheme ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-    {
-        bool fail = false;
-        rc = VPathReadSchemeInt ( self, buffer, buffer_size, num_read, "", & fail );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadAuth ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-        rc = VPathReadAuthInt ( self, buffer, buffer_size, num_read, "" );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadHost ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-        rc = VPathReadHostInt ( self, buffer, buffer_size, num_read, "" );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadPortName ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    return VPathReadMember ( self,
-        buffer, buffer_size, num_read,
-        & self -> portname, 0 );
-}
-
-LIB_EXPORT rc_t CC VPathReadPath ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-        rc = VPathReadPathInt ( self, buffer, buffer_size, num_read );
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadQuery ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    return VPathReadMember ( self,
-        buffer, buffer_size, num_read,
-        & self -> query, 1 );
-}
-
-static
-rc_t VPathFindParam ( const VPath * self, const char * param, String * val_str )
-{
-    rc_t rc;
-
-    if ( param == NULL )
-        rc = RC ( rcVFS, rcPath, rcReading, rcParam, rcNull );
-    else if ( param [ 0 ] == 0 )
-        rc = RC ( rcVFS, rcPath, rcReading, rcParam, rcEmpty );
-    else
-    {
-        size_t qsize = string_size ( param );
-        const char * start = self -> query . addr;
-        const char * end = start + self -> query . size;
-        if ( ++ start < end ) while ( 1 )
-        {
-            /* match as many characters as possible of param name */
-            uint32_t matching = strcase_match ( start, end - start, param, qsize, -1, NULL );
-            start += matching;
-
-            if ( ( size_t ) matching == qsize )
-            {
-                /* may have found the parameter */
-                if ( start == end || start [ 0 ] == '&' )
-                {
-                    /* no value */
-                    StringInit ( val_str, "", 0, 0 );
-                    return 0;
-                }
-
-                if ( start [ 0 ] == '=' )
-                {
-                    /* have value */
-                    const char * val = start + 1;
-                    const char * pend = string_chr ( val, end - val, '&' );
-                    if ( pend == NULL )
-                        pend = end;
-                    StringInit ( val_str, val, pend - val, string_len ( val, pend - val ) );
-                    return 0;
-                }
-            }
-
-            /* find next parameter */
-            start = string_chr ( start, end - start, '&' );
-            if ( start == NULL )
-                break;
-
-            /* skip separator */
-            ++ start;
-        }
-
-        rc = RC ( rcVFS, rcPath, rcReading, rcParam, rcNotFound );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadParam ( const VPath * self, const char * param,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-    {
-        String val_str;
-        rc = VPathFindParam ( self, param, & val_str );
-        if ( rc == 0 )
-        {
-            /* copy out value */
-            return string_printf ( buffer, buffer_size, num_read
-                                   , "%S"
-                                   , & val_str
-                );
-        }
-
-        VPathSetInvalidReturn ( rc, buffer, buffer_size, num_read );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathReadFragment ( const VPath * self,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    return VPathReadMember ( self,
-        buffer, buffer_size, num_read,
-        & self -> fragment, 1 );
-}
-
-
-/* MakeUri
- *  convert a VPath into a Uri
- */
-LIB_EXPORT rc_t CC VPathMakeUri ( const VPath * self, const String ** uri )
-{
-    rc_t rc;
-
-    if ( uri == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        /* TBD - if we build the path from a URI, we should just
-           grab the text from buffer */
-        size_t bytes;
-        char buffer [ 8192 ];
-        rc = VPathReadUri ( self, buffer, sizeof buffer, & bytes );
-        if ( rc == 0 )
-        {
-            String uri_str;
-            StringInit ( & uri_str, buffer, bytes, string_len ( buffer, bytes ) );
-            return StringCopy ( uri, & uri_str );
-        }
-
-        /* TBD - if we ever have huge URIs, 8K can be insufficient */
-        * uri = NULL;
-    }
-    return rc;
-}
-
-
-/* MakeString
- *  convert a VPath into a String
- *  respects original source of path,
- *  i.e. does not add scheme unnecessarily
- */
-LIB_EXPORT rc_t CC VPathMakeString ( const VPath * self, const String ** str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcPath, rcAccessing, rcSelf, rcNull );
-        else
-        {
-            size_t bytes, host;
-            char buffer [ 8192 ];
-
-            if ( self -> from_uri || self -> query . size != 0 || self -> fragment . size != 0 )
-                rc = VPathReadUriInt ( self, buffer, sizeof buffer, & bytes );
-            else switch ( self -> path_type )
-            {
-            case vpHostName:
-                rc = VPathReadHostInt ( self, buffer, sizeof buffer, & bytes, "" );
-                break;
-
-            case vpEndpoint:
-                rc = VPathReadHostInt ( self, buffer, sizeof buffer, & host, "" );
-                if ( rc == 0 )
-                {
-                    if ( self -> portname . size != 0 )
-                    {
-                        rc = string_printf ( & buffer [ host ], sizeof buffer - host,
-                            & bytes, ":%S", & self -> portname );
-                    }
-                    else
-                    {
-                        rc = string_printf ( & buffer [ host ], sizeof buffer - host,
-                            & bytes, ":%u", & self -> portnum );
-                    }
-
-                    bytes += host;
-                }
-                break;
-
-            default:
-                rc = VPathReadPathInt ( self, buffer, sizeof buffer, & bytes );
-            }
-
-            if ( rc == 0 )
-            {
-                String local_str;
-                StringInit ( & local_str, buffer, bytes, string_len ( buffer, bytes ) );
-                return StringCopy ( str, & local_str );
-            }
-        }
-
-        * str = NULL;
-    }
-    return rc;
-}
-
-
-/* Get*
- *  retrieves internal parts
- *  returns pointers to internal String data
- *  Strings remain valid while "self" is valid
- */
-static
-rc_t VPathGetTestSelf ( const VPath * self )
-{
-    if ( self == NULL )
-        return RC ( rcVFS, rcPath, rcAccessing, rcSelf, rcNull );
-    if ( self -> path_type == vpInvalid )
-        return RC ( rcVFS, rcPath, rcAccessing, rcSelf, rcInvalid );
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VPathGetScheme ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            /* work harder to fill out a scheme if not there */
-            rc = VPathGetSchemeInt ( self, str );
-            if ( rc == 0 )
-                return 0;
-
-            /* if the path can't have a scheme, it's okay */
-            rc = 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetAuth ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            * str = self -> auth;
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetHost ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            * str = self -> host;
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetPortName ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            * str = self -> portname;
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT uint16_t CC VPathGetPortNum ( const VPath * self )
-{
-    rc_t rc = VPathGetTestSelf ( self );
-    if ( rc == 0 )
-        return self -> portnum;
-
-    return 0;
-}
-
-LIB_EXPORT rc_t CC VPathGetPath ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            * str = self -> path;
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetQuery ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            StringSubstr ( & self -> query, str, 1, 0 );
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetParam ( const VPath * self, const char * param, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            rc = VPathFindParam ( self, param, str );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VPathGetFragment ( const VPath * self, String * str )
-{
-    rc_t rc;
-
-    if ( str == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        rc = VPathGetTestSelf ( self );
-        if ( rc == 0 )
-        {
-            StringSubstr ( & self -> fragment, str, 1, 0 );
-            return 0;
-        }
-
-        StringInit ( str, "", 0, 0 );
-    }
-
-    return rc;
-}
-
-/* TEMPORARY */
-LIB_EXPORT uint32_t CC VPathGetOid ( const VPath * self )
-{
-    if ( self != NULL )
-        return self -> obj_id;
-    return 0;
-}
-
-/*--------------------------------------------------------------------------
- * VFSManager
- */
-
-
-/* MakePath
- *  make a path object from a string conforming to
- *  either a standard POSIX path or a URI
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "path_str" [ IN ] - a UTF-8 NUL-terminated string
- *  representing a POSIX path or URI, or
- *  a string_printf compatible format string
- *
- *  "path_fmt" [ IN ] and "args" [ IN ] - a UTF-8 NUL-terminated fmt string
- *  compatible with string_vprintf, plus argument list
- */
-LIB_EXPORT rc_t CC VFSManagerVMakePath ( const VFSManager * self,
-    VPath ** new_path, const char * path_fmt, va_list args )
-{
-    rc_t rc;
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcSelf, rcNull );
-        else if ( path_fmt == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcNull );
-        else if ( path_fmt [ 0 ] == 0 )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcEmpty );
-        else
-        {
-            rc = VPathMakeFromVText ( new_path, path_fmt, args );
-            if ( rc == 0 )
-            {
-                VPath * path = * new_path;
-
-                if ( ! path -> from_uri )
-                {
-                    String scheme;
-                    rc = VPathGetSchemeInt ( path, & scheme );
-                    if ( rc == 0 )
-                        path -> scheme = scheme;
-                }
-
-                return 0;
-            }
-        }
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerMakePath ( const VFSManager * self,
-    VPath ** new_path, const char * path_str, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, path_str );
-
-    rc = VFSManagerVMakePath ( self, new_path, path_str, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-/* MakeAccPath - TEMPORARY
- *  takes a textual accession representation
- *  creates a VPath representing an accession
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "acc" [ IN ] - a NUL-terminated ASCII fmt string
- */
-LIB_EXPORT rc_t CC VFSManagerVMakeAccPath ( const VFSManager * self,
-    VPath ** new_path, const char * fmt, va_list args )
-{
-    rc_t rc = VFSManagerVMakePath ( self, new_path, fmt, args );
-    if ( rc == 0 )
-    {
-        VPath * path = * new_path;
-        switch ( path -> path_type )
-        {
-        case vpAccession:
-            break;
-        case vpNameOrAccession:
-            path -> path_type = vpAccession;
-            break;
-        default:
-            VPathRelease ( path );
-            * new_path = NULL;
-            return RC ( rcVFS, rcMgr, rcConstructing, rcToken, rcIncorrect );
-        }
-
-        if ( path -> scheme . size == 0 )
-            VPathCaptureScheme ( path, "ncbi-acc", 0, 8 );
-    }
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerMakeAccPath ( const VFSManager * self,
-    VPath ** new_path, const char * acc, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, acc );
-
-    rc = VFSManagerVMakeAccPath ( self, new_path, acc, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-
-/* MakeOidPath - TEMPORARY
- *  takes an integer oid
- *  creates a VPath representing an obj-id
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "oid" [ IN ] - a non-zero object id
- */
-LIB_EXPORT rc_t CC VFSManagerMakeOidPath ( const VFSManager * self,
-    VPath ** new_path, uint32_t oid )
-{
-    char oid_str [ 32 ];
-    rc_t rc = string_printf ( oid_str, sizeof oid_str, NULL, "%u", oid );
-    assert ( rc == 0 );
-
-    rc = VFSManagerMakePath ( self, new_path, oid_str );
-    if ( rc == 0 )
-    {
-        VPath * path = * new_path;
-        switch ( path -> path_type )
-        {
-        case vpInvalid:
-        case vpNameOrAccession:
-        case vpName:
-            break;
-        default:
-            VPathRelease ( path );
-            * new_path = NULL;
-            return RC ( rcVFS, rcMgr, rcConstructing, rcToken, rcIncorrect );
-        }
-
-        VPathCaptureScheme ( path, "ncbi-obj", 0, 8 );
-        path -> obj_id = oid;
-        path -> path_type = vpOID;
-    }
-    return rc;
-}
-
-
-
-/* ==========================================
-             HACK O' MATIC
- */
-
-#include <vfs/path-priv.h>
-#include <vfs/manager-priv.h>
-#include <kfs/directory.h>
-
-/* MakeDirectoryRelative
- *  apparently the idea was to interpret "posix_path" against
- *  "dir" to come up with a stand-alone path that could be used
- *  without "dir" in the future. this is a total misunderstanding
- *  of the filesystem.
- *
- *  the old code would call create system path from the posix_path,
- *  which seems to make little sense on Windows... then it would
- *  decide whether "posix_path" was standalone or directory relative.
- */
-static
-rc_t LegacyVPathResolveAccession ( VPath ** new_path, const VPath * path )
-{
-    rc_t rc;
-    VFSManager * mgr;
-
-    * new_path = NULL;
-
-    rc = VFSManagerMake ( & mgr );
-    if ( rc == 0 )
-    {
-        VResolver * resolver;
-        rc = VFSManagerGetResolver ( mgr, & resolver );
-        if ( rc == 0 )
-        {
-            rc = VResolverLocal ( resolver, path, ( const VPath** ) new_path );
-            if ( GetRCState ( rc ) == rcNotFound )
-                rc = VResolverRemote ( resolver, eProtocolHttp, path, ( const VPath** ) new_path, NULL );
-
-            VResolverRelease ( resolver );
-        }
-
-        VFSManagerRelease ( mgr );
-    }
-
-    return rc;
-}
-
-static
-rc_t LegacyVPathMakeKDirRelative ( VPath ** new_path, const KDirectory * dir, const VPath * path )
-{
-    /* resolve the provided path against directory */
-    char resolved [ 4096 ];
-    rc_t rc = KDirectoryResolvePath ( dir, true, resolved, sizeof resolved,
-        "%.*s", ( uint32_t ) path -> path . size, path -> path . addr );
-    if ( rc == 0 )
-    {
-        /* re-evaluate, adding in any query and fragment */
-        rc = VPathMakeFromText ( new_path, "%s%S%S", resolved, & path -> query, & path -> fragment );
-        if ( rc == 0 )
-        {
-            VPath * relpath = * new_path;
-
-            /* reassess the scheme */
-            String scheme;
-            rc = VPathGetSchemeInt ( relpath, & scheme );
-            if ( rc == 0 )
-                relpath -> scheme = scheme;
-
-            return 0;
-        }
-    }
-
-    * new_path = NULL;
-    return rc;
-}
-
-LIB_EXPORT rc_t CC LegacyVPathMakeDirectoryRelative ( VPath ** new_path,
-    const KDirectory * dir, const char * posix_path )
-{
-    rc_t rc;
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( dir == NULL )
-            rc = RC ( rcVFS, rcMgr, rcResolving, rcDirectory, rcNull );
-        else
-        {
-            /* first, try to get a VPath from "posix_path" */
-            rc = LegacyVPathMakeFmt ( new_path, posix_path );
-            if ( rc == 0 )
-            {
-                VPath * path = * new_path;
-
-                /* now try to interpret the thing */
-                if ( path -> from_uri )
-                {
-                    /* look at scheme */
-                    switch ( LegacyVPathGetUri_t ( path ) )
-                    {
-                    case vpuri_ncbi_acc:
-                    case vpuri_ncbi_obj:
-                    case vpuri_ncbi_legrefseq:
-                        /* try to resolve using VResolver */
-                        rc = LegacyVPathResolveAccession ( new_path, path );
-                        break;
-
-                    case vpuri_ncbi_vfs:
-                    case vpuri_file:
-                        /* test for full path */
-                        if ( path -> path_type == vpFullPath || path -> path_type == vpUNCPath )
-                            return 0;
-
-                        /* interpret relative to given directory */
-                        rc = LegacyVPathMakeKDirRelative ( new_path, dir, path );
-                        break;
-
-                    case vpuri_http:
-                    case vpuri_ftp:
-                    case vpuri_fasp:
-                        /* calling code would know how to handle these */
-                        return 0;
-
-                    default:
-                        /* while apparently valid URIs, callers would not know */
-                        * new_path = NULL;
-                    }
-                }
-
-                else
-                {
-                    /* look at deduced path type */
-                    switch ( path -> path_type )
-                    {
-                    case vpOID:
-                    case vpAccession: /* this is not expected not be set... */
-                    case vpNameOrOID:
-                    case vpNameOrAccession:
-                        /* try to resolve using VResolver */
-                        rc = LegacyVPathResolveAccession ( new_path, path );
-                        if ( rc == 0 )
-                            break;
-
-                        /* no break */
-
-                    case vpName:
-                    case vpRelPath:
-                        rc = LegacyVPathMakeKDirRelative ( new_path, dir, path );
-                        break;
-
-                    case vpUNCPath:
-                    case vpFullPath:
-                        return 0;
-
-                    default:
-                        * new_path = NULL;
-                    }
-                }
-
-                /* clean up path */
-                assert ( * new_path != path );
-                VPathRelease ( path );
-                return rc;
-            }
-        }
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-
-/* Option
- *  rc == 0 if the option has been specified
- *  for options with a parameter, the value of the parameter is copied to buffer
- */
-LIB_EXPORT rc_t CC VPathOption ( const VPath * self, VPOption_t option,
-    char * buffer, size_t buffer_size, size_t * num_read )
-{
-    rc_t rc = VPathReadTestSelf ( self, buffer, buffer_size, num_read );
-    if ( rc == 0 )
-    {
-        const char * param1, * param2 = NULL;
-
-        switch ( option )
-        {
-        case vpopt_encrypted:
-            param1 = "enc";
-            param2 = "encrypt";
-            break;
-        case vpopt_pwpath:
-            param1 = "pwfile";
-            break;
-        case vpopt_pwfd:
-            param1 = "pwfile";
-            break;
-        case vpopt_readgroup:
-            param1 = "readgroup";
-            break;
-#if 0            
-        case vpopt_temporary_pw_hack:
-            param1 = "temporary_pw_hack";
-            break;
-#endif            
-        case vpopt_vdb_ctx:
-            param1 = "vdb-ctx";
-            break;
-        case vpopt_gap_ticket: 
-            param1 = "tic";
-            break;
-        default:
-            return RC ( rcVFS, rcPath, rcReading, rcToken, rcUnrecognized );
-        }
-
-        rc = VPathReadParam ( self, param1, buffer, buffer_size, num_read );
-        if ( param2 != NULL && GetRCState ( rc ) == rcNotFound )
-            rc = VPathReadParam ( self, param2, buffer, buffer_size, num_read );
-    }
-    return rc;
-}
-
-
-rc_t LegacyVPathMake ( VPath ** new_path, const char * posix_path )
-{
-    return LegacyVPathMakeFmt ( new_path, posix_path );
-}
-
-rc_t LegacyVPathMakeFmt ( VPath ** new_path, const char * fmt, ... )
-{
-    rc_t rc;
-
-    va_list args;
-    va_start ( args, fmt );
-
-    rc = LegacyVPathMakeVFmt ( new_path, fmt, args );
-
-    va_end ( args );
-
-    return rc;
-}
-
-rc_t LegacyVPathMakeVFmt ( VPath ** new_path, const char * fmt, va_list args )
-{
-    rc_t rc;
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcPath, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( fmt == NULL )
-            rc = RC ( rcVFS, rcPath, rcConstructing, rcParam, rcNull );
-        else if ( fmt [ 0 ] == 0 )
-            rc = RC ( rcVFS, rcPath, rcConstructing, rcParam, rcEmpty );
-        else
-        {
-            rc = VPathMakeFromVText ( new_path, fmt, args );
-            if ( rc == 0 )
-            {
-                VPath * path = * new_path;
-
-                if ( ! path -> from_uri )
-                {
-                    String scheme;
-                    rc = VPathGetSchemeInt ( path, & scheme );
-                    if ( rc == 0 )
-                        path -> scheme = scheme;
-                }
-
-                return 0;
-            }
-        }
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC LegacyVPathGetScheme_t ( const VPath * self, VPUri_t * uri_type )
-{
-    rc_t rc;
-
-    if ( uri_type == NULL )
-        rc = RC ( rcVFS, rcPath, rcAccessing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcPath, rcAccessing, rcSelf, rcNull );
-        else if ( self -> path_type != vpInvalid )
-        {
-            if ( ! self -> from_uri )
-            {
-                * uri_type = vpuri_none;
-                return 0;
-            }
-
-            * uri_type = self -> scheme_type;
-            return 0;
-        }
-
-        /* object was invalid */
-        * uri_type = vpuri_invalid;
-    }
-
-    return rc;
-}
-
-VPUri_t LegacyVPathGetUri_t ( const VPath * self )
-{
-    VPUri_t uri_type;
-    LegacyVPathGetScheme_t ( self, & uri_type );
-    return uri_type;
-}
diff --git a/libs/vfs/resolver-priv.h b/libs/vfs/resolver-priv.h
deleted file mode 100644
index 860c601..0000000
--- a/libs/vfs/resolver-priv.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*===========================================================================
-*
-*                            Public Domain Notice
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_resolver_priv_
-#define _h_resolver_priv_
-
-#ifndef _h_vfs_resolver_
-#include <vfs/resolver.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*--------------------------------------------------------------------------
- * KConfig Repository Structure
- *  expressed in pseudo BNF:
- *
- *  base-config
- *      = "repository" <category>*
- *      ;
- *
- *  category
- *      = "remote" <remote-sub-category>*
- *      | "site" <site-sub-category>*
- *      | "user" <user-sub-category>*
- *      ;
- *
- *  remote-sub-category
- *      = "main" <public-remote-named-repository>*
- *      | "aux" <public-remote-named-repository>*
- *      | "protected" <protected-remote-named-repository>*
- *      ;
- *
- *  site-sub-category
- *      = "main" <site-named-repository>*
- *      | "aux" <site-named-repository>*
- *      ;
- *
- *  user-sub-category
- *      = "public" <public-user-named-repository>*
- *      | "protected" ID <protected-user-named-repository>*
- *      ;
- *
- *  public-remote-named-repository
- *      = ID <public-remote-repository>
- *      ;
- *
- *  protected-remote-named-repository
- *      = ID <protected-remote-repository>
- *      ;
- *
- *  site-named-repository
- *      = ID <site-repository>
- *      ;
- *
- *  public-user-named-repository
- *      = ID <public-user-repository>
- *      ;
- *
- *  protected-user-named-repository
- *      = ID <protected-user-repository>
- *      ;
- *
- *  public-remote-repository
- *      = <public-remote-root> [ <disabled> ] <apps>*
- *      ;
- *
- *  protected-remote-repository
- *      = <protected-remote-root> [ <disabled> ] <apps>*
- *      ;
- *
- *  site-repository
- *      = <local-root> [ <disabled> ] <apps>*
- *      ;
- *
- *  public-user-repository
- *      = <local-root> [ <disabled> ] [ <cache-enabled> ] <apps>*
- *      ;
- *
- *  protected-user-repository
- *      = <local-root> <passwd> <download-ticket> [ <disabled> ] [ <cache-enabled> ] <apps>*
- *      ;
- *
- *  apps
- *      = "refseq" <app>
- *      | "sra" <app>
- *      | "wgs" <app>
- *      ;
- *
- *  app
- *      = [ <disabled> ] "volumes" <volume>*
- *      ;
- *
- *  volume
- *      = <expansion-alg> "=" <path-list>
- *      ;
- *
- *  expansion-alg
- *      = "flat" | "sra1000" | "sra1024" | "fuse1000" | "refseq" | ...
- *      ;
- *
- *  disabled
- *      = "disabled" "=" ( "true" | * )  # any value other than "true" is false
- *      ;
- *
- *  cache-enabled
- *      = "cache-enabled" "=" ( "true" | * )  # any value other than "true" is false
- *      ;
- */
-
-#define rcResolver   rcTree
-#define rcRepository rcDirectory
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_resolver_priv_ */
diff --git a/libs/vfs/resolver.c b/libs/vfs/resolver.c
deleted file mode 100644
index 6c4c40b..0000000
--- a/libs/vfs/resolver.c
+++ /dev/null
@@ -1,3992 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-
-#include <vfs/extern.h>
-#include "resolver-priv.h"
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <kns/manager.h>
-#include <kns/http.h>
-#include <kns/stream.h>
-#include <kns/curl-file.h>
-#include <kns/KCurlRequest.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfg/repository.h>
-#include <kfg/config.h>
-
-#include <klib/text.h>
-#include <klib/vector.h>
-#include <klib/refcount.h>
-#include <klib/namelist.h>
-#include <klib/printf.h>
-#include <klib/data-buffer.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/log.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <vfs/path-priv.h>
-#include "path-priv.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-/* to turn off CGI name resolution for
-   any refseq accessions */
-#define NO_REFSEQ_CGI 1
-
-/* to turn off CGI name resolution for
-   legacy WGS packages used by refseq */
-#define NO_LEGACY_WGS_REFSEQ_CGI NO_REFSEQ_CGI
-
-#define USE_CURL 1
-
-#define NAME_SERVICE_MAJ_VERS 1
-#define NAME_SERVICE_MIN_VERS 1
-#define ONE_DOT_ONE 0x01010000
-#define NAME_SERVICE_VERS \
-    ( ( NAME_SERVICE_MAJ_VERS << 24 ) | ( NAME_SERVICE_MIN_VERS << 16 ) )
-
-
-/*--------------------------------------------------------------------------
- * String
- */
-static
-void CC string_whack ( void *obj, void *ignore )
-{
-    StringWhack ( ( String* ) obj );
-}
-
-/*--------------------------------------------------------------------------
- * VResolverAccToken
- *  breaks up an accession into parts
- *
- *  "acc" is entire accession as given
- *
- *  the remainder is divided like so:
- *
- *    [<prefix>_]<alpha><digits>[.<ext1>[.<ext2>]]
- *
- *  prefix is optional
- *  alpha can be zero length iff prefix is not zero length
- *  digits must be non-zero length
- *  ext1 and ext2 are optional
- */
-typedef struct VResolverAccToken VResolverAccToken;
-struct VResolverAccToken
-{
-    String acc;
-    String prefix;
-    String alpha;
-    String digits;
-    String ext1;
-    String ext2;
-    String suffix;
-};
-
-/*--------------------------------------------------------------------------
- * VResolverAlg
- *  represents a set of zero or more volumes
- *  each of which is addressed using a particular expansion algorithm
- */
-typedef enum
-{
-    appUnknown,
-    appAny,
-    appREFSEQ,
-    appSRA,
-    appWGS,
-    appNANNOT,
-    appNAKMER,
-    appCount
-} VResolverAppID;
-
-typedef enum
-{
-    algCGI,
-    algLeafPath,
-    algSRAFlat,
-    algSRA1024,
-    algSRA1000,
-    algFUSE1000,
-    algREFSEQ,
-    algWGSFlat,
-    algWGS,
-    algFuseWGS,
-    algSRA_NCBI,
-    algSRA_EBI,
-
-    algNANNOTFlat,
-    algNANNOT,
-    algFuseNANNOT,
-    algNAKMERFlat,
-    algNAKMER,
-    algFuseNAKMER,
-
-    /* leave as last value */
-    algUnknown
-
-} VResolverAlgID;
-
-typedef enum
-{
-    cacheDisallow,
-    cacheAllow
-} VResolverCacheAllow;
-
-typedef struct VResolverAlg VResolverAlg;
-struct VResolverAlg
-{
-    /* volume paths - stored as String* */
-    Vector vols;
-
-    /* root path - borrowed reference */
-    const String *root;
-
-    /* download ticket - borrowed reference
-       non-NULL means that the root is a
-       resolver CGI. also, don't rely on
-       presence of any volumes... */
-    const String *ticket;
-
-    /* app_id helps to filter out volumes by app */
-    VResolverAppID app_id;
-
-    /* how to expand an accession */
-    VResolverAlgID alg_id;
-
-    /* a property of the repository */
-    bool protected;
-
-    /* whether the volumes are cache-capable
-       in particularl, enabled if cache forced */
-    bool cache_capable;
-
-    /* whether the volumes are cache-enabled */
-    bool cache_enabled;
-
-    /* whether the volume is disabled in config */
-    bool disabled;
-#if 0
-    VRemoteProtocols protocols;
-#endif
-};
-
-
-/* Whack
- */
-static
-void CC VResolverAlgWhack ( void *item, void *ignore )
-{
-    VResolverAlg *self = item;
-
-    /* drop any volumes */
-    VectorWhack ( & self -> vols, string_whack, NULL );
-
-    /* everything else is a borrowed reference */
-
-    free ( self );
-}
-
-/* Make
- */
-static
-rc_t VResolverAlgMake ( VResolverAlg **algp, const String *root,
-     VResolverAppID app_id, VResolverAlgID alg_id, bool protected, bool disabled )
-{
-    rc_t rc;
-    VResolverAlg *alg = calloc ( 1, sizeof * alg );
-    if ( alg == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        VectorInit ( & alg -> vols, 0, 8 );
-        alg -> root = root;
-        alg -> app_id = app_id;
-        alg -> alg_id = alg_id;
-        alg -> protected = protected;
-        alg -> disabled = disabled;
-        rc = 0;
-    }
-
-    * algp = alg;
-    return rc;
-}
-
-/* MakeLocalWGSRefseqURI
- *  create a special URI that tells KDB how to open this
- *  obscured table, hidden away within a KAR file
- */
-static
-rc_t VResolverAlgMakeLocalWGSRefseqURI ( const VResolverAlg *self,
-    const String *vol, const String *exp, const String *acc, const VPath ** path )
-{
-    if ( self -> root == NULL )
-        return VPathMakeFmt ( ( VPath** ) path, NCBI_FILE_SCHEME ":%S/%S#tbl/%S", vol, exp, acc );
-    return VPathMakeFmt ( ( VPath** ) path, NCBI_FILE_SCHEME ":%S/%S/%S#tbl/%S", self -> root, vol, exp, acc );
-}
-
-/* MakeeRemoteWGSRefseqURI
- *  create a special URI that tells KDB how to open this
- *  obscured table, hidden away within a KAR file
- */
-static
-rc_t VResolverAlgMakeRemoteWGSRefseqURI ( const VResolverAlg *self,
-    const char *url, const String *acc, const VPath ** path )
-{
-    return VPathMakeFmt ( ( VPath** ) path, "%s#tbl/%S", url, acc );
-}
-
-/* MakeRemotePath
- *  the path is known to exist in the remote file system
- *  turn it into a VPath
- */
-static
-rc_t VResolverAlgMakeRemotePath ( const VResolverAlg *self,
-    const char *url, const VPath ** path )
-{
-    return VPathMakeFmt ( ( VPath** ) path, url );
-}
-
-/* MakeLocalPath
- *  the path is known to exist in the local file system
- *  turn it into a VPath
- */
-static
-rc_t VResolverAlgMakeLocalPath ( const VResolverAlg *self,
-    const String *vol, const String *exp, const VPath ** path )
-{
-    if ( self -> root == NULL )
-        return VPathMakeFmt ( ( VPath** ) path, "%S/%S", vol, exp );
-    return VPathMakeFmt ( ( VPath** ) path, "%S/%S/%S", self -> root, vol, exp );
-}
-
-/* expand_accession
- *  expand accession according to algorithm
- */
-static
-rc_t expand_algorithm ( const VResolverAlg *self, const VResolverAccToken *tok,
-    char *expanded, size_t bsize, size_t *size, bool legacy_wgs_refseq )
-{
-    rc_t rc;
-    uint32_t num;
-
-   switch ( self -> alg_id )
-    {
-    case algCGI:
-        return RC ( rcVFS, rcResolver, rcResolving, rcType, rcIncorrect );
-    case algLeafPath:
-        rc = string_printf ( expanded, bsize, size, "%S", & tok -> acc );
-        break;
-    case algSRAFlat:
-        rc = string_printf ( expanded, bsize, size,
-            "%S%S.sra", & tok -> alpha, & tok -> digits );
-        break;
-    case algSRA1024:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "%S/%06u/%S%S.sra", & tok -> alpha, num >> 10, & tok -> alpha, & tok -> digits );
-        break;
-    case algSRA1000:
-        num = ( uint32_t ) ( tok -> alpha . size + tok -> digits . size - 3 );
-        rc = string_printf ( expanded, bsize, size,
-            "%S/%.*S/%S%S.sra", & tok -> alpha, num, & tok -> acc, & tok -> alpha, & tok -> digits );
-        break;
-    case algFUSE1000:
-        num = ( uint32_t ) ( tok -> alpha . size + tok -> digits . size - 3 );
-        rc = string_printf ( expanded, bsize, size,
-            "%S/%.*S/%S%S/%S%S.sra", & tok -> alpha, num, & tok -> acc, 
-            & tok -> alpha, & tok -> digits, & tok -> alpha, & tok -> digits );
-        break;
-    case algREFSEQ:
-        if ( ! legacy_wgs_refseq )
-            rc = string_printf ( expanded, bsize, size, "%S", & tok -> acc );
-        else
-            rc = string_printf ( expanded, bsize, size, "%S%.2S", & tok -> alpha, & tok -> digits );
-        break;
-    case algWGSFlat:
-        num = ( uint32_t ) ( tok -> alpha . size + 2 );
-        if ( tok -> prefix . size != 0 )
-            num += tok -> prefix . size + 1;
-        rc = string_printf ( expanded, bsize, size,
-            "%.*S", num, & tok -> acc );
-        break;
-    case algWGS:
-        num = ( uint32_t ) ( tok -> alpha . size + 2 );
-        if ( tok -> prefix . size != 0 )
-            num += tok -> prefix . size + 1;
-        rc = string_printf ( expanded, bsize, size,
-            "WGS/%.2s/%.2s/%.*S", tok -> alpha . addr, tok -> alpha . addr + 2, num, & tok -> acc );
-        break;
-    case algFuseWGS:
-        num = ( uint32_t ) ( tok -> alpha . size + 2 );
-        if ( tok -> prefix . size != 0 )
-            num += tok -> prefix . size + 1;
-        rc = string_printf ( expanded, bsize, size,
-            "%.2s/%.2s/%.*S", tok -> alpha . addr, tok -> alpha . addr + 2, num, & tok -> acc );
-        break;
-    case algSRA_NCBI:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "%S/%06u/%S%S", & tok -> alpha, num >> 10, & tok -> alpha, & tok -> digits );
-        break;
-    case algSRA_EBI:
-        num = ( uint32_t ) ( tok -> alpha . size + tok -> digits . size - 3 );
-        rc = string_printf ( expanded, bsize, size,
-            "%S/%.*S/%S%S", & tok -> alpha, num, & tok -> acc, & tok -> alpha, & tok -> digits );
-        break;
-
-    case algNANNOTFlat:
-        rc = string_printf ( expanded, bsize, size, "%S", & tok -> acc );
-        break;
-    case algNANNOT:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "%03u/%03u/%S", num / 1000000, ( num / 1000 ) % 1000, & tok -> acc );
-        break;
-    case algFuseNANNOT:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "%03u/%03u/%S", num / 1000000, ( num / 1000 ) % 1000, & tok -> acc );
-        break;
-
-    case algNAKMERFlat:
-        rc = string_printf ( expanded, bsize, size, "%S", & tok -> acc );
-        break;
-    case algNAKMER:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "kmer/%03u/%03u/%S", num / 1000000, ( num / 1000 ) % 1000, & tok -> acc );
-        break;
-    case algFuseNAKMER:
-        num = ( uint32_t ) strtoul ( tok -> digits . addr, NULL, 10 );
-        rc = string_printf ( expanded, bsize, size,
-            "kmer/%03u/%03u/%S", num / 1000000, ( num / 1000 ) % 1000, & tok -> acc );
-        break;
-
-    default:
-        return RC ( rcVFS, rcResolver, rcResolving, rcType, rcUnrecognized );
-    }
-
-   return rc;
-}
-
-/* LocalResolve
- *  resolve an accession into a VPath or not found
- *
- *  1. expand accession according to algorithm
- *  2. search all volumes for accession
- *  3. return not found or new VPath
- */
-static
-rc_t VResolverAlgLocalResolve ( const VResolverAlg *self,
-    const KDirectory *wd, const VResolverAccToken *tok,
-    const VPath ** path, bool legacy_wgs_refseq, bool for_cache )
-{
-    KPathType kpt;
-    uint32_t i, count;
-
-    /* expanded accession */
-    String exp;
-    size_t size;
-    char expanded [ 256 ];
-
-    /* in some cases, "root" is NULL */
-    const String *vol, *root = self -> root;
-
-    /* expand the accession */
-    rc_t rc = expand_algorithm ( self, tok, expanded, sizeof expanded, & size, legacy_wgs_refseq );
-
-    /* should never have a problem here... */
-    if ( rc != 0 )
-        return rc;
-
-    /* if this is to detect a cache file, append extension */
-    if ( for_cache )
-    {
-        size += string_copy ( & expanded [ size ], sizeof expanded - size, ".cache", sizeof ".cache" - 1 );
-        if ( size == sizeof expanded )
-            return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    }
-
-    /* turn the expanded portion into a String
-       we know that size is also length due to
-       accession content rules */
-    StringInit ( & exp, expanded, size, ( uint32_t ) size );
-
-    /* remove the cache extension */
-    if ( for_cache )
-    {
-        exp . len -= sizeof ".cache" - 1;
-        exp . size -= sizeof ".cache" - 1;
-    }
-
-    /* now search all volumes */
-    count = VectorLength ( & self -> vols );
-    if ( root == NULL )
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            vol = VectorGet ( & self -> vols, i );
-            kpt = KDirectoryPathType ( wd, "%.*s/%.*s"
-                , ( int ) vol -> size, vol -> addr
-                , ( int ) size, expanded );
-            switch ( kpt & ~ kptAlias )
-            {
-            case kptFile:
-            case kptDir:
-                if ( legacy_wgs_refseq )
-                    return VResolverAlgMakeLocalWGSRefseqURI ( self, vol, & exp, & tok -> acc, path );
-                return VResolverAlgMakeLocalPath ( self, vol, & exp, path );
-            default:
-                break;
-            }
-        }
-    }
-    else
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            vol = VectorGet ( & self -> vols, i );
-            kpt = KDirectoryPathType ( wd, "%.*s/%.*s/%.*s"
-                , ( int ) root -> size, root -> addr
-                , ( int ) vol -> size, vol -> addr
-                , ( int ) size, expanded );
-            switch ( kpt & ~ kptAlias )
-            {
-            case kptFile:
-            case kptDir:
-                if ( legacy_wgs_refseq )
-                    return VResolverAlgMakeLocalWGSRefseqURI ( self, vol, & exp, & tok -> acc, path );
-                return VResolverAlgMakeLocalPath ( self, vol, & exp, path );
-            default:
-                break;
-            }
-        }
-    }
-    
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-static
-rc_t VPathCheckFromNamesCGI ( const VPath * path, const String *ticket, const VPath ** mapping )
-{
-    size_t i, size;
-    const char * start;
-
-    /* must have an explicit scheme */
-    if ( ! path -> from_uri )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    /* can only be http or fasp */
-    switch ( path -> scheme_type )
-    {
-    case vpuri_http:
-    case vpuri_fasp:
-        break;
-    default:
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    }
-
-
-    /* must have a host-spec with all ascii-characters */
-    switch ( path -> host_type )
-    {
-    case vhDNSName:
-        if ( path -> host . size == 0 || path -> host . size != ( size_t ) path -> host . len )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-        start = path -> host . addr;
-        size = path -> host . size;
-        for ( i = 0; i < size; ++ i )
-        {
-            if ( isalnum ( start [ i ] ) )
-                continue;
-            switch ( start [ i ] )
-            {
-            case '.':
-            case '-':
-                continue;
-            }
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-        }
-        break;
-    case vhIPv4:
-    case vhIPv6:
-        break;
-    }
-
-    /* must have a full-path */
-    if ( path -> path_type != vpFullPath )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    /* only ascii characters */
-    assert ( path -> path . size != 0 );
-    if ( path -> path . size != ( size_t ) path -> path . len )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    start = path -> path . addr;
-    size = path -> path . size;
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( isalnum ( start [ i ] ) )
-            continue;
-        switch ( start [ i ] )
-        {
-        case '/':
-        case '.':
-        case '-':
-            continue;
-        }
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    }
-
-#if DO_NOT_USE_TIC_HACK
-    /* if the ticket was placed into the mapped path */
-    if ( mapping != NULL )
-        ticket = NULL;
-#endif
-
-    if ( path -> query . size != 0 )
-    {
-        String name, val, req;
-
-        /* query must match ticket */
-        if ( ticket == NULL )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-        StringSubstr ( & path -> query, & name, 0, 5 );
-        StringSubstr ( & path -> query, & val, 5, 0 );
-        if ( ! StringEqual ( & val, ticket ) )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-        CONST_STRING ( & req, "?tic=" );
-        if ( ! StringEqual ( & name, & req ) )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    }
-
-    /* cannot have a fragment */
-    if ( path -> fragment . size != 0 )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    return 0;
-}
-
-
-/* ParseResolverCGIResponse_1_0
- *  expect single row table, with this structure:
- *
- *  <accession>|<download-ticket>|<url>|<result-code>|<message>
- */
-static
-rc_t VResolverAlgParseResolverCGIResponse_1_0 ( const char *start, size_t size,
-    const VPath ** path, const String *acc, const String *ticket )
-{
-    rc_t rc;
-    KLogLevel lvl;
-    char *rslt_end;
-    uint32_t result_code;
-
-    String accession, download_ticket, url, rslt_code, msg;
-
-    /* get accession */
-    const char *end = start + size;
-    const char *sep = string_chr ( start, size, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & accession, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get download-ticket */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & download_ticket, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get url */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & url, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get result-code */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & rslt_code, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get msg */
-    start = sep + 1;
-    for ( sep = end; sep > start; -- sep )
-    {
-        switch ( sep [ -1 ] )
-        {
-        case '\n':
-        case '\r':
-            continue;
-        default:
-            break;
-        }
-
-        break;
-    }
-    StringInit ( & msg, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* compare acc to accession */
-    if ( ! StringEqual ( & accession, acc ) )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    /* compare ticket
-       currently this makes sense with 1 request from a known workspace */
-    if ( download_ticket . size != 0 )
-    {
-        if ( ticket == NULL || ! StringEqual ( & download_ticket, ticket ) )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    }
-
-    /* get the result code */
-    if ( rslt_code . size == 0 )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    result_code = strtoul ( rslt_code . addr, & rslt_end, 10 );
-    if ( ( const char* ) rslt_end - rslt_code . addr != rslt_code . size )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    /* still have to test the URL */    
-
-    switch ( result_code / 100 )
-    {
-    case 1:
-        /* informational response
-           not much we can do here */
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 2:
-        /* successful response
-           but can only handle 200 */
-        if ( result_code == 200 )
-        {
-            /* normal public response */
-            if ( download_ticket . size == 0 )
-                rc = VPathMakeFmt ( ( VPath** ) path, "%S", & url );
-            else
-            {
-                /* protected response */
-                rc = VPathMakeFmt ( ( VPath** ) path, "%S?tic=%S", & url, & download_ticket );
-            }
-
-            if ( rc == 0 )
-            {
-                rc = VPathCheckFromNamesCGI ( * path, ticket, NULL );
-                if ( rc == 0 )
-                    return 0;
-
-                VPathRelease ( * path );
-                * path = NULL;
-            }
-
-            return rc;
-        }
-
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 3:
-        /* redirection
-           currently this is being handled by our request object */
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 4:
-        /* client error */
-        lvl = klogErr;
-        switch ( result_code )
-        {
-        case 400:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcInvalid );
-            break;
-        case 401:
-        case 403:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcQuery, rcUnauthorized );
-            break;
-        case 404:
-            return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-        case 410:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-            break;
-        default:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        }
-        break;
-
-    case 5:
-        /* server error */
-        lvl = klogSys;
-        switch ( result_code )
-        {
-        case 503:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcDatabase, rcNotAvailable );
-            break;
-        case 504:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcTimeout, rcExhausted );
-            break;
-        default:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        }
-        break;
-
-    default:
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-    }
-
-    /* log message to user */
-    PLOGERR ( lvl, ( lvl, rc, "failed to resolve accession '$(acc)' - $(msg) ( $(code) )",
-        "acc=%S,msg=%S,code=%u", acc, & msg, result_code ) );
-    return rc;
-}
-
-
-/* ParseResolverCGIResponse_1_1
- *  expect single row table, with this structure (SRA-1690) :
- *
- *  <accession>|obj-id|name|size|mod-date|md5|<download-ticket>|<url>|<result-code>|<message>
- */
-static
-rc_t VResolverAlgParseResolverCGIResponse_1_1 ( const char *start, size_t size,
-    const VPath ** path, const VPath ** mapping, const String *acc, const String *ticket )
-{
-    rc_t rc;
-    KLogLevel lvl;
-    char *rslt_end;
-    uint32_t result_code;
-
-    String accession, obj_id, name, size_str, mod_date, md5, download_ticket, url, rslt_code, msg;
-
-    /* get accession */
-    const char *end = start + size;
-    const char *sep = string_chr ( start, size, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & accession, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get obj-id */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & obj_id, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get name */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & name, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get size */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & size_str, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get mod-date */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & mod_date, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get md5 */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & md5, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get download-ticket */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & download_ticket, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get url */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & url, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get result-code */
-    start = sep + 1;
-    sep = string_chr ( start, end - start, '|' );
-    if ( sep == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-    StringInit ( & rslt_code, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* get msg */
-    start = sep + 1;
-    for ( sep = end; sep > start; -- sep )
-    {
-        switch ( sep [ -1 ] )
-        {
-        case '\n':
-        case '\r':
-            continue;
-        default:
-            break;
-        }
-
-        break;
-    }
-    StringInit ( & msg, start, sep - start, ( uint32_t ) ( sep - start ) );
-
-    /* compare acc to accession or obj_id */
-    if ( ! StringEqual ( & accession, acc ) && ! StringEqual ( & obj_id, acc ) )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    /* compare ticket
-       currently this makes sense with 1 request from a known workspace */
-    if ( download_ticket . size != 0 )
-    {
-        if ( ticket == NULL || ! StringEqual ( & download_ticket, ticket ) )
-            return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    }
-
-    /* get the result code */
-    if ( rslt_code . size == 0 )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-    result_code = strtoul ( rslt_code . addr, & rslt_end, 10 );
-    if ( ( const char* ) rslt_end - rslt_code . addr != rslt_code . size )
-        return RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcCorrupt );
-
-    /* still have to test the URL */    
-
-    switch ( result_code / 100 )
-    {
-    case 1:
-        /* informational response
-           not much we can do here */
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 2:
-        /* successful response
-           but can only handle 200 */
-        if ( result_code == 200 )
-        {
-            /* normal public response */
-            if ( download_ticket . size == 0
-#if DO_NOT_USE_TIC_HACK
-                 || mapping != NULL
-#endif
-                )
-            {
-                rc = VPathMakeFmt ( ( VPath** ) path, "%S", & url );
-            }
-            else
-            {
-                /* protected response */
-                rc = VPathMakeFmt ( ( VPath** ) path, "%S?tic=%S", & url, & download_ticket );
-            }
-
-            if ( rc == 0 )
-            {
-                rc = VPathCheckFromNamesCGI ( * path, ticket, mapping );
-                if ( rc == 0 )
-                {
-                    if ( mapping == NULL )
-                        return 0;
-
-                    if ( download_ticket . size != 0 )
-                    {
-                        if ( accession . size != 0 )
-                            rc = VPathMakeFmt ( ( VPath** ) mapping, "ncbi-acc:%S?tic=%S", & accession, & download_ticket );
-                        else if ( name . size == 0 )
-                            return 0;
-                        else
-                            rc = VPathMakeFmt ( ( VPath** ) mapping, "ncbi-file:%S?tic=%S", & name, & download_ticket );
-                    }
-                    else if ( accession . size != 0 )
-                        rc = VPathMakeFmt ( ( VPath** ) mapping, "ncbi-acc:%S", & accession );
-                    else if ( name . size == 0 )
-                        return 0;
-                    else
-                        rc = VPathMakeFmt ( ( VPath** ) mapping, "ncbi-file:%S", & name );
-
-                    if ( rc == 0 )
-                        return 0;
-                }
-
-                VPathRelease ( * path );
-                * path = NULL;
-            }
-
-            return rc;
-        }
-
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 3:
-        /* redirection
-           currently this is being handled by our request object */
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        break;
-
-    case 4:
-        /* client error */
-        lvl = klogErr;
-        switch ( result_code )
-        {
-        case 400:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcMessage, rcInvalid );
-            break;
-        case 401:
-        case 403:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcQuery, rcUnauthorized );
-            break;
-        case 404:
-            return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-        case 410:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-            break;
-        default:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        }
-        break;
-
-    case 5:
-        /* server error */
-        lvl = klogSys;
-        switch ( result_code )
-        {
-        case 503:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcDatabase, rcNotAvailable );
-            break;
-        case 504:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcTimeout, rcExhausted );
-            break;
-        default:
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-        }
-        break;
-
-    default:
-        lvl = klogInt;
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcError, rcUnexpected );
-    }
-
-    /* log message to user */
-    PLOGERR ( lvl, ( lvl, rc, "failed to resolve accession '$(acc)' - $(msg) ( $(code) )",
-        "acc=%S,msg=%S,code=%u", acc, & msg, result_code ) );
-    return rc;
-}
-
-
-/* ParseResolverCGIResponse
- *  the response should be NUL terminated
- *  but should also be close to the size of result
- */
-static
-rc_t VResolverAlgParseResolverCGIResponse ( const KDataBuffer *result,
-    const VPath ** path, const VPath ** mapping, const String *acc, const String *ticket )
-{
-    /* the textual response */
-    const char *start = ( const void* ) result -> base;
-    size_t i, size = KDataBufferBytes ( result );
-
-    DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS), (" Response = %s\n", start));
-
-    /* peel back buffer to significant bytes */
-    while ( size > 0 && start [ size - 1 ] == 0 )
-        -- size;
-
-    /* skip over blanks */
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( ! isspace ( start [ i ] ) )
-            break;
-    }
-
-    /* at this point, we expect only version 1.0 ... */
-    if ( string_cmp ( & start [ i ], size - i, "#1.0", sizeof "#1.0" - 1, sizeof "#1.0" - 1 ) == 0 )
-    {
-        do
-        {
-            /* accept version line */
-            i += sizeof "#1.0" - 1;
-
-            /* must be followed by eoln */
-            if ( start [ i ] == '\r' && start [ i + 1 ] == '\n' )
-                i += 2;
-            else if ( start [ i ] == '\n' )
-                i += 1;
-            else
-                break;
-
-            /* parse 1.0 response table */
-            return VResolverAlgParseResolverCGIResponse_1_0 ( & start [ i ], size - i, path, acc, ticket );
-        }
-        while ( false );
-    }
-
-    /* ... and 1.1 */
-    if ( string_cmp ( & start [ i ], size - i, "#1.1", sizeof "#1.1" - 1, sizeof "#1.1" - 1 ) == 0 )
-    {
-        do
-        {
-            /* accept version line */
-            i += sizeof "#1.1" - 1;
-
-            /* must be followed by eoln */
-            if ( start [ i ] == '\r' && start [ i + 1 ] == '\n' )
-                i += 2;
-            else if ( start [ i ] == '\n' )
-                i += 1;
-            else
-                break;
-
-            /* parse 1.0 response table */
-            return VResolverAlgParseResolverCGIResponse_1_1 ( & start [ i ], size - i, path, mapping, acc, ticket );
-        }
-        while ( false );
-    }
-
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-/* RemoteProtectedResolve
- *  use NCBI CGI to resolve accession into URL
- */
-static
-rc_t VResolverAlgRemoteProtectedResolve ( const VResolverAlg *self,
-    const KNSManager *kns, VRemoteProtocols protocols, const String *acc,
-    const VPath ** path, const VPath ** mapping, bool legacy_wgs_refseq )
-{
-#if USE_CURL
-    struct KCurlRequest *req;
-    rc_t rc = 0;
-    DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS), ("names.cgi = %S\n", self -> root));
-    rc = KNSManagerMakeCurlRequest ( kns, & req, self -> root -> addr, false );
-    if ( rc == 0 )
-    {
-        String name, val;
-
-        /* build up POST information: */
-        CONST_STRING ( & name, "version" );
-#if NAME_SERVICE_VERS == ONE_DOT_ONE
-        CONST_STRING (& val, "1.1" );
-#else
-        CONST_STRING (& val, "1.0" );
-#endif
-        DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS), ("  %S = %S\n", &name, &val));
-        rc = KCurlRequestAddSField ( req, & name, & val );
-        if ( rc == 0 )
-        {
-            CONST_STRING ( & name, "acc" );
-            DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS), ("  %S = %S\n", &name, acc));
-            rc = KCurlRequestAddSField ( req, & name, acc );
-        }
-        if ( rc == 0 && legacy_wgs_refseq )
-        {
-            CONST_STRING ( & name, "ctx" );
-            CONST_STRING (& val, "refseq" );
-            DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS), ("  %S = %S\n", &name, &val));
-            rc = KCurlRequestAddSField ( req, & name, & val );
-        }
-        if ( rc == 0 && self -> ticket != NULL )
-        {
-            CONST_STRING ( & name, "tic" );
-            DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS),
-                ("  %S = %S\n", &name, self->ticket));
-            rc = KCurlRequestAddSField ( req, & name, self -> ticket );
-        }
-#if NAME_SERVICE_VERS >= ONE_DOT_ONE /* SRA-1690 */
-        if ( rc == 0 )
-        {
-            CONST_STRING ( & name, "accept-proto" );
-            switch ( protocols )
-            {
-            case eProtocolHttp:
-                CONST_STRING ( & val, "http" );
-                break;
-            case eProtocolFasp:
-                CONST_STRING ( & val, "fasp" );
-                break;
-            case eProtocolFaspHttp:
-                CONST_STRING ( & val, "fasp,http" );
-                break;
-            case eProtocolHttpFasp:
-                CONST_STRING ( & val, "http,fasp" );
-                break;
-            default:
-                rc = RC ( rcVFS, rcResolver, rcResolving, rcParam, rcInvalid );
-            }
-            if ( rc == 0 ) {
-                DBGMSG(DBG_VFS, DBG_FLAG(DBG_VFS),
-                    ("  %S = %S\n", &name, &val));
-                rc = KCurlRequestAddSField ( req, & name, & val );
-            }
-        }
-#endif
-
-        /* execute post */
-        if ( rc == 0 )
-        {
-            KDataBuffer result;
-            memset ( & result, 0, sizeof result );
-            rc = KCurlRequestPerform ( req, & result );
-            if ( rc == 0 )
-            {
-                /* expect a table as a NUL-terminated string, but
-                   having close to the number of bytes in results */
-                rc = VResolverAlgParseResolverCGIResponse ( & result, path, mapping, acc, self -> ticket );
-                KDataBufferWhack ( & result );
-            }
-        }
-
-        KCurlRequestRelease ( req );
-    }
-#else
-    KHttpRequest *req;
-    rc_t rc = KNSManagerMakeRequest ( kns, &req, 0x01000000, NULL, self -> root -> addr );
-    if ( rc == 0 )
-    {
-        /* build up POST information: */
-        rc = KHttpRequestAddPostParam ( req, "version=%u.%u",
-            NAME_SERVICE_MAJ_VERS, NAME_SERVICE_MIN_VERS );
-        if ( rc == 0 )
-            rc = KHttpRequestAddPostParam ( req, "acc=%S", acc ); 
-        if ( rc == 0 && legacy_wgs_refseq )
-            rc = KHttpRequestAddPostParam ( req, "ctx=refseq" );
-        if ( rc == 0 && self -> ticket != NULL )
-            rc = KHttpRequestAddPostParam ( req, "tic=%S", self -> ticket );
-        if ( NAME_SERVICE_VERS >= ONE_DOT_ONE )
-        {
-            const char *val;
-            switch ( protocols )
-            {
-            case eProtocolHttp:
-                val = "http";
-                break;
-            case eProtocolFasp:
-                val = "fasp";
-                break;
-            case eProtocolFaspHttp:
-                val = "fasp,http";
-                break;
-            case eProtocolHttpFasp:
-                val = "http,fasp";
-                break;
-            default:
-                val = NULL;
-                rc = RC ( rcVFS, rcResolver, rcResolving, rcParam, rcInvalid );
-            }
-
-            if ( rc == 0 )
-                rc = KHttpRequestAddPostParam ( req, "accept-proto=%s", val );
-        }
-
-        if ( rc == 0 )
-        {
-            KHttpResult *rslt;
-            
-            rc = KHttpRequestPOST ( req, &rslt );
-            if ( rc == 0 )
-            {
-                uint32_t code;
-
-                rc = KHttpResultStatus ( rslt, &code, NULL, 0, NULL );
-                if ( code == 200 )
-                {
-                    KStream *response;
-                    
-                    rc = KHttpResultGetInputStream ( rslt, &response );
-                    if ( rc == 0 )
-                    {
-                        KDataBuffer result;
-                        size_t num_read;
-                        size_t total = 0;
-                        
-                        memset ( &result, 0, sizeof result );
-                        KDataBufferMakeBytes ( & result, 4096 );
-
-                        while ( 1 )
-                        {
-                            uint8_t *base;
-                            uint64_t avail = result . elem_count - total;
-                            if ( avail < 256 )
-                            {
-                                rc = KDataBufferResize ( & result, result . elem_count + 4096 );
-                                if ( rc != 0 )
-                                    break;
-                            }
-                            
-                            base = result . base;
-                            rc = KStreamRead ( response, & base [ total ], result . elem_count - total, &num_read );
-                            if ( rc != 0 )
-                            {
-                                /* TBD - look more closely at rc */
-                                if ( num_read > 0 )
-                                    rc = 0;
-                                else
-                                    break;
-                            }
-                            if ( num_read == 0 )
-                                break;
-                        }
-                        
-                        if ( rc == 0 )
-                        {
-                            rc = VResolverAlgParseResolverCGIResponse ( & result, path, mapping, acc, self -> ticket );
-                            KDataBufferWhack ( &result );
-                        }
-
-                        KStreamRelease ( response );
-                    }
-                }
-                KHttpResultRelease ( rslt );
-            }
-        }
-        KHttpRequestRelease ( req );
-    }
-#endif
-    return rc == 0 ? 0 : RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-/* RemoteResolve
- *  resolve an accession into a VPath or not found
- *
- *  1. expand accession according to algorithm
- *  2. search all volumes for accession
- *  3. return not found or new VPath
- */
-static
-rc_t VResolverAlgRemoteResolve ( const VResolverAlg *self,
-    const KNSManager *kns, VRemoteProtocols protocols, const VResolverAccToken *tok,
-    const VPath ** path, const VPath ** mapping, const KFile ** opt_file_rtn, bool legacy_wgs_refseq )
-{
-    rc_t rc;
-    uint32_t i, count;
-
-    /* expanded accession */
-    String exp;
-    size_t size;
-    char expanded [ 256 ];
-
-    const String *root;
-
-    /* check for download ticket */
-    if ( self -> alg_id == algCGI
-#if NO_LEGACY_WGS_REFSEQ_CGI
-         && ! legacy_wgs_refseq
-#endif
-        )
-    {
-        rc = VResolverAlgRemoteProtectedResolve ( self,
-            kns, protocols, & tok -> acc, path, mapping, legacy_wgs_refseq );
-        if (rc == 0 && path != NULL && *path != NULL &&
-            opt_file_rtn != NULL && *opt_file_rtn == NULL &&
-            VPathGetUri_t ( * path ) != vpuri_fasp )
-        {
-            const String *s = NULL;
-            rc_t rc = VPathMakeString(*path, &s);
-            if (rc != 0) {
-                LOGERR(klogInt, rc,
-                    "failed to make string from remote protected path");
-            }
-            else {
-#if USE_CURL
-                rc = KCurlFileMake(opt_file_rtn, s->addr, false);
-#else
-                rc = KNSManagerMakeHttpFile ( kns, opt_file_rtn, NULL, 0x01010000, "%S", s );
-#endif
-                if (rc != 0) {
-                    PLOGERR(klogInt, (klogInt, rc,
-                        "failed to open file for $(path)", "path=%s", s->addr));
-                }
-                free((void*)s);
-            }
-        }
-        return rc;
-    }
-
-    /* for remote, root can never be NULL */
-    root = self -> root;
-
-    /* expand the accession */
-    rc = expand_algorithm ( self, tok, expanded, sizeof expanded, & size, legacy_wgs_refseq );
-
-    /* should never have a problem here... */
-    if ( rc != 0 )
-        return rc;
-
-    /* turn the expanded portion into a String
-       we know that size is also length due to
-       accession content rules */
-    StringInit ( & exp, expanded, size, ( uint32_t ) size );
-
-    /* now search all remote volumes */
-    count = VectorLength ( & self -> vols );
-    for ( i = 0; i < count; ++ i )
-    {
-        char url [ 8192 ];
-        const String *vol = VectorGet ( & self -> vols, i );
-        rc = string_printf ( url, sizeof url, NULL, "%S/%S/%S", root, vol, & exp );
-        if ( rc == 0 )
-        {
-            const KFile *f;
-#if USE_CURL
-            rc = KCurlFileMake ( & f, url, false );
-#else
-            rc = KNSManagerMakeHttpFile ( kns, & f, NULL, 0x01010000, url );
-#endif
-            if ( rc == 0 )
-            {
-                if ( opt_file_rtn != NULL )
-                    * opt_file_rtn = f;
-                else
-                    KFileRelease ( f );
-
-                if ( legacy_wgs_refseq )
-                    return VResolverAlgMakeRemoteWGSRefseqURI ( self, url, & tok -> acc, path );
-                return VResolverAlgMakeRemotePath ( self, url, path );
-            }
-        }
-    }
-    
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-
-/* CacheResolve
- *  try to resolve accession for currently cached file
- */
-static
-rc_t VResolverAlgCacheResolve ( const VResolverAlg *self,
-    const KDirectory *wd, const VResolverAccToken *tok,
-    const VPath ** path, bool legacy_wgs_refseq )
-{
-    /* see if the cache file already exists */
-    const bool for_cache = true;
-    rc_t rc = VResolverAlgLocalResolve ( self, wd, tok, path, legacy_wgs_refseq, for_cache );
-    if ( rc == 0 )
-        return 0;
-
-    /* TBD - see if any of these volumes is a good candidate for creating a file */
-
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-
-
-/* MakeCachePath
- *  we have an accession that matches this volume
- *  create a path for it
- */
-static
-rc_t VResolverAlgMakeCachePath ( const VResolverAlg *self,
-    const VResolverAccToken *tok, const VPath ** path, bool legacy_wgs_refseq )
-{
-    uint32_t i, count;
-
-    /* expanded accession */
-    String exp;
-    size_t size;
-    char expanded [ 256 ];
-
-    const String *vol;
-
-    /* expand the accession */
-    rc_t rc = expand_algorithm ( self, tok, expanded, sizeof expanded, & size, legacy_wgs_refseq );
-
-    /* should never have a problem here... */
-    if ( rc != 0 )
-        return rc;
-
-    /* turn the expanded portion into a String
-       we know that size is also length due to
-       accession content rules */
-    StringInit ( & exp, expanded, size, ( uint32_t ) size );
-
-    /* now search all volumes */
-    count = VectorLength ( & self -> vols );
-    for ( i = 0; i < count; ++ i )
-    {
-        vol = VectorGet ( & self -> vols, i );
-        return VResolverAlgMakeLocalPath ( self, vol, & exp, path );
-    }
-    
-    return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-}
-
-
-
-/*--------------------------------------------------------------------------
- * VResolver
- */
-struct VResolver
-{
-    /* root paths - stored as String* */
-    Vector roots;
-
-    /* volume algorithms - stored as VResolverAlg* */
-    Vector local;
-    Vector remote;
-
-    /* working directory for testing local paths */
-    const KDirectory *wd;
-
-    /* if there is a protected remote resolver,
-       we will need a KNS manager */
-    const KNSManager *kns;
-
-    /* if there is a working protected repository,
-       store the download ticket here */
-    const String *ticket;
-
-    KRefcount refcount;
-
-    /* counters for various app volumes */
-    uint32_t num_app_vols [ appCount ];
-
-    /* preferred protocols preferences. Default: HTTP */
-    VRemoteProtocols protocols;
-};
-
-
-/* "process" global settings
- *  actually, they are library-closure global
- */
-static atomic32_t enable_local, enable_remote, enable_cache;
-
-
-/* Whack
- */
-static
-rc_t VResolverWhack ( VResolver *self )
-{
-    KRefcountWhack ( & self -> refcount, "VResolver" );
-
-    /* drop all remote volume sets */
-    VectorWhack ( & self -> remote, VResolverAlgWhack, NULL );
-
-    /* drop local volume sets */
-    VectorWhack ( & self -> local, VResolverAlgWhack, NULL );
-
-    /* drop download ticket */
-    if ( self -> ticket != NULL )
-        StringWhack ( ( String* ) self -> ticket );
-
-    /* drop root paths */
-    VectorWhack ( & self -> roots, string_whack, NULL );
-
-    /* release kns */
-    if ( self -> kns != NULL )
-        KNSManagerRelease ( self -> kns );
-
-    /* release directory onto local file system */
-    KDirectoryRelease ( self -> wd );
-
-    free ( self );
-    return 0;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT
-rc_t CC VResolverAddRef ( const VResolver * self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "VResolver" ) )
-        {
-        case krefOkay:
-            break;
-        case krefZero:
-            return RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcIncorrect );
-        case krefLimit:
-            return RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcExhausted );
-        case krefNegative:
-            return RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcInvalid );
-        default:
-            return RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcUnknown );
-        }
-    }
-    return 0;
-}
-
-LIB_EXPORT
-rc_t CC VResolverRelease ( const VResolver * self )
-{
-    rc_t rc = 0;
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "VResolver" ) )
-        {
-        case krefOkay:
-        case krefZero:
-            break;
-        case krefWhack:
-            VResolverWhack ( ( VResolver* ) self );
-            break;
-        case krefNegative:
-            return RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcInvalid );
-        default:
-            rc = RC ( rcVFS, rcResolver, rcAttaching, rcRefcount, rcUnknown );
-            break;            
-        }
-    }
-    return rc;
-}
-
-
-/* get_accession_code
- */
-static
-uint32_t get_accession_code ( const String * accession, VResolverAccToken *tok )
-{
-#if USE_VPATH_OPTIONS_STRINGS
-#error this thing is wrong
-#else
-
-#define MAX_ACCESSION_LEN 20
-
-    uint32_t code;
-
-    const char *acc = accession -> addr;
-    size_t i, size = accession -> size;
-
-    /* capture the whole accession */
-    tok -> acc = * accession;
-
-    /* scan prefix or alpha */
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( ! isalpha ( acc [ i ] ) )
-            break;
-    }
-
-    /* terrible situation - unrecognizable */
-    if ( i == size || i == 0 || i >= MAX_ACCESSION_LEN )
-    {
-        StringInit ( & tok -> prefix, acc, 0, 0 );
-        StringInit ( & tok -> alpha, acc, i, i );
-        StringInit ( & tok -> digits, & acc [ i ], 0, 0 );
-        tok -> ext1 = tok -> ext2 = tok -> suffix = tok -> digits;
-        return 0;
-    }
-
-    /* if stopped on '_', we have a prefix */
-    if ( acc [ i ] == '_' )
-    {
-        /* prefix
-           store only its presence, not length */
-        code = 1 << 4 * 4;
-        StringInit ( & tok -> prefix, acc, i, i );
-
-        /* remove prefix */
-        acc += ++ i;
-        size -= i;
-
-        /* scan for alpha */
-        for ( i = 0; i < size; ++ i )
-        {
-            if ( ! isalpha ( acc [ i ] ) )
-                break;
-        }
-
-        if ( i == size || i >= MAX_ACCESSION_LEN )
-        {
-            StringInit ( & tok -> alpha, acc, i, i );
-            StringInit ( & tok -> digits, & acc [ i ], 0, 0 );
-            tok -> ext1 = tok -> ext2 = tok -> suffix = tok -> digits;
-            return 0;
-        }
-
-        code |= i << 4 * 3;
-        StringInit ( & tok -> alpha, acc, i, i );
-    }
-    else if ( ! isdigit ( acc [ i ] ) )
-    {
-        StringInit ( & tok -> prefix, acc, 0, 0 );
-        StringInit ( & tok -> alpha, acc, i, i );
-        StringInit ( & tok -> digits, & acc [ i ], 0, 0 );
-        tok -> ext1 = tok -> ext2 = tok -> suffix = tok -> digits;
-        return 0;
-    }
-    else
-    {
-        /* alpha */
-        code = i << 4 * 3;
-        StringInit ( & tok -> prefix, acc, 0, 0 );
-        StringInit ( & tok -> alpha, acc, i, i );
-    }
-
-    /* remove alpha */
-    acc += i;
-    size -= i;
-
-    /* scan digits */
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( ! isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    /* record digits */
-    StringInit ( & tok -> digits, acc, i, i );
-    StringInit ( & tok -> ext1, & acc [ i ], 0, 0 );
-    tok -> ext2 = tok -> suffix = tok -> ext1;
-
-    if ( i == 0 || i >= MAX_ACCESSION_LEN )
-        return 0;
-
-    code |= i << 4 * 2;
-
-    /* normal return point for SRA */
-    if ( i == size )
-        return code;
-
-    /* check for extension */
-    if ( acc [ i ] != '.' )
-        return 0;
-
-    /* remove digit */
-    acc += ++ i;
-    size -= i;
-
-    /* scan numeric extension */
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( ! isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    if ( i == 0 || i >= MAX_ACCESSION_LEN )
-        return 0;
-
-    /* record the actual extension */
-    StringInit ( & tok -> ext1, acc, i, i );
-    /* codify the extension simply as present, not by its length */
-    code |= 1 << 4 * 1;
-
-    if ( i == size )
-        return code;
-
-    /* scan for suffix */
-    if ( acc [ i ] == '_' )
-    {
-        acc += ++ i;
-        size -= i;
-        for ( i = 0; i < size; ++ i )
-        {
-            if ( ! isalpha ( acc [ i ] ) )
-                break;
-        }
-
-        /* this has to end the whole thing */
-        if ( i == 0 || i != size )
-            return 0;
-
-        StringInit ( & tok -> suffix, acc, i, i );
-        /* NB - not incorporating suffix into code right now */
-        return code;
-    }
-
-    if ( acc [ i ] != '.' )
-        return 0;
-
-
-    /* remove first extension */
-    acc += ++ i;
-    size -= i;
-
-    /* scan 2nd numeric extension */
-    for ( i = 0; i < size; ++ i )
-    {
-        if ( ! isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    if ( i == 0 || i >= MAX_ACCESSION_LEN )
-        return 0;
-
-    StringInit ( & tok -> ext2, acc, i, i );
-    code |= 1 << 4 * 0;
-
-    if ( i == size )
-        return code;
-
-    /* no other patterns are accepted */
-    return 0;
-#endif
-}
-
-
-/* get_accession_app
- */
-static
-VResolverAppID get_accession_app ( const String * accession, bool refseq_ctx,
-    VResolverAccToken *tok, bool *legacy_wgs_refseq )
-{
-    VResolverAppID app;
-    uint32_t code = get_accession_code ( accession, tok );
-
-    if (accession != NULL &&
-        accession->addr != NULL && isdigit(accession->addr[0]))
-    {
-        /* TODO: KART */
-        return appAny;
-    }
-
-    /* disregard extensions at this point */
-    switch ( code >> 4 * 2 )
-    {
-    case 0x015: /* e.g. "J01415" or "J01415.2"     */
-    case 0x026: /* e.g. "CM000071" or "CM000039.2" */
-    case 0x126: /* e.g. "NZ_DS995509.1"            */
-        app = appREFSEQ;
-        break;
-
-    case 0x036: /* e.g. "SRR012345"    */
-    case 0x037: /* e.g. "SRR0123456"   */
-    case 0x038: /* e.g. "SRR01234567"  */
-    case 0x039: /* e.g. "SRR012345678" */
-
-        /* detect accession with extension */
-        if ( ( code & 0xFF ) != 0 )
-            app = appAny;
-        else
-            app = appSRA;
-        break;
-
-    case 0x106: /* e.g. "NC_000012.10"                      */
-    case 0x109: /* e.g. "NW_003315935.1", "GPC_000000393.1" */
-        if ( tok -> prefix . size == 3 &&
-             tok -> prefix . addr [ 0 ] == 'G' &&
-             tok -> prefix . addr [ 1 ] == 'C' &&
-             ( tok -> prefix . addr [ 2 ] == 'A' || tok -> prefix . addr [ 2 ] == 'F' ) )
-        {
-            /* e.g. "GCA_000392025.1_L" */
-            app = appNAKMER;
-            break;
-        }
-
-        app = appREFSEQ;
-        break;
-
-    case 0x042: /* e.g. "AAAB01" is WGS package name */
-    case 0x048: /* e.g. "AAAA01000001"               */
-    case 0x049: /* contig can be 6 or 7 digits       */
-    case 0x142: /* e.g. "NZ_AAEW01"                  */
-    case 0x148: /* e.g. "NZ_AAEW01000001"            */
-    case 0x149:
-        app = appWGS;
-        break;
-
-    case 0x029: /* e.g. NA000008777.1 */
-        if ( code == 0x02910 )
-        {
-            if ( tok -> alpha . addr [ 0 ] == 'N' && tok -> alpha . addr [ 1 ] == 'A' )
-            {
-                app = appNANNOT;
-                break;
-            }
-        }
-
-        /* no break */
-
-    default:
-        /* TBD - people appear to be able to throw anything into refseq,
-           so anything unrecognized we may as well test out there...
-           but this should not stay the case */
-        app = appREFSEQ;
-    }
-
-    if ( app == appWGS )
-    {
-        /* if we know this is for refseq, clobber it here */
-        if ( refseq_ctx )
-        {
-            app = appREFSEQ;
-            * legacy_wgs_refseq = true;
-        }
-    }
-
-    return app;
-}
-
-
-/* LocalResolve
- *  resolve an accession into a VPath or not found
- *
- *  1. determine the type of accession we have, i.e. its "app"
- *  2. search all local algorithms of app type for accession
- *  3. return not found or new VPath
- */
-static
-rc_t VResolverLocalResolve ( const VResolver *self,
-    const String * accession, const VPath ** path, bool refseq_ctx )
-{
-    rc_t rc;
-    uint32_t i, count;
-
-    VResolverAccToken tok;
-    bool legacy_wgs_refseq = false;
-    VResolverAppID app = get_accession_app ( accession, refseq_ctx, & tok, & legacy_wgs_refseq );
-
-    /* search all local volumes by app and accession algorithm expansion */
-    count = VectorLength ( & self -> local );
-    for ( i = 0; i < count; ++ i )
-    {
-        const VResolverAlg *alg = VectorGet ( & self -> local, i );
-        if ( alg -> app_id == app )
-        {
-            const bool for_cache = false;
-            rc = VResolverAlgLocalResolve ( alg, self -> wd, & tok, path, legacy_wgs_refseq, for_cache );
-            if ( rc == 0 )
-                return 0;
-        }
-    }
-
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-static
-bool VPathHasRefseqContext ( const VPath * accession )
-{
-    size_t num_read;
-    char option [ 64 ];
-    rc_t rc = VPathOption ( accession, vpopt_vdb_ctx, option, sizeof option, & num_read );
-    if ( rc != 0 )
-        return false;
-    return ( num_read == sizeof "refseq" - 1 &&
-             strcase_cmp ( "refseq", sizeof "refseq" - 1,
-                           option, num_read, num_read ) == 0 );
-}
-
-
-/* Local - DEPRECATED
- *  Find an existing local file/directory that is named by the accession.
- *  rcState of rcNotFound means it does not exist.
- *
- *  other rc code for failure are possible.
- *
- *  Accession must be an ncbi-acc scheme or a simple name with no 
- *  directory paths.
- */
-LIB_EXPORT
-rc_t CC VResolverLocal ( const VResolver * self,
-    const VPath * accession, const VPath ** path )
-{
-    rc_t rc =  VResolverQuery ( self, eProtocolHttp, accession, path, NULL, NULL );
-    if ( rc == 0 )
-    {
-        switch ( accession -> path_type )
-        {
-        case vpOID:
-        case vpAccession:
-        case vpNameOrOID:
-        case vpNameOrAccession:
-            if ( * path != accession )
-                break;
-        default:
-            VPathRelease ( * path );
-            * path = NULL;
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-        }
-    }
-    return rc;
-}
-
-
-/* LocalEnable
- *  modify settings for using local repositories,
- *  meaning site, user-public and user-protected.
- *
- *  "enable" [ IN ] - enable or disable local access,
- *  or follow settings in KConfig
- *
- *  returns the previous state of "local-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-LIB_EXPORT
-VResolverEnableState CC VResolverLocalEnable ( const VResolver * self, VResolverEnableState enable )
-{
-    int32_t val, cur, prior;
-
-    if ( self == NULL )
-        return vrUseConfig;
-
-    /* convert "VResolverEnableState" to 32-bit signed integer for atomic operation */
-    val = ( int32_t ) enable;
-
-    /* before performing atomic swap, get the current setting,
-       and return right away if it is already set correctly */
-    prior = atomic32_read ( & enable_local );
-    if ( prior != val ) do
-    {
-        cur = prior;
-        prior = atomic32_test_and_set ( & enable_local, val, prior );
-    }
-    while ( prior != cur );
-
-    return prior;
-}
-
-
-/* RemoteEnable
- *  apply or remove a process-wide enabling of remote access
- *  regardless of configuration settings
- *
- *  "enable" [ IN ] - if "true", enable all remote access
- *  if false, use settings from configuration.
- *
- *  returns the previous state of "remote-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-LIB_EXPORT
-VResolverEnableState CC VResolverRemoteEnable ( const VResolver * self, VResolverEnableState enable )
-{
-    int32_t val, cur, prior;
-
-    if ( self == NULL )
-        return vrUseConfig;
-
-    /* convert "VResolverEnableState" to 32-bit signed integer for atomic operation */
-    val = ( int32_t ) enable;
-
-    /* before performing atomic swap, get the current setting,
-       and return right away if it is already set correctly */
-    prior = atomic32_read ( & enable_remote );
-    if ( prior != val ) do
-    {
-        cur = prior;
-        prior = atomic32_test_and_set ( & enable_remote, val, prior );
-    }
-    while ( prior != cur );
-
-    return prior;
-}
-
-
-/* CacheEnable
- *  modify settings for caching files in user repositories
- *
- *  "enable" [ IN ] - enable or disable user repository cache,
- *  or follow settings in KConfig
- *
- *  returns the previous state of "cache-enabled" property
- *
- * NB - in VDB-2, the state is associated with library code
- *  shared libraries in separate closures will have separate
- *  state. this can only occur if dynamic ( manual ) loading of
- *  shared libraries is used, and will not occur with normal
- *  usage. in VDB-3 the state will be stored with the process,
- *  not the library.
- */
-LIB_EXPORT
-VResolverEnableState CC VResolverCacheEnable ( const VResolver * self, VResolverEnableState enable )
-{
-    int32_t val, cur, prior;
-
-    if ( self == NULL )
-        return vrUseConfig;
-
-    /* convert "VResolverEnableState" to 32-bit signed integer for atomic operation */
-    val = ( int32_t ) enable;
-
-    /* before performing atomic swap, get the current setting,
-       and return right away if it is already set correctly */
-    prior = atomic32_read ( & enable_cache );
-    if ( prior != val ) do
-    {
-        cur = prior;
-        prior = atomic32_test_and_set ( & enable_cache, val, prior );
-    }
-    while ( prior != cur );
-
-    return prior;
-}
-
-
-/* RemoteResolve
- *  resolve an accession into a remote VPath or not found
- *  may optionally open a KFile to the object in the process
- *  of finding it
- *
- *  2. determine the type of accession we have, i.e. its "app"
- *  3. search all local algorithms of app type for accession
- *  4. return not found or new VPath
- */
-static
-rc_t VResolverRemoteResolve ( const VResolver *self,
-    VRemoteProtocols protocols, const String * accession,
-    const VPath ** path, const VPath **mapping,
-    const KFile ** opt_file_rtn, bool refseq_ctx )
-{
-    rc_t rc, try_rc;
-    uint32_t i, count;
-
-    VResolverAccToken tok;
-    VResolverAppID app, wildCard;
-    bool legacy_wgs_refseq = false;
-
-    VResolverEnableState remote_state = atomic32_read ( & enable_remote );
-
-    /* subject the accession to pattern recognition */
-    app = get_accession_app ( accession, refseq_ctx, & tok, & legacy_wgs_refseq );
-
-    /* search all remote volumes by app and accession algorithm expansion */
-    count = VectorLength ( & self -> remote );
-
-    /* allow matching wildcard app */
-    wildCard = appAny;
-#if NO_REFSEQ_CGI
-    if ( app == appREFSEQ )
-        wildCard = -1;
-#endif
-
-    /* no error recorded yet */
-    rc = 0;
-
-    /* TBD - determine whether these settings interfere with
-       case of resolving oid to cache location */
-
-    /* test for forced enable, which applies only to main guys
-       TBD - limit to main sub-category */
-    if ( remote_state == vrAlwaysEnable )
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            const VResolverAlg *alg = VectorGet ( & self -> remote, i );
-            if ( alg -> app_id == app || alg -> app_id == wildCard )
-            {
-                try_rc = VResolverAlgRemoteResolve ( alg, self -> kns, protocols, & tok, path, mapping, opt_file_rtn, legacy_wgs_refseq );
-                if ( try_rc == 0 )
-                    return 0;
-                if ( rc == 0 )
-                    rc = try_rc;
-            }
-        }
-    }
-    else
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            const VResolverAlg *alg = VectorGet ( & self -> remote, i );
-            if ( ( alg -> app_id == app || alg -> app_id == wildCard ) && ! alg -> disabled )
-            {
-                try_rc = VResolverAlgRemoteResolve ( alg, self -> kns, protocols, & tok, path, mapping, opt_file_rtn, legacy_wgs_refseq );
-                if ( try_rc == 0 )
-                    return 0;
-                if ( rc == 0 )
-                    rc = try_rc;
-            }
-        }
-    }
-
-    if ( rc != 0 )
-        return rc;
-
-    return RC ( rcVFS, rcResolver, rcResolving, rcName, rcNotFound );
-}
-
-
-/* Remote
- *  Find an existing remote file that is named by the accession.
- *
- *  rcState of rcNotFound means it did not exist and can not be 
- *  downloaded. Probably a bad accession name.
- *
- *  Need a specific rc for no network configured.
- *  Need a specific rc for network access permitted.
- *
- *  Other rc code for failure are possible.
- *
- *  Accession must be an ncbi-acc scheme or a simple name with no 
- *  directory paths.
- *
- *  "opt_file_rtn" [ OUT, NULL OKAY ] - optional return parameter for
- *   any KFile that may be opened as a result of resolution. This can
- *   happen if resolving an accession involves opening a URL to a
- *   remote server, for example, in which case the KFile can be returned.
- */
-LIB_EXPORT
-rc_t CC VResolverRemote ( const VResolver * self,
-    VRemoteProtocols protocols, const VPath * accession,
-    const VPath ** path, const KFile ** opt_file_rtn )
-{
-    rc_t rc;
-
-    if ( opt_file_rtn != NULL )
-        * opt_file_rtn = NULL;
-
-    rc = VResolverQuery ( self, protocols, accession, NULL, path, NULL );
-    if ( rc == 0 && opt_file_rtn != NULL &&
-        VPathGetUri_t ( * path ) != vpuri_fasp )
-    {
-#if USE_CURL
-        char path_str [ 8192 ];
-        rc = VPathReadUri ( * path, path_str, sizeof path_str, NULL );
-        if ( rc == 0 )
-            rc = KCurlFileMake ( opt_file_rtn, path_str, false);
-        if ( rc != 0 )
-        {
-            VPathRelease ( * path );
-            * path = NULL;
-        }
-#endif
-    }
-
-    return rc;
-}
-
-
-/* ExtractAccessionApp
- *  examine a path for accession portion,
- *  and try to recognize what app it belongs to
- */
-static
-VResolverAppID VResolverExtractAccessionApp ( const VResolver *self,
-    const VPath * query, bool has_fragment,
-    String * accession, VResolverAccToken * tok,
-    bool *legacy_wgs_refseq )
-{
-    bool refseq_ctx = has_fragment;
-
-    * accession = query -> path;
-
-    if ( query -> fragment . size > 1 )
-        refseq_ctx = true;
-
-    /* should have something looking like an accession.
-       determine its app to see if we were successful */
-    return get_accession_app ( accession, refseq_ctx, tok, legacy_wgs_refseq );
-}
-
-static
-bool VPathHasDownloadTicket ( const VPath * url )
-{
-    size_t num_read;
-    char option [ 64 ];
-    rc_t rc = VPathOption ( url, vpopt_gap_ticket, option, sizeof option, & num_read );
-    return rc == 0;
-}
-
-static
-rc_t VPathExtractAcc ( const VPath * url, VPath ** acc )
-{
-    rc_t rc;
-    String accession;
-
-    /* locate last path or accession guy */
-    const char * start = string_rchr ( url -> path . addr, url -> path . size, '/' );
-    const char * sep, * end = url -> path . addr + url -> path . size;
-    if ( start ++ == NULL )
-        start = url -> path . addr;
-
-    /* strip off known extensions */
-    sep = string_rchr ( start, end - start, '.' );
-    while ( sep != NULL )
-    {
-        switch ( end - sep )
-        {
-        case 4:
-            if ( strcase_cmp ( ".sra", 4, sep, 4, 4 ) == 0 )
-                end = sep;
-            else if ( strcase_cmp ( ".wgs", 4, sep, 4, 4 ) == 0 )
-                end = sep;
-            break;
-        case 9:
-            if ( strcase_cmp ( ".ncbi_enc", 9, sep, 9, 9 ) == 0 )
-            {
-                end = sep;
-                sep = string_rchr ( start, end - start, '.' );
-                continue;
-            }
-            break;
-        }
-        break;
-    }
-
-    /* this is the string */
-    StringInit ( & accession, start, end - start, string_len ( start, end - start ) );
-
-    /* now extract the mapping */
-    rc = LegacyVPathMakeFmt ( acc, "ncbi-acc:%S%S%S",
-        & accession, & url -> query, & url -> fragment );
-    if ( rc == 0 )
-    {
-        VPath * ap = * acc;
-
-        /* fix up case where we said accession but it was really a name */
-        if ( ap -> acc_code == 0 || ap -> path_type != vpAccession )
-            CONST_STRING ( & ap -> scheme, "ncbi-file" );
-    }
-
-    return rc;
-}
-
-static
-rc_t VResolverCacheResolve ( const VResolver *self,
-    const VPath * query, bool has_fragment,
-    const VPath ** cache, bool refseq_ctx )
-{
-    rc_t rc = 0;
-
-    String accession;
-    VResolverAccToken tok;
-    bool legacy_wgs_refseq = false;
-    VResolverAppID app = VResolverExtractAccessionApp ( self,
-        query, has_fragment, & accession, & tok, & legacy_wgs_refseq );
-
-    /* going to walk the local volumes, and remember
-       which one was best. actually, we have no algorithm
-       for determining it, so it's just the comment for TBD */
-    const VResolverAlg *alg, *best = NULL;
-
-    /* search the volumes for a cache-enabled place */
-    uint32_t i, count = VectorLength ( & self -> local );
-
-    /* check for protected status by presence of a download ticket */
-    bool protected = VPathHasDownloadTicket ( query );
-
-    VResolverEnableState cache_state = atomic32_read ( & enable_cache );
-
-    /* check for cache-enable override */
-    if ( cache_state == vrAlwaysEnable )
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            alg = VectorGet ( & self -> local, i );
-            if ( alg -> cache_capable && alg -> protected == protected &&
-                 ( alg -> app_id == app || alg -> app_id == appAny ) )
-            {
-                /* try to find an existing cache file
-                   NB - race condition exists unless
-                   we do something with lock files */
-                rc = VResolverAlgCacheResolve ( alg, self -> wd, & tok, cache, legacy_wgs_refseq );
-                if ( rc == 0 )
-                    return 0;
-
-                /* just remember the first as best for now */
-                if ( best == NULL )
-                    best = alg;
-            }
-        }
-    }
-    else
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            alg = VectorGet ( & self -> local, i );
-            if ( alg -> cache_enabled && alg -> protected == protected &&
-                 ( alg -> app_id == app || alg -> app_id == appAny ) )
-            {
-                /* try to find an existing cache file
-                   NB - race condition exists unless
-                   we do something with lock files */
-                rc = VResolverAlgCacheResolve ( alg, self -> wd, & tok, cache, legacy_wgs_refseq );
-                if ( rc == 0 )
-                    return 0;
-
-                /* just remember the first as best for now */
-                if ( best == NULL )
-                    best = alg;
-            }
-        }
-    }
-    
-    /* no existing cache file was found,
-       so create a new one using the best
-       TBD - this should remember a volume path */
-    if ( best == NULL )
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-    else
-        rc = VResolverAlgMakeCachePath ( best, & tok, cache, legacy_wgs_refseq );
-
-    return rc;
-}
-
-
-/* Cache
- *  Find a cache directory that might or might not contain a partially
- *  downloaded file.
- *
- *  Accession must be an ncbi-acc scheme, an http url or a simple name with no 
- *  directory paths. All three should return the same directory URL as a VPath. (?)
- *  Or should it be a directory or a file url depending upon finding a partial
- *  download? This would require co-ordination with all download mechanisms that
- *  we permit.
- *
- *  With refseq holding wgs objects we have a case were the downloaded file is not
- *  named the same as the original accession as the file archive you want is a
- *  container for other files.
- *
- *  Find local will give a path that has a special scheme in these cases. 
- *  Find remote will give the url for the container that contains the accession
- *  so using the returned VPath from resolve remote is better than the original
- *  accession in this one case.  I think...
- */
-LIB_EXPORT
-rc_t CC VResolverCache ( const VResolver * self,
-    const VPath * url, const VPath ** path, uint64_t file_size )
-{
-    return VResolverQuery ( self, eProtocolHttp, url, NULL, NULL, path );
-}
-
-/* QueryOID
- */
-
-static
-rc_t get_query_accession ( const VPath * query, String * accession, char * oid_str, size_t bsize )
-{
-    rc_t rc;
-
-    /* going to treat oid as accession */
-    * accession = query -> path;
-
-    /* if the VPath already gives us a numeral, great */
-    if ( query -> path . size != 0 && query -> path . addr [ 0 ] != '0' )
-        return 0;
-
-    /* otherwise, generate one on stack */
-    rc = string_printf ( oid_str, bsize, & accession -> size, "%u", query -> obj_id );
-    if ( rc == 0 )
-    {
-        accession -> addr = oid_str;
-        accession -> len = ( uint32_t ) accession -> size;
-    }
-
-    return rc;
-}
-
-static
-rc_t VResolverQueryOID ( const VResolver * self, VRemoteProtocols protocols,
-    const VPath * query, const VPath ** local, const VPath ** remote, const VPath ** cache )
-{
-    rc_t rc;
-
-    /* require non-zero oid */
-    if ( query -> obj_id == 0 )
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcCorrupt );
-    else
-    {
-        /* temporary - no access to vfs
-           NB - this manager will either use a singleton
-           or create a new one with its existing config */
-        VFSManager * vfs;
-        rc = VFSManagerMake ( & vfs );
-        if ( rc == 0 )
-        {
-            char oid_str [ 32 ];
-            String accession;
-            VPath * mapped_query = NULL;
-
-            /* not expected to ever be true */
-            bool refseq_ctx = VPathHasRefseqContext ( query );
-
-            /* PREFACE - having an oid, we will need to map it to either
-               an accession or simple filename before resolving to a
-               local or cache path. there are two ways of getting this
-               mapping: either through the VFS manager, or by asking the
-               remote resolver CGI.
-
-               ASSUMPTION - if the file exists locally or is cached,
-               there should be a mapping available to VFS manager. this
-               assumption can fail if the mapping database has been lost
-               or damaged.
-            */
-
-            /* MAP OID TO ACCESSION */
-            if ( local != NULL || cache != NULL )
-            {
-                /* we want a mapping. ask VFS manager for one */
-                rc = VFSManagerGetObject ( vfs, query -> obj_id, & mapped_query );
-                if ( GetRCState ( rc ) == rcNotFound )
-                {
-                    /* no mapping could be found. another possibility is to resolve remotely */
-                    if ( remote != NULL || atomic32_read ( & enable_remote ) != vrAlwaysDisable )
-                    {
-                        rc = get_query_accession ( query, & accession, oid_str, sizeof oid_str );
-                        if ( rc == 0 )
-                        {
-                            const VPath * remote2, * remote_mapping = NULL;
-                            rc = VResolverRemoteResolve ( self, protocols, & accession,
-                                & remote2, & remote_mapping, NULL, refseq_ctx );
-                            if ( rc == 0 )
-                            {
-                                /* got it. now enter into VFS manager's table */
-                                rc = VFSManagerRegisterObject ( vfs, query -> obj_id, remote_mapping );
-                                if ( rc == 0 )
-                                {
-                                    mapped_query = ( VPath* ) remote_mapping;
-                                    remote_mapping = NULL;
-                                    if ( remote != NULL )
-                                    {
-                                        * remote = remote2;
-                                        remote2 = NULL;
-                                    }
-                                }
-
-                                VPathRelease ( remote2 );
-                                VPathRelease ( remote_mapping );
-                            }
-                        }
-                    }
-                }
-
-                if ( rc == 0 )
-                {
-                    assert ( mapped_query != NULL );
-
-                    /* the returned VPath should be of a usable type */
-                    assert ( mapped_query -> path_type == vpAccession       ||
-                             mapped_query -> path_type == vpNameOrAccession ||
-                             mapped_query -> path_type == vpName );
-                    assert ( mapped_query -> path . size != 0 );
-                }
-            }
-
-            /* RESOLVE FOR LOCAL PATH */
-            if ( local != NULL && mapped_query != NULL )
-            {
-                /* grab the path as accession */
-                accession = mapped_query -> path;
-
-                /* resolve from accession to local path
-                   will NOT find partial cache files */
-                rc = VResolverLocalResolve ( self, & accession, local, refseq_ctx );
-                if ( rc == 0 && remote != NULL && * remote != NULL )
-                {
-                    /* dump remote path used to map oid */
-                    VPathRelease ( * remote );
-                    * remote = NULL;
-                }
-            }
-
-            if ( local == NULL || * local == NULL )
-            {
-                bool has_fragment = false;
-
-                /* RESOLVE FOR REMOTE */
-                if ( remote != NULL && * remote == NULL )
-                {
-                    rc = get_query_accession ( query, & accession, oid_str, sizeof oid_str );
-                    if ( rc == 0 )
-                    {
-                        const VPath * remote_mapping = NULL;
-                        rc = VResolverRemoteResolve ( self, protocols, & accession, remote,
-                            ( mapped_query == NULL && cache != NULL ) ? & remote_mapping : NULL,
-                            NULL, refseq_ctx );
-
-                        if ( rc == 0 && mapped_query == NULL && cache != NULL && remote_mapping == NULL )
-                        {
-                            /* THIS IS LIKELY AN INTERNAL ERROR
-                               EITHER THE CGI DID NOT RETURN A MAPPING
-                               OR WE DID NOT PROPERLY PARSE IT */
-                            VPathRelease ( * remote );
-                            rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNull );
-                        }
-
-                        /* register new mapping */
-                        if ( rc == 0 )
-                        {
-                            assert ( * remote != NULL );
-                            if ( ( * remote ) -> fragment . size != 0 )
-                                has_fragment = true;
-                            if ( remote_mapping != NULL )
-                            {
-                                rc = VFSManagerRegisterObject ( vfs, query -> obj_id, remote_mapping );
-                                if ( rc == 0 )
-                                {
-                                    mapped_query = ( VPath* ) remote_mapping;
-                                    remote_mapping = NULL;
-                                }
-                                VPathRelease ( remote_mapping );
-                            }
-                        }
-                    }
-                }
-
-                /* RESOLVE FOR CACHE */
-                if ( ( remote == NULL || * remote != NULL ) && cache != NULL && mapped_query != NULL )
-                {
-                    /* resolve from accession to cache path */
-                    rc = VResolverCacheResolve ( self, mapped_query, has_fragment, cache, refseq_ctx );
-                    if ( rc != 0 && remote != NULL )
-                    {
-                        assert ( * cache == NULL );
-                        VPathRelease ( * remote );
-                        * remote = NULL;
-                    }
-                }
-            }
-
-            VPathRelease ( mapped_query );
-
-            VFSManagerRelease ( vfs );
-        }
-    }
-
-    return rc;
-}
-
-/* QueryAcc
- */
-static
-rc_t VResolverQueryAcc ( const VResolver * self, VRemoteProtocols protocols,
-    const VPath * query, const VPath ** local, const VPath ** remote, const VPath ** cache )
-{
-    rc_t rc = 0;
-
-    /* the accession should be directly usable */
-    const String * accession = & query -> path;
-
-    /* check if it is intended to locate a legacy refseq object */
-    bool refseq_ctx = VPathHasRefseqContext ( query );
-
-    /* will be needed to consult CGI */
-    const VPath * remote2 = NULL, * mapped_query = NULL;
-
-    /* LOCAL RESOLUTION */
-    if ( local != NULL )
-        rc = VResolverLocalResolve ( self, accession, local, refseq_ctx );
-
-    if ( local == NULL || * local == NULL )
-    {
-        bool has_fragment = false;
-
-        /* REMOTE RESOLUTION */
-        if ( remote != NULL || ( self -> ticket != NULL && cache != NULL ) )
-        {
-            /* will need to map if protected */
-            const VPath ** mapped_ptr = ( self -> ticket != NULL && cache != NULL ) ?
-                & mapped_query : NULL;
-
-            /* request remote resolution
-               this does not need to map the query to an accession */
-            rc = VResolverRemoteResolve ( self, protocols, accession,
-                & remote2, mapped_ptr, NULL, refseq_ctx );
-
-            if ( rc == 0 )
-            {
-                if ( remote2 -> fragment . size != 0 )
-                    has_fragment = true;
-
-                if ( remote != NULL )
-                    * remote = remote2;
-                else
-                    VPathRelease ( remote2 );
-
-                remote2 = NULL;
-            }
-        }
-
-        if ( ( remote == NULL || * remote != NULL ) && cache != NULL )
-        {
-            if ( mapped_query != NULL )
-                rc = VResolverCacheResolve ( self, mapped_query, has_fragment, cache, refseq_ctx );
-#if 0
-            /* the bad assumption that every remotely retrieved accession MUST be mapped */
-            else if ( self -> ticket != NULL )
-                rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-#endif
-            else
-                rc = VResolverCacheResolve ( self, query, has_fragment, cache, refseq_ctx );
-
-            if ( rc != 0 && remote != NULL )
-            {
-                assert ( * cache == NULL );
-                if ( GetRCState ( rc ) == rcNotFound )
-                    rc = 0;
-                else
-                {
-                    VPathRelease ( * remote );
-                    * remote = NULL;
-                }
-            }
-        }
-
-        if ( mapped_query != NULL )
-            VPathRelease ( mapped_query );
-    }
-
-    return rc;
-}
-
-/* QueryPath
- *  this behavior may not be correct
- *  perhaps we should reject paths upon input,
- *  and only resolve things that need resolving
- *  but there is a thought that we can also transform paths
- */
-static
-rc_t VResolverQueryPath ( const VResolver * self, const VPath * query, const VPath ** local )
-{
-    rc_t rc;
-
-    if ( local == NULL )
-        return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-
-    switch ( KDirectoryPathType ( self -> wd, "%.*s", ( int ) query -> path . size, query -> path . addr ) )
-    {
-    case kptFile:
-    case kptDir:
-    case kptCharDev:
-    case kptBlockDev:
-    case kptFIFO:
-    case kptFile | kptAlias:
-    case kptDir | kptAlias:
-    case kptCharDev | kptAlias:
-    case kptBlockDev | kptAlias:
-    case kptFIFO | kptAlias:
-        break;
-    default:
-        return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-    }
-
-    rc = VPathAddRef ( query );
-    if ( rc == 0 )
-        * local = query;
-
-    return rc;
-}
-
-
-/* QueryName
- *  may eventually look for the name in local cache,
- *  but for now just return it as a path
- */
-static
-rc_t VResolverQueryName ( const VResolver * self, VRemoteProtocols protocols,
-    const VPath * query, const VPath ** local, const VPath ** remote, const VPath ** cache )
-{
-    return VResolverQueryPath ( self, query, local );
-}
-
-
-/* QueryURL
- *  URL resolves to itself for remote and potentially to a path for cache
- */
-static
-rc_t VResolverQueryURL ( const VResolver * self, VRemoteProtocols protocols,
-    const VPath * query, const VPath ** remote, const VPath ** cache )
-{
-    rc_t rc = 0;
-
-    /* if neither remote nor cache, then must have requested local,
-       and a URL cannot be resolved to local in our world... */
-    if ( ( ( size_t ) remote | ( size_t ) cache ) == 0 )
-        return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcIncorrect );
-
-    /* the URL always resolves to itself for remote */
-    if ( remote != NULL )
-    {
-        rc = VPathAddRef ( query );
-        if ( rc != 0 )
-            return rc;
-        * remote = query;
-    }
-
-    /* if we want a cache location, then try to resolve it */
-    if ( cache != NULL )
-    {
-        VPath *mapping;
-
-        /* check for refseq context */
-        bool refseq_ctx = VPathHasRefseqContext ( query );
-
-        /* first, extract accession or name from URL */
-        rc = VPathExtractAcc ( query, & mapping );
-        if ( rc == 0 )
-        {
-            /* now map to cache location */
-            rc = VResolverCacheResolve ( self, mapping, false, cache, refseq_ctx );
-            VPathRelease ( mapping );
-            if ( GetRCState ( rc ) == rcNotFound && remote != NULL )
-                rc = 0;
-        }
-
-        /* any error must invalidate "remote" */
-        if ( rc != 0 && remote != NULL )
-        {
-            VPathRelease ( * remote );
-            * remote = NULL;
-        }
-    }
-
-    return rc;
-}
-
-
-/* Query
- *  resolve object location to either an existing local path,
- *  or a pair of remote URL + local cache location.
- *
- *  "protocols" [ IN ] - the desired protocols for remote resolution
- *
- *  "query" [ IN ] - a path that can represent:
- *     accession : a recognizable accession from NCBI or known organization
- *     obj-id    : a dbGaP object id
- *     path      : a filesystem path
- *     url       : a remote location
- *
- *  "local" [ OUT, NULL OKAY ] - optional return parameter for local path:
- *     accession : resolve to local user or site path
- *     obj-id    : resolve to local user protected path
- *     path      : return duplicate of input
- *     url       : set to NULL
- *
- *  "remote" [ OUT, NULL OKAY ] - optional return parameter for remote path:
- *     accession : resolve to URL
- *     obj-id    : resolve to URL
- *     path      : set to NULL
- *     url       : set to duplicate
- *
- *  "cache" [ OUT, NULL OKAY ] - optional return parameter for cache path:
- *     accession : resolve to user cache path
- *     obj-id    : resolve to user cache path
- *     path      : set to NULL
- *     url       : resolve to user cache path
- *
- *  any of the output parameters may be NULL, but not all, i.e. there
- *  must be at least one non-NULL return parameter.
- *
- *  if you DON'T want local resolution, pass NULL for "local" and
- *  the query will be resolved remotely. if you don't want remote
- *  resolution, pass NULL for "remote".
- *
- *  a query that is resolved locally will always return NULL for
- *  "remote" and "cache", if the parameters are provided.
- */
-LIB_EXPORT
-rc_t CC VResolverQuery ( const VResolver * self, VRemoteProtocols protocols,
-    const VPath * query, const VPath ** local, const VPath ** remote, const VPath ** cache )
-{
-    rc_t rc;
-
-    if ( ( ( size_t ) local | ( size_t ) remote | ( size_t ) cache ) == 0 )
-        rc = RC ( rcVFS, rcResolver, rcResolving, rcParam, rcNull );
-    else
-    {
-        if ( local != NULL )
-        {
-            * local = NULL;
-            if ( atomic32_read ( & enable_local ) == vrAlwaysDisable )
-                local = NULL;
-        }
-
-        if ( remote != NULL )
-        {
-            * remote = NULL;
-            if ( protocols >= eProtocolLastDefined )
-                return RC ( rcVFS, rcResolver, rcResolving, rcParam, rcInvalid );
-            if ( atomic32_read ( & enable_remote ) == vrAlwaysDisable )
-                remote = NULL;
-        }
-
-        if ( cache != NULL )
-        {
-            * cache = NULL;
-            if ( atomic32_read ( & enable_cache ) == vrAlwaysDisable )
-                cache = NULL;
-        }
-
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcSelf, rcNull );
-        else if ( query == NULL )
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNull );
-        else if ( ( ( size_t ) local | ( size_t ) remote | ( size_t ) cache ) == 0 )
-            rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcNotFound );
-        else
-        {
-            switch ( query -> scheme_type )
-            {
-            case vpuri_none:
-            case vpuri_ncbi_file:
-            case vpuri_file:
-            case vpuri_ncbi_acc:
-            case vpuri_ncbi_obj:
-                break;
-
-            case vpuri_http:
-                switch ( protocols )
-                {
-                case eProtocolHttp:
-                case eProtocolFaspHttp:
-                case eProtocolHttpFasp:
-                    return VResolverQueryURL ( self, protocols, query, remote, cache );
-                }
-                return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcIncorrect );
-
-            case vpuri_fasp:
-                switch ( protocols )
-                {
-                case eProtocolFasp:
-                case eProtocolFaspHttp:
-                case eProtocolHttpFasp:
-                    return VResolverQueryURL ( self, protocols, query, remote, cache );
-                }
-                return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcIncorrect );
-
-            default:
-                return RC ( rcVFS, rcResolver, rcResolving, rcPath, rcIncorrect );
-            }
-
-            switch ( query -> path_type )
-            {
-            case vpInvalid:
-                rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcInvalid );
-                break;
-
-            case vpOID:
-                rc = VResolverQueryOID ( self, protocols, query, local, remote, cache );
-                break;
-
-            case vpAccession:
-                rc = VResolverQueryAcc ( self, protocols, query, local, remote, cache );
-                break;
-
-            case vpNameOrOID:
-                rc = VResolverQueryOID ( self, protocols, query, local, remote, cache );
-                if ( rc != 0 )
-                    goto try_name;
-                break;
-
-            case vpNameOrAccession:
-                rc = VResolverQueryAcc ( self, protocols, query, local, remote, cache );
-                if ( rc != 0 )
-                    goto try_name;
-                break;
-
-            case vpName:
-            try_name:
-                rc = VResolverQueryName ( self, protocols, query, local, remote, cache );
-                break;
-
-            case vpRelPath:
-            case vpFullPath:
-            case vpUNCPath:
-                rc = VResolverQueryPath ( self, query, local );
-                break;
-
-            default:
-                rc = RC ( rcVFS, rcResolver, rcResolving, rcPath, rcIncorrect );
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-
-/* LoadVolume
- *  capture volume path and other information
- */
-static
-rc_t VResolverAlgLoadVolume ( VResolverAlg *self, uint32_t *num_vols, const char *start, size_t size )
-{
-    rc_t rc = 0;
-
-#if 0
-    /* trim volume whitespace */
-    while ( size != 0 && isspace ( start [ 0 ] ) )
-    {
-        ++ start;
-        -- size;
-    }
-    while ( size != 0 && isspace ( start [ size - 1 ] ) )
-        -- size;
-#endif
-
-    /* trim trailing slashes */
-    while ( size != 0 && start [ size - 1 ] == '/' )
-        -- size;
-
-    /* now see if the string survives */
-    if ( size != 0 )
-    {
-        String loc_vol_str;
-        const String *vol_str;
-        StringInit ( & loc_vol_str, start, size, string_len ( start, size ) );
-        rc = StringCopy ( & vol_str, & loc_vol_str );
-        if ( rc == 0 )
-        {
-            rc = VectorAppend ( & self -> vols, NULL, vol_str );
-            if ( rc == 0 )
-            {
-                * num_vols += 1;
-                return 0;
-            }
-
-            StringWhack ( vol_str );
-        }
-    }
-
-    return rc;
-}
-
-/* LoadVolumes
- *
- *    path-list
- *        = PATH
- *        | <path-list> ':' PATH ;
- */
-static
-rc_t VResolverAlgLoadVolumes ( VResolverAlg *self, uint32_t *num_vols, const String *vol_list )
-{
-    const char *start = vol_list -> addr;
-    const char *end = & vol_list -> addr [ vol_list -> size ];
-    const char *sep = string_chr ( start, end - start, ':' );
-    while ( sep != NULL )
-    {
-        rc_t rc = VResolverAlgLoadVolume ( self, num_vols, start, sep - start );
-        if ( rc != 0 )
-            return rc;
-        start = sep + 1;
-        sep = string_chr ( start, end - start, ':' );
-    }
-    return VResolverAlgLoadVolume ( self, num_vols, start, end - start );
-}
-
-/* LoadAlgVolumes
- *
- *    volumes
- *        = <path-list> ;
- */
-static
-rc_t VResolverLoadAlgVolumes ( Vector *algs, const String *root, const String *ticket,
-    VResolverCacheAllow allow_cache, VResolverAppID app_id, VResolverAlgID alg_id,
-     uint32_t *num_vols, const String *vol_list, bool protected, bool disabled, bool caching )
-{
-    VResolverAlg *alg;
-    rc_t rc = VResolverAlgMake ( & alg, root, app_id, alg_id, protected, disabled );
-    if ( rc == 0 )
-    {
-        alg -> ticket = ticket;
-        alg -> cache_capable = allow_cache == cacheAllow;
-        alg -> cache_enabled = caching;
-
-        if ( ticket != NULL )
-            alg -> alg_id = algCGI;
-
-        rc = VResolverAlgLoadVolumes ( alg, num_vols, vol_list );
-        if ( rc == 0 && VectorLength ( & alg -> vols ) != 0 )
-        {
-            rc = VectorAppend ( algs, NULL, alg );
-            if ( rc == 0 )
-                return 0;
-        }
-
-        VResolverAlgWhack ( alg, NULL );
-    }
-
-    return rc;
-}
-
-/* LoadApp
- *
- *    alg-block
- *        = <alg-type> <volumes> ;
- *
- *    alg-type
- *        = "flat" | "sraFlat" | "sra1024" | "sra1000" | "fuse1000"
- *        | "refseq" | "wgs" | "wgsFlag" | "fuseWGS"
- *        | "ncbi" | "ddbj" | "ebi"
- *        | "nannot" | "nannotFlat" | "fuseNANNOT" ;
- */
-static
-rc_t VResolverLoadVolumes ( Vector *algs, const String *root, const String *ticket,
-    VResolverCacheAllow allow_cache, VResolverAppID app_id, uint32_t *num_vols,
-    const KConfigNode *vols, bool resolver_cgi, bool protected, bool disabled, bool caching )
-{
-    KNamelist *algnames;
-    rc_t rc = KConfigNodeListChildren ( vols, & algnames );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( algnames, & count );
-        for ( i = 0; i < count && rc == 0; ++ i )
-        {
-            const char *algname;
-            rc = KNamelistGet ( algnames, i, & algname );
-            if ( rc == 0 )
-            {
-                const KConfigNode *alg;
-                rc = KConfigNodeOpenNodeRead ( vols, & alg, algname );
-                if ( rc == 0 )
-                {
-                    VResolverAlgID alg_id = algUnknown;
-
-                    /* if using CGI for resolution */
-                    if ( resolver_cgi || strcmp ( algname, "cgi" ) == 0 )
-                        alg_id = algCGI;
-                    /* stored in a flat directory with ".sra" extension */
-                    else if ( strcmp ( algname, "sraFlat" ) == 0 )
-                        alg_id = algSRAFlat;
-                    /* stored in a three-level directory with 1K banks and ".sra" extension */
-                    else if ( strcmp ( algname, "sra1024" ) == 0 )
-                        alg_id = algSRA1024;
-                    /* stored in a three-level directory with 1000 banks and ".sra" extension */
-                    else if ( strcmp ( algname, "sra1000" ) == 0 )
-                        alg_id = algSRA1000;
-                    /* stored in a four-level directory with 1000 banks and ".sra" extension */
-                    else if ( strcmp ( algname, "fuse1000" ) == 0 )
-                        alg_id = algFUSE1000;
-                    /* stored in a flat directory with no extension */
-                    else if ( strcmp ( algname, "refseq" ) == 0 )
-                        alg_id = algREFSEQ;
-                    /* stored in a flat directory with no extension */
-                    else if ( strcmp ( algname, "wgsFlat" ) == 0 )
-                        alg_id = algWGSFlat;
-                    /* stored in a multi-level directory with no extension */
-                    else if ( strcmp ( algname, "wgs" ) == 0 )
-                        alg_id = algWGS;
-                    else if ( strcmp ( algname, "fuseWGS" ) == 0 )
-                        alg_id = algFuseWGS;
-                    /* stored in a three-level directory with 1K banks and no extension */
-                    else if ( strcmp ( algname, "ncbi" ) == 0 ||
-                              strcmp ( algname, "ddbj" ) == 0 )
-                        alg_id = algSRA_NCBI;
-                    /* stored in a three-level directory with 1000 banks and no extension */
-                    else if ( strcmp ( algname, "ebi" ) == 0 )
-                        alg_id = algSRA_EBI;
-
-                    /* new named annotation */
-                    else if ( strcmp ( algname, "nannotFlat" ) == 0 )
-                        alg_id = algNANNOTFlat;
-                    else if ( strcmp ( algname, "nannot" ) == 0 )
-                        alg_id = algNANNOT;
-                    else if ( strcmp ( algname, "fuseNANNOT" ) == 0 )
-                        alg_id = algFuseNANNOT;
-
-                    /* new named annotation */
-                    else if ( strcmp ( algname, "nakmerFlat" ) == 0 )
-                        alg_id = algNAKMERFlat;
-                    else if ( strcmp ( algname, "nakmer" ) == 0 )
-                        alg_id = algNAKMER;
-                    else if ( strcmp ( algname, "fuseNAKMER" ) == 0 )
-                        alg_id = algFuseNAKMER;
-
-                    if ( alg_id != algUnknown )
-                    {
-                        String *vol_list;
-                        rc = KConfigNodeReadString ( alg, & vol_list );
-                        if ( rc == 0 )
-                        {
-                            if ( StringLength ( vol_list ) != 0 )
-                            {
-                                rc = VResolverLoadAlgVolumes ( algs, root, ticket, allow_cache,
-                                    app_id, alg_id, num_vols, vol_list, protected, disabled, caching );
-                            }
-                            StringWhack ( vol_list );
-                        }
-                    }
-
-                    KConfigNodeRelease ( alg );
-                }
-            }
-        }
-
-        KNamelistRelease ( algnames );
-    }
-    return rc;
-}
-
-/* LoadApp
- *
- *    app
- *        = [ <disabled> ] [ <cache-enabled> ] <vol-group> ;
- *
- *    disabled
- *        = "disabled" '=' ( "true" | "false" ) ;
- *
- *    cache-enabled
- *        = "cache-enabled" '=' ( "true" | "false" ) ;
- *
- *    vol-group
- *        = "volumes" <alg-block>* ;
- */
-static
-rc_t VResolverLoadApp ( VResolver *self, Vector *algs, const String *root, const String *ticket,
-    VResolverCacheAllow allow_cache, VResolverAppID app_id, uint32_t *num_vols,
-    const KConfigNode *app, bool resolver_cgi, bool protected, bool disabled, bool caching )
-{
-    const KConfigNode *node;
-
-    /* test for disabled app - it is entirely possible */
-    rc_t rc = KConfigNodeOpenNodeRead ( app, & node, "disabled" );
-    if ( rc == 0 )
-    {
-        bool app_disabled = false;
-        rc = KConfigNodeReadBool ( node, & app_disabled );
-        KConfigNodeRelease ( node );
-        if ( rc == 0 && app_disabled && algs == & self -> local )
-            return 0;
-        disabled |= app_disabled;
-    }
-
-    /* test again for cache enabled */
-    if ( allow_cache == cacheAllow )
-    {
-        rc = KConfigNodeOpenNodeRead ( app, & node, "cache-enabled" );
-        if ( rc == 0 )
-        {
-            /* allow this node to override current value */
-            bool cache;
-            rc = KConfigNodeReadBool ( node, & cache );
-            KConfigNodeRelease ( node );
-            if ( rc == 0 )
-                caching = cache;
-        }
-    }
-
-    /* get volumes */
-    rc = KConfigNodeOpenNodeRead ( app, & node, "volumes" );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        rc = VResolverLoadVolumes ( algs, root, ticket, allow_cache,
-            app_id, num_vols, node, resolver_cgi, protected, disabled, caching );
-        KConfigNodeRelease ( node );
-    }
-
-    return rc;
-}
-
-/* LoadApps
- *
- *    app-block
- *        = <app-name> <app> ;
- *
- *    app-name
- *        = "refseq" | "sra" | "wgs" | "nannot" | "nakmer" ;
- */
-static
-rc_t VResolverLoadApps ( VResolver *self, Vector *algs, const String *root,
-    const String *ticket, VResolverCacheAllow allow_cache, const KConfigNode *apps,
-    bool resolver_cgi, bool protected, bool disabled, bool caching )
-{
-    KNamelist *appnames;
-    rc_t rc = KConfigNodeListChildren ( apps, & appnames );
-    if ( rc == 0 )
-    {
-        uint32_t i, count;
-        rc = KNamelistCount ( appnames, & count );
-        if ( resolver_cgi && rc == 0 && count == 0 )
-        {
-            VResolverAlg *cgi;
-            rc = VResolverAlgMake ( & cgi, root, appAny, algCGI, protected, disabled );
-            if ( rc == 0 )
-            {
-                rc = VectorAppend ( algs, NULL, cgi );
-                if ( rc == 0 )
-                {
-                    ++ self -> num_app_vols [ appAny ];
-                    return 0;
-                }
-            }
-        }
-        else for ( i = 0; i < count && rc == 0; ++ i )
-        {
-            const char *appname;
-            rc = KNamelistGet ( appnames, i, & appname );
-            if ( rc == 0 )
-            {
-                const KConfigNode *app;
-                rc = KConfigNodeOpenNodeRead ( apps, & app, appname );
-                if ( rc == 0 )
-                {
-                    VResolverAppID app_id = appUnknown;
-                    if ( strcmp ( appname, "refseq" ) == 0 )
-                        app_id = appREFSEQ;
-                    else if ( strcmp ( appname, "sra" ) == 0 )
-                        app_id = appSRA;
-                    else if ( strcmp ( appname, "wgs" ) == 0 )
-                        app_id = appWGS;
-                    else if ( strcmp ( appname, "nannot" ) == 0 )
-                        app_id = appNANNOT;
-                    else if ( strcmp ( appname, "nakmer" ) == 0 )
-                        app_id = appNAKMER;
-
-                    rc = VResolverLoadApp ( self, algs, root, ticket, allow_cache, app_id,
-                        & self -> num_app_vols [ app_id ], app, resolver_cgi, protected, disabled, caching );
-
-                    KConfigNodeRelease ( app );
-                }
-            }
-        }
-        KNamelistRelease ( appnames );
-    }
-    return rc;
-}
-
-/* LoadRepo
- *
- *    repository
- *        = [ <disabled> ] [ <cache-enabled> ] <root> <app-group> ;
- *
- *    disabled
- *        = "disabled" '=' ( "true" | "false" ) ;
- *
- *    cache-enabled
- *        = "cache-enabled" '=' ( "true" | "false" ) ;
- *
- *    root
- *        = "root" '=' PATH ;
- *
- *    app-group
- *        = "apps" <app-block>* ;
- */
-static
-rc_t VResolverLoadRepo ( VResolver *self, Vector *algs, const KConfigNode *repo,
-    const String *ticket, VResolverCacheAllow allow_cache, bool protected )
-{
-    const KConfigNode *node;
-    bool caching, resolver_cgi;
-
-    /* test for disabled repository */
-    bool disabled = false;
-    rc_t rc = KConfigNodeOpenNodeRead ( repo, & node, "disabled" );
-    if ( rc == 0 )
-    {
-        rc = KConfigNodeReadBool ( node, & disabled );
-        KConfigNodeRelease ( node );
-
-        /* don't bother recording local, disabled repositories */
-        if ( rc == 0 && disabled && algs == & self -> local )
-            return 0;
-    }
-
-    /* check for caching */
-    caching = allow_cache;
-    if ( allow_cache )
-    {
-        rc = KConfigNodeOpenNodeRead ( repo, & node, "cache-enabled" );
-        if ( rc == 0 )
-        {
-            rc = KConfigNodeReadBool ( node, & caching );
-            KConfigNodeRelease ( node );
-            if ( rc != 0 )
-                caching = false;
-        }
-    }
-
-    /* cache-capable repositories cannot be remote resolvers */
-    resolver_cgi = false;
-    if ( allow_cache )
-        rc = KConfigNodeOpenNodeRead ( repo, & node, "root" );
-    else
-    {
-        /* check for specific resolver CGI */
-        rc = KConfigNodeOpenNodeRead ( repo, & node, "resolver-cgi" );
-        if ( rc == 0 )
-            resolver_cgi = true;
-        /* or get the repository root */
-        else if ( GetRCState ( rc ) == rcNotFound )
-        {
-            rc = KConfigNodeOpenNodeRead ( repo, & node, "root" );
-        }
-    }
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        /* read root as String */
-        String *root;
-        rc = KConfigNodeReadString ( node, & root );
-        KConfigNodeRelease ( node );
-        if ( GetRCState ( rc ) == rcNotFound )
-            rc = 0;
-        else if ( rc == 0 )
-        {
-            /* perform a bit of cleanup on root */
-            while ( root -> size != 0 && root -> addr [ root -> size - 1 ] == '/' )
-            {
-                /* this is terribly nasty, but known to be safe */
-                -- root -> len;
-                -- root -> size;
-            }
-
-            /* store string on VResolver for management purposes,
-               pass the loaned reference to sub-structures */
-            rc = VectorAppend ( & self -> roots, NULL, root );
-            if ( rc != 0 )
-                StringWhack ( root );
-            else
-            {
-                /* open the "apps" sub-node */
-                rc = KConfigNodeOpenNodeRead ( repo, & node, "apps" );
-                if ( rc == 0 )
-                {
-                    rc = VResolverLoadApps ( self, algs, root, ticket,
-                        allow_cache, node, resolver_cgi, protected, disabled, caching );
-                    KConfigNodeRelease ( node );
-                }
-                else if ( GetRCState ( rc ) == rcNotFound )
-                {
-                    rc = 0;
-                    if ( resolver_cgi )
-                    {
-                        VResolverAlg *cgi;
-                        rc = VResolverAlgMake ( & cgi, root, appAny, algCGI, protected, disabled );
-                        if ( rc == 0 )
-                        {
-                            cgi -> ticket = ticket;
-
-                            rc = VectorAppend ( algs, NULL, cgi );
-                            if ( rc == 0 )
-                            {
-                                ++ self -> num_app_vols [ appAny ];
-                                return 0;
-                            }
-                        }
-
-                        VResolverAlgWhack ( cgi, NULL );
-                    }
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-/* LoadNamedRepo
- *
- *    repository-block
- *        = ID <repository> ;
- */
-static
-rc_t VResolverLoadNamedRepo ( VResolver *self, Vector *algs, const KConfigNode *sub,
-    const String *ticket, const char *name, VResolverCacheAllow allow_cache, bool protected )
-{
-    const KConfigNode *repo;
-    rc_t rc = KConfigNodeOpenNodeRead ( sub, & repo, name );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        rc = VResolverLoadRepo ( self, algs, repo, ticket, allow_cache, protected );
-        KConfigNodeRelease ( repo );
-    }
-    return rc;
-}
-
-/* LoadSubCategory
- *
- *    sub-category-block
- *        = <sub-category> <repository-block>* ;
- *
- *    sub-category
- *        = "main" | "aux" | "protected"
- *
- *    repository-block
- *        = ID <repository> ;
- */
-static
-rc_t VResolverLoadSubCategory ( VResolver *self, Vector *algs, const KConfigNode *kfg,
-    const String *ticket, const char *sub_path, VResolverCacheAllow allow_cache, bool protected )
-{
-    const KConfigNode *sub;
-    rc_t rc = KConfigNodeOpenNodeRead ( kfg, & sub, sub_path );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        KNamelist *children;
-        rc = KConfigNodeListChildren ( sub, & children );
-        if ( rc == 0 )
-        {
-            uint32_t i, count;
-            rc = KNamelistCount ( children, & count );
-            for ( i = 0; i < count && rc == 0; ++ i )
-            {
-                const char *name;
-                rc = KNamelistGet ( children, i, & name );
-                if ( rc == 0 )
-                    rc = VResolverLoadNamedRepo ( self, algs, sub, ticket, name, allow_cache, protected );
-            }
-
-            KNamelistRelease ( children );
-        }
-        KConfigNodeRelease ( sub );
-    }
-    return rc;
-}
-
-/* LoadProtected
- *  special function to handle single, active protected workspace
- */
-static
-rc_t VResolverLoadProtected ( VResolver *self, const KConfigNode *kfg, const char *rep_name )
-{
-    const KConfigNode *repo;
-    rc_t rc = KConfigNodeOpenNodeRead ( kfg, & repo, "user/protected/%s", rep_name );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        rc = VResolverLoadRepo ( self, & self -> local, repo, NULL, cacheAllow, true );
-        KConfigNodeRelease ( repo );
-    }
-    return rc;
-}
-
-/* LoadLegacyRefseq
- *  load refseq information from KConfig
- *
- *  there are two legacy versions being supported
- *
- *    legacy-refseq
- *        = "refseq" <legacy-vol-or-repo> ;
- *
- *    legacy-vol-or-repo
- *        = "volumes" '=' <path-list>
- *        | <legacy-refseq-repo> <legacy-refseq-vols>
- *        ;
- */
-static
-rc_t VResolverLoadLegacyRefseq ( VResolver *self, const KConfig *cfg )
-{
-    const KConfigNode *vols;
-    rc_t rc = KConfigOpenNodeRead ( cfg, & vols, "/refseq/paths" );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        String *vol_list;
-        rc = KConfigNodeReadString ( vols, & vol_list );
-        if ( rc == 0 )
-        {
-            const bool protected = false;
-            const bool disabled = false;
-            const bool caching = true;
-            rc = VResolverLoadAlgVolumes ( & self -> local, NULL, NULL, cacheAllow,
-                appREFSEQ, algREFSEQ,  & self -> num_app_vols [ appREFSEQ ],
-                vol_list, protected, disabled, caching );
-            StringWhack ( vol_list );
-        }
-        KConfigNodeRelease ( vols );
-    }
-
-    return rc;
-}
-
-
-/* ForceRemoteRefseq
- *  makes sure there is a remote source of refseq
- *  or else adds a hard-coded URL to NCBI
- */
-static
-rc_t VResolverForceRemoteRefseq ( VResolver *self )
-{
-    rc_t rc;
-    bool found;
-    String local_root;
-    const String *root;
-
-    uint32_t i, count = VectorLength ( & self -> remote );
-    for ( found = false, i = 0; i < count; ++ i )
-    {
-        VResolverAlg *alg = ( VResolverAlg* ) VectorGet ( & self -> remote, i );
-        if ( alg -> app_id == appREFSEQ )
-        {
-            found = true;
-            if ( alg -> disabled )
-                alg -> disabled = false;
-        }
-    }
-
-    if ( found )
-        return 0;
-
-    if ( self -> num_app_vols [ appAny ] != 0 )
-    {
-        for ( i = 0; i < count; ++ i )
-        {
-            VResolverAlg *alg = ( VResolverAlg* ) VectorGet ( & self -> remote, i );
-            if ( alg -> app_id == appAny )
-            {
-                found = true;
-                if ( alg -> disabled )
-                    alg -> disabled = false;
-            }
-        }
-    }
-
-    if ( found )
-        return 0;
-
-    /* create one from hard-coded constants */
-    StringInitCString ( & local_root, "http://ftp-trace.ncbi.nlm.nih.gov/sra" );
-    rc = StringCopy ( & root, & local_root );    
-    if ( rc == 0 )
-    {
-        rc = VectorAppend ( & self -> roots, NULL, root );
-        if ( rc != 0 )
-            StringWhack ( root );
-        else
-        {
-            String vol_list;
-            const bool protected = false;
-            const bool disabled = false;
-            const bool caching = false;
-            StringInitCString ( & vol_list, "refseq" );
-            rc = VResolverLoadAlgVolumes ( & self -> remote, root, NULL, cacheDisallow,
-                appREFSEQ, algREFSEQ, & self -> num_app_vols [ appREFSEQ ],
-                & vol_list, protected, disabled, caching );
-        }
-    }
-
-    return rc;
-}
-
-
-/* GetDownloadTicket
- *  if we are within a working environment that has a download ticket,
- *  capture it here and add that local repository into the mix
- */
-static
-const String *VResolverGetDownloadTicket ( const VResolver *self,
-    const KRepository *protected, char *buffer, size_t bsize )
-{
-    const String *ticket = NULL;
-    if ( protected != NULL )
-    {
-        rc_t rc = KRepositoryName ( protected, buffer, bsize, NULL );
-        if ( rc == 0 )
-        {
-            size_t ticsz;
-            char ticbuf [ 256 ];
-            rc = KRepositoryDownloadTicket ( protected, ticbuf, sizeof ticbuf, & ticsz );
-            if ( rc == 0 )
-            {
-                String tic;
-                StringInit ( & tic, ticbuf, ticsz, ( uint32_t ) ticsz );
-                rc = StringCopy ( & ticket, & tic );
-            }
-        }
-    }
-    return ticket;
-}
-
-
-/* ForceRemoteProtected
- *  makes sure there is a remote CGI
- */
-static
-rc_t VResolverForceRemoteProtected ( VResolver *self )
-{
-    rc_t rc;
-    const String *root;
-
-    /* create one from hard-coded constants */
-    String cgi_root;
-    StringInitCString ( & cgi_root, "http://www.ncbi.nlm.nih.gov/Traces/names/names.cgi" );
-    rc = StringCopy ( & root, & cgi_root );    
-    if ( rc == 0 )
-    {
-        rc = VectorAppend ( & self -> roots, NULL, root );
-        if ( rc != 0 )
-            StringWhack ( root );
-        else
-        {
-            const bool protected = true;
-            const bool disabled = false;
-
-            VResolverAlg *cgi;
-            rc = VResolverAlgMake ( & cgi, root, appAny, algCGI, protected, disabled );
-            if ( rc == 0 )
-            {
-                cgi -> ticket = self -> ticket;
-
-                rc = VectorAppend ( & self -> remote, NULL, cgi );
-                if ( rc == 0 )
-                {
-                    ++ self -> num_app_vols [ appAny ];
-                    return 0;
-                }
-            }
-
-            VResolverAlgWhack ( cgi, NULL );
-        }
-    }
-
-    return rc;
-}
-
-
-/* Load
- *  load the respository from ( current ) KConfig
- *
- *  using pseudo BNF, it looks like this:
- *
- *    repositories
- *        = "repository" <category-block>* ;
- *
- *    category-block
- *        = <category> <sub-category-block>* ;
- *
- *    category
- *        = "remote" | "site" | "user" ;
- *
- *    sub-category-block
- *        = <sub-category> <repository-block>* ;
- *
- *    sub-category
- *        = "main" | "aux" | "protected"
- */
-static
-rc_t VResolverDetectSRALeafPath ( VResolver *self )
-{
-    /* capture working directory as "root" path */
-    const KDirectory *wd = self -> wd;
-    char cwd [ 4096 ];
-    rc_t rc = KDirectoryResolvePath ( wd, true, cwd, sizeof cwd, "." );
-    if ( rc == 0 )
-    {
-        const String *root;
-
-        /* convert C-string to real string */
-        String cwd_str;
-        StringInitCString ( & cwd_str, cwd );
-
-        /* create a copy on heap */
-        rc = StringCopy ( & root, & cwd_str );
-        if ( rc == 0 )
-        {
-            /* insert into "roots" */
-            rc = VectorAppend ( & self -> roots, NULL, root );
-            if ( rc == 0 )
-            {
-                /* create an algorithm for any application where the
-                   spec is to be treated as a leaf path */
-                VResolverAlg *alg;
-                rc = VResolverAlgMake ( & alg, root, appAny, algLeafPath, self -> ticket != NULL, false );
-                if ( rc == 0 )
-                {
-                    const String *vol;
-
-                    /* create a single volume - "." */
-                    CONST_STRING ( & cwd_str, "." );
-                    rc = StringCopy ( & vol, & cwd_str );
-                    if ( rc == 0 )
-                    {
-                        rc = VectorAppend ( & alg -> vols, NULL, vol );
-                        if ( rc != 0 )
-                            free ( ( void* ) vol );
-                        else
-                        {
-                            /* insert into local resolution path */
-                            rc = VectorAppend ( & self -> local, NULL, alg );
-                            if ( rc == 0 )
-                                return 0;
-                        }
-                    }
-                
-                    VResolverAlgWhack ( alg, NULL );
-                }
-            }
-
-            free ( ( void* ) root );
-        }
-    }
-    return rc;
-}
-
-static
-rc_t VResolverLoad ( VResolver *self, const KRepository *protected, const KConfig *cfg )
-{
-    bool have_remote_protected = false;
-
-    const KConfigNode *kfg;
-    rc_t rc = KConfigOpenNodeRead ( cfg, & kfg, "repository" );
-    if ( GetRCState ( rc ) == rcNotFound )
-        rc = 0;
-    else if ( rc == 0 )
-    {
-        /* check to see what the current directory is */
-        char buffer [ 256 ];
-        self -> ticket = VResolverGetDownloadTicket ( self, protected, buffer, sizeof buffer );
-
-        /* allow user to specify leaf paths in current directory */
-        rc = VResolverDetectSRALeafPath ( self );
-
-        /* if the user is inside of a protected workspace, load it now */
-        if ( rc == 0 && self -> ticket != NULL )
-            rc = VResolverLoadProtected ( self, kfg, buffer );
-
-        /* now load user public repositories */
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> local, kfg, NULL, "user/main", cacheAllow, false );
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> local, kfg, NULL, "user/aux", cacheAllow, false );
-
-        /* load any site repositories */
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> local, kfg, NULL, "site/main", cacheDisallow, false );
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> local, kfg, NULL, "site/aux", cacheDisallow, false );
-
-        /* if within a protected workspace, load protected remote repositories */
-        if ( rc == 0 && self -> ticket != NULL )
-        {
-            rc = KNSManagerMake ( ( KNSManager** ) & self -> kns );
-            if ( rc == 0 )
-            {
-                uint32_t entry_vols = VectorLength ( & self -> remote );
-                rc = VResolverLoadSubCategory ( self, & self -> remote, kfg,
-                    self -> ticket, "remote/protected", cacheDisallow, true );
-                have_remote_protected = VectorLength ( & self -> remote ) > entry_vols;
-            }
-        }
-
-        /* load any remote repositories */
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> remote, kfg, NULL, "remote/main", cacheDisallow, false );
-        if ( rc == 0 )
-            rc = VResolverLoadSubCategory ( self, & self -> remote, kfg, NULL, "remote/aux", cacheDisallow, false );
-
-        KConfigNodeRelease ( kfg );
-
-        /* recover from public remote repositories using resolver CGI */
-        if ( self -> kns == NULL
-#if USE_CURL
-             && self -> num_app_vols [ appAny ] != 0
-#endif
-            )
-        {
-            rc = KNSManagerMake ( ( KNSManager** ) & self -> kns );
-        }
-    }
-
-    if ( rc == 0 && self -> num_app_vols [ appAny ] == 0 )
-    {
-        bool has_current_refseq = true;
-
-        /* AT THIS POINT, a current configuration will have something.
-           But, older out-of-date configurations may exist and need special handling. */
-        if ( self -> num_app_vols [ appREFSEQ ] == 0 )
-        {
-            has_current_refseq = false;
-            rc = VResolverLoadLegacyRefseq ( self, cfg );
-        }
-
-        /* now, one more special case - for external users
-           who had legacy refseq configuration but nothing for SRA,
-           force existence of a remote refseq access */
-        if ( rc == 0
-             && ! has_current_refseq
-             && self -> num_app_vols [ appREFSEQ ] != 0
-             && self -> num_app_vols [ appSRA ] == 0 )
-        {
-            rc = VResolverForceRemoteRefseq ( self );
-        }
-    }
-
-    if ( rc == 0 && self -> ticket != NULL && ! have_remote_protected )
-        rc = VResolverForceRemoteProtected ( self );
-
-    self -> protocols = eProtocolHttp;
-
-    return rc;
-}
-
-#if 1
-LIB_EXPORT
-rc_t CC VResolverProtocols ( VResolver * self,
-    VRemoteProtocols protocols )
-{
-    if ( self == NULL ) {
-        return RC ( rcVFS, rcResolver, rcUpdating, rcSelf, rcNull );
-    }
-
-    if ( protocols >= eProtocolLastDefined ) {
-        return RC ( rcVFS, rcResolver, rcUpdating, rcParam, rcInvalid );
-    }
-
-    self -> protocols = protocols;
-
-    return 0;
-}
-#endif
-
-
-/* Make
- *  internal factory function
- */
-static
-rc_t VResolverMake ( VResolver ** objp, const KDirectory *wd,
-    const KRepository *protected, const KConfig *kfg )
-{
-    rc_t rc;
-
-    VResolver *obj = calloc ( 1, sizeof * obj );
-    if ( obj == NULL )
-        rc = RC ( rcVFS, rcMgr, rcCreating, rcMemory, rcExhausted );
-    else
-    {
-        VectorInit ( & obj -> roots, 0, 8 );
-        VectorInit ( & obj -> local, 0, 8 );
-        VectorInit ( & obj -> remote, 0, 8 );
-        obj -> wd = wd;
-
-        KRefcountInit ( & obj -> refcount, 1, "VResolver", "make", "resolver" );
-
-        rc = VResolverLoad ( obj, protected, kfg );
-        if ( rc == 0 )
-        {
-            * objp = obj;
-            return 0;
-        }
-
-        VResolverWhack ( obj );
-    }
-
-    return rc;
-}
-
-/* Make
- *  ask the VFS manager or repository to make a resolver
- */
-LIB_EXPORT
-rc_t CC VFSManagerMakeResolver ( const VFSManager * self,
-    VResolver ** new_resolver, const KConfig * cfg )
-{
-    rc_t rc;
-
-    if ( new_resolver == NULL )
-        rc = RC ( rcVFS, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcCreating, rcSelf, rcNull );
-        else if ( cfg == NULL )
-            rc = RC ( rcVFS, rcMgr, rcCreating, rcParam, rcNull );
-        else
-        {
-            KDirectory *wd;
-            rc = VFSManagerGetCWD ( self, & wd );
-            if ( rc == 0 )
-            {
-                const KRepositoryMgr *rmgr;
-                rc = KConfigMakeRepositoryMgrRead ( cfg, & rmgr );
-                if ( rc == 0 )
-                {
-                    const KRepository *protected = NULL;
-                    rc = KRepositoryMgrCurrentProtectedRepository ( rmgr, & protected );
-                    if ( rc == 0 || GetRCState ( rc ) == rcNotFound )
-                    {
-                        rc = VResolverMake ( new_resolver, wd, protected, cfg );
-                        KRepositoryRelease ( protected );
-
-                        if ( rc == 0 )
-                        {
-                            KRepositoryMgrRelease ( rmgr );
-                            return 0;
-                        }
-                    }
-
-                    KRepositoryMgrRelease ( rmgr );
-                }
-
-                KDirectoryRelease ( wd );
-            }
-        }
-
-        *new_resolver = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT
-rc_t CC KRepositoryMakeResolver ( const KRepository *self,
-    VResolver ** new_resolver, const KConfig * cfg )
-{
-    rc_t rc;
-
-    if ( new_resolver == NULL )
-        rc = RC ( rcVFS, rcMgr, rcCreating, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcCreating, rcSelf, rcNull );
-        else if ( cfg == NULL )
-            rc = RC ( rcVFS, rcMgr, rcCreating, rcParam, rcNull );
-        else
-        {
-            KDirectory *wd;
-            rc = KDirectoryNativeDir ( & wd );
-            if ( rc == 0 )
-            {
-                rc = VResolverMake ( new_resolver, wd, self, cfg );
-                if ( rc == 0 )
-                    return 0;
-
-                KDirectoryRelease ( wd );
-            }
-        }
-
-        *new_resolver = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vfs/srapath-stub.c b/libs/vfs/srapath-stub.c
deleted file mode 100644
index da0985d..0000000
--- a/libs/vfs/srapath-stub.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sra/extern.h>
-#include <klib/rc.h>
-#include <klib/defs.h>
-#include <klib/refcount.h>
-#include <sra/srapath.h>
-#include <sra/sradb-priv.h>
-#include <sysalloc.h>
-#include <os-native.h>
-
-#include <sra/impl.h>
-
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-
-
-/*--------------------------------------------------------------------------
- * SRAPath
- *  manages accession -> path conversion
- */
-
-/* Make
- *  create path manager
- *
- *  the path manager should already be configured with
- *  standard search paths, but can be augmented by using
- *  the Add*Path messages.
- *
- *  "dir" [ IN, NULL OKAY ] - optional root directory to use
- *  attaches a new reference
- */
-LIB_EXPORT rc_t CC SRAPathMake ( SRAPath **pm, struct KDirectory const *dir )
-{
-    rc_t rc;
-
-    if ( pm == NULL )
-        rc = RC ( rcSRA, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        rc = SRAPathMakeImpl( pm, dir );
-        if ( rc == 0 )
-            return 0;
-
-        * pm = NULL;
-    }
-
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-LIB_EXPORT rc_t CC SRAPathAddRef ( const SRAPath *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-        case 2:
-            return self -> vt -> v1 . addref ( self );
-        }
-
-        return RC ( rcSRA, rcMgr, rcReleasing, rcInterface, rcBadVersion );
-    }
-    return 0;
-}
-
-LIB_EXPORT rc_t CC SRAPathRelease ( const SRAPath *self )
-{
-    if ( self != NULL )
-    {
-        switch ( self -> vt -> v1 . maj )
-        {
-        case 1:
-        case 2:
-            return self -> vt -> v1 . release ( self );
-        }
-
-        return RC ( rcSRA, rcMgr, rcReleasing, rcInterface, rcBadVersion );
-    }
-    return 0;
-}
-
-
-/* Version
- *  returns the library version
- */
-LIB_EXPORT rc_t CC SRAPathVersion ( const SRAPath *self, uint32_t *version )
-{
-    if ( version == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcParam, rcNull );
-
-    * version = 0;
-
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . version ( self, version );
-    }
-
-    return RC ( rcSRA, rcMgr, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* Clear
- *  forget all existing server and volume paths
- */
-LIB_EXPORT rc_t CC SRAPathClear ( SRAPath *self )
-{
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcResetting, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . clear ( self );
-    }
-
-    return RC ( rcSRA, rcMgr, rcResetting, rcInterface, rcBadVersion );
-}
-
-
-/* AddRepPath
- *  add a replication path
- *
- *  "rep" [ IN ] - NUL-terminated server search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "/panfs/traces01:/panfs/traces31"
- *
- *  NB - servers are searched in the order provided,
- *  first to last, until one of them satisfies a request,
- *  at which time the successful server is placed at the
- *  head of the search path.
- */
-LIB_EXPORT rc_t CC SRAPathAddRepPath ( SRAPath *self, const char *path )
-{
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcString, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcString, rcEmpty );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . addRepPath ( self, path );
-    }
-
-    return RC ( rcSRA, rcMgr, rcUpdating, rcInterface, rcBadVersion );
-}
-
-
-/* AddVolPath
- *  add a volume path
- *
- *  "vol" [ IN ] - NUL-terminated volume search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "sra2:sra1:sra0"
- *
- *  NB - volumes are searched in the order provided,
- *  first to last. they are never re-ordered.
- */
-LIB_EXPORT rc_t CC SRAPathAddVolPath ( SRAPath *self, const char *path )
-{
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcSelf, rcNull );
-    if ( path == NULL )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcString, rcNull );
-    if ( path [ 0 ] == 0 )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcString, rcEmpty );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . addVolPath ( self, path );
-    }
-
-    return RC ( rcSRA, rcMgr, rcUpdating, rcInterface, rcBadVersion );
-}
-
-
-/* Full
- *  creates full path from server, volume & accession
- *
- *  "rep" [ IN ] - NUL terminated full path of replication
- *  server, e.g. "/panfs/traces01"
- *
- *  "vol" [ IN ] - NUL terminated relative path of volume,
- *  e.g. "sra2"
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *  e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- */
-LIB_EXPORT rc_t CC SRAPathFull ( const SRAPath *self, const char *rep,
-    const char *vol, const char *accession, char *path, size_t path_max )
-{
-    if ( path_max == 0 )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-    if ( path == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcNull );
-
-    /* prepare return for failure */
-    path [ 0 ] = 0;
-
-    /* test remainder */
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcSelf, rcNull );
-    if ( accession == NULL )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcPath, rcNull );
-    if ( accession [ 0 ] == 0 )
-        return RC ( rcSRA, rcMgr, rcAccessing, rcPath, rcEmpty );
-
-    /* turn NULL prefix parts into empty string */
-    if ( rep == NULL )
-        rep = "";
-    if ( vol == NULL )
-        vol = "";
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . fullPath ( self, rep, vol, accession, path, path_max );
-    }
-
-    return RC ( rcSRA, rcMgr, rcAccessing, rcInterface, rcBadVersion );
-}
-
-
-/* Test
- *  returns true if path appears to be accession
- *  the test is a heuristic, and may return false positives
- *
- *  "path" [ IN ] - NUL terminated path to run
- */
-LIB_EXPORT bool CC SRAPathTest ( const SRAPath *self, const char *path )
-{
-    if ( self == NULL )
-        return false;
-    if ( path == NULL || path [ 0 ] == 0 )
-        return false;
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . testPath ( self, path );
-    }
-
-    return false;
-}
-
-
-/* Find
- *  finds location of run within rep-server/volume matrix
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *   e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- *
- *  returns 0 if path exists, rc state rcNotFound if
- *  path cannot be found, and rcInsufficient if buffer is
- *  too small.
- */
-LIB_EXPORT rc_t CC SRAPathFindWithRepLen ( const SRAPath *self,
-    const char *accession, char *path, size_t path_max, size_t *rep_len )
-{
-    if ( path == NULL )
-        return RC ( rcSRA, rcMgr, rcSelecting, rcBuffer, rcNull );
-    if ( path_max == 0 )
-        return RC ( rcSRA, rcMgr, rcSelecting, rcBuffer, rcInsufficient );
-
-    /* looking for illegal character in the accession 'name'
-     * this will be the RC from something like "ncbi-acc:./SRR000001"
-     * or if this is called as a default resolution in the old manner
-     */
-    if ( strchr ( accession, '/' ) != NULL )
-        return RC ( rcSRA, rcUri, rcResolving, rcPath, rcIncorrect );
-
-    path [ 0 ] = 0;
-
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcSelecting, rcSelf, rcNull );
-    if ( accession == NULL )
-        return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNull );
-    if ( accession [ 0 ] == 0 )
-        return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcEmpty );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-    case 2:
-        return self -> vt -> v1 . findPath ( self, accession, path, path_max, rep_len );
-    }
-
-    return RC ( rcSRA, rcMgr, rcSelecting, rcInterface, rcBadVersion );
-}
-
-LIB_EXPORT rc_t CC SRAPathFind ( const SRAPath *self,
-    const char *accession, char *path, size_t path_max )
-{
-    return SRAPathFindWithRepLen ( self, accession, path, path_max, NULL );
-}
-
-
-/* List (Deprecated)
- *  list all runs known to SRAPath
- *  this can be VERY SLOW due to the large number of runs
- *
- *  "runs" [ OUT ] - return parameter for ordered list of accessions
- *
- *  "deep" [ IN ] - when false, list only first responding server
- */
-LIB_EXPORT rc_t CC SRAPathList ( const SRAPath *self, struct KNamelist **runs, bool deep )
-{
-    if ( runs == NULL )
-        return RC ( rcSRA, rcMgr, rcListing, rcParam, rcNull );
-
-    * runs = NULL;
-
-    if ( self == NULL )
-        return RC ( rcSRA, rcMgr, rcListing, rcSelf, rcNull );
-
-    switch ( self -> vt -> v1 . maj )
-    {
-    case 1:
-        return RC ( rcSRA, rcMgr, rcListing, rcInterface, rcUnsupported ); /* removed from v1 */
-    }
-
-    return RC ( rcSRA, rcMgr, rcListing, rcInterface, rcBadVersion );
-}
diff --git a/libs/vfs/srapath.c b/libs/vfs/srapath.c
deleted file mode 100644
index eb1ae28..0000000
--- a/libs/vfs/srapath.c
+++ /dev/null
@@ -1,1424 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <sra/path-extern.h>
-
-struct SRARunlist;
-#define KNAMELIST_IMPL struct SRARunlist
-#include <klib/impl.h>
-
-struct NCBISRAPath;
-#define SRAPATH_IMPL struct NCBISRAPath
-#include <sra/impl.h>
-
-#include "libsrapath.vers.h"
-
-#include <vfs/manager.h>
-#include <sra/srapath.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <kfs/dyload.h>
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <kfg/config.h>
-#include <kfg/kfg-priv.h>
-#include <klib/debug.h>
-#include <klib/log.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "path-priv.h"
-
-/*--------------------------------------------------------------------------
- * SRAPathString
- */
-enum
-{
-    alg_none,
-    alg_ncbi,
-    alg_ddbj,
-    alg_ebi,
-    alg_refseq,
-    alg_wgs
-};
-
-typedef struct SRAPathString SRAPathString;
-struct SRAPathString
-{
-    DLNode n;
-    uint8_t alg;
-    char path [ 1 ];
-};
-
-/* Whack
- */
-static
-void CC SRAPathStringWhack ( DLNode *n, void *ignore )
-{
-    free ( n );
-}
-
-/* Make
- */
-static
-rc_t SRAPathStringMake ( DLList *list, const char *path, size_t sz, uint8_t alg )
-{
-    SRAPathString *s = (SRAPathString*) malloc ( sizeof * s + sz );
-    if ( s == NULL )
-        return RC ( rcSRA, rcMgr, rcUpdating, rcMemory, rcExhausted );
-
-    s -> alg = alg;
-    string_copy ( s -> path, sz + 1, path, sz );
-    DLListPushTail ( list, & s -> n );
-
-    return 0;
-}
-
-
-/* Find
- */
-typedef struct SRAPathFindInfo SRAPathFindInfo;
-struct SRAPathFindInfo
-{
-    const char *path;
-    size_t size;
-    uint8_t alg;
-    bool found;
-};
-
-static
-bool CC SRAPathStringFind ( DLNode *n, void *data )
-{
-    const SRAPathString *p = ( const SRAPathString* ) n;
-    SRAPathFindInfo *pb = ( SRAPathFindInfo* ) data;
-    if ( memcmp ( p -> path, pb -> path, pb -> size ) == 0 )
-    {
-        if ( p -> path [ pb -> size ] == 0 )
-        {
-            pb -> alg = p -> alg;
-            return pb -> found = true;
-        }
-    }
-    return false;
-}
-
-/*--------------------------------------------------------------------------
- * NCBIRepository
- *  represents a repository: replication server(s) / volume(s)
- */
-typedef struct NCBIRepository NCBIRepository;
-struct NCBIRepository
-{
-    DLNode n;
-
-    uint8_t type; /* repository type: alg_ncbi (sra: ncbi/ebi/ddbj), alg_wgs, alg_refseq*/
-
-    /* replication servers */
-    DLList repsrv;
-
-    /* volumes upon each repserver */
-    DLList vols;
-};
-/* Init
- */
-static
-rc_t CC SRARepoMake(NCBIRepository** repo)
-{
-    *repo = (NCBIRepository*)malloc(sizeof(NCBIRepository));
-    if (* repo == 0)
-    {
-        return RC ( rcSRA, rcMgr, rcInitializing, rcMemory, rcExhausted );
-    }
-    (*repo)->type = alg_ncbi;
-    (*repo)->n.next = NULL;
-    (*repo)->n.prev = NULL;
-    DLListInit(&(*repo)->repsrv);
-    DLListInit(&(*repo)->vols);
-    return 0;
-}
-/* Whack
- */
-static
-void CC SRARepoWhack ( DLNode *n, void *ignore )
-{
-    if (n != NULL)
-    {
-        DLListWhack ( & ((NCBIRepository*) n) -> repsrv, SRAPathStringWhack, NULL );
-        DLListWhack ( & ((NCBIRepository*) n) -> vols, SRAPathStringWhack, NULL );
-        free ( (NCBIRepository*) n );
-    }
-}
-
-static 
-const char* AlgToStr(uint8_t alg)
-{
-    switch (alg)
-    {
-    case alg_ncbi: 
-    case alg_ddbj:
-    case alg_ebi: return "SRA";
-    case alg_wgs: return "WGS";
-    case alg_refseq: return "REFSEQ";
-    default: return "<unknown>";
-    }
-}
-
-
-static 
-void CC LogVolume( DLNode *n, void *data )
-{
-    const SRAPathString* self = (const SRAPathString*)n;
-    PATH_DEBUG (("        \"%s\", type=%s\n", 
-                  self->path,
-                  AlgToStr(self->alg)));
-}
-
-static 
-void CC LogServer( DLNode *n, void *data )
-{
-    const SRAPathString* self = (const SRAPathString*)n;
-    PATH_DEBUG (("        \"%s\"\n", self->path));
-}
-
-static 
-void CC LogRepository ( DLNode *n, void *data )
-{
-    if (n != NULL)
-    {
-        const NCBIRepository* self = (const NCBIRepository*)n;
-        PATH_DEBUG (("    type=%s\n", AlgToStr(self->type)));
-        PATH_DEBUG (("    servers:\n"));
-        DLListForEach ( & self->repsrv, false, LogServer, NULL );
-        PATH_DEBUG (("    volumes:\n"));
-        DLListForEach ( & self->vols, false, LogVolume, NULL );
-    }
-}
-
-/*--------------------------------------------------------------------------
- * NCBISRAPath
- *  manages accession -> path conversion
- */
-typedef struct NCBISRAPath NCBISRAPath;
-struct NCBISRAPath
-{
-    struct SRAPath dad;
-
-    /* working directory */
-    const KDirectory *dir;
-
-    /* repositories */
-    DLList repos;
-    NCBIRepository* dflt_repo; /* default repository (likely to be removed in the future versions) */ 
-
-    atomic32_t refcount;
-};
-
-static void LogPathInfo(const NCBISRAPath* self)
-{
-    PATH_DEBUG (("NCBISRAPath configuration:\n"));
-    DLListForEach ( & self->repos, false, LogRepository, NULL );
-    PATH_DEBUG (("default repository:\n"));
-    LogRepository( (DLNode*) self->dflt_repo, NULL );
-}
-
-/* Whack
- */
-static
-rc_t SRAPathWhack ( NCBISRAPath *self )
-{
-    rc_t rc = KDirectoryRelease ( self -> dir );
-    if ( rc == 0 )
-    {
-        DLListWhack ( & self -> repos, SRARepoWhack, NULL );
-        SRARepoWhack ( (DLNode*) self -> dflt_repo, NULL );
-        free ( self );
-    }
-    return rc;
-}
-
-
-/* AddRef
- * Release
- */
-static
-rc_t CC NCBISRAPathAddRef ( const NCBISRAPath *cself )
-{
-    atomic32_inc ( & ( ( NCBISRAPath* ) cself ) -> refcount );
-    return 0;
-}
-
-static
-rc_t CC NCBISRAPathRelease ( const NCBISRAPath *cself )
-{
-    NCBISRAPath *self = ( NCBISRAPath* ) cself;
-    if ( atomic32_dec_and_test ( & self -> refcount ) )
-        return SRAPathWhack ( self );
-    return 0;
-}
-
-
-/* Version
- *  returns the library version
- */
-static
-rc_t CC NCBISRAPathVersion ( const NCBISRAPath *self, uint32_t *version )
-{
-    * version = LIBSRAPATH_VERS;
-    return 0;
-}
-
-
-/* Clear
- *  forget existing server and volume paths for the default repository
- */
-static
-rc_t CC NCBISRAPathClear ( NCBISRAPath *self )
-{
-    DLListWhack ( & self -> dflt_repo -> repsrv, SRAPathStringWhack, NULL );
-    DLListWhack ( & self -> dflt_repo -> vols, SRAPathStringWhack, NULL );
-    DLListInit ( & self -> dflt_repo -> repsrv );
-    DLListInit ( & self -> dflt_repo -> vols );
-
-    return 0;
-}
-
-
-/* AddPath
- *  add an alternate replication or volume path
- *
- *  "path" [ IN ] and "size" [ IN ] - sets a search path
- *
- *  "alt" [ IN ] - use std or alternate volume path algorithm
- */
-static
-rc_t SRAPathAddSubPath ( DLList *list, const char *path, size_t size, uint8_t alg )
-{
-    /* see if it's already there */
-    SRAPathFindInfo pb;
-    pb . path = path;
-    pb . size = size;
-    pb . found = 0;
-    DLListDoUntil ( list, 0, SRAPathStringFind, & pb );
-    if ( pb . found )
-        return 0;
-
-    /* create a new one */
-    return SRAPathStringMake ( list, path, size, alg );
-}
-
-static
-rc_t SRAPathAddPath ( DLList *list, const char *path, uint8_t alg )
-{
-    rc_t rc;
-    if ( path == NULL )
-        rc = RC ( rcSRA, rcMgr, rcUpdating, rcString, rcNull );
-    else if ( path [ 0 ] == 0 )
-        rc = RC ( rcSRA, rcMgr, rcUpdating, rcString, rcEmpty );
-    else
-    {
-        /* treat path as a Unix-style multi-path */
-        size_t size = string_size ( path );
-        while ( 1 )
-        {
-            /* find separator */
-            const char *sep = string_chr ( path, size, ':' );
-            if ( sep == NULL )
-                break;
-
-            /* add sub-path */
-            rc = SRAPathAddSubPath ( list, path, sep - path, alg );
-            if ( rc != 0 )
-                return rc;
-
-            /* consume ':' */
-            ++ sep;
-
-            /* pop from string */
-            size -= sep - path;
-            path = sep;
-        }
-
-        return SRAPathAddSubPath ( list, path, size, alg );
-    }
-    return rc;
-}
-
-/* AddRepPath
- *  add a replication path to a repository
- *
- *  "rep" [ IN ] - NUL-terminated server search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "/panfs/traces01:/panfs/traces31"
- *
- *  NB - servers are searched in the order provided,
- *  first to last, until one of them satisfies a request,
- *  at which time the successful server is placed at the
- *  head of the search path.
- */
-static
-rc_t CC NCBISRAPathAddRepPath ( NCBIRepository* repo, const char *rep )
-{
-    return SRAPathAddPath ( & repo -> repsrv, rep, alg_none );
-}
-static
-rc_t CC NCBISRAPathAddRepPathDefault ( NCBISRAPath *self, const char *rep )
-{
-    return NCBISRAPathAddRepPath ( self -> dflt_repo, rep );
-}
-
-/* AddVolPath
- *  add a volume path to the default repository
- *
- *  "vol" [ IN ] - NUL-terminated volume search path
- *  may be a compound path with ':' separator characters, e.g.
- *  "sra2:sra1:sra0"
- *
- *  NB - volumes are searched in the order provided,
- *  first to last. they are never re-ordered.
- */
-static
-rc_t SRAPathAddAlgVolPath ( NCBIRepository* repo, const char *vol, uint8_t alg )
-{
-    return SRAPathAddPath ( & repo -> vols, vol, alg );
-}
-static
-rc_t CC NCBISRAPathAddVolPathDefault ( NCBISRAPath *self, const char *vol )
-{
-    return SRAPathAddAlgVolPath ( self -> dflt_repo, vol, alg_ncbi);
-}
-
-/* Config
- *  configure an existing path manager
- */
-static
-rc_t SRAPathConfigValue ( const KConfig *kfg, const char *node_path,
-    char *value, size_t value_size, const char *dflt )
-{
-    const KConfigNode *node;
-    rc_t rc = KConfigOpenNodeRead ( kfg, & node, node_path );
-    if ( rc == 0 )
-    {
-        size_t num_read, remaining;
-        rc = KConfigNodeRead ( node, 0, value, value_size - 1, & num_read,  & remaining );
-        if ( rc == 0 )
-        {
-            if ( remaining != 0 )
-                rc = RC ( rcSRA, rcMgr, rcConstructing, rcString, rcExcessive );
-            else
-                value [ num_read ] = 0;
-        }
-
-        KConfigNodeRelease ( node );
-    }
-
-    if ( rc != 0 )
-    {
-        if ( dflt != NULL && dflt [ 0 ] != 0 )
-        {
-            size_t num_read = string_copy_measure ( value, value_size, dflt );
-            rc = 0;
-            if ( num_read == value_size )
-                rc = RC ( rcSRA, rcMgr, rcConstructing, rcString, rcExcessive );
-        }
-        else
-	    	value[0] = 0;     
-    }
-    return rc;
-}
-
-static 
-rc_t ConfigVolume(NCBIRepository* repo, KConfig * kfg, const char* keyPref, const char* keySuff, uint8_t alg )
-{
-    char value [ 4096 ];
-    char key [ 4096 ];
-    size_t pSize = string_size(keyPref);
-    size_t sSize = string_size(keySuff);
-    if ( pSize + sSize >= sizeof(key))
-    {
-        return RC ( rcSRA, rcMgr, rcConstructing, rcString, rcExcessive );
-    }
-    string_copy(key, sizeof(key), keyPref, pSize);
-    string_copy(key + pSize, sizeof(key) - pSize, keySuff, sSize);
-    key[pSize+sSize] = 0;
-    value[0] = '\0';
-    if ( SRAPathConfigValue ( kfg, key, value, sizeof value, NULL ) == 0 )        
-        SRAPathAddAlgVolPath ( repo, value, alg );
-    return 0;
-}
-
-static
-rc_t ConfigRepo(KConfig * kfg, const char *dflt, const char* reps, const char* volPref, uint8_t type, NCBIRepository** repo)
-{
-    char value [ 4096 ] = "";
-    rc_t rc;
-
-    /* set up a new repo */ 
-    rc = SRARepoMake(repo);
-    if ( rc == 0 )
-    {
-        (*repo)->type = type;
-
-        /* set up servers */
-        if ( SRAPathConfigValue ( kfg, reps, value, sizeof value, dflt ) == 0 )
-            NCBISRAPathAddRepPath ( *repo, value );
-
-        if ( type == alg_ncbi )
-        {
-            /* set up NCBI volumes */
-            rc = ConfigVolume( *repo, kfg, volPref, "/ncbi/volumes", alg_ncbi );
-
-            /* set up EBI volumes */
-            if (rc == 0)
-                rc = ConfigVolume( *repo, kfg, volPref, "/ebi/volumes", alg_ebi );
-
-            /* set up DDBJ volumes */
-            if (rc == 0)
-                rc = ConfigVolume( *repo, kfg, volPref, "/ddbj/volumes", alg_ddbj );
-        }
-        else if (rc == 0)
-        {
-                rc = ConfigVolume( *repo, kfg, volPref, "/volumes", type);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t ConfigRepoSet(DLList* repos, KConfig * kfg, const char* kfgPath, const char *dflt, uint8_t type)
-{
-    const KConfigNode *node;
-
-    rc_t rc = KConfigOpenNodeRead ( kfg, & node, kfgPath );
-    if ( rc == 0 )
-    {
-        KNamelist* children;
-        rc = KConfigNodeListChild ( node, &children );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount ( children, &count );
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for (i = 0; i < count; ++i)
-                {
-                    const char* name;
-                    rc = KNamelistGet ( children, i, &name );
-                    if ( rc == 0 )
-                    {
-                        #define BufSize 4096
-                        char buf[ BufSize ];
-                        size_t bSize = string_size(kfgPath);
-                        string_copy(buf, BufSize, kfgPath, bSize);
-                        if (bSize + string_size(name) < sizeof(buf))
-                        {
-                            NCBIRepository* repo;
-                            string_copy(buf + bSize, sizeof(buf) - bSize, name, string_size(name) + 1);
-                            rc = ConfigRepo( kfg, dflt, buf, buf, type, &repo );
-                            DLListPushTail( repos, (DLNode*) repo );
-                        }
-                        #undef BufSize
-                    }
-                    else
-                    {
-                        rc = RC ( rcSRA, rcMgr, rcConstructing, rcString, rcExcessive );
-                    }
-                    if ( rc != 0 )
-                    {
-                        break;
-                    }
-                }
-            }
-            KNamelistRelease ( children );
-        }
-
-        KConfigNodeRelease ( node );
-    }
-    if (GetRCState(rc) == rcNotFound)
-    {
-        return 0;
-    }
-    return rc;
-}
-
-static
-rc_t SRAPathConfig ( NCBISRAPath *self )
-{
-    const char *dflt;
-    KConfig * kfg;
-    rc_t rc = KConfigMakeLocal ( & kfg, NULL );
-    assert ( ( rc == 0 && kfg != NULL ) || ( rc != 0 && kfg == NULL ) );
-
-    /* look for defaults */
-    dflt = getenv ( "SRAPATH" );
-
-    /* locate and configure all repositories */
-    if ( rc == 0 )
-        rc = ConfigRepoSet( & self->repos, kfg, "/sra/repository/", dflt, alg_ncbi );
-    if ( rc == 0 )
-        rc = ConfigRepoSet( & self->repos, kfg, "/wgs/repository/", dflt, alg_wgs );
-    if ( rc == 0 )
-        rc = ConfigRepoSet( & self->repos, kfg, "/refseq/repository/", dflt, alg_refseq );
-
-    if ( rc == 0 )
-    {   /* default repository for backwards compatibility */
-        rc = ConfigRepo( kfg, dflt, "sra/servers", "sra", alg_ncbi, &self->dflt_repo );
-
-        /* set up REFSEQ volumes */
-        if (rc == 0)
-            rc = ConfigVolume( self->dflt_repo, kfg, "", "/refseq/volumes", alg_refseq );
-
-        /* set up WGS volumes */
-        if (rc == 0)
-            rc = ConfigVolume( self->dflt_repo, kfg, "sra", "/wgs/volumes", alg_wgs );
-    }
-
-    LogPathInfo(self);
-
-    /* kfg may be NULL */        
-    KConfigRelease ( kfg );
-
-    return rc;
-}
-
-
-/* ParseRunAccession
- *  accession is a string matching <prefix><number>
- *  extract prefix length and accession number
- */
-static
-rc_t SRAPathParseRunAccession ( const char *accession, uint32_t *prefix, uint32_t *number )
-{
-    char *end;
-    uint32_t i;
-
-    for ( i = 0; accession [ i ] != 0; ++ i )
-    {
-        if ( isdigit ( accession [ i ] ) )
-            break;
-    }
-
-    if ( i == 0 )
-        return RC ( rcSRA, rcMgr, rcResolving, rcPath, rcInvalid );
-
-    * prefix = i;
-    * number = ( uint32_t ) strtoul ( & accession [ i ], & end, 10 );
-
-    if (( end [ 0 ] == 0 ) || ( end [ 0 ] == '.' ))
-    {
-        return 0;
-    }
-    return RC ( rcSRA, rcMgr, rcResolving, rcPath, rcInvalid );
-}
-
-
-/* Full
- *  creates full path from server, volume & accession
- *
- *  "rep" [ IN ] - NUL terminated full path of replication
- *  server, e.g. "/panfs/traces01"
- *
- *  "vol" [ IN ] - NUL terminated relative path of volume,
- *  e.g. "sra2"
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *  e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- */
-static
-rc_t SRAPathFullInt ( const NCBISRAPath *self, const char *rep, const char *vol,
-    const char *accession, char *path, size_t path_max, size_t bank_size )
-{
-    /* pick apart accession */
-    uint32_t prefix, number;
-    rc_t rc = SRAPathParseRunAccession ( accession, & prefix, & number );
-    if ( rc == 0 )
-    {
-        size_t len;
-        size_t total = 0;
-        uint32_t bank = number / bank_size;
-
-        if ( rep [ 0 ] != 0 && vol [ 0 ] != 0 )
-        {
-            /* normally write all parts at once */
-            if ( rep [ strlen (rep) - 1 ] == '/') /* check for need or not a '/' between rep and vol */
-                rc= string_printf ( path, path_max, &len, "%s%s/%.*s/%06u/%s"
-                                 , rep
-                                 , vol
-                                 , ( int ) prefix, accession
-                                 , bank
-                                 , accession );
-            else
-                rc= string_printf  ( path, path_max, &len, "%s/%s/%.*s/%06u/%s"
-                                 , rep
-                                 , vol
-                                 , ( int ) prefix, accession
-                                 , bank
-                                 , accession );
-        }
-        else
-        {
-            /* allow for individual rep-server and volume parts */
-            if ( rep [ 0 ] != 0 )
-            {
-                rc = string_printf ( path, path_max, &len, "%s/", rep );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-            else if ( vol [ 0 ] != 0 )
-            {
-                rc = string_printf ( & path [ total ], path_max - total, &len, "%s/", vol );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-
-            /* append the accession */
-            rc = string_printf ( & path [ total ], path_max - total, &len, "%.*s/%06u/%s"
-                             , ( int ) prefix, accession
-                             , bank
-                             , accession );
-        }
-
-        /* common detection of buffer overflow */
-        if ( rc != 0 || ( total += len ) >= path_max )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-    }
-
-    return rc;
-}
-
-static
-rc_t SRAPathFullEBI ( const NCBISRAPath *self, const char *rep, const char *vol,
-    const char *accession, char *path, size_t path_max )
-{
-    /* pick apart accession */
-    uint32_t prefix, number;
-    rc_t rc = SRAPathParseRunAccession ( accession, & prefix, & number );
-    if ( rc == 0 )
-    {
-        size_t len;
-        size_t total = 0;
-        uint32_t bank = number / 1000;
-
-        if ( rep [ 0 ] != 0 && vol [ 0 ] != 0 )
-        {
-            /* normally write all parts at once */
-            if ( rep [ strlen (rep) - 1 ] == '/') /* check for need or not a '/' between rep and vol */
-                rc= string_printf ( path, path_max, &len, "%s%s/%.*s/%.*s%03u/%s"
-                                 , rep
-                                 , vol
-                                 , ( int ) prefix, accession
-                                 , ( int ) prefix, accession
-                                 , bank
-                                 , accession );
-            else
-                rc= string_printf  ( path, path_max, &len, "%s/%s/%.*s/%.*s%03u/%s"
-                                 , rep
-                                 , vol
-                                 , ( int ) prefix, accession
-                                 , ( int ) prefix, accession
-                                 , bank
-                                 , accession );
-        }
-        else
-        {
-            /* allow for individual rep-server and volume parts */
-            if ( rep [ 0 ] != 0 )
-            {
-                rc = string_printf ( path, path_max, &len, "%s/", rep );
-                if ( rc < 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-            else if ( vol [ 0 ] != 0 )
-            {
-                rc = string_printf ( & path [ total ], path_max - total, &len, "%s/", vol );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-
-            /* append the accession */
-            rc = string_printf ( & path [ total ], path_max - total, &len, "%.*s/%.*s%03u/%s"
-                             , ( int ) prefix, accession
-                             , ( int ) prefix, accession
-                             , bank
-                             , accession );
-        }
-
-        /* common detection of buffer overflow */
-        if ( len < 0 || ( total += len ) >= path_max )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-    }
-
-    return rc;
-}
-
-/*
-* Refseq-style accessions come in 2 naming flavors, flat or SRA-like.
-* If an accession with a flat name does not exist, use SRAPathFullInt to create an SRA-like path
-*/
-static
-rc_t SRAPathFullREFSEQ ( const NCBISRAPath *self, const char *rep, const char *vol,
-    const char *accession, char *path, size_t path_max )
-{
-    /* pick apart accession */
-    uint32_t prefix, number;
-    rc_t rc = SRAPathParseRunAccession ( accession, & prefix, & number );
-    if ( rc == 0 )
-    {
-        size_t len;
-        size_t total = 0;
-
-        if ( rep [ 0 ] != 0 && vol [ 0 ] != 0 )
-        {
-            /* normally write all parts at once */
-            if ( rep [ strlen (rep) - 1 ] == '/') /* check for need or not a '/' between rep and vol */
-                rc= string_printf ( path, path_max, &len, "%s%s/%s"
-                                 , rep
-                                 , vol
-                                 , accession );
-            else
-                rc= string_printf  ( path, path_max, &len, "%s/%s/%s"
-                                 , rep
-                                 , vol
-                                 , accession );
-        }
-        else
-        {
-            /* allow for individual rep-server and volume parts */
-            if ( rep [ 0 ] != 0 )
-            {
-                rc = string_printf ( path, path_max, &len, "%s/", rep );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-            else if ( vol [ 0 ] != 0 )
-            {
-                rc = string_printf ( & path [ total ], path_max - total, &len, "%s/", vol );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-
-            /* append the accession */
-            rc = string_printf ( & path [ total ], path_max - total, &len, "%s"
-                             , accession );
-        }
-
-        /* common detection of buffer overflow */
-        if ( rc != 0 || ( total += len ) >= path_max )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-    }
-
-    return rc;
-}
-
-/*
- * Try to locate in RefSeq Archives:
- * check for pattern '(\w{4}\d{2})[\.\d]+'; the archive is $1
- * use the scheme "x-ncbi-legrefseq" for vfs to recognize special case
- */
-static
-rc_t SRAPathFullREFSEQArchive(NCBISRAPath const *self,
-                              char const rep[],
-                              char const vol[],
-                              char const accession[],
-                              char path[],
-                              size_t path_max
-                             )
-{
-    size_t const rep_sz = strlen(rep);
-    size_t const vol_sz = strlen(vol);
-    char const *const rep_sep = (rep_sz > 0 && rep[rep_sz - 1] != '/') ? "/" : "";
-    char const *const vol_sep = (vol_sz > 0 && vol[vol_sz - 1] != '/') ? "/" : "";
-    size_t sz;
-    unsigned i;
-    VFSManager *vfs;
-    rc_t rc = VFSManagerMake(&vfs);
-    VPath *vpath;
-    KDirectory const *dir;
-    KPathType type;
-    
-    if (rc)
-        return rc;
-    
-    for (i = 0; i < 4; ++i) {
-        int const ch = accession[i];
-        
-        if (ch == 0 || !isalpha(ch))
-            return RC(rcSRA, rcMgr, rcAccessing, rcPath, rcIncorrect);
-    }
-    for ( ; ; ++i) {
-        int const ch = accession[i];
-        
-        if (ch == 0)
-            break;
-        if (ch != '.' && !isdigit(ch))
-            return RC(rcSRA, rcMgr, rcAccessing, rcPath, rcIncorrect);
-    }
-    if (i < 8)
-        return RC(rcSRA, rcMgr, rcAccessing, rcPath, rcIncorrect);
-    
-    rc = string_printf(path, path_max, &sz, "x-ncbi-legrefseq:%s%s%s%s%.6s", rep, rep_sep, vol, vol_sep, accession);
-    if (rc) return rc;
-    i = sz;
-    
-    rc = VPathMake(&vpath, path + 17);
-    if (rc) return rc;
-
-    rc = VFSManagerOpenDirectoryRead(vfs, &dir, vpath);
-    VPathRelease(vpath);
-    VFSManagerRelease(vfs);
-    if (rc) return rc;
-    
-    type = KDirectoryPathType(dir, "tbl/%s", accession);
-    KDirectoryRelease(dir);
-    
-    if (type != kptDir)
-        return RC(rcSRA, rcMgr, rcAccessing, rcPath, rcIncorrect);
-
-    rc = string_printf(path + i, path_max - i, &sz, "#tbl/%s", accession);
-    
-    return rc;
-}
-
-/*
-* WGS style naming: accession name ABCD01 resolves into WGS/AB/CD/ABCD01
-*/
-static
-rc_t SRAPathFullWGS( const NCBISRAPath *self, const char *rep, const char *vol,
-    const char *accession, char *path, size_t path_max )
-{
-    /* pick apart accession */
-    uint32_t prefix, number;
-    rc_t rc = SRAPathParseRunAccession ( accession, & prefix, & number );
-    if ( rc == 0 )
-    {
-        size_t len;
-        size_t total = 0;
-
-        if ( prefix < 4 )
-        {
-            return RC ( rcSRA, rcMgr, rcResolving, rcName, rcTooShort );
-        }
-
-        if ( rep [ 0 ] != 0 && vol [ 0 ] != 0 )
-        {
-            /* normally write all parts at once */
-            if ( rep [ strlen (rep) - 1 ] == '/') /* check for need or not a '/' between rep and vol */
-                rc= string_printf ( path, path_max, &len, "%s%s/WGS/%.2s/%.2s/%s"
-                                 , rep
-                                 , vol
-                                 , accession
-                                 , accession+2
-                                 , accession );
-            else
-                rc= string_printf ( path, path_max, &len, "%s/%s/WGS/%.2s/%.2s/%s"
-                                 , rep
-                                 , vol
-                                 , accession
-                                 , accession+2
-                                 , accession );
-        }
-        else
-        {
-            /* allow for individual rep-server and volume parts */
-            if ( rep [ 0 ] != 0 )
-            {
-                rc = string_printf ( path, path_max, &len, "%s/", rep );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-            else if ( vol [ 0 ] != 0 )
-            {
-                rc = string_printf ( & path [ total ], path_max - total, &len, "%s/", vol );
-                if ( rc != 0 || ( total = len ) >= path_max )
-                    return RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-            }
-
-            /* append the accession */
-                rc= string_printf ( & path [ total ], path_max - total, &len, "WGS/%.2s/%.2s/%s"
-                                 , accession
-                                 , accession+2
-                                 , accession );
-        }
-
-        /* common detection of buffer overflow */
-        if ( rc != 0 || ( total += len ) >= path_max )
-            rc = RC ( rcSRA, rcMgr, rcAccessing, rcBuffer, rcInsufficient );
-    }
-
-    return rc;
-}
-
-static
-rc_t ApplyAlg( const NCBISRAPath *self, const char *rep, const char *vol, 
-    const char *accession, char *path, size_t path_max, NCBIRepository *repo, bool* found)
-{
-    SRAPathFindInfo pb;
-    /* see if we recognize volume */
-    pb . path = vol;
-    pb . size = strlen ( vol );
-    pb . found = 0;
-
-    DLListDoUntil ( & repo -> vols, 0, SRAPathStringFind, & pb );
-    if ( pb . found )
-    {
-        *found = true;
-        switch (pb . alg)
-        {
-        case alg_ebi:
-            return SRAPathFullEBI ( self, rep, vol, accession, path, path_max );
-        case alg_refseq:
-        {
-            rc_t rc = SRAPathFullREFSEQ ( self, rep, vol, accession, path, path_max );
-            if ( rc == 0) /* check for existence of accession at the root of the volume, and if not found try to apply the default path-building scheme */
-            {
-                switch ( KDirectoryPathType ( self -> dir, path ) )
-                {
-                case kptNotFound:
-                case kptBadPath:
-                    return SRAPathFullREFSEQArchive( self, rep, vol, accession, path, path_max );
-                default:
-                	return 0;
-                }
-            }
-		}            
-        case alg_wgs:
-            return SRAPathFullWGS ( self, rep, vol, accession, path, path_max );
-        default:
-            break;
-        }
-    }
-    *found = false;
-    return 0;
-}
-
-static
-rc_t CC NCBISRAPathFull ( const NCBISRAPath *self, const char *rep, const char *vol,
-    const char *accession, char *path, size_t path_max )
-{
-    NCBIRepository *repo;
-    bool found;
-    rc_t rc;
-
-    /* loop through repositories */ 
-    for ( repo = ( NCBIRepository* ) DLListHead ( & self -> repos );
-          repo != NULL; repo = ( NCBIRepository* ) DLNodeNext ( & repo -> n ) )
-    {
-        rc = ApplyAlg( self, rep, vol, accession, path, path_max, repo, &found);
-        if (found)
-        {
-            return rc;
-        }
-    }
-    /* try the default repository */
-    rc = ApplyAlg( self, rep, vol, accession, path, path_max, self -> dflt_repo, &found);
-    if (found)
-    {
-        return rc;
-    }
-    /* internal version */
-    return SRAPathFullInt ( self, rep, vol, accession, path, path_max, 1024 );
-}
-
-
-/* Test
- *  returns true if path appears to be accession
- *  the test is a heuristic, and may return false positives
- *
- *  "path" [ IN ] - NUL terminated path to run
- */
-static
-bool SRAPathTestTable ( const KDirectory *dir, uint32_t type, const char *path )
-{
-    /* differentiate between legacy and current structure */
-    switch ( KDirectoryPathType ( dir, "%s/idx", path ) )
-    {
-    case kptNotFound:
-        switch ( KDirectoryPathType ( dir, "%s/meta", path ) )
-        {
-        case kptFile:
-        case kptFile | kptAlias:
-            switch ( KDirectoryPathType ( dir, "%s/skey", path ) )
-            {
-            case kptFile:
-            case kptFile | kptAlias:
-                return true;
-            }
-            break;
-        }
-        break;
-
-    case kptDir:
-    case kptDir | kptAlias:
-        switch ( KDirectoryPathType ( dir, "%s/md/cur", path ) )
-        {
-        case kptFile:
-        case kptFile | kptAlias:
-            return true;
-        }
-        break;
-    }
-
-    /* not a table */
-    return false;
-}
-
-static
-bool SRAPathTestDatabase ( const KDirectory *dir, uint32_t type, const char *path )
-{
-    /* don't have a more stringent requirement for database at this time */
-    return true;
-}
-
-static
-bool SRAPathTestFile ( const KDirectory *dir, uint32_t type, const char *path )
-{
-    /* TBD - need to look at magic information */
-    return false;
-}
-
-static
-bool SRAPathTestInt ( const KDirectory *dir, uint32_t type, const char *path )
-{
-    switch ( type )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        break;
-
-    case kptFile:
-    case kptFile | kptAlias:
-        return SRAPathTestFile ( dir, type, path );
-
-    default:
-        return false;
-    }
-
-    /* detect apparent tables */
-    switch ( KDirectoryPathType ( dir, "%s/col", path ) )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        return SRAPathTestTable ( dir, type, path );
-    }
-
-    /* detect apparent databases */
-    switch ( KDirectoryPathType ( dir, "%s/tbl", path ) )
-    {
-    case kptDir:
-    case kptDir | kptAlias:
-        return SRAPathTestDatabase ( dir, type, path );
-    }
-
-    /* not a recognized accession */
-    return false;
-}
-
-static
-bool CC NCBISRAPathTest ( const NCBISRAPath *self, const char *path )
-{
-    return SRAPathTestInt ( self -> dir,
-        KDirectoryPathType ( self -> dir, path ), path );
-}
-
-
-/* FindOnServer
- *  find accession on rep-server 
- */
-static
-rc_t SRAPathFindOnServer ( const NCBISRAPath *self, const NCBIRepository *repo, const SRAPathString *srv,
-    const char *accession, char *path, size_t path_max, int vol_type )
-{
-    const SRAPathString *vol;
-
-    PATH_DEBUG (("SRAPathFindOnServer(%s)\n", srv->path));
-
-    for ( vol = ( const SRAPathString* ) DLListHead ( & repo -> vols );
-          vol != NULL; vol = ( const SRAPathString* ) DLNodeNext ( & vol -> n ) )
-    {
-        if ( vol_type == alg_none || vol_type == vol->alg )
-        {
-            rc_t rc;
-
-            PATH_DEBUG (("SRAPathFindOnServer trying volume %s\n", vol->path));
-
-            switch ( vol -> alg )
-            {
-            case alg_ebi:
-                rc = SRAPathFullEBI ( self, srv -> path, vol -> path, accession, path, path_max );
-                break;
-            case alg_refseq:
-                rc = SRAPathFullREFSEQ ( self, srv -> path, vol -> path, accession, path, path_max );
-                if ( rc == 0) /* check for existence of accession at the root of the volume, and if not found try to apply the default path-building scheme */
-                {
-                    switch ( KDirectoryPathType ( self -> dir, path ) )
-                    {
-                    case kptNotFound:
-                    case kptBadPath:
-                        rc = SRAPathFullREFSEQArchive( self, srv -> path, vol -> path, accession, path, path_max );
-                        if (rc == 0) {
-                            PATH_DEBUG (("SRAPathFindOnServer: found(%s)\n", path));
-                            return 0;
-                        }
-                        break;
-                    default:
-                    	return 0;
-                    }
-                }
-                break;
-            case alg_wgs:
-                rc = SRAPathFullWGS ( self, srv -> path, vol -> path, accession, path, path_max );
-                break;
-            default:
-                rc = SRAPathFullInt ( self, srv -> path, vol -> path, accession, path, path_max, 1024 );
-                break;
-            }
-            if ( rc == 0 )
-            {
-                switch ( KDirectoryPathType ( self -> dir, path ) )
-                {
-                case kptNotFound:
-                case kptBadPath:
-                    break;
-                default:
-                    PATH_DEBUG (("SRAPathFindOnServer: found(%s)\n", path));
-                    return 0;
-                }
-            }
-            else
-            {
-                if ( GetRCState( rc ) == rcInsufficient )
-                    return rc;
-            }
-        }
-    }
-
-    return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNotFound );
-}
-
-/* FindInRepo
- *  find accession in a repository
- */
-static
-rc_t SRAPathFindInRepo ( const NCBISRAPath *self, NCBIRepository *repo, const char *accession, 
-                         char *path, size_t path_max, size_t *rep_len, int vol_type )
-{
-    SRAPathString *srv;
-
-    PATH_DEBUG (("SRAPathFindInRepo(%s)\n", AlgToStr(repo->type)));
-
-    /* look for accession on a rep-server */
-    for ( srv = ( SRAPathString* ) DLListHead ( & repo -> repsrv ); srv != NULL; srv = ( SRAPathString* ) DLNodeNext ( & srv -> n ) )
-    {
-        /* try with this server */
-        rc_t rc = SRAPathFindOnServer ( self, repo, srv, accession, path, path_max, vol_type );
-        if ( rc == 0 )
-        {
-            /* make sure server is at head of list */
-            if ( DLNodePrev ( & srv -> n ) != NULL )
-            {
-                DLListUnlink ( & repo -> repsrv, & srv -> n );
-                DLListPushHead ( & repo -> repsrv, & srv -> n );
-            }
-
-            if ( rep_len != NULL )
-                * rep_len = strlen ( srv -> path );
-            
-            return 0;
-        }
-
-        if ( GetRCState ( rc ) != rcNotFound )
-            return rc;
-    }
-
-    return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNotFound );
-}
-
-/* FindInRepoByType
- *  find accession in a repository of a given type
- */
-static
-rc_t SRAPathFindInRepoByType ( const NCBISRAPath *self, const char *accession, char *path, size_t path_max, size_t *rep_len, int repo_type, int vol_type )
-{
-    /* loop through all repositories */
-    NCBIRepository *repo; 
-    for ( repo = ( NCBIRepository* ) DLListHead ( & self -> repos ); repo != NULL; repo = ( NCBIRepository* ) DLNodeNext ( & repo -> n ) )
-    {
-        if ( repo->type == repo_type && SRAPathFindInRepo(self, repo, accession, path, path_max, rep_len, vol_type) == 0 )
-            return 0;
-    }
-    return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNotFound );
-}
-
-/* FastFind
- * Uses heuristics to select the repository most likely to contain the accession, then tries to locate the acecssion in the repository.
-*/
-static
-rc_t FindFast( const NCBISRAPath *cself, const char *accession, char *path, size_t path_max, size_t *rep_len )
-{
-    /*TODO: look up cache first */
-    
-    /* recognize known naming schemes */
-    size_t size = string_size(accession);
-    if ( string_cmp(accession, size, "SRR", 3, 3) == 0 )
-        return SRAPathFindInRepoByType(cself, accession, path, path_max, rep_len, alg_ncbi, alg_ncbi);
-
-    if ( string_cmp(accession, size, "ERR", 3, 3) == 0 )
-        return SRAPathFindInRepoByType(cself, accession, path, path_max, rep_len, alg_ncbi, alg_ebi);
-
-    if ( string_cmp(accession, size, "DRR", 3, 3) == 0 )
-        return SRAPathFindInRepoByType(cself, accession, path, path_max, rep_len, alg_ncbi, alg_ddbj);
-        
-    if ( string_chr(accession, size, '.') != NULL )
-        return SRAPathFindInRepoByType(cself, accession, path, path_max, rep_len, alg_refseq, alg_none);    
-        
-    if ( size > 2 && isdigit(accession[size-1]) && isdigit(accession[size-2]) && ! isdigit(accession[size-3]) ) 
-        return SRAPathFindInRepoByType(cself, accession, path, path_max, rep_len, alg_wgs, alg_none);    
-        
-    return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNotFound );
-}
-
-/* Find
- *  finds location of run within rep-server/volume matrix
- *
- *  "accession" [ IN ] - NUL terminated run accession,
- *   e.g. "SRR000001"
- *
- *  "path" [ OUT ] and "path_max" [ IN ] - return buffer for
- *  NUL-terminated full path to accession.
- *
- *  returns 0 if path exists, rc state rcNotFound if
- *  path cannot be found, and rcInsufficient if buffer is
- *  too small.
- */
-static
-rc_t CC NCBISRAPathFindWithRepLen ( const NCBISRAPath *cself, const char *accession, char *path, size_t path_max, size_t *rep_len )
-{
-    rc_t rc;
-    NCBIRepository *repo;
-
-    PATH_DEBUG(("NCBISRAPathFindWithRepLen(%s)\n", accession));
-
-    rc = FindFast( cself, accession, path, path_max, rep_len );
-    if ( rc == 0 )
-        return 0;
-        
-    /* loop through all repositories */ 
-    for ( repo = ( NCBIRepository* ) DLListHead ( & cself -> repos ); repo != NULL; repo = ( NCBIRepository* ) DLNodeNext ( & repo -> n ) )
-    {
-        rc = SRAPathFindInRepo(cself, repo, accession, path, path_max, rep_len, alg_none);
-        if ( rc == 0 )
-            return 0;
-    }
-    /* default repository */
-    return SRAPathFindInRepo(cself, cself -> dflt_repo, accession, path, path_max, rep_len, alg_none);
-}
-
-struct SRAPath_vt_v2 vtSRAPath =
-{
-    2, 1,
-    NCBISRAPathAddRef,
-    NCBISRAPathRelease,
-    NCBISRAPathVersion,
-    NCBISRAPathClear,
-    NCBISRAPathAddRepPathDefault,
-    NCBISRAPathAddVolPathDefault,
-    NCBISRAPathFull,
-    NCBISRAPathTest,
-    NCBISRAPathFindWithRepLen
-};
-
-/* Make
- *  create path manager
- *
- *  the path manager should already be configured with
- *  standard search paths, but can be augmented by using
- *  the Add*Path messages.
- *
- *  "dir" [ IN, NULL OKAY ] - optional root directory to use
- *  attaches a new reference
- */
-MOD_EXPORT
-rc_t CC SRAPathMakeImpl ( SRAPath **pm, const KDirectory *dir )
-{
-    rc_t rc;
-
-    if ( pm == NULL )
-        rc = RC ( rcSRA, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        NCBISRAPath *p = (NCBISRAPath *) malloc ( sizeof * p );
-        if ( p == NULL )
-            rc = RC ( rcSRA, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            p -> dad . vt = ( SRAPath_vt* ) & vtSRAPath;
-            p -> dir = dir;
-            if ( dir != NULL )
-                rc = KDirectoryAddRef ( dir );
-            else
-            {
-                KDirectory *wd;
-                rc = KDirectoryNativeDir ( & wd );
-                p -> dir = wd;
-            }
-
-            if ( rc != 0 )
-                free ( p );
-            else
-            {
-                DLListInit ( & p -> repos );
-                p -> dflt_repo = NULL;
-                atomic32_set ( & p -> refcount, 1 );
-
-                /* the object is now complete */
-                rc = SRAPathConfig ( p );
-                if ( rc == 0 )
-                {
-                    * pm = & p -> dad;
-                    return 0;
-                }
-
-                SRAPathWhack ( p );
-            }
-        }
-
-        * pm = NULL;
-    }
-
-    return rc;
-}
diff --git a/libs/vfs/unix/syskeyring.c b/libs/vfs/unix/syskeyring.c
deleted file mode 100644
index 81c13b5..0000000
--- a/libs/vfs/unix/syskeyring.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "keyring-priv.h"
-
-#include <kfg/config.h>
-
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfs/lockfile.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-
-static const char LockFileName[] = "/home/boshkina/.ncbi/keyring_lock";
-static const char KeyRingServerExeName[] = "keyring-srv";
-
-LIB_EXPORT bool CC KKeyRingIsServerRunning()
-{   
-    KDirectory* wd;
-    rc_t rc = KDirectoryNativeDir (&wd);
-    if (rc == 0)
-    {
-        KFile* lockedFile;
-        rc = KDirectoryCreateExclusiveAccessFile(wd, &lockedFile, true, 0600, kcmOpen, LockFileName);
-        if (rc == 0)
-            KFileRelease(lockedFile);
-        KDirectoryRelease(wd);
-    }
-    return rc == 0;
-}
-
-static
-int StartServer()
-{   /* create a child process that will become the server */
-    char* const argv[] = {(char*)KeyRingServerExeName, NULL};
-    pid_t child = fork();
-    switch (child)
-    {
-    case 0: /* child */
-        if (execvp(KeyRingServerExeName, argv) == -1)
-        {   /* look around:
-                - same dir as the current executable (kfg/APPPATH)
-                - current dir
-            */
-            return -1;
-        }
-        /* no return if successful */
-        return -1;
-    case -1:
-        return -1;
-    default: /* parent */
-        return 0;
-    }
-}
-
-rc_t StartKeyRing(struct KStream** ipc)
-{
-/*
-    1. Lock the lock file
-    2. If failed, create the ipc object, connect to the server and exit (success)
-    3. If succeeded, fork
-        In the child:
-        - execvp(kr-server) (if not in PATH, try locate and execv in fixed places (kfg:$APPPATH, ./)
-        In the parent:
-        - wait for the server connection to come up (= keyring server ready).
-        - close the lock file (do not unlock)
-        - connect to the server and exit (success)
-*/
-    KDirectory* wd;
-    rc_t rc = KDirectoryNativeDir (&wd);
-    if (rc == 0)
-    {
-        KFile* lockedFile;
-        rc = KDirectoryCreateExclusiveAccessFile(wd, &lockedFile, true, 0600, kcmOpen, LockFileName);
-        if (rc == 0)
-        {   /* start the server */
-            pid_t child = fork();
-            switch (child)
-            {
-                case 0: /* child */
-                {   /* fork a grandchild that will become the server */
-                    exit(StartServer());
-                    break;
-                }
-                case -1: /* error */
-                {
-                    rc_t rc;
-                    switch (errno)
-                    {
-                    case EAGAIN:
-                    case ENOMEM:
-                        rc = RC (rcVFS, rcProcess, rcProcess, rcMemory, rcInsufficient);
-                        break;
-                    case ENOSYS:
-                        rc = RC (rcVFS, rcProcess, rcProcess, rcInterface, rcUnsupported);
-                        break;
-                    default:
-                        rc = RC (rcVFS, rcProcess, rcProcess, rcError, rcUnknown);
-                        break;
-                    }
-                    break;
-                }
-                default: /* parent */
-                {
-                    waitpid(child, 0, 0);
-                    break;
-                }
-            }
-            KFileRelease(lockedFile); /* if successfully started, the grandchild will hold the lock until its exit */
-        }
-        KDirectoryRelease(wd);
-    }
-    return rc;
-}
-
-#if 0
-static
-rc_t GetAppPath(const char* buf, size_t bufsize)
-{
-    KConfig* kfg;
-    rc_t rc = KConfigMake(&kfg, NULL);
-    if (rc == 0)
-    {
-        const KConfigNode *node;
-        char path[] = "APPPATH";
-        char buf[4096];
-        size_t num_read;
-        rc_t rc2;
-    
-        rc_t rc=KConfigOpenNodeRead(kfg, &node, path, string_measure(path, NULL), buf);
-        if (rc == 0) 
-        {
-            rc = KConfigNodeRead(node, 0, buf, bufsize, &num_read, NULL);
-            rc2 = KConfigNodeRelease(node);
-            if (rc == 0)
-                rc = r2;
-        }
-        rc2 = KConfigRelease(kfg);
-        if (rc == 0)
-            rc = r2;
-    }
-    return rc;
-}
-#endif
\ No newline at end of file
diff --git a/libs/vfs/unix/syspath.c b/libs/vfs/unix/syspath.c
deleted file mode 100644
index e128181..0000000
--- a/libs/vfs/unix/syspath.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vfs/extern.h>
-
-#include "path-priv.h"
-
-#include <vfs/manager.h>
-#include <klib/text.h>
-#include <klib/refcount.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include <sysalloc.h>
-
-
-/*--------------------------------------------------------------------------
- * VFSManager
- */
-
-
-/* MakeSysPath
- *  make a path object from an OS native filesystem path string
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "sys_path" [ IN ] - a UTF-8 NUL-terminated string
- *  representing a native filesystem path
- *
- *  "wide_sys_path" [ IN ] - a wide NUL-terminated string
- *  representing a native filesystem path, where
- *  wchar_t is either USC-2 or UTF-32 depending upon libraries
- */
-LIB_EXPORT rc_t CC VFSManagerMakeSysPath ( const VFSManager * self,
-    VPath ** new_path, const char * sys_path )
-{
-    rc_t rc;
-
-    if ( sys_path != NULL )
-    {
-        /* POSIX paths are our normal path type */
-        return VFSManagerMakePath ( self, new_path, "%s", sys_path );
-    }
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcSelf, rcNull );
-        else
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcNull );
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-LIB_EXPORT rc_t CC VFSManagerWMakeSysPath ( const VFSManager * self,
-    VPath ** new_path, const wchar_t * wide_sys_path )
-{
-    rc_t rc;
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcSelf, rcNull );
-        else if ( wide_sys_path == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcNull );
-        else
-        {
-            size_t src_size, dst_size;
-            uint32_t len = wchar_cvt_string_measure ( wide_sys_path, & src_size, & dst_size );
-            if ( len == 0 )
-                rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcEmpty );
-            else
-            {
-                /* transform to UTF-8 */
-                size_t copy_size;
-                char utf8_path [ 4096 ], *dst = utf8_path;
-                if ( dst_size < sizeof utf8_path )
-                    dst_size = sizeof utf8_path;
-                else
-                {
-                    dst = malloc ( ++ dst_size );
-                    if ( dst == NULL )
-                        rc = RC ( rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-                }
-
-                copy_size = wchar_cvt_string_copy ( dst, dst_size, wide_sys_path, src_size );
-                if ( copy_size >= dst_size )
-                    rc = RC ( rcVFS, rcMgr, rcConstructing, rcBuffer, rcInsufficient );
-                else
-                {
-                    dst [ copy_size ] = 0;
-                    rc = VFSManagerMakePath ( self, new_path, "%s", dst );
-                }
-
-                if ( dst != utf8_path )
-                    free ( dst );
-
-                if ( rc == 0 )
-                    return 0;
-            }
-        }
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-/* ==========================================
-             HACK O' MATIC
- */
-
-rc_t LegacyVPathMakeSysPath ( VPath ** new_path, const char * sys_path )
-{
-    return LegacyVPathMake ( new_path, sys_path );
-}
diff --git a/libs/vfs/win/syskeyring.c b/libs/vfs/win/syskeyring.c
deleted file mode 100644
index f747513..0000000
--- a/libs/vfs/win/syskeyring.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "keyring-priv.h"
-
-#include <kfg/config.h>
-#include <klib/text.h>
-
-rc_t StartKeyRing(struct KStream** ipc)
-{
-    KConfig* kfg;
-    rc_t rc = KConfigMake(&kfg, NULL);
-    if (rc == 0)
-    {
-        const KConfigNode *node;
-        char path[] = "$(APPPATH)";
-        char buf[4096];
-        size_t num_read;
-    
-        rc_t rc=KConfigOpenNodeRead(kfg, &node, path, string_measure(path, NULL), buf);
-        if (rc == 0) 
-        {
-            rc = KConfigNodeRead(node, 0, buf, sizeof(buf), &num_read, NULL);
-            if (rc == 0)
-            {
-printf("apppath='%s'\n", buf);        
-            }
-            KConfigNodeRelease(node);
-        }
-        rc = KConfigRelease(kfg);
-    }
-    return rc;
-}
diff --git a/libs/vfs/win/syspath.c b/libs/vfs/win/syspath.c
deleted file mode 100644
index 2a60ee5..0000000
--- a/libs/vfs/win/syspath.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vfs/extern.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-
-#include "path-priv.h"
-
-#include <wchar.h>
-#include <windows.h>
-#include <direct.h>
-
-#include <sysalloc.h>
-
-/*--------------------------------------------------------------------------
- * VFSManager
- */
-
-
-/* MakeSysPath
- *  make a path object from an OS native filesystem path string
- *
- *  "new_path" [ OUT ] - return parameter for new path object
- *
- *  "sys_path" [ IN ] - a UTF-8 NUL-terminated string
- *  representing a native filesystem path
- *
- *  "wide_sys_path" [ IN ] - a wide NUL-terminated string
- *  representing a native filesystem path, where
- *  wchar_t is either USC-2 or UTF-32 depending upon libraries
- */
-LIB_EXPORT rc_t CC VFSManagerMakeSysPath ( const VFSManager * self,
-    VPath ** new_path, const char * sys_path )
-{
-    rc_t rc = 0;
-
-    /* this is all incorrect - the only reason we STILL use
-       wchar_t in Windows is to guarantee UNICODE. most of the
-       time, we'll have UTF-8, which is okay. but on older systems,
-       it could still be something ancient. should use OS
-       to convert from system path to UCS-2. */
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcSelf, rcNull );
-        else if ( sys_path == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcNull );
-        else
-        {
-            size_t src_size = string_size ( sys_path );
-
-            /* transform to wchar_t */
-            wchar_t wchar_path [ 4096 ], * dst = wchar_path;
-            size_t copy_size, dst_size = src_size * sizeof wchar_path [ 0 ];
-            if ( dst_size < sizeof wchar_path )
-                dst_size = sizeof wchar_path;
-            else
-            {
-                dst = malloc ( dst_size += sizeof * dst );
-                if ( dst == NULL )
-                    rc = RC ( rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-            }
-
-            if ( rc == 0 )
-            {
-                /* we need to call windows to do the conversion, because sys_path can
-                   be ascii or multi-byte */
-                copy_size = MultiByteToWideChar(    CP_THREAD_ACP,
-                                        MB_PRECOMPOSED,
-                                        sys_path,
-                                        ( int )src_size,
-                                        dst,
-                                        ( int ) ( dst_size / sizeof dst[ 0 ] ) - 1 );
-                if ( copy_size == 0 )
-                {
-                    DWORD status = GetLastError ();
-                    DBGMSG ( DBG_VFS, DBG_FLAG_ANY, ( "MultiByteToWideChar: error code - %!.\n", status ) );
-                    rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcInvalid );
-                }
-                else
-                {
-                    dst [ copy_size ] = 0;
-                    rc = VFSManagerWMakeSysPath ( self, new_path, dst );
-                }
-
-                if ( dst != wchar_path )
-                    free ( dst );
-
-                if ( rc == 0 )
-                    return 0;
-
-            }
-        }
-
-        * new_path = NULL;
-    }
-
-    return rc;
-}
-
-
-static rc_t transform_to_utf8_and_make_vpath( const VFSManager * self,
-                                              VPath ** new_path,
-                                              const wchar_t * src )
-{
-    rc_t rc = 0;
-    size_t src_size, dst_size;
-    uint32_t len = wchar_cvt_string_measure ( src, & src_size, & dst_size );
-    if ( len == 0 )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcEmpty );
-    else
-    {
-        /* transform to UTF-8 */
-        size_t copy_size;
-        char utf8_path [ 4096 ], *dst = utf8_path;
-        if ( dst_size < sizeof utf8_path )
-            dst_size = sizeof utf8_path;
-        else
-        {
-            dst = malloc ( ++ dst_size );
-            if ( dst == NULL )
-                return RC ( rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        }
-
-        copy_size = wchar_cvt_string_copy ( dst, dst_size, src, src_size );
-        if ( copy_size >= dst_size )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcBuffer, rcInsufficient );
-        else
-        {
-            size_t i;
-
-            dst [ copy_size ] = 0;
-
-            /* convert '\\' to '/' */
-            for ( i = 0; i < copy_size; ++ i )
-            {
-                if ( dst [ i ] == '\\' )
-                    dst [ i ] = '/';
-            }
-
-            /* this is the final goal! */
-            rc = VFSManagerMakePath ( self, new_path, "%.*s", ( uint32_t ) copy_size, dst );
-        }
-
-        if ( dst != utf8_path )
-            free ( dst );
-    }
-    return rc;
-}
-
-
-static rc_t make_absolute_and_transform_to_utf8_and_make_vpath( const VFSManager * self,
-                                              VPath ** new_path,
-                                              const wchar_t * src )
-{
-    rc_t rc;
-    wchar_t full [ 4096 ];
-
-    /* expand to full path - this is temporary, and will be replaced after KFS is updated */
-    DWORD len = GetFullPathNameW ( src, sizeof full / sizeof full [ 0 ], full, NULL );
-    if ( len == 0 )
-    {
-        /* we have an error */
-        DWORD status = GetLastError ();
-        DBGMSG ( DBG_VFS, DBG_FLAG_ANY, ( "GetFullPathNameW: error code - %u.\n", status ) );
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcInvalid );
-    }
-    else if ( len >= sizeof full / sizeof full [ 0 ] )
-    {
-        /* the buffer is too small ! */
-        wchar_t * big_buf = malloc( ( ++len ) * ( sizeof full[ 0 ] ) );
-        if ( big_buf == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            DWORD len2 = GetFullPathNameW ( src, len, big_buf, NULL );
-            if ( len2 == 0 )
-            {
-                /* we have an error */
-                DWORD status = GetLastError ();
-                DBGMSG ( DBG_VFS, DBG_FLAG_ANY, ( "GetFullPathNameW: error code - %u.\n", status ) );
-                rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcInvalid );
-            }
-            else if ( len2 >= len )
-            {
-                DBGMSG ( DBG_VFS, DBG_FLAG_ANY, ( "GetFullPathNameW: buffer too small again - %u.\n", len2 ) );
-                rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcInvalid );
-            }
-            else
-            {
-                /* now we can call the final transform and make */
-                rc = transform_to_utf8_and_make_vpath( self, new_path, big_buf );
-            }
-            free( big_buf );
-        }
-    }
-    else
-    {
-        /* now we can call the final transform and make */
-        rc = transform_to_utf8_and_make_vpath( self, new_path, full );
-    }
-    return rc;
-}
-
-static
-bool could_be_url ( const wchar_t * wide_sys_path )
-{
-    uint32_t i;
-    for ( i = 0; wide_sys_path [ i ] != 0; ++ i )
-    {
-        if ( wide_sys_path [ i ] == ':' )
-        {
-            if ( i < 3 || i > 16 )
-                break;
-            for ( ++ i; wide_sys_path [ i ] != 0; ++ i )
-            {
-                if ( wide_sys_path [ i ] == '\\' )
-                    return false;
-            }
-            return true;
-        }
-
-        if ( wide_sys_path [ i ] == '\\' )
-            break;
-    }
-    return false;
-}
-
-
-LIB_EXPORT rc_t CC VFSManagerWMakeSysPath ( const VFSManager * self,
-    VPath ** new_path, const wchar_t * wide_sys_path )
-{
-    rc_t rc = 0;
-
-    /* what makes Windows paths exciting is that they
-       have these drive letters, or they can be UNC,
-       but they can be relative to the current drive,
-       and they can use back-slashes because they're
-       easy to type, or they can use forward-slashes,
-       whatever. */
-
-    if ( new_path == NULL )
-        rc = RC ( rcVFS, rcMgr, rcConstructing, rcParam, rcNull );
-    else
-    {
-        if ( self == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcSelf, rcNull );
-        else if ( wide_sys_path == NULL )
-            rc = RC ( rcVFS, rcMgr, rcConstructing, rcPath, rcNull );
-        else
-        {
-            if ( ( wide_sys_path [ 0 ] == '\\' && wide_sys_path [ 1 ] == '\\' ) ||
-                 ( wide_sys_path [ 0 ] == '/'  && wide_sys_path [ 1 ] == '/'  ) )
-            {
-                /* it is an unc-path */
-
-                /* reject IO or device namespaces */
-                if ( ( wide_sys_path [ 2 ] ==  '?' || wide_sys_path [ 2 ] == '.' ) &&
-                     ( wide_sys_path [ 3 ] == '\\' || wide_sys_path [ 3 ] == '/' ) )
-                    return RC ( rcVFS, rcPath, rcConstructing, rcPath, rcIncorrect );
-
-                /* produce the VPath-instance from the passed in string */
-                rc = transform_to_utf8_and_make_vpath( self, new_path,  wide_sys_path );
-            }
-            else
-            {
-                /* it is not an unc-path */
-                if ( iswalpha ( wide_sys_path [ 0 ] ) && wide_sys_path [ 1 ] == ':' )
-                {
-                    /* drive letter detected */
-                    if ( wide_sys_path [ 2 ] != '\\' && wide_sys_path [ 2 ] != '/' )
-                    {
-                        /* no absolute path, we have make a absolute path first */
-                        rc = make_absolute_and_transform_to_utf8_and_make_vpath( self, new_path, wide_sys_path );
-                    }
-                    else
-                    {
-                        /* produce the VPath-instance from the passed in string */
-                        rc = transform_to_utf8_and_make_vpath( self, new_path,  wide_sys_path );
-                    }
-                }
-                else if ( could_be_url ( wide_sys_path ) )
-                    rc = transform_to_utf8_and_make_vpath( self, new_path,  wide_sys_path );
-                else
-                {
-                    /* no drive letter detected, we have make a absolute path first */
-                    rc = make_absolute_and_transform_to_utf8_and_make_vpath( self, new_path, wide_sys_path );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* ==========================================
-             HACK O' MATIC
- */
-
-rc_t LegacyVPathMakeSysPath ( VPath ** new_path, const char * sys_path )
-{
-    VFSManager * vfs;
-    rc_t rc = VFSManagerMake ( & vfs );
-    if ( rc == 0 )
-    {
-        rc = VFSManagerMakeSysPath ( vfs, new_path, sys_path );
-        VFSManagerRelease ( vfs );
-    }
-    return rc;
-}
diff --git a/libs/vxf/Makefile b/libs/vxf/Makefile
deleted file mode 100644
index 1afc882..0000000
--- a/libs/vxf/Makefile
+++ /dev/null
@@ -1,162 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/vxf
-
-INT_LIBS = \
-	libvxf \
-	libwvxf
-
-include $(TOP)/build/Makefile.env
-
-RWORKDIR = $(BINDIR)
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-.PHONY: all std $(ALL_LIBS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(TARGDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vdb transform library
-#
-$(TARGDIR)/libvxf: $(addprefix $(ILIBDIR)/libvxf.,$(ILIBEXT))
-
-VXF_SRC = \
-	ceil \
-	clip \
-	cut \
-	echo \
-	exists \
-	floor \
-	paste \
-	round \
-	trunc \
-	unzip \
-	map \
-	funzip \
-	vec-sum \
-	min \
-	max \
-	rldecode \
-	pack \
-	unpack \
-	izip \
-	iunzip \
-	diff \
-	sum \
-	bit_or \
-	trim \
-	deriv \
-	integral \
-	integral_0 \
-	delta \
-	undelta \
-	add-row-id \
-	subtract-row-id \
-	irzip \
-	rand_4na_2na \
-	outlier-encoder \
-	outlier-decoder \
-	bunzip \
-	simple-sub-select \
-	extract_token \
-	strtonum \
-	sprintf \
-	wgs-tokenize-accession \
-	lower-case-tech-reads
-
-VXF_OBJ = \
-	$(addsuffix .$(LOBX),$(VXF_SRC))
-
-VXF_LIB = \
-	-dvdb \
-	-dklib \
-	-dm \
-	-dz \
-	-dbz2
-
-$(ILIBDIR)/libvxf.$(LIBX): $(VXF_OBJ)
-	$(LD) --slib -o $@ $^ $(VXF_LIB)
-
-#-------------------------------------------------------------------------------
-# wvdb transform library
-#
-
-$(TARGDIR)/libwvxf: $(addprefix $(ILIBDIR)/libwvxf.,$(ILIBEXT))
-
-WVXF_SRC = \
-	$(VXF_SRC) \
-	zip \
-	bzip \
-	fzip \
-	rlencode \
-	checksum
-
-WVXF_OBJ = \
-	$(addsuffix .$(LOBX),$(WVXF_SRC))
-
-# temporary
-WVXF_LIB = \
-	-dwvdb \
-	-dwkdb \
-	-dklib \
-	-dm \
-	-dz \
-	-dbz2
-
-$(ILIBDIR)/libwvxf.$(LIBX): $(WVXF_OBJ)
-	$(LD) --slib -o $@ $^ $(WVXF_LIB)
-
-libwvxf.vers.h:
-	@ true
-
-.PHONY: $(TARGDIR)/libwvxf
diff --git a/libs/vxf/add-row-id.c b/libs/vxf/add-row-id.c
deleted file mode 100644
index b07e9c2..0000000
--- a/libs/vxf/add-row-id.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-rc_t CC add_int64_t ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t i;
-    int64_t *dst;
-    const int64_t *src = argv [ 0 ] . u . data . base;
-    uint64_t elem_count = argv [ 0 ] . u . data . elem_count;
-
-    assert ( rslt -> data -> elem_bits == 64 );
-    rc = KDataBufferResize ( rslt -> data, elem_count );
-    if ( rc != 0 )
-        return rc;
-
-    dst = rslt -> data -> base;
-    rslt -> elem_count = elem_count;
-
-    /* while this function is typically used on single-element rows,
-       we advertise taking rows of any length... */
-    for ( i = 0, src += argv [ 0 ] . u . data . first_elem; i < elem_count; ++ i )
-        dst [ i ] = src [ i ] + row_id;
-
-    return 0;
-}
-
-
-/* add_row_id
- *  return the sum of input and current row id
- *
- *  "in" [ DATA ]
- *
- * SYNOPSIS:
- *  corrects for series that have been offset by row-id
- */
-VTRANSFACT_IMPL ( vdb_add_row_id, 1, 0, 0 ) ( const void *fself, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* version 1.0 operates on I64 input */
-    rslt -> u . ndf = add_int64_t;
-    rslt -> variant = vftNonDetRow;
-    return 0;
-}
diff --git a/libs/vxf/bit_or.c b/libs/vxf/bit_or.c
deleted file mode 100644
index 644ea53..0000000
--- a/libs/vxf/bit_or.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <assert.h>
-
-typedef struct tag_self_t {
-    uint8_t     align;
-} self_t;
-
-static void CC self_whack( void *Self )
-{
-    free( Self );
-}
-static
-rc_t CC bit_or_impl(
-                 void *Self,
-                 const VXformInfo *info,
-                 int64_t row_id,
-                 VRowResult *rslt,
-                 uint32_t argc,
-                 const VRowData argv[]
-                          )
-{                                                                        
-    rc_t rc;
-    uint32_t a_size,b_size;
-    const self_t *self = Self;
-    const uint8_t *a = argv[0].u.data.base;
-    const uint8_t *b = argv[1].u.data.base;
-    uint8_t *dst;
-
-    a += argv[0].u.data.first_elem;
-    b += argv[1].u.data.first_elem;
-
-    assert((argv[0].u.data.elem_bits&7)== 0);
-    assert(argv[1].u.data.elem_bits==argv[0].u.data.elem_bits);
-
-    rslt->elem_bits = argv[0].u.data.elem_bits;
-    
-    a_size = argv[0].u.data.elem_count * (argv[0].u.data.elem_bits>>3);
-    b_size = argv[1].u.data.elem_count * (argv[1].u.data.elem_bits>>3);
-    if(a_size >= b_size){ /**** leaving a > b *****/
-	rslt->elem_count = argv[0].u.data.elem_count;
-    } else { /*** switching so  a > b ***/
-	const uint8_t *t;
-	uint32_t       t_size;
-	rslt->elem_count = argv[1].u.data.elem_count;
-	t=a;a=b;b=t;
-	t_size=a_size;a_size=b_size;b_size=t_size;
-    } 
-    /*** everything a is now the largest ***/
-    rc = KDataBufferResize ( rslt->data, a_size );
-    if(rc==0){
-	dst = rslt -> data -> base;
-
-	if(b_size == 0){/*** trivial shortcut ***/
-		memcpy(dst,a,a_size);
-		return 0;
-	}
-	if(self -> align == 1){ /*** left side align ***/
-		while(a_size > b_size){
-			*dst++ = *a++;
-			a_size--;
-		}
-	}
-	while(b_size > 0){
-		*dst++ = *a++ | *b++;
-		a_size--;
-		b_size--;
-		
-	}
-	while(a_size > 0){
-		*dst++ = *a++;
-                a_size--;
-	}
-    }
-    return 0;
-}
-
-VTRANSFACT_IMPL ( vdb_bit_or, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    self_t *self;
-            
-    self = malloc(sizeof(*self));
-    if (self) {
-	self->align = cp->argv[0].data.u8[0];
-	rslt->self = self;
-	rslt->whack = self_whack;
-	rslt->variant = vftRow;
-	rslt->u.rf = bit_or_impl;
-	return 0;
-    }
-    rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    return rc;
-}
diff --git a/libs/vxf/bunzip.c b/libs/vxf/bunzip.c
deleted file mode 100644
index 3ea4309..0000000
--- a/libs/vxf/bunzip.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <string.h>
-#include <bzlib.h>
-
-static rc_t invoke_bzip2 ( void *dst, size_t dsize, const void *src, size_t ssize )
-{
-    int bzerr;
-
-    bz_stream s;
-    memset ( & s, 0, sizeof s );
-    bzerr = BZ2_bzDecompressInit ( & s, 0, 0 );
-    if ( bzerr != BZ_OK )
-        return RC ( rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted );
-
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = dsize;
-    
-    bzerr = BZ2_bzDecompress(&s);
-    BZ2_bzDecompressEnd ( & s );
-
-    switch ( bzerr )
-    {
-    case BZ_OK:
-    case BZ_STREAM_END:
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-    }
-
-    return 0;
-}
-
-static
-rc_t bunzip_func_v1 ( const VXformInfo *info, VBlobResult *dst, const VBlobData *src )
-{
-    dst->byte_order = src->byte_order;
-    return invoke_bzip2 ( dst->data, (((size_t)dst->elem_count * dst->elem_bits + 7) >> 3),
-                          src->data, (((size_t)src->elem_count * src->elem_bits + 7) >> 3));
-}
-
-static
-rc_t bunzip_func_v2 ( const VXformInfo *info,
-    VBlobResult *dst, const VBlobData *src, VBlobHeader *hdr )
-{
-    int64_t trailing;
-    rc_t rc = VBlobHeaderArgPopHead ( hdr, & trailing );
-    if ( rc == 0 )
-    {
-        dst -> elem_count *= dst -> elem_bits;
-        dst -> byte_order = src -> byte_order;
-        dst -> elem_bits = 1;
-
-        rc = invoke_bzip2 ( dst->data, (((size_t)dst->elem_count + 7) >> 3),
-                            src->data, (((size_t)src->elem_count * src->elem_bits + 7) >> 3));
-        if ( rc == 0 )
-        {
-            dst -> elem_count &= ( uint64_t ) ~ 7;
-            dst -> elem_count |= trailing;
-        }
-    }
-
-    return rc;
-}
-
-
-static
-rc_t CC bunzip_func ( void *Self, const VXformInfo *info,
-    VBlobResult *dst, const VBlobData *src, VBlobHeader *hdr )
-{
-    switch ( VBlobHeaderVersion ( hdr ) )
-    {
-    case 1:
-        return bunzip_func_v1(info, dst, src);
-    case 2:
-        return bunzip_func_v2(info, dst, src, hdr);
-    }
-
-    return RC(rcXF, rcFunction, rcExecuting, rcParam, rcBadVersion);
-}
-
-/* bunzip
- *  function any bunzip #1.0 ( bzip2_fmt in );
- */
-VTRANSFACT_IMPL ( vdb_bunzip, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = bunzip_func;
-
-    return 0;
-}
diff --git a/libs/vxf/bzip.c b/libs/vxf/bzip.c
deleted file mode 100644
index 1070503..0000000
--- a/libs/vxf/bzip.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <bzlib.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <stdio.h>
-#include <assert.h>
-
-#define BUFFER_GROWTH_RATE (128 * 1024)
-
-typedef struct bzip_t bzip_t;
-struct bzip_t
-{
-    int32_t blockSize100k;
-    int32_t workFactor;
-};
-
-#if _DEBUGGING
-static
-void debug_print_bz_stream(const bz_stream *s)
-{
-    printf("avail_in: %u, avail_out: %u, total_in_lo32: %u, total_in_hi32: %u, total_out_lo32: %u, total_out_hi32: %u\n",
-           s->avail_in,
-           s->avail_out,
-           s->total_in_lo32, s->total_in_hi32,
-           s->total_out_lo32, s->total_out_hi32);
-}
-#endif
-
-static
-rc_t invoke_bzip2 ( bzip_t *self, void *dst, uint32_t *dsize, const void *src, uint32_t ssize)
-{
-    int bzerr;
-
-    bz_stream s;
-    memset ( & s, 0, sizeof s );
-    bzerr = BZ2_bzCompressInit ( & s, self -> blockSize100k, 0, self -> workFactor );
-    if ( bzerr != BZ_OK )
-        return RC ( rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted );
-    
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = *dsize;
-    
-    *dsize = 0;
-    bzerr = BZ2_bzCompress(&s, BZ_FINISH);
-    switch (bzerr)
-    {
-    case BZ_OK:
-    case BZ_RUN_OK:
-    case BZ_FINISH_OK:
-    case BZ_STREAM_END:
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "BZ2_bzCompress: unexpected bzip2 error %i\n", bzerr);
-#endif
-        BZ2_bzCompressEnd ( & s );
-        return RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-
-    assert ( s.total_out_hi32 == 0 );
-    *dsize = s.total_out_lo32;
-
-
-    BZ2_bzCompressEnd ( & s );
-
-    return 0;
-}
-
-static
-rc_t CC bzip_func ( void *Self, const VXformInfo *info,
-    VBlobResult *dst, const VBlobData *src, VBlobHeader *hdr )
-{
-    rc_t rc;
-    bzip_t *self = Self;
-
-    /* input bits */
-    uint64_t sbits = ( uint64_t) src -> elem_count * src -> elem_bits;
-
-    /* input bytes */
-    uint32_t ssize = ( uint32_t ) ( ( sbits + 7 ) >> 3 );
-
-    /* required output size */
-    uint32_t dsize = ( uint32_t ) ( ( ( size_t ) dst -> elem_count * dst->elem_bits + 7 ) >> 3 );
-
-    if ( ( sbits & 7 ) == 0 )
-        /* version 1 is byte-aligned */
-        VBlobHeaderSetVersion ( hdr, 1 );
-    else
-    {
-        VBlobHeaderSetVersion ( hdr, 2 );
-        VBlobHeaderArgPushTail ( hdr, ( int64_t ) ( sbits & 7 ) );
-    }
-
-    rc = invoke_bzip2 ( self, dst -> data, & dsize, src -> data, ssize);
-    if (rc == 0)
-    {
-        dst->elem_bits = 1;
-        dst->byte_order = src->byte_order;
-        if (dsize != 0)
-            dst->elem_count = dsize << 3;
-        else
-            rc = RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    }
-
-    return rc;
-}
-
-/* bzip
- * function bzip2_fmt bzip #1.0 < * U32 blockSize100k, U32 workFactor > ( any in );
- */
-VTRANSFACT_IMPL ( vdb_bzip, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    bzip_t *fself;
-
-    int blockSize100k = 5;
-    int workFactor = 0;
-
-    if ( cp -> argc > 0 )
-    {
-        blockSize100k = cp -> argv [ 0 ] . data . i32 [ 0 ];
-        if ( blockSize100k < 1 || blockSize100k > 9 )
-            return RC(rcXF, rcFunction, rcConstructing, rcParam, rcInvalid);
-        if ( cp -> argc > 1 )
-        {
-            workFactor = cp -> argv [ 1 ] . data . i32 [ 0 ];
-            if ( workFactor > 250 )
-                return RC(rcXF, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-    }
-
-    fself = malloc ( sizeof *fself );
-    if ( fself == NULL )
-        return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    fself -> blockSize100k = blockSize100k;
-    fself -> workFactor = workFactor;
-
-    rslt->self = fself;
-    rslt->whack = free;
-    rslt->variant = vftBlob;
-    rslt->u.bf = bzip_func;
-        
-    return 0;
-}
diff --git a/libs/vxf/ceil.c b/libs/vxf/ceil.c
deleted file mode 100644
index 141d868..0000000
--- a/libs/vxf/ceil.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-#include <assert.h>
-
-#define FLOAT_FUNC ceilf
-#define DOUBLE_FUNC ceil
-#include "math-funcs-impl.h"
-
-/*
- function < type T >
- T vdb:ceil #1.0 ( T in );
- */
-VTRANSFACT_IMPL(vdb_ceil, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp ) {
-    return factory(self, info, rslt, cp, dp);
-}
diff --git a/libs/vxf/checksum.c b/libs/vxf/checksum.c
deleted file mode 100644
index 37b3903..0000000
--- a/libs/vxf/checksum.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <vdb/schema.h>
-#include <kdb/meta.h>
-#include <klib/checksum.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct CRC32State CRC32State;
-struct CRC32State
-{
-    uint64_t len;
-    uint32_t crc;
-};
-
-typedef struct checksum checksum;
-struct checksum
-{
-    KMetadata *meta;
-
-    void ( * swap ) ( checksum *self );
-    void ( * sum ) ( checksum *self, const void *data, size_t bytes );
-    size_t ( * digest ) ( checksum *self, uint8_t *buff, size_t bsize );
-
-    size_t valid;
-    union
-    {
-        CRC32State crc32;
-        MD5State md5;
-        SHA1State sha1;
-        SHA256State sha256;
-        SHA384State sha384;
-        SHA512State sha512;
-        uint8_t buff [ 1 ];
-    } u;
-
-    bool byte_swap;
-    char node [ 1 ];
-};
-
-/*--------------------------------------------------------------------------
- * CRC32
- */
-static
-void vdb_crc32swap ( checksum *self )
-{
-    self -> u . crc32 . len = bswap_64 ( self -> u . crc32 . len );
-    self -> u . crc32 . crc = bswap_32 ( self -> u . crc32 . crc );
-}
-
-static
-void vdb_crc32sum ( checksum *self, const void *data, size_t bytes )
-{
-    self -> u . crc32 . crc = CRC32 ( self -> u . crc32 . crc, data, bytes );
-    self -> u . crc32 . len += bytes;
-}
-
-static
-size_t vdb_crc32digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    uint64_t len = self -> u . crc32 . len;
-    uint8_t ch[sizeof(len)];
-    unsigned i;
-
-    assert ( bsize >= 4 );
-
-    for (i = 0; len; len >>= 8, ++i)
-        ch[i] = (uint8_t)len;
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    * ( uint32_t* ) buff = bswap_32 ( ~ CRC32 ( self -> u . crc32 . crc, ch, i ) );
-#else
-    * ( uint32_t* ) buff =  ~ CRC32 ( self -> u . crc32 . crc, ch, i );
-#endif
-    return 4;
-}
-
-/*--------------------------------------------------------------------------
- * md5
- */
-static
-void vdb_md5swap ( checksum *self )
-{
-    self -> u . md5 . count [ 0 ] = bswap_32 ( self -> u . md5 . count [ 0 ] );
-    self -> u . md5 . count [ 1 ] = bswap_32 ( self -> u . md5 . count [ 1 ] );
-    self -> u . md5 . abcd [ 0 ] = bswap_32 ( self -> u . md5 . abcd [ 0 ] );
-    self -> u . md5 . abcd [ 1 ] = bswap_32 ( self -> u . md5 . abcd [ 1 ] );
-    self -> u . md5 . abcd [ 2 ] = bswap_32 ( self -> u . md5 . abcd [ 2 ] );
-    self -> u . md5 . abcd [ 3 ] = bswap_32 ( self -> u . md5 . abcd [ 3 ] );
-}
-
-static
-void vdb_md5sum ( checksum *self, const void *data, size_t bytes )
-{
-    MD5StateAppend ( & self -> u . md5, data, bytes );
-}
-
-static
-size_t vdb_md5digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    assert ( bsize >= 16 );
-    MD5StateFinish ( & self -> u . md5, buff );
-    return 16;
-}
-
-/*--------------------------------------------------------------------------
- * sha1
- */
-static
-void vdb_sha32swap ( checksum *self )
-{
-    unsigned int i;
-    self -> u . sha1 . len = bswap_64 ( self -> u . sha1 . len );
-    for ( i = 0; i < 8; ++ i )
-        self -> u . sha1 . H [ i ] = bswap_32 ( self -> u . sha1 . H [ i ] );
-    self -> u . sha1 . cur = bswap_32 ( self -> u . sha1 . cur );
-}
-
-static
-void vdb_sha1sum ( checksum *self, const void *data, size_t bytes )
-{
-    SHA1StateAppend ( & self -> u . sha1, data, bytes );
-}
-
-static
-size_t vdb_sha1digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    assert ( bsize >= 20 );
-    SHA1StateFinish ( & self -> u . sha1, buff );
-    return 20;
-}
-
-/*--------------------------------------------------------------------------
- * sha256
- */
-static
-void vdb_sha256sum ( checksum *self, const void *data, size_t bytes )
-{
-    SHA256StateAppend ( & self -> u . sha256, data, bytes );
-}
-
-static
-size_t vdb_sha256digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    assert ( bsize >= 32 );
-    SHA256StateFinish ( & self -> u . sha256, buff );
-    return 32;
-}
-
-/*--------------------------------------------------------------------------
- * sha384
- */
-static
-void vdb_sha64swap ( checksum *self )
-{
-    unsigned int i;
-    self -> u . sha384 . len = bswap_64 ( self -> u . sha384 . len );
-    for ( i = 0; i < 8; ++ i )
-        self -> u . sha384 . H [ i ] = bswap_64 ( self -> u . sha384 . H [ i ] );
-    self -> u . sha384 . cur = bswap_32 ( self -> u . sha384 . cur );
-}
-
-static
-void vdb_sha384sum ( checksum *self, const void *data, size_t bytes )
-{
-    SHA384StateAppend ( & self -> u . sha384, data, bytes );
-}
-
-static
-size_t vdb_sha384digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    assert ( bsize >= 48 );
-    SHA384StateFinish ( & self -> u . sha384, buff );
-    return 48;
-}
-
-/*--------------------------------------------------------------------------
- * sha512
- */
-static
-void vdb_sha512sum ( checksum *self, const void *data, size_t bytes )
-{
-    SHA512StateAppend ( & self -> u . sha512, data, bytes );
-}
-
-static
-size_t vdb_sha512digest ( checksum *self, uint8_t *buff, size_t bsize )
-{
-    assert ( bsize >= 64 );
-    SHA512StateFinish ( & self -> u . sha512, buff );
-    return 64;
-}
-
-
-/*--------------------------------------------------------------------------
- * general checksum function
- */
-static
-rc_t CC checksum_driver ( void *obj, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    checksum *self = obj;
-
-    /* we ensured the input was an octet-stream within the factory */
-    uint32_t elem_bytes = argv [ 0 ] . u . data . elem_bits >> 3;
-    const uint8_t *src = argv [ 0 ] . u . data . base;
-    uint64_t count = argv [ 0 ] . u . data . elem_count;
-
-    src += argv [ 0 ] . u . data . first_elem * elem_bytes;
-    count *= elem_bytes;
-
-    ( * self -> sum ) ( self, src, count );
-
-    return 0;
-}
-
-static
-void CC checksum_whack ( void *obj )
-{
-    checksum *self = obj;
-
-    /* store metadata */
-    KMDataNode *digest;
-    rc_t rc = KMetadataOpenNodeUpdate ( self -> meta, & digest, self -> node );
-    if ( rc == 0 )
-    {
-        size_t bytes;
-        uint8_t buff [ 256 ];
-
-        /* open state node */
-        KMDataNode *state;
-        rc = KMDataNodeOpenNodeUpdate ( digest, & state, "state" );
-        if ( rc == 0 )
-        {
-            if ( self -> byte_swap )
-                ( * self -> swap ) ( self );
-
-            KMDataNodeWrite ( state, & self -> u, self -> valid );
-            KMDataNodeRelease ( state );
-
-            if ( self -> byte_swap )
-                ( * self -> swap ) ( self );
-       }
-
-        /* capture digest */
-        bytes = ( * self -> digest ) ( self, buff, sizeof buff );
-
-        /* write digest */
-        KMDataNodeWrite ( digest, buff, bytes );
-        KMDataNodeRelease ( digest );
-    }
-
-    KMetadataRelease ( self -> meta );
-    free ( self );
-}
-
-static
-rc_t checksum_prior_state ( checksum *self, size_t state_size )
-{
-    const KMDataNode *state;
-    rc_t rc = KMetadataOpenNodeRead ( self -> meta, & state, "%s/state", self -> node );
-    if ( rc == 0 )
-    {
-        size_t remaining;
-        rc = KMDataNodeRead ( state, 0, self -> u . buff, sizeof self -> u, & self -> valid, & remaining );
-        KMDataNodeRelease ( state );
-        if ( rc == 0 )
-        {
-            if ( remaining != 0 || self -> valid > state_size )
-                rc = RC ( rcXF, rcFunction, rcConstructing, rcData, rcExcessive );
-            else if ( self -> valid != 0 && self -> valid < state_size )
-                rc = RC ( rcXF, rcFunction, rcConstructing, rcData, rcInsufficient );
-        }
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = 0;
-    }
-
-    return rc;
-}
-
-static
-rc_t checksum_make ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, size_t state_size )
-{
-    rc_t rc;
-    checksum *self = malloc ( sizeof * self + cp -> argv [ 0 ] . count );
-    if ( self == NULL )
-        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = VTableOpenMetadataUpdate ( ( VTable* ) info -> tbl, & self -> meta );
-        if ( rc == 0 )
-        {
-            rc = KMetadataByteOrder ( self -> meta, & self -> byte_swap );
-            if ( rc == 0 )
-            {
-                string_copy ( self -> node, cp -> argv [ 0 ] . count + 1,
-                    cp -> argv [ 0 ] . data . ascii, cp -> argv [ 0 ] . count );
-
-                memset ( & self -> u, 0, sizeof self -> u );
-                rc = checksum_prior_state ( self, state_size );
-                if ( rc == 0 )
-                {
-                    rslt -> self = self;
-                    rslt -> whack = checksum_whack;
-                    rslt -> variant = vftNonDetRow;
-                    rslt -> u . rf = checksum_driver;
-
-                    return 0;
-                }
-            }
-
-            KMetadataRelease ( self -> meta );
-        }
-
-        free ( self );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * crc32 factory
- */
-static
-rc_t vdb_crc32_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . crc32 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_crc32swap;
-        self -> sum = vdb_crc32sum;
-        self -> digest = vdb_crc32digest;
-        if ( self -> valid == 0 ) {
-            self -> u . crc32 . crc = 0;
-            self -> u . crc32 . len = 0;
-            self -> valid = sizeof ( self -> u . crc32 );
-        }
-        else if ( self -> byte_swap )
-            vdb_crc32swap ( self );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * md5 factory
- */
-static
-rc_t vdb_md5sum_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . md5 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_md5swap;
-        self -> sum = vdb_md5sum;
-        self -> digest = vdb_md5digest;
-        if ( self -> valid == 0 ) {
-            MD5StateInit ( & self -> u . md5 );
-            self -> valid = sizeof ( self -> u . md5 );
-        }
-        else if ( self -> byte_swap )
-            vdb_md5swap ( self );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * sha factories
- */
-static
-rc_t vdb_sha1_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . sha1 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_sha32swap;
-        self -> sum = vdb_sha1sum;
-        self -> digest = vdb_sha1digest;
-        if ( self -> valid == 0 ) {
-            SHA1StateInit ( & self -> u . sha1 );
-            self -> valid = sizeof ( self -> u . sha1 );
-        }
-        else if ( self -> byte_swap )
-            vdb_sha32swap ( self );
-    }
-
-    return rc;
-}
-
-static
-rc_t vdb_sha256_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . sha256 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_sha32swap;
-        self -> sum = vdb_sha256sum;
-        self -> digest = vdb_sha256digest;
-        if ( self -> valid == 0 ) {
-            SHA256StateInit ( & self -> u . sha256 );
-            self -> valid = sizeof ( self -> u . sha256 );
-        }
-        else if ( self -> byte_swap )
-            vdb_sha32swap ( self );
-    }
-
-    return rc;
-}
-
-static
-rc_t vdb_sha384_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . sha384 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_sha64swap;
-        self -> sum = vdb_sha384sum;
-        self -> digest = vdb_sha384digest;
-        if ( self -> valid == 0 ) {
-            SHA384StateInit ( & self -> u . sha384 );
-            self -> valid = sizeof ( self -> u . sha384 );
-        }
-        else if ( self -> byte_swap )
-            vdb_sha64swap ( self );
-    }
-
-    return rc;
-}
-
-static
-rc_t vdb_sha512_fact ( const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    checksum *self;
-    rc_t rc = checksum_make ( info, rslt, cp, sizeof self -> u . sha512 );
-    if ( rc == 0 )
-    {
-        self = rslt -> self;
-        self -> swap = vdb_sha64swap;
-        self -> sum = vdb_sha512sum;
-        self -> digest = vdb_sha512digest;
-        if ( self -> valid == 0 ) {
-            SHA512StateInit ( & self -> u . sha512 );
-            self -> valid = sizeof ( self -> u . sha512 );
-        }
-        else if ( self -> byte_swap )
-            vdb_sha64swap ( self );
-    }
-
-    return rc;
-}
-
-
-/*--------------------------------------------------------------------------
- * checksum factory
- */
-VTRANSFACT_IMPL ( vdb_checksum, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* version 1.0 has 2 factory params... */
-    assert ( cp -> argc == 2 );
-    /* ...and 1 function param */
-    assert ( dp -> argc == 1 );
-
-    /* both factory params are of type ascii */
-    assert ( cp -> argv [ 0 ] . desc . domain == vtdAscii );
-    assert ( cp -> argv [ 1 ] . desc . domain == vtdAscii );
-    assert ( cp -> argv [ 0 ] . desc . intrinsic_bits == 8 );
-    assert ( cp -> argv [ 1 ] . desc . intrinsic_bits == 8 );
-    assert ( cp -> argv [ 0 ] . desc . intrinsic_dim == 1 );
-    assert ( cp -> argv [ 1 ] . desc . intrinsic_dim == 1 );
-
-    /* the input must be limited to bytes */
-    assert ( dp -> argc == 1 );
-    assert ( dp -> argv [ 0 ] . desc . intrinsic_bits == 8 );
-
-    /* look up algorithm */
-    switch ( cp -> argv [ 1 ] . count )
-    {
-    case 3:
-        if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 3, "md5", 3, 3 ) == 0 )
-            return vdb_md5sum_fact ( info, rslt, cp );
-        break;
-    case 4:
-        if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 4, "sha1", 4, 4 ) == 0 )
-            return vdb_sha1_fact ( info, rslt, cp );
-        break;
-    case 5:
-        if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 5, "crc32", 5, 5 ) == 0 )
-            return vdb_crc32_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 5, "sha-1", 5, 5 ) == 0 )
-            return vdb_sha1_fact ( info, rslt, cp );
-        break;
-    case 6:
-        if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 6, "crc-32", 6, 6 ) == 0 )
-            return vdb_crc32_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 6, "sha256", 6, 6 ) == 0 )
-            return vdb_sha256_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 6, "sha384", 6, 6 ) == 0 )
-            return vdb_sha384_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 6, "sha512", 6, 6 ) == 0 )
-            return vdb_sha512_fact ( info, rslt, cp );
-        break;
-    case 7:
-        if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 7, "sha-256", 7, 7 ) == 0 )
-            return vdb_sha256_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 7, "sha-384", 7, 7 ) == 0 )
-            return vdb_sha384_fact ( info, rslt, cp );
-        else if ( strcase_cmp ( cp -> argv [ 1 ] . data . ascii, 7, "sha-512", 7, 7 ) == 0 )
-            return vdb_sha512_fact ( info, rslt, cp );
-        break;
-    }
-
-    /* failed to resolve algorithm */
-    return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-}
diff --git a/libs/vxf/clip.c b/libs/vxf/clip.c
deleted file mode 100644
index e8047c2..0000000
--- a/libs/vxf/clip.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef struct {
-    union {
-        /* integer */
-        int8_t i8[2];
-        int16_t i16[2];
-        int32_t i32[2];
-        int64_t i64[2];
-    
-        /* unsigned integer */
-        uint8_t u8[2];
-        uint16_t u16[2];
-        uint32_t u32[2];
-        uint64_t u64[2];
-    
-        /* floating point */
-        float f32[2];
-        double f64[2];
-    } u;
-    uint32_t dim;
-} self_t;
-
-#define CLIP_FUNC(FUNC, TYPE, VAL) \
-static rc_t CC FUNC(void *Self, const VXformInfo *info, void *Dst, const void *Src, uint64_t n) { \
-    const self_t *self = Self; \
-    TYPE lower = self->u.VAL[0]; \
-    TYPE upper = self->u.VAL[1]; \
-    TYPE *dst = Dst; \
-    const TYPE *src = Src; \
-    size_t i; \
-\
-    for (i = 0, n *= self->dim; i != n; ++i) { \
-        TYPE val = src[i]; \
-\
-        if (val < lower) \
-            val = lower; \
-        else if (val > upper) \
-            val = upper; \
-\
-        dst[i] = val; \
-    } \
-    return 0; \
-}
-
-CLIP_FUNC(clip_U8, uint8_t, u8)
-CLIP_FUNC(clip_I8, int8_t, i8)
-CLIP_FUNC(clip_U16, uint16_t, u16)
-CLIP_FUNC(clip_I16, int16_t, i16)
-CLIP_FUNC(clip_U32, uint32_t, u32)
-CLIP_FUNC(clip_I32, int32_t, i32)
-CLIP_FUNC(clip_U64, uint64_t, u64)
-CLIP_FUNC(clip_I64, int64_t, i64)
-CLIP_FUNC(clip_F32, float, f32)
-CLIP_FUNC(clip_F64, double, f64)
-
-static
-void CC vxf_free_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* clip
- function < type T > T clip #1.0 < T lower, T upper > ( T in ) = vdb:clip;
- function < type T, U32 dim > T [ dim ] vclip #1.0 < T lower, T upper > ( T [ dim ] in ) = vdb:clip;
- */
-VTRANSFACT_IMPL(vdb_clip, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-
-    /* check types */
-    switch (info->fdesc.desc.domain) {
-        case vtdInt:
-        case vtdUint:
-        case vtdFloat:
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcType, rcInvalid);
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self == NULL)
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    
-    rslt->self = self;
-    rslt->whack = vxf_free_wrapper;
-    rslt->variant = vftArray;
-
-    self->dim = info->fdesc.fd.td.dim;
-    
-    switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 8:
-                    rslt->u.af = clip_I8;
-                    self->u.i8[0] = *cp->argv[0].data.i8;
-                    self->u.i8[1] = *cp->argv[1].data.i8;
-                    break;
-                case 16:
-                    rslt->u.af = clip_I16;
-                    self->u.i16[0] = *cp->argv[0].data.i16;
-                    self->u.i16[1] = *cp->argv[1].data.i16;
-                    break;
-                case 32:
-                    rslt->u.af = clip_I32;
-                    self->u.i32[0] = *cp->argv[0].data.i32;
-                    self->u.i32[1] = *cp->argv[1].data.i32;
-                    break;
-                case 64:
-                    rslt->u.af = clip_I64;
-                    self->u.i64[0] = *cp->argv[0].data.i64;
-                    self->u.i64[1] = *cp->argv[1].data.i64;
-                    break;
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 8:
-                    rslt->u.af = clip_U8;
-                    self->u.u8[0] = *cp->argv[0].data.u8;
-                    self->u.u8[1] = *cp->argv[1].data.u8;
-                    break;
-                case 16:
-                    rslt->u.af = clip_U16;
-                    self->u.u16[0] = *cp->argv[0].data.u16;
-                    self->u.u16[1] = *cp->argv[1].data.u16;
-                    break;
-                case 32:
-                    rslt->u.af = clip_U32;
-                    self->u.u32[0] = *cp->argv[0].data.u32;
-                    self->u.u32[1] = *cp->argv[1].data.u32;
-                    break;
-                case 64:
-                    rslt->u.af = clip_U64;
-                    self->u.u64[0] = *cp->argv[0].data.u64;
-                    self->u.u64[1] = *cp->argv[1].data.u64;
-                    break;
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-                case 32:
-                    rslt->u.af = clip_F32;
-                    self->u.f32[0] = *cp->argv[0].data.f32;
-                    self->u.f32[1] = *cp->argv[1].data.f32;
-                    break;
-                case 64:
-                    rslt->u.af = clip_F64;
-                    self->u.f64[0] = *cp->argv[0].data.f64;
-                    self->u.f64[1] = *cp->argv[1].data.f64;
-                    break;
-            }
-            break;
-    }
-	return rc;
-}
diff --git a/libs/vxf/cut.c b/libs/vxf/cut.c
deleted file mode 100644
index e732659..0000000
--- a/libs/vxf/cut.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-typedef struct self_t {
-    void (*f)(const struct self_t *, void *, const void *, size_t);
-    uint32_t type_size;
-    uint32_t dim;
-    uint32_t n;
-    uint32_t idx[7];
-} self_t;
-
-static
-void cut8(const struct self_t *self, void *Dst, const void *Src, size_t elem_count) {
-    uint8_t *dst = Dst;
-    const uint8_t *src = Src;
-    int i;
-    int j;
-    int doff;
-    int soff;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += self->n, soff += self->dim) {
-        for (j = 0; j != self->n; ++j) {
-            dst[doff + j] = src[soff + self->idx[j]];
-        }
-    }
-}
-
-static
-void cut16(const struct self_t *self, void *Dst, const void *Src, size_t elem_count) {
-    uint16_t *dst = Dst;
-    const uint16_t *src = Src;
-    int i;
-    int j;
-    int doff;
-    int soff;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += self->n, soff += self->dim) {
-        for (j = 0; j != self->n; ++j) {
-            dst[doff + j] = src[soff + self->idx[j]];
-        }
-    }
-}
-
-static
-void cut32(const struct self_t *self, void *Dst, const void *Src, size_t elem_count) {
-    uint32_t *dst = Dst;
-    const uint32_t *src = Src;
-    int i;
-    int j;
-    int doff;
-    int soff;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += self->n, soff += self->dim) {
-        for (j = 0; j != self->n; ++j) {
-            dst[doff + j] = src[soff + self->idx[j]];
-        }
-    }
-}
-
-static
-void cut64(const struct self_t *self, void *Dst, const void *Src, size_t elem_count) {
-    uint64_t *dst = Dst;
-    const uint64_t *src = Src;
-    int i;
-    int j;
-    int doff;
-    int soff;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += self->n, soff += self->dim) {
-        for (j = 0; j != self->n; ++j) {
-            dst[doff + j] = src[soff + self->idx[j]];
-        }
-    }
-}
-
-static
-void cut_bytes(const struct self_t *self, void *Dst, const void *Src, size_t elem_count) {
-    uint8_t *dst = Dst;
-    const uint8_t *src = Src;
-    int i;
-    int j;
-    int doff;
-    int soff;
-    const int sz = self->type_size >> 3;
-    const int di = sz * self->n;
-    const int si = sz * self->dim;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += di, soff += si) {
-        for (j = 0; j != self->n; ++j) {
-            memcpy(dst + doff + j * sz, src + soff + self->idx[j] * sz, sz);
-        }
-    }
-}
-
-static
-void cut_bits(const struct self_t *self, void *dst, const void *src, size_t elem_count) {
-    int i;
-    int j;
-    int doff;
-    int soff;
-    const int sz = self->type_size;
-    const int di = sz * self->n;
-    const int si = sz * self->dim;
-    
-    for (doff = soff = i = 0; i != elem_count; ++i, doff += di, soff += si) {
-        for (j = 0; j != self->n; ++j) {
-            bitcpy(dst, doff + j * sz, src, soff + self->idx[j] * sz, sz);
-        }
-    }
-}
-
-static
-rc_t CC cut_driver (
-                    void *Self,
-                    const VXformInfo *info,
-                    void *dst,
-                    const void *src,
-                    uint64_t elem_count
-                    )
-{
-    const self_t *self = Self;
-    
-    self->f( self, dst, src, elem_count );
-    return 0;
-}
-
-static
-void CC vxf_cut_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* cut
- * function < type T >
- * T [ * ] cut #1.0 < U32 idx, ... > ( T [ * ] in );
- */
-VTRANSFACT_IMPL(vdb_cut, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    uint32_t dim = cp->argc;
-    int i;
-    self_t *ctx;
-    
-    assert(dim != 0);
-    for (i = 0; i != dim; ++i) {
-        if (*(cp->argv[i].data.u32) >= dp->argv[0].fd.td.dim)
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-    
-    ctx = malloc ( sizeof * ctx - sizeof ctx -> idx + dim * sizeof ctx -> idx [ 0 ] );
-    if (ctx == NULL)
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-
-    ctx->type_size = VTypedescSizeof ( & info -> fdesc . desc ) / dim;
-    ctx->dim = VTypedescSizeof ( & dp->argv[0].desc ) / ctx->type_size;
-    ctx->n = dim;
-
-    for (i = 0; i != dim; ++i)
-    {
-        ctx->idx[i] = cp->argv[i].data.u32[0];
-        if ( ctx->idx[i] >= ctx->dim )
-        {
-            free ( ctx );
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-    }
-    
-    rslt->self = ctx;
-    rslt->whack = vxf_cut_wrapper;
-    rslt->variant = vftArray;
-    rslt->u.af = cut_driver;
-    
-    switch (ctx->type_size) {
-        case 8:
-            ctx->f = cut8;
-            break;
-        case 16:
-            ctx->f = cut16;
-            break;
-        case 32:
-            ctx->f = cut32;
-            break;
-        case 64:
-            ctx->f = cut64;
-            break;
-        default:
-            ctx->f = (ctx->type_size & 7) == 0 ? cut_bytes : cut_bits;
-            break;
-    }
-    
-	return 0;
-}
diff --git a/libs/vxf/delta.c b/libs/vxf/delta.c
deleted file mode 100644
index fc3136b..0000000
--- a/libs/vxf/delta.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-#define DELTA_NAME( T )  delta_ ## T
-#define DELTA( T )                                                       \
-static                                                                   \
-rc_t CC DELTA_NAME ( T ) ( void *data,                                   \
-    const VXformInfo *info,  void *rslt, const void *input,              \
-    uint64_t elem_count)                                                 \
-{                                                                        \
-    uint32_t i;                                                          \
-    T *dst       = (T*) rslt;                                            \
-    const T *src = (const T*) input;                                     \
-    if(elem_count >0) {							 \
-        dst [ 0 ] = src [ 0 ];						 \
-	for ( i = 1; i < elem_count; ++ i ) {                            \
-	    dst [ i ] = src [ i ] - src [ i - 1 ];                       \
-	}                                                                \
-    }									 \
-    return 0;                                                            \
-}
-
-DELTA ( int8_t )
-DELTA ( int16_t )
-DELTA ( int32_t )
-DELTA ( int64_t )
-
-static VArrayFunc delta_func [] =
-{
-    DELTA_NAME ( int8_t  ),
-    DELTA_NAME ( int16_t ),
-    DELTA_NAME ( int32_t ),
-    DELTA_NAME ( int64_t )
-};
-/* delta
- *  return the 1 derivative of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of  signed integers
- *
- *  "a" [ DATA ] - operand
- *
- *
- * SYNOPSIS:
- *  return 1st derivative for the whole blob with 1st element unmodified
- *
- * USAGE:
- *    I32 A = < I32 > delta ( B );
- */
-VTRANSFACT_IMPL ( vdb_delta, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int size_idx;
-    if ( info -> fdesc . desc . domain != vtdInt)
-    {
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector derivatives
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    rslt -> u . af = delta_func [ size_idx ];
-    rslt -> variant = vftArray;
-
-    return 0;
-}
diff --git a/libs/vxf/deriv.c b/libs/vxf/deriv.c
deleted file mode 100644
index 564e66a..0000000
--- a/libs/vxf/deriv.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-#define DERIV_NAME( T )  deriv_ ## T
-#define DERIV( T )                                                       \
-static                                                                   \
-rc_t CC DERIV_NAME ( T ) ( void *data,                                      \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-                                                                         \
-    T *dst       = rslt -> base;                                         \
-    const T *src = argv [ 0 ] . u . data . base;                         \
-    if(rslt -> elem_count == 0) return 0;				 \
-    dst += rslt -> first_elem;						 \
-    src += argv [ 0 ] . u . data . first_elem;				 \
-    dst [ 0 ] = src [ 0 ];						 \
-                                                                         \
-    for ( i = 1; i < rslt -> elem_count; ++ i ) {                        \
-        dst [ i ] = src [ i ] - src [ i - 1 ];                           \
-    }                                                                    \
-    return 0;                                                            \
-}
-
-DERIV ( int8_t )
-DERIV ( int16_t )
-DERIV ( int32_t )
-DERIV ( int64_t )
-
-static VFixedRowFunc deriv_func [] =
-{
-    DERIV_NAME ( int8_t  ),
-    DERIV_NAME ( int16_t ),
-    DERIV_NAME ( int32_t ),
-    DERIV_NAME ( int64_t )
-};
-/* deriv
- *  return the 1 derivative of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of  signed integers
- *
- *  "a" [ DATA ] - operand
- *
- *
- * SYNOPSIS:
- *  return 1st derivative for every row with 1st element unmodified
- *
- * USAGE:
- *    I32 pos_1st_d = < I32 > deriv ( position );
- */
-VTRANSFACT_IMPL ( vdb_deriv, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int size_idx;
-    if ( info -> fdesc . desc . domain != vtdInt)
-    {
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector derivatives
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    rslt -> u . pf = deriv_func [ size_idx ];
-    rslt -> variant = vftFixedRow;
-
-    return 0;
-}
diff --git a/libs/vxf/diff.c b/libs/vxf/diff.c
deleted file mode 100644
index d7062d4..0000000
--- a/libs/vxf/diff.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-/* optional constant */
-typedef union diff_data diff_data;
-union diff_data
-{
-    int8_t i8;
-    int16_t i16;
-    int32_t i32;
-    int64_t i64;
-
-    uint8_t u8;
-    uint16_t u16;
-    uint32_t u32;
-    uint64_t u64;
-
-    float f32;
-    double f64;
-};
-
-#define FULL_DIFF_NAME( T )                                              \
-    full_diff_ ## T
-#define FULL_DIFF( T, k )                                                \
-static                                                                   \
-rc_t CC FULL_DIFF_NAME ( T ) ( void *data,                                  \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-    const diff_data *self = ( const void* ) data;                        \
-                                                                         \
-    T *dst = rslt -> base;                                               \
-    const T *a = argv [ 0 ] . u . data . base;                           \
-    const T *b = argv [ 1 ] . u . data . base;                           \
-                                                                         \
-    for ( i = 0, dst += rslt -> first_elem,                              \
-              a += argv [ 0 ] . u . data . first_elem,                   \
-              b += argv [ 1 ] . u . data . first_elem;                   \
-          i < rslt -> elem_count; ++ i )                                 \
-    {                                                                    \
-        dst [ i ] = a [ i ] - b [ i ] - self -> k;                       \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-FULL_DIFF ( int8_t, i8 )
-FULL_DIFF ( int16_t, i16 )
-FULL_DIFF ( int32_t, i32 )
-FULL_DIFF ( int64_t, i64 )
-FULL_DIFF ( uint8_t, u8 )
-FULL_DIFF ( uint16_t, u16 )
-FULL_DIFF ( uint32_t, u32 )
-FULL_DIFF ( uint64_t, u64 )
-FULL_DIFF ( float, f32 )
-FULL_DIFF ( double, f64 )
-
-static VFixedRowFunc full_diff_func [] =
-{
-    FULL_DIFF_NAME ( uint8_t ),
-    FULL_DIFF_NAME ( uint16_t ),
-    FULL_DIFF_NAME ( uint32_t ),
-    FULL_DIFF_NAME ( uint64_t ),
-    FULL_DIFF_NAME ( int8_t ),
-    FULL_DIFF_NAME ( int16_t ),
-    FULL_DIFF_NAME ( int32_t ),
-    FULL_DIFF_NAME ( int64_t ),
-    NULL,
-    NULL,
-    FULL_DIFF_NAME ( float ),
-    FULL_DIFF_NAME ( double )
-};
-
-#define CONST_DIFF_NAME( T )                                             \
-    const_diff_ ## T
-#define CONST_DIFF( T, k )                                               \
-static                                                                   \
-rc_t CC CONST_DIFF_NAME ( T ) ( void *data, const VXformInfo *info,         \
-    void *rslt, const void *src, uint64_t elem_count )                   \
-{                                                                        \
-    uint32_t i;                                                          \
-    const diff_data *self = ( const void* ) data;                        \
-                                                                         \
-    T *dst = rslt;                                                       \
-    const T *a = src;                                                    \
-                                                                         \
-    for ( i = 0; i < elem_count; ++ i )                                 \
-    {                                                                    \
-        dst [ i ] = a [ i ] - self -> k;                                 \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-CONST_DIFF ( int8_t, i8 )
-CONST_DIFF ( int16_t, i16 )
-CONST_DIFF ( int32_t, i32 )
-CONST_DIFF ( int64_t, i64 )
-CONST_DIFF ( uint8_t, u8 )
-CONST_DIFF ( uint16_t, u16 )
-CONST_DIFF ( uint32_t, u32 )
-CONST_DIFF ( uint64_t, u64 )
-CONST_DIFF ( float, f32 )
-CONST_DIFF ( double, f64 )
-
-static VArrayFunc const_diff_func [] =
-{
-    CONST_DIFF_NAME ( uint8_t ),
-    CONST_DIFF_NAME ( uint16_t ),
-    CONST_DIFF_NAME ( uint32_t ),
-    CONST_DIFF_NAME ( uint64_t ),
-    CONST_DIFF_NAME ( int8_t ),
-    CONST_DIFF_NAME ( int16_t ),
-    CONST_DIFF_NAME ( int32_t ),
-    CONST_DIFF_NAME ( int64_t ),
-    NULL,
-    NULL,
-    CONST_DIFF_NAME ( float ),
-    CONST_DIFF_NAME ( double )
-};
-
-#define NO_CONST_NAME( T )                                               \
-    no_const_ ## T
-#define NO_CONST( T )                                                    \
-static                                                                   \
-rc_t CC NO_CONST_NAME ( T ) ( void *data,                                   \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-                                                                         \
-    T *dst = rslt -> base;                                               \
-    const T *a = argv [ 0 ] . u . data . base;                           \
-    const T *b = argv [ 1 ] . u . data . base;                           \
-                                                                         \
-    for ( i = 0, dst += rslt -> first_elem,                              \
-              a += argv [ 0 ] . u . data . first_elem,                   \
-              b += argv [ 1 ] . u . data . first_elem;                   \
-          i < rslt -> elem_count; ++ i )                                 \
-    {                                                                    \
-        dst [ i ] = a [ i ] - b [ i ];                                   \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-NO_CONST ( int8_t )
-NO_CONST ( int16_t )
-NO_CONST ( int32_t )
-NO_CONST ( int64_t )
-NO_CONST ( uint8_t )
-NO_CONST ( uint16_t )
-NO_CONST ( uint32_t )
-NO_CONST ( uint64_t )
-NO_CONST ( float )
-NO_CONST ( double )
-
-static VFixedRowFunc no_const_func [] =
-{
-    NO_CONST_NAME ( uint8_t ),
-    NO_CONST_NAME ( uint16_t ),
-    NO_CONST_NAME ( uint32_t ),
-    NO_CONST_NAME ( uint64_t ),
-    NO_CONST_NAME ( int8_t ),
-    NO_CONST_NAME ( int16_t ),
-    NO_CONST_NAME ( int32_t ),
-    NO_CONST_NAME ( int64_t ),
-    NULL,
-    NULL,
-    NO_CONST_NAME ( float ),
-    NO_CONST_NAME ( double )
-};
-
-static
-rc_t CC no_diff ( void *data, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count )
-{
-    memcpy ( dst, src, (size_t)elem_count * VTypedescSizeof ( & info -> fdesc . desc ) >> 3 );
-    return 0;
-}
-
-static
-void CC vxf_diff_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* diff
- *  return the difference of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of numeric_set
- *
- *  "k" [ CONST, DEFAULT 0 ] - optional constant
- *  to be added or subtracted
- *
- *  "a" [ DATA ] - left-most operand
- *
- *  "b" [ DATA ] - optional subtractand
- *
- * SYNOPSIS:
- *  incorporates "k" into expression for every row
- *  returns sum or difference of inputs for all rows
- *
- * USAGE:
- *  length of half-closed interval
- *    U32 len = < U32 > diff ( stop, start );
- *  length of fully-closed interval
- *    U32 len = < U32 > diff < -1 > ( stop, start );
- */
-VTRANSFACT_IMPL ( vdb_diff, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    bool has_const;
-    int32_t size_idx;
-    diff_data k;
-
-    /* "T" must be member of numeric_set */
-    switch ( info -> fdesc . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-    case vtdFloat:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector differences
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    /* there are 4 variants:
-       1. no constant ( or is 0 ) and single input
-       2. non-zero constant and single input
-       3. no constant ( or is 0 ) and dual input
-       4. non-zero constant and dual input */
-    has_const = false;
-    if ( cp -> argc == 1 ) switch ( cp -> argv [ 0 ] . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-        switch ( cp -> argv [ 0 ] . desc . intrinsic_bits )
-        {
-        case 8:
-            if ( ( k . u8 = cp -> argv [ 0 ] . data . u8 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 16:
-            if ( ( k . u16 = cp -> argv [ 0 ] . data . u16 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 32:
-            if ( ( k . u32 = cp -> argv [ 0 ] . data . u32 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 64:
-            if ( ( k . u64 = cp -> argv [ 0 ] . data . u64 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        }
-        break;
-
-    case vtdFloat:
-        switch ( cp -> argv [ 0 ] . desc . intrinsic_bits )
-        {
-        case 32:
-            if ( ( k . f32 = cp -> argv [ 0 ] . data . f32 [ 0 ] ) != 0.0 )
-                has_const = true;
-            break;
-        case 64:
-            if ( ( k . f64 = cp -> argv [ 0 ] . data . f64 [ 0 ] ) != 0.0 )
-                has_const = true;
-            break;
-        }
-        break;
-    }
-
-    if ( has_const )
-    {
-        diff_data *pb = malloc ( sizeof * pb );
-        if ( pb == NULL )
-            return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-        * pb = k;
-
-        rslt -> self = pb;
-        rslt -> whack = vxf_diff_wrapper;
-
-        if ( dp -> argc > 1 )
-        {
-            rslt -> u . pf = full_diff_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftFixedRow;
-        }
-        else
-        {
-            rslt -> u . af = const_diff_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftArray;
-        }
-    }
-    else
-    {
-        if ( dp -> argc > 1 )
-        {
-            rslt -> u . pf = no_const_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftFixedRow;
-        }
-        else
-        {
-            rslt -> u . af = no_diff;
-            rslt -> variant = vftArray;
-        }
-    }
-
-    return 0;
-}
diff --git a/libs/vxf/echo.c b/libs/vxf/echo.c
deleted file mode 100644
index c8a8938..0000000
--- a/libs/vxf/echo.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-struct self_t {
-    KDataBuffer val;
-    bitsz_t csize;
-    bitsz_t dsize;
-    int count;
-};
-
-static void CC self_free( void *Self ) {
-    struct self_t *self = Self;
-    
-    KDataBufferWhack(&self->val);
-    free(self);
-}
-
-static void fill(struct self_t *self, int start) {
-    int i;
-    
-    for (i = start; i != self->count; ++i)
-        bitcpy(self->val.base, i * self->csize, self->val.base, 0, self->csize);
-}
-
-static rc_t grow_and_fill(struct self_t *self, uint32_t rlen) {
-    bitsz_t rsize = rlen * self->dsize;
-    rc_t rc;
-    
-    if (self->count * self->csize <= rsize) {
-        int old_count = self->count;
-        int new_count = old_count;
-        
-        while (new_count * self->csize <= rsize)
-            new_count <<= 1;
-        
-        rc = KDataBufferResize(&self->val, new_count);
-        if (rc)
-            return rc;
-        
-        self->count = new_count;
-        fill(self, old_count);
-    }
-    return 0;
-}
-
-/* echo
- function < type T > T echo #1.0 < T val > ( any row_len );
- */
-static
-rc_t CC echo_func_1(
-                 void *Self,
-                 const VXformInfo *info,
-                 int64_t row_id,
-                 VRowResult *rslt,
-                 uint32_t argc,
-                 const VRowData argv[]
-) {
-    struct self_t *self = Self;
-    rc_t rc;
-
-    assert(argv[0].u.data.elem_count >> 32 == 0);
-    rc = grow_and_fill(self, (uint32_t)argv[0].u.data.elem_count);
-    if (rc == 0) {
-        KDataBufferWhack(rslt->data);
-        rslt->elem_count = argv[0].u.data.elem_count;
-        rc = KDataBufferSub(&self->val, rslt->data, 0, rslt->elem_count);
-    }
-    return rc;
-}
-
-/* echo
- function < type T > T echo #1.0 < T val > ();
- */
-static
-rc_t CC echo_func_0(
-                 void *Self,
-                 const VXformInfo *info,
-                 int64_t row_id,
-                 VRowResult *rslt,
-                 uint32_t argc,
-                 const VRowData argv[]
-) {
-    struct self_t *self = Self;
-
-    KDataBufferWhack(rslt->data);
-    rslt->elem_count = (uint32_t)( self->csize / self->dsize );
-    return KDataBufferSub(&self->val, rslt->data, 0, rslt->elem_count);
-}
-
-rc_t echo_row_0 ( const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc;
-    struct self_t *self = malloc ( sizeof *self );
-    if ( self == NULL )
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-
-    self->dsize = VTypedescSizeof ( & cp->argv[0].desc );
-    self->csize = self->dsize * cp->argv[0].count;
-    self->count = 1;
-
-    rc = KDataBufferMake(&self->val, self->dsize, cp->argv[0].count);
-    if (rc == 0) {
-        bitcpy(self->val.base, 0, cp->argv[0].data.u8, 0, self->csize);
-    
-        rslt->self = self;
-        rslt->whack = self_free;
-        rslt->variant = vftRow;
-        rslt->u.rf = echo_func_0;
-        return 0;
-    }
-    free(self);
-    return rc;
-}
-
-static
-rc_t echo_row_1 ( const VXfactInfo *info, VFuncDesc *rslt,
-    const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    struct self_t *self = malloc ( sizeof *self );
-    if ( self == NULL )
-        return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    self->dsize = VTypedescSizeof ( & cp->argv[0].desc );
-    self->csize = self->dsize * cp->argv[0].count;
-    self->count = 256;
-
-    rc = KDataBufferMake(&self->val, self->dsize, cp->argv[0].count*self->count);
-    if (rc == 0)
-    {
-        bitcpy(self->val.base, 0, cp->argv[0].data.u8, 0, self->csize);
-        fill(self, 1);
-
-        rslt->self = self;
-        rslt->whack = self_free;
-        rslt->variant = vftRow;
-        rslt->u.rf = echo_func_1;
-        return 0;
-    }
-    free(self);
-    return rc;
-}
-
-VTRANSFACT_IMPL ( vdb_echo, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    if ( dp -> argc == 0 )
-        return echo_row_0 ( info, rslt, cp );
-    return echo_row_1 ( info, rslt, cp, dp );
-}
diff --git a/libs/vxf/exists.c b/libs/vxf/exists.c
deleted file mode 100644
index b0b6b6c..0000000
--- a/libs/vxf/exists.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include <bitstr.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-
-struct self_t {
-    KDataBuffer val;
-    bitsz_t csize;
-    bitsz_t dsize;
-    int count;
-};
-
-static void CC self_free( void *Self ) {
-    struct self_t *self = Self;
-    
-    KDataBufferWhack(&self->val);
-    free(self);
-}
-
-static void fill(struct self_t *self, int start) {
-    int i;
-    
-    for (i = start; i != self->count; ++i)
-        bitcpy(self->val.base, 0, self->val.base, i * self->csize, self->csize);
-}
-
-static rc_t grow_and_fill(struct self_t *self, int rlen) {
-    bitsz_t rsize = rlen * self->dsize;
-    rc_t rc;
-    
-    if (self->count * self->csize <= rsize) {
-        int old_count = self->count;
-        int new_count = old_count;
-        
-        while (new_count * self->csize <= rsize)
-            new_count <<= 1;
-        
-        rc = KDataBufferResize(&self->val, new_count);
-        if (rc)
-            return rc;
-        
-        self->count = new_count;
-        fill(self, old_count);
-    }
-    return 0;
-}
-
-/* exists
- function < type T > T exits #1.0 < T val > ( any predicate, any row_len );
- */
-static
-rc_t CC exists_func_1(
-                 void *Self,
-                 const VXformInfo *info,
-                 int64_t row_id,
-                 VRowResult *rslt,
-                 uint32_t argc,
-                 const VRowData argv[]
-) {
-    struct self_t *self = Self;
-    rc_t rc = grow_and_fill(self, argv[1].u.data.elem_count);
-    
-    if (rc == 0) {
-        KDataBufferWhack(rslt->data);
-        rslt->elem_count = argv[1].u.data.elem_count;
-        rc = KDataBufferSub(&self->val, rslt->data, 0, rslt->elem_count);
-    }
-    return rc;
-}
-
-/* exists
- function < type T > T exists #1.0 < T val > ( any predicate );
- */
-static
-rc_t CC exists_func_0(
-                 void *Self,
-                 const VXformInfo *info,
-                 int64_t row_id,
-                 VRowResult *rslt,
-                 uint32_t argc,
-                 const VRowData argv[]
-) {
-    struct self_t *self = Self;
-
-    KDataBufferWhack(rslt->data);
-    rslt->elem_count = (uint32_t)( self->csize / self->dsize );
-    return KDataBufferSub(&self->val, rslt->data, 0, rslt->elem_count);
-}
-
-rc_t exists_row_0 ( const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc;
-    struct self_t *self = malloc ( sizeof *self );
-    if ( self == NULL )
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-
-    self->dsize = VTypedescSizeof ( & cp->argv[0].desc );
-    self->csize = self->dsize * cp->argv[0].count;
-    self->count = 1;
-
-    rc = KDataBufferMake(&self->val, self->dsize, cp->argv[0].count);
-    if (rc == 0) {
-        bitcpy(self->val.base, 0, cp->argv[0].data.u8, 0, self->csize);
-    
-        rslt->self = self;
-        rslt->whack = self_free;
-        rslt->variant = vftRow;
-        rslt->u.rf = exists_func_0;
-        return 0;
-    }
-    free(self);
-    return rc;
-}
-
-static
-rc_t exists_row_1 ( const VXfactInfo *info, VFuncDesc *rslt,
-    const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    struct self_t *self = malloc ( sizeof *self );
-    if ( self == NULL )
-        return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    self->dsize = VTypedescSizeof ( & cp->argv[0].desc );
-    self->csize = self->dsize * cp->argv[0].count;
-    self->count = 256;
-
-    rc = KDataBufferMake(&self->val, self->dsize, cp->argv[0].count*self->count);
-    if (rc == 0)
-    {
-        bitcpy(self->val.base, 0, cp->argv[0].data.u8, 0, self->csize);
-        fill(self, 1);
-
-        rslt->self = self;
-        rslt->whack = self_free;
-        rslt->variant = vftRow;
-        rslt->u.rf = exists_func_1;
-        return 0;
-    }
-    free(self);
-    return rc;
-}
-
-/* exists
- *  returns constant or dynamic value if predicate input exists
- *
- *  "T" [ TYPE ] - type of data to return
- *
- *  "cval" [ CONST, OPTIONAL ] - a data constant. when present,
- *  the function will behave like "echo" ( see below )
- *
- *  "predicate" [ DATA ] - an input whose existence determines
- *  whether the function will operate or not.
- *
- *  "dval" [ DATA, OPTIONAL ] - data value, either passed through
- *  or used to determine a repeat count of "cval" ( see below )
- *
- * USAGE:
- *  when "cval" is omitted, "dval" must be present and will be
- *  passed through depending upon the existence of "predicate"
- *    U8 count = < U8 > exists ( col, count2 );
- *
- *  when "cval" is present, "dval" may be omitted, and "cval" will
- *  be passed through just like echo depending upon "predicate"
- *   U8 count = < U8 > exists < 2 > ( col2 ) | < U8 > echo < 1 > ();
- *
- *  when "cval" and "dval" are both present, the behavior is
- *  like echo, but gated with "predicate"
- *    ascii poly = < ascii > exists < 'a' > ( col, repeat );
- *
-function < type T > T exists #1.0 < * T cval > ( any predicate, * T dval ) = vdb:exists;
-*/
-VTRANSFACT_IMPL ( vdb_exists, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    if ( dp -> argc == 1 )
-        return exists_row_0 ( info, rslt, cp );
-    return exists_row_1 ( info, rslt, cp, dp );
-}
diff --git a/libs/vxf/extract_token.c b/libs/vxf/extract_token.c
deleted file mode 100644
index 98d8e28..0000000
--- a/libs/vxf/extract_token.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <assert.h>
-
-
-typedef uint16_t text_token;
-enum { tt_id, tt_start, tt_len };
-
-
-/* extract_token
- *  extract a textual token from an input string
- *
- *  "idx" [ CONST ] - a zero-based index of the token
- *  if value < row_len ( tok ), then the substring of
- *  indexed token is returned. otherwise, returns empty.
- *
- *  "str" [ DATA ] - input text. type must be compatible with
- *  output production, meaning types must be same, or ascii input
- *  with utf8 output.
- *
- *  "tok" [ DATA ] - results of tokenizing "str"
- */
-static
-rc_t CC extract_token ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    KDataBuffer *dst = rslt -> data;
-    uint32_t idx = ( uint32_t ) ( size_t ) data;
-
-    rslt -> elem_count = 0;
-    if ( ( uint64_t ) idx >= argv [ 1 ] . u . data . elem_count )
-    {
-        /* issue empty string */
-        rc = KDataBufferResize ( dst, 0 );
-    }
-    else
-    {
-        size_t sub_bytes, elem_bytes = ( size_t ) ( argv [ 0 ] . u . data . elem_bits >> 3 );
-        const char *str = argv [ 0 ] . u . data . base;
-        const text_token *tok = argv [ 1 ] . u . data . base;
-
-        str += argv [ 0 ] . u . data . first_elem * elem_bytes;
-        tok += ( argv [ 1 ] . u . data . first_elem + idx ) * 3;
-        sub_bytes = elem_bytes * tok [ tt_len ];
-
-        /* set output buffer size */
-        KDataBufferCast ( dst, dst, rslt -> elem_bits, true );
-        rc = KDataBufferResize ( dst, tok [ tt_len ] );
-        if ( rc == 0 )
-        {
-            /* copy substring */
-            rslt -> elem_count = tok [ tt_len ];
-            memcpy ( dst -> base, & str [ elem_bytes * tok [ tt_start ] ], sub_bytes );
-        }
-    }
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( vdb_extract_token, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* ensure that the type of input is either identical to
-       or compatible with the output */
-    if ( ! VTypedeclToTypedecl ( & dp -> argv [ 0 ] . fd . td, info -> schema, & info -> fdesc . fd . td, NULL, NULL ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcInconsistent );
-
-    rslt -> self = ( void* ) ( size_t ) cp -> argv [ 0 ] . data . u32 [ 0 ];
-    rslt -> variant = vftRow;
-    rslt -> u . rf = extract_token;
-    return 0;
-}
diff --git a/libs/vxf/floor.c b/libs/vxf/floor.c
deleted file mode 100644
index 2fe5aff..0000000
--- a/libs/vxf/floor.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-#include <assert.h>
-
-#define FLOAT_FUNC floorf
-#define DOUBLE_FUNC floor
-#include "math-funcs-impl.h"
-
-/*
- function < type T >
- T vdb:floor #1.0 ( T in );
- */
-VTRANSFACT_IMPL(vdb_floor, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp ) {
-    return factory(self, info, rslt, cp, dp);
-}
diff --git a/libs/vxf/fsplit-join.impl.h b/libs/vxf/fsplit-join.impl.h
deleted file mode 100644
index 1688723..0000000
--- a/libs/vxf/fsplit-join.impl.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <stdint.h>
-#include <float.h>
-#include <math.h>
-
-#if ENCODING
-static unsigned split_and_pack_f32(const float src[], uint32_t n, unsigned m, uint8_t *pexp) {
-    const uint32_t mask = ~(0x007FFFFF >> (m - 1));
-    uint32_t i; /* src & exponent index */
-    uint32_t j; /* mantissa byte offset */
-    uint32_t breg = 0;
-    int inreg = 0;
-    uint8_t *pman = pexp + n;
-    
-    for (i = 0, j = 0; i != n; ++i) {
-        float f = src[i];
-        uint32_t man;
-        int exp;
-        int sgn = 0;
-        
-        if (f == 0.0) {
-            exp = 0;
-            man = 0;
-        }
-        else {
-            if (f < 0.0) {
-                sgn = 1;
-                f = -f;
-            }
-            man = (uint32_t)ldexpf(frexpf(f, &exp), 24);
-            man &= mask;
-#if ROUND_TO_NEAREST
-            {
-                float fl = ldexpf(man, exp - 24);
-                float fh = ldexpf(man + (mask & ~(mask << 1)), exp - 24);
-                
-                if (fh - f < f - fl) {
-                    man = (uint32_t)ldexpf(frexpf(fh, &exp), 24);
-                    man &= mask;
-                }
-            }
-#endif
-            exp += 127;
-            man &= 0x7FFFFF;
-            if (sgn)
-                man |= 0x800000;
-            man >>= (24 - m);
-        }
-        pexp[i] = exp;
-        if (inreg + m < 32) {
-            breg = (breg << m) | man;
-            inreg += m;
-        }
-        else {
-            const int n = 32 - inreg;
-            inreg = m - n;
-            breg = (breg << n) | (man >> inreg);
-            
-            pman[j + 0] = breg >> 24;
-            pman[j + 1] = breg >> 16;
-            pman[j + 2] = breg >>  8;
-            pman[j + 3] = breg >>  0;
-            j += 4;
-            
-            breg = man;
-        }
-    }
-    breg <<= 32 - inreg;
-    while (inreg > 0) {
-        pman[j] = breg >> 24;
-        breg <<= 8;
-        ++j;
-        inreg -= 8;
-    }
-    return j;
-}
-#endif /* ENCODING */
-
-#if DECODING
-static void unpack_and_join_f32(const uint8_t src[], uint32_t n, unsigned m, float dst[]) {
-    uint32_t i;
-    uint32_t j;
-    uint32_t breg;
-    uint32_t inreg;
-    
-    for (i = 0, j = n, breg = 0, inreg = 0; i != n; ) {
-        if (inreg >= m) {
-            const uint32_t man = (((breg >> (inreg - m)) << (24 - m)) & 0x00FFFFFF);
-            const int exp = src[i];
-            
-            if (exp != 0 || man != 0) {
-                const float f = ldexpf(man | 0x800000, (exp - 127) - 24);
-                
-                if ((man & 0x800000) != 0)
-                    dst[i] = -f;
-                else
-                    dst[i] = f;
-            }
-            else
-                dst[i] = 0.0;
-            inreg -= m;
-            ++i;
-        }
-        else {
-            breg = (breg << 8) | src[j];
-            inreg += 8;
-            ++j;
-        }
-    }
-}
-#endif /* DECODING */
diff --git a/libs/vxf/funzip.c b/libs/vxf/funzip.c
deleted file mode 100644
index 3559eab..0000000
--- a/libs/vxf/funzip.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <zlib.h>
-#include <assert.h>
-
-#define DECODING 1
-#include "fsplit-join.impl.h"
-
-static rc_t invoke_zlib(void *dst, uint32_t dsize, uint32_t *psize, const void *src, uint32_t ssize) {
-    z_stream s;
-    int zr;
-    rc_t rc;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = dsize;
-    
-    *psize = 0;
-    zr = inflateInit2(&s, -15);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    default:
-        return RC(rcXF, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-    }
-    zr = inflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-        assert(s.total_out <= UINT32_MAX);
-        *psize = (uint32_t)s.total_out;
-        rc = 0;
-        break;
-    case Z_OK:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcInsufficient);
-        break;
-    case Z_BUF_ERROR:
-    case Z_NEED_DICT:
-    case Z_DATA_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcCorrupt);
-        break;
-    case Z_MEM_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        break;
-    default:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-        break;
-    }
-    zr = inflateEnd(&s);
-    switch (zr) {
-    case Z_OK:
-        return rc;
-    default:
-        if (rc == 0)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcCorrupt);
-        return rc;
-    }
-}
-
-static
-rc_t f32unzip_func_v0(
-                   const VXformInfo *info,
-                   VBlobResult *Dst,
-                   const VBlobData *src,
-                   const VBlobHeader *hdr
-) {
-    rc_t rc;
-    uint8_t mantissa;
-    int64_t val;
-    float *dst = Dst->data;
-    uint32_t elem_count;
-    const bitsz_t dbits = Dst->elem_count * Dst->elem_bits;
-    KDataBuffer scratch;
-    
-    rc = KDataBufferMakeBytes(&scratch, (dbits + 7) >> 3);
-    if (rc == 0) {
-        assert(scratch.elem_count >> 32 == 0);
-        rc = invoke_zlib(scratch.base, (uint32_t)scratch.elem_count, &elem_count,
-                         src->data, ((size_t)src->elem_count * src->elem_bits + 7) >> 3);
-        if (rc == 0) {
-            scratch.elem_count = elem_count;
-            
-            VBlobHeaderArgPopHead(hdr, &val);
-            mantissa = (uint8_t)val;
-            
-            elem_count = (uint32_t)((8 * (size_t)scratch.elem_count) / (8 + mantissa));
-            if ((size_t)elem_count * 32 > dbits)
-                rc = RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-            else {
-                Dst->elem_bits = 32;
-                Dst->elem_count = elem_count;
-                Dst->byte_order = vboNative;
-                
-                unpack_and_join_f32(scratch.base, elem_count, mantissa, dst);
-            }
-        }
-    }
-    KDataBufferWhack(&scratch);
-    return rc;
-}
-
-static
-rc_t CC f32unzip_func(
-                void *Self,
-                const VXformInfo *info,
-                VBlobResult *dst,
-                const VBlobData *src,
-                VBlobHeader *hdr
-) {
-    uint8_t bits;
-    
-    switch (VBlobHeaderVersion(hdr)) {
-    case 0:
-        VBlobHeaderOpPopHead(hdr, &bits);
-        switch (bits) {
-        case 0:
-            return f32unzip_func_v0(info, dst, src, hdr);
-        }
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcUnexpected);
-    default:
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcBadVersion);
-    }
-}
-
-/* unzip
- function
- fzip_set funzip #1.0 ( fzip_fmt in );
- */
-VTRANSFACT_IMPL(vdb_funzip, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = f32unzip_func;
-
-    return 0;
-}
diff --git a/libs/vxf/fzip.c b/libs/vxf/fzip.c
deleted file mode 100644
index 784bec2..0000000
--- a/libs/vxf/fzip.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <zlib.h>
-
-#include <assert.h>
-
-#define ROUND_TO_NEAREST 1
-#define ENCODING 1
-#include "fsplit-join.impl.h"
-
-struct self_t {
-    int32_t mantissa;
-};
-
-static rc_t invoke_zlib(void *dst, uint64_t *dsize, const void *src, uint32_t ssize, int32_t strategy, int32_t level) {
-    z_stream s;
-    int zr;
-    rc_t rc = 0;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = (uInt)*dsize;
-    
-    *dsize = 0;
-    zr = deflateInit2(&s, level, Z_DEFLATED, -15, 9, strategy);
-    switch (zr) {
-        case 0:
-            break;
-        case Z_MEM_ERROR:
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        case Z_STREAM_ERROR:
-            return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-        default:
-            return RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-    zr = deflate(&s, Z_FINISH);
-    switch (zr) {
-        case Z_STREAM_END:
-            break;
-        case Z_OK:
-            s.total_out = 0;
-            break;
-        default:
-            rc = RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-            break;
-    }
-    zr = deflateEnd(&s);
-    if (zr != Z_OK)
-        rc = RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    if (rc == 0) {
-        assert(s.total_out <= UINT32_MAX);
-        *dsize = (uint32_t)s.total_out;
-    }
-    return rc;
-}
-
-static
-rc_t CC f32zip_func(
-              void *Self,
-              const VXformInfo *info,
-              VBlobResult *dst,
-              const VBlobData *Src,
-              VBlobHeader *hdr
-) {
-    rc_t rc;
-    const struct self_t *self = Self;
-    uint64_t dsize = (dst->elem_count * dst->elem_bits + 7) >> 3;
-    uint64_t element_count = (Src->elem_count * Src->elem_bits) >> 5;
-    uint64_t man_bytes;
-    KDataBuffer scratch;
-    
-    assert(element_count >> 32 == 0);
-    assert(dsize >> 32 == 0);
-    rc = KDataBufferMakeBytes(&scratch, element_count << 2);
-    if (rc)
-        return rc;
-    
-    VBlobHeaderSetVersion(hdr, 0);
-    VBlobHeaderOpPushTail(hdr, 0);
-    VBlobHeaderArgPushTail(hdr, self->mantissa);
-    
-    man_bytes = split_and_pack_f32(
-                                   Src->data, (uint32_t)element_count,
-                                   self->mantissa,
-                                   scratch.base);
-    assert((element_count + man_bytes) >> 32 == 0);
-    rc = invoke_zlib(dst->data, &dsize, scratch.base, (uint32_t)(element_count + man_bytes), Z_RLE, Z_BEST_SPEED);
-    KDataBufferWhack(&scratch);
-    if (rc == 0) {
-        dst->elem_bits = 1;
-        dst->byte_order = vboNone;
-        if (dsize)
-            dst->elem_count = dsize << 3;
-        else
-            rc = RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    }
-    return rc;
-}
-
-static
-void CC vxf_fzip_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* vdb:fzip
- * function fzip_fmt vdb:fzip #1.0 < U32 mantissa > ( fzip_set in );
- */
-VTRANSFACT_IMPL(vdb_fzip, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    struct self_t *ctx;
-    uint32_t mantissa = 0;
-
-    assert(cp->argc == 1);
-    
-    mantissa = cp->argv[0].data.u32[0];
-    if (1 > mantissa || mantissa > 24)
-        return RC(rcXF, rcFunction, rcConstructing, rcParam, rcInvalid);
-    
-    ctx = malloc(sizeof(*ctx));
-    if (ctx) {
-        ctx->mantissa = mantissa;
-       
-        rslt->self = ctx;
-        rslt->whack = vxf_fzip_wrapper;
-        rslt->variant = vftBlob;
-        rslt->u.bf = f32zip_func;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/vxf/integral.c b/libs/vxf/integral.c
deleted file mode 100644
index 7d40482..0000000
--- a/libs/vxf/integral.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-#define INTEGRAL_NAME( T )  integral_ ## T
-#define INTEGRAL( T )                                                       \
-static                                                                   \
-rc_t CC INTEGRAL_NAME ( T ) ( void *data,                                      \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-                                                                         \
-    T *dst       = rslt -> base;                                         \
-    const T *src = argv [ 0 ] . u . data . base;                         \
-    if(rslt -> elem_count== 0) return 0;				 \
-    dst += rslt -> first_elem;						 \
-    src += argv [ 0 ] . u . data . first_elem;				 \
-    dst [ 0 ] = src [ 0 ];						 \
-                                                                         \
-    for ( i = 1; i < rslt -> elem_count; ++ i ) {                        \
-        dst [ i ] = src [ i ] + dst [ i - 1 ];                           \
-    }                                                                    \
-    return 0;                                                            \
-}
-
-INTEGRAL ( int8_t )
-INTEGRAL ( int16_t )
-INTEGRAL ( int32_t )
-INTEGRAL ( int64_t )
-
-static VFixedRowFunc integral_func [] =
-{
-    INTEGRAL_NAME ( int8_t  ),
-    INTEGRAL_NAME ( int16_t ),
-    INTEGRAL_NAME ( int32_t ),
-    INTEGRAL_NAME ( int64_t )
-};
-/* integral
- *  return the 1 integral of input
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of  signed integers
- *
- *  "a" [ DATA ] - operand
- *
- *
- * SYNOPSIS:
- *  return 1st integral for every row
- *
- * USAGE:
- *    I32 position = < I32 > integral ( pos_1st_d );
- */
-VTRANSFACT_IMPL ( vdb_integral, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int size_idx;
-    switch ( info -> fdesc . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector integrals
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    rslt -> u . pf = integral_func [ size_idx ];
-    rslt -> variant = vftFixedRow;
-
-    return 0;
-}
diff --git a/libs/vxf/integral_0.c b/libs/vxf/integral_0.c
deleted file mode 100644
index cda997a..0000000
--- a/libs/vxf/integral_0.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-#define INTEGRAL_NAME( T )  integral_ ## T
-#define INTEGRAL( T )                                                       \
-static                                                                   \
-rc_t CC INTEGRAL_NAME ( T ) ( void *data,                                      \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-                                                                         \
-    T *dst       = rslt -> base;                                         \
-    const T *src = argv [ 0 ] . u . data . base;                         \
-    if(rslt -> elem_count== 0) return 0;				 \
-    dst += rslt -> first_elem;						 \
-    src += argv [ 0 ] . u . data . first_elem;				 \
-    dst [ 0 ] = 0;						 \
-                                                                         \
-    for ( i = 1; i < rslt -> elem_count; ++ i ) {                        \
-        dst [ i ] = src [ i ] + dst [ i - 1 ];                           \
-    }                                                                    \
-    return 0;                                                            \
-}
-
-INTEGRAL ( int8_t )
-INTEGRAL ( int16_t )
-INTEGRAL ( int32_t )
-INTEGRAL ( int64_t )
-
-static VFixedRowFunc integral0_func [] =
-{
-    INTEGRAL_NAME ( int8_t  ),
-    INTEGRAL_NAME ( int16_t ),
-    INTEGRAL_NAME ( int32_t ),
-    INTEGRAL_NAME ( int64_t )
-};
-/* integral
- *  return the 1 integral of input
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of  signed integers
- *
- *  "a" [ DATA ] - operand
- *
- *
- * SYNOPSIS:
- *  return 1st integral for every row
- *
- * USAGE:
- *    I32 position = < I32 > integral_0 ( pos_1st_d );
- */
-VTRANSFACT_IMPL ( vdb_integral_0, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int size_idx;
-    switch ( info -> fdesc . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector integrals
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    rslt -> u . pf = integral0_func [ size_idx ];
-    rslt -> variant = vftFixedRow;
-
-    return 0;
-}
diff --git a/libs/vxf/irzip.c b/libs/vxf/irzip.c
deleted file mode 100644
index 2ef4995..0000000
--- a/libs/vxf/irzip.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <compiler.h>
-#include <klib/sort.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <byteswap.h>
-#include <os-native.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-
-#include <zlib.h>
-
-#include <stdio.h>
-#include <assert.h>
-
-typedef struct {
-    size_t size;
-    size_t used;
-    void *buf;
-} szbuf;
-
-static rc_t zlib_compress(szbuf *dst, const void *src, size_t ssize, int32_t strategy, int32_t level) {
-    z_stream s;
-    int zr;
-    rc_t rc = 0;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = (uInt)ssize;
-    s.next_out = dst->buf;
-    s.avail_out = (uInt)dst->size;
-    
-    dst->used = 0;
-    
-    zr = deflateInit2(&s, level, Z_DEFLATED, -15, 9, strategy);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    case Z_STREAM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcParam, rcInvalid);
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-    zr = deflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-        break;
-    case Z_OK:
-        s.total_out = 0;
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-        break;
-    }
-    zr = deflateEnd(&s);
-    if (zr != Z_OK)
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    if (rc == 0) {
-        dst->used = (uint32_t)s.total_out;
-    }
-    return rc;
-}
-
-static rc_t zlib_decompress(void *dst, size_t dsize, size_t *psize, const void *src, size_t ssize) {
-    z_stream s;
-    int zr;
-    rc_t rc;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = (uInt)ssize;
-    s.next_out = dst;
-    s.avail_out = (uInt)dsize;
-    
-    zr = inflateInit2(&s, -15);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-    }
-    zr = inflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-    case Z_OK:
-        *psize = s.total_in;
-        rc = 0;
-        break;
-    case Z_BUF_ERROR:
-    case Z_NEED_DICT:
-    case Z_DATA_ERROR:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcData, rcCorrupt);
-        break;
-    case Z_MEM_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-        break;
-    }
-    if (inflateEnd(&s) == Z_OK) return rc;
-    
-    return rc == 0 ? RC(rcVDB, rcFunction, rcExecuting, rcData, rcCorrupt) : rc;
-}
-
-
-#define STYPE int8_t
-#define USTYPE uint8_t
-#define ENCODE encode_i8
-#define DECODE decode_i8
-#include "irzip.impl.h"
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE int16_t
-#define USTYPE uint16_t
-#define ENCODE encode_i16
-#define DECODE decode_i16
-#include "irzip.impl.h"
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE int32_t
-#define USTYPE uint32_t
-#define ENCODE encode_i32
-#define DECODE decode_i32
-#define TRY2SERIES 1
-#include "irzip.impl.h"
-#undef TRY2SERIES
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE int64_t
-#define USTYPE uint64_t
-#define ENCODE encode_i64
-#define DECODE decode_i64
-#define TRY2SERIES 1
-#include "irzip.impl.h"
-#undef TRY2SERIES
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE uint8_t
-#define USTYPE uint8_t
-#define ENCODE encode_u8
-#define DECODE decode_u8
-#include "irzip.impl.h"
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE uint16_t
-#define USTYPE uint16_t
-#define ENCODE encode_u16
-#define DECODE decode_u16
-#include "irzip.impl.h"
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE uint32_t
-#define USTYPE uint32_t
-#define ENCODE encode_u32
-#define DECODE decode_u32
-#define TRY2SERIES 1
-#include "irzip.impl.h"
-#undef TRY2SERIES
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-#define STYPE uint64_t
-#define USTYPE uint64_t
-#define ENCODE encode_u64
-#define DECODE decode_u64
-#define TRY2SERIES 1
-#include "irzip.impl.h"
-#undef TRY2SERIES
-#undef ENCODE
-#undef DECODE
-#undef STYPE
-#undef USTYPE
-
-
-typedef rc_t (*encode_f)(uint8_t dst[], size_t dsize, size_t *used,
-                         int64_t *Min, int64_t *Slope, uint8_t *series_count,uint8_t *planes, const void *Y, unsigned N);
-
-struct self_t {
-    encode_f f;
-};
-
-static
-struct self_t selfs[8] = {
-    { (encode_f)encode_u8 },
-    { (encode_f)encode_i8 },
-    { (encode_f)encode_u16 },
-    { (encode_f)encode_i16 },
-    { (encode_f)encode_u32 },
-    { (encode_f)encode_i32 },
-    { (encode_f)encode_u64 },
-    { (encode_f)encode_i64 },
-};
-
-
-
-static
-rc_t CC irzip(
-               void *Self,
-               const VXformInfo *info,
-               VBlobResult *dst,
-               const VBlobData *src,
-               VBlobHeader *hdr
-) {
-    rc_t rc = 0;
-    const struct self_t *self = Self;
-    size_t dsize;
-    int64_t min[2],slope[2];
-    uint8_t planes;
-    uint8_t series_count = 1;
-
-    assert(src->elem_count >> 32 == 0);
-    assert(((dst->elem_count * dst->elem_bits + 7) >> 3) >> 32 == 0);
-    dsize = (uint32_t)((dst->elem_count * dst->elem_bits + 7) >> 3);
-    
-   
-    rc = self->f(dst->data, dsize, &dsize, min, slope, &series_count, &planes, src->data, (unsigned)src->elem_count);
-#if 0
-    if(/*src->elem_bits ==64 &&*/ dsize > 0){
-	printf("%2d:irzip_elem_bits=%.8f\telem=%d\tstart=%ld\tslope=%lx\tplanes=%d\n",(int)src->elem_bits,dsize*8./src->elem_count,(int)src->elem_count,min,slope,planes);
-    }
-#endif
-    
-    VBlobHeaderSetVersion(hdr, (series_count > 1)?3:2);
-    if ( rc == 0 ) {
-	rc = VBlobHeaderOpPushTail(hdr, planes);
-	if ( rc == 0) {
-		rc = VBlobHeaderArgPushTail(hdr, min[0]);
-		if ( rc == 0 ) {
-			rc = VBlobHeaderArgPushTail(hdr, slope[0]);
-			if ( rc == 0 ){
-				if(series_count > 1){
-					rc = VBlobHeaderArgPushTail(hdr, min[1]);
-					if(rc == 0) rc = VBlobHeaderArgPushTail(hdr, slope[1]);
-				}
-				dst->byte_order = vboNative;
-				dst->elem_bits = 1;
-				dst->elem_count = dsize << 3;
-			}
-		}
-	}
-   }
-    return rc;
-}
-
-/* 
- function izip_fmt izip #2.1 ( izip_set in )
- */
-VTRANSFACT_IMPL(vdb_izip, 2, 1, 1) (const void *Self, const VXfactInfo *info,
-                                     VFuncDesc *rslt, const VFactoryParams *cp,
-                                     const VFunctionParams *dp )
-{
-/*
-* 2.1.1: bug fix for #VDB-539, bad conversions in encode_u64
-*/
-
-    if (dp->argc != 1) {
-#if _DEBUGGING
-        fprintf(stderr, "dp->argc = %u != 1\n", dp->argc);
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    rslt->variant = vftBlob;
-    rslt->u.bf = irzip;
-
-    switch (dp->argv[0].desc.domain) {
-    case vtdInt:
-        switch (dp->argv[0].desc.intrinsic_bits) {
-        case 8:
-            rslt->self = &selfs[1];
-            break;
-        case 16:
-            rslt->self = &selfs[3];
-            break;
-        case 32:
-            rslt->self = &selfs[5];
-            break;
-        case 64:
-            rslt->self = &selfs[7];
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", dp->argv[0].desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    case vtdUint:
-        switch (dp->argv[0].desc.intrinsic_bits) {
-        case 8:
-            rslt->self = &selfs[0];
-            break;
-        case 16:
-            rslt->self = &selfs[2];
-            break;
-        case 32:
-            rslt->self = &selfs[4];
-            break;
-        case 64:
-            rslt->self = &selfs[6];
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", dp->argv[0].desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "domain != vtdInt or vtdUint\n");
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    return 0;
-}
-
-typedef rc_t (*decode_f)(void *dst, unsigned N, int64_t* min, int64_t* slope, uint8_t series_count,uint8_t planes, const uint8_t src[], size_t ssize);
-
-static
-decode_f uselfs[8] = {
-    (decode_f)decode_u8,
-    (decode_f)decode_i8,
-    (decode_f)decode_u16,
-    (decode_f)decode_i16,
-    (decode_f)decode_u32,
-    (decode_f)decode_i32,
-    (decode_f)decode_u64,
-    (decode_f)decode_i64,
-};
-
-static
-rc_t iunzip_func_v1(
-                    void *Self,
-                    const VXformInfo *info,
-                    VBlobResult *dst,
-                    const VBlobData *src,
-                    int64_t* min,int64_t* slope,uint8_t series_count,
-                    uint8_t planes
-                    )
-{
-    uint32_t ssize;
-    rc_t rc;
-    
-    assert(dst->elem_count >> 32 == 0);
-    assert(((src->elem_count * src->elem_bits + 7) >> 3) >> 32 == 0);
-    ssize = (uint32_t)((src->elem_count * src->elem_bits + 7) >> 3);
-    
-    dst->byte_order = vboNative;
-    
-    rc = uselfs[(uintptr_t)(Self)](dst->data, (unsigned)dst->elem_count, min, slope, series_count, planes,src->data, ssize);
-    return rc;
-}
-
-extern rc_t CC iunzip_func_v0(
-                              void *Self,
-                              const VXformInfo *info,
-                              VBlobResult *dst,
-                              const VBlobData *src
-                              );
-    
-static
-rc_t CC iunzip(
-            void *Self,
-            const VXformInfo *info,
-            VBlobResult *dst,
-            const VBlobData *src,
-            VBlobHeader *hdr
-            )
-{
-    switch (VBlobHeaderVersion(hdr)) {
-    case 0:
-        return iunzip_func_v0(Self, info, dst, src);
-    case 1: 
-    case 2: 
-    case 3:
-	{
-        int64_t min[2],slope[2];
-        uint8_t planes;
-	uint8_t series_count=1;
-        rc_t rc;
-        
-        rc = VBlobHeaderOpPopHead(hdr, &planes);
-        if (rc == 0) {
-            rc = VBlobHeaderArgPopHead(hdr, min);
-            if (rc == 0) {
-		rc = VBlobHeaderArgPopHead(hdr, slope);
-		if (rc != 0) slope[0] = 0;
-		else {
-			rc = VBlobHeaderArgPopHead(hdr, min + 1);
-			if(rc==0) rc= VBlobHeaderArgPopHead(hdr, slope+1);
-			if(rc==0) series_count=2;
-		}
-                return iunzip_func_v1(Self, info, dst, src, min,slope, series_count, planes);
-            }
-	}
-        return rc;
-    }
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcParam, rcBadVersion);
-    }
-}
-
-/* 
- function izip_set iunzip #2.1 ( izip_fmt in )
- */
-VTRANSFACT_IMPL(vdb_iunzip, 2, 1, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = iunzip;
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            rslt->self = (void *)1;
-            break;
-        case 16:
-            rslt->self = (void *)3;
-            break;
-        case 32:
-            rslt->self = (void *)5;
-            break;
-        case 64:
-            rslt->self = (void *)7;
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", info->fdesc.desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            rslt->self = (void *)0;
-            break;
-        case 16:
-            rslt->self = (void *)2;
-            break;
-        case 32:
-            rslt->self = (void *)4;
-            break;
-        case 64:
-            rslt->self = (void *)6;
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", info->fdesc.desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "domain != vtdInt or vtdUint\n");
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-    return 0;
-}
-
-#if TESTING
-int test_encode(const int32_t Y[], unsigned N) {
-    uint8_t *dst;
-    size_t dsize;
-    size_t temp;
-    rc_t rc = 0;
-    int64_t min,slope;
-    uint8_t planes;
-    
-    temp = N * sizeof(Y[0]);
-    assert(temp >> 32 == 0);
-    dst = malloc(dsize = (unsigned)temp);
-    if (dst == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-
-    rc = encode_i32(dst, dsize, &dsize, &min, &slope, &planes, Y, N);
-    
-    {
-        int32_t *X;
-        
-        X = malloc(N * sizeof(Y[0]));
-        if (X) {
-            rc = decode_i32( X, N, min, slope, planes, dst, dsize);
-            if (rc == 0) {
-                rc = memcmp(Y, X, N * sizeof(Y[0])) == 0 ? 0 : RC(rcXF, rcFunction, rcExecuting, rcFunction, rcInvalid);
-            }
-            free(X);
-        }
-    }
-
-    free(dst);
-    if (rc)
-        fprintf(stdout, "test failed!\n");
-    return rc;
-}
-#endif
-
diff --git a/libs/vxf/irzip.impl.h b/libs/vxf/irzip.impl.h
deleted file mode 100644
index ff12a7b..0000000
--- a/libs/vxf/irzip.impl.h
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#define DELTA_UND  0
-#if _ARCH_BITS == 32
-#define DELTA_POS  0x7ffffffffffffff0LL
-#define DELTA_NEG  0x7ffffffffffffff1LL
-#define DELTA_BOTH 0x7ffffffffffffff2LL
-#else
-#define DELTA_POS  0x7ffffffffffffff0
-#define DELTA_NEG  0x7ffffffffffffff1
-#define DELTA_BOTH 0x7ffffffffffffff2
-#endif
-
-#define TRIGGER_2ND_SERIES 10*1024
-
-static rc_t ENCODE(uint8_t dst[], size_t dsize, size_t *used, int64_t *Min, int64_t *Slope, uint8_t *series_count,uint8_t *planes, const STYPE Y[], unsigned N)
-{
-    unsigned i;
-    unsigned k;
-    rc_t rc=0;
-    STYPE min,a0;
-    int64_t 	slope, delta_type = DELTA_UND,y_cur;
-    uint64_t    sum_a0,sum_min,sum_y,sum_delta;
-    uint64_t	max_diff;
-    uint8_t	*scratch=NULL;
-#ifdef TRY2SERIES
-    uint8_t	*series=NULL;/*** for 2nd series flag ***/
-    uint64_t    sum_delta2[2] = {0,0};
-    uint64_t    max_diff2[2] = {0,0};
-    uint32_t	last[2]; /** to run 2 series ***/
-    int64_t	delta2_type[2] = {DELTA_UND,DELTA_UND};
-#endif
-
-    if( N < 10 ) /*** no reason to encode **/
-		return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-
-    scratch=malloc(N*sizeof(STYPE));
-    if(scratch==NULL) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-#ifdef TRY2SERIES
-    series=malloc(N*sizeof(*series));
-    if(series==NULL) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-#endif
-   
-    /*** the code tries to best-fit one of 3 cases ****/
-    /*** 1. delta - for monotonous data **/
-    /*** 2. horizontal line through the minimum ****/
-    /*** 3. sloped line from the first element y[i] = y[0] + i * slope ***/
-    /*** all algorithms keep delta positive ****/
-    /*** 1. is preferred ***/
-    /*** the best between 2 and 3 is chosen by the sum of all deltas ****/
-    /*** floating point calculations are avoided ***/
-	a0 =  Y[0];
-	y_cur = Y[1];
-	sum_y =  Y[0] +  Y[1];
-	slope = (int64_t)Y[1] - (int64_t)Y[0];
-	if(slope < 0) {
-		min = Y[1]; 
-		sum_delta = -slope;
-		delta_type = DELTA_NEG;
-	} else {
-		min = Y[0];
-		sum_delta = slope;
-		if( slope != 0 ) delta_type = DELTA_POS;
-	}
-	max_diff = sum_delta;
-#ifdef TRY2SERIES
-	if(sum_delta >= TRIGGER_2ND_SERIES){
-		last[0]=0; last[1]=1;
-		series[0]=0; series[1]=1;
-	} else {
-		last[0]=1; last[1]=0;
-		series[0]=0; series[1]=0;
-		delta2_type[0] = delta_type;
-		sum_delta2[0]=sum_delta;
-		max_diff2[0]= sum_delta;
-	}
-#endif
-	for (i = 2; i < N; ++i) {
-		int64_t  md = (int64_t)Y[i] - (int64_t)min;
-		int64_t diff =  (int64_t)Y[i] - (int64_t)Y[i-1];
-		uint64_t abs_diff = (diff >= 0) ? diff : -diff;
-#ifdef TRY2SERIES
-		int64_t	last_delta_type = delta_type ;
-#endif
-		sum_y += Y[i];
-		sum_delta += abs_diff;
-		if(abs_diff > max_diff) max_diff = abs_diff;
-#define MACRO_SET_DELTA_TYPE(Diff,DeltaType) \
-		if( DeltaType != DELTA_BOTH){ \
-			if ( Diff > 0){ \
-				if(DeltaType == DELTA_NEG ) DeltaType =DELTA_BOTH; \
-				else if (DeltaType == DELTA_UND) DeltaType = DELTA_POS; \
-			} else if ( Diff < 0 ){ \
-				if(DeltaType == DELTA_POS ) DeltaType =DELTA_BOTH; \
-				else if (DeltaType == DELTA_UND) DeltaType = DELTA_NEG; \
-			} \
-		}
-		MACRO_SET_DELTA_TYPE(diff,delta_type);
-#ifdef TRY2SERIES
-		if(last[1] == 0){/** don't have a second series yet ***/
-			if(abs_diff >= TRIGGER_2ND_SERIES){
-				last[1]=i;
-				series[i]=1;
-				sum_delta2[0] = sum_delta - abs_diff;
-				delta2_type[0] = last_delta_type;
-				max_diff2[0] = max_diff;
-			} else {
-				last[0]=i;
-				series[i]=0;
-			}
-		} else { /*** second series is in being built ***/
-			int64_t diff1 =  (int64_t)Y[i] - (int64_t)Y[last[0]];
-			int64_t diff2 =  (int64_t)Y[i] - (int64_t)Y[last[1]];
-			uint64_t abs_diff1 = (diff1 >= 0) ? diff1 : -diff1;
-			uint64_t abs_diff2 = (diff2 >= 0) ? diff2 : -diff2;
-			if(abs_diff1 <= abs_diff2){
-				last[0]=i;
-				series[i]=0;
-				sum_delta2[0] += abs_diff1;
-				if(abs_diff1 > max_diff2[0]) max_diff2[0] = abs_diff1;
-				MACRO_SET_DELTA_TYPE(diff1,delta2_type[0]);
-			} else {
-				last[1]=i;
-				series[i]=1;
-				sum_delta2[1] += abs_diff2;
-				if(abs_diff2 > max_diff2[1]) max_diff2[1] = abs_diff2;
-				MACRO_SET_DELTA_TYPE(diff2,delta2_type[1]);
-			}
-		}
-#endif
-		if ( md < 0 ) {
-			min = Y[i];
-		}
-		y_cur += slope;
-		if(y_cur > (int64_t)Y[i]){/*** reduce the slope ***/
-			slope =  ((int64_t)Y[i] - (int64_t)Y[0] - i+1/**round down**/) /i;
-			y_cur =  (int64_t)Y[0] + (int64_t)(i* slope);
-			assert( y_cur <= (int64_t)Y[i]);
-		}
-	}
-
-    /*** define which delta is the smallest **/
-    *series_count=1;
-    if(delta_type == DELTA_BOTH) sum_delta <<= 1; /*** in DELTA_BOTH case we will use extra bit ***/
-    
-    sum_min = sum_y - N*min;
-    sum_a0  = sum_y - N*a0 - slope*N*(N-1)/2;
-    
-			
-    if( (delta_type == DELTA_POS || delta_type == DELTA_NEG ||
-        (delta_type == DELTA_BOTH &&  max_diff <  (((uint64_t)1)<<(sizeof(STYPE)*8-1))) /*** to prevent loosing a bit **/
-        ) && sum_delta <= sum_min && sum_delta <= sum_a0){
-	a0=Y[0];
-	slope = delta_type;
-    } else if(sum_a0 > sum_min){
-	a0 = min;
-	slope = 0;
-    }
-	
-
-    *planes = 0;
-    *used = 0;
-    *Min= a0;
-    *Slope = slope;
-
-#ifdef TRY2SERIES
-    if(last[1] > 0){
-	bool delta2_is_ok=true;
-	uint64_t    sum_delta2_total=0;
-	if(delta2_type[0] == DELTA_UND) delta2_type[0] = DELTA_POS;
-	if(delta2_type[1] == DELTA_UND) delta2_type[1] = DELTA_POS;
-
-	if(delta2_type[0] == DELTA_BOTH){
-		 delta2_is_ok = delta2_is_ok && (max_diff2[0] <  (((uint64_t)1)<<(sizeof(STYPE)*8-2)));
-		 sum_delta2_total += sum_delta2[0] * 4;
-	} else {
-		 delta2_is_ok = delta2_is_ok && (max_diff2[0] <  (((uint64_t)1)<<(sizeof(STYPE)*8-1)));
-		 sum_delta2_total += sum_delta2[0] * 2;
-	}
-	if(delta2_type[1] == DELTA_BOTH){
-		delta2_is_ok = delta2_is_ok && (max_diff2[1] <  (((uint64_t)1)<<(sizeof(STYPE)*8-2)));
-		sum_delta2_total += sum_delta2[1] * 4;
-	} else {
-		delta2_is_ok = delta2_is_ok && (max_diff2[1] <  (((uint64_t)1)<<(sizeof(STYPE)*8-1)));
-		sum_delta2_total += sum_delta2[1] * 2;
-	}
-	
-	if(delta2_is_ok && sum_delta2_total < sum_delta && sum_delta2_total < sum_min && sum_delta2_total< sum_a0){
-		*series_count=2;
-		Slope[0] = delta2_type[0];
-		Slope[1] = delta2_type[1];
-		Min[0]   = Y[0];
-	}
-    }
-#endif
-
-#define MACRO_FLUSH_VALUE \
-	for(k=0;k<sizeof(STYPE);k++){ \
-		if ((scratch[i+k*N] = (uint8_t)(val & 0xff)) != 0){ \
-			*planes |= (1<<k); \
-		} \
-		val >>= 8; \
-	}
-
-    /*** rotate the array ***/
-    if( *series_count > 1 ){
-#ifdef TRY2SERIES
-	for( i = 0,last[0]=0,last[1]=0; i != N; ++i){
-		uint64_t val;
-		if(series[i] == 0){
-			if(delta2_type[0] == DELTA_POS)       { assert(Y[i] >= Y[last[0]]); val = Y[i] - Y[last[0]];}
-			else if (delta2_type[0] == DELTA_NEG) { assert(Y[i] <= Y[last[0]]); val = Y[last[0]] - Y[i];}
-			else if( Y[i] >= Y[last[0]] )         val = (Y[i] - Y[last[0]])*2;
-			else				      val = (Y[last[0]] - Y[i])*2+1;
-			last[0]=i;
-			val<<=1;
-		} else {
-			if(last[1]==0){
-				Min[1] = Y[i];
-				val = 1;/*** flag second series with a bit ***/
-			} else {
-				if(delta2_type[1] == DELTA_POS)       { assert(Y[i] >= Y[last[1]]); val = Y[i] - Y[last[1]];}
-				else if (delta2_type[1] == DELTA_NEG) { assert(Y[i] <= Y[last[1]]); val = Y[last[1]] - Y[i];}
-				else if( Y[i] >= Y[last[1]] )         val = (Y[i] - Y[last[1]])*2;
-				else				      val = (Y[last[1]] - Y[i])*2+1;
-				val = val*2+1; /*** flag second series with a bit ***/
-			}
-			last[1]=i;
-		}
-                MACRO_FLUSH_VALUE;
-        }
-#else
-	assert(0);
-	rc=RC(rcXF, rcFunction, rcExecuting, rcParam, rcInconsistent);
-#endif
-    } else if(slope == DELTA_POS){
-	for( i = 0; i != N; ++i){
-		uint64_t val=Y[i] - a0;
-		assert(Y[i] >= a0);
-		a0 =  Y[i];
-		MACRO_FLUSH_VALUE;
-	}
-    } else if( slope == DELTA_NEG){
-	for( i = 0; i != N; ++i){
-		uint64_t  val = a0 - Y[i];
-		assert(Y[i] <= a0);
-                a0 =  Y[i];
-		MACRO_FLUSH_VALUE;
-	}
-    } else if( slope == DELTA_BOTH){
-	for( i = 0; i != N; ++i){
-		uint64_t val;
-		if( Y[i] >= a0 ){ /** move sign bit into the lowest bit ***/
-                        val = ( Y[i] - a0 ) << 1;
-                } else {
-                        val = ( a0 - Y[i]) * 2 + 1;
-                }
-                a0 =  Y[i];
-		MACRO_FLUSH_VALUE;
-	}
-    } else {
-	for( i = 0; i != N; ++i){
-		uint64_t val =  Y[i] - a0 - slope*i;
-		assert((int64_t)Y[i] >=  (int64_t)a0 + slope*i);
-		MACRO_FLUSH_VALUE;
-	}
-    }
-
-    /*** record the arrays ***/
-    for(k=0;k<sizeof(STYPE) && rc == 0; k++){
-	if (*planes & (1<<k)) {
-		szbuf s2;
-		s2.used = 0;
-		s2.size = dsize - *used;
-		s2.buf  = dst + *used;
-		rc = zlib_compress(&s2, scratch+k*N, N,Z_RLE, Z_BEST_SPEED);
-		if ( rc == 0 ) {
-			*used += s2.used;
-			if (s2.used == 0) /*** skip zipping **/
-				 rc=RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-		}
-	}
-    }
-    if(scratch) free(scratch);
-#ifdef TRY2SERIES
-    if(series) free(series);
-#endif
-    return rc;
-}
-
-static rc_t DECODE(STYPE Y[], unsigned N, int64_t* min, int64_t* slope, uint8_t series_count, uint8_t planes, const uint8_t src[], size_t ssize)
-{
-    unsigned k;
-    size_t j;
-    unsigned m;
-    unsigned i;
-    uint8_t *scratch=NULL;
-    rc_t rc=0;
-    bool    first;
-
-    memset(Y, 0, sizeof(Y[0]) * N);
-    for (j = k = 0, m = 1,first=true; m < 0x100; m <<= 1, k += 8) {
-        size_t n;
-        
-        if ((planes & m) == 0)
-            continue;
-        
-        n = 0;
-	if( !scratch ) scratch = malloc(N);
-	
-        rc = zlib_decompress(scratch, N, &n, src + j, ssize - j);
-        if (rc) goto DONE;
-        j += n;
-	if(first){
-		for (i = 0; i != N; ++i) Y[i] = ((STYPE)scratch[i]) << k;
-		first = false;
-	} else {
-		for (i = 0; i != N; ++i) Y[i] |= ((STYPE)scratch[i]) << k;
-	}
-    }
-    if(series_count == 2){
-#if 0 /** trying to unroll ***/
-	STYPE Ylast;
-	if(slope[0]==DELTA_BOTH){
-		if(slope[1]==DELTA_BOTH){ 
-			for(i = 0; i != N; ++i){
-				scratch[i] = Y[i]&3;
-				Y[i] = ((USTYPE)Y[i]) >> 2;
-			}
-		} else {
-			for(i = 0; i != N; ++i){
-				uint8_t tmp = Y[i]&1;
-				if(tmp){
-					scratch[i] = tmp;
-					Y[i] = ((USTYPE)Y[i]) >> 1;
-				} else {
-					scratch[i] = Y[i]&3;
-					Y[i] = ((USTYPE)Y[i]) >> 2;
-				}
-                        }
-
-		}
-	} else {
-		if(slope[1]==DELTA_BOTH){
-			for(i = 0; i != N; ++i){
-                                uint8_t tmp = Y[i]&1;
-                                if(!tmp){
-                                        scratch[i] = tmp;
-					Y[i] = ((USTYPE)Y[i]) >> 1;
-                                } else {
-                                        scratch[i] = Y[i]&3;
-					Y[i] = ((USTYPE)Y[i]) >> 2;
-
-                                }
-                        }
-		} else {
-			for(i = 0; i != N; ++i){
-				scratch[i] = Y[i]&1;
-				Y[i] = ((USTYPE)Y[i]) >> 1;
-			}
-		}
-	}
-	/** k=0 - main series, k=1 -secondary **/
-	for(k=0;k<2;k++){
-		Ylast = min[k];
-		if(slope[k]==DELTA_POS) {
-			for (i = 0; i != N; ++i){
-				if((scratch[i]&1)==k){
-					Y[i]  = Ylast + Y[i];
-					Ylast = Y[i];
-				}
-			}
-		} else if (slope[k]==DELTA_NEG){
-			for (i = 0; i != N; ++i){
-				if((scratch[i]&1)==k){
-					Y[i]  = Ylast - Y[i];
-					Ylast = Y[i];
-				}
-			}
-		} else for (i = 0; i != N; ++i){
-			if((scratch[i]&1)==k){
-				if(scratch[i]&2){
-					Y[i]  = Ylast - Y[i];
-				} else {
-					Y[i]  = Ylast + Y[i];
-				}
-				Ylast = Y[i];
-			}
-		}
-	}
-
-#else
-	uint32_t last[2]={0,0};
-	for (i = 0; i != N; ++i){
-		if( (Y[i]&1) == 0 ){/**main series **/
-			USTYPE val = (USTYPE)Y[i];
-			val >>= 1;
-			if(i==0){
-                                Y[i] = (STYPE)min[0];
-                                last[0]=i;
-                        }
-			if(slope[0]==DELTA_POS)      Y[i] = Y[last[0]] + val;
-			else if(slope[0]==DELTA_NEG) Y[i] = Y[last[0]] - val;
-			else if ((val&1)==0)         Y[i] = Y[last[0]] + (val >>1);
-			else 	                     Y[i] = Y[last[0]] - (val >>1);
-			last[0]=i;
-		} else { /**secondary series ***/
-			USTYPE val = (USTYPE)Y[i];
-			val >>= 1;
-			if(last[1]==0){
-				Y[i] = (STYPE)min[1];
-				last[1]=i;
-			}
-                        if(slope[1]==DELTA_POS)      Y[i] = Y[last[1]] + val;
-                        else if(slope[1]==DELTA_NEG) Y[i] = Y[last[1]] - val;
-                        else if ((val&1)==0)         Y[i] = Y[last[1]] + (val >>1);
-                        else                         Y[i] = Y[last[1]] - (val >>1);
-                        last[1]=i;
-		}
-        }
-#endif
-    } else if(min[0]==0 && slope[0]==0){ /*** no slope no offset - nothing to do ***/
-    } else if(slope[0] == DELTA_POS){
-	assert(Y[0] == 0);
-	Y[0] = (STYPE)min[0];
-	for (i = 1; i != N; ++i){
-		Y[i] = Y[i-1] + Y[i];
-	}
-    } else if (slope[0] == DELTA_NEG ) {
-	assert(Y[0] == 0);
-	Y[0] = (STYPE)min[0];
-	for (i = 1; i != N; ++i){
-		Y[i] =  Y[i-1] - Y[i];
-	}
-    } else if (slope[0] == DELTA_BOTH){
-	assert(Y[0] == 0);
-	Y[0] = (STYPE)min[0];
-	for (i = 1; i != N; ++i){
-		USTYPE val = (USTYPE)Y[i];
-		val >>= 1;
-		if(Y[i] & 1) Y[i] = Y[i-1] - val;
-		else         Y[i] = Y[i-1] + val;
-	}
-    } else if(slope[0] == 0) {
-	for (i = 0; i != N; ++i){
-		Y[i]  += (STYPE)min[0];
-	}
-    } else {
-	for (i = 0; i != N; ++i){
-                Y[i]  += (STYPE)min[0];
-                min[0] += slope[0];
-        }
-    }
-
-DONE:
-    if(scratch) free(scratch);
-    return rc;
-}
diff --git a/libs/vxf/iunzip.c b/libs/vxf/iunzip.c
deleted file mode 100644
index fb9cf52..0000000
--- a/libs/vxf/iunzip.c
+++ /dev/null
@@ -1,748 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include <byteswap.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-
-#include <zlib.h>
-
-#include <stdio.h>
-#include <assert.h>
-
-#include "izip-common.h"
-
-static void unpack_nbuf16_swap(nbuf *x) {
-    unsigned i;
-    
-    for (i = x->used; i; --i) {
-        x->data.raw[i - 1] = bswap_16(x->data.u16[i - 1]) + x->min;
-    }
-}
-
-static void unpack_nbuf32_swap(nbuf *x) {
-    unsigned i;
-    
-    for (i = x->used; i; --i) {
-        x->data.raw[i - 1] = bswap_32(x->data.u32[i - 1]) + x->min;
-    }
-}
-
-static void unpack_nbuf8(nbuf *x) {
-    unsigned i;
-    
-    for (i = x->used; i; --i) {
-        x->data.raw[i - 1] = x->data.u8[i - 1] + x->min;
-    }
-}
-
-static void unpack_nbuf16(nbuf *x) {
-    unsigned i;
-    
-    for (i = x->used; i; --i) {
-        x->data.raw[i - 1] = x->data.u16[i - 1] + x->min;
-    }
-}
-
-static void unpack_nbuf32(nbuf *x) {
-    unsigned i;
-    
-    for (i = x->used; i; --i) {
-        x->data.raw[i - 1] = x->data.u32[i - 1] + x->min;
-    }
-}
-
-static void unpack_nbuf(nbuf *x) {
-    unsigned i;
-    
-    switch (x->var) {
-    case 4:
-        unpack_nbuf8(x);
-        break;
-    case 3:
-        unpack_nbuf16(x);
-        break;
-    case 2:
-        unpack_nbuf32(x);
-        break;
-    default:
-        for (i = x->used; i; --i) {
-            x->data.raw[i - 1] = x->data.u64[i - 1] + x->min;
-        }
-        break;
-    }
-    x->var = 0;
-}
-
-static void unpack_nbuf_swap(nbuf *x) {
-    unsigned i;
-    
-    switch (x->var) {
-    case 4:
-        unpack_nbuf8(x);
-        break;
-    case 3:
-        unpack_nbuf16_swap(x);
-        break;
-    case 2:
-        unpack_nbuf32_swap(x);
-        break;
-    default:
-        for (i = x->used; ; --i) {
-            x->data.raw[i - 1] = bswap_64(x->data.u64[i - 1]) + x->min;
-            if (i == 0)
-                break;
-        }
-        break;
-    }
-    x->var = 0;
-}
-
-static rc_t zlib_decompress(void *dst, unsigned dsize, unsigned *psize, const void *src, uint32_t ssize) {
-    z_stream s;
-    int zr;
-    rc_t rc = 0;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = dsize;
-    
-    zr = inflateInit2(&s, -15);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-    }
-    zr = inflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-        assert(s.total_out <= UINT32_MAX);
-        *psize = (uint32_t)s.total_out;
-        rc = 0;
-        break;
-    case Z_OK:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcInsufficient);
-        break;
-    case Z_BUF_ERROR:
-    case Z_NEED_DICT:
-    case Z_DATA_ERROR:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcData, rcCorrupt);
-        break;
-    case Z_MEM_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-        break;
-    }
-    zr = inflateEnd(&s);
-    switch (zr) {
-    case Z_OK:
-        return rc;
-    default:
-        if (rc == 0)
-            {
-            return RC(rcVDB, rcFunction, rcExecuting, rcData, rcCorrupt);
-            }
-        return rc;
-    }
-    return 0;
-}
-
-static
-void decode_types(uint8_t dst[], unsigned n, const uint8_t src[])
-{
-    unsigned i, j, k = 0;
-    
-    for (i = 0, j = 1; i != n; ++i)
-    {
-        if (j == 1)
-            k = src[i / 8];
-
-        dst[i] = (k & j) == 0 ? 0 : 1;
-
-        j <<= 1;
-        if (j == 0x100)
-            j = 1;
-    }
-}
-
-#define DESERIAL16(X) do { if (i + 2 > n) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient); memcpy(&y->u.izipped.X, &src[i], 2); i += 2; if (swap) y->u.izipped.X = bswap_16(y->u.izipped.X); } while (0)
-#define DESERIAL32(X) do { if (i + 4 > n) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient); memcpy(&y->u.izipped.X, &src[i], 4); i += 4; if (swap) y->u.izipped.X = bswap_32(y->u.izipped.X); } while (0)
-#define DESERIAL64(X) do { if (i + 8 > n) return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient); memcpy(&y->u.izipped.X, &src[i], 8); i += 8; if (swap) y->u.izipped.X = bswap_64(y->u.izipped.X); } while (0)
-
-static rc_t deserialize_encoded(struct encoded *y, const uint8_t src[], unsigned n, int swap) {
-    unsigned i = 0;
-    
-    memset(y, 0, sizeof(*y));
-    
-    if (i + 1 > n)
-        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-    y->flags = src[i]; ++i;
-    
-    if (i + 4 > n)
-        return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-    memcpy(&y->data_count, &src[i], 4); i += 4;
-    if (swap)
-        y->data_count = bswap_32(y->data_count);
-    
-    switch (y->flags & 0x03) {
-    case 2:
-    case 3:
-        if (i + 8 > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        memcpy(&y->u.packed.min, &src[i], 8); i += 8;
-        if (swap)
-            y->u.packed.min = bswap_64(y->u.packed.min);
-    case 1:
-        y->u.zipped.data_size = n - i;
-        y->u.zipped.data = &src[i];
-        return 0;
-    default:
-        break;
-    }
-    
-    DESERIAL32(data_flags);
-    DESERIAL32(segments);
-    DESERIAL32(outliers);
-    
-    DESERIAL32(type_size);
-    DESERIAL32(diff_size);
-    DESERIAL32(length_size);
-    DESERIAL32(dy_size);
-    DESERIAL32(dx_size);
-    DESERIAL32(a_size);
-    DESERIAL32(outlier_size);
-    
-    DESERIAL64(min_diff);
-    DESERIAL64(min_length);
-    DESERIAL64(min_dy);
-    DESERIAL64(min_dx);
-    DESERIAL64(min_a);
-    DESERIAL64(min_outlier);
-    
-    if (FLAG_TYPE(y->u.izipped) != DATA_ABSENT && FLAG_TYPE(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.type_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.type = &src[i]; i += y->u.izipped.type_size;
-    }
-    
-    if (FLAG_DIFF(y->u.izipped) != DATA_ABSENT && FLAG_DIFF(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.diff_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.diff = &src[i]; i += y->u.izipped.diff_size;
-    }
-    
-    if (FLAG_LENGTH(y->u.izipped) != DATA_ABSENT && FLAG_LENGTH(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.length_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.length = &src[i]; i += y->u.izipped.length_size;
-    }
-    
-    if (FLAG_DY(y->u.izipped) != DATA_ABSENT && FLAG_DY(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.dy_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.dy = &src[i]; i += y->u.izipped.dy_size;
-    }
-    
-    if (FLAG_DX(y->u.izipped) != DATA_ABSENT && FLAG_DX(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.dx_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.dx = &src[i]; i += y->u.izipped.dx_size;
-    }
-    
-    if (FLAG_A(y->u.izipped) != DATA_ABSENT && FLAG_A(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.a_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.a = &src[i]; i += y->u.izipped.a_size;
-    }
-    
-    if (FLAG_OUTLIER(y->u.izipped) != DATA_ABSENT && FLAG_OUTLIER(y->u.izipped) != DATA_CONSTANT) {
-        if (i + y->u.izipped.outlier_size > n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-        y->u.izipped.outlier = &src[i];
-        /* i += y->u.izipped.outlier_size; */
-    }
-    
-    return 0;
-}
-
-#define BITS_TO_VARIANT(X, BITS) do { switch(BITS) { case 8: (X)->var = 4; break; case 16: (X)->var = 3; break; case 32: (X)->var = 2; break; case 64: (X)->var = 1; break; default: return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid); } } while (0);
-
-static rc_t decode_encoded(struct decoded *y, const struct encoded *x) {
-    unsigned i;
-    unsigned type = x->flags & 0x3;
-    rc_t rc;
-    const uint8_t *src;
-    uint8_t *hsrc;
-    unsigned elem_bits;
-    unsigned n = 0;
-    
-    memset(y, 0, sizeof(*y));
-    y->data_count = x->data_count;
-    y->size_type = (x->flags >> 2) & 3;
-    
-    y->diff = alloc_raw_nbuf(y->data_count);
-    if (y->diff == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    if (type) {
-        if ((type & 1) != 0)  {
-            rc = zlib_decompress(y->diff->data.u8, 8 * y->data_count, &n, x->u.zipped.data, x->u.zipped.data_size );
-            if (rc)
-                return rc;
-            if ((type & 2) != 0)
-                y->diff->min = x->u.packed.min;
-        }
-        else {
-            y->diff->min = x->u.packed.min;
-            memcpy(y->diff->data.u8, x->u.packed.data, n = x->u.packed.data_size);
-        }
-        elem_bits = n * 8 / x->data_count;
-        if (elem_bits * x->data_count / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->diff, elem_bits);
-        if (type == 1 && 4 - y->diff->var != y->size_type) {
-#if _DEBUGGING
-            fprintf(stderr, "decode_encoded: var = %i, size_type = %u\n", (int)y->diff->var, (unsigned)y->size_type);
-#endif
-            return RC(rcXF, rcFunction, rcExecuting, rcRange, rcExcessive);
-        }
-        y->diff->used = x->data_count;
-        return 0;
-    }
-    
-    y->type = malloc(x->u.izipped.segments);
-    if (y->type == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    if (x->u.izipped.outliers) {
-        hsrc = NULL;
-        
-        if (FLAG_TYPE(x->u.izipped) == DATA_ZIPPED) {
-            hsrc = malloc(x->u.izipped.segments);
-            if (hsrc == NULL)
-                return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            rc = zlib_decompress(hsrc, x->u.izipped.segments, &i, x->u.izipped.type, x->u.izipped.type_size);
-            if (rc) {
-                free(hsrc);
-                return rc;
-            }
-            src = hsrc;
-        }
-        else
-            src = x->u.izipped.type;
-        decode_types(y->type, x->u.izipped.segments, src);
-        if (hsrc) free(hsrc);
-        for (n = i = 0; i != x->u.izipped.segments; ++i) {
-            if (y->type[i])
-                ++n;
-        }
-        y->lines = x->u.izipped.segments - n;
-        y->outliers = n;
-    }
-    else {
-        memset(y->type, 0, x->u.izipped.segments);
-        y->lines = x->u.izipped.segments;
-        y->outliers = 0;
-    }
-    
-    y->diff->min = x->u.izipped.min_diff;
-    if (FLAG_DIFF(x->u.izipped) == DATA_CONSTANT) {
-        y->diff->used = x->u.izipped.diff_size;
-        memset(y->diff->data.raw, 0, nbuf_size(y->diff));
-    }
-    else {
-        if (FLAG_DIFF(x->u.izipped) == DATA_ZIPPED) {
-            rc = zlib_decompress(y->diff->data.u8, y->diff->size * 8, &n, x->u.izipped.diff, x->u.izipped.diff_size);
-            if (rc)
-                return rc;
-        }
-        else {
-            n = x->u.izipped.diff_size;
-            memcpy(y->diff->data.u8, x->u.izipped.diff, n);
-        }
-
-        if ( y->diff->size != 0 )
-            elem_bits = (n * 8) / y->diff->size;
-        else
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-
-        if (elem_bits * y->diff->size / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->diff, elem_bits);
-        y->diff->used = n >> (4 - y->diff->var);
-    }
-    
-    y->length = alloc_nbuf(y->lines + y->outliers, 2);
-    if (y->length == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    y->length->min = x->u.izipped.min_length;
-    if (FLAG_LENGTH(x->u.izipped) == DATA_CONSTANT) {
-        y->length->used = y->lines + y->outliers;
-        memset(y->length->data.raw, 0, nbuf_size(y->length));
-    }
-    else {
-        if (FLAG_LENGTH(x->u.izipped) == DATA_ZIPPED) {
-            rc = zlib_decompress(y->length->data.u8, y->length->size * 4, &n, x->u.izipped.length, x->u.izipped.length_size);
-            if (rc)
-                return rc;
-        }
-        else {
-            n = x->u.izipped.length_size;
-            memcpy(y->length->data.u8, x->u.izipped.length, n);
-        }
-        elem_bits = (n * 8) / (y->lines + y->outliers);
-        if (elem_bits * (y->lines + y->outliers) / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->length, elem_bits);
-        y->length->used = n >> (4 - y->length->var);
-    }
-    
-    y->dy = alloc_nbuf(y->lines, 1);
-    if (y->dy == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    y->dy->min = x->u.izipped.min_dy;
-    if (FLAG_DY(x->u.izipped) == DATA_CONSTANT) {
-        y->dy->used = y->lines;
-        memset(y->dy->data.raw, 0, nbuf_size(y->dy));
-    }
-    else {
-        if (FLAG_DY(x->u.izipped) == DATA_ZIPPED) {
-            rc = zlib_decompress(y->dy->data.u8, y->dy->size * 8, &n, x->u.izipped.dy, x->u.izipped.dy_size);
-            if (rc)
-                return rc;
-        }
-        else {
-            n = x->u.izipped.dy_size;
-            memcpy(y->dy->data.u8, x->u.izipped.dy, n);
-        }
-        elem_bits = (n * 8) / y->lines;
-        if (elem_bits * y->lines / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->dy, elem_bits);
-        y->dy->used = n >> (4 - y->dy->var);
-    }
-    
-    y->dx = alloc_nbuf(y->lines, 1);
-    if (y->dx == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    y->dx->min = x->u.izipped.min_dx;
-    if (FLAG_DX(x->u.izipped) == DATA_CONSTANT) {
-        y->dx->used = y->lines;
-        memset(y->dx->data.raw, 0, nbuf_size(y->dx));
-    }
-    else {
-        if (FLAG_DX(x->u.izipped) == DATA_ZIPPED) {
-            rc = zlib_decompress(y->dx->data.u8, y->dx->size * 8, &n, x->u.izipped.dx, x->u.izipped.dx_size);
-            if (rc)
-                return rc;
-        }
-        else {
-            n = x->u.izipped.dx_size;
-            memcpy(y->dx->data.u8, x->u.izipped.dx, n);
-        }
-        elem_bits = (n * 8) / y->lines;
-        if (elem_bits * y->lines / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->dx, elem_bits);
-        y->dx->used = n >> (4 - y->dx->var);
-    }
-    
-    y->a = alloc_nbuf(y->lines, 1);
-    if (y->a == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    
-    y->a->min = x->u.izipped.min_a;
-    if (FLAG_A(x->u.izipped) == DATA_CONSTANT) {
-        y->a->used = y->lines;
-        memset(y->a->data.raw, 0, nbuf_size(y->a));
-    }
-    else {
-        if (FLAG_A(x->u.izipped) == DATA_ZIPPED) {
-            rc = zlib_decompress(y->a->data.u8, y->a->size * 8, &n, x->u.izipped.a, x->u.izipped.a_size);
-            if (rc)
-                return rc;
-        }
-        else {
-            n = x->u.izipped.a_size;
-            memcpy(y->a->data.u8, x->u.izipped.a, n);
-        }
-        elem_bits = (n * 8) / y->lines;
-        if (elem_bits * y->lines / 8 != n)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        BITS_TO_VARIANT(y->a, elem_bits);
-        y->a->used = n >> (4 - y->a->var);
-    }
-    
-    if (y->outliers) {
-        y->outlier = alloc_nbuf(x->u.izipped.outliers, 1);
-        if (y->outlier == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        
-        y->outlier->min = x->u.izipped.min_outlier;
-        if (FLAG_OUTLIER(x->u.izipped) == DATA_CONSTANT) {
-            y->outlier->used = y->outliers;
-            memset(y->outlier->data.raw, 0, nbuf_size(y->outlier));
-        }
-        else {
-            if (FLAG_OUTLIER(x->u.izipped) == DATA_ZIPPED) {
-                rc = zlib_decompress(y->outlier->data.u8, y->outlier->size * 8, &n, x->u.izipped.outlier, x->u.izipped.outlier_size);
-                if (rc)
-                    return rc;
-            }
-            else {
-                n = x->u.izipped.outlier_size;
-                memcpy(y->outlier->data.u8, x->u.izipped.outlier, n);
-            }
-            elem_bits = (n * 8) / x->u.izipped.outliers;
-            if (elem_bits * x->u.izipped.outliers / 8 != n)
-                return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-            BITS_TO_VARIANT(y->outlier, elem_bits);
-            y->outlier->used = n >> (4 - y->outlier->var);
-        }
-    }
-    
-    return 0;
-}
-
-#define STYPE uint8_t
-#define DECODE decode_u8
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE int8_t
-#define DECODE decode_i8
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE uint16_t
-#define DECODE decode_u16
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE int16_t
-#define DECODE decode_i16
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE uint32_t
-#define DECODE decode_u32
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE int32_t
-#define DECODE decode_i32
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE uint64_t
-#define DECODE decode_u64
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-#define STYPE int64_t
-#define DECODE decode_i64
-#include "izip-decode.impl.h"
-#undef STYPE
-#undef DECODE
-
-typedef rc_t (*decode_f)(void *dst, unsigned dsize, const uint8_t src[], unsigned N, int swap);
-
-static
-decode_f selfs[8] = {
-    (decode_f)decode_u8,
-    (decode_f)decode_i8,
-    (decode_f)decode_u16,
-    (decode_f)decode_i16,
-    (decode_f)decode_u32,
-    (decode_f)decode_i32,
-    (decode_f)decode_u64,
-    (decode_f)decode_i64,
-};
-
-#if 0
-rc_t ex_decode8( void *dst, unsigned dsize, uint8_t *src, unsigned ssize )
-{
-    return selfs[0].f( dst, dsize, src, ssize, 0 );
-}
-
-rc_t ex_decode16( void *dst, unsigned dsize, uint8_t *src, unsigned ssize )
-{
-    return selfs[2].f( dst, dsize, src, ssize, 0 );
-}
-
-rc_t ex_decode32( void *dst, unsigned dsize, uint8_t *src, unsigned ssize )
-{
-    return selfs[4].f( dst, dsize, src, ssize, 0 );
-}
-
-rc_t ex_decode64( void *dst, unsigned dsize, uint8_t *src, unsigned ssize )
-{
-    return selfs[6].f( dst, dsize, src, ssize, 0 );
-}
-#endif
-
-rc_t CC iunzip_func_v0(
-                    void *Self,
-                    const VXformInfo *info,
-                    VBlobResult *dst,
-                    const VBlobData *src
-) {
-    uint32_t ssize;
-    
-    assert(dst->elem_count >> 32 == 0);
-    assert(((src->elem_count * src->elem_bits + 7) >> 3) >> 32 == 0);
-    ssize = (uint32_t)((src->elem_count * src->elem_bits + 7) >> 3);
-    
-    dst->byte_order = vboNative;
-    switch (src->byte_order) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    case vboBigEndian:
-#else
-    case vboBigEndian:
-#endif
-        return selfs[(uintptr_t)Self](dst->data, (uint32_t)dst->elem_count,
-                       src->data, ssize,
-                       1);
-    default:
-        return selfs[(uintptr_t)Self](dst->data, (uint32_t)dst->elem_count,
-                       src->data, ssize,
-                       0);
-    }
-}
-
-#if 0
-
-static
-rc_t CC iunzip(
-            void *Self,
-            const VXformInfo *info,
-            VBlobResult *dst,
-            const VBlobData *src,
-            VBlobHeader *hdr
-) {
-    switch (VBlobHeaderVersion(hdr)) {
-    case 0:
-        return iunzip_func_v0(Self, info, dst, src);
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcParam, rcBadVersion);
-    }
-}
-
-/* 
- function izip_set iunzip #1.0 ( izip_fmt in )
- */
-VTRANSFACT_IMPL(vdb_iunzip, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = iunzip;
-    
-    switch (info->fdesc.desc.domain) {
-    case vtdInt:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            rslt->self = (void *)1;
-            break;
-        case 16:
-            rslt->self = (void *)3;
-            break;
-        case 32:
-            rslt->self = (void *)5;
-            break;
-        case 64:
-            rslt->self = (void *)7;
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", info->fdesc.desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    case vtdUint:
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            rslt->self = (void *)0;
-            break;
-        case 16:
-            rslt->self = (void *)2;
-            break;
-        case 32:
-            rslt->self = (void *)4;
-            break;
-        case 64:
-            rslt->self = (void *)6;
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", info->fdesc.desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "domain != vtdInt or vtdUint\n");
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-    return 0;
-}
-#endif
-
-#if TESTING
-int test_decode(int32_t *dst, unsigned dsize, const uint8_t *src, unsigned ssize, int swap) {
-    return decode_i32(dst, dsize, src, ssize, 0);
-}
-#endif
diff --git a/libs/vxf/izip-common.h b/libs/vxf/izip-common.h
deleted file mode 100644
index c6dc84c..0000000
--- a/libs/vxf/izip-common.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct {
-    unsigned size;
-    unsigned used;
-    int64_t min;
-    int64_t max;
-    unsigned var;
-    union {
-        int64_t  raw[1];
-        uint64_t u64[1];
-        uint32_t u32[2];
-        uint16_t u16[4];
-        uint8_t  u8[8];
-    } data;
-} nbuf;
-
-#define nbuf_get(X, I) (((const nbuf *)X)->var == 4 ? ((const nbuf *)X)->data.u8[(I)] : (((const nbuf *)X)->var == 3 ? ((const nbuf *)X)->data.u16[(I)] : (((const nbuf *)X)->var == 2 ? ((const nbuf *)X)->data.u32[(I)] : ((const nbuf *)X)->data.u64[(I)])))
-
-static unsigned nbuf_size(const nbuf *x) {
-    size_t y;
-    
-    switch (x->var) {
-    default:
-        y = sizeof(x->data.raw[0]) * x->used;
-        break;
-    case 1:
-        y = sizeof(x->data.u64[0]) * x->used;
-        break;
-    case 2:
-        y = sizeof(x->data.u32[0]) * x->used;
-        break;
-    case 3:
-        y = sizeof(x->data.u16[0]) * x->used;
-        break;
-    case 4:
-        y = sizeof(x->data.u8[0]) * x->used;
-        break;
-    }
-    assert(y <= UINT32_MAX);
-    return (unsigned)y;
-}
-
-static nbuf *alloc_nbuf(unsigned cnt, unsigned var) {
-    nbuf *rslt;
-    
-    rslt = malloc(sizeof(*rslt) - sizeof(rslt->data) + cnt * sizeof(rslt->data.raw[0]));
-    if ( rslt != NULL ) {
-        memset(rslt, 0, sizeof(*rslt) - sizeof(rslt->data));
-        rslt->size = cnt;
-        rslt->used = 0;
-        rslt->var = var;
-    }
-    return rslt;
-}
-
-static nbuf *alloc_raw_nbuf(unsigned cnt) {
-    return alloc_nbuf(cnt, 0);
-}
-
-struct decoded {
-    unsigned data_count;
-    unsigned lines;
-    unsigned outliers;
-    unsigned size_type;
-    
-    nbuf *diff;      /* diff[data_count] */
-    uint8_t *type;   /* type[lines + outliers] */
-    nbuf *length;    /* length[lines + outliers]  */
-    nbuf *dy;        /* dy[lines] */
-    nbuf *dx;        /* dx[lines] */
-    nbuf *a;         /* a[lines] */
-    nbuf *outlier;   /* outlier[outliers] */
-};
-
-#define DATA_CONSTANT (1)
-#define DATA_ZIPPED (2)
-#define DATA_ABSENT (3)
-
-#define FLAG_BITS (4)
-#define FLAG_MASK ((1 << FLAG_BITS) - 1)
-
-#define FLAG_BITS_TYPE      (0)
-#define FLAG_BITS_DIFF      (FLAG_BITS + FLAG_BITS_TYPE)
-#define FLAG_BITS_LENGTH    (FLAG_BITS + FLAG_BITS_DIFF)
-#define FLAG_BITS_DY        (FLAG_BITS + FLAG_BITS_LENGTH)
-#define FLAG_BITS_DX        (FLAG_BITS + FLAG_BITS_DY)
-#define FLAG_BITS_A         (FLAG_BITS + FLAG_BITS_DX)
-#define FLAG_BITS_OUTLIER   (FLAG_BITS + FLAG_BITS_A)
-
-#define SET_TYPE_ABSENT(FLAGS)      ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_TYPE)
-#define SET_DIFF_ABSENT(FLAGS)      ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_DIFF)
-#define SET_LENGTH_ABSENT(FLAGS)    ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_LENGTH)
-#define SET_DY_ABSENT(FLAGS)        ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_DY)
-#define SET_DX_ABSENT(FLAGS)        ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_DX)
-#define SET_A_ABSENT(FLAGS)         ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_A)
-#define SET_OUTLIER_ABSENT(FLAGS)   ((FLAGS).data_flags) |= (DATA_ABSENT << FLAG_BITS_OUTLIER)
-
-#define SET_TYPE_CONSTANT(FLAGS)    ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_TYPE)
-#define SET_DIFF_CONSTANT(FLAGS)    ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_DIFF)
-#define SET_LENGTH_CONSTANT(FLAGS)  ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_LENGTH)
-#define SET_DY_CONSTANT(FLAGS)      ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_DY)
-#define SET_DX_CONSTANT(FLAGS)      ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_DX)
-#define SET_A_CONSTANT(FLAGS)       ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_A)
-#define SET_OUTLIER_CONSTANT(FLAGS) ((FLAGS).data_flags) |= (DATA_CONSTANT << FLAG_BITS_OUTLIER)
-
-#define SET_TYPE_ZIPPED(FLAGS)      ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_TYPE)
-#define SET_DIFF_ZIPPED(FLAGS)      ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_DIFF)
-#define SET_LENGTH_ZIPPED(FLAGS)    ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_LENGTH)
-#define SET_DY_ZIPPED(FLAGS)        ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_DY)
-#define SET_DX_ZIPPED(FLAGS)        ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_DX)
-#define SET_A_ZIPPED(FLAGS)         ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_A)
-#define SET_OUTLIER_ZIPPED(FLAGS)   ((FLAGS).data_flags) |= (DATA_ZIPPED << FLAG_BITS_OUTLIER)
-
-#define FLAG_TYPE(O)                ((((O).data_flags) >> FLAG_BITS_TYPE   ) & FLAG_MASK)
-#define FLAG_DIFF(O)                ((((O).data_flags) >> FLAG_BITS_DIFF   ) & FLAG_MASK)
-#define FLAG_LENGTH(O)              ((((O).data_flags) >> FLAG_BITS_LENGTH ) & FLAG_MASK)
-#define FLAG_DY(O)                  ((((O).data_flags) >> FLAG_BITS_DY     ) & FLAG_MASK)
-#define FLAG_DX(O)                  ((((O).data_flags) >> FLAG_BITS_DX     ) & FLAG_MASK)
-#define FLAG_A(O)                   ((((O).data_flags) >> FLAG_BITS_A      ) & FLAG_MASK)
-#define FLAG_OUTLIER(O)             ((((O).data_flags) >> FLAG_BITS_OUTLIER) & FLAG_MASK)
-
-struct encoded {
-    uint8_t flags;   /* 0x1: zipped, 0x2: packed, 0x3: packed+zipped, 0x0: izipped */
-    uint32_t data_count;
-    union {
-        struct {
-            uint32_t data_size;
-            const uint8_t *data;
-        } zipped;
-        struct {
-            uint32_t data_size;
-            const uint8_t *data;
-            int64_t min;
-        } packed;
-        struct {
-            uint32_t data_flags;
-            uint32_t segments;
-            uint32_t outliers;
-            uint32_t type_size;
-            uint32_t diff_size;
-            uint32_t length_size;
-            uint32_t dy_size;
-            uint32_t dx_size;
-            uint32_t a_size;
-            uint32_t outlier_size;
-            
-            int64_t min_diff;
-            int64_t min_length;
-            int64_t min_dy;
-            int64_t min_dx;
-            int64_t min_a;
-            int64_t min_outlier;
-            
-            const uint8_t *type;
-            const uint8_t *diff;
-            const uint8_t *length;
-            const uint8_t *dy;
-            const uint8_t *dx;
-            const uint8_t *a;
-            const uint8_t *outlier;
-        } izipped;
-    } u;
-};
-
-#if 1
-#define DEBUG_PRINT(fmt, ...) { do { } while(0); }
-#else
-#define DEBUG_PRINT(fmt, ...) fprintf(stderr, "%s - " fmt "\n", __func__, __VA_ARGS__)
-#endif
-
diff --git a/libs/vxf/izip-decode.impl.h b/libs/vxf/izip-decode.impl.h
deleted file mode 100644
index d6f88f8..0000000
--- a/libs/vxf/izip-decode.impl.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-static
-rc_t DECODE(STYPE Y[], unsigned N, const uint8_t src[], unsigned ssize, int swap) {
-    rc_t rc;
-    struct encoded encoded;
-    struct decoded decoded;
-    unsigned i;
-    unsigned j;
-    unsigned k;
-    unsigned u;
-    unsigned v;
-    
-    rc = deserialize_encoded(&encoded, src, ssize, swap);
-    if (rc)
-        return rc;
-    rc = decode_encoded(&decoded, &encoded);
-    if (rc == 0) {
-        if (decoded.diff->used != N)
-            return RC(rcXF, rcFunction, rcExecuting, rcData, rcInvalid);
-        
-        if ((encoded.flags & 3) == 0) {
-            if (N == 121)
-                DEBUG_PRINT("decompressing izip", 0);
-            if (swap) {
-                unpack_nbuf_swap(decoded.diff);
-                unpack_nbuf_swap(decoded.length);
-                unpack_nbuf_swap(decoded.dy);
-                unpack_nbuf_swap(decoded.dx);
-                unpack_nbuf_swap(decoded.a);
-                if (decoded.outlier)
-                    unpack_nbuf_swap(decoded.outlier);
-            }
-            else {
-                unpack_nbuf(decoded.diff);
-                unpack_nbuf(decoded.length);
-                unpack_nbuf(decoded.dy);
-                unpack_nbuf(decoded.dx);
-                unpack_nbuf(decoded.a);
-                if (decoded.outlier)
-                    unpack_nbuf(decoded.outlier);
-            }
-
-            if (N == 121) {
-                for (i = 0; i != decoded.diff->used; ++i) {
-                    DEBUG_PRINT("  %i - diff: %lli", i, decoded.diff->data.raw[i]);
-                }
-            }
-            
-            for (u = v = k = i = 0; i != decoded.lines + decoded.outliers; ++i) {
-                unsigned n = (unsigned)decoded.length->data.raw[i];
-                
-                if (decoded.type[i]) {
-                    if (N == 121)
-                        DEBUG_PRINT("extracting stored segment %u; length: %u", i, n);
-                    for (j = 0; j != n; ++j, ++k, ++v)
-                        Y[k] = (STYPE)( decoded.outlier->data.raw[v] );
-                }
-                else {
-                    const double m = decoded.dy->data.raw[u] / (double)decoded.dx->data.raw[u];
-                    
-                    if (N == 121)
-                        DEBUG_PRINT("extracting line segment %u; length: %u; dy: %lli; dx: %lli; a: %lli", i, n, decoded.dy->data.raw[u], decoded.dx->data.raw[u], decoded.a->data.raw[u]);
-                    for (j = 0; j != n; ++j, ++k) {
-                        Y[k] = (STYPE)( decoded.diff->data.raw[k] + (STYPE)(decoded.a->data.raw[u] + j * m) );
-                        if (N == 121)
-                            DEBUG_PRINT("    %u: %i", k, (int)Y[k]);
-                    }
-                    ++u;
-                }
-            }
-        }
-        else if ((encoded.flags & 2) != 0) {
-            if ((((size_t)1) << decoded.size_type) > sizeof(Y[0])) {
-#if _DEBUGGING
-                fprintf(stderr, "iunzip: refusing to decode from original element size of %u to %u\n", (unsigned)(((size_t)1) << decoded.size_type), (unsigned)sizeof(Y[0]));
-#endif
-                return RC(rcXF, rcFunction, rcExecuting, rcRange, rcExcessive);
-            }
-            switch (decoded.diff->var) {
-            case 4:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)( decoded.diff->data.u8[i] + decoded.diff->min );
-                break;
-            case 3:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)( decoded.diff->data.u16[i] + decoded.diff->min );
-                break;
-            case 2:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)( decoded.diff->data.u32[i] + decoded.diff->min );
-                break;
-            case 1:
-            default:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)( decoded.diff->data.u64[i] + decoded.diff->min );
-                break;
-            }
-        }
-        else {
-            if ((((size_t)1) << decoded.size_type) > sizeof(Y[0])) {
-#if _DEBUGGING
-                fprintf(stderr, "iunzip: refusing to decode from original element size of %u to %u\n", (unsigned)(((size_t)1) << decoded.size_type), (unsigned)sizeof(Y[0]));
-#endif
-                return RC(rcXF, rcFunction, rcExecuting, rcRange, rcExcessive);
-            }
-            
-            switch (decoded.diff->var) {
-            case 4:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)decoded.diff->data.u8[i];
-                break;
-            case 3:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)decoded.diff->data.u16[i];
-                break;
-            case 2:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)decoded.diff->data.u32[i];
-                break;
-            case 1:
-            default:
-                for (i = 0; i != decoded.diff->used; ++i)
-                    Y[i] = (int32_t)decoded.diff->data.u64[i];
-                break;
-            }
-        }
-    }
-    if (decoded.diff)   free(decoded.diff);
-    if (decoded.type)   free(decoded.type);
-    if (decoded.length) free(decoded.length);
-    if (decoded.dy)     free(decoded.dy);
-    if (decoded.dx)     free(decoded.dx);
-    if (decoded.a)      free(decoded.a);
-    if (decoded.outlier) free(decoded.outlier);
-    
-    return rc;
-}
diff --git a/libs/vxf/izip-encode.impl.h b/libs/vxf/izip-encode.impl.h
deleted file mode 100644
index a6ddc15..0000000
--- a/libs/vxf/izip-encode.impl.h
+++ /dev/null
@@ -1,523 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-static int ANALYZE(stats_t stats[], const unsigned scnt, unsigned *fcnt, const STYPE Y[], const unsigned dcnt, STYPE *MIN, STYPE *MAX) {
-    stats_t **base;
-    unsigned i;
-    unsigned k;
-    unsigned n = (dcnt + scnt - 1) / scnt;
-    int loops;
-    unsigned split;
-    unsigned merged = 0;
-    STYPE min = Y[0];
-    STYPE max = Y[0];
-    
-    memset(stats, 0, sizeof(stats[0]));
-    
-    for (i = 0, k = 0; i != dcnt; ++i) {
-        if (min > Y[i])
-            min = Y[i];
-        if (max < Y[i])
-            max = Y[i];
-        
-        stats[k].sy  += (double_t)Y[i];
-        stats[k].syy += (double_t)Y[i] * Y[i];
-        stats[k].sxy += (double_t)Y[i] * i;
-        
-        stats[k].sx  += (double_t)i;
-        stats[k].sxx += (double_t)i * i;
-        
-        ++stats[k].n;
-        if (stats[k].n != n)
-            continue;
-        
-        stats[k].fit = fitness( stats + k );
-        ++k;
-        if (k == scnt)
-            break;
-        memset(stats + k, 0, sizeof(stats[0]));
-        stats[k].x = i + 1;
-    }
-    n = k;
-    if (k != scnt && stats[k].n) {
-        stats[k].fit = fitness( stats + k );
-        ++n;
-    }
-    
-    *MIN = min;
-    *MAX = max;
-    
-    if (n == 1) {
-        *fcnt = 1;
-        return 0;
-    }
-    for (k = 0, i = 1; i != n; ++i) {
-        stats_t temp;
-        
-        merge(&temp, &stats[k], &stats[i]);
-        if (temp.fit >= stats[k].fit) {
-            stats[k] = temp;
-        }
-        else {
-            stats[++k] = stats[i];
-        }
-    }
-    n = k + 1;
-    
-    if (n == 1) {
-        *fcnt = 1;
-        return 0;
-    }
-    
-    base = malloc(scnt * sizeof(base[0]));
-    if (base == NULL)
-        return 1;
-    
-    for (loops = dcnt; loops > 0; loops >>= 1) {
-        for (i = 0, k = 0; i != n; ++i) {
-            assert(stats[i].x == k);
-            k += stats[i].n;
-            base[i] = &stats[i];
-            stats[i].i = i;
-        }
-        assert( k == dcnt );
-        ksort( base, n, sizeof(base[0]), comp_fitness, NULL );
-        if (n < scnt) {
-            for (i = 0, split = 0; i != n && n + split != scnt; ++i) {
-                stats_t R;
-                stats_t L = *base[i];
-                unsigned u = L.n / 2;
-                unsigned j;
-                
-                if (u == 0)
-                    continue;
-                
-                memset(&R, 0, sizeof(R));
-                                
-                R.x = L.x + L.n - u;
-                R.n = u;
-                u = L.x + L.n;
-                for (j = R.x; j != u; ++j) {
-                    R.sx  += j;
-                    R.sxx += (double_t)j * j;
-                    R.sy  += Y[j];
-                    R.syy += (double_t)Y[j] * Y[j];
-                    R.sxy += (double_t)Y[j] * j;
-                }
-                L.sx  -= R.sx;
-                L.sxx -= R.sxx;
-                L.sy  -= R.sy;
-                L.syy -= R.syy;
-                L.sxy -= R.sxy;
-                assert(L.n > R.n);
-                L.n   -= R.n;
-                
-                L.fit = fitness( &L );
-                R.fit = fitness( &R );
-                
-                if (L.n == 1 || R.n == 1 || L.fit > base[i]->fit || R.fit > base[i]->fit) {
-                    assert(L.x + L.n == R.x);
-                    assert(L.n + R.n == stats[L.i].n);
-                    L.i = R.i = dcnt; /* invalid value */
-                    *base[i] = L;
-                    stats[n + split] = R;
-                    ++split;
-                }
-            }
-            if (split) {
-                n += split;
-                ksort( stats, n, sizeof(stats[0]), comp_position, NULL );
-                continue;
-            }
-        }
-        
-        merged = 0;
-        for (i = n; i; ) {
-            stats_t temp;
-            unsigned j;
-            
-            --i;
-            j = base[i]->i;
-            
-            if (j == n - 1 || stats[j].n == 0 || stats[j + 1].n == 0)
-                continue;
-            
-            merge(&temp, stats + j, stats + j + 1);
-            if (temp.n > 2 && temp.fit >= stats[j].fit) {
-                stats[j] = temp;
-                stats[j + 1].n = 0;
-                stats[j + 1].x = dcnt;
-                ++merged;
-            }
-        }
-        if (merged == 0)
-            break;
-        
-        for (k = 0, i = 1; i < n; ++i) {
-            if (stats[i].n)
-                stats[++k] = stats[i];
-        }
-        assert(k + 1 == n - merged);
-        n -= merged;
-    }
-    
-    *fcnt = n;
-    free(base);
-    return 0;
-}
-
-#ifndef ABS
-#define ABS(X) ((uint64_t)(X >= 0 ? (X) : (-(X))))
-#endif
-
-static
-rc_t ENCODE(uint8_t *dst, unsigned dsize, unsigned *psize, const STYPE Y[], unsigned N, int DUMP) {
-    stats_t *stats = 0;
-    unsigned m = (N + CHUNK_SIZE - 1) / CHUNK_SIZE;
-    unsigned n;
-    rc_t rc = 0;
-    unsigned i;
-    unsigned j;
-    unsigned k;
-    unsigned u;
-    unsigned v;
-    STYPE min = 0;
-    STYPE max = 0;
-    unsigned pack_size = 0;
-    szbuf zipped;
-    struct decoded decoded;
-    struct encoded encoded;
-    int debugging = 0;
-
-    if (psize)
-        *psize = 0;
-    memset(&decoded, 0, sizeof(decoded));
-
-    do {
-        stats = malloc(m * sizeof(stats[0]));
-        if (stats == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        rc = ANALYZE(stats, m, &n, Y, N, &min, &max);
-        if (rc) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        
-        if ((ABS(min) >> 8) == 0 && (ABS(max) >> 8) == 0) {
-            decoded.size_type = 0;
-            pack_size = N;
-        }
-        else if ((ABS(min) >> 16) == 0 && (ABS(max) >> 16) == 0) {
-            decoded.size_type = 1;
-            pack_size = N * 2;
-        }
-        else if ((ABS(min) >> 32) == 0 && (ABS(max) >> 32) == 0) {
-            decoded.size_type = 2;
-            pack_size = N * 4;
-        }
-        else {
-            decoded.size_type = 3;
-            pack_size = N * 8;
-        }
-        
-        decoded.diff = alloc_raw_nbuf(N);
-        if (decoded.diff == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        decoded.outlier = alloc_raw_nbuf(N);
-        if (decoded.outlier == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        decoded.type = malloc(n);
-        if (decoded.type == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        decoded.length = alloc_raw_nbuf(n);
-        if (decoded.length == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-
-        for (v = u = k = i = 0; i != n; ++i) {
-            decoded.length->data.raw[i] = stats[i].n;
-            if (stats[i].n >= OUTLIER_LIMIT) {
-                double_t M;
-                int64_t dy;
-                int64_t dx;
-                int64_t a;
-                
-                ++v;
-                regress_params(stats + i, &dy, &dx, &a);
-                M = dy / (double_t)dx;
-                for (j = 0; j != stats[i].n; ++j, ++k) {
-                    decoded.diff->data.raw[k] = Y[k] - (STYPE)(M * j + a);
-                    if (decoded.diff->min > decoded.diff->data.raw[k] || k == 0)
-                        decoded.diff->min = decoded.diff->data.raw[k];
-                    if (decoded.diff->max < decoded.diff->data.raw[k] || k == 0)
-                        decoded.diff->max = decoded.diff->data.raw[k];
-                }
-                decoded.type[i] = 0;
-            }
-            else {
-                for (j = 0; j != stats[i].n; ++j, ++k, ++u) {
-                    decoded.diff->data.raw[k] = 0;
-                    if (decoded.diff->min > 0 || k == 0)
-                        decoded.diff->min = 0;
-                    if (decoded.diff->max < 0 || k == 0)
-                        decoded.diff->max = 0;
-                    decoded.outlier->data.raw[u] = Y[k];
-                    if (decoded.outlier->min > decoded.outlier->data.raw[u] || u == 0)
-                        decoded.outlier->min = decoded.outlier->data.raw[u];
-                    if (decoded.outlier->max < decoded.outlier->data.raw[u] || u == 0)
-                        decoded.outlier->max = decoded.outlier->data.raw[u];
-                }
-                ++decoded.outliers;
-                decoded.type[i] = 1;
-            }
-        }
-        decoded.length->used = n;
-        decoded.outlier->used = u;
-        decoded.diff->used = k;
-
-        decoded.dy = alloc_raw_nbuf(v);
-        if (decoded.dy == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        decoded.dx = alloc_raw_nbuf(v);
-        if (decoded.dx == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        decoded.a = alloc_raw_nbuf(v);
-        if (decoded.a == NULL) {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-        for (u = i = 0; i < n; ++i) {
-            if (decoded.type[i] == 0) {
-                regress_params(stats + i, decoded.dy->data.raw + u, decoded.dx->data.raw + u, decoded.a->data.raw + u);
-                if (u == 0) {
-                    decoded.dy->min = decoded.dy->data.raw[u];
-                    decoded.dy->max = decoded.dy->data.raw[u];
-                    decoded.dx->min = decoded.dx->data.raw[u];
-                    decoded.dx->max = decoded.dx->data.raw[u];
-                    decoded.a->min = decoded.a->data.raw[u];
-                    decoded.a->max = decoded.a->data.raw[u];
-                }
-                else {
-                    if (decoded.dy->min > decoded.dy->data.raw[u])
-                        decoded.dy->min = decoded.dy->data.raw[u];
-                    if (decoded.dy->max < decoded.dy->data.raw[u])
-                        decoded.dy->max = decoded.dy->data.raw[u];
-                    if (decoded.dx->min > decoded.dx->data.raw[u])
-                        decoded.dx->min = decoded.dx->data.raw[u];
-                    if (decoded.dx->max < decoded.dx->data.raw[u])
-                        decoded.dx->max = decoded.dx->data.raw[u];
-                    if (decoded.a->min > decoded.a->data.raw[u])
-                        decoded.a->min = decoded.a->data.raw[u];
-                    if (decoded.a->max < decoded.a->data.raw[u])
-                        decoded.a->max = decoded.a->data.raw[u];
-                }
-                ++u;            
-            }
-        }
-        decoded.data_count = N;
-        decoded.lines = decoded.dy->used = decoded.dx->used = decoded.a->used = u;
-        
-        free(stats); stats = NULL;
-        
-        for (u = k = 0, i = 1; i < n; ++i) {
-            if (decoded.type[i] == 1 && decoded.type[k] == 1) {
-                --decoded.length->used;
-                --decoded.outliers;
-                decoded.length->data.raw[k] += decoded.length->data.raw[i];
-            }
-            else {
-                ++k;
-                if (k != i) {
-                    decoded.type[k] = decoded.type[i];
-                    decoded.length->data.raw[k] = decoded.length->data.raw[i];
-                }
-            }
-        }
-        for (i = 0; i != decoded.length->used; ++i) {
-            if (decoded.length->min > decoded.length->data.raw[i] || i == 0)
-                decoded.length->min = decoded.length->data.raw[i];
-            if (decoded.length->max < decoded.length->data.raw[i] || i == 0)
-                decoded.length->max = decoded.length->data.raw[i];
-        }
-        if (DUMP) {
-            if (N == 121) {
-                DEBUG_PRINT("Y:", 0);
-                for (i = 0; i != N; ++i)
-                    DEBUG_PRINT("    %u: %i, diff: %lli", i, (int)Y[i], decoded.diff->data.raw[i]);
-
-                DEBUG_PRINT("%u elements, %u stored, %u lines", N, decoded.outliers, decoded.lines);
-                for (i = 0; i != decoded.lines; ++i) {
-                    DEBUG_PRINT("line %u: dy: %lli; dx: %lli; a: %lli", i, decoded.dy->data.raw[i], decoded.dx->data.raw[i], decoded.a->data.raw[i]);
-                }
-            }
-            if (decoded.diff)   free(decoded.diff);
-            if (decoded.type)   free(decoded.type);
-            if (decoded.length) free(decoded.length);
-            if (decoded.dy)     free(decoded.dy);
-            if (decoded.dx)     free(decoded.dx);
-            if (decoded.a)      free(decoded.a);
-            if (decoded.outlier) free(decoded.outlier);
-                            
-            if (stats)  free(stats);
-            return 0;
-        }
-        pack_nbuf(decoded.diff);
-        pack_nbuf(decoded.length);
-        pack_nbuf(decoded.dy);
-        pack_nbuf(decoded.dx);
-        pack_nbuf(decoded.a);
-        pack_nbuf(decoded.outlier);
-        
-        rc = encode_decoded(&encoded, &decoded);
-        if (rc == 0) {
-            unsigned act_size;
-            
-            rc = serialize_encoded(dst, dsize, &act_size, &encoded);
-            /* DEBUG_PRINT("izip compress to %u bytes", act_size); */
-            if (psize)
-                *psize = act_size;
-            free_encoded(&encoded);
-        }
-    } while (0);
-    
-    if (decoded.diff)   free(decoded.diff);
-    if (decoded.type)   free(decoded.type);
-    if (decoded.length) free(decoded.length);
-    if (decoded.dy)     free(decoded.dy);
-    if (decoded.dx)     free(decoded.dx);
-    if (decoded.a)      free(decoded.a);
-    if (decoded.outlier) free(decoded.outlier);
-                            
-    if (stats)  free(stats);
-    
-    if (*psize && pack_size && (pack_size + 13) < *psize) {
-        decoded.diff = alloc_raw_nbuf(N);
-        if (decoded.diff) {
-            decoded.diff->max = max;
-            decoded.diff->min = min;
-            decoded.diff->used = N;
-            
-            switch (decoded.size_type) {
-            case 0:
-                decoded.diff->var = 4;
-                for (i = 0; i != N; ++i)
-                    decoded.diff->data.u8[i] = (uint8_t)( Y[i] - min );
-                break;
-            case 1:
-                decoded.diff->var = 3;
-                for (i = 0; i != N; ++i)
-                    decoded.diff->data.u16[i] = (uint16_t)( Y[i] - min );
-                break;
-            case 2:
-                decoded.diff->var = 2;
-                for (i = 0; i != N; ++i)
-                    decoded.diff->data.u32[i] = (uint32_t)( Y[i] - min );
-                break;
-            default:
-                decoded.diff->var = 1;
-                for (i = 0; i != N; ++i)
-                    decoded.diff->data.u64[i] = Y[i] - min;
-                break;
-            }
-            zipped.buf = malloc(zipped.size = nbuf_size(decoded.diff));
-
-            if (zipped.buf) {
-                rc_t rc2 = zlib_compress(&zipped, decoded.diff->data.u8, zipped.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-                if (rc2 == 0 && zipped.used > 0) {
-                    encoded.flags = (decoded.size_type << 2) | 3;
-                    encoded.data_count = N;
-                    encoded.u.zipped.data_size = zipped.used;
-                    encoded.u.zipped.data = zipped.buf;
-                    encoded.u.packed.min = min;
-                    rc = serialize_encoded(dst, dsize, psize, &encoded);
-/*                    DEBUG_PRINT("packed+zipped to %u bytes", *psize); */
-                    debugging = 3;
-                }
-                else {
-                    encoded.flags = (decoded.size_type << 2) | 2;
-                    encoded.data_count = N;
-                    encoded.u.packed.data_size = nbuf_size(decoded.diff);
-                    encoded.u.packed.data = decoded.diff->data.u8;
-                    encoded.u.packed.min = min;
-                    rc = serialize_encoded(dst, dsize, psize, &encoded);
-/*                    DEBUG_PRINT("packed to %u bytes", *psize); */
-                    debugging = 2;
-                }
-                free(zipped.buf);
-            }
-            else {
-                rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            }
-            free(decoded.diff);
-        }
-        else {
-            rc = RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        }
-    }
-    else {
-        /* DEBUG_PRINT("packed would have been %u", pack_size + 13); */
-    }
-
-    if (*psize) {
-        size_t bsize = N * sizeof(Y[0]);
-        assert(bsize <= UINT32_MAX);
-        zipped.buf = malloc(zipped.size = (unsigned)bsize);
-        if (zipped.buf) {
-            rc_t rc2 = zlib_compress(&zipped, Y, zipped.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-            if (rc2 == 0 && zipped.used + 5 <= *psize) {
-                encoded.flags = ((sizeof(Y[0]) == 1 ? 0 : sizeof(Y[0]) == 2 ? 1 : sizeof(Y[0]) == 4 ? 2 : 3) << 2) | 1;
-                encoded.data_count = N;
-                encoded.u.zipped.data_size = zipped.used;
-                encoded.u.zipped.data = zipped.buf;
-                rc = serialize_encoded(dst, dsize, psize, &encoded);
-                /* DEBUG_PRINT("zipped to %u bytes", *psize); */
-                debugging = 1;
-            }
-            else {
-                /* DEBUG_PRINT("zipped would have been %u", zipped.used + 5); */
-            }
-
-            free(zipped.buf);
-        }
-    }
-    /* if (debugging == 0) { */
-    /*     ENCODE(NULL, 0, NULL, Y, N, 1); */
-    /* } */
-    return rc;
-}
diff --git a/libs/vxf/izip.c b/libs/vxf/izip.c
deleted file mode 100644
index 824dca4..0000000
--- a/libs/vxf/izip.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <compiler.h>
-#include <klib/sort.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include <byteswap.h>
-#include <os-native.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-
-#include <zlib.h>
-
-#include <stdio.h>
-#include <assert.h>
-
-#include "izip-common.h"
-
-#define FTYPE double_t
-typedef struct stats_t {
-    FTYPE sy, syy, sxy;
-    FTYPE sx, sxx;
-    FTYPE fit;
-    unsigned n;
-    unsigned i;
-    unsigned x;
-} stats_t;
-
-#if 0
-static void debug_print_stats(const stats_t *st) {
-    fprintf(stderr, "sy: %lf, syy: %lf, sxy: %lf, sx: %lf, sxx: %lf, n: %u\n",
-        st->sy, st->syy, st->sxy, st->sx, st->sxx, st->n);
-}
-
-static void debug_print_data_u32(const uint32_t Y[], unsigned n) {
-    unsigned i;
-
-    for (i = 0; i != n; ++i) {
-        fprintf(stderr, "%u\n", Y[i]);
-    }
-}
-
-static void debug_print_data_u64(const uint64_t Y[], unsigned n) {
-    unsigned i;
-
-    for (i = 0; i != n; ++i) {
-        fprintf(stderr, "%ju\n", Y[i]);
-    }
-}
-#endif
-
-static FTYPE fitness( const stats_t *st)
-{
-    double_t var_xy = st->sxy - st->sx * st->sy / (double_t)st->n;
-    double_t var_x  = st->sxx - st->sx * st->sx / (double_t)st->n;
-    double_t var_y  = st->syy - st->sy * st->sy / (double_t)st->n;
-    
-    if (st->n <= 2)
-        return 1.0;
-    if (var_y == 0.0)
-        return 1.0;
-    if (var_xy != 0.0) {
-        if (var_x != 0.0) {
-            double_t fit = (var_xy / var_x) * (var_xy / var_y);
-            assert(-1.0 <= fit && fit <= 1.0);
-            return fit;
-        }
-    }
-    return 0.0;
-}
-
-static void regress_params(const stats_t *st, int64_t *dy, int64_t *dx, int64_t *a) {
-    double_t beta = (st->sxy - st->sx * st->sy / st->n) / ((double_t)st->n * (st->n - 1) * (st->n + 1) / 12.0);
-    double_t beta2;
-    int sgn = 1;
-    
-    if (beta < 0) {
-        beta = -beta;
-        sgn = -1;
-    }
-    if (beta > 0 && beta < 1) {
-        *dy = sgn * UINT16_MAX;
-        *dx = (int64_t)( UINT16_MAX / beta );
-    }
-    else if (beta < (UINT64_MAX / UINT16_MAX)) {
-        *dy = (int64_t)( sgn * beta * UINT16_MAX );
-        *dx = UINT16_MAX;
-    }
-    else {
-        *dy = (int64_t)( sgn * beta );
-        *dx = 1;
-    }
-    beta2 = (double_t)*dy / *dx;
-    *a = (int64_t)( (st->sy / st->n) - beta2 * (st->n - 1) / 2 );
-    
-    return;
-}
-
-typedef struct {
-    unsigned size;
-    unsigned used;
-    void *buf;
-} szbuf;
-
-static void pack_nbuf8(nbuf *x) {
-    unsigned i;
-    const unsigned n = x->used;
-    
-    for (i = 0; i != n; ++i)
-        x->data.u8[i] = (uint8_t)( x->data.raw[i] - x->min );
-    x->var = 4;
-}
-
-static void pack_nbuf16(nbuf *x) {
-    unsigned i;
-    const unsigned n = x->used;
-    
-    for (i = 0; i != n; ++i)
-        x->data.u16[i] = (uint16_t)( x->data.raw[i] - x->min );
-    x->var = 3;
-}
-
-static void pack_nbuf32(nbuf *x) {
-    unsigned i;
-    const unsigned n = x->used;
-    
-    for (i = 0; i != n; ++i)
-        x->data.u32[i] = (uint32_t)( x->data.raw[i] - x->min );
-    x->var = 2;
-}
-
-static void pack_nbuf(nbuf *x) {
-    if ((x->max - x->min) >> 8 == 0) {
-        pack_nbuf8(x);
-    }
-    else if ((x->max - x->min) >> 16 == 0) {
-        pack_nbuf16(x);
-    }
-    else if ((x->max - x->min) >> 32 == 0) {
-        pack_nbuf32(x);
-    }
-    else {
-        unsigned i;
-        const unsigned n = x->used;
-        
-        for (i = 0; i != n; ++i)
-            x->data.u64[i] = x->data.raw[i] - x->min;
-        x->var = 1;
-    }
-}
-
-static rc_t zlib_compress(szbuf *dst, const void *src, uint32_t ssize, int32_t strategy, int32_t level) {
-    z_stream s;
-    int zr;
-    rc_t rc = 0;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst->buf;
-    s.avail_out = (uInt)dst->size;
-    
-    dst->used = 0;
-    
-    zr = deflateInit2(&s, level, Z_DEFLATED, -15, 9, strategy);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    case Z_STREAM_ERROR:
-        return RC(rcVDB, rcFunction, rcExecuting, rcParam, rcInvalid);
-    default:
-        return RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-    zr = deflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-        break;
-    case Z_OK:
-        s.total_out = 0;
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-        break;
-    }
-    zr = deflateEnd(&s);
-    if (zr != Z_OK)
-        rc = RC(rcVDB, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    if (rc == 0) {
-        assert(s.total_out <= UINT32_MAX);
-        dst->used = (uint32_t)s.total_out;
-    }
-    return rc;
-}
-
-static
-void encode_types(uint8_t *packed, const uint8_t type[], unsigned n) {
-    unsigned i;
-    unsigned j;
-    unsigned k;
-    
-    for (i = k = 0, j = 1; i != n; ++i) {
-        if (type[i])
-            k |= j;
-        j <<= 1;
-        if (j == 0x100) {
-            j = 1;
-            packed[i / 8] = k;
-            k = 0;
-        }
-    }
-    packed[i / 8] = k;
-}
-
-static rc_t encode_decoded(struct encoded *y, const struct decoded *x) {
-    rc_t rc = 0;
-    uint8_t *temp;
-    unsigned temp_size;
-    szbuf zbuf;
-    
-    memset(y, 0, sizeof(*y));
-    y->flags = x->size_type << 2;
-    y->data_count = x->data_count;
-    y->u.izipped.segments = x->lines + x->outliers;
-    y->u.izipped.outliers = x->outliers ? x->outlier->used : 0;
-    
-    y->u.izipped.min_diff = x->diff->min;
-    y->u.izipped.min_length = x->length->min;
-    y->u.izipped.min_dy = x->dy->min;
-    y->u.izipped.min_dx = x->dx->min;
-    y->u.izipped.min_a = x->a->min;
-    y->u.izipped.min_outlier = x->outlier->min;
-    
-    if (x->outliers) {
-        temp = malloc((temp_size = (x->lines + x->outliers + 7) / 8) + 1);
-        if (temp == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-
-        encode_types(temp, x->type, x->lines + x->outliers);
-        
-        zbuf.buf = malloc(zbuf.size = temp_size);
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-
-        zbuf.used = 0;
-        rc = zlib_compress(&zbuf, temp, temp_size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            free(temp);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            free(temp);
-            SET_TYPE_ZIPPED(y->u.izipped);
-            y->u.izipped.type = zbuf.buf;
-            y->u.izipped.type_size = zbuf.used;
-        }
-        else {
-            free(zbuf.buf);
-            y->u.izipped.type = temp;
-            y->u.izipped.type_size = temp_size;
-        }
-    }
-    else {
-        SET_TYPE_ABSENT(y->u.izipped);
-        SET_OUTLIER_ABSENT(y->u.izipped);
-        y->u.izipped.type_size = 0;
-    }
-
-    if (x->diff->min == x->diff->max) {
-        SET_DIFF_CONSTANT(y->u.izipped);
-        y->u.izipped.diff_size = x->diff->used;
-    }
-    else {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->diff));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->diff->data, zbuf.size, Z_FILTERED, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_DIFF_ZIPPED(y->u.izipped);
-            y->u.izipped.diff = zbuf.buf;
-            y->u.izipped.diff_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.diff = x->diff->data.u8;
-            y->u.izipped.diff_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    if (x->length->min == x->length->max) {
-        SET_LENGTH_CONSTANT(y->u.izipped);
-        y->u.izipped.length_size = x->length->used;
-    }
-    else {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->length));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->length->data, zbuf.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_LENGTH_ZIPPED(y->u.izipped);
-            y->u.izipped.length = zbuf.buf;
-            y->u.izipped.length_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.length = x->length->data.u8;
-            y->u.izipped.length_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    if (x->dy->min == x->dy->max) {
-        SET_DY_CONSTANT(y->u.izipped);
-        y->u.izipped.dy_size = x->dy->used;
-    }
-    else {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->dy));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->dy->data, zbuf.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_DY_ZIPPED(y->u.izipped);
-            y->u.izipped.dy = zbuf.buf;
-            y->u.izipped.dy_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.dy = x->dy->data.u8;
-            y->u.izipped.dy_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    if (x->dx->min == x->dx->max) {
-        SET_DX_CONSTANT(y->u.izipped);
-        y->u.izipped.dx_size = x->dx->used;
-    }
-    else {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->dx));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->dx->data, zbuf.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_DX_ZIPPED(y->u.izipped);
-            y->u.izipped.dx = zbuf.buf;
-            y->u.izipped.dx_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.dx = x->dx->data.u8;
-            y->u.izipped.dx_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    if (x->a->min == x->a->max) {
-        SET_A_CONSTANT(y->u.izipped);
-        y->u.izipped.a_size = x->a->used;
-    }
-    else {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->a));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->a->data, zbuf.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_A_ZIPPED(y->u.izipped);
-            y->u.izipped.a = zbuf.buf;
-            y->u.izipped.a_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.a = x->a->data.u8;
-            y->u.izipped.a_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    if (x->outliers != 0) {
-        zbuf.buf = malloc(zbuf.size = nbuf_size(x->outlier));
-        if (zbuf.buf == NULL)
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        zbuf.used = 0;
-        
-        rc = zlib_compress(&zbuf, &x->outlier->data, zbuf.size, Z_DEFAULT_STRATEGY, Z_BEST_SPEED);
-        if (rc) {
-            free(zbuf.buf);
-            return rc;
-        }
-        if (zbuf.used > 0 && zbuf.used < zbuf.size) {
-            SET_OUTLIER_ZIPPED(y->u.izipped);
-            y->u.izipped.outlier = zbuf.buf;
-            y->u.izipped.outlier_size = zbuf.used;
-        }
-        else {
-            y->u.izipped.outlier = x->outlier->data.u8;
-            y->u.izipped.outlier_size = zbuf.size;
-            free(zbuf.buf);
-        }
-    }
-    
-    return 0;
-}
-
-static void free_encoded(const struct encoded *self) {
-    switch (self->flags & 3) {
-    case 0:
-        if (FLAG_OUTLIER(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.outlier);
-        if (FLAG_A(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.a);
-        if (FLAG_DX(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.dx);
-        if (FLAG_DY(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.dy);
-        if (FLAG_LENGTH(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.length);
-        if (FLAG_DIFF(self->u.izipped) == DATA_ZIPPED)
-            free((void *)self->u.izipped.diff);
-        if (FLAG_TYPE(self->u.izipped) != DATA_ABSENT)
-            free((void *)self->u.izipped.type);
-        break;
-    default:
-        break;
-    }
-}
-
-#define SERIALZE16(X) do { if (i + 2 > dsize) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient); memcpy(dst + i, &x->u.izipped.X, 2); i += 2; } while(0)
-#define SERIALZE32(X) do { if (i + 4 > dsize) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient); memcpy(dst + i, &x->u.izipped.X, 4); i += 4; } while(0)
-#define SERIALZE64(X) do { if (i + 8 > dsize) return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient); memcpy(dst + i, &x->u.izipped.X, 8); i += 8; } while(0)
-
-static
-rc_t serialize_encoded(uint8_t *dst, unsigned dsize, unsigned *psize, const struct encoded *x) {
-    unsigned i = 0;
-   
-    *psize = 0;
-
-    if (i + 1 > dsize)
-        return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);    
-    dst[i] = x->flags; i += 1;
-    
-    if (i + 4 > dsize)
-        return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);    
-    memcpy(dst + i, &x->data_count, 4); i += 4;
-
-    switch (x->flags & 0x03) {
-    case 3:
-    case 2:
-        if (i + 8 > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);    
-        memcpy(dst + i, &x->u.packed.min, 8); i += 8;
-        /* fall thru */
-    case 1:
-        if (i + x->u.zipped.data_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);    
-        memcpy(dst + i, x->u.zipped.data, x->u.zipped.data_size); i += x->u.zipped.data_size;
-        *psize = i;
-        return 0;
-    default:
-        break;
-    }
-    
-    SERIALZE32(data_flags);
-    SERIALZE32(segments);
-    SERIALZE32(outliers);
-    SERIALZE32(type_size);
-    SERIALZE32(diff_size);
-    SERIALZE32(length_size);
-    SERIALZE32(dy_size);
-    SERIALZE32(dx_size);
-    SERIALZE32(a_size);
-    SERIALZE32(outlier_size);
-
-    SERIALZE64(min_diff);
-    SERIALZE64(min_length);
-    SERIALZE64(min_dy);
-    SERIALZE64(min_dx);
-    SERIALZE64(min_a);
-    SERIALZE64(min_outlier);
-    
-    if (FLAG_TYPE(x->u.izipped) != DATA_ABSENT && FLAG_TYPE(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.type_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.type, x->u.izipped.type_size); i += x->u.izipped.type_size;
-    }
-    
-    if (FLAG_DIFF(x->u.izipped) != DATA_ABSENT && FLAG_DIFF(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.diff_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.diff, x->u.izipped.diff_size); i += x->u.izipped.diff_size;
-    }
-    
-    if (FLAG_LENGTH(x->u.izipped) != DATA_ABSENT && FLAG_LENGTH(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.length_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.length, x->u.izipped.length_size); i += x->u.izipped.length_size;
-    }
-    
-    if (FLAG_DY(x->u.izipped) != DATA_ABSENT && FLAG_DY(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.dy_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.dy, x->u.izipped.dy_size); i += x->u.izipped.dy_size;
-    }
-    
-    if (FLAG_DX(x->u.izipped) != DATA_ABSENT && FLAG_DX(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.dx_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.dx, x->u.izipped.dx_size); i += x->u.izipped.dx_size;
-    }
-    
-    if (FLAG_A(x->u.izipped) != DATA_ABSENT && FLAG_A(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.a_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.a, x->u.izipped.a_size); i += x->u.izipped.a_size;
-    }
-    
-    if (FLAG_OUTLIER(x->u.izipped) != DATA_ABSENT && FLAG_OUTLIER(x->u.izipped) != DATA_CONSTANT) {
-        if (i + x->u.izipped.outlier_size > dsize)
-            return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        memcpy(dst + i, x->u.izipped.outlier, x->u.izipped.outlier_size); i += x->u.izipped.outlier_size;
-    }
-    
-    *psize = i;
-    return 0;
-}
-
-static int CC comp_position(const void *A, const void *B, void * ignored) {
-    const stats_t *a = A;
-    const stats_t *b = B;
-    
-    return a->x - b->x;
-}
-
-static int CC comp_fitness(const void *A, const void *B, void * ignored) {
-    const stats_t **a = (const stats_t **)A;
-    const stats_t **b = (const stats_t **)B;
-    
-    return (**a).fit < (**b).fit ? -1 : (**b).fit < (**a).fit ? 1 : (**a).i - (**b).i;
-}
-
-static void merge(stats_t *dst, const stats_t *L, const stats_t *R) {
-    stats_t temp = *L;
-    
-    temp.sx  += R->sx;
-    temp.sxx += R->sxx;
-    temp.sy  += R->sy;
-    temp.syy += R->syy;
-    temp.sxy += R->sxy;
-    temp.n   += R->n;
-    temp.fit  = fitness( &temp );
-    
-    *dst = temp;
-}
-
-#define OUTLIER_LIMIT (12)
-#define CHUNK_SIZE (16)
-#define SANITY_CHECK 1
-
-/* for signed operations */
-#define ABS(X) ((uint64_t)(X >= 0 ? (X) : (-(X))))
-
-#define STYPE int8_t
-#define ANALYZE analyze_i8
-#define ENCODE encode_i8
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE int16_t
-#define ANALYZE analyze_i16
-#define ENCODE encode_i16
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE int32_t
-#define ANALYZE analyze_i32
-#define ENCODE encode_i32
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE int64_t
-#define ANALYZE analyze_i64
-#define ENCODE encode_i64
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-
-/* for unsigned operations */
-#undef ABS
-#define ABS(X) ((uint64_t)(X))
-
-#define STYPE uint8_t
-#define ANALYZE analyze_u8
-#define ENCODE encode_u8
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE uint16_t
-#define ANALYZE analyze_u16
-#define ENCODE encode_u16
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE uint32_t
-#define ANALYZE analyze_u32
-#define ENCODE encode_u32
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-#define STYPE uint64_t
-#define ANALYZE analyze_u64
-#define ENCODE encode_u64
-#include "izip-encode.impl.h"
-#undef STYPE
-#undef ANALYZE
-#undef ENCODE
-
-typedef rc_t (*encode_f)(uint8_t *dst, unsigned dsize, unsigned *psize, const void *Y, unsigned N, int DUMP);
-
-struct self_t {
-    encode_f f;
-};
-
-static
-struct self_t selfs[8] = {
-    { (encode_f)encode_u8 },
-    { (encode_f)encode_i8 },
-    { (encode_f)encode_u16 },
-    { (encode_f)encode_i16 },
-    { (encode_f)encode_u32 },
-    { (encode_f)encode_i32 },
-    { (encode_f)encode_u64 },
-    { (encode_f)encode_i64 },
-};
-
-rc_t ex_encode8( void *dst, unsigned dsize, uint8_t *src,
-                 unsigned ssize_in_u8, unsigned *written )
-{
-    return selfs[0].f( dst, dsize, written, src, ssize_in_u8, 0 );
-}
-
-rc_t ex_encode16( void *dst, unsigned dsize, uint16_t *src,
-                  unsigned ssize_in_u16, unsigned *written )
-{
-    return selfs[2].f( dst, dsize, written, src, ssize_in_u16, 0 );
-}
-
-rc_t ex_encode32( void *dst, unsigned dsize, uint32_t *src,
-                  unsigned ssize_in_u32, unsigned *written )
-{
-    return selfs[4].f( dst, dsize, written, src, ssize_in_u32, 0 );
-}
-
-rc_t ex_encode64( void *dst, unsigned dsize, uint64_t *src,
-                  unsigned ssize_in_u64, unsigned *written )
-{
-    return selfs[6].f( dst, dsize, written, src, ssize_in_u64, 0 );
-}
-
-static
-rc_t CC izip(
-               void *Self,
-               const VXformInfo *info,
-               VBlobResult *dst,
-               const VBlobData *src,
-               VBlobHeader *hdr
-) {
-    rc_t rc = 0;
-    const struct self_t *self = Self;
-    uint32_t dsize;
-    
-    VBlobHeaderSetVersion(hdr, 0);
-
-    assert(src->elem_count >> 32 == 0);
-    assert(((dst->elem_count * dst->elem_bits + 7) >> 3) >> 32 == 0);
-    dsize = (uint32_t)((dst->elem_count * dst->elem_bits + 7) >> 3);
-    rc = self->f(dst->data, (uint32_t)dsize, &dsize, src->data, (uint32_t)src->elem_count, 0);
-    if (dsize && rc == 0) {
-        dst->byte_order = vboNative;
-        dst->elem_bits = 1;
-        dst->elem_count = dsize << 3;
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-}
-
-#if 0
-/* 
- function izip_fmt izip #1.0 ( izip_set in )
- */
-VTRANSFACT_IMPL(vdb_izip, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    if (dp->argc != 1) {
-#if _DEBUGGING
-        fprintf(stderr, "dp->argc = %u != 1\n", dp->argc);
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    rslt->variant = vftBlob;
-    rslt->u.bf = izip;
-
-    switch (dp->argv[0].desc.domain) {
-    case vtdInt:
-        switch (dp->argv[0].desc.intrinsic_bits) {
-        case 8:
-            rslt->self = &selfs[1];
-            break;
-        case 16:
-            rslt->self = &selfs[3];
-            break;
-        case 32:
-            rslt->self = &selfs[5];
-            break;
-        case 64:
-            rslt->self = &selfs[7];
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", dp->argv[0].desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    case vtdUint:
-        switch (dp->argv[0].desc.intrinsic_bits) {
-        case 8:
-            rslt->self = &selfs[0];
-            break;
-        case 16:
-            rslt->self = &selfs[2];
-            break;
-        case 32:
-            rslt->self = &selfs[4];
-            break;
-        case 64:
-            rslt->self = &selfs[6];
-            break;
-        default:
-#if _DEBUGGING
-            fprintf(stderr, "intrinsic_bits = %u != (8|16|32|64)\n", dp->argv[0].desc.intrinsic_bits);
-#endif
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            break;
-        }
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "domain != vtdInt or vtdUint\n");
-#endif
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    return 0;
-}
-#endif
-
-#if TESTING
-extern int test_decode(int32_t *, unsigned, const uint8_t *, unsigned, int);
-
-int test_encode(const int32_t Y[], unsigned N) {
-    uint8_t *dst;
-    unsigned dsize;
-    size_t temp;
-    rc_t rc = 0;
-    
-    temp = N * sizeof(Y[0]);
-    assert(temp >> 32 == 0);
-    dst = malloc(dsize = (unsigned)temp);
-    if (dst == NULL)
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    rc = encode_i32(dst, dsize, &dsize, Y, N, 0);
-
-    {
-        int32_t *X;
-        
-        X = malloc(N * sizeof(Y[0]));
-        if (X) {
-            rc = test_decode(X, N, dst, dsize, 0);
-            if (rc == 0) {
-                rc = memcmp(Y, X, N * sizeof(Y[0])) == 0 ? 0 : RC(rcXF, rcFunction, rcExecuting, rcFunction, rcInvalid);
-            }
-            free(X);
-        }
-    }
-
-    free(dst);
-    if (rc)
-        fprintf(stdout, "test failed!\n");
-    return rc;
-}
-#endif
diff --git a/libs/vxf/libvxf.vers b/libs/vxf/libvxf.vers
deleted file mode 100644
index 2bf1ca5..0000000
--- a/libs/vxf/libvxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.7
diff --git a/libs/vxf/libwvxf.vers b/libs/vxf/libwvxf.vers
deleted file mode 100644
index 0664a8f..0000000
--- a/libs/vxf/libwvxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.1.6
diff --git a/libs/vxf/lower-case-tech-reads.c b/libs/vxf/lower-case-tech-reads.c
deleted file mode 100644
index 9f9e911..0000000
--- a/libs/vxf/lower-case-tech-reads.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <insdc/insdc.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-
-static
-rc_t CC lower_case_tech_reads ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    uint32_t i, j, k;
-
-    char *mixed;
-    const char *read_text = argv [ 0 ] . u . data . base;
-    const INSDC_coord_len *read_len = argv [ 1 ] . u . data . base;
-    const INSDC_read_type *read_type = argv [ 2 ] . u . data . base;
-
-    rc_t rc = KDataBufferResize ( rslt -> data, argv [ 0 ] . u . data . elem_count );
-    if ( rc != 0 )
-        return rc;
-
-    rslt -> elem_count = argv [ 0 ] . u . data . elem_count;
-
-    mixed = rslt -> data -> base;
-    read_text += argv [ 0 ] . u . data . first_elem;
-    read_len += argv [ 1 ] . u . data . first_elem;
-    read_type += argv [ 2 ] . u . data . first_elem;
-
-    for ( i = j = 0; i < argv [ 0 ] . u . data . elem_count; ++ j )
-    {
-        /* should still have reads described */
-        if ( j == argv [ 1 ] . u . data . elem_count || j == argv [ 2 ] . u . data . elem_count )
-            break;
-
-        /* get read length */
-        k = read_len [ j ];
-        if ( i + k > argv [ 0 ] . u . data . elem_count )
-            k = argv [ 0 ] . u . data . elem_count - i;
-
-        /* decide upon upper or lower case */
-        if ( ( read_type [ j ] & 1 ) != READ_TYPE_BIOLOGICAL )
-        {
-            for ( ; k > 0; ++ i, -- k )
-                mixed [ i ] = tolower ( read_text [ i ] );
-        }
-        else
-        {
-            for ( ; k > 0; ++ i, -- k )
-                mixed [ i ] = toupper ( read_text [ i ] );
-        }
-    }
-
-    for ( ; i < argv [ 0 ] . u . data . elem_count; ++ i )
-        mixed [ i ] = toupper ( read_text [ i ] );
-
-    return 0;
-}
-
-
-/* lower_case_tech_reads
- *  locates technical reads within an IUPAC sequence
- *  converts them to lower-case
- *
- *  "read_text" [ DATA ] - IUPAC source text
- *
- *  "read_len" [ DATA ] - ordered array of read lengths
- *
- *  "read_type" [ DATA ] - describes which reads are technical
- *  and which are biological. determines the case of each read segment
- *
- * extern function
- * INSDC:dna:mixed_case:text NCBI:lower_case_tech_reads #1 ( INSDC:dna:text read_text,
- *     INSDC:coord:len read_len, INSDC:read:type read_type );
- */
-VTRANSFACT_IMPL ( NCBI_lower_case_tech_reads, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = lower_case_tech_reads;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/vxf/map.c b/libs/vxf/map.c
deleted file mode 100644
index ab7c25c..0000000
--- a/libs/vxf/map.c
+++ /dev/null
@@ -1,1019 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* LOOP TYPES
- *  this function can be characterized by its loops
- *
- *  1) single-input that is type-compatible with the output
- *     functions like the unix command "tr" by allowing all
- *     input to pass through, except those matching the "from"
- *     array, which are changed to the corresponding entry in
- *     the "to" array.
- *
- *  2) single-input that is NOT type-compatible with output
- *     functions like a type transformation where ALL input
- *     must be transformed, i.e. there can be no pass through.
- *     this loop requires detection of any unspecified input
- *     and results in an error.
- *
- *  3) dual-input that combines the other two loops, in a sense.
- *     it is like the first loop type in that there are no
- *     points of failure, and like the second in that it has
- *     to test for matches against the "from" array. its exact
- *     behavior is to pass values from the second input to the
- *     output unchanged, unless the corresponding value from the
- *     first input matches anything in the "from" table, in which
- *     case the corresponding "to" value is substituted to dest.
- */
-
-
-/* type 1: 8-bit to 8-bit map
- *  this is our principal workhorse
- *  there are no points of failure
- *  the map is built initially for identity
- *  and overridden to perform substitutions indicated
- */
-static
-rc_t CC type1_uint8_t ( void *self, const VXformInfo *info,
-    void *vdst, const void *vsrc, uint64_t elem_count )
-{
-    const uint8_t *map = ( const void* ) self;
-    const uint8_t *src = vsrc;
-    uint8_t *dst = vdst;
-
-    uint64_t i;
-    for ( i = 0; i < elem_count; ++ i )
-        dst [ i ] = map [ src [ i ] ];
-
-    return 0;
-}
-
-static
-rc_t make_type1_uint8_t ( void **selfp, const uint8_t *from, const uint8_t *to, uint32_t map_len )
-{
-    uint32_t i;
-
-    uint8_t *map = malloc ( 256 );
-    if ( map == NULL )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    for ( i = 0; i < 256; ++ i )
-        map [ i ] = ( uint8_t ) i;
-
-    for ( i = 0; i < map_len; ++ i )
-        map [ from [ i ] ] = to [ i ];
-
-    * selfp = map;
-    return 0;
-}
-
-
-/* map_t
- *  a structure that holds "from" and "to" arrays
- */
-typedef struct map_t map_t;
-struct map_t
-{
-#if _DEBUGGING
-    /* array function for type 1 and 2 loops */
-    VArrayFunc array;
-#endif
-
-    /* row function for type 3 loops */
-    void ( * row ) ( const map_t *self, void *dst,
-        const void *src, const void *tst, uint64_t elem_count );
-
-    /* map length */
-    uint32_t map_len;
-    uint32_t align;
-
-    /* ordered "from" array and corresponding "to" array */
-    const void *from, * to;
-};
-
-
-/* type 1: linear map
- *  when the arrays are so short as to not benefit from binary search
- */
-#define TYPE1_LINEAR_MAP( TYPE )                                \
-static                                                          \
-rc_t CC type1_linear_ ## TYPE ( void *vself,                    \
-    const VXformInfo *info, void *vdst, const void *vsrc,       \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const map_t *self = ( const void* ) vself;                  \
-                                                                \
-    const TYPE *src = vsrc;                                     \
-    TYPE *dst = vdst;                                           \
-                                                                \
-    const TYPE *from = self -> from;                            \
-    const TYPE *to = self -> to;                                \
-                                                                \
-    uint64_t i;                                                 \
-    uint32_t j, map_len = self -> map_len;                      \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        TYPE elem = dst [ i ] = src [ i ];                      \
-        for ( j = 0; j < map_len; ++ j )                        \
-        {                                                       \
-            if ( from [ j ] == elem )                           \
-            {                                                   \
-                dst [ i ] = to [ j ];                           \
-                break;                                          \
-            }                                                   \
-        }                                                       \
-    }                                                           \
-                                                                \
-    return 0;                                                   \
-}
-
-TYPE1_LINEAR_MAP ( uint16_t )
-TYPE1_LINEAR_MAP ( uint32_t )
-TYPE1_LINEAR_MAP ( uint64_t )
-TYPE1_LINEAR_MAP ( float )
-TYPE1_LINEAR_MAP ( double )
-
-static VArrayFunc type1_linear_funcs [ 5 ] =
-{
-    type1_linear_uint16_t,
-    type1_linear_uint32_t,
-    type1_linear_uint64_t,
-    type1_linear_float,
-    type1_linear_double
-};
-
-
-/* type 1: binary map
- *  when the arrays are long enough to warrant binary search
- */
-#define TYPE1_BINARY_MAP( TYPE )                                \
-static                                                          \
-rc_t CC type1_binary_ ## TYPE ( void *vself,                    \
-    const VXformInfo *info, void *vdst, const void *vsrc,       \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const map_t *self = ( const void* ) vself;                  \
-                                                                \
-    const TYPE *src = vsrc;                                     \
-    TYPE *dst = vdst;                                           \
-                                                                \
-    const TYPE *from = self -> from;                            \
-    const TYPE *to = self -> to;                                \
-                                                                \
-    uint64_t i;                                                 \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        TYPE elem = dst [ i ] = src [ i ];                      \
-                                                                \
-        uint32_t lower = 0, upper = self -> map_len;            \
-        while ( lower < upper )                                 \
-        {                                                       \
-            uint32_t j = ( lower + upper ) >> 1;                \
-            TYPE cur = from [ j ];                              \
-            if ( elem == cur )                                  \
-            {                                                   \
-                dst [ i ] = to [ j ];                           \
-                break;                                          \
-            }                                                   \
-            if ( elem < cur )                                   \
-                upper = j;                                      \
-            else                                                \
-                lower = j + 1;                                  \
-        }                                                       \
-    }                                                           \
-                                                                \
-    return 0;                                                   \
-}
-
-TYPE1_BINARY_MAP ( uint16_t )
-TYPE1_BINARY_MAP ( uint32_t )
-TYPE1_BINARY_MAP ( uint64_t )
-TYPE1_BINARY_MAP ( float )
-TYPE1_BINARY_MAP ( double )
-
-static VArrayFunc type1_binary_funcs [ 5 ] =
-{
-    type1_binary_uint16_t,
-    type1_binary_uint32_t,
-    type1_binary_uint64_t,
-    type1_binary_float,
-    type1_binary_double
-};
-
-/* type 2: 8-bit to N-bit
- *  allowed to perform a lookup test
- */
-#define TYPE2_8BIT_MAP( DTYPE )                                 \
-static                                                          \
-rc_t CC type2_uint8_t_to_ ## DTYPE ( void *vself,               \
-    const VXformInfo *info, void *vdst, const void *vsrc,       \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const map_t *self = ( const void* ) vself;                  \
-                                                                \
-    const uint8_t *src = vsrc;                                  \
-    DTYPE *dst = vdst;                                          \
-                                                                \
-    const uint8_t *from = self -> from;                         \
-    const DTYPE *to = self -> to;                               \
-                                                                \
-    uint64_t i;                                                 \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        int j = src [ i ];                                      \
-        if ( ! from [ j ] )                                     \
-        {                                                       \
-            return RC ( rcVDB, rcFunction, rcExecuting,         \
-                       rcConstraint, rcViolated );              \
-        }                                                       \
-        dst [ i ] = to [ j ];                                   \
-    }                                                           \
-                                                                \
-    return 0;                                                   \
-}
-
-TYPE2_8BIT_MAP ( uint8_t )
-TYPE2_8BIT_MAP ( uint16_t )
-TYPE2_8BIT_MAP ( uint32_t )
-TYPE2_8BIT_MAP ( uint64_t )
-
-/* type2: binary map
- *  due to the combinatorial explosion,
- *  just implement the binary version
- */
-#define TYPE2_BINARY_MAP( STYPE, DTYPE )                        \
-static                                                          \
-rc_t CC type2_ ## STYPE ## _to_ ## DTYPE ( void *vself,         \
-    const VXformInfo *info, void *vdst, const void *vsrc,       \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const map_t *self = ( const void* ) vself;                  \
-                                                                \
-    const STYPE *src = vsrc;                                    \
-    DTYPE *dst = vdst;                                          \
-                                                                \
-    const STYPE *from = self -> from;                           \
-    const DTYPE *to = self -> to;                               \
-                                                                \
-    uint64_t i;                                                 \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        STYPE cur, elem = src [ i ];                            \
-                                                                \
-        uint32_t j, lower = 0, upper = self -> map_len;         \
-        while ( lower < upper )                                 \
-        {                                                       \
-            j = ( lower + upper ) >> 1;                         \
-            cur = from [ j ];                                   \
-            if ( elem == cur )                                  \
-                goto FOUND;                                     \
-            if ( elem < cur )                                   \
-                upper = j;                                      \
-            else                                                \
-                lower = j + 1;                                  \
-        }                                                       \
-        return RC( rcVDB, rcFunction, rcExecuting,              \
-                   rcConstraint, rcViolated );                  \
-FOUND:                                                          \
-        dst [ i ] = to [ j ];                                   \
-    }                                                           \
-                                                                \
-    return 0;                                                   \
-}
-
-TYPE2_BINARY_MAP ( uint16_t, uint8_t )
-TYPE2_BINARY_MAP ( uint16_t, uint16_t )
-TYPE2_BINARY_MAP ( uint16_t, uint32_t )
-TYPE2_BINARY_MAP ( uint16_t, uint64_t )
-
-TYPE2_BINARY_MAP ( uint32_t, uint8_t )
-TYPE2_BINARY_MAP ( uint32_t, uint16_t )
-TYPE2_BINARY_MAP ( uint32_t, uint32_t )
-TYPE2_BINARY_MAP ( uint32_t, uint64_t )
-
-TYPE2_BINARY_MAP ( uint64_t, uint8_t )
-TYPE2_BINARY_MAP ( uint64_t, uint16_t )
-TYPE2_BINARY_MAP ( uint64_t, uint32_t )
-TYPE2_BINARY_MAP ( uint64_t, uint64_t )
-
-TYPE2_BINARY_MAP ( float, uint8_t )
-TYPE2_BINARY_MAP ( float, uint16_t )
-TYPE2_BINARY_MAP ( float, uint32_t )
-TYPE2_BINARY_MAP ( float, uint64_t )
-
-TYPE2_BINARY_MAP ( double, uint8_t )
-TYPE2_BINARY_MAP ( double, uint16_t )
-TYPE2_BINARY_MAP ( double, uint32_t )
-TYPE2_BINARY_MAP ( double, uint64_t )
-
-static VArrayFunc type2_funcs [ 6 ] [ 4 ] =
-{
-    /* uint8_t */
-    {
-        type2_uint8_t_to_uint8_t,
-        type2_uint8_t_to_uint16_t,
-        type2_uint8_t_to_uint32_t,
-        type2_uint8_t_to_uint64_t
-    },
-
-    /* uint16_t */
-    {
-        type2_uint16_t_to_uint8_t,
-        type2_uint16_t_to_uint16_t,
-        type2_uint16_t_to_uint32_t,
-        type2_uint16_t_to_uint64_t
-    },
-
-    /* uint32_t */
-    {
-        type2_uint32_t_to_uint8_t,
-        type2_uint32_t_to_uint16_t,
-        type2_uint32_t_to_uint32_t,
-        type2_uint32_t_to_uint64_t
-    },
-
-    /* uint64_t */
-    {
-        type2_uint64_t_to_uint8_t,
-        type2_uint64_t_to_uint16_t,
-        type2_uint64_t_to_uint32_t,
-        type2_uint64_t_to_uint64_t
-    },
-
-    /* float */
-    {
-        type2_float_to_uint8_t,
-        type2_float_to_uint16_t,
-        type2_float_to_uint32_t,
-        type2_float_to_uint64_t
-    },
-
-    /* double */
-    {
-        type2_double_to_uint8_t,
-        type2_double_to_uint16_t,
-        type2_double_to_uint32_t,
-        type2_double_to_uint64_t
-    }
-};
-
-
-/* type 3: 8-bit to N-bit
- *  allowed to perform a lookup test
- */
-#define TYPE3_8BIT_MAP( DTYPE )                                 \
-static                                                          \
-void type3_uint8_t_to_ ## DTYPE ( const map_t *self,            \
-    void *vdst, const void *vsrc, const void *vtst,             \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const uint8_t *tst = vtst;                                  \
-    const DTYPE *src = vsrc;                                    \
-    DTYPE *dst = vdst;                                          \
-                                                                \
-    const uint8_t *from = self -> from;                         \
-    const DTYPE *to = self -> to;                               \
-                                                                \
-    uint64_t i;                                                 \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        int j = tst [ i ];                                      \
-        dst [ i ] = src [ i ];                                  \
-        if ( from [ j ] )                                       \
-            dst [ i ] = to [ j ];                               \
-    }                                                           \
-}
-
-TYPE3_8BIT_MAP ( uint8_t )
-TYPE3_8BIT_MAP ( uint16_t )
-TYPE3_8BIT_MAP ( uint32_t )
-TYPE3_8BIT_MAP ( uint64_t )
-
-/* type3: binary map
- *  due to the combinatorial explosion,
- *  just implement the binary version
- */
-#define TYPE3_BINARY_MAP( STYPE, DTYPE )                        \
-static                                                          \
-void type3_ ## STYPE ## _to_ ## DTYPE ( const map_t *self,      \
-    void *vdst, const void *vsrc, const void *vtst,             \
-    uint64_t elem_count )                                       \
-{                                                               \
-    const STYPE *tst = vtst;                                    \
-    const DTYPE *src = vsrc;                                    \
-    DTYPE *dst = vdst;                                          \
-                                                                \
-    const STYPE *from = self -> from;                           \
-    const DTYPE *to = self -> to;                               \
-                                                                \
-    uint64_t i;                                                 \
-    for ( i = 0; i < elem_count; ++ i )                         \
-    {                                                           \
-        STYPE elem = tst [ i ];                                 \
-        uint32_t lower = 0, upper = self -> map_len;            \
-                                                                \
-        dst [ i ] = src [ i ];                                  \
-                                                                \
-        while ( lower < upper )                                 \
-        {                                                       \
-            uint32_t j = ( lower + upper ) >> 1;                \
-            STYPE cur = from [ j ];                             \
-            if ( elem == cur )                                  \
-            {                                                   \
-                dst [ i ] = to [ j ];                           \
-                break;                                          \
-            }                                                   \
-            if ( elem < cur )                                   \
-                upper = j;                                      \
-            else                                                \
-                lower = j + 1;                                  \
-        }                                                       \
-    }                                                           \
-}
-
-TYPE3_BINARY_MAP ( uint16_t, uint8_t )
-TYPE3_BINARY_MAP ( uint16_t, uint16_t )
-TYPE3_BINARY_MAP ( uint16_t, uint32_t )
-TYPE3_BINARY_MAP ( uint16_t, uint64_t )
-
-TYPE3_BINARY_MAP ( uint32_t, uint8_t )
-TYPE3_BINARY_MAP ( uint32_t, uint16_t )
-TYPE3_BINARY_MAP ( uint32_t, uint32_t )
-TYPE3_BINARY_MAP ( uint32_t, uint64_t )
-
-TYPE3_BINARY_MAP ( uint64_t, uint8_t )
-TYPE3_BINARY_MAP ( uint64_t, uint16_t )
-TYPE3_BINARY_MAP ( uint64_t, uint32_t )
-TYPE3_BINARY_MAP ( uint64_t, uint64_t )
-
-TYPE3_BINARY_MAP ( float, uint8_t )
-TYPE3_BINARY_MAP ( float, uint16_t )
-TYPE3_BINARY_MAP ( float, uint32_t )
-TYPE3_BINARY_MAP ( float, uint64_t )
-
-TYPE3_BINARY_MAP ( double, uint8_t )
-TYPE3_BINARY_MAP ( double, uint16_t )
-TYPE3_BINARY_MAP ( double, uint32_t )
-TYPE3_BINARY_MAP ( double, uint64_t )
-
-typedef void ( * type3_func ) ( const map_t*, void*, const void*, const void*, uint64_t );
-static type3_func type3_funcs [ 6 ] [ 4 ] =
-{
-    /* uint8_t */
-    {
-        type3_uint8_t_to_uint8_t,
-        type3_uint8_t_to_uint16_t,
-        type3_uint8_t_to_uint32_t,
-        type3_uint8_t_to_uint64_t
-    },
-
-    /* uint16_t */
-    {
-        type3_uint16_t_to_uint8_t,
-        type3_uint16_t_to_uint16_t,
-        type3_uint16_t_to_uint32_t,
-        type3_uint16_t_to_uint64_t
-    },
-
-    /* uint32_t */
-    {
-        type3_uint32_t_to_uint8_t,
-        type3_uint32_t_to_uint16_t,
-        type3_uint32_t_to_uint32_t,
-        type3_uint32_t_to_uint64_t
-    },
-
-    /* uint64_t */
-    {
-        type3_uint64_t_to_uint8_t,
-        type3_uint64_t_to_uint16_t,
-        type3_uint64_t_to_uint32_t,
-        type3_uint64_t_to_uint64_t
-    },
-
-    /* float */
-    {
-        type3_float_to_uint8_t,
-        type3_float_to_uint16_t,
-        type3_float_to_uint32_t,
-        type3_float_to_uint64_t
-    },
-
-    /* double */
-    {
-        type3_double_to_uint8_t,
-        type3_double_to_uint16_t,
-        type3_double_to_uint32_t,
-        type3_double_to_uint64_t
-    }
-};
-
-
-#if _DEBUGGING
-static
-rc_t CC type12_driver ( void *xself, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count )
-{
-    map_t *self = xself;
-    return ( * self -> array ) ( self, info, dst, src, elem_count );
-}
-#endif
-
-static
-rc_t CC type3_driver ( void *xself,
-    const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const map_t *self = ( const void* ) xself;
-
-    /* base pointers to pages */
-    uint8_t *dst = rslt -> base;
-    const uint8_t *tst = argv [ 0 ] . u . data . base;
-    const uint8_t *src = argv [ 1 ] . u . data . base;
-
-    /* offset by bytes to first element of row */
-    dst += ( rslt -> elem_bits * rslt -> first_elem ) >> 3;
-    tst += ( argv [ 0 ] . u . data . elem_bits * argv [ 0 ] . u . data . first_elem ) >> 3;
-    src += ( argv [ 1 ] . u . data . elem_bits * argv [ 1 ] . u . data . first_elem ) >> 3;
-
-    /* invoke function */
-    ( * self -> row ) ( self, dst, src, tst, rslt -> elem_count );
-    return 0;
-}
-
-
-/* make
- *  make a map_t structure
- */
-#define MAKE_8BIT_MAP_T( DTYPE )                                        \
-static                                                                  \
-rc_t make_map_t_uint8_t_to_ ## DTYPE ( map_t **mapp,                    \
-    const void *vfrom, const void *vto, uint32_t map_len )              \
-{                                                                       \
-    uint32_t i;                                                         \
-    uint8_t *tst;                                                       \
-    DTYPE *dto;                                                         \
-    const uint8_t *from = vfrom;                                        \
-    const DTYPE *sto = vto;                                             \
-    map_t *map = calloc ( 1, sizeof * map +                             \
-        ( sizeof * tst + sizeof * dto ) * 256 );                        \
-    if ( map == NULL )                                                  \
-    {                                                                   \
-        return RC ( rcVDB, rcFunction, rcConstructing,                  \
-            rcMemory, rcExhausted );                                    \
-    }                                                                   \
-                                                                        \
-    tst = ( uint8_t* ) ( map + 1 );                                     \
-    dto = ( DTYPE* ) & tst [ 256 ];                                     \
-                                                                        \
-    map -> row = NULL;                                                  \
-    map -> map_len = map_len;                                           \
-    map -> align = 0;                                                   \
-    map -> from = ( void* ) tst;                                        \
-    map -> to = ( void* ) dto;                                          \
-    * mapp = map;                                                       \
-                                                                        \
-    for ( i = 0; i < map_len; ++ i )                                    \
-    {                                                                   \
-        int j = from [ i ];                                             \
-        tst [ j ] = 1;                                                  \
-        dto [ j ] = sto [ i ];                                          \
-    }                                                                   \
-                                                                        \
-    return 0;                                                           \
-}
-
-MAKE_8BIT_MAP_T ( uint8_t )
-MAKE_8BIT_MAP_T ( uint16_t )
-MAKE_8BIT_MAP_T ( uint32_t )
-MAKE_8BIT_MAP_T ( uint64_t )
-
-#define MAP_T_CMP( TYPE )                                               \
-static                                                                  \
-int CC map_t_cmp_ ## TYPE ( const void *a, const void *b, void *data )     \
-{                                                                       \
-    const TYPE *from = ( const TYPE* ) data;                            \
-    int left = * ( const uint16_t* ) a;                                 \
-    int right = * ( const uint16_t* ) b;                                \
-    if ( from [ left ] < from [ right ] )                               \
-        return -1;                                                      \
-    return from [ left ] > from [ right ];                              \
-}
-
-MAP_T_CMP ( uint16_t )
-MAP_T_CMP ( uint32_t )
-MAP_T_CMP ( uint64_t )
-MAP_T_CMP ( float )
-MAP_T_CMP ( double )
-
-#define MAKE_MAP_T( STYPE, DTYPE )                                      \
-static                                                                  \
-rc_t make_map_t_ ## STYPE ## _to_ ## DTYPE ( map_t **mapp,              \
-    const void *vfrom, const void *vto, uint32_t map_len )              \
-{                                                                       \
-    uint32_t i;                                                         \
-    uint16_t buff [ 64 ], *ord = buff;                                  \
-                                                                        \
-    DTYPE *dto;                                                         \
-    STYPE *dfrom;                                                       \
-                                                                        \
-    const STYPE *sfrom = vfrom;                                         \
-    const DTYPE *sto = vto;                                             \
-    map_t *map = malloc ( sizeof * map +                                \
-        ( sizeof * dfrom + sizeof * dto ) * map_len );                  \
-    if ( map == NULL )                                                  \
-    {                                                                   \
-        return RC ( rcVDB, rcFunction, rcConstructing,                  \
-            rcMemory, rcExhausted );                                    \
-    }                                                                   \
-                                                                        \
-    dfrom = ( STYPE* ) ( map + 1 );                                     \
-    dto = ( DTYPE* ) & dfrom [ map_len ];                               \
-                                                                        \
-    map -> row = NULL;                                                  \
-    map -> map_len = map_len;                                           \
-    map -> align = 0;                                                   \
-    map -> from = ( void* ) dfrom;                                      \
-    map -> to = ( void* ) dto;                                          \
-    * mapp = map;                                                       \
-                                                                        \
-    if ( map_len > sizeof buff / sizeof buff [ 0 ] )                    \
-    {                                                                   \
-        assert ( map_len < 0x10000 );                                   \
-        ord = malloc ( sizeof * ord * map_len );                        \
-        if ( ord == NULL )                                              \
-        {                                                               \
-            free ( map );                                               \
-            return RC ( rcVDB, rcFunction, rcConstructing,              \
-                rcMemory, rcExhausted );                                \
-        }                                                               \
-    }                                                                   \
-                                                                        \
-    for ( i = 0; i < map_len; ++ i )                                    \
-        ord [ i ] = ( uint16_t ) i;                                     \
-    ksort ( ord, map_len, sizeof ord [ 0 ],                             \
-        map_t_cmp_ ## STYPE, ( void* ) sfrom );                          \
-                                                                        \
-    for ( i = 0; i < map_len; ++ i )                                    \
-    {                                                                   \
-        int j = ord [ i ];                                              \
-        dfrom [ i ] = sfrom [ j ];                                      \
-        dto [ i ] = sto [ j ];                                          \
-    }                                                                   \
-                                                                        \
-    if ( ord != buff )                                                  \
-        free ( ord );                                                   \
-                                                                        \
-    return 0;                                                           \
-}
-
-MAKE_MAP_T ( uint16_t, uint8_t )
-MAKE_MAP_T ( uint16_t, uint16_t )
-MAKE_MAP_T ( uint16_t, uint32_t )
-MAKE_MAP_T ( uint16_t, uint64_t )
-
-MAKE_MAP_T ( uint32_t, uint8_t )
-MAKE_MAP_T ( uint32_t, uint16_t )
-MAKE_MAP_T ( uint32_t, uint32_t )
-MAKE_MAP_T ( uint32_t, uint64_t )
-
-MAKE_MAP_T ( uint64_t, uint8_t )
-MAKE_MAP_T ( uint64_t, uint16_t )
-MAKE_MAP_T ( uint64_t, uint32_t )
-MAKE_MAP_T ( uint64_t, uint64_t )
-
-MAKE_MAP_T ( float, uint8_t )
-MAKE_MAP_T ( float, uint16_t )
-MAKE_MAP_T ( float, uint32_t )
-MAKE_MAP_T ( float, uint64_t )
-
-MAKE_MAP_T ( double, uint8_t )
-MAKE_MAP_T ( double, uint16_t )
-MAKE_MAP_T ( double, uint32_t )
-MAKE_MAP_T ( double, uint64_t )
-
-
-typedef rc_t ( * make_func ) ( map_t**, const void*, const void*, uint32_t );
-static make_func make_funcs [ 6 ] [ 4 ] =
-{
-    /* uint8_t */
-    {
-        make_map_t_uint8_t_to_uint8_t,
-        make_map_t_uint8_t_to_uint16_t,
-        make_map_t_uint8_t_to_uint32_t,
-        make_map_t_uint8_t_to_uint64_t
-    },
-
-    /* uint16_t */
-    {
-        make_map_t_uint16_t_to_uint8_t,
-        make_map_t_uint16_t_to_uint16_t,
-        make_map_t_uint16_t_to_uint32_t,
-        make_map_t_uint16_t_to_uint64_t
-    },
-
-    /* uint32_t */
-    {
-        make_map_t_uint32_t_to_uint8_t,
-        make_map_t_uint32_t_to_uint16_t,
-        make_map_t_uint32_t_to_uint32_t,
-        make_map_t_uint32_t_to_uint64_t
-    },
-
-    /* uint64_t */
-    {
-        make_map_t_uint64_t_to_uint8_t,
-        make_map_t_uint64_t_to_uint16_t,
-        make_map_t_uint64_t_to_uint32_t,
-        make_map_t_uint64_t_to_uint64_t
-    },
-
-    /* float */
-    {
-        make_map_t_float_to_uint8_t,
-        make_map_t_float_to_uint16_t,
-        make_map_t_float_to_uint32_t,
-        make_map_t_float_to_uint64_t
-    },
-
-    /* double */
-    {
-        make_map_t_double_to_uint8_t,
-        make_map_t_double_to_uint16_t,
-        make_map_t_double_to_uint32_t,
-        make_map_t_double_to_uint64_t
-    }
-};
-
-/* domain_and_size_code
- *  converts sizes 8..64 into 0..3
- *  converts domains into integer or float
- *  combines the two into a single integer
- *  returns -1 if something is simply unsupported
- */
-static
-int domain_and_size_code ( const VTypedesc *desc )
-{
-    int size, type;
-    switch ( desc -> intrinsic_bits )
-    {
-    case 8:
-        size = 0;
-        break;
-    case 16:
-        size = 1;
-        break;
-    case 32:
-        size = 2;
-        break;
-    case 64:
-        size = 3;
-        break;
-    default:
-        return -1;
-    }
-
-    switch ( desc -> domain )
-    {
-    case vtdBool:
-    case vtdUint:
-    case vtdInt:
-        type = 0;
-        break;
-    case vtdFloat:
-        type = 4;
-        break;
-    case vtdAscii:
-    case vtdUnicode:
-        type = 0;
-        break;
-    default:
-        return -1;
-    }
-
-    return type + size;
-}
-
-
-/* map
- *  translate input elements
- *  behaves much like the Unix "tr" command
- *  except that charsets are not [currently] supported
- *
- *  "A" [ TYPE ] - input data type, e.g. "ascii"
- *
- *  "B" [ TYPE ] - output data type, e.g. "ascii" or "U8"
- *
- *  "from" [ CONST ] - set of key values.
- *
- *  "to" [ CONST ] - set of mapped values,
- *  where length ( from ) === length ( to )
- *
- *  "in" [ DATA ] - input data to be matched against keys
- *  in "from". also serves as source data when "src" is omitted
- *
- *  "src" [ DATA, OPTIONAL ] - source data to be edited by
- *  substituting "to" values when corresponding "in" value
- *  matches key in "from". if omitted, "in" is used.
- *
- * USAGE:
- *  to upper case letters from a given alphabet
- *    ascii upper = < ascii, ascii > map < 'acgtn', 'ACGTN' > ( in );
- *
- *  to translate from ascii to binary
- *    U8 bin = < ascii, U8 > map < 'ACGTN', [ 0, 1, 2, 3, 0 ] > ( in );
- *
- *  to alter certain values of a column based upon values in another
- *    U8 n_encoded = < ascii, U8 > map < 'N', 0 > ( read, quality );
- *
- * CAVEATS:
- *  the full canonical mode of operation uses separate inputs
- *  for key matching and output source.
- *
- *  when a single input is specified:
- *   - sizeof ( A ) must equal sizeof ( B )
- *   - A must be a proper subset of B -OR-
- *   - "from" keys must match every possible "in" value ( total substitution )
- */
-static
-rc_t vdb_map_type1_8bit_fact ( VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc = make_type1_uint8_t ( & rslt -> self,
-        cp -> argv [ 0 ] . data . u8,
-        cp -> argv [ 1 ] . data . u8,
-        cp -> argv [ 0 ] . count );
-    if ( rc != 0 )
-        return rc;
-
-    rslt -> whack = free;
-    rslt -> u. af = type1_uint8_t;
-    rslt -> variant = vftArray;
-
-    return 0;
-}
-
-static
-rc_t vdb_map_type1_fact ( VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc;
-    int code;
-    map_t *self;
-
-    /* look for special case of 8-bit to 8-bit mapping */
-    if ( cp -> argv [ 0 ] . desc . intrinsic_bits == 8 )
-        return vdb_map_type1_8bit_fact ( rslt, cp );
-
-    /* determine the domain and size code */
-    code = domain_and_size_code ( & cp -> argv [ 0 ] . desc );
-    if ( code < 0 )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcType, rcUnsupported );
-
-    /* create the object */
-    rc = ( * make_funcs [ code ] [ code & 3 ] )
-        ( & self,
-          cp -> argv [ 0 ] . data . u8,
-          cp -> argv [ 1 ] . data . u8,
-          cp -> argv [ 0 ] . count );
-    if ( rc != 0 )
-        return rc;
-
-    /* 8=>8 can be discounted */
-    -- code;
-
-    /* determine whether it makes sense to perform a binary search */
-    rslt -> u. af = ( cp -> argv [ 0 ] . count < 8 ) ?
-        type1_linear_funcs [ code ] : type1_binary_funcs [ code ];
-    
-    rslt -> self = self;
-    rslt -> whack = free;
-    rslt -> variant = vftArray;
-
-#if _DEBUGGING
-    self -> array = rslt -> u . af;
-    rslt -> u . af = type12_driver;
-#endif
-
-    return 0;
-}
-
-static
-rc_t vdb_map_type2_fact ( VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc;
-    map_t *self;
-    int code1, code2;
-
-    /* determine the domain and size codes */
-    code1 = domain_and_size_code ( & cp -> argv [ 0 ] . desc );
-    code2 = domain_and_size_code ( & cp -> argv [ 1 ] . desc );
-    if ( code1 < 0 ||  code2 < 0 )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcType, rcUnsupported );
-
-    /* create the object */
-    rc = ( * make_funcs [ code1 ] [ code2 & 3 ] )
-        ( & self,
-          cp -> argv [ 0 ] . data . u8,
-          cp -> argv [ 1 ] . data . u8,
-          cp -> argv [ 0 ] . count );
-    if ( rc != 0 )
-        return rc;
-    
-    rslt -> self = self;
-    rslt -> whack = free;
-    rslt -> u. af = type2_funcs [ code1 ] [ code2 & 3 ];
-    rslt -> variant = vftArray;
-
-#if _DEBUGGING
-    self -> array = rslt -> u . af;
-    rslt -> u . af = type12_driver;
-#endif
-
-    return 0;
-}
-
-static
-rc_t vdb_map_type3_fact ( VFuncDesc *rslt, const VFactoryParams *cp )
-{
-    rc_t rc;
-    map_t *self;
-    int code1, code2;
-
-    /* determine the domain and size codes */
-    code1 = domain_and_size_code ( & cp -> argv [ 0 ] . desc );
-    code2 = domain_and_size_code ( & cp -> argv [ 1 ] . desc );
-    if ( code1 < 0 ||  code2 < 0 )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcType, rcUnsupported );
-
-    /* create the object */
-    rc = ( * make_funcs [ code1 ] [ code2 & 3 ] )
-        ( & self,
-          cp -> argv [ 0 ] . data . u8,
-          cp -> argv [ 1 ] . data . u8,
-          cp -> argv [ 0 ] . count );
-    if ( rc != 0 )
-        return rc;
-
-    self -> row = type3_funcs [ code1 ] [ code2 & 3 ];
-    
-    rslt -> self = self;
-    rslt -> whack = free;
-    rslt -> u. pf = type3_driver;
-    rslt -> variant = vftFixedRow;
-
-    return 0;
-}
-
-VTRANSFACT_IMPL ( vdb_map, 1, 0, 0 ) ( const void *ignore, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* the compiler has no way of knowing that the map dimensions must match */
-    if ( cp -> argv [ 0 ] . count != cp -> argv [ 1 ] . count )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcConstraint, rcViolated );
-
-    /* the loop type is determined by the number of inputs and input type */
-    if ( dp -> argc == 2 )
-        return vdb_map_type3_fact ( rslt, cp );
-
-    /* since two schema types A and B are given, the compiler has no way
-       of knowing that it should check for a relationship between them */
-    if ( VTypedeclToTypedecl ( & dp -> argv [ 0 ] . fd . td, info -> schema, & info -> fdesc . fd . td, NULL, NULL ) )
-        return vdb_map_type1_fact ( rslt, cp );
-
-    return vdb_map_type2_fact ( rslt, cp );
-}
diff --git a/libs/vxf/math-funcs-impl.h b/libs/vxf/math-funcs-impl.h
deleted file mode 100644
index 8f95e12..0000000
--- a/libs/vxf/math-funcs-impl.h
+++ /dev/null
@@ -1,361 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <compiler.h>
-#include <math.h>
-
-typedef void (*math_f)(void *dst, const void *src, size_t elem_count);
-typedef union self_t {
-    void *vp;
-    math_f f;
-} self_t;
-
-static void F32_to_I8(void *Dst, const void *Src, size_t elem_count) {
-    int8_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int8_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_U8(void *Dst, const void *Src, size_t elem_count) {
-    uint8_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint8_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_I16(void *Dst, const void *Src, size_t elem_count) {
-    int16_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int16_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_U16(void *Dst, const void *Src, size_t elem_count) {
-    uint16_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint16_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_I32(void *Dst, const void *Src, size_t elem_count) {
-    int32_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int32_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_U32(void *Dst, const void *Src, size_t elem_count) {
-    uint32_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint32_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_I64(void *Dst, const void *Src, size_t elem_count) {
-    int64_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int64_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_U64(void *Dst, const void *Src, size_t elem_count) {
-    uint64_t *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint64_t)FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_F32(void *Dst, const void *Src, size_t elem_count) {
-    float *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = FLOAT_FUNC(src[i]);
-}
-
-static void F32_to_F64(void *Dst, const void *Src, size_t elem_count) {
-    double *dst = Dst;
-    const float *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = FLOAT_FUNC(src[i]);
-}
-
-static void F64_to_I8(void *Dst, const void *Src, size_t elem_count) {
-    int8_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int8_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_U8(void *Dst, const void *Src, size_t elem_count) {
-    uint8_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint8_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_I16(void *Dst, const void *Src, size_t elem_count) {
-    int16_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int16_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_U16(void *Dst, const void *Src, size_t elem_count) {
-    uint16_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint16_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_I32(void *Dst, const void *Src, size_t elem_count) {
-    int32_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int32_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_U32(void *Dst, const void *Src, size_t elem_count) {
-    uint32_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint32_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_I64(void *Dst, const void *Src, size_t elem_count) {
-    int64_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (int64_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_U64(void *Dst, const void *Src, size_t elem_count) {
-    uint64_t *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (uint64_t)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_F32(void *Dst, const void *Src, size_t elem_count) {
-    float *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = (float)DOUBLE_FUNC(src[i]);
-}
-
-static void F64_to_F64(void *Dst, const void *Src, size_t elem_count) {
-    double *dst = Dst;
-    const double *src = Src;
-    int i;
-    
-    for (i = 0; i != elem_count; ++i)
-        dst[i] = DOUBLE_FUNC(src[i]);
-}
-
-static
-rc_t CC array_func(
-                void *Self,
-                const VXformInfo *info,
-                void *dst,
-                const void *src,
-                uint64_t num_elements
-                )
-{
-    self_t hack;
-
-    hack.vp = Self;
-    hack.f(dst, src, ( size_t ) num_elements);
-    return 0;
-}
-
-static rc_t factory( const void *self, const VXfactInfo *info, 
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VTypedesc src_desc;
-    rc_t rc;
-    self_t hack;
-
-    rc = VSchemaDescribeTypedecl(info->schema, &src_desc, &dp->argv[0].fd.td);
-    if (rc)
-        return rc;
-    
-    rslt->variant = vftArray;
-    rslt->u.af = array_func;
-    
-    switch (src_desc.intrinsic_bits) {
-    case 32:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                hack.f = F32_to_I8;
-                break;
-            case 16:
-                hack.f = F32_to_I16;
-                break;
-            case 32:
-                hack.f = F32_to_I32;
-                break;
-            case 64:
-                hack.f = F32_to_I64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                hack.f = F32_to_U8;
-                break;
-            case 16:
-                hack.f = F32_to_U16;
-                break;
-            case 32:
-                hack.f = F32_to_U32;
-                break;
-            case 64:
-                hack.f = F32_to_U64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                hack.f = F32_to_F32;
-                break;
-            case 64:
-                hack.f = F32_to_F64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 64:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                hack.f = F64_to_I8;
-                break;
-            case 16:
-                hack.f = F64_to_I16;
-                break;
-            case 32:
-                hack.f = F64_to_I32;
-                break;
-            case 64:
-                hack.f = F64_to_I64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case vtdUint:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 8:
-                hack.f = F64_to_U8;
-                break;
-            case 16:
-                hack.f = F64_to_U16;
-                break;
-            case 32:
-                hack.f = F64_to_U32;
-                break;
-            case 64:
-                hack.f = F64_to_U64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case vtdFloat:
-            switch (info->fdesc.desc.intrinsic_bits) {
-            case 32:
-                hack.f = F64_to_F32;
-                break;
-            case 64:
-                hack.f = F64_to_F64;
-                break;
-            default:
-                return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        default:
-            return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    default:
-        return RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-    rslt->self = hack.vp;
-    return 0;
-}
-
diff --git a/libs/vxf/max.c b/libs/vxf/max.c
deleted file mode 100644
index c941468..0000000
--- a/libs/vxf/max.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-
-typedef void (*func_t)(void *, const void *, const void *, uint64_t);
-
-typedef struct self_t {
-    func_t f;
-} self_t;
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, const void *A, const void *B, uint64_t n) { \
-    VALTYPE *dst = (VALTYPE *)Dst; \
-    const VALTYPE *a = (const VALTYPE *)A; \
-    const VALTYPE *b = (const VALTYPE *)B; \
-    uint64_t i; \
-    \
-    for (i = 0; i != n; ++i) \
-        dst[i] = b[i] < a[i] ? a[i] : b[i]; \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC fixed_row_func(
-                      void *Self,
-                      const VXformInfo *info,
-                      int64_t row_id,
-                      const VFixedRowResult *rslt,
-                      uint32_t argc,
-                      const VRowData argv[]
-) {
-    const self_t *self = Self;
-
-    /* base pointers to pages */
-    uint8_t *dst = rslt -> base;
-    const uint8_t *a = argv [ 0 ] . u . data . base;
-    const uint8_t *b = argv [ 1 ] . u . data . base;
-
-    /* offset by bytes to first element of row */
-    dst += ( rslt -> elem_bits * rslt -> first_elem ) >> 3;
-    a += ( argv [ 0 ] . u . data . elem_bits * argv [ 0 ] . u . data . first_elem ) >> 3;
-    b += ( argv [ 1 ] . u . data . elem_bits * argv [ 1 ] . u . data . first_elem ) >> 3;
-
-    self -> f ( dst, a, b, rslt -> elem_count );
-    return 0;
-}
-
-static
-void CC vxf_max_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- */
-VTRANSFACT_IMPL(vdb_max, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-
-	self = malloc(sizeof(self_t));
-    if (self == NULL)
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        
-    rslt->self = self;
-    rslt->whack = vxf_max_wrapper;
-    rslt->variant = vftFixedRow;
-    rslt->u.pf = fixed_row_func;
-
-    switch (info->fdesc.desc.intrinsic_bits) {
-    case 8:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int8_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint8_t);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 16:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int16_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint16_t);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 32:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int32_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint32_t);
-            break;
-        case vtdFloat:
-            self->f = FUNC(float);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 64:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int64_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint64_t);
-            break;
-        case vtdFloat:
-            self->f = FUNC(double);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    if (rc)
-        free(self);
-    return rc;
-}
diff --git a/libs/vxf/min.c b/libs/vxf/min.c
deleted file mode 100644
index b7e209c..0000000
--- a/libs/vxf/min.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-
-typedef void (*func_t)(void *, const void *, const void *, uint64_t);
-
-typedef struct self_t {
-    func_t f;
-} self_t;
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, const void *A, const void *B, uint64_t n) { \
-    VALTYPE *dst = (VALTYPE *)Dst; \
-    const VALTYPE *a = (const VALTYPE *)A; \
-    const VALTYPE *b = (const VALTYPE *)B; \
-    uint64_t i; \
-    \
-    for (i = 0; i != n; ++i) \
-        dst[i] = a[i] < b[i] ? a[i] : b[i]; \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC fixed_row_func(
-                      void *Self,
-                      const VXformInfo *info,
-                      int64_t row_id,
-                      const VFixedRowResult *rslt,
-                      uint32_t argc,
-                      const VRowData argv[]
-) {
-    const self_t *self = Self;
-
-    /* base pointers to pages */
-    uint8_t *dst = rslt -> base;
-    const uint8_t *a = argv [ 0 ] . u . data . base;
-    const uint8_t *b = argv [ 1 ] . u . data . base;
-
-    /* offset by bytes to first element of row */
-    dst += ( rslt -> elem_bits * rslt -> first_elem ) >> 3;
-    a += ( argv [ 0 ] . u . data . elem_bits * argv [ 0 ] . u . data . first_elem ) >> 3;
-    b += ( argv [ 1 ] . u . data . elem_bits * argv [ 1 ] . u . data . first_elem ) >> 3;
-    
-    self -> f ( dst, a, b, rslt -> elem_count );
-    return 0;
-}
-
-static
-void CC vxf_min_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- */
-VTRANSFACT_IMPL(vdb_min, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-
-	self = malloc(sizeof(self_t));
-    if (self == NULL)
-        return RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        
-    rslt->self = self;
-    rslt->whack = vxf_min_wrapper;
-    rslt->variant = vftFixedRow;
-    rslt->u.pf = fixed_row_func;
-
-    switch (info->fdesc.desc.intrinsic_bits) {
-    case 8:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int8_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint8_t);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 16:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int16_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint16_t);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 32:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int32_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint32_t);
-            break;
-        case vtdFloat:
-            self->f = FUNC(float);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    case 64:
-        switch (info->fdesc.desc.domain) {
-        case vtdInt:
-            self->f = FUNC(int64_t);
-            break;
-        case vtdUint:
-            self->f = FUNC(uint64_t);
-            break;
-        case vtdFloat:
-            self->f = FUNC(double);
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        break;
-    default:
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-    }
-
-    if (rc)
-        free(self);
-    return rc;
-}
diff --git a/libs/vxf/outlier-decoder.c b/libs/vxf/outlier-decoder.c
deleted file mode 100644
index 19e2ee2..0000000
--- a/libs/vxf/outlier-decoder.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define DECODER_NAME(T) outlier_encode_ ## T
-#define DECODER(T) static rc_t CC DECODER_NAME(T) (void *self, const VXformInfo *info, void *Dst, const void *Src, uint64_t elem_count) \
-{ \
-    T *dst = (T *)Dst; \
-    T const *src = (T const *)Src; \
-    T const outlier = *(T const *)self; \
-    uint64_t i; \
-    for (i = 0; i != elem_count; ++i) { \
-        T const y = src[i]; \
-        if (y & 1) \
-            dst[i] = outlier; \
-        else \
-            dst[i] = y >> 1; \
-    } \
-    return 0; \
-}
-
-DECODER(uint8_t)
-DECODER(uint16_t)
-DECODER(uint32_t)
-DECODER(uint64_t)
-
-/*
- function < type T > T outlier_decode #1.0 < T outlier > ( T y );
- */
-
-VTRANSFACT_IMPL ( vdb_outlier_decode, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-                                                 VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    void *self;
-    
-    if (info->fdesc.desc.domain != vtdInt || cp->argv[0].count != 1)
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcIncorrect);
-        
-        switch (VTypedescSizeof(&cp->argv[0].desc)) {
-        case 8:
-        case 16:
-        case 32:
-        case 64:
-            break;
-        default:
-            return RC(rcXF, rcFunction, rcConstructing, rcType, rcIncorrect);
-            break;
-        }
-    
-    self = malloc(sizeof(uint64_t));
-    if (self == NULL)
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-        
-        switch (VTypedescSizeof(&cp->argv[0].desc)) {
-        case 8:
-            *(uint8_t *)self = cp->argv[0].data.u8[0];
-            rslt->u.af = DECODER_NAME(uint8_t);
-            break;
-        case 16:
-            *(uint16_t *)self = cp->argv[0].data.u16[0];
-            rslt->u.af = DECODER_NAME(uint16_t);
-            break;
-        case 32:
-            *(uint32_t *)self = cp->argv[0].data.u32[0];
-            rslt->u.af = DECODER_NAME(uint32_t);
-            break;
-        case 64:
-            *(uint64_t *)self = cp->argv[0].data.u64[0];
-            rslt->u.af = DECODER_NAME(uint64_t);
-            break;
-        default:
-            break;
-        }
-    rslt->self = self;
-    rslt->whack = free;
-    rslt->variant = vftArray;
-    return 0;
-}
diff --git a/libs/vxf/outlier-encoder.c b/libs/vxf/outlier-encoder.c
deleted file mode 100644
index 6720044..0000000
--- a/libs/vxf/outlier-encoder.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <bitstr.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define ENCODER_NAME(T) outlier_encode_ ## T
-#define ENCODER(T) static rc_t CC ENCODER_NAME(T) (void *self, const VXformInfo *info, void *Dst, const void *Src, uint64_t elem_count) \
-{ \
-    T *dst = (T *)Dst; \
-    T const *src = (T const *)Src; \
-    T last = 1; \
-    T const outlier = *(T const *)self; \
-    uint64_t i; \
-    for (i = 0; i != elem_count; ++i) { \
-        T const y = src[i]; \
-        if ((((T)(y << 1)) >> 1) != y) \
-            return RC(rcXF, rcFunction, rcExecuting, rcConstraint, rcViolated); \
-        if (y == outlier) \
-            dst[i] = last; \
-        else \
-            last = (dst[i] = y << 1) | 1; \
-    } \
-    return 0; \
-}
-
-extern void Debugger(void);
-
-ENCODER(uint8_t)
-ENCODER(uint16_t)
-ENCODER(uint32_t)
-#if 1
-ENCODER(uint64_t)
-#else
-static rc_t CC outlier_encode_uint64_t (void *self, const VXformInfo *info, void *Dst, const void *Src, uint64_t elem_count)
-{
-    typedef uint64_t T;
-    T *dst = (T *)Dst;
-    T const *src = (T const *)Src;
-    T last = 1;
-    T const outlier = *(T const *)self;
-    uint64_t i;
-
-    for (i = 0; i != elem_count; ++i) {
-        T const y = src[i];
-        if ((((T)(y << 1)) >> 1) != y)
-            return RC(rcXF, rcFunction, rcExecuting, rcConstraint, rcViolated);
-        if (y == outlier)
-            dst[i] = last;
-        else
-            last = (dst[i] = y << 1) | 1;
-    }
-    return 0;
-}
-#endif
-
-/*
- function < type T > T outlier_encode #1.0 < T outlier > ( T y );
- */
-
-VTRANSFACT_IMPL ( vdb_outlier_encode, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    void *self;
-
-    if (info->fdesc.desc.domain != vtdInt || cp->argv[0].count != 1)
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcIncorrect);
-
-    switch (VTypedescSizeof(&cp->argv[0].desc)) {
-    case 8:
-    case 16:
-    case 32:
-    case 64:
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcConstructing, rcType, rcIncorrect);
-        break;
-    }
-    
-    self = malloc(sizeof(uint64_t));
-    if (self == NULL)
-        return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    
-    switch (VTypedescSizeof(&cp->argv[0].desc)) {
-    case 8:
-        *(uint8_t *)self = cp->argv[0].data.u8[0];
-        rslt->u.af = ENCODER_NAME(uint8_t);
-        break;
-    case 16:
-        *(uint16_t *)self = cp->argv[0].data.u16[0];
-        rslt->u.af = ENCODER_NAME(uint16_t);
-        break;
-    case 32:
-        *(uint32_t *)self = cp->argv[0].data.u32[0];
-        rslt->u.af = ENCODER_NAME(uint32_t);
-        break;
-    case 64:
-        *(uint64_t *)self = cp->argv[0].data.u64[0];
-        rslt->u.af = ENCODER_NAME(uint64_t);
-        break;
-    default:
-        break;
-    }
-    rslt->self = self;
-    rslt->whack = free;
-    rslt->variant = vftArray;
-    return 0;
-}
diff --git a/libs/vxf/pack.c b/libs/vxf/pack.c
deleted file mode 100644
index 27b9bae..0000000
--- a/libs/vxf/pack.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <klib/pack.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-
-typedef struct self_t {
-    VTypedesc sdesc;
-    uint32_t dbits;
-} self_t;
-
-static
-rc_t CC pack_func(
-               void *Self,
-               const VXformInfo *info,
-               void *dst,
-               const void *src,
-               uint64_t elem_count
-) {
-    const self_t *self = Self;
-    bitsz_t psize;
-    
-    return Pack(
-                self->sdesc.intrinsic_bits, self->dbits,
-                src, (elem_count * self->sdesc.intrinsic_dim * self->sdesc.intrinsic_bits) >> 3, 0,
-                dst, 0, elem_count * self->sdesc.intrinsic_dim * self->dbits, &psize
-               );
-}
-
-static
-void CC vxf_pack_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* 
- */
-VTRANSFACT_IMPL(vdb_pack, 1, 0, 0) (const void *Self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc = 0;
-    self_t *self;
-
-    self = malloc(sizeof(self_t));
-    if (self) {
-        self->dbits = info->fdesc.desc.intrinsic_dim;
-
-        assert (dp->argc == 1);
-        self->sdesc = dp->argv[0].desc;
-        
-        rslt->self = self;
-        rslt->whack = vxf_pack_wrapper;
-
-        rslt->variant = vftArray;
-        rslt->u.af = pack_func;
-    }
-    else
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    return rc;
-}
diff --git a/libs/vxf/paste.c b/libs/vxf/paste.c
deleted file mode 100644
index 6dd4b1a..0000000
--- a/libs/vxf/paste.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-typedef struct pastie pastie;
-struct pastie
-{
-    struct
-    {
-        union
-        {
-            void *u1;
-            uint8_t *u8;
-            uint16_t *u16;
-            uint32_t *u32;
-            uint64_t *u64;
-        } u;
-        bitsz_t off;
-
-    } dst;
-    struct
-    {
-        union
-        {
-            const void *u1;
-            const uint8_t *u8;
-            const uint16_t *u16;
-            const uint32_t *u32;
-            const uint64_t *u64;
-        } u;
-        bitsz_t off, len;
-
-    } src [ 16 ];
-};
-
-static
-rc_t CC paste_func1 ( void *data, const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    pastie *self = data;
-    uint32_t i, j, row_len = (uint32_t)rslt -> elem_count;
-
-    assert(rslt -> elem_count >> 32 == 0);
-    /* populate "self" */
-    self -> dst . u . u1 = rslt -> base;
-    self -> dst . off = ((uint64_t)rslt -> first_elem) * rslt -> elem_bits;
-    for ( j = 0; j < argc; ++ j )
-    {
-        self -> src [ j ] . u . u1 = argv [ j ] . u . data .base;
-        self -> src [ j ] . off = ((uint64_t)argv [ j ] . u . data .first_elem) * argv [ j ] . u . data .elem_bits;
-        self -> src [ j ] . len = argv [ j ] . u . data .elem_bits;
-    }
-
-    /* create output row */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        for ( j = 0; j < argc; ++ j )
-        {
-            uint32_t k = (uint32_t)self -> src [ j ] . len;
-            assert(self -> src [ j ] . len >> 32 == 0);
-            bitcpy ( self -> dst . u . u1, self -> dst . off,
-                     self -> src [ j ] . u . u1, self -> src [ j ] . off, k );
-            self -> dst . off += k;
-            self -> src [ j ] . off += k;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC paste_func8 ( void *data, const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    pastie *self = data;
-    uint32_t i, j, row_len = (uint32_t)rslt -> elem_count;
-    
-    assert(rslt -> elem_count >> 32 == 0);
-    /* populate "self" */
-    self -> dst . u . u8 = rslt -> base;
-    self -> dst . off = ((uint64_t)rslt -> first_elem) * (rslt -> elem_bits>>3);
-    for ( j = 0; j < argc; ++ j )
-    {
-        self -> src [ j ] . u . u8 = argv [ j ] . u . data .base;
-        self -> src [ j ] . off = ((uint64_t)argv [ j ] . u . data .first_elem) * (argv [ j ] . u . data .elem_bits >> 3);
-        self -> src [ j ] . len = argv [ j ] . u . data .elem_bits >> 3;
-    }
-
-    /* create output row */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        for ( j = 0; j < argc; ++ j )
-        {
-            uint32_t k;
-            for ( k = 0; k < self -> src [ j ] . len; ++ k )
-            {
-                self -> dst . u . u8 [ self -> dst . off + k ] =
-                    self -> src [ j ] . u . u8 [ self -> src [ j ] . off + k ];
-            }
-
-            self -> dst . off += k;
-            self -> src [ j ] . off += k;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC paste_func16 ( void *data, const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    pastie *self = data;
-    uint32_t i, j, row_len = (uint32_t)rslt -> elem_count;
-    
-    assert(rslt -> elem_count >> 32 == 0);
-    /* populate "self" */
-    self -> dst . u . u16 = rslt -> base;
-    self -> dst . off = ((uint64_t)rslt -> first_elem) * (rslt -> elem_bits>>4);
-    for ( j = 0; j < argc; ++ j )
-    {
-        self -> src [ j ] . u . u16 = argv [ j ] . u . data .base;
-        self -> src [ j ] . off = ((uint64_t)argv [ j ] . u . data .first_elem) * (argv [ j ] . u . data .elem_bits >> 4);
-        self -> src [ j ] . len = argv [ j ] . u . data .elem_bits >> 4;
-    }
-
-    /* create output row */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        for ( j = 0; j < argc; ++ j )
-        {
-            uint32_t k;
-            for ( k = 0; k < self -> src [ j ] . len; ++ k )
-            {
-                self -> dst . u . u16 [ self -> dst . off + k ] =
-                    self -> src [ j ] . u . u16 [ self -> src [ j ] . off + k ];
-            }
-
-            self -> dst . off += k;
-            self -> src [ j ] . off += k;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC paste_func32 ( void *data, const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    pastie *self = data;
-    uint32_t i, j, row_len = (uint32_t)rslt -> elem_count;
-    
-    assert(rslt -> elem_count >> 32 == 0);
-    /* populate "self" */
-    self -> dst . u . u32 = rslt -> base;
-    self -> dst . off = ((uint64_t)rslt -> first_elem) * (rslt -> elem_bits>>5);
-    for ( j = 0; j < argc; ++ j )
-    {
-        self -> src [ j ] . u . u32 = argv [ j ] . u . data .base;
-        self -> src [ j ] . off = ((uint64_t)argv [ j ] . u . data .first_elem) * (argv [ j ] . u . data .elem_bits >> 5);
-        self -> src [ j ] . len = argv [ j ] . u . data .elem_bits >> 5;
-    }
-
-    /* create output row */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        for ( j = 0; j < argc; ++ j )
-        {
-            uint32_t k;
-            for ( k = 0; k < self -> src [ j ] . len; ++ k )
-            {
-                self -> dst . u . u32 [ self -> dst . off + k ] =
-                    self -> src [ j ] . u . u32 [ self -> src [ j ] . off + k ];
-            }
-
-            self -> dst . off += k;
-            self -> src [ j ] . off += k;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC paste_func64 ( void *data, const VXformInfo *info, int64_t row_id,
-    const VFixedRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc = 0;
-    pastie *self = data;
-    uint32_t i, j, row_len = (uint32_t)rslt -> elem_count;
-    
-    assert(rslt -> elem_count >> 32 == 0);
-    /* populate "self" */
-    self -> dst . u . u64 = rslt -> base;
-    self -> dst . off = ((uint64_t)rslt -> first_elem) * (rslt -> elem_bits>>6);
-    for ( j = 0; j < argc; ++ j )
-    {
-        self -> src [ j ] . u . u64 = argv [ j ] . u . data .base;
-        self -> src [ j ] . off = ((uint64_t)argv [ j ] . u . data .first_elem) * (argv [ j ] . u . data .elem_bits >> 6);
-        self -> src [ j ] . len = argv [ j ] . u . data .elem_bits >> 6;
-    }
-
-    /* create output row */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        for ( j = 0; j < argc; ++ j )
-        {
-            uint32_t k;
-            for ( k = 0; k < self -> src [ j ] . len; ++ k )
-            {
-                self -> dst . u . u64 [ self -> dst . off + k ] =
-                    self -> src [ j ] . u . u64 [ self -> src [ j ] . off + k ];
-            }
-
-            self -> dst . off += k;
-            self -> src [ j ] . off += k;
-        }
-    }
-    return rc;
-}
-
-static
-void CC vxf_paste_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-#include <stdio.h>
-
-/* paste
- * function < type T > T [ * ] paste #1.0 ( T [ * ] in, ... );
- * function any NCBI:paste #1.0 ( any in, ... );
- */
-VTRANSFACT_IMPL ( vdb_paste, 1, 0, 0 ) ( const void *self,
-    const VXfactInfo *info, VFuncDesc *rslt,
-    const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    pastie *fself;
-    uint32_t rtn_bits, min_gcd;
-
-    /* in the case of the modern "paste", the compiler is able to
-       enforce only the function signature, but not the essential
-       requirement that the output dimension equal the sum of all
-       input dimensions. in the case of "NCBI:paste", the compiler
-       cannot enforce anything, so we check for inputs that have
-       the same domain and intrinsic type-size, already guaranteed
-       by the type-checked version. */
-    uint32_t i, sum;
-    for ( i = sum = 0; i < dp -> argc; ++ i )
-    {
-        assert ( dp -> argv [ i ] . fd . td . dim != 0 );
-
-        /* handle type-checking for NCBI:paste */
-        if ( dp -> argv [ i ] . desc . domain != info -> fdesc . desc . domain ||
-             dp -> argv [ i ] . desc . intrinsic_bits != info -> fdesc . desc . intrinsic_bits )
-        {
-            return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-        }
-
-        sum += dp -> argv [ i ] . desc . intrinsic_dim;
-    }
-
-    assert ( info -> fdesc . fd . td . dim != 0 );
-    if ( sum > info -> fdesc . desc . intrinsic_dim )
-        return RC ( rcXF, rcFunction, rcConstructing, rcArgv, rcExcessive );
-
-    if ( sum < info -> fdesc . desc . intrinsic_dim )
-        return RC ( rcXF, rcFunction, rcConstructing, rcArgv, rcInsufficient );
-
-    /* allocate self */
-    fself = malloc ( sizeof * fself - sizeof fself -> src + sizeof fself -> src [ 0 ] * dp -> argc );
-    if ( fself == NULL )
-        return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    /* we can create the function */
-    rslt -> self = fself;
-    rslt -> whack = vxf_paste_wrapper;
-    rslt -> variant = vftFixedRow;
-
-    /* the output dimension == sum ( dimension ) for all inputs
-       each input dimension will have a GCD of sizeof ( element ) * N
-       for N = 1 .. output dimension. the minimum of these will determine
-       the common copy word size */
-    rtn_bits = VTypedescSizeof ( & info -> fdesc . desc );
-    for ( min_gcd = rtn_bits, i = 0; i < dp -> argc; ++ i )
-    {
-        uint32_t gcd, a, b = VTypedescSizeof ( & dp -> argv [ i ] . desc );
-        for ( a = rtn_bits; ; )
-        {
-            if ( b == 0 )
-            {
-                gcd = a;
-                break;
-            }
-
-            a %= b;
-            if ( a == 0 )
-            {
-                gcd = b;
-                break;
-            }
-
-            b %= a;
-        }
-
-        if ( gcd < min_gcd )
-            min_gcd = gcd;
-    }
-
-    /* select the copy word size */
-    if ( ( min_gcd & 63 ) == 0 )
-        rslt -> u . pf = paste_func64;
-    else if ( ( min_gcd & 31 ) == 0 )
-        rslt -> u . pf = paste_func32;
-    else if ( ( min_gcd & 15 ) == 0 )
-        rslt -> u . pf = paste_func16;
-    else if ( ( min_gcd & 7 ) == 0 )
-        rslt -> u . pf = paste_func8;
-    else
-        rslt -> u . pf = paste_func1;
-
-    return 0;
-}
diff --git a/libs/vxf/rand_4na_2na.c b/libs/vxf/rand_4na_2na.c
deleted file mode 100644
index e8feaac..0000000
--- a/libs/vxf/rand_4na_2na.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-#include <time.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-#if 1
-static struct {
-	uint8_t num_bits;
-	uint8_t val[4];
-} map[16] = {
-
-#if WE_SECRETLY_MEANT_4NA_BY_2NA
-#define A 1
-#define C 2
-#define G 4
-#define T 8
-#else
-#define A 0
-#define C 1
-#define G 2
-#define T 3
-#endif
-/*0000*/{4,{A,C,G,T}}, 
-/*0001*/{1,{A}},
-/*0010*/{1,{C}},
-/*0011*/{2,{A,C}},
-/*0100*/{1,{G}},
-/*0101*/{2,{A,G}},
-/*0110*/{2,{C,G}},
-/*0111*/{3,{A,C,G}},
-/*1000*/{1,{T}},
-/*1001*/{2,{A,T}},
-/*1010*/{2,{C,T}},
-/*1011*/{3,{A,C,T}},
-/*1100*/{2,{G,T}},
-/*1101*/{3,{A,G,T}},
-/*1110*/{3,{C,G,T}},
-/*1111*/{4,{A,C,G,T}}
-#undef A
-#undef C
-#undef G
-#undef T
-};
-
-static uint8_t randomize_ambiguity(uint8_t base, unsigned *seed, bool *reseed) {
-    assert(base < 16);
-    
-    if (map[base].num_bits == 1) {
-        base = map[base].val[0];
-        *seed = (*seed << 2) | base;
-        *reseed = true;
-        return base;
-    }
-    else {        
-        unsigned int rval;
-        unsigned int num_bits = map [ base ] . num_bits;
-        
-        if (*reseed)
-        {
-            *reseed = false;
-            srand(*seed);
-        }
-        rval = ( unsigned int ) ( ( ( uint64_t ) rand () * num_bits ) / RAND_MAX );
-
-        if ( rval >= num_bits)
-            return map[base].val[rval % num_bits];
-
-        return map[base].val[rval];
-    }
-}
-#else
-typedef uint8_t dna4na_t;
-
-static const bool isExact[16]
-  = { 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-static const struct { dna4na_t val[12]; } possibleBase[16] = {
-    {{ 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8 }}, /* 0000 1 2 4 8 */
-    {{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }}, /* 0001 1 */
-    {{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }}, /* 0010 2 */
-    {{ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 }}, /* 0011 1 2 */
-    {{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }}, /* 0100 4 */
-    {{ 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4 }}, /* 0101 1 4 */
-    {{ 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4 }}, /* 0110 2 4 */
-    {{ 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4 }}, /* 0111 1 2 4 */
-    {{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }}, /* 1000 8 */
-    {{ 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8 }}, /* 1001 1 8 */
-    {{ 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8 }}, /* 1010 2 8 */
-    {{ 1, 2, 8, 1, 2, 8, 1, 2, 8, 1, 2, 8 }}, /* 1011 1 2 8 */
-    {{ 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8 }}, /* 1100 4 8 */
-    {{ 1, 4, 8, 1, 4, 8, 1, 4, 8, 1, 4, 8 }}, /* 1101 1 4 8 */
-    {{ 2, 4, 8, 2, 4, 8, 2, 4, 8, 2, 4, 8 }}, /* 1110 2 4 8 */
-    {{ 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8 }}  /* 1111 1 2 4 8 */
-};
-
-static uint8_t randomize_ambiguity(uint8_t base, unsigned *seed, bool *reseed) {
-    assert(base < 16);
-    
-    if (isExact[base]) {
-        typedef uint8_t dna2na_t;
-        
-        static const dna2na_t map4na2na[16]
-        = { 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 };
-        
-        *seed = (*seed << 2) | map4na2na[base];
-        *reseed = true;
-        return base;
-    }
-    else {
-        unsigned rval;
-        
-        if (*reseed) {
-            *reseed = false;
-            srand(*seed);
-        }
-        rval = ((uint8_t)(rand() / (RAND_MAX >> 8))) % 12;
-        assert(rval < 12);
-        return possibleBase[base].val[rval];
-    }
-}
-#endif
-
-
-static
-rc_t CC rand_4na_2na_impl  ( void *data,
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    unsigned seed = time( NULL ) + row_id;
-    bool reseed = true;
-    uint8_t *dst;
-    const uint8_t *src = argv [ 0 ] . u . data . base;
-    rc_t	rc;
-    KDataBuffer *dst_buf = rslt -> data;
-    
-    src += argv[0].u.data.first_elem;
-    rslt->elem_count = argv[0].u.data.elem_count;
-    assert(dst_buf -> elem_bits == 8 );
-#if 0
-    rslt->no_cache = true; /** do not cache randomized data **/
-#endif
-    rc = KDataBufferResize ( dst_buf, rslt->elem_count );
-    if( rc == 0 ){
-	    int i,last;
-	    dst = dst_buf -> base;
-
-	    for ( last = rslt -> elem_count; last >  0 && src[last-1] == 15; last --){} /** find run of Ns from the right **/
-	    if  ( rslt -> elem_count - last < 5) last = rslt -> elem_count; /*** discard not so large run of Ns ***/
-	    
-	    for ( i = 0; i < last ; ++ i )
-		dst[i] = randomize_ambiguity(src[i], &seed, &reseed);
-	    for ( ; i < rslt -> elem_count; ++ i ) /** large run of Ns from the right is set to As, not randomized  **/
-		dst[i] = 0;
-    }
-    return rc;
-}
-
-
-VTRANSFACT_IMPL ( INSDC_SEQ_rand_4na_2na, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> self = NULL;
-    rslt -> whack = NULL;
-    rslt -> u . ndf = rand_4na_2na_impl;
-    rslt -> variant = vftNonDetRow;
-
-    return 0;
-}
diff --git a/libs/vxf/rldecode.c b/libs/vxf/rldecode.c
deleted file mode 100644
index f39c868..0000000
--- a/libs/vxf/rldecode.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-enum header_flags {
-	zero_run = 0,
-	one_run = 1,
-	byte_run = 2,
-	uncompressed = 3
-};
-
-static int decode(uint8_t *dst, unsigned dsize, const uint8_t src[], unsigned ssize) {
-    int st, type;
-    unsigned size, i, j;
-    
-    for (st = type = 0, i = j = size = 0; i != ssize; ++i) {
-        int x = src[i];
-        
-        switch (st) {
-        case 0:
-            type = x >> 6;
-            size = x & 0x1F;
-            if ((x & 0x20) == 0)
-                goto DECODED;
-            st = 1;
-            break;
-        case 1:
-            size = (size << 7) | (x & 0x7F);
-            if ((x & 0x80) == 0)
-                goto DECODED;
-            st = 2;
-            break;
-        case 2:
-            size = (size << 7) | (x & 0x7F);
-            if ((x & 0x80) == 0)
-                goto DECODED;
-            st = 3;
-            break;
-        case 3:
-            size = (size << 7) | (x & 0x7F);
-            if ((x & 0x80) == 0)
-                goto DECODED;
-            return 1;
-        case 4:
-            dst[j++] = x;
-            if (--size == 0)
-                st = 0;
-            break;
-        case 5:
-            memset(dst + j, x, size);
-            j += size;
-            st = 0;
-            break;
-        }
-        continue;
-    DECODED:
-        if (j + size > dsize)
-            return 1;
-        switch (type) {
-        case uncompressed:
-            if (size == 0) {
-                size = ssize - i - 1;
-                if (j + size > dsize)
-                    return 1;
-                memcpy(dst + j, src + i + 1, size);
-                return 0;
-            }
-            st = 4;
-            break;
-        case zero_run:
-            memset(dst + j, 0, size);
-            j += size;
-            st = 0;
-            break;
-        case one_run:
-            memset(dst + j, 0xFF, size);
-            j += size;
-            st = 0;
-            break;
-        default:
-            st = 5;
-            break;
-        }
-    }
-    return 0;
-}
-
-static
-rc_t CC rldecode_func(
-                   void *Self,
-                   const VXformInfo *info,
-                   VBlobResult *dst,
-                   const VBlobData *src,
-                   VBlobHeader *hdr
-) {
-    int rslt;
-    
-    rslt = decode(dst->data, (unsigned)(((size_t)dst->elem_count * dst->elem_bits + 7) >> 3),
-                  src->data, (unsigned)(((size_t)src->elem_count * src->elem_bits + 7) >> 3));
-    if (rslt)
-        return RC(rcVDB, rcFunction, rcExecuting, rcData, rcCorrupt);
-    return 0;
-}
-
-/* vdb:rldecode
- * function any rldecode #1.0 ( rle_fmt in )
- */
-VTRANSFACT_IMPL(vdb_rldecode, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = rldecode_func;
-    
-    return 0;
-}
-
-#if TESTING
-int rld_test(void *dst, unsigned dsize, const void *src, unsigned ssize) {
-    return decode(dst, dsize, src, ssize);
-}
-#endif
diff --git a/libs/vxf/rlencode.c b/libs/vxf/rlencode.c
deleted file mode 100644
index 05a4890..0000000
--- a/libs/vxf/rlencode.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-enum header_flags {
-	zero_run = 0,
-	one_run = 1,
-	byte_run = 2,
-	uncompressed = 3
-};
-
-#define SPECIAL ((uncompressed) << 6)
-
-#define MAX_RUN_LEN ((size_t)(((size_t)1) << (5 + 3 * 7)))
-#define HEAD_SIZE (4)
-
-static __inline__
-unsigned LENGTH_SIZE(size_t len) {
-    return len < 1 ? 0 : len < 1UL << 6 ? 1 : len < 1UL << 13 ? 2 : len < 1UL << 20 ? 3 : len < 1UL << 27 ? 4 : 0;
-}
-
-static __inline__
-int OUTPUT_SIZE(int type, int len) {
-    switch (type) {
-    case zero_run:
-    case one_run:
-        return LENGTH_SIZE(len);
-    case byte_run:
-        return LENGTH_SIZE(len) + 1;
-    case uncompressed:
-        return LENGTH_SIZE(len) + len;
-    default:
-        return len + 1;
-    }
-}
-
-static __inline__
-int f_HEADER(uint8_t HEAD[], uint8_t FLAG, int rlen) {
-    if (rlen < 1UL << 5) {
-        HEAD[0] = (FLAG << 6) | rlen;
-        return 1;
-    }
-    if (rlen < 1UL << 12) {
-        HEAD[0] = (FLAG << 6) | (1 << 5) | (rlen >> 7);
-        HEAD[1] =                           rlen         & 0x7F;
-        return 2;
-    }
-    if (rlen < 1UL << 19) {
-        HEAD[0] = (FLAG << 6) | (1 << 5) | ( rlen >> 14);
-        HEAD[1] =               (1 << 7) | ((rlen >>  7) & 0x7F);
-        HEAD[2] =                            rlen        & 0x7F;
-        return 3;
-    }
-        HEAD[0] = (FLAG << 6) | (1 << 5) | ( rlen >> 21);
-        HEAD[1] =               (1 << 7) | ((rlen >> 14) & 0x7F);
-        HEAD[2] =               (1 << 7) | ((rlen >>  7) & 0x7F);
-        HEAD[3] =                            rlen        & 0x7F;
-        return 4;
-}
-
-#define HEADER(Y, HEAD, FLAG, LEN) Y = f_HEADER(HEAD, FLAG, LEN)
-
-static __inline__ int rle_write(uint8_t *dst, const uint8_t *dend, const uint8_t *src, int type, size_t len) {
-	uint8_t head[HEAD_SIZE + 1];
-	int i = 0;
-	
-	if (type == SPECIAL) {
-		if (dst + len + 1 > dend)
-			return 0;
-
-		*dst++ = SPECIAL;
-		memcpy(dst, src, len);
-		return (int)len + 1;
-	}
-    if (len >= MAX_RUN_LEN) {
-        i = rle_write(dst, dend, src, type, len >> 1);
-        if (i == 0)
-            return 0;
-        if (type == uncompressed)
-            src += len >> 1;
-        return i + rle_write(dst + i, dend, src, type, len - (len >> 1));
-    }
-	
-	HEADER(i, head, type, (int)len);
-
-	if (type == byte_run)
-		++i;
-	if (dst + i > dend)
-		return 0;
-	switch (type) {
-    case byte_run:
-        head[i - 1] = *src;
-    case zero_run:
-    case one_run:
-        memcpy(dst, head, i);
-        return i;
-    default:
-        break;
-	}
-	if (dst + i + len > dend)
-		return 0;
-	memcpy(dst, head, i);
-	memcpy(dst + i, src, len);
-	return i + (int)len;
-}
-
-#define WRITE(SRC, TYPE, END) do { \
-    int i; \
-    i = rle_write(dst, dend, (SRC), (TYPE), (END) - (SRC)); \
-    if (i == 0) { \
-        i = rle_write(dst, dend, (SRC), SPECIAL, send - (SRC)); \
-        if (i == 0) { \
-            return -1; \
-        } \
-    } \
-    dst += i; \
-} while(0)
-
-static int encode(uint8_t *Dst, unsigned dsize, unsigned *psize, const uint8_t *src, unsigned ssize) {
-    uint8_t *dst = Dst;
-	const uint8_t *const dend = dst + dsize;
-	const uint8_t *const send = src + ssize;
-	const uint8_t *cp = src, *mark = NULL;
-	uint8_t last;
-	int type;
-    unsigned size1, size2, size3;
-	
-	while (last = *cp, ++cp != send) {
-		if (*cp == last) {
-			if (mark == NULL)
-				mark = cp - 1;
-			else
-				continue;
-		}
-		else {
-			if (mark == NULL)
-				continue;
-			if (mark != src) {
-				if (mark - src == 1) {
-					if (*src == 0)
-						type = zero_run;
-					else if (*src == 0xFF)
-						type = one_run;
-					else
-						type = uncompressed;
-				}
-				else
-					type = uncompressed;
-				size1 = OUTPUT_SIZE(type, (int)( mark - src ) );
-				size2 = OUTPUT_SIZE(*mark == 0 ? zero_run : *mark == 0xFF ? one_run : byte_run, (int)(cp - mark) );
-				size3 = OUTPUT_SIZE(uncompressed, (int)(cp - src) );
-				if (size1 + size2 >= size3) {
-					mark = NULL;
-					continue;
-				}
-				WRITE(src, type, mark);
-			}
-			WRITE(mark, *mark == 0 ? zero_run : *mark == 0xFF ? one_run : byte_run, cp);
-			mark = NULL;
-			src = cp;
-		}
-	}
-	if (src != cp) {
-		if (mark == NULL)
-			WRITE(src, SPECIAL, cp);
-		else {
-			if (mark != src) {
-				if (mark - src == 1) {
-					if (*src == 0)
-						type = zero_run;
-					else if (*src == 0xFF)
-						type = one_run;
-					else
-						type = uncompressed;
-				}
-				else
-					type = uncompressed;
-				WRITE(src, type, mark);
-			}
-			WRITE(mark, *mark == 0 ? zero_run : *mark == 0xFF ? one_run : byte_run, cp);
-		}
-	}
-    *psize = (unsigned)(dst - Dst);
-	return 0;
-}
-
-static
-rc_t CC rlencode_func(
-              void *Self,
-              const VXformInfo *info,
-              VBlobResult *dst,
-              const VBlobData *src,
-              VBlobHeader *hdr
-) {
-    unsigned sz;
-    int rc;
-    
-    VBlobHeaderSetVersion(hdr, 0);
-    rc = encode(dst->data, (unsigned)(((size_t)dst->elem_count * dst->elem_bits + 7) >> 3), &sz,
-                src->data, (unsigned)(((size_t)src->elem_count * src->elem_bits + 7) >> 3));
-    if (rc)
-        return RC(rcVDB, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    dst->elem_bits = 1;
-    dst->byte_order = vboNone;
-    dst->elem_count = sz << 3;
-
-    return 0;
-}
-
-/* vdb:rlencode
- * function rle_fmt rlencode #1.0 ( any in )
- */
-VTRANSFACT_IMPL(vdb_rlencode, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = rlencode_func;
-    
-    return 0;
-}
-
-#if TESTING
-int rle_test(void *dst, unsigned dsize, const void *src, unsigned ssize) {
-    unsigned dummy;
-    return encode(dst, dsize, &dummy, src, ssize);
-}
-#endif
-
diff --git a/libs/vxf/round.c b/libs/vxf/round.c
deleted file mode 100644
index 8d74830..0000000
--- a/libs/vxf/round.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <compiler.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-
-#define FLOAT_FUNC roundf
-#define DOUBLE_FUNC round
-#include "math-funcs-impl.h"
-
-/*
- function < type T >
- T vdb:round #1.0 ( T in );
- */
-VTRANSFACT_IMPL(vdb_round, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp ) {
-    return factory(self, info, rslt, cp, dp);
-}
diff --git a/libs/vxf/simple-sub-select.c b/libs/vxf/simple-sub-select.c
deleted file mode 100644
index 044d0aa..0000000
--- a/libs/vxf/simple-sub-select.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-
-
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/sra.h>
-#include <insdc/insdc.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-typedef struct SubSelect SubSelect;
-struct SubSelect
-{
-    const VCursor *curs;
-    uint32_t idx;
-    const VCursor *native_curs; /** Native cursors are either master cursor or sub_cursors - no need to AddRef **/
-    bool  first_time;
-    char  *col_name;
-    uint32_t col_name_len;
-};
-
-static
-rc_t CC simple_sub_select ( void *data, const VXformInfo *info,
-    int64_t local_row_id, VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const SubSelect *self = ( const void* ) data;
-
-    rc_t rc;
-    const void *base;
-    uint32_t elem_bits, boff, row_len;
-    int32_t  idx=0; /*** 0 - means no index ***/
-
-    const int64_t *remote_row_id = argv [ 0 ] . u . data . base;
-    remote_row_id += argv [ 0 ] . u . data . first_elem;
-
-    assert ( argv [ 0 ] . u . data . elem_bits == 64 );
-    if(argv [ 0 ] . u . data . elem_count == 0){/** alow empty returns ***/
-        rc = KDataBufferResize ( rslt -> data, 0 );
-        rslt -> elem_count = 0;
-	return 0;
-    }
-    assert ( argv [ 0 ] . u . data . elem_count == 1 );
-    if(argc > 1 ){
-    	const int32_t *remote_idx = argv[1].u.data.base;
-	idx=remote_idx[argv[1].u.data.first_elem];
-    }
-    if(self->native_curs && self->first_time){ /*** can we use native cursor for the data? ***/
-	SubSelect *mself = (SubSelect *)self;
-	uint32_t idx;
-	rc = VCursorAddColumn ( mself->native_curs, & idx, "%.*s", mself->col_name_len, mself->col_name );
-	if(rc == 0 || GetRCState(rc) == rcExists){
-		VCursorRelease( mself->curs);
-		mself->curs = mself->native_curs;
-		mself->idx  = idx;
-	}
-	mself->first_time = false;
-	rc = 0; /** reset rc? **/
-    }
-	
-    /* sub-select */
-    rc = VCursorCellDataDirect ( self -> curs, * remote_row_id, self -> idx,
-        & elem_bits, & base, & boff, & row_len );
-    if ( rc == 0 )
-    {
-	uint8_t *cbase=(uint8_t*)base + (boff>>3);
-        rslt -> data -> elem_bits = elem_bits;
-	if(idx < 0 || idx > row_len){ /** out of bounds **/
-		rc = KDataBufferResize ( rslt -> data, 0 );
-		rslt -> elem_count = 0;
-		return rc;
-	} else if (idx > 0){ /*** do subset ***/
-		row_len=1;
-		cbase += (elem_bits>>3)*(idx-1);
-		boff  += elem_bits * (idx-1);
-	}
-	
-        rc = KDataBufferResize ( rslt -> data, row_len );
-        if ( rc == 0 )
-        {
-            bitsz_t bits = ( bitsz_t ) elem_bits * row_len;
-
-            if ( ( elem_bits & 7 ) != 0 )
-                bitcpy ( rslt -> data -> base, 0, base, boff, bits );
-            else{
-		assert((boff&7)==0);
-                memcpy ( rslt -> data -> base, cbase, bits>>3 );
- 	    }	
-
-            rslt -> elem_count = row_len;
-        }
-    }
-    else if ( GetRCState ( rc ) == rcNotFound )
-    {
-        rc = KDataBufferResize ( rslt -> data, 0 );
-        rslt -> elem_count = 0;
-    }
-
-    return rc;
-}
-
-
-/* open_sub_cursor
- */
-static
-rc_t open_sub_cursor ( SubSelect **fself, const VXfactInfo *info, const VFactoryParams *cp, const VCursor *native_curs )
-{
-    rc_t rc=0;
-    const VTable *tbl, *ftbl = NULL;
-    char name[256]="";
-    const VCursor *curs;
-
-    if ( cp -> argv [ 0 ] . count > 0 )
-    {
-	sprintf(name,"%.*s",(int)cp->argv[0].count,cp->argv[0].data.ascii);
-	rc = VCursorLinkedCursorGet(native_curs,name,&curs);
-	if(rc == 0){
-		rc = VCursorOpenParentRead(curs,&ftbl);
-		if(rc != 0)
-			return rc;
-		VCursorAddRef(curs);
-		tbl = ftbl;
-	} else {
-		const VDatabase *db;
-		rc = VTableOpenParentRead ( info -> tbl, & db );
-		if(rc != 0) return rc;
-		rc = VDatabaseOpenTableRead ( db, & ftbl,name);
-		if(rc != 0) return rc;
-		VDatabaseRelease ( db );
-		tbl = ftbl;
-		rc = VTableCreateCachedCursorRead ( tbl, (const VCursor**)& curs, 256*1024*1024 ); /*** some random io is expected ***/
-		if(rc != 0) return rc;
-		rc = VCursorPermitPostOpenAdd( curs );
-		if(rc != 0) return rc;
-		rc = VCursorOpen( curs );
-		if(rc != 0) return rc;
-		rc = VCursorLinkedCursorSet(native_curs,name,curs);
-		if(rc != 0) return rc;
-	}
-	native_curs = NULL;
-    }
-    else /** we don't now if native_curs permits adding columns **/
-    {
-        tbl = info -> tbl;
-	rc = VTableCreateCachedCursorRead ( tbl, & curs, 0 ); /*** some random io is expected ***/
-    }
-    if ( rc == 0 )
-    {
-            uint32_t idx;
-            rc = VCursorAddColumn ( curs, & idx, "%.*s",
-                ( int ) cp -> argv [ 1 ] . count, cp -> argv [ 1 ] . data . ascii );
-            if ( rc == 0 || GetRCState(rc) == rcExists)
-            {
-                rc = VCursorOpen ( curs );
-                if ( rc == 0 )
-                {
-                    VTypedesc src;
-                    rc = VCursorDatatype ( curs, idx, NULL, & src );
-                    if ( rc == 0 )
-                    {
-                        /* selected column should have same characteristics */
-                        if ( src . domain != info -> fdesc . desc . domain                 ||
-                             src . intrinsic_bits != info -> fdesc . desc . intrinsic_bits ||
-                             src . intrinsic_dim != info -> fdesc . desc. intrinsic_dim )
-                        {
-                            rc = RC ( rcXF, rcFunction, rcConstructing, rcType, rcInconsistent );
-                        }
-                        else
-                        {
-                            SubSelect *self = malloc ( sizeof * self );
-                            if ( self == NULL )
-                                rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-                            else
-                            {
-                                self -> curs = curs;
-                                self -> idx = idx;
-				self->native_curs = native_curs;
-				self->first_time  = true;
-				self->col_name_len  = cp->argv[1].count;
-				self->col_name = malloc(self->col_name_len);
-				memcpy(self->col_name,cp->argv[1].data.ascii,self->col_name_len);
-                                * fself = self;
-                                if ( ftbl != NULL )
-                                    VTableRelease ( ftbl );
-                                return 0;
-                            }
-                        }
-                    }
-                }
-            }
-            VCursorRelease ( curs );
-    }
-    if ( ftbl != NULL )
-        VTableRelease ( ftbl );
-
-    return rc;
-}
-
-
-/* close_sub_cursor
- */
-static
-void CC close_sub_cursor ( void *data )
-{
-    SubSelect *self = data;
-    if(self->curs != self->native_curs) VCursorRelease ( self -> curs );
-    free ( self->col_name);
-    free ( self );
-}
-
-
-/* 
- * function < type T >
- * T simple_sub_select < ascii tbl, ascii col > ( I64 row * I32 elem_idx(1-based) )
- *     = vdb:simple_sub_select;
- */
-VTRANSFACT_IMPL ( vdb_simple_sub_select_1, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    SubSelect *fself;
-
-    assert ( cp -> argc == 2 );
-    assert ( dp -> argc == 1 || dp -> argc == 2);
-
-    rc = open_sub_cursor ( & fself, info, cp, (const VCursor*)info->parms );
-    if ( rc == 0 )
-    {
-        rslt -> self = fself;
-        rslt -> u . rf = simple_sub_select;
-        rslt -> variant = vftRow;
-        rslt -> whack = close_sub_cursor;
-    }
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( vdb_simple_sub_select, 0, 9, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    return VTRANSFACT_NAME ( vdb_simple_sub_select_1 ) ( self, info, rslt, cp, dp );
-}
diff --git a/libs/vxf/sprintf.c b/libs/vxf/sprintf.c
deleted file mode 100644
index 385d25c..0000000
--- a/libs/vxf/sprintf.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* the number of PrintFmt, PrintArg and String
-   elements to allocate in function-local storage */
-#define LOCAL_FMT_COUNT 64
-
-
-typedef struct Sprintf Sprintf;
-struct Sprintf
-{
-    const PrintFmt *fmt;
-    PrintArg *args;
-    String *str;
-};
-
-static uint8_t const radix2_size [ 4 ] = { 8, 16, 32, 64 };
-static uint8_t const radix8_size [ 4 ] = { 3, 6, 11, 22 };
-static uint8_t const radix10_size [ 4 ] = { 3, 5, 10, 20 };
-static uint8_t const radix16_size [ 4 ] = { 2, 4, 8, 16 };
-
-#if _DEBUGGING
-static
-rc_t validate_obj ( const Sprintf *obj, bool fmt_only )
-{
-    uint32_t i;
-
-    /* validate the format blocks */
-    for ( i = 0; obj -> fmt [ i ] . type != sptTerm; ++ i )
-    {
-        /* at this point, only looking for bad formats */
-        if ( obj -> fmt [ i ] . type == sptLiteral )
-        {
-            if ( obj -> fmt [ i ] . u . l . text == NULL )
-                return RC ( rcXF, rcFunction, rcConstructing, rcString, rcNull );
-            if ( obj -> fmt [ i ] . u . l . size == 0 )
-                return RC ( rcXF, rcFunction, rcConstructing, rcString, rcEmpty );
-            if ( string_chr ( obj -> fmt [ i ] . u . l . text, obj -> fmt [ i ] . u . l . size, 0 ) != NULL )
-                return RC ( rcXF, rcFunction, rcConstructing, rcString, rcInvalid );
-        }
-    }
-
-    return 0;
-}
-#endif
-
-static
-size_t get_radix_size ( const PrintFmt *fmt, uint32_t selector )
-{
-    const uint8_t *radix_size;
-    switch ( fmt -> radix )
-    {
-    case 0:
-        return 0;
-    case 10:
-        radix_size = radix10_size;
-        break;
-    case 16:
-        radix_size = radix16_size;
-        break;
-    case 8:
-        radix_size = radix8_size;
-        break;
-    default:
-        radix_size = radix2_size;
-    }
-    return radix_size [ selector ];
-}
-
-typedef struct FuncArgs FuncArgs;
-struct FuncArgs
-{
-    const VRowData *argv;
-    uint32_t argc;
-    uint32_t idx;
-};
-
-static
-const void *access_cell_data ( FuncArgs *args, uint64_t *row_len, size_t *size )
-{
-    size_t elem_bytes;
-    const uint8_t *data;
-
-    if ( args -> idx == args -> argc )
-        return NULL;
-
-    elem_bytes = args -> argv [ args -> idx ] . u . data . elem_bits / 8;
-    assert ( elem_bytes * 8 == args -> argv [ args -> idx ] . u . data . elem_bits );
-
-    data = args -> argv [ args -> idx ] . u . data . base;
-    * row_len = args -> argv [ args -> idx ] . u . data . elem_count;
-
-    data += args -> argv [ args -> idx ] . u . data . first_elem * elem_bytes;
-
-    if ( size != NULL )
-        * size = ( size_t ) ( * row_len * elem_bytes );
-
-    ++ args -> idx;
-    return data;
-}
-
-static
-rc_t capture_uint_scalar ( FuncArgs *args, uint64_t *val )
-{
-    uint64_t row_len;
-    const void *data = access_cell_data ( args, & row_len, NULL );
-
-    if ( data == NULL )
-        return RC ( rcXF, rcFunction, rcExecuting, rcData, rcNull );
-
-    if ( row_len != 1 )
-        return RC ( rcXF, rcFunction, rcExecuting, rcRange, rcExcessive );
-
-    switch ( args -> argv [ args -> idx - 1 ] . u . data . elem_bits )
-    {
-    case 8:
-        * val = * ( const uint8_t* ) data;
-        break;
-    case 16:
-        * val = * ( const uint16_t* ) data;
-        break;
-    case 32:
-        * val = * ( const uint32_t* ) data;
-        break;
-    case 64:
-        * val = * ( const uint64_t* ) data;
-        break;
-    }
-
-    return 0;
-}
-
-static
-rc_t CC sprintf_func ( void *obj,
-     const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-     uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    size_t cell_size;
-    uint32_t str_idx, fmt_idx, arg_idx;
-
-    Sprintf *self = obj;
-
-    const PrintFmt *fmt = self -> fmt;
-    PrintArg *args = self -> args;
-    String *str = self -> str;
-
-    FuncArgs vargs;
-    vargs . argv = argv;
-    vargs . argc = argc;
-    vargs . idx = 0;
-
-    str_idx = fmt_idx = arg_idx = 0;
-
-#if _DEBUGGING
-    rc = validate_obj ( self, false );
-    if ( rc != 0 )
-        KDbgMsg ( "%s - self is bad on entry: %R\n", __func__, rc );
-#endif
-
-    /* initial pass - prepare argument list & estimate cell size */
-    for ( rc = 0, cell_size = 0; fmt [ fmt_idx ] . type != sptTerm; ++ fmt_idx )
-    {
-        size_t arg_size;
-        bool check_index;
-        uint64_t row_len, start_idx, select_len;
-        uint32_t ext_start_index, ext_stop_index;
-
-        row_len = 0;
-
-        /* test for external field width, precision, index */
-        if ( fmt [ fmt_idx ] . ext_field_width )
-        {
-            rc = capture_uint_scalar ( & vargs, & args [ arg_idx ++ ] . u );
-            if ( rc != 0 )
-                return rc;
-        }
-        if ( fmt [ fmt_idx ] . ext_precision )
-        {
-            rc = capture_uint_scalar ( & vargs, & args [ arg_idx ++ ] . u );
-            if ( rc != 0 )
-                return rc;
-        }
-
-        if ( ! fmt [ fmt_idx ] . ext_start_index )
-            start_idx = fmt [ fmt_idx ] . u . f . start_idx;
-        else
-        {
-            /* if the start index is the last in vector,
-               this needs to be suspended until later */
-            if ( ! fmt [ fmt_idx ] . inf_start_index )
-            {
-                rc = capture_uint_scalar ( & vargs, & start_idx );
-                if ( rc != 0 )
-                    return rc;
-                args [ arg_idx ] . u = start_idx;
-            }
-
-            ext_start_index = arg_idx ++;
-        }
-
-        if ( ! fmt [ fmt_idx ] . ext_stop_index && ! fmt [ fmt_idx ] . ext_select_len )
-            select_len = fmt [ fmt_idx ] . u . f . select_len;
-        else
-        {
-            /* if the stop index is the last in vector,
-               this needs to be suspended until later */
-            if ( ! fmt [ fmt_idx ] . inf_stop_index )
-            {
-                rc = capture_uint_scalar ( & vargs, & select_len );
-                if ( rc != 0 )
-                    return rc;
-                args [ arg_idx ] . u = select_len;
-            }
-            ext_stop_index = arg_idx ++;
-        }
-
-        /* make an estimate of the bytes needed by sprintf engine for argument
-           get row_len at the same time */
-        check_index = false;
-        switch ( fmt [ fmt_idx ] . type )
-        {
-        case sptLiteral:                     /* char literal        - arg in fmt   */
-            assert ( fmt [ fmt_idx ] . u . l . text != NULL );
-            arg_size = fmt [ fmt_idx ] . u . l . size;
-            row_len = arg_size;
-            -- arg_idx;
-            break;
-        case sptSignedInt8Vect:              /* signed vector int   - arg is d8    */
-            args [ arg_idx ] . d8 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 0 ) + 1;
-            break;
-        case sptSignedInt16Vect:             /* signed vector int   - arg is d16   */
-            args [ arg_idx ] . d16 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 1 ) + 1;
-            break;
-        case sptSignedInt32Vect:             /* signed vector int   - arg is d32   */
-            args [ arg_idx ] . d32 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 2 ) + 1;
-            break;
-        case sptSignedInt64Vect:             /* signed vector int   - arg is d64   */
-            args [ arg_idx ] . d64 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 3 ) + 1;
-            break;
-        case sptUnsignedInt8Vect:            /* unsigned vector int - arg is u8    */
-            args [ arg_idx ] . u8 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 0 ) + 2;
-            break;
-        case sptUnsignedInt16Vect:           /* unsigned vector int - arg is u16   */
-            args [ arg_idx ] . u16 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 1 ) + 2;
-            break;
-        case sptUnsignedInt32Vect:           /* unsigned vector int - arg is u32   */
-            args [ arg_idx ] . u32 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 2 ) + 2;
-            break;
-        case sptUnsignedInt64Vect:           /* unsigned vector int - arg is u64   */
-            args [ arg_idx ] . u64 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 3 ) + 2;
-            break;
-        case sptFloat32Vect:                 /* vector float        - arg is f32   */
-            args [ arg_idx ] . f32 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = 32;
-            break;
-        case sptFloat64Vect:                 /* vector float        - arg is f64   */
-            args [ arg_idx ] . f64 = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = 32;
-            break;
-        case sptFloatLongVect:               /* vector float        - arg is flong */
-            args [ arg_idx ] . flong = access_cell_data ( & vargs, & row_len, NULL );
-            arg_size = 32;
-            break;
-        case sptString:                      /* vector character    - arg is S     */
-            str [ str_idx ] . addr = access_cell_data ( & vargs, & row_len, & str [ str_idx ] . size );
-            str [ str_idx ] . len = ( uint32_t ) str [ str_idx ] . size;
-            arg_size = str [ str_idx ] . size;
-            args [ arg_idx ] . S = & str [ str_idx ++ ];
-            check_index = true;
-            break;
-        case sptUCS2String:                  /* vector character    - arg is S     */
-        case sptUTF32String:                 /* vector character    - arg is S     */
-            return RC ( rcXF, rcFunction, rcExecuting, rcType, rcUnsupported );
-        case sptRowId:                       /* current row id      - arg is d     */
-            args [ arg_idx ] . d = row_id;
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 3 ) + 1;
-            ++ arg_idx;
-            continue;
-        case sptRowLen:                      /* current row length  - arg is u     */
-            access_cell_data ( & vargs, & args [ arg_idx ] . u, NULL );
-            arg_size = get_radix_size ( & fmt [ fmt_idx ], 3 ) + 2;
-            ++ arg_idx;
-            continue;
-        }
-
-        /* back-fill based upon row-length in case of non-empty rows */
-        if ( row_len != 0 )
-        {
-            /* start index is last in row */
-            if ( fmt [ fmt_idx ] . inf_start_index )
-                start_idx = args [ ext_start_index ] . u = row_len - 1;
-
-            /* end index is last in row */
-            if ( fmt [ fmt_idx ] . inf_stop_index )
-                select_len = args [ ext_stop_index ] . u = row_len - 1;
-        }
-
-        /* detect runtime error condition */
-        if ( start_idx >= row_len )
-            args [ arg_idx ] . p = NULL;
-        else
-        {
-            /* adjust size by index */
-            if ( check_index )
-            {
-                /* the select_len should be correct,
-                   unless the end is a stop coordinate */
-                if ( fmt [ fmt_idx ] . ext_stop_index )
-                {
-                    if ( select_len <= start_idx )
-                        select_len = 1;
-                    else
-                        select_len -= start_idx - 1;
-                }
-
-                /* select_len of 0 means infinite */
-                if ( select_len == 0 )
-                    select_len = row_len - start_idx;
-
-                /* real size after sub-str */
-                arg_size = argv [ vargs . idx - 1 ] . u . data . elem_bits * select_len / 8;
-            }
-
-            /* incorporate size into calcuation */
-            cell_size += arg_size;
-        }
-
-        /* done with argument */
-        ++ arg_idx;
-    }
-
-    /* round cell-size up to nearest 4K */
-    cell_size = ( cell_size + 4095 ) & ~ ( size_t ) 4095;
-
-    /* set output buffer size */
-    rc = KDataBufferResize( rslt -> data, cell_size );
-    if ( rc == 0 )
-    {
-#if _DEBUGGING
-        rc = validate_obj ( self, false );
-        if ( rc != 0 )
-            KDbgMsg ( "%s - self is bad before invoking structured_sprintf: %R\n", __func__, rc );
-#endif
-        /* invoke sprintf engine */
-        rc = structured_sprintf ( rslt -> data -> base,
-            rslt -> data -> elem_count, & cell_size, fmt, args );
-
-        /* recover from buffer insufficient */
-        if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer )
-        {
-            rc = KDataBufferResize ( rslt -> data, cell_size + 1 );
-            if ( rc == 0 )
-            {
-                rc = structured_sprintf ( rslt -> data -> base,
-                    rslt -> data -> elem_count, & cell_size, fmt, args );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            /* set the return parameters */
-            rc = KDataBufferResize ( rslt -> data, cell_size );
-            if ( rc == 0 )
-            {
-                rslt -> elem_count = cell_size;
-                rslt -> elem_bits = 8;
-            }
-        }
-    }
-
-    return rc;
-}
-
-typedef struct ParseData ParseData;
-struct ParseData
-{
-    KDataBuffer overflow;
-    size_t fmt_size;
-    size_t lit_size;
-    PrintFmt *fmt;
-    uint32_t str_idx;
-    uint32_t fmt_idx;
-    uint32_t arg_idx;
-};
-
-/* create_overflow
- *  create a buffer so large that it cannot overflow again
- *  copy in existing structures
- */
-static
-rc_t create_overflow ( ParseData *pd, uint32_t fmt_idx )
-{
-    /* infer that we can never have more format items than characters in the string... */
-
-    /* our size will create a format for every byte.
-       this should be a total overkill. */
-    size_t buff_size = sizeof pd -> fmt [ 0 ] * pd -> fmt_size;
-
-    /* make the buffer */
-    rc_t rc = KDataBufferMakeBytes ( & pd -> overflow, buff_size );
-    if ( rc == 0 )
-    {
-        /* capture pointers to stack structures */
-        const PrintFmt *fmt = pd -> fmt;
-
-        /* destination pointer */
-        pd -> fmt = pd -> overflow . base;
-
-        /* copy existing data */
-        memcpy ( pd -> fmt, fmt, fmt_idx * sizeof pd -> fmt [ 0 ] );
-   }
-
-    pd -> fmt_idx = fmt_idx;
-
-    return rc;
-}
-
-typedef struct VAList VAList;
-struct VAList
-{
-    const VFunctionParams *dp;
-    uint32_t idx;
-};
-
-static
-rc_t check_integer_arg ( VAList *vargs )
-{
-    if ( vargs -> idx == vargs -> dp -> argc )
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcInsufficient );
-
-    switch ( vargs -> dp -> argv [ vargs -> idx ] . desc . domain )
-    {
-    case vtdBool:
-    case vtdInt:
-    case vtdUint:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-    }
-
-    switch ( VTypedescSizeof ( & vargs -> dp -> argv [ vargs -> idx ] . desc ) )
-    {
-    case 8:
-    case 16:
-    case 32:
-    case 64:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-    }
-
-    ++ vargs -> idx;
-    return 0;
-}
-
-static
-rc_t extract_size_modifier ( VAList *vargs, char *size_modifier )
-{
-    switch ( vargs -> dp -> argv [ vargs -> idx ] . desc . domain )
-    {
-    case vtdBool:
-        * size_modifier = 0;
-        break;
-    case vtdUint:
-    case vtdInt:
-        switch ( VTypedescSizeof ( & vargs -> dp -> argv [ vargs -> idx ] . desc ) )
-        {
-        case 8:
-            * size_modifier = 't';
-            break;
-        case 16:
-            * size_modifier = 'h';
-            break;
-        case 32:
-            * size_modifier = 0;
-            break;
-        case 64:
-            * size_modifier = 'l';
-            break;
-        default:
-            return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-        }
-        break;
-    case vtdFloat:
-        switch ( VTypedescSizeof ( & vargs -> dp -> argv [ vargs -> idx ] . desc ) )
-        {
-        case 32:
-            * size_modifier = 'h';
-            break;
-        case 64:
-            * size_modifier = 0;
-            break;
-        default:
-            return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-        }
-        break;
-    case vtdAscii:
-        * size_modifier = 0;
-        break;
-    case vtdUnicode:
-        switch ( vargs -> dp -> argv [ vargs -> idx ] . desc . intrinsic_bits )
-        {
-        case 8:
-            * size_modifier = 0;
-            break;
-        case 16:
-            * size_modifier = 'h';
-            break;
-        case 32:
-            * size_modifier = 'l';
-            break;
-        default:
-            return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-        }
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcIncorrect );
-    }
-    return 0;
-}
-
-
-/* parse_format_string
- *  parse format string and args into structured format
- */
-static
-rc_t parse_format_string ( const char *fmt_str, ParseData *pd, VAList *vargs )
-{
-    rc_t rc;
-    uint32_t i, fmt_idx;
-
-    PrintFmt *fmt = pd -> fmt;
-
-    /* initialize returned counters */
-    pd -> lit_size = 0;
-    pd -> str_idx = pd -> fmt_idx = pd -> arg_idx = 0;
-
-    /* loop over format string */
-    for ( rc = 0, i = fmt_idx = 0; fmt_str [ i ] != 0; ++ i )
-    {
-        uint32_t domain;
-        bool alternate, numeric;
-        char size_modifier, time_modifier;
-        bool has_width, has_precision, has_index;
-
-        /* loop to gather literal portions */
-        uint32_t start;
-        for ( start = i; ; ++ i )
-        {
-            /* run until we hit start of substitution token
-               or until we hit end of format string */
-            if ( fmt_str [ i ] != 0 && fmt_str [ i ] != '%' )
-                continue;
-
-            /* detect a literal string */
-            if ( i != start )
-            {
-                /* expand into overflow */
-                if ( fmt_idx == LOCAL_FMT_COUNT )
-                {
-                    rc = create_overflow ( pd, fmt_idx );
-                    if ( rc != 0 )
-                        return rc;
-
-                    fmt = pd -> fmt;
-                }
-
-                /* create a text-literal format */
-                memset ( & fmt [ fmt_idx ], 0, sizeof fmt [ 0 ] );
-                fmt [ fmt_idx ] . u . l . text = & fmt_str [ start ];
-                fmt [ fmt_idx ] . u . l . size = i - start;
-                pd -> lit_size += i - start;
-                fmt [ fmt_idx ] . fmt = spfText;
-                fmt [ fmt_idx ] . type = sptLiteral;
-
-                /* increment counter */
-                ++ fmt_idx;
-            }
-
-            /* detect escape sequence */
-            if ( fmt_str [ i ] == 0 || fmt_str [ i + 1 ] != '%' )
-                break;
-
-            /* skip over escape */
-            start = ++ i;
-        }
-
-        /* done when NUL byte is seen */
-        if ( fmt_str [ i ] == 0 )
-            break;
-
-        /* detect overflow */
-        if ( fmt_idx == LOCAL_FMT_COUNT )
-        {
-            rc = create_overflow ( pd, fmt_idx );
-            if ( rc != 0 )
-                return rc;
-
-            fmt = pd -> fmt;
-        }
-
-        /* initial format
-         *  thousands_separate    = false
-         *  add_prefix            = false
-         *  force_decimal_point   = false
-         *  leave_trailing_zeros  = false
-         *  print_time            = false
-         *  print_date            = false
-         *  print_weekday         = false
-         *  print_timezone        = false
-         *  hour_24               = false
-         *  sign                  = 0
-         *  left_fill             = space
-         */
-        memset ( & fmt [ fmt_idx ], 0, sizeof fmt [ 0 ] );
-        fmt [ fmt_idx ] . left_fill = ' ';
-
-        /* scan flags */
-        alternate = false;
-        while ( 1 )
-        {
-            switch ( fmt_str [ ++ i ] )
-            {
-                /* plus and space modify application of sign
-                   to signed integer and floating point conversions.
-                   plus overrides space. */
-            case ' ':
-                if ( fmt [ fmt_idx ] . sign == 0 )
-            case '+':
-                    fmt [ fmt_idx ] . sign = fmt_str [ i ];
-                continue;
-
-                /* dash indicates left-alignment. indicate this
-                   by setting "left_fill" to NUL. */
-            case '-':
-                fmt [ fmt_idx ] . left_fill = 0;
-                continue;
-
-                /* zero indicates an alternate left-fill for
-                   numeric conversions. the zero is inserted before
-                   any sign character in { '+', '-' or ' ' }.
-                   since "left_fill" is also used to indicate
-                   alignment, only store when right aligning. */
-            case '0':
-                if ( fmt [ fmt_idx ] . left_fill != 0 )
-                    fmt [ fmt_idx ] . left_fill = '0';
-                continue;
-
-                /* hash indicates that the formatter should use an
-                   "alternate" approach. that approach is specific
-                   to the format. */
-            case '#':
-                alternate = true;
-                continue;
-
-                /* comma ( or apostrophe outside of US ) indicates
-                   that the integer portion of a numeral should use
-                   a comma as a thousands separator for legibility. */
-            case ',':
-            case '\'':
-                fmt [ fmt_idx ] . thousands_separate = 1;
-                continue;
-            }
-
-            /* we've hit a non-flag character */
-            break;
-        }
-
-        /* minimum field width */
-        has_width = false;
-        if ( isdigit ( fmt_str [ i ] ) )
-        {
-            /* literal */
-            has_width = true;
-            fmt [ fmt_idx ] . u . f . min_field_width = fmt_str [ i ] - '0';
-            while ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                fmt [ fmt_idx ] . u . f . min_field_width *= 10;
-                fmt [ fmt_idx ] . u . f . min_field_width += fmt_str [ i ] - '0';
-            }
-        }
-        else if ( fmt_str [ i ] == '*' )
-        {
-            /* external */
-            rc = check_integer_arg ( vargs );
-            if ( rc != 0 )
-                return rc;
-
-            has_width = true;
-            fmt [ fmt_idx ] . ext_field_width = 1;
-            ++ pd -> arg_idx;
-            ++ i;
-        }
-
-        /* precision */
-        has_precision = false;
-        if ( fmt_str [ i ] == '.' )
-        {
-            /* a single dot implies a precision value of 0 */
-            has_precision = true;
-
-            if ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                /* a literal precision */
-                fmt [ fmt_idx ] . u . f . precision = fmt_str [ i ] - '0';
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    fmt [ fmt_idx ] . u . f . precision *= 10;
-                    fmt [ fmt_idx ] . u . f . precision += fmt_str [ i ] - '0';
-                }
-            }
-            else if ( fmt_str [ i ] == '*' )
-            {
-                /* external */
-                rc = check_integer_arg ( vargs );
-                if ( rc != 0 )
-                    return rc;
-
-                fmt [ fmt_idx ] . ext_precision = 1;
-                ++ pd -> arg_idx;
-                ++ i;
-            }
-            else if ( fmt_str [ i ] == '-' )
-            {
-                /* eat a negative precision - treat as 0 */
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                    ( void ) 0;
-            }
-        }
-
-        /* index - given when parameter is a vector */
-        has_index = false;
-        if ( fmt_str [ i ] == ':' )
-        {
-            bool has_start, has_len, has_end, end_is_stop;
-            has_start = has_len = has_end = end_is_stop = false;
-
-            /* parameter is taken as a vector,
-               with a default index starting at 0 */
-            has_index = true;
-
-            if ( isdigit ( fmt_str [ ++ i ] ) )
-            {
-                /* literal index */
-                fmt [ fmt_idx ] . u . f . start_idx = fmt_str [ i ] - '0';
-                while ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    fmt [ fmt_idx ] . u . f . start_idx *= 10;
-                    fmt [ fmt_idx ] . u . f . start_idx += fmt_str [ i ] - '0';
-                }
-                has_start = true;
-            }
-            else switch ( fmt_str [ i ] )
-            {
-            case '*':
-                /* external */
-                rc = check_integer_arg ( vargs );
-                if ( rc != 0 )
-                    return rc;
-
-                fmt [ fmt_idx ] . ext_start_index = 1;
-                ++ pd -> arg_idx;
-                ++ i;
-                has_start = true;
-                break;
-            case '$':
-                fmt [ fmt_idx ] . inf_start_index = 1;
-                fmt [ fmt_idx ] . ext_start_index = 1;
-                ++ pd -> arg_idx;
-                ++ i;
-                has_start = true;
-                break;
-            }
-
-            /* detect range */
-            switch ( fmt_str [ i ] )
-            {
-                /* given as start-stop */
-            case '-':
-                end_is_stop = true;
-
-                /* given as start/len */
-            case '/':
-
-                has_len = true;
-
-                if ( isdigit ( fmt_str [ ++ i ] ) )
-                {
-                    /* literal selection length or end */
-                    fmt [ fmt_idx ] . u . f . select_len = fmt_str [ i ] - '0';
-                    while ( isdigit ( fmt_str [ ++ i ] ) )
-                    {
-                        fmt [ fmt_idx ] . u . f . select_len *= 10;
-                        fmt [ fmt_idx ] . u . f . select_len += fmt_str [ i ] - '0';
-                    }
-                    has_end = true;
-                }
-                else switch ( fmt_str [ i ] )
-                {
-                case '*':
-                    /* external */
-                    rc = check_integer_arg ( vargs );
-                    if ( rc != 0 )
-                        return rc;
-
-                    /* external selection length or end */
-                    fmt [ fmt_idx ] . ext_stop_index = end_is_stop;
-                    fmt [ fmt_idx ] . ext_select_len = ! end_is_stop;
-                    ++ pd -> arg_idx;
-                    ++ i;
-                    has_end = true;
-                    break;
-                case '$':
-                    /* ignore index end if start is infinite */
-                    if ( ! fmt [ fmt_idx ] . inf_start_index )
-                    {
-                        fmt [ fmt_idx ] . inf_stop_index = 1;
-                        fmt [ fmt_idx ] . ext_stop_index = 1;
-                        ++ pd -> arg_idx;
-                        end_is_stop = has_end = true;
-                    }
-                    ++ i;
-                    break;
-                case '-':
-                    /* negatives are garbage */
-                    while ( isdigit ( fmt_str [ ++ i ] ) )
-                        ( void ) 0;
-                    break;
-                default:
-                    end_is_stop = false;
-                }
-                break;
-            }
-
-            if ( ! has_len && has_start )
-                fmt [ fmt_idx ] . u . f . select_len = 1;
-        }
-
-        /* size - accept for brownie-points and for KTime */
-        size_modifier = time_modifier = 0;
-        switch ( fmt_str [ i ] )
-        {
-            /* "Tiny" modifier - like "hh" in C format */
-        case 't':
-            /* "Half" modifier - same as C format */
-        case 'h':
-            /* "Long" modifier - means 64-bit for integers, otherwise like C */
-        case 'l':
-            size_modifier = time_modifier = fmt_str [ i ++ ];
-            break;
-            /* "siZe" modifier - whatever the size of size_t is */
-        case 'z':
-            ++ i;
-            time_modifier = 'z';
-            if ( sizeof ( size_t ) == sizeof ( uint64_t ) )
-                size_modifier = 'l';
-            break;
-        }
-
-        /* output format
-           describes the formatting to apply on output
-           if precision has not been set, give it a default value */
-        domain = 0;
-        numeric = false;
-        switch ( fmt_str [ i ] )
-        {
-            /* decimal signed integer */
-        case 'd':
-        case 'i':
-            fmt [ fmt_idx ] . radix = 10;
-            fmt [ fmt_idx ] . fmt = spfSignedInt;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 1;
-            else if ( fmt [ fmt_idx ] . left_fill == '0' )
-                fmt [ fmt_idx ] . left_fill = ' ';
-            domain = vtdInt;
-            break;
-
-            /* decimal unsigned integer */
-        case 'u':
-            fmt [ fmt_idx ] . radix = 10;
-        unsigned_int:
-            fmt [ fmt_idx ] . fmt = spfUnsigned;
-            fmt [ fmt_idx ] . sign = 0;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 1;
-            else if ( fmt [ fmt_idx ] . left_fill == '0' )
-                fmt [ fmt_idx ] . left_fill = ' ';
-            domain = vtdUint;
-            break;
-
-            /* hex unsigned integer */
-        case 'x':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 16;
-            goto unsigned_int;
-
-            /* upper-case hex unsigned integer */
-        case 'X':
-            fmt [ fmt_idx ] . upper_case_num = 1;
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 16;
-            goto unsigned_int;
-
-            /* octal unsigned integer */
-        case 'o':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 8;
-            goto unsigned_int;
-
-            /* binary unsigned integer */
-        case 'b':
-            fmt [ fmt_idx ] . add_prefix = alternate;
-            fmt [ fmt_idx ] . radix = 2;
-            goto unsigned_int;
-
-            /* decimal signed floating point */
-        case 'f':
-            fmt [ fmt_idx ] . fmt = spfStdFloat;
-        fmt_float:
-            fmt [ fmt_idx ] . radix = 10;
-            fmt [ fmt_idx ] . force_decimal_point = alternate;
-            numeric = true;
-            if ( ! has_precision )
-                fmt [ fmt_idx ] . u . f . precision = 6;
-            domain = vtdFloat;
-            break;
-
-            /* scientific notation floating point */
-        case 'e':
-            fmt [ fmt_idx ] . fmt = spfSciFloat;
-            goto fmt_float;
-
-            /* "general" floating point */
-        case 'g':
-            fmt [ fmt_idx ] . leave_trailing_zeros = alternate;
-            fmt [ fmt_idx ] . fmt = spfGenFloat;
-            goto fmt_float;
-
-            /* character data */
-        case 's':
-            if ( ! has_precision )
-            /* no break */
-        case 'c':
-                fmt [ fmt_idx ] . u . f . precision = -1;
-            fmt [ fmt_idx ] . fmt = spfText;
-            domain = vtdUnicode;
-            break;
-
-        default:
-            return RC ( rcXF, rcString, rcFormatting, rcFormat, rcUnrecognized );
-        }
-
-        /* handle zero padding for non-numeric cases */
-        if ( ! numeric && fmt [ fmt_idx ] . left_fill == '0' )
-            fmt [ fmt_idx ] . left_fill = ' ';
-
-        /* take size from actual parameter */
-        rc = extract_size_modifier ( vargs, & size_modifier );
-        if ( rc != 0 )
-            return rc;
-
-        /* determine type from argument */
-        switch ( vargs -> dp -> argv [ vargs -> idx ] . desc . domain )
-        {
-        case vtdBool:
-        case vtdUint:
-            switch ( domain )
-            {
-            case vtdBool:
-            case vtdUint:
-            case vtdInt:
-                break;
-            case vtdFloat:
-                fmt [ fmt_idx ] . type_cast = 1;
-                break;
-            default:
-                return RC ( rcXF, rcString, rcFormatting, rcParam, rcIncorrect );
-            }
-
-            switch ( size_modifier )
-            {
-            case 't':
-                fmt [ fmt_idx ] . type = sptUnsignedInt8Vect;
-                break;
-            case 'h':
-                fmt [ fmt_idx ] . type = sptUnsignedInt16Vect;
-                break;
-            case 0:
-                fmt [ fmt_idx ] . type = sptUnsignedInt32Vect;
-                break;
-            case 'l':
-                fmt [ fmt_idx ] . type = sptUnsignedInt64Vect;
-                break;
-            }
-            break;
-
-        case vtdInt:
-            switch ( domain )
-            {
-            case vtdBool:
-            case vtdUint:
-            case vtdInt:
-                break;
-            case vtdFloat:
-                fmt [ fmt_idx ] . type_cast = 1;
-                break;
-            default:
-                return RC ( rcXF, rcString, rcFormatting, rcParam, rcIncorrect );
-            }
-
-            switch ( size_modifier )
-            {
-            case 't':
-                fmt [ fmt_idx ] . type = sptSignedInt8Vect;
-                break;
-            case 'h':
-                fmt [ fmt_idx ] . type = sptSignedInt16Vect;
-                break;
-            case 0:
-                fmt [ fmt_idx ] . type = sptSignedInt32Vect;
-                break;
-            case 'l':
-                fmt [ fmt_idx ] . type = sptSignedInt64Vect;
-                break;
-            }
-            break;
-
-        case vtdFloat:
-            switch ( domain )
-            {
-            case vtdBool:
-            case vtdUint:
-            case vtdInt:
-                fmt [ fmt_idx ] . type_cast = 1;
-                break;
-            case vtdFloat:
-                break;
-            default:
-                return RC ( rcXF, rcString, rcFormatting, rcParam, rcIncorrect );
-            }
-
-            switch ( size_modifier )
-            {
-            case 'h':
-                fmt [ fmt_idx ] . type = sptFloat32Vect;
-                break;
-            case 0:
-                fmt [ fmt_idx ] . type = sptFloat64Vect;
-                break;
-            }
-            break;
-
-        case vtdAscii:
-            switch ( domain )
-            {
-            case vtdAscii:
-            case vtdUnicode:
-                if ( size_modifier != 0 )
-                    fmt [ fmt_idx ] . type_cast = 1;
-                break;
-            default:
-                return RC ( rcXF, rcString, rcFormatting, rcParam, rcIncorrect );
-            }
-
-            fmt [ fmt_idx ] . type = sptString;
-
-            ++ pd -> str_idx;
-            break;
-
-        case vtdUnicode:
-            switch ( domain )
-            {
-            case vtdAscii:
-            case vtdUnicode:
-                switch ( size_modifier )
-                {
-                case 0:
-                    fmt [ fmt_idx ] . type = sptString;
-                    break;
-                case 'h':
-                    fmt [ fmt_idx ] . type_cast = 1;
-                    fmt [ fmt_idx ] . type = sptUCS2String;
-                    break;
-                case 'l':
-                    fmt [ fmt_idx ] . type_cast = 1;
-                    fmt [ fmt_idx ] . type = sptUTF32String;
-                    break;
-                }
-                break;
-            default:
-                return RC ( rcXF, rcString, rcFormatting, rcParam, rcIncorrect );
-            }
-
-            ++ pd -> str_idx;
-            break;
-        }
-
-        /* account for format argument */
-        ++ fmt_idx;
-        ++ pd -> arg_idx;
-        ++ vargs -> idx;
-    }
-
-    /* record final fmt */
-    if ( rc == 0 )
-    {
-        if ( fmt_idx == LOCAL_FMT_COUNT )
-        {
-            rc = create_overflow ( pd, fmt_idx );
-            if ( rc != 0 )
-                return rc;
-
-            fmt = pd -> fmt;
-        }
-
-        memset ( & fmt [ fmt_idx ++ ], 0, sizeof fmt [ 0 ] );
-
-        /* if not all arguments were consumed, should this be an error? */
-        if ( vargs -> idx != vargs -> dp -> argc )
-        {
-            /* produce warning */
-        }
-    }
-
-    pd -> fmt_idx = fmt_idx;
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( vdb_sprintf, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rc_t rc;
-    Sprintf *obj;
-
-    /* const format string */
-    VAList vargs;
-    const char *fmt_str = cp -> argv [ 0 ] . data . ascii;
-
-    /* local formatting storage */
-    PrintFmt fmt [ LOCAL_FMT_COUNT ];
-
-    /* data block for parse */
-    ParseData pd;
-    pd . fmt_size = cp -> argv [ 0 ] . count;
-    pd . fmt = fmt;
-
-    /* packaged va_list */
-    vargs . dp = dp;
-    vargs . idx = 0;
-
-    /* parse the format string */
-    rc = parse_format_string ( fmt_str, & pd, & vargs );
-    if ( rc == 0 )
-    {
-        /* the object size:
-           literal data bytes +
-           space for PrintFmt +
-           space for PrintArg */
-        size_t obj_extra = pd . lit_size +
-            pd . fmt_idx * sizeof ( PrintFmt ) +
-            pd . arg_idx * sizeof ( PrintArg ) +
-            pd . str_idx * sizeof ( String );
-        obj = malloc ( sizeof * obj + 1 + obj_extra );
-        if ( obj == NULL )
-            rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-        else
-        {
-            uint32_t i;
-
-            char *lit;
-            PrintFmt *dfmt;
-            size_t lit_size;
-
-            obj -> args = ( void* ) ( obj + 1 );
-            dfmt = ( void* ) & obj -> args [ pd . arg_idx ];
-            obj -> str = ( void* ) & dfmt [ pd . fmt_idx ];
-            lit = ( void* ) & obj -> str [ pd . str_idx ];
-            obj -> fmt = dfmt;
-
-            /* not necessary or even helpful, but doesn't cost much */
-            memset ( obj -> args, 0, pd . arg_idx * sizeof obj -> args [ 0 ] );
-            memset ( obj -> str, 0, pd . str_idx * sizeof obj -> str [ 0 ] );
-
-            /* copy format and literals */
-            for ( lit_size = 0, i = 0; i < pd . fmt_idx; ++ i )
-            {
-                /* simple copy */
-                dfmt [ i ] = pd . fmt [ i ];
-                if ( pd . fmt [ i ] . type == sptLiteral )
-                {
-                    /* copy over literal data */
-                    dfmt [ i ] . u . l . text = & lit [ lit_size ];
-                    memcpy ( & lit [ lit_size ],
-                        pd . fmt [ i ] . u . l . text,
-                        pd . fmt [ i ] . u . l . size );
-                    lit_size += pd . fmt [ i ] . u . l . size;
-                }
-            }
-
-            /* NUL-terminate the literal text - again, doesn't help but doesn't hurt */
-            lit [ lit_size ] = 0;
-        }
-    }
-
-    /* douse any overflow memory used */
-    if ( pd . fmt != fmt )
-        KDataBufferWhack ( & pd . overflow );
-
-#if _DEBUGGING
-    if ( rc == 0 )
-    {
-        rc = validate_obj ( obj, true );
-        if ( rc != 0 )
-            KDbgMsg ( "%s - self is bad on factory exit: %R\n", __func__, rc );
-    }
-#endif
-
-    if ( rc == 0 )
-    {
-        rslt -> self = obj;
-        rslt -> whack = free;
-        rslt -> u . rf = sprintf_func;
-        rslt -> variant = vftRow;
-    }
-
-    return rc;
-}
diff --git a/libs/vxf/strtonum.c b/libs/vxf/strtonum.c
deleted file mode 100644
index 322f50e..0000000
--- a/libs/vxf/strtonum.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-
-/* strtonum
- *  convert string to number
- *
- *  "radix" [ CONST, DEFAULT 10 ]
- *   if not specified, or if given as 0, the default will be 10
- *   unless the string begins with "0x" or "0X", in which case radix will be 16
- *   octal is NOT inferred ( i.e. leading "0" does not imply octal )
- *
- *  "str" [ DATA ] - text to be converted
- */
-
-static
-rc_t CC strtoint ( void *data, const VXformInfo *info,
-    VRowResult *rslt, const char *str, size_t str_size )
-{
-    bool negate;
-    size_t i = 0;
-    uint64_t u, max_magnitude;
-    uint32_t radix;
-    rc_t rc;
-    KDataBuffer *dst;
-
-    if (str_size == 0) {
-        rslt -> elem_count = 0;
-        return 0;
-    }
-
-    /* determine radix */
-    radix = ( uint32_t ) ( ( size_t ) data );
-    if ( radix == 0 )
-    {
-        radix = 10;
-        if ( str_size > 2 && str [ 0 ] == '0' ) switch ( tolower ( str [ 1 ] ) )
-        {
-        case 'x':
-            radix = 16;
-            i = 2;
-            break;
-        case 'b':
-            radix = 2;
-            i = 2;
-            break;
-        }
-    }
-
-    /* check for negative */
-    negate = false;
-    if ( radix == 10 && i < str_size && str [ i ] == '-' )
-    {
-        negate = true;
-        ++ i;
-    }
-
-    /* convert numeral */
-    for ( u = 0; i < str_size; ++ i )
-    {
-        int32_t d = toupper ( str [ i ] ) - '0';
-        if ( d < 0 )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        if ( d >= 10 )
-        {
-            d -= 'A' - '0' - 10;
-            if ( d < 10 )
-                return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        }
-        if ( d > radix )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        u = u * radix + d;
-    }
-
-    /* determine maximum magnitude */
-    if ( info -> fdesc . desc . intrinsic_bits == 64 )
-        max_magnitude = ( int64_t ) -1;
-    else
-        max_magnitude = ( ( ( uint64_t ) 1 ) << ( info -> fdesc . desc . intrinsic_bits ) ) - 1;
-    if ( info -> fdesc . desc . domain == vtdInt || negate )
-    {
-        max_magnitude >>= 1;
-        max_magnitude += negate;
-    }
-
-    if ( u > max_magnitude )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    /* set output buffer size */
-    dst = rslt -> data;
-    rc = KDataBufferCast ( dst, dst, info -> fdesc . desc . intrinsic_bits, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( dst, 1 );
-    if ( rc == 0 )
-    {
-        if ( negate )
-            u = - ( int64_t ) u;
-
-        rslt -> elem_count = 1;
-
-        switch ( info -> fdesc . desc . intrinsic_bits )
-        {
-        case 8:
-            * ( uint8_t* ) dst -> base = ( uint8_t ) u;
-            break;
-        case 16:
-            * ( uint16_t* ) dst -> base = ( uint16_t ) u;
-            break;
-        case 32:
-            * ( uint32_t* ) dst -> base = ( uint32_t ) u;
-            break;
-        case 64:
-            * ( uint64_t* ) dst -> base = u;
-            break;
-        default:
-            rc = RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC strtoflt ( void *data, const VXformInfo *info,
-    VRowResult *rslt, char *str, size_t str_size )
-{
-    /* set output buffer size */
-    rc_t rc;
-    KDataBuffer *dst = rslt -> data;
-
-    double d;
-    char *end;
-
-    str [ str_size ] = 0;
-    d = strtod ( str, & end );
-    if ( end != & str [ str_size ] )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-
-    rc = KDataBufferCast ( dst, dst, info -> fdesc . desc . intrinsic_bits, true );
-    if ( rc == 0 )
-        rc = KDataBufferResize ( dst, 1 );
-    if ( rc == 0 )
-    {
-        rslt -> elem_count = 1;
-
-        switch ( info -> fdesc . desc . intrinsic_bits )
-        {
-        case 32:
-            * ( float* ) dst -> base = ( float ) d;
-            break;
-        case 64:
-            * ( double* ) dst -> base = d;
-            break;
-        default:
-            rc = RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t CC strtoint_8 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    const char *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-    return strtoint ( data, info, rslt, str, argv [ 0 ] . u . data . elem_count );
-}
-
-static
-rc_t CC strtoflt_8 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char buffer [ 128 ];
-    uint32_t count = argv [ 0 ] . u . data . elem_count;
-    const char *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-
-    if ( count >= sizeof buffer )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    memcpy ( buffer, str, count );
-
-    return strtoflt ( data, info, rslt, buffer, count );
-}
-
-static
-rc_t CC strtoint_16 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char buffer [ 64 ];
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    const uint16_t *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-
-    if ( count > sizeof buffer )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    for ( i = 0; i < count; ++ i )
-    {
-        if ( str [ i ] > 128 )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        buffer [ i ] = ( char ) str [ i ];
-    }
-
-    return strtoint ( data, info, rslt, buffer, count );
-}
-
-static
-rc_t CC strtoflt_16 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char buffer [ 128 ];
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    const uint16_t *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-
-    if ( count >= sizeof buffer )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    for ( i = 0; i < count; ++ i )
-    {
-        if ( str [ i ] > 128 )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        buffer [ i ] = ( char ) str [ i ];
-    }
-
-    return strtoflt ( data, info, rslt, buffer, count );
-}
-
-static
-rc_t CC strtoint_32 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char buffer [ 64 ];
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    const uint32_t *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-
-    if ( count > sizeof buffer )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    for ( i = 0; i < count; ++ i )
-    {
-        if ( str [ i ] > 128 )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        buffer [ i ] = ( char ) str [ i ];
-    }
-
-    return strtoint ( data, info, rslt, buffer, count );
-}
-
-static
-rc_t CC strtoflt_32 ( void *data, const VXformInfo *info, int64_t row_id,
-    VRowResult *rslt, uint32_t argc, const VRowData argv [] )
-{
-    char buffer [ 128 ];
-    uint32_t i, count = argv [ 0 ] . u . data . elem_count;
-    const uint32_t *str = argv [ 0 ] . u . data . base;
-    str += argv [ 0 ] . u . data . first_elem;
-
-    if ( count >= sizeof buffer )
-        return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcExcessive );
-
-    for ( i = 0; i < count; ++ i )
-    {
-        if ( str [ i ] > 128 )
-            return RC ( rcXF, rcFunction, rcExecuting, rcParam, rcInvalid );
-        buffer [ i ] = ( char ) str [ i ];
-    }
-
-    return strtoflt ( data, info, rslt, buffer, count );
-}
-
-VTRANSFACT_IMPL ( vdb_strtonum, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    uint32_t radix = 0;
-
-    if ( cp -> argc == 1 )
-    {
-        radix = cp -> argv [ 0 ] . data . u32 [ 0 ];
-        if ( radix > 36 )
-            return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    if ( info -> fdesc . desc . domain == vtdFloat ) switch ( radix )
-    {
-    case 0:
-    case 10:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcInvalid );
-
-    switch ( dp -> argv [ 0 ] . desc . intrinsic_bits )
-    {
-    case 8:
-        rslt -> u . rf = ( info -> fdesc . desc . domain == vtdFloat ) ? strtoflt_8 : strtoint_8;
-        break;
-    case 16:
-        rslt -> u . rf = ( info -> fdesc . desc . domain == vtdFloat ) ? strtoflt_16 : strtoint_16;
-        break;
-    case 32:
-        rslt -> u . rf = ( info -> fdesc . desc . domain == vtdFloat ) ? strtoflt_32 : strtoint_32;
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcParam, rcInvalid );
-    }
-
-    rslt -> self = ( void* ) ( size_t ) radix;
-    rslt -> variant = vftRow;
-
-    return 0;
-}
diff --git a/libs/vxf/subtract-row-id.c b/libs/vxf/subtract-row-id.c
deleted file mode 100644
index 16cfcd9..0000000
--- a/libs/vxf/subtract-row-id.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/data-buffer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-static
-rc_t CC subtract_int64_t ( void *self, const VXformInfo *info,
-    int64_t row_id, VRowResult *rslt,
-    uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    uint32_t i;
-    int64_t *dst;
-    const int64_t *src = argv [ 0 ] . u . data . base;
-    uint64_t elem_count = argv [ 0 ] . u . data . elem_count;
-
-    assert ( rslt -> data -> elem_bits == 64 );
-    rc = KDataBufferResize ( rslt -> data, elem_count );
-    if ( rc != 0 )
-        return rc;
-
-    dst = rslt -> data -> base;
-    rslt -> elem_count = elem_count;
-
-    /* while this function is typically used on single-element rows,
-       we advertise taking rows of any length... */
-    for ( i = 0, src += argv [ 0 ] . u . data . first_elem; i < elem_count; ++ i )
-        dst [ i ] = src [ i ] - row_id;
-
-    return 0;
-}
-
-
-/* subtract_row_id
- *  return the difference between input and current row id
- *
- *  "in" [ DATA ]
- *
- * SYNOPSIS:
- *  predicts that the integer data in "in" will be related to
- *  the corresponding row-id, and subtracts off the latter.
- *  for serially generated ids, this will produce a constant
- *  difference that can be stored as a static column.
- */
-VTRANSFACT_IMPL ( vdb_subtract_row_id, 1, 0, 0 ) ( const void *fself, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    /* version 1.0 operates on I64 input */
-    rslt -> u . ndf = subtract_int64_t;
-    rslt -> variant = vftNonDetRow;
-    return 0;
-}
diff --git a/libs/vxf/sum.c b/libs/vxf/sum.c
deleted file mode 100644
index 4ef695a..0000000
--- a/libs/vxf/sum.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-/* optional constant */
-typedef union sum_data sum_data;
-union sum_data
-{
-    int8_t i8;
-    int16_t i16;
-    int32_t i32;
-    int64_t i64;
-
-    uint8_t u8;
-    uint16_t u16;
-    uint32_t u32;
-    uint64_t u64;
-
-    float f32;
-    double f64;
-};
-
-#define FULL_SUM_NAME( T )                                               \
-    full_sum_ ## T
-#define FULL_SUM( T, k )                                                 \
-static                                                                   \
-rc_t CC FULL_SUM_NAME ( T ) ( void *data,                                   \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i, j;                                                       \
-    const sum_data *self = ( const void* ) data;                         \
-                                                                         \
-    T *dst = rslt -> base;                                               \
-    const T *a = argv [ 0 ] . u . data . base;                           \
-    const T *b = argv [ 1 ] . u . data . base;                           \
-                                                                         \
-    for ( i = 0, dst += rslt -> first_elem,                              \
-              a += argv [ 0 ] . u . data . first_elem,                   \
-              b += argv [ 1 ] . u . data . first_elem;                   \
-          i < rslt -> elem_count; ++ i )                                 \
-    {                                                                    \
-        dst [ i ] = a [ i ] + b [ i ] + self -> k;                       \
-        for ( j = 2; j < argc; ++ j )                                    \
-        {                                                                \
-            const T *c = argv [ j ] . u . data . base;                   \
-            dst [ i ] += c [ argv [ j ] . u . data . first_elem + i ];   \
-        }                                                                \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-FULL_SUM ( int8_t, i8 )
-FULL_SUM ( int16_t, i16 )
-FULL_SUM ( int32_t, i32 )
-FULL_SUM ( int64_t, i64 )
-FULL_SUM ( uint8_t, u8 )
-FULL_SUM ( uint16_t, u16 )
-FULL_SUM ( uint32_t, u32 )
-FULL_SUM ( uint64_t, u64 )
-FULL_SUM ( float, f32 )
-FULL_SUM ( double, f64 )
-
-static VFixedRowFunc full_sum_func [] =
-{
-    FULL_SUM_NAME ( uint8_t ),
-    FULL_SUM_NAME ( uint16_t ),
-    FULL_SUM_NAME ( uint32_t ),
-    FULL_SUM_NAME ( uint64_t ),
-    FULL_SUM_NAME ( int8_t ),
-    FULL_SUM_NAME ( int16_t ),
-    FULL_SUM_NAME ( int32_t ),
-    FULL_SUM_NAME ( int64_t ),
-    NULL,
-    NULL,
-    FULL_SUM_NAME ( float ),
-    FULL_SUM_NAME ( double )
-};
-
-#define CONST_SUM_NAME( T )                                              \
-    const_sum_ ## T
-#define CONST_SUM( T, k )                                                \
-static                                                                   \
-rc_t CC CONST_SUM_NAME ( T ) ( void *data, const VXformInfo *info,          \
-    void *rslt, const void *src, uint64_t elem_count )                   \
-{                                                                        \
-    uint32_t i;                                                          \
-    const sum_data *self = ( const void* ) data;                         \
-                                                                         \
-    T *dst = rslt;                                                       \
-    const T *a = src;                                                    \
-                                                                         \
-    for ( i = 0; i < elem_count; ++ i )                                  \
-    {                                                                    \
-        dst [ i ] = a [ i ] + self -> k;                                 \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-CONST_SUM ( int8_t, i8 )
-CONST_SUM ( int16_t, i16 )
-CONST_SUM ( int32_t, i32 )
-CONST_SUM ( int64_t, i64 )
-CONST_SUM ( uint8_t, u8 )
-CONST_SUM ( uint16_t, u16 )
-CONST_SUM ( uint32_t, u32 )
-CONST_SUM ( uint64_t, u64 )
-CONST_SUM ( float, f32 )
-CONST_SUM ( double, f64 )
-
-static VArrayFunc const_sum_func [] =
-{
-    CONST_SUM_NAME ( uint8_t ),
-    CONST_SUM_NAME ( uint16_t ),
-    CONST_SUM_NAME ( uint32_t ),
-    CONST_SUM_NAME ( uint64_t ),
-    CONST_SUM_NAME ( int8_t ),
-    CONST_SUM_NAME ( int16_t ),
-    CONST_SUM_NAME ( int32_t ),
-    CONST_SUM_NAME ( int64_t ),
-    NULL,
-    NULL,
-    CONST_SUM_NAME ( float ),
-    CONST_SUM_NAME ( double )
-};
-
-#define NO_CONST_NAME( T )                                               \
-    no_const_ ## T
-#define NO_CONST( T )                                                    \
-static                                                                   \
-rc_t CC NO_CONST_NAME ( T ) ( void *data,                                   \
-    const VXformInfo *info, int64_t row_id, const VFixedRowResult *rslt, \
-    uint32_t argc, const VRowData argv [] )                              \
-{                                                                        \
-    uint32_t i;                                                          \
-                                                                         \
-    T *dst = rslt -> base;                                               \
-    const T *a = argv [ 0 ] . u . data . base;                           \
-    const T *b = argv [ 1 ] . u . data . base;                           \
-                                                                         \
-    for ( i = 0, dst += rslt -> first_elem,                              \
-              a += argv [ 0 ] . u . data . first_elem,                   \
-              b += argv [ 1 ] . u . data . first_elem;                   \
-          i < rslt -> elem_count; ++ i )                                 \
-    {                                                                    \
-        dst [ i ] = a [ i ] + b [ i ];                                   \
-    }                                                                    \
-                                                                         \
-    return 0;                                                            \
-}
-
-NO_CONST ( int8_t )
-NO_CONST ( int16_t )
-NO_CONST ( int32_t )
-NO_CONST ( int64_t )
-NO_CONST ( uint8_t )
-NO_CONST ( uint16_t )
-NO_CONST ( uint32_t )
-NO_CONST ( uint64_t )
-NO_CONST ( float )
-NO_CONST ( double )
-
-static VFixedRowFunc no_const_func [] =
-{
-    NO_CONST_NAME ( uint8_t ),
-    NO_CONST_NAME ( uint16_t ),
-    NO_CONST_NAME ( uint32_t ),
-    NO_CONST_NAME ( uint64_t ),
-    NO_CONST_NAME ( int8_t ),
-    NO_CONST_NAME ( int16_t ),
-    NO_CONST_NAME ( int32_t ),
-    NO_CONST_NAME ( int64_t ),
-    NULL,
-    NULL,
-    NO_CONST_NAME ( float ),
-    NO_CONST_NAME ( double )
-};
-
-static
-rc_t CC no_sum ( void *data, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count )
-{
-    memcpy ( dst, src, (size_t)( elem_count * VTypedescSizeof ( & info -> fdesc . desc ) >> 3 ) );
-    return 0;
-}
-
-static
-void CC vxf_sum_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* sum
- *  return the sum of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of numeric_set
- *
- *  "k" [ CONST, DEFAULT 0 ] - optional constant
- *  to be added
- *
- *  "a" [ DATA ] - left-most operand
- *
- * SYNOPSIS:
- *  incorporates "k" into expression for every row
- *  returns sum or sumerence of inputs for all rows
- */
-VTRANSFACT_IMPL ( vdb_sum, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    bool has_const;
-    int32_t size_idx;
-    sum_data k;
-
-    /* "T" must be member of numeric_set */
-    switch ( info -> fdesc . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-    case vtdFloat:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector sums
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    /* there are 5 variants:
-       1. no constant ( or is 0 ) and single input
-       2. non-zero constant and single input
-       3. no constant ( or is 0 ) and dual input
-       4. non-zero constant and dual input
-       5. more than 2 inputs */
-    has_const = false;
-    if ( cp -> argc == 0 )
-        memset ( & k, 0, sizeof k );
-    else switch ( cp -> argv [ 0 ] . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-        switch ( cp -> argv [ 0 ] . desc . intrinsic_bits )
-        {
-        case 8:
-            if ( ( k . u8 = cp -> argv [ 0 ] . data . u8 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 16:
-            if ( ( k . u16 = cp -> argv [ 0 ] . data . u16 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 32:
-            if ( ( k . u32 = cp -> argv [ 0 ] . data . u32 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        case 64:
-            if ( ( k . u64 = cp -> argv [ 0 ] . data . u64 [ 0 ] ) != 0 )
-                has_const = true;
-            break;
-        }
-        break;
-
-    case vtdFloat:
-        switch ( cp -> argv [ 0 ] . desc . intrinsic_bits )
-        {
-        case 32:
-            if ( ( k . f32 = cp -> argv [ 0 ] . data . f32 [ 0 ] ) != 0.0 )
-                has_const = true;
-            break;
-        case 64:
-            if ( ( k . f64 = cp -> argv [ 0 ] . data . f64 [ 0 ] ) != 0.0 )
-                has_const = true;
-            break;
-        }
-        break;
-    }
-
-    if ( has_const || dp -> argc > 2 )
-    {
-        sum_data *pb = malloc ( sizeof * pb );
-        if ( pb == NULL )
-            return RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
-        * pb = k;
-        
-        rslt -> self = pb;
-        rslt -> whack = vxf_sum_wrapper;
-
-        if ( dp -> argc > 1 )
-        {
-            rslt -> u . pf = full_sum_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftFixedRow;
-        }
-        else
-        {
-            rslt -> u . af = const_sum_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftArray;
-        }
-    }
-    else
-    {
-        if ( dp -> argc > 1 )
-        {
-            rslt -> u . pf = no_const_func [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-            rslt -> variant = vftFixedRow;
-        }
-        else
-        {
-            rslt -> u . af = no_sum;
-            rslt -> variant = vftArray;
-        }
-    }
-
-    return 0;
-}
diff --git a/libs/vxf/trim.c b/libs/vxf/trim.c
deleted file mode 100644
index a32678e..0000000
--- a/libs/vxf/trim.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <klib/log.h>
-#include <arch-impl.h>
-
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct trim_self_struct {
-	union {
-	    int8_t i8;
-	    int16_t i16;
-	    int32_t i32;
-	    int64_t i64;
-
-	    uint8_t u8;
-	    uint16_t u16;
-	    uint32_t u32;
-	    uint64_t u64;
-
-	    float f32;
-	    double f64;
-	} el;
-	uint8_t side;
-} self_t;
-
-
-#define TRIM_NAME( T ) trim_ ## T
-
-#define FUNC_TRIM( T, K )                                               \
-static rc_t CC TRIM_NAME ( T ) ( void *data,                            \
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,           \
-    uint32_t argc, const VRowData argv [] )                             \
-{                                                                       \
-    rc_t rc = 0;                                                        \
-    const self_t *self = data;                                          \
-    uint32_t start = 0;                                                 \
-    uint32_t stop = argv[0].u.data.elem_count;                          \
-    const T *a = argv[0].u.data.base;                                   \
-    a += argv[0].u.data.first_elem;                                     \
-    if (self->side == 0) {                                              \
-        while (start != stop && a[start] == self->el.K)                 \
-            ++start;                                                    \
-    }                                                                   \
-    else {                                                              \
-        while (start != stop && a[stop - 1]  == self->el.K)             \
-            --stop;                                                     \
-    }                                                                   \
-    rslt->elem_count = stop - start;                                    \
-    if (rslt->elem_count > 0) {                                         \
-        rc = KDataBufferResize(rslt->data, rslt->elem_count);           \
-        if (rc == 0)                                                    \
-            memcpy(rslt->data->base, a + start, rslt->elem_count);      \
-    }                                                                   \
-    return rc;                                                          \
-}
-#if 1
-FUNC_TRIM ( uint8_t, u8 )
-#else
-static									 
-rc_t CC trim_uint8_t ( void *data,                                	 
-    const VXformInfo *info, int64_t row_id, VRowResult *rslt,		 
-    uint32_t argc, const VRowData argv [] )                              
-{                                                                        
-    rc_t rc = 0;
-    const self_t *self = data;						 
-    uint32_t start = 0;						
-    uint32_t stop = argv[0].u.data.elem_count;			
-    const uint8_t *a = argv[0].u.data.base;
-    
-    a += argv[0].u.data.first_elem;
-    
-    if (self->side == 0) { /*** left side trim ****/			 
-        while (start != stop && a[start] == self->el.u8)
-            ++start;
-    }
-    else {
-        while (start != stop && a[stop - 1]  == self->el.u8)
-            --stop;
-    }
-    rslt->elem_count = stop - start;
-    if (rslt->elem_count > 0) {
-        rc = KDataBufferResize(rslt->data, rslt->elem_count);
-        if (rc == 0)
-            memcpy(rslt->data->base, a + start, rslt->elem_count);
-    }
-    return rc;
-}
-#endif
-FUNC_TRIM ( int8_t, i8 )
-FUNC_TRIM ( int16_t, i16 )
-FUNC_TRIM ( int32_t, i32 )
-FUNC_TRIM ( int64_t, i64 )
-FUNC_TRIM ( uint16_t, u16 )
-FUNC_TRIM ( uint32_t, u32 )
-FUNC_TRIM ( uint64_t, u64 )
-FUNC_TRIM ( float, f32 )
-FUNC_TRIM ( double, f64 )
-
-static VRowFunc trim_func_set [] =
-{
-    TRIM_NAME ( uint8_t ),
-    TRIM_NAME ( uint16_t ),
-    TRIM_NAME ( uint32_t ),
-    TRIM_NAME ( uint64_t ),
-    TRIM_NAME ( int8_t ),
-    TRIM_NAME ( int16_t ),
-    TRIM_NAME ( int32_t ),
-    TRIM_NAME ( int64_t ),
-    NULL,
-    NULL,
-    TRIM_NAME ( float ),
-    TRIM_NAME ( double )
-};
-
-static
-void CC self_whack( void *ptr )
-{
-	free( ptr );
-}
-
-VTRANSFACT_IMPL ( vdb_trim, 1, 0, 0 ) ( const void *Self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int32_t size_idx;
-    self_t self;
-
-    self.el.u64 = 0;
-
-    self.side=cp -> argv [ 0 ] . data . u8 [ 0 ];
-
-    /* "T" must be member of numeric_set */
-    switch ( info -> fdesc . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-    case vtdFloat:
-        break;
-    default:
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    switch ( cp -> argv [ 1 ] . desc . domain )
-    {
-    case vtdUint:
-    case vtdInt:
-        switch ( cp -> argv [ 1 ] . desc . intrinsic_bits )
-        {
-        case 8:
-	    self . el . u8 = cp -> argv [ 1 ] . data . u8 [ 0 ];
-            break;
-        case 16:
-	    self . el . u16 = cp -> argv [ 1 ] . data . u16 [ 0 ];
-            break;
-        case 32:
-	    self . el . u32 = cp -> argv [ 1 ] . data . u32 [ 0 ];
-            break;
-        case 64:
-            self . el . u64 = cp -> argv [ 1 ] . data . u64 [ 0 ];
-            break;
-	default: return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-        }
-        break;
-
-    case vtdFloat:
-        switch ( cp -> argv [ 1 ] . desc . intrinsic_bits )
-        {
-        case 32:
-            self . el . f32 = cp -> argv [ 1 ] . data . f32 [ 0 ];
-            break;
-        case 64:
-            self . el . f64 = cp -> argv [ 1 ] . data . f64 [ 0 ];
-            break;
-	default: return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-        }
-        break;
-    default: return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-    rslt -> self = malloc ( sizeof self );
-    memcpy(rslt -> self,&self,sizeof(self));
-    rslt -> whack = self_whack;
-    rslt -> u . rf = trim_func_set [ ( dp -> argv [ 0 ] . desc . domain - vtdUint ) * 4 + size_idx ];
-    rslt -> variant = vftRow;
-
-    return 0;
-}
diff --git a/libs/vxf/trunc.c b/libs/vxf/trunc.c
deleted file mode 100644
index b9a1285..0000000
--- a/libs/vxf/trunc.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-
-#define FLOAT_FUNC truncf
-#define DOUBLE_FUNC trunc
-#include "math-funcs-impl.h"
-
-/*
- function < type T >
- T vdb:trunc #1.0 ( T in );
- */
-VTRANSFACT_IMPL(vdb_trunc, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp ) {
-    return factory(self, info, rslt, cp, dp);
-}
diff --git a/libs/vxf/undelta.c b/libs/vxf/undelta.c
deleted file mode 100644
index 5c3187c..0000000
--- a/libs/vxf/undelta.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <arch-impl.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-
-#define UNDELTA_NAME( T )  undelta_ ## T
-#define UNDELTA( T )                                                       \
-static                                                                   \
-rc_t CC UNDELTA_NAME ( T ) ( void *data,                                   \
-    const VXformInfo *info,  void *rslt, const void *input,              \
-    uint64_t elem_count)                                                 \
-{                                                                        \
-    uint32_t i;                                                          \
-    T *dst       = (T*) rslt;                                            \
-    const T *src = (const T*) input;                                     \
-    if(elem_count >0) {							 \
-        dst [ 0 ] = src [ 0 ];						 \
-	for ( i = 1; i < elem_count; ++ i ) {                            \
-	    dst [ i ] = src [ i ] + dst [ i - 1 ];                       \
-	}                                                                \
-    }									 \
-    return 0;                                                            \
-}
-
-UNDELTA ( int8_t )
-UNDELTA ( int16_t )
-UNDELTA ( int32_t )
-UNDELTA ( int64_t )
-
-static VArrayFunc undelta_func [] =
-{
-    UNDELTA_NAME ( int8_t  ),
-    UNDELTA_NAME ( int16_t ),
-    UNDELTA_NAME ( int32_t ),
-    UNDELTA_NAME ( int64_t )
-};
-/* undelta
- *  return restoration from 1st derivative of inputs
- *
- *  "T" [ TYPE ] - input and output data type
- *  must be member of  signed integers
- *
- *  "a" [ DATA ] - operand
- *
- *
- * SYNOPSIS:
- *  return restoration of 1st derivative for the whole blob
- *
- * USAGE:
- *    I32 A = < I32 > undelta ( B );
- */
-VTRANSFACT_IMPL ( vdb_undelta, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    int size_idx;
-    if ( info -> fdesc . desc . domain != vtdInt)
-    {
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-    }
-
-    /* TBD - eventually support vector derivatives
-       for today, check that dim of T is 1 */
-    if ( dp -> argv [ 0 ] . desc . intrinsic_dim != 1 )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-    /* the only numeric types we support are between 8 and 64 bits */
-    size_idx = uint32_lsbit ( dp -> argv [ 0 ] . desc . intrinsic_bits ) - 3;
-    if ( size_idx < 0 || size_idx > 3 || ( ( dp -> argv [ 0 ] . desc . intrinsic_bits &
-                                             ( dp -> argv [ 0 ] . desc . intrinsic_bits - 1 ) ) != 0 ) )
-        return RC ( rcXF, rcFunction, rcConstructing, rcType, rcIncorrect );
-
-
-    rslt -> u . af = undelta_func [ size_idx ];
-    rslt -> variant = vftArray;
-
-    return 0;
-}
diff --git a/libs/vxf/unpack.c b/libs/vxf/unpack.c
deleted file mode 100644
index d15ae31..0000000
--- a/libs/vxf/unpack.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <sysalloc.h>
-#include <klib/pack.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-typedef struct self_t self_t;
-struct self_t
-{
-    VTypedesc sdesc;
-    VTypedesc ddesc;
-    uint32_t sbits;
-};
-
-static
-rc_t CC unpack_func( void *Self, const VXformInfo *info,
-    void *dst, const void *src, uint64_t elem_count )
-{
-    size_t usize;
-    const self_t *self = ( const void* ) Self;
-    bitsz_t ssize = elem_count * VTypedescSizeof ( & self -> sdesc );
-    size_t dsize = (elem_count * VTypedescSizeof ( & self -> ddesc ) + 7) >> 3;
-
-    return Unpack( self -> sbits, self -> ddesc.intrinsic_bits,
-        src, 0, ssize, NULL,
-        dst, dsize, &usize );
-}
-
-static
-void CC vxf_unpack_wrapper( void *ptr )
-{
-    free( ptr );
-}
-
-/* 
- */
-VTRANSFACT_IMPL ( vdb_unpack, 1, 0, 0 ) ( const void *ignore, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self = malloc ( sizeof * self );
-    if ( self == NULL )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    assert (dp->argc == 1);
-    self->sdesc = dp->argv[0].desc;
-    self->ddesc = info->fdesc.desc;
-    self->sbits = VTypedescSizeof ( & dp->argv[0].desc );
-        
-    rslt->self = self;
-    rslt->whack = vxf_unpack_wrapper;
-        
-    rslt->variant = vftArray;
-    rslt->u.af = unpack_func;
-        
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_unpack, 1, 0, 0 ) ( const void *ignore, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    self_t *self = malloc ( sizeof * self );
-    if ( self == NULL )
-        return RC ( rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted );
-
-    assert ( dp -> argc == 1 );
-
-    assert ( cp -> argc == 2 );
-    assert ( cp -> argv [ 0 ] . desc . intrinsic_bits == 32 );
-    assert ( cp -> argv [ 0 ] . desc . domain == vtdUint );
-
-    self->sdesc = dp->argv[0].desc;
-    self -> ddesc . intrinsic_bits = cp -> argv [ 1 ] . data . u32 [ 0 ];
-    self -> ddesc . intrinsic_dim = 1;
-    self -> ddesc . domain = 0;
-    self -> sbits = cp -> argv [ 0 ] . data . u32 [ 0 ];
-
-    rslt->self = self;
-    rslt->whack = vxf_unpack_wrapper;
-        
-    rslt->variant = vftArray;
-    rslt->u.af = unpack_func;
-        
-    return 0;
-}
diff --git a/libs/vxf/unzip.c b/libs/vxf/unzip.c
deleted file mode 100644
index f39aabb..0000000
--- a/libs/vxf/unzip.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <vdb/vdb-priv.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <string.h>
-#include <zlib.h>
-#include <assert.h>
-
-static rc_t invoke_zlib(void *dst, size_t dsize, const void *src, size_t ssize, int windowBits)
-{
-    int zr;
-    rc_t rc = 0;
-
-    z_stream s;
-    memset ( & s, 0, sizeof s );
-
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = dsize;
-    
-    zr = inflateInit2(&s, windowBits);
-    switch (zr)
-    {
-        case Z_OK:
-            break;
-        case Z_MEM_ERROR:
-            return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        default:
-            return RC(rcXF, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-    }
-    zr = inflate(&s, Z_FINISH);
-    switch (zr)
-    {
-    case Z_STREAM_END:
-        break;
-    case Z_OK:         /* progress but not complete */
-    case Z_BUF_ERROR:  /* no progress - need more output buffer */
-        rc = RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-        break;
-    case Z_NEED_DICT:
-    case Z_DATA_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcCorrupt);
-        break;
-    case Z_MEM_ERROR:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-        break;
-    default:
-        rc = RC(rcXF, rcFunction, rcExecuting, rcNoObj, rcUnexpected);
-        break;
-    }
-    zr = inflateEnd(&s);
-    switch (zr)
-    {
-        case Z_OK:
-            break;
-        default:
-            if (rc == 0)
-                rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcCorrupt);
-    }
-
-    return rc;
-}
-
-static
-rc_t unzip_func_v1(
-                   const VXformInfo *info,
-                   VBlobResult *dst,
-                   const VBlobData *src
-) {
-    dst->byte_order = src->byte_order;
-    return invoke_zlib(dst->data, (((size_t)dst->elem_count * dst->elem_bits + 7) >> 3),
-                       src->data, (((size_t)src->elem_count * src->elem_bits + 7) >> 3),
-                       -15);
-}
-
-static
-rc_t unzip_func_v2(
-                   const VXformInfo *info,
-                   VBlobResult *dst,
-                   const VBlobData *src,
-                   VBlobHeader *hdr
-) {
-    int64_t trailing;
-    rc_t rc = VBlobHeaderArgPopHead ( hdr, & trailing );
-    if ( rc == 0 )
-    {
-        dst -> elem_count *= dst -> elem_bits;
-        dst -> byte_order = src -> byte_order;
-        dst -> elem_bits = 1;
-
-        /* the feed to zlib MUST be byte aligned
-           so the output must be as well */
-        assert ( ( dst -> elem_count & 7 ) == 0 );
-        rc = invoke_zlib(dst->data, (((size_t)dst->elem_count) >> 3),
-                         src->data, (((size_t)src->elem_count * src->elem_bits + 7) >> 3),
-                         -15);
-
-        /* if the original, uncompressed source was NOT byte aligned,
-           back off the rounded up byte and add in the original bit count */
-        if ( rc == 0 && trailing != 0 )
-            dst -> elem_count -= 8 - trailing;
-    }
-
-    return rc;
-}
-
-static
-rc_t CC legacy_unzip_func ( void *self, const VXformInfo *info,
-    VLegacyBlobResult *rslt, const KDataBuffer *src )
-{
-    rc_t rc;
-    KDataBuffer *dst = rslt -> dst;
-    const uint32_t *in = src -> base;
-#if __BYTE_ORDER == __BIG_ENDIAN
-    uint64_t bits = bswap_32 ( in [ 0 ] );
-#else
-    uint64_t bits = in [ 0 ];
-#endif
-
-    do
-    {
-        size_t const bytes = ( size_t ) ( ( bits + 7 ) >> 3 ) + 64;
-        
-        if ( ( ( uint64_t ) bytes << 3 ) < bits )
-        {
-            rc = RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-            break;
-        }
-
-        dst -> elem_bits = 8;
-        rc = KDataBufferResize ( dst, bytes );
-        if ( rc != 0 )
-            break;
-
-        rc = invoke_zlib ( dst -> base, bytes, & in [ 1 ], (size_t)KDataBufferBytes ( src ) - 4, 15 );
-        if ( rc == 0 )
-        {
-            dst -> elem_bits = 1;
-            dst -> elem_count = bits;
-            break;
-        }
-
-        /* in hopes that this is a 32-bit overflow, try increasing bits */
-        bits += ( uint64_t ) 1U << 32;
-        if ( ( bits >> 32 ) == 16 )
-            break;
-    }
-    while ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer );
-
-    return rc;
-}
-
-
-static
-rc_t CC unzip_func(
-                void *Self,
-                const VXformInfo *info,
-                VBlobResult *dst,
-                const VBlobData *src,
-                VBlobHeader *hdr
-) {
-    int const version = VBlobHeaderVersion(hdr);
-    
-    switch (version) {
-    case 1:
-        return unzip_func_v1(info, dst, src);
-        break;
-    case 2:
-        return unzip_func_v2(info, dst, src, hdr);
-        break;
-    default:
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcBadVersion);
-    }
-}
-
-/* unzip
- *  function any unzip #1.0 ( zlib_fmt in );
- */
-VTRANSFACT_IMPL ( vdb_unzip, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt->variant = vftBlob;
-    rslt->u.bf = unzip_func;
-
-    return 0;
-}
-
-/* NCBI:unzip
- *  function any NCBI:unzip #1.0 ( NCBI:zlib_encoded_t in );
- */
-VTRANSFACT_IMPL ( NCBI_unzip, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    VNoHdrBlobFunc f = legacy_unzip_func;
-    rslt->variant = vftLegacyBlob;
-    rslt->u.bf = ( VBlobFunc ) f;
-
-    return 0;
-}
diff --git a/libs/vxf/vec-sum.c b/libs/vxf/vec-sum.c
deleted file mode 100644
index 9903124..0000000
--- a/libs/vxf/vec-sum.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <vdb/extern.h>
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-#include <assert.h>
-
-typedef void (*math_f)(void *const dst,
-                       void const *const src, uint32_t const offset,
-                       uint32_t const vec_length, uint32_t const vec_count);
-typedef struct self_t {
-    uint32_t vec_length;
-    math_f f;
-} self_t;
-
-#define FUNC(VALTYPE) F_ ## VALTYPE
-
-#define FUNC_DEF(VALTYPE) \
-static void FUNC(VALTYPE)(void *Dst, void const *Src, uint32_t const offset, uint32_t const vec_length, uint32_t const vec_count) { \
-    VALTYPE sum; \
-    VALTYPE *const dst = (VALTYPE *)Dst; \
-    VALTYPE const *const src = &((VALTYPE const *)Src)[offset]; \
-    uint32_t i; \
-    uint32_t j; \
-    uint32_t k; \
-    \
-    for (i = k = 0; i != vec_count; ++i) { \
-        for (sum = 0, j = 0; j != vec_length; ++j, ++k) \
-            sum += src[k]; \
-        dst[i] = sum; \
-    } \
-}
-
-FUNC_DEF(float)
-FUNC_DEF(double)
-FUNC_DEF(uint8_t)
-FUNC_DEF(uint16_t)
-FUNC_DEF(uint32_t)
-FUNC_DEF(uint64_t)
-FUNC_DEF(int8_t)
-FUNC_DEF(int16_t)
-FUNC_DEF(int32_t)
-FUNC_DEF(int64_t)
-
-static
-rc_t CC vec_sum_row_func(void *const Self,
-                         VXformInfo const *info,
-                         int64_t const row_id,
-                         VRowResult *const rslt,
-                         uint32_t const argc,
-                         VRowData const argv[])
-{
-    self_t const *self = Self;
-    rc_t rc;
-    
-    assert(argc == 1);
-    
-    rslt->data->elem_bits = rslt->elem_bits;
-    rc = KDataBufferResize(rslt->data, rslt->elem_count = 1);
-    if (rc == 0) {
-        self->f(rslt->data->base,
-                argv[0].u.data.base, argv[0].u.data.first_elem,
-                argv[0].u.data.elem_count, 1);
-    }
-    return rc;
-}
-
-static
-rc_t CC vec_sum_array_func(
-                void *Self,
-                const VXformInfo *info,
-                void *dst,
-                const void *src,
-                uint64_t elem_count
-) {
-    const self_t *self = Self;
-    
-    assert(elem_count % self->vec_length == 0);
-    assert((elem_count / self->vec_length) >> 32 == 0);
-    self->f(dst, src, 0, self->vec_length, (uint32_t)(elem_count / self->vec_length));
-    return 0;
-}
-
-static
-void CC vxf_vec_sum_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-rc_t vec_sum_make(self_t **const rslt,
-                  VXfactInfo const *const info,
-                  VFunctionParams const *const dp)
-{
-    self_t *self;
-    rc_t rc = 0;
-    
-    self = malloc(sizeof(*self));
-    if (self == NULL)
-        rc = RC(rcVDB, rcFunction, rcConstructing, rcMemory, rcExhausted);
-    else {
-        self->vec_length = dp->argv[0].fd.td.dim;
-        
-        switch (info->fdesc.desc.intrinsic_bits) {
-        case 8:
-            switch (info->fdesc.desc.domain) {
-            case vtdInt:
-                self->f = FUNC(int8_t);
-                break;
-            case vtdUint:
-                self->f = FUNC(uint8_t);
-                break;
-            default:
-                rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case 16:
-            switch (info->fdesc.desc.domain) {
-            case vtdInt:
-                self->f = FUNC(int16_t);
-                break;
-            case vtdUint:
-                self->f = FUNC(uint16_t);
-                break;
-            default:
-                rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case 32:
-            switch (info->fdesc.desc.domain) {
-            case vtdInt:
-                self->f = FUNC(int32_t);
-                break;
-            case vtdUint:
-                self->f = FUNC(uint32_t);
-                break;
-            case vtdFloat:
-                self->f = FUNC(float);
-                break;
-            default:
-                rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        case 64:
-            switch (info->fdesc.desc.domain) {
-            case vtdInt:
-                self->f = FUNC(int64_t);
-                break;
-            case vtdUint:
-                self->f = FUNC(uint64_t);
-                break;
-            case vtdFloat:
-                self->f = FUNC(double);
-                break;
-            default:
-                rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-            }
-            break;
-        default:
-            rc = RC(rcVDB, rcFunction, rcConstructing, rcParam, rcInvalid);
-        }
-        if (rc) {
-            free(self);
-            self = NULL;
-        }
-    }
-    *rslt = self;
-    return rc;
-}
-
-VTRANSFACT_IMPL(vdb_vec_sum, 1, 0, 0)(const void *Self,
-                                      const VXfactInfo *info,
-                                      VFuncDesc *rslt,
-                                      const VFactoryParams *cp,
-                                      const VFunctionParams *dp)
-{
-    self_t *self;
-    rc_t rc = vec_sum_make(&self, info, dp);
-    
-    if (rc == 0) {
-        rslt->self = self;
-        rslt->whack = vxf_vec_sum_wrapper;
-        rslt->variant = vftRow;
-        rslt->u.rf = vec_sum_row_func;
-    }
-    return rc;
-}
-
-/*
- function < type T, U32 dim >
- T vec_sum #1.0 ( T [ dim ] in )
- */
-VTRANSFACT_IMPL(vdb_fixed_vec_sum, 1, 0, 0)(const void *Self,
-                                            const VXfactInfo *info,
-                                            VFuncDesc *rslt,
-                                            const VFactoryParams *cp,
-                                            const VFunctionParams *dp)
-{
-    self_t *self;
-    rc_t rc = vec_sum_make(&self, info, dp);
-    
-    if (rc == 0) {
-        rslt->self = self;
-        rslt->whack = vxf_vec_sum_wrapper;
-        rslt->variant = vftArray;
-        rslt->u.af = vec_sum_array_func;
-    }
-    return rc;
-}
diff --git a/libs/vxf/wgs-tokenize-accession.c b/libs/vxf/wgs-tokenize-accession.c
deleted file mode 100644
index 04454fc..0000000
--- a/libs/vxf/wgs-tokenize-accession.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-enum
-{
-    NCBI_WGS_acc_token_unrecognized = 1,
-    NCBI_WGS_acc_token_prefix,
-    NCBI_WGS_acc_token_contig
-};
-
-enum
-{
-    TTextToken_id,
-    TTextToken_start,
-    TTextToken_len
-};
-
-
-static
-uint32_t ParseWgsAccession ( uint16_t *tok, const char *acc, size_t acc_len )
-{
-    /* WGS accessions have form:
-     * [NZ_]<4-letter prefix><2-digit version><6-7 digit contig>
-     */
-    size_t i;
-
-    /* scan non-digits */
-    for ( i = 0; i < acc_len; ++ i )
-    {
-        if ( isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    /* require at least 4 characters... */
-    if ( i >= 4 )
-    {
-        /* require at least 8 digits */
-        if ( acc_len - i >= 8 )
-        {
-            /* 2-digit version */
-            if ( isdigit ( acc [ ++ i ] ) )
-            {
-                /* record first token as prefix */
-                tok [ 0 + TTextToken_id ] = NCBI_WGS_acc_token_prefix;
-                tok [ 0 + TTextToken_start ] = 0;
-                tok [ 0 + TTextToken_len ] = ( uint16_t ) ++ i;
-
-                /* the remainder should be contig */
-                tok [ 3 + TTextToken_id ] = NCBI_WGS_acc_token_contig;
-                tok [ 3 + TTextToken_start ] = ( uint16_t ) i;
-                tok [ 3 + TTextToken_len ] = ( uint16_t ) ( acc_len - i );
-
-                /* verify that it is numeric */
-                for ( ; i < acc_len; ++ i )
-                {
-                    if ( ! isdigit ( acc [ i ] ) )
-                        break;
-                }
-
-                /* great success */
-                if ( i == acc_len )
-                    return 2;
-            }
-        }
-    }
-
-    tok [ 0 + TTextToken_id ] = NCBI_WGS_acc_token_unrecognized;
-    tok [ 0 + TTextToken_start ] = 0;
-    tok [ 0 + TTextToken_len ] = ( uint16_t ) acc_len;
-
-    return 1;
-}
-
-static
-rc_t CC tokenize_nuc_accession ( void *obj,
-     const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-     uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *acc;
-    
-    assert ( rslt -> elem_bits == 16 * 3 );
-
-    rslt -> data -> elem_bits = rslt -> elem_bits;
-    rc = KDataBufferResize ( rslt -> data, 2 );
-    if ( rc != 0 )
-        return rc;
-
-    acc = argv [ 0 ] . u . data . base;
-    acc += argv [ 0 ] . u . data . first_elem;
-
-    rslt -> elem_count = ParseWgsAccession ( rslt -> data -> base, acc, argv [ 0 ] . u . data . elem_count );
-    if ( rslt -> elem_count != 2 )
-        rc = KDataBufferResize ( rslt -> data, rslt -> elem_count );
-
-    return rc;
-}
-
-static
-uint32_t ParseProtAccession ( uint16_t *tok, const char *acc, size_t acc_len )
-{
-    /* Protein accessions generally have pattern 
-     * <Cap-letter prefix><digital suffix>
-     * If this doesn't hold, use full accession as prefix, and make suffix empty.
-     */
-    size_t i;
-
-    for ( i = 0; i < acc_len; ++ i )
-    {
-        if ( isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    tok [ 0 + TTextToken_id ] = NCBI_WGS_acc_token_prefix;
-    tok [ 0 + TTextToken_start ] = 0;
-    tok [ 0 + TTextToken_len ] = ( uint16_t ) i;
-
-    for ( ; i < acc_len; ++ i )
-    {
-        if ( ! isdigit ( acc [ i ] ) )
-            break;
-    }
-
-    if ( i == acc_len )
-    {
-        tok [ 3 + TTextToken_id ] = NCBI_WGS_acc_token_contig;
-        tok [ 3 + TTextToken_start ] = tok [ 0 + TTextToken_len ];
-        tok [ 3 + TTextToken_len ] = ( uint16_t ) ( i - tok [ 0 + TTextToken_len ] );
-        return 2;
-    }
-
-    tok [ 0 + TTextToken_len ] = ( uint16_t ) acc_len;
-    return 1;
-}
-
-static
-rc_t CC tokenize_prot_accession ( void *obj,
-     const VXformInfo *info, int64_t row_id, VRowResult *rslt,
-     uint32_t argc, const VRowData argv [] )
-{
-    rc_t rc;
-    const char *acc;
-    
-    assert ( rslt -> elem_bits == 16 * 3 );
-
-    rslt -> data -> elem_bits = rslt -> elem_bits;
-    rc = KDataBufferResize ( rslt -> data, 2 );
-    if ( rc != 0 )
-        return rc;
-
-    acc = argv [ 0 ] . u . data . base;
-    acc += argv [ 0 ] . u . data . first_elem;
-
-    rslt -> elem_count = ParseProtAccession ( rslt -> data -> base, acc, argv [ 0 ] . u . data . elem_count );
-    if ( rslt -> elem_count != 2 )
-        rc = KDataBufferResize ( rslt -> data, rslt -> elem_count );
-
-    return rc;
-}
-
-VTRANSFACT_IMPL ( NCBI_WGS_tokenize_nuc_accession, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = tokenize_nuc_accession;
-    rslt -> variant = vftRow;
-    return 0;
-}
-
-VTRANSFACT_IMPL ( NCBI_WGS_tokenize_prot_accession, 1, 0, 0 ) ( const void *self, const VXfactInfo *info,
-    VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    rslt -> u . rf = tokenize_prot_accession;
-    rslt -> variant = vftRow;
-    return 0;
-}
diff --git a/libs/vxf/zip.c b/libs/vxf/zip.c
deleted file mode 100644
index 44f376d..0000000
--- a/libs/vxf/zip.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/extern.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <vdb/xform.h>
-#include <vdb/schema.h>
-#include <klib/data-buffer.h>
-#include <sysalloc.h>
-
-#include <string.h>
-#include <zlib.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifndef Z_MIN_LEVEL
-#define Z_MIN_LEVEL Z_DEFAULT_COMPRESSION
-#endif
-
-#ifndef Z_MAX_LEVEL
-#define Z_MAX_LEVEL Z_BEST_COMPRESSION
-#endif
-
-#ifndef Z_MIN_STRATEGY
-#define Z_MIN_STRATEGY Z_DEFAULT_STRATEGY
-#endif
-
-#ifndef Z_MAX_STRATEGY
-#define Z_MAX_STRATEGY Z_RLE
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-
-#define BUFFER_GROWTH_RATE (64 * 1024)
-
-struct self_t {
-    int32_t strategy;
-    int32_t level;
-};
-
-#if _DEBUGGING
-static void debug_print_z_stream(const z_stream *s) {
-    printf("avail_in: %lu, avail_out: %lu, total_in: %lu, total_out: %lu\n",
-           (unsigned long)s->avail_in,
-           (unsigned long)s->avail_out,
-           (unsigned long)s->total_in,
-           (unsigned long)s->total_out);
-}
-#endif
-
-static rc_t invoke_zlib(void *dst, uint32_t *dsize, const void *src, uint32_t ssize, int32_t strategy, int32_t level) {
-    z_stream s;
-    int zr;
-    rc_t rc = 0;
-    
-    memset(&s, 0, sizeof(s));
-    s.next_in = (void *)src;
-    s.avail_in = ssize;
-    s.next_out = dst;
-    s.avail_out = *dsize;
-    
-    *dsize = 0;
-    zr = deflateInit2(&s, level, Z_DEFLATED, -15, 9, strategy);
-    switch (zr) {
-    case 0:
-        break;
-    case Z_MEM_ERROR:
-        return RC(rcXF, rcFunction, rcExecuting, rcMemory, rcExhausted);
-    case Z_STREAM_ERROR:
-        return RC(rcXF, rcFunction, rcExecuting, rcParam, rcInvalid);
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "deflateInit2: unexpected zlib error %i: %s (strategy: %i, level: %i)\n", zr, s.msg, strategy, level);
-#endif
-        return RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-    zr = deflate(&s, Z_FINISH);
-    switch (zr) {
-    case Z_STREAM_END:
-        break;
-    case Z_OK:
-        s.total_out = 0;
-        break;
-    default:
-#if _DEBUGGING
-        fprintf(stderr, "deflate: unexpected zlib error %i: %s\n", zr, s.msg);
-#endif
-        rc = RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-        break;
-    }
-    zr = deflateEnd(&s);
-    if (zr != Z_OK && s.total_out != 0) {
-#if _DEBUGGING
-        fprintf(stderr, "deflateEnd: unexpected zlib error %i: %s\n", zr, s.msg);
-#endif
-        rc = RC(rcXF, rcFunction, rcExecuting, rcSelf, rcUnexpected);
-    }
-    if (rc == 0) {
-        assert(s.total_out <= UINT32_MAX);
-        *dsize = (uint32_t)s.total_out;
-    }
-    return rc;
-}
-
-static
-rc_t CC zip_func(
-              void *Self,
-              const VXformInfo *info,
-              VBlobResult *dst,
-              const VBlobData *src,
-              VBlobHeader *hdr
-) {
-    rc_t rc;
-    struct self_t *self = Self;
-
-    /* input bits */
-    uint64_t sbits = ( uint64_t) src -> elem_count * src -> elem_bits;
-
-    /* input bytes */
-    uint32_t ssize = ( uint32_t ) ( ( sbits + 7 ) >> 3 );
-
-    /* required output size */
-    uint32_t dsize = ( uint32_t ) ( ( ( size_t ) dst -> elem_count * dst->elem_bits + 7 ) >> 3 );
-
-    if ( ( sbits & 7 ) == 0 )
-        /* version 1 is byte-aligned */
-        VBlobHeaderSetVersion ( hdr, 1 );
-    else
-    {
-        VBlobHeaderSetVersion ( hdr, 2 );
-        VBlobHeaderArgPushTail ( hdr, ( int64_t ) ( sbits & 7 ) );
-    }
-
-    rc = invoke_zlib ( dst -> data, & dsize, src -> data, ssize, self->strategy, self->level);
-    if (rc == 0) {
-        dst->elem_bits = 1;
-        dst->byte_order = src->byte_order;
-        if (dsize)
-            dst->elem_count = dsize << 3;
-        else
-            rc = RC(rcXF, rcFunction, rcExecuting, rcBuffer, rcInsufficient);
-    }
-    return rc;
-}
-
-static
-void CC vxf_zip_wrapper( void *ptr )
-{
-	free( ptr );
-}
-
-/* zip
- * function zlib_fmt zip #1.0 < * I32 strategy, I32 level > ( any in );
- */
-VTRANSFACT_IMPL(vdb_zip, 1, 0, 0) (const void *self, const VXfactInfo *info, VFuncDesc *rslt, const VFactoryParams *cp, const VFunctionParams *dp )
-{
-    struct self_t *ctx;
-
-    int strategy = Z_RLE;
-    int level = Z_BEST_SPEED;
-
-    if ( cp -> argc > 0 )
-    {
-        strategy = cp -> argv [ 0 ] . data . i32 [ 0 ];
-        if ( strategy < Z_MIN_STRATEGY || strategy > Z_MAX_STRATEGY )
-            return RC(rcXF, rcFunction, rcConstructing, rcParam, rcInvalid);
-        if ( cp -> argc > 1 )
-        {
-            level = cp -> argv [ 1 ] . data . i32 [ 0 ];
-            if ( level < Z_MIN_LEVEL || level > Z_MAX_LEVEL )
-                return RC(rcXF, rcFunction, rcConstructing, rcRange, rcInvalid);
-        }
-    }
-
-    ctx = malloc(sizeof(*ctx));
-    if (ctx) {
-        ctx->strategy = strategy;
-        ctx->level = level;
-       
-        rslt->self = ctx;
-        rslt->whack = vxf_zip_wrapper;
-        rslt->variant = vftBlob;
-        rslt->u.bf = zip_func;
-        
-        return 0;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/wgsxf/Makefile b/libs/wgsxf/Makefile
deleted file mode 100644
index 0aa7bfc..0000000
--- a/libs/wgsxf/Makefile
+++ /dev/null
@@ -1,124 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = libs/wgsxf
-
-INT_LIBS = \
-	libwgsxf \
-	libwwgsxf
-
-ALL_LIBS = \
-	$(INT_LIBS)
-
-TEST_TOOLS = \
-
-include $(TOP)/build/Makefile.env
-
-RWORKDIR = $(BINDIR)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): makedirs
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(TEST_TOOLS): makedirs
-	@ $(MAKE_CMD) $(TEST_BINDIR)/$@
-
-.PHONY: all std $(ALL_LIBS) $(TEST_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(TARGDIR)/,$(INT_LIBS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# wgs-vdb transform library
-#
-$(TARGDIR)/libwgsxf: $(addprefix $(ILIBDIR)/libwgsxf.,$(ILIBEXT))
-
-WGSXF_SRC = \
-	build_scaffold \
-	build_read_type
-
-WGSXF_OBJ = \
-	$(addsuffix .$(LOBX),$(WGSXF_SRC))
-
-WGSXF_LIB = \
-	-dvdb \
-	-dklib \
-	-dm \
-	-dz \
-	-dbz2
-
-$(ILIBDIR)/libwgsxf.$(LIBX): $(WGSXF_OBJ)
-	$(LD) --slib -o $@ $^ $(WGSXF_LIB)
-
-.PHONY: $(TARGDIR)/libwgsxf
-
-#-------------------------------------------------------------------------------
-# update-side wgs transform library
-#
-
-$(TARGDIR)/libwwgsxf: $(addprefix $(ILIBDIR)/libwwgsxf.,$(ILIBEXT))
-
-WWGSXF_SRC = \
-	$(WGSXF_SRC)
-
-WWGSXF_OBJ = \
-	$(addsuffix .$(LOBX),$(WWGSXF_SRC))
-
-# temporary
-WWGSXF_LIB = \
-	-dwvdb \
-	-dwkdb \
-	-dklib \
-	-dm \
-	-dz \
-	-dbz2
-
-$(ILIBDIR)/libwwgsxf.$(LIBX): $(WWGSXF_OBJ)
-	$(LD) --slib -o $@ $^ $(WWGSXF_LIB)
-
-libwwgsxf.vers.h:
-	@ true
-
-.PHONY: $(TARGDIR)/libwwgsxf
diff --git a/libs/wgsxf/build_read_type.c b/libs/wgsxf/build_read_type.c
deleted file mode 100644
index 02ebed5..0000000
--- a/libs/wgsxf/build_read_type.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-#include <ncbi/wgs-contig.h>
-
-static
-rc_t build_read_type(INSDC_SRA_xread_type dst[],
-                     unsigned const components,
-                     NCBI_WGS_component_props const Props[/* components */])
-{
-    unsigned i;
-    
-    for (i = 0; i != components; ++i) {
-        int const props = Props[i];
-        
-        if (props < 0) {
-            dst[i] = SRA_READ_TYPE_TECHNICAL;
-        }
-        else {
-            int const type = props & 0x0F;
-            
-            if (type == 0) {
-                int const strand = props & ~(NCBI_WGS_strand_plus | NCBI_WGS_strand_minus);
-                
-                switch (strand) {
-                case 0:
-                    dst[i] = SRA_READ_TYPE_BIOLOGICAL;
-                    break;
-                case NCBI_WGS_strand_plus:
-                    dst[i] = SRA_READ_TYPE_BIOLOGICAL | SRA_READ_TYPE_FORWARD;
-                    break;
-                case NCBI_WGS_strand_minus:
-                    dst[i] = SRA_READ_TYPE_BIOLOGICAL | SRA_READ_TYPE_REVERSE;
-                    break;
-                default:
-                    return RC(rcXF, rcFunction, rcExecuting, rcType, rcInvalid);
-                }
-            }
-            else
-                return RC(rcXF, rcFunction, rcExecuting, rcType, rcInvalid);
-        }
-    }
-    return 0;
-}
-
-/*
- * function INSDC:SRA:xread_type NCBI:WGS:build_read_type #1
- *     ( NCBI:WGS:component_props component_props )
- */
-
-static
-rc_t CC build_read_type_impl(void *self, VXformInfo const *info, int64_t row_id,
-                             VFixedRowResult const *rslt,
-                             uint32_t argc, VRowData const argv[])
-{
-    NCBI_WGS_component_props const *const props = argv[0].u.data.base;
-    unsigned const components = argv[0].u.data.elem_count;
-    INSDC_SRA_xread_type *const dst = rslt->base;
-
-    return build_read_type(&dst[rslt->first_elem], components,
-                           &props[argv[0].u.data.first_elem]);
-}
-
-VTRANSFACT_IMPL(NCBI_WGS_build_read_type, 1, 0, 0)(void const *const Self,
-                                                   VXfactInfo const *const info,
-                                                   VFuncDesc *const rslt,
-                                                   VFactoryParams const *const cp,
-                                                   VFunctionParams const *const dp)
-{
-    rslt->variant = vftFixedRow;
-    rslt->u.pf = build_read_type_impl;
-    return 0;
-}
diff --git a/libs/wgsxf/build_scaffold.c b/libs/wgsxf/build_scaffold.c
deleted file mode 100644
index 41b900d..0000000
--- a/libs/wgsxf/build_scaffold.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <vdb/extern.h>
-#include <vdb/xform.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/schema.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <kdb/meta.h>
-#include <klib/data-buffer.h>
-#include <insdc/insdc.h>
-#include <align/refseq-mgr.h>
-#include <bitstr.h>
-#include <sysalloc.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <insdc/sra.h>
-#include <ncbi/wgs-contig.h>
-
-#define READ_GAP_VALUE (0)
-#define QUAL_GAP_VALUE (2)
-
-#define CURSOR_CACHE_SIZE (4 * 1024 * 1024)
-
-typedef struct self_t self_t;
-typedef rc_t (*impl_f)(self_t const *const self, void *const Dst,
-                       unsigned const components,
-                       INSDC_coord_one const start[/* components */],
-                       INSDC_coord_len const length[/* components */],
-                       NCBI_WGS_component_props const props[/* components */],
-                       int64_t const join[/* components */]);
-
-struct self_t
-{
-    VCursor const *curs;
-    uint32_t col_idx;
-    impl_f impl;
-};
-
-static void free_self(self_t *const self)
-{
-    VCursorRelease(self->curs);
-}
-
-static
-void CC whack(void *vp)
-{
-    if (vp) {
-        free_self(vp);
-        free(vp);
-    }
-}
-
-
-static bool does_table_have_column( VTable const * tbl, char const column[] )
-{
-    KNamelist * column_names;
-    bool res = false;
-    rc_t rc = VTableListReadableColumns ( tbl, &column_names );
-    if ( rc == 0 )
-    {
-        uint32_t count;
-        rc = KNamelistCount ( column_names, &count );
-        if ( rc == 0 && count > 0 )
-        {
-            uint32_t idx;
-            size_t col_name_size;
-            const char * col_name = string_chr ( column, string_size( column ), ')' );
-            if ( col_name == NULL )
-                col_name = column;
-            else
-                col_name++;
-            col_name_size = string_size( col_name );
-            for ( idx = 0; idx < count && rc == 0 && !res; ++idx )
-            {
-                const char * name;
-                rc = KNamelistGet ( column_names, idx, &name );
-                if ( rc == 0 && name != NULL )
-                {
-                    int cmp = string_cmp( col_name, col_name_size,
-                                          name, string_size( name ), 0xFFFF );
-                    if ( cmp == 0 )
-                        res = true;
-                }
-            }
-        }
-        KNamelistRelease ( column_names );
-    }
-    return res;
-}
-
-
-static
-rc_t init_self( self_t *self, VTable const * const srctbl, char const column[] )
-{
-    VDatabase const * db;
-    rc_t rc = VTableOpenParentRead( srctbl, &db );
-    if ( rc == 0 )
-    {
-        VTable const * tbl;
-        rc = VDatabaseOpenTableRead( db, &tbl, "SEQUENCE" );
-        VDatabaseRelease( db );
-        if ( rc == 0 )
-        {
-            bool has_column = does_table_have_column( tbl, column );
-            if ( !has_column )
-                VTableRelease( tbl );
-            else
-            {
-                VCursor const * curs;
-#if CURSOR_CACHE_SIZE
-                rc = VTableCreateCachedCursorRead( tbl, &curs, CURSOR_CACHE_SIZE );
-#else
-                rc = VTableCreateCursorRead( tbl, &curs );
-#endif
-                VTableRelease( tbl );
-                if ( rc == 0 )
-                {
-                    uint32_t col_idx;
-                    rc = VCursorAddColumn( curs, &col_idx, column );
-                    if ( rc == 0 )
-                    {
-                        rc = VCursorOpen( curs );
-                        if ( rc == 0 )
-                        {
-                            self->curs = curs;
-                            self->col_idx = col_idx;
-                            return 0;
-                        }
-                        if ( GetRCObject( rc ) == rcColumn && GetRCState( rc ) == rcUndefined )
-                            rc = 0;
-                    }
-                    VCursorRelease( curs );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t build_scaffold_read_impl(self_t const *const self, void *const Dst,
-                              unsigned const components,
-                              INSDC_coord_one const Start[/* components */],
-                              INSDC_coord_len const Length[/* components */],
-                              NCBI_WGS_component_props const Props[/* components */],
-                              int64_t const join[/* components */])
-{
-    INSDC_4na_bin *const dst = Dst;
-    unsigned i;
-    unsigned j;
-    unsigned id;
-    rc_t rc;
-    
-    for (rc = 0, id = j = i = 0; rc == 0 && i != components; ++i) {
-        INSDC_coord_len const length = Length[i];
-        int const props = Props[i];
-
-        if (props < 0) {
-            /* gap */
-            memset(dst + j, READ_GAP_VALUE, length);
-        }
-        else if (self->curs == NULL) {
-            memset(dst + j, 15, length);
-        }
-        else {
-            int const type = props & 0x0F;
-            int const strand = (props & ~(NCBI_WGS_strand_plus | NCBI_WGS_strand_minus)) >> 4;
-            
-            if (type != 0 || strand == 3)
-                rc = RC(rcXF, rcFunction, rcExecuting, rcType, rcInvalid);
-            else {
-                int64_t const row = join[id++];
-                uint32_t elem_bits;
-                uint32_t bit_offset;
-                uint32_t elem_count;
-                void const *base;
-                
-                rc = VCursorCellDataDirect(self->curs, row, self->col_idx,
-                                           &elem_bits, &base, &bit_offset,
-                                           &elem_count);
-                assert(bit_offset == 0);
-                if (rc == 0) {
-                    INSDC_coord_one const start = Start[i] - 1;
-                    
-                    if (elem_count < start + length)
-                        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                    else {
-                        INSDC_4na_bin const *const src = base;
-                        
-                        if (strand == 2) {
-                            static INSDC_4na_bin const complement[] = {
-                                /* 0  0000 - 0000*/  0,
-                                /* 1  0001 - 1000*/  8,
-                                /* 2  0010 - 0100*/  4,
-                                /* 3  0011 - 1100*/ 12,
-                                /* 4  0100 - 0010*/  2,
-                                /* 5  0101 - 1010*/ 10,
-                                /* 6  0110 - 0110*/  6,
-                                /* 7  0111 - 1110*/ 14,
-                                /* 8  1000 - 0001*/  1,
-                                /* 9  1001 - 1001*/  9,
-                                /*10  1010 - 0101*/  5,
-                                /*11  1011 - 1101*/ 13,
-                                /*12  1100 - 0011*/  3,
-                                /*13  1101 - 1011*/ 11,
-                                /*14  1110 - 0111*/  7,
-                                /*15  1111 - 1111*/ 15
-                            };
-                            unsigned k;
-                            unsigned jj;
-                            
-                            for (jj = j + length, k = 0; k != length; ++k) {
-                                INSDC_4na_bin const elem = src[start + k];
-                                
-                                assert(0 <= elem && elem <= 15);
-                                --jj;
-                                dst[jj] = complement[elem];
-                            }
-                        }
-                        else
-                            memcpy(&dst[j], &src[start], length);
-                    }
-                }
-            }
-        }
-
-        j += length;
-    }
-    return rc;
-}
-
-static
-rc_t build_scaffold_qual_impl(self_t const *const self, void *const Dst,
-                              unsigned const components,
-                              INSDC_coord_one const Start[/* components */],
-                              INSDC_coord_len const Length[/* components */],
-                              NCBI_WGS_component_props const Props[/* components */],
-                              int64_t const join[/* components */])
-{
-    INSDC_quality_phred *const dst = Dst;
-    unsigned i;
-    unsigned j;
-    unsigned id;
-    rc_t rc;
-    
-    for (rc = 0, id = j = i = 0; rc == 0 && i != components; ++i) {
-        INSDC_coord_len const length = Length[i];
-        int const props = Props[i];
-        
-        if (props < 0) {
-            /* gap */
-            memset(dst + j, QUAL_GAP_VALUE, length);
-        }
-        else if (self->curs == NULL) {
-            memset(dst + j, 30, length);
-        }
-        else {
-            int const type = props & 0x0F;
-            int const strand = (props & ~(NCBI_WGS_strand_plus | NCBI_WGS_strand_minus)) >> 4;
-            
-            if (type != 0 || strand == 3)
-                rc = RC(rcXF, rcFunction, rcExecuting, rcType, rcInvalid);
-            else {
-                int64_t const row = join[id++];
-                uint32_t elem_bits;
-                uint32_t bit_offset;
-                uint32_t elem_count;
-                void const *base;
-                
-                rc = VCursorCellDataDirect(self->curs, row, self->col_idx,
-                                           &elem_bits, &base, &bit_offset,
-                                           &elem_count);
-                assert(bit_offset == 0);
-                if (rc == 0) {
-                    INSDC_quality_phred const start = Start[i] - 1;
-                    
-                    if (elem_count < start + length)
-                        rc = RC(rcXF, rcFunction, rcExecuting, rcData, rcInsufficient);
-                    else {
-                        INSDC_quality_phred const *const src = base;
-                        
-                        if (strand == 2) {
-                            unsigned k;
-                            unsigned jj;
-                            
-                            for (jj = j + length, k = 0; k != length; ++k) {
-                                INSDC_quality_phred const elem = src[start + k];
-                                
-                                --jj;
-                                dst[jj] = elem;
-                            }
-                        }
-                        else
-                            memcpy(&dst[j], &src[start], length);
-                    }
-                }
-            }
-        }
-        
-        j += length;
-    }
-    return rc;
-}
-
-static
-unsigned total_length(unsigned const components, INSDC_coord_len const length[/* components */])
-{
-    unsigned i;
-    unsigned len;
-    
-    for (i = len = 0; i != components; ++i)
-        len += length[i];
-    return len;
-}
-
-
-/*
- * function INSDC:4na:bin NCBI:WGS:build_scaffold_read #1
- *     ( INSDC:coord:one component_start, INSDC:coord:len component_len,
- *       NCBI:WGS:component_props component_props, I64 component_id )
- *
- * function INSDC:quality:phred NCBI:WGS:build_scaffold_qual #1
- *     ( INSDC:coord:one component_start, INSDC:coord:len component_len,
- *       NCBI:WGS:component_props component_props, I64 component_id )
- */
-
-static
-rc_t CC build_scaffold_impl(void *const data, VXformInfo const *const info,
-                            int64_t const row_id, VRowResult *const rslt,
-                            uint32_t const argc, VRowData const argv[])
-{
-    self_t const *const self = data;
-    INSDC_coord_one const *const start = argv[0].u.data.base;
-    INSDC_coord_len const *const length = argv[1].u.data.base;
-    NCBI_WGS_component_props const *const props = argv[2].u.data.base;
-    int64_t const *const join = argv[3].u.data.base;
-    unsigned const components = argv[0].u.data.elem_count;
-    rc_t rc;
-    
-    assert(argv[1].u.data.elem_count == components);
-    assert(argv[2].u.data.elem_count == components);
-    
-    assert(start != NULL);
-    assert(length != NULL);
-    assert(props != NULL);
-    assert(join != NULL);
-    
-    assert(rslt->elem_bits == 8);
-    rslt->elem_count = total_length(components, &length[argv[1].u.data.first_elem]);
-    rc = KDataBufferResize(rslt->data, rslt->elem_count);
-    if (rc == 0)
-        rc = self->impl(self, rslt->data->base, components,
-                        &start[argv[0].u.data.first_elem],
-                        &length[argv[1].u.data.first_elem],
-                        &props[argv[2].u.data.first_elem],
-                        &join[argv[3].u.data.first_elem]);
-    return rc;
-}
-
-VTRANSFACT_IMPL(NCBI_WGS_build_scaffold_read, 1, 0, 0)(void const * Self,
-                                                       VXfactInfo const * info,
-                                                       VFuncDesc * rslt,
-                                                       VFactoryParams const * cp,
-                                                       VFunctionParams const * dp)
-{
-    self_t *self = calloc(1, sizeof(*self));
-    if (self) {
-        rc_t const rc = init_self(self, info->tbl, "(INSDC:4na:bin)READ");
-        
-        if (rc == 0) {
-            self->impl = build_scaffold_read_impl;
-            
-            rslt->self = self;
-            rslt->whack = whack;
-            rslt->variant = vftRow;
-            rslt->u.rf = build_scaffold_impl;
-        }
-        return rc;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
-
-VTRANSFACT_IMPL(NCBI_WGS_build_scaffold_qual, 1, 0, 0)(void const * Self,
-                                                       VXfactInfo const * info,
-                                                       VFuncDesc * rslt,
-                                                       VFactoryParams const * cp,
-                                                       VFunctionParams const * dp)
-{
-    self_t *self = calloc(1, sizeof(*self));
-    if (self) {
-        rc_t const rc = init_self(self, info->tbl, "(INSDC:quality:phred)QUALITY");
-    
-        if (rc == 0) {
-            self->impl = build_scaffold_qual_impl;
-            
-            rslt->self = self;
-            rslt->whack = whack;
-            rslt->variant = vftRow;
-            rslt->u.rf = build_scaffold_impl;
-        }
-        return rc;
-    }
-    return RC(rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted);
-}
diff --git a/libs/wgsxf/libwgsxf.vers b/libs/wgsxf/libwgsxf.vers
deleted file mode 100644
index 3eefcb9..0000000
--- a/libs/wgsxf/libwgsxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.0
diff --git a/libs/wgsxf/libwwgsxf.vers b/libs/wgsxf/libwwgsxf.vers
deleted file mode 100644
index 3eefcb9..0000000
--- a/libs/wgsxf/libwwgsxf.vers
+++ /dev/null
@@ -1 +0,0 @@
-1.0.0
diff --git a/sra-sdk_2.3.3-4~dfsg-1_amd64.build b/sra-sdk_2.3.3-4~dfsg-1_amd64.build
new file mode 100644
index 0000000..eabfce6
--- /dev/null
+++ b/sra-sdk_2.3.3-4~dfsg-1_amd64.build
@@ -0,0 +1,2821 @@
+I: Using pkgname logfile
+I: Current time: Wed Oct 23 11:53:55 CEST 2013
+I: pbuilder-time-stamp: 1382522035
+I: Obtaining the cached apt archive contents
+I: Installing the build-deps
+W: no hooks of type D found -- ignoring
+ -> Attempting to satisfy build-dependencies
+ -> Creating pbuilder-satisfydepends-dummy package
+Package: pbuilder-satisfydepends-dummy
+Version: 0.invalid.0
+Architecture: amd64
+Maintainer: Debian Pbuilder Team <pbuilder-maint at lists.alioth.debian.org>
+Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder
+ This package was created automatically by pbuilder to satisfy the
+ build-dependencies of the package being currently built.
+Depends: debhelper (>= 9), libbz2-dev, zlib1g-dev, libxml2-dev
+dpkg-deb: building package `pbuilder-satisfydepends-dummy' in `/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'.
+Selecting previously unselected package pbuilder-satisfydepends-dummy.
+(Reading database ... 12146 files and directories currently installed.)
+Unpacking pbuilder-satisfydepends-dummy (from .../pbuilder-satisfydepends-dummy.deb) ...
+dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring anyway as you requested:
+ pbuilder-satisfydepends-dummy depends on debhelper (>= 9); however:
+  Package debhelper is not installed.
+ pbuilder-satisfydepends-dummy depends on libbz2-dev; however:
+  Package libbz2-dev is not installed.
+ pbuilder-satisfydepends-dummy depends on zlib1g-dev; however:
+  Package zlib1g-dev is not installed.
+ pbuilder-satisfydepends-dummy depends on libxml2-dev; however:
+  Package libxml2-dev is not installed.
+
+Setting up pbuilder-satisfydepends-dummy (0.invalid.0) ...
+Reading package lists...
+Building dependency tree...
+Reading state information...
+Initializing package states...
+Writing extended state information...
+The following NEW packages will be installed:
+  bsdmainutils{a} debhelper{a} file{a} gettext{a} gettext-base{a} 
+  groff-base{a} intltool-debian{a} libasprintf0c2{a} libbz2-dev{a} 
+  libcroco3{a} libffi6{a} libglib2.0-0{a} libmagic1{a} libpipeline1{a} 
+  libunistring0{a} libxml2{a} libxml2-dev{a} man-db{a} po-debconf{a} 
+  zlib1g-dev{a} 
+0 packages upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
+Need to get 0 B/8901 kB of archives. After unpacking 28.3 MB will be used.
+Writing extended state information...
+debconf: delaying package configuration, since apt-utils is not installed
+Selecting previously unselected package libpipeline1:amd64.
+(Reading database ... 12146 files and directories currently installed.)
+Unpacking libpipeline1:amd64 (from .../libpipeline1_1.2.4-1_amd64.deb) ...
+Selecting previously unselected package groff-base.
+Unpacking groff-base (from .../groff-base_1.22.2-3_amd64.deb) ...
+Selecting previously unselected package bsdmainutils.
+Unpacking bsdmainutils (from .../bsdmainutils_9.0.5_amd64.deb) ...
+Selecting previously unselected package man-db.
+Unpacking man-db (from .../man-db_2.6.5-2_amd64.deb) ...
+Selecting previously unselected package libasprintf0c2:amd64.
+Unpacking libasprintf0c2:amd64 (from .../libasprintf0c2_0.18.3.1-1_amd64.deb) ...
+Selecting previously unselected package libmagic1:amd64.
+Unpacking libmagic1:amd64 (from .../libmagic1_1%3a5.14-2_amd64.deb) ...
+Selecting previously unselected package libxml2:amd64.
+Unpacking libxml2:amd64 (from .../libxml2_2.9.1+dfsg1-3_amd64.deb) ...
+Selecting previously unselected package libffi6:amd64.
+Unpacking libffi6:amd64 (from .../libffi6_3.0.13-4_amd64.deb) ...
+Selecting previously unselected package libglib2.0-0:amd64.
+Unpacking libglib2.0-0:amd64 (from .../libglib2.0-0_2.36.4-1_amd64.deb) ...
+Selecting previously unselected package libcroco3:amd64.
+Unpacking libcroco3:amd64 (from .../libcroco3_0.6.8-2_amd64.deb) ...
+Selecting previously unselected package libunistring0:amd64.
+Unpacking libunistring0:amd64 (from .../libunistring0_0.9.3-5_amd64.deb) ...
+Selecting previously unselected package file.
+Unpacking file (from .../file_1%3a5.14-2_amd64.deb) ...
+Selecting previously unselected package gettext-base.
+Unpacking gettext-base (from .../gettext-base_0.18.3.1-1_amd64.deb) ...
+Selecting previously unselected package gettext.
+Unpacking gettext (from .../gettext_0.18.3.1-1_amd64.deb) ...
+Selecting previously unselected package intltool-debian.
+Unpacking intltool-debian (from .../intltool-debian_0.35.0+20060710.1_all.deb) ...
+Selecting previously unselected package po-debconf.
+Unpacking po-debconf (from .../po-debconf_1.0.16+nmu2_all.deb) ...
+Selecting previously unselected package debhelper.
+Unpacking debhelper (from .../debhelper_9.20130921_all.deb) ...
+Selecting previously unselected package libbz2-dev:amd64.
+Unpacking libbz2-dev:amd64 (from .../libbz2-dev_1.0.6-5_amd64.deb) ...
+Selecting previously unselected package libxml2-dev:amd64.
+Unpacking libxml2-dev:amd64 (from .../libxml2-dev_2.9.1+dfsg1-3_amd64.deb) ...
+Selecting previously unselected package zlib1g-dev:amd64.
+Unpacking zlib1g-dev:amd64 (from .../zlib1g-dev_1%3a1.2.8.dfsg-1_amd64.deb) ...
+Setting up libpipeline1:amd64 (1.2.4-1) ...
+Setting up groff-base (1.22.2-3) ...
+Setting up bsdmainutils (9.0.5) ...
+update-alternatives: using /usr/bin/bsd-write to provide /usr/bin/write (write) in auto mode
+update-alternatives: using /usr/bin/bsd-from to provide /usr/bin/from (from) in auto mode
+Setting up man-db (2.6.5-2) ...
+Building database of manual pages ...
+Setting up libasprintf0c2:amd64 (0.18.3.1-1) ...
+Setting up libmagic1:amd64 (1:5.14-2) ...
+Setting up libxml2:amd64 (2.9.1+dfsg1-3) ...
+Setting up libffi6:amd64 (3.0.13-4) ...
+Setting up libglib2.0-0:amd64 (2.36.4-1) ...
+No schema files found: doing nothing.
+Setting up libcroco3:amd64 (0.6.8-2) ...
+Setting up libunistring0:amd64 (0.9.3-5) ...
+Setting up file (1:5.14-2) ...
+Setting up gettext-base (0.18.3.1-1) ...
+Setting up gettext (0.18.3.1-1) ...
+Setting up intltool-debian (0.35.0+20060710.1) ...
+Setting up po-debconf (1.0.16+nmu2) ...
+Setting up debhelper (9.20130921) ...
+Setting up libbz2-dev:amd64 (1.0.6-5) ...
+Setting up libxml2-dev:amd64 (2.9.1+dfsg1-3) ...
+Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-1) ...
+Processing triggers for libc-bin ...
+Reading package lists...
+Building dependency tree...
+Reading state information...
+Reading extended state information...
+Initializing package states...
+Writing extended state information...
+ -> Finished parsing the build-deps
+Reading package lists...
+Building dependency tree...
+Reading state information...
+The following NEW packages will be installed:
+  fakeroot
+debconf: delaying package configuration, since apt-utils is not installed
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Need to get 0 B/95.1 kB of archives.
+After this operation, 351 kB of additional disk space will be used.
+Selecting previously unselected package fakeroot.
+(Reading database ... 13615 files and directories currently installed.)
+Unpacking fakeroot (from .../fakeroot_1.20-1_amd64.deb) ...
+Processing triggers for man-db ...
+Setting up fakeroot (1.20-1) ...
+update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
+I: Copying back the cached apt archive contents
+I: Copying source file
+I: copying [/home/tillea/debian-maintain/alioth/debian-med_git/build-area/sra-sdk_2.3.3-4~dfsg-1.dsc]
+I: copying [/home/tillea/debian-maintain/alioth/debian-med_git/build-area/sra-sdk_2.3.3-4~dfsg.orig.tar.gz]
+I: copying [/home/tillea/debian-maintain/alioth/debian-med_git/build-area/sra-sdk_2.3.3-4~dfsg-1.debian.tar.gz]
+I: Extracting source
+dpkg-source: warning: extracting unsigned source package (sra-sdk_2.3.3-4~dfsg-1.dsc)
+dpkg-source: info: extracting sra-sdk in sra-sdk-2.3.3-4~dfsg
+dpkg-source: info: unpacking sra-sdk_2.3.3-4~dfsg.orig.tar.gz
+dpkg-source: info: unpacking sra-sdk_2.3.3-4~dfsg-1.debian.tar.gz
+dpkg-source: info: applying do_not_build_external_libs.patch
+dpkg-source: info: applying 10_portability.patch
+dpkg-source: info: applying build-with-system-libbz2-libz.patch
+dpkg-source: info: applying hardening.patch
+dpkg-source: info: applying hardening-format-security.patch
+I: Building the package
+W: no hooks of type A found -- ignoring
+I: Running cd tmp/buildd/*/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin" dpkg-buildpackage -us -uc   -i\.git -I.git   -i\.git -I.git  -rfakeroot
+dpkg-buildpackage: source package sra-sdk
+dpkg-buildpackage: source version 2.3.3-4~dfsg-1
+dpkg-buildpackage: source distribution unstable
+dpkg-buildpackage: source changed by Andreas Tille <tille at debian.org>
+ dpkg-source -i.git -I.git -i.git -I.git --before-build sra-sdk-2.3.3-4~dfsg
+dpkg-buildpackage: host architecture amd64
+ fakeroot debian/rules clean
+dh clean
+   dh_testdir
+   debian/rules override_dh_clean
+make[1]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+dh_clean
+find libs/krypto -name "*.pic.o.list" -delete
+rm -f build/OUTDIR.linux
+make[1]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+ dpkg-source -i.git -I.git -i.git -I.git -b sra-sdk-2.3.3-4~dfsg
+dpkg-source: info: using source format `3.0 (quilt)'
+dpkg-source: info: building sra-sdk using existing ./sra-sdk_2.3.3-4~dfsg.orig.tar.gz
+dpkg-source: info: building sra-sdk in sra-sdk_2.3.3-4~dfsg-1.debian.tar.gz
+dpkg-source: info: building sra-sdk in sra-sdk_2.3.3-4~dfsg-1.dsc
+ debian/rules build
+make: `build' is up to date.
+ fakeroot debian/rules binary
+dh binary
+   dh_testdir
+   debian/rules override_dh_auto_configure
+make[1]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+export OUTDIR=/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp ; make OUTDIR=/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp out ; make release dynamic
+make[2]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+  current build is linux static rel x86_64 build using gcc tools
+  output target directory is '/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/stat/x86_64/rel'
+
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[2]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[2]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+  current build is linux static rel x86_64 build using gcc tools
+  output target directory is '/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/stat/x86_64/rel'
+
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+  current build is linux dynamic rel x86_64 build using gcc tools
+  output target directory is '/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel'
+
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[2]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[1]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+   debian/rules override_dh_auto_build
+make[1]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/lib"; export OUTDIR=/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp ; make DEB_CFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" DEB_LDFLAGS="-Wl,-z,relro"
+make[2]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy'
+make[6]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy'
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMalloc.n.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMalloc.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudySL.n.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudySL.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyHS.n.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyHS.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyGet.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyGet.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyIns.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyInsArray.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyInsArray.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyDel.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyDel.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCascade.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCascade.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCount.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCount.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCreateBranch.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCreateBranch.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyDecascade.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyDecascade.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyFirst.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyFirst.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyFreeArray.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyFreeArray.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyInsertBranch.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyInsertBranch.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMallocIF.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMallocIF.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMemActive.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMemActive.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMemUsed.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMemUsed.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyNext.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyNext.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyNextEmpty.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyNextEmpty.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyPrev.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyPrev.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyPrevEmpty.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyPrevEmpty.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyByCountWithDefs.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyByCountWithDefs.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o j__udyGet.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/j__udyGet.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyTablesGen.w.64.o -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyTablesGen.c
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/JudyLTablesGen -Wl,-z,relro JudyTablesGen.w.64.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/JudyLTablesGen
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyLTables.w.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDYL -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/JudyLTables.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyGet.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyGet.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyIns.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c:29:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c: In function 'j__udyInsWalk':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c:1504:51: warning: iteration 8u invokes undefined behavior [-Waggressive-loop-optimizations]
+                 JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]);
+                                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/Judy1.h:400:58: note: in definition of macro 'J1_JLB_BITMAP'
+ #define J1_JLB_BITMAP(Pjlb,Subexp)  ((Pjlb)->j1lb_Bitmap[Subexp])
+                                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyPrivate.h:822:26: note: in expansion of macro 'JU_SUBEXPL'
+     (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) |= JU_BITPOSMASKL(INDEX))
+                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c:1504:17: note: in expansion of macro 'JU_BITMAPSETL'
+                 JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]);
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyIns.c:1503:13: note: containing loop
+             for (offset = 0; offset < 15; ++offset)
+             ^
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyInsArray.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyInsArray.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyDel.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyDel.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCascade.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCascade.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCount.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCount.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyCreateBranch.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyCreateBranch.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyDecascade.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyDecascade.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyFirst.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyFirst.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyFreeArray.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyFreeArray.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyInsertBranch.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyInsertBranch.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMallocIF.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMallocIF.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMemActive.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMemActive.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyMemUsed.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyMemUsed.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyNext.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyNext.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyNextEmpty.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyNextEmpty.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyPrev.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyPrev.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyPrevEmpty.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyPrevEmpty.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyByCountWithDefs.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyByCountWithDefs.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o j__udyGet.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/j__udyGet.c
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o JudyTablesGen.b.64.o -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/JudyTablesGen.c
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/Judy1TablesGen -Wl,-z,relro JudyTablesGen.b.64.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/Judy1TablesGen
+gcc -c  -DNDEBUG -Wno-array-bounds     -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -MD -o Judy1Tables.b.64.pic.o -fPIC -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing -DNDEBUG -Wno-array-bounds -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy/.. -DJUDY1 -DJU_64BIT /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy/Judy1Tables.c
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libjudy.a JudyMalloc.n.64.pic.o JudySL.n.64.pic.o JudyHS.n.64.pic.o JudyGet.w.64.pic.o JudyIns.w.64.pic.o JudyInsArray.w.64.pic.o JudyDel.w.64.pic.o JudyCascade.w.64.pic.o JudyCount.w.64.pic.o JudyCreateBranch.w.64.pic.o JudyDecascade.w.64.pic.o JudyFirst.w.64.pic.o JudyFreeArray.w.64.pic.o JudyInsertBranch.w.64.pic.o JudyMallocIF.w.64.pic.o JudyMemActive.w.64.pic.o JudyMemUsed.w.64.pic.o JudyNext.w.64.pic.o [...]
+make[6]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib/judy'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/printf.c: In function 'string_flush_vprintf':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/printf.c:153:21: warning: variable 'trim_trailing_zeros' set but not used [-Wunused-but-set-variable]
+     bool alternate, trim_trailing_zeros, date_time_zone;
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/printf.c: In function 'parse_format_string':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/printf.c:1411:14: warning: variable 'has_width' set but not used [-Wunused-but-set-variable]
+         bool has_width, has_precision;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/printf.c:1402:13: warning: variable 'str' set but not used [-Wunused-but-set-variable]
+     String *str = * strp;
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c: In function 'KVectorGet':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c:281:52: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                             * ( uint64_t* ) buffer = ( uint64_t ) data;
+                                                    ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c:246:44: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                         * ( bool* ) buffer = data;
+                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c: In function 'KVectorSet':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c:414:25: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     * ( Word_t* ) datap = value;
+                         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/judy-vector.c:431:16: note: 'value' was declared here
+         Word_t value;
+                ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libklib.a text.pic.o utf8.pic.o iso8859.pic.o iso8859-1.pic.o cp1252.pic.o token.pic.o symtab.pic.o container.pic.o vector.pic.o namelist.pic.o vector_namelist.pic.o trie.pic.o pbstree.pic.o pbstree-impl.nopt.pic.o pbstree-impl.swap.nopt.pic.o bstpersist.nopt.pic.o ptrie.nopt.pic.o ptpersist.nopt.pic.o crc32.pic.o md5.pic.o SHA-32bit.pic.o SHA-64bit.pic.o qsort.pic.o ksort.pic.o bsearch.pic.o pack.pic.o unpa [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/klib'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/klib'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kproc'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libksproc.a task.pic.o procmgr.pic.o sttimeout.pic.o stlock.pic.o stcond.pic.o stsem.pic.o stthread.pic.o stbarrier.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkproc.a task.pic.o procmgr.pic.o systimeout.pic.o syslock.pic.o systhread.pic.o syscond.pic.o sem.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/queue.c: In function 'KQueuePop':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc/queue.c:327:64: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if ( self -> sealed && GetRCObject ( rc ) == rcTimeout )
+                                                                ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkq.a queue.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kproc'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kproc'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kfs'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c: In function 'KFileMakeStdIn':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:984:8: warning: 'readable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( ! readable )
+        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c: In function 'KFileMakeStdOut':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:1002:8: warning: 'writable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( ! writable )
+        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c: In function 'KFileMakeStdErr':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:1016:8: warning: 'writable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( ! writable )
+        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c: In function 'KFileMakeFDFileRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:1034:8: warning: 'readable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( ! readable )
+        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c: In function 'KFileMakeFDFileWrite':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:1051:17: warning: 'readable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( update && ! readable )
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix/sysfile.c:1053:8: warning: 'writable' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     if ( ! writable )
+        ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/gzip.c: In function 'KGZipFile_OutDestroy':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/gzip.c:483:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
+         int ret;
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/gzip.c: In function 'KGZipFile_OutWrite':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/gzip.c:512:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
+     int ret;
+         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/bzip.c: In function 'KBZipFileWriteInt':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/bzip.c:113:13: warning: variable 'zret' set but not used [-Wunused-but-set-variable]
+         int zret;
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/bzip.c:96:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
+     int ret;
+         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/bzip.c: In function 'KBZipFileReadInt':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/bzip.c:211:12: warning: variable 'bleft' set but not used [-Wunused-but-set-variable]
+     size_t bleft = bsize;
+            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/arc.c: In function 'KArcDirResolvePath':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/arc.c:2377:12: warning: 'full' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     char * full;
+            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/toc.c: In function 'KTocResolvePathTocEntry':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/toc.c:1388:13: warning: variable 'loopcount' set but not used [-Wunused-but-set-variable]
+     int     loopcount; /* counter for loop limiting hardlink resolution */
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/tocfile.c: In function 'KTocFileRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/tocfile.c:416:47: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                             ((GetRCObject(rc) == rcFileDesc) &&
+                                               ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/buffile-write.c:62:9: warning: 'KBufWriteFileDestroy' defined but not used [-Wunused-function]
+ rc_t CC KBufWriteFileDestroy ( KBufWriteFile *self )
+         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/pagefile.c: In function 'KPageFile_whack_recursive':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/pagefile.c:647:9: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+    rc_t rc;
+         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/lockfile.c: In function 'KLockFileWhack':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/lockfile.c:134:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkfs.a mmap.pic.o directory.pic.o arrayfile.pic.o file.pic.o sysdir.pic.o sysfile.pic.o sysmmap.pic.o syslockfile.pic.o sysdll.pic.o gzip.pic.o bzip.pic.o md5.pic.o crc32.pic.o arc.pic.o toc.pic.o tocentry.pic.o tocdir.pic.o tocfile.pic.o sra.pic.o tar.pic.o teefile.pic.o buffile.pic.o buffile-read.pic.o buffile-write.pic.o subfile.pic.o nullfile.pic.o countfile.pic.o dir_test.pic.o pagefile.pic.o pmem.pic [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kfs'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfs'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kns'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/http.c:74:6: warning: 'KDataBufferContainsString' defined but not used [-Wunused-function]
+ bool KDataBufferContainsString ( const KDataBuffer *buf, const String *str )
+      ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkns.a kns_manager.pic.o stream.pic.o stream-from-files.pic.o stream-from-streams.pic.o endpoint.pic.o sysendpoint.pic.o syssock.pic.o sysstream.pic.o sysmgr.pic.o http.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/KCurlFile.c: In function 'KCurlFileMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/KCurlFile.c:464:29: warning: 'file_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
+             self->file_size = *size;
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/KCurlFile.c:684:34: note: 'file_size' was declared here
+                         uint64_t file_size;
+                                  ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkurl.a KCurlFile.pic.o KCurlRequest.pic.o url-fetcher.pic.o url-fetcher-curl.pic.o entrez-fetcher.pic.o ld-tmp/kns-kns_manager.pic.o ld-tmp/kns-stream.pic.o ld-tmp/kns-stream-from-files.pic.o ld-tmp/kns-stream-from-streams.pic.o ld-tmp/kns-endpoint.pic.o ld-tmp/kns-sysendpoint.pic.o ld-tmp/kns-syssock.pic.o ld-tmp/kns-sysstream.pic.o ld-tmp/kns-sysmgr.pic.o ld-tmp/kns-http.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kns'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kns'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kxml'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkxml.a xml.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/xtoc.c: In function 'XTocTreeAddSymlink':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/xtoc.c:532:13: warning: 'entry' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     *pentry = entry;
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/xtoc.c: In function 'XTocTreeAddFile':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/xtoc.c:578:13: warning: 'entry' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     *pentry = entry;
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkxfs.a xtoc.pic.o xtoc-parsexml.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kxml'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kxml'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kfg'
+rm -f /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/ncbi/config.kfg
+cp /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/default.kfg /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/ncbi/default.kfg
+mkdir -p /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/test-bin/ncbi
+cp /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/default.kfg /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/test-bin/ncbi/default.kfg
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config-lex.c:1565:17: warning: 'yyunput' defined but not used [-Wunused-function]
+     static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config-lex.c:1611:16: warning: 'input' defined but not used [-Wunused-function]
+     static int input  (yyscan_t yyscanner)
+                ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config-lex.c:2081:16: warning: 'yy_top_state' defined but not used [-Wunused-function]
+     static int yy_top_state  (yyscan_t yyscanner)
+                ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c: In function 'PrintBuffPrint':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c:1467:34: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     else if ( GetRCObject ( rc ) == rcBuffer && GetRCState ( rc ) == rcInsufficient )
+                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c: In function 'load_from_env_variable':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c:1873:18: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+             rc_t rc = 0;
+                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c: In function 'load_from_std_location':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/config.c:1897:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc = 0;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkfg.a config-grammar.pic.o config-lex.pic.o config.pic.o kart.pic.o repository.pic.o report-kfg.pic.o keystore.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kfg'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kfg'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/krypto'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/ciphermgr.c: In function 'KCipherManagerDestroy':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/ciphermgr.c:125:30: warning: variable 'reread' set but not used [-Wunused-but-set-variable]
+             KCipherManager * reread;
+                              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/encfile.c: In function 'KEncFileV1BufferRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/encfile.c:237:15: warning: variable 'bbuffer' set but not used [-Wunused-but-set-variable]
+     uint8_t * bbuffer; /* void pointer made to a byyte pointer */
+               ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/encfile.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/encfile.c:1509:9: warning: 'KEncFileV1Update' defined but not used [-Wunused-function]
+ rc_t CC KEncFileV1Update (KEncFileV1 *self, uint64_t pos,
+         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/encfilev2.c:473:6: warning: 'KEncFileFooterRead' defined but not used [-Wunused-function]
+ rc_t KEncFileFooterRead (KEncFile * self, const uint64_t pos,
+      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/reencfile.c: In function 'KReencFileReadHandleFooter':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/reencfile.c:561:12: warning: variable 'offset' set but not used [-Wunused-but-set-variable]
+     size_t offset;
+            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkrypto.a ciphermgr.pic.o wgaencrypt.pic.o encfile.pic.o encfilev2.pic.o cipher.pic.o aes_core.pic.o aes-byte.pic.o cipher-byte.pic.o key.pic.o reencfile.pic.o cipher-vec.vec.pic.o aes-ncbi.vec.pic.o cipher-vec.vecreg.pic.o aes-ncbi.vecreg.pic.o cipher-vec.aes-ni.pic.o aes-ncbi.aes-ni.pic.o no-null-ncbi.pic.o no-null-ncbi.vec.pic.o no-null-ncbi.vecreg.pic.o no-null-ncbi.aes-ni.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/null-ncbi.c:214:5: warning: initialization from incompatible pointer type [enabled by default]
+     NULLBCMEMBER(Encrypt),
+     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/null-ncbi.c:214:5: warning: (near initialization for 'KNullBlockCipherByte_vt_.encrypt') [enabled by default]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/null-ncbi.c:216:1: warning: initialization from incompatible pointer type [enabled by default]
+ };
+ ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/null-ncbi.c:216:1: warning: (near initialization for 'KNullBlockCipherByte_vt_.decrypt') [enabled by default]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkryptotest.a ciphermgr.pic.o wgaencrypt.pic.o encfile.pic.o encfilev2.pic.o cipher.pic.o aes_core.pic.o aes-byte.pic.o cipher-byte.pic.o key.pic.o reencfile.pic.o cipher-vec.vec.pic.o aes-ncbi.vec.pic.o cipher-vec.vecreg.pic.o aes-ncbi.vecreg.pic.o cipher-vec.aes-ni.pic.o aes-ncbi.aes-ni.pic.o null-ncbi.pic.o testcipher.pic.o null-ncbi.vec.pic.o null-ncbi.vecreg.pic.o no-null-ncbi.aes-ni.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/krypto'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/krypto'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vfs'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c: In function 'VPathParse':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c:1301:33: warning: 'oid_anchor' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 VPathCaptureOid ( self, oid, uri, anchor, oid_anchor, i );
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c:400:26: warning: 'oid' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         self -> obj_id = ( uint32_t ) oid;
+                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c:536:14: note: 'oid' was declared here
+     uint64_t oid;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c:1621:33: warning: 'ip' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                     ipv6 [ ip ] = toupper ( ch ) - 'A' + 10;
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/path.c:1702:29: warning: 'port' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 port = port * 10 + ch - '0';
+                             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/manager.c: In function 'VFSManagerUpdateKryptoPassword':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/manager.c:2314:24: warning: variable 'new_password_file_size' set but not used [-Wunused-but-set-variable]
+                 size_t new_password_file_size;
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/manager.c: In function 'VFSManagerOpenFileReadInt':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/manager.c:988:12: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         if (rc == 0)
+            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix/syskeyring.c: In function 'StartKeyRing':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs/unix/syskeyring.c:117:26: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+                     rc_t rc;
+                          ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libvfs.a path.pic.o syspath.pic.o manager.pic.o resolver.pic.o keyring.pic.o syskeyring.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vfs'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vfs'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kapp'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/args.c: In function 'OptionGetValue':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/args.c:254:14: warning: variable 'count' set but not used [-Wunused-but-set-variable]
+     uint32_t count;
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkapp.a main.o args.o tokenizer.o sysmain.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c: In function 'KQueueFileRunRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c:354:40: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             } else if( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted ) {
+                                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c: In function 'KQueueFileRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c:427:68: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             if ( GetRCState ( rc ) == rcDone && GetRCObject ( rc ) == rcData )
+                                                                    ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c:431:40: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             } else if( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted ) {
+                                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c: In function 'KQueueFileRunWrite':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c:500:68: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             if ( GetRCState ( rc ) == rcDone && GetRCObject ( rc ) == rcData )
+                                                                    ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp/queue-file.c:504:39: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             else if ( GetRCObject(rc) == rcTimeout && GetRCState(rc) == rcExhausted )
+                                       ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libload.a progressbar.pic.o loader-file.pic.o loader-meta.pic.o log-xml.pic.o queue-file.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kapp'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kapp'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kdb'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c: In function 'leaf_entry':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c:2021:22: warning: unused variable 'key_prefix_len' [-Wunused-variable]
+         const size_t key_prefix_len=cnode->key_prefix_len;
+                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c: In function 'branch_insert':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c:2181:14: warning: unused variable 'page' [-Wunused-variable]
+     uint8_t *page = (uint8_t*) node;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c: In function 'branch_entry':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c:2588:22: warning: unused variable 'key_prefix_len' [-Wunused-variable]
+         const size_t key_prefix_len=cnode->key_prefix_len;
+                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c: In function 'KBTreeMakeUpdate':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/btree.c:1172:28: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                         if ( rc == 0 && bt -> hdr . type [ 0 ] != type )
+                            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libkdb.a btree.pic.o dbmgr-cmn.pic.o kdb.pic.o dbmgr.pic.o dbcc-cmn.pic.o database.pic.o database-cc.pic.o table.pic.o table-cc.pic.o column.pic.o column-cc.pic.o coldata.pic.o colidx.pic.o colidx0.pic.o colidx1.pic.o colidx2.pic.o idxblk.pic.o meta.pic.o index.pic.o idstats.pic.o trieidx-v1.pic.o trieval-v1.pic.o ptrieval-v1.pic.o trieidx-v2.pic.o trieval-v2.pic.o ptrieval-v2.pic.o u64idx-v3.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/wcolumn.c: In function 'KDBManagerVCreateColumnInt':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/wcolumn.c:665:28: warning: 'col' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                     * colp = col;
+                            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/wtrieidx-v2.c: In function 'KTrieIndexDelete_v2':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/wtrieidx-v2.c:2366:14: warning: variable 'count' set but not used [-Wunused-but-set-variable]
+     uint32_t count;
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwkdb.a btree.pic.o dbmgr-cmn.pic.o wkdb.pic.o wdbmgr.pic.o wdatabase.pic.o wtable.pic.o wcolumn.pic.o wcoldata.pic.o wcolidx.pic.o wcolidx0.pic.o wcolidx1.pic.o wcolidx2.pic.o idxblk.pic.o widxblk.pic.o wmeta.pic.o windex.pic.o wtrieidx-v1.pic.o wtrieidx-v2.pic.o wu64idx-v3.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/kdb'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/kdb'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vdb'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/schema-eval.c: In function 'VSchemaCacheIntrinsicTypeId':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/schema-eval.c:72:18: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
+         uint32_t prev;
+                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/schema-eval.c: In function 'eval_const_expr':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/schema-eval.c:1234:77: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if ( rc != 0 && GetRCState ( rc ) == rcUnexpected && GetRCObject ( rc ) == rcType )
+                                                                             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/database-depend.c: In function 'DependenciesError':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/database-depend.c:1590:58: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     return GetRCModule(rc) == rcAlign && GetRCObject(rc) == rcTable
+                                                          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/cursor-cmn.c: In function 'VCursorParamsLookupOrCreate':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/cursor-cmn.c:2174:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/prod-cmn.c: In function 'VFunctionProdCallBlobFuncEncoding':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/prod-cmn.c:1015:30: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     else if (GetRCObject(rc) == rcBuffer && GetRCState(rc) == rcInsufficient) {
+                              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/page-map.c: In function 'PageMapNewIterator':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/page-map.c:545:16: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
+  lhs->exp_base = &self->data_offset;
+                ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/page-map.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/page-map.c:431:13: warning: 'PageMapGetData_HW' defined but not used [-Wunused-function]
+ static rc_t PageMapGetData_HW(const PageMap *cself,uint64_t row,uint32_t * data_offset,uint32_t * data_length,uint32_t * repeat_count)
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/page-map.c:464:12: warning: 'DEBUG_PageMapPrintSum' defined but not used [-Wunused-function]
+ static int DEBUG_PageMapPrintSum(const PageMap *pm, uint32_t row)
+            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/index_project.c: In function 'index_project_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/index_project.c:93:65: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if (GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcBuffer && key == key_buf) {
+                                                                 ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/delta_average.c: In function 'delta_average':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/delta_average.c:214:14: warning: variable 'min_rl_bytes' set but not used [-Wunused-but-set-variable]
+     uint64_t min_rl_bytes,max_rl_bytes;
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libvdb.a dbmgr-cmn.pic.o schema-tok.pic.o schema-parse.pic.o schema-type.pic.o schema-func.pic.o schema-prod.pic.o schema-expr.pic.o schema-eval.pic.o schema-tbl.pic.o schema-db.pic.o schema-dump.pic.o schema-int.pic.o schema.pic.o linker-int.pic.o linker-cmn.pic.o database-cmn.pic.o database-depend.pic.o database-load.pic.o table-cmn.pic.o table-load.pic.o cursor-cmn.pic.o column-cmn.pic.o prod-cmn.pic.o pr [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/wphys.c: In function 'VPhysicalCreateKColumn':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/wphys.c:553:43: warning: variable 'td' set but not used [-Wunused-but-set-variable]
+                                 VTypedecl td = smbr -> td;
+                                           ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/meta-attr-write.c: In function 'meta_attr_write_fact':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/meta-attr-write.c:434:10: warning: variable 'variable' set but not used [-Wunused-but-set-variable]
+     bool variable = false;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwvdb.a dbmgr-cmn.pic.o schema-tok.pic.o schema-parse.pic.o schema-type.pic.o schema-func.pic.o schema-prod.pic.o schema-expr.pic.o schema-eval.pic.o schema-tbl.pic.o schema-db.pic.o schema-dump.pic.o schema-int.pic.o schema.pic.o linker-int.pic.o linker-cmn.pic.o database-cmn.pic.o database-depend.pic.o database-load.pic.o table-cmn.pic.o table-load.pic.o cursor-cmn.pic.o column-cmn.pic.o prod-cmn.pic.o p [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vdb'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vdb'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vxf'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unzip.c: In function 'legacy_unzip_func':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unzip.c:183:71: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     while ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer );
+                                                                       ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:624:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_i8':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:632:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_i16':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:640:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_i32':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:648:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_i64':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:661:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_u8':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:669:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_u16':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:677:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_u32':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:685:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h: In function 'encode_u64':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip-encode.impl.h:213:9: warning: variable 'debugging' set but not used [-Wunused-but-set-variable]
+     int debugging = 0;
+         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/izip.c:733:9: warning: 'izip' defined but not used [-Wunused-function]
+ rc_t CC izip(
+         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/outlier-encoder.c: In function 'vdb_outlier_encode_fact':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/outlier-encoder.c:97:10: warning: unused variable 'rc' [-Wunused-variable]
+     rc_t rc;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/outlier-decoder.c: In function 'vdb_outlier_decode_fact':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/outlier-decoder.c:69:10: warning: unused variable 'rc' [-Wunused-variable]
+     rc_t rc;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c: In function 'sprintf_func':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:397:72: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if ( GetRCState ( rc ) == rcInsufficient && GetRCObject ( rc ) == rcBuffer )
+                                                                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c: In function 'parse_format_string':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:592:40: warning: variable 'has_index' set but not used [-Wunused-but-set-variable]
+         bool has_width, has_precision, has_index;
+                                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:592:14: warning: variable 'has_width' set but not used [-Wunused-but-set-variable]
+         bool has_width, has_precision, has_index;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c: In function 'sprintf_func':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:343:35: warning: 'ext_stop_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 select_len = args [ ext_stop_index ] . u = row_len - 1;
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:339:34: warning: 'ext_start_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 start_idx = args [ ext_start_index ] . u = row_len - 1;
+                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c: In function 'vdb_sprintf_fact':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/sprintf.c:1272:22: warning: 'obj' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         rslt -> self = obj;
+                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libvxf.a ceil.pic.o clip.pic.o cut.pic.o echo.pic.o exists.pic.o floor.pic.o paste.pic.o round.pic.o trunc.pic.o unzip.pic.o map.pic.o funzip.pic.o vec-sum.pic.o min.pic.o max.pic.o rldecode.pic.o pack.pic.o unpack.pic.o izip.pic.o iunzip.pic.o diff.pic.o sum.pic.o bit_or.pic.o trim.pic.o deriv.pic.o integral.pic.o integral_0.pic.o delta.pic.o undelta.pic.o add-row-id.pic.o subtract-row-id.pic.o irzip.pic.o  [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwvxf.a ceil.pic.o clip.pic.o cut.pic.o echo.pic.o exists.pic.o floor.pic.o paste.pic.o round.pic.o trunc.pic.o unzip.pic.o map.pic.o funzip.pic.o vec-sum.pic.o min.pic.o max.pic.o rldecode.pic.o pack.pic.o unpack.pic.o izip.pic.o iunzip.pic.o diff.pic.o sum.pic.o bit_or.pic.o trim.pic.o deriv.pic.o integral.pic.o integral_0.pic.o delta.pic.o undelta.pic.o add-row-id.pic.o subtract-row-id.pic.o irzip.pic.o [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/vxf'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/vxf'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/search'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/search.c: In function 'IUPAC_init':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/search.c:42:28: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
+         memset(t, 0, sizeof(t));
+                            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/fgrep-dumb.c: In function 'FgrepDumbSearchMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/fgrep-dumb.c:171:13: warning: variable 'len' set but not used [-Wunused-but-set-variable]
+     int32_t len;
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/agrep-myers.c: In function 'MyersFindAll':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/agrep-myers.c:354:13: warning: variable 'BestScore' set but not used [-Wunused-but-set-variable]
+     int32_t BestScore;
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/agrep-dp.c: In function 'dp_find_begin':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/agrep-dp.c:616:13: warning: variable 'bestscore' set but not used [-Wunused-but-set-variable]
+     int32_t bestscore = 10000;
+             ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libksrch.a search.pic.o fgrep-dumb.pic.o fgrep-boyermoore.pic.o fgrep-aho.pic.o agrep-wumanber.pic.o agrep-myers.pic.o agrep-myersunltd.pic.o agrep-dp.pic.o nucstrstr-icc-x86_64-rel.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/search'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/search'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/sraxf'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/v0-funcs.c: In function 'sra_read_decompress_slx':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/v0-funcs.c:108:14: warning: unused variable 'row_len' [-Wunused-variable]
+     uint32_t row_len = HTONS ( * ( const uint16_t* ) & p [ 5 ] );
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libsraxf.a untyped.pic.o v0-decompress-init.pic.o v0-decompress.pic.o v0-funcs.pic.o bio-start.pic.o dynamic-454-read-descriptor.pic.o format-spot-name.pic.o extract-name_coord.pic.o tokenize-spot_name-454.pic.o tokenize-spot_name-illumina.pic.o tokenize-spot_name-abi.pic.o tokenize-spot_name-helicos.pic.o tokenize-spot_name-ion-torrent.pic.o color-from-dna.pic.o dna-from-color.pic.o spot-desc.pic.o read-des [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwsraxf.a untyped.pic.o v0-decompress-init.pic.o v0-decompress.pic.o v0-funcs.pic.o bio-start.pic.o dynamic-454-read-descriptor.pic.o format-spot-name.pic.o extract-name_coord.pic.o tokenize-spot_name-454.pic.o tokenize-spot_name-illumina.pic.o tokenize-spot_name-abi.pic.o tokenize-spot_name-helicos.pic.o tokenize-spot_name-ion-torrent.pic.o color-from-dna.pic.o dna-from-color.pic.o spot-desc.pic.o read-de [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/sraxf'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sraxf'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/align'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BGZFileRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:199:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient) {
+                                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BGZFileWalkBlocksND':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:379:61: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if (GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcData)
+                                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:292:9: warning: variable 'zr' set but not used [-Wunused-but-set-variable]
+     int zr;
+         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BGZFileWalkBlocksUnzip':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:398:63: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if (GetRCState(rc2) == rcInsufficient && GetRCObject(rc2) == rcData)
+                                                               ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BGZThreadFileMain':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:563:33: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient)
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BAMFileRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1935:29: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInsufficient) {
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'fix_I':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:2885:9: warning: variable 'last_b' set but not used [-Wunused-but-set-variable]
+     int last_b = 0;
+         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'BAMValidate2':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:4085:74: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             else if (GetRCState(rc2) != rcIncomplete || GetRCObject(rc2) != rcData) {
+                                                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:71:18: warning: 'LE2HI64' defined but not used [-Wunused-function]
+ static  int64_t  LE2HI64(void const *X) {  int64_t y; memcpy(&y, X, sizeof(y)); return y; }
+                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:2882:17: warning: 'fix_I' defined but not used [-Wunused-function]
+ static unsigned fix_I(uint32_t cigar[], unsigned n)
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:2914:17: warning: 'fix_IN' defined but not used [-Wunused-function]
+ static unsigned fix_IN(uint32_t cigar[], unsigned n)
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:2977:13: warning: 'reverse' defined but not used [-Wunused-function]
+ static void reverse(uint32_t cigar[], unsigned n)
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c: In function 'ParseHeader':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1202:50: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 while (value < i && isspace(hdata[value]))
+                                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1158:14: note: 'value' was declared here
+     unsigned value;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1059:50: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 while (value < i && isspace(hdata[value]))
+                                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1012:14: note: 'value' was declared here
+     unsigned value;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:986:37: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                     self->version = &hdata[value];
+                                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:953:14: note: 'value' was declared here
+     unsigned value;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/bam.c:1317:24: warning: 'tag' may be used uninitialized in this function [-Wmaybe-uninitialized]
+             else if (i - tag > 2)
+                        ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libncbi-bam.a bam.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-refseq.c: In function 'TableWriterRefSeq_Make':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-refseq.c:91:13: warning: passing argument 5 of 'TableWriterRefSeq_Whack' makes integer from pointer without a cast [enabled by default]
+             TableWriterRefSeq_Whack(self, false, NULL, 0, NULL, NULL, NULL, 0);
+             ^
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-refseq.c:32:0:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/align/writer-refseq.h:72:22: note: expected 'ver_t' but argument is of type 'void *'
+ ALIGN_EXTERN rc_t CC TableWriterRefSeq_Whack(const TableWriterRefSeq* cself, bool commit, uint64_t* rows,
+                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c: In function 'ReferenceSeq_Dump':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:770:24: warning: unused variable 'types' [-Wunused-variable]
+     static char const *types[] = {
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c: In function 'ReferenceMgr_OpenSeq':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:1009:65: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcPath)
+                                                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c: In function 'ReferenceMgr_ReCover':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:1624:30: warning: variable 'num_elem_copied' set but not used [-Wunused-but-set-variable]
+                     uint64_t num_elem_copied = 0;
+                              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c: In function 'cigar2offset':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:2037:13: warning: 'ch' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         int ch;
+             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c: In function 'ReferenceMgr_Make':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:490:30: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         if (strcmp(&Data[data[i-1].id], &Data[data[i].id]) == 0)
+                              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/writer-reference.c:419:8: note: 'data' was declared here
+     } *data, tmp;
+        ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libalign-writer.a dna-reverse-cmpl.pic.o reader-cmn.pic.o reference-cmn.pic.o reader-refseq.pic.o refseq-mgr.pic.o writer-cmn.pic.o writer-refseq.pic.o writer-alignment.pic.o writer-sequence.pic.o writer-ref.pic.o writer-reference.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libalign-access.a align-access.pic.o ld-tmp/ncbi-bam-bam.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/reference.c: In function 'ReferenceList_MakeCursor':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/reference.c:306:22: warning: unused variable 'rctmp' [-Wunused-variable]
+                 rc_t rctmp = TableReader_OpenIndex( tmp, "i_name", &iname );
+                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/reference.c: In function 'ReferenceObj_External':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/reference.c:967:40: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if ( GetRCObject( rc ) == rcTable && GetRCState( rc ) == rcNotFound )
+                                        ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libalign-reader.a align_mgr.pic.o al_iterator.pic.o ref_iterator.pic.o pl_iterator.pic.o dna-reverse-cmpl.pic.o reference-cmn.pic.o reader-cmn.pic.o reader-refseq.pic.o reference.pic.o refseq-mgr.pic.o quality-quantizer.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/align'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/align'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/axf'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c: In function 'RefTableSubSelect_Make':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:319:17: note: in expansion of macro 'IS_ADDED'
+             if (IS_ADDED(obj->curs, &obj->u.ref.circular_idx, "CIRCULAR") ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:321:24: note: in expansion of macro 'IS_ADDED'
+                 if (   IS_ADDED(obj->curs, &obj->u.ref.name_idx, "(utf8)NAME")
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:322:24: note: in expansion of macro 'IS_ADDED'
+                     && IS_ADDED(obj->curs, &obj->u.ref.name_range_idx, "NAME_RANGE")
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:323:24: note: in expansion of macro 'IS_ADDED'
+                     && IS_ADDED(obj->curs, &obj->u.ref.seq_len_idx, "SEQ_LEN")
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:324:24: note: in expansion of macro 'IS_ADDED'
+                     && IS_ADDED(obj->curs, &obj->u.ref.max_seq_len_idx, "MAX_SEQ_LEN")
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:325:24: note: in expansion of macro 'IS_ADDED'
+                     && IS_ADDED(obj->curs, &obj->u.ref.cmp_read_idx, "CMP_READ")
+                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:332:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             else if (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:335:21: note: in expansion of macro 'IS_ADDED'
+                     IS_ADDED(obj->curs, &obj->u.mod.ref_id_idx, "REF_ID") &&
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:336:21: note: in expansion of macro 'IS_ADDED'
+                     IS_ADDED(obj->curs, &obj->u.mod.ref_start_idx, "REF_START") &&
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:337:21: note: in expansion of macro 'IS_ADDED'
+                     IS_ADDED(obj->curs, &obj->u.mod.ref_len_idx, "REF_LEN") &&
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:338:21: note: in expansion of macro 'IS_ADDED'
+                     IS_ADDED(obj->curs, &obj->u.mod.read_start_idx, "READ_START") &&
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:339:21: note: in expansion of macro 'IS_ADDED'
+                     IS_ADDED(obj->curs, &obj->u.mod.read_len_idx, "READ_LEN") )
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:302:45: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                            (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcExists))
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-tbl-sub-select.c:345:28: note: in expansion of macro 'IS_ADDED'
+             if (rc == 0 && IS_ADDED(obj->curs, &obj->out_idx,  out_col_name) ) {
+                            ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-restore-read.c: In function 'RestoreReadWhack':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/ref-restore-read.c:58:14: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+         rc_t rc;
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/raw-restore-read.c: In function 'raw_restore_read_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/raw-restore-read.c:75:20: warning: unused variable 'strand_len' [-Wunused-variable]
+     const uint32_t strand_len  = argv[1].u.data.elem_count;
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/raw-restore-qual.c: In function 'raw_restore_read_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/raw-restore-qual.c:53:20: warning: unused variable 'strand_len' [-Wunused-variable]
+     const uint32_t strand_len  = argv[1].u.data.elem_count;
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c: In function 'generate_has_mismatch_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c:680:14: warning: unused variable 'hro_len' [-Wunused-variable]
+     uint32_t hro_len = argv[2].u.data.elem_count;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c: In function 'generate_mismatch_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c:750:14: warning: unused variable 'hro_len' [-Wunused-variable]
+     uint32_t hro_len = argv[2].u.data.elem_count;
+              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c: In function 'right_soft_clip_4_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/cigar.c:1130:20: warning: unused variable 'n_offsets' [-Wunused-variable]
+     const uint64_t n_offsets = argv[1].u.data.elem_count;
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-pos.c: In function 'RefPosMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-pos.c:133:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-name.c: In function 'RefNameMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-name.c:80:23: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+   if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                       ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-seq-id.c: In function 'RefSeqIDMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-ref-seq-id.c:80:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-local_ref_id.c: In function 'LocalRefIDMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-local_ref_id.c:84:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-local_ref_start.c: In function 'LocalRefStartMake':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/align-local_ref_start.c:85:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
+                                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/mismatch-restore-qual.c: In function 'mismatch_restore_qual_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/mismatch-restore-qual.c:51:20: warning: unused variable 'nqual' [-Wunused-variable]
+     unsigned const nqual = argv[0].u.data.elem_count;
+                    ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/mismatch-restore-qual.c: In function 'decompress_quality_impl':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/mismatch-restore-qual.c:94:20: warning: unused variable 'nqual' [-Wunused-variable]
+     unsigned const nqual = argv[0].u.data.elem_count;
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/get_mate_align_ids.c:108:6: warning: 'get_mate_algn_id_impl' defined but not used [-Wunused-function]
+ rc_t get_mate_algn_id_impl(ID_cache_t *const self,
+      ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libaxf.a ref-tbl-sub-select.pic.o ref-restore-read.pic.o align-restore-read.pic.o raw-restore-read.pic.o raw-restore-qual.pic.o seq-restore-read.pic.o seq-construct-read.pic.o cigar.pic.o project_read_from_sequence.pic.o not-my-row.pic.o template-len.pic.o get-sam-flags.pic.o align-ref-pos.pic.o align-ref-name.pic.o align-ref-seq-id.pic.o align-local_ref_id.pic.o align-local_ref_start.pic.o generate-mismatch [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwaxf.a ref-tbl-sub-select.pic.o ref-restore-read.pic.o align-restore-read.pic.o raw-restore-read.pic.o raw-restore-qual.pic.o seq-restore-read.pic.o seq-construct-read.pic.o cigar.pic.o project_read_from_sequence.pic.o not-my-row.pic.o template-len.pic.o get-sam-flags.pic.o align-ref-pos.pic.o align-ref-name.pic.o align-ref-seq-id.pic.o align-local_ref_id.pic.o align-local_ref_start.pic.o generate-mismatc [...]
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/axf'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/axf'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/wgsxf'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/build_scaffold.c: In function 'init_self':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/build_scaffold.c:160:48: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                         if ( GetRCObject( rc ) == rcColumn && GetRCState( rc ) == rcUndefined )
+                                                ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwgsxf.a build_scaffold.pic.o build_read_type.pic.o
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwwgsxf.a build_scaffold.pic.o build_read_type.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/wgsxf'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/wgsxf'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ktst'
+g++ -c  -DNDEBUG     -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux  [...]
+g++ -c  -DNDEBUG     -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux  [...]
+g++ -c  -DNDEBUG     -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux  [...]
+g++ -c  -DNDEBUG     -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux  [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libktst.a runprocesstestcase.pic.o testenv.pic.o testcase.pic.o testrunner.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ktst'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ktst'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/loader'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/common-writer.c: In function 'ArchiveFile':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/common-writer.c:1495:42: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInvalid) {
+                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/common-writer.c:1499:42: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if (GetRCObject(rc) == rcData) {
+                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/common-writer.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/common-writer.c:173:20: warning: 'Print_ctx_value_t' defined but not used [-Wunused-function]
+ static char const *Print_ctx_value_t(ctx_value_t const *const self)
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/sequence-writer.c: In function 'SequenceWhack':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/sequence-writer.c:224:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libloader.a mmarray.pic.o common-reader.pic.o common-writer.pic.o sequence-writer.pic.o reference-writer.pic.o alignment-writer.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/loader'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/loader'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ascp'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/ascp.c: In function 'ascpParse':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/ascp.c:257:10: warning: variable 'failure' set but not used [-Wunused-but-set-variable]
+     bool failure = false;
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libascp.a ascp.pic.o ascp-path.pic.o connect.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ascp'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ascp'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/sra'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sra-dflt-schema.c: In function 'Usage':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sra-dflt-schema.c:132:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc;
+          ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/sra-dflt-schema -Wl,-z,relro sra-dflt-schema.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvdb -laxf -lsraxf -lwgsxf -lvxf -lalign-reader -lkdb -lvfs -lkurl -lksrch -lkrypto -lkfg -lkfs -lksproc -lklib -Wl,-Bdynamic -ldl -lz -lbz2 -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/sra-dflt-schema -osra-schema.c -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -T/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/sra/sra-schema.c.d /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/built-in.vschema
+cp sra-schema.c /tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libsraschema.a sraschema-stub.pic.o sraschema.pic.o sra-schema.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwsraschema.a wsraschema-stub.pic.o sraschema.pic.o sra-schema.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sratbl-cmn.c: In function 'VCursor_ReadPseudoMeta':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sratbl-cmn.c:220:29: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if (GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound) {
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sratbl-cmn.c: In function 'SRAMgrVOpenAltTableRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/sratbl-cmn.c:523:56: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                     if ( rc != 0 && GetRCObject ( rc ) == rcTable && GetRCState ( rc ) == rcIncorrect )
+                                                        ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libsradb.a sramgr-cmn.pic.o sratbl-cmn.pic.o sracol.pic.o types.pic.o sracache.pic.o sramgr.pic.o sratbl.pic.o ld-tmp/sraschema-sraschema-stub.pic.o ld-tmp/sraschema-sraschema.pic.o ld-tmp/sraschema-sra-schema.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libwsradb.a sramgr-cmn.pic.o sratbl-cmn.pic.o sracol.pic.o types.pic.o sracache.pic.o wsramgr.pic.o wsratbl.pic.o ld-tmp/wsraschema-wsraschema-stub.pic.o ld-tmp/wsraschema-sraschema.pic.o ld-tmp/wsraschema-sra-schema.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/reader-sff.c: In function 'SFFReaderInit':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/reader-sff.c:83:57: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcColumn ) {
+                                                         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/reader-illumina.c:203:5: warning: 'kludge_snprintf' defined but not used [-Wunused-function]
+ int kludge_snprintf ( char *buff, size_t bsize, const char *fmt, ... )
+     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux -I [...]
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libsrareader.a reader-cmn.pic.o reader-fastq.pic.o reader-sff.pic.o reader-illumina.pic.o reader-abi.pic.o
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/sra'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/sra'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ncbi-vdb'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ncbi-vdb'
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/libncbi-vdb.a.2.3.3 ld-tmp/align-access-align-access.pic.o ld-tmp/align-access-ncbi-bam-bam.pic.o ld-tmp/kfg-config-grammar.pic.o ld-tmp/kfg-config-lex.pic.o ld-tmp/kfg-config.pic.o ld-tmp/kfg-kart.pic.o ld-tmp/kfg-repository.pic.o ld-tmp/kfg-report-kfg.pic.o ld-tmp/kfg-keystore.pic.o ld-tmp/kfs-mmap.pic.o ld-tmp/kfs-directory.pic.o ld-tmp/kfs-arrayfile.pic.o ld-tmp/kfs-file.pic.o ld-tmp/kfs-sysdir.pic.o ld-t [...]
+ln -s libncbi-vdb.a.2 libncbi-vdb.a
+ln -s libncbi-vdb.a libncbi-vdb-static.a
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -shared -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/libncbi-vdb.so.2.3.3 -Wl,-soname,libncbi-vdb.so.2    -Wl,-z,relro  -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -Wl,-whole-archive -lalign-access -lkfg -lkfs -lklib -lkproc -lkq -lkrypto -lksrch -lkxml -lkxfs -lkurl -lvfs -lalign-reader -lascp -laxf -lsraxf -lwgsxf -lvxf -lkdb -lsradb [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s libncbi-vdb.so.2.3.3 libncbi-vdb.so.2
+ln -s libncbi-vdb.so.2 libncbi-vdb.so
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/libncbi-wvdb.a.2.3.3 ld-tmp/align-access-align-access.pic.o ld-tmp/align-access-ncbi-bam-bam.pic.o ld-tmp/kfg-config-grammar.pic.o ld-tmp/kfg-config-lex.pic.o ld-tmp/kfg-config.pic.o ld-tmp/kfg-kart.pic.o ld-tmp/kfg-repository.pic.o ld-tmp/kfg-report-kfg.pic.o ld-tmp/kfg-keystore.pic.o ld-tmp/kfs-mmap.pic.o ld-tmp/kfs-directory.pic.o ld-tmp/kfs-arrayfile.pic.o ld-tmp/kfs-file.pic.o ld-tmp/kfs-sysdir.pic.o ld- [...]
+ln -s libncbi-wvdb.a.2 libncbi-wvdb.a
+ln -s libncbi-wvdb.a libncbi-wvdb-static.a
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -shared -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/libncbi-wvdb.so.2.3.3 -Wl,-soname,libncbi-wvdb.so.2    -Wl,-z,relro  -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -Wl,-whole-archive -lalign-access -lkfg -lkfs -lklib -lkproc -lkq -lkrypto -lksrch -lkxml -lkxfs -lkurl -lvfs -lalign-writer -lwaxf -lwkdb -lwsradb -lwsraxf -lwvdb -lwvxf  [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s libncbi-wvdb.so.2.3.3 libncbi-wvdb.so.2
+ln -s libncbi-wvdb.so.2 libncbi-wvdb.so
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/libs/ncbi-vdb'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs/ncbi-vdb'
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/libs'
+make[3]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/util'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/util'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/util'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/rcexplain.2.3.3 -Wl,-z,relro rcexplain.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lksproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s rcexplain.2.3.3 rcexplain.2
+ln -s rcexplain.2 rcexplain
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/kdbmeta.c: In function 'value_select':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/kdbmeta.c:255:17: warning: variable 'tab_stop' set but not used [-Wunused-but-set-variable]
+             int tab_stop;
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/kdbmeta.c: In function 'KMain':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/kdbmeta.c:1165:2: warning: #warning fix kdbmanagerVPathType to understand accessions [-Wcpp]
+ #warning fix kdbmanagerVPathType to understand accessions
+  ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/kdbmeta.2.3.3 -Wl,-z,relro kdbmeta.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s kdbmeta.2.3.3 kdbmeta.2
+ln -s kdbmeta.2 kdbmeta
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-lock.2.3.3 -Wl,-z,relro vdb-lock.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-lock.2.3.3 vdb-lock.2
+ln -s vdb-lock.2 vdb-lock
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-unlock.2.3.3 -Wl,-z,relro vdb-unlock.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-unlock.2.3.3 vdb-unlock.2
+ln -s vdb-unlock.2 vdb-unlock
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/test-sra.c: In function 'VResolverQueryByType':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/test-sra.c:826:10: warning: variable 'rc2' set but not used [-Wunused-but-set-variable]
+     rc_t rc2 = 0;
+          ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/test-sra.2.3.3 -Wl,-z,relro test-sra.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s test-sra.2.3.3 test-sra.2
+ln -s test-sra.2 test-sra
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/li [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-passwd.2.3.3 -Wl,-z,relro vdb-passwd.o syspass.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lksproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-passwd.2.3.3 vdb-passwd.2
+ln -s vdb-passwd.2 vdb-passwd
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/util'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/util'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/kar'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/kar'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/kar'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/kar.c: In function 'sort_cmp':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/kar.c:366:18: warning: variable 'd' set but not used [-Wunused-but-set-variable]
+     KDirectory * d;
+                  ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/kar.2.3.3 -Wl,-z,relro kar.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkfg -lkrypto -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s kar.2.3.3 kar.2
+ln -s kar.2 kar
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/os/linux [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sra-kar.2.3.3 -Wl,-z,relro sra-kar.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sra-kar.2.3.3 sra-kar.2
+ln -s sra-kar.2 sra-kar
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/kar'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/kar'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-dump'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-dump'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-dump'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-dump.2.3.3 -Wl,-z,relro vdb-dump-num-gen.o vdb-dump-context.o vdb-dump-coldefs.o vdb-dump-tools.o vdb-dump-str.o vdb-dump-helper.o vdb-dump-filter.o vdb-dump-formats.o vdb-dump.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-dump.2.3.3 vdb-dump.2
+ln -s vdb-dump.2 vdb-dump
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-dump'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-dump'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-dump'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-dump'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-dump'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.c: In function 'SRASplitterFiler_GetCurrFile':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.c:380:50: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                                 (GetRCObject(rc) == rcDirectory && GetRCState(rc) == rcExists) ) {
+                                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.c: In function 'SRASplitterFactory_FilerInit':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.c:486:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                     (GetRCObject(rc) == rcDirectory && GetRCState(rc) == rcExists) ) {
+                                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.c: In function 'SRADumper_DumpRun':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.c:645:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                  ( GetRCObject( rc ) == rcData ) &&
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.c: In function 'KMain':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.c:1530:79: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcColumn )
+                                                                               ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.h:31:0,
+                 from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:46:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c: In function 'FastqQFilter_GetKey':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:1673:33: note: in expansion of macro 'IF_BUF'
+                                 IF_BUF( ( FastqReaderBase( self->reader, readId + 1,
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:1685:45: note: in expansion of macro 'IF_BUF'
+                                             IF_BUF( ( FastqReaderQuality( self->reader, readId + 1,
+                                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:1715:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF( ( FastqReaderBase( self->reader, 0, self->buffer_for_read_column->base,
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:1725:33: note: in expansion of macro 'IF_BUF'
+                                 IF_BUF( ( FastqReaderQuality( self->reader, 0, self->buffer_for_quality->base,
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c: In function 'FastqFormatterSplitter_DumpByRead':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2613:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( Defline_Build( FastqArgs.b_defline, &def_data, self->b[0]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2618:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderBaseName( self->reader, readId, &FastqArgs.dumpCs, self->b[0]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2626:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderBase( self->reader, readId, self->b[4]->base, KDataBufferBytes( self->b[4] ),
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2634:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderBase( self->reader, readId, self->b[1]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2642:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( Defline_Build( FastqArgs.q_defline, &def_data, self->b[2]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2647:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderQualityName( self->reader, readId, &FastqArgs.dumpCs, self->b[2]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2652:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderQuality( self->reader, readId, self->b[3]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c: In function 'FastqFormatterSplitter_DumpBySpot':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2749:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( Defline_Build( FastqArgs.b_defline, &def_data, self->b[0]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2754:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF( ( FastqReaderBaseName( self->reader, 0, &FastqArgs.dumpCs, self->b[0]->base,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2762:33: note: in expansion of macro 'IF_BUF'
+                                 IF_BUF( ( Defline_Build( FastqArgs.q_defline, &def_data, self->b[2]->base,
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2767:33: note: in expansion of macro 'IF_BUF'
+                                 IF_BUF( ( FastqReaderQualityName( self->reader, 0, &FastqArgs.dumpCs, self->b[2]->base,
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2780:25: note: in expansion of macro 'IF_BUF'
+                         IF_BUF( ( FastqReaderBase( self->reader, readId, &( (char*)(self->b[base_i]->base) )[ self->bsz[ base_i ] ],
+                         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:2786:33: note: in expansion of macro 'IF_BUF'
+                                 IF_BUF( ( FastqReaderQuality( self->reader, readId, &( (char*)(self->b[3]->base) )[ self->bsz[3] ],
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c: In function 'FastqDumper_Factories':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/fastq.c:3419:71: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcColumn )
+                                                                       ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/fastq-dump.2.3.3 -Wl,-z,relro factory.o fasta_dump.o core.o fastq.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s fastq-dump.2.3.3 fastq-dump.2
+ln -s fastq-dump.2 fastq-dump
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.h:31:0,
+                 from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c:37:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c: In function 'SFFFormatterSplitter_Dump':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c:63:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((SFFReaderHeader(self->reader, 0, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c:69:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((SFFReader_GetCurrentSpotData(self->reader, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c: In function 'SFFFormatterSplitter_Release':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/sff.c:96:13: note: in expansion of macro 'IF_BUF'
+             IF_BUF((SFFReaderHeader(self->reader, self->spots, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
+             ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sff-dump.2.3.3 -Wl,-z,relro factory.o fasta_dump.o core.o sff.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sff-dump.2.3.3 sff-dump.2
+ln -s sff-dump.2 sff-dump
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.h:31:0,
+                 from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:38:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c: In function 'IlluminaFormatterSplitter_Dump':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:205:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((IlluminaReaderBase(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:214:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderQuality1(self->reader, 0, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:229:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF((IlluminaReaderQuality1(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:240:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderQuality4(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:248:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderIntensity(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:256:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderNoise(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:264:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderSignal(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:272:17: note: in expansion of macro 'IF_BUF'
+                 IF_BUF((IlluminaReaderQSeq(self->reader, 0, true, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/illumina.c:287:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF((IlluminaReaderQSeq(self->reader, readId, true, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                             ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/illumina-dump.2.3.3 -Wl,-z,relro factory.o fasta_dump.o core.o illumina.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s illumina-dump.2.3.3 illumina-dump.2
+ln -s illumina-dump.2 illumina-dump
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+In file included from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/core.h:31:0,
+                 from /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:41:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c: In function 'AbsolidQFilter_GetKey':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:456:25: note: in expansion of macro 'IF_BUF'
+                         IF_BUF((AbsolidReaderBase(self->reader, readId + 1, self->b->base, KDataBufferBytes(self->b), NULL)), self->b, read_len) {
+                         ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c: In function 'AbsolidFormatterSplitter_Dump':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:584:29: note: in expansion of macro 'IF_BUF'
+                             IF_BUF((string_printf(self->hb->base, KDataBufferBytes(self->hb), &head_sz,
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:593:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderHeader(self->reader, readId, &h[head_sz],
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:600:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderBase(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:608:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderQuality(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:616:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderSignalFTC(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:624:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderSignalCY3(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:632:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderSignalTXR(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/factory.h:39:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+            (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
+                                                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:640:21: note: in expansion of macro 'IF_BUF'
+                     IF_BUF((AbsolidReaderSignalCY5(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
+                     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c: In function 'AbsolidDumper_Factories':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump/abi.c:807:68: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         } else if( GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcColumn ) {
+                                                                    ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/abi-dump.2.3.3 -Wl,-z,relro factory.o fasta_dump.o core.o abi.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s abi-dump.2.3.3 abi-dump.2
+ln -s abi-dump.2 abi-dump
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-dump'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-dump'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-load'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-load'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-load'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/common-xml.c: In function 'parse_BASECALL':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/common-xml.c:340:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/common-xml.c:345:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/common-xml.c:356:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/common-xml.c:371:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/experiment-xml.c: In function 'Experiment_FillSegAgrep':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/experiment-xml.c:711:21: warning: variable 'b' set but not used [-Wunused-but-set-variable]
+         const char* b = NULL;
+                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c: In function 'parse_FILE':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:125:34: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:132:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:141:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:144:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:147:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:151:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:154:35: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                   ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c: In function 'parse_DATA_BLOCK':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:273:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:278:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:287:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:293:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/run-xml.c:299:38: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+     if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
+                                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sra-writer.c: In function 'SRAWriter_CreateTable':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sra-writer.c:103:29: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if( GetRCObject(rc) == rcTable && GetRCState(rc) == rcExists && self->config->force_table_overwrite ) {
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sra-writer.c: In function 'SRAWriter_WriteDefaults':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sra-writer.c:225:36: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         } else if( GetRCObject(rc) == rcData && GetRCState(rc) == rcUnsupported ) {
+                                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/loader.c: In function 'KMain':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/loader.c:1056:41: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                     if( GetRCObject(rc) == rcCursor && GetRCState(rc) == rcNotOpen ) {
+                                         ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/writer-illumina.c: In function 'SRAWriterIllumina_Write':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/writer-illumina.c:592:22: warning: array subscript is above array bounds [-Warray-bounds]
+         final->filter[i] = final->filter[0];
+                      ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/fastq-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o writer-illumina.o writer-454.o writer-ion-torrent.o fastq-fmt.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread  [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s fastq-load.2.3.3 fastq-load.2
+ln -s fastq-load.2 fastq-load
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/illumina-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o writer-illumina.o illumina-fmt.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s illumina-load.2.3.3 illumina-load.2
+ln -s illumina-load.2 illumina-load
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-fmt.c: In function 'SRF_parse_prepdata':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-fmt.c:99:29: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if( GetRCObject(rc) != rcBuffer || GetRCState(rc) != rcInsufficient ) {
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-fmt.c:132:37: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 if( GetRCObject(rc) != rcBuffer || GetRCState(rc) != rcInsufficient ) {
+                                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-illumina.c: In function 'parse_header':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-illumina.c:154:68: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             if(GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcData)
+                                                                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-absolid.c: In function 'parse_v1_read.part.0':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/srf-absolid.c:362:113: warning: array subscript is above array bounds [-Warray-bounds]
+                             size_t len = (i + 1 >= fe->region.nreads) ? ztr.signal->datasize : (fe->region.start[i + 1] * sizeof(float));
+                                                                                                                 ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/srf-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o srf.o srf-fmt.o writer-illumina.o ztr-illumina.o srf-illumina.o writer-absolid.o ztr-absolid.o ztr-huffman.o srf-absolid.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstati [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s srf-load.2.3.3 srf-load.2
+ln -s srf-load.2 srf-load
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/abi-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o writer-absolid.o absolid-fmt.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s abi-load.2.3.3 abi-load.2
+ln -s abi-load.2 abi-load
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sff-fmt.c: In function 'SFFLoaderFmtWriteDataFile':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/sff-fmt.c:358:40: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             } else if( GetRCObject(rc) == rcData && GetRCState(rc) == rcIgnored ) {
+                                        ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sff-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o writer-454.o writer-ion-torrent.o sff-fmt.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sff-load.2.3.3 sff-load.2
+ln -s sff-load.2 sff-load
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/helicos-load.2.3.3 -Wl,-z,relro pstring.o common-xml.o experiment-xml.o run-xml.o loader-file.o loader-fmt.o sra-writer.o loader.o writer-helicos.o helicos-fmt.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s helicos-load.2.3.3 helicos-load.2
+ln -s helicos-load.2 helicos-load
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-load'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-load'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-pileup'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-pileup'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-pileup'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/cmdline_cmn.c: In function 'foreach_argument':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/cmdline_cmn.c:861:20: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 if ( rc == 0 && path != NULL )
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c: In function 'report_references':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:196:39: warning: 'max_ev_at' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         uint64_t from = ( ( max_ev_at - start ) * 5000 ) + 1;
+                                       ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:151:46: note: 'max_ev_at' was declared here
+     int64_t row_id, max_prim_at, max_sec_at, max_ev_at;
+                                              ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:192:12: warning: 'max_sec_at' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         rc = KOutMsg( "max. SEC:\t%,u\tat row #%,i ( from pos: %,u ... %,u )\n", max_sec, max_sec_at, from, from + 4999 );
+            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:151:34: note: 'max_sec_at' was declared here
+     int64_t row_id, max_prim_at, max_sec_at, max_ev_at;
+                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:187:12: warning: 'max_prim_at' may be used uninitialized in this function [-Wmaybe-uninitialized]
+         rc = KOutMsg( "max. PRI:\t%,u\tat row #%,i ( from pos: %,u ... %,u )\n", max_prim, max_prim_at, from, from + 4999 );
+            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/reref.c:151:21: note: 'max_prim_at' was declared here
+     int64_t row_id, max_prim_at, max_sec_at, max_ev_at;
+                     ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sra-pileup.2.3.3 -Wl,-z,relro cmdline_cmn.o reref.o sra-pileup.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sra-pileup.2.3.3 sra-pileup.2
+ln -s sra-pileup.2 sra-pileup
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-aligned.c: In function 'modify_and_print_cigar':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-aligned.c:786:18: warning: variable 'combined_len' set but not used [-Wunused-but-set-variable]
+         uint32_t combined_len;
+                  ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/cg_tools.c: In function 'fmt_cigar_elem':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/cg_tools.c:567:10: warning: unused variable 'rc' [-Wunused-variable]
+     rc_t rc = string_printf ( dst, 11, &num_writ, "%d%c", cig_oplen, cig_op );
+          ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c: In function 'Cursor_Open':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c:716:32: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if ( GetRCObject( rc ) == rcColumn )
+                                ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c: In function 'ProcessPath':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c:3885:5: warning: label 'old' defined but not used [-Wunused-label]
+     old:
+     ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c: In function 'DumpCGSAM.part.17':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c:2743:47: warning: 'last_cig_op' may be used uninitialized in this function [-Wmaybe-uninitialized]
+                 ciglen = last_ciglen + sprintf(dst+last_ciglen,"%d%c",last_cig_oplen,last_cig_op); \
+                                               ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump.c:2731:14: note: 'last_cig_op' was declared here
+     char     last_cig_op;
+              ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump3.c: In function 'KMain':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump3.c:446:8: warning: 'mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     rc = init_out_redir( &redir, mode, opts->outputfile, opts->output_buffer_size ); /* from out_redir.c */
+        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup/sam-dump3.c:437:25: note: 'mode' was declared here
+     enum out_redir_mode mode;
+                         ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sam-dump.2.3.3 -Wl,-z,relro inputfiles.o sam-dump-opts.o out_redir.o sam-hdr.o matecache.o read_fkt.o sam-aligned.o sam-unaligned.o cg_tools.o sam-dump.o sam-dump3.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sam-dump.2.3.3 sam-dump.2
+ln -s sam-dump.2 sam-dump
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-pileup'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-pileup'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/bam-loader'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/bam-loader'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/bam-loader'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/sequence-writer.c: In function 'SequenceWhack':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/sequence-writer.c:208:10: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
+     rc_t rc;
+          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/sequence-writer.c: In function 'SequenceRecordAppend':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/sequence-writer.c:298:20: warning: unused variable 'readStart' [-Wunused-variable]
+     unsigned const readStart = (uint8_t const *)self->readStart - (uint8_t const *)self->storage.base;
+                    ^
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c: In function 'ProcessBAM':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c:1323:42: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInvalid) {
+                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c:1327:42: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if (GetRCObject(rc) == rcData) {
+                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c: In function 'SequenceUpdateAlignInfo':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c:1824:28: warning: unused variable 'spotId' [-Wunused-variable]
+             uint64_t const spotId = CTX_VALUE_GET_S_ID(*value);
+                            ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c: At top level:
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader/loader-imp.c:167:20: warning: 'Print_ctx_value_t' defined but not used [-Wunused-function]
+ static char const *Print_ctx_value_t(ctx_value_t const *const self)
+                    ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/bam-load.2.3.3 -Wl,-z,relro bam-loader.o alignment-writer.o reference-writer.o sequence-writer.o loader-imp.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s bam-load.2.3.3 bam-load.2
+ln -s bam-load.2 bam-load
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/bam-loader'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/bam-loader'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/fastq-loader'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/fastq-loader'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/fastq-loader'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/fastq-lex.c:1512:16: warning: 'input' defined but not used [-Wunused-function]
+     static int input  (yyscan_t yyscanner)
+                ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/fastq-lex.c:1983:16: warning: 'yy_top_state' defined but not used [-Wunused-function]
+     static int yy_top_state  (yyscan_t yyscanner)
+                ^
+ar -rc /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib/libfastqloader.a fastq-reader.pic.o fastq-grammar.pic.o fastq-lex.pic.o
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/fastq-lex.c:1512:16: warning: 'input' defined but not used [-Wunused-function]
+     static int input  (yyscan_t yyscanner)
+                ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader/fastq-lex.c:1983:16: warning: 'yy_top_state' defined but not used [-Wunused-function]
+     static int yy_top_state  (yyscan_t yyscanner)
+                ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/latf-load.2.3.3 -Wl,-z,relro fastq-loader.o loader-imp.o fastq-reader.o fastq-grammar.o fastq-lex.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lloader -lload -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s latf-load.2.3.3 latf-load.2
+ln -s latf-load.2 latf-load
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/fastq-loader'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/fastq-loader'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/srapath'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/srapath'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/srapath'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/srapath'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/srapath/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/srapath/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/srapath -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfa [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/srapath.2.3.3 -Wl,-z,relro srapath.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s srapath.2.3.3 srapath.2
+ln -s srapath.2 srapath
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/srapath'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/srapath'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-stat'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-stat'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-stat'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-stat'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-stat/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-stat/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-stat -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sra-stat.2.3.3 -Wl,-z,relro sra-stat.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sra-stat.2.3.3 sra-stat.2
+ln -s sra-stat.2 sra-stat
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-stat'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-stat'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-copy'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-copy'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-copy'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+cp /tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy/vdb-copy.kfg /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib/ncbi/vdb-copy.kfg
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-copy.2.3.3 -Wl,-z,relro num-gen.o context.o helper.o coldefs.o get_platform.o namelist_tools.o progressbar.o copy_meta.o type_matcher.o redactval.o config_values.o vdb-copy.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-wvdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-copy.2.3.3 vdb-copy.2
+ln -s vdb-copy.2 vdb-copy
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-copy'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-copy'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-config'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-config'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-config'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config/vdb-config.c: In function 'CreateConfig':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config/vdb-config.c:643:42: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                 else if (GetRCObject(rc) == rcPath &&
+                                          ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config/vdb-config.c:664:34: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         else if (GetRCObject(rc) == rcPath
+                                  ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-config.2.3.3 -Wl,-z,relro vdb-config.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-config.2.3.3 vdb-config.2
+ln -s vdb-config.2 vdb-config
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-config'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-config'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/align-info'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/align-info'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/align-info'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfs [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info/align-info.c: In function 'bam_header':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info/align-info.c:178:60: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                         else if (i == 0 && GetRCObject(rc) == rcBuffer
+                                                            ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/align-info.2.3.3 -Wl,-z,relro align-info.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s align-info.2.3.3 align-info.2
+ln -s align-info.2 align-info
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/align-info'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/align-info'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/prefetch'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/prefetch'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/prefetch'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/prefetch'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/prefetch/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/prefetch/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/prefetch -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/prefetch.2.3.3 -Wl,-z,relro prefetch.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s prefetch.2.3.3 prefetch.2
+ln -s prefetch.2 prefetch
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/prefetch'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/prefetch'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nenctool'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nenctool'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nenctool'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nenctool'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nenctool/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nenctool/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nenctool -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/inte [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/nenctool.2.3.3 -Wl,-z,relro nenctool.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s nenctool.2.3.3 nenctool.2
+ln -s nenctool.2 nenctool
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nenctool'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nenctool'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nencvalid'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nencvalid'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nencvalid'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/i [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/nencvalid.c: In function 'nencvalidWGAEncValidate':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/nencvalid.c:250:29: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         if (GetRCObject(rc) == rcEncryptionKey && GetRCState(rc) == rcNotFound)
+                             ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/nencvalid.c: In function 'HandleOneFile':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/nencvalid.c:351:33: warning: case value '17' not in enumerated type 'enum RCObject' [-Wswitch]
+                                 case rcFile:
+                                 ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid/nencvalid.c:342:33: warning: case value '23' not in enumerated type 'enum RCObject' [-Wswitch]
+                                 case rcHeader:
+                                 ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/nencvalid.2.3.3 -Wl,-z,relro nencvalid.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s nencvalid.2.3.3 nencvalid.2
+ln -s nencvalid.2 nencvalid
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/nencvalid'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/nencvalid'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-decrypt'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-decrypt'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-decrypt'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~ [...]
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~ [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/shared.c:408:6: warning: 'IsCacheFile' defined but not used [-Wunused-function]
+ bool IsCacheFile (const char * path)
+      ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-decrypt.2.3.3 -Wl,-z,relro vdb-decrypt.o shared.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-decrypt.2.3.3 vdb-decrypt.2
+ln -s vdb-decrypt.2 vdb-decrypt
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~ [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt/vdb-encrypt.c:71:6: warning: 'DecryptSraFlag' defined but not used [-Wunused-variable]
+ bool DecryptSraFlag = false;
+      ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-encrypt.2.3.3 -Wl,-z,relro vdb-encrypt.o shared.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lvfs -lkurl -lkrypto -lkfg -lkfs -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-encrypt.2.3.3 vdb-encrypt.2
+ln -s vdb-encrypt.2 vdb-encrypt
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-decrypt'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-decrypt'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-validate'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-validate'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-validate'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3 [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c: In function 'init_dbcc':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c:640:40: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+                     && GetRCObject(rc) == rcSchema && sra_schema == NULL)
+                                        ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c: In function 'verify_mgr_table':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c:873:66: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+         else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema
+                                                                  ^
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c: In function 'get_platform':
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate/vdb-validate.c:1462:70: warning: comparison between 'enum RCObject' and 'enum RCTarget' [-Wenum-compare]
+             else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema
+                                                                      ^
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/vdb-validate.2.3.3 -Wl,-z,relro vdb-validate.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -Wl,-Bdynamic -lncbi-vdb -ldl -lpthread -lxml2 -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s vdb-validate.2.3.3 vdb-validate.2
+ln -s vdb-validate.2 vdb-validate
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/vdb-validate'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/vdb-validate'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-sort'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-sort'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-sort'
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/db-pair.c:334:6: warning: 'DbPairDefaultExplodeDB' defined but not used [-Wunused-function]
+ void DbPairDefaultExplodeDB ( DbPair *self, const ctx_t *ctx )
+      ^
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+gcc -c  -DNDEBUG    -std=gnu99 -fgnu89-inline  -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/ [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/sra-sort.2.3.3 -Wl,-z,relro caps.o mem.o membank.o paged-membank.o paged-mmapbank.o except.o idx-mapping.o map-file.o col-pair.o row-set.o simple-row-set.o mapping-row-set.o sorting-row-set.o meta-pair.o dir-pair.o tbl-pair.o db-pair.o glob-poslen.o poslen-col-pair.o ref-alignid-col.o buff-writer.o id-mapper-col.o capture-first-half-aligned.o csra-tbl.o csra-pair.o run.o sra-sort.o xcheck-ref-align.o -L/tmp/b [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s sra-sort.2.3.3 sra-sort.2
+ln -s sra-sort.2 sra-sort
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/sra-sort'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/sra-sort'
+make[4]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/cache-mgr'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/cache-mgr'
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/cache-mgr'
+make[5]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/cache-mgr'
+gcc -c  -DNDEBUG      -DLINUX -DUNIX -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_ARCH_BITS=64 -DLIBPREFIX=lib -DSHLIBEXT=so -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/cache-mgr/linux -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/cache-mgr/unix -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/cache-mgr -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc/x86_64 -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/interfaces/cc/gcc -I/tmp/buildd/sra-sdk-2.3.3-4~dfsg/i [...]
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+gcc -o /tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/bin/cache-mgr.2.3.3 -Wl,-z,relro cache-mgr.o -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/lib -L/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/ilib -Wl,-Bstatic -lkapp -lsraschema -lvdb -lkdb -lvfs -lkurl -lkrypto -lkfg -lkfs -lksrch -lkproc -lklib -Wl,-Bdynamic -lz -lbz2 -ldl -lpthread -lm
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
+ln -s cache-mgr.2.3.3 cache-mgr.2
+ln -s cache-mgr.2 cache-mgr
+make[5]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/debian/tmp/linux/gcc/dyn/x86_64/rel/obj/tools/cache-mgr'
+make[4]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools/cache-mgr'
+make[3]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg/tools'
+make[2]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+make[1]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+   dh_testroot
+   debian/rules override_dh_prep
+make[1]: Entering directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+dh_prep -X debian/tmp
+make[1]: Leaving directory `/tmp/buildd/sra-sdk-2.3.3-4~dfsg'
+   dh_auto_install
+   dh_install
+   dh_installdocs
+   dh_installchangelogs
+   dh_lintian
+   dh_perl
+   dh_link
+   dh_compress
+   dh_fixperms
+   dh_strip
+   dh_makeshlibs
+   dh_shlibdeps
+dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/sra-toolkit/usr/bin/vdb-encrypt.2.3.3 debian/sra-toolkit/usr/bin/nencvalid.2.3.3 debian/sra-toolkit/usr/bin/vdb-decrypt.2.3.3 debian/sra-toolkit/usr/bin/srapath.2.3.3 debian/sra-toolkit/usr/bin/rcexplain.2.3.3 debian/sra-toolkit/usr/bin/kar.2.3.3 debian/sra-toolkit/usr/bin/cache-mgr.2.3.3 debian/sra-toolkit/usr/bin/vdb-passwd.2.3.3 debian/sra-toolkit/usr/bin/nenctool.2.3.3 were not linked against libbz2.so.1.0 (t [...]
+dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/sra-toolkit/usr/bin/illumina-load.2.3.3 debian/sra-toolkit/usr/bin/vdb-unlock.2.3.3 debian/sra-toolkit/usr/bin/srf-load.2.3.3 debian/sra-toolkit/usr/bin/vdb-validate.2.3.3 debian/sra-toolkit/usr/bin/fastq-dump.2.3.3 debian/sra-toolkit/usr/bin/test-sra.2.3.3 debian/sra-toolkit/usr/bin/illumina-dump.2.3.3 debian/sra-toolkit/usr/bin/fastq-load.2.3.3 debian/sra-toolkit/usr/bin/sff-load.2.3.3 debian/sra-toolkit/usr/bi [...]
+   dh_installdeb
+   dh_gencontrol
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+dpkg-gencontrol: warning: Depends field of package sra-toolkit-libs-dev: unknown substitution variable ${shlibs:Depends}
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+   dh_md5sums
+   dh_builddeb
+dpkg-deb: building package `sra-toolkit' in `../sra-toolkit_2.3.3-4~dfsg-1_amd64.deb'.
+dpkg-deb: building package `sra-toolkit-libs0' in `../sra-toolkit-libs0_2.3.3-4~dfsg-1_amd64.deb'.
+dpkg-deb: building package `sra-toolkit-libs-dev' in `../sra-toolkit-libs-dev_2.3.3-4~dfsg-1_amd64.deb'.
+ dpkg-genchanges  >../sra-sdk_2.3.3-4~dfsg-1_amd64.changes
+dpkg-genchanges: including full source code in upload
+ dpkg-source -i.git -I.git -i.git -I.git --after-build sra-sdk-2.3.3-4~dfsg
+dpkg-buildpackage: full upload (original source is included)
+W: no hooks of type B found -- ignoring
+I: Copying back the cached apt archive contents
+I: unmounting dev/pts filesystem
+I: unmounting run/shm filesystem
+I: unmounting proc filesystem
+I: Current time: Wed Oct 23 11:58:20 CEST 2013
+I: pbuilder-time-stamp: 1382522300
+_compress
+   dh_fixperms
+   dh_strip
+   dh_makeshlibs
+   dh_shlibdeps
+dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/sra-toolkit/usr/bin/vdb-encrypt.2.3.3 debian/sra-toolkit/usr/bin/nencvalid.2.3.3 debian/sra-toolkit/usr/bin/vdb-decrypt.2.3.3 debian/sra-toolkit/usr/bin/srapath.2.3.3 debian/sra-toolkit/usr/bin/rcexplain.2.3.3 debian/sra-toolkit/usr/bin/kar.2.3.3 debian/sra-toolkit/usr/bin/cache-mgr.2.3.3 debian/sra-toolkit/usr/bin/vdb-passwd.2.3.3 debian/sra-toolkit/usr/bin/nenctool.2.3.3 were not linked against libbz2.so.1.0 (t [...]
+dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/sra-toolkit/usr/bin/illumina-load.2.3.3 debian/sra-toolkit/usr/bin/vdb-unlock.2.3.3 debian/sra-toolkit/usr/bin/srf-load.2.3.3 debian/sra-toolkit/usr/bin/vdb-validate.2.3.3 debian/sra-toolkit/usr/bin/fastq-dump.2.3.3 debian/sra-toolkit/usr/bin/test-sra.2.3.3 debian/sra-toolkit/usr/bin/illumina-dump.2.3.3 debian/sra-toolkit/usr/bin/fastq-load.2.3.3 debian/sra-toolkit/usr/bin/sff-load.2.3.3 debian/sra-toolkit/usr/bi [...]
+   dh_installdeb
+   dh_gencontrol
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+dpkg-gencontrol: warning: Depends field of package sra-toolkit-libs-dev: unknown substitution variable ${shlibs:Depends}
+dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
+   dh_md5sums
+   dh_builddeb
+dpkg-deb: building package `sra-toolkit' in `../sra-toolkit_2.3.3-4~dfsg-1_amd64.deb'.
+dpkg-deb: building package `sra-toolkit-libs0' in `../sra-toolkit-libs0_2.3.3-4~dfsg-1_amd64.deb'.
+dpkg-deb: building package `sra-toolkit-libs-dev' in `../sra-toolkit-libs-dev_2.3.3-4~dfsg-1_amd64.deb'.
+ dpkg-genchanges  >../sra-sdk_2.3.3-4~dfsg-1_amd64.changes
+dpkg-genchanges: including full source code in upload
+ dpkg-source -i.git -I.git -i.git -I.git --after-build sra-sdk-2.3.3-4~dfsg
+dpkg-buildpackage: full upload (original source is included)
+W: no hooks of type B found -- ignoring
+I: Copying back the cached apt archive contents
+I: unmounting dev/pts filesystem
+I: unmounting run/shm filesystem
+I: unmounting proc filesystem
+I: Current time: Wed Oct 23 11:58:20 CEST 2013
+I: pbuilder-time-stamp: 1382522300
+ -> Cleaning COW directory
+  forking: rm -rf /var/cache/pbuilder/build//cow.6075 
+ signfile /home/tillea/debian-maintain/alioth/debian-med_git/build-area/sra-sdk_2.3.3-4~dfsg-1.dsc Andreas Tille <tille at debian.org>
+
+ signfile /home/tillea/debian-maintain/alioth/debian-med_git/build-area/sra-sdk_2.3.3-4~dfsg-1_amd64.changes Andreas Tille <tille at debian.org>
+
+Successfully signed dsc and changes files
diff --git a/tools/Makefile b/tools/Makefile
deleted file mode 100644
index 09776c5..0000000
--- a/tools/Makefile
+++ /dev/null
@@ -1,83 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-TOP ?= $(shell ../build/abspath.sh ..)
-MODULE = tools
-
-include $(TOP)/build/Makefile.shell
-
-
-#-------------------------------------------------------------------------------
-# default
-#
-SUBDIRS = \
-	util \
-	kar \
-	vdb-dump \
-	sra-dump \
-	sra-load \
-	sra-pileup \
-	bam-loader \
-	fastq-loader \
-	srapath \
-	sra-stat \
-	vdb-copy \
-	vdb-config \
-	align-info \
-	prefetch \
-	nenctool \
-	nencvalid \
-	vdb-decrypt \
-	vdb-validate \
-	sra-sort \
-    cache-mgr
-
-# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
-include $(TOP)/build/Makefile.targets
-
-$(SUBDIRS):
-	@ $(MAKE) -C $@
-
-.PHONY: default $(SUBDIRS) 
-
-#-------------------------------------------------------------------------------
-# tag
-#
-SUBDIRS_TAG = $(addsuffix _tag,$(SUBDIRS))
-
-tag: $(SUBDIRS_TAG)
-
-$(SUBDIRS_TAG):
-	@ $(MAKE) -C $(subst _tag,,$@) tag
-
-.PHONY: tag $(SUBDIRS_TAG)
-
-#-------------------------------------------------------------------------------
-# pass-through
-#
-out debug profile release GCC ICC VC++:
-	@ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env $@
-
-.PHONY: out debug profile release GCC ICC VC++
diff --git a/tools/align-info/Makefile b/tools/align-info/Makefile
deleted file mode 100644
index a5f6fc0..0000000
--- a/tools/align-info/Makefile
+++ /dev/null
@@ -1,91 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/align-info
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	align-info
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# align-info
-#
-ALIGN_INFO_SRC = \
-	align-info
-
-ALIGN_INFO_OBJ = \
-	$(addsuffix .$(OBJX),$(ALIGN_INFO_SRC))
-
-ALIGN_INFO_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/align-info: $(ALIGN_INFO_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(ALIGN_INFO_LIB)
diff --git a/tools/align-info/align-info.c b/tools/align-info/align-info.c
deleted file mode 100644
index 0663401..0000000
--- a/tools/align-info/align-info.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "align-info.vers.h"
-
-#include <sra/sraschema.h> /* VDBManagerMakeSRASchema */
-
-#include <vdb/manager.h> /* VDBManager */
-#include <vdb/database.h> /* VDatabase */
-#include <vdb/dependencies.h> /* VDBDependencies */
-#include <vdb/table.h> /* VTable */
-#include <vdb/schema.h> /* VSchema */
-#include <vdb/cursor.h> /* VCursor */
-#include <vdb/vdb-priv.h> /* VDBManagerOpenKDBManagerRead */
-
-#include <kapp/main.h>
-
-#include <kfg/config.h> /* KConfig */
-
-#include <kdb/manager.h> /* KDBManagerRelease */
-#include <kdb/namelist.h> /* KMDataNodeListChild */
-#include <kdb/meta.h> /* KMetadata */
-
-#include <klib/container.h> /* BSTree */
-#include <klib/sort.h> /* ksort */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/log.h> /* LOGERR */
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/rc.h> /* RC */
-
-#include <assert.h>
-#include <stdio.h> /* sscanf */
-#include <stdlib.h> /* free */
-#include <string.h> /* strcmp */
-
-#define DISP_RC(rc, msg) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, msg))
-#define DISP_RC2(rc, name, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt,rc, "$(msg): $(name)","msg=%s,name=%s",msg,name)))
-#define DESTRUCT(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-typedef struct Params {
-    const char* dbPath;
-
-    bool paramBamHeader;
-    bool paramQuality;
-    bool paramRef;
-} Params;
-
-#define ALIAS_ALL    "a"
-#define OPTION_ALL   "all"
-static const char* USAGE_ALL[] = { "print all information", NULL };
-
-#define ALIAS_BAM    "b"
-#define OPTION_BAM   "bam"
-static const char* USAGE_BAM[] = { "print bam header (if present)", NULL };
-
-#define ALIAS_QUA    "q"
-#define OPTION_QUA   "qual"
-static const char* USAGE_QUA[]
-                       = { "print quality statistics (if present)", NULL };
-
-#define ALIAS_REF    "r"
-#define OPTION_REF   "ref"
-static const char* USAGE_REF[] = { "print refseq information [default]", NULL };
-
-OptDef Options[] =
-{
-      { OPTION_ALL, ALIAS_ALL, NULL, USAGE_ALL, 1, false, false }
-    , { OPTION_BAM, ALIAS_BAM, NULL, USAGE_BAM, 1, false, false }
-    , { OPTION_QUA, ALIAS_QUA, NULL, USAGE_QUA, 1, false, false }
-    , { OPTION_REF, ALIAS_REF, NULL, USAGE_REF, 1, false, false }
-};
-
-rc_t CC UsageSummary (const char * progname) {
-    return KOutMsg (
-        "Usage:\n"
-        "  %s [options] <db-path>\n"
-        "\n"
-        "Summary:\n"
-        "  Print database alignment information\n"
-        "\n", progname);
- }
-
-static const char* param_usage[] = { "Path to the database" };
-
-rc_t CC Usage(const Args* args) { 
-    rc_t rc = 0 ;
-
-    const char* progname = UsageDefaultName;
-    const char* fullpath = UsageDefaultName;
-
-    if (args == NULL)
-    {    rc = RC(rcExe, rcArgv, rcAccessing, rcSelf, rcNull); }
-    else
-    {    rc = ArgsProgram(args, &fullpath, &progname); }
-
-    UsageSummary(progname);
-
-    KOutMsg("Parameters:\n");
-
-    HelpParamLine ("db-path", param_usage);
-
-    KOutMsg ("\nOptions:\n");
-
-    HelpOptionLine (ALIAS_ALL, OPTION_ALL, NULL, USAGE_ALL);
-    HelpOptionLine (ALIAS_REF, OPTION_REF, NULL, USAGE_REF);
-    HelpOptionLine (ALIAS_BAM, OPTION_BAM, NULL, USAGE_BAM);
-    HelpOptionLine (ALIAS_QUA, OPTION_QUA, NULL, USAGE_QUA);
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-const char UsageDefaultName[] = "align-info";
-
-ver_t CC KAppVersion(void) { return ALIGN_INFO_VERS; }
-
-static rc_t bam_header(const VDatabase* db) {
-    rc_t rc = 0;
-    const char path[] = "BAM_HEADER";
-    const KMetadata* meta = NULL;
-    const KMDataNode* node = NULL;
-    char* buffer = NULL;
-    assert(db);
-    if (rc == 0) {
-        rc = VDatabaseOpenMetadataRead(db, &meta);
-        DISP_RC(rc, "while calling VDatabaseOpenMetadataRead");
-    }
-    if (rc == 0) {
-        rc = KMetadataOpenNodeRead(meta, &node, path);
-        if (GetRCState(rc) == rcNotFound)
-        {   rc = 0; }
-        else {
-            DISP_RC2(rc, path, "while calling KMetadataOpenNodeRead");
-            if (rc == 0) {
-                int i = 0;
-                size_t bsize = 0;
-                size_t size = 1024;
-                for (i = 0; i < 2; ++i) {
-                    free(buffer);
-                    bsize = size + 1;
-                    buffer = malloc(bsize);
-                    if (buffer == NULL) {
-                        rc = RC(rcExe, rcStorage, rcAllocating,
-                            rcMemory, rcExhausted);
-                    }
-                    else {
-                        rc = KMDataNodeReadCString(node, buffer, bsize, &size);
-                        if (rc == 0)
-                        {   break; }
-                        else if (i == 0 && GetRCObject(rc) == rcBuffer
-                                        && GetRCState(rc) == rcInsufficient)
-                        {   rc = 0; }
-                    }
-                    DISP_RC2(rc, path, "while calling KMDataNodeReadCString");
-                }
-            }
-        }
-    }
-    if (rc == 0 && buffer)
-    {   OUTMSG(("BAM_HEADER: {\n%s}\n\n", buffer)); }
-    DESTRUCT(KMDataNode, node);
-    DESTRUCT(KMetadata, meta);
-    free(buffer);
-    return rc;
-}
-
-static int CC sort_callback(const void* p1, const void* p2, void* data) {
-    int i1 = *(int*) p1;
-    int i2 = *(int*) p2;
-    return i1 - i2;
-}
-static rc_t qual_stats(const Params* prm, const VDatabase* db) {
-    rc_t rc = 0;
-    const char tblName[] = "SEQUENCE";
-    const VTable* tbl = NULL;
-    const KMetadata* meta = NULL;
-    const KMDataNode* node = NULL;
-    assert(prm && db);
-    if (rc == 0) {
-        rc = VDatabaseOpenTableRead(db, &tbl, tblName);
-        DISP_RC2(rc, tblName, "while calling VDatabaseOpenTableRead");
-    }
-    if (rc == 0) {
-        rc = VTableOpenMetadataRead(tbl, &meta);
-        DISP_RC2(rc, tblName, "while calling VTableOpenMetadataRead");
-    }
-    if (rc == 0) {
-        bool found = false;
-        const char path[] = "STATS/QUALITY";
-        rc = KMetadataOpenNodeRead(meta, &node, path);
-        if (rc == 0)
-        {   found = true; }
-        else if (GetRCState(rc) == rcNotFound)
-        {   rc = 0; }
-        DISP_RC2(rc, path, "while calling KMetadataOpenNodeRead");
-        if (found) {
-            uint32_t i = 0;
-            int nbr = 0;
-            uint32_t count = 0;
-            KNamelist* names = NULL;
-            int* quals = NULL;
-            if (rc == 0) {
-                rc = KMDataNodeListChild(node, &names);
-                DISP_RC2(rc, path, "while calling KMDataNodeListChild");
-            }
-            if (rc == 0) {
-                rc = KNamelistCount(names, &count);
-                DISP_RC2(rc, path, "while calling KNamelistCount");
-                if (rc == 0 && count > 0) {
-                    quals = calloc(count, sizeof *quals);
-                    if (quals == NULL) {
-                        rc = RC(rcExe,
-                            rcStorage, rcAllocating, rcMemory, rcExhausted);
-                    }
-                }
-            }
-            for (i = 0; i < count && rc == 0; ++i) {
-             /* uint64_t u = 0;
-                const KMDataNode* n = NULL; */
-                const char* nodeName = NULL;
-                const char* name = NULL;
-                rc = KNamelistGet(names, i, &nodeName);
-                DISP_RC2(rc, path, "while calling KNamelistGet");
-                if (rc)
-                {   break; }
-                name = nodeName;
-             /* rc = KMDataNodeOpenNodeRead(node, &n, name);
-                DISP_RC(rc, name);
-                if (rc == 0) {
-                    rc = KMDataNodeReadAsU64(n, &u);
-                    DISP_RC(rc, name);
-                } */
-                if (rc == 0) {
-                    char* c = strchr(name, '_');
-                    if (c != NULL && *(c + 1) != '\0') {
-                        name = c + 1;
-                        if (sscanf(name, "%d", &quals[i]) != 1) {
-                            rc = RC(rcExe,
-                                rcNode, rcParsing, rcName, rcUnexpected);
-                            PLOGERR(klogInt,
-                                (klogInt, rc, "$(name)", "name=%s", nodeName));
-                        }
-                    }
-                    /* OUTMSG(("QUALITY %s %lu\n", name, u)); */
-                }
-             /* DESTRUCT(KMDataNode, n); */
-            }
-            if (rc == 0 && count > 0)
-            {   ksort(quals, count, sizeof *quals, sort_callback, NULL); }
-            if (rc == 0) {
-                OUTMSG(("%s", prm->dbPath));
-            }
-            for (i = 0, nbr = 0; i < count && rc == 0; ++i, ++nbr) {
-                uint64_t u = 0;
-                char name[64];
-                const KMDataNode* n = NULL;
-                sprintf(name, "PHRED_%d", quals[i]);
-                rc = KMDataNodeOpenNodeRead(node, &n, name);
-                DISP_RC(rc, name);
-                if (rc == 0) {
-                    rc = KMDataNodeReadAsU64(n, &u);
-                    DISP_RC(rc, name);
-                    if (rc == 0) {
-                        while (nbr < quals[i]) {
-                            OUTMSG(("\t0"));
-                            ++nbr;
-                        }
-                        OUTMSG(("\t%lu", u));
-                    /*  OUTMSG(("QUALITY %d %lu\n", quals[i], u)); */
-                    }
-                }
-                DESTRUCT(KMDataNode, n);
-            }
-            while (rc == 0 && nbr <= 40) {
-                OUTMSG(("\t0"));
-                nbr++;
-            }
-            if (rc == 0) {
-                OUTMSG(("\n"));
-            }
-            DESTRUCT(KNamelist, names);
-        }
-    }
-    DESTRUCT(KMDataNode, node);
-    DESTRUCT(KMetadata, meta);
-    DESTRUCT(VTable, tbl);
-    return rc;
-}
-
-static rc_t align_info(const Params* prm) {
-    rc_t rc = 0;
-
-    const VDatabase* db = NULL;
-    const VDBManager* mgr = NULL;
-    const KDBManager *kmgr = NULL;
-    VSchema* schema = NULL;
-    bool is_db = false;
-
-    if (prm == NULL)
-    {   return RC(rcExe, rcQuery, rcExecuting, rcParam, rcNull); }
-
-    if (rc == 0) {
-        rc = VDBManagerMakeRead(&mgr, NULL);
-        DISP_RC(rc, "while calling VDBManagerMakeRead");
-    }
-
-    if (rc == 0) {
-        rc = VDBManagerOpenKDBManagerRead(mgr, &kmgr);
-        DISP_RC(rc, "while calling VDBManagerOpenKDBManagerRead");
-    }
-
-    if (rc == 0) {
-        rc = VDBManagerMakeSRASchema(mgr, &schema);
-        DISP_RC(rc, "while calling VDBManagerMakeSRASchema");
-    }
-
-    if (rc == 0) {
-        rc = VDBManagerOpenDBRead(mgr, &db, schema, prm->dbPath);
-        if (rc == 0) {
-            is_db = true;
-        }
-        else if (rc == SILENT_RC(rcDB, rcMgr, rcOpening, rcDatabase, rcIncorrect)) {
-            PLOGMSG(klogWarn, (klogWarn,
-                "'$(path)' is not a database", "path=%s", prm->dbPath));
-            rc = 0;
-        }
-        else {
-            PLOGERR(klogErr,
-                (klogErr, rc, "$(path)", "path=%s", prm->dbPath));
-        }
-    }
-
-    if (is_db) {
-        if (rc == 0) {
-            if (prm->paramRef) {
-                const VDBDependencies* dep = NULL;
-                uint32_t count = 0;
-                int i = 0;
-                rc = VDatabaseListDependencies(db, &dep, false);
-                DISP_RC2(rc, prm->dbPath,
-                    "while calling VDatabaseListDependencies");
-                if (rc == 0) {
-                    rc = VDBDependenciesCount(dep, &count);
-                    DISP_RC2(rc, prm->dbPath,
-                        "while calling VDBDependenciesCount");
-                }
-                for (i = 0; i < count && rc == 0; ++i) {
-                    bool circular = false;
-                    const char* name = NULL;
-                    const char* path = NULL;
-                    const char* remote = NULL;
-                    bool local = false;
-                    const char* seqId = NULL;
-                    rc = VDBDependenciesCircular(dep, &circular, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesCircular");
-                        break;
-                    }
-                    rc = VDBDependenciesName(dep, &name, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesName");
-                        break;
-                    }
-                    rc = VDBDependenciesPath(dep, &path, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesPath");
-                        break;
-                    }
-                    rc = VDBDependenciesLocal(dep, &local, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesLocal");
-                        break;
-                    }
-                    rc = VDBDependenciesSeqId(dep, &seqId, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesSeqId");
-                        break;
-                    }
-                    rc = VDBDependenciesPathRemote(dep, &remote, i);
-                    if (rc != 0) {
-                        DISP_RC2(rc, prm->dbPath,
-                            "while calling VDBDependenciesRemote");
-                        break;
-                    }
-                    OUTMSG(("%s,%s,%s,%s", seqId, name,
-                        (circular ? "true" : "false"),
-                        (local ? "local" : "remote")));
-                    if (path && path[0]) {
-                        OUTMSG((":%s", path));
-                    }
-                    else if (remote && remote[0]) {
-                        OUTMSG(("::%s", remote));
-                    }
-                    OUTMSG(("\n"));
-                }
-                DESTRUCT(VDBDependencies, dep);
-            }
-
-            if (prm->paramBamHeader) {
-                rc_t rc3 = bam_header(db);
-                if (rc3 != 0 && rc == 0)
-                {   rc = rc3; }
-            }
-
-            if (prm->paramQuality) {
-                rc_t rc3 = qual_stats(prm, db);
-                if (rc3 != 0 && rc == 0)
-                {   rc = rc3; }
-            }
-        }
-
-    }
-
-    DESTRUCT(VSchema, schema);
-    DESTRUCT(KDBManager, kmgr);
-    DESTRUCT(VDBManager, mgr);
-    DESTRUCT(VDatabase, db);
-
-    return rc;
-}
-
-rc_t CC KMain(int argc, char* argv[]) {
-    rc_t rc = 0;
-    Args* args = NULL;
-
-    Params prm;
-    memset(&prm, 0, sizeof prm);
-
-    do {
-        uint32_t pcount = 0;
-
-        rc = ArgsMakeAndHandle(&args, argc, argv, 1,
-            Options, sizeof Options / sizeof (OptDef));
-        if (rc) {
-            LOGERR(klogErr, rc, "While calling ArgsMakeAndHandle");
-            break;
-        }
-        rc = ArgsParamCount(args, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "While calling ArgsParamCount");
-            break;
-        }
-        if (pcount < 1) {
-            MiniUsage(args);
-            DESTRUCT(Args, args);
-            exit(1);
-            break;
-        }
-        if (pcount > 1) {
-            rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcAmbiguous);
-            LOGERR(klogErr, rc, "Too many database parameters");
-            break;
-        }
-        rc = ArgsParamValue(args, 0, &prm.dbPath);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure retrieving database name");
-            break;
-        }
-
-        rc = ArgsOptionCount (args, OPTION_ALL, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_ALL "' argument");
-            break;
-        }
-        if (pcount)
-        {   prm.paramBamHeader = prm.paramQuality = prm.paramRef = true; }
-
-        rc = ArgsOptionCount (args, OPTION_BAM, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_BAM "' argument");
-            break;
-        }
-        if (pcount)
-        {   prm.paramBamHeader = true; }
-
-        rc = ArgsOptionCount (args, OPTION_QUA, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_QUA "' argument");
-            break;
-        }
-        if (pcount)
-        {   prm.paramQuality = true; }
-
-        rc = ArgsOptionCount (args, OPTION_REF, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_REF "' argument");
-            break;
-        }
-        if (pcount)
-        {   prm.paramRef = true; }
-
-        if (!prm.paramBamHeader && !prm.paramQuality && !prm.paramRef)
-        {   prm.paramRef = true; }
-    } while (false);
-
-    if (rc == 0)
-    {   rc = align_info(&prm); }
-
-    DESTRUCT(Args, args);
-    return rc;
-}
-
-/************************************* EOF ************************************/
diff --git a/tools/align-info/align-info.vers b/tools/align-info/align-info.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/align-info/align-info.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/bam-loader/Globals.h b/tools/bam-loader/Globals.h
deleted file mode 100644
index 50a0d9c..0000000
--- a/tools/bam-loader/Globals.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_GLOBALS_H_
-#define BAM_LOAD_GLOBALS_H_ 1
-
-enum LoaderModes {
-    mode_Archive,
-    mode_Analysis
-};
-
-typedef struct globals
-{
-    char const *inpath;
-    char const *outpath;
-    char const *tmpfs;
-    
-    struct KFile *noMatchLog;
-    
-    char const *schemaPath;
-    char const *schemaIncludePath;
-    
-    char const *refXRefPath;
-    
-    char const *QualQuantizer;
-    
-    char const *refFilter;
-
-    char const** refFiles; /* NULL-terminated array pointing to argv */
-    
-    char const *headerText;
-    
-    uint64_t maxAlignCount;
-    size_t cache_size;
-
-    unsigned errCount;
-    unsigned maxErrCount;
-    unsigned maxWarnCount_NoMatch;
-    unsigned maxWarnCount_DupConflict;
-    unsigned pid;
-    unsigned minMatchCount; /* minimum number of matches to count as an alignment */
-    int minMapQual;
-    enum LoaderModes mode;
-    uint32_t maxSeqLen;
-    bool omit_aligned_reads;
-    bool omit_reference_reads;
-    bool no_real_output;
-    bool expectUnsorted;
-    bool noVerifyReferences;
-    bool onlyVerifyReferences;
-    bool useQUAL;
-    bool limit2config;
-    bool editAlignedQual;
-    bool keepMismatchQual;
-    bool acceptBadDups; /* accept spots with inconsistent PCR duplicate flags */
-    bool acceptNoMatch; /* accept without any matching bases */
-    bool noSpotAssembly;
-    uint8_t alignedQualValue;
-    bool allUnaligned; /* treat all records as unaligned */
-    bool noColorSpace;
-    bool noSecondary;
-    bool hasTI;
-    bool acceptHardClip;
-} Globals;
-
-extern Globals G;
-#endif
diff --git a/tools/bam-loader/KFileHelper.c b/tools/bam-loader/KFileHelper.c
deleted file mode 100644
index b9c65c0..0000000
--- a/tools/bam-loader/KFileHelper.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "KFileHelper.h"
-#include <string.h>
-
-rc_t BufferedKFileGets(KDataBuffer *buf, unsigned offset, unsigned *nread, BufferedKFile *strm) {
-    unsigned i;
-    unsigned n;
-    int ch;
-    rc_t rc;
-    
-    do {
-        if (strm->cur != strm->inbuf) {
-            ch = strm->buf[strm->cur];
-            
-            if (ch == '\r' || ch == '\n')
-                ++strm->cur;
-            else
-                break;
-        }
-        else {
-            size_t numread;
-            
-            rc = KFileRead(strm->kfp, strm->fpos, strm->buf, sizeof(strm->buf), &numread);
-            if (rc) return -1;
-            
-            strm->cur = 0;
-            strm->inbuf = numread;
-            strm->fpos += numread;
-            if (numread == 0) {
-                *nread = 0;
-                return 0;
-            }
-        }
-    } while (1);
-    
-    for (n = 0, i = offset; ; ++i, ++n) {
-        if (strm->cur != strm->inbuf) {
-            ch = strm->buf[strm->cur++];
-        }
-        else {
-            size_t numread;
-            
-            rc = KFileRead(strm->kfp, strm->fpos, strm->buf, sizeof(strm->buf), &numread);
-            if (rc) return rc;
-            
-            strm->cur = 0;
-            strm->inbuf = numread;
-            if (numread == 0) break;
-            strm->fpos += numread;
-            ch = strm->buf[strm->cur++];
-        }
-        if (ch == '\r' || ch == '\n') break;
-        if (i >= buf->elem_count) {
-            rc = KDataBufferResize(buf, buf->elem_count ? buf->elem_count * 2 : 1024);
-            if (rc) return rc;
-        }
-        ((char *)buf->base)[i] = ch;
-    }
-    *nread = n;
-    return 0;
-}
-
-rc_t BufferedKFileOpen(const KDirectory *directory, BufferedKFile *rslt, const char *fileName, ...) {
-    va_list va;
-    rc_t rc;
-
-    memset(rslt, 0, sizeof(rslt) - sizeof(rslt->buf));
-
-    va_start(va, fileName);
-    rc = KDirectoryVOpenFileRead(directory, &rslt->kfp, fileName, va);
-    va_end(va);
-    
-    return rc;
-}
-
-rc_t BufferedKFileClose(BufferedKFile *strm) {
-    return KFileRelease(strm->kfp);
-}
-
-rc_t LoadFile(KDataBuffer *dst, uint64_t *lineCount, const KDirectory *dir, const char *fileName, ...) {
-    BufferedKFile strm;
-    rc_t rc;
-    unsigned line = 0;
-
-    memset(&strm, 0, sizeof(strm) - sizeof(strm.buf));
-    {
-        va_list va;
-
-        va_start(va, fileName);
-        rc = KDirectoryVOpenFileRead(dir, &strm.kfp, fileName, va);
-        va_end(va);
-    }
-    if (rc == 0) {
-        unsigned offset = 0;
-        unsigned i;
-        
-        while ((rc = BufferedKFileGets(dst, offset, &i, &strm)) == 0 && i) {
-            offset += i;
-            if (offset + 1 >= dst->elem_count) {
-                rc = KDataBufferResize(dst, offset + 1);
-                if (rc)
-                    break;
-            }
-            ((char *)dst->base)[offset++] = '\0';
-            ++line;
-        }
-        BufferedKFileClose(&strm);
-        if (rc == 0)
-            rc = KDataBufferResize(dst, offset);
-    }
-    if (rc != 0) {
-        KDataBufferResize(dst, 0);
-        line = 0;
-    }
-    if (lineCount) *lineCount = line;
-    return rc;
-}
diff --git a/tools/bam-loader/KFileHelper.h b/tools/bam-loader/KFileHelper.h
deleted file mode 100644
index 4551952..0000000
--- a/tools/bam-loader/KFileHelper.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_KFILEHELPER_H_
-#define BAM_LOAD_KFILEHELPER_H_ 1
-#include <klib/data-buffer.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-
-typedef struct BufferedKFile BufferedKFile;
-
-#define KFILE_BUF_SIZE (4096)
-struct BufferedKFile {
-    uint64_t fpos;
-    const KFile *kfp;
-    unsigned inbuf;
-    unsigned cur;
-    char buf[KFILE_BUF_SIZE];
-};
-
-rc_t BufferedKFileGets(KDataBuffer *buf, unsigned offset, unsigned *nread, BufferedKFile *strm);
-rc_t BufferedKFileOpen(const KDirectory *directory, BufferedKFile *rslt, const char *fileName, ...);
-rc_t BufferedKFileClose(BufferedKFile *strm);
-rc_t LoadFile(KDataBuffer *dst, uint64_t *lineCount, const KDirectory *dir, const char *fileName, ...);
-#endif
diff --git a/tools/bam-loader/KVPFile.c b/tools/bam-loader/KVPFile.c
deleted file mode 100644
index c9d60cd..0000000
--- a/tools/bam-loader/KVPFile.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "KVPFile.h"
-
-#include <kfs/file.h>
-#include <klib/rc.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define USE_KDB_BTREE 1
-
-#if USE_KDB_BTREE
-#include <kdb/btree.h>
-#else
-#include "hashtable.h"
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#endif
-
-
-
-#if USE_KDB_BTREE
-
-/* going to make an index with:                                                                        
- *  a) backing file                                                                                     
- *  b) page size is fixed at 32K, otherwise the page size would have to be stored somewhere             
- *  c) page cache - need cache limit in bytes                                                           
- *  d) 2 chunked value streams - need key chunking and value chunking                                   
- *  e) B-Tree-ish index, requiring a comparison function. this interface uses opaque keys.              
- *     the "matched-count" parameter is useful for trie traversal, but this will be built-in            
- */
-rc_t KVPFileMake ( KVPFile **rslt, KFile *file, size_t climit,
-    size_t kchunk_size, size_t vchunk_size,
-    size_t min_ksize, size_t max_ksize, size_t min_vsize, size_t max_vsize,
-    KVPFileCompareFunc cmp )
-{
-    return KBTreeMakeUpdate ( ( KBTree** ) rslt, file, climit, false, kbtOpaqueKey,
-        kchunk_size, vchunk_size, min_ksize, max_ksize, min_vsize, max_vsize, cmp );
-}
-
-
-/* this whacker works fine
- */
-rc_t KVPFileWhack ( KVPFile *xself, bool commit )
-{
-    KBTree *self = ( KBTree* ) xself;
-
-    rc_t rc = 0;
-
-    if ( self != NULL )
-    {
-        /* drop the backing file unless commiting */
-        if ( ! commit )
-            rc = KBTreeDropBacking ( self );
-
-        /* drop the b-tree */
-        rc = KBTreeRelease ( self );
-    }
-
-    return rc;
-}
-
-
-/* whacker */
-void KVPValueWhack ( KVPValue *self )
-{
-    KBTreeValueWhack ( self );
-}
-
-/* return the pointer to thingie */
-rc_t KVPValueAccessRead ( const KVPValue *self, const void **mem, size_t *bytes )
-{
-    return KBTreeValueAccessRead ( self, mem, bytes );
-}
-
-rc_t KVPValueAccessUpdate ( KVPValue *self, void **mem, size_t *bytes )
-{
-    return KBTreeValueAccessUpdate ( self, mem, bytes );
-}
-
-
-/* find will not modify the index in any way
- *  returns a pointer into a page, meaning that the values cannot exceed 32K in size
- *  this is done
- */
-rc_t KVPFileFind ( const KVPFile *self, KVPValue *val, const void *key, size_t ksize )
-{
-    return KBTreeFind ( ( const KBTree* ) self, val, key, ksize );
-}
-
-
-
-/* find or insert will return an existing or create a new entry
- * note that the new entry is initially zeroed
- */
-rc_t KVPFileFindOrInsert ( KVPFile *self, KVPValue *val,
-                          bool *was_inserted, size_t alloc_size,
-                          const void *key, size_t ksize )
-{
-    return KBTreeEntry ( ( KBTree* ) self, val, was_inserted, alloc_size, key, ksize );
-}
-
-rc_t KVPFileForEach ( const KVPFile *self,
-                      void ( CC * f )( const void *key, size_t ksize, KVPValue *val, void *ctx ),
-                      void *ctx )
-{
-    return KBTreeForEach((KBTree *)self, 0, f, ctx);
-}
-
-
-#else
-typedef struct KTempMMap {
-    void *base;
-    size_t sz;
-    int fd;
-    unsigned elemsize;
-    unsigned fileNo;
-} KTempMMap;
-
-static rc_t KTempMMapMake(KTempMMap *rslt, size_t initSize, size_t elemSize)
-{
-    char fname[4096];
-    
-    memset(rslt, 0, sizeof(*rslt));
-    rslt->elemsize = elemSize;
-    
-    sprintf(fname, "/tmp/kvp.%u.XXXXXX", getpid());
-    rslt->fd = mkstemp(fname);
-    if (rslt->fd < 0) {
-        perror(fname);
-        return RC(rcApp, rcFile, rcCreating, rcFile, rcUnknown);
-    }    
-    unlink(fname);
-
-    if (ftruncate(rslt->fd, initSize * elemSize) != 0)
-        return RC(rcApp, rcFile, rcResizing, rcFile, rcUnknown);
-    
-    rslt->sz = initSize;
-    
-    rslt->base = mmap(0, initSize * elemSize, PROT_READ | PROT_WRITE, MAP_SHARED, rslt->fd, 0);
-    if (rslt->base == MAP_FAILED)
-        return RC(rcApp, rcMemMap, rcCreating, rcMemory, rcInsufficient);
-    
-    return 0;
-}
-
-static rc_t KTempMMapWhack(KTempMMap *self)
-{
-    close(self->fd);
-    madvise(self->base, self->sz, MADV_DONTNEED);
-    munmap(self->base, self->sz);
-    return 0;
-}
-
-static void *KTempMMapPointer(KTempMMap *self, size_t offset, size_t count)
-{
-    void *temp;
-    size_t newsz;
-    
-    if (offset + count <= self->sz)
-        return &((uint8_t *)self->base)[offset * self->elemsize];
-
-    newsz = self->sz;
-    while (newsz < offset + count)
-        newsz <<= 1;
-    
-    if (ftruncate(self->fd, newsz * self->elemsize) != 0)
-        return NULL;
-
-    temp = mmap(0, newsz * self->elemsize, PROT_READ | PROT_WRITE, MAP_SHARED, self->fd, 0);
-    if (temp == MAP_FAILED)
-        return NULL;
-    
-    munmap(self->base, self->sz);
-    self->base = temp;
-    self->sz = newsz;
-    
-    return &((uint8_t *)self->base)[offset * self->elemsize];
-}
-
-typedef struct key_t {
-    uint8_t len;
-    char key[255];
-} my_key_t;
-
-struct KVPFile {
-    HashTable *ht;
-    size_t next_obj;
-    KTempMMap keys;
-    KTempMMap values;
-};
-
-typedef struct KVPValueImpl KVPValueImpl;
-struct KVPValueImpl
-{
-    KVPFile * file;
-    size_t offset;
-    size_t size;
-};
-
-static int KeyComp(const void *id, const void *key, uint32_t len, void *ctx)
-{
-    KVPFile *self = ctx;
-    const my_key_t *test = KTempMMapPointer(&self->keys, (intptr_t)id, 1);
-    int r = memcmp(test->key, key, test->len < len ? test->len : len);
-    if (r == 0)
-        r = test->len - len;
-    return r;
-}
-
-rc_t KVPFileMake(KVPFile **rslt,
-                 KFile *file,
-                 size_t climit,
-                 size_t kchunk_size, size_t vchunk_size,
-                 size_t min_ksize, size_t max_ksize,
-                 size_t min_vsize, size_t max_vsize,
-                 KVPFileCompareFunc cmp
-                 )
-{
-    rc_t rc;
-    KVPFile *self = calloc(1, sizeof(*self));
-    
-    if (self == NULL)
-        return RC(rcApp, rcMemMap, rcAllocating, rcMemory, rcExhausted);
-    
-    rc = KTempMMapMake(&self->keys, 256, sizeof(my_key_t));
-    if (rc == 0) {
-        rc = KTempMMapMake(&self->values, 256, max_vsize);
-        if (rc == 0) {
-            rc = HashTableMake(&self->ht, 256, KeyComp, self);
-            if (rc == 0) {
-                *rslt = self;
-                return 0;
-            }
-            KTempMMapWhack(&self->values);
-        }
-        KTempMMapWhack(&self->keys);
-    }
-    free(self);
-    return rc;
-}
-
-rc_t KVPFileWhack(KVPFile *self, bool commit)
-{
-    if (self) {
-        KTempMMapWhack(&self->values);
-        KTempMMapWhack(&self->keys);
-        HashTableWhack(self->ht, 0, 0);
-        free(self);
-    }
-    return 0;
-}
-
-rc_t KVPFileFind(const KVPFile *self, KVPValue *xval, const void *key, size_t ksize)
-{
-    KVPValueImpl *val = ( KVPValueImpl* ) xval;
-    const HashTableIterator iter = HashTableLookup(self->ht, key, ksize);
-    if (HashTableIteratorHasValue(&iter)) {
-        val->file = (void *)self;
-        val->offset = (intptr_t)HashTableIteratorGetValue(&iter);
-        val->size = 1;
-        return 0;
-    }
-    return RC(rcApp, rcMemMap, rcReading, rcId, rcNotFound);
-}
-
-rc_t KVPFileFindOrInsert(KVPFile *self, KVPValue *xval,
-                         bool *was_inserted, size_t alloc_size,
-                         const void *key, size_t ksize
-                         )
-{
-    KVPValueImpl *val = ( KVPValueImpl* ) xval;
-    HashTableIterator iter = HashTableLookup(self->ht, key, ksize);
-    
-    if (HashTableIteratorHasValue(&iter)) {
-        val->file = (void *)self;
-        val->offset = (intptr_t)HashTableIteratorGetValue(&iter);
-        val->size = 1;
-        *was_inserted = false;
-        return 0;
-    }
-    else {
-        size_t new_id = self->next_obj++;
-        my_key_t *new_key = KTempMMapPointer(&self->keys, new_id, 1);
-        
-        new_key->len = ksize;
-        memcpy(new_key->key, key, ksize);
-        
-        *was_inserted = true;
-        val->file = (void *)self;
-        val->offset = new_id;
-        val->size = 1;
-        HashTableIteratorSetValue(&iter, (void *)(val->offset));
-    }
-    return 0;
-}
-
-static rc_t KVPValueAccess(const KVPValueImpl *value, void **mem, size_t *bytes)
-{
-    KVPFile *self = value->file;
-    void *temp = KTempMMapPointer(&self->values, value->offset, value->size);
-    
-    if (temp != NULL) {
-        *bytes = self->values.elemsize * value->size;
-        *mem = temp;
-        return 0;
-    }
-    *bytes = 0;
-    *mem = NULL;
-    return RC(rcApp, rcMemMap, rcReading, rcMemory, rcNotFound);
-}
-
-rc_t KVPValueAccessRead(const KVPValue *self, const void **mem, size_t *bytes)
-{
-    return KVPValueAccess((const KVPValueImpl*)self, (void **)mem, bytes);
-}
-
-rc_t KVPValueAccessUpdate(KVPValue *self, void **mem, size_t *bytes)
-{
-    return KVPValueAccess((KVPValueImpl*)self, mem, bytes);
-}
-
-void KVPValueWhack(KVPValue *self)
-{
-}
-
-#endif /* USE_KDB_BTREE */
diff --git a/tools/bam-loader/KVPFile.h b/tools/bam-loader/KVPFile.h
deleted file mode 100644
index 01de157..0000000
--- a/tools/bam-loader/KVPFile.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_KVPFile_
-#define _h_KVPFile_
-
-#ifndef _h_kdb_btree_
-#include <kdb/btree.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* this can be made to work as we go forward
- */
-typedef struct KVPFile KVPFile;
-
-
-/* generic comparison function
- *  size_t indicates bytes
- */
-typedef KBTreeCompareFunc KVPFileCompareFunc;
-
-
-/* going to make an index with:                                                                        
- *  a) backing file                                                                                     
- *  b) page size is fixed at 32K, otherwise the page size would have to be stored somewhere             
- *  c) page cache - need cache limit in bytes                                                           
- *  d) 2 chunked value streams - need key chunking and value chunking                                   
- *  e) B-Tree-ish index, requiring a comparison function. this interface uses opaque keys.              
- *     the "matched-count" parameter is useful for trie traversal, but this will be built-in            
- *                                                                                                      
- *  "rslt" [ OUT ] - return of Ken's object                                                             
- *                                                                                                      
- *  "file" [ IN ] - open file with read/write permissions.                                              
- *   NB - a reference will be attached to this file, so you still own it                                
- *                                                                                                      
- *  "climit" [ IN ] - cache limit in bytes. the internal page cache will                                
- *   retain UP TO ( but not exceeding ) the limit specified. for 32K pages,                             
- *   this means than the byte values 0..0x7FFF will result in NO CACHE.                                 
- *   internally, this limit is converted to a page count by simple division,                            
- *   i.e. cpage-limit = climit / PGSIZE.                                                                
- *                                                                                                      
- *  "kchunk_size" [ IN ] and "vchunk_size" [ IN ] - the "chunking" ( alignment )                        
- *   factor for storing keys and values, respectively. rounded up to the nearest                        
- *   power of 2 that will hold the bytes specified.                                                     
- *                                                                                                      
- *  "min_ksize" [ IN ] and "max_ksize" [ IN ] - specifies the allowed key sizes. if                     
- *   unknown, a min of 1 and a max of ~ ( size_t ) 0 will allow for any size. if fixed,                 
- *   min_ksize == max_ksize will indicate this, and the size will be used exactly as                    
- *   chunking factor ( see "kchunk_size" above ).                                                       
- *                                                                                                      
- *  "min_vsize" [ IN ] and "max_vsize" [ IN ] - specifies allowed value sizes. see above.               
- *                                                                                                      
- *  "cmp" [ IN ] - comparison callback function for opaque keys. later, we'll want to                   
- *   make use of key type knowledge to improve traversal ( callbacks are expensive ), but               
- *   for now, we can treat them as opaque.                                                              
- */
-rc_t KVPFileMake ( KVPFile **rslt, struct KFile *file, size_t climit,
-                  size_t kchunk_size, size_t vchunk_size,
-                  size_t min_ksize, size_t max_ksize, size_t min_vsize, size_t max_vsize,
-                  KVPFileCompareFunc cmp );
-
-
-
-/* this whacker works fine
- *
- * "commit" [ IN ] - if false, tells the underlying pagefile
- *  to forget its backing before whacking the cache.
- */
-rc_t KVPFileWhack ( KVPFile *self, bool commit );
-
-
-/* results point directly into pages, and thus require a reference
- * I'm going to invent a structure to use and some functions - the
- * structure itself may change, but we should be able to make it work
- *
- * it will be an defined structure, although it may be defined simply as
- * an array of 3 size_t to make it opaque. if it were made an allocation,
- * then we'd have to have a special allocator in order to keep the noise
- * down. maybe that's the way to go, but it means more code. for now,...
- */
-typedef struct KBTreeValue KVPValue;
-
-
-/* whacker */
-void KVPValueWhack ( KVPValue *self );
-
-/* return the pointer to thingie */
-rc_t KVPValueAccessRead ( const KVPValue *self, const void **mem, size_t *bytes );
-rc_t KVPValueAccessUpdate ( KVPValue *self, void **mem, size_t *bytes );
-
-
-/* find will not modify the index in any way
- *  returns a pointer into a page, meaning that the values cannot exceed 32K in size
- *  this is done
- *
- *  "val" [ OUT ] - pointer to an uninitialized block that will contain
- *   information on how to access data within a page. note that the value
- *   is "live", and if accessed for update will cause the page to be modified.
- *   it is not clear whether this is desired or side-effect behavior, so I'm
- *   leaving it alone for now.
- *
- *  "key" [ IN ] and "ksize" [ IN ] - opaque key description
- */
-rc_t KVPFileFind ( const KVPFile *self, KVPValue *val, const void *key, size_t ksize );
-
-
-
-/* find or insert will return an existing or create a new entry
- * note that the new entry is initially zeroed
- *
- *  "val" [ OUT ] - pointer to uninitialized block that will contain value data.
- *   since the intention is to modify the value, access to val will most certainly
- *   be via "KVPValueAccessUpdate" which will dirty the page regardless.
- *
- *  "was_inserted" [ OUT ] - if true, the returned value was the result of an
- *   insertion and can be guaranteed to be all 0 bits. otherwise, the returned
- *   value will be whatever was there previously.
- *
- *  "alloc_size" [ IN ] - the number of value bytes to allocate upon insertion,
- *   i.e. if the key was not found. this value must agree with the limits specified
- *   in Make.
- *
- *  "key" [ IN ] and "ksize" [ IN ] - opaque key description
- */
-rc_t KVPFileFindOrInsert ( KVPFile *self, KVPValue *val,
-                          bool *was_inserted, size_t alloc_size,
-                          const void *key, size_t ksize );
-
-rc_t KVPFileForEach ( const KVPFile *self,
-    void ( CC * f )( const void *key, size_t ksize, KVPValue *val, void *ctx ),
-    void *ctx);
-    
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_KVPFile_ */
diff --git a/tools/bam-loader/Makefile b/tools/bam-loader/Makefile
deleted file mode 100644
index 8de8ae4..0000000
--- a/tools/bam-loader/Makefile
+++ /dev/null
@@ -1,101 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/bam-loader
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	bam-load
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-ifeq (win,$(OS))
-all std:
-	@ echo "not building bam-load under Windows"
-else
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-endif
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# bam-load.2.*
-#
-BAMLOAD_SRC = \
-	bam-loader \
-	alignment-writer \
-	reference-writer \
-	sequence-writer \
-	loader-imp
-
-BAMLOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(BAMLOAD_SRC))
-
-BAMLOAD_LIB = \
-	-lkapp \
-	-lload \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/bam-load: $(BAMLOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(BAMLOAD_LIB)
diff --git a/tools/bam-loader/alignment-writer.c b/tools/bam-loader/alignment-writer.c
deleted file mode 100644
index fe84dc8..0000000
--- a/tools/bam-loader/alignment-writer.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sysalloc.h>
-#include <klib/out.h>
-
-#include <vdb/vdb-priv.h>
-
-#include "alignment-writer.h"
-#include "Globals.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-enum e_tables {
-    tblPrimary,
-    tblSecondary,
-    tblN
-};
-
-struct s_alignment {
-    VDatabase *db;
-    TableWriterAlgn const *tbl[tblN];
-    int64_t rowId;
-    int st;
-};
-
-Alignment *AlignmentMake(VDatabase *db) {
-    Alignment *self = calloc(1, sizeof(*self));
-    
-    if (self) {
-        self->db = db;
-        VDatabaseAddRef(self->db);
-    }
-    return self;
-}
-
-static rc_t SetColumnDefaults(TableWriterAlgn const *tbl)
-{
-    return 0;
-}
-
-static rc_t WritePrimaryRecord(Alignment *const self, AlignmentRecord *const data)
-{
-    if (self->tbl[tblPrimary] == NULL) {
-        rc_t rc = TableWriterAlgn_Make(&self->tbl[tblPrimary], self->db,
-                                       ewalgn_tabletype_PrimaryAlignment,
-                                       ewalgn_co_TMP_KEY_ID + 
-                                       (G.expectUnsorted ? ewalgn_co_unsorted : 0));
-        if (rc)
-            return rc;
-        rc = SetColumnDefaults(self->tbl[tblPrimary]);
-        if (rc)
-            return rc;
-    }
-    return TableWriterAlgn_Write(self->tbl[tblPrimary], &data->data, &data->alignId);
-}
-
-static rc_t WriteSecondaryRecord(Alignment *const self, AlignmentRecord *const data)
-{
-    if (self->tbl[tblSecondary] == NULL) {
-        rc_t rc = TableWriterAlgn_Make(&self->tbl[tblSecondary], self->db,
-                                       ewalgn_tabletype_SecondaryAlignment,
-                                       ewalgn_co_TMP_KEY_ID + 
-                                       (G.expectUnsorted ? ewalgn_co_unsorted : 0));
-        if (rc)
-            return rc;
-        rc = SetColumnDefaults(self->tbl[tblSecondary]);
-        if (rc)
-            return rc;
-    }
-#if 1
-    /* try to make consistent with cg-load */
-    if (data->mate_ref_pos == 0) {
-        data->data.mate_ref_orientation.elements = 0;
-    }
-#endif
-    return TableWriterAlgn_Write(self->tbl[tblSecondary], &data->data, &data->alignId);
-}
-
-rc_t AlignmentWriteRecord(Alignment *const self, AlignmentRecord *const data)
-{
-    return data->isPrimary ? WritePrimaryRecord(self, data) : WriteSecondaryRecord(self, data);
-}
-
-rc_t AlignmentStartUpdatingSpotIds(Alignment *const self)
-{
-    return 0;
-}
-
-rc_t AlignmentGetSpotKey(Alignment *const self, uint64_t * keyId)
-{
-    rc_t rc;
-    
-    switch (self->st) {
-    case 0:
-        rc = TableWriterAlgn_TmpKeyStart(self->tbl[tblPrimary]);
-        if (rc)
-            break;
-        self->rowId = 0;
-        ++self->st;
-    case 1:
-        rc = TableWriterAlgn_TmpKey(self->tbl[tblPrimary], ++self->rowId, keyId);
-        if (rc == 0)
-            break;
-        ++self->st;
-        if (GetRCState(rc) != rcNotFound || GetRCObject(rc) != rcRow || self->tbl[tblSecondary] == NULL)
-            break;
-    case 2:
-        rc = TableWriterAlgn_TmpKeyStart(self->tbl[tblSecondary]);
-        if (rc)
-            break;
-        self->rowId = 0;
-        ++self->st;
-    case 3:
-        rc = TableWriterAlgn_TmpKey(self->tbl[tblSecondary], ++self->rowId, keyId);
-        if (rc == 0)
-            break;
-        if (GetRCState(rc) != rcNotFound || GetRCObject(rc) != rcRow)
-            break;
-        ++self->st;
-        break;
-    default:
-        rc = RC(rcAlign, rcTable, rcUpdating, rcError, rcIgnored);
-        break;
-    }
-    return rc;
-}
-
-rc_t AlignmentWriteSpotId(Alignment * const self, int64_t const spotId)
-{
-    switch (self->st) {
-    case 1:
-        return TableWriterAlgn_Write_SpotId(self->tbl[tblPrimary], self->rowId, spotId);
-    case 3:
-        return TableWriterAlgn_Write_SpotId(self->tbl[tblSecondary], self->rowId, spotId);
-    default:
-        return RC(rcAlign, rcTable, rcUpdating, rcSelf, rcInconsistent);
-    }
-}
-
-rc_t AlignmentWhack(Alignment * const self, bool const commit) 
-{
-    rc_t const rc = TableWriterAlgn_Whack(self->tbl[tblPrimary], commit, NULL);
-    rc_t const rc2 = self->tbl[tblSecondary] ? TableWriterAlgn_Whack(self->tbl[tblSecondary], commit | (rc == 0), NULL) : 0;
-
-    VDatabaseRelease(self->db);
-    free(self);
-    return rc ? rc : rc2;
-}
diff --git a/tools/bam-loader/alignment-writer.h b/tools/bam-loader/alignment-writer.h
deleted file mode 100644
index bd8dfed..0000000
--- a/tools/bam-loader/alignment-writer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_ALIGNMENT_WRITER_H_
-#define BAM_LOAD_ALIGNMENT_WRITER_H_ 1
-
-#include <klib/text.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <insdc/insdc.h>
-
-#include <align/writer-alignment.h>
-
-typedef struct s_alignment Alignment;
-typedef struct AlignmentRecord AlignmentRecord;
-
-struct AlignmentRecord {
-    TableWriterAlgnData data;
-    int64_t alignId;
-    bool isPrimary;
-
-    INSDC_coord_one read_id;
-    int64_t ref_id;
-    INSDC_coord_zero ref_start;
-    uint64_t global_ref_start;
-    bool ref_orientation;
-    uint32_t mapq;
-    uint64_t tmp_key_id;
-
-    INSDC_coord_zero read_start;
-    INSDC_coord_len read_len;
-
-    bool mate_ref_orientation;
-    int64_t mate_ref_id;
-    INSDC_coord_zero mate_ref_pos;
-    int64_t mate_align_id;
-    int32_t template_len;
-};
-
-#define AR_REF_ID(X) ((X).ref_id)
-#define AR_REF_START(X) ((X).global_ref_start)
-#define AR_REF_LEN(X) ((X).ref_len)
-#define AR_REF_ORIENT(X) ((X).ref_orientation)
-#define AR_READNO(X) ((X).read_id)
-#define AR_MAPQ(X) ((X).mapq)
-#define AR_KEY(X) ((X).tmp_key_id)
-
-#define AR_BASECOUNT(X) ((X).data.has_mismatch.elements)
-#define AR_HAS_MISMATCH(X) ((bool *)((X).data.has_mismatch.buffer))
-#define AR_HAS_OFFSET(X) ((bool *)((X).data.has_ref_offset.buffer))
-
-#define AR_NUM_MISMATCH(X) ((X).data.mismatch.elements)
-#define AR_MISMATCH(X) ((char *)((X).data.mismatch.buffer))
-
-#define AR_NUM_OFFSET(X) ((X).data.ref_offset.elements)
-#define AR_OFFSET(X) ((INSDC_coord_zero *)((X).data.ref_offset.buffer))
-
-Alignment *AlignmentMake(VDatabase *db);
-
-rc_t AlignmentWriteRecord(Alignment *self, AlignmentRecord *data);
-
-rc_t AlignmentStartUpdatingSpotIds(Alignment *self);
-
-rc_t AlignmentGetSpotKey(Alignment *self, uint64_t *keyId);
-
-rc_t AlignmentWriteSpotId(Alignment *self, int64_t spotId);
-
-rc_t AlignmentWhack(Alignment *self, bool commit);
-
-#endif
diff --git a/tools/bam-loader/analysis.c b/tools/bam-loader/analysis.c
deleted file mode 100644
index cccc329..0000000
--- a/tools/bam-loader/analysis.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/data-buffer.h>
-#include <klib/sort.h>
-
-#include "KFileHelper.h"
-#include "analysis.h"
-#include "Globals.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-static rc_t ParseAnalysis(Analysis *rslt, unsigned lines, char *src) {
-    unsigned i;
-    
-    rslt->N = lines;
-    memset(&rslt->line[0], 0, lines * sizeof(rslt->line[0]));
-    
-    for (i = 0; i != lines; ++i) {
-        char *endp;
-        char *tab;
-        
-        endp = strchr(src, 0);
-        assert(endp);
-        
-        rslt->line[i].name = src;
-        tab = strchr(src, '\t');
-        if (!tab) break;
-        src = tab + 1;
-        tab[0] = '\0';
-        
-        rslt->line[i].refID = src;
-        tab = strchr(src, '\t');
-        if (!tab) break;
-        src = tab + 1;
-        tab[0] = '\0';
-        
-        tab = strchr(src, '\t');
-        if (!tab) break;
-        src = tab + 1;
-        
-        rslt->line[i].bamFile = src;
-        tab = strchr(src, '\t');
-        if (!tab) break;
-        src = tab + 1;
-        tab[0] = '\0';
-        
-        rslt->line[i].asoFile = src;
-        tab = strchr(src, '\t');
-        if (!tab) break;
-        tab[0] = '\0';
-        
-        src = endp + 1;
-    }
-    for (i = 0; i != lines; ++i) {
-        if (rslt->line[i].name == NULL ||
-            rslt->line[i].refID == NULL ||
-            rslt->line[i].bamFile == NULL ||
-            rslt->line[i].asoFile == NULL
-            )
-        {
-            return RC(rcApp, rcFile, rcReading, rcData, rcCorrupt);
-        }
-    }
-    return 0;
-}
-
-static int CC CompAnalysisLineBamFile(const void *A, const void *B, void *ignore) {
-    const AnalysisLine *a = A;
-    const AnalysisLine *b = B;
-    int rslt = strcmp(a->bamFile, b->bamFile);
-    
-    if (rslt == 0)
-        rslt = strcmp(a->name, b->name);
-    return rslt;
-}
-
-const char *AnalysisNextBAMFile(const char *last) {
-    unsigned i;
-    if (last == NULL) {
-        return G.analysis->line[0].bamFile;
-    }
-    for (i = 1; i < G.analysis->N; ++i) {
-        if (strcmp(last, G.analysis->line[i].bamFile) > 0) {
-            return G.analysis->line[i].bamFile;
-        }
-    }
-    return NULL;
-}
-
-AnalysisLine *AnalysisMatch(const char *bamFile, const char *name) {
-    unsigned i;
-    
-    for (i = 0; i != G.analysis->N; ++i) {
-        if (strcmp(bamFile, G.analysis->line[i].bamFile) == 0 &&
-            strcmp(name, G.analysis->line[i].name) == 0
-            )
-        {
-            return &G.analysis->line[i];
-        }
-    }
-    return NULL;
-}
-
-rc_t LoadAnalysis(const char *fileName) {
-    rc_t rc;
-    KDataBuffer buf;
-    uint64_t lines;
-    
-    memset(&buf, 0, sizeof(buf));
-    buf.elem_bits = 8;
-    
-    rc = LoadFile(&buf, &lines, G.inDir, fileName);
-    if (rc == 0) {
-        if (lines > 0 && buf.elem_count > 0) {
-            G.analysis = malloc(sizeof(*G.analysis) + (lines - 1) * sizeof(G.analysis->line[0]) + buf.elem_count);
-            if (G.analysis)
-                memcpy(&G.analysis->line[lines], buf.base, buf.elem_count);
-            else
-                rc = RC(rcApp, rcFile, rcReading, rcMemory, rcExhausted);
-        }
-        else
-            rc = RC(rcApp, rcFile, rcReading, rcData, rcEmpty);
-    }
-    KDataBufferWhack(&buf);
-    if (rc == 0) {
-        rc = ParseAnalysis(G.analysis, lines, (char *)&G.analysis->line[lines]);
-    }
-    return rc;
-}
-
diff --git a/tools/bam-loader/analysis.h b/tools/bam-loader/analysis.h
deleted file mode 100644
index 766a652..0000000
--- a/tools/bam-loader/analysis.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_ANALYSIS_H_
-#define BAM_LOAD_ANALYSIS_H_ 1
-#include <klib/rc.h>
-
-typedef struct s_analysis_line {
-    const char *name;
-    const char *refID;
-    const char *bamFile;
-    const char *asoFile;
-    uint64_t    startPos;
-} AnalysisLine;
-
-typedef struct s_analysis {
-    unsigned N;
-    AnalysisLine line[1];
-} Analysis;
-
-const char *AnalysisNextBAMFile(const char *last);
-
-AnalysisLine *AnalysisMatch(const char *bamFile, const char *name);
-
-rc_t LoadAnalysis(const char *fileName);
-#endif
diff --git a/tools/bam-loader/bam-load.vers b/tools/bam-loader/bam-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/bam-loader/bam-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/bam-loader/bam-loader.c b/tools/bam-loader/bam-loader.c
deleted file mode 100644
index 3d4ab92..0000000
--- a/tools/bam-loader/bam-loader.c
+++ /dev/null
@@ -1,987 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "bam-load.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kapp/log-xml.h>
-#include <align/writer-refseq.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <limits.h>
-
-#include "Globals.h"
-#include "loader-imp.h"
-
-/* MARK: Arguments and Usage */
-static char const option_input[] = "input";
-static char const option_output[] = "output";
-static char const option_tmpfs[] = "tmpfs";
-static char const option_config[] = "config";
-static char const option_min_mapq[] = "min-mapq";
-static char const option_qual_compress[] = "qual-quant";
-static char const option_cache_size[] = "cache-size";
-static char const option_unsorted[] = "unsorted";
-static char const option_max_err_count[] = "max-err-count";
-static char const option_max_rec_count[] = "max-rec-count";
-static char const option_no_verify[] = "no-verify";
-static char const option_only_verify[] = "only-verify";
-static char const option_use_qual[] = "use-QUAL";
-static char const option_ref_filter[] = "ref-filter";
-static char const option_ref_config[] = "ref-config";
-static char const option_edit_aligned_qual[] = "edit-aligned-qual";
-static char const option_unaligned[] = "unaligned";
-static char const option_accept_dup[] = "accept-dups";
-static char const option_accept_nomatch[] = "accept-nomatch";
-static char const option_nomatch_log[] = "nomatch-log";
-static char const option_keep_mismatch_qual[] = "keep-mismatch-qual";
-static char const option_min_match[] = "minimum-match";
-static char const option_header[] = "header";
-static char const option_no_cs[] = "no-cs";
-static char const option_no_secondary[] = "no-secondary";
-static char const option_ref_file[] = "ref-file";
-static char const option_TI[] = "TI";
-static char const option_max_warn_dup_flag[] = "max-warning-dup-flag";
-static char const option_accept_hard_clip[] = "accept-hard-clip";
-
-#define OPTION_INPUT option_input
-#define OPTION_OUTPUT option_output
-#define OPTION_TMPFS option_tmpfs
-#define OPTION_CONFIG option_config
-#define OPTION_MINMAPQ option_min_mapq
-#define OPTION_QCOMP option_qual_compress
-#define OPTION_CACHE_SIZE option_cache_size
-#define OPTION_MAX_ERR_COUNT option_max_err_count
-#define OPTION_MAX_REC_COUNT option_max_rec_count
-#define OPTION_UNALIGNED option_unaligned
-#define OPTION_ACCEPT_DUP option_accept_dup
-#define OPTION_ACCEPT_NOMATCH option_accept_nomatch
-#define OPTION_NOMATCH_LOG option_nomatch_log
-#define OPTION_MIN_MATCH option_min_match
-#define OPTION_HEADER option_header
-#define OPTION_NO_CS option_no_cs
-#define OPTION_NO_SECONDARY option_no_secondary
-#define OPTION_REF_FILE option_ref_file
-#define OPTION_TI option_TI
-#define OPTION_MAX_WARN_DUP_FLAG option_max_warn_dup_flag
-#define OPTION_ACCEPT_HARD_CLIP option_accept_hard_clip
-
-#define ALIAS_INPUT  "i"
-#define ALIAS_OUTPUT "o"
-#define ALIAS_TMPFS "t"
-#define ALIAS_CONFIG "k"
-#define ALIAS_MINMAPQ "q"
-#define ALIAS_QCOMP "Q"
-#define ALIAS_MAX_ERR_COUNT "E"
-#define ALIAS_UNALIGNED "u"
-#define ALIAS_ACCEPT_DUP "d"
-#define ALIAS_NO_SECONDARY "P"
-#define ALIAS_REF_FILE "r"
-
-static
-char const * input_usage[] = 
-{
-    "Path where to get fasta files from.",
-    NULL
-};
-
-static
-char const * output_usage[] = 
-{
-    "Path and Name of the output database.",
-    NULL
-};
-
-static
-char const * tmpfs_usage[] = 
-{
-    "Path to be used for scratch files.",
-    NULL
-};
-
-static
-char const * config_usage[] = 
-{
-    "Path to configuration file:",
-    "maps the input BAM file's reference names to the equivalent GenBank accession.",
-    "It is a tab-delimited text file with unix line endings (\\n - LF) with the following fields in this order:",
-    "#1 reference name as it occurs in the BAM file's SN field of @SQ header record;",
-    "#2 INSDC reference ID",
-    NULL
-};
-
-static
-char const * min_mapq_usage[] = 
-{
-    "Minimum mapping quality to be considered an alignment.",
-    NULL
-};
-
-static
-char const * qcomp_usage[] = 
-{
-    "Quality scores quantization level, can be a number (0: none, 1: 2bit, 2: 1bit), or a string like '1:10,10:20,20:30,30:-' (which is equivalent to 1) (nb. the endpoint is exclusive).",
-    NULL
-};
-
-static
-char const * unsorted_usage[] = 
-{
-    "Tell the loader to expect unsorted input (requires more memory)",
-    NULL
-};
-
-static
-char const * cache_size_usage[] = 
-{
-    "Set the cache size in MB for the temporary indices",
-    NULL
-};
-
-static
-char const * mrc_usage[] = 
-{
-    "Set the maximum number of records to process from the BAM file",
-    NULL
-};
-
-static
-char const * mec_usage[] = 
-{
-    "Set the maximum number of errors to ignore from the BAM file",
-    NULL
-};
-
-static
-char const * no_verify_usage[] = 
-{
-    "Skip verify existence of references from the BAM file",
-    NULL
-};
-
-static
-char const * only_verify_usage[] = 
-{
-    "Exit after verifying existence of references from the BAM file",
-    NULL
-};
-
-static
-char const * use_QUAL_usage[] = 
-{
-    "use QUAL column for quality values (default is to use OQ if it is available)",
-    NULL
-};
-
-static
-char const * use_ref_filter[] = 
-{
-    "Only process alignments to the given reference",
-    NULL
-};
-
-static
-char const * use_ref_config[] = 
-{
-    "Only process alignments to references in the config file",
-    NULL
-};
-
-static
-char const * use_edit_aligned_qual[] = 
-{
-    "Convert quality at aligned positions to this value",
-    NULL
-};
-
-static
-char const * use_keep_mismatch_qual[] = 
-{
-    "Don't quantized quality at mismatched positions",
-    NULL
-};
-
-static
-char const * use_unaligned[] = 
-{
-    "Specify file without aligned reads",
-    NULL
-};
-
-static
-char const * use_accept_dups[] = 
-{
-    "Accept spots inconsistent PCR duplicate flags",
-    NULL
-};
-
-static
-char const * use_accept_nomatch[] = 
-{
-    "Accept alignments with no matching bases",
-    NULL
-};
-
-static
-char const * use_nomatch_log[] = 
-{
-    "Where to write info for alignments with no matching bases",
-    NULL
-};
-
-static
-char const * use_min_match[] = 
-{
-    "minimum number of matches for an alignment",
-    NULL
-};
-
-static
-char const * use_header[] = 
-{
-    "path to a file containing the SAM header to store in the resulting cSRA, recommended in case of multiple input BAMs",
-    NULL
-};
-
-static
-char const * use_no_cs[] = 
-{
-    "turn off awareness of colorspace",
-    NULL
-};
-
-static
-char const * use_no_secondary[] = 
-{
-    "ignore alignments marked as secondary",
-    NULL
-};
-
-static
-char const * use_ref_file[] = 
-{
-    "path to a fasta file with references",
-    NULL
-};
-
-static
-char const * use_TI[] = 
-{
-    "for trace alignments",
-    NULL
-};
-
-static
-char const * use_max_dup_warnings[] = 
-{
-    "set limit for number of duplicate flag mismatch warnings",
-    NULL
-};
-
-static
-char const * use_accept_hard_clip[] = 
-{
-    "accept hard clipping in CIGAR",
-    NULL
-};
-
-OptDef Options[] = 
-{
-    /* order here is same as in param array below!!! */
-    { OPTION_INPUT, ALIAS_INPUT,  NULL,  input_usage, 1, true,  false },
-    { OPTION_OUTPUT, ALIAS_OUTPUT, NULL, output_usage, 1, true,  true },
-    { OPTION_CONFIG, ALIAS_CONFIG,  NULL,  config_usage, 1, true, false },
-    { OPTION_HEADER, NULL, NULL, use_header, 1, true, false },
-    { OPTION_TMPFS, ALIAS_TMPFS, NULL, tmpfs_usage, 1, true,  false },
-    { OPTION_UNALIGNED, ALIAS_UNALIGNED, NULL, use_unaligned, 256, true, false },
-    { OPTION_ACCEPT_DUP, ALIAS_ACCEPT_DUP, NULL, use_accept_dups, 1, false, false },
-    { OPTION_ACCEPT_NOMATCH, NULL, NULL, use_accept_nomatch, 1, false, false },
-    { OPTION_NOMATCH_LOG, NULL, NULL, use_nomatch_log, 1, true, false },
-    { OPTION_QCOMP, ALIAS_QCOMP, NULL, qcomp_usage, 1, true,  false },
-    { OPTION_MINMAPQ, ALIAS_MINMAPQ, NULL, min_mapq_usage, 1, true,  false },
-    { OPTION_CACHE_SIZE, NULL, NULL, cache_size_usage, 1, true,  false },
-    { OPTION_NO_CS, NULL, NULL, use_no_cs, 1, false,  false },
-    { OPTION_MIN_MATCH, NULL, NULL, use_min_match, 1, true, false },
-    { OPTION_NO_SECONDARY, ALIAS_NO_SECONDARY, NULL, use_no_secondary, 1, false, false },
-    { option_unsorted, NULL, NULL, unsorted_usage, 1, false,  false },
-    { option_no_verify, NULL, NULL, no_verify_usage, 1, false,  false },
-    { option_only_verify, NULL, NULL, only_verify_usage, 1, false,  false },
-    { option_use_qual, NULL, NULL, use_QUAL_usage, 1, false,  false },
-    { option_ref_config, NULL, NULL, use_ref_config, 1, false,  false },
-    { option_ref_filter, NULL, NULL, use_ref_filter, 1, true,  false },
-    { option_edit_aligned_qual, NULL, NULL, use_edit_aligned_qual, 1, true, false },
-    { option_keep_mismatch_qual, NULL, NULL, use_keep_mismatch_qual, 1, false,  false },
-    { OPTION_MAX_REC_COUNT, NULL, NULL, mrc_usage, 1, true,  false },
-    { OPTION_MAX_ERR_COUNT, ALIAS_MAX_ERR_COUNT, NULL, mec_usage, 1, true,  false },
-    { OPTION_REF_FILE, ALIAS_REF_FILE, NULL, use_ref_file, 0, true, false },
-    { OPTION_TI, NULL, NULL, use_TI, 1, false, false },
-    { OPTION_MAX_WARN_DUP_FLAG, NULL, NULL, use_max_dup_warnings, 1, true, false },
-    { OPTION_ACCEPT_HARD_CLIP, NULL, NULL, use_accept_hard_clip, 1, false, false }
-};
-
-const char* OptHelpParam[] =
-{
-    /* order here is same as in OptDef array above!!! */
-    "path",
-    "path",
-    "path-to-file",
-    "path-to-file",
-    "path",
-    "path-to-file",
-    NULL,
-    NULL,
-    NULL,
-    "level",
-    "phred-score",
-    "mbytes",
-    NULL,
-    "count",
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    "name",
-    "new-value",
-    NULL,
-    NULL,
-    NULL,
-    "path-to-file",
-    NULL,
-    "count",
-    NULL
-};
-
-rc_t UsageSummary (char const * progname)
-{
-    return KOutMsg (
-        "Usage:\n"
-        "\t%s [options] <bam-file>\n"
-        "\n"
-        "Summary:\n"
-        "\tLoad a BAM formatted data file\n"
-        "\n"
-        "Example:\n"
-        "\t%s -o /tmp/SRZ123456 -k analysis.bam.cfg 123456.bam\n"
-        "\n"
-        ,progname, progname);
-}
-
-char const UsageDefaultName[] = "bam-load";
-
-rc_t CC Usage (const Args * args)
-{
-    rc_t rc;
-    int i;
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    const size_t argsQty = sizeof(Options) / sizeof(Options[0]);
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    for(i = 0; i < argsQty; i++ ) {
-        if( Options[i].required && Options[i].help[0] != NULL ) {
-            HelpOptionLine(Options[i].aliases, Options[i].name, OptHelpParam[i], Options[i].help);
-        }
-    }
-    OUTMSG(("\nOptions:\n"));
-    for(i = 0; i < argsQty; i++ ) {
-        if( !Options[i].required && Options[i].help[0] != NULL ) {
-            HelpOptionLine(Options[i].aliases, Options[i].name, OptHelpParam[i], Options[i].help);
-        }
-    }
-    XMLLogger_Usage();
-    OUTMSG(("\n"));
-    HelpOptionsStandard ();
-    HelpVersion (fullpath, KAppVersion());
-    return rc;
-}
-
-/* MARK: Definitions and Globals */
-
-#define SCHEMAFILE "align/align.vschema"
-
-Globals G;
-
-uint32_t CC KAppVersion (void)
-{
-    return BAM_LOAD_VERS;
-}
-
-#ifdef _WIN32
-#include <process.h>
-#else
-#include <unistd.h>
-#endif
-static void set_pid(void)
-{
-    G.pid = getpid();
-}
-
-static rc_t PathWithBasePath(char rslt[], size_t sz, char const path[], char const base[])
-{
-    size_t const plen = strlen(path);
-    bool const hasBase = base && base[0];
-    bool const isBareName = strchr(path, '/') == NULL;
-    
-    if (isBareName && hasBase) {
-        if (string_printf(rslt, sz, NULL, "%s/%s", base, path) == 0)
-            return 0;
-    }
-    else if (plen < sz) {
-        strcpy(rslt, path);
-        return 0;
-    }
-    {
-        rc_t const rc = RC(rcApp, rcArgv, rcAccessing, rcBuffer, rcInsufficient);
-        (void)LOGERR(klogErr, rc, "The path to the file is too long");
-        return rc;
-    }
-}
-
-static rc_t OpenFile(KFile const **kf, char const path[], char const base[])
-{
-    char fname[4096];
-    rc_t rc = PathWithBasePath(fname, sizeof(fname), path, base);
-    
-    if (rc == 0) {
-        KDirectory *dir;
-        
-        rc = KDirectoryNativeDir(&dir);
-        if (rc == 0) {
-            rc = KDirectoryOpenFileRead(dir, kf, fname);
-            KDirectoryRelease(dir);
-        }
-    }
-    return rc;
-}
-
-static rc_t LoadHeader(char const **rslt, char const path[], char const base[])
-{
-    KFile const *kf;
-    rc_t rc = OpenFile(&kf, path, base);
-    
-    *rslt = NULL;
-    if (rc == 0) {
-        uint64_t fsize;
-        rc = KFileSize(kf, &fsize);
-        if (rc == 0) {
-            char *fdata = malloc(fsize+1);
-            
-            if (fdata) {
-                size_t nread;
-                rc = KFileRead(kf, 0, fdata, fsize, &nread);
-                if (rc == 0) {
-                    if (nread) {
-                        fdata[nread] = '\0';
-                        *rslt = fdata;
-                    }
-                    else {
-                        free(fdata);
-                        rc = RC(rcApp, rcArgv, rcAccessing, rcFile, rcEmpty);
-                        (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)' is empty", "file=%s", path));
-                    }
-                }
-                else {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Failed to read file '$(file)'", "file=%s", path));
-                }
-            }
-            else {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failed to read file '$(file)'", "file=%s", path));
-            }
-        }
-        KFileRelease(kf);
-    }
-    else {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to open file '$(file)'", "file=%s", path));
-    }
-    return rc;
-}
-
-rc_t CC KMain (int argc, char * argv[])
-{
-    Args * args;
-    rc_t rc;
-    unsigned n_aligned = 0;
-    unsigned n_unalgnd = 0;
-    char *aligned[256];
-    char *unalgnd[256];
-    char *name_buffer = NULL;
-    unsigned next_name = 0;
-    unsigned nbsz = 0;
-    char const *value;
-    char *dummy;
-    const XMLLogger* xml_logger = NULL;
-    
-    memset(&G, 0, sizeof(G));
-    
-    G.mode = mode_Archive;
-    G.maxSeqLen = TableWriterRefSeq_MAX_SEQ_LEN;
-    G.schemaPath = SCHEMAFILE;
-    G.omit_aligned_reads = true;
-    G.omit_reference_reads = true;
-    G.minMapQual = 0; /* accept all */
-    G.tmpfs = "/tmp";
-#if _ARCH_BITS == 32
-    G.cache_size = ( size_t ) 1 << 30;
-#else
-    G.cache_size = ( size_t ) 10 << 30;
-#endif
-    G.maxErrCount = 1000;
-    G.minMatchCount = 10;
-    
-    set_pid();
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 2, Options,
-                            sizeof Options / sizeof (OptDef), XMLLogger_Args, XMLLogger_ArgsQty);
-
-    while (rc == 0) {
-        uint32_t pcount;
-
-        if( (rc = XMLLogger_Make(&xml_logger, NULL, args)) != 0 ) {
-            break;
-        }
-        rc = ArgsOptionCount(args, option_only_verify, &pcount);
-        if (rc)
-            break;
-        G.onlyVerifyReferences = (pcount > 0);
-        
-        rc = ArgsOptionCount(args, option_no_verify, &pcount);
-        if (rc)
-            break;
-        G.noVerifyReferences = (pcount > 0);
-        
-        rc = ArgsOptionCount(args, option_use_qual, &pcount);
-        if (rc)
-            break;
-        G.useQUAL = (pcount > 0);
-        
-        rc = ArgsOptionCount(args, option_ref_config, &pcount);
-        if (rc)
-            break;
-        G.limit2config = (pcount > 0);
-        
-        rc = ArgsOptionCount(args, OPTION_REF_FILE, &pcount);
-        if (rc)
-            break;
-        G.refFiles = calloc(pcount + 1, sizeof(*(G.refFiles)));
-        if( !G.refFiles ) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-            break;
-        }
-        while(pcount-- > 0) {
-            rc = ArgsOptionValue(args, OPTION_REF_FILE, pcount, &G.refFiles[pcount]);
-            if (rc)
-                break;
-        }
-
-        rc = ArgsOptionCount (args, OPTION_TMPFS, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_TMPFS, 0, &G.tmpfs);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_INPUT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_INPUT, 0, &G.inpath);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single input parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, option_ref_filter, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, option_ref_filter, 0, &G.refFilter);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_CONFIG, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_CONFIG, 0, &G.refXRefPath);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single input parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_OUTPUT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_OUTPUT, 0, &G.outpath);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single output parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        else if (!G.onlyVerifyReferences) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcInsufficient);
-            OUTMSG (("Output parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MINMAPQ, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MINMAPQ, 0, &value);
-            if (rc)
-                break;
-            G.minMapQual = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_QCOMP, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_QCOMP, 0, &G.QualQuantizer);
-            if (rc)
-                break;
-        }
-        
-        rc = ArgsOptionCount (args, option_edit_aligned_qual, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, option_edit_aligned_qual, 0, &value);
-            if (rc)
-                break;
-            G.alignedQualValue = strtoul(value, &dummy, 0);
-            if (G.alignedQualValue == 0) {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcIncorrect);
-                OUTMSG (("edit-aligned-qual: bad value\n"));
-                MiniUsage (args);
-                break;
-            }
-            G.editAlignedQual = true;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_CACHE_SIZE, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_CACHE_SIZE, 0, &value);
-            if (rc)
-                break;
-            G.cache_size = strtoul(value, &dummy, 0) * 1024UL * 1024UL;
-            if (G.cache_size == 0) {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcIncorrect);
-                OUTMSG (("cache-size: bad value\n"));
-                MiniUsage (args);
-                break;
-            }
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_WARN_DUP_FLAG, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_WARN_DUP_FLAG, 0, &value);
-            if (rc)
-                break;
-            G.maxWarnCount_DupConflict = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, option_unsorted, &pcount);
-        if (rc)
-            break;
-        G.expectUnsorted = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_REC_COUNT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_REC_COUNT, 0, &value);
-            if (rc)
-                break;
-            G.maxAlignCount = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_ERR_COUNT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_ERR_COUNT, 0, &value);
-            if (rc)
-                break;
-            G.maxErrCount = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MIN_MATCH, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MIN_MATCH, 0, &value);
-            if (rc)
-                break;
-            G.minMatchCount = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_ACCEPT_DUP, &pcount);
-        if (rc)
-            break;
-        G.acceptBadDups = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_ACCEPT_NOMATCH, &pcount);
-        if (rc)
-            break;
-        G.acceptNoMatch = pcount > 0;
-        
-        rc = ArgsOptionCount (args, option_keep_mismatch_qual, &pcount);
-        if (rc)
-            break;
-        G.keepMismatchQual = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_NO_CS, &pcount);
-        if (rc)
-            break;
-        G.noColorSpace = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_NO_SECONDARY, &pcount);
-        if (rc)
-            break;
-        G.noSecondary = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_TI, &pcount);
-        if (rc)
-            break;
-        G.hasTI = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_ACCEPT_HARD_CLIP, &pcount);
-        if (rc)
-            break;
-        G.acceptHardClip = pcount > 0;
-        
-        rc = ArgsOptionCount (args, OPTION_NOMATCH_LOG, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            KDirectory *dir;
-            
-            rc = ArgsOptionValue (args, OPTION_NOMATCH_LOG, 0, &value);
-            if (rc) break;
-            rc = KDirectoryNativeDir(&dir);
-            if (rc) break;
-            rc = KDirectoryCreateFile(dir, &G.noMatchLog, 0, 0664, kcmInit, value);
-            KDirectoryRelease(dir);
-            if (rc) break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_HEADER, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1) {
-            rc = ArgsOptionValue (args, OPTION_HEADER, 0, &value);
-            if (rc) break;
-            rc = LoadHeader(&G.headerText, value, G.inpath);
-            if (rc) break;
-        }
-        
-        rc = ArgsParamCount (args, &pcount);
-        if (rc) break;
-        if (pcount == 0)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcInsufficient);
-            MiniUsage (args);
-            break;
-        }
-        else if (pcount > sizeof(aligned)/sizeof(aligned[0])) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            (void)PLOGERR(klogErr, (klogErr, rc, "$(count) input files is too many, $(max) is the limit",
-                        "count=%u,max=%u", (unsigned)pcount, (unsigned)(sizeof(aligned)/sizeof(aligned[0]))));
-            break;
-        }
-        else {
-            unsigned need = G.inpath ? (strlen(G.inpath) + 1) * pcount : 0;
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsParamValue(args, i, &value);
-                if (rc) break;
-                need += strlen(value) + 1;
-            }
-            nbsz = need;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_UNALIGNED, &pcount);
-        if (rc)
-            break;
-        if (pcount > 0)
-        {
-            unsigned need = G.inpath ? (strlen(G.inpath) + 1) * pcount : 0;
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsOptionValue(args, OPTION_UNALIGNED, i, &value);
-                if (rc) break;
-                need += strlen(value) + 1;
-            }
-            if (rc) break;
-            nbsz += need;
-        }
-        
-        name_buffer = malloc(nbsz);
-        if (name_buffer == NULL) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_UNALIGNED, &pcount);
-        if (rc == 0) {
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsOptionValue(args, OPTION_UNALIGNED, i, &value);
-                if (rc) break;
-                
-                unalgnd[n_unalgnd++] = name_buffer + next_name;
-                rc = PathWithBasePath(name_buffer + next_name, nbsz - next_name, value, G.inpath);
-                if (rc) break;
-                next_name += strlen(name_buffer + next_name) + 1;
-            }
-            if (rc) break;
-        }
-        else
-            break;
-        
-        rc = ArgsParamCount (args, &pcount);
-        if (rc == 0) {
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsParamValue(args, i, &value);
-                if (rc) break;
-                
-                aligned[n_aligned++] = name_buffer + next_name;
-                rc = PathWithBasePath(name_buffer + next_name, nbsz - next_name, value, G.inpath);
-                if (rc) break;
-                next_name += strlen(name_buffer + next_name) + 1;
-            }
-        }
-        else
-            break;
-        
-        rc = run(argv[0], n_aligned, (char const **)aligned, n_unalgnd, (char const **)unalgnd);
-        break;
-    }
-    free(name_buffer);
-    free((void *)G.headerText);
-    free(G.refFiles);
-
-    value = G.outpath ? strrchr(G.outpath, '/') : "/???";
-    if( value == NULL ) {
-        value = G.outpath;
-    } else {
-        value++;
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "load failed",
-                "severity=total,status=failure,accession=%s,errors=%u", value, G.errCount));
-    } else {
-        (void)PLOGMSG(klogInfo, (klogInfo, "loaded",
-                "severity=total,status=success,accession=%s,errors=%u", value, G.errCount));
-    }
-    ArgsWhack(args);
-    XMLLogger_Release(xml_logger);
-    return rc;
-}
diff --git a/tools/bam-loader/hashtable.c b/tools/bam-loader/hashtable.c
deleted file mode 100644
index ee8f8e6..0000000
--- a/tools/bam-loader/hashtable.c
+++ /dev/null
@@ -1,878 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#if TESTING
-#include <stdio.h>
-#include <string.h>
-#endif
-
-#include "hashtable.h"
-
-typedef struct HTBucket HTBucket;
-typedef struct HTEntry HTEntry;
-
-#define HASH_TABLE_ENTRIES_MAX (0x80000)
-#define HASH_TABLE_PREALLOC_MAX 1
-
-struct HTEntry {
-    const void *payload;
-    uint32_t hashValue;
-};
-
-struct HTBucket {
-    HTBucket *overflow;
-    uint32_t used;      /* one bit per entry */
-    HTEntry entry[32];
-};
-
-struct HashTable {
-    size_t hashMask;    /* the "size" of the table is hashMask + 1 */
-    size_t entryCount;  /* total number of entries in table */
-
-    HashTableKeyCompFunc comp_func;
-    const void *ctx;
-    
-#if HASH_TABLE_PREALLOC_MAX
-    HTBucket table[HASH_TABLE_ENTRIES_MAX];
-#else
-    HTBucket *table;
-#endif
-};
-
-typedef struct HashTableRealIterator {
-    HashTable *table;
-    HTBucket *bucket;
-    uint32_t slot;
-    uint32_t hashValue;
-} HashTableRealIterator;
-
-typedef union HashTableImplIterator {
-    HashTableRealIterator real;
-    HashTableIterator user;
-} HashTableImplIterator;
-
-static unsigned FirstSet(unsigned bits)
-{
-    assert(bits != 0);
-    if ((bits & 0xFFFF) != 0) {
-        if ((bits & 0xFF) != 0) {
-            if ((bits & 0xF) != 0) {
-                if ((bits & 0x3) != 0) {
-                    if ((bits & 0x1) != 0)
-                        return 0;
-                    else
-                        return 1;
-                }
-                else if ((bits & 0x4) != 0)
-                    return 2;
-                else
-                    return 3;
-            }
-            else if ((bits & 0x30) != 0) {
-                if ((bits & 0x10) != 0)
-                    return 4;
-                else
-                    return 5;
-            }
-            else if ((bits & 0x40) != 0)
-                return 6;
-            else
-                return 7;
-        }
-        else if ((bits & 0xF00) != 0) {
-            if ((bits & 0x300) != 0) {
-                if ((bits & 0x100) != 0)
-                    return 8;
-                else
-                    return 9;
-            }
-            else if ((bits & 0x400) != 0)
-                return 10;
-            else
-                return 11;
-        }
-        else if ((bits & 0x3000) != 0) {
-            if ((bits & 0x1000) != 0)
-                return 12;
-            else
-                return 13;
-        }
-        else if ((bits & 0x4000) != 0)
-            return 14;
-        else
-            return 15; 
-    }
-    else if ((bits & 0xFF0000) != 0) {
-        if ((bits & 0xF0000) != 0) {
-            if ((bits & 0x30000) != 0) {
-                if ((bits & 0x10000) != 0)
-                    return 16;
-                else
-                    return 17;
-            }
-            else if ((bits & 0x40000) != 0)
-                return 18;
-            else
-                return 19;
-        }
-        else if ((bits & 0x300000) != 0) {
-            if ((bits & 0x100000) != 0)
-                return 20;
-            else
-                return 21;
-        }
-        else if ((bits & 0x400000) != 0)
-            return 22;
-        else
-            return 23;
-    }
-    else if ((bits & 0xF000000) != 0) {
-        if ((bits & 0x3000000) != 0) {
-            if ((bits & 0x1000000) != 0)
-                return 24;
-            else
-                return 25;
-        }
-        else if ((bits & 0x4000000) != 0)
-            return 26;
-        else
-            return 27;
-    }
-    else if ((bits & 0x30000000) != 0) {
-        if ((bits & 0x10000000) != 0)
-            return 28;
-        else
-            return 29;
-    }
-    else if ((bits & 0x40000000) != 0)
-        return 30;
-    else
-        return 31;
-    
-}
-
-static rc_t HTBucketNextOpenSlot(HTBucket *self, HTBucket **rslt, unsigned *slot)
-{
-    while (self->used == 0xFFFFFFFF) {
-        if (self->overflow != NULL) {
-            self = self->overflow;
-            continue;
-        }
-        self->overflow = malloc(sizeof(*self->overflow));
-        if (self->overflow == NULL)
-            return RC(rcCont, rcBuffer, rcAllocating, rcMemory, rcExhausted);
-        self->overflow->overflow = NULL;
-        self->overflow->used = 0;
-        *rslt = self->overflow;
-        *slot = 0;
-        return 0;
-    }
-    *rslt = self;
-    *slot = FirstSet(~self->used);
-    
-    return 0;
-}
-
-static rc_t HTBucketInsert(HTBucket *self, const HTEntry *entry)
-{
-    HTBucket *found;
-    unsigned slot;
-    rc_t rc = HTBucketNextOpenSlot(self, &found, &slot);
-    
-    if (rc)
-        return rc;
-    found->used |= (1 << slot);
-    found->entry[slot] = *entry;
-    return 0;
-}
-
-static bool HTBucketFreeSlot(HTBucket *self, unsigned slot)
-{
-    unsigned i;
-    
-    self->used &= ~(1 << slot);
-#if _DEBUGGING
-    self->entry[slot].payload = NULL;
-#endif
-    if (self->overflow == NULL)
-        return true;
-    
-    /* pull something out of the overflow */
-    i = FirstSet(self->overflow->used);
-    self->entry[slot] = self->overflow->entry[i];
-    self->used |= (1 << slot);
-    HTBucketFreeSlot(self->overflow, i);
-    if (self->overflow->used == 0) {
-        free(self->overflow);
-        self->overflow = NULL;
-    }
-    return false;
-}
-
-static void HTBucketForEach(const HTBucket *self, void (*fn)(void *payload, void *ctx), void *ctx)
-{
-    do {
-        uint32_t bits = self->used;
-        unsigned i;
-        
-        for (i = 0; i != 32 && bits != 0; ++i, bits >>= 1) {
-            if ((bits & 1) == 0)
-                continue;
-            fn((void *)self->entry[i].payload, ctx);
-        }
-        self = self->overflow;
-    } while (self != NULL);
-}
-
-static bool HTBucketDoUntil(const HTBucket *self, bool (*fn)(void *payload, void *ctx), void *ctx)
-{
-    do {
-        uint32_t bits = self->used;
-        unsigned i;
-        
-        for (i = 0; i != 32 && bits != 0; ++i, bits >>= 1) {
-            if ((bits & 1) == 0)
-                continue;
-            if (fn((void *)self->entry[i].payload, ctx))
-                return true;
-        }
-        self = self->overflow;
-    } while (self != NULL);
-    return false;
-}
-
-static bool HTBucketValidate(const HTBucket *self, uint32_t hash, uint32_t mask)
-{
-    do {
-        uint32_t bits = self->used;
-        unsigned i;
-        
-        for (i = 0; i != 32 && bits != 0; ++i, bits >>= 1) {
-            const HTEntry *entry = &self->entry[i];
-            bool is_free = (bits & 1) == 0;
-#if _DEBUGGING
-            bool is_null = entry->payload == NULL;
-            
-            if (is_free != is_null)
-                return true;
-#endif
-            if (is_free)
-                continue;
-            if ((entry->hashValue & mask) != hash)
-                return true;
-        }
-        if (self->overflow && self->overflow->used == 0)
-            return true;
-        self = self->overflow;
-    } while (self != NULL);
-    return false;
-}
-
-static void HTBucketWhack(HTBucket *self, void (*fn)(void *payload, void *ctx), void *ctx)
-{
-    uint32_t bits;
-    unsigned i;
-    
-    if (self->overflow) {
-        HTBucketWhack(self->overflow, fn, ctx);
-        free(self->overflow);
-    }
-    for (i = 0, bits = self->used; i != 32 && bits != 0 && fn; ++i, bits >>= 1) {
-        if ((bits & 1) == 0)
-            continue;
-        fn((void *)self->entry[i].payload, ctx);
-    }
-}
-
-static uint32_t GetHashValue(const uint8_t *key, unsigned len)
-{
-    /*
-     * My basic hash function is Pearson's hash.
-     * The tables below contain each value between 0 and 255 inclusive, in
-     * random order.  The tables were generated with the following perl script.
-     *
-     *   #!perl -w
-     *   my @x = (0 .. 255); # each value between 0 and 255 inclusive
-     *   foreach (0 .. 10000) { # randomize the order
-     *       my $i = $_ % 256;                    # a sequential index
-     *       my $r = rand(256);                   # a random index
-     *       ($x[$i], $x[$r]) = ($x[$r], $x[$i]); # swap x[i] and x[r]
-     *   }
-     *   print join(', ', map { sprintf '%3u', $_; } @x);
-     *
-     * You can generate lots of different 8-bit hash functions this way.
-     *
-     * I generate four 8-bit hashes and combine them to make a 32-bit one.
-     * Even though I may not use all bits for the hash (e.g. the limit on the
-     * table's size is much less than UINT32_MAX), computing and storing the
-     * full hash reduces the number of string compares I have to do when buckets
-     * have lots of items in them.
-     */
-    static const uint8_t T1[] = {
-         64, 186,  39, 203,  54, 211,  98,  32,  26,  23, 219,  94,  77,  60,  56, 184,
-        129, 242,  10,  91,  84, 192,  19, 197, 231, 133, 125, 244,  48, 176, 160, 164,
-         17,  41,  57, 137,  44, 196, 116, 146, 105,  40, 122,  47, 220, 226, 213, 212,
-        107, 191,  52, 144,   9, 145,  81, 101, 217, 206,  85, 134, 143,  58, 128,  20,
-        236, 102,  83, 149, 148, 180, 167, 163,  12, 239,  31,   0,  73, 152,   1,  15,
-         75, 200,   4, 165,   5,  66,  25, 111, 255,  70, 174, 151,  96, 126, 147,  34,
-        112, 161, 127, 181, 237,  78,  37,  74, 222, 123,  21, 132,  95,  51, 141,  45,
-         61, 131, 193,  68,  62, 249, 178,  33,   7, 195, 228,  82,  27,  46, 254,  90,
-        185, 240, 246, 124, 205, 182,  42,  22, 198,  69, 166,  92, 169, 136, 223, 245,
-        118,  97, 115,  80, 252, 209,  49,  79, 221,  38,  28,  35,  36, 208, 187, 248,
-        158, 201, 202, 168,   2,  18, 189, 119, 216, 214,  11,   6,  89,  16, 229, 109,
-        120,  43, 162, 106, 204,   8, 199, 235, 142, 210,  86, 153, 227, 230,  24, 100,
-        224, 113, 190, 243, 218, 215, 225, 173,  99, 238, 138,  59, 183, 154, 171, 232,
-        157, 247, 233,  67,  88,  50, 253, 251, 140, 104, 156, 170, 150, 103, 117, 110,
-        155,  72, 207, 250, 159, 194, 177, 130, 135,  87,  71, 175,  14,  55, 172, 121,
-        234,  13,  30, 241,  93, 188,  53, 114,  76,  29,  65,   3, 179, 108,  63, 139
-    };
-    static const uint8_t T2[] = {
-        119, 174,  44, 225,  94, 226, 141, 197,  35, 241, 179, 154,  26, 161, 129,  10,
-        104,  53,  97,  12, 243,  80,  51, 123, 185,  13,  66, 214, 114,  17,  74, 165,
-        110, 143, 170, 222, 242,  73,  40, 101,  56, 163,  68,  86, 198,   9,  21,  90,
-          8,   1, 146, 121, 103,  70,   5, 160, 149,  50, 145, 236, 100,  75, 148,  58,
-         55,  15,  33, 131, 127, 186,   6, 109, 115,   2, 108,  52, 209, 128, 208,  47,
-        220, 173,  45,  72, 156, 212, 152, 102,  77,  36, 134, 137, 162,  54, 235, 167,
-         28, 255, 155, 240, 135, 176, 246, 244,  22, 157,  20, 224, 210, 192,  71, 140,
-         14, 211, 251, 204,  30, 213, 132, 248, 178, 187, 142,  62, 215, 106, 229, 125,
-         41, 216,  49,  29,  98,  32,  18, 237,  79, 206,  63, 227,  25,  99, 150, 223,
-        171, 118,   4, 139,  81,   0, 133,  95, 188, 120,  27, 124,  61, 195, 231, 207,
-         31, 202,  91, 252,  46,  39, 250, 144, 238, 254, 219, 200, 130, 201,  48, 107,
-        205, 177,  88,  16, 147, 221, 164, 184,  89,  67, 190,  11, 175,  42, 136, 189,
-        245, 117,  83,   3, 180, 172,  76,  43, 183,  84, 218, 169, 253, 159, 196,  59,
-        193, 249, 181, 116, 153,  24,  87, 239, 138, 199, 111,  82,  69, 105,  78, 151,
-        122, 168, 126,  85, 228, 233,  34, 113, 194, 191,  19, 230, 182,  96, 217,  38,
-        234, 232,  92,  23,  57, 203,  65,  60,  64,  37, 158, 247,  93, 166, 112,   7
-    };
-    static const uint8_t T3[] = {
-        103,  33, 228,  32, 183, 231, 139,  60,  67,  80, 184, 100,  70,  19,  14,  58,
-        104,  48, 140,  10,  91, 137,  31,  96, 102, 180,  77, 121, 251, 167,  37, 206,
-         79, 151, 109,  15,  92, 174, 108,  16,  95, 145,  18, 236,  49, 177, 135,   0,
-        165,  86,  83, 107, 144,  44,  27, 116, 168, 193, 119, 230,  56,  97, 138, 149,
-        132,  21, 176,  39, 205,  12,  69, 179, 210,  25, 213, 194, 239, 209, 248,  28,
-         93,  38, 224,  66, 105, 160,  40,  17,  23, 129, 212,   8, 178, 118, 163,  73,
-          3,  63,  57,  94, 254, 186, 131, 166,  61, 191, 133, 192,  78, 114, 250, 200,
-        222, 136, 188, 204, 101,  11, 247, 146, 142, 152, 171, 157, 110, 141, 199,  29,
-        147,  88, 211, 240, 164, 196, 189,  50,  65, 112, 219, 237, 197, 115, 126, 154,
-        246, 170, 227, 235,  42, 148,  84, 201, 242,  85,  35,   6, 173, 122, 215, 218,
-         75,  82,   1, 169, 143, 195,  51, 155,  54,   9,  71,  24,  53,   7,  47, 229,
-        158,  26, 245,  89, 150, 181, 255, 249, 221, 217, 223,  76,  90,  36, 216, 130,
-        220, 125, 182,  55, 202, 234, 203, 123,  34, 172,  74,  30,   4, 241, 162, 233,
-         64,  62, 127,  20,  52, 106, 190, 253, 185, 111, 232,   2, 187,  13,  68, 117,
-        128,  98, 208,  41, 159,  46, 207, 244, 226,  22, 252, 214,   5, 243,  99, 113,
-        120, 225, 175, 124, 134, 161, 156,  45,  72,  87,  43,  59, 198, 153, 238,  81
-    };
-    static const uint8_t T4[] = {
-        103, 124,  53, 254,  91, 106, 131,  69, 158,  23, 249, 171, 241,  30, 194, 217,
-         64, 123, 129, 118,  35,  16, 209, 190, 155, 104, 148, 163,  78, 188, 174, 245,
-        218, 125, 210, 250, 107, 212, 117,  17, 109,  44,  71,  38, 253, 177,  11, 114,
-         60, 192, 133, 219,  97, 246,  41, 228, 127, 151,  62, 213, 224, 234, 138, 162,
-         31, 110, 222, 141,  25, 135,  18,  49, 132, 242, 203, 207,  68, 130, 116,  59,
-         63,  67, 169, 147,  94,   0, 134,  77,  51, 128, 247,  21,  88, 145, 122,  19,
-         40,  58,   9,  39, 252,   8, 156, 126, 146,  80, 159, 201, 186, 175,  74,  89,
-         54, 173, 208,  86, 239,   6,  61, 139,  66,  87, 150, 231,  82,  42, 197, 202,
-        199, 196, 121, 112, 161,  99,  90, 144, 105, 195, 255,  27,   3, 216, 187, 172,
-         12,   4, 221, 182, 215, 214,  76,  98,  15,  33,  47, 200, 113, 140, 227, 191,
-        100,  24, 251, 185, 152, 237, 235,  92,  96,   1, 193,   2, 154,  72, 198, 223,
-         28,  46,  13,  56, 153, 232, 233, 143, 108, 184,  43, 119,  84, 189, 120, 211,
-         10, 164,  73, 230, 149, 238,  20,  37,  95, 166, 240,  29, 204, 167, 243, 236,
-         45, 170, 220,   5,   7,  50, 160,  83, 157,  22, 168, 111,  55, 137, 206,  36,
-         85, 180,  79, 142, 102, 181,  14, 115,  57,  34,  75, 244, 248,  48,  93, 183,
-        229, 101, 205,  70, 226, 225, 165, 176, 136, 179,  52,  32,  26,  81,  65, 178
-    };
-    unsigned h1 = 0;
-    unsigned h2 = 0;
-    unsigned h3 = 0;
-    unsigned h4 = 0;
-    unsigned i;
-    
-    for (i = 0; i != len; ++i) {
-        uint8_t ch = key[i];
-        h1 = T1[h1 ^ ch];
-        h2 = T2[h2 ^ ch];
-        h3 = T3[h3 ^ ch];
-        h4 = T4[h4 ^ ch];
-    }
-    
-    return (h4 << 24) | (h3 << 16) | (h2 << 8) | h1;
-}
-
-rc_t HashTableMake(HashTable **rslt, uint32_t initialSize, HashTableKeyCompFunc kf, const void *ctx)
-{
-    HashTable *self;
-    unsigned i;
-
-    *rslt = NULL;
-    
-    if (initialSize == 0)
-        initialSize = 2;
-    else {
-        uint32_t m;
-        
-        for (m = 2; m < initialSize; m <<= 1)
-            ;
-        initialSize = m;
-        
-        if (initialSize > HASH_TABLE_ENTRIES_MAX)
-            initialSize = HASH_TABLE_ENTRIES_MAX;
-    }
-    
-    self = malloc(sizeof(*self));
-    if (self == NULL)
-        return RC(rcCont, rcSelf, rcAllocating, rcMemory, rcExhausted);
-    
-#if HASH_TABLE_PREALLOC_MAX
-#else
-    self->table = malloc(initialSize * sizeof(self->table[0]));
-    if (self == NULL) {
-        free(self);
-        return RC(rcCont, rcSelf, rcAllocating, rcMemory, rcExhausted);
-    }
-#endif
-    
-    for (i = 0; i != initialSize; ++i) {
-        self->table[i].used = 0;
-        self->table[i].overflow = NULL;
-    }
-    
-    self->hashMask = initialSize - 1;
-    self->entryCount = 0;
-    
-    self->comp_func = kf;
-    self->ctx = ctx;
-
-    *rslt = self;
-    
-    return 0;
-}
-
-static bool HashTableValidate(const HashTable *self)
-{
-    unsigned i;
-    
-    for (i = 0; i != self->hashMask + 1; ++i) {
-        if (HTBucketValidate(&self->table[i], i, self->hashMask))
-            return true;
-    }
-    return false;
-}
-
-static rc_t HashTableExpand(HashTable *self)
-{
-    const uint32_t mask = (self->hashMask << 1) | 1;
-    size_t size;
-    unsigned i;
-#if HASH_TABLE_PREALLOC_MAX
-#else
-    HTBucket *temp;
-#endif
-    
-    /* the table must be smaller than the limit */
-    if (self->hashMask >= HASH_TABLE_ENTRIES_MAX - 1)
-        return 0;
-    
-    size = self->hashMask + 1;
-    
-    /* the density of used slots needs to be high enough */
-    if (self->entryCount * 4 < size * 3 * 32)
-        return 0;
-    
-#if HASH_TABLE_PREALLOC_MAX
-#else
-    temp = realloc(self->table, size * 2);
-    if (temp == NULL)
-        return RC(rcCont, rcTable, rcResizing, rcMemory, rcExhausted);
-    self->table = temp;
-#endif
-    
-    /* move any items that should be moved
-     * to the new buckets (about half should)
-     */
-    for (i = 0; i != size; ++i) {
-        HTBucket *bucket = &self->table[i];
-        HTBucket *other  = &self->table[i + size];
-        
-        other->overflow = NULL;
-        other->used = 0;
-        do {
-            unsigned j;
-            uint32_t bits = bucket->used;
-            
-            for (j = 0; j != 32 && bits != 0; ++j, bits >>= 1) {
-                /* slot j occupied? */
-                if ((bits & 1) != 0) {
-                    HTEntry *entry = &bucket->entry[j];
-                    
-                    assert((entry->hashValue & self->hashMask) == i);
-                    
-                    while ((entry->hashValue & mask) != i) {
-                        rc_t rc;
-
-                        /* move to new bucket */
-                        assert((entry->hashValue & mask) == i + size);
-                        
-                        rc = HTBucketInsert(other, entry);
-                        if (rc) return rc;
-                        if (HTBucketFreeSlot(bucket, j))
-                            break;
-                        
-                        /* FreeSlot decided to reuse the slot
-                         * for something from the overflow,
-                         * so process the new thing
-                         */
-                        assert((entry->hashValue & self->hashMask) == i);
-                    }
-                }
-            }
-            bucket = bucket->overflow;
-        } while (bucket);
-    }
-    self->hashMask = mask;
-#if 0
-    HashTableValidate(self);
-#endif    
-    return 0;
-}
-
-static rc_t HashTableShrink(HashTable *self)
-{
-    const uint32_t mask = self->hashMask >> 1;
-    size_t size;
-    unsigned i;
-    unsigned j;
-    
-    if (self->hashMask > 255)
-        return 0;
-    
-    size = self->hashMask + 1;
-    
-    if (self->entryCount * 4 >= size * 3 * 32)
-        return 0;
-    
-    for (j = 0, i = mask + 1; i != size; ++i, ++j) {
-        HTBucket *bucket = &self->table[i];
-        HTBucket *other  = &self->table[j];
-        
-        do {
-            unsigned k;
-            uint32_t bits = bucket->used;
-            
-            for (k = 0; k != 32 && bits != 0; ++k, bits >>= 1) {
-                if ((bits & 1) != 0) {
-                    rc_t rc;
-                    HTEntry *entry = &bucket->entry[k];
-                    
-                    assert((entry->hashValue & self->hashMask) == i);
-                    assert((entry->hashValue & mask) == j);
-                        
-                    rc = HTBucketInsert(other, entry);
-                    if (rc) return rc;
-                }
-            }
-            bucket = bucket->overflow;
-        } while (bucket);
-    }
-    self->hashMask = mask;
-#if 0
-    HashTableValidate(self);
-#endif    
-    return 0;
-}
-
-static bool HashTableFindSlot(const HashTable *self,
-                              const void *key,
-                              uint32_t key_len,
-                              HashTableRealIterator *iter
-                              )
-{
-    uint32_t h = GetHashValue(key, key_len);
-    const HTBucket *bucket = &self->table[h & self->hashMask];
-    const HTBucket *open_bucket = NULL;
-    int slot = 0;
-    
-    iter->hashValue = h;
-    do {
-        unsigned i;
-        uint32_t bits = bucket->used;
-        
-        for (i = 0; i != 32 && (bits != 0 || open_bucket == NULL); ++i, bits >>= 1) {
-            if ((bits & 1) == 0) {
-                if (open_bucket == NULL) {
-                    open_bucket = bucket;
-                    slot = i;
-                }
-                continue;
-            }
-            if (bucket->entry[i].hashValue != h)
-                continue;
-            if (self->comp_func(bucket->entry[i].payload, key, key_len, (void *)self->ctx) != 0)
-                continue;
-            
-            iter->bucket = (HTBucket *)bucket;
-            iter->slot = i;
-            return true;
-        }
-        if (bucket->overflow == NULL)
-            break;
-        bucket = bucket->overflow;
-    } while (1);
-    if (open_bucket == NULL) {
-        iter->bucket = (HTBucket *)bucket;
-        iter->slot = 32;
-    }
-    else {
-        iter->bucket = (HTBucket *)open_bucket;
-        iter->slot = slot;
-    }
-
-    return false;
-}
-
-HashTableIterator HashTableLookup(HashTable *self, const void *key, uint32_t key_length)
-{
-    HashTableImplIterator rslt;
-    
-    rslt.real.table = self;
-    HashTableFindSlot(self, key, key_length, &rslt.real);
-    
-    return rslt.user;
-}
-
-void HashTableRemove(HashTable *self, const HashTableIterator *iter,
-                        HashTableFreeFunc whack, void *ctx)
-{
-    const HashTableRealIterator *i = &((const HashTableImplIterator *)iter)->real;
-    uint32_t hv;
-    
-    assert(i->table == self);
-    if (i->slot > 32)
-        return;
-    if ((i->bucket->used & (1 << i->slot)) == 0)
-        return;
-    
-    hv = i->hashValue;
-    assert(hv == i->bucket->entry[i->slot].hashValue);
-    
-    if (whack)
-        whack((void *)i->bucket->entry[i->slot].payload, ctx);
-    
-    HTBucketFreeSlot(i->bucket, i->slot);
-    if (i->bucket->used == 0) {
-        HTBucket *parent = &self->table[hv & self->hashMask];
-        
-        if (i->bucket != parent) {
-            while (parent->overflow != i->bucket)
-                parent = parent->overflow;
-            assert(parent->overflow == i->bucket);
-            assert(i->bucket->overflow == NULL);
-            parent->overflow = NULL;
-            free(i->bucket);
-        }
-    }
-    --self->entryCount;
-}
-
-void HashTableForEach(const HashTable *self, void (*fn)(void *payload, void *ctx), void *ctx)
-{
-    unsigned i;
-    
-    for (i = 0; i != self->hashMask + 1; ++i) {
-        HTBucketForEach(&self->table[i], fn, ctx);
-    }
-}
-
-bool HashTableDoUntil(const HashTable *self, bool (*fn)(void *payload, void *ctx), void *ctx)
-{
-    unsigned i;
-    
-    for (i = 0; i != self->hashMask + 1; ++i) {
-        if (HTBucketDoUntil(&self->table[i], fn, ctx))
-            return true;
-    }
-    return false;
-}
-
-void HashTableWhack(HashTable *self, HashTableFreeFunc fn, void *ctx)
-{
-    unsigned i;
-    
-    if (self) {
-        for (i = 0; i != self->hashMask + 1; ++i)
-            HTBucketWhack(&self->table[i], fn, ctx);
-#if HASH_TABLE_PREALLOC_MAX
-#else
-        free(self->table);
-#endif
-        free(self);
-    }
-}
-
-bool HashTableIteratorHasValue(const HashTableIterator *iter)
-{
-    const HashTableRealIterator *i = &((const HashTableImplIterator *)iter)->real;
-    
-    if (i->slot < 32 && (i->bucket->used & (1 << i->slot)) != 0)
-        return true;
-    return false;
-}
-
-const void *HashTableIteratorGetValue(const HashTableIterator *iter)
-{
-    const HashTableRealIterator *i = &((const HashTableImplIterator *)iter)->real;
-    return i->bucket->entry[i->slot].payload;
-}
-
-rc_t HashTableIteratorSetValue(HashTableIterator *iter, const void *value)
-{
-    HashTableRealIterator *i = &((HashTableImplIterator *)iter)->real;
-    HashTable *self = i->table;
-    
-    if (i->slot >= 32) {
-        rc_t rc;
-        
-        assert(i->bucket->used == 0xFFFFFFFF);
-        rc = HashTableExpand(self);
-        if (rc)
-            return rc;
-        rc = HTBucketNextOpenSlot(&self->table[i->hashValue & self->hashMask], &i->bucket, &i->slot);
-        if (rc)
-            return rc;
-    }
-    assert((i->bucket->used & (1 << i->slot)) == 0);
-    i->bucket->entry[i->slot].hashValue = i->hashValue;
-    i->bucket->entry[i->slot].payload = value;
-    i->bucket->used |= (1 << i->slot);
-    ++self->entryCount;
-    return 0;
-}
-
-#define TESTING 0
-#if TESTING
-#include <stdio.h>
-#include <string.h>
-
-struct pstring {
-    uint8_t len;
-    char str[255];
-};
-
-static int comp_func(const void *Obj, const void *key, uint32_t len, void *ignore)
-{
-    const struct pstring *obj = Obj;
-    return obj->len == len ? memcmp(obj->str, key, len) : obj->len - len;
-}
-
-static void print_key(void *Obj, void *ignore)
-{
-    const struct pstring *obj = Obj;
-    
-    printf("%s\n", obj->str);
-    return;
-}
-
-static struct pstring **LoadTestData(unsigned *count) {
-    FILE *fp = fopen("spot_name.txt", "r");
-    unsigned N = 0;
-    unsigned bytes = 0;
-    struct pstring **rslt;
-    
-    *count = 0;
-    if (fp == NULL) {
-        perror("failed to open test data file");
-        return NULL;
-    }
-    do {
-        char buf[256];
-        int i = fscanf(fp, " %256s ", buf);
-        if (i != 1)
-            break;
-        ++N;
-        bytes += strlen(buf);
-    } while (1);
-    rewind(fp);
-    
-    rslt = malloc(N * (sizeof(*rslt) + 2) + bytes);
-    if (rslt) {
-        unsigned i;
-        char *cp = (char *)&rslt[N];
-        
-        for (i = 0; i != N; ++i) {
-            rslt[i] = (struct pstring *)cp;
-            fscanf(fp, " %s ", rslt[i]->str);
-            rslt[i]->len = strlen(rslt[i]->str);
-            cp += rslt[i]->len + 2;
-        }
-        *count = N;
-    }
-    fclose(fp);
-    return rslt;
-}
-
-bool is_not_consistent(void *payload, void *context)
-{
-    return payload == NULL;
-}
-
-void test(void) {
-    HashTable *ht;
-    struct pstring **testdata;
-    unsigned N;
-    unsigned i;
-    
-    srand(time(0));
-    
-    testdata = LoadTestData(&N);
-   
-    if (HashTableMake(&ht, 0, comp_func, 0) != 0)
-        return;
-    
-    for (i = 0; i != N; ++i) {
-        const struct pstring *val = testdata[i % N];
-        HashTableIterator iter = HashTableLookup(ht, val->str, val->len);
-        
-        if (HashTableIteratorHasValue(&iter)) {
-            HashTableRemove(ht, &iter, 0, 0);
-        }
-        else {
-            HashTableIteratorSetValue(&iter, val);
-        }
-    }
-#if 1
-    HashTableValidate(ht);
-#else
-    HashTableForEach(ht, print_key, 0);
-#endif
-    HashTableWhack(ht, 0, 0);
-}
-#endif
-
diff --git a/tools/bam-loader/hashtable.h b/tools/bam-loader/hashtable.h
deleted file mode 100644
index e77ee9c..0000000
--- a/tools/bam-loader/hashtable.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct HashTable HashTable;
-typedef struct HashTableIterator HashTableIterator;
-
-typedef int (*HashTableKeyCompFunc)(const void *value, const void *key, uint32_t key_length, void *context);
-typedef void (*HashTableFreeFunc)(void *value, void *context);
-
-struct HashTableIterator {
-    const void *root;
-    const void *bucket;
-    uint64_t id;
-};
-
-rc_t HashTableMake(HashTable **rslt, uint32_t initialSize, HashTableKeyCompFunc kf, const void *context);
-
-void HashTableForEach(const HashTable *self, void (*fn)(void *value, void *context), void *context);
-
-bool HashTableDoUntil(const HashTable *self, bool (*fn)(void *value, void *context), void *context);
-
-HashTableIterator HashTableLookup(HashTable *self, const void *key, uint32_t key_length);
-
-void HashTableWhack(HashTable *self, HashTableFreeFunc fn, void *context);
-
-void HashTableRemove(HashTable *self, const HashTableIterator *iter, HashTableFreeFunc whack, void *context);
-
-bool HashTableIteratorHasValue(const HashTableIterator *iter);
-
-const void *HashTableIteratorGetValue(const HashTableIterator *iter);
-
-rc_t HashTableIteratorSetValue(HashTableIterator *iter, const void *value);
diff --git a/tools/bam-loader/loader-imp.c b/tools/bam-loader/loader-imp.c
deleted file mode 100644
index 7883a76..0000000
--- a/tools/bam-loader/loader-imp.c
+++ /dev/null
@@ -1,2102 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-/* #include "bam-load.vers.h" */
-
-#include <klib/callconv.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <klib/sort.h>
-#include <klib/printf.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <kfs/pagefile.h>
-#include <kfs/pmem.h>
-#include <kdb/btree.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/meta.h>
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-#include <align/dna-reverse-cmpl.h>
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <kapp/loader-file.h>
-#include <kapp/loader-meta.h>
-#include <kapp/log-xml.h>
-#include <kapp/progressbar.h>
-
-#include <sysalloc.h>
-#include <atomic32.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-#include <limits.h>
-#include <time.h>
-
-#include <align/bam.h>
-
-#include "Globals.h"
-#include "sequence-writer.h"
-#include "reference-writer.h"
-#include "alignment-writer.h"
-
-#define NUM_ID_SPACES (256u)
-
-#define MMA_NUM_CHUNKS_BITS (24u)
-#define MMA_NUM_SUBCHUNKS_BITS ((32u)-(MMA_NUM_CHUNKS_BITS))
-#define MMA_SUBCHUNK_SIZE (1u << MMA_NUM_CHUNKS_BITS)
-#define MMA_SUBCHUNK_COUNT (1u << MMA_NUM_SUBCHUNKS_BITS)
-
-typedef struct {
-    KFile *fp;
-    size_t elemSize;
-    uint64_t fsize;
-    struct mma_map_s {
-        struct mma_submap_s {
-            uint8_t *base;
-            KMMap *mmap;
-        } submap[MMA_SUBCHUNK_COUNT];
-    } map[NUM_ID_SPACES];
-} MMArray;
-
-#define FRAG_CHUNK_SIZE (128)
-typedef struct {
-    uint32_t primaryId[2];
-    uint32_t spotId;
-    uint32_t fragmentId;
-    uint8_t  platform;
-    uint8_t  pId_ext[2];
-    uint8_t  spotId_ext;
-    uint8_t  alignmentCount[2]; /* 0..254; 254: saturated max; 255: special meaning "too many" */
-    uint8_t  unmated: 1,
-             pcr_dup: 1,
-             has_a_read: 1,
-             unaligned_1: 1,
-             unaligned_2: 1;
-} ctx_value_t;
-
-#define CTX_VALUE_SET_P_ID(O,N,V) do { int64_t tv = (V); (O).primaryId[N] = (uint32_t)tv; (O).pId_ext[N] = tv >> 32; } while(0);
-#define CTX_VALUE_GET_P_ID(O,N) ((((int64_t)((O).pId_ext[N])) << 32) | (O).primaryId[N])
-
-#define CTX_VALUE_SET_S_ID(O,V) do { int64_t tv = (V); (O).spotId = (uint32_t)tv; (O).spotId_ext = tv >> 32; } while(0);
-#define CTX_VALUE_GET_S_ID(O) ((((int64_t)(O).spotId_ext) << 32) | (O).spotId)
-
-typedef struct FragmentInfo {
-    uint64_t ti;
-    uint32_t readlen;
-    uint8_t  aligned;
-    uint8_t  is_bad;
-    uint8_t  orientation;
-    uint8_t  otherReadNo;
-    uint8_t  sglen;
-    uint8_t  cskey;
-} FragmentInfo;
-
-typedef struct context_t {
-    const KLoadProgressbar *progress[4];
-    KBTree *key2id[NUM_ID_SPACES];
-    char *key2id_names;
-    MMArray *id2value;
-    KMemBank *fragsBoth; /*** mate will be there soon ***/
-    KMemBank *fragsOne;  /*** mate may not be found soon or even show up ***/
-    int64_t spotId;
-    int64_t primaryId;
-    int64_t secondId;
-    uint64_t alignCount;
-    
-    uint32_t idCount[NUM_ID_SPACES];
-    uint32_t key2id_hash[NUM_ID_SPACES];
-
-    unsigned key2id_max;
-    unsigned key2id_name_max;
-    unsigned key2id_name_alloc;
-    unsigned key2id_count;
-    
-    unsigned key2id_name[NUM_ID_SPACES];
-    /* this array is kept in name order */
-    /* this maps the names to key2id and idCount */
-    unsigned key2id_oid[NUM_ID_SPACES];
-    
-    unsigned pass;
-    bool isColorSpace;
-} context_t;
-
-static char const *Print_ctx_value_t(ctx_value_t const *const self)
-{
-    static char buffer[4096];
-    rc_t rc = string_printf(buffer, sizeof(buffer), NULL, "pid: { %lu, %lu }, sid: %lu, fid: %u, alc: { %u, %u }, flg: %x", CTX_VALUE_GET_P_ID(*self, 0), CTX_VALUE_GET_P_ID(*self, 1), CTX_VALUE_GET_S_ID(*self), self->fragmentId, self->alignmentCount[0], self->alignmentCount[1], self->alignmentCount[2]);
-
-    if (rc)
-        return 0;
-    return buffer;
-}
-
-static rc_t MMArrayMake(MMArray **rslt, KFile *fp, uint32_t elemSize)
-{
-    MMArray *const self = calloc(1, sizeof(*self));
-
-    if (self == NULL)
-        return RC(rcExe, rcMemMap, rcConstructing, rcMemory, rcExhausted);
-    self->elemSize = (elemSize + 3) & ~(3u); /** align to 4 byte **/
-    self->fp = fp;
-    KFileAddRef(fp);
-    *rslt = self;
-    return 0;
-}
-
-#define PERF 0
-
-static rc_t MMArrayGet(MMArray *const self, void **const value, uint64_t const element)
-{
-    unsigned const bin_no = element >> 32;
-    unsigned const subbin = ((uint32_t)element) >> MMA_NUM_CHUNKS_BITS;
-    unsigned const in_bin = (uint32_t)element & (MMA_SUBCHUNK_SIZE - 1);
-
-    if (bin_no >= sizeof(self->map)/sizeof(self->map[0]))
-        return RC(rcExe, rcMemMap, rcConstructing, rcId, rcExcessive);
-    
-    if (self->map[bin_no].submap[subbin].base == NULL) {
-        size_t const chunk = MMA_SUBCHUNK_SIZE * self->elemSize;
-        size_t const fsize = self->fsize + chunk;
-        rc_t rc = KFileSetSize(self->fp, fsize);
-        
-        if (rc == 0) {
-            KMMap *mmap;
-            
-            self->fsize = fsize;
-            rc = KMMapMakeRgnUpdate(&mmap, self->fp, self->fsize, chunk);
-            if (rc == 0) {
-                void *base;
-                
-                rc = KMMapAddrUpdate(mmap, &base);
-                if (rc == 0) {
-#if PERF
-                    static unsigned mapcount = 0;
-
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Number of mmaps: $(cnt)", "cnt=%u", ++mapcount));
-#endif
-                    self->map[bin_no].submap[subbin].mmap = mmap;
-                    self->map[bin_no].submap[subbin].base = base;
-
-                    goto GET_MAP;
-                }
-                KMMapRelease(mmap);
-            }
-        }
-        return rc;
-    }
-GET_MAP:
-    *value = &self->map[bin_no].submap[subbin].base[(size_t)in_bin * self->elemSize];
-    return 0;
-}
-
-static void MMArrayWhack(MMArray *self)
-{
-    unsigned i;
-
-    for (i = 0; i != sizeof(self->map)/sizeof(self->map[0]); ++i) {
-        unsigned j;
-        
-        for (j = 0; j != sizeof(self->map[0].submap)/sizeof(self->map[0].submap[0]); ++j) {
-            if (self->map[i].submap[j].mmap)
-                KMMapRelease(self->map[i].submap[j].mmap);
-            self->map[i].submap[j].mmap = NULL;
-            self->map[i].submap[j].base = NULL;
-        }
-    }
-    KFileRelease(self->fp);
-    free(self);
-}
-
-static rc_t OpenKBTree(KBTree **const rslt, unsigned n, unsigned max)
-{
-    size_t const cacheSize = (((G.cache_size - (G.cache_size / 2) - (G.cache_size / 8)) / max)
-                            + 0xFFFFF) & ~((size_t)0xFFFFF);
-    KFile *file = NULL;
-    KDirectory *dir;
-    char fname[4096];
-    rc_t rc;
-    
-    rc = KDirectoryNativeDir(&dir);
-    if (rc)
-        return rc;
-    
-    rc = string_printf(fname, sizeof(fname), NULL, "%s/key2id.%u.%u", G.tmpfs, G.pid, n); if (rc) return rc;
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    KDirectoryRelease(dir);
-    if (rc == 0) {
-        rc = KBTreeMakeUpdate(rslt, file, cacheSize,
-                              false, kbtOpaqueKey,
-                              1, 255, sizeof ( uint32_t ),
-                              NULL
-                              );
-        KFileRelease(file);
-#if PERF
-        if (rc == 0) {
-            static unsigned treecount = 0;
-
-            (void)PLOGMSG(klogInfo, (klogInfo, "Number of trees: $(cnt)", "cnt=%u", ++treecount));
-        }
-#endif
-    }
-    return rc;
-}
-
-static rc_t GetKeyIDOld(context_t *const ctx, uint64_t *const rslt, bool *const wasInserted, char const key[], char const name[], unsigned const namelen)
-{
-    unsigned const keylen = strlen(key);
-    rc_t rc;
-    uint64_t tmpKey;
-
-    if (ctx->key2id_count == 0) {
-        rc = OpenKBTree(&ctx->key2id[0], 1, 1);
-        if (rc) return rc;
-        ctx->key2id_count = 1;
-    }
-    if (memcmp(key, name, keylen) == 0) {
-        /* qname starts with read group; no append */
-        tmpKey = ctx->idCount[0];
-        rc = KBTreeEntry(ctx->key2id[0], &tmpKey, wasInserted, name, namelen);
-    }
-    else {
-        char sbuf[4096];
-        char *buf = sbuf;
-        char *hbuf = NULL;
-        size_t bsize = sizeof(sbuf);
-        size_t actsize;
-        
-        if (keylen + namelen + 2 > bsize) {
-            hbuf = malloc(bsize = keylen + namelen + 2);
-            if (hbuf == NULL)
-                return RC(rcExe, rcName, rcAllocating, rcMemory, rcExhausted);
-            buf = hbuf;
-        }
-        rc = string_printf(buf, bsize, &actsize, "%s\t%.*s", key, (int)namelen, name);
-        
-        tmpKey = ctx->idCount[0];
-        rc = KBTreeEntry(ctx->key2id[0], &tmpKey, wasInserted, buf, actsize);
-        if (hbuf)
-            free(hbuf);
-    }
-    if (rc == 0) {
-        *rslt = tmpKey;
-        if (*wasInserted)
-            ++ctx->idCount[0];
-    }
-    return rc;
-}
-
-static unsigned HashKey(void const *key, unsigned keylen)
-{
-    /* There is nothing special about this hash. It was randomly generated. */
-    static const uint8_t T1[] = {
-         64, 186,  39, 203,  54, 211,  98,  32,  26,  23, 219,  94,  77,  60,  56, 184,
-        129, 242,  10,  91,  84, 192,  19, 197, 231, 133, 125, 244,  48, 176, 160, 164,
-         17,  41,  57, 137,  44, 196, 116, 146, 105,  40, 122,  47, 220, 226, 213, 212,
-        107, 191,  52, 144,   9, 145,  81, 101, 217, 206,  85, 134, 143,  58, 128,  20,
-        236, 102,  83, 149, 148, 180, 167, 163,  12, 239,  31,   0,  73, 152,   1,  15,
-         75, 200,   4, 165,   5,  66,  25, 111, 255,  70, 174, 151,  96, 126, 147,  34,
-        112, 161, 127, 181, 237,  78,  37,  74, 222, 123,  21, 132,  95,  51, 141,  45,
-         61, 131, 193,  68,  62, 249, 178,  33,   7, 195, 228,  82,  27,  46, 254,  90,
-        185, 240, 246, 124, 205, 182,  42,  22, 198,  69, 166,  92, 169, 136, 223, 245,
-        118,  97, 115,  80, 252, 209,  49,  79, 221,  38,  28,  35,  36, 208, 187, 248,
-        158, 201, 202, 168,   2,  18, 189, 119, 216, 214,  11,   6,  89,  16, 229, 109,
-        120,  43, 162, 106, 204,   8, 199, 235, 142, 210,  86, 153, 227, 230,  24, 100,
-        224, 113, 190, 243, 218, 215, 225, 173,  99, 238, 138,  59, 183, 154, 171, 232,
-        157, 247, 233,  67,  88,  50, 253, 251, 140, 104, 156, 170, 150, 103, 117, 110,
-        155,  72, 207, 250, 159, 194, 177, 130, 135,  87,  71, 175,  14,  55, 172, 121,
-        234,  13,  30, 241,  93, 188,  53, 114,  76,  29,  65,   3, 179, 108,  63, 139
-    };
-    unsigned h = 0x55;
-    unsigned i = keylen;
-    
-    do { h = T1[h ^ ((uint8_t)i)]; } while ((i >>= 8) != 0);
-
-    for (i = 0; i != keylen; ++i)
-        h = T1[h ^ ((uint8_t const *)key)[i]];
-
-    return h;
-}
-
-static rc_t GetKeyID(context_t *const ctx, uint64_t *const rslt, bool *const wasInserted, char const key[], char const name[], unsigned const namelen)
-{
-    if (ctx->key2id_max == 1)
-        return GetKeyIDOld(ctx, rslt, wasInserted, key, name, namelen);
-    else {
-        unsigned const keylen = strlen(key);
-        unsigned const h = HashKey(key, keylen);
-        unsigned f;
-        unsigned e = ctx->key2id_count;
-        uint64_t tmpKey;
-        
-        *rslt = 0;
-        {{
-            uint32_t const bucket_value = ctx->key2id_hash[h];
-            unsigned const n  = (uint8_t) bucket_value;
-            unsigned const i1 = (uint8_t)(bucket_value >>  8);
-            unsigned const i2 = (uint8_t)(bucket_value >> 16);
-            unsigned const i3 = (uint8_t)(bucket_value >> 24);
-            
-            if (n > 0 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i1]) == 0) {
-                f = i1;
-                /*
-                ctx->key2id_hash[h] = (i3 << 24) | (i2 << 16) | (i1 << 8) | n;
-                 */
-                goto GET_ID;
-            }
-            if (n > 1 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i2]) == 0) {
-                f = i2;
-                ctx->key2id_hash[h] = (i3 << 24) | (i1 << 16) | (i2 << 8) | n;
-                goto GET_ID;
-            }
-            if (n > 2 && strcmp(key, ctx->key2id_names + ctx->key2id_name[i3]) == 0) {
-                f = i3;
-                ctx->key2id_hash[h] = (i2 << 24) | (i1 << 16) | (i3 << 8) | n;
-                goto GET_ID;
-            }
-        }}
-        f = 0;
-        while (f < e) {
-            unsigned const m = (f + e) / 2;
-            unsigned const oid = ctx->key2id_oid[m];
-            int const diff = strcmp(key, ctx->key2id_names + ctx->key2id_name[oid]);
-            
-            if (diff < 0)
-                e = m;
-            else if (diff > 0)
-                f = m + 1;
-            else {
-                f = oid;
-                goto GET_ID;
-            }
-        }
-        if (ctx->key2id_count < ctx->key2id_max) {
-            unsigned const name_max = ctx->key2id_name_max + keylen + 1;
-            KBTree *tree;
-            rc_t rc = OpenKBTree(&tree, ctx->key2id_count + 1, 1); /* ctx->key2id_max); */
-            
-            if (rc) return rc;
-            
-            if (ctx->key2id_name_alloc < name_max) {
-                unsigned alloc = ctx->key2id_name_alloc;
-                void *tmp;
-                
-                if (alloc == 0)
-                    alloc = 4096;
-                while (alloc < name_max)
-                    alloc <<= 1;
-                tmp = realloc(ctx->key2id_names, alloc);
-                if (tmp == NULL)
-                    return RC(rcExe, rcName, rcAllocating, rcMemory, rcExhausted);
-                ctx->key2id_names = tmp;
-                ctx->key2id_name_alloc = alloc;
-            }
-            if (f < ctx->key2id_count) {
-                memmove(&ctx->key2id_oid[f + 1], &ctx->key2id_oid[f], (ctx->key2id_count - f) * sizeof(ctx->key2id_oid[f]));
-            }
-            ctx->key2id_oid[f] = ctx->key2id_count;
-            ++ctx->key2id_count;
-            f = ctx->key2id_oid[f];
-            ctx->key2id_name[f] = ctx->key2id_name_max;
-            ctx->key2id_name_max = name_max;
-
-            memcpy(&ctx->key2id_names[ctx->key2id_name[f]], key, keylen + 1);
-            ctx->key2id[f] = tree;
-            ctx->idCount[f] = 0;
-            if ((uint8_t)ctx->key2id_hash[h] < 3) {
-                unsigned const n = (uint8_t)ctx->key2id_hash[h] + 1;
-                
-                ctx->key2id_hash[h] = (((ctx->key2id_hash[h] & ~(0xFFu)) | f) << 8) | n;
-            }
-            else {
-                /* the hash function isn't working too well
-                 * keep the 3 mru
-                 */
-                ctx->key2id_hash[h] = (((ctx->key2id_hash[h] & ~(0xFFu)) | f) << 8) | 3;
-            }
-        GET_ID:
-            tmpKey = ctx->idCount[f];
-            rc = KBTreeEntry(ctx->key2id[f], &tmpKey, wasInserted, name, namelen);
-            if (rc == 0) {
-                *rslt = (((uint64_t)f) << 32) | tmpKey;
-                if (*wasInserted)
-                    ++ctx->idCount[f];
-                assert(tmpKey < ctx->idCount[f]);
-            }
-            return rc;
-        }
-        return RC(rcExe, rcTree, rcAllocating, rcConstraint, rcViolated);
-    }
-}
-
-static rc_t OpenMMapFile(context_t *const ctx, KDirectory *const dir)
-{
-    KFile *file = NULL;
-    char fname[4096];
-    rc_t rc = string_printf(fname, sizeof(fname), NULL, "%s/id2value.%u", G.tmpfs, G.pid);
-    
-    if (rc)
-        return rc;
-    
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    if (rc == 0)
-        rc = MMArrayMake(&ctx->id2value, file, sizeof(ctx_value_t));
-    KFileRelease(file);
-    return rc;
-}
-
-static rc_t OpenMBankFile(context_t *const ctx, KDirectory *const dir, int which, size_t climit)
-{
-    KFile *file = NULL;
-    char fname[4096];
-    char const *const suffix = which == 1 ? "One" : "Both";
-    KMemBank **const mbank = which == 1 ? &ctx->fragsOne : &ctx->fragsBoth;
-    rc_t rc = string_printf(fname, sizeof(fname), NULL, "%s/frag_data%s.%u", G.tmpfs, suffix, G.pid);
-    
-    if (rc)
-        return rc;
-    
-    rc = KDirectoryCreateFile(dir, &file, true, 0600, kcmInit, fname);
-    KDirectoryRemove(dir, 0, fname);
-    if (rc == 0) {
-        KPageFile *backing;
-        
-        rc = KPageFileMakeUpdate(&backing, file, climit, false);
-        KFileRelease(file);
-        if (rc == 0) {
-            rc = KMemBankMake(mbank, FRAG_CHUNK_SIZE, 0, backing);
-            KPageFileRelease(backing);
-        }
-    }
-    return rc;
-}
-
-static rc_t SetupContext(context_t *ctx, unsigned numfiles)
-{
-    rc_t rc = 0;
-
-    memset(ctx, 0, sizeof(*ctx));
-    
-    if (G.mode == mode_Archive) {
-        KDirectory *dir;
-        size_t fragSizeBoth; /*** temporary hold for first side of mate pair with both sides aligned**/
-        size_t fragSizeOne; /*** temporary hold for first side of mate pair with one side aligned**/
-
-        fragSizeBoth    =   (G.cache_size / 8);
-        fragSizeOne     =   (G.cache_size / 2);
-
-        rc = KLoadProgressbar_Make(&ctx->progress[0], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[1], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[2], 0); if (rc) return rc;
-        rc = KLoadProgressbar_Make(&ctx->progress[3], 0); if (rc) return rc;
-        
-        KLoadProgressbar_Append(ctx->progress[0], 100 * numfiles);
-        
-        rc = KDirectoryNativeDir(&dir);
-        if (rc == 0)
-            rc = OpenMMapFile(ctx, dir);
-        if (rc == 0)
-            rc = OpenMBankFile(ctx, dir, 0, fragSizeBoth);
-        if (rc == 0)
-            rc = OpenMBankFile(ctx, dir, 1, fragSizeOne);
-        KDirectoryRelease(dir);
-    }
-    return rc;
-}
-
-static void ContextReleaseMemBank(context_t *ctx)
-{
-    KMemBankRelease(ctx->fragsOne);
-    ctx->fragsOne = NULL;
-    KMemBankRelease(ctx->fragsBoth);
-    ctx->fragsBoth = NULL;
-}
-
-static void ContextRelease(context_t *ctx)
-{
-    KLoadProgressbar_Release(ctx->progress[0], true);
-    KLoadProgressbar_Release(ctx->progress[1], true);
-    KLoadProgressbar_Release(ctx->progress[2], true);
-    KLoadProgressbar_Release(ctx->progress[3], true);
-    MMArrayWhack(ctx->id2value);
-}
-
-static
-void COPY_QUAL(uint8_t D[], uint8_t const S[], unsigned const L, bool const R) 
-{
-    if (R) {
-        unsigned i;
-        unsigned j;
-        
-        for (i = 0, j = L - 1; i != L; ++i, --j)
-            D[i] = S[j];
-    }
-    else
-        memcpy(D, S, L);
-}
-
-static
-void COPY_READ(INSDC_dna_text D[], INSDC_dna_text const S[], unsigned const L, bool const R)
-{
-    static INSDC_dna_text const compl[] = {
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 , '.',  0 , 
-        '0', '1', '2', '3',  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 , 'T', 'V', 'G', 'H',  0 ,  0 , 'C', 
-        'D',  0 ,  0 , 'M',  0 , 'K', 'N',  0 , 
-         0 ,  0 , 'Y', 'S', 'A', 'A', 'B', 'W', 
-         0 , 'R',  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 , 'T', 'V', 'G', 'H',  0 ,  0 , 'C', 
-        'D',  0 ,  0 , 'M',  0 , 'K', 'N',  0 , 
-         0 ,  0 , 'Y', 'S', 'A', 'A', 'B', 'W', 
-         0 , 'R',  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , 
-         0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0
-    };
-    if (R) {
-        unsigned i;
-        unsigned j;
-        
-        for (i = 0, j = L - 1; i != L; ++i, --j)
-            D[i] = compl[((uint8_t const *)S)[j]];
-    }
-    else
-        memcpy(D, S, L);
-}
-
-static rc_t OpenBAM(const BAMFile **bam, VDatabase *db, const char bamFile[])
-{
-    rc_t rc = BAMFileMakeWithHeader(bam, G.headerText, bamFile);
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to open '$(file)'", "file=%s", bamFile));
-    }
-    else if (db) {
-        KMetadata *dbmeta;
-        
-        rc = VDatabaseOpenMetadataUpdate(db, &dbmeta);
-        if (rc == 0) {
-            KMDataNode *node;
-            
-            rc = KMetadataOpenNodeUpdate(dbmeta, &node, "BAM_HEADER");
-            KMetadataRelease(dbmeta);
-            if (rc == 0) {
-                char const *header;
-                size_t size;
-                
-                rc = BAMFileGetHeaderText(*bam, &header, &size);
-                if (rc == 0) {
-                    rc = KMDataNodeWrite(node, header, size);
-                }
-                KMDataNodeRelease(node);
-            }
-        }
-    }
-
-    return rc;
-}
-
-static rc_t VerifyReferences(BAMFile const *bam, Reference const *ref)
-{
-    rc_t rc = 0;
-    uint32_t n;
-    unsigned i;
-    
-    BAMFileGetRefSeqCount(bam, &n);
-    for (i = 0; i != n; ++i) {
-        BAMRefSeq const *refSeq;
-        
-        BAMFileGetRefSeq(bam, i, &refSeq);
-        if (G.refFilter && strcmp(refSeq->name, G.refFilter) != 0)
-            continue;
-        
-        rc = ReferenceVerify(ref, refSeq->name, refSeq->length, refSeq->checksum);
-        if (rc) {
-            if (GetRCObject(rc) == rcChecksum && GetRCState(rc) == rcUnequal) {
-#if NCBI
-                (void)PLOGMSG(klogWarn, (klogWarn, "Reference: '$(name)', Length: $(len); checksums do not match", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-#endif
-            }
-            else
-            if (GetRCObject(rc) == rcSize && GetRCState(rc) == rcUnequal) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Reference: '$(name)', Length: $(len); lengths do not match", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-            }
-            else if (GetRCObject(rc) == rcSize && GetRCState(rc) == rcEmpty) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Reference: '$(name)', Length: $(len); fasta file is empty", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-            }
-            else if (GetRCObject(rc) == rcId && GetRCState(rc) == rcNotFound) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Reference: '$(name)', Length: $(len); no match found", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-            }
-            else {
-                (void)PLOGERR(klogWarn, (klogWarn, rc, "Reference: '$(name)', Length: $(len); error", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-            }
-        }
-        else if (G.onlyVerifyReferences) {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Reference: '$(name)', Length: $(len); match found", "name=%s,len=%u", refSeq->name, (unsigned)refSeq->length));
-        }
-    }
-    return 0;
-}
-
-static uint8_t GetMapQ(BAMAlignment const *rec)
-{
-    uint8_t mapQ;
-    
-    BAMAlignmentGetMapQuality(rec, &mapQ);
-    return mapQ;
-}
-
-static void EditAlignedQualities(uint8_t qual[], bool const hasMismatch[], unsigned readlen)
-{
-    unsigned i;
-    
-    for (i = 0; i < readlen; ++i) {
-        uint8_t const q = hasMismatch[i] ? G.alignedQualValue : qual[i];
-        
-        qual[i] = q;
-    }
-}
-
-static void EditUnalignedQualities(uint8_t qual[], bool const hasMismatch[], unsigned readlen)
-{
-    unsigned i;
-    
-    for (i = 0; i < readlen; ++i) {
-        uint8_t const q = (qual[i] & 0x7F) | (hasMismatch[i] ? 0x80 : 0);
-        
-        qual[i] = q;
-    }
-}
-
-static void AlignmentRecordInit(AlignmentRecord *self, void *buffer, unsigned readlen, char **endp)
-{
-    memset(self, 0, sizeof(*self));
-
-    self->data.seq_read_id.buffer = &self->read_id;
-    self->data.seq_read_id.elements = 1;
-    self->data.ref_id.buffer = &self->ref_id;
-    self->data.ref_id.elements = 1;
-    if (G.expectUnsorted) {
-        self->data.ref_start.buffer = &self->ref_start;
-        self->data.ref_start.elements = 1;
-    }
-    else {
-        self->data.global_ref_start.buffer = &self->global_ref_start;
-        self->data.global_ref_start.elements = 1;
-    }
-    self->data.ref_orientation.buffer = &self->ref_orientation;
-    self->data.ref_orientation.elements = 1;
-    self->data.mapq.buffer = &self->mapq;
-    self->data.mapq.elements = 1;
-    self->data.tmp_key_id.buffer = &self->tmp_key_id;
-    self->data.tmp_key_id.elements = 1;
-    
-    self->data.read_start.buffer = &self->read_start;
-    self->data.read_start.elements = 1;
-    self->data.read_len.buffer = &self->read_len;
-    self->data.read_len.elements = 1;
-    
-    self->data.mate_ref_orientation.buffer = &self->mate_ref_orientation;
-    self->data.mate_ref_orientation.elements = 1;
-    self->data.mate_ref_id.buffer = &self->mate_ref_id;
-    self->data.mate_ref_id.elements = 1;
-    self->data.mate_ref_pos.buffer = &self->mate_ref_pos;
-    self->data.mate_ref_pos.elements = 1;
-    self->data.mate_align_id.buffer = &self->mate_align_id;
-    self->data.mate_align_id.elements = 1;
-    self->data.template_len.buffer = &self->template_len;
-    self->data.template_len.elements = 1;
-    
-    self->data.ref_offset.buffer = (int32_t *)buffer;
-    self->data.has_mismatch.buffer = (bool *)&AR_OFFSET(*self)[readlen];
-    self->data.has_mismatch.elements = readlen;
-    self->data.has_ref_offset.buffer = &AR_HAS_MISMATCH(*self)[readlen];
-    self->data.has_ref_offset.elements = readlen;
-    self->data.mismatch.buffer = (char *)&AR_HAS_OFFSET(*self)[readlen];
-    
-    *endp = (char *)&AR_MISMATCH(*self)[readlen];
-}
-
-static bool platform_cmp(char const platform[], char const test[])
-{
-    unsigned i;
-
-    for (i = 0; ; ++i) {
-        int ch1 = test[i];
-        int ch2 = toupper(platform[i]);
-        
-        if (ch1 != ch2)
-            break;
-        if (ch1 == 0)
-            return true;
-    }
-    return false;
-}
-
-static
-INSDC_SRA_platform_id GetINSDCPlatform(BAMFile const *bam, char const name[]) {
-    if (name) {
-        BAMReadGroup const *rg;
-
-        BAMFileGetReadGroupByName(bam, name, &rg);
-        if (rg && rg->platform) {
-            switch (toupper(rg->platform[0])) {
-            case 'C':
-                if (platform_cmp(rg->platform, "COMPLETE GENOMICS"))
-                    return SRA_PLATFORM_COMPLETE_GENOMICS;
-                if (platform_cmp(rg->platform, "CAPILLARY"))
-                    return SRA_PLATFORM_SANGER;
-                break;
-            case 'H':
-                if (platform_cmp(rg->platform, "HELICOS"))
-                    return SRA_PLATFORM_HELICOS;
-                break;
-            case 'I':
-                if (platform_cmp(rg->platform, "ILLUMINA"))
-                    return SRA_PLATFORM_ILLUMINA;
-                if (platform_cmp(rg->platform, "IONTORRENT"))
-                    return SRA_PLATFORM_ION_TORRENT;
-                break;
-            case 'L':
-                if (platform_cmp(rg->platform, "LS454"))
-                    return SRA_PLATFORM_454;
-                break;
-            case 'P':
-                if (platform_cmp(rg->platform, "PACBIO"))
-                    return SRA_PLATFORM_PACBIO_SMRT;
-                break;
-            case 'S':
-                if (platform_cmp(rg->platform, "SOLID"))
-                    return SRA_PLATFORM_ABSOLID;
-                break;
-            default:
-                break;
-            }
-        }
-    }
-    return SRA_PLATFORM_UNDEFINED;
-}
-
-static
-rc_t CheckLimitAndLogError(void)
-{
-    ++G.errCount;
-    if (G.maxErrCount > 0 && G.errCount > G.maxErrCount) {
-        (void)PLOGERR(klogErr, (klogErr, RC(rcAlign, rcFile, rcReading, rcError, rcExcessive), "Number of errors $(cnt) exceeds limit of $(max): Exiting", "cnt=%u,max=%u", G.errCount, G.maxErrCount));
-        return RC(rcAlign, rcFile, rcReading, rcError, rcExcessive);
-    }
-    return 0;
-}
-
-static
-void RecordNoMatch(char const readName[], char const refName[], uint32_t const refPos)
-{
-    if (G.noMatchLog) {
-        static uint64_t lpos = 0;
-        char logbuf[256];
-        size_t len;
-        
-        if (string_printf(logbuf, sizeof(logbuf), &len, "%s\t%s\t%u\n", readName, refName, refPos) == 0) {
-            KFileWrite(G.noMatchLog, lpos, logbuf, len, NULL);
-            lpos += len;
-        }
-    }
-}
-
-static
-rc_t LogNoMatch(char const readName[], char const refName[], unsigned rpos, unsigned matches)
-{
-    rc_t const rc = CheckLimitAndLogError();
-    static unsigned count = 0;
-    
-    ++count;
-    if (rc) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "This is the last warning; this class of warning occurred $(occurred) times",
-                                 "occurred=%u", count));
-        (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' contains too few ($(count)) matching bases to reference '$(ref)' at $(pos)",
-                                 "name=%s,ref=%s,pos=%u,count=%u", readName, refName, rpos, matches));
-    }
-    else if (G.maxWarnCount_NoMatch == 0 || count < G.maxWarnCount_NoMatch)
-        (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' contains too few ($(count)) matching bases to reference '$(ref)' at $(pos)",
-                                 "name=%s,ref=%s,pos=%u,count=%u", readName, refName, rpos, matches));
-    return rc;
-}
-
-static
-rc_t LogDupConflict(char const readName[])
-{
-    rc_t const rc = CheckLimitAndLogError();
-    static unsigned count = 0;
-    
-    ++count;
-    if (rc) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "This is the last warning; this class of warning occurred $(occurred) times",
-                                 "occurred=%u", count));
-        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                 "Spot '$(name)' is both a duplicate and NOT a duplicate!",
-                                 "name=%s", readName));
-    }
-    else if (G.maxWarnCount_DupConflict == 0 || count < G.maxWarnCount_DupConflict)
-        (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                 "Spot '$(name)' is both a duplicate and NOT a duplicate!",
-                                 "name=%s", readName));
-    return rc;
-}
-
-static rc_t ProcessBAM(char const bamFile[], context_t *ctx, VDatabase *db,
-                       Reference *ref, Sequence *seq, Alignment *align,
-                       bool *had_alignments, bool *had_sequences)
-{
-    const BAMFile *bam;
-    const BAMAlignment *rec;
-    KDataBuffer buf;
-    KDataBuffer fragBuf;
-    KDataBuffer cigBuf;
-    rc_t rc;
-    int32_t lastRefSeqId = -1;
-    size_t rsize;
-    uint64_t keyId = 0;
-    uint64_t reccount = 0;
-    SequenceRecord srec;
-    char spotGroup[512];
-    size_t namelen;
-    unsigned progress = 0;
-    unsigned warned = 0;
-    long     fcountBoth=0;
-    long     fcountOne=0;
-    int skipRefSeqID = -1;
-    uint64_t recordsProcessed = 0;
-    uint64_t filterFlagConflictRecords=0; /*** counts number of conflicts between flags 0x400 and 0x200 ***/
-#define MAX_WARNINGS_FLAG_CONFLICT 10000 /*** maximum errors to report ***/
-
-    bool isColorSpace = false;
-    bool isNotColorSpace = G.noColorSpace;
-    char alignGroup[32];
-    size_t alignGroupLen;
-    
-    rc = OpenBAM(&bam, db, bamFile);
-    if (rc) return rc;
-    if (!G.noVerifyReferences && ref != NULL) {
-        rc = VerifyReferences(bam, ref);
-        if (G.onlyVerifyReferences) {
-            BAMFileRelease(bam);
-            return rc;
-        }
-    }
-    if (ctx->key2id_max == 0) {
-        uint32_t rgcount;
-        unsigned rgi;
-        
-        BAMFileGetReadGroupCount(bam, &rgcount);
-        if (rgcount > (sizeof(ctx->key2id)/sizeof(ctx->key2id[0]) - 1))
-            ctx->key2id_max = 1;
-        else
-            ctx->key2id_max = sizeof(ctx->key2id)/sizeof(ctx->key2id[0]);
-        
-        for (rgi = 0; rgi != rgcount; ++rgi) {
-            BAMReadGroup const *rg;
-            
-            BAMFileGetReadGroup(bam, rgi, &rg);
-            if (rg && rg->platform && platform_cmp(rg->platform, "CAPILLARY")) {
-                G.hasTI = true;
-                break;
-            }
-        }
-    }
-    memset(&srec, 0, sizeof(srec));
-    
-    rc = KDataBufferMake(&cigBuf, 32, 0);
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferMake(&fragBuf, 8, FRAG_CHUNK_SIZE);
-    if (rc)
-        return rc;
-    
-    rc = KDataBufferMake(&buf, (sizeof(int32_t) + sizeof(bool) * 2 + sizeof(char) * 2 + sizeof(uint8_t))*8, 0);
-    if (rc)
-        return rc;
-    
-    if (rc == 0) {
-        (void)PLOGMSG(klogInfo, (klogInfo, "Loading '$(file)'", "file=%s", bamFile));
-    }
-    while (rc == 0 && (rc = Quitting()) == 0) {
-        bool aligned;
-        AlignmentRecord data;
-        uint32_t readlen;
-        uint16_t flags;
-        int64_t rpos=0;
-        char *seqDNA;
-        const BAMRefSeq *refSeq;
-        ctx_value_t *value;
-        bool wasInserted;
-        int32_t refSeqId=-1;
-        uint8_t *qual;
-        bool mated;
-        const char *name;
-        char cskey = 0;
-        bool originally_aligned;
-        bool isPrimary;
-        uint32_t opCount;
-        bool hasCG;
-        uint64_t ti = 0;
-        uint32_t csSeqLen = 0;
-
-        rc = BAMFileRead(bam, &rec);
-        if (rc) {
-            if (GetRCModule(rc) == rcAlign && GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                rc = 0;
-            break;
-        }
-        if ((unsigned)(BAMFileGetProportionalPosition(bam) * 100.0) > progress) {
-            unsigned new_value = BAMFileGetProportionalPosition(bam) * 100.0;
-            KLoadProgressbar_Process(ctx->progress[0], new_value - progress, false);
-            progress = new_value;
-        }
-
-
-        /**************************************************************/
-        if (!G.noColorSpace) {
-            if (BAMAlignmentHasColorSpace(rec)) {/*BAM*/
-                if (isNotColorSpace) {
-                MIXED_BASE_AND_COLOR:
-                    rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);  
-                    (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)' contains base space and color space", "file=%s", bamFile));
-                    goto LOOP_END;
-                }
-                ctx->isColorSpace = isColorSpace = true;
-            }
-            else if (isColorSpace)
-                goto MIXED_BASE_AND_COLOR;
-            else
-                isNotColorSpace = true;
-        }
-        hasCG = BAMAlignmentHasCGData(rec);/*BAM*/
-        if (hasCG) {
-            BAMAlignmentGetCigarCount(rec, &opCount);/*BAM*/
-            rc = KDataBufferResize(&cigBuf, opCount * 2 + 5);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize CIGAR buffer");
-                goto LOOP_END;
-            }
-            
-            rc = KDataBufferResize(&buf, readlen = 35);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize record buffer");
-                goto LOOP_END;
-            }
-            
-            AlignmentRecordInit(&data, buf.base, readlen, &seqDNA);
-            qual = (uint8_t *)&seqDNA[readlen];
-        }
-        else {
-            uint32_t const *tmp;
-            
-            BAMAlignmentGetRawCigar(rec, &tmp, &opCount);/*BAM*/
-            rc = KDataBufferResize(&cigBuf, opCount);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize CIGAR buffer");
-                goto LOOP_END;
-            }
-            memcpy(cigBuf.base, tmp, opCount * sizeof(uint32_t));
-            
-            BAMAlignmentGetReadLength(rec, &readlen);/*BAM*/
-            if (isColorSpace) {
-                BAMAlignmentGetCSSeqLen(rec, &csSeqLen);
-                if (readlen > csSeqLen) {
-                    rc = RC(rcAlign, rcRow, rcReading, rcData, rcInconsistent);
-                    (void)LOGERR(klogErr, rc, "Sequence length and CS Sequence length are inconsistent");
-                    goto LOOP_END;
-                }
-                else if (readlen < csSeqLen)
-                    readlen = 0;
-            }
-            else if (readlen == 0) {
-            }
-            rc = KDataBufferResize(&buf, readlen | csSeqLen);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to resize record buffer");
-                goto LOOP_END;
-            }
-            
-            AlignmentRecordInit(&data, buf.base, readlen | csSeqLen, &seqDNA);
-            qual = (uint8_t *)&seqDNA[readlen | csSeqLen];
-        }
-        BAMAlignmentGetSequence(rec, seqDNA);/*BAM*/
-        if (G.useQUAL) {
-            uint8_t const *squal;
-            
-            BAMAlignmentGetQuality(rec, &squal);/*BAM*/
-            memcpy(qual, squal, readlen);
-        }
-        else {
-            uint8_t const *squal;
-            uint8_t qoffset = 0;
-            unsigned i;
-            
-            rc = BAMAlignmentGetQuality2(rec, &squal, &qoffset);/*BAM*/
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Spot '$(name)': length of original quality does not match sequence", "name=%s", name));
-                goto LOOP_END;
-            }
-            if (qoffset) {
-                for (i = 0; i != readlen; ++i)
-                    qual[i] = squal[i] - qoffset;
-            }
-            else
-                memcpy(qual, squal, readlen);
-        }
-        if (hasCG) {
-            rc = BAMAlignmentGetCGSeqQual(rec, seqDNA, qual);/*BAM*/
-            if (rc == 0)
-                rc = BAMAlignmentGetCGCigar(rec, cigBuf.base, cigBuf.elem_count, &opCount);/*BAM*/
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "Failed to read CG data");
-                goto LOOP_END;
-            }
-        }
-        if (G.hasTI) {
-            rc = BAMAlignmentGetTI(rec, &ti);/*BAM*/
-            if (rc)
-                ti = 0;
-            rc = 0;
-        }
-        data.data.align_group.buffer = alignGroup;
-        if (BAMAlignmentGetCGAlignGroup(rec, alignGroup, sizeof(alignGroup), &alignGroupLen) == 0)/*BAM*/
-            data.data.align_group.elements = alignGroupLen;
-        else
-            data.data.align_group.elements = 0;
-
-        AR_MAPQ(data) = GetMapQ(rec);
-        BAMAlignmentGetFlags(rec, &flags);/*BAM*/
-        BAMAlignmentGetReadName2(rec, &name, &namelen);/*BAM*/
-        {{
-            char const *rgname;
-
-            BAMAlignmentGetReadGroupName(rec, &rgname);/*BAM*/
-            if (rgname)
-                strcpy(spotGroup, rgname);
-            else
-                spotGroup[0] = '\0';
-        }}        
-        AR_REF_ORIENT(data) = (flags & BAMFlags_SelfIsReverse) == 0 ? false : true;/*BAM*/
-        isPrimary = (flags & BAMFlags_IsNotPrimary) == 0 ? true : false;/*BAM*/
-        if (G.noSecondary && !isPrimary)
-            goto LOOP_END;
-        originally_aligned = (flags & BAMFlags_SelfIsUnmapped) == 0;/*BAM*/
-        aligned = originally_aligned && (AR_MAPQ(data) >= G.minMapQual);
-
-        if (isColorSpace && readlen == 0)   /* detect hard clipped colorspace   */
-            aligned = false;                /* reads and make unaligned         */
-        
-        if (aligned && align == NULL) {
-            rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);
-            (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)' contains aligned records", "file=%s", bamFile));
-            goto LOOP_END;
-        }
-        while (aligned) {
-            BAMAlignmentGetPosition(rec, &rpos);/*BAM*/
-            BAMAlignmentGetRefSeqId(rec, &refSeqId);/*BAM*/
-            if (rpos >= 0 && refSeqId >= 0) {
-                if (refSeqId == skipRefSeqID)
-                    goto LOOP_END;
-                if (refSeqId == lastRefSeqId)
-                    break;
-                refSeq = NULL;
-                BAMFileGetRefSeqById(bam, refSeqId, &refSeq);/*BAM*/
-                if (refSeq == NULL) {
-                    rc = RC(rcApp, rcFile, rcReading, rcData, rcInconsistent);
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "File '$(file)': Spot '$(name)' refers to an unknown Reference number $(refSeqId)", "file=%s,refSeqId=%i,name=%s", bamFile, (int)refSeqId, name));
-                    rc = CheckLimitAndLogError();
-                    goto LOOP_END;
-                }
-                else {
-                    if (G.refFilter && strcmp(G.refFilter, refSeq->name) != 0) {
-                        (void)PLOGMSG(klogInfo, (klogInfo, "Skipping Reference '$(name)'", "name=%s", refSeq->name));
-                        skipRefSeqID = refSeqId;
-                        goto LOOP_END;
-                    }
-                    
-                    rc = ReferenceSetFile(ref, refSeq->name, refSeq->length, refSeq->checksum);
-                    if (rc == 0) {
-                        lastRefSeqId = refSeqId;
-                        break;
-                    }
-                    if (GetRCObject(rc) == rcConstraint && GetRCState(rc) == rcViolated) {
-                        int const level = G.limit2config ? klogWarn : klogErr;
-                        
-                        (void)PLOGMSG(level, (level, "Could not find a Reference to match { name: '$(name)', length: $(rlen) }", "name=%s,rlen=%u", refSeq->name, (unsigned)refSeq->length));
-                    }
-                    else if (!G.limit2config)
-                        (void)PLOGERR(klogErr, (klogErr, rc, "File '$(file)': Spot '$(sname)' refers to an unknown Reference '$(rname)'", "file=%s,rname=%s,sname=%s", bamFile, refSeq->name, name));
-                    if (G.limit2config)
-                        rc = 0;
-                    goto LOOP_END;
-                }
-            }
-            else if (refSeqId < 0) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' was marked aligned, but reference id = $(id) is invalid", "name=%.*s,id=%i", namelen, name, refSeqId));
-                if ((rc = CheckLimitAndLogError()) != 0) goto LOOP_END;
-            }
-            else {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' was marked aligned, but reference position = $(pos) is invalid", "name=%.*s,pos=%i", namelen, name, rpos));
-                if ((rc = CheckLimitAndLogError()) != 0) goto LOOP_END;
-            }
-
-            aligned = false;
-        }
-        if (!aligned && (G.refFilter != NULL || G.limit2config))
-            goto LOOP_END;
-        
-        rc = GetKeyID(ctx, &keyId, &wasInserted, spotGroup, name, namelen);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "KBTreeEntry: failed on key '$(key)'", "key=%.*s", namelen, name));
-            goto LOOP_END;
-        }
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "MMArrayGet: failed on id '$(id)'", "id=%u", keyId));
-            goto LOOP_END;
-        }
-        
-        AR_KEY(data) = keyId;
-        
-        mated = false;
-        if (flags & BAMFlags_WasPaired) {/*BAM*/
-            if ((flags & BAMFlags_IsFirst) != 0)/*BAM*/
-                AR_READNO(data) |= 1;
-            if ((flags & BAMFlags_IsSecond) != 0)/*BAM*/
-                AR_READNO(data) |= 2;
-            switch (AR_READNO(data)) {
-            case 1:
-            case 2:
-                mated = true;
-                break;
-            case 0:
-                if ((warned & 1) == 0) {
-                    (void)LOGMSG(klogWarn, "Spots without fragment info have been encountered");
-                    warned |= 1;
-                }
-                break;
-            case 3:
-                if ((warned & 2) == 0) {
-                    (void)LOGMSG(klogWarn, "Spots with more than two fragments have been encountered");
-                    warned |= 2;
-                }
-                break;
-            }
-        }
-        if (!mated)
-            AR_READNO(data) = 1;
-        
-        if (wasInserted) {
-            memset(value, 0, sizeof(*value));
-            value->unmated = !mated;
-            value->pcr_dup = (flags & BAMFlags_IsDuplicate) == 0 ? 0 : 1;/*BAM*/
-            value->platform = GetINSDCPlatform(bam, spotGroup);
-        }
-        else {
-            if (!G.acceptBadDups && value->pcr_dup != ((flags & BAMFlags_IsDuplicate) == 0 ? 0 : 1)) {/*BAM*/
-                rc = LogDupConflict(name);
-                goto LOOP_END; /* TODO: is this correct? */
-            }
-            value->pcr_dup &= (flags & BAMFlags_IsDuplicate) == 0 ? 0 : 1;/*BAM*/
-            if (mated && value->unmated) {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                         "Spot '$(name)', which was first seen without mate info, now has mate info",
-                                         "name=%s", name));
-                rc = CheckLimitAndLogError();
-                goto LOOP_END;
-            }
-            else if (!mated && !value->unmated) {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcApp, rcFile, rcReading, rcData, rcInconsistent),
-                                         "Spot '$(name)', which was first seen with mate info, now has no mate info",
-                                         "name=%s", name));
-                rc = CheckLimitAndLogError();
-                goto LOOP_END;
-            }
-        }
-        
-        ++recordsProcessed;
-
-        if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                if (CTX_VALUE_GET_P_ID(*value, 0) != 0)
-                    isPrimary = false;
-                else if (aligned && value->unaligned_1) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Read 1 of spot '$(name)', which was unmapped, is now being mapped at position $(pos) on reference '$(ref)'; this alignment will be considered as secondary", "name=%s,ref=%s,pos=%u", name, refSeq->name, rpos));
-                    isPrimary = false;
-                }
-                break;
-            case 2:
-                if (CTX_VALUE_GET_P_ID(*value, 1) != 0)
-                    isPrimary = false;
-                else if (aligned && value->unaligned_2) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Read 2 of spot '$(name)', which was unmapped, is now being mapped at position $(pos) on reference '$(ref)'; this alignment will be considered as secondary", "name=%s,ref=%s,pos=%u", name, refSeq->name, rpos));
-                    isPrimary = false;
-                }
-                break;
-            default:
-                break;
-            }
-        }
-        data.isPrimary = isPrimary;
-        if (aligned) {
-            uint32_t matches = 0;
-            
-            rc = ReferenceRead(ref, &data, rpos, cigBuf.base, opCount, seqDNA, readlen, &matches);
-            if (rc) {
-                aligned = false;
-                
-                if (   (GetRCState(rc) == rcViolated  && GetRCObject(rc) == rcConstraint)
-                    || (GetRCState(rc) == rcExcessive && GetRCObject(rc) == rcRange))
-                {
-                    RecordNoMatch(name, refSeq->name, rpos);
-                }
-                if (GetRCState(rc) == rcViolated && GetRCObject(rc) == rcConstraint) {
-                    rc = LogNoMatch(name, refSeq->name, (unsigned)rpos, (unsigned)matches);
-                }
-                else if (GetRCObject(rc) == rcData && GetRCState(rc) == rcInvalid) {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': bad alignment to reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq->name, rpos));
-                    CheckLimitAndLogError();
-                }
-                else if (GetRCObject(rc) == rcData) {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': bad alignment to reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq->name, rpos));
-                    rc = CheckLimitAndLogError();
-                }
-                else {
-                    (void)PLOGERR(klogWarn, (klogWarn, rc, "Spot '$(name)': error reading reference '$(ref)' at $(pos)", "name=%s,ref=%s,pos=%u", name, refSeq->name, rpos));
-                    rc = CheckLimitAndLogError();
-                }
-                if (rc) goto LOOP_END;
-            }
-        }
-        if (isColorSpace) {
-            /* must be after ReferenceRead */
-            BAMAlignmentGetCSKey(rec, &cskey);/*BAM*/
-            BAMAlignmentGetCSSequence(rec, seqDNA, csSeqLen);/*BAM*/
-            if (!aligned && !G.useQUAL) {
-                uint8_t const *squal;
-                uint8_t qoffset = 0;
-                
-                rc = BAMAlignmentGetCSQuality(rec, &squal, &qoffset);/*BAM*/
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Spot '$(name)': length of colorspace quality does not match sequence", "name=%s", name));
-                    goto LOOP_END;
-                }
-                if (qoffset) {
-                    unsigned i;
-                    
-                    for (i = 0; i < csSeqLen; ++i)
-                        qual[i] = squal[i] - qoffset;
-                }
-                else
-                    memcpy(qual, squal, csSeqLen);
-                readlen = csSeqLen;
-            }
-        }
-        
-        if (aligned) {
-            if (G.editAlignedQual ) EditAlignedQualities  (qual, AR_HAS_MISMATCH(data), readlen);
-            if (G.keepMismatchQual) EditUnalignedQualities(qual, AR_HAS_MISMATCH(data), readlen);
-        }
-        else if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                value->unaligned_1 = 1;
-                break;
-            case 2:
-                value->unaligned_2 = 1;
-                break;
-            default:
-                break;
-            }
-        }
-        if (isPrimary) {
-            switch (AR_READNO(data)) {
-            case 1:
-                if (CTX_VALUE_GET_P_ID(*value, 0) == 0 && aligned) {
-                    data.alignId = ++ctx->primaryId;
-                    CTX_VALUE_SET_P_ID(*value, 0, data.alignId);
-                }
-                break;
-            case 2:
-                if (CTX_VALUE_GET_P_ID(*value, 1) == 0 && aligned) {
-                    data.alignId = ++ctx->primaryId;
-                    CTX_VALUE_SET_P_ID(*value, 1, data.alignId);
-                }
-                break;
-            default:
-                break;
-            }
-        }
-        if (mated) {
-            if (isPrimary || !originally_aligned) {
-                if (CTX_VALUE_GET_S_ID(*value) != 0) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)' has already been assigned a spot id", "name=%.*s", namelen, name));
-                }
-                else if (!value->has_a_read) {
-                    /* new mated fragment - do spot assembly */
-                    unsigned sz;
-                    uint64_t    fragmentId;
-                    FragmentInfo fi;
-                    KMemBank *frags;
-                    int32_t mate_refSeqId = -1;
-                    int64_t pnext = 0;
-                    
-                    memset(&fi, 0, sizeof(fi));
-                    fi.aligned = aligned;
-                    fi.ti = ti;
-                    fi.orientation = AR_REF_ORIENT(data);
-                    fi.otherReadNo = AR_READNO(data);
-                    fi.sglen   = strlen(spotGroup);
-                    fi.readlen = readlen;
-                    fi.cskey = cskey;
-                    fi.is_bad = (flags & BAMFlags_IsLowQuality) != 0;/*BAM*/
-                    sz = sizeof(fi) + 2*fi.readlen + fi.sglen;
-                    if (align) {
-                        BAMAlignmentGetMateRefSeqId(rec, &mate_refSeqId);/*BAM*/
-                        BAMAlignmentGetMatePosition(rec, &pnext);/*BAM*/
-                    }
-                    if(align && mate_refSeqId == refSeqId && pnext > 0 && pnext!=rpos /*** weird case in some bams**/){ 
-                        frags = ctx->fragsBoth;
-                        rc = KMemBankAlloc(frags, &fragmentId, sz, 0);
-                        value->fragmentId = fragmentId*2;
-                        fcountBoth++;
-                    } else {
-                        frags = ctx->fragsOne;
-                        rc = KMemBankAlloc(frags, &fragmentId, sz, 0);
-                        value->fragmentId = fragmentId*2+1;
-                        fcountOne++;
-                    }
-                    if (rc) {
-                        (void)LOGERR(klogErr, rc, "KMemBankAlloc failed");
-                        goto LOOP_END;
-                    }
-                    /*printf("IN:%10d\tcnt2=%ld\tcnt1=%ld\n",value->fragmentId,fcountBoth,fcountOne);*/
-                    
-                    rc = KDataBufferResize(&fragBuf, sz);
-                    if (rc) {
-                        (void)LOGERR(klogErr, rc, "Failed to resize fragment buffer");
-                        goto LOOP_END;
-                    }
-                    {{
-                        uint8_t *dst = (uint8_t*) fragBuf.base;
-                        memcpy(dst,&fi,sizeof(fi));
-                        dst += sizeof(fi);
-                        COPY_READ((char *)dst, seqDNA, fi.readlen, (isColorSpace && !aligned) ? 0 : fi.orientation);
-                        dst += fi.readlen;
-                        COPY_QUAL(dst, qual, fi.readlen, (isColorSpace && !aligned) ? 0 : fi.orientation);
-                        dst += fi.readlen;
-                        memcpy(dst,spotGroup,fi.sglen);
-                    }}
-                    rc = KMemBankWrite(frags, fragmentId, 0, fragBuf.base, sz, &rsize);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankWrite failed writing fragment $(id)", "id=%u", fragmentId));
-                        goto LOOP_END;
-                    }
-                    value->has_a_read = 1;
-                }
-                else if (value->fragmentId != 0 ) {
-                    /* might be second fragment */
-                    uint64_t sz;
-                    FragmentInfo *fip;
-                    KMemBank *frags;
-                    
-                    if(value->fragmentId & 1) frags = ctx->fragsOne;
-                    else               frags = ctx->fragsBoth; 
-                    
-                    rc=KMemBankSize(frags, value->fragmentId>>1, &sz);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankSize failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                        goto LOOP_END;
-                    }
-                    rc=KDataBufferResize(&fragBuf, (size_t)sz);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to resize fragment buffer", ""));
-                        goto LOOP_END;
-                    }
-                    rc=KMemBankRead(frags, value->fragmentId>>1, 0, fragBuf.base, sz, &rsize);
-                    if (rc) {
-                        (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankRead failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                        goto LOOP_END;
-                    }
-                    
-                    assert( rsize == sz );
-                    fip = (FragmentInfo *) fragBuf.base;
-                    if(AR_READNO(data) != fip->otherReadNo) {
-                        /* mate found */
-                        unsigned readLen[2];
-                        unsigned read1 = 0;
-                        unsigned read2 = 1;
-                        uint8_t  *src  = (uint8_t*) fip + sizeof(*fip);
-                        
-                        if (AR_READNO(data) < fip->otherReadNo) {
-                            read1 = 1;
-                            read2 = 0;
-                        }
-                        readLen[read1] = fip->readlen;
-                        readLen[read2] = readlen;
-                        rc = SequenceRecordInit(&srec, 2, readLen);
-                        if (rc) {
-                            (void)PLOGERR(klogErr, (klogErr, rc, "Failed resizing sequence record buffer", ""));
-                            goto LOOP_END;
-                        }
-                        srec.ti[read1] = fip->ti;
-                        srec.aligned[read1] = fip->aligned;
-                        srec.is_bad[read1] = fip->is_bad;
-                        srec.orientation[read1] = fip->orientation;
-                        srec.cskey[read1] = fip->cskey;
-                        memcpy(srec.seq + srec.readStart[read1], src, fip->readlen);
-                        src += fip->readlen;
-                        memcpy(srec.qual + srec.readStart[read1], src, fip->readlen);
-                        src += fip->readlen;
-                        
-                        srec.orientation[read2] = AR_REF_ORIENT(data);
-                        COPY_READ(srec.seq + srec.readStart[read2], seqDNA, srec.readLen[read2], (isColorSpace && !aligned) ? 0 : srec.orientation[read2]);
-                        COPY_QUAL(srec.qual + srec.readStart[read2], qual, srec.readLen[read2],  (isColorSpace && !aligned) ? 0 : srec.orientation[read2]);
-
-                        srec.keyId = keyId;
-                        srec.is_bad[read2] = (flags & BAMFlags_IsLowQuality) != 0;
-                        srec.aligned[read2] = aligned;
-                        srec.cskey[read2] = cskey;
-                        srec.ti[read2] = ti;
-                        
-                        srec.spotGroup = spotGroup;
-                        srec.spotGroupLen = strlen(spotGroup);
-                        if (value->pcr_dup && (srec.is_bad[0] || srec.is_bad[1])) {
-                            filterFlagConflictRecords++;
-                            if(filterFlagConflictRecords < MAX_WARNINGS_FLAG_CONFLICT){
-                                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)': both 0x400 and 0x200 flag bits set, only 0x400 will be saved", "name=%s", name));
-                            } else if(filterFlagConflictRecords == MAX_WARNINGS_FLAG_CONFLICT){
-                                (void)PLOGMSG(klogWarn, (klogWarn, "Last reported warning: Spot '$(name)': both 0x400 and 0x200 flag bits set, only 0x400 will be saved", "name=%s", name));
-                            }
-                        }
-                        rc = SequenceWriteRecord(seq, &srec, isColorSpace, value->pcr_dup, value->platform);
-                        if (rc) {
-                            (void)LOGERR(klogErr, rc, "SequenceWriteRecord failed");
-                            goto LOOP_END;
-                        }
-                        CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-                        if(value->fragmentId & 1){
-                            fcountOne--;
-                        } else {
-                            fcountBoth--;
-                        }
-                        /*	printf("OUT:%9d\tcnt2=%ld\tcnt1=%ld\n",value->fragmentId,fcountBoth,fcountOne);*/
-                        rc = KMemBankFree(frags, value->fragmentId>>1);
-                        if (rc) {
-                            (void)PLOGERR(klogErr, (klogErr, rc, "KMemBankFree failed on fragment $(id)", "id=%u", value->fragmentId>>1));
-                            goto LOOP_END;
-                        }
-                        value->fragmentId = 0;
-                    }
-                }
-            }
-            if (!isPrimary && aligned) {
-                int32_t bam_mrid;
-                int64_t mpos;
-                int64_t mrid;
-                int64_t tlen;
-                
-                BAMAlignmentGetMatePosition(rec, &mpos);/*BAM*/
-                BAMAlignmentGetMateRefSeqId(rec, &bam_mrid);/*BAM*/
-                BAMAlignmentGetInsertSize(rec, &tlen);/*BAM*/
-                
-                if (mpos >= 0 && bam_mrid >= 0 && tlen != 0) {
-                    BAMRefSeq const *mref;/*BAM*/
-                    
-                    BAMFileGetRefSeq(bam, bam_mrid, &mref);/*BAM*/
-                    if (mref) {
-                        rc_t rc_temp = ReferenceGet1stRow(ref, &mrid, mref->name);
-                        if (rc_temp == 0) {
-                            data.mate_ref_pos = mpos;
-                            data.template_len = tlen;
-                            data.mate_ref_orientation = (flags & BAMFlags_MateIsReverse) ? 1 : 0;
-                        }
-                        else {
-                            (void)PLOGERR(klogWarn, (klogWarn, rc_temp, "Failed to get refID for $(name)", "name=%s", mref->name));
-                            mrid = 0;
-                        }
-                        data.mate_ref_id = mrid;
-                    }
-                }
-            }
-        }
-        else if (wasInserted & (isPrimary || !originally_aligned)) {
-            /* new unmated fragment - no spot assembly */
-            unsigned readLen[1];
-            
-            readLen[0] = readlen;
-            rc = SequenceRecordInit(&srec, 1, readLen);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failed resizing sequence record buffer", ""));
-                goto LOOP_END;
-            }
-            srec.ti[0] = ti;
-            srec.aligned[0] = aligned;
-            srec.is_bad[0] = (flags & BAMFlags_IsLowQuality) != 0;
-            srec.orientation[0] = AR_REF_ORIENT(data);
-            srec.cskey[0] = cskey;
-            COPY_READ(srec.seq  + srec.readStart[0], seqDNA, readlen, (isColorSpace && !aligned) ? 0 : srec.orientation[0]);
-            COPY_QUAL(srec.qual + srec.readStart[0], qual, readlen, (isColorSpace && !aligned) ? 0 : srec.orientation[0]);
-	     
-            srec.keyId = keyId;
-            
-            srec.spotGroup = spotGroup;
-            srec.spotGroupLen = strlen(spotGroup);
-            if (value->pcr_dup && srec.is_bad[0]) {
-                filterFlagConflictRecords++;
-                if (filterFlagConflictRecords < MAX_WARNINGS_FLAG_CONFLICT) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(name)': both 0x400 and 0x200 flag bits set, only 0x400 will be saved", "name=%s", name));
-                }
-                else if (filterFlagConflictRecords == MAX_WARNINGS_FLAG_CONFLICT) {
-                    (void)PLOGMSG(klogWarn, (klogWarn, "Last reported warning: Spot '$(name)': both 0x400 and 0x200 flag bits set, only 0x400 will be saved", "name=%s", name));
-		}
-            }
-            rc = SequenceWriteRecord(seq, &srec, isColorSpace, value->pcr_dup, value->platform);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "SequenceWriteRecord failed", ""));
-                goto LOOP_END;
-            }
-            CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-            value->fragmentId = 0;
-        }
-        
-        if (aligned) {
-            if (value->alignmentCount[AR_READNO(data) - 1] < 254)
-                ++value->alignmentCount[AR_READNO(data) - 1];
-            ++ctx->alignCount;
-            
-            assert(keyId >> 32 < ctx->key2id_count);
-            assert((uint32_t)keyId < ctx->idCount[keyId >> 32]);
-            
-            rc = AlignmentWriteRecord(align, &data);
-            if (rc == 0) {
-                if (!isPrimary)
-                    data.alignId = ++ctx->secondId;
-                
-                rc = ReferenceAddAlignId(ref, data.alignId, isPrimary);
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "ReferenceAddAlignId failed", ""));
-                }
-                else {
-                    *had_alignments = true;
-                }
-            }
-            else {
-                (void)PLOGERR(klogErr, (klogErr, rc, "AlignmentWriteRecord failed", ""));
-            }
-        }
-        /**************************************************************/
-        
-    LOOP_END:
-        BAMAlignmentRelease(rec);
-        ++reccount;
-        if (G.maxAlignCount > 0 && reccount >= G.maxAlignCount)
-            break;
-        if (rc == 0)
-            *had_sequences = true;
-    }
-    if (filterFlagConflictRecords > 0) {
-        (void)PLOGMSG(klogWarn, (klogWarn, "$(cnt1) out of $(cnt2) records contained warning : both 0x400 and 0x200 flag bits set, only 0x400 will be saved", "cnt1=%lu,cnt2=%lu", filterFlagConflictRecords,recordsProcessed));
-    }
-    if (rc == 0 && recordsProcessed == 0) {
-        (void)LOGMSG(klogWarn, (G.limit2config || G.refFilter != NULL) ? 
-                     "All records from the file were filtered out" :
-                     "The file contained no records that were processed.");
-        rc = RC(rcAlign, rcFile, rcReading, rcData, rcEmpty);
-    }
-    BAMFileRelease(bam);
-    KDataBufferWhack(&buf);
-    KDataBufferWhack(&fragBuf);
-    KDataBufferWhack(&srec.storage);
-    KDataBufferWhack(&cigBuf);
-    return rc;
-}
-
-static rc_t WriteSoloFragments(context_t *ctx, Sequence *seq)
-{
-    uint32_t i;
-    unsigned j;
-    uint32_t fcountOne  = 0;
-    uint32_t fcountBoth = 0;
-    uint64_t idCount = 0;
-    rc_t rc;
-    KDataBuffer fragBuf;
-    SequenceRecord srec;
-    
-    ++ctx->pass;
-    memset(&srec, 0, sizeof(srec));
-    
-    rc = KDataBufferMake(&fragBuf, 8, 0);
-    if (rc) {
-        (void)LOGERR(klogErr, rc, "KDataBufferMake failed");
-        return rc;
-    }
-    for (idCount = 0, j = 0; j < ctx->key2id_count; ++j) {
-        idCount += ctx->idCount[j];
-    }
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], idCount);
-    
-    for (idCount = 0, j = 0; j < ctx->key2id_count; ++j) {
-        for (i = 0; i != ctx->idCount[j]; ++i, ++idCount) {
-            uint64_t const keyId = ((uint64_t)j << 32) | i;
-            ctx_value_t *value;
-            size_t rsize;
-            uint64_t id;
-            uint64_t sz;
-            unsigned readLen[2];
-            unsigned read = 0;
-            FragmentInfo const *fip;
-            uint8_t const *src;
-            KMemBank *frags;
-            
-            rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-            if (rc)
-                break;
-            KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-            if (value->fragmentId == 0)
-                continue;
-            if (value->fragmentId & 1) {
-                frags = ctx->fragsOne;
-                fcountOne++;
-            }
-            else {
-                frags = ctx->fragsBoth; 
-                fcountBoth++;
-            }
-            id = value->fragmentId >> 1;
-            
-            rc = KMemBankSize(frags, id, &sz);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KMemBankSize failed");
-                break;
-            }
-            rc = KDataBufferResize(&fragBuf, (size_t)sz);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KDataBufferResize failed");
-                break;
-            }
-            rc = KMemBankRead(frags, id, 0, fragBuf.base, sz, &rsize);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "KMemBankRead failed");
-                break;
-            }
-            assert( rsize == sz );
-            fip = (FragmentInfo const *)fragBuf.base;
-            src = (uint8_t const *)&fip[1];
-            
-            readLen[0] = readLen[1] = 0;
-            if (!value->unmated && (   (fip->aligned && CTX_VALUE_GET_P_ID(*value, 0) == 0)
-                                    || (value->unaligned_2)))
-            {
-                read = 1;
-            }
-            
-            readLen[read] = fip->readlen;
-            rc = SequenceRecordInit(&srec, value->unmated ? 1 : 2, readLen);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "SequenceRecordInit failed");
-                break;
-            }
-            
-            srec.ti[read] = fip->ti;
-            srec.aligned[read] = fip->aligned;
-            srec.is_bad[read] = fip->is_bad;
-            srec.orientation[read] = fip->orientation;
-            srec.cskey[read] = fip->cskey;
-            memcpy(srec.seq + srec.readStart[read], src, srec.readLen[read]);
-            src += fip->readlen;
-            memcpy(srec.qual + srec.readStart[read], src, srec.readLen[read]);
-            src += fip->readlen;
-            srec.spotGroup = (char *)src;
-            srec.spotGroupLen = fip->sglen;
-            srec.keyId = keyId;
-            
-            rc = SequenceWriteRecord(seq, &srec, ctx->isColorSpace, value->pcr_dup, value->platform);
-            if (rc) {
-                (void)LOGERR(klogErr, rc, "SequenceWriteRecord failed");
-                break;
-            }
-            /*rc = KMemBankFree(frags, id);*/
-            CTX_VALUE_SET_S_ID(*value, ++ctx->spotId);
-        }
-    }
-    /*printf("DONE_SOLO:\tcnt2=%d\tcnt1=%d\n",fcountBoth,fcountOne);*/
-    KDataBufferWhack(&fragBuf);
-    KDataBufferWhack(&srec.storage);
-    return rc;
-}
-
-static rc_t SequenceUpdateAlignInfo(context_t *ctx, Sequence *seq)
-{
-    rc_t rc = 0;
-    uint64_t row;
-    const ctx_value_t *value;
-    uint64_t keyId;
-    
-    ++ctx->pass;
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], ctx->spotId + 1);
-    
-    for (row = 1; row <= ctx->spotId; ++row) {
-        rc = SequenceReadKey(seq, row, &keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to get key for row $(row)", "row=%u", (unsigned)row));
-            break;
-        }
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc) {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to read info for row $(row), index $(idx)", "row=%u,idx=%u", (unsigned)row, (unsigned)keyId));
-            break;
-        }
-        if (row != CTX_VALUE_GET_S_ID(*value)) {
-            rc = RC(rcApp, rcTable, rcWriting, rcData, rcUnexpected);
-            (void)PLOGMSG(klogErr, (klogErr, "Unexpected spot id $(spotId) for row $(row), index $(idx)", "spotId=%u,row=%u,idx=%u", (unsigned)CTX_VALUE_GET_S_ID(*value), (unsigned)row, (unsigned)keyId));
-            break;
-        }
-        {{
-            int64_t primaryId[2];
-            uint64_t const spotId = CTX_VALUE_GET_S_ID(*value);
-            
-            primaryId[0] = CTX_VALUE_GET_P_ID(*value, 0);
-            primaryId[1] = CTX_VALUE_GET_P_ID(*value, 1);
-            
-            rc = SequenceUpdateAlignData(seq, row, value->unmated ? 1 : 2,
-                                         primaryId,
-                                         value->alignmentCount);
-        }}
-        if (rc) {
-            (void)LOGERR(klogErr, rc, "Failed updating Alignment data in sequence table");
-            break;
-        }
-        KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-    }
-    return rc;
-}
-
-static rc_t AlignmentUpdateSpotInfo(context_t *ctx, Alignment *align)
-{
-    rc_t rc;
-    uint64_t keyId;
-    
-    ++ctx->pass;
-
-    KLoadProgressbar_Append(ctx->progress[ctx->pass - 1], ctx->alignCount);
-
-    rc = AlignmentStartUpdatingSpotIds(align);
-    while (rc == 0 && (rc = Quitting()) == 0) {
-        ctx_value_t const *value;
-        
-        rc = AlignmentGetSpotKey(align, &keyId);
-        if (rc) {
-            if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                rc = 0;
-            break;
-        }
-        assert(keyId >> 32 < ctx->key2id_count);
-        assert((uint32_t)keyId < ctx->idCount[keyId >> 32]);
-        rc = MMArrayGet(ctx->id2value, (void **)&value, keyId);
-        if (rc == 0) {
-            int64_t const spotId = CTX_VALUE_GET_S_ID(*value);
-            
-            if (spotId == 0) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Spot '$(id)' was never assigned a spot id, probably has no primary alignments", "id=%lx", keyId));
-                /* (void)PLOGMSG(klogWarn, (klogWarn, "Spot #$(i): { $(s) }", "i=%lu,s=%s", keyId, Print_ctx_value_t(value))); */
-            }
-            rc = AlignmentWriteSpotId(align, spotId);
-        }
-        KLoadProgressbar_Process(ctx->progress[ctx->pass - 1], 1, false);
-    }
-    return rc;
-}
-
-static rc_t ArchiveBAM(VDBManager *mgr, VDatabase *db,
-                       unsigned bamFiles, char const *bamFile[],
-                       unsigned seqFiles, char const *seqFile[],
-                       bool *has_alignments)
-{
-    rc_t rc = 0;
-    rc_t rc2;
-    Reference ref;
-    Sequence seq;
-    Alignment *align;
-    context_t ctx;
-    bool has_sequences = false;
-    unsigned i;
-    
-    *has_alignments = false;
-    rc = ReferenceInit(&ref, mgr, db);
-    if (rc)
-        return rc;
-    
-    if (G.onlyVerifyReferences) {
-        for (i = 0; i < bamFiles && rc == 0; ++i) {
-            rc = ProcessBAM(bamFile[i], NULL, db, &ref, NULL, NULL, NULL, NULL);
-        }
-        ReferenceWhack(&ref, false);
-        return rc;
-    }
-    SequenceInit(&seq, db);
-    align = AlignmentMake(db);
-    
-    rc = SetupContext(&ctx, bamFiles + seqFiles);
-    if (rc)
-        return rc;
-    
-    ++ctx.pass;
-    for (i = 0; i < bamFiles && rc == 0; ++i) {
-        bool this_has_alignments = false;
-        bool this_has_sequences = false;
-        
-        rc = ProcessBAM(bamFile[i], &ctx, db, &ref, &seq, align, &this_has_alignments, &this_has_sequences);
-        *has_alignments |= this_has_alignments;
-        has_sequences |= this_has_sequences;
-    }
-    for (i = 0; i < seqFiles && rc == 0; ++i) {
-        bool this_has_alignments = false;
-        bool this_has_sequences = false;
-        
-        rc = ProcessBAM(seqFile[i], &ctx, db, &ref, &seq, align, &this_has_alignments, &this_has_sequences);
-        *has_alignments |= this_has_alignments;
-        has_sequences |= this_has_sequences;
-    }
-/*** No longer need memory for key2id ***/
-    for (i = 0; i != ctx.key2id_count; ++i) {
-        KBTreeDropBacking(ctx.key2id[i]);
-        KBTreeRelease(ctx.key2id[i]);
-        ctx.key2id[i] = NULL;
-    }
-    free(ctx.key2id_names);
-    ctx.key2id_names = NULL;
-/*******************/
-
-    if (has_sequences) {
-        if (rc == 0 && (rc = Quitting()) == 0) {
-            (void)LOGMSG(klogInfo, "Writing unpaired sequences");
-            rc = WriteSoloFragments(&ctx, &seq);
-            ContextReleaseMemBank(&ctx);
-            if (rc == 0) {
-                rc = SequenceDoneWriting(&seq);
-                if (rc == 0) {
-                    (void)LOGMSG(klogInfo, "Updating sequence alignment info");
-                    rc = SequenceUpdateAlignInfo(&ctx, &seq);
-                }
-            }
-        }
-    }
-    
-    if (*has_alignments && rc == 0 && (rc = Quitting()) == 0) {
-        (void)LOGMSG(klogInfo, "Writing alignment spot ids");
-        rc = AlignmentUpdateSpotInfo(&ctx, align);
-    }
-    rc2 = AlignmentWhack(align, *has_alignments && rc == 0 && (rc = Quitting()) == 0);
-    if (rc == 0)
-        rc = rc2;
-
-    rc2 = ReferenceWhack(&ref, *has_alignments && rc == 0 && (rc = Quitting()) == 0);
-    if (rc == 0)
-        rc = rc2;
-    
-    SequenceWhack(&seq, rc == 0);
-    
-    ContextRelease(&ctx);
-
-    if (rc == 0) {
-        (void)LOGMSG(klogInfo, "Successfully loaded all files");
-    }
-    return rc;
-}
-
-rc_t WriteLoaderSignature(KMetadata *meta, char const progName[])
-{
-    KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeUpdate(meta, &node, "/");
-    
-    if (rc == 0) {
-        rc = KLoaderMeta_Write(node, progName, __DATE__, "BAM", KAppVersion());
-        KMDataNodeRelease(node);
-    }
-    if (rc) {
-        (void)LOGERR(klogErr, rc, "Cannot update loader meta");
-    }
-    return rc;
-}
-
-rc_t OpenPath(char const path[], KDirectory **dir)
-{
-    KDirectory *p;
-    rc_t rc = KDirectoryNativeDir(&p);
-    
-    if (rc == 0) {
-        rc = KDirectoryOpenDirUpdate(p, dir, false, path);
-        KDirectoryRelease(p);
-    }
-    return rc;
-}
-
-static
-rc_t ConvertDatabaseToUnmapped(VDatabase *db)
-{
-    VTable* tbl;
-    rc_t rc = VDatabaseOpenTableUpdate(db, &tbl, "SEQUENCE");
-    if (rc == 0) 
-    {
-        VTableRenameColumn(tbl, false, "CMP_ALTREAD", "ALTREAD");
-        VTableRenameColumn(tbl, false, "CMP_READ", "READ");
-        VTableRenameColumn(tbl, false, "CMP_ALTCSREAD", "ALTCSREAD");
-        VTableRenameColumn(tbl, false, "CMP_CSREAD", "CSREAD");
-        rc = VTableRelease(tbl);
-    }
-    return rc;
-}
-rc_t run(char const progName[],
-         unsigned bamFiles, char const *bamFile[],
-         unsigned seqFiles, char const *seqFile[])
-{
-    VDBManager *mgr;
-    rc_t rc;
-    rc_t rc2;
-    char const *db_type = G.expectUnsorted ? "NCBI:align:db:alignment_unsorted" : "NCBI:align:db:alignment_sorted";
-    
-    rc = VDBManagerMakeUpdate(&mgr, NULL);
-    if (rc) {
-        (void)LOGERR (klogErr, rc, "failed to create VDB Manager!");
-    }
-    else {
-        bool has_alignments = false;
-            
-        if (G.onlyVerifyReferences) {
-            rc = ArchiveBAM(mgr, NULL, bamFiles, bamFile, 0, NULL, &has_alignments);
-        }
-        else {
-            VSchema *schema;
-        
-            rc = VDBManagerMakeSchema(mgr, &schema);
-            if (rc) {
-                (void)LOGERR (klogErr, rc, "failed to create schema");
-            }
-            else {
-                (void)(rc = VSchemaAddIncludePath(schema, G.schemaIncludePath));
-                rc = VSchemaParseFile(schema, G.schemaPath);
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc, "failed to parse schema file $(file)", "file=%s", G.schemaPath));
-                }
-                else {
-                    VDatabase *db;
-                    
-                    rc = VDBManagerCreateDB(mgr, &db, schema, db_type,
-                                            kcmInit + kcmMD5, G.outpath);
-                    rc2 = VSchemaRelease(schema);
-                    if (rc2)
-                        (void)LOGERR(klogWarn, rc2, "Failed to release schema");
-                    if (rc == 0)
-                        rc = rc2;
-                    if (rc == 0) {
-                        rc = ArchiveBAM(mgr, db, bamFiles, bamFile, seqFiles, seqFile, &has_alignments);
-                        if (rc == 0 && !has_alignments) {
-                            rc = ConvertDatabaseToUnmapped(db);
-                        }
-                        
-                        rc2 = VDatabaseRelease(db);
-                        if (rc2)
-                            (void)LOGERR(klogWarn, rc2, "Failed to close database");
-                        if (rc == 0)
-                            rc = rc2;
-                        
-                        if (rc == 0) {
-                            KMetadata *meta;
-                            KDBManager *kmgr;
-                            
-                            rc = VDBManagerOpenKDBManagerUpdate(mgr, &kmgr);
-                            if (rc == 0) {
-                                KDatabase *kdb;
-                                
-                                rc = KDBManagerOpenDBUpdate(kmgr, &kdb, G.outpath);
-                                if (rc == 0) {
-                                    rc = KDatabaseOpenMetadataUpdate(kdb, &meta);
-                                    KDatabaseRelease(kdb);
-                                }
-                                KDBManagerRelease(kmgr);
-                            }
-                            if (rc == 0) {
-                                rc = WriteLoaderSignature(meta, progName);
-                                KMetadataRelease(meta);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        rc2 = VDBManagerRelease(mgr);
-        if (rc2)
-            (void)LOGERR(klogWarn, rc2, "Failed to release VDB Manager");
-        if (rc == 0)
-            rc = rc2;
-    }
-    return rc;
-}
diff --git a/tools/bam-loader/loader-imp.h b/tools/bam-loader/loader-imp.h
deleted file mode 100644
index 6f524a7..0000000
--- a/tools/bam-loader/loader-imp.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-rc_t run(char const argv0[],
-         unsigned countAligned, char const *bamFile[],
-         unsigned countUnaligned, char const *unaligned[]);
diff --git a/tools/bam-loader/reference-writer.c b/tools/bam-loader/reference-writer.c
deleted file mode 100644
index af44f10..0000000
--- a/tools/bam-loader/reference-writer.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <kfs/file.h>
-
-#include <kapp/main.h> /* for Quitting */
-
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <align/writer-refseq.h>
-
-#include "reference-writer.h"
-#include "Globals.h"
-
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-#define SORTED_OPEN_TABLE_LIMIT (2)
-#define SORTED_CACHE_SIZE ((2 * 1024 * 1024)/(SORTED_OPEN_TABLE_LIMIT))
-
-#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
-#define UNSORTED_OPEN_TABLE_LIMIT (8)
-#define UNSORTED_CACHE_SIZE ((1024 * 1024 * 1024)/(UNSORTED_OPEN_TABLE_LIMIT))
-#else
-#define UNSORTED_OPEN_TABLE_LIMIT (64)
-#define UNSORTED_CACHE_SIZE (350 * 1024 * 1024)
-#endif
-
-#if _DEBUGGING
-#define DUMP_CONFIG 1
-#endif
-
-struct overlap_s {
-    uint32_t min; /* minimum start pos of any alignment that ends in this chunk */
-    uint32_t max; /* maximum end pos of any alignment that starts before this chunk and ends in this chunk */
-};
-
-extern void ReferenceMgr_DumpConfig(ReferenceMgr const *const self);
-
-rc_t ReferenceInit(Reference *self, const VDBManager *mgr, VDatabase *db)
-{
-    rc_t rc;
-    size_t const cache = G.expectUnsorted ? UNSORTED_CACHE_SIZE : SORTED_CACHE_SIZE;
-    unsigned const open_count = G.expectUnsorted ? UNSORTED_OPEN_TABLE_LIMIT : SORTED_OPEN_TABLE_LIMIT;
-    
-    memset(self, 0, sizeof(*self));
-    
-    self->coverage.elem_bits = self->mismatches.elem_bits = self->indels.elem_bits = 32;
-    self->pri_align.elem_bits = self->sec_align.elem_bits = 64;
-    self->pri_overlap.elem_bits = self->sec_overlap.elem_bits = sizeof(struct overlap_s) * 8;
-    
-    rc = ReferenceMgr_Make(&self->mgr, db, mgr, ewrefmgr_co_Coverage,
-                           G.refXRefPath, G.inpath,
-                           G.maxSeqLen, cache, open_count);
-    if (rc == 0) {
-        unsigned i;
-        
-        for (i = 0; G.refFiles[i]; ++i) {
-            rc = ReferenceMgr_FastaPath(self->mgr, G.refFiles[i]);
-            if (rc) {
-                (void)PLOGERR(klogWarn, (klogWarn, rc, "fasta file '$(file)'", "file=%s", G.refFiles[i]));
-                break;
-            }
-        }
-#if DUMP_CONFIG
-        if (rc == 0) {
-            ReferenceMgr_DumpConfig(self->mgr);
-        }
-#endif
-    }
-    return rc;
-}
-
-static
-void Unsorted(Reference *self) {
-    (void)LOGMSG(klogWarn, "Alignments are unsorted");
-    self->out_of_order = true;
-    ReferenceMgr_SetCache(self->mgr, UNSORTED_CACHE_SIZE, UNSORTED_OPEN_TABLE_LIMIT);
-    KDataBufferWhack(&self->sec_align);
-    KDataBufferWhack(&self->pri_align);
-    KDataBufferWhack(&self->mismatches);
-    KDataBufferWhack(&self->indels);
-    KDataBufferWhack(&self->coverage);
-    KDataBufferWhack(&self->pri_overlap);
-    KDataBufferWhack(&self->sec_overlap);
-}
-
-#define BAIL_ON_FAIL(STMT) do { rc_t const rc__ = (STMT); if (rc__) return rc__; } while(0)
-
-static rc_t FlushBuffers(Reference *self, uint64_t upto, bool full, bool final)
-{
-    if (!self->out_of_order && upto > 0) {
-        size_t offset = 0;
-        unsigned *const miss = (unsigned *)self->mismatches.base;
-        unsigned *const indel = (unsigned *)self->indels.base;
-        unsigned *const cov = (unsigned *)self->coverage.base;
-        struct overlap_s *const pri_overlap = (struct overlap_s *)self->pri_overlap.base;
-        struct overlap_s *const sec_overlap = (struct overlap_s *)self->sec_overlap.base;
-        unsigned chunk = 0;
-        
-        while ((self->curPos + offset + (full ? 0 : G.maxSeqLen)) <= upto) {
-            ReferenceSeqCoverage data;
-            uint64_t const curPos = self->curPos + offset;
-            unsigned const n = self->endPos > (curPos + G.maxSeqLen) ?
-                               G.maxSeqLen : (self->endPos - curPos);
-            unsigned const m = curPos + n > upto ? upto - curPos : n;
-            unsigned i;
-            unsigned hi;
-            unsigned lo;
-            
-            if (n == 0) break;
-            
-            memset(&data, 0, sizeof(data));
-            
-            data.ids[ewrefcov_primary_table].elements = self->pri_align.elem_count;
-            data.ids[ewrefcov_primary_table].buffer = self->pri_align.base;
-            data.overlap_ref_pos[ewrefcov_primary_table] = pri_overlap[chunk].min;
-            data.overlap_ref_len[ewrefcov_primary_table] = pri_overlap[chunk].max ? pri_overlap[chunk].max - curPos : 0;
-            
-            data.ids[ewrefcov_secondary_table].elements = self->sec_align.elem_count;
-            data.ids[ewrefcov_secondary_table].buffer = self->sec_align.base;
-            data.overlap_ref_pos[ewrefcov_secondary_table] = sec_overlap[chunk].min;
-            data.overlap_ref_len[ewrefcov_secondary_table] = sec_overlap[chunk].max ? sec_overlap[chunk].max - curPos : 0;
-            
-            for (hi = 0, lo = UINT_MAX, i = 0; i != m; ++i) {
-                unsigned const coverage = cov[offset + i];
-                
-                if (hi < coverage)
-                    hi = coverage;
-                if (lo > coverage)
-                    lo = coverage;
-            }
-            data.low  = lo > 255 ? 255 : lo;
-            data.high = hi > 255 ? 255 : hi;
-            
-            for (i = 0; i != m; ++i)
-                data.mismatches += miss[offset + i];
-
-            for (i = 0; i != m; ++i)
-                data.indels += indel[offset + i];
-            
-            {
-                rc_t rc = ReferenceSeq_AddCoverage(self->rseq, curPos, &data);
-                
-                if (rc) {
-                    Unsorted(self);
-                    return 0;
-                }
-            }
-            
-            KDataBufferResize(&self->pri_align, 0);
-            KDataBufferResize(&self->sec_align, 0);
-            offset += n;
-            ++chunk;
-        }
-        if (!final && offset > 0) {
-            unsigned const newChunkCount = self->pri_overlap.elem_count - chunk;
-            unsigned const newBaseCount = self->endPos - self->curPos - offset;
-            
-            memmove(self->pri_overlap.base, pri_overlap + chunk, newChunkCount * sizeof(pri_overlap[0]));
-            memmove(self->sec_overlap.base, sec_overlap + chunk, newChunkCount * sizeof(sec_overlap[0]));
-            memmove(self->mismatches.base, miss + offset, newBaseCount * sizeof(miss[0]));
-            memmove(self->indels.base, indel + offset, newBaseCount * sizeof(indel[0]));
-            memmove(self->coverage.base, cov + offset, newBaseCount * sizeof(cov[0]));
-
-            KDataBufferResize(&self->pri_overlap, newChunkCount);
-            KDataBufferResize(&self->sec_overlap, newChunkCount);
-            
-            self->curPos += offset;
-        }
-    }
-    return 0;
-}
-
-rc_t ReferenceSetFile(Reference *self, const char id[],
-                      uint64_t length, uint8_t const md5[16])
-{
-    const ReferenceSeq *rseq;
-    unsigned n;
-    
-    for (n = 0; ; ++n) {
-        if (self->last_id[n] != id[n])
-            break;
-        if (self->last_id[n] == 0 && id[n] == 0)
-            return 0;
-    }
-    while (id[n])
-        ++n;
-    if (n >= sizeof(self->last_id))
-        return RC(rcApp, rcTable, rcAccessing, rcParam, rcTooLong);
-    
-    BAIL_ON_FAIL(FlushBuffers(self, self->length, true, true));
-    BAIL_ON_FAIL(ReferenceMgr_GetSeq(self->mgr, &rseq, id));
-
-    if (self->rseq)
-        ReferenceSeq_Release(self->rseq);
-    self->rseq = rseq;
-    
-    memcpy(self->last_id, id, n + 1);
-    self->curPos = self->endPos = 0;
-    self->length = length;
-    self->lastOffset = 0;
-    KDataBufferResize(&self->pri_overlap, 0);
-    KDataBufferResize(&self->sec_overlap, 0);
-
-    if(!self->out_of_order) (void)PLOGMSG(klogInfo, (klogInfo, "Processing Reference '$(id)'", "id=%s", id));
-    
-    return 0;
-}
-
-rc_t ReferenceVerify(Reference const *self, char const id[], uint64_t length, uint8_t const md5[16])
-{
-    return ReferenceMgr_Verify(self->mgr, id, length, md5);
-}
-
-rc_t ReferenceGet1stRow(Reference const *self, int64_t *refID, char const refName[])
-{
-    const ReferenceSeq* rseq;
-    rc_t rc = ReferenceMgr_GetSeq(self->mgr, &rseq, refName);
-    if( rc == 0 ) {
-        rc = ReferenceSeq_Get1stRow(rseq, refID);
-        ReferenceSeq_Release(rseq);
-    }
-    return rc;
-}
-
-static
-rc_t ReferenceAddCoverage(Reference *const self,
-                          unsigned const refStart,
-                          unsigned const refLength,
-                          uint32_t const mismatches,
-                          uint32_t const indels,
-                          bool const isPrimary
-                          )
-{
-    unsigned const refEnd = refStart + refLength;
-    
-    if (refEnd > self->endPos) {
-        unsigned const t1 = refEnd + (G.maxSeqLen - 1);
-        unsigned const adjust = t1 % G.maxSeqLen;
-        unsigned const newEndPos = t1 - adjust;
-        unsigned const baseCount = self->endPos - self->curPos;
-        unsigned const newBaseCount = newEndPos - self->curPos;
-        
-        BAIL_ON_FAIL(KDataBufferResize(&self->coverage, newBaseCount));
-        BAIL_ON_FAIL(KDataBufferResize(&self->mismatches, newBaseCount));
-        BAIL_ON_FAIL(KDataBufferResize(&self->indels, newBaseCount));
-        
-        memset(&((unsigned *)self->coverage.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        memset(&((unsigned *)self->mismatches.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        memset(&((unsigned *)self->indels.base)[baseCount], 0, (newBaseCount - baseCount) * sizeof(unsigned));
-        self->endPos = newEndPos;
-    }
-    if ((refEnd - self->curPos) / G.maxSeqLen >= self->pri_overlap.elem_count) {
-        unsigned const chunks = (refEnd - self->curPos) / G.maxSeqLen + 1;
-        unsigned const end = self->pri_overlap.elem_count;
-        
-        BAIL_ON_FAIL(KDataBufferResize(&self->pri_overlap, chunks));
-        BAIL_ON_FAIL(KDataBufferResize(&self->sec_overlap, chunks));
-        
-        memset(&((struct overlap_s *)self->pri_overlap.base)[end], 0, (chunks - end) * sizeof(struct overlap_s));
-        memset(&((struct overlap_s *)self->sec_overlap.base)[end], 0, (chunks - end) * sizeof(struct overlap_s));
-    }
-    BAIL_ON_FAIL(FlushBuffers(self, refStart, false, false));
-    if (!self->out_of_order) {
-        unsigned const startBase = refStart - self->curPos;
-        unsigned const endChunk = (startBase + refLength) / G.maxSeqLen;
-        KDataBuffer *const overlapBuffer = isPrimary ? &self->pri_overlap : &self->sec_overlap;
-        unsigned *const cov = &((unsigned *)self->coverage.base)[startBase];
-        unsigned i;
-        
-        ((unsigned *)self->mismatches.base)[startBase] += mismatches;
-        ((unsigned *)self->indels.base)[startBase] += indels;
-        
-        if (((struct overlap_s *)overlapBuffer->base)[endChunk].min == 0 || 
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].min > refStart)
-        {
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].min = refStart;
-        }
-        if (endChunk != 0 &&
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].max < refStart + refLength)
-        {
-            ((struct overlap_s *)overlapBuffer->base)[endChunk].max = refStart + refLength;
-        }
-        
-        for (i = 0; i != refLength; ++i) {
-            if (cov[i] < UINT_MAX)
-                ++cov[i];
-        }
-    }
-    return 0;
-}
-
-static void GetCounts(AlignmentRecord const *data, unsigned const seqLen,
-                      unsigned *const nMatch,
-                      unsigned *const nMiss,
-                      unsigned *const nIndels)
-{
-    bool const *has_mismatch = data->data.has_mismatch.buffer;
-    bool const *has_offset = data->data.has_ref_offset.buffer;
-    int32_t const *ref_offset = data->data.ref_offset.buffer;
-    unsigned const n = data->data.ref_offset.elements;
-    unsigned const left_clip = (n != 0 && has_offset[0] && ref_offset[0] < 0) ? -ref_offset[0] : 0;
-    int right_edge;
-    unsigned nmis;
-    unsigned nmatch;
-    unsigned i;
-    unsigned j;
-    
-    for (right_edge = data->data.ref_len, i = 0; i != n; ++i)
-        right_edge -= ref_offset[i];
-    if (right_edge > seqLen)
-        right_edge = seqLen;
-    for (j = left_clip ? 1 : 0, i = left_clip, nmatch = nmis = 0; i < right_edge; ) {
-        if (has_offset[i]) {
-            int const offs = ref_offset[j++];
-            
-            if (offs < 0) {
-                i += (unsigned)(-offs);
-                continue;
-            }
-        }
-        if (has_mismatch[i])
-            ++nmis;
-        else
-            ++nmatch;
-        ++i;
-    }
-    *nMatch = nmatch;
-    *nMiss = nmis;
-    *nIndels = n - (left_clip ? 1 : 0);
-}
-
-rc_t ReferenceRead(Reference *self, AlignmentRecord *data, uint64_t const pos,
-                   uint32_t const rawCigar[], uint32_t const cigCount,
-                   char const seqDNA[], uint32_t const seqLen, uint32_t *matches)
-{
-    *matches = 0;
-    BAIL_ON_FAIL(ReferenceSeq_Compress(self->rseq, (G.acceptHardClip ? ewrefmgr_co_AcceptHardClip : 0) + ewrefmgr_cmp_Binary, pos,
-        seqDNA, seqLen, rawCigar, cigCount, 0, NULL, 0, 0, NULL, 0, &data->data));
-
-    if (!G.acceptNoMatch && data->data.ref_len == 0)
-        return RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
-    
-    if (!self->out_of_order && pos < self->lastOffset) {
-        Unsorted(self);
-    }
-    if (self->out_of_order)
-        return 0;
-    else {
-        unsigned nmis;
-        unsigned nmatch;
-        unsigned indels;
-
-        self->lastOffset = data->data.effective_offset;
-        GetCounts(data, seqLen, &nmatch, &nmis, &indels);
-        *matches = nmatch;
-        
-        if (G.acceptNoMatch || nmatch >= G.minMatchCount)
-            return ReferenceAddCoverage(self, data->data.effective_offset,
-                                        data->data.ref_len, nmis, indels,
-                                        data->isPrimary);
-        else
-            return RC(rcApp, rcFile, rcReading, rcConstraint, rcViolated);
-    }
-}
-
-static rc_t IdVecAppend(KDataBuffer *vec, uint64_t id)
-{
-    uint64_t const end = vec->elem_count;
-    
-    BAIL_ON_FAIL(KDataBufferResize(vec, end + 1));
-    ((uint64_t *)vec->base)[end] = id;
-    return 0;
-}
-
-rc_t ReferenceAddAlignId(Reference *self,
-                         int64_t align_id,
-                         bool is_primary
-                         )
-{
-    if (self->out_of_order)
-        return 0;
-    return IdVecAppend(is_primary ? &self->pri_align : &self->sec_align, align_id);
-}
-
-rc_t ReferenceWhack(Reference *self, bool commit)
-{
-    rc_t rc = 0;
-    
-    if (self) {
-#if DUMP_CONFIG
-        if (self->mgr)
-            ReferenceMgr_DumpConfig(self->mgr);
-#endif
-        if (commit) {
-            rc = FlushBuffers(self, self->length, true, true);
-            if (rc != 0)
-                commit = false;
-        }
-        KDataBufferWhack(&self->sec_align);
-        KDataBufferWhack(&self->pri_align);
-        KDataBufferWhack(&self->mismatches);
-        KDataBufferWhack(&self->indels);
-        KDataBufferWhack(&self->coverage);
-        KDataBufferWhack(&self->pri_overlap);
-        KDataBufferWhack(&self->sec_overlap);
-        if (self->rseq)
-            rc = ReferenceSeq_Release(self->rseq);
-        if (self->out_of_order) {
-            (void)LOGMSG(klogInfo, "Starting coverage calculation");
-            rc = ReferenceMgr_Release(self->mgr, commit, NULL, true, Quitting);
-        }
-        else {
-            rc = ReferenceMgr_Release(self->mgr, commit, NULL, false, Quitting);
-        }
-    }
-    return rc;
-}
diff --git a/tools/bam-loader/reference-writer.h b/tools/bam-loader/reference-writer.h
deleted file mode 100644
index 67d57f4..0000000
--- a/tools/bam-loader/reference-writer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_REFERENCE_WRITER_H_
-#define BAM_LOAD_REFERENCE_WRITER_H_ 1
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <klib/data-buffer.h>
-
-#include <align/writer-reference.h>
-#include "alignment-writer.h"
-
-typedef struct s_reference {
-    const ReferenceMgr *mgr;
-    const ReferenceSeq *rseq;
-    int64_t lastRefId;
-    int32_t lastOffset;
-    unsigned curPos;
-    unsigned endPos;
-    unsigned length;
-    KDataBuffer coverage;
-    KDataBuffer mismatches;
-    KDataBuffer indels;
-    KDataBuffer pri_align;
-    KDataBuffer sec_align;
-    KDataBuffer pri_overlap;
-    KDataBuffer sec_overlap;
-    bool out_of_order;
-    char last_id[256];
-} Reference;
-
-rc_t ReferenceInit(Reference *self, const VDBManager *mgr, VDatabase *db);
-rc_t ReferenceSetFile(Reference *self, const char *id, uint64_t length, uint8_t const md5[16]);
-rc_t ReferenceVerify(Reference const *self, char const id[], uint64_t length, uint8_t const md5[16]);
-rc_t ReferenceGet1stRow(Reference const *self, int64_t *refID, char const refName[]);
-rc_t ReferenceAddAlignId(Reference *self,
-                         int64_t align_id,
-                         bool is_primary
-                         );
-rc_t ReferenceRead(Reference *self, AlignmentRecord *data, uint64_t pos,
-                   uint32_t const rawCigar[], uint32_t cigCount,
-                   char const seqDNA[], uint32_t seqLen, uint32_t *matches);
-rc_t ReferenceWhack(Reference *self, bool commit);
-
-#endif
diff --git a/tools/bam-loader/sequence-writer.c b/tools/bam-loader/sequence-writer.c
deleted file mode 100644
index ec0f22e..0000000
--- a/tools/bam-loader/sequence-writer.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <vdb/database.h>
-
-#include <kdb/manager.h>
-
-#include <insdc/sra.h>
-#include <insdc/insdc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-#include <ctype.h>
-
-#include "Globals.h"
-#include <align/writer-sequence.h>
-#include "sequence-writer.h"
-
-/* MARK: Sequence Object */
-
-Sequence *SequenceInit(Sequence *self, VDatabase *db) {
-    memset(self, 0, sizeof(*self));
-    self->db = db;
-    VDatabaseAddRef(db);
-    return self;
-}
-
-rc_t SequenceWriteRecord(Sequence *self,
-                         SequenceRecord const *rec,
-                         bool color,
-                         bool isDup,
-                         INSDC_SRA_platform_id platform
-                         )
-{
-    rc_t rc = 0;
-    uint8_t nreads = rec->numreads;
-    unsigned i;
-    unsigned seqLen;
-    int64_t dummyRowId;
-    
-    uint8_t readInfo[4096];
-    void *h_readInfo = NULL;
-    
-    INSDC_coord_zero *readStart = (void *)readInfo;
-    INSDC_coord_len *readLen;
-    uint8_t *alcnt;
-    INSDC_SRA_xread_type *readType;
-    INSDC_SRA_read_filter *readFilter;
-    bool *mask = NULL;
-    size_t const elemSize = sizeof(alcnt[0]) + sizeof(readType[0])
-                          + sizeof(readStart[0]) + sizeof(readLen[0])
-                          + sizeof(readFilter[0]);
-    
-    TableWriterSeqData data;
-
-    for (i = seqLen = 0; i != nreads; ++i) {
-        seqLen += rec->readLen[i];
-    }
-    
-    if (nreads * elemSize + G.keepMismatchQual * seqLen * sizeof(mask[0]) > sizeof(readInfo))
-    {
-        h_readInfo = malloc(nreads * elemSize + G.keepMismatchQual * seqLen * sizeof(mask[0]));
-        if (h_readInfo == NULL)
-            return RC(rcAlign, rcTable, rcWriting, rcMemory, rcExhausted);
-        readStart = h_readInfo;
-    }
-    readLen = (INSDC_coord_len *)&readStart[nreads];
-    alcnt = (uint8_t *)&readLen[nreads];
-    readType = (INSDC_SRA_xread_type *)&alcnt[nreads];
-    readFilter = (INSDC_SRA_read_filter *)&readType[nreads];
-    
-    if (G.keepMismatchQual) {
-        mask = (bool *)&readFilter[nreads];
-        
-        for (i = 0; i != seqLen; ++i) {
-            mask[i] = (rec->qual[i] & 0x80) != 0;
-        }
-    }
-    
-    for (i = 0; i != nreads; ++i) {
-        alcnt[i] = rec->aligned[i] ? 1 : 0;
-        readLen[i] = rec->readLen[i];
-        readStart[i] = rec->readStart[i];
-        readType[i] = SRA_READ_TYPE_BIOLOGICAL | (rec->orientation[i] ?
-                                                  SRA_READ_TYPE_REVERSE:
-                                                  SRA_READ_TYPE_FORWARD
-                                                  );
-        readFilter[i] = isDup ? SRA_READ_FILTER_CRITERIA
-                      : rec->is_bad[i] ? SRA_READ_FILTER_REJECT : SRA_READ_FILTER_PASS;
-    }
-
-    memset(&data, 0, sizeof(data));
-    
-    data.sequence.buffer = rec->seq;
-    data.sequence.elements = seqLen;
-    
-    data.quality.buffer = rec->qual;
-    data.quality.elements = seqLen;
-    
-    if (G.keepMismatchQual) {
-        data.no_quantize_mask.buffer = mask;
-        data.no_quantize_mask.elements = seqLen;
-    }
-    
-    data.alignment_count.buffer = alcnt;
-    data.alignment_count.elements = nreads;
-    
-    data.nreads = nreads;
-    
-    data.read_type.buffer = readType;
-    data.read_type.elements = nreads;
-    
-    data.read_start.buffer = readStart;
-    data.read_start.elements = nreads;
-    
-    data.read_len.buffer = readLen;
-    data.read_len.elements = nreads;
-    
-    data.tmp_key_id = rec->keyId;
-    
-    data.spot_group.buffer = rec->spotGroup;
-    data.spot_group.elements = rec->spotGroupLen;
-    
-    data.cskey.buffer = rec->cskey;
-    data.cskey.elements = nreads;
-    
-    data.read_filter.buffer = readFilter;
-    data.read_filter.elements = nreads;
-    
-    data.platform.buffer = &platform;
-    data.platform.elements = 1;
-    
-    data.ti.buffer = rec->ti;
-    data.ti.elements = nreads;
-    
-    if (!G.no_real_output) {
-        if (self->tbl == NULL) {
-            int csoption = (color ? ewseq_co_ColorSpace : 0);
-
-	    if(G.hasTI) csoption |= ewseq_co_TI;
-            
-            rc = TableWriterSeq_Make(&self->tbl, self->db,
-                                     csoption | ewseq_co_NoLabelData | ewseq_co_SpotGroup, G.QualQuantizer);
-        }
-        if (rc == 0) {
-            rc = TableWriterSeq_Write(self->tbl, &data, &dummyRowId);
-        }
-    }
-    
-    if (h_readInfo)
-        free(h_readInfo);
-    
-    return rc;
-}
-
-rc_t SequenceDoneWriting(Sequence *self)
-{
-    return TableWriterSeq_TmpKeyStart(self->tbl);
-}
-
-rc_t SequenceReadKey(const Sequence *cself, int64_t row, uint64_t *keyId)
-{
-    return TableWriterSeq_TmpKey(cself->tbl, row, keyId);
-}
-
-rc_t SequenceUpdateAlignData(Sequence *self, int64_t rowId, unsigned nreads,
-                             int64_t const primeId[/* nreads */],
-                             uint8_t const algnCnt[/* nreads */])
-{
-    TableWriterData data[2];
-    
-    data[0].buffer = primeId; data[0].elements = nreads;
-    data[1].buffer = algnCnt; data[1].elements = nreads;
-    
-    return TableWriterSeq_WriteAlignmentData(self->tbl, rowId, &data[0], &data[1]);
-}
-
-void SequenceWhack(Sequence *self, bool commit) {
-    uint64_t dummyRows;
-    rc_t rc;
-    
-    VDatabaseRelease(self->db);
-    
-    if (self->tbl == NULL)
-        return;
-    
-    rc = TableWriterSeq_Whack(self->tbl, commit, &dummyRows);
-}
-
-/* MARK: SequenceRecord Object */
-static
-rc_t SequenceRecordResize(SequenceRecord *self,
-                          KDataBuffer *storage,
-                          unsigned numreads,
-                          unsigned seqLen)
-{
-    size_t sz;
-    rc_t rc;
-    
-    sz = seqLen * (sizeof(self->seq[0]) + sizeof(self->qual[0])) +
-         numreads * (sizeof(self->ti) +
-                     sizeof(self->readStart[0]) +
-                     sizeof(self->readLen[0]) +
-                     sizeof(self->aligned[0]) + 
-                     sizeof(self->orientation[0]) +
-                     sizeof(self->alignmentCount[0]) +
-                     sizeof(self->cskey[0])
-                     );
-    storage->elem_bits = 8;
-    rc = KDataBufferResize(storage, sz);
-    if (rc)
-        return rc;
-    self->numreads = numreads;
-    
-    self->ti = (uint64_t *)storage->base;
-    self->readStart = (uint32_t *)&self->ti[numreads];
-    self->readLen = (uint32_t *)&self->readStart[numreads];
-    self->aligned = (bool *)&self->readLen[numreads];
-    self->orientation = (uint8_t *)&self->aligned[numreads];
-    self->is_bad = (uint8_t *)&self->orientation[numreads];
-    self->alignmentCount = (uint8_t *)&self->is_bad[numreads];
-    self->cskey = (char *)&self->alignmentCount[numreads];
-    self->seq = (char *)&self->cskey[numreads];
-    self->qual = (uint8_t *)&self->seq[seqLen];
-
-    self->spotGroup = NULL;
-    self->spotGroupLen = 0;
-    
-    return 0;
-}
-
-rc_t SequenceRecordInit(SequenceRecord *self, unsigned numreads, unsigned readLen[])
-{
-    unsigned i;
-    unsigned seqlen = 0;
-    rc_t rc;
-    
-    for (i = 0; i != numreads; ++i) {
-        seqlen += readLen[i];
-    }
-    rc = SequenceRecordResize(self, &self->storage, numreads, seqlen);
-    if (rc)
-        return rc;
-    memset(self->storage.base, 0, KDataBufferBytes(&self->storage));
-    
-    for (seqlen = 0, i = 0; i != numreads; ++i) {
-        self->readLen[i] = readLen[i];
-        self->readStart[i] = seqlen;
-        seqlen += readLen[i];
-    }
-    self->numreads = numreads;
-    memset(self->cskey, 'T', numreads);
-    return 0;
-}
-
-rc_t SequenceRecordAppend(SequenceRecord *self,
-                          const SequenceRecord *other
-                          )
-{
-    /* save the locations of the original data */
-    unsigned const seq = (uint8_t const *)self->seq - (uint8_t const *)self->storage.base;
-    unsigned const qual = (uint8_t const *)self->qual - (uint8_t const *)self->storage.base;
-    unsigned const cskey = (uint8_t const *)self->cskey - (uint8_t const *)self->storage.base;
-    unsigned const alignmentCount = (uint8_t const *)self->alignmentCount - (uint8_t const *)self->storage.base;
-    unsigned const is_bad = (uint8_t const *)self->is_bad - (uint8_t const *)self->storage.base;
-    unsigned const orientation = (uint8_t const *)self->orientation - (uint8_t const *)self->storage.base;
-    unsigned const aligned = (uint8_t const *)self->aligned - (uint8_t const *)self->storage.base;
-    unsigned const ti = (uint8_t const *)self->ti - (uint8_t const *)self->storage.base;
-    unsigned const readLen = (uint8_t const *)self->readLen - (uint8_t const *)self->storage.base;
-    unsigned const readStart = (uint8_t const *)self->readStart - (uint8_t const *)self->storage.base;
-
-    rc_t rc;
-    unsigned seqlen;
-    unsigned otherSeqlen;
-    unsigned i;
-    unsigned numreads = self->numreads;
-    
-    for (seqlen = 0, i = 0; i != numreads; ++i) {
-        seqlen += self->readLen[i];
-    }
-    for (otherSeqlen = 0, i = 0; i != other->numreads; ++i) {
-        otherSeqlen += other->readLen[i];
-    }
-
-    rc = SequenceRecordResize(self, &self->storage, self->numreads + other->numreads, seqlen + otherSeqlen);
-    if (rc)
-        return rc;
-    /* this needs to be reverse order from assignment in Resize function
-     * these regions can overlap
-     */
-    memmove(self->qual,             &((uint8_t const *)self->storage.base)[qual],              seqlen);
-    memmove(self->seq,              &((uint8_t const *)self->storage.base)[seq],               seqlen);
-    memmove(self->cskey,            &((uint8_t const *)self->storage.base)[cskey],             numreads * sizeof(self->cskey[0]));
-    memmove(self->alignmentCount,   &((uint8_t const *)self->storage.base)[alignmentCount],    numreads * sizeof(self->alignmentCount[0]));
-    memmove(self->is_bad,           &((uint8_t const *)self->storage.base)[is_bad],            numreads * sizeof(self->is_bad[0]));
-    memmove(self->orientation,      &((uint8_t const *)self->storage.base)[orientation],       numreads * sizeof(self->orientation[0]));
-    memmove(self->aligned,          &((uint8_t const *)self->storage.base)[aligned],           numreads * sizeof(self->aligned[0]));
-    memmove(self->readLen,          &((uint8_t const *)self->storage.base)[readLen],           numreads * sizeof(self->readLen[0]));
-    memmove(self->ti,               &((uint8_t const *)self->storage.base)[ti],                numreads * sizeof(self->ti[0]));
-    
-    memcpy(&self->ti[numreads],             other->ti,              other->numreads * sizeof(self->ti[0]));
-    memcpy(&self->readLen[numreads],        other->readLen,         other->numreads * sizeof(self->readLen[0]));
-    memcpy(&self->aligned[numreads],        other->aligned,         other->numreads * sizeof(self->aligned[0]));
-    memcpy(&self->orientation[numreads],    other->orientation,     other->numreads * sizeof(self->orientation[0]));
-    memcpy(&self->is_bad[numreads],         other->is_bad,          other->numreads * sizeof(self->is_bad[0]));
-    memcpy(&self->alignmentCount[numreads], other->alignmentCount,  other->numreads * sizeof(self->alignmentCount[0]));
-    memcpy(&self->cskey[numreads],          other->cskey,           other->numreads * sizeof(self->cskey[0]));
-    memcpy(&self->seq[seqlen],              other->seq,             otherSeqlen);
-    memcpy(&self->qual[seqlen],             other->qual,            otherSeqlen);
-    
-    for (i = 0, seqlen = 0; i != self->numreads; ++i) {
-        self->readStart[i] = seqlen;
-        seqlen += self->readLen[i];
-    }
-    
-    return 0;
-}
diff --git a/tools/bam-loader/sequence-writer.h b/tools/bam-loader/sequence-writer.h
deleted file mode 100644
index ccd4071..0000000
--- a/tools/bam-loader/sequence-writer.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef BAM_LOAD_SEQUENCE_WRITER_H_
-#define BAM_LOAD_SEQUENCE_WRITER_H_ 1
-
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <klib/text.h>
-#include <klib/data-buffer.h>
-
-struct TableWriterSeq;
-
-typedef struct s_sequence_record {
-    char *seq;
-    uint8_t *qual;
-    uint32_t *readStart;
-    uint32_t *readLen;
-    uint8_t *orientation;
-    uint8_t *is_bad;
-    uint8_t *alignmentCount;
-    char *spotGroup;
-    bool *aligned;
-    char *cskey;
-    uint64_t *ti;
-    uint64_t keyId;
-    unsigned spotGroupLen;
-    KDataBuffer storage;
-    uint8_t numreads;
-} SequenceRecord;
-
-
-rc_t SequenceRecordInit(SequenceRecord *self,
-                        unsigned numreads, unsigned readLen[]);
-
-rc_t SequenceRecordAppend(SequenceRecord *self,
-                          const SequenceRecord *other);
-
-typedef struct s_sequence {
-    VDatabase *db;
-    struct TableWriterSeq const *tbl;
-} Sequence;
-
-Sequence *SequenceInit(Sequence *self, VDatabase *db);
-
-rc_t SequenceWriteRecord(Sequence *self, SequenceRecord const *rec,
-                         bool color, bool isDup, INSDC_SRA_platform_id platform);
-
-rc_t SequenceDoneWriting(Sequence *self);
-rc_t SequenceReadKey(const Sequence *self, int64_t row, uint64_t *key);
-rc_t SequenceUpdateAlignData(Sequence *self, int64_t row, unsigned nreads,
-                             const int64_t primeId[/* nreads */],
-                             const uint8_t alignCount[/* nreads */]);
-
-void SequenceWhack(Sequence *self, bool commit);
-
-
-#endif /* ndef BAM_LOAD_SEQUENCE_WRITER_H_ */
diff --git a/tools/cache-mgr/Makefile b/tools/cache-mgr/Makefile
deleted file mode 100644
index b58dd2e..0000000
--- a/tools/cache-mgr/Makefile
+++ /dev/null
@@ -1,120 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/cache-mgr
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	cache-mgr
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: $(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_TOOLS))
-
-#-------------------------------------------------------------------------------
-# cache-mgr
-#
-TOOL_SRC = \
-	cache-mgr
-
-TOOL_OBJ = \
-	$(addsuffix .$(OBJX),$(TOOL_SRC))
-
-TOOL_LIB = \
-	-lkapp \
-	-ssraschema \
-	-dalign-reader \
-	$(READONLY_SCHEMA_LIBS) \
-	-lvdb \
-	-lkdb \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lksrch \
-	-lkproc \
-	-lklib \
-	-lm
-
-$(BINDIR)/cache-mgr: $(TOOL_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(TOOL_LIB)
-
-cache-mgr_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) cache-mgr $(TOOL_OBJ)
diff --git a/tools/cache-mgr/cache-mgr.c b/tools/cache-mgr/cache-mgr.c
deleted file mode 100644
index d06e2dc..0000000
--- a/tools/cache-mgr/cache-mgr.c
+++ /dev/null
@@ -1,1332 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "cache-mgr.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-
-#include <kfg/config.h>
-#include <kfg/repository.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/cacheteefile.h>
-#include <kfs/defs.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-#include <strtol.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-static const char * report_usage[]  = { "report objects in cache", NULL };
-static const char * rreport_usage[] = { "report status of repositories", NULL };
-static const char * unlock_usage[]  = { "remove lock-files", NULL };
-static const char * clear_usage[]   = { "clear cache", NULL };
-static const char * enable_usage[]  = { "enable repository [user/site/rem]", NULL };
-static const char * disable_usage[] = { "disable repository [user/site/rem]", NULL };
-static const char * detail_usage[]  = { "show detailed report", NULL };
-static const char * urname_usage[]  = { "restrict to this user-repository", NULL };
-static const char * max_rem_usage[] = { "remove until reached that many bytes", NULL };
-static const char * rem_dir_usage[] = { "remove directories, not only files", NULL };
-
-#define OPTION_CREPORT  "report"
-#define ALIAS_CREPORT   "r"
-
-#define OPTION_UNLOCK   "unlock"
-#define ALIAS_UNLOCK    "u"
-
-#define OPTION_CLEAR    "clear"
-#define ALIAS_CLEAR     "c"
-
-#define OPTION_ENABLE   "enable"
-#define ALIAS_ENABLE    "e"
-
-#define OPTION_DISABLE  "disable"
-#define ALIAS_DISABLE   "d"
-
-#define OPTION_RREPORT  "rep-report"
-#define ALIAS_RREPORT   "o"
-
-#define OPTION_DETAIL   "details"
-#define ALIAS_DETAIL    "t"
-
-#define OPTION_URNAME   "user-repo-name"
-#define ALIAS_URNAME    "p"
-
-#define OPTION_MAXREM   "max-remove"
-#define ALIAS_MAXREM    "m"
-
-#define OPTION_REMDIR   "remove-dirs"
-#define ALIAS_REMDIR    "i"
-
-
-OptDef ToolOptions[] =
-{
-    { OPTION_CREPORT,   ALIAS_CREPORT,  NULL,   report_usage,   1,  false,  false },
-    { OPTION_RREPORT,   ALIAS_RREPORT,  NULL,   rreport_usage,  1,  false,  false },
-    { OPTION_DETAIL,    ALIAS_DETAIL,   NULL,   detail_usage,   1,  false,  false },
-    { OPTION_UNLOCK,    ALIAS_UNLOCK,   NULL,   unlock_usage,   1,  false,  false },
-    { OPTION_CLEAR,     ALIAS_CLEAR,    NULL,   clear_usage,    1,  false,  false },
-    { OPTION_MAXREM,    ALIAS_MAXREM,   NULL,   max_rem_usage,  1,  true,   false },
-    { OPTION_REMDIR,    ALIAS_REMDIR,   NULL,   rem_dir_usage,  1,  false,  false },
-    { OPTION_ENABLE,    ALIAS_ENABLE,   NULL,   enable_usage,   1,  true,   false },
-    { OPTION_DISABLE,   ALIAS_DISABLE,  NULL,   disable_usage,  1,  true,   false },
-    { OPTION_URNAME,    ALIAS_URNAME,   NULL,   urname_usage,   1,  true,   false }
-};
-
-const char UsageDefaultName[] = "cache-mgr";
-
-
-rc_t CC UsageSummary ( const char * progname )
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [path_to_cache] options\n"
-                    "\n", progname);
-}
-
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if ( args == NULL )
-        rc = RC ( rcApp, rcArgv, rcAccessing, rcSelf, rcNull );
-    else
-    {
-        rc = ArgsProgram ( args, &fullpath, &progname );
-
-        if ( rc != 0 )
-            progname = fullpath = UsageDefaultName;
-
-        rc = UsageSummary ( progname );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "UsageSummary() failed in $(func)", "func=%s", __func__ ) );
-
-        }
-        else
-            rc = KOutMsg ( "Options:\n" );
-
-        if ( rc == 0 )
-        {
-            uint32_t idx, count = sizeof ToolOptions / sizeof ToolOptions [ 0 ];
-            for ( idx = 0; idx < count; ++idx )
-            {
-                OptDef * o = &ToolOptions[ idx ];
-                HelpOptionLine ( o->aliases, o->name, NULL, o->help );
-            }
-        }
-
-        if ( rc == 0 )
-            rc = KOutMsg ( "Options:\n" );
-
-        if ( rc == 0 )
-        {
-            HelpOptionsStandard ();
-            HelpVersion ( fullpath, KAppVersion() );
-        }
-    }
-    return rc;
-}
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return CACHE_MGR_VERS;
-}
-
-
-typedef enum tool_main_function
-{
-    tf_report,
-    tf_rreport,
-    tf_unlock,
-    tf_clear,
-    tf_enable,
-    tf_disable,
-    tf_unknown
-} tool_main_function;
-
-
-typedef enum repo_select
-{
-    trs_user,
-    trs_site,
-    trs_remote,
-    trs_unknown
-} repo_select;
-
-
-typedef struct tool_options
-{
-    uint64_t max_remove;
-
-    VNamelist * paths;
-    const char * user_repo_name;
-
-    uint32_t path_count;
-    tool_main_function main_function;
-    repo_select repo_select;
-    bool detailed, remove_dirs;
-} tool_options;
-
-
-static rc_t init_tool_options( tool_options * options )
-{
-    rc_t rc = VNamelistMake ( &options->paths, 5 );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "VNamelistMake() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else
-    {
-        options->path_count = 0;
-        options->main_function = tf_unknown;
-        options->user_repo_name = NULL;
-        options->max_remove = 0;
-    }
-    return rc;
-}
-
-
-static rc_t clear_tool_options( tool_options * options )
-{
-    rc_t rc = VNamelistRelease ( options->paths );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "VNamelistRelease() failed in $(func)", "func=%s", __func__ ) );
-    }
-
-    if ( options->user_repo_name != NULL )
-    {
-        free( (void*) options->user_repo_name );
-        options->user_repo_name = NULL;
-    }
-    return rc;
-}
-
-
-static bool get_bool_option( const Args * args, const char * name )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "ArgsOptionCount() failed in $(func)", "func=%s", __func__ ) );
-        return false;
-    }
-    return ( count > 0 );
-}
-
-
-static bool string_cmp_1( const char * s1, const char * s2 )
-{
-    int cmp = string_cmp( s1, string_size( s1 ), s2, string_size( s2 ), -1 );
-    return ( cmp == 0 );
-}
-
-
-static repo_select get_repo_select( const Args * args, const char * name )
-{
-    repo_select res = trs_unknown;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "ArgsOptionCount() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else if ( count > 0 )
-    {
-        const char * s = NULL;
-        rc = ArgsOptionValue( args, name, 0, &s );
-        if ( rc == 0 && s != NULL )
-        {
-            if ( string_cmp_1 ( s, "user" ) )
-                res = trs_user;
-            else if ( string_cmp_1 ( s, "site" ) )
-                res = trs_site;
-            else if ( string_cmp_1 ( s, "rem" ) )
-                res = trs_remote;
-        }
-    }
-    return res;
-}
-
-
-static rc_t get_user_repo_name( const Args * args, const char ** name )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, OPTION_URNAME, &count );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "ArgsOptionCount( $(option) ) failed in $(func)", "option=%s,func=%s", OPTION_URNAME, __func__ ) );
-    }
-    else if ( count > 0 )
-    {
-        const char * s = NULL;
-        rc = ArgsOptionValue( args, OPTION_URNAME, 0, &s );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "ArgsOptionValue( $(option), 0 ) failed in $(func)", "option=%s,func=%s", OPTION_URNAME, __func__ ) );
-        }
-        else if ( s != NULL )
-            *name = string_dup_measure ( s, NULL );
-    }
-    return rc;
-}
-
-
-static rc_t get_max_remove( const Args * args, uint64_t * max_rem )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, OPTION_MAXREM, &count );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "ArgsOptionCount( $(option) ) failed in $(func)", "option=%s,func=%s", OPTION_MAXREM, __func__ ) );
-    }
-    else if ( count > 0 )
-    {
-        const char * s = NULL;
-        rc = ArgsOptionValue( args, OPTION_MAXREM, 0, &s );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "ArgsOptionValue( $(option), 0 ) failed in $(func)", "option=%s,func=%s", OPTION_MAXREM, __func__ ) );
-        }
-        else if ( s != NULL )
-        {
-            char *endp;
-            *max_rem = strtou64( s, &endp, 10 );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t add_tool_options_path( tool_options * options, const char * path )
-{
-    rc_t rc = VNamelistAppend ( options->paths, path );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "VNamelistAppend( $(name) ) failed in $(func)", "name=%s, func=%s", path, __func__ ) );
-    }
-    if ( rc == 0 )
-        options->path_count++;
-    return rc;
-}
-
-
-static rc_t get_tool_options( Args * args, tool_options * options )
-{
-    uint32_t idx, count;
-
-    rc_t rc = ArgsParamCount( args, &count );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "ArgsParamCount() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else if ( count > 0 )
-    {
-        for ( idx = 0; idx < count && rc == 0; ++idx )
-        {
-            const char *value = NULL;
-            rc = ArgsParamValue( args, idx, &value );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "ArgsParamValue( $(idx) ) failed in $(func)", "idx=%d,func=%s", idx, __func__ ) );
-            }
-            else if ( value != NULL )
-                rc = add_tool_options_path( options, value );
-        }
-    }
-
-    options->main_function = tf_unknown;
-    options->detailed = get_bool_option( args, OPTION_DETAIL );
-    options->remove_dirs = get_bool_option( args, OPTION_REMDIR );
-
-    if ( get_bool_option( args, OPTION_CREPORT ) )
-        options->main_function = tf_report;
-    else if ( get_bool_option( args, OPTION_RREPORT ) )
-        options->main_function = tf_rreport;
-    else if ( get_bool_option( args, OPTION_UNLOCK ) )
-        options->main_function = tf_unlock;
-    else if ( get_bool_option( args, OPTION_CLEAR ) )
-        options->main_function = tf_clear;
-    else
-    {
-        options->repo_select = get_repo_select( args, OPTION_ENABLE );
-        if ( options->repo_select != trs_unknown )
-            options->main_function = tf_enable;
-
-        if ( options->repo_select == trs_unknown )
-        {
-            options->repo_select = get_repo_select( args, OPTION_DISABLE );
-            if ( options->repo_select != trs_unknown )
-                options->main_function = tf_disable;
-        }
-    }
-
-    if ( rc == 0 )
-        rc = get_user_repo_name( args, &options->user_repo_name );
-    if ( rc == 0 )
-        rc = get_max_remove( args, &options->max_remove );
-    return rc;
-}
-
-
-typedef struct visit_ctx
-{
-    KDirectory * dir;
-    const tool_options * options;
-    const char * path;
-    void * data;
-    uint32_t path_type;
-    bool terminate;
-} visit_ctx;
-
-
-typedef rc_t ( *on_path_t )( visit_ctx * obj );
-
-
-static rc_t foreach_path_obj( visit_ctx * ctx, on_path_t func )
-{
-    rc_t rc = 0;
-    ctx->path_type = ( KDirectoryPathType ( ctx->dir, "%s", ctx->path ) & ~ kptAlias );
-    if ( ctx->path_type == kptDir )
-    {
-        KNamelist * path_objects;
-        rc = KDirectoryList ( ctx->dir, &path_objects, NULL, NULL, ctx->path );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KDirectoryList( $(path) ) failed in $(func)", "path=%s,func=%s", ctx->path, __func__ ) );
-        }
-        else
-        {
-            uint32_t idx, count;
-            rc = KNamelistCount ( path_objects, &count );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "KNamelistCount() failed in $(func)", "func=%s", __func__ ) );
-            }
-            for ( idx = 0; idx < count && rc == 0 && !ctx->terminate; ++idx )
-            {
-                const char * obj_name = NULL;
-                rc = KNamelistGet ( path_objects, idx, &obj_name );
-                if ( rc != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc,
-                             "KNamelistGet( $(idx) ) failed in $(func)", "idx=%d,func=%s", idx, __func__ ) );
-                }
-                else if ( obj_name != NULL )
-                {
-                    char obj_path[ 4096 ];
-                    rc = KDirectoryResolvePath ( ctx->dir, true, obj_path, sizeof obj_path, "%s/%s", ctx->path, obj_name );
-                    if ( rc != 0 )
-                    {
-                        PLOGERR( klogErr, ( klogErr, rc,
-                                 "KDirectoryResolvePath( $(path) ) failed in $(func)", "path=%s,func=%s", ctx->path, __func__ ) );
-                    }
-                    else
-                    {
-                        visit_ctx octx;
-                        octx.dir = ctx->dir;
-                        octx.options = ctx->options;
-                        octx.path = obj_path;
-                        octx.data = ctx->data;
-                        octx.path_type = ( KDirectoryPathType ( ctx->dir, "%s", obj_path ) & ~ kptAlias );
-                        if ( octx.path_type == kptDir )
-                        {
-                            rc = foreach_path_obj( &octx, func );   /* recursion !!! */
-                        }
-                        else if ( octx.path_type == kptFile )
-                        {
-                            rc = func( &octx );
-                        }
-                    }
-                }
-            }
-
-            {
-                rc_t rc2 = KNamelistRelease ( path_objects );
-                if ( rc2 != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc2,
-                             "KNamelistRelease() failed in $(func)", "func=%s", __func__ ) );
-                }
-            }
-        }
-    }
-    if ( rc == 0 && ( ctx->path_type == kptDir || ctx->path_type == kptFile ) && !ctx->terminate )
-    {
-        /* at the very end of it, call the function for the path itself */
-        rc = func( ctx );
-    }
-    return rc;
-}
-
-
-static rc_t foreach_path( visit_ctx * octx, on_path_t func )
-{
-    rc_t rc = 0;
-    uint32_t idx;
-
-    octx->terminate = false;
-    for ( idx = 0; idx < octx->options->path_count && rc == 0 && !octx->terminate; ++idx )
-    {
-        rc = VNameListGet ( octx->options->paths, idx, &octx->path );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "VNameListGet( $(idx) ) failed in $(func)", "idx=%u,func=%s", idx, __func__ ) );
-        }
-        else if ( octx->path != NULL )
-        {
-            rc = foreach_path_obj( octx, func );
-        }
-    }
-    return rc;
-}
-
-
-static bool string_ends_in( const char * str, const char * end )
-{
-    bool res = false;
-    if ( str != NULL && end != NULL )
-    {
-        uint32_t l_str = string_len( str, string_size( str ) );
-        uint32_t l_end = string_len( end, string_size( end ) );
-        if ( l_str >= l_end && l_end > 0 )
-        {
-            const char * p = str + ( l_str - l_end );
-            res = ( string_cmp ( p, l_end, end, l_end, l_end ) == 0 );
-        }
-    }
-    return res;
-}
-
-
-/***************************************************************************************************************/
-
-typedef struct report_data
-{
-    uint32_t partial_count;
-    uint32_t full_count;
-    uint32_t lock_count;
-    uint64_t file_size;
-    uint64_t used_file_size;
-} report_data;
-
-
-static rc_t on_report_cache_file( visit_ctx * obj )
-{
-    rc_t rc = 0;
-    uint64_t file_size = 0, used_size = 0;
-    float completeness = 0.0;
-    bool locked = false;
-    report_data * data = obj->data;
-
-    data->partial_count++;
-    rc = KDirectoryFileSize ( obj->dir, &file_size, "%s", obj->path );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KDirectoryFileSize( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-    }
-    else
-    {
-        struct KFile const *f;
-
-        data->file_size += file_size;
-        rc = KDirectoryOpenFileRead ( obj->dir, &f, "%s", obj->path );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KDirectoryOpenFileRead( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-        }
-        else
-        {
-            rc = GetCacheCompleteness( f, &completeness );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "GetCacheCompleteness( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-            }
-            else
-            {
-                used_size = file_size * ( completeness / 100 );
-                data->used_file_size += used_size;
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        uint32_t pt = ( KDirectoryPathType ( obj->dir, "%s.lock", obj->path ) & ~ kptAlias );
-        locked = ( pt == kptFile );
-    }
-
-    if ( rc == 0 && obj->options->detailed )
-    {
-        if ( locked )
-            rc = KOutMsg( "%s complete by %.02f %% [%,u of %,u]bytes locked\n",
-                          obj->path, completeness, used_size, file_size );
-        else
-            rc = KOutMsg( "%s complete by %.02f %% [%,u of %,u]bytes\n",
-                          obj->path, completeness, used_size, file_size );
-    }
-    return rc;
-}
-
-
-static rc_t on_report_full_file( visit_ctx * obj )
-{
-    rc_t rc = 0;
-    uint64_t file_size = 0;
-    report_data * data = obj->data;
-
-    data->full_count++;
-    rc = KDirectoryFileSize ( obj->dir, &file_size, "%s", obj->path );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KDirectoryFileSize( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-    }
-    else
-    {
-        data->file_size += file_size;
-        data->used_file_size += file_size;
-        if ( obj->options->detailed )
-            rc = KOutMsg( "%s complete file of %,u bytes\n", obj->path, file_size );
-    }
-    return rc;
-}
-
-
-static rc_t on_report_path( visit_ctx * obj )
-{
-    rc_t rc = 0;
-    if ( obj->path_type == kptFile )
-    {
-        report_data * data = obj->data;
-        if ( string_ends_in( obj->path, ".cache" ) )
-        {
-            rc = on_report_cache_file( obj );
-        }
-        else if ( string_ends_in( obj->path, ".lock" ) )
-        {
-            data->lock_count ++;
-        }
-        else if ( string_ends_in( obj->path, ".sra" ) )
-        {
-            rc = on_report_full_file( obj );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t perform_report( visit_ctx * octx )
-{
-    rc_t rc = 0;
-    report_data data;
-
-    memset( &data, 0, sizeof data );
-    octx->data = &data;
-
-    if ( octx->options->detailed )
-        rc = KOutMsg( "\n-----------------------------------\n" );
-    if ( rc == 0 )
-        rc = foreach_path( octx, on_report_path );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "-----------------------------------\n" );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u cached file(s)\n", data.partial_count );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u complete file(s)\n", data.full_count );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u bytes in cached files\n", data.file_size );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u bytes used in cached files\n", data.used_file_size );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u lock files\n", data.lock_count );
-
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-typedef rc_t ( * CC get_repo_cb )( const KRepositoryMgr *self, KRepositoryVector *repos );
-
-
-static rc_t report_repo( const tool_options * options, const KRepositoryMgr *repo_mgr, get_repo_cb getter, const char * hint )
-{
-    rc_t rc;
-    KRepositoryVector repos;
-    VectorInit ( &repos, 0, 5 );
-    rc = getter ( repo_mgr, &repos );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KRepositoryMgr<$(hint)>repositories() failed in $(func)", "hint=%s,func=%s", hint, __func__ ) );
-    }
-    else
-    {
-        uint32_t idx;
-        KOutMsg( "\n%s:\n", hint );
-        for ( idx = 0; idx < VectorLength( &repos ) && rc == 0; ++idx )
-        {
-            const KRepository *repo = VectorGet( &repos, idx );
-            if ( repo != NULL )
-            {
-                char repo_name[ 1024 ];
-                rc = KRepositoryName ( repo, repo_name, sizeof repo_name, NULL );
-                if ( rc != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc,
-                             "KRepositoryName() for $(hint) failed in $(func)", "hint=%s,func=%s", hint, __func__ ) );
-                }
-                else
-                {
-                    bool disabled = KRepositoryDisabled ( repo );
-                    bool cache_enabled = KRepositoryCacheEnabled ( repo );
-                    rc = KOutMsg( "\t%s: %s, cache-%s",
-                            repo_name,
-                            ( disabled ? "disabled" : "enabled" ),
-                            ( cache_enabled ? "enabled" : "disabled" ) );
-                    if ( rc == 0 )
-                    {
-                        if ( options->detailed )
-                        {
-                            char root[ 4096 ];
-                            rc = KRepositoryRoot ( repo, root, sizeof root, NULL );
-                            if ( rc != 0 )
-                            {
-                                PLOGERR( klogErr, ( klogErr, rc,
-                                         "KRepositoryRoot( $(hint) ) failed in $(func)", "hint=%s,func=%s", repo_name, __func__ ) );
-                            }
-                            if ( rc == 0 )
-                                rc = KOutMsg( ", at %s\n", root );
-                        }
-                        else
-                            rc = KOutMsg( "\n" );
-                    }
-                }
-            }
-        }
-    }
-    {
-        rc_t rc2 = KRepositoryVectorWhack ( &repos );
-        if ( rc2 != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc2,
-                     "KRepositoryVectorWhack() for $(hint) failed in $(func)", "hint=%s,func=%s", hint, __func__ ) );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t perform_rreport( visit_ctx * octx )
-{
-    KConfig * cfg;
-    rc_t rc = KConfigMake ( &cfg, NULL );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KConfigMake() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else
-    {
-        const KRepositoryMgr *repo_mgr;
-        rc = KConfigMakeRepositoryMgrRead ( cfg, &repo_mgr );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KConfigMakeRepositoryMgrRead() failed in $(func)", "func=%s", __func__ ) );
-        }
-        else
-        {
-            rc = report_repo( octx->options, repo_mgr, KRepositoryMgrUserRepositories, "user" );
-
-            if ( rc == 0 )
-                rc = report_repo( octx->options, repo_mgr, KRepositoryMgrSiteRepositories, "site" );
-
-            if ( rc == 0 )
-                rc = report_repo( octx->options, repo_mgr, KRepositoryMgrRemoteRepositories, "remote" );
-
-            {
-                rc_t rc2 = KRepositoryMgrRelease ( repo_mgr );
-                if ( rc2 != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc2,
-                             "KRepositoryMgrRelease() failed in $(func)", "func=%s", __func__ ) );
-                }
-            }
-
-            KOutMsg( "\n\n" );
-        }
-
-        {
-            rc_t rc2 = KConfigRelease ( cfg );
-            if ( rc2 != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc2,
-                         "KConfigRelease() failed in $(func)", "func=%s", __func__ ) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-
-
-typedef struct unlock_data
-{
-    uint32_t lock_count;
-} unlock_data;
-
-
-static rc_t on_unlock_path( visit_ctx * obj )
-{
-    rc_t rc = 0;
-    if ( obj->path_type == kptFile && string_ends_in( obj->path, ".lock" ) )
-    {
-        unlock_data * data = obj->data;
-        rc = KDirectoryRemove ( obj->dir, false, "%s", obj->path );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KDirectoryRemove( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-        }
-        else
-        {
-            data->lock_count++;
-            rc = KOutMsg( "%s deleted\n", obj->path );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t perform_unlock( visit_ctx * octx )
-{
-    rc_t rc = 0;
-    unlock_data data;
-
-    memset( &data, 0, sizeof data );
-    octx->data = &data;
-    if ( rc == 0 )
-        rc = foreach_path( octx, on_unlock_path );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "-----------------------------------\n" );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u lock-files removed\n", data.lock_count );
-
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-
-
-typedef struct clear_data
-{
-    uint32_t removed_files;
-    uint32_t removed_directories;
-    uint64_t removed_size;
-} clear_data;
-
-
-static rc_t on_clear_path( visit_ctx * obj )
-{
-    rc_t rc = 0;
-    clear_data * data = obj->data;
-
-    /* the caller is written to first hit the files/subdirs, then the directory that contains them */
-    if ( obj->path_type == kptDir )
-    {
-        if ( obj->options->remove_dirs )
-        {
-            rc = KDirectoryRemove ( obj->dir, false, "%s", obj->path );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "KDirectoryRemove( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-            }
-            else
-                data->removed_directories++;
-        }
-    }
-    else if ( obj->path_type == kptFile )
-    {
-        uint64_t file_size;
-        rc = KDirectoryFileSize ( obj->dir, &file_size, "%s", obj->path );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KDirectoryFileSize( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-        }
-        else
-        {
-            rc = KDirectoryRemove ( obj->dir, false, "%s", obj->path );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "KDirectoryRemove( $(path) ) failed in $(func)", "path=%s,func=%s", obj->path, __func__ ) );
-            }
-            else
-            {
-                if ( obj->options->detailed )
-                    rc = KOutMsg( "FILE: '%s' removed (%,u bytes)\n", obj->path, file_size );
-                data->removed_files++;
-                data->removed_size += file_size;
-                if ( obj->options->max_remove > 0 && data->removed_size >= obj->options->max_remove )
-                {
-                    obj->terminate = true;
-                    KOutMsg( "the maximum of %,lu bytes to be removed is reached now\n", obj->options->max_remove );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t perform_clear( visit_ctx * octx )
-{
-    rc_t rc = 0;
-    clear_data data;
-
-    memset( &data, 0, sizeof data );
-    octx->data = &data;
-
-    if ( octx->options->max_remove > 0 )
-        rc = KOutMsg( "removing max %,u bytes\n", octx->options->max_remove );
-    if ( rc == 0 )
-        rc = foreach_path( octx, on_clear_path );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "-----------------------------------\n" );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u files removed\n", data.removed_files );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u directories removed\n", data.removed_directories );
-    if ( rc == 0 )
-        rc = KOutMsg( "%,u bytes removed\n", data.removed_size );
-
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-
-static rc_t enable_disable_repo( bool disabled, get_repo_cb getter, const char * hint )
-{
-    KConfig * cfg;
-    rc_t rc = KConfigMake ( &cfg, NULL );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KConfigMake() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else
-    {
-        const KRepositoryMgr *repo_mgr;
-        rc = KConfigMakeRepositoryMgrRead ( cfg, &repo_mgr );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KConfigMakeRepositoryMgrRead() failed in $(func)", "func=%s", __func__ ) );
-        }
-        else
-        {
-            uint32_t idx;
-            KRepositoryVector repos;
-            VectorInit ( &repos, 0, 5 );
-            rc = getter ( repo_mgr, &repos );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc,
-                         "KRepositoryMgr<$(hint)>repositories() failed in $(func)", "hint=%s,func=%s", hint, __func__ ) );
-            }
-            for ( idx = 0; idx < VectorLength( &repos ) && rc == 0; ++idx )
-            {
-                const KRepository *repo = VectorGet( &repos, idx );
-                if ( repo != NULL )
-                {
-                    rc = KRepositorySetDisabled ( repo, disabled );
-                    if ( rc != 0 )
-                    {
-                        PLOGERR( klogErr, ( klogErr, rc,
-                                 "KRepositorySetDisabled() failed in $(func)", "func=%s", __func__ ) );
-                    }
-                }
-            }
-            if ( rc == 0 )
-            {
-                if ( disabled )
-                    KOutMsg( "%s repositories disabled\n", hint );
-                else
-                    KOutMsg( "%s repositories enabled\n", hint );
-            }
-            {
-                rc_t rc2 = KRepositoryVectorWhack ( &repos );
-                if ( rc2 != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc2,
-                             "KRepositoryVectorWhack() failed in $(func)", "func=%s", __func__ ) );
-                }
-                rc2 = KRepositoryMgrRelease ( repo_mgr );
-                if ( rc2 != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc2,
-                             "KRepositoryMgrRelease() failed in $(func)", "func=%s", __func__ ) );
-                }
-
-            }
-        }
-
-        {
-            rc_t rc2 = KConfigRelease ( cfg );
-            if ( rc2 != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc2,
-                         "KConfigRelease() failed in $(func)", "func=%s", __func__ ) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t enable_disable_user_repo( bool disabled )
-{
-    return enable_disable_repo( disabled, KRepositoryMgrUserRepositories, "user" );
-}
-
-
-static rc_t enable_disable_site_repo( bool disabled )
-{
-    return enable_disable_repo( disabled, KRepositoryMgrSiteRepositories, "site" );
-}
-
-
-static rc_t enable_disable_remote_repo( bool disabled )
-{
-    return enable_disable_repo( disabled, KRepositoryMgrRemoteRepositories, "remote" );
-}
-
-
-/***************************************************************************************************************/
-
-
-static rc_t perform_enable( visit_ctx * octx )
-{
-    rc_t rc = 0;
-    switch( octx->options->repo_select )
-    {
-    case trs_user    : rc = enable_disable_user_repo( false ); break;
-    case trs_site    : rc = enable_disable_site_repo( false ); break;
-    case trs_remote  : rc = enable_disable_remote_repo( false ); break;
-    case trs_unknown : rc = KOutMsg( "enable unknown\n" ); break;
-    }
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-
-
-static rc_t perform_disable( visit_ctx * octx )
-{
-    rc_t rc = 0;
-    switch( octx->options->repo_select )
-    {
-    case trs_user    : rc = enable_disable_user_repo( true ); break;
-    case trs_site    : rc = enable_disable_site_repo( true ); break;
-    case trs_remote  : rc = enable_disable_remote_repo( true ); break;
-    case trs_unknown : rc = KOutMsg( "disable unknown\n" ); break;
-    }
-    return rc;
-}
-
-
-/***************************************************************************************************************/
-
-
-static rc_t perform( tool_options * options, void * data )
-{
-    visit_ctx octx;
-    rc_t rc = KDirectoryNativeDir( &octx.dir );
-    if ( rc == 0 )
-    {
-        octx.options = options;
-        octx.data = data;
-        switch( options->main_function )
-        {
-            case tf_report  : rc = perform_report( &octx ); break;
-            case tf_rreport : rc = perform_rreport( &octx ); break;
-            case tf_unlock  : rc = perform_unlock( &octx ); break;
-            case tf_clear   : rc = perform_clear( &octx ); break;
-            case tf_enable  : rc = perform_enable( &octx ); break;
-            case tf_disable : rc = perform_disable( &octx ); break;
-            case tf_unknown : rc = KOutMsg( "unknown function requested\n" ); break;
-        }
-        KDirectoryRelease( octx.dir );
-    }
-    return rc;
-}
-
-
-/***************************************************************************
-    Main:
-***************************************************************************/
-
-
-static rc_t get_cache_path_from_repo_mgr( tool_options * options )
-{
-    KConfig * cfg;
-    rc_t rc = KConfigMake ( &cfg, NULL );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KConfigMake() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else
-    {
-        const KRepositoryMgr *repo_mgr;
-        rc = KConfigMakeRepositoryMgrRead ( cfg, &repo_mgr );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "KConfigMakeRepositoryMgrRead() failed in $(func)", "func=%s", __func__ ) );
-        }
-        else
-        {
-            KRepositoryVector repos;
-            VectorInit ( &repos, 0, 5 );
-            rc = KRepositoryMgrUserRepositories ( repo_mgr, &repos );
-            if ( rc != 0 )
-            {
-                rc = 0; /* we do not have a user-repository, but that is OK, the caller will display the lack of it ... */
-            }
-            else
-            {
-                uint32_t idx;
-                for ( idx = 0; idx < VectorLength( &repos ) && rc == 0; ++idx )
-                {
-                    const KRepository *repo = VectorGet( &repos, idx );
-                    if ( repo != 0 )
-                    {
-                        char path[ 4096 ];
-                        rc = KRepositoryRoot ( repo, path, sizeof path, NULL );
-                        if ( rc != 0 )
-                        {
-                            PLOGERR( klogErr, ( klogErr, rc,
-                                     "KRepositoryRoot( for repo # $(idx) ) failed in $(func)", "idx=%u,func=%s", idx, __func__ ) );
-                        }
-                        else
-                        {
-                            bool add = true;
-                            if ( options->user_repo_name != NULL )
-                            {
-                                char name[ 1024 ];
-                                rc = KRepositoryName ( repo, name, sizeof name, NULL );
-                                if ( rc != 0 )
-                                {
-                                    PLOGERR( klogErr, ( klogErr, rc,
-                                             "KRepositoryName( for repo # $(idx) ) failed in $(func)", "idx=%u,func=%s", idx, __func__ ) );
-                                }
-                                else
-                                    add = string_cmp_1( options->user_repo_name, name );
-                            }
-                            if ( add )
-                            {
-                                rc = add_tool_options_path( options, path );
-                                if ( options->detailed )
-                                    KOutMsg( "source: %s\n", path );
-                            }
-                        }
-                    }
-                }
-                {
-                    rc_t rc2 = KRepositoryVectorWhack ( &repos );
-                    if ( rc2 != 0 )
-                    {
-                        PLOGERR( klogErr, ( klogErr, rc2,
-                                 "KRepositoryVectorWhack() failed in $(func)", "func=%s", __func__ ) );
-                    }
-                }
-            }
-            {
-                rc_t rc2 = KRepositoryMgrRelease ( repo_mgr );
-                if ( rc2 != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc2,
-                             "KRepositoryMgrRelease() failed in $(func)", "func=%s", __func__ ) );
-                }
-            }
-        }
-        {
-            rc_t rc2 = KConfigRelease ( cfg );
-            if ( rc2 != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc2,
-                         "KConfigRelease() failed in $(func)", "func=%s", __func__ ) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t CC write_to_FILE ( void *f, const char *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = fwrite ( buffer, 1, bytes, f );    /* hardcoded value for stdout == 1 */
-    if ( * num_writ != bytes )
-        return RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-
-static rc_t explain_no_cache_found ( void )
-{
-    rc_t rc = KOutMsg( "this tool was not able to find the location of the cache\n" );
-    if ( rc == 0 )
-        rc = KOutMsg( "solution A : specify the cache-path at the commandline like 'cache-mgr ~/my_cache -r'\n" );
-    if ( rc == 0 )
-        rc = KOutMsg( "solution B : fix your broken configuration-setup ( run the java-gui )\n" );
-    return rc;
-}
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    rc_t rc = KOutHandlerSet ( write_to_FILE, stdout );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc,
-                 "KOutHandlerSet() failed in $(func)", "func=%s", __func__ ) );
-    }
-    else
-    {
-        Args * args;
-        rc = ArgsMakeAndHandle ( &args, argc, argv, 1,
-                                 ToolOptions, sizeof ToolOptions / sizeof ToolOptions [ 0 ] );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogErr, ( klogErr, rc,
-                     "ArgsMakeAndHandle() failed in $(func)", "func=%s", __func__ ) );
-        }
-        else
-        {
-            tool_options options;
-            rc = init_tool_options( &options );
-            if ( rc == 0 )
-            {
-                rc = get_tool_options( args, &options );
-                if ( rc == 0 )
-                {
-                    bool cache_paths_needed = false;
-                    switch( options.main_function )
-                    {
-                        case tf_report  : ;
-                        case tf_unlock  : ;
-                        case tf_clear   : cache_paths_needed = true; break;
-                        case tf_rreport : ;
-                        case tf_enable  : ;
-                        case tf_disable : ;
-                        case tf_unknown : ; break;
-                    }
-
-                    if ( options.path_count == 0 && cache_paths_needed )
-                        rc = get_cache_path_from_repo_mgr( &options );
-
-                    if ( rc == 0 )
-                    {
-                        if ( options.path_count == 0 && cache_paths_needed )
-                        {
-                            rc = explain_no_cache_found ();
-                        }
-                        else
-                            rc = perform( &options, NULL );
-                    }
-                }
-                clear_tool_options( &options );
-            }
-        }
-        {
-            rc_t rc2 = ArgsWhack ( args );
-            if ( rc2 != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc2,
-                         "ArgsWhack() failed in $(func)", "func=%s", __func__ ) );
-            }
-        }
-    }
-
-    return rc;
-}
-
diff --git a/tools/cache-mgr/cache-mgr.vers b/tools/cache-mgr/cache-mgr.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/cache-mgr/cache-mgr.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/cg-load/Makefile b/tools/cg-load/Makefile
deleted file mode 100644
index 9636568..0000000
--- a/tools/cg-load/Makefile
+++ /dev/null
@@ -1,106 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/cg-load
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	cg-load
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# cg-load
-#
-CGLOAD_SRC = \
-	file-version-factory \
-	file \
-	f1_3 \
-	f1_5 \
-	f2_0 \
-	f2_2 \
-	factory-reads \
-	factory-mappings \
-	factory-evidence-intervals \
-	factory-evidence-dnbs \
-	writer-seq \
-	writer-algn \
-	writer-evidence-intervals \
-	writer-evidence-dnbs \
-	cg-load
-
-CGLOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(CGLOAD_SRC))
-
-CGLOAD_LIB = \
-	-lkapp \
-	-lload \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/cg-load: $(CGLOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(CGLOAD_LIB)
diff --git a/tools/cg-load/cg-load.c b/tools/cg-load/cg-load.c
deleted file mode 100644
index e40a4c5..0000000
--- a/tools/cg-load/cg-load.c
+++ /dev/null
@@ -1,1120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/container.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <kfs/directory.h>
-#include <kfs/arc.h>
-#include <kfs/tar.h>
-#include <kfs/file.h>
-#include <kdb/manager.h>
-#include <kdb/meta.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <kapp/loader-meta.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <insdc/insdc.h>
-#include <align/writer-reference.h>
-#include <kapp/log-xml.h>
-
-#include "debug.h"
-#include "cg-load.vers.h"
-#include "file.h"
-#include "writer-seq.h"
-#include "writer-algn.h"
-#include "writer-evidence-intervals.h"
-
-#include <os-native.h>
-#include <sysalloc.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <assert.h>
-
-typedef struct SParam_struct
-{
-    const char* argv0;
-
-    KDirectory* input_dir;
-    const KDirectory *map_dir;
-    const KDirectory *asm_dir;
-    KDirectory* output_dir;
-
-    const char* map_path;
-    const char* asm_path;
-    const char* schema;
-    const char* refseqcfg;
-    const char* refseqpath;
-    const char* library;
-    char const** refFiles; /* NULL-terminated array pointing to argv */
-    /* mostly for debugging */
-    uint32_t refseq_chunk;
-    const char* out;
-    uint32_t force;
-    uint32_t force_refw;
-    uint32_t force_readw;
-    uint32_t no_read_ahead;
-    const char* qual_quant;
-    uint32_t no_spot_group;
-    uint32_t min_mapq;
-    uint32_t single_mate;
-    uint32_t cluster_size;
-} SParam;
-
-typedef struct DB_Handle_struct {
-    VDBManager* mgr;
-    VSchema* schema;
-    VDatabase* db;
-    const ReferenceMgr* rmgr;
-    const CGWriterSeq* wseq;
-    TReadsData* reads;
-    const CGWriterAlgn* walgn;
-    TMappingsData* mappings;
-    const CGWriterEvdInt* wev_int;
-    TEvidenceIntervalsData* ev_int;
-    const CGWriterEvdDnbs* wev_dnb;
-    TEvidenceDnbsData* ev_dnb;
-} DB_Handle;
-
-static
-rc_t DB_Init(const SParam* p, DB_Handle* h)
-{
-    rc_t rc;
-
-    if( (rc = VDBManagerMakeUpdate(&h->mgr, NULL)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create VDB Manager");
-
-    }
-    else if( (rc = VDBManagerMakeSchema(h->mgr, &h->schema)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create schema");
-
-    }
-    else if( (rc = VSchemaParseFile(h->schema, p->schema)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to parse schema file '$(schema)'", PLOG_S(schema), p->schema));
-
-    }
-    else if( (rc = VDBManagerCreateDB(h->mgr, &h->db, h->schema, "NCBI:align:db:alignment_evidence",
-                                        p->force ? kcmInit : kcmCreate, p->out)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to create database at '$(path)'", PLOG_S(path), p->out));
-
-    }
-    else if( (rc = ReferenceMgr_Make(&h->rmgr, h->db, h->mgr, (p->force_refw ? ewrefmgr_co_allREADs : 0),
-                        p->refseqcfg, p->refseqpath, p->refseq_chunk, 350 * 1024 * 1024, 0)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create reference manager");
-
-    }
-    else if( (rc = CGWriterAlgn_Make(&h->walgn, &h->mappings, h->db, h->rmgr, p->min_mapq, p->single_mate, p->cluster_size)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create alignment writer");
-
-    }
-    else if( (rc = CGWriterSeq_Make(&h->wseq, &h->reads, h->db, (p->force_readw ? ewseq_co_SaveRead : 0) |
-                                      (p->no_spot_group ? 0 : ewseq_co_SpotGroup), p->qual_quant)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create sequence writer");
-
-    } else if( p->asm_path && (rc = CGWriterEvdInt_Make(&h->wev_int, &h->ev_int, h->db, h->rmgr, 0)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create evidence intervals writer");
-
-    } else if( p->asm_path && (rc = CGWriterEvdDnbs_Make(&h->wev_dnb, &h->ev_dnb, h->db, h->rmgr, 0)) != 0 ) {
-        LOGERR(klogErr, rc, "failed to create evidence dnbs writer");
-    } else {
-        const char** r = p->refFiles;
-        while( rc == 0 && *r != NULL ) {
-            if( (rc = ReferenceMgr_FastaPath(h->rmgr, *r++)) != 0 ) {
-                PLOGERR(klogInfo, (klogInfo, rc, "fasta file '$(file)'", "file=%s", r[-1]));
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t DB_Fini(const SParam* p, DB_Handle* h, bool drop)
-{
-    rc_t rc = 0, rc2;
-
-    /* THIS FUNCTION MAKES NO ATTEMPT TO PRESERVE INITIAL ERROR CODES
-       EACH SUCCESSIVE ERROR OVERWRITES THE PREVIOUS CODE */
-    if( h != NULL ) {
-        PLOGMSG(klogInfo, (klogInfo, "Fini SEQUENCE", "severity=status"));
-        if( (rc2 = CGWriterSeq_Whack(h->wseq, !drop, NULL)) != 0 && !drop ) {
-            drop = true;
-            rc = rc2;
-        }
-        h->wseq = NULL;
-        h->reads = NULL;
-        PLOGMSG(klogInfo, (klogInfo, "Fini (PRI&SEC)_ALIGNMENT", "severity=status"));
-        if( (rc2 = CGWriterAlgn_Whack(h->walgn, !drop, NULL, NULL)) != 0 && !drop ) {
-            drop = true;
-            rc = rc2;
-        }
-        h->walgn = NULL;
-        h->mappings = NULL;
-        PLOGMSG(klogInfo, (klogInfo, "Fini EVIDENCE_INTERVAL", "severity=status"));
-        if( (rc2 = CGWriterEvdInt_Whack(h->wev_int, !drop, NULL)) != 0 && !drop ) {
-            drop = true;
-            rc = rc2;
-        }
-        h->wev_int = NULL;
-        h->ev_int = NULL;
-        PLOGMSG(klogInfo, (klogInfo, "Fini EVIDENCE_ALIGNMENT", "severity=status"));
-        if( (rc2 = CGWriterEvdDnbs_Whack(h->wev_dnb, !drop, NULL)) != 0 && !drop ) {
-            drop = true;
-            rc = rc2;
-        }
-        h->wev_dnb = NULL;
-        h->ev_dnb = NULL;
-        PLOGMSG(klogInfo, (klogInfo, "Fini calculating reference coverage", "severity=status"));
-        if( (rc2 = ReferenceMgr_Release(h->rmgr, !drop, NULL, drop ? false : true, Quitting)) != 0 && !drop ) {
-            drop = true;
-            rc = rc2;
-	    LOGERR(klogErr, rc, "Failed calculating reference coverage");
-        }
-        h->rmgr = NULL;
-        if( rc == 0 )
-        {
-            KMetadata* meta;
-            if( (rc = VDatabaseOpenMetadataUpdate(h->db, &meta)) == 0 ) {
-                KMDataNode *node;
-                if( (rc = KMetadataOpenNodeUpdate(meta, &node, "/")) == 0 ) {
-                    if( (rc = KLoaderMeta_Write(node, p->argv0, __DATE__, "Complete Genomics", KAppVersion())) != 0 ) {
-                        LOGERR(klogErr, rc, "Cannot update loader meta");
-                    }
-                    KMDataNodeRelease(node);
-                }
-                KMetadataRelease(meta);
-            }
-        }
-        PLOGMSG(klogInfo, (klogInfo, "Fini VDatabaseRelease", "severity=status"));
-        VDatabaseRelease(h->db);
-        h->db = NULL;
-        VSchemaRelease(h->schema);
-        h->schema = NULL;
-        if( drop || rc != 0 ) {
-            rc2 = VDBManagerDrop(h->mgr, kptDatabase, p->out);
-            if( GetRCState(rc2) == rcNotFound ) {
-                /* WHAT WOULD BE THE POINT OF RESETTING "rc" TO ZERO? */
-                rc = 0;
-            } else if( rc2 != 0 ) {
-                if ( rc == 0 )
-                    rc = rc2;
-                PLOGERR(klogErr, (klogErr, rc2, "cannot drop db at '$(path)'", PLOG_S(path), p->out));
-            }
-        }
-        VDBManagerRelease(h->mgr);
-        h->mgr = NULL;
-    }
-    return rc;
-}
-
-typedef struct FGroupKey_struct {
-    CG_EFileType type;
-    const CGFIELD_ASSEMBLY_ID_TYPE* assembly_id;
-    union {
-        struct {
-            const CGFIELD_SLIDE_TYPE* slide;
-            const CGFIELD_LANE_TYPE* lane;
-            const CGFIELD_BATCH_FILE_NUMBER_TYPE* batch_file_number;
-        } map;
-        struct {
-            const CGFIELD_SAMPLE_TYPE* sample;
-            const CGFIELD_CHROMOSOME_TYPE* chromosome;
-        } asmb;
-    } u;
-} FGroupKey;
-
-static
-rc_t CC FGroupKey_Make(FGroupKey* key, const CGLoaderFile* file, const SParam* param)
-{
-    rc_t rc = 0;
-    CG_EFileType ftype;
-
-    if( (rc = CGLoaderFile_GetType(file, &ftype)) == 0 ) {
-        switch(ftype) {
-            case cg_eFileType_READS:
-            case cg_eFileType_MAPPINGS:
-                key->type = cg_eFileType_READS;
-                if( (rc = CGLoaderFile_GetAssemblyId(file, &key->assembly_id)) == 0 &&
-                    (rc = CGLoaderFile_GetSlide(file, &key->u.map.slide)) == 0 &&
-                    (rc = CGLoaderFile_GetLane(file, &key->u.map.lane)) == 0 ) {
-                    rc = CGLoaderFile_GetBatchFileNumber(file, &key->u.map.batch_file_number);
-                }
-                break;
-            case cg_eFileType_EVIDENCE_INTERVALS:
-            case cg_eFileType_EVIDENCE_DNBS:
-                if( param->asm_path != NULL ) {
-                    /* do not pick up ASM files if not requested */
-                    key->type = cg_eFileType_EVIDENCE_INTERVALS;
-                    if( (rc = CGLoaderFile_GetAssemblyId(file, &key->assembly_id)) == 0 &&
-                        (rc = CGLoaderFile_GetSample(file, &key->u.asmb.sample)) == 0 ) {
-                        rc = CGLoaderFile_GetChromosome(file, &key->u.asmb.chromosome);
-                    }
-                    break;
-                }
-            default:
-                rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcIgnored);
-                break;
-        }
-    }
-    return rc;
-}
-static
-rc_t CC FGroupKey_Validate(const FGroupKey* key)
-{
-    rc_t rc = 0;
-    DEBUG_MSG(5, ("KEY: "));
-    switch( key->type ) {
-        case cg_eFileType_READS:
-            DEBUG_MSG(5, ("%s:%s:%s:%04u", key->assembly_id, key->u.map.slide, key->u.map.lane, key->u.map.batch_file_number));
-            if( !key->assembly_id || !key->u.map.slide || !key->u.map.lane || !key->u.map.batch_file_number ) {
-                rc = RC(rcExe, rcQueue, rcValidating, rcId, rcIncomplete);
-            }
-            break;
-        case cg_eFileType_EVIDENCE_INTERVALS:
-            DEBUG_MSG(5, ("%s:%s:%s", key->assembly_id, key->u.asmb.sample, key->u.asmb.chromosome));
-            if( !key->assembly_id || !key->u.asmb.sample || !key->u.asmb.chromosome ) {
-                rc = RC(rcExe, rcQueue, rcValidating, rcId, rcIncomplete);
-            }
-            break;
-        default:
-            DEBUG_MSG(5, ("CORRUPT!!"));
-            rc = RC(rcExe, rcQueue, rcValidating, rcId, rcWrongType);
-            break;
-    }
-    return rc;
-}
-
-typedef struct FGroupMAP_struct {
-    BSTNode dad;
-    FGroupKey key;
-    const CGLoaderFile* seq;
-    const CGLoaderFile* align;
-} FGroupMAP;
-
-static
-void FGroupMAP_CloseFiles(FGroupMAP *g)
-{
-    CGLoaderFile_Close(g->seq);
-    CGLoaderFile_Close(g->align);
-}
-
-static
-void CC FGroupMAP_Whack( BSTNode *node, void *data )
-{
-    FGroupMAP* n = (FGroupMAP*)node;
-    CGLoaderFile_Release(n->seq, false);
-    CGLoaderFile_Release(n->align, false);
-    free(node);
-}
-
-static
-int CC FGroupMAP_Cmp( const void *item, const BSTNode *node )
-{
-    const FGroupKey* i = (const FGroupKey*)item;
-    const FGroupMAP* n = (const FGroupMAP*)node;
-
-    int r = strcmp(i->assembly_id, n->key.assembly_id);
-    if( r == 0 ) {
-        if( i->type == n->key.type ) {
-            switch( i->type ) {
-                case cg_eFileType_READS:
-                    if( (r = strcmp(i->u.map.slide, n->key.u.map.slide)) == 0 ) {
-                        if( (r = strcmp(i->u.map.lane, n->key.u.map.lane)) == 0 ) {
-                            r = *(i->u.map.batch_file_number) - *(n->key.u.map.batch_file_number);
-                        }
-                    }
-                    break;
-                case cg_eFileType_EVIDENCE_INTERVALS:
-                    if( (r = strcmp(i->u.asmb.sample, n->key.u.asmb.sample)) == 0 ) {
-                        r = strcmp(i->u.asmb.chromosome, n->key.u.asmb.chromosome);
-                    }
-                    break;
-                default:
-                    r = -1;
-                    break;
-            }
-        } else {
-            r = -1;
-        }
-    }
-    return r;
-}
-
-static
-int CC FGroupMAP_Sort( const BSTNode *item, const BSTNode *n )
-{
-    return FGroupMAP_Cmp(&((const FGroupMAP*)item)->key, n);
-}
-
-typedef struct FGroupMAP_FindData_struct {
-    FGroupKey key;
-    int64_t rowid;
-} FGroupMAP_FindData;
-
-static
-bool CC FGroupMAP_FindRowId( BSTNode *node, void *data )
-{
-    FGroupMAP_FindData* d = (FGroupMAP_FindData*)data;
-    const FGroupMAP* n = (const FGroupMAP*)node;
-
-    if( FGroupMAP_Cmp(&d->key, node) == 0 ) {
-        if( CGLoaderFile_GetStartRow(n->seq, &d->rowid) == 0 ) {
-            return true;
-        }
-    }
-    return false;
-}
-
-static
-rc_t CC FGroupMAP_Set(FGroupMAP* g, const CGLoaderFile* file)
-{
-    rc_t rc = 0;
-    CG_EFileType ftype;
-
-    if( (rc = CGLoaderFile_GetType(file, &ftype)) == 0 ) {
-        if( g->key.type == cg_eFileType_READS ) {
-            if( ftype == cg_eFileType_READS ) {
-                if( g->seq == NULL ) {
-                    g->seq = file;
-                } else {
-                    rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcDuplicate);
-                }
-            } else if( ftype == cg_eFileType_MAPPINGS ) {
-                if( g->align == NULL ) {
-                    g->align = file;
-                } else {
-                    rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcDuplicate);
-                }
-            } else {
-                rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcWrongType);
-            }
-        } else if( g->key.type == cg_eFileType_EVIDENCE_INTERVALS ) {
-            if( ftype == cg_eFileType_EVIDENCE_INTERVALS ) {
-                if( g->seq != NULL ) {
-                    rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcDuplicate);
-                } else {
-                    g->seq = file;
-                }
-            } else if( ftype == cg_eFileType_EVIDENCE_DNBS ) {
-                if( g->align == NULL ) {
-                    g->align = file;
-                } else {
-                    rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcDuplicate);
-                }
-            } else {
-                rc = RC(rcExe, rcQueue, rcInserting, rcItem, rcWrongType);
-            }
-        } else {
-            rc = RC(rcExe, rcQueue, rcInserting, rcType, rcUnexpected);
-        }
-    }
-    return rc;
-}
-
-static
-void CC FGroupMAP_Validate( BSTNode *n, void *data )
-{
-    const FGroupMAP* g = (const FGroupMAP*)n;
-    rc_t rc = 0, *rc_out = (rc_t*)data;
-    const char* rnm = NULL, *mnm = NULL;
-
-    rc = FGroupKey_Validate(&g->key);
-    if( g->seq != NULL ) {
-        CGLoaderFile_Filename(g->seq, &rnm);
-        rnm = rnm ? strrchr(rnm, '/') : rnm;
-        DEBUG_MSG(5, (" READS(%s)", rnm));
-    }
-    if( g->align ) {
-        CGLoaderFile_Filename(g->align, &mnm);
-        mnm = mnm ? strrchr(mnm, '/') : mnm;
-        DEBUG_MSG(5, (" MAPPINGS(%s)", mnm));
-    }
-    DEBUG_MSG(5, ("\n"));
-    if( rc == 0 && g->seq == NULL ) {
-        rc = RC(rcExe, rcQueue, rcValidating, rcItem, rcIncomplete);
-    }
-
-    /* THIS USED TO WIPE OUT THE "rc" ON EACH ENTRY */
-    if( rc != 0)  {
-        PLOGERR(klogErr, (klogErr, rc,  "file pair $(f1)[mandatory], $(f2)[optional]", PLOG_2(PLOG_S(f1),PLOG_S(f2)), rnm, mnm));
-        if ( * rc_out == 0 )
-            *rc_out = rc;
-#if 0
-    } else {
-        *rc_out = RC(0, 0, 0, 0, 0);
-#endif
-    }
-}
-
-typedef struct DirVisit_Data_Struct {
-    const SParam* param;
-    BSTree* tree;
-    const KDirectory* dir;
-} DirVisit_Data;
-
-/* you cannot addref to this dir object cause it's created on stack silently */
-static
-rc_t CC DirVisitor(const KDirectory *dir, uint32_t type, const char *name, void *data)
-{
-    rc_t rc = 0;
-    DirVisit_Data* d = (DirVisit_Data*)data;
-
-    if( (type & ~kptAlias) == kptFile ) {
-        if (strcmp(&name[strlen(name) - 4], ".tsv") == 0 ||
-            strcmp(&name[strlen(name) - 8], ".tsv.bz2") == 0 ||
-            strcmp(&name[strlen(name) - 7], ".tsv.gz") == 0)
-        {
-            char buf[4096];
-            const CGLoaderFile* file;
-            FGroupKey key;
-            if( (rc = KDirectoryResolvePath(dir, true, buf, sizeof(buf), name)) == 0 &&
-                (rc = CGLoaderFile_Make(&file, d->dir, buf, NULL, !d->param->no_read_ahead)) == 0 &&
-                (rc = FGroupKey_Make(&key, file, d->param)) == 0 ) {
-
-                FGroupMAP* found = (FGroupMAP*)BSTreeFind(d->tree, &key, FGroupMAP_Cmp);
-                DEBUG_MSG(5, ("file %s recognized\n", name));
-                if( found != NULL ) {
-                    rc = FGroupMAP_Set(found, file);
-                } else {
-                    FGroupMAP* x = calloc(1, sizeof(*x));
-                    if( x == NULL ) {
-                        rc = RC(rcExe, rcFile, rcInserting, rcMemory, rcExhausted);
-                    } else {
-                        memcpy(&x->key, &key, sizeof(key));
-                        if( (rc = FGroupMAP_Set(x, file)) == 0 ) {
-                            rc = BSTreeInsertUnique(d->tree, &x->dad, NULL, FGroupMAP_Sort);
-                        }
-                    }
-                }
-            } else if( GetRCObject(rc) == rcItem && GetRCState(rc) == rcIgnored ) {
-                DEBUG_MSG(5, ("file %s ignored\n", name));
-                rc = CGLoaderFile_Release(file, true);
-                file = NULL;
-            }
-            if( rc != 0 && file != NULL ) {
-                CGLoaderFile_LOG(file, klogErr, rc, NULL, NULL);
-                CGLoaderFile_Release(file, true);
-            }
-        } else if( strcmp(&name[strlen(name) - 4], ".tar") == 0 ) {
-            const KDirectory* tmp = d->dir;
-            if( (rc = KDirectoryOpenArcDirRead(dir, &d->dir, true, name, tocKFile, KArcParseTAR, NULL, NULL)) == 0 ) {
-                rc = KDirectoryVisit(d->dir, true, DirVisitor, d, ".");
-                KDirectoryRelease(d->dir);
-            }
-            d->dir = tmp;
-        }
-    }
-    return rc;
-}
-
-typedef struct FGroupMAP_LoadData_struct {
-    rc_t rc;
-    const SParam* param;
-    DB_Handle db;
-    const BSTree* reads;
-} FGroupMAP_LoadData;
-
-bool CC FGroupMAP_LoadReads( BSTNode *node, void *data )
-{
-    FGroupMAP* n = (FGroupMAP*)node;
-    FGroupMAP_LoadData* d = (FGroupMAP_LoadData*)data;
-
-    DEBUG_MSG(5, (" started\n", FGroupKey_Validate(&n->key)));
-    while( d->rc == 0 )
-    {
-        if( (d->rc = CGLoaderFile_GetRead(n->seq, d->db.reads)) == 0 ) {
-            if( (d->db.reads->flags & (cg_eLeftHalfDnbNoMatches | cg_eLeftHalfDnbMapOverflow)) &&
-                (d->db.reads->flags & (cg_eRightHalfDnbNoMatches | cg_eRightHalfDnbMapOverflow)) ) {
-                d->db.mappings->map_qty = 0;
-            } else {
-                d->rc = CGLoaderFile_GetMapping(n->align, d->db.mappings);
-            }
-            /* alignment written 1st than sequence -> primary_alignment_id must be set!! */
-            if( d->rc == 0 && (d->rc = CGWriterAlgn_Write(d->db.walgn, d->db.reads)) == 0 ) {
-                d->rc = CGWriterSeq_Write(d->db.wseq);
-            }
-        }
-        if( GetRCState(d->rc) == rcDone && GetRCObject(d->rc) == rcData ) {
-            bool eof = false;
-            d->rc = 0;
-            if( n->align == NULL || ((d->rc = CGLoaderFile_IsEof(n->align, &eof)) == 0 && eof) ) {
-                /* mappings file EOF detected ok */
-                DEBUG_MSG(5, (" done\n", FGroupKey_Validate(&n->key)));
-                break;
-            } else if( d->rc == 0 ) {
-                /* not EOF */
-                d->rc = RC(rcExe, rcFile, rcReading, rcData, rcUnexpected);
-                CGLoaderFile_LOG(n->align, klogErr, d->rc,
-                    "extra mappings, possible that corresponding reads file is truncated", NULL);
-            }
-        }
-        d->rc = d->rc ? d->rc : Quitting();
-    }
-    if( d->rc != 0 ) {
-        CGLoaderFile_LOG(n->seq, klogErr, d->rc, NULL, NULL);
-        CGLoaderFile_LOG(n->align, klogErr, d->rc, NULL, NULL);
-    }
-    FGroupMAP_CloseFiles(n);
-    return d->rc != 0;
-}
-
-bool CC FGroupMAP_LoadEvidence( BSTNode *node, void *data )
-{
-    FGroupMAP* n = (FGroupMAP*)node;
-    FGroupMAP_LoadData* d = (FGroupMAP_LoadData*)data;
-
-    DEBUG_MSG(5, ("' started\n", FGroupKey_Validate(&n->key)));
-     while( d->rc == 0 ) {
-        if( (d->rc = CGLoaderFile_GetEvidenceIntervals(n->seq, d->db.ev_int)) == 0 ) {
-            int64_t evint_rowid;
-            if( n->align != NULL ) {
-                d->rc = CGLoaderFile_GetEvidenceDnbs(n->align, d->db.ev_int->interval_id, d->db.ev_dnb);
-            } else {
-		d->db.ev_dnb->qty = 0; /***weird, but the easiest place to fix ***/
-	    }
-            /* interval written 1st than dnbs which uses interval as reference */
-            if( d->rc == 0 ) {
-                d->rc = CGWriterEvdInt_Write(d->db.wev_int, d->db.ev_dnb, &evint_rowid);
-            }
-            if( d->rc == 0 && n->align != NULL ) {
-                /* attach dnbs to reads */
-                uint16_t i;
-                FGroupMAP_FindData found;
-
-                found.key.type = cg_eFileType_READS;
-                d->rc = CGLoaderFile_GetAssemblyId(n->align, &found.key.assembly_id);
-                for(i = 0; d->rc == 0 && i < d->db.ev_dnb->qty; i++) {
-                    found.key.u.map.slide = d->db.ev_dnb->dnbs[i].slide;
-                    found.key.u.map.lane = d->db.ev_dnb->dnbs[i].lane;
-                    found.key.u.map.batch_file_number = &d->db.ev_dnb->dnbs[i].file_num_in_lane;
-                    if( BSTreeDoUntil(d->reads, false, FGroupMAP_FindRowId, &found) ) {
-                        d->rc = CGWriterEvdDnbs_SetSEQ(d->db.wev_dnb, i, found.rowid);
-                    } else {
-                        d->rc = RC(rcExe, rcFile, rcWriting, rcData, rcInconsistent);
-                    }
-                }
-            }
-            if( d->rc == 0 && n->align != NULL ) {
-                d->rc = CGWriterEvdDnbs_Write(d->db.wev_dnb, d->db.ev_int, evint_rowid);
-            }
-        }
-        if( GetRCState(d->rc) == rcDone && GetRCObject(d->rc) == rcData ) {
-            bool eof = false;
-            d->rc = 0;
-            if( n->align == NULL || ((d->rc = CGLoaderFile_IsEof(n->align, &eof)) == 0 && eof) ) {
-                /* dnbs file EOF detected ok */
-                DEBUG_MSG(5, ("' done\n", FGroupKey_Validate(&n->key)));
-                break;
-            } else if( d->rc == 0 ) {
-                /* not EOF */
-                d->rc = RC(rcExe, rcFile, rcReading, rcData, rcUnexpected);
-                CGLoaderFile_LOG(n->align, klogErr, d->rc,
-                    "extra dnbs, possible that corresponding intervals file is truncated", NULL);
-            }
-        }
-        d->rc = d->rc ? d->rc : Quitting();
-    }
-    if( d->rc != 0 ) {
-        CGLoaderFile_LOG(n->seq, klogErr, d->rc, NULL, NULL);
-        CGLoaderFile_LOG(n->align, klogErr, d->rc, NULL, NULL);
-    }
-    FGroupMAP_CloseFiles(n);
-    return d->rc != 0;
-}
-
-
-static const char * lib_dst = "extra/library";
-
-static rc_t copy_library( const KDirectory * src_dir, KDirectory * dst_dir,
-                          const char * in_path, const char * out_path )
-{
-    rc_t rc;
-    size_t l = string_size( out_path ) + string_size( lib_dst ) + 2;
-    char * dst = malloc( l );
-    if ( dst == NULL )
-        rc = RC( rcExe, rcFile, rcCopying, rcMemory, rcExhausted );
-    else
-    {
-        size_t written;
-        rc = string_printf( dst, l, &written, "%s/%s", out_path, lib_dst );
-        if ( rc == 0 )
-            rc = KDirectoryCopy( src_dir, dst_dir, true, in_path, dst );
-        free( dst );
-    }
-    return rc;
-}
-
-
-static rc_t open_dir_or_tar( const KDirectory *dir, const KDirectory **sub, const char * name )
-{
-    rc_t rc1, rc2;
-    rc1 = KDirectoryOpenDirRead( dir, sub, true, name );
-    if ( rc1 != 0 )
-    {
-        rc2 = KDirectoryOpenTarArchiveRead( dir, sub, true, name );
-        if ( rc2 == 0 )
-            rc1 = rc2;
-    }
-    return rc1;
-}
-
-static rc_t Load( SParam* param )
-{
-    rc_t rc = 0, rc1 = 0;
-    BSTree slides, evidence;
-    
-
-    param->map_dir = NULL;
-    param->asm_dir = NULL;
-    param->output_dir = ( KDirectory * )param->input_dir;
-    BSTreeInit( &slides );
-    BSTreeInit( &evidence );
-
-    rc = open_dir_or_tar( param->input_dir, &param->map_dir, param->map_path );
-    if ( rc == 0 )
-    {
-        DirVisit_Data dv;
-
-        dv.param = param;
-        dv.tree = &slides;
-        dv.dir = param->map_dir;
-        rc = KDirectoryVisit( param->map_dir, true, DirVisitor, &dv, NULL );
-        if ( rc == 0 )
-        {
-            if ( param->asm_path != NULL )
-            {
-                rc_t rc2 = open_dir_or_tar( param->input_dir, &param->asm_dir, param->asm_path );
-                if ( rc2 == 0 )
-                {
-                    dv.tree = &evidence;
-                    dv.dir = param->asm_dir;
-                    rc = KDirectoryVisit( param->asm_dir, true, DirVisitor, &dv, NULL );
-                }
-            }
-            if ( rc == 0 )
-            {
-                /* SHOULD HAVE A BSTreeEmpty FUNCTION OR SOMETHING...
-                   MAKE ONE HERE - WITH KNOWLEDGE THAT TREE IS NOT NULL: */
-#ifndef BSTreeEmpty
-#define BSTreeEmpty( bst ) \
-    ( ( bst ) -> root == NULL )
-#endif
-                if ( BSTreeEmpty ( & slides ) && BSTreeEmpty ( & evidence ) )
-                    rc = RC( rcExe, rcFile, rcReading, rcData, rcInsufficient );
-                else
-                {
-                    /* CORRECTED SETTING OF "rc" IN "FGroupMAP_Validate" */
-                    assert ( rc == 0 );
-                    BSTreeForEach( &slides, false, FGroupMAP_Validate, &rc );
-                    BSTreeForEach( &evidence, false, FGroupMAP_Validate, &rc );
-                }
-
-                if ( rc == 0 )
-                {
-                    FGroupMAP_LoadData data;
-
-                    PLOGMSG( klogInfo, ( klogInfo, "file set validation complete", "severity=status" ) );
-                    memset( &data, 0, sizeof( data ) );
-                    data.rc = 0;
-                    data.param = param;
-                    data.reads = &slides;
-                    rc = DB_Init( param, &data.db );
-                    if ( rc == 0 )
-                    {
-                        BSTreeDoUntil( &slides, false, FGroupMAP_LoadReads, &data );
-                        rc = data.rc;
-                        if ( rc == 0 )
-                        {
-                            PLOGMSG( klogInfo, ( klogInfo, "MAP loaded", "severity=status" ) );
-                            BSTreeDoUntil( &evidence, false, FGroupMAP_LoadEvidence, &data );
-                            rc = data.rc;
-                            if ( rc == 0 )
-                                PLOGMSG( klogInfo, ( klogInfo, "ASM loaded", "severity=status" ) );
-                        }
-                    }
-                    rc1 = DB_Fini( param, &data.db, rc != 0 );
-                    if ( rc == 0 )
-                        rc = rc1;
-                }
-            }
-        }
-
-        /* copy the extra library ( file or recursive directory ) */
-        if ( rc == 0 && param->library != NULL )
-        {
-            const KDirectory *lib_src;
-            rc = open_dir_or_tar( param->input_dir, &lib_src, param->library );
-            if ( rc == 0 )
-            {
-                rc = copy_library( param->input_dir, param->output_dir,
-                                   param->library, param->out );
-                if ( rc == 0 )
-                    STSMSG( 0, ( "extra lib copied" ) );
-                else
-                    LOGERR( klogErr, rc, "failed to copy extra library" );
-                KDirectoryRelease( lib_src );
-            }
-/*
-            else
-            {
-                rc = copy_library( param->input_dir, param->output_dir,
-                                   ".", param->out );
-                if ( rc == 0 )
-                    STSMSG( 0, ( "extra lib copied" ) );
-                else
-                    LOGERR( klogErr, rc, "failed to copy extra library" );
-            }
-*/
-        }
-        KDirectoryRelease( param->map_dir );
-        KDirectoryRelease( param->asm_dir );
-    }
-    BSTreeWhack( &slides, FGroupMAP_Whack, NULL );
-    BSTreeWhack( &evidence, FGroupMAP_Whack, NULL );
-    return rc;
-}
-
-
-ver_t CC KAppVersion( void )
-{
-    return CG_LOAD_VERS;
-}
-
-const char* map_usage[] = {"MAP input directory path containing files", NULL};
-const char* asm_usage[] = {"ASM input directory path containing files", NULL};
-const char* schema_usage[] = {"database schema file name", NULL};
-const char* output_usage[] = {"output database path", NULL};
-const char* force_usage[] = {"force output overwrite", NULL};
-const char* refseqcfg_usage[] = {"path to a file with reference-to-accession list", NULL};
-const char* refseqpath_usage[] = {"path to a directory with reference sequences in fasta", NULL};
-const char* refseqchunk_usage[] = {NULL, "hidden param to override REFERENCE table seq chunk size for testing", NULL};
-const char* reffile_usage[] = {"path to fasta file with references", NULL};
-const char* forceref_usage[] = {"force reference sequence write", NULL};
-const char* forceread_usage[] = {"force reads write", NULL};
-const char* qualquant_usage[] = {"quality scores quantization level, can be a number (0: none, 1: 2bit, 2: 1bit), or a string like '1:10,10:20,20:30,30:-' (which is equivalent to 1)", NULL};
-const char* nospotgroup_usage[] = {"do not write source file key to SPOT_GROUP column", NULL};
-const char* min_mapq_usage[] = {"filter secondary mappings by minimum weight (phred)", NULL};
-const char* no_secondary_usage[] = {"preserve only one mapping per half-DNB based on weight", NULL};
-const char* single_mate_usage[] = {"if secondary mates have duplicates preserve only one in each pair based on weight", NULL};
-const char* cluster_size_usage[] = {"defines cluster window on the reference, records only 1 placement from given cluster size; default is zero which means ignore", NULL};
-const char* no_read_ahead_usage[] = {"disable input files threaded caching", NULL};
-const char* library_usage[] = {"copy extra file/directory into output", NULL};
-
-/* this enum must have same order as MainArgs array below */
-enum OptDefIndex {
-    eopt_MapInput = 0,
-    eopt_AsmInput,
-    eopt_Schema,
-    eopt_RefSeqConfig,
-    eopt_RefSeqPath,
-    eopt_RefSeqChunk,
-    eopt_RefFile,
-    eopt_Output,
-    eopt_Force,
-    eopt_ForceRef,
-    eopt_ForceRead,
-    eopt_QualQuantization,
-    eopt_NoSpotGroup,
-    eopt_MinMapQ,
-    eopt_No2nd_ary,
-    eopt_SingleMate,
-    eopt_ClusterSize,
-    eopt_noReadAhead,
-    eopt_Library
-};
-
-OptDef MainArgs[] =
-{
-    /* if you change order in this array, rearrange enum above accordingly! */
-    { "map",              "m",  NULL, map_usage,            1, true,  true  },
-    { "asm",              "a",  NULL, asm_usage,            1, true,  false },
-    { "schema",           "s",  NULL, schema_usage,         1, true,  false },
-    { "refseq-config",    "k",  NULL, refseqcfg_usage,      1, true,  false },
-    { "refseq-path",      "i",  NULL, refseqpath_usage,     1, true,  false },
-    { "refseq-chunk",     "C",  NULL, refseqchunk_usage,    1, true,  false },
-    { "ref-file",         "r",  NULL, reffile_usage,        1, true,  false },
-    { "output",           "o",  NULL, output_usage,         1, true,  true  },
-    { "force",            "f",  NULL, force_usage,          1, false, false },
-    { "write-reference",  "g",  NULL, forceref_usage,       1, false, false },
-    { "write-read",       "w",  NULL, forceread_usage,      1, false, false },
-    { "qual-quant",       "Q",  NULL, qualquant_usage,      1, true,  false },
-    { "no-spotgroup",     "G",  NULL, nospotgroup_usage,    1, false, false },
-    { "min-mapq",         "q",  NULL, min_mapq_usage,       1, true,  false },
-    { "no-secondary",     "P",  NULL, no_secondary_usage,   1, false, false },
-    { "single-mate",      NULL, NULL, single_mate_usage,    1, false, false },
-    { "cluster-size",     NULL, NULL, cluster_size_usage,   1, true,  false },
-    { "input-no-threads", "t",  NULL, no_read_ahead_usage,  1, false, false },
-    { "library",          "l",  NULL, library_usage,        1, true,  false }
-};
-const size_t MainArgsQty = sizeof(MainArgs) / sizeof(MainArgs[0]);
-
-rc_t UsageSummary (char const * progname)
-{
-    OUTMSG((
-        "Usage:\n"
-        "\t%s [options] -m map-dir -o path-to-run\n"
-        "\n"
-        "Summary:\n"
-        "\tLoad a Complete Genomics formatted data files\n"
-        "\n"
-        "Example:\n"
-        "\t%s -m build36/MAP -o /tmp/SRZ123456\n"
-        "\n"
-        ,progname, progname));
-    return 0;
-}
-
-char const UsageDefaultName[] = "cg-load";
-
-rc_t CC Usage( const Args* args )
-{
-    rc_t rc;
-    int i;
-    const char* progname = UsageDefaultName;
-    const char* fullname = UsageDefaultName;
-
-    rc = ArgsProgram(args, &fullname, &progname);
-
-    UsageSummary(progname);
-
-    for(i = 0; i < MainArgsQty; i++ ) {
-        if( MainArgs[i].required && MainArgs[i].help[0] != NULL ) {
-            HelpOptionLine(MainArgs[i].aliases, MainArgs[i].name, NULL, MainArgs[i].help);
-        }
-    }
-    OUTMSG(("\nOptions:\n"));
-    for(i = 0; i < MainArgsQty; i++ ) {
-        if( !MainArgs[i].required && MainArgs[i].help[0] != NULL ) {
-            HelpOptionLine(MainArgs[i].aliases, MainArgs[i].name, NULL, MainArgs[i].help);
-        }
-    }
-    XMLLogger_Usage();
-    OUTMSG(("\n"));
-    HelpOptionsStandard();
-    HelpVersion(fullname, KAppVersion());
-    return rc;
-}
-
-rc_t CC KMain( int argc, char* argv[] )
-{
-    rc_t rc = 0;
-    Args* args = NULL;
-    const char* errmsg = NULL, *refseq_chunk = NULL, *min_mapq = NULL, *cluster_size = NULL;
-    const XMLLogger* xml_logger = NULL;
-    SParam params;
-    memset(&params, 0, sizeof(params));
-    params.schema = "align/align.vschema";
-
-    params.argv0 = argv[0];
-    
-    if( (rc = ArgsMakeAndHandle(&args, argc, argv, 2, MainArgs, MainArgsQty, XMLLogger_Args, XMLLogger_ArgsQty)) == 0 ) {
-        uint32_t count;
-        if( (rc = ArgsParamCount (args, &count)) != 0 || count != 0 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            ArgsParamValue(args, 0, &errmsg);
-        
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_Output].name, &count)) != 0 || count != 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-            errmsg = MainArgs[eopt_Output].name;
-        } else if( (rc = ArgsOptionValue(args, MainArgs[eopt_Output].name, 0, &params.out)) != 0 ) {
-            errmsg = MainArgs[eopt_Output].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_MapInput].name, &count)) != 0 || count != 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-            errmsg = MainArgs[eopt_MapInput].name;
-        } else if( (rc = ArgsOptionValue(args, MainArgs[eopt_MapInput].name, 0, &params.map_path)) != 0 ) {
-            errmsg = MainArgs[eopt_MapInput].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_Schema].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-            errmsg = MainArgs[eopt_Schema].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_Schema].name, 0, &params.schema)) != 0 ) {
-            errmsg = MainArgs[eopt_Schema].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_AsmInput].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_AsmInput].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_AsmInput].name, 0, &params.asm_path)) != 0 ) {
-            errmsg = MainArgs[eopt_AsmInput].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_RefSeqConfig].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_RefSeqConfig].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_RefSeqConfig].name, 0, &params.refseqcfg)) != 0 ) {
-            errmsg = MainArgs[eopt_RefSeqConfig].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_RefSeqPath].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_RefSeqPath].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_RefSeqPath].name, 0, &params.refseqpath)) != 0 ) {
-            errmsg = MainArgs[eopt_RefSeqPath].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_Library].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_Library].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_Library].name, 0, &params.library)) != 0 ) {
-            errmsg = MainArgs[eopt_Library].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_RefSeqChunk].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_RefSeqChunk].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_RefSeqChunk].name, 0, &refseq_chunk)) != 0 ) {
-            errmsg = MainArgs[eopt_RefSeqChunk].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_Force].name, &params.force)) != 0 ) {
-            errmsg = MainArgs[eopt_Force].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_ForceRef].name, &params.force_refw)) != 0 ) {
-            errmsg = MainArgs[eopt_ForceRef].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_ForceRead].name, &params.force_readw)) != 0 ) {
-            errmsg = MainArgs[eopt_ForceRead].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_noReadAhead].name, &params.no_read_ahead)) != 0 ) {
-            errmsg = MainArgs[eopt_noReadAhead].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_NoSpotGroup].name, &params.no_spot_group)) != 0 ) {
-            errmsg = MainArgs[eopt_NoSpotGroup].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_No2nd_ary].name, &params.min_mapq)) != 0 ) {
-            errmsg = MainArgs[eopt_No2nd_ary].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_QualQuantization].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_QualQuantization].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_QualQuantization].name, 0, &params.qual_quant)) != 0 ) {
-            errmsg = MainArgs[eopt_QualQuantization].name;
-
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_MinMapQ].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_MinMapQ].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_MinMapQ].name, 0, &min_mapq)) != 0 ) {
-            errmsg = MainArgs[eopt_MinMapQ].name;
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_ClusterSize].name, &count)) != 0 || count > 1 ) {
-            rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-            errmsg = MainArgs[eopt_ClusterSize].name;
-        } else if( count > 0 && (rc = ArgsOptionValue(args, MainArgs[eopt_ClusterSize].name, 0, &cluster_size)) != 0 ) {
-            errmsg = MainArgs[eopt_ClusterSize].name;
-        } else if( (rc = ArgsOptionCount(args, MainArgs[eopt_SingleMate].name, &params.single_mate)) != 0 ) {
-            errmsg = MainArgs[eopt_SingleMate].name;
-
-        } else {
-            do {
-                long val = 0;
-                char* end = NULL;
-                uint32_t count;
-
-                if( (rc = ArgsOptionCount(args, MainArgs[eopt_RefFile].name, &count)) != 0 ) {
-                    break;
-                } else {
-                    params.refFiles = calloc(count + 1, sizeof(*(params.refFiles)));
-                    if( params.refFiles == NULL ) {
-                        rc = RC(rcApp, rcArgv, rcReading, rcMemory, rcExhausted);
-                        break;
-                    }
-                    while(rc == 0 && count-- > 0) {
-                        rc = ArgsOptionValue(args, MainArgs[eopt_RefFile].name, count, &params.refFiles[count]);
-                    }
-                }
-
-                if( refseq_chunk != NULL ) {
-                    errno = 0;
-                    val = strtol(refseq_chunk, &end, 10);
-                    if( errno != 0 || refseq_chunk == end || *end != '\0' || val < 0 || val > UINT32_MAX ) {
-                        rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                        break;
-                    }
-                    params.refseq_chunk = val;
-                }
-                if( params.min_mapq > 0 ) {
-                    params.min_mapq = ~0;
-                } else if( min_mapq != NULL ) {
-                    errno = 0;
-                    val = strtol(min_mapq, &end, 10);
-                    if( errno != 0 || min_mapq == end || *end != '\0' || val < 0 || val > 255 ) {
-                        rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                        break;
-                    }
-                    params.min_mapq = val;
-                }
-
-                if ( cluster_size )
-                    params.cluster_size = atoi( cluster_size );
-                else
-                    params.cluster_size = 0;
-
-                rc = KDirectoryNativeDir( &params.input_dir );
-                if ( rc != 0 )
-                    errmsg = "current directory";
-                else
-                {
-                    rc = XMLLogger_Make( &xml_logger, params.input_dir, args );
-                    if ( rc != 0 )
-                        errmsg = "XML logging";
-                    else
-                        rc = Load( &params );
-                }
-            } while( false );
-            KDirectoryRelease( params.input_dir );
-        }
-    }
-    /* find accession as last part of path for internal XML logging */
-    refseq_chunk = params.out ? strrchr(params.out, '/') : "/???";
-    if( refseq_chunk ++ == NULL )
-        refseq_chunk = params.out;
-
-    if( argc < 2 )
-        MiniUsage(args);
-    else if( rc != 0 )
-    {
-        if( errmsg )
-        {
-            MiniUsage(args);
-            LOGERR(klogErr, rc, errmsg);
-        }
-        else
-        {
-            PLOGERR(klogErr, (klogErr, rc, "load failed: $(reason_short)",
-                    "severity=total,status=failure,accession=%s", refseq_chunk));
-        }
-    }
-    else
-    {
-        PLOGMSG(klogInfo, (klogInfo, "loaded",
-                "severity=total,status=success,accession=%s", refseq_chunk));
-    }
-    ArgsWhack(args);
-    XMLLogger_Release(xml_logger);
-    return rc;
-}
diff --git a/tools/cg-load/cg-load.vers b/tools/cg-load/cg-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/cg-load/cg-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/cg-load/debug.h b/tools/cg-load/debug.h
deleted file mode 100644
index 2d732c4..0000000
--- a/tools/cg-load/debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_debug_h_
-#define _tools_cg_load_debug_h_
-
-#include <klib/debug.h>
-
-#define DEBUG_MSG_PASTE(a,b) a##b
-#define DEBUG_MSG(flag,msg) DBGMSG(DBG_APP,DBG_FLAG(DEBUG_MSG_PASTE(DBG_APP_,flag)), msg)
-
-#endif /* _tools_cg_load_debug_h_ */
diff --git a/tools/cg-load/defs.h b/tools/cg-load/defs.h
deleted file mode 100644
index 9e06969..0000000
--- a/tools/cg-load/defs.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_defs_h_
-#define _tools_cg_load_defs_h_
-
-/* buffers and sizes */
-
-/*
-#define CG_CHROMOSOME_NAME (8) make if fit NC_003977 */
-#define CG_CHROMOSOME_NAME (10)
-
-#define CG_SLIDE (32)
-#define CG_LANE (8)
-
-#define CG_READS_NREADS (2)
-#define CG_READS_SPOT_LEN (70)
-#define CG_READS_NGAPS (3)
-#define CG_MAPPINGS_MAX (2048)
-#define CG_EVDNC_PLOIDY (3)
-#define CG_EVDNC_INTERVALID_LEN (32)
-#define CG_EVDNC_SPOT_LEN (10 * 1024)
-
-/* CG_EVDNC_ALLELE_NUM is 3 in v.1.5; 4 in v.2 */
-#define CG_EVDNC_ALLELE_NUM (4)
-
-#define CG_EVDNC_ALLELE_LEN (10 * 1024)
-#define CG_EVDNC_ALLELE_CIGAR_LEN (10 * 1024)
-
-typedef char CGFIELD_LIBRARY_TYPE;
-typedef char CGFIELD_SAMPLE_TYPE;
-typedef char CGFIELD_SLIDE_TYPE;
-typedef char CGFIELD_LANE_TYPE;
-typedef char CGFIELD_CHROMOSOME_TYPE;
-typedef char CGFIELD_ASSEMBLY_ID_TYPE;
-typedef char CGFIELD_SOFTWARE_VERSION_TYPE;
-typedef char CGFIELD_DBSNP_BUILD_TYPE;
-typedef char CGFIELD_COSMIC_TYPE;
-typedef char CGFIELD_PFAM_DATE_TYPE;
-typedef char CGFIELD_MIRBASE_VERSION_TYPE;
-typedef char CGFIELD_DGV_VERSION_TYPE;
-typedef char CGFIELD_GENERATED_AT_TYPE;
-typedef char CGFIELD_GENERATED_BY_TYPE;
-typedef char CGFIELD_GENE_ANNOTATIONS_TYPE;
-typedef char CGFIELD_GENOME_REFERENCE_TYPE;
-typedef uint32_t CGFIELD_BATCH_FILE_NUMBER_TYPE;
-typedef uint64_t CGFIELD_BATCH_OFFSET_TYPE;
-typedef uint32_t CGFIELD_FIELD_SIZE_TYPE;
-typedef uint32_t CGFIELD_MAX_PLOIDY_TYPE;
-typedef uint16_t CGFIELD_WINDOW_SHIFT_TYPE;
-typedef uint16_t CGFIELD_WINDOW_WIDTH_TYPE;
-typedef uint16_t CGFIELD_NUMBER_LEVELS_TYPE;
-typedef uint16_t CGFIELD_MEAN_LEVEL_X_TYPE;
-
-typedef enum CG_EFileType_enum {
-    cg_eFileType_Unknown = 0,
-    cg_eFileType_READS = 1,
-    cg_eFileType_MAPPINGS,
-    cg_eFileType_LIB_DNB,
-    cg_eFileType_LIB_MATE_GAPS,
-    cg_eFileType_LIB_SEQDEP_GAPS,
-    cg_eFileType_REFMETRICS,
-    cg_eFileType_IDENTIFIER_MAPPING,
-    cg_eFileType_DBSNP_TO_CGI,
-    cg_eFileType_GENE_ANNOTATION,
-    cg_eFileType_SUMMARY_REPORT,
-    cg_eFileType_VAR_ANNOTATION,
-    cg_eFileType_GENE_VAR_SUMMARY_REPORT,
-    cg_eFileType_EVIDENCE_CORRELATION,
-    cg_eFileType_EVIDENCE_DNBS,
-    cg_eFileType_EVIDENCE_INTERVALS,
-    cg_eFileType_COVERAGE_DISTRIBUTION,
-    cg_eFileType_COVERAGE_BY_GC,
-    cg_eFileType_DEPTH_OF_COVERAGE,
-    cg_eFileType_INDEL_LENGTH_CODING,
-    cg_eFileType_INDEL_LENGTH,
-    cg_eFileType_SUBSTITUTION_LENGTH_CODING,
-    cg_eFileType_SUBSTITUTION_LENGTH,
-    cg_eFileType_CNV_SEGMENTS,
-    cg_eFileType_TUMOR_CNV_SEGMENTS,
-    cg_eFileType_CNV_DETAILS_SCORES,
-    cg_eFileType_TUMOR_DETAILS_SCORES,
-    cg_eFileType_NONDIPLOID_SOMATIC_CNV_SEGMENTS,
-    cg_eFileType_NONDIPLOID_SOMATIC_CNV_DETAILS,
-    cg_eFileType_JUNCTIONS,
-    cg_eFileType_JUNCTION_DNBS,
-    cg_eFileType_SV_EVENTS,
-    cg_eFileType_VAR_OLPL,
-    cg_eFileType_MEI,
-    cg_eFileType_TUMOR_CNV_DETAILS,
-    cg_eFileType_DIPLOID_SOMATIC_CNV_SEGMENTS,
-    cg_eFileType_COVERAGE_DISTRIBUTION_CODING,
-    cg_eFileType_COVERAGE_BY_GC_CODING,
-    cg_eFileType_LIB_SMALL_GAPS_ROLLUP,
-    cg_eFileType_DIPLOID_SOMATIC_CNV_DETAILSCORES,
-    cg_eFileType_Last
-} CG_EFileType;
-
-typedef enum CG_EReadsFlags_enum {
-    cg_eLeftHalfDnbNoMatches = 0x01,
-    cg_eLeftHalfDnbMapOverflow = 0x02,
-    cg_eRightHalfDnbNoMatches = 0x04,
-    cg_eRightHalfDnbMapOverflow = 0x08
-} CG_EReadsFlags;
-
-typedef enum CG_EMappingsFlags_enum {
-    cg_eLastDNBRecord = 0x01,
-    cg_eLeftHalfDnbMap = 0x00,
-    cg_eRightHalfDnbMap = 0x02,
-    cg_eFwdDnbStrand = 0x00,
-    cg_eRevDnbStrand = 0x04
-} CG_EMappingsFlags;
-
-#endif /* _tools_cg_load_defs_h_ */
diff --git a/tools/cg-load/f1_3.c b/tools/cg-load/f1_3.c
deleted file mode 100644
index 315f4e0..0000000
--- a/tools/cg-load/f1_3.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include "factory-reads.h"
-#include "factory-mappings.h"
-#include "factory-evidence-intervals.h"
-#include "factory-evidence-dnbs.h"
-
-#include "file.h"
-
-static const CGFileTypeFactory cg_ETypeXX_names[] = {
-    { "READS", cg_eFileType_READS, CGReads13_Make },
-    { "MAPPINGS", cg_eFileType_MAPPINGS, CGMappings13_Make },
-    { "LIB-DNB", cg_eFileType_LIB_DNB, NULL },
-    { "LIB-MATE-GAPS", cg_eFileType_LIB_MATE_GAPS, NULL },
-    { "LIB-SEQDEP-GAPS", cg_eFileType_LIB_SEQDEP_GAPS, NULL },
-    { "REFMETRICS", cg_eFileType_REFMETRICS, NULL },
-    { "DBSNP-TO-CGI", cg_eFileType_DBSNP_TO_CGI, NULL },
-    { "GENE-ANNOTATION", cg_eFileType_GENE_ANNOTATION, NULL },
-    { "SUMMARY-REPORT", cg_eFileType_SUMMARY_REPORT, NULL },
-    { "VAR-ANNOTATION", cg_eFileType_VAR_ANNOTATION, NULL },
-    { "GENE-VAR-SUMMARY-REPORT", cg_eFileType_GENE_VAR_SUMMARY_REPORT, NULL },
-    { "EVIDENCE-CORRELATION", cg_eFileType_EVIDENCE_CORRELATION, NULL },
-    { "EVIDENCE-DNBS", cg_eFileType_EVIDENCE_DNBS, CGEvidenceDnbs13_Make },
-    { "EVIDENCE-INTERVALS",
-                cg_eFileType_EVIDENCE_INTERVALS, CGEvidenceIntervals13_Make },
-    { "COVERAGE-DISTRIBUTION", cg_eFileType_COVERAGE_DISTRIBUTION, NULL },
-    { "COVERAGE-BY-GC", cg_eFileType_COVERAGE_BY_GC, NULL },
-    { "DEPTH-OF-COVERAGE", cg_eFileType_DEPTH_OF_COVERAGE, NULL },
-    { "INDEL-LENGTH-CODING", cg_eFileType_INDEL_LENGTH_CODING, NULL },
-    { "INDEL-LENGTH", cg_eFileType_INDEL_LENGTH, NULL },
-    { "SUBSTITUTION-LENGTH-CODING",
-                cg_eFileType_SUBSTITUTION_LENGTH_CODING, NULL },
-    { "SUBSTITUTION-LENGTH", cg_eFileType_SUBSTITUTION_LENGTH, NULL },
-    { "CNV_SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "CNV-SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "TUMOR_CNV_SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "CNV_DETAILS_SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAIL-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "TUMOR_DETAILS_SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "JUNCTIONS", cg_eFileType_JUNCTIONS, NULL },
-    { "JUNCTION-DNBS", cg_eFileType_JUNCTION_DNBS, NULL },
-    /* undocumented */
-    { "VAR-OLPL", cg_eFileType_VAR_OLPL, NULL }
-    
-};
-
-rc_t CGFile13_Make(const CGFileType** self,
-    const char* type, const CGLoaderFile* file)
-{
-    return CGLoaderFileMakeCGFileType(file, type,
-        cg_ETypeXX_names, sizeof cg_ETypeXX_names / sizeof cg_ETypeXX_names[0],
-        self);
-}
diff --git a/tools/cg-load/f1_5.c b/tools/cg-load/f1_5.c
deleted file mode 100644
index dcb152c..0000000
--- a/tools/cg-load/f1_5.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include "factory-reads.h"
-#include "factory-mappings.h"
-#include "factory-evidence-intervals.h"
-#include "factory-evidence-dnbs.h"
-
-#include "file.h"
-
-static const CGFileTypeFactory cg_ETypeXX_names[] = {
-    { "READS", cg_eFileType_READS, CGReads15_Make },
-    { "MAPPINGS", cg_eFileType_MAPPINGS, CGMappings15_Make },
-    { "LIB-DNB", cg_eFileType_LIB_DNB, NULL },
-    { "LIB-MATE-GAPS", cg_eFileType_LIB_MATE_GAPS, NULL },
-    { "LIB-SEQDEP-GAPS", cg_eFileType_LIB_SEQDEP_GAPS, NULL },
-    { "REFMETRICS", cg_eFileType_REFMETRICS, NULL },
-    { "DBSNP-TO-CGI", cg_eFileType_DBSNP_TO_CGI, NULL },
-    { "GENE-ANNOTATION", cg_eFileType_GENE_ANNOTATION, NULL },
-    { "SUMMARY-REPORT", cg_eFileType_SUMMARY_REPORT, NULL },
-    { "VAR-ANNOTATION", cg_eFileType_VAR_ANNOTATION, NULL },
-    { "GENE-VAR-SUMMARY-REPORT", cg_eFileType_GENE_VAR_SUMMARY_REPORT, NULL },
-    { "EVIDENCE-CORRELATION", cg_eFileType_EVIDENCE_CORRELATION, NULL },
-    { "EVIDENCE-DNBS", cg_eFileType_EVIDENCE_DNBS, CGEvidenceDnbs15_Make },
-    { "EVIDENCE-INTERVALS",
-                cg_eFileType_EVIDENCE_INTERVALS, CGEvidenceIntervals15_Make },
-    { "COVERAGE-DISTRIBUTION", cg_eFileType_COVERAGE_DISTRIBUTION, NULL },
-    { "COVERAGE-BY-GC", cg_eFileType_COVERAGE_BY_GC, NULL },
-    { "DEPTH-OF-COVERAGE", cg_eFileType_DEPTH_OF_COVERAGE, NULL },
-    { "INDEL-LENGTH-CODING", cg_eFileType_INDEL_LENGTH_CODING, NULL },
-    { "INDEL-LENGTH", cg_eFileType_INDEL_LENGTH, NULL },
-    { "SUBSTITUTION-LENGTH-CODING",
-                cg_eFileType_SUBSTITUTION_LENGTH_CODING, NULL },
-    { "SUBSTITUTION-LENGTH", cg_eFileType_SUBSTITUTION_LENGTH, NULL },
-    { "CNV_SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "CNV-SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "TUMOR_CNV_SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "CNV_DETAILS_SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAIL-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "TUMOR_DETAILS_SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "JUNCTIONS", cg_eFileType_JUNCTIONS, NULL },
-    { "JUNCTION-DNBS", cg_eFileType_JUNCTION_DNBS, NULL },
-    /* undocumented */
-    { "VAR-OLPL", cg_eFileType_VAR_OLPL, NULL }
-    
-};
-
-rc_t CGFile15_Make(const CGFileType** self,
-    const char* type, const CGLoaderFile* file)
-{
-    return CGLoaderFileMakeCGFileType(file, type,
-        cg_ETypeXX_names, sizeof cg_ETypeXX_names / sizeof cg_ETypeXX_names[0],
-        self);
-}
diff --git a/tools/cg-load/f2_0.c b/tools/cg-load/f2_0.c
deleted file mode 100644
index ba28f44..0000000
--- a/tools/cg-load/f2_0.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include "factory-reads.h"
-#include "factory-mappings.h"
-#include "factory-evidence-intervals.h"
-#include "factory-evidence-dnbs.h"
-
-#include "file.h"
-
-static const CGFileTypeFactory cg_ETypeXX_names[] = {
-    { "READS", cg_eFileType_READS, CGReads20_Make },
-    { "MAPPINGS", cg_eFileType_MAPPINGS, CGMappings20_Make },
-    { "LIB-DNB", cg_eFileType_LIB_DNB, NULL },
-    { "LIB-MATE-GAPS", cg_eFileType_LIB_MATE_GAPS, NULL },
-    { "LIB-SEQDEP-GAPS", cg_eFileType_LIB_SEQDEP_GAPS, NULL },
-    { "REFMETRICS", cg_eFileType_REFMETRICS, NULL },
-    { "DBSNP-TO-CGI", cg_eFileType_DBSNP_TO_CGI, NULL },
-    { "GENE-ANNOTATION", cg_eFileType_GENE_ANNOTATION, NULL },
-    { "SUMMARY-REPORT", cg_eFileType_SUMMARY_REPORT, NULL },
-    { "VAR-ANNOTATION", cg_eFileType_VAR_ANNOTATION, NULL },
-    { "GENE-VAR-SUMMARY-REPORT", cg_eFileType_GENE_VAR_SUMMARY_REPORT, NULL },
-    { "EVIDENCE-CORRELATION", cg_eFileType_EVIDENCE_CORRELATION, NULL },
-    { "EVIDENCE-DNBS", cg_eFileType_EVIDENCE_DNBS, CGEvidenceDnbs20_Make },
-    { "EVIDENCE-INTERVALS",
-                cg_eFileType_EVIDENCE_INTERVALS, CGEvidenceIntervals20_Make },
-    { "COVERAGE-DISTRIBUTION", cg_eFileType_COVERAGE_DISTRIBUTION, NULL },
-    { "COVERAGE-BY-GC", cg_eFileType_COVERAGE_BY_GC, NULL },
-    { "DEPTH-OF-COVERAGE", cg_eFileType_DEPTH_OF_COVERAGE, NULL },
-    { "INDEL-LENGTH-CODING", cg_eFileType_INDEL_LENGTH_CODING, NULL },
-    { "INDEL-LENGTH", cg_eFileType_INDEL_LENGTH, NULL },
-    { "SUBSTITUTION-LENGTH-CODING",
-                cg_eFileType_SUBSTITUTION_LENGTH_CODING, NULL },
-    { "SUBSTITUTION-LENGTH", cg_eFileType_SUBSTITUTION_LENGTH, NULL },
-    { "CNV_SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "CNV-SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "TUMOR_CNV_SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "TUMOR-CNV-SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "CNV_DETAILS_SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAILS-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAIL-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "TUMOR_DETAILS_SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "TUMOR-DETAILS-SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "JUNCTIONS", cg_eFileType_JUNCTIONS, NULL },
-    { "JUNCTION-DNBS", cg_eFileType_JUNCTION_DNBS, NULL },
-    { "SV-EVENTS", cg_eFileType_SV_EVENTS, NULL },
-    { "VAR-OLPL", cg_eFileType_VAR_OLPL, NULL },
-    { "MEI", cg_eFileType_MEI, NULL },    
-};
-
-rc_t CGFile20_Make(const CGFileType** self,
-    const char* type, const CGLoaderFile* file)
-{
-    return CGLoaderFileMakeCGFileType(file, type,
-        cg_ETypeXX_names, sizeof cg_ETypeXX_names / sizeof cg_ETypeXX_names[0],
-        self);
-}
diff --git a/tools/cg-load/f2_2.c b/tools/cg-load/f2_2.c
deleted file mode 100644
index 1d4986d..0000000
--- a/tools/cg-load/f2_2.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include "factory-reads.h"
-#include "factory-mappings.h"
-#include "factory-evidence-intervals.h"
-#include "factory-evidence-dnbs.h"
-
-#include "file.h"
-
-static const CGFileTypeFactory cg_ETypeXX_names[] = {
-    { "READS", cg_eFileType_READS, CGReads22_Make },
-    { "MAPPINGS", cg_eFileType_MAPPINGS, CGMappings22_Make },
-    { "LIB-DNB", cg_eFileType_LIB_DNB, NULL },
-    { "LIB-MATE-GAPS", cg_eFileType_LIB_MATE_GAPS, NULL },
-    { "LIB-SEQDEP-GAPS", cg_eFileType_LIB_SEQDEP_GAPS, NULL },
-    { "REFMETRICS", cg_eFileType_REFMETRICS, NULL },
-    { "IDENTIFIER-MAPPING", cg_eFileType_IDENTIFIER_MAPPING, NULL },
-    { "DBSNP-TO-CGI", cg_eFileType_DBSNP_TO_CGI, NULL },
-    { "GENE-ANNOTATION", cg_eFileType_GENE_ANNOTATION, NULL },
-    { "SUMMARY-REPORT", cg_eFileType_SUMMARY_REPORT, NULL },
-    { "VAR-ANNOTATION", cg_eFileType_VAR_ANNOTATION, NULL },
-    { "GENE-VAR-SUMMARY-REPORT", cg_eFileType_GENE_VAR_SUMMARY_REPORT, NULL },
-    { "EVIDENCE-CORRELATION", cg_eFileType_EVIDENCE_CORRELATION, NULL },
-    { "EVIDENCE-DNBS", cg_eFileType_EVIDENCE_DNBS, CGEvidenceDnbs22_Make },
-    { "EVIDENCE-INTERVALS",
-                cg_eFileType_EVIDENCE_INTERVALS, CGEvidenceIntervals22_Make },
-    { "COVERAGE-DISTRIBUTION", cg_eFileType_COVERAGE_DISTRIBUTION, NULL },
-    { "COVERAGE-BY-GC", cg_eFileType_COVERAGE_BY_GC, NULL },
-    { "DEPTH-OF-COVERAGE", cg_eFileType_DEPTH_OF_COVERAGE, NULL },
-    { "INDEL-LENGTH-CODING", cg_eFileType_INDEL_LENGTH_CODING, NULL },
-    { "INDEL-LENGTH", cg_eFileType_INDEL_LENGTH, NULL },
-    { "SUBSTITUTION-LENGTH-CODING",
-                cg_eFileType_SUBSTITUTION_LENGTH_CODING, NULL },
-    { "SUBSTITUTION-LENGTH", cg_eFileType_SUBSTITUTION_LENGTH, NULL },
-    { "CNV_SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "CNV-SEGMENTS", cg_eFileType_CNV_SEGMENTS, NULL },
-    { "TUMOR_CNV_SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "TUMOR-CNV-SEGMENTS", cg_eFileType_TUMOR_CNV_SEGMENTS, NULL },
-    { "CNV_DETAILS_SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAILS-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "CNV-DETAIL-SCORES", cg_eFileType_CNV_DETAILS_SCORES, NULL },
-    { "TUMOR_DETAILS_SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "TUMOR-DETAILS-SCORES", cg_eFileType_TUMOR_DETAILS_SCORES, NULL },
-    { "NONDIPLOID-SOMATIC-CNV-SEGMENTS",
-                cg_eFileType_NONDIPLOID_SOMATIC_CNV_SEGMENTS, NULL },
-    { "NONDIPLOID-SOMATIC-CNV-DETAILS",
-                cg_eFileType_NONDIPLOID_SOMATIC_CNV_DETAILS, NULL },
-    { "JUNCTIONS", cg_eFileType_JUNCTIONS, NULL },
-    { "JUNCTION-DNBS", cg_eFileType_JUNCTION_DNBS, NULL },
-    { "SV-EVENTS", cg_eFileType_SV_EVENTS, NULL },
-    { "VAR-OLPL", cg_eFileType_VAR_OLPL, NULL },
-    { "MEI", cg_eFileType_MEI, NULL },
-    /* from Standard Sequencing Service Data File Formats file test */
-    { "TUMOR-CNV-DETAILS", cg_eFileType_TUMOR_CNV_DETAILS, NULL },
-    { "DIPLOID-SOMATIC-CNV-SEGMENTS",
-                cg_eFileType_DIPLOID_SOMATIC_CNV_SEGMENTS, NULL },
-    { "COVERAGE-DISTRIBUTION-CODING",
-                cg_eFileType_COVERAGE_DISTRIBUTION_CODING, NULL },
-    { "COVERAGE-BY-GC-CODING", cg_eFileType_COVERAGE_BY_GC_CODING, NULL },
-    { "LIB-SMALL-GAPS-ROLLUP", cg_eFileType_LIB_SMALL_GAPS_ROLLUP, NULL },
-    /* from Cancer Sequencing Service Data File Formats file test */
-    { "DIPLOID-SOMATIC-CNV-DETAILSCORES",
-                cg_eFileType_DIPLOID_SOMATIC_CNV_DETAILSCORES, NULL },
-};
-
-rc_t CGFile22_Make(const CGFileType** self,
-    const char* type, const CGLoaderFile* file)
-{
-    return CGLoaderFileMakeCGFileType(file, type,
-        cg_ETypeXX_names, sizeof cg_ETypeXX_names / sizeof cg_ETypeXX_names[0],
-        self);
-}
diff --git a/tools/cg-load/factory-cmn.h b/tools/cg-load/factory-cmn.h
deleted file mode 100644
index a2eaaaa..0000000
--- a/tools/cg-load/factory-cmn.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_cmh_h_
-#define _tools_cg_load_factory_cmh_h_
-
-#include <klib/defs.h>
-#include "defs.h"
-
-typedef CGFIELD_LIBRARY_TYPE CGFIELD15_LIBRARY[32];
-typedef CGFIELD_SAMPLE_TYPE CGFIELD15_SAMPLE[32];
-typedef CGFIELD_SLIDE_TYPE CGFIELD15_SLIDE[CG_SLIDE];
-typedef CGFIELD_LANE_TYPE CGFIELD15_LANE[CG_LANE];
-typedef CGFIELD_CHROMOSOME_TYPE CGFIELD15_CHROMOSOME[CG_CHROMOSOME_NAME];
-typedef CGFIELD_ASSEMBLY_ID_TYPE CGFIELD15_ASSEMBLY_ID[32];
-
-/* VDB-951: make it process invalid #SOFTWARE_VERSION value
-typedef CGFIELD_SOFTWARE_VERSION_TYPE CGFIELD15_SOFTWARE_VERSION[16];*/
-typedef CGFIELD_SOFTWARE_VERSION_TYPE CGFIELD15_SOFTWARE_VERSION[38];
-
-typedef CGFIELD_DBSNP_BUILD_TYPE CGFIELD15_DBSNP_BUILD[8];
-typedef CGFIELD_COSMIC_TYPE CGFIELD15_COSMIC[8];
-typedef CGFIELD_PFAM_DATE_TYPE CGFIELD15_PFAM_DATE[16];
-typedef CGFIELD_MIRBASE_VERSION_TYPE CGFIELD15_MIRBASE_VERSION[8];
-typedef CGFIELD_DGV_VERSION_TYPE CGFIELD15_DGV_VERSION[16];
-typedef CGFIELD_GENERATED_AT_TYPE CGFIELD15_GENERATED_AT[32];
-typedef CGFIELD_GENERATED_BY_TYPE CGFIELD15_GENERATED_BY[32];
-typedef CGFIELD_GENE_ANNOTATIONS_TYPE CGFIELD15_GENE_ANNOTATIONS[16];
-typedef CGFIELD_GENOME_REFERENCE_TYPE CGFIELD15_GENOME_REFERENCE[16];
-typedef CGFIELD_BATCH_FILE_NUMBER_TYPE CGFIELD15_BATCH_FILE_NUMBER;
-typedef CGFIELD_BATCH_OFFSET_TYPE CGFIELD15_BATCH_OFFSET;
-typedef CGFIELD_FIELD_SIZE_TYPE CGFIELD15_FIELD_SIZE;
-typedef CGFIELD_MAX_PLOIDY_TYPE CGFIELD15_MAX_PLOIDY;
-typedef CGFIELD_WINDOW_SHIFT_TYPE CGFIELD15_WINDOW_SHIFT;
-typedef CGFIELD_WINDOW_WIDTH_TYPE CGFIELD15_WINDOW_WIDTH;
-typedef CGFIELD_NUMBER_LEVELS_TYPE CGFIELD15_NUMBER_LEVELS;
-typedef CGFIELD_MEAN_LEVEL_X_TYPE CGFIELD15_MEAN_LEVEL_X;
-
-#endif /* _tools_cg_load_factory_cmh_h_ */
diff --git a/tools/cg-load/factory-evidence-dnbs.c b/tools/cg-load/factory-evidence-dnbs.c
deleted file mode 100644
index a4af12b..0000000
--- a/tools/cg-load/factory-evidence-dnbs.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-typedef struct CGEvidenceDnbs15 CGEvidenceDnbs15;
-#define CGFILETYPE_IMPL CGEvidenceDnbs15
-#include "file.h"
-#include "factory-cmn.h"
-#include "factory-evidence-dnbs.h"
-#include "debug.h"
-
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
-
-struct CGEvidenceDnbs15 {
-    CGFileType dad;
-    const CGLoaderFile* file;
-    uint64_t records;
-    /* headers */
-    CGFIELD15_ASSEMBLY_ID assembly_id;
-    CGFIELD15_CHROMOSOME chromosome;
-    CGFIELD15_GENERATED_AT generated_at;
-    CGFIELD15_GENERATED_BY generated_by;
-    CGFIELD15_SAMPLE sample;
-    CGFIELD15_SOFTWARE_VERSION software_version;
-};
-
-void CGEvidenceDnbs15_Release(const CGEvidenceDnbs15* cself, uint64_t* records)
-{
-    if( cself != NULL ) {
-        CGEvidenceDnbs15* self = (CGEvidenceDnbs15*)cself;
-        if( records != NULL ) {
-            *records = cself->records;
-        }
-        free(self);
-    }
-}
-
-static
-rc_t CC CGEvidenceDnbs15_Header(const CGEvidenceDnbs15* cself, const char* buf, const size_t len)
-{
-    rc_t rc = 0;
-    size_t slen;
-    CGEvidenceDnbs15* self = (CGEvidenceDnbs15*)cself;
-
-    if( strncmp("ASSEMBLY_ID\t", buf, slen = 12) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->assembly_id, sizeof(self->assembly_id));
-    } else if( strncmp("CHROMOSOME\t", buf, slen = 11) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->chromosome, sizeof(self->chromosome));
-    } else if( strncmp("GENERATED_AT\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_at, sizeof(self->generated_at));
-    } else if( strncmp("GENERATED_BY\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_by, sizeof(self->generated_by));
-    } else if( strncmp("SAMPLE\t", buf, slen = 7) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->sample, sizeof(self->sample));
-    } else if( strncmp("SOFTWARE_VERSION\t", buf, slen = 17) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->software_version, sizeof(self->software_version));
-    } else {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcName, rcUnrecognized);
-    }
-    return rc;
-}
-
-static
-rc_t CGEvidenceDnbs15_GetAssemblyId(const CGEvidenceDnbs15* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id)
-{
-    if( cself->assembly_id[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *assembly_id = cself->assembly_id;
-    return 0;
-}
-
-static
-rc_t CGEvidenceDnbs15_GetSample(const CGEvidenceDnbs15* cself, const CGFIELD_SAMPLE_TYPE** sample)
-{
-    if( cself->sample[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *sample = cself->sample;
-    return 0;
-}
-
-static
-rc_t CGEvidenceDnbs15_GetChromosome(const CGEvidenceDnbs15* cself, const CGFIELD_CHROMOSOME_TYPE** chromosome)
-{
-    if( cself->chromosome[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *chromosome = cself->chromosome;
-    return 0;
-}
-
-static
-rc_t CC CGEvidenceDnbs_Read(const CGEvidenceDnbs15* cself, const char* interval_id, TEvidenceDnbsData* data, int score_allele_num)
-{
-    rc_t rc = 0;
-    TEvidenceDnbsData_dnb* m = NULL;
-    static TEvidenceDnbsData_dnb next_rec;
-    static char next_interval_id[32] = "";
-
-    /* local copy of unused TEvidenceDnbsData_dnb struct elements */
-    char reference_alignment[CG_EVDNC_ALLELE_CIGAR_LEN];
-    INSDC_coord_zero mate_offset_in_reference;
-    char mate_reference_alignment[CG_EVDNC_ALLELE_CIGAR_LEN];
-    uint16_t score_allele[4] = {0, 0, 0, 0}; /* v1.5 has ScoreAllele[012]; v2.0 - [0123] */
-    char qual[CG_EVDNC_SPOT_LEN];
-
-    strcpy(data->interval_id, interval_id);
-    data->qty = 0;
-    /* already read one rec for this interval_id */
-    if( next_interval_id[0] != '\0' ) {
-        if( strcmp(next_interval_id, interval_id) != 0 ) {
-            /* nothing todo since next interval id is different */
-            return rc;
-        }
-        m = &data->dnbs[data->qty++];
-        memcpy(m, &next_rec, sizeof(next_rec));
-        DEBUG_MSG(10, ("%3u evidenceDnbs: '%s'\t'%s'\t'%s'\t'%s'\t%u\t%lu\t%hu\t%c\t%c\t%i\t'%.*s'"
-                        "\t%i\tnot_used\t0\tnot_used\t%c\t0\t0\t0\t'%.*s'\t'--'\n",
-            data->qty, next_interval_id, m->chr, m->slide, m->lane, m->file_num_in_lane,
-            m->dnb_offset_in_lane_file, m->allele_index, m->side, m->strand, m->offset_in_allele,
-            m->allele_alignment_length, m->allele_alignment, m->offset_in_reference,
-            m->mapping_quality, m->read_len, m->read));
-    }
-    do {
-        int i = 0;
-        char tmp[2];
-        CG_LINE_START(cself->file, b, len, p);
-        if( b == NULL || len == 0 ) {
-            next_interval_id[0] = '\0';
-            break; /* EOF */
-        }
-        if( data->qty >= data->max_qty ) {
-            TEvidenceDnbsData_dnb* x;
-            data->max_qty += 100;
-            x = realloc(data->dnbs, sizeof(*(data->dnbs)) * data->max_qty);
-            if( x == NULL ) {
-                rc = RC(rcRuntime, rcFile, rcReading, rcMemory, rcExhausted);
-                break;
-            }
-            data->dnbs = x;
-        }
-        m = &data->dnbs[data->qty++];
-
-        /*DEBUG_MSG(10, ("%2hu evidenceDnbs: '%.*s'\n", data->qty, len, b));*/
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, next_interval_id, sizeof(next_interval_id));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->chr, sizeof(m->chr));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->slide, sizeof(m->slide));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->lane, sizeof(m->lane));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2u32(b, p - b, &m->file_num_in_lane);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2u64(b, p - b, &m->dnb_offset_in_lane_file);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2u16(b, p - b, &m->allele_index);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if( tmp[0] != 'L' && tmp[0] != 'R' ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        }
-        m->side = tmp[0];
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if( tmp[0] != '+' && tmp[0] != '-' ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        }
-        m->strand = tmp[0];
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i32(b, p - b, &m->offset_in_allele);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->allele_alignment, sizeof(m->allele_alignment));
-        m->allele_alignment_length = p - b;
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i32(b, p - b, &m->offset_in_reference);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, reference_alignment, sizeof(reference_alignment));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i32(b, p - b, &mate_offset_in_reference);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, mate_reference_alignment, sizeof(mate_reference_alignment));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if( tmp[0] < 33 || tmp[0] > 126 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        }
-        m->mapping_quality = tmp[0];
-        for (i = 0; i < score_allele_num; ++i) {
-            CG_LINE_NEXT_FIELD(b, len, p);
-            rc = str2u16(b, p - b, &score_allele[i]);
-	    if(rc){
-		score_allele[i] =0;
-		rc =0;
-	    }
-        }
-        CG_LINE_NEXT_FIELD(b, len, p);
-        m->read_len = p - b;
-        rc = str2buf(b, m->read_len, m->read, sizeof(m->read));
-        CG_LINE_LAST_FIELD(b, len, p);
-        if( m->read_len != p - b ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInconsistent);
-        } else {
-            rc = str2buf(b, p - b, qual, sizeof(qual));
-        }
-        ((CGEvidenceDnbs15*)cself)->records++;
-        if( strcmp(next_interval_id, data->interval_id) != 0 ) {
-            if (score_allele_num == 3) {
-              DEBUG_MSG(10, ("%3u evidenceDnbs: '%s'\t'%s'\t'%s'\t'%s'\t%u\t%lu\t%hu\t%c\t%c\t%i\t'%.*s'"
-                            "\t%i\t'%s'\t%i\t'%s'\t%c\t%hu\t%hu\t%hu\t'%.*s'\t'%s'\n",
-                data->qty, next_interval_id, m->chr, m->slide, m->lane, m->file_num_in_lane,
-                m->dnb_offset_in_lane_file, m->allele_index, m->side, m->strand, m->offset_in_allele,
-                m->allele_alignment_length, m->allele_alignment, m->offset_in_reference,
-                reference_alignment, mate_offset_in_reference, mate_reference_alignment,
-                m->mapping_quality, score_allele[0], score_allele[1], score_allele[2], m->read_len, m->read, qual));
-            }
-            else if (score_allele_num == 4) {
-              DEBUG_MSG(10, ("%3u evidenceDnbs: '%s'\t'%s'\t'%s'\t'%s'\t%u\t%lu\t%hu\t%c\t%c\t%i\t'%.*s'"
-                            "\t%i\t'%s'\t%i\t'%s'\t%c\t%hu\t%hu\t%hu\t%hu\t'%.*s'\t'%s'\n",
-                data->qty, next_interval_id, m->chr, m->slide, m->lane, m->file_num_in_lane,
-                m->dnb_offset_in_lane_file, m->allele_index, m->side, m->strand, m->offset_in_allele,
-                m->allele_alignment_length, m->allele_alignment, m->offset_in_reference,
-                reference_alignment, mate_offset_in_reference, mate_reference_alignment,
-                m->mapping_quality, score_allele[0], score_allele[1], score_allele[2], score_allele[3], m->read_len, m->read, qual));
-            }
-            else { assert(0); }
-        }
-        CG_LINE_END();
-        if( next_interval_id[0] == '\0' ) {
-            break;
-        }
-        if( strcmp(next_interval_id, data->interval_id) != 0 ) {
-            /* next record is from next interval, remeber it and stop */
-            memcpy(&next_rec, m, sizeof(next_rec));
-            data->qty--;
-            break;
-        }
-    } while( rc == 0 );
-    return rc;
-}
-
-static
-rc_t CC CGEvidenceDnbs15_Read(const CGEvidenceDnbs15* self, const char* interval_id, TEvidenceDnbsData* data)
-{   return CGEvidenceDnbs_Read(self, interval_id, data, 3); }
-
-static
-rc_t CC CGEvidenceDnbs20_Read(const CGEvidenceDnbs15* self, const char* interval_id, TEvidenceDnbsData* data)
-{   return CGEvidenceDnbs_Read(self, interval_id, data, 4); }
-
-static const CGFileType_vt CGEvidenceDnbs15_vt =
-{
-    CGEvidenceDnbs15_Header,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceDnbs15_Read,
-    CGEvidenceDnbs15_GetAssemblyId,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceDnbs15_GetSample,
-    CGEvidenceDnbs15_GetChromosome,
-    CGEvidenceDnbs15_Release
-};
-
-static const CGFileType_vt CGEvidenceDnbs20_vt =
-{
-    CGEvidenceDnbs15_Header,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceDnbs20_Read,
-    CGEvidenceDnbs15_GetAssemblyId,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceDnbs15_GetSample,
-    CGEvidenceDnbs15_GetChromosome,
-    CGEvidenceDnbs15_Release
-};
-
-static
-rc_t CC CGEvidenceDnbs_Make(const CGFileType** cself, const CGLoaderFile* file,
-                              const CGFileType_vt* vt)
-{
-    rc_t rc = 0;
-    CGEvidenceDnbs15* obj = NULL;
-
-    assert(vt);
-
-    if( cself == NULL || file == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        *cself = NULL;
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            obj->file = file;
-            obj->dad.type = cg_eFileType_EVIDENCE_DNBS;
-            obj->dad.vt = vt;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = &obj->dad;
-    } else {
-        CGEvidenceDnbs15_Release(obj, NULL);
-    }
-    return rc;
-}
-
-rc_t CC CGEvidenceDnbs15_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGEvidenceDnbs_Make(self, file, &CGEvidenceDnbs15_vt); }
-
-rc_t CC CGEvidenceDnbs13_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGEvidenceDnbs15_Make(self, file); }
-
-rc_t CC CGEvidenceDnbs20_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGEvidenceDnbs_Make(self, file, &CGEvidenceDnbs20_vt); }
-
-rc_t CC CGEvidenceDnbs22_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGEvidenceDnbs_Make(self, file, &CGEvidenceDnbs20_vt); }
diff --git a/tools/cg-load/factory-evidence-dnbs.h b/tools/cg-load/factory-evidence-dnbs.h
deleted file mode 100644
index 4ba4b4f..0000000
--- a/tools/cg-load/factory-evidence-dnbs.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_evidence_dnbs_h_
-#define _tools_cg_load_factory_evidence_dnbs_h_
-
-#include <klib/defs.h>
-
-struct CGFileType;
-struct CGLoaderFile;
-
-rc_t CC CGEvidenceDnbs13_Make(const struct CGFileType** self,
-                              const struct CGLoaderFile* file);
-rc_t CC CGEvidenceDnbs15_Make(const struct CGFileType** self,
-                              const struct CGLoaderFile* file);
-rc_t CC CGEvidenceDnbs20_Make(const struct CGFileType** self,
-                              const struct CGLoaderFile* file);
-rc_t CC CGEvidenceDnbs22_Make(const struct CGFileType** self,
-                              const struct CGLoaderFile* file);
-
-#endif /* _tools_cg_load_factory_evidence_dnbs_h_ */
diff --git a/tools/cg-load/factory-evidence-intervals.c b/tools/cg-load/factory-evidence-intervals.c
deleted file mode 100644
index 1705bdc..0000000
--- a/tools/cg-load/factory-evidence-intervals.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-typedef struct CGEvidenceIntervals15 CGEvidenceIntervals15;
-#define CGFILETYPE_IMPL CGEvidenceIntervals15
-#include "file.h"
-#include "factory-cmn.h"
-#include "factory-evidence-intervals.h"
-#include "debug.h"
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct CGEvidenceIntervals15 {
-    CGFileType dad;
-    const CGLoaderFile* file;
-    uint64_t records;
-    /* headers */
-    CGFIELD15_ASSEMBLY_ID assembly_id;
-    CGFIELD15_CHROMOSOME chromosome;
-    CGFIELD15_GENERATED_AT generated_at;
-    CGFIELD15_GENERATED_BY generated_by;
-    CGFIELD15_SAMPLE sample;
-    CGFIELD15_SOFTWARE_VERSION software_version;
-};
-
-static
-rc_t CC CGEvidenceIntervals15_Header(const CGEvidenceIntervals15* cself, const char* buf, const size_t len)
-{
-    rc_t rc = 0;
-    size_t slen;
-    CGEvidenceIntervals15* self = (CGEvidenceIntervals15*)cself;
-
-    if( strncmp("ASSEMBLY_ID\t", buf, slen = 12) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->assembly_id, sizeof(self->assembly_id));
-    } else if( strncmp("CHROMOSOME\t", buf, slen = 11) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->chromosome, sizeof(self->chromosome));
-    } else if( strncmp("GENERATED_AT\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_at, sizeof(self->generated_at));
-    } else if( strncmp("GENERATED_BY\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_by, sizeof(self->generated_by));
-    } else if( strncmp("SAMPLE\t", buf, slen = 7) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->sample, sizeof(self->sample));
-    } else if( strncmp("SOFTWARE_VERSION\t", buf, slen = 17) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->software_version, sizeof(self->software_version));
-    } else {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcName, rcUnrecognized);
-    }
-    return rc;
-}
-
-static
-rc_t CGEvidenceIntervals15_GetAssemblyId(const CGEvidenceIntervals15* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id)
-{
-    if( cself->assembly_id[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *assembly_id = cself->assembly_id;
-    return 0;
-}
-
-static
-rc_t CGEvidenceIntervals15_GetSample(const CGEvidenceIntervals15* cself, const CGFIELD_SAMPLE_TYPE** sample)
-{
-    if( cself->sample[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *sample = cself->sample;
-    return 0;
-}
-
-static
-rc_t CGEvidenceIntervals15_GetChromosome(const CGEvidenceIntervals15* cself, const CGFIELD_CHROMOSOME_TYPE** chromosome)
-{
-    if( cself->chromosome[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *chromosome = cself->chromosome;
-    return 0;
-}
-
-static
-rc_t CC CGEvidenceIntervals15_Read(const CGEvidenceIntervals15* cself, TEvidenceIntervalsData* data)
-{
-    rc_t rc = 0;
-
-    CG_LINE_START(cself->file, b, len, p);
-    if( b == NULL || len == 0) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcDone);
-        break;
-    }
-    /*DEBUG_MSG(10, ("evidenceIntervals: '%.*s'\n", len, b));*/
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->interval_id, sizeof(data->interval_id));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->chr, sizeof(data->chr));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2i32(b, p - b, &data->offset);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2u32(b, p - b, &data->length);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2u16(b, p - b, &data->ploidy);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_indexes, sizeof(data->allele_indexes));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2i32(b, p - b, &data->score);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[0], sizeof(data->allele[0]));
-    data->allele_length[0] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[1], sizeof(data->allele[1]));
-    data->allele_length[1] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[2], sizeof(data->allele[2]));
-    data->allele_length[2] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_alignment[1], sizeof(data->allele_alignment[1]));
-    data->allele_alignment_length[1] = p - b;
-    CG_LINE_LAST_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_alignment[2], sizeof(data->allele_alignment[2]));
-    data->allele_alignment_length[2] = p - b;
-    ((CGEvidenceIntervals15*)cself)->records++;
-    DEBUG_MSG(10, ("evidenceIntervals: '%s'\t'%s'\t%i\t%u\t%u\t%s\t%u\t'%s'\t'%s'\t'%s'\t'%s'\t'%s'\n",
-        data->interval_id, data->chr, data->offset, data->length, data->ploidy,
-        data->allele_indexes, data->score, data->allele[0], data->allele[1], data->allele[2],
-        data->allele_alignment[1], data->allele_alignment[2]));
-    CG_LINE_END();
-    return rc;
-}
-
-static
-rc_t CC CGEvidenceIntervals20_Read(const CGEvidenceIntervals15* cself, TEvidenceIntervalsData* data)
-{
-    rc_t rc = 0;
-
-    CG_LINE_START(cself->file, b, len, p);
-    if( b == NULL || len == 0) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcDone);
-        break;
-    }
-    /*DEBUG_MSG(10, ("evidenceIntervals: '%.*s'\n", len, b));*/
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->interval_id, sizeof(data->interval_id));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->chr, sizeof(data->chr));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2i32(b, p - b, &data->offset);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2u32(b, p - b, &data->length);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2u16(b, p - b, &data->ploidy);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_indexes, sizeof(data->allele_indexes));
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2i32(b, p - b, &data->scoreVAF);
-    data->score = data->scoreVAF; /***TODO: do we need re-calculation? ***/
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2i32(b, p - b, &data->scoreEAF);
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[0], sizeof(data->allele[0]));
-    data->allele_length[0] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[1], sizeof(data->allele[1]));
-    data->allele_length[1] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[2], sizeof(data->allele[2]));
-    data->allele_length[2] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele[3], sizeof(data->allele[3]));
-    data->allele_length[3] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_alignment[1], sizeof(data->allele_alignment[1]));
-    data->allele_alignment_length[1] = p - b;
-    CG_LINE_NEXT_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_alignment[2], sizeof(data->allele_alignment[2]));
-    data->allele_alignment_length[2] = p - b;
-    CG_LINE_LAST_FIELD(b, len, p);
-    rc = str2buf(b, p - b, data->allele_alignment[3], sizeof(data->allele_alignment[3]));
-    data->allele_alignment_length[3] = p - b;
-    ((CGEvidenceIntervals15*)cself)->records++;
-    DEBUG_MSG(10, (
-        "evidenceIntervals: '%s'\t'%s'\t%i\t%u\t%u\t%s\t%u\t%u\t'%s'\t'%s'\t'%s'\t'%s'\t'%s'\t'%s'\t'%s'\n",
-        data->interval_id, data->chr, data->offset, data->length, data->ploidy,
-        data->allele_indexes, data->scoreVAF, data->scoreEAF,
-        data->allele[0], data->allele[1], data->allele[2], data->allele[3],
-        data->allele_alignment[1], data->allele_alignment[2], data->allele_alignment[3]));
-    CG_LINE_END();
-    return rc;
-}
-
-static
-void CC CGEvidenceIntervals15_Release(const CGEvidenceIntervals15* cself, uint64_t* records)
-{
-    if( cself != NULL ) {
-        CGEvidenceIntervals15* self = (CGEvidenceIntervals15*)cself;
-        if( records != NULL ) {
-            *records = cself->records;
-        }
-        free(self);
-    }
-}
-
-static const CGFileType_vt CGEvidenceIntervals15_vt =
-{
-    CGEvidenceIntervals15_Header,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceIntervals15_Read,
-    NULL,
-    CGEvidenceIntervals15_GetAssemblyId,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceIntervals15_GetSample,
-    CGEvidenceIntervals15_GetChromosome,
-    CGEvidenceIntervals15_Release
-};
-
-static const CGFileType_vt CGEvidenceIntervals20_vt =
-{
-    CGEvidenceIntervals15_Header,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceIntervals20_Read,
-    NULL,
-    CGEvidenceIntervals15_GetAssemblyId,
-    NULL,
-    NULL,
-    NULL,
-    CGEvidenceIntervals15_GetSample,
-    CGEvidenceIntervals15_GetChromosome,
-    CGEvidenceIntervals15_Release
-};
-
-static
-rc_t CGEvidenceIntervals_Make(const CGFileType** cself, const CGLoaderFile* file, const CGFileType_vt* vt)
-{
-    rc_t rc = 0;
-    CGEvidenceIntervals15* obj = NULL;
-
-    assert(vt);
-
-    if( cself == NULL || file == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    if( rc == 0 ) {
-        *cself = NULL;
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            obj->file = file;
-            obj->dad.type = cg_eFileType_EVIDENCE_INTERVALS;
-            obj->dad.vt = vt;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = &obj->dad;
-    } else {
-        CGEvidenceIntervals15_Release(obj, NULL);
-    }
-    return rc;
-}
-
-rc_t CGEvidenceIntervals15_Make(const CGFileType** self,
-    const CGLoaderFile* file)
-{   return CGEvidenceIntervals_Make(self, file, &CGEvidenceIntervals15_vt); }
-
-rc_t CGEvidenceIntervals13_Make(const CGFileType** self,
-    const CGLoaderFile* file)
-{   return CGEvidenceIntervals15_Make(self, file); }
-
-rc_t CGEvidenceIntervals20_Make(const CGFileType** self,
-    const CGLoaderFile* file)
-{   return CGEvidenceIntervals_Make(self, file, &CGEvidenceIntervals20_vt); }
-
-rc_t CGEvidenceIntervals22_Make(const CGFileType** self,
-    const CGLoaderFile* file)
-{   return CGEvidenceIntervals20_Make(self, file); }
diff --git a/tools/cg-load/factory-evidence-intervals.h b/tools/cg-load/factory-evidence-intervals.h
deleted file mode 100644
index 2f84fd4..0000000
--- a/tools/cg-load/factory-evidence-intervals.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_evidence_intervals_h_
-#define _tools_cg_load_factory_evidence_intervals_h_
-
-#include <klib/defs.h>
-
-struct CGFileType;
-struct CGLoaderFile;
-
-rc_t CGEvidenceIntervals13_Make(const struct CGFileType** self,
-                                const struct CGLoaderFile* file);
-rc_t CGEvidenceIntervals15_Make(const struct CGFileType** self,
-                                const struct CGLoaderFile* file);
-rc_t CGEvidenceIntervals20_Make(const struct CGFileType** self,
-                                const struct CGLoaderFile* file);
-rc_t CGEvidenceIntervals22_Make(const struct CGFileType** self,
-                                const struct CGLoaderFile* file);
-
-#endif /* _tools_cg_load_factory_evidence_intervals_h_ */
diff --git a/tools/cg-load/factory-file.h b/tools/cg-load/factory-file.h
deleted file mode 100644
index 8931fca..0000000
--- a/tools/cg-load/factory-file.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_file_h_
-#define _tools_cg_load_factory_file_h_
-
-#include <klib/defs.h>
-
-struct CGFileType;
-struct CGLoaderFile;
-
-rc_t CGFile13_Make(const struct CGFileType** self,
-                   const char* type, const struct CGLoaderFile* file);
-rc_t CGFile15_Make(const struct CGFileType** self,
-                   const char* type, const struct CGLoaderFile* file);
-rc_t CGFile20_Make(const struct CGFileType** self,
-                   const char* type, const struct CGLoaderFile* file);
-rc_t CGFile22_Make(const struct CGFileType** self,
-                   const char* type, const struct CGLoaderFile* file);
-
-#endif /* _tools_cg_load_factory_file_h_ */
diff --git a/tools/cg-load/factory-mappings.c b/tools/cg-load/factory-mappings.c
deleted file mode 100644
index 43537f2..0000000
--- a/tools/cg-load/factory-mappings.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-typedef struct CGMappings15 CGMappings15;
-#define CGFILETYPE_IMPL CGMappings15
-#include "file.h"
-#include "factory-cmn.h"
-#include "factory-mappings.h"
-#include "debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-
-struct CGMappings15 {
-    CGFileType dad;
-    const CGLoaderFile* file;
-    uint64_t records;
-    /* headers */
-    CGFIELD15_ASSEMBLY_ID assembly_id;
-    CGFIELD15_BATCH_FILE_NUMBER batch_file_number;
-    CGFIELD15_GENERATED_AT generated_at;
-    CGFIELD15_GENERATED_BY generated_by;
-    CGFIELD15_LANE lane;
-    CGFIELD15_LIBRARY library;
-    CGFIELD15_SAMPLE sample;
-    CGFIELD15_SLIDE slide;
-    CGFIELD15_SOFTWARE_VERSION software_version;
-};
-
-void CGMappings15_Release(const CGMappings15* cself, uint64_t* records)
-{
-    if( cself != NULL ) {
-        CGMappings15* self = (CGMappings15*)cself;
-        if( records != NULL ) {
-            *records = cself->records;
-        }
-        free(self);
-    }
-}
-
-static
-rc_t CC CGMappings15_Header(const CGMappings15* cself, const char* buf, const size_t len)
-{
-    rc_t rc = 0;
-    size_t slen;
-    CGMappings15* self = (CGMappings15*)cself;
-
-    if( strncmp("ASSEMBLY_ID\t", buf, slen = 12) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->assembly_id, sizeof(self->assembly_id));
-    } else if( strncmp("BATCH_FILE_NUMBER\t", buf, slen = 18) == 0 ) {
-        rc = str2u32(&buf[slen], len - slen, &self->batch_file_number);
-        if( self->batch_file_number < 1 ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcItem, rcOutofrange);
-        }
-    } else if( strncmp("GENERATED_AT\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_at, sizeof(self->generated_at));
-    } else if( strncmp("GENERATED_BY\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_by, sizeof(self->generated_by));
-    } else if( strncmp("LANE\t", buf, slen = 5) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->lane, sizeof(self->lane));
-    } else if( strncmp("LIBRARY\t", buf, slen = 8) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->library, sizeof(self->library));
-    } else if( strncmp("SAMPLE\t", buf, slen = 7) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->sample, sizeof(self->sample));
-    } else if( strncmp("SLIDE\t", buf, slen = 6) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->slide, sizeof(self->slide));
-    } else if( strncmp("SOFTWARE_VERSION\t", buf, slen = 17) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->software_version, sizeof(self->software_version));
-    } else {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcName, rcUnrecognized);
-    }
-    return rc;
-}
-
-static
-rc_t CGMappings15_GetAssemblyId(const CGMappings15* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id)
-{
-    if( cself->assembly_id[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *assembly_id = cself->assembly_id;
-    return 0;
-}
-
-static
-rc_t CGMappings15_GetSlide(const CGMappings15* cself, const CGFIELD_SLIDE_TYPE** slide)
-{
-    if( cself->slide[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *slide = cself->slide;
-    return 0;
-}
-
-static
-rc_t CGMappings15_GetLane(const CGMappings15* cself, const CGFIELD_LANE_TYPE** lane)
-{
-    if( cself->lane[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *lane = cself->lane;
-    return 0;
-}
-
-static
-rc_t CGMappings15_GetBatchFileNumber(const CGMappings15* cself, const CGFIELD_BATCH_FILE_NUMBER_TYPE** batch_file_number)
-{
-    *batch_file_number = &cself->batch_file_number;
-    return 0;
-}
-
-static
-rc_t CC CGMappings15_Read(const CGMappings15* cself, TMappingsData* data)
-{
-    rc_t rc = 0;
-    TMappingsData_map* m = NULL;
-
-    data->map_qty = 0;
-    do {
-        char tmp[2];
-        CG_LINE_START(cself->file, b, len, p);
-        if( b == NULL || len == 0 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInsufficient);
-            break;
-        }
-        m = &data->map[data->map_qty];
-        m->saved = false;
-        /*DEBUG_MSG(10, ("mappings %4u: '%.*s'\n", data->map_qty, len, b));*/
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2u16(b, p - b, &m->flags);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->chr, sizeof(m->chr));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i32(b, p - b, &m->offset);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[0]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[1]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[2]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if( tmp[0] < 33 || tmp[0] > 126 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        }
-        m->weight = tmp[0];
-        CG_LINE_LAST_FIELD(b, len, p);
-        if( (rc = str2u32(b, p - b, &m->mate)) != 0 ) {
-        } else if( m->flags > 7 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        } else if( ++data->map_qty >= CG_MAPPINGS_MAX ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcBuffer, rcInsufficient);
-        }
-        ((CGMappings15*)cself)->records++;
-        DEBUG_MSG(10, ("mappings %4u:  %u\t'%s'\t%u\t%i\t%i\t%i\t%c\t%u\n",
-                        data->map_qty - 1, m->flags, m->chr, m->offset,
-                        m->gap[0], m->gap[1], m->gap[2], m->weight, m->mate));
-        CG_LINE_END();
-    } while( rc == 0 && !(m->flags & cg_eLastDNBRecord) );
-    if (rc == 0) {
-        unsigned i;
-        unsigned const n = data->map_qty;
-        
-        for (i = 0; i != n && rc == 0; ++i) {
-            unsigned const mate = data->map[i].mate;
-            
-            if (mate > n)
-                data->map[i].mate = i;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t CC CGMappings22_Read(const CGMappings15* cself, TMappingsData* data)
-{
-    rc_t rc = 0;
-    TMappingsData_map* m = NULL;
-
-    data->map_qty = 0;
-    do {
-        char tmp[2];
-        char armWeight = '\0';
-        CG_LINE_START(cself->file, b, len, p);
-        if( b == NULL || len == 0 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInsufficient);
-            break;
-        }
-        m = &data->map[data->map_qty];
-        m->saved = false;
-        /*DEBUG_MSG(10, ("mappings %4u: '%.*s'\n", data->map_qty, len, b));*/
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2u16(b, p - b, &m->flags);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, m->chr, sizeof(m->chr));
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i32(b, p - b, &m->offset);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[0]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[1]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2i16(b, p - b, &m->gap[2]);
-        CG_LINE_NEXT_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if( tmp[0] < 33 || tmp[0] > 126 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        }
-        m->weight = tmp[0];
-        CG_LINE_NEXT_FIELD(b, len, p);
-        if( (rc = str2u32(b, p - b, &m->mate)) != 0 ) {
-        } else if( m->flags > 7 ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-        } else if( ++data->map_qty >= CG_MAPPINGS_MAX ) {
-            rc = RC(rcRuntime, rcFile, rcReading, rcBuffer, rcInsufficient);
-        }
-        CG_LINE_LAST_FIELD(b, len, p);
-        rc = str2buf(b, p - b, tmp, sizeof(tmp));
-        if (tmp[0] < 33 || tmp[0] > 126)
-        {   rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange); }
-        armWeight = tmp[0]; /* ignore armWeight */
-        ((CGMappings15*)cself)->records++;
-        DEBUG_MSG(10, ("mappings %4u:  %u\t'%s'\t%u\t%i\t%i\t%i\t%c\t%u\t%c\n",
-            data->map_qty - 1, m->flags, m->chr, m->offset,
-            m->gap[0], m->gap[1], m->gap[2], m->weight, m->mate, armWeight));
-        CG_LINE_END();
-    } while( rc == 0 && !(m->flags & cg_eLastDNBRecord) );
-    if (rc == 0) {
-        unsigned i;
-        unsigned const n = data->map_qty;
-        
-        for (i = 0; i != n && rc == 0; ++i) {
-            unsigned const mate = data->map[i].mate;
-            
-            if (mate > n)
-                data->map[i].mate = n;
-        }
-    }
-    return rc;
-}
-
-static const CGFileType_vt CGMappings15_vt =
-{
-    CGMappings15_Header,
-    NULL,
-    NULL,
-    CGMappings15_Read,
-    NULL,
-    NULL,
-    CGMappings15_GetAssemblyId,
-    CGMappings15_GetSlide,
-    CGMappings15_GetLane,
-    CGMappings15_GetBatchFileNumber,
-    NULL,
-    NULL,
-    CGMappings15_Release
-};
-
-static const CGFileType_vt CGMappings22_vt =
-{
-    CGMappings15_Header,
-    NULL,
-    NULL,
-    CGMappings22_Read,
-    NULL,
-    NULL,
-    CGMappings15_GetAssemblyId,
-    CGMappings15_GetSlide,
-    CGMappings15_GetLane,
-    CGMappings15_GetBatchFileNumber,
-    NULL,
-    NULL,
-    CGMappings15_Release
-};
-
-static
-rc_t CC CGMappings_Make(const CGFileType** cself,
-    const CGLoaderFile* file, const CGFileType_vt* vt)
-{
-    rc_t rc = 0;
-    CGMappings15* obj = NULL;
-    
-    if( cself == NULL || file == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        *cself = NULL;
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            obj->file = file;
-            obj->dad.type = cg_eFileType_MAPPINGS;
-            obj->dad.vt = vt;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = &obj->dad;
-    } else {
-        CGMappings15_Release(obj, NULL);
-    }
-    return rc;
-}
-
-rc_t CC CGMappings15_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGMappings_Make(self, file, &CGMappings15_vt); }
-
-rc_t CC CGMappings13_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGMappings15_Make(self, file); }
-
-rc_t CC CGMappings20_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGMappings15_Make(self, file); }
-
-rc_t CC CGMappings22_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGMappings_Make(self, file, &CGMappings22_vt); }
diff --git a/tools/cg-load/factory-mappings.h b/tools/cg-load/factory-mappings.h
deleted file mode 100644
index cc283b7..0000000
--- a/tools/cg-load/factory-mappings.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_mappings_h_
-#define _tools_cg_load_factory_mappings_h_
-
-#include <klib/defs.h>
-
-struct CGFileType;
-struct CGLoaderFile;
-
-rc_t CC CGMappings13_Make(const struct CGFileType** self,
-                          const struct CGLoaderFile* file);
-rc_t CC CGMappings15_Make(const struct CGFileType** self,
-                          const struct CGLoaderFile* file);
-rc_t CC CGMappings20_Make(const struct CGFileType** self,
-                          const struct CGLoaderFile* file);
-rc_t CC CGMappings22_Make(const struct CGFileType** self,
-                          const struct CGLoaderFile* file);
-
-#endif /* _tools_cg_load_factory_mappings_h_ */
diff --git a/tools/cg-load/factory-reads.c b/tools/cg-load/factory-reads.c
deleted file mode 100644
index 8b39f9a..0000000
--- a/tools/cg-load/factory-reads.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-
-typedef struct CGReads15 CGReads15;
-#define CGFILETYPE_IMPL CGReads15
-#include "file.h"
-#include "factory-cmn.h"
-#include "factory-reads.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <os-native.h>
-
-struct CGReads15 {
-    CGFileType dad;
-    const CGLoaderFile* file;
-    int64_t start_rowid;
-    char spot_group[512];
-    uint64_t records;
-    /* headers */
-    CGFIELD15_ASSEMBLY_ID assembly_id;
-    CGFIELD15_BATCH_FILE_NUMBER batch_file_number;
-    CGFIELD15_BATCH_OFFSET batch_offset;
-    CGFIELD15_FIELD_SIZE field_size;
-    CGFIELD15_GENERATED_AT generated_at;
-    CGFIELD15_GENERATED_BY generated_by;
-    CGFIELD15_LANE lane;
-    CGFIELD15_LIBRARY library;
-    CGFIELD15_SAMPLE sample;
-    CGFIELD15_SLIDE slide;
-    CGFIELD15_SOFTWARE_VERSION software_version;
-};
-
-static
-rc_t CC CGReads15_Header(const CGReads15* cself, const char* buf, const size_t len)
-{
-    rc_t rc = 0;
-    size_t slen;
-    CGReads15* self = (CGReads15*)cself;
-
-    if( strncmp("ASSEMBLY_ID\t", buf, slen = 12) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->assembly_id, sizeof(self->assembly_id));
-    } else if( strncmp("BATCH_FILE_NUMBER\t", buf, slen = 18) == 0 ) {
-        rc = str2u32(&buf[slen], len - slen, &self->batch_file_number);
-        if( self->batch_file_number < 1 ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcItem, rcOutofrange);
-        }
-    } else if( strncmp("BATCH_OFFSET\t", buf, slen = 13) == 0 ) {
-        rc = str2u64(&buf[slen], len - slen, &self->batch_offset);
-    } else if( strncmp("FIELD_SIZE\t", buf, slen = 11) == 0 ) {
-        rc = str2u32(&buf[slen], len - slen, &self->field_size);
-    } else if( strncmp("GENERATED_AT\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_at, sizeof(self->generated_at));
-    } else if( strncmp("GENERATED_BY\t", buf, slen = 13) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->generated_by, sizeof(self->generated_by));
-    } else if( strncmp("LANE\t", buf, slen = 5) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->lane, sizeof(self->lane));
-    } else if( strncmp("LIBRARY\t", buf, slen = 8) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->library, sizeof(self->library));
-    } else if( strncmp("SAMPLE\t", buf, slen = 7) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->sample, sizeof(self->sample));
-    } else if( strncmp("SLIDE\t", buf, slen = 6) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->slide, sizeof(self->slide));
-    } else if( strncmp("SOFTWARE_VERSION\t", buf, slen = 17) == 0 ) {
-        rc = str2buf(&buf[slen], len - slen, self->software_version, sizeof(self->software_version));
-    } else {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcName, rcUnrecognized);
-    }
-    return rc;
-}
-
-static
-rc_t CGReads15_GetAssemblyId(const CGReads15* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id)
-{
-    if( cself->assembly_id[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *assembly_id = cself->assembly_id;
-    return 0;
-}
-
-static
-rc_t CGReads15_GetSlide(const CGReads15* cself, const CGFIELD_SLIDE_TYPE** slide)
-{
-    if( cself->slide[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *slide = cself->slide;
-    return 0;
-}
-
-static
-rc_t CGReads15_GetLane(const CGReads15* cself, const CGFIELD_LANE_TYPE** lane)
-{
-    if( cself->lane[0] == '\0' ) {
-        return RC(rcRuntime, rcFile, rcReading, rcFormat, rcInvalid);
-    }
-    *lane = cself->lane;
-    return 0;
-}
-
-static
-rc_t CGReads15_GetBatchFileNumber(const CGReads15* cself, const CGFIELD_BATCH_FILE_NUMBER_TYPE** batch_file_number)
-{
-    *batch_file_number = &cself->batch_file_number;
-    return 0;
-}
-
-static
-rc_t CC CGReads15_Read(const CGReads15* cself, TReadsData* data)
-{
-    rc_t rc = 0;
-
-    if( cself->start_rowid == 0 ) {
-        ((CGReads15*)cself)->start_rowid = data->rowid;
-    }
-    CG_LINE_START(cself->file, b, len, p);
-    if( b == NULL || len == 0) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcDone);
-        break;
-    }
-    /*DEBUG_MSG(10, ("reads: '%.*s'\n", len, b));*/
-    CG_LINE_NEXT_FIELD(b, len, p);
-    if( (rc = str2u16(b, p - b, &data->flags)) != 0 ) {
-    } else if( data->flags > 10 ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcOutofrange);
-    } else if( (data->flags & 0x03) == 3 || (data->flags & 0x07) == 7 ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInvalid);
-    }
-    CG_LINE_NEXT_FIELD(b, len, p);
-    data->seq.sequence.elements = p - b;
-    if( data->seq.sequence.elements != CG_READS_SPOT_LEN ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInvalid);
-    } else {
-        rc = str2buf(b, data->seq.sequence.elements, data->read, sizeof(data->read));
-        /* clear cache, set in algnment writer */
-        data->reverse[0] = '\0';
-        data->reverse[CG_READS_SPOT_LEN / 2] = '\0';
-    }
-    CG_LINE_LAST_FIELD(b, len, p);
-    data->seq.quality.elements = p - b;
-    if( data->seq.quality.elements != CG_READS_SPOT_LEN ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcData, rcInvalid);
-    } else {
-        rc = str2buf(b, data->seq.quality.elements, data->qual, sizeof(data->qual));
-    }
-    if( cself->records == 0 ) {
-        size_t w;
-        
-#if 0
-        rc = string_printf(((CGReads15*)cself)->spot_group, sizeof(cself->spot_group), &w, "%s:%s:%s:%04u",
-                           cself->assembly_id, cself->slide, cself->lane, cself->batch_file_number);
-#else
-        rc = string_printf(((CGReads15*)cself)->spot_group, sizeof(cself->spot_group), &w, "%s-%s",
-                           cself->slide, cself->lane);
-#endif
-        data->seq.spot_group.buffer = cself->spot_group;
-        data->seq.spot_group.elements = w;
-    }
-    ((CGReads15*)cself)->records++;
-    DEBUG_MSG(10, ("reads:  %u\t'%s'\t'%s'\n", data->flags, data->read, data->qual));
-    CG_LINE_END();
-    return rc;
-}
-
-static
-rc_t CGReads15_GetStartRow(const CGReads15* cself, int64_t* rowid)
-{
-    *rowid = cself->start_rowid;
-    return 0;
-}
-
-static
-void CC CGReads15_Release(const CGReads15* cself, uint64_t* records)
-{
-    if( cself != NULL ) {
-        CGReads15* self = (CGReads15*)cself;
-        if( records != NULL ) {
-            *records = cself->records;
-        }
-        free(self);
-    }
-}
-
-static const CGFileType_vt CGReads15_vt =
-{
-    CGReads15_Header,
-    CGReads15_Read,
-    CGReads15_GetStartRow,
-    NULL,
-    NULL,
-    NULL,
-    CGReads15_GetAssemblyId,
-    CGReads15_GetSlide,
-    CGReads15_GetLane,
-    CGReads15_GetBatchFileNumber,
-    NULL,
-    NULL,
-    CGReads15_Release
-};
-
-rc_t CC CGReads15_Make(const CGFileType** cself, const CGLoaderFile* file)
-{
-    rc_t rc = 0;
-    CGReads15* obj = NULL;
-    
-    if( cself == NULL || file == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    if( rc == 0 ) {
-        *cself = NULL;
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            obj->file = file;
-            obj->dad.type = cg_eFileType_READS;
-            obj->dad.vt = &CGReads15_vt;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = &obj->dad;
-    } else {
-        CGReads15_Release(obj, NULL);
-    }
-    return rc;
-}
-
-rc_t CC CGReads13_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGReads15_Make(self, file); }
-
-rc_t CC CGReads20_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGReads15_Make(self, file); }
-
-rc_t CC CGReads22_Make(const CGFileType** self, const CGLoaderFile* file)
-{   return CGReads15_Make(self, file); }
diff --git a/tools/cg-load/factory-reads.h b/tools/cg-load/factory-reads.h
deleted file mode 100644
index e0266d3..0000000
--- a/tools/cg-load/factory-reads.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_factory_reads_h_
-#define _tools_cg_load_factory_reads_h_
-
-#include <klib/defs.h>
-
-struct CGFileType;
-struct CGLoaderFile;
-
-rc_t CC CGReads13_Make(const struct CGFileType** self,
-                       const struct CGLoaderFile* file);
-rc_t CC CGReads15_Make(const struct CGFileType** self,
-                       const struct CGLoaderFile* file);
-rc_t CC CGReads20_Make(const struct CGFileType** self,
-                       const struct CGLoaderFile* file);
-rc_t CC CGReads22_Make(const struct CGFileType** self,
-                       const struct CGLoaderFile* file);
-
-#endif /* _tools_cg_load_factory_reads_h_ */
diff --git a/tools/cg-load/file-version-factory.c b/tools/cg-load/file-version-factory.c
deleted file mode 100644
index 55372f8..0000000
--- a/tools/cg-load/file-version-factory.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-
-#include "factory-file.h" /* CGFile15_Make ... */
-
-typedef struct CGIgnored CGIgnored;
-#define CGFILETYPE_IMPL CGIgnored
-
-#include "file.h" /* CGLoaderFile */
-
-#include <assert.h>
-
-rc_t CGLoaderFile_CreateCGFile(CGLoaderFile* self,
-    uint32_t FORMAT_VERSION, const char* TYPE)
-{
-    assert(self && !self->cg_file);
-
-    switch (FORMAT_VERSION) {
-        case 0x01030000:
-            return CGFile13_Make(&self->cg_file, TYPE, self);
-        case 0x01050000:
-        case 0x01060000:
-            return CGFile15_Make(&self->cg_file, TYPE, self);
-        case 0x02000000:
-            return CGFile20_Make(&self->cg_file, TYPE, self);
-        case 0x02020000:
-            return CGFile22_Make(&self->cg_file, TYPE, self);
-        default: {
-            const char* name = NULL;
-            rc_t rc = CGLoaderFile_Filename(self, &name);
-            if (rc != 0 || name == NULL)
-            {   name = " | UNKNOWN | "; }
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcData, rcBadVersion);
-            PLOGERR(klogErr, (klogErr, rc,
-                "Unexpected #FORMAT_VERSION value '$(FORMAT_VERSION)' "
-                "in CG file '$(name)'",
-                "FORMAT_VERSION=%X,name=%s", FORMAT_VERSION, name));
-            return rc;
-        }
-    }
-}
-
-struct CGIgnored {
-    CGFileType dad;
-};
-
-static
-void CC CGIgnored_Release(const CGIgnored* cself, uint64_t* records)
-{
-    if( cself != NULL ) {
-        CGIgnored* self = (CGIgnored*)cself;
-        if( records != NULL ) {
-            *records = 0;
-        }
-        free(self);
-    }
-}
-
-static
-rc_t CC CGIgnored_Header(const CGIgnored* cself,
-    const char* buf, const size_t len)
-{
-    return 0;
-}
-
-static const CGFileType_vt CGIgnored_vt =
-{
-    CGIgnored_Header,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    CGIgnored_Release
-};
-
-rc_t CGLoaderFileMakeCGFileType(const CGLoaderFile* self, const char* type,
-    const CGFileTypeFactory* factory, size_t factories,
-    const CGFileType** ftype)
-{
-    rc_t rc = 0;
-    CGIgnored* obj = NULL;
-    uint32_t i;
-
-    if (self == NULL || type == NULL ||
-        factory == NULL || factories == 0 || ftype == NULL)
-    {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcParam, rcNull);
-    }
-    else {
-        *ftype = NULL;
-
-        for (i = 0; i < factories; ++i) {
-            if (strcmp(type, factory[i].name) == 0) {
-                if (factory[i].make != NULL) {
-                    return factory[i].make(ftype, self);
-                } else if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-                    rc = RC(rcRuntime,
-                        rcFile, rcConstructing, rcMemory, rcExhausted);
-                } else {
-                    obj->dad.vt = &CGIgnored_vt;
-                    obj->dad.type = factory[i].type;
-                }
-                break;
-            }
-        }
-
-        if( obj == NULL ) {
-            const char* name = NULL;
-            rc = CGLoaderFile_Filename(self, &name);
-            if (rc != 0 || name == NULL)
-            {   name = " | UNKNOWN | "; }
-
-            rc = RC(rcRuntime, rcFile, rcConstructing, rcItem, rcUnrecognized);
-            PLOGERR(klogErr, (klogErr, rc,
-                "Unexpected header #TYPE value '$(TYPE)' in CG file '$(name)'",
-                "TYPE=%s,name=%s", type, name));
-        }
-    }
-
-    if( rc == 0 ) {
-        *ftype = &obj->dad;
-    }
-    else {
-        CGIgnored_Release(obj, NULL);
-    }
-
-    return rc;
-}
diff --git a/tools/cg-load/file.c b/tools/cg-load/file.c
deleted file mode 100644
index 0e9a272..0000000
--- a/tools/cg-load/file.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/status.h>
-#include <kfs/directory.h>
-#include <kapp/loader-file.h>
-#include <strtol.h>
-
-#include "defs.h"
-#include "file.h"
-#include "factory-file.h"
-#include "debug.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-rc_t CGLoaderFile_IsEof(const CGLoaderFile* cself, bool* eof)
-{
-    return KLoaderFile_IsEof(cself ? cself->file : NULL, eof);
-}
-
-rc_t CGLoaderFile_Close(const CGLoaderFile* cself)
-{
-    const char* nm;
-
-    if( KLoaderFile_FullName(cself ? cself->file : NULL, &nm) == 0 ) {
-        PLOGMSG(klogInfo, (klogInfo, "File $(file) done", "severity=status,file=%s", nm));
-    }
-    return KLoaderFile_Close(cself ? cself->file : NULL);
-}
-
-rc_t CGLoaderFile_Line(const CGLoaderFile* cself, uint64_t* line)
-{
-    return KLoaderFile_Line(cself ? cself->file : NULL, line);
-}
-
-
-rc_t CGLoaderFile_Readline(const CGLoaderFile* cself, const void** buffer, size_t* length)
-{
-    return KLoaderFile_Readline(cself ? cself->file : NULL, buffer, length);
-}
-
-rc_t CGLoaderFile_Filename(const CGLoaderFile* cself, const char** name)
-{
-    return KLoaderFile_Name(cself ? cself->file : NULL, name);
-}
-
-rc_t CGLoaderFile_LOG(const CGLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...)
-{
-    if( cself != NULL ) {
-        va_list args;
-        va_start(args, fmt);
-        rc = KLoaderFile_VLOG(cself->file, lvl, rc, msg, fmt, args);
-        va_end(args);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_Release(const CGLoaderFile* cself, bool ignored)
-{
-    rc_t rc = 0;
-
-    if( cself ) {
-        CGLoaderFile* self = (CGLoaderFile*)cself;
-        /* may return md5 check error here */
-        if( self->cg_file && self->cg_file->vt->destroy ) {
-            uint64_t recs = 0;
-            self->cg_file->vt->destroy(self->cg_file, &recs);
-            if( rc == 0 && !ignored ) {
-                const char* name = NULL;
-                CGLoaderFile_Filename(cself, &name);
-                STSMSG(0, ("file %s %lu records", name, recs));
-            }
-        }
-        rc = KLoaderFile_Release(self->file, ignored);
-        free(self);
-    }
-    return rc;
-}
-
-static
-rc_t parse_version(const char* buf, size_t len, uint32_t* v)
-{
-    rc_t rc = 0;
-    int i = 0;
-    int64_t q;
-    char* end = (char*)buf;
-    const size_t sz = sizeof(*v) / sizeof(char);
-
-    *v = 0;
-    do {
-        if( i == sz ) {
-            rc = RC(rcRuntime, rcHeader, rcConstructing, rcFile, rcBadVersion);
-        } else {
-            q = strtoi64(end, &end, 10);
-            if( q < 0 || q > 255 ) {
-                rc = RC(rcRuntime, rcHeader, rcConstructing, rcFile, rcBadVersion);
-            } else if( *end == '.' ) {
-                end++;
-            } else if( end - buf < len ) {
-                rc = RC(rcRuntime, rcHeader, rcConstructing, rcFile, rcBadVersion);
-            }
-            *v = *v | ((uint8_t)q << ((sz - ++i) * 8));
-        }
-    } while( rc == 0 && end - buf < len);
-    return rc;
-}
-
-static
-rc_t CGLoaderFile_header(const CGLoaderFile* cself)
-{
-    rc_t rc = 0;
-
-    if( cself->cg_file == NULL ) {
-        CGLoaderFile* self = (CGLoaderFile*)cself;
-        const char* buf;
-        size_t len;
-        uint32_t fver = 0;
-        char type[64];
-
-        do {
-            if( (rc = CGLoaderFile_Readline(self, (const void**)&buf, &len)) == 0 ) {
-                if( buf == NULL ) {
-                    rc = RC(rcRuntime, rcFile, rcConstructing, rcData, rcTooShort);
-                } else if( len == 0 ) {
-                    /* empty line: skip */
-                } else if( buf[0] == '>' ) {
-                    /* start of records */
-                    break;
-                } else if( buf[0] == '#' ) {
-                    len--; buf++;
-                    if( strncmp("FORMAT_VERSION\t", buf, 15) == 0 ) {
-                        rc = parse_version(&buf[15], len - 15, &fver);
-                    } else if( strncmp("TYPE\t", buf, 5) == 0 ) {
-                        rc = str2buf(&buf[5], len - 5, type, sizeof(type));
-                    }
-                } else {
-                    rc = RC(rcRuntime, rcFile, rcConstructing, rcData, rcUnrecognized);
-                }
-            }
-        } while( rc == 0 && self->cg_file == NULL );
-        if( rc == 0 ) {
-            rc = CGLoaderFile_CreateCGFile(self, fver, type);
-
-            if( rc == 0 ) {
-                CGFileType* f = (CGFileType*)self->cg_file;
-                f->format_version = fver;
-                if( f->type == cg_eFileType_Unknown || !f->vt || !f->vt->header ) {
-                    rc = RC(rcRuntime, rcFile, rcConstructing, rcInterface, rcIncomplete);
-                }
-            }
-            if( rc == 0 ) {
-                /* we need to restart file for loading all header by sub class */
-                KLoaderFile_Reset(self->file);
-            }
-            while( rc == 0 ) {
-                if( (rc = CGLoaderFile_Readline(self, (const void**)&buf, &len)) == 0 ) {
-                    if( buf == NULL ) {
-                        rc = RC(rcRuntime, rcFile, rcConstructing, rcData, rcTooShort);
-                    } else if( len == 0 ) {
-                        /* empty line: skip */
-                    } else if( buf[0] == '>' ) {
-                        /* start of records */
-                        break;
-                    } else if( buf[0] == '#' ) {
-                        if( strncmp("FORMAT_VERSION\t", &buf[1], 15) != 0 && strncmp("TYPE\t", &buf[1], 5) != 0 ) {
-                            rc = cself->cg_file->vt->header(cself->cg_file, &buf[1], len - 1);
-                        }
-                    } else {
-                        rc = RC(rcRuntime, rcFile, rcConstructing, rcData, rcUnrecognized);
-                    }
-                }
-            }
-        }
-        /* close file after file is processed, but stay at data start */
-        KLoaderFile_SetReadAhead(self->file, self->read_ahead);
-        KLoaderFile_Close(self->file);
-    }
-
-    return rc;
-}
-
-rc_t CGLoaderFile_Make(const CGLoaderFile** cself, const KDirectory* dir, const char* filename,
-                       const uint8_t* md5_digest, bool read_ahead)
-{
-    rc_t rc = 0;
-    CGLoaderFile* obj = NULL;
-
-    if( cself == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcSelf, rcNull);
-    } else if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = KLoaderFile_Make(&obj->file, dir, filename, md5_digest, false)) == 0 ) {
-        obj->read_ahead = read_ahead;
-    }
-    if( rc == 0 ) {
-        *cself = obj;
-    } else {
-        CGLoaderFile_Release(obj, true);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetType(const CGLoaderFile* cself, CG_EFileType* type)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || type == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcClassifying, rcParam, rcNull);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        *type = cself->cg_file->type;
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetRead(const CGLoaderFile* cself, TReadsData* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->type != cg_eFileType_READS ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( cself->cg_file->vt->reads == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcIncomplete);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->reads(cself->cg_file, data);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetStartRow(const CGLoaderFile* cself, int64_t* rowid)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || rowid == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->type != cg_eFileType_READS ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( cself->cg_file->vt->get_start_row == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcIncomplete);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->get_start_row(cself->cg_file, rowid);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetMapping(const CGLoaderFile* cself, TMappingsData* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->type != cg_eFileType_MAPPINGS ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( cself->cg_file->vt->mappings == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcIncomplete);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->mappings(cself->cg_file, data);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetEvidenceIntervals(const CGLoaderFile* cself, TEvidenceIntervalsData* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || data == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->type != cg_eFileType_EVIDENCE_INTERVALS ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( cself->cg_file->vt->evidence_intervals == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcIncomplete);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->evidence_intervals(cself->cg_file, data);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetEvidenceDnbs(const CGLoaderFile* cself, const char* interval_id, TEvidenceDnbsData* data)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || interval_id == NULL || data == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->type != cg_eFileType_EVIDENCE_DNBS ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( cself->cg_file->vt->evidence_dnbs == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcIncomplete);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->evidence_dnbs(cself->cg_file, interval_id, data);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetAssemblyId(const CGLoaderFile* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || assembly_id == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->assembly_id == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->assembly_id(cself->cg_file, assembly_id);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetSlide(const CGLoaderFile* cself, const CGFIELD_SLIDE_TYPE** slide)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || slide == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->slide == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->slide(cself->cg_file, slide);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetLane(const CGLoaderFile* cself, const CGFIELD_LANE_TYPE** lane)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || lane == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->lane == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->lane(cself->cg_file, lane);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetBatchFileNumber(const CGLoaderFile* cself, const CGFIELD_BATCH_FILE_NUMBER_TYPE** batch_file_number)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || batch_file_number == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->batch_file_number == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->batch_file_number(cself->cg_file, batch_file_number);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetSample(const CGLoaderFile* cself, const CGFIELD_SAMPLE_TYPE** sample)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || sample == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->sample == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->sample(cself->cg_file, sample);
-    }
-    return rc;
-}
-
-rc_t CGLoaderFile_GetChromosome(const CGLoaderFile* cself, const CGFIELD_CHROMOSOME_TYPE** chromosome)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL || chromosome == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcParam, rcNull);
-    } else if( cself->cg_file->vt->chromosome == NULL ) {
-        rc = RC(rcRuntime, rcFile, rcReading, rcInterface, rcUnsupported);
-    } else if( (rc = CGLoaderFile_header(cself)) == 0 ) {
-        rc = cself->cg_file->vt->chromosome(cself->cg_file, chromosome);
-    }
-    return rc;
-}
diff --git a/tools/cg-load/file.h b/tools/cg-load/file.h
deleted file mode 100644
index d9bc44a..0000000
--- a/tools/cg-load/file.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_file_h_
-#define _tools_cg_load_file_h_
-
-#include <kfs/file.h>
-#include <kfs/directory.h>
-
-#include <klib/container.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-
-#include "defs.h"
-#include "writer-seq.h"
-#include "writer-algn.h"
-#include "writer-evidence-intervals.h"
-#include "writer-evidence-dnbs.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <strtol.h>
-
-
-/* some usefull utils */
-/* strchr but in fixed size buffer (not asciiZ!) */
-static __inline__ const char* str_chr(const char* str, const size_t len, char sep)
-{
-    const char* end = str + len;
-    while( str < end ) {
-        if( *str == sep ) {
-            break;
-        }
-        str++;
-    }
-    return str == end ? NULL : str;
-}
-
-static __inline__
-rc_t str2buf(const char* str, const size_t len, char* buf, const size_t buf_sz)
-{
-    if( buf_sz <= len ) {
-        rc_t rc = RC(rcRuntime, rcString, rcCopying, rcBuffer, rcInsufficient);
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc,  "'$(str)': $(sz) <= $(len)",
-                "str=%.*s,sz=%lu,len=%lu", len, str, buf_sz, len));
-        }
-        return rc;
-    }
-    memcpy(buf, str, len);
-    buf[len] = '\0';
-    return 0;
-}
-
-static __inline__
-rc_t str2unsigned(const char* str, const size_t len, uint64_t max, uint64_t* value)
-{
-    char* end;
-    int64_t q;
-
-    if( len == 0 ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcTooShort);
-    }
-    q = strtou64(str, &end, 10);
-    if( end - str != len ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcInvalid);
-    }
-    if( q < 0 || ( uint64_t ) q > max ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcOutofrange);
-    }
-    *value = q;
-    return 0;
-}
-static __inline__
-rc_t str2u64(const char* str, const size_t len, uint64_t* value)
-{
-    rc_t rc;
-    uint64_t q;
-
-    if( (rc = str2unsigned(str, len, -1, &q)) == 0 ) {
-        *value = q;
-    }
-    return rc;
-}
-
-static __inline__
-rc_t str2signed(const char* str, const size_t len, int64_t min, int64_t max, int64_t* value)
-{
-    char* end;
-    int64_t q;
-
-    if( len == 0 ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcTooShort);
-    }
-    q = strtoi64(str, &end, 10);
-    if( end - str != len ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcInvalid);
-    }
-    if( q < min || q > max ) {
-        return RC(rcRuntime, rcString, rcConverting, rcData, rcOutofrange);
-    }
-    *value = q;
-    return 0;
-}
-static __inline__
-rc_t str2i64(const char* str, const size_t len, int64_t* value)
-{
-    rc_t rc;
-    int64_t q;
-
-#if _ARCH_BITS == 32
-    if( (rc = str2signed(str, len, -0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL, &q)) == 0 ) {
-        *value = q;
-    }
-#else
-    if( (rc = str2signed(str, len, -0x7FFFFFFFFFFFFFFFL, 0x7FFFFFFFFFFFFFFFL, &q)) == 0 ) {
-        *value = q;
-    }
-#endif
-    return rc;
-}
-static __inline__
-rc_t str2i32(const char* str, const size_t len, int32_t* value)
-{
-    rc_t rc;
-    int64_t q;
-
-    if( (rc = str2signed(str, len, -0x7FFFFFFF - 1, 0x7FFFFFFF, &q)) == 0 ) {
-        *value = ( int32_t ) q;
-    }
-    return rc;
-}
-static __inline__
-rc_t str2u32(const char* str, const size_t len, uint32_t* value)
-{
-    rc_t rc;
-    uint64_t q;
-
-    if( (rc = str2unsigned(str, len, 0xFFFFFFFF, &q)) == 0 ) {
-        *value = ( uint32_t ) q;
-    }
-    return rc;
-}
-static __inline__
-rc_t str2i16(const char* str, const size_t len, int16_t* value)
-{
-    rc_t rc;
-    int64_t q;
-
-    if( (rc = str2signed(str, len, -0x7FFF - 1, 0x7FFF, &q)) == 0 ) {
-        *value = ( int16_t ) q;
-    }
-    return rc;
-}
-static __inline__
-rc_t str2u16(const char* str, const size_t len, uint16_t* value)
-{
-    rc_t rc;
-    uint64_t q;
-
-    if( (rc = str2unsigned(str, len, 0xFFFF, &q)) == 0 ) {
-        *value = ( uint16_t ) q;
-    }
-    return rc;
-}
-#define CG_LINE_START(file, buf, len, res) \
-    do { \
-        const char* buf, *res; \
-        size_t len; \
-        if( (rc = CGLoaderFile_Readline(file, (const void**)&buf, &len)) != 0 ) { \
-            break; \
-        } \
-        res = buf - 1;
-
-#define CG_LINE_NEXT_FIELD(buf, len, res) \
-    if( rc != 0 ) { \
-        break; \
-    } else { \
-        len -= ++res - buf; \
-        buf = res; \
-        if( (res = str_chr(buf, len, '\t')) == NULL ) { \
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcCorrupt); \
-            break; \
-        } \
-    }
-
-#define CG_LINE_LAST_FIELD(buf, len, res) \
-    if( rc != 0 ) { \
-        break; \
-    } else { \
-        len -= ++res - buf; \
-        buf = res; \
-        res = buf + len; \
-        if( str_chr(buf, len, '\t') != NULL ) { \
-            rc = RC(rcRuntime, rcFile, rcReading, rcData, rcCorrupt); \
-            break; \
-        } \
-    }
-
-#define CG_LINE_END() \
-    } while(false)
-
-#ifndef CGFILETYPE_IMPL
-#define CGFILETYPE_IMPL CGFileType
-#endif
-
-typedef struct CGFileType CGFileType;
-
-typedef struct CGFileType_vt_struct {
-    rc_t ( CC *header ) (const CGFILETYPE_IMPL* self, const char* buf, const size_t len);
-
-    rc_t ( CC *reads ) (const CGFILETYPE_IMPL* cself, TReadsData* data);
-    rc_t ( CC *get_start_row ) (const CGFILETYPE_IMPL* cself, int64_t* rowid);
-    rc_t ( CC *mappings ) (const CGFILETYPE_IMPL* cself, TMappingsData* data);
-    rc_t ( CC *evidence_intervals )(const CGFILETYPE_IMPL* cself, TEvidenceIntervalsData* data);
-    rc_t ( CC *evidence_dnbs )(const CGFILETYPE_IMPL* cself, const char* interval_id, TEvidenceDnbsData* data);
-
-    rc_t ( CC *assembly_id) (const CGFILETYPE_IMPL* self, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id);
-    rc_t ( CC *slide) (const CGFILETYPE_IMPL* self, const CGFIELD_SLIDE_TYPE** slide);
-    rc_t ( CC *lane) (const CGFILETYPE_IMPL* self, const CGFIELD_LANE_TYPE** lane);
-    rc_t ( CC *batch_file_number) (const CGFILETYPE_IMPL* self, const CGFIELD_BATCH_FILE_NUMBER_TYPE** batch_file_number);
-    rc_t ( CC *sample) (const CGFILETYPE_IMPL* self, const CGFIELD_SAMPLE_TYPE** sample);
-    rc_t ( CC *chromosome) (const CGFILETYPE_IMPL* self, const CGFIELD_CHROMOSOME_TYPE** chromosome);
-
-    void ( CC *destroy ) (const CGFILETYPE_IMPL* self, uint64_t* records);
-} CGFileType_vt;
-
-struct CGFileType {
-    uint32_t format_version;
-    CG_EFileType type;
-    const CGFileType_vt* vt;
-};
-
-typedef struct CGLoaderFile
-{
-    bool read_ahead;
-    const struct KLoaderFile *file;
-    const CGFileType* cg_file;
-} CGLoaderFile;
-
-typedef struct CGFileTypeFactory {
-    const char* name;
-    CG_EFileType type;
-    rc_t ( CC *make ) (const CGFileType** self, const CGLoaderFile* file);
-} CGFileTypeFactory;
-
-rc_t CGLoaderFile_Make(const CGLoaderFile **cself, const KDirectory* dir, const char* filename,
-                       const uint8_t* md5_digest, bool read_ahead);
-
-rc_t CGLoaderFile_Release(const CGLoaderFile* cself, bool ignored);
-
-/* returns true if eof is reached and buffer is empty */
-rc_t CGLoaderFile_IsEof(const CGLoaderFile* cself, bool* eof);
-
-/* closes the underlying file */
-rc_t CGLoaderFile_Close(const CGLoaderFile* cself);
-
-/* returns current 1-based line number in file */
-rc_t CGLoaderFile_Line(const CGLoaderFile* cself, uint64_t* line);
-
-rc_t CGLoaderFile_Filename(const CGLoaderFile *cself, const char** name);
-
-rc_t CGLoaderFile_LOG(const CGLoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...);
-
-rc_t CGLoaderFile_GetType(const CGLoaderFile* cself, CG_EFileType* type);
-
-rc_t CGLoaderFile_GetRead(const CGLoaderFile* cself, TReadsData* data);
-rc_t CGLoaderFile_GetStartRow(const CGLoaderFile* cself, int64_t* rowid);
-
-rc_t CGLoaderFile_GetMapping(const CGLoaderFile* cself, TMappingsData* data);
-
-rc_t CGLoaderFile_GetEvidenceIntervals(const CGLoaderFile* cself, TEvidenceIntervalsData* data);
-
-rc_t CGLoaderFile_GetEvidenceDnbs(const CGLoaderFile* cself, const char* interval_id, TEvidenceDnbsData* data);
-
-rc_t CGLoaderFile_GetAssemblyId(const CGLoaderFile* cself, const CGFIELD_ASSEMBLY_ID_TYPE** assembly_id);
-rc_t CGLoaderFile_GetSlide(const CGLoaderFile* cself, const CGFIELD_SLIDE_TYPE** slide);
-rc_t CGLoaderFile_GetLane(const CGLoaderFile* cself, const CGFIELD_LANE_TYPE** lane);
-rc_t CGLoaderFile_GetBatchFileNumber(const CGLoaderFile* cself, const CGFIELD_BATCH_FILE_NUMBER_TYPE** batch_file_number);
-rc_t CGLoaderFile_GetSample(const CGLoaderFile* cself, const CGFIELD_SAMPLE_TYPE** sample);
-rc_t CGLoaderFile_GetChromosome(const CGLoaderFile* cself, const CGFIELD_CHROMOSOME_TYPE** chromosome);
-
-
-/* Readline
- *  makes next line from a file available in buffer.
- *  eligable EOL symbols are: \n (unix), \r (older mac), \r\n (win)
- *  EOL symbol(s) never included in buffer length.
- *  line is \0 terminated.
- *  if there is no EOL at EOF - not an error.
- *  fails if internal buffer is insufficient.
- *  buffer is NULL on EOF
- *  rc state of (rcString rcTooLong) means line was too long
- *              you may copy line and readline again for the tail of the line
- *
- *  "buffer" [ OUT ] and "length" [ OUT ] - returned line and it's length
- */
-rc_t CGLoaderFile_Readline(const CGLoaderFile* cself, const void** buffer, size_t* length);
-
-rc_t CGLoaderFile_CreateCGFile(CGLoaderFile* self,
-    uint32_t FORMAT_VERSION, const char* TYPE);
-
-rc_t CGLoaderFileMakeCGFileType(const CGLoaderFile* self, const char* type,
-    const CGFileTypeFactory* factory, size_t factories,
-    const CGFileType** ftype);
-
-#endif /* _tools_cg_load_file_h_ */
diff --git a/tools/cg-load/writer-algn.c b/tools/cg-load/writer-algn.c
deleted file mode 100644
index cb025dc..0000000
--- a/tools/cg-load/writer-algn.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <klib/sort.h>
-#include <kfs/file.h>
-#include <insdc/insdc.h>
-#include <align/dna-reverse-cmpl.h>
-
-#include "defs.h"
-#include "writer-algn.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include <assert.h>
-
-typedef struct CGWriterAlgn_match_struct {
-    /* filled out by ReferenceMgr_Compress */
-    INSDC_coord_zero read_start;
-    INSDC_coord_len read_len;
-    bool has_ref_offset[CG_READS_SPOT_LEN];
-    int32_t ref_offset[CG_READS_SPOT_LEN];
-    bool has_mismatch[CG_READS_SPOT_LEN];
-    char mismatch[CG_READS_SPOT_LEN];
-    int64_t ref_id;
-    INSDC_coord_zero ref_start;
-    /* fill oud here */
-    int64_t seq_spot_id;
-    INSDC_coord_one seq_read_id;
-    bool ref_orientation;
-    uint32_t mapq;
-    /* used only only in secondary */
-    bool mate_ref_orientation;
-    int64_t mate_ref_id;
-    INSDC_coord_zero mate_ref_pos;
-    INSDC_coord_zero template_len;
-    INSDC_coord_len ref_len;
-} CGWriterAlgn_match;
-
-struct CGWriterAlgn {
-    const ReferenceMgr* rmgr;
-    const TableWriterAlgn* primary;
-    const TableWriterAlgn* secondary;
-    TableWriterAlgnData algn[CG_MAPPINGS_MAX];
-    CGWriterAlgn_match match[CG_MAPPINGS_MAX];
-    TMappingsData data;
-    uint32_t min_mapq;
-    bool single_mate;
-    uint64_t forced_pairs_cnt;
-    uint64_t dropped_mates_cnt;
-};
-    
-
-static uint32_t global_cluster_size;
-
-rc_t CGWriterAlgn_Make(const CGWriterAlgn** cself, TMappingsData** data, VDatabase* db, const ReferenceMgr* rmgr,
-                       uint32_t min_mapq, bool single_mate, uint32_t cluster_size)
-{
-    rc_t rc = 0;
-    CGWriterAlgn* self;
-
-    if( cself == NULL || db == NULL ) {
-        return RC(rcExe, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        if( (rc = TableWriterAlgn_Make(&self->primary, db,
-                            ewalgn_tabletype_PrimaryAlignment, ewalgn_co_SEQ_SPOT_ID | ewalgn_co_unsorted)) != 0 ){
-            LOGERR(klogErr, rc, "primary alignment table");
-        } else if( (rc = TableWriterAlgn_Make(&self->secondary, db,
-                            ewalgn_tabletype_SecondaryAlignment, ewalgn_co_SEQ_SPOT_ID | ewalgn_co_unsorted)) != 0 ) {
-            LOGERR(klogErr, rc, "secondary alignment table");
-        } else {
-            int i;
-            /* interconnect buffers */
-            for(i = 0; i < CG_MAPPINGS_MAX; i++) {
-                self->algn[i].seq_spot_id.buffer = &self->match[i].seq_spot_id;
-                self->algn[i].seq_spot_id.elements = 1;
-                
-                self->algn[i].seq_read_id.buffer = &self->match[i].seq_read_id;
-                self->algn[i].seq_read_id.elements = 1;
-
-                self->algn[i].read_start.buffer = &self->match[i].read_start;
-                
-                self->algn[i].read_len.buffer = &self->match[i].read_len;
-                
-                self->algn[i].has_ref_offset.buffer = self->match[i].has_ref_offset;
-                
-                self->algn[i].ref_offset.buffer = self->match[i].ref_offset;
-                
-                self->algn[i].ref_id.buffer = &self->match[i].ref_id;
-                
-                self->algn[i].ref_start.buffer = &self->match[i].ref_start;
-                
-                self->algn[i].has_mismatch.buffer = self->match[i].has_mismatch;
-                
-                self->algn[i].mismatch.buffer = self->match[i].mismatch;
-                
-                self->algn[i].ref_orientation.buffer = &self->match[i].ref_orientation;
-                self->algn[i].ref_orientation.elements = 1;
-                
-                self->algn[i].mapq.buffer = &self->match[i].mapq;
-                self->algn[i].mapq.elements = 1;
-                
-                self->algn[i].mate_ref_orientation.buffer = &self->match[i].mate_ref_orientation;
-                self->algn[i].mate_ref_orientation.elements = 1;
-                
-                self->algn[i].mate_ref_id.buffer = &self->match[i].mate_ref_id;
-                self->algn[i].mate_ref_id.elements = 1;
-                
-                self->algn[i].mate_ref_pos.buffer = &self->match[i].mate_ref_pos;
-                self->algn[i].mate_ref_pos.elements = 1;
-                
-                self->algn[i].template_len.buffer = &self->match[i].template_len;
-                self->algn[i].template_len.elements = 1;
-            }
-            self->rmgr = rmgr;
-            self->min_mapq = min_mapq;
-            self->single_mate = single_mate;
-            global_cluster_size = cluster_size;
-            *data = &self->data;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        CGWriterAlgn_Whack(self, false, NULL, NULL);
-    }
-    return rc;
-}
-
-rc_t CGWriterAlgn_Whack(const CGWriterAlgn* cself, bool commit, uint64_t* rows_1st, uint64_t* rows_2nd)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        CGWriterAlgn* self = (CGWriterAlgn*)cself;
-        rc_t rc1 = TableWriterAlgn_Whack(cself->primary, commit, rows_1st);
-        rc_t rc2 = TableWriterAlgn_Whack(cself->secondary, commit, rows_2nd);
-        if( self->forced_pairs_cnt > 0 ) {
-            PLOGMSG(klogInfo, (klogInfo, "$(forced_pairs_cnt) forced pairs to PRIMARY", "forced_pairs_cnt=%lu", self->forced_pairs_cnt));
-        }
-        if( self->dropped_mates_cnt > 0 ) {
-            PLOGMSG(klogInfo, (klogInfo, "$(dropped_mates_cnt) dropped duplicate mates in SECONDARY", "dropped_mates_cnt=%lu", self->dropped_mates_cnt));
-        }
-        rc = rc1 ? rc1 : rc2;
-        free(self);
-    }
-    return rc;
-}
-
-static
-rc_t CGWriterAlgn_Save(CGWriterAlgn *const self,
-                       TReadsData *const rd,
-                       TableWriterAlgn const *const writer,
-                       uint32_t const mate,
-                       int64_t *const rowid)
-{
-    rc_t rc = 0;
-    TMappingsData_map *const map = &self->data.map[mate];
-
-    if( !map->saved ) {
-        CGWriterAlgn_match *const match = &self->match[mate];
-        TableWriterAlgnData *const algn = &self->algn[mate];
-        uint32_t* cigar, g;
-        uint32_t left_cigar[] = { 5 << 4, 0, 10 << 4, 0, 10 << 4, 0, 10 << 4 };
-        uint32_t right_cigar[] = { 10 << 4, 0, 10 << 4, 0, 10 << 4, 0, 5 << 4 };
-        const uint32_t read_len = CG_READS_SPOT_LEN / 2;
-        const char* read;
-
-        if (match->seq_read_id == 2) {
-            read = &((const char*)(rd->seq.sequence.buffer))[read_len];
-            cigar = right_cigar;
-            g = CG_READS_SPOT_LEN / 2;
-        }
-        else {
-            read = rd->seq.sequence.buffer;
-            cigar = left_cigar;
-            g = 0;
-        }
-        if (match->ref_orientation) {
-            if( rd->reverse[g] == '\0' ) {
-                if( (rc = DNAReverseCompliment(read, &rd->reverse[g], read_len)) != 0) {
-                    return rc;
-                }
-                DEBUG_MSG(10, ("'%.*s' -> cg_eRevDnbStrand: '%.*s'\n", read_len, read, read_len, &rd->reverse[g]));
-            }
-            read = &rd->reverse[g];
-            cigar = (cigar == left_cigar) ? right_cigar : left_cigar;
-        }
-        for(g = 0; g < CG_READS_NGAPS; g++) {
-            if( map->gap[g] > 0 ) {
-                cigar[g * 2 + 1] = (map->gap[g] << 4) | 2; /* 'xN' */
-            } else if( map->gap[g] < 0 ) {
-                cigar[g * 2 + 1] = (-map->gap[g] << 4) | 9; /* 'xB' */
-            } else {
-                cigar[g * 2 + 1] = 0; /* '0M' */
-            }
-        }
-        algn->ploidy = 0;
-        if( (rc = ReferenceMgr_Compress(self->rmgr, ewrefmgr_cmp_Binary,
-                    map->chr, map->offset, read, read_len, cigar, 7, 0, NULL, 0, 0, NULL, 0, algn)) != 0 ) {
-            PLOGERR(klogErr, (klogErr, rc, "compression failed $(id) $(o)",
-                    PLOG_2(PLOG_S(id),PLOG_I32(o)), map->chr, map->offset));
-        }
-        else {
-#if 1
-            /* this is to try represent these alignments as unmated to match cgatools
-             * axf uses the row length of MATE_REF_ORIENTATION as the indicator of 
-             * mate presence
-             */
-            unsigned const save = algn->mate_ref_orientation.elements;
-            
-            if (map->mate == mate)
-                algn->mate_ref_orientation.elements = 0;
-            
-            rc = TableWriterAlgn_Write(writer, algn, rowid);
-            
-            if (map->mate == mate)
-                algn->mate_ref_orientation.elements = save;
-#else
-            rc = TableWriterAlgn_Write(writer, algn, rowid);
-#endif
-            map->saved = true;
-        }
-    }
-    return rc;
-}
-
-#if 1
-static
-double JointQ(double const Q1, double const Q2)
-{
-    double const P1 =   1.0 - pow(10.0, Q1/-10.0);  /* prob that  1  is not incorrect */
-    double const P2 =   1.0 - pow(10.0, Q2/-10.0);  /* prob that  2  is not incorrect */
-    double const Pj =   1.0 - P1*P2;                /* prob that 1+2   is   incorrect */
-    double const Q  = -10.0 * log10(Pj);
-    
-    return Q;
-}
-
-static
-unsigned FindBestPair(TMappingsData *const data)
-{
-    unsigned const N = data->map_qty;
-    unsigned i;
-    double maxq;
-    unsigned best = N;
-    
-    /* pick best of the reciprocal pairs */
-    for (i = 0, maxq = -1.0; i != N; ++i) {
-        unsigned const mate = data->map[i].mate;
-        bool const is_left = (data->map[i].flags & cg_eRightHalfDnbMap) == 0;
-        
-        if (mate < N && mate != i && data->map[mate].mate == i && is_left) {
-            double const Q1 = (int)data->map[i].weight - 33;
-            double const Q2 = (int)data->map[mate].weight - 33;
-            double const q = JointQ(Q1, Q2);
-
-            assert(Q1 >= 0);
-            assert(Q2 >= 0);
-            assert(q >= 0);
-            if (maxq < q) {
-                maxq = q;
-                best = i;
-            }
-        }
-    }
-    if (best < N)
-        return best;
-    
-    /* no reciprocal pairs, pick best of any pair */
-    for (i = 0, maxq = 0.0; i != N; ++i) {
-        unsigned const mate = data->map[i].mate;
-        if (mate < N && mate != i) {
-            double const Q1 = (int)data->map[i].weight - 33;
-            double const Q2 = (int)data->map[mate].weight - 33;
-            double const q = JointQ(Q1, Q2);
-            
-            assert(Q1 >= 0);
-            assert(Q2 >= 0);
-            assert(q >= 0);
-            if (maxq < q) {
-                maxq = q;
-                best = i;
-            }
-        }
-    }
-    if (best == N) {
-        /* no pair with a joint Q > 0; pick best mapping */
-        for (i = 0, maxq = 0.0; i != N; ++i) {
-            unsigned const mate = data->map[i].mate;
-            if (mate < N && mate != i) {
-                double const q = (int)data->map[i].weight - 33;
-                
-                if (maxq < q) {
-                    maxq = q;
-                    best = i;
-                }
-            }
-        }
-        if (best == N) {
-            /* no mapping with Q > 0; pick first */
-            for (i = 0, maxq = 0.0; i != N; ++i) {
-                unsigned const mate = data->map[i].mate;
-                if (mate < N && mate != i) {
-                    best = i;
-                    break;
-                }
-            }
-            if (best == N) {
-                /* give up */
-                return N;
-            }
-        }
-    }
-    {
-        /* make the pair reciprocal */
-        unsigned const mate = data->map[best].mate;
-        
-        if (mate < N) {
-            data->map[mate].mate = best;
-            return (data->map[best].flags & cg_eRightHalfDnbMap) ? mate : best;
-        }
-        return N;
-    }
-}
-
-static
-unsigned FindBestLeft(TMappingsData *const data)
-{
-    unsigned const N = data->map_qty;
-    unsigned i;
-    unsigned best;
-    int maxq;
-    
-    for (best = N, maxq = -1, i = 0; i != N; ++i) {
-        int const q = (int)data->map[i].weight;
-        
-        if ((data->map[i].flags & cg_eRightHalfDnbMap) == 0 && maxq < q) {
-            maxq = q;
-            best = i;
-        }
-    }
-    return best;
-}
-
-static
-unsigned FindBestRight(TMappingsData *const data)
-{
-    unsigned const N = data->map_qty;
-    unsigned i;
-    unsigned best;
-    int maxq;
-    
-    for (best = N, maxq = -1, i = 0; i != N; ++i) {
-        int const q = (int)data->map[i].weight;
-        
-        if ((data->map[i].flags & cg_eRightHalfDnbMap) != 0 && maxq < q) {
-            maxq = q;
-            best = i;
-        }
-    }
-    return best;
-}
-
-static
-bool check_in_cluster(TMappingsData_map const *const a, TMappingsData_map const *const b)
-{
-	if (   (a->flags & cg_eRightHalfDnbMap) == (b->flags & cg_eRightHalfDnbMap)
-        && (strcmp(a->chr, b->chr) == 0)
-        && abs((int)a->offset - (int)b->offset) <= global_cluster_size)
-    {
-        return true;
-	}
-	return false;
-}
-
-static
-int clustering_sort_cb(void const *const A, void const *const B, void *const ctx)
-{
-    TMappingsData const *const data = (TMappingsData const *)ctx;
-    unsigned const ia = *(unsigned const *)A;
-    unsigned const ib = *(unsigned const *)B;
-    TMappingsData_map const *const a = &data->map[ia];
-    TMappingsData_map const *const b = &data->map[ib];
-    int res;
-    
-	res = (int)(a->flags & cg_eRightHalfDnbMap) - (int)(b->flags & cg_eRightHalfDnbMap); /**** separate by DNP side ***/
-	if (res) return res;
-    
-    res = strcmp(a->chr, b->chr); /* same chromosome ? **/
-	if (res) return res;
-    
-	res = (a->offset - b->offset) / (global_cluster_size + 1); /***  is it within the range ***/
-	if (res) return res;
-    
-	/**cluster is defined here; now pick the winner **/
-	res = (int)a->saved - (int)b->saved; /*** if already saved **/
-	if (res) return -res;
-    
-	res = (int)a->weight - (int)b->weight; /*** has  higher score **/
-	if (res) return -res;
-    
-	res = (int)(a->gap[0] + a->gap[1] + a->gap[2])
-    - (int)(b->gap[0] + b->gap[1] + b->gap[2]); /** has lower projection on the reference **/
-    return res;
-}
-
-static
-void cluster_mates(TMappingsData *const data)
-{
-    unsigned index[CG_MAPPINGS_MAX];
-    unsigned i;
-    unsigned j;
-    
-    for (i = 0; i != data->map_qty; ++i)
-        index[i] = i;
-    
-    ksort(index, data->map_qty, sizeof(index[0]), clustering_sort_cb, data);
-    for (i = 0, j = 1; j != data->map_qty; ++j) {
-        unsigned const ii = index[i];
-        unsigned const ij = index[j];
-        TMappingsData_map *const a = &data->map[ij];
-        TMappingsData_map const *const b = &data->map[ii];
-        
-        if (check_in_cluster(a, b)) {
-            unsigned const a_mate = a->mate;
-            unsigned const b_mate = b->mate;
-            
-            if (   a_mate == ij /** remove singletons **/
-                || a_mate == b_mate) /** or cluster originator has the same mate **/
-            {
-                a->saved = true;
-                DEBUG_MSG(10, ("mapping %u was dropped as a part of cluster at mapping %u\n", ij, ii));
-            }
-        }
-        else
-            i = j;
-    }
-}
-
-static
-INSDC_coord_zero template_length(unsigned const self_left,
-                                 unsigned const mate_left,
-                                 unsigned const self_len,
-                                 unsigned const mate_len,
-                                 unsigned const read_id)
-{
-    /* adapted from libs/axf/template_len.c */
-    unsigned const self_right = self_left + self_len;
-    unsigned const mate_right = mate_left + mate_len;
-    unsigned const  leftmost  = (self_left  < mate_left ) ? self_left  : mate_left;
-    unsigned const rightmost  = (self_right > mate_right) ? self_right : mate_right;
-    unsigned const tlen = rightmost - leftmost;
-    
-    /* The standard says, "The leftmost segment has a plus sign and the rightmost has a minus sign." */
-    if (   (self_left <= mate_left && self_right >= mate_right)     /* mate fully contained within self or */
-        || (mate_left <= self_left && mate_right >= self_right))    /* self fully contained within mate; */
-    {
-        if (self_left < mate_left || (read_id == 1 && self_left == mate_left))
-            return (INSDC_coord_zero)tlen;
-        else
-            return -(INSDC_coord_zero)tlen;
-    }
-    else if (   (self_right == mate_right && mate_left == leftmost) /* both are rightmost, but mate is leftmost */
-             ||  self_right == rightmost)
-    {
-        return -(INSDC_coord_zero)tlen;
-    }
-    else
-        return (INSDC_coord_zero)tlen;
-}
-
-static
-rc_t CGWriterAlgn_Write_int(CGWriterAlgn *const self, TReadsData *const read)
-{
-    TMappingsData *const data = &self->data;
-    unsigned const N = data->map_qty;
-    rc_t rc = 0;
-
-    if (N != 0) {
-        unsigned left_prime = N;
-        unsigned right_prime = N;
-        unsigned i;
-        unsigned countLeft  = 0;
-        unsigned countRight = 0;
-        
-        for (i = 0; i != N; ++i) {
-            char const *const refname = data->map[i].chr;
-            unsigned j;
-            INSDC_coord_len reflen = 35;
-            ReferenceSeq const *rseq;
-            
-            memset(&self->match[i], 0, sizeof(self->match[i]));
-            
-            rc = ReferenceMgr_GetSeq(self->rmgr, &rseq, refname);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failed accessing Reference '$(ref)'", "ref=%s", refname));
-                break;
-            }
-            rc = ReferenceSeq_Get1stRow(rseq, &self->match[i].ref_id); /* if the above worked, this is infallible */
-            assert(rc == 0);
-            ReferenceSeq_Release(rseq);
-            
-            for (j = 0; j != CG_READS_NGAPS; ++j)
-                reflen += data->map[i].gap[j];
-            
-            self->match[i].seq_spot_id = read->rowid;
-            self->match[i].mapq = data->map[i].weight - 33;
-            self->match[i].ref_orientation = (data->map[i].flags & cg_eRevDnbStrand) ? true : false;
-            self->match[i].ref_len = reflen;
-            
-            if (data->map[i].flags & cg_eRightHalfDnbMap) {
-                self->match[i].seq_read_id = 2;
-                ++countRight;
-            }
-            else {
-                self->match[i].seq_read_id = 1;
-                ++countLeft;
-            }
-        }
-
-        if (countLeft > 0 && countRight > 0) {
-            left_prime = FindBestPair(data);
-            if (left_prime < N) {
-                right_prime = data->map[left_prime].mate;
-            }
-            else { /* force the pairing */
-                left_prime = FindBestLeft(data);
-                right_prime = FindBestRight(data);
-                data->map[left_prime].mate = right_prime;
-                data->map[right_prime].mate = left_prime;
-            }
-            for (i = 0; i != N; ++i) {
-                unsigned const mate = data->map[i].mate;
-                
-                if (mate < N && mate != i) {
-                    INSDC_coord_zero const tlen = (self->match[i].ref_id == self->match[mate].ref_id)
-                                                ? template_length(data->map[i].offset,
-                                                                  data->map[mate].offset,
-                                                                  self->match[i].ref_len,
-                                                                  self->match[mate].ref_len,
-                                                                  self->match[i].seq_read_id)
-                                                : 0;
-
-                    self->match[i].mate_ref_id = self->match[mate].ref_id;
-                    self->match[i].mate_ref_orientation = self->match[mate].ref_orientation;
-                    self->match[i].mate_ref_pos = data->map[mate].offset;
-                    self->match[i].template_len = tlen;
-                }
-            }
-        }
-        else if (countLeft > 0) {
-            left_prime = FindBestLeft(data);
-        }
-        else {
-            assert(countRight > 0);
-            right_prime = FindBestRight(data);
-        }
-        
-        read->align_count[0] = countLeft  < 254 ? countLeft  : 255;
-        read->align_count[1] = countRight < 254 ? countRight : 255;
-        if (rc == 0 && left_prime < N) {
-            rc = CGWriterAlgn_Save(self, read, self->primary, left_prime,
-                                   &read->prim_algn_id[0]);
-            read->prim_is_reverse[0] = self->match[left_prime].ref_orientation;
-            data->map[left_prime].saved = 1;
-        }
-        if (rc == 0 && right_prime < N) {
-            rc = CGWriterAlgn_Save(self, read, self->primary, right_prime,
-                                   &read->prim_algn_id[1]);
-            read->prim_is_reverse[1] = self->match[right_prime].ref_orientation;
-            data->map[right_prime].saved = 1;
-        }
-        if (global_cluster_size > 0 && data->map_qty > 1 + (left_prime < N ? 1 : 0) + (right_prime < N ? 1 : 0)) {
-            cluster_mates(data);
-        }
-        for (i = 0; i != N && rc == 0; ++i) {
-            if (data->map[i].saved || self->match[i].mapq < self->min_mapq)
-                continue;
-            rc = CGWriterAlgn_Save(self, read, self->secondary, i, NULL);
-        }
-    }
-    return rc;
-}
-
-rc_t CGWriterAlgn_Write(const CGWriterAlgn* cself, TReadsData* read)
-{
-    assert(cself != NULL);
-    assert(read != NULL);
-    assert(read->seq.sequence.buffer != NULL && read->seq.sequence.elements == CG_READS_SPOT_LEN);
-    
-    memset(read->prim_algn_id, 0, sizeof(read->prim_algn_id));
-    memset(read->align_count, 0, sizeof(read->align_count));
-    memset(read->prim_is_reverse, 0, sizeof(read->prim_is_reverse));
-    
-    return CGWriterAlgn_Write_int((CGWriterAlgn *)cself, read);
-}
-
-#else
-
-rc_t CGWriterAlgn_Write(const CGWriterAlgn* cself, TReadsData* read)
-{
-    if( cself->data.map_qty != 0 ) {
-        /* primary is-found indicator: weights are ASCII-33 so they can't be 0 if found */
-        uint8_t left_weight = 0, right_weight = 0, pair_weight = 0;
-        uint32_t i, left_prim = 0, right_prim = 0, paired = 0;
-
-        CGWriterAlgn* self = (CGWriterAlgn*)cself;
-        TMappingsData* data = &self->data;
-
-        /* find best left, right and pair */
-        for(i = 0; i < data->map_qty; i++) {
-            int k = (data->map[i].flags & cg_eRightHalfDnbMap) ? 1 : 0;
-            if( read->align_count[k] < 254 ) {
-                read->align_count[k]++;
-            }
-            if( k == 0 ) {
-                if( left_weight < data->map[i].weight ) {
-                    left_prim = i;
-                    left_weight = data->map[i].weight;
-                }
-            } else {
-                if( right_weight < data->map[i].weight ) {
-                    right_prim = i;
-                    right_weight = data->map[i].weight;
-                }
-            }
-            if( i != data->map[i].mate && pair_weight < data->map[i].weight ) {
-                if( data->map[i].mate < data->map_qty ) {
-                    /* note pair's left mate id */
-                    paired = k == 0 ? i : data->map[i].mate;
-                    pair_weight = data->map[i].weight;
-                } else {
-                    /* fail safe in case mate id is out of map boundaries */
-                    data->map[i].mate = i;
-                }
-            }
-        }
-        /* choose primary pair */
-        if( left_weight > right_weight && data->map[left_prim].mate != left_prim ) {
-            /* left is better and has a mate -> choose left pair */
-            right_prim = data->map[left_prim].mate;
-            right_weight = data->map[right_prim].weight;
-        } else if( right_weight > left_weight && data->map[right_prim].mate != right_prim ) {
-            /* right is better and has a mate -> choose right pair */
-            left_prim = data->map[right_prim].mate;
-            left_weight = data->map[left_prim].weight;
-        } else if( pair_weight > 0 ) {
-            /* use paired as primary */
-            left_prim = paired;
-            left_weight = data->map[left_prim].weight;
-            right_prim = data->map[left_prim].mate;
-            right_weight = data->map[right_prim].weight;
-        } else if( left_weight > 0 && right_weight > 0 ) {
-            /* force best left and right to be mates */
-            data->map[left_prim].mate = right_prim;
-            data->map[right_prim].mate = left_prim;
-            self->forced_pairs_cnt++;
-            DEBUG_MSG(10, ("forced pair: %u %u\n", left_prim, right_prim));
-        }
-#if _DEBUGGING
-        DEBUG_MSG(10, ("alignment_count [%hu,%hu]", read->align_count[0], read->align_count[1]));
-        DEBUG_MSG(10, (" left primary: "));
-        if( left_weight > 0 ) {
-            DEBUG_MSG(10, ("weight %hu [%c], id %u", left_weight, left_weight, left_prim));
-        } else {
-            DEBUG_MSG(10, ("none"));
-        }
-        DEBUG_MSG(10, ("; right primary: "));
-        if( right_weight > 0 ) {
-            DEBUG_MSG(10, ("weight %hu [%c], id %u", right_weight, right_weight, right_prim));
-        } else {
-            DEBUG_MSG(10, ("none"));
-        }
-        DEBUG_MSG(10, ("\n"));
-#endif
-        assert((left_weight == 0 && read->align_count[0] == 0) || (left_weight > 0 && read->align_count[0] > 0));
-        assert((right_weight == 0 && read->align_count[1] == 0) || (right_weight > 0 && read->align_count[1] > 0));
-
-        /* write left primary */
-        if( rc == 0 && left_weight > 0 ) {
-            rc = CGWriterAlgn_Save(self, read, self->primary, left_prim, &read->prim_algn_id[0]);
-            read->prim_is_reverse[0] = cself->match[left_prim].ref_orientation;
-        }
-        /* write right primary */
-        if( rc == 0 && right_weight > 0 ) {
-            rc = CGWriterAlgn_Save(self, read, self->primary, right_prim, &read->prim_algn_id[1]);
-            read->prim_is_reverse[1] = cself->match[right_prim].ref_orientation;
-        }
-        DEBUG_MSG(10, ("prim_algn_rowid [%li,%li], ", read->prim_algn_id[0], read->prim_algn_id[1]));
-        DEBUG_MSG(10, ("prim_is_reverse [%hu,%hu]\n", read->prim_is_reverse[0], read->prim_is_reverse[1]));
-        if( rc == 0 ) {
-            /* others go to secondary */
-            int64_t row;
-            
-            rc = TableWriterAlgn_GetNextRowId(cself->secondary, &row);
-            if( global_cluster_size > 0  && data->map_qty > 1) {
-                cluster_mates(data);
-            }
-            if( cself->single_mate ) {
-                /* we need to re-mate in case original mate's weight is lower */
-                for(i = 0; rc == 0 && i < data->map_qty; i++ ) {
-                    if( !data->map[i].saved && data->map[i].weight >= cself->min_mapq ) {
-                        uint32_t mate = data->map[i].mate;
-                        if( mate != i && data->map[mate].mate != i ) {
-                            self->dropped_mates_cnt++;
-                            if( data->map[data->map[mate].mate].weight < data->map[i].weight ) {
-                                /* do not save my mate's mate */
-                                DEBUG_MSG(10, ("mate %u dropped as pair of %u\n", data->map[mate].mate, mate));
-                                data->map[data->map[mate].mate].saved = true;
-                                /* repoint mate to me */
-                                data->map[mate].mate = i;
-                            } else {
-                                /* do not save me */
-                                DEBUG_MSG(10, ("mate %u dropped as pair of %u\n", i, mate));
-                                data->map[i].saved = true;
-                            }
-                        }
-                    }
-                }
-            }
-            for(i = 0; rc == 0 && i < data->map_qty; i++ ) {
-                if( !data->map[i].saved && data->map[i].weight >= cself->min_mapq ) {
-                    uint32_t mate = data->map[i].mate;
-                    /* no mate or mate is under-weigth */
-                    if( mate == i || data->map[mate].weight < cself->min_mapq ||
-                       /* or mate was saved in primary */
-                       (left_weight > 0 && mate == left_prim) || (right_weight > 0 && mate == right_prim) ) {
-                        self->match[i].mate_align_id = 0;
-                        rc = CGWriterAlgn_Save(self, read, self->secondary, i, NULL);
-                        row++;
-                    } else {
-                        self->match[mate].mate_align_id = row++;
-                        self->match[i].mate_align_id = row++;
-                        if( (rc = CGWriterAlgn_Save(self, read, self->secondary, i, NULL)) == 0 ) {
-                            rc = CGWriterAlgn_Save(self, read, self->secondary, mate, NULL);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-#endif
diff --git a/tools/cg-load/writer-algn.h b/tools/cg-load/writer-algn.h
deleted file mode 100644
index 6ccb019..0000000
--- a/tools/cg-load/writer-algn.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_writer_algn_h_
-#define _tools_cg_load_writer_algn_h_
-
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/manager.h>
-#include <insdc/insdc.h>
-#include <align/writer-alignment.h>
-#include <align/writer-reference.h>
-
-#include "writer-seq.h"
-
-typedef struct TMappingsData_map_struct {
-    bool saved;
-    uint16_t flags;
-    char chr[CG_CHROMOSOME_NAME];
-    INSDC_coord_zero offset;
-    int16_t gap[CG_READS_NGAPS];
-    uint8_t weight;
-    uint32_t mate;
-} TMappingsData_map;
-
-typedef struct TMappingsData_struct {
-    uint16_t map_qty;
-    TMappingsData_map map[CG_MAPPINGS_MAX];
-} TMappingsData;
-
-typedef struct CGWriterAlgn CGWriterAlgn;
-
-rc_t CGWriterAlgn_Make(const CGWriterAlgn** cself, TMappingsData** data, VDatabase* db, const ReferenceMgr* rmgr,
-                       uint32_t min_mapq, bool single_mate, uint32_t cluster_size);
-
-rc_t CGWriterAlgn_Whack(const CGWriterAlgn* cself, bool commit, uint64_t* rows_1st, uint64_t* rows_2nd);
-
-rc_t CGWriterAlgn_Write(const CGWriterAlgn* cself, TReadsData* read);
-
-#endif /* _tools_cg_load_writer_algn_h_ */
diff --git a/tools/cg-load/writer-evidence-dnbs.c b/tools/cg-load/writer-evidence-dnbs.c
deleted file mode 100644
index 18be548..0000000
--- a/tools/cg-load/writer-evidence-dnbs.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/container.h>
-#include <kfs/file.h>
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <align/writer-alignment.h>
-#include <align/dna-reverse-cmpl.h>
-
-#include "debug.h"
-#include "defs.h"
-#include "writer-evidence-intervals.h"
-#include "writer-evidence-dnbs.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef struct CGWriterEvdDnb_match_struct {
-
-    int64_t seq_spot_id;
-    INSDC_coord_one seq_read_id;
-
-    /* filled out by ReferenceMgr_Compress */
-    INSDC_coord_zero read_start;
-    INSDC_coord_len read_len;
-    bool has_ref_offset[CG_EVDNC_ALLELE_LEN];
-    int32_t ref_offset[CG_EVDNC_ALLELE_LEN];
-    int64_t ref_id;
-    INSDC_coord_zero ref_start;
-    bool has_mismatch[CG_EVDNC_ALLELE_LEN];
-    char mismatch[CG_EVDNC_ALLELE_LEN];
-
-    bool ref_orientation;
-    uint32_t ref_ploidy;
-    uint32_t mapq;
-
-} CGWriterEvdDnb_match;
-
-struct CGWriterEvdDnbs {
-    const ReferenceMgr* rmgr;
-    const TableWriterAlgn* writer;
-
-    TableWriterAlgnData algn;
-    CGWriterEvdDnb_match match;
-    
-    TEvidenceDnbsData data;
-
-    uint64_t bad_allele_index;
-};
-
-rc_t CGWriterEvdDnbs_Make(const CGWriterEvdDnbs** cself, TEvidenceDnbsData** data,
-                          VDatabase* db, const ReferenceMgr* rmgr, const uint32_t options)
-{
-    rc_t rc = 0;
-    CGWriterEvdDnbs* self;
-
-    if( cself == NULL || db == NULL ) {
-        return RC(rcExe, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        if( (rc = TableWriterAlgn_Make(&self->writer, db, ewalgn_tabletype_EvidenceAlignment, ewalgn_co_SEQ_SPOT_ID)) == 0 ) {
-            self->algn.seq_spot_id.buffer = &self->match.seq_spot_id;
-            self->algn.seq_spot_id.elements = 1;
-            self->algn.seq_read_id.buffer = &self->match.seq_read_id;
-            self->algn.seq_read_id.elements = 1;
-
-            self->algn.read_start.buffer = &self->match.read_start;
-            self->algn.read_len.buffer = &self->match.read_len;
-            self->algn.has_ref_offset.buffer = self->match.has_ref_offset;
-            self->algn.ref_offset.buffer = self->match.ref_offset;
-            self->algn.ref_id.buffer = &self->match.ref_id;
-            self->algn.ref_id.elements = 1;
-            self->algn.ref_start.buffer = &self->match.ref_start;
-            self->algn.ref_start.elements = 1;
-            self->algn.has_mismatch.buffer = self->match.has_mismatch;
-            self->algn.mismatch.buffer = self->match.mismatch;
-            self->algn.ref_orientation.buffer = &self->match.ref_orientation;
-            self->algn.ref_orientation.elements = 1;
-            self->algn.ref_ploidy.buffer = &self->match.ref_ploidy;
-            self->algn.ref_ploidy.elements = 1;
-            self->algn.mapq.buffer = &self->match.mapq;
-            self->algn.mapq.elements = 1;
-            self->rmgr = rmgr;
-
-            /* set to 1st row for evidence_interval to collect ids */
-            self->data.last_rowid = 1;
-            *data = &self->data;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        CGWriterEvdDnbs_Whack(self, false, NULL);
-    }
-    return rc;
-}
-
-rc_t CGWriterEvdDnbs_Whack(const CGWriterEvdDnbs* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        CGWriterEvdDnbs* self = (CGWriterEvdDnbs*)cself;
-        if( self->bad_allele_index > 0 ) {
-            PLOGMSG(klogInfo, (klogInfo, "$(bad_allele_index) bad allele_indexes in evidence dnbs",
-                    "bad_allele_index=%lu", self->bad_allele_index));
-        }
-        rc = TableWriterAlgn_Whack(cself->writer, commit, rows);
-        free(self->data.dnbs);
-        free(self);
-    }
-    return rc;
-}
-
-rc_t CGWriterEvdDnbs_SetSEQ(const CGWriterEvdDnbs* cself, uint16_t dnb, const int64_t seq_spot_id_1st)
-{
-    rc_t rc = 0;
-    CGWriterEvdDnbs* self =(CGWriterEvdDnbs*)cself;
-
-    assert(cself != NULL);
-
-    self->data.dnbs[dnb].seq_spot_id = seq_spot_id_1st + self->data.dnbs[dnb].dnb_offset_in_lane_file;
-
-    return rc;
-}
-
-rc_t CGWriterEvdDnbs_Write(const CGWriterEvdDnbs* cself, const TEvidenceIntervalsData* ref, int64_t ref_rowid)
-{
-    rc_t rc = 0;
-    uint16_t i;
-    int64_t last_rowid;
-    CGWriterEvdDnbs* self =(CGWriterEvdDnbs*)cself;
-
-    assert(cself != NULL);
-    assert(ref != NULL);
-
-    for(i = 0; rc == 0 && i < cself->data.qty; i++) {
-
-        /* align against allele */
-        uint16_t ai = cself->data.dnbs[i].allele_index;
-        self->match.ref_ploidy = ref->allele_indexes_to_read_number[ai];
-        if( self->match.ref_ploidy == 0 ) {
-            DEBUG_MSG(3, ("bad allele_index for interval %s %s[%hu]\n", cself->data.dnbs[i].chr, cself->data.interval_id, i + 1));
-            self->bad_allele_index++;
-            continue;
-        } else {
-            const char* read;
-            char reversed[CG_READS_SPOT_LEN];
-            uint32_t read_len = CG_READS_SPOT_LEN / 2;
-
-            if( cself->data.dnbs[i].side == 'L' ) {
-                self->match.seq_read_id = 1;
-                read = cself->data.dnbs[i].read;
-            } else {
-                self->match.seq_read_id = 2;
-                read = &cself->data.dnbs[i].read[read_len];
-            }
-            if( cself->data.dnbs[i].strand == '-' ) {
-                if( (rc = DNAReverseCompliment(read, reversed, read_len)) != 0 ) {
-                    break;
-                }
-                read = reversed;
-                self->match.ref_orientation = true;
-            } else {
-                self->match.ref_orientation = false;
-            }
-            self->algn.ploidy = 0;
-            if( (rc = ReferenceMgr_Compress(cself->rmgr, 0, cself->data.dnbs[i].chr,
-                                            cself->data.dnbs[i].offset_in_reference, read, read_len,
-                                            cself->data.dnbs[i].allele_alignment, cself->data.dnbs[i].allele_alignment_length,
-                                            ref->offset,
-                                            ref->allele[ai], ref->allele_length[ai],
-					    cself->data.dnbs[i].offset_in_allele,
-                                            ref->allele_alignment[ai], ref->allele_alignment_length[ai],
-                                            &self->algn)) == 0 ) {
-                self->match.mapq = cself->data.dnbs[i].mapping_quality - 33;
-                /* pointer to SEQUENCE table spot and read */
-                self->match.seq_spot_id = cself->data.dnbs[i].seq_spot_id;
-                self->match.ref_id = ref_rowid;
-                self->match.ref_start = cself->data.dnbs[i].offset_in_allele;
-                DEBUG_MSG(3, ("REF_ID: %li, REF_START: %i, REF_PLOIDY: %hu\n",
-                    self->match.ref_id, self->match.ref_start, self->match.ref_ploidy));
-                rc = TableWriterAlgn_Write(cself->writer, &self->algn, &last_rowid);
-		if( rc == 0 && self->data.last_rowid++ != last_rowid ) {
-		    rc = RC(rcExe, rcTable, rcWriting, rcData, rcInconsistent);
-		}
-            } else if( GetRCObject(rc) == rcOffset && GetRCState(rc) == rcOutofrange ) {
-                PLOGERR(klogErr, (klogErr, rc, "evidence dnb for $(chr) interval $(interval) OffsetInReference $(offset) skipped",
-                    "chr=%s,interval=%s,offset=%i", ref->chr, ref->interval_id, cself->data.dnbs[i].offset_in_reference));
-                rc = 0;
-            }
-        }
-    }
-    return rc;
-}
diff --git a/tools/cg-load/writer-evidence-dnbs.h b/tools/cg-load/writer-evidence-dnbs.h
deleted file mode 100644
index 6c9014b..0000000
--- a/tools/cg-load/writer-evidence-dnbs.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_writer_evidence_dnbs_h_
-#define _tools_cg_load_writer_evidence_dnbs_h_
-
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <sra/sradb.h>
-
-#include "defs.h"
-#include "factory-cmn.h"
-
-typedef struct TEvidenceDnbsData_dnb_struct {
-
-    /* translated:
-       slide+lane+file_num_in_lane+dnb_offset_in_lane_file --> SEQ_SPOT_ID */
-    int64_t seq_spot_id;
-
-    char chr[CG_CHROMOSOME_NAME];
-    char slide[CG_SLIDE];
-    char lane[CG_LANE];
-    CGFIELD15_BATCH_FILE_NUMBER file_num_in_lane;
-    uint64_t dnb_offset_in_lane_file; /* zero-based */
-    uint16_t allele_index;
-    char side;
-    char strand;
-    INSDC_coord_zero offset_in_allele;
-    char allele_alignment[CG_EVDNC_ALLELE_CIGAR_LEN];
-    /* strlen for allele_alignment[] buffer */
-    size_t allele_alignment_length;
-    uint8_t mapping_quality;
-    INSDC_coord_zero offset_in_reference;
-    /* moved into reading function since it is not used after reading anyway
-    char reference_alignment[CG_EVDNC_ALLELE_CIGAR_LEN];
-    INSDC_coord_zero mate_offset_in_reference;
-    char mate_reference_alignment[CG_EVDNC_ALLELE_CIGAR_LEN];
-    uint16_t score_allele[3];*/
-    char read[CG_EVDNC_SPOT_LEN];
-    size_t read_len;
-    /*char qual[CG_EVDNC_SPOT_LEN];
-    */
-} TEvidenceDnbsData_dnb;
-
-typedef struct TEvidenceDnbsData {
-    char interval_id[CG_EVDNC_INTERVALID_LEN];
-    uint16_t qty;
-    uint16_t max_qty;
-    TEvidenceDnbsData_dnb* dnbs;
-    int64_t last_rowid; /* last used rowid in this table */
-} TEvidenceDnbsData;
-
-typedef struct CGWriterEvdDnbs CGWriterEvdDnbs;
-
-struct TEvidenceIntervalsData;
-
-rc_t CGWriterEvdDnbs_Make(const CGWriterEvdDnbs** cself, TEvidenceDnbsData** data,
-                          VDatabase* db, const ReferenceMgr* rmgr, const uint32_t options);
-
-rc_t CGWriterEvdDnbs_Whack(const CGWriterEvdDnbs* cself, bool commit, uint64_t* rows);
-
-rc_t CGWriterEvdDnbs_SetSEQ(const CGWriterEvdDnbs* cself, uint16_t dnb, const int64_t seq_spot_id_1st);
-
-rc_t CGWriterEvdDnbs_Write(const CGWriterEvdDnbs* cself, const struct TEvidenceIntervalsData* ref, int64_t ref_rowid);
-
-#endif /* _tools_cg_load_writer_evidence_dnbs_h_ */
diff --git a/tools/cg-load/writer-evidence-intervals.c b/tools/cg-load/writer-evidence-intervals.c
deleted file mode 100644
index 070cfc7..0000000
--- a/tools/cg-load/writer-evidence-intervals.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/printf.h>
-#include <kfs/file.h>
-#include <vdb/table.h>
-
-#include "defs.h"
-#include "writer-evidence-intervals.h"
-#include "writer-evidence-dnbs.h"
-#include "debug.h"
-#include "file.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef struct CGWriterEvdInt_match_struct {
-
-    /* filled out by ReferenceMgr_Compress */
-    INSDC_coord_zero read_start[CG_EVDNC_PLOIDY];
-    INSDC_coord_len read_len[CG_EVDNC_PLOIDY];
-    bool has_ref_offset[CG_EVDNC_ALLELE_LEN];
-    int32_t ref_offset[CG_EVDNC_ALLELE_LEN];
-    bool has_mismatch[CG_EVDNC_ALLELE_LEN];
-    char mismatch[CG_EVDNC_ALLELE_LEN];
-    int64_t ref_id;
-    INSDC_coord_zero ref_start;
-    bool ref_orientation;
-    uint32_t mapq;
-
-} CGWriterEvdInt_match;
-
-struct CGWriterEvdInt {
-    const ReferenceMgr* rmgr;
-    const TableWriterAlgn* writer;
-    TableWriterAlgnData algn;
-    TEvidenceIntervalsData data;
-    CGWriterEvdInt_match match;
-    int64_t* dnbs_ids;
-    uint64_t dnbs_ids_max;
-};
-
-rc_t CGWriterEvdInt_Make(const CGWriterEvdInt** cself, TEvidenceIntervalsData** data,
-                         VDatabase* db, const ReferenceMgr* rmgr, const uint32_t options)
-{
-    rc_t rc = 0;
-    CGWriterEvdInt* self;
-
-    if( cself == NULL || db == NULL ) {
-        return RC(rcExe, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        if( (rc = TableWriterAlgn_Make(&self->writer, db, ewalgn_tabletype_EvidenceInterval, 0)) == 0 ) {
-            self->algn.read_start.buffer = &self->match.read_start;
-            self->algn.read_len.buffer = &self->match.read_len;
-            self->algn.has_ref_offset.buffer = self->match.has_ref_offset;
-            self->algn.ref_offset.buffer = self->match.ref_offset;
-            self->algn.has_mismatch.buffer = self->match.has_mismatch;
-            self->algn.mismatch.buffer = self->match.mismatch;
-            self->algn.ref_id.buffer = &self->match.ref_id;
-            self->algn.ref_id.elements = 1;
-            self->algn.ref_start.buffer = &self->match.ref_start;
-            self->algn.ref_start.elements = 1;
-            self->match.ref_orientation = false;
-            self->algn.ref_orientation.buffer = &self->match.ref_orientation;
-            self->algn.ref_orientation.elements = 1;
-            self->algn.mapq.buffer = &self->match.mapq;
-            self->algn.mapq.elements = 1;
-            self->algn.alingment_ids.buffer = self->dnbs_ids;
-            self->rmgr = rmgr;
-            *data = &self->data;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        CGWriterEvdInt_Whack(self, false, NULL);
-    }
-    return rc;
-}
-
-rc_t CGWriterEvdInt_Whack(const CGWriterEvdInt* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        CGWriterEvdInt* self = (CGWriterEvdInt*)cself;
-        rc = TableWriterAlgn_Whack(cself->writer, commit, rows);
-        free(self->dnbs_ids);
-        free(self);
-    }
-    return rc;
-}
-
-rc_t CGWriterEvdInt_Write(const CGWriterEvdInt* cself, const TEvidenceDnbsData* dnbs, int64_t* rowid)
-{
-    rc_t rc = 0;
-    CGWriterEvdInt* self = (CGWriterEvdInt*)cself;
-    
-    assert(cself != NULL);
-
-    memset(self->data.allele_indexes_to_read_number, 0, sizeof(self->data.allele_indexes_to_read_number));
-    if( self->data.ploidy == 1 ) {
-
-        uint32_t i = self->data.allele_indexes[0] - '0';
-
-        if( self->data.allele_indexes[1] != '\0' || i > 2 ) {
-            rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcOutofrange);
-        } else if( self->data.allele_alignment_length[i] == 0 ) {
-            rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcEmpty);
-        } else {
-            if( i == 0 ) {
-                rc = string_printf(self->data.allele_alignment[0], sizeof(self->data.allele_alignment[0]),
-                                   &self->data.allele_alignment_length[0], "%uM", self->data.length);
-            }
-            if( rc == 0 ) {
-                self->algn.ploidy = 0;
-                rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i], self->data.allele_length[i],
-                                           self->data.allele_alignment[i], self->data.allele_alignment_length[i],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-                self->data.allele_indexes_to_read_number[i] = 1; /* 1st read */
-            }
-        }
-
-    } else if( self->data.ploidy == 2 ) {  /** possibilities: 0;1 1;2 and 1;1 - single ploidy but recorded as dual **/
-        uint32_t i1 = self->data.allele_indexes[0] - '0';
-        uint32_t i2 = self->data.allele_indexes[2] - '0';
-
-        if( self->data.allele_indexes[1] != ';' || self->data.allele_indexes[3] != '\0' || i1 > 2 || i2 > 2) {
-            rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcOutofrange);
-        } else {
-            if( i1 == 0 || i2 == 0 ) {
-                rc = string_printf(self->data.allele_alignment[0], sizeof(self->data.allele_alignment[0]),
-                                   &self->data.allele_alignment_length[0], "%uM", self->data.length);
-            }
-            if( self->data.allele_alignment_length[i1] == 0 || self->data.allele_alignment_length[i2] == 0 ) {
-                rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcEmpty);
-            }
-            if( rc == 0 ) {
-                self->algn.ploidy = 0;
-                rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i1], self->data.allele_length[i1],
-                                           self->data.allele_alignment[i1], self->data.allele_alignment_length[i1],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-                self->data.allele_indexes_to_read_number[i1] = 1; /* 1st read */
-            }
-            if( rc == 0 ) {
-		if ( i2 != i1 ) {
-			rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i2], self->data.allele_length[i2],
-                                           self->data.allele_alignment[i2], self->data.allele_alignment_length[i2],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-			self->data.allele_indexes_to_read_number[i2] = 2; /* 2nd read */
-		} else {
-			self->data.ploidy = 1;
-		}
-            }
-        }
-
-    }  else if( self->data.ploidy == 3 ) { /** possibilities: 0;1;2 1;2;3 **/
-        uint32_t i1 = self->data.allele_indexes[0] - '0';
-        uint32_t i2 = self->data.allele_indexes[2] - '0';
-        uint32_t i3 = self->data.allele_indexes[4] - '0';
-
-
-        if( self->data.allele_indexes[1] != ';'  || self->data.allele_indexes[3] != ';' || self->data.allele_indexes[5] != '\0' || i1 > 3 || i2 > 3 || i3 > 3) {
-            rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcOutofrange);
-        } else {
-            if( i1 == 0 || i2 == 0 || i3 == 0) {
-                rc = string_printf(self->data.allele_alignment[0], sizeof(self->data.allele_alignment[0]),
-                                   &self->data.allele_alignment_length[0], "%uM", self->data.length);
-            }
-            if( self->data.allele_alignment_length[i1] == 0 || self->data.allele_alignment_length[i2] == 0 || self->data.allele_alignment_length[i3]==0) {
-                rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcEmpty);
-            }
-            if( rc == 0 ) {
-                self->algn.ploidy = 0;
-                rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i1], self->data.allele_length[i1],
-                                           self->data.allele_alignment[i1], self->data.allele_alignment_length[i1],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-                self->data.allele_indexes_to_read_number[i1] = 1; /* 1st read */
-            }
-            if( rc == 0 ) {
-                rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i2], self->data.allele_length[i2],
-                                           self->data.allele_alignment[i2], self->data.allele_alignment_length[i2],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-                self->data.allele_indexes_to_read_number[i2] = 2; /* 2nd read */
-            }
-            if( rc == 0 ) {
-                rc = ReferenceMgr_Compress(cself->rmgr, ewrefmgr_cmp_Exact, self->data.chr, self->data.offset, self->data.allele[i3], self->data.allele_length[i3],
-                                           self->data.allele_alignment[i3], self->data.allele_alignment_length[i3],
-                                           0, NULL, 0, 0, NULL, 0, &self->algn);
-                self->data.allele_indexes_to_read_number[i3] = 3; /* 3rd read */
-            }
-        }
-
-    } else {
-        rc = RC(rcExe, rcFormatter, rcWriting, rcData, rcUnrecognized);
-    }
-    if( rc == 0 ) { /*** a bit careful here - were are predicting what EvidenceDnb writer will do ***/
-	uint32_t i,valid_qty;
-	for(valid_qty = i = 0;i< dnbs->qty;i++){
-		if(self->data.allele_indexes_to_read_number[dnbs->dnbs[i].allele_index] > 0){
-			valid_qty++;
-		}
-	}
-        if( self->dnbs_ids_max < valid_qty ) {
-            void* p = realloc(self->dnbs_ids, sizeof(*(self->dnbs_ids)) * valid_qty);
-            if( p == NULL ) {
-                rc = RC(rcExe, rcFormatter, rcWriting, rcMemory, rcExhausted);
-            } else {
-                self->dnbs_ids = p;
-                self->dnbs_ids_max = valid_qty;
-                self->algn.alingment_ids.buffer = self->dnbs_ids;
-            }
-        }
-        if( rc == 0 ) {
-            self->algn.alingment_ids.elements = valid_qty;
-	    for(i=0;i<valid_qty;i++){
-		self->dnbs_ids[i] = dnbs->last_rowid + i;
-            }
-        }
-    }
-    if( rc == 0 ) {
-        self->match.mapq = self->data.score;
-        rc = TableWriterAlgn_Write(self->writer, &self->algn, rowid);
-    }
-    return rc;
-}
diff --git a/tools/cg-load/writer-evidence-intervals.h b/tools/cg-load/writer-evidence-intervals.h
deleted file mode 100644
index 7a8f586..0000000
--- a/tools/cg-load/writer-evidence-intervals.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_writer_evidence_intervals
-#define _tools_cg_load_writer_evidence_intervals
-
-#include <vdb/database.h>
-#include <vdb/manager.h>
-#include <insdc/insdc.h>
-
-#include "defs.h"
-#include <align/writer-alignment.h>
-#include <align/writer-reference.h>
-
-typedef struct TEvidenceIntervalsData {
-    char interval_id[CG_EVDNC_INTERVALID_LEN];
-    char chr[CG_CHROMOSOME_NAME];
-    INSDC_coord_zero offset;
-    INSDC_coord_len length;
-    uint16_t ploidy;
-    char allele_indexes[16];
-    /* translation from allele_indexes into read id for use in dnbs */
-    uint8_t allele_indexes_to_read_number[CG_EVDNC_ALLELE_NUM];
-    int32_t score;
-    int32_t scoreVAF;
-    int32_t scoreEAF;
-    char allele[CG_EVDNC_ALLELE_NUM][CG_EVDNC_ALLELE_LEN];
-    /* strlen for allele[3][] buffers */
-    size_t allele_length[CG_EVDNC_ALLELE_NUM];
-    char allele_alignment[CG_EVDNC_ALLELE_NUM][CG_EVDNC_ALLELE_CIGAR_LEN];
-    /* strlen for allele_alignment[3][] buffers */
-    size_t allele_alignment_length[CG_EVDNC_ALLELE_NUM];
-} TEvidenceIntervalsData;
-
-typedef struct CGWriterEvdInt CGWriterEvdInt;
-
-struct TEvidenceDnbsData;
-
-rc_t CGWriterEvdInt_Make(const CGWriterEvdInt** cself, TEvidenceIntervalsData** data,
-                         VDatabase* db, const ReferenceMgr* rmgr, const uint32_t options);
-
-rc_t CGWriterEvdInt_Whack(const CGWriterEvdInt* cself, bool commit, uint64_t* rows);
-
-rc_t CGWriterEvdInt_Write(const CGWriterEvdInt* cself, const struct TEvidenceDnbsData* dnbs, int64_t* rowid);
-
-#endif /* _tools_cg_load_writer_evidence_intervals */
diff --git a/tools/cg-load/writer-seq.c b/tools/cg-load/writer-seq.c
deleted file mode 100644
index 43b34bd..0000000
--- a/tools/cg-load/writer-seq.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <insdc/insdc.h>
-
-#include "debug.h"
-#include "defs.h"
-#include "writer-seq.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-const INSDC_SRA_platform_id DFTL_platform = SRA_PLATFORM_COMPLETE_GENOMICS;
-const char DFTL_label[] = "LeftRight";
-const INSDC_coord_zero DFTL_label_start[CG_READS_NREADS] = {0, 4};
-const INSDC_coord_len DFTL_label_len[CG_READS_NREADS] =    {4, 5};
-const INSDC_coord_zero DFTL_read_start[CG_READS_NREADS] =  {0, 35};
-const INSDC_coord_len DFTL_read_len[CG_READS_NREADS] =    {35, 35};
-const INSDC_SRA_read_filter DFTL_read_filter[CG_READS_NREADS] =  {SRA_READ_FILTER_PASS, SRA_READ_FILTER_PASS};
-
-struct CGWriterSeq {
-    const TableWriterSeq* base;
-    TReadsData data;
-};
-
-rc_t CGWriterSeq_Make(const CGWriterSeq** cself, TReadsData** data, VDatabase* db, const uint32_t options, const char* quality_quantization)
-{
-    rc_t rc = 0;
-    CGWriterSeq* self;
-
-    if( cself == NULL || db == NULL ) {
-        return RC(rcExe, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        TableWriterData p;
-        p.buffer = &DFTL_platform;
-        p.elements = 1;
-        if( (rc = TableWriterSeq_Make(&self->base, db, options | ewseq_co_AlignData | ewseq_co_SpotGroup, quality_quantization)) != 0 ) {
-            LOGERR(klogErr, rc, "sequence table");
-        } else if( (rc = TableWriteSeq_WriteDefault(self->base, ewseq_cn_PLATFORM, &p)) == 0 ) {
-            /* attach data pointer to data */
-            self->data.seq.nreads = CG_READS_NREADS;
-            self->data.seq.alignment_count.buffer = self->data.align_count;
-            self->data.seq.alignment_count.elements = CG_READS_NREADS;
-            self->data.seq.primary_alignment_id.buffer = self->data.prim_algn_id;
-            self->data.seq.primary_alignment_id.elements = CG_READS_NREADS;
-            self->data.seq.sequence.buffer = self->data.read;
-            self->data.seq.quality.buffer = self->data.qual;
-            self->data.seq.label.buffer = DFTL_label;
-            self->data.seq.label.elements = sizeof(DFTL_label) - 1;
-            self->data.seq.label_start.buffer = DFTL_label_start;
-            self->data.seq.label_start.elements = CG_READS_NREADS;
-            self->data.seq.label_len.buffer = DFTL_label_len;
-            self->data.seq.label_len.elements = CG_READS_NREADS;
-            self->data.seq.read_type.buffer = self->data.read_type;
-            self->data.seq.read_type.elements = CG_READS_NREADS;
-            self->data.seq.read_start.buffer = DFTL_read_start;
-            self->data.seq.read_start.elements = CG_READS_NREADS;
-            self->data.seq.read_len.buffer = DFTL_read_len;
-            self->data.seq.read_len.elements = CG_READS_NREADS;
-            self->data.seq.read_filter.buffer = DFTL_read_filter;
-            self->data.seq.read_filter.elements = CG_READS_NREADS;
-
-            /* set to 1st row for aligment to refer */
-            self->data.rowid = 1;
-            *data = &self->data;
-        }
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        CGWriterSeq_Whack(self, false, NULL);
-    }
-    return rc;
-}
-
-rc_t CGWriterSeq_Whack(const CGWriterSeq* cself, bool commit, uint64_t* rows)
-{
-    rc_t rc = 0;
-    if( cself != NULL ) {
-        CGWriterSeq* self = (CGWriterSeq*)cself;
-        rc = TableWriterSeq_Whack(cself->base, commit, rows);
-        free(self);
-    }
-    return rc;
-}
-
-rc_t CGWriterSeq_Write(const CGWriterSeq* cself)
-{
-    uint64_t i;
-    int64_t r;
-    rc_t rc;
-    INSDC_quality_phred* b;
-    CGWriterSeq* self = (CGWriterSeq*)cself;
-
-    assert(cself != NULL);
-
-    b = (INSDC_quality_phred*)(self->data.seq.quality.buffer);
-    for(i = 0; i < cself->data.seq.quality.elements; i++ ) {
-        b[i] -= 33;
-    }
-    for(i = 0; i < CG_READS_NREADS; i++) {
-        self->data.read_type[i] = SRA_READ_TYPE_BIOLOGICAL |
-            (cself->data.prim_is_reverse[i] ? SRA_READ_TYPE_REVERSE : SRA_READ_TYPE_FORWARD);
-    }
-    rc = TableWriterSeq_Write(cself->base, &cself->data.seq, &r);
-    return rc ? rc : (self->data.rowid++ == r ? 0 : RC(rcExe, rcTable, rcWriting, rcData, rcInconsistent));
-}
diff --git a/tools/cg-load/writer-seq.h b/tools/cg-load/writer-seq.h
deleted file mode 100644
index b9a1da7..0000000
--- a/tools/cg-load/writer-seq.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_cg_load_writer_seq_h_
-#define _tools_cg_load_writer_seq_h_
-
-#include <insdc/insdc.h>
-#include <vdb/database.h>
-#include <sra/sradb.h>
-#include <align/writer-sequence.h>
-
-typedef struct TReadsData_struct {
-    uint16_t flags;
-    char read[CG_READS_SPOT_LEN + 1];
-    char qual[CG_READS_SPOT_LEN + 1];
-
-    /* reverse read cache by half-dnb */
-    INSDC_dna_text reverse[CG_READS_SPOT_LEN];
-
-    TableWriterSeqData seq;
-    int64_t rowid;
-    uint8_t align_count[CG_READS_NREADS];
-    int64_t prim_algn_id[CG_READS_NREADS];
-    bool prim_is_reverse[CG_READS_NREADS];
-    SRAReadTypes read_type[CG_READS_NREADS];
-} TReadsData;
-
-typedef struct CGWriterSeq CGWriterSeq;
-
-rc_t CGWriterSeq_Make(const CGWriterSeq** cself, TReadsData** data, VDatabase* db, const uint32_t options, const char* quality_quantization);
-
-rc_t CGWriterSeq_Whack(const CGWriterSeq* cself, bool commit, uint64_t* rows);
-
-rc_t CGWriterSeq_Write(const CGWriterSeq* cself);
-
-#endif /* _tools_cg_load_writer_seq_h_ */
diff --git a/tools/fastq-loader/Makefile b/tools/fastq-loader/Makefile
deleted file mode 100644
index 8f7c286..0000000
--- a/tools/fastq-loader/Makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/fastq-loader
-
-INT_LIBS = \
-	libfastqloader
-
-ALL_LIBS = \
-	$(INT_LIBS) \
-	$(EXT_LIBS)
-
-EXT_TOOLS = \
-    latf-load
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)    
-
-include $(TOP)/build/Makefile.env
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes 
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(INT_LIBS): vers-includes
-	@ $(MAKE_CMD) $(ILIBDIR)/$@
-
-$(EXT_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@    
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-.PHONY: all std $(ALL_LIBS) 
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(ILIBDIR)/,$(INT_LIBS)) \
-	$(addprefix $(LIBDIR)/,$(EXT_LIBS)) \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-INTERM_SRC = \
-	$(SRCDIR)/fastq-lex.c \
-	$(SRCDIR)/fastq-grammar.c \
-	$(SRCDIR)/fastq-tokens.h 
-
-clean: stdclean
-
-.PHONY: clean
-
-.PRECIOUS: $(INTERM_SRC)
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_LIBS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_LIBS))
-
-#-------------------------------------------------------------------------------
-# fastq
-#
-$(ILIBDIR)/libfastqloader: $(ILIBDIR)/libfastqloader.$(LIBX)
-
-FASTQ_SRC = \
-    fastq-reader \
-	fastq-grammar \
-	fastq-lex
-
-$(SRCDIR)/fastq-grammar.c $(SRCDIR)/fastq-tokens.h: $(SRCDIR)/fastq-grammar.y
-	$(YACC) -o $(SRCDIR)/fastq-grammar.c --defines=$(SRCDIR)/fastq-tokens.h -v $^
-
-FASTQ_OBJ = \
-	$(addsuffix .$(LOBX),$(FASTQ_SRC))
-
-FASTQ_LIB = \
-    -lload \
-    -lloader \
-	-dkfs \
-	-dklib \
-
-ifneq (win,$(OS))
-    FASTQ_LIB += -dkq
-endif
-
-$(ILIBDIR)/libfastqloader.$(SHLX): $(INTERM_SRC) $(FASTQ_OBJ)
-	$(LD) --dlib -o $@ $^ $(FASTQ_LIB)
-
-$(ILIBDIR)/libfastqloader.$(LIBX): $(INTERM_SRC) $(FASTQ_OBJ)
-	$(LD) --slib -o $@ $^ $(FASTQ_LIB)
-
-#------------------------------------------------------------------------------
-# fastq-load.3
-#
-FASTQ_LOAD_SRC = \
-	fastq-loader \
-    loader-imp \
-	$(FASTQ_SRC)
-
-FASTQ_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(FASTQ_LOAD_SRC))
-
-FASTQ_LOADER_LIB = \
-	-lkapp \
-    -lloader \
-    -lload \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/latf-load: $(FASTQ_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR)/latf-load.vers -o $@ $^ $(FASTQ_LOADER_LIB)
-
diff --git a/tools/fastq-loader/fastq-grammar.c b/tools/fastq-loader/fastq-grammar.c
deleted file mode 100644
index 66d32fd..0000000
--- a/tools/fastq-loader/fastq-grammar.c
+++ /dev/null
@@ -1,2129 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
-
-/* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
-   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 3 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, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "2.5"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names.  */
-#define yyparse         FASTQ_parse
-#define yylex           FASTQ_lex
-#define yyerror         FASTQ_error
-#define yylval          FASTQ_lval
-#define yychar          FASTQ_char
-#define yydebug         FASTQ_debug
-#define yynerrs         FASTQ_nerrs
-
-
-/* Copy the first part of user declarations.  */
-
-  
-    #include <sysalloc.h>
-    #include <ctype.h>
-    #include <stdlib.h>
-    #include <string.h>
-
-    #include "fastq-parse.h"
-
-    #define YYSTYPE FASTQToken
-    #define YYLEX_PARAM pb->scanner
-    #define YYDEBUG 1
-
-    #include "fastq-tokens.h"
-
-    static void AddQuality(FASTQParseBlock* pb, const FASTQToken* token);
-    static void SetReadNumber(FASTQParseBlock* pb, const FASTQToken* token);
-    static void GrowTagLine(FASTQParseBlock* pb, const FASTQToken* token);
-    static void StopSpotName(FASTQParseBlock* pb);
-    static void SetSpotGroup(FASTQParseBlock* pb, const FASTQToken* token);
-    static void SetRead(FASTQParseBlock* pb, const FASTQToken* token);
-
-    #define UNLEX do { if (yychar != YYEMPTY && yychar != YYEOF) FASTQ_unlex(pb, & yylval); } while (0)
-
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 1
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     fqENDOFTEXT = 0,
-     fqNUMBER = 258,
-     fqALPHANUM = 259,
-     fqWS = 260,
-     fqENDLINE = 261,
-     fqBASESEQ = 262,
-     fqCOLORSEQ = 263,
-     fqTOKEN = 264,
-     fqASCQUAL = 265,
-     fqUNRECOGNIZED = 266
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-/* Copy the second part of user declarations.  */
-
-
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
-#endif
-{
-  return yyi;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef EXIT_SUCCESS
-#      define EXIT_SUCCESS 0
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
-       && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef EXIT_SUCCESS
-#    define EXIT_SUCCESS 0
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss_alloc;
-  YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
-#  endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  24
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   90
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  22
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  52
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  89
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  131
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   266
-
-#define YYTRANSLATE(YYX)						\
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,    18,     2,     2,     2,     2,
-       2,     2,     2,    21,     2,    16,    17,    19,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
-       2,    20,    14,     2,    13,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,    15,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     6,     8,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    46,    50,    52,
-      54,    57,    59,    63,    68,    72,    75,    78,    80,    82,
-      83,    87,    88,    93,    94,    98,    99,   104,   106,   108,
-     110,   113,   114,   118,   120,   122,   125,   128,   131,   134,
-     137,   140,   141,   145,   146,   150,   151,   153,   154,   158,
-     159,   163,   164,   169,   170,   174,   175,   180,   181,   182,
-     183,   184,   185,   186,   200,   202,   204,   205,   207,   210,
-     213,   216,   219,   222,   226,   231,   233,   236,   239,   243
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      23,     0,    -1,    37,    70,    -1,    37,    -1,    70,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,     4,    24,    12,    25,     3,    26,    12,    27,     3,
-      28,    12,    29,     3,    30,    12,    31,     3,    32,    12,
-      33,    46,    12,    34,    72,    -1,     4,     1,    36,    -1,
-      35,    -1,     0,    -1,    36,    35,    -1,     6,    -1,    38,
-      36,    39,    -1,    38,    36,     1,    36,    -1,     1,    36,
-      39,    -1,    13,    47,    -1,    14,    47,    -1,    40,    -1,
-      43,    -1,    -1,     7,    41,    36,    -1,    -1,    40,     7,
-      42,    36,    -1,    -1,     8,    44,    36,    -1,    -1,    43,
-       8,    45,    36,    -1,     7,    -1,     8,    -1,    48,    -1,
-      48,    54,    -1,    -1,    50,    49,    51,    -1,     4,    -1,
-       3,    -1,    50,    15,    -1,    50,    16,    -1,    50,    17,
-      -1,    50,    12,    -1,    50,     4,    -1,    50,     3,    -1,
-      -1,    18,    52,     3,    -1,    -1,    18,    53,     4,    -1,
-      -1,    58,    -1,    -1,     5,    55,    61,    -1,    -1,     5,
-      56,    69,    -1,    -1,    54,     5,    57,    69,    -1,    -1,
-      19,    59,     3,    -1,    -1,    58,    19,    60,     4,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,     3,    62,    12,    63,
-       4,    64,    12,    65,     3,    66,    12,    67,    68,    -1,
-       4,    -1,     3,    -1,    -1,     4,    -1,    69,     3,    -1,
-      69,     4,    -1,    69,    15,    -1,    69,    19,    -1,    69,
-      20,    -1,    71,    36,    72,    -1,    71,    36,     1,    36,
-      -1,    21,    -1,    71,     9,    -1,    73,    36,    -1,    72,
-      73,    36,    -1,    10,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_uint8 yyrline[] =
-{
-       0,    71,    71,    73,    75,    77,    78,    79,    80,    81,
-      82,    83,    84,    85,    86,    88,    77,    91,    93,    97,
-      98,   102,   106,   107,   108,   112,   113,   117,   118,   122,
-     122,   124,   124,   129,   129,   131,   131,   136,   137,   142,
-     143,   147,   147,   152,   153,   154,   155,   156,   157,   158,
-     159,   163,   163,   165,   165,   167,   171,   172,   172,   174,
-     174,   176,   176,   181,   180,   192,   192,   197,   198,   199,
-     200,   201,   202,   197,   206,   207,   208,   212,   213,   214,
-     215,   216,   217,   223,   224,   228,   229,   233,   234,   237
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "fqENDOFTEXT", "error", "$undefined", "fqNUMBER", "fqALPHANUM", "fqWS",
-  "fqENDLINE", "fqBASESEQ", "fqCOLORSEQ", "fqTOKEN", "fqASCQUAL",
-  "fqUNRECOGNIZED", "':'", "'@'", "'>'", "'_'", "'-'", "'.'", "'#'", "'/'",
-  "'='", "'+'", "$accept", "sequence", "$@1", "$@2", "$@3", "$@4", "$@5",
-  "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "endfile", "endline",
-  "readLines", "header", "read", "baseRead", "$@12", "$@13", "csRead",
-  "$@14", "$@15", "inlineRead", "tagLine", "nameSpotGroup", "$@16", "name",
-  "spotGroup", "$@17", "$@18", "readNumberOrTail", "$@19", "$@20", "$@21",
-  "readNumber", "$@22", "$@23", "casava1_8", "$@24", "$@25", "$@26",
-  "$@27", "$@28", "$@29", "indexSequence", "tail", "qualityLines",
-  "qualityHeader", "quality", "qualityLine", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,    58,    64,    62,    95,    45,    46,    35,    47,
-      61,    43
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    22,    23,    23,    23,    24,    25,    26,    27,    28,
-      29,    30,    31,    32,    33,    34,    23,    23,    23,    35,
-      35,    36,    37,    37,    37,    38,    38,    39,    39,    41,
-      40,    42,    40,    44,    43,    45,    43,    46,    46,    47,
-      47,    49,    48,    50,    50,    50,    50,    50,    50,    50,
-      50,    52,    51,    53,    51,    51,    54,    55,    54,    56,
-      54,    57,    54,    59,    58,    60,    58,    62,    63,    64,
-      65,    66,    67,    61,    68,    68,    68,    69,    69,    69,
-      69,    69,    69,    70,    70,    71,    71,    72,    72,    73
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     2,     1,     1,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,    24,     3,     1,     1,
-       2,     1,     3,     4,     3,     2,     2,     1,     1,     0,
-       3,     0,     4,     0,     3,     0,     4,     1,     1,     1,
-       2,     0,     3,     1,     1,     2,     2,     2,     2,     2,
-       2,     0,     3,     0,     3,     0,     1,     0,     3,     0,
-       3,     0,     4,     0,     3,     0,     4,     0,     0,     0,
-       0,     0,     0,    13,     1,     1,     0,     1,     2,     2,
-       2,     2,     2,     3,     4,     1,     2,     2,     3,     1
-};
-
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,    19,     0,     0,    21,     0,     0,    85,     0,    18,
-       0,     3,     0,     4,     0,     0,     0,     0,    44,    43,
-      25,    39,    41,    26,     1,    20,     2,     0,    86,     0,
-      29,    33,    24,    27,    28,    17,     6,    57,    63,    40,
-      56,    50,    49,    48,    45,    46,    47,    55,     0,    22,
-       0,    89,    83,     0,     0,     0,    31,    35,     0,     0,
-       0,     0,    61,    65,    51,    42,    23,    84,     0,    87,
-      30,    34,     0,     0,     7,    67,    58,    77,    60,    64,
-       0,     0,     0,     0,    88,    32,    36,     0,     0,    78,
-      79,    80,    81,    82,    62,    66,    52,    54,     8,    68,
-       0,     0,     9,    69,     0,     0,    10,    70,     0,     0,
-      11,    71,     0,     0,    12,    72,     0,    76,    13,    75,
-      74,    73,     0,    14,     0,    37,    38,     0,    15,     0,
-      16
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int16 yydefgoto[] =
-{
-      -1,     8,    17,    58,    87,   100,   104,   108,   112,   116,
-     122,   124,   129,     9,    10,    11,    12,    32,    33,    54,
-      72,    34,    55,    73,   127,    20,    21,    47,    22,    65,
-      82,    83,    39,    59,    60,    80,    40,    61,    81,    76,
-      88,   101,   105,   109,   113,   117,   121,    78,    13,    14,
-      52,    53
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -53
-static const yytype_int8 yypact[] =
-{
-       3,   -53,     6,     9,   -53,    34,    34,   -53,    23,   -53,
-       2,     8,     6,   -53,    16,    35,     6,    19,   -53,   -53,
-     -53,     1,    24,   -53,   -53,   -53,   -53,    25,   -53,     4,
-     -53,   -53,   -53,    39,    40,   -53,   -53,    51,   -53,    52,
-      37,   -53,   -53,   -53,   -53,   -53,   -53,    42,     6,   -53,
-       6,   -53,    48,     6,     6,     6,   -53,   -53,    56,    58,
-      59,    61,   -53,   -53,    62,   -53,   -53,   -53,     6,   -53,
-     -53,   -53,     6,     6,   -53,   -53,   -53,   -53,    15,   -53,
-      59,    64,    66,    69,   -53,   -53,   -53,    50,    53,   -53,
-     -53,   -53,   -53,   -53,    15,   -53,   -53,   -53,   -53,   -53,
-      67,    70,   -53,   -53,    63,    65,   -53,   -53,    73,    76,
-     -53,   -53,    68,    71,   -53,   -53,    78,    41,   -53,   -53,
-     -53,   -53,    72,   -53,    43,   -53,   -53,    74,   -53,    48,
-      48
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,
-     -53,   -53,   -53,    75,    -1,   -53,   -53,    55,   -53,   -53,
-     -53,   -53,   -53,   -53,   -53,    81,   -53,   -53,   -53,   -53,
-     -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,   -53,
-     -53,   -53,   -53,   -53,   -53,   -53,   -53,    10,    77,   -53,
-     -40,   -52
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -60
-static const yytype_int16 yytable[] =
-{
-      68,    15,     1,     1,     2,    50,    37,     3,     4,     4,
-      16,    27,     4,    29,    51,    35,     5,     6,    89,    90,
-      38,    -5,     4,    24,     7,    28,    48,    41,    42,     7,
-      91,    36,    30,    31,    92,    93,    43,    18,    19,    44,
-      45,    46,    30,    31,   119,   120,    56,    66,    57,    67,
-     125,   126,    69,    70,    71,   -59,    63,    62,    51,    74,
-      64,    75,    98,    77,    79,    99,   -53,    84,    95,    96,
-     102,    85,    86,    97,   103,   106,   110,   107,    68,   111,
-     114,   118,    49,   115,   123,    25,   128,    23,    26,   130,
-      94
-};
-
-#define yypact_value_is_default(yystate) \
-  ((yystate) == (-53))
-
-#define yytable_value_is_error(yytable_value) \
-  YYID (0)
-
-static const yytype_uint8 yycheck[] =
-{
-      52,     2,     0,     0,     1,     1,     5,     4,     6,     6,
-       1,    12,     6,    14,    10,    16,    13,    14,     3,     4,
-      19,    12,     6,     0,    21,     9,     1,     3,     4,    21,
-      15,    12,     7,     8,    19,    20,    12,     3,     4,    15,
-      16,    17,     7,     8,     3,     4,     7,    48,     8,    50,
-       7,     8,    53,    54,    55,     4,    19,     5,    10,     3,
-      18,     3,    12,     4,     3,    12,     4,    68,     4,     3,
-       3,    72,    73,     4,     4,    12,     3,    12,   130,     3,
-      12,     3,    27,    12,    12,    10,    12,     6,    11,   129,
-      80
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     0,     1,     4,     6,    13,    14,    21,    23,    35,
-      36,    37,    38,    70,    71,    36,     1,    24,     3,     4,
-      47,    48,    50,    47,     0,    35,    70,    36,     9,    36,
-       7,     8,    39,    40,    43,    36,    12,     5,    19,    54,
-      58,     3,     4,    12,    15,    16,    17,    49,     1,    39,
-       1,    10,    72,    73,    41,    44,     7,     8,    25,    55,
-      56,    59,     5,    19,    18,    51,    36,    36,    73,    36,
-      36,    36,    42,    45,     3,     3,    61,     4,    69,     3,
-      57,    60,    52,    53,    36,    36,    36,    26,    62,     3,
-       4,    15,    19,    20,    69,     4,     3,     4,    12,    12,
-      27,    63,     3,     4,    28,    64,    12,    12,    29,    65,
-       3,     3,    30,    66,    12,    12,    31,    67,     3,     3,
-       4,    68,    32,    12,    33,     7,     8,    46,    12,    34,
-      72
-};
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)					\
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    {								\
-      yychar = (Token);						\
-      yylval = (Value);						\
-      YYPOPSTACK (1);						\
-      goto yybackup;						\
-    }								\
-  else								\
-    {								\
-      yyerror (pb, YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
-
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)				\
-    do									\
-      if (YYID (N))                                                    \
-	{								\
-	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
-	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
-	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
-	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
-	}								\
-      else								\
-	{								\
-	  (Current).first_line   = (Current).last_line   =		\
-	    YYRHSLOC (Rhs, 0).last_line;				\
-	  (Current).first_column = (Current).last_column =		\
-	    YYRHSLOC (Rhs, 0).last_column;				\
-	}								\
-    while (YYID (0))
-#endif
-
-
-/* This macro is provided for backward compatibility. */
-
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, pb)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value, pb); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, FASTQParseBlock* pb)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, pb)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    FASTQParseBlock* pb;
-#endif
-{
-  if (!yyvaluep)
-    return;
-  YYUSE (pb);
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
-# endif
-  switch (yytype)
-    {
-      default:
-	break;
-    }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, FASTQParseBlock* pb)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, pb)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    FASTQParseBlock* pb;
-#endif
-{
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, pb);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; yybottom <= yytop; yybottom++)
-    {
-      int yybot = *yybottom;
-      YYFPRINTF (stderr, " %d", yybot);
-    }
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, FASTQParseBlock* pb)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule, pb)
-    YYSTYPE *yyvsp;
-    int yyrule;
-    FASTQParseBlock* pb;
-#endif
-{
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       		       , pb);
-      YYFPRINTF (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, Rule, pb); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
-
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
-
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
-                yytype_int16 *yyssp, int yytoken)
-{
-  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
-  YYSIZE_T yysize = yysize0;
-  YYSIZE_T yysize1;
-  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-  /* Internationalized format string. */
-  const char *yyformat = 0;
-  /* Arguments of yyformat. */
-  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Number of reported tokens (one for the "unexpected", one per
-     "expected"). */
-  int yycount = 0;
-
-  /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
-     - If this state is a consistent state with a default action, then
-       the only way this function was invoked is if the default action
-       is an error action.  In that case, don't check for expected
-       tokens because there are none.
-     - The only way there can be no lookahead present (in yychar) is if
-       this state is a consistent state with a default action.  Thus,
-       detecting the absence of a lookahead is sufficient to determine
-       that there is no unexpected or expected token to report.  In that
-       case, just report a simple "syntax error".
-     - Don't assume there isn't a lookahead just because this state is a
-       consistent state with a default action.  There might have been a
-       previous inconsistent state, consistent state with a non-default
-       action, or user semantic action that manipulated yychar.
-     - Of course, the expected token list depends on states to have
-       correct lookahead information, and it depends on the parser not
-       to perform extra reductions after fetching a lookahead from the
-       scanner and before detecting a syntax error.  Thus, state merging
-       (from LALR or IELR) and default reductions corrupt the expected
-       token list.  However, the list is correct for canonical LR with
-       one exception: it will still contain any token that will not be
-       accepted due to an error action in a later state.
-  */
-  if (yytoken != YYEMPTY)
-    {
-      int yyn = yypact[*yyssp];
-      yyarg[yycount++] = yytname[yytoken];
-      if (!yypact_value_is_default (yyn))
-        {
-          /* Start YYX at -YYN if negative to avoid negative indexes in
-             YYCHECK.  In other words, skip the first -YYN actions for
-             this state because they are default actions.  */
-          int yyxbegin = yyn < 0 ? -yyn : 0;
-          /* Stay within bounds of both yycheck and yytname.  */
-          int yychecklim = YYLAST - yyn + 1;
-          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-          int yyx;
-
-          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
-                && !yytable_value_is_error (yytable[yyx + yyn]))
-              {
-                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                  {
-                    yycount = 1;
-                    yysize = yysize0;
-                    break;
-                  }
-                yyarg[yycount++] = yytname[yyx];
-                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-                if (! (yysize <= yysize1
-                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                  return 2;
-                yysize = yysize1;
-              }
-        }
-    }
-
-  switch (yycount)
-    {
-# define YYCASE_(N, S)                      \
-      case N:                               \
-        yyformat = S;                       \
-      break
-      YYCASE_(0, YY_("syntax error"));
-      YYCASE_(1, YY_("syntax error, unexpected %s"));
-      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
-    }
-
-  yysize1 = yysize + yystrlen (yyformat);
-  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-    return 2;
-  yysize = yysize1;
-
-  if (*yymsg_alloc < yysize)
-    {
-      *yymsg_alloc = 2 * yysize;
-      if (! (yysize <= *yymsg_alloc
-             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-      return 1;
-    }
-
-  /* Avoid sprintf, as that infringes on the user's name space.
-     Don't have undefined behavior even if the translation
-     produced a string with the wrong number of "%s"s.  */
-  {
-    char *yyp = *yymsg;
-    int yyi = 0;
-    while ((*yyp = *yyformat) != '\0')
-      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-        {
-          yyp += yytnamerr (yyp, yyarg[yyi++]);
-          yyformat += 2;
-        }
-      else
-        {
-          yyp++;
-          yyformat++;
-        }
-  }
-  return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, FASTQParseBlock* pb)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, pb)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    FASTQParseBlock* pb;
-#endif
-{
-  YYUSE (yyvaluep);
-  YYUSE (pb);
-
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  switch (yytype)
-    {
-
-      default:
-	break;
-    }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (FASTQParseBlock* pb);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (FASTQParseBlock* pb)
-#else
-int
-yyparse (pb)
-    FASTQParseBlock* pb;
-#endif
-#endif
-{
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-
-    /* Number of syntax errors so far.  */
-    int yynerrs;
-
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-
-       Refer to the stacks thru separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-  int yyn;
-  int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken;
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
-  yystacksize = YYINITDEPTH;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yystacksize);
-
-	yyss = yyss1;
-	yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
-
-      {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-#  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     lookahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-  yyn = yypact[yystate];
-  if (yypact_value_is_default (yyn))
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yytable_value_is_error (yyn))
-        goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the lookahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
-  yystate = yyn;
-  *++yyvsp = yylval;
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 2:
-
-    { UNLEX; return 1; }
-    break;
-
-  case 3:
-
-    { UNLEX; return 1; }
-    break;
-
-  case 4:
-
-    { UNLEX; return 1; }
-    break;
-
-  case 5:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 6:
-
-    { GrowTagLine(pb, &(yyvsp[(3) - (3)])); }
-    break;
-
-  case 7:
-
-    { GrowTagLine(pb, &(yyvsp[(5) - (5)])); }
-    break;
-
-  case 8:
-
-    { GrowTagLine(pb, &(yyvsp[(7) - (7)]));}
-    break;
-
-  case 9:
-
-    { GrowTagLine(pb, &(yyvsp[(9) - (9)])); }
-    break;
-
-  case 10:
-
-    { GrowTagLine(pb, &(yyvsp[(11) - (11)])); }
-    break;
-
-  case 11:
-
-    { GrowTagLine(pb, &(yyvsp[(13) - (13)])); }
-    break;
-
-  case 12:
-
-    { GrowTagLine(pb, &(yyvsp[(15) - (15)])); }
-    break;
-
-  case 13:
-
-    { GrowTagLine(pb, &(yyvsp[(17) - (17)])); }
-    break;
-
-  case 14:
-
-    { FASTQScan_inline_sequence(pb); }
-    break;
-
-  case 15:
-
-    { FASTQScan_inline_quality(pb); }
-    break;
-
-  case 16:
-
-    { UNLEX; return 1; }
-    break;
-
-  case 17:
-
-    { UNLEX; return 1; }
-    break;
-
-  case 18:
-
-    { return 0; }
-    break;
-
-  case 27:
-
-    { pb->record->seq.is_colorspace = false; }
-    break;
-
-  case 28:
-
-    { pb->record->seq.is_colorspace = true; }
-    break;
-
-  case 29:
-
-    { SetRead(pb, & (yyvsp[(1) - (1)])); }
-    break;
-
-  case 31:
-
-    { SetRead(pb, & (yyvsp[(2) - (2)])); }
-    break;
-
-  case 33:
-
-    { SetRead(pb, & (yyvsp[(1) - (1)])); }
-    break;
-
-  case 35:
-
-    { SetRead(pb, & (yyvsp[(2) - (2)])); }
-    break;
-
-  case 37:
-
-    { SetRead(pb, & (yyvsp[(1) - (1)])); pb->record->seq.is_colorspace = false; }
-    break;
-
-  case 38:
-
-    { SetRead(pb, & (yyvsp[(1) - (1)])); pb->record->seq.is_colorspace = true; }
-    break;
-
-  case 41:
-
-    { StopSpotName(pb); }
-    break;
-
-  case 43:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 44:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 45:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 46:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 47:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 48:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 49:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 50:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 51:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 52:
-
-    { SetSpotGroup(pb, &(yyvsp[(3) - (3)]));  GrowTagLine(pb, &(yyvsp[(3) - (3)])); }
-    break;
-
-  case 53:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 54:
-
-    { SetSpotGroup(pb, &(yyvsp[(3) - (3)]));  GrowTagLine(pb, &(yyvsp[(3) - (3)])); }
-    break;
-
-  case 57:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 59:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 61:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 63:
-
-    {   /* in PACBIO fastq, the first '/' and the following digits are treated as a continuation of the spot name, not a read number */
-            if (pb->defaultReadNumber == -1) pb->spotNameDone = false; 
-            GrowTagLine(pb, &(yyvsp[(1) - (1)])); 
-        }
-    break;
-
-  case 64:
-
-    { 
-            SetReadNumber(pb, &(yyvsp[(3) - (3)])); 
-            GrowTagLine(pb, &(yyvsp[(3) - (3)])); 
-            StopSpotName(pb); 
-        }
-    break;
-
-  case 65:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 66:
-
-    { GrowTagLine(pb, &(yyvsp[(4) - (4)])); }
-    break;
-
-  case 67:
-
-    { SetReadNumber(pb, &(yyvsp[(1) - (1)])); GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 68:
-
-    { GrowTagLine(pb, &(yyvsp[(3) - (3)])); }
-    break;
-
-  case 69:
-
-    { GrowTagLine(pb, &(yyvsp[(5) - (5)])); if ((yyvsp[(5) - (5)]).tokenLength == 1 && (yyvsp[(5) - (5)]).tokenText[0] == 'Y') pb->record->seq.lowQuality = true; }
-    break;
-
-  case 70:
-
-    { GrowTagLine(pb, &(yyvsp[(7) - (7)])); }
-    break;
-
-  case 71:
-
-    { GrowTagLine(pb, &(yyvsp[(9) - (9)])); }
-    break;
-
-  case 72:
-
-    { GrowTagLine(pb, &(yyvsp[(11) - (11)])); }
-    break;
-
-  case 74:
-
-    { SetSpotGroup(pb, &(yyvsp[(1) - (1)])); GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 75:
-
-    { SetSpotGroup(pb, &(yyvsp[(1) - (1)])); GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 77:
-
-    { GrowTagLine(pb, &(yyvsp[(1) - (1)])); }
-    break;
-
-  case 78:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 79:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 80:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 81:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 82:
-
-    { GrowTagLine(pb, &(yyvsp[(2) - (2)])); }
-    break;
-
-  case 89:
-
-    {  AddQuality(pb, & (yyvsp[(1) - (1)])); }
-    break;
-
-
-
-      default: break;
-    }
-  /* User semantic actions sometimes alter yychar, and that requires
-     that yytoken be updated with the new translation.  We take the
-     approach of translating immediately before every use of yytoken.
-     One alternative is translating here after every semantic action,
-     but that translation would be missed if the semantic action invokes
-     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-     incorrect destructor might then be invoked immediately.  In the
-     case of YYERROR or YYBACKUP, subsequent parser actions might lead
-     to an incorrect destructor call or verbose syntax error message
-     before the lookahead is translated.  */
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* Make sure we have latest lookahead translation.  See comments at
-     user semantic actions for why this is necessary.  */
-  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (pb, YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
-                                        yyssp, yytoken)
-      {
-        char const *yymsgp = YY_("syntax error");
-        int yysyntax_error_status;
-        yysyntax_error_status = YYSYNTAX_ERROR;
-        if (yysyntax_error_status == 0)
-          yymsgp = yymsg;
-        else if (yysyntax_error_status == 1)
-          {
-            if (yymsg != yymsgbuf)
-              YYSTACK_FREE (yymsg);
-            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
-            if (!yymsg)
-              {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
-              }
-            else
-              {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
-              }
-          }
-        yyerror (pb, yymsgp);
-        if (yysyntax_error_status == 2)
-          goto yyexhaustedlab;
-      }
-# undef YYSYNTAX_ERROR
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
-
-      if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
-      else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, pb);
-	  yychar = YYEMPTY;
-	}
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-	YYABORT;
-
-
-      yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, pb);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  *++yyvsp = yylval;
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#if !defined(yyoverflow) || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (pb, YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEMPTY)
-    {
-      /* Make sure we have latest lookahead translation.  See comments at
-         user semantic actions for why this is necessary.  */
-      yytoken = YYTRANSLATE (yychar);
-      yydestruct ("Cleanup: discarding lookahead",
-                  yytoken, &yylval, pb);
-    }
-  /* Do not reclaim the symbols of the rule which action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, pb);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
-}
-
-
-
-
-
-static
-void GrowByteBuffer(KDataBuffer* self, const char* buf, uint64_t length)
-{
-    uint64_t oldSize = self->elem_count;
-    KDataBufferResize( self, oldSize + length );
-    memcpy( (char*)self->base + oldSize, buf, length );
-}
-
-void AddQuality(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    if (pb->phredOffset != 0)
-    {
-        uint8_t floor   = pb->phredOffset == 33 ? MIN_PHRED_33 : MIN_PHRED_64;
-        uint8_t ceiling = pb->maxPhred == 0 ? (pb->phredOffset == 33 ? MAX_PHRED_33 : MAX_PHRED_64) : pb->maxPhred;
-        unsigned int i;
-        for (i=0; i < token->tokenLength; ++i)
-        {
-            char buf[200];
-            if (token->tokenText[i] < floor || token->tokenText[i] > ceiling)
-            {
-                sprintf(buf, "Invalid quality value (%d): for %s, valid range is from %d to %d.", 
-                                                         token->tokenText[i],
-                                                         pb->phredOffset == 33 ? "Phred33": "Phred64", 
-                                                         floor, 
-                                                         ceiling);
-                pb->fatalError = true;
-                yyerror(pb, buf);
-                return;
-            }
-        }
-    }
-    GrowByteBuffer( & pb->quality, token->tokenText, token->tokenLength);
-}
-
-void SetReadNumber(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    if (pb->defaultReadNumber != -1)
-    {
-        if (token->tokenLength == 1)
-        {
-            switch (token->tokenText[0])
-            {
-            case '1': pb->record->seq.readnumber = 1; return;
-            case '2': pb->record->seq.readnumber = 2; return;
-            }
-        }
-        pb->record->seq.readnumber = pb->defaultReadNumber;
-    }
-}
-
-void GrowTagLine(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    /* TODO: move tagline to FileReader, move this function to fastq-reader.c */
-
-    /* grow the buffer as necessary*/
-    uint64_t oldSize = pb->tagLine.elem_count;
-    KDataBufferResize( & pb->tagLine, oldSize + token->tokenLength);
-    string_copy((char*)pb->tagLine.base + oldSize, pb->tagLine.elem_count - oldSize, token->tokenText, token->tokenLength);
-    
-    if (!pb->spotNameDone)
-        pb->spotNameLength = pb->tagLine.elem_count;
-}
-
-void StopSpotName(FASTQParseBlock* pb)
-{   /* spot name is the current content of the tag line (there may be more tokens coming, they will not be a part of the spot name) */
-    pb->spotNameDone = true;
-}
-
-void SetSpotGroup(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    if (token->tokenLength != 1 || token->tokenText[0] != '0') /* ignore spot group 0 */
-    {
-        pb->spotGroupOffset = pb->tagLine.elem_count;    
-        pb->spotGroupLength = token->tokenLength;
-    }
-}
-
-void SetRead(FASTQParseBlock* pb, const FASTQToken* token)
-{ 
-    if (pb->record->seq.read)
-    {
-        pb->record->seq.read = (char*)realloc(pb->record->seq.read, strlen(pb->record->seq.read) + 1 + token->tokenLength + 1);
-        strcat(pb->record->seq.read, token->tokenText); 
-        ++pb->expectedQualityLines;
-    }
-    else
-    {
-        pb->record->seq.read = (char*)malloc(token->tokenLength+1);
-        strcpy(pb->record->seq.read, token->tokenText); 
-        pb->expectedQualityLines = 1;
-    }
-}
-
diff --git a/tools/fastq-loader/fastq-grammar.y b/tools/fastq-loader/fastq-grammar.y
deleted file mode 100644
index 66c36ef..0000000
--- a/tools/fastq-loader/fastq-grammar.y
+++ /dev/null
@@ -1,294 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
- 
-%{  
-    #include <ctype.h>
-    #include <stdlib.h>
-
-	#include "fastq-parse.h"
-
-   	#define YYSTYPE FASTQToken
-    #define YYLEX_PARAM pb->scanner
-    #define YYDEBUG 1
-
-	#include "fastq-tokens.h"
-
-    static uint64_t string_touint(const char* str, size_t length);
-    static void AddBinaryQuality(FASTQParseBlock* pb, int8_t value);
-    static void SetReadNumber(FASTQParseBlock* pb, const FASTQToken* token);
-    static void SetTagLine(FASTQParseBlock* pb, const char* start, size_t length, const FASTQToken* coords);
-    static void SetSpotGroup(FASTQParseBlock* pb, const FASTQToken* token);
-
-%}
-
-%pure-parser
-%parse-param {FASTQParseBlock* pb }
-%lex-param {FASTQParseBlock* pb }
-
-%name-prefix="FASTQ_"
-
-%token fqNUMBER
-%token fqALPHANUM
-%token fqWS
-%token fqENDLINE
-%token fqBASESEQ
-%token fqCOLORSEQ
-%token fqTOKEN
-%token fqASC33QUAL
-%token fqASC64QUAL
-%token fqUNRECOGNIZED
-%token fqENDOFTEXT 0
-
-%%
-
-sequence
-    : readLines qualityLines    { return 1; }
-    | readLines                 { if (yychar != YYEMPTY && yychar != YYEOF) FASTQ_unlex(pb, & yylval); return 1; }
-    | readQualityLines          { return 1; }
-    | qualityLines              { return 1; } 
-    | name ':' coords ':'           { FASTQScan_inline_sequence(pb); } 
-                 read ':'           { FASTQScan_inline_quality(pb); } 
-                 quality endline    { return 1; }
-    | name error endline        { return 1; }
-    | endfile                   { return 0; }
-    ;
-
-endfile
-    : fqENDOFTEXT
-    | endline fqENDOFTEXT
-    | endline endfile
-    ;
-
-endline
-    : fqENDLINE
-    ;
-
-readLines
-    : header  endline  read endline  
-    | qheader endline  read endline  
-    | header  endline error endline
-    | error   endline  read endline
-    ;
-
-readQualityLines
-    : qheader endline quality endline
-    | qheader endline   error endline
-    ;
-
-read
-    : fqBASESEQ                  { pb->record->seq.read = string_dup($1.tokenText, $1.tokenLength); pb->record->seq.is_colorspace = false; }
-    | fqCOLORSEQ                 { pb->record->seq.read = string_dup($1.tokenText, $1.tokenLength); pb->record->seq.is_colorspace = true; }
-    ;
-
-header 
-    : headerStart tagLine;
-
-headerStart
-    : '@' { pb->tagStart = $1.tokenText + 1; }
-    ;
-
-qheader 
-    : qheaderStart tagLine;
-
-qheaderStart
-    : '>' { pb->tagStart = $1.tokenText + 1; }
-    ;
-
-tagLine    
-    : name ':' coords tail  { SetTagLine(pb, $1.tokenText, $1.tokenLength + $2.tokenLength + $3.tokenLength + $4.tokenLength, &$3); }  
-    | name ':' coords       { SetTagLine(pb, $1.tokenText, $1.tokenLength + $2.tokenLength + $3.tokenLength, &$3); }  
-    | name                  { SetTagLine(pb, $1.tokenText, $1.tokenLength, 0); /* coords may be embbedded in the name with '_' as the separator */ }
-    | coords tail           { SetTagLine(pb, $1.tokenText, $1.tokenLength + $2.tokenLength, &$1); }  
-    | coords                { SetTagLine(pb, $1.tokenText, $1.tokenLength, &$1); }  
-    ;
-
-name
-    : fqALPHANUM        { $$ = $1; }
-    | name '_'          { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    | name '-'          { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    | name fqALPHANUM   { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    | name fqNUMBER     { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    ;
-
-coords
-    : fqNUMBER ':' fqNUMBER ':' signedNumber ':' signedNumber 
-        { $$ = $1; $$.tokenLength += ($2.tokenLength + $3.tokenLength + $4.tokenLength + $5.tokenLength + $6.tokenLength + $7.tokenLength); }
-    ;
-
-signedNumber
-    : '+' fqNUMBER  { pb->signedNumber =    (int8_t)string_touint($2.tokenText, $2.tokenLength); }
-    | '-' fqNUMBER  { pb->signedNumber =  - (int8_t)string_touint($2.tokenText, $2.tokenLength); }
-    | fqNUMBER      { pb->signedNumber =    (int8_t)string_touint($1.tokenText, $1.tokenLength); }
-    ;
-
-tail
-    : tailPiece
-    | tail tailPiece
-    ;
-
-tailPiece
-    : ':'                           { $$ = $1; }
-    | ':' fqNUMBER                  { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    | '.' fqNUMBER                  { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    
-    | '#' fqNUMBER                  { $$ = $1; $$.tokenLength += $2.tokenLength; SetSpotGroup(pb, & $2); }
-    | '#' fqALPHANUM                { $$ = $1; $$.tokenLength += $2.tokenLength; SetSpotGroup(pb, & $2); }
-    | '/' fqNUMBER                  { $$ = $1; $$.tokenLength += $2.tokenLength; SetReadNumber(pb, & $2); }
-
-    | fqWS fqALPHANUM '=' value     { $$ = $1; $$.tokenLength += ($2.tokenLength + $3.tokenLength + $4.tokenLength); }
-    ;
-
-value
-    : anyToken                      
-    | value anyToken                { $$ = $1; $$.tokenLength += $2.tokenLength; }
-    ;
-
-anyToken
-    : fqNUMBER
-    | fqALPHANUM
-    |'_'
-    ;
-
-qualityLines
-    : qualityHeader endline quality endline
-    | qualityHeader endline error endline
-    ;
-
-qualityHeader
-    : '+'                 
-    | qualityHeader fqTOKEN
-    ;
-
-quality
-    : fqASC33QUAL                { 
-                                    pb->record->seq.qualityBase     = 33; 
-                                    pb->record->seq.qualityType     = QT_Phred; 
-                                    pb->record->seq.quality         = (int8_t*)string_dup($1.tokenText, $1.tokenLength); 
-                                    pb->record->seq.qualityLength   = $1.tokenLength;
-                                 }
-    | fqASC64QUAL                { 
-                                    pb->record->seq.qualityBase     = 64; 
-                                    pb->record->seq.qualityType     = QT_Phred; 
-                                    pb->record->seq.quality         = (int8_t*)string_dup($1.tokenText, $1.tokenLength); 
-                                    pb->record->seq.qualityLength   = $1.tokenLength;
-                                 }
-    | decList                    {  /*consume the quality buffer */
-                                    pb->record->seq.qualityBase     = 0; 
-                                    pb->record->seq.qualityType     = QT_LogOdds; 
-                                    pb->record->seq.quality         = pb->quality.buffer; 
-                                    pb->record->seq.qualityLength   = pb->quality.curIdx;
-                                    pb->quality.buffer = 0; 
-                                    pb->quality.curIdx = 0;
-                                 }
-    ;
-
-decList
-    : signedNumber              { AddBinaryQuality(pb, (int8_t)pb->signedNumber); }
-    | decList signedNumber      { AddBinaryQuality(pb, (int8_t)pb->signedNumber); }
-    | decList ',' signedNumber  { AddBinaryQuality(pb, (int8_t)pb->signedNumber); }
-    ;
-
-%%
-
-static
-uint64_t string_touint(const char* str, size_t length)
-{
-    size_t i;
-    uint64_t ret = 0;
-    for (i = 0; i < length; ++i)
-    {
-        if (isdigit(str[i]))
-        {
-            ret = ret*10 + (str[i] - '0');
-        }
-    }
-    return ret;
-}
-
-void AddBinaryQuality(FASTQParseBlock* pb, int8_t value)
-{
-    #define ChunkSize 128
-
-    if (pb->quality.buffer == 0) 
-    {   /* allocate based on the size of the previous buffer, if any */
-        if (pb->quality.bufLen == 0)
-        {
-            pb->quality.bufLen = ChunkSize;
-        }
-        pb->quality.buffer = (int8_t*)malloc(pb->quality.bufLen);
-        pb->quality.curIdx = 0;
-    }
-    else if (pb->quality.curIdx == pb->quality.bufLen)
-    {   /* grow the buffer */
-        pb->quality.bufLen += ChunkSize;
-        pb->quality.buffer = (int8_t*)realloc(pb->quality.buffer, pb->quality.bufLen);
-    }
-    pb->quality.buffer[pb->quality.curIdx] = value;
-    ++ pb->quality.curIdx;
-
-    #undef ChunkSize
-}
-
-void SetReadNumber(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    if (token->tokenLength == 1)
-    {
-        switch (token->tokenText[0])
-        {
-        case '1': pb->record->seq.readnumber = 1; return;
-        case '2': pb->record->seq.readnumber = 2; return;
-        }
-    }
-    pb->record->seq.readnumber = 0;
-}
-
-void SetTagLine(FASTQParseBlock* pb, const char* start, size_t length, const FASTQToken* coords)
-{
-    pb->record->seq.tagline = string_dup(start, length);
-    if (coords != 0)
-    {   /* assumes that a buffer switch can only happen at a line boundary*/ 
-        StringInit(& pb->record->seq.spotname, pb->record->seq.tagline, coords->tokenText - start + coords->tokenLength + 1, coords->tokenText - start + coords->tokenLength);
-    }
-    else
-    {
-        StringInit(& pb->record->seq.spotname, pb->record->seq.tagline, length + 1, length);
-    }
-    if (pb->spotGroupOffset != 0)
-    {
-        StringInit(& pb->record->seq.spotgroup, pb->record->seq.tagline + pb->spotGroupOffset, pb->spotGroupLength, pb->spotGroupLength);
-        pb->spotGroupOffset = 0;
-    }
-    else
-    {
-        StringInit(& pb->record->seq.spotgroup, 0, 0, 0);
-    }
-}
-
-void SetSpotGroup(FASTQParseBlock* pb, const FASTQToken* token)
-{
-    pb->spotGroupOffset = token->tokenText - pb->tagStart;    
-    pb->spotGroupLength = token->tokenLength;
-}
diff --git a/tools/fastq-loader/fastq-lex.c b/tools/fastq-loader/fastq-lex.c
deleted file mode 100644
index 970d1c6..0000000
--- a/tools/fastq-loader/fastq-lex.c
+++ /dev/null
@@ -1,2419 +0,0 @@
-
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
-   are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yyg->yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yyg->yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE FASTQ_restart(yyin ,yyscanner )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
-     *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE FASTQ_lex. 
-     *       One obvious solution it to make yy_act a global. I tried that, and saw
-     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
-     *       normally declared as a register variable-- so it is not worth it.
-     */
-    #define  YY_LESS_LINENO(n) \
-            do { \
-                int yyl;\
-                for ( yyl = n; yyl < yyleng; ++yyl )\
-                    if ( yytext[yyl] == '\n' )\
-                        --yylineno;\
-            }while(0)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = yyg->yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via FASTQ_restart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
-                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-
-void FASTQ_restart (FILE *input_file ,yyscan_t yyscanner );
-void FASTQ__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE FASTQ__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void FASTQ__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void FASTQ__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void FASTQ_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void FASTQ_pop_buffer_state (yyscan_t yyscanner );
-
-static void FASTQ_ensure_buffer_stack (yyscan_t yyscanner );
-static void FASTQ__load_buffer_state (yyscan_t yyscanner );
-static void FASTQ__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-
-#define YY_FLUSH_BUFFER FASTQ__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
-
-YY_BUFFER_STATE FASTQ__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE FASTQ__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE FASTQ__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *FASTQ_alloc (yy_size_t ,yyscan_t yyscanner );
-void *FASTQ_realloc (void *,yy_size_t ,yyscan_t yyscanner );
-void FASTQ_free (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer FASTQ__create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        FASTQ_ensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            FASTQ__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        FASTQ_ensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            FASTQ__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define FASTQ_wrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-typedef int yy_state_type;
-
-#define yytext_ptr yytext_r
-
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yyg->yytext_ptr = yy_bp; \
-	yyleng = (size_t) (yy_cp - yy_bp); \
-	yyg->yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yyg->yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 27
-#define YY_END_OF_BUFFER 28
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_acclist[175] =
-    {   0,
-       28,    9,   27,    6,    9,   27,   26,   27,    9,   26,
-       27,    5,    9,   27,    4,    5,    9,   27,    3,    9,
-       27,    9,   27,16391,    2,    9,   27,    1,    9,   27,
-        5,    9,   27,16391,    5,    9,   27,16391,    6,    9,
-       27,   10,   27,    9,   10,   27,   27,   27,   14,   27,
-       27,16397,   27,16395,16397,   27,16395,16397,   27,   18,
-       27,   18,   27,   22,   27,   19,   22,   27,   21,   27,
-       21,   22,   27,   22,   27,16404,   19,   22,   27,16404,
-       15,   27,   15,   27,   25,   27,   19,   25,   27,   24,
-       27,   24,   25,   27,   25,   27,16407,   19,   25,   27,
-
-    16407,    6,   26,    5,    4,    5, 8199, 8199,16391,16391,
-    16392,    5,16392,    5,16391,    6,   10,   10,   14, 8205,
-       14, 8205,16397, 8203, 8205,   14, 8203, 8205,16395,16397,
-    16395,16396,16397,16396,16397,   17,   17,   18,   19,   21,
-     8212, 8212,16404,   19,16404,   15,   15,   16,   16,   24,
-     8215, 8215,16407,   19,16407, 8199, 8200, 8199, 8200,16392,
-     8200, 8200, 8203, 8204, 8205,   14, 8203, 8204, 8205, 8204,
-     8205,   14, 8204, 8205
-    } ;
-
-static yyconst flex_int16_t yy_accept[113] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    2,    4,    7,    9,   12,   15,   19,
-       22,   25,   28,   31,   35,   39,   42,   44,   47,   48,
-       49,   51,   53,   56,   59,   60,   62,   64,   66,   69,
-       71,   74,   77,   81,   83,   85,   87,   90,   92,   95,
-       98,  102,  103,  104,  105,  107,  108,  109,  110,  112,
-      114,  116,  117,  118,  119,  119,  120,  122,  123,  124,
-      127,  129,  131,  134,  136,  136,  137,  139,  140,  141,
-      142,  143,  144,  146,  147,  149,  150,  151,  152,  153,
-
-      154,  156,  158,  160,  161,  162,  163,  167,  170,  173,
-      175,  175
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    4,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    6,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    7,    5,    8,    9,    5,   10,   10,   10,
-       10,   11,   11,   11,   11,   11,   11,    5,    5,    5,
-        5,   12,    5,   13,   14,    8,   14,    8,    8,    8,
-       14,    8,    8,    8,    8,    8,    8,   15,    8,    8,
-        8,    8,    8,   14,    8,    8,    8,    8,    8,    8,
-        5,    5,    5,    5,    8,    5,   14,    8,   14,    8,
-
-        8,    8,   14,    8,    8,    8,    8,    8,    8,   15,
-        8,    8,    8,    8,    8,   14,    8,    8,    8,    8,
-        8,    8,    5,    5,    5,    5,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[16] =
-    {   0,
-        1,    1,    2,    2,    3,    3,    3,    4,    5,    4,
-        4,    3,    3,    6,    6
-    } ;
-
-static yyconst flex_int16_t yy_base[125] =
-    {   0,
-        0,    9,   23,   21,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   36,   16,   28,   50,   56,   54,    0,
-       69,   75,  172,  252,   59,  252,  168,    0,   23,  252,
-       63,  252,  252,   79,   75,   93,  252,  167,  252,  162,
-      252,   99,  103,   82,  161,  252,  160,  252,  107,  252,
-      159,  107,  117,    0,  105,  252,  120,  252,  150,  121,
-      125,  128,  252,    0,    0,  252,  149,  129,  132,  145,
-        0,    0,  252,  137,  113,  252,  252,  105,  155,  252,
-       95,    0,  157,  165,   83,  252,  252,  137,  252,  252,
-       77,  134,    0,    0,    0,  135,  252,  252,   71,  147,
-
-        0,  252,   61,  173,  252,   52,  252,   25,  252,   14,
-      252,  183,  189,  195,  201,  207,  210,  215,  221,  227,
-      233,  238,  240,  245
-    } ;
-
-static yyconst flex_int16_t yy_def[125] =
-    {   0,
-      111,    1,    1,    3,  112,  112,  112,  112,  112,  112,
-      112,  112,  112,  111,  113,  113,  114,  115,  112,   19,
-      116,  116,  111,  111,  111,  111,  111,  117,  117,  111,
-      118,  111,  111,  111,   34,  111,  111,  111,  111,  119,
-      111,  120,  120,   43,  121,  111,  121,  111,  111,  111,
-      111,  122,  122,  123,  123,  111,  111,  111,  111,  124,
-      124,  111,  111,  117,   29,  111,  111,  118,  111,  117,
-       35,   36,  111,  111,  119,  111,  111,  119,  120,  111,
-      119,   43,   43,   79,  121,  111,  111,  111,  111,  111,
-      111,  122,   53,  123,   55,  111,  111,  111,  111,  124,
-
-       61,  111,  111,  111,  111,  111,  111,  119,  111,  119,
-        0,  111,  111,  111,  111,  111,  111,  111,  111,  111,
-      111,  111,  111,  111
-    } ;
-
-static yyconst flex_int16_t yy_nxt[268] =
-    {   0,
-       24,   25,   26,   27,   24,   25,   24,   28,   24,   29,
-       29,   24,   24,   28,   28,   30,  109,   31,   46,   47,
-       32,   33,   34,   35,   36,   37,   38,  107,   36,   31,
-       46,   47,   65,   65,   34,   35,   40,   40,   41,   40,
-       42,   42,   42,   42,   43,   42,   42,   42,   42,   44,
-       43,   49,   50,   51,  105,   49,   48,   49,   50,   51,
-       62,   53,   54,  102,   62,   66,   67,   55,   54,   56,
-       57,   58,   59,   98,   61,   56,   57,   58,   59,   90,
-       61,   66,   67,   68,   64,   86,   64,   69,   70,   64,
-       83,   84,   71,   71,   72,   73,   74,   80,   72,   75,
-
-       75,   77,   78,   75,   75,   80,   81,   77,   88,   90,
-       91,   82,   88,   95,   96,   76,   82,   82,   88,   90,
-       91,   88,   93,   98,   99,   88,   88,   98,   99,   62,
-      101,   66,   67,   62,  102,  103,   90,   91,   88,   73,
-       69,  104,   88,   96,   96,   68,   68,  105,  106,   98,
-       99,   66,   97,  104,   70,   75,   75,   77,   78,  107,
-      108,   89,   87,   86,   76,   83,   84,  109,  110,   73,
-       63,  111,  111,   84,   84,  105,  106,  111,  111,  111,
-      111,  104,  104,   39,   39,   39,   39,   39,   39,   45,
-       45,   45,   45,   45,   45,   48,   48,   48,   48,   48,
-
-       48,   52,   52,   52,   52,   52,   52,   60,   60,   60,
-       60,   60,   60,   64,  111,   64,   68,  111,  111,   68,
-       68,   75,   75,   75,   75,   75,   75,   79,   79,   79,
-       79,   79,   79,   85,   85,   85,   85,   85,   85,   92,
-       92,   92,   92,   92,   94,   94,  100,  100,  100,  100,
-      100,   23,  111,  111,  111,  111,  111,  111,  111,  111,
-      111,  111,  111,  111,  111,  111,  111
-    } ;
-
-static yyconst flex_int16_t yy_chk[268] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    2,  110,    2,   15,   15,
-        2,    2,    2,    2,    3,    3,    3,  108,    3,    4,
-       16,   16,   29,   29,    4,    4,   14,   14,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
-       14,   17,   17,   17,  106,   17,   18,   18,   18,   18,
-       25,   18,   19,  103,   25,   31,   31,   19,   19,   21,
-       21,   21,   21,   99,   21,   22,   22,   22,   22,   91,
-       22,   34,   34,   35,   35,   85,   34,   34,   34,   34,
-       44,   44,   34,   34,   36,   36,   36,   81,   36,   42,
-
-       42,   42,   42,   43,   43,   43,   43,   78,   49,   52,
-       52,   43,   49,   55,   55,   75,   43,   43,   53,   53,
-       53,   57,   53,   60,   60,   57,   61,   61,   61,   62,
-       61,   68,   68,   62,   69,   69,   92,   92,   88,   74,
-       69,   69,   88,   96,   96,   69,   69,   70,   70,  100,
-      100,   67,   59,   70,   70,   79,   79,   79,   79,   83,
-       83,   51,   47,   45,   40,   83,   83,   84,   84,   38,
-       27,   23,    0,   84,   84,  104,  104,    0,    0,    0,
-        0,  104,  104,  112,  112,  112,  112,  112,  112,  113,
-      113,  113,  113,  113,  113,  114,  114,  114,  114,  114,
-
-      114,  115,  115,  115,  115,  115,  115,  116,  116,  116,
-      116,  116,  116,  117,    0,  117,  118,    0,    0,  118,
-      118,  119,  119,  119,  119,  119,  119,  120,  120,  120,
-      120,  120,  120,  121,  121,  121,  121,  121,  121,  122,
-      122,  122,  122,  122,  123,  123,  124,  124,  124,  124,
-      124,  111,  111,  111,  111,  111,  111,  111,  111,  111,
-      111,  111,  111,  111,  111,  111,  111
-    } ;
-
-/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[28] =
-    {   0,
-0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 
-    1, 1, 0, 1, 1, 0, 1, 0,     };
-
-#define YY_TRAILING_MASK 0x2000
-#define YY_TRAILING_HEAD_MASK 0x4000
-#define REJECT \
-{ \
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
-yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \
-yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \
-yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \
-++yyg->yy_lp; \
-goto find_rule; \
-}
-
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-    #include <sysalloc.h>
-    #include <ctype.h>
-    
-    #include <klib/rc.h>
-
-	#include "fastq-parse.h"
-	#include "fastq-tokens.h"    
-	
-    #define YYSTYPE FASTQToken
-
-    /* code to populate token with internal values */
-    #define YY_USER_ACTION              \
-        yylval -> tokenText		= yytext;	\
-        yylval -> tokenLength	= yyleng;	\
-        yylval -> line_no		= yylineno;	\
-        yylval -> column_no		= yyextra -> column; \
-        yyextra -> column += yyleng; \
-        yyextra -> length += yyleng; \
-        yyextra -> lastToken = yylval; 
-
-    #define ENDLINE \
-        yyextra -> column=1;\
-        return fqENDLINE;
-
-    #define YY_INPUT(buf, result, max_size) \
-        result = yyextra->input(yyextra, buf, max_size)
-
-    #define ECHO
-
-#define YY_NO_UNISTD_H 1
-/*%option debug*/
-
-/* there are more: =ACMGRSVTWYHKDBN. plus lowercase */
-
-#define INITIAL 0
-#define TAG_LINE 1
-#define SEE_COORDS 2
-#define PAST_COORDS 3
-#define READ_NUMBER 4
-#define NAMEVALUE 5
-#define IN_SEQUENCE 6
-#define QTAG_LINE 7
-#define IN_QUALITY 8
-#define INLINE_SEQUENCE 9
-#define INLINE_QUALITY 10
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#define YY_EXTRA_TYPE FASTQParseBlock*
-
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
-    {
-
-    /* User-defined. Not touched by flex. */
-    YY_EXTRA_TYPE yyextra_r;
-
-    /* The rest are the same as the globals declared in the non-reentrant scanner. */
-    FILE *yyin_r, *yyout_r;
-    size_t yy_buffer_stack_top; /**< index of top of stack. */
-    size_t yy_buffer_stack_max; /**< capacity of stack. */
-    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
-    char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
-    char *yy_c_buf_p;
-    int yy_init;
-    int yy_start;
-    int yy_did_buffer_switch_on_eof;
-    int yy_start_stack_ptr;
-    int yy_start_stack_depth;
-    int *yy_start_stack;
-    yy_state_type yy_last_accepting_state;
-    char* yy_last_accepting_cpos;
-
-    int yylineno_r;
-    int yy_flex_debug_r;
-
-    yy_state_type *yy_state_buf;
-    yy_state_type *yy_state_ptr;
-    char *yy_full_match;
-    int yy_lp;
-
-    /* These are only needed for trailing context rules,
-     * but there's no conditional variable for that yet. */
-    int yy_looking_for_trail_begin;
-    int yy_full_lp;
-    int *yy_full_state;
-
-    char *yytext_r;
-    int yy_more_flag;
-    int yy_more_len;
-
-    YYSTYPE * yylval_r;
-
-    }; /* end struct yyguts_t */
-
-static int yy_init_globals (yyscan_t yyscanner );
-
-    /* This must go here because YYSTYPE and YYLTYPE are included
-     * from bison output in section 1.*/
-    #    define yylval yyg->yylval_r
-    
-int FASTQ_lex_init (yyscan_t* scanner);
-
-int FASTQ_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int FASTQ_lex_destroy (yyscan_t yyscanner );
-
-int FASTQ_get_debug (yyscan_t yyscanner );
-
-void FASTQ_set_debug (int debug_flag ,yyscan_t yyscanner );
-
-YY_EXTRA_TYPE FASTQ_get_extra (yyscan_t yyscanner );
-
-void FASTQ_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-
-FILE *FASTQ_get_in (yyscan_t yyscanner );
-
-void FASTQ_set_in  (FILE * in_str ,yyscan_t yyscanner );
-
-FILE *FASTQ_get_out (yyscan_t yyscanner );
-
-void FASTQ_set_out  (FILE * out_str ,yyscan_t yyscanner );
-
-int FASTQ_get_leng (yyscan_t yyscanner );
-
-char *FASTQ_get_text (yyscan_t yyscanner );
-
-int FASTQ_get_lineno (yyscan_t yyscanner );
-
-void FASTQ_set_lineno (int line_number ,yyscan_t yyscanner );
-
-YYSTYPE * FASTQ_get_lval (yyscan_t yyscanner );
-
-void FASTQ_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int FASTQ_wrap (yyscan_t yyscanner );
-#else
-extern int FASTQ_wrap (yyscan_t yyscanner );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
-#else
-static int input (yyscan_t yyscanner );
-#endif
-
-#endif
-
-    static void yy_push_state (int new_state ,yyscan_t yyscanner);
-    
-    static void yy_pop_state (yyscan_t yyscanner );
-    
-    static int yy_top_state (yyscan_t yyscanner );
-    
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		int n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int FASTQ_lex \
-               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
-
-#define YY_DECL int FASTQ_lex \
-               (YYSTYPE * yylval_param , yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	if ( yyleng > 0 ) \
-		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
-				(yytext[yyleng - 1] == '\n'); \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-    yylval = yylval_param;
-
-	if ( !yyg->yy_init )
-		{
-		yyg->yy_init = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-        /* Create the reject buffer large enough to save one state per allowed character. */
-        if ( ! yyg->yy_state_buf )
-            yyg->yy_state_buf = (yy_state_type *)FASTQ_alloc(YY_STATE_BUF_SIZE  ,yyscanner);
-            if ( ! yyg->yy_state_buf )
-                YY_FATAL_ERROR( "out of dynamic memory in FASTQ_lex()" );
-
-		if ( ! yyg->yy_start )
-			yyg->yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			FASTQ_ensure_buffer_stack (yyscanner);
-			YY_CURRENT_BUFFER_LVALUE =
-				FASTQ__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-		}
-
-		FASTQ__load_buffer_state(yyscanner );
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yyg->yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yyg->yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yyg->yy_start;
-		yy_current_state += YY_AT_BOL();
-
-		yyg->yy_state_ptr = yyg->yy_state_buf;
-		*yyg->yy_state_ptr++ = yy_current_state;
-
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 112 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			*yyg->yy_state_ptr++ = yy_current_state;
-			++yy_cp;
-			}
-		while ( yy_current_state != 111 );
-
-yy_find_action:
-		yy_current_state = *--yyg->yy_state_ptr;
-		yyg->yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
-		for ( ; ; ) /* until we find what rule we matched */
-			{
-			if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
-				{
-				yy_act = yy_acclist[yyg->yy_lp];
-				if ( yy_act & YY_TRAILING_HEAD_MASK ||
-				     yyg->yy_looking_for_trail_begin )
-					{
-					if ( yy_act == yyg->yy_looking_for_trail_begin )
-						{
-						yyg->yy_looking_for_trail_begin = 0;
-						yy_act &= ~YY_TRAILING_HEAD_MASK;
-						break;
-						}
-					}
-				else if ( yy_act & YY_TRAILING_MASK )
-					{
-					yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
-					yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
-					}
-				else
-					{
-					yyg->yy_full_match = yy_cp;
-					yyg->yy_full_state = yyg->yy_state_ptr;
-					yyg->yy_full_lp = yyg->yy_lp;
-					break;
-					}
-				++yyg->yy_lp;
-				goto find_rule;
-				}
-			--yy_cp;
-			yy_current_state = *--yyg->yy_state_ptr;
-			yyg->yy_lp = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-			{
-			int yyl;
-			for ( yyl = 0; yyl < yyleng; ++yyl )
-				if ( yytext[yyl] == '\n' )
-					   
-    do{ yylineno++;
-        yycolumn=0;
-    }while(0)
-;
-			}
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-case 1:
-YY_RULE_SETUP
-{ BEGIN TAG_LINE; return yytext[0]; }
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-{ BEGIN TAG_LINE; return yytext[0]; }
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-{ BEGIN QTAG_LINE; return yytext[0]; }
-	YY_BREAK
-
-case 4:
-YY_RULE_SETUP
-{ return fqNUMBER; }
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-{ return fqALPHANUM; }
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-{ return fqWS; }
-	YY_BREAK
-case 7:
-/* rule 7 can match eol */
-YY_RULE_SETUP
-{ return fqBASESEQ; }
-	YY_BREAK
-case 8:
-/* rule 8 can match eol */
-YY_RULE_SETUP
-{ return fqCOLORSEQ; }
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-{ return yytext[0]; }
-	YY_BREAK
-
-case 10:
-/* rule 10 can match eol */
-YY_RULE_SETUP
-{ BEGIN IN_SEQUENCE; ENDLINE; }
-	YY_BREAK
-
-case 11:
-/* rule 11 can match eol */
-YY_RULE_SETUP
-{ BEGIN 0; return fqBASESEQ; }
-	YY_BREAK
-case 12:
-/* rule 12 can match eol */
-YY_RULE_SETUP
-{ BEGIN 0; return fqCOLORSEQ; }
-	YY_BREAK
-case 13:
-/* rule 13 can match eol */
-YY_RULE_SETUP
-{ BEGIN 0; return fqASCQUAL; }
-	YY_BREAK
-case 14:
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ BEGIN 0; return fqUNRECOGNIZED; }
-	YY_BREAK
-
-case 15:
-YY_RULE_SETUP
-{ BEGIN 0; return fqBASESEQ; }
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-{ BEGIN 0; return fqCOLORSEQ; }
-	YY_BREAK
-
-case 17:
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-{ return fqTOKEN; /* do not bother to parse the inside of the line */ }
-	YY_BREAK
-case 18:
-/* rule 18 can match eol */
-YY_RULE_SETUP
-{ BEGIN IN_QUALITY; ENDLINE }
-	YY_BREAK
-
-case 19:
-YY_RULE_SETUP
-{ } 
-	YY_BREAK
-
-case 20:
-/* rule 20 can match eol */
-YY_RULE_SETUP
-{ return fqASCQUAL; }
-	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-YY_RULE_SETUP
-{   /* if read was split across several lines, expect the same number of lines in quality */
-                                    if (yyextra->expectedQualityLines <= 1) 
-                                        BEGIN 0; 
-                                    else 
-                                        --yyextra->expectedQualityLines;
-                                    ENDLINE; 
-                                }
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-{ return yytext[0]; }
-	YY_BREAK
-
-case 23:
-/* rule 23 can match eol */
-YY_RULE_SETUP
-{ return fqASCQUAL; }
-	YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-{ BEGIN 0; ENDLINE; }
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-{ return yytext[0]; }
-	YY_BREAK
-
-case 26:
-/* rule 26 can match eol */
-YY_RULE_SETUP
-{ ENDLINE; }
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-ECHO;
-	YY_BREAK
-			case YY_STATE_EOF(INITIAL):
-			case YY_STATE_EOF(TAG_LINE):
-			case YY_STATE_EOF(SEE_COORDS):
-			case YY_STATE_EOF(PAST_COORDS):
-			case YY_STATE_EOF(READ_NUMBER):
-			case YY_STATE_EOF(NAMEVALUE):
-			case YY_STATE_EOF(IN_SEQUENCE):
-			case YY_STATE_EOF(QTAG_LINE):
-			case YY_STATE_EOF(IN_QUALITY):
-			case YY_STATE_EOF(INLINE_SEQUENCE):
-			case YY_STATE_EOF(INLINE_QUALITY):
-				yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yyg->yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * FASTQ_lex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state( yyscanner );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
-
-			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer( yyscanner ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yyg->yy_did_buffer_switch_on_eof = 0;
-
-				if ( FASTQ_wrap(yyscanner ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yyg->yy_c_buf_p =
-					yyg->yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yyg->yy_c_buf_p =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-} /* end of FASTQ_lex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = yyg->yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-	else
-		{
-			int num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	if ( yyg->yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			FASTQ_restart(yyin  ,yyscanner);
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) FASTQ_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	yyg->yy_n_chars += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	yy_current_state = yyg->yy_start;
-	yy_current_state += YY_AT_BOL();
-
-	yyg->yy_state_ptr = yyg->yy_state_buf;
-	*yyg->yy_state_ptr++ = yy_current_state;
-
-	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 112 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		*yyg->yy_state_ptr++ = yy_current_state;
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
-{
-	register int yy_is_jam;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
-
-	register YY_CHAR yy_c = 1;
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 112 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 111);
-	if ( ! yy_is_jam )
-		*yyg->yy_state_ptr++ = yy_current_state;
-
-	return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
-{
-	register char *yy_cp;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-    yy_cp = yyg->yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yyg->yy_hold_char;
-
-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yyg->yy_n_chars + 2;
-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-		register char *source =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-    if ( c == '\n' ){
-        --yylineno;
-    }
-
-	yyg->yytext_ptr = yy_bp;
-	yyg->yy_hold_char = *yy_cp;
-	yyg->yy_c_buf_p = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (yyscan_t yyscanner)
-#else
-    static int input  (yyscan_t yyscanner)
-#endif
-
-{
-	int c;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	*yyg->yy_c_buf_p = yyg->yy_hold_char;
-
-	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			/* This was really a NUL. */
-			*yyg->yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-			++yyg->yy_c_buf_p;
-
-			switch ( yy_get_next_buffer( yyscanner ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					FASTQ_restart(yyin ,yyscanner);
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( FASTQ_wrap(yyscanner ) )
-						return EOF;
-
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput(yyscanner);
-#else
-					return input(yyscanner);
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
-	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
-	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
-		   
-    do{ yylineno++;
-        yycolumn=0;
-    }while(0)
-;
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * @param yyscanner The scanner object.
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void FASTQ_restart  (FILE * input_file , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if ( ! YY_CURRENT_BUFFER ){
-        FASTQ_ensure_buffer_stack (yyscanner);
-		YY_CURRENT_BUFFER_LVALUE =
-            FASTQ__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-	}
-
-	FASTQ__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
-	FASTQ__load_buffer_state(yyscanner );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * @param yyscanner The scanner object.
- */
-    void FASTQ__switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		FASTQ_pop_buffer_state();
-	 *		FASTQ_push_buffer_state(new_buffer);
-     */
-	FASTQ_ensure_buffer_stack (yyscanner);
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	FASTQ__load_buffer_state(yyscanner );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (FASTQ_wrap()) processing, but the only time this flag
-	 * is looked at is after FASTQ_wrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-static void FASTQ__load_buffer_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	yyg->yy_hold_char = *yyg->yy_c_buf_p;
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * @param yyscanner The scanner object.
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE FASTQ__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) FASTQ_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in FASTQ__create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) FASTQ_alloc(b->yy_buf_size + 2 ,yyscanner );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in FASTQ__create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	FASTQ__init_buffer(b,file ,yyscanner);
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with FASTQ__create_buffer()
- * @param yyscanner The scanner object.
- */
-    void FASTQ__delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		FASTQ_free((void *) b->yy_ch_buf ,yyscanner );
-
-	FASTQ_free((void *) b ,yyscanner );
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a FASTQ_restart() or at EOF.
- */
-    static void FASTQ__init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
-
-{
-	int oerrno = errno;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	FASTQ__flush_buffer(b ,yyscanner);
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then FASTQ__init_buffer was _probably_
-     * called from FASTQ_restart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * @param yyscanner The scanner object.
- */
-    void FASTQ__flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		FASTQ__load_buffer_state(yyscanner );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  @param yyscanner The scanner object.
- */
-void FASTQ_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (new_buffer == NULL)
-		return;
-
-	FASTQ_ensure_buffer_stack(yyscanner);
-
-	/* This block is copied from FASTQ__switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		yyg->yy_buffer_stack_top++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from FASTQ__switch_to_buffer. */
-	FASTQ__load_buffer_state(yyscanner );
-	yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  @param yyscanner The scanner object.
- */
-void FASTQ_pop_buffer_state (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (!YY_CURRENT_BUFFER)
-		return;
-
-	FASTQ__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if (yyg->yy_buffer_stack_top > 0)
-		--yyg->yy_buffer_stack_top;
-
-	if (YY_CURRENT_BUFFER) {
-		FASTQ__load_buffer_state(yyscanner );
-		yyg->yy_did_buffer_switch_on_eof = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void FASTQ_ensure_buffer_stack (yyscan_t yyscanner)
-{
-	int num_to_alloc;
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-	if (!yyg->yy_buffer_stack) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-		num_to_alloc = 1;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)FASTQ_alloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in FASTQ_ensure_buffer_stack()" );
-								  
-		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		yyg->yy_buffer_stack_max = num_to_alloc;
-		yyg->yy_buffer_stack_top = 0;
-		return;
-	}
-
-	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)FASTQ_realloc
-								(yyg->yy_buffer_stack,
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in FASTQ_ensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
-		yyg->yy_buffer_stack_max = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE FASTQ__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) FASTQ_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in FASTQ__scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	FASTQ__switch_to_buffer(b ,yyscanner );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to FASTQ_lex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       FASTQ__scan_bytes() instead.
- */
-YY_BUFFER_STATE FASTQ__scan_string (yyconst char * yystr , yyscan_t yyscanner)
-{
-    
-	return FASTQ__scan_bytes(yystr,strlen(yystr) ,yyscanner);
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to FASTQ_lex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE FASTQ__scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) FASTQ_alloc(n ,yyscanner );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in FASTQ__scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = FASTQ__scan_buffer(buf,n ,yyscanner);
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in FASTQ__scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-    static void yy_push_state (int  new_state , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yyg->yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yyg->yy_start_stack_depth * sizeof( int );
-
-		if ( ! yyg->yy_start_stack )
-			yyg->yy_start_stack = (int *) FASTQ_alloc(new_size ,yyscanner );
-
-		else
-			yyg->yy_start_stack = (int *) FASTQ_realloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
-
-		if ( ! yyg->yy_start_stack )
-			YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-		}
-
-	yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-}
-
-    static void yy_pop_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( --yyg->yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
-}
-
-    static int yy_top_state  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
-{
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		yytext[yyleng] = yyg->yy_hold_char; \
-		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
-		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
-		*yyg->yy_c_buf_p = '\0'; \
-		yyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the user-defined data for this scanner.
- * @param yyscanner The scanner object.
- */
-YY_EXTRA_TYPE FASTQ_get_extra  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyextra;
-}
-
-/** Get the current line number.
- * @param yyscanner The scanner object.
- */
-int FASTQ_get_lineno  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
-        if (! YY_CURRENT_BUFFER)
-            return 0;
-    
-    return yylineno;
-}
-
-/** Get the current column number.
- * @param yyscanner The scanner object.
- */
-int FASTQ_get_column  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
-        if (! YY_CURRENT_BUFFER)
-            return 0;
-    
-    return yycolumn;
-}
-
-/** Get the input stream.
- * @param yyscanner The scanner object.
- */
-FILE *FASTQ_get_in  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyin;
-}
-
-/** Get the output stream.
- * @param yyscanner The scanner object.
- */
-FILE *FASTQ_get_out  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyout;
-}
-
-/** Get the length of the current token.
- * @param yyscanner The scanner object.
- */
-int FASTQ_get_leng  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyleng;
-}
-
-/** Get the current token.
- * @param yyscanner The scanner object.
- */
-
-char *FASTQ_get_text  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yytext;
-}
-
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * @param yyscanner The scanner object.
- */
-void FASTQ_set_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyextra = user_defined ;
-}
-
-/** Set the current line number.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void FASTQ_set_lineno (int  line_number , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-        /* lineno is only valid if an input buffer exists. */
-        if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "FASTQ_set_lineno called with no buffer" , yyscanner); 
-    
-    yylineno = line_number;
-}
-
-/** Set the current column.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void FASTQ_set_column (int  column_no , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-        /* column is only valid if an input buffer exists. */
-        if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "FASTQ_set_column called with no buffer" , yyscanner); 
-    
-    yycolumn = column_no;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * @param yyscanner The scanner object.
- * @see FASTQ__switch_to_buffer
- */
-void FASTQ_set_in (FILE *  in_str , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyin = in_str ;
-}
-
-void FASTQ_set_out (FILE *  out_str , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyout = out_str ;
-}
-
-int FASTQ_get_debug  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yy_flex_debug;
-}
-
-void FASTQ_set_debug (int  bdebug , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yy_flex_debug = bdebug ;
-}
-
-/* Accessor methods for yylval and yylloc */
-
-YYSTYPE * FASTQ_get_lval  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yylval;
-}
-
-void FASTQ_set_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yylval = yylval_param;
-}
-
-/* User-visible API */
-
-/* FASTQ_lex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-
-int FASTQ_lex_init(yyscan_t* ptr_yy_globals)
-
-{
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t) FASTQ_alloc ( sizeof( struct yyguts_t ), NULL );
-
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-/* FASTQ_lex_init_extra has the same functionality as FASTQ_lex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to FASTQ_alloc in
- * the yyextra field.
- */
-
-int FASTQ_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
-{
-    struct yyguts_t dummy_yyguts;
-
-    FASTQ_set_extra (yy_user_defined, &dummy_yyguts);
-
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-	
-    *ptr_yy_globals = (yyscan_t) FASTQ_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-	
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-    
-    /* By setting to 0xAA, we expose bugs in
-    yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-    
-    FASTQ_set_extra (yy_user_defined, *ptr_yy_globals);
-    
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-static int yy_init_globals (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from FASTQ_lex_destroy(), so don't allocate here.
-     */
-
-    yyg->yy_buffer_stack = 0;
-    yyg->yy_buffer_stack_top = 0;
-    yyg->yy_buffer_stack_max = 0;
-    yyg->yy_c_buf_p = (char *) 0;
-    yyg->yy_init = 0;
-    yyg->yy_start = 0;
-
-    yyg->yy_start_stack_ptr = 0;
-    yyg->yy_start_stack_depth = 0;
-    yyg->yy_start_stack =  NULL;
-
-    yyg->yy_state_buf = 0;
-    yyg->yy_state_ptr = 0;
-    yyg->yy_full_match = 0;
-    yyg->yy_lp = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * FASTQ_lex_init()
-     */
-    return 0;
-}
-
-/* FASTQ_lex_destroy is for both reentrant and non-reentrant scanners. */
-int FASTQ_lex_destroy  (yyscan_t yyscanner)
-{
-    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		FASTQ__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		FASTQ_pop_buffer_state(yyscanner);
-	}
-
-	/* Destroy the stack itself. */
-	FASTQ_free(yyg->yy_buffer_stack ,yyscanner);
-	yyg->yy_buffer_stack = NULL;
-
-    /* Destroy the start condition stack. */
-        FASTQ_free(yyg->yy_start_stack ,yyscanner );
-        yyg->yy_start_stack = NULL;
-
-    FASTQ_free ( yyg->yy_state_buf , yyscanner);
-    yyg->yy_state_buf  = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * FASTQ_lex() is called, initialization will occur. */
-    yy_init_globals( yyscanner);
-
-    /* Destroy the main struct (reentrant only). */
-    FASTQ_free ( yyscanner , yyscanner );
-    yyscanner = NULL;
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
-{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
-{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *FASTQ_alloc (yy_size_t  size , yyscan_t yyscanner)
-{
-	return (void *) malloc( size );
-}
-
-void *FASTQ_realloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
-{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-}
-
-void FASTQ_free (void * ptr , yyscan_t yyscanner)
-{
-	free( (char *) ptr );	/* see FASTQ_realloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-rc_t CC FASTQScan_yylex_init(FASTQParseBlock* sb, bool debug)
-{
-	if (FASTQ_lex_init_extra(sb,&sb->scanner) != 0)
-	{
-		return RC ( rcKFG, rcMgr, rcParsing, rcMemory, rcExhausted );
-	}		
-
-    sb->length = 0;
-    sb->lastToken = NULL;
-    sb->record = NULL;
-    sb->column = 1;
-    KDataBufferMakeBytes( &sb->tagLine, 1024);
-    
-    sb->spotNameLength = 0;
-    sb->spotNameDone = false;
-    sb->spotGroupOffset = 0;
-    sb->spotGroupLength = 0;
-
-    KDataBufferMakeBytes( &sb->quality, 1024);
-    sb->expectedQualityLines = 0;
-    
-	FASTQ_set_debug(debug ? 1 : 0,sb->scanner);
-
-    yy_push_state(INITIAL, sb->scanner);
-    
-	return 0;
-}
-
-void CC FASTQScan_yylex_destroy(FASTQParseBlock* sb)
-{
-    KDataBufferWhack( & sb->tagLine);
-    KDataBufferWhack( & sb->quality);
-	if (sb->scanner)
-	{
-		FASTQ_lex_destroy(sb->scanner);
-	}		
-	sb->scanner=0;
-}
-
-void CC FASTQScan_inline_sequence(FASTQParseBlock* pb)
-{
-    yy_pop_state(pb->scanner);
-    yy_push_state(INLINE_SEQUENCE, pb->scanner);
-}
-
-void CC FASTQScan_inline_quality(FASTQParseBlock* pb)
-{
-    yy_pop_state(pb->scanner);
-    yy_push_state(INLINE_QUALITY, pb->scanner);
-}
-
-void CC FASTQ_unlex(FASTQParseBlock* pb, FASTQToken* token)
-{
-    size_t i;
-    struct yyguts_t* yyg = (struct yyguts_t*)pb->scanner;
-    for (i = 0; i < token->tokenLength; ++i)
-    {
-        yyunput(token->tokenText[token->tokenLength-1-i], yyg->yytext_r, pb->scanner);
-    }
-    yyextra -> column -= token->tokenLength; 
-    yyextra -> length -= token->tokenLength; 
-}
-
diff --git a/tools/fastq-loader/fastq-lex.l b/tools/fastq-loader/fastq-lex.l
deleted file mode 100644
index 64481aa..0000000
--- a/tools/fastq-loader/fastq-lex.l
+++ /dev/null
@@ -1,294 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
- 
-%{ 
-    #include <ctype.h>
-    
-    #include <klib/rc.h>
-
-	#include "fastq-parse.h"
-	#include "fastq-tokens.h"    
-	
-    #define YYSTYPE FASTQToken
-
-    /* code to populate token with internal values */
-    #define YY_USER_ACTION              \
-        yylval -> tokenText		= yytext;	\
-        yylval -> tokenLength	= yyleng;	\
-        yylval -> line_no		= yylineno;	\
-        yylval -> column_no		= yyextra -> column; \
-        yyextra -> column += yyleng; \
-        yyextra -> length += yyleng; \
-        yyextra -> lastToken = yylval; 
-
-    #define ENDLINE \
-        yyextra -> column=1;\
-        return fqENDLINE;
-
-    #define YY_INPUT(buf, result, max_size) \
-        result = yyextra->input(yyextra, buf, max_size)
-
-    #define ECHO
-
-    static bool IsDecList(const char*, size_t*, int*);
-
-    #define CHECK_FOR_DECLIST                               \
-        int token;                                          \
-        size_t firstNumLen = yylval -> tokenLength;         \
-        if (IsDecList(yytext, & firstNumLen, & token))      \
-        {                                                   \
-            yyextra -> column -= (yyleng - firstNumLen);    \
-            yyextra -> length -= (yyleng - firstNumLen);    \
-            yylval -> tokenLength   = firstNumLen;          \
-            BEGIN DECLIST;                                  \
-            yyless(firstNumLen);                            \
-            return token;                                   \
-        }
-%}
-
-%option never-interactive nounistd yylineno reentrant bison-bridge stack noyywrap
-
-%option prefix="FASTQ_"
-%option extra-type="FASTQParseBlock*"
-
- /*%option debug*/
-
-%x TAG_LINE
-%x SEE_COORDS
-%x PAST_COORDS
-%x READ_NUMBER
-%x NAMEVALUE
-%x IN_SEQUENCE
-%x QTAG_LINE
-%x IN_QUALITY
-%x INLINE_SEQUENCE
-%x INLINE_QUALITY
-%x DECLIST
-
-ws          [ \t]+
-digits      [0-9]+
-alphanum    [A-Za-z0-9]+
-eol         (\r\n|\r|\n)
-
-/* there are more: =ACMGRSVTWYHKDBN. plus lowercase */
-base [ACGTacgtNn.]   
-cskey [ACGTacgt]
-color   [0-3.]
-
-asc33qual   [\x0E-\x1F \x21-\x7E]+
-asc64qual   [\x40-\x7E]+
-
-%%
-
-^@                              { BEGIN TAG_LINE; return yytext[0]; }
-^>                              { BEGIN TAG_LINE; return yytext[0]; }
-
-^\+                             { BEGIN QTAG_LINE; return yytext[0]; }
-
-<INITIAL,TAG_LINE>
-{
-    {digits}                    { return fqNUMBER; }
-    {alphanum}                  { return fqALPHANUM; }
-    {ws}                        { return fqWS; }
-    .                           { return yytext[0]; }
-}
-
-<TAG_LINE>[ \t]*{eol}           { BEGIN IN_SEQUENCE; ENDLINE; }
-
-<IN_SEQUENCE>
-{
-    ^{base}+/{eol}              { BEGIN 0; return fqBASESEQ; }
-    ^{cskey}{color}+/{eol}      { BEGIN 0; return fqCOLORSEQ; }
-    ^{asc64qual}/{eol}          { CHECK_FOR_DECLIST; BEGIN 0; return fqASC64QUAL; }
-    ^{asc33qual}/{eol}          { CHECK_FOR_DECLIST; BEGIN 0; return fqASC33QUAL; }
-    ^.*$                        { BEGIN 0; return fqUNRECOGNIZED; }
-}
-
-<INLINE_SEQUENCE>
-{
-    {base}+                     { BEGIN 0; return fqBASESEQ; }
-    {cskey}{color}+             { BEGIN 0; return fqCOLORSEQ; }
-}
-
-<QTAG_LINE>
-{
-    .+$                         { return fqTOKEN; /* do not bother to parse the inside of the line */ }
-    {eol}                       { BEGIN IN_QUALITY; ENDLINE }
-}
-
-<IN_QUALITY,INLINE_QUALITY,DECLIST>
-{
-    {ws}                        { } 
-    {digits}                    { BEGIN DECLIST; return fqNUMBER; }
-}
-
-<IN_QUALITY>
-{
-    ^{asc64qual}/{eol}          { CHECK_FOR_DECLIST; return fqASC64QUAL; }
-    ^{asc33qual}/{eol}          { CHECK_FOR_DECLIST; return fqASC33QUAL; }
-    {eol}                       { BEGIN 0; ENDLINE; }
-    .                           { return yytext[0]; }
-}
-
-<INLINE_QUALITY>
-{
-    {digits}/{eol}              { BEGIN DECLIST; return fqNUMBER; }
-    {asc64qual}/{eol}           { CHECK_FOR_DECLIST; return fqASC64QUAL; }
-    {asc33qual}/{eol}           { CHECK_FOR_DECLIST; return fqASC33QUAL; }
-    {eol}                       { BEGIN 0; ENDLINE; }
-    .                           { return yytext[0]; }
-}
-
-<DECLIST>
-{
-    {digits}/{eol}              { return fqNUMBER; }
-    {eol}                       { BEGIN 0; ENDLINE; }
-    .                           { return yytext[0]; }
-}
-
-{eol}                           { ENDLINE; }
-
-%%    
-
-rc_t CC FASTQScan_yylex_init(FASTQParseBlock* sb, bool debug)
-{
-	if (yylex_init_extra(sb, &sb->scanner) != 0)
-	{
-		return RC ( rcKFG, rcMgr, rcParsing, rcMemory, rcExhausted );
-	}		
-
-	yyset_debug(debug ? 1 : 0, sb->scanner);
-
-    yy_push_state(INITIAL, sb->scanner);
-
-    sb->column = 1;
-
-	return 0;
-}
-
-void CC FASTQScan_yylex_destroy(FASTQParseBlock* sb)
-{
-	if (sb->scanner)
-	{
-		yylex_destroy(sb->scanner);
-	}		
-	sb->scanner=0;
-}
-
-void CC FASTQScan_inline_sequence(FASTQParseBlock* pb)
-{
-    yy_pop_state(pb->scanner);
-    yy_push_state(INLINE_SEQUENCE, pb->scanner);
-}
-
-void CC FASTQScan_inline_quality(FASTQParseBlock* pb)
-{
-    yy_pop_state(pb->scanner);
-    yy_push_state(INLINE_QUALITY, pb->scanner);
-}
-
-/* 
- * True if the token appears to be a comma/whitespace separated list of signed decimals, each no longer than 3 decimal positions.
- */
-bool IsDecList(const char* token, size_t* size, int* p_newToken)
-{
-    size_t firstTokenSize = 0;
-    size_t curNumberSize = 0;
-    int newToken;
-    bool inFirstToken = true;
-    size_t i;
-    for (i=0; i < *size; ++i)
-    {
-        char ch=token[i];
-        if (strchr("0123456789, -+", ch) == NULL)
-        {
-            return false;
-        }
-        if (inFirstToken)
-        {
-            if (i == 0)
-            {   /* decide on the first character */ 
-                if (isdigit(ch))
-                {
-                    newToken = fqNUMBER;
-                    firstTokenSize = 1;
-                    curNumberSize = 1;
-                }
-                else if (ch == '-' || ch == '+')
-                {
-                    newToken = ch;
-                    firstTokenSize = 1;
-                    inFirstToken = false;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-            else if (isdigit(ch))
-            {   /* keep on tracking the first token's size */
-                ++firstTokenSize;
-                ++curNumberSize;
-                if (curNumberSize > 3)
-                {
-                    return false;
-                }
-            }
-            else
-            {   /* end of the first token */ 
-                curNumberSize = 0;
-                inFirstToken = false;
-            }
-        }
-        else if (isdigit(ch))
-        {   /* keep on tracking the current number's size */
-            ++curNumberSize;
-            if (curNumberSize > 3)
-            {
-                return false;
-            }
-        }
-        else
-        {
-            curNumberSize = 0;
-        }
-    }
-    *size = firstTokenSize;
-    *p_newToken = newToken;
-    return true;
-}
-
-void CC FASTQ_unlex(FASTQParseBlock* pb, FASTQToken* token)
-{
-    size_t i;
-    struct yyguts_t* yyg = (struct yyguts_t*)pb->scanner;
-    for (i = 0; i < token->tokenLength; ++i)
-    {
-        yyunput(token->tokenText[token->tokenLength-1-i], yyg->yytext_r, pb->scanner);
-    }
-    yyextra -> column -= token->tokenLength; 
-    yyextra -> length -= token->tokenLength; 
-}
diff --git a/tools/fastq-loader/fastq-loader.c b/tools/fastq-loader/fastq-loader.c
deleted file mode 100644
index 0cccd6d..0000000
--- a/tools/fastq-loader/fastq-loader.c
+++ /dev/null
@@ -1,543 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- * 
- */
-
-#include "latf-load.vers.h"
-
-#include <sysalloc.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <loader/common-writer.h>
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <kapp/log-xml.h>
-#include <align/writer-refseq.h>
-
-extern rc_t run(char const argv0[], 
-                struct CommonWriterSettings* G,
-                unsigned countReads, 
-                const char* reads[],
-                uint8_t qualityOffset,
-                const int8_t defaultReadNumbers[]);
-
-/* MARK: Arguments and Usage */
-static char const option_input[] = "input";
-static char const option_output[] = "output";
-static char const option_tmpfs[] = "tmpfs";
-static char const option_qual_compress[] = "qual-quant";
-static char const option_cache_size[] = "cache-size";
-static char const option_max_err_count[] = "max-err-count";
-static char const option_max_rec_count[] = "max-rec-count";
-static char const option_platform[] = "platform";
-static char const option_quality[] = "quality";
-static char const option_read[] = "read";
-static char const option_max_err_pct[] = "max-err-pct";
-
-#define OPTION_INPUT option_input
-#define OPTION_OUTPUT option_output
-#define OPTION_TMPFS option_tmpfs
-#define OPTION_QCOMP option_qual_compress
-#define OPTION_CACHE_SIZE option_cache_size
-#define OPTION_MAX_ERR_COUNT option_max_err_count
-#define OPTION_MAX_REC_COUNT option_max_rec_count
-#define OPTION_PLATFORM option_platform
-#define OPTION_QUALITY option_quality
-#define OPTION_READ option_read
-#define OPTION_MAX_ERR_PCT option_max_err_pct
-
-#define ALIAS_INPUT  "i"
-#define ALIAS_OUTPUT "o"
-#define ALIAS_TMPFS "t"
-#define ALIAS_QCOMP "Q"
-#define ALIAS_MAX_ERR_COUNT "E"
-#define ALIAS_PLATFORM "p"
-#define ALIAS_READ "r"
-/* this alias is deprecated (conflicts with -q for --quiet): */
-#define ALIAS_QUALITY "q"
-
-static
-char const * output_usage[] = 
-{
-    "Path and Name of the output database.",
-    NULL
-};
-
-static
-char const * tmpfs_usage[] = 
-{
-    "Path to be used for scratch files.",
-    NULL
-};
-
-static
-char const * qcomp_usage[] = 
-{
-    "Quality scores quantization level, can be a number (0: none - default, 1: 2bit, 2: 1bit), or a string like '1:10,10:20,20:30,30:-' (which is equivalent to 1).",
-    NULL
-};
-
-static
-char const * cache_size_usage[] = 
-{
-    "Set the cache size in MB for the temporary indices",
-    NULL
-};
-
-static
-char const * mrc_usage[] = 
-{
-    "Set the maximum number of records to process from the FASTQ file",
-    NULL
-};
-
-static
-char const * mec_usage[] = 
-{
-    "Set the maximum number of errors to ignore from the FASTQ file",
-    NULL
-};
-
-static
-char const * use_platform[] = 
-{
-    "Platform (ILLUMINA, LS454, SOLID, COMPLETE_GENOMICS, HELICOS, PACBIO, IONTORRENT, CAPILLARY)",
-    NULL
-};
-
-static
-char const * use_quality[] = 
-{
-    "Quality encoding (PHRED_33, PHRED_64)",
-    NULL
-};
-
-/*static
-char const * use_read[] = 
-{
-    "Default read number (1 or 2)",
-    NULL
-};*/
-
-static
-char const * use_max_err_pct[] = 
-{
-    "acceptable percentage of spots creation errors, default is 5",
-    NULL
-};
-
-OptDef Options[] = 
-{
-    /* order here is same as in param array below!!! */               /* max#,  needs param, required */
-    { OPTION_OUTPUT,        ALIAS_OUTPUT,           NULL, output_usage,     1,  true,        true },
-    { OPTION_TMPFS,         ALIAS_TMPFS,            NULL, tmpfs_usage,      1,  true,        false },
-    { OPTION_QCOMP,         ALIAS_QCOMP,            NULL, qcomp_usage,      1,  true,        false },
-    { OPTION_CACHE_SIZE,    NULL,                   NULL, cache_size_usage, 1,  true,        false },
-    { OPTION_MAX_REC_COUNT, NULL,                   NULL, mrc_usage,        1,  true,        false },
-    { OPTION_MAX_ERR_COUNT, ALIAS_MAX_ERR_COUNT,    NULL, mec_usage,        1,  true,        false },
-    { OPTION_PLATFORM,      ALIAS_PLATFORM,         NULL, use_platform,     1,  true,        false },
-    { OPTION_QUALITY,       ALIAS_QUALITY,          NULL, use_quality,      1,  true,        true },
-    { OPTION_MAX_ERR_PCT,   NULL,                   NULL, use_max_err_pct,  1,  true,        false },
-/*    { OPTION_READ,          ALIAS_READ,             NULL, use_read,         0,  true,        false },*/
-};
-
-const char* OptHelpParam[] =
-{
-    /* order here is same as in OptDef array above!!! */
-    "path",
-    "path-to-file",
-    "phred-score",
-    "mbytes",
-    "count",
-    "count",
-    NULL,
-    NULL,
-    NULL,
-};
-
-rc_t UsageSummary (char const * progname)
-{
-    return KOutMsg (
-        "Usage:\n"
-        "\t%s [options] <fastq-file> ...\n"
-        "\n"
-        "Summary:\n"
-        "\tLoad FASTQ formatted data files\n"
-        "\n"
-        "Example:\n"
-        "\t%s -p 454 -o /tmp/SRZ123456 123456-1.fastq 123456-2.fastq\n"
-        "\n"
-        ,progname, progname);
-}
-
-char const UsageDefaultName[] = "fastq-load";
-
-rc_t CC Usage (const Args * args)
-{
-    rc_t rc;
-    int i;
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    const size_t argsQty = sizeof(Options) / sizeof(Options[0]);
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    for(i = 0; i < argsQty; i++ ) {
-        if( Options[i].required && Options[i].help[0] != NULL ) {
-            HelpOptionLine(Options[i].aliases, Options[i].name, OptHelpParam[i], Options[i].help);
-        }
-    }
-    OUTMSG(("\nOptions:\n"));
-    for(i = 0; i < argsQty; i++ ) {
-        if( !Options[i].required && Options[i].help[0] != NULL ) {
-            HelpOptionLine(Options[i].aliases, Options[i].name, OptHelpParam[i], Options[i].help);
-        }
-    }
-    XMLLogger_Usage();
-    OUTMSG(("\n"));
-    HelpOptionsStandard ();
-    HelpVersion (fullpath, KAppVersion());
-    return rc;
-}
-
-/* MARK: Definitions and Globals */
-
-#define SCHEMAFILE "align/align.vschema"
-
-CommonWriterSettings G;
-
-uint32_t CC KAppVersion (void)
-{
-    return LATF_LOAD_VERS;
-}
-
-#ifdef _WIN32
-#include <process.h>
-#else
-#include <unistd.h>
-#endif
-static void set_pid(void)
-{
-    G.pid = getpid();
-}
-
-static rc_t PathWithBasePath(char rslt[], size_t sz, char const path[], char const base[])
-{
-    size_t const plen = strlen(path);
-    bool const hasBase = base && base[0];
-    bool const isBareName = strchr(path, '/') == NULL;
-    
-    if (isBareName && hasBase) {
-        if (string_printf(rslt, sz, NULL, "%s/%s", base, path) == 0)
-            return 0;
-    }
-    else if (plen < sz) {
-        strcpy(rslt, path);
-        return 0;
-    }
-    {
-        rc_t const rc = RC(rcApp, rcArgv, rcAccessing, rcBuffer, rcInsufficient);
-        (void)LOGERR(klogErr, rc, "The path to the file is too long");
-        return rc;
-    }
-}
-
-rc_t CC KMain (int argc, char * argv[])
-{
-    Args * args;
-    rc_t rc;
-    char *files[256];
-    int8_t defaultReadNumbers[256];
-    char *name_buffer = NULL;
-    unsigned next_name = 0;
-    unsigned nbsz = 0;
-    char const *value;
-    char *dummy;
-    const XMLLogger* xml_logger = NULL;
-    uint8_t qualityOffset;
-    
-    memset(&G, 0, sizeof(G));
-    
-    G.mode = mode_Archive;
-    G.maxSeqLen = TableWriterRefSeq_MAX_SEQ_LEN;
-    G.schemaPath = SCHEMAFILE;
-    G.omit_aligned_reads = true;
-    G.omit_reference_reads = true;
-    G.minMapQual = 0; /* accept all */
-    G.tmpfs = "/tmp";
-#if _ARCH_BITS == 32
-    G.cache_size = ( size_t ) 1 << 30;
-#else
-    G.cache_size = ( size_t ) 10 << 30;
-#endif
-    G.maxErrCount = 1000;
-    G.maxErrPct = 5;
-    G.acceptNoMatch = true; 
-    G.minMatchCount = 0; 
-    G.QualQuantizer="0";
-    
-    set_pid();
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 2, Options,
-                            sizeof Options / sizeof (OptDef), XMLLogger_Args, XMLLogger_ArgsQty);
-
-    while (rc == 0) {
-        uint32_t pcount;
-
-        if( (rc = XMLLogger_Make(&xml_logger, NULL, args)) != 0 ) {
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_TMPFS, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_TMPFS, 0, &G.tmpfs);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_OUTPUT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_OUTPUT, 0, &G.outpath);
-            if (rc)
-                break;
-        }
-        else if (pcount > 1)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            OUTMSG (("Single output parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        else {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcInsufficient);
-            OUTMSG (("Output parameter required\n"));
-            MiniUsage (args);
-            break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_QCOMP, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_QCOMP, 0, &G.QualQuantizer);
-            if (rc)
-                break;
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_CACHE_SIZE, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_CACHE_SIZE, 0, &value);
-            if (rc)
-                break;
-            G.cache_size = strtoul(value, &dummy, 0) * 1024UL * 1024UL;
-            if (G.cache_size == 0  || G.cache_size == ULONG_MAX) {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcIncorrect);
-                OUTMSG (("cache-size: bad value\n"));
-                MiniUsage (args);
-                break;
-            }
-        }
-        
-        G.expectUnsorted = true;
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_REC_COUNT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_REC_COUNT, 0, &value);
-            if (rc)
-                break;
-            G.maxAlignCount = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_ERR_COUNT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_ERR_COUNT, 0, &value);
-            if (rc)
-                break;
-            G.maxErrCount = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_MAX_ERR_PCT, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_MAX_ERR_PCT, 0, &value);
-            if (rc)
-                break;
-            G.maxErrPct = strtoul(value, &dummy, 0);
-        }
-        
-        rc = ArgsOptionCount (args, OPTION_PLATFORM, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_PLATFORM, 0, &value);
-            if (rc)
-                break;
-            G.platform = PlatformToId(value);
-            if (G.platform == SRA_PLATFORM_UNDEFINED)
-            {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcIncorrect);
-                (void)PLOGERR(klogErr, (klogErr, rc, "Invalid platform $(v)",
-                            "v=%s", value));
-                break;
-            }
-        }
-        else
-            G.platform = SRA_PLATFORM_UNDEFINED;
-
-        rc = ArgsOptionCount (args, OPTION_QUALITY, &pcount);
-        if (rc)
-            break;
-        if (pcount == 1)
-        {
-            rc = ArgsOptionValue (args, OPTION_QUALITY, 0, &value);
-            if (rc)
-                break;
-            if (strcmp(value, "PHRED_33") == 0)
-                qualityOffset = 33;
-            else if (strcmp(value, "PHRED_64") == 0)
-                qualityOffset = 64;
-            else
-            {
-                rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcIncorrect);
-                (void)PLOGERR(klogErr, (klogErr, rc, "Invalid quality encoding $(v)",
-                            "v=%s", value));
-                break;
-            }
-        }
-        else
-            qualityOffset = 0;
-            
-        rc = ArgsParamCount (args, &pcount);
-        if (rc) break;
-        if (pcount == 0)
-        {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcInsufficient);
-            MiniUsage (args);
-            break;
-        }
-        else if (pcount > sizeof(files)/sizeof(files[0])) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcParam, rcExcessive);
-            (void)PLOGERR(klogErr, (klogErr, rc, "$(count) input files is too many, $(max) is the limit",
-                        "count=%u,max=%u", (unsigned)pcount, (unsigned)(sizeof(files)/sizeof(files[0]))));
-            break;
-        }
-        else {
-            unsigned need = G.inpath ? (strlen(G.inpath) + 1) * pcount : 0;
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsParamValue(args, i, &value);
-                if (rc) break;
-                need += strlen(value) + 1;
-            }
-            nbsz = need;
-        }
-        
-        name_buffer = malloc(nbsz);
-        if (name_buffer == NULL) {
-            rc = RC(rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted);
-            break;
-        }
-        
-        rc = ArgsParamCount (args, &pcount);
-        if (rc == 0) {
-            unsigned i;
-            
-            for (i = 0; i < pcount; ++i) {
-                rc = ArgsParamValue(args, i, &value);
-                if (rc) break;
-
-                defaultReadNumbers[i] = 0;
-                files[i] = name_buffer + next_name;
-                rc = PathWithBasePath(name_buffer + next_name, nbsz - next_name, value, G.inpath);
-                if (rc) break;
-                next_name += strlen(name_buffer + next_name) + 1;
-            }
-        }
-        else
-            break;
-        
-        rc = run(argv[0], &G, pcount, (char const **)files, qualityOffset, defaultReadNumbers);
-        break;
-    }
-    free(name_buffer);
-
-    value = G.outpath ? strrchr(G.outpath, '/') : "/???";
-    if( value == NULL ) {
-        value = G.outpath;
-    } else {
-        value++;
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "load failed",
-                "severity=total,status=failure,accession=%s,errors=%u", value, G.errCount));
-    } else {
-        (void)PLOGMSG(klogInfo, (klogInfo, "loaded",
-                "severity=total,status=success,accession=%s,errors=%u", value, G.errCount));
-    }
-    ArgsWhack(args);
-    XMLLogger_Release(xml_logger);
-    return rc;
-}
diff --git a/tools/fastq-loader/fastq-parse.h b/tools/fastq-loader/fastq-parse.h
deleted file mode 100644
index bce7ee6..0000000
--- a/tools/fastq-loader/fastq-parse.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_fastq_parse_
-#define _h_fastq_parse_
-
-#include <align/extern.h>
-#include <klib/text.h>
-
-#include <loader/common-reader-priv.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* values used in validating quality lines */
-#define MIN_PHRED_33 33
-#define MAX_PHRED_33 74
-#define MIN_PHRED_64 64
-#define MAX_PHRED_64 127
-
-struct FastqSequence
-{
-    Sequence_vt sequence_vt;
-    KRefcount   refcount;
-
-    /* tagline components: */
-    String spotname; /* tag line up to and including coordinates */
-    String spotgroup; /* token following '#' */
-    uint8_t readnumber; /* token following '/' 1 - IsFirst, 2 - IsSecond, 0 - dont know */
-
-    /* not populated at this time: */
-#if 0
-    String rungroup; 
-    String fmt_name; /* x and y replaced with $X and $Y */
-    uint8_t coord_num;
-    int32_t coords[16];
-#endif
-
-    char* read;
-    bool is_colorspace;
-    
-    String  quality;
-    uint8_t qualityOffset;
-    
-    bool lowQuality;
-};
-
-struct FastqRecord
-{
-    Record  dad;
-
-    KDataBuffer source;
-    struct FastqSequence    seq;
-    Rejected*               rej; 
-};
-
-typedef struct FASTQToken
-{ 
-    const char* tokenText;
-    size_t tokenLength;
-    size_t line_no;
-    size_t column_no;
-} FASTQToken;
-
-typedef struct FASTQParseBlock
-{
-    void* self;
-    size_t (CC *input)(struct FASTQParseBlock* sb, char* buf, size_t max_size);
-    uint8_t phredOffset;
-    uint8_t maxPhred;
-    
-    void* scanner;
-    size_t length; /* input characters consumed for the current record */
-    FASTQToken* lastToken;
-    struct FastqRecord* record;
-    size_t column;
-
-    /* temporaries for bison: */
-    KDataBuffer tagLine;
-
-    size_t spotNameLength;
-    bool spotNameDone;
-    size_t spotGroupOffset;
-    size_t spotGroupLength;
-
-    KDataBuffer quality;
-    size_t expectedQualityLines;
-    
-    int8_t defaultReadNumber; /* -1: never assign read numbers */
-    
-    bool fatalError;
-} FASTQParseBlock;
-
-extern rc_t CC FASTQScan_yylex_init(FASTQParseBlock* context, bool debug);
-extern void CC FASTQScan_yylex_destroy(FASTQParseBlock* context);
-
-/* explicit FLEX state control for bison*/
-extern void CC FASTQScan_inline_sequence(FASTQParseBlock* pb);
-extern void CC FASTQScan_inline_quality(FASTQParseBlock* pb);
-
-extern void CC FASTQ_set_lineno (int line_number, void* scanner);
-
-extern int CC FASTQ_lex(FASTQToken* pb, void * scanner);
-extern void CC FASTQ_unlex(FASTQParseBlock* pb, FASTQToken* token);
-extern void CC FASTQ_qualityContext(FASTQParseBlock* pb);
-
-extern int FASTQ_debug; /* set to 1 to print Bison trace */ 
-
-extern int CC FASTQ_parse(FASTQParseBlock* pb); /* 0 = end of input, 1 = success, a new record is in context->record, 2 - syntax error */
-
-extern void CC FASTQ_error(FASTQParseBlock* pb, const char* msg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_fastq_parse_ */
diff --git a/tools/fastq-loader/fastq-reader.c b/tools/fastq-loader/fastq-reader.c
deleted file mode 100644
index c64d389..0000000
--- a/tools/fastq-loader/fastq-reader.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct FastqReaderFile  FastqReaderFile;
-typedef struct FastqRecord      FastqRecord;
-typedef struct FastqSequence    FastqSequence;
-
-#define READERFILE_IMPL FastqReaderFile
-#define RECORD_IMPL     FastqRecord
-#define SEQUENCE_IMPL   FastqSequence
-
-#include "fastq-reader.h"
-#include "fastq-parse.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-#include <kapp/loader-file.h>
-#include <kfs/directory.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-
-static rc_t FastqSequenceInit(FastqSequence* self);
-
-/*--------------------------------------------------------------------------
- * FastqRecord
- */
-static rc_t FastqRecordAddRef   ( const FastqRecord* self );
-static rc_t FastqRecordRelease  ( const FastqRecord* self );
-static rc_t FastqRecordGetSequence  ( const FastqRecord* self, const Sequence** result);
-static rc_t FastqRecordGetAlignment ( const FastqRecord* self, const Alignment** result);
-static rc_t FastqRecordGetRejected  ( const FastqRecord* self, const Rejected** result);
-
-static Record_vt_v1 FastqRecord_vt = 
-{
-    1, 0, 
-    /* start minor version == 0 */
-    FastqRecordAddRef,
-    FastqRecordRelease,
-    FastqRecordGetSequence,
-    FastqRecordGetAlignment,
-    FastqRecordGetRejected,
-    /* end minor version == 0 */
-};
-
-static rc_t CC FastqRecordInit ( FastqRecord* self )
-{
-    assert(self);
-    self->dad.vt.v1 = & FastqRecord_vt; 
-    KDataBufferMakeBytes ( & self->source, 0 );
-    self->rej = 0;
-    return FastqSequenceInit(& self->seq);
-}
-
-static rc_t FastqRecordWhack( const FastqRecord* cself )
-{
-    rc_t rc = 0;
-    FastqRecord* self = (FastqRecord*)cself;
-    assert(self);
-    
-    free((void*)self->seq.read);
-    
-    rc = KDataBufferWhack( & self->source );
-    
-    if (rc)
-        RejectedRelease(self->rej);
-    else
-        rc = RejectedRelease(self->rej);
-        
-    free(self);    
-      
-    return rc;
-}
-
-static rc_t FastqRecordAddRef( const FastqRecord* self )
-{
-    assert(self);
-    KRefcountAdd( & self->seq.refcount, "FastqRecord" );
-    /* TODO: handle rc from KRefcountAdd */
-    return 0;
-}
-
-static rc_t FastqRecordRelease( const FastqRecord* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqRecord *self = ( FastqRecord* ) cself;
-        switch ( KRefcountDrop ( & self ->seq.refcount, "FastqRecord" ) )
-        {
-        case krefWhack:
-            FastqRecordWhack( self );
-            break;
-        default:
-            /* TODO: handle other values */
-            break;
-        }
-    }
-    return 0;
-}
-
-static rc_t FastqRecordGetSequence( const FastqRecord* self, const Sequence** result )
-{
-    rc_t rc = 0;
-    assert(result);
-    *result = 0;
-    if (self->rej == 0)
-    {
-        rc = FastqRecordAddRef(self);
-        if (rc == 0)
-            *result = (const Sequence*) & self->seq;
-    }
-    return rc;
-}
-
-static rc_t FastqRecordGetAlignment( const FastqRecord* self, const Alignment** result)
-{
-    *result = 0;
-    return 0;
-}
-
-static rc_t FastqRecordGetRejected( const FastqRecord* self, const Rejected** result)
-{
-    rc_t rc = 0;
-    assert(result);
-    *result = 0;
-    if (self->rej != 0)
-    {
-        rc = RejectedAddRef(self->rej);
-        if (rc == 0)
-            *result = self->rej;
-    }
-    return rc;
-}
-
-/*--------------------------------------------------------------------------
- * FastqSequence
- */
-
-static rc_t FastqSequenceAddRef              ( const SEQUENCE_IMPL* self );
-static rc_t FastqSequenceRelease             ( const SEQUENCE_IMPL* self );
-static rc_t FastqSequenceGetReadLength       ( const SEQUENCE_IMPL *self, uint32_t *length );
-static rc_t FastqSequenceGetRead             ( const SEQUENCE_IMPL *self, char *sequence );
-static rc_t FastqSequenceGetRead2            ( const SEQUENCE_IMPL *self, char *sequence, uint32_t start, uint32_t stop );
-static rc_t FastqSequenceGetQuality          ( const SEQUENCE_IMPL *self, const int8_t **quality, uint8_t *offset, int *qualType );
-static rc_t FastqSequenceGetSpotGroup        ( const SEQUENCE_IMPL *self, const char **name, size_t *length );
-static rc_t FastqSequenceGetSpotName         ( const SEQUENCE_IMPL *self, const char **name, size_t *length );
-static bool FastqSequenceIsColorSpace        ( const SEQUENCE_IMPL *self );
-static rc_t FastqSequenceGetCSKey            ( const SEQUENCE_IMPL *self, char cskey[1] );
-static rc_t FastqSequenceGetCSReadLength     ( const SEQUENCE_IMPL *self, uint32_t *length );
-static rc_t FastqSequenceGetCSRead           ( const SEQUENCE_IMPL *self, char *sequence );
-static rc_t FastqSequenceGetCSQuality        ( const SEQUENCE_IMPL *self, const int8_t **quality, uint8_t *offset, int *qualType );
-static bool FastqSequenceRecordWasPaired     ( const SEQUENCE_IMPL *self );
-static int  FastqSequenceGetOrientationSelf  ( const SEQUENCE_IMPL *self );
-static int  FastqSequenceGetOrientationMate  ( const SEQUENCE_IMPL *self );
-static bool FastqSequenceRecordIsFirst       ( const SEQUENCE_IMPL *self );
-static bool FastqSequenceRecordIsSecond      ( const SEQUENCE_IMPL *self );
-static bool FastqSequenceIsDuplicate         ( const SEQUENCE_IMPL *self ); 
-static bool FastqSequenceIsLowQuality        ( const SEQUENCE_IMPL *self ); 
-static rc_t FastqSequenceGetTI               ( const SEQUENCE_IMPL *self, uint64_t *ti );
-
-static Sequence_vt_v1 FastqSequence_vt = 
-{
-    1, 0, 
-    /* start minor version == 0 */
-    FastqSequenceAddRef,
-    FastqSequenceRelease,
-    FastqSequenceGetReadLength,
-    FastqSequenceGetRead,
-    FastqSequenceGetRead2,
-    FastqSequenceGetQuality,
-    FastqSequenceGetSpotGroup,
-    FastqSequenceGetSpotName,
-    FastqSequenceIsColorSpace,
-    FastqSequenceGetCSKey,
-    FastqSequenceGetCSReadLength,
-    FastqSequenceGetCSRead,
-    FastqSequenceGetCSQuality,
-    FastqSequenceRecordWasPaired,
-    FastqSequenceGetOrientationSelf,
-    FastqSequenceGetOrientationMate,
-    FastqSequenceRecordIsFirst,
-    FastqSequenceRecordIsSecond,
-    FastqSequenceIsDuplicate,  
-    FastqSequenceIsLowQuality, 
-    FastqSequenceGetTI,        
-    /* end minor version == 0 */
-};
-
-static
-rc_t
-FastqSequenceInit(FastqSequence* self)
-{
-    self->sequence_vt.v1 = & FastqSequence_vt;
-    KRefcountInit ( & self -> refcount, 1, "FastqSequence", "FastqSequenceInit", "");
-
-    StringInit(&self->spotname, 0, 0, 0);
-    StringInit(&self->spotgroup, 0, 0, 0);
-    self->readnumber = 0; 
-
-    self->read = 0;
-    self->is_colorspace = false;
-    StringInit(&self->quality, 0, 0, 0);
-    self->qualityOffset = 0;
-    self->lowQuality = false;
-
-    return 0;
-}
-
-static const FastqRecord*
-FastqSequenceToRecord(const FastqSequence* seq) 
-{
-    return ( const FastqRecord * ) ( (uint8_t*)seq - offsetof ( FastqRecord, seq ) );
-}
-
-static rc_t FastqSequenceAddRef( const FastqSequence* self )
-{
-    switch (KRefcountAdd( & self->refcount, "FastqSequence" ))
-    {
-    case krefLimit:
-        return RC ( RC_MODULE, rcData, rcAttaching, rcRange, rcExcessive );
-    case krefNegative:
-        return RC ( RC_MODULE, rcData, rcAttaching, rcRefcount, rcInvalid );
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceRelease( const FastqSequence* self )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "FastqSequence" ) )
-        {
-        case krefWhack:
-            return FastqRecordWhack ( FastqSequenceToRecord(self) );
-
-        case krefNegative:
-            return RC ( RC_MODULE, rcData, rcDestroying, rcSelf, rcDestroyed );
-        }
-    }
-
-    return 0;
-
-}
-
-static rc_t FastqSequenceGetReadLength ( const FastqSequence *self, uint32_t *length )
-{
-    assert(self);
-    if ( self->read == NULL || self->is_colorspace )
-    {
-        *length = 0;
-    }
-    else
-    {
-        *length = string_measure(self->read, NULL);
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceGetRead ( const FastqSequence *self, char *sequence )
-{
-    assert(self);
-    assert(sequence);
-    if ( self->read != NULL && !self->is_colorspace )
-    {
-        uint32_t length = string_measure(self->read, NULL);
-        string_copy(sequence, length, self->read, length);
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceGetRead2 ( const FastqSequence *self, char *sequence, uint32_t start, uint32_t stop )
-{
-    assert(self);
-    assert(sequence);
-    if ( self->read == NULL || self->is_colorspace )
-    {
-        return RC( RC_MODULE, rcData, rcAccessing, rcItem, rcEmpty );
-    }
-    else
-    {
-        uint32_t length = string_measure(self->read, NULL);
-        if (start >= length || stop >= length || start >= stop)
-        {
-            return RC( RC_MODULE, rcData, rcAccessing, rcRange, rcInvalid);
-        }
-        string_copy(sequence, stop - start, self->read + start, stop - start);
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceGetQuality ( const FastqSequence *self, const int8_t **quality, uint8_t *offset, int *qualType )
-{
-    assert(self);
-    assert(quality);
-    assert(offset);
-    assert(qualType);
-    *quality = NULL;
-    if ( self->quality.size != 0)
-    {
-        uint32_t length = string_measure(self->read, NULL);
-        if (self->quality.size != length)
-            return RC(rcAlign, rcRow, rcReading, rcData, rcInconsistent);
-            
-        *quality = (const int8_t *)self->quality.addr;
-        *offset = self->qualityOffset;
-    }
-    else
-    {
-        *quality = NULL;
-        *offset = 0;
-    }
-    *qualType = QT_Phred;
-    return 0;
-}
-
-static rc_t FastqSequenceGetSpotGroup ( const FastqSequence *self, const char **name, size_t *length )
-{
-    assert(self);
-    assert(name);
-    *name = self->spotgroup.addr;
-    *length = self->spotgroup.len;
-    return 0;
-}
-
-static rc_t FastqSequenceGetSpotName ( const FastqSequence *self, const char **name, size_t *length )
-{
-    assert(self);
-    assert(name);
-    *name = self->spotname.addr;
-    *length = self->spotname.len;
-    return 0;
-}
-
-static bool FastqSequenceIsColorSpace ( const FastqSequence *self )
-{
-    assert(self);
-    return self->is_colorspace;
-}
-
-static rc_t FastqSequenceGetCSKey ( const FastqSequence *self, char cskey[1] )
-{
-    assert(self);
-    if (self->is_colorspace)
-        cskey[0] = self->read[0];
-    return 0;
-}
-
-static rc_t FastqSequenceGetCSReadLength ( const FastqSequence *self, uint32_t *length )
-{
-    assert(self);
-    if ( self->read == NULL )
-    {
-        *length = 0;
-    }
-    else if (self->is_colorspace)
-    {
-        *length = string_measure(self->read + 1, NULL);
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceGetCSRead ( const FastqSequence *self, char *sequence )
-{
-    assert(self);
-    assert(sequence);
-    if ( self->read != NULL && self->is_colorspace )
-    {
-        uint32_t length = string_measure(self->read + 1, NULL);
-        string_copy(sequence, length, self->read + 1, length);
-    }
-    return 0;
-}
-
-static rc_t FastqSequenceGetCSQuality ( const FastqSequence *self, const int8_t **quality, uint8_t *offset, int *qualType )
-{
-    assert(self);
-    assert(quality);
-    assert(offset);
-    assert(qualType);
-    *quality = NULL;
-    if ( self->quality.size != 0 && self->is_colorspace )
-    {
-        *quality = (const int8_t *)self->quality.addr + 1;
-        *offset = self->qualityOffset;
-    }
-    else
-    {
-        *quality = NULL;
-        *offset = 0;
-    }
-    *qualType = QT_Phred;
-    return 0;
-}
-
-static bool FastqSequenceRecordWasPaired ( const FastqSequence *self )
-{
-    assert(self);
-    return self->readnumber != 0;
-}
-
-static int FastqSequenceGetOrientationSelf ( const FastqSequence *self )
-{
-    assert(self);
-    return ReadOrientationUnknown;
-}
-
-static int FastqSequenceGetOrientationMate ( const FastqSequence *self )
-{
-    assert(self);
-    return ReadOrientationUnknown;
-}
-
-static bool FastqSequenceRecordIsFirst ( const FastqSequence *self )
-{
-    assert(self);
-    return self->readnumber == 1;
-}
-
-static bool FastqSequenceRecordIsSecond ( const FastqSequence *self )
-{
-    assert(self);
-    return self->readnumber == 2;
-}
-
-static bool FastqSequenceIsDuplicate         ( const SEQUENCE_IMPL *self )
-{
-    assert(self);
-    return 0;
-}
-
-static bool FastqSequenceIsLowQuality        ( const SEQUENCE_IMPL *self )
-{
-    assert(self);
-    return self->lowQuality;
-}
-
-static rc_t FastqSequenceGetTI               ( const SEQUENCE_IMPL *self, uint64_t *ti )
-{
-    assert(self);
-    return false;
-}
-
-/*--------------------------------------------------------------------------
- * FastqReaderFile
- */
-
-static rc_t FastqReaderFileWhack( READERFILE_IMPL* self );
-static rc_t FastqReaderFileGetRecord ( const READERFILE_IMPL *self, const Record** result );
-static float FastqReaderFileGetProportionalPosition ( const READERFILE_IMPL *self );
-static rc_t FastqReaderFileGetReferenceInfo ( const READERFILE_IMPL *self, const ReferenceInfo** result );
-
-static ReaderFile_vt_v1 FastqReaderFile_vt = 
-{
-    1, 0, 
-    /* start minor version == 0 */
-    FastqReaderFileWhack,
-    FastqReaderFileGetRecord,
-    FastqReaderFileGetProportionalPosition,
-    FastqReaderFileGetReferenceInfo,
-    /* end minor version == 0 */
-};
-
-struct FastqReaderFile
-{
-    ReaderFile dad;
-
-    FASTQParseBlock pb; 
-    const KLoaderFile* reader;
-
-    const char* recordStart; /* raw source of the record being currently parsed */
-    size_t curPos;           /* current tokenization position relative to recordStart */
-    bool lastEol;
-    bool eolInserted;
-};
-
-rc_t FastqReaderFileWhack( FastqReaderFile* f )
-{
-    FastqReaderFile* self = (FastqReaderFile*) f;
-
-    FASTQScan_yylex_destroy(& self->pb);
-
-    if (self->reader)
-        KLoaderFile_Release ( self->reader, true );
-
-    ReaderFileWhack( &self->dad );
-
-    free ( self );
-    return 0;
-}
-
-rc_t FastqReaderFileGetRecord ( const FastqReaderFile *f, const Record** result )
-{
-    rc_t rc;
-    FastqReaderFile* self = (FastqReaderFile*) f;
-    
-    if (self->pb.fatalError)
-        return 0;
-
-    self->pb.record = (FastqRecord*)malloc(sizeof(FastqRecord));
-    if (self->pb.record == NULL)
-    {
-        rc = RC ( RC_MODULE, rcData, rcAllocating, rcMemory, rcExhausted );
-        return 0;
-    }
-    rc = FastqRecordInit(self->pb.record);
-    if (rc != 0)
-        return rc;
-
-    self->pb.length = 0;
-    KDataBufferResize( & self->pb.tagLine, 0 );
-    KDataBufferResize( & self->pb.quality, 0 );
-    self->pb.spotNameDone = false;
-
-    if ( FASTQ_parse( & self->pb ) == 0 && self->pb.record->rej == 0 )
-    {   /* normal end of input */
-        RecordRelease((const Record*)self->pb.record);
-        *result = 0;
-        return 0;
-    }
-
-    /*TODO: remove? compensate for an artificially inserted trailing \n */
-    if ( self->eolInserted )
-    {
-        -- self->pb.length;
-        self->eolInserted = false;
-    }
-
-    if (self->pb.record->rej != 0) /* had error(s) */
-    {   /* save the complete raw source in the Rejected object */
-        StringInit(& self->pb.record->rej->source, string_dup(self->recordStart, self->pb.length), self->pb.length, self->pb.length);
-        self->pb.record->rej->fatal = self->pb.fatalError;
-    }
-
-    if (rc == 0 && self->reader != 0)
-    {   
-        /* advance the record start pointer beyond the last token */ 
-        size_t length;
-        rc = KLoaderFile_Read( self->reader, self->pb.length, 0, (const void**)& self->recordStart, & length);
-        if (rc != 0)
-            LogErr(klogErr, rc, "FastqReaderFileGetRecord failed");
-
-        self->curPos -= self->pb.length;
-    }
-
-    StringInit( & self->pb.record->seq.spotname,    (const char*)self->pb.tagLine.base, self->pb.spotNameLength, self->pb.spotNameLength);
-    StringInit( & self->pb.record->seq.spotgroup,   (const char*)self->pb.tagLine.base + self->pb.spotGroupOffset, self->pb.spotGroupLength, self->pb.spotGroupLength);
-    StringInit( & self->pb.record->seq.quality,     (const char*)self->pb.quality.base, self->pb.quality.elem_count, self->pb.quality.elem_count); 
-    self->pb.record->seq.qualityOffset = self->pb.phredOffset;
-    
-    if (self->pb.record->seq.readnumber == 0)
-        self->pb.record->seq.readnumber = self->pb.defaultReadNumber;
-    
-    *result = (const Record*) self->pb.record;
-
-    return rc;
-}
-
-void CC FASTQ_error(struct FASTQParseBlock* sb, const char* msg)
-{
-    if (sb->record->rej == 0)
-    {   /* save the error information in the Rejected object */
-        sb->record->rej = (Rejected*)malloc(sizeof(Rejected));
-        RejectedInit(sb->record->rej);
-
-        sb->record->rej->message    = string_dup(msg, strlen(msg));
-        sb->record->rej->line       = sb->lastToken->line_no;
-        sb->record->rej->column     = sb->lastToken->column_no;
-    }
-    /* subsequent errors in this record will be ignored */
-}
-
-size_t CC FASTQ_input(FASTQParseBlock* pb, char* buf, size_t max_size)
-{
-    FastqReaderFile* self = (FastqReaderFile*)pb->self;
-    size_t length;
-
-    rc_t rc = KLoaderFile_Read( self->reader, 0, self->curPos + max_size, (const void**)& self->recordStart, & length);
-
-    if ( rc != 0 )
-    {
-        LogErr(klogErr, rc, "FASTQ_input failed");
-        return 0;
-    }
-    
-    length -= self->curPos;
-    if ( length == 0 ) /* nothing new read = end of file */
-    {   /* insert an additional \n before the end of file if missing */
-        if ( !self->lastEol )
-        {
-            buf[0] = '\n';
-            self->eolInserted = true;
-            self->lastEol = true;
-            return 1;
-        }
-        else
-        {   
-            return 0; /* signal EOF to flex */
-        }
-    }
-
-    memcpy(buf, self->recordStart + self->curPos, length);
-    self->lastEol = ( buf[length-1] == '\n' );
-    self->curPos += length;
-    return length;
-}
-
-rc_t CC FastqReaderFileMake( const ReaderFile **reader, const KDirectory* dir, const char* file, uint8_t phredOffset, uint8_t phredMax, int8_t defaultReadNumber)
-{
-    rc_t rc;
-    FastqReaderFile* self = (FastqReaderFile*) malloc ( sizeof * self );
-    if ( self == NULL )
-    {
-         rc = RC ( RC_MODULE, rcFileFormat, rcAllocating, rcMemory, rcExhausted );
-    }
-    else
-    {
-        memset(self, 0, sizeof(*self));
-        rc = ReaderFileInit ( self );
-        self->dad.vt.v1 = & FastqReaderFile_vt;
-
-        self->dad.pathname = string_dup(file, strlen(file)+1);
-        if ( self->dad.pathname == NULL )
-        {
-            rc = RC ( RC_MODULE, rcFileFormat, rcAllocating, rcMemory, rcExhausted );
-        }
-        else
-        {
-            rc = KLoaderFile_Make( & self->reader, dir, file, 0, true );
-        }
-        if (rc == 0)
-        {
-            self->pb.self = self;
-            self->pb.input = FASTQ_input;    
-            self->pb.phredOffset = phredOffset;
-            self->pb.maxPhred = phredMax;
-            /* TODO: 
-                if phredOffset is 0, 
-                    guess based on the raw values on the first quality line:
-                        if all values are above MAX_PHRED_33, phredOffset = 64
-                        if all values are in MIN_PHRED_33..MAX_PHRED_33, phredOffset = 33
-                        if any value is below MIN_PHRED_33, abort
-                    if the guess is 33 and proven wrong (a raw quality value >MAX_PHRED_33 is encountered and no values below MIN_PHRED_64 ever seen)
-                        reopen the file, 
-                        phredOffset = 64
-                        try to parse again
-                        if a value below MIN_PHRED_64 seen, abort 
-            */
-            self->pb.defaultReadNumber = defaultReadNumber;
-            
-            rc = FASTQScan_yylex_init(& self->pb, true); 
-            if (rc == 0)
-            {
-                *reader = (const ReaderFile *) self;
-            } 
-            else
-            {
-                KLoaderFile_Release( self->reader, true );
-                ReaderFileRelease( & self->dad );
-                *reader = 0;
-            }
-        }
-        else
-        {
-            ReaderFileRelease( & self->dad );
-            *reader = 0;
-        }
-    }
- 
-    return rc;
-}
-
-float FastqReaderFileGetProportionalPosition ( const READERFILE_IMPL *self )
-{
-    return 0.0f;
-}
-
-rc_t FastqReaderFileGetReferenceInfo ( const READERFILE_IMPL *self, const ReferenceInfo** result )
-{
-    *result = NULL;
-    return 0;
-}
diff --git a/tools/fastq-loader/fastq-reader.h b/tools/fastq-loader/fastq-reader.h
deleted file mode 100644
index 4fb1f6a..0000000
--- a/tools/fastq-loader/fastq-reader.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_fastq_reader_
-#define _h_fastq_reader_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-struct ReaderFile;
-
-rc_t CC FastqReaderFileMake( const struct ReaderFile **self, const struct KDirectory* dir, const char* file, uint8_t phredOffset, uint8_t phredMax, int8_t defaultReadNumber);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _h_fastq_reader_ */
diff --git a/tools/fastq-loader/fastq-tokens.h b/tools/fastq-loader/fastq-tokens.h
deleted file mode 100644
index bcb059d..0000000
--- a/tools/fastq-loader/fastq-tokens.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
-
-/* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
-   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 3 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, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     fqENDOFTEXT = 0,
-     fqNUMBER = 258,
-     fqALPHANUM = 259,
-     fqWS = 260,
-     fqENDLINE = 261,
-     fqBASESEQ = 262,
-     fqCOLORSEQ = 263,
-     fqTOKEN = 264,
-     fqASCQUAL = 265,
-     fqUNRECOGNIZED = 266
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-
-
diff --git a/tools/fastq-loader/latf-load.vers b/tools/fastq-loader/latf-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/fastq-loader/latf-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/fastq-loader/loader-imp.c b/tools/fastq-loader/loader-imp.c
deleted file mode 100644
index fdd39e1..0000000
--- a/tools/fastq-loader/loader-imp.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <string.h>
- 
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <kdb/btree.h>
-#include <kdb/meta.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-
-#include <kapp/loader-meta.h>
-#include <kapp/main.h>
-
-#include <kfs/directory.h>
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/vdb-priv.h>
-
-#include <loader/common-reader.h>
-#include <loader/common-writer.h>
-#include <loader/sequence-writer.h>
-#include <loader/reference-writer.h>
-
-#include "fastq-reader.h"
-
-rc_t AcrhiveFASTQ(CommonWriterSettings* G, 
-                VDBManager *mgr, 
-                VDatabase *db,
-                unsigned seqFiles, 
-                char const *seqFile[], 
-                uint8_t qualityOffset, 
-                const int8_t defaultReadNumbers[])
-{
-    rc_t rc = 0;
-    unsigned i;
-    CommonWriter cw;
-
-    KDirectory *dir;
-    rc = KDirectoryNativeDir(&dir);    
-    if (rc != 0)
-        return rc;
-
-    rc = CommonWriterInit( &cw, mgr, db, G);
-    if (rc != 0)
-    {
-        KDirectoryRelease(dir);
-        return rc;
-    }
-    
-    for (i = 0; i < seqFiles; ++i) {
-        const ReaderFile *reader;
-        if (G->platform == SRA_PLATFORM_PACBIO_SMRT)  
-            rc = FastqReaderFileMake(&reader, dir, seqFile[i], 33, 33 + 93, -1); 
-        else
-            rc = FastqReaderFileMake(&reader, dir, seqFile[i], qualityOffset, 0, defaultReadNumbers[i]);
-        
-        if (rc == 0) 
-        {
-            rc = CommonWriterArchive( &cw, reader );
-            if (rc != 0) 
-                ReaderFileRelease(reader);
-            else
-                rc = ReaderFileRelease(reader);
-        }
-        if (rc != 0)
-            break;
-    }
-    if (rc == 0)
-        rc = CommonWriterComplete( &cw, Quitting() != 0, 0 );
-    else
-        CommonWriterComplete( &cw, true, 0 );
-        
-    G->errCount = cw.err_count;
-        
-    if (rc == 0)
-        rc = CommonWriterWhack( &cw );
-    else
-        CommonWriterWhack( &cw );
-    
-    if (rc == 0)
-        rc = KDirectoryRelease(dir);
-    else
-        KDirectoryRelease(dir);
-        
-    if (rc == 0) {
-        (void)LOGMSG(klogInfo, "Successfully loaded all files");
-    }
-    return rc;
-}
- 
-rc_t WriteLoaderSignature(KMetadata *meta, char const progName[])
-{
-    KMDataNode *node;
-    rc_t rc = KMetadataOpenNodeUpdate(meta, &node, "/");
-    
-    if (rc == 0) {
-        rc = KLoaderMeta_Write(node, progName, __DATE__, "FASTQ", KAppVersion());
-        KMDataNodeRelease(node);
-    }
-    if (rc) {
-        (void)LOGERR(klogErr, rc, "Cannot update loader meta");
-    }
-    return rc;
-}
-
-rc_t OpenPath(char const path[], KDirectory **dir)
-{
-    KDirectory *p;
-    rc_t rc = KDirectoryNativeDir(&p);
-    
-    if (rc == 0) {
-        rc = KDirectoryOpenDirUpdate(p, dir, false, path);
-        KDirectoryRelease(p);
-    }
-    return rc;
-}
-
-rc_t ConvertDatabaseToUnmapped(VDatabase* db)
-{
-    VTable* tbl;
-    rc_t rc = VDatabaseOpenTableUpdate(db, &tbl, "SEQUENCE");
-    if (rc == 0) 
-    {
-        rc = VTableRenameColumn(tbl, false, "CMP_ALTREAD", "ALTREAD");
-        if (rc == 0 || GetRCState(rc) == rcNotFound)
-            rc = VTableRenameColumn(tbl, false, "CMP_READ", "READ");
-/*        if (rc == 0 || GetRCState(rc) == rcNotFound)
-            rc = VTableRenameColumn(tbl, false, "CMP_ALTCSREAD", "ALTCSREAD");
-        if (rc == 0 || GetRCState(rc) == rcNotFound)
-            rc = VTableRenameColumn(tbl, false, "CMP_CSREAD", "CSREAD");*/
-        if (GetRCState(rc) == rcNotFound)
-            rc = 0;
-        rc = VTableRelease(tbl);
-    }
-    return rc;
-}
-
-rc_t run(char const progName[], CommonWriterSettings* G, unsigned seqFiles, const char *seqFile[], uint8_t qualityOffset, const int8_t defaultReadNumbers[])
-{
-    VDBManager *mgr;
-    rc_t rc;
-    rc_t rc2;
-    char const *db_type = "NCBI:align:db:alignment_sorted"; 
-    
-    rc = VDBManagerMakeUpdate(&mgr, NULL);
-    if (rc) {
-        (void)LOGERR (klogErr, rc, "failed to create VDB Manager!");
-    }
-    else {
-        VSchema *schema;
-
-        rc = VDBManagerMakeSchema(mgr, &schema);
-        if (rc) {
-            (void)LOGERR (klogErr, rc, "failed to create schema");
-        }
-        else {
-            (void)(rc = VSchemaAddIncludePath(schema, G->schemaIncludePath));
-            rc = VSchemaParseFile(schema, G->schemaPath);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "failed to parse schema file $(file)", "file=%s", G->schemaPath));
-            }
-            else {
-                VDatabase *db;
-                
-                rc = VDBManagerCreateDB(mgr, &db, schema, db_type, kcmInit + kcmMD5, G->outpath);
-                rc2 = VSchemaRelease(schema);
-                if (rc2)
-                    (void)LOGERR(klogWarn, rc2, "Failed to release schema");
-                if (rc == 0)
-                    rc = rc2;
-                if (rc == 0) {
-                    rc = AcrhiveFASTQ(G, mgr, db, seqFiles, seqFile, qualityOffset, defaultReadNumbers);
-                }
-
-                if (rc == 0) {
-                    rc = ConvertDatabaseToUnmapped(db);
-                }
-
-                rc2 = VDatabaseRelease(db);
-                if (rc == 0)
-                {
-                    if (rc2)
-                        (void)LOGERR(klogWarn, rc2, "Failed to close database");
-                    rc = rc2;
-                }
-                
-                if (rc == 0) {
-                    KMetadata *meta;
-                    KDBManager *kmgr;
-                    
-                    rc = VDBManagerOpenKDBManagerUpdate(mgr, &kmgr);
-                    if (rc == 0) {
-                        KDatabase *kdb;
-                        
-                        rc = KDBManagerOpenDBUpdate(kmgr, &kdb, G->outpath);
-                        if (rc == 0) {
-                            rc = KDatabaseOpenMetadataUpdate(kdb, &meta);
-                            KDatabaseRelease(kdb);
-                        }
-                        KDBManagerRelease(kmgr);
-                    }
-                    if (rc == 0) {
-                        rc = WriteLoaderSignature(meta, progName);
-                        KMetadataRelease(meta);
-                    }
-                }
-            }
-            rc2 = VDBManagerRelease(mgr);
-            if (rc2)
-                (void)LOGERR(klogWarn, rc2, "Failed to release VDB Manager");
-            if (rc == 0)
-                rc = rc2;
-        }
-    }
-    return rc;
-}
diff --git a/tools/kar/Makefile b/tools/kar/Makefile
deleted file mode 100644
index 5f2ea7a..0000000
--- a/tools/kar/Makefile
+++ /dev/null
@@ -1,134 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/kar
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	kar \
-	sra-kar
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_TOOLS))
-
-
-#----------------------------------------------------------------
-# kar
-#
-
-KAR_SRC = \
-	kar
-
-KAR_OBJ = \
-	$(addsuffix .$(OBJX),$(KAR_SRC))
-
-KAR_LIB = \
-	-skapp \
-	-lvfs \
-	-lkurl \
-	-lkfg \
-	-lkrypto \
-	-lkfs \
-	-lkproc \
-	-lklib \
-	-lm
-
-$(BINDIR)/kar: $(KAR_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(KAR_LIB)
-
-kar_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) kar $(KAR_OBJ)
-
-#----------------------------------------------------------------
-# sra-kar
-#
-
-SRA_KAR_SRC = \
-	sra-kar
-
-SRA_KAR_OBJ = \
-	$(addsuffix .$(OBJX),$(SRA_KAR_SRC))
-
-SRA_KAR_LIB = \
-	-skapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/sra-kar: $(SRA_KAR_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SRA_KAR_LIB)
-
-sra-kar_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) sra-kar $(SRA_KAR_OBJ)
-
-
diff --git a/tools/kar/kar.c b/tools/kar/kar.c
deleted file mode 100644
index 0fadca6..0000000
--- a/tools/kar/kar.c
+++ /dev/null
@@ -1,1517 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#define USE_SKEY_MD5_FIX 1
-
-#include "kar.vers.h"
-
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <klib/vector.h>
-#include <klib/container.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/arc.h>
-#include <kfs/tar.h>
-#include <kfs/toc.h>
-#include <kfs/sra.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <sysalloc.h>
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-/* #include <stdarg.h> */
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-
-
-static
-KDirectory * kdir;
-
-
-#define OPTION_CREATE    "create"
-#define OPTION_TEST      "test"
-#define OPTION_LIST      "list"
-#define OPTION_EXTRACT   "extract"
-#define OPTION_FORCE     "force"
-#define OPTION_LONGLIST  "long-list"
-#define OPTION_DIRECTORY "directory"
-#define OPTION_ALIGN     "align"
-
-#define ALIAS_CREATE    "c"
-#define ALIAS_TEST      "t"
-#define ALIAS_LIST      ""
-#define ALIAS_EXTRACT   "x"
-#define ALIAS_FORCE     "f"
-#define ALIAS_LONGLIST  "l"
-#define ALIAS_DIRECTORY "d"
-#define ALIAS_ALIGN     "a"
-
-static const char * create_usage[] = { "Create a new archive.", NULL };
-static const char * extract_usage[] = { "Extract the contents of an archive into a directory.", NULL };
-static const char * test_usage[] = { "Check the structural validity of an archive",
-                                     "Optionally listing its contents", NULL };
-static const char * list_usage[] = { "Check the structural validity of an archive",
-                                     "Optionally listing its contents", NULL };
-static const char * directory_usage[] = 
-{ "The next token on the command line is the",
-  "name of the directory to extract to or create",
-  "from", NULL };
-static const char * force_usage[] =
-{ "(no parameter) this will cause the extract or",
-  "create to over-write existing files unless",
-  "they are write-protected.  Without this",
-  "option the program will fail if the archive",
-  "already exists for a create or the target",
-  "directory exists for an extract", NULL };
-static const char * align_usage[] =
- { "Forces the alignment of files in create",
-   "mode putting the first byte of included",
-   "files at <alignment boundaries",
-   "alignment: 1|2|4|8",
-   "(default=4)", NULL };
-static const char * longlist_usage[] =
-{ "more information will be given on each file",
-  "in test/list mode.", NULL };
-
-OptDef Options[] = 
-{
-    { OPTION_CREATE,    ALIAS_CREATE,    NULL, create_usage, 1, true,  false },
-    { OPTION_TEST,      ALIAS_TEST,      NULL, test_usage, 1, true,  false },
-    { OPTION_LIST,      ALIAS_LIST,      NULL, list_usage, 1, true,  false },
-    { OPTION_EXTRACT,   ALIAS_EXTRACT,   NULL, extract_usage, 1, true,  false },
-    { OPTION_FORCE,     ALIAS_FORCE,     NULL, force_usage, 0, false, false },
-    { OPTION_LONGLIST,  ALIAS_LONGLIST,  NULL, longlist_usage, 0, false, false },
-    { OPTION_DIRECTORY, ALIAS_DIRECTORY, NULL, directory_usage, 1, true,  false },
-    { OPTION_ALIGN,     ALIAS_ALIGN,     NULL, align_usage, 1, true,  false }
-};
-
-const char UsageDefaultName[] = "kar";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [OPTIONS] -%s|--%s <Archive> -%s|--%s <Directory> [Filter ...]\n"
-                    "  %s [OPTIONS] -%s|--%s <Archive> -%s|--%s <Directory>\n"
-                    "  %s [OPTIONS] -%s|--%s|--%s <Archive>\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Create, extract from, or test an archive.\n"
-                    "\n",
-                    progname, ALIAS_CREATE, OPTION_CREATE, ALIAS_DIRECTORY, OPTION_DIRECTORY,
-                    progname, ALIAS_EXTRACT, OPTION_EXTRACT, ALIAS_DIRECTORY, OPTION_DIRECTORY,
-                    progname, ALIAS_TEST, OPTION_TEST, OPTION_LIST);
-}
-
-rc_t CC Usage (const Args * args)
-{
-    static const char archive[] = "archive";
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    OUTMSG (("Archive Command:\n"
-	     "  All of these options require the next token on the command line to be\n"
-	     "  the name of the archive\n\n"));
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionLine (ALIAS_CREATE, OPTION_CREATE, archive, create_usage);
-    HelpOptionLine (ALIAS_EXTRACT, OPTION_EXTRACT, archive, extract_usage);
-    HelpOptionLine (ALIAS_TEST, OPTION_TEST, archive, test_usage);
-    OUTMSG (("\n"
-             "Archive:\n"
-             "  Path to a file that will/does hold the archive of other files.\n"
-             "  This can be a full or relative path.\n"
-             "\n"
-             "Directory:\n"
-	     "  Required for create or extract command, ignored for test command.\n"
-             "  This can be a full or relative path.\n"
-             "\n"
-             "Filters:\n"
-	     "  When present these act as include filters.\n"
-	     "  Any file name will be included in the extracted files, created archive\n"
-	     "  or test operation listing\n"
-	     "  Any directory will be included as well as its contents\n"
-             "\n"
-             "Options:\n"));
-    HelpOptionLine (ALIAS_DIRECTORY, OPTION_DIRECTORY, "Directory", directory_usage);
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage);
-    HelpOptionLine (ALIAS_ALIGN, OPTION_ALIGN, "alignment", align_usage);
-    HelpOptionLine (ALIAS_LONGLIST, OPTION_LONGLIST, NULL, longlist_usage);
-
-    HelpOptionsStandard ();
-
-    OUTMSG (("\n"
-             "Use examples:"
-             "\n"
-             "  To create an archive named 'example.sra' that contains the same\n"
-             "  contents as a subdirectory 'example' of the current directory\n"
-             "\n"
-             "  $ %s --%s example.sra --%s example\n",
-             progname, OPTION_CREATE, OPTION_DIRECTORY));
-
-    OUTMSG (("\n"
-             "  To replace an existing archive named 'example.sra' with another that contains\n"
-             "  the same contents as a subdirectory 'example' of the current directory\n"
-             "\n"
-             "  $ %s -%s -%s example.sra -%s example\n",
-             progname, ALIAS_FORCE, ALIAS_CREATE, ALIAS_DIRECTORY));
-
-    OUTMSG (("\n"
-             "  To examine in detail the contents of an archive named 'example.sra'\n"
-             "\n"
-             "  $ %s --%s --%s example.sra\n",
-             progname, OPTION_LONGLIST, OPTION_TEST));
-
-    OUTMSG (("\n"
-             "  To extract the files from an archive named 'example.sra' into\n"
-             "  a subdirectory 'example' of the current directory.\n"
-             "  NOTE: all extracted files will be read only.\n"
-             "\n"
-             "  $ %s --%s example.sra --%s example\n",
-             progname, OPTION_EXTRACT, OPTION_DIRECTORY));
-
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-static
-KDirectory * kdir;
-
-static
-bool long_list;
-static
-bool force;
-
-static
-KSRAFileAlignment alignment;
-
-
-static BSTree pnames;
-typedef struct pnamesNode
-{
-    BSTNode      dad;
-    const char * name;
-    size_t name_len;
-} pnamesNode;
-
-static rc_t pnamesNodeMake (pnamesNode ** pself, const char * path)
-{
-    size_t len;
-    pnamesNode * self;
-
-    len = strlen (path);
-    self = malloc (sizeof (pnamesNode));
-    if (self == NULL)
-    {
-        rc_t rc = RC (rcExe, rcNoTarg, rcAllocating, rcMemory, rcExhausted);
-        PLOGERR (klogErr, (klogErr, rc, "out of memory allocating node for $(P)", PLOG_S(P), path));
-        return rc;
-    }
-    self->name = path;
-    self->name_len = len;
-    *pself = self;
-    return 0;
-}
-
-static int CC pnameFindCmp (const void * _item, const BSTNode *_n)
-{
-    const char * item = _item;
-    const pnamesNode * n = (const pnamesNode *)_n;
-    size_t ilen = strlen (item);
-    size_t nlen = n->name_len;
-
-    /*     printf("compare <%s(%u),%s(%u)>\n", item, ilen, n->name, nlen); */
-
-    if (((ilen+1) == nlen) && (n->name[ilen] == '/'))
-    {
-        /* 	printf("strncmp ilen\n"); */
-        return (strncmp (item, n->name, ilen));
-    }
-    if ((item[nlen] == '/') || (item[nlen-1] == '/'))
-    {
-        /* 	printf("strncmp nlen\n"); */
-        return (strncmp (item, n->name, nlen));
-    }
-    /*     printf("strcmp\n"); */
-    return (strcmp (item, n->name));
-}
-
-static int CC pnamesInsertCmp (const BSTNode * _item, const BSTNode *_n)
-{
-    const pnamesNode * item = (const pnamesNode *)_item;
-    const pnamesNode * n = (const pnamesNode *)_n;
-    return strcmp (item->name, n->name);
-}
-
-static rc_t pnamesInsert (const char * path)
-{
-    pnamesNode * node;
-    rc_t rc;
-
-    rc = pnamesNodeMake (&node, path);
-/*     if (rc != 0) */
-/* 	    PLOGERR (klogDebug2, (klogDebug2, rc, "Unable to process filter parameter $(P)", */
-/*                  PLOG_S(P), path)); */
-    if (rc == 0)
-    {
-        rc = BSTreeInsert ( &pnames, &node->dad, pnamesInsertCmp );
-/*         if (rc != 0) */
-/*             PLOGERR (klogDebug2, (klogDebug2, rc, "Unable to store filter parameter $(P)", */
-/*                      PLOG_S(P), path)); */
-/*         else */
-/*             PLOGMSG (klogDebug2, "Processed filter parameter $(P)", */
-/*                      PLOG_S(P), path); */
-    }
-    return rc;
-}
-static bool pnamesUsePath (const char * path)
-{
-    bool ret;
-
-    STSMSG (4, ("Use path called %s", path));
-
-    STSMSG (4, ("Depth %u ", BSTreeDepth(&pnames, false) ));
-    if (BSTreeDepth(&pnames, false) == 0)
-    {
-/*         PLOGMSG (klogDebug9, "pnamesUsePath use $(P) by default", PLOG_S(P), path); */
-        ret = true;
-    }
-    else
-    {
-        ret = ( BSTreeFind (&pnames, path, pnameFindCmp ) != NULL);
-/*         if (ret) */
-/*             PLOGMSG (klogDebug9, "pnamesUsePath use $(P)", PLOG_S(P), path); */
-/*         else */
-/*             PLOGMSG (klogDebug9, "pnamesUsePath don't use $(P)", PLOG_S(P), path); */
-    }
-    STSMSG (4, ("Use? %u ", ret));
-    return ret;
-}
-
-static
-bool CC pnamesFilter ( const KDirectory * dir, const char * path, void * data )
-{
-    return pnamesUsePath ( path );
-}
-
-static KSRAFileAlignment get_alignment (const char * str)
-{
-    if (str == NULL)
-        return sraAlign4Byte;
-    else
-    {
-        KSRAFileAlignment a;
-	uint32_t	val;
-        if (sscanf (str, "%u", &val) == 1)
-        {
-	    a = val;
-            if (a == (a & ~(a-1)))
-                return a; /* if a is 0 its valid for the test but 0 is
-                           * sraAlignInvalid so it gets the right result */
-        }
-    }
-    return sraAlignInvalid;
-}
-
-static
-int CC sort_cmp (const void ** l, const void ** r, void * data)
-{
-    KDirectory * d;
-    uint64_t lz, rz;
-    rc_t rc;
-
-    d = data;
-/*     lz = l; */
-/*     rz = r; */
-
-    rc = KDirectoryFileSize (data, &lz, *l);
-    if (rc == 0)
-    {
-        rc = KDirectoryFileSize (data, &rz, *r);
-        if (rc == 0)
-        {
-            int64_t zdiff;
-
-            zdiff = lz - rz;
-            if (zdiff != 0)
-                return (zdiff < 0) ? -1 : 1;
-            else
-            {
-                size_t lsz = string_size (*l);
-                size_t rsz = string_size (*r);
-
-                return string_cmp (*l, lsz, *r, rsz, lsz+1);
-            }
-        }
-    }
-    return 0; /* dunno just leave it... */
-}
-
-
-static
-rc_t CC sort_size_then_rel_path (const KDirectory * d, struct Vector * v)
-{
-    VectorReorder (v, sort_cmp, (void*)d);
-
-    return 0;
-}
-
-
-
-
-
-static
-rc_t open_dir_as_archive (const char * path, const KFile ** file)
-{
-    rc_t rc;
-    KPathType kpt;
-    const KDirectory * d;
-
-    assert (path != NULL);
-    assert (path[0] != '\0');
-    assert (file != NULL);
-
-    rc = 0;
-    kpt = KDirectoryPathType (kdir, path);
-    switch (kpt)
-    {
-    case kptFile:
-        STSMSG (1, ("Opening as archive %s\n", path));
-
-        rc = KDirectoryOpenSraArchiveRead (kdir, &d, false, path);
-        if (rc != 0)
-            rc = KDirectoryOpenTarArchiveRead (kdir, &d, false, path);
-        if (rc != 0)
-            rc = RC (rcExe, rcParam, rcOpening, rcDirectory, rcInvalid);
-        break;
-    default:
-        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcInvalid);
-        PLOGERR (klogFatal, (klogFatal, rc, "Parameter [$(P)] must be a directory", PLOG_S(P), path));
-        return rc;
-    case kptDir:
-/*         KOutMsg ("%s: opening dir\n",__func__); */
-        rc = KDirectoryVOpenDirRead (kdir, &d, false, path, NULL);
-    }
-    if (rc == 0)
-    {
-/*         KOutMsg ("%s: dir to archive\n",__func__); */
-        rc = KDirectoryOpenTocFileRead (d, file, alignment, pnamesFilter, NULL, sort_size_then_rel_path );
-        KDirectoryRelease (d);
-    }
-    return rc;
-}
-static
-rc_t open_file_as_dir (const char * path, const KDirectory ** dir)
-{
-    rc_t rc;
-    KPathType kpt;
-    const KDirectory * d;
-
-    rc = 0;
-    kpt = KDirectoryPathType (kdir, path);
-    switch (kpt & ~kptAlias)
-    {
-    case kptNotFound:
-        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcNotFound);
-        PLOGERR (klogFatal, (klogFatal, rc, "Archive [$(A)] must exist", PLOG_S(A), path));
-        return rc;
-    case kptDir:
-    default:
-        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcInvalid);
-        PLOGERR (klogFatal, (klogFatal, rc, "Archive [$(A)] must be a file", PLOG_S(A), path));
-        return rc;
-    case kptFile:
-        break;
-    }
-    if (rc == 0)
-    {
-        STSMSG (1, ("Opening %s\n", path));
-        rc = KDirectoryOpenArcDirRead (kdir, &d, /*chroot*/false, path, 
-                                       tocKFile, KArcParseSRA,
-                                       /*filter*/pnamesFilter, /*filt.param*/NULL);
-        *dir = (rc == 0) ? d : NULL;
-    }
-    return rc;
-}
-static
-rc_t open_out_dir (const char * path, KDirectory ** dir)
-{
-    rc_t rc;
-    KCreateMode mode;
-
-    rc = 0;
-    mode = force ? kcmParents|kcmInit : kcmParents|kcmCreate;
-    STSMSG (1, ("Creating %s\n", path));
-    rc = KDirectoryVCreateDir (kdir, 0777, mode, path, NULL);
-    if (rc != 0)
-    {
-        PLOGERR (klogFatal, (klogFatal, rc, "failure to create or clear output directory $(D)", PLOG_S(D), path));
-    }
-    else
-    {
-        rc = KDirectoryVOpenDirUpdate (kdir, dir, false, path, NULL);
-        if (rc != 0)
-        {
-            PLOGERR (klogFatal, (klogFatal, rc, "failure to open output directory $(D)", PLOG_S(D), path));
-        }
-    }
-    return rc;
-}
-/* this could be modified to accept stdout */
-static
-rc_t open_out_file (const char * path, KFile ** fout)
-{
-    rc_t rc;
-    KPathType kpt;
-    KCreateMode mode;
-    rc = 0;
-    mode = kcmParents|kcmCreate;
-
-    kpt = KDirectoryPathType (kdir, path);
-    switch (kpt & ~kptAlias)
-    {
-    case kptDir:
-        /* -----
-         * this version will fail but perhaps with directory
-         * take last facet <F> from input path and use that as a name
-         * to be <F>.sra in this directory
-         */
-    default:
-        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcInvalid);
-        PLOGERR (klogFatal, (klogFatal, rc, "archive [$(A)] must be a file", PLOG_S(A), path));
-        break;
-    case kptFile:
-        if (force)
-            mode = kcmParents|kcmInit;
-        else
-        {
-            rc = RC (rcExe, rcNoTarg, rcParsing, rcFile, rcExists);
-            PLOGERR (klogFatal, (klogFatal, rc, "archive [$(A)] already exists", PLOG_S(A), path));
-        }
-        break;
-    case kptNotFound:
-        break;
-    }
-    if (rc == 0)
-    {
-        rc = KDirectoryVCreateFile (kdir, fout, false, 0664,
-                                    mode, path, NULL);
-        if (rc)
-            PLOGERR (klogFatal, (klogFatal, rc, "unable to create archive [$(A)]", PLOG_S(A), path));
-    }
-    return rc;
-}
-
-
-static
-void remove_out_file (const char * path)
-{
-    KDirectoryRemove (kdir, true, path);
-}
-
-static
-rc_t copy_file (const KFile * fin, KFile *fout)
-{
-    rc_t rc;
-    uint8_t	buff	[64 * 1024];
-    size_t	num_read;
-    uint64_t	inpos;
-    uint64_t	outpos;
-
-    assert (fin != NULL);
-    assert (fout != NULL);
-
-    inpos = 0;
-    outpos = 0;
-
-    do
-    {
-        rc = KFileRead (fin, inpos, buff, sizeof (buff), &num_read);
-        if (rc != 0)
-        {
-            PLOGERR (klogErr, (klogErr, rc,
-                     "Failed to read from directory structure in creating archive at $(P)",
-                               PLOG_U64(P), inpos));
-            break;
-        }
-        else if (num_read > 0)
-        {
-            size_t to_write;
-
-            inpos += (uint64_t)num_read;
-
-            STSMSG (2, ("Read %zu bytes to %lu", num_read, inpos));
-
-/*             PLOGMSG (klogDebug10, "Read $(B) Bytes for $(T)", PLOG_2(PLOG_U64(B),PLOG_U64(T)), num_read, inpos); */
-            to_write = num_read;
-            while (to_write > 0)
-            {
-                size_t num_writ;
-                rc = KFileWrite (fout, outpos, buff, num_read, &num_writ);
-                if (rc != 0)
-                {
-                    PLOGERR (klogErr, (klogErr, rc,
-                             "Failed to write to archive in creating archive at $(P)",
-                                       PLOG_U64(P), outpos));
-                    break;
-                }
-                outpos += num_writ;
-/*                 PLOGMSG (klogDebug10, "Wrote $(B) Bytes for $(T)", PLOG_2(PLOG_U64(B),PLOG_U64(T)), num_writ, outpos); */
-                to_write -= num_writ;
-            }
-        }
-/*         else */
-/*             PLOGMSG (klogDebug10, "Read $(B) Bytes for $(T)", PLOG_2(PLOG_U64(B),PLOG_U64(T)), num_read, inpos); */
-        if (rc != 0)
-            break;
-    } while (num_read != 0);
-    return rc;
-}
-
-#if USE_SKEY_MD5_FIX
-static
-rc_t copy_file_skey_md5_kludge (const KFile * fin, KFile *fout)
-{
-/* size of HEX digest plus spzce plus * */
-#define READ_SIZE 34
-    static const uint8_t skey[] = "skey\n";
-    uint8_t buff [256];
-    uint64_t tot_read, tot_writ;
-    size_t num_read, num_writ;
-    rc_t rc;
-
-    assert (fin);
-    assert (fout);
-
-    for (tot_read = 0 ; tot_read < READ_SIZE; tot_read += num_read)
-    {
-        rc = KFileRead (fin, tot_read, buff, READ_SIZE - tot_read, &num_read);
-        if (rc != 0)
-        {
-            PLOGERR (klogErr, (klogErr, rc,
-                               "Failed to read from directory structure in creating archive at $(P)",
-                               PLOG_U64(P), tot_read));
-            break;
-        }
-        if (num_read == 0)
-            break;
-    }
-    if (rc == 0)
-    {
-        if (tot_read == READ_SIZE)
-        {
-            memcpy (buff + READ_SIZE, skey, sizeof (skey));
-            tot_read += sizeof (skey) - 1;
-        }
-
-        for (tot_writ = 0; tot_writ < tot_read; tot_writ += num_writ)
-        {
-            rc = KFileWrite (fout, tot_writ, buff + tot_writ, 
-                             (uint32_t)(tot_read - tot_writ), &num_writ);
-            if (rc != 0)
-            {
-                PLOGERR (klogErr, (klogErr, rc,
-                                   "Failed to write to archive in creating archive at $(P)",
-                                   PLOG_U64(P), num_writ));
-                break;
-            }
-        }
-    }
-    return rc;
-}
-#endif
-
-
-/* filter will let us add the add to and extract by name things to kar */
-static
-rc_t step_through_dir (const KDirectory * dir, const char * path,
-                       bool ( CC * filter)(const KDirectory *, const char *, void *),
-                       void * fdata,
-                       rc_t ( CC * action)(const KDirectory *, const char *, void *),
-                       void * adata)
-{
-    rc_t rc;
-    KNamelist * names;
-
-    STSMSG (4, ("step_through_dir %s\n", path));
-
-    rc = KDirectoryList (dir, &names, NULL, NULL, path);
-    if (rc == 0)
-    {
-        uint32_t limit;
-        rc = KNamelistCount (names, &limit);
-        if (rc == 0)
-        {
-            uint32_t idx;
-            size_t pathlen;
-
-            pathlen = strlen(path);
-            for (idx = 0; idx < limit; idx ++)
-            {
-                const char * name;
-                rc = KNamelistGet (names, idx, &name);
-                if (rc == 0)
-                {
-                    char * new_path;
-                    size_t namelen;
-                    size_t new_pathlen;
-                    size_t rsize;
-
-                    namelen = strlen (name);
-                    new_pathlen = pathlen + 1 + namelen;
-                    rsize = new_pathlen + 1;
-                    new_path = malloc (rsize);
-                    if (new_path != NULL)
-                    {
-                        char * recur_path;
-                        if (pathlen == 0)
-                        {
-                            memcpy (new_path, name, namelen);
-                            new_path[namelen] = '\0';
-                        }
-                        else
-                        {
-                            memcpy (new_path, path, pathlen);
-                            new_path[pathlen] = '/';
-                            memcpy (&new_path[pathlen+1], name, namelen);
-                            new_path[new_pathlen] = '\0';
-                        }
-                        recur_path = malloc (rsize);
-                        if (recur_path != NULL)
-                        {
-                            rc = KDirectoryVResolvePath (dir, false, recur_path,
-                                                         rsize, new_path, NULL);
-
-                            if (rc == 0)
-                            {
-                                bool use_name;
-                                if (filter != NULL)
-                                {
-                                    use_name = filter (dir, recur_path, fdata);
-                                }
-                                else
-                                {
-                                    use_name = true;
-                                }
-                                if (use_name)
-                                {
-                                    rc = action (dir, recur_path, adata);
-                                    /* 				    if (rc == 0) */
-                                    /* 				    { */
-                                    /* 					enum KPathType type; */
-                                    /* 					type = (enum KPathType)KDirectoryPathType (dir, recur_path); */
-                                    /* 					if (type == kptDir) */
-                                    /*                                             rc = step_through_dir (dir, recur_path, filter, fdata, action, adata); */
-                                    /* 				    } */
-                                }
-                            }
-                            free (recur_path);
-                        }
-                        free (new_path);
-                    }
-                }
-                if (rc != 0)
-                    break;
-            }
-        }
-        KNamelistRelease (names);
-    }
-    return rc;
-}
-static
-rc_t	derive_directory_name (char ** dirname, const char * arcname, const char * optname)
-{
-    rc_t rc;
-    const char * srcname;
-    size_t len;
-
-    rc = 0;
-    if (optname == NULL)
-    {
-        const char * dot;
-        dot = strrchr (arcname, '.');
-        if (dot == NULL)
-        {
-            rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcInvalid);
-            PLOGERR (klogErr, (klogErr, rc, "Unable to derive directory name from $(D)", PLOG_S(D),
-                               arcname));
-            *dirname = NULL;
-        }
-        else 
-        {
-            len = dot - arcname;
-            srcname = arcname;
-        }
-    }
-    else
-    {
-        len = strlen (optname);
-        srcname = optname;
-    }
-    if (rc == 0)
-    {
-        *dirname = malloc (len + 1);
-        if (*dirname == NULL)
-        {
-            rc = RC (rcExe, rcNoTarg, rcAllocating, rcMemory, rcExhausted);
-            LOGERR (klogErr, rc, "Unable to allocate memory for directory name");
-        }
-        else
-        {
-            memcpy (*dirname, srcname, len);
-            (*dirname)[len] = '\0';
-        }
-    }
-    return rc;
-}
-
-static
-rc_t	run_kar_create(const char * archive, const char * directory)
-{
-    rc_t rc;
-    const KFile * fin;
-    KFile * fout;
-
-    rc = open_out_file (archive, &fout);
-    if (rc == 0)
-    {
-        char * directorystr;
-
-        rc = derive_directory_name (&directorystr, archive, directory);
-
-        assert (directorystr != NULL);
-        assert (directorystr[0] != '\0');
-
-        if (rc != 0)
-            LOGERR (klogErr, rc,"failed to derive directory name");
-        else
-        {
-            STSMSG (4, ("start creation of archive"));
-
-            rc = open_dir_as_archive (directorystr, &fin);
-            if (rc != 0)
-                PLOGERR (klogErr, (klogErr, rc,"failed to open directory [$(D)] as archive",
-                                   PLOG_S(D),directorystr));
-            else
-            {
-                assert (fin != NULL);
-                assert (fout != NULL);
-
-                STSMSG (4, ("start copy_file"));
-                rc = copy_file (fin, fout);
-                if (rc != 0)
-                    LOGERR (klogErr, rc, "failed copy file in create");
-                KFileRelease (fin);
-            }
-        }
-        KFileRelease (fout);
-        free (directorystr);
-
-        if (rc)
-        {
-            remove_out_file (archive);
-        }
-
-    }
-    return rc;
-}
-/* buffer must be at least 10 characters long */
-void access_to_string (char * b, uint32_t a)
-{
-    b[0] = (a & 0400) ? 'r' : '-';
-    b[1] = (a & 0200) ? 'w' : '-';
-    b[2] = (a & 0100) ? 'x' : '-';
-    b[3] = (a & 0040) ? 'r' : '-';
-    b[4] = (a & 0020) ? 'w' : '-';
-    b[5] = (a & 0010) ? 'x' : '-';
-    b[6] = (a & 0004) ? 'r' : '-';
-    b[7] = (a & 0002) ? 'w' : '-';
-    b[8] = (a & 0001) ? 'x' : '-';
-    b[9] = '\0';
-}
-
-typedef struct list_adata
-{
-    uint64_t max_size;
-    uint64_t max_loc;
-    bool (CC * filter)(const KDirectory *, const char *, void *);
-    void * fdata;
-    DLList list;
-    bool has_zombies;
-} list_adata;
-typedef struct list_item
-{
-    DLNode         dad;
-    KPathType      type;
-    uint32_t       access;
-    uint64_t       size;
-    uint64_t       loc;
-    KTime_t        mtime;
-    char *         path;
-    char *         link;
-
-} list_item;
-
-static
-rc_t CC list_action (const KDirectory * dir, const char * path, void * _adata)
-{
-    rc_t           rc;
-    list_adata *   data;
-    list_item *    item;
-    KPathType      type;
-    uint32_t       access;
-    uint64_t       size;
-    uint64_t       loc;
-    KTime_t        mtime;
-    size_t         pathlen;
-    size_t         linklen;
-    char           link		[2 * 4096]; /* we'll truncate? */
-
-    rc = 0;
-    data = _adata;
-
-    loc = size = 0;
-    pathlen = strlen (path);
-    type = KDirectoryPathType (dir, path);
-
-    if (type & kptAlias)
-    {
-        rc = KDirectoryVResolveAlias (dir, false, link, sizeof (link),
-                                      path, NULL);
-        if (rc == 0)
-            linklen = strlen (link);
-    }
-    else
-    {
-        linklen = 0;
-        switch (type & ~kptAlias)
-        {
-        case kptNotFound:
-            rc = RC (rcExe, rcDirectory, rcAccessing, rcPath, rcNotFound);
-            break;
-        case kptBadPath:
-            rc = RC (rcExe, rcDirectory, rcAccessing, rcPath, rcInvalid);
-            break;
-        case kptZombieFile:
-            if ( ! long_list )
-                return 0;
-            data->has_zombies = true;
-        case kptFile:
-            rc = KDirectoryFileSize (dir, &size, path);
-            if (rc == 0)
-            {
-                if (size > data->max_size)
-                    data->max_size = size;
-                rc = KDirectoryFileLocator (dir, &loc, path);
-                if ((rc == 0) && (loc > data->max_loc))
-                    data->max_loc = loc;
-            }
-            break;
-        case kptDir:
-            break;
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-            /* shouldn't get here */
-            return 0;
-        }
-    }
-    if (rc == 0)
-    {
-        rc = KDirectoryVAccess (dir, &access, path, NULL);
-        if (rc == 0)
-        {
-            rc = KDirectoryVDate (dir, &mtime, path, NULL);
-
-            if (rc == 0)
-            {
-                item = malloc (sizeof (*item) + pathlen + linklen + 2); /* usually one too many */
-                if (item == NULL)
-                {
-                    rc = RC (rcExe, rcNoTarg, rcAllocating, rcMemory, rcExhausted);
-                }
-                else
-                {
-                    item->type = type;
-                    item->access = access;
-                    item->size = size;
-                    item->loc = loc;
-                    item->mtime = mtime;
-                    item->path = (char *)(item+1);
-                    strcpy (item->path, path);
-                    if (type & kptAlias)
-                    {
-                        item->link = item->path + pathlen + 1;
-                        strcpy (item->link, link);
-                    }
-                    else
-                        item->link = NULL;
-                    DLListPushHead (&data->list, &item->dad);
-
-                    if (type == kptDir)
-                        rc = step_through_dir (dir, path, data->filter, data->fdata, 
-                                               list_action, data);
-
-
-                }
-            }
-        }
-    }
-    return rc;
-}
-static
-rc_t run_kar_test( const char * archive )
-{
-    rc_t rc;
-    const KDirectory * din;
-
-    rc = open_file_as_dir (archive, &din);
-    if (rc == 0)
-    {
-        list_adata adata;
-
-        adata.max_loc = adata.max_size = 0;
-        adata.filter = pnamesFilter;
-        adata.fdata = NULL;
-        adata.has_zombies = false;
-        DLListInit (&adata.list);
-        /* find all directory entries */
-        rc = step_through_dir ( din, ".", pnamesFilter, NULL, list_action, &adata );
-
-        /* "sort" the file entries if requested */
-        if (rc == 0)
-        {
-        }
-        if (rc == 0)
-        {
-            const char * LineFormatFile = "%c%s %*lu %*lu %*s %s";
-            const char * LineFormatEFile = "%c%s %*lu %*c %*s %s";
-            const char * LineFormatDir = "%c%s %*c %*c %*s %s";
-            const char * LineFormatTxt = "%c%s %-*s %-*s %-*s %s";
-            /* 18446744073709551615 is max 64bit unsigned so 20 characters + 1 */
-            char zwidth_buffer [32];
-            size_t zwidth, lwidth;
-            union u
-            {
-                DLNode * node;
-                list_item * item;
-            } ptr;
-
-            rc = string_printf (zwidth_buffer, sizeof zwidth_buffer, & zwidth, "%lu", adata.max_size);
-            rc = string_printf (zwidth_buffer, sizeof zwidth_buffer, & lwidth, "%lu", adata.max_size);
-            if (long_list)
-            { 
-                /* need to use time_t not Ktime_t here since we are calling system functions */
-                time_t t = time(NULL);
-                struct tm * ts = localtime (&t);
-                int dwidth = strftime (zwidth_buffer, sizeof (zwidth_buffer), "%Y-%m-%d %H:%M:%S", ts);
-
-                KOutMsg (LineFormatTxt,
-                         'T',"ypeAccess",
-                         (uint32_t)zwidth, "Size",
-                         (uint32_t)lwidth, "Offset",
-                         (uint32_t)dwidth, "ModDateTime",
-                         "Path Name\n");
-            }
-            for (ptr.node = DLListPopTail(&adata.list); 
-                 ptr.node != NULL;
-                 ptr.node = DLListPopTail(&adata.list))
-            {
-                if (long_list)
-                {
-                    struct tm * ts;
-                    char t;
-                    char a[10];
-                    char d[20];
-                    size_t dwidth;
-                    time_t lt;
-
-                    lt = ptr.item->mtime;
-                    ts = localtime (&lt);
-                    dwidth = strftime (d, sizeof (d), "%Y-%m-%d %H:%M:%S", ts);
-                    access_to_string (a, ptr.item->access);
-                    if (ptr.item->type & kptAlias)
-                        t = 'l';
-                    else if (ptr.item->type == kptDir)
-                        t = 'd';
-                    else
-                        t = '-';
-                    if ((ptr.item->type & ~kptAlias) == kptZombieFile)
-                        KOutMsg(LineFormatFile,
-                                t, "TRUNCATED",
-                                (uint32_t)zwidth, ptr.item->size,
-                                ( uint32_t )lwidth, ptr.item->loc,
-                                ( uint32_t )dwidth, d, ptr.item->path);
-                    else if ((ptr.item->type & ~kptAlias) == kptFile)
-                    {
-                        if (ptr.item->size == 0)
-                            KOutMsg(LineFormatEFile,
-                                    t, a,
-                                    ( uint32_t )zwidth, ptr.item->size,
-                                    ( uint32_t )lwidth, '-',
-                                    ( uint32_t )dwidth, d, ptr.item->path);
-                        else
-                            KOutMsg(LineFormatFile,
-                                    t, a,
-                                    ( uint32_t )zwidth, ptr.item->size,
-                                    ( uint32_t )lwidth, ptr.item->loc,
-                                    ( uint32_t )dwidth, d, ptr.item->path);
-                    }
-                    else
-                        KOutMsg(LineFormatDir,
-                                t, a,
-                                ( uint32_t )zwidth, '-',
-                                ( uint32_t )lwidth, '-',
-                                ( uint32_t )dwidth, d, ptr.item->path);
-                    if (ptr.item->type & kptAlias)
-                        KOutMsg (" -> %s\n", ptr.item->link);
-                    else
-                        KOutMsg ("\n");
-                }
-                else
-                {
-                    KOutMsg ("%s\n",ptr.item->path);
-                }
-            }
-        }
-        KDirectoryRelease (din);
-    }
-    return rc;
-}
-
-typedef struct extract_adata
-{
-    KDirectory * dir;
-    bool ( CC * filter)(const KDirectory *, const char *, void *);
-    void * fdata;
-} extract_adata;
-
-static
-rc_t CC extract_action (const KDirectory * dir, const char * path, void * _adata)
-{
-    rc_t            rc;
-    extract_adata * adata;
-    KPathType     type;
-    char            link	[2 * 4096]; /* we'll truncate? */
-    uint32_t	    access;
-    rc = 0;
-    adata = _adata;
-
-    STSMSG (1, ("extract_action: %s\n", path));
-
-    type = KDirectoryPathType (dir, path);
-
-    if (type & kptAlias)
-    {
-        rc = KDirectoryVResolveAlias (dir, false, link, sizeof (link),
-                                      path, NULL);
-        if (rc == 0)
-        {
-            rc = KDirectoryVAccess (dir, &access, path, NULL);
-            if (rc == 0)
-            {
-                rc = KDirectoryCreateAlias (adata->dir, access, kcmCreate|kcmParents,
-                                            link, path);
-            }
-        }
-    }
-    else
-    {
-        switch (type & ~kptAlias)
-        {
-        case kptNotFound:
-            rc = RC (rcExe, rcDirectory, rcAccessing, rcPath, rcNotFound);
-
-            KOutMsg ("%s: %s type kptNotFouns %R\n", __func__, path, rc);
-
-            break;
-        case kptBadPath:
-            rc = RC (rcExe, rcDirectory, rcAccessing, rcPath, rcInvalid);
-            break;
-        case kptFile:
-            rc = KDirectoryVAccess (dir, &access, path, NULL);
-            if (rc == 0)
-            {
-                const KFile * fin;
-                KFile * fout;
-                rc = KDirectoryVCreateFile (adata->dir, &fout, false, access,
-                                            kcmCreate|kcmParents,
-                                            path, NULL);
-                if (rc == 0)
-                {
-                    rc = KDirectoryVOpenFileRead (dir, &fin, path, NULL);
-                    if (rc == 0)
-                    {
-#if USE_SKEY_MD5_FIX
-                        /* KLUDGE!!!! */
-                        size_t pathz, skey_md5z;
-                        static const char skey_md5[] = "skey.md5";
-
-                        pathz = string_size (path);
-                        skey_md5z = string_size(skey_md5);
-                        if ( pathz >= skey_md5z && strcmp ( & path [ pathz - skey_md5z ], skey_md5 ) == 0 )
-                            rc = copy_file_skey_md5_kludge (fin, fout);
-                        else
-#endif
-                            rc = copy_file (fin, fout);
-                        KFileRelease (fin);
-                    }
-                    KFileRelease (fout);
-                }
-            }
-            break;
-        case kptDir:
-            rc = KDirectoryVAccess (dir, &access, path, NULL);
-            if (rc == 0)
-            {
-                rc = KDirectoryCreateDir (adata->dir, 0700, 
-                                          kcmCreate|kcmParents,
-                                          path, NULL);
-                if (rc == 0)
-                {
-                    rc = step_through_dir (dir, path, adata->filter, adata->fdata,
-                                           extract_action, adata);
-                    if (rc == 0)
-                        rc = KDirectoryVSetAccess (adata->dir, false, access, 0777, path, NULL);
-                }
-
-
-
-            }
-            break;
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-            /* shouldn't get here */
-            return 0;
-        }
-    }
-
-    return rc;
-}
-static
-rc_t	run_kar_extract (const char * archive, const char * directory)
-{
-    rc_t rc;
-    const KDirectory * din;
-    KDirectory * dout;
-
-    STSMSG (1, ("run_kar_extract"));
-
-    rc = open_file_as_dir (archive, &din);
-    if (rc == 0 )
-    {
-        char * directorystr;
-        rc = derive_directory_name (&directorystr, archive, directory);
-        
-        if (rc != 0)
-        {
-            ;
-/*             PLOGERR (klogDebug1, (klogDebug1, rc, "failure to derive archive [$(A)/$(D)]", */
-/*                      PLOG_2(PLOG_S(A),PLOG_S(D)), archive, directory)); */
-        }
-        else
-        {
-            rc = open_out_dir (directorystr, &dout);
-            free (directorystr);
-            if (rc != 0)
-            {
-                LOGERR (klogErr, rc, "failure to open output directory");
-            }
-            else
-            {
-                extract_adata adata;
-                adata.dir = dout;
-                adata.filter = pnamesFilter;
-                adata.fdata = NULL;
-                
-                rc = step_through_dir (din, ".", pnamesFilter, NULL, extract_action, &adata);
-                KDirectoryRelease (dout);
-            }
-        }
-        KDirectoryRelease (din);
-    }
-    return rc;
-}
-
-ver_t CC KAppVersion (void)
-{
-    return  KAR_VERS;
-}
-
-
-rc_t CC NextLogLevelCommon ( const char * level_parameter );
-
-typedef enum op_mode
-{
-    OM_NONE = 0,
-    OM_CREATE,
-    OM_TEST,
-    OM_EXTRACT,
-    OM_ERROR
-} op_mode;
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc == 0)
-    {
-        uint32_t pcount;
-        const char * pc;
-        const char * directory;
-        const char * archive;
-
-        do
-        {
-            op_mode mode;
-            uint32_t ix;
-
-            BSTreeInit (&pnames);
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-            for (ix = 0; ix < pcount; ++ix)
-            {
-                rc = ArgsParamValue (args, ix, &pc);
-                if (rc)
-                    break;
-                rc = pnamesInsert (pc);
-                if (rc)
-                {
-                    PLOGERR (klogInt, (klogInt, rc, "failure to process filter parameter [%s]", pc));
-                    break;
-                }
-            }
-            if (rc)
-                break;
-
-            rc = ArgsOptionCount (args, OPTION_ALIGN, &pcount);
-            if (rc)
-                break;
-            if (pcount == 0)
-                pc = NULL;
-            else
-            {
-                rc = ArgsOptionValue (args, OPTION_ALIGN, 0, &pc);
-                if (rc)
-                    break;
-            }
-            alignment = get_alignment (pc);
-            if (alignment == sraAlignInvalid)
-            {
-                rc = RC (rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-                PLOGERR (klogFatal, (klogFatal, rc,
-                         "Parameter for alignment [$(A)] is invalid: must be a power of two bytes",
-                                     PLOG_S(A), pc));
-                break;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_LONGLIST, &pcount);
-            if (rc)
-                break;
-            long_list = (pcount != 0);
-
-            rc = ArgsOptionCount (args, OPTION_FORCE, &pcount);
-            if (rc)
-                break;
-            force = (pcount != 0);
-
-            mode = OM_NONE;
-
-            rc = ArgsOptionCount (args, OPTION_DIRECTORY, &pcount);
-            if (rc)
-                break;
-            if (pcount)
-            {
-                rc = ArgsOptionValue (args, OPTION_DIRECTORY, 0, &directory);
-                if (rc)
-                    break;
-
-            }
-            else
-                directory = NULL;
-
-            rc = ArgsOptionCount (args, OPTION_CREATE, &pcount);
-            if (rc)
-                break;
-            if (pcount)
-            {
-                rc = ArgsOptionValue (args, OPTION_CREATE, 0, &archive);
-
-                if (rc)
-                    break;
-                mode = OM_CREATE;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_TEST, &pcount);
-            if (rc)
-                break;
-            if (pcount)
-            {
-                if (mode == OM_NONE)
-                {
-                    mode = OM_TEST;
-                    rc = ArgsOptionValue (args, OPTION_TEST, 0, &archive);
-                    if (rc)
-                        break;
-                }
-                else
-                    mode = OM_ERROR;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_LIST, &pcount);
-            if (rc)
-                break;
-            if (pcount)
-            {
-                if (mode == OM_NONE)
-                {
-                    mode = OM_TEST;
-                    rc = ArgsOptionValue (args, OPTION_LIST, 0, &archive);
-                    if (rc)
-                        break;
-                }
-                else
-                    mode = OM_ERROR;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_EXTRACT, &pcount);
-            if (rc)
-                break;
-            if (pcount)
-            {
-                if (mode == OM_NONE)
-                {
-                    mode = OM_EXTRACT;
-                    rc = ArgsOptionValue (args, OPTION_EXTRACT, 0, &archive);
-                    if (rc)
-                        break;
-                }
-                else
-                    mode = OM_ERROR;
-            }
-
-
-            if (mode == OM_NONE)
-            {
-                MiniUsage(args);
-                break;
-            }
-
-
-            /* -----
-             * Mount the native filesystem as root
-             */
-            rc = KDirectoryNativeDir (&kdir);
-            if (rc != 0)
-            {
-                LOGMSG (klogFatal, "Failed to open native KDirectory");
-            }
-            else
-            {
-                switch (mode)
-
-                { 
-                default: /* OM_NONE presumably */
-/*                     assert (mode == OM_NONE); */
-/*                     rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcEmpty); */
-/*                     LOGERR (klogFatal, rc, "Must provide a single operating mode and archive: Create, Test (list) or eXtract"); */
-                    pc = NULL;
-                    break;
-
-                case OM_ERROR:
-                    rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcAmbiguous);
-                    LOGERR (klogFatal, rc, "Must provide a single operating mode and archive: Create, Test (list) or eXtract");
-                    break;
-                case OM_CREATE:
-                    STSMSG (2, ("Create Mode %s %s", archive, directory));
-                    if (directory == NULL)
-                    {
-                        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcNull);
-                        LOGERR (klogFatal, rc, "Must provide a directory for create mode");
-                    }
-                    else
-                        rc = run_kar_create (archive, directory);
-                    break;
-                case OM_TEST:
-                    STSMSG (2, ("Test Mode %s", archive));
-                    rc = run_kar_test (archive);
-                    break;
-                case OM_EXTRACT:
-                    STSMSG (2, ("Extract Mode %s %s", archive, directory));
-                    if (directory == NULL)
-                    {
-                        rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcNull);
-                        LOGERR (klogFatal, rc, "Must provide a directory for extract mode");
-                    }
-                    else
-                        rc = run_kar_extract (archive, directory);
-                    break;
-                }
-
-                KDirectoryRelease (kdir);
-            }
-
-        } while (0);
-
-        ArgsWhack (args);
-    }
-    if (rc)
-        LOGERR (klogWarn, rc, "Failure exiting kar");
-    else
-        STSMSG (1, ("Success: Exiting kar\n"));
-    return rc;
-}
-
-/* end of file */
diff --git a/tools/kar/kar.vers b/tools/kar/kar.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/kar/kar.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/kar/sra-kar.c b/tools/kar/sra-kar.c
deleted file mode 100644
index 67d8745..0000000
--- a/tools/kar/sra-kar.c
+++ /dev/null
@@ -1,443 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#define USE_FORCE 0
-
-#include "sra-kar.vers.h"
-
-#include <klib/rc.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/status.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-
-#include <sra/sradb.h>
-#include <sra/sradb-priv.h>
-
-#include <kapp/args.h>
-
-
-#include <assert.h>
-
-typedef struct srakar_parms srakar_parms;
-struct srakar_parms
-{
-    KDirectory * dir;
-    const char *src_path;
-    const char *dst_path;
-    bool lite;
-    bool force;
-};
-
-static
-rc_t copy_file (const KFile * fin, KFile *fout)
-{
-    rc_t rc;
-    uint8_t	buff	[64 * 1024];
-    size_t	num_read;
-    uint64_t	inpos;
-    uint64_t	outpos;
-    uint64_t    fsize;
-
-    assert (fin != NULL);
-    assert (fout != NULL);
-
-    inpos = 0;
-    outpos = 0;
-
-    rc = KFileSize (fin, &fsize);
-    if (rc != 0)
-        return rc;
-
-    do
-    {
-        rc = KFileRead (fin, inpos, buff, sizeof (buff), &num_read);
-        if (rc != 0)
-        {
-            PLOGERR (klogErr, (klogErr, rc,
-                               "Failed to read from directory structure in creating archive at $(P)",
-                               PLOG_U64(P), inpos));
-            break;
-        }
-        else if (num_read > 0)
-        {
-            size_t to_write;
-
-            inpos += (uint64_t)num_read;
-
-            to_write = num_read;
-            while (to_write > 0)
-            {
-                size_t num_writ;
-                rc = KFileWrite (fout, outpos, buff, num_read, &num_writ);
-                if (rc != 0)
-                {
-                    PLOGERR (klogErr, (klogErr, rc,
-                                       "Failed to write to archive in creating archive at $(P)",
-                                       PLOG_U64(P), outpos));
-                    break;
-                }
-                outpos += num_writ;
-                to_write -= num_writ;
-            }
-        }
-        if (rc != 0)
-            break;
-    } while (num_read != 0);
-    return rc;
-}
-static
-rc_t run ( srakar_parms *pb )
-{
-    KFile * outfile;
-    rc_t rc;
-
-    const SRAMgr *mgr;
-
-    rc = SRAMgrMakeRead ( & mgr );
-    if ( rc != 0 )
-        LOGERR ( klogInt, rc, "failed to open SRAMgr" );
-    else
-    {
-        const SRATable *tbl;
-        rc = SRAMgrOpenTableRead ( mgr, & tbl, pb -> src_path );
-        if ( rc != 0 )
-            PLOGERR ( klogInt, (klogInt, rc,
-                "failed to open SRATable '$(spec)'", "spec=%s",
-                pb -> src_path ));
-        else
-        {
-            rc = KDirectoryCreateFile (pb->dir, &outfile, false, 0446,
-                kcmParents | ( pb->force ? kcmInit : kcmCreate) , pb->dst_path);
-            if (rc == 0)
-            {
-                const KFile * archive;
-
-                rc = SRATableMakeSingleFileArchive (tbl, &archive, pb->lite,
-                    NULL);
-                if (rc == 0)
-                {
-                    rc = copy_file (archive, outfile);
-                    KFileRelease (archive);
-                }
-                KFileRelease (outfile);
-            }
-            SRATableRelease ( tbl );
-        }
-        SRAMgrRelease (mgr);
-    }
-/*
-    rc = KDirectoryCreateFile (pb->dir, &outfile, false, 0446, kcmParents | ( pb->force ? kcmInit : kcmCreate) , pb->dst_path);
-
-    if (rc == 0)
-    {
-        const SRAMgr *mgr;
-
-        rc = SRAMgrMakeRead ( & mgr );
-        if ( rc != 0 )
-            LOGERR ( klogInt, rc, "failed to open SRAMgr" );
-        else
-        {
-            const SRATable *tbl;
-            rc = SRAMgrOpenTableRead ( mgr, & tbl, pb -> src_path );
-            if ( rc != 0 )
-                PLOGERR ( klogInt, (klogInt, rc, "failed to open SRATable '$(spec)'", "spec=%s", pb -> src_path ));
-            else
-            {
-                const KFile * archive;
-
-                rc = SRATableMakeSingleFileArchive (tbl, &archive, pb->lite, NULL);
-                if (rc == 0)
-                {
-                    rc = copy_file (archive, outfile);
-                    KFileRelease (archive);
-                }
-                SRATableRelease ( tbl );
-            }
-            SRAMgrRelease (mgr);
-        }
-        KFileRelease (outfile);
-    }
-*/
-    return rc;
-}
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return SRA_KAR_VERS;
-}
-
-
-/* Usage
- */
-#define OPTION_LITE "lite"
-#define ALIAS_LITE "l"
-static const char * lite_usage[] = { "output an abbreviated version of the table", NULL };
-
-#if USE_FORCE
-#define OPTION_FORCE "force"
-#define ALIAS_FORCE "f"
-static const char * force_usage[] = { "replace an existing archive if present", NULL };
-#endif
-static
-OptDef Options[] = 
-{
-#if USE_FORCE
-    { OPTION_FORCE, ALIAS_FORCE, NULL, force_usage, 1, false, false },
-#endif
-    { OPTION_LITE, ALIAS_LITE, NULL, lite_usage, 1, false, false }
-};
-
-
-static
-KLogLevel default_log_level;
-
-
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [options] table [archive]\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Create a single file archive from an SRA database table.\n"
-                    "  The archive name can be given or will be derived from the\n"
-                    "  name of the table.\n"
-                    "\n", progname);
-}
-
-const char UsageDefaultName[] = "sra-kar";
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionLine (ALIAS_LITE, OPTION_LITE, NULL, lite_usage);
-#if USE_FORCE
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage);
-#endif
-    HelpOptionsStandard ();
-    HelpVersion (fullpath, KAppVersion());
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-    rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    default_log_level = KLogLevelGet();
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc == 0)
-    {
-        do
-        {
-            srakar_parms pb;
-            KDirectory * pwd;
-            const char * name;
-            uint32_t pcount;
-            char archive_name [256];
-
-            rc = KDirectoryNativeDir (&pwd);
-            if (rc)
-                break;
-
-            pb.lite = false;
-            pb.force = false;
-            pb.dir = pwd;
-
-            rc = ArgsOptionCount (args, OPTION_LITE, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                STSMSG (1, ("Using lite option"));
-                pb.lite = true;
-            }
-
-#if USE_FORCE
-            rc = ArgsOptionCount (args, OPTION_FORCE, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                STSMSG (1, ("Using force option"));
-                pb.force = true;
-            }
-#endif
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 0)
-            {
-                KOutMsg ("missing source table\n");
-                rc = MiniUsage (args);
-                break;
-            }
-            else if (pcount > 2)
-            {
-                KOutMsg ("Too many parameters\n");
-                rc = MiniUsage (args);
-                break;
-            }
-
-            rc = ArgsParamValue (args, 0, &pb.src_path);
-            if (rc)
-            {
-                KOutMsg ("failure to get source path/name\n");
-                break;
-            }
-
-            pb.dst_path = archive_name;
-
-            name = string_rchr (pb.src_path, string_size (pb.src_path), '/');
-            if (name == NULL)
-                name = pb.src_path;
-
-            if (pcount == 1)
-            {
-                size_t size;
-
-                rc = string_printf (archive_name, sizeof (archive_name), & size,
-                                 "%s%s", name, pb.lite ? ".lite.sra" : ".sra");
-                if ( rc != 0 )
-                {
-                    rc = RC (rcExe, rcArgv, rcParsing, rcPath, rcInsufficient);
-                    PLOGERR (klogFatal, (klogFatal, rc, "Failure building archive name $(P)", "P=%s", archive_name));
-                    break;
-                }
-            }
-            else
-            {
-                rc = ArgsParamValue (args, 1, &pb.dst_path);
-                if (rc)
-                {
-                    LOGERR (klogInt, rc, "failure to get destination path");
-                    break;
-                }
-            }
-
-            if (rc == 0)
-            {
-                KPathType kpt;
-
-                kpt = KDirectoryPathType (pwd, pb.dst_path);
-
-                switch (kpt & ~kptAlias)
-                {
-                case kptNotFound:
-                    /* found nothing so assume its a valid new file name
-                     * not gonna tweak extensions at this point but that can be upgraded */
-                    break;
-                case kptFile:
-                    /* got a file name, use it  - would need force... */
-                    if (pb.force == false)
-                    {
-                        rc = RC (rcExe, rcArgv, rcParsing, rcPath, rcBusy);
-                        PLOGERR (klogFatal, (klogFatal, rc, 
-                                             "Output file already exists $(P)",
-                                             "P=%s", archive_name));
-                    }
-                    break;
-
-                case kptDir:
-                {
-                    size_t size;
-
-                    rc = string_printf (archive_name, sizeof (archive_name), & size,
-                                     "%s/%s%s", pb.dst_path, name, pb.lite ? ".lite.sra" : ".sra");
-                    if ( rc != 0 )
-                    {
-                        rc = RC (rcExe, rcArgv, rcParsing, rcPath, rcInsufficient);
-                        PLOGERR (klogFatal, (klogFatal, rc, "Failure building archive name $(P)", "P=%s", archive_name));
-                        break;
-                    }
-                    pb.dst_path = archive_name;
-                    break;
-                }
-                default:
-                    rc = RC (rcExe, rcArgv, rcParsing, rcPath, rcInvalid);
-                    break;
-                }
-                if (rc == 0)
-                {
-                    STSMSG (1,("Creating archive (%s) from table (%s)\n", pb.dst_path, pb.src_path));
-
-                    rc = run (&pb);
-                    STSMSG (5, ("Run exits with %d %R\n", rc, rc));
-                }
-            }
-
-        } while (0);
-    }
-    STSMSG (1, ("Exit status %u %R", rc, rc));
-    return rc;
-}
diff --git a/tools/kar/sra-kar.vers b/tools/kar/sra-kar.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/kar/sra-kar.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/nenctool/Makefile b/tools/nenctool/Makefile
deleted file mode 100644
index f6a51c8..0000000
--- a/tools/nenctool/Makefile
+++ /dev/null
@@ -1,123 +0,0 @@
-# ==============================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-USE_GCC_IF_ICC = 1
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/nenctool
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	nenctool
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# nenctool
-#  Copy files from one directory to another while cataloging the contents.
-#  XML files can be redirected as well.
-#
-NENCTOOL_SRC = \
-	nenctool
-
-NENCTOOL_OBJ = \
-	$(addsuffix .$(OBJX),$(NENCTOOL_SRC))
-
-NENCTOOL_LIB = \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/nenctool: $(NENCTOOL_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(NENCTOOL_LIB)
-
-#-------------------------------------------------------------------------------
-# nenctest
-#  Copy files from one directory to another while cataloging the contents.
-#  XML files can be redirected as well.
-#
-NENCTEST_SRC = \
-	nenctest
-
-NENCTEST_OBJ = \
-	$(addsuffix .$(OBJX),$(NENCTEST_SRC))
-
-NENCTEST_LIB = \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkryptotest \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/nenctest: $(NENCTEST_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(NENCTEST_LIB)
diff --git a/tools/nenctool/nenctest.c b/tools/nenctool/nenctest.c
deleted file mode 100644
index 89f1286..0000000
--- a/tools/nenctool/nenctest.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "nenctest.vers.h"
-
-#include <kapp/main.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <krypto/testciphermgr.h>
-#include <krypto/encfile.h>
-#include <kfs/file.h>
-
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/rc.h>
-
-#include <assert.h>
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return NENCTEST_VERS;
-}
-
-
-#define OPTION_FORCE   "force"
-#define ALIAS_FORCE   "f"
-static
-const char * force_usage[] = 
-{ "force overwrite of existing files", NULL };
-
-
-#define OPTION_CIPHER  "cipher"
-#define ALIAS_CIPHER   "c"
-static
-const char * cipher_usage[] = 
-{ "choose cipher version ",
-  "0-byte oritented vector", 
-  "1-vector",
-  "2-vector register",
-  "3-aes-ni",
-  "not all implementatons exist on all platforms",
-  NULL };
-static
-OptDef Options[] = 
-{
-    /* name            alias max times oparam required fmtfunc help text loc */
-    { OPTION_FORCE,  ALIAS_FORCE,  NULL, force_usage,  0, false, false },
-    { OPTION_CIPHER, ALIAS_CIPHER, NULL, cipher_usage, 1, true,  false }
-};
-
-
-
-/* Usage
- */
-const char UsageDefaultName [] = "nencvalid";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s [options] <source-file-path> <destination-file-path>\n"
-        "\n"
-        "Summary:\n"
-        "  Copy a file from the first parameter to the second parameter\n"
-        "  Encryption, decryption, or re-encryption are the expected purpose.\n"
-        "  This is a version of nenctool with some testing features added.\n"
-        "  The first added feature is some level of cipher implementation\n"
-        "  selection.\n"
-        "\n", progname);
-}
-
-static
-const char * first_usage[] = 
-{
-    "The path to a file either in native format",
-};
-
-static
-const char * second_usage[] = 
-{
-    "in 'file' URI scheme or in 'ncbi-file'",
-    "URI scheme.",
-    "\"ncbi-file\" scheme adds a query to the \"file\" scheme",
-    "where 'enc' or 'encrypt' means the file is encrypted",
-    "and 'pwfile=<path>' points to a file to get the password",
-    "or 'pwfd=<fd>' refers to a file descriptor from which to",
-    "read a password."
-};
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("Parameters:\n");
-
-    HelpParamLine ("source-file-path", first_usage);
-    HelpParamLine ("destination-file-path", second_usage);
-
-    KOutMsg ("\nOptions:\n");
-
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage);
-    HelpOptionLine (ALIAS_CIPHER, OPTION_CIPHER, "implementation", cipher_usage);
-
-    HelpOptionsStandard ();
-
-    OUTMSG (("\n"
-             "ncbi-file uri syntax:\n"
-             "  'ncbi-file' uris are based on a combination of the standard\n"
-             "  'file' and 'http' syntax familiar to browser users.\n"
-             "  Enclosing questions marks are probably necessary.\n"
-             "\n"
-             "  URI syntax is 'scheme:'hierarchical-part'?'query'#'fragment'\n"
-             "  scheme:\n"
-             "    ncbi-file\n"
-             "  hierarchical-part:\n"
-             "    this is the same as for scheme file and can be the native form or\n"));
-    OUTMSG (("    the ncbi 'posix' format that matches most flavors of Unix.\n"
-             "    Environment variables and short hands such as '~' are not interpreted.\n"
-             "  query:\n"
-             "    Zero or two symbols separated by the '&'.  The whole query can be omitted.\n"
-             "      enc or encrypt\n"
-             "      pwfile='path to a file containing a password'\n"
-             "      pwfd='file descriptor where the password can be read'\n"
-             "    If the encrypt is present exactly one of the other two must be present.\n"
-             "  fragment:\n"
-             "    No fragment is permitted.\n"));
-    OUTMSG (("\n"
-             "password contents:\n"
-             "  The file or file descriptor containing the password is read enough to satisfy\n"
-             "  the following restriction.  The password is terminated by the end of file,\n"
-             "  a carriage return or a line feed.  The length must be no more than 4096 bytes.\n"
-             "  The password file should have limited read access to protect it.\n"));
-
-
-    OUTMSG (("\n"
-             "Use examples:"
-             "\n"
-             "  To encrypt a create a file named 'example' with a password from a file\n"
-             "  named 'password-file' to a file named 'example.nenc' all in the current\n"
-             "  directory:\n"
-             "\n"
-             "  $ %s example \"ncbi-file:example.nenc?encrypt&pwfile=password-file\"\n",
-             progname));
-    OUTMSG (("\n"
-             "  To decrypt a file named 'example.nenc' with a password from a file\n"
-             "  named 'password-file' to a file named 'example' in directories implied\n"
-             "  in the command:\n"
-             "\n"
-             "  $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=/home/user/password-file\" example\n",
-             progname));
-    OUTMSG (("\n"
-             "  To change the encryption of a file from one password to another:\n"
-             "\n"
-             "  $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=old-password-file\" \\\n"
-             "         \"ncbi-file:example.nenc?encrypt&pwfile=/home/user/new-password-file\"\n",
-             progname));
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-static
-rc_t copy_file (const char * src, const char * dst, const KFile * fin, KFile *fout)
-{
-    rc_t rc;
-    uint8_t	buff	[64 * 1024];
-    size_t	num_read;
-    uint64_t	inpos;
-    uint64_t	outpos;
-
-    assert (src);
-    assert (dst);
-    assert (fin);
-    assert (fout);
-
-    inpos = 0;
-    outpos = 0;
-
-#if 1
-    for (inpos = 0; ; inpos += num_read)
-    {
-        rc = Quitting ();
-        if (rc)
-        {
-            LOGMSG (klogFatal, "Received quit");
-            break;
-        }
-        else
-        {
-            rc = KFileReadAll (fin, inpos, buff, sizeof (buff), &num_read);
-            if (rc)
-            {
-                PLOGERR (klogErr,
-                         (klogErr, rc,
-                          "Failed to read from file $(F) at $(P)",
-                          "F=%s,P=%lu", src, inpos));
-                break;
-            }
-            else if (num_read)
-            {
-                size_t num_writ;
-
-                rc = KFileWriteAll (fout, inpos, buff, num_read, &num_writ);
-                if (rc)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-                else if (num_writ != num_read)
-                {
-                    rc = RC (rcExe, rcFile, rcWriting, rcFile, rcInsufficient);
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write all to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-            }
-            else 
-                break;
-        }
-    }
-#else
-    do
-    {
-        rc = Quitting ();
-        if (rc)
-        {
-            LOGMSG (klogFatal, "Received quit");
-            break;
-        }
-        rc = KFileRead (fin, inpos, buff, sizeof (buff), &num_read);
-        if (rc)
-        {
-            PLOGERR (klogErr,
-                     (klogErr, rc,
-                      "Failed to read from file $(F) at $(P)",
-                      "F=%s,P=%lu", src, inpos));
-            break;
-        }
-        else if (num_read > 0)
-        {
-            size_t to_write;
-
-            inpos += (uint64_t)num_read;
-
-            STSMSG (2, ("Read %zu bytes to %lu", num_read, inpos));
-
-            to_write = num_read;
-            while (to_write > 0)
-            {
-                size_t num_writ;
-                rc = KFileWrite (fout, outpos, buff, num_read, &num_writ);
-                if (rc)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-                outpos += num_writ;
-                to_write -= num_writ;
-            }
-        }
-        if (rc)
-            break;
-    } while (num_read != 0);
-#endif
-    return rc;
-}
-
-
-static
-rc_t nenctest (const char * srcstr, const char * dststr, bool force)
-{
-    VFSManager * mgr;
-    rc_t rc;
-
-    rc = VFSManagerMake (&mgr);
-    if (rc)
-        LOGERR (klogInt, rc, "failed to create file system manager");
-    else
-    {
-        VPath * srcpath;
-
-        rc = VFSManagerMakePath (mgr, &srcpath, srcstr);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Failed to parse source path '$(path)'",
-                      "path=%s", srcstr));
-        else
-        {
-            VPath * dstpath;
-
-            rc = VFSManagerMakePath (mgr, &dstpath, dststr);
-            if (rc)
-                PLOGERR (klogErr,
-                         (klogErr, rc, "Failed to parse destination path '$(path)'",
-                          "path=%s", dststr));
-            else
-            {
-                const KFile * srcfile;
-
-                rc = VFSManagerOpenFileRead (mgr, &srcfile, srcpath);
-                if (rc)
-                    PLOGERR (klogErr,
-                             (klogErr, rc, "Failed to open source path '$(path)'",
-                              "path=%s", srcstr));
-                else
-                {
-                    KFile * dstfile;
-
-                    rc = VFSManagerCreateFile (mgr, &dstfile, false, 0666,
-                                               kcmParents | (force ? kcmInit : kcmCreate),
-                                               dstpath);
-                    if (rc)
-                        PLOGERR (klogErr,
-                                 (klogErr, rc, "failed to open destination path '$(path)'",
-                                  "path=%s", dststr));
-                    else
-                    {
-                        rc = copy_file (srcstr, dststr, srcfile, dstfile);
-                        if (rc)
-                        {
-                            PLOGERR (klogErr,
-                                     (klogErr, rc, "failed to copy '$(S)' to '$(D)'",
-                                      "S=%s,D=%s", srcstr, dststr));
-
-                            VFSManagerRemove (mgr, true, dstpath);
-                        }
-
-                        KFileRelease (dstfile);
-                    }
-                    KFileRelease (srcfile);
-                }
-                VPathRelease (dstpath);
-            }
-            VPathRelease (srcpath);
-        }
-        VFSManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args* args = NULL;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse command line parameters");
-    if (rc == 0)
-    {
-        uint32_t pcount;
-        bool force;
-
-        rc = ArgsOptionCount (args, OPTION_FORCE, &pcount);
-        if (rc)
-            LOGERR (klogInt, rc, "failed to examine force option");
-        else
-        {
-            force = (pcount > 0);
- 
-            rc = ArgsOptionCount (args, OPTION_CIPHER, &pcount);
-            if (rc)
-                LOGERR (klogInt, rc, "failed to examine cipher option");
-            else
-            {
-                if (pcount)
-                {
-                    const char * value;
-
-                    rc = ArgsOptionValue (args, OPTION_CIPHER, 0, &value);
-                    if (rc)
-                        LOGERR (klogInt, rc, "failed to examine cipher value");
-                    else
-                    {
-                        if (value[1])
-                            rc = RC (rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-                        else
-                            switch (value[0])
-                            {
-                            case '0':
-                            case '1':
-                            case '2':
-                            case '3':
-                                KCipherSubType = value[0] - '0';
-                                break;
-                            default:
-                                rc = RC (rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-                                break;
-                            }
-                        if (rc)
-                            LOGERR (klogErr, rc, "bad value for cipher implmentation");
-                    }
-                }
-                if (rc == 0)
-                {
-                    rc = ArgsParamCount (args, &pcount);
-                    if (rc)
-                        LOGERR (klogInt, rc, "failed to count parameters");
-                    else
-                    {
-                        if (pcount != 2)
-                            MiniUsage (args);
-                        else
-                        {
-                            const char * src;
-
-                            rc = ArgsParamValue (args, 0, &src);
-                            if (rc)
-                                LOGERR (klogInt, rc, "failed to get source parameter");
-                            else
-                            {
-                                const char * dst;
-                                rc = ArgsParamValue (args, 1, &dst);
-                                if (rc)
-                                    LOGERR (klogInt, rc, "failed to get destination parameter");
-                                else
-                                {
-                                    rc = nenctest (src, dst, force);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        ArgsWhack (args);
-    }
-    STSMSG (1, ("exiting: %R (%u)", rc, rc));
-    return rc;
-}
-
-/* EOF */
diff --git a/tools/nenctool/nenctest.vers b/tools/nenctool/nenctest.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/nenctool/nenctest.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/nenctool/nenctool.c b/tools/nenctool/nenctool.c
deleted file mode 100644
index 2b51bdb..0000000
--- a/tools/nenctool/nenctool.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "nenctool.vers.h"
-
-#include <kapp/main.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <krypto/encfile.h>
-#include <kfs/file.h>
-
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/rc.h>
-
-#include <assert.h>
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return NENCTOOL_VERS;
-}
-
-
-#define OPTION_FORCE   "force"
-#define ALIAS_FORCE   "f"
-static
-const char * force_usage[] = 
-{ "force overwrite of existing files", NULL };
-static
-OptDef Options[] = 
-{
-    /* name            alias max times oparam required fmtfunc help text loc */
-    { OPTION_FORCE,   ALIAS_FORCE,   NULL, force_usage,   0, false, false }
-};
-
-
-
-/* Usage
- */
-const char UsageDefaultName [] = "nencvalid";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s [options] <source-file-path> <destination-file-path>\n"
-        "\n"
-        "Summary:\n"
-        "  Copy a file from the first parameter to the second parameter\n"
-        "  Encryption, decryption, or re-encryption are the expected purpose.\n"
-        "\n", progname);
-}
-
-static
-const char * first_usage[] = 
-{
-    "The path to a file either in native format",
-};
-
-static
-const char * second_usage[] = 
-{
-    "in 'file' URI scheme or in 'ncbi-file'",
-    "URI scheme.",
-    "\"ncbi-file\" scheme adds a query to the \"file\" scheme",
-    "where 'enc' or 'encrypt' means the file is encrypted",
-    "and 'pwfile=<path>' points to a file to get the password",
-    "or 'pwfd=<fd>' refers to a file descriptor from which to",
-    "read a password."
-};
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("Parameters:\n");
-
-    HelpParamLine ("source-file-path", first_usage);
-    HelpParamLine ("destination-file-path", second_usage);
-
-    KOutMsg ("\nOptions:\n");
-
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage);
-
-    HelpOptionsStandard ();
-
-    OUTMSG (("\n"
-             "ncbi-file uri syntax:\n"
-             "  'ncbi-file' uris are based on a combination of the standard\n"
-             "  'file' and 'http' syntax familiar to browser users.\n"
-             "  Enclosing questions marks are probably necessary.\n"
-             "\n"
-             "  URI syntax is 'scheme:'hierarchical-part'?'query'#'fragment'\n"
-             "  scheme:\n"
-             "    ncbi-file\n"
-             "  hierarchical-part:\n"
-             "    this is the same as for scheme file and can be the native form or\n"));
-    OUTMSG (("    the ncbi 'posix' format that matches most flavors of Unix.\n"
-             "    Environment variables and short hands such as '~' are not interpreted.\n"
-             "  query:\n"
-             "    Zero or two symbols separated by the '&'.  The whole query can be omitted.\n"
-             "      enc or encrypt\n"
-             "      pwfile='path to a file containing a password'\n"
-             "      pwfd='file descriptor where the password can be read'\n"
-             "    If the encrypt is present exactly one of the other two must be present.\n"
-             "  fragment:\n"
-             "    No fragment is permitted.\n"));
-    OUTMSG (("\n"
-             "password contents:\n"
-             "  The file or file descriptor containing the password is read enough to satisfy\n"
-             "  the following restriction.  The password is terminated by the end of file,\n"
-             "  a carriage return or a line feed.  The length must be no more than 4096 bytes.\n"
-             "  The password file should have limited read access to protect it.\n"));
-
-
-    OUTMSG (("\n"
-             "Use examples:"
-             "\n"
-             "  To encrypt a create a file named 'example' with a password from a file\n"
-             "  named 'password-file' to a file named 'example.nenc' all in the current\n"
-             "  directory:\n"
-             "\n"
-             "  $ %s example \"ncbi-file:example.nenc?encrypt&pwfile=password-file\"\n",
-             progname));
-    OUTMSG (("\n"
-             "  To decrypt a file named 'example.nenc' with a password from a file\n"
-             "  named 'password-file' to a file named 'example' in directories implied\n"
-             "  in the command:\n"
-             "\n"
-             "  $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=/home/user/password-file\" example\n",
-             progname));
-    OUTMSG (("\n"
-             "  To change the encryption of a file from one password to another:\n"
-             "\n"
-             "  $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=old-password-file\" \\\n"
-             "         \"ncbi-file:example.nenc?encrypt&pwfile=/home/user/new-password-file\"\n",
-             progname));
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-static
-rc_t copy_file (const char * src, const char * dst, const KFile * fin, KFile *fout)
-{
-    rc_t rc;
-    uint8_t	buff	[64 * 1024];
-    size_t	num_read;
-    uint64_t	inpos;
-    uint64_t	outpos;
-
-    assert (src);
-    assert (dst);
-    assert (fin);
-    assert (fout);
-
-    inpos = 0;
-    outpos = 0;
-
-#if 1
-    for (inpos = 0; ; inpos += num_read)
-    {
-        rc = Quitting ();
-        if (rc)
-        {
-            LOGMSG (klogFatal, "Received quit");
-            break;
-        }
-        else
-        {
-            rc = KFileReadAll (fin, inpos, buff, sizeof (buff), &num_read);
-            if (rc)
-            {
-                PLOGERR (klogErr,
-                         (klogErr, rc,
-                          "Failed to read from file $(F) at $(P)",
-                          "F=%s,P=%lu", src, inpos));
-                break;
-            }
-            else if (num_read)
-            {
-                size_t num_writ;
-
-                rc = KFileWriteAll (fout, inpos, buff, num_read, &num_writ);
-                if (rc)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-                else if (num_writ != num_read)
-                {
-                    rc = RC (rcExe, rcFile, rcWriting, rcFile, rcInsufficient);
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write all to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-            }
-            else 
-                break;
-        }
-    }
-#else
-    do
-    {
-        rc = Quitting ();
-        if (rc)
-        {
-            LOGMSG (klogFatal, "Received quit");
-            break;
-        }
-        rc = KFileRead (fin, inpos, buff, sizeof (buff), &num_read);
-        if (rc)
-        {
-            PLOGERR (klogErr,
-                     (klogErr, rc,
-                      "Failed to read from file $(F) at $(P)",
-                      "F=%s,P=%lu", src, inpos));
-            break;
-        }
-        else if (num_read > 0)
-        {
-            size_t to_write;
-
-            inpos += (uint64_t)num_read;
-
-            STSMSG (2, ("Read %zu bytes to %lu", num_read, inpos));
-
-            to_write = num_read;
-            while (to_write > 0)
-            {
-                size_t num_writ;
-                rc = KFileWrite (fout, outpos, buff, num_read, &num_writ);
-                if (rc)
-                {
-                    PLOGERR (klogErr,
-                             (klogErr, rc,
-                              "Failed to write to file $(F) at $(P)",
-                              "F=%s,P=%lu", dst, outpos));
-                    break;
-                }
-                outpos += num_writ;
-                to_write -= num_writ;
-            }
-        }
-        if (rc)
-            break;
-    } while (num_read != 0);
-#endif
-    return rc;
-}
-
-
-static
-rc_t nenctool (const char * srcstr, const char * dststr, bool force)
-{
-    VFSManager * mgr;
-    rc_t rc;
-
-    rc = VFSManagerMake (&mgr);
-    if (rc)
-        LOGERR (klogInt, rc, "failed to create file system manager");
-    else
-    {
-        VPath * srcpath;
-
-        rc = VFSManagerMakePath (mgr, &srcpath, srcstr);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "Failed to parse source path '$(path)'",
-                      "path=%s", srcstr));
-        else
-        {
-            VPath * dstpath;
-
-            rc = VFSManagerMakePath (mgr, &dstpath, dststr);
-            if (rc)
-                PLOGERR (klogErr,
-                         (klogErr, rc, "Failed to parse destination path '$(path)'",
-                          "path=%s", dststr));
-            else
-            {
-                const KFile * srcfile;
-
-                rc = VFSManagerOpenFileRead (mgr, &srcfile, srcpath);
-                if (rc)
-                    PLOGERR (klogErr,
-                             (klogErr, rc, "Failed to open source path '$(path)'",
-                              "path=%s", srcstr));
-                else
-                {
-                    KFile * dstfile;
-
-                    rc = VFSManagerCreateFile (mgr, &dstfile, false, 0666,
-                                               kcmParents | (force ? kcmInit : kcmCreate),
-                                               dstpath);
-                    if (rc)
-                        PLOGERR (klogErr,
-                                 (klogErr, rc, "failed to open destination path '$(path)'",
-                                  "path=%s", dststr));
-                    else
-                    {
-                        rc = copy_file (srcstr, dststr, srcfile, dstfile);
-                        if (rc)
-                        {
-                            PLOGERR (klogErr,
-                                     (klogErr, rc, "failed to copy '$(S)' to '$(D)'",
-                                      "S=%s,D=%s", srcstr, dststr));
-
-                            VFSManagerRemove (mgr, true, dstpath);
-                        }
-
-                        KFileRelease (dstfile);
-                    }
-                    KFileRelease (srcfile);
-                }
-                VPathRelease (dstpath);
-            }
-            VPathRelease (srcpath);
-        }
-        VFSManagerRelease (mgr);
-    }
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args* args = NULL;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse command line parameters");
-    if (rc == 0)
-    {
-        uint32_t pcount;
-        bool force;
-
-        rc = ArgsOptionCount (args, OPTION_FORCE, &pcount);
-        if (rc)
-            LOGERR (klogInt, rc, "failed to examine force option");
-        else
-        {
-            force = (pcount > 0);
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                LOGERR (klogInt, rc, "failed to count parameters");
-            else
-            {
-                if (pcount != 2)
-                    MiniUsage (args);
-                else
-                {
-                    const char * src;
-
-                    rc = ArgsParamValue (args, 0, &src);
-                    if (rc)
-                        LOGERR (klogInt, rc, "failed to get source parameter");
-                    else
-                    {
-                        const char * dst;
-                        rc = ArgsParamValue (args, 1, &dst);
-                        if (rc)
-                            LOGERR (klogInt, rc, "failed to get destination parameter");
-                        else
-                        {
-                            rc = nenctool (src, dst, force);
-                        }
-                    }
-                }
-            }
-        }
-        ArgsWhack (args);
-    }
-    STSMSG (1, ("exiting: %R (%u)", rc, rc));
-    return rc;
-}
-
-/* EOF */
diff --git a/tools/nenctool/nenctool.vers b/tools/nenctool/nenctool.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/nenctool/nenctool.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/nencvalid/Makefile b/tools/nencvalid/Makefile
deleted file mode 100644
index 2628e5e..0000000
--- a/tools/nencvalid/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-# ==============================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/nencvalid
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	nencvalid
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_LIBS)) $(addsuffix _tag,$(ALL_TOOLS))
-
-#-------------------------------------------------------------------------------
-# nencvalid
-#  Copy files from one directory to another while cataloging the contents.
-#  XML files can be redirected as well.
-#
-NENCVALID_SRC = \
-	nencvalid
-
-NENCVALID_OBJ = \
-	$(addsuffix .$(OBJX),$(NENCVALID_SRC))
-
-NENCVALID_LIB = \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/nencvalid: $(NENCVALID_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(NENCVALID_LIB)
-
-nencvalid_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) nencvalid $(NENCVALID_OBJ)
-
-
-
diff --git a/tools/nencvalid/nencvalid.c b/tools/nencvalid/nencvalid.c
deleted file mode 100644
index c33dc41..0000000
--- a/tools/nencvalid/nencvalid.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "nencvalid.vers.h"
-
-#include <kapp/main.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-
-#include <krypto/encfile.h>
-#include <krypto/wgaencrypt.h>
-
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/out.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/rc.h>
-#include <klib/text.h>
-
-#include <assert.h>
-#include <stdlib.h>
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return NENCVALID_VERS;
-}
-
-#define OPTION_DECRYPT_BIN_COMPATIBILITY "compatibility-mode"
-/* "decrypt.bin" */
-
-static
-OptDef Options[] = 
-{
-    /* private option for decrypt.bin script */
-    { OPTION_DECRYPT_BIN_COMPATIBILITY, NULL,        NULL, NULL,        0, false, false }
-};
-
-enum CompatibilityModeExitCode
-{
-    CMEC_NO_ERROR = 0,
-    CMEC_BAD_TYPE = 100,
-    CMEC_BAD_HEADER = 101,
-    CMEC_TRUNCATED = 102,
-    CMEC_EXCESS = 103,
-    CMEC_NO_CHECKSUM = 104,
-    CMEC_NO_PASSWORD = 105,
-    CMEC_BAD_CHECKSUM = 106
-};
-
-/* Usage
- */
-const char UsageDefaultName [] = "nencvalid";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s [options] <file-path> [ <file-path> ...]\n"
-        "\n"
-        "Summary:\n"
-        "  Validate the consistency of NCBI format encrypted files\n"
-        "\n", progname);
-}
-
-static
-const char * param_usage[] = 
-{
-    "A file in an NCBI encrypted file format.", 
-    "The first version encrypted file format",
-    "needs a password to validate the content",
-    "while the second version does not.  If the",
-    "ncbi-file uri format is used if you ask",
-    "file decryption (encrypt in the query)",
-    "the validation will be on the decrypted",
-    "file which might not be the intention.",
-    "The password if needed for validation will",
-    "have to be in the standard NCBI VDB",
-    "configuration as 'krypto/pwfile' or ",
-    "referenced by the environment variable",
-    "VDB_PWFILE or Config parameter", NULL
-};
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("Parameters:\n");
-
-    HelpParamLine ("file-path", param_usage);
-
-    KOutMsg ("\nOptions:\n");
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-static rc_t wga_log_error (const char * path, rc_t rc, bool decrypt_bin_compatible)
-{
-    switch (GetRCObject(rc))
-    {
-    case rcSize:
-        switch (GetRCState(rc))
-        {
-        case rcExcessive:
-            if (decrypt_bin_compatible)
-                exit (CMEC_EXCESS);
-            PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                              "probably mis-concatenated file '$(P)'",
-                              "P=%s", path));
-            return rc;
-
-        case rcInsufficient:
-            if (decrypt_bin_compatible)
-                exit (CMEC_TRUNCATED);
-            PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                              "probably truncated file '$(P)'",
-                              "P=%s", path));
-            return rc;
-
-        default:
-            break;
-        }
-        break;
-
-    case rcChecksum:
-        switch (GetRCState(rc))
-        {
-        case rcInvalid:
-            if (decrypt_bin_compatible)
-                exit (CMEC_BAD_CHECKSUM);
-            PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                              "checksum of contents '$(P)'",
-                              "P=%s", path));
-            return rc;
-
-        case rcNull:
-            if (decrypt_bin_compatible)
-                exit (CMEC_NO_CHECKSUM);
-            PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                              "checksum of contents without password '$(P)'",
-                              "P=%s", path));
-            return 0;
-
-        default:
-            break;
-        }
-        break;
-
-    case rcConstraint:
-        switch (GetRCState(rc))
-        {
-        case rcCorrupt:
-            if (decrypt_bin_compatible)
-                exit (CMEC_BAD_CHECKSUM);
-            PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                              "checksum of contents '$(P)'",
-                              "P=%s", path));
-            return rc;
-
-        default:
-            break;
-        }
-        break;
-
-    case rcEncryption:
-        switch (GetRCState(rc))
-        {
-        case rcNull:
-            if (decrypt_bin_compatible)
-                exit (CMEC_NO_PASSWORD);
-            LOGERR (klogWarn, rc, "length validated but content not checked without a password");
-            return 0;
-
-        case rcNotFound:
-            if (decrypt_bin_compatible)
-                exit (CMEC_NO_CHECKSUM);
-            LOGERR (klogWarn, rc, "length validated but content not has no checksum");
-            return 0;
-
-        default:
-            break;
-        }
-        break;
-
-    default:
-        break;
-    }
-    PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                      "with non-specified error file "
-                      "'$(P)'", "P=%s", path));
-    return rc;
-}
-
-static rc_t nencvalidWGAEncValidate (const char * path, const KFile * file, VFSManager * mgr, bool decrypt_bin_compatible)
-{
-    rc_t rc;
-    size_t pwz;
-    char   pw [8192];
-
-    rc = VFSManagerGetKryptoPassword (mgr, pw, sizeof (pw) - 1, &pwz);
-
-    if (rc) 
-    {
-        if (GetRCObject(rc) == rcEncryptionKey && GetRCState(rc) == rcNotFound)
-        {   /* krypto/pwfile not found in the configuration; will proceed without decryption */
-            LOGERR (klogWarn, rc, "no password file configured file content will not be validated");
-
-            /* configuration did not contain a password file so set it to nul */
-            pw[0] = '\0';
-            pwz = 0;
-            rc = 0;
-        }
-        else
-            LOGERR (klogInt, rc, "unable to read password file");
-    }
-
-    if (rc == 0)
-    {
-        rc = WGAEncValidate (file, pw, pwz);
-        if (rc)
-            rc =  wga_log_error (path, rc, decrypt_bin_compatible);
-    }
-    return rc;
-}
-
-
-/*
- * do out thing on a single file name
- */
-static
-rc_t HandleOneFile (VFSManager * mgr, const char * path, bool decrypt_bin_compatible)
-{
-    rc_t rc;
-    VPath * vpath;
-
-    rc = VFSManagerMakePath (mgr, &vpath, path);
-    if (rc)
-        PLOGERR (klogErr,
-                 (klogErr, rc, "failed to parse path "
-                  "parameter '$(P)'", "P=%s", path));
-
-    else
-    {
-        const KFile * file;
-
-        rc = VFSManagerOpenFileRead (mgr, &file, vpath);
-        if (rc)
-            PLOGERR (klogErr,
-                     (klogErr, rc, "failed to parse path "
-                      "parameter '$(P)'", "P=%s", path));
-
-        else
-        {
-            size_t  buffread;
-            const KFile * buffile;
-
-            rc = KBufFileMakeRead (&buffile, file, 64*1024);
-            if (rc)
-                LOGERR (klogInt, rc, "unable to buffer file");
-            else
-            {
-                /* the two current encrypted file types have an 8 byte signature (magic(
-                 * at the beginning of the file.  If these 8 don't match we don't even call it
-                 * an encrypted file at all */
-                char buffer [8];
-
-                rc = KFileRead (buffile, 0, buffer, sizeof buffer, &buffread);
-                if (rc)
-                    LOGERR (klogInt, rc, "Unable to read file signature");
-                else
-                {
-                    if (buffread < sizeof buffer)
-                    {
-                        if (decrypt_bin_compatible)
-                            exit (CMEC_BAD_TYPE);
-                        else
-                        {
-                            rc = RC (rcExe, rcFile, rcValidating, rcHeader, rcWrongType);
-                            LOGERR (klogErr, rc, "File too short to be encrypted file");
-                        }
-                    }
-                    else
-                    {
-                        rc = KFileIsEnc (buffer, sizeof buffer);
-
-                        switch (GetRCState(rc))
-                        {
-                        case 0:
-                        case rcInsufficient:
-                            rc = KEncFileValidate (buffile);
-                            if (rc)
-                            {
-                                switch (GetRCObject(rc))
-                                {
-                                    /* unsuable header */
-                                case rcHeader:
-                                case rcByteOrder:
-                                    if (decrypt_bin_compatible)
-                                        exit (CMEC_BAD_HEADER);
-                                    PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                      "with a bad header file '$(P)'",
-                                                      "P=%s", path));
-                                    break;
-
-                                case rcFile:
-                                    switch (GetRCState(rc))
-                                    {
-                                        /* bad block count in the footer: guess it was a truncataiont
-                                         * an inconvienent point */
-                                    case rcCorrupt:
-                                        /* block read was neither a block nor a footer */
-                                    case rcInsufficient:
-                                        if (decrypt_bin_compatible)
-                                            exit (CMEC_TRUNCATED);
-                                        PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                          "probably truncated file '$(P)'",
-                                                          "P=%s", path));
-
-                                        break;
-                                    default:
-                                        PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                          "with non-specified error file "
-                                                          "'$(P)'", "P=%s", path));
-
-                                        break;
-                                    }
-                                    break;
-
-                                case rcCrc:
-                                    if (decrypt_bin_compatible)
-                                        exit (CMEC_BAD_CHECKSUM);
-                                    PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                      "with good length but bad checksum file "
-                                                      "'$(P)'", "P=%s", path));
-                                    break;
-
-                                default:
-                                    PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                      "with non-specified error file "
-                                                      "'$(P)'", "P=%s", path));
-                                    break;
-                                }
-                            }
-                            else
-                                STSMSG (1, ("validated file content and size for '%s'\n", path));
-                            break;
-
-                        case rcWrongType:
-                            rc = KFileIsWGAEnc (buffer, buffread);
-                            switch (GetRCState(rc))
-                            {
-                            case 0:
-                                rc = nencvalidWGAEncValidate (path, buffile, mgr, decrypt_bin_compatible);
-                                break;
-
-                            case rcWrongType:
-                                if (decrypt_bin_compatible)
-                                    exit (CMEC_BAD_TYPE);
-                                STSMSG (1, ("'%s' is not an encrypted file", path));
-                                break;
-
-                            default:
-                                break;
-                            }
-
-                        default:
-                            if (rc)
-                                PLOGERR (klogErr,(klogErr, rc, "failed to validate "
-                                                  "with non-specified error file "
-                                                  "'$(P)'", "P=%s", path));
-                            break;
-                        }
-                    }
-                }
-                KFileRelease (buffile);
-            }
-            KFileRelease (file);
-        }
-        VPathRelease (vpath);
-    }
-    if (rc)
-        STSMSG (1, ("failed validation '%s'", path));
-    else
-        STSMSG (1, ("passed validation '%s'", path));
-
-    return rc;
-}
-
-
-/*
- * params are file names so retrienve them one by one and process them
- */
-static __inline__
-rc_t HandleParams (VFSManager * mgr, Args * args, uint32_t pcount)
-{
-    rc_t rc;
-    rc_t orc;
-    uint32_t ix;
-
-    rc = orc = 0;
-    for (ix = 0; (ix < pcount); ++ix)
-    {
-        const char * pc;
-
-        rc = ArgsParamValue (args, ix, &pc);
-        if (rc)
-            PLOGERR (klogErr, 
-                     (klogErr, rc, "failed to retrieve "
-                      "parameter '$(P)'", "P=%u", ix));
-        else
-        {
-            /*
-             * we will return rc but use orc to handle
-             * the return error code form the first found error on a parameter
-             * though we will continue to process all file parameters
-             */
-            orc = HandleOneFile (mgr, pc, false);
-            if (rc == 0)
-                rc = orc;
-        }
-    }
-    return rc;
-}
-
-
-/*
- * handle the command line options then handle the file name parameters
- */
-static __inline__
-rc_t HandleOptions (Args * args)
-{
-    uint32_t pcount;
-    rc_t rc;
-
-    rc = ArgsParamCount (args, &pcount);
-    if (rc)
-        LOGERR (klogInt, rc, "failed to count parameters");
-
-    else
-    {
-        if (pcount == 0)
-            MiniUsage(args);
-
-        else
-        {
-            uint32_t ocount;
-
-            rc = ArgsOptionCount (args, OPTION_QUIET, &ocount);
-            if (rc)
-                LOGERR (klogInt, rc, "failed to retrieve quiet option");
-
-            else
-            {
-                bool quiet;
-
-                quiet = (ocount != 0);
-
-                rc = ArgsOptionCount (args, OPTION_DECRYPT_BIN_COMPATIBILITY, &ocount);
-                if (rc)
-                    LOGERR (klogInt, rc, "failed to retrieve compatibility option");
-
-                else
-                {
-                    VFSManager * mgr;
-
-                    rc = VFSManagerMake (&mgr);
-                    if (rc)
-                        LOGERR (klogErr, rc, "failed to open file system manager");
-
-                    else
-                    {
-                        bool decrypt_bin_compatible;
-
-                        if (ocount == 0)
-                            decrypt_bin_compatible = false;
-
-                        else
-                            decrypt_bin_compatible = true;
-
-
-                        if (quiet)
-                        {
-                            KStsLevelSet (0);
-                            KLogLevelSet (0);
-                        }
-                        else if (!decrypt_bin_compatible)
-                        {
-                            if (KStsLevelGet() == 0)
-                                KStsLevelSet(1);
-                        }
-
-
-                        if (decrypt_bin_compatible)
-                        {
-                            if (pcount > 1)
-                            {
-                                rc = RC (rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-                                LOGERR (0, rc, "compatibility mode can only handle one file parameter");
-                            }
-                            else
-                            {
-                                const char * pc;
-
-                                rc = ArgsParamValue (args, 0, &pc);
-                                if (rc)
-                                    LOGERR (0, rc, "unable to retrieve file parameter");
-
-                                if (rc == 0)
-                                    rc = HandleOneFile (mgr, pc, true); 
-                            }
-                        }
-                        else
-                        {
-                            rc = HandleParams (mgr, args, pcount);
-                        }
-                    
-                        VFSManagerRelease (mgr);
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
- 
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args* args = NULL;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 1, Options, sizeof Options / sizeof (Options[0]) );
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse command line parameters");
-    if (rc == 0)
-    {
-        rc = HandleOptions (args);
-
-        ArgsWhack (args);
-    }
-    STSMSG (2,("exiting: %R (%u)", rc, rc));
-    return rc;
-}
-
-/* EOF */
diff --git a/tools/nencvalid/nencvalid.vers b/tools/nencvalid/nencvalid.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/nencvalid/nencvalid.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/prefetch/Makefile b/tools/prefetch/Makefile
deleted file mode 100644
index f8e7d0c..0000000
--- a/tools/prefetch/Makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/prefetch
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	prefetch
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# prefetch
-#
-PREFETCH_SRC = \
-	prefetch
-
-PREFETCH_OBJ = \
-	$(addsuffix .$(OBJX),$(PREFETCH_SRC))
-
-PREFETCH_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-
-$(BINDIR)/prefetch: $(PREFETCH_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(PREFETCH_LIB)
diff --git a/tools/prefetch/prefetch.c b/tools/prefetch/prefetch.c
deleted file mode 100644
index 46d99f5..0000000
--- a/tools/prefetch/prefetch.c
+++ /dev/null
@@ -1,1965 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "prefetch.vers.h"
-
-#include <kapp/main.h> /* KAppVersion */
-
-#include <kfg/config.h> /* KConfig */
-#include <kfg/kart.h> /* Kart */
-#include <kfg/repository.h> /* KRepositoryMgr */
-
-#include <vdb/database.h> /* VDatabase */
-#include <vdb/dependencies.h> /* VDBDependencies */
-#include <vdb/manager.h> /* VDBManager */
-
-#include <vfs/manager.h> /* VFSManager */
-#include <vfs/path.h> /* VPath */
-#include <vfs/resolver.h> /* VResolver */
-
-#include <kns/ascp.h> /* ascp_locate */
-#include <kns/curl-file.h> /* KCurlFileMake */
-
-#include <kfs/file.h> /* KFile */
-#include <kfs/gzip.h> /* KFileMakeGzipForRead */
-#include <kfs/subfile.h> /* KFileMakeSubRead */
-
-#include <klib/container.h> /* BSTree */
-#include <klib/data-buffer.h> /* KDataBuffer */
-#include <klib/log.h> /* PLOGERR */
-#include <klib/out.h> /* KOutMsg */
-#include <klib/printf.h> /* string_printf */
-#include <klib/rc.h>
-#include <klib/status.h> /* STSMSG */
-#include <klib/text.h> /* String */
-
-#include <strtol.h> /* strtou64 */
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <stdlib.h> /* free */
-#include <string.h> /* memset */
-#include <time.h> /* time */
-
-#include <stdio.h> /* printf */
-
-#define DISP_RC(rc, err) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, err))
-
-#define DISP_RC2(rc, name, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt,rc, "$(msg): $(name)","msg=%s,name=%s",msg,name)))
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define STS_TOP 0
-#define STS_INFO 1
-#define STS_DBG 2
-#define STS_FIN 3
-
-#define rcResolver   rcTree
-static bool NotFoundByResolver(rc_t rc) {
-    if (GetRCModule(rc) == rcVFS) {
-        if (GetRCTarget(rc) == rcResolver) {
-            if (GetRCContext(rc) == rcResolving) {
-                if (GetRCState(rc) == rcNotFound) {
-                    return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-typedef struct {
-    const VPath *path;
-    const String *str;
-} VPathStr;
-static rc_t VPathStrFini(VPathStr *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    VPathRelease(self->path);
-
-    free((void*)self->str);
-
-    memset(self, 0, sizeof *self);
-
-    return rc;
-}
-
-typedef struct {
-    /* "plain" command line argument */
-    const char *desc;
-
-    const KartItem *item;
-
-#ifdef _DEBUGGING
-    const char *textkart;
-#endif
-} Item;
-static rc_t ItemInit(Item *self, const char *obj) {
-    assert(self);
-    self->desc = obj;
-    return 0;
-}
-
-static char* StringCheck(const String *self, rc_t rc) {
-    if (rc == 0 && self != NULL
-        && self->addr != NULL && self->len != 0 && self->addr[0] != '\0')
-    {
-        return string_dup(self->addr, self->size);
-    }
-    return NULL;
-}
-
-static char* ItemName(const Item *self) {
-    char *c = NULL;
-    assert(self);
-    if (self->desc != NULL) {
-        return string_dup_measure(self->desc, NULL);
-    }
-    else {
-        rc_t rc = 0;
-        const String *elem = NULL;
-        assert(self->item);
-
-        rc = KartItemItemDesc(self->item, &elem);
-        c = StringCheck(elem, rc);
-        if (c != NULL) {
-            return c;
-        }
-
-        rc = KartItemAccession(self->item, &elem);
-        c = StringCheck(elem, rc);
-        if (c != NULL) {
-            return c;
-        }
-
-        rc = KartItemItemId(self->item, &elem);
-        return StringCheck(elem, rc);
-    }
-}
-
-static rc_t V_ResolverRemote ( const VResolver * self,
-    VRemoteProtocols protocols, struct VPath const * accession,
-    struct VPath const ** remote, struct KFile const ** opt_file_rtn,
-    struct VPath const ** cache)
-{
-    return VResolverQuery(self, protocols, accession, NULL, remote, cache);
-}
-
-static rc_t _VResolverRemote(VResolver *self, VRemoteProtocols protocols,
-    const char *name, const VPath *vaccession,
-    const VPath **vremote, const String **remote,
-    const String **cache)
-{
-    rc_t rc = 0;
-    const VPath *vcache = NULL;
-    assert(vaccession && vremote && !*vremote);
-    rc = V_ResolverRemote(self, protocols, vaccession, vremote, NULL, &vcache);
-    if (rc == 0) {
-        char path[PATH_MAX] = "";
-        size_t len = 0;
-        rc = VPathReadUri(*vremote, path, sizeof path, &len);
-        DISP_RC2(rc, "VPathReadUri(VResolverRemote)", name);
-        if (rc == 0) {
-            String local_str;
-            char *query = string_chr(path, len, '?');
-            if (query != NULL) {
-                *query = '\0';
-            }
-            StringInit(&local_str, path, len, len);
-            rc = StringCopy(remote, &local_str);
-            DISP_RC2(rc, "StringCopy(VResolverRemote)", name);
-        }
-    }
-    else if (NotFoundByResolver(rc)) {
-        PLOGERR(klogErr, (klogErr, rc, "$(acc) cannot be found.",
-            "acc=%s", name));
-    }
-    else {
-        DISP_RC2(rc, "Cannot resolve remote", name);
-    }
-    if (rc == 0 && cache != NULL) {
-        String path_str;
-        if (vcache == NULL) {
-            rc = RC(rcExe, rcResolver, rcResolving, rcPath, rcNotFound);
-            PLOGERR(klogInt, (klogInt, rc, "cannot get cache location "
-                "for $(acc). Try to cd out of protected repository.",
-                "acc=%s" , name));
-        }
-        if (rc == 0) {
-            rc = VPathGetPath(vcache, &path_str);
-            DISP_RC2(rc, "VPathGetPath(VResolverCache)", name);
-        }
-        if (rc == 0) {
-            rc = StringCopy(cache, &path_str);
-            DISP_RC2(rc, "StringCopy(VResolverCache)", name);
-        }
-    }
-    RELEASE(VPath, vcache);
-    return rc;
-}
-
-static rc_t V_ResolverLocal ( const VResolver * self,
-    struct VPath const * accession, struct VPath const ** path )
-{
-    return VResolverQuery(self, eProtocolHttp, accession, path, NULL, NULL);
-}
-
-static rc_t _VResolverResolve(VResolver *self, VRemoteProtocols protocols,
-    const Item *item, VPathStr *local, const String **remote,
-    const String **cache, const KFile **file, VPath **vaccession,
-    uint64_t *project, const KRepositoryMgr *repoMgr, const KConfig *cfg,
-    const char *name)
-{
-    VResolver *resolver = NULL;
-    const char *accession = NULL;
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-    VFSManager *vfs = NULL;
-
-    const VPath **vlocal = NULL;
-    const VPath *vremote = NULL;
-
-    if (item == NULL) {
-        return RC(rcExe, rcResolver, rcResolving, rcParam, rcNull);
-    }
-    if (self == NULL) {
-        return RC(rcExe, rcResolver, rcResolving, rcSelf, rcNull);
-    }
-    if (local != NULL) {
-        memset(local, 0, sizeof *local);
-        vlocal = &local->path;
-    }
-
-    assert(vaccession && !*vaccession && project && !*project);
-
-    if (rc == 0) {
-        rc = VFSManagerMake(&vfs);
-    }
-
-    accession = item->desc;
-    if (accession == NULL) {
-        uint64_t oid = 0;
-        rc = KartItemProjIdNumber(item->item, project);
-        if (rc != 0) {
-            DISP_RC(rc, "KartItemProjIdNumber");
-            return rc;
-        }
-        rc = KartItemItemIdNumber(item->item, &oid);
-        if (rc != 0) {
-            DISP_RC(rc, "KartItemItemIdNumber");
-            return rc;
-        }
-        {
-            const KRepository *p_protected = NULL;
-            rc = KRepositoryMgrGetProtectedRepository(repoMgr, 
-                *project, &p_protected);
-            if (rc == 0) {
-                rc = KRepositoryMakeResolver(p_protected, &resolver, cfg);
-                if (rc == 0) {
-                    self = resolver;
-                }
-            }
-            RELEASE(KRepository, p_protected);
-        }
-        rc = VFSManagerMakeOidPath(vfs, vaccession, oid);
-    }
-    else {
-        rc = VFSManagerMakePath(vfs, vaccession, accession);
-        DISP_RC2(rc, "VFSManagerMakePath", accession);
-    }
-
-    RELEASE(VFSManager, vfs);
-
-    if (rc == 0 && local != NULL) {
-        rc = V_ResolverLocal(self, *vaccession, vlocal);
-        if (rc == 0) {
-            rc = VPathMakeString(*vlocal, &local->str);
-            DISP_RC2(rc, "VPathMakeString(VResolverLocal)", name);
-        }
-        else if (NotFoundByResolver(rc)) {
-            rc = 0;
-        }
-        else {
-            DISP_RC2(rc, "VResolverLocal", name);
-        }
-    }
-
-    if (remote != NULL) {
-        rc2 = _VResolverRemote(self, protocols, name,
-            *vaccession, &vremote, remote, cache);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-    }
-
-    RELEASE(VPath, vremote);
-    RELEASE(VResolver, resolver);
-    return rc;
-}
-
-typedef enum {
-    eForceNo, /* do not download found and complete objects */
-    eForceYes,/* force download of found and complete objects */
-    eForceYES /* force download; ignore lockes */
-} Force;
-typedef struct {
-    BSTNode n;
-    char *path;
-} TreeNode;
-typedef struct {
-    Args *args;
-    bool check_all;
-    bool list_kart;
-    Force force;
-    KConfig *cfg;
-    const VDBManager *mgr;
-    KDirectory *dir;
-    const KRepositoryMgr *repoMgr;
-    VResolver *resolver;
-
-    void *buffer;
-    size_t bsize;
-
-    BSTree downloaded;
-
-    uint64_t heartbeat;
-
-    bool noAscp;
-    bool noHttp;
-
-    bool forceAscpFail;
-
-    bool ascpChecked;
-    const char *ascp;
-    const char *asperaKey;
-    String *ascpMaxRate;
-
-#ifdef _DEBUGGING
-    const char *textkart;
-#endif
-} Main;
-static rc_t StringRelease(const String *self) {
-    free((String*)self);
-    return 0;
-}
-
-typedef struct {
-    VPathStr local;
-    const String *cache;
-    const String *remote;
-
-    const KFile *file;
-    uint64_t remoteSz;
-
-    bool existing;
-
-    /* path to the resolved object : either local or cache:
-    should not be released */
-    const char *path;
-
-    char *name;
-    VPath *accession;
-    uint64_t project;
-} Resolved;
-static rc_t ResolvedFini(Resolved *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    rc = VPathStrFini(&self->local);
-
-    RELEASE(KFile, self->file);
-    RELEASE(VPath, self->accession);
-
-    RELEASE(String, self->remote);
-    RELEASE(String, self->cache);
-
-    free(self->name);
-
-    memset(self, 0, sizeof *self);
-
-    return rc;
-}
-
-static rc_t ResolvedInit(Resolved *self,
-    const Item *item, VResolver *resolver, KDirectory *dir, bool ascp,
-    const KRepositoryMgr *repoMgr, const KConfig *cfg)
-{
-    rc_t rc = 0;
-    KPathType type = kptNotFound;
-    VRemoteProtocols protocols = ascp ? eProtocolFaspHttp : eProtocolHttp;
-
-    assert(self && item);
-
-    memset(self, 0, sizeof *self);
-
-    self->name = ItemName(item);
-
-    type = KDirectoryPathType(dir, item->desc) & ~kptAlias;
-    if (type == kptFile || type == kptDir) {
-        self->path = item->desc;
-        self->existing = true;
-        return 0;
-    }
-
-    rc = _VResolverResolve(resolver, protocols, item, &self->local,
-        &self->remote, &self->cache, &self->file, &self->accession,
-        &self->project, repoMgr, cfg, self->name);
-
-    if (rc == 0 && self->file != NULL) {
-        rc_t rc2 = KFileSize(self->file, &self->remoteSz);
-        DISP_RC2(rc2, "KFileSize(remote)", self->name);
-    }
-
-
-    STSMSG(STS_DBG, ("Resolve(%s) = %R:", self->name, rc));
-    STSMSG(STS_DBG, ("local(%s)",
-        self->local.str ? self->local.str->addr : "NULL"));
-    STSMSG(STS_DBG, ("cache(%s)", self->cache ? self->cache->addr : "NULL"));
-    STSMSG(STS_DBG, ("remote(%s:%,ld)",
-        self->remote ? self->remote->addr : "NULL", self->remoteSz));
-
-    if (rc == 0) {
-        if (self->local.str == NULL
-            && (self->cache == NULL || self->remote == NULL))
-        {
-            rc = RC(rcExe, rcPath, rcValidating, rcParam, rcNull);
-            PLOGERR(klogInt, (klogInt, rc,
-                "bad VResolverResolve($(acc)) result", "acc=%s", self->name));
-        }
-    }
-
-    return rc;
-}
-
-static bool _StringIsFasp(const String *self, const char **withoutScheme) {
-    const char fasp[] = "fasp://";
-    const char *dummy = NULL;
-
-    assert(self && self->addr);
-
-    if (withoutScheme == NULL) {
-        withoutScheme = &dummy;
-    }
-
-    *withoutScheme = NULL;
-
-    if (memcmp(self->addr, fasp, sizeof fasp - 1) == 0) {
-        *withoutScheme = self->addr + sizeof fasp - 1;
-        return true;
-    }
-    return false;
-}
-
-/** isLocal is set to true when the object is found locally.
-    i.e. does not need need not be [re]downloaded */
-static rc_t ResolvedLocal(const Resolved *self,
-    const KDirectory *dir, bool *isLocal, Force force)
-{
-    rc_t rc = 0;
-    uint64_t sRemote = 0;
-    uint64_t sLocal = 0;
-    const KFile *local = NULL;
-    char path[PATH_MAX] = "";
-
-    assert(isLocal && self);
-
-    *isLocal = false;
-
-    if (self->local.str == NULL) {
-        return 0;
-    }
-
-    rc = VPathReadPath(self->local.path, path, sizeof path, NULL);
-    DISP_RC(rc, "VPathReadPath");
-
-    if (rc == 0 && KDirectoryPathType(dir, path) != kptFile) {
-        if (force == eForceNo) {
-            STSMSG(STS_TOP,
-                ("%s (not a file) is found locally: consider it complete",
-                 path));
-            *isLocal = true;
-        }
-        else {
-            STSMSG(STS_TOP,
-                ("%s (not a file) is found locally and will be redownloaded",
-                 path));
-        }
-        return 0;
-    }
-
-    if (rc == 0 && ! _StringIsFasp(self->remote, NULL) && self->file != NULL) {
-        rc = KFileSize(self->file, &sRemote);
-        DISP_RC2(rc, "KFileSize(remote)", self->name);
-    }
-
-    if (rc == 0) {
-        rc = KDirectoryOpenFileRead(dir, &local, path);
-        DISP_RC2(rc, "KDirectoryOpenFileRead", path);
-    }
-
-    if (rc == 0) {
-        rc = KFileSize(local, &sLocal);
-        DISP_RC2(rc, "KFileSize", path);
-    }
-
-    if (rc == 0) {
-        if (sRemote == 0) {
-            if (sLocal != 0) {
-                if (force == eForceNo) {
-                    *isLocal = true;
-                    STSMSG(STS_INFO, ("%s (%,lu) is found", path, sLocal));
-                }
-                else {
-                    STSMSG(STS_INFO,
-                        ("%s (%,lu) is found and will be redownloaded",
-                        path, sLocal));
-                }
-            }
-            else if (sLocal == 0) {
-                STSMSG(STS_INFO,
-                    ("an empty %s (%,lu) is found and will be redownloaded",
-                    path, sLocal));
-            }
-        }
-        else if (sRemote == sLocal) {
-            if (force == eForceNo) {
-                *isLocal = true;
-                STSMSG(STS_INFO, ("%s (%,lu) is found and is complete",
-                    path, sLocal));
-            }
-            else {
-                STSMSG(STS_INFO, ("%s (%,lu) is found and will be redownloaded",
-                    path, sLocal));
-            }
-        }
-        else {
-            STSMSG(STS_TOP, ("%s (%,lu) is incomplete. Expected size is %,lu. "
-                "It will be re-downloaded", path, sLocal, sRemote));
-        }
-    }
-
-    RELEASE(KFile, local);
-
-    return rc;
-}
-
-static rc_t _KDirectoryMkTmpPrefix(const KDirectory *self,
-    const String *prefix, char *out, size_t sz)
-{
-    size_t num_writ = 0;
-    rc_t rc = string_printf(out, sz, &num_writ,
-        "%.*s.tmp", prefix->size, prefix->addr);
-    if (rc != 0) {
-        DISP_RC2(rc, "string_printf(tmp)", prefix->addr);
-        return rc;
-    }
-
-    if (num_writ > sz) {
-        rc = RC(rcExe, rcFile, rcCopying, rcBuffer, rcInsufficient);
-        PLOGERR(klogInt, (klogInt, rc,
-            "bad string_printf($(s).tmp) result", "s=%s", prefix->addr));
-        return rc;
-    }
-
-    return rc;
-}
-
-static rc_t _KDirectoryMkTmpName(const KDirectory *self,
-    const String *prefix, char *out, size_t sz)
-{
-    rc_t rc = 0;
-    int i = 0;
-
-    assert(prefix);
-
-    while (rc == 0) {
-        size_t num_writ = 0;
-        rc = string_printf(out, sz, &num_writ,
-            "%.*s.tmp.%d.tmp", prefix->size, prefix->addr, rand() % 100000);
-        if (rc != 0) {
-            DISP_RC2(rc, "string_printf(tmp.rand)", prefix->addr);
-            break;
-        }
-
-        if (num_writ > sz) {
-            rc = RC(rcExe, rcFile, rcCopying, rcBuffer, rcInsufficient);
-            PLOGERR(klogInt, (klogInt, rc,
-                "bad string_printf($(s).tmp.rand) result",
-                "s=%s", prefix->addr));
-            return rc;
-        }
-        if (KDirectoryPathType(self, out) == kptNotFound) {
-            break;
-        }
-        if (++i > 999) {
-            rc = RC(rcExe, rcFile, rcCopying, rcName, rcUndefined);
-            PLOGERR(klogInt, (klogInt, rc,
-                "cannot generate unique tmp file name for $(name)", "name=%s",
-                prefix->addr));
-            return rc;
-        }
-    }
-
-    return rc;
-}
-
-static rc_t _KDirectoryMkLockName(const KDirectory *self,
-    const String *prefix, char *out, size_t sz)
-{
-    rc_t rc = 0;
-    size_t num_writ = 0;
-
-    assert(prefix);
-
-    rc = string_printf(out, sz, &num_writ,
-        "%.*s.lock", prefix->size, prefix->addr);
-    DISP_RC2(rc, "string_printf(lock)", prefix->addr);
-
-    if (rc == 0 && num_writ > sz) {
-        rc = RC(rcExe, rcFile, rcCopying, rcBuffer, rcInsufficient);
-        PLOGERR(klogInt, (klogInt, rc,
-            "bad string_printf($(s).lock) result", "s=%s", prefix->addr));
-        return rc;
-    }
-
-    return rc;
-}
-
-static
-rc_t _KDirectoryCleanCache(KDirectory *self, const String *local)
-{
-    rc_t rc = 0;
-
-    char cache[PATH_MAX] = "";
-    size_t num_writ = 0;
-
-    assert(self && local && local->addr);
-
-    if (rc == 0) {
-        rc = string_printf(cache, sizeof cache, &num_writ, "%s.cache",
-            local->addr);
-        DISP_RC2(rc, "string_printf(.cache)", local->addr);
-    }
-
-    if (rc == 0 && KDirectoryPathType(self, cache) != kptNotFound) {
-        STSMSG(STS_DBG, ("removing %s", cache));
-        rc = KDirectoryRemove(self, false, cache);
-    }
-
-    return rc;
-}
-
-static rc_t _KDirectoryClean(KDirectory *self, const String *cache,
-    const char *lock, const char *tmp, bool rmSelf)
-{
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-
-    char tmpName[PATH_MAX] = "";
-    const char *dir = tmpName;
-    const char *tmpPfx = NULL;
-    size_t tmpPfxLen = 0;
-
-    assert(self && cache);
-
-    rc = _KDirectoryMkTmpPrefix(self, cache, tmpName, sizeof tmpName);
-    if (rc == 0) {
-        char *slash = strrchr(tmpName, '/');
-        if (slash != NULL) {
-            if (strlen(tmpName) == slash + 1 - tmpName) {
-                rc = RC(rcExe,
-                    rcDirectory, rcSearching, rcDirectory, rcIncorrect);
-                PLOGERR(klogInt, (klogInt, rc,
-                    "bad file name $(path)", "path=%s", tmpName));
-            }
-            else {
-                *slash = '\0';
-                tmpPfx = slash + 1;
-            }
-        }
-        else {
-            rc = RC(rcExe, rcDirectory, rcSearching, rcChar, rcNotFound);
-            PLOGERR(klogInt, (klogInt, rc,
-                    "cannot extract directory from $(path)", "path=%s", dir));
-        }
-        tmpPfxLen = strlen(tmpPfx);
-    }
-
-    if (tmp != NULL && KDirectoryPathType(self, tmp) != kptNotFound) {
-        rc_t rc3 = 0;
-        STSMSG(STS_DBG, ("removing %s", tmp));
-        rc3 = KDirectoryRemove(self, false, tmp);
-        if (rc2 == 0 && rc3 != 0) {
-            rc2 = rc3;
-        }
-    }
-
-    if (rmSelf && KDirectoryPathType(self, cache->addr) != kptNotFound) {
-        rc_t rc3 = 0;
-        STSMSG(STS_DBG, ("removing %s", cache->addr));
-        rc3 = KDirectoryRemove(self, false, cache->addr);
-        if (rc2 == 0 && rc3 != 0) {
-            rc2 = rc3;
-        }
-    }
-
-    if (rc == 0) {
-        uint32_t count = 0;
-        uint32_t i = 0;
-        KNamelist *list = NULL;
-        STSMSG(STS_DBG, ("listing %s for old temporary files", dir));
-        rc = KDirectoryList(self, &list, NULL, NULL, dir);
-        DISP_RC2(rc, "KDirectoryList", dir);
-
-        if (rc == 0) {
-            rc = KNamelistCount(list, &count);
-            DISP_RC2(rc, "KNamelistCount(KDirectoryList)", dir);
-        }
-
-        for (i = 0; i < count && rc == 0; ++i) {
-            const char *name = NULL;
-            rc = KNamelistGet(list, i, &name);
-            if (rc != 0) {
-                DISP_RC2(rc, "KNamelistGet(KDirectoryList)", dir);
-            }
-            else {
-                if (strncmp(name, tmpPfx, tmpPfxLen) == 0) {
-                    rc_t rc3 = 0;
-                    STSMSG(STS_DBG, ("removing %s", name));
-                    rc3 = KDirectoryRemove(self, false,
-                        "%s%c%s", dir, '/', name);
-                    if (rc2 == 0 && rc3 != 0) {
-                        rc2 = rc3;
-                    }
-                }
-            }
-        }
-
-        RELEASE(KNamelist, list);
-    }
-
-    if (lock != NULL && KDirectoryPathType(self, lock) != kptNotFound) {
-        rc_t rc3 = 0;
-        STSMSG(STS_DBG, ("removing %s", lock));
-        rc3 = KDirectoryRemove(self, false, lock);
-        if (rc2 == 0 && rc3 != 0) {
-            rc2 = rc3;
-        }
-    }
-
-    if (rc == 0 && rc2 != 0) {
-        rc = rc2;
-    }
-
-    return rc;
-}
-
-static int CC bstCmp(const void *item, const BSTNode *n) {
-    const char* path = item;
-    const TreeNode* sn = (const TreeNode*) n;
-
-    assert(path && sn && sn->path);
-
-    return strcmp(path, sn->path);
-}
-
-static int CC bstSort(const BSTNode* item, const BSTNode* n) {
-    const TreeNode* sn = (const TreeNode*) item;
-
-    return bstCmp(sn->path, n);
-}
-
-static void CC bstWhack(BSTNode* n, void* ignore) {
-    TreeNode* sn = (TreeNode*) n;
-
-    assert(sn);
-
-/* #if ! WINDOWS #endif */
-    free(sn->path);
-
-    memset(sn, 0, sizeof *sn);
-
-    free(sn);
-}
-/*
-static bool _KConfigAscpDisabled(const KConfig *self) {
-    bool disabled = false;
-    const char path[] = "tools/ascp/disabled";
-    rc_t rc = KConfigReadBool(self, path, &disabled);
-    if (rc != 0) {
-        if (rc != SILENT_RC(rcKFG, rcNode, rcOpening, rcPath, rcNotFound)) {
-            DISP_RC(rc, path);
-        }
-        else {
-            STSMSG(STS_DBG, ("'%s': not found in configuration", path));
-        }
-        disabled = false;
-    }
-    else {
-        STSMSG(STS_DBG, ("'%s' = '%s'", path, disabled ? "true" : "false"));
-    }
-    return disabled;
-}
-
-static String* _KConfigAscpString(const KConfig *self,
-    const char *path, const char *name)
-{
-    String *ascp = NULL;
-    rc_t rc = KConfigReadString(self, path, &ascp);
-    if (rc == 0) {
-        assert(ascp);
-        STSMSG(STS_INFO, ("Using %s from configuration: '%s'",
-            name, ascp->addr));
-        return ascp;
-    }
-    else {
-        if (rc != SILENT_RC(rcKFG, rcNode, rcOpening, rcPath, rcNotFound)) {
-            DISP_RC(rc, path);
-        }
-        else {
-            STSMSG(STS_DBG, ("'%s': not found in configuration", path));
-        }
-        free(ascp);
-        return NULL;
-    }
-}
-
-static String* _StringMake(const char *s) {
-    size_t len = string_size(s);
-    size_t tmp = 0;
-    String *str = malloc(sizeof *str + len + 1);
-    if (str == NULL) {
-        return NULL;
-    }
-    StringInit(str,
-        (char*)str + sizeof *str, len, len + 1);
-    tmp = string_copy((char*)str + sizeof *str, len + 1, s, len + 1);
-    assert(tmp == len + 1);
-    return str;
-}
-
-static String* _SystemHelp(String* prev, const char *command) {
-    int value = 0;
-    if (prev != NULL) {
-        return prev;
-    }
-    STSMSG(STS_DBG, ("Checking '%s'", command));
-    value = _SilentSystem("%s -h", command);
-    if (value == 0) {
-        STSMSG(STS_INFO, ("Using '%s'", command));
-        return _StringMake(command);
-    }
-    else {
-        STSMSG(STS_DBG, ("'%s': not found", command));
-        return NULL;
-    }
-}
-
-static String* _KDirectoryFileFound(const KDirectory *self,
-    String* prev, const char *path)
-{
-    KPathType type = kptNotFound;
-    if (prev != NULL) {
-        return prev;
-    }
-    STSMSG(STS_DBG, ("Checking '%s'", path));
-    type = KDirectoryPathType(self, path);
-    if ((type & ~kptAlias) == kptFile) {
-        STSMSG(STS_DBG, ("'%s': found", path));
-        return _StringMake(path);
-    }
-    else {
-        STSMSG(STS_DBG, ("'%s': not found", path));
-        return NULL;
-    }
-}
-*/
-static bool MainUseAscp(Main *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    if (self->ascpChecked) {
-        return self->ascp != NULL;
-    }
-
-    self->ascpChecked = true;
-
-    if (self->noAscp) {
-        return false;
-    }
-
-    rc = ascp_locate(&self->ascp, &self->asperaKey, true, true);
-    return rc == 0 && self->ascp && self->asperaKey;
-}
-
-static bool MainHasDownloaded(const Main *self, const char *local) {
-    TreeNode *sn = NULL;
-
-    assert(self);
-
-    sn = (TreeNode*) BSTreeFind(&self->downloaded, local, bstCmp);
-
-    return sn != NULL;
-}
-
-static rc_t MainDownloaded(Main *self, const char *path) {
-    TreeNode *sn = NULL;
-
-    assert(self);
-
-    if (MainHasDownloaded(self, path)) {
-        return 0;
-    }
-
-    sn = calloc(1, sizeof *sn);
-    if (sn == NULL) {
-        return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    sn->path = string_dup_measure(path, NULL);
-    if (sn->path == NULL) {
-        bstWhack((BSTNode*) sn, NULL);
-        sn = NULL;
-        return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    BSTreeInsert(&self->downloaded, (BSTNode*)sn, bstSort);
-
-    return 0;
-}
-
-typedef struct {
-    const char *obj;
-    bool done;
-    Kart *kart;
-    bool isKart;
-} Iterator;
-static
-rc_t IteratorInit(Iterator *self, const char *obj, const Main *main)
-{
-    rc_t rc = 0;
-
-    KPathType type = kptNotFound;
-
-    assert(self && main);
-    memset(self, 0, sizeof *self);
-
-#ifdef _DEBUGGING
-    if (obj == NULL && main->textkart) {
-        type = KDirectoryPathType(main->dir, main->textkart);
-        if ((type & ~kptAlias) != kptFile) {
-            rc = RC(rcExe, rcFile, rcOpening, rcFile, rcNotFound);
-            DISP_RC(rc, main->textkart);
-            return rc;
-        }
-        rc = KartMakeText(main->dir, main->textkart, &self->kart,
-            &self->isKart);
-        if (!self->isKart) {
-            rc = 0;
-        }
-        return rc;
-    }
-#endif
-
-    assert(obj);
-    type = KDirectoryPathType(main->dir, obj);
-    if ((type & ~kptAlias) == kptFile) {
-        type = VDBManagerPathType(main->mgr, obj);
-        if ((type & ~kptAlias) == kptFile) {
-            rc = KartMake(main->dir, obj, &self->kart, &self->isKart);
-            if (!self->isKart) {
-                rc = 0;
-            }
-        }
-    }
-
-    if (rc == 0 && !self->isKart) {
-        self->obj = obj;
-    }
-
-    return rc;
-}
-
-static rc_t IteratorNext(Iterator *self, Item *next, bool *done) {
-    rc_t rc = 0;
-
-    assert(self && next && done);
-
-    memset(next, 0, sizeof *next);
-
-    if (self->done) {
-        *done = true;
-        return 0;
-    }
-
-    *done = false;
-
-    if (self->isKart) {
-        RELEASE(KartItem, next->item);
-        rc = KartMakeNextItem(self->kart, &next->item);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Invalid kart file row");
-        }
-        else if (next->item == NULL) {
-            *done = true;
-        }
-
-        if (rc == 0 && *done) {
-            self->done = true;
-        }
-    }
-    else {
-        rc = ItemInit(next, self->obj);
-
-        self->done = true;
-    }
-
-    return rc;
-}
-
-static void IteratorFini(Iterator *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    RELEASE(Kart, self->kart);
-}
-
-static rc_t ResolvedDownloadFile(Resolved *self,
-    Main *main, const char *to)
-{
-    rc_t rc = 0;
-    KFile *out = NULL;
-    uint64_t pos = 0;
-    size_t num_read = 0;
-    uint64_t opos = 0;
-    size_t num_writ = 0;
-
-    assert(self && main);
-
-    if (rc == 0) {
-        STSMSG(STS_DBG, ("creating %s", to));
-        rc = KDirectoryCreateFile(main->dir, &out,
-            false, 0664, kcmInit | kcmParents, to);
-        DISP_RC2(rc, "Cannot OpenFileWrite", to);
-    }
-
-    assert(self->remote);
-
-    if (self->file == NULL) {
-#define USE_CURL 1
-#if USE_CURL
-        rc = KCurlFileMake(&self->file, self->remote->addr, false);
-#else
-        rc =
-            KNSManagerMakeHttpFile(kns, &self->file, NULL, 0x01010000, "%S", s);
-#endif
-        if (rc != 0) {
-            PLOGERR(klogInt, (klogInt, rc, "failed to open file for $(path)",
-                "path=%s", self->remote->addr));
-        }
-    }
-
-    STSMSG(STS_INFO, ("%s -> %s", self->remote->addr, to));
-    do {
-        rc = Quitting();
-
-        if (rc == 0) {
-            STSMSG(STS_FIN,
-                ("> Reading %lu bytes from pos. %lu", main->bsize, pos));
-            rc = KFileRead(self->file,
-                pos, main->buffer, main->bsize, &num_read);
-            if (rc != 0) {
-                DISP_RC2(rc, "Cannot KFileRead", self->remote->addr);
-            }
-            else {
-                STSMSG(STS_FIN,
-                    ("< Read %lu bytes from pos. %lu", num_read, pos));
-                pos += num_read;
-            }
-        }
-
-        if (rc == 0 && num_read > 0) {
-            rc = KFileWrite(out, opos, main->buffer, num_read, &num_writ);
-            DISP_RC2(rc, "Cannot KFileWrite", to);
-            opos += num_writ;
-        }
-    } while (rc == 0 && num_read > 0);
-
-    RELEASE(KFile, out);
-
-    if (rc == 0) {
-        STSMSG(STS_INFO, ("%s (%ld)", to, pos));
-    }
-
-    return rc;
-}
-
-/*  http://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByR.../SRR125365.sra
-anonftp at ftp-private.ncbi.nlm.nih.gov:/sra/sra-instant/reads/ByR.../SRR125365.sra
-*/
-static rc_t ResolvedDownloadAscp(const Resolved *self, Main *main,
-    const char *to)
-{
-    const char *src = NULL;
-    AscpOptions opt;
-    assert(self && self->remote && self->remote->addr
-        && main && main->ascp && main->asperaKey);
-    memset(&opt, 0, sizeof opt);
-    if (!_StringIsFasp(self->remote, &src)) {
-        return RC(rcExe, rcFile, rcCopying, rcSchema, rcInvalid);
-    }
-    opt.target_rate
-        = main->ascpMaxRate == NULL ? NULL : main->ascpMaxRate->addr;
-    opt.name = self->name;
-    opt.src_size = self->remoteSz;
-    opt.heartbeat = main->heartbeat;
-    opt.quitting = Quitting;
-    return aspera_get(main->ascp, main->asperaKey, src, to, &opt);
-}
-
-static rc_t ResolvedDownload(Resolved *self, Main *main) {
-    bool canceled = false;
-    rc_t rc = 0;
-    KFile *flock = NULL;
-
-    char tmp[PATH_MAX] = "";
-    char lock[PATH_MAX] = "";
-
-    assert(self
-        && self->cache && self->cache->size && self->cache->addr && main);
-
-    if (main->force != eForceYES &&
-        MainHasDownloaded(main, self->cache->addr))
-    {
-        STSMSG(STS_INFO, ("%s has just been downloaded", self->cache->addr));
-        return 0;
-    }
-
-    if (rc == 0) {
-        rc = _KDirectoryMkLockName(main->dir, self->cache, lock, sizeof lock);
-    }
-
-    if (rc == 0) {
-        rc = _KDirectoryMkTmpName(main->dir, self->cache, tmp, sizeof tmp);
-    }
-
-    if (KDirectoryPathType(main->dir, lock) != kptNotFound) {
-        if (main->force != eForceYES) {
-            KTime_t date = 0;
-            rc = KDirectoryDate(main->dir, &date, lock);
-            if (rc == 0) {
-                time_t t = time(NULL) - date;
-                if (t < 60 * 60 * 24) { /* 24 hours */
-                    STSMSG(STS_DBG, ("%s found: canceling download", lock));
-                    rc = RC(rcExe, rcFile, rcCopying, rcLock, rcExists);
-                    PLOGERR(klogWarn, (klogWarn, rc,
-                        "Lock file $(file) exists: download canceled",
-                        "file=%s", lock));
-                    return rc;
-                }
-                else {
-                    STSMSG(STS_DBG, ("%s found and ignored as too old", lock));
-                    rc = _KDirectoryClean(main->dir,
-                        self->cache, NULL, NULL, true);
-                }
-            }
-            else {
-                STSMSG(STS_DBG, ("%s found", lock));
-                DISP_RC2(rc, "KDirectoryDate", lock);
-            }
-        }
-        else {
-            STSMSG(STS_DBG, ("%s found and forced to be ignored", lock));
-            rc = _KDirectoryClean(main->dir, self->cache, NULL, NULL, true);
-        }
-    }
-    else {
-        STSMSG(STS_DBG, ("%s not found", lock));
-    }
-
-    if (rc == 0) {
-        STSMSG(STS_DBG, ("creating %s", lock));
-        rc = KDirectoryCreateFile(main->dir, &flock,
-            false, 0664, kcmInit | kcmParents, lock);
-        DISP_RC2(rc, "Cannot OpenFileWrite", lock);
-    }
-
-    assert(!main->noAscp || !main->noHttp);
-
-    if (rc == 0) {
-        bool ascp = _StringIsFasp(self->remote, NULL);
-        if (ascp) {
-            STSMSG(STS_TOP, (" Downloading via fasp..."));
-            rc = ResolvedDownloadAscp(self, main, tmp);
-            if (rc == 0 && main->forceAscpFail) {
-                rc = 1;
-            }
-            if (rc == 0) {
-                STSMSG(STS_TOP, (" fasp download succeed"));
-            }
-            else {
-                rc_t rc = Quitting();
-                if (rc != 0) {
-                    canceled = true;
-                }
-                else {
-                    STSMSG(STS_TOP, (" fasp download failed"));
-                }
-            }
-        }
-        if (!ascp || (rc != 0 && GetRCObject(rc) != rcMemory
-                              && !canceled && !main->noHttp))
-        {
-            const VPath *vremote = NULL;
-            STSMSG(STS_TOP, (" Downloading via http..."));
-            RELEASE(String, self->remote);
-            RELEASE(KFile, self->file);
-            rc = _VResolverRemote(main->resolver, eProtocolHttp, self->name,
-                self->accession, &vremote, &self->remote, &self->cache);
-            if (rc == 0) {
-                rc = ResolvedDownloadFile(self, main, tmp);
-            }
-            RELEASE(VPath, vremote);
-        }
-    }
-
-    RELEASE(KFile, flock);
-
-    if (rc == 0) {
-        STSMSG(STS_DBG, ("renaming %s -> %s", tmp, self->cache->addr));
-        rc = KDirectoryRename(main->dir, true, tmp, self->cache->addr);
-        if (rc != 0) {
-            PLOGERR(klogInt, (klogInt, rc, "cannot rename $(from) to $(to)",
-                "from=%s,to=%s", tmp, self->cache->addr));
-        }
-    }
-
-    if (rc == 0) {
-        rc = MainDownloaded(main, self->cache->addr);
-    }
-
-    if (rc == 0) {
-        rc_t rc2 = _KDirectoryCleanCache(main->dir, self->cache);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    {
-        rc_t rc2 = _KDirectoryClean(main->dir, self->cache, lock, tmp, rc != 0);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t ResolvedResolve(Resolved *self, Main *main, const Item *item)
-{
-    static int n = 0;
-    rc_t rc = 0;
-    bool isLocal = false;
-    bool ascp = false;
-
-    assert(self && main);
-
-    ++n;
-
-    ascp = MainUseAscp(main);
-
-    rc = ResolvedInit(self, item,
-        main->resolver, main->dir, ascp, main->repoMgr, main->cfg);
-
-    if (rc == 0) {
-        if (self->existing) {
-            self->path = item->desc;
-            return rc;
-        }
-
-        rc = ResolvedLocal(self, main->dir, &isLocal, main->force);
-    }
-
-    if (rc == 0) {
-        if (isLocal) {
-            STSMSG(STS_TOP, ("%d) %s is found locally", n, self->name));
-            if (self->local.str != NULL) {
-                self->path = self->local.str->addr;
-            }
-        }
-        else if (!_StringIsFasp(self->remote, NULL) && main->noHttp) {
-            rc = RC(rcExe, rcFile, rcCopying, rcFile, rcNotFound);
-            PLOGERR(klogErr, (klogErr, rc,
-                "cannot download '$(name)' using requested transport",
-                "name=%s", self->name));
-        }
-        else {
-            STSMSG(STS_TOP, ("%d) Downloading %s...", n, self->name));
-            rc = ResolvedDownload(self, main);
-            if (rc == 0) {
-                STSMSG(STS_TOP,
-                    ("%d) %s was downloaded successfully", n, self->name));
-                if (self->cache != NULL) {
-                    self->path = self->cache->addr;
-                }
-            }
-            else if (rc !=
-                SILENT_RC(rcExe, rcProcess, rcExecuting, rcProcess, rcCanceled))
-            {
-                STSMSG(STS_TOP, ("%d) failed to download %s", n, self->name));
-            }
-        }
-    }
-
-    return rc;
-}
-
-static rc_t MainDependenciesList(const Main *self,
-    const char *path, const VDBDependencies **deps)
-{
-    rc_t rc = 0;
-    bool isDb = true;
-    const VDatabase *db = NULL;
-
-    assert(self && path && deps);
-
-    rc = VDBManagerOpenDBRead(self->mgr, &db, NULL, path);
-    if (rc != 0) {
-        if (rc == SILENT_RC(rcDB, rcMgr, rcOpening, rcDatabase, rcIncorrect)) {
-            isDb = false;
-            rc = 0;
-        }
-        DISP_RC2(rc, "Cannot open database", path);
-    }
-
-    if (rc == 0 && isDb) {
-        bool all = self->check_all || self->force != eForceNo;
-        rc = VDatabaseListDependencies(db, deps, !all);
-        DISP_RC2(rc, "VDatabaseListDependencies", path);
-    }
-
-    RELEASE(VDatabase, db);
-
-    return rc;
-}
-
-static rc_t MainExecute(Main *self, const Item *item) {
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-    const VDBDependencies *deps = NULL;
-    uint32_t count = 0;
-    uint32_t i = 0;
-
-    Resolved resolved;
-
-    assert(self && item);
-
-    if (item->desc == NULL) {
-        OUTMSG(("Requested kart row download\n"));
-    }
-
-    /* resolve: locate; download if not found */
-    rc = ResolvedResolve(&resolved, self, item);
-
-    if (rc == 0) {
-        rc = MainDependenciesList(self, resolved.path, &deps);
-    }
-
-    /* resolve dependencies (refseqs) */
-    if (rc == 0 && deps != NULL) {
-        rc = VDBDependenciesCount(deps, &count);
-        if (rc == 0) {
-            STSMSG(STS_TOP, ("'%s' has %d%s dependenc%s",
-                item->desc, count, self->check_all ? "" : " unresolved",
-                count == 1 ? "y" : "ies"));
-        }
-        else {
-            DISP_RC2(rc, "Failed to check %s's dependencies", item->desc);
-        }
-    }
-
-    for (i = 0; i < count && rc == 0; ++i) {
-        bool local = true;
-        const char *seq_id = NULL;
-
-        if (rc == 0) {
-            rc = VDBDependenciesLocal(deps, &local, i);
-            DISP_RC2(rc, "VDBDependenciesLocal", item->desc);
-            if (local) {
-                continue;
-            }
-        }
-
-        if (rc == 0) {
-            rc = VDBDependenciesSeqId(deps, &seq_id, i);
-            DISP_RC2(rc, "VDBDependenciesSeqId", item->desc);
-        }
-
-        if (rc == 0) {
-            size_t num_writ = 0;
-            char ncbiAcc[512] = "";
-
-            assert(seq_id);
-
-            rc = string_printf(ncbiAcc, sizeof ncbiAcc, &num_writ,
-                "ncbi-acc:%s?vdb-ctx=refseq", seq_id);
-            DISP_RC2(rc, "string_printf(?vdb-ctx=refseq)", seq_id);
-            if (rc == 0 && num_writ > sizeof ncbiAcc) {
-                rc = RC(rcExe, rcFile, rcCopying, rcBuffer, rcInsufficient);
-                PLOGERR(klogInt, (klogInt, rc,
-                    "bad string_printf($(s)?vdb-ctx=refseq) result",
-                    "s=%s", seq_id));
-            }
-    
-            if (rc == 0) {
-                Resolved resolved;
-                Item item;
-                item.desc = ncbiAcc;
-                rc = ResolvedResolve(&resolved, self, &item);
-                rc2 = ResolvedFini(&resolved);
-            }
-        }
-    }
-
-    if (rc == 0 && rc2 != 0) {
-        rc = rc2;
-    }
-
-    RELEASE(VDBDependencies, deps);
-
-    {
-        rc_t rc2 = ResolvedFini(&resolved);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
-
-static rc_t MainFini(Main *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    RELEASE(KConfig, self->cfg);
-    RELEASE(VResolver, self->resolver);
-    RELEASE(VDBManager, self->mgr);
-    RELEASE(KDirectory, self->dir);
-    RELEASE(KRepositoryMgr, self->repoMgr);
-    RELEASE(Args, self->args);
-
-    BSTreeWhack(&self->downloaded, bstWhack, NULL);
-
-    free(self->buffer);
-
-    free((void*)self->ascp);
-    free((void*)self->asperaKey);
-    free(self->ascpMaxRate);
-
-    memset(self, 0, sizeof *self);
-
-    return rc;
-}
-
-#define CHECK_ALL_OPTION "check-all"
-#define CHECK_ALL_ALIAS  "c"
-static const char* CHECK_ALL_USAGE[] = { "double-check all refseqs", NULL };
-
-#define FORCE_OPTION "force"
-#define FORCE_ALIAS  "f"
-static const char* FORCE_USAGE[] = {
-    "force object download - one of: no, yes, all.",
-    "no [default]: skip download if the object if found and complete;",
-    "yes: download it even if it is found and is complete;", "all: ignore lock "
-    "files (stale locks or it is beeing downloaded by another process)", NULL };
-
-#define FAIL_ASCP_OPTION "FAIL-ASCP"
-#define FAIL_ASCP_ALIAS  "F"
-static const char* FAIL_ASCP_USAGE[] = {
-    "force ascp download fail to test ascp->http download combination" };
-
-
-#define LIST_OPTION "list"
-#define LIST_ALIAS  "l"
-static const char* LIST_USAGE[] = { "list the content of a kart file", NULL };
-
-#define HBEAT_ALIAS  "p"
-#define HBEAT_OPTION "progress"
-static const char* HBEAT_USAGE[] = {
-    "time period in minutes to display download progress",
-    "(0: no progress), default: 1", NULL };
-
-#define TRANS_OPTION "transport"
-#define TRASN_ALIAS  "t"
-static const char* TRANS_USAGE[] = { "transport: one of: ascp; http; both.",
-    "(ascp only; http only; first try ascp, "
-    "use http if cannot download by ascp).",
-    "Default: both", NULL };
-
-#ifdef _DEBUGGING
-#define TEXTKART_OPTION "text-kart"
-static const char* TEXTKART_USAGE[] =
-{ "To read a textual format kart file (DEBUG ONLY)", NULL };
-#endif
-
-static OptDef Options[] = {
-    /*                                                    needs_value required*/
-    { FORCE_OPTION    , FORCE_ALIAS    , NULL, FORCE_USAGE , 1, true, false }
-   ,{ TRANS_OPTION    , TRASN_ALIAS    , NULL, TRANS_USAGE , 1, true, false }
-   ,{ LIST_OPTION     , LIST_ALIAS     , NULL, LIST_USAGE  , 1, false,false }
-   ,{ HBEAT_OPTION    , HBEAT_ALIAS    , NULL, HBEAT_USAGE , 1, true, false }
-   ,{ CHECK_ALL_OPTION, CHECK_ALL_ALIAS, NULL, CHECK_ALL_USAGE, 1, false, false}
-   ,{ FAIL_ASCP_OPTION, FAIL_ASCP_ALIAS, NULL, FAIL_ASCP_USAGE, 1, false, false}
-#ifdef _DEBUGGING
-   ,{ TEXTKART_OPTION , NULL           , NULL, TEXTKART_USAGE , 1, true , false}
-#endif
-};
-
-static rc_t MainProcessArgs(Main *self, int argc, char *argv[]) {
-    rc_t rc = 0;
-
-    uint32_t pcount = 0;
-
-    assert(self);
-
-    rc = ArgsMakeAndHandle(&self->args, argc, argv, 1,
-        Options, sizeof Options / sizeof (OptDef));
-    if (rc != 0) {
-        DISP_RC(rc, "ArgsMakeAndHandle");
-        return rc;
-    }
-
-    do {
-        rc = ArgsOptionCount (self->args, FORCE_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Failure to get '" FORCE_OPTION "' argument");
-            break;
-        }
-
-        if (pcount > 0) {
-            const char *val = NULL;
-            rc = ArgsOptionValue(self->args, FORCE_OPTION, 0, &val);
-            if (rc != 0) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" FORCE_OPTION "' argument value");
-                break;
-            }
-            if (val == NULL || val[0] == '\0') {
-                rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-                LOGERR(klogErr, rc,
-                    "Unrecognized '" FORCE_OPTION "' argument value");
-                break;
-            }
-            switch (val[0]) {
-                case 'n':
-                case 'N':
-                    self->force = eForceNo;
-                    break;
-                case 'y':
-                case 'Y':
-                    self->force = eForceYes;
-                    break;
-                case 'a':
-                case 'A':
-                    self->force = eForceYES;
-                    break;
-                default:
-                    rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-                    LOGERR(klogErr, rc,
-                        "Unrecognized '" FORCE_OPTION "' argument value");
-                    break;
-            }
-            if (rc != 0) {
-                break;
-            }
-        }
-
-        rc = ArgsOptionCount(self->args, CHECK_ALL_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr,
-                rc, "Failure to get '" CHECK_ALL_OPTION "' argument");
-            break;
-        }
-        if (pcount > 0 || self->force != eForceNo) {
-            self->check_all = true;
-        }
-
-        rc = ArgsOptionCount(self->args, FAIL_ASCP_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr,
-                rc, "Failure to get '" FAIL_ASCP_OPTION "' argument");
-            break;
-        }
-        if (pcount > 0) {
-            self->forceAscpFail = true;
-        }
-
-        rc = ArgsOptionCount(self->args, LIST_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr,
-                rc, "Failure to get '" LIST_OPTION "' argument");
-            break;
-        }
-        if (pcount > 0) {
-            self->list_kart = true;
-        }
-
-        rc = ArgsOptionCount(self->args, HBEAT_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Failure to get '" HBEAT_OPTION "' argument");
-            break;
-        }
-
-        if (pcount > 0) {
-            double f;
-            const char *val = NULL;
-            rc = ArgsOptionValue(self->args, HBEAT_OPTION, 0, &val);
-            if (rc != 0) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" HBEAT_OPTION "' argument value");
-                break;
-            }
-            f = atof(val) * 60000;
-            self->heartbeat = f;
-        }
-
-        rc = ArgsOptionCount(self->args, TRANS_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Failure to get '" TRANS_OPTION "' argument");
-            break;
-        }
-
-        if (pcount > 0) {
-            const char *val = NULL;
-            rc = ArgsOptionValue(self->args, TRANS_OPTION, 0, &val);
-            if (rc != 0) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" TRANS_OPTION "' argument value");
-                break;
-            }
-            assert(val);
-            if (val[0] == 'a') {
-                self->noHttp = true;
-            }
-            else if (val[0] == 'h') {
-                self->noAscp = true;
-            }
-        }
-
-#ifdef _DEBUGGING
-        rc = ArgsOptionCount(self->args, TEXTKART_OPTION, &pcount);
-        if (rc != 0) {
-            LOGERR(klogErr, rc,
-                "Failure to get '" TEXTKART_OPTION "' argument");
-            break;
-        }
-
-        if (pcount > 0) {
-            const char *val = NULL;
-            rc = ArgsOptionValue(self->args, TEXTKART_OPTION, 0, &val);
-            if (rc != 0) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" TEXTKART_OPTION "' argument value");
-                break;
-            }
-            self->textkart = val;
-        }
-#endif
-    } while (false);
-
-    STSMSG(STS_FIN, ("heartbeat = %ld Milliseconds", self->heartbeat));
-
-    return rc;
-}
-
-const char UsageDefaultName[] = "prefetch";
-rc_t CC UsageSummary(const char *progname) {
-    return OUTMSG((
-        "Usage:\n"
-        "  %s [options] <SRA accession | kart file> [...]\n"
-        "  Download SRA or dbGaP files and their dependencies\n"
-        "\n"
-        "  %s [options] <SRA file> [...]\n"
-        "  Check SRA file for missed dependencies "
-                                           "and download them\n"
-        "\n"
-        "  %s --list <kart file> [...]\n"
-        "  List the content of a kart file\n"
-        , progname, progname, progname));
-}
-
-rc_t CC Usage(const Args *args) {
-    rc_t rc = 0;
-    int i = 0;
-
-    const char *progname = UsageDefaultName;
-    const char *fullpath = UsageDefaultName;
-
-    if (args == NULL) {
-        rc = RC(rcExe, rcArgv, rcAccessing, rcSelf, rcNull);
-    }
-    else {
-        rc = ArgsProgram(args, &fullpath, &progname);
-    }
-    if (rc != 0) {
-        progname = fullpath = UsageDefaultName;
-    }
-
-    UsageSummary(progname);
-    OUTMSG(("\n"));
-
-    OUTMSG(("Options:\n"));
-    for (i = 0; i < sizeof(Options) / sizeof(Options[0]); i++ ) {
-        const char *param = NULL;
-
-        if (Options[i].aliases != NULL) {
-            if (strcmp(Options[i].aliases, FAIL_ASCP_ALIAS) == 0) {
-                continue; /* debug option */
-            }
-            if (strcmp(Options[i].aliases, FORCE_ALIAS) == 0) {
-                param = "value";
-            }
-        }
-        HelpOptionLine(Options[i].aliases, Options[i].name,
-            param, Options[i].help);
-    }
-
-    OUTMSG(("\n"));
-    HelpOptionsStandard();
-    HelpVersion(fullpath, KAppVersion());
-
-    return rc;
-}
-
-static rc_t MainInit(int argc, char *argv[], Main *self) {
-    rc_t rc = 0;
-    VFSManager *mgr = NULL;
-
-    assert(self);
-    memset(self, 0, sizeof *self);
-
-    self->heartbeat = 60000;
-/*  self->heartbeat = 69; */
-
-    BSTreeInit(&self->downloaded);
-
-    if (rc == 0) {
-        rc = MainProcessArgs(self, argc, argv);
-    }
-
-    if (rc == 0) {
-        self->bsize = 1024 * 1024;
-        self->buffer = malloc(self->bsize);
-        if (self->buffer == NULL) {
-            rc = RC(rcExe, rcData, rcAllocating, rcMemory, rcExhausted);
-        }
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerMake(&mgr);
-        DISP_RC(rc, "VFSManagerMake");
-    }
-
-    if (rc == 0) {
-        VResolver *resolver = NULL;
-        rc = VFSManagerGetResolver(mgr, &resolver);
-        DISP_RC(rc, "VFSManagerGetResolver");
-        VResolverRemoteEnable(resolver, vrAlwaysEnable);
-        RELEASE(VResolver, resolver);
-    }
-
-    if (rc == 0) {
-        rc = KConfigMake(&self->cfg, NULL);
-        DISP_RC(rc, "KConfigMake");
-    }
-
-    if (rc == 0) {
-        rc = KConfigMakeRepositoryMgrRead(self->cfg, &self->repoMgr);
-        DISP_RC(rc, "KConfigMakeRepositoryMgrRead");
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerMakeResolver(mgr, &self->resolver, self->cfg);
-        DISP_RC(rc, "VFSManagerMakeResolver");
-    }
-
-    if (rc == 0) {
-        VResolverRemoteEnable(self->resolver, vrAlwaysEnable);
-        VResolverCacheEnable(self->resolver, vrAlwaysEnable);
-    }
-
-    if (rc == 0) {
-        rc = VDBManagerMakeRead(&self->mgr, NULL);
-        DISP_RC(rc, "VDBManagerMakeRead");
-    }
-
-    if (rc == 0) {
-        rc = KDirectoryNativeDir(&self->dir);
-        DISP_RC(rc, "KDirectoryNativeDir");
-    }
-
-    if (rc == 0) {
-        srand(time(NULL));
-    }
-
-    RELEASE(VFSManager, mgr);
-
-    return rc;
-}
-
-ver_t CC KAppVersion(void) { return PREFETCH_VERS; }
-
-/******************************************************************************/
-
-rc_t CC KMain(int argc, char *argv[]) {
-    rc_t rc = 0;
-    uint32_t pcount = 0;
-
-    Main pars;
-    rc = MainInit(argc, argv, &pars);
-
-    if (rc == 0) {
-        rc = ArgsParamCount(pars.args, &pcount);
-    }
-    if (rc == 0 && pcount == 0) {
-#ifdef _DEBUGGING
-        if (!pars.textkart)
-#endif
-          rc = UsageSummary(UsageDefaultName);
-    }
-
-    if (rc == 0) {
-        uint32_t i = ~0;
-
-#ifdef _DEBUGGING
-        if (pars.textkart) {
-            rc_t rc2 = 0;
-            Iterator it;
-            memset(&it, 0, sizeof it);
-            if (rc2 == 0) {
-                rc2 = IteratorInit(&it, NULL, &pars);
-            }
-            if (rc2 == 0) {
-                if (pars.list_kart) {
-                    rc2 = KartPrint(it.kart);
-                }
-                else {
-                    while (true) {
-                        rc_t rc3 = 0;
-                        bool done = false;
-                        Item item;
-                        rc2 = IteratorNext(&it, &item, &done);
-                        if (rc2 != 0 || done == true) {
-                            break;
-                        }
-                        rc3 = MainExecute(&pars, &item);
-                        if (rc == 0) {
-                            if (rc2 != 0) {
-                                rc = rc2;
-                            }
-                            else if (rc3 != 0) {
-                                rc = rc3;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-#endif
-
-        for (i = 0; i < pcount; ++i) {
-            rc_t rc2 = 0;
-            Iterator it;
-            const char *obj = NULL;
-
-            memset(&it, 0, sizeof it);
-
-            rc2 = ArgsParamValue(pars.args, i, &obj);
-            DISP_RC(rc2, "ArgsParamValue");
-
-            if (rc2 == 0) {
-                rc2 = IteratorInit(&it, obj, &pars);
-            }
-
-            if (rc2 == 0) {
-                if (pars.list_kart) {
-                    rc2 = KartPrint(it.kart);
-                }
-                else {
-                    while (true) {
-                        rc_t rc3 = 0;
-                        bool done = false;
-                        Item item;
-                        rc2 = IteratorNext(&it, &item, &done);
-                        if (rc2 != 0 || done == true) {
-                            break;
-                        }
-                        rc3 = MainExecute(&pars, &item);
-                        if (rc == 0) {
-                            if (rc2 != 0) {
-                                rc = rc2;
-                            }
-                            else if (rc3 != 0) {
-                                rc = rc3;
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (pars.list_kart && it.isKart) {
-                rc_t rc2 = OUTMSG(("\n"));
-                if (rc2 != 0 && rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            IteratorFini(&it);
-        }
-    }
-
-    {
-        rc_t rc2 = MainFini(&pars);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
diff --git a/tools/prefetch/prefetch.vers b/tools/prefetch/prefetch.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/prefetch/prefetch.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sam-dump/Makefile b/tools/sam-dump/Makefile
deleted file mode 100644
index 8d1d212..0000000
--- a/tools/sam-dump/Makefile
+++ /dev/null
@@ -1,102 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sam-dump
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	sam-dump
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sam-dump
-#
-SAMDUMP_SRC = \
-	sam-dump
-
-SAMDUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(SAMDUMP_SRC))
-
-SAMDUMP_LIB = \
-	-lkapp \
-	-lalign-reader \
-	$(READONLY_SCHEMA_LIBS) \
-	-lsraschema \
-	-lvdb \
-	-lkdb \
-	-lvfs \
-	-ssrapath \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lksrch \
-	-lkproc \
-	-lklib \
-	-lm
-
-$(BINDIR)/sam-dump: $(SAMDUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SAMDUMP_LIB)
diff --git a/tools/sam-dump/debug.h b/tools/sam-dump/debug.h
deleted file mode 100644
index d1a321b..0000000
--- a/tools/sam-dump/debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_sam_dump_debug_h_
-#define _tools_sam_dump_debug_h_
-
-#include <klib/debug.h>
-
-#define SAM_DUMP_DBG_PASTE(a,b) a##b
-#define SAM_DUMP_DBG(flag,msg) DBGMSG(DBG_APP,DBG_FLAG(SAM_DUMP_DBG_PASTE(DBG_APP_,flag)), msg)
-
-#endif /* _tools_sam_dump_debug_h_ */
diff --git a/tools/sam-dump/sam-dump.c b/tools/sam-dump/sam-dump.c
deleted file mode 100644
index 682f264..0000000
--- a/tools/sam-dump/sam-dump.c
+++ /dev/null
@@ -1,4870 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/report.h>
-#include <klib/container.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <klib/vector.h>
-#include <klib/printf.h>
-#include <klib/data-buffer.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/gzip.h>
-#include <kfs/bzip.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-#include <vdb/report.h>
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/schema.h>
-#include <vdb/dependencies.h>
-#include <sra/sraschema.h>
-#include <sra/srapath.h>
-#include <align/dna-reverse-cmpl.h>
-#include <align/iterator.h>
-#include <align/reference.h>
-#include <align/quality-quantizer.h>
-
-#include <kfs/directory.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <string.h>
-#include <strtol.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "sam-dump.vers.h"
-
-#if _ARCH_BITS == 64
-#define USE_MATE_CACHE 1
-#define CURSOR_CACHE (4 * 1024 * 1024 * 1024UL)
-#else
-#define USE_MATE_CACHE 0
-#define CURSOR_CACHE (256 * 1024 * 1024)
-#endif
-
-
-
-typedef struct TAlignedRegion_struct
-{
-    char name[1024];
-    struct {
-        INSDC_coord_zero from;
-        INSDC_coord_zero to;
-    } r[10240];
-    int rq;
-    INSDC_coord_zero max_to;
-    INSDC_coord_zero min_from;
-    int printed;
-} TAlignedRegion;
-
-
-typedef struct TMatepairDistance_struct
-{
-    uint32_t from;
-    uint32_t to;
-} TMatepairDistance;
-
-
-struct params_s
-{
-    /* which outputs are on */
-    bool primaries;
-    bool secondaries;
-    bool unaligned;
-    bool cg_evidence;
-    bool cg_ev_dnb;
-    bool cg_sam;
-    
-    bool use_seqid;
-    bool long_cigar;
-    bool reheader;
-    bool noheader;
-    bool hide_identical;
-    bool fasta;
-    bool fastq;
-    bool spot_group_in_name;
-    bool cg_friendly_names;
-    bool reverse_unaligned;
-    bool unaligned_spots;
-    
-    bool output_gzip;
-    bool output_bz2;
-    
-    bool xi;
-    int cg_style; /* 0: raw; 1: with B's; 2: without B's, fixed up SEQ/QUAL; */
-    char const *name_prefix;
-    /* region filter data */
-    TAlignedRegion* region;
-    uint32_t region_qty;
-    /* distance filter data */
-    bool mp_dist_unknown;
-    TMatepairDistance* mp_dist;
-    uint32_t mp_dist_qty;
-    uint32_t test_rows;
-
-    /* mate info cache */
-    int64_t mate_row_gap_cachable;
-    
-    char const **comments;
-    
-    bool quantizeQual;
-    uint8_t qualQuant[256];
-    uint8_t qualQuantSingle; /*** the quality is quantized - single value, no need to retrieve **/
-};
-
-
-struct params_s const *param;
-ReferenceList const *gRefList;
-
-
-typedef union UData_union
-{
-    void const *v;
-    uint32_t const *u32;
-    int32_t const *i32;
-    int64_t const *i64;
-    uint64_t const *u64;
-    uint8_t const *u8;
-    char const *str;
-    bool const *tf;
-    INSDC_coord_one* coord1;
-    INSDC_coord_zero* coord0;
-    INSDC_coord_len* coord_len;
-    INSDC_coord_val* coord_val;
-    INSDC_SRA_xread_type* read_type;
-    INSDC_SRA_read_filter* read_filter;
-} UData;
-
-
-typedef struct SCol_struct
-{
-    char const *name;
-    uint32_t idx;
-    UData base;
-    uint32_t len;
-    bool optional;
-} SCol;
-
-
-typedef struct STable_struct
-{
-    char const *name;
-    VTable const *vtbl;
-} STable;
-
-
-typedef struct SCursCache_struct
-{
-    KVector* cache;
-    KVector* cache_unaligned_mate; /* keeps unaligned-mate for a half-aligned spots */
-    uint32_t sam_flags;
-    INSDC_coord_zero pnext;
-    int32_t tlen;
-    ReferenceObj const *ref;
-    /* cache stats */
-    uint64_t projected;
-    uint64_t added;
-    uint64_t hit;
-    uint64_t bad;
-} SCursCache;
-
-
-typedef struct SCurs_struct
-{
-    STable const *tbl;
-    VCursor const *vcurs;
-    SCursCache* cache;
-    SCursCache cache_local;
-    uint64_t col_reads_qty;
-} SCurs;
-
-enum eDSTableType
-{
-    edstt_NotSpecified,
-    edstt_Reference,
-    edstt_Sequence,
-    edstt_PrimaryAlignment,
-    edstt_SecondaryAlignment,
-    edstt_EvidenceAlignment,
-    edstt_EvidenceInterval
-};
-
-
-typedef struct DataSource_s {
-    STable tbl;
-    SCurs curs;
-    SCol *cols;
-    enum eDSTableType type;
-} DataSource;
-
-
-#define DATASOURCE_INIT(O, NAME) do { memset(&O, 0, sizeof(O)); O.tbl.name = NAME; O.curs.tbl = &O.tbl; } while(0)
-
-
-typedef struct SAM_dump_ctx_s
-{
-    VDatabase const *db;
-    char const *fullPath;
-    char const *accession;
-    char const *readGroup;
-    
-    DataSource ref;
-    DataSource pri;
-    DataSource sec;
-    DataSource evi;
-    DataSource eva;
-    DataSource seq;
-} SAM_dump_ctx_t;
-
-
-enum ealg_col
-{
-    alg_SEQ_SPOT_ID = 0,
-    alg_SEQ_NAME,
-    alg_MAPQ,
-    alg_CIGAR,
-    alg_READ,
-    alg_READ_START,
-    alg_READ_LEN,
-    alg_CIGAR_LEN,
-    alg_SAM_QUALITY,
-    alg_SPOT_GROUP,
-    alg_SEQ_SPOT_GROUP,
-    alg_SEQ_READ_ID,
-    alg_REVERSED,
-    alg_ALIGNMENT_COUNT,
-    alg_EDIT_DISTANCE,
-    alg_READ_FILTER,
-    alg_MATE_ALIGN_ID,
-    alg_MATE_REF_NAME,
-    alg_SAM_FLAGS,
-    alg_REF_START,
-    alg_MATE_REF_POS,
-    alg_ALIGN_GROUP,
-    alg_EVIDENCE_ALIGNMENT_IDS,
-    alg_REF_PLOIDY,
-    alg_REF_ID,
-    alg_MATE_REF_ID,
-    alg_HAS_MISMATCH,
-    alg_REGION_FILTER,
-    alg_REF_NAME = alg_REGION_FILTER,
-    alg_REF_SEQ_ID,
-    alg_REF_POS,
-    alg_REF_LEN,
-    alg_DISTANCE_FILTER,
-    alg_TEMPLATE_LEN = alg_DISTANCE_FILTER,
-    alg_CG_TAGS_STR
-};
-
-
-SCol const g_alg_col_tmpl[] =
-{
-    { "SEQ_SPOT_ID", 0, {NULL}, 0, true },
-    { "SEQ_NAME", 0, {NULL}, 0, false },
-    { "MAPQ", 0, {NULL}, 0, false },
-    { "?CIGAR column name?", 0, {NULL}, 0, false },
-    { "?READ column name?", 0, {NULL}, 0, false },
-    { "READ_START", 0, {NULL}, 0, false }, /* READ_START */
-    { "READ_LEN", 0, {NULL}, 0, false }, /* READ_LEN */
-    { "?CIGAR_LEN column name?", 0, {NULL}, 0, true }, /* CIGAR_LEN */
-    { "SAM_QUALITY", 0, {NULL}, 0, false },
-    { "SPOT_GROUP", 0, {NULL}, 0, true },
-    { "SEQ_SPOT_GROUP", 0, {NULL}, 0, true },
-    { "SEQ_READ_ID", 0, {NULL}, 0, true },
-    { "REF_ORIENTATION", 0, {NULL}, 0, true },
-    { "ALIGNMENT_COUNT", 0, {NULL}, 0, true },
-    { "EDIT_DISTANCE", 0, {NULL}, 0, false },
-    { "", 0, {NULL}, 0, false },
-    /* start cols used as standalone in DumpUnaligned */
-    /* MATE_ALIGN_ID col must preceeed
-       MATE_REF_NAME, MATE_REF_POS, SAM_FLAGS, TEMPLATE_LEN for cache to work */
-    { "MATE_ALIGN_ID", 0, {NULL}, 0, false },
-    { "?MATE_REF_NAME column name?", 0, {NULL}, 0, false },
-    { "SAM_FLAGS", 0, {NULL}, 0, false },
-    { "REF_START", 0, {NULL}, 0, false },  /* priming cursor cache */
-    { "MATE_REF_POS", 0, {NULL}, 0, false },
-    { "ALIGN_GROUP", 0, {NULL}, 0, true },
-    { "", 0, {NULL}, 0, true }, /* EVIDENCE_ALIGNMENT_IDS */
-    { "", 0, {NULL}, 0, true }, /* REF_PLOIDY */
-    { "REF_ID", 0, {NULL}, 0, true }, /* REF_ID */
-    { "MATE_REF_ID", 0, {NULL}, 0, true }, /* priming cursor cache */
-    { "(bool)HAS_MISMATCH", 0, {NULL}, 0, true },
-    /* these are read before any other for filtering so they must be last */
-    { "REF_NAME", 0, {NULL}, 0, false },
-    { "REF_SEQ_ID", 0, {NULL}, 0, false },
-    { "REF_POS", 0, {NULL}, 0, false },
-    /* end cols used as standalone in DumpUnaligned */
-    { "REF_LEN", 0, {NULL}, 0, false },
-    { "TEMPLATE_LEN", 0, {NULL}, 0, false },
-    { NULL, 0, {NULL}, 0, false }, /* alg_CG_TAGS_STR */
-    { NULL, 0, {NULL}, 0, false }
-};
-
-enum eseq_col
-{
-    seq_READ = 0,
-    seq_QUALITY,
-    seq_SPOT_GROUP,
-    seq_READ_START,
-    seq_READ_LEN,
-    seq_READ_TYPE,
-    seq_READ_FILTER,
-    seq_NAME,
-    seq_PRIMARY_ALIGNMENT_ID
-};
-
-static 
-SCol const gSeqCol[] =
-{
-    { "READ", 0, {NULL}, 0, false },
-/*    { "(INSDC:quality:text:phred_33)QUALITY", 0, {NULL}, 0, false }, */
-    { "(INSDC:quality:phred)QUALITY", 0, {NULL}, 0, false }, /* changed Jan 29 2013, because some runs don't have the phred_33-type in schema */
-    { "SPOT_GROUP", 0, {NULL}, 0, true },
-    { "READ_START", 0, {NULL}, 0, true },
-    { "READ_LEN", 0, {NULL}, 0, true },
-    { "READ_TYPE", 0, {NULL}, 0, true },
-    { "READ_FILTER", 0, {NULL}, 0, true },
-    { "NAME", 0, {NULL}, 0, true },
-    /* must be last in list to avoid reading all columns */
-    { "PRIMARY_ALIGNMENT_ID", 0, {NULL}, 0, true },
-    { NULL, 0, {NULL}, 0, false }
-};
-
-
-static rc_t RefSeqPrint( void )
-{
-    rc_t rc = 0;
-    uint32_t i, count = 0;
-    
-    rc = ReferenceList_Count( gRefList, &count );
-    for( i = 0; rc == 0 && i < count; i++ )
-    {
-        ReferenceObj const *obj;
-        rc = ReferenceList_Get( gRefList, &obj, i );
-        if ( rc == 0 )
-        {
-            char const *seqid = NULL;
-            rc = ReferenceObj_SeqId( obj, &seqid );
-            if ( rc == 0 )
-            {
-                char const *name = NULL;
-                rc = ReferenceObj_Name( obj, &name );
-                if ( rc == 0 )
-                {
-                    INSDC_coord_len len;
-                    rc = ReferenceObj_SeqLength( obj, &len );
-                    if ( rc == 0 )
-                    {
-                        char const *nm;
-                        if ( param->use_seqid && seqid != NULL && seqid[ 0 ] != '\0' )
-                        {
-                            nm = seqid;
-                        }
-                        else
-                        {
-                            nm = name;
-                        }
-                        KOutMsg( "@SQ\tSN:%s", nm );
-                        if ( nm != seqid && seqid != NULL && seqid[ 0 ] != '\0' && strcmp( nm, seqid ) != 0)
-                        {
-                            KOutMsg( "\tAS:%s", seqid );
-                        }
-                        KOutMsg( "\tLN:%u\n", len );
-                    }
-                }
-            }
-            ReferenceObj_Release( obj );
-        }
-    }
-    return rc;
-}
-
-
-#if USE_MATE_CACHE
-static rc_t Cache_Init( SCursCache* c )
-{
-    if ( c != NULL )
-    {
-	rc_t rc;
-        memset( c, 0, sizeof( *c ) );
-        rc=KVectorMake( &c->cache );
-	if(rc == 0){
-		rc=KVectorMake( &c->cache_unaligned_mate );
-	}
-    }
-    return 0;
-}
-
-
-static void Cache_Close( char const *name, SCursCache* c )
-{
-    if ( c != NULL )
-    {
-        KVectorRelease( c->cache );
-        KVectorRelease( c->cache_unaligned_mate );
-        if ( c->added > 0 )
-        {
-            SAM_DUMP_DBG( 2, ( "%s cache stats: projected %lu added of those %lu; "
-                               "hits %lu of those broken %lu;\n",
-                               name, c->projected, c->added, c->hit, c->bad ) );
-        }
-    }
-    memset( c, 0, sizeof( *c ) );
-}
-
-
-static rc_t Cache_Add( uint64_t key, SCurs const *curs, SCol const *cols )
-{
-    /* compact values for mate record to cache as:
-        pos_delta - 32bit, ref_proj - 11bit, flags - 11bit, rnext_idx - 10bit = 64bit
-    */
-    rc_t rc = 0;
-    ReferenceObj const *r = NULL;
-    uint32_t rid = 0;
-    uint64_t val = 0;
-    int64_t mate_id = cols[ alg_MATE_ALIGN_ID ].len > 0 ? cols[ alg_MATE_ALIGN_ID ].base.i64[ 0 ] : 0;
-
-    rc = ReferenceList_Find( gRefList, &r, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len );
-    if ( rc == 0 )
-    {
-        rc = ReferenceObj_Idx( r, &rid );
-    }
-#if _DEBUGGING
-    {
-        char const *rname = NULL;
-        curs->cache->projected++;
-        ReferenceObj_Name( r, &rname );
-        SAM_DUMP_DBG( 10, ( "to cache row %li for mate %li: %u,%s[%hu],%u,%u,%i",
-            key, mate_id, cols[ alg_SAM_FLAGS ].base.u32[ 0 ], rname, rid,
-            cols[ alg_REF_POS ].len ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0,
-            cols[ alg_MATE_REF_POS ].len ? cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] : 0,
-            cols[ alg_TEMPLATE_LEN ].len > 0 ? cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] : 0));
-    }
-#endif
-    if ( rc == 0 && !( rid & 0xFC00 ) )
-    {
-        int64_t pos_delta64;
-        int32_t pos_delta32;
-
-        if ( mate_id != 0 )
-        {
-            ReferenceObj const *rm = NULL;
-            uint32_t rm_id;
-
-            rc = ReferenceList_Find( gRefList, &rm, cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len );
-            if ( rc == 0 )
-            {
-                rc = ReferenceObj_Idx( rm, &rm_id );
-            }
-            assert( rm != NULL );
-            if ( rc == 0 && rid != rm_id )
-            {
-                char const *rm_name = NULL;
-                ReferenceObj_Name( rm, &rm_name );
-                mate_id = 0;
-                SAM_DUMP_DBG( 10, ( " mate ref differ: %s[%hu]!", rm_name, rm_id ) );
-            }
-            ReferenceObj_Release( rm );
-        }
-
-        if ( mate_id != 0 )
-        {
-            pos_delta64 = cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] - cols[ alg_REF_POS ].base.coord0[ 0 ];
-        }
-        else
-        {
-            pos_delta64 = cols[ alg_REF_POS ].base.coord0[ 0 ];
-        }
-
-        pos_delta32 = pos_delta64;
-        if ( pos_delta64 == pos_delta32 )
-        {
-            int64_t ref_proj;
-            if ( mate_id == 0 )
-            {
-                ref_proj = 0; /* indicates full value in delta */
-            }
-            else if ( cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] < 0 )
-            {
-                assert( pos_delta32 <= 0 );
-                ref_proj = pos_delta32 - cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ];
-            }
-            else
-            {
-                assert( pos_delta32 >= 0 );
-                ref_proj = cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] - pos_delta32;
-            }
-
-            if ( !( ref_proj & 0xFFFFF800 ) )
-            {
-                val = ( pos_delta64 << 32 ) | ( ref_proj << 21 ) | ( cols[ alg_SAM_FLAGS ].base.u32[ 0 ] << 10 ) | rid;
-                rc = KVectorSetU64( curs->cache->cache, key, val );
-            }
-        }
-    }
-    ReferenceObj_Release( r );
-
-#if _DEBUGGING
-    if ( val == 0 )
-    {
-        SAM_DUMP_DBG( 10, ( " --> out of range\n" ) );
-    }
-    else
-    {
-        SAM_DUMP_DBG( 10, ( " --> %016lX\n", val ) );
-        curs->cache->added++;
-    }
-#endif
-    return rc;
-}
-
-
-static rc_t Cache_Get( SCurs const *curs, uint64_t key, uint64_t* val )
-{
-    rc_t rc = KVectorGetU64( curs->cache->cache, key, val );
-    if ( rc == 0 )
-    {
-        uint32_t id = ( *val & 0x3FF );
-#if _DEBUGGING
-        curs->cache->hit++;
-#endif
-        KVectorUnset( curs->cache->cache, key );
-        rc = ReferenceList_Get( gRefList, &curs->cache->ref, id );
-        if ( rc != 0 )
-        {
-            *val = 0;
-            curs->cache->ref = NULL;
-            rc = RC( rcExe, rcNoTarg, rcSearching, rcItem, rcNotFound );
-#if _DEBUGGING
-            curs->cache->bad++;
-#endif
-        }
-        else
-        {
-            SAM_DUMP_DBG( 10, ( "from cache row %li %016lX", key, *val ) );
-        }
-    }
-    return rc;
-}
-
-
-static void Cache_Unpack( uint64_t val, int64_t mate_id, SCurs const *curs, SCol* cols )
-{
-    int32_t pos_delta = ( val & 0xFFFFFFFF00000000 ) >> 32;
-    uint32_t ref_proj = ( val & 0x00000000FFE00000 ) >> 21;
-    uint32_t flags = ( val & 0x00000000001FFC00 ) >> 10;
-
-    if ( mate_id != 0 )
-    {
-        /* adjust flags for mate record */
-        curs->cache->sam_flags = ( flags & 0x1 ) |
-                                 ( flags & 0x2 ) |
-                                 ( ( flags & 0x8 ) >> 1 ) |
-                                 ( ( flags & 0x4 ) << 1 ) |
-                                 ( ( flags & 0x20 ) >> 1 ) |
-                                 ( ( flags & 0x10 ) << 1 ) |
-                                 ( ( flags & 0x40 ) ? 0x80 : 0x40 ) |
-                                 ( flags & 0x700 );
-    }
-    else
-    {
-        /* preserve flags as if original records is restored */
-        curs->cache->sam_flags = flags;
-    }
-    cols[ alg_SAM_FLAGS ].base.u32 = &curs->cache->sam_flags;
-    cols[ alg_SAM_FLAGS ].len = sizeof( curs->cache->sam_flags );
-
-    if ( param->use_seqid )
-    {
-        ReferenceObj_SeqId( curs->cache->ref, &cols[ alg_MATE_REF_NAME ].base.str );
-    }
-    else
-    {
-        ReferenceObj_Name( curs->cache->ref, &cols[ alg_MATE_REF_NAME ].base.str );
-    }
-
-    cols[ alg_MATE_REF_NAME ].len = strlen( cols[ alg_MATE_REF_NAME ].base.str );
-
-    if ( ref_proj == 0 )
-    {
-        curs->cache->pnext = pos_delta;
-        curs->cache->tlen = 0;
-    }
-    else if ( pos_delta > 0 )
-    {
-        curs->cache->pnext = ( cols[ alg_REF_POS ].len > 0 ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0 ) - pos_delta;
-        curs->cache->tlen = - ( ref_proj + pos_delta );
-    }
-    else
-    {
-        curs->cache->pnext = ( cols[ alg_REF_POS ].len > 0 ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0 ) - pos_delta;
-        curs->cache->tlen = ref_proj - pos_delta;
-    }
-
-    cols[ alg_MATE_REF_POS ].base.coord0 = &curs->cache->pnext;
-    cols[ alg_MATE_REF_POS ].len = sizeof( curs->cache->pnext );
-    cols[ alg_TEMPLATE_LEN ].base.i32 = &curs->cache->tlen;
-    cols[ alg_TEMPLATE_LEN ].len = sizeof( curs->cache->tlen );
-    {
-        uint32_t id;
-        ReferenceObj_Idx( curs->cache->ref, &id );
-        SAM_DUMP_DBG( 10, ( " --> mate %li: %u,%s[%hu],%u,%i\n",
-            mate_id, curs->cache->sam_flags, cols[ alg_MATE_REF_NAME ].base.str,
-            id, curs->cache->pnext, curs->cache->tlen ) );
-    }
-}
-#endif /* USE_MATE_CACHE */
-
-#if 0
-static rc_t OpenVTable( VDatabase const *db, STable* tbl, char const *name, bool optional )
-{
-    rc_t rc = VDatabaseOpenTableRead( db, &tbl->vtbl, name );
-    if ( GetRCState( rc ) == rcNotFound && optional )
-    {
-        rc = 0;
-        tbl->vtbl = NULL;
-    }
-    tbl->name = name;
-    return rc;
-}
-#endif
-
-static rc_t Cursor_Open( STable const *const tbl, SCurs *const curs, SCol cols[], SCursCache* cache )
-{
-    rc_t rc = 0;
-    unsigned i;
-
-    curs->vcurs = NULL;
-    if ( tbl == NULL || tbl->vtbl == NULL )
-        return 0;
-
-    rc = VTableCreateCachedCursorRead( tbl->vtbl, &curs->vcurs, CURSOR_CACHE );
-    if ( rc != 0 )
-        return rc;
-    
-    rc = VCursorPermitPostOpenAdd( curs->vcurs );
-    if ( rc != 0 )
-        return rc;
-
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( curs->vcurs );
-        if ( rc == 0 )
-        {
-#if USE_MATE_CACHE
-            if ( cache != NULL )
-            {
-                curs->cache = cache;
-            }
-            else
-            {
-                curs->cache = &curs->cache_local;
-                rc = Cache_Init( &curs->cache_local );
-            }
-#endif /* USE_MATE_CACHE */
-            curs->tbl = tbl;
-        }
-    }
-    
-    for ( i = 0; cols[ i ].name != NULL; ++i )
-    {
-        if ( cols[ i ].name[ 0 ] == 0 )
-            continue;
-        rc = VCursorAddColumn( curs->vcurs, &cols[ i ].idx, cols[ i ].name );
-        if ( GetRCObject( rc ) == rcColumn )
-        {
-            switch ( GetRCState( rc ) )
-            {
-            case rcNotFound:
-            case rcUndefined:
-                if ( !cols[ i ].optional )
-                    break;
-            case rcExists:
-                rc = 0;
-            default:
-                break;
-            }
-        }
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "table $(t) column $(c)", "t=%s,c=%s", tbl->name, cols[ i ].name ) );
-            break;
-        }
-    }
-    if ( rc != 0 )
-    {
-        VCursorRelease( curs->vcurs );
-        curs->vcurs = NULL;
-        if ( rc != KLogLastErrorCode() )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "table $(t)", "t=%s", tbl->name ) );
-        }
-    }
-    else
-    {
-        SAM_DUMP_DBG( 2, ( "%s: table %s\n", __func__, curs->tbl->name ) );
-    }
-    return rc;
-}
-
-
-static void Cursor_Close( SCurs* curs )
-{
-    if ( curs != NULL && curs->vcurs != NULL )
-    {
-        SAM_DUMP_DBG( 2, ( "%s: table %s, columns rows read %lu\n", __func__, curs->tbl->name, curs->col_reads_qty ) );
-        VCursorRelease( curs->vcurs );
-#if USE_MATE_CACHE
-        if ( curs->cache == &curs->cache_local )
-        {
-            Cache_Close( curs->tbl->name, curs->cache );
-        }
-#endif /* USE_MATE_CACHE */
-        memset( curs, 0, sizeof( *curs ) );
-    }
-}
-
-
-static rc_t Cursor_Read( DataSource *ds, int64_t row_id, int firstCol, unsigned nCols )
-{
-    rc_t rc = 0;
-
-    if ( ds->curs.vcurs == NULL )
-    {
-        rc = Cursor_Open( &ds->tbl, &ds->curs, ds->cols, ds->curs.cache );
-        if ( rc != 0 )
-            return rc;
-    }
-    if (1)
-    {
-        SCol *const col = &ds->cols[ firstCol ];
-        unsigned i;
-        
-        for ( i = 0; i < nCols && col[ i ].name; ++i )
-        {
-            uint32_t const idx = col[ i ].idx;
-            
-            if ( idx != 0 )
-            {
-                uint32_t elem_bits;
-                uint32_t bit_offset;
-                uint32_t elem_count;
-                void const *base;
-                
-                rc = VCursorCellDataDirect( ds->curs.vcurs, row_id, idx, &elem_bits, &base, &bit_offset, &elem_count );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogWarn, ( klogWarn, rc, "reading $(t) row $(r), column $(c)", "t=%s,r=%li,c=%s",
-                                               ds->tbl.name, row_id, col[ i ].name ) );
-                    return rc;
-                }
-                
-                assert( bit_offset == 0 );
-                assert( elem_bits % 8 == 0 );
-                
-                col[ i ].base.v = base;
-                col[ i ].len = elem_count;
-            }
-        }
-    }
-    return rc;
-}
-
-struct
-{
-    KWrtWriter writer;
-    void* data;
-    KFile* kfile;
-    uint64_t pos;
-} g_out_writer = {NULL};
-
-
-static rc_t CC BufferedWriter( void *const self, char const buffer[], size_t const bufsize, size_t *const pnum_writ )
-{
-    rc_t rc = 0;
-    size_t written = 0;
-
-    assert( buffer != NULL );
-
-    while ( written < bufsize )
-    {
-        size_t n;
-
-        rc = KFileWrite( g_out_writer.kfile, g_out_writer.pos + written, &buffer[ written ], bufsize - written, &n );
-        if ( rc != 0 )
-            break;
-        written += n;
-    }
-    g_out_writer.pos += written;
-    if ( pnum_writ != NULL )
-        *pnum_writ = written;
-    return rc;
-}
-
-
-static rc_t BufferedWriterMake( bool gzip, bool bzip2 )
-{
-    rc_t rc = 0;
-
-    if ( gzip && bzip2 )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else if ( g_out_writer.writer != NULL )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else
-    {
-        rc = KFileMakeStdOut( &g_out_writer.kfile );
-        if ( rc == 0 )
-        {
-            g_out_writer.pos = 0;
-            if ( gzip )
-            {
-                KFile* gz;
-                rc = KFileMakeGzipForWrite( &gz, g_out_writer.kfile );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = gz;
-                }
-            }
-            else if ( bzip2 )
-            {
-                KFile* bz;
-                rc = KFileMakeBzip2ForWrite( &bz, g_out_writer.kfile );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = bz;
-                }
-            }
-            if ( rc == 0 )
-            {
-                KFile* buf;
-                rc = KBufFileMakeWrite( &buf, g_out_writer.kfile, false, 128 * 1024 );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = buf;
-                    g_out_writer.writer = KOutWriterGet();
-                    g_out_writer.data = KOutDataGet();
-                    rc = KOutHandlerSet( BufferedWriter, &g_out_writer );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static void BufferedWriterRelease( bool flush )
-{
-    if ( flush )
-    {
-        /* avoid flushing buffered data after failure */
-        KFileRelease( g_out_writer.kfile );
-    }
-    if ( g_out_writer.writer != NULL )
-    {
-        KOutHandlerSet( g_out_writer.writer, g_out_writer.data );
-    }
-    g_out_writer.writer = NULL;
-}
-
-
-typedef struct ReadGroup
-{
-    BSTNode node;
-    char name[ 1024 ];
-} ReadGroup;
-
-
-static int CC ReadGroup_sort( BSTNode const *item, BSTNode const *node )
-{
-    return strcmp( ( ( ReadGroup const * )item )->name, ( ( ReadGroup const * ) node )->name );
-}
-
-
-static void ReadGroup_print( char const *nm )
-{
-    if ( nm[ 0 ] != '\0' && strcasecmp( nm, "default" ) )
-    {
-        KOutMsg( "@RG\tID:%s\n", nm );
-    }
-}
-
-
-static void CC ReadGroup_dump( BSTNode *n, void *data )
-{
-    ReadGroup const *g = ( ReadGroup* )n;
-    ReadGroup_print( g->name );
-}
-
-
-static rc_t CC DumpReadGroupsScan( STable const *tbl )
-{
-    SCol cols[] =
-    {
-        { "SPOT_GROUP", 0, {NULL}, 0, false },
-        { NULL, 0, {NULL}, 0, false }
-    };
-    rc_t rc = 0;
-    BSTree tree;
-    DataSource ds;
-
-    memset( &ds, 0, sizeof( ds ) );
-    ds.cols = cols;
-
-    BSTreeInit( &tree );
-    rc = Cursor_Open( tbl, &ds.curs, ds.cols, NULL );
-    if ( rc == 0 )
-    {
-        int64_t start;
-        uint64_t count;
-
-        rc = VCursorIdRange( ds.curs.vcurs, 0, &start, &count );
-        if ( rc == 0 )
-        {
-            ReadGroup* node = NULL;
-            uint32_t last_len = 0;
-
-            while ( count > 0 && rc == 0 )
-            {
-                rc = Cursor_Read( &ds, start, 0, ~(unsigned)0 );
-                if ( rc == 0 && cols[ 0 ].len != 0 )
-                {
-                    if ( node == NULL ||
-                         last_len != cols[ 0 ].len ||
-                         strncmp( cols[ 0 ].base.str, node->name, cols[ 0 ].len ) != 0 )
-                    {
-                        node = malloc( sizeof( *node ) );
-                        if ( node == NULL )
-                        {
-                            rc = RC( rcExe, rcNode, rcConstructing, rcMemory, rcExhausted );
-                        }
-                        else if ( cols[ 0 ].len > sizeof( node->name ) )
-                        {
-                            rc = RC( rcExe, rcString, rcCopying, rcBuffer, rcInsufficient ); 
-                        }
-                        else
-                        {
-                            last_len = cols[ 0 ].len;
-                            strncpy( node->name, cols[ 0 ].base.str, last_len );
-                            node->name[ last_len ] = '\0';
-                            rc = BSTreeInsertUnique( &tree, &node->node, NULL, ReadGroup_sort );
-                            if ( GetRCState( rc ) == rcExists )
-                            {
-                                free( node );
-                                rc = 0;
-                            }
-                        }
-                    }
-                }
-                else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcRow )
-                {
-                    rc = 0;
-                }
-                start++;
-                count--;
-            }
-        }
-        Cursor_Close( &ds.curs );
-    }
-
-    if ( rc == 0 )
-    {
-        BSTreeForEach( &tree, false, ReadGroup_dump, NULL );
-    }
-    else if ( rc != KLogLastErrorCode() )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "$(f)", "f=%s", __func__ ) );
-    }
-    BSTreeWhack( &tree, NULL, NULL );
-    return rc;
-}
-
-
-rc_t CC DumpReadGroups( STable const *tbl )
-{
-    rc_t rc = 0;
-    KMetadata const *m;
-
-    /* try getting list from stats meta */
-    rc = VTableOpenMetadataRead( tbl->vtbl, &m );
-    if ( rc == 0 )
-    {
-        KMDataNode const *n;
-        rc = KMetadataOpenNodeRead( m, &n, "/STATS/SPOT_GROUP" );
-        if ( rc == 0 )
-        {
-            KNamelist* names;
-            rc = KMDataNodeListChild( n, &names );
-            if ( rc == 0 )
-            {
-                uint32_t i, q;
-                rc = KNamelistCount( names, &q );
-                if ( rc == 0 )
-                {
-                    for ( i = 0; rc == 0 && i < q; i++ )
-                    {
-                        char const *nm;
-                        rc = KNamelistGet( names, i, &nm );
-                        if ( rc == 0 )
-                        {
-                            ReadGroup_print( nm );
-                        }
-                    }
-                }
-                KNamelistRelease( names );
-            }
-            KMDataNodeRelease( n );
-        }
-        KMetadataRelease( m );
-    }
-
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        rc = DumpReadGroupsScan( tbl );
-    }
-    else if ( rc != 0 && rc != KLogLastErrorCode() )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "$(f)", "f=%s", __func__ ) );
-    }
-    return rc;
-}
-
-static rc_t Cursor_ReadAlign( SCurs const *curs, int64_t row_id, SCol* cols, uint32_t idx )
-{
-    rc_t rc = 0;
-    SCol* c = NULL;
-    SCol* mate_id = NULL;
-#if USE_MATE_CACHE
-    uint64_t cache_val = 0;
-    bool cache_miss = false;
-#endif /* USE_MATE_CACHE */
-
-    
-    for( ; rc == 0 && cols[ idx ].name != NULL; idx++ )
-    {
-        c = &cols[ idx ];
-        if ( c->idx != 0 )
-        {
-#if USE_MATE_CACHE
-            if ( mate_id != NULL && curs->cache != NULL && !cache_miss &&
-                ( idx == alg_SAM_FLAGS || idx == alg_MATE_REF_NAME || idx == alg_MATE_REF_POS || idx == alg_TEMPLATE_LEN ) &&
-                mate_id->idx && mate_id->len > 0 && mate_id->base.i64[ 0 ] > 0 )
-            {
-                if ( cache_val != 0 )
-                {
-                    continue;
-                }
-                rc = Cache_Get( curs, mate_id->base.u64[ 0 ], &cache_val );
-                if ( rc == 0 )
-                {
-                    continue;
-                }
-                else if ( !( GetRCObject( rc ) == rcItem && GetRCState( rc ) == rcNotFound ) )
-                {
-                    break;
-                }
-                else
-                {
-                    /* avoid multiple lookups in cache */
-                    cache_miss = true;
-                }
-            }
-#endif /* USE_MATE_CACHE */
-            rc = VCursorCellDataDirect( curs->vcurs, row_id, c->idx, NULL, &c->base.v, NULL, &c->len );
-            if ( rc == 0 )
-            {
-                if ( idx == alg_SEQ_SPOT_ID && ( c->len  ==0 || c->base.i64[ 0 ] == 0 ) )
-                {
-                    return RC( rcExe, rcColumn, rcReading, rcRow, rcNotFound );
-                }
-                if ( idx == alg_MATE_ALIGN_ID )
-                {
-                    mate_id = &cols[ alg_MATE_ALIGN_ID ];
-                }
-#if _DEBUGGING
-                ( ( SCurs* )curs )->col_reads_qty++;
-#endif
-            }
-        }
-        else
-        {
-            static INSDC_coord_zero readStart;
-            static INSDC_coord_len  readLen;
-            static INSDC_coord_len  cigarLen;
-            
-            switch ( (int)idx )
-            {
-            case alg_READ_START:
-                readStart = 0;
-                c->base.coord0 = &readStart;
-                c->len = 1;
-                break;
-            case alg_READ_LEN:
-                readLen = cols[ alg_READ ].len;
-                c->base.coord_len = &readLen;
-                c->len = 1;
-                break;
-            case alg_CIGAR_LEN:
-                cigarLen = cols[ alg_CIGAR ].len;
-                c->base.coord_len = &cigarLen;
-                c->len = 1;
-                break;
-            }
-        }
-    }
-
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogWarn, ( klogWarn, rc, "reading $(t) row $(r), column $(c)", "t=%s,r=%li,c=%s",
-            curs->tbl->name, row_id, c ? c->name : "<none>" ) );
-#if USE_MATE_CACHE
-    }
-    else if ( curs->cache == NULL )
-    {
-    }
-    else if ( cache_val == 0 )
-    {
-        /* this row is not from cache */
-        int64_t mate_align_id = ( mate_id != NULL && mate_id->len > 0 ) ? mate_id->base.i64[ 0 ] : 0;
-        if ( cols[ 0 ].idx != 0 && /* we have full cursor which means we are reading alignment table */
-            /* no mate -> unaligned (not secondary!) */
-            ( ( mate_align_id == 0 && param->unaligned && curs->cache != &curs->cache_local ) ||
-            /* 2nd mate with higher rowid and more than set gap rows away */
-              ( mate_align_id != 0 && mate_align_id > row_id && ( mate_align_id - row_id) > param->mate_row_gap_cachable ) ) )
-        {
-          rc = Cache_Add( row_id, curs, cols );
-        }
-	if(param->unaligned == true && mate_align_id == 0 ){
-	  rc = KVectorSetBool( curs->cache->cache_unaligned_mate, cols[alg_SEQ_SPOT_ID].base.i64[0], true );
-        }
-    }
-    else
-    {
-        Cache_Unpack( cache_val, row_id, curs, cols );
-#endif /* USE_MATE_CACHE */
-    }
-    return rc;
-}
-
-
-static void DumpName( char const *name, size_t name_len,
-                      const char spot_group_sep, char const *spot_group,
-                     size_t spot_group_len, int64_t spot_id )
-{
-    if ( param->cg_friendly_names ) {
-        KOutMsg("%.*s-1:%lu", spot_group_len, spot_group, spot_id);
-    }
-    else {
-        if ( param->name_prefix != NULL )
-        {
-            KOutMsg( "%s.", param->name_prefix );
-        }
-        BufferedWriter( NULL, name, name_len, NULL );
-        if ( param->spot_group_in_name && spot_group_len > 0 )
-        {
-            BufferedWriter( NULL, &spot_group_sep, 1, NULL );
-            BufferedWriter( NULL, spot_group, spot_group_len, NULL );
-        }
-    }
-}
-
-
-static void DumpQuality( char const quality[], unsigned const count, bool const reverse, bool const quantize )
-{
-    if ( quality == NULL )
-    {
-        unsigned i;
-
-        for ( i = 0; i < count; ++i )
-        {
-            char const newValue = ((param->qualQuant && param->qualQuantSingle)?param->qualQuantSingle:30) + 33;
-
-            BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else if ( reverse || quantize )
-    {
-        unsigned i;
-
-        for ( i = 0; i < count; ++i )
-        {
-            char const qual = quality[ reverse ? ( count - i - 1 ) : i ];
-
-            /* changed Jan 29 2013, because some runs dont have the phred_33 - type */
-            /* char const newValue = quantize ? param->qualQuant[ qual - 33 ] + 33 : qual; */
-            char const newValue = ( quantize ? param->qualQuant[ (unsigned int)qual ] : qual ) + 33 ;
-            BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else
-    {
-        /* changed Jan 29 2013, because some runs dont have the phred_33 - type */
-        /* BufferedWriter( NULL, quality, count, NULL ); */
-        unsigned i;
-        for ( i = 0; i < count; ++i )
-        {
-            char const qual = quality[ i ] + 33;
-            BufferedWriter( NULL, &qual, 1, NULL );
-        }
-    }
-}
-
-
-static void DumpQuality_33( char const quality[], unsigned const count, bool const reverse, bool const quantize )
-{
-    if ( quality == NULL )
-    {
-        unsigned i;
-
-        for ( i = 0; i < count; ++i )
-        {
-            char const newValue = ((param->qualQuant && param->qualQuantSingle)?param->qualQuantSingle:30) + 33;
-
-            BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else if ( reverse || quantize )
-    {
-        unsigned i;
-
-        for ( i = 0; i < count; ++i )
-        {
-            char const qual = quality[ reverse ? ( count - i - 1 ) : i ];
-            char const newValue = quantize ? param->qualQuant[ qual - 33 ] + 33 : qual;
-            BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else
-    {
-        BufferedWriter( NULL, quality, count, NULL );
-    }
-}
-
-
-static void DumpUnalignedFastX( const SCol cols[], uint32_t read_id, INSDC_coord_zero readStart, INSDC_coord_len readLen, int64_t row_id )
-{
-    /* fast[AQ] represnted in SAM fields:
-       [@|>]QNAME unaligned
-       SEQ
-       +
-       QUAL
-    */
-    BufferedWriter( NULL, param->fastq ? "@" : ">", 1, NULL );
-
-    /* QNAME: [PFX.]SEQUENCE:NAME[#SPOT_GROUP] */
-    DumpName( cols[ seq_NAME ].base.str, cols[ seq_NAME ].len, '#',
-              cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, row_id );
-    if ( read_id > 0 )
-    {
-        KOutMsg( "/%u", read_id );
-    }
-    BufferedWriter( NULL, " unaligned\n", 11, NULL );
-
-    /* SEQ: SEQUENCE.READ */
-    BufferedWriter( NULL, &cols[ seq_READ ].base.str[readStart], readLen, NULL );
-    if ( param->fastq )
-    {
-        /* QUAL: SEQUENCE.QUALITY */
-        BufferedWriter( NULL, "\n+\n", 3, NULL );
-        DumpQuality( &cols[ seq_QUALITY ].base.str[ readStart ], readLen, false, param->quantizeQual );
-    }
-    BufferedWriter( NULL, "\n", 1, NULL );
-}
-
-
-static void DumpAlignedFastX( const SCol cols[], int64_t const alignId, uint32_t read_id, bool primary, bool secondary )
-{
-    size_t nm;
-    unsigned readId;
-    unsigned const nreads = cols[ alg_READ_LEN ].len;
-
-    for ( readId = 0; readId < nreads; ++readId )
-    {
-        char const *qname = cols[ alg_SEQ_NAME ].base.str;
-        size_t qname_len = cols[ alg_SEQ_NAME ].len;
-        char synth_qname[ 40 ];
-	int64_t const spot_id = cols[alg_SEQ_SPOT_ID].len > 0 ? cols[alg_SEQ_SPOT_ID].base.i64[0] : 0;
-        char const *const read = cols[ alg_READ ].base.str + cols[ alg_READ_START ].base.coord0[ readId ];
-        char const *const qual = cols[ alg_SAM_QUALITY ].base.v
-                               ? cols[ alg_SAM_QUALITY ].base.str + cols[ alg_READ_START ].base.coord0[ readId ]
-                               : NULL;
-        unsigned const readlen = cols[ alg_READ_LEN ].base.coord_len[ readId ];
-
-        /* fast[AQ] represnted in SAM fields:
-           [@|>]QNAME primary|secondary ref=RNAME pos=POS mapq=MAPQ
-           SEQ
-           +
-           QUAL
-        */
-        BufferedWriter( NULL, param->fastq ? "@" : ">", 1, NULL );
-        /* QNAME: [PFX.]SEQ_NAME[#SPOT_GROUP] */
-        if ( qname_len == 0 || qname == NULL )
-        {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "%li.%u", alignId, readId + 1 );
-            qname = synth_qname;
-        }
-        nm = cols[ alg_SPOT_GROUP ].len ? alg_SPOT_GROUP : alg_SEQ_SPOT_GROUP;
-        DumpName( qname, qname_len, '.', cols[ nm ].base.str, cols[ nm ].len, spot_id);
-
-        if ( read_id > 0 )
-        {
-            KOutMsg( "/%u", read_id );
-        }
-
-        if ( primary )
-        {
-            BufferedWriter( NULL, " primary", 8, NULL );
-        }
-        else if ( secondary )
-        {
-            BufferedWriter( NULL, " secondary", 10, NULL );
-        }
-
-        /* RNAME: REF_NAME or REF_SEQ_ID */
-        BufferedWriter( NULL, " ref=", 5, NULL );
-        if ( param->use_seqid )
-        {
-            BufferedWriter( NULL, cols[ alg_REF_SEQ_ID ].base.str, cols[ alg_REF_SEQ_ID ].len, NULL );
-        }
-        else
-        {
-            BufferedWriter( NULL, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len, NULL );
-        }
-
-        /* POS: REF_POS, MAPQ: MAPQ */
-        KOutMsg( " pos=%u mapq=%i\n", cols[ alg_REF_POS ].base.coord0[ 0 ] + 1, cols[ alg_MAPQ ].base.i32[ 0 ] );
-        
-        /* SEQ: READ */
-        BufferedWriter( NULL, read, readlen, NULL );
-        if ( param->fastq )
-        {
-            /* QUAL: SAM_QUALITY */
-            BufferedWriter( NULL, "\n+\n", 3, NULL );
-            DumpQuality_33( qual, readlen, false, param->quantizeQual );
-        }
-        BufferedWriter( NULL, "\n", 1, NULL );
-    }
-}
-
-
-static
-void DumpUnalignedSAM( const SCol cols[], uint32_t flags, INSDC_coord_zero readStart, INSDC_coord_len readLen,
-                      char const *rnext, uint32_t rnext_len, INSDC_coord_zero pnext, char const readGroup[], int64_t row_id )
-{
-    unsigned i;
-
-    /* QNAME: [PFX.]NAME[.SPOT_GROUP] */
-    DumpName( cols[ seq_NAME ].base.str, cols[ seq_NAME ].len, '.',
-              cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, row_id );
-
-    /* all these fields are const text for now */
-    KOutMsg( "\t%u\t*\t0\t0\t*\t%.*s\t%u\t0\t",
-             flags, rnext_len ? rnext_len : 1, rnext_len ? rnext : "*", pnext );
-    /* SEQ: SEQUENCE.READ */
-    if ( flags & 0x10 )
-    {
-        for( i = 0; i < readLen; i++ )
-        {
-            char base;
-
-            DNAReverseCompliment( &cols[ seq_READ ].base.str[ readStart + readLen - 1 - i ], &base, 1 );
-            BufferedWriter( NULL, &base, 1, NULL );
-        }
-    }
-    else
-    {
-        BufferedWriter( NULL, &cols[ seq_READ ].base.str[ readStart ], readLen, NULL );
-    }
-
-    BufferedWriter( NULL, "\t", 1, NULL );
-    /* QUAL: SEQUENCE.QUALITY */
-    DumpQuality( &cols[ seq_QUALITY ].base.str[ readStart ], readLen, flags & 0x10, param->quantizeQual );
-
-    /* optional fields: */
-    if ( readGroup )
-    {
-        BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-        BufferedWriter( NULL, readGroup, strlen( readGroup ), NULL );
-    }
-    else if ( cols[ seq_SPOT_GROUP ].len > 0 )
-    {
-        /* read group */
-        BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-        BufferedWriter( NULL, cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, NULL );
-    }
-    BufferedWriter( NULL, "\n", 1, NULL );
-}
-
-
-static
-void DumpAlignedSAM(SAM_dump_ctx_t *const ctx,
-                    DataSource const *ds,
-                    int64_t alignId,
-                    char const readGroup[],
-                    int type)
-{
-    unsigned const nreads = ds->cols[ alg_READ_LEN ].len;
-    SCol const *const cols = ds->cols;
-    int64_t const spot_id = cols[alg_SEQ_SPOT_ID].len > 0 ? cols[alg_SEQ_SPOT_ID].base.i64[0] : 0;
-    INSDC_coord_one const read_id = cols[alg_SEQ_READ_ID].len > 0 ? cols[alg_SEQ_READ_ID].base.coord1[0] : 0;
-    INSDC_SRA_read_filter const *align_filter = cols[alg_READ_FILTER].len == nreads ? cols[alg_READ_FILTER].base.read_filter : NULL;
-    INSDC_SRA_read_filter seq_filter = 0;
-    unsigned readId;
-    unsigned cigOffset = 0;
-    
-    if (align_filter == NULL && spot_id && read_id && ctx->seq.cols) {
-        rc_t rc;
-        
-        rc = Cursor_Read(&ctx->seq, spot_id, seq_READ_FILTER, 1);
-        if (rc == 0 && ctx->seq.cols[seq_READ_FILTER].len >= read_id)
-            seq_filter = ctx->seq.cols[seq_READ_FILTER].base.read_filter[read_id - 1];
-    }
-    for ( readId = 0; readId < nreads; ++readId ) {
-        char const *qname = cols[ alg_SEQ_NAME ].base.str;
-        size_t qname_len = cols[ alg_SEQ_NAME ].len;
-        char const *const read = cols[ alg_READ ].base.str + cols[ alg_READ_START ].base.coord0[ readId ];
-        char const *const qual = cols[ alg_SAM_QUALITY ].base.v
-                               ? cols[ alg_SAM_QUALITY ].base.str + cols[ alg_READ_START ].base.coord0[ readId ]
-                               : NULL;
-        unsigned const readlen = nreads > 1 ? cols[ alg_READ_LEN ].base.coord_len[ readId ] : cols[ alg_READ ].len;
-        unsigned const sflags = cols[ alg_SAM_FLAGS ].base.v ? cols[ alg_SAM_FLAGS ].base.u32[ readId ] : 0;
-        INSDC_SRA_read_filter const filt = align_filter ? align_filter[readId] : seq_filter;
-        unsigned const flags = (sflags & ~((unsigned)0x200)) | ((filt == SRA_READ_FILTER_REJECT) ? 0x200 : 0);
-        char const *const cigar = cols[ alg_CIGAR ].base.str + cigOffset;
-        unsigned const cigLen = nreads > 1 ? cols[ alg_CIGAR_LEN ].base.coord_len[ readId ] : cols[ alg_CIGAR ].len;
-        size_t nm;
-        char synth_qname[1024];
-        
-        cigOffset += cigLen;
-        if ( qname_len == 0 || qname == NULL )
-        {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "ALLELE_%li.%u", alignId, readId + 1 );
-            qname = synth_qname;
-        }
-        else if (ds->type == edstt_EvidenceAlignment) {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "%u/ALLELE_%li.%u", spot_id, cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-            qname = synth_qname;
-        }
-        nm = cols[ alg_SPOT_GROUP ].len ? alg_SPOT_GROUP : alg_SEQ_SPOT_GROUP;
-        DumpName( qname, qname_len, '.', cols[ nm ].base.str, cols[ nm ].len, spot_id );
-
-        /* FLAG: SAM_FLAGS */
-        if (ds->type == edstt_EvidenceAlignment) {
-            bool const cmpl = cols[alg_REVERSED].base.v && readId < cols[alg_REVERSED].len ? cols[alg_REVERSED].base.tf[readId] : false;
-            
-            KOutMsg( "\t%u\t", 1 | (cmpl ? 0x10 : 0) | (read_id == 1 ? 0x40 : 0x80) );
-        }
-        else if ( !param->unaligned      /** not going to dump unaligned **/
-             && ( flags & 0x1 )     /** but we have sequenced multiple fragments **/
-             && ( flags & 0x8 ) )   /** and not all of them align **/
-        {
-            /*** remove flags talking about multiple reads **/
-            /* turn off 0x001 0x008 0x040 0x080 */
-            KOutMsg( "\t%u\t", flags & ~0xC9 );
-        }
-        else
-            KOutMsg( "\t%u\t", flags );
-        
-        if ( ds->type == edstt_EvidenceAlignment && type == 0 )
-            KOutMsg( "ALLELE_%li.%u", cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-        else
-        {
-            /* RNAME: REF_NAME or REF_SEQ_ID */
-            if ( param->use_seqid )
-                BufferedWriter( NULL, cols[ alg_REF_SEQ_ID ].base.str, cols[ alg_REF_SEQ_ID ].len, NULL );
-            else
-                BufferedWriter( NULL, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len, NULL );
-        }
-        BufferedWriter( NULL, "\t", 1, NULL );
-        
-        /* POS: REF_POS */
-        KOutMsg( "%i\t", cols[ alg_REF_POS ].base.coord0[ 0 ] + 1 );
-        /* MAPQ: MAPQ */
-        KOutMsg( "%i\t", cols[ alg_MAPQ ].base.i32[ 0 ] );
-        /* CIGAR: CIGAR_* */
-        if (ds->type == edstt_EvidenceInterval) {
-            unsigned i;
-            
-            for (i = 0; i != cigLen; ++i) {
-                char ch = cigar[i];
-                
-                if (ch == 'S')
-                    ch = 'I';
-                BufferedWriter(NULL, &ch, 1, NULL);
-            }
-        }
-        else
-            BufferedWriter( NULL, cigar, cigLen, NULL );
-        BufferedWriter( NULL, "\t", 1, NULL );
-        
-        /* RNEXT: MATE_REF_NAME or '*' */
-        /* PNEXT: MATE_REF_POS or 0 */
-        if ( cols[ alg_MATE_REF_NAME ].len )
-        {
-            if ( cols[ alg_MATE_REF_NAME ].len == cols[ alg_REF_NAME ].len &&
-                memcmp( cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len ) == 0 )
-            {
-                BufferedWriter( NULL, "=\t", 2, NULL );
-            }
-            else
-            {
-                BufferedWriter( NULL, cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len, NULL );
-                BufferedWriter( NULL, "\t", 1, NULL );
-            }
-            KOutMsg( "%u\t", cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] + 1 );
-        }
-        else
-        {
-            BufferedWriter( NULL, "*\t0\t", 4, NULL );
-        }
-        /* TLEN: TEMPLATE_LEN */
-        KOutMsg( "%i\t", cols[ alg_TEMPLATE_LEN ].base.v ? cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] : 0 );
-        /* SEQ: READ */
-        BufferedWriter( NULL, read, readlen, NULL );
-        BufferedWriter( NULL, "\t", 1, NULL );
-        /* QUAL: SAM_QUALITY */
-        DumpQuality_33( qual, readlen, false, param->quantizeQual );
-    
-        /* optional fields: */
-        if ( ds->type == edstt_EvidenceInterval )
-        {
-            KOutMsg( "\tRG:Z:ALLELE_%u", readId + 1 );
-        }
-        if ( readGroup )
-        {
-            BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-            BufferedWriter( NULL, readGroup, strlen( readGroup ), NULL );
-        }
-        else if ( cols[ alg_SPOT_GROUP ].len > 0 )
-        {
-            /* read group */
-            BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-            BufferedWriter( NULL, cols[ alg_SPOT_GROUP ].base.str, cols[ alg_SPOT_GROUP ].len, NULL );
-        }
-        else if ( cols[ alg_SEQ_SPOT_GROUP ].len > 0 )
-        {
-            /* backward compatibility */
-            BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-            BufferedWriter( NULL, cols[ alg_SEQ_SPOT_GROUP ].base.str, cols[ alg_SEQ_SPOT_GROUP ].len, NULL );
-        }
-        if ( param->cg_style > 0 && cols[ alg_CG_TAGS_STR ].len > 0 )
-        {
-            BufferedWriter( NULL, cols[ alg_CG_TAGS_STR ].base.str, cols[ alg_CG_TAGS_STR ].len, NULL );
-        }
-
-        if ( param->cg_style > 0 && cols[ alg_ALIGN_GROUP ].len > 0 )
-        {
-            char const *ZI = cols[ alg_ALIGN_GROUP ].base.str;
-            unsigned i;
-            
-            for ( i = 0; i < cols[ alg_ALIGN_GROUP ].len - 1; ++i )
-            {
-                if ( ZI[ i ] == '_' )
-                {
-                    KOutMsg( "\tZI:i:%.*s\tZA:i:%.1s", i, ZI, ZI + i + 1 );
-                    break;
-                }
-            }
-        }
-        else if ( ds->type == edstt_EvidenceAlignment && type == 1 )
-            KOutMsg( "\tZI:i:%li\tZA:i:%u", cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-
-        /* align id */
-        if ( param->xi )
-            KOutMsg( "\tXI:i:%li", alignId );
-
-        /* hit count */
-        if (cols[alg_ALIGNMENT_COUNT].len)
-            KOutMsg( "\tNH:i:%i", (int)cols[ alg_ALIGNMENT_COUNT ].base.u8[ readId ] );
-
-        /* edit distance */
-        if ( cols[ alg_EDIT_DISTANCE ].len )
-            KOutMsg( "\tNM:i:%i", cols[ alg_EDIT_DISTANCE ].base.i32[ readId ] );
-
-        KOutMsg( "\n" );
-    }
-}
-
-
-static rc_t DumpUnalignedReads( SAM_dump_ctx_t *const ctx, SCol const calg_col[], int64_t row_id, uint64_t* rcount )
-{
-    rc_t rc = 0;
-    uint32_t i, nreads = 0;
-
-    if ( calg_col != NULL )
-    {
-        if ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x02 )
-        {
-            /* skip all aligned rows by flag */
-            return rc;
-        }
-        /* get primary alignments only */
-        rc = Cursor_Read( &ctx->seq, calg_col[ alg_SEQ_SPOT_ID ].base.i64[ 0 ], seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-        if ( rc == 0 )
-        {
-            for ( i = 0; i < ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len; i++ )
-            {
-                if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] != 0 )
-                {
-                    if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] < row_id )
-                    {
-                        /* unaligned were printed with 1st aligment */
-                        return rc;
-                    }
-                }
-                else
-                {
-                    nreads++;
-                }
-            }
-            if ( nreads == ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len )
-            {
-                /* skip all aligned rows by actual data, if flag above is not set properly */
-                return rc;
-            }
-            row_id = calg_col[ alg_SEQ_SPOT_ID ].base.i64[ 0 ];
-        }
-    }
-    if ( rc == 0 )
-    {
-        rc = Cursor_Read( &ctx->seq, row_id, 0, ~(unsigned)0 );
-        if ( rc == 0 )
-        {
-            unsigned non_empty_reads = 0;
-            
-            nreads = ctx->seq.cols[ seq_READ_LEN ].idx != 0 ? ctx->seq.cols[ seq_READ_LEN ].len : 1;
-
-            for( i = 0; i < nreads; i++ ) {
-                unsigned const readLen = ctx->seq.cols[ seq_READ_LEN ].idx
-                                       ? ctx->seq.cols[ seq_READ_LEN ].base.coord_len[ i ]
-                                       : 0;
-                
-                if (readLen)
-                    ++non_empty_reads;
-            }
-            for( i = 0; i < nreads; i++ )
-            {
-                INSDC_coord_zero readStart;
-                INSDC_coord_len readLen;
-
-                if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].idx != 0 && 
-                     ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] != 0 )
-                {
-                    continue;
-                }
-
-                if ( ctx->seq.cols[ seq_READ_TYPE ].idx != 0 && 
-                     !( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i ] & SRA_READ_TYPE_BIOLOGICAL ) )
-                {
-                    continue;
-                }
-
-                readLen = ctx->seq.cols[ seq_READ_LEN ].idx ? 
-                            ctx->seq.cols[ seq_READ_LEN ].base.coord_len[ i ] :
-                            ctx->seq.cols[ seq_READ ].len;
-                if ( readLen == 0 )
-                {
-                    continue;
-                }
-
-                readStart = ctx->seq.cols[ seq_READ_START ].idx ?
-                                ctx->seq.cols[ seq_READ_START ].base.coord0[ i ] :
-                                0;
-                if ( param->fasta || param->fastq )
-                {
-                    DumpUnalignedFastX( ctx->seq.cols, nreads > 1 ? i + 1 : 0, readStart, readLen, row_id );
-                }
-                else
-                {
-                    uint32_t cflags = 0x4;
-                    if ( param->reverse_unaligned )
-                    {
-                        if ( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i ] & SRA_READ_TYPE_REVERSE )
-                        {
-                            cflags |= 0x10;
-                        }
-                        if ( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i == nreads - 1 ? 0 : ( i + 1 ) ] & SRA_READ_TYPE_REVERSE )
-                        {
-                            cflags |= 0x20;
-                        }
-                    }
-                    if ( ctx->seq.cols[ seq_READ_FILTER ].idx != 0 )
-                    {
-                        if ( ctx->seq.cols[ seq_READ_FILTER ].base.read_filter[ i ] == SRA_READ_FILTER_REJECT )
-                        {
-                            cflags |= 0x200;
-                        }
-                        else if ( ctx->seq.cols[ seq_READ_FILTER ].base.read_filter[ i ] == SRA_READ_FILTER_CRITERIA )
-                        {
-                            cflags |= 0x400;
-                        }
-                    }
-                    if ( calg_col == NULL )
-                    {
-                        DumpUnalignedSAM( ctx->seq.cols, cflags |
-                                          ( non_empty_reads > 1 ? ( 0x1 | 0x8 | ( i == 0 ? 0x40 : 0x00 ) | ( i == nreads - 1 ? 0x80 : 0x00 ) ) : 0x00 ),
-                                          readStart, readLen, NULL, 0, 0, ctx->readGroup, row_id );
-                    }
-                    else
-                    {
-                        int c = param->use_seqid ? alg_REF_SEQ_ID : alg_REF_NAME;
-                        uint16_t flags = cflags | 0x1 |
-                                         ( ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x10 ) << 1 ) |
-                                         ( ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x40 ) ? 0x80 : 0x40 );
-                        DumpUnalignedSAM( ctx->seq.cols, flags, readStart, readLen,
-                                          calg_col[ c ].base.str, calg_col[ c ].len,
-                                          calg_col[ alg_REF_POS ].base.coord0[ 0 ] + 1, ctx->readGroup, row_id );
-                    }
-                }
-                *rcount = *rcount + 1;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static bool AlignRegionFilter( SCol const *cols )
-{
-    if ( param->region_qty == 0 )
-        return true;
-    if ( cols[ alg_REF_NAME ].len != 0 || cols[ alg_REF_SEQ_ID ].len != 0 )
-    {
-        unsigned i;
-
-        assert( cols[ alg_REF_POS ].len == cols[ alg_REF_LEN ].len );
-
-        for ( i = 0; i < param->region_qty; i++ )
-        {
-            unsigned j;
-            
-            for ( j = 0; j < cols[ alg_REF_POS ].len; j++ )
-            {
-                unsigned const refStart_zero = cols[ alg_REF_POS ].base.coord0[ j ];
-                unsigned const refEnd_exclusive = refStart_zero + cols[ alg_REF_LEN ].base.coord_len[ j ];
-                unsigned k;
-                
-                for ( k = 0; k < param->region[ i ].rq; k++ )
-                {
-                    unsigned const from_zero = param->region[ i ].r[ k ].from;
-                    unsigned const to_inclusive = param->region[ i ].r[ k ].to;
-                    
-                    if ( from_zero < refEnd_exclusive && refStart_zero <= to_inclusive )
-                        return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-
-static bool AlignDistanceFilter( SCol const *cols )
-{
-    if ( param->mp_dist_qty != 0 || param->mp_dist_unknown )
-    {
-        if ( cols[ alg_TEMPLATE_LEN ].len == 0 && param->mp_dist_unknown )
-        {
-            return true;
-        }
-        else
-        {
-            uint32_t i, j;
-            for( i = 0; i < param->mp_dist_qty; i++ )
-            {
-                for( j = 0; j < cols[ alg_TEMPLATE_LEN ].len; j++ )
-                {
-                    if ( ( cols[ alg_TEMPLATE_LEN ].base.i32[ j ] == 0 && param->mp_dist_unknown ) ||
-                         ( param->mp_dist[ i ].from <= cols[ alg_TEMPLATE_LEN ].base.i32[ j ] &&
-                         cols[ alg_TEMPLATE_LEN ].base.i32[ j ] <= param->mp_dist[ i ].to ) )
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-    return true;
-}
-
-
-typedef struct cgOp_s
-{
-    uint16_t length;
-    uint8_t type; /* 0: match, 1: insert, 2: delete */
-    char code;
-} cgOp;
-
-
-static void print_CG_cigar( int line, cgOp const op[], unsigned const ops, unsigned const gap[ 3 ] )
-{
-#if _DEBUGGING
-    unsigned i;
-    
-    SAM_DUMP_DBG( 3, ( "%5i: ", line ) );
-    for ( i = 0; i < ops; ++i )
-    {
-        if ( gap && ( i == gap[ 0 ] || i == gap[ 1 ] || i == gap[ 2 ] ) )
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, tolower( op[ i ].code ) ) );
-        }
-        else
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, toupper( op[ i ].code ) ) );
-        }
-    }
-    SAM_DUMP_DBG( 3, ( "\n" ) );
-#endif
-}
-
-/* gap contains the indices of the wobbles in op
- * gap[0] is between read 1 and 2; it is the 'B'
- * gap[1] is between read 2 and 3; it is an 'N'
- * gap[2] is between read 3 and 4; it is an 'N'
- */
-
-static rc_t CIGAR_to_CG_Ops( cgOp op[], unsigned const maxOps,
-                             unsigned *const opCnt,
-                             unsigned gap[ 3 ],
-                             char const cigar[], unsigned const ciglen,
-                             unsigned *const S_adjust,
-                             unsigned *const CG_adjust,
-                             unsigned const read,
-                             bool const reversed )
-{
-    unsigned i;
-    unsigned ops = 0;
-    unsigned gapno;
-
-    *opCnt = 0;
-    *S_adjust = 0;
-    for ( i = 0; i < ciglen; ++ops )
-    {
-        char opChar=0;
-        int opLen=0;
-        int n;
-
-	for(n=0;n+i<ciglen && isdigit(cigar[n+i]);n++){
-		opLen = opLen * 10 + cigar[n+i] - '0';
-	}
-	if(n+i<ciglen){
-		opChar = cigar[n+i];
-		n++;
-	}
-        if ( ops + 1 >= maxOps )
-            return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-
-        i += n;
-        
-        op[ ops ].length = opLen;
-        op[ ops ].code = opChar;
-        switch ( opChar )
-        {
-        case 'M':
-        case '=':
-        case 'X':
-            op[ ops ].type = 0;
-            break;
-        case 'S':
-            *S_adjust += opLen;
-        case 'I':
-            op[ ops ].type = 1;
-            op[ ops ].code = 'I';
-            break;
-        case 'D':
-            op[ ops ].type = 2;
-            break;
-        default:
-            return RC( rcExe, rcData, rcReading, rcConstraint, rcViolated );
-        }
-    }
-    *opCnt = ops;
-    gap[ 0 ] = gap[ 1 ] = gap[ 2 ] = ops;
-    print_CG_cigar( __LINE__, op, ops, NULL );
-    if ( ops < 3 )
-        return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-
-    {
-        unsigned fwd = 0; /* 5 10 10 10 */
-        unsigned rev = 0; /* 10 10 10 5 */
-        unsigned acc; /* accumulated length */
-        
-        if ( ( read == 1 && !reversed ) || ( read == 2 && reversed ) )
-        {
-            for ( i = 0, acc = 0; i < ops  && acc <=5; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const right = acc - 5;
-                        unsigned const left = op[ i ].length - right;
-                        
-                        memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                        ops += 2;
-                        op[ i ].length = left;
-                        op[ i + 2 ].length = right;
-                        
-                        op[ i + 1 ].type = 1;
-                        op[ i + 1 ].code = 'B';
-                        op[ i + 1 ].length = 0;
-                        
-                        fwd = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else if ( ( read == 2 && !reversed ) || ( read == 1 && reversed ) )
-        {
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i ].type == 1 )
-                    {
-                        rev = i;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const left = acc - 5;
-                        unsigned const right = op[ i ].length - left;
-                        
-                        memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                        ops += 2;
-                        op[ i ].length = left;
-                        op[ i + 2 ].length = right;
-                        
-                        op[ i + 1 ].type = 1;
-                        op[ i + 1 ].code = 'B';
-                        op[ i + 1 ].length = 0;
-                         
-                        rev = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else
-        {
-            /* fprintf(stderr, "guessing layout\n"); */
-            for ( i = 0, acc = 0; i < ops  && acc <= 5; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                    }
-                }
-            }
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[i].type == 1 )
-                    {
-                        rev = i;
-                    }
-                }
-            }
-            if ( ( fwd == 0 && rev == 0 ) || ( fwd != 0 && rev != 0 ) )
-            {
-                for ( i = 0; i < ops; ++i )
-                {
-                    if ( op[ i ].type == 2 )
-                    {
-                        op[ i ].code = 'N';
-                        *CG_adjust += op[ i ].length;
-                    }
-                }
-                return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-            }
-        }
-        if ( fwd && op[ fwd ].type == 1 )
-        {
-            for ( i = ops, acc = 0; i > fwd + 1; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const r = 10 + op[ i ].length - acc;
-                            unsigned const l = op[ i ].length - r;
-                            
-                            if ( ops + 2 >= maxOps )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                            ops += 2;
-                            op[ i + 2 ].length = r;
-                            op[ i ].length = l;
-                            
-                            op[ i + 1 ].length = 0;
-                            op[ i + 1 ].type = 2;
-                            op[ i + 1 ].code = 'N';
-                            i += 2;
-                        }
-                        else if ( i - 1 > fwd )
-                        {
-                            if ( op[ i - 1 ].type == 2 )
-                                 op[ i - 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= maxOps )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &op[ i + 1 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                                ops += 1;
-                                op[ i ].length = 0;
-                                op[ i ].type = 2;
-                                op[ i ].code = 'N';
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            /** change I to B+M **/
-            op[ fwd ].code = 'B';
-            memmove( &op[ fwd + 1 ], &op[ fwd ], ( ops - fwd ) * sizeof( op[ 0 ] ) );
-            ops += 1;
-            op[ fwd + 1 ].code = 'M';
-            *opCnt = ops;
-            /** set the gaps now **/
-            for ( gapno = 3, i = ops; gapno > 1 && i > 0; )
-            {
-                --i;
-                if ( op[ i ].code == 'N' )
-                    gap[ --gapno ] = i;
-            }
-            gap[ 0 ] = fwd;
-            print_CG_cigar( __LINE__, op, ops, gap );
-            return 0;
-        }
-        if ( rev && op[ rev ].type == 1 )
-        {
-            for ( acc = i = 0; i < rev; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const l = 10 + op[ i ].length - acc;
-                            unsigned const r = op[ i ].length - l;
-                            
-                            if ( ops + 2 >= maxOps )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                            ops += 2;
-                            op[ i + 2 ].length = r;
-                            op[ i ].length = l;
-                            
-                            op[ i + 1 ].length = 0;
-                            op[ i + 1 ].type = 2;
-                            op[ i + 1 ].code = 'N';
-                            rev += 2;
-                            i += 2;
-                        }
-                        else if ( i + 1 < rev )
-                        {
-                            if ( op[ i + 1 ].type == 2)
-                                 op[ i + 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= maxOps )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &op[ i + 1 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                                ops += 1;
-                                op[ i + 1 ].length = 0;
-                                op[ i + 1 ].type = 2;
-                                op[ i + 1 ].code = 'N';
-                                rev += 1;
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            for ( gapno = 3, i = 0; gapno > 1 && i < ops; ++i )
-            {
-                if ( op[ i ].code == 'N' )
-                    gap[ --gapno ] = i;
-            }
-            gap[ 0 ] = rev;
-            op[ rev ].code = 'B';
-            memmove( &op[ rev + 1 ], &op[ rev ], ( ops - rev ) * sizeof( op[ 0 ] ) );
-            ops += 1;
-            op[ rev + 1 ].code = 'M';
-            *opCnt = ops;
-            print_CG_cigar( __LINE__, op, ops, gap );
-            return 0;
-        }
-    }
-    return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-}
-
-
-static rc_t GenerateCGData( SCol cols[], unsigned style )
-{
-    rc_t rc = 0;
-    
-    memset( &cols[ alg_CG_TAGS_STR], 0, sizeof( cols[ alg_CG_TAGS_STR ] ) );
-    
-    if ( cols[ alg_READ ].len == 35 && cols[ alg_SAM_QUALITY ].len == 35 )
-    {
-        static char newCIGAR[ 35 * 11 ];
-        static int32_t newEditDistance;
-        unsigned gap[ 3 ] = { 0, 0, 0 };
-        cgOp cigOp[ 35 ];
-        unsigned opCnt;
-        unsigned i;
-        unsigned j;
-        size_t sz;
-        unsigned S_adjust = 0;
-        unsigned CG_adjust = 0;
-        unsigned const read = cols[ alg_SEQ_READ_ID ].len && cols[ alg_REVERSED ].len ? cols[ alg_SEQ_READ_ID ].base.coord1[ 0 ] : 0;
-        bool const reversed = cols[ alg_REVERSED ].len ? cols[ alg_REVERSED ].base.u8[ 0 ] : false;
-        
-        rc = CIGAR_to_CG_Ops( cigOp, sizeof( cigOp ) / sizeof( cigOp[ 0 ] ), &opCnt, gap,
-                              cols[ alg_CIGAR ].base.str, cols[ alg_CIGAR ].len,
-                              &S_adjust, &CG_adjust, read, reversed );
-        if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcFormat )
-        {
-            rc = 0;
-            if ( style == 1 )
-                goto CLEAN_CIGAR;
-            else
-                goto PRINT_CIGAR;
-        }
-        if ( rc != 0 )
-            return 0;
-
-        if ( CG_adjust == 0 )
-            CG_adjust = ( gap[ 0 ] < opCnt ? cigOp[ gap[ 0 ] ].length : 0 )
-                      + ( gap[ 1 ] < opCnt ? cigOp[ gap[ 1 ] ].length : 0 )
-                      + ( gap[ 2 ] < opCnt ? cigOp[ gap[ 2 ] ].length : 0 );
-
-        print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-        if ( style == 1 )
-        {
-            static char newSeq[ 35 ];
-            static char newQual[ 35 ];
-            static char tags[ 35*22 + 1 ];
-            unsigned const B_len = cigOp[ gap[ 0 ] ].length;
-            unsigned const B_at = gap[ 0 ] < gap[ 2 ] ? 5 : 30;
-            
-            if ( 0 < B_len && B_len < 5 )
-            {
-                memcpy( newSeq, cols[ alg_READ ].base.v, 35 );
-                memcpy( newQual, cols[ alg_SAM_QUALITY ].base.v, 35 );
-                
-                cols[ alg_CG_TAGS_STR ].base.v = tags;
-                
-                cols[ alg_READ ].base.v = newSeq;
-                cols[ alg_READ ].len = 35 - B_len;
-                
-                cols[ alg_SAM_QUALITY ].base.v = newQual;
-                cols[ alg_SAM_QUALITY ].len = 35 - B_len;
-                
-                /* nBnM -> nB0M */
-                cigOp[ gap[ 0 ] + 1 ].length -= B_len;
-                if ( gap[ 0 ] < gap[ 2 ] )
-                {
-                    rc = string_printf( tags, sizeof( tags ), &sz, "\tGC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                        5 - B_len, B_len, 30 - B_len, 2 * B_len, &newSeq[ 5 - B_len ], 2 * B_len, &newQual[ 5 - B_len ] );
-                    if ( rc == 0 )
-                    {
-                        cols[ alg_CG_TAGS_STR ].len = sz;
-                    }
-                    memmove( &cigOp[ gap[ 0 ] ],
-                             &cigOp[ gap[ 0 ] + 1 ],
-                             ( opCnt - ( gap[ 0 ] + 1 ) ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-                else
-                {
-                    rc = string_printf( tags, sizeof( tags ), &sz, "\tGC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                        30 - B_len, B_len, 5 - B_len, 2 * B_len, &newSeq[ 30 - B_len ], 2 * B_len, &newQual[ 30 - B_len ] );
-                    if ( rc == 0 )
-                    {
-                        cols[ alg_CG_TAGS_STR ].len = sz;
-                    }
-                    memmove( &cigOp[ gap[ 0 ] ],
-                             &cigOp[ gap[ 0 ] + 1 ],
-                             ( opCnt - ( gap[ 0 ] + 1 ) ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-                if ( rc == 0 )
-                {
-                    for ( i = B_at; i < B_at + B_len; ++i )
-                    {
-                        int const Lq = newQual[ i - B_len ];
-                        int const Rq = newQual[ i ];
-
-                        if ( Lq <= Rq )
-                        {
-                            newSeq[ i - B_len ] = newSeq[ i ];
-                            newQual[ i - B_len ] = Rq;
-                        }
-                        else
-                        {
-                            newSeq[ i ] = newSeq[ i - B_len ];
-                            newQual[ i ] = Lq;
-                        }
-                    }
-                    memmove( &newSeq [ B_at ], &newSeq [ B_at + B_len ], 35 - B_at - B_len );
-                    memmove( &newQual[ B_at ], &newQual[ B_at + B_len ], 35 - B_at - B_len );
-                }
-            }
-            else
-            {
-                int len = cigOp[ gap[ 0 ] ].length;
-                
-                cigOp[ gap[ 0 ] ].code = 'I';
-                for (i = gap[0] + 1; i < opCnt && len > 0; ++i) {
-                    if (cigOp[i].length <= len){
-                        len -= cigOp[i].length;
-                        cigOp[i].length = 0;
-                    }
-                    else {
-                        cigOp[i].length -= len;
-                        len = 0;
-                    }
-                }
-                CG_adjust -= cigOp[ gap[ 0 ] ].length;
-            }
-        }
-        if ( rc == 0 )
-        {
-        PRINT_CIGAR:
-        CLEAN_CIGAR:
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            /* remove zero length ops */
-            for ( j = i = 0; i < opCnt; )
-            {
-                if ( cigOp[ j ].length == 0)
-                {
-                    ++j;
-                    --opCnt;
-                    continue;
-                }
-                cigOp[ i++ ] = cigOp[ j++ ];
-            }
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            if ( cols[ alg_EDIT_DISTANCE ].len )
-            {
-                int const edit_distance = cols[ alg_EDIT_DISTANCE ].base.i32[ 0 ];
-                int const adjusted = edit_distance + S_adjust - CG_adjust;
-            
-                newEditDistance = adjusted > 0 ? adjusted : 0;
-                SAM_DUMP_DBG( 4, ( "NM: before: %u, after: %u(+%u-%u)\n", edit_distance, newEditDistance, S_adjust, CG_adjust ) );
-                cols[ alg_EDIT_DISTANCE ].base.v = &newEditDistance;
-                cols[ alg_EDIT_DISTANCE ].len = 1;
-            }
-            /* merge adjacent ops */
-            for ( i = opCnt; i > 1; )
-            {
-                --i;
-                if ( cigOp[ i - 1 ].code == cigOp[ i ].code )
-                {
-                    cigOp[ i - 1 ].length += cigOp[ i ].length;
-                    memmove( &cigOp[ i ], &cigOp[ i + 1 ], ( opCnt - 1 - i ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-            }
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            for ( i = j = 0; i < opCnt && rc == 0; ++i )
-            {
-                rc = string_printf( &newCIGAR[ j ], sizeof( newCIGAR ) - j, &sz, "%u%c", cigOp[ i ].length, cigOp[ i ].code);
-                j += sz;
-            }
-            cols[ alg_CIGAR ].base.v = newCIGAR;
-            cols[ alg_CIGAR ].len = j;
-        }
-    }
-    return rc;
-}
-
-
-static bool DumpAlignedRow( SAM_dump_ctx_t *const ctx, DataSource *const ds,
-                    int64_t row,
-                    bool const primary,
-                    int const cg_style,
-                    rc_t *prc )
-{
-    rc_t rc;
-    
-    /* if SEQ_SPOT_ID is open then skip rows with no SEQ_SPOT_ID */
-    if ( ds->cols[ alg_SEQ_SPOT_ID ].idx )
-    {
-        rc = Cursor_Read( ds, row, alg_SEQ_SPOT_ID, 1 );
-        if ( rc != 0 )
-        {
-            if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-                *prc = rc;
-            return false;
-        }
-        if ( ds->cols[ alg_SEQ_SPOT_ID ].len == 0 ||
-             ds->cols[ alg_SEQ_SPOT_ID ].base.i64[ 0 ] == 0 )
-            return false;
-    }
-
-    /* skip rows that fail mate distance filter */
-    if ( param->mp_dist_qty != 0 || param->mp_dist_unknown )
-    {
-        rc = Cursor_Read( ds, row, alg_TEMPLATE_LEN, 1 );
-        if ( rc != 0 )
-        {
-            if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-                *prc = rc;
-            return false;
-        }
-        if ( !AlignDistanceFilter( ds->cols ) )
-            return false;
-    }
-
-    rc = Cursor_ReadAlign( &ds->curs, row, ds->cols, 0 );
-    if ( rc != 0 )
-    {
-        if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-            *prc = rc;
-        return false;
-    }
-
-    if ( param->fasta || param->fastq )
-    {
-        unsigned const read_id = ds->cols[ alg_SEQ_READ_ID ].base.v ? ds->cols[ alg_SEQ_READ_ID ].base.coord1[ 0 ] : 0;
-        
-        DumpAlignedFastX( ctx->pri.cols, row, read_id, primary, false );
-    }
-    else
-    {
-        if ( cg_style != 0 )
-        {
-            rc = GenerateCGData( ds->cols, cg_style );
-            if ( rc != 0 )
-            {
-                *prc = rc;
-                return false;
-            }
-        }
-        DumpAlignedSAM(ctx, ds, row, ctx->readGroup, 0 );
-    }
-    *prc = 0;
-    return true;
-}
-
-
-static rc_t DumpAlignedRowList( SAM_dump_ctx_t *const ctx, DataSource *const ds, SCol const *const ids,
-                        int64_t *rcount,
-                        bool const primary,
-                        int const cg_style,
-                        bool const noFilter )
-{
-    rc_t rc;
-    unsigned i;
-    unsigned const n = ids->len;
-
-    for ( i = 0; ( rc = Quitting() ) == 0 && i < n; ++i )
-    {
-        int64_t const row = ids->base.i64[ i ];
-
-        if ( ! noFilter )
-            rc = Cursor_Read( ds, row, alg_REGION_FILTER, ~(unsigned)0 );
-
-        if ( rc == 0 )
-        {
-            if ( noFilter || AlignRegionFilter(ds->cols) )
-            {
-                if ( DumpAlignedRow( ctx, ds, row, primary, cg_style, &rc ) )
-                    ++*rcount;
-                if ( rc != 0 )
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t DumpAlignedRowListIndirect( SAM_dump_ctx_t *const ctx,
-                                DataSource *const indirectSource,
-                                DataSource *const directSource,
-                                SCol const *const directIDs,
-                                int64_t *rcount,
-                                bool const primary,
-                                int const cg_style )
-{
-    unsigned i;
-
-    for ( i = 0; i < directIDs->len; ++i )
-    {
-        int64_t const row = directIDs->base.i64[ i ];
-        rc_t rc = Cursor_Read( directSource, row, alg_REGION_FILTER, ~(unsigned)0 );
-        
-        if ( rc != 0 )
-            return rc;
-        
-        if ( !AlignRegionFilter( directSource->cols ) )
-            continue;
-            
-        rc = Cursor_Read( directSource, row, alg_EVIDENCE_ALIGNMENT_IDS, 1 );
-        if ( rc != 0 )
-            return rc;
-        
-        rc = DumpAlignedRowList( ctx, indirectSource, &directSource->cols[ alg_EVIDENCE_ALIGNMENT_IDS ],
-                                 rcount, primary, cg_style, true );
-        if ( rc != 0 )
-            return rc;
-    }
-    return 0;
-}
-
-
-enum e_tables
-{
-    primary_alignment,
-    secondary_alignment,
-    evidence_interval,
-    evidence_alignment
-};
-
-enum e_IDS_opts
-{
-    primary_IDS             = ( 1 << primary_alignment ),
-    secondary_IDS           = ( 1 << secondary_alignment ),
-    evidence_interval_IDS   = ( 1 << evidence_interval ),
-    evidence_alignment_IDS  = ( 1 << evidence_alignment )
-};
-
-
-static rc_t DumpAlignedRowList_cb( SAM_dump_ctx_t *const ctx, TAlignedRegion const *const rgn,
-                                   int options, int which, int64_t *rcount, SCol const *const IDS )
-{
-    /*SAM_DUMP_DBG(2, ("row %s index range is [%lu:%lu] pos %lu\n",
-        param->region[r].name, start, start + count - 1, cur_pos));*/
-    switch ( which )
-    {
-    case primary_IDS:
-        return DumpAlignedRowList( ctx, &ctx->pri, IDS, rcount, true, param->cg_style, false );
-
-    case secondary_IDS:
-        return DumpAlignedRowList( ctx, &ctx->sec, IDS, rcount, false, param->cg_style, false );
-
-    case evidence_interval_IDS:
-        {
-            rc_t rc = 0;
-
-            if ( ( options & evidence_interval_IDS ) != 0 )
-                rc = DumpAlignedRowList( ctx, &ctx->evi, IDS, rcount, true, 0, false );
-
-            if ( rc == 0 && ( options & evidence_alignment_IDS ) != 0 )
-                rc = DumpAlignedRowListIndirect( ctx, &ctx->eva, &ctx->evi, IDS, rcount, true, param->cg_style );
-
-            return rc;
-        }
-    }
-    return RC( rcExe, rcTable, rcReading, rcParam, rcUnexpected );
-}
-
-
-typedef struct CigOps{
-	char op;
-	int8_t	 ref_sign; /*** 0;+1;-1; ref_offset = ref_sign * offset ***/
-	int8_t	 seq_sign; /*** 0;+1;-1; seq_offset = seq_sign * offset ***/
-	uint32_t oplen;
-} CigOps;
-
-static void SetCigOp(CigOps *dst,char op,uint32_t oplen)
-{
-	dst->op    = op;
-	dst->oplen = oplen;
-	switch(op) { /*MX= DN B IS PH*/
-	 case 'M': case 'X': case '=':
-		dst->ref_sign=+1;
-		dst->seq_sign=+1;
-		break;
-	 case 'D': case 'N':
-		dst->ref_sign=+1;
-                dst->seq_sign= 0;
-                break;
-	 case 'B': 
-		dst->ref_sign=-1;
-                dst->seq_sign= 0;
-                break;
-	 case 'S': case 'I':
-		dst->ref_sign= 0;
-                dst->seq_sign=+1;
-                break;
-	 case 'P': case 'H':
-	  case 0: /** terminating op **/
-		dst->ref_sign= 0;
-                dst->seq_sign= 0;
-                break;
-	  default:
-		assert(0);
-                break;
-	}
-}
-
-static unsigned ExplodeCIGAR( CigOps dst[], unsigned len, char const cigar[], unsigned ciglen )
-{
-    unsigned i;
-    unsigned j;
-    int opLen;
-    
-    for ( i = j = opLen=0; i < ciglen; i++) {
-	if(isdigit(cigar[i])){
-		opLen = opLen * 10 + cigar[i] - '0';
-	} else {
-		assert(isalpha(cigar[i]));
-		SetCigOp(dst+j,cigar[i],opLen);
-		opLen=0;
-		j++;
-	}
-    }
-    SetCigOp(dst+j,0,0);
-    j++;
-    return j;
-}
-
-
-#define CG_CIGAR_STRING_MAX (35 * 11 + 1)
-
-
-#if 0
-static unsigned FormatCIGAR( char dst[], unsigned cp, unsigned oplen, int opcode )
-{
-    size_t sz;
-    string_printf( dst + cp, CG_CIGAR_STRING_MAX - cp, &sz, "%u%c", oplen, opcode );
-    return sz;
-}
-
-
-static unsigned DeletedCIGAR( char dst[], unsigned const cp, int opcode, unsigned D,
-                              uint32_t const Op[], int ri, unsigned len )
-{
-    unsigned i;
-    unsigned curPos = 0;
-    int curOp = opcode;
-    unsigned oplen = 0;
-    
-    for ( i = 0; i < D && ri < len; ++i, ++ri )
-    {
-        uint32_t const op = Op[ ri ];
-        int const d = op >> 2;
-        int const m = op & 1;
-        int const nxtOp = m ? opcode : 'P';
-        
-        if ( d != 0 )
-        {
-            if ( oplen != 0 )
-                curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-            curPos += FormatCIGAR( dst, cp, d, 'D' );
-            oplen = 0;
-        }
-        if ( oplen == 0 || nxtOp == curOp )
-        {
-            ++oplen;
-        }
-        else
-        {
-            curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-            oplen = 1;
-        }
-        curOp = nxtOp;
-    }
-
-    if ( oplen != 0 && curOp != opcode)
-    {
-        curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-        oplen = 0;
-    }
-    if ( i < D )
-        oplen += D - i;
-    if ( oplen )
-        curPos += FormatCIGAR( dst, curPos + cp, oplen, opcode );
-    return curPos;
-}
-#endif
-
-static char merge_M_type_ops(char a,char b)
-{ /*MX=*/
-	char c=0;
-	switch(b){
-	 case 'X':
-		switch(a){
-		 case '=': c='X'; break;
-		 case 'X': c='M'; break; /**we don't know - 2X may create '=' **/
-		 case 'M': c='M'; break;
-		}
-		break;
-	 case 'M':
-		c='M';
-		break;
-	 case '=':
-		c=a;
-		break;
-	}
-	assert(c!=0);
-	return c;
-}
-
-
-static unsigned CombineCIGAR( char dst[], CigOps const seqOp[], unsigned seq_len,
-                              int refPos, CigOps const refOp[], unsigned ref_len )
-{
-    bool     done=false;
-    unsigned ciglen=0,last_ciglen=0;
-    char     last_cig_op;
-    uint32_t last_cig_oplen=0;
-    int	     si=0,ri=0;
-    CigOps   seq_cop={0,0,0,0},ref_cop={0,0,0,0};
-    int	     seq_pos=0; /** seq_pos is tracked roughly - with every extraction from seqOp **/
-    int      ref_pos=0; /** ref_pos is tracked precisely - with every delta and consumption in cigar **/
-    int	     delta=refPos; /*** delta in relative positions of seq and ref **/
-			   /*** when delta < 0 - rewind or extend the reference ***/
-			   /*** wher delta > 0 - skip reference  ***/
-#define MACRO_BUILD_CIGAR(OP,OPLEN) \
-	if( last_cig_oplen > 0 && last_cig_op == OP){							\
-                last_cig_oplen += OPLEN;								\
-                ciglen = last_ciglen + sprintf(dst+last_ciglen,"%d%c",last_cig_oplen,last_cig_op);	\
-        } else {											\
-                last_ciglen = ciglen;									\
-                last_cig_oplen = OPLEN;									\
-                last_cig_op    = OP;									\
-                ciglen = ciglen      + sprintf(dst+last_ciglen,"%d%c",last_cig_oplen,last_cig_op);	\
-        }
-    while(!done){
-	while(delta < 0){ 
-		ref_pos += delta; /** we will make it to back up this way **/
-		if(ri > 0){ /** backing up on ref if possible ***/
-			int avail_oplen = refOp[ri-1].oplen - ref_cop.oplen;
-			if(avail_oplen > 0 ){
-				if((-delta) <= avail_oplen * ref_cop.ref_sign){ /*** rewind within last operation **/
-					ref_cop.oplen -= delta;
-					delta -= delta * ref_cop.ref_sign;
-				} else { /*** rewind the whole ***/
-					ref_cop.oplen += avail_oplen;
-					delta += avail_oplen * ref_cop.ref_sign;
-				}
-			} else {
-				ri--;
-				/** pick the previous as used up **/
-				ref_cop = refOp[ri-1];
-				ref_cop.oplen =0; 
-			}
-		} else { /** extending the reference **/
-			SetCigOp(&ref_cop,'=',ref_cop.oplen - delta);
-			delta = 0;
-		}
-		ref_pos -= delta; 
-	}
-	if(ref_cop.oplen == 0){ /*** advance the reference ***/
-		ref_cop = refOp[ri++];
-		if(ref_cop.oplen == 0) { /** extending beyond the reference **/
-			SetCigOp(&ref_cop,'=',1000);
-		}
-		assert(ref_cop.oplen > 0 );
-	}
-	if(delta > 0){ /***  skip refOps ***/
-		ref_pos += delta; /** may need to back up **/
-		if(delta >=  ref_cop.oplen){ /** full **/
-			delta -= ref_cop.oplen * ref_cop.ref_sign;
-			ref_cop.oplen = 0;
-		} else { /** partial **/
-			ref_cop.oplen -= delta;
-			delta -= delta * ref_cop.ref_sign;
-		}
-		ref_pos -= delta; /** if something left - restore ***/
-		continue;
-	}
-	/*** seq and ref should be synchronized here **/
-	assert(delta == 0);
-	if(seq_cop.oplen == 0){ /*** advance sequence ***/
-		if(seq_pos < seq_len){
-			seq_cop = seqOp[si++];
-			assert(seq_cop.oplen > 0 );
-			seq_pos += seq_cop.oplen * seq_cop.seq_sign;
-		} else {
-			done=true;
-		}
-	}
-        if(!done){
-		int seq_seq_step = seq_cop.oplen * seq_cop.seq_sign; /** sequence movement**/
-		int seq_ref_step = seq_cop.oplen * seq_cop.ref_sign; /** influence of sequence movement on intermediate reference **/
-		int ref_seq_step = ref_cop.oplen * ref_cop.seq_sign; /** movement of the intermediate reference ***/
-		int ref_ref_step = ref_cop.oplen * ref_cop.ref_sign; /** influence of the intermediate reference movement on final reference ***/
-		assert( ref_ref_step >= 0); /** no B in the reference **/
-		if( seq_ref_step <= 0){ /** BSIPH in the sequence against anything ***/
-			MACRO_BUILD_CIGAR( seq_cop.op, seq_cop.oplen );
-			seq_cop.oplen = 0;
-			delta = seq_ref_step; /** if negative - will force rewind next cycle **/
-		} else if(ref_ref_step <= 0){ /** MX=DN against SIPH in the reference***/
-			if(ref_seq_step == 0){ /** MX=DN against PH **/
-				MACRO_BUILD_CIGAR( ref_cop.op,ref_cop.oplen);
-				ref_cop.oplen = 0;
-			} else {
-				int min_len = (seq_cop.oplen<ref_cop.oplen)?seq_cop.oplen:ref_cop.oplen;
-				if(seq_seq_step == 0){ /** DN agains SI **/
-					MACRO_BUILD_CIGAR('P',min_len);
-				} else { /** MX= agains SI ***/
-					MACRO_BUILD_CIGAR( ref_cop.op,min_len);
-				}
-				seq_cop.oplen -= min_len;
-				ref_cop.oplen -= min_len;
-			}
-		} else { /*MX=DN  against MX=DN*/
-			int min_len = (seq_cop.oplen<ref_cop.oplen)?seq_cop.oplen:ref_cop.oplen;
-			if(seq_seq_step == 0){ /* DN against MX=DN */
-				if(ref_seq_step == 0){ /** padding DN against DN **/
-					MACRO_BUILD_CIGAR('P',min_len);
-					ref_cop.oplen -= min_len;
-					seq_cop.oplen -= min_len;
-				} else { /* DN against MX= **/
-					MACRO_BUILD_CIGAR(seq_cop.op,min_len);
-					seq_cop.oplen -= min_len;
-				}
-			} else if (ref_cop.seq_sign == 0){ /* MX= against DN - always wins */
-				MACRO_BUILD_CIGAR(ref_cop.op,min_len);
-				ref_cop.oplen -= min_len;
-			} else { /** MX= against MX= ***/
-				MACRO_BUILD_CIGAR(merge_M_type_ops(seq_cop.op,ref_cop.op),min_len);
-				ref_cop.oplen -= min_len;
-				seq_cop.oplen -= min_len;
-			}
-			ref_pos += min_len;
-		}
-        }
-    }
-    return ciglen;
-}
-
-
-static rc_t DumpCGSAM( SAM_dump_ctx_t *const ctx, TAlignedRegion const *const rgn, int options,
-                       int which, int64_t *rows, SCol const *const ids )
-{
-    if ( which == evidence_interval_IDS )
-    {
-        rc_t rc = 0;
-        unsigned i;
-        
-        for ( i = 0; i < ids->len; ++i )
-        {
-            int64_t const rowInterval = ids->base.i64[ i ];
-
-            rc = Cursor_Read( &ctx->evi, rowInterval, alg_REGION_FILTER, ~(0u) );
-            if ( rc == 0 )
-            {
-                if ( AlignRegionFilter( ctx->evi.cols ) )
-                {
-                    rc = Cursor_ReadAlign( &ctx->evi.curs, rowInterval, ctx->evi.cols, 0 );
-                    if ( rc == 0 )
-                    {
-                        unsigned const evidence = ctx->evi.cols[ alg_EVIDENCE_ALIGNMENT_IDS ].len;
-                        if ( evidence != 0 )
-                        {
-                            INSDC_coord_len const *const refLen = ctx->evi.cols[ alg_READ_LEN ].base.coord_len;
-                            INSDC_coord_len const *const cigLen = ctx->evi.cols[ alg_CIGAR_LEN ].base.coord_len;
-                            unsigned const ploids = ctx->evi.cols[ alg_CIGAR_LEN ].len;
-                            unsigned const totalIntervalReadLen = ctx->evi.cols[ alg_READ ].len;
-			    CigOps  refCigOps_stack[1024];
-			    CigOps *refCigOps_heap=NULL;
-                            CigOps *refCigOps;
-
-			    if( totalIntervalReadLen > 1000){
-				refCigOps=refCigOps_heap = malloc( sizeof( refCigOps[ 0 ] ) * (totalIntervalReadLen+ploids) );
-			    } else {
-				refCigOps=refCigOps_stack;
-			    }
-                            
-                            if ( refCigOps != NULL )
-                            {
-                                unsigned j;
-                                unsigned start;
-                                unsigned cigop_starts[256];
-                                
-                                assert(ploids < 256);
-                                
-                                for ( start = j = 0, cigop_starts[0]=0; j < ploids; ++j )
-                                {
-                                    unsigned len = cigLen[ j ];
-                                    cigop_starts[j+1] = cigop_starts[j] + ExplodeCIGAR( refCigOps + cigop_starts[j], refLen[ j ], 
-                                                                                       ctx->evi.cols[ alg_CIGAR ].base.str + start, len );
-                                    start += len;
-                                }
-                                
-                                for ( j = 0; j < evidence; ++j )
-                                {
-                                    int64_t const rowAlign = ctx->evi.cols[ alg_EVIDENCE_ALIGNMENT_IDS ].base.i64[ j ];
-                                    
-                                    rc = Cursor_ReadAlign( &ctx->eva.curs, rowAlign, ctx->eva.cols, 0 );
-                                    if ( rc == 0 )
-                                    {
-                                        if(param->cg_style != 0)
-                                            rc = GenerateCGData( ctx->eva.cols, param->cg_style );
-                                        if ( rc == 0 )
-                                        {
-                                            int const ploidy = ctx->eva.cols[ alg_REF_PLOIDY ].base.u32[ 0 ];
-                                            int const readLen = ctx->eva.cols[ alg_READ ].len;
-                                            INSDC_coord_zero refPos = ctx->eva.cols[ alg_REF_POS ].base.coord0[ 0 ];
-                                            CigOps op[ 36 ];
-                                            char cigbuf[ CG_CIGAR_STRING_MAX ];
-                                            
-                                            memset( cigbuf, 0, CG_CIGAR_STRING_MAX );
-                                            ExplodeCIGAR( op, readLen, ctx->eva.cols[ alg_CIGAR ].base.str,
-                                                         ctx->eva.cols[ alg_CIGAR ].len );
-                                            ctx->eva.cols[ alg_CIGAR ].len = CombineCIGAR( cigbuf, op, readLen, refPos, 
-                                                                                          refCigOps + cigop_starts[ ploidy - 1 ], refLen[ ploidy - 1 ] );
-                                            ctx->eva.cols[ alg_CIGAR ].base.str = cigbuf;
-                                            ctx->eva.cols[ alg_REF_POS ].base.v = &refPos;
-                                            refPos += ctx->evi.cols[ alg_REF_POS ].base.coord0[ 0 ] ;
-			  		    if(refPos < 0){
-						ReferenceObj const *r = NULL;
-    						rc = ReferenceList_Find( gRefList, &r,
-									ctx->evi.cols[ alg_REF_NAME ].base.str,
-									ctx->evi.cols[ alg_REF_NAME ].len );
-						if(rc == 0){
-							bool circular=false;
-							rc=ReferenceObj_Circular(r, &circular);
-							if(rc == 0 && circular){
-								INSDC_coord_len len;
-								rc=ReferenceObj_SeqLength(r,&len);
-								if(rc == 0)
-									refPos += len;
-							}
-							ReferenceObj_Release(r);
-						}
-					    }
-                                            DumpAlignedSAM(ctx, &ctx->eva, rowAlign, ctx->readGroup, 1);
-                                            ++*rows;
-                                        }
-                                        else
-                                            break;
-                                    }
-                                    else
-                                        break;
-                                }
-				if(refCigOps_heap) free( refCigOps_heap );
-                            }
-                            else
-                                rc = RC( rcExe, rcTable, rcReading, rcMemory, rcExhausted );
-                        }
-                    }
-                }
-            }
-            else
-                break;
-            rc = rc ? rc : Quitting();
-            if ( rc != 0 )
-                break;
-        }
-        return rc;
-    }
-    return RC( rcExe, rcTable, rcReading, rcParam, rcUnexpected );
-}
-
-
-static rc_t ForEachAlignedRegion( SAM_dump_ctx_t *const ctx, enum e_IDS_opts const Options,
-    rc_t ( *user_func )( SAM_dump_ctx_t *ctx, TAlignedRegion const *rgn, int options, int which, int64_t *rows, SCol const *IDS ) )
-{
-    SCol cols[] =
-    {
-        { "MAX_SEQ_LEN", 0, { NULL }, 0, false },
-        { "OVERLAP_REF_POS", 0, { NULL }, 0, true },
-        { "PRIMARY_ALIGNMENT_IDS", 0, { NULL }, 0, false },
-        { "SECONDARY_ALIGNMENT_IDS", 0, { NULL }, 0, true },
-        { "EVIDENCE_INTERVAL_IDS", 0, { NULL }, 0, true }, 
-        { NULL, 0, { NULL }, 0, false }
-    };
-    enum eref_col
-    {
-        ref_MAX_SEQ_LEN = 0,
-        ref_OVERLAP_REF_LEN,
-        ref_PRIMARY_ALIGNMENT_IDS,
-        ref_SECONDARY_ALIGNMENT_IDS,
-        ref_EVIDENCE_INTERVAL_IDS
-    };
-
-    KIndex const *iname = NULL;
-    int64_t rows = 0;
-    rc_t rc = 0;
-    int options = Options & 7;
-
-    if ( Options & evidence_alignment_IDS )
-        options |= evidence_interval_IDS;
-
-    if ( ( options & primary_IDS ) == 0 )
-        cols[ ref_PRIMARY_ALIGNMENT_IDS ].name = "";
-    if ( ( options & secondary_IDS ) == 0 )
-        cols[ ref_SECONDARY_ALIGNMENT_IDS ].name = "";
-    if ( ( options & evidence_interval_IDS ) == 0 )
-        cols[ ref_EVIDENCE_INTERVAL_IDS ].name = "";
-    
-    ctx->ref.cols = cols;
-    
-    rc = VTableOpenIndexRead( ctx->ref.tbl.vtbl, &iname, "i_name" );
-    if ( rc == 0 )
-    {
-        rc = Cursor_Open( &ctx->ref.tbl, &ctx->ref.curs, ctx->ref.cols, NULL );
-        if ( rc == 0 )
-        {
-            int64_t rowid = 1;
-            uint64_t count = 0;
-            char refname[ 1024 ];
-            size_t sz;
-            
-            if ( ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS ].idx == 0 )
-                options &= ~primary_IDS;
-            if ( ctx->ref.cols[ ref_SECONDARY_ALIGNMENT_IDS ].idx == 0 )
-                options &= ~secondary_IDS;
-            if ( ctx->ref.cols[ ref_EVIDENCE_INTERVAL_IDS ].idx == 0 )
-                options &= ~evidence_interval_IDS;
-
-            /* new: if we have a list of regions, reset the their print-flag */
-            if ( param->region_qty > 0 )
-            {
-                unsigned r;
-                for ( r = 0; r < param->region_qty; ++r )
-                {
-                    param->region[ r ].printed = 0;
-                }
-            }
-
-            while ( ( rc = KIndexProjectText(iname, rowid + count, &rowid, &count, refname, sizeof( refname ), &sz ) ) == 0 )
-            {
-                bool include;
-                unsigned r;
-                unsigned max_to = UINT_MAX;
-                unsigned min_from = 0;
-                
-                for ( include = false, r = 0; r < param->region_qty; ++r )
-                {
-                    if ( sz == strlen( param->region[ r ].name ) &&
-                         memcmp( param->region[ r ].name, refname, sz ) == 0 )
-                    {
-                        include = true;
-                        max_to = param->region[ r ].max_to;
-                        min_from = param->region[ r ].min_from;
-                        param->region[ r ].printed++; /* new: mark a region as printed */
-                        break;
-                    }
-                }
-
-                if ( param->region_qty == 0 || include )
-                {
-                    int64_t const endrow_exclusive = rowid + count;
-                    unsigned m;
-                    unsigned k;
-                    
-                    for ( k = 0, m = 1; rc == 0 && k < 3; ++k, m <<= 1 )
-                    {
-                        if ( m & options )
-                        {
-                            unsigned lookback = 0;
-                            int64_t row;
-                            int32_t row_start_offset;
-                            unsigned pos;
-			    unsigned const maxseqlen = 5000; /***** TODO: this code is to be rewritten anyway ****/
-                            
-                            if ( param->region_qty )
-                            {
-                                if ( ctx->ref.cols[ ref_OVERLAP_REF_LEN ].idx )
-                                {
-                                    rc = Cursor_Read( &ctx->ref, rowid, 0, ~(0u) );
-                                    if ( rc != 0 )
-                                        break;
-                                    if ( ctx->ref.cols[ ref_OVERLAP_REF_LEN ].len > k )
-                                    {
-                                        unsigned const overlap = ctx->ref.cols[ ref_OVERLAP_REF_LEN ].base.coord0[ k ];
-                                        
-                                        if ( overlap != 0 )
-                                        {
-                                            
-                                            assert( overlap < rowid * maxseqlen );
-                                            lookback = ( rowid - ( overlap / maxseqlen ) );
-                                        }
-                                    }
-                                }
-                                else
-                                    lookback = 1;
-                            }
-			    row_start_offset = min_from/maxseqlen - lookback;
-			   if(row_start_offset < 0) row_start_offset=0;
-			    
-
-                            for ( pos = row_start_offset*maxseqlen, row = rowid + row_start_offset; rc == 0 && row < endrow_exclusive; ++row )
-                            {
-                                if ( row < 1 )
-                                {
-                                    row = 0;
-                                    continue;
-                                }
-                                rc = Cursor_Read( &ctx->ref, row, 0, ~(0u) );
-                                if ( rc != 0 )
-                                    break;
-                                if ( ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS + k ].len > 0 )
-                                    rc = user_func( ctx, &param->region[r], Options, m, &rows,
-                                                    &ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS + k ] );
-                                pos += ctx->ref.cols[ ref_MAX_SEQ_LEN ].base.u32[ 0 ];
-                                if ( pos >= max_to )
-                                    break;
-                                if ( param->test_rows != 0 && rows > param->test_rows )
-                                    break;
-                            }
-                        }
-                    }
-                }
-                if ( param->test_rows != 0 && rows > param->test_rows )
-                    break;
-                if ( rc != 0 )
-                    break;
-            } /* while */
-
-            /* new: walk the list of regions and report what was NOT printed ( found ) ... */
-            if ( param->region_qty > 0 && GetRCState( rc ) != rcCanceled )
-            {
-                unsigned r;
-                for ( r = 0; r < param->region_qty; ++r )
-                {
-                    if ( param->region[ r ].printed == 0 )
-                    {
-                        (void)PLOGMSG( klogWarn, ( klogWarn, "reference >$(a)< not found", "a=%s", param->region[ r ].name ) );
-                    }
-                }
-            }
-
-            if ( GetRCObject( rc ) == rcId && GetRCState( rc ) == rcNotFound )
-            {
-                rc = 0;
-            }
-
-        }
-    }
-    Cursor_Close( &ctx->ref.curs );
-    KIndexRelease( iname );
-    
-    return rc;
-}
-
-
-static rc_t DumpAlignedTable( SAM_dump_ctx_t *const ctx, DataSource *const ds,
-                              bool const primary, int const cg_style, unsigned *const rcount )
-{
-    unsigned i;
-    int64_t start;
-    uint64_t count;
-    rc_t rc = VCursorIdRange( ds->curs.vcurs, 0, &start, &count );
-    
-    if ( rc != 0 )
-        return rc;
-    for ( i = 0; i != (unsigned)count; ++i )
-    {
-        if ( DumpAlignedRow(ctx, ds, start + i, primary, cg_style, &rc ) )
-            ++*rcount;
-        if ( rc != 0 || ( rc = Quitting() ) != 0 )
-            return rc;
-        if ( param->test_rows && *rcount > param->test_rows )
-            break;
-    }
-    return 0;
-}
-
-
-static rc_t DumpUnsorted( SAM_dump_ctx_t *const ctx )
-{
-    rc_t rc = 0;
-    unsigned rcount;
-    
-    if ( rc == 0 && param->cg_evidence )
-    {
-        SAM_DUMP_DBG( 2, ( "%s EVIDENCE_INTERVAL\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->evi, false, 0, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) allele sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && param->cg_ev_dnb )
-    {
-        SAM_DUMP_DBG( 2, ( "%s EVIDENCE_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->eva, false, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) support sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && ctx->pri.curs.vcurs )
-    {
-        SAM_DUMP_DBG( 2, ( "%s PRIMARY_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->pri, true, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) primary sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && ctx->sec.curs.vcurs )
-    {
-        SAM_DUMP_DBG( 2, ( "%s SECONDARY_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->sec, false, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) secondary sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    return rc;
-}
-
-
-static rc_t DumpUnaligned( SAM_dump_ctx_t *const ctx, bool const aligned )
-{
-    rc_t rc = 0;
-    int64_t start = 0;
-    uint64_t count = 0;
-
-    rc = VCursorIdRange( ctx->seq.curs.vcurs, 0, &start, &count );
-    if ( rc == 0 )
-    {
-        uint64_t rcount = 0;
-        if ( param->test_rows != 0 && count > param->test_rows )
-        {
-            count = param->test_rows;
-        }
-        SAM_DUMP_DBG( 2, ( "%s SEQUENCE table range from %ld qty %lu\n", ctx->accession, start, count ) );
-        while ( count > 0 && rc == 0 )
-        {
-            uint32_t i;
-
-            if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].idx == 0)
-            {
-                rc = DumpUnalignedReads( ctx, NULL, start, &rcount );
-            }
-            else
-            {
-                /* avoid reading whole sequence cursor data unnecessarily */
-                rc = Cursor_Read( &ctx->seq, start, seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-                if ( rc == 0 )
-                {
-                    /* find if its completely unaligned */
-                    int64_t min_prim_id = 0;
-                    bool has_unaligned = false;
-                    for ( i = 0; rc == 0 && i < ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len; i++ )
-                    {
-                        int64_t x = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ];
-                        has_unaligned |= x == 0;
-                        if ( ( min_prim_id == 0 && x != 0 ) || min_prim_id < x )
-                        {
-                            min_prim_id = x;
-                        }
-                    }
-                    if ( min_prim_id == 0 )
-                    {
-                        /* fully unaligned spot */
-                        rc = DumpUnalignedReads( ctx, NULL, start, &rcount );
-                    }
-                    else if ( has_unaligned && !param->unaligned_spots )
-                    {
-                        if ( rc == 0 )
-                        {
-#if USE_MATE_CACHE
-                            uint64_t val;
-                            rc = Cache_Get( &ctx->pri.curs, min_prim_id, &val );
-                            if ( rc == 0 )
-                            {
-                                ctx->pri.cols[ alg_REF_POS ].len = 0;
-                                Cache_Unpack( val, 0, &ctx->pri.curs, ctx->pri.cols );
-                                ctx->pri.cols[ alg_SEQ_SPOT_ID ].base.i64 = &start;
-                                ctx->pri.cols[ alg_SEQ_SPOT_ID ].len = 1;
-                                memcpy( &ctx->pri.cols[ alg_REF_NAME ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-                                memcpy( &ctx->pri.cols[ alg_REF_SEQ_ID ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-                                memcpy( &ctx->pri.cols[ alg_REF_POS ], &ctx->pri.cols[ alg_MATE_REF_POS ], sizeof( SCol ) );
-                            }
-                            else if ( !( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcItem ) )
-                            {
-                                break;
-                            }
-                            else
-                            {
-#endif /* USE_MATE_CACHE */
-                                rc = Cursor_ReadAlign( &ctx->pri.curs, min_prim_id, ctx->pri.cols, alg_MATE_ALIGN_ID );
-#if USE_MATE_CACHE
-                            }
-#endif /* USE_MATE_CACHE */
-                            rc = rc ? rc : DumpUnalignedReads( ctx, ctx->pri.cols, min_prim_id, &rcount );
-                        }
-                    }
-                } else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcRow )
-                {
-                    rc = 0;
-                }
-            }
-            start++;
-            count--;
-            rc = rc ? rc : Quitting();
-        }
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) unaligned sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    return rc;
-}
-
-#if USE_MATE_CACHE
-static rc_t FlushUnalignedRead_cb (uint64_t key, bool value,void *user_data)
-{
-	rc_t rc;
-	int64_t spot_id = (int64_t) key;
-	int64_t aligned_mate_id = (int64_t) value;
-	SAM_dump_ctx_t *const ctx = user_data;
-	rc = Cursor_Read( &ctx->seq, spot_id, seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-	if ( rc == 0 ) {
-		uint64_t rcount;
-		uint64_t val;
-		assert(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len == 2);
-		if(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[0]==0){
-			aligned_mate_id = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[1];
-			assert(aligned_mate_id != 0);
-		} else if(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[1] == 0){
-			aligned_mate_id = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[0];
-			assert(aligned_mate_id != 0);
-		} else {
-			assert(0);
-		}
-                rc = Cache_Get( &ctx->pri.curs, aligned_mate_id, &val );
-                if ( rc == 0 ) {
-			ctx->pri.cols[ alg_REF_POS ].len = 0;
-			Cache_Unpack( val, 0, &ctx->pri.curs, ctx->pri.cols );
-			ctx->pri.cols[ alg_SEQ_SPOT_ID ].base.i64 = &spot_id;
-			ctx->pri.cols[ alg_SEQ_SPOT_ID ].len = 1;
-			memcpy( &ctx->pri.cols[ alg_REF_NAME ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-			memcpy( &ctx->pri.cols[ alg_REF_SEQ_ID ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-			memcpy( &ctx->pri.cols[ alg_REF_POS ], &ctx->pri.cols[ alg_MATE_REF_POS ], sizeof( SCol ) );
-			rc =DumpUnalignedReads( ctx, ctx->pri.cols, aligned_mate_id, &rcount );
-		}
-	}
-        return rc;
-}
-static rc_t FlushUnaligned( SAM_dump_ctx_t *const ctx, const SCursCache * cache )
-{
-    return KVectorVisitBool (cache->cache_unaligned_mate, false, FlushUnalignedRead_cb, ctx );
-}
-#endif
-
-static rc_t DumpHeader( SAM_dump_ctx_t const *ctx )
-{
-    bool reheader = param->reheader;
-    rc_t rc = 0;
-    
-    if ( !reheader )
-    {
-        if ( ctx->db )
-        {
-            /* grab header from db meta node */
-            KMetadata const *meta;
-            
-            rc = VDatabaseOpenMetadataRead( ctx->db, &meta );
-            if ( rc == 0 )
-            {
-                KMDataNode const *node;
-                
-                rc = KMetadataOpenNodeRead( meta, &node, "BAM_HEADER" );
-                KMetadataRelease( meta );
-                
-                if ( rc == 0 )
-                {
-                    size_t offset = 0;
-                    
-                    for ( offset = 0; ; )
-                    {
-                        size_t remain;
-                        size_t nread;
-                        char buffer[ 4096 ];
-                        
-                        rc = KMDataNodeRead( node, offset, buffer, sizeof(buffer), &nread, &remain );
-                        if ( rc != 0 )
-                            break;
-                        BufferedWriter( NULL, buffer, nread, NULL );
-                        if ( remain == 0 )
-                        {
-                            if ( buffer[nread - 1] != '\n' )
-                            {
-                                 buffer[ 0 ] = '\n';
-                                 BufferedWriter( NULL, buffer, 1, NULL );
-                            }
-                            break;
-                        }
-                        offset += nread;
-                    }
-                    KMDataNodeRelease(node);
-                }
-                else if ( GetRCState( rc ) == rcNotFound )
-                {
-                    reheader = true;
-                    rc = 0;
-                }
-            }
-        }
-        else
-        {
-            reheader = true;
-            rc = 0;
-        }
-    }
-
-    if ( rc == 0 && reheader )
-    {
-        KOutMsg( "@HD\tVN:1.3\n" );
-        if ( gRefList )
-            rc = RefSeqPrint();
-        if ( ctx->readGroup )
-            ReadGroup_print( ctx->readGroup );
-        if ( ctx->seq.tbl.vtbl )
-            rc = DumpReadGroups( &ctx->seq.tbl );
-    }
-    if ( rc == 0 && param->comments )
-    {
-        unsigned i;
-        
-        for( i = 0; param->comments[ i ]; ++i )
-            KOutMsg( "@CO\t%s\n", param->comments[ i ] );
-    }
-    return rc;
-}
-
-
-static rc_t DumpDB( SAM_dump_ctx_t *const ctx )
-{
-    rc_t rc = 0;
-
-    if ( ctx->ref.tbl.vtbl != NULL )
-        rc = ReferenceList_MakeTable( &gRefList, ctx->ref.tbl.vtbl, 0, CURSOR_CACHE, NULL, 0 );
-    if ( !param->noheader )
-        rc = DumpHeader( ctx );
-    if ( rc == 0 )
-    {
-        if ( param->region_qty ){
-            rc = ForEachAlignedRegion(  ctx
-                                      ,   ( param->primaries   ? primary_IDS : 0 )
-                                        | ( param->secondaries ? secondary_IDS : 0 )
-                                        | ( param->cg_evidence ? evidence_interval_IDS : 0 )
-                                        | ( param->cg_ev_dnb   ? evidence_alignment_IDS : 0 )
-                                      , DumpAlignedRowList_cb );
-#if USE_MATE_CACHE
-	    if ( rc == 0 && param->unaligned ){
-                rc = FlushUnaligned( ctx,ctx->pri.curs.cache);
-	    }
-#endif
-	}
-        if ( param->cg_sam )
-            rc = ForEachAlignedRegion( ctx, evidence_interval_IDS, DumpCGSAM );
-
-        if ( param->region_qty == 0 )
-        {
-            rc = DumpUnsorted( ctx );
-            if ( rc == 0 && param->unaligned )
-                rc = DumpUnaligned( ctx, ctx->pri.tbl.vtbl != NULL );
-        }
-    }
-    ReferenceList_Release( gRefList );
-    return rc;
-}
-
-
-static rc_t DumpTable( SAM_dump_ctx_t *ctx )
-{
-    rc_t rc = 0;
-
-    if ( !param->noheader )
-        rc = DumpHeader( ctx );
-    if ( rc == 0 )
-        rc = DumpUnaligned( ctx, false );
-    return rc;
-}
-
-
-static rc_t ProcessTable( VDBManager const *mgr, char const fullPath[],
-                          char const accession[], char const readGroup[] )
-{
-    VTable const *tbl;
-    rc_t rc = VDBManagerOpenTableRead( mgr, &tbl, 0, fullPath );
-    
-    if ( rc != 0 )
-    {
-        VSchema *schema;
-        
-        rc = VDBManagerMakeSRASchema( mgr, &schema );
-        if ( rc == 0 )
-        {
-            rc = VDBManagerOpenTableRead( mgr, &tbl, schema, fullPath );
-            VSchemaRelease( schema );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        SAM_dump_ctx_t ctx;
-        SCol seq_cols[ sizeof( gSeqCol ) / sizeof( gSeqCol[ 0 ] ) ];
-        
-        memset( &ctx, 0, sizeof( ctx ) );
-        
-        ctx.fullPath = fullPath;
-        ctx.accession = accession;
-        ctx.readGroup = readGroup;
-        
-        DATASOURCE_INIT( ctx.seq, accession );
-        ctx.seq.tbl.vtbl = tbl;
-        ctx.seq.type = edstt_Sequence;
-        
-        ReportResetTable( fullPath, tbl );
-
-        ctx.seq.cols = seq_cols;
-        memcpy( ctx.seq.cols, gSeqCol, sizeof( gSeqCol ) );
-        rc = Cursor_Open( &ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL );
-        if ( rc == 0 ) {
-            rc = DumpTable( &ctx );
-            Cursor_Close(&ctx.seq.curs);
-        }
-        VTableRelease( tbl );
-    }
-    return rc;
-}
-
-
-static void SetupColumns( DataSource *ds, enum eDSTableType type )
-{
-    memcpy( ds->cols, g_alg_col_tmpl, sizeof( g_alg_col_tmpl ) );
-    
-    ds->type = type;
-    if ( param->use_seqid )
-        ds->cols[ alg_MATE_REF_NAME ].name = "MATE_REF_SEQ_ID";
-    else
-        ds->cols[ alg_MATE_REF_NAME ].name = "MATE_REF_NAME";
-    
-    if ( param->fasta || param->fastq )
-        ds->cols[ alg_READ ].name = "RAW_READ";
-    else if ( param->hide_identical )
-        ds->cols[ alg_READ ].name = "MISMATCH_READ";
-    else
-        ds->cols[ alg_READ ].name = "READ";
-    
-    if ( param->long_cigar )
-    {
-        ds->cols[ alg_CIGAR ].name = "CIGAR_LONG";
-        ds->cols[ alg_CIGAR_LEN ].name = "CIGAR_LONG_LEN";
-    }
-    else
-    {
-        ds->cols[ alg_CIGAR ].name = "CIGAR_SHORT";
-        ds->cols[ alg_CIGAR_LEN ].name = "CIGAR_SHORT_LEN";
-    }
-
-    if(param->qualQuant && param->qualQuantSingle){ /** we don't really need quality ***/
-	ds->cols[ alg_SAM_QUALITY   ].name = "";
-    }
-    
-    switch ( type )
-    {
-    case edstt_EvidenceInterval:
-	
-        ds->cols[ alg_SEQ_SPOT_ID   ].name = "";
-        ds->cols[ alg_SEQ_NAME      ].name = "";
-        ds->cols[ alg_SAM_QUALITY   ].name = "";
-        ds->cols[ alg_SPOT_GROUP    ].name = "";
-        ds->cols[ alg_SEQ_SPOT_GROUP].name = "";
-        ds->cols[ alg_SEQ_READ_ID   ].name = "";
-        ds->cols[ alg_MATE_ALIGN_ID ].name = "";
-        ds->cols[ alg_MATE_REF_ID   ].name = "";
-        ds->cols[ alg_MATE_REF_NAME ].name = "";
-        ds->cols[ alg_SAM_FLAGS     ].name = "";
-        ds->cols[ alg_MATE_REF_POS  ].name = "";
-        ds->cols[ alg_ALIGN_GROUP   ].name = "";
-        ds->cols[ alg_TEMPLATE_LEN  ].name = "";
-        if ( param->cg_sam || param->cg_ev_dnb )
-            ds->cols[ alg_EVIDENCE_ALIGNMENT_IDS ].name = "EVIDENCE_ALIGNMENT_IDS";
-        break;
-
-    case edstt_EvidenceAlignment:
-        ds->cols[ alg_REF_PLOIDY    ].name = "REF_PLOIDY";
-        ds->cols[ alg_REF_ID        ].name = "REF_ID";
-        ds->cols[ alg_MATE_ALIGN_ID ].name = "";
-        ds->cols[ alg_MATE_REF_ID   ].name = "";
-        ds->cols[ alg_MATE_REF_NAME ].name = "";
-        ds->cols[ alg_SAM_FLAGS     ].name = "";
-        ds->cols[ alg_MATE_REF_POS  ].name = "";
-        ds->cols[ alg_ALIGN_GROUP   ].name = "";
-        ds->cols[ alg_TEMPLATE_LEN  ].name = "";
-        break;
-    default:
-        break;
-    }
-}
-
-
-static rc_t ProcessDB( VDatabase const *db, char const fullPath[],
-                       char const accession[], char const readGroup[] )
-{
-    char const *const refTableName = (   param->region_qty > 0
-                                      || param->cg_evidence
-                                      || param->cg_ev_dnb
-                                      || param->cg_sam
-                                      || param->reheader
-                                      || param->primaries
-                                      || param->secondaries
-                                     )
-                                   ? "REFERENCE"
-                                   : 0;
-    char const *const priTableName = param->primaries   ? "PRIMARY_ALIGNMENT" : 0;
-    char const *const secTableName = param->secondaries ? "SECONDARY_ALIGNMENT" : 0;
-    char const *const seqTableName = ( param->unaligned || param->reheader ) ? "SEQUENCE" : 0;
-    char const *const eviTableName = ( param->cg_evidence || ( param->cg_ev_dnb & ( param->region_qty > 0 ) ) || param->cg_sam ) ? "EVIDENCE_INTERVAL" : 0;
-    char const *const evaTableName = ( param->cg_ev_dnb   || param->cg_sam ) ? "EVIDENCE_ALIGNMENT" : 0;
-    
-    SAM_dump_ctx_t ctx;
-    SCol align_cols[ ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) * 4 ];
-    SCol seq_cols[ sizeof( gSeqCol ) / sizeof( gSeqCol[ 0 ] ) ];
-    rc_t rc = 0;
-    
-    memset( &ctx, 0, sizeof( ctx ) );
-    memset( align_cols, 0, sizeof( align_cols ) );
-    memset( seq_cols, 0, sizeof( seq_cols ) );
-    
-    ctx.db = db;
-    ctx.fullPath = fullPath;
-    ctx.accession = accession;
-    ctx.readGroup = readGroup;
-    
-    DATASOURCE_INIT( ctx.seq, seqTableName );
-    DATASOURCE_INIT( ctx.ref, refTableName );
-    DATASOURCE_INIT( ctx.pri, priTableName );
-    DATASOURCE_INIT( ctx.sec, secTableName );
-    DATASOURCE_INIT( ctx.evi, eviTableName );
-    DATASOURCE_INIT( ctx.eva, evaTableName );
-    
-    if ( ctx.seq.tbl.name )
-    {
-        rc = VDatabaseOpenTableRead( db, &ctx.seq.tbl.vtbl, ctx.seq.tbl.name );
-        if ( rc == 0 )
-        {
-            ctx.seq.cols = seq_cols;
-            memcpy(seq_cols, gSeqCol, sizeof(gSeqCol));
-            rc = Cursor_Open( &ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL );
-        }
-    }
-    ctx.pri.cols = &align_cols[ 0 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.sec.cols = &align_cols[ 1 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.evi.cols = &align_cols[ 2 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.eva.cols = &align_cols[ 3 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    
-    SetupColumns( &ctx.pri, edstt_PrimaryAlignment );
-    SetupColumns( &ctx.sec, edstt_SecondaryAlignment );
-    SetupColumns( &ctx.evi, edstt_EvidenceInterval );
-    SetupColumns( &ctx.eva, edstt_EvidenceAlignment );
-    
-    if ( ctx.pri.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.pri.tbl.vtbl, ctx.pri.tbl.name );
-    if ( ctx.sec.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.sec.tbl.vtbl, ctx.sec.tbl.name );
-    if ( ctx.evi.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.evi.tbl.vtbl, ctx.evi.tbl.name );
-    if ( ctx.eva.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.eva.tbl.vtbl, ctx.eva.tbl.name );
-    
-    if (   ctx.pri.tbl.vtbl == NULL
-        && ctx.sec.tbl.vtbl == NULL
-        && ctx.evi.tbl.vtbl == NULL
-        && ctx.eva.tbl.vtbl == NULL )
-    {
-        memset (&ctx.pri, 0, sizeof( ctx.pri ) * 4 );
-        if ( ctx.seq.tbl.name == NULL )
-        {
-            ctx.seq.tbl.name = "SEQUENCE";
-            rc = VDatabaseOpenTableRead( db, &ctx.seq.tbl.vtbl, ctx.seq.tbl.name );
-        }
-        if ( rc == 0 )
-        {
-            ctx.seq.cols = seq_cols;
-            memcpy(seq_cols, gSeqCol, sizeof(gSeqCol));
-            rc = Cursor_Open(&ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL);
-            if ( rc == 0 )
-            {
-                rc = DumpTable( &ctx );
-                Cursor_Close(&ctx.seq.curs);
-            }
-            VTableRelease(ctx.seq.tbl.vtbl);
-        }
-        VDatabaseRelease( db );
-        return rc;
-    }
-    ReportResetDatabase( fullPath, db );
-    
-    if ( ctx.ref.tbl.name )
-    {
-        rc = VDatabaseOpenTableRead( db, &ctx.ref.tbl.vtbl, ctx.ref.tbl.name );
-        ctx.ref.type = edstt_Reference;
-    }
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.pri.tbl, &ctx.pri.curs, ctx.pri.cols, ctx.seq.curs.cache );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.sec.tbl, &ctx.sec.curs, ctx.sec.cols, NULL );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.evi.tbl, &ctx.evi.curs, ctx.evi.cols, NULL );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.eva.tbl, &ctx.eva.curs, ctx.eva.cols, NULL );
-    if ( rc == 0 )
-        rc = DumpDB( &ctx );
-    
-    Cursor_Close(&ctx.ref.curs);
-    Cursor_Close(&ctx.pri.curs);
-    Cursor_Close(&ctx.sec.curs);
-    Cursor_Close(&ctx.evi.curs);
-    Cursor_Close(&ctx.eva.curs);
-    Cursor_Close(&ctx.seq.curs);
-    
-    VTableRelease( ctx.ref.tbl.vtbl );
-    VTableRelease( ctx.pri.tbl.vtbl );
-    VTableRelease( ctx.sec.tbl.vtbl );
-    VTableRelease( ctx.evi.tbl.vtbl );
-    VTableRelease( ctx.eva.tbl.vtbl );
-    VTableRelease( ctx.seq.tbl.vtbl );
-    
-    return rc;
-}
-
-#if 0
-rc_t ResolvePath( char const *accession, char const ** path )
-{
-    rc_t rc = 0;
-    static char tblpath[ 4096 ];
-#if TOOLS_USE_SRAPATH != 0
-    static SRAPath* pmgr = NULL;
-    
-    if ( accession == NULL && path == NULL )
-    {
-        SRAPathRelease( pmgr );
-        return 0;
-    }
-    if (   pmgr != NULL
-        || ( rc = SRAPathMake( &pmgr, NULL ) ) == 0
-        || ( GetRCState( rc ) == rcNotFound && GetRCTarget( rc ) == rcDylib ) )
-    {
-        *path = tblpath;
-        tblpath[ 0 ] = '\0';
-        rc = 0;
-        do {
-            if ( pmgr != NULL && !SRAPathTest( pmgr, accession ) )
-            {
-                /* try to resolve the path using mgr */
-                rc = SRAPathFind( pmgr, accession, tblpath, sizeof( tblpath ) );
-                if ( rc == 0 )
-                    break;
-            }
-            if ( strlen( accession ) >= sizeof( tblpath ) )
-            {
-                rc = RC( rcExe, rcPath, rcResolving, rcBuffer, rcInsufficient );
-            }
-            else
-            {
-                strcpy( tblpath, accession );
-                rc = 0;
-            }
-        } while( false );
-    }
-#else
-    if ( accession != NULL && path != NULL )
-    {
-        *path = tblpath;
-        strcpy( tblpath, accession );
-    }
-#endif
-
-    return rc;
-}
-#endif
-
-
-static rc_t ProcessPath( VDBManager const *mgr, char const Path[] )
-{
-#if 0
-    unsigned pathlen = strlen( Path );
-    char *readGroup = NULL;
-    char *path = NULL;
-    unsigned i;
-    rc_t rc;
-    
-    /* strip trailing path seperators */
-    for ( i = pathlen; i > 0; )
-    {
-        int const ch = Path[ --i ];
-        
-        if ( ch == '/' || ch == '\\' )
-            --pathlen;
-        else
-            break;
-    }
-
-    /* find read group alias */
-    for ( i = pathlen; i > 0; )
-    {
-        int const ch = Path[ --i ];
-        
-        if ( ch == '=' )
-        {
-            unsigned const pos = i + 1;
-            unsigned const len = pathlen - pos;
-            
-            pathlen = i;
-            
-            readGroup = malloc( len + 1 );
-            if ( readGroup == NULL )
-                return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-            memcpy( readGroup, &Path[ pos ], len );
-            readGroup[ len ] = '\0';
-            break;
-        }
-    }
-
-    path = malloc( pathlen + 1 );
-    if ( path == NULL )
-        return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    memcpy( path, Path, pathlen );
-    path[ pathlen ] = '\0';
-    
-    rc = ReportResetObject( path );
-    if ( rc == 0 )
-    {
-        char const *fullPath;
-
-        rc = ResolvePath( path, &fullPath );
-        if ( rc == 0 )
-        {
-            char const *accession = fullPath;
-            VDatabase const *db;
-            
-            /* use last path element as accession */
-            for ( i = pathlen; i > 0; )
-            {
-                int const ch = path[ --i ];
-                
-                if ( ch == '/' || ch == '\\' )
-                {
-                    accession = &fullPath[ i + i ];
-                    break;
-                }
-            }
-            rc = VDBManagerOpenDBRead( mgr, &db, NULL, fullPath );
-            if ( rc == 0 )
-            {
-                rc = ProcessDB( db, fullPath, accession, readGroup );
-                VDatabaseRelease( db );
-            }
-            else
-                rc = ProcessTable( mgr, fullPath, accession, readGroup );
-        }
-    }
-    free( path );
-    free( readGroup );
-    return rc;
-
-#else
-
-    char * pc;
-    rc_t rc = 0;
-
-    pc = strchr (Path, ':');
-    if (pc == NULL)
-    {
-        unsigned pathlen;
-        char *readGroup;
-        char *path;
-        unsigned i;
-
-    old:
-        pathlen = strlen( Path );
-        readGroup = NULL;
-        path = NULL;
-    
-        /* strip trailing path seperators */
-        for ( i = pathlen; i > 0; )
-        {
-            int const ch = Path[ --i ];
-        
-            if ( ch == '/' || ch == '\\' )
-                --pathlen;
-            else
-                break;
-        }
-
-        /* find read group alias */
-        for ( i = pathlen; i > 0; )
-        {
-            int const ch = Path[ --i ];
-        
-            if ( ch == '=' )
-            {
-                unsigned const pos = i + 1;
-                unsigned const len = pathlen - pos;
-            
-                pathlen = i;
-            
-                readGroup = malloc( len + 1 );
-                if ( readGroup == NULL )
-                    return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-                memcpy( readGroup, &Path[ pos ], len );
-                readGroup[ len ] = '\0';
-                break;
-            }
-        }
-
-        path = malloc( pathlen + 1 );
-        if ( path == NULL )
-            return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-        memcpy( path, Path, pathlen );
-        path[ pathlen ] = '\0';
-    
-        rc = ReportResetObject( path );
-        if ( rc == 0 )
-        {
-            char const *accession = path;
-            VDatabase const *db;
-            
-            /* use last path element as accession */
-            for ( i = pathlen; i > 0; )
-            {
-                int const ch = path[ --i ];
-                
-                if ( ch == '/' || ch == '\\' )
-                {
-                    accession = &path[ i + 1 ];
-                    break;
-                }
-            }
-            rc = VDBManagerOpenDBRead( mgr, &db, NULL, path );
-            if ( rc == 0 )
-            {
-                rc = ProcessDB( db, path, accession, readGroup );
-                if (UIError(rc, db, NULL)) {
-                    UIDatabaseLOGError(rc, db, true);
-/*                  *error_reported = true; */
-                }
-                VDatabaseRelease( db );
-            }
-            else {
-                rc = ProcessTable( mgr, path, accession, readGroup );
-                if (UIError(rc, NULL, NULL)) {
-                    UITableLOGError(rc, NULL, true);
-/*                  *error_reported = true; */
-                }
-            }
-        }
-        free( path );
-        free( readGroup );
-        return rc;
-    }
-    else
-    {
-        VPath * vpath;
-        char * basename;
-        size_t zz;
-        char buffer [8193];
-        char readgroup_ [257];
-        char * readgroup;
-
-        rc = VPathMake (&vpath, Path);
-        if (rc)
-            ; /* LOGERR */
-        else
-        {
-            VPUri_t uri_t;
-            switch (uri_t = VPathGetUri_t (vpath))
-            {
-            default:
-            case vpuri_invalid:
-                rc = RC (rcExe, rcParam, rcAccessing, rcPath, rcInvalid);
-                break;
-            case vpuri_not_supported:
-                rc = RC (rcExe, rcParam, rcAccessing, rcPath, rcUnsupported);
-                break;
-            case vpuri_none:
-                goto old;
-
-            case vpuri_ncbi_vfs:
-            case vpuri_file:
-            case vpuri_ncbi_acc:
-            case vpuri_http:
-                rc = VPathReadPath (vpath, buffer, sizeof buffer - 1, &zz);
-                if (rc)
-                    ;
-                else
-                {
-                loop:
-                    basename = strrchr (buffer, '/');
-                    if (basename)
-                    {
-                        if (basename[1] == '\0')
-                        {
-                            basename[0] = '\0';
-                            goto loop;
-                        }
-                        else
-                            ++basename;
-                    }
-                    else
-                        basename = buffer;
-
-                    {
-                        char * ext;
-
-                        /* cut off [.lite].[c]sra[.nenc||.ncbi_enc] if any */
-                        ext = strrchr( basename, '.' );
-                        if ( ext != NULL )
-                        {
-                            if ( strcasecmp( ext, ".nenc" ) == 0 || strcasecmp( ext, ",ncbi_enc" ) == 0 )
-                            {
-                                *ext = '\0';
-                                ext = strrchr( basename, '.' );
-                            }
-                            if ( ext != NULL )
-                            {
-                                if ( strcasecmp( ext, ".sra" ) == 0 || strcasecmp( ext, ".csra" ) == 0 )
-                                {
-                                    *ext = '\0';
-                                    ext = strrchr( basename, '.' );
-                                    if ( ext != NULL && strcasecmp( ext, ".lite" ) == 0 )
-                                        *ext = '\0';
-                                }
-                            }
-                        }
-                    }
-
-                    rc = VPathOption (vpath, vpopt_readgroup, readgroup_, 
-                                      sizeof readgroup_ - 1, &zz);
-                    if (rc)
-                    {
-                        if (GetRCState (rc) == rcNotFound)
-                        {
-                            rc = 0;
-                            readgroup = NULL;
-                        }
-                    }
-                    else
-                        readgroup = readgroup_;
-
-
-                    if (rc)
-                        ;
-                    else
-                    {
-                        VDatabase const *db;
-
-                        rc = VDBManagerOpenDBRead( mgr, &db, NULL, Path );
-                        if ( rc == 0 )
-                        {
-                            rc = ProcessDB( db, Path, basename, readgroup );
-                            VDatabaseRelease( db );
-                        }
-                        else
-                            rc = ProcessTable( mgr, Path, basename, readgroup );
-                    }
-                }
-                break;
-            }
-            VPathRelease (vpath);
-        }
-    }
-    return rc;
-#endif
-}
-
-
-ver_t CC KAppVersion( void )
-{
-    return SAM_DUMP_VERS;
-}
-
-char const *unaligned_usage[] = {"Output unaligned reads", NULL};
-char const *unaligned_only_usage[] = {"Only output unaligned spots", NULL};
-char const *primaryonly_usage[] = {"Output only primary alignments", NULL};
-char const *cigartype_usage[] = {"Output long version of CIGAR", NULL};
-char const *cigarCG_usage[] = {"Output CG version of CIGAR", NULL};
-char const *cigarCGMerge_usage[] = {"Apply CG fixups to CIGAR/SEQ/QUAL and outputs CG-specific columns", NULL};
-char const *CG_evidence[] = {"Output CG evidence aligned to reference", NULL};
-char const *CG_ev_dnb[] = {"Output CG evidence DNB's aligned to evidence", NULL};
-char const *CG_SAM[] = {"Output CG evidence DNB's aligned to reference ", NULL};
-char const *CG_mappings[] = {"Output CG sequences aligned to reference ", NULL};
-char const *header_usage[] = {"Replace original BAM header with a reconstructed one", NULL};
-char const *noheader_usage[] = {"Do not output headers", NULL};
-char const *region_usage[] = {"Filter by position on genome.",
-                              "Name can either be file specific name (ex: \"chr1\" or \"1\").",
-                              "\"from\" and \"to\" are 1-based coordinates", NULL};
-char const *distance_usage[] = {"Filter by distance between matepairs.",
-                                "Use \"unknown\" to find matepairs split between the references.",
-                                "Use from-to to limit matepair distance on the same reference", NULL};
-char const *seq_id_usage[] = {"Print reference SEQ_ID in RNAME instead of NAME", NULL};
-char const *identicalbases_usage[] = {"Output '=' if base is identical to reference", NULL};
-char const *gzip_usage[] = {"Compress output using gzip", NULL};
-char const *bzip2_usage[] = {"Compress output using bzip2", NULL};
-char const *qname_usage[] = {"Add .SPOT_GROUP to QNAME", NULL};
-char const *fasta_usage[] = {"Produce Fasta formatted output", NULL};
-char const *fastq_usage[] = {"Produce FastQ formatted output", NULL};
-char const *prefix_usage[] = {"Prefix QNAME: prefix.QNAME", NULL};
-char const *reverse_usage[] = {"Reverse unaligned reads according to read type", NULL};
-char const *comment_usage[] = {"Add comment to header. Use multiple times for several lines. Use quotes", NULL};
-char const *XI_usage[] = {"Output cSRA alignment id in XI column", NULL};
-char const *qual_quant_usage[] = {"Quality scores quantization level",
-                                  "a string like '1:10,10:20,20:30,30:-'", NULL};
-char const *CG_names[] = { "Generate CG friendly read names", NULL};
-
-char const *usage_params[] =
-{
-    NULL,                       /* unaligned */
-    NULL,                       /* unaligned-only */
-    NULL,                       /* primaryonly */
-    NULL,                       /* cigartype */
-    NULL,                       /* cigarCG */
-    NULL,                       /* header */
-    NULL,                       /* no-header */
-    "'text'",                   /* comment */
-    "name[:from-to]",           /* region */
-    "from-to|unknown",          /* distance */
-    NULL,                       /* seq-id */
-    NULL,                       /* identical-bases */
-    NULL,                       /* gzip */
-    NULL,                       /* bzip2 */
-    NULL,                       /* qname */
-    NULL,                       /* fasta */
-    NULL,                       /* fastq */
-    "prefix",                   /* prefix */
-    NULL,                       /* reverse */
-    NULL,                       /* test-rows */
-    NULL,                       /* mate-row-gap-cacheable */
-    NULL,                       /* cigarCGMerge */
-    NULL,                       /* XI */
-    "quantization string",      /* qual-quant */
-    NULL,                       /* cigarCGMerge */
-    NULL,                       /* CG-evidence */
-    NULL,                       /* CG-ev-dnb */
-    NULL,                       /* CG-mappings */
-    NULL,                       /* CG-SAM */
-    NULL                        /* CG-names */
-};
-
-enum eArgs
-{
-    earg_unaligned = 0,         /* unaligned */
-    earg_unaligned_only,        /* unaligned */
-    earg_prim_only,             /* primaryonly */
-    earg_cigartype,             /* cigartype */
-    earg_cigarCG,               /* cigarCG */
-    earg_header,                /* header */
-    earg_noheader,              /* no-header */
-    earg_comment,               /* comment */
-    earg_region,                /* region */
-    earg_distance,              /* distance */
-    earg_seq_id,                /* seq-id */
-    earg_identicalbases,        /* identical-bases */
-    earg_gzip,                  /* gzip */
-    earg_bzip2,                 /* bzip2 */
-    earg_qname,                 /* qname */
-    earg_fastq,                 /* fasta */
-    earg_fasta,                 /* fastq */
-    earg_prefix,                /* prefix */
-    earg_reverse,               /* reverse */
-    earg_test_rows,             /* test-rows */
-    earg_mate_row_gap_cachable, /* mate-row-gap-cacheable */
-    earg_cigarCG_merge,         /* cigarCGMerge */
-    earg_XI,                    /* XI */
-    earg_QualQuant,             /* qual-quant */
-    earg_CG_evidence,           /* CG-evidence */
-    earg_CG_ev_dnb,             /* CG-ev-dnb */
-    earg_CG_mappings,           /* CG-mappings */
-    earg_CG_SAM,                /* CG-SAM */
-    earg_CG_names               /* CG-names */
-};
-
-OptDef DumpArgs[] =
-{
-    { "unaligned", "u", NULL, unaligned_usage, 0, false, false },           /* unaligned */
-    { "unaligned-only", "U", NULL, unaligned_only_usage, 0, false, false }, /* unaligned-only */
-    { "primary", "1", NULL, primaryonly_usage, 0, false, false },           /* primaryonly */
-    { "cigar-long", "c", NULL, cigartype_usage, 0, false, false },          /* cigartype */
-    { "cigar-CG", NULL, NULL, cigarCG_usage, 0, false, false },             /* cigarCG */
-    { "header", "r", NULL, header_usage, 0, false, false },                 /* header */
-    { "no-header", "n", NULL, noheader_usage, 0, false, false },            /* no-header */
-    { "header-comment", NULL, NULL, comment_usage, 0, true, false },        /* comment */
-    { "aligned-region", NULL, NULL, region_usage, 0, true, false },         /* region */
-    { "matepair-distance", NULL, NULL, distance_usage, 0, true, false },    /* distance */
-    { "seqid", "s", NULL, seq_id_usage, 0, false, false },                  /* seq-id */
-    { "hide-identical", "=", NULL, identicalbases_usage, 0, false, false }, /* identical-bases */
-    { "gzip", NULL, NULL, gzip_usage, 0, false, false },                    /* gzip */
-    { "bzip2", NULL, NULL, bzip2_usage, 0, false, false },                  /* bzip2 */
-    { "spot-group", "g", NULL, qname_usage, 0, false, false },              /* qname */
-    { "fastq", NULL, NULL, fastq_usage, 0, false, false },                  /* fasta */
-    { "fasta", NULL, NULL, fasta_usage, 0, false, false },                  /* fastq */
-    { "prefix", "p", NULL, prefix_usage, 0, true, false },                  /* prefix */
-    { "reverse", NULL, NULL, reverse_usage, 0, false, false },              /* reverse */
-    { "test-rows", NULL, NULL, NULL, 0, true, false },                      /* test-rows */
-    { "mate-cache-row-gap", NULL, NULL, NULL, 0, true, false },             /* mate-row-gap-cacheable */
-    { "cigar-CG-merge", NULL, NULL, cigarCGMerge_usage, 0, false, false },  /* cigarCGMerge */
-    { "XI", NULL, NULL, XI_usage, 0, false, false },                        /* XI */
-    { "qual-quant", "Q", NULL, qual_quant_usage, 0, true, false },          /* qual-quant */
-    { "CG-evidence", NULL, NULL, CG_evidence, 0, false, false },            /* CG-evidence */
-    { "CG-ev-dnb"  , NULL, NULL, CG_ev_dnb  , 0, false, false },            /* CG-ev-dnb */
-    { "CG-mappings", NULL, NULL, CG_mappings, 0, false, false },            /* CG-mappings */
-    { "CG-SAM", NULL, NULL, CG_SAM, 0, false, false },                      /* CG-SAM */
-    { "CG-names", NULL, NULL, CG_names, 0, false, false }                   /* CG-names */
-};
-
-
-const char UsageDefaultName[] = "sam-dump";
-
-
-rc_t CC UsageSummary( char const *progname )
-{
-    return KOutMsg( "Usage:\n"
-        "\t%s [options] path-to-run[ path-to-run ...] > output.sam\n\n", progname );
-}
-
-
-rc_t CC Usage( Args const *args)
-{
-    char const *progname = UsageDefaultName;
-    char const *fullpath = UsageDefaultName;
-    rc_t rc;
-    unsigned i;
-
-    rc = ArgsProgram( args, &fullpath, &progname );
-
-    UsageSummary( progname );
-
-    KOutMsg( "Options:\n" );
-    for( i = 0; i < sizeof( DumpArgs ) / sizeof( DumpArgs[ 0 ] ); i++ )
-    {
-        if ( DumpArgs[ i ].help != NULL )
-        {
-            HelpOptionLine( DumpArgs[ i ].aliases, DumpArgs[ i ].name,
-                            usage_params[ i ], DumpArgs[ i ].help);
-        }
-    }
-    KOutMsg( "\n" );
-    HelpOptionsStandard();
-
-    HelpVersion( fullpath, KAppVersion() );
-
-    return rc;
-}
-
-
-#define ARGS_COUNT (sizeof(DumpArgs)/sizeof(DumpArgs[0]))
-
-
-static unsigned ParamCount( Args const *const args, rc_t *const prc )
-{
-    uint32_t y = 0;
-    rc_t rc = ArgsParamCount( args, &y );
-    
-    if ( prc != NULL )
-        *prc = rc;
-    return y;
-}
-
-
-static unsigned ArgCount( Args const *const args, rc_t *const prc )
-{
-    uint32_t y = 0;
-    rc_t rc = ArgsArgvCount( args, &y );
-    
-    if ( prc != NULL )
-        *prc = rc;
-    return y;
-}
-
-
-static rc_t CountArgs( Args const *const args, unsigned count[],
-                       char const **const errmsg )
-{
-    rc_t rc;
-    unsigned const pcount = ParamCount( args, &rc );
-    
-    memset( count, 0, ARGS_COUNT );
-    if ( rc != 0 || pcount == 0 )
-    {
-        *errmsg = "";
-        MiniUsage( args );
-        return ( ArgCount( args, NULL ) < 2 )
-             ? 0
-             : RC( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-    }
-#define COUNT_ARG(E) do {\
-    char const *const optname = DumpArgs[ (E) ].name; \
-    if ( ( rc = ArgsOptionCount( args, optname, &count[ (E) ] ) ) != 0 ) { \
-        *errmsg = optname; \
-        return rc; \
-    } } while( 0 )
-    
-    
-    /* record source options */
-    COUNT_ARG( earg_unaligned );
-    COUNT_ARG( earg_unaligned_only );
-    COUNT_ARG( earg_prim_only );
-    COUNT_ARG( earg_CG_evidence );
-    COUNT_ARG( earg_CG_ev_dnb );
-    COUNT_ARG( earg_CG_mappings );
-    COUNT_ARG( earg_CG_SAM );
-    
-    /* record filter options */
-    COUNT_ARG( earg_region );
-    COUNT_ARG( earg_distance );
-    
-    /* output format options */
-    COUNT_ARG( earg_fastq );
-    COUNT_ARG( earg_fasta );
-    
-    /* SAM header options */
-    COUNT_ARG( earg_header );
-    COUNT_ARG( earg_noheader );
-    COUNT_ARG( earg_comment );
-    
-    /* SAM field options */
-    COUNT_ARG( earg_prefix );
-    COUNT_ARG( earg_qname );
-    COUNT_ARG( earg_seq_id );
-    COUNT_ARG( earg_CG_names );
-    
-    COUNT_ARG( earg_cigartype );
-    COUNT_ARG( earg_cigarCG );
-    COUNT_ARG( earg_cigarCG_merge );
-    
-    COUNT_ARG( earg_identicalbases );
-    COUNT_ARG( earg_reverse );
-    COUNT_ARG( earg_QualQuant );
-    
-    /* output encoding options */
-    COUNT_ARG( earg_gzip );
-    COUNT_ARG( earg_bzip2 );
-    
-    COUNT_ARG( earg_mate_row_gap_cachable );
-    
-    /* debug options */
-    COUNT_ARG( earg_XI );
-    COUNT_ARG( earg_test_rows );
-#undef COUNT_ARG
-    return 0;
-}
-
-
-static unsigned GetOptValU( Args const *const args, char const *const argname,
-                            unsigned const defval, rc_t *const prc )
-{
-    unsigned y = defval;
-    char const *valstr;
-    rc_t rc = ArgsOptionValue( args, argname, 0, &valstr );
-    
-    if ( rc == 0 )
-    {
-        char *endp;
-        
-        y = strtou32( valstr, &endp, 0 );
-        if ( *endp != '\0' )
-        {
-            rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-            y = 0;
-        }
-        if ( y == 0 )
-            y = defval;
-    }
-    if ( prc )
-        *prc = rc;
-    return y;
-}
-
-
-static rc_t GetComments( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    parms->comments = calloc( n + 1, sizeof( parms->comments[ 0 ] ) );
-    if ( parms->comments != NULL )
-    {
-        unsigned i;
-        
-        for ( i = 0; i < n; ++i )
-        {
-            rc_t const rc = ArgsOptionValue( args, DumpArgs[ earg_comment ].name, i, &parms->comments[ i ] );
-            if ( rc != 0 )
-            {
-                free( parms->comments );
-                parms->comments = NULL;
-                return rc;
-            }
-        }
-        return 0;
-    }
-    else
-        return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-}
-
-
-static rc_t ParseFromTo( int *const pFrom, int *const pTo, char const str[] )
-{
-    /* $str =~ /((\d+)-(\d+))|(-(\d+))|(\d+)/ */
-    int n;
-    char fr_str[ 16 ];
-    char to_str[ 16 ];
-    uint32_t fr = 0;
-    uint32_t to = 0;
-    int i = sscanf( str, "%15[0-9]-%15[0-9]%n", fr_str, to_str, &n );
-    
-    if ( i != 2 )
-    {
-        unsigned const offset = ( str[ 0 ] == '-' ) ? 1 : 0;
-        
-        fr = 0;
-        i = sscanf( str + offset, "%15[0-9]%n", to_str, &n );
-        if ( i != 1 )
-            return RC( rcExe, rcArgv, rcProcessing, rcParam, rcOutofrange );
-        to = strtou32( to_str, 0, 0 );
-    }
-    else
-    {
-        fr = strtou32( fr_str, 0, 0 );
-        to = strtou32( to_str, 0, 0 );
-        
-        if ( to < fr )
-        {
-            uint32_t const tmp = to;
-            to = fr;
-            fr = tmp;
-        }
-    }
-    /* was the entire string consumed */
-    if ( str[ n ] != 0 )
-        return RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-    *pFrom = ( int )fr;
-    *pTo = ( int )to;
-    return 0;
-}
-
-
-static rc_t GetDistance( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    rc_t rc;
-    TMatepairDistance *const mpd = calloc( n, sizeof( mpd[ 0 ] ) );
-    
-    if ( mpd == NULL )
-        rc = RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    else
-    {
-        unsigned i;
-        unsigned j;
-        
-        for ( j = i = 0; i < n; ++i )
-        {
-            char const *valstr;
-            int from = 0;
-            int to = 0;
-
-            rc = ArgsOptionValue( args, DumpArgs[earg_distance].name, i, &valstr );
-            if ( rc != 0 )
-                break;
-            if ( strcasecmp( valstr, "unknown" ) == 0 )
-            {
-                parms->mp_dist_unknown = true;
-                continue;
-            }
-            rc = ParseFromTo( &from, &to, valstr );
-            if ( rc != 0 )
-                break;
-            if ( ( from != 0 ) || ( to != 0 ) )
-            {
-                mpd[ j ].from = from;
-                mpd[ j ].to = to;
-                ++j;
-            }
-        }
-        if ( rc == 0 )
-        {
-            parms->mp_dist = mpd;
-            parms->mp_dist_qty = j;
-            
-            SAM_DUMP_DBG( 2, ( "filter by mate pair distance\n" ) );
-            if ( parms->mp_dist_unknown )
-                SAM_DUMP_DBG( 2, ( "    distance: unknown\n" ) );
-            for ( i = 0; i < j; ++i )
-            {
-                SAM_DUMP_DBG( 2, ( "    distance [%lu-%lu]\n",
-                              parms->mp_dist[ i ].from, parms->mp_dist[ i ].to ) );
-            }
-        }
-        else
-            free( mpd );
-    }
-    return rc;
-}
-
-
-static rc_t GetRegion( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    rc_t rc;
-    TAlignedRegion *const reg = calloc( n, sizeof( reg[ 0 ] ) );
-    
-    if ( reg == NULL )
-        rc = RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    else
-    {
-        unsigned i;
-        unsigned j;
-        
-        for ( rc = 0, j = i = 0; i < n; ++i )
-        {
-            char const *valstr;
-            char const *sep;
-            unsigned namelen;
-            unsigned f;
-            unsigned e;
-            TAlignedRegion r;
-
-	    memset(&r,0,sizeof(r));
-            
-            rc = ArgsOptionValue( args, DumpArgs[ earg_region ].name, i, &valstr );
-            if ( rc != 0 ) break;
-            
-            sep = strchr( valstr, ':' );
-            if ( sep != NULL )
-                namelen = sep - valstr;
-            else
-                namelen = strlen( valstr );
-            
-            if ( namelen >= sizeof( r.name ) )
-                return RC( rcExe, rcArgv, rcProcessing, rcParam, rcTooLong );
-            
-            memcpy( r.name, valstr, namelen );
-            r.name[ namelen ] = '\0';
-            
-            r.rq = UINT_MAX;
-            if ( sep != NULL )
-            {
-                int from = -1;
-                int to = -1;
-                
-                rc = ParseFromTo( &from, &to, sep + 1 );
-                if ( rc != 0 )
-                    break;
-                if ( from > 0 ) /* convert to 0-based */
-                    --from;
-                else if ( to > 0 )
-                    from = 0;
-                if ( to > 0 )
-                    --to;
-                else if ( from >= 0 && to < 0 )
-                    to = from;
-                if ( from >= 0 || to >= 0 )
-                {
-                    if ( from > to )
-                    {
-                        int tmp = to;
-                        to = from;
-                        from = tmp;
-                    }
-                    r.r[ 0 ].from = from;
-                    r.r[ 0 ].to = to;
-                    r.rq = 1;
-                }
-            }
-            
-            for ( f = 0, e = j; f < e; )
-            {
-                unsigned const m = ( ( f + e ) / 2 );
-                int const diff = strcmp( r.name, reg[ m ].name );
-                
-                if ( diff < 0 )
-                    e = m;
-                else
-                    f = m + 1;
-            }
-            if ( 0 < e && e < j && strcmp( r.name, reg[ e-1 ].name ) == 0 )
-            {
-                TAlignedRegion *const fnd = &reg[ e - 1 ];
-                
-                if ( fnd->rq != UINT_MAX )
-                {
-                    for ( f = 0, e = fnd->rq; f < e; )
-                    {
-                        unsigned const m = ( ( f + e ) / 2 );
-                        
-                        if ( r.r[ 0 ].from < fnd->r[ m ].from )
-                            e = m;
-                        else
-                            f = m + 1;
-                    }
-                    if ( fnd->rq >= ( sizeof( r.r ) / sizeof( r.r[0] ) ) )
-                    {
-                        rc = RC( rcExe, rcArgv, rcProcessing, rcBuffer, rcInsufficient );
-                        break;
-                    }
-                    memmove( &fnd->r[ e +1 ], &fnd->r[ e ], ( fnd->rq - e ) * sizeof( fnd->r[ 0 ] ) );
-                    fnd->r[ e ] = r.r[ 0 ];
-                    ++fnd->rq;
-                }
-            }
-            else
-            {
-                memmove( &reg[ e + 1 ], &reg[ e ], ( j - e ) * sizeof( reg[ 0 ] ) );
-                reg[ e ] = r;
-                ++j;
-            }
-        }
-        if ( rc == 0 )
-        {
-            parms->region = reg;
-            parms->region_qty = j;
-            
-            for ( i = 0; i < parms->region_qty; ++i )
-            {
-                TAlignedRegion *const r = &parms->region[ i ];
-                
-                SAM_DUMP_DBG( 2, ( "filter by %s\n", r->name ) );
-                if ( r->rq == UINT_MAX )
-                {
-                    r->rq = 1;
-                    r->r[ 0 ].from = 0;
-                    r->r[ 0 ].to = UINT_MAX;
-                }
-                for ( j = 0; j < r->rq; ++j )
-                {
-                    unsigned const to = r->r[ j ].to;
-                    unsigned const from = r->r[ j ].from;
-                    
-                    SAM_DUMP_DBG( 2, ( "   range: [%u:%u]\n", r->r[ j ].from, to ) );
-                    if ( r->max_to < to ) r->max_to = to;
-                    if ( r->min_from < from ) r->min_from = from;
-                }
-            }
-        }
-        else
-            free( reg );
-    }
-    return rc;
-}
-
-
-static rc_t GetQualQuant( Args const *const args, struct params_s *const parms )
-{
-    char const *valstr;
-    int i;
-    rc_t rc = ArgsOptionValue( args, DumpArgs[ earg_QualQuant ].name, 0, &valstr );
-    
-    if ( rc == 0 && strcmp( valstr, "0" ) != 0 )
-        parms->quantizeQual = QualityQuantizerInitMatrix( parms->qualQuant, valstr );
-    for(i=1; parms->qualQuant[i]==parms->qualQuant[0] && i<256;i++){}
-    if(i<256) parms->qualQuantSingle=0;
-    else      parms->qualQuantSingle = parms->qualQuant[0];
-    return rc;
-}
-
-
-static rc_t GetArgs( Args const *const args, unsigned const count[],
-                     char const **const errmsg )
-{
-    static struct params_s parms;
-    bool const multipass = ParamCount( args, 0 ) > 1;
-    rc_t rc;
-    
-    memset( &parms, 0, sizeof( parms ) );
-    
-    if ( count[ earg_comment ] )
-    {
-        rc = GetComments( args, &parms, count[ earg_comment ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_comment ].name;
-            return rc;
-        }
-    }
-    
-    if ( count[ earg_region ] && count[ earg_unaligned_only ] == 0 )
-    {
-        rc = GetRegion( args, &parms, count[ earg_region ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_region ].name;
-            return rc;
-        }
-    }
-
-    if ( count[ earg_distance ] && count[ earg_unaligned_only ] == 0 )
-    {
-        rc = GetDistance( args, &parms, count[ earg_distance ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_distance ].name;
-            return rc;
-        }
-    }
-
-    if ( count[ earg_QualQuant ] )
-    {
-        rc = GetQualQuant( args, &parms );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_QualQuant ].name;
-            return rc;
-        }
-    }
-    
-    parms.cg_sam = ( count[ earg_CG_SAM ] != 0 );
-    parms.cg_evidence = ( count[ earg_CG_evidence ] != 0 );
-    parms.cg_ev_dnb = ( count[ earg_CG_ev_dnb ] != 0 );
-    
-    if ( count[ earg_CG_mappings ] == 0 &&
-         ( parms.cg_sam || parms.cg_evidence || parms.cg_ev_dnb ) )
-    {
-        parms.primaries = false;
-        parms.secondaries = false;
-        parms.unaligned = false;
-    }
-    else
-    {
-        parms.primaries = true;
-        parms.secondaries = ( count[ earg_prim_only ] == 0 );
-        parms.unaligned = ( ( count[ earg_unaligned ] != 0 ) /*&& ( parms.region_qty == 0 )*/ );
-    }
-    
-    parms.long_cigar = ( count[ earg_cigartype ] != 0 );
-    parms.use_seqid = ( ( count[ earg_seq_id ] != 0 ) || multipass );
-    parms.hide_identical = ( count[ earg_identicalbases ] != 0 );
-    parms.fasta = ( count[ earg_fasta ] != 0 );
-    parms.fastq = ( count[ earg_fastq ] != 0 );
-    parms.reverse_unaligned = ( count[ earg_reverse ] != 0 );
-    parms.cg_friendly_names = count[ earg_CG_names ] != 0;
-    parms.spot_group_in_name = ( count[ earg_qname ] != 0 || multipass );
-    parms.noheader = ( ( count[ earg_noheader ] != 0 ) || parms.fasta || parms.fastq || multipass );
-    parms.reheader = ( ( count[ earg_header ] != 0 ) && !parms.noheader );
-    parms.xi = ( count[ earg_XI ] != 0 );
-    if ( ( count[ earg_cigarCG ] == 0 ) && ( count[ earg_cigarCG_merge ] == 0 ) )
-    {
-        parms.cg_style = 0;
-    }
-    else if ( count[ earg_cigarCG ] == 0 )
-    {
-        parms.cg_style = 1;
-        parms.long_cigar = false;
-    }
-    else if ( count[ earg_cigarCG_merge ] == 0 )
-    {
-        parms.cg_style = 2;
-    }
-    else
-    {
-        rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInconsistent );
-        *errmsg = "cigar-CG and CG are mutually exclusive";
-        parms.cg_style = 0;
-    }
-
-    if (count[ earg_unaligned_only ] > 0) {
-        parms.unaligned_spots = true;
-        
-        parms.primaries = false;
-        parms.secondaries = false;
-        parms.unaligned = true;
-        parms.cg_ev_dnb = false;
-        parms.cg_evidence = false;
-        parms.cg_sam = false;
-        parms.cg_style = 0;
-    }
-    
-    parms.test_rows = GetOptValU( args, DumpArgs[ earg_test_rows ].name, 0, NULL );
-    parms.mate_row_gap_cachable = GetOptValU( args, DumpArgs[ earg_mate_row_gap_cachable ].name, 1000000, NULL );
-    
-    param = &parms;
-    return 0;
-}
-
-
-static rc_t GetParams( Args const *const args, char const **const errmsg )
-{
-    unsigned count[ ARGS_COUNT ];
-    rc_t rc = CountArgs( args, count, errmsg );
-    
-    if ( rc == 0 )
-        rc = GetArgs( args, count, errmsg );
-    return rc;
-}
-
-
-rc_t CC SAM_Dump_Main( int argc, char* argv[] )
-{
-    rc_t rc = 0;
-    Args* args;
-    char const *errmsg = "stop";
-    bool error_reported = false;
-
-    memset( &g_out_writer, 0, sizeof( g_out_writer ) );
-    KOutHandlerSetStdOut();
-    KStsHandlerSetStdErr();
-    KLogHandlerSetStdErr();
-    (void)KDbgHandlerSetStdErr();
-
-    ReportBuildDate( __DATE__ );
-
-    rc = ArgsMakeAndHandle( &args, argc, argv, 1, DumpArgs, ARGS_COUNT );
-    if ( rc == 0 )
-    {
-        uint32_t pcount;
-
-        rc = ArgsParamCount( args, &pcount );
-        if ( rc != 0 || pcount < 1 )
-        {
-            errmsg = "";
-            rc = argc < 2 ? 0 : RC( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-            MiniUsage( args );
-        }
-        else if ( ( rc = GetParams( args, &errmsg ) ) != 0 )
-        {
-        }
-        else
-        {
-            VDBManager const *mgr;
-            
-            rc = VDBManagerMakeRead( &mgr, NULL );
-            if ( rc == 0 )
-            {
-                rc = BufferedWriterMake( param->output_gzip, param->output_bz2 );
-                if ( rc == 0 )
-                {
-                    unsigned i;
-                    
-                    for ( i = 0; i < pcount; ++i )
-                    {
-                        char const *arg;
-                        
-                        rc = ArgsParamValue( args, i, &arg );
-                        if ( rc != 0 ) break;
-                        rc = ProcessPath( mgr, arg );
-#if _ARCH_BITS < 64
-                        /* look for "param excessive while writing vector within container module" */
-                        if (GetRCState(rc) == rcExcessive &&
-                            GetRCObject(rc) == rcParam &&
-                            GetRCContext(rc) == rcWriting &&
-                            GetRCTarget(rc) == rcVector &&
-                            GetRCModule(rc) == rcCont)
-                        {
-                            ( void )PLOGMSG( klogErr, (klogErr, "This run '$(run)' contains too many reads to be processed with a $(bits)-bit executable; please try again with a 64-bit executable.", "run=%s,bits=%u", arg, _ARCH_BITS));
-                        }
-#endif
-                        if ( rc != 0 ) break;
-                    }
-                    BufferedWriterRelease( rc == 0 );
-                }
-                VDBManagerRelease( mgr );
-            }
-        }
-        ArgsWhack( args );
-    }
-
-    if ( rc != 0 && !error_reported )
-    {
-        if ( errmsg[ 0 ] )
-        {
-            ( void )LOGERR( klogErr, rc, errmsg );
-        } else if ( KLogLastErrorCode() != rc )
-        {
-            ( void )LOGERR( klogErr, rc, "stop" );
-        }
-    }
-
-    {
-        /* Report execution environment if necessary */
-        rc_t rc2 = ReportFinalize( rc );
-        if ( rc == 0 )
-            rc = rc2;
-    }
-    return rc;
-}
-
-
-rc_t CC KMain( int argc, char* argv[] )
-{
-    char filename[ 4096 ];
-    /*
-       Try to find a option-file - parameter in the original parameters 
-       This is a hack to teach sam-dump to read it's parameters from a file/pipe instead
-       of the commandline
-       It is neccessary because the code above does not use libkapp to parse parameters!
-    */
-    rc_t rc = Args_find_option_in_argv( argc, argv, "--option-file", filename, sizeof filename );
-    if ( rc == 0 )
-    {
-        int new_argc;
-        char ** new_argv;
-        /* we found it! Now comes the special treatment: we fake a new argc/argv-pair! */
-        rc = Args_tokenize_file_and_progname_into_argv( filename, "sam-dump", &new_argc, &new_argv );
-        if ( rc == 0 )
-        {
-            /* pass the faked input-parameters from */
-            rc = SAM_Dump_Main( new_argc, new_argv );
-
-            Args_free_token_argv( new_argc, new_argv );
-        }
-    }
-    else
-    {
-        /* we did not found the special option, just use the commandline-parameters unchanged */
-        rc = SAM_Dump_Main( argc, argv );
-    }
-    return rc;
-}
diff --git a/tools/sam-dump/sam-dump.vers b/tools/sam-dump/sam-dump.vers
deleted file mode 100644
index 5859406..0000000
--- a/tools/sam-dump/sam-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.2.3
diff --git a/tools/sra-dbcc/Makefile b/tools/sra-dbcc/Makefile
deleted file mode 100644
index beeda09..0000000
--- a/tools/sra-dbcc/Makefile
+++ /dev/null
@@ -1,113 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-dbcc
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	sra-dbcc
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sra-dbcc
-#
-SRA_DBCC_SRC = \
-	sra-dbcc
-
-SRA_DBCC_OBJ = \
-	$(addsuffix .$(OBJX),$(SRA_DBCC_SRC))
-
-SRA_DBCC_LIB = \
-	-dalign-reader \
-	$(READONLY_SCHEMA_LIBS) \
-	-dksrch \
-	-lsradb \
-	-lvdb \
-	-lkdb \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib \
-	-lm
-
-sra-dbcc.vers.h: sra-dbcc.vers
-	$(TOP)/build/make-vers-inc.sh SRA_DBCC_VERS $^ > $@
-
-$(BINDIR)/sra-dbcc: $(SRA_DBCC_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SRA_DBCC_LIB)
diff --git a/tools/sra-dbcc/sra-dbcc.c b/tools/sra-dbcc/sra-dbcc.c
deleted file mode 100644
index 869a787..0000000
--- a/tools/sra-dbcc/sra-dbcc.c
+++ /dev/null
@@ -1,1577 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "sra-dbcc.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-
-#include <sra/sradb.h>
-#include <sra/sraschema.h>
-#include <sra/srapath.h>
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/meta.h>
-#include <kdb/consistency-check.h>
-#include <kdb/namelist.h>
-
-#include <vfs/manager.h> /* VFSManager */
-#include <vfs/resolver.h> /* VResolver */
-#include <vfs/path.h> /* VPath */
-
-#include <kfs/sra.h>
-#include <kfs/tar.h>
-#include <kfs/kfs-priv.h>
-
-#include <klib/container.h>
-#include <klib/sort.h>
-#include <klib/namelist.h>
-#include <klib/data-buffer.h>
-#include <klib/text.h> /* String */
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/rc.h>
-
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#ifndef PATH_MAX
-    #define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-static bool exhaustive;
-static bool md5_required;
-static bool ref_int_check;
-static bool s_IndexOnly = false;
-
-struct node_s {
-    int parent;
-    int prvSibl;
-    int nxtSibl;
-    int firstChild;
-    unsigned depth;
-    unsigned name;
-    uint32_t objType;
-};
-typedef struct node_s node_t;
-
-typedef struct cc_context_s {
-    node_t *nodes;
-    char *names;
-    rc_t rc;
-    unsigned num_columns;
-    unsigned nextNode;
-    unsigned nextName;
-} cc_context_t;
-
-static
-rc_t report_rtn ( rc_t rc )
-{
-    return exhaustive ? 0 : rc;
-}
-
-static rc_t report_index(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc, "Index '$(index)': $(mesg)",
-                                    "index=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_Index:
-        return 0; /* continue with check */
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc, "File '$(file)' of index '$(index)' failed MD5 check",
-                                    "file=%s,index=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_column(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc, "Column '$(column)': $(mesg)",
-                                    "column=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Column '$(column)': $(mesg)", "column=%s,mesg=%s",
-                                     what->objName, what->info.done.mesg ? what->info.done.mesg : "checked"));
-            ++ctx->num_columns;
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_Blob:
-        return 0; /* continue with check */
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc, "File '$(file)' of column '$(column)' failed MD5 check",
-                                    "file=%s,column=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_table(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc, "Table '$(table)': $(mesg)",
-                                    "table=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else if (what->info.done.mesg) {
-            if (strcmp(what->info.done.mesg, "missing md5 file") == 0 && md5_required) {
-                rc_t rc = RC(0, rcTable, rcValidating, rcChecksum, rcNotFound);
-                (void)PLOGERR(klogErr, (klogErr, rc, "Table '$(table)': is missing required md5 files",
-                                        "table=%s", what->objName));
-                return rc;
-            }
-            else if (strncmp("unexpected object ", what->info.done.mesg, 18) == 0) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Table '$(tbl)': $(mesg)", "tbl=%s,mesg=%s",
-                                         what->objName, what->info.done.mesg));
-            }
-            else {
-                (void)PLOGMSG(klogInfo, (klogInfo, "Table '$(tbl)' metadata: $(mesg)",
-                                         "tbl=%s,mesg=%s", what->objName, what->info.done.mesg));
-            }
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc, "File '$(file)' of table '$(table)' failed MD5 check",
-                                    "file=%s,table=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_database(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc, "Database '$(db)': $(mesg)",
-                                    "db=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else if (what->info.done.mesg) {
-            if (strcmp(what->info.done.mesg, "missing md5 file") == 0 && md5_required) {
-                rc_t rc = RC(0, rcTable, rcValidating, rcChecksum, rcNotFound);
-                (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(table)': is missing required md5 files",
-                                        "table=%s", what->objName));
-                return rc;
-            }
-            else {
-                (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(db)' metadata: $(mesg)",
-                                         "db=%s,mesg=%s", what->objName, what->info.done.mesg));
-            }
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc, "File '$(file)' of database '$(db)' failed MD5 check",
-                                    "file=%s,db=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t visiting(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    unsigned const nn = ctx->nextNode++;
-    node_t *const nxt = &ctx->nodes[nn];
-    node_t *const cur = nxt - 1;
-    
-    nxt->parent = nxt->prvSibl = nxt->nxtSibl = nxt->firstChild = -1;
-    nxt->depth = what->info.visit.depth;
-    nxt->objType = what->objType;
-    nxt->name = ctx->nextName;
-    ctx->nextName += strlen(what->objName) + 1;
-    strcpy(&ctx->names[nxt->name], what->objName);
-    
-    if (nn) {
-        if (cur->depth == nxt->depth) {
-            nxt->parent = cur->parent;
-            nxt->prvSibl = nn - 1;
-            cur->nxtSibl = nn;
-        }
-        else if (cur->depth < nxt->depth) {
-            nxt->parent = nn - 1;
-            cur->firstChild = nn;
-        }
-        else {
-            unsigned sibling = cur->parent;
-            
-            while (ctx->nodes[sibling].depth > nxt->depth)
-                sibling = ctx->nodes[sibling].parent;
-            nxt->parent = ctx->nodes[sibling].parent;
-            nxt->prvSibl = sibling;
-            ctx->nodes[sibling].nxtSibl = nn;
-        }
-    }
-    return 0;
-}
-
-static rc_t CC report(CCReportInfoBlock const *what, void *Ctx)
-{
-    cc_context_t *ctx = Ctx;
-    rc_t rc = Quitting();
-    
-    if (rc)
-        return rc;
-    
-    if (what->type == ccrpt_Visit)
-        return visiting(what, ctx);
-
-    switch (what->objType) {
-    case kptDatabase:
-        return report_database(what, ctx);
-    case kptTable:
-        return report_table(what, ctx);
-    case kptColumn:
-        return report_column(what, ctx);
-    case kptIndex:
-        return report_index(what, ctx);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static
-rc_t kdbcc(const KDirectory *dir, char const name[], uint32_t mode, bool *is_db,
-    bool is_file, node_t nodes[], char names[], INSDC_SRA_platform_id platform)
-{
-    const KDBManager *mgr;
-    rc_t rc = KDBManagerMakeRead ( & mgr, NULL );
-
-    if ( rc == 0 )
-    {
-        cc_context_t ctx;
-        char const *objtype;
-
-        uint32_t level = ( mode & 4 ) ? 3 : ( mode & 2 ) ? 1 : 0;
-        if (s_IndexOnly) {
-            level |= CC_INDEX_ONLY;
-        }
-
-        memset(&ctx, 0, sizeof(ctx));
-        ctx.nodes = &nodes[0];
-        ctx.names = &names[0];
-
-        * is_db = KDBManagerExists ( mgr, kptDatabase, name );
-        if ( * is_db )
-        {
-            const KDatabase *db;
-            
-            objtype = "database";
-            rc = KDBManagerOpenDBRead ( mgr, & db, name );
-            if ( rc == 0 )
-            {
-                rc = KDatabaseConsistencyCheck ( db, 0, level, report, & ctx );
-                if ( rc == 0 ) {
-                    rc = ctx.rc;
-                    if (s_IndexOnly)
-                    {   (void)LOGMSG(klogInfo, "Indices: checked"); }
-                }
-                KDatabaseRelease ( db );
-            }
-        }
-        else
-        {
-            const KTable *tbl;
-
-            objtype = "table";
-            rc = KDBManagerOpenTableRead ( mgr, & tbl, name );
-            if ( rc == 0 )
-            {
-                rc = KTableConsistencyCheck ( tbl, 0, level, report, & ctx,
-                    platform );
-                if ( rc == 0 ) {
-                    rc = ctx.rc;
-                }
-                if ( rc == 0 && s_IndexOnly ) {
-                    (void)LOGMSG(klogInfo, "Index: checked");
-                }
-                KTableRelease ( tbl );
-            }
-        }
-        if (rc == 0 && ctx.num_columns == 0 && !s_IndexOnly) {
-            if (is_file) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Nothing to validate; the file '$(file)' has no checksums or is truncated.", "file=%s", name));
-            }
-            else {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Nothing to validate; the $(type) '$(file)' has no checksums or is empty.", "type=%s,file=%s", objtype, name));
-            }
-        }
-        
-        KDBManagerRelease ( mgr );
-    }
-    return rc;
-}
-
-static
-rc_t vdbcc(const KDirectory *dir, char const name[], uint32_t mode, bool is_db, bool is_file)
-{
-#if 0
-    if (mode & 8) {
-        const VDBManager *mgr;
-        rc_t rc = VDBManagerMakeRead(&mgr, dir);
-        
-        if (rc == 0) {
-            const VTable *tbl;
-            
-            rc = VDBManagerOpenTableRead(mgr, &tbl, NULL, name);
-            if (rc == 0)
-                rc = VTableConsistencyCheck(tbl, 2);
-        }
-        return rc;
-    }
-#endif
-    return 0;
-}
-
-typedef struct ColumnInfo_s {
-    char const *name;
-    union {
-        void     const *vp;
-        char     const *string;
-        bool     const *tf;
-        int8_t   const *i8;
-        uint8_t  const *u8;
-        int16_t  const *i16;
-        uint16_t const *u16;
-        int32_t  const *i32;
-        uint32_t const *u32;
-        int64_t  const *i64;
-        uint64_t const *u64;
-        float    const *f32;
-        double   const *f64;
-    } value;
-    uint32_t idx;
-    uint32_t elem_bits;
-    uint32_t elem_count;
-} ColumnInfo;
-
-static rc_t CC get_sizes_cb(const KDirectory *dir, uint32_t type, const char *name, void *data)
-{
-    struct {
-        unsigned count;
-        size_t size;
-    } *pb = data;
-
-    ++pb->count;    
-    pb->size += strlen(name) + 1;
-    
-    return 0;
-}
-
-static rc_t get_sizes(KDirectory const *dir, unsigned *nobj, size_t *namesz)
-{
-    rc_t rc;
-    struct {
-        unsigned count;
-        size_t size;
-    } pb;
-    
-    memset(&pb, 0, sizeof(pb));
-    rc = KDirectoryVVisit(dir, true, get_sizes_cb, &pb, NULL, NULL);
-    if (rc)
-        memset(&pb, 0, sizeof(pb));
-    *nobj = pb.count;
-    *namesz = pb.size;
-    return rc;
-}
-
-static rc_t init_dbcc(KDirectory const *dir, char const name[], bool is_file, node_t **nodes, char **names)
-{
-    KDirectory const *obj;
-    unsigned nobj;
-    size_t namesz;
-    rc_t rc;
-    
-    if (is_file) {
-        rc = KDirectoryOpenSraArchiveRead_silent(dir, &obj, false, name);
-        if (rc)
-            rc = KDirectoryOpenTarArchiveRead_silent(dir, &obj, false, name);
-    }
-    else {
-        rc = KDirectoryOpenDirRead(dir, &obj, false, name);
-    }
-    if (rc)
-        return rc;
-    rc = get_sizes(obj, &nobj, &namesz);
-    KDirectoryRelease(obj);
-    if (rc) {
-        *nodes = NULL;
-        *names = NULL;
-    }
-    else {
-        *nodes = malloc(nobj * sizeof(**nodes) + namesz);
-        if (nodes)
-            *names = (char *)&(*nodes)[nobj];
-        else
-            rc = RC(rcExe, rcSelf, rcConstructing, rcMemory, rcExhausted);
-    }
-    return rc;
-}
-
-static rc_t get_schema_info(KMetadata const *meta, char buffer[], size_t bsz, char **vers)
-{
-    KMDataNode const *node;
-    rc_t rc = KMetadataOpenNodeRead(meta, &node, "schema");
-    
-    if (rc == 0) {
-        size_t sz;
-        
-        rc = KMDataNodeReadAttr(node, "name", buffer, bsz, &sz);
-        if (rc == 0) {
-            buffer[sz] = '\0';
-            *vers = &buffer[sz];
-            while (sz) {
-                --sz;
-                if (buffer[sz] == '#') {
-                    buffer[sz] = '\0';
-                    *vers = &buffer[sz + 1];
-                    break;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t get_tbl_schema_info(VTable const *tbl, char buffer[], size_t bsz, char **vers)
-{
-    KMetadata const *meta;
-    rc_t rc = VTableOpenMetadataRead(tbl, &meta);
-    
-    *(*vers = &buffer[0]) = '\0';
-    if (rc == 0) rc = get_schema_info(meta, buffer, bsz, vers);
-    return 0;
-}
-
-static rc_t get_db_schema_info(VDatabase const *db, char buffer[], size_t bsz, char **vers)
-{
-    KMetadata const *meta;
-    rc_t rc = VDatabaseOpenMetadataRead(db, &meta);
-    
-    *(*vers = &buffer[0]) = '\0';
-    if (rc == 0) rc = get_schema_info(meta, buffer, bsz, vers);
-    return rc;
-}
-
-static rc_t sra_dbcc_454(VTable const *tbl, char const name[])
-{
-    /* TODO: complete this */
-    return 0;
-}
-
-static rc_t sra_dbcc_fastq(VTable const *tbl, char const name[])
-{
-    static char const *const cn_FastQ[] = {
-        "READ", "QUALITY", "SPOT_LEN", "READ_START", "READ_LEN", "READ_TYPE"
-    };
-    
-    VCursor const *curs;
-    rc_t rc = VTableCreateCursorRead(tbl, &curs);
-    
-    if (rc == 0) {
-        unsigned const n = sizeof(cn_FastQ)/sizeof(cn_FastQ[0]);
-        ColumnInfo cols[sizeof(cn_FastQ)/sizeof(cn_FastQ[0])];
-        unsigned i;
-
-        memset(cols, 0, sizeof(cols));
-        for (i = 0; i < n; ++i) {
-            cols[i].name = cn_FastQ[i];
-            VCursorAddColumn(curs, &cols[i].idx, cols[i].name);
-        }
-        rc = VCursorOpen(curs);
-        if (rc == 0) {
-            rc = VCursorOpenRow(curs);
-            for (i = 0; i < n && rc == 0; ++i) {
-                VCursorCellData(curs, cols[i].idx, &cols[i].elem_bits, &cols[i].value.vp, NULL, &cols[i].elem_count);
-            }
-            if (   cols[0].idx == 0 || cols[0].elem_bits == 0 || cols[0].value.vp == NULL
-                || cols[1].idx == 0 || cols[1].elem_bits == 0 || cols[1].value.vp == NULL)
-            {
-                rc = RC(rcExe, rcTable, rcValidating, rcColumn, rcNotFound);
-            }
-            else if (cols[2].idx == 0 || cols[2].elem_bits == 0 || cols[2].value.vp == NULL) {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcExe, rcTable, rcValidating, rcColumn, rcNotFound),
-                                         "Table '$(name)' is usable for fasta only; no quality data", "name=%s", name));
-            }
-        }
-        VCursorRelease(curs);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Table '$(name)' is damaged beyond any use", "name=%s", name));
-    }
-    return rc;
-}
-
-static rc_t VTable_get_platform(VTable const *tbl, INSDC_SRA_platform_id *rslt)
-{
-    rc_t rc;
-    VCursor const *curs;
-    INSDC_SRA_platform_id platform = -1;
-    
-    rc = VTableCreateCursorRead(tbl, &curs);
-    if (rc == 0) {
-        uint32_t cid;
-        
-        rc = VCursorAddColumn(curs, &cid, "("sra_platform_id_t")PLATFORM");
-        if (rc == 0) {
-            rc = VCursorOpen(curs);
-            if (rc == 0) {
-                uint32_t ebits;
-                void const *data;
-                uint32_t boff;
-                uint32_t ecnt;
-                
-                rc = VCursorCellDataDirect(curs, 1, cid, &ebits, &data, &boff, &ecnt);
-                if (rc == 0) {
-                    if (ebits == sizeof(platform) * 8 && boff == 0 && ecnt == 1)
-                        platform = ((INSDC_SRA_platform_id *)data)[0];
-                    else
-                        rc = RC(rcExe, rcTable, rcReading, rcType, rcUnexpected);
-                }
-            }
-        }
-        else
-            rc = 0;
-        VCursorRelease(curs);
-    }
-    rslt[0] = platform;
-    return rc;
-}
-
-static rc_t verify_table(VTable const *tbl, char const name[])
-{
-    char schemaName[1024];
-    char *schemaVers = NULL;
-    rc_t rc = 0;
-    
-    get_tbl_schema_info(tbl, schemaName, sizeof(schemaName), &schemaVers);
-    
-    if (schemaName[0] == '\0' || strncmp(schemaName, "NCBI:SRA:", 9) == 0) {
-        /* SRA or legacy SRA */
-        INSDC_SRA_platform_id platform;
-        
-        rc = VTable_get_platform(tbl, &platform);
-        if (rc == 0) {
-            if (platform == (INSDC_SRA_platform_id)-1) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Couldn't determine SRA Platform; type of table '$(name)' is indeterminate.", "name=%s", name));
-            }
-            rc = sra_dbcc_fastq(tbl, name);
-            if (rc == 0 && platform == SRA_PLATFORM_454) {
-                rc = sra_dbcc_454(tbl, name);
-            }
-        }
-        else {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to read table '$(name)'", "name=%s", name));
-        }
-    }
-    return rc;
-}
-
-static rc_t verify_mgr_table(VDBManager const *mgr, char const name[])
-{
-    VTable const *tbl;
-    VSchema *sra_schema = NULL;
-    
-    for ( ; ; ) {
-        rc_t rc = VDBManagerOpenTableRead(mgr, &tbl, sra_schema, name);
-        VSchemaRelease(sra_schema);
-        if (rc == 0) {
-            rc = verify_table(tbl, name);
-            VTableRelease(tbl);
-            return rc;
-        }
-        else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema && sra_schema == NULL) {
-            rc = VDBManagerMakeSRASchema(mgr, &sra_schema);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failed to open table '$(name)'", "name=%s", name));
-                return rc;
-            }
-        }
-        else {
-            (void)PLOGERR(klogErr, (klogErr, rc, "Failed to open table '$(name)'", "name=%s", name));
-            return rc;
-        }
-    }
-}
-
-#if 0
-static rc_t verify_db_table(VDatabase const *db, char const name[])
-{
-    VTable const *tbl;
-    rc_t rc = VDatabaseOpenTableRead(db, &tbl, name);
-    
-    if (rc == 0) {
-        rc = verify_table(tbl, name);
-        VTableRelease(tbl);
-    }
-    else {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to open table '$(name)'", "name=%s", name));
-    }
-    return rc;
-}
-
-static rc_t align_dbcc_primary_alignment(VTable const *tbl, char const name[])
-{
-    VCursor const *curs;
-    rc_t rc = VTableCreateCursorRead(tbl, &curs);
-    
-    if (rc == 0) {
-        static char const *const cn_SAM[] = {
-            "SEQ_NAME",
-            "SAM_FLAGS",
-            "REF_NAME",
-            "REF_POS",
-            "MAPQ",
-            "HAS_MISMATCH",
-            "HAS_REF_OFFSET",
-            "REF_OFFSET",
-            "MATE_REF_NAME",
-            "MATE_REF_POS",
-            "TEMPLATE_LEN",
-            "READ",
-            "QUALITY"
-        };
-        unsigned const n = sizeof(cn_SAM)/sizeof(cn_SAM[0]);
-        ColumnInfo cols[sizeof(cn_SAM)/sizeof(cn_SAM[0])];
-        unsigned i;
-        
-        memset(cols, 0, sizeof(cols));
-        for (i = 0; i < n; ++i) {
-            cols[i].name = cn_SAM[i];
-            VCursorAddColumn(curs, &cols[i].idx, cols[i].name);
-        }
-        rc = VCursorOpen(curs);
-        if (rc == 0) {
-            rc = VCursorOpenRow(curs);
-            for (i = 0; i < n && rc == 0; ++i) {
-                VCursorCellData(curs, cols[i].idx, &cols[i].elem_bits, &cols[i].value.vp, NULL, &cols[i].elem_count);
-            }
-            for (i = 0; i < n && rc == 0; ++i) {
-                if (cols[i].idx == 0 || cols[i].elem_bits == 0) {
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(name)' could not be used to generate SAM", "name=%s", name));
-                    break;
-                }
-            }
-        }
-        VCursorRelease(curs);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)' is damaged beyond any use", "name=%s", name));
-    }
-    return rc;
-}
-#endif
-
-typedef struct id_pair_s {
-    int64_t first;
-    int64_t second;
-} id_pair_t;
-
-static int CC id_pair_cmp(void const *A, void const *B, void *ignored)
-{
-    id_pair_t const *a = A;
-    id_pair_t const *b = B;
-    
-    return a->first < b->first ? -1 : a->first == b->first ? a->second < b->second ? -1 : a->second == b->second ? 0 : 1 : 1;
-}
-
-static rc_t ric_align_ref_and_align(char const dbname[],
-                                    VTable const *ref,
-                                    VTable const *align,
-                                    int which)
-{
-    char const *const id_col_name = which == 0 ? "PRIMARY_ALIGNMENT_IDS"
-                                  : which == 1 ? "SECONDARY_ALIGNMENT_IDS"
-                                  : which == 2 ? "EVIDENCE_ALIGNMENT_IDS"
-                                  : NULL;
-    rc_t rc;
-    VCursor const *curs = NULL;
-    ColumnInfo ci;
-    int64_t startId;
-    uint64_t count;
-    
-    rc = VTableCreateCursorRead(align, &curs);
-    if (rc == 0) {
-        rc = VCursorAddColumn(curs, &ci.idx, "REF_ID");
-        if (rc == 0)
-            rc = VCursorOpen(curs);
-        if (rc == 0)
-            rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': alignment table can not be read", "name=%s", dbname));
-    }
-    else {
-        id_pair_t *const id_pair = malloc(sizeof(id_pair_t) * count);
-        
-        if (id_pair) {
-            uint64_t i;
-            uint64_t j;
-            
-            for (j = i = 0; i < count && rc == 0; ++i) {
-                int64_t const row = startId + i;
-                
-                rc = VCursorCellDataDirect(curs, row, ci.idx, &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                if (rc == 0) {
-                    if (ci.elem_count != 1) {
-                        rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcUnexpected);
-                        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': failed referential integrity check", "name=%s", dbname));
-                        break;
-                    }
-                    else {
-                        id_pair[j].second = row;
-                        id_pair[j].first = ci.value.i64[0];
-                        ++j;
-                    }
-                }
-                else if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                    rc = 0;
-            }
-            VCursorRelease(curs); curs = NULL;
-            if (rc == 0) {
-                bool ooo_warned = false;
-                bool failed = false;
-                
-                ksort(id_pair, count, sizeof(id_pair_t), id_pair_cmp, NULL);
-                
-                rc = VTableCreateCursorRead(ref, &curs);
-                if (rc == 0)
-                    rc = VCursorAddColumn(curs, &ci.idx, id_col_name);
-                if (rc == 0)
-                    rc = VCursorOpen(curs);
-                if (rc == 0)
-                    rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-                if (rc == 0) {
-                    for (i = j = 0; rc == 0 && i < count; ++i) {
-                        int64_t const row = startId + i;
-                        
-                        rc = VCursorCellDataDirect(curs, row, ci.idx, &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                        if (rc == 0) {
-                            unsigned k;
-                            int64_t prvId = ci.value.i64[0];
-                            
-                            for (k = 0; rc == 0 && k < ci.elem_count; ++k, ++j) {
-                                int64_t const alignId = ci.value.i64[k];
-                                
-                                if (!ooo_warned && prvId > alignId) {
-                                    (void)PLOGMSG(klogWarn, (klogWarn, "Database '$(name)': column '$(idcol)' is not ordered", "name=%s,idcol=%s", dbname, id_col_name));
-                                    ooo_warned = true;
-                                }
-                                if (id_pair[j].first != row) {
-                                    if (!failed) {
-                                        rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcInconsistent);
-                                        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': column '$(idcol)' failed referential integrity check", "name=%s,idcol=%s", dbname, id_col_name));
-                                    }
-                                    failed = true;
-                                }
-                                else if (id_pair[j].second != alignId) {
-                                    if (!ooo_warned) {
-                                        (void)PLOGMSG(klogWarn, (klogWarn, "Database '$(name)': column '$(idcol)' might fail referential integrity check", "name=%s,idcol=%s", dbname, id_col_name));
-                                    }
-                                }
-                                prvId = alignId;
-                            }
-                        }
-                        else if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                            rc = 0;
-                    }
-                    if (!failed && i < count) {
-                        rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcInconsistent);
-                        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': column '$(idcol)' failed referential integrity check", "name=%s,idcol=%s", dbname, id_col_name));
-                    }
-                }
-                else
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': reference table can not be read", "name=%s", dbname));
-            }
-            free(id_pair);
-            VCursorRelease(curs);
-        }
-        else {
-            rc = RC(rcExe, rcDatabase, rcValidating, rcMemory, rcExhausted);
-            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': referential integrity could not be checked", "name=%s", dbname));
-        }
-    }
-    return rc;
-}
-
-static rc_t ric_align_seq_and_pri(char const dbname[],
-                                  VTable const *seq,
-                                  VTable const *pri)
-{
-    rc_t rc;
-    VCursor const *curs = NULL;
-    ColumnInfo ci;
-    int64_t startId;
-    uint64_t count;
-    
-    rc = VTableCreateCursorRead(pri, &curs);
-    if (rc == 0) {
-        rc = VCursorAddColumn(curs, &ci.idx, "SEQ_SPOT_ID");
-        if (rc == 0)
-            rc = VCursorOpen(curs);
-        if (rc == 0)
-            rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': alignment table can not be read", "name=%s", dbname));
-    }
-    else {
-        id_pair_t *const id_pair = malloc(sizeof(id_pair_t) * count);
-
-        if (id_pair) {
-            uint64_t i;
-            uint64_t j;
-            
-            for (j = i = 0; i < count && rc == 0; ++i) {
-                int64_t const row = startId + i;
-                
-                rc = VCursorCellDataDirect(curs, row, ci.idx, &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                if (rc == 0) {
-                    if (ci.elem_count != 1) {
-                        rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcUnexpected);
-                        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': failed referential integrity check", "name=%s", dbname));
-                        break;
-                    }
-                    else {
-                        id_pair[j].second = row;
-                        id_pair[j].first = ci.value.i64[0];
-                        ++j;
-                    }
-                }
-                else if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound)
-                    rc = 0;
-            }
-            VCursorRelease(curs); curs = NULL;
-            if (rc == 0) {
-                ksort(id_pair, count, sizeof(id_pair_t), id_pair_cmp, NULL);
-                
-                rc = VTableCreateCursorRead(seq, &curs);
-                if (rc == 0)
-                    rc = VCursorAddColumn(curs, &ci.idx, "PRIMARY_ALIGNMENT_ID");
-                if (rc == 0)
-                    rc = VCursorOpen(curs);
-                if (rc == 0) {
-                    for (i = 0; rc == 0 && i < count; ++i) {
-                        int64_t const row = id_pair[i].first;
-                        int64_t const alignId = id_pair[i].second;
-                        
-                        rc = VCursorCellDataDirect(curs, row, ci.idx, &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                        if (rc == 0) {
-                            bool found = false;
-                            
-                            for (j = 0; j < ci.elem_count; ++j)
-                                found |= (alignId == ci.value.i64[j]);
-                            
-                            if (!found) {
-                                rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcInconsistent);
-                                (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': column 'SEQ_SPOT_ID' failed referential integrity check", "name=%s", dbname));
-                            }
-                        }
-                        else if (GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound) {
-                            rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcInconsistent);
-                            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': column 'SEQ_SPOT_ID' failed referential integrity check", "name=%s", dbname));
-                        }
-                        else
-                            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': sequence table can not be read", "name=%s", dbname));
-                    }
-                }
-                else
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': sequence table can not be read", "name=%s", dbname));
-            }
-            free(id_pair);
-        }
-        else {
-            rc = RC(rcExe, rcDatabase, rcValidating, rcMemory, rcExhausted);
-            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': referential integrity could not be checked", "name=%s", dbname));
-        }
-        VCursorRelease(curs);
-    }
-    return rc;
-}
-
-/* database referential integrity check for alignment database */
-static rc_t dbric_align(char const dbname[],
-                        VTable const *pri,
-                        VTable const *seq,
-                        VTable const *ref)
-{
-    rc_t rc = 0;
-    
-    if ((rc == 0 || exhaustive) && (pri != NULL && seq != NULL)) {
-        rc_t rc2 = ric_align_seq_and_pri(dbname, seq, pri);
-        
-        if (rc2 == 0) {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(dbname)': SEQUENCE.PRIMARY_ALIGNMENT_ID <-> PRIMARY_ALIGNMENT.SEQ_SPOT_ID referential integrity ok", "dbname=%s", dbname));
-        }
-        if (rc == 0) {
-            rc = rc2;
-        }
-    }
-    if ((rc == 0 || exhaustive) && (pri != NULL && ref != NULL)) {
-        rc_t rc2 = ric_align_ref_and_align(dbname, ref, pri, 0);
-        
-        if (rc2 == 0) {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(dbname)': REFERENCE.PRIMARY_ALIGNMENT_IDS <-> PRIMARY_ALIGNMENT.REF_ID referential integrity ok", "dbname=%s", dbname));
-        }
-        if (rc == 0) {
-            rc = rc2;
-        }
-    }
-    return rc;
-}
-                        
-
-static rc_t verify_database_align(VDatabase const *db, char const name[], node_t const nodes[], char const names[])
-{
-    rc_t rc = 0;
-    unsigned tables = 0;
-    node_t const *tbl = &nodes[nodes[0].firstChild];
-    enum table_bits {
-        tbEvidenceInterval   = ( 1u << 0 ),
-        tbEvidenceAlignment  = ( 1u << 1 ),
-        tbPrimaryAlignment   = ( 1u << 2 ),
-        tbReference          = ( 1u << 3 ),
-        tbSequence           = ( 1u << 4 ),
-        tbSecondaryAlignment = ( 1u << 5 )
-    };
-    
-    if (nodes[0].firstChild) {
-        for ( ; ; ) {
-            char const *tname = &names[tbl->name];
-            unsigned this_table = 0;
-            
-            if (tbl->objType == kptTable) {
-                switch (tname[0]) {
-                case 'E':
-                    if (strcmp(tname, "EVIDENCE_INTERVAL") == 0)
-                        this_table |= tbEvidenceInterval;
-                    else if (strcmp(tname, "EVIDENCE_ALIGNMENT") == 0)
-                        this_table |= tbEvidenceAlignment;
-                    break;
-                case 'P':
-                    if (strcmp(tname, "PRIMARY_ALIGNMENT") == 0)
-                        this_table |= tbPrimaryAlignment;
-                    break;
-                case 'R':
-                    if (strcmp(tname, "REFERENCE") == 0)
-                        this_table |= tbReference;
-                    break;
-                case 'S':
-                    if (strcmp(tname, "SEQUENCE") == 0)
-                        this_table |= tbSequence;
-                    else if (strcmp(tname, "SECONDARY_ALIGNMENT") == 0)
-                        this_table |= tbSecondaryAlignment;
-                    break;
-                }
-                if (this_table == 0) {
-                    (void)PLOGERR(klogWarn, (klogWarn, RC(rcExe, rcDatabase, rcValidating, rcTable, rcUnexpected),
-                                             "Database '$(name)' contains unexpected table '$(table)'",
-                                             "name=%s,table=%s", name, tname));
-                }
-                tables |= this_table;
-            }
-            else {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(rcExe, rcDatabase, rcValidating, rcType, rcUnexpected),
-                                         "Database '$(name)' contains unexpected object '$(obj)'",
-                                         "name=%s,obj=%s", name, tname));
-            }
-            if (tbl->nxtSibl > 0)
-                tbl = &nodes[tbl->nxtSibl];
-            else
-                break;
-        }
-    }
-    if (tables == tbSequence) {
-        /* sequence data only */
-        (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(name)' contains only unaligned reads", "name=%s", name));
-    }
-    else if (   (tables & tbReference) == 0
-             || (tables & tbPrimaryAlignment) == 0)
-    {
-        /* missing reference or primary alignment */
-        (void)PLOGERR(klogWarn, (klogWarn, rc = RC(rcExe, rcDatabase, rcValidating, rcDatabase, rcIncomplete),
-                                 "Database '$(name)' does not contain all required tables",
-                                 "name=%s", name));
-    }
-    else if (   ((tables & tbEvidenceAlignment) != 0)
-             != ((tables & tbEvidenceInterval ) != 0))
-    {
-        /* both must be present or both must be absent */
-        (void)PLOGERR(klogWarn, (klogWarn, rc = RC(rcExe, rcDatabase, rcValidating, rcDatabase, rcIncomplete),
-                                 "Database '$(name)' does not contain all required tables",
-                                 "name=%s", name));
-    }
-    while (ref_int_check) {
-        VTable const *pri = NULL;
-        VTable const *seq = NULL;
-        VTable const *ref = NULL;
-        
-        if ((tables & tbPrimaryAlignment) != 0) {
-            rc = VDatabaseOpenTableRead(db, &pri, "PRIMARY_ALIGNMENT");
-            if (rc) break;
-        }
-        if ((tables & tbSequence) != 0) {
-            rc = VDatabaseOpenTableRead(db, &seq, "SEQUENCE");
-            if (rc) break;
-        }
-        if ((tables & tbReference) != 0) {
-            rc = VDatabaseOpenTableRead(db, &ref, "REFERENCE");
-            if (rc) break;
-        }
-        rc = dbric_align(name, pri, seq, ref);
-        break;
-    }
-    return rc;    
-}
-
-static rc_t verify_database(VDatabase const *db, char const name[], node_t const nodes[], char const names[])
-{
-    char schemaName[1024];
-    char *schemaVers = NULL;
-    rc_t rc;
-    
-    rc = get_db_schema_info(db, schemaName, sizeof(schemaName), &schemaVers);
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Failed to find database schema for '$(name)'", "name=%s", name));
-    }
-    else if (strncmp(schemaName, "NCBI:var:db:", 12) == 0) {
-        /* TODO: verify NCBI:var:db:* */
-    }
-    else if (strncmp(schemaName, "NCBI:WGS:db:", 12) == 0) {
-        /* TODO: verify NCBI:WGS:db:* */
-    }
-    else if (strncmp(schemaName, "NCBI:align:db:", 14) == 0) {
-        rc = verify_database_align(db, name, nodes, names);
-    }
-    else if (strcmp(schemaName, "NCBI:SRA:PacBio:smrt:db") == 0) {
-        /* TODO: verify NCBI:SRA:PacBio:smrt:db */
-    }
-    else {
-        (void)PLOGERR(klogWarn, (klogWarn, RC(rcExe, rcDatabase, rcValidating, rcType, rcUnrecognized),
-                                 "Database '$(name)' has unrecognized type '$(type)'",
-                                 "name=%s,type=%s", name, schemaName));
-    }
-    return rc;
-}
-
-static rc_t verify_mgr_database(VDBManager const *mgr, char const name[], node_t const nodes[], char const names[])
-{
-    VDatabase const *child;
-    rc_t rc = VDBManagerOpenDBRead(mgr, &child, NULL, name);
-    
-    if (rc == 0) {
-        rc = verify_database(child, name, nodes, names);
-        VDatabaseRelease(child);
-    }
-    return rc;
-}
-
-static rc_t sra_dbcc(KDirectory const *dir, char const name[], node_t const nodes[], char const names[])
-{
-    const VDBManager *mgr;
-    rc_t rc = VDBManagerMakeRead(&mgr, NULL);
-    
-    if (rc) return rc;
-    
-    if (nodes[0].objType == kptDatabase)
-        rc = verify_mgr_database(mgr, name, nodes, names);
-    else
-        rc = verify_mgr_table(mgr, name);
-    VDBManagerRelease(mgr);
-    
-    return rc;
-}
-
-static
-rc_t get_platform(const KDirectory *dir, const VDBManager *aMgr,
-    const VTable *aTbl, char const name[], INSDC_SRA_platform_id *platform)
-{
-    rc_t rc = 0;
-    const VDBManager *mgr = aMgr;
-    const VTable *tbl = aTbl;
-    assert(name && platform);
-    if (mgr == NULL) {
-        rc = VDBManagerMakeRead(&mgr, NULL);
-        if (rc != 0) {
-            return rc;
-        }
-    }
-    if (tbl == NULL) {
-        VSchema *sra_schema = NULL;
-        for ( ; rc == 0; ) {
-            rc = VDBManagerOpenTableRead(mgr, &tbl, sra_schema, name);
-            VSchemaRelease(sra_schema);
-            if (rc == 0) {
-                rc = VTable_get_platform(tbl, platform);
-                break;
-            }
-            else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema
-                && sra_schema == NULL)
-            {
-                rc = VDBManagerMakeSRASchema(mgr, &sra_schema);
-            }
-        }
-    }
-    if (aTbl == NULL) {
-        VTableRelease(tbl);
-    }
-    if (aMgr == NULL) {
-        VDBManagerRelease(mgr);
-    }
-    return rc;
-}
-
-static
-rc_t dbcc(const char *src_path, const KDirectory *dir,
-    char const name[], uint32_t mode, bool *is_db, bool is_file)
-{
-    rc_t rc;
-    node_t *nodes = NULL;
-    char *names;
-
-    assert(src_path);
-
-    rc = init_dbcc(dir, name, is_file, &nodes, &names);
-    if (rc == 0) {
-        INSDC_SRA_platform_id platform = SRA_PLATFORM_UNDEFINED;
-        get_platform(dir, NULL, NULL, src_path, &platform);
-        rc = kdbcc(dir, src_path, mode, is_db, is_file, nodes, names, platform);
-        if ( rc == 0 )
-            rc = vdbcc(dir, src_path, mode, * is_db, is_file);
-    }
-    if (rc == 0)
-        rc = sra_dbcc(dir, src_path, nodes, names);
-
-    free(nodes);
-
-    return rc;
-}
-
-static char const* const defaultLogLevel = 
-#if _DEBUGGING
-"debug5";
-#else
-"info";
-#endif
-
-/******************************************************************************
- * Usage
- ******************************************************************************/
-const char UsageDefaultName[] = "sra-dbcc";
-
-rc_t CC UsageSummary(const char *prog_name)
-{
-    return KOutMsg("Usage: %s [options] table\n\n", prog_name);
-}
-
-char const *help_text[] = 
-{
-    "Check components md5s if present, fail unless other checks are requested (default: yes)", NULL,
-    "Check blobs CRC32 (default: no)", NULL,
-    "Check 'skey' index (default: no)", NULL,
-    "Continue checking table for all possible errors (default: no)", NULL,
-    "Check data referential integrity for databases (default: no)", NULL,
-    "Check index-only with blobs CRC32 (default: no)", NULL
-};
-
-OptDef Options[] = 
-{
-    { "md5"       , "5", NULL, &help_text[0], 1, false, false },
-    { "blob-crc"  , "b", NULL, &help_text[2], 1, false, false },
-#if CHECK_INDEX
-    { "index"     , "i", NULL, &help_text[4], 1, false, false },
-#endif
-    { "exhaustive", "x", NULL, &help_text[6], 1, false, false },
-    { "dri"       , "d", NULL, &help_text[8], 1, false, false },
-
-    /* should be the last one here: it is not printed by --help */
-    { "index-only",NULL, NULL, &help_text[10], 1, false, false }
-};
-#define NOPTS ( sizeof(Options)/sizeof(Options[0]))
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-    unsigned i;
-    
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-    
-    UsageSummary (progname);
-    
-    KOutMsg ("Options:\n");
-    
-    for (i = 0; i != NOPTS - 1; ++i) {
-        HelpOptionLine(Options[i].aliases, Options[i].name, NULL, Options[i].help);
-    }
-    
-    HelpOptionsStandard ();
-    
-    HelpVersion (fullpath, KAppVersion());
-    
-    return 0;
-}
-
-uint32_t CC KAppVersion(void)
-{
-    return SRA_DBCC_VERS;
-}
-
-#ifdef MAC
-#define SRAPathMake(...) (RC(rcRuntime, rcDylib, rcSearching, rcFunction, rcUnsupported))
-#define SRAPathFind(...) (RC(rcRuntime, rcDylib, rcSearching, rcFunction, rcUnsupported))
-#define SRAPathRelease(...) ((rc_t)(0))
-#endif
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    char *src_dir_path = NULL;
-    char *src_path = NULL;
-    char *obj_name = NULL;
-    bool md5_chk = true, md5_chk_explicit = false;
-    bool blob_crc = false;
-    bool index_chk = false;
-    bool is_file = false;
-    const KDirectory *src_dir = NULL;
-/*  char path_buffer [ 4096 ]; */
-    VFSManager *mgr = NULL;
-    VResolver *resolver = NULL;
-
-    rc_t rc = KLogLevelSet ( klogInfo );
-
-    if ( rc == 0 )
-        rc = ArgsMakeAndHandle(&args, argc, argv, 1, Options, NOPTS);
-    
-    if (rc == 0) {
-        rc = VFSManagerMake(&mgr);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Failed to VFSManagerMake()");
-        }
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerGetResolver(mgr, &resolver);
-        if (rc != 0) {
-            LOGERR(klogInt, rc, "Cannot VFSManagerGetResolver");
-        }
-        else {
-            VResolverRemoteEnable(resolver, vrAlwaysDisable);
-        }
-    }
-
-    RELEASE(VFSManager, mgr);
-
-    while (rc == 0) {
-        uint32_t pcount;
-        
-        rc = ArgsParamCount(args, &pcount); if (rc) break;
-        if (pcount == 1) {
-            KDirectory *dir;
-            rc = KDirectoryNativeDir(&dir);
-            if (rc == 0)
-            {
-                char const *value;
-                
-                rc = ArgsParamValue (args, 0, &value); if (rc) break;
-                src_dir_path = strdup(value);
-                src_path = strdup(value);
-                obj_name = strrchr(src_dir_path, '/');
-                if ( obj_name != NULL && obj_name [ 1 ] == 0 )
-                {
-                    * obj_name = 0;
-                    obj_name = strrchr(src_dir_path, '/');
-                }
-                if (obj_name != NULL)
-                {
-                    if (obj_name == src_dir_path) {
-                        src_dir_path[0] = '/';
-                        src_dir_path[1] = '\0';
-                    }
-                    *obj_name++ = '\0';
-                }
-                else
-                {
-                    uint32_t type
-                        = KDirectoryPathType(dir, src_path) & ~kptAlias;
-                    if (type != kptFile && type != kptDir) {
-                        /* check for accession */
-                        VPath *acc = NULL;
-                        const VPath *pLocal = NULL;
-                        const String *local = NULL;
-
-                        if (rc == 0) {
-                            rc = VPathMake(&acc, src_path);
-                            if (rc != 0) {
-                                PLOGERR(klogErr, (klogErr, rc,
-                                    "VPathMake($(path)) failed",
-                                    PLOG_S(path), src_path));
-                            }
-                            else {
-                               rc = VResolverLocal(resolver, acc, &pLocal);
-                            }
-                        }
-                        if (rc == 0) {
-                            rc = VPathMakeString(pLocal, &local);
-                            if (rc != 0) {
-                                PLOGERR(klogErr, (klogErr, rc,
-                                    "VPathMake(local $(path)) failed",
-                                    PLOG_S(path), src_path));
-                            }
-                        }
-                        if ( rc == 0 )
-                        {
-                            PLOGMSG(klogInfo, (klogInfo,
-                                "Validating '$(path)'...", PLOG_S(path),
-                                local->addr));
-                            /* use mapped path */
-                            free(src_path);
-                            src_path = string_dup(local->addr, local->size);
-                            free(src_dir_path);
-                            src_dir_path = string_dup(local->addr, local->size);
-                            obj_name = strrchr(src_dir_path, '/');
-                            if ( obj_name == NULL )
-                                obj_name = src_dir_path;
-                            else
-                            {
-                                if ( obj_name == src_dir_path ) {
-                                    src_dir_path[0] = '/';
-                                    src_dir_path[1] = '\0';
-                                }
-                                * obj_name ++ = '\0';
-                            }
-                        }
-
-                        RELEASE(VPath, pLocal);
-                        RELEASE(VPath, acc);
-                        free((void*)local);
-                    }
-                    else {
-                        char full[PATH_MAX];
-                        rc = KDirectoryResolvePath(dir, true,
-                            full, sizeof full, src_path);
-                        if (rc == 0) {
-                            PLOGMSG(klogInfo, (klogInfo,
-                                "Validating '$(path)'...", PLOG_S(path),
-                                full));
-                            /* use mapped path */
-                            free(src_path);
-                            src_path = string_dup(full, strlen(full));
-                            free(src_dir_path);
-                            src_dir_path = string_dup(full, strlen(full));
-                            obj_name = strrchr(src_dir_path, '/');
-                            if ( obj_name == NULL )
-                                obj_name = src_dir_path;
-                            else
-                            {
-                                if ( obj_name == src_dir_path ) {
-                                    src_dir_path[0] = '/';
-                                    src_dir_path[1] = '\0';
-                                }
-                                * obj_name ++ = '\0';
-                            }
-                        }
-                    }
-
-                    if ( rc != 0 )
-                    {
-                        /* appears to be a simple name */
-                        obj_name = strdup(src_dir_path);
-                        src_dir_path[0] = '.';
-                        src_dir_path[1] = '\0';
-                    }
-                }
-                
-                rc = KDirectoryOpenDirRead(dir, &src_dir, false, src_dir_path);
-                KDirectoryRelease(dir);
-                if (rc) {
-                    (void)PLOGERR(klogErr, (klogErr, rc,
-                        "Failed to open '$(dir)'", "dir=%s", src_dir_path));
-                    break;
-                }
-                else {
-                    uint32_t const obj_type = KDirectoryPathType(src_dir, obj_name) & (~((uint32_t)kptAlias));
-                    
-                    switch (obj_type) {
-                    case kptFile:
-                        is_file = true;
-                        break;
-                    default:
-                        break;
-                    }
-                }
-            }
-        }
-        else {
-            MiniUsage(args);
-            ArgsWhack(args);
-            exit(EXIT_FAILURE);
-        }
-
-        rc = ArgsOptionCount(args, "md5", &pcount); if (rc) break;
-        md5_chk_explicit = md5_required = (pcount == 1);
-        if (pcount > 1) {
-            KOutMsg("argument given too many times\n");
-            MiniUsage(args);
-            break;
-        }
-        
-        rc = ArgsOptionCount(args, "blob-crc", &pcount); if (rc) break;
-        blob_crc = (pcount == 1);
-        if (pcount > 1) {
-            KOutMsg("argument given too many times\n");
-            MiniUsage(args);
-            break;
-        }
-        
-        rc = ArgsOptionCount(args, "exhaustive", &pcount); if (rc) break;
-        exhaustive = (pcount == 1);
-        if (pcount > 1) {
-            KOutMsg("argument given too many times\n");
-            MiniUsage(args);
-            break;
-        }
-        
-        rc = ArgsOptionCount(args, "dri", &pcount); if (rc) break;
-        ref_int_check = (pcount == 1);
-        if (pcount > 1) {
-            KOutMsg("argument given too many times\n");
-            MiniUsage(args);
-            break;
-        }
-        
-#if CHECK_INDEX
-        rc = ArgsOptionCount(args, "index", &pcount); if (rc) break;
-        index_chk = (pcount == 1);
-        if (pcount > 1) {
-            KOutMsg("argument given too many times\n");
-            MiniUsage(args);
-            break;
-        }
-#endif
-
-        rc = ArgsOptionCount(args, "index-only", &pcount);
-        if (rc) {
-            break;
-        }
-        if (pcount > 0) {
-            s_IndexOnly = blob_crc = true;
-        }
-            
-
-        if (blob_crc || index_chk)
-        {
-            /* if blob or index is requested, md5 is off unless explicitly requested */
-            md5_chk = md5_chk_explicit;
-        }
-        
-        {
-            bool is_db = false;
-            rc = dbcc(src_path, src_dir, obj_name, (md5_chk ? 1 : 0)|(blob_crc ? 2 : 0)|(index_chk ? 4 : 0), & is_db, is_file);
-            if ( is_db )
-            {
-                if ( rc != 0 )
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(db)' check failed", PLOG_S(db), obj_name));
-                else
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(db)' is consistent", PLOG_S(db), obj_name));
-            }
-            else
-            {
-                if ( rc != 0 )
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Table '$(table)' check failed", PLOG_S(table), obj_name));
-                else
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Table '$(table)' is consistent", PLOG_S(table), obj_name));
-            }
-        }
-        break;
-    }
-
-    RELEASE(VResolver, resolver);
-    RELEASE(KDirectory, src_dir);
-    free(src_path);
-   
-    return rc;
-}
diff --git a/tools/sra-dbcc/sra-dbcc.vers b/tools/sra-dbcc/sra-dbcc.vers
deleted file mode 100644
index f90b1af..0000000
--- a/tools/sra-dbcc/sra-dbcc.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.2
diff --git a/tools/sra-dump/Makefile b/tools/sra-dump/Makefile
deleted file mode 100644
index 51302a8..0000000
--- a/tools/sra-dump/Makefile
+++ /dev/null
@@ -1,162 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-dump
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	fastq-dump \
-	sff-dump \
-	illumina-dump \
-	abi-dump
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_TOOLS))
-
-#-------------------------------------------------------------------------------
-# Common dumper definitions
-#
-DUMP_COMMON_SRC = \
-	factory \
-	fasta_dump \
-	core
-
-DUMP_COMMON_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-#-------------------------------------------------------------------------------
-# fastq-dump
-#
-FASTQ_DUMP_SRC = \
-	$(DUMP_COMMON_SRC) \
-	fastq
-
-FASTQ_DUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(FASTQ_DUMP_SRC))
-
-$(BINDIR)/fastq-dump: $(FASTQ_DUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(DUMP_COMMON_LIB)
-
-fastq-dump_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) fastq-dump $(FASTQ_DUMP_OBJ)
-
-#-------------------------------------------------------------------------------
-# sff-dump
-#
-SFF_DUMP_SRC = \
-	$(DUMP_COMMON_SRC) \
-	sff
-
-SFF_DUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(SFF_DUMP_SRC))
-
-$(BINDIR)/sff-dump: $(SFF_DUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(DUMP_COMMON_LIB)
-
-sff-dump_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) sff-dump $(SFF_DUMP_OBJ)
-
-#-------------------------------------------------------------------------------
-# illumina-dump
-#
-ILLUMINA_DUMP_SRC = \
-	$(DUMP_COMMON_SRC) \
-	illumina
-
-ILLUMINA_DUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(ILLUMINA_DUMP_SRC))
-
-$(BINDIR)/illumina-dump: $(ILLUMINA_DUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(DUMP_COMMON_LIB)
-
-illumina-dump_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) illumina-dump $(ILLUMINA_DUMP_OBJ)
-
-#-------------------------------------------------------------------------------
-# abi-dump
-#
-ABI_DUMP_SRC = \
-	$(DUMP_COMMON_SRC) \
-	abi
-
-ABI_DUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(ABI_DUMP_SRC))
-
-$(BINDIR)/abi-dump: $(ABI_DUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(DUMP_COMMON_LIB)
-
-abi-dump_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) abi-dump $(ABI_DUMP_OBJ)
diff --git a/tools/sra-dump/abi-dump.vers b/tools/sra-dump/abi-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-dump/abi-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-dump/abi.c b/tools/sra-dump/abi.c
deleted file mode 100644
index 3cdfdcc..0000000
--- a/tools/sra-dump/abi.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/container.h>
-#include <klib/printf.h>
-#include <kapp/main.h>
-
-#include <sra/sradb.h>
-#include <sra/abi.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "core.h"
-#include "abi-dump.vers.h"
-#include "debug.h"
-
-#define DATABUFFERINITSIZE 10240
-
-/* ============== Absolid read type (bio/tech) filter ============================ */
-
-typedef struct Absolid2BioFilter_struct {
-    const AbsolidReader* reader;
-} Absolid2BioFilter;
-
-/* leave only up to 2 first bio reads */
-static
-rc_t Absolid2BioFilter_GetKey(const SRASplitter* cself, const char** key, spotid_t spot, readmask_t* readmask)
-{
-    rc_t rc = 0;
-    Absolid2BioFilter* self = (Absolid2BioFilter*)cself;
-
-    if( self == NULL || key == NULL ) {
-        rc = RC(rcExe, rcNode, rcExecuting, rcParam, rcInvalid);
-    } else {
-        if( (rc = AbsolidReaderSeekSpot(self->reader, spot)) == 0 ) {
-            uint32_t num_reads = 0;
-            if( (rc = AbsolidReader_SpotInfo(self->reader, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                uint32_t q, readId;
-                make_readmask(new_mask);
-                SRAReadTypes read_type = SRA_READ_TYPE_TECHNICAL;
-
-                clear_readmask(new_mask);
-                for(q = 0, readId = 0; rc == 0 && readId < num_reads && q < 2; readId++) {
-                    if( (rc = AbsolidReader_SpotReadInfo(self->reader, readId + 1, &read_type, NULL, NULL, NULL, NULL)) == 0 ) {
-                        if( read_type & SRA_READ_TYPE_BIOLOGICAL ) {
-                            set_readmask(new_mask, readId);
-                            q++;
-                        }
-                    }
-                }
-                *key = "";
-                copy_readmask(new_mask, readmask);
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            *key = NULL;
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct Absolid2BioFilterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    const AbsolidReader* reader;
-} Absolid2BioFilterFactory;
-
-static
-rc_t Absolid2BioFilterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    Absolid2BioFilterFactory* self = (Absolid2BioFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else {
-        rc = AbsolidReaderMake(&self->reader, self->table, self->accession,
-                               false, false, 0, 0, 0, false);
-    }
-    return rc;
-}
-
-static
-rc_t Absolid2BioFilterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    Absolid2BioFilterFactory* self = (Absolid2BioFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(Absolid2BioFilter), Absolid2BioFilter_GetKey, NULL, NULL, NULL)) == 0 ) {
-            ((Absolid2BioFilter*)(*splitter))->reader = self->reader;
-        }
-    }
-    return rc;
-}
-
-static
-void Absolid2BioFilterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        Absolid2BioFilterFactory* self = (Absolid2BioFilterFactory*)cself;
-        AbsolidReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t Absolid2BioFilterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table)
-{
-    rc_t rc = 0;
-    Absolid2BioFilterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterSpot, sizeof(*obj),
-                                             Absolid2BioFilterFactory_Init,
-                                             Absolid2BioFilterFactory_NewObj,
-                                             Absolid2BioFilterFactory_Release)) == 0 ) {
-        obj = (Absolid2BioFilterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-    }
-    return rc;
-}
-
-/* ============== Absolid label assigning ============================ */
-
-typedef struct AbsolidLabelerFilter_struct {
-    const AbsolidReader* reader;
-    bool is_platform_cs_native;
-    SRASplitter_Keys keys[7];
-    size_t key_sz[7];
-} AbsolidLabelerFilter;
-
-static
-rc_t AbsolidLabelerFilter_GetKeySet(const SRASplitter* cself, const SRASplitter_Keys** key, uint32_t* keys, spotid_t spot, const readmask_t* readmask)
-{
-    rc_t rc = 0;
-    AbsolidLabelerFilter* self = (AbsolidLabelerFilter*)cself;
-
-    if( self == NULL || key == NULL ) {
-        rc = RC(rcExe, rcNode, rcExecuting, rcParam, rcInvalid);
-    } else {
-        *keys = 0;
-        if( rc == 0 && (rc = AbsolidReaderSeekSpot(self->reader, spot)) == 0 ) {
-            uint32_t num_reads = 0;
-            if( (rc = AbsolidReader_SpotInfo(self->reader, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                uint32_t readId, q;
-                const char* read_label;
-                INSDC_coord_len read_label_sz = 0;
-                INSDC_coord_len read_len = 0;
-
-                *key = self->keys;
-                *keys = sizeof(self->keys) / sizeof(self->keys[0]);
-                for(q = 0; q < *keys; q++) {
-                    clear_readmask(self->keys[q].readmask);
-                }
-                for(q = 0, readId = 0; rc == 0 && readId < num_reads; readId++) {
-                    if( !isset_readmask(readmask, readId) ) {
-                        continue;
-                    }
-                    rc = AbsolidReader_SpotReadInfo(self->reader, readId + 1, NULL, &read_label, &read_label_sz, NULL, &read_len);
-                    if( read_len == 0 ) {
-                        continue;
-                    }
-                    if( self->is_platform_cs_native ) {
-                        uint32_t i;
-                        for(i = 0; i < *keys; i++) {
-                            if( read_label_sz == self->key_sz[i] && strncmp(read_label, self->keys[i].key, read_label_sz) == 0 ) {
-                                set_readmask(self->keys[i].readmask, readId);
-                                break;
-                            }
-                        }
-                        if( i >= *keys ) {
-                            rc = RC(rcExe, rcNode, rcExecuting, rcTag, rcUnexpected);
-                        }
-                    } else {
-                        /* since prev filter leaves only 2 first bio reads labels F3 and R3 wil be used */
-                        set_readmask(self->keys[q].readmask, readId);
-                    }
-                    q++;
-                }
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct AbsolidLabelerFilterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    bool is_platform_cs_native;
-    const AbsolidReader* reader;
-} AbsolidLabelerFilterFactory;
-
-static
-rc_t AbsolidLabelerFilterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    AbsolidLabelerFilterFactory* self = (AbsolidLabelerFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else {
-        rc = AbsolidReaderMake(&self->reader, self->table, self->accession,
-                               false, false, 0, 0, 0, false);
-    }
-    return rc;
-}
-
-static
-rc_t AbsolidLabelerFilterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    AbsolidLabelerFilterFactory* self = (AbsolidLabelerFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(AbsolidLabelerFilter), NULL, AbsolidLabelerFilter_GetKeySet, NULL, NULL)) == 0 ) {
-            ((AbsolidLabelerFilter*)(*splitter))->reader = self->reader;
-            ((AbsolidLabelerFilter*)(*splitter))->is_platform_cs_native = self->is_platform_cs_native;
-            ((AbsolidLabelerFilter*)(*splitter))->keys[0].key = "F3";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[1].key = "R3";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[2].key = "F5-P2";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[3].key = "F5-BC";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[4].key = "F5-RNA";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[5].key = "F5-DNA";
-            ((AbsolidLabelerFilter*)(*splitter))->keys[6].key = "F3-DNA";
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[0] = 2;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[1] = 2;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[2] = 5;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[3] = 5;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[4] = 6;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[5] = 6;
-            ((AbsolidLabelerFilter*)(*splitter))->key_sz[6] = 6;
-        }
-    }
-    return rc;
-}
-
-static
-void AbsolidLabelerFilterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        AbsolidLabelerFilterFactory* self = (AbsolidLabelerFilterFactory*)cself;
-        AbsolidReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t AbsolidLabelerFilterFactory_Make(const SRASplitterFactory** cself, const char* accession,
-                                      const SRATable* table, bool is_platform_cs_native)
-{
-    rc_t rc = 0;
-    AbsolidLabelerFilterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterRead, sizeof(*obj),
-                                             AbsolidLabelerFilterFactory_Init,
-                                             AbsolidLabelerFilterFactory_NewObj,
-                                             AbsolidLabelerFilterFactory_Release)) == 0 ) {
-        obj = (AbsolidLabelerFilterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-        obj->is_platform_cs_native = is_platform_cs_native;
-    }
-    return rc;
-}
-
-/* ============== Absolid min read length splitter ============================ */
-
-char* AbsolidReadLenFilter_key_buf = NULL;
-
-typedef struct AbsolidReadLenFilter_struct {
-    const AbsolidReader* reader;
-} AbsolidReadLenFilter;
-
-
-/* skip all reads with len < minreadlen */
-static
-rc_t AbsolidReadLenFilter_GetKey(const SRASplitter* cself, const char** key, spotid_t spot, readmask_t* readmask)
-{
-    rc_t rc = 0;
-    AbsolidReadLenFilter* self = (AbsolidReadLenFilter*)cself;
-
-    if( self == NULL || key == NULL ) {
-        rc = RC(rcExe, rcNode, rcExecuting, rcParam, rcInvalid);
-    } else {
-        *key = "";
-
-        if( rc == 0 && (rc = AbsolidReaderSeekSpot(self->reader, spot)) == 0 ) {
-            uint32_t num_reads = 0;
-            if( (rc = AbsolidReader_SpotInfo(self->reader, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                uint32_t readId;
-                make_readmask(new_mask);
-                INSDC_coord_len read_len = 0;
-
-                clear_readmask(new_mask);
-                for(readId = 0; rc == 0 && readId < num_reads; readId++) {
-                    if( !isset_readmask(readmask, readId) ) {
-                        continue;
-                    }
-                    rc = AbsolidReader_SpotReadInfo(self->reader, readId + 1, NULL, NULL, NULL, NULL, &read_len);
-                    if( rc == 0 && read_len > 0 ) {
-                        set_readmask(new_mask, readId);
-                    }
-                }
-                copy_readmask(new_mask, readmask);
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            *key = NULL;
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct AbsolidReadLenFilterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    bool clip;
-    uint32_t minReadLen;
-    const AbsolidReader* reader;
-} AbsolidReadLenFilterFactory;
-
-static
-rc_t AbsolidReadLenFilterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    AbsolidReadLenFilterFactory* self = (AbsolidReadLenFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else {
-        rc = AbsolidReaderMake(&self->reader, self->table, self->accession,
-                               false, !self->clip, self->minReadLen, 0, 0, false);
-    }
-    return rc;
-}
-
-static
-rc_t AbsolidReadLenFilterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    AbsolidReadLenFilterFactory* self = (AbsolidReadLenFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(AbsolidReadLenFilter), AbsolidReadLenFilter_GetKey, NULL, NULL, NULL)) == 0 ) {
-            ((AbsolidReadLenFilter*)(*splitter))->reader = self->reader;
-        }
-    }
-    return rc;
-}
-
-static
-void AbsolidReadLenFilterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        AbsolidReadLenFilterFactory* self = (AbsolidReadLenFilterFactory*)cself;
-        AbsolidReaderWhack(self->reader);
-        free(AbsolidReadLenFilter_key_buf);
-    }
-}
-
-static
-rc_t AbsolidReadLenFilterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table,
-                                      bool clip, uint32_t minReadLen)
-{
-    rc_t rc = 0;
-    AbsolidReadLenFilterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterSpot, sizeof(*obj),
-                                             AbsolidReadLenFilterFactory_Init,
-                                             AbsolidReadLenFilterFactory_NewObj,
-                                             AbsolidReadLenFilterFactory_Release)) == 0 ) {
-        obj = (AbsolidReadLenFilterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-        obj->minReadLen = minReadLen;
-        obj->clip = clip;
-    }
-    return rc;
-}
-
-/* ============== Absolid quality filter ============================ */
-
-typedef struct AbsolidQFilter_struct {
-    const AbsolidReader* reader;
-    KDataBuffer* b;
-} AbsolidQFilter;
-
-
-/* filter out reads by leading/trialing quality */
-static
-rc_t AbsolidQFilter_GetKey(const SRASplitter* cself, const char** key, spotid_t spot, readmask_t* readmask)
-{
-    rc_t rc = 0;
-    AbsolidQFilter* self = (AbsolidQFilter*)cself;
-
-    if( self == NULL || key == NULL ) {
-        rc = RC(rcExe, rcNode, rcExecuting, rcParam, rcInvalid);
-    } else {
-        uint32_t num_reads = 0;
-
-        if( (rc = AbsolidReaderSeekSpot(self->reader, spot)) == 0 ) {
-            if( (rc = AbsolidReader_SpotInfo(self->reader, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                uint32_t readId;
-                make_readmask(new_mask);
-                INSDC_coord_len read_len = 0;
-                static char const* const colorStr = "..........";
-                static const int xLen = 10;
-
-                clear_readmask(new_mask);
-                for(readId = 0; rc == 0 && readId < num_reads; readId++) {
-                    if( (rc = AbsolidReader_SpotReadInfo(self->reader, readId + 1, NULL, NULL, NULL, NULL, &read_len)) == 0 ) {
-                        IF_BUF((AbsolidReaderBase(self->reader, readId + 1, self->b->base, KDataBufferBytes(self->b), NULL)), self->b, read_len) {
-                            const char* b = self->b->base;
-                            if( strncmp(&b[1], colorStr, xLen) == 0 && strcmp(&b[read_len - xLen + 1], colorStr) == 0 )  {
-                                continue;
-                            }
-                        }
-                        set_readmask(new_mask, readId);
-                    }
-                }
-                *key = "";
-                copy_readmask(new_mask, readmask);
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            *key = NULL;
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct AbsolidQFilterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    bool clip;
-    const AbsolidReader* reader;
-    KDataBuffer buf;
-} AbsolidQFilterFactory;
-
-static
-rc_t AbsolidQFilterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    AbsolidQFilterFactory* self = (AbsolidQFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = KDataBufferMakeBytes(&self->buf, DATABUFFERINITSIZE)) == 0 ) {
-        rc = AbsolidReaderMake(&self->reader, self->table, self->accession,
-                               false, self->clip, 0, 0, 0, false);
-    }
-    return rc;
-}
-
-static
-rc_t AbsolidQFilterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    AbsolidQFilterFactory* self = (AbsolidQFilterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcExe, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(AbsolidQFilter), AbsolidQFilter_GetKey, NULL, NULL, NULL)) == 0 ) {
-            ((AbsolidQFilter*)(*splitter))->reader = self->reader;
-            ((AbsolidQFilter*)(*splitter))->b = &self->buf;
-        }
-    }
-    return rc;
-}
-
-static
-void AbsolidQFilterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        AbsolidQFilterFactory* self = (AbsolidQFilterFactory*)cself;
-        KDataBufferWhack(&self->buf);
-        AbsolidReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t AbsolidQFilterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table, bool clip)
-{
-    rc_t rc = 0;
-    AbsolidQFilterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcExe, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterSpot, sizeof(*obj),
-                                             AbsolidQFilterFactory_Init,
-                                             AbsolidQFilterFactory_NewObj,
-                                             AbsolidQFilterFactory_Release)) == 0 ) {
-        obj = (AbsolidQFilterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-        obj->clip = clip;
-    }
-    return rc;
-}
-
-/* ============== Absolid formatter object  ============================ */
-
-typedef struct AbsolidFormatterSplitter_struct {
-    const AbsolidReader* reader;
-    char pfx[10 * 1024];
-    int pfx_sz;
-    KDataBuffer* hb;
-    KDataBuffer* b;
-} AbsolidFormatterSplitter;
-
-static
-rc_t AbsolidFormatterSplitter_Dump(const SRASplitter* cself, spotid_t spot, const readmask_t* readmask)
-{
-    rc_t rc = 0;
-    AbsolidFormatterSplitter* self = (AbsolidFormatterSplitter*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = AbsolidReaderSeekSpot(self->reader, spot)) == 0 ) {
-            const char* prefix;
-            size_t head_sz, writ = 0;
-            uint32_t num_reads, readId;
-
-            rc = AbsolidReader_SpotInfo(self->reader, NULL, NULL, NULL, &num_reads);
-
-            for(readId = 1; rc == 0 && readId <= num_reads; readId++) {
-                if( !isset_readmask(readmask, readId - 1) ) {
-                    continue;
-                }
-                if( (rc = AbsolidReaderSpotName(self->reader, &prefix, &head_sz, NULL, NULL)) == 0 ) {
-                    if( head_sz != self->pfx_sz || memcmp(self->pfx, prefix, head_sz) != 0 ) {
-                        if( head_sz >= sizeof(self->pfx) ) {
-                            rc = RC(rcSRA, rcString, rcCopying, rcBuffer, rcInsufficient);
-                        } else {
-                            self->pfx_sz = head_sz;
-                            memcpy(self->pfx, prefix, head_sz);
-                            IF_BUF((string_printf(self->hb->base, KDataBufferBytes(self->hb), &head_sz,
-                                   "#\n# Title: %.*s\n#\n", self->pfx_sz, self->pfx)), self->hb, head_sz);
-                        }
-                    } else {
-                        head_sz = 0;
-                    }
-                }
-                if( rc == 0 ) {
-                    char* h = self->hb->base;
-                    IF_BUF((AbsolidReaderHeader(self->reader, readId, &h[head_sz],
-                            KDataBufferBytes(self->hb) - head_sz - 1, &writ)), self->hb, writ + head_sz + 1) {
-                        head_sz += writ;
-                        h[head_sz++] = '\n';
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, ".csfasta")) == 0 ) {
-                    IF_BUF((AbsolidReaderBase(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, "_QV.qual")) == 0 ) {
-                    IF_BUF((AbsolidReaderQuality(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, "_intensity.ScaledFTC.fasta")) == 0 ) {
-                    IF_BUF((AbsolidReaderSignalFTC(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, "_intensity.ScaledCY3.fasta")) == 0 ) {
-                    IF_BUF((AbsolidReaderSignalCY3(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, "_intensity.ScaledTXR.fasta")) == 0 ) {
-                    IF_BUF((AbsolidReaderSignalTXR(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-                if( rc == 0 && (rc = SRASplitter_FileActivate(cself, "_intensity.ScaledCY5.fasta")) == 0 ) {
-                    IF_BUF((AbsolidReaderSignalCY5(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                        if( writ > 0 && (rc = SRASplitter_FileWrite(cself, 0, self->hb->base, head_sz)) == 0 ) {
-                            ((char*)(self->b->base))[writ] = '\n';
-                            rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                        }
-                    }
-                }
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct AbsolidFormatterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    bool orig;
-    bool clip;
-    const AbsolidReader* reader;
-    KDataBuffer hbuf;
-    KDataBuffer buf;
-} AbsolidFormatterFactory;
-
-static
-rc_t AbsolidFormatterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    AbsolidFormatterFactory* self = (AbsolidFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = KDataBufferMakeBytes(&self->hbuf, DATABUFFERINITSIZE)) == 0 &&
-               (rc = KDataBufferMakeBytes(&self->buf, DATABUFFERINITSIZE)) == 0 ) {
-        rc = AbsolidReaderMake(&self->reader, self->table, self->accession,
-                               self->orig, !self->clip, 0, 0, 0, true);
-    }
-    return rc;
-}
-
-static
-rc_t AbsolidFormatterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    AbsolidFormatterFactory* self = (AbsolidFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(AbsolidFormatterSplitter), NULL, NULL, AbsolidFormatterSplitter_Dump, NULL)) == 0 ) {
-            ((AbsolidFormatterSplitter*)(*splitter))->reader = self->reader;
-            ((AbsolidFormatterSplitter*)(*splitter))->pfx[0] = '\0';
-            ((AbsolidFormatterSplitter*)(*splitter))->pfx_sz = 0;
-            ((AbsolidFormatterSplitter*)(*splitter))->hb = &self->hbuf;
-            ((AbsolidFormatterSplitter*)(*splitter))->b = &self->buf;
-
-        }
-    }
-    return rc;
-}
-
-static
-void AbsolidFormatterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        AbsolidFormatterFactory* self = (AbsolidFormatterFactory*)cself;
-        KDataBufferWhack(&self->hbuf);
-        KDataBufferWhack(&self->buf);
-        AbsolidReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t AbsolidFormatterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table, bool orig, bool clip)
-{
-    rc_t rc = 0;
-    AbsolidFormatterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterFormat, sizeof(*obj),
-                                             AbsolidFormatterFactory_Init,
-                                             AbsolidFormatterFactory_NewObj,
-                                             AbsolidFormatterFactory_Release)) == 0 ) {
-        obj = (AbsolidFormatterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-        obj->orig = orig;
-        obj->clip = clip;
-    }
-    return rc;
-}
-
-/* ### External entry points ##################################################### */
-const char UsageDefaultName[] = "abi-dump";
-rc_t CC UsageSummary (const char * progname)
-{
-    return 0;
-}
-
-
-ver_t CC KAppVersion( void )
-{
-    return ABI_DUMP_VERS;
-}
-
-struct AbsolidArgs_struct {
-    bool is_platform_cs_native;
-
-    uint32_t minReadLen;
-    bool applyClip;
-    bool dumpOrigFmt;
-    bool qual_filter;
-} AbsolidArgs;
-
-rc_t AbsolidDumper_Release(const SRADumperFmt* fmt)
-{
-    if( fmt == NULL ) {
-        return RC(rcExe, rcFormatter, rcDestroying, rcParam, rcInvalid);
-    }
-    return 0;
-}
-
-bool AbsolidDumper_AddArg(const SRADumperFmt* fmt, GetArg* f, int* i, int argc, char *argv[])
-{
-    const char* arg = NULL;
-
-    if( fmt == NULL || f == NULL || i == NULL || argv == NULL ) {
-        LOGERR(klogErr, RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid), "null param");
-        return false;
-    } else if( f(fmt, "M", "minReadLen", i, argc, argv, &arg) ) {
-        AbsolidArgs.minReadLen = AsciiToU32(arg, NULL, NULL);
-    } else if( f(fmt, "W", "noclip", i, argc, argv, NULL) ) {
-        AbsolidArgs.applyClip = false;
-    } else if( f(fmt, "F", "origfmt", i, argc, argv, NULL) ) {
-        AbsolidArgs.dumpOrigFmt = true;
-    } else if( f(fmt, "B", "noDotReads", i, argc, argv, NULL) ) {
-        AbsolidArgs.qual_filter = true;
-    } else {
-        return false;
-    }
-    return true;
-}
-
-rc_t AbsolidDumper_Factories(const SRADumperFmt* fmt, const SRASplitterFactory** factory)
-{
-    rc_t rc = 0;
-    const SRASplitterFactory* parent = NULL, *child = NULL;
-
-    if( fmt == NULL || factory == NULL ) {
-        return RC(rcExe, rcFormatter, rcReading, rcParam, rcInvalid);
-    }
-    *factory = NULL;
-
-    {
-        const SRAColumn* c = NULL;
-        if( (rc = SRATableOpenColumnRead(fmt->table, &c, "PLATFORM", sra_platform_id_t)) == 0 ) {
-            const INSDC_SRA_platform_id* platform;
-            bitsz_t o, z;
-            if( (rc = SRAColumnRead(c, 1, (const void **)&platform, &o, &z)) == 0 ) {
-                if( *platform == SRA_PLATFORM_ABSOLID ) {
-                    AbsolidArgs.is_platform_cs_native = true;
-                }
-            }
-            SRAColumnRelease(c);
-        } else if( GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcColumn ) {
-            rc = 0;
-        }
-    }
-
-    if( rc == 0 ) {
-        if( (rc = Absolid2BioFilterFactory_Make(&child, fmt->accession, fmt->table)) == 0 ) {
-            if( parent != NULL ) {
-                if( (rc = SRASplitterFactory_AddNext(parent, child)) != 0 ) {
-                    SRASplitterFactory_Release(child);
-                } else {
-                    parent = child;
-                }
-            } else {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-    if( rc == 0 ) {
-        if( (rc = AbsolidLabelerFilterFactory_Make(&child, fmt->accession, fmt->table, AbsolidArgs.is_platform_cs_native)) == 0 ) {
-            if( parent != NULL ) {
-                if( (rc = SRASplitterFactory_AddNext(parent, child)) != 0 ) {
-                    SRASplitterFactory_Release(child);
-                } else {
-                    parent = child;
-                }
-            } else {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-    if( rc == 0 && AbsolidArgs.minReadLen > 0 ) {
-        if( (rc = AbsolidReadLenFilterFactory_Make(&child, fmt->accession, fmt->table,
-                                                   AbsolidArgs.applyClip, AbsolidArgs.minReadLen)) == 0 ) {
-            if( parent != NULL ) {
-                if( (rc = SRASplitterFactory_AddNext(parent, child)) != 0 ) {
-                    SRASplitterFactory_Release(child);
-                } else {
-                    parent = child;
-                }
-            } else {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-    if( rc == 0 && AbsolidArgs.qual_filter ) {
-        if( (rc = AbsolidQFilterFactory_Make(&child, fmt->accession, fmt->table, AbsolidArgs.applyClip)) == 0 ) {
-            if( parent != NULL ) {
-                if( (rc = SRASplitterFactory_AddNext(parent, child)) != 0 ) {
-                    SRASplitterFactory_Release(child);
-                } else {
-                    parent = child;
-                }
-            } else {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-    if( rc == 0 ) {
-        if( (rc = AbsolidFormatterFactory_Make(&child, fmt->accession, fmt->table,
-                                               AbsolidArgs.dumpOrigFmt, AbsolidArgs.applyClip)) == 0 ) {
-            if( parent != NULL ) {
-                if( (rc = SRASplitterFactory_AddNext(parent, child)) != 0 ) {
-                    SRASplitterFactory_Release(child);
-                }
-            } else {
-                *factory = child;
-            }
-        }
-    }
-    return rc;
-}
-
-/* main entry point of the file */
-rc_t SRADumper_Init(SRADumperFmt* fmt)
-{
-    static const SRADumperFmt_Arg arg[] =
-        {
-            {"M", "minReadLen", "len", {"Minimum read length to output, default is 25", NULL}},
-            {"W", "noclip", NULL, {"Do not clip quality left and right for spot", NULL}},
-            {"F", "origfmt", NULL, {"Excludes SRR accession on defline", NULL}},
-            {"B", "noDotReads", NULL, {"Do not output reads consisting mostly of dots", NULL}},
-            {NULL, NULL, NULL, {NULL}}
-        };
-    AbsolidArgs.is_platform_cs_native = false;
-    AbsolidArgs.minReadLen = 25;
-    AbsolidArgs.applyClip = true;
-    AbsolidArgs.dumpOrigFmt = false;
-    AbsolidArgs.qual_filter = false;
-
-    if( fmt == NULL ) {
-        return RC(rcExe, rcFileFormat, rcConstructing, rcParam, rcNull);
-    }
-    fmt->release = AbsolidDumper_Release;
-    fmt->arg_desc = arg;
-    fmt->add_arg = AbsolidDumper_AddArg;
-    fmt->get_factory = AbsolidDumper_Factories;
-    fmt->gzip = true;
-    fmt->bzip2 = true;
-
-    return 0;
-}
diff --git a/tools/sra-dump/core.c b/tools/sra-dump/core.c
deleted file mode 100644
index 4ab00b8..0000000
--- a/tools/sra-dump/core.c
+++ /dev/null
@@ -1,1690 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <vdb/table.h> /* VTableRelease */
-#include <kfg/config.h> /* KConfigDisableUserSettings */
-
-#include <vdb/manager.h> /* VDBManagerRelease */
-#include <kdb/manager.h> /* for different path-types */
-#include <vdb/dependencies.h> /* UIError */
-#include <klib/report.h> /* ReportInit */
-#include <vdb/report.h>
-#include <vdb/database.h>
-#include <klib/container.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <kapp/main.h>
-#include <kfs/directory.h>
-#include <sra/sradb-priv.h>
-#include <sra/types.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "debug.h"
-#include "core.h"
-#include "fasta_dump.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-/* ### checks to see if NREADS <= nreads_max defined in factory.h ##################################################### */
-
-typedef struct MaxNReadsValidator_struct
-{
-    const SRAColumn* col;
-    uint64_t rejected_spots;
-} MaxNReadsValidator;
-
-
-static rc_t MaxNReadsValidator_GetKey( const SRASplitter* cself, 
-    const char** key, spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    MaxNReadsValidator* self = ( MaxNReadsValidator* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        const void* nreads = NULL;
-        bitsz_t o = 0, sz = 0;
-        uint64_t nn = 0;
-
-        *key = "";
-        if ( self->col != NULL )
-        {
-            rc = SRAColumnRead( self->col, spot, &nreads, &o, &sz );
-            if ( rc == 0 )
-            {
-                switch( sz )
-                {
-                    case 8:
-                        nn = *((const uint8_t*)nreads);
-                        break;
-                    case 16:
-                        nn = *((const uint16_t*)nreads);
-                        break;
-                    case 32:
-                        nn = *((const uint32_t*)nreads);
-                        break;
-                    case 64:
-                        nn = *((const uint64_t*)nreads);
-                        break;
-                    default:
-                        rc = RC( rcSRA, rcNode, rcExecuting, rcData, rcUnexpected );
-                        break;
-                }
-                if ( nn > nreads_max )
-                {
-                    clear_readmask( readmask );
-                    self->rejected_spots ++;
-                    PLOGMSG(klogWarn, (klogWarn, "too many reads $(nreads) at spot id $(row), maximum $(max) supported, skipped",
-                                       PLOG_3(PLOG_U64(nreads),PLOG_I64(row),PLOG_U32(max)), nn, spot, nreads_max));
-                }
-                else if ( nn == nreads_max - 1 )
-                {
-                    PLOGMSG(klogWarn, (klogWarn, "too many reads $(nreads) at spot id $(row), truncated to $(max)",
-                                       PLOG_3(PLOG_U64(nreads),PLOG_I64(row),PLOG_U32(max)), nn + 1, spot, nreads_max));
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t MaxNReadsValidator_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    MaxNReadsValidator* self = ( MaxNReadsValidator* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else if ( !g_legacy_report )
-    {
-        if ( self->rejected_spots > 0 )
-            rc = KOutMsg( "Rejected %lu SPOTS because of to many READS\n", self->rejected_spots );
-    }
-    return rc;
-}
-
-
-typedef struct MaxNReadsValidatorFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col;
-} MaxNReadsValidatorFactory;
-
-
-static rc_t MaxNReadsValidatorFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    MaxNReadsValidatorFactory* self = ( MaxNReadsValidatorFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRATableOpenColumnRead( self->table, &self->col, "NREADS", NULL );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) == rcNotFound || GetRCState( rc ) == rcExists )
-            {
-                rc = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t MaxNReadsValidatorFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    MaxNReadsValidatorFactory* self = ( MaxNReadsValidatorFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof(MaxNReadsValidator),
-                               MaxNReadsValidator_GetKey, NULL, NULL, MaxNReadsValidator_Release );
-        if ( rc == 0 )
-        {
-            MaxNReadsValidator * filter = ( MaxNReadsValidator * )( * splitter );
-            filter->col = self->col;
-            filter->rejected_spots = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void MaxNReadsValidatorFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        MaxNReadsValidatorFactory* self = ( MaxNReadsValidatorFactory* )cself;
-        SRAColumnRelease( self->col );
-    }
-}
-
-
-static rc_t MaxNReadsValidatorFactory_Make( const SRASplitterFactory** cself, const SRATable* table )
-{
-    rc_t rc = 0;
-    MaxNReadsValidatorFactory* obj = NULL;
-
-    if( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                     MaxNReadsValidatorFactory_Init,
-                                     MaxNReadsValidatorFactory_NewObj,
-                                     MaxNReadsValidatorFactory_Release);
-        if ( rc == 0 )
-        {
-            obj = ( MaxNReadsValidatorFactory* )*cself;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-/* ### READ_FILTER splitter/filter ##################################################### */
-
-enum EReadFilterSplitter_names
-{
-    EReadFilterSplitter_pass = 0,
-    EReadFilterSplitter_reject,
-    EReadFilterSplitter_criteria,
-    EReadFilterSplitter_redacted,
-    EReadFilterSplitter_unknown,
-    EReadFilterSplitter_max
-};
-
-
-typedef struct ReadFilterSplitter_struct
-{
-    const SRAColumn* col_rdf;
-    SRAReadFilter read_filter;
-    SRASplitter_Keys keys[5];
-} ReadFilterSplitter;
-
-
-static rc_t ReadFilterSplitter_GetKeySet( const SRASplitter* cself,
-        const SRASplitter_Keys** key, uint32_t* keys, spotid_t spot, const readmask_t* readmask )
-{
-    rc_t rc = 0;
-    ReadFilterSplitter* self = ( ReadFilterSplitter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        const INSDC_SRA_read_filter* rdf;
-        bitsz_t o = 0, sz = 0;
-
-        *keys = 0;
-        if ( self->col_rdf != NULL )
-        {
-            rc = SRAColumnRead( self->col_rdf, spot, (const void **)&rdf, &o, &sz );
-            if ( rc == 0 && sz > 0 )
-            {
-                int32_t j, i = sz / sizeof( INSDC_SRA_read_filter ) / 8;
-                *key = self->keys;
-                *keys = sizeof( self->keys ) / sizeof( self->keys[ 0 ] );
-                for ( j = 0; j < *keys; j++ )
-                {
-                    clear_readmask( self->keys[ j ].readmask );
-                }
-                while ( i > 0 )
-                {
-                    i--;
-                    if ( self->read_filter != 0xFF && self->read_filter != rdf[i] )
-                    {
-                        /* skip by filter value != to command line */
-                    }
-                    else if ( rdf[ i ] == SRA_READ_FILTER_PASS )
-                    {
-                        set_readmask( self->keys[ EReadFilterSplitter_pass ].readmask, i );
-                    }
-                    else if ( rdf[ i ] == SRA_READ_FILTER_REJECT )
-                    {
-                        set_readmask( self->keys[ EReadFilterSplitter_reject ].readmask, i );
-                    }
-                    else if( rdf[ i ] == SRA_READ_FILTER_CRITERIA )
-                    {
-                        set_readmask( self->keys[ EReadFilterSplitter_criteria ].readmask, i );
-                    }
-                    else if( rdf[ i ] == SRA_READ_FILTER_REDACTED )
-                    {
-                        set_readmask( self->keys[ EReadFilterSplitter_redacted ].readmask, i );
-                    }
-                    else
-                    {
-                        set_readmask( self->keys[ EReadFilterSplitter_unknown ].readmask, i );
-                        PLOGMSG( klogWarn, ( klogWarn,
-                                 "unknown READ_FILTER value $(value) at spot id $(row)",
-                                 PLOG_2( PLOG_U8( value ), PLOG_I64( row ) ), rdf[ i ], spot ) );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-typedef struct ReadFilterSplitterFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col_rdf;
-    SRAReadFilter read_filter;
-} ReadFilterSplitterFactory;
-
-
-static rc_t ReadFilterSplitterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    ReadFilterSplitterFactory* self = ( ReadFilterSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRATableOpenColumnRead( self->table, &self->col_rdf, "READ_FILTER", sra_read_filter_t );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) == rcNotFound )
-            {
-                LOGMSG( klogWarn, "Column READ_FILTER was not found, param ignored" );
-                rc = 0;
-            }
-            else if ( GetRCState( rc ) == rcExists )
-            {
-                rc = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t ReadFilterSplitterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    ReadFilterSplitterFactory* self = ( ReadFilterSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof(ReadFilterSplitter), NULL,
-                               ReadFilterSplitter_GetKeySet, NULL, NULL );
-        if ( rc == 0 )
-        {
-            ( (ReadFilterSplitter*)(*splitter) )->col_rdf = self->col_rdf;
-            ( (ReadFilterSplitter*)(*splitter) )->read_filter = self->read_filter;
-            ( (ReadFilterSplitter*)(*splitter) )->keys[ EReadFilterSplitter_pass ].key = "pass";
-            ( (ReadFilterSplitter*)(*splitter) )->keys[ EReadFilterSplitter_reject ].key = "reject";
-            ( (ReadFilterSplitter*)(*splitter) )->keys[ EReadFilterSplitter_criteria ].key = "criteria";
-            ( (ReadFilterSplitter*)(*splitter) )->keys[ EReadFilterSplitter_redacted ].key = "redacted";
-            ( (ReadFilterSplitter*)(*splitter) )->keys[ EReadFilterSplitter_unknown ].key = "unknown";
-        }
-    }
-    return rc;
-}
-
-
-static void ReadFilterSplitterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        ReadFilterSplitterFactory* self = ( ReadFilterSplitterFactory* )cself;
-        SRAColumnRelease( self->col_rdf );
-    }
-}
-
-
-static rc_t ReadFilterSplitterFactory_Make( const SRASplitterFactory** cself,
-            const SRATable* table, SRAReadFilter read_filter )
-{
-    rc_t rc = 0;
-    ReadFilterSplitterFactory* obj = NULL;
-
-    if ( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterRead, sizeof( *obj ),
-                                        ReadFilterSplitterFactory_Init,
-                                        ReadFilterSplitterFactory_NewObj,
-                                        ReadFilterSplitterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( ReadFilterSplitterFactory* ) *cself;
-            obj->table = table;
-            obj->read_filter = read_filter;
-        }
-    }
-    return rc;
-}
-
-
-/* ### SPOT_GROUP splitter/filter ##################################################### */
-
-typedef struct SpotGroupSplitter_struct
-{
-    char cur_key[ 256 ];
-    const SRAColumn* col;
-    char* const* spot_group;
-    uint64_t rejected_spots;
-    bool split;
-} SpotGroupSplitter;
-
-
-static rc_t SpotGroupSplitter_GetKey( const SRASplitter* cself,
-            const char** key, spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    SpotGroupSplitter* self = ( SpotGroupSplitter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        *key = self->cur_key;
-        if ( self->col != NULL )
-        {
-            const char* g = NULL;
-            bitsz_t o = 0, sz = 0;
-            rc = SRAColumnRead( self->col, spot, (const void **)&g, &o, &sz );
-            if ( rc == 0 && sz > 0 )
-            {
-                sz /= 8;
-                /* truncate trailing \0 */
-                while ( sz > 0 && g[ sz - 1 ] == '\0' )
-                {
-                    sz--;
-                }
-                if ( sz > sizeof( self->cur_key ) - 1 )
-                {
-                    rc = RC( rcSRA, rcNode, rcExecuting, rcBuffer, rcInsufficient );
-                }
-                else
-                {
-                    int i;
-                    bool found = false;
-                    memcpy( self->cur_key, g, sz );
-                    self->cur_key[ sz ] = '\0';
-                    for ( i = 0; self->spot_group[ i ] != NULL; i++ )
-                    {
-                        if ( strcmp( self->cur_key, self->spot_group[ i ] ) == 0 )
-                        {
-                            found = true;
-                            break;
-                        }
-                    }
-                    if ( self->spot_group[ 0 ] != NULL && !found )
-                    {
-                        /* list not empty and not in list -> skip */
-                        self->rejected_spots ++;
-                        *key = NULL;
-                    }
-                    else if ( !self->split )
-                    {
-                        *key = "";
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t SpotGroupSplitter_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    SpotGroupSplitter* self = ( SpotGroupSplitter* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else if ( !g_legacy_report )
-    {
-        if ( self->rejected_spots > 0 )
-            rc = KOutMsg( "Rejected %lu SPOTS because of spotgroup filtering\n", self->rejected_spots );
-    }
-    return rc;
-}
-
-typedef struct SpotGroupSplitterFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col;
-    bool split;
-    char* const* spot_group;
-} SpotGroupSplitterFactory;
-
-
-static rc_t SpotGroupSplitterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    SpotGroupSplitterFactory* self = ( SpotGroupSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRATableOpenColumnRead( self->table, &self->col, "SPOT_GROUP", vdb_ascii_t );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) == rcNotFound )
-            {
-                LOGMSG(klogWarn, "Column SPOT_GROUP was not found, param ignored");
-                rc = 0;
-            }
-            else if ( GetRCState( rc ) == rcExists )
-            {
-                rc = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t SpotGroupSplitterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    SpotGroupSplitterFactory* self = ( SpotGroupSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( SpotGroupSplitter ),
-                               SpotGroupSplitter_GetKey, NULL, NULL, SpotGroupSplitter_Release );
-        if ( rc == 0 )
-        {
-            SpotGroupSplitter * filter = ( SpotGroupSplitter * )( * splitter );
-            filter->col = self->col;
-            filter->split = self->split;
-            filter->spot_group = self->spot_group;
-            filter->rejected_spots = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void SpotGroupSplitterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        SpotGroupSplitterFactory* self = ( SpotGroupSplitterFactory* )cself;
-        SRAColumnRelease( self->col );
-    }
-}
-
-
-static rc_t SpotGroupSplitterFactory_Make( const SRASplitterFactory** cself,
-            const SRATable* table, bool split, char* const spot_group[] )
-{
-    rc_t rc = 0;
-    SpotGroupSplitterFactory* obj = NULL;
-
-    if ( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                             SpotGroupSplitterFactory_Init,
-                                             SpotGroupSplitterFactory_NewObj,
-                                             SpotGroupSplitterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( SpotGroupSplitterFactory* ) *cself;
-            obj->table = table;
-            obj->split = split;
-            obj->spot_group = spot_group;
-        }
-    }
-    return rc;
-}
-
-/* ### Common dumper code ##################################################### */
-
-
-static rc_t SRADumper_DumpRun( const SRATable* table,
-        spotid_t minSpotId, spotid_t maxSpotId, const SRASplitterFactory* factories, uint64_t * num_spots )
-{
-    rc_t rc = 0, rcr = 0;
-    spotid_t spot = 0;
-
-    /* !!! make_readmask is a MACRO defined in factory.h !!! */
-    make_readmask( readmask );
-    const SRASplitter* root_splitter = NULL;
-
-    if ( num_spots != NULL ) *num_spots = 0;
-
-    rc = SRASplitterFactory_NewObj( factories, &root_splitter );
-
-    for ( spot = minSpotId; rc == 0 && spot <= maxSpotId; spot++ )
-    {
-        reset_readmask( readmask );
-        /* SRASplitter_AddSpot() defined in factory.c */
-        rc = SRASplitter_AddSpot( root_splitter, spot, readmask );
-        if ( rc == 0 )
-        {
-            if ( num_spots != NULL ) (*num_spots)++;
-            rc = Quitting();
-        }
-        else
-        {
-            if ( ( GetRCModule( rc ) == rcXF ) &&
-                 ( GetRCTarget( rc ) == rcFunction ) &&
-                 ( GetRCContext( rc ) == rcExecuting ) &&
-                 ( GetRCObject( rc ) == rcData ) &&
-                 ( GetRCState( rc ) == rcInconsistent ) )
-            {
-                rc = 0;
-            }
-        }
-    }
-    rcr = SRASplitter_Release( root_splitter );
-
-    return rc ? rc : rcr;
-}
-
-
-static const SRADumperFmt_Arg KMainArgs[] =
-{
-    { NULL, "no-user-settings", NULL, {"Internal Only", NULL}},
-    { "A", "accession", "accession", {"Replaces accession derived from <path> in filename(s) and deflines (only for single table dump)", NULL}},
-    { "O", "outdir", "path", {"Output directory, default is working directory ( '.' )", NULL}},
-    { "Z", "stdout", NULL, {"Output to stdout, all split data become joined into single stream", NULL}},
-    { NULL, "gzip", NULL, {"Compress output using gzip", NULL}},
-    { NULL, "bzip2", NULL, {"Compress output using bzip2", NULL}},
-    { "N", "minSpotId", "rowid", {"Minimum spot id", NULL}},
-    { "X", "maxSpotId", "rowid", {"Maximum spot id", NULL}},
-    { "G", "spot-group", NULL, {"Split into files by SPOT_GROUP (member name)", NULL}},
-    { NULL, "spot-groups", "[list]", {"Filter by SPOT_GROUP (member): name[,...]", NULL}},
-    { "R", "read-filter", "[filter]", {"Split into files by READ_FILTER value",
-                                      "optionally filter by a value: pass|reject|criteria|redacted", NULL}},
-    { "T", "group-in-dirs", NULL, {"Split into subdirectories instead of files", NULL}},
-    { "K", "keep-empty-files", NULL, {"Do not delete empty files", NULL}},
-    { NULL, "table", "table-name", {"Table name within cSRA object, default is \"SEQUENCE\"", NULL}},
-
-    { "h", "help", NULL, {"Output a brief explanation of program usage", NULL}},
-    { "V", "version", NULL, {"Display the version of the program", NULL}},
-
-    { "L", "log-level", "level", {"Logging level as number or enum string",
-                                 "One of (fatal|sys|int|err|warn|info) or (0-5)",
-                                 "Current/default is warn", NULL}},
-    { "v", "verbose", NULL, {"Increase the verbosity level of the program",
-                            "Use multiple times for more verbosity", NULL}},
-    { NULL, OPTION_REPORT, NULL, {
-"Control program execution environment report generation (if implemented).",
-"One of (never|error|always). Default is error",
-                      NULL}},
-#if _DEBUGGING
-        {"+", "debug", "Module[-Flag]", {"Turn on debug output for module",
-                                         "All flags if not specified", NULL}},
-#endif
-
-    { NULL, "legacy-report", NULL, { "use legacy style 'Written N spots' for tool" } },
-    { NULL, NULL, NULL, {NULL}} /* terminator */
-};
-
-
-rc_t CC Usage ( const Args * args )
-{
-    return fasta_dump_usage ( args );
-}
-
-
-void CC SRADumper_PrintArg( const SRADumperFmt_Arg* arg )
-{
-    /* ??? */
-}
-
-
-static void CoreUsage( const char* prog, const SRADumperFmt* fmt, bool brief, int exit_status )
-{
-    OUTMSG(( "\n"
-             "Usage:\n"
-             "  %s [options] <path> [<path>...]\n"
-             "  %s [options] <accession>\n"
-             "\n", prog, prog));
-
-    if ( !brief )
-    {
-        if ( fmt->usage )
-        {
-            rc_t rc = fmt->usage( fmt, KMainArgs, 1 );
-            if ( rc != 0 )
-            {
-                LOGERR(klogErr, rc, "Usage print failed");
-            }
-        }
-        else
-        {
-            int k, i;
-            const SRADumperFmt_Arg* d[ 2 ] = { KMainArgs, NULL };
-
-            d[ 1 ] = fmt->arg_desc;
-            for ( k = 0; k < ( sizeof( d ) / sizeof( d[0] ) ); k++ )
-            {
-                for ( i = 1;
-                      d[k] != NULL && ( d[ k ][ i ].abbr != NULL || d[ k ][ i ].full != NULL );
-                      ++ i )
-                {
-                    if ( ( !fmt->gzip && strcmp( d[ k ][ i ].full, "gzip" ) == 0 ) ||
-                         ( !fmt->bzip2 && strcmp (d[ k ][ i ].full, "bzip2" ) == 0 ) )
-                    {
-                        continue;
-                    }
-                    if ( k > 0 && i == 0 )
-                    {
-                        OUTMSG(("\nFormat options:\n\n"));
-                    }
-                    HelpOptionLine( d[ k ][ i ].abbr, d[ k ][ i ].full,
-                                    d[ k ][ i ].param, (const char**)( d[ k ][ i ].descr ) );
-                    if ( k == 0 && i == 0 )
-                    {
-                        OUTMSG(( "\nOptions:\n\n" ));
-                    }
-                }
-            }
-        }
-    }
-    else
-    {
-        OUTMSG(( "Use option --help for more information\n" ));
-    }
-    HelpVersion( prog, KAppVersion() );
-    exit( exit_status );
-}
-
-
-static rc_t SRADumper_ArgsValidate( const char* prog, const SRADumperFmt* fmt )
-{
-    rc_t rc = 0;
-    int k, i;
-
-    /* set default log level */
-    const char* default_log_level = "warn";
-    rc = LogLevelSet( default_log_level );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc, "default log level to '$(lvl)'",
-                            PLOG_S( lvl ), default_log_level ) );
-        CoreUsage( prog, fmt, true, EXIT_FAILURE );
-    }
-    for ( i = 0; KMainArgs[ i ].abbr != NULL; i++ )
-    {
-        for ( k = 0; fmt->arg_desc != NULL && fmt->arg_desc[ k ].abbr != NULL; k++ )
-        {
-            if ( strcmp( fmt->arg_desc[ k ].abbr, KMainArgs[ i ].abbr ) == 0 ||
-                 ( fmt->arg_desc[ k ].full != NULL && strcmp( fmt->arg_desc[ k ].full, KMainArgs[ i ].full ) == 0 ) )
-            {
-                rc = RC(rcExe, rcArgv, rcValidating, rcParam, rcDuplicate);
-            }
-        }
-    }
-    return rc;
-}
-
-
-bool CC SRADumper_GetArg( const SRADumperFmt* fmt, char const* const abbr, char const* const full,
-                          int* i, int argc, char *argv[], const char** value )
-{
-    rc_t rc = 0;
-    const char* arg = argv[*i];
-    while ( *arg == '-' && *arg != '\0')
-    {
-        arg++;
-    }
-    if ( abbr != NULL && strcmp(arg, abbr) == 0 )
-    {
-        SRA_DUMP_DBG( 9, ( "GetArg key: '%s'\n", arg ) );
-        arg = arg + strlen( abbr );
-        if ( value != NULL && arg[0] == '\0' && (*i + 1) < argc )
-        {
-            arg = NULL;
-            if ( argv[ *i + 1 ][ 0 ] != '-' )
-            {
-                /* advance only if next is not an option with '-' */
-                *i = *i + 1;
-                arg = argv[ *i ];
-            }
-        }
-        else
-        {
-            arg = NULL;
-        }
-    }
-    else if ( full != NULL && strcmp( arg, full ) == 0 )
-    {
-        SRA_DUMP_DBG( 9, ( "GetArg key: '%s'\n", arg ) );
-        arg = NULL;
-        if ( value != NULL && ( *i + 1 ) < argc )
-        {
-            if ( argv[ *i + 1 ][ 0 ] != '-' )
-            {
-                /* advance only if next is not an option with '-' */
-                *i = *i + 1;
-                arg = argv[ *i ];
-            }
-        }
-    }
-    else
-    {
-        return false;
-    }
-
-    SRA_DUMP_DBG( 9, ( "GetArg val: '%s'\n", arg ) );
-    if ( value == NULL && arg != NULL )
-    {
-        rc = RC( rcApp, rcArgv, rcAccessing, rcParam, rcUnexpected );
-    }
-    else if ( value != NULL )
-    {
-        if ( arg == NULL && *value == '\0' )
-        {
-            rc = RC( rcApp, rcArgv, rcAccessing, rcParam, rcNotFound );
-        }
-        else if ( arg != NULL && arg[0] != '\0' )
-        {
-            *value = arg;
-        }
-    }
-    if ( rc != 0 )
-    {
-        PLOGERR( klogErr, ( klogErr, rc, "$(a0)$(a1)$(a2)$(f0)$(f1): $(v)",
-            PLOG_3(PLOG_S(a0),PLOG_S(a1),PLOG_S(a2))","PLOG_3(PLOG_S(f0),PLOG_S(f1),PLOG_S(v)),
-            abbr ? "-": "", abbr ? abbr : "", abbr ? ", " : "", full ? "--" : "", full ? full : "", arg));
-        CoreUsage( argv[ 0 ], fmt, true, EXIT_FAILURE );
-    }
-    return rc == 0 ? true : false;
-}
-
-
-static bool reportToUserSffFromNot454Run(rc_t rc, char* argv0, bool silent) {
-    assert( argv0 );
-    if ( rc == SILENT_RC( rcSRA, rcFormatter, rcConstructing,
-        rcData, rcUnsupported ) )
-    {
-        const char* name = strpbrk( argv0, "/\\" );
-        const char* last_name = name;
-        if ( last_name )
-        {
-        ++last_name;
-        }
-        while ( name )
-        {
-            name = strpbrk( last_name, "/\\" );
-            if ( name )
-            {
-                last_name = name;
-                if ( last_name )
-                {
-                    ++last_name;
-                }
-            }
-        }
-        name = last_name ? last_name : argv0;
-        if ( strcmp( "sff-dump", name ) == 0 )
-        {
-            if (!silent) {
-              OUTMSG((
-               "This run cannot be transformed into SFF format.\n"
-               "Conversion cannot be completed because the source lacks\n"
-               "one or more of the data series required by the SFF format.\n"
-               "You should be able to dump it as FASTQ by running fastq-dump.\n"
-               "\n"));
-            }
-            return true;
-        }
-    }
-    return false;
-}
-
-
-static int str_cmp( const char *a, const char *b )
-{
-    size_t asize = string_size ( a );
-    size_t bsize = string_size ( b );
-    return strcase_cmp ( a, asize, b, bsize, ( asize > bsize ) ? asize : bsize );
-}
-
-static bool database_contains_table_name( const VDBManager * vmgr, const char * acc_or_path, const char * tablename )
-{
-    bool res = false;
-    if ( ( vmgr != NULL ) && ( acc_or_path != NULL ) && ( tablename != NULL ) )
-    {
-        const VDatabase * db;
-        rc_t rc = VDBManagerOpenDBRead( vmgr, &db, NULL, acc_or_path );
-        if ( rc == 0 )
-        {
-            KNamelist * tbl_names;
-            rc = VDatabaseListTbl( db, &tbl_names );
-            if ( rc == 0 )
-            {
-                uint32_t count;
-                rc = KNamelistCount( tbl_names, &count );
-                if ( rc == 0 && count > 0 )
-                {
-                    uint32_t idx;
-                    for ( idx = 0; idx < count && rc == 0 && !res; ++idx )
-                    {
-                        const char *tbl_name;
-                        rc = KNamelistGet( tbl_names, idx, &tbl_name );
-                        if ( rc == 0 )
-                        {
-                            res = ( str_cmp( tbl_name, tablename ) == 0 );
-                        }
-                    }
-                }
-                KNamelistRelease( tbl_names );
-            }
-            VDatabaseRelease( db );
-        }
-    }
-    return res;
-}
-
-
-static const char * consensus_table_name = "CONSENSUS";
-
-/*******************************************************************************
- * KMain - defined for use with kapp library
- *******************************************************************************/
-rc_t CC KMain ( int argc, char* argv[] )
-{
-    rc_t rc = 0;
-    int i;
-    const char* arg;
-    uint64_t total_spots_read = 0;
-    uint64_t total_spots_written = 0;
-
-    const VDBManager* vmgr = NULL;
-    const SRAMgr* sraMGR = NULL;
-    SRADumperFmt fmt;
-
-    bool to_stdout = false, do_gzip = false, do_bzip2 = false;
-    char const* outdir = NULL;
-    spotid_t minSpotId = 1;
-    spotid_t maxSpotId = ~0;
-    bool sub_dir = false;
-    bool keep_empty = false;
-    const char* table_path[10240];
-    int table_path_qty = 0;
-
-    char const* D_option = NULL;
-    char const* P_option = NULL;
-    char P_option_buffer[4096];
-    const char* accession = NULL;
-    const char* table_name = NULL;
-    
-    bool spot_group_on = false;
-    int spot_groups = 0;
-    char* spot_group[128] = {NULL};
-    bool read_filter_on = false;
-    SRAReadFilter read_filter = 0xFF;
-
-    /* for the fasta-ouput of fastq-dump: branch out completely of 'common' code */
-    if ( fasta_dump_requested( argc, argv ) )
-    {
-        return fasta_dump( argc, argv );
-    }
-
-    /* Prepare for the worst: report this information after disaster */
-    ReportBuildDate ( __DATE__ );
-
-    memset( &fmt, 0, sizeof( fmt ) );
-    rc = SRADumper_Init( &fmt );    /* !!!dirty dirty trick!!! function is defined in abi.c AND fastq.c AND illumina.c AND sff.c !!! */
-    if ( rc != 0 )
-    {
-        LOGERR(klogErr, rc, "formatter initialization");
-        return 100;
-    }
-    else if ( fmt.get_factory == NULL )
-    {
-        rc = RC( rcExe, rcFormatter, rcValidating, rcInterface, rcNull );
-        LOGERR( klogErr, rc, "formatter factory" );
-        return 101;
-    }
-    else
-    {
-        rc = SRADumper_ArgsValidate( argv[0], &fmt );   /* above in this file */
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "formatter args list" );
-            return 102;
-        }
-    }
-
-    if ( argc < 2 )
-    {
-        CoreUsage( argv[0], &fmt, true, EXIT_FAILURE ); /* above in this file */
-        return 0;
-    }
-
-    /* now looping through argv[], ignoring args-parsing via kapp!!! */
-    for ( i = 1; i < argc; i++ )
-    {
-        arg = argv[ i ];
-        if ( arg[ 0 ] != '-' )
-        {
-            uint32_t k;
-            for ( k = 0; k < table_path_qty; k++ )
-            {
-                if ( strcmp( arg, table_path[ k ] ) == 0 )
-                {
-                    break;
-                }
-            }
-            if ( k >= table_path_qty )
-            {
-                if ( ( table_path_qty + 1 ) >= ( sizeof( table_path ) / sizeof( table_path[ 0 ] ) ) )
-                {
-                    rc = RC( rcExe, rcArgv, rcReading, rcBuffer, rcInsufficient );
-                    goto Catch;
-                }
-                table_path[ table_path_qty++ ] = arg;
-            }
-            continue;
-        }
-        arg = NULL;
-        if ( SRADumper_GetArg( &fmt, "L", "log-level", &i, argc, argv, &arg ) )
-        {
-            rc = LogLevelSet( arg );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc, "log level $(lvl)", PLOG_S( lvl ), arg ) );
-                goto Catch;
-            }
-        }
-        else if ( SRADumper_GetArg( &fmt, NULL, OPTION_REPORT, &i, argc, argv, &arg ) )
-        {
-        }
-        else if ( SRADumper_GetArg( &fmt, "+", "debug", &i, argc, argv, &arg ) )
-        {
-#if _DEBUGGING
-            rc = KDbgSetString( arg );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogErr, ( klogErr, rc, "debug level $(lvl)", PLOG_S( lvl ), arg ) );
-                goto Catch;
-            }
-#endif
-        }
-        else if ( SRADumper_GetArg( &fmt, "H", "help", &i, argc, argv, NULL ) ||
-                  SRADumper_GetArg( &fmt, "?", "h", &i, argc, argv, NULL ) )
-        {
-            CoreUsage( argv[ 0 ], &fmt, false, EXIT_SUCCESS );
-
-        }
-        else if ( SRADumper_GetArg( &fmt, "V", "version", &i, argc, argv, NULL ) )
-        {
-            HelpVersion ( argv[ 0 ], KAppVersion() );
-            return 0;
-        }
-        else if ( SRADumper_GetArg( &fmt, "v", NULL, &i, argc, argv, NULL ) )
-        {
-            KStsLevelAdjust( 1 );
-
-        }
-        else if ( SRADumper_GetArg( &fmt, "D", "table-path", &i, argc, argv, &D_option ) )
-        {
-            LOGMSG( klogErr, "option -D is deprecated, see --help" );
-        }
-        else if ( SRADumper_GetArg( &fmt, "P", "path", &i, argc, argv, &P_option ) )
-        {
-            LOGMSG( klogErr, "option -P is deprecated, see --help" );
-
-        }
-        else if ( SRADumper_GetArg( &fmt, "A", "accession", &i, argc, argv, &accession ) )
-        {
-        }
-        else if ( SRADumper_GetArg( &fmt, "O", "outdir", &i, argc, argv, &outdir ) )
-        {
-        }
-        else if ( SRADumper_GetArg( &fmt, "Z", "stdout", &i, argc, argv, NULL ) )
-        {
-            to_stdout = true;
-        }
-        else if ( fmt.gzip && SRADumper_GetArg( &fmt, NULL, "gzip", &i, argc, argv, NULL ) )
-        {
-            do_gzip = true;
-        }
-        else if ( fmt.bzip2 && SRADumper_GetArg( &fmt, NULL, "bzip2", &i, argc, argv, NULL ) )
-        {
-            do_bzip2 = true;
-        }
-        else if ( SRADumper_GetArg( &fmt, NULL, "table", &i, argc, argv, &table_name ) )
-        {
-        }
-        else if ( SRADumper_GetArg( &fmt, "N", "minSpotId", &i, argc, argv, &arg ) )
-        {
-            minSpotId = AsciiToU32( arg, NULL, NULL );
-        }
-        else if ( SRADumper_GetArg( &fmt, "X", "maxSpotId", &i, argc, argv, &arg ) )
-        {
-            maxSpotId = AsciiToU32( arg, NULL, NULL );
-        }
-        else if ( SRADumper_GetArg( &fmt, "G", "spot-group", &i, argc, argv, NULL ) )
-        {
-            spot_group_on = true;
-        }
-        else if ( SRADumper_GetArg( &fmt, NULL, "spot-groups", &i, argc, argv, NULL ) )
-        {
-            if ( i + 1 < argc && argv[ i + 1 ][ 0 ] != '-' )
-            {
-                int f = 0, t = 0;
-                i++;
-                while ( argv[ i ][ t ] != '\0' )
-                {
-                    if ( argv[ i ][ t ] == ',' )
-                    {
-                        if ( t - f > 0 )
-                        {
-                            spot_group[ spot_groups++ ] = string_dup( &argv[ i ][ f ], t - f );
-                        }
-                        f = t + 1;
-                    }
-                    t++;
-                }
-                if ( t - f > 0 )
-                {
-                    spot_group[ spot_groups++ ] = string_dup( &argv[ i ][ f ], t - f );
-                }
-                if ( spot_groups < 1 )
-                {
-                    rc = RC( rcApp, rcArgv, rcReading, rcParam, rcEmpty );
-                    PLOGERR( klogErr, ( klogErr, rc, "$(p)", PLOG_S( p ), argv[ i - 1 ] ) );
-                    CoreUsage( argv[ 0 ], &fmt, false, EXIT_FAILURE );
-                }
-                spot_group[ spot_groups ] = NULL;
-            }
-        }
-        else if ( SRADumper_GetArg( &fmt, "R", "read-filter", &i, argc, argv, NULL ) )
-        {
-            read_filter_on = true;
-            if ( i + 1 < argc && argv[ i + 1 ][ 0 ] != '-' )
-            {
-                i++;
-                if ( read_filter != 0xFF )
-                {
-                    rc = RC( rcApp, rcArgv, rcReading, rcParam, rcDuplicate );
-                    PLOGERR( klogErr, ( klogErr, rc, "$(p): $(o)",
-                             PLOG_2( PLOG_S( p ),PLOG_S( o ) ), argv[ i - 1 ], argv[ i ] ) );
-                    CoreUsage( argv[ 0 ], &fmt, false, EXIT_FAILURE );
-                }
-                if ( strcasecmp( argv[ i ], "pass" ) == 0 )
-                {
-                    read_filter = SRA_READ_FILTER_PASS;
-                }
-                else if ( strcasecmp( argv[ i ], "reject" ) == 0 )
-                {
-                    read_filter = SRA_READ_FILTER_REJECT;
-                }
-                else if ( strcasecmp( argv[ i ], "criteria" ) == 0 )
-                {
-                    read_filter = SRA_READ_FILTER_CRITERIA;
-                }
-                else if ( strcasecmp( argv[ i ], "redacted" ) == 0 )
-                {
-                    read_filter = SRA_READ_FILTER_REDACTED;
-                }
-                else
-                {
-                    /* must be accession */
-                    i--;
-                }
-            }
-        }
-        else if ( SRADumper_GetArg( &fmt, "T", "group-in-dirs", &i, argc, argv, NULL ) )
-        {
-            sub_dir = true;
-        }
-        else if ( SRADumper_GetArg( &fmt, "K", "keep-empty-files", &i, argc, argv, NULL ) )
-        {
-            keep_empty = true;
-        }
-        else if ( SRADumper_GetArg( &fmt, NULL, "no-user-settings", &i, argc, argv, NULL ) )
-        {
-             KConfigDisableUserSettings ();
-        }
-        else if ( SRADumper_GetArg( &fmt, NULL, "legacy-report", &i, argc, argv, NULL ) )
-        {
-             g_legacy_report = true;
-        }
-        else if ( fmt.add_arg && fmt.add_arg( &fmt, SRADumper_GetArg, &i, argc, argv ) )
-        {
-        }
-        else
-        {
-            rc = RC( rcApp, rcArgv, rcReading, rcParam, rcIncorrect );
-            PLOGERR( klogErr, ( klogErr, rc, "$(p)", PLOG_S( p ), argv[ i ] ) );
-            CoreUsage( argv[ 0 ], &fmt, false, EXIT_FAILURE );
-        }
-    }
-
-    if ( to_stdout )
-    {
-        if ( outdir != NULL || sub_dir || keep_empty ||
-            spot_group_on || ( read_filter_on && read_filter == 0xFF ) )
-        {
-            LOGMSG( klogWarn, "stdout mode is set, some options are ignored" );
-            spot_group_on = false;
-            if ( read_filter == 0xFF )
-            {
-                read_filter_on = false;
-            }
-        }
-        KOutHandlerSetStdErr();
-        KStsHandlerSetStdErr();
-        KLogHandlerSetStdErr();
-        ( void ) KDbgHandlerSetStdErr();
-    }
-
-    if ( do_gzip && do_bzip2 )
-    {
-        rc = RC( rcApp, rcArgv, rcReading, rcParam, rcAmbiguous );
-        LOGERR( klogErr, rc, "output compression method" );
-        CoreUsage( argv[ 0 ], &fmt, false, EXIT_FAILURE );
-    }
-
-    if ( minSpotId > maxSpotId )
-    {
-        spotid_t temp = maxSpotId;
-        maxSpotId = minSpotId;
-        minSpotId = temp;
-    }
-
-    if ( table_path_qty == 0 )
-    {
-        if ( D_option != NULL && D_option[ 0 ] != '\0' )
-        {
-            /* support deprecated '-D' option */
-            table_path[ table_path_qty++ ] = D_option;
-        }
-        else if ( accession == NULL || accession[ 0 ] == '\0' )
-        {
-            /* must have accession to proceed */
-            rc = RC( rcExe, rcArgv, rcValidating, rcParam, rcEmpty );
-            LOGERR( klogErr, rc, "expected accession" );
-            goto Catch;
-        }
-        else if ( P_option != NULL && P_option[ 0 ] != '\0' )
-        {
-            /* support deprecated '-P' option */
-            i = snprintf( P_option_buffer, sizeof( P_option_buffer ), "%s/%s", P_option, accession );
-            if ( i < 0 || i >= sizeof( P_option_buffer ) )
-            {
-                rc = RC( rcExe, rcArgv, rcValidating, rcParam, rcExcessive );
-                LOGERR( klogErr, rc, "path too long" );
-                goto Catch;
-            }
-            table_path[ table_path_qty++ ] = P_option_buffer;
-        }
-        else
-        {
-            table_path[ table_path_qty++ ] = accession;
-        }
-    }
-
-    rc = SRAMgrMakeRead( &sraMGR ); /* !!! in libsra !!! */
-    if ( rc != 0 )
-    {
-        LOGERR( klogErr, rc, "failed to open SRA manager" );
-        goto Catch;
-    }
-    else
-    {
-        rc = SRASplitterFactory_FilerInit( to_stdout, do_gzip, do_bzip2, sub_dir, keep_empty, outdir );
-        if ( rc != 0 )
-        {
-            LOGERR( klogErr, rc, "failed to initialize files" );
-            goto Catch;
-        }
-    }
-
-    {
-        rc_t rc2 = SRAMgrGetVDBManagerRead( sraMGR, &vmgr );
-        if ( rc2 != 0 )
-        {
-            LOGERR( klogErr, rc2, "while calling SRAMgrGetVDBManagerRead" );
-        }
-        rc2 = ReportSetVDBManager( vmgr );
-    }
-
-
-    /* loop tables */
-    for ( i = 0; i < table_path_qty; i++ )
-    {
-        const SRASplitterFactory* fact_head = NULL;
-        spotid_t smax, smin;
-        int path_type;
-
-        SRA_DUMP_DBG( 5, ( "table path '%s', name '%s'\n", table_path[ i ], table_name ) );
-
-        /* because of PacBio: if no table_name is given ---> open the 'CONSENSUS' table implicitly!
-            we first have to lookup the Object-Type, if it is a Database we have to look if it contains
-            a CONSENSUS-table ( only PacBio-Runs have one ! )...
-        */
-
-        path_type = ( VDBManagerPathType ( vmgr, table_path[ i ] ) & ~ kptAlias );
-        switch ( path_type )
-        {
-            case kptDatabase        :   ;   /* types defined in <kdb/manager.h> */
-            case kptPrereleaseTbl   :   ;
-            case kptTable           :   break;
-
-            default             :   rc = RC( rcVDB, rcNoTarg, rcConstructing, rcItem, rcNotFound );
-                                    PLOGERR( klogErr, ( klogErr, rc,
-                                        "the path '$(p)' cannot be opened as database or table",
-                                        "p=%s", table_path[ i ] ) );
-                                    continue;
-                                    break;
-        }
-
-
-        if ( path_type == kptDatabase )
-        {
-            const char * table_to_open = table_name;
-            if ( table_to_open == NULL && database_contains_table_name( vmgr, table_path[ i ], consensus_table_name ) )
-            {
-                table_to_open = consensus_table_name;
-            }
-            if ( table_to_open != NULL )
-            {
-                rc = SRAMgrOpenAltTableRead( sraMGR, &fmt.table, table_to_open, table_path[ i ] ); /* from sradb-priv.h */
-                if ( rc != 0 )
-                {
-                    PLOGERR( klogErr, ( klogErr, rc, 
-                        "failed to open '$(path):$(table)'", "path=%s,table=%s",
-                        table_path[ i ], table_to_open ) );
-                    continue;
-                }
-            }
-
-        }
-
-        ReportResetObject( table_path[ i ] );
-
-        if ( fmt.table == NULL )
-        {
-            rc = SRAMgrOpenTableRead( sraMGR, &fmt.table, table_path[ i ] );
-            if ( rc != 0 )
-            {
-                if ( UIError( rc, NULL, NULL ) )
-                {
-                    UITableLOGError( rc, NULL, true );
-                }
-                else
-                {
-                    PLOGERR( klogErr, ( klogErr, rc,
-                            "failed to open '$(path)'", "path=%s", table_path[ i ] ) );
-                }
-                continue;
-            }
-        }
-
-        /* infer accession from table_path if missing or more than one table */
-        fmt.accession = table_path_qty > 1 ? NULL : accession;
-        if ( fmt.accession == NULL || fmt.accession[ 0 ] == 0 )
-        {
-            char * basename;
-            char *ext;
-            size_t l;
-            bool is_url = false;
-
-            strcpy( P_option_buffer, table_path[ i ] );
-
-            basename = strchr ( P_option_buffer, ':' );
-            if ( basename )
-            {
-                ++basename;
-                if ( basename [0] == '\0' )
-                    basename = P_option_buffer;
-                else
-                    is_url = true;
-            }
-            else
-                basename = P_option_buffer;
-
-            if ( is_url )
-            {
-                ext = strchr ( basename, '#' );
-                if ( ext )
-                    ext[ 0 ] = '\0';
-                ext = strchr ( basename, '?' );
-                if ( ext )
-                    ext[ 0 ] = '\0';
-            }
-
-
-            l = strlen( basename  );
-            while ( strchr( "\\/", basename[ l - 1 ] ) != NULL )
-            {
-                basename[ --l ] = '\0';
-            }
-            fmt.accession = strrchr( basename, '/' );
-            if ( fmt.accession++ == NULL )
-            {
-                fmt.accession = basename;
-            }
-
-            /* cut off [.lite].[c]sra[.nenc||.ncbi_enc] if any */
-            ext = strrchr( fmt.accession, '.' );
-            if ( ext != NULL )
-            {
-                if ( strcasecmp( ext, ".nenc" ) == 0 || strcasecmp( ext, ",ncbi_enc" ) == 0 )
-                {
-                    *ext = '\0';
-                    ext = strrchr( fmt.accession, '.' );
-                }
-                if ( ext != NULL && ( strcasecmp( ext, ".sra" ) == 0 || strcasecmp( ext, ".csra" ) == 0 ) )
-                {
-                    *ext = '\0';
-                    ext = strrchr( fmt.accession, '.' );
-                    if ( ext != NULL && strcasecmp( ext, ".lite" ) == 0 )
-                    {
-                        *ext = '\0';
-                    }
-                }
-            }
-        }
-
-        SRA_DUMP_DBG( 5, ( "accession: '%s'\n", fmt.accession ) );
-        rc = SRASplitterFactory_FilerPrefix( accession ? accession : fmt.accession );
-
-        while ( rc == 0 )
-        {
-            /* sort out the spot id range */
-            rc = SRATableMaxSpotId( fmt.table, &smax );
-            if ( rc != 0 )
-                break;
-            rc = SRATableMinSpotId( fmt.table, &smin );
-            if ( rc != 0 )
-                break;
-
-            {
-                const struct VTable* tbl = NULL;
-                rc_t rc2 = SRATableGetVTableRead( fmt.table, &tbl );
-                if ( rc == 0 )
-                {
-                    rc = rc2;
-                }
-                rc2 = ReportResetTable( table_path[i], tbl );
-                if ( rc == 0 )
-                {
-                    rc = rc2;
-                }
-                VTableRelease( tbl );   /* SRATableGetVTableRead adds Reference to tbl! */
-            }
-
-            /* test if we have to dump anything... */
-            if ( smax < minSpotId || smin > maxSpotId )
-            {
-                break;
-            }
-            if ( smax > maxSpotId )
-            {
-                smax = maxSpotId;
-            }
-            if ( smin < minSpotId )
-            {
-                smin = minSpotId;
-            }
-
-            /* hack to reduce looping in AddSpot: needs redesign to pass nreads along through tree */
-            if ( true ) /* ??? */
-            {
-                const SRAColumn* c = NULL;
-
-                nreads_max = NREADS_MAX;    /* global variables defined in factory.h */
-                quality_N_limit = 0;
-
-                rc = SRATableOpenColumnRead( fmt.table, &c, "PLATFORM", sra_platform_id_t );
-                if ( rc == 0 )
-                {
-                    const INSDC_SRA_platform_id *platform;
-                    bitsz_t o, z;
-                    rc = SRAColumnRead( c, 1, (const void **)&platform, &o, &z );
-                    if ( rc == 0 && platform != NULL )
-                    {
-                        /* platform constands in insdc/sra.h */
-                        switch( *platform )
-                        {
-                            case SRA_PLATFORM_454           : quality_N_limit = 30;   break;
-                            case SRA_PLATFORM_ION_TORRENT   : ;
-                            case SRA_PLATFORM_ILLUMINA      : quality_N_limit = 35;   break;
-                            case SRA_PLATFORM_ABSOLID       : quality_N_limit = 25;   break;
-                            case SRA_PLATFORM_PACBIO_SMRT   : nreads_max = 32; break;
-                        }
-                    }
-                    SRAColumnRelease( c );
-                }
-                else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcColumn )
-                {
-                    rc = 0;
-                }
-            }
-
-            /* table dependent */
-            rc = fmt.get_factory( &fmt, &fact_head );
-            if ( rc != 0 )
-            {
-                break;
-            }
-            if ( fact_head == NULL )
-            {
-                rc = RC( rcExe, rcFormatter, rcResolving, rcInterface, rcNull );
-                break;
-            }
-
-            if ( rc == 0 && ( spot_group_on || spot_groups > 0 ) )
-            {
-                const SRASplitterFactory* f = NULL;
-                rc = SpotGroupSplitterFactory_Make( &f, fmt.table, spot_group_on, spot_group );
-                if ( rc == 0 )
-                {
-                    rc = SRASplitterFactory_AddNext( f, fact_head );
-                    if ( rc == 0 )
-                    {
-                        fact_head = f;
-                    }
-                    else
-                    {
-                        SRASplitterFactory_Release( f );
-                    }
-                }
-            }
-
-            if ( rc == 0 && read_filter_on )
-            {
-                const SRASplitterFactory* f = NULL;
-                rc = ReadFilterSplitterFactory_Make( &f, fmt.table, read_filter );
-                if ( rc == 0 )
-                {
-                    rc = SRASplitterFactory_AddNext( f, fact_head );
-                    if ( rc == 0 )
-                    {
-                        fact_head = f;
-                    }
-                    else
-                    {
-                        SRASplitterFactory_Release( f );
-                    }
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                /* this filter takes over head of chain to be first and kill off bad NREADS */
-                const SRASplitterFactory* f = NULL;
-                rc = MaxNReadsValidatorFactory_Make( &f, fmt.table );
-                if ( rc == 0 )
-                {
-                    rc = SRASplitterFactory_AddNext( f, fact_head );
-                    if ( rc == 0 )
-                    {
-                        fact_head = f;
-                    }
-                    else
-                    {
-                        SRASplitterFactory_Release( f );
-                    }
-                }
-            }
-
-            rc = SRASplitterFactory_Init( fact_head );
-            if ( rc == 0 )
-            {
-                uint64_t spots_read;
-
-                /* ********************************************************** */
-                rc = SRADumper_DumpRun( fmt.table, smin, smax, fact_head, &spots_read );
-                /* ********************************************************** */
-                if ( rc == 0 )
-                { 
-                    uint64_t spots_written = 0, file = 0;
-
-                    SRASplitterFactory_FilerReport( &spots_written, &file );
-                    if ( !g_legacy_report )
-                    {
-                        OUTMSG(( "Read %lu spots for %s\n", spots_read, table_path[ i ] ));
-                    }
-                    OUTMSG(( "Written %lu spots for %s\n", spots_written - total_spots_written, table_path[ i ] ));
-
-                    if ( to_stdout && spots_written > 0 )
-                    {
-                        PLOGMSG( klogInfo, ( klogInfo, "$(t) biggest file has $(n) spots",
-                            PLOG_2( PLOG_S( t ), PLOG_U64( n ) ), table_path[ i ], file ));
-                    }
-                    total_spots_written = spots_written;
-                    total_spots_read += spots_read;
-                }
-            }
-            break;
-        }
-
-        SRASplitterFactory_Release( fact_head );
-        SRATableRelease( fmt.table );
-        fmt.table = NULL;
-        if ( rc == 0 )
-        {
-            PLOGMSG( klogInfo, ( klogInfo, "$(path)$(dot)$(table) $(spots) spots",
-                    PLOG_4(PLOG_S(path),PLOG_S(dot),PLOG_S(table),PLOG_U32(spots)),
-                    table_path[ i ], table_name ? ":" : "", table_name ? table_name : "", smax - smin + 1 ) );
-        }
-        else if (!reportToUserSffFromNot454Run(rc, argv [0], false)) {
-            PLOGERR( klogErr, ( klogErr, rc, "failed $(path)$(dot)$(table)",
-                    PLOG_3(PLOG_S(path),PLOG_S(dot),PLOG_S(table)),
-                    table_path[ i ], table_name ? ":" : "", table_name ? table_name : "" ) );
-        }
-    }
-
-Catch:
-    if ( fmt.release )
-    {
-        rc_t rr = fmt.release( &fmt );
-        if ( rr != 0 )
-        {
-            SRA_DUMP_DBG( 1, ( "formatter release error %R\n", rr ) );
-        }
-    }
-
-    for ( i = 0; i < spot_groups; i++ )
-    {
-        free( spot_group[ i ] );
-    }
-    SRASplitterFiler_Release();
-    SRAMgrRelease( sraMGR );
-    VDBManagerRelease( vmgr );
-
-    if ( g_legacy_report )
-    {
-        OUTMSG(( "Written %lu spots total\n", total_spots_written ));
-    }
-    else if ( table_path_qty > 1 )
-    {
-        OUTMSG(( "Read %lu spots total\n", total_spots_read ));
-        OUTMSG(( "Written %lu spots total\n", total_spots_written ));
-    }
-
-    /* Report execution environment if necessary */
-    if (rc != 0 && reportToUserSffFromNot454Run(rc, argv [0], true)) {
-        ReportSilence();
-    }
-    {
-        rc_t rc2 = ReportFinalize( rc );
-        if ( rc == 0 )
-        {
-            rc = rc2;
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-dump/core.h b/tools/sra-dump/core.h
deleted file mode 100644
index 493b1ab..0000000
--- a/tools/sra-dump/core.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_tools_dump_core
-#define _h_tools_dump_core
-
-#include <klib/rc.h>
-
-#include "factory.h"
-
-typedef struct SRADumperFmt_Arg_struct {
-    const char* abbr; /* NULL here means end of list */
-    /* next 3 can be NULL */
-    const char* full;
-    const char* param;
-    const char* descr[10];
-} SRADumperFmt_Arg;
-
-typedef struct SRADumperFmt SRADumperFmt;
-
-/**
-  * Setup formatter interfaces
-  */
-rc_t SRADumper_Init(SRADumperFmt* fmt);
-
-typedef bool CC GetArg(const SRADumperFmt* fmt, char const* const abbr, char const* const full,
-                       int* i, int argc, char *argv[], const char** value);
-
-struct SRADumperFmt
-{
-    /* optional pointer to formatter arguments, NULL terminated array otherwise */
-    const SRADumperFmt_Arg* arg_desc;
-
-    /* optional - prints custom help page */
-    rc_t (*usage)(const SRADumperFmt* fmt, const SRADumperFmt_Arg* core_args, int first );
-    /* optional */
-    rc_t (*release)(const SRADumperFmt* fmt);
-    /* optional process current arg and advance i by number of processed args */
-    bool (*add_arg)(const SRADumperFmt* fmt, GetArg* f, int* i, int argc, char *argv[]);
-
-    /* mandatory return head of factories implemented in module, factories released by caller! */
-    rc_t (*get_factory)(const SRADumperFmt* fmt, const SRASplitterFactory** factory);
-
-    /* set by parent code, do not change!!! */
-    const char* accession;
-    const SRATable* table;
-    bool gzip;
-    bool bzip2;
-};
-
-#endif /* _h_tools_dump_core */
diff --git a/tools/sra-dump/debug.h b/tools/sra-dump/debug.h
deleted file mode 100644
index c9d1e56..0000000
--- a/tools/sra-dump/debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_sra_dump_debug_h_
-#define _tools_sra_dump_debug_h_
-
-#include <klib/debug.h>
-
-#define SRA_DUMP_DBG_PASTE(a,b) a##b
-#define SRA_DUMP_DBG(flag,msg) DBGMSG(DBG_APP,DBG_FLAG(SRA_DUMP_DBG_PASTE(DBG_APP_,flag)), msg)
-
-#endif /* _tools_sra_dump_debug_h_ */
diff --git a/tools/sra-dump/factory.c b/tools/sra-dump/factory.c
deleted file mode 100644
index 63897c9..0000000
--- a/tools/sra-dump/factory.c
+++ /dev/null
@@ -1,1065 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/container.h>
-#include <kfs/directory.h>
-#include <kfs/buffile.h>
-#include <kfs/gzip.h>
-#include <kfs/bzip.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include "factory.h"
-#include "debug.h"
-
-#define DUMPER_MAX_KEY_LENGTH 63
-#define DUMPER_MAX_TREE_DEPTH 100
-#define DUMPER_MAX_OPEN_FILES 100
-
-#define OUTPUT_BUFFER_SIZE ( 128 * 1024 )
-
-uint32_t nreads_max = 0;
-uint32_t quality_N_limit = 0;
-bool g_legacy_report = false;
-
-typedef struct SRASplitterFile_struct {
-    SLNode dad;
-    char* key;
-    KDirectory* dir;
-    char* name;
-    KFile* file;
-    time_t opened;
-    uint64_t pos;
-    /* keep track of number of spots written to file */
-    spotid_t curr_spot;
-    uint64_t spot_qty;
-} SRASplitterFile;
-
-typedef struct SRASplitterFiler_struct {
-    /* TBD - reorder structure to avoid premature ageing of compiler and CPU */
-    char* prefix;
-    KFile* kf_stdout;
-    bool key_as_dir;
-    bool keep_empty;
-    bool do_gzip;
-    bool do_bzip2;
-    const char* arc_extension;
-    KDirectory* dir;
-
-    /* TBD - this should be a BSTree */
-    SLList files;
-
-    /* list of keys to construct a path */
-    int path_tail; /* count of elements in path array */
-    int path_len; /* cumulative length of path in array */
-    const char* path[DUMPER_MAX_TREE_DEPTH];
-    char key_buf[DUMPER_MAX_TREE_DEPTH * (DUMPER_MAX_KEY_LENGTH + 3) + 10];
-    /* holds opened files */
-    SRASplitterFile* open[DUMPER_MAX_OPEN_FILES];
-    /* keep track of number of spots written to file */
-    spotid_t curr_spot;
-    uint64_t spot_qty;
-} SRASplitterFiler;
-
-SRASplitterFiler* g_filer = NULL;
-
-static
-void CC SRASplitterFiler_WhackFile( SLNode *node, void *data )
-{
-    SRASplitterFile* file = (SRASplitterFile*)node;
-    bool* d = (bool*)data;
-
-    SRA_DUMP_DBG(5, ("Close file: '%s%s'\n", file->key, g_filer->arc_extension));
-    if( file->spot_qty == 0 ) {
-        /* truncate file which didn't get actual spots written */
-        KFileSetSize(file->file, 0);
-    }
-    KFileRelease(file->file);
-    if( !*d ) {
-        uint64_t sz = ~0;
-        if( KDirectoryFileSize(file->dir, &sz, "%s%s", file->name, g_filer->arc_extension) == 0 ) {
-            if( file->spot_qty == 0 || sz == 0 ) {
-                SRA_DUMP_DBG(5, ("Delete empty file: '%s%s'\n", file->key, g_filer->arc_extension));
-                KDirectoryRemove(file->dir, false, "%s%s", file->name, g_filer->arc_extension);
-            }
-        }
-    }
-    if( file->dir != g_filer->dir ) {
-        KDirectoryRelease(file->dir);
-    }
-    free(file->key);
-    free(file->name);
-    free(file);
-}
-
-static
-void CC SRASplitterFiler_StatFile( SLNode *node, void *data )
-{
-    SRASplitterFile* file = (SRASplitterFile*)node;
-    uint64_t* d = (uint64_t*)data;
-
-    if( *d < file->spot_qty ) {
-        *d = file->spot_qty;
-    }
-}
-
-void SRASplitterFiler_Release(void)
-{
-    if( g_filer != NULL ) {
-        SLListWhack(&g_filer->files, SRASplitterFiler_WhackFile, &g_filer->keep_empty);
-        KFileRelease(g_filer->kf_stdout);
-        KDirectoryRelease(g_filer->dir);
-        free(g_filer->prefix);
-        free(g_filer);
-        g_filer = NULL;
-    }
-}
-
-void SRASplitterFactory_FilerReport(uint64_t* total, uint64_t* biggest_file)
-{
-    if( g_filer != NULL ) {
-        if( total != NULL ) {
-            *total = g_filer->spot_qty;
-        }
-        if( biggest_file != NULL ) {
-            SLListForEach(&g_filer->files, SRASplitterFiler_StatFile, biggest_file);
-        }
-    }
-}
-
-static
-rc_t SRASplitterFiler_PushKey(const char* key)
-{
-    if( g_filer == NULL || key == NULL ) {
-        return RC(rcExe, rcFile, rcAttaching, rcParam, rcNull);
-    }
-    if( g_filer->path_tail == sizeof(g_filer->path) - 1 ) {
-        return RC(rcExe, rcFile, rcAttaching, rcDirEntry, rcTooLong);
-    }
-    if( g_filer->key_as_dir ) {
-        /* skip initial non-letters */
-        while( !isalnum(*key) && *key != '\0' ) {
-            ++key;
-        }
-    }
-    g_filer->path[g_filer->path_tail++] = key;
-    g_filer->path_len += strlen(key) + 1;
-    return 0;
-}
-
-static
-rc_t SRASplitterFiler_PopKey(void)
-{
-    if( g_filer->path_tail == 0 ) {
-        return RC(rcExe, rcFile, rcDetaching, rcDirEntry, rcTooShort);
-    }
-    g_filer->path_len -= strlen(g_filer->path[--g_filer->path_tail]) + 1;
-    return 0;
-}
-
-static
-rc_t SRASplitterFiler_OpenFile(SRASplitterFile* file, bool initial)
-{
-    rc_t rc = 0;
-
-    if( file == NULL || (initial && file->file != NULL) ) {
-        rc = RC(rcExe, rcFile, rcOpening, rcParam, rcInvalid);
-    } else if( initial || file->file == NULL ) {
-        int i, vacancy = -1;
-        time_t oldest = 0;
-
-        for(i = 0; i < DUMPER_MAX_OPEN_FILES; i++) {
-            if(g_filer->open[i] == NULL ) {
-                vacancy = i;
-                break;
-            }
-            if(g_filer->open[i]->opened < oldest || oldest == 0 ) {
-                oldest = g_filer->open[i]->opened;
-                vacancy = i;
-            }
-        }
-        if( g_filer->open[vacancy] != NULL ) {
-            SRA_DUMP_DBG(5, ("Close file[%i]: %lu '%s%s'\n", vacancy,
-                g_filer->open[vacancy]->opened, g_filer->open[vacancy]->key, g_filer->arc_extension));
-            KFileRelease(g_filer->open[vacancy]->file);
-            g_filer->open[vacancy]->file = NULL;
-            g_filer->open[vacancy] = NULL;
-        }
-        if( g_filer->kf_stdout ) {
-            SRA_DUMP_DBG(5, ("attach to pre-opened stdout: '%s'\n", file->key));
-            rc = KFileAddRef(g_filer->kf_stdout);
-            file->file = g_filer->kf_stdout;
-        } else if( initial ) {
-            SRA_DUMP_DBG(5, ("Create file: '%s%s'\n", file->key, g_filer->arc_extension));
-            if( (rc = KDirectoryCreateFile(file->dir, &file->file, false, 0664, kcmInit,
-                                           "%s%s", file->name, g_filer->arc_extension)) == 0 ) {
-                if( g_filer->do_gzip ) {
-                    KFile* gz;
-                    if( (rc = KFileMakeGzipForWrite(&gz, file->file)) == 0 ) {
-                        KFileRelease(file->file);
-                        file->file = gz;
-                    }
-                } else if( g_filer->do_bzip2 ) {
-                    KFile* bz;
-                    if( (rc = KFileMakeBzip2ForWrite(&bz, file->file)) == 0 ) {
-                        KFileRelease(file->file);
-                        file->file = bz;
-                    }
-                }
-            }
-        } else if( file->file == NULL ) {
-            SRA_DUMP_DBG(5, ("Reopen file: '%s%s'\n", file->key, g_filer->arc_extension));
-            /* position is rememebered since last time */
-            if( (rc = KDirectoryOpenFileWrite(file->dir, &file->file, false,
-                                              "%s%s", file->name, g_filer->arc_extension)) == 0 ) {
-#if ! SUPPORT_MULTI_SESSION_GZIP_FILES
-                if( g_filer->do_gzip || g_filer->do_bzip2 ) {
-                    /* compressed files cannot (currently) be re-opened until we support multi-session compression */
-                    rc = RC(rcExe, rcFile, rcOpening, rcConstraint, rcViolated);
-                }
-#else
-                if( g_filer->do_gzip ) {
-                    KFile* gz;
-                    if( (rc = KFileMakeGzipForAppend(&gz, file->file)) == 0 ) {
-                        KFileRelease(file->file);
-                        file->file = gz;
-                    }
-                } else if( g_filer->do_bzip2 ) {
-                    KFile* bz;
-                    if( (rc = KFileMakeBzip2ForWrite(&bz, file->file)) == 0 ) {
-                        KFileRelease(file->file);
-                        file->file = bz;
-                    }
-                }
-#endif
-            }
-        }
-#if OUTPUT_BUFFER_SIZE
-        if( rc == 0 && !g_filer->kf_stdout ) {
-            /* attach buffer */
-            KFile *buf = NULL;
-            if( (rc = KBufFileMakeWrite(&buf, file->file, false, OUTPUT_BUFFER_SIZE)) == 0 ) {
-                KFileRelease(file->file);
-                file->file = buf;
-            } else {
-#if _DEBUGGING
-                /* we only want to see this in debug */
-                PLOGERR(klogErr, (klogErr, rc, "creating buffer for file '$(s)$(e)'",
-                    PLOG_2(PLOG_S(s),PLOG_S(e)), file->key, g_filer->arc_extension));
-#else
-                rc = 0;
-#endif
-            }
-        }
-#endif
-        if( rc == 0 ) {
-            g_filer->open[vacancy] = file;
-            file->opened = time(NULL);
-            SRA_DUMP_DBG(5, ("Opened file[%i]: %lu '%s%s'\n",
-                vacancy, file->opened, file->key, g_filer->arc_extension));
-        }
-    }
-    return rc;
-}
-
-static
-bool CC SRASplitterFiler_GetCurrFile_FindByKey( SLNode *node, void *data )
-{
-    SRASplitterFile** d = (SRASplitterFile**)data;
-    SRASplitterFile* file = (SRASplitterFile*)node;
-
-    if( strcmp(file->key, g_filer->key_buf) == 0 ) {
-        *d = file;
-        return true;
-    }
-    return false;
-}
-
-static
-rc_t SRASplitterFiler_FixFSName(const char* name, char** fname)
-{
-    /* replace invalid chars with '_' in name */
-    char* nn = strdup(name);
-
-    if( nn == NULL ) {
-        return RC(rcExe, rcFile, rcOpening, rcMemory, rcExhausted);
-    }
-    *fname = nn;
-    while(*nn != '\0' ) {
-        if( strchr("\\/?:*(){}[]^%\"\'<>|`", *nn) != NULL ) {
-            *nn = '_';
-        }
-        nn++;
-/*TODO: use it!*/
-    }
-    return 0;
-}
-
-static
-rc_t SRASplitterFiler_GetCurrFile(const SRASplitterFile** out_file)
-{
-    rc_t rc = 0;
-    int i;
-    char* key = g_filer->key_buf; /* shortcut */
-    SRASplitterFile* file = NULL;
-
-    if( out_file == NULL ) {
-        return RC(rcExe, rcFile, rcOpening, rcParam, rcInvalid);
-    } else if( g_filer->kf_stdout ) {
-        strcpy(key, "stdout");
-    } else {
-        /* prepare the key
-           if key_as_dir true, key will be prefix/path[i]/(path[i+1]..)/suffix
-           otherwise key will be prefix_path[i](_path[i+1]..)_?suffix
-         */
-        key[0] = '\0';
-        for(i = 0; i < g_filer->path_tail; i++ ) {
-            if( g_filer->path[i][0] == '\0' ) {
-                continue;
-            }
-            if( g_filer->key_as_dir ) {
-                if( i != 0 ) {
-                    strcat(key, "/");
-                }
-                strcat(key, g_filer->path[i]);
-            } else {
-                if( i != 0 && isalnum(g_filer->path[i][0]) ) {
-                    strcat(key, "_");
-                }
-                strcat(key, g_filer->path[i]);
-            }
-        }
-    }
-    if( !SLListDoUntil( &g_filer->files, SRASplitterFiler_GetCurrFile_FindByKey, &file ) ) {
-        SRA_DUMP_DBG(5, ("New file: '%s'\n", key));
-        file = calloc(1, sizeof(*file));
-        key = strdup(key);
-        if( file == NULL || key == NULL ) {
-            free(file);
-            free(key);
-            rc = RC(rcExe, rcFile, rcResolving, rcMemory, rcExhausted);
-        } else {
-            file->key = key;
-            if( g_filer->key_as_dir ) {
-                KDirectory* sub = g_filer->dir;
-                for(i = 0; rc == 0 && i < (g_filer->path_tail - 1); i++ ) {
-                    if( g_filer->path[i][0] != '\0' ) {
-                        char* ndir = NULL;
-                        if( (rc = SRASplitterFiler_FixFSName(g_filer->path[i], &ndir)) == 0 ) {
-                            if( (rc = KDirectoryCreateDir(sub, 0775, kcmCreate, ndir)) == 0 ||
-                                (GetRCObject(rc) == rcDirectory && GetRCState(rc) == rcExists) ) {
-                                if( (rc = KDirectoryOpenDirUpdate(sub, &file->dir, true, ndir)) == 0 ) {
-                                    KDirectoryRelease(i == 0 ? NULL : sub);
-                                    sub = file->dir;
-                                }
-                            }
-                            free(ndir);
-                        }
-                    }
-                }
-                rc = SRASplitterFiler_FixFSName(&file->key[strlen(file->key) - strlen(g_filer->path[g_filer->path_tail - 1])], &file->name);
-            } else {
-                file->dir = g_filer->dir;
-                rc = SRASplitterFiler_FixFSName(file->key, &file->name);
-            }
-            if( rc == 0 && (rc = SRASplitterFiler_OpenFile(file, true)) == 0 ) {
-                SLListPushTail(&g_filer->files, &file->dad);
-            } else {
-                SRASplitterFiler_WhackFile(&file->dad, &g_filer->keep_empty);
-            }
-        }
-    } else {
-        SRA_DUMP_DBG(5, ("Curr file key '%s': '%s'\n", key, file->name));
-        rc = SRASplitterFiler_OpenFile(file, false);
-    }
-    *out_file = rc ? NULL : file;
-    return rc;
-}
-
-rc_t SRASplitterFactory_FilerPrefix(const char* prefix)
-{
-    rc_t rc = 0;
-
-    if( g_filer == NULL ) {
-        rc = RC(rcExe, rcFile, rcUpdating, rcSelf, rcNotOpen);
-    } else if( prefix == NULL || strcmp(prefix, g_filer->prefix) != 0 ) {
-        if( (rc = SRASplitterFiler_PopKey()) == 0 ) {
-            free(g_filer->prefix);
-            g_filer->prefix = strdup(prefix ? prefix : "");
-            if( g_filer->prefix == NULL ) {
-                rc = RC(rcExe, rcFile, rcConstructing, rcMemory, rcExhausted);
-            } else {
-                rc = SRASplitterFiler_PushKey(g_filer->prefix);
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitterFactory_FilerInit(bool to_stdout, bool gzip, bool bzip2, bool key_as_dir, bool keep_empty, const char* path, ...)
-{
-    rc_t rc = 0;
-
-    if( g_filer != NULL ) {
-        rc = RC(rcExe, rcFile, rcConstructing, rcSelf, rcExists);
-    } else if( gzip && bzip2 ) {
-        rc = RC(rcExe, rcFile, rcConstructing, rcParam, rcAmbiguous);
-    } else if( (g_filer = calloc(1, sizeof(*g_filer))) == NULL ) {
-        rc = RC(rcExe, rcFile, rcConstructing, rcMemory, rcExhausted);
-    } else {
-        g_filer->key_as_dir = to_stdout ? false : key_as_dir;
-        g_filer->keep_empty = to_stdout ? true : keep_empty;
-        g_filer->do_gzip = gzip;
-        g_filer->do_bzip2 = bzip2;
-        g_filer->arc_extension = gzip ? ".gz" : (bzip2 ? ".bz2" : "");
-        SLListInit(&g_filer->files);
-        /* push empty prefix */
-        g_filer->prefix = strdup("");
-        if( (rc = SRASplitterFiler_PushKey(g_filer->prefix)) == 0 &&
-            (rc = KDirectoryNativeDir(&g_filer->dir)) == 0 ) {
-            if( to_stdout ) {
-                if( (rc = KFileMakeStdOut(&g_filer->kf_stdout)) == 0 ) {
-                    KFile *buf = NULL;
-                    if( gzip ) {
-                        KFile* gz;
-                        if( (rc = KFileMakeGzipForWrite(&gz, g_filer->kf_stdout)) == 0 ) {
-                            KFileRelease(g_filer->kf_stdout);
-                            g_filer->kf_stdout = gz;
-                        }
-                    } else if( bzip2 ) {
-                        KFile* bz;
-                        if( (rc = KFileMakeBzip2ForWrite(&bz, g_filer->kf_stdout)) == 0 ) {
-                            KFileRelease(g_filer->kf_stdout);
-                            g_filer->kf_stdout = bz;
-                        }
-                    }
-#if OUTPUT_BUFFER_SIZE
-                    if ( rc == 0 ) {
-                        if( (rc = KBufFileMakeWrite(&buf, g_filer->kf_stdout, false, OUTPUT_BUFFER_SIZE)) == 0 ) {
-                            KFileRelease(g_filer->kf_stdout);
-                            g_filer->kf_stdout = buf;
-                        } else {
-#if _DEBUGGING
-                            /* we only want to see this in debug */
-                            LOGERR(klogErr, rc, "creating buffer for stdout");
-#else
-                            rc = 0;
-#endif
-                        }
-                    }
-#endif
-                }
-            } else if( path != NULL ) {
-                va_list args;
-                va_start(args, path);
-                if( (rc = KDirectoryVCreateDir(g_filer->dir, 0775, kcmCreate | kcmParents, path, args)) == 0 ||
-                    (GetRCObject(rc) == rcDirectory && GetRCState(rc) == rcExists) ) {
-                    KDirectory* sub = NULL;
-                    va_end(args);
-                    va_start(args, path);
-                    if( (rc = KDirectoryVOpenDirUpdate(g_filer->dir, &sub, true, path, args)) == 0 ) {
-                        KDirectoryRelease(g_filer->dir);
-                        g_filer->dir = sub;
-                    }
-                }
-                va_end(args);
-            }
-        }
-    }
-    if( rc != 0 ) {
-        SRASplitterFiler_PopKey();
-        SRASplitterFiler_Release();
-    }
-    return rc;
-}
-
-/* ### Base splitter code ##################################################### */
-
-/* used to detect correct object pointers */
-const uint32_t SRASplitterFactory_MAGIC = 0xFACE3693;
-
-struct SRASplitterFactory {
-    uint32_t magic;
-    ESRASplitterTypes type;
-    const SRASplitterFactory* next;
-    SRASplitterFactory_Init_Func* Init;
-    SRASplitterFactory_NewObj_Func* NewObj;
-    SRASplitterFactory_Release_Func* Release;
-};
-
-/* used to detect correct object pointers */
-const uint32_t SRASplitter_MAGIC = 0xFACE5325;
-
-typedef struct SRASplitter_Child SRASplitter_Child;
-
-struct SRASplitter {
-    uint32_t magic;
-    ESRASplitterTypes type;
-    const SRASplitterFactory* next_fact;
-    SRASplitter_GetKey_Func* GetKey;
-    SRASplitter_GetKeySet_Func* GetKeySet;
-    SRASplitter_Dump_Func* Dump;
-    SRASplitter_Release_Func* Release;
-    BSTree children;
-    SRASplitter_Child* last_found;
-};
-
-struct SRASplitter_Child {
-    BSTNode node;
-    char key[DUMPER_MAX_KEY_LENGTH + 1];
-    bool is_splitter; /* next union selector */
-    union {
-        /* chained key->splitter for self type of eSplitterRead and eSplitterSpot */
-        const SRASplitter* splitter;
-        /* file object for self type of eSplitterFormat */
-        const SRASplitterFile* file;
-    } child;
-};
-
-static
-rc_t SRASplitter_Child_Make(SRASplitter_Child** child, const char* key)
-{
-    if( child == NULL || key == NULL ) {
-        return RC(rcExe, rcNode, rcAllocating, rcParam, rcNull);
-    }
-    if( strlen(key) > DUMPER_MAX_KEY_LENGTH ) {
-        return RC(rcExe, rcNode, rcAllocating, rcTag, rcTooLong);
-    }
-    *child = calloc(1, sizeof(**child));
-    if( *child == NULL ) {
-        return RC(rcExe, rcNode, rcAllocating, rcMemory, rcExhausted);
-    }
-    strcpy((*child)->key, key);
-    return 0;
-}
-
-static
-rc_t SRASplitter_Child_MakeSplitter(SRASplitter_Child** child, const char* key, const SRASplitter* splitter)
-{
-    rc_t rc = 0;
-
-    if( splitter == NULL ) {
-        rc = RC(rcExe, rcNode, rcAllocating, rcParam, rcNull);
-    } else if( (rc = SRASplitter_Child_Make(child, key)) == 0 ) {
-        (*child)->is_splitter = true;
-        (*child)->child.splitter = splitter;
-    }
-    return rc;
-}
-
-static
-rc_t SRASplitter_Child_MakeFile(SRASplitter_Child** child, const char* key, const SRASplitterFile* file)
-{
-    rc_t rc = 0;
-
-    if( file == NULL ) {
-        rc = RC(rcExe, rcNode, rcAllocating, rcParam, rcNull);
-    } else if( (rc = SRASplitter_Child_Make(child, key)) == 0 ) {
-        (*child)->is_splitter = false;
-        (*child)->child.file = file;
-    }
-    return rc;
-}
-
-static
-void CC SRASplitter_Child_Whack(BSTNode* node, void* data)
-{
-    const SRASplitter_Child* n = (const SRASplitter_Child*)node;
-    if( n->is_splitter ) {
-        rc_t rc = 0;
-        if( (rc = SRASplitter_Release(n->child.splitter)) != 0 ) {
-            LOGERR(klogErr, rc, "SRASplitter_Release");
-        }
-    }
-    free(node);
-}
-
-static
-int CC SRASplitter_Child_Cmp(const BSTNode* item, const BSTNode* node)
-{
-    const SRASplitter_Child* i = (const SRASplitter_Child*)item;
-    const SRASplitter_Child* n = (const SRASplitter_Child*)node;
-    return strcmp(i->key, n->key);
-}
-
-static
-int CC SRASplitter_Child_Find(const void* item, const BSTNode* node)
-{
-    const char* key = (const char*)item;
-    const SRASplitter_Child* n = (const SRASplitter_Child*)node;
-    return strcmp(key, n->key);
-}
-
-static /* not virtual, self is direct pointer to base type here !!! */
-rc_t SRASplitter_FindNextSplitter(SRASplitter* self, const char* key)
-{
-    rc_t rc = 0;
-
-    if( self->last_found == NULL || strcmp(self->last_found->key, key) ) {
-        self->last_found = (SRASplitter_Child*)BSTreeFind( &self->children, key, SRASplitter_Child_Find );
-        if( self->last_found == NULL ) {
-            /* create new child using next factory in chain */
-            const SRASplitter* splitter = NULL;
-            SRA_DUMP_DBG(5, ("New splitter on key '%s'\n", key));
-            if( (rc = SRASplitterFactory_NewObj(self->next_fact, &splitter)) == 0 ) {
-                if( (rc = SRASplitter_Child_MakeSplitter(&self->last_found, key, splitter)) == 0 ) {
-                    if( (rc = BSTreeInsertUnique(&self->children, &self->last_found->node, NULL, SRASplitter_Child_Cmp)) != 0 ) {
-                        SRASplitter_Child_Whack(&self->last_found->node, NULL);
-                        self->last_found = NULL;
-                    }
-                } else {
-                    SRASplitter_Release(splitter);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static /* not virtual, self is direct pointer to base type here !!! */
-rc_t SRASplitter_FindNextFile(SRASplitter* self, const char* key)
-{
-    rc_t rc = 0;
-
-    if( self->last_found == NULL || strcmp(self->last_found->key, key) != 0 ) {
-        self->last_found = (SRASplitter_Child*)BSTreeFind(&self->children, key, SRASplitter_Child_Find);
-        if( self->last_found == NULL ) {
-            /* create new child using global filer */
-            const SRASplitterFile* file = NULL;
-            SRA_DUMP_DBG(5, ("New file on key '%s'\n", key));
-            if( (rc = SRASplitterFiler_GetCurrFile(&file)) == 0 ) {
-                if( (rc = SRASplitter_Child_MakeFile(&self->last_found, key, file)) == 0 ) {
-                    if( (rc = BSTreeInsertUnique(&self->children, &self->last_found->node, NULL, SRASplitter_Child_Cmp)) != 0 ) {
-                        SRASplitter_Child_Whack(&self->last_found->node, NULL);
-                        self->last_found = NULL;
-                    }
-                }
-            }
-        }
-    }
-    if( rc == 0 ) {
-        /* make sure file is opened */
-        rc = SRASplitterFiler_OpenFile((SRASplitterFile*)(self->last_found->child.file), false);
-    }
-    return rc;
-}
-
-rc_t SRASplitter_Make(const SRASplitter** cself, size_t type_size,
-                      SRASplitter_GetKey_Func* getkey,
-                      SRASplitter_GetKeySet_Func* get_keyset,
-                      SRASplitter_Dump_Func* dump,
-                      SRASplitter_Release_Func* release)
-{
-    SRASplitter* self = NULL;
-
-    if( cself == NULL ) {
-        return RC(rcExe, rcType, rcAllocating, rcParam, rcNull);
-    }
-    self = calloc(1, type_size + sizeof(*self));
-    if( self == NULL ) {
-        return RC(rcExe, rcType, rcAllocating, rcMemory, rcExhausted);
-    }
-    self->magic = SRASplitter_MAGIC;
-    BSTreeInit(&self->children);
-    self->GetKey = getkey;
-    self->GetKeySet = get_keyset;
-    self->Dump = dump;
-    self->Release = release;
-
-    /* shift pointer to after hidden structure */
-    self++;
-    *cself = self;
-    return 0;
-}
-
-static
-rc_t SRASplitter_ResolveSelf(const SRASplitter* self, enum RCContext ctx, SRASplitter** resolved)
-{
-    if( self == NULL || resolved == NULL ) {
-        return RC(rcExe, rcType, ctx, rcSelf, rcNull);
-    }
-    *resolved = (SRASplitter*)--self;
-    /* just to validate that it is full instance */
-    if( (*resolved)->magic != SRASplitter_MAGIC ) {
-        *resolved = NULL;
-        return RC(rcExe, rcType, ctx, rcMemory, rcCorrupt);
-    }
-    return 0;
-}
-
-rc_t SRASplitter_AddSpot( const SRASplitter * cself, spotid_t spot, readmask_t * readmask )
-{
-    SRASplitter * self = NULL;
-    rc_t rc = SRASplitter_ResolveSelf( cself, rcExecuting, &self );
-    if ( rc == 0 )
-    {
-        if ( self->type == eSplitterRead )
-        {
-            const SRASplitter_Keys* keys = NULL;
-            uint32_t key_qty = 0;
-            int32_t i, j, k;
-            make_readmask( used_readmasks );
-
-            clear_readmask( used_readmasks );
-            rc = self->GetKeySet( cself, &keys, &key_qty, spot, readmask );
-
-            for ( i = 0; rc == 0 && i < key_qty; i++ )
-            {
-                if ( keys[ i ].key != NULL && !isset_readmask( used_readmasks, i ) )
-                {
-                    make_readmask( local_readmask );
-                    copy_readmask( keys[ i ].readmask, local_readmask );
-                    /* merge readmasks from duplicate keys in array */
-                    for ( j = i + 1; j < key_qty; j++ )
-                    {
-                        if ( keys[ i ].key == keys[ j ].key || strcmp( keys[ i ].key, keys[ j ].key ) == 0 )
-                        {
-                            set_readmask( used_readmasks, j );
-                            for ( k = 0; k < nreads_max; k++ )
-                            {
-                                local_readmask[ k ] |= keys[ j ].readmask[ k ];
-                            }
-                        }
-                    }
-                    /* leave reads only allowed by previous object in chain */
-                    for ( j = 0, k = 0; k < nreads_max; k++ )
-                    {
-                        local_readmask[ k ] &= readmask[ k ];
-                        if ( isset_readmask( local_readmask, k ) )
-                        {
-                            j++;
-                        }
-                    }
-                    if ( j > 0 )
-                    {
-                        rc = SRASplitter_FindNextSplitter( self, keys[ i ].key );
-                        if ( rc == 0 )
-                        {
-                            /* push spot to next splitter in chain */
-                            rc = SRASplitterFiler_PushKey( self->last_found->key );
-                            if ( rc == 0 )
-                            {
-                                /* here comes RECURSION!!! */
-                                rc_t rc2;
-                                rc = SRASplitter_AddSpot( self->last_found->child.splitter, spot, local_readmask );
-                                rc2 = SRASplitterFiler_PopKey();
-                                rc = rc ? rc : rc2;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        else if ( self->type == eSplitterSpot )
-        {
-            const char* key = NULL;
-            make_readmask( new_readmask );
-            copy_readmask( readmask, new_readmask );
-            rc = self->GetKey( cself, &key, spot, new_readmask );
-            if ( rc == 0 && key != NULL )
-            {
-                int32_t j, k;
-                /* leave reads only allowed by previous object in chain */
-                for( j = 0, k = 0; k < nreads_max; k++ )
-                {
-                    readmask[ k ] &= new_readmask[ k ];
-                    if ( isset_readmask( readmask, k ) )
-                    {
-                        j++;
-                    }
-                }
-                if ( j > 0 )
-                {
-                    rc = SRASplitter_FindNextSplitter( self, key );
-                    if ( rc == 0 )
-                    {
-                        /* push spot to next splitter in chain */
-                        rc = SRASplitterFiler_PushKey( self->last_found->key );
-                        if ( rc == 0 )
-                        {
-                            /* here comes RECURSION!!! */
-                            rc_t rc2;
-                            rc = SRASplitter_AddSpot( self->last_found->child.splitter, spot, readmask );
-                            rc2 = SRASplitterFiler_PopKey();
-                            rc = rc ? rc : rc2;
-                        }
-                    }
-                }
-            }
-        }
-        else if ( self->type == eSplitterFormat )
-        {
-            rc = self->Dump( cself, spot, readmask );
-        }
-        else
-        {
-            rc = RC( rcExe, rcFile, rcExecuting, rcInterface, rcUnsupported );
-        }
-    }
-    return rc;
-}
-
-
-rc_t SRASplitter_Release(const SRASplitter* cself)
-{
-    rc_t rc = 0;
-    SRASplitter* self = NULL;
-
-    if( cself != NULL ) {
-        if( (rc = SRASplitter_ResolveSelf(cself, rcExecuting, &self)) == 0 ) {
-            if( self->Release ) {
-                rc = self->Release(cself);
-            }
-            BSTreeWhack( &self->children, SRASplitter_Child_Whack, NULL );
-            free(self);
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitter_FileActivate(const SRASplitter* cself, const char* key)
-{
-    rc_t rc = 0, rc2 = 0;
-    SRASplitter* self = NULL;
-
-    if( (rc = SRASplitter_ResolveSelf(cself, rcExecuting, &self)) == 0 ) {
-        if( (rc = SRASplitterFiler_PushKey(key)) == 0 ) {
-            /* sets self->last_found */
-            rc = SRASplitter_FindNextFile(self, key);
-            rc2 = SRASplitterFiler_PopKey();
-            rc = rc ? rc : rc2;
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitter_FileWrite( const SRASplitter* cself, spotid_t spot, const void* buf, size_t size )
-{
-    SRASplitter* self = NULL;
-    
-    rc_t rc = SRASplitter_ResolveSelf( cself, rcWriting, &self );
-    if ( rc == 0 )
-    {
-        if ( self->last_found == NULL )
-        {
-            rc = RC( rcExe, rcFile, rcWriting, rcDirEntry, rcUnknown );
-        }
-        else if ( buf != NULL && size > 0 )
-        {
-            size_t writ = 0;
-            SRASplitterFile* f = ( SRASplitterFile* )( self->last_found->child.file );
-            rc = KFileWrite( f->file, f->pos, buf, size, &writ );
-            if ( rc == 0 )
-            {
-                f->pos += writ;
-                if ( f->curr_spot != spot && spot != 0 )
-                {
-                     f->curr_spot = spot;
-                     f->spot_qty = f->spot_qty + 1;
-                }
-                if ( g_filer->curr_spot != spot && spot != 0 )
-                {
-                    g_filer->curr_spot = spot;
-                    g_filer->spot_qty = g_filer->spot_qty + 1;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitter_FileWritePos( const SRASplitter* cself, spotid_t spot, 
-                               uint64_t pos, const void* buf, size_t size )
-{
-    SRASplitter* self = NULL;
-
-    rc_t rc = SRASplitter_ResolveSelf( cself, rcWriting, &self );
-    if ( rc == 0 )
-    {
-        if ( self->last_found == NULL )
-        {
-            rc = RC( rcExe, rcFile, rcWriting, rcDirEntry, rcUnknown );
-        }
-        else if ( buf != NULL && size > 0 )
-        {
-            const SRASplitterFile* f = self->last_found->child.file;
-            /* remember last position */
-            uint64_t old_pos = f->pos;
-            ( ( SRASplitterFile* ) f )->pos = pos;
-            /* write to requested position */
-            rc = SRASplitter_FileWrite( cself, spot, buf, size );
-            if ( f->pos < old_pos )
-            {
-                /* revert to last position if wrote less than it was */
-                ( ( SRASplitterFile* ) f )->pos = old_pos;
-            }
-        }
-    }
-    return rc;
-}
-
-/* ### Common splitter factory code ##################################################### */
-
-rc_t SRASplitterFactory_Make(const SRASplitterFactory** cself, ESRASplitterTypes type, size_t type_size,
-                             SRASplitterFactory_Init_Func* init, SRASplitterFactory_NewObj_Func* newObj,
-                             SRASplitterFactory_Release_Func* release)
-{
-    SRASplitterFactory* self = NULL;
-
-    if( cself == NULL || newObj == NULL ) {
-        return RC(rcExe, rcType, rcAllocating, rcParam, rcNull);
-    }
-    self = calloc(1, type_size + sizeof(*self));
-    if( self == NULL ) {
-        return RC(rcExe, rcType, rcAllocating, rcMemory, rcExhausted);
-    }
-    self->magic = SRASplitterFactory_MAGIC;
-    self->type = type;
-    self->Init = init;
-    self->NewObj = newObj;
-    self->Release = release;
-
-    /* shift pointer to after hidden structure */
-    self++;
-    *cself = self;
-    return 0;
-}
-
-static
-rc_t SRASplitterFactory_ResolveSelf(const SRASplitterFactory* self, enum RCContext ctx, SRASplitterFactory** resolved)
-{
-    if( self == NULL || resolved == NULL ) {
-        return RC(rcExe, rcType, ctx, rcSelf, rcNull);
-    }
-    *resolved = (SRASplitterFactory*)--self;
-    /* just to validate that it is full instance */
-    if( (*resolved)->magic != SRASplitterFactory_MAGIC ) {
-        *resolved = NULL;
-        return RC(rcExe, rcType, ctx, rcMemory, rcCorrupt);
-    }
-    return 0;
-}
-
-void SRASplitterFactory_Release(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    SRASplitterFactory* self = NULL;
-
-    if( cself != NULL ) {
-        if( (rc = SRASplitterFactory_ResolveSelf(cself, rcReleasing, &self)) == 0 ) {
-            SRASplitterFactory_Release(self->next);
-            if( self->Release != NULL ) {
-                self->Release(cself);
-            }
-            free(self);
-        }
-    }
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "SRASplitterFactory");
-    }
-}
-
-ESRASplitterTypes SRASplitterFactory_GetType(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    SRASplitterFactory* self = NULL;
-
-    if( (rc = SRASplitterFactory_ResolveSelf(cself, rcClassifying, &self)) == 0 ) {
-        return self->type;
-    }
-    LOGERR(klogErr, rc, "SRASplitterFactory");
-    return 0;
-}
-
-rc_t SRASplitterFactory_AddNext(const SRASplitterFactory* cself, const SRASplitterFactory* next)
-{
-    rc_t rc = 0;
-    SRASplitterFactory* self = NULL;
-
-    if( (rc = SRASplitterFactory_ResolveSelf(cself, rcAttaching, &self)) == 0 ) {
-        if( self->type == eSplitterFormat && next != NULL ) {
-            /* formatter must be last in chain */
-            rc = RC(rcExe, rcType, rcAttaching, rcConstraint, rcViolated);
-        } else {
-            SRASplitterFactory_Release(self->next);
-            self->next = next;
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    SRASplitterFactory* self = NULL;
-
-    if( (rc = SRASplitterFactory_ResolveSelf(cself, rcConstructing, &self)) == 0 ) {
-        if( self->Init ) {
-            rc = self->Init(cself);
-        }
-        if( rc == 0 ) {
-            if( self->next != NULL ) {
-                rc = SRASplitterFactory_Init(self->next);
-            } else if( self->type != eSplitterFormat ) {
-                /* formatter must be last in chain */
-                rc = RC(rcExe, rcType, rcConstructing, rcConstraint, rcViolated);
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t SRASplitterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    SRASplitterFactory* self = NULL;
-
-    if( (rc = SRASplitterFactory_ResolveSelf(cself, rcConstructing, &self)) == 0 ) {
-        if( (rc = self->NewObj(cself, splitter)) == 0 ) {
-            SRASplitter* sp = NULL;
-            if( (rc = SRASplitter_ResolveSelf(*splitter, rcConstructing, &sp)) == 0 ) {
-                sp->type = self->type;
-                if( (self->type == eSplitterSpot   && (!sp->GetKey ||  sp->GetKeySet ||  sp->Dump) ) ||
-                    (self->type == eSplitterRead   && ( sp->GetKey || !sp->GetKeySet ||  sp->Dump) ) ||
-                    (self->type == eSplitterFormat && ( sp->GetKey ||  sp->GetKeySet || !sp->Dump) ) ) {
-                    SRASplitter_Release(*splitter);
-                    *splitter = NULL;
-                    rc = RC(rcExe, rcType, rcAllocating, rcInterface, rcInvalid);
-                } else if(self->type != eSplitterFormat) {
-                    sp->next_fact = self->next;
-                }
-            }
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-dump/factory.h b/tools/sra-dump/factory.h
deleted file mode 100644
index c315f47..0000000
--- a/tools/sra-dump/factory.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_tools_dump_factory
-#define _h_tools_dump_factory
-
-#include <klib/rc.h>
-#include <kfs/file.h>
-#include <klib/data-buffer.h>
-#include <sra/sradb.h>
-
-#define DATABUFFER_INC_SZ 4096
-
-/* KDataBuffer is used as byte buffer-only here! */
-#define IF_BUF(expr, buf, writ) \
-    while( (rc = (expr)) != 0 && \
-           (GetRCObject(rc) == rcMemory || GetRCObject(rc) == rcBuffer) && \
-           (GetRCState(rc) == rcInsufficient || GetRCState(rc) == rcExhausted) ) { \
-        SRA_DUMP_DBG(10, ("\n%s grow buffer from %u to %u\n", __func__, buf->elem_count, writ + DATABUFFER_INC_SZ)); \
-        if( (rc = KDataBufferResize(buf, writ + DATABUFFER_INC_SZ)) != 0 ) { \
-            break; \
-        } \
-    } \
-    if( rc == 0 )
-
-typedef enum {
-    eSplitterSpot = 1,
-    eSplitterRead,
-    eSplitterFormat /* in splitters chain this type must be the last instance and must write to file(s) */
-} ESRASplitterTypes;
-
-typedef struct SRASplitter SRASplitter;
-
-#define NREADS_MAX (8*1024)
-typedef uint8_t readmask_t; 
-extern uint32_t nreads_max;
-
-/* new hack to realize changed requirement for quality-filter */
-#define DEF_QUAL_N_LIMIT 10
-extern uint32_t quality_N_limit;
-
-extern bool g_legacy_report;
-
-#define make_readmask(m) readmask_t m[NREADS_MAX]
-#define copy_readmask(src,dst) (memcpy(dst, src, sizeof(readmask_t) * nreads_max))
-#define reset_readmask(m) (memset(m, ~0, sizeof(readmask_t) * nreads_max))
-#define clear_readmask(m) (memset(m,  0, sizeof(readmask_t)  * nreads_max))
-#define set_readmask(m,id) (id < nreads_max ? (m)[id] = 1 : 0)
-#define unset_readmask(m,id) (id < nreads_max ? (m)[id] = 0 : 0)
-#define get_readmask(m,id) (id < nreads_max ? ((m)[id]) : 0)
-#define isset_readmask(m,id) (id < nreads_max ? (m)[id] != 0 : false)
-
-typedef struct SRASplitter_Keys_struct {
-    const char* key;
-    make_readmask(readmask);
-} SRASplitter_Keys;
-
-/* for eSpot splitter: returns pointer to key and (optionally) modified readmask, based on spotid and readmask
-   key == NULL stops further processing of the spot, char* key alloc and dealloc must be handled by splitter itself
- */
-typedef rc_t (SRASplitter_GetKey_Func)(const SRASplitter* self, const char** key, spotid_t spot, readmask_t* readmask);
-
-/* for eRead splitter:
-   returns array of keys and readmasks used array portion count in keys, based on spotid and readmask,
-   on return keys shows number of array key[] elements used, keys == 0 stops further processing of the spot,
-   elements with key.key == NULL OR key.readmask == 0 are skipped
-   key alloc and dealloc must be handled by splitter itself
-*/
-typedef rc_t (SRASplitter_GetKeySet_Func)(const SRASplitter* self, const SRASplitter_Keys** key, uint32_t* keys, spotid_t spot, const readmask_t* readmask);
-
-/* writes data to file(s) using SRASplitter_File* functions, based on spot and readmask
-   do NOT open or create any files directly here, use SRASplitter_FileXXX functions only!
-*/
-typedef rc_t (SRASplitter_Dump_Func)(const SRASplitter* self, spotid_t spot, const readmask_t* readmask);
-
-/* optional method to free splitter resources, object distruction is handled automatically, do NOT free self! */
-typedef rc_t (SRASplitter_Release_Func)(const SRASplitter* self);
-
-/**
-  * Base type constructor, must be called when constructing custom splitter type
-  */
-rc_t SRASplitter_Make(const SRASplitter** self, size_t type_size, /* sizeof(derived object) */
-                      /* mandatory only for eSpot splitter, must be NULL for other types */
-                      SRASplitter_GetKey_Func*,
-                      /* mandatory only for eRead splitter, must be NULL for other types */
-                      SRASplitter_GetKeySet_Func*,
-                      /* mandatory only for eFormat splitter, must be NULL for other types */
-                      SRASplitter_Dump_Func*,
-                      /* optional destructor, do NOT free self! */
-                      SRASplitter_Release_Func* release);
-/**
-  * Base type destructor
-  */
-rc_t SRASplitter_Release(const SRASplitter* self);
-
-/**
-  * Add spot to processing chain
-  */
-rc_t SRASplitter_AddSpot(const SRASplitter* self, spotid_t spot, readmask_t* readmask);
-
-/**
-  * File access routines
-  */
-/* key [IN] - usually file type extension: .sff, .fastq, _nse.txt, etc */
-rc_t SRASplitter_FileActivate(const SRASplitter* self, const char* key);
-/* CAREFULL!!! these operates on last active file
-   spot can be zero to indicate file header/footer
-   which no considered as actual data and file treated as empty if no actual spots is written
- */
-rc_t SRASplitter_FileWrite( const SRASplitter* cself, spotid_t spot, const void* buf, size_t size );
-rc_t SRASplitter_FileWritePos( const SRASplitter* cself, spotid_t spot, uint64_t pos, const void* buf, size_t size );
-
-typedef struct SRASplitterFactory SRASplitterFactory;
-
-typedef rc_t (SRASplitterFactory_Init_Func)(const SRASplitterFactory* self);
-typedef rc_t (SRASplitterFactory_NewObj_Func)(const SRASplitterFactory* self, const SRASplitter** splitter);
-typedef void (SRASplitterFactory_Release_Func)(const SRASplitterFactory* self);
-
-
-/**
-  * Initialize factories file handler object.
-  * Must be called BEFORE 1st call to SRASplitterFactory_Init
-  *
-  * key_as_dir [IN] - if true, subdirs created for each splitting level: SPOT_GROUP/1/prefix.fastq
-  *                   if false, single file is used in split chain: prefix_SPOT_GROUP_1.fastq
-  * prefix [IN]     - file name prefix, usually run id (accession)
-  * path, ... [IN]  - path to directory where file will reside
-  */
-rc_t SRASplitterFactory_FilerInit(bool to_stdout, bool gzip, bool bzip2, bool key_as_dir, bool keep_empty, const char* path, ...);
-/* this only works correctly on top of the splitter tree !! */
-rc_t SRASplitterFactory_FilerPrefix(const char* prefix);
-void SRASplitterFactory_FilerReport(uint64_t* total, uint64_t* biggest_file);
-void SRASplitterFiler_Release(void);
-
-/**
-  * Create factory object
-  */
-rc_t SRASplitterFactory_Make(const SRASplitterFactory** self, ESRASplitterTypes type, size_t type_size,
-                             /* optional method to initialize self */
-                             SRASplitterFactory_Init_Func* init,
-                             /* mandatory method to spawn new SRASplitter object */
-                             SRASplitterFactory_NewObj_Func* newObj,
-                             /* optional destructor, should NOT free self!!! */
-                             SRASplitterFactory_Release_Func* release);
-
-/**
-  * Releases Factory and all chained factories
-  */
-void SRASplitterFactory_Release(const SRASplitterFactory* self);
-
-/**
-  * Get Factory type
-  */
-ESRASplitterTypes SRASplitterFactory_GetType(const SRASplitterFactory* self);
-
-/**
-  * Chain "next" factory after "self", releases old chain if present
-  */
-rc_t SRASplitterFactory_AddNext(const SRASplitterFactory* self, const SRASplitterFactory* next);
-
-/**
-  * Initialize a chain of factories. Factories must be chaind properly before init.
-  * Type chain must look like (eSpot|eRead)*, eFormat.
-  */
-rc_t SRASplitterFactory_Init(const SRASplitterFactory* self);
-
-/**
-  * Create new instance of factory kind, point splitter to next factory in chain
-  */
-rc_t SRASplitterFactory_NewObj(const SRASplitterFactory* self, const SRASplitter** splitter);
-
-#endif /* _h_tools_dump_factory */
diff --git a/tools/sra-dump/fasta_dump.c b/tools/sra-dump/fasta_dump.c
deleted file mode 100644
index 41e7b58..0000000
--- a/tools/sra-dump/fasta_dump.c
+++ /dev/null
@@ -1,752 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/printf.h>
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfs/buffile.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-
-#include <vdb/manager.h>
-
-#include <align/manager.h>
-#include <align/reference.h>
-
-#include <sra/srapath.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
-static bool string_ends_with( const char * s, const char * pattern )
-{
-    const char * found = strstr ( s, pattern );
-    if ( found == NULL )
-        return false;
-    else
-    {
-        size_t len_string = string_size ( s );
-        size_t len_pattern = string_size ( pattern );
-        size_t found_at = ( found - s );
-        return ( found_at == ( len_string - len_pattern ) );
-    }
-}
-
-
-static char * fasta_ref = "--fastaref";
-
-/* we have to test if argv[0] ends in 'fastq-dump' or 'fastq-dump.exe',
-   and we have an argument called '--fasta' */
-bool fasta_dump_requested( int argc, char* argv[] )
-{
-    if ( string_ends_with( argv[ 0 ], "fastq-dump" ) ||
-         string_ends_with( argv[ 0 ], "fastq-dump.exe" ) )
-    {
-        int i;
-        for ( i = 1; i < argc; ++i )
-        {
-            if ( strcmp( argv[ i ], fasta_ref ) == 0 )
-                return true;
-        }
-    }
-
-    return false;
-}
-
-#define OPTION_OUTF    "outfile"
-#define ALIAS_OUTF     "o"
-
-#define OPTION_WIDTH   "width"
-#define ALIAS_WIDTH    "w"
-
-#define OPTION_GZIP    "gzip"
-#define ALIAS_GZIP     NULL
-
-#define OPTION_BZIP    "bzip2"
-#define ALIAS_BZIP     NULL
-
-#define OPTION_REFNAME "refname"
-#define ALIAS_REFNAME  "r"
-
-#define OPTION_FROM    "from"
-#define ALIAS_FROM     "N"
-
-#define OPTION_LENGTH   "length"
-#define ALIAS_LENGTH    "X"
-
-#define OPTION_FAREF    "fastaref"
-#define ALIAS_FAREF     NULL
-
-
-OptDef MyOptions[] =
-{
-    /*name,           alias,         hfkt, usage-help,    maxcount, needs value, required */
-    { OPTION_OUTF,    ALIAS_OUTF,    NULL, NULL,          1,        true,        false },
-    { OPTION_WIDTH,   ALIAS_WIDTH,   NULL, NULL,          1,        true,        false },
-    { OPTION_GZIP,    ALIAS_GZIP,    NULL, NULL,          1,        false,       false },
-    { OPTION_BZIP,    ALIAS_BZIP,    NULL, NULL,          1,        false,       false },
-    { OPTION_REFNAME, ALIAS_REFNAME, NULL, NULL,          0,        true,        false },
-    { OPTION_FROM,    ALIAS_FROM,    NULL, NULL,          1,        true,        false },
-    { OPTION_LENGTH,  ALIAS_LENGTH,  NULL, NULL,          1,        true,        false },
-    { OPTION_FAREF,   ALIAS_FAREF,   NULL, NULL,          1,        false,       false }
-};
-
-
-/* =========================================================================================== */
-
-
-/* GLOBAL VARIABLES */
-struct {
-    KWrtWriter org_writer;
-    void* org_data;
-    KFile* kfile;
-    uint64_t pos;
-} g_out_writer = { NULL };
-
-
-/* =========================================================================================== */
-
-static rc_t get_str_option( const Args *args, const char *name, const char ** res )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    *res = NULL;
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-    }
-    else
-    {
-        if ( count > 0 )
-        {
-            rc = ArgsOptionValue( args, name, 0, res );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ArgsOptionValue() failed" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t get_bool_option( const Args *args, const char *name, bool *res, const bool def )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        *res = true;
-    }
-    else
-    {
-        *res = def;
-    }
-    return rc;
-}
-
-
-static rc_t get_int_option( const Args *args, const char *name, uint32_t *res, const uint32_t def )
-{
-    const char * s;
-    rc_t rc = get_str_option( args, name, &s );
-    *res = def;
-    if ( rc == 0 && s != NULL )
-    {
-        *res = atoi( s );
-    }
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-static rc_t CC BufferedWriter ( void* self, const char* buffer, size_t bufsize, size_t* num_writ )
-{
-    rc_t rc = 0;
-
-    assert( buffer != NULL );
-    assert( num_writ != NULL );
-
-    do {
-        rc = KFileWrite( g_out_writer.kfile, g_out_writer.pos, buffer, bufsize, num_writ );
-        if ( rc == 0 )
-        {
-            buffer += *num_writ;
-            bufsize -= *num_writ;
-            g_out_writer.pos += *num_writ;
-        }
-    } while ( rc == 0 && bufsize > 0 );
-    return rc;
-}
-
-
-static rc_t set_stdout_to( bool gzip, bool bzip2, const char * filename, size_t bufsize )
-{
-    rc_t rc = 0;
-    if ( gzip && bzip2 )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else
-    {
-        KDirectory *dir;
-        rc = KDirectoryNativeDir( &dir );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-        else
-        {
-            KFile *of;
-            rc = KDirectoryCreateFile ( dir, &of, false, 0664, kcmInit, "%s", filename );
-            if ( rc == 0 )
-            {
-                KFile *buf;
-                if ( gzip )
-                {
-                    KFile *gz;
-                    rc = KFileMakeGzipForWrite( &gz, of );
-                    if ( rc == 0 )
-                    {
-                        KFileRelease( of );
-                        of = gz;
-                    }
-                }
-                if ( bzip2 )
-                {
-                    KFile *bz;
-                    rc = KFileMakeBzip2ForWrite( &bz, of );
-                    if ( rc == 0 )
-                    {
-                        KFileRelease( of );
-                        of = bz;
-                    }
-                }
-
-                rc = KBufFileMakeWrite( &buf, of, false, bufsize );
-                if ( rc == 0 )
-                {
-                    g_out_writer.kfile = buf;
-                    g_out_writer.org_writer = KOutWriterGet();
-                    g_out_writer.org_data = KOutDataGet();
-                    rc = KOutHandlerSet( BufferedWriter, &g_out_writer );
-                    if ( rc != 0 )
-                        LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-                }
-                KFileRelease( of );
-            }
-            KDirectoryRelease( dir );
-        }
-    }
-    return rc;
-}
-
-
-static void release_stdout_redirection( void )
-{
-    KFileRelease( g_out_writer.kfile );
-    if( g_out_writer.org_writer != NULL )
-    {
-        KOutHandlerSet( g_out_writer.org_writer, g_out_writer.org_data );
-    }
-    g_out_writer.org_writer = NULL;
-}
-
-
-static rc_t CC write_to_FILE( void *f, const char *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = fwrite ( buffer, 1, bytes, f );
-    if ( * num_writ != bytes )
-        return RC( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-
-/* =========================================================================================== */
-
-typedef struct fasta_options
-{
-    uint32_t width;
-    bool gzip;
-    bool bzip;
-    const char * outfile;
-    INSDC_coord_zero from;
-    INSDC_coord_len length;
-} fasta_options;
-
-
-static rc_t get_fasta_options( Args * args, fasta_options *opts )
-{
-    rc_t rc = get_int_option( args, OPTION_WIDTH, &opts->width, 80 );
-
-    if ( rc == 0 )
-        rc = get_str_option( args, OPTION_OUTF, &opts->outfile );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_GZIP, &opts->gzip, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_BZIP, &opts->bzip, false );
-
-    if ( rc == 0 )
-    {
-        uint32_t x;
-        rc = get_int_option( args, OPTION_FROM, &x, 0 );
-        if ( rc == 0 )
-            opts->from = x;
-    }
-
-    if ( rc == 0 )
-    {
-        uint32_t x;
-        rc = get_int_option( args, OPTION_LENGTH, &x, 0 );
-        if ( rc == 0 )
-            opts->length = x;
-    }
-
-    return rc;
-}
-
-/* =========================================================================================== */
-
-#if TOOLS_USE_SRAPATH != 0
-static bool is_this_a_filesystem_path( const char * path )
-{
-    bool res = false;
-    size_t i, n = string_size ( path );
-    for ( i = 0; i < n && !res; ++i )
-    {
-        char c = path[ i ];
-        res = ( c == '.' || c == '/' || c == '\\' );
-    }
-    return res;
-}
-#endif
-
-#if TOOLS_USE_SRAPATH != 0
-static char *translate_accession( SRAPath *my_sra_path,
-                           const char *accession,
-                           const size_t bufsize )
-{
-    rc_t rc;
-    char * res = calloc( 1, bufsize );
-    if ( res == NULL ) return NULL;
-
-    rc = SRAPathFind( my_sra_path, accession, res, bufsize );
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        free( res );
-        return NULL;
-    }
-    else if ( GetRCState( rc ) == rcInsufficient )
-    {
-        free( res );
-        return translate_accession( my_sra_path, accession, bufsize * 2 );
-    }
-    else if ( rc != 0 )
-    {
-        free( res );
-        return NULL;
-    }
-    return res;
-}
-#endif
-
-#if TOOLS_USE_SRAPATH != 0
-static rc_t resolve_accession( const KDirectory *my_dir, char ** path )
-{
-    SRAPath *my_sra_path;
-    rc_t rc = 0;
-
-    if ( strchr ( *path, '/' ) != NULL )
-        return 0;
-
-    rc = SRAPathMake( &my_sra_path, my_dir );
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound || GetRCTarget ( rc ) != rcDylib )
-        {
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "SRAPathMake() failed" );
-        }
-        else
-            rc = 0;
-    }
-    else
-    {
-        if ( !SRAPathTest( my_sra_path, *path ) )
-        {
-            char *buf = translate_accession( my_sra_path, *path, 64 );
-            if ( buf != NULL )
-            {
-                free( (char*)(*path) );
-                *path = buf;
-            }
-        }
-        SRAPathRelease( my_sra_path );
-    }
-    return rc;
-}
-#endif
-
-/* =========================================================================================== */
-
-
-typedef struct fasta_ctx
-{
-    KDirectory *dir;
-    const VDBManager *vdb_mgr;
-    const AlignMgr *almgr;
-} fasta_ctx;
-
-
-static rc_t dump_reference_loop( fasta_options *opts, const ReferenceObj* refobj )
-{
-    rc_t rc = 0;
-    uint8_t * buffer = malloc( opts->width + 2 );
-    if ( buffer == NULL )
-    {
-        rc = RC( rcExe, rcNoTarg, rcListing, rcMemory, rcExhausted );
-        LOGERR( klogInt, rc, "allocating reference-buffer failed!" );
-    }
-    else
-    {
-        INSDC_coord_zero pos = opts->from;
-        INSDC_coord_len w = opts->length;
-
-        while ( w > 0 && rc == 0 )
-        {
-            INSDC_coord_len written;
-            INSDC_coord_len to_read = ( w > opts->width ? opts->width : w );
-            rc = ReferenceObj_Read( refobj, pos, to_read, buffer, &written );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "ReferenceObj_Read() failed" );
-            else
-            {
-                OUTMSG(( "%.*s\n", written, buffer ));
-                w -= written;
-                pos += written;
-            }
-        }
-        free( buffer );
-    }
-    return rc;
-}
-
-
-static rc_t dump_reference( fasta_options *opts, const ReferenceObj* refobj )
-{
-    const char * name;
-    rc_t rc = ReferenceObj_Name( refobj, &name );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "ReferenceObj_Name() failed!" );
-    else
-    {
-        INSDC_coord_len seq_len;
-        rc = ReferenceObj_SeqLength( refobj, &seq_len );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "ReferenceObj_SeqLength() failed!" );
-        else
-        {
-            if ( opts->from == 0 )
-            {
-                if ( opts->length == 0 )
-                    opts->length = seq_len;
-            }
-            else
-            {
-                if ( opts->length == 0 )
-                    opts->length = ( seq_len - opts->from );
-            }
-            if ( opts->from >= seq_len )
-            {
-                rc = RC( rcExe, rcNoTarg, rcListing, rcParam, rcInvalid );
-                LOGERR( klogInt, rc, "reference-start-point beyond reference-end!" );
-            }
-            else
-            {
-                if ( opts->from + opts->length > seq_len )
-                    opts->length = ( seq_len - opts->from );
-                OUTMSG(( ">%s|from %u|%u bases\n", name, opts->from, opts->from + opts->length -1 ));
-                rc = dump_reference_loop( opts, refobj );
-            }
-        }
-    }
-    return 0;
-}
-
-
-static rc_t dump_all_reference( fasta_options *opts, const ReferenceList* reflist )
-{
-    uint32_t count;
-    rc_t rc = ReferenceList_Count( reflist, &count );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "ReferenceList_Count() failed!" );
-    else
-    {
-        uint32_t i;
-        for ( i = 0; i < count && rc == 0; ++i )
-        {
-            const ReferenceObj* refobj;
-            rc = ReferenceList_Get( reflist, &refobj, i );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "ReferenceList_Get() failed!" );
-            else
-                rc = dump_reference( opts, refobj );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t foreach_refname( Args * args, fasta_options *opts, fasta_ctx *ctx, const char * path )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, OPTION_REFNAME, &count );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsOptionCount( REFNAME ) failed" );
-    }
-    else
-    {
-        const ReferenceList* reflist;
-
-        rc = ReferenceList_MakePath( &reflist, ctx->vdb_mgr, path,
-                        ereferencelist_usePrimaryIds, 0, NULL, 0 );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "ReferenceList_MakePath() failed!" );
-        else
-        {
-            if ( count == 0 )
-            {
-                /* dump all references... */
-                rc = dump_all_reference( opts, reflist );
-            }
-            else
-            {
-                uint32_t i;
-                for ( i = 0; i < count && rc == 0; ++i )
-                {
-                    const char * refname;
-                    rc = ArgsOptionValue( args, OPTION_REFNAME, 0, &refname );
-                    if ( rc != 0 )
-                    {
-                        LOGERR( klogInt, rc, "ArgsOptionValue( REFNAME ) failed" );
-                    }
-                    else
-                    {
-                        const ReferenceObj* refobj;
-                        rc = ReferenceList_Find( reflist, &refobj, refname, string_size( refname ) );
-                        if ( rc != 0 )
-                            LOGERR( klogInt, rc, "ReferenceList_Find() failed" );
-                        else
-                            rc = dump_reference( opts, refobj );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t foreach_argument( Args * args, fasta_options *opts, fasta_ctx *ctx )
-{
-    uint32_t count;
-    rc_t rc = ArgsParamCount( args, &count );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "ArgsParamCount() failed" );
-    else
-    {
-        uint32_t idx;
-        if ( count < 1 )
-        {
-            rc = RC( rcExe, rcNoTarg, rcListing, rcParam, rcEmpty );
-            LOGERR( klogInt, rc, "no source-files given!" );
-        }
-        else
-        {
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *param = NULL;
-                rc = ArgsParamValue( args, idx, &param );
-                if ( rc != 0 )
-                    LOGERR( klogInt, rc, "ArgsParamvalue() failed" );
-                else
-                {
-                    char *path = string_dup_measure ( param, NULL );
-                    if ( path == NULL )
-                    {
-                        rc = RC( rcExe, rcNoTarg, rcListing, rcMemory, rcExhausted );
-                        LOGERR( klogInt, rc, "allocating path to source-file failed!" );
-                    }
-                    else
-                    {
-
-#if TOOLS_USE_SRAPATH != 0
-                        if ( !is_this_a_filesystem_path( path ) )
-                        {
-                            rc = resolve_accession( ctx->dir, &path );
-                        }
-#endif
-
-                        if ( rc == 0 )
-                        {
-                            rc = foreach_refname( args, opts, ctx, path );
-                        }
-                        free( path );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t fasta_main( Args * args, fasta_options *opts )
-{
-    rc_t rc;
-    fasta_ctx ctx;
-
-    memset( &ctx, 0, sizeof ctx );
-    rc = KDirectoryNativeDir( &ctx.dir );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-    else
-    {
-        rc = VDBManagerMakeRead ( &ctx.vdb_mgr, ctx.dir );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "VDBManagerMakeRead() failed" );
-        else
-        {
-            rc = AlignMgrMakeRead ( &ctx.almgr );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "AlignMgrMake() failed" );
-            else
-            {
-                rc = foreach_argument( args, opts, &ctx );
-                AlignMgrRelease ( ctx.almgr );
-            }
-            VDBManagerRelease( ctx.vdb_mgr );
-        }
-        KDirectoryRelease( ctx.dir );
-    }
-    return rc;
-}
-
-/* =========================================================================================== */
-
-
-rc_t fasta_dump( int argc, char* argv[] )
-{
-    rc_t rc = KOutHandlerSet( write_to_FILE, stdout );
-    if ( rc != 0 )
-        LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-    else
-    {
-        Args * args;
-
-        KLogHandlerSetStdErr();
-        rc = ArgsMakeAndHandle( &args, argc, argv, 1,
-            MyOptions, sizeof MyOptions / sizeof MyOptions [ 0 ] );
-        if ( rc == 0 )
-        {
-            fasta_options opts;
-            rc = get_fasta_options( args, &opts );
-            if ( rc == 0 )
-            {
-                if ( opts.outfile != NULL )
-                {
-                    rc = set_stdout_to( opts.gzip,
-                                        opts.bzip,
-                                        opts.outfile,
-                                        32 * 1024 );
-                }
-
-                if ( rc == 0 )
-                {
-                    /* ============================== */
-                    rc = fasta_main( args, &opts );
-                    /* ============================== */
-                }
-
-                if ( opts.outfile != NULL )
-                    release_stdout_redirection();
-            }
-            ArgsWhack( args );
-        }
-    }
-    return rc;
-}
-
-
-static const char * outf_usage[]     = { "output to stdout if omitted", NULL };
-static const char * width_usage[]    = { "default = 80 bases", NULL };
-static const char * gzip_usage[]     = { "for file and stdout", NULL };
-static const char * bzip_usage[]     = { "for file and stdout", NULL };
-static const char * refname_usage[]  = { "multiple ref's permitted", NULL };
-static const char * from_usage[]     = { "zero-based", NULL };
-static const char * length_usage[]   = { NULL };
-
-rc_t CC fasta_dump_usage ( const Args * args )
-{
-    rc_t rc;
-    const char * fullname = "fastq-dump";
-    const char * progname = fullname;
-
-    if ( args == NULL )
-        rc = RC( rcApp, rcArgv, rcAccessing, rcSelf, rcNull );
-    else
-        rc = ArgsProgram( args, &fullname, &progname );
-
-    KOutMsg( "\nUsage:\n"
-              "  %s <path> [options]\n"
-              "\n", progname );
-
-    KOutMsg( "Options:\n" );
-
-    HelpOptionLine( ALIAS_OUTF,    OPTION_OUTF,    "output-file", outf_usage );
-    HelpOptionLine( ALIAS_WIDTH,   OPTION_WIDTH,   "bases per line", width_usage );
-    HelpOptionLine( ALIAS_GZIP,    OPTION_GZIP,    "output gzipped", gzip_usage );
-    HelpOptionLine( ALIAS_BZIP,    OPTION_BZIP,    "output bzipped", bzip_usage );
-    HelpOptionLine( ALIAS_REFNAME, OPTION_REFNAME, "reference to dump", refname_usage );
-    HelpOptionLine( ALIAS_FROM,    OPTION_FROM,    "start-offset", from_usage );
-    HelpOptionLine( ALIAS_LENGTH,  OPTION_LENGTH,  "length of sequence", length_usage );
-
-    HelpOptionsStandard ();
-    HelpVersion ( fullname, KAppVersion() );
-    return rc;
-}
diff --git a/tools/sra-dump/fasta_dump.h b/tools/sra-dump/fasta_dump.h
deleted file mode 100644
index 9d3fe8a..0000000
--- a/tools/sra-dump/fasta_dump.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_fasta_dump_hdr_
-#define _h_fasta_dump_hdr_
-
-
-bool fasta_dump_requested( int argc, char* argv[] );
-
-rc_t fasta_dump( int argc, char* argv[] );
-
-rc_t CC fasta_dump_usage ( const Args * args );
-
-#endif
diff --git a/tools/sra-dump/fastq-dump.vers b/tools/sra-dump/fastq-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-dump/fastq-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-dump/fastq.c b/tools/sra-dump/fastq.c
deleted file mode 100644
index f32202e..0000000
--- a/tools/sra-dump/fastq.c
+++ /dev/null
@@ -1,3794 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/container.h>
-#include <klib/text.h>
-#include <kapp/main.h>
-
-#include <sra/sradb.h>
-#include <sra/types.h>
-#include <sra/fastq.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <strtol.h>
-
-#include "core.h"
-#include "fastq-dump.vers.h"
-#include "debug.h"
-
-#define DATABUFFERINITSIZE 10240
-
-typedef struct TAlignedRegion_struct
-{
-    const char* name;
-    uint32_t name_len;
-    /* 1-based, 0 - means not set */
-    uint64_t from;
-    uint64_t to;
-} TAlignedRegion;
-
-
-typedef struct TMatepairDistance_struct
-{
-    uint64_t from;
-    uint64_t to;
-} TMatepairDistance;
-
-
-struct FastqArgs_struct
-{
-    bool is_platform_cs_native;
-
-    int maxReads;
-    bool skipTechnical;
-
-    uint32_t minReadLen;
-    bool applyClip;
-    bool dumpOrigFmt;
-    bool dumpBase;
-    bool dumpCs;
-    bool readIds;
-    int offset;
-    bool qual_filter;
-    bool qual_filter1;
-    const char* b_deffmt;
-    SLList* b_defline;
-    const char* q_deffmt;
-    SLList* q_defline;
-    const char *desiredCsKey;
-    bool split_files;
-    bool split_3;
-    bool split_spot;
-    uint64_t fasta;
-    const char* file_extension;
-    bool aligned;
-    bool unaligned;
-    TAlignedRegion* alregion;
-    uint32_t alregion_qty;
-    bool mp_dist_unknown;
-    TMatepairDistance* mp_dist;
-    uint32_t mp_dist_qty;
-} FastqArgs;
-
-
-typedef enum DefNodeType_enum
-{
-    DefNode_Unknown = 0,
-    DefNode_Text = 1,
-    DefNode_Optional,
-    DefNode_Accession,
-    DefNode_SpotId,
-    DefNode_SpotName,
-    DefNode_SpotGroup,
-    DefNode_SpotLen,
-    DefNode_ReadId,
-    DefNode_ReadName,
-    DefNode_ReadLen,
-    DefNode_Last
-} DefNodeType;
-
-
-typedef struct DefNode_struct
-{
-    SLNode node;
-    DefNodeType type;
-    union
-    {
-        SLList* optional;
-        char* text;
-    } data;
-} DefNode;
-
-
-typedef struct DeflineData_struct
-{
-    rc_t rc;
-    bool optional;
-    union
-    {
-        spotid_t* id;
-        struct
-        {
-            const char* s;
-            size_t sz;
-        } str;
-        uint32_t* u32;
-    } values[ DefNode_Last ];
-    char* buf;
-    size_t buf_sz;
-    size_t* writ;
-} DeflineData;
-
-
-static bool CC Defline_Builder( SLNode *node, void *data )
-{
-    DefNode* n = ( DefNode* )node;
-    DeflineData* d = ( DeflineData* )data;
-    char s[ 256 ];
-    size_t w;
-    int x = 0;
-
-    s[ 0 ] = '\0';
-    switch ( n->type )
-    {
-        case DefNode_Optional :
-            d->optional = true;
-            w = *d->writ;
-            *d->writ = 0;
-            SLListDoUntil( n->data.optional, Defline_Builder, data );
-            x = ( *d->writ == 0 ) ? 0 : 1;
-            d->optional = false;
-            *d->writ = w;
-            if ( x > 0 )
-            {
-                SLListDoUntil( n->data.optional, Defline_Builder, data );
-            }
-            break;
-
-        case DefNode_Text :
-            if ( d->optional )
-            {
-                break;
-            }
-            d->values[n->type].str.s = n->data.text;
-            d->values[n->type].str.sz = strlen( n->data.text );
-
-        case DefNode_Accession :
-        case DefNode_SpotName :
-        case DefNode_SpotGroup :
-        case DefNode_ReadName :
-            if ( d->values[n->type].str.s != NULL )
-            {
-                x = d->values[ n->type ].str.sz;
-                if ( x < sizeof( s ) )
-                {
-                    strncpy( s, d->values[ n->type ].str.s, x );
-                    s[ x ] = '\0';
-                    *d->writ = *d->writ + x;
-                }
-                else
-                {
-                    d->rc = RC( rcExe, rcNamelist, rcExecuting, rcBuffer, rcInsufficient );
-                }
-            }
-            break;
-
-        case DefNode_SpotId :
-            if ( d->values[ n->type ].id != NULL &&
-                ( !d->optional || *d->values[ n->type ].id > 0 ) )
-            {
-                x = snprintf( s, sizeof( s ), "%u", *d->values[ n->type ].id );
-                if ( x < 0 || x >= sizeof( s ) )
-                {
-                    d->rc = RC( rcExe, rcNamelist, rcExecuting, rcBuffer, rcInsufficient );
-                }
-                else
-                {
-                    *d->writ = *d->writ + x;
-                }
-            }
-            break;
-
-        case DefNode_ReadId :
-        case DefNode_SpotLen :
-        case DefNode_ReadLen :
-            if ( d->values[ n->type] .u32 != NULL &&
-                 ( !d->optional || *d->values[ n->type ].u32 > 0 ) )
-            {
-                x = snprintf( s, sizeof( s ), "%u", *d->values[ n->type ].u32 );
-                if ( x < 0 || x >= sizeof( s ) )
-                {
-                    d->rc = RC( rcExe, rcNamelist, rcExecuting, rcBuffer, rcInsufficient );
-                }
-                else
-                {
-                    *d->writ = *d->writ + x;
-                }
-            }
-            break;
-
-        default:
-            d->rc = RC( rcExe, rcNamelist, rcExecuting, rcId, rcInvalid );
-    } /* switch */
-
-    if ( d->rc == 0 && !d->optional && n->type != DefNode_Optional )
-    {
-        if ( *d->writ < d->buf_sz )
-        {
-            strcat( d->buf, s );
-        }
-        else
-        {
-            d->rc = RC( rcExe, rcNamelist, rcExecuting, rcBuffer, rcInsufficient );
-        }
-    }
-    return d->rc != 0;
-}
-
-
-static rc_t Defline_Bind( DeflineData* data, const char* accession,
-            spotid_t* spotId, const char* spot_name, size_t spotname_sz,
-            const char* spot_group, size_t sgrp_sz, uint32_t* spot_len,
-            uint32_t* readId, const char* read_name, INSDC_coord_len rlabel_sz,
-            INSDC_coord_len* read_len )
-{
-    if ( data == NULL )
-    {
-        return RC( rcExe, rcNamelist, rcExecuting, rcMemory, rcInsufficient );
-    }
-    data->values[ DefNode_Unknown ].str.s = NULL;
-    data->values[ DefNode_Text ].str.s = NULL;
-    data->values[ DefNode_Optional ].str.s = NULL;
-    data->values[ DefNode_Accession ].str.s = accession;
-    data->values[ DefNode_Accession ].str.sz = strlen( accession );
-    data->values[ DefNode_SpotId ].id = spotId;
-    data->values[ DefNode_SpotName ].str.s = spot_name;
-    data->values[ DefNode_SpotName ].str.sz = spotname_sz;
-    data->values[ DefNode_SpotGroup ].str.s = spot_group;
-    data->values[ DefNode_SpotGroup ].str.sz = sgrp_sz;
-    data->values[ DefNode_SpotLen ].u32 = spot_len;
-    data->values[ DefNode_ReadId ].u32 = readId;
-    data->values[ DefNode_ReadName ].str.s = read_name;
-    data->values[ DefNode_ReadName ].str.sz = rlabel_sz;
-    data->values[ DefNode_ReadLen ].u32 = read_len;
-    return 0;
-}
-
-
-static rc_t Defline_Build( const SLList* def, DeflineData* data, char* buf,
-                           size_t buf_sz, size_t* writ )
-{
-    if ( data == NULL )
-    {
-        return RC( rcExe, rcNamelist, rcExecuting, rcMemory, rcInsufficient );
-    }
-
-    data->rc = 0;
-    data->optional = false;
-    data->buf = buf;
-    data->buf_sz = buf_sz;
-    data->writ = writ;
-
-    data->buf[ 0 ] = '\0';
-    *data->writ = 0;
-
-    SLListDoUntil( def, Defline_Builder, data );
-    return data->rc;
-}
-
-
-static rc_t DeflineNode_Add( SLList* list, DefNode** node,
-                            DefNodeType type, const char* text, size_t text_sz )
-{
-    rc_t rc = 0;
-
-    *node = calloc( 1, sizeof( **node ) );
-    if ( *node == NULL )
-    {
-        rc = RC( rcExe, rcNamelist, rcConstructing, rcMemory, rcExhausted );
-    }
-    else if ( type == DefNode_Text && ( text == NULL || text_sz == 0 ) )
-    {
-        rc = RC( rcExe, rcNamelist, rcConstructing, rcParam, rcInvalid );
-    }
-    else
-    {
-        ( *node )->type = type;
-        if ( type == DefNode_Text )
-        {
-            ( *node )->data.text = string_dup( text, text_sz );
-            if ( ( *node )->data.text == NULL )
-            {
-                rc = RC( rcExe, rcNamelist, rcConstructing, rcMemory, rcExhausted );
-                free( *node );
-            }
-        }
-        else if ( type == DefNode_Optional )
-        {
-            ( *node )->data.optional = malloc( sizeof( SLList ) );
-            if ( ( *node )->data.optional == NULL )
-            {
-                rc = RC( rcExe, rcNamelist, rcConstructing, rcMemory, rcExhausted );
-                free( *node );
-            }
-            else
-            {
-                SLListInit( ( *node )->data.optional );
-            }
-        }
-        if ( rc == 0 )
-        {
-            SLListPushTail( list, &( *node )->node );
-        }
-    }
-    return rc;
-}
-
-
-static void Defline_Release( SLList* list );
-
-
-static void CC DeflineNode_Whack( SLNode* node, void* data )
-{
-    if ( node != NULL )
-    {
-        DefNode* n = (DefNode*)node;
-        if ( n->type == DefNode_Text )
-        {
-            free( n->data.text );
-        }
-        else if ( n->type == DefNode_Optional )
-        {
-            Defline_Release( n->data.optional );
-        }
-        free( node );
-    }
-}
-
-
-static void Defline_Release( SLList* list )
-{
-    if ( list != NULL )
-    {
-        SLListForEach( list, DeflineNode_Whack, NULL );
-        free( list );
-    }
-}
-
-
-#if _DEBUGGING
-static void CC Defline_Dump( SLNode* node, void* data )
-{
-    DefNode* n = ( DefNode* )node;
-    const char* s = NULL, *t;
-    if ( n->type == DefNode_Text )
-    {
-        s = n->data.text;
-    }
-    switch ( n->type )
-    {
-        case DefNode_Unknown :      t = "Unknown";   break;
-        case DefNode_Text :         t = "Text";      break;
-        case DefNode_Optional :     t = "Optional";  break;
-        case DefNode_Accession :    t = "Accession"; break;
-        case DefNode_SpotId :       t = "SpotId";    break;
-        case DefNode_SpotName :     t = "SpotName";  break;
-        case DefNode_SpotGroup :    t = "SpotGroup"; break;
-        case DefNode_SpotLen :      t = "SpotLen";   break;
-        case DefNode_ReadId :       t = "ReadId";    break;
-        case DefNode_ReadName :     t = "ReadName";  break;
-        case DefNode_ReadLen :      t = "ReadLen";   break;
-        default :  t = "ERROR";
-    }
-
-    SRA_DUMP_DBG( 3, ( "%s type %s", data, t ) );
-    if ( s )
-    {
-        SRA_DUMP_DBG( 3, ( ": '%s'", s ) );
-    }
-    SRA_DUMP_DBG( 3, ( "\n" ) );
-    if ( n->type == DefNode_Optional )
-    {
-        SLListForEach( n->data.optional, Defline_Dump, "+-->" );
-    }
-}
-#endif
-
-
-static rc_t Defline_Parse( SLList** def, const char* line )
-{
-    rc_t rc = 0;
-    size_t i, sz, text = 0, opt_vars = 0;
-    DefNode* node;
-    SLList* list = NULL;
-
-    if ( def == NULL || line == NULL )
-    {
-        return RC( rcExe, rcNamelist, rcConstructing, rcParam, rcInvalid );
-    }
-    *def = malloc( sizeof( SLList ) );
-    if ( *def  == NULL )
-    {
-        return RC( rcExe, rcNamelist, rcConstructing, rcMemory, rcExhausted );
-    }
-    sz = strlen( line );
-    list = *def;
-    SLListInit( list );
-
-    for ( i = 0; rc == 0 && i < sz; i++ )
-    {
-        if ( line[ i ] == '[' )
-        {
-            if ( ( i + 1 ) < sz && line[ i + 1 ] == '[' )
-            {
-                i++;
-            }
-            else
-            {
-                if ( list != *def )
-                {
-                    rc = RC( rcExe, rcNamelist, rcConstructing, rcFormat, rcIncorrect );
-                }
-                else if ( i > text )
-                {
-                    rc = DeflineNode_Add( list, &node, DefNode_Text, &line[text], i - text );
-                }
-                if ( rc == 0 )
-                {
-                    rc = DeflineNode_Add( list, &node, DefNode_Optional, NULL, 0 );
-                    if ( rc == 0 )
-                    {
-                        opt_vars = 0;
-                        list = node->data.optional;
-                        text = i + 1;
-                    }
-                }
-            }
-        }
-        else if ( line[ i ] == ']' )
-        {
-            if ( ( i + 1 ) < sz && line[ i + 1 ] == ']' )
-            {
-                i++;
-            }
-            else
-            {
-                if ( list == *def )
-                {
-                    rc = RC( rcExe, rcNamelist, rcConstructing, rcFormat, rcIncorrect );
-                }
-                else
-                {
-                    if ( opt_vars < 1 )
-                    {
-                        rc = RC( rcExe, rcNamelist, rcConstructing, rcConstraint, rcEmpty );
-                    }
-                    else if ( i > text )
-                    {
-                        rc = DeflineNode_Add( list, &node, DefNode_Text, &line[text], i - text );
-                    }
-                    list = *def;
-                    text = i + 1;
-                }
-            }
-        }
-        else if ( line[ i ] == '$' )
-        {
-            if ( ( i + 1 ) < sz && line[ i + 1 ] == '$' )
-            {
-                i++;
-            }
-            else
-            {
-                DefNodeType type = DefNode_Unknown;
-                switch ( line[ ++i] )
-                {
-                    case 'a' :
-                        switch( line[ ++i ] )
-                        {
-                            case 'c': type = DefNode_Accession; break;
-                        }
-                        break;
-
-                    case 's' :
-                        switch ( line[ ++i ] )
-                        {
-                            case 'i': type = DefNode_SpotId; break;
-                            case 'n': type = DefNode_SpotName; break;
-                            case 'g': type = DefNode_SpotGroup; break;
-                            case 'l': type = DefNode_SpotLen; break;
-                        }
-                        break;
-                    case 'r' :
-                        switch( line[ ++i ] )
-                        {
-                            case 'i': type = DefNode_ReadId; break;
-                            case 'n': type = DefNode_ReadName; break;
-                            case 'l': type = DefNode_ReadLen; break;
-                        }
-                        break;
-                }
-                if ( type == DefNode_Unknown )
-                {
-                    rc = RC( rcExe, rcNamelist, rcConstructing, rcName, rcUnrecognized );
-                }
-                else
-                {
-                    if ( ( i - 2 ) > text )
-                    {
-                        rc = DeflineNode_Add( list, &node, DefNode_Text, &line[ text ], i - text - 2 );
-                    }
-                    if ( rc == 0 )
-                    {
-                        rc = DeflineNode_Add( list, &node, type, NULL, 0 );
-                        if ( rc == 0 )
-                        {
-                            opt_vars++;
-                            text = i + 1;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        if ( list != *def )
-        {
-            rc = RC( rcExe, rcNamelist, rcConstructing, rcFormat, rcInvalid );
-        }
-        else if ( i > text )
-        {
-            rc = DeflineNode_Add( list, &node, DefNode_Text, &line[ text ], i - text );
-        }
-    }
-    if ( rc != 0 )
-    {
-        i = i < sz ? i : sz;
-        PLOGERR( klogErr, ( klogErr, rc, "$(l1) -->$(c)<-- $(l2)",
-                 "l1=%.*s,c=%c,l2=%.*s", i - 1, line, line[ i - 1 ], sz - i, &line[ i ] ) );
-    }
-#if _DEBUGGING
-    SRA_DUMP_DBG( 3, ( "| defline\n" ) );
-    SLListForEach( *def, Defline_Dump, "+->" );
-#endif
-    return rc;
-}
-
-/* ### ALIGNMENT_COUNT based filtering ##################################################### */
-
-typedef struct AlignedFilter_struct
-{
-    const SRAColumn* col;
-    uint64_t rejected_reads;
-    bool aligned;
-    bool unaligned;
-} AlignedFilter;
-
-
-static rc_t AlignedFilter_GetKey( const SRASplitter* cself, const char** key,
-                                  spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    AlignedFilter* self = ( AlignedFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        *key = "";
-        if ( self->col != NULL )
-        {
-            const uint8_t* ac = NULL;
-            bitsz_t o = 0, sz = 0;
-            rc = SRAColumnRead( self->col, spot, (const void **)&ac, &o, &sz );
-            if ( rc == 0 && sz > 0 )
-            {
-                sz = sz / 8 / sizeof( *ac );
-                for( o = 0; o < sz; o++ )
-                {
-                    if ( ( self->aligned   && !self->unaligned && ac[ o ] == 0 ) ||
-                         ( self->unaligned && !self->aligned   && ac[ o ] != 0 ) )
-                    {
-                        unset_readmask( readmask, o );
-                        self->rejected_reads ++;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t AlignedFilter_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    AlignedFilter* self = ( AlignedFilter* )cself;
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        if ( self->rejected_reads > 0 && !g_legacy_report )
-            rc = KOutMsg( "Rejected %lu READS because of aligned/unaligned filter\n", self->rejected_reads );
-    }
-    return rc;
-}
-
-typedef struct AlignedFilterFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col;
-    bool aligned;
-    bool unaligned;
-} AlignedFilterFactory;
-
-
-static rc_t AlignedFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    AlignedFilterFactory* self = ( AlignedFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRATableOpenColumnRead( self->table, &self->col, "ALIGNMENT_COUNT", vdb_uint8_t );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) == rcNotFound )
-            {
-                LOGMSG( klogWarn, "Column ALIGNMENT_COUNT was not found, param ignored" );
-                rc = 0;
-            }
-            else if ( GetRCState( rc ) == rcExists )
-            {
-                rc = 0;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t AlignedFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    AlignedFilterFactory* self = ( AlignedFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( AlignedFilter ),
-                               AlignedFilter_GetKey, NULL, NULL, AlignedFilter_Release );
-        if ( rc == 0 )
-        {
-            AlignedFilter * filter = ( AlignedFilter * )( * splitter );
-            filter->col = self->col;
-            filter->aligned = self->aligned;
-            filter->unaligned = self->unaligned;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void AlignedFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        AlignedFilterFactory* self = ( AlignedFilterFactory* )cself;
-        SRAColumnRelease( self->col );
-    }
-}
-
-
-static rc_t AlignedFilterFactory_Make( const SRASplitterFactory** cself,
-                    const SRATable* table, bool aligned, bool unaligned )
-{
-    rc_t rc = 0;
-    AlignedFilterFactory* obj = NULL;
-
-    if ( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                 AlignedFilterFactory_Init,
-                                 AlignedFilterFactory_NewObj,
-                                 AlignedFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( AlignedFilterFactory* )*cself;
-            obj->table = table;
-            obj->aligned = aligned;
-            obj->unaligned = unaligned;
-        }
-    }
-    return rc;
-}
-
-
-/* ### alignment region filtering ##################################################### */
-
-typedef struct AlignRegionFilter_struct
-{
-    const SRAColumn* col_pos;
-    const SRAColumn* col_name;
-    const SRAColumn* col_seqid;
-    const TAlignedRegion* alregion;
-    uint64_t rejected_spots;
-    uint32_t alregion_qty;
-} AlignRegionFilter;
-
-
-static rc_t AlignRegionFilter_GetKey( const SRASplitter* cself, const char** key,
-                                      spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    AlignRegionFilter* self = ( AlignRegionFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        *key = "";
-        reset_readmask( readmask );
-        if ( self->col_name || self->col_seqid )
-        {
-            bool match = false;
-            uint32_t i;
-            const char* nm, *si;
-            bitsz_t o, nm_len = 0, si_len = 0;
-
-            if ( self->col_name )
-            {
-                rc = SRAColumnRead( self->col_name, spot, (const void **)&nm, &o, &nm_len );
-                if ( rc == 0 && nm_len > 0 )
-                    nm_len /= 8;
-            }
-            if ( rc == 0 && self->col_seqid )
-            {
-                rc = SRAColumnRead( self->col_seqid, spot, (const void **)&si, &o, &si_len );
-                if ( rc == 0 && si_len > 0 )
-                    si_len /= 8;
-            }
-            for ( i = 0; rc == 0 && i < self->alregion_qty; i++ )
-            {
-                if ( ( self->alregion[i].name_len == nm_len && 
-                       strncasecmp( self->alregion[ i ].name, nm, nm_len ) == 0 ) ||
-                     ( self->alregion[i].name_len == si_len && 
-                       strncasecmp(self->alregion[i].name, si, si_len) == 0 ) )
-                {
-                    if ( self->col_pos )
-                    {
-                        INSDC_coord_zero* pos;
-                        bitsz_t nreads, j;
-                        rc = SRAColumnRead( self->col_pos, spot, ( const void ** )&pos, &o, &nreads );
-                        if ( rc == 0 && nreads > 0 )
-                        {
-                            nreads = nreads / sizeof(*pos) / 8;
-                            for ( i = 0; !match && i < self->alregion_qty; i++ )
-                            {
-                                for ( j = 0; j < nreads; j++ )
-                                {
-                                    if ( self->alregion[i].from <= pos[j] &&
-                                         pos[j] <= self->alregion[i].to )
-                                    {
-                                        match = true;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    else
-                    {
-                        match = true;
-                    }
-                    break;
-                }
-            }
-            if ( !match )
-            {
-                clear_readmask( readmask );
-                self->rejected_spots ++;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t AlignRegionFilter_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    AlignRegionFilter* self = ( AlignRegionFilter* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        if ( self->rejected_spots > 0 && !g_legacy_report )
-            rc = KOutMsg( "Rejected %lu SPOTS because of AlignRegionFilter\n", self->rejected_spots );
-    }
-    return rc;
-}
-
-
-typedef struct AlignRegionFilterFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col_pos;
-    const SRAColumn* col_name;
-    const SRAColumn* col_seqid;
-    TAlignedRegion* alregion;
-    uint32_t alregion_qty;
-} AlignRegionFilterFactory;
-
-
-static rc_t AlignRegionFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    AlignRegionFilterFactory* self = ( AlignRegionFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-
-#define COLNF(v,n,t) (!(rc == 0 && ((rc = SRATableOpenColumnRead(self->table, &v, n, t)) == 0 || \
-                       GetRCState(rc) == rcExists)) && GetRCState(rc) == rcNotFound)
-
-        if ( COLNF( self->col_name, "REF_NAME", vdb_ascii_t ) )
-        {
-            SRAColumnRelease( self->col_name );
-            self->col_name = NULL;
-            rc = 0;
-        }
-
-        if ( COLNF( self->col_seqid, "REF_SEQ_ID", vdb_ascii_t ) )
-        {
-            SRAColumnRelease( self->col_seqid );
-            self->col_seqid = NULL;
-            rc = 0;
-        }
-
-        if ( self->col_name == NULL && self->col_seqid == NULL )
-        {
-            LOGMSG( klogWarn, "None of columns REF_NAME or REF_SEQ_ID was found, no region filtering" );
-        }
-        else
-        {
-            bool range_used = false;
-            uint32_t i;
-            /* see if there are any actual ranges set and open col only if yes */
-            for ( i = 0; i < self->alregion_qty; i++ )
-            {
-                if ( self->alregion[ i ].from != 0 || self->alregion[ i ].to != 0 )
-                {
-                    range_used = true;
-                    break;
-                }
-            }
-            if ( range_used )
-            {
-                if ( COLNF( self->col_pos, "REF_POS", "INSDC:coord:zero" ) )
-                {
-                    LOGMSG( klogWarn, "Column REF_POS is not found, no region position filtering" );
-                    rc = 0;
-                }
-                else
-                {
-                    for ( i = 0; i < self->alregion_qty; i++ )
-                    {
-                        if ( self->alregion[ i ].from > 0 )
-                        {
-                            self->alregion[ i ].from--;
-                        }
-                        if ( self->alregion[ i ].to > 0 )
-                        {
-                            self->alregion[ i ].to--;
-                        }
-                        else if ( self->alregion[ i ].to == 0 )
-                        {
-                            self->alregion[ i ].to = ~0;
-                        }
-                    }
-                }
-            }
-        }
-    }
-#undef COLNF
-    return rc;
-}
-
-
-static rc_t AlignRegionFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    AlignRegionFilterFactory* self = ( AlignRegionFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( AlignRegionFilter ),
-                               AlignRegionFilter_GetKey, NULL, NULL, AlignRegionFilter_Release );
-        if ( rc == 0 )
-        {
-            AlignRegionFilter * filter = ( AlignRegionFilter * )( * splitter );
-            filter->col_pos = self->col_pos;
-            filter->col_name = self->col_name;
-            filter->col_seqid = self->col_seqid;
-            filter->alregion = self->alregion;
-            filter->alregion_qty = self->alregion_qty;
-            filter->rejected_spots = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void AlignRegionFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        AlignRegionFilterFactory* self = ( AlignRegionFilterFactory* )cself;
-        SRAColumnRelease( self->col_pos );
-        SRAColumnRelease( self->col_name );
-        SRAColumnRelease( self->col_seqid );
-    }
-}
-
-
-static rc_t AlignRegionFilterFactory_Make( const SRASplitterFactory** cself,
-            const SRATable* table, TAlignedRegion* alregion, uint32_t alregion_qty )
-{
-    rc_t rc = 0;
-    AlignRegionFilterFactory* obj = NULL;
-
-    if ( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      AlignRegionFilterFactory_Init,
-                                      AlignRegionFilterFactory_NewObj,
-                                      AlignRegionFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( AlignRegionFilterFactory* )*cself;
-            obj->table = table;
-            obj->alregion = alregion;
-            obj->alregion_qty = alregion_qty;
-        }
-    }
-    return rc;
-}
-
-/* ### alignment meta-pair distance filtering ##################################################### */
-
-typedef struct AlignPairDistanceFilter_struct
-{
-    const SRAColumn* col_tlen;
-    const TMatepairDistance* mp_dist;
-    uint64_t rejected_reads;
-    bool mp_dist_unknown;
-    uint32_t mp_dist_qty;
-} AlignPairDistanceFilter;
-
-
-static rc_t AlignPairDistanceFilter_GetKey( const SRASplitter* cself,
-                const char** key, spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    AlignPairDistanceFilter* self = ( AlignPairDistanceFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        *key = "";
-        reset_readmask( readmask );
-        if ( self->col_tlen )
-        {
-            uint32_t i, j;
-            bitsz_t o, nreads;
-            int32_t* tlen;
-            rc = SRAColumnRead( self->col_tlen, spot, (const void **)&tlen, &o, &nreads );
-            if ( rc == 0 )
-            {
-                nreads = nreads / sizeof(*tlen) / 8;
-                for ( i = 0; i < self->mp_dist_qty; i++ )
-                {
-                    for ( j = 0; j < nreads; j++ )
-                    {
-                        if ( ( tlen[ j ] == 0 && !self->mp_dist_unknown) ||
-                             ( tlen[ j ] != 0 && 
-                               ( tlen[ j ] < self->mp_dist[ i ].from || self->mp_dist[ i ].to < tlen[ j ] ) ) )
-                        {
-                            unset_readmask( readmask, j );
-                            self->rejected_reads ++;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t AlignPairDistanceFilter_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    AlignPairDistanceFilter* self = ( AlignPairDistanceFilter* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcNode, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        if ( self->rejected_reads > 0 && !g_legacy_report )
-            rc = KOutMsg( "Rejected %lu READS because of AlignPairDistanceFilter\n", self->rejected_reads );
-    }
-    return rc;
-}
-
-typedef struct AlignPairDistanceFilterFactory_struct
-{
-    const SRATable* table;
-    const SRAColumn* col_tlen;
-    bool mp_dist_unknown;
-    TMatepairDistance* mp_dist;
-    uint32_t mp_dist_qty;
-} AlignPairDistanceFilterFactory;
-
-
-static rc_t AlignPairDistanceFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    AlignPairDistanceFilterFactory* self = ( AlignPairDistanceFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRATableOpenColumnRead( self->table, &self->col_tlen, "TEMPLATE_LEN", "I32" );
-        if( !( rc == 0 || GetRCState( rc ) == rcExists ) && GetRCState( rc ) == rcNotFound )
-        {
-            LOGMSG( klogWarn, "Column TLEN was not found, no distance filtering" );
-            self->col_tlen = NULL;
-            rc = 0;
-        }
-        if ( rc == 0 )
-        {
-            uint32_t i;
-            for ( i = 0; i < self->mp_dist_qty; i++ )
-            {
-                if ( self->mp_dist[ i ].to == 0 )
-                {
-                    self->mp_dist[ i ].to = ~0;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t AlignPairDistanceFilterFactory_NewObj( const SRASplitterFactory* cself,
-                                                   const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    AlignPairDistanceFilterFactory* self = ( AlignPairDistanceFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( AlignPairDistanceFilter ),
-                               AlignPairDistanceFilter_GetKey, NULL, NULL, AlignPairDistanceFilter_Release );
-        if ( rc == 0 )
-        {
-            AlignPairDistanceFilter * filter = ( AlignPairDistanceFilter * )( * splitter );
-            filter->col_tlen = self->col_tlen;
-            filter->mp_dist_unknown = self->mp_dist_unknown;
-            filter->mp_dist = self->mp_dist;
-            filter->mp_dist_qty = self->mp_dist_qty;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void AlignPairDistanceFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        AlignPairDistanceFilterFactory* self = ( AlignPairDistanceFilterFactory* )cself;
-        SRAColumnRelease( self->col_tlen );
-    }
-}
-
-
-static rc_t AlignPairDistanceFilterFactory_Make( const SRASplitterFactory** cself,
-        const SRATable* table, bool mp_dist_unknown, TMatepairDistance* mp_dist, uint32_t mp_dist_qty )
-{
-    rc_t rc = 0;
-    AlignPairDistanceFilterFactory* obj = NULL;
-
-    if ( cself == NULL || table == NULL )
-    {
-        rc = RC( rcSRA, rcType, rcAllocating, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      AlignPairDistanceFilterFactory_Init,
-                                      AlignPairDistanceFilterFactory_NewObj,
-                                      AlignPairDistanceFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( AlignPairDistanceFilterFactory* ) *cself;
-            obj->table = table;
-            obj->mp_dist_unknown = mp_dist_unknown;
-            obj->mp_dist = mp_dist;
-            obj->mp_dist_qty = mp_dist_qty;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ read type (bio/tech) filter ============================ */
-
-typedef struct FastqBioFilter_struct
-{
-    const FastqReader* reader;
-    uint64_t rejected_reads;
-} FastqBioFilter;
-
-
-/* filter out non-bio reads */
-static rc_t FastqBioFilter_GetKey( const SRASplitter* cself, const char** key,
-                                   spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqBioFilter* self = ( FastqBioFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0;
-
-        *key = NULL;
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-            if ( rc == 0 )
-            {
-                uint32_t readId;
-                SRA_DUMP_DBG( 3, ( "%s %u row reads: ", __func__, spot ) );
-                for (readId = 0; rc == 0 && readId < num_reads; readId++ )
-                {
-                    if ( isset_readmask( readmask, readId ) )
-                    {
-                        SRAReadTypes read_type;
-                        rc = FastqReader_SpotReadInfo( self->reader, readId + 1, &read_type,
-                                                       NULL, NULL, NULL, NULL);
-                        if ( rc == 0 )
-                        {
-                            if ( !( read_type & SRA_READ_TYPE_BIOLOGICAL ) )
-                            {
-                                unset_readmask( readmask, readId );
-                                self->rejected_reads ++;
-                            }
-                            else
-                            {
-                                SRA_DUMP_DBG( 3, ( " %u", readId ) );
-                            }
-                        }
-                    }
-                }
-                *key = "";
-                SRA_DUMP_DBG( 3, ( " key '%s'\n", *key ) );
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqBioFilter_Release( const SRASplitter * cself )
-{
-    rc_t rc = 0;
-    FastqBioFilter * self = ( FastqBioFilter * )cself;
-
-    if ( self == NULL )
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    else
-    {
-        if ( self->rejected_reads > 0 && !g_legacy_report )
-            rc = KOutMsg( "Rejected %lu READS because of filtering out non-biological READS\n", self->rejected_reads );
-    }
-    return rc;
-}
-
-
-typedef struct FastqBioFilterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-} FastqBioFilterFactory;
-
-
-static rc_t FastqBioFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqBioFilterFactory* self = ( FastqBioFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                              /* preserve orig spot format to save on conversions */
-                              FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                              false, !FastqArgs.applyClip, 0,
-                              FastqArgs.offset, '\0', 0, 0) ;
-    }
-    return rc;
-}
-
-
-static rc_t FastqBioFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqBioFilterFactory* self = ( FastqBioFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( FastqBioFilter ),
-                               FastqBioFilter_GetKey, NULL, NULL, FastqBioFilter_Release );
-        if ( rc == 0 )
-        {
-            FastqBioFilter * filter = ( FastqBioFilter * )( * splitter );
-            filter->reader = self->reader;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void FastqBioFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqBioFilterFactory* self = ( FastqBioFilterFactory* )cself;
-        FastqReaderWhack( self->reader );
-    }
-}
-
-
-static rc_t FastqBioFilterFactory_Make( const SRASplitterFactory** cself,
-                        const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqBioFilterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      FastqBioFilterFactory_Init,
-                                      FastqBioFilterFactory_NewObj,
-                                      FastqBioFilterFactory_Release );
-
-        if ( rc == 0 )
-        {
-            obj = ( FastqBioFilterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ number of reads filter ============================ */
-
-typedef struct FastqRNumberFilter_struct
-{
-    const FastqReader* reader;
-    uint64_t rejected_reads;
-} FastqRNumberFilter;
-
-
-static rc_t FastqRNumberFilter_GetKey( const SRASplitter* cself, const char** key,
-                                       spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqRNumberFilter* self = ( FastqRNumberFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0;
-
-        *key = NULL;
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-            if ( rc == 0 )
-            {
-                int readId, q;
-
-                SRA_DUMP_DBG( 3, ( "%s %u row reads: ", __func__, spot ) );
-                for ( readId = 0, q = 0; readId < num_reads; readId++ )
-                {
-                    if ( isset_readmask( readmask, readId ) )
-                    {
-                        if ( ++q > FastqArgs.maxReads )
-                        {
-                            unset_readmask( readmask, 1 << readId );
-                        }
-                        else
-                        {
-                            SRA_DUMP_DBG( 3, ( " %u", readId ) );
-                        }
-                    }
-                }
-                *key = "";
-                SRA_DUMP_DBG( 3, ( " key '%s'\n", *key ) );
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqRNumberFilter_Release( const SRASplitter* cself )
-{
-    rc_t rc = 0;
-    FastqRNumberFilter * self = ( FastqRNumberFilter * )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        if ( self->rejected_reads > 0 && !g_legacy_report )
-            rc = KOutMsg( "Rejected %lu READS because of max. number of READS = %u\n", self->rejected_reads, FastqArgs.maxReads );
-    }
-    return rc;
-}
-
-typedef struct FastqRNumberFilterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-} FastqRNumberFilterFactory;
-
-
-static rc_t FastqRNumberFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqRNumberFilterFactory* self = ( FastqRNumberFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                              /* preserve orig spot format to save on conversions */
-                              FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                              false, !FastqArgs.applyClip, 0,
-                              FastqArgs.offset, '\0', 0, 0 );
-    }
-    return rc;
-}
-
-
-static rc_t FastqRNumberFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqRNumberFilterFactory* self = ( FastqRNumberFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( FastqRNumberFilter ),
-                               FastqRNumberFilter_GetKey, NULL, NULL, FastqRNumberFilter_Release );
-        if ( rc == 0 )
-        {
-            FastqRNumberFilter * filter = ( FastqRNumberFilter * )( * splitter );
-            filter->reader = self->reader;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void FastqRNumberFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqRNumberFilterFactory* self = ( FastqRNumberFilterFactory* )cself;
-        FastqReaderWhack( self->reader );
-    }
-}
-
-
-static rc_t FastqRNumberFilterFactory_Make( const SRASplitterFactory** cself,
-                                const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqRNumberFilterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      FastqRNumberFilterFactory_Init,
-                                      FastqRNumberFilterFactory_NewObj,
-                                      FastqRNumberFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( FastqRNumberFilterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-/* ============== FASTQ quality filter ============================ */
-
-typedef struct FastqQFilter_struct
-{
-    const FastqReader * reader;
-    KDataBuffer * buffer_for_read_column;
-    KDataBuffer * buffer_for_quality;
-    uint64_t rejected_spots;
-    uint64_t rejected_reads;
-} FastqQFilter;
-
-
-#define MIN_QUAL_FOR_RULE_3 ( 33 + 2 )
-
-static bool QFilter_Test_new( const char * read, const char * quality, uint32_t readlen, uint32_t minlen, char N_char )
-{
-    uint32_t idx, cnt, cnt1, start;
-    char b0;
-
-    /* 1st criteria : READ has to be longer than the minlen */
-    if ( readlen < minlen ) return false;
-
-    /* 2nd criteria : READ does not contain any N's in the first minlen bases */
-    for ( idx = 0; idx < minlen; ++idx )
-    {
-        if ( read[ idx ] == N_char ) return false;
-    }
-
-    start = ( N_char == '.' ) ? 1 : 0;
-    /* 3rd criteria : QUALITY values are all 2 or higher in the first minlen values */
-    for ( idx = start; idx < minlen; ++idx )
-    {
-        if ( quality[ idx ] < MIN_QUAL_FOR_RULE_3 ) return false;
-    }
-
-    /* 4th criteria : READ contains more than one type of base in the first minlen bases */
-    b0 = read[ 0 ];
-    for ( idx = 1, cnt = 1; idx < minlen; ++idx )
-    {
-        if ( read[ idx ] == b0 ) cnt++;
-    }
-    if ( cnt == minlen ) return false;
-
-    /* 5th criteria : READ does not contain more than 50% N's in its whole length */
-    cnt = ( readlen / 2 );
-    for ( idx = 0, cnt1 = 0; idx < readlen; ++idx )
-    {
-        if ( read[ idx ] == N_char ) cnt1++;
-    }
-    if ( cnt1 > cnt ) return false;
-
-    /* 6th criteria : READ does not contain values other than ACGTN in its whole length */
-    if ( N_char != '.' )
-    {
-        for ( idx = 0; idx < readlen; ++idx )
-        {
-            if ( ! ( ( read[ idx ] == 'A' ) || ( read[ idx ] == 'C' ) || ( read[ idx ] == 'G' ) ||
-                    ( read[ idx ] == 'T' ) || ( read[ idx ] == 'N' ) ) )
-                return false;
-        }
-    }
-
-    return true;
-}
-
-
-static bool QFilter_Test_old( const char * read, uint32_t readlen, bool cs_native )
-{
-    static char const* const baseStr = "NNNNNNNNNN";
-    static char const* const colorStr = "..........";
-    static const uint32_t strLen = 10;
-    uint32_t xLen = readlen < strLen ? readlen : strLen;
-
-    if ( cs_native )
-    {
-        if ( strncmp( &read[ 1 ], colorStr, xLen ) == 0 || strcmp( &read[ readlen - xLen + 1 ], colorStr ) == 0 )
-            return false;
-    }
-    else
-    {
-        if ( strncmp( read, baseStr, xLen ) == 0 || strcmp( &read[ readlen - xLen ], baseStr ) == 0 )
-            return false;
-    }
-    return true;
-}
-
-
-/* filter out reads by leading/trialing quality */
-static rc_t FastqQFilter_GetKey( const SRASplitter* cself, const char** key,
-                                 spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqQFilter* self = ( FastqQFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0, spot_len;
-
-        *key = NULL;
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, &spot_len, &num_reads );
-            if ( rc == 0 )
-            {
-                SRA_DUMP_DBG( 3, ( "%s %u row reads: ", __func__, spot ) );
-                if ( FastqArgs.split_spot )
-                {
-                    uint32_t readId;
-                    INSDC_coord_len read_len;
-                    for ( readId = 0; rc == 0 && readId < num_reads; readId++ )
-                    {
-                        if ( isset_readmask( readmask, readId ) )
-                        {
-                            rc = FastqReader_SpotReadInfo( self->reader, readId + 1, NULL, NULL, NULL, NULL, &read_len );
-                            if ( rc == 0 )
-                            {
-                                /* FastqReaderBase() in libsra! libs/sra/fastq.h 
-                                   IF_BUF ... very, very bad macro defined in factory.h !!
-                                   it combines reading from table with resizing of a KDatabuffer in a loop until rc == 0 is reached!
-                                */
-                                IF_BUF( ( FastqReaderBase( self->reader, readId + 1,
-                                          self->buffer_for_read_column->base,
-                                          KDataBufferBytes( self->buffer_for_read_column ), NULL) ),
-                                          self->buffer_for_read_column, read_len )
-                                {
-                                    const char * b = self->buffer_for_read_column->base;
-                                    bool filter_passed = true;
-
-                                    if ( FastqArgs.qual_filter1 )
-                                    {
-                                        if ( quality_N_limit > 0 )
-                                        {
-                                            IF_BUF( ( FastqReaderQuality( self->reader, readId + 1,
-                                                      self->buffer_for_quality->base,
-                                                      KDataBufferBytes( self->buffer_for_quality ), NULL) ),
-                                                      self->buffer_for_quality, read_len )
-                                            {
-                                                const char * q = self->buffer_for_quality->base;
-                                                char N_char = FastqArgs.is_platform_cs_native ? '.' : 'N';
-                                                filter_passed = QFilter_Test_new( b, q, read_len, quality_N_limit, N_char );
-                                            }
-                                        }
-                                    }
-                                    else
-                                        filter_passed = QFilter_Test_old( b, read_len, FastqArgs.is_platform_cs_native );
-
-                                    if ( filter_passed )
-                                        SRA_DUMP_DBG( 3, ( " %u", readId ) );
-                                    else
-                                    {
-                                        unset_readmask( readmask, readId );
-                                        /* READ did not pass filter */
-                                        self->rejected_reads ++;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    *key = "";
-                }
-                else
-                {
-                    IF_BUF( ( FastqReaderBase( self->reader, 0, self->buffer_for_read_column->base,
-                              KDataBufferBytes( self->buffer_for_read_column ), NULL ) ), self->buffer_for_read_column, spot_len )
-                    {
-                        const char* b = self->buffer_for_read_column->base;
-                        bool filter_passed = true;
-
-                        if ( FastqArgs.qual_filter1 )
-                        {
-                            if ( quality_N_limit > 0 )
-                            {
-                                IF_BUF( ( FastqReaderQuality( self->reader, 0, self->buffer_for_quality->base,
-                                          KDataBufferBytes( self->buffer_for_quality ), NULL ) ), self->buffer_for_quality, spot_len )
-                                {
-                                    const char * q = self->buffer_for_quality->base;
-                                    char N_char = FastqArgs.is_platform_cs_native ? '.' : 'N';
-                                    filter_passed = QFilter_Test_new( b, q, spot_len, quality_N_limit, N_char );
-                                }
-                            }
-                        }
-                        else
-                            filter_passed = QFilter_Test_old( b, spot_len, FastqArgs.is_platform_cs_native );
-
-                        if ( filter_passed )
-                        {
-                            *key = "";
-                            SRA_DUMP_DBG( 3, ( " whole spot" ) );
-                        }
-                        else
-                        {
-                            /* SPOT did not pass filter */
-                            self->rejected_spots ++;
-                        }
-                    }
-                }
-                SRA_DUMP_DBG( 3, ( " key '%s'\n", *key ) );
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqQFilter_Release( const SRASplitter * cself )
-{
-    rc_t rc = 0;
-    FastqQFilter* self = ( FastqQFilter* )cself;
-
-    if ( self == NULL )
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    else if ( !g_legacy_report )
-    {
-        if ( self->rejected_reads > 0 )
-            rc = KOutMsg( "Rejected %lu READS because of Quality-Filtering\n", self->rejected_reads );
-        if ( rc == 0 && self->rejected_spots > 0 )
-            rc = KOutMsg( "Rejected %lu SPOTS because of Quality-Filtering\n", self->rejected_spots );
-
-    }
-    return rc;
-}
-
-
-typedef struct FastqQFilterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-    KDataBuffer kdbuf;
-    KDataBuffer kdbuf2;
-} FastqQFilterFactory;
-
-
-static rc_t FastqQFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqQFilterFactory* self = ( FastqQFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = KDataBufferMakeBytes( &self->kdbuf, DATABUFFERINITSIZE );
-        if ( rc == 0 )
-        {
-            rc = KDataBufferMakeBytes( &self->kdbuf2, DATABUFFERINITSIZE );
-            if ( rc == 0 )
-            {
-                rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                             /* preserve orig spot format to save on conversions */
-                             FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                             false, !FastqArgs.applyClip, 0,
-                             FastqArgs.offset, '\0', 0, 0 );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqQFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqQFilterFactory* self = ( FastqQFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( FastqQFilter ), FastqQFilter_GetKey, NULL, NULL, FastqQFilter_Release );
-        if ( rc == 0 )
-        {
-            FastqQFilter * filter = ( FastqQFilter * )( * splitter );
-            filter->reader = self->reader;
-            filter->buffer_for_read_column = &self->kdbuf;
-            filter->buffer_for_quality = &self->kdbuf2;
-            filter->rejected_spots = 0;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void FastqQFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqQFilterFactory* self = ( FastqQFilterFactory* )cself;
-        KDataBufferWhack( &self->kdbuf );
-        KDataBufferWhack( &self->kdbuf2 );
-        FastqReaderWhack( self->reader );
-    }
-}
-
-
-static rc_t FastqQFilterFactory_Make( const SRASplitterFactory** cself,
-                                      const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqQFilterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      FastqQFilterFactory_Init,
-                                      FastqQFilterFactory_NewObj,
-                                      FastqQFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( FastqQFilterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ min read length filter ============================ */
-
-
-typedef struct FastqReadLenFilter_struct
-{
-    const FastqReader* reader;
-    uint64_t rejected_spots;
-    uint64_t rejected_reads;
-} FastqReadLenFilter;
-
-
-static rc_t FastqReadLenFilter_GetKey( const SRASplitter* cself, const char** key,
-                                       spotid_t spot, readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqReadLenFilter* self = ( FastqReadLenFilter* )cself;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0, spot_len = 0;
-
-        *key = NULL;
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, &spot_len, &num_reads );
-            if ( rc == 0 )
-            {
-                SRA_DUMP_DBG( 3, ( "%s %u row reads:", __func__, spot ) );
-                if ( FastqArgs.split_spot )
-                {
-                    uint32_t readId;
-                    INSDC_coord_len read_len = 0;
-                    for ( readId = 0; rc == 0 && readId < num_reads; readId++ )
-                    {
-                        if ( isset_readmask( readmask, readId ) )
-                        {
-                            rc = FastqReader_SpotReadInfo( self->reader, readId + 1, NULL, NULL, NULL, NULL, &read_len );
-                            if ( rc == 0 )
-                            {
-                                if ( read_len < FastqArgs.minReadLen )
-                                {
-                                    unset_readmask( readmask, readId );
-                                    self->rejected_reads ++;
-                                }
-                                else
-                                {
-                                    SRA_DUMP_DBG( 3, ( " %u", readId ) );
-                                }
-                            }
-                        }
-                    }
-                    *key = "";
-                }
-                else
-                {
-                    if ( spot_len >= FastqArgs.minReadLen )
-                    {
-                        *key = "";
-                        SRA_DUMP_DBG( 3, ( " whole spot" ) );
-                    }
-                    else
-                        self->rejected_spots ++;
-                }
-                SRA_DUMP_DBG( 3, ( "\n" ) );
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqReadLenFilter_Release( const SRASplitter * cself )
-{
-    rc_t rc = 0;
-    FastqReadLenFilter * self = ( FastqReadLenFilter* )cself;
-
-    if ( self == NULL )
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    else if ( !g_legacy_report )
-    {
-        if ( self->rejected_reads > 0 )
-            rc = KOutMsg( "Rejected %lu READS because READLEN < %u\n", self->rejected_reads, FastqArgs.minReadLen );
-        if ( self->rejected_spots > 0 && rc == 0 )
-            rc = KOutMsg( "Rejected %lu SPOTS because SPOTLEN < %u\n", self->rejected_spots, FastqArgs.minReadLen );
-    }
-    return rc;
-}
-
-
-typedef struct FastqReadLenFilterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-} FastqReadLenFilterFactory;
-
-
-static rc_t FastqReadLenFilterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqReadLenFilterFactory* self = ( FastqReadLenFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                             /* preserve orig spot format to save on conversions */
-                              FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                              false, !FastqArgs.applyClip, 0,
-                              FastqArgs.offset, '\0', 0, 0 );
-    }
-    return rc;
-}
-
-
-static rc_t FastqReadLenFilterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqReadLenFilterFactory* self = ( FastqReadLenFilterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( FastqReadLenFilter ),
-                               FastqReadLenFilter_GetKey, NULL, NULL, FastqReadLenFilter_Release );
-        if ( rc == 0 )
-        {
-            FastqReadLenFilter * filter = ( FastqReadLenFilter* )( *splitter );
-            filter->reader = self->reader;
-            filter->rejected_spots = 0;
-            filter->rejected_reads = 0;
-        }
-    }
-    return rc;
-}
-
-
-static void FastqReadLenFilterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqReadLenFilterFactory* self = ( FastqReadLenFilterFactory* )cself;
-        FastqReaderWhack( self->reader );
-    }
-}
-
-
-static rc_t FastqReadLenFilterFactory_Make( const SRASplitterFactory** cself,
-                            const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqReadLenFilterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterSpot, sizeof( *obj ),
-                                      FastqReadLenFilterFactory_Init,
-                                      FastqReadLenFilterFactory_NewObj,
-                                      FastqReadLenFilterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( FastqReadLenFilterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ read splitter ============================ */
-
-char* FastqReadSplitter_key_buf = NULL;
-
-
-typedef struct FastqReadSplitter_struct
-{
-    const FastqReader* reader;
-    SRASplitter_Keys* keys;
-    uint32_t keys_max;
-} FastqReadSplitter;
-
-
-static rc_t FastqReadSplitter_GetKeySet( const SRASplitter* cself, const SRASplitter_Keys** key,
-                    uint32_t* keys, spotid_t spot, const readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqReadSplitter* self = ( FastqReadSplitter* )cself;
-    const size_t key_offset = 5;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0;
-
-        *keys = 0;
-        if ( FastqReadSplitter_key_buf == NULL )
-        {
-            /* initial alloc key_buf: "  1\0  2\0...\0  9\0 10\0 11\0...\03220..\08192\0" */
-            if ( nreads_max > 9999 )
-            {
-                /* key_offset and sprintf format size are insufficient for keys longer than 4 digits */
-                rc = RC( rcExe, rcNode, rcExecuting, rcBuffer, rcInsufficient );
-            }
-            else
-            {
-                FastqReadSplitter_key_buf = malloc( nreads_max * key_offset );
-                if ( FastqReadSplitter_key_buf == NULL )
-                {
-                    rc = RC( rcExe, rcNode, rcExecuting, rcMemory, rcExhausted );
-                }
-                else
-                {
-                    /* fill buffer w/keys */
-                    int i;
-                    char* p = FastqReadSplitter_key_buf;
-                    for ( i = 1; rc == 0 && i <= nreads_max; i++ )
-                    {
-                        if ( sprintf( p, "%4u", i ) <= 0 )
-                        {
-                            rc = RC( rcExe, rcNode, rcExecuting, rcTransfer, rcIncomplete );
-                        }
-                        p += key_offset;
-                    }
-                }
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            rc = FastqReaderSeekSpot( self->reader, spot );
-            if ( rc == 0 )
-            {
-                rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-                if ( rc == 0 )
-                {
-                    uint32_t readId, good = 0;
-
-                    SRA_DUMP_DBG( 3, ( "%s %u row reads:", __func__, spot ) );
-                    for ( readId = 0; rc == 0 && readId < num_reads; readId++ )
-                    {
-                        rc = FastqReader_SpotReadInfo( self->reader, readId + 1, NULL, NULL, NULL, NULL, NULL );
-                        if ( !isset_readmask( readmask, readId ) )
-                        {
-                            continue;
-                        }
-                        if ( self->keys_max < ( good + 1 ) )
-                        {
-                            void* p = realloc( self->keys, sizeof( *self->keys ) * ( good + 1 ) );
-                            if ( p == NULL )
-                            {
-                                rc = RC( rcExe, rcNode, rcExecuting, rcMemory, rcExhausted );
-                                break;
-                            }
-                            else
-                            {
-                                self->keys = p;
-                                self->keys_max = good + 1;
-                            }
-                        }
-                        self->keys[ good ].key = &FastqReadSplitter_key_buf[ readId * key_offset ];
-                        while ( self->keys[ good ].key[ 0 ] == ' ' && self->keys[ good ].key[0] != '\0' )
-                        {
-                            self->keys[ good ].key++;
-                        }
-                        clear_readmask( self->keys[ good ].readmask );
-                        set_readmask( self->keys[good].readmask, readId );
-                        SRA_DUMP_DBG( 3, ( " key['%s']+=%u", self->keys[ good ].key, readId ) );
-                        good++;
-                    }
-                    if ( rc == 0 )
-                    {
-                        *key = self->keys;
-                        *keys = good;
-                    }
-                    SRA_DUMP_DBG( 3, ( "\n" ) );
-                }
-            }
-            else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-            {
-                SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-                rc = 0;
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-                SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-                rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-rc_t FastqReadSplitter_Release( const SRASplitter* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqReadSplitter* self = ( FastqReadSplitter* )cself;
-        free( self->keys );
-    }
-    return 0;
-}
-
-
-typedef struct FastqReadSplitterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-} FastqReadSplitterFactory;
-
-
-static rc_t FastqReadSplitterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqReadSplitterFactory* self = ( FastqReadSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                              /* preserve orig spot format to save on conversions */
-                              FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                              false, !FastqArgs.applyClip, 0,
-                              FastqArgs.offset, '\0', 0, 0 );
-    }
-    return rc;
-}
-
-
-static rc_t FastqReadSplitterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqReadSplitterFactory* self = ( FastqReadSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( FastqReadSplitter ), NULL,
-                               FastqReadSplitter_GetKeySet, NULL, FastqReadSplitter_Release );
-        if ( rc == 0 )
-        {
-            ( (FastqReadSplitter*)(*splitter) )->reader = self->reader;
-        }
-    }
-    return rc;
-}
-
-
-static void FastqReadSplitterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        FastqReadSplitterFactory* self = ( FastqReadSplitterFactory* )cself;
-        FastqReaderWhack( self->reader );
-        free( FastqReadSplitter_key_buf );
-        FastqReadSplitter_key_buf = NULL;
-    }
-}
-
-
-static rc_t FastqReadSplitterFactory_Make( const SRASplitterFactory** cself,
-                const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqReadSplitterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterRead, sizeof( *obj ),
-                                      FastqReadSplitterFactory_Init,
-                                      FastqReadSplitterFactory_NewObj,
-                                      FastqReadSplitterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( FastqReadSplitterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ 3 read splitter ============================ */
-
-char* Fastq3ReadSplitter_key_buf = NULL;
-
-typedef struct Fastq3ReadSplitter_struct
-{
-    const FastqReader* reader;
-    SRASplitter_Keys keys[ 2 ];
-} Fastq3ReadSplitter;
-
-
-/* if all active reads len >= minreadlen, reads are splitted into separate files, otherwise on single key "" is returnded for all reads */
-static rc_t Fastq3ReadSplitter_GetKeySet( const SRASplitter* cself, const SRASplitter_Keys** key,
-            uint32_t* keys, spotid_t spot, const readmask_t* readmask )
-{
-    rc_t rc = 0;
-    Fastq3ReadSplitter* self = ( Fastq3ReadSplitter* )cself;
-    const size_t key_offset = 5;
-
-    if ( self == NULL || key == NULL )
-    {
-        rc = RC( rcExe, rcNode, rcExecuting, rcParam, rcInvalid );
-    }
-    else
-    {
-        uint32_t num_reads = 0;
-
-        *keys = 0;
-        if ( Fastq3ReadSplitter_key_buf == NULL )
-        {
-            /* initial alloc key_buf: "  1\0  2\0...\0  9\0 10\0 11\0...\03220..\08192\0" */
-            if ( nreads_max > 9999 )
-            {
-                /* key_offset and sprintf format size are insufficient for keys longer than 4 digits */
-                rc = RC( rcExe, rcNode, rcExecuting, rcBuffer, rcInsufficient );
-            }
-            else
-            {
-                Fastq3ReadSplitter_key_buf = malloc( nreads_max * key_offset );
-                if ( Fastq3ReadSplitter_key_buf == NULL )
-                {
-                    rc = RC( rcExe, rcNode, rcExecuting, rcMemory, rcExhausted );
-                }
-                else
-                {
-                    /* fill buffer w/keys */
-                    int i;
-                    char* p = Fastq3ReadSplitter_key_buf;
-                    for ( i = 1; rc == 0 && i <= nreads_max; i++ )
-                    {
-                        if ( sprintf( p, "%4u", i ) <= 0 )
-                        {
-                            rc = RC( rcExe, rcNode, rcExecuting, rcTransfer, rcIncomplete );
-                        }
-                        p += key_offset;
-                    }
-                }
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            rc = FastqReaderSeekSpot( self->reader, spot );
-            if ( rc == 0 )
-            {
-                rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-                if ( rc == 0 )
-                {
-                    uint32_t readId, good  = 0;
-                    const uint32_t max_reads = sizeof( self->keys ) /sizeof( self->keys[ 0 ] );
-
-                    SRA_DUMP_DBG( 3, ( "%s %u row reads:", __func__, spot ) );
-                    for ( readId = 0; rc == 0 && readId < num_reads && good < max_reads; readId++ )
-                    {
-                        rc = FastqReader_SpotReadInfo( self->reader, readId + 1, NULL, NULL, NULL, NULL, NULL );
-                        if ( !isset_readmask( readmask, readId ) )
-                        {
-                            continue;
-                        }
-                        self->keys[ good ].key = &Fastq3ReadSplitter_key_buf[ good * key_offset ];
-                        while ( self->keys[ good ].key[ 0 ] == ' ' && self->keys[good].key[ 0 ] != '\0' )
-                        {
-                            self->keys[ good ].key++;
-                        }
-                        clear_readmask( self->keys[ good ].readmask );
-                        set_readmask( self->keys[ good ].readmask, readId );
-                        SRA_DUMP_DBG( 3, ( " key['%s']+=%u", self->keys[ good ].key, readId ) );
-                        good++;
-                    }
-                    if ( rc == 0 )
-                    {
-                        *key = self->keys;
-                        *keys = good;
-                        if ( good != max_reads )
-                        {
-                            /* some are short -> reset keys to same value for all valid reads */
-                            /* run has just one read -> no suffix */
-                            /* or single file was requested */
-                            for ( readId = 0; readId < good; readId++ )
-                            {
-                                self->keys[ readId ].key = "";
-                            }
-                            SRA_DUMP_DBG( 3, ( " all keys joined to ''" ) );
-                        }
-                    }
-                    SRA_DUMP_DBG( 3, ( "\n" ) );
-                }
-            }
-            else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-            {
-                SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-                rc = 0;
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct Fastq3ReadSplitterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-} Fastq3ReadSplitterFactory;
-
-
-static rc_t Fastq3ReadSplitterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    Fastq3ReadSplitterFactory* self = ( Fastq3ReadSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                              /* preserve orig spot format to save on conversions */
-                              FastqArgs.is_platform_cs_native, false, FastqArgs.fasta > 0, false, 
-                              false, !FastqArgs.applyClip, 0,
-                              FastqArgs.offset, '\0', 0, 0 );
-    }
-    return rc;
-}
-
-
-static rc_t Fastq3ReadSplitterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    Fastq3ReadSplitterFactory* self = ( Fastq3ReadSplitterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make( splitter, sizeof( Fastq3ReadSplitter ),
-                               NULL, Fastq3ReadSplitter_GetKeySet, NULL, NULL );
-        if ( rc == 0 )
-        {
-            ( (Fastq3ReadSplitter*)(*splitter) )->reader = self->reader;
-        }
-    }
-    return rc;
-}
-
-
-static void Fastq3ReadSplitterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        Fastq3ReadSplitterFactory* self = ( Fastq3ReadSplitterFactory* )cself;
-        FastqReaderWhack( self->reader );
-        free( Fastq3ReadSplitter_key_buf );
-    }
-}
-
-
-static rc_t Fastq3ReadSplitterFactory_Make( const SRASplitterFactory** cself,
-                    const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    Fastq3ReadSplitterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL ) 
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterRead, sizeof( *obj ),
-                                      Fastq3ReadSplitterFactory_Init,
-                                      Fastq3ReadSplitterFactory_NewObj,
-                                      Fastq3ReadSplitterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = ( Fastq3ReadSplitterFactory* )*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ============== FASTQ formatter object  ============================ */
-
-
-typedef struct FastqFormatterSplitter_struct
-{
-    const char* accession;
-    const FastqReader* reader;
-    KDataBuffer* b[ 5 ];
-    size_t bsz[ 5 ]; /* fifth is for fasta line wrap */
-} FastqFormatterSplitter;
-
-
-static rc_t FastqFormatterSplitter_WrapLine( const KDataBuffer* src, size_t src_sz,
-                                             KDataBuffer* dst, size_t* dst_sz, const uint64_t width )
-{
-    rc_t rc = 0;
-    size_t sz = src_sz + ( src_sz - 1 ) / width;
-
-    if ( KDataBufferBytes( dst ) < sz )
-    {
-        SRA_DUMP_DBG( 10, ( "%s grow buffer from %u to %u\n", __func__, KDataBufferBytes( dst ), sz + 10 ) );
-        rc = KDataBufferResize( dst, sz + 10 );
-    }
-    if ( rc == 0 )
-    {
-        const char* s = src->base;
-        char* d = dst->base;
-        *dst_sz = sz = src_sz;
-        while ( sz > 0 )
-        {
-            memcpy( d, s, sz > width ? width : sz );
-            if ( sz <= width )
-            {
-                break;
-            }
-            d += width;
-            *d++ = '\n';
-            *dst_sz = *dst_sz + 1;
-            s += width;
-            sz -= width;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqFormatterSplitter_DumpByRead( const SRASplitter* cself, spotid_t spot, const readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqFormatterSplitter* self = ( FastqFormatterSplitter* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else 
-    {
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            rc = SRASplitter_FileActivate( cself, FastqArgs.file_extension );
-            if ( rc == 0 )
-            {
-                DeflineData def_data;
-                const char* spot_name = NULL, *spot_group = NULL, *read_name = NULL;
-                uint32_t readIdx, spot_len = 0;
-                uint32_t num_reads, readId, k;
-                size_t sname_sz, sgrp_sz;
-                INSDC_coord_len rlabel_sz = 0, read_len = 0;
-
-                if ( FastqArgs.b_defline || FastqArgs.q_defline )
-                {
-                    rc = FastqReader_SpotInfo( self->reader, &spot_name, &sname_sz, &spot_group, &sgrp_sz, &spot_len, &num_reads );
-                }
-                else
-                {
-                    rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-                }
-
-                for ( readId = 1, readIdx = 1; rc == 0 && readId <= num_reads; readId++, readIdx++ )
-                {
-                    if ( !isset_readmask( readmask, readId - 1 ) )
-                    {
-                        continue;
-                    }
-                    if ( FastqArgs.b_defline || FastqArgs.q_defline )
-                    {
-                        rc = FastqReader_SpotReadInfo( self->reader, readId, NULL, &read_name, &rlabel_sz, NULL, &read_len );
-                        if ( rc == 0 )
-                        {
-                            rc = Defline_Bind( &def_data, self->accession, &spot, spot_name, sname_sz, spot_group, sgrp_sz,
-                                               &spot_len, &readIdx, read_name, rlabel_sz, &read_len );
-                        }
-                    }
-                    if ( rc == 0 )
-                    {
-                        if ( FastqArgs.b_defline )
-                        {
-                            IF_BUF( ( Defline_Build( FastqArgs.b_defline, &def_data, self->b[0]->base,
-                                      KDataBufferBytes( self->b[0] ), &self->bsz[0] ) ), self->b[0], self->bsz[0] );
-                        }
-                        else
-                        {
-                            IF_BUF( ( FastqReaderBaseName( self->reader, readId, &FastqArgs.dumpCs, self->b[0]->base,
-                                      KDataBufferBytes( self->b[0] ), &self->bsz[0] ) ), self->b[0], self->bsz[0] );
-                        }
-                    }
-                    if ( rc == 0 )
-                    {
-                        if ( FastqArgs.fasta > 0 )
-                        {
-                            IF_BUF( ( FastqReaderBase( self->reader, readId, self->b[4]->base, KDataBufferBytes( self->b[4] ),
-                                      &self->bsz[4] ) ), self->b[4], self->bsz[4] )
-                            {
-                                rc = FastqFormatterSplitter_WrapLine( self->b[4], self->bsz[4], self->b[1], &self->bsz[1], FastqArgs.fasta );
-                            }
-                        }
-                        else
-                        {
-                            IF_BUF( ( FastqReaderBase( self->reader, readId, self->b[1]->base,
-                                      KDataBufferBytes( self->b[1] ), &self->bsz[1] ) ), self->b[1], self->bsz[1] );
-                        }
-                    }
-                    if ( !FastqArgs.fasta && rc == 0 )
-                    {
-                        if ( FastqArgs.q_defline )
-                        {
-                            IF_BUF( ( Defline_Build( FastqArgs.q_defline, &def_data, self->b[2]->base,
-                                      KDataBufferBytes( self->b[2] ), &self->bsz[2] ) ), self->b[2], self->bsz[2] );
-                        }
-                        else
-                        {
-                            IF_BUF( ( FastqReaderQualityName( self->reader, readId, &FastqArgs.dumpCs, self->b[2]->base,
-                                      KDataBufferBytes( self->b[2] ), &self->bsz[2] ) ), self->b[2], self->bsz[2] );
-                        }
-                        if ( rc == 0 )
-                        {
-                            IF_BUF( ( FastqReaderQuality( self->reader, readId, self->b[3]->base,
-                                      KDataBufferBytes( self->b[3] ), &self->bsz[3] ) ), self->b[3], self->bsz[3] );
-                        }
-                    }
-                    else if ( ( (char*)(self->b[0]->base))[0] == '@' )
-                    {
-                        ( (char*)(self->b[0]->base) )[0] = '>';
-                    }
-                    for ( k = 0; rc == 0 && k < ( FastqArgs.fasta ? 2 : 4); k++ )
-                    {
-                        rc = SRASplitter_FileWrite( cself, spot, self->b[ k ]->base, self->bsz[ k ] );
-                        if ( rc == 0 )
-                        {
-                            rc = SRASplitter_FileWrite( cself, spot, "\n", 1 );
-                        }
-                    }
-                }
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t Fasta_dump( const SRASplitter* cself, FastqFormatterSplitter* self, spotid_t spot, uint32_t columns )
-{
-    uint32_t readId;
-    rc_t rc = FastqFormatterSplitter_WrapLine( self->b[4], self->bsz[4], self->b[1], &self->bsz[1], columns );
-    for ( readId = 0; rc == 0 && readId < 2; readId++ )
-    {
-        rc = SRASplitter_FileWrite( cself, spot, self->b[readId]->base, self->bsz[ readId ] );
-        if ( rc == 0 )
-        {
-            rc = SRASplitter_FileWrite( cself, spot, "\n", 1 );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqFormatterSplitter_DumpBySpot( const SRASplitter* cself, spotid_t spot, const readmask_t* readmask )
-{
-    rc_t rc = 0;
-    FastqFormatterSplitter* self = ( FastqFormatterSplitter* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderSeekSpot( self->reader, spot );
-        if ( rc == 0 )
-        {
-            uint32_t num_reads, readId;
-
-            rc = FastqReader_SpotInfo( self->reader, NULL, NULL, NULL, NULL, NULL, &num_reads );
-            for ( readId = 0; rc == 0 && readId < num_reads; readId++ )
-            {
-                /* if any read in readmask is not set - skip whole spot */
-                if ( !isset_readmask( readmask, readId ) )
-                {
-                    return 0;
-                }
-            }
-            if ( rc == 0 )
-            {
-                rc = SRASplitter_FileActivate( cself, FastqArgs.file_extension );
-                if ( rc == 0 )
-                {
-                    DeflineData def_data;
-                    const char* spot_name = NULL, *spot_group = NULL;
-                    uint32_t spot_len = 0;
-                    size_t writ, sname_sz, sgrp_sz;
-                    const int base_i = FastqArgs.fasta ? 4 : 1;
-
-                    if ( FastqArgs.b_defline || FastqArgs.q_defline )
-                    {
-                        rc = FastqReader_SpotInfo( self->reader, &spot_name, &sname_sz,
-                                                   &spot_group, &sgrp_sz, &spot_len, NULL );
-                        if ( rc == 0 )
-                        {
-                            rc = Defline_Bind( &def_data, self->accession, &spot, spot_name,
-                                               sname_sz, spot_group, sgrp_sz, 
-                                               &spot_len, &readId, NULL, 0, &spot_len );
-                        }
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        if ( FastqArgs.b_defline )
-                        {
-                            IF_BUF( ( Defline_Build( FastqArgs.b_defline, &def_data, self->b[0]->base,
-                                      KDataBufferBytes( self->b[0] ), &self->bsz[0] ) ), self->b[0], self->bsz[0] );
-                        }
-                        else
-                        {
-                            IF_BUF( ( FastqReaderBaseName( self->reader, 0, &FastqArgs.dumpCs, self->b[0]->base,
-                                      KDataBufferBytes( self->b[0] ), &self->bsz[0] ) ), self->b[0], self->bsz[0] );
-                        }
-                        self->bsz[ base_i ] = 0;
-                        if ( !FastqArgs.fasta && rc == 0 )
-                        {
-                            if ( FastqArgs.q_defline )
-                            {
-                                IF_BUF( ( Defline_Build( FastqArgs.q_defline, &def_data, self->b[2]->base,
-                                          KDataBufferBytes( self->b[2] ), &self->bsz[2] ) ), self->b[2], self->bsz[2] );
-                            }
-                            else
-                            {
-                                IF_BUF( ( FastqReaderQualityName( self->reader, 0, &FastqArgs.dumpCs, self->b[2]->base,
-                                          KDataBufferBytes( self->b[2] ), &self->bsz[2] ) ), self->b[2], self->bsz[2] );
-                            }
-                            self->bsz[3] = 0;
-                        }
-                        else if ( ( (char*)(self->b[0]->base) )[0] == '@' )
-                        {
-                            ( (char*)(self->b[0]->base) )[0] = '>';
-                        }
-                    }
-
-                    for ( readId = 1; rc == 0 && readId <= num_reads; readId++ )
-                    {
-                        IF_BUF( ( FastqReaderBase( self->reader, readId, &( (char*)(self->b[base_i]->base) )[ self->bsz[ base_i ] ],
-                                  KDataBufferBytes( self->b[ base_i ] ) - self->bsz[ base_i ], &writ) ), self->b[ base_i ], self->bsz[ base_i ] + writ )
-                        {
-                            self->bsz[base_i] += writ;
-                            if ( !FastqArgs.fasta )
-                            {
-                                IF_BUF( ( FastqReaderQuality( self->reader, readId, &( (char*)(self->b[3]->base) )[ self->bsz[3] ],
-                                        KDataBufferBytes( self->b[3] ) - self->bsz[3], &writ ) ), self->b[3], self->bsz[3] + writ )
-                                {
-                                    self->bsz[ 3 ] += writ;
-                                }
-                            }
-                        }
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        if ( FastqArgs.fasta > 0 )
-                        {
-                            /* special printint of fasta-output ( line-wrap... ) */
-                            rc = Fasta_dump( cself, self, spot, FastqArgs.fasta );
-                        }
-                        else
-                        {
-                            for ( readId = 0; rc == 0 && readId < 4; readId++ )
-                            {
-                                rc = SRASplitter_FileWrite( cself, spot, self->b[readId]->base, self->bsz[ readId ] );
-                                if ( rc == 0 )
-                                {
-                                    rc = SRASplitter_FileWrite( cself, spot, "\n", 1 );
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        else if ( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound )
-        {
-            SRA_DUMP_DBG( 3, ( "%s skipped %u row\n", __func__, spot ) );
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-
-typedef struct FastqFormatterFactory_struct
-{
-    const char* accession;
-    const SRATable* table;
-    const FastqReader* reader;
-    KDataBuffer buf[ 5 ]; /* fifth is for fasta line wrap */
-} FastqFormatterFactory;
-
-
-static rc_t FastqFormatterFactory_Init( const SRASplitterFactory* cself )
-{
-    rc_t rc = 0;
-    FastqFormatterFactory* self = ( FastqFormatterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = FastqReaderMake( &self->reader, self->table, self->accession,
-                     FastqArgs.dumpCs, FastqArgs.dumpOrigFmt, FastqArgs.fasta > 0, FastqArgs.dumpCs,
-                     FastqArgs.readIds, !FastqArgs.applyClip, 0,
-                     FastqArgs.offset, FastqArgs.desiredCsKey[ 0 ], 0, 0 );
-        if ( rc == 0 )
-        {
-            int i;
-            for( i = 0; rc == 0 && i < sizeof( self->buf ) / sizeof( self->buf[ 0 ] ); i++ )
-            {
-                rc = KDataBufferMakeBytes( &self->buf[ i ], DATABUFFERINITSIZE );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t FastqFormatterFactory_NewObj( const SRASplitterFactory* cself, const SRASplitter** splitter )
-{
-    rc_t rc = 0;
-    FastqFormatterFactory* self = ( FastqFormatterFactory* )cself;
-
-    if ( self == NULL )
-    {
-        rc = RC( rcExe, rcType, rcExecuting, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitter_Make ( splitter, sizeof( FastqFormatterSplitter ), NULL, NULL,
-                                FastqArgs.split_spot ?
-                                    FastqFormatterSplitter_DumpByRead :
-                                    FastqFormatterSplitter_DumpBySpot, NULL );
-        if ( rc == 0 )
-        {
-            int i;
-            ( (FastqFormatterSplitter*)(*splitter) )->accession = self->accession;
-            ( (FastqFormatterSplitter*)(*splitter) )->reader = self->reader;
-            for ( i = 0; i < sizeof( self->buf ) / sizeof( self->buf[ 0 ] ); i++ )
-            {
-                ( (FastqFormatterSplitter*)(*splitter) )->b[ i ] = &self->buf[ i ];
-            }
-        }
-    }
-    return rc;
-}
-
-
-static void FastqFormatterFactory_Release( const SRASplitterFactory* cself )
-{
-    if ( cself != NULL )
-    {
-        int i;
-        FastqFormatterFactory* self = ( FastqFormatterFactory* )cself;
-        FastqReaderWhack( self->reader );
-        for ( i = 0; i < sizeof( self->buf ) / sizeof( self->buf[ 0 ] ); i++ )
-        {
-            KDataBufferWhack( &self->buf[ i ] );
-        }
-    }
-}
-
-
-static rc_t FastqFormatterFactory_Make( const SRASplitterFactory** cself,
-                const char* accession, const SRATable* table )
-{
-    rc_t rc = 0;
-    FastqFormatterFactory* obj = NULL;
-
-    if ( cself == NULL || accession == NULL || table == NULL )
-    {
-        rc = RC( rcExe, rcType, rcConstructing, rcParam, rcNull );
-    }
-    else
-    {
-        rc = SRASplitterFactory_Make( cself, eSplitterFormat, sizeof( *obj ),
-                                      FastqFormatterFactory_Init,
-                                      FastqFormatterFactory_NewObj,
-                                      FastqFormatterFactory_Release );
-        if ( rc == 0 )
-        {
-            obj = (FastqFormatterFactory*)*cself;
-            obj->accession = accession;
-            obj->table = table;
-        }
-    }
-    return rc;
-}
-
-
-/* ### External entry points ##################################################### */
-
-
-const char UsageDefaultName[] = "fastq-dump";
-
-
-rc_t CC UsageSummary ( const char * progname )
-{
-    return 0;
-}
-
-ver_t CC KAppVersion( void )
-{
-    return FASTQ_DUMP_VERS;
-}
-
-
-#define H_splip_sot 0
-#define H_clip 1
-#define H_minReadLen 2
-#define H_qual_filter 3
-#define H_skip_tech 4
-#define H_split_files 5
-#define H_split_3 6
-#define H_dumpcs 7
-#define H_dumpbase 8
-#define H_offset 9
-#define H_fasta 10
-#define H_origfmt 11
-#define H_readids 12
-#define H_helicos 13
-#define H_defline_seq 14
-#define H_defline_qual 15
-#define H_aligned 16
-#define H_unaligned 17
-#define H_aligned_region 18
-#define H_matepair_distance 19
-#define H_qual_filter_1 20
-
-rc_t FastqDumper_Usage( const SRADumperFmt* fmt, const SRADumperFmt_Arg* core_args, int first )
-{
-    int i, j;
-    /* known core options */
-    const SRADumperFmt_Arg* core[ 13 ];
-
-    memset( (void*)core, 0, sizeof( core ) );
-    for ( i = first; core_args[i].abbr != NULL || core_args[ i ].full != NULL; i++ )
-    {
-        const char* nm = core_args[ i ].abbr;
-        nm = nm ? nm : core_args[ i ].full;
-        if ( strcmp( nm, "A" ) == 0 )
-        {
-            core[ 0 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "O" ) == 0 )
-        {
-            core[ 1 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "N" ) == 0 )
-        {
-            core[ 2 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "X" ) == 0 )
-        {
-            core[ 3 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "G" ) == 0 )
-        {
-            core[ 4 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "spot-groups" ) == 0 )
-        {
-            core[ 5 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "R" ) == 0 )
-        {
-            core[ 6 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "T" ) == 0 )
-        {
-            core[ 7 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "K" ) == 0 )
-        {
-            core[ 8 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "table" ) == 0 )
-        {
-            core[ 9 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "Z" ) == 0 )
-        {
-            core[ 10 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "gzip" ) == 0 )
-        {
-            core[ 11 ] = &core_args[ i ];
-        }
-        else if ( strcmp( nm, "bzip2" ) == 0 )
-        {
-            core[ 12 ] = &core_args[ i ];
-        }
-    }
-
-#define OARG(arg,msg) (arg ? HelpOptionLine((arg)->abbr, (arg)->full, (arg)->param, \
-                       msg ? msg : (const char**)((arg)->descr)) : ((void)(0)))
-
-    OUTMSG(( "INPUT\n" ));
-    OARG( core[ 0 ], NULL );
-    OARG( core[ 9 ], NULL );
-
-    OUTMSG(( "\nPROCESSING\n" ));
-    OUTMSG(( "\nRead Splitting                     Sequence data may be used in raw form or\n"));
-    OUTMSG(( "                                     split into individual reads\n" ));
-    OARG( &fmt->arg_desc[ 0 ], NULL);
-
-    OUTMSG(( "\nFull Spot Filters                  Applied to the full spot independently\n" ));
-    OUTMSG(( "                                     of --%s\n", fmt->arg_desc[0].full ));
-    OARG( core[ 2 ], NULL );
-    OARG( core[ 3 ], NULL );
-    OARG( core[ 5 ], NULL );
-    OARG( &fmt->arg_desc[ 1 ], NULL );
-
-    OUTMSG(( "\nCommon Filters                     Applied to spots when --%s is not\n",
-                                                  fmt->arg_desc[0].full ));
-    OUTMSG(( "                                     set, otherwise - to individual reads\n" ));
-    OARG( &fmt->arg_desc[ 2 ], NULL );
-    OARG( core[ 6 ], NULL );
-    OARG( &fmt->arg_desc[ 3 ], NULL );
-    OARG( &fmt->arg_desc[ 20 ], NULL );
-
-    OUTMSG(( "\nFilters based on alignments        Filters are active when alignment\n" ));
-    OUTMSG(( "                                     data are present\n" ));
-    OARG( &fmt->arg_desc[ 16 ], NULL );
-    OARG( &fmt->arg_desc[ 17 ], NULL );
-    OARG( &fmt->arg_desc[ 18 ], NULL );
-    OARG( &fmt->arg_desc[ 19 ], NULL );
-
-    OUTMSG(( "\nFilters for individual reads       Applied only with --%s set\n",
-                                                  fmt->arg_desc[0].full ));
-    OARG( &fmt->arg_desc[ 4 ], NULL );
-
-    OUTMSG(( "\nOUTPUT\n" ));
-    OARG( core[ 1 ], NULL );
-    OARG( core[ 10 ], NULL );
-    OARG( core[ 11 ], NULL  );
-    OARG( core[ 12 ], NULL);
-
-    OUTMSG(( "\nMultiple File Options              Setting these options will produce more\n" ));
-    OUTMSG(( "                                     than 1 file, each of which will be suffixed\n" ));
-    OUTMSG(( "                                     according to splitting criteria.\n" ));
-    OARG( &fmt->arg_desc[ 5 ], NULL );
-    OARG( &fmt->arg_desc[ 6 ], NULL );
-    OARG( core[ 4 ], NULL );
-    OARG( core[ 6 ], NULL );
-    OARG( core[ 7 ], NULL );
-    OARG( core[ 8 ], NULL );
-
-    OUTMSG(( "\nFORMATTING\n" ));
-    OUTMSG(( "\nSequence\n" ));
-    OARG( &fmt->arg_desc[ 7 ], NULL );
-    OARG( &fmt->arg_desc[ 8 ], NULL );
-
-    OUTMSG(( "\nQuality\n" ));
-    OARG( &fmt->arg_desc[ 9 ], NULL );
-    OARG( &fmt->arg_desc[ 10 ], NULL );
-
-    OUTMSG(( "\nDefline\n" ));
-    OARG( &fmt->arg_desc[ 11 ], NULL );
-    OARG( &fmt->arg_desc[ 12 ], NULL );
-    OARG( &fmt->arg_desc[ 13 ], NULL );
-    OARG( &fmt->arg_desc[ 14 ], NULL );
-    OARG( &fmt->arg_desc[ 15 ], NULL );
-
-    OUTMSG(( "OTHER:\n" ));
-    for ( i = first; core_args[ i ].abbr != NULL || core_args[ i ].full != NULL; i++ )
-    {
-        bool print = true;
-        for ( j = 0; j < sizeof( core ) / sizeof( core[ 0 ] ); j++ )
-        {
-            if ( core[ j ] == &core_args[ i ] )
-            {
-                print = false;
-                break;
-            }
-        }
-        if ( print )
-        {
-            OARG( &core_args[ i ], NULL );
-        }
-    }
-    return 0;
-}
-
-
-rc_t FastqDumper_Release( const SRADumperFmt* fmt )
-{
-    if ( fmt == NULL )
-    {
-        return RC( rcExe, rcFormatter, rcDestroying, rcParam, rcInvalid );
-    }
-    else
-    {
-        Defline_Release( FastqArgs.b_defline );
-        Defline_Release( FastqArgs.q_defline );
-        free( FastqArgs.alregion );
-    }
-    return 0;
-}
-
-
-bool FastqDumper_AddArg( const SRADumperFmt* fmt, GetArg* f, int* i, int argc, char *argv[] )
-{
-    const char* arg = NULL;
-
-    if ( fmt == NULL || f == NULL || i == NULL || argv == NULL )
-    {
-        LOGERR( klogErr, RC( rcExe, rcArgv, rcReading, rcParam, rcInvalid ), "null param" );
-        return false;
-    }
-    else if ( f( fmt, "M", "minReadLen", i, argc, argv, &arg ) )
-    {
-        FastqArgs.minReadLen = AsciiToU32( arg, NULL, NULL );
-    }
-    else if ( f( fmt, "W", "clip", i, argc, argv, NULL ) )
-    {
-        FastqArgs.applyClip = true;
-    }
-    else if ( f( fmt, "F", "origfmt", i, argc, argv, NULL ) )
-    {
-        FastqArgs.dumpOrigFmt = true;
-    }
-    else if ( f( fmt, "C", "dumpcs", i, argc, argv, NULL ) )
-    {
-        int k = ( *i ) + 1;
-        FastqArgs.dumpCs = true;
-        if ( k < argc && strlen( argv[ k ] ) == 1 && strchr( "acgtACGT", argv[ k ][ 0 ] ) != NULL )
-        {
-            FastqArgs.desiredCsKey = argv[ k ];
-            *i = k;
-        }
-    }
-    else if ( f( fmt, "B", "dumpbase", i, argc, argv, NULL ) )
-    {
-        FastqArgs.dumpBase = true;
-    }
-    else if ( f( fmt, "Q", "offset", i, argc, argv, &arg ) )
-    {
-        FastqArgs.offset = AsciiToU32( arg, NULL, NULL );
-    }
-    else if ( f( fmt, "I", "readids", i, argc, argv, NULL ) )
-    {
-        FastqArgs.readIds = true;
-    }
-    else if ( f( fmt, "E", "qual-filter", i, argc, argv, NULL ) )
-    {
-        FastqArgs.qual_filter = true;
-    }
-    else if ( f( fmt, "E1", "qual-filter-1", i, argc, argv, NULL ) )
-    {
-        FastqArgs.qual_filter1 = true;
-    }
-    else if ( f( fmt, "DB", "defline-seq", i, argc, argv, &arg ) )
-    {
-        FastqArgs.b_deffmt = arg;
-    }
-    else if ( f( fmt, "DQ", "defline-qual", i, argc, argv, &arg ) )
-    {
-        FastqArgs.q_deffmt = arg;
-    }
-    else if ( f( fmt, "TR", "skip-technical", i, argc, argv, NULL ) )
-    {
-        FastqArgs.skipTechnical = true;
-    }
-    else if ( f( fmt, "SF", "split-files", i, argc, argv, NULL ) )
-    {
-        FastqArgs.split_spot = true;
-        FastqArgs.split_files = true;
-    }
-    else if ( f( fmt, NULL, "split-3", i, argc, argv, NULL ) )
-    {
-        FastqArgs.split_3 = true;
-        FastqArgs.split_spot = true;
-        FastqArgs.maxReads = 2;
-        FastqArgs.skipTechnical = true;
-    }
-    else if ( f( fmt, "SL", "split-spot", i, argc, argv, NULL ) )
-    {
-        FastqArgs.split_spot = true;
-    }
-    else if ( f( fmt, "HS", "helicos", i, argc, argv, NULL ) )
-    {
-        FastqArgs.b_deffmt = "@$sn";
-        FastqArgs.q_deffmt =  "+";
-    }
-    else if ( f( fmt, "FA", "fasta", i, argc, argv, NULL ) )
-    {
-        int k = (*i) + 1;
-        FastqArgs.fasta = 70;
-        if ( k < argc && isdigit( argv[ k ][ 0 ] ) )
-        {
-            char* endp = NULL;
-            errno = 0;
-            FastqArgs.fasta = strtou64( argv[ k ], &endp, 10 );
-            if ( errno != 0 || endp == NULL || *endp != '\0' )
-            {
-                return false;
-            }
-            *i = k;
-            if ( FastqArgs.fasta == 0 )
-            {
-                FastqArgs.fasta = ~0;
-            }
-        }
-        FastqArgs.file_extension = ".fasta";
-    }
-    else if ( f( fmt, NULL, "aligned", i, argc, argv, NULL ) )
-    {
-        FastqArgs.aligned = true;
-    }
-    else if ( f( fmt, NULL, "unaligned", i, argc, argv, NULL ) )
-    {
-        FastqArgs.unaligned = true;
-    }
-    else if ( f( fmt, NULL, "aligned-region", i, argc, argv, &arg ) )
-    {
-        /* name[:[from][-[to]]] */
-        TAlignedRegion* r = realloc( FastqArgs.alregion, sizeof( *FastqArgs.alregion ) * ++FastqArgs.alregion_qty );
-        if ( r == NULL )
-        {
-            return false;
-        }
-        FastqArgs.alregion = r;
-        r = &FastqArgs.alregion[ FastqArgs.alregion_qty - 1 ];
-        r->name = strchr( arg, ':' );
-        r->from = 0;
-        r->to = 0;
-        if ( r->name == NULL )
-        {
-            r->name = arg;
-            r->name_len = strlen( arg );
-        }
-        else
-        {
-            const char* c;
-            uint64_t* v;
-
-            r->name_len = r->name - arg;
-            c = r->name;
-            r->name = arg;
-
-            v = &r->from;
-            while ( *++c != '\0')
-            {
-                if ( *c == '-' )
-                {
-                    v = &r->to;
-                }
-                else if ( *c == '+' )
-                {
-                    if ( *v != 0 )
-                    {
-                        return false;
-                    }
-                }
-                else if ( !isdigit( *c ) )
-                {
-                    return false;
-                }
-                else
-                {
-                    *v = *v * 10 + ( *c - '0' );
-                }
-            }
-            if ( r->from > r->to && r->to != 0 )
-            {
-                uint64_t x = r->from;
-                r->from = r->to;
-                r->to = x;
-            }
-        }
-    }
-    else if ( f( fmt, NULL, "matepair-distance", i, argc, argv, &arg ) )
-    {
-        /* from[-to] | [from]-to | unknown */
-        if ( strcmp( arg, "unknown" ) == 0 )
-        {
-            FastqArgs.mp_dist_unknown = true;
-        }
-        else
-        {
-            uint64_t* v;
-            TMatepairDistance* p = realloc( FastqArgs.mp_dist, sizeof( *FastqArgs.mp_dist ) * ++FastqArgs.mp_dist_qty );
-            if ( p == NULL )
-            {
-                return false;
-            }
-            FastqArgs.mp_dist = p;
-            p = &FastqArgs.mp_dist[ FastqArgs.mp_dist_qty - 1 ];
-            p->from = 0;
-            p->to = 0;
-
-            v = &p->from;
-            while ( *++arg != '\0' )
-            {
-                if ( *arg == '-' )
-                {
-                    v = &p->to;
-                }
-                else if ( *arg == '+' )
-                {
-                    if ( *v != 0 )
-                    {
-                        return false;
-                    }
-                }
-                else if ( !isdigit( *arg ) )
-                {
-                    return false;
-                }
-                else
-                {
-                    *v = *v * 10 + ( *arg - '0' );
-                }
-            }
-            if ( p->from > p->to && p->to != 0 )
-            {
-                uint64_t x = p->from;
-                p->from = p->to;
-                p->to = x;
-            }
-            if ( p->from == 0 && p->to == 0 )
-            {
-                FastqArgs.mp_dist_qty--;
-            }
-        }
-    }
-    else
-    {
-        return false;
-    }
-    return true;
-}
-
-
-rc_t FastqDumper_Factories( const SRADumperFmt* fmt, const SRASplitterFactory** factory )
-{
-    rc_t rc = 0;
-    const SRASplitterFactory* parent = NULL, *child = NULL;
-
-    if ( fmt == NULL || factory == NULL )
-    {
-        return RC( rcExe, rcFormatter, rcReading, rcParam, rcInvalid );
-    }
-    *factory = NULL;
-    {
-        const SRAColumn* c = NULL;
-        rc = SRATableOpenColumnRead( fmt->table, &c, "PLATFORM", sra_platform_id_t );
-        if ( rc == 0 )
-        {
-            const INSDC_SRA_platform_id * platform;
-            bitsz_t o, z;
-            rc = SRAColumnRead( c, 1, ( const void ** )&platform, &o, &z );
-            if ( rc == 0 )
-            {
-                if ( !FastqArgs.dumpCs && !FastqArgs.dumpBase )
-                {
-                    if ( platform != NULL && *platform == SRA_PLATFORM_ABSOLID )
-                    {
-                        FastqArgs.dumpCs = true;
-                    }
-                    else
-                    {
-                        FastqArgs.dumpBase = true;
-                    }
-                }
-                if ( platform != NULL && *platform == SRA_PLATFORM_ABSOLID )
-                {
-                    FastqArgs.is_platform_cs_native = true;
-                }
-            }
-            SRAColumnRelease( c );
-        }
-        else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcColumn )
-        {
-            rc = 0;
-        }
-    }
-
-    if ( ( FastqArgs.aligned || FastqArgs.unaligned ) && !( FastqArgs.aligned && FastqArgs.unaligned ) )
-    {
-        rc = AlignedFilterFactory_Make( &child, fmt->table, FastqArgs.aligned, FastqArgs.unaligned );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release(child);
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( FastqArgs.alregion_qty > 0 )
-    {
-        rc = AlignRegionFilterFactory_Make( &child, fmt->table, FastqArgs.alregion, FastqArgs.alregion_qty );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release( child );
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( FastqArgs.mp_dist_unknown || FastqArgs.mp_dist_qty > 0 )
-    {
-        rc = AlignPairDistanceFilterFactory_Make( &child, fmt->table,
-                FastqArgs.mp_dist_unknown, FastqArgs.mp_dist, FastqArgs.mp_dist_qty);
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release(child);
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( rc == 0 && FastqArgs.skipTechnical && FastqArgs.split_spot )
-    {
-        rc = FastqBioFilterFactory_Make( &child, fmt->accession, fmt->table );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release( child );
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( rc == 0 && FastqArgs.maxReads > 0 )
-    {
-        rc = FastqRNumberFilterFactory_Make( &child, fmt->accession, fmt->table );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release( child );
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( rc == 0 && ( FastqArgs.qual_filter || FastqArgs.qual_filter1 ) )
-    {
-        rc = FastqQFilterFactory_Make( &child, fmt->accession, fmt->table );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release( child );
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = FastqReadLenFilterFactory_Make( &child, fmt->accession, fmt->table );
-        if ( rc == 0 )
-        {
-            if ( parent != NULL )
-            {
-                rc = SRASplitterFactory_AddNext( parent, child );
-                if ( rc != 0 )
-                {
-                    SRASplitterFactory_Release( child );
-                }
-                else
-                {
-                    parent = child;
-                }
-            }
-            else
-            {
-                parent = child;
-                *factory = parent;
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        if ( FastqArgs.split_3 )
-        {
-            rc = Fastq3ReadSplitterFactory_Make( &child, fmt->accession, fmt->table );
-            if ( rc == 0 )
-            {
-                if ( parent != NULL )
-                {
-                    rc = SRASplitterFactory_AddNext( parent, child );
-                    if ( rc != 0 )
-                    {
-                        SRASplitterFactory_Release( child );
-                    }
-                    else
-                    {
-                        parent = child;
-                    }
-                }
-                else
-                {
-                    parent = child;
-                    *factory = parent;
-                }
-            }
-        }
-        else if ( FastqArgs.split_files )
-        {
-            rc = FastqReadSplitterFactory_Make( &child, fmt->accession, fmt->table );
-            if ( rc == 0 )
-            {
-                if ( parent != NULL )
-                {
-                    rc = SRASplitterFactory_AddNext( parent, child );
-                    if ( rc != 0 )
-                    {
-                        SRASplitterFactory_Release(child);
-                    }
-                    else
-                    {
-                        parent = child;
-                    }
-                }
-                else
-                {
-                    parent = child;
-                    *factory = parent;
-                }
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        if ( FastqArgs.b_deffmt != NULL )
-        {
-            rc = Defline_Parse( &FastqArgs.b_defline, FastqArgs.b_deffmt );
-        }
-        if ( FastqArgs.q_deffmt != NULL )
-        {
-            rc = Defline_Parse( &FastqArgs.q_defline, FastqArgs.q_deffmt );
-        }
-        if ( rc == 0 )
-        {
-            rc = FastqFormatterFactory_Make( &child, fmt->accession, fmt->table );
-            if ( rc == 0 )
-            {
-                if ( parent != NULL )
-                {
-                    rc = SRASplitterFactory_AddNext( parent, child );
-                    if ( rc != 0 ) 
-                    {
-                        SRASplitterFactory_Release( child );
-                    }
-                }
-                else
-                {
-                    *factory = child;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/* main entry point of the file */
-rc_t SRADumper_Init( SRADumperFmt* fmt )
-{
-    static const SRADumperFmt_Arg arg[] =
-        {
-
-            /* DO NOT ADD IN THE MIDDLE ORDER IS IMPORTANT IN USAGE FUNCTION ABOVE!!! */
-            {NULL, "split-spot", NULL, {"Split spots into individual reads", NULL}},            /* H_splip_sot = 0 */
-
-            {"W", "clip", NULL, {"Apply left and right clips", NULL}},                          /* H_clip = 1 */
-
-            {"M", "minReadLen", "len", {"Filter by sequence length >= <len>", NULL}},           /* H_minReadLen = 2 */
-            {"E", "qual-filter", NULL, {"Filter used in early 1000 Genomes data:",              /* H_qual_filter = 3 */
-                                        "no sequences starting or ending with >= 10N", NULL}},
-
-            {NULL, "skip-technical", NULL, {"Dump only biological reads", NULL}},               /* H_skip_tech = 4 */
-
-            {NULL, "split-files", NULL, {"Dump each read into a separate file."                 /* H_split_files = 5 */
-                                         "Files will receive suffix corresponding to read number", NULL}},
-
-            /* DO NOT ADD IN THE MIDDLE ORDER IS IMPORTANT IN USAGE FUNCTION ABOVE!!! */
-            {NULL, "split-3", NULL, {"Legacy 3-file splitting for mate-pairs:",                 /* H_split_3 = 6 */
-                                     "First 2 biological reads satisfying dumping conditions",
-                                     "are placed in files *_1.fastq and *_2.fastq",
-                                     "If only one biological read is present - it is placed in *.fastq",
-                                     "Biological reads 3 and above are ignored.", NULL}},
-            
-            {"C", "dumpcs", "[cskey]", {"Formats sequence using color space (default for SOLiD),"   /* H_dumpcs = 7 */
-                                        "\"cskey\" may be specified for translation", NULL}},
-            {"B", "dumpbase", NULL, {"Formats sequence using base space (default for other than SOLiD).", NULL}}, /* H_dumpbase = 8 */
-
-            /* DO NOT ADD IN THE MIDDLE ORDER IS IMPORTANT IN USAGE FUNCTION ABOVE!!! */
-            {"Q", "offset", "integer", {"Offset to use for quality conversion, default is 33", NULL}},  /* H_offset = 9 */
-            {NULL, "fasta", "[line width]", {"FASTA only, no qualities, optional line wrap width (set to zero for no wrapping)", NULL}}, /* H_fasta = 10 */
-
-            {"F", "origfmt", NULL, {"Defline contains only original sequence name", NULL}}, /* H_origfmt = 11 */
-            {"I", "readids", NULL, {"Append read id after spot id as 'accession.spot.readid' on defline", NULL}}, /* H_readids = 12 */
-            {NULL, "helicos", NULL, {"Helicos style defline", NULL}}, /* H_helicos = 13 */
-            {NULL, "defline-seq", "fmt", {"Defline format specification for sequence.", NULL}}, /* H_defline_seq = 14 */
-            {NULL, "defline-qual", "fmt", {"Defline format specification for quailty.", /* H_defline_qual = 15 */
-                              "<fmt> is a string of characters and/or variables. The variables can be one of:",
-                              "$ac - accession, $si - spot id, $sn - spot name, $sg - spot group (barcode),",
-                              "$sl - spot length in bases, $ri - read number, $rn - read name, $rl - read length in bases.",
-                              "'[]' could be used for an optional output: if all vars in [] yield empty values whole group is not printed.",
-                              "Empty value is empty string or 0 for numeric variables.",
-                              "Ex: @$sn[_$rn]/$ri - '_$rn' is omitted if name is empty\n", NULL}},
-
-            {NULL, "aligned", NULL, {"Dump only aligned sequences", NULL}}, /* H_aligned = 16 */
-            {NULL, "unaligned", NULL, {"Dump only unaligned sequences", NULL}}, /* H_unaligned = 17 */
-
-            /* DO NOT ADD IN THE MIDDLE ORDER IS IMPORTANT IN USAGE FUNCTION ABOVE!!! */
-            {NULL, "aligned-region", "name[:from-to]", {"Filter by position on genome.", /* H_aligned_region = 18 */
-                            "Name can either be accession.version (ex: NC_000001.10) or",
-                            "file specific name (ex: \"chr1\" or \"1\").",
-                            "\"from\" and \"to\" are 1-based coordinates", NULL}},
-            {NULL, "matepair-distance", "from-to|unknown", {"Filter by distance beiween matepairs.", /* H_matepair-distance = 19 */
-                            "Use \"unknown\" to find matepairs split between the references.",
-                            "Use from-to to limit matepair distance on the same reference", NULL}},
-
-            {NULL, "qual-filter-1", NULL, {"Filter used in current 1000 Genomes data", NULL}}, /* H_qual_filter_1 = 20 */
-
-            {NULL, NULL, NULL, {NULL}}
-        };
-
-    if ( fmt == NULL )
-    {
-        return RC( rcExe, rcFileFormat, rcConstructing, rcParam, rcNull );
-    }
-
-    memset( &FastqArgs, 0, sizeof( FastqArgs ) );
-    FastqArgs.is_platform_cs_native = false;
-    FastqArgs.maxReads = 0;
-    FastqArgs.skipTechnical = false;
-    FastqArgs.minReadLen = 1;
-    FastqArgs.applyClip = false;
-    FastqArgs.dumpOrigFmt = false;
-    FastqArgs.dumpBase = false;
-    FastqArgs.dumpCs = false;
-    FastqArgs.readIds = false;
-    FastqArgs.offset = 33;
-    FastqArgs.desiredCsKey = "";
-    FastqArgs.qual_filter = false;
-    FastqArgs.b_deffmt = NULL;
-    FastqArgs.b_defline = NULL;
-    FastqArgs.q_deffmt = NULL;
-    FastqArgs.q_defline = NULL;
-    FastqArgs.split_files = false;
-    FastqArgs.split_3 = false;
-    FastqArgs.split_spot = false;
-    FastqArgs.fasta = 0;
-    FastqArgs.file_extension = ".fastq";
-    FastqArgs.aligned = false;
-    FastqArgs.unaligned = false;
-    FastqArgs.alregion = NULL;
-    FastqArgs.alregion_qty = 0;
-    FastqArgs.mp_dist = NULL;
-    FastqArgs.mp_dist_unknown = false;
-    FastqArgs.mp_dist_qty = 0;
-
-    fmt->usage = FastqDumper_Usage;
-    fmt->release = FastqDumper_Release;
-    fmt->arg_desc = arg;
-    fmt->add_arg = FastqDumper_AddArg;
-    fmt->get_factory = FastqDumper_Factories;
-    fmt->gzip = true;
-    fmt->bzip2 = true;
-
-    return 0;
-}
diff --git a/tools/sra-dump/illumina-dump.vers b/tools/sra-dump/illumina-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-dump/illumina-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-dump/illumina.c b/tools/sra-dump/illumina.c
deleted file mode 100644
index 17e8d23..0000000
--- a/tools/sra-dump/illumina.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <kapp/main.h>
-
-#include <sra/sradb.h>
-#include <sra/illumina.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "debug.h"
-#include "core.h"
-#include "illumina-dump.vers.h"
-
-#define DATABUFFERINITSIZE 10240
-
-typedef enum {
-    eRead = 0x01,
-    eQual1_S = 0x02,
-    eQual1_M = 0x04,
-    eQual4 = 0x08,
-    eIntensity = 0x10,
-    eNoise = 0x20,
-    eSignal = 0x40,
-    eQSeq_S = 0x80,
-    eQSeq_M = 0x100
-} EIlluminaOptions;
-
-struct IlluminaArgs_struct {
-    EIlluminaOptions opt;
-} IlluminaArgs;
-
-
-/* ============== Illumina tile/lane splitter based on uint32_t pointer ============================ */
-typedef enum {
-    eIlluminaLaneSplitter = 1,
-    eIlluminaTileSplitter = 2
-} TIlluminaLaneSplitterType;
-
-typedef struct IlluminaU32Splitter_struct {
-    TIlluminaLaneSplitterType type;
-    const IlluminaReader* reader;
-    char key[128];
-} IlluminaU32Splitter;
-
-static
-rc_t IlluminaU32Splitter_GetKey(const SRASplitter* cself, const char** key, spotid_t spot, readmask_t* readmask)
-{
-    rc_t rc = 0;
-    IlluminaU32Splitter* self = (IlluminaU32Splitter*)cself;
-
-    if( self == NULL || key == NULL ) {
-        rc = RC(rcSRA, rcNode, rcExecuting, rcParam, rcInvalid);
-    } else {
-        *key = self->key;
-        self->key[0] = '\0';
-        if( (rc = IlluminaReaderSeekSpot(self->reader, spot)) == 0 ) {
-            int w;
-            INSDC_coord_val val;
-            switch( self->type ) {
-                case eIlluminaLaneSplitter:
-                    w = 1;
-                    rc = IlluminaReader_SpotInfo(self->reader, NULL, NULL, &val, NULL, NULL, NULL, NULL, NULL);
-                    break;
-                case eIlluminaTileSplitter:
-                    w = 4;
-                    rc = IlluminaReader_SpotInfo(self->reader, NULL, NULL, NULL, &val, NULL, NULL, NULL, NULL);
-                    break;
-                default:
-                    rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcInvalid);
-            }
-            if( rc == 0 ) {
-                sprintf(self->key, "%0*d", w, val);
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            *key = NULL;
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct IlluminaU32SplitterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    TIlluminaLaneSplitterType type;
-    const IlluminaReader* reader;
-} IlluminaU32SplitterFactory;
-
-static
-rc_t IlluminaU32SplitterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    IlluminaU32SplitterFactory* self = (IlluminaU32SplitterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else {
-        rc = IlluminaReaderMake(&self->reader, self->table, self->accession, true, false, false, false, false, false, false, 0, 0);
-    }
-    return rc;
-}
-
-static
-rc_t IlluminaU32SplitterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    IlluminaU32SplitterFactory* self = (IlluminaU32SplitterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(IlluminaU32Splitter), IlluminaU32Splitter_GetKey, NULL, NULL, NULL)) == 0 ) {
-            ((IlluminaU32Splitter*)(*splitter))->reader = self->reader;
-            ((IlluminaU32Splitter*)(*splitter))->type = self->type;
-        }
-    }
-    return rc;
-}
-
-static
-void IlluminaU32SplitterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        IlluminaU32SplitterFactory* self = (IlluminaU32SplitterFactory*)cself;
-        IlluminaReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t IlluminaU32SplitterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table, TIlluminaLaneSplitterType type)
-{
-    rc_t rc = 0;
-    IlluminaU32SplitterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterSpot, sizeof(*obj),
-                                             IlluminaU32SplitterFactory_Init,
-                                             IlluminaU32SplitterFactory_NewObj,
-                                             IlluminaU32SplitterFactory_Release)) == 0 ) {
-        obj = (IlluminaU32SplitterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-        switch(type) {
-            case eIlluminaLaneSplitter:
-            case eIlluminaTileSplitter:
-                obj->type = type;
-                break;
-            default:
-                rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcInvalid);
-        }
-    }
-    return rc;
-}
-
-/* ============== Illumina formatter object  ============================ */
-
-typedef struct IlluminaFormatterSplitter_struct {
-    const IlluminaReader* reader;
-    KDataBuffer* b;
-} IlluminaFormatterSplitter;
-
-static
-rc_t IlluminaFormatterSplitter_Dump(const SRASplitter* cself, spotid_t spot, const readmask_t* readmask)
-{
-    rc_t rc = 0;
-    IlluminaFormatterSplitter* self = (IlluminaFormatterSplitter*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = IlluminaReaderSeekSpot(self->reader, spot)) == 0 ) {
-            size_t writ = 0;
-
-            if( rc == 0 && (IlluminaArgs.opt & eRead) &&
-                (rc = SRASplitter_FileActivate(cself, "seq.txt")) == 0 ) {
-                    IF_BUF((IlluminaReaderBase(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eQual1_S) &&
-                (rc = SRASplitter_FileActivate(cself, "qcal.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderQuality1(self->reader, 0, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eQual1_M) ) {
-                uint32_t num_reads = 0;
-                if( (rc = IlluminaReader_SpotInfo(self->reader, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                    int readId;
-                    char key[128];
-                    for(readId = 1; rc == 0 && readId <= num_reads; readId++) {
-                        sprintf(key, "%u_qcal.txt", readId);
-                        if( (rc = SRASplitter_FileActivate(cself, key)) == 0 ) {
-                            IF_BUF((IlluminaReaderQuality1(self->reader, readId, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                                if( writ > 0 ) {
-                                    ((char*)(self->b->base))[writ] = '\n';
-                                    rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eQual4) && (rc = SRASplitter_FileActivate(cself, "prb.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderQuality4(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eIntensity) && (rc = SRASplitter_FileActivate(cself, "int.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderIntensity(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eNoise) && (rc = SRASplitter_FileActivate(cself, "nse.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderNoise(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eSignal) && (rc = SRASplitter_FileActivate(cself, "sig2.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderSignal(self->reader, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eQSeq_S) && (rc = SRASplitter_FileActivate(cself, "qseq.txt")) == 0 ) {
-                IF_BUF((IlluminaReaderQSeq(self->reader, 0, true, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                    if( writ > 0 ) {
-                        ((char*)(self->b->base))[writ] = '\n';
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                    }
-                }
-            }
-            if( rc == 0 && (IlluminaArgs.opt & eQSeq_M) ) {
-                uint32_t num_reads = 0;
-                if( (rc = IlluminaReader_SpotInfo(self->reader, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &num_reads)) == 0 ) {
-                    uint32_t readId;
-                    char key[128];
-                    for(readId = 1; rc == 0 && readId <= num_reads; readId++) {
-                        sprintf(key, "%u_qseq.txt", readId);
-                        if( (rc = SRASplitter_FileActivate(cself, key)) == 0 ) {
-                            IF_BUF((IlluminaReaderQSeq(self->reader, readId, true, self->b->base, KDataBufferBytes(self->b) - 1, &writ)), self->b, writ) {
-                                if( writ > 0 ) {
-                                    ((char*)(self->b->base))[writ] = '\n';
-                                    rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ + 1);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-            SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-            rc = 0;
-        }
-    }
-    return rc;
-}
-
-typedef struct IlluminaFormatterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    const IlluminaReader* reader;
-    KDataBuffer buf;
-} IlluminaFormatterFactory;
-
-static
-rc_t IlluminaFormatterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    IlluminaFormatterFactory* self = (IlluminaFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = IlluminaReaderMake(&self->reader, self->table, self->accession,
-                                IlluminaArgs.opt & eRead, IlluminaArgs.opt & (eQual1_S | eQual1_M), IlluminaArgs.opt & eQual4, 
-                                IlluminaArgs.opt & eIntensity, IlluminaArgs.opt & eNoise, IlluminaArgs.opt & eSignal,
-                                IlluminaArgs.opt & (eQSeq_S | eQSeq_M), 0, 0)) == 0 ) {
-        rc = KDataBufferMakeBytes(&self->buf, DATABUFFERINITSIZE);
-    }
-    return rc;
-}
-
-static
-rc_t IlluminaFormatterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    IlluminaFormatterFactory* self = (IlluminaFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(IlluminaFormatterSplitter), NULL, NULL, IlluminaFormatterSplitter_Dump, NULL)) == 0 ) {
-            ((IlluminaFormatterSplitter*)(*splitter))->reader = self->reader;
-            ((IlluminaFormatterSplitter*)(*splitter))->b = &self->buf;
-        }
-    }
-    return rc;
-}
-
-static
-void IlluminaFormatterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        IlluminaFormatterFactory* self = (IlluminaFormatterFactory*)cself;
-        IlluminaReaderWhack(self->reader);
-        KDataBufferWhack(&self->buf);
-    }
-}
-
-static
-rc_t IlluminaFormatterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table)
-{
-    rc_t rc = 0;
-    IlluminaFormatterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterFormat, sizeof(*obj),
-                                             IlluminaFormatterFactory_Init,
-                                             IlluminaFormatterFactory_NewObj,
-                                             IlluminaFormatterFactory_Release)) == 0 ) {
-        obj = (IlluminaFormatterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-    }
-    return rc;
-}
-
-/* ### External entry points ##################################################### */
-const char UsageDefaultName[] = "illumina-dump";
-rc_t CC UsageSummary (const char * progname)
-{
-    return 0;
-}
-
-ver_t CC KAppVersion( void )
-{
-    return ILLUMINA_DUMP_VERS;
-}
-
-rc_t IlluminaDumper_Release(const SRADumperFmt* fmt)
-{
-    if( fmt == NULL ) {
-        return RC(rcExe, rcFormatter, rcDestroying, rcParam, rcInvalid);
-    }
-    return 0;
-}
-
-bool IlluminaDumper_AddArg(const SRADumperFmt* fmt, GetArg* f, int* i, int argc, char *argv[])
-{
-    const char* arg = NULL;
-    const char* qseq = "2";
-
-    if( fmt == NULL || f == NULL || i == NULL || argv == NULL ) {
-        LOGERR(klogErr, RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid), "null param");
-        return false;
-    } else if( f(fmt, "r", "read", i, argc, argv, NULL) ) {
-        IlluminaArgs.opt |= eRead;
-    } else if( f(fmt, "x", "qseq", i, argc, argv, &qseq) ) {
-        uint32_t q = AsciiToU32(qseq, NULL, NULL);
-        if( q == 1 ) {
-            IlluminaArgs.opt |= eQSeq_S;
-            IlluminaArgs.opt &= ~eQSeq_M;
-        } else if( q == 2 ) {
-            IlluminaArgs.opt |= eQSeq_M;
-            IlluminaArgs.opt &= ~eQSeq_S;
-        } else {
-            return false;
-        }
-    } else if( f(fmt, "q", "qual1", i, argc, argv, &arg) ) {
-        uint32_t q = AsciiToU32(arg, NULL, NULL);
-        if( q == 1 ) {
-            IlluminaArgs.opt |= eQual1_S;
-            IlluminaArgs.opt &= ~eQual1_M;
-        } else if( q == 2 ) {
-            IlluminaArgs.opt |= eQual1_M;
-            IlluminaArgs.opt &= ~eQual1_S;
-        } else {
-            return false;
-        }
-    } else if( f(fmt, "p", "qual4", i, argc, argv, NULL) ) {
-        IlluminaArgs.opt |= eQual4;
-    } else if( f(fmt, "i", "intensity", i, argc, argv, NULL) ) {
-        IlluminaArgs.opt |= eIntensity;
-    } else if( f(fmt, "n", "noise", i, argc, argv, NULL) ) {
-        IlluminaArgs.opt |= eNoise;
-    } else if( f(fmt, "s", "signal", i, argc, argv, NULL) ) {
-        IlluminaArgs.opt |= eSignal;
-    } else {
-        return false;
-    }
-    return true;
-}
-
-rc_t IlluminaDumper_Factories(const SRADumperFmt* fmt, const SRASplitterFactory** factory)
-{
-    rc_t rc = 0;
-    const SRASplitterFactory* f_lane = NULL, *f_tile = NULL, *f_fmt = NULL;
-
-    if( fmt == NULL || factory == NULL ) {
-        return RC(rcExe, rcFormatter, rcReading, rcParam, rcInvalid);
-    }
-    *factory = NULL;
-
-    if( IlluminaArgs.opt == 0 ) {
-        IlluminaArgs.opt = eRead | eQual1_S;
-    }
-
-    if( (rc = IlluminaU32SplitterFactory_Make(&f_lane, fmt->accession, fmt->table, eIlluminaLaneSplitter)) == 0 ) {
-        if( (rc = IlluminaU32SplitterFactory_Make(&f_tile, fmt->accession, fmt->table, eIlluminaTileSplitter)) == 0 ) {
-            if( (rc = IlluminaFormatterFactory_Make(&f_fmt, fmt->accession, fmt->table)) == 0 ) {
-                if( (rc = SRASplitterFactory_AddNext(f_tile, f_fmt)) == 0 ) {
-                    f_fmt = NULL;
-                    if( (rc = SRASplitterFactory_AddNext(f_lane, f_tile)) == 0 ) {
-                        f_tile = NULL;
-                        *factory = f_lane;
-                    }
-                }
-            }
-        }
-    }
-    if( rc != 0 ) {
-        SRASplitterFactory_Release(f_lane);
-        SRASplitterFactory_Release(f_tile);
-        SRASplitterFactory_Release(f_fmt);
-    }
-    return rc;
-}
-
-/* main entry point of the file */
-rc_t SRADumper_Init(SRADumperFmt* fmt)
-{
-    static const SRADumperFmt_Arg arg[] =
-        {
-            {"r", "read", NULL, {"Output READ: \"seq\", default is on", NULL}},
-            {"q", "qual1", "1|2", {"Output QUALITY, whole spot (1) or split by reads (2): \"qcal\", default is 1", NULL}},
-            {"p", "qual4", NULL, {"Output full QUALITY: \"prb\", default is off", NULL}},
-            {"i", "intensity", NULL, {"Output INTENSITY, if present: \"int\", default is off", NULL}},
-            {"n", "noise", NULL, {"Output NOISE, if present: \"nse\", default is off", NULL}},
-            {"s", "signal", NULL, {"Output SIGNAL, if present: \"sig2\", default is off", NULL}},
-            {"x", "qseq", "1|2", {"Output QSEQ format: whole spot (1) or split by reads: \"qseq\", default is off", NULL}},
-            {NULL, NULL, NULL, {NULL}}
-        };
-
-    IlluminaArgs.opt = 0;
-
-    if( fmt == NULL ) {
-        return RC(rcExe, rcFileFormat, rcConstructing, rcParam, rcNull);
-    }
-    fmt->release = IlluminaDumper_Release;
-    fmt->arg_desc = arg;
-    fmt->add_arg = IlluminaDumper_AddArg;
-    fmt->get_factory = IlluminaDumper_Factories;
-    fmt->gzip = true;
-    fmt->bzip2 = true;
-
-    return 0;
-}
diff --git a/tools/sra-dump/sff-dump.vers b/tools/sra-dump/sff-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-dump/sff-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-dump/sff.c b/tools/sra-dump/sff.c
deleted file mode 100644
index cf39716..0000000
--- a/tools/sra-dump/sff.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <klib/log.h>
-
-#include <kapp/main.h>
-#include <sra/sradb.h>
-#include <sra/sff.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-
-#include "debug.h"
-#include "core.h"
-#include "sff-dump.vers.h"
-
-#define DATABUFFERINITSIZE 10240
-
-typedef struct SFFFormatterSplitter_struct {
-    const SFFReader* reader;
-    spotid_t spots;
-    KDataBuffer* b;
-} SFFFormatterSplitter;
-
-static const char* SFFFormatterSplitter_Dump_Ext = ".sff";
-
-static
-rc_t SFFFormatterSplitter_Dump(const SRASplitter* cself, spotid_t spot, const readmask_t* readmask)
-{
-    rc_t rc = 0;
-    SFFFormatterSplitter* self = (SFFFormatterSplitter*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcNode, rcExecuting, rcParam, rcNull);
-    } else {
-        size_t writ = 0;
-
-        if( (rc = SRASplitter_FileActivate(cself, SFFFormatterSplitter_Dump_Ext)) == 0 ) {
-            if( self->spots == 0 ) {
-                IF_BUF((SFFReaderHeader(self->reader, 0, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
-                    rc = SRASplitter_FileWrite(cself, 0, self->b->base, writ);
-                }
-            }
-            if( rc == 0 ) {
-                if( (rc = SFFReaderSeekSpot(self->reader, spot)) == 0 ) {
-                    IF_BUF((SFFReader_GetCurrentSpotData(self->reader, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
-                        rc = SRASplitter_FileWrite(cself, spot, self->b->base, writ);
-                        self->spots++;
-                    }
-                } else if( GetRCObject(rc) == rcRow && GetRCState(rc) == rcNotFound ) {
-                    SRA_DUMP_DBG (3, ("%s skipped %u row\n", __func__, spot));
-                    self->spots++;
-                    rc = 0;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SFFFormatterSplitter_Release(const SRASplitter* cself)
-{
-    rc_t rc = 0;
-    SFFFormatterSplitter* self = (SFFFormatterSplitter*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcNode, rcReleasing, rcSelf, rcNull);
-    } else if( (rc = SRASplitter_FileActivate(cself, SFFFormatterSplitter_Dump_Ext)) == 0 ) {
-        if( self->spots > 0 ) {
-            size_t writ = 0;
-            /* tweak SFF file header with real number of reads per file */
-            IF_BUF((SFFReaderHeader(self->reader, self->spots, self->b->base, KDataBufferBytes(self->b), &writ)), self->b, writ) {
-                rc = SRASplitter_FileWritePos(cself, 0, 0, self->b->base, writ);
-            }
-        }
-    }
-    return rc;
-}
-
-typedef struct SFFFormatterFactory_struct {
-    const char* accession;
-    const SRATable* table;
-    const SFFReader* reader;
-    KDataBuffer kdbuf;
-} SFFFormatterFactory;
-
-static
-rc_t SFFFormatterFactory_Init(const SRASplitterFactory* cself)
-{
-    rc_t rc = 0;
-    SFFFormatterFactory* self = (SFFFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = KDataBufferMakeBytes(&self->kdbuf, DATABUFFERINITSIZE)) == 0 ) {
-        rc = SFFReaderMake(&self->reader, self->table, self->accession, 0, 0);
-    }
-    return rc;
-}
-
-static
-rc_t SFFFormatterFactory_NewObj(const SRASplitterFactory* cself, const SRASplitter** splitter)
-{
-    rc_t rc = 0;
-    SFFFormatterFactory* self = (SFFFormatterFactory*)cself;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcType, rcExecuting, rcParam, rcNull);
-    } else {
-        if( (rc = SRASplitter_Make(splitter, sizeof(SFFFormatterSplitter), NULL, NULL, SFFFormatterSplitter_Dump, SFFFormatterSplitter_Release)) == 0 ) {
-            ((SFFFormatterSplitter*)(*splitter))->reader = self->reader;
-            ((SFFFormatterSplitter*)(*splitter))->b = &self->kdbuf;
-        }
-    }
-    return rc;
-}
-
-static
-void SFFFormatterFactory_Release(const SRASplitterFactory* cself)
-{
-    if( cself != NULL ) {
-        SFFFormatterFactory* self = (SFFFormatterFactory*)cself;
-        KDataBufferWhack(&self->kdbuf);
-        SFFReaderWhack(self->reader);
-    }
-}
-
-static
-rc_t SFFFormatterFactory_Make(const SRASplitterFactory** cself, const char* accession, const SRATable* table)
-{
-    rc_t rc = 0;
-    SFFFormatterFactory* obj = NULL;
-
-    if( cself == NULL || accession == NULL || table == NULL ) {
-        rc = RC(rcSRA, rcType, rcConstructing, rcParam, rcNull);
-    } else if( (rc = SRASplitterFactory_Make(cself, eSplitterFormat, sizeof(*obj),
-                                             SFFFormatterFactory_Init,
-                                             SFFFormatterFactory_NewObj,
-                                             SFFFormatterFactory_Release)) == 0 ) {
-        obj = (SFFFormatterFactory*)*cself;
-        obj->accession = accession;
-        obj->table = table;
-    }
-    return rc;
-}
-
-/* ### External entry points ##################################################### */
-const char UsageDefaultName[] = "sff-dump";
-rc_t CC UsageSummary (const char * progname)
-{
-    return 0;
-}
-
-
-ver_t CC KAppVersion( void )
-{
-    return SFF_DUMP_VERS;
-}
-
-rc_t SFFDumper_Factories(const SRADumperFmt* fmt, const SRASplitterFactory** factory)
-{
-    if( fmt == NULL || factory == NULL ) {
-        return RC(rcExe, rcFormatter, rcReading, rcParam, rcInvalid);
-    }
-    *factory = NULL;
-    return SFFFormatterFactory_Make(factory, fmt->accession, fmt->table);
-}
-
-/* main entry point of the file */
-rc_t SRADumper_Init(SRADumperFmt* fmt)
-{
-    if( fmt == NULL ) {
-        return RC(rcExe, rcFileFormat, rcConstructing, rcParam, rcNull);
-    }
-    fmt->release = NULL;
-    fmt->arg_desc = NULL;
-    fmt->add_arg = NULL;
-    fmt->get_factory = SFFDumper_Factories;
-    fmt->gzip = false;
-    fmt->bzip2 = false;
-
-    return 0;
-}
diff --git a/tools/sra-dump/sra-dump.c b/tools/sra-dump/sra-dump.c
deleted file mode 100644
index 8355511..0000000
--- a/tools/sra-dump/sra-dump.c
+++ /dev/null
@@ -1,1029 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "sra-dump.vers.h"
-
-#include <sra/sradb.h>
-#include <sra/srapath.h>
-#include <sra/types.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef struct sradump_parms sradump_parms;
-struct sradump_parms
-{
-    const char *src_path;
-
-    const char **columns;
-    uint32_t column_cnt;
-
-    spotid_t start, stop;
-};
-
-typedef struct column_map column_map;
-struct column_map
-{
-    const char *name;
-    void ( * dump ) ( const void *base, bitsz_t row_bits );
-    const SRAColumn *col;
-    VTypedecl td;
-    uint32_t elem_size;
-};
-
-/* dump_row
- */
-static
-void dump_text ( const void *base, bitsz_t row_bits )
-{
-    const unsigned char *data = base;
-    uint32_t i, count = row_bits >> 3;
-
-    for ( i = 0; i < count; ++ i )
-  {
-        if ( isprint ( data [ i ] ) )
-            OUTMSG(( "%c", data [ i ] ));
-        else
-            OUTMSG(( "\\x%2x", data [ i ] ));
-    }
-}
-
-static
-void dump_I8 ( const void *base, bitsz_t row_bits )
-{
-    const int8_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 3;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%d", sep, data [ i ] ));
-}
-
-static
-void dump_U8 ( const void *base, bitsz_t row_bits )
-{
-    const uint8_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 3;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%u", sep, data [ i ] ));
-}
-
-static
-void dump_I16 ( const void *base, bitsz_t row_bits )
-{
-    const int16_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 4;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%d", sep, data [ i ] ));
-}
-
-static
-void dump_U16 ( const void *base, bitsz_t row_bits )
-{
-    const uint16_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 4;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%u", sep, data [ i ] ));
-}
-
-static
-void dump_I32 ( const void *base, bitsz_t row_bits )
-{
-    const int32_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 5;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%d", sep, data [ i ] ));
-}
-
-static
-void dump_U32 ( const void *base, bitsz_t row_bits )
-{
-    const uint32_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 5;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%u", sep, data [ i ] ));
-}
-
-static
-void dump_I64 ( const void *base, bitsz_t row_bits )
-{
-    const int64_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 6;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%ld", sep, data [ i ] ));
-}
-
-static
-void dump_U64 ( const void *base, bitsz_t row_bits )
-{
-    const uint64_t *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 6;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%lu", sep, data [ i ] ));
-}
-
-static
-void dump_F32 ( const void *base, bitsz_t row_bits )
-{
-    const float *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 5;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%f", sep, data [ i ] ));
-}
-
-static
-void dump_F64 ( const void *base, bitsz_t row_bits )
-{
-    const double *data = base;
-    const char *sep = "";
-    uint32_t i, count = row_bits >> 6;
-
-    for ( i = 0; i < count; sep = ",", ++ i )
-        OUTMSG(( "%s%f", sep, data [ i ] ));
-}
-
-
-#define CASE( x ) \
-    case x: p = # x; break
-
-static
-void dump_platform ( const void *base, bitsz_t row_bits )
-{
-    const char *p = NULL;
-    const uint8_t *data = base;
-    if ( row_bits == 8 ) switch ( data [ 0 ] )
-    {
-    CASE ( SRA_PLATFORM_UNDEFINED );
-    CASE ( SRA_PLATFORM_454 );
-    CASE ( SRA_PLATFORM_ILLUMINA );
-    CASE ( SRA_PLATFORM_ABSOLID );
-    CASE ( SRA_PLATFORM_COMPLETE_GENOMICS );
-    CASE ( SRA_PLATFORM_HELICOS );
-    default:
-        OUTMSG(( "%u", data [ 0 ] ));
-        return;
-    }
-    OUTMSG(( "%s", p ));
-}
-
-static
-void dump_readtype ( const void *base, bitsz_t row_bits )
-{
-    const char *sep = "";
-    const uint8_t *data = base;
-    uint32_t i, count = row_bits >> 3;
-    for ( i = 0; i < count; sep = ",", ++ i )
-    {
-        const char *p;
-        switch ( data [ i ] )
-        {
-        CASE ( SRA_READ_TYPE_TECHNICAL );
-        CASE ( SRA_READ_TYPE_BIOLOGICAL );
-        CASE ( SRA_READ_TYPE_TECHNICAL|SRA_READ_TYPE_FORWARD );
-        CASE ( SRA_READ_TYPE_BIOLOGICAL|SRA_READ_TYPE_FORWARD );
-        CASE ( SRA_READ_TYPE_TECHNICAL|SRA_READ_TYPE_REVERSE );
-        CASE ( SRA_READ_TYPE_BIOLOGICAL|SRA_READ_TYPE_REVERSE );
-        default:
-            OUTMSG(( "%s%u", sep, data [ 0 ] ));
-            continue;
-        }
-        OUTMSG(( "%s%s", sep, p ));
-    }
-}
-
-static
-void dump_readfilt ( const void *base, bitsz_t row_bits )
-{
-    const char *sep = "";
-    const uint8_t *data = base;
-    uint32_t i, count = row_bits >> 3;
-    for ( i = 0; i < count; sep = ",", ++ i )
-    {
-        const char *p;
-        switch ( data [ i ] )
-        {
-        CASE ( SRA_READ_FILTER_PASS );
-        CASE ( SRA_READ_FILTER_REJECT );
-        CASE ( SRA_READ_FILTER_CRITERIA );
-        CASE ( SRA_READ_FILTER_REDACTED );
-        default:
-            OUTMSG(( "%s%u", sep, data [ 0 ] ));
-            continue;
-        }
-        OUTMSG(( "%s%s", sep, p ));
-    }
-}
-
-#undef CASE
-
-
-static
-rc_t dump_row ( const sradump_parms *pb, const column_map *cm, uint32_t count, spotid_t row )
-{
-    rc_t rc;
-    uint32_t i;
-
-    for ( rc = 0, i = 0; rc == 0 && i < count; ++ i )
-    {
-        const void *base;
-        bitsz_t boff, row_bits;
-
-        /* read data */
-        rc = SRAColumnRead ( cm [ i ] . col, row, & base, & boff, & row_bits );
-        if ( rc != 0 )
-        {
-            PLOGERR ( klogInt,  (klogInt, rc, "failed to read column '$(name)' row $(row)",
-                                 "name=%s,row=%u", cm [ i ] . name, row ));
-            break;
-        }
-
-        /* cannot deal with non-byte-aligned data */
-        if ( boff != 0 || ( row_bits & 7 ) != 0 )
-        {
-            rc = RC ( rcExe, rcColumn, rcReading, rcType, rcUnsupported );
-            PLOGERR ( klogInt,  (klogInt, rc, "non-byte-aligned data in column '$(name)' row $(row)",
-                                 "name=%s,row=%u", cm [ i ] . name, row ));
-            break;
-        }
-
-        /* write cell header - TBD - improve column alignment for readability */
-        OUTMSG(( "%u. %s: ", row, cm [ i ] . name ));
-
-        /* write cell data */
-        if ( cm [ i ] . td . dim == 1 )
-            ( cm [ i ] . dump ) ( base, row_bits );
-        else
-        {
-            const char *sep;
-            const uint8_t *data = base;
-            uint32_t elem_bits = cm [ i ] . elem_size;
-            uint32_t j, row_len = ( uint32_t ) ( row_bits / elem_bits );
-
-            for ( sep = "{", j = 0; j < row_len; sep = "},{", ++ j )
-            {
-                OUTMSG(( "%s", sep ));
-                ( cm [ i ] . dump ) ( & data [ j * elem_bits >> 3 ], elem_bits );
-            }
-
-            OUTMSG(( "}" ));
-        }
-
-        OUTMSG(( "\n" ));
-    }
-
-    return rc;
-}
-
-static
-rc_t dump_table ( const sradump_parms *pb, const column_map *cm, uint32_t count )
-{
-    rc_t rc;
-    spotid_t row;
-
-    for ( rc = 0, row = pb -> start; row <= pb -> stop; ++ row )
-    {
-        rc = Quitting();
-        if ( rc != 0 )
-            break;
-        rc = dump_row ( pb, cm, count, row );
-        if ( rc != 0 )
-            break;
-    }
-
-    return rc;
-}
-
-static
-const char *s_454_default [] =
-{
-    "(INSDC:SRA:platform_id)PLATFORM",
-    "(U8)NREADS",
-    "(INSDC:SRA:xread_type)READ_TYPE",
-    "(NCBI:SRA:Segment)READ_SEG",
-    "(NCBI:SRA:Segment)LABEL_SEG",
-    "(ascii)LABEL",
-    "(INSDC:SRA:read_filter)READ_FILTER",
-    "(ascii)SPOT_GROUP",
-
-    "(INSDC:dna:text)FLOW_CHARS",
-    "(INSDC:dna:text)KEY_SEQUENCE",
-    "(INSDC:dna:text)LINKER_SEQUENCE",
-    "(INSDC:dna:text)READ",
-    "(INSDC:quality:phred)QUALITY",
-    "(INSDC:coord:one)CLIP_ADAPTER_LEFT",
-    "(INSDC:coord:one)CLIP_ADAPTER_RIGHT",
-    "(INSDC:coord:one)CLIP_QUALITY_LEFT",
-    "(INSDC:coord:one)CLIP_QUALITY_RIGHT",
-    "(NCBI:isamp1)SIGNAL",
-    "(INSDC:position:one)POSITION"
-};
-
-static
-const char *s_Illumina_default [] =
-{
-    "(INSDC:SRA:platform_id)PLATFORM"
-    , "(U8)NREADS"
-    , "(INSDC:SRA:xread_type)READ_TYPE"
-    , "(NCBI:SRA:Segment)READ_SEG"
-    , "(NCBI:SRA:Segment)LABEL_SEG"
-    , "(ascii)LABEL"
-    , "(INSDC:SRA:read_filter)READ_FILTER"
-    , "(ascii)SPOT_GROUP"
-
-    , "(INSDC:dna:text)READ"
-    , "(NCBI:qual4)QUALITY:QUALITY"
-    , "(INSDC:quality:phred)PHYS_QUALITY:QUALITY"
-    , "(INSDC:quality:phred)QUALITY2"
-#if ENABLE_INTENSITY_COPY
-    , "(NCBI:fsamp4)INTENSITY"
-#endif
-};
-
-static
-const char *s_ABI_default [] =
-{
-    " (INSDC:SRA:platform_id)PLATFORM"
-    , "(U8)NREADS"
-    , "(INSDC:SRA:xread_type)READ_TYPE"
-    , "(NCBI:SRA:Segment)READ_SEG"
-    , "(NCBI:SRA:Segment)LABEL_SEG"
-    , "(ascii)LABEL"
-    , "(INSDC:SRA:read_filter)READ_FILTER"
-    , "(ascii)SPOT_GROUP"
-
-    , "(INSDC:dna:text)CS_KEY"
-    , "(INSDC:color:text)CSREAD"
-    , "(INSDC:quality:phred)QUALITY"
-#if ENABLE_INTENSITY_COPY
-    , "(NCBI:fsamp4)SIGNAL"
-#endif
-};
-
-static
-const char *s_fastq_default [] =
-{
-    "(INSDC:SRA:platform_id)PLATFORM",
-    "(U8)NREADS",
-    "(INSDC:SRA:xread_type)READ_TYPE",
-    "(NCBI:SRA:Segment)READ_SEG",
-    "(NCBI:SRA:Segment)LABEL_SEG",
-    "(ascii)LABEL",
-    "(INSDC:SRA:read_filter)READ_FILTER",
-    "(ascii)SPOT_GROUP",
-
-    "(INSDC:dna:text)READ",
-    "(INSDC:quality:phred)QUALITY"
-};
-
-static
-rc_t get_default_columns ( sradump_parms *pb, const SRATable *tbl )
-{
-    const SRAColumn *col;
-    rc_t rc = SRATableOpenColumnRead ( tbl, & col, "PLATFORM", sra_platform_id_t );
-    if ( rc != 0 )
-        LOGERR ( klogInt, rc, "failed to determine table platform" );
-    else
-    {
-        const void *base;
-        bitsz_t boff, row_bits;
-        rc = SRAColumnRead ( col, 1, & base, & boff, & row_bits );
-        if ( rc != 0 )
-            LOGERR ( klogInt, rc, "failed to read table platform" );
-        else if ( boff != 0 || ( row_bits & 7 ) != 0 )
-        {
-            rc = RC ( rcExe, rcColumn, rcReading, rcData, rcCorrupt );
-            PLOGERR ( klogInt,  (klogInt, rc, "bit offset $(boff), row bits $(bits)",
-                                 "boff=%u,bits=%u", ( uint32_t ) boff, ( uint32_t ) row_bits ));
-        }
-        else
-        {
-            const uint8_t *platform_id = base;
-            switch ( platform_id [ 0 ] )
-            {
-            case SRA_PLATFORM_UNDEFINED:
-                rc = RC ( rcExe, rcTable, rcReading, rcType, rcInvalid );
-                LOGERR ( klogInt, rc, "table platform undefined" );
-                break;
-            case SRA_PLATFORM_454:
-                pb -> columns = s_454_default;
-                pb -> column_cnt = sizeof s_454_default / sizeof s_454_default [ 0 ];
-                break;
-            case SRA_PLATFORM_ILLUMINA:
-                pb -> columns = s_Illumina_default;
-                pb -> column_cnt = sizeof s_Illumina_default / sizeof s_Illumina_default [ 0 ];
-                break;
-            case SRA_PLATFORM_ABSOLID:
-                pb -> columns = s_ABI_default;
-                pb -> column_cnt = sizeof s_ABI_default / sizeof s_ABI_default [ 0 ];
-                break;
-            default:
-                pb -> columns = s_fastq_default;
-                pb -> column_cnt = sizeof s_fastq_default / sizeof s_fastq_default [ 0 ];
-            }
-        }
-
-        SRAColumnRelease ( col );
-    }
-
-    return rc;
-}
-
-
-typedef struct basetype basetype;
-struct basetype
-{
-    BSTNode n;
-    void ( * dump ) ( const void *base, bitsz_t row_bits );
-    uint32_t type_id;
-};
-
-static
-void CC basetype_whack ( BSTNode *n, void *ignore )
-{
-    free ( n );
-}
-
-static
-int CC basetype_cmp ( const void *item, const BSTNode *n )
-{
-    const VTypedecl *td = item;
-    const basetype *bt = ( const basetype* ) n;
-
-    if ( td -> type_id < bt -> type_id )
-        return -1;
-    return td -> type_id - bt -> type_id;
-}
-
-static
-int CC basetype_sort ( const BSTNode *item, const BSTNode *n )
-{
-    const basetype *td = ( const basetype* ) item;
-    const basetype *bt = ( const basetype* ) n;
-
-    if ( td -> type_id < bt -> type_id )
-        return -1;
-    return td -> type_id - bt -> type_id;
-}
-
-static
-rc_t build_basetypes ( BSTree *ttree, const VDatatypes *dt )
-{
-    struct
-    {
-        const char *name;
-        void ( * dump ) ( const void *base, bitsz_t row_bits );
-    }
-    types [] =
-    {
-        { "I8", dump_I8 },
-        { "U8", dump_U8 },
-        { "I16", dump_I16 },
-        { "U16", dump_U16 },
-        { "I32", dump_I32 },
-        { "U32", dump_U32 },
-        { "I64", dump_I64 },
-        { "U64", dump_U64 },
-        { "F32", dump_F32 },
-        { "F64", dump_F64 },
-        { "utf8", dump_text },
-        { "ascii", dump_text },
-
-        /* special case types */
-        { "INSDC:SRA:platform_id", dump_platform },
-        { "NCBI:SRA:platform_id", dump_platform },
-        { "INSDC:SRA:xread_type", dump_readtype },
-        { "INSDC:SRA:read_type", dump_readtype },
-        { "NCBI:SRA:read_type", dump_readtype },
-        { "INSDC:SRA:read_filter", dump_readfilt },
-        { "NCBI:SRA:read_filter", dump_readfilt }
-    };
-
-    rc_t rc;
-    uint32_t i, count = sizeof types / sizeof types [ 0 ];
-
-    BSTreeInit ( ttree );
-
-    for ( rc = 0, i = 0; i < count; ++ i )
-    {
-        VTypedef def;
-        basetype *bt = malloc ( sizeof * bt );
-        if ( bt == NULL )
-        {
-            rc = RC ( rcExe, rcType, rcAllocating, rcMemory, rcExhausted );
-            LOGERR ( klogSys, rc, "failed to populate basetypes table" );
-            break;
-        }
-        rc = VDatatypesResolveTypename ( dt, & def, types [ i ] . name );
-        if ( rc != 0 )
-        {
-            free ( bt );
-            PLOGERR ( klogInt,  (klogInt, rc, "failed to resolve typename '$(typename)'",
-                                 "typename=%s", types [ i ] . name ));
-            break;
-        }
-
-        bt -> dump = types [ i ] . dump;
-        bt -> type_id = def . type_id;
-
-        BSTreeInsert ( ttree, & bt -> n, basetype_sort );
-    }
-
-    return rc;
-}
-
-static
-rc_t open_column ( const VDatatypes *dt, const SRATable *tbl,
-    const BSTree *ttree, column_map *cm, const char *colspec )
-{
-    rc_t rc;
-    VTypedef def;
-
-    int len;
-    const char *iname;
-    char inamebuff [ 128 ];
-
-    /* convert column spec to typedecl and name */
-    char tdbuffer [ 128 ];
-    const char *typedecl = NULL;
-    const char *end = strchr ( colspec, ')' );
-    if ( end != NULL )
-    {
-        const char *begin = strchr ( colspec, '(' );
-        if ( begin != NULL && begin < end )
-        {
-            /* the colspec is now the name */
-            colspec = end;
-
-            /* trim whitespace */
-            while ( isspace ( ( ++ colspec ) [ 0 ] ) )
-                ( void ) 0;
-            while ( ++ begin < end && isspace ( begin [ 0 ] ) )
-                ( void ) 0;
-            while ( begin < end && isspace ( end [ -1 ] ) )
-                -- end;
-
-            /* create a copy to allow for a NUL byte */
-            len = snprintf ( tdbuffer, sizeof tdbuffer,
-                "%.*s", ( int ) ( end - begin ), begin );
-            if ( len < 0 || len >= sizeof tdbuffer )
-            {
-                rc = RC ( rcExe, rcColumn, rcOpening, rcString, rcExcessive );
-                return rc;
-            }
-
-            typedecl = tdbuffer;
-        }
-    }
-
-    /* convert name to iname and extname */
-    iname = colspec;
-    colspec = strchr ( colspec, ':' );
-    if ( colspec == NULL )
-        colspec = iname;
-    else
-    {
-        len = snprintf ( inamebuff, sizeof inamebuff, "%.*s",
-                         ( int ) ( colspec - iname ), iname );
-        if ( len < 0 || len >= sizeof inamebuff )
-        {
-            rc = RC ( rcExe, rcColumn, rcOpening, rcString, rcExcessive );
-            return rc;
-        }
-
-        iname = inamebuff;
-        ++ colspec;
-    }
-
-    /* record the name */
-    cm -> name = colspec;
-
-    /* open the column */
-    rc = SRATableOpenColumnRead ( tbl, & cm -> col, iname, typedecl );
-    if ( rc != 0 )
-        return rc;
-
-    /* read its datatype */
-    rc = SRAColumnDatatype ( cm -> col, & cm -> td, & def );
-    if ( rc == 0 )
-    {
-        const basetype *bt;
-
-        /* get its element size */
-        cm -> elem_size = VTypedefSizeof ( & def ) * cm -> td . dim;
-
-        /* try to find the actual type */
-        bt = ( const basetype* ) BSTreeFind ( ttree, & cm -> td, basetype_cmp );
-        if ( bt == NULL )
-        {
-            /* find the intrinsic type
-               NB - this code treats ascii as intrinsic */
-            rc = VDatatypesToIntrinsic ( ( const VDatatypes*) SRATableGetSchema(tbl), & cm -> td );
-            if ( rc == 0 )
-                bt = ( const basetype* ) BSTreeFind ( ttree, & cm -> td, basetype_cmp );
-        }
-         
-        if ( bt == NULL )
-            rc = RC ( rcExe, rcColumn, rcOpening, rcType, rcUnsupported );
-        else
-        {
-            cm -> dump = bt -> dump;
-            return 0;
-        }
-    }
-
-    SRAColumnRelease ( cm -> col );
-    cm -> col = NULL;
-    return rc;
-}
-
-static
-rc_t sra_dump ( sradump_parms *pb, const VDatatypes *dt, const SRATable *tbl )
-{
-    BSTree ttree;
-    rc_t rc = build_basetypes ( & ttree, dt );
-    if ( rc == 0 )
-    {
-        if ( pb -> column_cnt == 0 )
-            rc = get_default_columns ( pb, tbl );
-        if ( rc == 0 )
-        {
-            uint32_t count = pb -> column_cnt;
-            const char **columns = pb -> columns;
-            column_map *cm = malloc ( sizeof * cm * count );
-            if ( cm == NULL )
-                rc = RC ( rcExe, rcTable, rcReading, rcMemory, rcExhausted );
-            else
-            {
-
-                uint32_t i;
-                uint32_t count2 = count;
-                
-                for ( i = count = 0; rc == 0 && i < count2; ++ i )
-                {
-                    rc = open_column ( dt,  tbl, & ttree, & cm [ count ], columns [ i ] );
-                    if ( rc == 0 )
-                        ++ count;
-                    else switch ( GetRCState ( rc ) )
-                    {
-                    case rcNotFound:
-                    case rcUnsupported:
-                    case rcExcessive:
-                        rc = 0;
-                        break;
-                    default:
-                        break;
-                    }
-                }
-
-                if ( rc == 0 )
-                {
-                    spotid_t max_spot;
-                    rc = SRATableMaxSpotId ( tbl, & max_spot );
-                    if ( rc != 0 )
-                        LOGERR ( klogInt, rc, "failed to read max spot id" );
-                    else
-                    {
-                        if ( pb -> start == 0 )
-                            pb -> start = 1;
-                        if ( pb -> stop == 0 || pb -> stop > max_spot )
-                            pb -> stop = max_spot;
-
-                        rc = dump_table ( pb, cm, count );
-                    }
-                }
-
-                for ( i = 0; i < count; ++ i )
-                    SRAColumnRelease ( cm [ i ] . col );
-
-                free (cm);
-            }
-        }
-
-        BSTreeWhack ( & ttree, basetype_whack, NULL );
-    }
-    return rc;
-}
-
-static
-rc_t run ( sradump_parms *pb )
-{
-    const SRAMgr *mgr;
-    rc_t rc = SRAMgrMakeRead ( & mgr );
-    if ( rc != 0 )
-        LOGERR ( klogInt, rc, "failed to open SRAMgr" );
-    else
-    {
-        const VDatatypes *dt;
-        rc = SRAMgrOpenDatatypesRead ( mgr, & dt );
-        if ( rc != 0 )
-            LOGERR ( klogInt, rc, "failed to open VDatatypes" );
-        else
-        {
-            const SRATable *tbl;
-            rc = SRAMgrOpenTableRead ( mgr, & tbl, pb -> src_path );
-            if ( rc != 0 )
-                PLOGERR ( klogInt,
-                          ( klogInt, rc, "failed to open SRATable '$(spec)'", "spec=%s", pb -> src_path));
-            else
-            {
-                rc = sra_dump ( pb, dt, tbl );
-                SRATableRelease ( tbl );
-            }
-
-            VDatatypesRelease ( dt );
-        }
-
-        SRAMgrRelease ( mgr );
-    }
-
-    return rc;
-}
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-uint32_t CC KAppVersion ( void )
-{
-    return SRA_DUMP_VERS;
-}
-
-
-/* Usage
- */
-static
-KLogLevel default_log_level;
-
-
-#define OPTION_START "start"
-#define OPTION_STOP  "stop"
-#define ALIAS_START ""
-#define ALIAS_STOP  ""
-
-static const
-char * start_usage[] =
-{
-    "beginning spot id (default 1)", NULL
-};
-
-
-static const
-char * stop_usage[] =
-{
-    "ending spot id (default max)", NULL
-};
-
-
-static
-OptDef Options[] = 
-{
-    { OPTION_START, ALIAS_START, NULL, start_usage, 1, true, false},
-    { OPTION_STOP,  ALIAS_STOP,  NULL, stop_usage,  1, true, false}
-};
-    
-   
-const char UsageDefaultName[] = "sra-dump";
-
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [ options ] table [ column-spec ... ]\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Dump all data in table for specified or all columns\n"
-                    "\n", progname );
-}
-
-static
-const char * name_param[] =
-{
-    "NAME", "simple column name", NULL
-};
-
-
-static
-const char * typedecl_param[] =
-{
-    "(typedecl)NAME", "specifically typed column name", NULL
-};
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    OUTMSG (( "Options:\n" ));
-
-    OUTMSG (("table:\n"
-	     "  path to table or accession id within NCBI\n"
-             "\n"
-             "column-spec:\n"));
-
-    HelpParamLine (name_param[0], name_param+1);
-    HelpParamLine (typedecl_param[0], typedecl_param+1);
-
-    OUTMSG (( "\nOptions:\n" ));
-
-    HelpOptionLine (ALIAS_START, OPTION_START, "ID", start_usage);
-
-    HelpOptionLine (ALIAS_STOP, OPTION_STOP, "ID", stop_usage);
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    default_log_level = KLogLevelGet();
-
-    rc = KStsHandlerSetStdErr();
-    if (rc)
-        return rc;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc == 0)
-    {
-        do
-        {
-            uint32_t pcount;
-
-            sradump_parms pb;
-
-            memset (&pb, 0, sizeof pb);
-
-            rc = ArgsOptionCount (args, OPTION_START, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                const char * pc;
-
-                rc = ArgsOptionValue (args, OPTION_START, 0, &pc);
-                if (rc)
-                    break;
-
-                pb.start = AsciiToU32 (pc, NULL, NULL);
-            }
-
-            rc = ArgsOptionCount (args, OPTION_STOP, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                const char * pc;
-
-                rc = ArgsOptionValue (args, OPTION_STOP, 0, &pc);
-                if (rc)
-                    break;
-
-                pb.stop = AsciiToU32 (pc, NULL, NULL);
-            }
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 0) {
-                OUTMSG (("missing source table\n"));
-                rc = MiniUsage (args);
-                ArgsWhack(args);
-                exit(EXIT_FAILURE);
-            }
-
-            rc = ArgsParamValue (args, 0, &pb.src_path);
-            if (rc)
-                break;
-
-            pb.column_cnt = pcount - 1; /* pcount is used below */
-
-            if (pb.column_cnt) {
-                pb.columns = malloc (pb.column_cnt * sizeof (const char *));
-                if (pb.columns == NULL)
-                    rc = RC (rcExe, rcArgv, rcParsing, rcMemory, rcExhausted);
-            }
-            else
-                pb.columns = NULL;
-
-            {
-                uint32_t ix;
-                const char ** ppc;
-
-                ppc = pb.columns;
-                for (ix = 1; ix < pcount; ix++)
-                {
-                    rc = ArgsParamValue (args, ix, ppc);
-                    if (rc)
-                        break;
-                    ppc++;
-                }
-
-                if (rc == 0)
-                {
-                    rc = run (&pb);
-                }
-
-                if ( pcount != 1 )
-                    /* brain damaged windows compiler warned about next line */
-                    free ( (void*)pb.columns );
-            }
-        } while (0);
- 
-        ArgsWhack (args);
-    }
-    return rc;
-}
-
-
diff --git a/tools/sra-dump/sra-dump.vers b/tools/sra-dump/sra-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-dump/sra-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/Makefile b/tools/sra-load/Makefile
deleted file mode 100644
index 3743ab8..0000000
--- a/tools/sra-load/Makefile
+++ /dev/null
@@ -1,209 +0,0 @@
-# ==============================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-load
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	fastq-load \
-	illumina-load \
-	srf-load \
-	abi-load \
-	sff-load \
-	helicos-load
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-ifeq (win,$(OS))
-all std:
-	@ echo "not building loaders under Windows"
-else
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-endif
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-	@ rm -f *.vers.h
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_TOOLS))
-
-#-------------------------------------------------------------------------------
-# loader
-#
-LOADER_SRC = \
-	pstring \
-	common-xml \
-	experiment-xml \
-	run-xml \
-	loader-file \
-	loader-fmt \
-	sra-writer \
-	loader
-
-LOADER_OBJ = \
-	$(addsuffix .$(OBJX),$(LOADER_SRC))
-
-LOADER_LIB = \
-	-lkapp \
-	-lload \
-	-lncbi-wvdb \
-	$(LIBXML) \
-	-lm
-
-
-#------------------------------------------------------------------------------
-# sff-load
-#
-SFF_LOAD_SRC = \
-	$(LOADER_SRC) \
-	writer-454 \
-	writer-ion-torrent \
-	sff-fmt
-
-SFF_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(SFF_LOAD_SRC))
-
-$(BINDIR)/sff-load: $(SFF_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
-
-#------------------------------------------------------------------------------
-# fastq-load
-#
-FASTQ_LOAD_SRC = \
-	$(LOADER_SRC) \
-	writer-illumina \
-	writer-454 \
-	writer-ion-torrent \
-	fastq-fmt
-
-FASTQ_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(FASTQ_LOAD_SRC))
-
-$(BINDIR)/fastq-load: $(FASTQ_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
-
-#------------------------------------------------------------------------------
-# srf-load
-#
-SRF_LOAD_SRC = \
-	$(LOADER_SRC) \
-	srf \
-	srf-fmt \
-	writer-illumina \
-	ztr-illumina \
-	srf-illumina \
-	writer-absolid \
-	ztr-absolid \
-	ztr-huffman \
-	srf-absolid
-
-SRF_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(SRF_LOAD_SRC))
-
-$(BINDIR)/srf-load: $(SRF_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
-
-#------------------------------------------------------------------------------
-# abi-load
-#
-ABSOLID_LOAD_SRC = \
-	$(LOADER_SRC) \
-	writer-absolid \
-	absolid-fmt
-
-ABSOLID_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(ABSOLID_LOAD_SRC))
-
-$(BINDIR)/abi-load: $(ABSOLID_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
-
-#------------------------------------------------------------------------------
-# illumina-load
-#
-ILLUMINA_LOAD_SRC = \
-	$(LOADER_SRC) \
-	writer-illumina \
-	illumina-fmt
-
-ILLUMINA_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(ILLUMINA_LOAD_SRC))
-
-$(BINDIR)/illumina-load: $(ILLUMINA_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
-
-#------------------------------------------------------------------------------
-# helicos-load
-#
-HELICOS_LOAD_SRC = \
-	$(LOADER_SRC) \
-	writer-helicos \
-	helicos-fmt
-
-HELICOS_LOAD_OBJ = \
-	$(addsuffix .$(OBJX),$(HELICOS_LOAD_SRC))
-
-$(BINDIR)/helicos-load: $(HELICOS_LOAD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(LOADER_LIB)
diff --git a/tools/sra-load/abi-load.vers b/tools/sra-load/abi-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/abi-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/absolid-fmt.c b/tools/sra-load/absolid-fmt.c
deleted file mode 100644
index f8b5186..0000000
--- a/tools/sra-load/absolid-fmt.c
+++ /dev/null
@@ -1,579 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <kapp/main.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-
-typedef struct AbiLoaderFmt AbiLoaderFmt;
-#define SRALOADERFMT_IMPL AbiLoaderFmt
-#include "loader-fmt.h"
-
-#include "pstring.h"
-#include "writer-absolid.h"
-#include "abi-load.vers.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <assert.h>
-
-typedef enum EFileType_enum {
-    eNotSet = -1,
-    eCSFasta,
-    eQuality,
-    eSignalFTC,
-    eSignalCY3,
-    eSignalTXR,
-    eSignalCY5,
-    eFileTypeMax
-} EFileType;
-
-typedef struct AbiFileInfo_struct {
-    /* parsed data from file for a single spot */
-    bool ready; /* if data is filled from file */
-    /* header */
-    EFileType file_type;
-    pstring name_prefix;
-    /* spot data */
-    EAbisolidReadType read_type;
-    pstring name; /* name suffix */
-    long coord[3]; /* panel, x, y - sort-merge keys */
-    pstring data;
-    char cs_key; /* only for csfasta file type */
-
-    const SRALoaderFile* file;
-    /* file line buffer */
-    const char* line; /* not NULL if contains unprocessed data */
-    size_t line_len;
-} AbiFileInfo;
-
-struct AbiLoaderFmt {
-    SRALoaderFmt dad;
-    bool skip_signal;
-    const SRAWriteAbsolid* writer;
-    AbsolidRead read[ABSOLID_FMT_MAX_NUM_READS];
-};
-
-static
-void AbiFileInfo_init(AbiFileInfo* file)
-{
-    file->ready = false;
-    file->read_type = eAbisolidReadType_Unknown;
-    pstring_clear(&file->name);
-    memset(file->coord, 0, sizeof(file->coord));
-    pstring_clear(&file->data);
-    file->cs_key = '\0';
-}
-
-/* reads 1 line from given file
- * if file->line pointer is not NULL line is in buffer already, nothing is read
- * failes on error or if line empty and not optional
- */
-static
-rc_t file_read_line(AbiFileInfo* file, bool optional)
-{
-    rc_t rc = 0;
-
-    if( file->line == NULL ) {
-        if( (rc = SRALoaderFileReadline(file->file, (const void**)&file->line, &file->line_len)) == 0 ) {
-            if( file->line == NULL || file->line_len == 0 ) {
-                if( !optional ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcString, rcInsufficient);
-                }
-            }
-            if( rc == 0 && file->line != NULL ) {
-                if( file->line_len > 0 ) {
-                    const char* e = file->line + file->line_len;
-                    /* right trim */
-                    while( --e >= file->line ) {
-                        if( !isspace(*e) ) {
-                            break;
-                        }
-                        file->line_len--;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-bool is_csfasta(const char* str, const size_t len)
-{
-    const char* s = str, *end = s + len;
-
-    if( s == end || strchr("ACGTacgt", *s++) == NULL ) {
-        return false;
-    }
-    while( s != end ) {
-        if( strchr("0123.", *s++) == NULL ) {
-            return false;
-        }
-    }
-    return true;
-}
-
-static
-bool is_quality(const char* str, const size_t len)
-{
-    const char* s = str, *end = s + len;
-
-    while( s != end ) {
-        if( strchr("-+0123456789 ", *s++) == NULL ) {
-            return false;
-        }
-    }
-    return len != 0;
-}
-
-static
-bool is_signal(const char* str, const size_t len)
-{
-    const char* s = str, *end = s + len;
-
-    while( s != end ) {
-        if( strchr("-+.0123456789Ee ", *s++) == NULL ) {
-            return false;
-        }
-    }
-    return len != 0;
-}
-
-static
-rc_t read_signal(const char* data, size_t data_sz, pstring* str)
-{
-    rc_t rc = 0;
-    double d;
-    const char* c = data, *end = data + data_sz;
-
-    pstring_clear(str);
-    while( rc == 0 && c != end ) {
-        char* next;
-        errno = 0;
-        d = strtod(c, &next);
-        if( errno != 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcOutofrange);
-        } else if( d == 0 && c == next ) {
-            break;
-        } else {
-            float f = d;
-            c = next;
-            rc = pstring_append(str, &f, sizeof(f));
-        }
-    }
-    return rc;
-}
-
-static
-rc_t parse_suffix(const char* s, size_t len, AbiFileInfo* file)
-{
-    rc_t rc = 0;
-    int i;
-    const char* p = s, *end = p + len;
-    
-    assert(s && file);
-    while( isspace(*p) && p < end ) { ++p; }
-    if( (rc = pstring_assign(&file->name, p, end - p)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading name");
-    }
-    if( file->name.len <= 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcFile, rcInvalid);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=expected not empty name after '>'");
-    }
-    p = strrchr(file->name.data, '_');
-    if( p != NULL ) {
-        file->read_type = AbsolidRead_Suffix2ReadType(p + 1);
-    } else {
-        file->read_type = eAbisolidReadType_Unknown;
-    }
-    /* in native form each file has single read: 1st or 2nd. Can't be whole spot, so label must be always found */
-    if( file->read_type <= eAbisolidReadType_SPOT ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "read name suffix is not recognized: '$(name)'", "name=%.*s",
-                                 file->name.len, file->name.data);
-    }
-    file->name.len -= strlen(AbisolidReadType2ReadLabel[file->read_type]) + 1;
-    /* try to get panel, x, y from name, format: \D*(\d+)\D+(\d+)\D+(\d+) */
-    p = file->name.data + file->name.len;
-    for(i = 2; rc == 0 && i >= 0; i--) {
-        /* reverse parse */
-        while( !isdigit(*--p) && p >= file->name.data );
-        while( isdigit(*--p) && p >= file->name.data );
-        errno = 0;
-        file->coord[i] = strtol(p + 1, NULL, 10);
-        if( errno != 0 ) {
-            file->coord[i] =  0;
-        }
-    }
-    return rc;
-}
-
-/* reads from a file data for a sinlge spot, data may be partial */
-static
-rc_t read_next_spot(AbiLoaderFmt* self, AbiFileInfo* file)
-{
-    rc_t rc = 0;
-
-    if( file->ready ) {
-        /* data still not used */
-        return 0;
-    }
-    AbiFileInfo_init(file);
-    do {
-        if( (rc = file_read_line(file, true)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading more data");
-        } else if( file->line == NULL ) {
-            return 0; /* eof */
-        }
-        if( file->line[0] != '#' ) {
-            break;
-        } else {
-            const char* p = file->line, *end = p + file->line_len;
-            while( isspace(*++p) && p < end );
-            if( strncasecmp(p, "Title:", 6) == 0 ) {
-                p += 5;
-                while( isspace(*++p) && p < end );
-                if( p < end ) {
-                    if( (rc = pstring_assign(&file->name_prefix, p, end - p)) != 0 ){
-                        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading Title");
-                    }
-                }
-            }
-            file->line = NULL;
-        }
-    } while( true );
-    if( file->line[0] != '>' ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcFile, rcInvalid);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=expected '>'");
-    } else {
-        if( (rc = parse_suffix(&file->line[1], file->line_len - 1, file)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading name suffix");
-        }
-        file->line = NULL;
-        if( (rc = file_read_line(file, false)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading data line");
-        }
-        if( file->file_type == eNotSet ) {
-            if( is_csfasta(file->line, file->line_len) ) {
-                file->file_type = eCSFasta;
-            } else if( is_quality(file->line, file->line_len) ) {
-                file->file_type = eQuality;
-            } else if( is_signal(file->line, file->line_len) ) {
-                const char* fname, *p;
-                if( (rc = SRALoaderFileName(file->file, &fname)) != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=file name");
-                }
-                /* skip path if present */
-                p = strrchr(fname, '/');
-                p = p ? p : fname;
-                if( strstr(p, "FTC") != NULL ) {
-                    file->file_type = eSignalFTC;
-                } else if( strstr(p, "CY3") != NULL ) {
-                    file->file_type = eSignalCY3;
-                } else if( strstr(p, "TXR") != NULL ) {
-                    file->file_type = eSignalTXR;
-                } else if( strstr(p, "CY5") != NULL ) {
-                    file->file_type = eSignalCY5;
-                } else {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=signal type by file name");
-                }
-            } else {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading data line");
-            }
-        }
-        switch( file->file_type ) {
-            case eCSFasta:
-                if( !is_csfasta(file->line, file->line_len) ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading csfasta");
-                }
-                file->cs_key = file->line[0];
-                if( (rc = pstring_assign(&file->data, &file->line[1], file->line_len - 1)) != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=copying csfasta");
-                }
-                break;
-            case eQuality:
-                if( (rc = pstring_assign(&file->data, file->line, file->line_len) != 0 ) ||
-                    (rc = pstring_quality_convert(&file->data, eExperimentQualityEncoding_Decimal, 0, -1, 0x7F)) != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting quality");
-                }
-                break;
-            case eSignalFTC:
-            case eSignalCY3:
-            case eSignalTXR:
-            case eSignalCY5:
-                if( (rc = read_signal(file->line, file->line_len, &file->data)) != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting signal");
-                }
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcReading, rcFileFormat, rcUnknown);
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=processing data line");
-                break;
-        }
-        file->line = NULL;
-        file->ready = true;
-    }
-#if _DEBUGGING
-    DEBUG_MSG(3, ("READ: type:%i, pfx:%s, rd_typ:%s, name:'%s', %li:%li:%li",
-                  file->file_type, file->name_prefix.data, AbisolidReadType2ReadLabel[file->read_type],
-                  file->name.data, file->coord[0], file->coord[1], file->coord[2]));
-    if( file->cs_key ) {
-        DEBUG_MSG(3, (", cs_key %c, data [%u] '%.*s'\n",
-                      file->cs_key, file->data.len, file->data.len, file->data.data));
-    } else {
-        DEBUG_MSG(3, (", data length: %u\n", file->data.len));
-    }
-#endif
-    return 0;
-}
-
-static
-rc_t AbiLoaderFmt_WriteData(AbiLoaderFmt* self, uint32_t argc, const SRALoaderFile* const argv[], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t i, origin;
-    AbiFileInfo* files = NULL;
-    bool done;
-    pstring spotname;
-
-    if( (files = calloc(argc, sizeof(*files))) == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcMemory, rcInsufficient);
-    }
-    for(i = 0; rc == 0 && i < argc; i++) {
-        AbiFileInfo* file = &files[i];
-        AbiFileInfo_init(file);
-        file->file = argv[i];
-        file->file_type = eNotSet;
-    }
-    do {
-        done = true;
-        for(i = 0; rc == 0 && i < argc; i++) {
-            AbiFileInfo* file = &files[i];
-            if( (rc = read_next_spot(self, file)) != 0 || !file->ready ) {
-                continue;
-            }
-            done = false;
-        }
-        if( rc != 0 || done ) {
-            break;
-        }
-        /* find read with min coords */
-        origin = argc;
-        for(i = 0; i < argc; i++) {
-            AbiFileInfo* file = &files[i];
-            if( file->ready && (origin == argc ||
-                                file->coord[0] < files[origin].coord[0] ||
-                                (file->coord[0] == files[origin].coord[0] &&
-                                 file->coord[1] < files[origin].coord[1]) ||
-                                (file->coord[0] == files[origin].coord[0] &&
-                                 file->coord[1] == files[origin].coord[1] &&
-                                 file->coord[2] < files[origin].coord[2]) ) ) {
-                origin = i;
-            }
-        }
-        assert(origin != argc);
-        /* collect spot reads, matching by spot name
-         * spot data may be split across multiple files
-         */
-        for(i = 0; i < sizeof(self->read) / sizeof(self->read[0]); i++) {
-            AbsolidRead_Init(&self->read[i]);
-        }
-        rc = SRAWriteAbsolid_MakeName(&files[origin].name_prefix, &files[origin].name, &spotname);
-        for(i = 0; rc == 0 && i < argc; i++) {
-            AbiFileInfo* file = &files[i];
-            if( file->ready ) {
-                pstring tmpname;
-                if( (rc = SRAWriteAbsolid_MakeName(&file->name_prefix, &file->name, &tmpname)) == 0 ) {
-                    if( pstring_cmp(&spotname, &tmpname) == 0 ) {
-                        int read_number = AbisolidReadType2ReadNumber[file->read_type];
-                        switch( file->file_type ) {
-                            case eNotSet:
-                            case eFileTypeMax:
-                                rc = RC(rcSRA, rcFormatter, rcReading, rcFileFormat, rcUnknown);
-                                SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=merging spot data");
-                                break;
-                            case eCSFasta:
-                                if( self->read[read_number].seq.len > 0 ) {
-                                    rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                    SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=sequence");
-                                } else {
-                                    self->read[read_number].cs_key = file->cs_key;
-                                    rc = pstring_copy(&self->read[read_number].seq, &file->data);
-                                }
-                                break;
-                            case eQuality:
-                                if( self->read[read_number].qual.len > 0 ) {
-                                    rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                    SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=quality");
-                                } else {
-                                    rc = pstring_copy(&self->read[read_number].qual, &file->data);
-                                }
-                                break;
-                            case eSignalFTC:
-                                if( !self->skip_signal ) {
-                                    if( self->read[read_number].fxx.len > 0 ) {
-                                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                        SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=FTC");
-                                    } else {
-                                        self->read[read_number].fs_type = eAbisolidFSignalType_FTC;
-                                        rc = pstring_copy(&self->read[read_number].fxx, &file->data);
-                                    }
-                                }
-                                break;
-                            case eSignalCY3:
-                                if( !self->skip_signal ) {
-                                    if( self->read[read_number].cy3.len > 0 ) {
-                                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                        SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=CY3");
-                                    } else {
-                                        rc = pstring_copy(&self->read[read_number].cy3, &file->data);
-                                    }
-                                }
-                                break;
-                            case eSignalTXR:
-                                if( !self->skip_signal ) {
-                                    if( self->read[read_number].txr.len > 0 ) {
-                                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                        SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=TXR");
-                                    } else {
-                                        rc = pstring_copy(&self->read[read_number].txr, &file->data);
-                                    }
-                                }
-                                break;
-                            case eSignalCY5:
-                                if( !self->skip_signal ) {
-                                    if( self->read[read_number].cy5.len > 0 ) {
-                                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                                        SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=CY5");
-                                    } else {
-                                        rc = pstring_copy(&self->read[read_number].cy5, &file->data);
-                                    }
-                                }
-                                break;
-                        }
-                        if( rc == 0 ) {
-                            const char* l = AbisolidReadType2ReadLabel[file->read_type];
-                            rc = pstring_assign(&self->read[read_number].label, l, strlen(l));
-                        }
-                        file->ready = false;
-                    }
-                }
-            }
-        }
-        /* replace -1 quality for '.' to 0 */
-        for(i = 0; rc == 0 && i < ABSOLID_FMT_MAX_NUM_READS; i++) {
-            int j;
-            for(j = 0; rc == 0 && j < self->read[i].qual.len; j++ ) {
-                if( self->read[i].qual.data[j] == -1 ) {
-                    if( self->read[i].seq.data[j] == '.' ) {
-                        self->read[i].qual.data[j] = 0;
-                    } else {
-                        SRALoaderFile_LOG(files[0].file, klogErr, rc, "$(msg)", "msg=quality is -1 not for '.'");
-                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-                    }
-                }
-            }
-        }
-        if( rc == 0 ) {
-            rc = SRAWriteAbsolid_Write(self->writer, argv[0], &spotname, NULL,
-                                       self->read[0].label.len > 0 ? &self->read[0] : NULL,
-                                       self->read[1].label.len > 0 ? &self->read[1] : NULL);
-        }
-    } while( rc == 0 );
-    free(files);
-    return rc;
-}
-
-static
-rc_t AbiLoaderFmt_Whack(AbiLoaderFmt *self, SRATable** table)
-{
-    SRAWriteAbsolid_Whack(self->writer, table);
-    free(self);
-    return 0;
-}
-
-const char UsageDefaultName[] = "abi-load";
-
-uint32_t KAppVersion(void)
-{
-    return ABI_LOAD_VERS;
-}
-
-static
-rc_t AbiLoaderFmt_Version (const AbiLoaderFmt* self, uint32_t *vers, const char** name )
-{
-    *vers = ABI_LOAD_VERS;
-    *name = "AB SOLiD native";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 vtAbiLoaderFmt =
-{
-    1, 0,
-    AbiLoaderFmt_Whack,
-    AbiLoaderFmt_Version,
-    NULL,
-    AbiLoaderFmt_WriteData
-};
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    rc_t rc = 0;
-    AbiLoaderFmt* fmt;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    *self = NULL;
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( (rc = SRAWriteAbsolid_Make(&fmt->writer, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize writer");
-    } else if( (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&vtAbiLoaderFmt)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    }
-    /* Set result or free obj */
-    if( rc != 0 ) {
-        AbiLoaderFmt_Whack(fmt, NULL);
-    } else {
-        fmt->skip_signal = (config->columnFilter & (efltrSIGNAL | efltrDEFAULT));
-        *self = &fmt->dad;
-    }
-    return rc;
-}
diff --git a/tools/sra-load/common-xml.c b/tools/sra-load/common-xml.c
deleted file mode 100644
index 9b1b389..0000000
--- a/tools/sra-load/common-xml.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/container.h>
-#include <sra/types.h>
-#include <os-native.h>
-
-#include "common-xml.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-static
-rc_t parse_READ_LABEL(const KXMLNode* READ_SPEC, ReadSpecXML_read* read)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-
-    if( (rc = KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "READ_LABEL")) == 0 ) {
-        rc = KXMLNodeReadCStr(node, &read->read_label, NULL);
-        if( rc != 0 ) {
-            LOGERR(klogErr, rc, "READ_LABEL");
-        } else if( strlen(read->read_label) == 0 ) {
-            free(read->read_label);
-            read->read_label = NULL;
-        }
-        KXMLNodeRelease(node);
-    } else {
-        /* label is optional */
-        rc = 0;
-    }
-    return rc;
-}
-
-static
-rc_t parse_READ_CLASS(const KXMLNode* READ_SPEC, ReadSpecXML_read* read)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-    char* rclass = NULL;
-
-    if( (rc = KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "READ_CLASS")) == 0 ) {
-        rc = KXMLNodeReadCStr(node, &rclass, NULL);
-        KXMLNodeRelease(node);
-    }
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "READ_CLASS");
-    } else if( strcmp(rclass, "Application Read") == 0 ) {
-        read->read_class = SRA_READ_TYPE_BIOLOGICAL;
-    } else if( strcmp(rclass, "Technical Read") == 0 ) {
-        read->read_class = SRA_READ_TYPE_TECHNICAL;
-    } else {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "READ_CLASS: $(c)", PLOG_S(c), rclass));
-    }
-    free(rclass);
-    return rc;
-}
-
-static
-rc_t parse_READ_TYPE(const KXMLNode* READ_SPEC, ReadSpecXML_read* read)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-    char* rtype = NULL;
-
-    if( (rc = KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "READ_TYPE")) == 0 ) {
-        rc = KXMLNodeReadCStr(node, &rtype, "Forward");
-        KXMLNodeRelease(node);
-    }
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "READ_TYPE");
-    } else if( strcmp(rtype, "Forward") == 0 ) {
-        read->read_type = rdsp_Forward_rt;
-    } else if( strcmp(rtype, "Reverse") == 0 ) {
-        read->read_type = rdsp_Reverse_rt;
-    } else if( strcmp(rtype, "Adapter") == 0 ) {
-        read->read_type = rdsp_Adapter_rt;
-    } else if( strcmp(rtype, "Primer") == 0 ) {
-        read->read_type = rdsp_Primer_rt;
-    } else if( strcmp(rtype, "Linker") == 0 ) {
-        read->read_type = rdsp_Linker_rt;
-    } else if( strcmp(rtype, "BarCode") == 0 ) {
-        read->read_type = rdsp_BarCode_rt;
-    } else if( strcmp(rtype, "Other") == 0 ) {
-        read->read_type = rdsp_Other_rt;
-    } else {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "READ_CLASS: $(c)", PLOG_S(c), rtype));
-    }
-    free(rtype);
-    return rc;
-}
-
-static
-rc_t parse_RELATIVE_ORDER(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t* counter)
-{
-    rc_t rc1 = 0, rc2 = 0;
-    const KXMLNode *node = NULL;
-
-    if( KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "RELATIVE_ORDER") != 0 ) {
-        return 0;
-    }
-    *counter = *counter + 1;
-    read->coord.relative_order.follows = -1; /* not set */
-    read->coord.relative_order.precedes = -1; /* not set */
-    rc1 = KXMLNodeReadAttrAsI16(node, "follows_read_index", &read->coord.relative_order.follows);
-    rc2 = KXMLNodeReadAttrAsI16(node, "precedes_read_index", &read->coord.relative_order.precedes);
-    KXMLNodeRelease(node);
-    if( (rc1 != 0 && GetRCState(rc1) != rcNotFound) || (rc2 != 0 && GetRCState(rc2) != rcNotFound) ) {
-        rc1 = rc1 ? rc1 : rc2;
-        LOGERR(klogErr, rc1, "RELATIVE_ORDER attributes");
-    } else if( (read->coord.relative_order.follows < 0 && read->coord.relative_order.precedes < 0) ||
-               (read->coord.relative_order.follows >= 0 && read->coord.relative_order.precedes >= 0) ) {
-        rc1 = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInconsistent);
-        LOGERR(klogErr, rc1, "RELATIVE_ORDER attributes");
-    } else {
-        rc1 = 0;
-        read->coord_type = rdsp_RelativeOrder_ct;
-    }
-    return rc1;
-}
-
-static
-rc_t parse_BASE_COORD(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t* counter)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-
-    if( KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "BASE_COORD") != 0 ) {
-        return 0;
-    }
-    *counter = *counter + 1;
-    rc = KXMLNodeReadAsI16(node, &read->coord.start_coord);
-    KXMLNodeRelease(node);
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "BASE_COORD");
-    } else if( read->coord.start_coord < 1 ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "BASE_COORD: $(b)", PLOG_I32(b), read->coord.start_coord));
-    } else {
-        read->coord_type = rdsp_BaseCoord_ct;
-    }
-    return rc;
-}
-
-static
-rc_t parse_CYCLE_COORD(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t* counter)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-
-    if( KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "CYCLE_COORD") != 0 ) {
-        return 0;
-    }
-    *counter = *counter + 1;
-    rc = KXMLNodeReadAsI16(node, &read->coord.start_coord);
-    KXMLNodeRelease(node);
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "CYCLE_COORD");
-    } else if( read->coord.start_coord < 1 ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "CYCLE_COORD: $(b)", PLOG_I32(b), read->coord.start_coord));
-    } else {
-        read->coord_type = rdsp_CycleCoord_ct;
-    }
-    return rc;
-}
-
-rc_t parse_BASECALL_TABLE_add(ReadSpecXML_read_BASECALL_TABLE* table, const ReadSpecXML_read_BASECALL* src, const char* bc)
-{
-    rc_t rc = 0;
-
-    if( table->size == table->count ) {
-        const int inc = 20;
-        ReadSpecXML_read_BASECALL* nt = realloc(table->table, (table->size + inc) * sizeof(*src));
-        if( nt == NULL ) {
-            rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            table->size += inc;
-            table->table = nt;
-        }
-    }
-    if( rc == 0 ) {
-        uint32_t i;
-        for(i = 0; rc == 0 && i < table->count; i++) {
-            if( strcmp(table->table[i].basecall, bc) == 0 ) {
-                rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcDuplicate);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        table->table[table->count].basecall = bc ? strdup(bc) : NULL;
-        table->table[table->count].read_group_tag = src->read_group_tag ? strdup(src->read_group_tag) : NULL;
-        table->table[table->count].min_match = src->min_match;
-        table->table[table->count].max_mismatch = src->max_mismatch;
-        table->table[table->count].match_edge = src->match_edge;
-        if( table->table[table->count].basecall == NULL ||
-            (src->read_group_tag != NULL && table->table[table->count].read_group_tag == NULL) ) {
-            rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        } else {
-            uint32_t k = strlen(table->table[table->count].basecall);
-            k += src->max_mismatch;
-            switch(src->match_edge) {
-                case match_edge_End:
-                    if( table->match_end < k ) {
-                        table->match_end = k;
-                    }
-                    break;
-                case match_edge_Start:
-                case match_edge_Full:
-                    if( table->match_start < k ) {
-                        table->match_start = k;
-                    }
-                    break;
-            }
-
-            rc = AgrepMake(&table->table[table->count].agrep,
-                           AGREP_PATTERN_4NA |
-                           AGREP_ALG_MYERS |
-                           AGREP_EXTEND_BETTER, table->table[table->count].basecall);
-        }
-        table->count++;
-    }
-    return rc;
-}
-
-static
-rc_t parse_BASECALL_new4na(ReadSpecXML_read_BASECALL_TABLE* table, const ReadSpecXML_read_BASECALL* bc)
-{
-    rc_t rc = 0;
-
-    if( table == NULL || bc == NULL || bc->basecall[0] == '\0' ||
-        strspn(bc->basecall, "ACGTURYSWKMBDHVNacgturyswkmbdhvn.-") != strlen(bc->basecall) ) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-    }
-    if( rc == 0 ) {
-        char r[4096];
-        size_t l = strlen(bc->basecall);
-
-        if( l >= sizeof(r) ) {
-            rc = RC(rcExe, rcFormatter, rcConstructing, rcBuffer, rcInsufficient);
-        } else {
-            int i;
-            for(i = 0; i < l; i++) {
-                if( bc->match_edge == match_edge_End ) {
-                    /* need to reverse BC because match will happen on reversed seq */
-                    r[i] = bc->basecall[l - i - 1];
-                } else {
-                    r[i] = bc->basecall[i];
-                }
-                /*r[i] = isalpha(r[i]) ? toupper(r[i]) : 'N';*/
-            }
-            r[i] = '\0';
-            rc = parse_BASECALL_TABLE_add(table, bc, r);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t parse_EXPECTED_BASECALL(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t* counter)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-    ReadSpecXML_read_BASECALL bc;
-
-    if( KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "EXPECTED_BASECALL") != 0 ) {
-        return 0;
-    }
-    *counter = *counter + 1;
-    if( (rc = KXMLNodeReadCStr(node, &bc.basecall, NULL)) != 0 ) {
-        LOGERR(klogErr, rc, "EXPECTED_BASECALL value");
-    } else if( (rc = KXMLNodeReadAttrAsU32(node, "default_length", &read->coord.expected_basecalls.default_length)) != 0 &&
-        GetRCState(rc) != rcNotFound ) {
-        LOGERR(klogErr, rc, "EXPECTED_BASECALL 'default_length' attribute");
-    } else if( (rc = KXMLNodeReadAttrAsU32(node, "base_coord", &read->coord.expected_basecalls.base_coord)) != 0 &&
-         GetRCState(rc) != rcNotFound ) {
-        LOGERR(klogErr, rc, "EXPECTED_BASECALL 'base_coord' attribute");
-    } else {
-        bc.read_group_tag = NULL;
-        bc.min_match = strlen(bc.basecall);
-        /* allow 10% mismatches */
-        bc.max_mismatch = bc.min_match * 0.1;
-        bc.match_edge = match_edge_Full;
-        if( (rc = parse_BASECALL_new4na(&read->coord.expected_basecalls, &bc)) == 0 ) {
-            read->coord_type = rdsp_ExpectedBaseCall_ct;
-        }
-    }
-    if( rc != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "EXPECTED_BASECALL '$(c)'", PLOG_S(c), bc.basecall));
-    }
-    free(bc.basecall);
-    KXMLNodeRelease(node);
-    return rc;
-}
-
-static
-rc_t parse_BASECALL(const KXMLNode* node, ReadSpecXML_read_BASECALL_TABLE* table)
-{
-    rc_t rc = 0;
-    char* match_edge = NULL;
-    ReadSpecXML_read_BASECALL bc;
-
-
-    memset(&bc, 0, sizeof(bc));
-    if( (rc = KXMLNodeReadCStr(node, &bc.basecall, NULL)) != 0 ) {
-        LOGERR(klogErr, rc, "BASECALL");
-        return rc;
-    }
-    rc = KXMLNodeReadAttrCStr(node, "read_group_tag", &bc.read_group_tag, NULL);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "BASECALL @read_group_tag");
-        return rc;
-    }
-    rc = KXMLNodeReadAttrAsU32(node, "min_match", &bc.min_match);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "BASECALL @min_match");
-        return rc;
-    } else if(bc.min_match > strlen(bc.basecall)) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "BASECALL @min_match more than basecall length: $(bc)", PLOG_S(bc), bc.basecall));
-        return rc;
-    } else if( bc.min_match == 0 ) {
-        bc.min_match = strlen(bc.basecall);
-    }
-    rc = KXMLNodeReadAttrAsU32(node, "max_mismatch", &bc.max_mismatch);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "BASECALL @max_mismatch");
-        return rc;
-    } else if(bc.max_mismatch >= strlen(bc.basecall)) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "BASECALL @max_mismatch value too big: $(bc)", PLOG_S(bc), bc.basecall));
-        return rc;
-    }
-    if( (bc.min_match + bc.max_mismatch) < strlen(bc.basecall) ) {
-        if( bc.min_match != 0 ) {
-            PLOGMSG(klogWarn, (klogWarn, "BASECALL @min_match is too small: $(bc)", PLOG_S(bc), bc.basecall));
-        }
-        bc.min_match = strlen(bc.basecall) - bc.max_mismatch;
-    }
-    rc = KXMLNodeReadAttrCStr(node, "match_edge", &match_edge, NULL);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "BASECALL @match_edge");
-    } else if( match_edge == NULL || strcmp(match_edge, "full") == 0 ) {
-        bc.match_edge = match_edge_Full;
-    } else if( strcmp(match_edge, "start") == 0 ) {
-        bc.match_edge = match_edge_Start;
-    } else if( strcmp(match_edge, "end") == 0 ) {
-        bc.match_edge = match_edge_End;
-    } else {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "BASECALL @match_edge: $(c)", PLOG_S(c), match_edge));
-    }
-    free(match_edge);
-
-    if( (rc = parse_BASECALL_new4na(table, &bc)) != 0 ) {
-        LOGERR(klogErr, rc, "BASECALL");
-    }
-    free(bc.basecall);
-    free(bc.read_group_tag);
-    return rc;
-}
-
-static
-rc_t parse_EXPECTED_BASECALL_TABLE(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t* counter)
-{
-    rc_t rc = 0;
-    const KXMLNode* EXPECTED_BASECALL_TABLE;
-    const KXMLNodeset* BASECALLS;
-   
-    if( KXMLNodeGetFirstChildNodeRead(READ_SPEC, &EXPECTED_BASECALL_TABLE, "EXPECTED_BASECALL_TABLE") != 0 ) {
-        return 0;
-    }
-    *counter = *counter + 1;
-
-    if( (rc = KXMLNodeReadAttrAsU32(EXPECTED_BASECALL_TABLE, "default_length", &read->coord.expected_basecalls.default_length)) != 0 &&
-        GetRCState(rc) != rcNotFound ) {
-        LOGERR(klogErr, rc, "EXPECTED_BASECALL_TABLE 'default_length' attribute");
-    } else if( (rc = KXMLNodeReadAttrAsU32(EXPECTED_BASECALL_TABLE, "base_coord", &read->coord.expected_basecalls.base_coord)) != 0 &&
-         GetRCState(rc) != rcNotFound ) {
-        LOGERR(klogErr, rc, "EXPECTED_BASECALL_TABLE 'base_coord' attribute");
-    } else if( (rc = KXMLNodeOpenNodesetRead(EXPECTED_BASECALL_TABLE, &BASECALLS, "BASECALL")) == 0 ) {
-        uint32_t count = 0;
-        KXMLNodesetCount(BASECALLS, &count);
-        if( count > 0 ) {
-            uint32_t i, tagged;
-            for(i = 0; rc == 0 && i < count; i++) {
-                const KXMLNode* BASECALL = NULL;
-                if( (rc = KXMLNodesetGetNodeRead(BASECALLS, &BASECALL, i)) == 0 ) {
-                        if( (rc = parse_BASECALL(BASECALL, &read->coord.expected_basecalls)) != 0 ) {
-                            PLOGERR(klogErr, (klogErr, rc, "BASECALL $(i)", PLOG_U32(i), i));
-                        }
-                        KXMLNodeRelease(BASECALL);
-                } else {
-                    PLOGERR(klogErr, (klogErr, rc, "BASECALL node #$(i)", PLOG_U32(i), i));
-                }
-            }
-            for(i = 0, tagged = 0; rc == 0 && i < read->coord.expected_basecalls.count; i++) {
-                if( read->coord.expected_basecalls.table[i].read_group_tag != NULL ) {
-                    tagged++;
-                }
-            }
-            if( tagged > 0 ) {
-                if( read->coord.expected_basecalls.count != tagged ) {
-                    LOGMSG(klogWarn, "mixed tagged/untagged BASECALLs in table");
-                } else {
-                    read->coord.expected_basecalls.pooled = true;
-                }
-            }
-            if( rc == 0 ) {
-                read->coord_type = rdsp_ExpectedBaseCallTable_ct;
-            } else {
-                free(read->coord.expected_basecalls.table);
-            }
-        } else {
-            rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcIncomplete);
-            LOGERR(klogErr, rc, "need at leaset one BASECALL element");
-        }
-        KXMLNodesetRelease(BASECALLS);
-    } else {
-        LOGERR(klogErr, rc, "missing element(s) BASECALL");
-    }
-    KXMLNodeRelease(EXPECTED_BASECALL_TABLE);
-    return rc;
-}
-
-static
-rc_t parse_READ_SPEC(const KXMLNode* READ_SPEC, ReadSpecXML_read* read, uint32_t index)
-{
-    rc_t rc = 0;
-    uint32_t coord = 0;
-
-    if( (rc = parse_READ_LABEL(READ_SPEC, read)) != 0 ||
-        (rc = parse_READ_CLASS(READ_SPEC, read)) != 0 ||
-        (rc = parse_READ_TYPE(READ_SPEC, read)) != 0 ||
-        (rc = parse_RELATIVE_ORDER(READ_SPEC, read, &coord)) != 0 ||
-        (rc = parse_BASE_COORD(READ_SPEC, read, &coord)) != 0 ||
-        (rc = parse_CYCLE_COORD(READ_SPEC, read, &coord)) != 0 ||
-        (rc = parse_EXPECTED_BASECALL(READ_SPEC, read, &coord)) != 0 ||
-        (rc = parse_EXPECTED_BASECALL_TABLE(READ_SPEC, read, &coord)) != 0 ) {
-        return rc;
-    }
-    if( coord != 1 || read->coord_type == 0) {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "bad or missing coordinate descriptor in read #$(index)",
-                        PLOG_U32(index), index));
-    }
-    return rc;
-}
-
-static
-rc_t parse_READ_INDEX(const KXMLNode* READ_SPEC, uint32_t* index)
-{
-    rc_t rc = 0;
-    const KXMLNode* node = NULL;
-
-    if( (rc = KXMLNodeGetFirstChildNodeRead(READ_SPEC, &node, "READ_INDEX")) == 0 ) {
-        if( (rc = KXMLNodeReadAsU32(node, index)) != 0 ) {
-            LOGERR(klogErr, rc, "READ_INDEX");
-        }
-        KXMLNodeRelease(node);
-    } else {
-        LOGERR(klogErr, rc, "missing required node READ_INDEX");
-    }
-    return rc;
-}
-
-static
-rc_t XMLNode_get_subnode(const KXMLNode* node, const char* child, const KXMLNode** sub)
-{
-    rc_t rc = 0;
-    const KXMLNodeset* ns = NULL; 
-
-    *sub = NULL;
-    if( (rc = KXMLNodeOpenNodesetRead(node, &ns, child)) == 0 ) {
-        uint32_t count = 0;
-        if( (rc = KXMLNodesetCount(ns, &count)) == 0 ) {
-            if( count == 0 ) {
-                rc = RC(rcExe, rcFormatter, rcParsing, rcNode, rcNotFound);
-            } else if( count > 1 ) {
-                rc = RC(rcExe, rcFormatter, rcParsing, rcNode, rcDuplicate);
-            } else {
-                rc = KXMLNodesetGetNodeRead(ns, sub, 0);
-            }
-        }
-        KXMLNodesetRelease(ns);
-    }
-    return rc;
-}
-
-rc_t XMLNode_get_strnode(const KXMLNode* node, const char* child, bool optional, char** value)
-{
-    rc_t rc = 0;
-    const KXMLNode* n = NULL;
-    
-    *value = NULL;
-    if( (rc = XMLNode_get_subnode(node, child, &n)) == 0 ) {
-        if( (rc = KXMLNodeReadCStr(n, value, NULL)) == 0 && *value != NULL && **value != '\0' ) {
-            /* rtrim and ltrim */
-            char* start = *value, *end;
-            while( *start != '\0' && isspace(*start) ) {
-                start++;
-            }
-            for(end = start; *end != '\0'; end++){}
-            while( --end > start && isspace(*end) ){}
-            memmove(*value, start, end - start + 1);
-            (*value)[end - start + 1] = '\0';
-        }
-        KXMLNodeRelease(n);
-    } else if( optional && GetRCState(rc) == rcNotFound ) {
-        rc = 0;
-    }
-    return rc;
-}
-
-static
-rc_t XMLNode_get_u32node(const KXMLNode* node, const char* child, bool optional, uint32_t* value)
-{
-    rc_t rc = 0;
-    const KXMLNode* n = NULL;
-    
-    if( (rc = XMLNode_get_subnode(node, child, &n)) == 0 ) {
-        rc = KXMLNodeReadAsU32(n, value);
-        KXMLNodeRelease(n);
-    } else if( optional && GetRCState(rc) == rcNotFound ) {
-        rc = 0;
-    }
-    return rc;
-}
-
-rc_t PlatformXML_Make(const PlatformXML** cself, const KXMLNode* node, uint32_t* spot_length)
-{
-    rc_t rc = 0;
-    PlatformXML* platform;
-    const KXMLNodeset* ns = NULL;
-
-    platform = calloc(1, sizeof(*platform));
-    if( platform != NULL ) {
-        platform->id = SRA_PLATFORM_UNDEFINED;
-        if( (rc = KXMLNodeOpenNodesetRead(node, &ns, "PLATFORM/*")) == 0 ) {
-            uint32_t count = 0;
-            if( (rc = KXMLNodesetCount(ns, &count)) != 0 || count != 1 ) {
-                rc = rc ? rc : RC(rcExe, rcFormatter, rcConstructing, rcTag, count ? rcExcessive : rcNotFound);
-            } else {
-                const KXMLNode* n = NULL;
-                if( (rc = KXMLNodesetGetNodeRead(ns, &n, 0)) == 0 ) {
-                    const char* name = NULL;
-                    if( (rc = KXMLNodeElementName(n, &name)) == 0 ) {
-                        DEBUG_MSG (4, ("PLATFORM: %s\n", name));
-                        if( strcmp(name, "LS454") == 0 ) {
-                            if( (rc = XMLNode_get_strnode(n, "KEY_SEQUENCE", true, &platform->param.ls454.key_sequence)) == 0 &&
-                                (rc = XMLNode_get_strnode(n, "FLOW_SEQUENCE", true, &platform->param.ls454.flow_sequence)) == 0 &&
-                                (rc = XMLNode_get_u32node(n, "FLOW_COUNT", true, &platform->param.ls454.flow_count)) == 0 ) {
-                                platform->id = SRA_PLATFORM_454;
-                                if( platform->param.ls454.key_sequence == NULL || platform->param.ls454.key_sequence[0] == '\0' ) {
-                                    PLOGMSG(klogWarn, (klogWarn, "$(n)/KEY_SEQUENCE is not specified", PLOG_S(n), name));
-                                    free(platform->param.ls454.key_sequence);
-                                    platform->param.ls454.key_sequence = NULL;
-                                }
-                                if( platform->param.ls454.flow_sequence == NULL || platform->param.ls454.flow_sequence[0] == '\0' ) {
-                                    PLOGMSG(klogWarn, (klogWarn, "$(n)/FLOW_SEQUENCE is not specified", PLOG_S(n), name));
-                                    free(platform->param.ls454.flow_sequence);
-                                    platform->param.ls454.flow_sequence = NULL;
-                                } else if( platform->param.ls454.flow_count % strlen(platform->param.ls454.flow_sequence) != 0 ) {
-                                    rc = RC(rcExe, rcFormatter, rcConstructing, rcId, rcInconsistent);
-                                } else {
-                                    char* flows = platform->param.ls454.flow_sequence;
-                                    platform->param.ls454.flow_sequence = malloc(platform->param.ls454.flow_count + 1);
-                                    if( platform->param.ls454.flow_sequence != NULL ) {
-                                        uint32_t i = platform->param.ls454.flow_count / strlen(flows);
-                                        platform->param.ls454.flow_sequence[0] = '\0';
-                                        while( i > 0 ) {
-                                            strcat(platform->param.ls454.flow_sequence, flows);
-                                            i--;
-                                        }
-                                        free(flows);
-                                    } else {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-                                    }
-                                }
-                            }
-                        } else if( strcmp(name, "ION_TORRENT") == 0 ) {
-                            if( (rc = XMLNode_get_strnode(n, "KEY_SEQUENCE", true, &platform->param.ion_torrent.key_sequence)) == 0 &&
-                                (rc = XMLNode_get_strnode(n, "FLOW_SEQUENCE", true, &platform->param.ion_torrent.flow_sequence)) == 0 &&
-                                (rc = XMLNode_get_u32node(n, "FLOW_COUNT", true, &platform->param.ion_torrent.flow_count)) == 0 ) {
-                                platform->id = SRA_PLATFORM_ION_TORRENT;
-                                if( platform->param.ion_torrent.key_sequence == NULL || platform->param.ion_torrent.key_sequence[0] == '\0' ) {
-                                    PLOGMSG(klogWarn, (klogWarn, "$(n)/KEY_SEQUENCE is not specified", PLOG_S(n), name));
-                                    free(platform->param.ion_torrent.key_sequence);
-                                    platform->param.ion_torrent.key_sequence = NULL;
-                                }
-                                if( platform->param.ion_torrent.flow_sequence == NULL || platform->param.ion_torrent.flow_sequence[0] == '\0' ) {
-                                    PLOGMSG(klogWarn, (klogWarn, "$(n)/FLOW_SEQUENCE is not specified", PLOG_S(n), name));
-                                    free(platform->param.ion_torrent.flow_sequence);
-                                    platform->param.ion_torrent.flow_sequence = NULL;
-                                } else if( platform->param.ion_torrent.flow_count % strlen(platform->param.ion_torrent.flow_sequence) != 0 ) {
-                                    rc = RC(rcExe, rcFormatter, rcConstructing, rcId, rcInconsistent);
-                                } else {
-                                    char* flows = platform->param.ion_torrent.flow_sequence;
-                                    platform->param.ion_torrent.flow_sequence = malloc(platform->param.ion_torrent.flow_count + 1);
-                                    if( platform->param.ion_torrent.flow_sequence != NULL ) {
-                                        uint32_t i = platform->param.ion_torrent.flow_count / strlen(flows);
-                                        platform->param.ion_torrent.flow_sequence[0] = '\0';
-                                        while( i > 0 ) {
-                                            strcat(platform->param.ion_torrent.flow_sequence, flows);
-                                            i--;
-                                        }
-                                        free(flows);
-                                    } else {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-                                    }
-                                }
-                            }
-                        } else if( strcmp(name, "ILLUMINA") == 0 ) {
-                            if( (rc = XMLNode_get_u32node(n, "SEQUENCE_LENGTH", false, spot_length)) != 0 &&
-                                GetRCState(rc) == rcNotFound ) {
-                                rc = XMLNode_get_u32node(n, "CYCLE_COUNT", true, spot_length);
-                            }
-                            if( rc == 0 ) {
-                                platform->id = SRA_PLATFORM_ILLUMINA;
-                            }
-                        } else if( strcmp(name, "HELICOS") == 0 ) {
-                            if( (rc = XMLNode_get_strnode(n, "FLOW_SEQUENCE", true, &platform->param.helicos.flow_sequence)) == 0 &&
-                                (rc = XMLNode_get_u32node(n, "FLOW_COUNT", true, &platform->param.helicos.flow_count)) == 0 ) {
-                                platform->id = SRA_PLATFORM_HELICOS;
-                            }
-                        } else if( strcmp(name, "ABI_SOLID") == 0 ) {
-                            if( (rc = XMLNode_get_u32node(n, "SEQUENCE_LENGTH", false, spot_length)) != 0 &&
-                                GetRCState(rc) == rcNotFound ) {
-                                rc = XMLNode_get_u32node(n, "CYCLE_COUNT", true, spot_length);
-                            }
-                            if( rc == 0 ) {
-                                platform->id = SRA_PLATFORM_ABSOLID;
-                            }
-                        } else if( strcmp(name, "PACBIO_SMRT") == 0 ) {
-                            platform->id = SRA_PLATFORM_PACBIO_SMRT;
-                        } else if( strcmp(name, "COMPLETE_GENOMICS") == 0 ) {
-                            platform->id = SRA_PLATFORM_COMPLETE_GENOMICS;
-                        }
-                        if( rc != 0 || platform->id == SRA_PLATFORM_UNDEFINED ) {
-                            rc = rc ? rc : RC(rcExe, rcFormatter, rcConstructing, rcId, rcUnrecognized);
-                            PLOGERR(klogErr, (klogErr, rc, "PLATFORM '$(n)'", PLOG_S(n), name));
-                        }
-                    }
-                    KXMLNodeRelease(n);
-                }
-            }
-            KXMLNodesetRelease(ns);
-        }
-        if( rc == 0 ) {
-            *cself = platform;
-        } else {
-            PlatformXML_Whack(platform);
-        }
-    } else {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    }
-    return rc;
-}
-
-void PlatformXML_Whack(const PlatformXML* cself)
-{
-    if( cself != NULL ) {
-        PlatformXML* self = (PlatformXML*)cself;
-        switch(self->id) {
-            case SRA_PLATFORM_454:
-                free(self->param.ls454.key_sequence);
-                free(self->param.ls454.flow_sequence);
-                break;
-            case SRA_PLATFORM_ION_TORRENT:
-                free(self->param.ion_torrent.key_sequence);
-                free(self->param.ion_torrent.flow_sequence);
-                break;
-            case SRA_PLATFORM_ILLUMINA:
-                break;
-            case SRA_PLATFORM_HELICOS:
-                free(self->param.helicos.flow_sequence);
-                break;
-            case SRA_PLATFORM_ABSOLID:
-                break;
-            case SRA_PLATFORM_PACBIO_SMRT:
-                break;
-            case SRA_PLATFORM_COMPLETE_GENOMICS:
-                break;
-            case SRA_PLATFORM_UNDEFINED:
-                break;
-        }
-        free(self);
-    }
-}
-
-rc_t ReadSpecXML_Make(const ReadSpecXML** cself, const KXMLNode* node, const char* path, uint32_t* spot_length)
-{
-    rc_t rc = 0;
-    ReadSpecXML* obj;
-
-    assert(node != NULL);
-
-    obj = calloc(1, sizeof(*obj));
-    if( obj != NULL ) {
-        const KXMLNodeset* READ_SPECS = NULL;
-        const KXMLNode* nsplen = NULL;
-        obj->nreads = 0;
-        obj->reads = &obj->spec[1]; /* set actual read to next one after fake fixed size read */
-        if( (rc = KXMLNodeGetFirstChildNodeRead(node, &nsplen, "%s/SPOT_DECODE_SPEC/SPOT_LENGTH", path)) == 0 ) {
-            rc = KXMLNodeReadAsU32(nsplen, spot_length);
-            KXMLNodeRelease(nsplen);
-        }
-        if( rc != 0 ) {
-            if( GetRCState(rc) != rcNotFound) {
-                LOGERR(klogErr, rc, "node SPOT_LENGTH");
-            } else {
-                rc = 0;
-            }
-        }
-        if( rc == 0 &&
-            (rc = KXMLNodeOpenNodesetRead(node, &READ_SPECS, "%s/SPOT_DECODE_SPEC/READ_SPEC", path)) == 0 ) {
-            if( (rc = KXMLNodesetCount(READ_SPECS, &obj->nreads)) != 0 || obj->nreads < 1 || obj->nreads > SRALOAD_MAX_READS ) {
-                rc = rc ? rc : RC(rcExe, rcFormatter, rcConstructing, rcTag, obj->nreads ? rcExcessive : rcNotFound);
-            } else {
-                const uint8_t class_none = ~0;
-                uint32_t i;
-                for(i = 0; i < obj->nreads; i++) {
-                    /* set all read's mandatory READ_CLASS to 'unset' value */
-                    obj->reads[i].read_class = class_none;
-                }
-                for(i = 0; rc == 0 && i < obj->nreads; i++) {
-                    const KXMLNode* READ_SPEC = NULL;
-                    uint32_t index = ~0;
-                    if( (rc = KXMLNodesetGetNodeRead(READ_SPECS, &READ_SPEC, i)) == 0 &&
-                        (rc = parse_READ_INDEX(READ_SPEC, &index)) == 0 ) {
-                        if( obj->reads[index].read_class == class_none ) {
-                            if( (rc = parse_READ_SPEC(READ_SPEC, &obj->reads[index], index)) != 0 ) {
-                                PLOGERR(klogErr, (klogErr, rc, "READ_INDEX $(i)", PLOG_U32(i), index));
-                            }
-                        }
-                        KXMLNodeRelease(READ_SPEC);
-                    } else {
-                        PLOGERR(klogErr, (klogErr, rc, "READ_SPEC node #$(i)", PLOG_U32(i), i));
-                    }
-                }
-                if(rc == 0) {
-                    for(i = 0; i < obj->nreads; i++) {
-                        if(obj->reads[i].read_class == class_none ) {
-                            rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-                            PLOGERR(klogErr, (klogErr, rc, "missing READ_SPEC for READ_INDEX #$(i)", PLOG_U32(i), i));
-                        } else {
-                            switch(obj->reads[i].coord_type) {
-                                case rdsp_RelativeOrder_ct:
-                                    if( obj->nreads == 1 ) {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                                        PLOGERR(klogErr, (klogErr, rc, "#$(i) single RELATIVE_ORDER not allowed", PLOG_U32(i), i));
-                                    } else if( i > 0 && obj->reads[i - 1].coord_type != rdsp_ExpectedBaseCall_ct &&
-                                                        obj->reads[i - 1].coord_type != rdsp_ExpectedBaseCallTable_ct ) {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                                        PLOGERR(klogErr, (klogErr, rc, "#$(i) RELATIVE_ORDER cannot follow read of $(type) type",
-                                                PLOG_2(PLOG_U32(i),PLOG_S(type)), i, 
-                                                obj->reads[i - 1].coord_type == rdsp_BaseCoord_ct ? "BASE_COORD" :
-                                                    obj->reads[i - 1].coord_type == rdsp_CycleCoord_ct ? "CYCLE_COORD" :
-                                                        obj->reads[i - 1].coord_type == rdsp_RelativeOrder_ct ? "RELATIVE_ORDER" : "????"));
-                                    } else if( (obj->reads[i].coord.relative_order.follows >= 0 &&
-                                                (i == 0 || obj->reads[i].coord.relative_order.follows != i - 1)) ||
-                                               (obj->reads[i].coord.relative_order.precedes >= 0 &&
-                                                (i == obj->nreads - 1 || obj->reads[i].coord.relative_order.precedes != i + 1)) ) {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-                                        PLOGERR(klogErr, (klogErr, rc, "#$(i) RELATIVE_ORDER attribute value(s)", PLOG_U32(i), i));
-                                    }
-                                    break;
-                                case rdsp_BaseCoord_ct:
-                                case rdsp_CycleCoord_ct:
-                                    if( i == 0 && obj->reads[i].coord.start_coord != 1 ) {
-                                        rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcInvalid);
-                                        PLOGERR(klogErr, (klogErr, rc, "#$(i) 1st read coordinate must be 1", PLOG_U32(i), i));
-                                    }
-                                    break;
-                                case rdsp_ExpectedBaseCall_ct:
-                                case rdsp_ExpectedBaseCallTable_ct:
-                                    break;
-                                default:
-                                    rc = RC(rcExe, rcFormatter, rcConstructing, rcData, rcUnexpected);
-                                    PLOGERR(klogErr, (klogErr, rc, "read #$(i) type", PLOG_U32(i), i));
-                                    break;
-                            }
-                        }
-                    }
-                }
-            }
-            KXMLNodesetRelease(READ_SPECS);
-        }
-    } else {
-        rc = RC(rcExe, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    }
-    if( rc == 0 ) {
-        obj->spec[0].coord_type = rdsp_FIXED_BRACKET_ct;
-        obj->spec[0].read_class = SRA_READ_TYPE_TECHNICAL;
-        obj->spec[0].read_type = rdsp_Other_rt;
-        obj->spec[0].coord.start_coord = 1;
-        obj->spec[obj->nreads + 1].coord_type = rdsp_FIXED_BRACKET_ct;
-        obj->spec[obj->nreads + 1].read_class = SRA_READ_TYPE_TECHNICAL;
-        obj->spec[obj->nreads + 1].read_type = rdsp_Other_rt;
-        obj->spec[obj->nreads + 1].coord.start_coord = 0;
-        *cself = obj;
-    } else {
-        ReadSpecXML_Whack(obj);
-    }
-    return rc;
-}
-
-void ReadSpecXML_Whack(const ReadSpecXML* cself)
-{
-    if( cself != NULL ) {
-        uint32_t i, j;
-        ReadSpecXML* self = (ReadSpecXML*)cself;
-
-        for(i = 0; i < self->nreads; i++) {
-            free(self->reads[i].read_label);
-            switch(self->reads[i].coord_type) {
-                case rdsp_ExpectedBaseCall_ct:
-                case rdsp_ExpectedBaseCallTable_ct:
-                    for(j = 0; j < self->reads[i].coord.expected_basecalls.count; j++) {
-                        free(self->reads[i].coord.expected_basecalls.table[j].basecall);
-                        free(self->reads[i].coord.expected_basecalls.table[j].read_group_tag);
-                        AgrepWhack(self->reads[i].coord.expected_basecalls.table[j].agrep);
-                    }
-                    free(self->reads[i].coord.expected_basecalls.table);
-                    break;
-                default:
-                    break;
-            }
-        }
-        free(self);
-    }
-}
diff --git a/tools/sra-load/common-xml.h b/tools/sra-load/common-xml.h
deleted file mode 100644
index 918a142..0000000
--- a/tools/sra-load/common-xml.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_common_xml_
-#define _sra_load_common_xml_
-
-#include <kxml/xml.h>
-#include <search/grep.h>
-#include <sra/sradb.h>
-
-#define SRALOAD_MAX_READS 32
-
-rc_t XMLNode_get_strnode(const KXMLNode* node, const char* child, bool optional, char** value);
-
-typedef struct PlatformXML_struct {
-    SRAPlatforms id;
-    union {
-        struct {
-            char* key_sequence; /* optional */
-            char* flow_sequence; /* optional */
-            uint32_t flow_count; /* optional */
-        } ls454;
-
-        struct {
-            char* key_sequence; /* optional */
-            char* flow_sequence; /* optional */
-            uint32_t flow_count; /* optional */
-        } ion_torrent;
-
-        struct {
-            char* flow_sequence; /* optional */
-            uint32_t flow_count; /* optional */
-        } helicos;
-    } param;
-} PlatformXML;
-
-rc_t PlatformXML_Make(const PlatformXML** cself, const KXMLNode* node, uint32_t* spot_length);
-
-void PlatformXML_Whack(const PlatformXML* cself);
-
-typedef struct ReadSpecXML_read_BASECALL_struct {
-    char* basecall;
-    char* read_group_tag;
-    uint32_t min_match;
-    uint32_t max_mismatch;
-    enum {
-        match_edge_Full = 1,
-        match_edge_Start,
-        match_edge_End
-    } match_edge;
-    Agrep* agrep;
-} ReadSpecXML_read_BASECALL;
-
-typedef struct ReadSpecXML_read_BASECALL_TABLE_struct {
-    uint32_t default_length;
-    uint32_t base_coord;
-    ReadSpecXML_read_BASECALL* table;
-    uint32_t size; /* allocated structures qty */
-    uint32_t count; /* used structures qty */
-    bool pooled; /* true disables search if member is present from run */
-    uint16_t match_start; /* length of longest bc with match_edge="start" */
-    uint16_t match_end; /* length of longest bc with match_edge="end" */
-} ReadSpecXML_read_BASECALL_TABLE;
-
-typedef struct ReadSpecXML_read_struct {
-    char* read_label; /* asciiz */
-    SRAReadTypes read_class;
-    enum {
-        rdsp_Forward_rt = 1,
-        rdsp_Reverse_rt,
-        rdsp_Adapter_rt,
-        rdsp_Primer_rt,
-        rdsp_Linker_rt,
-        rdsp_BarCode_rt,
-        rdsp_Other_rt
-    } read_type;
-    
-    enum {
-        /* order is important !!! */
-        rdsp_FIXED_BRACKET_ct = 1, /* special fixed size type */
-        rdsp_RelativeOrder_ct,
-        rdsp_BaseCoord_ct,
-        rdsp_CycleCoord_ct,
-        rdsp_ExpectedBaseCall_ct,
-        rdsp_ExpectedBaseCallTable_ct
-    } coord_type;
-
-    union {
-        struct {
-            int16_t follows;
-            int16_t precedes;
-        } relative_order;
-        /* starting position for *_COORD types */
-        int16_t start_coord;
-        /* EXPECTED_BASECALL is a table of 1 element, unless IUPAC is used in values */
-        ReadSpecXML_read_BASECALL_TABLE expected_basecalls;
-    } coord;
-} ReadSpecXML_read;
-
-typedef struct ReadSpecXML_struct {
-    uint32_t nreads;
-    ReadSpecXML_read spec[SRALOAD_MAX_READS + 2];
-    ReadSpecXML_read* reads;
-} ReadSpecXML;
-
-rc_t ReadSpecXML_Make(const ReadSpecXML** cself, const KXMLNode* node, const char* path, uint32_t* spot_length);
-
-void ReadSpecXML_Whack(const ReadSpecXML* cself);
-
-typedef enum {
-    eExperimentQualityType_Undefined = 0,
-    eExperimentQualityType_Phred,
-    eExperimentQualityType_LogOdds,
-    eExperimentQualityType_Other
-} ExperimentQualityType;
-
-typedef enum {
-    eExperimentQualityEncoding_Undefined = 0,
-    eExperimentQualityEncoding_Ascii,
-    eExperimentQualityEncoding_Decimal,
-    eExperimentQualityEncoding_Hexadecimal
-} ExperimentQualityEncoding;
-
-/*
-
-The value 'default' is same as '' or NULL in terms coding and represents default group (member) in SRA.
-
-We use value of these data elements as SPOT_GROUP (barcode, member, etc) column value.
-Rules (whichever is present in order of importance):
-
-1.	Run.xml: /RUN/DATA_BLOCK/ attribute member_name. (must have POOL to set read lengths).
-2.	Barcode in spot name in file data. (if not explicitly chosen [below] must have pool, otherwise fail)(must have POOL to set read lengths).
-3.	Experiment.xml: /EXPERIMENT/DESIGN/SAMPLE_DESCRIPTOR/POOL elements MEMBER. Match subsequences to determine SPOT_GROUP value.
-4.	No SPOT_GROUP column
-
-Than <RUN_ATTRIBUTE> with <TAG> case-insensitive value of �read_name_barcode_proc_directive� comes in with case-insensitive <VALUE> values:
-
-1.	RUN_ATTRIBUTE not present at all � use rules above.
-2.	'interpret_as_spotgroup' (use_file_spot_name) � use data from file�s spot names. Force rule #2. (new addition)
-3.	�use_table_in_experiment� � use POOL table from experiment.xml. Force rule #3.
-4.	�ignore� � do not write anything to SPOT_GROUP column. Force rule #4
-
-*/
-
-typedef enum {
-    eBarcodeRule_not_set = 0,
-    eBarcodeRule_use_file_spot_name,
-    eBarcodeRule_use_table_in_experiment,
-    eBarcodeRule_ignore_barcode
-} ExperimentBarcodeRule;
-
-typedef struct RunAttributes_struct {
-    uint32_t spot_length;
-    const PlatformXML* platform;
-    const ReadSpecXML* reads;
-    ExperimentBarcodeRule barcode_rule;
-    ExperimentQualityType quality_type;
-    uint8_t quality_offset;
-} RunAttributes;
-
-#endif /* _sra_load_common_xml_ */
diff --git a/tools/sra-load/debug.h b/tools/sra-load/debug.h
deleted file mode 100644
index 48dc6b8..0000000
--- a/tools/sra-load/debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_sra_load_debug_h_
-#define _tools_sra_load_debug_h_
-
-#include <klib/debug.h>
-
-#define DEBUG_MSG_PASTE(a,b) a##b
-#define DEBUG_MSG(flag,msg) DBGMSG(DBG_APP,DBG_FLAG(DEBUG_MSG_PASTE(DBG_APP_,flag)), msg)
-
-#endif /* _tools_sra_load_debug_h_ */
diff --git a/tools/sra-load/experiment-xml.c b/tools/sra-load/experiment-xml.c
deleted file mode 100644
index 3995c90..0000000
--- a/tools/sra-load/experiment-xml.c
+++ /dev/null
@@ -1,1255 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/debug.h>
-#include <klib/container.h>
-#include <klib/trie.h>
-#include <sra/types.h>
-#include <os-native.h>
-
-#include "experiment-xml.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#define MAX_POOL_MEMBER_BASECALLS 64
-#define MAX_SPOT_DESCRIPTOR_READS (SRALOAD_MAX_READS + 2)
-
-typedef struct PoolReadSpec_struct {
-    int16_t start;
-    int16_t length;
-    /* chosen basecalls for EXPECTED_BASECALL_TABLE for defined member_name, NULL-terminated array */
-    const ReadSpecXML_read_BASECALL* item[MAX_POOL_MEMBER_BASECALLS];
-    int32_t score;
-} PoolReadSpec;
-
-typedef struct PoolMember_struct {
-    BSTNode node;
-    const char *name;
-    PoolReadSpec spec[MAX_SPOT_DESCRIPTOR_READS];
-} PoolMember;
-
-struct ExperimentXML {
-    uint32_t spot_length;
-    const PlatformXML* platform;
-    ProcessingXML processing;
-    const ReadSpecXML* reads;
-    BSTree* member_pool;
-    PoolMember* member_null;
-    SLList member_stats;
-};
-
-static
-void CC PoolMember_Whack(BSTNode* node, void* data)
-{
-    if( node != NULL ) {
-        const PoolMember* n = (const PoolMember*)node;
-        free((void*)n->name);
-        free(node);
-    }
-}
-
-static
-int CC PoolMember_StrCmp(const char* s1, const char* s2)
-{
-    if( s1 == NULL && s2 == NULL ) {
-        return 0;
-    } else if( s1 == NULL ) {
-        return -32767;
-    } else if( s2 == NULL ) {
-        return 32768;
-    }
-    return strcmp(s1, s2);
-}
-
-static
-int CC PoolMember_Cmp(const BSTNode* item, const BSTNode* node)
-{
-    const PoolMember* i = (const PoolMember*)item;
-    const PoolMember* n = (const PoolMember*)node;
-
-    return PoolMember_StrCmp(i->name, n->name);
-}
-
-static
-int CC PoolMember_FindByName(const void* item, const BSTNode* node)
-{
-    const char* name = (const char*)item;
-    const PoolMember* n = (const PoolMember*)node;
-
-    return PoolMember_StrCmp(name, n->name);
-}
-
-#if _DEBUGGING
-static
-void CC PoolMember_Dump( BSTNode *node, void *data )
-{
-    const PoolMember* n = (const PoolMember*)node;
-    const ExperimentXML* self = (const ExperimentXML*)data;
-    int r;
-
-    DEBUG_MSG(9, ("Member '%s'\n", n->name));
-
-    for(r = 0; r <= self->reads->nreads + 1; r++) {
-        DEBUG_MSG(9, ("Read %d [%hd:%hd]", r + 1, n->spec[r].start, n->spec[r].length));
-        if( self->reads->spec[r].coord_type == rdsp_ExpectedBaseCall_ct ) {
-            DEBUG_MSG(9, (" ebc:'%s'", n->spec[r].item[0]->basecall));
-        } else if( self->reads->spec[r].coord_type == rdsp_ExpectedBaseCallTable_ct ) {
-            int i = -1;
-            while( n->spec[r].item[++i] != NULL ) {
-                DEBUG_MSG(9, (" bc:'%s', tag:'%s';", n->spec[r].item[i]->basecall, n->spec[r].item[i]->read_group_tag));
-            }
-        }
-        DEBUG_MSG(9, ("\n"));
-    }
-}
-#endif
-
-static
-rc_t PoolMember_Add(ExperimentXML* self, const char* name)
-{
-    rc_t rc = 0;
-    PoolMember* member = NULL;
-
-    if( self == NULL) {
-        return RC(rcSRA, rcFormatter, rcAllocating, rcSelf, rcNull);
-    }
-    member = calloc(1, sizeof(*member));
-    if( member == NULL ) {
-        return RC(rcSRA, rcFormatter, rcAllocating, rcMemory, rcExhausted);
-    }
-    if( name == NULL ) {
-        if( self->member_null == NULL ) {
-            self->member_null = member;
-        } else {
-            rc = RC(rcSRA, rcFormatter, rcAllocating, rcId, rcDuplicate);
-        }
-    } else {
-        member->name = strdup(name);
-        if( member->name == NULL ) {
-            rc = RC(rcSRA, rcFormatter, rcAllocating, rcMemory, rcExhausted);
-        } else {
-            if( self->member_pool == NULL ) {
-                self->member_pool = calloc(1, sizeof(BSTree));
-                if( self->member_pool == NULL ) {
-                    rc = RC(rcSRA, rcFormatter, rcAllocating, rcMemory, rcExhausted);
-                } else {
-                    BSTreeInit(self->member_pool);
-                }
-            }
-            if( rc == 0 ) {
-                rc = BSTreeInsertUnique(self->member_pool, &member->node, NULL, PoolMember_Cmp);
-            }
-        }
-    }
-    if( rc == 0 ) {
-        uint32_t i;
-        for(i = 0; i <= self->reads->nreads + 1; i++) {
-            switch(self->reads->spec[i].coord_type) {
-                case rdsp_FIXED_BRACKET_ct:
-                    member->spec[i].start = self->reads->spec[i].coord.start_coord - 1;
-                    member->spec[i].length = (i == 0 ? 0 : -1);
-                    break;
-                case rdsp_RelativeOrder_ct:
-                    member->spec[i].start = -1;
-                    member->spec[i].length = -1;
-                    break;
-
-                case rdsp_BaseCoord_ct:
-                case rdsp_CycleCoord_ct:
-                    member->spec[i].start = self->reads->spec[i].coord.start_coord - 1;
-                    member->spec[i].length = -1;
-                    break;
-
-                case rdsp_ExpectedBaseCall_ct:
-                    if( name == NULL || name[0] == '\0' ) {
-                        member->spec[i].start = self->reads->spec[i].coord.expected_basecalls.base_coord;
-                        member->spec[i].length = self->reads->spec[i].coord.expected_basecalls.default_length;
-                    }
-                    if( member->spec[i].start == 0 ) {
-                        member->spec[i].start = -1;
-                    }
-                    member->spec[i].item[0] = self->reads->spec[i].coord.expected_basecalls.table;
-                    if( member->spec[i].length == 0 ) {
-                        member->spec[i].length = strlen(member->spec[i].item[0]->basecall);
-                    }
-                    break;
-
-                case rdsp_ExpectedBaseCallTable_ct:
-                    if( name == NULL || name[0] == '\0' ) {
-                        member->spec[i].start = self->reads->spec[i].coord.expected_basecalls.base_coord;
-                        member->spec[i].length = self->reads->spec[i].coord.expected_basecalls.default_length;
-                    }
-                    if( member->spec[i].start == 0 ) {
-                        member->spec[i].start = -1;
-                    }
-                    if( member->spec[i].length == 0 ) {
-                        member->spec[i].length = (!self->reads->spec[i].coord.expected_basecalls.pooled || name == NULL) ? -1 : 0;
-                    }
-                    break;
-            }
-        }
-    } else {
-        PoolMember_Whack(&member->node, NULL);
-    }
-    return rc;
-}
-
-static
-rc_t PoolMember_AddBasecalls(const ExperimentXML* self, const char* member, int readid, const ReadSpecXML_read_BASECALL* basecalls[])
-{
-    rc_t rc = 0;
-
-    if( self == NULL || basecalls == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcParam, rcNull);
-    } else if( self->reads->reads[readid].coord_type != rdsp_ExpectedBaseCallTable_ct ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcId, rcIncorrect);
-    } else {
-        PoolMember* pm = (PoolMember*)BSTreeFind(self->member_pool, member, PoolMember_FindByName);
-        if( pm == NULL ) {
-            rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcNotFound);
-            PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)'", PLOG_S(m), member));
-        } else {
-            int k = -1, i = -1;
-            while( pm->spec[readid + 1].item[++k] != NULL );
-            while( rc == 0 && basecalls[++i] != NULL ) {
-                if( k >= MAX_POOL_MEMBER_BASECALLS ) {
-                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcTooLong);
-                    PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' basecalls", PLOG_S(m), member));
-                } else {
-                    pm->spec[readid + 1].item[k++] = basecalls[i];
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t parse_POOL(const KXMLNode* EXPERIMENT, ExperimentXML* obj)
-{
-    rc_t rc = 0;
-
-    /* create unspecified member -> NULL */
-    if( (rc = PoolMember_Add(obj, NULL)) == 0 ) {
-        const KXMLNodeset* MEMBERS;
-        if( (rc = KXMLNodeOpenNodesetRead(EXPERIMENT, &MEMBERS, "DESIGN/SAMPLE_DESCRIPTOR/POOL/MEMBER")) == 0 ) {
-            uint32_t i, num_members = 0;
-            if( (rc = KXMLNodesetCount(MEMBERS, &num_members)) == 0 && num_members > 0 ) {
-                /* create default member -> '' */
-                rc = PoolMember_Add(obj, "");
-                for(i = 0; rc == 0 && i < num_members; i++) {
-                    const KXMLNode* MEMBER;
-                    if( (rc = KXMLNodesetGetNodeRead(MEMBERS, &MEMBER, i)) == 0 ) {
-                        char* member_name = NULL;
-                        if( (rc = KXMLNodeReadAttrCStr(MEMBER, "member_name", &member_name, NULL)) == 0 ) {
-                            const KXMLNodeset* LABELS;
-                            if( strcasecmp(member_name, "default") == 0 ) {
-                                member_name[0] = '\0';
-                            }
-                            if( member_name[0] != '\0' ) {
-                                if( (rc = PoolMember_Add(obj, member_name)) != 0 ) {
-                                    PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)'", PLOG_S(m), member_name));
-                                }
-                            }
-                            if( rc == 0 && (rc = KXMLNodeOpenNodesetRead(MEMBER, &LABELS, "READ_LABEL")) == 0 ) {
-                                uint32_t l, num_labels = 0;
-                                KXMLNodesetCount(LABELS, &num_labels);
-                                if( num_labels > 0 ) {
-                                    const ReadSpecXML_read_BASECALL* basecalls[MAX_POOL_MEMBER_BASECALLS];
-                                    for(l = 0; rc == 0 && l < num_labels; l++) {
-                                        const KXMLNode* LABEL;
-                                        if( (rc = KXMLNodesetGetNodeRead(LABELS, &LABEL, l)) == 0 ) {
-                                            char* label = NULL, *tag = NULL;
-                                            if( (rc = KXMLNodeReadCStr(LABEL, &label, NULL)) != 0 || label == NULL || label[0] == '\0' ) {
-                                                rc = rc ? rc : RC(rcSRA, rcFormatter, rcConstructing, rcData, rcEmpty);
-                                                PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL value", PLOG_S(m), member_name));
-                                            } else {
-                                                if( (rc = KXMLNodeReadAttrCStr(LABEL, "read_group_tag", &tag, NULL)) != 0 ) {
-                                                    if( GetRCState(rc) != rcNotFound ) {
-                                                        PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL '$(l)' 'read_group_tag' attribute",
-                                                                                        PLOG_2(PLOG_S(m),PLOG_S(l)), member_name, label));
-                                                    } else {
-                                                        rc = 0;
-                                                    }
-                                                } else if( tag != NULL && tag[0] == '\0' )  {
-                                                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcEmpty);
-                                                    PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL '$(l)' 'read_group_tag' attribute",
-                                                                                   PLOG_2(PLOG_S(m),PLOG_S(l)), member_name, label));
-                                                }
-                                                if( rc == 0 ) {
-                                                    /* find read_spec based on label and update basecall table */
-                                                    uint32_t r, read_found = 0;
-                                                    for(r = 0; rc == 0 && r < obj->reads->nreads; r++) {
-                                                        if( obj->reads->reads[r].read_label != NULL && strcmp(label, obj->reads->reads[r].read_label) == 0 ) {
-                                                            read_found++;
-                                                            if( tag != NULL && tag[0] != '\0' ) {
-                                                                if( obj->reads->reads[r].coord_type != rdsp_ExpectedBaseCallTable_ct ) {
-                                                                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                                                                    PLOGERR(klogErr, (klogErr, rc,
-                                                                            "MEMBER '$(m)' READ_LABEL '$(l)' READ_SPEC must have EXPECTED_BASECALL_TABLE type",
-                                                                            PLOG_2(PLOG_S(m),PLOG_S(l)), member_name, label));
-                                                                } else {
-                                                                    uint32_t b, bcall_found = 0;
-                                                                    memset(basecalls, 0, sizeof(basecalls));
-                                                                    /* find tag in table */
-                                                                    for(b = 0; rc == 0 && b < obj->reads->reads[r].coord.expected_basecalls.count; b++) {
-                                                                        if( obj->reads->reads[r].coord.expected_basecalls.table[b].read_group_tag != NULL &&
-                                                                            strcmp(tag, obj->reads->reads[r].coord.expected_basecalls.table[b].read_group_tag) == 0 ) {
-                                                                            if( bcall_found >= MAX_POOL_MEMBER_BASECALLS ) {
-                                                                                rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcExcessive);
-                                                                                PLOGERR(klogErr, (klogErr, rc,
-                                                                                        "MEMBER '$(m)' READ_LABEL '$(l)' read_group_tag='$(t)' too many basecalls",
-                                                                                         PLOG_3(PLOG_S(m),PLOG_S(l),PLOG_S(t)), member_name, label, tag));
-                                                                            }
-                                                                            basecalls[bcall_found++] = &obj->reads->reads[r].coord.expected_basecalls.table[b];
-                                                                        }
-                                                                    }
-                                                                    if( rc == 0 && bcall_found == 0 ) {
-                                                                        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcNotFound);
-                                                                        PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL '$(l)' read_group_tag='$(t)' in READ_SPEC",
-                                                                                 PLOG_3(PLOG_S(m),PLOG_S(l),PLOG_S(t)), member_name, label, tag));
-                                                                    } else {
-                                                                        rc = PoolMember_AddBasecalls(obj, member_name, r, basecalls);
-                                                                    }
-                                                                }
-                                                            }
-                                                        }
-                                                    }
-                                                    if( read_found == 0 ) {
-                                                        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcNotFound);
-                                                        PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL '$(l)' in READ_SPEC", PLOG_2(PLOG_S(l),PLOG_S(m)), label, member_name));
-                                                    } else if( read_found > 1 ) {
-                                                        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                                                        PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL '$(l)' in READ_SPEC", PLOG_2(PLOG_S(l),PLOG_S(m)), label, member_name));
-                                                    }
-                                                }
-                                            }
-                                            free(tag);
-                                            free(label);
-                                            KXMLNodeRelease(LABEL);
-                                        } else {
-                                            PLOGERR(klogErr, (klogErr, rc, "MEMBER '$(m)' READ_LABEL #$(i)", PLOG_2(PLOG_S(m),PLOG_U32(i)), member_name, l));
-                                        }
-                                    }
-                                } else {
-                                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-                                    PLOGERR(klogErr, (klogErr, rc, "missing READ_LABEL element(s) in MEMBER '$(m)'", PLOG_S(m), member_name));
-                                }
-                                KXMLNodesetRelease(LABELS);
-                            }
-                            free(member_name);
-                        } else {
-                            PLOGERR(klogErr, (klogErr, rc, "'member_name' in MEMBER node #$(i)", PLOG_U32(i), i));
-                        }
-                        KXMLNodeRelease(MEMBER);
-                    } else {
-                        PLOGERR(klogErr, (klogErr, rc, "MEMBER node #$(i)", PLOG_U32(i), i));
-                    }
-                }
-            } else if( rc != 0 ) {
-                LOGERR(klogErr, rc, "POOL/MEMBER(s)");
-            }
-            KXMLNodesetRelease(MEMBERS);
-        } else {
-            LOGERR(klogErr, rc, "POOL/MEMBER(s)");
-        }
-    }
-#if _DEBUGGING
-    PoolMember_Dump(&obj->member_null->node, obj);
-    BSTreeForEach(obj->member_pool, false, PoolMember_Dump, obj);
-#endif
-    return rc;
-}
-
-typedef struct ExpectedTableMatch_struct {
-    /* in */
-    const char* seq;
-    uint32_t len;
-    const char* tag;
-    enum {
-        etm_Forward = 1,
-        etm_Reverse,
-        etm_Both
-    } direction;
-    bool left_adjusted;
-    /* out */
-    AgrepMatch match;
-    ReadSpecXML_read_BASECALL* bc;
-} ExpectedTableMatch;
-
-static
-bool Experiment_ExpectedTableMatch(const ReadSpecXML_read_BASECALL_TABLE* table, ExpectedTableMatch* data)
-{
-    uint32_t i;
-
-    assert(table && data && data->seq );
-
-    data->match.score = -1;
-    for(i = 0; i < table->count; i++) {
-        AgrepMatch match;
-        ReadSpecXML_read_BASECALL* bc = &table->table[i];
-
-        if( data->tag != NULL && strcmp(data->tag, bc->read_group_tag) != 0 ) {
-            continue;
-        }
-        if( data->direction != etm_Both ) {
-            if( bc->match_edge == match_edge_End ) {
-                if( data->direction == etm_Forward ) {
-                    continue;
-                }
-            } else if( data->direction != etm_Forward ) {
-                continue;
-            }
-        }
-        match.score = -1;
-        if( data->left_adjusted ) {
-            if( AgrepFindFirst(bc->agrep, bc->max_mismatch, data->seq, data->len, &match) ) {
-                if( data->direction == etm_Reverse ) {
-                    int32_t right_tail = data->len - match.position - strlen(bc->basecall);
-                    if( right_tail > bc->max_mismatch - match.score ) {
-                        match.score = -1;
-                    } else if( match.position > 0 ) {
-                        match.score += right_tail;
-                        match.length += right_tail;
-                        match.position = 0;
-                    }
-                } else {
-                    if( match.position > bc->max_mismatch - match.score ) {
-                        match.score = -1;
-                    } else if( match.position > 0 ) {
-                        match.score += match.position;
-                        match.length += match.position;
-                        match.position = 0;
-                    }
-                }
-            }
-        } else {
-            AgrepFindBest(bc->agrep, bc->max_mismatch, data->seq, data->len, &match);
-        }
-        if( !(match.score < 0) ) {
-            DEBUG_MSG(3, ("agrep match bc %s, min: %u, max: %u, edge: %s%s, [%d:%d] score %d\n", bc->basecall, bc->min_match, bc->max_mismatch,
-                       bc->match_edge == match_edge_Full ? "Full" : (bc->match_edge == match_edge_Start ? "Start" : "End"),
-                       data->left_adjusted ? " left adjusted" : "",
-                       match.position, match.length, match.score));
-            if( (data->match.score < 0 || data->match.score > match.score) ) {
-                memcpy(&data->match, &match, sizeof(data->match));
-                data->bc = bc;
-            }
-        }
-    }
-    return !(data->match.score < 0);
-}
-
-static
-rc_t Experiment_FillRead(const ReadSpecXML_read* spec, PoolReadSpec* pool,
-                         const char** tag, const uint32_t nreads, int16_t start, const char* bases, uint32_t nbases)
-{
-    rc_t rc = 0;
-
-    switch(spec->coord_type) {
-        case rdsp_RelativeOrder_ct:
-            if( pool[-1].length >= 0 ) {
-                if( pool[-1].start >= 0 ) {
-                    pool->start = pool[-1].start + pool[-1].length;
-                } else {
-                    pool->start = start;
-                }
-            } else {
-                pool->start = -1;
-            }
-            pool->length = -1;
-            if( nreads > 1 ) {
-                if( (rc = Experiment_FillRead(spec + 1, pool + 1, tag + 1, nreads - 1, start, bases, nbases)) != 0 ) {
-                    break;
-                }
-            }
-            if( pool->start < 0 ) {
-                pool->start = pool[1].start;
-            }
-            pool->length = pool[1].start - pool->start;
-            break;
-
-        case rdsp_BaseCoord_ct:
-        case rdsp_CycleCoord_ct:
-            pool->start = spec->coord.start_coord - 1;
-            pool->length = -1;
-            if( nreads > 1 ) {
-                if( (rc = Experiment_FillRead(spec + 1, pool + 1, tag + 1, nreads - 1, pool->start, bases, nbases)) != 0 ) {
-                    break;
-                }
-            }
-            pool->length = pool[1].start - pool->start;
-            break;
-
-        case rdsp_ExpectedBaseCall_ct:
-        case rdsp_ExpectedBaseCallTable_ct:
-            {{
-            int32_t gap;
-            if( spec->coord.expected_basecalls.base_coord > 0 ) {
-                pool->start = spec->coord.expected_basecalls.base_coord - 1;
-                start = pool->start;
-            } else {
-                pool->start = -1;
-            }
-            pool->length = -1;
-            pool->item[0] = NULL;
-            pool->score = -1;
-            if( spec->coord.expected_basecalls.match_start > 0 ) {
-                uint32_t i, stop = nbases;
-                ExpectedTableMatch data;
-                /* find terminator, if any */
-                for(i = 1; i < nreads; i++) {
-                    if( spec[i].coord_type == rdsp_BaseCoord_ct ||
-                        spec[i].coord_type == rdsp_CycleCoord_ct ||
-                        spec[i].coord_type == rdsp_FIXED_BRACKET_ct ) {
-                        stop = spec[i].coord.start_coord - 1;
-                        break;
-                    }
-                }
-                data.seq = &bases[start];
-                data.len = stop - start;
-                data.tag = *tag;
-                data.direction = etm_Forward;
-                data.left_adjusted = !(pool->start < 0) || !(pool[-1].length < 0);
-                DEBUG_MSG(3, ("agrep find read %u fwd in: '%.*s' = %u\n", nreads, data.len, data.seq, data.len));
-                if( Experiment_ExpectedTableMatch(&spec->coord.expected_basecalls, &data) ) {
-                    DEBUG_MSG(3, ("agrep found from %hd match %d:%d - %d '%s' in '%.*s...' \n",
-                                   start, data.match.position, data.match.length,
-                                   data.match.score, data.bc->basecall,
-                                   start + data.match.position + data.match.length * 3 + data.match.score, &bases[start]));
-                    pool->start = start + data.match.position;
-                    pool->length = data.match.length;
-                    pool->item[0] = data.bc;
-                    pool->score = data.match.score;
-                    start = pool->start + pool->length;
-                } else {
-                    DEBUG_MSG(3, ("agrep nothing found\n"));
-                }
-            }
-            if( pool[-1].length >= 0 && pool->length < 0 && spec->coord.expected_basecalls.match_end == 0 ) {
-                pool->length = spec->coord.expected_basecalls.default_length;
-                start += pool->length;
-            }
-            if( nreads > 1 ) {
-                if( (rc = Experiment_FillRead(spec + 1, pool + 1, tag + 1, nreads - 1, start, bases, nbases)) != 0 ) {
-                    break;
-                }
-            }
-            if( spec->coord.expected_basecalls.match_end > 0 ) {
-                /* match_end can have a better match even if match_start found smth before
-                   normally table has start or end match edge, not both */
-                char r[4096];
-                uint32_t i;
-                ExpectedTableMatch data;
-                
-                data.len = pool[1].start - start;
-                DEBUG_MSG(3, ("agrep find read %u rev in: '%.*s' = %u\n", nreads, data.len, &bases[start], data.len));
-                if( data.len > sizeof(r) ) {
-                    rc = RC(rcSRA, rcFormatter, rcResolving, rcBuffer, rcInsufficient);
-                    break;
-                }
-                for(i = 0; i < data.len; i++) {
-                    /* reverse a portion of seq */
-                    r[i] = bases[pool[1].start - i - 1];
-                }
-                data.seq = r;
-                data.tag = *tag;
-                data.direction = etm_Reverse;
-                data.left_adjusted = spec[1].coord_type != rdsp_RelativeOrder_ct && pool[1].start > 0;
-                DEBUG_MSG(3, ("agrep find read %u rev in: '%.*s' = %u\n", nreads, data.len, data.seq, data.len));
-                if( Experiment_ExpectedTableMatch(&spec->coord.expected_basecalls, &data) ) {
-                    DEBUG_MSG(3, ("agrep found rev from %hd match %d:%d - %d '%s' in '%.*s' \n",
-                                    start, data.match.position, data.match.length, data.match.score,
-                                    data.bc->basecall, data.len, &bases[pool[1].start - data.len]));
-                    if( pool->length < 0 || data.match.score < pool->score ) {
-                        pool->start = pool[1].start - data.match.position - data.match.length;
-                        pool->length = data.match.length;
-                        pool->item[0] = data.bc;
-                        pool->score = data.match.score;
-                    }
-                } else {
-                    DEBUG_MSG(3, ("agrep nothing found rev\n"));
-                }
-            }
-            if( pool->length < 0 ) {
-                pool->length = spec->coord.expected_basecalls.default_length;
-            }
-            if( pool->start < 0 ) {
-                pool->start = pool[1].start - pool->length;
-            }
-            gap = pool[1].start - (pool->start + pool->length);
-            if( gap > 0 ) {
-                /* right gap */
-                if( spec[1].coord_type == rdsp_RelativeOrder_ct ) {
-                    /* adjust right read's start to the tail of current read */
-                    pool[1].start -= gap;
-                    pool[1].length += gap;
-                    gap = 0;
-                } else if( spec[1].coord_type >= rdsp_ExpectedBaseCall_ct &&
-                    spec[1].coord.expected_basecalls.base_coord <= 0 && pool[1].item[0] != NULL ) {
-                    /* move left read's start to left as much as possible */
-                    int32_t left = pool[1].item[0]->max_mismatch - pool[1].score;
-                    if( left > 0 ) {
-                        if( left > gap ) {
-                            left = gap;
-                        }
-                        pool[1].length += left;
-                        pool[1].score += left;
-                        pool[1].start -= left;
-                        gap -= left;
-                    }
-                }
-                if( gap > 0 && pool->item[0] != NULL ) {
-                    /* add gap to end of self */
-                    int32_t left = pool->item[0]->max_mismatch - pool->score;
-                    if( left > 0 ) {
-                        if( left > gap ) {
-                            left = gap;
-                        }
-                        pool->length += left;
-                        pool->score += left;
-                    }
-                }
-            }
-            break;
-            }}
-        default:
-            rc = RC(rcSRA, rcFormatter, rcResolving, rcItem, rcUnexpected);
-            break;
-    }
-    return rc;
-}
-
-typedef struct PoolMember_FindReverse_Data_struct {
-    const char* tags[MAX_SPOT_DESCRIPTOR_READS];
-    uint8_t nreads;
-    const PoolMember* member;
-} PoolMember_FindReverse_Data;
-
-static
-bool CC PoolMember_FindReverse(BSTNode* n, void* d)
-{
-    const PoolMember* node = (const PoolMember*)n;
-    PoolMember_FindReverse_Data* data = (PoolMember_FindReverse_Data*)d;
-    int r, j, found;
-
-    for(r = 1; r <= data->nreads; r++) {
-        /* comparing pointers here because tags contains same pointers */
-        if( node->spec[r].item[0] == NULL && data->tags[r] == NULL ) {
-            continue;
-        }
-        found = 0;
-        for(j = 0; node->spec[r].item[j] != NULL; j++ ) {
-            if( node->spec[r].item[j]->read_group_tag == data->tags[r] ) {
-                found = 1;
-                break;
-            }
-        }
-        if( found == 0 ) {
-            return false;
-        }
-    }
-    data->member = node;
-    return true;
-}
-
-static
-rc_t Experiment_FillSegAgrep(const ExperimentXML* self, PoolReadSpec* pool, const PoolMember* src,
-                             uint32_t nbases, const char* bases,
-                             const char** const new_member_name)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    PoolMember_FindReverse_Data data;
-
-    /* close left and right brackets tech reads as spot terminators */
-    pool[0].start = 0;
-    pool[0].length = 0;
-    pool[self->reads->nreads + 1].start = nbases;
-    pool[self->reads->nreads + 1].length = 0;
-
-    /* setup known tags if it is predefined member search */
-    for(i = 0; i <= self->reads->nreads + 1; i++) {
-        data.tags[i] = src->spec[i].item[0] ? src->spec[i].item[0]->read_group_tag : NULL;
-    }
-    /* start from read, not bracket read */
-    rc = Experiment_FillRead(self->reads->reads, &pool[1], &data.tags[1], self->reads->nreads, 0, bases, nbases);
-
-    if( rc != 0 ) {
-        DEBUG_MSG(3, ("ERROR: %R\n", rc));
-    }
-    DEBUG_MSG(3, ("%s: bases %u: '%.*s'\n", new_member_name ? *new_member_name : NULL, nbases, nbases, bases));
-    for(i = 1; i <= self->reads->nreads; i++) {
-        const char* b = NULL;
-        if( pool[i].start >= 0 ) {
-            b = &bases[pool[i].start];
-        }
-        DEBUG_MSG(3, ("Read %u. [%hd:%hd] - '%.*s'",
-                       i, pool[i].start, pool[i].length, pool[i].length < 0 ? 0 : pool[i].length, b));
-        if( self->reads->spec[i].coord_type == rdsp_FIXED_BRACKET_ct ) {
-            DEBUG_MSG(3, (" terminator???"));
-        }
-        if( self->reads->spec[i].coord_type >= rdsp_ExpectedBaseCall_ct ) {
-            if( pool[i].item[0] ) {
-                if( pool[i].item[0]->match_edge == match_edge_End ) {
-                    DEBUG_MSG(3, (" in reverse"));
-                }
-                DEBUG_MSG(3, (" matches %s", pool[i].item[0]->basecall));
-                if( pool[i].item[0]->read_group_tag ) {
-                    DEBUG_MSG(3, (" tagged %s", pool[i].item[0]->read_group_tag));
-                }
-                DEBUG_MSG(3, (" with %d mismatches", pool[i].score));
-            } else {
-                DEBUG_MSG(3, (" no match"));
-            }
-        }
-        DEBUG_MSG(3, ("\n"));
-    }
-
-    if( rc == 0 && new_member_name != NULL ) {
-        data.nreads = self->reads->nreads;
-        data.member = NULL;
-        for(i = 1; i <= self->reads->nreads; i++) {
-            if( self->reads->spec[i].coord_type == rdsp_ExpectedBaseCallTable_ct && pool[i].item[0] != NULL ) {
-                data.tags[i] = pool[i].item[0]->read_group_tag;
-            } else {
-                data.tags[i] = NULL;
-            }
-        }
-        if( BSTreeDoUntil(self->member_pool, false, PoolMember_FindReverse, &data) ) {
-            *new_member_name = data.member->name;
-            DEBUG_MSG(2, ("Assigned member_name '%s'\n", *new_member_name));
-        } else {
-#if _DEBUGGING
-            DEBUG_MSG(2, ("member_name reverse lookup failed for tags:"));
-            for(i = 1; i <= self->reads->nreads; i++) {
-                DEBUG_MSG(2, (" '%s'", data.tags[i]));
-            }
-            DEBUG_MSG(2, ("\n"));
-#endif
-        }
-    }
-    return rc;
-}
-
-rc_t Experiment_MemberSeg(const ExperimentXML* self,
-                          const char* const file_member_name, const char* const data_block_member_name,
-                          uint32_t nbases, const char* bases,
-                          SRASegment* seg, const char** const new_member_name)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    PoolReadSpec pool[MAX_SPOT_DESCRIPTOR_READS];
-
-    if( self == NULL || bases == NULL || seg == NULL || new_member_name == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcResolving, rcParam, rcNull);
-    } else if( nbases < 1 ) {
-        rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcEmpty);
-    }
-
-    if( rc == 0 ) {
-        const char* mm = NULL;
-        switch(self->processing.barcode_rule) {
-            case eBarcodeRule_not_set:
-                mm = data_block_member_name ? data_block_member_name : file_member_name;
-                break;
-
-            case eBarcodeRule_use_file_spot_name:
-                mm = file_member_name;
-                break;
-
-            case eBarcodeRule_use_table_in_experiment:
-            case eBarcodeRule_ignore_barcode:
-                mm = NULL;
-                break;
-        }
-        if( self->member_pool == NULL || self->processing.barcode_rule == eBarcodeRule_ignore_barcode ) {
-            if( (rc = Experiment_FillSegAgrep(self, pool, self->member_null, nbases, bases, NULL)) == 0 ) {
-                *new_member_name = mm;
-            }
-        } else if( mm == NULL ) {
-            *new_member_name = NULL;
-	    rc = Experiment_FillSegAgrep(self, pool, self->member_null, nbases, bases, new_member_name);
-        } else {
-            PoolMember* pm = (PoolMember*)BSTreeFind(self->member_pool, mm, PoolMember_FindByName);
-            if( pm == NULL ) {
-                rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcNotFound);
-                PLOGERR(klogErr, (klogErr, rc, "specified member_name '$(m)'", PLOG_S(m), mm));
-            } else {
-                if( (rc = Experiment_FillSegAgrep(self, pool, pm, nbases, bases, NULL)) == 0 ) {
-                    *new_member_name = mm;
-                }
-            }
-        }
-    }
-
-    if( rc == 0 ) {
-        int32_t new_bases = 0;
-
-        for(i = 1; i <= self->reads->nreads; i++) {
-            if( pool[i].start < 0 || pool[i].length < 0 ) {
-                rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcIncomplete);
-                PLOGERR(klogErr, (klogErr, rc, "Read #$(i) boundaries", PLOG_U32(i), i));
-            } else if( i == 1 ) {
-                if( pool[i].start != 0 ) {
-                    rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcInvalid);
-                    PLOGERR(klogErr, (klogErr, rc, "Read #$(i) do not start at 0", PLOG_U32(i), i));
-                }
-            } else {
-                int16_t delta = pool[i].start - pool[i - 1].length - pool[i - 1].start;
-                /* try to close gap by failng back to default length IF:
-                   prev read was EXPECTED_BASECALL OR
-                                 EXPECTED_BASECALL_TABLE and there an BASECALL chosen
-                   AND
-                    defailt_length != 0 (was set)
-                   */
-                if( delta != 0 &&
-                    (self->reads->spec[i - 1].coord_type == rdsp_ExpectedBaseCall_ct ||
-                     (self->reads->spec[i - 1].coord_type == rdsp_ExpectedBaseCallTable_ct && pool[i - 1].item[0] != NULL)) &&
-                    self->reads->spec[i - 1].coord.expected_basecalls.default_length > 0 ) {
-                    new_bases -= pool[i - 1].length;
-                    pool[i - 1].length = self->reads->spec[i - 1].coord.expected_basecalls.default_length;
-                    DEBUG_MSG(2, ("trying to close delta %hi for read %u: length reset default %hi\n", delta, i - 1, pool[i - 1].length));
-                    if( pool[i - 1].item[0] != NULL  && pool[i - 1].item[0]->read_group_tag != NULL ) {
-                        DEBUG_MSG(2, ("member_name '%s' reset to ''\n", *new_member_name));
-                        *new_member_name = NULL;
-                    }
-                    delta = pool[i].start - pool[i - 1].length - pool[i - 1].start;
-                    new_bases += pool[i - 1].length;
-                    seg[i - 2].len = pool[i - 1].length;
-                }
-                if( delta > 0 ) {
-                    rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcInconsistent);
-                    PLOGERR(klogErr, (klogErr, rc, "Gap between reads #$(p) and #$(i)", PLOG_2(PLOG_U32(p),PLOG_U32(i)), i - 1, i));
-                } else if( delta < 0 ) {
-                    rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcInconsistent);
-                    PLOGERR(klogErr, (klogErr, rc, "Reads #$(p) and #$(i) overlap", PLOG_2(PLOG_U32(p),PLOG_U32(i)), i - 1, i));
-                }
-            }
-            seg[i - 1].start = pool[i].start;
-            seg[i - 1].len = pool[i].length;
-            new_bases += pool[i].length;
-        }
-        if( rc == 0 && (new_bases < 0 || nbases != new_bases) ) {
-            rc = RC(rcSRA, rcFormatter, rcResolving, rcData, rcInconsistent);
-            PLOGERR(klogErr, (klogErr, rc, "total read length $(c)", PLOG_U32(c), new_bases));
-        }
-        if( rc != 0 ) {
-            char err_buf[8192], *p = err_buf;
-            size_t max = sizeof(err_buf);
-
-            for(i = 1; i <= self->reads->nreads; i++) {
-                int x = snprintf(p, max, "[%hd:%d, len = %hd", pool[i].start, pool[i].start + pool[i].length, pool[i].length);
-                if( x > 0 && x < max ) {
-                    max -= x;
-                    p += x;
-                    if( self->reads->spec[i].coord_type == rdsp_ExpectedBaseCallTable_ct ) {
-                        if( pool[i].item[0] != NULL ) {
-                            if( pool[i].item[0]->read_group_tag != NULL ) {
-                                x = snprintf(p, max, ", matched tag '%s', mismatches %d]", pool[i].item[0]->read_group_tag, pool[i].score);
-                            } else {
-                                x = snprintf(p, max, ", mismatches %d]", pool[i].score);
-                            }
-                        } else {
-                            x = snprintf(p, max, ", no match]");
-                        }
-                    } else {
-                        x = snprintf(p, max, "]");
-                    }
-                }
-                if( x <= 0 || x >= max ) {
-                    max = strlen(err_buf);
-                    err_buf[max - 4] = '\0';
-                    strcat(err_buf, "... ");
-                    break;
-                }
-                max -= x;
-                p += x;
-            }
-            PLOGMSG(klogErr, (klogErr, "segments: $(seg) spot length actual: $(actual), calculated $(calc)",
-                "seg=%s,actual=%u,calc=%d", err_buf, nbases, new_bases));
-        }
-    }
-    return rc;
-}
-
-rc_t Experiment_MemberSegSimple(const ExperimentXML* self,
-                                const char* const file_member_name, const char* const data_block_member_name,
-                                const char** const new_member_name)
-{
-    rc_t rc = 0;
-    if( self == NULL || new_member_name == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcResolving, rcParam, rcNull);
-    } else {
-        switch(self->processing.barcode_rule) {
-            case eBarcodeRule_not_set:
-                *new_member_name = data_block_member_name ? data_block_member_name : file_member_name;
-                break;
-
-            case eBarcodeRule_use_file_spot_name:
-                *new_member_name = file_member_name;
-                break;
-
-            case eBarcodeRule_use_table_in_experiment:
-            case eBarcodeRule_ignore_barcode:
-                *new_member_name = NULL;
-                break;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t Experiment_Apply_RUN_ATTRIBUTES(const ExperimentXML* cself, RunAttributes* attr, uint32_t spot_length)
-{
-    rc_t rc = 0;
-
-    if( cself == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcEvaluating, rcSelf, rcNull);
-    } else if( attr != NULL ) {
-        ExperimentXML* obj = (ExperimentXML*)cself;
-
-        obj->processing.barcode_rule = attr->barcode_rule;
-        if( attr->quality_offset != '\0' ) {
-            obj->processing.quality_offset = attr->quality_offset;
-        }
-        if( attr->quality_type != eExperimentQualityType_Undefined ) {
-            obj->processing.quality_type = attr->quality_type;
-        }
-        obj->spot_length = attr->spot_length ? attr->spot_length : spot_length;
-        if( obj->spot_length == 0 &&
-            (obj->platform->id == SRA_PLATFORM_ILLUMINA || obj->platform->id == SRA_PLATFORM_ABSOLID) ) {
-            PLOGMSG(klogWarn, (klogWarn,
-                "SPOT_LENGTH is not found or specified as $(l)", PLOG_U32(l), obj->spot_length));
-        }
-    }
-    return rc;
-}
-
-rc_t Experiment_Make(const ExperimentXML** self, const KXMLDoc* doc, RunAttributes* attr)
-{
-    rc_t rc = 0;
-    ExperimentXML* obj = NULL;
-    const KXMLNodeset* ns = NULL;
-    uint32_t p_spot_length = 0, r_spot_length = 0;
-
-    if( self == NULL || doc == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    obj = calloc(1, sizeof(*obj));
-    if( obj == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    }
-    if( (rc = KXMLDocOpenNodesetRead(doc, &ns, "/EXPERIMENT_SET/EXPERIMENT | /EXPERIMENT")) == 0 ) {
-        uint32_t count = 0;
-        if( (rc = KXMLNodesetCount(ns, &count)) == 0 && count != 1 ) {
-            rc = RC(rcSRA, rcFormatter, rcConstructing, rcTag, count ? rcExcessive : rcNotFound);
-            LOGERR(klogErr, rc, "EXPERIMENT");
-        } else {
-            const KXMLNode* EXPERIMENT = NULL;
-            if( (rc = KXMLNodesetGetNodeRead(ns, &EXPERIMENT, 0)) == 0 ) {
-                if( (rc = PlatformXML_Make(&obj->platform, EXPERIMENT, &p_spot_length)) == 0 ) {
-                    if( attr->platform != NULL ) {
-                        if( obj->platform->id != attr->platform->id ) {
-                            rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                            LOGERR(klogErr, rc, "EXPERIMENT and RUN platforms differ");
-                        } else {
-                            PlatformXML_Whack(obj->platform);
-                            obj->platform = attr->platform;
-                            /* take ownership */
-                            attr->platform = NULL;
-                        }
-                    }
-                    if( rc == 0 ) {
-                        if( attr->reads == NULL ) {
-                            if( (rc = ReadSpecXML_Make(&obj->reads, EXPERIMENT, "DESIGN/SPOT_DESCRIPTOR", &r_spot_length)) != 0 ) {
-                                LOGERR(klogErr, rc, "EXPERIMENT/.../READ_SPEC");
-                            }
-                        } else {
-                            obj->reads = attr->reads;
-                            /* take ownership */
-                            attr->reads = NULL;
-                        }
-                        if( rc == 0 && (rc = parse_POOL(EXPERIMENT, obj)) == 0 ) {
-                            rc = Experiment_Apply_RUN_ATTRIBUTES(obj, attr, r_spot_length ? r_spot_length : p_spot_length);
-                        }
-                        if( rc == 0 && p_spot_length != 0 && r_spot_length != 0 && p_spot_length != r_spot_length ) {
-                            PLOGMSG(klogWarn, (klogWarn,
-                                "in EXPERIMENT sequence length (cycle count) in PLATFORM $(p) differ"
-                                " from SPOT_LENGTH $(l) in SPOT_DECODE_SPEC",
-                                PLOG_2(PLOG_U32(p),PLOG_U32(l)), p_spot_length, r_spot_length));
-                        }
-                    }
-                } else {
-                    LOGERR(klogErr, rc, "EXPERIMENT/PLATFORM");
-                }
-                KXMLNodeRelease(EXPERIMENT);
-            }
-        }
-        KXMLNodesetRelease(ns);
-    }
-    if( rc != 0 ) {
-        *self = NULL;
-        Experiment_Whack(obj);
-    } else {
-        *self = obj;
-    }
-    return rc;
-}
-
-rc_t Experiment_GetPlatform(const ExperimentXML* cself, const PlatformXML** platform)
-{
-    rc_t rc = 0;
-    if( cself == NULL || platform == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *platform = cself->platform;
-    }
-    return rc;
-}
-
-rc_t Experiment_GetProcessing(const ExperimentXML* cself, const ProcessingXML** processing)
-{
-    rc_t rc = 0;
-    if( cself == NULL || processing == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *processing = &cself->processing;
-    }
-    return rc;
-}
-
-rc_t Experiment_GetReadNumber(const ExperimentXML* cself, uint8_t* nreads)
-{
-    rc_t rc = 0;
-    if( cself == NULL || nreads == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *nreads = cself->reads->nreads;
-    }
-    return rc;
-}
-
-rc_t Experiment_GetSpotLength(const ExperimentXML* cself, uint32_t* spot_length)
-{
-    rc_t rc = 0;
-    if( cself == NULL || spot_length == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *spot_length= cself->spot_length;
-    }
-    return rc;
-}
-
-rc_t Experiment_GetRead(const ExperimentXML* cself, uint8_t read_id, const ReadSpecXML_read** read_spec)
-{
-    rc_t rc = 0;
-    if( cself == NULL || read_spec == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else if( read_id >= cself->reads->nreads ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcId, rcOutofrange);
-    } else {
-        *read_spec = &(cself->reads->reads[read_id]);
-    }
-    return rc;
-}
-
-typedef struct PoolMember_FindByTag_Data_struct {
-    /* in */
-    const char* tag;
-    uint8_t readid;
-    /* out */
-    const char* member_name;
-} PoolMember_FindByTag_Data;
-
-static
-bool CC PoolMember_FindByTag(BSTNode *node, void *data)
-{
-    PoolMember_FindByTag_Data* d = (PoolMember_FindByTag_Data*)data;
-    const PoolMember* n = (const PoolMember*)node;
-    int i = 0;
-
-    const ReadSpecXML_read_BASECALL* bc = n->spec[d->readid].item[i];
-    while( bc != NULL ) {
-        if( strcmp(bc->read_group_tag, d->tag) == 0 ) {
-            d->member_name = n->name;
-            return true;
-        }
-        bc = n->spec[d->readid].item[++i];
-    }
-    return false;
-}
-
-rc_t Experiment_FindReadInTable(const ExperimentXML* cself, uint8_t read_id, const char* key, const char** basecall, const char** member_name)
-{
-    rc_t rc = 0;
-    if( cself == NULL || key == NULL || (basecall == NULL && member_name == NULL) ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else if( read_id >= cself->reads->nreads ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcId, rcOutofrange);
-    } else {
-        const ReadSpecXML_read* read_spec = &(cself->reads->reads[read_id++]);
-        if( read_spec->coord_type != rdsp_ExpectedBaseCallTable_ct ) {
-            rc = RC(rcSRA, rcFormatter, rcAccessing, rcName, rcNotFound);
-        } else {
-            ExpectedTableMatch match;
-
-            rc = RC(rcSRA, rcFormatter, rcAccessing, rcName, rcNotFound);
-            /* try to find key as basecall */
-            match.seq = key;
-            match.len = strlen(key);
-            match.tag = NULL;
-            match.direction = etm_Both;
-            match.left_adjusted = true;
-            if( Experiment_ExpectedTableMatch(&read_spec->coord.expected_basecalls, &match) ) {
-                rc = 0;
-                if( basecall != NULL ) {
-                    *basecall = match.bc->basecall;
-                }
-                if( member_name != NULL ) {
-                    if( cself->member_pool != NULL ) {
-                        PoolMember_FindByTag_Data data;
-                        data.readid = read_id;
-                        data.tag = match.bc->read_group_tag;
-                        if( BSTreeDoUntil(cself->member_pool, false, PoolMember_FindByTag, &data) ) {
-                            *member_name = data.member_name;
-                        } else {
-                            rc = RC(rcSRA, rcFormatter, rcAccessing, rcSelf, rcCorrupt);
-                        }
-                    } else {
-                        *member_name = NULL;
-                    }
-                }
-            } else if( cself->member_pool != NULL ) {
-                /* try to find key as member_name */
-                PoolMember* pm = (PoolMember*)BSTreeFind(cself->member_pool, key, PoolMember_FindByName);
-                if( pm != NULL ) {
-                    rc = 0;
-                    if( member_name != NULL ) {
-                        *member_name = pm->name;
-                    }
-                    if( basecall != NULL ) {
-                        if( pm->spec[read_id].item[0] != NULL ) {
-                            *basecall = pm->spec[read_id].item[0]->basecall;
-                            if( pm->spec[read_id].item[1] != NULL ) {
-                                rc = RC(rcSRA, rcFormatter, rcAccessing, rcData, rcAmbiguous);
-                            }
-                        } else {
-                            rc = RC(rcSRA, rcFormatter, rcAccessing, rcData, rcViolated);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t Experiment_HasPool(const ExperimentXML* cself, bool* has_pool)
-{
-    rc_t rc = 0;
-    if( cself == NULL || has_pool == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *has_pool = cself->member_pool != NULL;
-    }
-    return rc;
-}
-
-rc_t Experiment_ReadSegDefault(const ExperimentXML* self, SRASegment* seg)
-{
-    rc_t rc = 0;
-
-    /* TBD to do memberseg call based on junk seq of known length */
-    if( self == NULL || seg == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcResolving, rcParam, rcNull);
-    } else if( self->spot_length == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-    } else {
-        uint32_t i;
-        int32_t spot_len = self->spot_length;
-
-        i = self->reads->nreads;
-        do {
-            int16_t len = 0;
-            --i;
-            switch(self->reads->reads[i].coord_type) {
-                case rdsp_RelativeOrder_ct:
-                    if( i == 0 ) {
-                        len = spot_len;
-                    } else {
-                        len = 0;
-                    }
-                    break;
-                case rdsp_BaseCoord_ct:
-                case rdsp_CycleCoord_ct:
-                    len = spot_len - (self->reads->reads[i].coord.start_coord - 1);
-                    break;
-                case rdsp_ExpectedBaseCall_ct:
-                case rdsp_ExpectedBaseCallTable_ct:
-                    if( self->reads->reads[i].coord.expected_basecalls.base_coord > 0 ) {
-                        len = spot_len - (self->reads->reads[i].coord.expected_basecalls.base_coord - 1);
-                    }
-                    len += self->reads->reads[i].coord.expected_basecalls.default_length;
-                    break;
-                default:
-                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnexpected);
-                    LOGERR(klogErr, rc, "read type in default");
-                    break;
-            }
-            spot_len -= len;
-            if( spot_len < 0 || len < 0 ) {
-                rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                LOGERR(klogErr, rc, "cummulative read lengths and SEQUENCE_LENGTH");
-                return rc;
-            } else {
-                seg[i].start = spot_len;
-                seg[i].len = len;
-            }
-        } while( i > 0 );
-    }
-    return rc;
-}
-
-void Experiment_Whack(const ExperimentXML* cself)
-{
-    if( cself != NULL ) {
-        ExperimentXML* self = (ExperimentXML*)cself;
-
-        free(self->processing.quality_scorer);
-        ReadSpecXML_Whack(self->reads);
-        BSTreeWhack(self->member_pool, PoolMember_Whack, NULL);
-        free(self->member_pool);
-        PoolMember_Whack(&self->member_null->node, NULL);
-        PlatformXML_Whack(self->platform);
-        free(self);
-    }
-}
diff --git a/tools/sra-load/experiment-xml.h b/tools/sra-load/experiment-xml.h
deleted file mode 100644
index 8ab869d..0000000
--- a/tools/sra-load/experiment-xml.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_experiment_xml_
-#define _sra_load_experiment_xml_
-
-#include "common-xml.h"
-
-typedef struct ProcessingXML_struct {
-    char* quality_scorer;
-    ExperimentQualityType quality_type;
-    uint8_t quality_offset;
-    ExperimentBarcodeRule barcode_rule;
-
-} ProcessingXML;
-
-typedef struct ExperimentXML ExperimentXML;
-
-/* Make spot descriptor information structure based on XML file
- */
-rc_t Experiment_Make(const ExperimentXML** self, const KXMLDoc* doc, RunAttributes* attr);
-
-rc_t Experiment_GetPlatform(const ExperimentXML* cself, const PlatformXML** platform);
-
-rc_t Experiment_GetProcessing(const ExperimentXML* cself, const ProcessingXML** processing);
-
-rc_t Experiment_GetReadNumber(const ExperimentXML* cself, uint8_t* nreads);
-
-rc_t Experiment_GetSpotLength(const ExperimentXML* cself, uint32_t* spot_length);
-
-/* ZERO-based read_id here! */
-rc_t Experiment_GetRead(const ExperimentXML* cself, uint8_t read_id, const ReadSpecXML_read** read_spec);
-
-/* find in read (EXPECTED_BASECALL_TABLE type ONLY) basecall and/or member_name by bases or mamber_name
- * on of basecall or member_name must be not NULL
- */
-rc_t Experiment_FindReadInTable(const ExperimentXML* cself, uint8_t read_id, const char* key, const char** basecall, const char** member_name);
-
-rc_t Experiment_HasPool(const ExperimentXML* cself, bool* has_pool);
-
-rc_t Experiment_ReadSegDefault(const ExperimentXML* self, SRASegment* seg);
-
-rc_t Experiment_MemberSeg(const ExperimentXML* self,
-                          const char* const file_member_name, const char* const data_block_member_name,
-                          uint32_t nbases, const char* bases,
-                          SRASegment* seg, const char** const new_member_name);
-
-rc_t Experiment_MemberSegSimple(const ExperimentXML* self,
-                                const char* const file_member_name, const char* const data_block_member_name,
-                                const char** const new_member_name);
-
-
-void Experiment_Whack(const ExperimentXML* cself);
-
-#endif /* _sra_load_experiment_xml_ */
diff --git a/tools/sra-load/fastq-fmt.c b/tools/sra-load/fastq-fmt.c
deleted file mode 100644
index 35c3090..0000000
--- a/tools/sra-load/fastq-fmt.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-typedef struct FastqLoaderFmt FastqLoaderFmt;
-#define SRALOADERFMT_IMPL FastqLoaderFmt
-#include "loader-fmt.h"
-
-#include "writer-illumina.h"
-#include "writer-454.h"
-#include "writer-ion-torrent.h"
-#include "experiment-xml.h"
-#include "fastq-load.vers.h"
-#include "debug.h"
-
-typedef struct FileReadData_struct {
-    bool ready; /* if data is filled from file */
-    pstring name;
-    pstring barcode;
-    IlluminaRead read;
-} FileReadData;
-
-typedef struct FastqFileInfo_struct {
-    const SRALoaderFile* file;
-    /* parsed data from file for single spot */
-    FileReadData spot[2]; /* 2nd element is used for 8 line format file only */
-
-    int qualType;
-    ExperimentQualityEncoding qualEnc;
-    uint8_t qualOffset;
-    int8_t qualMin;
-    int8_t qualMax;
-
-    /* file line buffer */
-    const char* line; /* not NULL if contains unprocessed data */
-    size_t line_len;
-} FastqFileInfo;
-
-struct FastqLoaderFmt {
-    SRALoaderFmt dad;
-    const SRAWriterIllumina* wIllumina;
-    const SRAWriter454* w454;
-    const SRAWriterIonTorrent* wIonTorrent;
-
-    const ProcessingXML* processing;
-    int64_t spots_bad_allowed;
-    int64_t spots_bad_count;
-};
-
-static
-void FileReadData_init(FileReadData* read, bool name_only)
-{
-    pstring_clear(&read->name);
-    pstring_clear(&read->barcode);
-    IlluminaRead_Init(&read->read, name_only);
-    if( !name_only ) {
-        read->ready = false;
-    }
-}
-
-/* reads 1 line from given file
- * if file->line pointer is not NULL line is in buffer already, nothing is read
- * failes on error or if line empty and not optional
- */
-static
-rc_t file_read_line(FastqFileInfo* file, bool optional)
-{
-    rc_t rc = 0;
-static unsigned long lineNo=0;
-
-    if( file->line == NULL ) {
-        if( (rc = SRALoaderFileReadline(file->file, (const void**)&file->line, &file->line_len)) == 0 ) {
-            if( file->line == NULL || file->line_len == 0 ) {
-                if( !optional ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcString, rcInsufficient);
-                }
-            }
-            if( rc == 0 && file->line != NULL ) {
-                if( file->line_len > 0 ) {
-                    const char* e = file->line + file->line_len;
-                    /* right trim */
-                    while( --e >= file->line ) {
-                        if( *e!=0 && !isspace(*e) ) {
-                            break;
-                        }
-                        file->line_len--;
-                    }
-                }
-            }
-        }
-        ++lineNo;
-    }
-    return rc;
-}
-
-/*
- * compare seq to quality length ignoring traling spaces, no leading spaces expected
- */
-static
-bool match_seq_to_qual(const char* seq, size_t seq_len, const char* qual, size_t qual_len)
-{
-    char *space = NULL;
-
-    /* cut trailing spaces */
-    while( seq_len > 0 && seq[seq_len - 1] == ' ') {
-        seq_len--;
-    }
-    while( qual_len > 0 && qual[qual_len - 1] == ' ') {
-        qual_len--;
-    }
-    space = memchr(qual, ' ', qual_len);
-    if( space != NULL ) {
-        /* spaced numbers form: count numbers */
-        int spaceCount = 1;
-        do {
-            if( (space = memchr(space, ' ', qual_len - (space - qual))) != NULL ) {
-                spaceCount++;
-                space++;
-            }
-        } while( space != NULL );
-        qual_len = spaceCount;
-    }
-    return seq_len == qual_len;
-}
-
-/* parses name as a given word number (1-based) in a str of size len
- * looks for name(#barcode)?([\/.]\d)?
- * returns score of found parts
- * score == 0 word not found
- */ 
-static
-uint8_t parse_spot_name(const SRALoaderFile* file, FileReadData* spot, const char* str, size_t len, uint8_t word_number)
-{
-    uint8_t w, score = 0;
-    const char* name, *name_end;
-
-    name = name_end = str;
-    /* set name_end to end of word_number-th word */
-    for(w = 1; w <= word_number || name_end == NULL; w++ ) {
-        /* skip consecutive spaces */
-        while( *name_end == ' ' && name_end != &str[len] ) {
-            name_end++;
-        }
-        name = name_end;
-        name_end = memchr(name, ' ', len - (name_end - str));
-        if( name_end == NULL ) {
-            if( w == word_number ) {
-                name_end = &str[len];
-            }
-            break;
-        }
-    }
-    if( name != name_end && name_end != NULL ) {
-        char* x;
-        rc_t rc;
-
-        /* init only name portion */
-        FileReadData_init(spot, true);
-        --name_end; /* goto last char */
-        if( isdigit(name_end[0])&& (name_end[-1] == '\\' || name_end[-1] == '/' )) {
-            score++;
-            spot->read.read_id = name_end[0] - '0';
-            name_end -= 2;
-        } else if( isdigit(*name_end) && name_end[-1] == '.' ) {
-            int q = 0;
-            if( memrchr(name, '#', name_end - name) != NULL ) {
-                /* have barode -> this is read id */
-                q = 4;
-            } else {
-                /* may a read id, check to see if 4 coords follow */
-                const char* end = name_end - 1;
-                while( --end >= name ) {
-                    if( strchr(":|_", *end) != NULL ) {
-                        q++;
-                    } else if( !isdigit(*end) ) {
-                        break;
-                    }
-                }
-            }
-            if( q == 4 ) {
-                score++;
-                spot->read.read_id = name_end[0] - '0';
-                name_end -= 2;
-            }
-        }
-        if( (x = memrchr(name, '#', name_end - name)) != NULL ) {
-            score++;
-            if( (rc = pstring_assign(&spot->barcode, x + 1, name_end - x)) != 0 ) {
-                SRALoaderFile_LOG(file, klogErr, rc, "barcode $(b)", "b=%.*s", name_end - x, x + 1);
-                return 0;
-            }
-            if( pstring_strcmp(&spot->barcode, "0") == 0 ) {
-                pstring_clear(&spot->barcode);
-            } else if( spot->barcode.len >= 4 &&
-                       (strncmp(spot->barcode.data, "0/1_", 4) == 0 || strncmp(spot->barcode.data, "0/2_", 4) == 0) ) {
-                spot->read.read_id = spot->barcode.data[2] - '0';
-                pstring_assign(&spot->barcode, &spot->barcode.data[4], spot->barcode.len - 4);
-            }
-            name_end = --x;
-        }
-        score++;
-        if( (rc = pstring_assign(&spot->name, name, name_end - name + 1)) != 0 ) {
-            SRALoaderFile_LOG(file, klogErr, rc, "spot name $(n)", "n=%.*s", name_end - name + 1, name);
-            return 0;
-        }
-        /* search for _R\d\D in name and use it as read id, remove from name or spot won't assemble */
-        x = spot->name.data;
-        while( (x = strrchr(x, 'R')) != NULL ) {
-            if( x != spot->name.data && *(x - 1) == '_' && isdigit(*(x + 1)) && !isalnum(*(x + 2)) ) {
-                score++;
-		if(spot->read.read_id == -1){
-			spot->read.read_id = *(x + 1) - '0';
-		}
-                strcpy(x - 1, x + 2);
-                spot->name.len -= 4;
-                break;
-            }
-            x++;
-        }
-        /* find last '=' and use only whatever is to the left of it */
-        if( (x = memrchr(spot->name.data, '=', spot->name.len)) != NULL ) {
-            rc = pstring_assign(&spot->name, spot->name.data, (x - spot->name.data) );
-        }
-    }
-    return score;
-}
-
-/*
- * in a single line form tries to grab last to chunks defined by sep into seq and qual
- * ignores spaces adjucent to sep
- * normally line would look like "name sep seq sep sep qual"
- */
-static
-bool find_seq_qual_by_sep(FastqLoaderFmt* self, FastqFileInfo* file, const char sep)
-{
-    const char* seq = NULL, *qual = NULL;
-    size_t seq_len = 0, qual_len = 0;
-
-    FileReadData_init(file->spot, false);
-    qual = memrchr(file->line, sep, file->line_len);
-    if( qual != NULL ) {
-        seq = memrchr(file->line, sep, qual - file->line);
-        if( seq != NULL ) {
-            if( parse_spot_name(file->file, file->spot, file->line, seq - file->line, 1) != 0 ) {
-                /* skip leading spaces */
-                do {
-                    seq = seq + 1;
-                } while( *seq == ' ' && seq < (file->line + file->line_len) );
-                seq_len = qual - seq;
-                do {
-                    qual = qual + 1;
-                } while( *qual == ' ' && qual < (file->line + file->line_len)  );
-                qual_len = file->line_len - (qual - file->line);
-                if( *seq != sep && *seq != ' ' && seq_len != 0 &&
-                    *qual != sep && *qual != ' ' && qual_len != 0 ) {
-                    if( match_seq_to_qual(seq, seq_len, qual, qual_len) ) {
-                        rc_t rc;
-                        if( (rc = pstring_assign(&file->spot->read.seq, seq, seq_len)) == 0 ) {
-                            if( pstring_is_fasta(&file->spot->read.seq) ) {
-                                if( (rc = pstring_assign(&file->spot->read.qual, qual, qual_len)) == 0 ) {
-                                    file->spot->read.qual_type = file->qualType;
-                                    return true;
-                                }
-                            }
-                            file->spot->read.seq.len = 0;
-                        }
-                        if( rc != 0 ) {
-                            SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=storing read data");
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return false;
-}
-
-/*
- * read fasta or quality, which maybe wrapped on 70th column width,
- * into asciiZ buffer
- */
-static
-rc_t read_multiline_seq_or_qual(FastqFileInfo* file, const char stop, pstring* str)
-{
-    rc_t rc = 0;
-    bool append = false, optional = false;
-
-    while( rc == 0 ) {
-        if( (rc = file_read_line(file, optional)) == 0 ) {
-            if( optional && (file->line == NULL || (file->line_len > 0 && file->line[0] == stop)) ) {
-                /* eof or next line is defline -> stop, line stays in buffer */
-                break;
-            }
-            if( append && memchr(str->data, ' ', str->len) != NULL ) {
-                rc = pstring_append(str, " ", 1);
-            }
-            if( rc == 0 && (rc = pstring_append(str, file->line, file->line_len)) == 0 ) {
-                file->line = NULL; /* line processed */
-                optional = true;
-            }
-            append = true;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t read_spot_data_3lines(FastqFileInfo* file, FileReadData* sd, uint8_t best_word, uint8_t best_score, int qualType)
-{
-    rc_t rc = 0;
-
-    file->line = NULL; /* discard defline */
-    /* read sequence */
-    if( (rc = read_multiline_seq_or_qual(file, '+', &sd->read.seq)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading sequence data");
-    }
-    if( !pstring_is_fasta(&sd->read.seq) ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=expected sequence data");
-    }
-    /* next defline */
-    if( (rc = file_read_line(file, false)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading quality defline");
-    }
-    if( file->line[0] != '+' ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=expected '+' on quality defline");
-    }
-    if( file->line_len != 1 ) { /* there may be just '+' on quality defline */
-        FileReadData d;
-        uint8_t score = parse_spot_name(file->file, &d, &file->line[1], file->line_len - 1, best_word);
-        /* sometimes quality defline may NOT contain barcode and readid, so score will be lower than bestscore,
-           but must be at least == 1 with none empty line, which means that name was found */
-        if( score < 1 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=spot name not found");
-        }
-        if( pstring_cmp(&sd->name, &d.name) != 0 ||
-            (score == best_score && (pstring_cmp(&sd->barcode, &d.barcode) != 0 || sd->read.read_id != d.read.read_id)) ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=quality defline do not match sequence defline");
-        }
-    }
-    file->line = NULL; /* discard defline */
-    if( (rc = read_multiline_seq_or_qual(file, '@', &sd->read.qual)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=failed to read quality");
-    }
-    if( sd->read.qual.len <= 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcEmpty);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=quality");
-    }
-    sd->read.qual_type = qualType;
-    sd->ready = true;
-    return 0;
-}
-
-/* reads from a file data for a sinlge spot, data may be partial */
-static
-rc_t read_next_spot(FastqLoaderFmt* self, FastqFileInfo* file)
-{
-    rc_t rc = 0;
-
-    if( file->spot->ready ) {
-        /* data still not used */
-        return 0;
-    }
-    FileReadData_init(file->spot, false);
-    FileReadData_init(&file->spot[1], false);
-    if( (rc = file_read_line(file, true)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading more data");
-    } else if( file->line == NULL ) {
-        return 0; /* eof */
-    }
-    if( find_seq_qual_by_sep(self, file, ':') || find_seq_qual_by_sep(self, file, ' ') ) {
-        /* single line forms */
-        file->line = NULL; /* line consumed */
-        file->spot->ready = true;
-    } else  if( file->line[0] == '>' || file->line[0] == '@' ) {
-        /* 4 or 8 line format */
-        FileReadData sd;
-        uint8_t word = 0, best_word = 0;
-        uint8_t score = 0, best_score = 0;
-        /* find and parse spot name on defline */
-        do {
-            score = parse_spot_name(file->file, &sd, &file->line[1], file->line_len - 1, ++word);
-            if( score > best_score ) {
-                if( (rc = pstring_copy(&file->spot->name, &sd.name)) != 0 ||
-                    (rc = pstring_copy(&file->spot->barcode, &sd.barcode)) != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=copying read name");
-                }
-                file->spot->read.read_id = sd.read.read_id;
-                best_score = score;
-                best_word = word; /* used below for quality defline parsing */
-            }
-
-        } while(score != 0);
-        if( best_score == 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcId, rcNotFound);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=spot name not detected");
-        }
-        if( file->line[0] == '@' ) {
-            if( (rc = read_spot_data_3lines(file, file->spot, best_word, best_score, file->qualType)) != 0 ) {
-                return rc;
-            }
-            /* now we MAY have 5th line in buffer so we can check if it's 2nd read for 8 lines format */
-            if( file->line_len != 0 && file->line != NULL && file->line[0] == '@' ) {
-                /* try to find read id on next line */
-                FileReadData_init(&file->spot[1], false);
-                if( parse_spot_name(file->file, &file->spot[1], &file->line[1], file->line_len - 1, best_word) == best_score ) {
-                    if( pstring_cmp(&file->spot->name, &file->spot[1].name) == 0 &&
-                        pstring_cmp(&file->spot->barcode, &file->spot[1].barcode) == 0 &&
-                        file->spot->read.read_id != file->spot[1].read.read_id ) {
-                        /* since it is different read id with same name and barcode, fill up second read */
-                        if( (rc = read_spot_data_3lines(file, &file->spot[1], best_word, best_score, file->qualType)) != 0 ) {
-                            return rc;
-                        }
-                    }
-                }
-            }
-        } else {
-            /* 2 line seq or quality form */
-            file->line = NULL; /* line consumed */
-            /* read sequence/quality */
-            if( (rc = read_multiline_seq_or_qual(file, '>', &file->spot->read.seq)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading seq/qual data");
-            }
-            if( file->spot->read.seq.len == 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=empty string reading seq/qual data");
-            } else if( !pstring_is_fasta(&file->spot->read.seq) ) {
-                /* swap */
-                if( (rc = pstring_copy(&file->spot->read.qual, &file->spot->read.seq)) == 0 ) {
-                    file->spot->read.qual_type = file->qualType;
-                    pstring_clear(&file->spot->read.seq);
-                }
-            }
-            file->spot->ready = true;
-        }
-    } else {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcFile, rcInvalid);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=file corrupt or format unknown");
-    }
-    if( rc == 0 ) {
-        int k;
-        for(k = 0; k < 2; k++) {
-            FileReadData* rd = &file->spot[k];
-            if( rd->ready && rd->read.qual_type != ILLUMINAWRITER_COLMASK_NOTSET ) {
-                if( file->qualOffset == 0 ) {
-                    /* detect and remember */
-                    file->qualOffset = 33;
-		    file->qualMax = 94;
-                    rc = pstring_quality_convert(&rd->read.qual, file->qualEnc, file->qualOffset, file->qualMin, file->qualMax);
-                    if( GetRCState(rc) == rcOutofrange ) {
-                        file->qualOffset = 64;
-			file->qualMax = 61;
-                        rc = pstring_quality_convert(&rd->read.qual, file->qualEnc, file->qualOffset, file->qualMin, file->qualMax);
-                    }
-                } else {
-		    if(file->qualOffset == 33) file->qualMax = 94;
-                    rc = pstring_quality_convert(&rd->read.qual, file->qualEnc, file->qualOffset, file->qualMin, file->qualMax);
-                }
-                if( rc != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting quality");
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-static
-rc_t FastqLoaderFmt_WriteData(FastqLoaderFmt* self, uint32_t argc, const SRALoaderFile* const argv[], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t i, g = 0;
-    FastqFileInfo* files = NULL;
-    bool done;
-    static IlluminaSpot spot;
- 
-    if( (files = calloc(argc, sizeof(*files))) == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcMemory, rcInsufficient);
-    }
-
-    for(i = 0; rc == 0 && i < argc; i++) {
-        ExperimentQualityType qType;
-        FastqFileInfo* file = &files[i];
-
-        file->file = argv[i];
-        FileReadData_init(file->spot, false);
-        FileReadData_init(&file->spot[1], false);
-        if( (rc = SRALoaderFile_QualityScoringSystem(file->file, &qType)) == 0 &&
-            (rc = SRALoaderFile_QualityEncoding(file->file, &file->qualEnc)) == 0 &&
-            (rc = SRALoaderFile_AsciiOffset(file->file, &file->qualOffset)) == 0 ) {
-
-            file->qualType = ILLUMINAWRITER_COLMASK_NOTSET;
-
-            if( qType == eExperimentQualityType_Undefined ) {
-                qType = self->processing->quality_type;
-                file->qualOffset = self->processing->quality_offset;
-            }
-            switch(qType) {
-                case eExperimentQualityType_LogOdds:
-                case eExperimentQualityType_Other:
-                    if( self->w454 != NULL || self->wIonTorrent != NULL ) {
-                        rc = RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcInvalid);
-                        LOGERR(klogInt, rc, "quality type other than Phred is not supported for this PLATFORM");
-                    }
-                    file->qualMin = -40;
-                    file->qualMax = 41;
-                    file->qualType = ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS1;
-                    break;
-                default:
-                    SRALoaderFile_LOG(file->file, klogWarn, rc, 
-                        "quality_scoring_system attribute not set for this file, using Phred as default", NULL);
-                case eExperimentQualityType_Phred:
-                    file->qualType = ILLUMINAWRITER_COLMASK_QUALITY_PHRED;
-                    file->qualMin = 0;
-                    file->qualMax = (self->wIllumina) ? 61: 127;
-                    break;
-            }
-        }
-    }
-    do {
-        done = true;
-        for(i = 0; rc == 0 && i < argc; i++) {
-            FastqFileInfo* file = &files[i];
-            if( (rc = read_next_spot(self, file)) != 0 || !file->spot->ready ) {
-                continue;
-            }
-            done = false;
-#if _DEBUGGING
-            {{
-                FileReadData* ss = file->spot;
-                do {
-                    DEBUG_MSG(3, ("file-%u: name:'%s', bc:%s, rd:%i, flt:%hu, seq '%.*s', qual %u bytes\n",
-                                  i + 1, ss->name.data, ss->barcode.data, ss->read.read_id, ss->read.filter,
-                                  ss->read.seq.len, ss->read.seq.data, ss->read.qual.len));
-                    if( ss == &file->spot[1]){ break; }
-                    ss = file->spot[1].ready ? &file->spot[1] : NULL;
-                } while( ss != NULL );
-            }}
-#endif
-        }
-        if( rc != 0 || done ) {
-            break;
-        }
-        /* collect spot reads, matching by spot name
-         * spot data may be split across multiple files
-         */
-        IlluminaSpot_Init(&spot);
-        for(i = 0; rc == 0 && i < argc; i++) {
-            FileReadData* fspot = files[i].spot[0].ready ? &files[i].spot[0] : NULL;
-            while(rc == 0 && fspot != NULL ) {
-                rc = IlluminaSpot_Add(&spot, &fspot->name, &fspot->barcode, &fspot->read);
-                if( rc == 0 ) {
-                    g = i;
-                    fspot->ready = false;
-                } else if( GetRCState(rc) == rcIgnored ) {
-                    rc = 0;
-                } else {
-                    SRALoaderFile_LOG(files[i].file, klogErr, rc, "$(msg)", "msg=adding data to spot");
-                }
-                if( fspot == &files[i].spot[1]) { break; }
-                fspot = files[i].spot[1].ready ? &files[i].spot[1] : NULL;
-            }
-        }
-        if( rc == 0 ) {
-            if( self->wIllumina != NULL ) {
-                if( (rc = SRAWriterIllumina_Write(self->wIllumina, argv[0], &spot)) != 0 &&
-                    GetRCTarget(rc) == rcFormatter && GetRCContext(rc) == rcValidating ) {
-                    SRALoaderFile_LOG(files[g].file, klogWarn, rc, "$(msg) $(spot_name)", "msg=bad spot,spot_name=%.*s",
-                                                spot.name->len, spot.name->data);
-                    self->spots_bad_count++;
-                    if( self->spots_bad_allowed < 0 ||
-                        self->spots_bad_count <= self->spots_bad_allowed ) {
-                        rc = 0;
-                    }
-                }
-            } else if( spot.nreads != 1 ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnsupported);
-                SRALoaderFile_LOG(files[i].file, klogErr, rc, "$(msg)", "msg=multiple reads for this platform");
-            } else if( self->wIonTorrent != NULL ) {
-                rc = SRAWriterIonTorrent_WriteRead(self->wIonTorrent, argv[0], spot.name,
-                                                   spot.reads[0].seq, spot.reads[0].qual, NULL, NULL, 0, 0, 0, 0);
-            } else {
-                rc = SRAWriter454_WriteRead(self->w454, argv[0], spot.name,
-                                            spot.reads[0].seq, spot.reads[0].qual, NULL, NULL, 0, 0, 0, 0);
-            }
-        }
-    } while( rc == 0 );
-    free(files);
-    *spots_bad_count = self->spots_bad_count;
-    return rc;
-}
-
-static
-rc_t FastqLoaderFmt_Whack(FastqLoaderFmt *self, SRATable** table)
-{
-    SRAWriterIllumina_Whack(self->wIllumina, table);
-    SRAWriter454_Whack(self->w454, table);
-    SRAWriterIonTorrent_Whack(self->wIonTorrent, table);
-    free(self);
-    return 0;
-}
-
-const char UsageDefaultName[] = "fastq-load";
-
-uint32_t KAppVersion(void)
-{
-    return FASTQ_LOAD_VERS;
-}
-
-static
-rc_t FastqLoaderFmt_Version (const FastqLoaderFmt* self, uint32_t *vers, const char** name )
-{
-    *vers = FASTQ_LOAD_VERS;
-    *name = "Fastq";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 vtFastqLoaderFmt =
-{
-    1, 0,
-    FastqLoaderFmt_Whack,
-    FastqLoaderFmt_Version,
-    NULL,
-    FastqLoaderFmt_WriteData
-};
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    rc_t rc = 0;
-    FastqLoaderFmt* fmt;
-    const PlatformXML* platform;
-    const ProcessingXML* processing;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    *self = NULL;
-
-    if( (rc = Experiment_GetProcessing(config->experiment, &processing)) != 0 ||
-        (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ) {
-        return rc;
-    }
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( platform->id == SRA_PLATFORM_454 ) {
-        if( rc == 0 && (rc = SRAWriter454_Make(&fmt->w454, config)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to initialize 454 writer");
-        }
-    } else if( platform->id == SRA_PLATFORM_ION_TORRENT ) {
-        if( rc == 0 && (rc = SRAWriterIonTorrent_Make(&fmt->wIonTorrent, config)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to initialize Ion Torrent writer");
-        }
-    } else if(   (rc = SRAWriterIllumina_Make(&fmt->wIllumina, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize Illumina writer");
-    }
-    if( rc == 0 && (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&vtFastqLoaderFmt)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    }
-    if( rc != 0 ) {
-        FastqLoaderFmt_Whack(fmt, NULL);
-    } else {
-        fmt->processing = processing;
-        fmt->spots_bad_allowed = config->spots_bad_allowed;
-        fmt->spots_bad_count = 0;
-        *self = &fmt->dad;
-    }
-    return rc;
-}
diff --git a/tools/sra-load/fastq-load.vers b/tools/sra-load/fastq-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/fastq-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/helicos-fmt.c b/tools/sra-load/helicos-fmt.c
deleted file mode 100644
index d2f254b..0000000
--- a/tools/sra-load/helicos-fmt.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <kapp/main.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <assert.h>
-
-typedef struct HelicosLoaderFmt HelicosLoaderFmt;
-#define SRALOADERFMT_IMPL HelicosLoaderFmt
-#include "loader-fmt.h"
-
-#include "pstring.h"
-#include "writer-helicos.h"
-#include "helicos-load.vers.h"
-#include "debug.h"
-
-typedef enum EFileType_enum {
-    eNotSet = -1,
-    eCSFasta,
-    eQuality,
-    eSignalFTC,
-    eSignalCY3,
-    eSignalTXR,
-    eSignalCY5,
-    eFileTypeMax
-} EFileType;
-
-typedef struct HelicosFileInfo_struct {
-    /* parsed data from file for a single spot */
-    bool ready; /* if data is filled from file */
-    /* spot data */
-    pstring name;
-    pstring sequence;
-    pstring quality;
-
-    const SRALoaderFile* file;
-    /* file line buffer */
-    const char* line; /* not NULL if contains unprocessed data */
-    size_t line_len;
-} HelicosFileInfo;
-
-struct HelicosLoaderFmt {
-    SRALoaderFmt dad;
-    const SRAWriterHelicos* writer;
-};
-
-static
-void HelicosFileInfo_init(HelicosFileInfo* file)
-{
-    file->ready = false;
-    pstring_clear(&file->name);
-    pstring_clear(&file->sequence);
-    pstring_clear(&file->quality);
-}
-
-/* reads 1 line from given file
- * if file->line pointer is not NULL line is in buffer already, nothing is read
- * failes on error or if line empty and not optional
- */
-static
-rc_t file_read_line(HelicosFileInfo* file, bool optional)
-{
-    rc_t rc = 0;
-
-    if( file->line == NULL ) {
-        if( (rc = SRALoaderFileReadline(file->file, (const void**)&file->line, &file->line_len)) == 0 ) {
-            if( file->line == NULL || file->line_len == 0 ) {
-                if( !optional ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcString, rcInsufficient);
-                }
-            }
-            if( rc == 0 && file->line != NULL ) {
-                if( file->line_len > 0 ) {
-                    const char* e = file->line + file->line_len;
-                    /* right trim */
-                    while( --e >= file->line ) {
-                        if( !isspace(*e) ) {
-                            break;
-                        }
-                        file->line_len--;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/* reads from a file data for a sinlge spot, data may be partial */
-static
-rc_t read_next_spot(HelicosLoaderFmt* self, HelicosFileInfo* file)
-{
-    rc_t rc = 0;
-
-    if( file->ready ) {
-        /* data still not used */
-        return 0;
-    }
-    HelicosFileInfo_init(file);
-    if( (rc = file_read_line(file, true)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading more data");
-    } else if( file->line == NULL ) {
-        return 0; /* eof */
-    }
-    if( file->line[0] == '@' ) { /*** fastq format **/
-        if( (rc = pstring_assign(&file->name, &file->line[1], file->line_len - 1)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading name");
-        }
-        file->line = NULL;
-        if( (rc = file_read_line(file, false)) != 0 || file->line_len > sizeof(file->sequence.data)-1 ||
-            (rc = pstring_assign(&file->sequence, file->line, file->line_len)) != 0 ||
-            !pstring_is_fasta(&file->sequence) ) {
-            rc = rc ? rc : RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading sequence");
-        }
-        file->line = NULL;
-        if( (rc = file_read_line(file, false)) != 0 ||
-            file->line[0] != '+' || file->line_len != 1 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading quality defline");
-        }
-        file->line = NULL;
-        if( (rc = file_read_line(file, false)) != 0 || file->line_len > sizeof(file->quality.data)-1 ||
-            (rc = pstring_assign(&file->quality, file->line, file->line_len)) != 0 ||
-            (rc = pstring_quality_convert(&file->quality, eExperimentQualityEncoding_Ascii, 33, 0, 0x7F)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading quality");
-        }
-        file->line = NULL;
-        file->ready = true;
-    } else if( file->line[0] == '>' ) { /** fasta format **/
-	if( (rc = pstring_assign(&file->name, &file->line[1], file->line_len - 1)) != 0 ) {
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading name");
-        }
-        file->line = NULL;
-	if( (rc = file_read_line(file, false)) != 0 || file->line_len > sizeof(file->sequence.data)-1 ||
-            (rc = pstring_assign(&file->sequence, file->line, file->line_len)) != 0 ||
-            !pstring_is_fasta(&file->sequence) ) {
-            rc = rc ? rc : RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading sequence");
-        }
-	file->line = NULL;
-	file->quality.len = file->sequence.len;
-	memset(file->quality.data,14,file->quality.len);
-	file->ready = true;
-    } else {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcFile, rcInvalid);
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=expected '@'");
-    }
-#if _DEBUGGING
- DEBUG_MSG(3, ("READ: name:'%s', seq[%u]:'%s', qual[%u]\n", file->name.data,
-                file->sequence.len, file->sequence.data, file->quality.len)); /*
-    DEBUG_MSG(3, ("READ: name:'%s', seq[%u]:'%s', qual[%u]:'%s'\n", file->name.data,
-                file->sequence.len, file->sequence.data, file->quality.len, file->quality.data));*/
-#endif
-    return 0;
-}
-
-static
-rc_t HelicosLoaderFmt_WriteData(HelicosLoaderFmt* self, uint32_t argc, const SRALoaderFile* const argv[], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    HelicosFileInfo* files = NULL;
-    bool done;
-
-    if( (files = calloc(argc, sizeof(*files))) == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcMemory, rcInsufficient);
-    }
-    for(i = 0; rc == 0 && i < argc; i++) {
-        HelicosFileInfo* file = &files[i];
-        HelicosFileInfo_init(file);
-        file->file = argv[i];
-    }
-    do {
-        done = true;
-        for(i = 0; rc == 0 && i < argc; i++) {
-            HelicosFileInfo* file = &files[i];
-            if( (rc = read_next_spot(self, file)) == 0 && file->ready ) {
-                done = false;
-                rc = SRAWriterHelicos_Write(self->writer, argv[0], &file->name, &file->sequence, &file->quality);
-                file->ready = false;
-            }
-        }
-    } while( rc == 0 && !done );
-    free(files);
-    return rc;
-}
-
-static
-rc_t HelicosLoaderFmt_Whack(HelicosLoaderFmt *self, SRATable** table)
-{
-    SRAWriterHelicos_Whack(self->writer, table);
-    free(self);
-    return 0;
-}
-
-const char UsageDefaultName[] = "helicos-load";
-
-uint32_t KAppVersion(void)
-{
-    return HELICOS_LOAD_VERS;
-}
-
-static
-rc_t HelicosLoaderFmt_Version (const HelicosLoaderFmt* self, uint32_t *vers, const char** name )
-{
-    *vers = HELICOS_LOAD_VERS;
-    *name = "Helicos";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 vtHelicosLoaderFmt =
-{
-    1, 0,
-    HelicosLoaderFmt_Whack,
-    HelicosLoaderFmt_Version,
-    NULL,
-    HelicosLoaderFmt_WriteData
-};
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    rc_t rc = 0;
-    HelicosLoaderFmt* fmt;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    *self = NULL;
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( (rc = SRAWriterHelicos_Make(&fmt->writer, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize writer");
-    } else if( (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&vtHelicosLoaderFmt)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    }
-    /* Set result or free obj */
-    if( rc != 0 ) {
-        HelicosLoaderFmt_Whack(fmt, NULL);
-    } else {
-        *self = &fmt->dad;
-    }
-    return rc;
-}
diff --git a/tools/sra-load/helicos-load.vers b/tools/sra-load/helicos-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/helicos-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/illumina-fmt.c b/tools/sra-load/illumina-fmt.c
deleted file mode 100644
index ad0caa6..0000000
--- a/tools/sra-load/illumina-fmt.c
+++ /dev/null
@@ -1,853 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <assert.h>
-
-typedef struct IlluminaLoaderFmt IlluminaLoaderFmt;
-#define SRALOADERFMT_IMPL IlluminaLoaderFmt
-#include "loader-fmt.h"
-
-#include "writer-illumina.h"
-#include "illumina-load.vers.h"
-#include "debug.h"
-
-typedef enum EIlluminaNativeFileType_enum {
-    eIlluminaNativeFileTypeNotSet = 0,
-    eIlluminaNativeFileTypeQuality4 = 0x01,
-    eIlluminaNativeFileTypeQSeq = 0x02,
-    eIlluminaNativeFileTypeFasta = 0x04,
-    eIlluminaNativeFileTypeNoise = 0x08,
-    eIlluminaNativeFileTypeIntensity = 0x10,
-    eIlluminaNativeFileTypeSignal = 0x20
-} EIlluminaNativeFileType;
-
-struct {
-    EIlluminaNativeFileType type;
-    const char* key[3];
-} const file_types[] = {
-    /* order important, see WritaData loop */
-    { eIlluminaNativeFileTypeSignal,
-        { "_sig2.", NULL } },
-    { eIlluminaNativeFileTypeIntensity,
-        { "_int.", NULL } },
-    { eIlluminaNativeFileTypeNoise,
-        { "_nse.", NULL } },
-    { eIlluminaNativeFileTypeFasta,
-        { "_seq.", NULL } },
-    { eIlluminaNativeFileTypeQSeq,
-        { "_qseq.", ".qseq", NULL } },
-    { eIlluminaNativeFileTypeQuality4,
-        { "_prb.", NULL } }
-};
-
-typedef struct IlluminaFileInfo_struct {
-    /* parsed data from file for a single spot */
-    bool ready; /* if data is filled from file */
-    EIlluminaNativeFileType type;
-    struct IlluminaFileInfo_struct* prev;
-    struct IlluminaFileInfo_struct* next;
-
-    /* spot data */
-    pstring name;
-    pstring barcode;
-    long coord[4]; /* lane, tile, x, y - sort-merge keys */
-
-    IlluminaRead read;
-
-    const SRALoaderFile* file;
-    /* file line buffer */
-    const char* line; /* not NULL if contains unprocessed data */
-    size_t line_len;
-} IlluminaFileInfo;
-
-static
-void IlluminaFileInfo_init(IlluminaFileInfo* file)
-{
-    assert(file);
-    file->ready = false;
-    pstring_clear(&file->name);
-    memset(file->coord, 0, sizeof(file->coord));
-    IlluminaRead_Init(&file->read, false);
-}
-
-/* reads 1 line from given file
- * if file->line pointer is not NULL line is in buffer already, nothing is read
- * failes on error or if line empty and not optional
- */
-static
-rc_t file_read_line(IlluminaFileInfo* file, bool optional)
-{
-    rc_t rc = 0;
-
-    if( file->line == NULL ) {
-        if( (rc = SRALoaderFileReadline(file->file, (const void**)&file->line, &file->line_len)) == 0 ) {
-            if( file->line == NULL || file->line_len == 0 ) {
-                if( !optional ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcString, rcInsufficient);
-                }
-            }
-            if( rc == 0 && file->line != NULL ) {
-                if( file->line_len > 0 ) {
-                    const char* e = file->line + file->line_len;
-                    /* right trim */
-                    while( --e >= file->line ) {
-                        if( !isspace(*e) ) {
-                            break;
-                        }
-                        file->line_len--;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-/*
- * assumes tab separated file:
- * first 2 postiions concatinated with "_" into spot prefix
- * nextg 4 postiions concatinated with ":" into spot id: lane:tile:x:y
- * 7th (index) ignored
- * 8th is read id
- * 9th fasta
- * 10th quality
- * 11th (optional) read filter
- */
-static
-rc_t parse_qseq(IlluminaFileInfo* file, const char* data, size_t data_sz)
-{
-    rc_t rc = 0;
-    const char* t, *str = data, *end = data + data_sz;
-    int tabs = 0;
-    do {
-        if( (t = memchr(str, '\t', end - str)) != NULL ) {
-            switch(++tabs) {
-                case 1:
-                    rc = pstring_assign(&file->name, str, t - str);
-                    break;
-                case 2:
-                    if( (rc = pstring_append(&file->name, "_", 1)) == 0 ) {
-                        rc = pstring_append(&file->name, str, t - str);
-                    }
-                    break;
-                case 3:
-                case 4:
-                case 5:
-                case 6:
-                    errno = 0;
-                    file->coord[tabs - 3] = strtol(str, NULL, 10);
-                    if( errno != 0 ) {
-                        file->coord[tabs - 3] = 0;
-                    }
-                    if( (rc = pstring_append(&file->name, ":", 1)) == 0 ) {
-                        rc = pstring_append(&file->name, str, t - str);
-                    }
-                    break;
-                case 7:
-                    if( t - str != 1 || (*str != '0' && *str != '1') ) {
-                        rc = pstring_assign(&file->barcode, str, t - str);
-                    }
-                    break;
-                case 8:
-                    if( t - str != 1 || !isdigit(*str) ) {
-                        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-                    } else {
-                        file->read.read_id = *str - '0';
-                        if( file->read.read_id == 0 ) {
-                            file->read.read_id = ILLUMINAWRITER_READID_NONE;
-                        }
-                    }
-                    break;
-                case 9:
-                    rc = pstring_assign(&file->read.seq, str, t - str);
-                    break;
-                case 10:
-                    file->read.qual_type = ILLUMINAWRITER_COLMASK_QUALITY_PHRED;
-                    rc = pstring_assign(&file->read.qual, str, t - str);
-                    break;
-            }
-            str = ++t;
-        }
-    } while( rc == 0 && t != NULL && str < end );
-
-    if( rc == 0 ) {
-        if( tabs == 9 ) {
-            file->read.qual_type = ILLUMINAWRITER_COLMASK_QUALITY_PHRED;
-            rc = pstring_assign(&file->read.qual, str, end - str);
-        } else if( tabs == 10 ) {
-            if( end - str != 1 ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-            } else if( *str == '1' ) {
-                file->read.filter = SRA_READ_FILTER_PASS;
-            } else if( *str == '0' ) {
-                file->read.filter = SRA_READ_FILTER_REJECT;
-            } else {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-            }
-        } else {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-        }
-        if( rc == 0 ) {
-            if( file->read.seq.len != file->read.qual.len ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-            } else {
-                rc = pstring_quality_convert(&file->read.qual, eExperimentQualityEncoding_Ascii, 64, 0, 0x7F);
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t read_quality(const char* data, size_t data_sz, IlluminaRead* read)
-{
-    rc_t rc = 0;
-
-    if( (rc = pstring_assign(&read->qual, data, data_sz)) == 0 ) {
-        if( (rc = pstring_quality_convert(&read->qual, eExperimentQualityEncoding_Decimal, 0, -128, 127)) == 0 ) {
-            read->qual_type = ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t read_spot_coord(IlluminaFileInfo* file, const char* data, size_t data_sz, const char** tail)
-{
-    rc_t rc = 0;
-    const char* t, *str = data, *end = data + data_sz;
-    int tabs = 0;
-
-    if( tail ) {
-        *tail = NULL;
-    }
-    do {
-        if( (t = memchr(str, '\t', end - str)) != NULL ) {
-            switch(++tabs) {
-                case 1:
-                    errno = 0;
-                    file->coord[0] = strtol(str, NULL, 10);
-                    if( errno != 0 ) {
-                        file->coord[0] = 0;
-                    }
-                    rc = pstring_assign(&file->name, str, t - str);
-                    break;
-                case 2:
-                case 3:
-                case 4:
-                    errno = 0;
-                    file->coord[tabs - 1] = strtol(str, NULL, 10);
-                    if( errno != 0 ) {
-                        file->coord[tabs - 1] = 0;
-                    }
-                    if( (rc = pstring_append(&file->name, ":", 1)) == 0 ) {
-                        rc = pstring_append(&file->name, str, t - str);
-                    }
-                    if( tail ) {
-                        *tail = t + 1;
-                    }
-                    break;
-            }
-            str = ++t;
-        }
-    } while( rc == 0 && t != NULL && str < end && tabs < 4 );
-
-    if( tabs < 4 ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcTooShort);
-    }
-    return rc;
-}
-
-static
-rc_t read_signal(const char* data, size_t data_sz, pstring* str)
-{
-    rc_t rc = 0;
-    double d;
-    const char* c = data, *end = data + data_sz;
-    float* f = (float*)str->data;
-    float* fend = (float*)(str->data + sizeof(str->data));
-
-    while( rc == 0 && c != end ) {
-        char* next;
-        errno = 0;
-        d = strtod(c, &next);
-        if( errno != 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcOutofrange);
-        } else if( d == 0 && c == next ) {
-            break;
-        } else {
-            c = next;
-            if( f >= fend ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcBuffer, rcInsufficient);
-            }
-            *f++ = d;
-        }
-    }
-    if( rc == 0 ) {
-        str->len = (f - (float*)str->data) * sizeof(*f);
-        if( str->len == 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcEmpty);
-        }
-    }
-    return rc;
-}
-
-/* reads from a file data for a sinlge spot, data may be partial */
-static
-rc_t read_next_spot(const char* blk_pfx, IlluminaFileInfo* file)
-{
-    rc_t rc = 0;
-    const char* tail = file->line;
-
-    if( file->ready ) {
-        /* data still not used */
-        return 0;
-    }
-    IlluminaFileInfo_init(file);
-    if( (rc = file_read_line(file, true)) != 0 ) {
-        return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading more data");
-    } else if( file->line == NULL ) {
-        return 0; /* eof */
-    }
-    switch( file->type ) {
-        case eIlluminaNativeFileTypeQSeq:
-            if( (rc = parse_qseq(file, file->line, file->line_len)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading qseq");
-            }
-            break;
-
-        case eIlluminaNativeFileTypeFasta:
-        case eIlluminaNativeFileTypeNoise:
-        case eIlluminaNativeFileTypeIntensity:
-        case eIlluminaNativeFileTypeSignal:
-            {{
-                /* read only common first 4 coords into name and prepend with DATA_BLOCK/@name */
-                if( (rc = read_spot_coord(file, file->line, file->line_len, &tail)) == 0 ) {
-                    if( blk_pfx != NULL ) {
-                        pstring tmp_name;
-                        if( (rc = pstring_copy(&tmp_name, &file->name)) == 0 &&
-                            (rc = pstring_assign(&file->name, blk_pfx, strlen(blk_pfx))) == 0 &&
-                            (rc = pstring_append(&file->name, ":", 1)) == 0 ) {
-                            rc = pstring_concat(&file->name, &tmp_name);
-                        }
-                    }
-                }
-                if( rc != 0 ) {
-                    return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading spot coord");
-                }
-                break;
-            }}
-
-        case eIlluminaNativeFileTypeQuality4:
-            if( (rc = read_quality(file->line, file->line_len, &file->read)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading quality");
-            } else if( (rc = pstring_assign(&file->name, blk_pfx, strlen(blk_pfx))) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=name for quality 4");
-            }
-            break;
-
-        default:
-            rc = RC(rcSRA, rcFormatter, rcReading, rcFileFormat, rcUnknown);
-            return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=processing data line");
-            break;
-    }
-
-    /* process tail (after coords) for some file types */
-    file->line_len -= tail - file->line; /* length of tail */
-    switch( file->type ) {
-        case eIlluminaNativeFileTypeQSeq:
-        case eIlluminaNativeFileTypeQuality4:
-        default:
-            /* completely processed before */
-            break;
-
-        case eIlluminaNativeFileTypeFasta:
-            if( (rc = pstring_assign(&file->read.seq, tail, file->line_len)) != 0 ||
-                !pstring_is_fasta(&file->read.seq) ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcCorrupt);
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=reading fasta");
-            }
-            break;
-
-        case eIlluminaNativeFileTypeNoise:
-            if( (rc = read_signal(tail, file->line_len, &file->read.noise)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting noise");
-            }
-            break;
-
-        case eIlluminaNativeFileTypeIntensity:
-            if( (rc = read_signal(tail, file->line_len, &file->read.intensity)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting intensity");
-            }
-            break;
-
-        case eIlluminaNativeFileTypeSignal:
-            if( (rc = read_signal(tail, file->line_len, &file->read.signal)) != 0 ) {
-                return SRALoaderFile_LOG(file->file, klogErr, rc, "$(msg)", "msg=converting signal");
-            }
-            break;
-    }
-    file->line = NULL;
-    file->ready = true;
-#if _DEBUGGING
-    DEBUG_MSG(3, ("name:'%s' [%li:%li:%li:%li]\n", file->name.data, 
-                file->coord[0], file->coord[1], file->coord[2], file->coord[3]));
-    if( file->read.seq.len ) {
-        DEBUG_MSG(3, ("seq:'%.*s'\n", file->read.seq.len, file->read.seq.data));
-    }
-    if( file->read.qual.len ) {
-        DEBUG_MSG(3, ("qual{0x%x}: %u bytes\n", file->read.qual_type, file->read.qual.len));
-    }
-#endif
-    return 0;
-}
-
-struct IlluminaLoaderFmt {
-    SRALoaderFmt dad;
-    const SRAWriterIllumina* writer;
-    bool skip_intensity;
-    bool skip_signal;
-    bool skip_noise;
-    int64_t spots_bad_allowed;
-    int64_t spots_bad_count;
-};
-
-typedef struct FGroup_struct {
-    SLNode dad;
-    pstring key; /* part of filename w/o path up to ftypes value above */
-    const char* blk_pfx;
-    EIlluminaNativeFileType mask;
-    IlluminaFileInfo* files;
-} FGroup;
-
-typedef struct FGroup_Find_data_struct {
-    FGroup* found;
-    pstring key;
-} FGroup_Find_data;
-
-bool FGroup_Find( SLNode *node, void *data )
-{
-    FGroup* n = (FGroup*)node;
-    FGroup_Find_data* d = (FGroup_Find_data*)data;
-    IlluminaFileInfo* file = n->files;
-
-    while( file != NULL ) {
-        if( pstring_cmp(&file->name, &d->key) == 0 ) {
-            d->found = n;
-            return true;
-        }
-        file = file->next;
-    }
-    if( pstring_cmp(&d->key, &n->key) == 0 ) {
-        d->found = n;
-        return true;
-    }
-    return false;
-}
-
-void FGroup_Validate( SLNode *node, void *data )
-{
-    rc_t* rc = (rc_t*)data;
-    static EIlluminaNativeFileType mask = eIlluminaNativeFileTypeNotSet;
-    FGroup* n = (FGroup*)node;
-    IlluminaFileInfo* file = n->files;
-
-    DEBUG_MSG(3, ("==> group: '%s'\n", n->key.data));
-    while( file != NULL ) {
-        DEBUG_MSG(3, ("file: type %u '%s'\n", file->type, file->name.data));
-        if( mask == eIlluminaNativeFileTypeNotSet ) {
-            mask = n->mask;
-            if( !(mask & (eIlluminaNativeFileTypeFasta | eIlluminaNativeFileTypeQSeq)) ) {
-                *rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcNotFound);
-                SRALoaderFile_LOG(file->file, klogErr, *rc, "file group '$(p)*': sequence data", PLOG_S(p) , n->key.data);
-            }
-            if( (mask & eIlluminaNativeFileTypeFasta) && (mask & eIlluminaNativeFileTypeQSeq) ) {
-                *rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-                SRALoaderFile_LOG(file->file, klogErr, *rc, "file group '$(p)*': _seq and _qseq", PLOG_S(p) , n->key.data);
-            }
-            if( !(mask & eIlluminaNativeFileTypeQuality4) && !(mask & eIlluminaNativeFileTypeQSeq) ) {
-                *rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcNotFound);
-                SRALoaderFile_LOG(file->file, klogErr, *rc, "file group '$(p)*': quality data", PLOG_S(p) , n->key.data);
-            }
-        } else if( mask != n->mask ) {
-            *rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-            SRALoaderFile_LOG(file->file, klogErr, *rc, "file group '$(p)*': no match in spot names on 1st lines across files in group",
-                              PLOG_S(p) , n->key.data);
-        }
-        file = file->next;
-    }
-    DEBUG_MSG(3, ("<== group: '%s'\n", n->key.data));
-}
-
-void FGroup_Whack(SLNode *n, void *data )
-{
-    if( n != NULL ) {
-        FGroup* node = (FGroup*)n;
-        IlluminaFileInfo* file = node->files;
-
-        while( file != NULL ) {
-            IlluminaFileInfo* x = file;
-            file = file->next;
-            free(x);
-        }
-        free(node);
-    }
-}
-
-typedef struct FGroup_Parse_data_struct {
-    rc_t rc;
-    IlluminaLoaderFmt* self;
-    IlluminaSpot spot;
-} FGroup_Parse_data;
-
-bool FGroup_Parse( SLNode *n, void *d )
-{
-    FGroup_Parse_data* data = (FGroup_Parse_data*)d;
-    FGroup* g = (FGroup*)n;
-    bool done;
-    const SRALoaderFile* data_block_ref = NULL;
-
-    data->rc = 0;
-    do {
-        IlluminaFileInfo* file = g->files;
-        done = true;
-        while( data->rc == 0 && file != NULL ) {
-            if( (data->rc = read_next_spot(g->blk_pfx, file)) == 0 && file->ready ) {
-                done = false;
-            }
-            file = file->next;
-        }
-        if( data->rc != 0 || done ) {
-            break;
-        }
-        /* collect spot reads, matching by spot name
-         * spot data may be split across multiple files
-         */
-        IlluminaSpot_Init(&data->spot);
-        file = g->files;
-        while( data->rc == 0 && file != NULL ) {
-            if( file->ready ) {
-                if( (file->type == eIlluminaNativeFileTypeNoise && data->self->skip_noise) ||
-                    (file->type == eIlluminaNativeFileTypeIntensity && data->self->skip_intensity) ||
-                    (file->type == eIlluminaNativeFileTypeSignal && data->self->skip_signal) ) {
-                    file->ready = false;
-                } else {
-                    data_block_ref = file->file;
-                    if( file->type == eIlluminaNativeFileTypeQSeq && (g->mask & eIlluminaNativeFileTypeQuality4) ) {
-                        /* drop quality1 from qseq data */
-                        pstring_clear(&file->read.qual);
-                    } else if( file->type == eIlluminaNativeFileTypeQuality4 ) {
-                        IlluminaFileInfo* neib = file->next ? file->next : file->prev;
-                        /* need to fix spotname to be same cause prb do not have any name in it */
-                        if( (data->rc = pstring_copy(&file->name, &neib->name)) != 0 ) {
-                            SRALoaderFile_LOG(file->file, klogErr, data->rc, "$(msg) '$(n)'", "msg=syncing prb spot name,n=%s", neib->name.data);
-                        }
-                    }
-                    if( data->rc == 0 ) {
-                        data->rc = IlluminaSpot_Add(&data->spot, &file->name, &file->barcode, &file->read);
-                        if( data->rc == 0 ) {
-                            file->ready = false;
-                        } else {
-                            if( GetRCState(data->rc) == rcIgnored ) {
-                                SRALoaderFile_LOG(file->file, klogWarn, data->rc, "$(msg) '$(s1)' <> '$(s2)'",
-                                                "msg=spot name mismatch,s1=%.*s,s2=%.*s",
-                                                data->spot.name->len, data->spot.name->data, file->name.len, file->name.data);
-                                data->self->spots_bad_count++;
-                                /* skip spot for all files in a group */
-                                file = g->files;
-                                while( file != NULL ) {
-                                    file->ready = false;
-                                    SRALoaderFile_LOG(file->file, klogWarn, data->rc,
-                                                      "$(msg) '$(n)'", "msg=skipped spot,n=%s", file->name.data);
-                                    file = file->next;
-                                }
-                                if( data->self->spots_bad_allowed >= 0 &&
-                                    data->self->spots_bad_count > data->self->spots_bad_allowed ) {
-                                    data->rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInvalid);
-                                }
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-            file = file->next;
-        }
-        if( GetRCState(data->rc) == rcIgnored ) {
-            data->rc = 0;
-            continue;
-        }
-        if( data->rc == 0 ) {
-            data->rc = SRAWriterIllumina_Write(data->self->writer, data_block_ref, &data->spot);
-        }
-    } while( data->rc == 0 );
-    return data->rc != 0;
-}
-
-static
-rc_t IlluminaLoaderFmt_WriteData(IlluminaLoaderFmt* self, uint32_t argc, const SRALoaderFile* const argv[], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t t, i, k, ftype_q = sizeof(file_types) / sizeof(file_types[0]);
-    SLList files;
-    IlluminaFileInfo* file = NULL;
-
-    SLListInit(&files);
-
-    /* group files using spotname, for _prb. file name prefix is used,
-       files reviewed by type detected from name and ordered by file_type array */
-    for(t = 0; rc == 0 && t < ftype_q; t++) {
-        for(i = 0; rc == 0 && i < argc; i++) {
-            const char* fname, *blk_pfx;
-            int prefix_len = 0;
-            ERunFileType ftype;
-            EIlluminaNativeFileType type = eIlluminaNativeFileTypeNotSet;
-            FGroup_Find_data data;
-
-            if( (rc = SRALoaderFileName(argv[i], &fname)) != 0 ) {
-                SRALoaderFile_LOG(argv[i], klogErr, rc, "reading file name", NULL);
-                break;
-            }
-            if( (rc = SRALoaderFile_FileType(argv[i], &ftype)) != 0 ) {
-                SRALoaderFile_LOG(argv[i], klogErr, rc, "reading file type", NULL);
-                break;
-            }
-            if( (rc = SRALoaderFileBlockName(argv[i], &blk_pfx)) != 0 ) {
-                SRALoaderFile_LOG(argv[i], klogErr, rc, "reading DATA_BLOCK/@name", NULL);
-                break;
-            }
-            if( blk_pfx == NULL ) {
-                blk_pfx = "";
-            }
-            {{
-                /* skip path if present */
-                const char* p = strrchr(fname, '/');
-                fname = p ? p + 1 : fname;
-                p = NULL;
-                for(k = 0; type == eIlluminaNativeFileTypeNotSet && k < ftype_q; k++) {
-                    const char* const* e = file_types[k].key;
-                    while( *e != NULL ) {
-                        p = strstr(fname, *e++);
-                        if( p != NULL ) {
-                            type = file_types[k].type;
-                            break;
-                        } 
-                    }
-                }
-                if( p != NULL ) {
-                    prefix_len = p - fname;
-                }
-            }}
-            if( ftype == rft_IlluminaNativeSeq ) {
-                type = eIlluminaNativeFileTypeFasta;
-            } else if( ftype == rft_IlluminaNativePrb ) {
-                type = eIlluminaNativeFileTypeQuality4;
-            } else if( ftype == rft_IlluminaNativeInt ) {
-                type = eIlluminaNativeFileTypeIntensity;
-            } else if( ftype == rft_IlluminaNativeQseq ) {
-                type = eIlluminaNativeFileTypeQSeq;
-            }
-            if( type == eIlluminaNativeFileTypeNotSet ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-                SRALoaderFile_LOG(argv[i], klogErr, rc, "detecting file type by file name", NULL);
-                break;
-            }
-            if( type != file_types[t].type ) {
-                /* one type at a time */
-                continue;
-            }
-            DEBUG_MSG(3, ("file '%s' type set to %d\n", fname, type));
-            file = calloc(1, sizeof(*file));
-            if( file == NULL ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcMemory, rcExhausted);
-                SRALoaderFile_LOG(argv[i], klogErr, rc, "allocating file object", NULL);
-                break;
-            }
-            IlluminaFileInfo_init(file);
-            file->file = argv[i];
-            file->type = type;
-
-            if( file->type == eIlluminaNativeFileTypeQuality4 ) {
-                /* in _prb there is no spotname inside so use file prefix */
-                rc = pstring_assign(&data.key, fname, prefix_len);
-            } else {
-                /* try to get 1st spot so group can be organized by spot name */
-                if( (rc = read_next_spot(blk_pfx, file)) != 0 || !file->ready ) {
-                    rc = rc ? rc : RC(rcSRA, rcFormatter, rcReading, rcData, rcNotFound);
-                    SRALoaderFile_LOG(argv[i], klogErr, rc, "reading 1st spot", NULL);
-                    break;
-                }
-                rc = pstring_copy(&data.key, &file->name);
-            }
-
-            data.found = NULL;
-            if( SLListDoUntil(&files, FGroup_Find, &data) && data.found != NULL ) {
-                IlluminaFileInfo* ss = data.found->files;
-
-                while( rc == 0 && file != NULL ) {
-                    if( ss->type != eIlluminaNativeFileTypeQSeq && ss->type == file->type ) {
-                        rc = RC(rcSRA, rcFormatter, rcReading, rcFile, rcDuplicate);
-                        SRALoaderFile_LOG(argv[i], klogErr, rc, "type of file for lane", NULL);
-                    } else if( ss->next != NULL ) {
-                        ss = ss->next;
-                    } else {
-                        ss->next = file;
-                        file->prev = ss;
-                        data.found->mask |= file->type;
-                        file = NULL;
-                    }
-                }
-            } else {
-                data.found = calloc(1, sizeof(*data.found));
-                if( data.found == NULL ) {
-                    rc = RC(rcSRA, rcFormatter, rcReading, rcMemory, rcInsufficient);
-                    SRALoaderFile_LOG(argv[i], klogErr, rc, "preparing file group", NULL);
-                    break;
-                } else {
-                    if( (rc = pstring_assign(&data.found->key, fname, prefix_len)) != 0 ) {
-                        SRALoaderFile_LOG(argv[i], klogErr, rc, "setting file group key", NULL);
-                        FGroup_Whack(&data.found->dad, NULL);
-                        break;
-                    } else {
-                        FGroup* curr = (FGroup*)SLListHead(&files), *prev = NULL;
-                        data.found->blk_pfx = blk_pfx;
-                        data.found->files = file;
-                        data.found->mask = file->type;
-                        /* group inserted into list by coords in 1st spot */
-                        while( curr != NULL ) {
-                            if( curr->files[0].coord[0] > file->coord[0] ||
-                                (curr->files[0].coord[0] == file->coord[0] &&
-                                 curr->files[0].coord[1] > file->coord[1]) ) {
-                                data.found->dad.next = &curr->dad;
-                                if( prev == NULL ) {
-                                    files.head = &data.found->dad;
-                                } else {
-                                    prev->dad.next = &data.found->dad;
-                                }
-                                break;
-                            }
-                            prev = curr;
-                            curr = (FGroup*)curr->dad.next;
-                        }
-                        if( curr == NULL ) {
-                            SLListPushTail(&files, &data.found->dad);
-                        }
-                        file = NULL;
-                    }
-                }
-            }
-        }
-    }
-    if( rc == 0 ) {
-        SLListForEach(&files, FGroup_Validate, &rc);
-    }
-    if( rc == 0 ) {
-        FGroup_Parse_data data;
-        data.self = self;
-        if( SLListDoUntil(&files, FGroup_Parse, &data) ) {
-            rc = data.rc;
-        }
-    } else {
-        free(file);
-    }
-    SLListWhack(&files, FGroup_Whack, NULL);
-    *spots_bad_count = self->spots_bad_count;
-    return rc;
-}
-
-static
-rc_t IlluminaLoaderFmt_Whack(IlluminaLoaderFmt *self, SRATable** table)
-{
-    SRAWriterIllumina_Whack(self->writer, table);
-    free(self);
-    return 0;
-}
-
-const char UsageDefaultName[] = "illumina-load";
-
-uint32_t KAppVersion(void)
-{
-    return ILLUMINA_LOAD_VERS;
-}
-
-static
-rc_t IlluminaLoaderFmt_Version (const IlluminaLoaderFmt* self, uint32_t *vers, const char** name )
-{
-    *vers = ILLUMINA_LOAD_VERS;
-    *name = "Illumina native";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 vtIlluminaLoaderFmt =
-{
-    1, 0,
-    IlluminaLoaderFmt_Whack,
-    IlluminaLoaderFmt_Version,
-    NULL,
-    IlluminaLoaderFmt_WriteData
-};
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    rc_t rc = 0;
-    IlluminaLoaderFmt* fmt;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    *self = NULL;
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( (rc = SRAWriterIllumina_Make(&fmt->writer, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize writer");
-    } else if( (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&vtIlluminaLoaderFmt)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    }
-    if( rc != 0 ) {
-        IlluminaLoaderFmt_Whack(fmt, NULL);
-    } else {
-        fmt->skip_signal = (config->columnFilter & (efltrSIGNAL | efltrDEFAULT));
-        fmt->skip_noise = (config->columnFilter & (efltrNOISE | efltrDEFAULT));
-        fmt->skip_intensity = (config->columnFilter & (efltrINTENSITY | efltrDEFAULT));
-        fmt->spots_bad_allowed = config->spots_bad_allowed;
-        fmt->spots_bad_count = 0;
-        *self = &fmt->dad;
-    }
-    return rc;
-}
diff --git a/tools/sra-load/illumina-load.vers b/tools/sra-load/illumina-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/illumina-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/loader-file.c b/tools/sra-load/loader-file.c
deleted file mode 100644
index feeff1a..0000000
--- a/tools/sra-load/loader-file.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*/
-#include <klib/rc.h>
-
-#include "loader-file.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-struct SRALoaderFile
-{
-    const DataBlock* data_block;
-    const DataBlockFileAttr* file_attr;
-    const KLoaderFile *lfile;
-};
-
-rc_t SRALoaderFile_IsEof(const SRALoaderFile* cself, bool* eof)
-{
-    return KLoaderFile_IsEof(cself ? cself->lfile : NULL, eof);
-}
-
-rc_t SRALoaderFile_LOG(const SRALoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    rc = KLoaderFile_VLOG(cself ? cself->lfile : NULL, lvl, rc, msg, fmt, args);
-    va_end(args);
-    return rc;
-}
-
-rc_t SRALoaderFile_Offset(const SRALoaderFile* cself, uint64_t* offset)
-{
-    return KLoaderFile_Offset(cself ? cself->lfile : NULL, offset);
-}
-
-rc_t SRALoaderFileReadline(const SRALoaderFile* cself, const void** buffer, size_t* length)
-{
-    return KLoaderFile_Readline(cself ? cself->lfile : NULL, buffer, length);
-}
-
-rc_t SRALoaderFileRead(const SRALoaderFile* cself, size_t advance, size_t size, const void** buffer, size_t* length)
-{
-    return KLoaderFile_Read(cself ? cself->lfile : NULL, advance, size, buffer, length);
-}
-
-rc_t SRALoaderFileName(const SRALoaderFile *cself, const char **name)
-{
-    return KLoaderFile_Name(cself ? cself->lfile : NULL, name);
-}
-
-rc_t SRALoaderFileFullName(const SRALoaderFile *cself, const char **name)
-{
-    return KLoaderFile_FullName(cself ? cself->lfile : NULL, name);
-}
-
-rc_t SRALoaderFileResolveName(const SRALoaderFile *self, char *resolved, size_t rsize)
-{
-    return KLoaderFile_ResolveName(self ? self->lfile : NULL, resolved, rsize);
-}
-
-rc_t SRALoaderFileBlockName ( const SRALoaderFile *cself, const char **block_name )
-{
-    if( cself == NULL || block_name == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *block_name = cself->data_block->name;
-    return 0;
-}
-
-rc_t SRALoaderFileMemberName(const SRALoaderFile *cself, const char **member_name)
-{
-    if( cself == NULL || member_name == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *member_name = cself->data_block->member_name;
-    return 0;
-}
-
-rc_t SRALoaderFileSector( const SRALoaderFile *cself, int64_t* sector)
-{
-    if( cself == NULL || sector == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *sector = cself->data_block->sector;
-    return 0;
-}
-
-rc_t SRALoaderFileRegion( const SRALoaderFile *cself, int64_t* region)
-{
-    if( cself == NULL || region == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *region = cself->data_block->region;
-    return 0;
-}
-
-rc_t SRALoaderFile_QualityScoringSystem( const SRALoaderFile *cself, ExperimentQualityType* quality_scoring_system )
-{
-    if( cself == NULL || quality_scoring_system == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *quality_scoring_system = cself->file_attr->quality_scoring_system;
-    return 0;
-}
-
-rc_t SRALoaderFile_QualityEncoding( const SRALoaderFile *cself, ExperimentQualityEncoding* quality_encoding )
-{
-    if( cself == NULL || quality_encoding == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *quality_encoding = cself->file_attr->quality_encoding;
-    return 0;
-}
-
-rc_t SRALoaderFile_AsciiOffset( const SRALoaderFile *cself, uint8_t* ascii_offset )
-{
-    if( cself == NULL || ascii_offset == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *ascii_offset = cself->file_attr->ascii_offset;
-    return 0;
-}
-
-rc_t SRALoaderFile_FileType( const SRALoaderFile *cself, ERunFileType* filetype )
-{
-    if( cself == NULL || filetype == NULL ) {
-        return RC(rcSRA, rcFile, rcAccessing, rcParam, rcNull);
-    }
-    *filetype = cself->file_attr->filetype;
-    return 0;
-}
-
-rc_t SRALoaderFile_Release(const SRALoaderFile* cself)
-{
-    rc_t rc = 0;
-
-    if( cself ) {
-        SRALoaderFile* self = (SRALoaderFile*)cself;
-        /* may return md5 check error here */
-        rc = KLoaderFile_Release(self->lfile, false);
-        free(self);
-    }
-    return rc;
-}
-
-rc_t SRALoaderFile_Make(const SRALoaderFile **cself, const KDirectory* dir, const char* filename,
-                        const DataBlock* block, const DataBlockFileAttr* fileattr, const uint8_t* md5_digest, bool read_ahead)
-{
-    rc_t rc = 0;
-    SRALoaderFile* obj;
-
-    if( cself == NULL || block == NULL || fileattr == NULL ) {
-        rc = RC(rcSRA, rcFile, rcConstructing, rcParam, rcNull);
-    } else {
-        if( (obj = calloc(1, sizeof(*obj))) == NULL ) {
-            rc = RC(rcSRA, rcFile, rcConstructing, rcMemory, rcExhausted);
-        } else if( (rc = KLoaderFile_Make(&obj->lfile, dir, filename, md5_digest, read_ahead)) == 0 ) {
-            obj->data_block = block;
-            obj->file_attr = fileattr;
-            *cself = obj;
-        }
-        if( rc != 0 ) {
-            *cself = NULL;
-            SRALoaderFile_Release(obj);
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-load/loader-file.h b/tools/sra-load/loader-file.h
deleted file mode 100644
index 261eb32..0000000
--- a/tools/sra-load/loader-file.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_file_
-#define _sra_load_file_
-
-#include <klib/defs.h>
-#include <klib/log.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kapp/loader-file.h>
-
-#include "run-xml.h"
-
-/*--------------------------------------------------------------------------
-* SRA reader buffered input file
-*/
-typedef struct SRALoaderFile SRALoaderFile;
-
-rc_t SRALoaderFile_Make(const SRALoaderFile **cself, const KDirectory* dir, const char* filename,
-                        const DataBlock* block, const DataBlockFileAttr* fileattr, const uint8_t* md5_digest, bool read_ahead);
-
-rc_t SRALoaderFile_Release(const SRALoaderFile* cself);
-
-/* returns true if eof is reached and buffer is empty */
-rc_t SRALoaderFile_IsEof(const SRALoaderFile* cself, bool* eof);
-
-/* print error msg file file info and return original!! rc
-   if msg is NULL fmt is not used so call with NULL, NULL if no msg needs to be printed */
-rc_t SRALoaderFile_LOG(const SRALoaderFile* cself, KLogLevel lvl, rc_t rc, const char *msg, const char *fmt, ...);
-
-/* returns current buffer position in file */
-rc_t SRALoaderFile_Offset(const SRALoaderFile* cself, uint64_t* offset);
-
-/* file name */
-rc_t SRALoaderFileName ( const SRALoaderFile *cself, const char **name );
-
-rc_t SRALoaderFileFullName(const SRALoaderFile *cself, const char **name);
-
-rc_t SRALoaderFileResolveName(const SRALoaderFile  *self, char *resolved, size_t rsize);
-
-/* DATA_BLOCK name attribute */
-rc_t SRALoaderFileBlockName ( const SRALoaderFile *cself, const char **block_name );
-
-/* DATA_BLOCK member_name attribute */
-rc_t SRALoaderFileMemberName ( const SRALoaderFile *cself, const char **member_name );
-
-/* DATA_BLOCK sector attribute */
-rc_t SRALoaderFileSector( const SRALoaderFile *cself, int64_t* sector);
-
-/* DATA_BLOCK region attribute */
-rc_t SRALoaderFileRegion( const SRALoaderFile *cself, int64_t* region);
-
-/* FILE @quality_scoring_system */
-rc_t SRALoaderFile_QualityScoringSystem( const SRALoaderFile *scelf, ExperimentQualityType* quality_scoring_system );
-
-/* FILE @quality_encoding */
-rc_t SRALoaderFile_QualityEncoding( const SRALoaderFile *cself, ExperimentQualityEncoding* quality_encoding );
-
-/* FILE @ascii_offset */
-rc_t SRALoaderFile_AsciiOffset( const SRALoaderFile *cself, uint8_t* ascii_offset );
-
-/* FILE @filetype */
-rc_t SRALoaderFile_FileType( const SRALoaderFile *cself, ERunFileType* filetype );
-
-/* Readline
- *  makes next line from a file available in buffer.
- *  eligable EOL symbols are: \n (unix), \r (older mac), \r\n (win)
- *  EOL symbol(s) never included in buffer length.
- *  if there is no EOL at EOF - not an error.
- *  fails if internal buffer is insufficient.
- *  buffer is NULL on EOF
- *  rc state of (rcString rcTooLong) means line was too long
- *              you may copy line and readline again for the tail of the line
- *
- *  "buffer" [ OUT ] and "length" [ OUT ] - returned line and it's length
- */
-rc_t SRALoaderFileReadline(const SRALoaderFile* cself, const void** buffer, size_t* length);
-
-/* Read
-*  reads "size" bytes from file and makes them available through "buffer"
-*  if "advance" is > 0 than before reading skips "advance" bytes in file
-*  if "size" == 0 then nothing is read and available "length" bytes is returned in "buffer"
-*
-*  "buffer" [ OUT ] - pointer to read bytes, "buffer" NULL means EOF
-*  "length" [ OUT ] - number of read bytes, normally == size,
-                      if less than requested size, rc is [rcBuffer,rcInsufficient], advance and read more!
-*/
-rc_t SRALoaderFileRead(const SRALoaderFile* cself, size_t advance, size_t size, const void** buffer, size_t* length);
-
-#endif /* _sra_load_file_ */
diff --git a/tools/sra-load/loader-fmt.c b/tools/sra-load/loader-fmt.c
deleted file mode 100644
index 2e11457..0000000
--- a/tools/sra-load/loader-fmt.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-
-#include "loader-fmt.h"
-
-rc_t SRALoaderFmtInit( SRALoaderFmt *self, const SRALoaderFmt_vt *vt )
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcSelf, rcNull);
-    } else if( vt == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcInterface, rcNull);
-    } else {
-        switch( vt->v1.maj ) {
-            case 0:
-                rc = RC(rcSRA, rcFormatter, rcConstructing, rcInterface, rcInvalid);
-                break;
-            case 1:
-                if( vt->v1.destroy == NULL || vt->v1.version == NULL ||
-                    (vt->v1.write_data == NULL && vt->v1.exec_prep == NULL) ) {
-                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcInterface, rcInvalid);
-                }
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcConstructing, rcInterface, rcBadVersion);
-                break;
-        }
-    }
-    if( rc == 0 ) {
-        self->vt = vt;
-    } else if( KLogLastErrorCode() != rc ) {
-        PLOGERR( klogInt, (klogInt, rc, "failed to initialize loader formatter version $(maj).$(min)",
-                              "maj=%u,min=%u", vt ? vt->v1.maj : 0, vt ? vt->v1.min : 0));
-    }
-    return rc;
-}
-
-rc_t SRALoaderFmtRelease ( const SRALoaderFmt *cself, SRATable** table )
-{
-    rc_t rc = 0;
-
-    if( cself != NULL ) {
-        SRALoaderFmt *self = (SRALoaderFmt*)cself;
-        switch( self->vt->v1.maj ) {
-            case 1:
-                rc = self->vt ->v1.destroy(self, table);
-                break;
-
-            default:
-                rc = RC(rcSRA, rcFormatter, rcDestroying, rcInterface, rcBadVersion);
-                PLOGERR( klogInt, (klogInt, rc, "failed to release loader formatter with interface version $(maj).$(min)",
-                         "maj=%u,min=%u", self->vt->v1.maj, self->vt->v1.min));
-                break;
-        }
-    }
-    return rc;
-}
-
-rc_t SRALoaderFmtVersion ( const SRALoaderFmt *self, uint32_t *vers, const char** name )
-{
-    rc_t rc = 0;
-
-    if( self == NULL || vers == NULL || name == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcAccessing, rcParam, rcNull);
-    } else {
-        *vers = 0;
-        *name = NULL;
-        switch( self->vt->v1.maj ) {
-            case 1:
-                rc = self->vt->v1.version(self, vers, name);
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcAccessing, rcInterface, rcBadVersion);
-                PLOGERR( klogInt, (klogInt, rc, "failed to read loader formatter version with interface version $(maj).$(min)",
-                    "maj=%u,min=%u", self ? self->vt->v1.maj : 0, self ? self->vt->v1.min : 0));
-                break;
-        }
-    }
-    return rc;
-}
-
-rc_t SRALoaderFmtWriteData ( SRALoaderFmt *self, uint32_t argc, const SRALoaderFile *const argv [], int64_t* spots_bad_count )
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    } else if( argv == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcArgv, rcNull);
-    } else if( argc == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcArgv, rcEmpty);
-    } else if( spots_bad_count == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcParam, rcNull);
-    } else {
-        switch( self->vt->v1.maj ) {
-            case 1:
-                if( self->vt->v1.write_data == NULL ) {
-                    rc = RC(rcSRA, rcFormatter, rcCreating, rcInterface, rcNull);
-                } else {
-                    rc = self->vt->v1.write_data(self, argc, argv, spots_bad_count);
-                }
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcWriting, rcInterface, rcBadVersion);
-                PLOGERR ( klogInt, ( klogInt, rc, "failed to load data with interface version $(maj).$(min)",
-                    "maj=%u,min=%u", self ? self->vt->v1.maj : 0, self ? self->vt->v1.min : 0));
-                break;
-        }
-    }
-    return rc;
-}
-
-rc_t SRALoaderFmtExecPrep(const SRALoaderFmt *self, const TArgs* args, const SInput* input,
-                          const char** path, const char* eargs[], size_t max_eargs)
-{
-    rc_t rc = 0;
-
-    if( self == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcCreating, rcSelf, rcNull);
-    } else if( args == NULL || input == NULL || path == NULL || eargs == NULL || max_eargs == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcCreating, rcParam, rcInvalid);
-    } else {
-        switch( self->vt->v1.maj ) {
-            case 1:
-                if( self->vt->v1.exec_prep == NULL ) {
-                    rc = RC(rcSRA, rcFormatter, rcCreating, rcInterface, rcNull);
-                } else {
-                    rc = self->vt->v1.exec_prep(self, args, input, path, eargs, max_eargs);
-                }
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcCreating, rcInterface, rcBadVersion);
-                PLOGERR ( klogInt, ( klogInt, rc, "failed to load data with interface version $(maj).$(min)",
-                    "maj=%u,min=%u", self ? self->vt->v1.maj : 0, self ? self->vt->v1.min : 0));
-                break;
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-load/loader-fmt.h b/tools/sra-load/loader-fmt.h
deleted file mode 100644
index 9ef888c..0000000
--- a/tools/sra-load/loader-fmt.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*=======================================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_loader_fmt_
-#define _sra_load_loader_fmt_
-
-#include <kfs/directory.h>
-#include <kapp/args.h>
-#include <kapp/log-xml.h>
-
-#include "loader-file.h"
-#include "experiment-xml.h"
-
-typedef struct ResultXML {
-    char *file;
-    char *name;
-    char *region;
-    char *sector;
-    char *member_name;
-} ResultXML;
-
-typedef struct ExpectedXML {
-    uint8_t number_of_results;
-    ResultXML **result;
-} ExpectedXML;
-
-typedef struct TArgs_struct {
-    const char *_runXmlPath;
-    const char* _input_path;
-    uint32_t _input_unpacked; /* as bool */
-    uint32_t _no_read_ahead; /* as bool */
-
-    const char *_experimentXmlPath;
-    const char *_target;
-    uint32_t _force_target; /* as bool */
-
-    int64_t _spots_to_run;
-    int64_t _spots_bad_allowed;
-    int _spots_bad_allowed_percentage;
-
-    const char* _expectedXmlPath;
-    int _intensities; /* trie state: 0 - default, 1 - on, 2 - off */
-
-    Args* args;
-    const XMLLogger* _xml_log;
-    RunXML* _run;
-    const KDirectory* _input_dir;
-    const ExperimentXML* _experiment;
-    const ExpectedXML* _expected;
-    SRAMgr* _sra_mgr;
-} TArgs;
-
-typedef struct SInput_struct {
-    struct {
-        const SRALoaderFile** files;
-        uint32_t count;
-    } *blocks;
-    uint32_t count;
-} SInput;
-
-/* Filter output columns */
-enum ESRAColumnFilter {
-    efltrINTENSITY = 0x01,
-    efltrNOISE     = 0x02,
-    efltrSIGNAL    = 0x04,
-    efltrDEFAULT   = 0x08 /* if this bit is set FE must decide for itself ignoring other bits!! */
-};
-
-typedef struct SRALoaderConfig_struct {
-    /* if spots_to_run >= 0 then reader must stop after writing given number of spots */
-	int64_t spots_to_run;
-    int64_t spots_bad_allowed;
-    /* combination of SRAColumnFilter values. If the corresponding bit is set then the column should be skipped */
-	uint64_t columnFilter;
-    const ExperimentXML* experiment;
-    const char* table_path;
-    SRAMgr* sra_mgr;
-    bool force_table_overwrite;
-} SRALoaderConfig;
-
-
-typedef union SRALoaderFmt_vt SRALoaderFmt_vt;
-
-typedef struct SRALoaderFmt_struct {
-    const SRALoaderFmt_vt *vt;
-} SRALoaderFmt;
-
-#ifndef SRALOADERFMT_IMPL
-#define SRALOADERFMT_IMPL SRALoaderFmt
-#endif
-
-typedef struct SRALoaderFmt_vt_v1_struct {
-    /* version == 1.x */
-    uint32_t maj;
-    uint32_t min;
-
-    /* start minor version == 0 */
-    rc_t ( * destroy ) ( SRALOADERFMT_IMPL *self, SRATable** table  );
-    rc_t ( * version ) ( const SRALOADERFMT_IMPL *self, uint32_t *vers, const char** name );
-    rc_t ( * exec_prep ) (const SRALOADERFMT_IMPL *self, const TArgs* args, const SInput* input,
-                                                    const char** path, const char* eargs[], size_t max_eargs);
-    rc_t ( * write_data ) ( SRALOADERFMT_IMPL *self, uint32_t argc, const SRALoaderFile *const argv [], int64_t* spots_bad_count );
-    /* end minor version == 0 */
-
-} SRALoaderFmt_vt_v1;
-
-union SRALoaderFmt_vt {
-    SRALoaderFmt_vt_v1 v1;
-};
-
-/* Make
- *  allocate object based on SRALoaderFmt type and initialize it both using
- *  SRALoaderFmtInit and SRALoaderConfig data
- */
-rc_t SRALoaderFmtMake( SRALoaderFmt **self, const SRALoaderConfig *config );
-
-/* Init
- *  initialize a newly allocated loader object
- */
-rc_t SRALoaderFmtInit( SRALoaderFmt *self, const SRALoaderFmt_vt *vt);
-
-rc_t SRALoaderFmtRelease ( const SRALoaderFmt *self, SRATable** table );
-
-/* Version
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-rc_t SRALoaderFmtVersion ( const SRALoaderFmt *self, uint32_t *vers, const char** name );
-
-/* WriteData
- *  reader will parse data from input files and write them to table
- *  a row at a time.
- *
- *  "table" [ IN ] - an open, writable table with no open columns.
- *  the reader should open columns with the appropriate data type
- *  based upon its format and input files as determined during construction
- *
- *  "argc" [ IN ] and "argv" [ IN ] - input files positionally
- *  corresponding to information given in reader configuration
- *  data in XML node.
- */
-rc_t SRALoaderFmtWriteData ( SRALoaderFmt *self, uint32_t argc, const SRALoaderFile *const argv [], int64_t* spots_bad_count );
-
-rc_t SRALoaderFmtExecPrep (const SRALoaderFmt *self, const TArgs* args, const SInput* input,
-                           const char** path, const char* eargs[], size_t max_eargs);
-
-#endif /* _sra_load_loader_fmt_ */
diff --git a/tools/sra-load/loader.c b/tools/sra-load/loader.c
deleted file mode 100644
index 9c9c888..0000000
--- a/tools/sra-load/loader.c
+++ /dev/null
@@ -1,1135 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kapp/main.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <kxml/xml.h>
-#include <kfs/md5.h>
-#include <kfs/arc.h>
-#include <kfs/tar.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kdb/meta.h>
-#include <kapp/loader-meta.h>
-#include <sra/wsradb.h>
-
-#include <os-native.h>
-
-#include "debug.h"
-#include "loader-fmt.h"
-#include "run-xml.h"
-#include "experiment-xml.h"
-#include "loader-file.h"
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <assert.h>
-#include <limits.h>
-
-static KDirectory* s_Directory = NULL;
-static const KXMLMgr *s_XmlMgr = NULL;
-
-enum TArgsIndex {
-    targs_RunXML = 0,
-    targs_InputPath,
-    targs_InputUnpacked,
-    targs_InputNoCache,
-    targs_ExperimentXML,
-    targs_Target,
-    targs_ForceTarget,
-    targs_SpotsNumber,
-    targs_BadSpotsNumber,
-    targs_BadSpotPercentage,
-    targs_ExpectedXML,
-    targs_Intensities,
-    targs_ArgsQty
-};
-
-const char* usage_text[targs_ArgsQty][5] = {
-	{ "path to run.xml describing input files", NULL },
-	{ "input files location, default '.'", NULL },
-	{ "input files are unpacked", NULL },
-    { "disable input files threaded caching", NULL },
-	{ "path to experiment.xml", NULL },
-    { "target location", NULL },
-	{ "force target overwrite", NULL },
-	{ "process only given number of spots from input", NULL },
-	{ "acceptable number of spot creation errors, default is 50", NULL },
-	{ "acceptable percentage of spots creation errors, default is 5", NULL },
-	{ "path to expected.xml", NULL },
-	{ "[on | off] load intensity data, default is off. For ",
-      "  Illumina: signal, intensity, noise;",
-      "  AB SOLiD: signal(s);",
-      "  LS454: signal, position (for SFF files this option is ON by default).", NULL },
-};
-
-OptDef TArgsDef[] =
-{
-    /* if you change order in this array, rearrange enum and usage_text above accordingly! */
-    {"run-xml", "r", NULL, usage_text[targs_RunXML], 1, true, true},
-    {"input-path", "i", NULL, usage_text[targs_InputPath], 1, true, false},
-    {"input-unpacked", "u", NULL, usage_text[targs_InputUnpacked], 1, false, false},
-    {"input-no-threads", "t", NULL, usage_text[targs_InputNoCache], 1, false, false},
-    {"experiment", "e", NULL, usage_text[targs_ExperimentXML], 1, true, true},
-    {"output-path", "o", NULL, usage_text[targs_Target], 1, true, true},
-    {"force", "f", NULL, usage_text[targs_ForceTarget], 1, false, false},
-    {"spots-number", "n", NULL, usage_text[targs_SpotsNumber], 1, true, false},
-    {"bad-spot-number", "bE", NULL, usage_text[targs_BadSpotsNumber], 1, true, false},
-    {"bad-spot-percentage", "p", NULL, usage_text[targs_BadSpotPercentage], 1, true, false},
-    {"expected", "x", NULL, usage_text[targs_ExpectedXML], 1, true, false},
-    {"intensities", "s", NULL, usage_text[targs_Intensities], 1, true, false}
-};
-
-rc_t CC UsageSummary (const char * progname)
-{
-    OUTMSG(( "\nUsage:\n\t%s [options] -r run.xml -e experiment.xml -o output-path\n\n", progname));
-    return 0;
-}
-
-rc_t Usage( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-    int i;
-
-    if(args == NULL) {
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    } else {
-        rc = ArgsProgram (args, &fullpath, &progname);
-    }
-    if(rc != 0 ) {
-        progname = fullpath = UsageDefaultName;
-    }
-    UsageSummary(progname);
-
-    for(i = 0; i < targs_ArgsQty; i++ ) {
-        if( TArgsDef[i].required && TArgsDef[i].help[0] != NULL ) {
-            HelpOptionLine(TArgsDef[i].aliases, TArgsDef[i].name, NULL, TArgsDef[i].help);
-        }
-    }
-    OUTMSG(("\nOptions:\n"));
-    for(i = 0; i < targs_ArgsQty; i++ ) {
-        if( !TArgsDef[i].required && TArgsDef[i].help[0] != NULL ) {
-            HelpOptionLine(TArgsDef[i].aliases, TArgsDef[i].name, NULL, TArgsDef[i].help);
-        }
-    }
-    XMLLogger_Usage();
-    OUTMSG(("\n"));
-    HelpOptionsStandard();
-    HelpVersion(fullpath, KAppVersion());
-    return rc;
-}
-
-static
-rc_t TArgsParse(TArgs *args, int argc, char *argv[])
-{
-    rc_t rc = 0;
-    uint32_t count;
-    char* end = NULL;
-    const char* errmsg = NULL;
-    const char* spot_qty = NULL, *bad_spots = NULL;
-    const char *bad_percent = NULL, *intense = NULL;
-
-    assert(args && argv);
-
-    /* no parameters accepted */
-    if( (rc = ArgsParamCount(args->args, &count)) != 0 || count != 0 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcUnexpected);
-        ArgsParamValue(args->args, 0, &errmsg);
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_RunXML].name, &count)) != 0 || count != 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-        errmsg = TArgsDef[targs_RunXML].name;
-    } else if( (rc = ArgsOptionValue(args->args, TArgsDef[targs_RunXML].name, 0, &args->_runXmlPath)) != 0 ) {
-        errmsg = TArgsDef[targs_RunXML].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_ExperimentXML].name, &count)) != 0 || count != 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-        errmsg = TArgsDef[targs_ExperimentXML].name;
-    } else if( (rc = ArgsOptionValue(args->args, TArgsDef[targs_ExperimentXML].name, 0, &args->_experimentXmlPath)) != 0 ) {
-        errmsg = TArgsDef[targs_ExperimentXML].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_Target].name, &count)) != 0 || count != 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, count ? rcExcessive : rcInsufficient);
-        errmsg = TArgsDef[targs_Target].name;
-    } else if( (rc = ArgsOptionValue(args->args, TArgsDef[targs_Target].name, 0, &args->_target)) != 0 ) {
-        errmsg = TArgsDef[targs_Target].name;
-
-    /* optional */
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_InputPath].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_InputPath].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_InputPath].name, 0, &args->_input_path)) != 0 ) {
-        errmsg = TArgsDef[targs_InputPath].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_InputUnpacked].name, &args->_input_unpacked)) != 0 ) {
-        errmsg = TArgsDef[targs_InputUnpacked].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_InputNoCache].name, &args->_no_read_ahead)) != 0 ) {
-        errmsg = TArgsDef[targs_InputNoCache].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_ForceTarget].name, &args->_force_target)) != 0 ) {
-        errmsg = TArgsDef[targs_ForceTarget].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_SpotsNumber].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_SpotsNumber].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_SpotsNumber].name, 0, &spot_qty)) != 0 ) {
-        errmsg = TArgsDef[targs_SpotsNumber].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_BadSpotsNumber].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_BadSpotsNumber].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_BadSpotsNumber].name, 0, &bad_spots)) != 0 ) {
-        errmsg = TArgsDef[targs_BadSpotsNumber].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_BadSpotPercentage].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_BadSpotPercentage].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_BadSpotPercentage].name, 0, &bad_percent)) != 0 ) {
-        errmsg = TArgsDef[targs_BadSpotPercentage].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_ExpectedXML].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_ExpectedXML].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_ExpectedXML].name, 0, &args->_expectedXmlPath)) != 0 ) {
-        errmsg = TArgsDef[targs_ExpectedXML].name;
-
-    } else if( (rc = ArgsOptionCount(args->args, TArgsDef[targs_Intensities].name, &count)) != 0 || count > 1 ) {
-        rc = rc ? rc : RC(rcExe, rcArgv, rcParsing, rcParam, rcExcessive);
-        errmsg = TArgsDef[targs_Intensities].name;
-    } else if( count > 0 && (rc = ArgsOptionValue(args->args, TArgsDef[targs_Intensities].name, 0, &intense)) != 0 ) {
-        errmsg = TArgsDef[targs_Intensities].name;
-    }
-    while( rc == 0 ) {
-        long val = 0;
-        if( args->_input_path == NULL ) {
-            args->_input_path = "./";
-            if( (rc = KDirectoryAddRef(s_Directory)) == 0 ) {
-                args->_input_dir = s_Directory;
-            } else {
-                errmsg = TArgsDef[targs_InputPath].name;
-                break;
-            }
-        } else if( (rc = KDirectoryOpenDirRead(s_Directory, &args->_input_dir, true, args->_input_path)) != 0 ) {
-            errmsg = TArgsDef[targs_InputPath].name;
-            break;
-        }
-
-        if( spot_qty != NULL ) {
-            errno = 0;
-            val = strtol(spot_qty, &end, 10);
-            if( errno != 0 || spot_qty == end || *end != '\0' || val <= 0 ) {
-                rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                errmsg = TArgsDef[targs_SpotsNumber].name;
-                break;
-            }
-            args->_spots_to_run = val;
-        }
-        if( bad_spots != NULL ) {
-            errno = 0;
-            val = strtol(bad_spots, &end, 10);
-            if( errno != 0 || bad_spots == end || *end != '\0' || val < 0 ) {
-                rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                errmsg = TArgsDef[targs_BadSpotsNumber].name;
-                break;
-            }
-            args->_spots_bad_allowed = val;
-        }
-        if( bad_percent != NULL ) {
-            errno = 0;
-            val = strtol(bad_percent, &end, 10);
-            if( errno != 0 || bad_percent == end || *end != '\0' || val < 0 || val > 100 ) {
-                rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                errmsg = TArgsDef[targs_BadSpotPercentage].name;
-                break;
-            }
-            args->_spots_bad_allowed_percentage = val;
-        }
-        if( intense != NULL ) {
-            if( strcasecmp(intense, "on") == 0 ) {
-                args->_intensities = 1;
-            } else if( strcasecmp(intense, "off") == 0 ) {
-                args->_intensities = 2;
-            } else {
-                rc = RC(rcExe, rcArgv, rcReading, rcParam, rcInvalid);
-                errmsg = TArgsDef[targs_Intensities].name;
-                break;
-            }
-        }
-        break;
-    }
-    if( rc != 0 ) {
-        Usage(args->args);
-        LOGERR(klogErr, rc, errmsg ? errmsg : "check command line");
-    }
-    return rc;
-}
-
-static
-void TArgsRelease(const TArgs* cself)
-{
-    if(cself) {
-        TArgs* self = (TArgs*)cself;
-        RunXML_Whack(self->_run);
-        Experiment_Whack(self->_experiment);
-        KDirectoryRelease(self->_input_dir);
-        ArgsWhack(self->args);
-        SRAMgrRelease(self->_sra_mgr);
-        XMLLogger_Release(self->_xml_log);
-        free(self);
-    }
-}
-
-static
-rc_t TArgsMake(TArgs **args, int argc, char *argv[])
-{
-    rc_t rc = 0;
-    TArgs* r;
-
-    assert(args && argv);
-
-    if( (r = calloc(1, sizeof(*r))) == NULL) {
-        rc = RC(rcExe, rcArgv, rcAllocating, rcMemory, rcExhausted);
-    } else if( (rc = ArgsMakeAndHandle(&r->args, argc, argv, 2, TArgsDef, targs_ArgsQty, XMLLogger_Args, XMLLogger_ArgsQty)) == 0 &&
-               (rc = XMLLogger_Make(&r->_xml_log, s_Directory, r->args)) == 0 ) {
-        r->_force_target = false;
-        r->_spots_to_run = -1;
-        r->_spots_bad_allowed = 50;
-        r->_spots_bad_allowed_percentage = 5;
-        r->_input_unpacked = false;
-        if( argc > 1 ) {
-            rc = TArgsParse(r, argc, argv);
-        } else {
-            MiniUsage(r->args);
-            exit(0);
-        }
-    }
-    if( rc == 0 ) {
-        *args = r;
-    } else {
-        TArgsRelease(r);
-        *args = NULL;
-    }
-    return rc;
-}
-
-static rc_t read_required_node_data_cstr(const KXMLNode *node,
-    const char *attr, char **string)
-{
-    rc_t rc = attr == NULL ?
-            KXMLNodeReadCStr(node, string, NULL) :
-            KXMLNodeReadAttrCStr(node, attr, string, NULL);
-
-    if (rc && GetRCState(rc) == rcNotFound) {
-        const char *name = NULL;
-        if( (rc = KXMLNodeElementName(node, &name)) == 0 ) {
-            if (attr == NULL) {
-                PLOGERR(klogErr, (klogErr, rc, "XML node $(name)", "name=%s", name));
-            }
-            else {
-                PLOGERR(klogErr, (klogErr, rc, "XML attribute $(name)/@$(attr)",
-                                  "name=%s,attr=%s", name, attr));
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t read_optional_node_data_cstr(const KXMLNode *node,
-    const char *attr, char **string)
-{
-    rc_t rc = attr == NULL ?
-            KXMLNodeReadCStr(node, string, NULL) :
-            KXMLNodeReadAttrCStr(node, attr, string, "");
-
-    if (rc) {
-        if (GetRCState(rc) == rcNotFound) {
-            rc = 0;
-        }
-        else {
-            const char *name = NULL;
-            if( (rc = KXMLNodeElementName(node, &name)) == 0 ) {
-                PLOGERR(klogErr, (klogErr, rc, "XML attribute $(name)/@$(attr)",
-                                  "name=%s,attr=%s", name, attr));
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t ResultXML_make(ResultXML **rslt, const KXMLNode *Result)
-{
-    rc_t rc = 0;
-    ResultXML *r = NULL;
-
-    assert(rslt && Result);
-
-    r = calloc(1, sizeof *r);
-    if (r == NULL) {
-        rc = RC(rcExe, rcXmlDoc, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    if (rc == 0) {
-        rc = read_required_node_data_cstr(Result, "file", &r->file);
-    }
-
-    if (rc == 0) {
-        rc = read_required_node_data_cstr(Result, "name", &r->name);
-    }
-
-    if (rc == 0) {
-        rc = read_required_node_data_cstr(Result, "sector", &r->sector);
-    }
-
-    if (rc == 0) {
-        rc = read_required_node_data_cstr(Result, "region", &r->region);
-    }
-
-    if (rc == 0) {
-        rc = read_optional_node_data_cstr(Result, "member_name", &r->member_name);
-    }
-
-    if (rc) {
-        free(r);
-    }
-    else {
-        *rslt = r;
-    }
-
-    return rc;
-}
-
-static rc_t ExpectedXMLWhack(const ExpectedXML *r)
-{
-    return 0;
-}
-
-static rc_t ExpectedXMLMake(const ExpectedXML **rslt,
-    const KXMLNode *Expected)
-{
-    rc_t rc = 0;
-    const KXMLNodeset *Results = NULL;
-    if (rslt == NULL) {
-        return RC(rcExe, rcXmlDoc, rcConstructing, rcParam, rcNull);
-    }
-    *rslt = NULL;
-    if (Expected == NULL) {
-        return RC(rcExe, rcXmlDoc, rcConstructing, rcParam, rcNull);
-    }
-    rc = KXMLNodeOpenNodesetRead(Expected, &Results, "Result");
-    if (rc == 0) {
-        ExpectedXML *r = calloc(1, sizeof *r);
-        if (r == NULL) {
-            rc = RC(rcExe, rcXmlDoc, rcAllocating, rcMemory, rcExhausted);
-        }
-        else {
-            uint32_t num = 0;
-            rc = KXMLNodesetCount(Results, &num);
-            if (rc == 0 && num > 0) {
-                r->number_of_results = num;
-                r->result = calloc(1, num * sizeof r->result[0]);
-                if (r->result == NULL) {
-                    rc = RC(rcExe, rcXmlDoc, rcAllocating, rcMemory, rcExhausted);
-                    free(r);
-                }
-                else {
-                    int i = 0;
-                    for (i = 0; rc == 0 && i < num; ++i) {
-                        const KXMLNode *Result = NULL;
-                        rc = KXMLNodesetGetNodeRead(Results, &Result, i);
-                        if (rc == 0) {
-                            rc = ResultXML_make(&r->result[i], Result);
-                        }
-                    }
-                    if (rc == 0) {
-                        *rslt = r;
-                    }
-                    else {
-                        ExpectedXMLWhack(r);
-                    }
-                }
-            }
-        }
-    }
-    else if (GetRCState(rc) != rcNotFound) {
-        LOGERR(klogErr, rc, "Cannot read Result node");
-    }
-    return rc;
-}
-
-static rc_t s_KXMLDocMake(const KXMLDoc **doc, const char *path)
-{
-    rc_t rc = 0;
-    const KFile *file = NULL;
-    if (doc == NULL || path == NULL) {
-        return RC(rcExe, rcXmlDoc, rcConstructing, rcParam, rcNull);
-    }
-    if (rc == 0) {
-        rc = KDirectoryOpenFileRead(s_Directory, &file, path);
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc, "Cannot open file $(file)", "file=%s", path));
-        }
-    }
-    if (rc == 0) {
-        rc = KXMLMgrMakeDocRead(s_XmlMgr, doc, file);
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc, "Cannot make XML document from $(file)",
-                              "file=%s", path));
-        }
-    }
-    KFileRelease(file);
-    return rc;
-}
-
-static rc_t KXMLNodeMakeFromDoc(const KXMLNode **node, const KXMLDoc *doc,
-    const char *root)
-{
-    rc_t rc = 0;
-    const KXMLNodeset *ns = NULL;
-    if (node == NULL || doc == NULL || root == NULL) {
-        return RC(rcExe, rcXmlDoc, rcConstructing, rcParam, rcNull);
-    }
-    if (rc == 0) {
-        rc = KXMLDocOpenNodesetRead(doc, &ns, root);
-    }
-    if (rc == 0) {
-        uint32_t count = 0;
-        rc = KXMLNodesetCount(ns, &count);
-        if (rc == 0) {
-            if (count == 0) {
-                rc = RC(rcExe, rcXmlDoc, rcReading, rcNode, rcNotFound);
-                PLOGERR(klogErr, (klogErr, rc, "$(path)", "path=%s", root));
-            }
-            else if (count > 1) {
-                rc = RC(rcExe, rcXmlDoc, rcParsing, rcData, rcExcessive);
-                PLOGERR(klogErr, (klogErr, rc,
-                                  "too many data $(node) nodes", "node=%s", root));
-            }
-        }
-    }
-    if (rc == 0) {
-        rc = KXMLNodesetGetNodeRead(ns, node, 0);
-    }
-    KXMLNodesetRelease(ns);
-    return rc;
-}
-
-static rc_t KXMLNodeMakeFromFile(const KXMLNode **node, const char *path,
-    const char *root)
-{
-    rc_t rc = 0;
-    const KXMLDoc *doc = NULL;
-    const char *rootPath = "/";
-    if (node == NULL || path == NULL) {
-        return RC(rcExe, rcXmlDoc, rcConstructing, rcParam, rcNull);
-    }
-    rc = s_KXMLDocMake(&doc, path);
-    if (rc == 0) {
-        if (root != NULL) {
-            rootPath = root;
-        }
-        rc = KXMLNodeMakeFromDoc(node, doc, rootPath);
-    }
-    KXMLDocRelease(doc);
-    return rc;
-}
-
-static
-rc_t TArgsParseRunXml(TArgs *args)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-    const KXMLDoc *doc = NULL;
-    assert(args);
-    if (args->_runXmlPath == NULL) {
-        return rc;
-    }
-    if (rc == 0) {
-        rc = s_KXMLDocMake(&doc, args->_runXmlPath);
-    }
-    if (rc == 0) {
-        rc= KXMLNodeMakeFromDoc(&node, doc, "/RUN_SET/RUN | /RUN");
-    }
-    if (rc == 0) {
-        rc = RunXML_Make(&args->_run, node);
-    }
-    KXMLNodeRelease(node);
-    KXMLDocRelease(doc);
-    return rc;
-}
-
-static rc_t TArgsParseExpectedXml(TArgs *self)
-{
-    rc_t rc = 0;
-    const KXMLNode *node = NULL;
-    assert(self);
-    if (self->_expectedXmlPath == NULL) {
-        return rc;
-    }
-    if (rc == 0) {
-        rc = KXMLNodeMakeFromFile(&node, self->_expectedXmlPath, "//Expected");
-    }
-    if (rc == 0) {
-        rc = ExpectedXMLMake(&self->_expected, node);
-    }
-    KXMLNodeRelease(node);
-    return rc;
-}
-
-static rc_t TArgsParseXmls(TArgs *self)
-{
-    rc_t rc = 0;
-    const KXMLDoc *doc = NULL;
-
-    if( (rc = TArgsParseRunXml(self)) == 0 &&
-        (rc = s_KXMLDocMake(&doc, self->_experimentXmlPath)) == 0 &&
-        (rc = Experiment_Make(&self->_experiment, doc, &self->_run->attributes)) == 0 ) {
-        rc = TArgsParseExpectedXml(self);
-    }
-    KXMLDocRelease(doc);
-    return rc;
-}
-
-static rc_t TArgsLogResultTotal(const TArgs *self, rc_t status, uint64_t spotCount, uint64_t baseCount, int64_t bad_spot_count)
-{
-    rc_t rc = 0;
-    int i = 0;
-    const char* accession, *state;
-    KLogLevel tmp_lvl;
-
-    if (self == NULL) {
-        return rc;
-    }
-
-    accession = strrchr(self->_target, '/');
-    if( accession == NULL ) {
-        accession = self->_target;
-    } else {
-        accession++;
-    }
-    state = status == 0 ? "success" : "failure";
-    /* raise log level in order to print stats */
-    tmp_lvl = KLogLevelGet();
-    KLogLevelSet(klogInfo);
-    for(i = 0; self->_expected != NULL && i < self->_expected->number_of_results && rc == 0; i++) {
-        ResultXML *f = self->_expected->result[i];
-        PLOGMSG(klogInfo, (klogInfo, "loaded",
-                "severity=result,status=%s,accession=%s,spot_count=%lu,base_count=%lu,"
-                "file=%s,name=%s,region=%s,sector=%s,member_name=%s",
-                state, accession, spotCount, baseCount,
-                f->file, f->name, f->region, f->sector, f->member_name ? f->member_name : ""));
-    }
-    if(status == 0) {
-        PLOGMSG(klogInfo, (klogInfo, "loaded",
-                "severity=total,status=%s,accession=%s,spot_count=%lu,base_count=%lu,bad_spots=%ld",
-                state, accession, spotCount, baseCount, bad_spot_count));
-    } else {
-        PLOGERR(klogErr, (klogErr, status, "load failed: $(reason_short)",
-                "severity=total,status=%s,accession=%s",
-                state, accession));
-    }
-    KLogLevelSet(tmp_lvl);
-    return rc;
-}
-
-static
-void SInput_Release(const SInput* cself)
-{
-    if(cself) {
-        SInput* self = (SInput*)cself;
-        uint32_t i;
-        for(i = 0; i < self->count; i++) {
-            /* actual files must be released elsewhere */
-            free(self->blocks[i].files);
-        }
-        free(self->blocks);
-        free(self);
-    }
-}
-
-typedef struct SInputOpen_TarVisitData_struct {
-    uint32_t alloc;
-    char** files;
-    uint32_t count;
-    
-} SInputOpen_TarVisitData;
-
-static
-rc_t SInputOpen_TarVisit(const KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    rc_t rc = 0;
-
-    if( type == kptFile ) {
-        SInputOpen_TarVisitData* d = (SInputOpen_TarVisitData*)data;
-
-        if( d->alloc <= d->count ) {
-            void* p;
-            d->alloc = d->files == NULL ? 1024 : (d->alloc * 2);
-            if( (p = realloc(d->files, d->alloc * sizeof(*d->files))) == NULL ) {
-                rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            } else {
-                d->files = p;
-            }
-        }
-        if( rc == 0 ) {
-            char buf[1024];
-            if( (rc = KDirectoryResolvePath(dir, true, buf, sizeof(buf), name)) == 0 ) { 
-                d->files[d->count++] = strdup(buf);
-                if( d->files[d->count - 1] == NULL ) {
-                    rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SInputOpen(const SInput **cself, TArgs *args)
-{
-    rc_t rc = 0;
-    SInput *self = calloc(1, sizeof(*self));
-    uint32_t file_qty = 0;
-
-    if(self == NULL) {
-        rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    } else {
-        self->blocks = calloc(args->_run->datablock_count, sizeof(*(self->blocks)));
-        if(self->blocks == NULL) {
-            rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-        } else {
-            uint32_t i, ccdirs_qty = 0;
-            struct {
-                const char* uid;
-                const KDirectory* xdir;
-            } ccdirs[1024];
-
-            memset(ccdirs, 0, sizeof(ccdirs));
-            self->count = args->_run->datablock_count;
-            for(i = 0; rc == 0 && i < self->count; i++) {
-                const DataBlock* b = &args->_run->datablocks[i];
-                uint32_t f, j;
-                char fname[10240];
-
-                self->blocks[i].files = calloc(b->files_count, sizeof(*(self->blocks->files)));
-                if(self->blocks == NULL) {
-                    rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                    continue;
-                }
-                self->blocks[i].count = b->files_count;
-                for(f = 0, j = 0; rc == 0 && j < b->files_count; j++ ) {
-                    int fnlen = strlen(b->files[j].filename);
-                    if( b->files[j].cc_xml != NULL ) {
-                        const KDirectory* fdir = args->_input_dir;
-                        if( !args->_input_unpacked ) {
-                            uint32_t cd;
-                            for(cd = 0; cd < ccdirs_qty; cd++) {
-                                if( strcmp(ccdirs[cd].uid,  b->files[j].cc_xml) == 0 ) {
-                                    break;
-                                }
-                            }
-                            if( cd >= ccdirs_qty ) {
-                                const KFile* kf = NULL;
-                                if( ccdirs_qty + 1 > sizeof(ccdirs) / sizeof(ccdirs[0]) ) {
-                                    rc = RC(rcExe, rcStorage, rcAllocating, rcNamelist, rcTooLong);
-                                } else if( (rc = KDirectoryOpenFileRead(args->_input_dir, &kf, "%s.xml", b->files[j].cc_xml)) == 0) {
-                                    char base_path[4096];
-                                    int r = snprintf(base_path, sizeof base_path, "%s/", b->files[j].cc_xml);
-                                    if (r >= sizeof base_path) {
-                                        rc = RC(rcExe, rcStorage, rcAllocating, rcFile, rcTooLong);
-                                    } else if ((rc = KDirectoryOpenXTocDirRead(args->_input_dir, &ccdirs[ccdirs_qty].xdir, false, kf, base_path)) == 0 ) {
-                                        cd = ccdirs_qty++;
-                                        ccdirs[cd].uid = b->files[j].cc_xml;
-                                        KFileRelease(kf);
-                                    }
-                                }
-                            }
-                            fdir = ccdirs[cd].xdir;
-                        }
-                        if( rc == 0 ) {
-                            char* fn = strdup(b->files[j].cc_path);
-                            if( fn == NULL ) {
-                                rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                            } else {
-                                rc = SRALoaderFile_Make(&self->blocks[i].files[f++], fdir, fn, b, &b->files[j].attr,
-                                                        NULL, !args->_no_read_ahead);
-                                file_qty++;
-                                free(fn);
-                            }
-                        }
-                        continue;
-                    }
-                    if( fnlen >= sizeof(fname) ) {
-                        rc = RC(rcExe, rcStorage, rcAllocating, rcFile, rcTooLong);
-                        PLOGERR(klogErr, (klogErr, rc, "$(file)", PLOG_S(file), b->files[j].filename));
-                        continue;
-                    }
-                    strcpy(fname, b->files[j].filename);
-                    /* compressed archives supposed to be decompressed beforehand */
-                    if( fnlen > 7 && strcmp(&fname[fnlen - 7], ".tar.gz") == 0 ) {
-                        fnlen -= 3;
-                        fname[fnlen] = '\0';
-                    } else if( fnlen > 4 && strcmp(&fname[fnlen - 4], ".tgz") == 0 ) {
-                        fname[fnlen - 2] = 'a';
-                        fname[fnlen - 1] = 'r';
-                    } else if( fnlen > 7 && strcmp(&fname[fnlen - 7], ".tar.bz2") == 0 ) {
-                        fnlen -= 4;
-                        fname[fnlen] = '\0';
-                    }
-                    if( strcmp(&fname[fnlen - 4], ".tar") == 0 ) {
-                        const KDirectory* tar;
-                        if( (rc = KDirectoryOpenArcDirRead(args->_input_dir, &tar, true, fname,
-                                                           tocKFile, KArcParseTAR, NULL, NULL)) == 0 ) {
-                            uint32_t k;
-                            void* p;
-                            SInputOpen_TarVisitData data = {0, NULL, 0};
-
-                            if( (rc = KDirectoryVisit(tar, true, SInputOpen_TarVisit, &data, ".")) != 0 ) {
-                                continue;
-                            }
-                            if( data.count == 0 ) {
-                                rc = RC(rcExe, rcStorage, rcAllocating, rcFile, rcEmpty);
-                                PLOGERR(klogErr,(klogErr, rc, "Empty tar $(file)", PLOG_S(file), fname));
-                                continue;
-                            }
-                            self->blocks[i].count += data.count - 1; /* minus tar file */
-                            p = realloc(self->blocks[i].files, self->blocks[i].count * sizeof(*(self->blocks->files)));
-                            if( p == NULL) {
-                                rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                                continue;
-                            }
-                            self->blocks[i].files = p;
-                            for(k = 0; k < data.count; k++) {
-                                rc = SRALoaderFile_Make(&self->blocks[i].files[f++], tar, data.files[k], b, &b->files[j].attr,
-                                                        NULL, !args->_no_read_ahead);
-                                file_qty++;
-                            }
-                            free(data.files);
-                            KDirectoryRelease(tar);
-                        }
-                    } else {
-                        char* fn = strdup(fname);
-                        if( fn == NULL ) {
-                            rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                        } else {
-                            rc = SRALoaderFile_Make(&self->blocks[i].files[f++], args->_input_dir, fn, b, &b->files[j].attr,
-                                                    b->files[j].md5_digest, !args->_no_read_ahead);
-                            file_qty++;
-                            free(fn);
-                        }
-                    }
-                }
-            }
-            for(i = 0; i < ccdirs_qty; i++) {
-                KDirectoryRelease(ccdirs[i].xdir);
-            }
-        }
-    }
-    if( rc == 0 && file_qty < 1 ) {
-        rc = RC(rcExe, rcStorage, rcAllocating, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "no files to load");
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        SInput_Release(self);
-    }
-    return rc;
-}
-
-static
-rc_t WriteSoftwareVersionsMeta(SRATable* table, const char *argv0, uint32_t fe_version, const char* fe_name)
-{
-    rc_t rc = 0;
-    KMDataNode *node = NULL;
-
-    assert(table);
-
-    if( (rc = SRATableOpenMDataNodeUpdate(table, &node, "/")) == 0 ) {
-        rc = KLoaderMeta_Write(node, argv0, __DATE__, fe_name, fe_version);
-    }
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "Cannot update loader meta");
-    }
-    KMDataNodeRelease(node);
-    return rc;
-}
-
-rc_t KMain(int argc, char *argv[])
-{
-    rc_t rc = 0, lastRc = 0;
-
-    TArgs *args = NULL;
-    const SInput *input = NULL;
-    SRATable* table = NULL;
-    SRALoaderFmt* fe = NULL;
-
-    SRALoaderConfig feInput;
-    memset(&feInput, 0, sizeof feInput);
-
-    /* Initialize statics */
-    if (rc == 0) {
-        rc = KDirectoryNativeDir(&s_Directory);
-    }
-    /* Parse command line arguments */
-    if (rc == 0) {
-        rc = TArgsMake(&args, argc, argv);
-    }
-    if( rc == 0 &&
-        (rc = SRAMgrMakeUpdate(&args->_sra_mgr, NULL)) == 0 &&
-        (rc = SRAMgrSetMD5Mode(args->_sra_mgr, true)) == 0 ) {
-        rc = KXMLMgrMakeRead(&s_XmlMgr);
-    }
-    if( rc == 0 && (rc = TArgsParseXmls(args)) == 0) {
-        if( args->_intensities == 2 ) {
-            feInput.columnFilter = efltrINTENSITY | efltrNOISE | efltrSIGNAL;
-        } else if( args->_intensities == 1 ) {
-            feInput.columnFilter = 0;
-        } else {
-            feInput.columnFilter = efltrDEFAULT;
-        }
-        feInput.spots_to_run = args->_spots_to_run;
-        feInput.spots_bad_allowed = args->_spots_bad_allowed;
-        feInput.experiment = args->_experiment;
-        feInput.sra_mgr = args->_sra_mgr;
-        feInput.table_path = args->_target;
-        feInput.force_table_overwrite = args->_force_target;
-
-        rc = SRALoaderFmtMake(&fe, &feInput);
-    }
-    if (rc == 0) {
-        rc = SInputOpen(&input, args);
-    }
-    if(rc == 0) {
-        if( fe->vt->v1.exec_prep ) {
-            const char* efile = NULL;
-            const char* eargs[64];
-            uint32_t i = 1, j, qty = 0, x = 0;
-            char extra[1024];
-
-            eargs[i++] = "-L";
-            eargs[i++] = KLogGetParamStrings()[KLogLevelGet()];
-            qty = KStsLevelGet();
-            while(qty-- > 0 ) {
-                eargs[i++] = "-v";
-            }
-#if _DEBUGGING
-            if( ArgsOptionCount(args->args, "+", &qty) == 0 ) {
-                uint32_t j;
-                for(j = 0; j < qty; j++) {
-                    const char* v;
-                    if( ArgsOptionValue(args->args, "+", j, &v) == 0 ) {
-                        eargs[i++] = "-+";
-                        eargs[i++] = v;
-                    }
-                }
-            }
-            if( ArgsOptionCount(args->args, "debug", &qty) == 0) {
-                uint32_t j;
-                for(j = 0; j < qty; j++) {
-                    const char* v;
-                    if( ArgsOptionValue(args->args, "debug", j, &v) == 0 ) {
-                        eargs[i++] = "-+";
-                        eargs[i++] = v;
-                    }
-                }
-            }
-#endif
-            for(j = 0; j < XMLLogger_ArgsQty; j++) {
-                const char* v;
-                if( XMLLogger_Args[j].aliases != NULL &&
-                    ArgsOptionCount(args->args, XMLLogger_Args[j].aliases, &qty) == 0 &&
-                    qty > 0 &&
-                    ArgsOptionValue(args->args, XMLLogger_Args[j].aliases, 0, &v) == 0 ) {
-                        eargs[i++] = &extra[x];
-                        extra[x++] = '-';
-                        extra[x++] = '-';
-                        strcpy(&extra[x], XMLLogger_Args[j].name);
-                        x += strlen(XMLLogger_Args[j].name);
-                        eargs[i++] = v;
-                } else if( XMLLogger_Args[j].name != NULL &&
-                           ArgsOptionCount(args->args, XMLLogger_Args[j].name, &qty) == 0 &&
-                           qty > 0 &&
-                           ArgsOptionValue(args->args, XMLLogger_Args[j].name, 0, &v) == 0 ) {
-                        eargs[i++] = &extra[x];
-                        extra[x++] = '-';
-                        extra[x++] = '-';
-                        strcpy(&extra[x], XMLLogger_Args[j].name);
-                        x += strlen(XMLLogger_Args[j].name);
-                        eargs[i++] = v;
-                }
-
-            }
-            eargs[i] = NULL;
-
-            if( (rc = SRALoaderFmtExecPrep(fe, args, input, &efile, eargs + i, sizeof(eargs) / sizeof(eargs[0]) - i)) == 0 ) {
-                eargs[0] = efile;
-#if _DEBUGGING
-                DEBUG_MSG(3, ("execv: '%s", efile));
-                for(i = 0; eargs[i] != NULL; i++) {
-                    DEBUG_MSG(3, (" %s", eargs[i]));
-                }
-                DEBUG_MSG(3, ("'\n"));
-#endif
-                execv(efile, (char* const*)eargs);
-                rc = RC(rcExe, rcFormatter, rcExecuting, rcInterface, rcFailed);
-                PLOGERR(klogErr, (klogErr, rc, "front-end exec: $(errno)", "errno=%s", strerror(errno)));
-            }
-        } else {
-            rc_t rc2 = 0;
-            uint64_t spotCount = 0;
-            uint64_t numBases = 0;
-            int64_t bad_spot_count = 0;
-            uint32_t fe_vers = 0;
-            const char* fe_name;
-
-            rc = SRALoaderFmtVersion(fe, &fe_vers, &fe_name);
-            if(rc == 0) {
-                uint32_t i, j;
-                for(i = 0; rc == 0 && i < input->count; i++) {
-                    rc = SRALoaderFmtWriteData(fe, input->blocks[i].count, input->blocks[i].files, &bad_spot_count);
-                    for(j = 0; j < input->blocks[i].count; j++) {
-                        bool eof = true;
-                        if( rc == 0 && SRALoaderFile_IsEof(input->blocks[i].files[j], &eof) == 0 ) {
-                            if( args->_spots_to_run < 0 && eof != true ) {
-                                const char* fn;
-                                SRALoaderFileName(input->blocks[i].files[j], &fn);
-                                rc2 = RC(rcExe, rcFormatter, rcReading, rcFile, rcExcessive);
-                                PLOGERR(klogErr, (klogErr, rc2, "File $(file) not completely parsed", PLOG_S(file), fn));
-                            }
-                        }
-                        SRALoaderFile_Release(input->blocks[i].files[j]);
-                    }
-                    if( GetRCObject(rc) == rcTransfer && GetRCState(rc) == rcDone ) {
-                        /* interrupted by requested spot count */
-                        rc = 0;
-                        break;
-                    }
-                    rc = rc ? rc : rc2;
-                }
-            }
-            /* release object to make sure it free's it's data and commits */
-            rc2 = SRALoaderFmtRelease(fe, &table);
-            rc = rc ? rc : rc2;
-            fe = NULL;
-
-            if( rc == 0 && table != NULL ) {
-                /* Write versions */
-                if (rc == 0) {
-                    rc = WriteSoftwareVersionsMeta(table, argv[0], fe_vers, fe_name);
-                }
-                if (rc == 0) {
-                    rc = SRATableCommit(table);
-                    if( GetRCObject(rc) == rcCursor && GetRCState(rc) == rcNotOpen ) {
-                        rc = 0;
-                    }
-                }
-                if (rc == 0) {
-                    rc = SRATableSpotCount(table, &spotCount);
-                    if (rc == 0) {
-                        rc = SRATableBaseCount(table, &numBases);
-                    }
-                    if(rc == 0) {
-                        if(spotCount > 0) {
-                            double percentage = ((double)bad_spot_count) / spotCount;
-                            double allowed = args->_spots_bad_allowed_percentage / 100.0;
-                            if(percentage > allowed ||
-                               (feInput.spots_bad_allowed >= 0 && bad_spot_count > feInput.spots_bad_allowed)) {
-                                rc = RC(rcExe, rcTable, rcClosing, rcData, rcInvalid);
-                                PLOGERR(klogErr, 
-                                        (klogErr, rc,
-                                         "Too many bad spots: "
-                                         "spots: $(spots), bad spots: $(bad_spots), "
-                                         "bad spots percentage: $(percentage), "
-                                         "allowed percentage: $(allowed), "
-                                         "allowed count: $(bad_allowed)",
-                                         "spots=%d,bad_spots=%li,percentage=%.2f,allowed=%.2f,bad_allowed=%li",
-                                         spotCount, bad_spot_count,
-                                         percentage, allowed, feInput.spots_bad_allowed));
-                            }
-                        }
-                    }
-                }
-                if( rc == 0) {
-                    rc = SRATableRelease(table);
-                    table = NULL;
-                }
-            }
-            if(rc == 0) {
-                if(spotCount == 0) {
-                    rc = RC(rcExe, rcFormatter, rcClosing, rcTable, rcEmpty);
-                    LOGERR(klogErr, rc, "0 spots were loaded after successful front-end run");
-                }
-            }
-            rc2 = TArgsLogResultTotal(args, rc, spotCount, numBases, bad_spot_count);
-            rc = rc ? rc : rc2;
-        }
-
-        if( rc != 0 ) {
-            if( table ) {
-                rc_t status = SRATableRelease(table);
-                table = NULL;
-                if(status == 0) {
-                    /* should go away as soon as cursor transactions are in place */
-                    status = SRAMgrDropTable(args->_sra_mgr, true, args->_target);
-                }
-                if(status != 0) {
-                    lastRc = KLogLastErrorCode();
-                    LOGERR(klogInt, status, "cannot DropRun after load failure");
-                }
-            }
-        }
-    }
-
-    /* make sure the error was reported */
-    if( rc != 0 &&
-        rc != SILENT_RC(rcExe, rcProcess, rcExecuting, rcProcess, rcCanceled) &&
-        rc != SILENT_RC(rcExe, rcProcess, rcExecuting, rcTransfer, rcDone)) {
-        if (lastRc == 0) {
-            lastRc = KLogLastErrorCode();
-        }
-        if (rc != lastRc) {
-            LOGERR(klogInt, rc, "no message text available");
-        }
-    }
-    SInput_Release(input);
-    SRALoaderFmtRelease(fe, NULL);
-    TArgsRelease(args);
-    KDirectoryRelease(s_Directory);
-    KXMLMgrRelease(s_XmlMgr);
-
-    return rc;
-}
diff --git a/tools/sra-load/pstring.c b/tools/sra-load/pstring.c
deleted file mode 100644
index 6966393..0000000
--- a/tools/sra-load/pstring.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/wsradb.h>
-#include <sra/types.h>
-
-#include "common-xml.h"
-#include "pstring.h"
-#include "debug.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-rc_t pstring_clear(pstring* str)
-{
-    if( str == NULL ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcParam, rcNull);
-    }
-    str->data[0] = '\0';
-    str->len = 0;
-    return 0;
-}
-
-
-rc_t pstring_copy(pstring* dst, const pstring* src)
-{
-    if( src == NULL ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcParam, rcNull);
-    }
-    return pstring_assign(dst, src->data, src->len);
-}
-
-rc_t pstring_assign(pstring* str, const void* data, const size_t data_sz)
-{
-    if( str == NULL || data == NULL ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcParam, rcNull);
-    } else if( data_sz > sizeof(str->data) - 1 ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcBuffer, rcInsufficient);
-    }
-    memmove(str->data, data, data_sz);
-    str->len = data_sz;
-    str->data[str->len] = '\0';
-    return 0;
-}
-
-rc_t pstring_concat(pstring* dst, const pstring* src)
-{
-    return pstring_append(dst, src->data, src->len);
-}
-
-rc_t pstring_append(pstring* str, const void* data, const size_t data_sz)
-{
-    if( str == NULL || data == NULL ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcParam, rcNull);
-    } else if( str->len + data_sz > sizeof(str->data) - 1 ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcBuffer, rcInsufficient);
-    }
-    memmove(&str->data[str->len], data, data_sz);
-    str->len += data_sz;
-    str->data[str->len] = '\0';
-    return 0;
-}
-
-rc_t pstring_append_chr(pstring* str, char c, size_t count)
-{
-    if( str == NULL ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcParam, rcNull);
-    } else if( str->len + count > sizeof(str->data) - 1 ) {
-        return RC(rcSRA, rcFormatter, rcCopying, rcBuffer, rcInsufficient);
-    }
-    memset(&str->data[str->len], c, count);
-    str->len += count;
-    str->data[str->len] = '\0';
-    return 0;
-}
-
-int pstring_cmp(const pstring* str1, const pstring* str2)
-{
-    int r = str1->len - str2->len;
-    return r ? r : memcmp(str1->data, str2->data, str1->len);
-}
-
-int pstring_strcmp(const pstring* str1, const char* str2)
-{
-    int r = str1->len - strlen(str2);
-    return r ? r : memcmp(str1->data, str2, str1->len);
-}
-
-bool pstring_is_fasta(const pstring* str)
-{
-    if( str != NULL ) {
-        const char* s = str->data;
-        const char* end = s + str->len;
-        while( s != end ) {
-            if( strchr("ACGTNactgn.", *s++) == NULL ) {
-                return false;
-            }
-        }
-        return str->len != 0;
-    }
-    return false;
-}
-
-bool pstring_is_csfasta(const pstring* str)
-{
-    if( str != NULL ) {
-        const char* s = str->data;
-        const char* end = s + str->len;
-
-        if( s == end || strchr("ACGTacgt", *s++) == NULL ) {
-            return false;
-        }
-        while( s != end ) {
-            if( strchr("0123.", *s++) == NULL ) {
-                return false;
-            }
-        }
-        return true;
-    }
-    return false;
-}
-
-rc_t pstring_quality_convert(pstring* qstr, ExperimentQualityEncoding enc, const uint8_t offset, const int8_t min, const int8_t max)
-{
-    rc_t rc = 0;
-    char* c, *end, *next;
-    pstring qbin;
-
-    if( qstr == NULL || min > max ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcParam, rcInvalid);
-    }
-    errno = 0;
-    c = qstr->data;
-    end = qstr->data + qstr->len;
-    pstring_clear(&qbin);
-    if(enc == eExperimentQualityEncoding_Undefined) {
-	if(memchr(c, ' ', qstr->len) != NULL || memchr(c, '\t', qstr->len) != NULL){
-		enc = eExperimentQualityEncoding_Decimal;
-	} else {
-		enc = eExperimentQualityEncoding_Ascii;
-	}
-    }
-
-
-    while( rc == 0 && c < end ) {
-        long q;
-        switch(enc) {
-            case eExperimentQualityEncoding_Decimal:
-            case eExperimentQualityEncoding_Hexadecimal:
-                /* spaced numbers form */
-                errno = 0;
-                q = strtol(c, &next, enc == eExperimentQualityEncoding_Decimal ? 10 : 16);
-                if( q == 0 && c == next ) {
-                    /* no more digits in line */
-		    goto DONE; /*** need do break while loop as well ***/
-                }
-                c = next;
-                break;
-            case eExperimentQualityEncoding_Ascii:
-                /* textual form with offset */
-                q = (long)(*c++) - offset;
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcUnrecognized);
-                break;
-        }
-        if( rc == 0 ) {
-            if( errno != 0 || q < min || q > max ) {
-                rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcOutofrange);
-            } else {
-                rc = pstring_append_chr(&qbin, (int8_t)q, 1);
-            }
-        }
-    }
-DONE:
-    if( rc == 0 ) {
-        rc = pstring_copy(qstr, &qbin);
-    }
-    return rc;
-}
diff --git a/tools/sra-load/pstring.h b/tools/sra-load/pstring.h
deleted file mode 100644
index 67a2142..0000000
--- a/tools/sra-load/pstring.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_pstring_
-#define _sra_load_pstring_
-
-#include <klib/rc.h>
-
-typedef struct pstring_struct {
-    uint16_t len;
-    char data[64 * 1024];
-} pstring;
-
-rc_t pstring_clear(pstring* str);
-
-rc_t pstring_copy(pstring* dst, const pstring* src);
-
-rc_t pstring_assign(pstring* str, const void* data, const size_t data_sz);
-
-rc_t pstring_concat(pstring* dst, const pstring* src);
-
-rc_t pstring_append(pstring* str, const void* data, const size_t data_sz);
-
-rc_t pstring_append_chr(pstring* str, char c, size_t count);
-
-int pstring_cmp(const pstring* str1, const pstring* str2);
-
-int pstring_strcmp(const pstring* str1, const char* str2);
-
-bool pstring_is_fasta(const pstring* str);
-
-bool pstring_is_csfasta(const pstring* str);
-
-rc_t pstring_quality_convert(pstring* qstr, ExperimentQualityEncoding enc, const uint8_t offset, const int8_t min, const int8_t max);
-
-#endif /* _sra_load_pstring_ */
diff --git a/tools/sra-load/run-xml.c b/tools/sra-load/run-xml.c
deleted file mode 100644
index 12399eb..0000000
--- a/tools/sra-load/run-xml.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <os-native.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include "run-xml.h"
-
-void DataBlockFile_Whack(DataBlockFile* self)
-{
-    if( self ) {
-        free(self->filename);
-        free(self->md5_digest);
-        free(self->cc_xml);
-        free(self->cc_path);
-    }
-}
-
-void DataBlock_Whack(DataBlock* self)
-{
-    if( self ) {
-        uint32_t i;
-        for(i = 0; i < self->files_count; i++) {
-            DataBlockFile_Whack(&self->files[i]);
-        }
-        free(self->files);
-        free(self->name);
-        free(self->member_name);
-    }
-}
-
-rc_t RunXML_Whack(const RunXML *cself)
-{
-    if( cself ) {
-        RunXML* self = (RunXML*)cself;
-        uint32_t i = 0;
-        for(i = 0; i < self->datablock_count; i++) {
-            DataBlock_Whack(&self->datablocks[i]);
-        }
-        free(self->datablocks);
-        PlatformXML_Whack(self->attributes.platform);
-        ReadSpecXML_Whack(self->attributes.reads);
-        free(self);
-    }
-    return 0;
-}
-
-static
-const struct {
-    const char* name;
-    ERunFileType type;
-} file_types[] = {
-    /* generic types giving us no useful information about file */
-    { "tab", rft_Unknown },
-    { "454_native", rft_Unknown },
-    { "454_native_seq", rft_Unknown },
-    { "454_native_qual", rft_Unknown },
-    { "Illumina_native", rft_Unknown },
-    { "Illumina_native_fastq", rft_Unknown },
-    { "Illumina_native_scarf", rft_Unknown },
-    { "SOLiD_native", rft_Unknown },
-    { "bam", rft_Unknown },
-    { "sra", rft_Unknown },
-    { "kar", rft_Unknown },
-    /* more specific information about file content */
-    { "fastq", rft_Fastq },
-    { "srf", rft_SRF },
-    { "sff", rft_SFF },
-    { "Helicos_native", rft_HelicosNative },
-    { "Illumina_native_seq", rft_IlluminaNativeSeq },
-    { "Illumina_native_prb", rft_IlluminaNativePrb },
-    { "Illumina_native_int", rft_IlluminaNativeInt },
-    { "Illumina_native_qseq", rft_IlluminaNativeQseq },
-    { "SOLiD_native_csfasta", rft_ABINativeCSFasta },
-    { "SOLiD_native_qual", rft_ABINativeQuality },
-    { "PacBio_HDF5", rft_PacBio_HDF5 }
-};
-
-static
-rc_t parse_FILE(const KXMLNode* FILE, DataBlockFile* file)
-{
-    rc_t rc = 0;
-    char* filetype = NULL, *checksum_method = NULL, *checksum = NULL;
-    char* quality_scoring_system = NULL, *quality_encoding = NULL, *ascii_offset = NULL;
-
-    if( (rc = KXMLNodeReadAttrCStr(FILE, "filename", &file->filename, NULL)) != 0 ||
-        file->filename == NULL || file->filename[0] == '\0' ) {
-        LOGERR(klogErr, rc, "FILE @filename");
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "filetype", &filetype, NULL)) != 0 ||
-        filetype == NULL || filetype[0] == '\0' ) {
-        rc = rc ? rc : RC(rcExe, rcStorage, rcConstructing, rcTag, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @filetype", PLOG_S(file), file->filename));
-
-/* <!-- custom pipeline attributes, not from schema! */
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "upload_id", &file->cc_xml, NULL)) != 0 &&
-               !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @upload_id", PLOG_S(file), file->filename));
-    } else if( file->cc_xml != NULL && file->cc_xml[0] == '\0' ) {
-        rc = RC(rcExe, rcStorage, rcConstructing, rcTag, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @upload_id", PLOG_S(file), file->filename));
-
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "cc_path", &file->cc_path, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @cc_path", PLOG_S(file), file->filename));
-    } else if( ((file->cc_path == NULL || file->cc_path[0] == '\0') && file->cc_xml != NULL) || 
-                (file->cc_path != NULL && file->cc_xml == NULL) ) {
-        rc = RC(rcExe, rcStorage, rcConstructing, rcTag, file->cc_xml ? rcEmpty : rcUnexpected);
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @cc_path", PLOG_S(file), file->filename));
-/* --> */
-
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "quality_scoring_system", &quality_scoring_system, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @quality_scoring_system", PLOG_S(file), file->filename));
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "quality_encoding", &quality_encoding, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @quality_encoding", PLOG_S(file), file->filename));
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "ascii_offset", &ascii_offset, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @ascii_offset", PLOG_S(file), file->filename));
-
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "checksum_method", &checksum_method, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @checksum_method", PLOG_S(file), file->filename));
-    } else if( (rc = KXMLNodeReadAttrCStr(FILE, "checksum", &checksum, NULL)) != 0 &&
-                !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @checksum", PLOG_S(file), file->filename));
-    } else if( checksum_method != NULL && strcasecmp(checksum_method, "MD5") != 0 ) {
-        rc = RC(rcExe, rcStorage, rcConstructing, rcData, rcInvalid);
-        PLOGERR(klogErr, (klogErr, rc, "FILE $(file) @checksum_method", PLOG_S(file), file->filename));
-    } else {
-        rc_t rc1 = 0, rc2 = 0, rc3 = 0, rc4 = 0;
-        if( quality_scoring_system != NULL ) {
-            if( quality_encoding == NULL ) {
-                rc1 = RC(rcExe, rcStorage, rcConstructing, rcParam, rcIncomplete);
-                PLOGERR(klogErr, (klogErr, rc1, "FILE $(file) @quality_encoding is required if @quality_scoring_system is specified",
-                    PLOG_S(file), file->filename));
-            } else if( strcmp(quality_scoring_system, "phred") == 0 ) {
-                file->attr.quality_scoring_system = eExperimentQualityType_Phred;
-            } else if( strcmp(quality_scoring_system, "log-odds") == 0 ) {
-                file->attr.quality_scoring_system = eExperimentQualityType_LogOdds;
-            } else {
-                rc1 = RC(rcExe, rcStorage, rcConstructing, rcAttr, rcOutofrange);
-                PLOGERR(klogErr, (klogErr, rc1, "FILE $(file) @quality_scoring_system", PLOG_S(file), file->filename));
-            }
-        }
-        if( quality_encoding != NULL ) {
-            if( quality_scoring_system == NULL ) {
-                rc2 = RC(rcExe, rcStorage, rcConstructing, rcParam, rcIncomplete);
-                PLOGERR(klogErr, (klogErr, rc2, "FILE $(file) @quality_scoring_system is required if @quality_encoding is specified",
-                    PLOG_S(file), file->filename));
-            } else if( strcmp(quality_encoding, "ascii") == 0 ) {
-                file->attr.quality_encoding = eExperimentQualityEncoding_Ascii;
-                if( ascii_offset == NULL ) {
-                    rc2 = RC(rcExe, rcStorage, rcConstructing, rcParam, rcIncomplete);
-                    PLOGERR(klogErr, (klogErr, rc2, "FILE $(file) @ascii_offset is required if @quality_encoding is 'ascii'",
-                        PLOG_S(file), file->filename));
-                } else if( strcmp(ascii_offset, "!") == 0 || strcmp(ascii_offset, "@") == 0 ) {
-                    file->attr.ascii_offset = ascii_offset[0];
-                } else {
-                    rc2 = RC(rcExe, rcStorage, rcConstructing, rcAttr, rcOutofrange);
-                    PLOGERR(klogErr, (klogErr, rc2, "FILE $(file) @ascii_offset", PLOG_S(file), file->filename));
-                }
-            } else if( strcmp(quality_encoding, "decimal") == 0 ) {
-                file->attr.quality_encoding = eExperimentQualityEncoding_Decimal;
-            } else if( strcmp(quality_encoding, "hexadecimal") == 0 ) {
-                file->attr.quality_encoding = eExperimentQualityEncoding_Hexadecimal;
-            } else {
-                rc2 = RC(rcExe, rcStorage, rcConstructing, rcAttr, rcOutofrange);
-                PLOGERR(klogErr, (klogErr, rc2, "FILE $(file) @quality_encoding", PLOG_S(file), file->filename));
-            }
-        }
-        if( ascii_offset != NULL ) {
-            if( file->attr.quality_encoding != eExperimentQualityEncoding_Ascii ) {
-                PLOGMSG(klogWarn, (klogWarn, "FILE $(file) @ascii_offset ignored since @quality_encoding is $(reason)",
-                    PLOG_2(PLOG_S(reason),PLOG_S(file)),
-                    file->attr.quality_encoding == eExperimentQualityEncoding_Undefined ? "undefined" : "not ascii", file->filename));
-            }
-        }
-        if( checksum_method == NULL && checksum != NULL ) {
-            PLOGMSG(klogWarn, (klogWarn, "FILE $(file) @checksum ignored since @checksum_method is not defined", PLOG_S(file), file->filename));
-            free(checksum);
-            checksum = NULL;
-        }
-        if( checksum != NULL ) {
-            if( strlen(checksum) != (16 * 2) ) {
-                /* MD5 sum is 16 bytes in hex format (2 hex digits per byte) */
-                rc3 = RC(rcExe, rcStorage, rcConstructing, rcData, rcUnrecognized);
-                PLOGERR(klogErr, (klogErr, rc3, "FILE $(file) MD5 @checksum", PLOG_S(file), file->filename));
-            } else if( (file->md5_digest = malloc(16 * sizeof(uint8_t))) == NULL ) {
-                rc3 = RC(rcExe, rcStorage, rcConstructing, rcMemory, rcExhausted);
-                PLOGERR(klogErr, (klogErr, rc3, "FILE $(file) MD5 @checksum allocation", PLOG_S(file), file->filename));
-            } else {
-                int i = 0;
-                char digit[3];
-                unsigned int xdig;
-                
-                digit[2] = '\0';
-                for(i = 0; rc3 == 0 && i < 16; i++) {
-                    digit[0] = tolower(checksum[2 * i]);
-                    digit[1] = tolower(checksum[2 * i + 1]);
-                    if(!isxdigit(digit[0]) || !isxdigit(digit[1])) {
-                        rc3 = RC(rcExe, rcStorage, rcConstructing, rcData, rcInvalid);
-                        PLOGERR(klogErr, (klogErr, rc3, "FILE $(file) MD5 @checksum $(digits)",
-                                 PLOG_2(PLOG_S(file),PLOG_S(digits)), file->filename, digit));
-                    } else {
-                        sscanf(digit, "%x", &xdig);
-                        file->md5_digest[i] = xdig;
-                    }
-                }
-            }
-        }
-        if( filetype != NULL ) {
-            int i;
-            for(i = 0; i < sizeof(file_types) / sizeof(file_types[0]); i++) {
-                if( strcmp(filetype, file_types[i].name) == 0 ) {
-                    file->attr.filetype = file_types[i].type;
-                    break;
-                }
-            }
-            if( file->attr.filetype == 0 ) {
-                rc4 = RC(rcExe, rcStorage, rcConstructing, rcAttr, rcOutofrange);
-                PLOGERR(klogErr, (klogErr, rc4, "FILE $(file) @filetype '$(type)'",
-                         PLOG_2(PLOG_S(file),PLOG_S(type)), file->filename, filetype));
-            }
-        }
-        rc = rc1 ? rc1 : (rc2 ? rc2 : (rc3 ? rc3 : rc4));
-    }
-    free(filetype);
-    free(checksum_method);
-    free(checksum);
-    free(quality_scoring_system);
-    free(quality_encoding);
-    free(ascii_offset);
-    return rc;
-}
-
-static
-rc_t parse_DATA_BLOCK(const KXMLNode* DATA_BLOCK, DataBlock* datablock)
-{
-    rc_t rc = 0;
-    const KXMLNodeset* FILES;
-
-    rc = KXMLNodeReadAttrCStr(DATA_BLOCK, "name", &datablock->name, NULL);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "DATA_BLOCK @name");
-        return rc;
-    }
-    rc = KXMLNodeReadAttrCStr(DATA_BLOCK, "member_name", &datablock->member_name, NULL);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "DATA_BLOCK @member_name");
-        return rc;
-    }
-    if( datablock->member_name != NULL && strcasecmp(datablock->member_name, "default") == 0 ) {
-        datablock->member_name[0] = '\0';
-    }
-    datablock->serial = ~0; /* file w/o serial pushed to end of list */
-    rc = KXMLNodeReadAttrAsU32(DATA_BLOCK, "serial", &datablock->serial);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "DATA_BLOCK @serial");
-        return rc;
-    }
-    datablock->sector = -1;
-    rc = KXMLNodeReadAttrAsU64(DATA_BLOCK, "sector", (uint64_t*)&datablock->sector);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "DATA_BLOCK @sector");
-        return rc;
-    }
-    datablock->region = -1;
-    rc = KXMLNodeReadAttrAsU64(DATA_BLOCK, "region", (uint64_t*)&datablock->region);
-    if( rc != 0 && !(GetRCObject(rc) == rcAttr && GetRCState(rc) == rcNotFound) ) {
-        LOGERR(klogErr, rc, "DATA_BLOCK @region");
-        return rc;
-    }
-
-    if( (rc = KXMLNodeOpenNodesetRead(DATA_BLOCK, &FILES, "FILES/FILE")) == 0) {
-        if( (rc = KXMLNodesetCount(FILES, &datablock->files_count)) != 0) {
-            LOGERR(klogErr, rc, "reading FILES/FILE node(s)");
-        } else if( datablock->files_count < 1 ) {
-            rc = RC(rcExe, rcStorage, rcConstructing, rcData, rcIncomplete);
-            LOGERR(klogErr, rc, "FILES/FILE at least one node is required");
-        } else if( (datablock->files = calloc(datablock->files_count, sizeof(*datablock->files))) == NULL ) {
-                rc = RC(rcExe, rcStorage, rcConstructing, rcMemory, rcExhausted);
-                LOGERR(klogErr, rc, "allocating FILES/FILE");
-        } else {
-            uint32_t i = 0;
-            for(i = 0; rc == 0 && i < datablock->files_count; i++) {
-                const KXMLNode *FILE = NULL;
-                if( (rc = KXMLNodesetGetNodeRead(FILES, &FILE, i)) == 0 ) {
-                    rc = parse_FILE(FILE, &datablock->files[i]);
-                    KXMLNodeRelease(FILE);
-                }
-                if( rc != 0 ) {
-                    PLOGERR(klogErr, (klogErr, rc, "reading FILES/FILE $(i)", PLOG_U32(i), i));
-                }
-            }
-        }
-        KXMLNodesetRelease(FILES);
-    }
-    return rc;
-}
-
-rc_t RunXML_Make(RunXML** rslt, const KXMLNode* RUN)
-{
-    rc_t rc = 0;
-    const KXMLNodeset* nset = NULL;
-    RunXML* obj = NULL;
-    uint32_t p_spot_length = 0, r_spot_length = 0;
-
-    if(rslt == NULL || RUN == NULL) {
-        return RC(rcExe, rcStorage, rcConstructing, rcParam, rcNull);
-    }
-    *rslt = NULL;
-    obj = calloc(1, sizeof(*obj));
-    if( obj == NULL ) {
-        rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    } else {
-        if( (rc = PlatformXML_Make(&obj->attributes.platform, RUN, &p_spot_length)) != 0 ) {
-            if( GetRCState(rc) == rcNotFound ) {
-                rc = 0;
-            } else {
-                LOGERR(klogErr, rc, "RUN/PLATFORM");
-            }
-        }
-        if( rc == 0 && (rc = ReadSpecXML_Make(&obj->attributes.reads, RUN, "SPOT_DESCRIPTOR", &r_spot_length)) != 0 ) {
-            if( GetRCState(rc) == rcNotFound ) {
-                rc = 0;
-            } else {
-                LOGERR(klogErr, rc, "RUN/.../READ_SPEC");
-            }
-        }
-        obj->attributes.spot_length = r_spot_length ? r_spot_length : p_spot_length;
-        if( rc == 0 && p_spot_length != 0 && r_spot_length != 0 && p_spot_length != r_spot_length ) {
-            PLOGMSG(klogWarn, (klogWarn,
-                "in RUN sequence length (cycle count) in PLATFORM $(p) differ"
-                " from SPOT_LENGTH $(l) in SPOT_DECODE_SPEC",
-                PLOG_2(PLOG_U32(p),PLOG_U32(l)), p_spot_length, r_spot_length));
-        }
-    }
-    if( rc == 0 ) {
-        if( (rc = KXMLNodeOpenNodesetRead(RUN, &nset, "DATA_BLOCK")) == 0) {
-            if( (rc = KXMLNodesetCount(nset, &obj->datablock_count)) == 0 && obj->datablock_count > 0 ) {
-                obj->datablocks = calloc(obj->datablock_count, sizeof(*obj->datablocks));
-                if( obj->datablocks == NULL ) {
-                    rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                } else {
-                    uint32_t i = 0;
-                    for(i = 0; rc == 0 && i < obj->datablock_count; i++) {
-                        const KXMLNode *DATA_BLOCK = NULL;
-                        if( (rc = KXMLNodesetGetNodeRead(nset, &DATA_BLOCK, i)) == 0 ) {
-                            rc = parse_DATA_BLOCK(DATA_BLOCK, &obj->datablocks[i]);
-                            KXMLNodeRelease(DATA_BLOCK);
-                        }
-                        if( rc != 0 ) {
-                            PLOGERR(klogErr, (klogErr, rc, "reading DATA_BLOCK $(i)", PLOG_U32(i), i));
-                        }
-                    }
-                    if( rc == 0 ) {
-                        /* serial ascending sort */
-                        bool swapped = true;
-                        while(swapped) {
-                            swapped = false;
-                            for(i = 1; i < obj->datablock_count; i++) {
-                                if( obj->datablocks[i].serial < obj->datablocks[i - 1].serial ) {
-                                    DataBlock db;
-                                    memcpy(&db, &obj->datablocks[i], sizeof(db));
-                                    memcpy(&obj->datablocks[i], &obj->datablocks[i - 1], sizeof(db));
-                                    memcpy(&obj->datablocks[i - 1], &db, sizeof(db));
-                                    swapped = true;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            KXMLNodesetRelease(nset);
-        } else {
-            LOGERR(klogErr, rc, "DATA_BLOCK node(s)");
-        }
-    }
-
-    if( rc == 0 ) {
-        if( (rc = KXMLNodeOpenNodesetRead(RUN, &nset, "RUN_ATTRIBUTES/RUN_ATTRIBUTE")) == 0) {
-            uint32_t num_attr = 0;
-            if( (rc = KXMLNodesetCount(nset, &num_attr)) == 0) {
-                uint32_t i = 0;
-                for(i = 0; rc == 0 && i < num_attr; i++) {
-                    const KXMLNode* RUN_ATTRIBUTE = NULL;
-                    if( (rc = KXMLNodesetGetNodeRead(nset, &RUN_ATTRIBUTE, i)) == 0 ) {
-                        const KXMLNode* TAG = NULL, *VALUE = NULL;
-                        if( (rc = KXMLNodeGetFirstChildNodeRead(RUN_ATTRIBUTE, &TAG, "TAG")) == 0 && 
-                            (rc = KXMLNodeGetFirstChildNodeRead(RUN_ATTRIBUTE, &VALUE, "VALUE")) == 0 ) {
-                            char* tag = NULL, *value = NULL;
-                            if( (rc = KXMLNodeReadCStr(TAG, &tag, NULL)) == 0 &&
-                                (rc = KXMLNodeReadCStr(VALUE, &value, NULL)) == 0 ) {
-                                if( strcasecmp(tag, "read_name_barcode_proc_directive") == 0 ) {
-                                    if( value == NULL || value[0] == '\0' ) {
-                                        obj->attributes.barcode_rule = eBarcodeRule_not_set;
-                                    } else if (strcasecmp(value, "interpret_as_spotgroup") == 0 || strcasecmp(value, "use_file_spot_name") == 0) {
-                                        obj->attributes.barcode_rule = eBarcodeRule_use_file_spot_name;
-                                    } else if (strcasecmp(value, "use_table_in_experiment") == 0) {
-                                        obj->attributes.barcode_rule = eBarcodeRule_use_table_in_experiment;
-                                    } else if(strcasecmp(value, "ignore") == 0) {
-                                        obj->attributes.barcode_rule = eBarcodeRule_ignore_barcode;
-                                    } else {
-                                        rc = RC(rcSRA, rcFormatter, rcParsing, rcAttr, rcUnrecognized);
-                                        PLOGERR(klogErr, (klogErr, rc, "RUN_ATTRIBUTE['$(t)'] VALUE='$(v)'", PLOG_2(PLOG_S(t),PLOG_S(v)), tag, value));
-                                    }
-                                } else if( strcasecmp(tag, "quality_scoring_system") == 0 ) {
-                                    if( value != NULL )  {
-                                        if( strcasecmp(value, "phred") == 0 ) {
-                                            obj->attributes.quality_type = eExperimentQualityType_Phred;
-                                        } else if( strcasecmp(value, "logodds") == 0 || strcasecmp(value, "log odds") == 0 ) {
-                                            obj->attributes.quality_type = eExperimentQualityType_LogOdds;
-                                        } else if( strcasecmp(value, "other") == 0 ) {
-                                            obj->attributes.quality_type = eExperimentQualityType_Other;
-                                        }
-                                    }
-                                    if( obj->attributes.quality_type == eExperimentQualityType_Undefined ) {
-                                        rc = RC(rcSRA, rcFormatter, rcParsing, rcAttr, rcUnrecognized);
-                                        PLOGERR(klogErr, (klogErr, rc, "RUN_ATTRIBUTE['$(t)'] VALUE='$(v)'", PLOG_2(PLOG_S(t),PLOG_S(v)), tag, value));
-                                    }
-                                } else if( strcasecmp(tag, "quality_book_char") == 0 ) {
-                                    if( value != NULL && value[0] != '\0' ) {
-                                        obj->attributes.quality_offset = value[0];
-                                    } else {
-                                        PLOGMSG(klogWarn, (klogWarn, "RUN_ATTRIBUTE['$(t)'] VALUE='$(v)' ignored", PLOG_2(PLOG_S(t),PLOG_S(v)), tag, value));
-                                    }
-                                }
-                            } else {
-                                PLOGERR(klogErr, (klogErr, rc, "RUN_ATTRIBUTE[$(i)]/VALUE", PLOG_U32(i), i));
-                            }
-                            free(value);
-                            free(tag);
-                        } else {
-                            PLOGERR(klogErr, (klogErr, rc, "RUN_ATTRIBUTE[$(i)]", PLOG_U32(i), i));
-                        }
-                        KXMLNodeRelease(VALUE);
-                        KXMLNodeRelease(TAG);
-                        KXMLNodeRelease(RUN_ATTRIBUTE);
-                    } else {
-                        PLOGERR(klogErr, (klogErr, rc, "RUN_ATTRIBUTE $(i)", PLOG_U32(i), i));
-                    }
-                }
-            }
-            KXMLNodesetRelease(nset);
-        } else if( GetRCState(rc) == rcNotFound ) {
-            rc = 0;
-        } else {
-            LOGERR(klogErr, rc, "RUN_ATTRIBUTES/RUN_ATTRIBUTE node(s)");
-        }
-    }
-    if (rc == 0) {
-        *rslt = obj;
-    } else {
-        RunXML_Whack(obj);
-    }
-    return rc;
-}
diff --git a/tools/sra-load/run-xml.h b/tools/sra-load/run-xml.h
deleted file mode 100644
index b46172b..0000000
--- a/tools/sra-load/run-xml.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_tools_run_xml_
-#define _sra_tools_run_xml_
-
-#ifndef _h_klib_container_
-#include <klib/container.h>
-#endif
-
-#include "common-xml.h"
-
-typedef enum ERunFileType_enum {
-    rft_Unknown = 1,
-    rft_Fastq,
-    rft_SRF,
-    rft_SFF,
-    rft_HelicosNative,
-    rft_IlluminaNativeSeq,
-    rft_IlluminaNativePrb,
-    rft_IlluminaNativeInt,
-    rft_IlluminaNativeQseq,
-    rft_ABINativeCSFasta,
-    rft_ABINativeQuality,
-    rft_PacBio_HDF5
-} ERunFileType;
-
-typedef struct DataBlockFileAttr_struct {
-    ERunFileType filetype;
-    ExperimentQualityType quality_scoring_system;
-    ExperimentQualityEncoding quality_encoding;
-    uint8_t ascii_offset;
-} DataBlockFileAttr;
-
-typedef struct DataBlockFile_struct {
-    DataBlockFileAttr attr;
-    char* filename;
-    uint8_t* md5_digest;
-    char* cc_xml;
-    char* cc_path;
-} DataBlockFile;
-
-typedef struct DataBlock_struct {
-    char* name;
-    char* member_name;
-    int64_t sector;
-    int64_t region;
-    uint32_t serial;
-    uint32_t files_count;
-    DataBlockFile* files;
-} DataBlock;
-
-typedef struct RunXML {
-    uint32_t datablock_count;
-    DataBlock* datablocks;
-    /* known/used run attribuites */
-    RunAttributes attributes;
-} RunXML;
-
-void DataBlockFile_Whack(DataBlockFile* self);
-
-void DataBlock_Whack(DataBlock* self);
-
-rc_t RunXML_Make(RunXML **rslt, const KXMLNode *RUN);
-
-rc_t RunXML_Whack(const RunXML *cself);
-
-#endif /* _sra_tools_run_xml_ */
diff --git a/tools/sra-load/sff-fmt.c b/tools/sra-load/sff-fmt.c
deleted file mode 100644
index 49ce718..0000000
--- a/tools/sra-load/sff-fmt.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <sra/sff-file.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-
-typedef struct SFFLoaderFmt SFFLoaderFmt;
-
-#define SRALOADERFMT_IMPL SFFLoaderFmt
-#include "loader-fmt.h"
-
-#include "writer-454.h"
-#include "writer-ion-torrent.h"
-#include "sff-load.vers.h"
-#include "debug.h"
-
-#include <byteswap.h>
-
-struct SFFLoaderFmt {
-    SRALoaderFmt dad; /* base type -> must be first in struct */ 
-    const SRAWriter454* w454;
-    const SRAWriterIonTorrent* wIonTorrent;
-    bool skip_signal;
-    uint32_t curr_read_number;
-
-    /* file buffer data */
-    const char* file_name;
-    const uint8_t* file_buf;
-    size_t file_advance;
-    uint64_t index_correction; /* used in case of concatinated files */
-
-    /* spot data */
-    SFFCommonHeader header;
-    pstring flow_chars;
-    pstring key_seq;
-
-    SFFReadHeader read_header;
-    pstring name;
-    pstring signal;
-    pstring position;
-    pstring read;
-    pstring quality;
-};
-
-static
-rc_t SFFLoaderFmt_ReadBlock(SFFLoaderFmt* self, const SRALoaderFile* file, size_t size, const char* location, bool silent)
-{
-    size_t read = 0;
-    rc_t rc = SRALoaderFileRead(file, self->file_advance, size, (const void**)&self->file_buf, &read);
-    self->file_advance = 0;
-    if( rc == 0 && (size > 0 && (self->file_buf == NULL || read < size)) ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    }
-    if( rc != 0 && !silent ) {
-        SRALoaderFile_LOG(file, klogErr, rc, "$(l), needed $(needed) got $(got) bytes",
-                PLOG_3(PLOG_S(l),PLOG_U32(needed),PLOG_U32(got)), location, size, read);
-    }
-    return rc;
-}
-
-static
-rc_t SFFLoaderFmtReadCommonHeader(SFFLoaderFmt* self, const SRALoaderFile *file)
-{
-    rc_t rc = 0;
-    bool skiped_idx_pad = false;
-    uint16_t head_sz;
-    SFFCommonHeader prev_head;
-    pstring prev_flow_chars;
-    pstring prev_key_seq;
-
-    if( (rc = SRALoaderFile_Offset(file, &self->index_correction)) != 0 ) {
-        SRALoaderFile_LOG(file, klogErr, rc, "Reading initial file position", NULL);
-        return rc;
-    }
-SkipIndexPad:
-    self->index_correction += self->file_advance;
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, SFFCommonHeader_size, NULL, true)) != 0) {
-        SRALoaderFile_LOG(file, klogErr, rc, "common header, needed $(needed) bytes",
-                          PLOG_U32(needed), SFFCommonHeader_size);
-        return rc;
-    }
-    if( self->header.magic_number != 0 ) {
-        /* next file in stream, remember prev to sync to each */
-        memcpy(&prev_head, &self->header, sizeof(SFFCommonHeader));
-        pstring_copy(&prev_flow_chars, &self->flow_chars);
-        pstring_copy(&prev_key_seq, &self->key_seq);
-    } else {
-        prev_head.magic_number = 0;
-        prev_head.index_length = 0;
-    }
-
-    memcpy(&self->header, self->file_buf, SFFCommonHeader_size);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    self->header.magic_number = bswap_32(self->header.magic_number);
-    self->header.version = bswap_32(self->header.version);
-    self->header.index_offset = bswap_64(self->header.index_offset);
-    self->header.index_length = bswap_32(self->header.index_length);
-    self->header.number_of_reads = bswap_32(self->header.number_of_reads);
-    self->header.header_length = bswap_16(self->header.header_length);
-    self->header.key_length = bswap_16(self->header.key_length);
-    self->header.num_flows_per_read = bswap_16(self->header.num_flows_per_read);
-#endif
-
-    if( self->header.magic_number != (('.'<<24)|('s'<<16)|('f'<<8)|('f'<<0)) ) {
-        if( !skiped_idx_pad && prev_head.magic_number != 0 ) {
-            /* possible concatination of 2 files with index at EOF and padded to 8 bytes with header values not padded,
-               try skipping padding and reread */
-            uint32_t pad = 8 - prev_head.index_length % 8;
-            if( pad != 0 ) {
-                self->file_advance += pad;
-                DEBUG_MSG(5, ("%s: trying to skip over %u bytes index section padding\n", self->file_name, pad));
-                skiped_idx_pad = true;
-                goto SkipIndexPad;
-            }
-        }
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnrecognized);
-        SRALoaderFile_LOG(file, klogErr, rc, "magic number: $(m)", PLOG_U32(m), self->header.magic_number);
-        return rc;
-    }
-    if( self->header.version != 1 ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcBadVersion);
-        SRALoaderFile_LOG(file, klogErr, rc, "format version $(v)", PLOG_U32(v), self->header.version);
-        return rc;
-    }
-    if( self->header.flowgram_format_code != SFFFormatCodeUI16Hundreths ) {
-        /* NOTE: add a case here if flowgram coding gets new version to support different */
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnsupported);
-        SRALoaderFile_LOG(file, klogErr, rc, "common header flowgram format code", NULL);
-        return rc;
-    }
-    if( self->header.index_length % 8 != 0 ) {
-        DEBUG_MSG(5, ("%s: index_length field value is not 8 byte padded: %u\n", self->file_name, self->header.index_length));
-    }
-    head_sz = SFFCommonHeader_size + self->header.num_flows_per_read + self->header.key_length;
-    head_sz += (head_sz % 8) ? (8 - (head_sz % 8)) : 0;
-    if( head_sz != self->header.header_length ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcFormat, rcInvalid);
-        SRALoaderFile_LOG(file, klogErr, rc, "header length $(h) <> $(s) ", PLOG_2(PLOG_U16(h),PLOG_U16(s)),
-                          self->header.header_length, head_sz);
-        return rc;
-    }
-    /* read flow chars and key */
-    self->file_advance = SFFCommonHeader_size;
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, head_sz - SFFCommonHeader_size, "common header", false)) != 0) {
-        return rc;
-    }
-    self->file_advance = head_sz - SFFCommonHeader_size;
-
-    if( (rc = pstring_assign(&self->flow_chars, self->file_buf, self->header.num_flows_per_read)) != 0 ||
-        (rc = pstring_assign(&self->key_seq, self->file_buf + self->header.num_flows_per_read, self->header.key_length)) != 0 ) {
-        SRALoaderFile_LOG(file, klogErr, rc, "reading flows/key sequence", NULL);
-        return rc;
-    }
-    if( prev_head.magic_number != 0 ) {
-        /* next file's common header must match previous file's common header, partially */
-        if( prev_head.key_length != self->header.key_length ||
-            prev_head.num_flows_per_read != self->header.num_flows_per_read ||
-            pstring_cmp(&prev_flow_chars, &self->flow_chars) != 0 ||
-            pstring_cmp(&prev_key_seq, &self->key_seq) != 0 ) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInconsistent);
-                SRALoaderFile_LOG(file, klogErr, rc, "previous file common header differ in flows/key sequence", NULL);
-        }
-    }
-    if( rc == 0 ) {
-        if( self->w454 ) {
-            rc = SRAWriter454_WriteHead(self->w454, &self->flow_chars, &self->key_seq);
-        } else {
-            rc = SRAWriterIonTorrent_WriteHead(self->wIonTorrent, &self->flow_chars, &self->key_seq);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SFFLoaderFmtReadDataHeader(SFFLoaderFmt* self, const SRALoaderFile* file)
-{
-    rc_t rc = 0;
-    uint16_t head_sz = 0;
-
-    /* Make sure the entire fixed portion of Read Header section is in the file buffer window */
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, SFFReadHeader_size, "read header", false)) != 0 ) {
-        return rc;
-    }
-    memcpy(&self->read_header, self->file_buf, SFFReadHeader_size);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    self->read_header.header_length = bswap_16(self->read_header.header_length);
-    self->read_header.name_length = bswap_16(self->read_header.name_length);
-    self->read_header.number_of_bases = bswap_32(self->read_header.number_of_bases);
-    self->read_header.clip_quality_left = bswap_16(self->read_header.clip_quality_left);
-    self->read_header.clip_quality_right = bswap_16(self->read_header.clip_quality_right);
-    self->read_header.clip_adapter_left = bswap_16(self->read_header.clip_adapter_left);
-    self->read_header.clip_adapter_right = bswap_16(self->read_header.clip_adapter_right);
-#endif
-
-    head_sz = SFFReadHeader_size + self->read_header.name_length;
-    head_sz += (head_sz % 8) ? (8 - (head_sz % 8)) : 0;
-    if( head_sz != self->read_header.header_length ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcFormat, rcInvalid);
-        SRALoaderFile_LOG(file, klogErr, rc, "read header length $(h) != $(s)", PLOG_2(PLOG_U16(h),PLOG_U16(s)),
-                          self->header.header_length, head_sz);
-        return rc;
-    }
-    /* read name */
-    self->file_advance = SFFReadHeader_size;
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, head_sz - SFFReadHeader_size, "read header", false)) != 0) {
-        return rc;
-    }
-    self->file_advance = head_sz - SFFReadHeader_size;
-
-    if( (rc = pstring_assign(&self->name, self->file_buf, self->read_header.name_length)) != 0 ) {
-        SRALoaderFile_LOG(file, klogErr, rc, "copying read name", NULL);
-    }
-    return rc;
-}
-
-static
-rc_t SFFLoaderFmtReadData(SFFLoaderFmt* self, const SRALoaderFile* file)
-{
-    rc_t rc = 0;
-    uint32_t i;
-
-    /* calc signal chunk size */
-    size_t signal_sz = self->header.num_flows_per_read * sizeof(uint16_t);
-    /* plus position, read, quality */
-    size_t sz = signal_sz + self->read_header.number_of_bases * 3;
-    /* + padding */
-    sz += (sz % 8) ? (8 - (sz % 8)) : 0;
-
-    /* adjust the buffer window to full data block size */
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, sz, "read data", false)) != 0 ) { 
-        return rc;
-    }
-    self->file_advance = sz;
-
-    if( !self->skip_signal ) {
-        rc = pstring_assign(&self->signal, self->file_buf, signal_sz);
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        if( rc == 0 ) {
-            uint16_t* sig = (uint16_t*)self->signal.data;
-            for(i = 0; i < self->header.num_flows_per_read; i++) {
-                sig[i] = bswap_16(sig[i]);
-            }
-        }
-#endif
-    }
-
-    if( rc == 0 ) {
-        const uint8_t* pos = self->file_buf + signal_sz;
-
-        if( !self->skip_signal ) {
-            INSDC_coord_one *p;
-            /* reset buffer to proper size */
-            pstring_clear(&self->position);
-            rc = pstring_append_chr(&self->position, 0, self->read_header.number_of_bases * sizeof(*p));
-            p = (INSDC_coord_one*)&self->position.data[0];
-            p[0] = pos[0];
-            for(i = 1; i < self->read_header.number_of_bases; i++) {
-                p[i] = p[i - 1] + pos[i];
-            }
-        }
-        if( rc == 0 ) {
-            pos += self->read_header.number_of_bases;
-            rc = pstring_assign(&self->read, pos, self->read_header.number_of_bases);
-            /*for(i = 0; i< self->read.len; i++ ) {
-                self->read.data[i] = tolower(self->read.data[i]);
-            }*/
-        }
-        if( rc == 0 ) {
-            pos += self->read_header.number_of_bases;
-            rc = pstring_assign(&self->quality, pos, self->read_header.number_of_bases);
-        }
-    }
-    if( rc != 0 ) {
-        SRALoaderFile_LOG(file, klogErr, rc, "copying read data", NULL);
-    }
-    return rc;
-}
-
-/**
- * SFFLoaderFmtSkipIndex - skip through indexes section if current position in file is indexes offset from header
- */
-static
-rc_t SFFLoaderFmtSkipIndex(SFFLoaderFmt* self, const SRALoaderFile* file)
-{
-    rc_t rc = 0;
-    uint64_t pos;
-    /* advance whatever and read file position */
-    if( (rc = SFFLoaderFmt_ReadBlock(self, file, 0, "index", false)) == 0 &&
-        (rc = SRALoaderFile_Offset(file, &pos)) == 0 ) {
-        if( pos == (self->header.index_offset + self->index_correction) ) {
-            /* skip */
-            size_t leftover;
-            self->file_advance += self->header.index_length;
-            DEBUG_MSG(5, ("%s: indexes skipped at 0x%016X, %u bytes\n",
-                          self->file_name, pos, self->header.index_length));
-            /* try to get more data while skipping index */
-            if( (rc = SRALoaderFileRead(file, self->file_advance, 16, (const void**)&self->file_buf, &leftover)) == 0 ) {
-                if( self->file_buf != NULL && leftover < 8 ) {
-                    /* smth short is read! possible last chunk in file was index and it was padded to 8 bytes,
-                       while in header index_length field value was not padded */
-                    if( leftover == (8 - self->header.index_length % 8) ) {
-                        /* read out padding */
-                        if( (rc = SRALoaderFileRead(file, leftover, 0, (const void**)&self->file_buf, &leftover)) == 0 ) {
-                            if( self->file_buf == NULL ) {
-                                /* ok EOF! */
-                                DEBUG_MSG(5, ("%s: ignored extra %u bytes index section padding\n",
-                                              self->file_name, 8 - self->header.index_length % 8));
-                            }
-                        }
-                    }
-                }
-            }
-            self->file_advance = 0;
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SFFLoaderFmtWriteDataFile(SFFLoaderFmt* self, const SRALoaderFile* file)
-{
-    rc_t rc = 0;
-
-    while( rc == 0 ) {
-        if( self->curr_read_number == 0 ) {
-            if( (rc = SFFLoaderFmtReadCommonHeader(self, file)) == 0 ) {
-                DEBUG_MSG (5, ("%s: Common header ok: %u reads\n", self->file_name, self->header.number_of_reads));
-                DEBUG_MSG (8, ("%s: flow_chars: [%hu] %s\n", self->file_name, self->header.num_flows_per_read, self->flow_chars.data));
-                DEBUG_MSG (8, ("%s: key_seq: [%hu] %s\n", self->file_name, self->header.key_length, self->key_seq.data));
-            } else if( GetRCObject(rc) == rcData && GetRCState(rc) == rcIgnored ) {
-                rc = 0;
-                break;
-            }
-        }
-        if( rc == 0 && self->header.number_of_reads != 0 && 
-            (rc = SFFLoaderFmtSkipIndex(self, file)) == 0 &&
-            (rc = SFFLoaderFmtReadDataHeader(self, file)) == 0 &&
-            (rc = SFFLoaderFmtReadData(self, file)) == 0 ) {
-            if( self->w454 ) {
-                rc = SRAWriter454_WriteRead(self->w454, file, &self->name, &self->read, &self->quality,
-                                         self->skip_signal ? NULL : &self->signal,
-                                         self->skip_signal ? NULL : &self->position,
-                                         self->read_header.clip_quality_left, self->read_header.clip_quality_right,
-                                         self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
-            } else {
-                rc = SRAWriterIonTorrent_WriteRead(self->wIonTorrent, file, &self->name, &self->read, &self->quality,
-                         self->skip_signal ? NULL : &self->signal,
-                         self->skip_signal ? NULL : &self->position,
-                         self->read_header.clip_quality_left, self->read_header.clip_quality_right,
-                         self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
-            }
-            if( rc == 0 ) {
-                ++self->curr_read_number;
-            }
-        }
-        if( rc != 0 && (GetRCObject(rc) != rcTransfer && GetRCState(rc) != rcDone) ) {
-            SRALoaderFile_LOG(file, klogErr, rc, "on or about read #$(i)", PLOG_U32(i), self->curr_read_number + 1);
-        } else if( self->curr_read_number == self->header.number_of_reads ) {
-            DEBUG_MSG(5, ("%s: done loading declared %u reads\n", self->file_name, self->curr_read_number));
-            self->curr_read_number = 0;
-            /* will skip indexes if they are at eof */
-            if( (rc = SFFLoaderFmtSkipIndex(self, file)) == 0 ) {
-                /* This should be the end of file and/or beginning of next */
-                if( (rc = SFFLoaderFmt_ReadBlock(self, file, 0, "EOF", false)) == 0 ) {
-                    if( self->file_buf == NULL ) {
-                        DEBUG_MSG(5, ("%s: EOF detected\n", self->file_name));
-                        self->index_correction = 0;
-                        break;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-const char UsageDefaultName[] = "sff-load";
-
-uint32_t KAppVersion(void)
-{
-    return SFF_LOAD_VERS;
-}
-
-static
-rc_t SFFLoaderFmtVersion( const SFFLoaderFmt*self, uint32_t *vers, const char** name )
-{
-    *vers = SFF_LOAD_VERS;
-    *name = "SFF";
-    return 0;
-}
-
-static
-rc_t SFFLoaderFmtDestroy(SFFLoaderFmt* self, SRATable** table)
-{
-    SRAWriter454_Whack(self->w454, table);
-    SRAWriterIonTorrent_Whack(self->wIonTorrent, table);
-    free(self);
-    return 0;
-}
-
-static
-rc_t SFFLoaderFmtWriteData(SFFLoaderFmt* self, uint32_t argc, const SRALoaderFile* const argv[], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t idx = 0;
-
-    for(idx = 0; rc == 0 && idx < argc; idx ++) {
-        if( (rc = SRALoaderFileName(argv[idx], &self->file_name)) == 0 ) {
-            self->curr_read_number = 0;
-            rc = SFFLoaderFmtWriteDataFile(self, argv[idx]);
-        }
-    }
-    return rc;
-}
-
-static SRALoaderFmt_vt_v1 vtSFFLoaderFmt = 
-{
-    1,
-    0,
-    SFFLoaderFmtDestroy,
-    SFFLoaderFmtVersion,
-    NULL,
-    SFFLoaderFmtWriteData
-};
-
-rc_t SFFLoaderFmtMake(SRALoaderFmt** self, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SFFLoaderFmt* obj = NULL;
-    const PlatformXML* platform;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcSelf, rcNull);
-    }
-    *self = NULL;
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ) {
-        return rc;
-    }
-    obj = calloc(1, sizeof(SFFLoaderFmt));
-    if(obj == NULL) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    }
-    if( (rc = SRALoaderFmtInit(&obj->dad, (const SRALoaderFmt_vt*)&vtSFFLoaderFmt)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    } else {
-        if( platform->id == SRA_PLATFORM_454 ) {
-            if( (rc = SRAWriter454_Make(&obj->w454, config)) != 0 ) {
-                LOGERR(klogInt, rc, "failed to initialize writer");
-            }
-        } else {
-            if( (rc = SRAWriterIonTorrent_Make(&obj->wIonTorrent, config)) != 0 ) {
-                LOGERR(klogInt, rc, "failed to initialize Ion Torrent writer");
-            }
-        }
-    }
-    if(rc == 0) {
-        obj->skip_signal = (config->columnFilter & efltrSIGNAL) && !(config->columnFilter & efltrDEFAULT);
-        *self = &obj->dad;
-    } else {
-        free(obj);
-    }
-    return rc;
-}
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    return SFFLoaderFmtMake(self, config);
-}
diff --git a/tools/sra-load/sff-load.vers b/tools/sra-load/sff-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/sff-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/sra-writer.c b/tools/sra-load/sra-writer.c
deleted file mode 100644
index 3f29211..0000000
--- a/tools/sra-load/sra-writer.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <kapp/main.h>
-#include <klib/rc.h>
-#include <klib/status.h>
-#include <klib/log.h>
-#include <sra/types.h>
-#include <sra/wsradb.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "loader-fmt.h"
-#include "sra-writer.h"
-
-#define SRAWRITER_MAX_READS 256
-
-struct SRAWriter {
-    const SRALoaderConfig* config;
-    int64_t spots_to_run;
-
-    SRATable* table;
-    uint8_t nreads;
-    bool defaults;
-
-    uint32_t col_spot_group_id;
-    uint32_t col_read_start_id;
-    uint32_t col_read_len_id;
-    SRASegment read_segs[SRAWRITER_MAX_READS];
-};
-
-rc_t SRAWriter_Make( SRAWriter** self, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriter* obj = NULL;
-    uint8_t nreads;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetReadNumber(config->experiment, &nreads)) != 0 ) {
-        return rc;
-    }
-    obj = calloc(1, sizeof(*obj));
-    if( obj == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    }
-    obj->config = config;
-    obj->nreads = nreads;
-    obj->spots_to_run = config->spots_to_run;
-    *self = obj;
-    return 0;
-}
-
-void SRAWriter_Whack(SRAWriter* self, SRATable** table)
-{
-    if( self != NULL ) {
-        if( table != NULL ) {
-            *table = self->table;
-        } else {
-            SRATableRelease(self->table);
-        }
-        free(self);
-    }
-}
-
-rc_t SRAWriter_CreateTable(SRAWriter* self, const char* schema)
-{
-    rc_t rc = 0;
-
-    assert(self->table == NULL);
-    if( self == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    } else {
-retry:
-        rc = SRAMgrCreateTable(self->config->sra_mgr, &self->table, schema, self->config->table_path);
-        if( GetRCObject(rc) == rcTable && GetRCState(rc) == rcExists && self->config->force_table_overwrite ) {
-            if( (rc = SRAMgrDropTable(self->config->sra_mgr, true, self->config->table_path)) == 0 ) {
-                goto retry;
-            }
-        }
-    }
-    if( rc != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to create table with schema $(schema)", PLOG_S(schema), schema));
-    } else {
-        DEBUG_MSG (7, ("Created table with schema '%s'\n", schema));
-    }
-    return rc;
-}
-
-rc_t SRAWriter_OpenColumnWrite(SRAWriter* self, uint32_t *idx, const char *name, const char *datatype)
-{
-    if( self == NULL ) {
-        return RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    }
-    return SRATableOpenColumnWrite(self->table, idx, NULL, name, datatype);
-}
-
-rc_t SRAWriter_NewSpot(SRAWriter* self, spotid_t *id)
-{
-    rc_t rc = 0;
-    spotid_t s;
-
-    if( self == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    } else {
-        id = id ? id : &s;
-        rc = SRATableNewSpot(self->table, id);
-        if(rc == 0 ) {
-            DEBUG_MSG(3, ("writing spot %lu data\n", *id));
-        }
-        if( (*id % 2000000) == 0 ) {
-            PLOGMSG(klogInt, (klogInfo, "spot $(spot_count)", "severity=status,spot_count=%u", *id));
-        }
-    }
-    return rc;
-}
-
-rc_t SRAWriter_WriteIdxColumn(SRAWriter* self, uint32_t idx, const void *base, uint64_t bytes, bool as_dflt)
-{
-    if( self == NULL ) {
-        return RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    }
-    if( as_dflt ) {
-        return SRATableSetIdxColumnDefault(self->table, idx, base, 0, bytes * 8);
-    }
-    return SRATableWriteIdxColumn(self->table, idx, base, 0, bytes * 8);
-}
-
-rc_t SRAWriter_CloseSpot(SRAWriter* self)
-{
-    rc_t rc = 0;
-    if( self == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    } else {
-        if( (rc = SRATableCloseSpot(self->table)) == 0 ) {
-            rc = Quitting();
-            if( self->spots_to_run > 0 ) {
-                self->spots_to_run--;
-            }
-            if( rc == 0 && self->spots_to_run == 0 ) {
-                rc = RC( rcSRA, rcFormatter, rcWriting, rcTransfer, rcDone);
-            }
-        }
-    }
-    return rc;
-}
-
-/* if data is NULL no default value is written, only column is open */
-static
-rc_t SRAWriter_WDflt(SRAWriter* self, const char *cname, const char *type, const void *data, size_t size)
-{
-    rc_t rc = 0;
-    uint32_t ci = 0;
-
-    if( (rc = SRATableOpenColumnWrite(self->table, &ci, 0, cname, type)) != 0 && GetRCState(rc) != rcExists ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to open column $(column)", PLOG_S(column), cname));
-    } else if( data != NULL && (rc = SRATableSetIdxColumnDefault(self->table, ci, data, 0, size * 8)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write default to column $(column)", PLOG_S(column), cname));
-    } else if( strcmp(cname, "SPOT_GROUP") == 0 ) {
-        self->col_spot_group_id = ci;
-    } else if( strcmp(cname, "READ_START") == 0 ) {
-        self->col_read_start_id = ci;
-    } else if( strcmp(cname, "READ_LEN") == 0 ) {
-        self->col_read_len_id = ci;
-    }
-    return rc;
-}
-
-rc_t SRAWriter_WriteDefaults(SRAWriter* self)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    const PlatformXML* plat;
-    char labels[10240] = "\0";
-    INSDC_SRA_xread_type read_types[SRAWRITER_MAX_READS];
-    INSDC_coord_zero label_start[SRAWRITER_MAX_READS];
-    INSDC_coord_len label_len[SRAWRITER_MAX_READS];
-    bool has_read_seg = false;
-    INSDC_coord_zero read_start[SRAWRITER_MAX_READS];
-    INSDC_coord_len read_len[SRAWRITER_MAX_READS];
-
-    if( self == NULL ) {
-        return RC( rcSRA, rcFormatter, rcWriting, rcSelf, rcNull);
-    }
-    if( self->defaults ) {
-        return 0;
-    }
-    ((SRAWriter*)self)->defaults = true;
-
-    if( (rc = Experiment_GetPlatform(self->config->experiment, &plat)) == 0 ) {
-        SRASegment read_segs[SRAWRITER_MAX_READS];
-        if( (rc = Experiment_ReadSegDefault(self->config->experiment, read_segs)) == 0 ) {
-            has_read_seg = true;
-            for (i = 0; i != self->nreads; ++i) {
-                read_start[i] = read_segs[i].start;
-                read_len[i] = read_segs[i].len;
-            }
-        } else if( GetRCObject(rc) == rcData && GetRCState(rc) == rcUnsupported ) {
-            rc = 0;
-        }
-    }
-    for(i = 0; rc == 0 && i < self->nreads; i++) {
-        const ReadSpecXML_read* rspec = NULL;
-        if( (rc = Experiment_GetRead(self->config->experiment, i, &rspec)) != 0 ) {
-            continue;
-        }
-        label_start[i] = strlen(labels);
-        label_len[i] = 0;
-        if( rspec->read_label != NULL ) {
-            label_len[i] = strlen(rspec->read_label);
-            strncat(labels, rspec->read_label, label_len[i]);
-        }
-        read_types[i] = rspec->read_class;
-    }
-
-    if( rc == 0 ) {
-        uint8_t platform = plat->id;
-#if _DEBUGGING
-        DEBUG_MSG (7, ("Default: %hu reads per spot, labels: '%s'\n", self->nreads, labels));
-        for( i = 0; i < self->nreads; i++) {
-            DEBUG_MSG (5, ("Default: Read %u. %s: Label: [%2u:%2u]",
-                           i + 1, ( read_types[i] & SRA_READ_TYPE_BIOLOGICAL ) ? " Bio" : "Tech",
-                           label_start[i], label_len[i]));
-            if( has_read_seg ) {
-                DEBUG_MSG (5, (" Seg: [%3u:%3u]", read_start[i], read_len[i]));
-            }
-            DEBUG_MSG (5, ("\n"));
-        }
-#endif
-        /* TBD: SPOT_GROUP on demand, remove NREADS!! */
-        if( (rc = SRAWriter_WDflt(self, "PLATFORM", sra_platform_id_t, &platform, sizeof(platform))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "NREADS", vdb_uint8_t, &self->nreads, sizeof(self->nreads))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "LABEL", vdb_ascii_t, labels, strlen(labels))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "LABEL_START", "INSDC:coord:zero", label_start, self->nreads * sizeof(label_start[0]))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "LABEL_LEN", vdb_uint32_t, label_len, self->nreads * sizeof(label_len[0]))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "READ_TYPE", sra_read_type_t, read_types, self->nreads * sizeof(read_types[0]))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "SPOT_GROUP", vdb_ascii_t, "", 0)) != 0 ||
-            (rc = SRAWriter_WDflt(self, "READ_START", "INSDC:coord:zero", has_read_seg ? read_start : NULL, self->nreads * sizeof(read_start[0]))) != 0 ||
-            (rc = SRAWriter_WDflt(self, "READ_LEN", vdb_uint32_t, has_read_seg ? read_len : NULL, self->nreads * sizeof(read_len[0]))) != 0 ) {
-            return rc;
-        }
-    }
-    return rc;
-}
-
-rc_t SRAWriter_WriteSpotSegment(SRAWriter* self, const SRALoaderFile* file,
-                                const char* file_member_name, uint32_t nbases, const char* bases)
-{
-    rc_t rc = 0;
-
-    if( self == NULL || file == NULL || bases == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcMultiplexing, rcParam, rcNull);
-    } else if ( self->col_spot_group_id == 0 || self->col_read_start_id == 0 || self->col_read_len_id == 0 ) {
-        rc = RC( rcSRA, rcFormatter, rcMultiplexing, rcSelf, rcCorrupt);
-    } else {
-        const char* data_block_member_name = NULL;
-        const char* assigned_member_name = NULL;
-
-        DEBUG_MSG (5, ("file spot member_name '%s'\n", file_member_name));
-        if( file_member_name != NULL &&
-            (strcasecmp(file_member_name, "default") == 0 || strcasecmp(file_member_name, "0") == 0) ) {
-            file_member_name = "";
-        }
-        rc = SRALoaderFileMemberName(file, &data_block_member_name);
-        DEBUG_MSG (5, ("data block member_name '%s'\n", data_block_member_name));
-
-        if( rc == 0 && (rc = Experiment_MemberSeg(self->config->experiment, file_member_name, data_block_member_name,
-                                                  nbases, bases, ((SRAWriter*)self)->read_segs, &assigned_member_name)) == 0 ) {
-            DEBUG_MSG (5, ("Assigned member '%s'\n", assigned_member_name));
-            if( assigned_member_name != NULL ) {
-                if( (rc = SRATableWriteIdxColumn(self->table, self->col_spot_group_id, assigned_member_name, 0, strlen(assigned_member_name) * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=SPOT_GROUP"));
-                }
-            }
-            if( rc == 0 ) {
-                int32_t read_start[SRAWRITER_MAX_READS];
-                uint32_t read_len[SRAWRITER_MAX_READS];
-                int i;
-
-                for (i = 0; i < self->nreads; i++) {
-                    read_start[i] = self->read_segs[i].start;
-                    read_len[i] = self->read_segs[i].len;
-                }
-
-                if( (rc = SRATableWriteIdxColumn(self->table, self->col_read_start_id, read_start, 0, sizeof(read_start[0]) * self->nreads * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_START"));
-                } else if( (rc = SRATableWriteIdxColumn(self->table, self->col_read_len_id, read_len, 0, sizeof(read_len[0]) * self->nreads * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_LEN"));
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t SRAWriter_WriteSpotSegmentSimple(SRAWriter* self, const SRALoaderFile* file, const char* file_member_name, const SRASegment* read_seg)
-{
-    rc_t rc = 0;
-
-    if( self == NULL || file == NULL ) {
-        rc = RC( rcSRA, rcFormatter, rcMultiplexing, rcParam, rcNull);
-    } else if ( self->col_spot_group_id == 0 || self->col_read_start_id == 0 || self->col_read_len_id == 0 ) {
-        rc = RC( rcSRA, rcFormatter, rcMultiplexing, rcSelf, rcCorrupt);
-    } else {
-        const char* data_block_member_name = NULL;
-        const char* assigned_member_name = NULL;
-
-        DEBUG_MSG (5, ("file spot member_name '%s'\n", file_member_name));
-        if( file_member_name != NULL &&
-            (strcasecmp(file_member_name, "default") == 0 || strcasecmp(file_member_name, "0") == 0) ) {
-            file_member_name = "";
-        }
-        rc = SRALoaderFileMemberName(file, &data_block_member_name);
-        DEBUG_MSG (5, ("data block member_name '%s'\n", data_block_member_name));
-
-        if( rc == 0 && (rc = Experiment_MemberSegSimple(self->config->experiment, file_member_name, data_block_member_name,
-                                                        &assigned_member_name)) == 0 ) {
-            DEBUG_MSG (5, ("Assigned member '%s'\n", assigned_member_name));
-            if( assigned_member_name != NULL ) {
-                if( (rc = SRATableWriteIdxColumn(self->table, self->col_spot_group_id, assigned_member_name, 0, strlen(assigned_member_name) * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=SPOT_GROUP"));
-                }
-            }
-            if( rc == 0 ) {
-                int32_t read_start[SRAWRITER_MAX_READS];
-                uint32_t read_len[SRAWRITER_MAX_READS];
-                int i;
-
-                for (i = 0; i < self->nreads; i++) {
-                    read_start[i] = read_seg[i].start;
-                    read_len[i] = read_seg[i].len;
-                }
-
-                if( (rc = SRATableWriteIdxColumn(self->table, self->col_read_start_id, read_start, 0, sizeof(read_start[0]) * self->nreads * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_START"));
-                } else if( (rc = SRATableWriteIdxColumn(self->table, self->col_read_len_id, read_len, 0, sizeof(read_len[0]) * self->nreads * 8 )) != 0 ) {
-                    PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_LEN"));
-                }
-            }
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-load/sra-writer.h b/tools/sra-load/sra-writer.h
deleted file mode 100644
index bae5bb2..0000000
--- a/tools/sra-load/sra-writer.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_sra_writer_
-#define _sra_load_sra_writer_
-
-#include <sra/sradb.h>
-
-typedef struct SRAWriter SRAWriter;
-
-/* Make SRAWriter from configuration
- */
-rc_t SRAWriter_Make( SRAWriter** self, const SRALoaderConfig* config);
-
-rc_t SRAWriter_CreateTable(SRAWriter* self, const char* schema);
-
-rc_t SRAWriter_OpenColumnWrite(SRAWriter* self, uint32_t *idx, const char *name, const char *datatype);
-
-#define COL_OPEN(colid, name, type) \
-    if( (rc = SRAWriter_OpenColumnWrite(self->base, &colid, name, type)) != 0 ) { \
-        if( GetRCState(rc) != rcExists ) { \
-            LOGERR(klogInt, rc, "failed to open column " name " of type " type); \
-            return rc; \
-        } \
-        rc = 0; \
-    }
-
-rc_t SRAWriter_NewSpot(SRAWriter* self, spotid_t *id);
-
-rc_t SRAWriter_WriteIdxColumn(SRAWriter* self, uint32_t idx, const void *base, uint64_t bytes, bool as_dflt);
-
-#define COL_WRITE(colid, name, pstring) \
-    if( colid != 0 ) { \
-        if( (rc = SRAWriter_WriteIdxColumn(cself->base, colid, pstring.data, pstring.len, false)) != 0 ) { \
-            LOGERR(klogInt, rc, "failed to write column " name); \
-            return rc; \
-        } \
-    }
-
-#define COL_WRITE_DEFAULT(colid, name, pstring) \
-    if( colid != 0 ) { \
-        if( (rc = SRAWriter_WriteIdxColumn(cself->base, colid, pstring.data, pstring.len, true)) != 0 ) { \
-            LOGERR(klogInt, rc, "failed to write default to column " name); \
-            return rc; \
-        } \
-    }
-
-rc_t SRAWriter_CloseSpot(SRAWriter* self);
-
-/* Writes default values ONLY ONCE to common SRATable columns
- * bases_per_spot [IN, OPTIONAL] - 0 ignored, otherwise used in default READ_SEG calculations
- */
-rc_t SRAWriter_WriteDefaults(SRAWriter* self);
-
-/* WriteSpotSegment
- *  Will determine SPOT_GROUP and READ_SEG values and write them to table to current spot
- *
- *  file [IN] - current file
- *  member_name [IN,NULL] - value extracted from a spotname if present
- *  bases [IN] - 2na FASTA string
- *  nbases [IN] - bases number (length)
- *  read_seg [OUT,OPTIONAL] - calculated READ_SEG values
- */
-rc_t SRAWriter_WriteSpotSegment(SRAWriter* self, const SRALoaderFile* file, const char* file_member_name, uint32_t nbases, const char* bases);
-
-rc_t SRAWriter_WriteSpotSegmentSimple(SRAWriter* self, const SRALoaderFile* file, const char* file_member_name, const SRASegment* read_seg);
-
-void SRAWriter_Whack(SRAWriter* self, SRATable** table);
-
-#endif /* _sra_load_sra_writer_ */
diff --git a/tools/sra-load/srf-absolid.c b/tools/sra-load/srf-absolid.c
deleted file mode 100644
index 6e6a67f..0000000
--- a/tools/sra-load/srf-absolid.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <kapp/main.h>
-
-typedef struct SRFAbsolidLoaderFmt SRFAbsolidLoaderFmt;
-
-#define SRALOADERFMT_IMPL SRFAbsolidLoaderFmt
-#include "loader-fmt.h"
-
-#include "srf.h"
-#include "ztr-absolid.h"
-#include "srf-fmt.h"
-#include "pstring.h"
-#include "writer-absolid.h"
-#include "srf-load.vers.h"
-#include "debug.h"
-
-#include <endian.h>
-#include <byteswap.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <assert.h>
-
-typedef struct fe_context_t_struct {
-    SRF_context ctx;
-    bool skip_signal;
-    const SRAWriteAbsolid* writer;
-
-    pstring name_prefix;
-    
-    struct {
-        uint8_t nreads;
-        uint16_t start[ABSOLID_FMT_MAX_NUM_READS];
-        pstring label[ABSOLID_FMT_MAX_NUM_READS];
-        char cs_key[ABSOLID_FMT_MAX_NUM_READS];
-        EAbisolidReadType type[ABSOLID_FMT_MAX_NUM_READS];
-    } region;
-} fe_context_t;
-
-static
-rc_t set_label_type(const char* label, pstring* name, EAbisolidReadType* type)
-{
-    rc_t rc = 0;
-
-    assert(name && type);
-
-    *type = AbsolidRead_Suffix2ReadType(label);
-
-    if( *type == eAbisolidReadType_Unknown ) {
-        DEBUG_MSG(3, ("read label is not recognized: '%s'\n", label));
-    } else {
-        const char* l = AbisolidReadType2ReadLabel[*type];
-        rc = pstring_assign(name, l, strlen(l));
-    }
-    return rc;
-}
-
-static
-rc_t fe_new_region(fe_context_t *self, size_t region_count, const region_t region[])
-{
-    rc_t rc = 0;
-    int i;
-
-    self->region.nreads = region_count / 2;
-    DEBUG_MSG(3, ("REGION: %u -> %u reads\n", region_count, self->region.nreads));
-    if( self->region.nreads <= 0 || self->region.nreads > ABSOLID_FMT_MAX_NUM_READS ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnsupported);
-        SRALoaderFile_LOG(self->ctx.file, klogErr, rc, "read count $(c)", PLOG_U8(c), self->region.nreads);
-    }
-    for(i = 0; rc == 0 && i < self->region.nreads; i++ ) {
-        int j = i * 2 + 1;
-        self->region.start[i] = region[j].start;
-        if( (rc = set_label_type(region[j].name, &self->region.label[i], &self->region.type[i])) != 0 ) {
-            break;
-        }
-        self->region.cs_key[i] = region[j - 1].name[0];
-        DEBUG_MSG(3, ("REGION[%u]: '%s', %u, '%c', start: %u\n",
-                      i, self->region.label[i].data, self->region.type[i], self->region.cs_key[i], self->region.start[i]));
-        switch(region[j].type) {
-            case Biological:
-            case Normal:
-            case Paired:
-            case Technical:
-                break;
-            default:
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                SRALoaderFile_LOG(self->ctx.file, klogErr, rc, "read #$(read_id) type mismatch; expected $(expected), got $(got)",
-                        "read_id=%u,expected=%s,got=%u", i, "(B|N|P|T)", region[j].type);
-                return rc;
-        }
-    }
-    if( rc == 0 &&
-        self->region.nreads > 1 && self->region.type[0] == self->region.type[1] ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcDuplicate);
-        SRALoaderFile_LOG(self->ctx.file, klogErr, rc, "both reads have same type", NULL);
-    }
-    return rc;
-}
-
-static
-rc_t parse_v1_header(SRF_context *ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size)
-{
-    rc_t rc = 0;
-    size_t parsed;
-    char prefixType;
-    uint32_t counter;
-    ztr_raw_t ztr_raw;
-    ztr_t ztr;
-    enum ztr_chunk_type type;
-    fe_context_t* fe = (fe_context_t*)ctx;
-    
-    if( (rc = SRF_ParseDataChunk(data, size, &parsed, &fe->name_prefix, &prefixType, &counter)) != 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "parse_v1_header - failed to parse SRF chunk", NULL);
-    }
-    DEBUG_MSG(3, ("HEADER PREFIX: '%s'\n", fe->name_prefix.data));
-    if((rc = ABI_ZTR_AddToBuffer(ztr_ctx, data + parsed, size - parsed)) != 0) {
-        return rc;
-    }
-    if((rc = ABI_ZTR_ParseHeader(ztr_ctx)) != 0) {
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "parse_v1_header - failed to parse ZTR header", NULL);
-    }
-    while(rc == 0 && !ABI_ZTR_BufferIsEmpty(ztr_ctx)) {
-        if((rc = ABI_ZTR_ParseBlock(ztr_ctx, &ztr_raw)) != 0) {
-            return SRALoaderFile_LOG(ctx->file, klogErr, rc, "parse_v1_header - failed to parse ZTR chunk", NULL);
-        }
-        if((rc = ABI_ZTR_ProcessBlock(ztr_ctx, &ztr_raw, &ztr, &type)) != 0) {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "parse_v1_header - failed to process ZTR chunk", NULL);
-        }
-        if(type == REGN) {
-            rc = fe_new_region(fe, ztr.region->count, ztr.region->region);
-        }
-        if(*(void **)&ztr != NULL) {
-            free(*(void **)&ztr);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t fe_new_read(fe_context_t *self, pstring *readId, EAbisolidReadType* type, pstring* label)
-{
-    rc_t rc = 0;
-    pstring name_suffix;
-    const char* p;
-
-    assert(self && readId && type && label);
-    DEBUG_MSG(3, ("READ_LABEL: '%s'\n", readId->data));
-    /* spot name suffix may end with '_(F|R).+' */
-    p = strrchr(readId->data, '_');
-    if( p != NULL ) {
-        rc = set_label_type(p + 1, label, type);
-        if( rc == 0 && *type > eAbisolidReadType_SPOT) {
-            /* cut label */
-            readId->len -= label->len + 1;
-        }
-    } else {
-        pstring_clear(label);
-        *type = eAbisolidReadType_SPOT;
-    }
-    if( rc == 0 && (rc = pstring_copy(&name_suffix, readId)) == 0 ) {
-        rc = SRAWriteAbsolid_MakeName(&self->name_prefix, &name_suffix, readId);
-    }
-    return rc;
-}
-
-static
-rc_t parse_v1_read(SRF_context *ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size)
-{
-    rc_t rc = 0;
-    size_t i, parsed;
-    ztr_raw_t ztr_raw;
-    ztr_t ztr;
-    enum ztr_chunk_type type;
-    fe_context_t* fe = (fe_context_t*)ctx;
-
-    uint8_t flags;
-    pstring readId;
-    EAbisolidReadType read_type;
-    pstring label;
-
-    AbsolidRead read[ABSOLID_FMT_MAX_NUM_READS];
-        
-    if( fe->region.nreads == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcNotFound);
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "missing region chunk before 1st read chunk", NULL);
-    }
-    if( (rc = SRF_ParseReadChunk(data, size, &parsed, &flags, &readId)) != 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rc);
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "SRF parsing failure", NULL);
-    }
-    ABI_ZTR_AddToBuffer(ztr_ctx, data + parsed, size - parsed);
-
-    /* readId will have spotname */
-    if( (rc = fe_new_read(fe, &readId, &read_type, &label)) != 0 ) {
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "parsing spot name suffix", NULL);
-    }
-    for(i = 0; i < sizeof(read) / sizeof(read[0]); i++) {
-        AbsolidRead_Init(&read[i]);
-    }
-    while(!ABI_ZTR_BufferIsEmpty(ztr_ctx)) {
-        if( (rc = ABI_ZTR_ParseBlock(ztr_ctx, &ztr_raw)) != 0 ||
-            (rc = ABI_ZTR_ProcessBlock(ztr_ctx, &ztr_raw, &ztr, &type)) != 0 ) {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "ZTR parsing failure", NULL);
-            break;
-        }
-        switch (type) {
-        case BASE:
-            if(ztr.sequence->datatype != i8) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "read: expected 8-bit datatype", NULL);
-            } else if( read_type > eAbisolidReadType_SPOT ) {
-                int read_number = AbisolidReadType2ReadNumber[read_type];
-                if( (rc = pstring_assign(&read[read_number].seq, ztr.sequence->data, ztr.sequence->datasize)) == 0 ) {
-                    /* grab 1st, may be the only cs_key */
-                    read[read_number].cs_key = fe->region.cs_key[0];
-                    for(i = 1; i < fe->region.nreads; i++) {
-                        if( read_type == fe->region.type[i] ) {
-                            read[read_number].cs_key = fe->region.cs_key[i];
-                            break;
-                        }
-                    }
-                    SRF_set_read_filter(&read[read_number].filter, flags);
-                    rc = pstring_copy(&read[read_number].label, &label);
-                    DEBUG_MSG(3, ("SRF READ: '%s'\n", read[read_number].seq.data));
-                }
-                if( rc != 0 ) {
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying read", NULL);
-                }
-            } else {
-                for(i = 0; rc == 0 && i < fe->region.nreads; i++) {
-                    int read_number = AbisolidReadType2ReadNumber[fe->region.type[i]];
-                    size_t len = (i + 1 >= fe->region.nreads ? ztr.sequence->datasize : fe->region.start[i + 1]) - fe->region.start[i];
-                    rc = pstring_assign(&read[read_number].seq, &ztr.sequence->data[fe->region.start[i]], len);
-                    read[read_number].cs_key = fe->region.cs_key[i];
-                    SRF_set_read_filter(&read[read_number].filter, flags);
-                    if( fe->region.label[i].len != 0 ) {
-                        rc = pstring_copy(&read[read_number].label, &fe->region.label[i]);
-                    }
-                    DEBUG_MSG(3, ("SRF READ[%u]: '%s'\n", i, read[read_number].seq.data));
-                }
-                if( rc != 0 ) {
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying reads", NULL);
-                }
-            }
-            break;
-        case CNF1:
-            if(ztr.quality1->datatype != i8) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "quality: expected 8-bit datatype", NULL);
-            } else if( read_type > eAbisolidReadType_SPOT ) {
-                int read_number = AbisolidReadType2ReadNumber[read_type];
-                if( (rc = pstring_assign(&read[read_number].qual, ztr.quality1->data, ztr.quality1->datasize)) == 0 ) {
-                    DEBUG_MSG(3, ("SRF QUAL: %u bytes\n", read[read_number].qual.len));
-                }
-                if( rc != 0 ) {
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying quality", NULL);
-                }
-            } else {
-                for(i = 0; rc == 0 && i < fe->region.nreads; i++) {
-                    int read_number = AbisolidReadType2ReadNumber[fe->region.type[i]];
-                    size_t len = (i + 1 >= fe->region.nreads ? ztr.quality1->datasize : fe->region.start[i + 1]) - fe->region.start[i];
-                    rc = pstring_assign(&read[read_number].qual, &ztr.quality1->data[fe->region.start[i]], len);
-                    DEBUG_MSG(3, ("SRF QUAL[%u]: %u bytes\n", i, read[read_number].qual.len));
-                }
-                if( rc != 0 ) {
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying qualities", NULL);
-                }
-            }
-            break;
-        case SAMP:
-            if( !fe->skip_signal ) {
-                size_t i;
-                int stype = ABSOLID_FMT_COLMASK_NOTSET;
-                if(ztr.signal->datatype != f32) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "signal: expected 32-bit float datatype", NULL);
-                } else if( (ztr.signal->datasize % sizeof(float)) != 0 ) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "signal: size not 32-bit float aligned", NULL);
-                } else if (ztr.signal->channel == NULL) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcIncomplete);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "SIGNAL column: missing channel type", NULL);
-                } else if(strcmp(ztr.signal->channel, "0FAM") == 0) {
-                    stype = ABSOLID_FMT_COLMASK_FAM;
-                } else if(strcmp(ztr.signal->channel, "1CY3") == 0) {
-                    stype = ABSOLID_FMT_COLMASK_CY3;
-                } else if(strcmp(ztr.signal->channel, "2TXR") == 0) {
-                    stype = ABSOLID_FMT_COLMASK_TXR;
-                } else if(strcmp(ztr.signal->channel, "3CY5") == 0) {
-                    stype = ABSOLID_FMT_COLMASK_CY5;
-                } else {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "SIGNAL column: unexpected channel type", NULL);
-                }
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-                for(i = 0; rc == 0 && i < ztr.signal->datasize; i += 4) {
-                    uint32_t* r = (uint32_t*)&ztr.signal->data[i];
-                    *r = bswap_32(*r);
-                }
-#endif
-                if( rc == 0 ) {
-                    if( read_type > eAbisolidReadType_SPOT ) {
-                        int read_number = AbisolidReadType2ReadNumber[read_type];
-                        pstring* d = NULL;
-                        switch(stype) {
-                            case ABSOLID_FMT_COLMASK_FAM:
-                                read[read_number].fs_type = eAbisolidFSignalType_FAM;
-                                d = &read[read_number].fxx;
-                                break;
-                            case ABSOLID_FMT_COLMASK_CY3:
-                                d = &read[read_number].cy3;
-                               break;
-                            case ABSOLID_FMT_COLMASK_TXR:
-                                d = &read[read_number].txr;
-                                break;
-                            case ABSOLID_FMT_COLMASK_CY5:
-                                d = &read[read_number].cy5;
-                                break;
-                        }
-                        if( d ) {
-                            rc = pstring_assign(d, ztr.signal->data, ztr.signal->datasize);
-                            DEBUG_MSG(3, ("SRF SIGNAL[%s]: %u bytes\n", ztr.signal->channel, d->len));
-                        } else {
-                            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnrecognized);
-                        }
-                        if( rc != 0 ) {
-                            SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying signal", NULL);
-                        }
-                    } else {
-                        for(i = 0; rc == 0 && i < fe->region.nreads; i++) {
-                            pstring* d = NULL;
-                            int read_number = AbisolidReadType2ReadNumber[fe->region.type[i]];
-                            size_t len = (i + 1 >= fe->region.nreads) ? ztr.signal->datasize : (fe->region.start[i + 1] * sizeof(float));
-                            len -= fe->region.start[i] * sizeof(float);
-                            switch(stype) {
-                                case ABSOLID_FMT_COLMASK_FAM:
-                                    read[read_number].fs_type = eAbisolidFSignalType_FAM;
-                                    d = &read[read_number].fxx;
-                                    break;
-                                case ABSOLID_FMT_COLMASK_CY3:
-                                    d = &read[read_number].cy3;
-                                   break;
-                                case ABSOLID_FMT_COLMASK_TXR:
-                                    d = &read[read_number].txr;
-                                    break;
-                                case ABSOLID_FMT_COLMASK_CY5:
-                                    d = &read[read_number].cy5;
-                                    break;
-                            }
-                            if( d ) {
-                                rc = pstring_assign(d, &ztr.signal->data[fe->region.start[i] * sizeof(float)], len);
-                                DEBUG_MSG(3, ("SRF SIGNAL[%s]: %u bytes\n", ztr.signal->channel, d->len));
-                            } else {
-                                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnrecognized);
-                            }
-                        }
-                        if( rc != 0 ) {
-                            SRALoaderFile_LOG(ctx->file, klogErr, rc, "copying signals", NULL);
-                        }
-                    }
-                }
-            }
-            break;
-        default:
-            break;
-        }
-        if(type != none && type != ignore) {
-            free(*(void **)&ztr);
-        }
-    }
-    if(rc == 0) {
-        if( read_type <= eAbisolidReadType_SPOT ) {
-            rc = SRAWriteAbsolid_Write(fe->writer, ctx->file, &readId, NULL, &read[0], &read[1]);
-        } else {
-            switch( AbisolidReadType2ReadNumber[read_type] ) {
-                case 0:
-                    rc = SRAWriteAbsolid_Write(fe->writer, ctx->file, &readId, NULL, &read[0], NULL);
-                    break;
-                case 1:
-                    rc = SRAWriteAbsolid_Write(fe->writer, ctx->file, &readId, NULL, NULL, &read[1]);
-                    break;
-                default:
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnsupported);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "more than 2 reads", NULL);
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-
-struct SRFAbsolidLoaderFmt {
-    SRALoaderFmt dad;
-    fe_context_t fe;
-};
-
-static
-rc_t SRFAbsolidLoaderFmt_WriteData(SRFAbsolidLoaderFmt *self, uint32_t argc, const SRALoaderFile *const argv [], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t i;
-    
-    for(i = 0; rc == 0 && i < argc; i++) {
-        self->fe.ctx.file = argv[i];
-        if( (rc = SRALoaderFileName(argv[i], &self->fe.ctx.file_name)) == 0 ) {
-            rc = SRF_parse(&self->fe.ctx, parse_v1_header, parse_v1_read, ABI_ZTR_CreateContext, ABI_ZTR_ContextRelease);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SRFAbsolidLoaderFmt_Whack(SRFAbsolidLoaderFmt* self, SRATable** table)
-{
-    SRAWriteAbsolid_Whack(self->fe.writer, table);
-    free(self);
-    return 0;
-}
-
-static
-rc_t SRFAbsolidLoaderFmt_Version( const SRFAbsolidLoaderFmt* self, uint32_t* vers, const char** name )
-{
-    *vers = SRF_LOAD_VERS;
-    *name = "AB SOLiD SRF";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 SRFAbsolidLoaderFmt_vt_v1 =
-{
-    1, 0,
-    SRFAbsolidLoaderFmt_Whack,
-    SRFAbsolidLoaderFmt_Version,
-    NULL,
-    SRFAbsolidLoaderFmt_WriteData
-};
-
-rc_t SRFABSolidLoaderFmt_Make(SRALoaderFmt** self, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRFAbsolidLoaderFmt* fmt;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&SRFAbsolidLoaderFmt_vt_v1)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    } else if( (rc = SRAWriteAbsolid_Make(&fmt->fe.writer, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize writer");
-    }
-    if( rc == 0 ) {
-        fmt->fe.skip_signal = (config->columnFilter & (efltrSIGNAL | efltrDEFAULT));
-        *self = &fmt->dad;
-    } else {
-        free(fmt);
-    }
-    return rc;
-}
diff --git a/tools/sra-load/srf-fmt.c b/tools/sra-load/srf-fmt.c
deleted file mode 100644
index 19252f3..0000000
--- a/tools/sra-load/srf-fmt.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#include "srf.h"
-#include "ztr.h"
-#include "srf-fmt.h"
-#include "srf-load.vers.h"
-#include "experiment-xml.h"
-#include "debug.h"
-
-
-const char UsageDefaultName[] = "srf-load";
-
-uint32_t KAppVersion(void)
-{
-    return SRF_LOAD_VERS;
-}
-
-extern rc_t SRFIlluminaLoaderFmt_Make(SRALoaderFmt **self, const SRALoaderConfig *config);
-
-extern rc_t SRFABSolidLoaderFmt_Make(SRALoaderFmt **self, const SRALoaderConfig *config);
-
-rc_t SRALoaderFmtMake(SRALoaderFmt **self, const SRALoaderConfig *config)
-{
-    rc_t rc = 0;
-    const PlatformXML* platform;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) == 0 ) {
-        switch(platform->id) {
-            case SRA_PLATFORM_ILLUMINA:
-                rc = SRFIlluminaLoaderFmt_Make(self, config);
-                break;
-            case SRA_PLATFORM_ABSOLID:
-                rc = SRFABSolidLoaderFmt_Make(self, config);
-                break;
-
-            default:
-                rc = RC(rcSRA, rcFormatter, rcConstructing, rcFormat, rcUnknown);
-        }
-    }
-    return rc;
-}
-
-/* BIGGER than internal SRALoaderFile buffer chunks handling
- * skips 'skipover' bytes in buffer and makes 'bsize' bytes available via 'data',
- * caller may want to skip 'skipover' returned back after 'data' is used
- * call with all params zero to deallocated internal buffer
- */
-static
-rc_t SRF_parse_prepdata(SRF_context* ctx, uint64_t bsize, const uint8_t** data, size_t* skipover)
-{
-    rc_t rc = 0;
-    static size_t big_buffer_sz = 0;
-    static uint8_t* big_buffer = NULL;
-
-    if( ctx == NULL && bsize == 0 && data == NULL && skipover == NULL ) {
-        free(big_buffer);
-        big_buffer = NULL;
-        big_buffer_sz = 0;
-        return 0;
-    }
-    assert(ctx != NULL), assert(data != NULL), assert(skipover != NULL);
-
-    /* prepare bsize bytes in buffer */
-    rc = SRALoaderFileRead(ctx->file, *skipover, bsize, (const void**)&ctx->file_buf, &ctx->file_buf_sz);
-    if( rc != 0 || ctx->file_buf == NULL || ctx->file_buf_sz == 0 || ctx->file_buf_sz > bsize ) {
-        if( GetRCObject(rc) != rcBuffer || GetRCState(rc) != rcInsufficient ) {
-            rc = rc ? rc : RC(rcSRA, rcFormatter, rcParsing, rcData, ctx->file_buf_sz > bsize ? rcExcessive : rcInsufficient);
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "expected $(expected) bytes chunk", PLOG_U64(expected), bsize);
-            return rc;
-        }
-        rc = 0;
-    }
-    if( ctx->file_buf_sz == bsize ) {
-        /* data fitted in file buffer, use it directly */
-        *data = ctx->file_buf;
-        *skipover = bsize;
-    } else {
-        size_t to_read = bsize, inbuf = 0;
-
-        DEBUG_MSG(3, ("file buffer overflow on chunk %lu bytes\n", bsize));
-        if( big_buffer_sz < bsize ) {
-            uint8_t* d = realloc(big_buffer, bsize);
-            DEBUG_MSG(3, ("grow internal chunk buffer to %lu bytes\n", bsize));
-            if (d == NULL) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "reading chunk of $(bytes) bytes", PLOG_U64(bytes), bsize);
-            } else {
-                big_buffer = d;
-                big_buffer_sz = bsize;
-            }
-        }
-        while( rc == 0 && to_read > 0 ) {
-            size_t x = to_read > ctx->file_buf_sz ? ctx->file_buf_sz : to_read;
-            memcpy(&big_buffer[inbuf], ctx->file_buf, x);
-            to_read -= x;
-            inbuf += x;
-            rc = SRALoaderFileRead(ctx->file, x, to_read, (const void**)&ctx->file_buf, &ctx->file_buf_sz);
-            if( rc != 0 || ((ctx->file_buf == NULL || ctx->file_buf_sz == 0) && to_read > 0) ) {
-                if( GetRCObject(rc) != rcBuffer || GetRCState(rc) != rcInsufficient ) {
-                    rc = rc ? rc : RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-                    SRALoaderFile_LOG(ctx->file, klogErr, rc, "expected $(expected) bytes of $(chunk) chunk",
-                                      PLOG_2(PLOG_U64(expected),PLOG_U64(chunk)), to_read, bsize);
-                    return rc;
-                }
-                rc = 0;
-            }
-        }
-        *data = big_buffer;
-        *skipover = 0;
-    }
-    return rc;
-}
-
-rc_t SRF_parse(SRF_context *ctx, SRF_parse_header_func* header, SRF_parse_read_func* read,
-               rc_t (*zcreate)(ZTR_Context **ctx), rc_t (*zrelease)(ZTR_Context *self))
-{
-    rc_t rc = 0;
-    bool first_block = true;
-    enum SRF_ChunkTypes type = SRF_ChunkTypeUnknown;
-    uint64_t bsize;
-    size_t dataOffset;
-    size_t skipover = 0;
-    ZTR_Context *ztr_ctx = NULL;
-    const char* errmsg;
-    
-    while( rc == 0 ) {
-        errmsg = NULL;
-        /* SRF_ParseChunk needs 5-16 bytes to be in buffer */
-        if( (rc = SRALoaderFileRead(ctx->file, skipover, 16, (const void**)&ctx->file_buf, &ctx->file_buf_sz)) != 0 ) {
-            errmsg = "chunk start";
-            break;
-        }
-        if( ctx->file_buf == NULL ) {
-            /* EOF */
-            break;
-        }
-        rc = SRF_ParseChunk(ctx->file_buf, ctx->file_buf_sz, &bsize, &type, &dataOffset);
-        if( rc == rcInvalid ) {
-            /* not a chunk; might be an index pointer, if so then skip it */
-            skipover = 8;
-            /* reset to start in case files were concatinated */
-            first_block = true;
-            rc = 0;
-            continue;
-        } else if( rc != 0 ) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rc);
-            errmsg = "chunk head";
-            break;
-        }
-        if( first_block && type != SRF_ChunkTypeContainer ) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt);
-            errmsg = "expected SRF container header";
-            break;
-        }
-        if( type == SRF_ChunkTypeIndex ) {
-            /* index is at least 16 bytes */
-            if( ctx->file_buf_sz < 16 ) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-                errmsg = "index chunk";
-                break;
-            }
-            /* rest of the chunk index ignored */
-            skipover = bsize;
-        } else if( type == SRF_ChunkTypeXML ) {
-            /* ignore XML chunk */
-            skipover = bsize;
-        } else {
-            const uint8_t* data;
-            bsize -= dataOffset;
-            skipover = dataOffset;
-            if( (rc = SRF_parse_prepdata(ctx, bsize, &data, &skipover)) == 0 ) {
-                switch (type) {
-                    case SRF_ChunkTypeContainer:
-                        {{
-                            unsigned versMajor = 0;
-                            unsigned versMinor = 0;
-                            char contType = '\0';
-                            if( (rc = SRF_ParseContainerHeader(data, bsize, &versMajor, &versMinor, &contType, NULL, NULL)) != 0 ) {
-                                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rc);
-                                errmsg = "container header";
-                            }
-                            if(versMajor != 1) {
-                                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcBadVersion);
-                            } else if(contType != 'Z') {
-                                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-                                errmsg = "container type";
-                            }
-                            SRALoaderFile_LOG(ctx->file, klogInfo, 0, "parsing SRF v$(vers)", "vers=%u.%u", versMajor, versMinor);
-                            first_block = false;
-                        }}
-                        break;
-
-                    case SRF_ChunkTypeHeader:
-                        if (ztr_ctx != NULL) {
-                            (*zrelease)(ztr_ctx);
-                            ztr_ctx = NULL;
-                        }
-                        if( (rc = (*zcreate)(&ztr_ctx)) == 0) {
-                            rc = (*header)(ctx, ztr_ctx, data, bsize);
-                        }
-                        break;
-
-                    case SRF_ChunkTypeRead:
-                        rc = (*read)(ctx, ztr_ctx, data, bsize);
-                        break;
-
-                    default:
-                        /* this is impossible */
-                        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-                        errmsg = "unexpected chunk type";
-                        break;
-                }
-            }
-        }
-    }
-    SRF_parse_prepdata(NULL, 0, NULL, NULL); /* free internal buffer */
-    (*zrelease)(ztr_ctx);
-    if( rc != 0 ) {
-        if( errmsg ) {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "$(msg) - chunk type '$(type)'",
-                             PLOG_2(PLOG_C(type),PLOG_S(msg)), type, errmsg);
-        } else {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "chunk type '$(type)'", PLOG_C(type), type);
-        }
-    }
-    return rc;
-}
-
-void SRF_set_read_filter(uint8_t* filter, int SRF_flags)
-{
-    assert(filter != NULL);
-
-    if( ( SRF_flags & SRF_READ_WITHDRAWN ) != 0 ) {
-        *filter = SRA_READ_FILTER_REJECT;
-    } else if( ( SRF_flags & SRF_READ_BAD ) != 0 ) {
-        *filter = SRA_READ_FILTER_CRITERIA;
-    } else {
-        *filter = SRA_READ_FILTER_PASS;
-    }
-}
diff --git a/tools/sra-load/srf-fmt.h b/tools/sra-load/srf-fmt.h
deleted file mode 100644
index f9ea3cf..0000000
--- a/tools/sra-load/srf-fmt.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_srf_fmt_
-#define _sra_load_srf_fmt_
-
-#include "loader-fmt.h"
-
-typedef struct SRF_context_struct {
-    const SRALoaderFile *file;
-    const char* file_name;
-    const uint8_t* file_buf;
-    size_t file_buf_sz;
-} SRF_context;
-
-typedef rc_t (SRF_parse_header_func)(SRF_context* ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size);
-typedef rc_t (SRF_parse_read_func)(SRF_context* ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size);
-
-rc_t SRF_parse(SRF_context* ctx, SRF_parse_header_func* header, SRF_parse_read_func* read,
-               rc_t (*create)(ZTR_Context **ctx), rc_t (*release)(ZTR_Context *self));
-
-void SRF_set_read_filter(uint8_t* filter, int SRF_flags);
-
-#endif /* _sra_load_srf_fmt_ */
diff --git a/tools/sra-load/srf-illumina.c b/tools/sra-load/srf-illumina.c
deleted file mode 100644
index 0294dc2..0000000
--- a/tools/sra-load/srf-illumina.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-typedef struct SRFIlluminaLoaderFmt SRFIlluminaLoaderFmt;
-
-#define SRALOADERFMT_IMPL SRFIlluminaLoaderFmt
-#include "loader-fmt.h"
-
-#include "srf.h"
-#include "ztr.h"
-#include "srf-fmt.h"
-#include "ztr-illumina.h"
-#include "srf-load.vers.h"
-#include "writer-illumina.h"
-#include "debug.h"
-
-typedef struct fe_context_t_struct {
-
-    SRF_context ctx;
-    bool skip_intensity;
-    bool skip_signal;
-    bool skip_noise;
-
-    const uint8_t *defered;
-    uint32_t defered_len;
-    
-    const SRAWriterIllumina* writer;
-
-    pstring name_prefix;
-
-    IlluminaRead read;
-
-    ztr_t sequence;
-    ztr_t quality1;
-    ztr_t quality4;
-    ztr_t signal;
-    ztr_t noise;
-    ztr_t intensity;
-} fe_context_t;
-
-static
-rc_t fe_new_read(fe_context_t *self, int flags, pstring *readId )
-{
-    rc_t rc;
-    char *suffix;
-    pstring readName, spotGroup;
-    static IlluminaSpot spot;
-
-    /* look for spot group */
-    suffix = strchr(readId->data, '#');
-    if( suffix != NULL ) {
-        readId->len = suffix++ - readId->data;
-        if( (rc = pstring_assign(&spotGroup, suffix, strlen(suffix))) != 0 ) {
-            SRALoaderFile_LOG(self->ctx.file, klogInt, rc,
-                "extracting barcode from spot '$(spotname)'", "spotname=%s", readId->data);
-            return rc;
-        }
-    } else {
-        pstring_clear(&spotGroup);
-    }
-
-    /* build the read name from prefix (self->name_prefix) and read id */
-    if(self->name_prefix.len > 0 ) {
-        if( (rc = pstring_copy(&readName, &self->name_prefix)) == 0 ) {
-            if( isdigit(readName.data[readName.len - 1]) ) {
-                rc = pstring_append(&readName, ":", 1);
-            }
-            if( rc == 0 ) {
-                rc = pstring_concat(&readName, readId);
-            }
-        }
-    } else {
-        rc = pstring_copy(&readName, readId);
-    }
-    if( rc != 0 ) {
-        SRALoaderFile_LOG(self->ctx.file, klogErr, rc,
-            "preparing spot name $(spotname)", "spotname=%s", readId->data);
-        return rc;
-    }
-    SRF_set_read_filter(&self->read.filter, flags);
-
-    IlluminaSpot_Init(&spot);
-    if( (rc = IlluminaSpot_Add(&spot, &readName, &spotGroup, &self->read)) == 0 ) {
-        rc = SRAWriterIllumina_Write(self->writer, self->ctx.file, &spot);
-    }
-    return rc;
-}
-
-static
-rc_t parse_header(SRF_context *ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size)
-{
-    rc_t rc = 0;
-    size_t parsed;
-    char prefixType;
-    uint32_t counter;
-    ztr_raw_t ztr_raw;
-    ztr_t ztr;
-    enum ztr_chunk_type type;
-    fe_context_t* fe = (fe_context_t*)ctx;
-    
-    rc = SRF_ParseDataChunk(data, size, &parsed, &fe->name_prefix, &prefixType, &counter);
-    if(rc) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-    }
-    if(fe->defered != NULL) {
-        free((void *)fe->defered);
-        fe->defered = NULL;
-    }
-    if(parsed == size)
-        return 0;
-    
-    rc = ZTR_AddToBuffer(ztr_ctx, data + parsed, size - parsed);
-    if(rc)
-        return rc;
-
-    if((rc = ZTR_ParseHeader(ztr_ctx)) != 0) {
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-    }
-
-    while (rc == 0 && !ZTR_BufferIsEmpty(ztr_ctx)) {
-        if((rc = ZTR_ParseBlock(ztr_ctx, &ztr_raw)) != 0) {
-            if(GetRCState(rc) == rcInsufficient && GetRCObject(rc) == rcData)
-                rc = ZTR_BufferGetRemainder(ztr_ctx, &fe->defered, &fe->defered_len);
-            break;
-        }
-
-        if((rc = ZTR_ProcessBlock(ztr_ctx, &ztr_raw, &ztr, &type)) != 0) {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-            break;
-        }
-        if(*(void **)&ztr != NULL)
-            free(*(void **)&ztr);
-
-        if(ztr_raw.meta != NULL)
-            free(ztr_raw.meta);
-        if(ztr_raw.data != NULL)
-            free(ztr_raw.data);
-    }
-    return rc;
-}
-
-static
-rc_t parse_read(SRF_context *ctx, ZTR_Context *ztr_ctx, const uint8_t *data, size_t size)
-{
-    rc_t rc = 0;
-    size_t parsed;
-    uint8_t flags;
-    pstring readId;
-    ztr_raw_t ztr_raw;
-    ztr_t ztr;
-    enum ztr_chunk_type type;
-    fe_context_t* fe = (fe_context_t*)ctx;
-
-    *(void **)&fe->sequence =
-    *(void **)&fe->quality1 =
-    *(void **)&fe->quality4 =
-    *(void **)&fe->signal =
-    *(void **)&fe->intensity = 
-    *(void **)&fe->noise = NULL;
-    
-    rc = SRF_ParseReadChunk(data, size, &parsed, &flags, &readId);
-    if(rc) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rc);
-        return SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-    }
-    if(fe->defered != NULL)
-        ZTR_AddToBuffer(ztr_ctx, fe->defered, fe->defered_len);
-    ZTR_AddToBuffer(ztr_ctx, data + parsed, size - parsed);
-    if(fe->defered == NULL) {
-        rc = ZTR_ParseBlock(ztr_ctx, &ztr_raw);
-        if(rc == 0)
-            goto PARSE_BLOCK;
-        rc = ZTR_ParseHeader(ztr_ctx);
-        if(rc) {
-            return SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-        }
-    }
-    
-    while (!ZTR_BufferIsEmpty(ztr_ctx)) {
-        rc = ZTR_ParseBlock(ztr_ctx, &ztr_raw);
-    PARSE_BLOCK:
-        if(rc != 0 || (rc = ZTR_ProcessBlock(ztr_ctx, &ztr_raw, &ztr, &type)) != 0 ) {
-            return SRALoaderFile_LOG(ctx->file, klogErr, rc, "corrupt", NULL);
-        }
-        
-        switch (type) {
-            case READ:
-                if(ztr.sequence->datatype != i8) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                    return SRALoaderFile_LOG(ctx->file, klogErr, rc, "invalid data type for sequence data", NULL);
-                }
-                fe->sequence = ztr;
-                break;
-            case QUALITY1:
-                if(ztr.quality1->datatype != i8) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                    return SRALoaderFile_LOG(ctx->file, klogErr, rc, "invalid data type for quality1 data", NULL);
-                }
-                fe->quality1 = ztr;
-                break;
-            case QUALITY4:
-                if(ztr.quality4->datatype != i8) {
-                    rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected);
-                    return SRALoaderFile_LOG(ctx->file, klogErr, rc, "invalid data type for quality4 data", NULL);
-                }
-                fe->quality4 = ztr;
-                break;
-            case SIGNAL4:
-                if(ztr.signal4->Type != NULL && strncmp(ztr.signal4->Type, "SLXI", 4) == 0 ) {
-                    if( !fe->skip_intensity ) {
-                        fe->intensity = ztr;
-                    } else if(ztr.signal4){
-			if(ztr.signal4->data) free(ztr.signal4->data);
-			free(ztr.signal4);
-		    }
-                } else if(ztr.signal4->Type != NULL && strncmp(ztr.signal4->Type, "SLXN", 4) == 0 ) {
-                    if( !fe->skip_noise ) {
-                        fe->noise = ztr;
-                    } else if(ztr.signal4){
-			if(ztr.signal4->data) free(ztr.signal4->data);
-			free(ztr.signal4);
-                    }
-                } else if( !fe->skip_signal ) {
-                    fe->signal = ztr;
-		} else if(ztr.signal4){
-			if(ztr.signal4->data) free(ztr.signal4->data);
-			free(ztr.signal4);
-                }
-                break;
-
-            default:
-                free(*(void **)&ztr);
-
-            case none:
-            case ignore:
-                if(ztr_raw.data) {
-                    free(ztr_raw.data);
-                }
-                break;
-        }
-	if(ztr_raw.meta){
-		free(ztr_raw.meta);
-		ztr_raw.meta=NULL;
-	}
-    }
-    
-    while(rc == 0) {
-        if(*(void **)&fe->sequence == NULL) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcConstraint, rcViolated);
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "missing sequence data", NULL);
-            break;
-        }
-        if(*(void **)&fe->quality4 == NULL && *(void **)&fe->quality1 == NULL) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcConstraint, rcViolated);
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "missing quality data", NULL);
-            break;
-        }
-
-        if( (rc = ILL_ZTR_Decompress(ztr_ctx, BASE, fe->sequence, fe->sequence)) != 0 ||
-            (rc = pstring_assign(&fe->read.seq, fe->sequence.sequence->data, fe->sequence.sequence->datasize)) != 0 ) {
-            SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress sequence data", NULL);
-            break;
-        }
-        
-        if( *(void **)&fe->quality4 != NULL ) {
-            if( (rc = ILL_ZTR_Decompress(ztr_ctx, CNF4, fe->quality4, fe->sequence)) != 0 ||
-                (rc = pstring_assign(&fe->read.qual, fe->quality4.quality4->data, fe->quality4.quality4->datasize)) != 0 ) {
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress quality4 data", NULL);
-                break;
-            }
-            fe->read.qual_type = ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4;
-        } else if( *(void **)&fe->quality1 != NULL ) {
-            if( (rc = ILL_ZTR_Decompress(ztr_ctx, CNF1, fe->quality1, fe->sequence)) != 0 ||
-                (rc = pstring_assign(&fe->read.qual, fe->quality1.quality1->data, fe->quality1.quality4->datasize)) != 0 ) {
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress quality1 data", NULL);
-                break;
-            }
-            fe->read.qual_type = ILLUMINAWRITER_COLMASK_QUALITY_PHRED;
-        }
-        if( *(void **)&fe->signal != NULL ) {
-            if( (rc = ILL_ZTR_Decompress(ztr_ctx, SMP4, fe->signal, fe->sequence)) != 0 ||
-                (rc = pstring_assign(&fe->read.signal, fe->signal.signal4->data, fe->signal.signal4->datasize)) != 0 ) {
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress signal data", NULL);
-                break;
-            }
-        }
-        if( *(void **)&fe->intensity != NULL ) {
-            if( (rc = ILL_ZTR_Decompress(ztr_ctx, SMP4, fe->intensity, fe->sequence)) != 0 ||
-                (rc = pstring_assign(&fe->read.intensity, fe->intensity.signal4->data, fe->intensity.signal4->datasize)) != 0 ) {
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress intensity data", NULL);
-                break;
-            }
-        }
-        if( *(void **)&fe->noise != NULL ) {
-            if( (rc = ILL_ZTR_Decompress(ztr_ctx, SMP4, fe->noise, fe->sequence)) != 0 ||
-                (rc = pstring_assign(&fe->read.noise, fe->noise.signal4->data, fe->noise.signal4->datasize)) != 0 ) {
-                SRALoaderFile_LOG(ctx->file, klogErr, rc, "failed to decompress noise data", NULL);
-                break;
-            }
-        }
-        rc = fe_new_read(fe, flags, &readId);
-        break;
-    }
-    if(fe->sequence.sequence) {
-        if(fe->sequence.sequence->data)
-            free(fe->sequence.sequence->data);
-        free(fe->sequence.sequence);
-    }
-    if(fe->quality1.quality1) {
-        if(fe->quality1.quality1->data)
-            free(fe->quality1.quality1->data);
-        free(fe->quality1.quality1);
-    }
-    if(fe->quality4.quality4) {
-        if(fe->quality4.quality4->data)
-            free(fe->quality4.quality4->data);
-        free(fe->quality4.quality4);
-    }
-    if(fe->signal.signal4) {
-        if(fe->signal.signal4->data)
-            free(fe->signal.signal4->data);
-        free(fe->signal.signal4);
-    }
-    if(fe->intensity.signal4) {
-        if(fe->intensity.signal4->data)
-            free(fe->intensity.signal4->data);
-        free(fe->intensity.signal4);
-    }
-    if(fe->noise.signal4) {
-        if(fe->noise.signal4->data)
-            free(fe->noise.signal4->data);
-        free(fe->noise.signal4);
-    }
-    return rc;
-}
-
-struct SRFIlluminaLoaderFmt {
-    SRALoaderFmt dad;
-    fe_context_t fe;
-};
-
-static
-rc_t SRFIlluminaLoaderFmt_WriteData(SRFIlluminaLoaderFmt *self, uint32_t argc, const SRALoaderFile *const argv [], int64_t* spots_bad_count)
-{
-    rc_t rc = 0;
-    uint32_t i;
-
-    for(i = 0; rc == 0 && i < argc; i++) {
-        self->fe.ctx.file = argv[i];
-        if( (rc = SRALoaderFileName(argv[i], &self->fe.ctx.file_name)) == 0 ) {
-            rc = SRF_parse(&self->fe.ctx, parse_header, parse_read, ZTR_CreateContext, ZTR_ContextRelease);
-        }
-    }
-    return rc;
-}
-
-static
-rc_t SRFIlluminaLoaderFmt_Whack(SRFIlluminaLoaderFmt *self, SRATable** table)
-{
-    SRAWriterIllumina_Whack(self->fe.writer, table);
-    free(self);
-    return 0;
-}
-
-static
-rc_t SRFIlluminaLoaderFmt_Version( const SRFIlluminaLoaderFmt *self, uint32_t *vers, const char** name )
-{
-    *vers = SRF_LOAD_VERS;
-    *name = "Illumina SRF";
-    return 0;
-}
-
-static SRALoaderFmt_vt_v1 SRFIlluminaLoaderFmt_vt_v1 =
-{
-    1, 0,
-    SRFIlluminaLoaderFmt_Whack,
-    SRFIlluminaLoaderFmt_Version,
-    NULL,
-    SRFIlluminaLoaderFmt_WriteData
-};
-
-rc_t SRFIlluminaLoaderFmt_Init(SRFIlluminaLoaderFmt* self, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-
-    self->fe.skip_signal = (config->columnFilter & (efltrSIGNAL | efltrDEFAULT));
-    self->fe.skip_noise = (config->columnFilter & (efltrNOISE | efltrDEFAULT));
-    self->fe.skip_intensity = (config->columnFilter & (efltrINTENSITY | efltrDEFAULT));
-
-    if( (rc = SRAWriterIllumina_Make(&self->fe.writer, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize writer");
-    }
-    return rc;
-}
-
-rc_t SRFIlluminaLoaderFmt_Make(SRALoaderFmt** self, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRFIlluminaLoaderFmt* fmt;
-
-    if( self == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    fmt = calloc(1, sizeof(*fmt));
-    if(fmt == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        LOGERR(klogInt, rc, "failed to initialize; out of memory");
-        return rc;
-    }
-    if( (rc = SRFIlluminaLoaderFmt_Init(fmt, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize");
-    } else if( (rc = SRALoaderFmtInit(&fmt->dad, (const SRALoaderFmt_vt*)&SRFIlluminaLoaderFmt_vt_v1)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize parent object");
-    }
-    if( rc == 0 ) {
-        *self = &fmt->dad;
-    } else {
-        free(fmt);
-    }
-    return rc;
-}
diff --git a/tools/sra-load/srf-load.vers b/tools/sra-load/srf-load.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-load/srf-load.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-load/srf.c b/tools/sra-load/srf.c
deleted file mode 100644
index 904cde6..0000000
--- a/tools/sra-load/srf.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#include <klib/rc.h>
-
-#include "debug.h"
-#include "srf.h"
-#include "ztr.h"
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <memory.h>
-#include <stdio.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-
-enum RCState SRF_ParseChunk(const uint8_t *src, size_t srclen, uint64_t *size, enum SRF_ChunkTypes *type, size_t *data)
-{
-    assert(size);
-    assert(type);
-    assert(data);
-    
-    *size = 0;
-    *type = SRF_ChunkTypeUnknown;
-    *data = 0;
-    
-    if(srclen == 0) {
-        return rcInsufficient;
-    }
-    *type = src[0];
-    switch(*type) {
-        case 'S':
-            if (srclen < 8) {
-                return rcInsufficient;
-            }
-            if (*(const uint32_t *)src != *(const uint32_t *)("SSRF")) {
-                return rcInvalid;
-            }
-            *size = (((((src[4] << 8) | src[5]) << 8) | src[6]) << 8) | src[7];
-            *data = 8;
-            break;
-        case 'I':
-            if(srclen >= 16) {
-                *size = (((((((((((((src[8] << 8) | src[9]) << 8) | src[10]) << 8) | src[11]) << 8) |
-                              src[12]) << 8) | src[13]) << 8) | src[14]) << 8) | src[15];
-            }
-            break;
-        case 'X':
-        case 'H':
-        case 'R':
-            if (srclen < 5) {
-                return rcInsufficient;
-            }
-            *size = (((((src[1] << 8) | src[2]) << 8) | src[3]) << 8) | src[4];
-            *data = 5;
-            break;
-        default:
-            return rcInvalid;
-    }
-    return 0;
-}
-
-int SRF_ParseContainerHeader(const uint8_t *src, uint64_t src_length,
-                             unsigned *versMajor, unsigned *versMinor,
-                             char *contType, pstring *baseCaller, pstring *baseCallerVersion)
-{
-    const uint8_t *vers = src + 1;
-    
-    src += *src + 1;
-    
-    if (versMajor != NULL) {
-        *versMajor = 0;
-        
-        while (vers != src && *vers != '.') {
-            if (*vers > '9' || *vers < '0')
-                return rcInvalid;
-            *versMajor = *versMajor * 10 + *vers - '0';
-            ++vers;
-        }
-        if (versMinor != NULL) {
-            *versMinor = 0;
-            
-            if (vers != src && *vers == '.')
-                ++vers;
-            while (vers != src) {
-                if (*vers > '9' || *vers < '0')
-                    return rcInvalid;
-                *versMinor = *versMinor * 10 + *vers - '0';
-                ++vers;
-            }
-        }
-    }
-    
-    if (contType != NULL)
-        *contType = *src;
-    ++src;
-    
-    if (baseCaller != NULL) {
-        if( pstring_assign(baseCaller, src, *src + 1) != 0 ) {
-            return rcInsufficient;
-        }
-    }
-    src += *src + 1;
-    
-    if (baseCallerVersion != NULL) {
-        if( pstring_assign(baseCallerVersion, src, *src + 1) != 0 ) {
-            return rcInsufficient;
-        }
-    }
-    return 0;
-}
-
-int SRF_ParseDataChunk(const uint8_t *src, size_t src_length, size_t *parsed_length, pstring *prefix,
-                       char *prefixType, uint32_t *counter)
-{
-    const uint8_t *const endp = src + src_length;
-    assert(src);
-    assert(parsed_length);
-    
-    if (counter != NULL)
-        *counter = 0;
-    if (prefix != NULL)
-        pstring_clear(prefix);
-    
-    if (src_length < 2)
-        return rcInsufficient;
-    
-    if (prefixType != NULL)
-        *prefixType = *src;
-    ++src;
-    if (*src == 0)
-        ++src;
-    else if (src + *src + 1 > endp)
-        return rcInsufficient;
-    else {
-        if (prefix != NULL) {
-            if( pstring_assign(prefix, src + 1, *src) != 0 ) {
-                return rcInsufficient;
-            }
-        }
-        src += *src + 1;
-    }
-#if 1
-    switch (endp - src) {
-        case 0:
-            break;
-        case 4:
-            if (counter != NULL)
-                *counter = (((((src[0] << 8) | src[1]) << 8) | src[2]) << 8) | src[3];
-            src += 4;
-            break;
-        default:
-            if (endp - src < 8)
-                return rcInsufficient;
-            if (memcmp(src, ZTR_SIG, 8) != 0) {
-                if (counter != NULL)
-                    *counter = (((((src[0] << 8) | src[1]) << 8) | src[2]) << 8) | src[3];
-                src += 4;
-            }
-            break;
-    }
-#else
-    if (!ZTR_IsSignature(src, endp - src)) {
-        if (src + 4 > endp)
-            return rcInsufficient;
-        if (counter != NULL)
-            *counter = (((((src[0] << 8) | src[1]) << 8) | src[2]) << 8) | src[3];
-        src += 4;
-    }
-#endif
-    *parsed_length = src_length - (endp - src);
-    return 0;
-}
-
-int SRF_ParseReadChunk(const uint8_t *src, size_t src_length, size_t *parsed_length, uint8_t *flags, pstring *id)
-{
-    const uint8_t* const endp = src + src_length;
-    
-    assert(src);
-    assert(parsed_length);
-    assert(flags);
-    assert(id);
-    
-    *flags = 0;
-    pstring_clear(id);
-
-    if(src_length < 2) {
-        return rcInsufficient;
-    }
-    *flags = *src++;
-    if(*src == '\0') {
-        ++src;
-    } else if(src + *src + 1 > endp) {
-        return rcInsufficient;
-    } else {
-        if( pstring_assign(id, src + 1, *src) != 0 ) {
-            return rcInsufficient;
-        }
-        src += *src + 1;
-    }
-    *parsed_length = src_length - (endp - src);
-    if( *flags != 0 ) {
-        DEBUG_MSG(5, ("SRF_FLAGS='%02X'\n", (int)(*flags)));
-    }
-    return 0;
-}
diff --git a/tools/sra-load/srf.h b/tools/sra-load/srf.h
deleted file mode 100644
index b918120..0000000
--- a/tools/sra-load/srf.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_srf_
-#define _sra_load_srf_
-
-#include "writer-illumina.h"
-
-#define SRF_READ_BAD (1U << 0)
-#define SRF_READ_WITHDRAWN (1U << 1)
-
-#define SRF_CONTAINER_HEADER_MIN_SIZE (8)
-#define SRF_BLOCK_HEADER_MIN_SIZE (5)
-
-enum SRF_ChunkTypes {
-    SRF_ChunkTypeUnknown = '?',
-    SRF_ChunkTypeContainer = 'S',
-    SRF_ChunkTypeIndex = 'I',
-    SRF_ChunkTypeHeader = 'H',
-    SRF_ChunkTypeRead = 'R',
-    SRF_ChunkTypeXML = 'X'
-};
-
-/* SRF_ParseChunk
-   try to parse an SRF chunk
-
-   returns:
-       0: no error
-       rcInsufficient: not enough src data to parse;
-           provide more data or declare an error
-       rcInvalid: the data is invalid
-
-   Parameters:
-       src [in, required]: the bytes to parse
-       srclen: the number of bytes parsable
-       size [out, required]: the total size of the chunk
-           the next chunk starts at src + size
-       type [out, required]: the type of chunk found
-       data [out, required]: the start of any inner data
-          in the chunk
-*/
-enum RCState SRF_ParseChunk(const uint8_t *src,
-		                    size_t srclen,
-		                    uint64_t *size,
-		                    enum SRF_ChunkTypes *type,
-		                    size_t *data);
-
-/* SRF_ParseContainerHeader
- try to parse an SRF Container Header
- 
- Returns:
-	0: no error
-        rcInsufficient: not enough data
-	rcInvalid: data invalid
-
- Parameters:
-	src [in, required]: the bytes to parse
-	src_length: the length of src
-	versMajor, versMinor [out, optional]: SRF version
-	contType [out, optional]: type of the data contained in
-		this SRF; *contType should be 'Z' per the spec.
-	baseCaller [out, optional]: the base caller program that
-		generated the contained data
-	baseCallerVersion [out, optional]: the version of
-		base caller program
- */
-int SRF_ParseContainerHeader(const uint8_t *src,
-                             uint64_t src_length,
-                             unsigned *versMajor,
-                             unsigned *versMinor,
-                             char *contType,
-                             pstring *baseCaller,
-                             pstring *baseCallerVersion);
-
-/* SRF_ParseDataChunk
- try to parse an SRF data chunk (i.e. block header type = 'H')
- 
- Returns:
-	0: no error
-        rcInsufficient: not enough data
-	rcInvalid: data invalid
- 
- Parameters:
-	src [in, required]: the bytes to parse
-	src_length: the length of src
-	parsed_length [out, required]: length of SRF data in
-		this chunk; the bytes src[parsed_length..src_length],
-		if any, are ZTR.
-	prefix [out, optional]: (pstring) read name prefix, if any
-	prefixType [out, optional]: read name prefix type 'E' or 'I'
-	counter [out, optional]: initial value of counter, only
-		relevant if prefixType == 'I'
- */
-int SRF_ParseDataChunk(const uint8_t *src,
-                       size_t src_length,
-                       size_t *parsed_length,
-                       pstring *prefix,
-                       char *prefixType,
-                       uint32_t *counter);
-
-/* SRF_ParseReadChunk
- try to parse an SRF read chunk (i.e. block header type = 'R')
- 
- Returns:
-	0: no error
-        rcInsufficient: not enough data
-	rcInvalid: data invalid
- 
- Parameters:
-	src [in, required]: the bytes to parse
-	src_length: the length of src
-	parsed_length [out, required]: length of SRF data in
-		this chunk; the bytes src[parsed_length..src_length],
-		if any, are ZTR.
-	flags [out, optional]: read flags
-	id [out, optional]: read Id
- */
-int SRF_ParseReadChunk(const uint8_t *src,
-		               size_t src_length,
-		               size_t *parsed_length,
-		               uint8_t *flags,
-		               pstring *id);
-
-#endif /* _sra_load_srf_ */
diff --git a/tools/sra-load/writer-454.c b/tools/sra-load/writer-454.c
deleted file mode 100644
index 0b1992c..0000000
--- a/tools/sra-load/writer-454.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <insdc/insdc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "writer-454.h"
-#include "sra-writer.h"
-
-struct SRAWriter454 {
-    SRAWriter* base;
-    pstring flows;
-    uint32_t flow_count;
-    pstring keys;
-
-    uint32_t ci_flowc;
-    uint32_t ci_keys;
-    uint32_t ci_name;
-    uint32_t ci_read;
-    uint32_t ci_qual;
-    uint32_t ci_signal;
-    uint32_t ci_position;
-    uint32_t ci_q_left;
-    uint32_t ci_q_right;
-    uint32_t ci_a_left;
-    uint32_t ci_a_right;
-};
-
-rc_t SRAWriter454_Make(const SRAWriter454** cself, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriter454* self;
-    const PlatformXML* platform;
-
-    if( cself == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ) {
-        return rc;
-    }
-    if( platform->id != SRA_PLATFORM_454 ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "platform type");
-        return rc;
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = SRAWriter_Make(&self->base, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize base writer");
-    } else {
-        if( platform->param.ls454.flow_sequence != NULL ) {
-            rc = pstring_assign(&self->flows, platform->param.ls454.flow_sequence,
-                                       strlen(platform->param.ls454.flow_sequence));
-        }
-        if( rc == 0 && platform->param.ls454.key_sequence != NULL ) {
-            rc = pstring_assign(&self->keys, platform->param.ls454.key_sequence,
-                                      strlen(platform->param.ls454.key_sequence));
-        }
-        self->flow_count = platform->param.ls454.flow_count;
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        SRAWriter454_Whack(self, NULL);
-    }
-    return rc;
-}
-
-void SRAWriter454_Whack(const SRAWriter454* cself, SRATable** table)
-{
-    if( cself != NULL ) {
-        SRAWriter454* self = (SRAWriter454*)cself;
-        SRAWriter_Whack(self->base, table);
-        free(self);
-    }
-}
-
-static
-rc_t SRAWriter454_Open(const SRAWriter454* cself, bool sig_and_pos)
-{
-    rc_t rc = 0;
-    SRAWriter454* self = (SRAWriter454*)cself;
-
-    if( cself->ci_name == 0 ) {
-        INSDC_coord_one d = 0;
-        pstring x;
-
-        if( (rc = SRAWriter_CreateTable(self->base, "NCBI:SRA:_454_:tbl:v2")) != 0 ) {
-            return rc;
-        }
-        if( (rc = SRAWriter_WriteDefaults(self->base)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to write table defaults");
-            return rc;
-        }
-        COL_OPEN(self->ci_name, "NAME", vdb_ascii_t);
-        COL_OPEN(self->ci_read, "READ", insdc_fasta_t);
-        COL_OPEN(self->ci_qual, "QUALITY", insdc_phred_t);
-        COL_OPEN(self->ci_q_left, "CLIP_QUALITY_LEFT", "INSDC:coord:one");
-        COL_OPEN(self->ci_q_right, "CLIP_QUALITY_RIGHT", "INSDC:coord:one");
-        COL_OPEN(self->ci_a_left, "CLIP_ADAPTER_LEFT", "INSDC:coord:one");
-        COL_OPEN(self->ci_a_right, "CLIP_ADAPTER_RIGHT", "INSDC:coord:one");
-        COL_OPEN(self->ci_flowc, "FLOW_CHARS", insdc_fasta_t);
-        COL_OPEN(self->ci_keys, "KEY_SEQUENCE", insdc_fasta_t);
-
-        COL_WRITE_DEFAULT(self->ci_flowc, "FLOW_CHARS", self->flows);
-        COL_WRITE_DEFAULT(self->ci_keys, "KEY_SEQUENCE", self->keys);
-        if( (rc = pstring_assign(&x, &d, sizeof(d))) == 0 ) {
-            COL_WRITE_DEFAULT(self->ci_q_left, "CLIP_QUALITY_LEFT", x);
-            COL_WRITE_DEFAULT(self->ci_q_right, "CLIP_QUALITY_RIGHT", x);
-            COL_WRITE_DEFAULT(self->ci_a_left, "CLIP_ADAPTER_LEFT", x);
-            COL_WRITE_DEFAULT(self->ci_a_right, "CLIP_ADAPTER_RIGHT", x);
-        }
-    }
-    if( sig_and_pos && (cself->ci_signal == 0 || cself->ci_position == 0) ) {
-        COL_OPEN(self->ci_signal, "SIGNAL", ncbi_isamp1_t);
-        COL_OPEN(self->ci_position, "POSITION", "INSDC:position:one");
-    }
-    return rc;
-}
-
-rc_t SRAWriter454_WriteHead(const SRAWriter454* cself, const pstring* flow_chars, const pstring* key_sequence)
-{
-    rc_t rc = 0;
-
-    if( (rc = SRAWriter454_Open(cself, false)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to create table");
-        return rc;
-    }
-    if( flow_chars && flow_chars->len != 0 ) {
-        if( cself->flows.len != 0 && pstring_cmp(&cself->flows, flow_chars) != 0 ) {
-            PLOGMSG(klogWarn, (klogWarn, "file FLOW_SEQUENCE do not match experiment: $(s)", PLOG_S(s), flow_chars->data));
-        }
-        /* update flow_count so signal data length will match below */
-        ((SRAWriter454*)cself)->flow_count = flow_chars->len;
-        COL_WRITE_DEFAULT(cself->ci_flowc, "FLOW_CHARS", (*flow_chars));
-    }
-    if( key_sequence && key_sequence->len != 0 ) {
-        if( cself->keys.len != 0 && pstring_cmp(&cself->keys, key_sequence) != 0 ) {
-            PLOGMSG(klogWarn, (klogWarn, "file KEY_SEQUENCE do not match experiment: $(s)", PLOG_S(s), key_sequence->data));
-        }
-        COL_WRITE_DEFAULT(cself->ci_keys, "KEY_SEQUENCE", (*key_sequence));
-    }
-    return 0;
-}
-
-rc_t SRAWriter454_WriteRead(const SRAWriter454* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality,
-                            const pstring* signal, const pstring* position,
-                            INSDC_coord_one q_left, INSDC_coord_one q_right,
-                            INSDC_coord_one a_left, INSDC_coord_one a_right)
-{
-    rc_t rc = 0;
-    SRAWriter454* self =(SRAWriter454*)cself;
-    
-    assert(self != NULL);
-    assert(data_block_ref != NULL);
-
-    DEBUG_MSG(3, ("spot name '%s'\n", name ? name->data : NULL));
-
-    if( (rc = SRAWriter454_Open(cself, signal || position)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to open table");
-        return rc;
-    }
-    if( !name || name->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "spot name");
-    }
-    if( !sequence || sequence->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "sequence");
-    } else if( !quality || sequence->len != quality->len ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, quality ? rcInconsistent : rcEmpty);
-        LOGERR(klogErr, rc, "quality");
-    }
-    if( signal && signal->len / self->flow_count != sizeof(uint16_t) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "signal and flow chars");
-    }
-    if( position && position->len / sequence->len != sizeof(INSDC_position_one) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "sequence and position");
-    }
-    if( q_left < 0 || (sequence && q_left > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip quality left and sequence");
-    }
-    if( q_right < 0 || (sequence && q_right > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip quality right and sequence");
-    }
-    if( a_left < 0 || (sequence && a_left > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip adapter left and sequence");
-    }
-    if( a_right < 0 || (sequence && a_right > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip adapter right and sequence");
-    }
-    if( rc != 0 || (rc = SRAWriter_NewSpot(self->base, NULL)) != 0 ) {
-        return rc;
-    }
-    COL_WRITE(self->ci_name, "NAME", (*name));
-    COL_WRITE(self->ci_read, "READ", (*sequence));
-    COL_WRITE(self->ci_qual, "QUALITY", (*quality));
-    COL_WRITE(self->ci_signal, "SIGNAL", (*signal));
-    COL_WRITE(self->ci_position, "POSITION", (*position));
-
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_q_left, &q_left, sizeof(q_left), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_QUALITY_LEFT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_q_right, &q_right, sizeof(q_right), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_QUALITY_RIGHT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_a_left, &a_left, sizeof(a_left), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_ADAPTER_LEFT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_a_right, &a_right, sizeof(a_right), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_ADAPTER_RIGHT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteSpotSegment(self->base, data_block_ref, NULL, sequence->len, sequence->data)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-        return rc;
-    }
-    return SRAWriter_CloseSpot(self->base);
-}
diff --git a/tools/sra-load/writer-454.h b/tools/sra-load/writer-454.h
deleted file mode 100644
index 5bca626..0000000
--- a/tools/sra-load/writer-454.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_writer_454_
-#define _sra_load_writer_454_
-
-#include "loader-fmt.h"
-#include "pstring.h"
-
-typedef struct SRAWriter454 SRAWriter454;
-
-rc_t SRAWriter454_Make(const SRAWriter454** cself, const SRALoaderConfig* config);
-
-void SRAWriter454_Whack(const SRAWriter454* cself, SRATable** table);
-
-rc_t SRAWriter454_WriteHead(const SRAWriter454* cself, const pstring* flow_chars, const pstring* key_sequence);
-
-rc_t SRAWriter454_WriteRead(const SRAWriter454* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality,
-                            const pstring* signal, const pstring* position,
-                            INSDC_coord_one q_left, INSDC_coord_one q_right,
-                            INSDC_coord_one a_left, INSDC_coord_one a_right);
-
-#endif /* _sra_load_writer_454_ */
diff --git a/tools/sra-load/writer-absolid.c b/tools/sra-load/writer-absolid.c
deleted file mode 100644
index faaaec4..0000000
--- a/tools/sra-load/writer-absolid.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/wsradb.h>
-#include <sra/types.h>
-
-#include "debug.h"
-#include "writer-absolid.h"
-#include "sra-writer.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-const int AbisolidReadType2ReadNumber [] = {0, 0, 0, 1, 1, 1, 1, 1, 1};
-const char *AbisolidReadType2ReadLabel [] = {"", "", "F3", "R3", "F5-P2", "F5-BC", "F5-RNA", "F5-DNA", "F3-DNA"};
-
-void AbsolidRead_Init(AbsolidRead* read)
-{
-    if( read ) {
-        pstring_clear(&read->label);
-        read->cs_key = 0;
-        pstring_clear(&read->seq);
-        pstring_clear(&read->qual);
-        read->fs_type = eAbisolidFSignalType_NotSet;
-        pstring_clear(&read->fxx);
-        pstring_clear(&read->cy3);
-        pstring_clear(&read->txr);
-        pstring_clear(&read->cy5);
-        read->filter = 0;
-    }
-}
-
-EAbisolidReadType AbsolidRead_Suffix2ReadType(const char* s)
-{
-    EAbisolidReadType type;
-    size_t len;
-
-    assert(s != NULL);
-
-    len = strlen(s);
-    if( len == 0 ) {
-        type = eAbisolidReadType_SPOT;
-    } else if( len > 1 && strcmp(&s[len - 2], "F3") == 0 ) {
-        type = eAbisolidReadType_F3;
-    } else if( len > 1 && strcmp(&s[len - 2], "R3") == 0 ) {
-        type = eAbisolidReadType_R3;
-    } else if( len > 4 && strcmp(&s[len - 5], "F5-P2") == 0 ) {
-        type = eAbisolidReadType_F5_P2;
-    } else if( len > 4 && strcmp(&s[len - 5], "F5-BC") == 0 ) {
-        type = eAbisolidReadType_F5_BC;
-    } else if( len > 5 && strcmp(&s[len - 6], "F5-RNA") == 0 ) {
-        type = eAbisolidReadType_F5_RNA;
-    } else if( len > 5 && strcmp(&s[len - 6], "F5-DNA") == 0 ) {
-        type = eAbisolidReadType_F5_DNA;
-    } else if( len > 5 && strcmp(&s[len - 6], "F3-DNA") == 0 ) {
-        type = eAbisolidReadType_F3_DNA;
-    } else {
-        int i;
-        for(i = 0; i < len; i++) {
-            if( !isdigit(s[i]) ) {
-                break;
-            }
-        }
-        type = i < len ? eAbisolidReadType_Unknown : eAbisolidReadType_SPOT;
-    }
-    return type;
-}
-
-struct SRAWriteAbsolid {
-    SRAWriter* base;
-    const PlatformXML* platform;
-    uint8_t nreads;
-    SRASegment read_seg[ABSOLID_FMT_MAX_NUM_READS];
-
-    uint32_t ci_name;
-    uint32_t ci_cs_key;
-    uint32_t ci_label;
-    uint32_t ci_label_start;
-    uint32_t ci_label_len;
-    uint32_t ci_csread;
-    uint32_t ci_qual;
-    uint32_t ci_fxx;
-    uint32_t ci_cy3;
-    uint32_t ci_txr;
-    uint32_t ci_cy5;
-    uint32_t ci_read_filter;
-};
-
-rc_t SRAWriteAbsolid_Make(const SRAWriteAbsolid** cself, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriteAbsolid* self;
-    const PlatformXML* platform;
-    const ReadSpecXML_read* read;
-    uint32_t sequence_length;
-    uint8_t nreads;
-
-    if( cself == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ||
-        (rc = Experiment_GetSpotLength(config->experiment, &sequence_length)) != 0 ||
-        (rc = Experiment_GetReadNumber(config->experiment, &nreads)) != 0 ) {
-        return rc;
-    }
-    if( platform->id != SRA_PLATFORM_ABSOLID ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "platform type");
-        return rc;
-    }
-    if( nreads > ABSOLID_FMT_MAX_NUM_READS ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-        PLOGERR(klogErr, (klogErr, rc, "expected up to $(max) reads", "max=%u", ABSOLID_FMT_MAX_NUM_READS));
-        return rc;
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        return rc;
-    }
-    if( (rc = SRAWriter_Make(&self->base, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize base writer");
-    } else if( (rc = Experiment_GetRead(config->experiment, 0, &read)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to get read 1 descriptor");
-    } else if( read->coord_type != rdsp_RelativeOrder_ct && read->coord_type != rdsp_BaseCoord_ct ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "1st read can be BASE_COORD or RELATIVE_ORDER only");
-    } else if( read->read_type != rdsp_Forward_rt && read->read_type != rdsp_Reverse_rt ) {
-        LOGMSG(klogWarn, "expected 1st read to be of type 'Forward' or 'Reverse'");
-    }
-    self->read_seg[0].start = 0;
-    self->read_seg[0].len = sequence_length;
-
-    if( rc == 0 && nreads >= ABSOLID_FMT_MAX_NUM_READS ) {
-        if( nreads > ABSOLID_FMT_MAX_NUM_READS ) {
-            rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-            LOGERR(klogErr, rc, "more than 2 reads");
-        } else if( (rc = Experiment_GetRead(config->experiment, 1, &read)) != 0 ) {
-            LOGERR(klogErr, rc, "failed to get read 2 descriptor");
-        } else if( read->coord_type != rdsp_BaseCoord_ct ) {
-            rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-            LOGERR(klogErr, rc, "2nd read can be BASE_COORD only");
-        } else if( read->read_type != rdsp_Forward_rt && read->read_type != rdsp_Reverse_rt ) {
-            LOGMSG(klogWarn, "expected 2ndt read to be of type 'Forward' or 'Reverse'");
-        }
-		if( rc == 0 ) {
-			self->read_seg[1].start = read->coord.start_coord - 1;
-			self->read_seg[1].len = sequence_length - self->read_seg[1].start;
-			self->read_seg[0].len = self->read_seg[1].start;
-		}
-    }
-#if _DEBUGGING
-    DEBUG_MSG(3, ("%s READ_SEG[%hu,%hu]\n", __func__, self->read_seg[0].start, self->read_seg[0].len));
-    if( nreads > 1 ) {
-        DEBUG_MSG(3, ("%s READ_SEG[%hu,%hu]\n", __func__, self->read_seg[1].start, self->read_seg[1].len));
-    }
-#endif
-    if( rc == 0 ) {
-        self->platform = platform;
-        self->nreads = nreads;
-        *cself = self;
-    } else {
-        SRAWriteAbsolid_Whack(self, NULL);
-    }
-    return rc;
-}
-
-rc_t SRAWriteAbsolid_MakeName(const pstring* prefix, const pstring* suffix, pstring* name)
-{
-    rc_t rc = 0;
-    if( prefix == NULL || name == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcParam, rcNull);
-    } else if( (rc = pstring_copy(name, prefix)) == 0 ) {
-        if( suffix && suffix->len > 0 ) {
-            if( name->len > 0 && name->data[name->len - 1] != '_' && suffix->data[0] != '_' ) {
-                rc = pstring_append(name, "_", 1);
-            }
-            if( rc == 0 ) {
-                pstring_concat(name, suffix);
-            }
-        }
-    }
-    if( rc != 0 ) {
-        LOGERR(klogErr, rc, "preparing spot name");
-    }
-    return rc;
-}
-
-void SRAWriteAbsolid_Whack(const SRAWriteAbsolid* cself, SRATable** table)
-{
-    if( cself != NULL ) {
-        SRAWriteAbsolid* self = (SRAWriteAbsolid*)cself;
-        SRAWriter_Whack(self->base, table);
-        free(self);
-    }
-}
-
-typedef struct AbsolidSpot_struct {
-    const pstring* spot_name;
-    uint32_t nreads;
-    pstring label;
-    SRASegment read_seg[ABSOLID_FMT_MAX_NUM_READS];
-    INSDC_coord_zero label_start[ABSOLID_FMT_MAX_NUM_READS];
-    uint32_t label_len[ABSOLID_FMT_MAX_NUM_READS];
-    char cs_key[ABSOLID_FMT_MAX_NUM_READS];
-    pstring seq;
-    pstring qual;
-    EAbisolidFSignalType fs_type;
-    pstring fxx;
-    pstring cy3;
-    pstring txr;
-    pstring cy5;
-    uint8_t filter[ABSOLID_FMT_MAX_NUM_READS];
-} AbsolidSpot;
-
-static
-void AbsolidSpot_Init(AbsolidSpot* spot, const pstring* spot_name,
-                      const uint16_t nreads, const SRASegment* read_seg)
-{
-    assert(spot != NULL);
-    assert(spot_name != NULL);
-    assert(nreads != 0);
-
-    spot->spot_name = spot_name;
-    pstring_clear(&spot->label);
-    memcpy(spot->read_seg, read_seg, sizeof(spot->read_seg[0]) * nreads);
-    memset(spot->label_start, 0, sizeof(spot->label_start[0]) * nreads);
-    memset(spot->label_len, 0, sizeof(spot->label_len[0]) * nreads);
-    memset(spot->cs_key, 0, sizeof(spot->cs_key[0]) * nreads);
-    pstring_clear(&spot->seq);
-    pstring_clear(&spot->qual);
-    spot->fs_type = eAbisolidFSignalType_NotSet;
-    pstring_clear(&spot->fxx);
-    pstring_clear(&spot->cy3);
-    pstring_clear(&spot->txr);
-    pstring_clear(&spot->cy5);
-    memset(spot->filter, 0, sizeof(spot->filter[0]) * nreads);
-}
-
-static
-rc_t  AbsolidSpot_AddRead(AbsolidSpot* spot, const int id, const AbsolidRead* read)
-{
-    rc_t rc = 0;
-    const char* what = NULL;
-
-    if( read == NULL ) {
-        if( id == 0 ) {
-            spot->read_seg[id].start = 0;
-            spot->label_start[id] = 0;
-        } else {
-            spot->read_seg[id].start = spot->read_seg[id - 1].start + spot->read_seg[id - 1].len;
-            spot->label_start[id] = spot->label_start[id - 1] + spot->label_len[id - 1];
-        }
-        spot->read_seg[id].len = 0;
-        spot->label_len[id] = 0;
-        spot->cs_key[id] = (id % 2) ? 'G' : 'T';
-        spot->filter[id] = SRA_READ_FILTER_REJECT;
-    } else {
-        if( read->seq.len != spot->read_seg[id].len ) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-            what = "length do not match experiment";
-        } else if( read->qual.len != read->seq.len ) {
-            rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-            what = "quality length";
-        } else if( spot->fs_type != eAbisolidFSignalType_NotSet && spot->fs_type != read->fs_type ) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInconsistent);
-            what = "signal structure";
-        } else if( read->fs_type != eAbisolidFSignalType_NotSet ) {
-            if( read->fxx.len / read->seq.len != sizeof(float) ) {
-                rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-                what = read->fs_type == eAbisolidFSignalType_FTC ? "signal FTC length" : "signal FAM length";
-            } else if( read->cy3.len / read->seq.len != sizeof(float) ) {
-                rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-                what = "signal CY3 length";
-            } else if( read->txr.len / read->seq.len != sizeof(float) ) {
-                rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-                what = "signal TXR length";
-            } else if( read->cy5.len / read->seq.len != sizeof(float) ) {
-                rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-                what = "signal CY5 length";
-            }
-        }
-        if( rc == 0 ) {
-            if( (rc = pstring_concat(&spot->seq, &read->seq)) == 0 &&
-                (rc = pstring_concat(&spot->qual, &read->qual)) == 0 &&
-                (rc = pstring_concat(&spot->label, &read->label)) == 0 ) {
-                if( id == 0 ) {
-                    spot->read_seg[id].start = 0;
-                    spot->label_start[id] = 0;
-                } else {
-                    spot->read_seg[id].start = spot->read_seg[id - 1].start + spot->read_seg[id - 1].len;
-                    spot->label_start[id] = spot->label_start[id - 1] + spot->label_len[id - 1];
-                }
-                spot->label_len[id] = read->label.len;
-                spot->cs_key[id] = read->cs_key;
-                spot->filter[id] = read->filter;
-                if( read->fs_type != eAbisolidFSignalType_NotSet &&
-                    (rc = pstring_concat(&spot->fxx, &read->fxx)) == 0 &&
-                    (rc = pstring_concat(&spot->cy3, &read->cy3)) == 0 &&
-                    (rc = pstring_concat(&spot->txr, &read->txr)) == 0 &&
-                    (rc = pstring_concat(&spot->cy5, &read->cy5)) == 0 &&
-                    id == 0 ) {
-                    spot->fs_type = read->fs_type;
-                }
-            }
-        }
-    }
-    if( rc != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "read '$(label)' $(problem) in spot '$(spot_name)'",
-                "label=%.*s,problem=%s,spot_name=%s", read->label.len, read->label.data, what, spot->spot_name->data));
-    }
-    return rc;
-}
-
-rc_t SRAWriteAbsolid_Write(const SRAWriteAbsolid* cself, const SRALoaderFile* file, 
-                           const pstring* spot_name, const pstring* spot_group,
-                           const AbsolidRead* f3, const AbsolidRead* r3)
-{
-    rc_t rc = 0;
-    uint32_t nreads = ((f3 ? 1 : 0) + (r3 ? 1 : 0));
-    AbsolidSpot spot;
-
-    assert(cself != NULL);
-    assert(sizeof(cself->read_seg) == sizeof(spot.read_seg));
-    assert(file != NULL);
-    assert(spot_name);
-
-    DEBUG_MSG(3, ("spot name '%s', group '%s'\n", spot_name->data, spot_group ? spot_group->data : NULL));
-
-    if( nreads == 0 || nreads > cself->nreads ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcExcessive);
-        PLOGERR(klogErr, (klogErr, rc, "read count do not match experiment in spot $(spot): $(c)",
-                "spot=%s,c=%u", spot_name->data, nreads));
-        return rc;
-    }
-
-    AbsolidSpot_Init(&spot, spot_name, cself->nreads, cself->read_seg);
-    if( cself->nreads == 1 ) {
-        rc = AbsolidSpot_AddRead(&spot, 0, f3 ? f3 : r3);
-    } else if( cself->nreads == 2 ) {
-        rc = AbsolidSpot_AddRead(&spot, 0, f3);
-        rc = rc ? rc : AbsolidSpot_AddRead(&spot, 1, r3);
-    } else {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcFunction, rcCorrupt);
-        PLOGERR(klogInt, (klogInt, rc, "cannot handle reads: $(n) > 2!!!", "n=%hu", cself->nreads));
-        return rc;
-    }
-    if( rc == 0 && cself->ci_name == 0 ) {
-        SRAWriteAbsolid* self =(SRAWriteAbsolid*)cself;
-        if( (rc = SRAWriter_CreateTable(cself->base, "NCBI:SRA:ABI:tbl:v2")) != 0 ) {
-            return rc;
-        }
-        if( (rc = SRAWriter_WriteDefaults(cself->base)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to write table defaults");
-            return rc;
-        }
-        COL_OPEN(self->ci_name, "NAME", vdb_ascii_t);
-        COL_OPEN(self->ci_cs_key, "CS_KEY", insdc_fasta_t);
-        COL_OPEN(self->ci_csread, "CSREAD", insdc_csfasta_t);
-        COL_OPEN(self->ci_qual, "QUALITY", insdc_phred_t);
-        COL_OPEN(self->ci_read_filter, "READ_FILTER", sra_read_filter_t);
-
-        if( spot.label.len != 0 ) {
-            COL_OPEN(self->ci_label, "LABEL", vdb_ascii_t);
-            COL_OPEN(self->ci_label_start, "LABEL_START", "INSDC:coord:zero");
-            COL_OPEN(self->ci_label_len, "LABEL_LEN", "U32");
-        }
-        if( spot.fs_type != eAbisolidFSignalType_NotSet ) {
-            if( spot.fs_type == eAbisolidFSignalType_FTC ) {
-                COL_OPEN(self->ci_fxx, "FTC", ncbi_fsamp1_t);
-            } else {
-                COL_OPEN(self->ci_fxx, "FAM", ncbi_fsamp1_t);
-            }
-            COL_OPEN(self->ci_cy3, "CY3", ncbi_fsamp1_t);
-            COL_OPEN(self->ci_txr, "TXR", ncbi_fsamp1_t);
-            COL_OPEN(self->ci_cy5, "CY5", ncbi_fsamp1_t);
-        }
-    }
-    if( rc != 0 || (rc = SRAWriter_NewSpot(cself->base, NULL)) != 0 ) {
-        return rc;
-    }
-#if _DEBUGGING
-    {{
-        uint32_t i;
-
-        DEBUG_MSG(13, ("NAME: '%.*s'\n", spot.spot_name->len, spot.spot_name->data));
-        DEBUG_MSG(13, ("CSREAD: len:%u %.*s\n", spot.seq.len, spot.seq.len, spot.seq.data));
-        DEBUG_MSG(13, ("QUAL: len:%u", spot.qual.len));
-        for(i = 0; i < spot.qual.len; i++ ) {
-            DEBUG_MSG(13, (" %i", spot.qual.data[i]));
-        }
-        DEBUG_MSG(13, ("\nLABEL: '%.*s'\n", spot.label.len, spot.label.data));
-        for(i = 0; i < cself->nreads; i++) {
-            DEBUG_MSG(13, ("READ_%02u ", i));
-            DEBUG_MSG(13, ("READ_SEG: [%2u,%2u] ", spot.read_seg[i].start, spot.read_seg[i].len));
-            DEBUG_MSG(13, ("LABEL_SEG: [%2u,%2u] ", spot.label_start[i], spot.label_len[i]));
-            DEBUG_MSG(13, ("CS_KEY: %c ", spot.cs_key[i]));
-            DEBUG_MSG(13, ("READ_FLT: %s", spot.filter[i] == SRA_READ_FILTER_PASS ? "PASS" : "REJECT"));
-            DEBUG_MSG(13, ("\n"));
-        }
-        if( spot.fs_type != eAbisolidFSignalType_NotSet ) {
-            float* f;
-            DEBUG_MSG(13, ("FXX len:%u", spot.fxx.len));
-            f = (float*)spot.fxx.data;
-            for(i = 0; i < spot.fxx.len / sizeof(*f); i++) {
-                DEBUG_MSG(13, (" %f", f[i]));
-            }
-            DEBUG_MSG(13, ("\nCY3: len%u:", spot.cy3.len));
-            f = (float*)spot.cy3.data;
-            for(i = 0; i < spot.cy3.len / sizeof(*f); i++) {
-                DEBUG_MSG(13, (" %f", f[i]));
-            }
-            DEBUG_MSG(13, ("\nTXR: len:%u:", spot.txr.len));
-            f = (float*)spot.txr.data;
-            for(i = 0; i < spot.txr.len / sizeof(*f); i++) {
-                DEBUG_MSG(13, (" %f", f[i]));
-            }
-            DEBUG_MSG(13, ("\nCY5: len:%u", spot.cy5.len));
-            f = (float*)spot.cy5.data;
-            for(i = 0; i < spot.cy5.len / sizeof(*f); i++) {
-                DEBUG_MSG(13, (" %f", f[i]));
-            }
-            DEBUG_MSG(13, ("\n"));
-        }
-    }}
-#endif
-    /* this column is the one that is most likely to fail as it is required to be unique
-     * so we put it first so that we can still close the spot if it fails
-     */
-    COL_WRITE(cself->ci_name, "NAME", (*spot_name));
-    COL_WRITE(cself->ci_csread, "CSREAD", spot.seq);
-    COL_WRITE(cself->ci_qual, "QUALITY", spot.qual);
-    if( cself->ci_fxx != 0 ) {
-        if( spot.fs_type == eAbisolidFSignalType_FTC ) {
-            COL_WRITE(cself->ci_fxx, "FTC", spot.fxx);
-        } else {
-            COL_WRITE(cself->ci_fxx, "FAM", spot.fxx);
-        }
-        COL_WRITE(cself->ci_cy3, "CY3", spot.cy3);
-        COL_WRITE(cself->ci_txr, "TXR", spot.txr);
-        COL_WRITE(cself->ci_cy5, "CY5", spot.cy5);
-    }
-    if( (rc = SRAWriter_WriteSpotSegmentSimple(cself->base, file, spot_group ? spot_group->data : NULL, spot.read_seg)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-        return rc;
-    }
-    if( cself->ci_label != 0 ) {
-        COL_WRITE(cself->ci_label, "LABEL", spot.label);
-        rc = SRAWriter_WriteIdxColumn(cself->base, cself->ci_label_start, spot.label_start, cself->nreads * sizeof(spot.label_start[0]), false);
-        if(rc) {
-            PLOGERR(klogErr, (klogErr, rc, "failed to write '$(column)' column", "column=LABEL_START"));
-            return rc;
-        }
-        rc = SRAWriter_WriteIdxColumn(cself->base, cself->ci_label_len, spot.label_len, cself->nreads * sizeof(spot.label_len[0]), false);
-        if(rc) {
-            PLOGERR(klogErr, (klogErr, rc, "failed to write '$(column)' column", "column=LABEL_LEN"));
-            return rc;
-        }
-    }
-
-    rc = SRAWriter_WriteIdxColumn(cself->base, cself->ci_cs_key, spot.cs_key, cself->nreads * sizeof(spot.cs_key[0]), false);
-    if(rc) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write '$(column)' column", "column=CS_KEY"));
-        return rc;
-    }
-    rc = SRAWriter_WriteIdxColumn(cself->base, cself->ci_read_filter, spot.filter, cself->nreads * sizeof(spot.filter[0]), false);
-    if(rc) {
-        PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_FILTER"));
-        return rc;
-    }
-    return SRAWriter_CloseSpot(cself->base);
-}
diff --git a/tools/sra-load/writer-absolid.h b/tools/sra-load/writer-absolid.h
deleted file mode 100644
index 220a990..0000000
--- a/tools/sra-load/writer-absolid.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_writer_absolid_
-#define _sra_load_writer_absolid_
-
-#include "loader-fmt.h"
-#include "pstring.h"
-
-#define ABSOLID_FMT_MAX_NUM_READS 2
-
-#define ABSOLID_FMT_COLMASK_NOTSET 0x00
-#define ABSOLID_FMT_COLMASK_READ 0x01
-#define ABSOLID_FMT_COLMASK_QUALITY 0x02
-#define ABSOLID_FMT_COLMASK_FTC 0x04
-#define ABSOLID_FMT_COLMASK_FAM 0x08
-#define ABSOLID_FMT_COLMASK_CY3 0x10
-#define ABSOLID_FMT_COLMASK_TXR 0x20
-#define ABSOLID_FMT_COLMASK_CY5 0x40
-
-typedef enum EAbisolidReadType_enum {
-    eAbisolidReadType_Unknown = 0,
-    eAbisolidReadType_SPOT = 1,
-    eAbisolidReadType_F3 = 2,
-    eAbisolidReadType_R3 = 3,
-    eAbisolidReadType_F5_P2 = 4,
-    eAbisolidReadType_F5_BC = 5,
-    eAbisolidReadType_F5_RNA = 6,
-    eAbisolidReadType_F5_DNA = 7,
-    eAbisolidReadType_F3_DNA = 8
-} EAbisolidReadType;
-
-extern const int AbisolidReadType2ReadNumber [];
-extern const char *AbisolidReadType2ReadLabel [];
-
-typedef enum EAbisolidFSignalType_enum {
-    eAbisolidFSignalType_NotSet = 0,
-    eAbisolidFSignalType_FAM = 1,
-    eAbisolidFSignalType_FTC = 2
-} EAbisolidFSignalType;
-
-typedef struct AbsolidRead_struct {
-    pstring label;
-    char cs_key;
-    pstring seq;
-    pstring qual;
-    EAbisolidFSignalType fs_type;
-    pstring fxx;
-    pstring cy3;
-    pstring txr;
-    pstring cy5;
-    SRAReadFilter filter;
-} AbsolidRead;
-
-void AbsolidRead_Init(AbsolidRead* read);
-
-EAbisolidReadType AbsolidRead_Suffix2ReadType(const char* s);
-
-typedef struct SRAWriteAbsolid SRAWriteAbsolid;
-
-rc_t SRAWriteAbsolid_Make(const SRAWriteAbsolid** cself, const SRALoaderConfig* config);
-
-rc_t SRAWriteAbsolid_MakeName(const pstring* prefix, const pstring* suffix, pstring* name);
-
-void SRAWriteAbsolid_Whack(const SRAWriteAbsolid* cself, SRATable** table);
-
-rc_t SRAWriteAbsolid_Write(const SRAWriteAbsolid* cself, const SRALoaderFile* file, 
-                           const pstring* spot_name, const pstring* spot_group,
-                           const AbsolidRead* f3, const AbsolidRead* r3);
-
-#endif /* _sra_load_writer_absolid_ */
diff --git a/tools/sra-load/writer-helicos.c b/tools/sra-load/writer-helicos.c
deleted file mode 100644
index 2935826..0000000
--- a/tools/sra-load/writer-helicos.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/types.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "writer-helicos.h"
-#include "sra-writer.h"
-
-struct SRAWriterHelicos {
-    SRAWriter* base;
-
-    uint32_t ci_name;
-    uint32_t ci_read;
-    uint32_t ci_qual;
-};
-
-rc_t SRAWriterHelicos_Make(const SRAWriterHelicos** cself, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriterHelicos* self;
-    const PlatformXML* platform;
-
-    if( cself == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ) {
-        return rc;
-    }
-    if( platform->id != SRA_PLATFORM_HELICOS ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "platform type");
-        return rc;
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = SRAWriter_Make(&self->base, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize base writer");
-    }
-
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        SRAWriterHelicos_Whack(self, NULL);
-    }
-    return rc;
-}
-
-void SRAWriterHelicos_Whack(const SRAWriterHelicos* cself, SRATable** table)
-{
-    if( cself != NULL ) {
-        SRAWriterHelicos* self = (SRAWriterHelicos*)cself;
-        SRAWriter_Whack(self->base, table);
-        free(self);
-    }
-}
-
-rc_t SRAWriterHelicos_Write(const SRAWriterHelicos* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality)
-{
-    rc_t rc = 0;
-    SRAWriterHelicos* self =(SRAWriterHelicos*)cself;
-    
-    assert(self != NULL);
-    assert(data_block_ref != NULL);
-
-    DEBUG_MSG(3, ("spot name '%s'\n", name ? name->data : NULL));
-
-    if( self->ci_name == 0 ) {
-        if( (rc = SRAWriter_CreateTable(self->base, "NCBI:SRA:Helicos:tbl:v2")) != 0 ) {
-            return rc;
-        }
-        if( (rc = SRAWriter_WriteDefaults(self->base)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to write table defaults");
-            return rc;
-        }
-        COL_OPEN(self->ci_name, "NAME", vdb_ascii_t);
-        COL_OPEN(self->ci_read, "READ", insdc_fasta_t);
-        COL_OPEN(self->ci_qual, "QUALITY", insdc_phred_t);
-    }
-    if( !name || name->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "spot name");
-    }
-    if( !sequence || sequence->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "sequence");
-    } else if( !quality || sequence->len != quality->len ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, quality ? rcInconsistent : rcEmpty);
-        LOGERR(klogErr, rc, "quality");
-    }
-    if( rc != 0 || (rc = SRAWriter_NewSpot(self->base, NULL)) != 0 ) {
-        return rc;
-    }
-    COL_WRITE(self->ci_name, "NAME", (*name));
-    COL_WRITE(self->ci_read, "READ", (*sequence));
-    COL_WRITE(self->ci_qual, "QUALITY", (*quality));
-    if( (rc = SRAWriter_WriteSpotSegment(self->base, data_block_ref, NULL, sequence->len, sequence->data)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-        return rc;
-    }
-    return SRAWriter_CloseSpot(self->base);
-}
diff --git a/tools/sra-load/writer-helicos.h b/tools/sra-load/writer-helicos.h
deleted file mode 100644
index a8a9f93..0000000
--- a/tools/sra-load/writer-helicos.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_writer_454_
-#define _sra_load_writer_454_
-
-#include "loader-fmt.h"
-#include "pstring.h"
-
-typedef struct SRAWriterHelicos SRAWriterHelicos;
-
-rc_t SRAWriterHelicos_Make(const SRAWriterHelicos** cself, const SRALoaderConfig* config);
-
-void SRAWriterHelicos_Whack(const SRAWriterHelicos* cself, SRATable** table);
-
-rc_t SRAWriterHelicos_Write(const SRAWriterHelicos* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality);
-
-#endif /* _sra_load_writer_454_ */
diff --git a/tools/sra-load/writer-illumina.c b/tools/sra-load/writer-illumina.c
deleted file mode 100644
index b6c3ef4..0000000
--- a/tools/sra-load/writer-illumina.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/types.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "writer-illumina.h"
-#include "sra-writer.h"
-
-void IlluminaRead_Init(IlluminaRead* read, bool name_only)
-{
-    assert(read != NULL);
-    read->read_id = ILLUMINAWRITER_READID_NONE;
-    if( !name_only ) {
-        pstring_clear(&read->seq);
-        read->qual_type = ILLUMINAWRITER_COLMASK_NOTSET;
-        pstring_clear(&read->qual);
-        pstring_clear(&read->noise);
-        pstring_clear(&read->intensity);
-        pstring_clear(&read->signal);
-        read->filter = SRA_READ_FILTER_PASS;
-    }
-}
-
-void IlluminaSpot_Init(IlluminaSpot* spot)
-{
-    memset(spot, 0, sizeof(*spot));
-    spot->qual_type = ILLUMINAWRITER_COLMASK_NOTSET;
-}
-
-static
-rc_t IlluminaSpot_Set(IlluminaSpot* spot, int r, const pstring* name, const pstring* barcode, const IlluminaRead* read)
-{
-    rc_t rc = 0;
-    if( r >= ILLUMINAWRITER_MAX_NUM_READS ) {
-        rc = RC(rcSRA, rcFormatter, rcCopying, rcData, rcOutofrange);
-    } else {
-        DEBUG_MSG(3, ("starting spot '%s' bc:'%s'\n", name->data, barcode->data));
-        spot->name = name;
-        spot->barcode = barcode;
-        spot->reads[r].read_id = read->read_id;
-        spot->reads[r].seq = read->seq.len > 0 ? &read->seq : NULL;
-        if( (read->qual_type == ILLUMINAWRITER_COLMASK_QUALITY_PHRED) ||
-            (read->qual_type == ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS1) ||
-            (read->qual_type == ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4) ) {
-            spot->qual_type = read->qual_type;
-            spot->reads[r].qual = &read->qual;
-        } else if( read->qual_type != ILLUMINAWRITER_COLMASK_NOTSET ) {
-            rc = RC(rcSRA, rcFormatter, rcCopying, rcRange, rcUnrecognized);
-        }
-        spot->reads[r].noise = read->noise.len > 0 ? &read->noise : NULL;
-        spot->reads[r].intensity = read->intensity.len > 0 ? &read->intensity : NULL;
-        spot->reads[r].signal = read->signal.len > 0 ? &read->signal : NULL;
-        spot->reads[r].filter = &read->filter;
-    }
-    return rc;
-}
-
-static
-rc_t IlluminaSpot_Append(IlluminaSpot* spot, int r, const pstring* barcode, const IlluminaRead* read, const char** field)
-{
-    rc_t rc = 0;
-    /* spot->name and spot->reads[r].read_id assumed to be matched with read before call!!! */
-    if( r >= ILLUMINAWRITER_MAX_NUM_READS ) {
-        *field = "number of reads";
-        return RC(rcSRA, rcFormatter, rcCopying, rcData, rcOutofrange);
-    }
-    if( (spot->barcode == NULL && barcode != NULL) ||
-        (spot->barcode != NULL && barcode == NULL) ||
-        (spot->barcode != barcode && pstring_cmp(spot->barcode, barcode) != 0) ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-        *field = "barcode";
-        return rc;
-    }
-    if( read->seq.len > 0 ) {
-        if( spot->reads[r].seq ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-            *field = "sequence";
-            return rc;
-        } else {
-            spot->reads[r].seq = &read->seq;
-        }
-    }
-    if( read->qual_type != ILLUMINAWRITER_COLMASK_NOTSET ) {
-        if( spot->reads[r].qual ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-            *field = "quality";
-            return rc;
-        }
-        if( spot->qual_type != ILLUMINAWRITER_COLMASK_NOTSET && spot->qual_type != read->qual_type ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-            *field = "quality type";
-            return rc;
-        }
-        spot->qual_type = read->qual_type;
-        spot->reads[r].qual = &read->qual;
-    }
-
-    if( read->noise.len > 0 ) {
-        if( spot->reads[r].noise ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-            *field = "noise";
-            return rc;
-        } else {
-            spot->reads[r].noise = &read->noise;
-        }
-    }
-    if( read->intensity.len > 0 ) {
-        if( spot->reads[r].intensity ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-            *field = "intensity";
-            return rc;
-        } else {
-            spot->reads[r].intensity = &read->intensity;
-        }
-    }
-    if( read->signal.len > 0 ) {
-        if( spot->reads[r].signal ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcDuplicate);
-            *field = "signal";
-            return rc;
-        } else {
-            spot->reads[r].signal = &read->signal;
-        }
-    }
-    if( spot->reads[r].filter != NULL ) {
-        if( *(spot->reads[r].filter) != read->filter ) {
-            rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-            *field = "read_filter";
-            return rc;
-        }
-    } else {
-        spot->reads[r].filter = &read->filter;
-    }
-    return rc;
-}
-
-rc_t IlluminaSpot_Add(IlluminaSpot* spot, const pstring* name, const pstring* barcode, const IlluminaRead* read)
-{
-    rc_t rc = 0;
-
-    if( spot->nreads == 0 ) {
-        rc = IlluminaSpot_Set(spot, spot->nreads++, name, barcode, read);
-    } else if( pstring_cmp(spot->name, name) == 0 ) {
-        /* look if same read_id was already seen in this spot */
-        int32_t k;
-        for(k = 0; k < spot->nreads; k++) {
-            if( spot->reads[k].read_id == read->read_id ) {
-                const char* field;
-                rc = IlluminaSpot_Append(spot, k, barcode, read, &field);
-                if( GetRCState(rc) == rcDuplicate && read->read_id == ILLUMINAWRITER_READID_NONE ) {
-                    /* may be it is the case when readids are missing on defline and these are separate reads */
-                    k = spot->nreads + 1;
-                    rc = 0;
-                } else if( rc != 0 ) {
-                    PLOGERR(klogErr, (klogErr, rc, "$(field) for spot '$(s)'", PLOG_2(PLOG_S(field),PLOG_S(s)), field, spot->name->data));
-                }
-                break;
-            }
-        }
-        if( rc == 0 && k >= spot->nreads ) {
-            /* read was not found, adddind new read to this spot */
-            rc = IlluminaSpot_Set(spot, spot->nreads++, name, barcode, read);
-        }
-    } else {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcIgnored);
-    }
-    return rc;
-}
-
-struct SRAWriterIllumina {
-    SRAWriter* base;
-    const SRALoaderConfig* config;
-    const PlatformXML* platform;
-    uint8_t nreads;
-
-    SRASegment read_seg[ILLUMINAWRITER_MAX_NUM_READS];
-    int16_t barcode_read_id;
-    bool fixed_read_seg;
-    const ReadSpecXML_read* last_read;
-    uint32_t sequence_length;
-    
-    uint16_t col_mask;
-    uint32_t ci_name;
-    uint32_t ci_read;
-    uint32_t ci_qual;
-    uint32_t ci_signal;
-    uint32_t ci_noise;
-    uint32_t ci_intensity;
-    uint32_t ci_read_filter;
-
-};
-
-rc_t SRAWriterIllumina_Make(const SRAWriterIllumina** cself, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriterIllumina* self;
-    const PlatformXML* platform;
-    const ReadSpecXML_read* last_read;
-    int32_t spot_len;
-    uint32_t sequence_length;
-    uint8_t nreads;
-
-    if( cself == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ||
-        (rc = Experiment_GetReadNumber(config->experiment, &nreads)) != 0 ||
-        (rc = Experiment_GetSpotLength(config->experiment, &sequence_length)) != 0 ||
-        (rc = Experiment_GetRead(config->experiment, nreads - 1, &last_read)) != 0 ) {
-        return rc;
-    }
-    if( platform->id != SRA_PLATFORM_ILLUMINA ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "platform type");
-        return rc;
-    }
-    if( nreads > ILLUMINAWRITER_MAX_NUM_READS ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-        PLOGERR(klogErr, (klogErr, rc, "more than $(max) reads", PLOG_U8(max), (uint8_t)ILLUMINAWRITER_MAX_NUM_READS));
-        return rc;
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-        return rc;
-    }
-    if( (rc = SRAWriter_Make(&self->base, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize base writer");
-    }
-    self->config = config;
-    self->platform = platform;
-    self->nreads = nreads;
-    self->barcode_read_id = ILLUMINAWRITER_READID_NONE;
-    self->last_read = last_read;
-    self->fixed_read_seg = true;
-    self->col_mask = ILLUMINAWRITER_COLMASK_NOTSET;
-    self->sequence_length = sequence_length;
-    spot_len = sequence_length;
-
-    do {
-        const ReadSpecXML_read* read_spec;
-        int16_t len = 0;
-        --nreads;
-        if( (rc = Experiment_GetRead(config->experiment, nreads, &read_spec)) != 0 ) {
-            break;
-        }
-        if( read_spec->read_type == rdsp_BarCode_rt ) {
-            if( self->barcode_read_id == ILLUMINAWRITER_READID_NONE ) {
-                self->barcode_read_id = nreads;
-            } else {
-                rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcDuplicate);
-                LOGERR(klogErr, rc, "only on BarCode READ_TYPE per spot supported");
-                break;
-            }
-        }
-        if( self->fixed_read_seg ) {
-            switch(read_spec->coord_type) {
-                case rdsp_BaseCoord_ct:
-                case rdsp_CycleCoord_ct:
-                    len = spot_len - read_spec->coord.start_coord + 1;
-                    break;
-                case rdsp_ExpectedBaseCall_ct:
-                case rdsp_ExpectedBaseCallTable_ct:
-                    if( read_spec->coord.expected_basecalls.default_length > 0 ) {
-                        len = read_spec->coord.expected_basecalls.default_length;
-                    } else {
-                        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-                    }
-                    break;
-                case rdsp_RelativeOrder_ct:
-                    if( nreads == 0 ) {
-                        len = spot_len - 1 + 1; /* as if BASE_COORD == 1 */
-                        break;
-                    }
-                default:
-                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcUnsupported);
-            }
-            if( rc == 0 ) {
-                spot_len -= len;
-                if( spot_len < 0 || len <= 0 ) {
-                    rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInconsistent);
-                    LOGERR(klogErr, rc, "SPOT_DECODE_SPEC and SEQUENCE_LENGTH");
-                } else {
-                    SRASegment* seg = &self->read_seg[nreads];
-                    seg->start = spot_len;
-                    seg->len = len;
-                    DEBUG_MSG(3, ("#%u read fixed length = %i\n", nreads, len));
-                }
-            } else if( GetRCState(rc) == rcUnsupported ) {
-                self->fixed_read_seg = false;
-                DEBUG_MSG(3, ("not fixed spot segmentation"));
-                rc = 0;
-            }
-        }
-    } while( rc == 0 && nreads > 0 );
-
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        SRAWriterIllumina_Whack(self, NULL);
-    }
-    return rc;
-}
-
-void SRAWriterIllumina_Whack(const SRAWriterIllumina* cself, SRATable** table)
-{
-    if( cself != NULL ) {
-        SRAWriterIllumina* self = (SRAWriterIllumina*)cself;
-        SRAWriter_Whack(self->base, table);
-        free(self);
-    }
-}
-
-typedef struct IlluminaWriterSpot_struct {
-    pstring name;
-    const char* spot_group;
-    uint16_t col_mask;
-    bool adjust_last_read_len;
-    pstring seq;
-    pstring qual;
-    pstring noise;
-    pstring intensity;
-    pstring signal;
-    SRAReadFilter filter[ILLUMINAWRITER_MAX_NUM_READS];
-} IlluminaWriterSpot;
-
-static
-rc_t SRAWriterIllumina_Check(SRAWriterIllumina* self, IlluminaSpot* spot, IlluminaWriterSpot* final)
-{
-    rc_t rc = 0;
-    bool done, inject_barcode = false;
-    int32_t i, flt_qty, spot_len;
-    const char* what = NULL, *member_basecall = NULL;
-
-    assert(self != NULL);
-    assert(spot != NULL);
-    assert(final != NULL);
-
-    /* reorder reads ascending by file's read_ids */
-    do {
-        IlluminaSpot tmp;
-        done = true;
-        for(i = 1; i < spot->nreads; i++) {
-            if( spot->reads[i].read_id < spot->reads[i - 1].read_id ) {
-                memcpy(&tmp.reads[0], &spot->reads[i], sizeof(tmp.reads[0]));
-                memcpy(&spot->reads[i], &spot->reads[i - 1], sizeof(tmp.reads[0]));
-                memcpy(&spot->reads[i - 1], &tmp.reads[0], sizeof(tmp.reads[0]));
-                done = false;
-            }
-        }
-    } while( !done );
-
-    /* get total spot length in bases */
-    spot_len = 0;
-    for(i = 0; rc == 0 && i < spot->nreads; i++) {
-        if( spot->reads[i].seq == NULL ) {
-            rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcNotFound);
-            what = "sequence";
-        } else {
-            spot_len += spot->reads[i].seq->len;
-            if( spot->reads[i].qual == NULL ) {
-                rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcNotFound);
-                what = "quality";
-            }
-        }
-    }
-    if( rc == 0 ) {
-        if( spot->name == NULL || spot->name->len < 1 ) {
-            rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcEmpty);
-            what = "spot name";
-        } else {
-            rc = pstring_copy(&final->name, spot->name);
-        }
-    }
-    if( rc == 0 ) {
-        final->spot_group = NULL;
-        if( spot->barcode != NULL && spot->barcode->len > 0 ) {
-            if( self->barcode_read_id != ILLUMINAWRITER_READID_NONE ) {
-                rc = Experiment_FindReadInTable(self->config->experiment, self->barcode_read_id,
-                                                spot->barcode->data, &member_basecall, &final->spot_group);
-                if( GetRCState(rc) == rcNotFound ) {
-                    /* experiment knows nothing about this barcode, so may be they assigned membership themselves, reset */
-                    member_basecall = NULL;
-                    final->spot_group = NULL;
-                    rc = 0;
-                } else if( rc != 0 ) {
-                    what = "barcode";
-                }
-            }
-            if( final->spot_group == NULL ) {
-                /* reset back to file value */
-                final->spot_group = spot->barcode->data;
-            }
-            if( member_basecall == NULL && pstring_is_fasta(spot->barcode) ) {
-                /* keep original barcode from file if it is fasta */
-                member_basecall = spot->barcode->data;
-            }
-        }
-    }
-    if( rc == 0 ) {
-        final->adjust_last_read_len = false;
-        if( self->sequence_length != spot_len ) {
-            uint16_t barc_len = member_basecall ? strlen(member_basecall) : 0;
-            if( self->sequence_length != (spot_len + barc_len) ) {
-                if( spot_len > self->sequence_length ) {
-                    what = "spot too long";
-                    rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcExcessive);
-                    PLOGERR(klogErr, (klogErr, rc,
-                        "cummulative length of reads data in file(s): $(l) is greater than"
-                        " spot length declared in experiment: $(e) in spot '$(spot)'",
-                        "l=%d,e=%u,spot=%.*s", spot_len, self->sequence_length,
-                        (uint32_t)spot->name->len, spot->name->data));
-                } else if( self->fixed_read_seg && (self->last_read->read_class & SRA_READ_TYPE_BIOLOGICAL) &&
-                           spot_len > (self->sequence_length - self->read_seg[self->nreads - 1].len) &&
-                           (self->barcode_read_id == ILLUMINAWRITER_READID_NONE ||
-                            self->sequence_length - spot_len != self->read_seg[self->barcode_read_id].len) ) {
-                    final->adjust_last_read_len = true;
-                } else {
-                    what = "spot too short";
-                    rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-                    PLOGERR(klogErr, (klogErr, rc,
-                        "cummulative length of reads data in file(s): $(l) is less than"
-                        " spot length declared in experiment: $(e), most probably $(x) is absent in spot '$(spot)'",
-                        "l=%d,e=%u,spot=%.*s,x=%s", spot_len, self->sequence_length,
-                        (uint32_t)spot->name->len, spot->name->data,
-                        (self->barcode_read_id == ILLUMINAWRITER_READID_NONE ||
-                         self->sequence_length - spot_len != self->read_seg[self->barcode_read_id].len) ? "mate-pair" : "barcode" ));
-                }
-            } else {
-                spot_len += barc_len;
-                inject_barcode = true;
-                DEBUG_MSG(3, ("barcode needs to be injected into spot data\n"));
-            }
-        }
-    }
-
-    /* prepare seq/qual/signal/noise/intensity */
-    pstring_clear(&final->seq);
-    pstring_clear(&final->qual);
-    pstring_clear(&final->noise);
-    pstring_clear(&final->intensity);
-    pstring_clear(&final->signal);
-    final->col_mask = ILLUMINAWRITER_COLMASK_READ | spot->qual_type;
-    for(flt_qty = i = 0; rc == 0 && i < spot->nreads; i++, flt_qty++) {
-        /* presence of seq and qual data is checked above */
-        if( (rc = pstring_concat(&final->seq, spot->reads[i].seq)) != 0 ) {
-            what = "sequence";
-            break;
-        } else if( (rc = pstring_concat(&final->qual, spot->reads[i].qual)) != 0 ) {
-            what = "quality";
-            break;
-        }
-        if( spot->reads[i].signal != NULL ) {
-            if( (rc = pstring_concat(&final->signal, spot->reads[i].signal)) != 0 ) {
-                what = "signal";
-                break;
-            }
-            final->col_mask |= ILLUMINAWRITER_COLMASK_SIGNAL; 
-        }
-        if( spot->reads[i].noise != NULL ) {
-            if( (rc = pstring_concat(&final->noise, spot->reads[i].noise)) != 0 ) {
-                what = "noise";
-                break;
-            }
-            final->col_mask |= ILLUMINAWRITER_COLMASK_NOISE; 
-        }
-        if( spot->reads[i].intensity != NULL ) {
-            if( (rc = pstring_concat(&final->intensity, spot->reads[i].intensity)) != 0 ) {
-                what = "intensity";
-                break;
-            }
-            final->col_mask |= ILLUMINAWRITER_COLMASK_INTENSITY; 
-        }
-        if( spot->reads[i].filter != NULL && i == 0 ) {
-            final->col_mask |= ILLUMINAWRITER_COLMASK_RDFILTER; 
-        } else if( ((final->col_mask & ILLUMINAWRITER_COLMASK_RDFILTER) && spot->reads[i].filter == NULL) ||
-                   (!(final->col_mask & ILLUMINAWRITER_COLMASK_RDFILTER) && spot->reads[i].filter != NULL) ) {
-            rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-            what = "read filter";
-            break;
-        }
-        if( spot->reads[i].filter != NULL ) {
-            final->filter[flt_qty] = *(spot->reads[i].filter);
-        }
-    }
-    if( rc == 0 &&
-        (final->qual.len / final->seq.len) != ((final->col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4) ? 4 : 1) ) {
-        rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-        what = "quality length vs sequence";
-    }
-    if( rc == 0 &&
-        ((final->col_mask & ILLUMINAWRITER_COLMASK_SIGNAL) && (final->signal.len != self->sequence_length * 16)) ) {
-        rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-        what = "signal data length";
-    }
-    if( rc == 0 &&
-        ((final->col_mask & ILLUMINAWRITER_COLMASK_NOISE) && (final->noise.len != self->sequence_length * 16)) ) {
-        rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-        what = "noise data length";
-    }
-    if( rc == 0 &&
-        ((final->col_mask & ILLUMINAWRITER_COLMASK_INTENSITY) && (final->intensity.len != self->sequence_length * 16)) ) {
-        rc = RC(rcSRA, rcFormatter, rcValidating, rcData, rcInconsistent);
-        what = "intensity data length";
-    }
-
-    if( rc == 0 && inject_barcode ) {
-        /* insert barcode into spot data using read_seg information */
-        /* verified above to be present, to be fasta, and length as in XML */
-        INSDC_coord_zero from = self->read_seg[self->barcode_read_id].start;
-        INSDC_coord_len l = self->read_seg[self->barcode_read_id].len;
-        INSDC_coord_len carry = final->seq.len - from;
-        const uint32_t qual_x = ((final->col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4) ? 4 : 1);
-        pstring tmp;
-
-        DEBUG_MSG(3, ("injecting barcodr as read %i [%i,%u] \n", self->barcode_read_id, from, l));
-        final->seq.len = from;
-        final->qual.len = from * qual_x;
-        if( (rc = pstring_assign(&tmp, &final->seq.data[final->seq.len], carry)) != 0 ||
-            (rc = pstring_append(&final->seq, member_basecall, l)) != 0 ||
-            (rc = pstring_concat(&final->seq, &tmp)) != 0 ) {
-            what = "inserting barcode into sequence";
-        } else if( (rc = pstring_assign(&tmp, &final->qual.data[final->qual.len], carry * qual_x)) != 0 ||
-                   (rc = pstring_append_chr(&final->qual, 1, l * qual_x)) != 0 ||
-                   (rc = pstring_concat(&final->qual, &tmp)) != 0 ) {
-            what = "inserting barcode into quality";
-        }
-        if( rc == 0 && (final->col_mask & ILLUMINAWRITER_COLMASK_SIGNAL) ) {
-            final->signal.len = from * 16;
-            if( (rc = pstring_assign(&tmp, &final->signal.data[final->signal.len], carry * 16)) != 0 ||
-                (rc = pstring_append_chr(&final->signal, 0, l * 16)) != 0 ||
-                (rc = pstring_concat(&final->signal, &tmp)) != 0 ) {
-                what = "inserting barcode into signal";
-            }
-        }
-        if( rc == 0 && (final->col_mask & ILLUMINAWRITER_COLMASK_INTENSITY) ) {
-            final->intensity.len = from * 16;
-            if( (rc = pstring_assign(&tmp, &final->intensity.data[final->intensity.len], carry * 16)) != 0 ||
-                (rc = pstring_append_chr(&final->intensity, 0, l * 16)) != 0 ||
-                (rc = pstring_concat(&final->intensity, &tmp)) != 0 ) {
-                what = "inserting barcode into intensity";
-            }
-        }
-        if( rc == 0 && (final->col_mask & ILLUMINAWRITER_COLMASK_NOISE) ) {
-            final->noise.len = from * 16;
-            if( (rc = pstring_assign(&tmp, &final->noise.data[final->noise.len], carry * 16)) != 0 ||
-                (rc = pstring_append_chr(&final->noise, 0, l * 16)) != 0 ||
-                (rc = pstring_concat(&final->noise, &tmp)) != 0 ) {
-                what = "inserting barcode into noise";
-            }
-        }
-        for(i = flt_qty - 1; rc == 0 && i >= self->barcode_read_id; i--) {
-            final->filter[i + 1] = final->filter[i];
-        }
-        final->filter[self->barcode_read_id] = final->filter[0];
-        flt_qty++;
-    }
-    /* propogate filter value in case number of reads in files is less than in XML */
-    for(i = flt_qty; rc == 0 && i < self->nreads; i++) {
-        final->filter[i] = final->filter[0];
-    }
-
-#if _DEBUGGING
-    DEBUG_MSG(3, ("Ready: READ: %s\n", final->seq.data));
-    DEBUG_MSG(3, ("Ready: QUAL%c:", (final->col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4) ? '4' : '1'));
-    for(i = 0; i < final->qual.len; i++ ) {
-        DEBUG_MSG(3, (" %i", final->qual.data[i]));
-    }
-    DEBUG_MSG(3, ("\nReady: SGRUP: %s\n", final->spot_group));
-    for(i = 0; i < self->nreads; i++ ) {
-        DEBUG_MSG(3, ("Ready: READ_FLT[%u]: %s\n", i, final->filter[i] == SRA_READ_FILTER_PASS ? "PASS" : "REJECT"));
-    }
-#endif
-    if( rc != 0 && rc != KLogLastErrorCode() ) {
-        PLOGERR(klogErr, (klogErr, rc, "$(msg) in spot '$(spot)'", "msg=%s,spot=%.*s", what, spot->name->len, spot->name->data));
-    }
-    return rc;
-}
-
-rc_t SRAWriterIllumina_Write(const SRAWriterIllumina* cself, const SRALoaderFile* data_block_ref, IlluminaSpot* spot)
-{
-    rc_t rc = 0;
-    SRAWriterIllumina* self =(SRAWriterIllumina*)cself;
-    IlluminaWriterSpot final;
-    
-    assert(self != NULL);
-    assert(data_block_ref != NULL);
-
-    DEBUG_MSG(3, ("spot name '%s', group '%s'\n", spot->name->data, spot->barcode ? spot->barcode->data : NULL));
-
-    if( (rc = SRAWriterIllumina_Check(self, spot, &final)) != 0 ) {
-        return rc;
-    }
-    if( self->col_mask == ILLUMINAWRITER_COLMASK_NOTSET ) {
-        const char* schema;
-
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4 ) {
-            schema = "NCBI:SRA:Illumina:tbl:q4:v2";
-        } else if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS1 ) {
-            schema = "NCBI:SRA:Illumina:tbl:q1:v2";
-        } else if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_PHRED ) {
-            schema = "NCBI:SRA:Illumina:tbl:phred:v2";
-        } else {
-            rc = RC(rcExe, rcTable, rcCreating, rcType, rcUnknown);
-            return rc;
-        }
-        if( (rc = SRAWriter_CreateTable(self->base, schema)) != 0 ) {
-            return rc;
-        }
-        if( (rc = SRAWriter_WriteDefaults(self->base)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to write table defaults");
-            return rc;
-        }
-        COL_OPEN(self->ci_name, "NAME", vdb_ascii_t);
-        COL_OPEN(self->ci_read, "READ", insdc_fasta_t);
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4 ) {
-            COL_OPEN(self->ci_qual, "QUALITY", ncbi_qual4_t);
-        } else if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS1 ) {
-            COL_OPEN(self->ci_qual, "QUALITY", insdc_logodds_t);
-        } else if( final.col_mask & ILLUMINAWRITER_COLMASK_QUALITY_PHRED ) {
-            COL_OPEN(self->ci_qual, "QUALITY", insdc_phred_t);
-        }
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_SIGNAL ) {
-            COL_OPEN(self->ci_signal, "SIGNAL", ncbi_fsamp4_t);
-        }
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_NOISE ) {
-            COL_OPEN(self->ci_noise, "NOISE", ncbi_fsamp4_t);
-        }
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_INTENSITY ) {
-            COL_OPEN(self->ci_intensity, "INTENSITY", ncbi_fsamp4_t);
-        }
-        if( final.col_mask & ILLUMINAWRITER_COLMASK_RDFILTER ) {
-            COL_OPEN(self->ci_read_filter, "READ_FILTER", sra_read_filter_t);
-        }
-        self->col_mask = final.col_mask;
-    }
-    if( self->col_mask != final.col_mask ) {
-        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcInconsistent);
-        LOGERR(klogInt, rc, "columns do not match to 1st spot");
-        return rc;
-    }
-    if( (rc = SRAWriter_NewSpot(self->base, NULL)) != 0 ) {
-        return rc;
-    }
-    COL_WRITE(self->ci_name, "NAME", final.name);
-    COL_WRITE(self->ci_read, "READ", final.seq);
-    COL_WRITE(self->ci_qual, "QUALITY", final.qual);
-    COL_WRITE(self->ci_noise, "NOISE", final.noise);
-    COL_WRITE(self->ci_intensity, "INTENSITY", final.intensity);
-    COL_WRITE(self->ci_signal, "SIGNAL", final.signal);
-
-    if( self->fixed_read_seg ) {
-        uint16_t tmp = 0;
-        if( final.adjust_last_read_len ) {
-            tmp = cself->read_seg[cself->nreads - 1].len;
-            self->read_seg[cself->nreads - 1].len -= cself->sequence_length - final.seq.len;
-        }
-        if( (rc = SRAWriter_WriteSpotSegmentSimple(self->base, data_block_ref, final.spot_group, cself->read_seg)) != 0 ) {
-            PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-            return rc;
-        }
-        if( final.adjust_last_read_len ) {
-            self->read_seg[cself->nreads - 1].len = tmp;
-        }
-    } else {
-        if( (rc = SRAWriter_WriteSpotSegment(self->base, data_block_ref, final.spot_group, final.seq.len, final.seq.data)) != 0 ) {
-            PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-            return rc;
-        }
-    }
-    if( self->ci_read_filter != 0 ) {
-        rc = SRAWriter_WriteIdxColumn(self->base, self->ci_read_filter, final.filter, self->nreads * sizeof(final.filter[0]), false);
-        if(rc) {
-            PLOGERR(klogInt, (klogInt, rc, "failed to write $(column) column", "column=READ_FILTER"));
-            return rc;
-        }
-    }
-    return SRAWriter_CloseSpot(self->base);
-}
diff --git a/tools/sra-load/writer-illumina.h b/tools/sra-load/writer-illumina.h
deleted file mode 100644
index ca7eae5..0000000
--- a/tools/sra-load/writer-illumina.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_writer_illumina_
-#define _sra_load_writer_illumina_
-
-#include "loader-fmt.h"
-#include "pstring.h"
-
-#define ILLUMINAWRITER_MAX_NUM_READS 5
-/* these readids have special meaning,
- * from file we can get only single digit positive readid so they never overlap
- * readid == -1 from file means no read id was found, must be whole spot data or single read submission
- */
-#define ILLUMINAWRITER_READID_NONE -1
-
-#define ILLUMINAWRITER_COLMASK_NOTSET 0x00
-#define ILLUMINAWRITER_COLMASK_READ 0x01
-#define ILLUMINAWRITER_COLMASK_QUALITY_PHRED 0x02
-#define ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS1 0x04
-#define ILLUMINAWRITER_COLMASK_QUALITY_LOGODDS4 0x08
-#define ILLUMINAWRITER_COLMASK_SIGNAL 0x10
-#define ILLUMINAWRITER_COLMASK_NOISE 0x20
-#define ILLUMINAWRITER_COLMASK_INTENSITY 0x40
-#define ILLUMINAWRITER_COLMASK_RDFILTER 0x80
-
-
-typedef struct IlluminaRead_struct {
-    int16_t read_id;
-    pstring seq;
-    int qual_type;
-    pstring qual;
-    pstring noise;
-    pstring intensity;
-    pstring signal;
-    SRAReadFilter filter;
-} IlluminaRead;
-
-void IlluminaRead_Init(IlluminaRead* read, bool name_only);
-
-typedef struct IlluminaSpot_struct {
-    const pstring* name;
-    const pstring* barcode;
-    int32_t nreads;
-    int qual_type;
-    struct {
-        int16_t read_id;
-        const pstring* seq;
-        const pstring* qual;
-        const pstring* noise;
-        const pstring* intensity;
-        const pstring* signal;
-        const SRAReadFilter* filter;
-    } reads[ILLUMINAWRITER_MAX_NUM_READS];
-} IlluminaSpot;
-
-void IlluminaSpot_Init(IlluminaSpot* spot);
-
-rc_t IlluminaSpot_Add(IlluminaSpot* spot, const pstring* name, const pstring* barcode, const IlluminaRead* read);
-
-
-typedef struct SRAWriterIllumina SRAWriterIllumina;
-
-rc_t SRAWriterIllumina_Make(const SRAWriterIllumina** cself, const SRALoaderConfig* config);
-
-void SRAWriterIllumina_Whack(const SRAWriterIllumina* cself, SRATable** table);
-
-rc_t SRAWriterIllumina_Write(const SRAWriterIllumina* cself, const SRALoaderFile* data_block_ref, IlluminaSpot* spot);
-
-#endif /* _sra_load_writer_illumina_ */
diff --git a/tools/sra-load/writer-ion-torrent.c b/tools/sra-load/writer-ion-torrent.c
deleted file mode 100644
index 174020c..0000000
--- a/tools/sra-load/writer-ion-torrent.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <sra/types.h>
-#include <insdc/insdc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-#include "writer-ion-torrent.h"
-#include "sra-writer.h"
-
-struct SRAWriterIonTorrent {
-    SRAWriter* base;
-    pstring flows;
-    uint32_t flow_count;
-    pstring keys;
-
-    uint32_t ci_flowc;
-    uint32_t ci_keys;
-    uint32_t ci_name;
-    uint32_t ci_read;
-    uint32_t ci_qual;
-    uint32_t ci_signal;
-    uint32_t ci_position;
-    uint32_t ci_q_left;
-    uint32_t ci_q_right;
-    uint32_t ci_a_left;
-    uint32_t ci_a_right;
-};
-
-rc_t SRAWriterIonTorrent_Make(const SRAWriterIonTorrent** cself, const SRALoaderConfig* config)
-{
-    rc_t rc = 0;
-    SRAWriterIonTorrent* self;
-    const PlatformXML* platform;
-
-    if( cself == NULL || config == NULL ) {
-        return RC(rcSRA, rcFormatter, rcConstructing, rcParam, rcNull);
-    }
-    if( (rc = Experiment_GetPlatform(config->experiment, &platform)) != 0 ) {
-        return rc;
-    }
-    if( platform->id != SRA_PLATFORM_ION_TORRENT ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcData, rcInvalid);
-        LOGERR(klogErr, rc, "platform type");
-        return rc;
-    }
-    self = calloc(1, sizeof(*self));
-    if( self == NULL ) {
-        rc = RC(rcSRA, rcFormatter, rcConstructing, rcMemory, rcExhausted);
-    } else if( (rc = SRAWriter_Make(&self->base, config)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to initialize base writer");
-    } else {
-        if( platform->param.ion_torrent.flow_sequence != NULL ) {
-            rc = pstring_assign(&self->flows, platform->param.ion_torrent.flow_sequence,
-                                       strlen(platform->param.ion_torrent.flow_sequence));
-        }
-        if( rc == 0 && platform->param.ion_torrent.key_sequence != NULL ) {
-            rc = pstring_assign(&self->keys, platform->param.ion_torrent.key_sequence,
-                                      strlen(platform->param.ion_torrent.key_sequence));
-        }
-        self->flow_count = platform->param.ion_torrent.flow_count;
-    }
-    if( rc == 0 ) {
-        *cself = self;
-    } else {
-        SRAWriterIonTorrent_Whack(self, NULL);
-    }
-    return rc;
-}
-
-void SRAWriterIonTorrent_Whack(const SRAWriterIonTorrent* cself, SRATable** table)
-{
-    if( cself != NULL ) {
-        SRAWriterIonTorrent* self = (SRAWriterIonTorrent*)cself;
-        SRAWriter_Whack(self->base, table);
-        free(self);
-    }
-}
-
-static
-rc_t SRAWriterIonTorrent_Open(const SRAWriterIonTorrent* cself, bool sig_and_pos)
-{
-    rc_t rc = 0;
-    SRAWriterIonTorrent* self = (SRAWriterIonTorrent*)cself;
-
-    if( cself->ci_name == 0 ) {
-        INSDC_coord_one d = 0;
-        pstring x;
-
-        if( (rc = SRAWriter_CreateTable(self->base, "NCBI:SRA:IonTorrent:tbl:v2")) != 0 ) {
-            return rc;
-        }
-        if( (rc = SRAWriter_WriteDefaults(self->base)) != 0 ) {
-            LOGERR(klogInt, rc, "failed to write table defaults");
-            return rc;
-        }
-        COL_OPEN(self->ci_name, "NAME", vdb_ascii_t);
-        COL_OPEN(self->ci_read, "READ", insdc_fasta_t);
-        COL_OPEN(self->ci_qual, "QUALITY", insdc_phred_t);
-        COL_OPEN(self->ci_q_left, "CLIP_QUALITY_LEFT", "INSDC:coord:one");
-        COL_OPEN(self->ci_q_right, "CLIP_QUALITY_RIGHT", "INSDC:coord:one");
-        COL_OPEN(self->ci_a_left, "CLIP_ADAPTER_LEFT", "INSDC:coord:one");
-        COL_OPEN(self->ci_a_right, "CLIP_ADAPTER_RIGHT", "INSDC:coord:one");
-        COL_OPEN(self->ci_flowc, "FLOW_CHARS", insdc_fasta_t);
-        COL_OPEN(self->ci_keys, "KEY_SEQUENCE", insdc_fasta_t);
-
-        COL_WRITE_DEFAULT(self->ci_flowc, "FLOW_CHARS", self->flows);
-        COL_WRITE_DEFAULT(self->ci_keys, "KEY_SEQUENCE", self->keys);
-        if( (rc = pstring_assign(&x, &d, sizeof(d))) == 0 ) {
-            COL_WRITE_DEFAULT(self->ci_q_left, "CLIP_QUALITY_LEFT", x);
-            COL_WRITE_DEFAULT(self->ci_q_right, "CLIP_QUALITY_RIGHT", x);
-            COL_WRITE_DEFAULT(self->ci_a_left, "CLIP_ADAPTER_LEFT", x);
-            COL_WRITE_DEFAULT(self->ci_a_right, "CLIP_ADAPTER_RIGHT", x);
-        }
-    }
-    if( sig_and_pos && (cself->ci_signal == 0 || cself->ci_position == 0) ) {
-        COL_OPEN(self->ci_signal, "SIGNAL", ncbi_isamp1_t);
-        COL_OPEN(self->ci_position, "POSITION", "INSDC:position:one");
-    }
-    return rc;
-}
-
-rc_t SRAWriterIonTorrent_WriteHead(const SRAWriterIonTorrent* cself, const pstring* flow_chars, const pstring* key_sequence)
-{
-    rc_t rc = 0;
-
-    if( (rc = SRAWriterIonTorrent_Open(cself, false)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to create table");
-        return rc;
-    }
-    if( flow_chars && flow_chars->len != 0 ) {
-        if( cself->flows.len != 0 && pstring_cmp(&cself->flows, flow_chars) != 0 ) {
-            PLOGMSG(klogWarn, (klogWarn, "file FLOW_SEQUENCE do not match experiment: $(s)", PLOG_S(s), flow_chars->data));
-        }
-        /* update flow_count so signal data length will match below */
-        ((SRAWriterIonTorrent*)cself)->flow_count = flow_chars->len;
-        COL_WRITE_DEFAULT(cself->ci_flowc, "FLOW_CHARS", (*flow_chars));
-    }
-    if( key_sequence && key_sequence->len != 0 ) {
-        if( cself->keys.len != 0 && pstring_cmp(&cself->keys, key_sequence) != 0 ) {
-            PLOGMSG(klogWarn, (klogWarn, "file KEY_SEQUENCE do not match experiment: $(s)", PLOG_S(s), key_sequence->data));
-        }
-        COL_WRITE_DEFAULT(cself->ci_keys, "KEY_SEQUENCE", (*key_sequence));
-    }
-    return 0;
-}
-
-rc_t SRAWriterIonTorrent_WriteRead(const SRAWriterIonTorrent* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality,
-                            const pstring* signal, const pstring* position,
-                            INSDC_coord_one q_left, INSDC_coord_one q_right,
-                            INSDC_coord_one a_left, INSDC_coord_one a_right)
-{
-    rc_t rc = 0;
-    SRAWriterIonTorrent* self =(SRAWriterIonTorrent*)cself;
-    
-    assert(self != NULL);
-    assert(data_block_ref != NULL);
-
-    DEBUG_MSG(3, ("spot name '%s'\n", name ? name->data : NULL));
-
-    if( (rc = SRAWriterIonTorrent_Open(cself, signal || position)) != 0 ) {
-        LOGERR(klogInt, rc, "failed to open table");
-        return rc;
-    }
-    if( !name || name->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "spot name");
-    }
-    if( !sequence || sequence->len == 0 ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcEmpty);
-        LOGERR(klogErr, rc, "sequence");
-    } else if( !quality || sequence->len != quality->len ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, quality ? rcInconsistent : rcEmpty);
-        LOGERR(klogErr, rc, "quality");
-    }
-    if( signal && signal->len / self->flow_count != sizeof(uint16_t) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "signal and flow chars");
-    }
-    if( position && position->len / sequence->len != sizeof(INSDC_position_one) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "sequence and position");
-    }
-    if( q_left < 0 || (sequence && q_left > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip quality left and sequence");
-    }
-    if( q_right < 0 || (sequence && q_right > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip quality right and sequence");
-    }
-    if( a_left < 0 || (sequence && a_left > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip adapter left and sequence");
-    }
-    if( a_right < 0 || (sequence && a_right > sequence->len) ) {
-        rc = RC(rcSRA, rcFormatter, rcWriting, rcData, rcInconsistent);
-        LOGERR(klogErr, rc, "clip adapter right and sequence");
-    }
-    if( rc != 0 || (rc = SRAWriter_NewSpot(self->base, NULL)) != 0 ) {
-        return rc;
-    }
-    COL_WRITE(self->ci_name, "NAME", (*name));
-    COL_WRITE(self->ci_read, "READ", (*sequence));
-    COL_WRITE(self->ci_qual, "QUALITY", (*quality));
-    COL_WRITE(self->ci_signal, "SIGNAL", (*signal));
-    COL_WRITE(self->ci_position, "POSITION", (*position));
-
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_q_left, &q_left, sizeof(q_left), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_QUALITY_LEFT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_q_right, &q_right, sizeof(q_right), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_QUALITY_RIGHT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_a_left, &a_left, sizeof(a_left), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_ADAPTER_LEFT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteIdxColumn(self->base, self->ci_a_right, &a_right, sizeof(a_right), false)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=CLIP_ADAPTER_RIGHT"));
-        return rc;
-    }
-    if( (rc = SRAWriter_WriteSpotSegment(self->base, data_block_ref, NULL, sequence->len, sequence->data)) != 0 ) {
-        PLOGERR(klogErr, (klogErr, rc, "failed to write $(column) column", "column=SPOT_GROUP/READ_SEG"));
-        return rc;
-    }
-    return SRAWriter_CloseSpot(self->base);
-}
diff --git a/tools/sra-load/writer-ion-torrent.h b/tools/sra-load/writer-ion-torrent.h
deleted file mode 100644
index 004e443..0000000
--- a/tools/sra-load/writer-ion-torrent.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_writer_ion_torrent_
-#define _sra_load_writer_ion_torrent_
-
-#include "loader-fmt.h"
-#include "pstring.h"
-
-typedef struct SRAWriterIonTorrent SRAWriterIonTorrent;
-
-rc_t SRAWriterIonTorrent_Make(const SRAWriterIonTorrent** cself, const SRALoaderConfig* config);
-
-void SRAWriterIonTorrent_Whack(const SRAWriterIonTorrent* cself, SRATable** table);
-
-rc_t SRAWriterIonTorrent_WriteHead(const SRAWriterIonTorrent* cself, const pstring* flow_chars, const pstring* key_sequence);
-
-rc_t SRAWriterIonTorrent_WriteRead(const SRAWriterIonTorrent* cself, const SRALoaderFile* data_block_ref,
-                            const pstring* name, const pstring* sequence, const pstring* quality,
-                            const pstring* signal, const pstring* position,
-                            INSDC_coord_one q_left, INSDC_coord_one q_right,
-                            INSDC_coord_one a_left, INSDC_coord_one a_right);
-
-#endif /* _sra_load_writer_ion_torrent_ */
diff --git a/tools/sra-load/ztr-absolid.c b/tools/sra-load/ztr-absolid.c
deleted file mode 100644
index 8ef2e56..0000000
--- a/tools/sra-load/ztr-absolid.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#include "ztr-absolid.h"
-#include "debug.h"
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define BE2H16(X) (bswap_16(X))
-#define BE2H32(X) (bswap_32(X))
-#else
-#define BE2H16(X) (X)
-#define BE2H32(X) (X)
-#endif
-
-struct ZTR_Context {
-    int versMajor;
-    int versMinor;
-    size_t current, buflen;
-    const uint8_t *buf;
-};
-
-#define METANAME_COMP strcmp
-
-static size_t strendlen(const char *src, const char *end) {
-    size_t n = 0;
-    
-    while (*src && src != end) {
-        ++src;
-        ++n;
-    }
-    return n;
-}
-
-static int count_pairs(const char *src, uint32_t len) {
-    int i, j;
-    
-    for (j = i = 0; i != len; ++i) {
-        if (*src++ == 0)
-            ++j;
-    }
-    return j >> 1;
-}
-
-#if 0
-static const char *meta_getValueForName(const nvp_t *meta, int count, const char *name) {
-    int i;
-    
-    for (i = 0; i != count; ++i) {
-        if (meta[i].name != NULL && METANAME_COMP(meta[i].name, name) == 0)
-            return meta[i].value;
-    }
-    return NULL;
-}
-#endif
-
-static const char *meta_getValueForNameAndRemove(nvp_t *meta, int count, const char *name) {
-    int i;
-    
-    for (i = 0; i != count; ++i) {
-        if (meta[i].name != NULL && METANAME_COMP(meta[i].name, name) == 0) {
-            meta[i].name = NULL;
-            return meta[i].value;
-        }
-    }
-    return NULL;
-}
-
-static void parse_meta(nvp_t *meta, int count, const char *metadata, const char *end) {
-    int i, j;
-    
-    for (i = 0; i != count && metadata <= end; ++i) {
-        j = strendlen(metadata, end);
-        if (j == 0)
-            break;
-        meta[i].name = metadata;
-        metadata += j; ++metadata;
-        meta[i].value = metadata;
-        metadata += strendlen(metadata, end); ++metadata;
-    }
-}
-
-bool ABI_ZTR_BufferIsEmpty(const ZTR_Context *ctx) {
-	return (ctx->buf == NULL || ctx->buflen == 0 || ctx->current == ctx->buflen) ? true : false;
-}
-
-static int isZTRchunk(const uint8_t type[4]) {
-  static const char *types[] = {
-    "BASE",
-    "BPOS",
-    "CLIP",
-    "CNF1",
-    "CNF4",
-    "COMM",
-    "CR32",
-    "HUFF",
-    "REGN",
-    "SAMP",
-    "SMP4",
-    "TEXT"
-  };
-  int i;
-
-  for (i = 0; i != sizeof(types) / sizeof(types[0]); ++i)
-    if (*(const uint32_t *)type == *(const uint32_t *)types[i])
-      return 1;
-  
-  return 0;
-}
-
-rc_t ABI_ZTR_ParseBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw) {
-  assert(ctx);
-  assert(ztr_raw);
-    
-  memset(ztr_raw, 0, sizeof(*ztr_raw));
-	
-  if (ABI_ZTR_BufferIsEmpty(ctx))
-    return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcEmpty );
-	
-  if (ctx->current + 4 > ctx->buflen)
-    return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-
-  *(uint32_t *)(ztr_raw->type) = *(uint32_t *)(ctx->buf + ctx->current);
-  ctx->current += 4;
-  if (ctx->current + 4 >= ctx->buflen)
-    return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-  if (!isZTRchunk(ztr_raw->type))
-    return RC(rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt);
-
-  ztr_raw->metalength = BE2H32(*(uint32_t *)(ctx->buf + ctx->current));
-  ctx->current += 4;
-  if (ztr_raw->metalength != 0) {
-    if (ctx->current + ztr_raw->metalength > ctx->buflen)
-      return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-
-    ztr_raw->meta = ctx->buf + ctx->current;
-    ctx->current += ztr_raw->metalength;
-    if (memchr(ztr_raw->meta, 0, ztr_raw->metalength) == NULL)
-      return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-  }
-  if (ctx->current + 4 > ctx->buflen)
-    return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-
-  ztr_raw->datalength = BE2H32(*(uint32_t *)(ctx->buf + ctx->current));
-  ctx->current += 4;
-  if (ztr_raw->datalength != 0) {
-    if (ctx->current + ztr_raw->datalength > ctx->buflen)
-      return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-
-    ztr_raw->data = ctx->buf + ctx->current;
-    ctx->current += ztr_raw->datalength;
-  }
-  return 0;
-}
-
-#if ZTR_USE_EXTRA_META
-rc_t ABI_ZTR_ProcessBlock(ZTR_Context *ctx, const ztr_raw_t *ztr_raw, ztr_t *dst, enum ztr_chunk_type *chunkType, nvp_t **extraMeta, int *extraMetaCount)
-#else
-rc_t ABI_ZTR_ProcessBlock(ZTR_Context *ctx, const ztr_raw_t *ztr_raw, ztr_t *dst, enum ztr_chunk_type *chunkType)
-#endif
-{
-    rc_t rc;
-    const uint8_t *ptype;
-    uint8_t format;
-    size_t metasize, datasize;
-    const uint8_t *data;
-    const char *metadata;
-    int count;
-    enum ztr_chunk_type type;
-    enum ztr_data_type datatype = i8;
-    nvp_t *meta = NULL;
-    ztr_t ztr;
-	int padded = 0;
-
-    assert(ctx);
-    assert(ztr_raw);
-    assert(dst);
-    assert(chunkType);
-
-    *chunkType = none;
-    *(void **)dst = NULL;
-    *(void **)&ztr = NULL;
-
-    ptype = ztr_raw->type;
-    count = 0;
-    metasize = ztr_raw->metalength;
-    if (metasize != 0) {
-        metadata = (char *)ztr_raw->meta;
-        assert(metadata);
-        count = count_pairs(metadata, metasize);
-        if (count < 0)
-            return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-		if (count != 0) {
-			meta = malloc(sizeof(*meta) * count);
-			if (meta == NULL)
-				return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-
-			parse_meta(meta, count, metadata, metadata + metasize);
-		}
-		else
-			meta = NULL;
-    }
-    
-    if (memcmp(ptype, "BASE", 4) == 0) {
-        type = BASE;
-        datatype = i8;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "BPOS", 4) == 0) {
-        type = BPOS;
-        datatype = i32;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "CLIP", 4) == 0) {
-        type = CLIP;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "CNF1", 4) == 0) {
-        type = CNF1;
-        datatype = i8;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "CNF4", 4) == 0) {
-        type = CNF4;
-        datatype = i8;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "COMM", 4) == 0) {
-        type = COMM;
-    }
-    else if (memcmp(ptype, "CR32", 4) == 0) {
-        type = CR32;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "HUFF", 4) == 0) {
-        type = HUFF;
-    }
-    else if (memcmp(ptype, "REGN", 4) == 0) {
-        type = REGN;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "SAMP", 4) == 0) {
-        type = SAMP;
-        datatype = i16;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "SMP4", 4) == 0) {
-        type = SMP4;
-        datatype = i16v4;
-		padded = 1;
-    }
-    else if (memcmp(ptype, "TEXT", 4) == 0) {
-        type = TEXT;
-    }
-    else {
-        type = unknown;
-        DEBUG_MSG(1, ("$(func) - '$(type)' chunk unrecognized", "func=ZTR_ProcessBlock,type=%.*s\n", 4, & ztr_raw->type ));
-    }
-    {
-        metadata = meta_getValueForNameAndRemove(meta, count, "VALTYPE");
-        
-        if (metadata != NULL) {
-            if (strcmp(metadata, "16 bit integer") == 0)
-                datatype = i16;
-            else if (strcmp(metadata, "32 bit integer") == 0)
-                datatype = i32;
-            else if (strcmp(metadata, "32 bit IEEE float") == 0)
-                datatype = f32;
-            else if (strcmp(metadata, "64 bit IEEE float") == 0)
-                datatype = f64;
-        }
-    }
-    datasize = ztr_raw->datalength;
-    if (datasize == 0)
-        data = NULL;
-    else
-    {
-		static const char zero[8];
-		
-        data = ztr_raw->data;
-        assert(data);
-        format = *data;
-		switch (format) {
-			case 0:
-				if (padded) {
-					switch (datatype) {
-						case i16:
-						case i16v4:
-							if (memcmp(data, zero, 2) == 0)
-								padded = 2;
-							break;
-						case i32:
-						case f32:
-							if (memcmp(data, zero, 4) == 0)
-								padded = 4;
-							break;
-						case f64:
-							if (memcmp(data, zero, 8) == 0)
-								padded = 8;
-							break;
-						default:
-							break;
-					}
-					data += padded;
-					datasize -= padded;
-				}
-				else {
-					data += 1;
-					datasize -= 1;
-				}
-				break;
-			default:
-				rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected );
-				PLOGERR ( klogWarn, ( klogWarn, rc,
-                                                      "$(func) - '$(type)' unexpected ZTR chunk format '$(format)'",
-                                                      "func=ZTR_ProcessBlock,type=%.*s,format=%02X", 4,
-                                                      & ztr_raw->type, format ));
-				return rc;
-				break;
-		}
-    }
-	
-    switch (type) {
-        case BASE:
-            ztr.sequence = malloc(sizeof(*ztr.sequence));
-            if (ztr.sequence == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-
-            *chunkType = type;
-            ztr.sequence->datatype = datatype;
-            ztr.sequence->datasize = datasize;
-            ztr.sequence->charset = (char *)meta_getValueForNameAndRemove(meta, count, "CSET");
-            ztr.sequence->data = (uint8_t *)data;
-            break;
-        case BPOS:
-            ztr.position = malloc(sizeof(*ztr.position));
-            if (ztr.position == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            
-            *chunkType = type;
-            ztr.position->datatype = datatype;
-            ztr.position->datasize = datasize;
-            ztr.position->data = (uint8_t *)data;
-            break;
-        case CLIP:
-            ztr.clip = malloc(sizeof(ztr.clip));
-            if (ztr.clip == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            
-            *chunkType = type;
-            ztr.clip->left  = (((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3];
-            ztr.clip->right = (((((data[4] << 8) | data[5]) << 8) | data[6]) << 8) | data[7];
-            break;
-        case CNF1:
-            ztr.quality1 = malloc(sizeof(*ztr.quality1));
-            if (ztr.quality1 == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            
-            *chunkType = type;
-            ztr.quality1->datatype = datatype;
-            ztr.quality1->datasize = datasize;
-            if ((ztr.quality1->scale = (char *)meta_getValueForNameAndRemove(meta, count, "SCALE")) == NULL)
-                ztr.quality1->scale = "PH";
-            ztr.quality1->data = (uint8_t *)data;
-            break;
-        case CNF4:
-            metadata = meta_getValueForNameAndRemove(meta, count, "SCALE");
-            ztr.quality4 = malloc(sizeof(*ztr.quality4));
-            if (ztr.quality4 == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-
-            *chunkType = type;
-            ztr.quality4->datatype = datatype;
-            ztr.quality4->datasize = datasize;
-            if ((ztr.quality4->scale = (char *)meta_getValueForNameAndRemove(meta, count, "SCALE")) == NULL)
-                ztr.quality4->scale = "PH";
-            ztr.quality4->data = (uint8_t *)data;
-            break;
-        case COMM:
-            ztr.comment = malloc(sizeof(*ztr.comment) + datasize);
-            if (ztr.comment == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            *chunkType = type;
-            ztr.comment->size = datasize;
-            ztr.comment->text = (char *)data;
-            break;
-        case CR32:
-            *chunkType = ignore;
-#if 0
-            if (ctx->checksum != ((((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3]))
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-                PLOGERR (( klogErr, rc, "$(func) - checksum error", "func=ZTR_ProcessBlock" ));
-                return rc;
-            }
-            ctx->checksum = 0;
-#endif
-            break;
-        case HUFF:
-            *chunkType = ignore;
-            break;
-        case REGN:
-        {
-            int region_count;
-            int n;
-            
-            metadata = meta_getValueForNameAndRemove(meta, count, "NAME");
-            if (metadata) {
-                const char *cp;
-                
-                region_count = 1;
-                if (metadata[strlen(metadata) - 1] == ';')
-                    region_count = 0;
-                for (cp = metadata; (cp = strchr(cp, ';')) != NULL; ++cp)
-                    ++region_count;
-            }
-            else
-                region_count = 0;
-            ztr.region = NULL;
-            n = (size_t)(&ztr.region->region[region_count]) + (metadata ? (strlen(metadata) + 1) : 0);
-            ztr.region = malloc(n);
-            if (ztr.region == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-
-            *chunkType = type;
-            ztr.region->count = region_count;
-            if (region_count > 0) {
-                char *temp = (char *)&ztr.region->region[region_count];
-                int i, st;
-                
-                strcpy(temp, metadata);
-                for (i = st = 0; *temp != '\0'; ++temp) {
-                    switch (st) {
-                        case 0:
-                            if (!isspace(*temp)) {
-                                ztr.region->region[i].name = temp;
-                                ++st;
-                            }
-                            break;
-                        case 1:
-                            if (*temp == ':') {
-                                char *cp = temp - 1;
-                                
-                                while (isspace(*cp))
-                                    *cp-- = '\0';
-                                *temp = '\0';
-                                ++st;
-                            }
-                            break;
-                        case 2:
-                            if (!isspace(*temp)) {
-                                ztr.region->region[i].type = *temp;
-                                if (i == region_count - 1)
-                                    ztr.region->region[0].start = 0;
-                                else
-                                    switch (datatype) {
-                                        case i16:
-                                            ztr.region->region[i + 1].start = BE2H16(((const int16_t *)data)[i]);
-                                            break;
-                                        case i32:
-                                            ztr.region->region[i + 1].start = BE2H32(((const int32_t *)data)[i]);
-                                            break;
-                                        default:
-                                            break;
-                                    }
-                                ++i;
-                                ++st;
-                            }
-                            break;
-                        case 3:
-                            if (*temp == ';')
-                                st = 0;
-                            break;
-                    }
-                }
-            }
-        }
-            break;
-        case SAMP:
-            ztr.signal = malloc(sizeof(*ztr.signal));
-            if (ztr.signal == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            
-            *chunkType = type;
-            ztr.signal->datatype = datatype;
-            ztr.signal->datasize = datasize;
-			metadata = meta_getValueForNameAndRemove(meta, count, "OFFS");
-            ztr.signal->offset  = metadata == NULL ? 0 : strtol(metadata, NULL, 0);
-            ztr.signal->channel = (char *)meta_getValueForNameAndRemove(meta, count, "TYPE");
-            ztr.signal->data = (uint8_t *)data;
-            break;
-        case SMP4:
-            ztr.signal4 = malloc(sizeof(*ztr.signal4));
-            if (ztr.signal4 == NULL)
-                return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            
-            *chunkType = type;
-            ztr.signal4->datatype = datatype;
-            ztr.signal4->datasize = datasize;
-			metadata = meta_getValueForNameAndRemove(meta, count, "OFFS");
-            ztr.signal->offset  = metadata == NULL ? 0 : strtol(metadata, NULL, 0);
-            ztr.signal4->data = (uint8_t *)data;
-            break;
-#if ZTR_USE_TEXT_CHUNK
-        case TEXT:
-        {
-            int n;
-            const char *const end = (const char *)(data + datasize);
-            const char *cp;
-
-            for (cp = (const char *)data, n = 0; cp < end; ++n) {
-                size_t len = strendlen(cp, end);
-                
-                if (len == 0)
-                    break;
-                cp += len + 1;
-                len = strendlen(cp, end);
-                cp += len + 1;
-            }
-            if (n != 0) {
-                int i;
-
-                ztr.xmeta = malloc(sizeof(*ztr.xmeta) + (n - 1) * sizeof(nvp_t));
-                if (ztr.xmeta == NULL)
-                    return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                
-                *chunkType = type;
-                ztr.xmeta->count = n;
-                for (i = 0, cp = (const char *)data; i != n; ++i) {
-                    size_t len = strendlen(cp, end);
-                    
-                    if (len == 0)
-                        break;
-                    ztr.xmeta->data[i].name = cp;
-                    cp += len + 1;
-                    ztr.xmeta->data[i].value = cp;
-                    len = strendlen(cp, end);
-                    cp += len + 1;
-                }
-            }
-        }
-            break;
-#endif
-        default:
-            *chunkType = ignore;
-            break;
-    }
-    *dst = ztr;
-#if ZTR_USE_EXTRA_META
-    if (extraMeta != NULL && extraMetaCount != NULL) {
-        int i, j, k;
-        
-        for (k = j = i = 0; i != count; ++i)
-            if (meta[i].name != NULL) {
-                k += strlen(meta[i].name) + strlen(meta[i].value) + 2;
-                ++j;
-            }
-        *extraMetaCount = 0;
-        *extraMeta = NULL;
-        if (j > 0) {
-            *extraMeta = malloc(sizeof(nvp_t) * j + k);
-            if (*extraMeta != NULL) {
-                char *temp = (char *)(*extraMeta + j);
-                
-                for (j = i = 0; i != count; ++i)
-                    if (meta[i].name != NULL) {
-                        strcpy(temp, meta[i].name);
-                        (*extraMeta)[j].name = temp;
-                        temp += strlen(temp) + 1;
-                        strcpy(temp, meta[i].value);
-                        (*extraMeta)[j].value = temp;
-                        temp += strlen(temp) + 1;
-                    }
-            }
-        }
-    }
-#endif
-    if (meta != NULL)
-        free(meta);
-    return 0;
-}
-
-rc_t ABI_ZTR_CreateContext(ZTR_Context **ctx)
-{
-    assert(ctx);
-
-    if ((*ctx = malloc(sizeof(**ctx))) == NULL)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-
-    memset(*ctx, 0, sizeof(**ctx));
-    return 0;
-}
-
-rc_t ABI_ZTR_AddToBuffer(ZTR_Context *ctx, const uint8_t *data, uint32_t datasize) {
-    assert(ctx);
-	ctx->current = 0;
-	ctx->buf = data;
-	ctx->buflen = datasize;
-	return 0;
-}
-
-
-rc_t ABI_ZTR_ParseHeader(ZTR_Context *ctx) {
-    assert(ctx);
-    
-	if (ctx->current + 10 > ctx->buflen)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-
-    if (memcmp(ctx->buf + ctx->current, ZTR_SIG, 8) != 0)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-
-    if ((ctx->versMajor = ((uint8_t *)(ctx->buf + ctx->current))[8]) != 1)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcBadVersion );
-
-    ctx->versMinor = ((uint8_t *)(ctx->buf + ctx->current))[9];    
-	ctx->current += 10;
-    return 0;
-}
-
-rc_t ABI_ZTR_ContextRelease(ZTR_Context *self) {
-    if (self != NULL) {
-        free(self);
-    }
-    return 0;
-}
diff --git a/tools/sra-load/ztr-absolid.h b/tools/sra-load/ztr-absolid.h
deleted file mode 100644
index bfb1cc6..0000000
--- a/tools/sra-load/ztr-absolid.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_ztr_absolid_
-#define _sra_load_ztr_absolid_
-
-#include <klib/defs.h>
-
-#include "ztr.h"
-
-typedef struct ztr_raw_t {
-    uint8_t type[4];
-    size_t metalength, datalength;
-    const uint8_t *meta, *data;
-} ztr_raw_t;
-
-/* allocate and initialize a ZTR parser context
-caller is responsible to free resulting pointer
-
-return 1 if context can't be allocated,
-0 for no error.
-*/
-rc_t ABI_ZTR_CreateContext(ZTR_Context **ctx);
-
-/* add some bytes to context's input buffer
-   the caller is responsible for ensuring that
-   the pointer remains valid until the bytes
-   are consumed.  the caller is responsible for
-   free'ing it.  the context will simply forget
-   the bytes when it has consumed them all.
-
-   returns 1 if data can't be added to the buffer chain,
-   0 for no error.
-*/
-rc_t ABI_ZTR_AddToBuffer(ZTR_Context *ctx, const uint8_t *data, uint32_t datasize);
-
-bool ABI_ZTR_BufferIsEmpty(const ZTR_Context *ctx);
-
-/* parse a ZTR header from the input buffer
-returns 0 if no error, 1 otherwise
-*/
-rc_t ABI_ZTR_ParseHeader(ZTR_Context *ctx);
-
-/* parse a ZTR block from the input buffer
-    returns
-        0: no error
-        1: not valid ZTR
-        2: out of memory
-
-   the caller is responsible for free'ing ztr_raw->meta and
-   ztr_raw->data when it is no longer needed
-*/
-rc_t ABI_ZTR_ParseBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw);
-
-/* cook a ztr_raw_t to produce a ztr_t
-   sets defaults, processes meta data, etc.
-
-    returns
-        0: no error
-        1: not valid ZTR
-        2: out of memory
-
-Parameters:
-    ctx [in]: the context returned from ZTR_CreateContext
-    ztr_raw [in]: the structure filled in by ZTR_ParseBlock
-    ztr [out]: the resulting data object
-    chunkType [out]: how to interpret the data object
-    if chunkType is none or unknown, it is probably an error
-    if chunkType is ignore, then the chunk was valid and known
-    but of no interest to you, e.g. a huffman dictionary chunk
-    extraMeta [out optional]: any unprocessed name-value pairs
-    extraMetaCount [out optional]: the number of unprocessed name-value pairs
-
-    NB. ztr and its pointers refer to ztr_raw, so don't free
-    ztr_raw before you are done with ztr
-
-    ztr can be free'ed in one-fell-swoop
-    *extraMeta can be free'ed in one-fell-swoop
-*/
-#if ZTR_USE_EXTRA_META
-
-rc_t ABI_ZTR_ProcessBlock(ZTR_Context *ctx,
-                          const ztr_raw_t *ztr_raw,
-                          ztr_t *ztr,
-                          enum ztr_chunk_type *chunkType,
-                          nvp_t **extraMeta,
-                          int *extraMetaCount);
-
-#else
-
-rc_t ABI_ZTR_ProcessBlock(ZTR_Context *ctx,
-                          const ztr_raw_t *ztr_raw,
-                          ztr_t *ztr,
-                          enum ztr_chunk_type *chunkType);
-#endif
-
-/* free a context created by ZTR_CreateContext
-   do this when done processing the ZTR stream.
-*/
-rc_t ABI_ZTR_ContextRelease(ZTR_Context *ctx);
-
-#endif /* _sra_load_ztr_absolid_ */
diff --git a/tools/sra-load/ztr-huffman.c b/tools/sra-load/ztr-huffman.c
deleted file mode 100644
index b525807..0000000
--- a/tools/sra-load/ztr-huffman.c
+++ /dev/null
@@ -1,669 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <klib/sort.h>
-#include <klib/rc.h>
-
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <memory.h>
-#include <byteswap.h>
-#include <endian.h>
-
-#include <assert.h>
-#include <stdio.h>
-
-#include "ztr-huffman.h"
-
-typedef uint8_t *sym_t;
-
-struct decode_table_t {
-	int sig_bits;
-	bitsz_t sym_len;
-	sym_t symbol;
-	decode_table_t *next;
-};
-
-static void assign(uint8_t *dst, const uint16_t code[32], int len) {
-	len = (len + 7) >> 3;
-	
-	while (len--)
-		*dst++ = *code++;
-}
-
-static void inc(uint16_t code[32], int len) {
-	int c;
-	
-	--len;
-	code[len >> 3] += 0x80 >> (len & 7);
-	len >>= 3;
-	c = code[len] >> 8;
-	while (len && c) {
-		code[len] &= 0xFF;
-		--len;
-		++code[len];
-		c = code[len] >> 8;
-	}
-}
-
-struct index_t {
-	uint16_t i, len;
-};
-
-static int idx_cmp(const void *A, const void *B, void * ignored) {
-	const struct index_t *a = A;
-	const struct index_t *b = B;
-	
-	if (a->len < b->len)
-		return -1;
-	if (a->len > b->len)
-		return 1;
-	if (a->i < b->i)
-		return -1;
-	if (a->i > b->i)
-		return 1;
-	return 0;
-}
-
-#if 0
-static void huffman_codes(uint8_t **codes, const uint8_t length[256]) {
-	struct index_t idx[256];
-	size_t total_len;
-	int i;
-	uint16_t code[32];
-	uint8_t *cp = (uint8_t *)&codes[256];
-	
-	for (total_len = 0, i = 0; i != 256; ++i) {
-		total_len += ((idx[i].len = length[i]) + 7) >> 3;
-		idx[i].i = i;
-	}
-	ksort(idx, 256, sizeof(*idx), idx_cmp, NULL);
-	for (i = 0; i != 256 && idx[i].len == 0; ++i)
-		;
-	memset(code, 0, 32);
-	for ( ; i != 256; ++i) {
-		uint16_t j = idx[i].i, n = idx[i].len;
-		codes[j] = cp;
-		assign(cp, code, n);
-		inc(code, n);
-		cp += (n + 7) >> 3;
-	}
-}
-#endif
-
-static void huffman_codes257(uint8_t **codes, const uint8_t length[257]) {
-	struct index_t idx[257];
-	size_t total_len;
-	int i;
-	uint16_t code[32];
-	uint8_t *cp = (uint8_t *)&codes[257];
-	
-	for (total_len = 0, i = 0; i != 257; ++i) {
-		total_len += ((idx[i].len = length[i]) + 7) >> 3;
-		idx[i].i = i;
-	}
-	ksort(idx, 257, sizeof(*idx), idx_cmp, NULL);
-	for (i = 0; i != 257 && idx[i].len == 0; ++i)
-		;
-	memset(code, 0, 32);
-	for ( ; i != 257; ++i) {
-		uint16_t j = idx[i].i, n = idx[i].len;
-		codes[j] = cp;
-		assign(cp, code, n);
-		inc(code, n);
-		cp += (n + 7) >> 3;
-	}
-}
-
-static void huffman_codes19(uint8_t **codes, const uint8_t length[19]) {
-	struct index_t idx[19];
-	size_t total_len;
-	int i;
-	uint16_t code[32];
-	uint8_t *cp = (uint8_t *)&codes[19];
-	
-	for (total_len = 0, i = 0; i != 19; ++i) {
-		total_len += ((idx[i].len = length[i]) + 7) >> 3;
-		idx[i].i = i;
-	}
-	ksort(idx, 19, sizeof(*idx), idx_cmp, NULL);
-	for (i = 0; i != 19 && idx[i].len == 0; ++i)
-		;
-	memset(code, 0, 32);
-	for ( ; i != 19; ++i) {
-		uint8_t j = idx[i].i, n = idx[i].len;
-		codes[j] = cp;
-		assign(cp, code, n);
-		inc(code, n);
-		cp += (n + 7) >> 3;
-	}
-}
-
-static uint16_t get_bits1(const uint8_t *data, int *bp, int bc) {
-	uint16_t val = *(uint16_t *)(data + (*bp >> 3));
-	
-#if __BYTE_ORDER == __BIG_ENDIAN
-	val = bswap_16(val);
-#endif
-	val >>= *bp & 0x07;
-	val &= (1 << bc) - 1;
-	*bp += bc;
-	return val;
-}
-
-static uint32_t get_bits4(const uint8_t *data, int *bp, int bc) {
-	uint32_t val = *(uint32_t *)(data + (*bp >> 3));
-	
-#if __BYTE_ORDER == __BIG_ENDIAN
-	val = bswap_32(val);
-#endif
-	val >>= *bp & 0x07;
-	val &= (1L << bc) - 1;
-	*bp += bc;
-	return val;
-}
-
-#if 0
-static int get_bits(const uint8_t *data, int *bp, int bc) {
-	uint32_t val = get_bits4(data, bp, bc);
-
-	fprintf(stderr, "%02X/%u\n", val, bc);
-	return val;
-}
-#else
-#define get_bits get_bits4
-#endif
-
-static rc_t build_table(
-						decode_table_t *tbl,
-						uint8_t *pcode,
-						bitsz_t len,
-						const sym_t sym,
-						bitsz_t sym_len
-) {
-	int i, code = *pcode, mask;
-	static const uint8_t rev[] = 
-		"\x00\x80\x40\xc0\x20\xa0\x60\xe0\x10\x90\x50\xd0\x30\xb0\x70\xf0"
-		"\x08\x88\x48\xc8\x28\xa8\x68\xe8\x18\x98\x58\xd8\x38\xb8\x78\xf8"
-		"\x04\x84\x44\xc4\x24\xa4\x64\xe4\x14\x94\x54\xd4\x34\xb4\x74\xf4"
-		"\x0c\x8c\x4c\xcc\x2c\xac\x6c\xec\x1c\x9c\x5c\xdc\x3c\xbc\x7c\xfc"
-		"\x02\x82\x42\xc2\x22\xa2\x62\xe2\x12\x92\x52\xd2\x32\xb2\x72\xf2"
-		"\x0a\x8a\x4a\xca\x2a\xaa\x6a\xea\x1a\x9a\x5a\xda\x3a\xba\x7a\xfa"
-		"\x06\x86\x46\xc6\x26\xa6\x66\xe6\x16\x96\x56\xd6\x36\xb6\x76\xf6"
-		"\x0e\x8e\x4e\xce\x2e\xae\x6e\xee\x1e\x9e\x5e\xde\x3e\xbe\x7e\xfe"
-		"\x01\x81\x41\xc1\x21\xa1\x61\xe1\x11\x91\x51\xd1\x31\xb1\x71\xf1"
-		"\x09\x89\x49\xc9\x29\xa9\x69\xe9\x19\x99\x59\xd9\x39\xb9\x79\xf9"
-		"\x05\x85\x45\xc5\x25\xa5\x65\xe5\x15\x95\x55\xd5\x35\xb5\x75\xf5"
-		"\x0d\x8d\x4d\xcd\x2d\xad\x6d\xed\x1d\x9d\x5d\xdd\x3d\xbd\x7d\xfd"
-		"\x03\x83\x43\xc3\x23\xa3\x63\xe3\x13\x93\x53\xd3\x33\xb3\x73\xf3"
-		"\x0b\x8b\x4b\xcb\x2b\xab\x6b\xeb\x1b\x9b\x5b\xdb\x3b\xbb\x7b\xfb"
-		"\x07\x87\x47\xc7\x27\xa7\x67\xe7\x17\x97\x57\xd7\x37\xb7\x77\xf7"
-		"\x0f\x8f\x4f\xcf\x2f\xaf\x6f\xef\x1f\x9f\x5f\xdf\x3f\xbf\x7f\xff";
-	
-	if (len > 8) {
-		int j = rev[code];
-		
-		if (tbl[j].next == NULL)
-			tbl[j].next = calloc(256, sizeof(decode_table_t));
-		if (tbl[j].next == NULL)
-			return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-		
-		tbl[j].sig_bits = 8;
-		return build_table(tbl[j].next, pcode + 1, len - 8, sym, sym_len);
-	}
-	code &= (mask = (0xFF00 >> len) & 0xFF);
-	for (i = code; i != 256; ++i) {
-		int j = rev[i];
-		
-		if ((i & mask) != code)
-			break;
-		assert(tbl[j].sig_bits == 0);
-		tbl[j].sym_len = sym ? sym_len : 1;
-		tbl[j].symbol = sym;
-		tbl[j].sig_bits = len;
-	}
-	return 0;
-}
-
-static void	fixup_table(decode_table_t *dt, decode_table_t *root) {
-	int i;
-	
-	for (i = 0; i != 256; ++i) {
-		if (dt[i].next)
-			fixup_table(dt[i].next, root);
-		else
-			dt[i].next = root;
-	}
-}
-
-static void free_table(decode_table_t *dt, decode_table_t *root) {
-	int i;
-	
-	for (i = 0; i != 256; ++i) {
-		if (dt[i].next && dt[i].next != root)
-			free_table(dt[i].next, root);
-	}
-	free(dt);
-}
-
-
-static const uint8_t symbols[290] = 
-	"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-	"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-	"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-	"\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-	"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-	"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
-	"\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
-	"\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
-	"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-	"\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-	"\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-	"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-	"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-	"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
-	"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-	"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
-
-static void decode_zlib_length_codes(uint8_t *length, const uint8_t *data, int *bp, size_t datasize) {
-	uint8_t length19[19];
-	int llc, dc, clc;
-	uint8_t storage19[19 * sizeof(uint8_t *) + 19 * 32];
-	uint8_t **codes19;
-	decode_table_t dt1[256];
-	static const uint8_t ndx[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
-	int i, n;
-	int bits = datasize << 3;
-	
-	codes19 = (uint8_t **)storage19;
-	memset(length19, 0, sizeof(length19));
-	memset(storage19, 0, sizeof(storage19));
-	
-	llc = get_bits1(data, bp, 5) + 257;
-	dc  = get_bits1(data, bp, 5) + 1;
-	clc = get_bits1(data, bp, 4) + 4;
-
-	for (i = 0; i != clc; ++i)
-		length19[ndx[i]] = get_bits(data, bp, 3);
-
-	huffman_codes19(codes19, length19);
-	memset(dt1, 0, sizeof(dt1));
-	for (i = 0; i != 19; ++i) {
-		if (codes19[i] != NULL)
-			build_table(dt1, codes19[i], length19[i], (sym_t)(symbols + i), 8);
-	}
-	fixup_table(dt1, dt1);
-	i = 0;
-	while (bits > *bp) {
-		uint8_t code;
-		const decode_table_t *cp;
-		int bc = 8;
-		
-		if (bits - *bp < 8)
-			bc = bits - *bp;
-		code = get_bits1(data, bp, bc);
-		cp = dt1 + code;
-		/* fprintf(stderr, "%02X/%u\n", code & ((1L << cp->sig_bits) - 1), cp->sig_bits); */
-		*bp -= bc - cp->sig_bits;
-
-		switch (cp->symbol[0]) {
-			case 16:
-				n = get_bits1(data, bp, 2) + 3;
-				memset(length + i, length[i - 1], n);
-				i += n;
-				break;
-			case 17:
-				n = get_bits1(data, bp, 3) + 3;
-				memset(length + i, 0, n);
-				i += n;
-				break;
-			case 18:
-				n = get_bits1(data, bp, 7) + 11;
-				memset(length + i, 0, n);
-				i += n;
-				break;
-			default:
-				length[i++] = cp->symbol[0];
-				break;
-		}
-		if (i >= llc)
-			break;
-	}
-	assert(i == llc);
-	i = 0;
-	while (bits > *bp) {
-		uint8_t code;
-		const decode_table_t *cp;
-		int bc = 8;
-		
-		if (bits - *bp < 8)
-			bc = bits - *bp;
-		code = get_bits1(data, bp, bc);
-		cp = dt1 + code;
-		/* fprintf(stderr, "%02X/%u\n", code & ((1L << cp->sig_bits) - 1), cp->sig_bits); */
-		*bp -= bc - cp->sig_bits;
-		
-		switch (cp->symbol[0]) {
-			case 16:
-				n = get_bits1(data, bp, 2) + 3;
-				i += n;
-				break;
-			case 17:
-				n = get_bits1(data, bp, 3) + 3;
-				i += n;
-				break;
-			case 18:
-				n = get_bits1(data, bp, 7) + 11;
-				i += n;
-				break;
-			default:
-				++i;
-				break;
-		}
-		if (i >= dc)
-			break;
-	}
-	assert(i == dc);
-}
-
-rc_t handle_huffman_codes(ztr_huffman_table *y, const uint8_t *data, size_t datasize) {
-	int bc = 0;
-	int i, j;
-	uint8_t storage[257 * sizeof(uint8_t *) + 257 * 32];
-	uint8_t **codes;
-
-	codes = (uint8_t **)storage;
-	
-	get_bits1(data, &bc, 1);
-	
-	switch (get_bits1(data, &bc, 2)) {
-		default:
-			return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-		case 2:
-			y->tblcnt = 1;
-			break;
-		case 3:
-			y->tblcnt = get_bits(data, &bc, get_bits1(data, &bc, 4) + 1) + 1;
-			break;
-	}
-	y->tbl = calloc(y->tblcnt, sizeof(*y->tbl));
-	for (i = 0; i != y->tblcnt; ++i) {
-		uint8_t length[289];
-		
-		memset(length, 0, sizeof(length));
-		memset(storage, 0, sizeof(storage));
-		decode_zlib_length_codes(length, data, &bc, datasize);
-		huffman_codes257(codes, length);
-		y->tbl[i] = calloc(257, sizeof(decode_table_t));
-		for (j = 0; j != 256; ++j) {
-			if (codes[j] != NULL)
-				build_table(y->tbl[i], codes[j], length[j], (sym_t)(symbols + j), 8);
-		}
-		if (codes[256] != NULL)
-			build_table(y->tbl[i], codes[256], length[256], (sym_t)0, 0);
-	}
-	y->bits_left = (datasize << 3) - bc;
-	
-	return 0;
-}
-
-rc_t handle_special_huffman_codes(ztr_huffman_table *y, int which_one) {
-	typedef uint8_t length_array[257];
-	
-	static const length_array special0 = 
-        {
-            5, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 2, 14, 2, 14, 14, 14, 3, 14, 14, 14, 14, 14, 14, 4, 14, 
-            14, 14, 14, 14, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
-            6
-        };
-	static const length_array special1 = 
-        {
-            7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 2, 8, 2, 8, 15, 15, 3, 8, 15, 15, 8, 15, 8, 4, 15, 
-            15, 15, 8, 8, 2, 15, 8, 8, 15, 8, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            11
-        };
-	static const length_array special2 = 
-        {
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 15, 15, 6, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            3, 11, 8, 15, 15, 15, 15, 10, 15, 15, 15, 15, 6, 9, 7, 15, 
-            11, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 15, 15, 15, 10, 
-            15, 9, 10, 10, 15, 10, 11, 11, 10, 8, 15, 15, 15, 10, 9, 15, 
-            15, 15, 15, 10, 9, 15, 15, 10, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 4, 7, 6, 5, 3, 6, 6, 5, 4, 15, 8, 5, 6, 4, 4, 
-            6, 15, 5, 4, 4, 5, 7, 6, 10, 6, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 
-            15
-        };
-	int i, j;
-	uint8_t storage[257 * sizeof(uint8_t *) + 257 * 32];
-	uint8_t **codes;
-	const uint8_t *special;
-    
-	codes = (uint8_t **)storage;
-	
-	switch (which_one) {
-	case 0:
-		special = special0;
-		break;
-	case 1:
-		special = special1;
-		break;
-	case 2:
-		special = special2;
-		break;
-	default:
-		assert (which_one >= 0 && which_one < 3);
-        return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-	}
-
-	if (y->tbl)
-        return 0;
-	y->tbl = calloc(y->tblcnt, sizeof(*y->tbl));
-    y->tblcnt = 1;
-    
-	for (i = 0; i != y->tblcnt; ++i) {
-		memset(storage, 0, sizeof(storage));
-		huffman_codes257(codes, special);
-		y->tbl[i] = calloc(257, sizeof(decode_table_t));
-		for (j = 0; j != 256; ++j) {
-			if (codes[j] != NULL)
-				build_table(y->tbl[i], codes[j], special[j], (sym_t)(symbols + j), 8);
-		}
-		if (codes[256] != NULL)
-			build_table(y->tbl[i], codes[256], special[256], (sym_t)0, 0);
-	}
-	y->bits_left = 0;
-	
-	return 0;
-}
-
-rc_t decompress_huffman(const ztr_huffman_table *tbl, uint8_t **Data, size_t *datasize) {
-#if 0
-	const uint8_t *src = *Data;
-	size_t srclen = *datasize, dstlen = 0;
-	size_t sbits, dalloc;
-	uint8_t *dst, *Dst;
-	int bp, tblNo = 0, n = tbl->tblcnt;
-	const decode_table_t *cp = tbl->tbl[0];
-    
-    bp =  8 - tbl->bits_left;
-	src += 2; srclen -= 2;
-    
-	Dst = dst = malloc(dalloc = srclen << 1);
-	if (Dst != NULL) {
-		sbits = srclen << 3;
-		while (sbits) {
-			uint8_t code;
-			int bc = 8;
-			
-			if (sbits < 8)
-				bc = sbits;
-			code = get_bits1(src, &bp, bc);
-			cp += code;
-            
-			bp -= bc - cp->sig_bits;
-			sbits -= cp->sig_bits;
-			src += bp >> 3;
-			bp &= 7;
-			
-			if (cp->symbol == NULL) {
-				if (cp->next == NULL) {
-					break;
-                }
-			}
-			else {
-				if (++dstlen == dalloc) {
-					void *temp;
-					
-					temp = realloc(Dst, dalloc <<= 1);
-					if (temp == NULL)
-						goto NoMem;
-					
-					Dst = temp;
-					dst = Dst + dstlen - 1;
-				}
-				tblNo = (tblNo + 1) % n;
-				*dst++ = *cp->symbol;
-			}
-			cp = cp->next;
-			if (cp == NULL)
-				cp = tbl->tbl[tblNo];
-		}
-		free((void *)*Data);
-		*Data = Dst;
-		*datasize = dstlen;
-		return 0;
-	}
-#else
-	const uint8_t *src = *Data;
-	size_t srclen = *datasize, dstlen = 0;
-	const uint8_t *endp = src + srclen;
-	size_t dalloc;
-	uint8_t *dst, *Dst;
-	int tblNo = 0, n = tbl->tblcnt;
-	const decode_table_t *cp = tbl->tbl[0];
-    uint16_t code;
-    int bits = tbl->bits_left;
-    
-	src += 2; srclen -= 2;
-    code = (*src++) >> (8 - bits);
-    
-	Dst = dst = malloc(dalloc = srclen << 2);
-	if (Dst != NULL) {
-		while (src != endp) {
-            if (bits < 8) {
-                code |= ((uint16_t)(*src++)) << bits;
-                bits += 8;
-            }
-        PROCESS_BITS:
-			cp += code & 0xFF;
-            
-            bits -= cp->sig_bits;
-            code >>= cp->sig_bits;
-            
-			if (cp->symbol == NULL) {
-                cp = cp->next;
-                if (cp)
-                    continue;
-                assert(src == endp && bits < 8);
-                bits = 0;
-                break;
-			}
-            if (++dstlen == dalloc) {
-                void *temp;
-                
-                temp = realloc(Dst, dalloc <<= 1);
-                if (temp == NULL)
-                    goto NoMem;
-                
-                Dst = temp;
-                dst = Dst + dstlen - 1;
-            }
-            *dst++ = *cp->symbol;
-            tblNo = (tblNo + 1) % n;
-			cp = tbl->tbl[tblNo];
-		}
-        if (bits)
-            goto PROCESS_BITS;
-		free((void *)*Data);
-		*Data = Dst;
-		*datasize = dstlen;
-		return 0;
-	}
-#endif
-NoMem:
-	free((void *)*Data);
-	*Data = NULL;
-	*datasize = 0;
-	return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-}
-
-rc_t free_huffman_table(ztr_huffman_table *tbl) {
-    int i;
-    
-    for (i = 0; i != tbl->tblcnt; ++i) {
-        free_table(tbl->tbl[i], tbl->tbl[i]);
-    }
-    free(tbl->tbl);
-    return 0;
-}
diff --git a/tools/sra-load/ztr-huffman.h b/tools/sra-load/ztr-huffman.h
deleted file mode 100644
index 3da48b4..0000000
--- a/tools/sra-load/ztr-huffman.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_ztr_huffman_
-#define _sra_load_ztr_huffman_
-
-typedef struct decode_table_t decode_table_t;
-
-typedef struct ztr_huffman_table {
-    int bits_left;
-    int tblcnt;
-    decode_table_t **tbl;
-} ztr_huffman_table;
-
-rc_t handle_huffman_codes(ztr_huffman_table *tbl, const uint8_t *data, size_t datasize);
-
-rc_t handle_special_huffman_codes(ztr_huffman_table *y, int which_one);
-
-rc_t decompress_huffman(const ztr_huffman_table *tbl, uint8_t **Data, size_t *datasize);
-
-rc_t free_huffman_table(ztr_huffman_table *);
-
-#endif /* _sra_load_ztr_huffman_ */
diff --git a/tools/sra-load/ztr-illumina.c b/tools/sra-load/ztr-illumina.c
deleted file mode 100644
index 99cdaf1..0000000
--- a/tools/sra-load/ztr-illumina.c
+++ /dev/null
@@ -1,1367 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <os-native.h>
-
-#include <stdlib.h>
-
-#include <string.h>
-#include <ctype.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-
-#include "ztr-illumina.h"
-#include "ztr-huffman.h"
-#include "debug.h"
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-
-#define ltoh16(X) (X)
-#define ltoh32(X) (X)
-
-#define btoh16(X) (bswap_16(X))
-#define btoh32(X) (bswap_32(X))
-
-#else
-
-#define ltoh16(X) (bswap_16(X))
-#define ltoh32(X) (bswap_32(X))
-
-#define btoh16(X) (X)
-#define btoh32(X) (X)
-
-#endif
-
-struct ZTR_Context {
-    int versMajor;
-    int versMinor;
-    uint32_t checksum;
-    ztr_huffman_table huffman_table[128], special[3];
-    size_t current, buflen[2];
-    const uint8_t *buf[2];
-};
-
-static int ztr_read(ZTR_Context *ctx, void *Dst, size_t n) {
-    char *dst = Dst;
-    size_t i, j = 0;
-    
-    assert(ctx);
-    do {
-        if (n == 0 || ctx->buf[0] == NULL)
-            break;
-        i = ctx->buflen[0] - ctx->current;
-        if (i > n)
-            i = n;
-        memcpy(dst + j, ctx->buf[0] + ctx->current, i);
-        ctx->current += i;
-        n -= i;
-        j += i;
-        if (ctx->current == ctx->buflen[0]) {
-            ctx->current = 0;
-            ctx->buflen[0] = ctx->buflen[1];
-            ctx->buf[0] = ctx->buf[1];
-            ctx->buflen[1] = 0;
-            ctx->buf[1] = NULL;
-        }
-    } while (1);
-
-    return j;
-}
-
-#define METANAME_COMP strcmp
-
-static size_t strendlen(const char *src, const char *end) {
-    size_t n = 0;
-    
-    while (*src && src != end) {
-        ++src;
-        ++n;
-    }
-    return n;
-}
-
-static int count_pairs(const char *src, uint32_t len) {
-    int i, j;
-    
-    for (j = i = 0; i != len; ++i) {
-        if (*src++ == 0)
-            ++j;
-    }
-    return (j % 2 == 0) ? (j >> 1) : 0;
-}
-
-#if 0
-static const char *meta_getValueForName(const nvp_t *meta, int count, const char *name) {
-    int i;
-    
-    for (i = 0; i != count; ++i) {
-        if (meta[i].name != NULL && METANAME_COMP(meta[i].name, name) == 0)
-            return meta[i].value;
-    }
-    return NULL;
-}
-#endif
-
-static const char *meta_getValueForNameAndRemove(nvp_t *meta, int count, const char *name) {
-    int i;
-    
-    for (i = 0; i != count; ++i) {
-        if (meta[i].name != NULL && METANAME_COMP(meta[i].name, name) == 0) {
-            meta[i].name = NULL;
-            return meta[i].value;
-        }
-    }
-    return NULL;
-}
-
-static void parse_meta(nvp_t *meta, int count, const char *metadata, const char *end) {
-    int i, j;
-    
-    for (i = 0; i != count && metadata <= end; ++i) {
-        j = strendlen(metadata, end);
-        if (j == 0)
-            break;
-        meta[i].name = metadata;
-        metadata += j; ++metadata;
-        meta[i].value = metadata;
-        metadata += strendlen(metadata, end); ++metadata;
-    }
-}
-
-bool ILL_ZTR_BufferIsEmpty(const ZTR_Context *ctx) {
-	return (ctx->buf[0] == NULL || ctx->buflen[0] == 0) ? true : false;
-}
-
-static int isZTRchunk(const uint8_t type[4]) {
-    static const char *types[] = {
-        "BASE",
-        "BPOS",
-        "CLIP",
-        "CNF1",
-        "CNF4",
-        "COMM",
-        "CR32",
-        "HUFF",
-        "REGN",
-        "SAMP",
-        "SMP4",
-        "TEXT"
-    };
-    int i;
-    
-    for (i = 0; i != sizeof(types) / sizeof(types[0]); ++i)
-        if (*(const uint32_t *)type == *(const uint32_t *)types[i])
-            return 1;
-    
-    return 0;
-}
-
-static rc_t parse_block(ZTR_Context *ctx, ztr_raw_t *ztr_raw) {
-    if (ztr_read(ctx, &ztr_raw->type, 4) != 4)
-        return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    
-    if (!isZTRchunk(ztr_raw->type))
-        return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-    
-    if (ztr_read(ctx, &ztr_raw->metalength, 4) != 4)
-        return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    
-    if (ztr_raw->metalength != 0) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        ztr_raw->metalength = bswap_32(ztr_raw->metalength);
-#endif
-        ztr_raw->meta = malloc(ztr_raw->metalength);
-
-        if (ztr_raw->meta == NULL)
-            return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-
-        if (ztr_read(ctx, ztr_raw->meta, ztr_raw->metalength) != ztr_raw->metalength)
-            return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    }
-    
-    if (ztr_read(ctx, &ztr_raw->datalength, 4) != 4)
-        return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    
-    if (ztr_raw->datalength != 0) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-        ztr_raw->datalength = bswap_32(ztr_raw->datalength);
-#endif
-        ztr_raw->data = malloc(ztr_raw->datalength+1); /*** overallocating  **/
-
-        if (ztr_raw->data == NULL)
-            return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-
-        if (ztr_read(ctx, ztr_raw->data, ztr_raw->datalength) != ztr_raw->datalength)
-            return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient);
-    }
-    
-    return 0;
-}
-
-rc_t ILL_ZTR_ParseBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw)
-{
-    rc_t rc = 0;
-    uint32_t current, len[2];
-    const uint8_t *buf[2];
-    
-    assert(ctx);
-    assert(ztr_raw);
-    
-    memset(ztr_raw, 0, sizeof(*ztr_raw));
-	
-	if (ctx->buf[0] == NULL || ctx->buflen[0] == 0 || ctx->current == ctx->buflen[0] + ctx->buflen[1])
-		return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcEmpty );
-	
-    /* save input buffer state for restoration upon error exit */
-    current = ctx->current;
-    len[0] = ctx->buflen[0];
-    len[1] = ctx->buflen[1];
-    buf[0] = ctx->buf[0];
-    buf[1] = ctx->buf[1];
-    
-    rc = parse_block(ctx, ztr_raw);
-    if (rc) {
-        /* clean up and restore buffer state */
-        if (ztr_raw->data)
-            free (ztr_raw->data);
-        if (ztr_raw->meta)
-            free (ztr_raw->meta);
-        
-        ctx->current = current;
-        ctx->buflen[0] = len[0];
-        ctx->buflen[1] = len[1];
-        ctx->buf[0] = buf[0];
-        ctx->buf[1] = buf[1];
-    }
-    return rc;
-}
-
-static rc_t undo_mode_4(uint8_t **Data, size_t *datasize) {
-	const uint8_t *src = *Data, *end;
-	size_t srclen = *datasize, dstlen = 0;
-	size_t dalloc;
-	uint8_t *dst, *Dst;
-	uint8_t dup = 0;
-	uint8_t esize;
-	rc_t rc = 0;
-	int st = 0;
-	int i;
-	
-	esize = src[1];
-	if (esize < 1 || srclen % esize != 0) {
-		rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-        return rc;
-    }
-    if (esize > 2) {
-        src += esize; srclen -= esize;
-    }
-    else {
-        src += 2; srclen -= 2;
-        if (srclen == 0) {
-            rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-            return rc;
-        }
-    }
-    Dst = dst = malloc(dalloc = srclen << 4);
-    if (Dst == NULL) {
-        rc = RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-        return rc;
-    }
-
-    end = src + srclen;
-    while (src != end) {
-        size_t out = esize;
-        
-        if (st == 2)
-            out *= (dup = *src);
-        if ((dstlen += out) >= dalloc) {
-            void *temp;
-            size_t n = dst - Dst;
-            
-            while (dalloc < dstlen)
-                dalloc <<= 1;
-            temp = realloc(Dst, dalloc);
-            if (temp == NULL) {
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-                break;
-            }
-            Dst = temp;
-            dst = Dst + n;
-        }
-        switch (st) {
-            case 0:
-                st = 1;
-                memcpy(dst, src, esize);
-                break;
-            case 1:
-                if (memcmp(dst, src, esize) == 0)
-                    st = 2;
-                dst += esize;
-                memcpy(dst, src, esize);
-                break;
-            case 2:
-                st = 0;
-                dst += esize;
-                for (i = 0; i != dup; ++i) {
-                    memcpy(dst, src - esize, esize);
-                    dst += esize;
-                }
-                break;
-        }
-        src += esize;
-    }
-
-	free((void *)*Data);
-	*Data = Dst;
-	*datasize = dstlen;
-	return rc;
-}
-
-static rc_t undo_mode_79(uint8_t **Data, size_t *datasize) {
-    uint8_t scratch[4 * 1024];
-	const uint8_t *src = *Data;
-	size_t srclen = *datasize;
-	uint8_t *dst0, *dst1, *Dst;
-	rc_t rc = 0;
-	int i, j, k, n;
-
-	if (srclen == 0) {
-		rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-        return rc;
-    }
-    assert(srclen % 4 == 0);
-    assert(srclen < sizeof(scratch));
-    
-    Dst = *Data;
-    Dst[0] = 0;
-    n = (srclen >> 2) - 1;
-    dst0 = scratch;
-    dst1 = dst0 + n;
-    src += 4;
-    for (k = i = j = 0; i != n; ++i, k += 3, j += 4) {
-        dst0[i + 0] = src[j + 0];
-        dst1[k + 0] = src[j + 1];
-        dst1[k + 1] = src[j + 2];
-        dst1[k + 2] = src[j + 3];
-    }
-
-    memcpy(Dst + 1, scratch, n << 2);
-	*Data = Dst;
-	*datasize = (n << 2) + 1;
-	return rc;
-}
-
-#if 0
-static rc_t undo_mode_80(uint8_t **Data, size_t *datasize, const uint8_t *sequence, size_t basecount) {
-	uint16_t temp[4 * 1024];
-	uint16_t *A = temp;
-	uint16_t *C = A + basecount;
-	uint16_t *G = C + basecount;
-	uint16_t *T = G + basecount;
-	uint8_t *dst;
-	int i, n;
-	const uint16_t *u;
-
-	assert(basecount < 1024);
-	dst = *Data;
-	*dst = 0;
-	u = (const uint16_t *)(dst + 8);
-	for (n = basecount, i = 0; i != n; ++i, u += 4) {
-		switch (sequence[i]) {
-			default:
-			case 'A':
-			case 'a':
-				A[i] = btoh16(u[0]);
-				C[i] = btoh16(u[1]);
-				G[i] = btoh16(u[2]);
-				T[i] = btoh16(u[3]);
-				break;					
-			case 'C':
-			case 'c':
-				C[i] = btoh16(u[0]);
-				A[i] = btoh16(u[1]);
-				G[i] = btoh16(u[2]);
-				T[i] = btoh16(u[3]);
-				break;					
-			case 'G':
-			case 'g':
-				G[i] = btoh16(u[0]);
-				A[i] = btoh16(u[1]);
-				C[i] = btoh16(u[2]);
-				T[i] = btoh16(u[3]);
-				break;					
-			case 'T':
-			case 't':
-				T[i] = btoh16(u[0]);
-				A[i] = btoh16(u[1]);
-				C[i] = btoh16(u[2]);
-				G[i] = btoh16(u[3]);
-				break;
-		}
-	}
-	memcpy(dst + 2, temp, 8 * basecount);
-	*datasize = 2 + 8 * basecount;
-	return 0;
-}
-#else
-static rc_t undo_mode_80(uint8_t **Data, size_t *datasize, const uint8_t *sequence, size_t basecount, long offset) {
-	const uint16_t *u = (const uint16_t *)(*Data + 8);
-	int i;
-    float *Dst = malloc(sizeof(Dst[0]) * 4 * basecount);
-    float *dst = Dst;
-
-    if (dst == NULL)
-        return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-    
-	for (i = 0; i != basecount; ++i, u += 4, dst += 4) {
-		switch (sequence[i]) {
-			default:
-			case 'A':
-			case 'a':
-				dst[0] = (long)btoh16(u[0]) - offset;
-				dst[1] = (long)btoh16(u[1]) - offset;
-				dst[2] = (long)btoh16(u[2]) - offset;
-				dst[3] = (long)btoh16(u[3]) - offset;
-				break;					
-			case 'C':
-			case 'c':
-				dst[1] = (long)btoh16(u[0]) - offset;
-				dst[0] = (long)btoh16(u[1]) - offset;
-				dst[2] = (long)btoh16(u[2]) - offset;
-				dst[3] = (long)btoh16(u[3]) - offset;
-				break;					
-			case 'G':
-			case 'g':
-				dst[2] = (long)btoh16(u[0]) - offset;
-				dst[0] = (long)btoh16(u[1]) - offset;
-				dst[1] = (long)btoh16(u[2]) - offset;
-				dst[3] = (long)btoh16(u[3]) - offset;
-				break;					
-			case 'T':
-			case 't':
-				dst[3] = (long)btoh16(u[0]) - offset;
-				dst[0] = (long)btoh16(u[1]) - offset;
-				dst[1] = (long)btoh16(u[2]) - offset;
-				dst[2] = (long)btoh16(u[3]) - offset;
-				break;
-		}
-	}
-    free(*Data);
-    *Data = (void *)Dst;
-	*datasize =  sizeof(dst[0]) * 4 * basecount;
-	return 0;
-}
-#endif
-
-static void swab16(const void *Src, void *Dst, size_t len) {
-	const uint16_t *src = Src;
-	uint16_t *dst = Dst;
-	size_t n = len >> 1;
-	size_t i;
-	
-	assert((len & 1) == 0);
-	for (i = 0; i != n; ++i)
-		dst[i] = bswap_16(src[i]);
-}
-
-static void swab32(const void *Src, void *Dst, size_t len) {
-	const uint32_t *src = Src;
-	uint32_t *dst = Dst;
-	size_t n = len >> 2;
-	size_t i;
-	
-	assert((len & 3) == 0);
-	for (i = 0; i != n; ++i)
-		dst[i] = bswap_32(src[i]);
-}
-
-static void swab64(const void *Src, void *Dst, size_t len) {
-	const uint64_t *src = Src;
-	uint64_t *dst = Dst;
-	size_t n = len >> 3;
-	size_t i;
-	
-	assert((len & 7) == 0);
-	for (i = 0; i != n; ++i)
-		dst[i] = bswap_64(src[i]);
-}
-
-static rc_t fixup_read(uint8_t *read, size_t bases) {
-	int i;
-	
-	for (i = 0; i != bases; ++i)
-		switch (read[i]) {
-			case 'A':
-			case 'C':
-			case 'G':
-			case 'T':
-			case 'a':
-			case 'c':
-			case 'g':
-			case 't':
-				break;
-			default:
-				read[i] = 'N';
-				break;
-		}
-	return 0;
-}
-
-static rc_t fixup_quality4(uint8_t *qual, const uint8_t *read, size_t bases) {
-	uint8_t src[4 * 1024];
-	const uint8_t *src0 = src; /* called */
-	const uint8_t *src1 = src0 + bases; /* not called */
-	int i, j, k;
-	
-	assert(bases < 1024);
-	memcpy(src, qual, bases * 4);
-	
-	for (k = j = i = 0; i != bases; ++i, j += 3, k += 4) {
-		switch (read[i]) {
-			default:
-			case 'A':
-			case 'a':
-				qual[k + 0] = src0[i];
-				qual[k + 1] = src1[j + 0];
-				qual[k + 2] = src1[j + 1];
-				qual[k + 3] = src1[j + 2];
-				break;
-			case 'C':
-			case 'c':
-				qual[k + 0] = src1[j + 0];
-				qual[k + 1] = src0[i];
-				qual[k + 2] = src1[j + 1];
-				qual[k + 3] = src1[j + 2];
-				break;
-			case 'G':
-			case 'g':
-				qual[k + 0] = src1[j + 0];
-				qual[k + 1] = src1[j + 1];
-				qual[k + 2] = src0[i];
-				qual[k + 3] = src1[j + 2];
-				break;
-			case 'T':
-			case 't':
-				qual[k + 0] = src1[j + 0];
-				qual[k + 1] = src1[j + 1];
-				qual[k + 2] = src1[j + 2];
-				qual[k + 3] = src0[i];
-				break;
-		}
-	}
-	return 0;
-}
-
-static rc_t fixup_trace_reorder(float *dst, const uint16_t *src, long offset, size_t bases) {
-	size_t i, j;
-	const uint16_t *A = src;
-	const uint16_t *C = A + bases;
-	const uint16_t *G = C + bases;
-	const uint16_t *T = G + bases;
-	
-	for (j = i = 0; i < bases; ++i, j += 4) {
-		dst[j + 0] = ((long)A[i] - offset);
-		dst[j + 1] = ((long)C[i] - offset);
-		dst[j + 2] = ((long)G[i] - offset);
-		dst[j + 3] = ((long)T[i] - offset);
-	}
-	
-	return 0;
-}
-
-static rc_t fixup_trace(float *dst, const uint16_t *src, long offset, size_t bases) {
-	size_t i;
-	
-    /*
-     float x;
-     float y;
-     int t;
-     
-     y = clip(x + offset, 0, 64k);
-     t = rint(y);
-     write(t & 0xFFFF)
-    */
-    
-    if (offset == 0) {
-        for (i = 0; i != bases * 4; ++i)
-            dst[i] = src[i];
-        return 0;
-    }
-	for (i = 0; i != bases * 4; ++i)
-		dst[i] = ((long)src[i] - offset);
-	return 0;
-}
-
-rc_t ILL_ZTR_Decompress(ZTR_Context *ctx, enum ztr_chunk_type type, ztr_t ztr, const ztr_t base) {
-	int padded = 1;
-	size_t *datasize;
-	uint8_t **data;
-	enum ztr_data_type datatype;
-	static char zero[8];
-	rc_t rc = 0;
-	
-	if (ztr.sequence == NULL)
-		return 0;
-    switch (type) {
-        case BASE:
-			data = &ztr.sequence->data;
-			datasize = &ztr.sequence->datasize;
-			datatype = ztr.sequence->datatype;
-            break;
-        case BPOS:
-			data = &ztr.position->data;
-			datasize = &ztr.position->datasize;
-			datatype = ztr.position->datatype;
-            break;
-        case CNF1:
-			data = &ztr.quality1->data;
-			datasize = &ztr.quality1->datasize;
-			datatype = ztr.quality1->datatype;
-            break;
-        case CNF4:
-			data = &ztr.quality4->data;
-			datasize = &ztr.quality4->datasize;
-			datatype = ztr.quality4->datatype;
-            break;
-        case SAMP:
-			data = &ztr.signal->data;
-			datasize = &ztr.signal->datasize;
-			datatype = ztr.signal->datatype;
-            break;
-        case SMP4:
-			data = &ztr.signal4->data;
-			datasize = &ztr.signal4->datasize;
-			datatype = ztr.signal4->datatype;
-            break;
-        default:
-			return 0;
-    }
-	assert(*datasize);
-	assert(*data);
-
-    if ((*data)[0] == 0x4D) {
-        switch ((*data)[1]) {
-        case 1:
-            rc = handle_special_huffman_codes(&ctx->special[0], 0);
-            if (rc == 0)
-                rc = decompress_huffman(&ctx->special[0], data, datasize);
-            if (rc == 0)
-                (*data)[0] = 0;
-            break;
-        case 2:
-            rc = handle_special_huffman_codes(&ctx->special[1], 1);
-            if (rc == 0)
-                rc = decompress_huffman(&ctx->special[1], data, datasize);
-            if (rc == 0)
-                (*data)[0] = 0;
-            break;
-        case 3:
-            rc = handle_special_huffman_codes(&ctx->special[2], 2);
-            if (rc == 0)
-                rc = decompress_huffman(&ctx->special[2], data, datasize);
-            if (rc == 0)
-                (*data)[0] = 0;
-            break;
-        default:
-            if ((*data)[1] < 128)
-                rc = RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-            else
-                rc = decompress_huffman(&ctx->huffman_table[(*data)[1] - 128], data, datasize);
-        }
-    }
-	while (rc == 0) {
-		switch (**data) {
-		case 0:
-			switch (datatype) {
-				case i16:
-				case i16v4:
-					if (memcmp(*data, zero, 2) == 0)
-						padded = 2;
-					*datasize -= padded;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-					swab16((*data) + padded, *data, *datasize);
-#else
-					memmove(*data, (*data) + padded, *datasize);
-#endif
-					break;
-				case i32:
-				case f32:
-					if (memcmp(*data, zero, 4) == 0)
-						padded = 4;
-					*datasize -= padded;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-					swab32((*data) + padded, *data, *datasize);
-#else
-					memmove(*data, (*data) + padded, *datasize);
-#endif
-					break;
-				case f64:
-					if (memcmp(*data, zero, 8) == 0)
-						padded = 8;
-					*datasize -= padded;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-					swab64((*data) + padded, *data, *datasize);
-#else
-					memmove(*data, (*data) + padded, *datasize);
-#endif
-					break;
-				default:
-					*datasize -= padded;
-					memmove(*data, (*data) + padded, *datasize);
-					break;
-			}
-			switch (type) {
-			case BASE:
-				rc = fixup_read(*data, *datasize);
-				break;
-			case CNF4:
-				rc = fixup_quality4(*data, base.sequence->data, base.sequence->datasize);
-				break;
-			case SMP4:
-                {
-                    float *dst = malloc(sizeof(*dst) * 4 * base.sequence->datasize);
-                    if (dst == NULL)
-                        return RC(rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted);
-                    
-                    if (ztr.signal4->Type != NULL && memcmp("SLXN", ztr.signal4->Type, 5) == 0)
-                        rc = fixup_trace_reorder(dst, (const uint16_t *)*data, ztr.signal4->offset, base.sequence->datasize);
-                    else
-                        rc = fixup_trace(dst, (const uint16_t *)*data, ztr.signal4->offset, base.sequence->datasize);
-                    free(*data);
-                    *data = ( uint8_t* ) dst;
-                    *datasize = sizeof(*dst) * 4 * base.sequence->datasize;
-                }
-				break;
-			default:
-				break;
-			}
-			return rc;
-		case 4:
-			rc = undo_mode_4(data, datasize);
-			if (rc)
-				return rc;
-			break;
-		case 79:
-			rc = undo_mode_79(data, datasize);
-			if (rc)
-				return rc;
-			break;
-		case 80:
-			if (base.sequence->data == NULL || base.sequence->datasize == 0) {
-				**(uint16_t **)data = 0;
-				memmove(*data + 2, *data + 8, *datasize - 8);
-				*datasize -= 6;
-			}
-			else {
-				rc = undo_mode_80(data, datasize, base.sequence->data, base.sequence->datasize, ztr.signal4->offset);
-                if (rc == 0)
-                    ztr.signal4->datatype = f32;
-                return rc;
-			}
-			break;
-		default:
-			rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcUnexpected );
-			PLOGERR ( klogInt, ( klogInt, rc, "$(func) - don't know how to handle format '$(format)'",
-                                             "func=ZTR_Decompress,format=%02X", *data ));
-		}
-	}
-	return rc;
-}
-
-#if ZTR_USE_EXTRA_META
-rc_t ILL_ZTR_ProcessBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw, ztr_t *dst, enum ztr_chunk_type *chunkType, nvp_t **extraMeta, int *extraMetaCount)
-#else
-rc_t ILL_ZTR_ProcessBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw, ztr_t *dst, enum ztr_chunk_type *chunkType)
-#endif
-{
-    rc_t rc;
-    const uint8_t *ptype;
-    size_t metasize, datasize;
-    uint8_t *data;
-    const char *metadata;
-    int count;
-    enum ztr_chunk_type type = 0;
-    enum ztr_data_type datatype = 0;
-    nvp_t *meta = NULL;
-    ztr_t ztr;
-
-    assert(ctx);
-    assert(ztr_raw);
-    assert(dst);
-    assert(chunkType);
-
-    *chunkType = none;
-    *(void **)dst = NULL;
-    *(void **)&ztr = NULL;
-	
-    ptype = ztr_raw->type;
-    count = 0;
-    metasize = ztr_raw->metalength;
-    if (metasize != 0) {
-        metadata = (char *)ztr_raw->meta;
-
-        count = count_pairs(metadata, metasize);
-        if (count < 0) {
-            rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-            PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk metadata malformed pairs",
-                                 "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-            return rc;
-        }
-
-		if (count == 0)
-			meta = NULL;
-        else {
-			meta = calloc(count, sizeof(*meta));
-			if (meta == NULL) {
-				rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-				PLOGERR ( klogSys, ( klogSys, rc, "$(func) - '$(type)' chunk metadata pair",
-						  "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-				return rc;
-			}
-			parse_meta(meta, count, metadata, metadata + metasize);
-		}
-    }
-    
-    if (memcmp(ptype, "BASE", 4) == 0) {
-        type = BASE;
-        datatype = i8;
-    }
-    else if (memcmp(ptype, "BPOS", 4) == 0) {
-        type = BPOS;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "CLIP", 4) == 0) {
-        type = CLIP;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "CNF1", 4) == 0) {
-        type = CNF1;
-        datatype = i8;
-    }
-    else if (memcmp(ptype, "CNF4", 4) == 0) {
-        type = CNF4;
-        datatype = i8;
-    }
-    else if (memcmp(ptype, "COMM", 4) == 0) {
-        type = COMM;
-    }
-    else if (memcmp(ptype, "CR32", 4) == 0) {
-        type = CR32;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "HUFF", 4) == 0) {
-        type = HUFF;
-    }
-    else if (memcmp(ptype, "REGN", 4) == 0) {
-        type = REGN;
-        datatype = i32;
-    }
-    else if (memcmp(ptype, "SAMP", 4) == 0) {
-        type = SAMP;
-        datatype = i16;
-    }
-    else if (memcmp(ptype, "SMP4", 4) == 0) {
-        type = SMP4;
-        datatype = i16v4;
-    }
-    else if (memcmp(ptype, "TEXT", 4) == 0) {
-        type = TEXT;
-    }
-
-    metadata = meta_getValueForNameAndRemove(meta, count, "VALTYPE");
-    if (metadata != NULL) {
-        if (strcmp(metadata, "16 bit integer") == 0)
-            datatype = i16;
-        else if (strcmp(metadata, "32 bit integer") == 0)
-            datatype = i32;
-        else if (strcmp(metadata, "32 bit IEEE float") == 0)
-            datatype = f32;
-        else if (strcmp(metadata, "64 bit IEEE float") == 0)
-            datatype = f64;
-    }
-
-    datasize = ztr_raw->datalength;
-    data = ztr_raw->data;
-#if 0
-	if (datasize > 0 && *data == 0x4D) {
-		if (data[1] < 128)
-			return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-		rc = decompress_huffman(&ctx->huffman_table[data[1] - 128], (const uint8_t **)&data, &datasize);
-		if (rc)
-			return rc;
-		ztr_raw->datalength = datasize;
-		ztr_raw->data = (uint8_t *)data;
-	}
-#endif
-
-    switch (type) {
-        case BASE:
-            ztr.sequence = malloc(sizeof(*ztr.sequence));
-            if (ztr.sequence == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                                     "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.sequence->datatype = datatype;
-            ztr.sequence->datasize = datasize;
-            ztr.sequence->charset = (char *)meta_getValueForNameAndRemove(meta, count, "CSET");
-            ztr.sequence->data = (uint8_t *)data;
-            break;
-        case BPOS:
-            ztr.position = malloc(sizeof(*ztr.position));
-            if (ztr.position == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                                     "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.position->datatype = datatype;
-            ztr.position->datasize = datasize;
-            ztr.position->data = (uint8_t *)data;
-            break;
-        case CLIP:
-            ztr.clip = malloc(sizeof(ztr.clip));
-            if (ztr.clip == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                                     "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.clip->left  = (((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3];
-            ztr.clip->right = (((((data[4] << 8) | data[5]) << 8) | data[6]) << 8) | data[7];
-            break;
-        case CNF1:
-            ztr.quality1 = malloc(sizeof(*ztr.quality1));
-            if (ztr.quality1 == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.quality1->datatype = datatype;
-            ztr.quality1->datasize = datasize;
-            if ((ztr.quality1->scale = (char *)meta_getValueForNameAndRemove(meta, count, "SCALE")) == NULL)
-                ztr.quality1->scale = "PH";
-            ztr.quality1->data = (uint8_t *)data;
-            break;
-        case CNF4:
-            ztr.quality4 = malloc(sizeof(*ztr.quality4));
-            if (ztr.quality4 == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.quality4->datatype = datatype;
-            ztr.quality4->datasize = datasize;
-            if ((ztr.quality4->scale = (char *)meta_getValueForNameAndRemove(meta, count, "SCALE")) == NULL)
-                ztr.quality4->scale = "PH";
-            ztr.quality4->data = (uint8_t *)data;
-            break;
-        case COMM:
-            ztr.comment = malloc(sizeof(*ztr.comment) + datasize);
-            if (ztr.comment == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.comment->size = datasize;
-            ztr.comment->text = (char *)data;
-            break;
-#if ZTR_USE_TEXT_CHUNK
-#else
-        case TEXT:
-#endif
-        case CR32:
-            *chunkType = ignore;
-#if 0
-            if (ctx->checksum != ((((((data[0] << 8) | data[1]) << 8) | data[2]) << 8) | data[3]))
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - checksum error", "func=ZTR_ProcessBlock" ));
-                return rc;
-            }
-            ctx->checksum = 0;
-#endif
-            break;
-        case HUFF:
-            *chunkType = ignore;
-			if (data[1] < 128)
-				return RC(rcSRA, rcFormatter, rcParsing, rcData, rcInvalid);
-			rc = handle_huffman_codes(&ctx->huffman_table[data[1] - 128], data + 2, datasize - 2);
-			if (rc)
-				return rc;
-            break;
-        case REGN:
-        {
-            int region_count;
-            int n;
-            
-            metadata = meta_getValueForNameAndRemove(meta, count, "NAME");
-            if (metadata) {
-                const char *cp;
-                
-                region_count = 1;
-                if (metadata[strlen(metadata) - 1] == ';')
-                    region_count = 0;
-                for (cp = metadata; (cp = strchr(cp, ';')) != NULL; ++cp)
-                    ++region_count;
-            }
-            else
-                region_count = 0;
-            switch (datatype) {
-                case i16:
-                    if ((datasize & 1) != 0) {
-                        --datasize;
-                        data = ((uint8_t *)data) + 1;
-                    }
-                    if ((datasize >> 1) < (region_count - 1)) {
-                        rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-                        PLOGERR ( klogSys, ( klogSys, rc, "$(func) - '$(type)' chunk data",
-                                  "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                        return rc;
-                    }
-                    break;
-                case i32:
-                    if ((datasize & 1) != 0) {
-                        --datasize;
-                        data = ((uint8_t *)data) + 1;
-                    }
-                    if ((datasize >> 2) < (region_count - 1)) {
-                        rc = RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-                        PLOGERR ( klogSys, ( klogSys, rc, "$(func) - '$(type)' chunk data",
-                                  "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                        return rc;
-                    }
-                    break;
-                default:
-                    break;
-            }
-            ztr.region = NULL;
-            n = (size_t)(&ztr.region->region[region_count]) + (metadata ? (strlen(metadata) + 1) : 0);
-            ztr.region = malloc(n);
-            if (ztr.region == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogSys, ( klogSys, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.region->count = region_count;
-            if (region_count > 0) {
-                char *temp = (char *)&ztr.region->region[region_count];
-                int i, st;
-                
-                strcpy(temp, metadata);
-                for (i = st = 0; *temp != '\0'; ++temp) {
-                    switch (st) {
-                        case 0:
-                            if (!isspace(*temp)) {
-                                ztr.region->region[i].name = temp;
-                                ++st;
-                            }
-                            break;
-                        case 1:
-                            if (*temp == ':') {
-                                char *cp = temp - 1;
-                                
-                                while (isspace(*cp))
-                                    *cp-- = '\0';
-                                *temp = '\0';
-                                ++st;
-                            }
-                            break;
-                        case 2:
-                            if (!isspace(*temp)) {
-                                ztr.region->region[i].type = *temp;
-                                if (i == region_count - 1)
-                                    ztr.region->region[0].start = 0;
-                                else
-                                    switch (datatype) {
-                                        case i16:
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-                                            ztr.region->region[i + 1].start = bswap_16(((const int16_t *)data)[i]);
-#else
-                                            ztr.region->region[i + 1].start = ((const int16_t *)data)[i];
-#endif
-                                            break;
-                                        case i32:
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-                                            ztr.region->region[i + 1].start = bswap_32(((const int32_t *)data)[i]);
-#else
-                                            ztr.region->region[i + 1].start = ((const int32_t *)data)[i];
-#endif
-                                            break;
-                                        default:
-                                            break;
-                                    }
-                                ++i;
-                                ++st;
-                            }
-                            break;
-                        case 3:
-                            if (*temp == ';')
-                                st = 0;
-                            break;
-                    }
-                }
-            }
-        }
-            break;
-        case SAMP:
-            ztr.signal = malloc(sizeof(*ztr.signal));
-            if (ztr.signal == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.signal->datatype = datatype;
-            ztr.signal->datasize = datasize;
-			metadata = (char *)meta_getValueForNameAndRemove(meta, count, "OFFS");
-			ztr.signal->offset = metadata == NULL ? 0 : strtol(metadata, 0, 0);
-            ztr.signal->channel = (char *)meta_getValueForNameAndRemove(meta, count, "TYPE");
-            ztr.signal->data = (uint8_t *)data;
-            break;
-        case SMP4:
-            ztr.signal4 = malloc(sizeof(*ztr.signal4));
-            if (ztr.signal4 == NULL)
-            {
-                rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                           "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                return rc;
-            }
-            *chunkType = type;
-            ztr.signal4->datatype = datatype;
-            ztr.signal4->datasize = datasize;
-			metadata = (char *)meta_getValueForNameAndRemove(meta, count, "OFFS");
-			ztr.signal->offset = metadata == NULL ? 0 : strtol(metadata, 0, 0);
-            ztr.signal4->Type   = (char *)meta_getValueForNameAndRemove(meta, count, "TYPE");
-            ztr.signal4->data = (uint8_t *)data;
-            break;
-#if ZTR_USE_TEXT_CHUNK
-        case TEXT:
-        {
-            int n;
-            const char *const end = (const char *)(data + datasize);
-            const char *cp;
-
-            for (cp = (const char *)data, n = 0; cp < end; ++n) {
-                size_t len = strendlen(cp, end);
-                
-                if (len == 0)
-                    break;
-                cp += len + 1;
-                len = strendlen(cp, end);
-                cp += len + 1;
-            }
-            if (n != 0) {
-                int i;
-
-                ztr.xmeta = malloc(sizeof(*ztr.xmeta) + (n - 1) * sizeof(nvp_t));
-                if (ztr.xmeta == NULL)
-                {
-                    rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-                    PLOGERR ( klogErr, ( klogErr, rc, "$(func) - '$(type)' chunk data",
-                               "func=ZTR_ProcessBlock,type=%.*s", 4, & ztr_raw->type ));
-                    return rc;
-                }
-                *chunkType = type;
-                ztr.xmeta->count = n;
-                for (i = 0, cp = (const char *)data; i != n; ++i) {
-                    size_t len = strendlen(cp, end);
-                    
-                    if (len == 0)
-                        break;
-                    ztr.xmeta->data[i].name = cp;
-                    cp += len + 1;
-                    ztr.xmeta->data[i].value = cp;
-                    len = strendlen(cp, end);
-                    cp += len + 1;
-                }
-            }
-        }
-            break;
-#endif
-        default:
-            *chunkType = unknown;
-            DEBUG_MSG(1, ("$(func) - chunk '$(type)' unrecognized", "func=ZTR_ProcessBlock,type=%.*s\n", 4, & ztr_raw->type ));
-            break;
-    }
-
-    *dst = ztr;
-#if ZTR_USE_EXTRA_META
-    if (extraMeta != NULL && extraMetaCount != NULL) {
-        int i, j, k;
-        
-        for (k = j = i = 0; i != count; ++i)
-            if (meta[i].name != NULL) {
-                k += strlen(meta[i].name) + strlen(meta[i].value) + 2;
-                ++j;
-            }
-        *extraMetaCount = 0;
-        *extraMeta = NULL;
-        if (j > 0) {
-            *extraMeta = malloc(sizeof(nvp_t) * j + k);
-            if (*extraMeta != NULL) {
-                char *temp = (char *)(*extraMeta + j);
-                
-                for (j = i = 0; i != count; ++i)
-                    if (meta[i].name != NULL) {
-                        strcpy(temp, meta[i].name);
-                        (*extraMeta)[j].name = temp;
-                        temp += strlen(temp) + 1;
-                        strcpy(temp, meta[i].value);
-                        (*extraMeta)[j].value = temp;
-                        temp += strlen(temp) + 1;
-                    }
-            }
-        }
-    }
-#endif
-    if (meta != NULL)
-        free(meta);
-    return 0;
-}
-
-rc_t ILL_ZTR_CreateContext(ZTR_Context **ctx)
-{
-    rc_t rc;
-
-    assert(ctx);
-
-    *ctx = malloc(sizeof(**ctx));
-    if (*ctx)
-    {
-        memset(*ctx, 0, sizeof(**ctx));
-        return 0;
-    }
-
-    rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-    PLOGERR ( klogErr, ( klogErr, rc, "$(func)", "func=ZTR_CreateContext" ));
-    return rc;
-}
-
-rc_t ILL_ZTR_AddToBuffer(ZTR_Context *ctx, const uint8_t *data, uint32_t datasize)
-{
-    rc_t rc;
-
-    assert(ctx);
-    if (ctx->buf[0] == NULL) {
-        ctx->current = 0;
-        ctx->buf[0] = data;
-        ctx->buflen[0] = datasize;
-        return 0;
-    }
-    if (ctx->buf[1] == NULL) {
-        ctx->buf[1] = data;
-        ctx->buflen[1] = datasize;
-        return 0;
-    }
-
-    rc = RC ( rcSRA, rcFormatter, rcParsing, rcBuffer, rcExhausted );
-    PLOGERR ( klogErr, ( klogErr, rc, "$(func) - both buffers are in use",
-               "func=ZTR_AddToBuffer" ));
-    return rc;
-}
-
-
-rc_t ILL_ZTR_ParseHeader(ZTR_Context *ctx)
-{
-    uint8_t src[10];
-    int len;
-    
-    assert(ctx);
-    
-    len = ztr_read(ctx, src, 10);
-    if (len != 10)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcInsufficient );
-
-    if (memcmp(src, ZTR_SIG, 8) != 0)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcCorrupt );
-
-    if ((ctx->versMajor = src[8]) != 1)
-        return RC ( rcSRA, rcFormatter, rcParsing, rcData, rcBadVersion );
-
-    ctx->versMinor = src[9];
-
-    return 0;
-}
-
-rc_t ILL_ZTR_ContextRelease(ZTR_Context *self) {
-    int i;
-    
-    if (self != NULL)
-    {
-        for (i = 0; i != 128; ++i) {
-            free_huffman_table(self->huffman_table + i);
-        }
-        free(self);
-    }
-    return 0;
-}
-
-rc_t ILL_ZTR_BufferGetRemainder(ZTR_Context *ctx, const uint8_t **data, uint32_t *datasize)
-{
-    assert(ctx);
-    assert(data);
-    assert(datasize);
-    
-    *data = NULL;
-    *datasize = ctx->buflen[0] + ctx->buflen[1] - ctx->current;
-    if (*datasize != 0) {
-        void *r = malloc(*datasize);
-        if (r == NULL)
-        {
-            rc_t rc = RC ( rcSRA, rcFormatter, rcParsing, rcMemory, rcExhausted );
-            PLOGERR ( klogErr, ( klogErr, rc, "$(func)", "func=ZTR_BufferGetRemainder" ));
-            return rc;
-        }
-        ztr_read(ctx, r, *datasize);
-        *data = r;
-    }
-    return 0;
-}
diff --git a/tools/sra-load/ztr-illumina.h b/tools/sra-load/ztr-illumina.h
deleted file mode 100644
index 575348b..0000000
--- a/tools/sra-load/ztr-illumina.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _sra_load_ztr_illumina_
-#define _sra_load_ztr_illumina_
-
-#include <klib/defs.h>
-
-#include "ztr.h"
-
-typedef struct ztr_raw_t {
-    uint8_t type[4];
-    size_t metalength, datalength;
-    uint8_t *meta, *data;
-} ztr_raw_t;
-
-/* allocate and initialize a ZTR parser context
-   caller is responsible to free resulting pointer
-
-   return 1 if context can't be allocated,
-   0 for no error.
- */
-rc_t ILL_ZTR_CreateContext(ZTR_Context **ctx);
-
-/* add some bytes to context's input buffer
-   the caller is responsible for ensuring that
-   the pointer remains valid until the bytes
-   are consumed.  the caller is responsible for
-   free'ing it.  the context will simply forget
-   the bytes when it has consumed them all.
- 
-   returns 1 if data can't be added to the buffer chain,
-   0 for no error.
- */
-rc_t ILL_ZTR_AddToBuffer(ZTR_Context *ctx, const uint8_t *data, uint32_t datasize);
-
-/* get a copy of any unconsumed input bytes from the context.
-   the bytes are consumed in the process.  the caller is
-   responsible for free'ing the resulting pointer.
-   the resulting pointer is should be sent in to AddToBuffer
-   when more bytes are available.
- 
-   returns 1 if the *data can't be allocated, 0 for no error.
- */
-rc_t ILL_ZTR_BufferGetRemainder(ZTR_Context *ctx, const uint8_t **data, uint32_t *datasize);
-
-bool ILL_ZTR_BufferIsEmpty(const ZTR_Context *ctx);
-
-/* parse a ZTR header from the input buffer
-   returns 0 if no error, 1 otherwise
- */
-rc_t ILL_ZTR_ParseHeader(ZTR_Context *ctx);
-
-/* parse a ZTR block from the input buffer
-   returns
-        0: no error
-        1: not valid ZTR
-        2: out of memory
-
-   the caller is responsible for free'ing ztr_raw->meta and
-   ztr_raw->data when it is no longer needed
- */
-rc_t ILL_ZTR_ParseBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw);
-
-/* cook a ztr_raw_t to produce a ztr_t
-   sets defaults, processes meta data, etc.
-
-   returns
-        0: no error
-        1: not valid ZTR
-        2: out of memory
-
-   Parameters:
-    ctx [in]: the context returned from ZTR_CreateContext
-    ztr_raw [in]: the structure filled in by ZTR_ParseBlock
-    ztr [out]: the resulting data object
-    chunkType [out]: how to interpret the data object
-        if chunkType is none or unknown, it is probably an error
-        if chunkType is ignore, then the chunk was valid and known
-        but of no interest to you, e.g. a huffman dictionary chunk
-    extraMeta [out optional]: any unprocessed name-value pairs
-    extraMetaCount [out optional]: the number of unprocessed name-value pairs
- 
-   NB. ztr and its pointers refer to ztr_raw, so don't free
-   ztr_raw before you are done with ztr
- 
-   ztr can be free'ed in one-fell-swoop
-   *extraMeta can be free'ed in one-fell-swoop
- */
-#if ZTR_USE_EXTRA_META
-    rc_t ILL_ZTR_ProcessBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw, ztr_t *ztr,
-                              enum ztr_chunk_type *chunkType, nvp_t **extraMeta, int *extraMetaCount);
-#else
-    rc_t ILL_ZTR_ProcessBlock(ZTR_Context *ctx, ztr_raw_t *ztr_raw, ztr_t *ztr,
-                              enum ztr_chunk_type *chunkType);
-#endif
-
-/* free a context created by ZTR_CreateContext
-   do this when done processing the ZTR stream.
- */
-rc_t ILL_ZTR_ContextRelease(ZTR_Context *ctx);
-
-rc_t ILL_ZTR_Decompress(ZTR_Context *ctx, enum ztr_chunk_type type, ztr_t ztr, const ztr_t base);
-
-#define ZTR_CreateContext		ILL_ZTR_CreateContext
-#define ZTR_ContextRelease		ILL_ZTR_ContextRelease
-#define ZTR_AddToBuffer			ILL_ZTR_AddToBuffer
-#define ZTR_BufferGetRemainder	ILL_ZTR_BufferGetRemainder
-#define ZTR_BufferIsEmpty		ILL_ZTR_BufferIsEmpty
-#define ZTR_ParseHeader			ILL_ZTR_ParseHeader
-#define ZTR_ParseBlock			ILL_ZTR_ParseBlock
-#define ZTR_ProcessBlock		ILL_ZTR_ProcessBlock
-
-#endif /* _sra_load_ztr_illumina_ */
diff --git a/tools/sra-load/ztr.h b/tools/sra-load/ztr.h
deleted file mode 100644
index 4265121..0000000
--- a/tools/sra-load/ztr.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-#ifndef _sra_load_ztr_
-#define _sra_load_ztr_
-
-#define ZTR_USE_TEXT_CHUNK 0
-#define ZTR_USE_EXTRA_META 0
-
-#define ZTR_SIG "\xaeZTR\r\n\x1A\n"
-/* does buffer contain a ZTR signature?
- */
-#define ZTR_IsSignature(X, N) ((N >= 8) && (memcmp(X, ZTR_SIG, 8) == 0) ? 1 : 0)
-
-#define METANAME_IS_CASE_SENSITIVE 1
-
-enum ztr_data_type {
-	i8,
-	i16,
-	i32,
-	f32,
-	f64,
-	vector4 = 16,
-	i8v4  = i8  | vector4,
-	i16v4 = i16 | vector4,
-	i32v4 = i32 | vector4,
-	f32v4 = f32 | vector4,
-	f64v4 = f64 | vector4
-};
-
-enum ztr_chunk_type {
-	none,
-	unknown,
-	ignore,
-	BASE,
-	BPOS,
-	CLIP,
-	CNF1,
-	CNF4,
-	REGN,
-	SAMP,
-	SMP4,
-	TEXT,
-	COMM,
-	CR32,
-	HUFF,
-
-	READ = BASE,
-	POSITION = BPOS,
-	QUALITY1 = CNF1,
-	QUALITY4 = CNF4,
-	READ_STRUCTURE = REGN,
-	SIGNAL1 = SAMP,
-	SIGNAL4 = SMP4
-};
-
-enum region_type {
-	Biological = 'B',
-	Duplicate = 'D',
-	Explicit = 'E',
-	Inverted = 'I',
-	Normal = 'N',
-	Paired = 'P',
-	Technical = 'T'
-};
-
-typedef struct region_t region_t;
-struct region_t {
-	int start;
-	enum region_type type;
-	char *name;
-};
-
-struct ztr_sequence_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-	char *charset;
-};
-
-struct ztr_position_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-};
-
-struct ztr_clip_t {
-	uint32_t left, right;
-};
-
-struct ztr_quality1_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-	char *scale;
-};
-
-struct ztr_quality4_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-	char *scale;
-};
-
-struct ztr_comment_t {
-	size_t size;
-	char *text;
-};
-
-struct ztr_region_t {
-	size_t count;
-	region_t region[1];
-};
-
-struct ztr_signal_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-	char *channel;
-	long offset;
-};
-
-struct ztr_signal4_t {
-	enum ztr_data_type datatype;
-	size_t datasize;
-	uint8_t *data;
-	char *Type;
-	long offset;
-};
-
-typedef struct nvp_t {
-    const char *name,
-    *value;
-} nvp_t;
-
-#if ZTR_USE_TEXT_CHUNK
-struct ztr_xmetadata_t {
-	size_t count;
-	nvp_t data[1];
-};
-#endif
-
-typedef union ztr_t {
-	struct ztr_sequence_t   *sequence;  /* chunk type 'BASE' */
-	struct ztr_position_t   *position;  /* chunk type 'BPOS' */
-	struct ztr_clip_t       *clip;      /* chunk type 'CLIP' */
-	struct ztr_quality1_t   *quality1;  /* chunk type 'CNF1' */
-	struct ztr_quality4_t   *quality4;  /* chunk type 'CNF4' */
-	struct ztr_comment_t    *comment;   /* chunk type 'COMM' */
-	struct ztr_region_t     *region;    /* chunk type 'REGN' */
-	struct ztr_signal_t     *signal;    /* chunk type 'SAMP' */
-	struct ztr_signal4_t    *signal4;   /* chunk type 'SMP4' */
-#if ZTR_USE_TEXT_CHUNK
-	struct ztr_xmetadata_t  *xmeta;     /* chunk type 'TEXT' */
-#endif
-} ztr_t;
-
-typedef struct ZTR_Context ZTR_Context;
-
-#endif /* _sra_load_ztr_ */
diff --git a/tools/sra-pileup/Makefile b/tools/sra-pileup/Makefile
deleted file mode 100644
index 0ce8dea..0000000
--- a/tools/sra-pileup/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-pileup
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	sra-pileup \
-	sam-dump
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sra-pileup
-#
-TOOL_SRC = \
-	cmdline_cmn \
-	reref \
-	sra-pileup
-
-TOOL_OBJ = \
-	$(addsuffix .$(OBJX),$(TOOL_SRC))
-
-TOOL_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/sra-pileup: $(TOOL_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(TOOL_LIB)
-
-#-------------------------------------------------------------------------------
-# sam-dump
-#
-SAMDUMP3_SRC = \
-	inputfiles \
-	sam-dump-opts \
-	out_redir \
-	sam-hdr \
-	matecache \
-	read_fkt \
-	sam-aligned \
-	sam-unaligned \
-	cg_tools \
-	sam-dump \
-	sam-dump3
-
-SAMDUMP3_OBJ = \
-	$(addsuffix .$(OBJX),$(SAMDUMP3_SRC))
-
-SAMDUMP3_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/sam-dump: $(SAMDUMP3_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SAMDUMP3_LIB)
diff --git a/tools/sra-pileup/cg_tools.c b/tools/sra-pileup/cg_tools.c
deleted file mode 100644
index f2f18fa..0000000
--- a/tools/sra-pileup/cg_tools.c
+++ /dev/null
@@ -1,984 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "cg_tools.h"
-#include "debug.h"
-
-#include <klib/printf.h>
-#include <sysalloc.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-
-static void SetCigOp( CigOps * dst, char op, uint32_t oplen )
-{
-    dst->op    = op;
-    dst->oplen = oplen;
-    switch( op ) 
-    { /*MX= DN B IS PH*/
-
-    case 'M' :
-    case 'X' :
-    case '=' :  dst->ref_sign = +1;
-                dst->seq_sign = +1;
-                break;
-
-    case 'D' :
-    case 'N' :  dst->ref_sign = +1;
-                dst->seq_sign = 0;
-                break;
-
-    case 'B' :  dst->ref_sign = -1;
-                dst->seq_sign = 0;
-                break;
-
-    case 'S' :
-    case 'I' :  dst->ref_sign = 0;
-                dst->seq_sign = +1;
-                break;
-
-    case 'P' :
-    case 'H' :
-    case 0   :  dst->ref_sign= 0;   /* terminating op */
-                dst->seq_sign= 0;
-                break;
-
-    default :   assert( 0 );
-                break;
-    }
-}
-
-
-int32_t ExplodeCIGAR( CigOps dst[], uint32_t len, char const cigar[], uint32_t ciglen )
-{
-    uint32_t i;
-    uint32_t j;
-    int32_t opLen;
-    
-    for ( i = j = opLen = 0; i < ciglen; ++i )
-    {
-        if ( isdigit( cigar[ i ] ) )
-        {
-            opLen = opLen * 10 + cigar[ i ] - '0';
-        }
-        else
-        {
-            assert( isalpha( cigar[ i ] ) );
-            SetCigOp( dst + j, cigar[ i ], opLen );
-            opLen = 0;
-            j++;
-        }
-    }
-    SetCigOp( dst + j, 0, 0 );
-    j++;
-    return j;
-}
-
-
-typedef struct cgOp_s
-{
-    uint16_t length;
-    uint8_t type; /* 0: match, 1: insert, 2: delete */
-    char code;
-} cgOp;
-
-
-static void print_CG_cigar( int line, cgOp const op[], unsigned const ops, unsigned const gap[ 3 ] )
-{
-#if _DEBUGGING
-    unsigned i;
-    
-    SAM_DUMP_DBG( 3, ( "%5i: ", line ) );
-    for ( i = 0; i < ops; ++i )
-    {
-        if ( gap && ( i == gap[ 0 ] || i == gap[ 1 ] || i == gap[ 2 ] ) )
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, tolower( op[ i ].code ) ) );
-        }
-        else
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, toupper( op[ i ].code ) ) );
-        }
-    }
-    SAM_DUMP_DBG( 3, ( "\n" ) );
-#endif
-}
-
-
-/* gap contains the indices of the wobbles in op
- * gap[0] is between read 1 and 2; it is the 'B'
- * gap[1] is between read 2 and 3; it is an 'N'
- * gap[2] is between read 3 and 4; it is an 'N'
- */
-
-typedef struct cg_cigar_temp
-{
-    unsigned gap[ 3 ];
-    cgOp cigOp[ MAX_READ_LEN ];
-    unsigned opCnt;
-    unsigned S_adjust;
-    unsigned CG_adjust;
-} cg_cigar_temp;
-
-
-static rc_t CIGAR_to_CG_Ops( const cg_cigar_input * input,
-                             cg_cigar_temp * tmp )
-{
-    unsigned i;
-    unsigned ops = 0;
-    unsigned gapno;
-
-    tmp->opCnt = 0;
-    tmp->S_adjust = 0;
-    tmp->CG_adjust = 0;
-    for ( i = 0; i < input->p_cigar.len; ++ops )
-    {
-        char opChar = 0;
-        int opLen = 0;
-        int n;
-
-        for ( n = 0; ( ( n + i ) < input->p_cigar.len ) && ( isdigit( input->p_cigar.ptr[ n + i ] ) ); n++ )
-        {
-            opLen = opLen * 10 + input->p_cigar.ptr[ n + i ] - '0';
-        }
-
-        if ( ( n + i ) < input->p_cigar.len )
-        {
-            opChar = input->p_cigar.ptr[ n + i ];
-            n++;
-        }
-
-        if ( ( ops + 1 ) >= MAX_READ_LEN )
-            return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-
-        i += n;
-        
-        tmp->cigOp[ ops ].length = opLen;
-        tmp->cigOp[ ops ].code = opChar;
-        switch ( opChar )
-        {
-            case 'M' :
-            case '=' :
-            case 'X' :  tmp->cigOp[ ops ].type = 0;
-                        break;
-
-            case 'S' :  tmp->S_adjust += opLen;
-            case 'I' :  tmp->cigOp[ ops ].type = 1;
-                        tmp->cigOp[ ops ].code = 'I';
-                        break;
-
-            case 'D':   tmp->cigOp[ ops ].type = 2;
-                        break;
-
-            default :   return RC( rcExe, rcData, rcReading, rcConstraint, rcViolated );
-        }
-    }
-
-    tmp->opCnt = ops;
-    tmp->gap[ 0 ] = tmp->gap[ 1 ] = tmp->gap[ 2 ] = ops;
-    print_CG_cigar( __LINE__, tmp->cigOp, ops, NULL );
-
-
-    if ( ops < 3 )
-        return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-
-    {
-        unsigned fwd = 0; /* 5 10 10 10 */
-        unsigned rev = 0; /* 10 10 10 5 */
-        unsigned acc; /* accumulated length */
-        
-        if ( ( input->seq_req_id == 1 && !input->orientation ) ||
-             ( input->seq_req_id == 2 && input->orientation ) )
-        {
-            for ( i = 0, acc = 0; i < ops  && acc <= 5; ++i )
-            {
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc == 5 && tmp->cigOp[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const right = acc - 5;
-                        unsigned const left = tmp->cigOp[ i ].length - right;
-                        
-                        memmove( &tmp->cigOp[ i + 2 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                        ops += 2;
-                        tmp->cigOp[ i ].length = left;
-                        tmp->cigOp[ i + 2 ].length = right;
-                        
-                        tmp->cigOp[ i + 1 ].type = 1;
-                        tmp->cigOp[ i + 1 ].code = 'B';
-                        tmp->cigOp[ i + 1 ].length = 0;
-                        
-                        fwd = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else if ( ( input->seq_req_id == 2 && !input->orientation ) ||
-                  ( input->seq_req_id == 1 && input->orientation ) )
-        {
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc == 5 && tmp->cigOp[ i ].type == 1 )
-                    {
-                        rev = i;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const left = acc - 5;
-                        unsigned const right = tmp->cigOp[ i ].length - left;
-                        
-                        memmove( &tmp->cigOp[ i + 2 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                        ops += 2;
-                        tmp->cigOp[ i ].length = left;
-                        tmp->cigOp[ i + 2 ].length = right;
-                        
-                        tmp->cigOp[ i + 1 ].type = 1;
-                        tmp->cigOp[ i + 1 ].code = 'B';
-                        tmp->cigOp[ i + 1 ].length = 0;
-                         
-                        rev = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else
-        {
-            /* fprintf(stderr, "guessing layout\n"); */
-            for ( i = 0, acc = 0; i < ops  && acc <= 5; ++i )
-            {
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc == 5 && tmp->cigOp[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                    }
-                }
-            }
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc == 5 && tmp->cigOp[i].type == 1 )
-                    {
-                        rev = i;
-                    }
-                }
-            }
-            if ( ( fwd == 0 && rev == 0 ) || ( fwd != 0 && rev != 0 ) )
-            {
-                for ( i = 0; i < ops; ++i )
-                {
-                    if ( tmp->cigOp[ i ].type == 2 )
-                    {
-                        tmp->cigOp[ i ].code = 'N';
-                        tmp->CG_adjust += tmp->cigOp[ i ].length;
-                    }
-                }
-                return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-            }
-        }
-        if ( fwd && tmp->cigOp[ fwd ].type == 1 )
-        {
-            for ( i = ops, acc = 0; i > fwd + 1; )
-            {
-                --i;
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const r = 10 + tmp->cigOp[ i ].length - acc;
-                            unsigned const l = tmp->cigOp[ i ].length - r;
-                            
-                            if ( ops + 2 >= MAX_READ_LEN )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &tmp->cigOp[ i + 2 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                            ops += 2;
-                            tmp->cigOp[ i + 2 ].length = r;
-                            tmp->cigOp[ i ].length = l;
-                            
-                            tmp->cigOp[ i + 1 ].length = 0;
-                            tmp->cigOp[ i + 1 ].type = 2;
-                            tmp->cigOp[ i + 1 ].code = 'N';
-                            i += 2;
-                        }
-                        else if ( i - 1 > fwd )
-                        {
-                            if ( tmp->cigOp[ i - 1 ].type == 2 )
-                                 tmp->cigOp[ i - 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= MAX_READ_LEN )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &tmp->cigOp[ i + 1 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                                ops += 1;
-                                tmp->cigOp[ i ].length = 0;
-                                tmp->cigOp[ i ].type = 2;
-                                tmp->cigOp[ i ].code = 'N';
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            /** change I to B+M **/
-            tmp->cigOp[ fwd ].code = 'B';
-            memmove( &tmp->cigOp[ fwd + 1 ], &tmp->cigOp[ fwd ], ( ops - fwd ) * sizeof( tmp->cigOp[ 0 ] ) );
-            ops += 1;
-            tmp->cigOp[ fwd + 1 ].code = 'M';
-            tmp->opCnt = ops;
-            /** set the gaps now **/
-            for ( gapno = 3, i = ops; gapno > 1 && i > 0; )
-            {
-                --i;
-                if ( tmp->cigOp[ i ].code == 'N' )
-                    tmp->gap[ --gapno ] = i;
-            }
-            tmp->gap[ 0 ] = fwd;
-            print_CG_cigar( __LINE__, tmp->cigOp, ops, tmp->gap );
-            return 0;
-        }
-        if ( rev && tmp->cigOp[ rev ].type == 1 )
-        {
-            for ( acc = i = 0; i < rev; ++i )
-            {
-                if ( tmp->cigOp[ i ].type != 2 )
-                {
-                    acc += tmp->cigOp[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const l = 10 + tmp->cigOp[ i ].length - acc;
-                            unsigned const r = tmp->cigOp[ i ].length - l;
-                            
-                            if ( ops + 2 >= MAX_READ_LEN )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &tmp->cigOp[ i + 2 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                            ops += 2;
-                            tmp->cigOp[ i + 2 ].length = r;
-                            tmp->cigOp[ i ].length = l;
-                            
-                            tmp->cigOp[ i + 1 ].length = 0;
-                            tmp->cigOp[ i + 1 ].type = 2;
-                            tmp->cigOp[ i + 1 ].code = 'N';
-                            rev += 2;
-                            i += 2;
-                        }
-                        else if ( i + 1 < rev )
-                        {
-                            if ( tmp->cigOp[ i + 1 ].type == 2 )
-                                 tmp->cigOp[ i + 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= MAX_READ_LEN )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &tmp->cigOp[ i + 1 ], &tmp->cigOp[ i ], ( ops - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-                                ops += 1;
-                                tmp->cigOp[ i + 1 ].length = 0;
-                                tmp->cigOp[ i + 1 ].type = 2;
-                                tmp->cigOp[ i + 1 ].code = 'N';
-                                rev += 1;
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            for ( gapno = 3, i = 0; gapno > 1 && i < ops; ++i )
-            {
-                if ( tmp->cigOp[ i ].code == 'N' )
-                    tmp->gap[ --gapno ] = i;
-            }
-            tmp->gap[ 0 ] = rev;
-            tmp->cigOp[ rev ].code = 'B';
-            memmove( &tmp->cigOp[ rev + 1 ], &tmp->cigOp[ rev ], ( ops - rev ) * sizeof( tmp->cigOp[ 0 ] ) );
-            ops += 1;
-            tmp->cigOp[ rev + 1 ].code = 'M';
-            tmp->opCnt = ops;
-            print_CG_cigar( __LINE__, tmp->cigOp, ops, tmp->gap );
-            return 0;
-        }
-    }
-    return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-}
-
-
-static rc_t adjust_cigar( const cg_cigar_input * input, cg_cigar_temp * tmp, cg_cigar_output * output )
-{
-    rc_t rc = 0;
-    unsigned i, j;
-
-    print_CG_cigar( __LINE__, tmp->cigOp, tmp->opCnt, NULL );
-
-    /* remove zero length ops */
-    for ( j = i = 0; i < tmp->opCnt; )
-    {
-        if ( tmp->cigOp[ j ].length == 0 )
-        {
-            ++j;
-            --(tmp->opCnt);
-            continue;
-        }
-        tmp->cigOp[ i++ ] = tmp->cigOp[ j++ ];
-    }
-
-    print_CG_cigar( __LINE__, tmp->cigOp, tmp->opCnt, NULL );
-
-    if ( input->edit_dist_available )
-    {
-        int const adjusted = input->edit_dist + tmp->S_adjust - tmp->CG_adjust;
-        output->edit_dist = adjusted > 0 ? adjusted : 0;
-        SAM_DUMP_DBG( 4, ( "NM: before: %u, after: %u(+%u-%u)\n", input->edit_dist, output->edit_dist, tmp->S_adjust, tmp->CG_adjust ) );
-    }
-    else
-    {
-        output->edit_dist = input->edit_dist;
-    }
-
-    /* merge adjacent ops */
-    for ( i = tmp->opCnt; i > 1; )
-    {
-        --i;
-        if ( tmp->cigOp[ i - 1 ].code == tmp->cigOp[ i ].code )
-        {
-            tmp->cigOp[ i - 1 ].length += tmp->cigOp[ i ].length;
-            memmove( &tmp->cigOp[ i ], &tmp->cigOp[ i + 1 ], ( tmp->opCnt - 1 - i ) * sizeof( tmp->cigOp[ 0 ] ) );
-            --(tmp->opCnt);
-        }
-    }
-    print_CG_cigar( __LINE__, tmp->cigOp, tmp->opCnt, NULL );
-    for ( i = j = 0; i < tmp->opCnt && rc == 0; ++i )
-    {
-        size_t sz;
-        rc = string_printf( &output->cigar[ j ], sizeof( output->cigar ) - j, &sz, "%u%c", tmp->cigOp[ i ].length, tmp->cigOp[ i ].code );
-        j += sz;
-    }
-    output->cigar_len = j;
-    return rc;
-}
-
-
-rc_t make_cg_cigar( const cg_cigar_input * input, cg_cigar_output * output )
-{
-    rc_t rc;
-    cg_cigar_temp tmp;
-    memset( &tmp, 0, sizeof tmp );
-
-    rc = CIGAR_to_CG_Ops( input, &tmp );
-    if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcFormat )
-    {
-        memmove( &output->cigar[ 0 ], &input->p_cigar.ptr[ 0 ], input->p_cigar.len );
-        output->cigar_len = input->p_cigar.len;
-        output->cigar[ output->cigar_len ] = 0;
-        output->edit_dist = input->edit_dist;
-        output->p_cigar.ptr = output->cigar;
-        output->p_cigar.len = output->cigar_len;
-        rc = 0;
-    }
-    else if ( rc == 0 )
-    {
-        if ( tmp.CG_adjust == 0 )
-        {
-            if ( tmp.gap[ 0 ] < tmp.opCnt )
-                tmp.CG_adjust = tmp.cigOp[ tmp.gap[ 0 ] ].length;
-
-            if ( tmp.gap[ 1 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 1 ] ].length;
-
-            if ( tmp.gap[ 2 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 2 ] ].length;
-        }
-
-        rc = adjust_cigar( input, &tmp, output );
-    }
-    return rc;
-}
-
-
-static char merge_M_type_ops( char a, char b )
-{ /*MX=*/
-    char c = 0;
-    switch( b )
-    {
-        case 'X' :  switch( a )
-                    {
-                        case '=' : c = 'X'; break;
-                        case 'X' : c = 'M'; break; /**we don't know - 2X may create '=' **/
-                        case 'M' : c = 'M'; break;
-                    }
-                    break;
-        case 'M' :  c = 'M'; break;
-        case '=' :  c = a; break;
-    }
-    assert( c != 0 );
-    return c;
-}
-
-
-static size_t fmt_cigar_elem( char * dst, uint32_t cig_oplen, char cig_op )
-{
-    size_t num_writ;
-    rc_t rc = string_printf ( dst, 11, &num_writ, "%d%c", cig_oplen, cig_op );
-    assert ( rc == 0 && num_writ > 1 );
-    return num_writ;
-}
-
-uint32_t CombineCIGAR( char dst[], CigOps const seqOp[], uint32_t seq_len,
-                       uint32_t refPos, CigOps const refOp[], uint32_t ref_len )
-{
-    bool done = false;
-    uint32_t ciglen = 0, last_ciglen = 0, last_cig_oplen = 0;
-    int32_t si = 0, ri = 0;
-    char last_cig_op = '0'; /* never used operation, forces a mismatch in MACRO_BUILD_CIGAR */
-    CigOps seq_cop = { 0, 0, 0, 0 }, ref_cop = { 0, 0, 0, 0 };
-    int32_t seq_pos = 0;        /** seq_pos is tracked roughly - with every extraction from seqOp **/
-    int32_t ref_pos = 0;        /** ref_pos is tracked precisely - with every delta and consumption in cigar **/
-    int32_t delta = refPos;     /*** delta in relative positions of seq and ref **/
-                                /*** when delta < 0 - rewind or extend the reference ***/
-                                /*** wher delta > 0 - skip reference  ***/
-#define MACRO_BUILD_CIGAR(OP,OPLEN) \
-	if( last_cig_oplen > 0 && last_cig_op == OP){							\
-                last_cig_oplen += OPLEN;								\
-                ciglen = last_ciglen + fmt_cigar_elem( dst + last_ciglen, last_cig_oplen,last_cig_op );	\
-        } else {											\
-                last_ciglen = ciglen;									\
-                last_cig_oplen = OPLEN;									\
-                last_cig_op    = OP;									\
-                ciglen = ciglen      + fmt_cigar_elem( dst + last_ciglen, last_cig_oplen, last_cig_op );	\
-        }
-    while( !done )
-    {
-        while ( delta < 0 )
-        { 
-            ref_pos += delta; /** we will make it to back up this way **/
-            if( ri > 0 )
-            { /** backing up on ref if possible ***/
-                int avail_oplen = refOp[ ri - 1 ].oplen - ref_cop.oplen;
-                if ( avail_oplen > 0 )
-                {
-                    if ( ( -delta ) <= avail_oplen * ref_cop.ref_sign )
-                    { /*** rewind within last operation **/
-                        ref_cop.oplen -= delta;
-                        delta -= delta * ref_cop.ref_sign;
-                    }
-                    else
-                    { /*** rewind the whole ***/
-                        ref_cop.oplen += avail_oplen;
-                        delta += avail_oplen * ref_cop.ref_sign;
-                    }
-                }
-                else
-                {
-                    ri--;
-                    /** pick the previous as used up **/
-                    ref_cop = refOp[ri-1];
-                    ref_cop.oplen =0; 
-                }
-            }
-            else
-            { /** extending the reference **/
-                SetCigOp( &ref_cop, '=', ref_cop.oplen - delta );
-                delta = 0;
-            }
-            ref_pos -= delta; 
-        }
-        if ( ref_cop.oplen == 0 )
-        { /*** advance the reference ***/
-            ref_cop = refOp[ri++];
-            if ( ref_cop.oplen == 0 )
-            { /** extending beyond the reference **/
-                SetCigOp( &ref_cop,'=', 1000 );
-            }
-            assert( ref_cop.oplen > 0 );
-        }
-        if ( delta > 0 )
-        { /***  skip refOps ***/
-            ref_pos += delta; /** may need to back up **/
-            if ( delta >=  ref_cop.oplen )
-            { /** full **/
-                delta -= ref_cop.oplen * ref_cop.ref_sign;
-                ref_cop.oplen = 0;
-            }
-            else
-            { /** partial **/
-                ref_cop.oplen -= delta;
-                delta -= delta * ref_cop.ref_sign;
-            }
-            ref_pos -= delta; /** if something left - restore ***/
-            continue;
-        }
-
-        /*** seq and ref should be synchronized here **/
-        assert( delta == 0 );
-        if ( seq_cop.oplen == 0 )
-        { /*** advance sequence ***/
-            if ( seq_pos < seq_len )
-            {
-                seq_cop = seqOp[ si++ ];
-                assert( seq_cop.oplen > 0 );
-                seq_pos += seq_cop.oplen * seq_cop.seq_sign;
-            }
-            else
-            {
-                done=true;
-            }
-        }
-
-        if( !done )
-        {
-            int seq_seq_step = seq_cop.oplen * seq_cop.seq_sign; /** sequence movement**/
-            int seq_ref_step = seq_cop.oplen * seq_cop.ref_sign; /** influence of sequence movement on intermediate reference **/
-            int ref_seq_step = ref_cop.oplen * ref_cop.seq_sign; /** movement of the intermediate reference ***/
-            int ref_ref_step = ref_cop.oplen * ref_cop.ref_sign; /** influence of the intermediate reference movement on final reference ***/
-            assert( ref_ref_step >= 0 ); /** no B in the reference **/
-            if ( seq_ref_step <= 0 )
-            { /** BSIPH in the sequence against anything ***/
-                MACRO_BUILD_CIGAR( seq_cop.op, seq_cop.oplen );
-                seq_cop.oplen = 0;
-                delta = seq_ref_step; /** if negative - will force rewind next cycle **/
-            }
-            else if ( ref_ref_step <= 0 )
-            { /** MX=DN against SIPH in the reference***/
-                if ( ref_seq_step == 0 )
-                { /** MX=DN against PH **/
-                    MACRO_BUILD_CIGAR( ref_cop.op,ref_cop.oplen);
-                    ref_cop.oplen = 0;
-                }
-                else
-                {
-                    int min_len = ( seq_cop.oplen < ref_cop.oplen ) ? seq_cop.oplen : ref_cop.oplen;
-                    if( seq_seq_step == 0 )
-                    { /** DN agains SI **/
-                        MACRO_BUILD_CIGAR( 'P', min_len );
-                    }
-                    else
-                    { /** MX= agains SI ***/
-                        MACRO_BUILD_CIGAR( ref_cop.op,min_len );
-                    }
-                    seq_cop.oplen -= min_len;
-                    ref_cop.oplen -= min_len;
-                }
-            }
-            else
-            {
-                /*MX=DN  against MX=DN*/
-                int min_len = ( seq_cop.oplen < ref_cop.oplen ) ? seq_cop.oplen : ref_cop.oplen;
-                if ( seq_seq_step == 0 )
-                { /* DN against MX=DN */
-                    if ( ref_seq_step == 0 )
-                    { /** padding DN against DN **/
-                        MACRO_BUILD_CIGAR( 'P', min_len );
-                        ref_cop.oplen -= min_len;
-                        seq_cop.oplen -= min_len;
-                    }
-                    else
-                    { /* DN against MX= **/
-                        MACRO_BUILD_CIGAR( seq_cop.op, min_len );
-                        seq_cop.oplen -= min_len;
-                    }
-                }
-                else if ( ref_cop.seq_sign == 0 )
-                { /* MX= against DN - always wins */
-                    MACRO_BUILD_CIGAR( ref_cop.op, min_len );
-                    ref_cop.oplen -= min_len;
-                }
-                else
-                { /** MX= against MX= ***/
-                    char curr_op = merge_M_type_ops( seq_cop.op, ref_cop.op );
-                    /* or otherwise merge_M_type_ops() will be called twice by the macro! */
-                    MACRO_BUILD_CIGAR( curr_op, min_len );
-                    ref_cop.oplen -= min_len;
-                    seq_cop.oplen -= min_len;
-                }
-                ref_pos += min_len;
-            }
-        }
-    }
-    return ciglen;
-}
-
-
-typedef struct cg_merger
-{
-    char newSeq[ MAX_READ_LEN ];
-    char newQual[ MAX_READ_LEN ];
-    char tags[ MAX_CG_CIGAR_LEN * 2 ];
-} cg_merger;
-
-
-rc_t merge_cg_cigar( const cg_cigar_input * input, cg_cigar_output * output )
-{
-    rc_t rc;
-    cg_cigar_temp tmp;
-    memset( &tmp, 0, sizeof tmp );
-
-    rc = CIGAR_to_CG_Ops( input, &tmp );
-    if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcFormat )
-    {
-        memmove( &output->cigar[ 0 ], &input->p_cigar.ptr[ 0 ], input->p_cigar.len );
-        output->cigar_len = input->p_cigar.len;
-        output->cigar[ output->cigar_len ] = 0;
-        output->edit_dist = input->edit_dist;
-        rc = 0;
-    }
-    else if ( rc == 0 )
-    {
-
-        if ( tmp.CG_adjust == 0 )
-        {
-            if ( tmp.gap[ 0 ] < tmp.opCnt )
-                tmp.CG_adjust = tmp.cigOp[ tmp.gap[ 0 ] ].length;
-
-            if ( tmp.gap[ 1 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 1 ] ].length;
-
-            if ( tmp.gap[ 2 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 2 ] ].length;
-        }
-
-        rc = adjust_cigar( input, &tmp, output );
-
-    }
-    return rc;
-}
-
-
-rc_t make_cg_merge( const cg_cigar_input * input, cg_cigar_output * output )
-{
-    rc_t rc;
-    cg_cigar_temp tmp;
-    memset( &tmp, 0, sizeof tmp );
-
-    rc = CIGAR_to_CG_Ops( input, &tmp );
-    if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcFormat )
-    {
-        memmove( &output->cigar[ 0 ], &input->p_cigar.ptr[ 0 ], input->p_cigar.len );
-        output->cigar_len = input->p_cigar.len;
-        output->cigar[ output->cigar_len ] = 0;
-        output->edit_dist = input->edit_dist;
-        rc = 0;
-    }
-    else if ( rc == 0 )
-    {
-
-        if ( tmp.CG_adjust == 0 )
-        {
-            if ( tmp.gap[ 0 ] < tmp.opCnt )
-                tmp.CG_adjust = tmp.cigOp[ tmp.gap[ 0 ] ].length;
-
-            if ( tmp.gap[ 1 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 1 ] ].length;
-
-            if ( tmp.gap[ 2 ] < tmp.opCnt )
-                tmp.CG_adjust += tmp.cigOp[ tmp.gap[ 2 ] ].length;
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        uint32_t const B_len = tmp.cigOp[ tmp.gap[ 0 ] ].length;
-        uint32_t const B_at = tmp.gap[ 0 ] < tmp.gap[ 2 ] ? 5 : 30;
-            
-        if ( 0 < B_len && B_len < 5 )
-        {
-            memcpy( output->newSeq,  input->p_read.ptr, MAX_READ_LEN );
-            memcpy( output->newQual, input->p_quality.ptr, MAX_READ_LEN );
-            
-            output->p_read.ptr = output->newSeq;
-            output->p_read.len = ( MAX_READ_LEN - B_len );
-            
-            output->p_quality.ptr = output->newQual;
-            output->p_quality.len = ( MAX_READ_LEN - B_len );
-            
-            output->p_tags.ptr = output->tags;
-            output->p_tags.len = 0;
-
-            /* nBnM -> nB0M */
-            tmp.cigOp[ tmp.gap[ 0 ] + 1 ].length -= B_len;
-            if ( tmp.gap[ 0 ] < tmp.gap[ 2 ] )
-            {
-                size_t written;
-                rc = string_printf( output->tags, sizeof( output->tags ), &written,
-                                    "GC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                                    5 - B_len, B_len, 30 - B_len, 2 * B_len, &output->newSeq[ 5 - B_len ], 2 * B_len, &output->newQual[ 5 - B_len ] );
-                if ( rc == 0 )
-                    output->p_tags.len = written;
-                memmove( &tmp.cigOp[ tmp.gap[ 0 ] ],
-                         &tmp.cigOp[ tmp.gap[ 0 ] + 1 ],
-                         ( tmp.opCnt - ( tmp.gap[ 0 ] + 1 ) ) * sizeof( tmp.cigOp[ 0 ] ) );
-                --tmp.opCnt;
-            }
-            else
-            {
-                size_t written;
-                rc = string_printf( output->tags, sizeof( output->tags ), &written,
-                                    "GC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                                    30 - B_len, B_len, 5 - B_len, 2 * B_len, &output->newSeq[ 30 - B_len ], 2 * B_len, &output->newQual[ 30 - B_len ] );
-                if ( rc == 0 )
-                    output->p_tags.len = written;
-                memmove( &tmp.cigOp[ tmp.gap[ 0 ] ],
-                         &tmp.cigOp[ tmp.gap[ 0 ] + 1 ],
-                         ( tmp.opCnt - ( tmp.gap[ 0 ] + 1 ) ) * sizeof( tmp.cigOp[ 0 ] ) );
-                --tmp.opCnt;
-            }
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for ( i = B_at; i < B_at + B_len; ++i )
-                {
-                    uint32_t const Lq = output->newQual[ i - B_len ];
-                    uint32_t const Rq = output->newQual[ i ];
-
-                    if ( Lq <= Rq )
-                    {
-                        output->newSeq[ i - B_len ] = output->newSeq[ i ];
-                        output->newQual[ i - B_len ] = Rq;
-                    }
-                    else
-                    {
-                        output->newSeq[ i ] = output->newSeq[ i - B_len ];
-                        output->newQual[ i ] = Lq;
-                    }
-                }
-                memmove( &output->newSeq [ B_at ], &output->newSeq [ B_at + B_len ], MAX_READ_LEN - B_at - B_len );
-                memmove( &output->newQual[ B_at ], &output->newQual[ B_at + B_len ], MAX_READ_LEN - B_at - B_len );
-            }
-        }
-        else
-        {
-            uint32_t i, len = tmp.cigOp[ tmp.gap[ 0 ] ].length;
-            
-            tmp.cigOp[ tmp.gap[ 0 ] ].code = 'I';
-            for ( i = tmp.gap[ 0 ] + 1; i < tmp.opCnt && len > 0; ++i )
-            {
-                if ( tmp.cigOp[ i ].length <= len )
-                {
-                    len -= tmp.cigOp[ i ].length;
-                    tmp.cigOp[ i ].length = 0;
-                }
-                else
-                {
-                    tmp.cigOp[ i ].length -= len;
-                    len = 0;
-                }
-            }
-            tmp.CG_adjust -= tmp.cigOp[ tmp.gap[ 0 ] ].length;
-        }
-    }
-
-    if ( rc == 0 )
-        rc = adjust_cigar( input, &tmp, output );
-
-    return rc;
-}
-
-#define MAX_RNA_SPLICE_CIGOPS 200
-
-rc_t discover_rna_splicing_candidates( uint32_t cigar_len, const char * cigar, uint32_t min_len, rna_splice_candidates * candidates )
-{
-    rc_t rc = 0;
-    uint32_t cigops_len = cigar_len / 2 + 1;
-    CigOps * cigops = malloc( ( sizeof * cigops ) * cigops_len );
-    if ( cigops == NULL )
-        rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        int32_t op_idx;
-        uint32_t offset = 0;
-        int32_t n_cigops = ExplodeCIGAR( cigops, cigops_len, cigar, cigar_len );
-        candidates->count = 0;
-        for ( op_idx = 0; op_idx < ( n_cigops - 1 ); op_idx++ )
-        {
-            char op_code = cigops[ op_idx ].op;
-            uint32_t op_len = cigops[ op_idx ].oplen;
-            if ( op_code == 'D' && op_len >= min_len && candidates->count < MAX_RNA_SPLICE_CANDIDATES )
-            {
-                rna_splice_candidate * rsc = &candidates->candidates[ candidates->count++ ];
-                rsc->offset = offset;
-                rsc->len = op_len;
-                rsc->op_idx = op_idx;
-                rsc->matched = 0;
-            }
-            if ( op_code == 'M' || op_code == 'X' || op_code == '=' || op_code == 'D' || op_code == 'N' )
-                offset += op_len;
-        }
-        free( cigops );
-    }
-    return rc;
-}
-
-
-rc_t change_rna_splicing_cigar( uint32_t cigar_len, char * cigar, rna_splice_candidates * candidates )
-{
-    rc_t rc = 0;
-    uint32_t cigops_len = cigar_len / 2;
-    CigOps * cigops = malloc( ( sizeof * cigops ) * cigops_len );
-    if ( cigops == NULL )
-        rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        int32_t idx, dst;
-        int32_t n_cigops = ExplodeCIGAR( cigops, MAX_RNA_SPLICE_CIGOPS, cigar, cigar_len );
-        for ( idx = 0; idx < candidates->count; ++idx )    
-        {
-            rna_splice_candidate * rsc = &candidates->candidates[ idx ];
-            if ( rsc->matched != 0 && cigops[ rsc->op_idx ].op == 'D' )
-                cigops[ rsc->op_idx ].op = 'N';
-        }
-
-        for ( idx = 0, dst = 0; idx < ( n_cigops - 1 ) && rc == 0; ++idx )
-        {
-            size_t sz;
-            rc = string_printf( &cigar[ dst ], cigar_len + 1 - dst, &sz, "%u%c", cigops[ idx ].oplen, cigops[ idx ].op );
-            dst += sz;
-        }
-        free( cigops );
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/cg_tools.h b/tools/sra-pileup/cg_tools.h
deleted file mode 100644
index b60bdb3..0000000
--- a/tools/sra-pileup/cg_tools.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_cgtools_
-#define _h_cgtools_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/rc.h>
-#include <insdc/sra.h>
-
-#define MAX_CG_CIGAR_LEN ( ( 11 * 35 ) + 1 )
-#define MAX_GC_LEN ( ( 11 * 3 ) + 1 )
-#define MAX_READ_LEN ( 35 )
-
-
-typedef struct ptr_len
-{
-    const char * ptr;
-    uint32_t len;
-} ptr_len;
-
-typedef struct cg_cigar_input
-{
-    ptr_len p_cigar;
-    ptr_len p_read;
-    ptr_len p_quality;
-
-    bool orientation;
-    INSDC_coord_one seq_req_id;
-    bool edit_dist_available;
-    int32_t edit_dist;
-} cg_cigar_input;
-
-
-typedef struct cg_cigar_output
-{
-    char cigar[ MAX_CG_CIGAR_LEN ];
-    uint32_t cigar_len;
-
-    ptr_len p_cigar;
-    ptr_len p_read;
-    ptr_len p_quality;
-    ptr_len p_tags;
-
-    char newSeq[ MAX_READ_LEN ];
-    char newQual[ MAX_READ_LEN ];
-    char tags[ MAX_CG_CIGAR_LEN * 2 ];
-
-    int32_t edit_dist;
-} cg_cigar_output;
-
-
-rc_t make_cg_cigar( const cg_cigar_input * input, cg_cigar_output * output );
-
-rc_t make_cg_merge( const cg_cigar_input * input, cg_cigar_output * output );
-
-
-typedef struct CigOps
-{
-    char op;
-    int8_t   ref_sign; /* 0;+1;-1; ref_offset = ref_sign * offset */
-    int8_t   seq_sign; /* 0;+1;-1; seq_offset = seq_sign * offset */
-    uint32_t oplen;
-} CigOps;
-
-
-int32_t ExplodeCIGAR( CigOps dst[], uint32_t len, char const cigar[], uint32_t ciglen );
-
-uint32_t CombineCIGAR( char dst[], CigOps const seqOp[], uint32_t seq_len,
-                       uint32_t refPos, CigOps const refOp[], uint32_t ref_len );
-
-
-typedef struct rna_splice_candidate
-{
-    uint32_t offset;
-    uint32_t len;
-    uint32_t op_idx;
-    uint32_t matched;
-} rna_splice_candidate;
-
-
-#define MAX_RNA_SPLICE_CANDIDATES 10
-
-typedef struct rna_splice_candidates
-{
-    rna_splice_candidate candidates[ MAX_RNA_SPLICE_CANDIDATES ];
-    uint32_t count, fwd_matched, rev_matched;
-} rna_splice_candidates;
-
-
-rc_t discover_rna_splicing_candidates( uint32_t cigar_len, const char * cigar, uint32_t min_len, rna_splice_candidates * candidates );
-
-rc_t change_rna_splicing_cigar( uint32_t cigar_len, char * cigar, rna_splice_candidates * candidates );
-
-#endif
\ No newline at end of file
diff --git a/tools/sra-pileup/cmdline_cmn.c b/tools/sra-pileup/cmdline_cmn.c
deleted file mode 100644
index 28b3be1..0000000
--- a/tools/sra-pileup/cmdline_cmn.c
+++ /dev/null
@@ -1,1058 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "cmdline_cmn.h"
-
-#include <kapp/args.h>
-
-#include <vdb/report.h> /* ReportResetTable */
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-
-#include <sra/srapath.h>
-
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-
-const char * ref_usage[] = { "Filter by position on genome.",
-                             "Name can either be file specific name",
-                             "(ex: \"chr1\" or \"1\").",
-                             "\"from\" and \"to\" are 1-based coordinates",
-                             NULL };
-
-const char * outf_usage[] = { "Output will be written to this file",
-                              "instead of std-out", NULL };
-
-const char * table_usage[] = { "Which alignment table(s) to use (p|s|e):", 
-                               "p - primary, s - secondary, e - evidence-interval", 
-                               "(default = p)", NULL };
-
-const char * gzip_usage[] = { "Compress output using gzip", NULL };
-
-const char * bzip_usage[] = { "Compress output using bzip2", NULL };
-
-const char * inf_usage[] = { "File with all input-parameters / options", NULL };
-
-const char * schema_usage[] = { "optional schema-file to be used", NULL };
-
-#define OPTION_REF     "aligned-region"
-#define ALIAS_REF      "r"
-
-#define OPTION_OUTF    "outfile"
-#define ALIAS_OUTF     "o"
-
-#define OPTION_TABLE   "table"
-#define ALIAS_TABLE    "t"
-
-#define OPTION_GZIP    "gzip"
-#define ALIAS_GZIP     NULL
-
-#define OPTION_BZIP    "bzip2"
-#define ALIAS_BZIP     NULL
-
-#define OPTION_INF    "infile"
-#define ALIAS_INF     "f"
-
-#define OPTION_SCHEMA "schema"
-#define ALIAS_SCHEMA  "S"
-
-OptDef CommonOptions[] =
-{
-    /*name,           alias,         hfkt, usage-help,    maxcount, needs value, required */
-    { OPTION_REF,     ALIAS_REF,     NULL, ref_usage,     0,        true,        false },
-    { OPTION_OUTF,    ALIAS_OUTF,    NULL, outf_usage,    1,        true,        false },
-    { OPTION_TABLE,   ALIAS_TABLE,   NULL, table_usage,   1,        true,        false },
-    { OPTION_GZIP,    ALIAS_GZIP,    NULL, gzip_usage,    1,        false,       false },
-    { OPTION_BZIP,    ALIAS_BZIP,    NULL, bzip_usage,    1,        false,       false },
-    { OPTION_INF,     ALIAS_INF,     NULL, inf_usage,     0,        true,        false },
-    { OPTION_SCHEMA,  ALIAS_SCHEMA,  NULL, schema_usage,  1,        true,        false }
-};
-
-
-/* =========================================================================================== */
-
-static rc_t get_str_option( const Args *args, const char *name, const char ** res )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    *res = NULL;
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-    }
-    else
-    {
-        if ( count > 0 )
-        {
-            rc = ArgsOptionValue( args, name, 0, res );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ArgsOptionValue() failed" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t get_bool_option( const Args *args, const char *name, bool *res, const bool def )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        *res = true;
-    }
-    else
-    {
-        *res = def;
-    }
-    return rc;
-}
-
-/* =========================================================================================== */
-
-rc_t get_common_options( Args * args, common_options *opts )
-{
-    rc_t rc = get_str_option( args, OPTION_OUTF, &opts->output_file );
-
-    if ( rc == 0 )
-        rc = get_str_option( args, OPTION_INF, &opts->input_file );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_GZIP, &opts->gzip_output, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_BZIP, &opts->bzip_output, false );
-
-    if ( rc == 0 )
-        rc = get_str_option( args, OPTION_SCHEMA, &opts->schema_file );
-
-    if ( rc == 0 )
-    {
-        const char * table2use = NULL;
-        rc = get_str_option( args, OPTION_TABLE, &table2use );
-        opts->tab_select = primary_ats;
-        if ( rc == 0 && table2use != NULL )
-        {
-            size_t l = string_size ( table2use );
-            opts->tab_select = 0;
-            if ( ( string_chr ( table2use, l, 'p' ) != NULL )||
-                 ( string_chr ( table2use, l, 'P' ) != NULL ) )
-            { opts->tab_select |= primary_ats; };
-
-            if ( ( string_chr ( table2use, l, 's' ) != NULL )||
-                 ( string_chr ( table2use, l, 'S' ) != NULL ) )
-            { opts->tab_select |= secondary_ats; };
-
-            if ( ( string_chr ( table2use, l, 'e' ) != NULL )||
-                 ( string_chr ( table2use, l, 'E' ) != NULL ) )
-            { opts->tab_select |= evidence_ats; };
-        }
-    }
-
-    return rc;
-}
-
-void print_common_helplines( void )
-{
-    HelpOptionLine ( ALIAS_REF, OPTION_REF, "name[:from-to]", ref_usage );
-    HelpOptionLine ( ALIAS_OUTF, OPTION_OUTF, "output-file", outf_usage );
-    HelpOptionLine ( ALIAS_TABLE, OPTION_TABLE, "shortcut", table_usage );
-    HelpOptionLine ( ALIAS_BZIP, OPTION_BZIP, NULL, bzip_usage );
-    HelpOptionLine ( ALIAS_GZIP, OPTION_GZIP, NULL, gzip_usage );
-}
-
-
-OptDef * CommonOptions_ptr( void )
-{
-    return &CommonOptions[ 0 ];
-}
-
-size_t CommonOptions_count( void )
-{
-    return ( sizeof CommonOptions / sizeof CommonOptions [ 0 ] );
-}
-
-
-/* =========================================================================================== */
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-
-/* =========================================================================================== */
-
-
-typedef struct range
-{
-    uint32_t start;
-    uint32_t end;
-} range;
-
-
-static range * make_range( const uint64_t start, const uint64_t end )
-{
-    range *res = calloc( sizeof *res, 1 );
-    if ( res != NULL )
-    {
-        res->start = start;
-        res->end = end;
-    }
-    return res;
-}
-
-
-static int cmp_range( const range * a, const range * b )
-{
-
-    int res = ( a->start - b->start );
-    if ( res == 0 )
-        res = ( a->end - b->end );
-    return res;
-}
-
-
-static bool range_overlapp( const range * a, const range * b )
-{
-    return ( !( ( b->end < a->start ) || ( b->start > a->end ) ) );
-}
-
-
-/* =========================================================================================== */
-
-typedef struct reference_region
-{
-    BSTNode node;
-    const char * name;
-    Vector ranges;
-} reference_region;
-
-
-static reference_region * make_reference_region( const char *name )
-{
-    reference_region *res = calloc( sizeof *res, 1 );
-    if ( res != NULL )
-    {
-        res->name = string_dup_measure ( name, NULL );
-        VectorInit ( &res->ranges, 0, 5 );
-    }
-    return res;
-}
-
-
-static int CC cmp_range_wrapper( const void *item, const void *n )
-{   return cmp_range( item, n ); }
-
-
-static rc_t add_ref_region_range( reference_region * self, const uint64_t start, const uint64_t end )
-{
-    rc_t rc = 0;
-    range *r = make_range( start, end );
-    if ( r == NULL )
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = VectorInsert ( &self->ranges, r, NULL, cmp_range_wrapper );
-        if ( rc != 0 )
-            free( r );
-    }
-    return rc;
-}
-
-
-#define RR_NAME  1
-#define RR_START 2
-#define RR_END   3
-
-
-static void put_c( char *s, size_t size, size_t *dst, char c )
-{
-    if ( *dst < ( size - 1 ) )
-        s[ *dst ] = c;
-    (*dst)++;
-}
-
-static void finish_txt( char *s, size_t size, size_t *dst )
-{
-    if ( *dst > size )
-        s[ size - 1 ] = 0;
-    else
-        s[ *dst ] = 0;
-    *dst = 0;
-}
-
-static uint64_t finish_num( char *s, size_t size, size_t *dst )
-{
-    uint64_t res = 0;
-    char *endp;
-    finish_txt( s, size, dst );
-    res = strtou64( s, &endp, 10 );
-    return res;
-}
-
-
-/* s = refname:1000-2000 */
-static void parse_definition( const char *s, char * name, size_t len,
-                              uint64_t *start, uint64_t *end )
-{
-    size_t n = string_size( s );
-
-    *start = 0;
-    *end   = 0;
-    name[ 0 ] = 0;
-    if ( n > 0 )
-    {
-        size_t i, st, dst = 0;
-        char tmp[ 32 ];
-        st = RR_NAME;
-        for ( i = 0; i < n; ++i )
-        {
-            char c = s[ i ];
-            switch( st )
-            {
-                case RR_NAME  : if ( c == ':' )
-                                {
-                                    finish_txt( name, len, &dst );
-                                    st = RR_START;
-                                }
-                                else
-                                {
-                                    put_c( name, len, &dst, c );
-                                }
-                                break;
-
-                case RR_START : if ( c == '-' )
-                                {
-                                    *start = finish_num( tmp, sizeof tmp, &dst );
-                                    st = RR_END;
-                                }
-                                else if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-
-                case RR_END   : if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-            }
-        }
-        switch( st )
-        {
-            case RR_NAME  : finish_txt( name, len, &dst );
-                            break;
-
-            case RR_START : *start = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-
-            case RR_END   : *end = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-        }
-    }
-}
-
-
-static void CC release_range_wrapper( void * item, void * data )
-{
-    free( item );
-}
-
-
-static void free_reference_region( reference_region * self )
-{
-    free( (void*)self->name );
-    VectorWhack ( &self->ranges, release_range_wrapper, NULL );
-    free( self );
-}
-
-
-static void check_ref_region_ranges( reference_region * self )
-{
-    uint32_t n = VectorLength( &self->ranges );
-    uint32_t i = 0;
-    range *a = NULL;
-    while ( i < n )
-    {
-        range *b = VectorGet ( &self->ranges, i );
-        bool remove = false;
-        if ( a != NULL )
-        {
-            remove = range_overlapp( a, b );
-            if ( remove )
-            {
-                range *r;
-                a->end = b->end;
-                VectorRemove ( &self->ranges, i, (void**)&r );
-                free( r );
-                n--;
-            }
-        }
-        if ( !remove )
-        {
-            a = b;
-            ++i;
-        }
-    }
-}
-
-
-/* =========================================================================================== */
-
-
-static int CC reference_vs_pchar_wrapper( const void *item, const BSTNode *n )
-{
-    const reference_region * r = ( const reference_region * )n;
-    return cmp_pchar( (const char *)item, r->name );
-}
-
-static reference_region * find_reference_region( BSTree * regions, const char * name )
-{
-    return ( reference_region * ) BSTreeFind ( regions, name, reference_vs_pchar_wrapper );
-}
-
-static int CC ref_vs_ref_wrapper( const BSTNode *item, const BSTNode *n )
-{
-   const reference_region * a = ( const reference_region * )item;
-   const reference_region * b = ( const reference_region * )n;
-   return cmp_pchar( a->name, b->name );
-}
-
-static rc_t add_refrange( BSTree * regions, const char * name, const uint64_t start, const uint64_t end )
-{
-    rc_t rc;
-
-    reference_region * r = find_reference_region( regions, name );
-    if ( r == NULL )
-    {
-        r = make_reference_region( name );
-        if ( r == NULL )
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        else
-            rc = add_ref_region_range( r, start, end );
-        if ( rc == 0 )
-            rc = BSTreeInsert ( regions, (BSTNode *)r, ref_vs_ref_wrapper );
-        if ( rc != 0 )
-            free_reference_region( r );
-    }
-    else
-    {
-        rc = add_ref_region_range( r, start, end );
-    }
-    return rc;
-}
-
-
-rc_t parse_and_add_region( BSTree * regions, const char * s )
-{
-    uint64_t start, end;
-    char name[ 64 ];
-    parse_definition( s, name, sizeof name, &start, &end );
-    if ( name[ 0 ] == 0 )
-        return RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-        return add_refrange( regions, name, start, end );
-}
-
-
-static void CC check_refrange_wrapper( BSTNode *n, void *data )
-{
-    check_ref_region_ranges( ( reference_region * ) n );
-}
-
-
-void check_ref_regions( BSTree * regions )
-{
-    BSTreeForEach ( regions, false, check_refrange_wrapper, NULL );
-}
-
-
-static void CC release_ref_region_wrapper( BSTNode *n, void * data )
-{
-    free_reference_region( ( reference_region * ) n );
-}
-
-
-void free_ref_regions( BSTree * regions )
-{    
-    BSTreeWhack ( regions, release_ref_region_wrapper, NULL );
-}
-
-
-rc_t init_ref_regions( BSTree * tree, Args * args )
-{
-    uint32_t count;
-    rc_t rc;
-
-    BSTreeInit( tree );
-    rc = ArgsOptionCount( args, OPTION_REF, &count );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-    }
-    else
-    {
-        uint32_t i;
-        for ( i = 0; i < count && rc == 0; ++i )
-        {
-            const char * s;
-            rc = ArgsOptionValue( args, OPTION_REF, i, &s );
-            if ( rc != 0 )
-                LOGERR( klogInt, rc, "ArgsOptionValue() failed" );
-            else
-                rc = parse_and_add_region( tree, s );
-        }
-    }
-    return rc;
-}
-
-
-static void CC count_ref_region_wrapper( BSTNode *n, void *data )
-{   
-    reference_region * r = ( reference_region * ) n;
-    uint32_t * count = ( uint32_t * ) data;
-    *count += VectorLength( &(r->ranges) );
-}
-
-
-uint32_t count_ref_regions( BSTree * regions )
-{
-    uint32_t res = 0;
-    BSTreeForEach ( regions, false, count_ref_region_wrapper, &res );
-    return res;
-}
-
-
-typedef struct foreach_ref_region_func
-{
-    rc_t ( CC * on_region ) ( const char * name, uint32_t start, uint32_t end, void *data );
-    const char * name;
-    void * data;
-    rc_t rc;
-} foreach_ref_region_func;
-
-
-static void CC foreach_range_vector_wrapper( void *item, void *data )
-{
-    range * r = ( range * ) item;
-    foreach_ref_region_func * func = ( foreach_ref_region_func * )data;
-
-    if ( func->rc == 0 )
-    {
-        func->rc = func->on_region( func->name, r->start, r->end, func->data );
-    }
-}
-
-
-static void CC foreach_ref_region_wrapper( BSTNode *n, void *data )
-{   
-    reference_region * r = ( reference_region * ) n;
-    foreach_ref_region_func * func = ( foreach_ref_region_func * )data;
-
-    if ( func->rc == 0 )
-    {
-        func->name = r->name;
-        VectorForEach ( &(r->ranges), false, foreach_range_vector_wrapper, data );
-    }
-}
-
-
-rc_t foreach_ref_region( BSTree * regions,
-    rc_t ( CC * on_region ) ( const char * name, uint32_t start, uint32_t end, void *data ), 
-    void *data )
-{
-    foreach_ref_region_func func;
-
-    func.on_region = on_region;
-    func.data = data;
-    func.rc = 0;
-    BSTreeForEach ( regions, false, foreach_ref_region_wrapper, &func );
-    return func.rc;
-}
-
-
-/* =========================================================================================== */
-
-#if TOOLS_USE_SRAPATH != 0
-static bool is_this_a_filesystem_path( const char * path )
-{
-    bool res = false;
-    size_t i, n = string_size ( path );
-    for ( i = 0; i < n && !res; ++i )
-    {
-        char c = path[ i ];
-        res = ( c == '.' || c == '/' || c == '\\' );
-    }
-    return res;
-}
-#endif
-
-#if TOOLS_USE_SRAPATH != 0
-static char *translate_accession( SRAPath *my_sra_path,
-                           const char *accession,
-                           const size_t bufsize )
-{
-    rc_t rc;
-    char * res = calloc( 1, bufsize );
-    if ( res == NULL ) return NULL;
-
-    rc = SRAPathFind( my_sra_path, accession, res, bufsize );
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        free( res );
-        return NULL;
-    }
-    else if ( GetRCState( rc ) == rcInsufficient )
-    {
-        free( res );
-        return translate_accession( my_sra_path, accession, bufsize * 2 );
-    }
-    else if ( rc != 0 )
-    {
-        free( res );
-        return NULL;
-    }
-    return res;
-}
-#endif
-
-#if TOOLS_USE_SRAPATH != 0
-static rc_t resolve_accession( const KDirectory *my_dir, char ** path )
-{
-    SRAPath *my_sra_path;
-    rc_t rc = 0;
-
-    if ( strchr ( *path, '/' ) != NULL )
-        return 0;
-
-    rc = SRAPathMake( &my_sra_path, my_dir );
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound || GetRCTarget ( rc ) != rcDylib )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "SRAPathMake() failed" );
-            }
-        }
-        else
-            rc = 0;
-    }
-    else
-    {
-        if ( !SRAPathTest( my_sra_path, *path ) )
-        {
-            char *buf = translate_accession( my_sra_path, *path, 64 );
-            if ( buf != NULL )
-            {
-                free( (char*)(*path) );
-                *path = buf;
-            }
-        }
-        SRAPathRelease( my_sra_path );
-    }
-    return rc;
-}
-#endif
-
-
-/* =========================================================================================== */
-
-
-/****************************************************************************************
-    splits an argument
-
-    example: "/path/file=grp1" into path = "/path/file" and attribute = "grp1"
-    or
-    example: "/path/file" into path = "/path/file" and attribute = NULL
-
-****************************************************************************************/
-static rc_t split_argument( const char *argument, char ** path, char ** attribute, char delim )
-{
-    if ( argument == NULL || path == NULL || attribute == NULL )
-        return RC( rcApp, rcNoTarg, rcConstructing, rcParam, rcNull );
-    else
-    {
-        char * delim_ptr = string_chr ( argument, string_size ( argument ), delim );
-        if ( delim_ptr == NULL )
-        {
-            *path = string_dup_measure( argument, NULL );
-            *attribute = NULL;
-        }
-        else
-        {
-            size_t len = string_size( argument );
-            size_t len1 = ( delim_ptr - argument );
-            *path = string_dup ( argument, len1 );
-            if ( delim_ptr < argument + len - 1 )
-                *attribute = string_dup ( delim_ptr + 1, len - ( len1 + 1 ) );
-            else
-                *attribute = NULL;
-        }
-    }
-    return 0;
-}
-
-
-static rc_t split_vpath_into_path_and_readgroup( VPath *vpath, const char *argument, char ** path, char ** attribute )
-{
-    size_t zz;
-    char readgroup_buffer[ 256 ];
-    rc_t rc1 = VPathOption( vpath, vpopt_readgroup, readgroup_buffer, sizeof readgroup_buffer - 1, &zz );
-    if ( rc1 == 0 )
-        *attribute = string_dup( readgroup_buffer, zz );
-    *path = string_dup( argument, string_size( argument ) );
-    return 0;
-}
-
-
-static rc_t test_split_vpath_into_path_and_readgroup( VPath *vpath, const char *argument, char ** path, char ** attribute )
-{
-    rc_t rc = 0;
-#if 1
-    if ( VPathFromUri ( vpath ) )
-        rc = split_vpath_into_path_and_readgroup ( vpath, argument, path, attribute );
-    else
-        rc = split_argument ( argument, path, attribute, '=' );
-#else
-    VPUri_t uri_type = VPathGetUri_t( vpath );
-    switch ( uri_type )
-    {
-        default:
-        case vpuri_invalid:
-            rc = RC( rcExe, rcParam, rcAccessing, rcPath, rcInvalid );
-            break;
-
-        case vpuri_not_supported:
-            rc = RC( rcExe, rcParam, rcAccessing, rcPath, rcUnsupported );
-            break;
-
-        case vpuri_none:
-            rc = split_argument( argument, path, attribute, '=' );
-            break;
-
-        case vpuri_ncbi_vfs:
-        case vpuri_file:
-        case vpuri_ncbi_acc:
-        case vpuri_http:
-            rc = split_vpath_into_path_and_readgroup( vpath, argument, path, attribute );
-            break;
-    }
-#endif
-    return rc;
-}
-
-
-static rc_t split_argument_into_path_and_readgroup( const char *argument, char ** path, char ** attribute )
-{
-    rc_t rc;
-    char * colon_ptr = string_chr ( argument, string_size ( argument ), ':' );
-    if ( colon_ptr == NULL )
-    {
-        /* we do not have a colon in the argument, that means: there is no uri-syntax involved
-           ---> we can split the "old fashioned way" at the equal-sign */
-        rc = split_argument( argument, path, attribute, '=' );
-    }
-    else
-    {
-        VFSManager * mgr;
-        rc_t rc = VFSManagerMake ( & mgr );
-
-        *path = NULL;
-        *attribute = NULL;
-
-        if ( rc == 0 )
-        {
-            VPath * vpath;
-            rc = VFSManagerMakePath ( mgr, &vpath, argument );
-            if ( rc == 0 )
-            {
-                rc = test_split_vpath_into_path_and_readgroup( vpath, argument, path, attribute );
-                VPathRelease( vpath );
-            }
-
-            VFSManagerRelease ( mgr );
-        }
-    }
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-rc_t foreach_argument( Args * args, KDirectory *dir, bool div_by_spotgrp, bool * empty,
-    rc_t ( CC * on_argument ) ( const char * path, const char * spot_group, void * data ), void * data )
-{
-    uint32_t count;
-    rc_t rc = ArgsParamCount( args, &count );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsParamCount() failed" );
-    }
-    else
-    {
-        uint32_t idx;
-        if ( empty != NULL )
-        {
-            *empty = ( count == 0 );
-        }
-        for ( idx = 0; idx < count && rc == 0; ++idx )
-        {
-            const char *param = NULL;
-            rc = ArgsParamValue( args, idx, &param );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ArgsParamvalue() failed" );
-            }
-            else
-            {
-                
-                char * path = NULL;
-                char * spot_group = NULL;
-
-                rc = split_argument_into_path_and_readgroup( param, &path, &spot_group );
-                if ( rc == 0 && path != NULL )
-                {
-                    /* in case there is no spotgroup-override from the commandline AND
-                       the option to divide by spot-group is set, let spot_group point
-                       to an empty string ---> divide by original spot-group! */
-                    if ( spot_group == NULL && div_by_spotgrp )
-                    {
-                        spot_group = calloc( 1, 1 );
-                    }
-
-#if TOOLS_USE_SRAPATH != 0
-                    if ( !is_this_a_filesystem_path( path ) )
-                    {
-                        rc = resolve_accession( dir, &path );
-                    }
-#endif
-
-                    if ( rc == 0 )
-                    {
-                        rc = on_argument( path, spot_group, data );
-                    }
-
-                    free( path );
-                    if ( spot_group != NULL )
-                        free( spot_group );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-static rc_t prepare_whole_file( prepare_ctx * ctx )
-{
-    rc_t rc = 0;
-    if ( ctx->reflist != NULL )
-    {
-        uint32_t count;
-        rc = ReferenceList_Count( ctx->reflist, &count );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "ReferenceList_Count() failed" );
-        }
-        else
-        {
-            uint32_t idx;
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                rc = ReferenceList_Get( ctx->reflist, &ctx->refobj, idx );
-                if ( rc != 0 )
-                {
-                    LOGERR( klogInt, rc, "ReferenceList_Get() failed" );
-                }
-                else
-                {
-                    rc = ctx->on_section( ctx, 0, 0 );
-                    if ( rc == 0 )
-                        ReferenceObj_Release( ctx->refobj );
-                }
-            }
-        }
-    }
-    else
-    {
-        ctx->refobj = NULL;
-        rc = ctx->on_section( ctx, 0, 0 );
-    }
-    return rc;
-}
-
-
-static rc_t CC prepare_region_cb( const char * name, uint32_t start, uint32_t end, void * data )
-{
-    prepare_ctx * ctx = ( prepare_ctx * )data;
-    rc_t rc = ReferenceList_Find( ctx->reflist, &ctx->refobj, name, string_size( name ) );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ReferenceList_Find() failed" );
-    }
-    else
-    {
-        rc = ctx->on_section( ctx, start, end );
-        if ( rc == 0 )
-            ReferenceObj_Release( ctx->refobj );
-    }
-    return rc;
-}
-
-
-static rc_t prepare_db_table( prepare_ctx *ctx,
-                              const VDBManager *vdb_mgr,
-                              VSchema *vdb_schema,
-                              const char * path )
-{
-    rc_t rc;
-    ctx->db = NULL;
-    ctx->seq_tab = NULL;
-
-    rc = VDBManagerOpenDBRead ( vdb_mgr, &ctx->db, vdb_schema, "%s", path );
-    if ( rc != 0 )
-    {
-        rc = VDBManagerOpenTableRead ( vdb_mgr, &ctx->seq_tab, NULL, "%s", path );
-        if ( rc != 0 )
-        {
-            PLOGERR(klogInt, (klogInt, rc, "failed to open '$(path)'",
-                "path=%s", path));
-        }
-        else {
-            ReportResetTable(path, ctx->seq_tab);
-        }
-    }
-    else
-    {
-        rc = VDatabaseOpenTableRead( ctx->db, &ctx->seq_tab, "SEQUENCE" );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VDatabaseOpenTableRead( SEQUENCE ) failed" );
-        }
-        else {
-            ReportResetDatabase(path, ctx->db);
-        }
-    }
-    return rc;
-}
-
-
-static rc_t prepare_reflist( prepare_ctx *ctx )
-{
-    rc_t rc = 0;
-    ctx->reflist = NULL;
-    if ( ctx->db != NULL )
-    {
-        uint32_t reflist_options = ereferencelist_4na;
-
-        if ( ctx->use_primary_alignments )
-            reflist_options |= ereferencelist_usePrimaryIds;
-
-        if ( ctx->use_secondary_alignments )
-            reflist_options |= ereferencelist_useSecondaryIds;
-
-        if ( ctx->use_evidence_alignments )
-            reflist_options |= ereferencelist_useEvidenceIds;
-
-        rc = ReferenceList_MakeDatabase( &ctx->reflist, ctx->db, reflist_options, 0, NULL, 0 );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "ReferenceList_MakeDatabase() failed" );
-        }
-    }
-    return rc;
-}
-
-
-rc_t prepare_ref_iter( prepare_ctx *ctx,
-                       const VDBManager *vdb_mgr,
-                       VSchema *vdb_schema,
-                       const char * path,
-                       BSTree * regions )
-{
-    rc_t rc = prepare_db_table( ctx, vdb_mgr, vdb_schema, path );
-    if ( rc == 0 )
-    {
-        rc = prepare_reflist( ctx );
-        if( rc == 0 )
-        {
-            if ( ctx->reflist == NULL || count_ref_regions( regions ) == 0 )
-            {
-                /* the user has not specified a reference-range : use the whole file... */
-                rc = prepare_whole_file( ctx );
-            }
-            else
-            {
-                /* pick only the requested ranges... */
-                rc = foreach_ref_region( regions, prepare_region_cb, ctx );
-            }
-        }
-        if ( ctx->reflist != NULL )
-        {
-            ReferenceList_Release( ctx->reflist );
-        }
-    }
-    VTableRelease ( ctx->seq_tab );
-    VDatabaseRelease ( ctx->db );
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-rc_t parse_inf_file( Args * args )
-{
-    return Args_parse_inf_file( args, OPTION_INF );
-}
diff --git a/tools/sra-pileup/cmdline_cmn.h b/tools/sra-pileup/cmdline_cmn.h
deleted file mode 100644
index b29c298..0000000
--- a/tools/sra-pileup/cmdline_cmn.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_cmdline_cmn_
-#define _h_cmdline_cmn_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <kapp/args.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/text.h>
-#include <klib/vector.h>
-#include <klib/container.h>
-
-#include <kfs/directory.h>
-/* #include <sra/srapath.h> */
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-
-#include <align/iterator.h>
-#include <align/reference.h>
-
-#include <strtol.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-typedef uint8_t align_tab_select;
-enum { primary_ats = 1, secondary_ats = 2, evidence_ats = 4 };
-
-typedef struct common_options
-{
-    bool gzip_output;
-    bool bzip_output;
-    align_tab_select tab_select;
-    const char * output_file;
-    const char * input_file;
-    const char * schema_file;
-} common_options;
-
-
-void print_common_helplines( void );
-
-rc_t get_common_options( Args * args, common_options *opts );
-OptDef * CommonOptions_ptr( void );
-size_t CommonOptions_count( void );
-
-/* get ref-ranges from the command-line and iterate them... */
-rc_t init_ref_regions( BSTree * regions, Args * args );
-uint32_t count_ref_regions( BSTree * regions );
-
-rc_t parse_and_add_region( BSTree * regions, const char * s );
-
-rc_t foreach_ref_region( BSTree * regions,
-    rc_t ( CC * on_range ) ( const char * name, uint32_t start, uint32_t end, void *data ), 
-    void *data );
-
-void check_ref_regions( BSTree * regions );
-void free_ref_regions( BSTree * regions );
-
-rc_t foreach_argument( Args * args, KDirectory *dir, bool div_by_spotgrp, bool * empty,
-    rc_t ( CC * on_argument ) ( const char * path, const char * spot_group, void * data ), void * data );
-
-
-typedef struct prepare_ctx
-{
-    ReferenceIterator *ref_iter;
-    PlacementSetIterator *plset_iter;
-    const VDatabase *db;
-    const VTable *seq_tab;
-    const ReferenceList *reflist;
-    const ReferenceObj *refobj;
-    const char * spot_group;
-    bool omit_qualities;
-    bool read_tlen;
-    bool use_primary_alignments;
-    bool use_secondary_alignments;
-    bool use_evidence_alignments;
-    void * data;
-    const char *path;
-    rc_t ( CC * on_section ) ( struct prepare_ctx * ctx, uint32_t start, uint32_t end );
-} prepare_ctx;
-
-
-
-rc_t prepare_ref_iter( prepare_ctx *ctx,
-                       const VDBManager *vdb_mgr,
-                       VSchema *vdb_schema,
-                       const char * path,
-                       BSTree * regions );
-
-rc_t prepare_plset_iter( prepare_ctx *ctx,
-                         const VDBManager *vdb_mgr,
-                         VSchema *vdb_schema,
-                         const char * path,
-                         BSTree * ranges );
-
-
-rc_t parse_inf_file( Args * args );
-
-#endif
diff --git a/tools/sra-pileup/debug.h b/tools/sra-pileup/debug.h
deleted file mode 100644
index d1a321b..0000000
--- a/tools/sra-pileup/debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _tools_sam_dump_debug_h_
-#define _tools_sam_dump_debug_h_
-
-#include <klib/debug.h>
-
-#define SAM_DUMP_DBG_PASTE(a,b) a##b
-#define SAM_DUMP_DBG(flag,msg) DBGMSG(DBG_APP,DBG_FLAG(SAM_DUMP_DBG_PASTE(DBG_APP_,flag)), msg)
-
-#endif /* _tools_sam_dump_debug_h_ */
diff --git a/tools/sra-pileup/inputfiles.c b/tools/sra-pileup/inputfiles.c
deleted file mode 100644
index 0c8ba0d..0000000
--- a/tools/sra-pileup/inputfiles.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "inputfiles.h"
-
-#include <sra/sraschema.h> /* VDBManagerMakeSRASchema */
-#include <vdb/schema.h> /* VSchemaRelease */
-
-#include <kdb/manager.h>
-#include <kfs/file.h>
-#include <vfs/manager.h>
-#include <vfs/path.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-
-
-static void free_input_database( input_database * id )
-{
-    if ( id->path != NULL ) free( id->path );
-    if ( id->db != NULL ) VDatabaseRelease( id->db );
-    if ( id->reflist != NULL ) ReferenceList_Release( id->reflist );
-    if ( id->prim_ctx != NULL ) free( id->prim_ctx );
-    if ( id->sec_ctx != NULL ) free( id->sec_ctx );
-    if ( id->ev_ctx != NULL ) free( id->ev_ctx );
-    free( id );
-}
-
-
-static void free_input_table( input_table * it )
-{
-    if ( it->path != NULL ) free( it->path );
-    if ( it->tab != NULL ) VTableRelease( it->tab );
-    free( it );
-}
-
-
-static rc_t append_database( input_files *self, const VDatabase * db,
-                             const char * path, uint32_t reflist_options, bool show_err )
-{
-    const ReferenceList *reflist;
-    rc_t rc = ReferenceList_MakeDatabase( &reflist, db, reflist_options, 0, NULL, 0 );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "cannot create reflist for '$(t)'", "t=%s", path ) );
-    }
-    else
-    {
-        input_database * id = calloc( sizeof * id, 1 );
-        if ( id == NULL )
-        {
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            (void)LOGERR( klogErr, rc, "cannot create input-database structure" );
-        }
-        else
-        {
-            uint32_t idx;
-
-            id->db = db;
-            id->reflist = reflist;
-            id->path = string_dup( path, string_size( path ) );
-
-            rc = VectorAppend( &self->dbs, &idx, id );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogErr, ( klogErr, rc, "cannot append db '$(t)' to inputfiles", "t=%s", path ) );
-                free_input_database( id );
-            }
-            else
-            {
-                ++(self->database_count);
-                id->db_idx = idx;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t append_table( input_files *self, const VTable *tab, const char * path )
-{
-    rc_t rc = 0;
-    input_table * it = calloc( sizeof * it, 1 );
-    if ( it == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        (void)LOGERR( klogErr, rc, "cannot create input-table structure" );
-    }
-    else
-    {
-        it->path = string_dup( path, string_size( path ) );
-        it->tab = tab;
-
-        rc = VectorAppend( &self->tabs, NULL, it );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "cannot append tab '$(t)' to inputfiles", "t=%s", path ) );
-            free_input_table( it );
-        }
-        else
-        {
-            ++(self->table_count);
-        }
-    }
-    return rc;
-}
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-
-static rc_t contains_ref_and_alignments( const VDatabase * db, const char * path, bool * res, bool show_err )
-{
-    KNamelist *tables;
-    rc_t rc = VDatabaseListTbl ( db, &tables );
-    if ( rc != 0 )
-    {
-        if ( show_err )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "VDatabaseListTbl() failed on '$(t)'", "t=%s", path ) );
-        }
-    }
-    else
-    {
-        uint32_t count;
-        rc = KNamelistCount ( tables, &count );
-        if ( rc != 0 )
-        {
-            if ( show_err )
-            {
-                (void)PLOGERR( klogErr, ( klogErr, rc, "KNamelistCount on Table-Names-List failed on '$(t)'", "t=%s", path ) );
-            }
-        }
-        else
-        {
-            uint32_t idx;
-            bool has_ref = false;
-            bool has_alignment = false;
-            for ( idx = 0; rc == 0 && idx < count; ++idx )
-            {
-                const char * tabname;
-                rc = KNamelistGet ( tables, idx, &tabname );
-                if ( rc != 0 )
-                {
-                    if ( show_err )
-                    {
-                        (void)PLOGERR( klogErr, ( klogErr, rc, "KNamelistGet on Table-Names-List failed on '$(t)'", "t=%s", path ) );
-                    }
-                }
-                else
-                {
-                    if ( cmp_pchar( tabname, "REFERENCE" ) == 0 )
-                        has_ref = true;
-                    if ( cmp_pchar( tabname, "PRIMARY_ALIGNMENT" ) == 0 )
-                        has_alignment = true;
-                }
-            }
-            *res = ( has_ref && has_alignment );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t open_database( input_files *self, const VDBManager *mgr,
-                           const char * path, uint32_t reflist_options, bool show_err )
-{
-    const VDatabase * db;
-    rc_t rc = VDBManagerOpenDBRead( mgr, &db, NULL, "%s", path );
-    if ( rc != 0 )
-    {
-        if ( show_err )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open db '$(t)'", "t=%s", path ) );
-        }
-    }
-    else
-    {
-        bool has_alignments = false;
-        rc = contains_ref_and_alignments( db, path, &has_alignments, show_err );
-        if ( rc == 0 )
-        {
-            if ( has_alignments )
-            {
-                rc = append_database( self, db, path, reflist_options, show_err );
-            }
-            else
-            {
-                const VTable *tab;
-                rc = VDatabaseOpenTableRead ( db, &tab, "SEQUENCE" );
-                if ( rc != 0 )
-                {
-                    if ( show_err )
-                    {
-                        (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open table SEQUENCE for '$(t)'", "t=%s", path ) );
-                    }
-                }
-                else
-                {
-                    rc = append_table( self, tab, path );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t open_table( input_files *self, const VDBManager *mgr, const char * path, bool show_error )
-{
-    const VTable * tab;    
-
-    rc_t rc = VDBManagerOpenTableRead( mgr, &tab, NULL, "%s", path );
-    if ( rc != 0 )
-    {
-        struct VSchema* schema = NULL;
-        rc = VDBManagerMakeSRASchema( mgr, &schema );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot MakeSRASchema" );
-        }
-        else
-        {
-            rc = VDBManagerOpenTableRead( mgr, &tab, schema, "%s", path );
-            if ( rc != 0 )
-            {
-                if ( show_error )
-                {
-                    (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open tab '$(t)'", "t=%s", path ) );
-                }
-            }
-            VSchemaRelease( schema );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = append_table( self, tab, path );
-
-    return rc;
-}
-
-
-static rc_t is_unknown( input_files *self, const char * path )
-{
-    rc_t rc = VNamelistAppend( self->not_found, path );
-    if ( rc == 0 )
-        ++( self->not_found_count );
-    return rc;
-}
-
-
-static rc_t split_input_files( input_files *self, const VDBManager *mgr,
-                               const VNamelist * src, uint32_t reflist_options )
-{
-    uint32_t src_count;
-    rc_t rc = VNameListCount( src, &src_count );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "VNameListCount failed" );
-    }
-    else
-    {
-        uint32_t src_idx;
-        for ( src_idx = 0; src_idx < src_count && rc == 0 ; ++src_idx )
-        {
-            const char * path;
-            rc = VNameListGet( src, src_idx, &path );
-            if ( rc == 0 && path != NULL )
-            {
-                int path_type = VDBManagerPathType ( mgr, path );
-                if ( rc == 0 )
-                {
-                    switch( path_type )
-                    {
-                        case kptDatabase : rc = open_database( self, mgr, path, reflist_options, true ); break;
-
-                        case kptPrereleaseTbl :
-                        case kptTable    : rc = open_table( self, mgr, path, true ); break;
-
-                        default          : rc = is_unknown( self, path ); break;
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t discover_input_files( input_files **self, const VDBManager *mgr,
-                           const VNamelist * src, uint32_t reflist_options )
-{
-    rc_t rc = 0;
-
-    input_files * ipf = calloc( sizeof * ipf, 1 );
-    *self = NULL;
-    if ( ipf == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        (void)LOGERR( klogErr, rc, "cannot create inputfiles structure" );
-    }
-    else
-    {
-        rc = VNamelistMake( &( ipf->not_found ), 5 );
-        if ( rc != 0 )
-            (void)LOGERR( klogErr, rc, "cannot create inputfiles.not_found structure" );
-        else
-        {
-            VectorInit( &( ipf->dbs ), 0, 5 );
-            VectorInit( &( ipf->tabs ), 0, 5 );
-            rc = split_input_files( ipf, mgr, src, reflist_options );
-        }
-        if ( rc != 0 )
-            release_input_files( ipf );
-        else
-            *self = ipf;
-    }
-    return rc;
-}
-
-
-static void CC db_whack( void * item, void * data )
-{
-    input_database * id = ( input_database * )item;
-    free_input_database( id );
-}
-
-
-static void CC tab_whack( void * item, void * data )
-{
-    input_table * it = ( input_table * )item;
-    free( it->path );
-    VTableRelease( it->tab );
-    free( it );
-}
-
-
-void release_input_files( input_files *self )
-{
-    VectorWhack( &self->dbs, db_whack, NULL );
-    VectorWhack( &self->tabs, tab_whack, NULL );
-    VNamelistRelease( self->not_found );
-    free( self );
-}
diff --git a/tools/sra-pileup/inputfiles.h b/tools/sra-pileup/inputfiles.h
deleted file mode 100644
index 4698785..0000000
--- a/tools/sra-pileup/inputfiles.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_inputfiles_
-#define _h_inputfiles_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/vector.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/namelist.h>
-
-#include <vdb/manager.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-
-#include <align/reference.h>
-#include <align/manager.h>
-
-/*
-    the VNamelist of input-files/accessions/uri's is tested one at a time
-    if it is: a database, a table or cannot be found
-    in case of a database : a vdb-db-handle is opened
-    in case of a table    : a vdb-tab-handle is opened
-    in case of not found  : name is put into the not-found list
-*/
-
-
-typedef struct input_database
-{
-    uint32_t db_idx;
-    char * path;
-    const VDatabase * db;
-    const ReferenceList *reflist;
-    void * prim_ctx;
-    void * sec_ctx;
-    void * ev_ctx;
-} input_database;
-
-
-typedef struct input_table
-{
-    char * path;
-    const VTable * tab;
-} input_table;
-
-
-
-typedef struct input_files
-{
-    uint32_t database_count;
-    uint32_t table_count;
-    uint32_t not_found_count;
-
-    Vector dbs;
-    Vector tabs;
-    VNamelist * not_found;
-} input_files;
-
-
-
-rc_t discover_input_files( input_files **self, const VDBManager *mgr,
-                           const VNamelist * src, uint32_t reflist_options );
-
-void release_input_files( input_files *self );
-
-#endif
diff --git a/tools/sra-pileup/matecache.c b/tools/sra-pileup/matecache.c
deleted file mode 100644
index bbe2e9c..0000000
--- a/tools/sra-pileup/matecache.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "matecache.h"
-#include <sysalloc.h>
-#include <stdlib.h>
-
-void release_matecache( matecache * const self )
-{
-    if ( self != NULL )
-    {
-        if ( self->per_file != NULL )
-        {
-            uint32_t idx;
-            for ( idx = 0; idx < self->count; ++idx )
-            {
-                if ( self->per_file[ idx ].same_ref_64 != NULL )
-                    KVectorRelease( self->per_file[ idx ].same_ref_64 );
-                if ( self->per_file[ idx ].same_ref_16 != NULL )
-                    KVectorRelease( self->per_file[ idx ].same_ref_16 );
-
-                if ( self->per_file[ idx ].unaligned_64_a != NULL )
-                    KVectorRelease( self->per_file[ idx ].unaligned_64_a );
-                if ( self->per_file[ idx ].unaligned_64_b != NULL )
-                    KVectorRelease( self->per_file[ idx ].unaligned_64_b );
-            }
-            free( self->per_file );
-        }
-        free( self );
-    }
-}
-
-
-rc_t make_matecache( matecache **self, uint32_t count )
-{
-    rc_t rc = 0;
-
-    matecache * mc = calloc( sizeof * mc, 1 );
-    *self = NULL;
-    if ( mc == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        (void)LOGERR( klogErr, rc, "cannot create matecache structure" );
-    }
-    else
-    {
-        mc->count = count;
-        mc->per_file = calloc( sizeof *(mc->per_file), count );
-        if ( mc->per_file == NULL )
-        {
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            (void)LOGERR( klogErr, rc, "cannot create matecache internal structure" );
-        }
-        else
-        {
-            uint32_t idx;
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                rc = KVectorMake( &( mc->per_file[ idx ].same_ref_64 ) );
-                if ( rc != 0 )
-                    (void)LOGERR( klogErr, rc, "cannot create KVector (same-ref) U64" );
-                else
-                {
-                    rc = KVectorMake( &( mc->per_file[ idx ].same_ref_16 ) );
-                    if ( rc != 0 )
-                        (void)LOGERR( klogErr, rc, "cannot create KVector (same-ref) U16" );
-                    else
-                    {
-                        rc = KVectorMake( &( mc->per_file[ idx ].unaligned_64_a ) );
-                        if ( rc != 0 )
-                            (void)LOGERR( klogErr, rc, "cannot create KVector (unaligned a) U64" );
-                        else
-                        {
-                            rc = KVectorMake( &( mc->per_file[ idx ].unaligned_64_b ) );
-                            if ( rc != 0 )
-                                (void)LOGERR( klogErr, rc, "cannot create KVector (unaligned b) U64" );
-                        }
-                    }
-                }
-            }
-            if ( rc == 0 )
-                *self = mc;
-        }
-        if ( rc != 0 )
-            release_matecache( mc );
-    }
-    return rc;
-}
-
-#if 0
-static int32_t calc_tlen( uint32_t self_pos, uint32_t mate_pos,
-                   uint32_t self_len, uint32_t mate_len, uint32_t read_num )
-{
-    int32_t res = 0;
-    unsigned const self_left  = self_pos;
-    unsigned const mate_left  = mate_pos;
-    unsigned const self_right = self_left + self_len;
-    unsigned const mate_right = mate_left + mate_len;
-    unsigned const  leftmost  = (self_left  < mate_left ) ? self_left  : mate_left;
-    unsigned const rightmost  = (self_right > mate_right) ? self_right : mate_right;
-    unsigned const tlen = rightmost - leftmost;
-            
-    /* The standard says, "The leftmost segment has a plus sign and the rightmost has a minus sign." */
-    if (   ( self_left <= mate_left && self_right >= mate_right )      /* mate fully contained within self or */
-        || ( mate_left <= self_left && mate_right >= self_right ) )    /* self fully contained within mate; */
-    {
-        if ( self_left < mate_left || ( read_num == 1 && self_left == mate_left ) )
-            res = tlen;
-        else
-            res = -tlen;
-    }
-    else if ( ( self_right == mate_right && mate_left == leftmost ) /* both are rightmost, but mate is leftmost */
-             ||  self_right == rightmost )
-    {
-        res = -tlen;
-    }
-    else
-        res = tlen;
-
-    return res;
-}
-#endif
-
-static rc_t matecache_check( const matecache * const self, uint32_t db_idx, matecache_per_file ** mcpf )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcAccessing, rcSelf, rcNull );
-        (void)LOGERR( klogErr, rc, "cannot insert into same-ref-cache" );
-    }
-    else if ( db_idx < self->count )
-    {
-        *mcpf = &self->per_file[ db_idx ];
-        if ( mcpf == NULL )
-        {
-            rc = RC( rcApp, rcNoTarg, rcAccessing, rcParam, rcInvalid );
-            (void)LOGERR( klogErr, rc, "cannot insert into same-ref-cache" );
-        }
-    }
-    return rc;
-}
-
-
-rc_t matecache_insert_same_ref( matecache * const self,
-        uint32_t db_idx, int64_t key, INSDC_coord_zero ref_pos, uint32_t flags, INSDC_coord_len tlen )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        uint64_t ref_pos_and_tlen = ref_pos;
-        ref_pos_and_tlen <<= 32;
-        ref_pos_and_tlen |= tlen;
-        rc = KVectorSetU64( mcpf->same_ref_64, key, ref_pos_and_tlen );
-        if ( rc != 0 )
-            (void)LOGERR( klogErr, rc, "cannot insert into KVector (same-ref) U64" );
-        else
-        {
-            rc = KVectorSetU16( mcpf->same_ref_16, key, flags );
-            if ( rc != 0 )
-                (void)LOGERR( klogErr, rc, "cannot insert into KVector (same-ref) U16" );
-        }
-        if ( rc == 0 )
-        {
-            mcpf->stat_same_ref.count++;
-            if ( mcpf->stat_same_ref.count > mcpf->maxcount_same_ref )
-                mcpf->maxcount_same_ref = mcpf->stat_same_ref.count;
-            mcpf->stat_same_ref.inserts++;
-        }
-    }
-    return rc;
-}
-
-
-rc_t matecache_lookup_same_ref( const matecache * const self, uint32_t db_idx, int64_t key,
-                       INSDC_coord_zero *ref_pos, uint32_t *flags, INSDC_coord_len *tlen )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        uint64_t value64;
-        mcpf->stat_same_ref.lookups++;
-        rc = KVectorGetU64( mcpf->same_ref_64, key, &value64 );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) != rcNotFound )
-                (void)LOGERR( klogErr, rc, "cannot retrieve value (same-ref) U64" );
-        }
-        else
-        {
-            uint16_t value16;
-            rc = KVectorGetU16( mcpf->same_ref_16, key, &value16 );
-            if ( rc != 0 )
-            {
-                if ( GetRCState( rc ) != rcNotFound )
-                    (void)LOGERR( klogErr, rc, "cannot retrieve value (same-ref) U16" );
-            }
-            else
-            {
-                *ref_pos = ( value64 >> 32 );
-                *tlen = ( value64 & 0xFFFFFFFF );
-                *flags = value16;
-                mcpf->stat_same_ref.finds++;
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t matecache_remove_same_ref( matecache * const self, uint32_t db_idx, int64_t key )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        rc = KVectorUnset( mcpf->same_ref_64, key );
-        if ( rc != 0 )
-            (void)LOGERR( klogErr, rc, "cannot remove from same-ref-cache (64bit)" );
-        else
-        {
-            rc = KVectorUnset( mcpf->same_ref_16, key );
-            if ( rc != 0 )
-                (void)LOGERR( klogErr, rc, "cannot remove from same-ref-cache (16bit)" );
-        }
-        if ( rc == 0 && mcpf->stat_same_ref.count > 0 )
-            mcpf->stat_same_ref.count--;
-    }
-    return rc;
-}
-
-
-static rc_t matecache_clear_same_ref_per_file( matecache_per_file * const mcpf )
-{
-    rc_t rc = KVectorRelease( mcpf->same_ref_64 );
-    if ( rc != 0 )
-        (void)LOGERR( klogErr, rc, "cannot release same-ref-cache (64bit)" );
-    else
-    {
-        rc = KVectorRelease( mcpf->same_ref_16 );
-        if ( rc != 0 )
-            (void)LOGERR( klogErr, rc, "cannot release same-ref-cache (16bit)" );
-        else
-        {
-            rc = KVectorMake( &mcpf->same_ref_64 );
-            if ( rc != 0 )
-                (void)LOGERR( klogErr, rc, "cannot make same-ref-cache (64bit)" );
-            else
-            {
-                rc = KVectorMake( &mcpf->same_ref_16 );
-                if ( rc != 0 )
-                    (void)LOGERR( klogErr, rc, "cannot make same-ref-cache (16bit)" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t matecache_clear_same_ref( matecache * const self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcAccessing, rcSelf, rcNull );
-        (void)LOGERR( klogErr, rc, "cannot clear same-ref-cache" );
-    }
-    else
-    {
-        uint32_t idx;
-        for ( idx = 0; idx < self->count && rc == 0; ++idx )
-        {
-            rc = matecache_clear_same_ref_per_file( &self->per_file[ idx ] );
-        }
-        self->flashes++;
-   }
-    return rc;
-}
-
-
-rc_t matecache_report( const matecache * const self )
-{
-    rc_t rc = 0;
-    if ( self == NULL )
-    {
-        rc = RC( rcApp, rcNoTarg, rcAccessing, rcSelf, rcNull );
-        (void)LOGERR( klogErr, rc, "cannot report same-ref-cache" );
-    }
-    else
-    {
-        uint32_t idx;
-        for ( idx = 0; idx < self->count && rc == 0; ++idx )
-        {
-            rc = KOutMsg( "on same reference:\n" );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].maxcount = %,lu\n", idx, self->per_file[ idx ].maxcount_same_ref );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].inserts = %,lu\n", idx, self->per_file[ idx ].stat_same_ref.inserts );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].lookups = %,lu\n", idx, self->per_file[ idx ].stat_same_ref.lookups );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].finds = %,lu\n", idx, self->per_file[ idx ].stat_same_ref.finds );
-            if ( rc == 0 )
-                rc = KOutMsg( "unaligned:\n" );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].count = %,lu\n", idx, self->per_file[ idx ].stat_unaligned.count );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].lookups = %,lu\n", idx, self->per_file[ idx ].stat_unaligned.lookups );
-            if ( rc == 0 )
-                rc = KOutMsg( "matecache[ %u ].finds = %,lu\n", idx, self->per_file[ idx ].stat_unaligned.finds );
-        }
-        if ( rc == 0 )
-            rc = KOutMsg( "matecache.flashes = %,lu\n", idx, self->flashes );
-    }
-    return rc;
-}
-
-
-rc_t matecache_insert_unaligned( matecache * const self,
-        uint32_t db_idx, int64_t key, INSDC_coord_zero ref_pos, uint32_t ref_idx, int64_t seq_id )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        uint64_t ref_pos_and_ref_idx = ref_pos;
-        ref_pos_and_ref_idx <<= 32;
-        ref_pos_and_ref_idx |= ref_idx;
-        rc = KVectorSetU64( mcpf->unaligned_64_a, key, ref_pos_and_ref_idx );
-        if ( rc != 0 )
-            (void)LOGERR( klogErr, rc, "cannot insert into KVector (unaligned a) U64" );
-        else
-        {
-            rc = KVectorSetU64( mcpf->unaligned_64_b, key, seq_id );
-            if ( rc != 0 )
-                (void)LOGERR( klogErr, rc, "cannot insert into KVector (unaligned b) U64" );
-        }
-        if ( rc == 0 )
-        {
-            mcpf->stat_unaligned.count++;
-            mcpf->stat_unaligned.inserts++;
-        }
-    }
-    return rc;
-}
-
-
-rc_t matecache_lookup_unaligned( const matecache * const self, uint32_t db_idx, int64_t key,
-                                 INSDC_coord_zero * const ref_pos, uint32_t * const ref_idx, int64_t * const seq_id )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        uint64_t value64_a;
-        mcpf->stat_unaligned.lookups++;
-        rc = KVectorGetU64( mcpf->unaligned_64_a, key, &value64_a );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) != rcNotFound )
-                (void)LOGERR( klogErr, rc, "cannot retrieve value (unaligned a) U64" );
-        }
-        else
-        {
-            uint64_t value64_b;
-            rc = KVectorGetU64( mcpf->unaligned_64_b, key, &value64_b );
-            if ( rc != 0 )
-            {
-                if ( GetRCState( rc ) != rcNotFound )
-                    (void)LOGERR( klogErr, rc, "cannot retrieve value (unaligned b) U64" );
-            }
-            else
-            {
-                *seq_id = ( int64_t )value64_b;
-                *ref_pos = ( value64_a >> 32 );
-                *ref_idx = ( value64_a & 0xFFFFFFFF );
-                mcpf->stat_unaligned.finds++;
-            }
-        }
-    }
-    return rc;
-}
-
-
-typedef struct visit_ctx
-{
-    rc_t ( CC * f ) ( int64_t seq_id, int64_t al_id, void * user_data );
-    void * user_data;
-} visit_ctx;
-
-
-static rc_t CC on_seq_id( uint64_t key, int64_t value, void *user_data )
-{
-    visit_ctx * vctx = user_data;
-    return vctx->f( value, ( int64_t )key, vctx->user_data );
-}
-
-
-rc_t foreach_unaligned_entry( const matecache * const self,
-                              uint32_t db_idx,
-                              rc_t ( CC * f ) ( int64_t seq_id, int64_t al_id, void * user_data ),
-                              void * user_data )
-{
-    matecache_per_file * mcpf = NULL;
-    rc_t rc = matecache_check( self, db_idx, &mcpf );
-    if ( rc == 0 )
-    {
-        visit_ctx vctx;
-        vctx.f = f;
-        vctx.user_data = user_data;
-        rc = KVectorVisitI64 ( mcpf->unaligned_64_b, false, on_seq_id, &vctx );
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/matecache.h b/tools/sra-pileup/matecache.h
deleted file mode 100644
index 0b8d9df..0000000
--- a/tools/sra-pileup/matecache.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_matecache_
-#define _h_matecache_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/vector.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <insdc/sra.h>
-
-typedef struct matecache_stat
-{
-    uint64_t count;
-    uint64_t lookups;
-    uint64_t finds;
-    uint64_t inserts;
-} matecache_stat;
-
-
-typedef struct matecache_per_file
-{
-    KVector *same_ref_64;   /* ref-pos and ref-idx */
-    KVector *same_ref_16;   /* flags */
-
-    KVector *unaligned_64_a;  /* ref-pos and ref-idx */
-    KVector *unaligned_64_b;  /* seq_spot_id */
-
-    matecache_stat stat_same_ref;
-    matecache_stat stat_unaligned;
-    uint64_t maxcount_same_ref;
-} matecache_per_file;
-
-
-typedef struct matecache
-{
-    matecache_per_file *per_file;
-    uint32_t count;
-    uint32_t flashes;
-} matecache;
-
-
-/* general cache functions */
-
-rc_t make_matecache( matecache **self, uint32_t count );
-
-void release_matecache( matecache * const self );
-
-rc_t matecache_clear_same_ref( matecache * const self );
-
-rc_t matecache_report( const matecache * const self );
-
-
-/* cache functions for aligned mates on the same reference */
-
-rc_t matecache_insert_same_ref( matecache * const self,
-        uint32_t db_idx, int64_t key, INSDC_coord_zero ref_pos, uint32_t flags, INSDC_coord_len tlen );
-
-rc_t matecache_lookup_same_ref( const matecache * const self, uint32_t db_idx, int64_t key,
-                       INSDC_coord_zero *ref_pos, uint32_t *flags, INSDC_coord_len *tlen );
-
-rc_t matecache_remove_same_ref( matecache * const self, uint32_t db_idx, int64_t key );
-
-
-/* cache functions for half aligned mates */
-
-/*
-    db_idx  ... index, what input-file did the alignment come from
-    key     ... row-id of aligned half
-    pos     ... position of the aligned half
-    flags   ... sam-flags of the aligned half
-    ref_idx ... idx of reference the aligned half aligns to
-*/
-
-rc_t matecache_insert_unaligned( matecache * const self,
-        uint32_t db_idx, int64_t key, INSDC_coord_zero ref_pos, uint32_t ref_idx, int64_t seq_id );
-
-rc_t matecache_lookup_unaligned( const matecache * const self, uint32_t db_idx, int64_t key,
-                                 INSDC_coord_zero * const ref_pos, uint32_t * const ref_idx, int64_t * const seq_id );
-
-rc_t foreach_unaligned_entry( const matecache * const self,
-                              uint32_t db_idx,
-                              rc_t ( CC * f ) ( int64_t seq_id, int64_t al_id, void * user_data ),
-                              void * user_data );
-
-
-#endif
diff --git a/tools/sra-pileup/out_redir.c b/tools/sra-pileup/out_redir.c
deleted file mode 100644
index c089d78..0000000
--- a/tools/sra-pileup/out_redir.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "out_redir.h"
-
-#include <kfs/directory.h>
-#include <kfs/buffile.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-#include <sysalloc.h>
-
-static rc_t CC out_redir_callback( void * self, const char * buffer, size_t bufsize, size_t * num_writ )
-{
-    out_redir * redir = ( out_redir * )self;
-    rc_t rc = KFileWriteAll( redir->kfile, redir->pos, buffer, bufsize, num_writ );
-    if ( rc == 0 )
-        redir->pos += *num_writ;
-    return rc;
-}
-
-
-rc_t init_out_redir( out_redir * self, enum out_redir_mode mode, const char * filename, size_t bufsize )
-{
-    rc_t rc;
-    KFile *output_file;
-
-    if ( filename != NULL )
-    {
-        KDirectory *dir;
-        rc = KDirectoryNativeDir( &dir );
-        if ( rc != 0 )
-            LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-        else
-        {
-            rc = KDirectoryCreateFile ( dir, &output_file, false, 0664, kcmInit, "%s", filename );
-            KDirectoryRelease( dir );
-        }
-    }
-    else
-        rc = KFileMakeStdOut ( &output_file );
-
-    if ( rc == 0 )
-    {
-        KFile *temp_file;
-
-        /* wrap the output-file in compression, if requested */
-        switch ( mode )
-        {
-            case orm_gzip  : rc = KFileMakeGzipForWrite( &temp_file, output_file ); break;
-            case orm_bzip2 : rc = KFileMakeBzip2ForWrite( &temp_file, output_file ); break;
-            case orm_uncompressed : break;
-        }
-        if ( rc == 0 )
-        {
-            if ( mode != orm_uncompressed )
-            {
-                KFileRelease( output_file );
-                output_file = temp_file;
-            }
-
-            /* wrap the output/compressed-file in buffering, if requested */
-            if ( bufsize != 0 )
-            {
-                rc = KBufFileMakeWrite( &temp_file, output_file, false, bufsize );
-                if ( rc == 0 )
-                {
-                    KFileRelease( output_file );
-                    output_file = temp_file;
-                }
-            }
-
-            if ( rc == 0 )
-            {
-                self->kfile = output_file;
-                self->org_writer = KOutWriterGet();
-                self->org_data = KOutDataGet();
-                self->pos = 0;
-                rc = KOutHandlerSet( out_redir_callback, self );
-                if ( rc != 0 )
-                    LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-void release_out_redir( out_redir * self )
-{
-    KFileRelease( self->kfile );
-    if( self->org_writer != NULL )
-    {
-        KOutHandlerSet( self->org_writer, self->org_data );
-    }
-    self->org_writer = NULL;
-}
-
diff --git a/tools/sra-pileup/out_redir.h b/tools/sra-pileup/out_redir.h
deleted file mode 100644
index 6eacab5..0000000
--- a/tools/sra-pileup/out_redir.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_out_redir_
-#define _h_out_redir_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <kfs/file.h>
-
-enum out_redir_mode
-{
-    orm_uncompressed = 0,
-    orm_gzip,
-    orm_bzip2
-};
-
-
-/* GLOBAL VARIABLES */
-typedef struct out_redir
-{
-    KWrtWriter org_writer;
-    void* org_data;
-    KFile* kfile;
-    uint64_t pos;
-} out_redir;
-
-
-rc_t init_out_redir( out_redir * self, enum out_redir_mode mode, const char * filename, size_t bufsize );
-
-void release_out_redir( out_redir * self );
-
-#endif
diff --git a/tools/sra-pileup/read_fkt.c b/tools/sra-pileup/read_fkt.c
deleted file mode 100644
index df114aa..0000000
--- a/tools/sra-pileup/read_fkt.c
+++ /dev/null
@@ -1,718 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "read_fkt.h"
-#include <sysalloc.h>
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-rc_t read_bool( int64_t row_id, const VCursor * cursor, uint32_t idx, bool *res, bool dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) bool",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const bool * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) bool failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_bool_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const bool **res, uint32_t *res_len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) bool ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		bool * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( res_len != NULL )
-				*res_len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_uint8( int64_t row_id, const VCursor * cursor, uint32_t idx, uint8_t *res, uint8_t dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) uint8",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const uint8_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) char_ptr failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_uint8_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const uint8_t **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) uint8 ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const uint8_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) char_ptr failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_uint32( int64_t row_id, const VCursor * cursor, uint32_t idx, uint32_t *res, uint32_t dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) uint32",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		uint32_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) uint32_t failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_uint32_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const uint32_t **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) uint32 ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		uint32_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) uint32_t (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_int32( int64_t row_id, const VCursor * cursor, uint32_t idx, int32_t *res, int32_t dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) int32",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		int32_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) uint32_t failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_int32_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const int32_t **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) int32 ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		int32_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) uint32_t (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_int64( int64_t row_id, const VCursor * cursor, uint32_t idx, int64_t *res, int64_t dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) int64",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const int64_t *value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) int64 failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_int64_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const int64_t **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) int64 ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		int64_t * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) uint64_t (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_char_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const char **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) char ptr",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const char * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) char_ptr failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_INSDC_coord_zero( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_zero *res, INSDC_coord_zero dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_zero",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		INSDC_coord_zero * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_zero failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_INSDC_coord_zero_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_coord_zero **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_zero (ptr)",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const INSDC_coord_zero * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_zero (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_INSDC_coord_one( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_one *res, INSDC_coord_one dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_one",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		INSDC_coord_one * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_one failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_INSDC_coord_one_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_one **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_one (ptr)",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		INSDC_coord_one * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_one (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_INSDC_coord_len( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_len *res, INSDC_coord_len dflt, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_len", 
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		INSDC_coord_len * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_len failed", 
-				"tr=%li,ti=%u,hi=$u", row_id, idx, hint ) );
-		}
-		else
-		{
-			*res = ( row_len > 0 ) ? *value : dflt;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_INSDC_coord_len_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_coord_len **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_coord_len (ptr)", 
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const INSDC_coord_len * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_coord_len (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-
-rc_t read_INSDC_read_type_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_read_type **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_read_type (ptr)", 
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const INSDC_read_type * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_read_type (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_INSDC_read_filter_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_read_filter **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_read_filter (ptr)",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const INSDC_read_filter * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_read_filter (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-rc_t read_INSDC_dna_text_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_dna_text **res, uint32_t *len, const char * hint )
-{
-	rc_t rc;
-	if ( idx == INVALID_COLUMN )
-	{
-		rc = RC( rcExe, rcNoTarg, rcReading, rcItem, rcInvalid );	
-        (void)PLOGERR( klogInt, ( klogInt, rc, "column idx invalid at row#$(tr) . $(hi) ) INSDC_dna_text (ptr)",
-            "tr=%li,hi=%s", row_id, hint ) );
-	}
-	else
-	{
-		const INSDC_dna_text * value;
-		uint32_t elem_bits, boff, row_len;
-		rc = VCursorCellDataDirect( cursor, row_id, idx, &elem_bits, (const void**)&value, &boff, &row_len );
-		if ( rc != 0 )
-		{
-			(void)PLOGERR( klogInt, ( klogInt, rc, "VCursorCellDataDirect( row#$(tr) . idx#$(ti) . $(hi) ) INSDC_dna_text (ptr) failed", 
-				"tr=%li,ti=%u,hi=%s", row_id, idx, hint ) );
-		}
-		else
-		{
-			if ( row_len > 0 )
-				*res = value;
-			if ( len != NULL )
-				*len = row_len;
-		}
-	}
-    return rc;
-}
-
-
-/* ------------------------------------------------------------------------------------------------------------------- */
-
-bool namelist_contains( const KNamelist *names, const char * a_name )
-{
-    bool res = false;
-    uint32_t count;
-    rc_t rc = KNamelistCount( names, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        uint32_t idx;
-        size_t a_name_len = string_size( a_name );
-        for ( idx = 0; idx < count && rc == 0 && !res; ++idx )
-        {
-            const char * s;
-            rc = KNamelistGet( names, idx, &s );
-            if ( rc == 0 && s != NULL )
-            {
-                size_t s_len = string_size( s );
-                size_t max_len = a_name_len > s_len ? a_name_len : s_len;
-                int cmp = string_cmp( a_name, a_name_len, s, s_len, max_len );
-                if ( cmp == 0 )
-                    res = true;
-            }
-        }
-    }
-    return res;
-}
-
-
-rc_t add_column( const VCursor * cursor, const char *colname, uint32_t * idx )
-{
-    rc_t rc = VCursorAddColumn( cursor, idx, colname );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorAddColumn( $(cn) ) failed", "cn=%s", colname ) );
-    }
-    return rc;
-}
-
-
-static const char * col_name_without_type( const char * colname )
-{
-	const char * res = colname;
-	const char * s = string_chr( colname, string_size( colname ), ')' );
-	if ( s != NULL )
-		res = ++s;
-	return res;
-}
-
-void add_opt_column( const VCursor * cursor, const KNamelist *names, const char *colname, uint32_t * idx )
-{
-    bool available = namelist_contains( names, col_name_without_type( colname ) );
-    if ( available )
-    {
-        rc_t rc = VCursorAddColumn( cursor, idx, colname );
-        if ( rc != 0 )
-            *idx = COL_NOT_AVAILABLE;
-    }
-    else
-    {
-        *idx = COL_NOT_AVAILABLE;
-    }
-}
diff --git a/tools/sra-pileup/read_fkt.h b/tools/sra-pileup/read_fkt.h
deleted file mode 100644
index b4d2439..0000000
--- a/tools/sra-pileup/read_fkt.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_read_fkt_
-#define _h_read_fkt_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/vector.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <vdb/cursor.h>
-#include <insdc/sra.h>
-
-#define COL_NOT_AVAILABLE 0xFFFFFFFF
-#define INVALID_COLUMN 0xFFFFFFFF
-
-rc_t read_bool( int64_t row_id, const VCursor * cursor, uint32_t idx, bool *res, bool dflt, const char * hint );
-rc_t read_bool_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const bool **res, uint32_t *res_len, const char * hint );
-
-rc_t read_uint8( int64_t row_id, const VCursor * cursor, uint32_t idx, uint8_t *res, uint8_t dflt, const char * hint );
-rc_t read_uint8_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const uint8_t **res, uint32_t *len, const char * hint );
-
-rc_t read_uint32( int64_t row_id, const VCursor * cursor, uint32_t idx, uint32_t *res, uint32_t dflt, const char * hint );
-rc_t read_uint32_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const uint32_t **res, uint32_t *len, const char * hint );
-
-rc_t read_int32( int64_t row_id, const VCursor * cursor, uint32_t idx, int32_t *res, int32_t dflt, const char * hint );
-rc_t read_int32_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const int32_t **res, uint32_t *len, const char * hint );
-
-rc_t read_int64( int64_t row_id, const VCursor * cursor, uint32_t idx, int64_t *res, int64_t dflt, const char * hint );
-rc_t read_int64_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const int64_t **res, uint32_t *len, const char * hint );
-
-rc_t read_char_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const char **res, uint32_t *len, const char * hint );
-
-rc_t read_INSDC_coord_zero( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_zero *res, INSDC_coord_zero dflt, const char * hint );
-rc_t read_INSDC_coord_zero_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_coord_zero **res, uint32_t *len, const char * hint );
-
-rc_t read_INSDC_coord_one( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_one *res, INSDC_coord_one dflt, const char * hint );
-rc_t read_INSDC_coord_one_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_one **res, uint32_t *len, const char * hint );
-
-rc_t read_INSDC_coord_len( int64_t row_id, const VCursor * cursor, uint32_t idx, INSDC_coord_len *res, INSDC_coord_len dflt, const char * hint );
-rc_t read_INSDC_coord_len_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_coord_len **res, uint32_t *len, const char * hint );
-
-rc_t read_INSDC_read_type_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_read_type **res, uint32_t *len, const char * hint );
-rc_t read_INSDC_read_filter_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_read_filter **res, uint32_t *len, const char * hint );
-rc_t read_INSDC_dna_text_ptr( int64_t row_id, const VCursor * cursor, uint32_t idx, const INSDC_dna_text **res, uint32_t *len, const char * hint );
-
-bool namelist_contains( const KNamelist * names, const char * a_name );
-rc_t add_column( const VCursor * cursor, const char *colname, uint32_t * idx );
-void add_opt_column( const VCursor * cursor, const KNamelist *names, const char *colname, uint32_t * idx );
-
-#endif
\ No newline at end of file
diff --git a/tools/sra-pileup/reref.c b/tools/sra-pileup/reref.c
deleted file mode 100644
index b282f1a..0000000
--- a/tools/sra-pileup/reref.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "reref.h"
-
-#include <klib/text.h>
-#include <kfs/file.h>
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/resolver.h>
-#include <align/reference.h>
-
-#include <sysalloc.h>
-#include <stdlib.h>
-
-#if 0
-
-typedef struct report_row_ctx
-{
-    uint32_t prim_idx;
-    uint32_t sec_idx;
-    int64_t row_id;
-} report_row_ctx;
-
-
-static rc_t report_ref_row( const VCursor *cur, report_row_ctx * row_ctx )
-{
-    rc_t rc = 0;
-    uint32_t elem_bits, boff, prim_count, sec_count;
-    const void *base;
-    rc = VCursorCellDataDirect ( cur, row_ctx->row_id, row_ctx->prim_idx, &elem_bits, &base, &boff, &prim_count );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot read colum >PRIMARY_ALIGNMENT_IDS<" );
-    }
-    else
-    {
-        rc = VCursorCellDataDirect ( cur, row_ctx->row_id, row_ctx->sec_idx, &elem_bits, &base, &boff, &sec_count );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot read colum >SECONDARY_ALIGNMENT_IDS<" );
-        }
-        else if ( prim_count > 0 || sec_count > 0 )
-        {
-            rc = KOutMsg( "ROW[ %,lu ]: PRIM:%,u SEC:%,u\n", row_ctx->row_id, prim_count, sec_count );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t report_ref_cursor( const VCursor *cur, int64_t start, int64_t stop )
-{
-    report_row_ctx row_ctx;
-    rc_t rc = VCursorAddColumn ( cur, &row_ctx.prim_idx, "PRIMARY_ALIGNMENT_IDS" );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot add column >PRIMARY_ALIGNMENT_IDS<" );
-    }
-    else
-    {
-        rc = VCursorAddColumn ( cur, &row_ctx.sec_idx, "SECONDARY_ALIGNMENT_IDS" );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot add column >SECONDARY_ALIGNMENT_IDS<" );
-        }
-        else
-        {
-            rc = VCursorOpen ( cur );
-            if ( rc != 0 )
-            {
-                (void)LOGERR( klogErr, rc, "cannot open REFERENCE-CURSOR" );
-            }
-            else
-            {
-                for ( row_ctx.row_id = start; rc == 0 && row_ctx.row_id <= stop; ++row_ctx.row_id )
-                {
-                    rc = report_ref_row( cur, &row_ctx );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t report_ref_table( const VDBManager *vdb_mgr, const char * path, int64_t start, int64_t stop )
-{
-    const VDatabase* db;
-    rc_t rc = VDBManagerOpenDBRead ( vdb_mgr, &db, NULL, "%s", path );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot open vdb-database" );
-    }
-    else
-    {
-        const VTable* tb;
-        rc = VDatabaseOpenTableRead ( db, &tb, "REFERENCE" );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot open REFERENCE-table" );
-        }
-        else
-        {
-            const VCursor *cur;
-            rc = VTableCreateCursorRead ( tb, &cur );
-            if ( rc != 0 )
-            {
-                (void)LOGERR( klogErr, rc, "cannot open REFERENCE-cursor" );
-            }
-            else
-            {
-                rc = report_ref_cursor( cur, start, stop );
-                VCursorRelease( cur );
-            }
-            VTableRelease ( tb );
-        }
-        VDatabaseRelease ( db );
-    }
-    return rc;
-}
-#endif
-
-
-static rc_t report_ref_table2( const ReferenceObj* ref_obj, int64_t start, int64_t stop )
-{
-    rc_t rc = 0;
-    int64_t row_id, max_prim_at, max_sec_at, max_ev_at;
-    uint64_t sum_prim, sum_sec, sum_ev, max_prim, max_sec, max_ev;
-    sum_prim = sum_sec = sum_ev = max_prim = max_sec = max_ev = 0;
-
-    for ( row_id = start; rc == 0 && row_id <= stop; ++row_id )
-    {
-        uint32_t count[ 3 ];
-        rc = ReferenceObj_GetIdCount( ref_obj, row_id, count );
-        if ( rc == 0 )
-        {
-            sum_prim += count[ 0 ];
-            sum_sec  += count[ 1 ];
-            sum_ev   += count[ 2 ];
-
-            if ( count[ 0 ] > max_prim )
-            {
-                max_prim = count[ 0 ];
-                max_prim_at = row_id;
-            }
-            if ( count[ 1 ] > max_sec )
-            {
-                max_sec = count[ 1 ];
-                max_sec_at = row_id;
-            }
-            if ( count[ 2 ] > max_ev )
-            {
-                max_ev = count[ 2 ];
-                max_ev_at = row_id;
-            }
-        }
-    }
-
-    rc = KOutMsg( "alignments:\t%,u PRI\t%,u SEC\t%,u EV\n", sum_prim, sum_sec, sum_ev );
-    if ( rc == 0 && max_prim > 0 )
-    {
-        uint64_t from = ( ( max_prim_at - start ) * 5000 ) + 1;
-        rc = KOutMsg( "max. PRI:\t%,u\tat row #%,i ( from pos: %,u ... %,u )\n", max_prim, max_prim_at, from, from + 4999 );
-    }
-    if ( rc == 0 && max_sec > 0 )
-    {
-        uint64_t from = ( ( max_sec_at - start ) * 5000 ) + 1;
-        rc = KOutMsg( "max. SEC:\t%,u\tat row #%,i ( from pos: %,u ... %,u )\n", max_sec, max_sec_at, from, from + 4999 );
-    }
-    if ( rc == 0 && max_ev > 0 )
-    {
-        uint64_t from = ( ( max_ev_at - start ) * 5000 ) + 1;
-        rc = KOutMsg( "max. EV:\t%,u\tat row #%,i ( from pos: %,u ... %,u )\n", max_ev, max_ev_at, from, from + 4999 );
-    }
-    return rc;
-}
-
-
-const char * ss_Database        = "Database";
-const char * ss_Table           = "Table";
-const char * ss_PrereleaseTbl   = "Prerelease Table";
-const char * ss_Column          = "Column";
-const char * ss_Index           = "Index";
-const char * ss_NotFound        = "not found";
-const char * ss_BadPath         = "bad path";
-const char * ss_File            = "File";
-const char * ss_Dir             = "Dir";
-const char * ss_CharDev         = "CharDev";
-const char * ss_BlockDev        = "BlockDev";
-const char * ss_FIFO            = "FIFO";
-const char * ss_ZombieFile      = "ZombieFile";
-const char * ss_Dataset         = "Dataset";
-const char * ss_Datatype        = "Datatype";
-const char * ss_unknown         = "unknown pathtype";
-
-
-static const char * path_type_2_str( const uint32_t pt )
-{
-    const char * res = ss_unknown;
-    switch ( pt )
-    {
-    case kptDatabase      :   res = ss_Database; break;
-    case kptTable         :   res = ss_Table; break;
-    case kptPrereleaseTbl :   res = ss_PrereleaseTbl; break;
-    case kptColumn        :   res = ss_Column; break;
-    case kptIndex         :   res = ss_Index; break;
-    case kptNotFound      :   res = ss_NotFound; break;
-    case kptBadPath       :   res = ss_BadPath; break;
-    case kptFile          :   res = ss_File; break;
-    case kptDir           :   res = ss_Dir; break;
-    case kptCharDev       :   res = ss_CharDev; break;
-    case kptBlockDev      :   res = ss_BlockDev; break;
-    case kptFIFO          :   res = ss_FIFO; break;
-    case kptZombieFile    :   res = ss_ZombieFile; break;
-    case kptDataset       :   res = ss_Dataset; break;
-    case kptDatatype      :   res = ss_Datatype; break;
-    default               :   res = ss_unknown; break;
-    }
-    return res;
-}
-
-
-static rc_t resolve_accession( VFSManager * vfs_mgr, const char * accession, const String ** path )
-{
-    VResolver * resolver;
-    rc_t rc = VFSManagerGetResolver( vfs_mgr, &resolver );
-    if ( rc == 0 )
-    {
-        VPath * vpath;
-        rc = VFSManagerMakePath( vfs_mgr, &vpath, accession );
-        if ( rc == 0 )
-        {
-            const VPath * local;
-            const VPath * remote;
-
-            rc = VResolverQuery ( resolver, eProtocolHttp, vpath, &local, &remote, NULL );
-            if ( rc == 0 )
-            {
-                if ( local != NULL )
-                    rc = VPathMakeString( local, path );
-                else 
-                    rc = VPathMakeString( remote, path );
-                if ( local != NULL )
-                    VPathRelease ( local );
-                if ( remote != NULL )
-                    VPathRelease ( remote );
-            }
-            VPathRelease ( vpath );
-        }
-        VResolverRelease( resolver );
-    }
-    return rc;
-}
-
-
-static rc_t report_ref_loc( const VDBManager *vdb_mgr, VFSManager * vfs_mgr, const char * seq_id )
-{
-    const String * path;
-    rc_t rc = resolve_accession( vfs_mgr, seq_id, &path );
-    if ( rc == 0 )
-    {
-        rc = KOutMsg( "location:\t%S\n", path );
-        if ( rc == 0 )
-        {
-            uint32_t pt = VDBManagerPathType ( vdb_mgr, "%S", path );
-            const char * spt = path_type_2_str( pt );
-            rc = KOutMsg( "pathtype:\t%s\n", spt );
-        }
-        free ( (void*) path );
-    }
-    return rc;
-}
-
-
-static rc_t report_ref_obj( const VDBManager *vdb_mgr, VFSManager * vfs_mgr, const char * path, uint32_t idx,
-                            const ReferenceObj* ref_obj, bool extended )
-{
-    const char * s;
-    const char * seq_id;
-    INSDC_coord_len len;
-    bool circular, external;
-    int64_t start, stop;
-
-    rc_t rc = ReferenceObj_Name( ref_obj, &s );
-    if ( rc == 0 )
-        rc = KOutMsg( "\nREF[%u].Name     = '%s'\n", idx, s );
-
-    if ( rc == 0 )
-        rc = ReferenceObj_SeqId( ref_obj, &seq_id );
-    if ( rc == 0 )
-        rc = KOutMsg( "REF[%u].SeqId    = '%s'\n", idx, seq_id );
-
-    if ( rc == 0 )
-        rc = ReferenceObj_SeqLength( ref_obj, &len );
-    if ( rc == 0 )
-        rc = KOutMsg( "REF[%u].Length   = %,u\n", idx, len );
-
-    if ( rc == 0 )
-        rc = ReferenceObj_Circular( ref_obj, &circular );
-    if ( rc == 0 )
-        rc = KOutMsg( "REF[%u].Circular = %s\n", idx, circular ? "yes" : "no" );
-
-    if ( rc == 0 )
-        rc = ReferenceObj_IdRange( ref_obj, &start, &stop );
-    if ( rc == 0 )
-        rc = KOutMsg( "REF[%u].IdRange  = [%,lu]...[%,lu]\n", idx, start, stop );
-
-    if ( rc == 0 )
-        rc = ReferenceObj_External( ref_obj, &external, NULL );
-    if ( rc == 0 )
-        rc = KOutMsg( "REF[%u].Extern   = %s\n", idx, external ? "yes" : "no" );
-    if ( rc == 0 && external )
-    {
-        rc = report_ref_loc( vdb_mgr, vfs_mgr, seq_id );
-    }
-
-    if ( rc == 0 && extended )
-        rc = report_ref_table2( ref_obj, start, stop );
-
-    return rc;
-}
-
-
-static rc_t report_ref_database( const VDBManager *vdb_mgr, VFSManager * vfs_mgr, const char * path, bool extended )
-{
-    const ReferenceList* reflist;
-    uint32_t options = ( ereferencelist_usePrimaryIds | ereferencelist_useSecondaryIds | ereferencelist_useEvidenceIds );
-    rc_t rc = ReferenceList_MakePath( &reflist, vdb_mgr, path, options, 0, NULL, 0 );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create ReferenceList" );
-    }
-    else
-    {
-        uint32_t count;
-        rc = ReferenceList_Count( reflist, &count );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "ReferenceList_Count() failed" );
-        }
-        else
-        {
-            rc = KOutMsg( "this object uses %u references\n", count );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                for ( idx = 0; idx < count && rc == 0; ++idx )
-                {
-                    const ReferenceObj* ref_obj;
-                    rc = ReferenceList_Get( reflist, &ref_obj, idx );
-                    if ( rc != 0 )
-                    {
-                        (void)LOGERR( klogErr, rc, "ReferenceList_Get() failed" );
-                    }
-                    else
-                    {
-                        rc = report_ref_obj( vdb_mgr, vfs_mgr, path, idx, ref_obj, extended );
-                        ReferenceObj_Release( ref_obj );
-                    }
-                }
-            }
-        }
-        ReferenceList_Release( reflist );
-    }
-    return rc;
-}
-
-
-static rc_t report_references( const VDBManager *vdb_mgr, VFSManager * vfs_mgr, const char * spec,
-                               bool extended )
-{
-    rc_t rc = KOutMsg( "\nreporting references of '%s'\n", spec );
-    if ( rc == 0 )
-    {
-        VPath * path = NULL;
-        const VPath * local_cache = NULL;
-        const KFile * remote_file = NULL;
-        rc = VFSManagerResolveSpec ( vfs_mgr, spec, &path, &remote_file, &local_cache, true );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot resolve spec via VFSManager" );
-        }
-        else
-        {
-            char buffer[ 4096 ];
-            size_t num_read;
-            rc = VPathReadPath ( path, buffer, sizeof buffer, &num_read );
-            if ( rc != 0 )
-            {
-                (void)LOGERR( klogErr, rc, "cannot read path from vpath" );
-            }
-            else
-            {
-                rc = KOutMsg( "resolved into '%s'\n", buffer );
-                if ( rc == 0 )
-                {
-                    int path_type = ( VDBManagerPathType ( vdb_mgr, "%s", buffer ) & ~ kptAlias );
-                    switch( path_type )
-                    {
-                        case kptDatabase : rc = report_ref_database( vdb_mgr, vfs_mgr, buffer, extended );
-                                           break;
-
-                        case kptTable    : rc = KOutMsg( "cannot report references on a table-object\n" );
-                                           break;
-
-                        default          : rc = KOutMsg( "the given object is not a vdb-database\n" );
-                                           break;
-                    }
-                }
-            }
-            KFileRelease( remote_file );
-            VPathRelease ( local_cache );
-            VPathRelease ( path );
-        }
-    }
-    return rc;
-}
-
-
-rc_t report_on_reference( Args * args, bool extended )
-{
-    uint32_t count;
-    rc_t rc = ArgsParamCount( args, &count );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsParamCount() failed" );
-    }
-    else
-    {
-        KDirectory *dir; 
-        rc = KDirectoryNativeDir( &dir );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-        }
-        else
-        {
-            const VDBManager *vdb_mgr;
-            rc = VDBManagerMakeRead ( &vdb_mgr, dir );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "VDBManagerMakeRead() failed" );
-            }
-            else
-            {
-                VFSManager * vfs_mgr;
-                rc =  VFSManagerMake ( &vfs_mgr );
-                if ( rc != 0 )
-                {
-                    (void)LOGERR( klogErr, rc, "cannot make vfs-manager" );
-                }
-                else
-                {
-                    uint32_t idx;
-                    for ( idx = 0; idx < count && rc == 0; ++idx )
-                    {
-                        const char *param = NULL;
-                        rc = ArgsParamValue( args, idx, &param );
-                        if ( rc != 0 )
-                        {
-                            LOGERR( klogInt, rc, "ArgsParamvalue() failed" );
-                        }
-                        else
-                        {
-                            /* rc value not used, because it can be something that has no references */
-                            report_references( vdb_mgr, vfs_mgr, param, extended );
-                        }
-                    }
-                    VFSManagerRelease ( vfs_mgr );
-                }
-                VDBManagerRelease( vdb_mgr );
-            }
-            KDirectoryRelease( dir );
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/reref.h b/tools/sra-pileup/reref.h
deleted file mode 100644
index 13e3136..0000000
--- a/tools/sra-pileup/reref.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_reref_
-#define _h_reref_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <kapp/args.h>
-
-#include <klib/out.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-
-#include <vdb/manager.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-
-rc_t report_on_reference( Args * args, bool extended );
-
-#endif
diff --git a/tools/sra-pileup/sam-aligned.c b/tools/sra-pileup/sam-aligned.c
deleted file mode 100644
index d0b4667..0000000
--- a/tools/sra-pileup/sam-aligned.c
+++ /dev/null
@@ -1,2046 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <align/manager.h>
-#include <align/iterator.h>
-#include <kapp/main.h>
-#include <sysalloc.h>
-
-#include "read_fkt.h"
-#include "cg_tools.h"
-#include "sam-aligned.h"
-
-const char * PRIM_TABLE = "PRIMARY_ALIGNMENT";
-const char * SEC_TABLE = "SECONDARY_ALIGNMENT";
-const char * EV_INT_TABLE = "EVIDENCE_INTERVAL";
-const char * EV_AL_TABLE = "EVIDENCE_ALIGNMENT";
-
-
-/* -------------------------------------------------------------------------------------------
-    column                      PRIM    SEC     EV_INT      EV_ALIGN ( outside of iterator )
-
-    SEQ_SPOT_ID                 X       X       -           X
-    SAM_FLAGS                   X       X       -           -
-    CIGAR_LONG                  X       X       X           X 
-    CIGAR_SHORT                 X       X       X           X
-    CIGAR_LONG_LEN              X       X       X           X 
-    CIGAR_SHORT_LEN             X       X       X           X
-    MATE_ALIGN_ID               X       X       -           -
-    MATE_REF_NAME               X       X       -           -
-    MATE_REF_POS                X       X       -           -
-    TEMPLATE_LEN                X       X       -           -
-    READ                        X       X       X           X
-    READ_LEN                    X       X       X           X
-    MISMATCH_READ               X       X       X           X
-    SAM_QUALITY                 X       X       X           X
-    REF_ORIENTATION             X       X       X           X
-    EDIT_DISTANCE               X       X       X           X
-    SEQ_SPOT_GROUP              X       X       -           X
-    SEQ_READ_ID                 X       X       -           X
-    RAW_READ                    X       X       X           X
-    READ_FILTER                 X       X       X           X
-    EVIDENCE_ALIGNMENT_IDS      -       -       X           -
-    REF_POS                                                 o
-    REF_PLOIDY                                              o
-    ALIGNMENT_COUNT             X       X       -           X
-    SEQ_NAME                                                X
-    MAPQ                                                    X
-   -------------------------------------------------------------------------------------------*/
-
-
-#define COL_NOT_AVAILABLE 0xFFFFFFFF
-
-#define COL_SEQ_SPOT_ID "(I64)SEQ_SPOT_ID"
-#define COL_SAM_FLAGS "(U32)SAM_FLAGS"
-#define COL_LONG_CIGAR "(ascii)CIGAR_LONG"
-#define COL_SHORT_CIGAR "(ascii)CIGAR_SHORT"
-#define COL_MATE_ALIGN_ID "(I64)MATE_ALIGN_ID"
-#define COL_MATE_REF_NAME "(ascii)MATE_REF_NAME"
-#define COL_MATE_REF_POS "(INSDC:coord:zero)MATE_REF_POS"
-#define COL_TEMPLATE_LEN "(I32)TEMPLATE_LEN"
-#define COL_MISMATCH_READ "(ascii)MISMATCH_READ"
-#define COL_SAM_QUALITY "(INSDC:quality:text:phred_33)SAM_QUALITY"
-#define COL_REF_ORIENTATION "(bool)REF_ORIENTATION"
-#define COL_EDIT_DIST "(U32)EDIT_DISTANCE"
-#define COL_SEQ_SPOT_GROUP "(ascii)SEQ_SPOT_GROUP"
-#define COL_SEQ_READ_ID "(INSDC:coord:one)SEQ_READ_ID"
-#define COL_RAW_READ "(INSDC:dna:text)RAW_READ"
-#define COL_PLOIDY "(NCBI:align:ploidy)PLOIDY"
-#define COL_CIGAR_LONG_LEN "(INSDC:coord:len)CIGAR_LONG_LEN"
-#define COL_CIGAR_SHORT_LEN "(INSDC:coord:len)CIGAR_SHORT_LEN"
-#define COL_READ_LEN "(INSDC:coord:len)READ_LEN"
-#define COL_EV_ALIGNMENTS "(I64)EVIDENCE_ALIGNMENT_IDS"
-#define COL_REF_POS "(INSDC:coord:zero)REF_POS"
-#define COL_REF_PLOIDY "(U32)REF_PLOIDY"
-#define COL_READ_FILTER "(INSDC:SRA:read_filter)READ_FILTER"
-#define COL_AL_COUNT "(U8)ALIGNMENT_COUNT"
-#define COL_SEQ_NAME "(ascii)SEQ_NAME"
-#define COL_MAPQ "(I32)MAPQ"
-
-enum align_table_type
-{
-    att_primary = 0,
-    att_secondary,
-    att_evidence
-};
-
-
-/* the part common to prim/sec/ev-alignment */
-typedef struct align_cmn_context
-{
-    const VCursor * cursor;
-
-    uint32_t seq_spot_id_idx;
-    uint32_t cigar_idx;
-    uint32_t cigar_len_idx;
-    uint32_t read_idx;
-    uint32_t read_len_idx;
-    uint32_t edit_dist_idx;
-    uint32_t seq_spot_group_idx;
-    uint32_t seq_read_id_idx;
-    uint32_t raw_read_idx;
-    uint32_t sam_quality_idx;
-    uint32_t ref_orientation_idx;
-    uint32_t read_filter_idx;
-    uint32_t al_count_idx;
-} align_cmn_context;
-
-
-typedef struct align_table_context
-{
-    CigOps * cig_op_buffer;
-    uint32_t cig_op_buffer_len;
-
-    /* which Reference-Obj in the ReferenceList we are aligning against... */
-    const ReferenceObj* ref_obj;
-    uint32_t ref_idx;
-
-    /* which index into the input-files object / needed to distinguish cache entries with the same number
-       but comming from different input-files */
-    uint32_t db_idx;
-
-    /* objects of which table are we aligning PRIM/SEC/EV ? */
-    enum align_table_type align_table_type;
-
-    /* the part common to prim/sec/ev-alignment */
-    align_cmn_context cmn;
-
-    /* this is specific to pim/sec */
-    uint32_t sam_flags_idx;
-    uint32_t mate_align_id_idx;
-    uint32_t mate_ref_name_idx;
-    uint32_t mate_ref_pos_idx;
-    uint32_t tlen_idx;
-
-    /* this is specific to ev-interval/ev-alignmnet */
-    uint32_t ploidy_idx;
-    uint32_t ev_alignments_idx;
-    uint32_t ref_pos_idx;
-    uint32_t ref_ploidy_idx;
-    uint32_t seq_name_idx;
-    uint32_t mapq_idx;
-
-    /* the common part repeats for evidence-alignment */
-    align_cmn_context eval;
-} align_table_context;
-
-
-static void invalidate_all_cmn_column_idx( align_cmn_context * const actx )
-{
-    actx->seq_spot_id_idx       = COL_NOT_AVAILABLE;
-    actx->cigar_idx             = COL_NOT_AVAILABLE;    
-    actx->cigar_len_idx         = COL_NOT_AVAILABLE;
-    actx->read_idx              = COL_NOT_AVAILABLE;
-    actx->read_len_idx          = COL_NOT_AVAILABLE;    
-    actx->edit_dist_idx         = COL_NOT_AVAILABLE;
-    actx->seq_spot_group_idx    = COL_NOT_AVAILABLE;
-    actx->seq_read_id_idx       = COL_NOT_AVAILABLE;
-    actx->raw_read_idx          = COL_NOT_AVAILABLE;
-    actx->sam_quality_idx       = COL_NOT_AVAILABLE;
-    actx->ref_orientation_idx   = COL_NOT_AVAILABLE;
-    actx->read_filter_idx       = COL_NOT_AVAILABLE;
-    actx->al_count_idx          = COL_NOT_AVAILABLE;
-}
-
-static void invalidate_all_column_idx( align_table_context * const atx )
-{
-    atx->sam_flags_idx      = COL_NOT_AVAILABLE;
-    atx->mate_align_id_idx  = COL_NOT_AVAILABLE;
-    atx->mate_ref_name_idx  = COL_NOT_AVAILABLE;
-    atx->mate_ref_pos_idx   = COL_NOT_AVAILABLE;
-    atx->tlen_idx           = COL_NOT_AVAILABLE;
-    atx->ploidy_idx         = COL_NOT_AVAILABLE;
-    atx->ev_alignments_idx  = COL_NOT_AVAILABLE;
-    atx->ref_pos_idx        = COL_NOT_AVAILABLE;
-    atx->ref_ploidy_idx     = COL_NOT_AVAILABLE;
-    atx->seq_name_idx       = COL_NOT_AVAILABLE;
-    atx->mapq_idx           = COL_NOT_AVAILABLE;
-    invalidate_all_cmn_column_idx( &atx->cmn );
-    invalidate_all_cmn_column_idx( &atx->eval );
-}
-
-
-static void init_align_table_context( align_table_context * const atx, const uint32_t db_idx, const ReferenceObj* ref_obj )
-{
-    atx->db_idx = db_idx;
-    atx->ref_obj = ref_obj;
-    atx->cig_op_buffer = NULL;
-    atx->cig_op_buffer_len = 0;
-    invalidate_all_column_idx( atx );
-}
-
-
-static void free_align_table_context( align_table_context * atx )
-{
-    if ( atx != NULL )
-    {
-        if ( atx->cig_op_buffer != NULL )
-            free( atx->cig_op_buffer );
-
-        VCursorRelease( atx->cmn.cursor );
-        VCursorRelease( atx->eval.cursor );
-        free( atx );
-    }
-}
-
-
-static rc_t adjust_align_table_context_cig_op_buffer( align_table_context * atx, uint32_t read_len )
-{
-    rc_t rc = 0;
-
-    uint32_t reqested = ( read_len * 3 );
-    if ( reqested < 1024 ) reqested = 1024;
-
-    if ( atx->cig_op_buffer_len < reqested )
-    {
-        void * org_buffer = NULL;
-
-        if ( atx->cig_op_buffer == NULL )
-            atx->cig_op_buffer = malloc( reqested );
-        else
-        {
-            org_buffer = atx->cig_op_buffer;
-            atx->cig_op_buffer = realloc( org_buffer, reqested );
-        }
-
-        if ( atx->cig_op_buffer == NULL )
-        {
-            rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            (void)LOGERR( klogInt, rc, "cigar-op-buffer-allocation failed" );
-            if ( org_buffer != NULL )
-                free( org_buffer );
-        }
-        else
-        {
-            atx->cig_op_buffer_len = reqested;
-        }
-    }
-
-    return rc;
-}
-
-
-/* src: 'P'rimary, 'S'econdary, Evidence_'I'nterval, Evidence_'A'lignment */
-static rc_t prepare_cmn_table_rows( const samdump_opts * const opts, const VTable *tbl,
-                                    align_cmn_context * const cmn, char src )
-{
-    struct KNamelist * available_columns;
-    rc_t rc = VTableListReadableColumns ( tbl, &available_columns );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, 
-            "VTableListReadableColumns( $(src) ) failed", "src=%c", src ) );
-    }
-    else
-    {
-        const VCursor * cursor = cmn->cursor;
-
-        if ( src == 'P' || src == 'S' )
-            rc = add_column( cursor, COL_SEQ_SPOT_ID, &cmn->seq_spot_id_idx );
-
-        if ( rc == 0 )
-        {
-            if ( opts->use_long_cigar )
-            {
-                rc = add_column( cursor, COL_LONG_CIGAR, &cmn->cigar_idx );
-                if ( rc == 0 && ( src == 'I' || src == 'A' ) )
-                    rc = add_column( cursor, COL_CIGAR_LONG_LEN, &cmn->cigar_len_idx );
-            }
-            else
-            {
-                rc = add_column( cursor, COL_SHORT_CIGAR, &cmn->cigar_idx );
-                if ( rc == 0 && ( src == 'I' || src == 'A' ) )
-                    rc = add_column( cursor, COL_CIGAR_SHORT_LEN, &cmn->cigar_len_idx );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            if ( opts->print_matches_as_equal_sign )
-                rc = add_column( cursor, COL_MISMATCH_READ, &cmn->read_idx );
-            else
-                rc = add_column( cursor, COL_READ, &cmn->read_idx );
-        }
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_READ_LEN, &cmn->read_len_idx );
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_SAM_QUALITY, &cmn->sam_quality_idx );
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_REF_ORIENTATION, &cmn->ref_orientation_idx );
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_EDIT_DIST, &cmn->edit_dist_idx );
-
-        if ( rc == 0 && ( src == 'P' || src == 'S' || src == 'A' ) )
-            rc = add_column( cursor, COL_SEQ_SPOT_GROUP, &cmn->seq_spot_group_idx );
-
-        if ( rc == 0 && ( src == 'P' || src == 'S' || src == 'A' ) )
-            rc = add_column( cursor, COL_SEQ_READ_ID, &cmn->seq_read_id_idx );
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_RAW_READ, &cmn->raw_read_idx );
-
-        if ( rc == 0 )
-            rc = add_column( cursor, COL_READ_FILTER, &cmn->read_filter_idx );
-
-        if ( rc == 0 && ( src == 'P' || src == 'S' || src == 'A' ) )
-            add_opt_column( cursor, available_columns, COL_AL_COUNT, &cmn->al_count_idx );
-
-        KNamelistRelease( available_columns );
-    }
-    return rc;
-}
-
-
-static rc_t prepare_prim_sec_table_cursor( const samdump_opts * const opts, const VDatabase * db,
-                                           const char * table_name, align_table_context * const atx )
-{
-    const VTable *tbl;
-    rc_t rc = VDatabaseOpenTableRead( db, &tbl, table_name );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, "VDatabaseOpenTableRead( $(tn) ) failed", "tn=%s", table_name ) );
-    }
-    else
-    {
-        if ( opts->cursor_cache_size == 0 )
-            rc = VTableCreateCursorRead( tbl, &atx->cmn.cursor );
-        else
-            rc = VTableCreateCachedCursorRead( tbl, &atx->cmn.cursor, opts->cursor_cache_size );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VTableCreateCursorRead( $(tn) ) failed", "tn=%s", table_name ) );
-        }
-        else
-        {
-            const VCursor * cursor = atx->cmn.cursor;
-            
-            rc = prepare_cmn_table_rows( opts, tbl, &atx->cmn, 'P' );
-
-            if ( rc == 0 )
-                rc = add_column( cursor, COL_SAM_FLAGS, &atx->sam_flags_idx );
-
-            /*  i don't have to add REF_NAME or REF_SEQ_ID, because i have it from the ref_obj later
-                i don't have to add REF_POS, because i have it from the iterator later
-                i don't have to add MAPQ, it is in the PlacementRecord later
-                    ... when walking the iterator ...
-            */
-            if ( rc == 0 )
-                rc = add_column( cursor, COL_MATE_ALIGN_ID, &atx->mate_align_id_idx );
-            if ( rc == 0 )
-                rc = add_column( cursor, COL_MATE_REF_NAME, &atx->mate_ref_name_idx );
-            if ( rc == 0 )
-                rc = add_column( cursor, COL_MATE_REF_POS, &atx->mate_ref_pos_idx );
-            if ( rc == 0 )
-                rc = add_column( cursor, COL_TEMPLATE_LEN, &atx->tlen_idx );
-
-            if ( rc != 0 )
-                VCursorRelease( cursor );
-        }
-        VTableRelease ( tbl ); /* the cursor keeps the table alive */
-    }
-    return rc;
-}
-
-
-static rc_t prepare_sub_ev_alignment_table_cursor( const samdump_opts * const opts, const VDatabase * db,
-                                                   align_table_context * const atx )
-{
-    rc_t rc = add_column( atx->cmn.cursor, COL_EV_ALIGNMENTS, &atx->ev_alignments_idx );
-    if ( rc == 0 )
-    {
-        const VTable *evidence_alignment_tbl;
-        rc = VDatabaseOpenTableRead( db, &evidence_alignment_tbl, EV_AL_TABLE );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VDatabaseOpenTableRead( $(tn) ) failed", "tn=%s", EV_AL_TABLE ) );
-        }
-        else
-        {
-            if ( opts->cursor_cache_size == 0 )
-                rc = VTableCreateCursorRead( evidence_alignment_tbl, &atx->eval.cursor );
-            else
-                rc = VTableCreateCachedCursorRead( evidence_alignment_tbl, &atx->eval.cursor, opts->cursor_cache_size );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogInt, ( klogInt, rc, "VTableCreateCursorRead( $(tn) ) failed", "tn=%s", EV_AL_TABLE ) );
-            }
-            else
-            {
-                rc = prepare_cmn_table_rows( opts, evidence_alignment_tbl, &atx->eval, 'A' ); /* common to prim/sec/ev-align */
-                if ( rc == 0 )
-                {
-                    /* special to ev-align */
-                    rc = add_column( atx->eval.cursor, COL_REF_POS, &atx->ref_pos_idx );
-                    if ( rc == 0 )
-                        rc = add_column( atx->eval.cursor, COL_REF_PLOIDY, &atx->ref_ploidy_idx );
-                    if ( rc == 0 )
-                        rc = add_column( atx->eval.cursor, COL_SEQ_NAME, &atx->seq_name_idx );
-                    if ( rc == 0 )
-                        rc = add_column( atx->eval.cursor, COL_MAPQ, &atx->mapq_idx );
-                }
-                rc = VCursorOpen( atx->eval.cursor );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( $(tn) ) failed", "tn=%s", EV_AL_TABLE ) );
-                }
-            }
-            VTableRelease ( evidence_alignment_tbl ); /* the cursor keeps the table alive */
-        }
-    }
-    return rc;
-}
-
-
-static rc_t prepare_evidence_table_cursor( const samdump_opts * const opts, const VDatabase * db,
-                                           const char * table_name, align_table_context * const atx )
-{
-    const VTable *evidence_interval_tbl;
-    rc_t rc = VDatabaseOpenTableRead( db, &evidence_interval_tbl, table_name );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, "VDatabaseOpenTableRead( $(tn) ) failed", "tn=%s", table_name ) );
-    }
-    else
-    {
-        if ( opts->cursor_cache_size == 0 )
-            rc = VTableCreateCursorRead( evidence_interval_tbl, &atx->cmn.cursor );
-        else
-            rc = VTableCreateCachedCursorRead( evidence_interval_tbl, &atx->cmn.cursor, opts->cursor_cache_size );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VTableCreateCursorRead( $(tn) ) failed", "tn=%s", table_name ) );
-        }
-        else
-        {
-            rc = prepare_cmn_table_rows( opts, evidence_interval_tbl, &atx->cmn, 'I' );
-            if ( rc == 0 )
-                rc = add_column( atx->cmn.cursor, COL_PLOIDY, &atx->ploidy_idx );            
-
-            if ( rc == 0 && ( opts->dump_cg_sam || opts->dump_cg_ev_dnb ) )
-                rc = prepare_sub_ev_alignment_table_cursor( opts, db, atx );
-
-            if ( rc != 0 )
-                VCursorRelease( atx->cmn.cursor );
-        }
-        VTableRelease ( evidence_interval_tbl ); /* the cursor keeps the table alive */
-    }
-    return rc;
-}
-
-
-static rc_t add_table_pl_iter( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                               const ReferenceObj * const ref_obj, const input_database * const idb,
-                               INSDC_coord_zero ref_pos, INSDC_coord_len ref_len, const char * spot_group,
-                               const char * table_name, align_id_src id_src_selector, Vector * const context_list )
-{
-    rc_t rc = 0;
-    align_table_context * atx;
-    PlacementRecordExtendFuncs ext_0; /* ReferenceObj_MakePlacementIterator makes copies of the elements */
-
-    memset( &ext_0, 0, sizeof ext_0 );
-    atx = calloc( 1, sizeof * atx );
-    if ( atx == NULL )
-    {
-        rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        (void)PLOGERR( klogInt, ( klogInt, rc, "align-context-allocation for $(tn) failed", "tn=%s", table_name ) );
-    }
-    else
-    {
-        init_align_table_context( atx, idb->db_idx, ref_obj );
-        rc = ReferenceObj_Idx( ref_obj, &atx->ref_idx );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "failed to detect ref-idx for $(tn) failed", "tn=%s", table_name ) );
-        }
-        else
-        {
-            switch( id_src_selector )
-            {
-                case primary_align_ids   :  atx->align_table_type = att_primary;
-                                            rc = prepare_prim_sec_table_cursor( opts, idb->db, table_name, atx );
-                                            break;
-
-                case secondary_align_ids :  atx->align_table_type = att_secondary;
-                                            rc = prepare_prim_sec_table_cursor( opts, idb->db, table_name, atx );
-                                            break;
-
-                case evidence_align_ids  :  atx->align_table_type = att_evidence;
-                                            rc = prepare_evidence_table_cursor( opts, idb->db, table_name, atx );
-                                            break;
-            }
-        }
-        if ( rc == 0 )
-        {
-            ext_0.data = atx;
-            /* we must put the atx-ptr into a global list, in order to close everything later at the end... */
-        }
-        else
-            free_align_table_context( atx );
-    }
-
-    if ( rc == 0 )
-    {
-        int32_t min_mapq = 0;
-        PlacementIterator *pl_iter;
-
-        if ( opts->use_min_mapq )
-            min_mapq = opts->min_mapq;
-
-        rc = ReferenceObj_MakePlacementIterator( ref_obj, /* the reference-obj it is made from */
-            &pl_iter,           /* the placement-iterator we want to make */
-            ref_pos,            /* where it starts on the reference */
-            ref_len,            /* the whole length of this reference/chromosome */
-            min_mapq,           /* no minimal mapping-quality to filter out */
-            NULL,               /* no special reference-cursor */
-            atx->cmn.cursor,    /* a cursor into the PRIMARY/SECONDARY/EVIDENCE-table */
-            id_src_selector,    /* what ID-source to select from REFERENCE-table (ref_obj) */
-            &ext_0,             /* placement-record extensions #0 with data-ptr pointing to cursor/index-struct */
-            NULL,               /* no placement-record extensions #1 */
-            spot_group,         /* optional spotgroup re-grouping */
-            NULL                /* source-cursor specific data/context */
-            );
-        if ( rc == 0 )
-        {
-            rc = PlacementSetIteratorAddPlacementIterator ( set_iter, pl_iter );
-            if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-        }
-    }
-
-    if ( rc == 0 )
-        rc = VectorAppend ( context_list, NULL, atx );
-    return rc;
-}
-
-
-static rc_t add_pl_iters( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                          const ReferenceObj * const ref_obj, const input_database * const idb,
-                          INSDC_coord_zero ref_pos, INSDC_coord_len ref_len,
-                          const char * spot_group, Vector * const context_list )
-{
-    KNamelist *tables;
-    rc_t rc = VDatabaseListTbl( idb->db, &tables );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, "VDatabaseListTbl( $(tn) ) failed", "tn=%s", idb->path ) );
-    }
-    else
-    {
-        if ( opts->dump_primary_alignments && namelist_contains( tables, PRIM_TABLE ) ) /* read_fkt.c */
-        {
-            rc = add_table_pl_iter( opts, set_iter, ref_obj, idb, ref_pos, ref_len, spot_group, 
-                                    PRIM_TABLE, primary_align_ids, context_list );
-        }
-
-        if ( rc == 0 && opts->dump_secondary_alignments && namelist_contains( tables, SEC_TABLE ) )
-        {
-            rc = add_table_pl_iter( opts, set_iter, ref_obj, idb, ref_pos, ref_len, spot_group, 
-                                    SEC_TABLE, secondary_align_ids, context_list );
-        }
-
-        if ( rc == 0 )
-        {
-            bool b0 = ( opts->dump_cg_evidence && 
-                        namelist_contains( tables, EV_INT_TABLE ) );
-
-            bool b1 = ( ( opts->dump_cg_sam || opts->dump_cg_ev_dnb ) && 
-                        namelist_contains( tables, EV_INT_TABLE ) &&
-                        namelist_contains( tables, EV_AL_TABLE ) );
-
-            if ( b0 || b1 )
-            {
-                rc = add_table_pl_iter( opts, set_iter, ref_obj, idb, ref_pos, ref_len, spot_group, 
-                                        EV_INT_TABLE, evidence_align_ids, context_list );
-            }
-        }
-        KNamelistRelease( tables );
-    }
-    return rc;
-}
-
-
-/* the user did not specify ranges on the reference, that means the whole file has to be dumped...
-   the reflist is iterated over all ref-objects it contains ... */
-static rc_t prepare_whole_files( const samdump_opts * const opts, const input_files * const ifs,
-                                 PlacementSetIterator * const set_iter, Vector * const context_list )
-{
-    rc_t rc = 0;
-    uint32_t db_idx;
-    /* we now loop through all input-databases... */
-    for ( db_idx = 0; db_idx < ifs->database_count && rc == 0; ++db_idx )
-    {
-        const input_database * idb = VectorGet( &ifs->dbs, db_idx );
-        if ( idb != NULL )
-        {
-            uint32_t refobj_count;
-            rc = ReferenceList_Count( idb->reflist, &refobj_count );
-            if ( rc == 0 && refobj_count > 0 )
-            {
-                uint32_t ref_idx;
-                for ( ref_idx = 0; ref_idx < refobj_count && rc == 0; ++ref_idx )
-                {
-                    const ReferenceObj* ref_obj;
-                    rc = ReferenceList_Get( idb->reflist, &ref_obj, ref_idx );
-                    if ( rc == 0 && ref_obj != NULL )
-                    {
-                        INSDC_coord_len ref_len;
-                        rc = ReferenceObj_SeqLength( ref_obj, &ref_len );
-                        if ( rc == 0 )
-                            rc = add_pl_iters( opts,
-                                set_iter,
-                                ref_obj,
-                                idb,
-                                0,                  /* where it starts on the reference */
-                                ref_len,            /* the whole length of this reference/chromosome */
-                                NULL,               /* no spotgroup re-grouping (yet) */
-                                context_list
-                                );
-                        ReferenceObj_Release( ref_obj );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-typedef struct on_region_ctx
-{
-    rc_t rc;
-    const samdump_opts * opts;
-    input_database * idb;
-    PlacementSetIterator * set_iter;
-    Vector *context_list;
-} on_region_ctx;
-
-
-static void CC on_region( BSTNode *n, void *data )
-{
-    on_region_ctx * rctx = data;
-    if ( rctx->rc == 0 )
-    {
-        reference_region * ref_rgn = ( reference_region * )n;
-        const ReferenceObj * ref_obj;
-        rctx->rc = ReferenceList_Find( rctx->idb->reflist, &ref_obj, ref_rgn->name, string_size( ref_rgn->name ) );
-        if ( rctx->rc == 0 )
-        {
-            uint32_t range_idx, range_count = VectorLength( &ref_rgn->ranges );
-            for ( range_idx = 0; range_idx < range_count && rctx->rc == 0; ++range_idx )
-            {
-                range * r = VectorGet( &ref_rgn->ranges, range_idx );
-                if ( r != NULL )
-                {
-                    INSDC_coord_len len;
-                    if ( r->start == 0 && r->end == 0 )
-                    {
-                        r->start = 1;
-                        rctx->rc = ReferenceObj_SeqLength( ref_obj, &len );
-                        if ( rctx->rc == 0 )
-                            r->end = ( r->start + len );
-                    }
-                    else
-                    {
-                        len = ( r->end - r->start + 1 );
-                    }
-                    if ( rctx->rc == 0 )
-                    {
-                        rctx->rc = add_pl_iters( rctx->opts, rctx->set_iter, ref_obj, rctx->idb,
-                            r->start,           /* where the range starts on the reference */
-                            len,                /* the length of this range */
-                            NULL,               /* no spotgroup re-grouping (yet) */
-                            rctx->context_list
-                            );
-                    }
-                }
-            }
-            ReferenceObj_Release( ref_obj );
-        }
-        else
-        {
-            if ( GetRCState( rctx->rc ) == rcNotFound ) rctx->rc = 0;
-        }
-    }
-}
-
-
-static rc_t prepare_regions( const samdump_opts * const opts, const input_files * const ifs,
-                             PlacementSetIterator * const set_iter, Vector * const context_list )
-{
-    uint32_t db_idx;
-    on_region_ctx rctx;
-
-    rctx.rc = 0;
-    rctx.opts = opts;
-    rctx.set_iter = set_iter;
-    rctx.context_list = context_list;
-    /* we now loop through all input-databases... */
-    for ( db_idx = 0; db_idx < ifs->database_count && rctx.rc == 0; ++db_idx )
-    {
-        rctx.idb = VectorGet( &ifs->dbs, db_idx );
-        if ( rctx.idb != NULL )
-            BSTreeForEach( ( BSTree * ) &opts->regions, false, on_region, &rctx );
-    }
-    return rctx.rc;
-}
-
-
-static uint32_t calc_mate_flags( uint32_t flags )
-{
-    uint32_t res = ( flags & 0x1 ) |
-                   ( flags & 0x2 ) |
-                   ( ( flags & 0x8 ) >> 1 ) |
-                   ( ( flags & 0x4 ) << 1 ) |
-                   ( ( flags & 0x20 ) >> 1 ) |
-                   ( ( flags & 0x10 ) << 1 ) |
-                   ( ( flags & 0x40 ) ? 0x80 : 0x40 ) |
-                   ( flags & 0x700 );
-    return res;
-}
-
-
-static const char *equal_sign = "=";
-
-
-static rc_t print_qslice( const samdump_opts * const opts, bool reverse, const char * source, uint32_t source_str_len,
-                          uint32_t *source_offset, const uint32_t * source_len_vector,
-                          uint32_t source_len_vector_len, uint32_t slice_nr )
-{
-    rc_t rc = 0;
-    if ( *source_offset > source_str_len || slice_nr >= source_len_vector_len )
-        rc = RC( rcExe, rcNoTarg, rcReading, rcParam, rcInvalid );
-    else
-    {
-        uint32_t len = source_len_vector[ slice_nr ];
-        if ( len > 0 )
-        {
-            const char * ptr = &source[ *source_offset ];
-            rc = dump_quality_33( opts, ptr, len, reverse ); /* sam-dump-opts.c */
-            if ( rc == 0 )
-            {
-                rc = KOutMsg( "\t" );
-                if ( rc == 0 )
-                    *source_offset += len;
-            }
-        }
-        else
-            rc = KOutMsg( "*\t" );
-    }
-    return rc;
-}
-
-
-static rc_t modify_and_print_cigar( const char * cigar, size_t cigar_len,
-                                    CigOps *ref_cig, int32_t ref_cig_len, INSDC_coord_zero ref_pos, uint32_t read_len )
-{
-    rc_t rc;
-    if ( cigar_len > 0 )
-    {
-        char cigbuf[ MAX_CG_CIGAR_LEN ];
-        uint32_t combined_len;
-        CigOps al_cig[ 1024 ];
-        ExplodeCIGAR( al_cig, 1024, cigar, cigar_len );
-        combined_len = CombineCIGAR( cigbuf, al_cig, read_len, ref_pos, ref_cig, ref_cig_len );
-        rc = KOutMsg( "%s\t", cigbuf );
-    }
-    else
-        rc = KOutMsg( "*\t" );
-    return rc;
-}
-
-
-static rc_t get_READ_QUALITY_EDIT_DIST( cg_cigar_output * cgc_output, int64_t align_id, const align_cmn_context * acc )
-{
-    /* get READ, QUALITY and EIDT_DIST before cigar manipulation because we need/change these values */
-    rc_t rc = read_char_ptr( align_id, acc->cursor, acc->read_idx, &cgc_output->p_read.ptr, &cgc_output->p_read.len, "READ" );
-    if ( rc == 0 )
-        rc = read_char_ptr( align_id, acc->cursor, acc->sam_quality_idx, &cgc_output->p_quality.ptr, &cgc_output->p_quality.len, "SAM_QUALITY" );
-    if ( rc == 0 )
-        rc = read_int32( align_id, acc->cursor, acc->edit_dist_idx, &cgc_output->edit_dist, 0, "EDIT_DIST" );
-    cgc_output->p_tags.len = 0;
-    return rc;
-}
-
-
-static rc_t read_ref_orientation_and_seq_read_id( cg_cigar_input * cgc_input, int64_t align_id, const align_cmn_context * acc )
-{
-    rc_t rc = read_bool( align_id, acc->cursor, acc->ref_orientation_idx, &cgc_input->orientation, false, "REF_ORIENT" );
-    if ( rc == 0 )
-        rc = read_INSDC_coord_one( align_id, acc->cursor, acc->seq_read_id_idx, &cgc_input->seq_req_id, 0, "SEQ_READ_ID" );
-    return rc;
-}
-
-/* this function expects:
-    READ        in : cgc_output->p_read.ptr, cgc_output->p_read.len
-    SAM_QUALITY in : cgc_output->p_quality.ptr, cgc_output->p_quality.len
-    CIGAR       in : cgc_input->p_cigar.ptr, cgc_input->p_cigar.len
-    EDIT_DIST   in : cgc_output->edit_dist
-*/
-static rc_t cg_cigar_treatments( enum cigar_treatment what_treatment, cg_cigar_input * cgc_input, cg_cigar_output * cgc_output,
-                                 int64_t align_id, const align_cmn_context * acc )
-{
-    rc_t rc = 0;
-    switch ( what_treatment )
-    {
-        case ct_unchanged : cgc_output->p_cigar.len  = cgc_input->p_cigar.len;
-                            cgc_output->p_cigar.ptr = cgc_input->p_cigar.ptr;
-                            break;
-
-        case ct_cg_style  : rc = read_ref_orientation_and_seq_read_id( cgc_input, align_id, acc );
-                            if ( rc == 0 )
-                            {
-                                cgc_input->edit_dist_available = true;
-                                cgc_input->edit_dist = cgc_output->edit_dist;
-                                rc = make_cg_cigar( cgc_input, cgc_output );
-                                if ( rc == 0 )
-                                {
-                                    cgc_output->p_cigar.len = cgc_output->cigar_len;
-                                    cgc_output->p_cigar.ptr = cgc_output->cigar;
-                                }
-                            }
-                            break;
-
-        case ct_cg_merge :  rc = read_ref_orientation_and_seq_read_id( cgc_input, align_id, acc );
-                            if ( rc == 0 )
-                            {
-                                cgc_input->p_read.ptr = cgc_output->p_read.ptr;
-                                cgc_input->p_read.len = cgc_output->p_read.len;
-                                cgc_input->p_quality.ptr = cgc_output->p_quality.ptr;
-                                cgc_input->p_quality.len = cgc_output->p_quality.len;
-                                cgc_input->edit_dist_available = true;
-                                cgc_input->edit_dist = cgc_output->edit_dist;
-                                rc = make_cg_merge( cgc_input, cgc_output );
-                                if ( rc == 0 )
-                                {
-                                    cgc_output->p_cigar.len = cgc_output->cigar_len;
-                                    cgc_output->p_cigar.ptr = cgc_output->cigar;
-                                }
-                            }
-                            break;
-    }
-    return rc;
-}
-
-
-/* triggered by option "--CG-SAM" */
-static rc_t print_evidence_alignment_cg_sam( const samdump_opts * const opts, const PlacementRecord * const rec,
-                                      const align_table_context * const atx, int64_t align_id, uint32_t ploidy_idx,
-                                      const char * ref_name, INSDC_coord_zero allele_pos, int32_t ref_cig_len )
-{
-    const VCursor * cursor = atx->eval.cursor;
-    INSDC_coord_zero ref_pos;
-    uint32_t seq_name_len, sam_flags, spot_group_len = 0;
-    const char * seq_name, * spot_group;
-    int32_t mapq;
-    cg_cigar_output cgc_output;
-
-    rc_t rc = read_char_ptr( align_id, cursor, atx->seq_name_idx, &seq_name, &seq_name_len, "SEQ_NAME" );
-    if ( rc == 0 && atx->eval.seq_spot_group_idx != COL_NOT_AVAILABLE )
-        rc = read_char_ptr( align_id, cursor, atx->eval.seq_spot_group_idx, &spot_group, &spot_group_len, "SEQ_SPOT_GROUP" );
-
-    if ( rc == 0 )
-    {
-        if ( opts->print_cg_names )
-        {
-            if ( spot_group_len > 0 )
-                /* SAM-FIELD: QNAME     constructed from spot-group/seq-name */
-                rc = KOutMsg( "%.*s-1:%.*s\t", spot_group_len, spot_group, seq_name_len, seq_name );
-
-        }
-        else
-        {
-            if ( seq_name_len > 0 )
-                /* SAM-FIELD: QNAME     constructed from allel-id/sub-id */
-                rc = KOutMsg( "%.*s/ALLELE_%li.%u\t", seq_name_len, seq_name, rec->id, ploidy_idx );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = read_INSDC_coord_zero( align_id, cursor, atx->ref_pos_idx, &ref_pos, 0, "REF_POS" );
-
-    if ( rc == 0 )
-        rc = read_int32( align_id, cursor, atx->mapq_idx, &mapq, 0, "MAPQ" );
-
-    if ( rc == 0 )
-    {
-        uint8_t ref_orient;
-        rc = read_uint8( align_id, cursor, atx->eval.ref_orientation_idx, &ref_orient, 0, "REF_ORIENT" );
-        if ( rc == 0 )
-        {
-            INSDC_coord_one seq_read_id;
-            bool cmpl = ref_orient;
-            rc = read_INSDC_coord_one( align_id, cursor, atx->eval.seq_read_id_idx, &seq_read_id, 0, "SEQ_READ_ID" );
-            sam_flags = ( 1 | ( cmpl ? 0x10 : 0 ) | ( seq_read_id == 1 ? 0x40 : 0x80 ) );
-        }
-    }
-
-    /* SAM-FIELD: FLAG      SRA-column: SAM_FLAGS ( uint32 ) */
-    /* SAM-FIELD: RNAME     SRA-column: ALLEL-NAME.ploidy_idx */
-    /* SAM-FIELD: POS       SRA-column: REF_POS + 1 */
-    /* SAM-FIELD: MAPQ      SRA-column: MAPQ ( from evidence-alignment-table, not from allel! ) */
-    if ( rc == 0 )
-        rc = KOutMsg( "%u\t%s\t%i\t%d\t", sam_flags, ref_name, allele_pos + ref_pos + 1, mapq );
-
-    /* get READ, QUALITY and EIDT_DIST before cigar manipulation because we need/change these values */
-    if ( rc == 0 )
-        rc = get_READ_QUALITY_EDIT_DIST( &cgc_output, align_id, &atx->eval );
-
-    /* SAM-FIELD: CIGAR     SRA-column: CIGAR_SHORT / with special treatment */
-    if ( rc == 0 )
-    {
-        cg_cigar_input cgc_input;
-        rc = read_char_ptr( align_id, cursor, atx->eval.cigar_idx, &cgc_input.p_cigar.ptr, &cgc_input.p_cigar.len, "CIGAR" );
-        if ( rc == 0 )
-            rc = cg_cigar_treatments( opts->cigar_treatment, &cgc_input, &cgc_output, align_id, &atx->eval );
-        if ( rc == 0 )
-            rc = modify_and_print_cigar( cgc_output.p_cigar.ptr, cgc_output.p_cigar.len,
-                                         atx->cig_op_buffer, ref_cig_len, ref_pos, cgc_output.p_read.len );
-    }
-
-    /* SAM-FIELD: RNEXT     SRA-column: MATE_REF_NAME '*' no mates! */
-    /* SAM-FIELD: PNEXT     SRA-column: MATE_REF_POS + 1 '0' no mates */
-    /* SAM-FIELD: TLEN      SRA-column: TEMPLATE_LEN '0' not in table */
-    /* SAM-FIELD: SEQ       SRA-column: READ  */
-    if ( rc == 0 )
-        rc = KOutMsg( "*\t0\t0\t%.*s\t", cgc_output.p_read.len, cgc_output.p_read.ptr );
-
-    /* SAM-FIELD: QUAL      SRA-column: SAM_QUALITY */
-    if ( rc == 0 && cgc_output.p_quality.len > 0 )
-        rc = dump_quality_33( opts, cgc_output.p_quality.ptr, cgc_output.p_quality.len, false ); /* sam-dump-opts.c */
-
-    /* OPT SAM-FIELD: RG     SRA-column: SEQ_SPOT_GROUP */
-    if ( rc == 0 && spot_group_len > 0 )
-        rc = KOutMsg( "\tRG:Z:%.*s", spot_group_len, spot_group );
-
-    if ( rc == 0 && cgc_output.p_tags.len > 0 )
-        rc = KOutMsg( "\t%.*s", cgc_output.p_tags.len, cgc_output.p_tags.ptr );
-
-    /* OPT SAM-FIELD: ZI     SRA-column: rec->id */
-    /* OPT SAM-FIELD: ZA     SRA-column: ploidy_idx */
-    if ( rc == 0 )
-        rc = KOutMsg( "\tZI:i:%li\tZA:i:%u", rec->id, ploidy_idx );
-
-    /* OPT SAM-FIELD: NH     SRA-column: ALIGNMENT_COUNT */
-    if ( rc == 0 && atx->eval.al_count_idx != COL_NOT_AVAILABLE )
-    {
-        const uint8_t * al_count;
-        uint32_t al_count_len;
-        rc = read_uint8_ptr( align_id, cursor, atx->eval.al_count_idx, &al_count, &al_count_len, "ALIGNMENT_COUNT" );
-        if ( rc == 0 && al_count_len > 0 )
-            rc = KOutMsg( "\tNH:i:%u", *al_count );
-    }
-
-    /* OPT SAM-FIELD: NM     SRA-column: EDIT_DISTANCE */
-    if ( rc == 0 )
-        rc = KOutMsg( "\tNM:i:%u", cgc_output.edit_dist );
-
-    /* OPT SAM-FIELD: XI     SRA-column: ALIGN_ID */
-    if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-        rc = KOutMsg( "\tXI:i:%u", align_id );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-
-    return rc;
-}
-
-
-/*  triggered by option --CG-evidence-dnb */
-static rc_t print_evidence_alignment_cg_ev_dnb( const samdump_opts * const opts, const PlacementRecord * const rec,
-                                      const align_table_context * const atx, int64_t align_id, uint32_t ploidy_idx )
-{
-    const VCursor * cursor = atx->eval.cursor;
-    INSDC_coord_zero ref_pos;
-    uint32_t seq_name_len, sam_flags, spot_group_len = 0;
-    int32_t mapq;
-    const char * seq_name, * spot_group;
-    cg_cigar_output cgc_output;
-
-    rc_t rc = read_char_ptr( align_id, cursor, atx->seq_name_idx, &seq_name, &seq_name_len, "SEQ_NAME" );
-    if ( rc == 0 && atx->eval.seq_spot_group_idx != COL_NOT_AVAILABLE )
-        rc = read_char_ptr( align_id, cursor, atx->eval.seq_spot_group_idx, &spot_group, &spot_group_len, "SEQ_SPOT_GROUP" );
-
-    if ( rc == 0 )
-    {
-        if ( opts->print_cg_names )
-        {
-            if ( spot_group_len > 0 )
-                /* SAM-FIELD: QNAME     constructed from spot-group/seq-name */
-                rc = KOutMsg( "%.*s-1:%.*s\t", spot_group_len, spot_group, seq_name_len, seq_name );
-
-        }
-        else
-        {
-            if ( seq_name_len > 0 )
-                /* SAM-FIELD: QNAME     constructed from allel-id/sub-id */
-                rc = KOutMsg( "%.*s/ALLELE_%li.%u\t", seq_name_len, seq_name, rec->id, ploidy_idx );
-        }
-    }
-
-    if ( rc == 0 )
-        rc = read_INSDC_coord_zero( align_id, cursor, atx->ref_pos_idx, &ref_pos, 0, "REF_POS" );
-
-    if ( rc == 0 )
-        rc = read_int32( align_id, cursor, atx->mapq_idx, &mapq, 0, "MAPQ" );
-
-    if ( rc == 0 )
-    {
-        uint8_t ref_orient;
-        rc = read_uint8( align_id, cursor, atx->eval.ref_orientation_idx, &ref_orient, 0, "REF_ORIENT" );
-        if ( rc == 0 )
-        {
-            INSDC_coord_one seq_read_id;
-            bool cmpl = ref_orient;
-            rc = read_INSDC_coord_one( align_id, cursor, atx->eval.seq_read_id_idx, &seq_read_id, 0, "SEQ_READ_ID" );
-            sam_flags = ( 1 | ( cmpl ? 0x10 : 0 ) | ( seq_read_id == 1 ? 0x40 : 0x80 ) );
-        }
-    }
-
-    /* SAM-FIELD: FLAG      SRA-column: SAM_FLAGS ( uint32 ) */
-    /* SAM-FIELD: RNAME     SRA-column: ALLEL-NAME.ploidy_idx */
-    /* SAM-FIELD: POS       SRA-column: REF_POS + 1 */
-    /* SAM-FIELD: MAPQ      SRA-column: MAPQ ( from evidence-alignment-table, not from allel! ) */
-    if ( rc == 0 )
-        rc = KOutMsg( "%u\tALLELE_%li.%u\t%i\t%d\t", sam_flags, rec->id, ploidy_idx, ref_pos + 1, mapq );
-
-    /* get READ, QUALITY and EIDT_DIST before cigar manipulation because we need/change these values */
-    if ( rc == 0 )
-        rc = get_READ_QUALITY_EDIT_DIST( &cgc_output, align_id, &atx->eval );
-
-    /* SAM-FIELD: CIGAR     SRA-column: CIGAR_SHORT / with or without treatment */
-    if ( rc == 0 )
-    {
-        cg_cigar_input cgc_input;
-        rc = read_char_ptr( align_id, cursor, atx->eval.cigar_idx, &cgc_input.p_cigar.ptr, &cgc_input.p_cigar.len, "CIGAR" );
-        if ( rc == 0 )
-        rc = cg_cigar_treatments( opts->cigar_treatment, &cgc_input, &cgc_output, align_id, &atx->eval );
-        if ( rc == 0 )
-            rc = KOutMsg( "%.*s\t", cgc_output.p_cigar.len, cgc_output.p_cigar.ptr );
-    }
-
-    /* SAM-FIELD: RNEXT     SRA-column: MATE_REF_NAME '*' no mates! */
-    /* SAM-FIELD: PNEXT     SRA-column: MATE_REF_POS + 1 '0' no mates */
-    /* SAM-FIELD: TLEN      SRA-column: TEMPLATE_LEN '0' not in table */
-    /* SAM-FIELD: SEQ       SRA-column: READ  */
-    if ( rc == 0 )
-        rc = KOutMsg( "*\t0\t0\t%.*s\t", cgc_output.p_read.len, cgc_output.p_read.ptr );
-
-    /* SAM-FIELD: QUAL      SRA-column: SAM_QUALITY */
-    if ( rc == 0 && cgc_output.p_quality.len > 0 )
-        rc = dump_quality_33( opts, cgc_output.p_quality.ptr, cgc_output.p_quality.len, false ); /* sam-dump-opts.c */
-
-    /* OPT SAM-FIELD: RG     SRA-column: SEQ_SPOT_GROUP */
-    if ( rc == 0 && spot_group_len > 0 )
-        rc = KOutMsg( "\tRG:Z:%.*s", spot_group_len, spot_group );
-
-    if ( rc == 0 && cgc_output.p_tags.len > 0 )
-        rc = KOutMsg( "\t%.*s", cgc_output.p_tags.len, cgc_output.p_tags.ptr );
-
-    /* OPT SAM-FIELD: NH     SRA-column: ALIGNMENT_COUNT */
-    if ( rc == 0 && atx->eval.al_count_idx != COL_NOT_AVAILABLE )
-    {
-        const uint8_t * al_count;
-        uint32_t al_count_len;
-        rc = read_uint8_ptr( align_id, cursor, atx->eval.al_count_idx, &al_count, &al_count_len, "ALIGNMENT_COUNT" );
-        if ( rc == 0 && al_count_len > 0 )
-            rc = KOutMsg( "\tNH:i:%u", *al_count );
-    }
-
-    /* OPT SAM-FIELD: NM     SRA-column: EDIT_DISTANCE */
-    if ( rc == 0 )
-        rc = KOutMsg( "\tNM:i:%u", cgc_output.edit_dist );
-
-    /* OPT SAM-FIELD: XI     SRA-column: ALIGN_ID */
-    if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-        rc = KOutMsg( "\tXI:i:%u", align_id );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-
-    return rc;
-}
-
-
-/* print minimal one alignment from the EVIDENCE-INTERVAL / EVIDENCE-ALIGNMENT - table(s) 
-   triggered by option "--CG-SAM / --CG-evidence / --CG-evidence-dnb */
-static rc_t print_alignment_sam_ev( const samdump_opts * const opts, const char * ref_name,
-                                    INSDC_coord_zero pos,
-                                    const PlacementRecord * const rec, align_table_context * const atx,
-                                    uint64_t * const rows_so_far )
-{
-    uint32_t ploidy;
-    const VCursor * cursor = atx->cmn.cursor;
-    rc_t rc = read_uint32( rec->id, cursor, atx->ploidy_idx, &ploidy, 0, "PLOIDY" );
-    if ( rc == 0 && ploidy > 0 )
-    {
-        uint32_t ploidy_idx, cigar_len_vector_len, read_len_vector_len, edit_dist_vector_len, cigar_str_len, read_len, quality_str_len;
-        uint32_t quality_offset = 0;
-        const uint32_t *cigar_len_vector, *read_len_vector, *edit_dist_vector;
-        const char * cigar, *read, *quality;
-
-        rc = read_char_ptr( rec->id, cursor, atx->cmn.cigar_idx, &cigar, &cigar_str_len, "CIGAR" );
-        if ( rc == 0 )
-            rc = read_uint32_ptr( rec->id, cursor, atx->cmn.cigar_len_idx, &cigar_len_vector, &cigar_len_vector_len, "CIGAR_LEN" );
-        if ( rc == 0 )
-            rc = read_char_ptr( rec->id, cursor, atx->cmn.read_idx, &read, &read_len, "READ" );
-        if ( rc == 0 )
-            rc = read_uint32_ptr( rec->id, cursor, atx->cmn.read_len_idx, &read_len_vector, &read_len_vector_len, "READ_LEN" );
-        if ( rc == 0 )
-            rc = read_char_ptr( rec->id, cursor, atx->cmn.sam_quality_idx, &quality, &quality_str_len, "QUALITY" );
-        if ( rc == 0 )
-            rc = read_uint32_ptr( rec->id, cursor, atx->cmn.edit_dist_idx, &edit_dist_vector, &edit_dist_vector_len, "EDIT_DIST" );
-
-        for ( ploidy_idx = 0; ploidy_idx < ploidy && rc == 0; ++ploidy_idx )
-        {
-            uint32_t cigar_slice_len = cigar_len_vector[ ploidy_idx ];
-            uint32_t read_slice_len = read_len_vector[ ploidy_idx ];
-            if ( opts->dump_cg_evidence )
-            {
-                /* SAM-FIELD: QNAME     SRA-column: eventually prefixed row-id into EVIDENCE_INTERVAL - table */
-                /* SAM-FIELD: FLAG      SRA-column: SAM_FLAGS ( uint32 ) */
-                /* SAM-FIELD: RNAME     SRA-column: REF_NAME / REF_SEQ_ID ( char * ) */
-                /* SAM-FIELD: POS       SRA-column: REF_POS + 1 */
-                /* SAM-FIELD: MAPQ      SRA-column: MAPQ */
-                if ( rc == 0 )
-                {
-                    if ( opts->print_cg_names )
-                        rc = KOutMsg( "-1:0\t" );
-                    else
-                        rc = KOutMsg( "ALLELE_%li.%u\t", rec->id, ploidy_idx + 1 );
-                }
-
-                if ( rc == 0 )
-                    rc = KOutMsg( "0\t%s\t%u\t%d\t", ref_name, pos + 1, rec->mapq );
-
-                /* SAM-FIELD: CIGAR     SRA-column: CIGAR_SHORT / CIGAR_LONG sliced!!! */
-                if ( rc == 0 )
-                    rc = KOutMsg( "%.*s\t", cigar_slice_len, cigar );
-
-                /* SAM-FIELD: RNEXT     SRA-column: MATE_REF_NAME ( !!! row_len can be zero !!! ) */
-                /* SAM-FIELD: PNEXT     SRA-column: MATE_REF_POS + 1 ( !!! row_len can be zero !!! ) */
-                /* SAM-FIELD: TLEN      SRA-column: TEMPLATE_LEN ( !!! row_len can be zero !!! ) */
-                /* SAM-FIELD: SEQ       SRA-column: READ sliced!!! */
-                if ( rc == 0 )
-                    rc = KOutMsg( "*\t0\t0\t%.*s\t", read_slice_len, read );
-
-                /* SAM-FIELD: QUAL      SRA-column: SAM_QUALITY sliced!!! */
-                if ( rc == 0 )
-                    rc = print_qslice( opts, false, quality, quality_str_len, &quality_offset, read_len_vector, read_len_vector_len, ploidy_idx );
-
-                /* OPT SAM-FIELD: RG     SRA-column: ploidy_idx */
-                if ( rc == 0 )
-                    rc = KOutMsg( "RG:Z:ALLELE_%u", ploidy_idx + 1 );
-
-                /* OPT SAM-FIELD: XI     SRA-column: ALIGN_ID */
-                if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-                    rc = KOutMsg( "\tXI:i:%u", rec->id );
-
-                /* OPT SAM-FIELD: NM     SRA-column: EDIT_DISTANCE sliced!!! */
-                if ( rc == 0 && ( ploidy_idx < edit_dist_vector_len ) )
-                    rc = KOutMsg( "\tNM:i:%u", edit_dist_vector[ ploidy_idx ] );
-
-                if ( rc == 0 )
-                    rc = KOutMsg( "\n" );
-
-                (*rows_so_far)++;
-            }
-
-            /* we do that here per ALLEL-READ, not at the end per ALLEL, because we have to test which alignments
-               fit the ploidy_idx */
-
-            if ( rc == 0 && ( opts->dump_cg_sam || opts->dump_cg_ev_dnb ) )
-            {
-                const int64_t *ev_al_ids;
-                uint32_t ev_al_ids_count, read_id;
-
-                rc = read_int64_ptr( rec->id, atx->cmn.cursor, atx->ev_alignments_idx, &ev_al_ids, &ev_al_ids_count, "EV_ALIGNMENTS" );
-                for ( read_id = 0; read_id < ev_al_ids_count && rc == 0; ++read_id )
-                {
-                    uint32_t ref_ploidy;
-                    int64_t align_id = ev_al_ids[ read_id ];
-                    rc = read_uint32( align_id, atx->eval.cursor, atx->ref_ploidy_idx, &ref_ploidy, 0, "PLOIDY" );
-
-                    if ( rc == 0 && ( ref_ploidy == ( ploidy_idx + 1 ) ) )
-                    {
-                        if ( rc == 0 && opts->dump_cg_sam )
-                        {
-                            rc = adjust_align_table_context_cig_op_buffer( atx, read_slice_len );
-                            if ( rc == 0 )
-                            {
-                                int32_t ref_cig_len = ExplodeCIGAR( atx->cig_op_buffer, atx->cig_op_buffer_len, cigar, cigar_slice_len );
-                                rc = print_evidence_alignment_cg_sam( opts, rec, atx, align_id, ploidy_idx + 1, ref_name, pos, ref_cig_len );
-                            }
-                        }
-
-                        if ( rc == 0 && opts->dump_cg_ev_dnb )
-                            rc = print_evidence_alignment_cg_ev_dnb( opts, rec, atx, align_id, ploidy_idx + 1 );
-                    }
-                }
-            }
-
-            /* advance the cigar-slice... */
-            cigar += cigar_slice_len;
-            read += read_slice_len;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t check_rna_splicing_candidates_against_ref( struct ReferenceObj const * ref_obj,
-                                                       INSDC_coord_zero pos, rna_splice_candidates * candidates )
-{
-    rc_t rc = 0;
-    uint32_t idx;
-    for ( idx = 0; idx < candidates->count && rc == 0; ++idx )
-    {
-        uint8_t splice[ 4 ];
-        INSDC_coord_len written;
-        rna_splice_candidate * rsc = &candidates->candidates[ idx ];
-        rc = ReferenceObj_Read( ref_obj, pos + rsc->offset, 2, splice, &written );
-        if ( rc == 0 && written == 2 )
-        {
-            rc = ReferenceObj_Read( ref_obj, pos + rsc->offset + rsc->len - 2, 2, &splice[2], &written );
-            if ( rc == 0 && written == 2 && splice[ 1 ] == 'T' && splice[ 2 ] == 'A' )
-            {
-                if ( splice[ 0 ] == 'G' && splice[ 3 ] == 'G' )
-                {
-                    rsc->matched = 1;
-                }
-                else if ( splice[ 0 ] == 'A' && splice[ 3 ] == 'C' )
-                {
-                    rsc->matched = 1;
-                }
-                else if ( splice[ 0 ] == 'C' && splice[ 3 ] == 'C' )
-                {
-                    rsc->matched = 2;
-                }
-                else if ( splice[ 0 ] == 'G' && splice[ 3 ] == 'T' )
-                {
-                    rsc->matched = 2;
-                }
-                if ( rsc->matched == 1 )
-                    candidates->fwd_matched++;
-                else if ( rsc->matched == 2 )
-                    candidates->rev_matched++;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_alignment_sam_ps( const samdump_opts * const opts, const char * ref_name,
-                                    INSDC_coord_zero pos, matecache * const mc,
-                                    const PlacementRecord * const rec, const align_table_context * const atx,
-                                    uint64_t * const rows_so_far )
-{
-    uint32_t sam_flags = 0, seq_spot_id_len, mate_ref_pos_len = 0, mate_ref_name_len = string_size( ref_name );
-    INSDC_coord_zero mate_ref_pos = 0;
-    INSDC_coord_len tlen = 0;
-    int64_t mate_align_id = 0, id = rec->id;
-    const int64_t * seq_spot_id;
-    const char * mate_ref_name = ref_name;
-    const VCursor * cursor = atx->cmn.cursor;
-    cg_cigar_output cgc_output;
-    rna_splice_candidates candidates;
-
-    /* SAM-FIELD: NONE      SRA-column: MATE_ALIGN_ID ( int64 ) ... for cache lookup's */
-    rc_t rc = read_int64( id, cursor, atx->mate_align_id_idx, &mate_align_id, 0, "MATE_ALIGN_ID" );
-
-    candidates.count = 0;
-    candidates.fwd_matched = 0;
-    candidates.rev_matched = 0;
-
-    /* pre-read seq-spot-id, needed for unaligned cache and SAM-field QNAME */
-    if ( rc == 0 )
-        rc = read_int64_ptr( id, cursor, atx->cmn.seq_spot_id_idx, &seq_spot_id, &seq_spot_id_len, "SEQ_SPOT_ID" );
-
-    /* try to find the info about the mate in the CACHE... */
-    if ( rc == 0 )
-    {
-        if ( mate_align_id != 0 )
-        {
-            if ( opts->use_mate_cache && mc != NULL )
-            {
-                rc = matecache_lookup_same_ref( mc, atx->db_idx, mate_align_id, &mate_ref_pos, &sam_flags, &tlen );
-                if ( rc == 0 )
-                {
-                    /* we found it in the the sam-ref-matecache */
-                    const INSDC_read_filter * read_filter;
-                    uint32_t read_filter_len;
-
-                    /* cache entry-found! (on the same reference) -> that means we have now mate_ref_pos, flags and tlen */
-                    matecache_remove_same_ref( mc, atx->db_idx, mate_align_id );
-                    mate_ref_name = equal_sign;
-                    mate_ref_name_len = 1;
-                    mate_ref_pos_len = 1;
-
-                    /* read the read-filter column and adjust the sam-flags value to reflect the presense
-                       of the flag SRA_READ_FILTER_REJECT, if it is there switch 0x200 on, of not switch 0x200 off */
-                    rc = read_INSDC_read_filter_ptr( id, cursor, atx->cmn.read_filter_idx, &read_filter, &read_filter_len, "RD_FILTER" );
-                    if ( rc == 0 && read_filter_len > 0 )
-                    {
-                        if ( ( read_filter[ 0 ] & READ_FILTER_REJECT ) == READ_FILTER_REJECT )
-                            sam_flags |= 0x200;
-                        else
-                            sam_flags &= ~0x200;
-
-                        if ( ( read_filter[ 0 ] & READ_FILTER_CRITERIA ) == READ_FILTER_CRITERIA )
-                            sam_flags |= 0x400;
-                        else
-                            sam_flags &= ~0x400;
-                    }
-                }
-                else
-                {
-                    /* we did not find it in the the sam-ref-matecache */
-                    rc = RC( rcApp, rcNoTarg, rcAccessing, rcItem, rcNotFound );
-                }
-            }
-            else
-            {
-                rc = RC( rcApp, rcNoTarg, rcAccessing, rcItem, rcNotFound );
-            }
-        }
-
-        if ( ( mate_align_id != 0 && GetRCState( rc ) == rcNotFound )||( mate_align_id == 0 ) )
-        {
-            /* no cache entry-found OR do not use mate-cache
-               ---> that means we have to read it from the table... */
-
-            rc = read_char_ptr( id, cursor, atx->mate_ref_name_idx, &mate_ref_name, &mate_ref_name_len, "REF_NAME" );
-            if ( rc == 0 )
-                rc = read_INSDC_coord_zero( id, cursor, atx->mate_ref_pos_idx, &mate_ref_pos, 0, "REF_POS" );
-            if ( rc == 0 )
-                rc = read_INSDC_coord_len( id, cursor, atx->tlen_idx, &tlen, 0, "TLEN" );
-            if ( rc == 0 )
-                rc = read_uint32( id, cursor, atx->sam_flags_idx, &sam_flags, 0, "SAM_FLAGS" );
-
-            if ( rc == 0 )
-            {
-                int32_t cmp = -1;
-                if ( mate_ref_name_len > 0 )
-                {
-                    size_t ref_name_len = string_size( ref_name );
-                    size_t cmp_len = ( mate_ref_name_len > ref_name_len ? mate_ref_name_len : ref_name_len );
-                    cmp = string_cmp( mate_ref_name, mate_ref_name_len, ref_name, ref_name_len, cmp_len );
-                    if ( cmp == 0 )
-                    {
-                        mate_ref_name = equal_sign;
-                        mate_ref_name_len = 1;
-                    }
-                }
-
-                if ( opts->use_mate_cache )
-                {
-                    if ( mate_align_id != 0 && mate_ref_name_len > 0 && cmp == 0 )
-                    {
-                        /* now that we have the data, store it in sam-ref-cache it the mate is on the same ref. */
-                        uint32_t mate_flags = calc_mate_flags( sam_flags );
-                        rc = matecache_insert_same_ref( mc, atx->db_idx, id, pos, mate_flags, -tlen );
-                    }
-
-                    if ( mate_align_id == 0 && mate_ref_name_len == 0 && opts->print_half_unaligned_reads )
-                    {
-                        rc = matecache_insert_unaligned( mc, atx->db_idx, id, pos, atx->ref_idx, *seq_spot_id );
-                    }
-                }
-            }
-        }
-    }
-
-    if ( rc == 0 && opts->use_matepair_filter && !filter_by_matepair_dist( opts, tlen ) )
-        return 0;
-
-    (*rows_so_far)++;
-
-    /* SAM-FIELD: QNAME     SRA-column: SEQ_SPOT_ID ( int64 ) */
-    if ( rc == 0 )
-    {
-        if ( seq_spot_id_len > 0 )
-        {
-            if ( opts->print_spot_group_in_name | opts->print_cg_names )
-            {
-                const char * spot_group;
-                uint32_t spot_group_len;
-                rc = read_char_ptr( id, cursor, atx->cmn.seq_spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-                if ( rc == 0 )
-                    rc = dump_name( opts, *seq_spot_id, spot_group, spot_group_len ); /* sam-dump-opts.c */
-            }
-            else
-                rc = dump_name( opts, *seq_spot_id, NULL, 0 ); /* sam-dump-opts.c */
-        }
-        else
-            rc = KOutMsg( "*" );
-    }
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\t" );
-
-    /* massage the sam-flag if we are not dumping unaligned reads... */
-    if ( !opts->dump_unaligned_reads    /** not going to dump unaligned **/
-         && ( sam_flags & 0x1 )         /** but we have sequenced multiple fragments **/
-         && ( sam_flags & 0x8 ) )       /** and not all of them align **/
-        /*** remove flags talking about multiple reads **/
-        /* turn off 0x001 0x008 0x040 0x080 */
-        sam_flags &= ~0xC9;
-
-    /* SAM-FIELD: FLAG      SRA-column: SAM_FLAGS ( uint32 ) */
-    /* SAM-FIELD: RNAME     SRA-column: REF_NAME / REF_SEQ_ID ( char * ) */
-    /* SAM-FIELD: POS       SRA-column: REF_POS + 1 */
-    /* SAM-FIELD: MAPQ      SRA-column: MAPQ */
-    if ( rc == 0 )
-        rc = KOutMsg( "%u\t%s\t%u\t%d\t", sam_flags, ref_name, pos + 1, rec->mapq );
-
-    /* get READ, QUALITY and EIDT_DIST before cigar manipulation because we need/change these values */
-    if ( rc == 0 )
-        rc = get_READ_QUALITY_EDIT_DIST( &cgc_output, rec->id, &atx->cmn );
-
-    /* SAM-FIELD: CIGAR     SRA-column: CIGAR_SHORT / with or without treatment */
-    if ( rc == 0 )
-    {
-        cg_cigar_input cgc_input;
-        char * temp_cigar = NULL;
-        static char const *bogus_quality = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
-
-        rc = read_char_ptr( id, cursor, atx->cmn.cigar_idx, &cgc_input.p_cigar.ptr, &cgc_input.p_cigar.len, "CIGAR" );
-        if (rc == 0) {
-            if (cgc_output.p_quality.len == 0) {
-                cgc_output.p_quality.ptr = bogus_quality;
-                cgc_output.p_quality.len = 35;
-            }
-            rc = cg_cigar_treatments( opts->cigar_treatment, &cgc_input, &cgc_output, rec->id, &atx->cmn );
-        }
-
-        if ( opts->rna_splicing )
-        {
-            rc = discover_rna_splicing_candidates( cgc_output.p_cigar.len, cgc_output.p_cigar.ptr, 10, &candidates ); /* cg_tools.c */
-            if ( rc == 0 && candidates.count > 0 )
-            {
-                rc = check_rna_splicing_candidates_against_ref( rec->ref, pos, &candidates );
-                if ( rc == 0 && ( candidates.fwd_matched > 0 || candidates.rev_matched > 0 ) )
-                {
-                    temp_cigar = malloc( cgc_output.p_cigar.len + 1 );
-                    if ( temp_cigar != NULL )
-                    {
-                        memcpy( temp_cigar, cgc_output.p_cigar.ptr, cgc_output.p_cigar.len );
-                        rc = change_rna_splicing_cigar( cgc_output.p_cigar.len, temp_cigar, &candidates ); /* cg_tools.c */
-                        if ( rc == 0 )
-                            cgc_output.p_cigar.ptr = temp_cigar;
-                    }
-                }
-            }
-        }
-        if ( rc == 0 )
-            rc = KOutMsg( "%.*s\t", cgc_output.p_cigar.len, cgc_output.p_cigar.ptr );
-        if ( temp_cigar != NULL )
-            free( temp_cigar );
-    }
-
-    /* SAM-FIELD: RNEXT     SRA-column: MATE_REF_NAME ( !!! row_len can be zero !!! ) */
-    /* SAM-FIELD: PNEXT     SRA-column: MATE_REF_POS + 1 ( !!! row_len can be zero !!! ) */
-    /* SAM-FIELD: TLEN      SRA-column: TEMPLATE_LEN ( !!! row_len can be zero !!! ) */
-    if ( rc == 0 )
-    {
-        if ( mate_ref_name_len > 0 )
-        {
-            rc = KOutMsg( "%.*s\t%u\t%d\t", mate_ref_name_len, mate_ref_name, mate_ref_pos + 1, tlen );
-        }
-        else
-        {
-            if ( mate_ref_pos_len == 0 )
-                rc = KOutMsg( "*\t0\t%d\t", tlen );
-            else
-                rc = KOutMsg( "*\t%u\t%d\t", mate_ref_pos, tlen );
-        }
-    }
-
-    /* SAM-FIELD: SEQ       SRA-column: READ */
-    if ( rc == 0 )
-        rc = KOutMsg( "%.*s\t", cgc_output.p_read.len, cgc_output.p_read.ptr );
-
-    /* SAM-FIELD: QUAL      SRA-column: SAM_QUALITY */
-    if ( rc == 0 )
-    {
-        if ( cgc_output.p_quality.len > 0 )
-            rc = dump_quality_33( opts, cgc_output.p_quality.ptr, cgc_output.p_quality.len, false );
-        else
-            rc = KOutMsg( "*" );
-    }
-
-    /* OPT SAM-FIELD: RG     SRA-column: SPOT_GROUP */
-    if ( rc == 0 && atx->cmn.seq_spot_group_idx != COL_NOT_AVAILABLE )
-    {
-        const char * spot_grp;
-        uint32_t spot_grp_len;
-        rc = read_char_ptr( id, cursor, atx->cmn.seq_spot_group_idx, &spot_grp, &spot_grp_len, "SPOT_GROUP" );
-        if ( rc == 0 && spot_grp_len > 0 )
-            rc = KOutMsg( "\tRG:Z:%.*s", spot_grp_len, spot_grp );
-    }
-
-    if ( rc == 0 && cgc_output.p_tags.len > 0 )
-        rc = KOutMsg( "\t%.*s", cgc_output.p_tags.len, cgc_output.p_tags.ptr );
-
-    /* OPT SAM-FIELD: XI     SRA-column: ALIGN_ID */
-    if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-        rc = KOutMsg( "\tXI:i:%u", id );
-
-    /* OPT SAM-FIELD: NH     SRA-column: ALIGNMENT_COUNT */
-    if ( rc == 0 && atx->cmn.al_count_idx != COL_NOT_AVAILABLE )
-    {
-        const uint8_t * al_count;
-        uint32_t al_count_len;
-        rc = read_uint8_ptr( id, cursor, atx->cmn.al_count_idx, &al_count, &al_count_len, "ALIGNMENT_COUNT" );
-        if ( rc == 0 && al_count_len > 0 )
-            rc = KOutMsg( "\tNH:i:%u", *al_count );
-    }
-
-    /* OPT SAM-FIELD: NM     SRA-column: EDIT_DISTANCE */
-    if ( rc == 0 )
-        rc = KOutMsg( "\tNM:i:%u", cgc_output.edit_dist );
-
-    /* OPT SAM-FIELD: XS:A:+/-  SRA-column: RNA-SPLICING detected via computation */
-    if ( rc == 0 && opts->rna_splicing && ( candidates.fwd_matched > 0 || candidates.rev_matched > 0 ) )
-    {
-        if ( candidates.fwd_matched > 0 )
-            rc = KOutMsg( "\tXS:A:+" );
-        else 
-            rc = KOutMsg( "\tXS:A:-" );
-/*
-        uint32_t i;
-        KOutMsg( "\tXS:A:" );
-        for ( i = 0; i < candidates.count; ++i )
-        {
-            rna_splice_candidate * rsc = &candidates.candidates[ i ];
-            KOutMsg( "( offs=%u | len=%u | op_idx=%u | matech=%u )", rsc->offset, rsc->len, rsc->op_idx, rsc->matched );
-        }
-*/
-    }
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-    return rc;
-}
-
-
-static rc_t print_alignment_fastx( const samdump_opts * const opts, const char * ref_name,
-                                   INSDC_coord_zero pos, matecache * const mc,
-                                   const PlacementRecord * const rec, const align_table_context * const atx,
-                                   uint64_t * const rows_so_far )
-{
-    bool orientation;
-    const VCursor *cursor = atx->cmn.cursor;
-    int64_t mate_align_id;
-    const int64_t * seq_spot_id;
-    uint32_t seq_spot_id_len;
-
-    rc_t rc = read_int64_ptr( rec->id, cursor, atx->cmn.seq_spot_id_idx, &seq_spot_id, &seq_spot_id_len, "SEQ_SPOT_ID" );
-
-    /* this is here to detect if the mate is aligned, if NOT, we want to put it into the unaligned-cache! */
-    if ( rc == 0 && opts->print_half_unaligned_reads )
-    {
-        rc = read_int64( rec->id, cursor, atx->mate_align_id_idx, &mate_align_id, 0, "MATE_ALIGN_ID" );
-        if ( rc == 0 && mate_align_id == 0 && mc != NULL && opts->use_mate_cache )
-        {
-            rc = matecache_insert_unaligned( mc, atx->db_idx, rec->id, pos, atx->ref_idx, *seq_spot_id );
-        }
-    }
-
-    ( *rows_so_far )++;
-
-    if ( opts->output_format == of_fastq )
-        rc = KOutMsg( "@" );
-    else
-        rc = KOutMsg( ">" );
-
-    /* SAM-FIELD: QNAME     1.row: name */
-    if ( rc == 0 )
-    {
-        if ( seq_spot_id_len > 0 )
-        {
-            if ( opts->print_spot_group_in_name )
-            {
-                const char * spot_grp;
-                uint32_t spot_grp_len;
-                rc = read_char_ptr( rec->id, cursor, atx->cmn.seq_spot_group_idx, &spot_grp, &spot_grp_len, "SEQ_SPOT_GROUP" );
-                if ( rc == 0 )
-                    rc = dump_name( opts, *seq_spot_id, spot_grp, spot_grp_len ); /* sam-dump-opts.c */
-            }
-            else
-                rc = dump_name( opts, *seq_spot_id, NULL, 0 ); /* sam-dump-opts.c */
-        }
-        else
-            rc = KOutMsg( "*" );
-
-        if ( rc == 0 )
-        {
-            uint32_t seq_read_id;
-            rc = read_uint32( rec->id, cursor, atx->cmn.seq_read_id_idx, &seq_read_id, 0, "SEQ_READ_ID" );
-            if ( rc == 0 )
-                rc = KOutMsg( "/%u", seq_read_id );
-        }
-    }
-
-    /* SRA-column: REF_ORIENTATION ( bool ) ... needed for quality */
-    if ( rc == 0 )
-        rc = read_bool( rec->id, cursor, atx->cmn.ref_orientation_idx, &orientation, false, "REF_ORIENT" );
-
-    /* source of the alignment: primary/secondary/evidence */
-    if ( rc == 0 )
-    {
-        switch( atx->align_table_type )
-        {
-        case att_primary    :   rc = KOutMsg( " primary" ); break;
-        case att_secondary  :   rc = KOutMsg( " secondary" ); break;
-        case att_evidence   :   rc = KOutMsg( " evidence" ); break;
-        }
-    }
-
-    /* against what reference aligned, at what position, with what mapping-quality */
-    if ( rc == 0 )
-        rc = KOutMsg( " ref=%s pos=%u mapq=%i\n", ref_name, pos + 1, rec->mapq );
-
-    /* READ at a new line */
-    if ( rc == 0 )
-    {
-        const char * read;
-        uint32_t read_size;
-        rc = read_char_ptr( rec->id, cursor, atx->cmn.raw_read_idx, &read, &read_size, "RAW_READ" );
-        if ( rc == 0 )
-        {
-            if ( read_size > 0 )
-                rc = KOutMsg( "%.*s\n", read_size, read );
-            else
-                rc = KOutMsg( "*\n" );
-        }
-    }
-
-    /* QUALITY on a new line if in fastq-mode */
-    if ( rc == 0 && opts->output_format == of_fastq )
-    {
-        rc = KOutMsg( "+\n" );
-        if ( rc == 0 )
-        {
-            const char * quality;
-            uint32_t quality_size;
-            rc = read_char_ptr( rec->id, cursor, atx->cmn.sam_quality_idx, &quality, &quality_size, "SAM_QUALITY" );
-            if ( rc == 0 )
-            {
-                if ( quality_size > 0 )
-                    rc = dump_quality_33( opts, quality, quality_size, false );
-                else
-                    rc = KOutMsg( "*" );
-            }
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-        }
-    }
-
-    return rc;
-}
-
-
-/* print one record of alignment-information in SAM-format */
-static rc_t walk_position( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                           const char * ref_name, INSDC_coord_zero pos,
-                           matecache * const mc, uint64_t * const rows_so_far,
-                           INSDC_coord_zero first_pos, INSDC_coord_len len )
-{
-    rc_t rc = 0;
-    while ( rc == 0 && !test_limit_reached( opts, *rows_so_far ) )
-    {
-        rc = Quitting ();
-        if ( rc == 0 )
-        {
-            const PlacementRecord *rec;
-            rc = PlacementSetIteratorNextRecordAt( set_iter, pos, &rec );
-            if ( rc != 0 )
-            {
-                if ( GetRCState( rc ) != rcDone )
-                {
-                    LOGERR( klogInt, rc, "PlacementSetIteratorNextRecordAt() failed" );
-                }
-            }
-            else
-            {
-                /* We have to do this here, becasue the nature of the iterator is to return all alignments that
-                   touch ( stick into ) the requested interval. But: sam-dump has to dump alignments that
-                   !! start !! in the requested interval. */
-                if ( pos >= first_pos )
-                {
-                    align_table_context * atx = PlacementRecord_get_ext_data_ptr( rec, placementRecordExtension0 );
-                    if ( atx == NULL )
-                    {
-                        rc = RC( rcExe, rcNoTarg, rcReading, rcParam, rcNull );
-                        LOGERR( klogInt, rc, "no placement-record-context available" );
-                    }
-                    else
-                    {
-                        if ( opts->output_format == of_sam )
-                        {
-                            if ( atx->align_table_type == att_evidence )
-                                rc = print_alignment_sam_ev( opts, ref_name, pos, rec, atx, rows_so_far );
-                            else
-                                rc = print_alignment_sam_ps( opts, ref_name, pos, mc, rec, atx, rows_so_far );
-                        }
-                        else
-                            rc = print_alignment_fastx( opts, ref_name, pos, mc, rec, atx, rows_so_far );
-                    }
-                }
-                PlacementRecordWhack ( rec );
-            }
-        }
-    }
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-    return rc;
-}
-
-
-static rc_t walk_window( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                         const char * ref_name, matecache * const mc, uint64_t * const rows_so_far,
-                         INSDC_coord_zero first_pos, INSDC_coord_len len )
-{
-    rc_t rc = 0;
-    while ( rc == 0 && !test_limit_reached( opts, *rows_so_far ) )
-    {
-        rc = Quitting ();
-        if ( rc == 0 )
-        {
-            INSDC_coord_zero pos;
-            rc = PlacementSetIteratorNextAvailPos( set_iter, &pos, NULL );
-            if ( rc != 0 )
-            {
-                if ( GetRCState( rc ) != rcDone )
-                {
-                    LOGERR( klogInt, rc, "PlacementSetIteratorNextAvailPos() failed" );
-                }
-            }
-            else
-            {
-                rc = walk_position( opts, set_iter, ref_name, pos, mc, rows_so_far, first_pos, len );
-            }
-        }
-    }
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-    return rc;
-}
-
-
-static rc_t walk_reference( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                            const char * ref_name, matecache * const mc, uint64_t * const rows_so_far )
-{
-    rc_t rc = 0;
-    while ( rc == 0 && !test_limit_reached( opts, *rows_so_far ) )
-    {
-        rc = Quitting ();
-        if ( rc == 0 )
-        {
-            INSDC_coord_zero first_pos;
-            INSDC_coord_len len;
-            rc = PlacementSetIteratorNextWindow( set_iter, &first_pos, &len );
-            if ( rc != 0 )
-            {
-                if ( GetRCState( rc ) != rcDone )
-                {
-                    LOGERR( klogInt, rc, "PlacementSetIteratorNextWindow() failed" );
-                }
-            }
-            else
-                rc = walk_window( opts, set_iter, ref_name, mc, rows_so_far, first_pos, len );
-        }
-    }
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-
-    if ( rc == 0 && mc != NULL && opts->use_mate_cache )
-        rc = matecache_clear_same_ref( mc );
-
-    return rc;
-}
-
-
-static rc_t walk_placements( const samdump_opts * const opts, PlacementSetIterator * const set_iter,
-                             matecache * const mc, uint64_t * const rows_so_far )
-{
-    rc_t rc = 0;
-    while ( rc == 0 && !test_limit_reached( opts, *rows_so_far ) )
-    {
-        struct ReferenceObj const * ref_obj;
-
-        rc = PlacementSetIteratorNextReference( set_iter, NULL, NULL, &ref_obj );
-        if ( rc == 0 )
-        {
-            if ( ref_obj != NULL )
-            {
-                const char * ref_name = NULL;
-                if ( opts->use_seqid_as_refname )
-                    rc = ReferenceObj_SeqId( ref_obj, &ref_name );
-                else
-                    rc = ReferenceObj_Name( ref_obj, &ref_name );
-
-                if ( rc == 0 )
-                    rc = walk_reference( opts, set_iter, ref_name, mc, rows_so_far );
-                else
-                {
-                    if ( opts->use_seqid_as_refname )
-                    {
-                        (void)LOGERR( klogInt, rc, "ReferenceObj_SeqId() failed" );
-                    }
-                    else
-                    {
-                        (void)LOGERR( klogInt, rc, "ReferenceObj_Name() failed" );
-                    }
-                }
-            }
-        }
-        else if ( GetRCState( rc ) != rcDone )
-        {
-            (void)LOGERR( klogInt, rc, "ReferenceIteratorNextReference() failed" );
-        }
-    }
-
-    if ( GetRCState( rc ) == rcDone )
-        rc = 0;
-    return rc;
-}
-
-
-
-static void CC destroy_align_table_context( void *item, void *data )
-{
-    align_table_context * atx = item;
-    free_align_table_context( atx );
-}
-
-
-static rc_t print_all_aligned_spots_of_this_reference( const samdump_opts * const opts, const input_database * const ids,
-                                                       matecache * const mc, const AlignMgr * const a_mgr,
-                                                       const ReferenceObj * const ref_obj, uint64_t * const rows_so_far )
-{
-    PlacementSetIterator * set_iter;
-    /* the we ask the alignment-manager to produce a placement-set-iterator... */
-    rc_t rc = AlignMgrMakePlacementSetIterator( a_mgr, &set_iter );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create PlacementSetIterator" );
-    }
-    else
-    {
-        /* here we need a vector to passed along into the creation of the iterators */
-        Vector context_list;
-        INSDC_coord_len ref_len;
-
-        VectorInit ( &context_list, 0, 5 );
-
-        rc = ReferenceObj_SeqLength( ref_obj, &ref_len );
-        if ( rc == 0 )
-        {
-            rc = add_pl_iters( opts, set_iter, ref_obj, ids,
-                0,                  /* where it starts on the reference */
-                ref_len,            /* the whole length of this reference/chromosome */
-                NULL,               /* no spotgroup re-grouping (yet) */
-                &context_list
-                );
-            if ( rc == 0 )
-                rc = walk_placements( opts, set_iter, mc, rows_so_far );
-        }
-
-        /* walk the context_list to free the align_table_context records, close/free the cursors... */
-        VectorWhack ( &context_list, destroy_align_table_context, NULL );
-        PlacementSetIteratorRelease( set_iter );
-    }
-    return rc;
-}
-
-
-/*
-   the user did not specify regions, print all alignments from all input-files
-   this is strategy #1 to do this, create a ref_iter for every reference each
-    + ... less cursors will be open at the same time, more resource efficient
-    - ... if more than one input-file, the output will be sorted only within each reference
-*/
-static rc_t print_all_aligned_spots_0( const samdump_opts * const opts, const input_files * const ifs,
-                                       matecache * const mc, const AlignMgr * const a_mgr, uint64_t * const rows_so_far )
-{
-    rc_t rc = 0;
-    uint32_t db_idx;
-    /* we now loop through all input-databases... */
-    for ( db_idx = 0; db_idx < ifs->database_count && rc == 0; ++db_idx )
-    {
-        const input_database * ids = VectorGet( &ifs->dbs, db_idx );
-        if ( ids != NULL )
-        {
-            uint32_t refobj_count;
-            rc = ReferenceList_Count( ids->reflist, &refobj_count );
-            if ( rc == 0 && refobj_count > 0 )
-            {
-                uint32_t ref_idx;
-                for ( ref_idx = 0; ref_idx < refobj_count && rc == 0; ++ref_idx )
-                {
-                    const ReferenceObj * ref_obj;
-                    rc = ReferenceList_Get( ids->reflist, &ref_obj, ref_idx );
-                    if ( rc == 0 && ref_obj != NULL )
-                    {
-                        rc = print_all_aligned_spots_of_this_reference( opts, ids, mc, a_mgr, ref_obj, rows_so_far );
-                        ReferenceObj_Release( ref_obj );
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-/*
-   the user did not specify regions, print all alignments from all input-files
-   this is strategy #2 to do this, throw all iterators for all input-files and all there references
-   into one set_iter.
-    + ... if more than one input-file, everything will be sorted
-    - ... creates a large number of open cursors ( because of sub-cursors due to schema-functions )
-          this can result in not beeing able to perform the functions at all because of running out of resources
-    - ... a long delay at start up, before the 1st alignment is printed ( all the cursors have to be opened )
-*/
-static rc_t print_all_aligned_spots_1( const samdump_opts * const opts, const input_files * const ifs,
-                                       matecache * const mc, const AlignMgr * const a_mgr, uint64_t * const rows_so_far )
-{
-    PlacementSetIterator * set_iter;
-    /* the we ask the alignment-manager to produce a placement-set-iterator... */
-    rc_t rc = AlignMgrMakePlacementSetIterator( a_mgr, &set_iter );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create PlacementSetIterator" );
-    }
-    else
-    {
-        /* here we need a vector to passed along into the creation of the iterators */
-        Vector context_list;
-        VectorInit ( &context_list, 0, 5 );
-
-        rc = prepare_whole_files( opts, ifs, set_iter, &context_list );
-
-        if ( rc == 0 )
-            rc = walk_placements( opts, set_iter, mc, rows_so_far );
-
-        /* walk the context_list to free the align_table_context records, close/free the cursors... */
-        VectorWhack ( &context_list, destroy_align_table_context, NULL );
-        PlacementSetIteratorRelease( set_iter );
-    }
-    return rc;
-}
-
-
-/*
-   the user has specified certain regions on the references,
-   print only alignments, that start in these regions
-*/
-static rc_t print_selected_aligned_spots( const samdump_opts * const opts, const input_files * const ifs,
-                                          matecache * const mc, const AlignMgr * const a_mgr, uint64_t * const rows_so_far )
-{
-    PlacementSetIterator * set_iter;
-    /* the we ask the alignment-manager to produce a placement-set-iterator... */
-    rc_t rc = AlignMgrMakePlacementSetIterator( a_mgr, &set_iter );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create PlacementSetIterator" );
-    }
-    else
-    {
-        /* here we need a vector to passed along into the creation of the iterators */
-        Vector context_list;
-        VectorInit ( &context_list, 0, 5 );
-
-        rc = prepare_regions( opts, ifs, set_iter, &context_list );
-
-        if ( rc == 0 )
-            rc = walk_placements( opts, set_iter, mc, rows_so_far );
-
-        /* walk the context_list to free the align_table_context records, close/free the cursors... */
-        VectorWhack ( &context_list, destroy_align_table_context, NULL );
-
-        PlacementSetIteratorRelease( set_iter );
-    }
-    return rc;
-}
-
-
-/*
-   this is called from sam-dump3.c, it prepares the iterators and then walks them
-   ---> only entry into this module <--- 
-*/
-rc_t print_aligned_spots( const samdump_opts * const opts, const input_files * const ifs,
-                          matecache * const mc, uint64_t * const rows_so_far )
-{
-    const AlignMgr * a_mgr;
-    /* first we make an alignment-manager */
-    rc_t rc = AlignMgrMakeRead( &a_mgr );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create alignment-manager" );
-    }
-    else
-    {
-        if ( opts->region_count == 0 )
-        {
-            /* the user did not specify regions to be printed ==> print all alignments */
-            switch( opts->dump_mode )
-            {
-                case dm_one_ref_at_a_time : rc = print_all_aligned_spots_0( opts, ifs, mc, a_mgr, rows_so_far ); break;
-                case dm_prepare_all_refs  : rc = print_all_aligned_spots_1( opts, ifs, mc, a_mgr, rows_so_far ); break;
-            }
-        }
-        else
-        {
-            /* the user did specify regions to be printed ==> print only the alignments in these regions */
-            rc = print_selected_aligned_spots( opts, ifs, mc, a_mgr, rows_so_far );
-        }
-        AlignMgrRelease( a_mgr );
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sam-aligned.h b/tools/sra-pileup/sam-aligned.h
deleted file mode 100644
index b8a4260..0000000
--- a/tools/sra-pileup/sam-aligned.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sam_aligned_
-#define _h_sam_aligned_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include "sam-dump-opts.h"
-#include "inputfiles.h"
-#include "matecache.h"
-
-#define COL_READ "(INSDC:dna:text)READ"
-
-rc_t print_aligned_spots( const samdump_opts * const opts, const input_files * const ifs,
-                          matecache * const mc, uint64_t * const rows_so_far );
-
-#endif
\ No newline at end of file
diff --git a/tools/sra-pileup/sam-dump-opts.c b/tools/sra-pileup/sam-dump-opts.c
deleted file mode 100644
index c1f9567..0000000
--- a/tools/sra-pileup/sam-dump-opts.c
+++ /dev/null
@@ -1,1502 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-
-#include "sam-dump-opts.h"
-#include <align/quality-quantizer.h>
-#include <sysalloc.h>
-
-#define CURSOR_CACHE_SIZE 256*1024*1024
-
-/* =========================================================================================== */
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-
-/* =========================================================================================== */
-
-
-static range * make_range( const uint64_t start, const uint64_t end )
-{
-    range *res = calloc( sizeof *res, 1 );
-    if ( res != NULL )
-    {
-        res->start = start;
-        res->end = end;
-    }
-    return res;
-}
-
-
-static int cmp_range( const range * a, const range * b )
-{
-
-    int res = ( a->start - b->start );
-    if ( res == 0 )
-        res = ( a->end - b->end );
-    return res;
-}
-
-
-static bool range_overlapp( const range * a, const range * b )
-{
-    return ( !( ( b->end < a->start ) || ( b->start > a->end ) ) );
-}
-
-
-/* =========================================================================================== */
-
-
-static reference_region * make_reference_region( const char *name )
-{
-    reference_region *res = calloc( sizeof *res, 1 );
-    if ( res != NULL )
-    {
-        res->name = string_dup_measure ( name, NULL );
-        if ( res->name == NULL )
-        {
-            free( res );
-            res = NULL;
-        }
-        else
-            VectorInit ( &res->ranges, 0, 5 );
-    }
-    return res;
-}
-
-
-static int CC cmp_range_wrapper( const void *item, const void *n )
-{   return cmp_range( item, n ); }
-
-
-static rc_t add_ref_region_range( reference_region * self, const uint64_t start, const uint64_t end )
-{
-    rc_t rc = 0;
-    range *r = make_range( start, end );
-    if ( r == NULL )
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        rc = VectorInsert ( &self->ranges, r, NULL, cmp_range_wrapper );
-        if ( rc != 0 )
-            free( r );
-    }
-    return rc;
-}
-
-
-#define RR_NAME  1
-#define RR_START 2
-#define RR_END   3
-
-
-static void put_c( char *s, size_t size, size_t *dst, char c )
-{
-    if ( *dst < ( size - 1 ) )
-        s[ *dst ] = c;
-    (*dst)++;
-}
-
-static void finish_txt( char *s, size_t size, size_t *dst )
-{
-    if ( *dst > size )
-        s[ size - 1 ] = 0;
-    else
-        s[ *dst ] = 0;
-    *dst = 0;
-}
-
-static uint64_t finish_num( char *s, size_t size, size_t *dst )
-{
-    uint64_t res = 0;
-    char *endp;
-    finish_txt( s, size, dst );
-    res = strtou64( s, &endp, 10 );
-    return res;
-}
-
-
-/* s = refname:1000-2000 */
-static void parse_definition( const char *s, char * name, size_t len,
-                              uint64_t *start, uint64_t *end )
-{
-    size_t n = string_size( s );
-
-    *start = 0;
-    *end   = 0;
-    name[ 0 ] = 0;
-    if ( n > 0 )
-    {
-        size_t i, st, dst = 0;
-        char tmp[ 32 ];
-        st = RR_NAME;
-        for ( i = 0; i < n; ++i )
-        {
-            char c = s[ i ];
-            switch( st )
-            {
-                case RR_NAME  : if ( c == ':' )
-                                {
-                                    finish_txt( name, len, &dst );
-                                    st = RR_START;
-                                }
-                                else
-                                {
-                                    put_c( name, len, &dst, c );
-                                }
-                                break;
-
-                case RR_START : if ( c == '-' )
-                                {
-                                    *start = finish_num( tmp, sizeof tmp, &dst );
-                                    st = RR_END;
-                                }
-                                else if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-
-                case RR_END   : if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-            }
-        }
-        switch( st )
-        {
-            case RR_NAME  : finish_txt( name, len, &dst );
-                            break;
-
-            case RR_START : *start = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-
-            case RR_END   : *end = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-        }
-    }
-}
-
-
-static void CC release_range_wrapper( void * item, void * data )
-{
-    free( item );
-}
-
-
-static void free_reference_region( reference_region * self )
-{
-    free( (void*)self->name );
-    VectorWhack ( &self->ranges, release_range_wrapper, NULL );
-    free( self );
-}
-
-
-static void check_ref_region_ranges( reference_region * self )
-{
-    uint32_t n = VectorLength( &self->ranges );
-    uint32_t i = 0;
-    range *a = NULL;
-    while ( i < n )
-    {
-        range *b = VectorGet ( &self->ranges, i );
-        bool remove = false;
-        if ( a != NULL )
-        {
-            remove = range_overlapp( a, b );
-            if ( remove )
-            {
-                range *r;
-                a->end = b->end;
-                VectorRemove ( &self->ranges, i, (void**)&r );
-                free( r );
-                n--;
-            }
-        }
-        if ( !remove )
-        {
-            a = b;
-            ++i;
-        }
-    }
-}
-
-
-/* =========================================================================================== */
-
-
-static int CC reference_vs_pchar_wrapper( const void *item, const BSTNode *n )
-{
-    const reference_region * r = ( const reference_region * )n;
-    return cmp_pchar( (const char *)item, r->name );
-}
-
-static reference_region * find_reference_region( BSTree * regions, const char * name )
-{
-    return ( reference_region * ) BSTreeFind ( regions, name, reference_vs_pchar_wrapper );
-}
-
-
-typedef struct frrl
-{
-    const char * name;
-    size_t len;
-} frrl;
-
-
-static int cmp_pchar_vs_len( const char * a, const char * b, size_t len_b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-static int CC reference_vs_frr_wrapper( const void *item, const BSTNode *n )
-{
-    const reference_region * r = ( const reference_region * )n;
-    const frrl * ctx = item;
-    return cmp_pchar_vs_len( r->name, ctx->name, ctx->len );
-}
-
-static reference_region * find_reference_region_len( BSTree * regions, const char * name, size_t len )
-{
-    frrl ctx;
-    ctx.name = name;
-    ctx.len  = len;
-    return ( reference_region * ) BSTreeFind ( regions, &ctx, reference_vs_frr_wrapper );
-}
-
-
-static int CC ref_vs_ref_wrapper( const BSTNode *item, const BSTNode *n )
-{
-   const reference_region * a = ( const reference_region * )item;
-   const reference_region * b = ( const reference_region * )n;
-   return cmp_pchar( a->name, b->name );
-}
-
-static rc_t add_refrange( BSTree * regions, const char * name, const uint64_t start, const uint64_t end )
-{
-    rc_t rc;
-
-    reference_region * r = find_reference_region( regions, name );
-    if ( r == NULL )
-    {
-        r = make_reference_region( name );
-        if ( r == NULL )
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        else
-            rc = add_ref_region_range( r, start, end );
-        if ( rc == 0 )
-            rc = BSTreeInsert ( regions, (BSTNode *)r, ref_vs_ref_wrapper );
-        if ( rc != 0 )
-            free_reference_region( r );
-    }
-    else
-    {
-        rc = add_ref_region_range( r, start, end );
-    }
-    return rc;
-}
-
-
-static rc_t parse_and_add_region( BSTree * regions, const char * s )
-{
-    rc_t rc = 0;
-    uint64_t start, end;
-    char name[ 64 ];
-    parse_definition( s, name, sizeof name, &start, &end );
-    if ( name[ 0 ] == 0 )
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    else
-    {
-        uint64_t start_0based = ( start > 0 ) ? start - 1 : 0;
-        uint64_t end_0based = ( end > 0 ) ? end - 1 : 0;
-        if ( end_0based != 0 && end_0based < start_0based )
-        {
-            uint64_t temp = end_0based;
-            end_0based = start_0based;
-            start_0based = temp;
-        }
-        rc = add_refrange( regions, name, start_0based, end_0based );
-    }
-    return rc;
-}
-
-
-static void CC check_refrange_wrapper( BSTNode *n, void *data )
-{
-    check_ref_region_ranges( ( reference_region * ) n );
-}
-
-
-static void check_ref_regions( BSTree * regions )
-{
-    BSTreeForEach ( regions, false, check_refrange_wrapper, NULL );
-}
-
-
-static void CC release_ref_region_wrapper( BSTNode *n, void * data )
-{
-    free_reference_region( ( reference_region * ) n );
-}
-
-
-static void free_ref_regions( BSTree * regions )
-{    
-    BSTreeWhack ( regions, release_ref_region_wrapper, NULL );
-}
-
-
-static void CC count_ref_region_wrapper( BSTNode *n, void *data )
-{   
-    reference_region * r = ( reference_region * ) n;
-    uint32_t * count = ( uint32_t * ) data;
-    *count += VectorLength( &(r->ranges) );
-}
-
-
-static uint32_t count_ref_regions( BSTree * regions )
-{
-    uint32_t res = 0;
-    BSTreeForEach ( regions, false, count_ref_region_wrapper, &res );
-    return res;
-}
-
-
-/* =========================================================================================== */
-
-
-static void CC foreach_reference_wrapper( BSTNode *n, void *data )
-{   
-    reference_region * r = ( reference_region * ) n;
-    foreach_reference_func * func = ( foreach_reference_func * )data;
-
-    if ( func->rc == 0 )
-        func->rc = func->on_reference( r->name, &(r->ranges), func->data );
-}
-
-
-rc_t foreach_reference( BSTree * regions,
-    rc_t ( CC * on_reference ) ( const char * name, Vector *ranges, void *data ), 
-    void *data )
-{
-    foreach_reference_func func;
-
-    func.on_reference = on_reference;
-    func.data = data;
-    func.rc = 0;
-    BSTreeForEach ( regions, false, foreach_reference_wrapper, &func );
-    return func.rc;
-}
-
-
-/* =========================================================================================== */
-
-/* s = 1000-2000 */
-static void parse_matepair_definition( const char *s, uint64_t *start, uint64_t *end )
-{
-    size_t n = string_size( s );
-    if ( n > 0 )
-    {
-        size_t i, st, dst = 0;
-        char tmp[ 32 ];
-        st = RR_START;
-        for ( i = 0; i < n; ++i )
-        {
-            char c = s[ i ];
-            switch( st )
-            {
-                case RR_START : if ( c == '-' )
-                                {
-                                    *start = finish_num( tmp, sizeof tmp, &dst );
-                                    st = RR_END;
-                                }
-                                else if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-
-                case RR_END   : if ( ( c >= '0' )&&( c <= '9' ) )
-                                {
-                                    put_c( tmp, sizeof tmp, &dst, c );
-                                }
-                                break;
-            }
-        }
-        switch( st )
-        {
-            case RR_START : *start = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-
-            case RR_END   : *end = finish_num( tmp, sizeof tmp, &dst );
-                            break;
-        }
-    }
-}
-
-
-static rc_t parse_and_add_matepair_dist( Vector * dist_vector, const char * s )
-{
-    rc_t rc = 0;
-    uint64_t start = 0, end = 0;
-    range *r;
-
-    if ( cmp_pchar( s, "unknown" ) != 0 )
-        parse_matepair_definition( s, &start, &end );
-
-    r = make_range( start, end );
-    if ( r == NULL )
-    {
-        rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
-        (void)LOGERR( klogErr, rc, "error storing matepair-distance" );
-    }
-    else
-    {
-        rc = VectorInsert ( dist_vector, r, NULL, cmp_range_wrapper );
-        if ( rc != 0 )
-            free( r );
-    }
-    return rc;
-}
-
-
-bool filter_by_matepair_dist( const samdump_opts * opts, int32_t tlen )
-{
-    bool res = false;
-
-    uint32_t count = VectorLength( &opts->mp_dist );
-    if ( count > 0 )
-    {
-        uint32_t idx, tlen_v;
-
-        res = false;
-        if ( tlen < 0 )
-            tlen_v = -(tlen);
-        else
-            tlen_v = tlen;
-
-        for ( idx = 0; idx < count && !res; ++idx )
-        {
-            range * r = VectorGet( &opts->mp_dist, idx );
-            if ( r != NULL )
-                res = ( ( tlen_v >= r->start )&&( tlen_v <= r->end ) );
-        }
-    }
-    return res;
-}
-
-/* =========================================================================================== */
-
-
-static rc_t get_bool_option( Args * args, const char * name, bool *value )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "error reading comandline option '$(t)'", "t=%s", name ) );
-    }
-    else
-    {
-        *value = ( count > 0 );
-    }
-    return rc;
-}
-
-
-static rc_t gather_region_options( Args * args, samdump_opts * opts )
-{
-    uint32_t count;
-
-    rc_t rc = ArgsOptionCount( args, OPT_REGION, &count );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "error counting comandline option '$(t)'", "t=%s", OPT_REGION ) );
-    }
-    else if ( count > 0 )
-    {
-        uint32_t i;
-
-        BSTreeInit( &opts->regions );
-        for ( i = 0; i < count && rc == 0; ++i )
-        {
-            const char * s;
-            rc = ArgsOptionValue( args, OPT_REGION, i, &s );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline option '$(t)'", "t=%s", OPT_REGION ) );
-            }
-            else
-                rc = parse_and_add_region( &opts->regions, s );
-        }
-        if ( rc == 0 )
-        {
-            check_ref_regions( &opts->regions );
-            opts->region_count = count_ref_regions( &opts->regions );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t gather_matepair_distances( Args * args, samdump_opts * opts )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, OPT_MATE_DIST, &count );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "error counting comandline option '$(t)'", "t=%s", OPT_REGION ) );
-    }
-    else if ( count > 0 )
-    {
-        uint32_t i;
-
-        VectorInit( &opts->mp_dist, 0, 10 );
-        for ( i = 0; i < count && rc == 0; ++i )
-        {
-            const char * s;
-            rc = ArgsOptionValue( args, OPT_MATE_DIST, i, &s );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline option '$(t)'", "t=%s", OPT_MATE_DIST ) );
-            }
-            else
-                rc = parse_and_add_matepair_dist( &opts->mp_dist, s );
-        }
-        opts->use_matepair_filter = ( VectorLength( &opts->mp_dist ) > 0 );
-    }
-    return rc;
-}
-
-
-static rc_t gather_2_bool( Args * args, const char *name1, const char *name2, bool *b1, bool *b2 )
-{
-    rc_t rc = get_bool_option( args, name1, b1 );
-    if ( rc != 0 ) return rc;
-
-    rc = get_bool_option( args, name2, b2 );
-    if ( rc != 0 ) return rc;
-
-    if ( *b1 && *b2 )
-    {
-        rc = RC( rcExe, rcNoTarg, rcValidating, rcParam, rcInvalid );
-        (void)PLOGERR( klogErr, ( klogErr, rc, "the parameters '--$(p1)' and '--$(p2)' are mutually exclusive", 
-                      "p1=%s,p2=%s", name1, name2 ) );
-    }
-    return rc;
-}
-
-
-static rc_t gather_flag_options( Args * args, samdump_opts * opts )
-{
-    bool dump_prim_only;
-
-    /* do we have to dump unaligned reads too? */
-    rc_t rc = get_bool_option( args, OPT_UNALIGNED, &opts->dump_unaligned_reads );
-    if ( rc != 0 ) return rc;
-
-    /* assume we have to dump primary alignments, maybe switched off later by other option */
-    opts->dump_primary_alignments = true;
-
-    /* we are dumping secondary alignments only if the user does
-       not explicitly ask for "primary only" */
-    rc = get_bool_option( args, OPT_PRIM_ONLY, &dump_prim_only );
-    if ( rc != 0 ) return rc;
-    opts->dump_secondary_alignments = !dump_prim_only;
-
-    /* check if we are asked to be in cga-tool compatible mode */
-    rc = get_bool_option( args, OPT_CG_SAM, &opts->dump_cg_sam );
-    if ( rc != 0 ) return rc;
-
-    /* check if we have to dump "EVIDENCE_INTERVAL" against the reference */
-    rc = get_bool_option( args, OPT_CG_EVIDENCE, &opts->dump_cg_evidence );
-    if ( rc != 0 ) return rc;
-
-    /* check if we have to dump "EVIDENCE_ALIGNMENT" against "EVIDENCE_INTERVAL" */
-    rc = get_bool_option( args, OPT_CG_EV_DNB, &opts->dump_cg_ev_dnb );
-    if ( rc != 0 ) return rc;
-
-    {
-        bool dump_cg_mappings;
-
-        /* look if cg-mappings is requested */
-        rc = get_bool_option( args, OPT_CG_MAPP, &dump_cg_mappings );
-        if ( rc != 0 ) return rc;
-
-        /* do some mode logic ... */
-        if ( !dump_cg_mappings &&
-             ( opts->dump_cga_tools_mode || opts->dump_cg_evidence || opts->dump_cg_ev_dnb || opts->dump_cg_sam ) )
-        {
-            opts->dump_primary_alignments = false;
-            opts->dump_secondary_alignments = false;
-            opts->dump_unaligned_reads = false;
-        }
-        else
-        {
-            opts->dump_primary_alignments = true;
-            opts->dump_secondary_alignments = !dump_prim_only;
-            /* opts->dump_unaligned_reads = ( opts->dump_unaligned_reads && opts->region_count == 0 ); */
-        }
-    }
-
-    /* do we have to print the long-version of the cigar-string? */
-    rc = get_bool_option( args, OPT_CIGAR_LONG, &opts->use_long_cigar );
-    if ( rc != 0 ) return rc;
-
-    /* print the sequence-id instead of the sequence-name */
-    rc = get_bool_option( args, OPT_USE_SEQID, &opts->use_seqid_as_refname );
-    if ( rc != 0 ) return rc;
-
-    /* print the READ where matched bases are replaced with '=' */
-    rc = get_bool_option( args, OPT_HIDE_IDENT, &opts->print_matches_as_equal_sign );
-    if ( rc != 0 ) return rc;
-
-    {
-        bool recalc_header, dont_print_header;
-
-        /* do we have to recalculate the header instead of printing the meta-data */
-        rc = get_bool_option( args, OPT_RECAL_HDR, &recalc_header );
-        if ( rc != 0 ) return rc;
-        /* should we suppress the header completely */
-        rc = get_bool_option( args, OPT_NO_HDR, &dont_print_header );
-        if ( rc != 0 ) return rc;
-        if ( dont_print_header )
-            opts->header_mode = hm_none;
-        else if ( recalc_header )
-            opts->header_mode = hm_recalc;
-        else
-            opts->header_mode = hm_dump;
-    }
-
-    {
-        bool cigar_cg, cigar_cg_merge;
-
-        /* do we have to transform cigar into cg-style ( has B/N ) */
-        /* do we have to transform cg-data(length of read/patterns in cigar) into valid SAM (cigar/READ/QUALITY) */
-        rc = gather_2_bool( args, OPT_CIGAR_CG, OPT_CIGAR_CG_M, &cigar_cg, &cigar_cg_merge );
-        if ( rc != 0 ) return rc;
-        if ( cigar_cg )
-            opts->cigar_treatment = ct_cg_style;
-        if ( cigar_cg_merge )
-            opts->cigar_treatment = ct_cg_merge;
-    }
-
-    {
-        bool gzip, bzip2;
-
-        /* do we have to compress the output with gzip ? */
-        /* do we have to compress the output with bzip2 ? */
-        rc = gather_2_bool( args, OPT_GZIP, OPT_BZIP2, &gzip, &bzip2 );
-        if ( rc != 0 ) return rc;
-        if ( gzip )
-            opts->output_compression = oc_gzip;
-        if ( bzip2 )
-            opts->output_compression = oc_bzip2;
-    }
-
-
-    {
-        bool fasta, fastq;
-
-        /* output in FASTA - mode  ? */
-        /* output in FASTQ - mode  ? */
-        rc = gather_2_bool( args, OPT_FASTA, OPT_FASTQ, &fasta, &fastq );
-        if ( rc != 0 ) return rc;
-        if ( fasta )
-            opts->output_format = of_fasta;
-        if ( fastq )
-            opts->output_format = of_fastq;
-    }
-
-
-    /* do we have to reverse unaligned reads if the flag in the row says so */
-    rc = get_bool_option( args, OPT_REVERSE, &opts->reverse_unaligned_reads );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to add the spotgroup to the qname-column */
-    rc = get_bool_option( args, OPT_SPOTGRP, &opts->print_spot_group_in_name );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to report options instead of executing */
-    rc = get_bool_option( args, OPT_REPORT, &opts->report_options );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to print the alignment id in column XI */
-    rc = get_bool_option( args, OPT_XI_DEBUG, &opts->print_alignment_id_in_column_xi );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to print the alignment id in column XI */
-    rc = get_bool_option( args, OPT_CACHEREPORT, &opts->report_cache );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to dump unaligned reads only */
-    rc = get_bool_option( args, OPT_UNALIGNED_ONLY, &opts->dump_unaligned_only );
-    if ( rc != 0 ) return rc;
-
-    /* do we have to print the spot-group in a special way */
-    rc = get_bool_option( args, OPT_CG_NAMES, &opts->print_cg_names );
-    if ( rc != 0 ) return rc;
-
-    /* do we use a mate-cache */
-    rc = get_bool_option( args, OPT_NO_MATE_CACHE, &opts->use_mate_cache );
-    if ( rc != 0 ) return rc;
-    opts->use_mate_cache = !opts->use_mate_cache;
-
-    /* do we use a mate-cache */
-    rc = get_bool_option( args, OPT_LEGACY, &opts->force_legacy );
-    if ( rc != 0 ) return rc;
-
-    rc = get_bool_option( args, OPT_NEW, &opts->force_new );
-    if ( rc != 0 ) return rc;
-
-    if ( opts->force_new && opts->force_legacy )
-        opts->force_new = false;
-
-    /* do we have to merge cigar ( and read/qual ) for cg-operations in cigar */
-    rc = get_bool_option( args, OPT_CIGAR_CG_M, &opts->merge_cg_cigar );
-    if ( rc != 0 ) return rc;
-
-    rc = get_bool_option( args, OPT_RNA_SPLICE, &opts->rna_splicing );
-    return rc;
-}
-
-
-static rc_t get_str_option( Args * args, const char * name, const char ** s )
-{
-    uint32_t count;
-
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    *s = NULL;
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "error counting comandline option '$(t)'", "t=%s", name ) );
-    }
-    else if ( count > 0 )
-    {
-        rc = ArgsOptionValue( args, name, 0, s );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline option '$(t)'", "t=%s", name ) );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t get_int_option( Args * args, const char * name, uint32_t def, uint32_t * value, bool dflt_if_zero )
-{
-    const char * s;
-    rc_t rc = get_str_option( args, name, &s );
-    *value = def;
-    if ( rc == 0 && s != NULL )
-    {
-        char *endp;
-        *value = strtou32( s, &endp, 0 );
-        if ( *endp != '\0' )
-        {
-            rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-            (void)PLOGERR( klogErr, ( klogErr, rc, "error converting string to integer option '$(t)'", "t=%s", name ) );
-        }
-        else if ( dflt_if_zero && *value == 0 )
-            *value = def;
-    }
-    return rc;
-}
-
-
-static rc_t get_int32_options( Args * args, const char * name, int32_t * value, bool * used )
-{
-    const char * s;
-    rc_t rc = get_str_option( args, name, &s );
-    if ( rc == 0 && s != NULL )
-    {
-        char *endp;
-        *value = strtoi32( s, &endp, 0 );
-        if ( *endp != '\0' )
-        {
-            rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-            (void)PLOGERR( klogErr, ( klogErr, rc, "error converting string to integer option '$(t)'", "t=%s", name ) );
-        }
-        else
-        {
-            *used = true;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t get_int64_option( Args * args, const char * name, uint64_t def, uint64_t * value )
-{
-    const char * s;
-    rc_t rc = get_str_option( args, name, &s );
-    *value = def;
-    if ( rc == 0 && s != NULL )
-    {
-        char *endp;
-        *value = strtou32( s, &endp, 0 );
-        if ( *endp != '\0' )
-        {
-            rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-            (void)PLOGERR( klogErr, ( klogErr, rc, "error converting string to integer option '$(t)'", "t=%s", name ) );
-        }
-        else if ( *value == 0 )
-            *value = def;
-    }
-    return rc;
-}
-
-
-static rc_t gather_int_options( Args * args, samdump_opts * opts )
-{
-    rc_t rc = get_int_option( args, OPT_MATE_GAP, 10000, &opts->mape_gap_cache_limit, true );
-    if ( rc == 0 )
-        rc = get_int64_option( args, OPT_TEST_ROWS, 0, &opts->test_rows );
-    if ( rc == 0 )
-        rc = get_int_option( args, OPT_OUTBUFSIZE, 1024 * 32, &opts->output_buffer_size, false );
-    if ( rc == 0 )
-    {
-        uint32_t cs;
-        rc = get_int_option( args, OPT_CURSOR_CACHE, CURSOR_CACHE_SIZE, &cs, false );
-        if ( rc == 0 )
-            opts->cursor_cache_size = ( size_t )cs;
-    }
-    if ( rc == 0 )
-    {
-        uint32_t mode;
-        rc = get_int_option( args, OPT_DUMP_MODE, 0, &mode, true );
-        if ( rc == 0 )
-        {
-            switch( mode )
-            {
-                case 0  : opts->dump_mode = dm_one_ref_at_a_time; break;
-                case 1  : opts->dump_mode = dm_prepare_all_refs; break;
-                default : opts->dump_mode = dm_one_ref_at_a_time; break;
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        rc = get_int32_options( args, OPT_MIN_MAPQ, &opts->min_mapq, &opts->use_min_mapq );
-    }
-    return rc;
-}
-
-
-static rc_t gather_string_options( Args * args, samdump_opts * opts )
-{
-    const char * s;
-    uint32_t count;
-
-    rc_t rc = get_str_option( args, OPT_PREFIX, &s );
-    if ( rc == 0 && s != NULL )
-    {
-        opts->qname_prefix = string_dup_measure( s, NULL );
-        if ( opts->qname_prefix == NULL )
-        {
-            rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
-            (void)LOGERR( klogErr, rc, "error storing QNAME-PREFIX" );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = get_str_option( args, OPT_Q_QUANT, &s );
-        if ( rc == 0 && s != NULL )
-        {
-            opts->qual_quant = string_dup_measure( s, NULL );
-            if ( opts->qual_quant == NULL )
-            {
-                rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
-                (void)LOGERR( klogErr, rc, "error storing QUAL-QUANT" );
-            }
-            else
-            {
-                bool bres = QualityQuantizerInitMatrix( opts->qual_quant_matrix, opts->qual_quant );
-                if ( !bres )
-                {
-                    rc = RC( rcExe, rcNoTarg, rcValidating, rcParam, rcInvalid );
-                    (void)LOGERR( klogErr, rc, "error initializing quality-quantizer-matrix" );
-                }
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = get_str_option( args, OPT_OUTPUTFILE, &s );
-        if ( rc == 0 && s != NULL )
-        {
-            opts->outputfile = string_dup_measure( s, NULL );
-            if ( opts->outputfile == NULL )
-            {
-                rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
-                (void)LOGERR( klogErr, rc, "error storing OUTPUTFILE" );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = ArgsOptionCount( args, OPT_HDR_COMMENT, &count );
-        if ( rc == 0 && count > 0 )
-        {
-            uint32_t i;
-            rc = VNamelistMake( &opts->hdr_comments, 10 );
-            for ( i = 0; i < count && rc == 0; ++i )
-            {
-                const char * src;
-                rc = ArgsOptionValue( args, OPT_HDR_COMMENT, i, &src );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline option '$(t)' #$(n)", 
-                                              "t=%s,n=%u", OPT_HDR_COMMENT, i ) );
-                }
-                else
-                {
-                    rc = VNamelistAppend( opts->hdr_comments, src );
-                    if ( rc != 0 )
-                    {
-                        (void)PLOGERR( klogErr, ( klogErr, rc, "error appending hdr-comment '$(t)'", 
-                                                  "t=%s", src ) );
-                    }
-                }
-            }
-            if ( rc != 0 )
-            {
-                VNamelistRelease( opts->hdr_comments );
-                opts->hdr_comments = NULL;
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = ArgsParamCount( args, &count );
-        if ( rc == 0 && count > 0 )
-        {
-            uint32_t i;
-            rc = VNamelistMake( &opts->input_files, 10 );
-            for ( i = 0; i < count && rc == 0; ++i )
-            {
-                const char * src;
-                rc = ArgsParamValue( args, i, &src );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline param #$(n)", 
-                                              "n=%u", i ) );
-                }
-                else
-                {
-                    rc = VNamelistAppend( opts->input_files, src );
-                    if ( rc != 0 )
-                    {
-                        (void)PLOGERR( klogErr, ( klogErr, rc, "error appending input_file '$(t)'", 
-                                                  "t=%s", src ) );
-                    }
-                }
-            }
-            if ( rc != 0 )
-            {
-                VNamelistRelease( opts->input_files );
-                opts->input_files = NULL;
-            }
-        }
-        opts->input_file_count = count;
-    }
-
-    rc = get_str_option( args, OPT_CIGAR_TEST, &s );
-    if ( rc == 0 && s != NULL )
-    {
-        opts->cigar_test = string_dup_measure( s, NULL );
-        if ( opts->cigar_test == NULL )
-        {
-            rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
-            (void)LOGERR( klogErr, rc, "error storing CIGAR-TEST" );
-        }
-    }
-
-    return rc;
-}
-
-
-/*********************************************************************************************
-
-                                            fa ... fully aligned reads
-                                            ha ... half aligned reads
-                                            hu ... half unaligned reads
-                                            fu ... fully unaligned reads
-
-    regions > 0     |   dump-unaligned  |
-    ----------------------------------------------------------------------
-        no          |       no          |   fa  ha  hu
-        no          |       yes         |   fa  ha  hu  fu
-        yes         |       no          |   fa  ha
-        yes         |       yes         |   fa  ha  hu
-
-*********************************************************************************************/
-static void gather_unaligned_options( samdump_opts * opts )
-{
-    if ( opts->region_count == 0 )
-    {
-        if ( opts->dump_unaligned_only )
-        {
-            opts->print_half_unaligned_reads  = false;
-            opts->print_fully_unaligned_reads = true;
-        }
-        else
-        {
-            opts->print_half_unaligned_reads  = true;
-            opts->print_fully_unaligned_reads = opts->dump_unaligned_reads;
-        }
-    }
-    else
-    {
-        opts->print_fully_unaligned_reads = false;
-        opts->print_half_unaligned_reads  = opts->dump_unaligned_reads;
-    }
-}
-
-/* =========================================================================================== */
-
-
-static rc_t CC report_reference_cb( const char * name, Vector * ranges, void *data )
-{
-    rc_t rc = KOutMsg( "region: <%s>\n",  name );
-    if ( rc == 0 )
-    {
-        uint32_t count = VectorLength( ranges );
-        if ( count > 0 )
-        {
-            uint32_t i;
-            for ( i = VectorStart( ranges ); i < count && rc == 0; ++i )
-            {
-                range *r = VectorGet( ranges, i );
-                if ( r->end == 0 )
-                {
-                    if ( r->start == 0 )
-                        rc = KOutMsg( "\t[ start ... end ]\n" );
-                    else
-                        rc = KOutMsg( "\t[ %u ... ]\n", r->start );
-                }
-                else
-                    rc = KOutMsg( "\t[ %u ... %u ]\n", r->start, r->end );
-            }
-        }
-    }
-    return rc;
-}
-
-
-void report_options( const samdump_opts * opts )
-{
-    rc_t rc;
-    uint32_t len;
-
-    KOutMsg( "dump unaligned reads  : %s\n",  opts->dump_unaligned_reads ? "YES" : "NO" );
-    KOutMsg( "dump unaligned only   : %s\n",  opts->dump_unaligned_only ? "YES" : "NO" );
-    KOutMsg( "dump prim. alignments : %s\n",  opts->dump_primary_alignments ? "YES" : "NO" );
-    KOutMsg( "dump sec. alignments  : %s\n",  opts->dump_secondary_alignments ? "YES" : "NO" );
-    KOutMsg( "dump cga-tools-mode   : %s\n",  opts->dump_cga_tools_mode ? "YES" : "NO" );
-    KOutMsg( "dump cg-evidence      : %s\n",  opts->dump_cg_evidence ? "YES" : "NO" );
-    KOutMsg( "dump cg-ev-dnb        : %s\n",  opts->dump_cg_ev_dnb ? "YES" : "NO" );
-    KOutMsg( "dump cg-sam           : %s\n",  opts->dump_cg_sam ? "YES" : "NO" );
-    KOutMsg( "merge cg-cigar        : %s\n",  opts->merge_cg_cigar ? "YES" : "NO" );
-
-    KOutMsg( "use long cigar        : %s\n",  opts->use_long_cigar ? "YES" : "NO" );
-    KOutMsg( "print seqid           : %s\n",  opts->use_seqid_as_refname ? "YES" : "NO" );
-    KOutMsg( "print READ with '='   : %s\n",  opts->print_matches_as_equal_sign ? "YES" : "NO" );
-    KOutMsg( "reverse unaligned rd  : %s\n",  opts->reverse_unaligned_reads ? "YES" : "NO" );
-    KOutMsg( "add spotgrp to qname  : %s\n",  opts->print_spot_group_in_name ? "YES" : "NO" );
-    KOutMsg( "print id in col. XI   : %s\n",  opts->print_alignment_id_in_column_xi ? "YES" : "NO" );
-    KOutMsg( "report matecache      : %s\n",  opts->report_cache ? "YES" : "NO" );
-    KOutMsg( "print cg-names        : %s\n",  opts->print_cg_names ? "YES" : "NO" );
-
-    switch( opts->header_mode )
-    {
-        case hm_none   : KOutMsg( "header-mode           : dont print\n" ); break;
-        case hm_recalc : KOutMsg( "header-mode           : recalculate\n" ); break;
-        case hm_dump   : KOutMsg( "header-mode           : print meta-data\n" ); break;
-        default        : KOutMsg( "header-mode           : unknown\n" ); break;
-    }
-
-    switch( opts->cigar_treatment )
-    {
-        case ct_unchanged : KOutMsg( "cigar-treatment       : unchanged\n" ); break;
-        case ct_cg_style  : KOutMsg( "cigar-treatment       : transform cg to 'cg-style\n" ); break;
-        case ct_cg_merge  : KOutMsg( "cigar-treatment       : transform cg to valid SAM\n" ); break;
-        default           : KOutMsg( "cigar-treatment       : unknow'\n" ); break;
-    }
-
-    switch( opts->output_compression )
-    {
-        case oc_none  : KOutMsg( "output-compression    : none\n" ); break;
-        case oc_gzip  : KOutMsg( "output-compression    : gzip\n" ); break;
-        case oc_bzip2 : KOutMsg( "output-compression    : bzip2\n" ); break;
-        default       : KOutMsg( "output-compression    : unknown\n" ); break;
-    }
-
-    switch( opts->output_format )
-    {
-        case of_sam   : KOutMsg( "output-format         : SAM\n" ); break;
-        case of_fasta : KOutMsg( "output-format         : FASTA\n" ); break;
-        case of_fastq : KOutMsg( "output-format         : FASTQ\n" ); break;
-        default       : KOutMsg( "output-format         : unknown\n" ); break;
-    }
-
-    switch( opts->dump_mode )
-    {
-        case dm_one_ref_at_a_time : KOutMsg( "dump-mode             : one ref at a time\n" ); break;
-        case dm_prepare_all_refs  : KOutMsg( "dump-mode             : prepare all refs\n" ); break;
-        default                   : KOutMsg( "dump-mode             : unknown\n" ); break;
-    }
-
-    KOutMsg( "number of regions     : %u\n",  opts->region_count );
-    if ( opts->region_count > 0 )
-        foreach_reference( (BSTree *)&opts->regions, report_reference_cb, NULL );
-
-    if ( opts->qname_prefix == NULL )
-        KOutMsg( "qname-prefix          : NONE\n" );
-    else
-        KOutMsg( "qname-prefix          : '%s'\n",  opts->qname_prefix );
-
-    if ( opts->qual_quant == NULL )
-        KOutMsg( "quality-quantization  : NONE\n" );
-    else
-        KOutMsg( "quality-quantization  : '%s'\n",  opts->qual_quant );
-
-    if ( opts->hdr_comments != NULL )
-    {
-        rc = VNameListCount( opts->hdr_comments, &len );
-        if ( rc == 0 && len > 0 )
-        {
-            uint32_t i;
-
-            KOutMsg( "header-comments-count : %u\n",  len );
-            for ( i = 0; i < len; ++i )
-            {
-                const char * s;
-                rc = VNameListGet( opts->hdr_comments, i, &s );
-                if ( rc == 0 && s != NULL )
-                    KOutMsg( "header-comment[ %u ]  : '%s'\n",  i, s );
-            }
-        }
-    }
-
-    if ( opts->input_files != NULL )
-    {
-        rc = VNameListCount( opts->input_files, &len );
-        if ( rc == 0 && len > 0 )
-        {
-            uint32_t i;
-
-            KOutMsg( "input-file-count      : %u\n",  len );
-            for ( i = 0; i < len; ++i )
-            {
-                const char * s;
-                rc = VNameListGet( opts->input_files, i, &s );
-                if ( rc == 0 && s != NULL )
-                    KOutMsg( "input-file[ %u ]      : '%s'\n",  i, s );
-            }
-        }
-    }
-
-    len = VectorLength( &opts->mp_dist );
-    if ( len > 0 )
-    {
-        uint32_t i;
-
-        KOutMsg( "matepair-dist-filters : %u\n",  len );
-        for ( i = 0; i < len; ++i )
-        {
-            range *r = VectorGet( &opts->mp_dist, i );
-            if ( r != NULL )
-                KOutMsg( "matepair-dist[ %u ]   : '%u ... %u'\n",  i, r->start, r->end );
-        }
-    }
-
-    KOutMsg( "mate-gap-cache-limit  : %u\n",  opts->mape_gap_cache_limit );
-    KOutMsg( "test-row limit        : %u\n",  opts->test_rows );
-    KOutMsg( "outputfile            : %s\n",  opts->outputfile );
-    KOutMsg( "outputbuffer-size     : %u\n",  opts->output_buffer_size );
-    KOutMsg( "cursor-cache-size     : %u\n",  opts->cursor_cache_size );
-
-    KOutMsg( "use mate-cache        : %s\n",  opts->use_mate_cache ? "YES" : "NO" );
-    KOutMsg( "force legacy code     : %s\n",  opts->force_legacy ? "YES" : "NO" );
-    KOutMsg( "use min-mapq          : %s\n",  opts->use_min_mapq ? "YES" : "NO" );
-    KOutMsg( "min-mapq              : %i\n",  opts->min_mapq );
-    KOutMsg( "rna-splicing          : %s\n",  opts->rna_splicing ? "YES" : "NO" );
-}
-
-
-/* =========================================================================================== */
-
-
-void release_options( samdump_opts * opts )
-{
-    free_ref_regions( &opts->regions );
-    if ( opts->qname_prefix != NULL )
-        free( (void*)opts->qname_prefix );
-    if ( opts->qual_quant != NULL )
-        free( (void*)opts->qual_quant );
-    if( opts->outputfile != NULL )
-        free( (void*)opts->outputfile );
-    VNamelistRelease( opts->hdr_comments );
-    VNamelistRelease( opts->input_files );
-    VectorWhack ( &opts->mp_dist, release_range_wrapper, NULL );
-}
-
-/* =========================================================================================== */
-
-
-rc_t gather_options( Args * args, samdump_opts * opts )
-{
-    rc_t rc = gather_region_options( args, opts );
-    if ( rc == 0 )
-        rc = gather_flag_options( args, opts );
-    if ( rc == 0 )
-        rc = gather_string_options( args, opts );
-    if ( rc == 0 )
-        rc = gather_int_options( args, opts );
-    if ( rc == 0 )
-        rc = gather_matepair_distances( args, opts );
-    if ( rc == 0 )
-        gather_unaligned_options( opts );
-    return rc;
-}
-
-
-bool is_this_alignment_requested( const samdump_opts * opts, const char *refname, uint32_t refname_len,
-                                  uint64_t start, uint64_t end )
-{
-    bool res = false;
-    if ( opts != NULL )
-    {
-        reference_region *rr = find_reference_region_len( ( BSTree * )&opts->regions, refname, refname_len );
-        if ( rr != NULL )
-        {
-            Vector *v = &(rr->ranges);
-            uint32_t i, count = VectorLength( v );
-            for ( i = 0; i < count && !res; ++i )
-            {
-                range * r = VectorGet ( v, i );
-                if ( r != NULL )
-                {
-                    res = ( ( end >= r->start )&&( start <= r->end ) );
-                }
-            }
-        }
-    }
-    return res;
-}
-
-
-bool test_limit_reached( const samdump_opts * opts, uint64_t rows_so_far )
-{
-    bool res = false;
-    if ( opts->test_rows > 0 )
-        res = ( rows_so_far >= opts->test_rows );
-    return res;
-}
-
-
-rc_t dump_name( const samdump_opts * opts, int64_t seq_spot_id,
-                const char * spot_group, uint32_t spot_group_len )
-{
-    rc_t rc;
-
-    if ( opts->print_cg_names )
-    {
-        if ( spot_group != NULL && spot_group_len != 0 )
-            rc = KOutMsg( "%.*s-1:%lu", spot_group_len, spot_group, seq_spot_id );
-        else
-            rc = KOutMsg( "%lu", seq_spot_id );
-    }
-    else
-    {
-        if ( opts->qname_prefix != NULL )
-        {
-            /* we do have to print a prefix */
-            if ( opts->print_spot_group_in_name && spot_group != NULL && spot_group_len > 0 )
-                rc = KOutMsg( "%s.%lu.%.*s", opts->qname_prefix, seq_spot_id, spot_group_len, spot_group );
-            else
-            /* we do NOT have to append the spot-group */
-                rc = KOutMsg( "%s.%lu", opts->qname_prefix, seq_spot_id );
-        }
-        else
-        {
-            /* we do NOT have to print a prefix */
-            if ( opts->print_spot_group_in_name && spot_group != NULL && spot_group_len > 0 )
-                rc = KOutMsg( "%lu.%.*s", seq_spot_id, spot_group_len, spot_group );
-            else
-            /* we do NOT have to append the spot-group */
-                rc = KOutMsg( "%lu", seq_spot_id );
-        }
-    }
-    return rc;
-}
-
-
-rc_t dump_name_legacy( const samdump_opts * opts, const char * name, size_t name_len,
-                       const char * spot_group, uint32_t spot_group_len )
-{
-    rc_t rc;
-
-    if ( opts->qname_prefix != NULL )
-    {
-        /* we do have to print a prefix */
-        if ( opts->print_spot_group_in_name && spot_group != NULL && spot_group_len > 0 )
-            rc = KOutMsg( "%s.%.*s%.*s", opts->qname_prefix, name_len, name, spot_group_len, spot_group );
-        else
-        /* we do NOT have to append the spot-group */
-            rc = KOutMsg( "%s.%.*s", opts->qname_prefix, name_len, name );
-    }
-    else
-    {
-        /* we do NOT have to print a prefix */
-        if ( opts->print_spot_group_in_name && spot_group != NULL && spot_group_len > 0 )
-            rc = KOutMsg( "%.*s.%.*s", name_len, name, spot_group_len, spot_group );
-        else
-        /* we do NOT have to append the spot-group */
-            rc = KOutMsg( "%.*s", name_len, name );
-    }
-    return rc;
-}
-
-
-rc_t dump_quality( const samdump_opts * opts, char const *quality, uint32_t qual_len, bool reverse )
-{
-    rc_t rc = 0;
-    bool quantize = ( opts->qual_quant != NULL );
-    uint32_t i;
-    if ( reverse )
-    {
-        if ( quantize )
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                uint32_t qual = quality[ qual_len - i - 1 ];
-                char newValue = ( opts->qual_quant_matrix[ qual ] + 33 );
-                rc = KOutMsg( "%c", newValue );
-            }
-        }
-        else
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                char qual = quality[ qual_len - i - 1 ] + 33;
-                rc = KOutMsg( "%c", qual );
-            }
-        }
-    }
-    else
-    {
-        if ( quantize )
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                uint32_t qual = quality[ i ];
-                char newValue = opts->qual_quant_matrix[ qual ] + 33;
-                rc = KOutMsg( "%c", newValue );
-            }
-
-        }
-        else
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                char qual = quality[ i ] + 33;
-                rc = KOutMsg( "%c", qual );
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t dump_quality_33( const samdump_opts * opts, char const *quality, uint32_t qual_len, bool reverse )
-{
-    rc_t rc = 0;
-    bool quantize = ( opts->qual_quant != NULL );
-    uint32_t i;
-    if ( reverse )
-    {
-        if ( quantize )
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                uint32_t qual = quality[ qual_len - i - 1 ] - 33;
-                char newValue = ( opts->qual_quant_matrix[ qual ] + 33 );
-                rc = KOutMsg( "%c", newValue );
-            }
-        }
-        else
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                char qual = quality[ qual_len - i - 1 ];
-                rc = KOutMsg( "%c", qual );
-            }
-        }
-    }
-    else
-    {
-        if ( quantize )
-        {
-            for ( i = 0; i < qual_len && rc == 0; ++i )
-            {
-                uint32_t qual = quality[ i ] - 33;
-                char newValue = opts->qual_quant_matrix[ qual ] + 33;
-                rc = KOutMsg( "%c", newValue );
-            }
-
-        }
-        else
-        {
-            rc = KOutMsg( "%.*s", qual_len, quality );
-        }
-    }
-    return rc;
-}
-
-
diff --git a/tools/sra-pileup/sam-dump-opts.h b/tools/sra-pileup/sam-dump-opts.h
deleted file mode 100644
index e17c3c8..0000000
--- a/tools/sra-pileup/sam-dump-opts.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_sam_dump_opts_
-#define _h_sam_dump_opts_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/namelist.h>
-
-#include <kapp/args.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <strtol.h>
-
-
-#define OPT_UNALIGNED   "unaligned"
-#define OPT_PRIM_ONLY   "primary"
-#define OPT_CIGAR_LONG  "cigar-long"
-#define OPT_CG_SAM      "CG-SAM"
-#define OPT_CG_EVIDENCE "CG-evidence"
-#define OPT_CG_EV_DNB   "CG-ev-dnb"
-#define OPT_CG_MAPP     "CG-mappings"
-#define OPT_REGION      "aligned-region"
-#define OPT_RECAL_HDR   "header"
-#define OPT_NO_HDR      "no-header"
-#define OPT_USE_SEQID   "seqid"
-#define OPT_HIDE_IDENT  "hide-identical"
-#define OPT_CIGAR_CG    "cigar-CG"
-#define OPT_CIGAR_CG_M  "cigar-CG-merge"
-#define OPT_PREFIX      "prefix"
-#define OPT_REVERSE     "reverse"
-#define OPT_SPOTGRP     "spot-group"
-#define OPT_MATE_GAP    "mate-cache-row-gap"
-#define OPT_TEST_ROWS   "test-rows"
-#define OPT_XI_DEBUG    "XI"
-#define OPT_Q_QUANT     "qual-quant"
-#define OPT_GZIP        "gzip"
-#define OPT_BZIP2       "bzip2"
-#define OPT_FASTQ       "fastq"
-#define OPT_FASTA       "fasta"
-#define OPT_HDR_COMMENT "header-comment"
-#define OPT_MATE_DIST   "matepair-distance"
-#define OPT_OUTPUTFILE  "output-file"
-#define OPT_OUTBUFSIZE  "output-buffer-size"
-#define OPT_REPORT      "report"
-#define OPT_CACHEREPORT "cachereport"
-#define OPT_UNALIGNED_ONLY "unaligned-spots-only"
-#define OPT_CG_NAMES    "CG-names"
-#define OPT_CIGAR_TEST  "cigar-test"
-#define OPT_CURSOR_CACHE "cursor-cache"
-#define OPT_DUMP_MODE   "dump-mode"
-#define OPT_MIN_MAPQ    "min-mapq"
-#define OPT_NO_MATE_CACHE "no-mate-cache"
-#define OPT_LEGACY      "legacy"
-#define OPT_NEW         "new"
-#define OPT_RNA_SPLICE  "rna-splicing"
-
-
-typedef struct range
-{
-    uint64_t start;
-    uint64_t end;
-} range;
-
-
-typedef struct reference_region
-{
-    BSTNode node;
-    const char * name;      /* the name of the reference */
-    Vector ranges;          /* what regions on this reference */
-} reference_region;
-
-
-enum header_mode
-{
-    hm_none = 0,    /* do not dump the headers at all */
-    hm_recalc,      /* recalculate the headers */
-    hm_dump         /* dump the header found in metadata */
-};
-
-enum output_format
-{
-    of_sam = 0,     /* use sam-tools format */
-    of_fasta,       /* use fasta-format */
-    of_fastq        /* use fastq-format */
-};
-
-enum output_compression
-{
-    oc_none = 0,    /* do not compress output */
-    oc_gzip,        /* compress output with gzip */
-    oc_bzip2        /* compress output with bzip2 */
-};
-
-enum cigar_treatment
-{
-    ct_unchanged = 0,   /* use the cigar-string as it is stored */
-    ct_cg_style,        /* transform cigar into cg-style ( has B/N ) */
-    ct_cg_merge         /* transform cg-data(length of read/patterns in cigar) into valid SAM (cigar/READ/QUALITY) */
-};
-
-
-enum dump_mode
-{
-    /* in case of: aligned reads requested + no regions given */
-    dm_one_ref_at_a_time = 0,   /* create a set-iter each for every reference sequentially, put only one reference into it */
-    dm_prepare_all_refs         /* create only ONE set-iter, put ALL references into it */
-};
-
-
-typedef struct samdump_opts
-{
-    /* tree with regions, each node has a sorted vector of ranges, can be empty ... */
-    BSTree regions;     /* contains reference_region structs */
-
-    /* vector with header-comments, can be empty... */
-    VNamelist * hdr_comments;
-
-    /* vector input files/accessions/url's */
-    VNamelist * input_files;
-
-    /* vector with metapair-distances... */
-    Vector mp_dist;
-
-    /* prepend qname with this prefix */
-    const char * qname_prefix;
-
-    /* the quality quantization string */
-    const char * qual_quant;
-
-    /* optional outputfile */
-    const char * outputfile;
-
-    /* cigar-test >>> not advertized! */
-    const char * cigar_test;
-
-    uint32_t region_count;
-    uint32_t input_file_count;
-
-    int32_t min_mapq;
-
-    /* how much buffering on the output-buffer, of OFF if zero */
-    uint32_t output_buffer_size;
-
-    /* mate's farther apart than this are not cached */
-    uint32_t mape_gap_cache_limit;
-
-    /* limit the output of each table to max. this number of rows, if set to a vaue greater than zero */
-    uint64_t test_rows;
-    uint64_t rows_so_far;
-
-    size_t cursor_cache_size;
-
-    /* how the sam-headers are treated */
-    enum header_mode header_mode;
-
-    /* how the cigar-string is treated */
-    enum cigar_treatment cigar_treatment;
-
-    /* in which format should the output be created */
-    enum output_format output_format;
-
-    /* should the output be compressed / in which format */
-    enum output_compression output_compression;
-
-    /* how to process in case of: aligned reads requested + no regions given */
-    enum dump_mode dump_mode;
-
-    /* use a mate-cache to dump aligned and half-aligned reads */
-    bool use_mate_cache;
-    bool force_legacy;
-    bool force_new;
-
-    /* which tables have to be processed/dumped */
-    bool dump_primary_alignments;
-    bool dump_secondary_alignments;
-    bool dump_cg_evidence;
-    bool dump_cg_sam;
-    bool dump_cg_ev_dnb;
-    bool merge_cg_cigar;
-
-    bool dump_unaligned_reads;
-    bool dump_unaligned_only;
-    bool dump_cga_tools_mode;
-
-    /* what alignment/unaligned reads should be dumped */
-    bool print_half_unaligned_reads;
-    bool print_fully_unaligned_reads;
-
-    /* flag that shows if we need to filter by matepair-distance */
-    bool use_matepair_filter;
-    bool use_min_mapq;
-
-    /* options changing the output-format */
-    bool use_seqid_as_refname;
-    bool use_long_cigar;
-    bool print_matches_as_equal_sign;
-    bool print_spot_group_in_name;
-    bool reverse_unaligned_reads;
-    bool print_alignment_id_in_column_xi;
-    bool report_options;
-    bool report_cache;
-    bool print_cg_names;
-    bool rna_splicing;
-
-    uint8_t qual_quant_matrix[ 256 ];
-} samdump_opts;
-
-
-typedef struct foreach_reference_func
-{
-    rc_t ( CC * on_reference ) ( const char * name, Vector *ranges, void *data );
-    const char * name;
-    void * data;
-    rc_t rc;
-} foreach_reference_func;
-
-
-rc_t foreach_reference( BSTree * regions,
-    rc_t ( CC * on_reference ) ( const char * name, Vector *ranges, void *data ), 
-    void *data );
-
-
-rc_t gather_options( Args * args, samdump_opts * opts );
-void report_options( const samdump_opts * opts );
-void release_options( samdump_opts * opts );
-
-bool filter_by_matepair_dist( const samdump_opts * opts, int32_t tlen );
-
-bool is_this_alignment_requested( const samdump_opts * opts, const char *refname, uint32_t refname_len,
-                                  uint64_t start, uint64_t len );
-
-bool test_limit_reached( const samdump_opts * opts, uint64_t rows_so_far );
-
-rc_t dump_name( const samdump_opts * opts, int64_t seq_spot_id,
-                const char * spot_group, uint32_t spot_group_len );
-rc_t dump_name_legacy( const samdump_opts * opts, const char * name, size_t name_len,
-                       const char * spot_group, uint32_t spot_group_len );
-
-rc_t dump_quality( const samdump_opts * opts, char const *quality, uint32_t qual_len, bool reverse );
-
-rc_t dump_quality_33( const samdump_opts * opts, char const *quality, uint32_t qual_len, bool reverse );
-
-#endif
diff --git a/tools/sra-pileup/sam-dump.c b/tools/sra-pileup/sam-dump.c
deleted file mode 100644
index 4c491b9..0000000
--- a/tools/sra-pileup/sam-dump.c
+++ /dev/null
@@ -1,4896 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include <klib/report.h>
-#include <klib/container.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <klib/vector.h>
-#include <klib/printf.h>
-#include <klib/data-buffer.h>
-#include <vfs/manager.h>
-#include <vfs/path.h>
-#include <vfs/path-priv.h>
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/gzip.h>
-#include <kfs/bzip.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-#include <vdb/report.h>
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <vdb/schema.h>
-#include <vdb/dependencies.h>
-#include <sra/sraschema.h>
-#include <sra/srapath.h>
-#include <align/dna-reverse-cmpl.h>
-#include <align/iterator.h>
-#include <align/reference.h>
-#include <align/quality-quantizer.h>
-
-#include <kfs/directory.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <string.h>
-#include <strtol.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "debug.h"
-/* #include "sam-dump.vers.h" */
-
-#if _ARCH_BITS == 64
-#define USE_MATE_CACHE 1
-#define CURSOR_CACHE (4 * 1024 * 1024 * 1024UL)
-#else
-#define USE_MATE_CACHE 0
-#define CURSOR_CACHE (256 * 1024 * 1024)
-#endif
-
-
-
-typedef struct TAlignedRegion_struct
-{
-    char name[1024];
-    struct {
-        INSDC_coord_zero from;
-        INSDC_coord_zero to;
-    } r[10240];
-    int rq;
-    INSDC_coord_zero max_to;
-    INSDC_coord_zero min_from;
-    int printed;
-} TAlignedRegion;
-
-
-typedef struct TMatepairDistance_struct
-{
-    uint32_t from;
-    uint32_t to;
-} TMatepairDistance;
-
-
-struct params_s
-{
-    /* which outputs are on */
-    bool primaries;
-    bool secondaries;
-    bool unaligned;
-    bool cg_evidence;
-    bool cg_ev_dnb;
-    bool cg_sam;
-    
-    bool use_seqid;
-    bool long_cigar;
-    bool reheader;
-    bool noheader;
-    bool hide_identical;
-    bool fasta;
-    bool fastq;
-    bool spot_group_in_name;
-    bool cg_friendly_names;
-    bool reverse_unaligned;
-    bool unaligned_spots;
-    
-    bool output_gzip;
-    bool output_bz2;
-    
-    bool xi;
-    int cg_style; /* 0: raw; 1: with B's; 2: without B's, fixed up SEQ/QUAL; */
-    char const *name_prefix;
-    /* region filter data */
-    TAlignedRegion* region;
-    uint32_t region_qty;
-    /* distance filter data */
-    bool mp_dist_unknown;
-    TMatepairDistance* mp_dist;
-    uint32_t mp_dist_qty;
-    uint32_t test_rows;
-
-    /* mate info cache */
-    int64_t mate_row_gap_cachable;
-    
-    char const **comments;
-    
-    bool quantizeQual;
-    uint8_t qualQuant[256];
-    uint8_t qualQuantSingle; /*** the quality is quantized - single value, no need to retrieve **/
-};
-
-
-struct params_s const *param;
-ReferenceList const *gRefList;
-
-
-typedef union UData_union
-{
-    void const *v;
-    uint32_t const *u32;
-    int32_t const *i32;
-    int64_t const *i64;
-    uint64_t const *u64;
-    uint8_t const *u8;
-    char const *str;
-    bool const *tf;
-    INSDC_coord_one* coord1;
-    INSDC_coord_zero* coord0;
-    INSDC_coord_len* coord_len;
-    INSDC_coord_val* coord_val;
-    INSDC_SRA_xread_type* read_type;
-    INSDC_SRA_read_filter* read_filter;
-} UData;
-
-
-typedef struct SCol_struct
-{
-    char const *name;
-    uint32_t idx;
-    UData base;
-    uint32_t len;
-    bool optional;
-} SCol;
-
-
-typedef struct STable_struct
-{
-    char const *name;
-    VTable const *vtbl;
-} STable;
-
-
-typedef struct SCursCache_struct
-{
-    KVector* cache;
-    KVector* cache_unaligned_mate; /* keeps unaligned-mate for a half-aligned spots */
-    uint32_t sam_flags;
-    INSDC_coord_zero pnext;
-    int32_t tlen;
-    ReferenceObj const *ref;
-    /* cache stats */
-    uint64_t projected;
-    uint64_t added;
-    uint64_t hit;
-    uint64_t bad;
-} SCursCache;
-
-
-typedef struct SCurs_struct
-{
-    STable const *tbl;
-    VCursor const *vcurs;
-    SCursCache* cache;
-    SCursCache cache_local;
-    uint64_t col_reads_qty;
-} SCurs;
-
-enum eDSTableType
-{
-    edstt_NotSpecified,
-    edstt_Reference,
-    edstt_Sequence,
-    edstt_PrimaryAlignment,
-    edstt_SecondaryAlignment,
-    edstt_EvidenceAlignment,
-    edstt_EvidenceInterval
-};
-
-
-typedef struct DataSource_s {
-    STable tbl;
-    SCurs curs;
-    SCol *cols;
-    enum eDSTableType type;
-} DataSource;
-
-
-#define DATASOURCE_INIT(O, NAME) do { memset(&O, 0, sizeof(O)); O.tbl.name = NAME; O.curs.tbl = &O.tbl; } while(0)
-
-
-typedef struct SAM_dump_ctx_s
-{
-    VDatabase const *db;
-    char const *fullPath;
-    char const *accession;
-    char const *readGroup;
-    
-    DataSource ref;
-    DataSource pri;
-    DataSource sec;
-    DataSource evi;
-    DataSource eva;
-    DataSource seq;
-} SAM_dump_ctx_t;
-
-
-enum ealg_col
-{
-    alg_SEQ_SPOT_ID = 0,
-    alg_SEQ_NAME,
-    alg_MAPQ,
-    alg_CIGAR,
-    alg_READ,
-    alg_READ_START,
-    alg_READ_LEN,
-    alg_CIGAR_LEN,
-    alg_SAM_QUALITY,
-    alg_SPOT_GROUP,
-    alg_SEQ_SPOT_GROUP,
-    alg_SEQ_READ_ID,
-    alg_REVERSED,
-    alg_ALIGNMENT_COUNT,
-    alg_EDIT_DISTANCE,
-    alg_READ_FILTER,
-    alg_MATE_ALIGN_ID,
-    alg_MATE_REF_NAME,
-    alg_SAM_FLAGS,
-    alg_REF_START,
-    alg_MATE_REF_POS,
-    alg_ALIGN_GROUP,
-    alg_EVIDENCE_ALIGNMENT_IDS,
-    alg_REF_PLOIDY,
-    alg_REF_ID,
-    alg_MATE_REF_ID,
-    alg_HAS_MISMATCH,
-    alg_REGION_FILTER,
-    alg_REF_NAME = alg_REGION_FILTER,
-    alg_REF_SEQ_ID,
-    alg_REF_POS,
-    alg_REF_LEN,
-    alg_DISTANCE_FILTER,
-    alg_TEMPLATE_LEN = alg_DISTANCE_FILTER,
-    alg_CG_TAGS_STR
-};
-
-
-SCol const g_alg_col_tmpl[] =
-{
-    { "SEQ_SPOT_ID", 0, {NULL}, 0, true },
-    { "SEQ_NAME", 0, {NULL}, 0, false },
-    { "MAPQ", 0, {NULL}, 0, false },
-    { "?CIGAR column name?", 0, {NULL}, 0, false },
-    { "?READ column name?", 0, {NULL}, 0, false },
-    { "READ_START", 0, {NULL}, 0, false }, /* READ_START */
-    { "READ_LEN", 0, {NULL}, 0, false }, /* READ_LEN */
-    { "?CIGAR_LEN column name?", 0, {NULL}, 0, true }, /* CIGAR_LEN */
-    { "SAM_QUALITY", 0, {NULL}, 0, false },
-    { "SPOT_GROUP", 0, {NULL}, 0, true },
-    { "SEQ_SPOT_GROUP", 0, {NULL}, 0, true },
-    { "SEQ_READ_ID", 0, {NULL}, 0, true },
-    { "REF_ORIENTATION", 0, {NULL}, 0, true },
-    { "ALIGNMENT_COUNT", 0, {NULL}, 0, true },
-    { "EDIT_DISTANCE", 0, {NULL}, 0, false },
-    { "", 0, {NULL}, 0, false },
-    /* start cols used as standalone in DumpUnaligned */
-    /* MATE_ALIGN_ID col must preceeed
-       MATE_REF_NAME, MATE_REF_POS, SAM_FLAGS, TEMPLATE_LEN for cache to work */
-    { "MATE_ALIGN_ID", 0, {NULL}, 0, false },
-    { "?MATE_REF_NAME column name?", 0, {NULL}, 0, false },
-    { "SAM_FLAGS", 0, {NULL}, 0, false },
-    { "REF_START", 0, {NULL}, 0, false },  /* priming cursor cache */
-    { "MATE_REF_POS", 0, {NULL}, 0, false },
-    { "ALIGN_GROUP", 0, {NULL}, 0, true },
-    { "", 0, {NULL}, 0, true }, /* EVIDENCE_ALIGNMENT_IDS */
-    { "", 0, {NULL}, 0, true }, /* REF_PLOIDY */
-    { "REF_ID", 0, {NULL}, 0, true }, /* REF_ID */
-    { "MATE_REF_ID", 0, {NULL}, 0, true }, /* priming cursor cache */
-    { "(bool)HAS_MISMATCH", 0, {NULL}, 0, true },
-    /* these are read before any other for filtering so they must be last */
-    { "REF_NAME", 0, {NULL}, 0, false },
-    { "REF_SEQ_ID", 0, {NULL}, 0, false },
-    { "REF_POS", 0, {NULL}, 0, false },
-    /* end cols used as standalone in DumpUnaligned */
-    { "REF_LEN", 0, {NULL}, 0, false },
-    { "TEMPLATE_LEN", 0, {NULL}, 0, false },
-    { NULL, 0, {NULL}, 0, false }, /* alg_CG_TAGS_STR */
-    { NULL, 0, {NULL}, 0, false }
-};
-
-enum eseq_col
-{
-    seq_READ = 0,
-    seq_QUALITY,
-    seq_SPOT_GROUP,
-    seq_READ_START,
-    seq_READ_LEN,
-    seq_READ_TYPE,
-    seq_READ_FILTER,
-    seq_NAME,
-    seq_PRIMARY_ALIGNMENT_ID
-};
-
-static 
-SCol const gSeqCol[] =
-{
-    { "READ", 0, {NULL}, 0, false },
-    { "(INSDC:quality:text:phred_33)QUALITY", 0, {NULL}, 0, false },
-    { "SPOT_GROUP", 0, {NULL}, 0, true },
-    { "READ_START", 0, {NULL}, 0, true },
-    { "READ_LEN", 0, {NULL}, 0, true },
-    { "READ_TYPE", 0, {NULL}, 0, true },
-    { "READ_FILTER", 0, {NULL}, 0, true },
-    { "NAME", 0, {NULL}, 0, true },
-    /* must be last in list to avoid reading all columns */
-    { "PRIMARY_ALIGNMENT_ID", 0, {NULL}, 0, true },
-    { NULL, 0, {NULL}, 0, false }
-};
-
-
-static rc_t RefSeqPrint( void )
-{
-    rc_t rc = 0;
-    uint32_t i, count = 0;
-    
-    rc = ReferenceList_Count( gRefList, &count );
-    for( i = 0; rc == 0 && i < count; i++ )
-    {
-        ReferenceObj const *obj;
-        rc = ReferenceList_Get( gRefList, &obj, i );
-        if ( rc == 0 )
-        {
-            char const *seqid = NULL;
-            rc = ReferenceObj_SeqId( obj, &seqid );
-            if ( rc == 0 )
-            {
-                char const *name = NULL;
-                rc = ReferenceObj_Name( obj, &name );
-                if ( rc == 0 )
-                {
-                    INSDC_coord_len len;
-                    rc = ReferenceObj_SeqLength( obj, &len );
-                    if ( rc == 0 )
-                    {
-                        char const *nm;
-                        if ( param->use_seqid && seqid != NULL && seqid[ 0 ] != '\0' )
-                        {
-                            nm = seqid;
-                        }
-                        else
-                        {
-                            nm = name;
-                        }
-                        KOutMsg( "@SQ\tSN:%s", nm );
-                        if ( nm != seqid && seqid != NULL && seqid[ 0 ] != '\0' && strcmp( nm, seqid ) != 0)
-                        {
-                            KOutMsg( "\tAS:%s", seqid );
-                        }
-                        KOutMsg( "\tLN:%u\n", len );
-                    }
-                }
-            }
-            ReferenceObj_Release( obj );
-        }
-    }
-    return rc;
-}
-
-
-#if USE_MATE_CACHE
-static rc_t Cache_Init( SCursCache* c )
-{
-    if ( c != NULL )
-    {
-	rc_t rc;
-        memset( c, 0, sizeof( *c ) );
-        rc=KVectorMake( &c->cache );
-	if(rc == 0){
-		rc=KVectorMake( &c->cache_unaligned_mate );
-	}
-    }
-    return 0;
-}
-
-
-static void Cache_Close( char const *name, SCursCache* c )
-{
-    if ( c != NULL )
-    {
-        KVectorRelease( c->cache );
-        KVectorRelease( c->cache_unaligned_mate );
-        if ( c->added > 0 )
-        {
-            SAM_DUMP_DBG( 2, ( "%s cache stats: projected %lu added of those %lu; "
-                               "hits %lu of those broken %lu;\n",
-                               name, c->projected, c->added, c->hit, c->bad ) );
-        }
-    }
-    memset( c, 0, sizeof( *c ) );
-}
-
-
-static rc_t Cache_Add( uint64_t key, SCurs const *curs, SCol const *cols )
-{
-    /* compact values for mate record to cache as:
-        pos_delta - 32bit, ref_proj - 11bit, flags - 11bit, rnext_idx - 10bit = 64bit
-    */
-    rc_t rc = 0;
-    ReferenceObj const *r = NULL;
-    uint32_t rid = 0;
-    uint64_t val = 0;
-    int64_t mate_id = cols[ alg_MATE_ALIGN_ID ].len > 0 ? cols[ alg_MATE_ALIGN_ID ].base.i64[ 0 ] : 0;
-
-    rc = ReferenceList_Find( gRefList, &r, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len );
-    if ( rc == 0 )
-    {
-        rc = ReferenceObj_Idx( r, &rid );
-    }
-#if _DEBUGGING
-    {
-        char const *rname = NULL;
-        curs->cache->projected++;
-        ReferenceObj_Name( r, &rname );
-        SAM_DUMP_DBG( 10, ( "to cache row %li for mate %li: %u,%s[%hu],%u,%u,%i",
-            key, mate_id, cols[ alg_SAM_FLAGS ].base.u32[ 0 ], rname, rid,
-            cols[ alg_REF_POS ].len ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0,
-            cols[ alg_MATE_REF_POS ].len ? cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] : 0,
-            cols[ alg_TEMPLATE_LEN ].len > 0 ? cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] : 0));
-    }
-#endif
-    if ( rc == 0 && !( rid & 0xFC00 ) )
-    {
-        int64_t pos_delta64;
-        int32_t pos_delta32;
-
-        if ( mate_id != 0 )
-        {
-            ReferenceObj const *rm = NULL;
-            uint32_t rm_id;
-
-            rc = ReferenceList_Find( gRefList, &rm, cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len );
-            if ( rc == 0 )
-            {
-                rc = ReferenceObj_Idx( rm, &rm_id );
-            }
-            assert( rm != NULL );
-            if ( rc == 0 && rid != rm_id )
-            {
-                char const *rm_name = NULL;
-                ReferenceObj_Name( rm, &rm_name );
-                mate_id = 0;
-                SAM_DUMP_DBG( 10, ( " mate ref differ: %s[%hu]!", rm_name, rm_id ) );
-            }
-            ReferenceObj_Release( rm );
-        }
-
-        if ( mate_id != 0 )
-        {
-            pos_delta64 = cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] - cols[ alg_REF_POS ].base.coord0[ 0 ];
-        }
-        else
-        {
-            pos_delta64 = cols[ alg_REF_POS ].base.coord0[ 0 ];
-        }
-
-        pos_delta32 = pos_delta64;
-        if ( pos_delta64 == pos_delta32 )
-        {
-            int64_t ref_proj;
-            if ( mate_id == 0 )
-            {
-                ref_proj = 0; /* indicates full value in delta */
-            }
-            else if ( cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] < 0 )
-            {
-                assert( pos_delta32 <= 0 );
-                ref_proj = pos_delta32 - cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ];
-            }
-            else
-            {
-                assert( pos_delta32 >= 0 );
-                ref_proj = cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] - pos_delta32;
-            }
-
-            if ( !( ref_proj & 0xFFFFF800 ) )
-            {
-                val = ( pos_delta64 << 32 ) | ( ref_proj << 21 ) | ( cols[ alg_SAM_FLAGS ].base.u32[ 0 ] << 10 ) | rid;
-                rc = KVectorSetU64( curs->cache->cache, key, val );
-            }
-        }
-    }
-    ReferenceObj_Release( r );
-
-#if _DEBUGGING
-    if ( val == 0 )
-    {
-        SAM_DUMP_DBG( 10, ( " --> out of range\n" ) );
-    }
-    else
-    {
-        SAM_DUMP_DBG( 10, ( " --> %016lX\n", val ) );
-        curs->cache->added++;
-    }
-#endif
-    return rc;
-}
-
-
-static rc_t Cache_Get( SCurs const *curs, uint64_t key, uint64_t* val )
-{
-    rc_t rc = KVectorGetU64( curs->cache->cache, key, val );
-    if ( rc == 0 )
-    {
-        uint32_t id = ( *val & 0x3FF );
-#if _DEBUGGING
-        curs->cache->hit++;
-#endif
-        KVectorUnset( curs->cache->cache, key );
-        rc = ReferenceList_Get( gRefList, &curs->cache->ref, id );
-        if ( rc != 0 )
-        {
-            *val = 0;
-            curs->cache->ref = NULL;
-            rc = RC( rcExe, rcNoTarg, rcSearching, rcItem, rcNotFound );
-#if _DEBUGGING
-            curs->cache->bad++;
-#endif
-        }
-        else
-        {
-            SAM_DUMP_DBG( 10, ( "from cache row %li %016lX", key, *val ) );
-        }
-    }
-    return rc;
-}
-
-
-static void Cache_Unpack( uint64_t val, int64_t mate_id, SCurs const *curs, SCol* cols )
-{
-    int32_t pos_delta = ( val & 0xFFFFFFFF00000000 ) >> 32;
-    uint32_t ref_proj = ( val & 0x00000000FFE00000 ) >> 21;
-    uint32_t flags = ( val & 0x00000000001FFC00 ) >> 10;
-
-    if ( mate_id != 0 )
-    {
-        /* adjust flags for mate record */
-        curs->cache->sam_flags = ( flags & 0x1 ) |
-                                 ( flags & 0x2 ) |
-                                 ( ( flags & 0x8 ) >> 1 ) |
-                                 ( ( flags & 0x4 ) << 1 ) |
-                                 ( ( flags & 0x20 ) >> 1 ) |
-                                 ( ( flags & 0x10 ) << 1 ) |
-                                 ( ( flags & 0x40 ) ? 0x80 : 0x40 ) |
-                                 ( flags & 0x700 );
-    }
-    else
-    {
-        /* preserve flags as if original records is restored */
-        curs->cache->sam_flags = flags;
-    }
-    cols[ alg_SAM_FLAGS ].base.u32 = &curs->cache->sam_flags;
-    cols[ alg_SAM_FLAGS ].len = sizeof( curs->cache->sam_flags );
-
-    if ( param->use_seqid )
-    {
-        ReferenceObj_SeqId( curs->cache->ref, &cols[ alg_MATE_REF_NAME ].base.str );
-    }
-    else
-    {
-        ReferenceObj_Name( curs->cache->ref, &cols[ alg_MATE_REF_NAME ].base.str );
-    }
-
-    cols[ alg_MATE_REF_NAME ].len = string_size( cols[ alg_MATE_REF_NAME ].base.str );
-
-    if ( ref_proj == 0 )
-    {
-        curs->cache->pnext = pos_delta;
-        curs->cache->tlen = 0;
-    }
-    else if ( pos_delta > 0 )
-    {
-        curs->cache->pnext = ( cols[ alg_REF_POS ].len > 0 ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0 ) - pos_delta;
-        curs->cache->tlen = - ( ref_proj + pos_delta );
-    }
-    else
-    {
-        curs->cache->pnext = ( cols[ alg_REF_POS ].len > 0 ? cols[ alg_REF_POS ].base.coord0[ 0 ] : 0 ) - pos_delta;
-        curs->cache->tlen = ref_proj - pos_delta;
-    }
-
-    cols[ alg_MATE_REF_POS ].base.coord0 = &curs->cache->pnext;
-    cols[ alg_MATE_REF_POS ].len = sizeof( curs->cache->pnext );
-    cols[ alg_TEMPLATE_LEN ].base.i32 = &curs->cache->tlen;
-    cols[ alg_TEMPLATE_LEN ].len = sizeof( curs->cache->tlen );
-    {
-        uint32_t id;
-        ReferenceObj_Idx( curs->cache->ref, &id );
-        SAM_DUMP_DBG( 10, ( " --> mate %li: %u,%s[%hu],%u,%i\n",
-            mate_id, curs->cache->sam_flags, cols[ alg_MATE_REF_NAME ].base.str,
-            id, curs->cache->pnext, curs->cache->tlen ) );
-    }
-}
-#endif /* USE_MATE_CACHE */
-
-#if 0
-static rc_t OpenVTable( VDatabase const *db, STable* tbl, char const *name, bool optional )
-{
-    rc_t rc = VDatabaseOpenTableRead( db, &tbl->vtbl, name );
-    if ( GetRCState( rc ) == rcNotFound && optional )
-    {
-        rc = 0;
-        tbl->vtbl = NULL;
-    }
-    tbl->name = name;
-    return rc;
-}
-#endif
-
-static rc_t Cursor_Open( STable const *const tbl, SCurs *const curs, SCol cols[], SCursCache* cache )
-{
-    rc_t rc = 0;
-    unsigned i;
-
-    curs->vcurs = NULL;
-    if ( tbl == NULL || tbl->vtbl == NULL )
-        return 0;
-
-    rc = VTableCreateCachedCursorRead( tbl->vtbl, &curs->vcurs, CURSOR_CACHE );
-    if ( rc != 0 )
-        return rc;
-    
-    rc = VCursorPermitPostOpenAdd( curs->vcurs );
-    if ( rc != 0 )
-        return rc;
-
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( curs->vcurs );
-        if ( rc == 0 )
-        {
-#if USE_MATE_CACHE
-            if ( cache != NULL )
-            {
-                curs->cache = cache;
-            }
-            else
-            {
-                curs->cache = &curs->cache_local;
-                rc = Cache_Init( &curs->cache_local );
-            }
-#endif /* USE_MATE_CACHE */
-            curs->tbl = tbl;
-        }
-    }
-    
-    for ( i = 0; cols[ i ].name != NULL; ++i )
-    {
-        if ( cols[ i ].name[ 0 ] == 0 )
-            continue;
-        rc = VCursorAddColumn( curs->vcurs, &cols[ i ].idx, cols[ i ].name );
-        if ( GetRCObject( rc ) == rcColumn )
-        {
-            switch ( GetRCState( rc ) )
-            {
-            case rcNotFound:
-            case rcUndefined:
-                if ( !cols[ i ].optional )
-                    break;
-            case rcExists:
-                rc = 0;
-            default:
-                break;
-            }
-        }
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "table $(t) column $(c)", "t=%s,c=%s", tbl->name, cols[ i ].name ) );
-            break;
-        }
-    }
-    if ( rc != 0 )
-    {
-        VCursorRelease( curs->vcurs );
-        curs->vcurs = NULL;
-        if ( rc != KLogLastErrorCode() )
-        {
-            (void)PLOGERR( klogErr, ( klogErr, rc, "table $(t)", "t=%s", tbl->name ) );
-        }
-    }
-    else
-    {
-        SAM_DUMP_DBG( 2, ( "%s: table %s\n", __func__, curs->tbl->name ) );
-    }
-    return rc;
-}
-
-
-static void Cursor_Close( SCurs* curs )
-{
-    if ( curs != NULL && curs->vcurs != NULL )
-    {
-        SAM_DUMP_DBG( 2, ( "%s: table %s, columns rows read %lu\n", __func__, curs->tbl->name, curs->col_reads_qty ) );
-        VCursorRelease( curs->vcurs );
-#if USE_MATE_CACHE
-        if ( curs->cache == &curs->cache_local )
-        {
-            Cache_Close( curs->tbl->name, curs->cache );
-        }
-#endif /* USE_MATE_CACHE */
-        memset( curs, 0, sizeof( *curs ) );
-    }
-}
-
-
-static rc_t Cursor_Read( DataSource *ds, int64_t row_id, int firstCol, unsigned nCols )
-{
-    rc_t rc = 0;
-
-    if ( ds->curs.vcurs == NULL )
-    {
-        rc = Cursor_Open( &ds->tbl, &ds->curs, ds->cols, ds->curs.cache );
-        if ( rc != 0 )
-            return rc;
-    }
-    if (1)
-    {
-        SCol *const col = &ds->cols[ firstCol ];
-        unsigned i;
-        
-        for ( i = 0; i < nCols && col[ i ].name; ++i )
-        {
-            uint32_t const idx = col[ i ].idx;
-            
-            if ( idx != 0 )
-            {
-                uint32_t elem_bits;
-                uint32_t bit_offset;
-                uint32_t elem_count;
-                void const *base;
-                
-                rc = VCursorCellDataDirect( ds->curs.vcurs, row_id, idx, &elem_bits, &base, &bit_offset, &elem_count );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogWarn, ( klogWarn, rc, "reading $(t) row $(r), column $(c)", "t=%s,r=%li,c=%s",
-                                               ds->tbl.name, row_id, col[ i ].name ) );
-                    return rc;
-                }
-                
-                assert( bit_offset == 0 );
-                assert( elem_bits % 8 == 0 );
-                
-                col[ i ].base.v = base;
-                col[ i ].len = elem_count;
-            }
-        }
-    }
-    return rc;
-}
-
-struct
-{
-    KWrtWriter writer;
-    void* data;
-    KFile* kfile;
-    uint64_t pos;
-} g_out_writer = {NULL};
-
-
-static rc_t CC BufferedWriter( void *const self, char const buffer[], size_t const bufsize, size_t *const pnum_writ )
-{
-    rc_t rc = 0;
-    size_t written = 0;
-
-    assert( buffer != NULL );
-
-    while ( written < bufsize )
-    {
-        size_t n;
-
-        rc = KFileWrite( g_out_writer.kfile, g_out_writer.pos + written, &buffer[ written ], bufsize - written, &n );
-        if ( rc != 0 )
-            break;
-        written += n;
-    }
-    g_out_writer.pos += written;
-    if ( pnum_writ != NULL )
-        *pnum_writ = written;
-    return rc;
-}
-
-
-static rc_t BufferedWriterMake( bool gzip, bool bzip2 )
-{
-    rc_t rc = 0;
-
-    if ( gzip && bzip2 )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else if ( g_out_writer.writer != NULL )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else
-    {
-        rc = KFileMakeStdOut( &g_out_writer.kfile );
-        if ( rc == 0 )
-        {
-            g_out_writer.pos = 0;
-            if ( gzip )
-            {
-                KFile* gz;
-                rc = KFileMakeGzipForWrite( &gz, g_out_writer.kfile );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = gz;
-                }
-            }
-            else if ( bzip2 )
-            {
-                KFile* bz;
-                rc = KFileMakeBzip2ForWrite( &bz, g_out_writer.kfile );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = bz;
-                }
-            }
-            if ( rc == 0 )
-            {
-                KFile* buf;
-                rc = KBufFileMakeWrite( &buf, g_out_writer.kfile, false, 128 * 1024 );
-                if ( rc == 0 )
-                {
-                    KFileRelease( g_out_writer.kfile );
-                    g_out_writer.kfile = buf;
-                    g_out_writer.writer = KOutWriterGet();
-                    g_out_writer.data = KOutDataGet();
-                    rc = KOutHandlerSet( BufferedWriter, &g_out_writer );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static void BufferedWriterRelease( bool flush )
-{
-    if ( flush )
-    {
-        /* avoid flushing buffered data after failure */
-        KFileRelease( g_out_writer.kfile );
-    }
-    if ( g_out_writer.writer != NULL )
-    {
-        KOutHandlerSet( g_out_writer.writer, g_out_writer.data );
-    }
-    g_out_writer.writer = NULL;
-}
-
-
-typedef struct ReadGroup
-{
-    BSTNode node;
-    char name[ 1024 ];
-} ReadGroup;
-
-
-static int CC ReadGroup_sort( BSTNode const *item, BSTNode const *node )
-{
-    return strcmp( ( ( ReadGroup const * )item )->name, ( ( ReadGroup const * ) node )->name );
-}
-
-
-static rc_t ReadGroup_print( char const *nm )
-{
-    rc_t rc = 0;
-    if ( nm[ 0 ] != '\0' && strcasecmp( nm, "default" ) )
-    {
-        rc = KOutMsg( "@RG\tID:%s\n", nm );
-    }
-    return rc;
-}
-
-
-static void CC ReadGroup_dump( BSTNode *n, void *data )
-{
-    ReadGroup const *g = ( ReadGroup* )n;
-    ReadGroup_print( g->name );
-}
-
-
-static rc_t CC DumpReadGroupsScan( STable const *tbl )
-{
-    SCol cols[] =
-    {
-        { "SPOT_GROUP", 0, {NULL}, 0, false },
-        { NULL, 0, {NULL}, 0, false }
-    };
-    rc_t rc = 0;
-    BSTree tree;
-    DataSource ds;
-
-    memset( &ds, 0, sizeof( ds ) );
-    ds.cols = cols;
-
-    BSTreeInit( &tree );
-    rc = Cursor_Open( tbl, &ds.curs, ds.cols, NULL );
-    if ( rc == 0 )
-    {
-        int64_t start;
-        uint64_t count;
-
-        rc = VCursorIdRange( ds.curs.vcurs, 0, &start, &count );
-        if ( rc == 0 )
-        {
-            ReadGroup* node = NULL;
-            uint32_t last_len = 0;
-
-            while ( count > 0 && rc == 0 )
-            {
-                rc = Cursor_Read( &ds, start, 0, ~(unsigned)0 );
-                if ( rc == 0 && cols[ 0 ].len != 0 )
-                {
-                    if ( node == NULL ||
-                         last_len != cols[ 0 ].len ||
-                         strncmp( cols[ 0 ].base.str, node->name, cols[ 0 ].len ) != 0 )
-                    {
-                        node = malloc( sizeof( *node ) );
-                        if ( node == NULL )
-                        {
-                            rc = RC( rcExe, rcNode, rcConstructing, rcMemory, rcExhausted );
-                        }
-                        else if ( cols[ 0 ].len > sizeof( node->name ) )
-                        {
-                            rc = RC( rcExe, rcString, rcCopying, rcBuffer, rcInsufficient ); 
-                        }
-                        else
-                        {
-                            last_len = cols[ 0 ].len;
-                            string_copy( node->name, ( sizeof node->name ) - 1, cols[ 0 ].base.str, last_len );
-                            node->name[ last_len ] = '\0';
-                            rc = BSTreeInsertUnique( &tree, &node->node, NULL, ReadGroup_sort );
-                            if ( GetRCState( rc ) == rcExists )
-                            {
-                                free( node );
-                                rc = 0;
-                            }
-                        }
-                    }
-                }
-                else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcRow )
-                {
-                    rc = 0;
-                }
-                start++;
-                count--;
-            }
-        }
-        Cursor_Close( &ds.curs );
-    }
-
-    if ( rc == 0 )
-    {
-        BSTreeForEach( &tree, false, ReadGroup_dump, NULL );
-    }
-    else if ( rc != KLogLastErrorCode() )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "$(f)", "f=%s", __func__ ) );
-    }
-    BSTreeWhack( &tree, NULL, NULL );
-    return rc;
-}
-
-
-rc_t CC DumpReadGroups( STable const *tbl )
-{
-    rc_t rc = 0;
-    KMetadata const *m;
-
-    /* try getting list from stats meta */
-    rc = VTableOpenMetadataRead( tbl->vtbl, &m );
-    if ( rc == 0 )
-    {
-        KMDataNode const *n;
-        rc = KMetadataOpenNodeRead( m, &n, "/STATS/SPOT_GROUP" );
-        if ( rc == 0 )
-        {
-            KNamelist* names;
-            rc = KMDataNodeListChild( n, &names );
-            if ( rc == 0 )
-            {
-                uint32_t i, q;
-                rc = KNamelistCount( names, &q );
-                if ( rc == 0 )
-                {
-                    for ( i = 0; rc == 0 && i < q; i++ )
-                    {
-                        char const *nm;
-                        rc = KNamelistGet( names, i, &nm );
-                        if ( rc == 0 )
-                        {
-                            rc = ReadGroup_print( nm );
-                        }
-                    }
-                }
-                KNamelistRelease( names );
-            }
-            KMDataNodeRelease( n );
-        }
-        KMetadataRelease( m );
-    }
-
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        rc = DumpReadGroupsScan( tbl );
-    }
-    else if ( rc != 0 && rc != KLogLastErrorCode() )
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "$(f)", "f=%s", __func__ ) );
-    }
-    return rc;
-}
-
-static rc_t Cursor_ReadAlign( SCurs const *curs, int64_t row_id, SCol* cols, uint32_t idx )
-{
-    rc_t rc = 0;
-    SCol* c = NULL;
-    SCol* mate_id = NULL;
-#if USE_MATE_CACHE
-    uint64_t cache_val = 0;
-    bool cache_miss = false;
-#endif /* USE_MATE_CACHE */
-
-    
-    for( ; rc == 0 && cols[ idx ].name != NULL; idx++ )
-    {
-        c = &cols[ idx ];
-        if ( c->idx != 0 )
-        {
-#if USE_MATE_CACHE
-            if ( mate_id != NULL && curs->cache != NULL && !cache_miss &&
-                ( idx == alg_SAM_FLAGS || idx == alg_MATE_REF_NAME || idx == alg_MATE_REF_POS || idx == alg_TEMPLATE_LEN ) &&
-                mate_id->idx && mate_id->len > 0 && mate_id->base.i64[ 0 ] > 0 )
-            {
-                if ( cache_val != 0 )
-                {
-                    continue;
-                }
-                rc = Cache_Get( curs, mate_id->base.u64[ 0 ], &cache_val );
-                if ( rc == 0 )
-                {
-                    continue;
-                }
-                else if ( !( GetRCObject( rc ) == rcItem && GetRCState( rc ) == rcNotFound ) )
-                {
-                    break;
-                }
-                else
-                {
-                    /* avoid multiple lookups in cache */
-                    cache_miss = true;
-                }
-            }
-#endif /* USE_MATE_CACHE */
-            rc = VCursorCellDataDirect( curs->vcurs, row_id, c->idx, NULL, &c->base.v, NULL, &c->len );
-            if ( rc == 0 )
-            {
-                if ( idx == alg_SEQ_SPOT_ID && ( c->len  ==0 || c->base.i64[ 0 ] == 0 ) )
-                {
-                    return RC( rcExe, rcColumn, rcReading, rcRow, rcNotFound );
-                }
-                if ( idx == alg_MATE_ALIGN_ID )
-                {
-                    mate_id = &cols[ alg_MATE_ALIGN_ID ];
-                }
-#if _DEBUGGING
-                ( ( SCurs* )curs )->col_reads_qty++;
-#endif
-            }
-        }
-        else
-        {
-            static INSDC_coord_zero readStart;
-            static INSDC_coord_len  readLen;
-            static INSDC_coord_len  cigarLen;
-            
-            switch ( (int)idx )
-            {
-            case alg_READ_START:
-                readStart = 0;
-                c->base.coord0 = &readStart;
-                c->len = 1;
-                break;
-            case alg_READ_LEN:
-                readLen = cols[ alg_READ ].len;
-                c->base.coord_len = &readLen;
-                c->len = 1;
-                break;
-            case alg_CIGAR_LEN:
-                cigarLen = cols[ alg_CIGAR ].len;
-                c->base.coord_len = &cigarLen;
-                c->len = 1;
-                break;
-            }
-        }
-    }
-
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogWarn, ( klogWarn, rc, "reading $(t) row $(r), column $(c)", "t=%s,r=%li,c=%s",
-            curs->tbl->name, row_id, c ? c->name : "<none>" ) );
-#if USE_MATE_CACHE
-    }
-    else if ( curs->cache == NULL )
-    {
-    }
-    else if ( cache_val == 0 )
-    {
-        /* this row is not from cache */
-        int64_t mate_align_id = ( mate_id != NULL && mate_id->len > 0 ) ? mate_id->base.i64[ 0 ] : 0;
-        if ( cols[ 0 ].idx != 0 && /* we have full cursor which means we are reading alignment table */
-            /* no mate -> unaligned (not secondary!) */
-            ( ( mate_align_id == 0 && param->unaligned && curs->cache != &curs->cache_local ) ||
-            /* 2nd mate with higher rowid and more than set gap rows away */
-              ( mate_align_id != 0 && mate_align_id > row_id && ( mate_align_id - row_id) > param->mate_row_gap_cachable ) ) )
-        {
-          rc = Cache_Add( row_id, curs, cols );
-        }
-	if(param->unaligned == true && mate_align_id == 0 ){
-	  rc = KVectorSetBool( curs->cache->cache_unaligned_mate, cols[alg_SEQ_SPOT_ID].base.i64[0], true );
-        }
-    }
-    else
-    {
-        Cache_Unpack( cache_val, row_id, curs, cols );
-#endif /* USE_MATE_CACHE */
-    }
-    return rc;
-}
-
-
-static rc_t DumpName( char const *name, size_t name_len,
-                      const char spot_group_sep, char const *spot_group,
-                      size_t spot_group_len, int64_t spot_id )
-{
-    rc_t rc = 0;
-    if ( param->cg_friendly_names )
-    {
-        rc = KOutMsg( "%.*s-1:%lu", spot_group_len, spot_group, spot_id );
-    }
-    else
-    {
-        if ( param->name_prefix != NULL )
-        {
-            rc = KOutMsg( "%s.", param->name_prefix );
-        }
-        rc = BufferedWriter( NULL, name, name_len, NULL );
-        if ( rc == 0 && param->spot_group_in_name && spot_group_len > 0 )
-        {
-            rc = BufferedWriter( NULL, &spot_group_sep, 1, NULL );
-            if ( rc == 0 )
-                rc = BufferedWriter( NULL, spot_group, spot_group_len, NULL );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t DumpQuality( char const quality[], unsigned const count, bool const reverse, bool const quantize )
-{
-    rc_t rc = 0;
-    if ( quality == NULL )
-    {
-        unsigned i;
-
-        for ( i = 0; rc == 0 && i < count; ++i )
-        {
-            char const newValue = ((param->qualQuant && param->qualQuantSingle)?param->qualQuantSingle:30) + 33;
-            rc = BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else if ( reverse || quantize )
-    {
-        unsigned i;
-
-        for ( i = 0; rc == 0 && i < count; ++i )
-        {
-            char const qual = quality[ reverse ? ( count - i - 1 ) : i ];
-            char const newValue = quantize ? param->qualQuant[ qual - 33 ] + 33 : qual;
-
-            rc = BufferedWriter( NULL, &newValue, 1, NULL );
-        }
-    }
-    else
-    {
-        rc = BufferedWriter( NULL, quality, count, NULL );
-    }
-    return rc;
-}
-
-
-static rc_t DumpUnalignedFastX( const SCol cols[], uint32_t read_id, INSDC_coord_zero readStart, INSDC_coord_len readLen, int64_t row_id )
-{
-    /* fast[AQ] represnted in SAM fields:
-       [@|>]QNAME unaligned
-       SEQ
-       +
-       QUAL
-    */
-    rc_t rc = BufferedWriter( NULL, param->fastq ? "@" : ">", 1, NULL );
-
-    /* QNAME: [PFX.]SEQUENCE:NAME[#SPOT_GROUP] */
-    if ( rc == 0 )
-        rc = DumpName( cols[ seq_NAME ].base.str, cols[ seq_NAME ].len, '#',
-                       cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, row_id );
-    if ( rc == 0 && read_id > 0 )
-    {
-        rc = KOutMsg( "/%u", read_id );
-    }
-    if ( rc == 0 )
-        rc = BufferedWriter( NULL, " unaligned\n", 11, NULL );
-
-    /* SEQ: SEQUENCE.READ */
-    if ( rc == 0 )
-        rc = BufferedWriter( NULL, &cols[ seq_READ ].base.str[readStart], readLen, NULL );
-    if ( rc == 0 && param->fastq )
-    {
-        /* QUAL: SEQUENCE.QUALITY */
-        rc = BufferedWriter( NULL, "\n+\n", 3, NULL );
-        if ( rc == 0 )
-            rc = DumpQuality( &cols[ seq_QUALITY ].base.str[ readStart ], readLen, false, param->quantizeQual );
-    }
-    if ( rc == 0 )
-        rc = BufferedWriter( NULL, "\n", 1, NULL );
-    return rc;
-}
-
-
-static rc_t DumpAlignedFastX( const SCol cols[], int64_t const alignId, uint32_t read_id, bool primary, bool secondary )
-{
-    rc_t rc = 0;
-    size_t nm;
-    unsigned readId;
-    unsigned const nreads = cols[ alg_READ_LEN ].len;
-
-    for ( readId = 0; readId < nreads && rc == 0 ; ++readId )
-    {
-        char const *qname = cols[ alg_SEQ_NAME ].base.str;
-        size_t qname_len = cols[ alg_SEQ_NAME ].len;
-        char synth_qname[ 40 ];
-        int64_t const spot_id = cols[alg_SEQ_SPOT_ID].len > 0 ? cols[alg_SEQ_SPOT_ID].base.i64[0] : 0;
-        char const *const read = cols[ alg_READ ].base.str + cols[ alg_READ_START ].base.coord0[ readId ];
-        char const *const qual = cols[ alg_SAM_QUALITY ].base.v
-                               ? cols[ alg_SAM_QUALITY ].base.str + cols[ alg_READ_START ].base.coord0[ readId ]
-                               : NULL;
-        unsigned const readlen = cols[ alg_READ_LEN ].base.coord_len[ readId ];
-
-        /* fast[AQ] represnted in SAM fields:
-           [@|>]QNAME primary|secondary ref=RNAME pos=POS mapq=MAPQ
-           SEQ
-           +
-           QUAL
-        */
-        rc = BufferedWriter( NULL, param->fastq ? "@" : ">", 1, NULL );
-        /* QNAME: [PFX.]SEQ_NAME[#SPOT_GROUP] */
-        if ( qname_len == 0 || qname == NULL )
-        {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "%li.%u", alignId, readId + 1 );
-            qname = synth_qname;
-        }
-        nm = cols[ alg_SPOT_GROUP ].len ? alg_SPOT_GROUP : alg_SEQ_SPOT_GROUP;
-        if ( rc == 0 )
-            rc = DumpName( qname, qname_len, '.', cols[ nm ].base.str, cols[ nm ].len, spot_id);
-
-        if ( rc == 0 && read_id > 0 )
-            rc = KOutMsg( "/%u", read_id );
-
-        if ( rc == 0 )
-        {
-            if ( primary )
-            {
-                rc = BufferedWriter( NULL, " primary", 8, NULL );
-            }
-            else if ( secondary )
-            {
-                rc = BufferedWriter( NULL, " secondary", 10, NULL );
-            }
-        }
-
-        /* RNAME: REF_NAME or REF_SEQ_ID */
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, " ref=", 5, NULL );
-        if ( rc == 0 )
-        {
-            if ( param->use_seqid )
-            {
-                rc = BufferedWriter( NULL, cols[ alg_REF_SEQ_ID ].base.str, cols[ alg_REF_SEQ_ID ].len, NULL );
-            }
-            else
-            {
-                rc = BufferedWriter( NULL, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len, NULL );
-            }
-        }
-
-        /* POS: REF_POS, MAPQ: MAPQ */
-        if ( rc == 0 )
-            rc = KOutMsg( " pos=%u mapq=%i\n", cols[ alg_REF_POS ].base.coord0[ 0 ] + 1, cols[ alg_MAPQ ].base.i32[ 0 ] );
-        
-        /* SEQ: READ */
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, read, readlen, NULL );
-        if ( rc == 0 && param->fastq )
-        {
-            /* QUAL: SAM_QUALITY */
-            rc = BufferedWriter( NULL, "\n+\n", 3, NULL );
-            if ( rc == 0 )
-                rc = DumpQuality( qual, readlen, false, param->quantizeQual );
-        }
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, "\n", 1, NULL );
-    }
-    return rc;
-}
-
-
-static
-rc_t DumpUnalignedSAM( const SCol cols[], uint32_t flags, INSDC_coord_zero readStart, INSDC_coord_len readLen,
-                       char const *rnext, uint32_t rnext_len, INSDC_coord_zero pnext, char const readGroup[], int64_t row_id )
-{
-    unsigned i;
-
-    /* QNAME: [PFX.]NAME[.SPOT_GROUP] */
-    rc_t rc = DumpName( cols[ seq_NAME ].base.str, cols[ seq_NAME ].len, '.',
-              cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, row_id );
-
-    /* all these fields are const text for now */
-    if ( rc == 0 )
-        rc = KOutMsg( "\t%u\t*\t0\t0\t*\t%.*s\t%u\t0\t",
-             flags, rnext_len ? rnext_len : 1, rnext_len ? rnext : "*", pnext );
-    /* SEQ: SEQUENCE.READ */
-    if ( flags & 0x10 )
-    {
-        for( i = 0; i < readLen && rc == 0; i++ )
-        {
-            char base;
-
-            DNAReverseCompliment( &cols[ seq_READ ].base.str[ readStart + readLen - 1 - i ], &base, 1 );
-            rc = BufferedWriter( NULL, &base, 1, NULL );
-        }
-    }
-    else
-    {
-        rc = BufferedWriter( NULL, &cols[ seq_READ ].base.str[ readStart ], readLen, NULL );
-    }
-
-    if ( rc == 0 )
-        rc = BufferedWriter( NULL, "\t", 1, NULL );
-    /* QUAL: SEQUENCE.QUALITY */
-    if ( rc == 0 )
-        rc = DumpQuality( &cols[ seq_QUALITY ].base.str[ readStart ], readLen, flags & 0x10, param->quantizeQual );
-
-    /* optional fields: */
-    if ( rc == 0 )
-    {
-        if ( readGroup )
-        {
-            rc = BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-            if ( rc == 0 )
-                rc = BufferedWriter( NULL, readGroup, string_size( readGroup ), NULL );
-        }
-        else if ( cols[ seq_SPOT_GROUP ].len > 0 )
-        {
-            /* read group */
-            rc = BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-            if ( rc == 0 )
-                rc = BufferedWriter( NULL, cols[ seq_SPOT_GROUP ].base.str, cols[ seq_SPOT_GROUP ].len, NULL );
-        }
-    }
-    if ( rc == 0 )
-        rc = BufferedWriter( NULL, "\n", 1, NULL );
-    return rc;
-}
-
-
-static
-rc_t DumpAlignedSAM( SAM_dump_ctx_t *const ctx,
-                     DataSource const *ds,
-                     int64_t alignId,
-                     char const readGroup[],
-                     int type)
-{
-    rc_t rc = 0;
-    unsigned const nreads = ds->cols[ alg_READ_LEN ].len;
-    SCol const *const cols = ds->cols;
-    int64_t const spot_id = cols[alg_SEQ_SPOT_ID].len > 0 ? cols[alg_SEQ_SPOT_ID].base.i64[0] : 0;
-    INSDC_coord_one const read_id = cols[alg_SEQ_READ_ID].len > 0 ? cols[alg_SEQ_READ_ID].base.coord1[0] : 0;
-    INSDC_SRA_read_filter const *align_filter = cols[alg_READ_FILTER].len == nreads ? cols[alg_READ_FILTER].base.read_filter : NULL;
-    INSDC_SRA_read_filter seq_filter = 0;
-    unsigned readId;
-    unsigned cigOffset = 0;
-    
-    if ( align_filter == NULL && spot_id && read_id && ctx->seq.cols )
-    {
-        rc_t rc;
-        
-        rc = Cursor_Read(&ctx->seq, spot_id, seq_READ_FILTER, 1);
-        if (rc == 0 && ctx->seq.cols[seq_READ_FILTER].len >= read_id)
-            seq_filter = ctx->seq.cols[seq_READ_FILTER].base.read_filter[read_id - 1];
-    }
-
-    for ( readId = 0; readId < nreads && rc == 0 ; ++readId )
-    {
-        char const *qname = cols[ alg_SEQ_NAME ].base.str;
-        size_t qname_len = cols[ alg_SEQ_NAME ].len;
-        char const *const read = cols[ alg_READ ].base.str + cols[ alg_READ_START ].base.coord0[ readId ];
-        char const *const qual = cols[ alg_SAM_QUALITY ].base.v
-                               ? cols[ alg_SAM_QUALITY ].base.str + cols[ alg_READ_START ].base.coord0[ readId ]
-                               : NULL;
-        unsigned const readlen = nreads > 1 ? cols[ alg_READ_LEN ].base.coord_len[ readId ] : cols[ alg_READ ].len;
-        unsigned const sflags = cols[ alg_SAM_FLAGS ].base.v ? cols[ alg_SAM_FLAGS ].base.u32[ readId ] : 0;
-        INSDC_SRA_read_filter const filt = align_filter ? align_filter[readId] : seq_filter;
-        unsigned const flags = (sflags & ~((unsigned)0x200)) | ((filt == SRA_READ_FILTER_REJECT) ? 0x200 : 0);
-        char const *const cigar = cols[ alg_CIGAR ].base.str + cigOffset;
-        unsigned const cigLen = nreads > 1 ? cols[ alg_CIGAR_LEN ].base.coord_len[ readId ] : cols[ alg_CIGAR ].len;
-        size_t nm;
-        char synth_qname[1024];
-        
-        cigOffset += cigLen;
-        if ( qname_len == 0 || qname == NULL )
-        {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "ALLELE_%li.%u", alignId, readId + 1 );
-            qname = synth_qname;
-        }
-        else if (ds->type == edstt_EvidenceAlignment) {
-            string_printf( synth_qname, sizeof( synth_qname ), &qname_len, "%u/ALLELE_%li.%u", spot_id, cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-            qname = synth_qname;
-        }
-        nm = cols[ alg_SPOT_GROUP ].len ? alg_SPOT_GROUP : alg_SEQ_SPOT_GROUP;
-        rc = DumpName( qname, qname_len, '.', cols[ nm ].base.str, cols[ nm ].len, spot_id );
-
-        /* FLAG: SAM_FLAGS */
-        if ( rc == 0 )
-        {
-            if ( ds->type == edstt_EvidenceAlignment )
-            {
-                bool const cmpl = cols[alg_REVERSED].base.v && readId < cols[alg_REVERSED].len ? cols[alg_REVERSED].base.tf[readId] : false;
-                rc = KOutMsg( "\t%u\t", 1 | (cmpl ? 0x10 : 0) | (read_id == 1 ? 0x40 : 0x80) );
-            }
-            else if ( !param->unaligned      /** not going to dump unaligned **/
-                 && ( flags & 0x1 )     /** but we have sequenced multiple fragments **/
-                 && ( flags & 0x8 ) )   /** and not all of them align **/
-            {
-                /*** remove flags talking about multiple reads **/
-                /* turn off 0x001 0x008 0x040 0x080 */
-                rc = KOutMsg( "\t%u\t", flags & ~0xC9 );
-            }
-            else
-            {
-                rc = KOutMsg( "\t%u\t", flags );
-            }
-        }
-
-        if ( rc == 0 )
-        {
-            if ( ds->type == edstt_EvidenceAlignment && type == 0 )
-            {
-                rc = KOutMsg( "ALLELE_%li.%u", cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-            }
-            else
-            {
-                /* RNAME: REF_NAME or REF_SEQ_ID */
-                if ( param->use_seqid )
-                    rc = BufferedWriter( NULL, cols[ alg_REF_SEQ_ID ].base.str, cols[ alg_REF_SEQ_ID ].len, NULL );
-                else
-                    rc = BufferedWriter( NULL, cols[ alg_REF_NAME ].base.str, cols[ alg_REF_NAME ].len, NULL );
-            }
-        }
-
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, "\t", 1, NULL );
-        
-        /* POS: REF_POS */
-        if ( rc == 0 )
-            rc = KOutMsg( "%i\t", cols[ alg_REF_POS ].base.coord0[ 0 ] + 1 );
-
-        /* MAPQ: MAPQ */
-        if ( rc == 0 )
-            rc = KOutMsg( "%i\t", cols[ alg_MAPQ ].base.i32[ 0 ] );
-
-        /* CIGAR: CIGAR_* */
-        if ( ds->type == edstt_EvidenceInterval )
-        {
-            unsigned i;
-            
-            for ( i = 0; i != cigLen && rc == 0; ++i )
-            {
-                char ch = cigar[i];
-                if ( ch == 'S' ) ch = 'I';
-                rc = BufferedWriter(NULL, &ch, 1, NULL);
-            }
-        }
-        else
-        {
-            if ( rc == 0 )
-                rc = BufferedWriter( NULL, cigar, cigLen, NULL );
-        }
-
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, "\t", 1, NULL );
-        
-        /* RNEXT: MATE_REF_NAME or '*' */
-        /* PNEXT: MATE_REF_POS or 0 */
-        if ( rc == 0 )
-        {
-            if ( cols[ alg_MATE_REF_NAME ].len )
-            {
-                if ( cols[ alg_MATE_REF_NAME ].len == cols[ alg_REF_NAME ].len &&
-                    memcmp( cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len ) == 0 )
-                {
-                    rc = BufferedWriter( NULL, "=\t", 2, NULL );
-                }
-                else
-                {
-                    rc = BufferedWriter( NULL, cols[ alg_MATE_REF_NAME ].base.str, cols[ alg_MATE_REF_NAME ].len, NULL );
-                    if ( rc == 0 )
-                        rc = BufferedWriter( NULL, "\t", 1, NULL );
-                }
-                if ( rc == 0 )
-                    rc = KOutMsg( "%u\t", cols[ alg_MATE_REF_POS ].base.coord0[ 0 ] + 1 );
-            }
-            else
-            {
-                rc = BufferedWriter( NULL, "*\t0\t", 4, NULL );
-            }
-        }
-
-        /* TLEN: TEMPLATE_LEN */
-        if ( rc == 0 )
-            rc = KOutMsg( "%i\t", cols[ alg_TEMPLATE_LEN ].base.v ? cols[ alg_TEMPLATE_LEN ].base.i32[ 0 ] : 0 );
-
-        /* SEQ: READ */
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, read, readlen, NULL );
-        if ( rc == 0 )
-            rc = BufferedWriter( NULL, "\t", 1, NULL );
-
-        /* QUAL: SAM_QUALITY */
-        if ( rc == 0 )
-            rc = DumpQuality( qual, readlen, false, param->quantizeQual );
-    
-        /* optional fields: */
-        if ( rc == 0 && ds->type == edstt_EvidenceInterval )
-            rc = KOutMsg( "\tRG:Z:ALLELE_%u", readId + 1 );
-
-        if ( rc == 0 )
-        {
-            if ( readGroup )
-            {
-                rc = BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-                if ( rc == 0 )
-                    rc = BufferedWriter( NULL, readGroup, string_size( readGroup ), NULL );
-            }
-            else if ( cols[ alg_SPOT_GROUP ].len > 0 )
-            {
-                /* read group */
-                rc = BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-                if ( rc == 0 )
-                    rc = BufferedWriter( NULL, cols[ alg_SPOT_GROUP ].base.str, cols[ alg_SPOT_GROUP ].len, NULL );
-            }
-            else if ( cols[ alg_SEQ_SPOT_GROUP ].len > 0 )
-            {
-                /* backward compatibility */
-                rc = BufferedWriter( NULL, "\tRG:Z:", 6, NULL );
-                if ( rc == 0 )
-                    rc = BufferedWriter( NULL, cols[ alg_SEQ_SPOT_GROUP ].base.str, cols[ alg_SEQ_SPOT_GROUP ].len, NULL );
-            }
-        }
-
-        if ( rc == 0 && param->cg_style > 0 && cols[ alg_CG_TAGS_STR ].len > 0 )
-            rc = BufferedWriter( NULL, cols[ alg_CG_TAGS_STR ].base.str, cols[ alg_CG_TAGS_STR ].len, NULL );
-
-        if ( rc == 0 )
-        {
-            if ( param->cg_style > 0 && cols[ alg_ALIGN_GROUP ].len > 0 )
-            {
-                char const *ZI = cols[ alg_ALIGN_GROUP ].base.str;
-                unsigned i;
-                
-                for ( i = 0; rc == 0 && i < cols[ alg_ALIGN_GROUP ].len - 1; ++i )
-                {
-                    if ( ZI[ i ] == '_' )
-                    {
-                        rc = KOutMsg( "\tZI:i:%.*s\tZA:i:%.1s", i, ZI, ZI + i + 1 );
-                        break;
-                    }
-                }
-            }
-            else if ( ds->type == edstt_EvidenceAlignment && type == 1 )
-            {
-                rc = KOutMsg( "\tZI:i:%li\tZA:i:%u", cols[ alg_REF_ID ].base.i64[ readId ], cols[ alg_REF_PLOIDY ].base.u32[ readId ] );
-            }
-        }
-
-        /* align id */
-        if ( rc == 0 && param->xi )
-            rc = KOutMsg( "\tXI:i:%li", alignId );
-
-        /* hit count */
-        if ( rc == 0 && cols[alg_ALIGNMENT_COUNT].len )
-            rc = KOutMsg( "\tNH:i:%i", (int)cols[ alg_ALIGNMENT_COUNT ].base.u8[ readId ] );
-
-        /* edit distance */
-        if ( rc == 0 && cols[ alg_EDIT_DISTANCE ].len )
-            rc = KOutMsg( "\tNM:i:%i", cols[ alg_EDIT_DISTANCE ].base.i32[ readId ] );
-
-        if ( rc == 0 )
-            rc = KOutMsg( "\n" );
-    }
-    return rc;
-}
-
-
-static rc_t DumpUnalignedReads( SAM_dump_ctx_t *const ctx, SCol const calg_col[], int64_t row_id, uint64_t* rcount )
-{
-    rc_t rc = 0;
-    uint32_t i, nreads = 0;
-
-    if ( calg_col != NULL )
-    {
-        if ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x02 )
-        {
-            /* skip all aligned rows by flag */
-            return rc;
-        }
-        /* get primary alignments only */
-        rc = Cursor_Read( &ctx->seq, calg_col[ alg_SEQ_SPOT_ID ].base.i64[ 0 ], seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-        if ( rc == 0 )
-        {
-            for ( i = 0; i < ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len; i++ )
-            {
-                if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] != 0 )
-                {
-                    if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] < row_id )
-                    {
-                        /* unaligned were printed with 1st aligment */
-                        return rc;
-                    }
-                }
-                else
-                {
-                    nreads++;
-                }
-            }
-            if ( nreads == ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len )
-            {
-                /* skip all aligned rows by actual data, if flag above is not set properly */
-                return rc;
-            }
-            row_id = calg_col[ alg_SEQ_SPOT_ID ].base.i64[ 0 ];
-        }
-    }
-    if ( rc == 0 )
-    {
-        rc = Cursor_Read( &ctx->seq, row_id, 0, ~(unsigned)0 );
-        if ( rc == 0 )
-        {
-            unsigned non_empty_reads = 0;
-            
-            nreads = ctx->seq.cols[ seq_READ_LEN ].idx != 0 ? ctx->seq.cols[ seq_READ_LEN ].len : 1;
-
-            for( i = 0; i < nreads; i++ ) {
-                unsigned const readLen = ctx->seq.cols[ seq_READ_LEN ].idx
-                                       ? ctx->seq.cols[ seq_READ_LEN ].base.coord_len[ i ]
-                                       : 0;
-                
-                if (readLen)
-                    ++non_empty_reads;
-            }
-            for( i = 0; i < nreads; i++ )
-            {
-                INSDC_coord_zero readStart;
-                INSDC_coord_len readLen;
-
-                if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].idx != 0 && 
-                     ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ] != 0 )
-                {
-                    continue;
-                }
-
-                if ( ctx->seq.cols[ seq_READ_TYPE ].idx != 0 && 
-                     !( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i ] & SRA_READ_TYPE_BIOLOGICAL ) )
-                {
-                    continue;
-                }
-
-                readLen = ctx->seq.cols[ seq_READ_LEN ].idx ? 
-                            ctx->seq.cols[ seq_READ_LEN ].base.coord_len[ i ] :
-                            ctx->seq.cols[ seq_READ ].len;
-                if ( readLen == 0 )
-                {
-                    continue;
-                }
-
-                readStart = ctx->seq.cols[ seq_READ_START ].idx ?
-                                ctx->seq.cols[ seq_READ_START ].base.coord0[ i ] :
-                                0;
-                if ( param->fasta || param->fastq )
-                {
-                    rc = DumpUnalignedFastX( ctx->seq.cols, nreads > 1 ? i + 1 : 0, readStart, readLen, row_id );
-                }
-                else
-                {
-                    uint32_t cflags = 0x4;
-                    if ( param->reverse_unaligned )
-                    {
-                        if ( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i ] & SRA_READ_TYPE_REVERSE )
-                        {
-                            cflags |= 0x10;
-                        }
-                        if ( ctx->seq.cols[ seq_READ_TYPE ].base.read_type[ i == nreads - 1 ? 0 : ( i + 1 ) ] & SRA_READ_TYPE_REVERSE )
-                        {
-                            cflags |= 0x20;
-                        }
-                    }
-                    if ( ctx->seq.cols[ seq_READ_FILTER ].idx != 0 )
-                    {
-                        if ( ctx->seq.cols[ seq_READ_FILTER ].base.read_filter[ i ] == SRA_READ_FILTER_REJECT )
-                        {
-                            cflags |= 0x200;
-                        }
-                        else if ( ctx->seq.cols[ seq_READ_FILTER ].base.read_filter[ i ] == SRA_READ_FILTER_CRITERIA )
-                        {
-                            cflags |= 0x400;
-                        }
-                    }
-                    if ( calg_col == NULL )
-                    {
-                        rc = DumpUnalignedSAM( ctx->seq.cols, cflags |
-                                          ( non_empty_reads > 1 ? ( 0x1 | 0x8 | ( i == 0 ? 0x40 : 0x00 ) | ( i == nreads - 1 ? 0x80 : 0x00 ) ) : 0x00 ),
-                                          readStart, readLen, NULL, 0, 0, ctx->readGroup, row_id );
-                    }
-                    else
-                    {
-                        int c = param->use_seqid ? alg_REF_SEQ_ID : alg_REF_NAME;
-                        uint16_t flags = cflags | 0x1 |
-                                         ( ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x10 ) << 1 ) |
-                                         ( ( calg_col[ alg_SAM_FLAGS ].base.u32[ 0 ] & 0x40 ) ? 0x80 : 0x40 );
-                        rc = DumpUnalignedSAM( ctx->seq.cols, flags, readStart, readLen,
-                                          calg_col[ c ].base.str, calg_col[ c ].len,
-                                          calg_col[ alg_REF_POS ].base.coord0[ 0 ] + 1, ctx->readGroup, row_id );
-                    }
-                }
-                *rcount = *rcount + 1;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static bool AlignRegionFilter( SCol const *cols )
-{
-    if ( param->region_qty == 0 )
-        return true;
-    if ( cols[ alg_REF_NAME ].len != 0 || cols[ alg_REF_SEQ_ID ].len != 0 )
-    {
-        unsigned i;
-
-        assert( cols[ alg_REF_POS ].len == cols[ alg_REF_LEN ].len );
-
-        for ( i = 0; i < param->region_qty; i++ )
-        {
-            unsigned j;
-            
-            for ( j = 0; j < cols[ alg_REF_POS ].len; j++ )
-            {
-                unsigned const refStart_zero = cols[ alg_REF_POS ].base.coord0[ j ];
-                unsigned const refEnd_exclusive = refStart_zero + cols[ alg_REF_LEN ].base.coord_len[ j ];
-                unsigned k;
-                
-                for ( k = 0; k < param->region[ i ].rq; k++ )
-                {
-                    unsigned const from_zero = param->region[ i ].r[ k ].from;
-                    unsigned const to_inclusive = param->region[ i ].r[ k ].to;
-                    
-                    if ( from_zero < refEnd_exclusive && refStart_zero <= to_inclusive )
-                        return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-
-static bool AlignDistanceFilter( SCol const *cols )
-{
-    if ( param->mp_dist_qty != 0 || param->mp_dist_unknown )
-    {
-        if ( cols[ alg_TEMPLATE_LEN ].len == 0 && param->mp_dist_unknown )
-        {
-            return true;
-        }
-        else
-        {
-            uint32_t i, j;
-            for( i = 0; i < param->mp_dist_qty; i++ )
-            {
-                for( j = 0; j < cols[ alg_TEMPLATE_LEN ].len; j++ )
-                {
-                    if ( ( cols[ alg_TEMPLATE_LEN ].base.i32[ j ] == 0 && param->mp_dist_unknown ) ||
-                         ( param->mp_dist[ i ].from <= cols[ alg_TEMPLATE_LEN ].base.i32[ j ] &&
-                         cols[ alg_TEMPLATE_LEN ].base.i32[ j ] <= param->mp_dist[ i ].to ) )
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-    return true;
-}
-
-
-typedef struct cgOp_s
-{
-    uint16_t length;
-    uint8_t type; /* 0: match, 1: insert, 2: delete */
-    char code;
-} cgOp;
-
-
-static void print_CG_cigar( int line, cgOp const op[], unsigned const ops, unsigned const gap[ 3 ] )
-{
-#if _DEBUGGING
-    unsigned i;
-    
-    SAM_DUMP_DBG( 3, ( "%5i: ", line ) );
-    for ( i = 0; i < ops; ++i )
-    {
-        if ( gap && ( i == gap[ 0 ] || i == gap[ 1 ] || i == gap[ 2 ] ) )
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, tolower( op[ i ].code ) ) );
-        }
-        else
-        {
-            SAM_DUMP_DBG( 3, ( "%u%c", op[ i ].length, toupper( op[ i ].code ) ) );
-        }
-    }
-    SAM_DUMP_DBG( 3, ( "\n" ) );
-#endif
-}
-
-/* gap contains the indices of the wobbles in op
- * gap[0] is between read 1 and 2; it is the 'B'
- * gap[1] is between read 2 and 3; it is an 'N'
- * gap[2] is between read 3 and 4; it is an 'N'
- */
-
-static rc_t CIGAR_to_CG_Ops( cgOp op[], unsigned const maxOps,
-                             unsigned *const opCnt,
-                             unsigned gap[ 3 ],
-                             char const cigar[], unsigned const ciglen,
-                             unsigned *const S_adjust,
-                             unsigned *const CG_adjust,
-                             unsigned const read,
-                             bool const reversed )
-{
-    unsigned i;
-    unsigned ops = 0;
-    unsigned gapno;
-
-    *opCnt = 0;
-    *S_adjust = 0;
-    for ( i = 0; i < ciglen; ++ops )
-    {
-        char opChar=0;
-        int opLen=0;
-        int n;
-
-	for(n=0;n+i<ciglen && isdigit(cigar[n+i]);n++){
-		opLen = opLen * 10 + cigar[n+i] - '0';
-	}
-	if(n+i<ciglen){
-		opChar = cigar[n+i];
-		n++;
-	}
-        if ( ops + 1 >= maxOps )
-            return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-
-        i += n;
-        
-        op[ ops ].length = opLen;
-        op[ ops ].code = opChar;
-        switch ( opChar )
-        {
-        case 'M':
-        case '=':
-        case 'X':
-            op[ ops ].type = 0;
-            break;
-        case 'S':
-            *S_adjust += opLen;
-        case 'I':
-            op[ ops ].type = 1;
-            op[ ops ].code = 'I';
-            break;
-        case 'D':
-            op[ ops ].type = 2;
-            break;
-        default:
-            return RC( rcExe, rcData, rcReading, rcConstraint, rcViolated );
-        }
-    }
-    *opCnt = ops;
-    gap[ 0 ] = gap[ 1 ] = gap[ 2 ] = ops;
-    print_CG_cigar( __LINE__, op, ops, NULL );
-    if ( ops < 3 )
-        return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-
-    {
-        unsigned fwd = 0; /* 5 10 10 10 */
-        unsigned rev = 0; /* 10 10 10 5 */
-        unsigned acc; /* accumulated length */
-        
-        if ( ( read == 1 && !reversed ) || ( read == 2 && reversed ) )
-        {
-            for ( i = 0, acc = 0; i < ops  && acc <=5; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const right = acc - 5;
-                        unsigned const left = op[ i ].length - right;
-                        
-                        memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                        ops += 2;
-                        op[ i ].length = left;
-                        op[ i + 2 ].length = right;
-                        
-                        op[ i + 1 ].type = 1;
-                        op[ i + 1 ].code = 'B';
-                        op[ i + 1 ].length = 0;
-                        
-                        fwd = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else if ( ( read == 2 && !reversed ) || ( read == 1 && reversed ) )
-        {
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i ].type == 1 )
-                    {
-                        rev = i;
-                        break;
-                    }
-                    else if ( acc > 5 )
-                    {
-                        unsigned const left = acc - 5;
-                        unsigned const right = op[ i ].length - left;
-                        
-                        memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                        ops += 2;
-                        op[ i ].length = left;
-                        op[ i + 2 ].length = right;
-                        
-                        op[ i + 1 ].type = 1;
-                        op[ i + 1 ].code = 'B';
-                        op[ i + 1 ].length = 0;
-                         
-                        rev = i + 1;
-                        break;
-                    }
-                }
-            }
-        }
-        else
-        {
-            /* fprintf(stderr, "guessing layout\n"); */
-            for ( i = 0, acc = 0; i < ops  && acc <= 5; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[ i + 1 ].type == 1 )
-                    {
-                        fwd = i + 1;
-                    }
-                }
-            }
-            for ( i = ops, acc = 0; i > 0 && acc <= 5; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc == 5 && op[i].type == 1 )
-                    {
-                        rev = i;
-                    }
-                }
-            }
-            if ( ( fwd == 0 && rev == 0 ) || ( fwd != 0 && rev != 0 ) )
-            {
-                for ( i = 0; i < ops; ++i )
-                {
-                    if ( op[ i ].type == 2 )
-                    {
-                        op[ i ].code = 'N';
-                        *CG_adjust += op[ i ].length;
-                    }
-                }
-                return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-            }
-        }
-        if ( fwd && op[ fwd ].type == 1 )
-        {
-            for ( i = ops, acc = 0; i > fwd + 1; )
-            {
-                --i;
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const r = 10 + op[ i ].length - acc;
-                            unsigned const l = op[ i ].length - r;
-                            
-                            if ( ops + 2 >= maxOps )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                            ops += 2;
-                            op[ i + 2 ].length = r;
-                            op[ i ].length = l;
-                            
-                            op[ i + 1 ].length = 0;
-                            op[ i + 1 ].type = 2;
-                            op[ i + 1 ].code = 'N';
-                            i += 2;
-                        }
-                        else if ( i - 1 > fwd )
-                        {
-                            if ( op[ i - 1 ].type == 2 )
-                                 op[ i - 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= maxOps )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &op[ i + 1 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                                ops += 1;
-                                op[ i ].length = 0;
-                                op[ i ].type = 2;
-                                op[ i ].code = 'N';
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            /** change I to B+M **/
-            op[ fwd ].code = 'B';
-            memmove( &op[ fwd + 1 ], &op[ fwd ], ( ops - fwd ) * sizeof( op[ 0 ] ) );
-            ops += 1;
-            op[ fwd + 1 ].code = 'M';
-            *opCnt = ops;
-            /** set the gaps now **/
-            for ( gapno = 3, i = ops; gapno > 1 && i > 0; )
-            {
-                --i;
-                if ( op[ i ].code == 'N' )
-                    gap[ --gapno ] = i;
-            }
-            gap[ 0 ] = fwd;
-            print_CG_cigar( __LINE__, op, ops, gap );
-            return 0;
-        }
-        if ( rev && op[ rev ].type == 1 )
-        {
-            for ( acc = i = 0; i < rev; ++i )
-            {
-                if ( op[ i ].type != 2 )
-                {
-                    acc += op[ i ].length;
-                    if ( acc >= 10 )
-                    {
-                        if ( acc > 10 )
-                        {
-                            unsigned const l = 10 + op[ i ].length - acc;
-                            unsigned const r = op[ i ].length - l;
-                            
-                            if ( ops + 2 >= maxOps )
-                                return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                            memmove( &op[ i + 2 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                            ops += 2;
-                            op[ i + 2 ].length = r;
-                            op[ i ].length = l;
-                            
-                            op[ i + 1 ].length = 0;
-                            op[ i + 1 ].type = 2;
-                            op[ i + 1 ].code = 'N';
-                            rev += 2;
-                            i += 2;
-                        }
-                        else if ( i + 1 < rev )
-                        {
-                            if ( op[ i + 1 ].type == 2)
-                                 op[ i + 1 ].code = 'N';
-                            else
-                            {
-                                if ( ops + 1 >= maxOps )
-                                    return RC( rcExe, rcData, rcReading, rcBuffer, rcInsufficient );
-                                memmove( &op[ i + 1 ], &op[ i ], ( ops - i ) * sizeof( op[ 0 ] ) );
-                                ops += 1;
-                                op[ i + 1 ].length = 0;
-                                op[ i + 1 ].type = 2;
-                                op[ i + 1 ].code = 'N';
-                                rev += 1;
-                                i += 1;
-                            }
-                        }
-                        acc = 0;
-                    }
-                }
-            }
-            for ( gapno = 3, i = 0; gapno > 1 && i < ops; ++i )
-            {
-                if ( op[ i ].code == 'N' )
-                    gap[ --gapno ] = i;
-            }
-            gap[ 0 ] = rev;
-            op[ rev ].code = 'B';
-            memmove( &op[ rev + 1 ], &op[ rev ], ( ops - rev ) * sizeof( op[ 0 ] ) );
-            ops += 1;
-            op[ rev + 1 ].code = 'M';
-            *opCnt = ops;
-            print_CG_cigar( __LINE__, op, ops, gap );
-            return 0;
-        }
-    }
-    return RC( rcExe, rcData, rcReading, rcFormat, rcNotFound ); /* CG pattern not found */
-}
-
-
-static rc_t GenerateCGData( SCol cols[], unsigned style )
-{
-    rc_t rc = 0;
-    
-    memset( &cols[ alg_CG_TAGS_STR], 0, sizeof( cols[ alg_CG_TAGS_STR ] ) );
-    
-    if ( cols[ alg_READ ].len == 35 && cols[ alg_SAM_QUALITY ].len == 35 )
-    {
-        static char newCIGAR[ 35 * 11 ];
-        static int32_t newEditDistance;
-        unsigned gap[ 3 ] = { 0, 0, 0 };
-        cgOp cigOp[ 35 ];
-        unsigned opCnt;
-        unsigned i;
-        unsigned j;
-        size_t sz;
-        unsigned S_adjust = 0;
-        unsigned CG_adjust = 0;
-        unsigned const read = cols[ alg_SEQ_READ_ID ].len && cols[ alg_REVERSED ].len ? cols[ alg_SEQ_READ_ID ].base.coord1[ 0 ] : 0;
-        bool const reversed = cols[ alg_REVERSED ].len ? cols[ alg_REVERSED ].base.u8[ 0 ] : false;
-        
-        rc = CIGAR_to_CG_Ops( cigOp, sizeof( cigOp ) / sizeof( cigOp[ 0 ] ), &opCnt, gap,
-                              cols[ alg_CIGAR ].base.str, cols[ alg_CIGAR ].len,
-                              &S_adjust, &CG_adjust, read, reversed );
-        if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcFormat )
-        {
-            rc = 0;
-            if ( style == 1 )
-                goto CLEAN_CIGAR;
-            else
-                goto PRINT_CIGAR;
-        }
-        if ( rc != 0 )
-            return 0;
-
-        if ( CG_adjust == 0 )
-            CG_adjust = ( gap[ 0 ] < opCnt ? cigOp[ gap[ 0 ] ].length : 0 )
-                      + ( gap[ 1 ] < opCnt ? cigOp[ gap[ 1 ] ].length : 0 )
-                      + ( gap[ 2 ] < opCnt ? cigOp[ gap[ 2 ] ].length : 0 );
-
-        print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-        if ( style == 1 )
-        {
-            static char newSeq[ 35 ];
-            static char newQual[ 35 ];
-            static char tags[ 35*22 + 1 ];
-            unsigned const B_len = cigOp[ gap[ 0 ] ].length;
-            unsigned const B_at = gap[ 0 ] < gap[ 2 ] ? 5 : 30;
-            
-            if ( 0 < B_len && B_len < 5 )
-            {
-                memcpy( newSeq, cols[ alg_READ ].base.v, 35 );
-                memcpy( newQual, cols[ alg_SAM_QUALITY ].base.v, 35 );
-                
-                cols[ alg_CG_TAGS_STR ].base.v = tags;
-                
-                cols[ alg_READ ].base.v = newSeq;
-                cols[ alg_READ ].len = 35 - B_len;
-                
-                cols[ alg_SAM_QUALITY ].base.v = newQual;
-                cols[ alg_SAM_QUALITY ].len = 35 - B_len;
-                
-                /* nBnM -> nB0M */
-                cigOp[ gap[ 0 ] + 1 ].length -= B_len;
-                if ( gap[ 0 ] < gap[ 2 ] )
-                {
-                    rc = string_printf( tags, sizeof( tags ), &sz, "\tGC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                        5 - B_len, B_len, 30 - B_len, 2 * B_len, &newSeq[ 5 - B_len ], 2 * B_len, &newQual[ 5 - B_len ] );
-                    if ( rc == 0 )
-                    {
-                        cols[ alg_CG_TAGS_STR ].len = sz;
-                    }
-                    memmove( &cigOp[ gap[ 0 ] ],
-                             &cigOp[ gap[ 0 ] + 1 ],
-                             ( opCnt - ( gap[ 0 ] + 1 ) ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-                else
-                {
-                    rc = string_printf( tags, sizeof( tags ), &sz, "\tGC:Z:%uS%uG%uS\tGS:Z:%.*s\tGQ:Z:%.*s",
-                        30 - B_len, B_len, 5 - B_len, 2 * B_len, &newSeq[ 30 - B_len ], 2 * B_len, &newQual[ 30 - B_len ] );
-                    if ( rc == 0 )
-                    {
-                        cols[ alg_CG_TAGS_STR ].len = sz;
-                    }
-                    memmove( &cigOp[ gap[ 0 ] ],
-                             &cigOp[ gap[ 0 ] + 1 ],
-                             ( opCnt - ( gap[ 0 ] + 1 ) ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-                if ( rc == 0 )
-                {
-                    for ( i = B_at; i < B_at + B_len; ++i )
-                    {
-                        int const Lq = newQual[ i - B_len ];
-                        int const Rq = newQual[ i ];
-
-                        if ( Lq <= Rq )
-                        {
-                            newSeq[ i - B_len ] = newSeq[ i ];
-                            newQual[ i - B_len ] = Rq;
-                        }
-                        else
-                        {
-                            newSeq[ i ] = newSeq[ i - B_len ];
-                            newQual[ i ] = Lq;
-                        }
-                    }
-                    memmove( &newSeq [ B_at ], &newSeq [ B_at + B_len ], 35 - B_at - B_len );
-                    memmove( &newQual[ B_at ], &newQual[ B_at + B_len ], 35 - B_at - B_len );
-                }
-            }
-            else
-            {
-                int len = cigOp[ gap[ 0 ] ].length;
-                
-                cigOp[ gap[ 0 ] ].code = 'I';
-                for (i = gap[0] + 1; i < opCnt && len > 0; ++i) {
-                    if (cigOp[i].length <= len){
-                        len -= cigOp[i].length;
-                        cigOp[i].length = 0;
-                    }
-                    else {
-                        cigOp[i].length -= len;
-                        len = 0;
-                    }
-                }
-                CG_adjust -= cigOp[ gap[ 0 ] ].length;
-            }
-        }
-        if ( rc == 0 )
-        {
-        PRINT_CIGAR:
-        CLEAN_CIGAR:
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            /* remove zero length ops */
-            for ( j = i = 0; i < opCnt; )
-            {
-                if ( cigOp[ j ].length == 0)
-                {
-                    ++j;
-                    --opCnt;
-                    continue;
-                }
-                cigOp[ i++ ] = cigOp[ j++ ];
-            }
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            if ( cols[ alg_EDIT_DISTANCE ].len )
-            {
-                int const edit_distance = cols[ alg_EDIT_DISTANCE ].base.i32[ 0 ];
-                int const adjusted = edit_distance + S_adjust - CG_adjust;
-            
-                newEditDistance = adjusted > 0 ? adjusted : 0;
-                SAM_DUMP_DBG( 4, ( "NM: before: %u, after: %u(+%u-%u)\n", edit_distance, newEditDistance, S_adjust, CG_adjust ) );
-                cols[ alg_EDIT_DISTANCE ].base.v = &newEditDistance;
-                cols[ alg_EDIT_DISTANCE ].len = 1;
-            }
-            /* merge adjacent ops */
-            for ( i = opCnt; i > 1; )
-            {
-                --i;
-                if ( cigOp[ i - 1 ].code == cigOp[ i ].code )
-                {
-                    cigOp[ i - 1 ].length += cigOp[ i ].length;
-                    memmove( &cigOp[ i ], &cigOp[ i + 1 ], ( opCnt - 1 - i ) * sizeof( cigOp[ 0 ] ) );
-                    --opCnt;
-                }
-            }
-            print_CG_cigar( __LINE__, cigOp, opCnt, NULL );
-            for ( i = j = 0; i < opCnt && rc == 0; ++i )
-            {
-                rc = string_printf( &newCIGAR[ j ], sizeof( newCIGAR ) - j, &sz, "%u%c", cigOp[ i ].length, cigOp[ i ].code);
-                j += sz;
-            }
-            cols[ alg_CIGAR ].base.v = newCIGAR;
-            cols[ alg_CIGAR ].len = j;
-        }
-    }
-    return rc;
-}
-
-
-static bool DumpAlignedRow( SAM_dump_ctx_t *const ctx, DataSource *const ds,
-                    int64_t row,
-                    bool const primary,
-                    int const cg_style,
-                    rc_t *prc )
-{
-    rc_t rc = 0;
-    
-    /* if SEQ_SPOT_ID is open then skip rows with no SEQ_SPOT_ID */
-    if ( ds->cols[ alg_SEQ_SPOT_ID ].idx )
-    {
-        rc = Cursor_Read( ds, row, alg_SEQ_SPOT_ID, 1 );
-        if ( rc != 0 )
-        {
-            if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-                *prc = rc;
-            return false;
-        }
-        if ( ds->cols[ alg_SEQ_SPOT_ID ].len == 0 ||
-             ds->cols[ alg_SEQ_SPOT_ID ].base.i64[ 0 ] == 0 )
-            return false;
-    }
-
-    /* skip rows that fail mate distance filter */
-    if ( param->mp_dist_qty != 0 || param->mp_dist_unknown )
-    {
-        rc = Cursor_Read( ds, row, alg_TEMPLATE_LEN, 1 );
-        if ( rc != 0 )
-        {
-            if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-                *prc = rc;
-            return false;
-        }
-        if ( !AlignDistanceFilter( ds->cols ) )
-            return false;
-    }
-
-    rc = Cursor_ReadAlign( &ds->curs, row, ds->cols, 0 );
-    if ( rc != 0 )
-    {
-        if ( !( GetRCObject( rc ) == rcRow && GetRCState( rc ) == rcNotFound ) )
-            *prc = rc;
-        return false;
-    }
-
-    if ( param->fasta || param->fastq )
-    {
-        unsigned const read_id = ds->cols[ alg_SEQ_READ_ID ].base.v ? ds->cols[ alg_SEQ_READ_ID ].base.coord1[ 0 ] : 0;
-        
-        rc = DumpAlignedFastX( ctx->pri.cols, row, read_id, primary, false );
-    }
-    else
-    {
-        if ( cg_style != 0 )
-        {
-            rc = GenerateCGData( ds->cols, cg_style );
-            if ( rc != 0 )
-            {
-                *prc = rc;
-                return false;
-            }
-        }
-        rc = DumpAlignedSAM(ctx, ds, row, ctx->readGroup, 0 );
-    }
-    *prc = rc;
-    return true;
-}
-
-
-static rc_t DumpAlignedRowList( SAM_dump_ctx_t *const ctx, DataSource *const ds, SCol const *const ids,
-                        int64_t *rcount,
-                        bool const primary,
-                        int const cg_style,
-                        bool const noFilter )
-{
-    rc_t rc;
-    unsigned i;
-    unsigned const n = ids->len;
-
-    for ( i = 0; ( rc = Quitting() ) == 0 && i < n; ++i )
-    {
-        int64_t const row = ids->base.i64[ i ];
-
-        if ( ! noFilter )
-            rc = Cursor_Read( ds, row, alg_REGION_FILTER, ~(unsigned)0 );
-
-        if ( rc == 0 )
-        {
-            if ( noFilter || AlignRegionFilter(ds->cols) )
-            {
-                if ( DumpAlignedRow( ctx, ds, row, primary, cg_style, &rc ) )
-                    ++*rcount;
-                if ( rc != 0 )
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t DumpAlignedRowListIndirect( SAM_dump_ctx_t *const ctx,
-                                DataSource *const indirectSource,
-                                DataSource *const directSource,
-                                SCol const *const directIDs,
-                                int64_t *rcount,
-                                bool const primary,
-                                int const cg_style )
-{
-    unsigned i;
-
-    for ( i = 0; i < directIDs->len; ++i )
-    {
-        int64_t const row = directIDs->base.i64[ i ];
-        rc_t rc = Cursor_Read( directSource, row, alg_REGION_FILTER, ~(unsigned)0 );
-        
-        if ( rc != 0 )
-            return rc;
-        
-        if ( !AlignRegionFilter( directSource->cols ) )
-            continue;
-            
-        rc = Cursor_Read( directSource, row, alg_EVIDENCE_ALIGNMENT_IDS, 1 );
-        if ( rc != 0 )
-            return rc;
-        
-        rc = DumpAlignedRowList( ctx, indirectSource, &directSource->cols[ alg_EVIDENCE_ALIGNMENT_IDS ],
-                                 rcount, primary, cg_style, true );
-        if ( rc != 0 )
-            return rc;
-    }
-    return 0;
-}
-
-
-enum e_tables
-{
-    primary_alignment,
-    secondary_alignment,
-    evidence_interval,
-    evidence_alignment
-};
-
-enum e_IDS_opts
-{
-    primary_IDS             = ( 1 << primary_alignment ),
-    secondary_IDS           = ( 1 << secondary_alignment ),
-    evidence_interval_IDS   = ( 1 << evidence_interval ),
-    evidence_alignment_IDS  = ( 1 << evidence_alignment )
-};
-
-
-static rc_t DumpAlignedRowList_cb( SAM_dump_ctx_t *const ctx, TAlignedRegion const *const rgn,
-                                   int options, int which, int64_t *rcount, SCol const *const IDS )
-{
-    /*SAM_DUMP_DBG(2, ("row %s index range is [%lu:%lu] pos %lu\n",
-        param->region[r].name, start, start + count - 1, cur_pos));*/
-    switch ( which )
-    {
-    case primary_IDS:
-        return DumpAlignedRowList( ctx, &ctx->pri, IDS, rcount, true, param->cg_style, false );
-
-    case secondary_IDS:
-        return DumpAlignedRowList( ctx, &ctx->sec, IDS, rcount, false, param->cg_style, false );
-
-    case evidence_interval_IDS:
-        {
-            rc_t rc = 0;
-
-            if ( ( options & evidence_interval_IDS ) != 0 )
-                rc = DumpAlignedRowList( ctx, &ctx->evi, IDS, rcount, true, 0, false );
-
-            if ( rc == 0 && ( options & evidence_alignment_IDS ) != 0 )
-                rc = DumpAlignedRowListIndirect( ctx, &ctx->eva, &ctx->evi, IDS, rcount, true, param->cg_style );
-
-            return rc;
-        }
-    }
-    return RC( rcExe, rcTable, rcReading, rcParam, rcUnexpected );
-}
-
-
-typedef struct CigOps{
-	char op;
-	int8_t	 ref_sign; /*** 0;+1;-1; ref_offset = ref_sign * offset ***/
-	int8_t	 seq_sign; /*** 0;+1;-1; seq_offset = seq_sign * offset ***/
-	uint32_t oplen;
-} CigOps;
-
-static void SetCigOp(CigOps *dst,char op,uint32_t oplen)
-{
-	dst->op    = op;
-	dst->oplen = oplen;
-	switch(op) { /*MX= DN B IS PH*/
-	 case 'M': case 'X': case '=':
-		dst->ref_sign=+1;
-		dst->seq_sign=+1;
-		break;
-	 case 'D': case 'N':
-		dst->ref_sign=+1;
-                dst->seq_sign= 0;
-                break;
-	 case 'B': 
-		dst->ref_sign=-1;
-                dst->seq_sign= 0;
-                break;
-	 case 'S': case 'I':
-		dst->ref_sign= 0;
-                dst->seq_sign=+1;
-                break;
-	 case 'P': case 'H':
-	  case 0: /** terminating op **/
-		dst->ref_sign= 0;
-                dst->seq_sign= 0;
-                break;
-	  default:
-		assert(0);
-                break;
-	}
-}
-
-static unsigned ExplodeCIGAR( CigOps dst[], unsigned len, char const cigar[], unsigned ciglen )
-{
-    unsigned i;
-    unsigned j;
-    int opLen;
-    
-    for ( i = j = opLen=0; i < ciglen; i++) {
-	if(isdigit(cigar[i])){
-		opLen = opLen * 10 + cigar[i] - '0';
-	} else {
-		assert(isalpha(cigar[i]));
-		SetCigOp(dst+j,cigar[i],opLen);
-		opLen=0;
-		j++;
-	}
-    }
-    SetCigOp(dst+j,0,0);
-    j++;
-    return j;
-}
-
-
-#define CG_CIGAR_STRING_MAX (35 * 11 + 1)
-
-
-#if 0
-static unsigned FormatCIGAR( char dst[], unsigned cp, unsigned oplen, int opcode )
-{
-    size_t sz;
-    string_printf( dst + cp, CG_CIGAR_STRING_MAX - cp, &sz, "%u%c", oplen, opcode );
-    return sz;
-}
-
-
-static unsigned DeletedCIGAR( char dst[], unsigned const cp, int opcode, unsigned D,
-                              uint32_t const Op[], int ri, unsigned len )
-{
-    unsigned i;
-    unsigned curPos = 0;
-    int curOp = opcode;
-    unsigned oplen = 0;
-    
-    for ( i = 0; i < D && ri < len; ++i, ++ri )
-    {
-        uint32_t const op = Op[ ri ];
-        int const d = op >> 2;
-        int const m = op & 1;
-        int const nxtOp = m ? opcode : 'P';
-        
-        if ( d != 0 )
-        {
-            if ( oplen != 0 )
-                curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-            curPos += FormatCIGAR( dst, cp, d, 'D' );
-            oplen = 0;
-        }
-        if ( oplen == 0 || nxtOp == curOp )
-        {
-            ++oplen;
-        }
-        else
-        {
-            curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-            oplen = 1;
-        }
-        curOp = nxtOp;
-    }
-
-    if ( oplen != 0 && curOp != opcode)
-    {
-        curPos += FormatCIGAR( dst, curPos + cp, oplen, curOp );
-        oplen = 0;
-    }
-    if ( i < D )
-        oplen += D - i;
-    if ( oplen )
-        curPos += FormatCIGAR( dst, curPos + cp, oplen, opcode );
-    return curPos;
-}
-#endif
-
-static char merge_M_type_ops(char a,char b)
-{ /*MX=*/
-	char c=0;
-	switch(b){
-	 case 'X':
-		switch(a){
-		 case '=': c='X'; break;
-		 case 'X': c='M'; break; /**we don't know - 2X may create '=' **/
-		 case 'M': c='M'; break;
-		}
-		break;
-	 case 'M':
-		c='M';
-		break;
-	 case '=':
-		c=a;
-		break;
-	}
-	assert(c!=0);
-	return c;
-}
-
-
-static unsigned CombineCIGAR( char dst[], CigOps const seqOp[], unsigned seq_len,
-                              int refPos, CigOps const refOp[], unsigned ref_len )
-{
-    bool     done=false;
-    unsigned ciglen=0,last_ciglen=0;
-    char     last_cig_op;
-    uint32_t last_cig_oplen=0;
-    int	     si=0,ri=0;
-    CigOps   seq_cop={0,0,0,0},ref_cop={0,0,0,0};
-    int	     seq_pos=0; /** seq_pos is tracked roughly - with every extraction from seqOp **/
-    int      ref_pos=0; /** ref_pos is tracked precisely - with every delta and consumption in cigar **/
-    int	     delta=refPos; /*** delta in relative positions of seq and ref **/
-			   /*** when delta < 0 - rewind or extend the reference ***/
-			   /*** wher delta > 0 - skip reference  ***/
-#define MACRO_BUILD_CIGAR(OP,OPLEN) \
-	if( last_cig_oplen > 0 && last_cig_op == OP){							\
-                last_cig_oplen += OPLEN;								\
-                ciglen = last_ciglen + sprintf(dst+last_ciglen,"%d%c",last_cig_oplen,last_cig_op);	\
-        } else {											\
-                last_ciglen = ciglen;									\
-                last_cig_oplen = OPLEN;									\
-                last_cig_op    = OP;									\
-                ciglen = ciglen      + sprintf(dst+last_ciglen,"%d%c",last_cig_oplen,last_cig_op);	\
-        }
-    while(!done){
-	while(delta < 0){ 
-		ref_pos += delta; /** we will make it to back up this way **/
-		if(ri > 0){ /** backing up on ref if possible ***/
-			int avail_oplen = refOp[ri-1].oplen - ref_cop.oplen;
-			if(avail_oplen > 0 ){
-				if((-delta) <= avail_oplen * ref_cop.ref_sign){ /*** rewind within last operation **/
-					ref_cop.oplen -= delta;
-					delta -= delta * ref_cop.ref_sign;
-				} else { /*** rewind the whole ***/
-					ref_cop.oplen += avail_oplen;
-					delta += avail_oplen * ref_cop.ref_sign;
-				}
-			} else {
-				ri--;
-				/** pick the previous as used up **/
-				ref_cop = refOp[ri-1];
-				ref_cop.oplen =0; 
-			}
-		} else { /** extending the reference **/
-			SetCigOp(&ref_cop,'=',ref_cop.oplen - delta);
-			delta = 0;
-		}
-		ref_pos -= delta; 
-	}
-	if(ref_cop.oplen == 0){ /*** advance the reference ***/
-		ref_cop = refOp[ri++];
-		if(ref_cop.oplen == 0) { /** extending beyond the reference **/
-			SetCigOp(&ref_cop,'=',1000);
-		}
-		assert(ref_cop.oplen > 0 );
-	}
-	if(delta > 0){ /***  skip refOps ***/
-		ref_pos += delta; /** may need to back up **/
-		if(delta >=  ref_cop.oplen){ /** full **/
-			delta -= ref_cop.oplen * ref_cop.ref_sign;
-			ref_cop.oplen = 0;
-		} else { /** partial **/
-			ref_cop.oplen -= delta;
-			delta -= delta * ref_cop.ref_sign;
-		}
-		ref_pos -= delta; /** if something left - restore ***/
-		continue;
-	}
-	/*** seq and ref should be synchronized here **/
-	assert(delta == 0);
-	if(seq_cop.oplen == 0){ /*** advance sequence ***/
-		if(seq_pos < seq_len){
-			seq_cop = seqOp[si++];
-			assert(seq_cop.oplen > 0 );
-			seq_pos += seq_cop.oplen * seq_cop.seq_sign;
-		} else {
-			done=true;
-		}
-	}
-        if(!done){
-		int seq_seq_step = seq_cop.oplen * seq_cop.seq_sign; /** sequence movement**/
-		int seq_ref_step = seq_cop.oplen * seq_cop.ref_sign; /** influence of sequence movement on intermediate reference **/
-		int ref_seq_step = ref_cop.oplen * ref_cop.seq_sign; /** movement of the intermediate reference ***/
-		int ref_ref_step = ref_cop.oplen * ref_cop.ref_sign; /** influence of the intermediate reference movement on final reference ***/
-		assert( ref_ref_step >= 0); /** no B in the reference **/
-		if( seq_ref_step <= 0){ /** BSIPH in the sequence against anything ***/
-			MACRO_BUILD_CIGAR( seq_cop.op, seq_cop.oplen );
-			seq_cop.oplen = 0;
-			delta = seq_ref_step; /** if negative - will force rewind next cycle **/
-		} else if(ref_ref_step <= 0){ /** MX=DN against SIPH in the reference***/
-			if(ref_seq_step == 0){ /** MX=DN against PH **/
-				MACRO_BUILD_CIGAR( ref_cop.op,ref_cop.oplen);
-				ref_cop.oplen = 0;
-			} else {
-				int min_len = (seq_cop.oplen<ref_cop.oplen)?seq_cop.oplen:ref_cop.oplen;
-				if(seq_seq_step == 0){ /** DN agains SI **/
-					MACRO_BUILD_CIGAR('P',min_len);
-				} else { /** MX= agains SI ***/
-					MACRO_BUILD_CIGAR( ref_cop.op,min_len);
-				}
-				seq_cop.oplen -= min_len;
-				ref_cop.oplen -= min_len;
-			}
-		} else { /*MX=DN  against MX=DN*/
-			int min_len = (seq_cop.oplen<ref_cop.oplen)?seq_cop.oplen:ref_cop.oplen;
-			if(seq_seq_step == 0){ /* DN against MX=DN */
-				if(ref_seq_step == 0){ /** padding DN against DN **/
-					MACRO_BUILD_CIGAR('P',min_len);
-					ref_cop.oplen -= min_len;
-					seq_cop.oplen -= min_len;
-				} else { /* DN against MX= **/
-					MACRO_BUILD_CIGAR(seq_cop.op,min_len);
-					seq_cop.oplen -= min_len;
-				}
-			} else if (ref_cop.seq_sign == 0){ /* MX= against DN - always wins */
-				MACRO_BUILD_CIGAR(ref_cop.op,min_len);
-				ref_cop.oplen -= min_len;
-			} else { /** MX= against MX= ***/
-				MACRO_BUILD_CIGAR(merge_M_type_ops(seq_cop.op,ref_cop.op),min_len);
-				ref_cop.oplen -= min_len;
-				seq_cop.oplen -= min_len;
-			}
-			ref_pos += min_len;
-		}
-        }
-    }
-    return ciglen;
-}
-
-
-static rc_t DumpCGSAM( SAM_dump_ctx_t *const ctx, TAlignedRegion const *const rgn, int options,
-                       int which, int64_t *rows, SCol const *const ids )
-{
-    if ( which == evidence_interval_IDS )
-    {
-        rc_t rc = 0;
-        unsigned i;
-        
-        for ( i = 0; i < ids->len; ++i )
-        {
-            int64_t const rowInterval = ids->base.i64[ i ];
-
-            rc = Cursor_Read( &ctx->evi, rowInterval, alg_REGION_FILTER, ~(0u) );
-            if ( rc == 0 )
-            {
-                if ( AlignRegionFilter( ctx->evi.cols ) )
-                {
-                    rc = Cursor_ReadAlign( &ctx->evi.curs, rowInterval, ctx->evi.cols, 0 );
-                    if ( rc == 0 )
-                    {
-                        unsigned const evidence = ctx->evi.cols[ alg_EVIDENCE_ALIGNMENT_IDS ].len;
-                        if ( evidence != 0 )
-                        {
-                            INSDC_coord_len const *const refLen = ctx->evi.cols[ alg_READ_LEN ].base.coord_len;
-                            INSDC_coord_len const *const cigLen = ctx->evi.cols[ alg_CIGAR_LEN ].base.coord_len;
-                            unsigned const ploids = ctx->evi.cols[ alg_CIGAR_LEN ].len;
-                            unsigned const totalIntervalReadLen = ctx->evi.cols[ alg_READ ].len;
-			    CigOps  refCigOps_stack[1024];
-			    CigOps *refCigOps_heap=NULL;
-                            CigOps *refCigOps;
-
-			    if( totalIntervalReadLen > 1000){
-				refCigOps=refCigOps_heap = malloc( sizeof( refCigOps[ 0 ] ) * (totalIntervalReadLen+ploids) );
-			    } else {
-				refCigOps=refCigOps_stack;
-			    }
-                            
-                            if ( refCigOps != NULL )
-                            {
-                                unsigned j;
-                                unsigned start;
-                                unsigned cigop_starts[256];
-                                
-                                assert(ploids < 256);
-                                
-                                for ( start = j = 0, cigop_starts[0]=0; j < ploids; ++j )
-                                {
-                                    unsigned len = cigLen[ j ];
-                                    cigop_starts[j+1] = cigop_starts[j] + ExplodeCIGAR( refCigOps + cigop_starts[j], refLen[ j ], 
-                                                                                       ctx->evi.cols[ alg_CIGAR ].base.str + start, len );
-                                    start += len;
-                                }
-                                
-                                for ( j = 0; j < evidence; ++j )
-                                {
-                                    int64_t const rowAlign = ctx->evi.cols[ alg_EVIDENCE_ALIGNMENT_IDS ].base.i64[ j ];
-                                    
-                                    rc = Cursor_ReadAlign( &ctx->eva.curs, rowAlign, ctx->eva.cols, 0 );
-                                    if ( rc == 0 )
-                                    {
-                                        if(param->cg_style != 0)
-                                            rc = GenerateCGData( ctx->eva.cols, param->cg_style );
-                                        if ( rc == 0 )
-                                        {
-                                            int const ploidy = ctx->eva.cols[ alg_REF_PLOIDY ].base.u32[ 0 ];
-                                            int const readLen = ctx->eva.cols[ alg_READ ].len;
-                                            INSDC_coord_zero refPos = ctx->eva.cols[ alg_REF_POS ].base.coord0[ 0 ];
-                                            CigOps op[ 36 ];
-                                            char cigbuf[ CG_CIGAR_STRING_MAX ];
-                                            
-                                            memset( cigbuf, 0, CG_CIGAR_STRING_MAX );
-                                            ExplodeCIGAR( op, readLen, ctx->eva.cols[ alg_CIGAR ].base.str,
-                                                         ctx->eva.cols[ alg_CIGAR ].len );
-                                            ctx->eva.cols[ alg_CIGAR ].len = CombineCIGAR( cigbuf, op, readLen, refPos, 
-                                                                                          refCigOps + cigop_starts[ ploidy - 1 ], refLen[ ploidy - 1 ] );
-                                            ctx->eva.cols[ alg_CIGAR ].base.str = cigbuf;
-                                            ctx->eva.cols[ alg_REF_POS ].base.v = &refPos;
-                                            refPos += ctx->evi.cols[ alg_REF_POS ].base.coord0[ 0 ] ;
-			  		    if(refPos < 0){
-						ReferenceObj const *r = NULL;
-    						rc = ReferenceList_Find( gRefList, &r,
-									ctx->evi.cols[ alg_REF_NAME ].base.str,
-									ctx->evi.cols[ alg_REF_NAME ].len );
-						if(rc == 0){
-							bool circular=false;
-							rc=ReferenceObj_Circular(r, &circular);
-							if(rc == 0 && circular){
-								INSDC_coord_len len;
-								rc=ReferenceObj_SeqLength(r,&len);
-								if(rc == 0)
-									refPos += len;
-							}
-							ReferenceObj_Release(r);
-						}
-					    }
-                                            rc = DumpAlignedSAM( ctx, &ctx->eva, rowAlign, ctx->readGroup, 1 );
-                                            ++*rows;
-                                        }
-                                        else
-                                            break;
-                                    }
-                                    else
-                                        break;
-                                }
-				if(refCigOps_heap) free( refCigOps_heap );
-                            }
-                            else
-                                rc = RC( rcExe, rcTable, rcReading, rcMemory, rcExhausted );
-                        }
-                    }
-                }
-            }
-            else
-                break;
-            rc = rc ? rc : Quitting();
-            if ( rc != 0 )
-                break;
-        }
-        return rc;
-    }
-    return RC( rcExe, rcTable, rcReading, rcParam, rcUnexpected );
-}
-
-
-static rc_t ForEachAlignedRegion( SAM_dump_ctx_t *const ctx, enum e_IDS_opts const Options,
-    rc_t ( *user_func )( SAM_dump_ctx_t *ctx, TAlignedRegion const *rgn, int options, int which, int64_t *rows, SCol const *IDS ) )
-{
-    SCol cols[] =
-    {
-        { "MAX_SEQ_LEN", 0, { NULL }, 0, false },
-        { "OVERLAP_REF_POS", 0, { NULL }, 0, true },
-        { "PRIMARY_ALIGNMENT_IDS", 0, { NULL }, 0, false },
-        { "SECONDARY_ALIGNMENT_IDS", 0, { NULL }, 0, true },
-        { "EVIDENCE_INTERVAL_IDS", 0, { NULL }, 0, true }, 
-        { NULL, 0, { NULL }, 0, false }
-    };
-    enum eref_col
-    {
-        ref_MAX_SEQ_LEN = 0,
-        ref_OVERLAP_REF_LEN,
-        ref_PRIMARY_ALIGNMENT_IDS,
-        ref_SECONDARY_ALIGNMENT_IDS,
-        ref_EVIDENCE_INTERVAL_IDS
-    };
-
-    KIndex const *iname = NULL;
-    int64_t rows = 0;
-    rc_t rc = 0;
-    int options = Options & 7;
-
-    if ( Options & evidence_alignment_IDS )
-        options |= evidence_interval_IDS;
-
-    if ( ( options & primary_IDS ) == 0 )
-        cols[ ref_PRIMARY_ALIGNMENT_IDS ].name = "";
-    if ( ( options & secondary_IDS ) == 0 )
-        cols[ ref_SECONDARY_ALIGNMENT_IDS ].name = "";
-    if ( ( options & evidence_interval_IDS ) == 0 )
-        cols[ ref_EVIDENCE_INTERVAL_IDS ].name = "";
-    
-    ctx->ref.cols = cols;
-    
-    rc = VTableOpenIndexRead( ctx->ref.tbl.vtbl, &iname, "i_name" );
-    if ( rc == 0 )
-    {
-        rc = Cursor_Open( &ctx->ref.tbl, &ctx->ref.curs, ctx->ref.cols, NULL );
-        if ( rc == 0 )
-        {
-            int64_t rowid = 1;
-            uint64_t count = 0;
-            char refname[ 1024 ];
-            size_t sz;
-            
-            if ( ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS ].idx == 0 )
-                options &= ~primary_IDS;
-            if ( ctx->ref.cols[ ref_SECONDARY_ALIGNMENT_IDS ].idx == 0 )
-                options &= ~secondary_IDS;
-            if ( ctx->ref.cols[ ref_EVIDENCE_INTERVAL_IDS ].idx == 0 )
-                options &= ~evidence_interval_IDS;
-
-            /* new: if we have a list of regions, reset the their print-flag */
-            if ( param->region_qty > 0 )
-            {
-                unsigned r;
-                for ( r = 0; r < param->region_qty; ++r )
-                {
-                    param->region[ r ].printed = 0;
-                }
-            }
-
-            while ( ( rc = KIndexProjectText(iname, rowid + count, &rowid, &count, refname, sizeof( refname ), &sz ) ) == 0 )
-            {
-                bool include;
-                unsigned r;
-                unsigned max_to = UINT_MAX;
-                unsigned min_from = 0;
-                
-                for ( include = false, r = 0; r < param->region_qty; ++r )
-                {
-                    if ( sz == string_size( param->region[ r ].name ) &&
-                         memcmp( param->region[ r ].name, refname, sz ) == 0 )
-                    {
-                        include = true;
-                        max_to = param->region[ r ].max_to;
-                        min_from = param->region[ r ].min_from;
-                        param->region[ r ].printed++; /* new: mark a region as printed */
-                        break;
-                    }
-                }
-
-                if ( param->region_qty == 0 || include )
-                {
-                    int64_t const endrow_exclusive = rowid + count;
-                    unsigned m;
-                    unsigned k;
-                    
-                    for ( k = 0, m = 1; rc == 0 && k < 3; ++k, m <<= 1 )
-                    {
-                        if ( m & options )
-                        {
-                            unsigned lookback = 0;
-                            int64_t row;
-                            int32_t row_start_offset;
-                            unsigned pos;
-			    unsigned const maxseqlen = 5000; /***** TODO: this code is to be rewritten anyway ****/
-                            
-                            if ( param->region_qty )
-                            {
-                                if ( ctx->ref.cols[ ref_OVERLAP_REF_LEN ].idx )
-                                {
-                                    rc = Cursor_Read( &ctx->ref, rowid, 0, ~(0u) );
-                                    if ( rc != 0 )
-                                        break;
-                                    if ( ctx->ref.cols[ ref_OVERLAP_REF_LEN ].len > k )
-                                    {
-                                        unsigned const overlap = ctx->ref.cols[ ref_OVERLAP_REF_LEN ].base.coord0[ k ];
-                                        
-                                        if ( overlap != 0 )
-                                        {
-                                            
-                                            assert( overlap < rowid * maxseqlen );
-                                            lookback = ( rowid - ( overlap / maxseqlen ) );
-                                        }
-                                    }
-                                }
-                                else
-                                    lookback = 1;
-                            }
-			    row_start_offset = min_from/maxseqlen - lookback;
-			   if(row_start_offset < 0) row_start_offset=0;
-			    
-
-                            for ( pos = row_start_offset*maxseqlen, row = rowid + row_start_offset; rc == 0 && row < endrow_exclusive; ++row )
-                            {
-                                if ( row < 1 )
-                                {
-                                    row = 0;
-                                    continue;
-                                }
-                                rc = Cursor_Read( &ctx->ref, row, 0, ~(0u) );
-                                if ( rc != 0 )
-                                    break;
-                                if ( ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS + k ].len > 0 )
-                                    rc = user_func( ctx, &param->region[r], Options, m, &rows,
-                                                    &ctx->ref.cols[ ref_PRIMARY_ALIGNMENT_IDS + k ] );
-                                pos += ctx->ref.cols[ ref_MAX_SEQ_LEN ].base.u32[ 0 ];
-                                if ( pos >= max_to )
-                                    break;
-                                if ( param->test_rows != 0 && rows > param->test_rows )
-                                    break;
-                            }
-                        }
-                    }
-                }
-                if ( param->test_rows != 0 && rows > param->test_rows )
-                    break;
-                if ( rc != 0 )
-                    break;
-            } /* while */
-
-            /* new: walk the list of regions and report what was NOT printed ( found ) ... */
-            if ( param->region_qty > 0 && GetRCState( rc ) != rcCanceled )
-            {
-                unsigned r;
-                for ( r = 0; r < param->region_qty; ++r )
-                {
-                    if ( param->region[ r ].printed == 0 )
-                    {
-                        (void)PLOGMSG( klogWarn, ( klogWarn, "reference >$(a)< not found", "a=%s", param->region[ r ].name ) );
-                    }
-                }
-            }
-
-            if ( GetRCObject( rc ) == rcId && GetRCState( rc ) == rcNotFound )
-            {
-                rc = 0;
-            }
-
-        }
-    }
-    Cursor_Close( &ctx->ref.curs );
-    KIndexRelease( iname );
-    
-    return rc;
-}
-
-
-static rc_t DumpAlignedTable( SAM_dump_ctx_t *const ctx, DataSource *const ds,
-                              bool const primary, int const cg_style, unsigned *const rcount )
-{
-    unsigned i;
-    int64_t start;
-    uint64_t count;
-    rc_t rc = VCursorIdRange( ds->curs.vcurs, 0, &start, &count );
-    
-    if ( rc != 0 )
-        return rc;
-    for ( i = 0; i != (unsigned)count; ++i )
-    {
-        if ( DumpAlignedRow(ctx, ds, start + i, primary, cg_style, &rc ) )
-            ++*rcount;
-        if ( rc != 0 || ( rc = Quitting() ) != 0 )
-            return rc;
-        if ( param->test_rows && *rcount > param->test_rows )
-            break;
-    }
-    return 0;
-}
-
-
-static rc_t DumpUnsorted( SAM_dump_ctx_t *const ctx )
-{
-    rc_t rc = 0;
-    unsigned rcount;
-    
-    if ( rc == 0 && param->cg_evidence )
-    {
-        SAM_DUMP_DBG( 2, ( "%s EVIDENCE_INTERVAL\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->evi, false, 0, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) allele sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && param->cg_ev_dnb )
-    {
-        SAM_DUMP_DBG( 2, ( "%s EVIDENCE_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->eva, false, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) support sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && ctx->pri.curs.vcurs )
-    {
-        SAM_DUMP_DBG( 2, ( "%s PRIMARY_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->pri, true, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) primary sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    if ( rc == 0 && ctx->sec.curs.vcurs )
-    {
-        SAM_DUMP_DBG( 2, ( "%s SECONDARY_ALIGNMENT\n", ctx->accession ) );
-        rcount = 0;
-        rc = DumpAlignedTable( ctx, &ctx->sec, false, param->cg_style, &rcount );
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) secondary sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    return rc;
-}
-
-
-static rc_t DumpUnaligned( SAM_dump_ctx_t *const ctx, bool const aligned )
-{
-    rc_t rc = 0;
-    int64_t start = 0;
-    uint64_t count = 0;
-
-    rc = VCursorIdRange( ctx->seq.curs.vcurs, 0, &start, &count );
-    if ( rc == 0 )
-    {
-        uint64_t rcount = 0;
-        if ( param->test_rows != 0 && count > param->test_rows )
-        {
-            count = param->test_rows;
-        }
-        SAM_DUMP_DBG( 2, ( "%s SEQUENCE table range from %ld qty %lu\n", ctx->accession, start, count ) );
-        while ( count > 0 && rc == 0 )
-        {
-            uint32_t i;
-
-            if ( ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].idx == 0)
-            {
-                rc = DumpUnalignedReads( ctx, NULL, start, &rcount );
-            }
-            else
-            {
-                /* avoid reading whole sequence cursor data unnecessarily */
-                rc = Cursor_Read( &ctx->seq, start, seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-                if ( rc == 0 )
-                {
-                    /* find if its completely unaligned */
-                    int64_t min_prim_id = 0;
-                    bool has_unaligned = false;
-                    for ( i = 0; rc == 0 && i < ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len; i++ )
-                    {
-                        int64_t x = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[ i ];
-                        has_unaligned |= x == 0;
-                        if ( ( min_prim_id == 0 && x != 0 ) || min_prim_id < x )
-                        {
-                            min_prim_id = x;
-                        }
-                    }
-                    if ( min_prim_id == 0 )
-                    {
-                        rc = DumpUnalignedReads( ctx, NULL, start, &rcount );
-                    }
-                    else if ( has_unaligned && !param->unaligned_spots )
-                    {
-                        if ( rc == 0 )
-                        {
-#if USE_MATE_CACHE
-                            uint64_t val;
-                            rc = Cache_Get( &ctx->pri.curs, min_prim_id, &val );
-                            if ( rc == 0 )
-                            {
-                                ctx->pri.cols[ alg_REF_POS ].len = 0;
-                                Cache_Unpack( val, 0, &ctx->pri.curs, ctx->pri.cols );
-                                ctx->pri.cols[ alg_SEQ_SPOT_ID ].base.i64 = &start;
-                                ctx->pri.cols[ alg_SEQ_SPOT_ID ].len = 1;
-                                memcpy( &ctx->pri.cols[ alg_REF_NAME ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-                                memcpy( &ctx->pri.cols[ alg_REF_SEQ_ID ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-                                memcpy( &ctx->pri.cols[ alg_REF_POS ], &ctx->pri.cols[ alg_MATE_REF_POS ], sizeof( SCol ) );
-                            }
-                            else if ( !( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcItem ) )
-                            {
-                                break;
-                            }
-                            else
-                            {
-#endif /* USE_MATE_CACHE */
-                                rc = Cursor_ReadAlign( &ctx->pri.curs, min_prim_id, ctx->pri.cols, alg_MATE_ALIGN_ID );
-#if USE_MATE_CACHE
-                            }
-#endif /* USE_MATE_CACHE */
-                            rc = rc ? rc : DumpUnalignedReads( ctx, ctx->pri.cols, min_prim_id, &rcount );
-                        }
-                    }
-                } else if ( GetRCState( rc ) == rcNotFound && GetRCObject( rc ) == rcRow )
-                {
-                    rc = 0;
-                }
-            }
-            start++;
-            count--;
-            rc = rc ? rc : Quitting();
-        }
-        (void)PLOGMSG( klogInfo, ( klogInfo, "$(a): $(c) unaligned sequences", "a=%s,c=%lu", ctx->accession, rcount ) );
-    }
-    return rc;
-}
-
-#if USE_MATE_CACHE
-static rc_t FlushUnalignedRead_cb (uint64_t key, bool value,void *user_data)
-{
-	rc_t rc;
-	int64_t spot_id = (int64_t) key;
-	int64_t aligned_mate_id = (int64_t) value;
-	SAM_dump_ctx_t *const ctx = user_data;
-	rc = Cursor_Read( &ctx->seq, spot_id, seq_PRIMARY_ALIGNMENT_ID, ~(unsigned)0 );
-	if ( rc == 0 ) {
-		uint64_t rcount;
-		uint64_t val;
-		assert(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].len == 2);
-		if(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[0]==0){
-			aligned_mate_id = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[1];
-			assert(aligned_mate_id != 0);
-		} else if(ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[1] == 0){
-			aligned_mate_id = ctx->seq.cols[ seq_PRIMARY_ALIGNMENT_ID ].base.i64[0];
-			assert(aligned_mate_id != 0);
-		} else {
-			assert(0);
-		}
-                rc = Cache_Get( &ctx->pri.curs, aligned_mate_id, &val );
-                if ( rc == 0 ) {
-			ctx->pri.cols[ alg_REF_POS ].len = 0;
-			Cache_Unpack( val, 0, &ctx->pri.curs, ctx->pri.cols );
-			ctx->pri.cols[ alg_SEQ_SPOT_ID ].base.i64 = &spot_id;
-			ctx->pri.cols[ alg_SEQ_SPOT_ID ].len = 1;
-			memcpy( &ctx->pri.cols[ alg_REF_NAME ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-			memcpy( &ctx->pri.cols[ alg_REF_SEQ_ID ], &ctx->pri.cols[ alg_MATE_REF_NAME ], sizeof( SCol ) );
-			memcpy( &ctx->pri.cols[ alg_REF_POS ], &ctx->pri.cols[ alg_MATE_REF_POS ], sizeof( SCol ) );
-			rc =DumpUnalignedReads( ctx, ctx->pri.cols, aligned_mate_id, &rcount );
-		}
-	}
-        return rc;
-}
-static rc_t FlushUnaligned( SAM_dump_ctx_t *const ctx, const SCursCache * cache )
-{
-    return KVectorVisitBool (cache->cache_unaligned_mate, false, FlushUnalignedRead_cb, ctx );
-}
-#endif
-
-static rc_t DumpHeader( SAM_dump_ctx_t const *ctx )
-{
-    bool reheader = param->reheader;
-    rc_t rc = 0;
-    
-    if ( !reheader )
-    {
-        if ( ctx->db )
-        {
-            /* grab header from db meta node */
-            KMetadata const *meta;
-            
-            rc = VDatabaseOpenMetadataRead( ctx->db, &meta );
-            if ( rc == 0 )
-            {
-                KMDataNode const *node;
-                
-                rc = KMetadataOpenNodeRead( meta, &node, "BAM_HEADER" );
-                KMetadataRelease( meta );
-                
-                if ( rc == 0 )
-                {
-                    size_t offset = 0;
-                    
-                    for ( offset = 0; ; )
-                    {
-                        size_t remain;
-                        size_t nread;
-                        char buffer[ 4096 ];
-                        
-                        rc = KMDataNodeRead( node, offset, buffer, sizeof(buffer), &nread, &remain );
-                        if ( rc != 0 )
-                            break;
-                        BufferedWriter( NULL, buffer, nread, NULL );
-                        if ( remain == 0 )
-                        {
-                            if ( buffer[nread - 1] != '\n' )
-                            {
-                                 buffer[ 0 ] = '\n';
-                                 rc = BufferedWriter( NULL, buffer, 1, NULL );
-                            }
-                            break;
-                        }
-                        offset += nread;
-                    }
-                    KMDataNodeRelease(node);
-                }
-                else if ( GetRCState( rc ) == rcNotFound )
-                {
-                    reheader = true;
-                    rc = 0;
-                }
-            }
-        }
-        else
-        {
-            reheader = true;
-            rc = 0;
-        }
-    }
-
-    if ( rc == 0 && reheader )
-    {
-        rc = KOutMsg( "@HD\tVN:1.3\n" );
-        if ( rc == 0 && gRefList )
-            rc = RefSeqPrint();
-        if ( rc == 0 && ctx->readGroup )
-            rc = ReadGroup_print( ctx->readGroup );
-        if ( rc == 0 && ctx->seq.tbl.vtbl )
-            rc = DumpReadGroups( &ctx->seq.tbl );
-    }
-
-    if ( rc == 0 && param->comments )
-    {
-        unsigned i;
-        
-        for( i = 0; rc == 0 && param->comments[ i ]; ++i )
-            rc = KOutMsg( "@CO\t%s\n", param->comments[ i ] );
-    }
-    return rc;
-}
-
-
-static rc_t DumpDB( SAM_dump_ctx_t *const ctx )
-{
-    rc_t rc = 0;
-
-    if ( ctx->ref.tbl.vtbl != NULL )
-        rc = ReferenceList_MakeTable( &gRefList, ctx->ref.tbl.vtbl, 0, CURSOR_CACHE, NULL, 0 );
-    if ( !param->noheader )
-        rc = DumpHeader( ctx );
-    if ( rc == 0 )
-    {
-        if ( param->region_qty ){
-            rc = ForEachAlignedRegion(  ctx
-                                      ,   ( param->primaries   ? primary_IDS : 0 )
-                                        | ( param->secondaries ? secondary_IDS : 0 )
-                                        | ( param->cg_evidence ? evidence_interval_IDS : 0 )
-                                        | ( param->cg_ev_dnb   ? evidence_alignment_IDS : 0 )
-                                      , DumpAlignedRowList_cb );
-#if USE_MATE_CACHE
-	    if ( rc == 0 && param->unaligned ){
-                rc = FlushUnaligned( ctx,ctx->pri.curs.cache);
-	    }
-#endif
-	}
-        if ( param->cg_sam )
-            rc = ForEachAlignedRegion( ctx, evidence_interval_IDS, DumpCGSAM );
-
-        if ( param->region_qty == 0 )
-        {
-            rc = DumpUnsorted( ctx );
-            if ( rc == 0 && param->unaligned )
-                rc = DumpUnaligned( ctx, ctx->pri.tbl.vtbl != NULL );
-        }
-    }
-    ReferenceList_Release( gRefList );
-    return rc;
-}
-
-
-static rc_t DumpTable( SAM_dump_ctx_t *ctx )
-{
-    rc_t rc = 0;
-
-    if ( !param->noheader )
-        rc = DumpHeader( ctx );
-    if ( rc == 0 )
-        rc = DumpUnaligned( ctx, false );
-    return rc;
-}
-
-
-static rc_t ProcessTable( VDBManager const *mgr, char const fullPath[],
-                          char const accession[], char const readGroup[] )
-{
-    VTable const *tbl;
-    rc_t rc = VDBManagerOpenTableRead( mgr, &tbl, 0, fullPath );
-    
-    if ( rc != 0 )
-    {
-        VSchema *schema;
-        
-        rc = VDBManagerMakeSRASchema( mgr, &schema );
-        if ( rc == 0 )
-        {
-            rc = VDBManagerOpenTableRead( mgr, &tbl, schema, fullPath );
-            VSchemaRelease( schema );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        SAM_dump_ctx_t ctx;
-        SCol seq_cols[ sizeof( gSeqCol ) / sizeof( gSeqCol[ 0 ] ) ];
-        
-        memset( &ctx, 0, sizeof( ctx ) );
-        
-        ctx.fullPath = fullPath;
-        ctx.accession = accession;
-        ctx.readGroup = readGroup;
-        
-        DATASOURCE_INIT( ctx.seq, accession );
-        ctx.seq.tbl.vtbl = tbl;
-        ctx.seq.type = edstt_Sequence;
-        
-        ReportResetTable( fullPath, tbl );
-
-        ctx.seq.cols = seq_cols;
-        memcpy( ctx.seq.cols, gSeqCol, sizeof( gSeqCol ) );
-        rc = Cursor_Open( &ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL );
-        if ( rc == 0 ) {
-            rc = DumpTable( &ctx );
-            Cursor_Close(&ctx.seq.curs);
-        }
-        VTableRelease( tbl );
-    }
-    return rc;
-}
-
-
-static void SetupColumns( DataSource *ds, enum eDSTableType type )
-{
-    memcpy( ds->cols, g_alg_col_tmpl, sizeof( g_alg_col_tmpl ) );
-    
-    ds->type = type;
-    if ( param->use_seqid )
-        ds->cols[ alg_MATE_REF_NAME ].name = "MATE_REF_SEQ_ID";
-    else
-        ds->cols[ alg_MATE_REF_NAME ].name = "MATE_REF_NAME";
-    
-    if ( param->fasta || param->fastq )
-        ds->cols[ alg_READ ].name = "RAW_READ";
-    else if ( param->hide_identical )
-        ds->cols[ alg_READ ].name = "MISMATCH_READ";
-    else
-        ds->cols[ alg_READ ].name = "READ";
-    
-    if ( param->long_cigar )
-    {
-        ds->cols[ alg_CIGAR ].name = "CIGAR_LONG";
-        ds->cols[ alg_CIGAR_LEN ].name = "CIGAR_LONG_LEN";
-    }
-    else
-    {
-        ds->cols[ alg_CIGAR ].name = "CIGAR_SHORT";
-        ds->cols[ alg_CIGAR_LEN ].name = "CIGAR_SHORT_LEN";
-    }
-
-    if(param->qualQuant && param->qualQuantSingle){ /** we don't really need quality ***/
-	ds->cols[ alg_SAM_QUALITY   ].name = "";
-    }
-    
-    switch ( type )
-    {
-    case edstt_EvidenceInterval:
-	
-        ds->cols[ alg_SEQ_SPOT_ID   ].name = "";
-        ds->cols[ alg_SEQ_NAME      ].name = "";
-        ds->cols[ alg_SAM_QUALITY   ].name = "";
-        ds->cols[ alg_SPOT_GROUP    ].name = "";
-        ds->cols[ alg_SEQ_SPOT_GROUP].name = "";
-        ds->cols[ alg_SEQ_READ_ID   ].name = "";
-        ds->cols[ alg_MATE_ALIGN_ID ].name = "";
-        ds->cols[ alg_MATE_REF_ID   ].name = "";
-        ds->cols[ alg_MATE_REF_NAME ].name = "";
-        ds->cols[ alg_SAM_FLAGS     ].name = "";
-        ds->cols[ alg_MATE_REF_POS  ].name = "";
-        ds->cols[ alg_ALIGN_GROUP   ].name = "";
-        ds->cols[ alg_TEMPLATE_LEN  ].name = "";
-        if ( param->cg_sam || param->cg_ev_dnb )
-            ds->cols[ alg_EVIDENCE_ALIGNMENT_IDS ].name = "EVIDENCE_ALIGNMENT_IDS";
-        break;
-
-    case edstt_EvidenceAlignment:
-        ds->cols[ alg_REF_PLOIDY    ].name = "REF_PLOIDY";
-        ds->cols[ alg_REF_ID        ].name = "REF_ID";
-        ds->cols[ alg_MATE_ALIGN_ID ].name = "";
-        ds->cols[ alg_MATE_REF_ID   ].name = "";
-        ds->cols[ alg_MATE_REF_NAME ].name = "";
-        ds->cols[ alg_SAM_FLAGS     ].name = "";
-        ds->cols[ alg_MATE_REF_POS  ].name = "";
-        ds->cols[ alg_ALIGN_GROUP   ].name = "";
-        ds->cols[ alg_TEMPLATE_LEN  ].name = "";
-        break;
-    default:
-        break;
-    }
-}
-
-
-static rc_t ProcessDB( VDatabase const *db, char const fullPath[],
-                       char const accession[], char const readGroup[] )
-{
-    char const *const refTableName = (   param->region_qty > 0
-                                      || param->cg_evidence
-                                      || param->cg_ev_dnb
-                                      || param->cg_sam
-                                      || param->reheader
-                                      || param->primaries
-                                      || param->secondaries
-                                     )
-                                   ? "REFERENCE"
-                                   : 0;
-    char const *const priTableName = param->primaries   ? "PRIMARY_ALIGNMENT" : 0;
-    char const *const secTableName = param->secondaries ? "SECONDARY_ALIGNMENT" : 0;
-    char const *const seqTableName = ( param->unaligned || param->reheader ) ? "SEQUENCE" : 0;
-    char const *const eviTableName = ( param->cg_evidence || ( param->cg_ev_dnb & ( param->region_qty > 0 ) ) || param->cg_sam ) ? "EVIDENCE_INTERVAL" : 0;
-    char const *const evaTableName = ( param->cg_ev_dnb   || param->cg_sam ) ? "EVIDENCE_ALIGNMENT" : 0;
-    
-    SAM_dump_ctx_t ctx;
-    SCol align_cols[ ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) * 4 ];
-    SCol seq_cols[ sizeof( gSeqCol ) / sizeof( gSeqCol[ 0 ] ) ];
-    rc_t rc = 0;
-    
-    memset( &ctx, 0, sizeof( ctx ) );
-    memset( align_cols, 0, sizeof( align_cols ) );
-    memset( seq_cols, 0, sizeof( seq_cols ) );
-    
-    ctx.db = db;
-    ctx.fullPath = fullPath;
-    ctx.accession = accession;
-    ctx.readGroup = readGroup;
-    
-    DATASOURCE_INIT( ctx.seq, seqTableName );
-    DATASOURCE_INIT( ctx.ref, refTableName );
-    DATASOURCE_INIT( ctx.pri, priTableName );
-    DATASOURCE_INIT( ctx.sec, secTableName );
-    DATASOURCE_INIT( ctx.evi, eviTableName );
-    DATASOURCE_INIT( ctx.eva, evaTableName );
-    
-    if ( ctx.seq.tbl.name )
-    {
-        rc = VDatabaseOpenTableRead( db, &ctx.seq.tbl.vtbl, ctx.seq.tbl.name );
-        if ( rc == 0 )
-        {
-            ctx.seq.cols = seq_cols;
-            memcpy(seq_cols, gSeqCol, sizeof(gSeqCol));
-            rc = Cursor_Open( &ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL );
-        }
-    }
-    ctx.pri.cols = &align_cols[ 0 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.sec.cols = &align_cols[ 1 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.evi.cols = &align_cols[ 2 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    ctx.eva.cols = &align_cols[ 3 * ( sizeof( g_alg_col_tmpl ) / sizeof( g_alg_col_tmpl[ 0 ] ) ) ];
-    
-    SetupColumns( &ctx.pri, edstt_PrimaryAlignment );
-    SetupColumns( &ctx.sec, edstt_SecondaryAlignment );
-    SetupColumns( &ctx.evi, edstt_EvidenceInterval );
-    SetupColumns( &ctx.eva, edstt_EvidenceAlignment );
-    
-    if ( ctx.pri.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.pri.tbl.vtbl, ctx.pri.tbl.name );
-    if ( ctx.sec.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.sec.tbl.vtbl, ctx.sec.tbl.name );
-    if ( ctx.evi.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.evi.tbl.vtbl, ctx.evi.tbl.name );
-    if ( ctx.eva.tbl.name )
-        VDatabaseOpenTableRead( db, &ctx.eva.tbl.vtbl, ctx.eva.tbl.name );
-    
-    if (   ctx.pri.tbl.vtbl == NULL
-        && ctx.sec.tbl.vtbl == NULL
-        && ctx.evi.tbl.vtbl == NULL
-        && ctx.eva.tbl.vtbl == NULL )
-    {
-        memset (&ctx.pri, 0, sizeof( ctx.pri ) * 4 );
-        if ( ctx.seq.tbl.name == NULL )
-        {
-            ctx.seq.tbl.name = "SEQUENCE";
-            rc = VDatabaseOpenTableRead( db, &ctx.seq.tbl.vtbl, ctx.seq.tbl.name );
-        }
-        if ( rc == 0 )
-        {
-            ctx.seq.cols = seq_cols;
-            memcpy(seq_cols, gSeqCol, sizeof(gSeqCol));
-            rc = Cursor_Open(&ctx.seq.tbl, &ctx.seq.curs, ctx.seq.cols, NULL);
-            if ( rc == 0 )
-            {
-                rc = DumpTable( &ctx );
-                Cursor_Close(&ctx.seq.curs);
-            }
-            VTableRelease(ctx.seq.tbl.vtbl);
-        }
-        VDatabaseRelease( db );
-        return rc;
-    }
-    ReportResetDatabase( fullPath, db );
-    
-    if ( ctx.ref.tbl.name )
-    {
-        rc = VDatabaseOpenTableRead( db, &ctx.ref.tbl.vtbl, ctx.ref.tbl.name );
-        ctx.ref.type = edstt_Reference;
-    }
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.pri.tbl, &ctx.pri.curs, ctx.pri.cols, ctx.seq.curs.cache );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.sec.tbl, &ctx.sec.curs, ctx.sec.cols, NULL );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.evi.tbl, &ctx.evi.curs, ctx.evi.cols, NULL );
-    if ( rc == 0 )
-        rc = Cursor_Open( &ctx.eva.tbl, &ctx.eva.curs, ctx.eva.cols, NULL );
-    if ( rc == 0 )
-        rc = DumpDB( &ctx );
-    
-    Cursor_Close(&ctx.ref.curs);
-    Cursor_Close(&ctx.pri.curs);
-    Cursor_Close(&ctx.sec.curs);
-    Cursor_Close(&ctx.evi.curs);
-    Cursor_Close(&ctx.eva.curs);
-    Cursor_Close(&ctx.seq.curs);
-    
-    VTableRelease( ctx.ref.tbl.vtbl );
-    VTableRelease( ctx.pri.tbl.vtbl );
-    VTableRelease( ctx.sec.tbl.vtbl );
-    VTableRelease( ctx.evi.tbl.vtbl );
-    VTableRelease( ctx.eva.tbl.vtbl );
-    VTableRelease( ctx.seq.tbl.vtbl );
-    
-    return rc;
-}
-
-#if 0
-rc_t ResolvePath( char const *accession, char const ** path )
-{
-    rc_t rc = 0;
-    static char tblpath[ 4096 ];
-#if TOOLS_USE_SRAPATH != 0
-    static SRAPath* pmgr = NULL;
-    
-    if ( accession == NULL && path == NULL )
-    {
-        SRAPathRelease( pmgr );
-        return 0;
-    }
-    if (   pmgr != NULL
-        || ( rc = SRAPathMake( &pmgr, NULL ) ) == 0
-        || ( GetRCState( rc ) == rcNotFound && GetRCTarget( rc ) == rcDylib ) )
-    {
-        *path = tblpath;
-        tblpath[ 0 ] = '\0';
-        rc = 0;
-        do {
-            if ( pmgr != NULL && !SRAPathTest( pmgr, accession ) )
-            {
-                /* try to resolve the path using mgr */
-                rc = SRAPathFind( pmgr, accession, tblpath, sizeof( tblpath ) );
-                if ( rc == 0 )
-                    break;
-            }
-            if ( string_size( accession ) >= sizeof( tblpath ) )
-            {
-                rc = RC( rcExe, rcPath, rcResolving, rcBuffer, rcInsufficient );
-            }
-            else
-            {
-                string_copy( tblpath, ( sizeof tblpath ) - 1, accession, string_size( accession ) );
-                rc = 0;
-            }
-        } while( false );
-    }
-#else
-    if ( accession != NULL && path != NULL )
-    {
-        *path = tblpath;
-        string_copy( tblpath, ( sizeof tblpath ) - 1, accession, string_size( accession ) );
-    }
-#endif
-
-    return rc;
-}
-#endif
-
-
-static rc_t ProcessPath( VDBManager const *mgr, char const Path[] )
-{
-#if 0
-    unsigned pathlen = string_size( Path );
-    char *readGroup = NULL;
-    char *path = NULL;
-    unsigned i;
-    rc_t rc;
-    
-    /* strip trailing path seperators */
-    for ( i = pathlen; i > 0; )
-    {
-        int const ch = Path[ --i ];
-        
-        if ( ch == '/' || ch == '\\' )
-            --pathlen;
-        else
-            break;
-    }
-
-    /* find read group alias */
-    for ( i = pathlen; i > 0; )
-    {
-        int const ch = Path[ --i ];
-        
-        if ( ch == '=' )
-        {
-            unsigned const pos = i + 1;
-            unsigned const len = pathlen - pos;
-            
-            pathlen = i;
-            
-            readGroup = malloc( len + 1 );
-            if ( readGroup == NULL )
-                return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-            memcpy( readGroup, &Path[ pos ], len );
-            readGroup[ len ] = '\0';
-            break;
-        }
-    }
-
-    path = malloc( pathlen + 1 );
-    if ( path == NULL )
-        return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    memcpy( path, Path, pathlen );
-    path[ pathlen ] = '\0';
-    
-    rc = ReportResetObject( path );
-    if ( rc == 0 )
-    {
-        char const *fullPath;
-
-        rc = ResolvePath( path, &fullPath );
-        if ( rc == 0 )
-        {
-            char const *accession = fullPath;
-            VDatabase const *db;
-            
-            /* use last path element as accession */
-            for ( i = pathlen; i > 0; )
-            {
-                int const ch = path[ --i ];
-                
-                if ( ch == '/' || ch == '\\' )
-                {
-                    accession = &fullPath[ i + 1 ];
-                    break;
-                }
-            }
-            rc = VDBManagerOpenDBRead( mgr, &db, NULL, fullPath );
-            if ( rc == 0 )
-            {
-                rc = ProcessDB( db, fullPath, accession, readGroup );
-                VDatabaseRelease( db );
-            }
-            else
-                rc = ProcessTable( mgr, fullPath, accession, readGroup );
-        }
-    }
-    free( path );
-    free( readGroup );
-    return rc;
-
-#else
-
-    char * pc;
-    rc_t rc = 0;
-    size_t pathlen = string_size ( Path );
-
-    /* look for scheme */
-    pc = string_chr ( Path, pathlen, ':' );
-    if (pc == NULL)
-    {
-        char *readGroup;
-        char *path;
-        size_t i;
-
-        /* no scheme found - must be simple fs path */
-    old:
-        readGroup = NULL;
-        path = NULL;
-    
-        /* strip trailing path separators */
-        for ( i = pathlen; i > 0; -- pathlen )
-        {
-            int const ch = Path[ --i ];
-            if ( ch != '/' && ch != '\\' )
-                break;
-        }
-
-        /* find read group alias */
-        for ( i = pathlen; i > 0; )
-        {
-            int const ch = Path[ --i ];
-        
-            if ( ch == '=' )
-            {
-                size_t const pos = i + 1;
-                size_t const len = pathlen - pos;
-            
-                pathlen = i;
-            
-                readGroup = malloc( len + 1 );
-                if ( readGroup == NULL )
-                    return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-                memcpy( readGroup, &Path[ pos ], len );
-                readGroup[ len ] = '\0';
-                break;
-            }
-        }
-
-        path = malloc( pathlen + 1 );
-        if ( path == NULL )
-            return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-        memcpy( path, Path, pathlen );
-        path[ pathlen ] = '\0';
-    
-        rc = ReportResetObject( path );
-        if ( rc == 0 )
-        {
-            char const *accession = path;
-            VDatabase const *db;
-            
-            /* use last path element as accession */
-            for ( i = pathlen; i > 0; )
-            {
-                int const ch = path[ --i ];
-                
-                if ( ch == '/' || ch == '\\' )
-                {
-                    accession = &path[ i + 1 ];
-                    break;
-                }
-            }
-            rc = VDBManagerOpenDBRead( mgr, &db, NULL, path );
-            if ( rc == 0 )
-            {
-                rc = ProcessDB( db, path, accession, readGroup );
-                if (UIError(rc, db, NULL)) {
-                    UIDatabaseLOGError(rc, db, true);
-/*                  *error_reported = true; */
-                }
-                VDatabaseRelease( db );
-            }
-            else {
-                rc = ProcessTable( mgr, path, accession, readGroup );
-                if (UIError(rc, NULL, NULL)) {
-                    UITableLOGError(rc, NULL, true);
-/*                  *error_reported = true; */
-                }
-            }
-        }
-        free( path );
-        free( readGroup );
-        return rc;
-    }
-    else
-    {
-        VFSManager * vfs;
-        rc = VFSManagerMake ( & vfs );
-        if ( rc == 0 )
-        {
-            VPath * vpath;
-            char * basename;
-            size_t zz;
-            char buffer [8193];
-            char readgroup_ [257];
-            char * readgroup;
-
-            rc = VFSManagerMakePath (vfs, &vpath, Path);
-            VFSManagerRelease ( vfs );
-            if ( rc == 0 )
-            {
-                char * ext;
-
-                rc = VPathReadPath (vpath, buffer, sizeof buffer - 1, &zz);
-                if ( rc == 0 )
-                {
-                loop:
-                    basename = string_rchr (buffer, zz, '/');
-                    if ( basename == NULL )
-                        basename = buffer;
-                    else
-                    {
-                        if (basename[1] == '\0')
-                        {
-                            basename[0] = '\0';
-                            goto loop;
-                        }
-                        ++ basename;
-                        zz -= basename - buffer;
-                    }
-
-                    /* cut off [.lite].[c]sra[.nenc||.ncbi_enc] if any */
-                    ext = string_rchr( basename, zz, '.' );
-                    if ( ext != NULL )
-                    {
-                        if ( strcasecmp( ext, ".nenc" ) == 0 || strcasecmp( ext, ".ncbi_enc" ) == 0 )
-                        {
-                            zz -= ext - basename;
-                            *ext = '\0';
-                            ext = string_rchr( basename, zz, '.' );
-                        }
-
-                        if ( ext != NULL )
-                        {
-                            if ( strcasecmp( ext, ".sra" ) == 0 || strcasecmp( ext, ".csra" ) == 0 )
-                            {
-                                zz -= ext - basename;
-                                *ext = '\0';
-                                ext = string_rchr( basename, zz, '.' );
-                                if ( ext != NULL && strcasecmp( ext, ".lite" ) == 0 )
-                                    *ext = '\0';
-                            }
-                        }
-                    }
-                
-                    rc = VPathOption (vpath, vpopt_readgroup, readgroup_, 
-                                      sizeof readgroup_ - 1, &zz);
-                    if ( rc == 0 )
-                        readgroup = readgroup_;
-                    else if ( GetRCState ( rc ) == rcNotFound )
-                    {
-                        rc = 0;
-                        readgroup = NULL;
-                    }
-
-
-                    if ( rc == 0 )
-                    {
-                        VDatabase const *db;
-                        
-                        rc = VDBManagerOpenDBRead( mgr, &db, NULL, Path );
-                        if ( rc == 0 )
-                        {
-                            rc = ProcessDB( db, Path, basename, readgroup );
-                            VDatabaseRelease( db );
-                        }
-                        else
-                            rc = ProcessTable( mgr, Path, basename, readgroup );
-                    }
-                }
-
-                VPathRelease (vpath);
-            }
-        }
-    }
-    return rc;
-#endif
-}
-
-/*
-ver_t CC KAppVersion( void )
-{
-    return SAM_DUMP_VERS;
-}
-*/
-
-char const *unaligned_usage[] = {"Output unaligned reads", NULL};
-char const *unaligned_only_usage[] = {"Only output unaligned spots", NULL};
-char const *primaryonly_usage[] = {"Output only primary alignments", NULL};
-char const *cigartype_usage[] = {"Output long version of CIGAR", NULL};
-char const *cigarCG_usage[] = {"Output CG version of CIGAR", NULL};
-char const *cigarCGMerge_usage[] = {"Apply CG fixups to CIGAR/SEQ/QUAL and outputs CG-specific columns", NULL};
-char const *CG_evidence[] = {"Output CG evidence aligned to reference", NULL};
-char const *CG_ev_dnb[] = {"Output CG evidence DNB's aligned to evidence", NULL};
-char const *CG_SAM[] = {"Output CG evidence DNB's aligned to reference ", NULL};
-char const *CG_mappings[] = {"Output CG sequences aligned to reference ", NULL};
-char const *header_usage[] = {"Replace original BAM header with a reconstructed one", NULL};
-char const *noheader_usage[] = {"Do not output headers", NULL};
-char const *region_usage[] = {"Filter by position on genome.",
-                              "Name can either be file specific name (ex: \"chr1\" or \"1\").",
-                              "\"from\" and \"to\" are 1-based coordinates", NULL};
-char const *distance_usage[] = {"Filter by distance between matepairs.",
-                                "Use \"unknown\" to find matepairs split between the references.",
-                                "Use from-to to limit matepair distance on the same reference", NULL};
-char const *seq_id_usage[] = {"Print reference SEQ_ID in RNAME instead of NAME", NULL};
-char const *identicalbases_usage[] = {"Output '=' if base is identical to reference", NULL};
-char const *gzip_usage[] = {"Compress output using gzip", NULL};
-char const *bzip2_usage[] = {"Compress output using bzip2", NULL};
-char const *qname_usage[] = {"Add .SPOT_GROUP to QNAME", NULL};
-char const *fasta_usage[] = {"Produce Fasta formatted output", NULL};
-char const *fastq_usage[] = {"Produce FastQ formatted output", NULL};
-char const *prefix_usage[] = {"Prefix QNAME: prefix.QNAME", NULL};
-char const *reverse_usage[] = {"Reverse unaligned reads according to read type", NULL};
-char const *comment_usage[] = {"Add comment to header. Use multiple times for several lines. Use quotes", NULL};
-char const *XI_usage[] = {"Output cSRA alignment id in XI column", NULL};
-char const *qual_quant_usage[] = {"Quality scores quantization level",
-                                  "a string like '1:10,10:20,20:30,30:-'", NULL};
-char const *CG_names[] = { "Generate CG friendly read names", NULL};
-
-char const *usage_params[] =
-{
-    NULL,                       /* unaligned */
-    NULL,                       /* unaligned-only */
-    NULL,                       /* primaryonly */
-    NULL,                       /* cigartype */
-    NULL,                       /* cigarCG */
-    NULL,                       /* header */
-    NULL,                       /* no-header */
-    "text",                     /* comment */
-    "name[:from-to]",           /* region */
-    "from-to|'unknown'",        /* distance */
-    NULL,                       /* seq-id */
-    NULL,                       /* identical-bases */
-    NULL,                       /* gzip */
-    NULL,                       /* bzip2 */
-    NULL,                       /* qname */
-    NULL,                       /* fasta */
-    NULL,                       /* fastq */
-    "prefix",                   /* prefix */
-    NULL,                       /* reverse */
-    NULL,                       /* test-rows */
-    NULL,                       /* mate-row-gap-cacheable */
-    NULL,                       /* cigarCGMerge */
-    NULL,                       /* XI */
-    "quantization string",      /* qual-quant */
-    NULL,                       /* cigarCGMerge */
-    NULL,                       /* CG-evidence */
-    NULL,                       /* CG-ev-dnb */
-    NULL,                       /* CG-mappings */
-    NULL,                       /* CG-SAM */
-    NULL                        /* CG-names */
-};
-
-enum eArgs
-{
-    earg_unaligned = 0,         /* unaligned */
-    earg_unaligned_only,        /* unaligned */
-    earg_prim_only,             /* primaryonly */
-    earg_cigartype,             /* cigartype */
-    earg_cigarCG,               /* cigarCG */
-    earg_header,                /* header */
-    earg_noheader,              /* no-header */
-    earg_comment,               /* comment */
-    earg_region,                /* region */
-    earg_distance,              /* distance */
-    earg_seq_id,                /* seq-id */
-    earg_identicalbases,        /* identical-bases */
-    earg_gzip,                  /* gzip */
-    earg_bzip2,                 /* bzip2 */
-    earg_qname,                 /* qname */
-    earg_fastq,                 /* fasta */
-    earg_fasta,                 /* fastq */
-    earg_prefix,                /* prefix */
-    earg_reverse,               /* reverse */
-    earg_test_rows,             /* test-rows */
-    earg_mate_row_gap_cachable, /* mate-row-gap-cacheable */
-    earg_cigarCG_merge,         /* cigarCGMerge */
-    earg_XI,                    /* XI */
-    earg_QualQuant,             /* qual-quant */
-    earg_CG_evidence,           /* CG-evidence */
-    earg_CG_ev_dnb,             /* CG-ev-dnb */
-    earg_CG_mappings,           /* CG-mappings */
-    earg_CG_SAM,                /* CG-SAM */
-    earg_CG_names               /* CG-names */
-};
-
-OptDef DumpArgs[] =
-{
-    { "unaligned", "u", NULL, unaligned_usage, 0, false, false },           /* unaligned */
-    { "unaligned-only", "U", NULL, unaligned_usage, 0, false, false },      /* unaligned-only */
-    { "primary", "1", NULL, primaryonly_usage, 0, false, false },           /* primaryonly */
-    { "cigar-long", "c", NULL, cigartype_usage, 0, false, false },          /* cigartype */
-    { "cigar-CG", NULL, NULL, cigarCG_usage, 0, false, false },             /* cigarCG */
-    { "header", "r", NULL, header_usage, 0, false, false },                 /* header */
-    { "no-header", "n", NULL, noheader_usage, 0, false, false },            /* no-header */
-    { "header-comment", NULL, NULL, comment_usage, 0, true, false },        /* comment */
-    { "aligned-region", NULL, NULL, region_usage, 0, true, false },         /* region */
-    { "matepair-distance", NULL, NULL, distance_usage, 0, true, false },    /* distance */
-    { "seqid", "s", NULL, seq_id_usage, 0, false, false },                  /* seq-id */
-    { "hide-identical", "=", NULL, identicalbases_usage, 0, false, false }, /* identical-bases */
-    { "gzip", NULL, NULL, gzip_usage, 0, false, false },                    /* gzip */
-    { "bzip2", NULL, NULL, bzip2_usage, 0, false, false },                  /* bzip2 */
-    { "spot-group", "g", NULL, qname_usage, 0, false, false },              /* qname */
-    { "fastq", NULL, NULL, fastq_usage, 0, false, false },                  /* fasta */
-    { "fasta", NULL, NULL, fasta_usage, 0, false, false },                  /* fastq */
-    { "prefix", "p", NULL, prefix_usage, 0, true, false },                  /* prefix */
-    { "reverse", NULL, NULL, reverse_usage, 0, false, false },              /* reverse */
-    { "test-rows", NULL, NULL, NULL, 0, true, false },                      /* test-rows */
-    { "mate-cache-row-gap", NULL, NULL, NULL, 0, true, false },             /* mate-row-gap-cacheable */
-    { "cigar-CG-merge", NULL, NULL, cigarCGMerge_usage, 0, false, false },  /* cigarCGMerge */
-    { "XI", NULL, NULL, XI_usage, 0, false, false },                        /* XI */
-    { "qual-quant", "Q", NULL, qual_quant_usage, 0, true, false },          /* qual-quant */
-    { "CG-evidence", NULL, NULL, CG_evidence, 0, false, false },            /* CG-evidence */
-    { "CG-ev-dnb"  , NULL, NULL, CG_ev_dnb  , 0, false, false },            /* CG-ev-dnb */
-    { "CG-mappings", NULL, NULL, CG_mappings, 0, false, false },            /* CG-mappings */
-    { "CG-SAM", NULL, NULL, CG_SAM, 0, false, false },                      /* CG-SAM */
-    { "CG-names", NULL, NULL, CG_names, 0, false, false },                  /* CG-names */
-    { "legacy", NULL, NULL, NULL, 0, false, false }
-};
-
-
-/*
-const char UsageDefaultName[] = "sam-dump";
-
-
-rc_t CC UsageSummary( char const *progname )
-{
-    return KOutMsg( "Usage:\n"
-        "\t%s [options] path-to-run[ path-to-run ...] > output.sam\n\n", progname );
-}
-
-
-rc_t CC Usage( Args const *args)
-{
-    char const *progname = UsageDefaultName;
-    char const *fullpath = UsageDefaultName;
-    rc_t rc;
-    unsigned i;
-
-    rc = ArgsProgram( args, &fullpath, &progname );
-
-    UsageSummary( progname );
-
-    KOutMsg( "Options:\n" );
-    for( i = 0; i < sizeof( DumpArgs ) / sizeof( DumpArgs[ 0 ] ); i++ )
-    {
-        if ( DumpArgs[ i ].help != NULL )
-        {
-            HelpOptionLine( DumpArgs[ i ].aliases, DumpArgs[ i ].name,
-                            usage_params[ i ], DumpArgs[ i ].help);
-        }
-    }
-    KOutMsg( "\n" );
-    HelpOptionsStandard();
-
-    HelpVersion( fullpath, KAppVersion() );
-
-    return rc;
-}
-*/
-
-#define ARGS_COUNT (sizeof(DumpArgs)/sizeof(DumpArgs[0]))
-
-
-static unsigned ParamCount( Args const *const args, rc_t *const prc )
-{
-    uint32_t y = 0;
-    rc_t rc = ArgsParamCount( args, &y );
-    
-    if ( prc != NULL )
-        *prc = rc;
-    return y;
-}
-
-
-static unsigned ArgCount( Args const *const args, rc_t *const prc )
-{
-    uint32_t y = 0;
-    rc_t rc = ArgsArgvCount( args, &y );
-    
-    if ( prc != NULL )
-        *prc = rc;
-    return y;
-}
-
-
-static rc_t CountArgs( Args const *const args, unsigned count[],
-                       char const **const errmsg )
-{
-    rc_t rc;
-    unsigned const pcount = ParamCount( args, &rc );
-    
-    memset( count, 0, ARGS_COUNT );
-    if ( rc != 0 || pcount == 0 )
-    {
-        *errmsg = "";
-        MiniUsage( args );
-        return ( ArgCount( args, NULL ) < 2 )
-             ? 0
-             : RC( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-    }
-#define COUNT_ARG(E) do {\
-    char const *const optname = DumpArgs[ (E) ].name; \
-    if ( ( rc = ArgsOptionCount( args, optname, &count[ (E) ] ) ) != 0 ) { \
-        *errmsg = optname; \
-        return rc; \
-    } } while( 0 )
-    
-    
-    /* record source options */
-    COUNT_ARG( earg_unaligned );
-    COUNT_ARG( earg_unaligned_only );
-    COUNT_ARG( earg_prim_only );
-    COUNT_ARG( earg_CG_evidence );
-    COUNT_ARG( earg_CG_ev_dnb );
-    COUNT_ARG( earg_CG_mappings );
-    COUNT_ARG( earg_CG_SAM );
-    
-    /* record filter options */
-    COUNT_ARG( earg_region );
-    COUNT_ARG( earg_distance );
-    
-    /* output format options */
-    COUNT_ARG( earg_fastq );
-    COUNT_ARG( earg_fasta );
-    
-    /* SAM header options */
-    COUNT_ARG( earg_header );
-    COUNT_ARG( earg_noheader );
-    COUNT_ARG( earg_comment );
-    
-    /* SAM field options */
-    COUNT_ARG( earg_prefix );
-    COUNT_ARG( earg_qname );
-    COUNT_ARG( earg_seq_id );
-    COUNT_ARG( earg_CG_names );
-    
-    COUNT_ARG( earg_cigartype );
-    COUNT_ARG( earg_cigarCG );
-    COUNT_ARG( earg_cigarCG_merge );
-    
-    COUNT_ARG( earg_identicalbases );
-    COUNT_ARG( earg_reverse );
-    COUNT_ARG( earg_QualQuant );
-    
-    /* output encoding options */
-    COUNT_ARG( earg_gzip );
-    COUNT_ARG( earg_bzip2 );
-    
-    COUNT_ARG( earg_mate_row_gap_cachable );
-    
-    /* debug options */
-    COUNT_ARG( earg_XI );
-    COUNT_ARG( earg_test_rows );
-#undef COUNT_ARG
-    return 0;
-}
-
-
-static unsigned GetOptValU( Args const *const args, char const *const argname,
-                            unsigned const defval, rc_t *const prc )
-{
-    unsigned y = defval;
-    char const *valstr;
-    rc_t rc = ArgsOptionValue( args, argname, 0, &valstr );
-    
-    if ( rc == 0 )
-    {
-        char *endp;
-        
-        y = strtou32( valstr, &endp, 0 );
-        if ( *endp != '\0' )
-        {
-            rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-            y = 0;
-        }
-        if ( y == 0 )
-            y = defval;
-    }
-    if ( prc )
-        *prc = rc;
-    return y;
-}
-
-
-static rc_t GetComments( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    parms->comments = calloc( n + 1, sizeof( parms->comments[ 0 ] ) );
-    if ( parms->comments != NULL )
-    {
-        unsigned i;
-        
-        for ( i = 0; i < n; ++i )
-        {
-            rc_t const rc = ArgsOptionValue( args, DumpArgs[ earg_comment ].name, i, &parms->comments[ i ] );
-            if ( rc != 0 )
-            {
-                free( ( void * )parms->comments );
-                parms->comments = NULL;
-                return rc;
-            }
-        }
-        return 0;
-    }
-    else
-        return RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-}
-
-
-static rc_t ParseFromTo( int *const pFrom, int *const pTo, char const str[] )
-{
-    /* $str =~ /((\d+)-(\d+))|(-(\d+))|(\d+)/ */
-    int n;
-    char fr_str[ 16 ];
-    char to_str[ 16 ];
-    uint32_t fr = 0;
-    uint32_t to = 0;
-    int i = sscanf( str, "%15[0-9]-%15[0-9]%n", fr_str, to_str, &n );
-    
-    if ( i != 2 )
-    {
-        unsigned const offset = ( str[ 0 ] == '-' ) ? 1 : 0;
-        
-        fr = 0;
-        i = sscanf( str + offset, "%15[0-9]%n", to_str, &n );
-        if ( i != 1 )
-            return RC( rcExe, rcArgv, rcProcessing, rcParam, rcOutofrange );
-        to = strtou32( to_str, 0, 0 );
-    }
-    else
-    {
-        fr = strtou32( fr_str, 0, 0 );
-        to = strtou32( to_str, 0, 0 );
-        
-        if ( to < fr )
-        {
-            uint32_t const tmp = to;
-            to = fr;
-            fr = tmp;
-        }
-    }
-    /* was the entire string consumed */
-    if ( str[ n ] != 0 )
-        return RC( rcExe, rcArgv, rcProcessing, rcParam, rcInvalid );
-    *pFrom = ( int )fr;
-    *pTo = ( int )to;
-    return 0;
-}
-
-
-static rc_t GetDistance( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    rc_t rc;
-    TMatepairDistance *const mpd = calloc( n, sizeof( mpd[ 0 ] ) );
-    
-    if ( mpd == NULL )
-        rc = RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    else
-    {
-        unsigned i;
-        unsigned j;
-        
-        for ( j = i = 0; i < n; ++i )
-        {
-            char const *valstr;
-            int from = 0;
-            int to = 0;
-
-            rc = ArgsOptionValue( args, DumpArgs[earg_distance].name, i, &valstr );
-            if ( rc != 0 )
-                break;
-            if ( strcasecmp( valstr, "unknown" ) == 0 )
-            {
-                parms->mp_dist_unknown = true;
-                continue;
-            }
-            rc = ParseFromTo( &from, &to, valstr );
-            if ( rc != 0 )
-                break;
-            if ( ( from != 0 ) || ( to != 0 ) )
-            {
-                mpd[ j ].from = from;
-                mpd[ j ].to = to;
-                ++j;
-            }
-        }
-        if ( rc == 0 )
-        {
-            parms->mp_dist = mpd;
-            parms->mp_dist_qty = j;
-            
-            SAM_DUMP_DBG( 2, ( "filter by mate pair distance\n" ) );
-            if ( parms->mp_dist_unknown )
-                SAM_DUMP_DBG( 2, ( "    distance: unknown\n" ) );
-            for ( i = 0; i < j; ++i )
-            {
-                SAM_DUMP_DBG( 2, ( "    distance [%lu-%lu]\n",
-                              parms->mp_dist[ i ].from, parms->mp_dist[ i ].to ) );
-            }
-        }
-        else
-            free( mpd );
-    }
-    return rc;
-}
-
-
-static rc_t GetRegion( Args const *const args, struct params_s *const parms, unsigned const n )
-{
-    rc_t rc;
-    TAlignedRegion *const reg = calloc( n, sizeof( reg[ 0 ] ) );
-    
-    if ( reg == NULL )
-        rc = RC( rcExe, rcArgv, rcProcessing, rcMemory, rcExhausted );
-    else
-    {
-        unsigned i;
-        unsigned j;
-        
-        for ( rc = 0, j = i = 0; i < n; ++i )
-        {
-            char const *valstr;
-            char const *sep;
-            unsigned namelen;
-            unsigned f;
-            unsigned e;
-            TAlignedRegion r;
-
-	    memset(&r,0,sizeof(r));
-            
-            rc = ArgsOptionValue( args, DumpArgs[ earg_region ].name, i, &valstr );
-            if ( rc != 0 ) break;
-            
-            sep = strchr( valstr, ':' );
-            if ( sep != NULL )
-                namelen = sep - valstr;
-            else
-                namelen = string_size( valstr );
-            
-            if ( namelen >= sizeof( r.name ) )
-                return RC( rcExe, rcArgv, rcProcessing, rcParam, rcTooLong );
-            
-            memcpy( r.name, valstr, namelen );
-            r.name[ namelen ] = '\0';
-            
-            r.rq = UINT_MAX;
-            if ( sep != NULL )
-            {
-                int from = -1;
-                int to = -1;
-                
-                rc = ParseFromTo( &from, &to, sep + 1 );
-                if ( rc != 0 )
-                    break;
-                if ( from > 0 ) /* convert to 0-based */
-                    --from;
-                else if ( to > 0 )
-                    from = 0;
-                if ( to > 0 )
-                    --to;
-                else if ( from >= 0 && to < 0 )
-                    to = from;
-                if ( from >= 0 || to >= 0 )
-                {
-                    if ( from > to )
-                    {
-                        int tmp = to;
-                        to = from;
-                        from = tmp;
-                    }
-                    r.r[ 0 ].from = from;
-                    r.r[ 0 ].to = to;
-                    r.rq = 1;
-                }
-            }
-            
-            for ( f = 0, e = j; f < e; )
-            {
-                unsigned const m = ( ( f + e ) / 2 );
-                int const diff = strcmp( r.name, reg[ m ].name );
-                
-                if ( diff < 0 )
-                    e = m;
-                else
-                    f = m + 1;
-            }
-            if ( 0 < e && e < j && strcmp( r.name, reg[ e-1 ].name ) == 0 )
-            {
-                TAlignedRegion *const fnd = &reg[ e - 1 ];
-                
-                if ( fnd->rq != UINT_MAX )
-                {
-                    for ( f = 0, e = fnd->rq; f < e; )
-                    {
-                        unsigned const m = ( ( f + e ) / 2 );
-                        
-                        if ( r.r[ 0 ].from < fnd->r[ m ].from )
-                            e = m;
-                        else
-                            f = m + 1;
-                    }
-                    if ( fnd->rq >= ( sizeof( r.r ) / sizeof( r.r[0] ) ) )
-                    {
-                        rc = RC( rcExe, rcArgv, rcProcessing, rcBuffer, rcInsufficient );
-                        break;
-                    }
-                    memmove( &fnd->r[ e +1 ], &fnd->r[ e ], ( fnd->rq - e ) * sizeof( fnd->r[ 0 ] ) );
-                    fnd->r[ e ] = r.r[ 0 ];
-                    ++fnd->rq;
-                }
-            }
-            else
-            {
-                memmove( &reg[ e + 1 ], &reg[ e ], ( j - e ) * sizeof( reg[ 0 ] ) );
-                reg[ e ] = r;
-                ++j;
-            }
-        }
-        if ( rc == 0 )
-        {
-            parms->region = reg;
-            parms->region_qty = j;
-            
-            for ( i = 0; i < parms->region_qty; ++i )
-            {
-                TAlignedRegion *const r = &parms->region[ i ];
-                
-                SAM_DUMP_DBG( 2, ( "filter by %s\n", r->name ) );
-                if ( r->rq == UINT_MAX )
-                {
-                    r->rq = 1;
-                    r->r[ 0 ].from = 0;
-                    r->r[ 0 ].to = UINT_MAX;
-                }
-                for ( j = 0; j < r->rq; ++j )
-                {
-                    unsigned const to = r->r[ j ].to;
-                    unsigned const from = r->r[ j ].from;
-                    
-                    SAM_DUMP_DBG( 2, ( "   range: [%u:%u]\n", r->r[ j ].from, to ) );
-                    if ( r->max_to < to ) r->max_to = to;
-                    if ( r->min_from < from ) r->min_from = from;
-                }
-            }
-        }
-        else
-            free( reg );
-    }
-    return rc;
-}
-
-
-static rc_t GetQualQuant( Args const *const args, struct params_s *const parms )
-{
-    char const *valstr;
-    int i;
-    rc_t rc = ArgsOptionValue( args, DumpArgs[ earg_QualQuant ].name, 0, &valstr );
-    
-    if ( rc == 0 && strcmp( valstr, "0" ) != 0 )
-        parms->quantizeQual = QualityQuantizerInitMatrix( parms->qualQuant, valstr );
-    for(i=1; parms->qualQuant[i]==parms->qualQuant[0] && i<256;i++){}
-    if(i<256) parms->qualQuantSingle=0;
-    else      parms->qualQuantSingle = parms->qualQuant[0];
-    return rc;
-}
-
-
-static rc_t GetArgs( Args const *const args, unsigned const count[],
-                     char const **const errmsg )
-{
-    static struct params_s parms;
-    bool const multipass = ParamCount( args, 0 ) > 1;
-    rc_t rc;
-    
-    memset( &parms, 0, sizeof( parms ) );
-    
-    if ( count[ earg_comment ] )
-    {
-        rc = GetComments( args, &parms, count[ earg_comment ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_comment ].name;
-            return rc;
-        }
-    }
-    
-    if ( count[ earg_region ] && count[ earg_unaligned_only ] == 0 )
-    {
-        rc = GetRegion( args, &parms, count[ earg_region ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_region ].name;
-            return rc;
-        }
-    }
-
-    if ( count[ earg_distance ] && count[ earg_unaligned_only ] == 0 )
-    {
-        rc = GetDistance( args, &parms, count[ earg_distance ] );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_distance ].name;
-            return rc;
-        }
-    }
-
-    if ( count[ earg_QualQuant ] )
-    {
-        rc = GetQualQuant( args, &parms );
-        if ( rc != 0 )
-        {
-            *errmsg = DumpArgs[ earg_QualQuant ].name;
-            return rc;
-        }
-    }
-    
-    parms.cg_sam = ( count[ earg_CG_SAM ] != 0 );
-    parms.cg_evidence = ( count[ earg_CG_evidence ] != 0 );
-    parms.cg_ev_dnb = ( count[ earg_CG_ev_dnb ] != 0 );
-    
-    if ( count[ earg_CG_mappings ] == 0 &&
-         ( parms.cg_sam || parms.cg_evidence || parms.cg_ev_dnb ) )
-    {
-        parms.primaries = false;
-        parms.secondaries = false;
-        parms.unaligned = false;
-    }
-    else
-    {
-        parms.primaries = true;
-        parms.secondaries = ( count[ earg_prim_only ] == 0 );
-        parms.unaligned = ( ( count[ earg_unaligned ] != 0 ) /*&& ( parms.region_qty == 0 )*/ );
-    }
-    
-    parms.long_cigar = ( count[ earg_cigartype ] != 0 );
-    parms.use_seqid = ( ( count[ earg_seq_id ] != 0 ) || multipass );
-    parms.hide_identical = ( count[ earg_identicalbases ] != 0 );
-    parms.fasta = ( count[ earg_fasta ] != 0 );
-    parms.fastq = ( count[ earg_fastq ] != 0 );
-    parms.reverse_unaligned = ( count[ earg_reverse ] != 0 );
-    parms.cg_friendly_names = count[ earg_CG_names ] != 0;
-    parms.spot_group_in_name = ( count[ earg_qname ] != 0 || multipass );
-    parms.noheader = ( ( count[ earg_noheader ] != 0 ) || parms.fasta || parms.fastq || multipass );
-    parms.reheader = ( ( count[ earg_header ] != 0 ) && !parms.noheader );
-    parms.xi = ( count[ earg_XI ] != 0 );
-    if ( ( count[ earg_cigarCG ] == 0 ) && ( count[ earg_cigarCG_merge ] == 0 ) )
-    {
-        parms.cg_style = 0;
-    }
-    else if ( count[ earg_cigarCG ] == 0 )
-    {
-        parms.cg_style = 1;
-        parms.long_cigar = false;
-    }
-    else if ( count[ earg_cigarCG_merge ] == 0 )
-    {
-        parms.cg_style = 2;
-    }
-    else
-    {
-        rc = RC( rcExe, rcArgv, rcProcessing, rcParam, rcInconsistent );
-        *errmsg = "cigar-CG and CG are mutually exclusive";
-        parms.cg_style = 0;
-    }
-
-    if (count[ earg_unaligned_only ] > 0) {
-        parms.unaligned_spots = true;
-        
-        parms.primaries = false;
-        parms.secondaries = false;
-        parms.unaligned = true;
-        parms.cg_ev_dnb = false;
-        parms.cg_evidence = false;
-        parms.cg_sam = false;
-        parms.cg_style = 0;
-    }
-    
-    parms.test_rows = GetOptValU( args, DumpArgs[ earg_test_rows ].name, 0, NULL );
-    parms.mate_row_gap_cachable = GetOptValU( args, DumpArgs[ earg_mate_row_gap_cachable ].name, 1000000, NULL );
-    
-    param = &parms;
-    return 0;
-}
-
-
-static rc_t GetParams( Args const *const args, char const **const errmsg )
-{
-    unsigned count[ ARGS_COUNT ];
-    rc_t rc = CountArgs( args, count, errmsg );
-    
-    if ( rc == 0 )
-        rc = GetArgs( args, count, errmsg );
-    return rc;
-}
-
-
-rc_t CC SAM_Dump_Main( int argc, char* argv[] )
-{
-    rc_t rc = 0;
-    Args* args;
-    char const *errmsg = "stop";
-    bool error_reported = false;
-
-    memset( &g_out_writer, 0, sizeof( g_out_writer ) );
-    KOutHandlerSetStdOut();
-    KStsHandlerSetStdErr();
-    KLogHandlerSetStdErr();
-    (void)KDbgHandlerSetStdErr();
-
-    ReportBuildDate( __DATE__ );
-
-    rc = ArgsMakeAndHandle( &args, argc, argv, 1, DumpArgs, ARGS_COUNT );
-    if ( rc == 0 )
-    {
-        uint32_t pcount;
-
-        rc = ArgsParamCount( args, &pcount );
-        if ( rc != 0 || pcount < 1 )
-        {
-            errmsg = "";
-            rc = argc < 2 ? 0 : RC( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-            MiniUsage( args );
-        }
-        else if ( ( rc = GetParams( args, &errmsg ) ) != 0 )
-        {
-        }
-        else
-        {
-            VDBManager const *mgr;
-            
-            rc = VDBManagerMakeRead( &mgr, NULL );
-            if ( rc == 0 )
-            {
-                rc = BufferedWriterMake( param->output_gzip, param->output_bz2 );
-                if ( rc == 0 )
-                {
-                    unsigned i;
-                    
-                    for ( i = 0; i < pcount; ++i )
-                    {
-                        char const *arg;
-                        
-                        rc = ArgsParamValue( args, i, &arg );
-                        if ( rc != 0 ) break;
-                        rc = ProcessPath( mgr, arg );
-#if _ARCH_BITS < 64
-                        /* look for "param excessive while writing vector within container module" */
-                        if (GetRCState(rc) == rcExcessive &&
-                            GetRCObject(rc) == rcParam &&
-                            GetRCContext(rc) == rcWriting &&
-                            GetRCTarget(rc) == rcVector &&
-                            GetRCModule(rc) == rcCont)
-                        {
-                            ( void )PLOGMSG( klogErr, (klogErr, "This run '$(run)' contains too many reads to be processed with a $(bits)-bit executable; please try again with a 64-bit executable.", "run=%s,bits=%u", arg, _ARCH_BITS));
-                        }
-#endif
-                        if ( rc != 0 ) break;
-                    }
-                    BufferedWriterRelease( rc == 0 );
-                }
-                VDBManagerRelease( mgr );
-            }
-        }
-        ArgsWhack( args );
-    }
-
-    if ( rc != 0 && !error_reported )
-    {
-        if ( errmsg[ 0 ] )
-        {
-            ( void )LOGERR( klogErr, rc, errmsg );
-        } else if ( KLogLastErrorCode() != rc )
-        {
-            ( void )LOGERR( klogErr, rc, "stop" );
-        }
-    }
-
-    {
-        /* Report execution environment if necessary */
-        rc_t rc2 = ReportFinalize( rc );
-        if ( rc == 0 )
-            rc = rc2;
-    }
-    return rc;
-}
-
-
-rc_t CC Legacy_KMain( int argc, char* argv[] )
-{
-    char filename[ 4096 ];
-    /*
-       Try to find a option-file - parameter in the original parameters 
-       This is a hack to teach sam-dump to read it's parameters from a file/pipe instead
-       of the commandline
-       It is neccessary because the code above does not use libkapp to parse parameters!
-    */
-    rc_t rc = Args_find_option_in_argv( argc, argv, "--option-file", filename, sizeof filename );
-    if ( rc == 0 )
-    {
-        int new_argc;
-        char ** new_argv;
-        /* we found it! Now comes the special treatment: we fake a new argc/argv-pair! */
-        rc = Args_tokenize_file_and_progname_into_argv( filename, "sam-dump", &new_argc, &new_argv );
-        if ( rc == 0 )
-        {
-            /* pass the faked input-parameters from */
-            rc = SAM_Dump_Main( new_argc, new_argv );
-
-            Args_free_token_argv( new_argc, new_argv );
-        }
-    }
-    else
-    {
-        /* we did not found the special option, just use the commandline-parameters unchanged */
-        rc = SAM_Dump_Main( argc, argv );
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sam-dump.vers b/tools/sra-pileup/sam-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-pileup/sam-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-pileup/sam-dump3.c b/tools/sra-pileup/sam-dump3.c
deleted file mode 100644
index 0bea584..0000000
--- a/tools/sra-pileup/sam-dump3.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "sam-dump.vers.h"
-
-#include <kapp/main.h>
-#include <vdb/report.h> /* ReportSetVDBManager */
-#include <klib/report.h>
-#include <sysalloc.h>
-
-#include "sam-dump-opts.h"
-#include "inputfiles.h"
-#include "sam-hdr.h"
-#include "matecache.h"
-#include "cg_tools.h"
-#include "out_redir.h"
-#include "sam-aligned.h"
-#include "sam-unaligned.h"
-
-
-char const *sd_unaligned_usage[]      = { "Output unaligned reads along with aligned reads",
-                                       NULL };
-
-char const *sd_primaryonly_usage[]    = { "Output only primary alignments",
-                                       NULL };
-
-char const *sd_cigartype_usage[]      = { "Output long version of CIGAR",
-                                       NULL };
-
-char const *sd_cigarCG_usage[]        = { "Output CG version of CIGAR",
-                                       NULL };
-
-char const *sd_cigarCGMerge_usage[]   = { "Apply CG fixups to CIGAR/SEQ/QUAL and outputs CG-specific columns",
-                                       NULL };
-
-char const *sd_CG_evidence[]          = { "Output CG evidence aligned to reference", 
-                                       NULL };
-
-char const *sd_CG_ev_dnb[]            = { "Output CG evidence DNB's aligned to evidence",
-                                       NULL };
-
-char const *sd_CG_SAM[]               = { "Output CG evidence DNB's aligned to reference ", 
-                                       NULL };
-
-char const *sd_CG_mappings[]          = { "Output CG sequences aligned to reference ",
-                                       NULL };
-
-char const *sd_header_usage[]         = { "Always reconstruct header",
-                                       NULL };
-
-char const *sd_noheader_usage[]       = { "Do not output headers",
-                                       NULL };
-
-char const *sd_region_usage[]         = { "Filter by position on genome.",
-                                       "Name can either be file specific name (ex: \"chr1\" or \"1\").",
-                                       "\"from\" and \"to\" (inclusive) are 1-based coordinates",
-                                       NULL };
-
-char const *sd_distance_usage[]       = { "Filter by distance between matepairs.",
-                                       "Use \"unknown\" to find matepairs split between the references.",
-                                       "Use from-to (inclusive) to limit matepair distance on the same reference",
-                                       NULL };
-
-char const *sd_seq_id_usage[]         = { "Print reference SEQ_ID in RNAME instead of NAME",
-                                       NULL };
-
-char const *sd_identicalbases_usage[] = { "Output '=' if base is identical to reference",
-                                       NULL };
-
-char const *sd_gzip_usage[]           = { "Compress output using gzip",
-                                       NULL };
-
-char const *sd_bzip2_usage[]          = { "Compress output using bzip2",
-                                       NULL };
-
-char const *sd_qname_usage[]          = { "Add .SPOT_GROUP to QNAME",
-                                       NULL };
-
-char const *sd_fasta_usage[]          = { "Produce Fasta formatted output",
-                                       NULL };
-
-char const *sd_fastq_usage[]          = { "Produce FastQ formatted output",
-                                       NULL };
-
-char const *sd_prefix_usage[]         = { "Prefix QNAME: prefix.QNAME",
-                                       NULL };
-
-char const *sd_reverse_usage[]        = { "Reverse unaligned reads according to read type",
-                                       NULL };
-
-char const *sd_comment_usage[]        = { "Add comment to header. Use multiple times for several lines. Use quotes",
-                                       NULL };
-
-char const *sd_XI_usage[]             = { "Output cSRA alignment id in XI column",
-                                       NULL };
-
-char const *sd_qual_quant_usage[]     = { "Quality scores quantization level",
-                                       "a string like '1:10,10:20,20:30,30:-'",
-                                       NULL };
-
-char const *sd_report_usage[]         = { "report options instead of executing",
-                                       NULL };
-
-char const *sd_outputfile_usage[]     = { "print output into this file (instead of STDOUT)",
-                                       NULL };
-
-char const *sd_outbufsize_usage[]     = { "size of output-buffer(dflt:32k, 0...off)",
-                                       NULL };
-
-char const *sd_cachereport_usage[]    = { "print report about mate-pair-cache",
-                                       NULL };
-
-char const *sd_unaligned_only_usage[] = { "output reads for spots with no aligned reads",
-                                       NULL };
-
-char const *sd_cg_names_usage[]       = { "prints cg-style spotgroup.spotid fromed names",
-                                       NULL };
-
-char const *sd_cur_cache_usage[]      = { "open cached cursor with this size",
-                                       NULL };
-
-char const *sd_min_mapq_usage[]       = { "min. mapq an alignment has to have, to be printed",
-                                       NULL };
-
-char const *sd_no_mate_cache_usage[]  = { "do not use a mate-cache, slower but less memory usage",
-                                       NULL };
-
-char const *rna_splice_usage[]        = { "modify cigar-string and output flags if rna-splicing detected",
-                                       NULL };
-
-OptDef SamDumpArgs[] =
-{
-    { OPT_UNALIGNED,     "u", NULL, sd_unaligned_usage,      0, false, false },  /* print unaligned reads */
-    { OPT_PRIM_ONLY,     "1", NULL, sd_primaryonly_usage,    0, false, false },  /* print only primary alignments */
-    { OPT_CIGAR_LONG,    "c", NULL, sd_cigartype_usage,      0, false, false },  /* use long cigar-string instead of short */
-    { OPT_CIGAR_CG,     NULL, NULL, sd_cigarCG_usage,        0, false, false },  /* transform cigar into cg-style ( has B/N ) */
-    { OPT_RECAL_HDR,     "r", NULL, sd_header_usage,         0, false, false },  /* recalculate header */
-    { OPT_NO_HDR,        "n", NULL, sd_noheader_usage,       0, false, false },  /* do not print header */
-    { OPT_HDR_COMMENT,  NULL, NULL, sd_comment_usage,        0, true,  false },  /* insert this comment into header */
-    { OPT_REGION,       NULL, NULL, sd_region_usage,         0, true,  false },  /* filter by region */
-    { OPT_MATE_DIST,    NULL, NULL, sd_distance_usage,       0, true,  false },  /* filter by a list of mate-pair-distances */
-    { OPT_USE_SEQID,     "s", NULL, sd_seq_id_usage,         0, false, false },  /* print seq-id instead of seq-name*/
-    { OPT_HIDE_IDENT,    "=", NULL, sd_identicalbases_usage, 0, false, false },  /* replace bases that match the reference with '=' */
-    { OPT_GZIP,         NULL, NULL, sd_gzip_usage,           0, false, false },  /* compress the output with gzip */
-    { OPT_BZIP2,        NULL, NULL, sd_bzip2_usage,          0, false, false },  /* compress the output with bzip2 */
-    { OPT_SPOTGRP,       "g", NULL, sd_qname_usage,          0, false, false },  /* add spotgroup to qname */
-    { OPT_FASTQ,        NULL, NULL, sd_fastq_usage,          0, false, false },  /* output-format = fastq ( instead of SAM ) */
-    { OPT_FASTA,        NULL, NULL, sd_fasta_usage,          0, false, false },  /* output-format = fasta ( instead of SAM ) */
-    { OPT_PREFIX,        "p", NULL, sd_prefix_usage,         0, true,  false },  /* prefix QNAME with this string */
-    { OPT_REVERSE,      NULL, NULL, sd_reverse_usage,        0, false, false },  /* reverse unaligned reads if reverse-flag set*/
-    { OPT_TEST_ROWS,    NULL, NULL, NULL,                    0, true,  false },  /* test-rows, if >0 limit output to this amount of rows */
-    { OPT_MATE_GAP,     NULL, NULL, NULL,                    0, true,  false },  /* int value, mate's farther apart than this are not cached */
-    { OPT_CIGAR_CG_M,   NULL, NULL, sd_cigarCGMerge_usage,   0, false, false },  /* transform cg-data(length of read/patterns in cigar) into valid SAM (cigar/READ/QUALITY)*/
-    { OPT_XI_DEBUG,     NULL, NULL, sd_XI_usage,             0, false, false },  /* output alignment id for debugging... XI:I:NNNNNNN */
-    { OPT_Q_QUANT,       "Q", NULL, sd_qual_quant_usage,     0, true,  false },  /* quality-quantization string */
-    { OPT_CG_EVIDENCE,  NULL, NULL, sd_CG_evidence,          0, false, false },  /* CG-evidence */
-    { OPT_CG_EV_DNB,    NULL, NULL, sd_CG_ev_dnb,            0, false, false },  /* CG-ev-dnb */
-    { OPT_CG_MAPP,      NULL, NULL, sd_CG_mappings,          0, false, false },  /* CG-mappings */
-    { OPT_CG_SAM,       NULL, NULL, sd_CG_SAM,               0, false, false },  /* cga-tools emulation mode */
-    { OPT_REPORT,       NULL, NULL, sd_report_usage,         0, false, false },  /* report options instead of executing */
-    { OPT_OUTPUTFILE,   NULL, NULL, sd_outputfile_usage,     0, true,  false },  /* write into output-file */
-    { OPT_OUTBUFSIZE,   NULL, NULL, sd_outbufsize_usage,     0, true,  false },  /* size of output-buffer */
-    { OPT_CACHEREPORT,  NULL, NULL, sd_cachereport_usage,    0, false, false },  /* report usage of mate-pair-cache */
-    { OPT_UNALIGNED_ONLY,NULL, NULL, sd_unaligned_only_usage, 0, false, false }, /* print only unaligned spots */
-    { OPT_CG_NAMES,     NULL, NULL, sd_cg_names_usage,       0, false, false },  /* print cg-style spotnames */
-    { OPT_CURSOR_CACHE, NULL, NULL, sd_cur_cache_usage,      0, true,  false },  /* size of cursor cache */
-    { OPT_MIN_MAPQ,     NULL, NULL, sd_min_mapq_usage,       0, true,  false },  /* minimal mapping quality */
-    { OPT_NO_MATE_CACHE,NULL, NULL, sd_no_mate_cache_usage,  0, false, false },  /* do not use mate-cache */
-    { OPT_RNA_SPLICE,   NULL, NULL, rna_splice_usage,        0, false, false },  /* detect rna-splicing in sequence */
-    { OPT_DUMP_MODE,    NULL, NULL, NULL,                    0, true,  false },  /* how to produce aligned reads if no regions given */
-    { OPT_CIGAR_TEST,   NULL, NULL, NULL,                    0, true,  false },  /* test cg-treatment of cigar string */
-    { OPT_LEGACY,       NULL, NULL, NULL,                    0, false, false },  /* force legacy code-path */
-    { OPT_NEW,          NULL, NULL, NULL,                    0, false, false }   /* force new code-path */
-};
-
-char const *sd_usage_params[] =
-{
-    NULL,                       /* unaligned */
-    NULL,                       /* primaryonly */
-    NULL,                       /* cigartype */
-    NULL,                       /* cigarCG */
-    NULL,                       /* recalc header */
-    NULL,                       /* no-header */
-    "text",                     /* hdr-comment */
-    "name[:from-to]",           /* region */
-    "from-to|'unknown'",        /* mate distance filter*/
-    NULL,                       /* seq-id */
-    NULL,                       /* identical-bases */
-    NULL,                       /* gzip */
-    NULL,                       /* bzip2 */
-    NULL,                       /* qname */
-    NULL,                       /* fasta */
-    NULL,                       /* fastq */
-    "prefix",                   /* prefix */
-    NULL,                       /* reverse */
-    NULL,                       /* test-rows */
-    NULL,                       /* mate-row-gap-cacheable */
-    NULL,                       /* cigarCGMerge */
-    NULL,                       /* XI */
-    "quantization string",      /* qual-quant */
-    NULL,                       /* CG-evidence */
-    NULL,                       /* CG-ev-dnb */
-    NULL,                       /* CG-mappings */
-    NULL,                       /* CG-SAM */
-    NULL,                       /* report */
-    NULL,                       /* outputfile */
-    NULL,                       /* outputfile buffsize */
-    NULL,                       /* cachereport */
-    NULL,                       /* unaligned-only */
-    NULL,                       /* CG-names */
-    NULL,                       /* cursor cache */
-    NULL,                       /* min_mapq */
-    NULL,                       /* no mate-cache */
-    NULL,                       /* detect rna-splicing in sequence */
-    NULL,                       /* dump_mode */
-    NULL,                       /* cigar test */
-    NULL,                       /* force legacy code path */
-    NULL,                       /* force new code path */
-};
-
-ver_t CC KAppVersion( void )
-{
-    return SAM_DUMP_VERS;
-}
-
-const char UsageDefaultName[] = "sam-dump";
-
-
-rc_t CC UsageSummary( char const *progname )
-{
-    return KOutMsg( "Usage:\n"
-        "\t%s [options] path-to-run[ path-to-run ...]\n\n", progname );
-}
-
-
-rc_t CC Usage( Args const *args )
-{
-    char const *progname = UsageDefaultName;
-    char const *fullpath = UsageDefaultName;
-    rc_t rc;
-    unsigned i, n;
-
-    rc = ArgsProgram( args, &fullpath, &progname );
-
-    UsageSummary( progname );
-
-    KOutMsg( "Options:\n" );
-
-    n = sizeof( SamDumpArgs ) / sizeof( SamDumpArgs[ 0 ] );
-    n--; /* do not print the last option in the SamDumpArgs as help */
-    for( i = 0; i < n; i++ )
-    {
-        if ( SamDumpArgs[ i ].help != NULL )
-        {
-            HelpOptionLine( SamDumpArgs[ i ].aliases, SamDumpArgs[ i ].name,
-                            sd_usage_params[ i ], SamDumpArgs[ i ].help );
-        }
-    }
-    KOutMsg( "\n" );
-    HelpOptionsStandard();
-
-    HelpVersion( fullpath, KAppVersion() );
-
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-static rc_t CC write_to_FILE( void *f, const char *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = fwrite ( buffer, 1, bytes, f );
-    if ( * num_writ != bytes )
-        return RC( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-
-/* =========================================================================================== */
-
-
-static uint32_t tabsel_2_ReferenceList_Options( const samdump_opts * opts )
-{
-    uint32_t res = 0;
-    if ( opts->dump_primary_alignments )
-        res |= ereferencelist_usePrimaryIds;
-    if ( opts->dump_secondary_alignments )
-        res |= ereferencelist_useSecondaryIds;
-    if ( opts->dump_cg_evidence | opts->dump_cg_ev_dnb | opts->dump_cg_sam )
-        res |= ereferencelist_useEvidenceIds;
-    return res;
-}
-
-
-static rc_t print_samdump( const samdump_opts * const opts )
-{
-    KDirectory *dir;
-
-    rc_t rc = KDirectoryNativeDir( &dir );
-    if ( rc != 0 )
-    {
-        (void)LOGERR( klogErr, rc, "cannot create native directory" );
-    }
-    else
-    {
-        const VDBManager *mgr;
-        rc = VDBManagerMakeRead( &mgr, dir );
-        if ( rc != 0 )
-        {
-            (void)LOGERR( klogErr, rc, "cannot create vdb-manager" );
-        }
-        else
-        {
-            input_files * ifs; /* input_files.h */
-            uint32_t reflist_opt = tabsel_2_ReferenceList_Options( opts );
-
-            ReportSetVDBManager( mgr ); /**/
-
-            rc = discover_input_files( &ifs, mgr, opts->input_files, reflist_opt ); /* inputfiles.c */
-            if ( rc == 0 )
-            {
-                if ( ifs->database_count == 0 && ifs->table_count == 0 )
-                {
-                    rc = RC( rcExe, rcFile, rcReading, rcItem, rcNotFound );
-                    (void)LOGERR( klogErr, rc, "input object(s) not found" );
-                }
-                else
-                {
-                    matecache * mc = NULL;
-
-                    if ( opts->use_mate_cache )
-                        rc = make_matecache( &mc, ifs->database_count );
-
-                    if ( rc == 0 )
-                    {
-                        uint64_t rows_so_far = 0;
-
-                        /* print output of header */
-                        if ( ( opts->output_format == of_sam )  &&
-                             ( ifs->database_count > 0 )        &&
-                             ( opts->header_mode != hm_none )   &&
-                             !opts->dump_unaligned_only ) 
-                        /* ------------------------------------------------------ */
-                            rc = print_headers( opts, ifs ); /* sam-hdr.c */
-                        /* ------------------------------------------------------ */
-
-
-                        /* print output of aligned reads */
-                        if ( rc == 0 && 
-                             ifs->database_count > 0 && 
-                             !opts->dump_unaligned_only )
-                        /* ------------------------------------------------------ */
-                            rc = print_aligned_spots( opts, ifs, mc, &rows_so_far ); /* sam-aligned.c */
-                        /* ------------------------------------------------------ */
-
-
-                        /* print output of unaligned reads */
-                        if ( rc == 0 )
-                        {
-                            /* ------------------------------------------------------ */
-                            rc = print_unaligned_spots( opts, ifs, mc, &rows_so_far ); /* sam-unaligned.c */
-                            /* ------------------------------------------------------ */
-                        }
-
-                        if ( opts->use_mate_cache )
-                        {
-                            if ( opts->report_cache )
-                                rc = matecache_report( mc ); /* matecache.c */
-                            release_matecache( mc ); /* matecache.c */
-                        }
-                    }
-                }
-                release_input_files( ifs ); /* inputfiles.c */
-            }
-            VDBManagerRelease( mgr );
-        }
-        KDirectoryRelease( dir );
-    }
-    return rc;
-}
-
-
-static rc_t perform_cigar_test( const samdump_opts * const opts )
-{
-    rc_t rc;
-    cg_cigar_input input;
-    cg_cigar_output output;
-
-    memset( &input, 0, sizeof input );
-    memset( &output, 0, sizeof output );
-
-    input.p_cigar.len = string_size( opts->cigar_test );
-    input.p_cigar.ptr = opts->cigar_test;
-
-    rc = make_cg_cigar( &input, &output );
-    if ( rc == 0 )
-    {
-        KOutMsg( "%s\n", output.cigar );
-    }
-    else
-    {
-        (void)PLOGERR( klogErr, ( klogErr, rc, "error testing cg-cigar treatment '$(t)'", 
-                                  "t=%s", opts->cigar_test ) );
-    }
-    return rc;
-}
-
-/* =========================================================================================== */
-
-static rc_t samdump_main( Args * args, const samdump_opts * const opts )
-{
-    rc_t rc = 0;
-    out_redir redir; /* from out_redir.h */
-    enum out_redir_mode mode;
-
-    switch( opts->output_compression )
-    {
-        case oc_none  : mode = orm_uncompressed; break;
-        case oc_gzip  : mode = orm_gzip; break;
-        case oc_bzip2 : mode = orm_bzip2; break;
-    }
-
-    rc = init_out_redir( &redir, mode, opts->outputfile, opts->output_buffer_size ); /* from out_redir.c */
-    if ( rc == 0 )
-    {
-        if ( opts->report_options )
-        {
-            report_options( opts ); /* from sam-dump-opts.c */
-        }
-        else if ( opts->cigar_test != NULL )
-        {
-            rc = perform_cigar_test( opts );
-        }
-        else
-        {
-            if ( opts->input_file_count < 1 )
-            {
-                rc = RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcInvalid );
-                (void)LOGERR( klogErr, rc, "no inputfiles given at commandline" );
-                Usage( args );
-            }
-            else
-            {
-            /* ------------------------------------------------------ */
-                rc = print_samdump( opts );
-            /* ------------------------------------------------------ */
-            }
-        }
-        release_out_redir( &redir ); /* from out_redir.c */
-    }
-    return rc;
-}
-
-
-/* forward declaration, code is in sam-dump.c */
-rc_t CC Legacy_KMain( int argc, char* argv[] );
-
-
-rc_t CC KMain( int argc, char *argv [] )
-{
-    bool call_legacy_dumper = false;
-
-    rc_t rc = KOutHandlerSet( write_to_FILE, stdout );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-    }
-    else
-    {
-        Args * args;
-
-        KLogHandlerSetStdErr();
-        rc = ArgsMakeAndHandle( &args, argc, argv, 1, 
-                                SamDumpArgs, sizeof SamDumpArgs / sizeof SamDumpArgs [ 0 ] );
-        if ( rc == 0 )
-        {
-            samdump_opts opts; /* from sam-dump-opts.h */
-
-            memset( &opts, 0, sizeof opts );
-            rc = gather_options( args, &opts ); /* from sam-dump-opts.c */
-            if ( rc == 0 )
-            {
-                call_legacy_dumper = opts.force_legacy;
-                if ( !call_legacy_dumper )
-                {
-                    ReportBuildDate( __DATE__ );
-                    rc = samdump_main( args, &opts );
-                }
-                /* because the options have sub-structures, like tree/vector's */
-                release_options( &opts ); /* from sam-dump-opts.c */
-            }
-            ArgsWhack( args );
-        }
-    }
-
-    /* trick to call the legacy sam-dump code if cg-functionality is requested */
-    if ( call_legacy_dumper )
-    {
-        rc = Legacy_KMain( argc, argv );
-    }
-    else
-    {
-        /* Report execution environment if necessary */
-        rc_t rc2 = ReportFinalize( rc );
-        if ( rc == 0 )
-            rc = rc2;
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sam-hdr.c b/tools/sra-pileup/sam-hdr.c
deleted file mode 100644
index 0adc2fa..0000000
--- a/tools/sra-pileup/sam-hdr.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <align/reference.h>
-#include <sysalloc.h>
-
-#include "sam-dump-opts.h"
-#include "inputfiles.h"
-
-
-static rc_t print_headers_from_metadata( const VDatabase * db, bool * recalc, const char * path )
-{
-    const KMetadata * meta;
-    rc_t rc = VDatabaseOpenMetadataRead( db, &meta );
-    if ( rc != 0 )
-        (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open metadata from '$(t)'", "t=%s", path ) );
-    else
-    {
-        const KMDataNode * node;
-        rc = KMetadataOpenNodeRead( meta, &node, "BAM_HEADER" );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) == rcNotFound )
-            {
-                *recalc = true;
-                rc = 0;
-            }
-            else
-                (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open meta-node 'BAM_HEADER' from '$(t)'", "t=%s", path ) );
-        }
-        else
-        {
-            size_t offset = 0, num_read, remaining = ~0;
-            char buffer[ 40960 ];
-            while ( rc == 0 && remaining > 0 )
-            {
-                rc = KMDataNodeRead( node, offset, buffer, sizeof( buffer ),
-                                     &num_read, &remaining );
-                if ( rc == 0 )
-                {
-                    rc = KOutMsg( "%.*s", ( uint32_t )num_read, buffer );
-                    offset += num_read;
-                }
-            }
-            if ( rc == 0 && buffer[ num_read - 1 ] != '\n' )
-            {
-                rc = KOutMsg( "\n" );
-            }
-            KMDataNodeRelease( node );
-        }
-        KMetadataRelease( meta );
-    }
-    return rc;
-}
-
-
-typedef struct seq_id_node
-{
-    BSTNode node;
-    char * seq_id;
-    char * name;
-    INSDC_coord_len seq_len;
-} seq_id_node;
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = 0;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-
-static seq_id_node * make_seq_id_node( const char * seq_id, const char * name, INSDC_coord_len seq_len )
-{
-    seq_id_node *res = calloc( sizeof *res, 1 );
-    if ( res != NULL )
-    {
-        res->name = string_dup( name, string_size( name ) );
-        res->seq_id = string_dup( seq_id, string_size( seq_id ) );
-        res->seq_len = seq_len;
-    }
-    return res;
-}
-
-
-static void free_seq_id_node( seq_id_node * node )
-{
-    if ( node != NULL )
-    {
-        if ( node->seq_id != NULL )
-            free( node->seq_id );
-        if ( node->name != NULL )
-            free( node->name );
-        free( node );
-    }
-}
-
-
-static void CC free_seq_id_tree_callback( BSTNode *n, void * data )
-{
-    free_seq_id_node( ( seq_id_node * )n );
-}
-
-
-static void free_seq_id_tree( BSTree * tree )
-{
-    BSTreeWhack( tree, free_seq_id_tree_callback, NULL );
-}
-
-
-static int CC seq_id_node_vs_pchar_wrapper( const void *item, const BSTNode *n )
-{
-    const seq_id_node * node = ( const seq_id_node * )n;
-    return cmp_pchar( (const char *)item, node->seq_id );
-}
-
-
-static seq_id_node * find_seq_id_node( BSTree * tree, const char * key )
-{
-    return ( seq_id_node * ) BSTreeFind( tree, key, seq_id_node_vs_pchar_wrapper );
-}
-
-
-static int CC node_vs_node_wrapper( const BSTNode *item, const BSTNode *n )
-{
-   const seq_id_node * a = ( const seq_id_node * )item;
-   const seq_id_node * b = ( const seq_id_node * )n;
-   return cmp_pchar( a->seq_id, b->seq_id );
-}
-
-
-static rc_t add_seq_id_node( BSTree * tree, const char * seq_id, const char * name, INSDC_coord_len len )
-{
-    rc_t rc = 0;
-    seq_id_node * node = make_seq_id_node( seq_id, name, len );
-    if ( node != NULL )
-    {
-        rc = BSTreeInsert( tree, (BSTNode *)node, node_vs_node_wrapper );
-        if ( rc != 0 )
-            free_seq_id_node( node );
-    }
-    else
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    return rc;
-}
-
-
-static rc_t print_seq_id_tree( BSTree * tree, input_files * ifs )
-{
-    rc_t rc = 0;
-    uint32_t i;
-    for ( i = 0; i < ifs->database_count && rc == 0; ++i )
-    {
-        input_database * id = VectorGet( &ifs->dbs, i );
-        if ( id != NULL )
-        {
-            uint32_t rcount;
-            rc = ReferenceList_Count( id->reflist, &rcount );
-            if ( rc == 0 && rcount > 0 )
-            {
-                uint32_t r_idx;
-                for ( r_idx = 0; r_idx < rcount && rc == 0; ++r_idx )
-                {
-                    const ReferenceObj * ref_obj;
-                    rc = ReferenceList_Get( id->reflist, &ref_obj, r_idx );
-                    if ( rc == 0 && ref_obj != NULL )
-                    {
-                        const char * seqid;
-                        rc = ReferenceObj_SeqId( ref_obj, &seqid );
-                        if ( rc == 0 )
-                        {
-                            const char * name;
-                            rc = ReferenceObj_Name( ref_obj, &name );
-                            if ( rc == 0 )
-                            {
-                                INSDC_coord_len seq_len;
-                                rc = ReferenceObj_SeqLength( ref_obj, &seq_len );
-                                if ( rc == 0 )
-                                {
-                                    seq_id_node * node = find_seq_id_node( tree, seqid );
-                                    if ( node != NULL )
-                                    {
-                                        if ( node->seq_len != seq_len )
-                                            rc = RC( rcApp, rcNoTarg, rcConstructing, rcData, rcInvalid );
-                                    }
-                                    else
-                                        rc = add_seq_id_node( tree, seqid, name, seq_len );
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-typedef struct hdr_print_ctx
-{
-    rc_t rc;
-    bool use_seq_id;
-} hdr_print_ctx;
-
-
-static void CC print_header_callback( BSTNode *n, void *data )
-{
-    seq_id_node * node = ( seq_id_node * )n;
-    hdr_print_ctx * hctx = ( hdr_print_ctx * )data;
-    if ( hctx->rc == 0 )
-    {
-        if ( hctx->use_seq_id )
-            hctx->rc = KOutMsg( "@SQ\tSN:%s\tLN:%u\n", node->seq_id, node->seq_len );
-        else
-        {
-            if ( cmp_pchar( node->seq_id, node->name ) == 0 )
-                hctx->rc = KOutMsg( "@SQ\tSN:%s\tLN:%u\n", node->name, node->seq_len );
-            else
-                hctx->rc = KOutMsg( "@SQ\tSN:%s\tAS:%s\tLN:%u\n", node->name, node->seq_id, node->seq_len );
-        }
-    }
-}
-
-
-static rc_t extract_spotgroups( VNamelist * spotgroups, input_files * ifs )
-{
-    rc_t rc = 0;
-    uint32_t i;
-    for ( i = 0; i < ifs->database_count && rc == 0; ++i )
-    {
-        input_database * id = VectorGet( &ifs->dbs, i );
-        if ( id != NULL )
-        {
-            const VTable * tab;
-            rc = VDatabaseOpenTableRead( id->db, &tab, "SEQUENCE" );
-            if ( rc != 0 )
-                (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open table SEQUENCE in '$(t)'", "t=%s", id->path ) );
-            else
-            {
-                const KMetadata * meta;
-                rc = VTableOpenMetadataRead( tab, &meta );
-                if ( rc != 0 )
-                    (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open metadata from '$(t)'", "t=%s", id->path ) );
-                else
-                {
-                    const KMDataNode * node;
-                    rc = KMetadataOpenNodeRead( meta, &node, "STATS/SPOT_GROUP" );
-                    if ( rc != 0 )
-                       (void)PLOGERR( klogErr, ( klogErr, rc, "cannot open meta-node 'STATS/SPOT_GROUP' from '$(t)'", "t=%s", id->path ) );
-                    else
-                    {
-                        KNamelist * node_childs;
-                        rc = KMDataNodeListChildren( node, &node_childs );
-                        if ( rc != 0 )
-                            (void)PLOGERR( klogErr, ( klogErr, rc, "cannot list children of SPOT_GROUP-node in '$(t)'", "t=%s", id->path ) );
-                        else
-                        {
-                            uint32_t n_count;
-                            rc = KNamelistCount( node_childs, &n_count );
-                            if ( rc == 0 && n_count > 0 )
-                            {
-                                uint32_t n_idx;
-                                for ( n_idx = 0; n_idx < n_count && rc == 0; ++n_idx )
-                                {
-                                    const char * spotgroup;
-                                    rc = KNamelistGet( node_childs, n_idx, &spotgroup );
-                                    if ( rc == 0 && spotgroup != NULL )
-                                    {
-                                        uint32_t found;
-                                        rc_t rc1 = VNamelistIndexOf( spotgroups, spotgroup, &found );
-                                        if ( GetRCState( rc1 ) == rcNotFound )
-                                            rc = VNamelistAppend( spotgroups, spotgroup );
-                                    }
-                                }
-                            }
-                            KNamelistRelease( node_childs );
-                        }
-                        KMDataNodeRelease( node );
-                    }
-                    KMetadataRelease( meta );
-                }
-                VTableRelease( tab );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_spotgroups( VNamelist * spotgroups )
-{
-    uint32_t count;
-    rc_t rc = VNameListCount( spotgroups, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        uint32_t i;
-        for ( i = 0; i < count && rc == 0; ++i )
-        {
-            const char * s;
-            rc = VNameListGet( spotgroups, i, &s );
-            if ( rc == 0 && s != NULL )
-            {
-                if ( cmp_pchar( s, "default" ) != 0 )
-                    rc = KOutMsg( "@RG\tID:%s\n", s );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_headers_by_recalculating( const samdump_opts * opts, input_files * ifs )
-{
-    BSTree tree;
-    rc_t rc = KOutMsg( "@HD\tVN:1.3\n" );
-    if ( rc == 0 )
-    {
-        /* collect sequenc-id's and names and their lengths, unique by sequence-id */
-        BSTreeInit( &tree );
-        rc = print_seq_id_tree( &tree, ifs );
-        if ( rc == 0 )
-        {
-            hdr_print_ctx hctx;
-            hctx.rc = 0;
-            hctx.use_seq_id = opts->use_seqid_as_refname;
-            /* ptrint it */
-            BSTreeForEach( &tree, false, print_header_callback, &hctx );
-            rc = hctx.rc;
-        }
-        free_seq_id_tree( &tree );
-
-        /* collect spot-groups ( unique ) */
-        if ( rc == 0 )
-        {
-            VNamelist * spotgroups;
-            rc = VNamelistMake( &spotgroups, 10 );
-            if ( rc == 0 )
-            {
-                rc = extract_spotgroups( spotgroups, ifs );
-                if ( rc == 0 )
-                    rc = print_spotgroups( spotgroups );
-                VNamelistRelease( spotgroups );
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t print_headers( const samdump_opts * opts, input_files * ifs )
-{
-    rc_t rc = 0;
-    if ( ifs->database_count > 1 )
-        rc = print_headers_by_recalculating( opts, ifs );
-    else
-    {
-        bool recalc = false;
-        switch( opts->header_mode )
-        {
-        case hm_dump    :   {
-                                input_database * id = VectorGet( &ifs->dbs, 0 );
-                                rc = print_headers_from_metadata( id->db, &recalc, id->path );
-                                if ( rc == 0 && recalc )
-                                    rc = print_headers_by_recalculating( opts, ifs );
-                            }
-                            break;
-
-        case hm_recalc  :   rc = print_headers_by_recalculating( opts, ifs );
-                            break;
-
-        case hm_none    :   break; /* to not let the compiler complain about not handled enum */
-        }
-    }
-
-    /* attach header comments from the commandline */
-    if ( rc == 0 && opts->hdr_comments != NULL )
-    {
-        uint32_t count;
-        rc = VNameListCount( opts->hdr_comments, &count );
-        if ( rc == 0 && count > 0 )
-        {
-            uint32_t i;
-            for ( i = 0; i < count && rc == 0; ++i )
-            {
-                const char * s;
-                rc = VNameListGet( opts->hdr_comments, i, &s );
-                if ( rc == 0 && s != NULL )
-                    rc = KOutMsg( "@CO\t%s\n", s );
-            }
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sam-hdr.h b/tools/sra-pileup/sam-hdr.h
deleted file mode 100644
index 7b373c4..0000000
--- a/tools/sra-pileup/sam-hdr.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sam_headers_
-#define _h_sam_headers_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include "sam-dump-opts.h"
-#include "inputfiles.h"
-
-rc_t print_headers( const samdump_opts * opts, input_files * ifs );
-
-#endif
diff --git a/tools/sra-pileup/sam-unaligned.c b/tools/sra-pileup/sam-unaligned.c
deleted file mode 100644
index 09e9583..0000000
--- a/tools/sra-pileup/sam-unaligned.c
+++ /dev/null
@@ -1,1482 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "read_fkt.h"
-#include "sam-unaligned.h"
-#include <kapp/main.h>
-#include <sysalloc.h>
-#include <ctype.h>
-
-#define COL_READ "(INSDC:dna:text)READ"
-#define COL_REF_NAME "(ascii)REF_NAME"
-#define COL_REF_SEQ_ID "(ascii)REF_SEQ_ID"
-#define COL_REF_POS "(INSDC:coord:zero)REF_POS"
-
-typedef struct prim_table_ctx
-{
-    const VCursor * cursor;
-
-    uint32_t ref_name_idx;
-    uint32_t ref_seq_id_idx;
-    uint32_t ref_pos_idx;
-} prim_table_ctx;
-
-
-static rc_t prepare_prim_table_ctx( const samdump_opts * const opts, const input_table * const itab, prim_table_ctx * const ptx )
-{
-    rc_t rc;
-
-    if ( opts->cursor_cache_size == 0 )
-        rc = VTableCreateCursorRead( itab->tab, &ptx->cursor );
-    else
-        rc = VTableCreateCachedCursorRead( itab->tab, &ptx->cursor, opts->cursor_cache_size );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, "VTableCreateCursorRead( PRIMARY_ALIGNMENT ) for $(tn) failed", "tn=%s", itab->path ) );
-    }
-    else
-    {
-        rc = add_column( ptx->cursor, COL_REF_NAME, &ptx->ref_name_idx );
-        if ( rc == 0 )
-            rc = add_column( ptx->cursor, COL_REF_SEQ_ID, &ptx->ref_seq_id_idx );
-        if ( rc == 0 )
-            rc = add_column( ptx->cursor, COL_REF_POS, &ptx->ref_pos_idx );
-        if ( rc == 0 )
-        {
-            rc = VCursorOpen( ptx->cursor );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( PRIMARY_ALIGNMENT ) for $(tn) failed", "tn=%s", itab->path ) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-#define COL_ALIGN_COUNT "(U8)ALIGNMENT_COUNT"
-#define COL_SPOT_ID "(INSDC:SRA:spotid_t)SPOT_ID"
-#define COL_PRIM_AL_ID "(I64)PRIMARY_ALIGNMENT_ID"
-#define COL_READ_TYPE "(INSDC:SRA:xread_type)READ_TYPE"
-#define COL_READ_FILTER "(INSDC:SRA:read_filter)READ_FILTER"
-#define COL_READ_LEN "(INSDC:coord:len)READ_LEN"
-#define COL_READ_START "(INSDC:coord:zero)READ_START"
-/* #define COL_QUALITY "(INSDC:quality:text:phred_33)QUALITY" */
-#define COL_QUALITY "(INSDC:quality:phred)QUALITY"
-#define COL_SPOT_GROUP "(ascii)SPOT_GROUP"
-#define COL_NAME "(ascii)NAME"
-
-typedef struct seq_table_ctx
-{
-    const VCursor * cursor;
-
-    uint32_t align_count_idx;
-    uint32_t prim_al_id_idx;
-    uint32_t read_type_idx;
-    uint32_t read_filter_idx;
-    uint32_t read_len_idx;
-    uint32_t read_start_idx;
-    uint32_t read_idx;
-    uint32_t quality_idx;
-    uint32_t spot_group_idx;
-    uint32_t name_idx;
-} seq_table_ctx;
-
-
-static rc_t prepare_seq_table_ctx( const samdump_opts * const opts, const input_table * const itab, seq_table_ctx * const stx, bool legacy )
-{
-    struct KNamelist * available_columns;
-    rc_t rc = VTableListReadableColumns ( itab->tab, &available_columns );
-    if ( rc != 0 )
-    {
-        (void)PLOGERR( klogInt, ( klogInt, rc, 
-            "VTableListReadableColumns( SEQUENCE ) for $(tn) failed", "tn=%s", itab->path ) );
-    }
-    else
-    {
-        if ( opts->cursor_cache_size == 0 )
-            rc = VTableCreateCursorRead( itab->tab, &stx->cursor );
-        else
-            rc = VTableCreateCachedCursorRead( itab->tab, &stx->cursor, opts->cursor_cache_size );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VTableCreateCursorRead( SEQUENCE ) for $(tn) failed", "tn=%s", itab->path ) );
-        }
-        else
-        {
-            add_opt_column( stx->cursor, available_columns, COL_ALIGN_COUNT, &stx->align_count_idx ); /* read_fkt.c */
-            add_opt_column( stx->cursor, available_columns, COL_PRIM_AL_ID, &stx->prim_al_id_idx );
-            add_opt_column( stx->cursor, available_columns, COL_NAME, &stx->name_idx );
-
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_READ_TYPE, &stx->read_type_idx ); /* read_fkt.c */
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_READ_FILTER, &stx->read_filter_idx );
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_READ_LEN, &stx->read_len_idx );
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_READ_START, &stx->read_start_idx );
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_READ, &stx->read_idx );
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_QUALITY, &stx->quality_idx );
-            if ( rc == 0 )
-                rc = add_column( stx->cursor, COL_SPOT_GROUP, &stx->spot_group_idx );
-        }
-        KNamelistRelease( available_columns );
-    }
-    return rc;
-}
-
-
-typedef struct seq_row
-{
-    uint32_t nreads;
-
-    bool fully_unaligned;
-    bool partly_unaligned;
-    bool filtered_out;
-} seq_row;
-
-
-static rc_t complain_size_diff( int64_t row_id, const char * txt )
-{
-    rc_t rc = RC( rcExe, rcNoTarg, rcConstructing, rcSize, rcInvalid );
-    (void)PLOGERR( klogInt, ( klogInt, rc, "in row $(rn) of SEQUENCE.$(tx)", "rn=%ld,tx=%s", row_id, txt ) );
-    return rc;
-}
-
-
-static rc_t read_seq_row( const samdump_opts * const opts, const seq_table_ctx * const stx, const int64_t row_id, seq_row * const row )
-{
-    rc_t rc = 0;
-
-    if ( stx->align_count_idx == INVALID_COLUMN )
-    {
-        const INSDC_read_type *ptr;
-
-        row->fully_unaligned = true;
-        row->partly_unaligned = false;
-        row->filtered_out = false;
-        rc = read_INSDC_read_type_ptr( row_id, stx->cursor, stx->read_type_idx, &ptr, &row->nreads, "READ_TYPE" );
-    }
-    else
-    {
-        const uint8_t * u8ptr;
-        uint32_t len;
-
-        /* ALIGNMENT_COUNT ... only to detect if reads are unaligned, could be done with PRIMARY_ALINGMENT too,
-           but this one is only 8 bit instead of 64 bit, that means faster */
-        rc = read_uint8_ptr( row_id, stx->cursor, stx->align_count_idx, &u8ptr, &len, "ALIGN_COUNT" );
-        if ( rc == 0 )
-        {
-            uint32_t i, n;
-
-            row->nreads = len;
-            for ( i = 0, n = 0; i < len; ++i )
-                if ( u8ptr[ i ] != 0 )
-                    n++;
-            row->fully_unaligned = ( n == 0 );
-            row->partly_unaligned = ( n < len && n > 0 );
-
-            if ( row->partly_unaligned )
-                row->filtered_out = !opts->print_half_unaligned_reads;
-            else if ( row->fully_unaligned )
-                row->filtered_out = !opts->print_fully_unaligned_reads;
-            else
-                row->filtered_out = true;
-        }
-    }
-    return rc;
-}
-
-
-/**********************************************************************************
-
-    0x001   template having multiple fragments in sequencing
-            (row->nreads > 1 )
-
-    0x002   each fragment properly aligned according to the aligner
-            ( never the case in an unaligned read )
-
-    0x004   fragment unmapped
-            ( always true in an unaligned read )
-
-    0x008   next fragment in the template unmapped
-            ( is the mate aligned? next: read_idx+1, if read_idx==row->nreads-1 then read_idx-1 )
-
-    0x010   SEQ being reverse complemented
-            ( column 'READ_TYPE' has bit READ_TYPE_REVERSE set )
-
-    0x020   SEQ of the next fragment in the template being reversed
-            ( is the mate reversed? )
-
-    0x040   the first fragment in the template
-            ( read_idx == 0 )
-
-    0x080   the last fragment in the template
-            ( read_idx == ( row->nreads - 1 ) )
-
-    0x100   secondary alignment
-            ( never the case in an unaligned read )
-
-    0x200   not passing quality controls
-            ( column 'READ_FILTER' has bit READ_FILTER_REJECT set )
-
-    0x400   PCR or optical duplicate
-            ( column 'READ_FILTER' has bit READ_FILTER_CRITERIA set )
-
-**********************************************************************************/
-static uint32_t calculate_unaligned_sam_flags_db( uint32_t nreads, uint32_t read_idx,
-                                                  uint32_t mate_idx, int64_t mate_id,
-                                                  const INSDC_read_type * read_type,
-                                                  bool reverse_flag,
-                                                  const INSDC_read_filter * read_filter )
-{
-    uint32_t res = 0x04;
-
-    if ( nreads > 1 )
-    {
-        res |= 0x01;
-        /* the following test only make sense if there is a mate */
-
-        if ( mate_id == 0 )
-            res |= 0x08;
-        if ( ( read_type[ mate_idx ] & READ_TYPE_REVERSE ) == READ_TYPE_REVERSE )
-            res |= 0x020;
-        if ( read_idx == 0 )
-            res |= 0x040;
-        if ( read_idx == ( nreads - 1 ) )
-            res |= 0x080;
-    }
-
-    if ( reverse_flag )
-        res |= 0x010;
-    if ( ( read_filter[ read_idx ] & READ_FILTER_REJECT ) == READ_FILTER_REJECT )
-        res |= 0x200;
-    if ( ( read_filter[ read_idx ] & READ_FILTER_CRITERIA ) == READ_FILTER_CRITERIA )
-        res |= 0x400;
-    return res;
-}
-
-
-const char * ref_name_star = "*";
-
-static rc_t get_mate_info( const prim_table_ctx * const ptx, const matecache * const mc,
-                           const input_database * const ids, const int64_t row_id, const int64_t mate_id, const uint32_t nreads,
-                           const char ** mate_ref_name, uint32_t * const mate_ref_name_len, INSDC_coord_zero * const mate_ref_pos )
-{
-    rc_t rc = 0;
-
-    *mate_ref_name = ref_name_star;
-    *mate_ref_name_len = 1;
-    *mate_ref_pos = 0;
-    if ( nreads < 2 )
-        return rc;
-
-    if ( mate_id != 0 )
-    {
-        uint32_t ref_idx;
-        int64_t seq_spot_id;
-        rc = matecache_lookup_unaligned( mc, ids->db_idx, mate_id, mate_ref_pos, &ref_idx, &seq_spot_id );
-        if ( rc == 0 )
-        {
-            const ReferenceObj* refobj;
-            *mate_ref_pos += 1;
-            /* now we have to lookup the reference-name based on it's index into the ids->reflist */
-            rc = ReferenceList_Get( ids->reflist, &refobj, ref_idx );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogInt, ( klogInt, rc, "in row $(rn) of SEQUENCE.$(rx)", "rn=%ld,rx=%ld", mate_id, row_id ) );
-            }
-            else
-            {
-                rc = ReferenceObj_Name( refobj, mate_ref_name );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogInt, ( klogInt, rc, "in row $(rn) of SEQUENCE.$(rx)", "rn=%ld,rx=%ld", mate_id, row_id ) );
-                }
-                else
-                {
-                    *mate_ref_name_len = string_size( *mate_ref_name );
-                }
-            }
-        }
-        else if ( GetRCState( rc ) == rcNotFound )
-        {
-            /* we have a mate and it is aligned! ---> look it up in the PRIMARY_ALIGNMENT - table*/
-            const char * ptr;
-            uint32_t len;
-
-            rc = read_char_ptr( mate_id, ptx->cursor, ptx->ref_name_idx, &ptr, &len, "REF_NAME" );
-            if ( rc == 0 && len > 0 )
-            {
-                *mate_ref_name = ptr;
-                *mate_ref_name_len = len;
-            }
-
-            if ( rc == 0 )
-            {
-                INSDC_coord_zero pos;
-                rc = read_INSDC_coord_zero( mate_id, ptx->cursor, ptx->ref_pos_idx, &pos, 0, "REF_POS" );
-                if ( rc == 0 )
-                {
-                    *mate_ref_pos = ( pos + 1 );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_sliced_read( const INSDC_dna_text * read, uint32_t read_idx,
-                               bool reverse, const INSDC_coord_zero * read_start, const INSDC_coord_len * read_len )
-{
-    rc_t rc = 0;
-    const INSDC_dna_text * ptr = read + read_start[ read_idx ];
-    if ( !reverse )
-    {
-        rc = KOutMsg( "%.*s", read_len[ read_idx ], ptr );
-    }
-    else
-    {
-        const char cmp_tbl [] =
-        {
-            'T', 'V', 'G', 'H', 'E', 'F', 'C', 'D',
-            'I', 'J', 'M', 'L', 'K', 'N', 'O', 'P',
-            'Q', 'Y', 'S', 'A', 'U', 'B', 'W', 'X',
-            'R', 'Z'
-        };
-
-        int32_t i = ( read_len[ read_idx ] - 1 );
-        while( i >= 0 && rc == 0 )
-        {
-            int c = ptr [ i ];
-            if ( isalpha ( c ) )
-            {
-                if ( islower ( c )  )
-                     c = tolower ( cmp_tbl [ toupper ( c ) - 'A' ] );
-                else
-                     c = cmp_tbl [ c - 'A' ];
-            }
-
-            rc = KOutMsg( "%c", ( char ) c );
-            i--;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_sliced_quality( const samdump_opts * const opts, const char * quality, uint32_t read_idx,
-                                  bool reverse, const INSDC_coord_zero * read_start, const INSDC_coord_len * read_len )
-{
-    const char * ptr = quality + read_start[ read_idx ];
-    return dump_quality( opts, ptr, read_len[ read_idx ], reverse ); /* sam-dump-opts.c */
-}
-
-
-static rc_t dump_the_other_read( const seq_table_ctx * const stx, const prim_table_ctx * const ptx,
-                                 const int64_t row_id, const uint32_t mate_idx )
-{
-    uint32_t row_len;
-    const int64_t *prim_al_id_ptr;
-
-    /* read from the SEQUENCE-table the value of the colum "PRIMARY_ALIGNMENT_ID"[ mate_idx ] */
-    rc_t rc = read_int64_ptr( row_id, stx->cursor, stx->prim_al_id_idx, &prim_al_id_ptr, &row_len, "PRIM_AL_ID" );
-    if ( rc == 0 )
-    {
-        if ( row_len == 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "rowlen zero in row $(rn) of SEQUENCE.PRIMARY_ALIGNMENT_ID", "rn=%ld", row_id ) );
-        }
-        else if ( mate_idx >= row_len )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "mate_idx invalid in row $(rn) of SEQUENCE.PRIMARY_ALIGNMENT_ID", "rn=%ld", row_id ) );
-        }
-        else
-        {
-            /* read from the PRIMARY_ALIGNMENT_TABLE the value of the columns "REF_NAME" and "REF_POS" */
-            int64_t a_row_id = prim_al_id_ptr[ mate_idx ];
-            if ( a_row_id == 0 )
-            {
-                rc = KOutMsg( "*\t0\t" );
-            }
-            else
-            {
-                const char * ref_name;
-                uint32_t ref_name_len;
-                rc = read_char_ptr( a_row_id, ptx->cursor, ptx->ref_name_idx, &ref_name, &ref_name_len, "REF_NAME" );
-                if ( rc == 0 )
-                {
-                    if ( ref_name_len == 0 )
-                    {
-                        (void)PLOGERR( klogInt, ( klogInt, rc, "rowlen zero in row $(rn) of PRIM.REF_NAME", "rn=%ld", a_row_id ) );
-                    }
-                    else
-                    {
-                        const INSDC_coord_zero *ref_pos;
-                        rc = read_INSDC_coord_zero_ptr( a_row_id, ptx->cursor, ptx->ref_pos_idx, &ref_pos, &row_len, "REF_POS" );
-                        if ( rc == 0 )
-                        {
-                            rc = KOutMsg( "%.*s\t%i\t", ref_name_len, ref_name, ref_pos[ 0 ] + 1 );
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static uint32_t calc_mate_idx( const uint32_t n_reads, const uint32_t read_idx )
-{
-    if ( read_idx == ( n_reads - 1 ) )
-        return ( read_idx - 1 );
-    else
-        return ( read_idx + 1 );
-}
-
-
-static rc_t read_quality( const seq_table_ctx * const stx,
-                          const int64_t row_id, const char **quality, const uint32_t read_len )
-{
-    uint32_t quality_len;
-    rc_t rc = read_char_ptr( row_id, stx->cursor, stx->quality_idx, quality, &quality_len, "QUALITY" );
-    if ( rc == 0 && read_len != quality_len )
-        rc = complain_size_diff( row_id, "QUALITY" );
-    return rc;
-}
-
-
-static rc_t read_read_type( const seq_table_ctx * const stx,
-                            const int64_t row_id, const INSDC_read_type **read_type, const uint32_t read_len )
-{
-    uint32_t read_type_len;
-    rc_t rc = read_INSDC_read_type_ptr( row_id, stx->cursor, stx->read_type_idx, read_type, &read_type_len, "READ_TYPE" );
-    if ( rc == 0 && read_type_len != read_len )
-        rc = complain_size_diff( row_id, "READ_TYPE" );
-    return rc;
-}
-
-
-static rc_t read_read_filter( const seq_table_ctx * const stx,
-                              const int64_t row_id, const INSDC_read_filter **read_filter, const uint32_t read_len )
-{
-    uint32_t read_filter_len;
-    rc_t rc = read_INSDC_read_filter_ptr( row_id, stx->cursor, stx->read_filter_idx, read_filter, &read_filter_len, "READ_FILTER" );
-    if ( rc == 0 && read_filter_len != read_len )
-        rc = complain_size_diff( row_id, "READ_FILTER" );
-    return rc;
-}
-
-
-static rc_t read_read_start( const seq_table_ctx * const stx,
-                             const int64_t row_id, const INSDC_coord_zero **read_start, const uint32_t nreads )
-{
-    uint32_t read_start_len;
-    rc_t rc = read_INSDC_coord_zero_ptr( row_id, stx->cursor, stx->read_start_idx, read_start, &read_start_len, "READ_START" );
-    if ( rc == 0 && nreads != read_start_len )
-        rc = complain_size_diff( row_id, "READ_START" );
-    return rc;
-}
-
-
-static rc_t read_read_len( const seq_table_ctx * const stx,
-                           const int64_t row_id, const INSDC_coord_len **read_len, const uint32_t nreads )
-{
-    uint32_t read_len_len;
-    rc_t rc = read_INSDC_coord_len_ptr( row_id, stx->cursor, stx->read_len_idx, read_len, &read_len_len, "READ_LEN" );
-    if ( rc == 0 && nreads != read_len_len )
-        rc = complain_size_diff( row_id, "READ_LEN" );
-    return rc;
-}
-
-
-static bool calc_reverse_flag( const samdump_opts * const opts, const uint32_t read_idx, const INSDC_read_type * read_type )
-{
-    bool res = ( ( read_type[ read_idx ] & READ_TYPE_REVERSE ) == READ_TYPE_REVERSE );
-    if ( res )
-        res = opts -> reverse_unaligned_reads;
-    return res;
-}
-
-
-static rc_t dump_seq_row_sam_filtered( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                                       const prim_table_ctx * const ptx, const matecache * const mc,
-                                       const input_database * const ids, const int64_t row_id, const uint32_t nreads,
-                                       uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, prim_align_ids_len, spot_group_len;
-    const int64_t * prim_align_ids;
-    const char * spot_group = NULL;
-    const char * quality = NULL;
-    const INSDC_dna_text * read = NULL;
-    const INSDC_read_type * read_type = NULL;
-    const INSDC_read_filter * read_filter = NULL;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_int64_ptr( row_id, stx->cursor, stx->prim_al_id_idx, &prim_align_ids, &prim_align_ids_len, "PRIM_AL_ID" );
-    if ( rc == 0 && nreads != prim_align_ids_len )
-        rc = complain_size_diff( row_id, "PRIMARY_ALIGNMENT_ID" );
-    if ( rc == 0 )
-        rc = read_read_len( stx, row_id, &read_len, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        int64_t align_id = prim_align_ids[ read_idx ];
-        if ( align_id == 0 &&              /* read is NOT aligned! */
-             read_len[ read_idx ] > 0 )    /* and has a length! */
-        {
-            uint32_t mate_idx = calc_mate_idx( nreads, read_idx );
-
-            /*  here we have to find out if the read is actually requested: 
-                -----------------------------------------------------------
-                read from the SEQ-table the ID of the mate in PRIM-table
-                look if we have the requested ID in the mate-cache, if not here it ends...
-            */
-            align_id = prim_align_ids[ mate_idx ];
-            if ( align_id != 0 )
-            {
-                uint32_t ref_idx;
-                INSDC_coord_zero mate_ref_pos;
-                int64_t seq_spot_id;
-                /* this is the filter: we look up in the mate-cache! */
-                rc = matecache_lookup_unaligned( mc, ids->db_idx, align_id, &mate_ref_pos, &ref_idx, &seq_spot_id );
-                if ( rc == 0 )
-                {
-                    const ReferenceObj* refobj;
-                    /* now we have to lookup the reference-name based on it's index into the ids->reflist */
-                    rc = ReferenceList_Get( ids->reflist, &refobj, ref_idx );
-                    if ( rc != 0 )
-                    {
-                        (void)PLOGERR( klogInt, ( klogInt, rc, "in row $(rn) of SEQUENCE.$(rx)", "rn=%ld,rx=%ld", mate_idx, row_id ) );
-                    }
-                    else
-                    {
-                        const char * mate_ref_name;
-                        rc = ReferenceObj_Name( refobj, &mate_ref_name );
-                        if ( rc != 0 )
-                        {
-                            (void)PLOGERR( klogInt, ( klogInt, rc, "in row $(rn) of SEQUENCE.$(rx)", "rn=%ld,rx=%ld", mate_idx, row_id ) );
-                        }
-                        else
-                        {
-                            bool reverse = false;
-
-                            /* SAM-FIELD: QNAME     SRA-column: SPOT_ID ( int64 ) */
-                            if ( rc == 0 )
-                                rc = KOutMsg( "%ld\t", seq_spot_id );
-
-                            if ( rc == 0 && read_type == NULL )
-                                rc = read_read_type( stx, row_id, &read_type, nreads );
-
-                            if ( rc == 0 )
-                                reverse = calc_reverse_flag( opts, read_idx, read_type );
-
-                            if ( rc == 0 && read_filter == NULL )
-                                rc = read_read_filter( stx, row_id, &read_filter, nreads );
-
-                            /* SAM-FIELD: FLAG      SRA-column: calculated from READ_TYPE, READ_FILTER etc. */
-                            if ( rc == 0 )
-                            {
-                                uint32_t sam_flags = calculate_unaligned_sam_flags_db( nreads, read_idx, mate_idx, 
-                                                                                    align_id, read_type, reverse, read_filter );
-                                rc = KOutMsg( "%u\t", sam_flags );
-                            }
-
-                            /* SAM-FIELD: RNAME     SRA-column: none, fix '*' */
-                            /* SAM-FIELD: POS       SRA-column: none, fix '0' */
-                            /* SAM-FIELD: MAPQ      SRA-column: none, fix '0' */
-                            /* SAM-FIELD: CIGAR     SRA-column: none, fix '*' */
-                            if ( rc == 0 )
-                                rc = KOutMsg( "*\t0\t0\t*\t" );
-
-                            /* SAM-FIELD: RNEXT     SRA-column: found in cache */
-                            /* SAM-FIELD: POS       SRA-column: found in cache */
-                            if ( rc == 0 )
-                                rc = KOutMsg( "%s\t%li\t", mate_ref_name, mate_ref_pos + 1 );
-
-                            /* SAM-FIELD: TLEN      SRA-column: none, fix '0' */
-                            if ( rc == 0 )
-                                rc = KOutMsg( "0\t" );
-
-                            if ( rc == 0 && read == NULL )
-                                rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-                            if ( rc == 0 && quality == NULL )
-                                rc = read_quality( stx, row_id, &quality, rd_len );
-                            if ( rc == 0 && read_start == NULL )
-                                rc = read_read_start( stx, row_id, &read_start, nreads );
-
-                            /* SAM-FIELD: SEQ       SRA-column: READ, sliced by READ_START/READ_LEN */
-                            if ( rc == 0 )
-                                rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-                            if ( rc == 0 )
-                                rc = KOutMsg( "\t" );
-
-                            /* SAM-FIELD: QUAL      SRA-column: QUALITY, sliced by READ_START/READ_LEN */
-                            if ( rc == 0 )
-                                rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-
-                            /* OPT SAM-FIIELD:      SRA-column: ALIGN_ID */
-                            if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-                                rc = KOutMsg( "\tXI:i:%u", row_id );
-
-                            /* OPT SAM-FIIELD:      SRA-column: SPOT_GROUP */
-                            if ( rc == 0 && spot_group == NULL )
-                                rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-                            if ( rc == 0 )
-                                rc = KOutMsg( "\tRG:Z:%.*s", spot_group_len, spot_group );
-
-                            if ( rc == 0 )
-                                rc = KOutMsg( "\n" );
-
-                            if ( rc == 0 )
-                                (*printed)++;
-                        }
-                    }
-                }
-                else
-                {
-                    rc = 0;     /* it is OK if an alignment is not found in the cache, do not terminate! */
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t dump_seq_prim_row_sam( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                                   const prim_table_ctx * const ptx, const matecache * const mc,
-                                   const input_database * const ids, const int64_t row_id, const uint32_t nreads,
-                                   uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, prim_align_ids_len, spot_group_len;
-    const int64_t * prim_align_ids;
-    const char * spot_group = NULL;
-    const char * quality = NULL;
-    const INSDC_dna_text * read = NULL;
-    const INSDC_read_type * read_type = NULL;
-    const INSDC_read_filter * read_filter = NULL;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_int64_ptr( row_id, stx->cursor, stx->prim_al_id_idx, &prim_align_ids, &prim_align_ids_len, "PRIM_AL_ID" );
-    if ( rc == 0 && nreads != prim_align_ids_len )
-        rc = complain_size_diff( row_id, "PRIMARY_ALIGNMENT_ID" );
-    if ( rc == 0 )
-        rc = read_read_len( stx, row_id, &read_len, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        if ( prim_align_ids[ read_idx ] == 0 &&     /* read is NOT aligned! */
-             read_len[ read_idx ] > 0 )             /* and has a length! */
-        {
-            bool reverse = false, mate_available = false;
-            uint32_t mate_idx = 0;
-            int64_t mate_id = 0;
-
-            if ( nreads > 1 )
-            {
-                if ( read_idx == ( nreads - 1 ) )
-                    mate_idx = read_idx - 1;
-                else
-                    mate_idx = read_idx + 1;
-                mate_available = true;
-            }
-
-            if ( mate_available && mate_idx < prim_align_ids_len ) 
-                mate_id = prim_align_ids[ mate_idx ];
-
-            if ( rc == 0 && read_type == NULL )
-                rc = read_read_type( stx, row_id, &read_type, nreads );
-            if ( rc == 0 )
-                reverse = calc_reverse_flag( opts, read_idx, read_type );
-
-            if ( rc == 0 && read_filter == NULL )
-                rc = read_read_filter( stx, row_id, &read_filter, nreads );
-
-            /* SAM-FIELD: QNAME     SRA-column: SPOT_ID ( int64 ) */
-            if ( rc == 0 )
-                rc = KOutMsg( "%ld\t", row_id );
-
-            /* SAM-FIELD: FLAG      SRA-column: calculated from READ_TYPE, READ_FILTER etc. */
-            if ( rc == 0 )
-            {
-                uint32_t sam_flags;
-                if ( stx->prim_al_id_idx != INVALID_COLUMN )
-                {
-                    uint32_t temp_nreads = nreads;
-                    if ( mate_id == 0 && read_len[ mate_idx ] == 0 ) temp_nreads--;
-                    sam_flags = calculate_unaligned_sam_flags_db( temp_nreads, read_idx, mate_idx, 
-                                            mate_id, read_type, reverse, read_filter );
-                }
-                else
-                {
-                    if ( reverse )
-                        sam_flags = ( 0x04 | 0x10 );
-                    else
-                        sam_flags = 0x04;
-                }
-                rc = KOutMsg( "%u\t", sam_flags );
-            }
-
-            /* SAM-FIELD: RNAME     SRA-column: none, fix '*' */
-            /* SAM-FIELD: POS       SRA-column: none, fix '0' */
-            /* SAM-FIELD: MAPQ      SRA-column: none, fix '0' */
-            /* SAM-FIELD: CIGAR     SRA-column: none, fix '*' */
-            if ( rc == 0 )
-                rc = KOutMsg( "*\t0\t0\t*\t" );
-
-            /* SAM-FIELD: RNEXT     SRA-column: look up in cache, or none */
-            /* SAM-FIELD: POS       SRA-column: look up in cache, or none */
-            if ( rc == 0 )
-            {
-                if ( ptx == NULL )
-                {
-                    rc = KOutMsg( "0\t0\t" );   /* no way to get that without PRIM_ALIGN-table */
-                }
-                else
-                {
-                    if ( opts->use_mate_cache && mc != NULL && ids != NULL )
-                    {
-                        const char * mate_ref_name;
-                        uint32_t mate_ref_name_len;
-                        INSDC_coord_zero mate_ref_pos;
-
-                        rc = get_mate_info( ptx, mc, ids, row_id, mate_id, nreads, &mate_ref_name, &mate_ref_name_len, &mate_ref_pos );
-                        if ( rc == 0 )
-                            rc = KOutMsg( "%.*s\t%li\t", mate_ref_name_len, mate_ref_name, mate_ref_pos );
-                    }
-                    else
-                    {
-                        /* print the mate info */
-                        rc = dump_the_other_read( stx, ptx, row_id, mate_idx );
-                    }
-                }
-            }
-
-
-            /* SAM-FIELD: TLEN      SRA-column: none, fix '0' */
-            if ( rc == 0 )
-                rc = KOutMsg( "0\t" );
-
-            if ( rc == 0 && read == NULL )
-                rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-            if ( rc == 0 && read_start == NULL )
-                rc = read_read_start( stx, row_id, &read_start, nreads );
-
-            /* SAM-FIELD: SEQ       SRA-column: READ, sliced by READ_START/READ_LEN */
-            if ( rc == 0 )
-                rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-            if ( rc == 0 )
-                rc = KOutMsg( "\t" );
-
-            if ( rc == 0 && quality == NULL )
-                rc = read_quality( stx, row_id, &quality, rd_len );
-
-            /* SAM-FIELD: QUAL      SRA-column: QUALITY, sliced by READ_START/READ_LEN */
-            if ( rc == 0 )
-                rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-
-            /* OPT SAM-FIIELD:      SRA-column: ALIGN_ID */
-            if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-                rc = KOutMsg( "\tXI:i:%u", row_id );
-
-            /* OPT SAM-FIIELD:      SRA-column: SPOT_GROUP */
-            if ( rc == 0 && spot_group == NULL )
-                rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-            if ( rc == 0 )
-                rc = KOutMsg( "\tRG:Z:%.*s", spot_group_len, spot_group );
-
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-
-            if ( rc == 0 )
-                (*printed)++;
-        }
-    }
-    return rc;
-}
-
-
-/* called if we are dumping from a legacy table instead from a database */
-static rc_t dump_seq_row_sam( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                              const int64_t row_id, const uint32_t nreads, uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, spot_group_len, name_len;
-    const char * spot_group = NULL;
-    const char * quality = NULL;
-    const char * name = NULL;
-    const INSDC_dna_text * read = NULL;
-    const INSDC_read_type * read_type;
-    const INSDC_read_filter * read_filter = NULL;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_read_len( stx, row_id, &read_len, nreads );
-    if ( rc == 0 )
-    {
-        if ( stx->name_idx != COL_NOT_AVAILABLE )
-            rc = read_char_ptr( row_id, stx->cursor, stx->name_idx, &name, &name_len, "NAME" );
-        else
-            name_len = 0;
-    }
-    if ( rc == 0 )
-        rc = read_read_type( stx, row_id, &read_type, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        if ( ( read_len[ read_idx ] > 0 ) &&             /* has a length! */
-             ( ( read_type[ read_idx ] & READ_TYPE_BIOLOGICAL ) == READ_TYPE_BIOLOGICAL ) )
-        {
-            bool reverse = false;
-            uint32_t mate_idx = 0;
-
-            if ( nreads > 1 )
-            {
-                if ( read_idx == ( nreads - 1 ) )
-                    mate_idx = read_idx - 1;
-                else
-                    mate_idx = read_idx + 1;
-            }
-
-            if ( rc == 0 ) /* types in interfaces/insdc/insdc.h */
-                reverse = calc_reverse_flag( opts, read_idx, read_type );
-
-            if ( rc == 0 && read_filter == NULL )
-                rc = read_read_filter( stx, row_id, &read_filter, nreads );
-
-            /* SAM-FIELD: QNAME     SRA-column: SPOT_ID ( int64 ) */
-            if ( rc == 0 )
-            {
-                if ( name != NULL && name_len > 0 )
-                    rc = KOutMsg( "%.*s\t", name_len, name );
-                else
-                    rc = KOutMsg( "%lu\t", row_id );
-            }
-
-            /* SAM-FIELD: FLAG      SRA-column: calculated from READ_TYPE, READ_FILTER etc. */
-            if ( rc == 0 )
-            {
-                uint32_t sam_flags = calculate_unaligned_sam_flags_db( nreads, read_idx, mate_idx, 
-                                            0, read_type, reverse, read_filter );
-                rc = KOutMsg( "%u\t", sam_flags );
-            }
-
-            /* SAM-FIELD: RNAME     SRA-column: none, fix '*' */
-            /* SAM-FIELD: POS       SRA-column: none, fix '0' */
-            /* SAM-FIELD: MAPQ      SRA-column: none, fix '0' */
-            /* SAM-FIELD: CIGAR     SRA-column: none, fix '*' */
-            /* SAM-FIELD: RNEXT     SRA-column: none, fix '*' */
-            /* SAM-FIELD: POS       SRA-column: none, fix '0' */
-            /* SAM-FIELD: TLEN      SRA-column: none, fix '0' */
-
-            if ( rc == 0 )
-                rc = KOutMsg( "*\t0\t0\t*\t*\t0\t0\t" );
-
-            if ( rc == 0 && read == NULL )
-                rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-            if ( rc == 0 && read_start == NULL )
-                rc = read_read_start( stx, row_id, &read_start, nreads );
-
-            /* SAM-FIELD: SEQ       SRA-column: READ, sliced by READ_START/READ_LEN */
-            if ( rc == 0 )
-                rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-            if ( rc == 0 )
-                rc = KOutMsg( "\t" );
-
-            if ( rc == 0 && quality == NULL )
-                rc = read_quality( stx, row_id, &quality, rd_len );
-
-            /* SAM-FIELD: QUAL      SRA-column: QUALITY, sliced by READ_START/READ_LEN */
-            if ( rc == 0 )
-                rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-
-            /* OPT SAM-FIIELD:      SRA-column: ALIGN_ID */
-            if ( rc == 0 && opts->print_alignment_id_in_column_xi )
-                rc = KOutMsg( "\tXI:i:%u", row_id );
-
-            /* OPT SAM-FIIELD:      SRA-column: SPOT_GROUP */
-            if ( rc == 0 && spot_group == NULL )
-                rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-            if ( rc == 0 && ( spot_group != NULL ) && ( spot_group_len > 0 ) )
-                rc = KOutMsg( "\tRG:Z:%.*s", spot_group_len, spot_group );
-
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-
-            if ( rc == 0 )
-                (*printed)++;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t dump_seq_row_fastx_filtered( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                                         const prim_table_ctx * const ptx, const matecache * const mc,
-                                         const input_database * const ids,
-                                         const int64_t row_id, const uint32_t nreads, uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, prim_align_ids_len, spot_group_len = 0;
-    const int64_t * prim_align_ids;
-    const char * quality = NULL;
-    const INSDC_dna_text * read = NULL;
-    const char * spot_group = NULL;
-    const INSDC_read_type * read_type = NULL;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_int64_ptr( row_id, stx->cursor, stx->prim_al_id_idx, &prim_align_ids, &prim_align_ids_len, "PRIM_AL_ID" );
-    if ( rc == 0 && nreads != prim_align_ids_len )
-        rc = complain_size_diff( row_id, "PRIMARY_ALIGNMENT_ID" );
-    if ( rc == 0 )
-        rc = read_read_len( stx, row_id, &read_len, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        if ( prim_align_ids[ read_idx ] == 0 &&    /* read is NOT aligned! */
-             read_len[ read_idx ] > 0 )            /* and has a length! */
-        {
-            uint32_t mate_idx = calc_mate_idx( nreads, read_idx );
-            int64_t align_id = prim_align_ids[ mate_idx ];
-            if ( align_id != 0 )
-            {
-                uint32_t ref_idx;
-                INSDC_coord_zero mate_ref_pos;
-                int64_t seq_spot_id;
-                rc = matecache_lookup_unaligned( mc, ids->db_idx, align_id, &mate_ref_pos, &ref_idx, &seq_spot_id );
-                if ( rc == 0 )
-                {
-                    bool reverse;
-
-                    /* the NAME */
-                    if ( opts->output_format == of_fastq )
-                        rc = KOutMsg( "@" );
-                    else
-                        rc = KOutMsg( ">" );
-
-                    if ( rc == 0 )
-                    {
-                        if ( opts->print_spot_group_in_name && spot_group == NULL )
-                            rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-                        if ( rc == 0 )
-                            rc = dump_name( opts, seq_spot_id, spot_group, spot_group_len ); /* sam-dump-opts.c */
-                        if ( rc == 0 )
-                            rc = KOutMsg( "/%u unaligned\n", read_idx + 1 );
-                    }
-
-                    if ( rc == 0 && read == NULL )
-                        rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-                    if ( rc == 0 && quality == NULL )
-                        rc = read_quality( stx, row_id, &quality, rd_len );
-                    if ( rc == 0 && read_type == NULL )
-                        rc = read_read_type( stx, row_id, &read_type, nreads );
-                    if ( rc == 0 )
-                        reverse = ( ( read_type[ read_idx ] & READ_TYPE_REVERSE ) == READ_TYPE_REVERSE );
-                    if ( rc == 0 && read_start == NULL )
-                        rc = read_read_start( stx, row_id, &read_start, nreads );
-
-                    /* the READ */
-                    if ( rc == 0 )
-                        rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-                    if ( rc == 0 )
-                        rc = KOutMsg( "\n" );
-
-                    /* in case of fastq : the QUALITY-line */
-                    if ( rc == 0 && opts->output_format == of_fastq )
-                    {
-                        rc = KOutMsg( "+\n" );
-                        if ( rc == 0 )
-                            rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-                        if ( rc == 0 )
-                            rc = KOutMsg( "\n" );
-                    }
-                    (*printed)++;
-                }
-                else
-                {
-                    rc = 0;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t dump_seq_row_fastx( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                                const int64_t row_id, const uint32_t nreads, uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, prim_align_ids_len, spot_group_len = 0;
-    const int64_t * prim_align_ids;
-    const char * quality = NULL;
-    const INSDC_dna_text * read = NULL ;
-    const char * spot_group = NULL;
-    const INSDC_read_type * read_type = NULL;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_int64_ptr( row_id, stx->cursor, stx->prim_al_id_idx, &prim_align_ids, &prim_align_ids_len, "PRIM_AL_IDS" );
-    if ( rc == 0 && nreads != prim_align_ids_len )
-        rc = complain_size_diff( row_id, "PRIMARY_ALIGNMENT_ID" );
-    if ( rc == 0 )
-        rc = read_read_len( stx, row_id, &read_len, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        if ( prim_align_ids[ read_idx ] == 0 &&    /* read is NOT aligned! */
-             read_len[ read_idx ] > 0 )            /* and has a length! */
-        {
-            bool reverse;
-
-            /* the NAME */
-            if ( opts->output_format == of_fastq )
-                rc = KOutMsg( "@" );
-            else
-                rc = KOutMsg( ">" );
-            if ( rc == 0 )
-            {
-                if ( opts->print_spot_group_in_name && spot_group == NULL )
-                    rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-                if ( rc == 0 )
-                    rc = dump_name( opts, row_id, spot_group, spot_group_len ); /* sam-dump-opts.c */
-                if ( rc == 0 )
-                    rc = KOutMsg( "/%u unaligned\n", read_idx + 1 );
-            }
-
-            if ( rc == 0 && read == NULL )
-                rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-            if ( rc == 0 && quality == NULL )
-                rc = read_quality( stx, row_id, &quality, rd_len );
-            if ( rc == 0 && read_type == NULL )
-                rc = read_read_type( stx, row_id, &read_type, nreads );
-            if ( rc == 0 )
-                reverse = ( ( read_type[ read_idx ] & READ_TYPE_REVERSE ) == READ_TYPE_REVERSE );
-            if ( rc == 0 && read_start == NULL )
-                rc = read_read_start( stx, row_id, &read_start, nreads );
-
-            /* the READ */
-            if ( rc == 0 )
-                rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-
-            /* in case of fastq : the QUALITY-line */
-            if ( rc == 0 && opts->output_format == of_fastq )
-            {
-                rc = KOutMsg( "+\n" );
-                if ( rc == 0 )
-                    rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-                if ( rc == 0 )
-                    rc = KOutMsg( "\n" );
-            }
-            (*printed)++;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t dump_seq_tab_row_fastx( const samdump_opts * const opts, const seq_table_ctx * const stx,
-                                    const int64_t row_id, const uint32_t nreads, uint64_t * const printed )
-{
-    uint32_t read_idx, rd_len, name_len, spot_group_len = 0;
-    const char * quality = NULL;
-    const char * name;
-    const INSDC_dna_text * read = NULL ;
-    const char * spot_group = NULL;
-    const INSDC_read_type * read_type;
-    const INSDC_coord_zero * read_start = NULL;
-    const INSDC_coord_len * read_len;
-
-    rc_t rc = read_read_len( stx, row_id, &read_len, nreads );
-    if ( rc == 0 )
-        rc = read_char_ptr( row_id, stx->cursor, stx->name_idx, &name, &name_len, "NAME" );
-    if ( rc == 0 )
-        rc = read_read_type( stx, row_id, &read_type, nreads );
-
-    for ( read_idx = 0; ( read_idx < nreads ) && ( rc == 0 ); ++read_idx )
-    {
-        if ( ( read_len[ read_idx ] > 0 ) &&            /* has a length! */
-             ( ( read_type[ read_idx ] & READ_TYPE_BIOLOGICAL ) == READ_TYPE_BIOLOGICAL ) )
-        {
-            bool reverse;
-
-            /* the NAME */
-            if ( opts->output_format == of_fastq )
-                rc = KOutMsg( "@" );
-            else
-                rc = KOutMsg( ">" );
-            if ( rc == 0 )
-            {
-                if ( opts->print_spot_group_in_name && spot_group == NULL )
-                    rc = read_char_ptr( row_id, stx->cursor, stx->spot_group_idx, &spot_group, &spot_group_len, "SPOT_GROUP" );
-
-                if ( rc == 0 )
-                    rc = dump_name_legacy( opts, name, name_len, spot_group, spot_group_len ); /* sam-dump-opts.c */
-
-                if ( rc == 0 )
-                    rc = KOutMsg( "/%u unaligned\n", read_idx + 1 );
-            }
-
-            if ( rc == 0 && read == NULL )
-                rc = read_INSDC_dna_text_ptr( row_id, stx->cursor, stx->read_idx, &read, &rd_len, "READ" );
-            if ( rc == 0 && quality == NULL )
-                rc = read_quality( stx, row_id, &quality, rd_len );
-            if ( rc == 0 )
-                reverse = ( ( read_type[ read_idx ] & READ_TYPE_REVERSE ) == READ_TYPE_REVERSE );
-            if ( rc == 0 && read_start == NULL )
-                rc = read_read_start( stx, row_id, &read_start, nreads );
-
-            /* the READ */
-            if ( rc == 0 )
-                rc = print_sliced_read( read, read_idx, reverse, read_start, read_len );
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-
-            /* in case of fastq : the QUALITY-line */
-            if ( rc == 0 && opts->output_format == of_fastq )
-            {
-                if ( quality == NULL )
-                    rc = read_quality( stx, row_id, &quality, rd_len );
-                if ( rc == 0 )
-                    rc = KOutMsg( "+\n" );
-                if ( rc == 0 )
-                    rc = print_sliced_quality( opts, quality, read_idx, reverse, read_start, read_len );
-                if ( rc == 0 )
-                    rc = KOutMsg( "\n" );
-            }
-            (*printed)++;
-        }
-    }
-    return rc;
-}
-
-
-typedef struct unaligned_callback_ctx
-{
-    const samdump_opts * opts;
-    const input_database * ids;
-    const matecache * mc;
-    seq_table_ctx * stx;
-    prim_table_ctx * ptx;
-    uint64_t * rows_so_far;
-} unaligned_callback_ctx;
-
-
-static rc_t CC on_unaligned_seq_id( int64_t seq_id, int64_t al_id, void * user_data )
-{
-    rc_t rc = Quitting();
-    if ( rc == 0 )
-    {
-        seq_row row;
-        unaligned_callback_ctx * u_ctx = user_data;
-        rc = read_seq_row( u_ctx->opts, u_ctx->stx, seq_id, &row );
-        if ( rc == 0 && !row.filtered_out )
-        {
-            switch( u_ctx->opts->output_format )
-            {
-                case of_sam   : rc = dump_seq_row_sam_filtered( u_ctx->opts, u_ctx->stx, u_ctx->ptx, u_ctx->mc, u_ctx->ids, seq_id, row.nreads, u_ctx->rows_so_far ); break;
-                case of_fasta : /* fall through intended ! */
-                case of_fastq : rc = dump_seq_row_fastx_filtered( u_ctx->opts, u_ctx->stx, u_ctx->ptx, u_ctx->mc, u_ctx->ids, seq_id, row.nreads, u_ctx->rows_so_far ); break;
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t print_unaligned_database_filtered_2( const samdump_opts * const opts, const input_table * const seq,
-                                                 const input_table * const prim, const matecache * const mc,
-                                                 const input_database * const ids, uint64_t * const rows_so_far )
-{
-    seq_table_ctx stx;
-    rc_t rc = prepare_seq_table_ctx( opts, seq, &stx, ( prim == NULL ) );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( stx.cursor );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-        }
-        else
-        {
-            prim_table_ctx ptx;
-            rc = prepare_prim_table_ctx( opts, prim, &ptx );
-            if ( rc == 0 )
-            {
-                unaligned_callback_ctx u_ctx;
-                u_ctx.opts = opts;
-                u_ctx.ids = ids;
-                u_ctx.mc = mc;
-                u_ctx.stx = &stx;
-                u_ctx.ptx = &ptx;
-                u_ctx.rows_so_far = rows_so_far;
-                rc = foreach_unaligned_entry( mc, ids->db_idx, on_unaligned_seq_id, &u_ctx );
-                VCursorRelease( ptx.cursor );
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* we are printing from a sra-database, we print half aligned reads only if we find them in the mate-cache */
-static rc_t print_unaligned_database_filtered( const samdump_opts * const opts, const input_table * const seq,
-                                               const input_table * const prim, const matecache * const mc,
-                                               const input_database * const ids, uint64_t * const rows_so_far )
-{
-    return print_unaligned_database_filtered_2( opts, seq, prim, mc, ids, rows_so_far );
-#if 0
-    seq_table_ctx stx;
-    rc_t rc = prepare_seq_table_ctx( opts, seq, &stx, ( prim == NULL ) );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( stx.cursor );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-        }
-        else
-        {
-            int64_t first_row;
-            uint64_t row_count;
-            rc = VCursorIdRange( stx.cursor, stx.prim_al_id_idx, &first_row, &row_count );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorIdRange( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-            }
-            else
-            {
-                prim_table_ctx ptx;
-                rc = prepare_prim_table_ctx( opts, prim, &ptx );
-                if ( rc == 0 )
-                {
-                    int64_t row_id;
-                    seq_row row;
-
-                    for ( row_id = first_row; ( ( row_id - first_row ) < row_count ) && rc == 0 && !test_limit_reached( opts, *rows_so_far ); ++row_id )
-                    {
-                        rc = Quitting();
-                        if ( rc == 0 )
-                        {
-                            rc = read_seq_row( opts, &stx, row_id, &row );
-                            if ( rc == 0 && !row.filtered_out )
-                            {
-                                switch( opts->output_format )
-                                {
-                                    case of_sam   : rc = dump_seq_row_sam_filtered( opts, &stx, &ptx, mc, ids, row_id, row.nreads, rows_so_far ); break;
-                                    case of_fasta : /* fall through intended ! */
-                                    case of_fastq : rc = dump_seq_row_fastx_filtered( opts, &stx, &ptx, mc, ids, row_id, row.nreads, rows_so_far ); break;
-                                }
-                            }
-                        }
-                    }
-                    VCursorRelease( ptx.cursor );
-                }
-            }
-        }
-        VCursorRelease( stx.cursor );
-    }
-    return rc;
-#endif
-}
-
-
-/* we are printing from a sra-database, we print all unaligned read we can find */
-static rc_t print_unaligned_database_full( const samdump_opts * const opts, const input_table * const seq,
-                                           const input_table * const prim, const matecache * const mc,
-                                           const input_database * const ids, uint64_t * const rows_so_far )
-{
-    seq_table_ctx stx;
-    rc_t rc = prepare_seq_table_ctx( opts, seq, &stx, ( prim == NULL ) );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( stx.cursor );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-        }
-        else
-        {
-            prim_table_ctx ptx;
-            if ( opts->output_format == of_sam )
-                rc = prepare_prim_table_ctx( opts, prim, &ptx );
-            if ( rc == 0 )
-            {
-                int64_t first_row, row_id;
-                uint64_t row_count;
-                rc = VCursorIdRange( stx.cursor, stx.read_type_idx, &first_row, &row_count );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorIdRange( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-                }
-                else
-                {
-                    seq_row row;
-                    for ( row_id = first_row; ( ( row_id - first_row ) < row_count ) && rc == 0 && !test_limit_reached( opts, *rows_so_far ); ++row_id )
-                    {
-                        rc = Quitting();
-                        if ( rc == 0 )
-                        {
-                            rc = read_seq_row( opts, &stx, row_id, &row );
-                            if ( rc == 0 && !row.filtered_out )
-                            {
-                                switch( opts->output_format )
-                                {
-                                    case of_sam   : rc = dump_seq_prim_row_sam( opts, &stx, &ptx, mc, ids, row_id, row.nreads, rows_so_far ); break;
-                                    case of_fasta : /* fall through intended ! */
-                                    case of_fastq : rc = dump_seq_row_fastx( opts, &stx, row_id, row.nreads, rows_so_far ); break;
-                                }
-                            }
-                        }
-                    }
-                }
-                if ( opts->output_format == of_sam )
-                    VCursorRelease( ptx.cursor );
-            }
-        }
-        VCursorRelease( stx.cursor );
-    }
-    return rc;
-}
-
-
-/* we are printing from a (legacy) table not from a database! */
-static rc_t print_unaligned_table( const samdump_opts * const opts, const input_table * const seq, uint64_t * const rows_so_far )
-{
-    seq_table_ctx stx;
-    rc_t rc = prepare_seq_table_ctx( opts, seq, &stx, true ); /* true ... this is a legacy table, not a database */
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( stx.cursor );
-        if ( rc != 0 )
-        {
-            (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorOpen( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-        }
-        else
-        {
-            int64_t first_row, row_id;
-            uint64_t row_count;
-            rc = VCursorIdRange( stx.cursor, stx.read_type_idx, &first_row, &row_count );
-            if ( rc != 0 )
-            {
-                (void)PLOGERR( klogInt, ( klogInt, rc, "VCursorIdRange( SEQUENCE ) for $(tn) failed", "tn=%s", seq->path ) );
-            }
-            else
-            {
-                seq_row row;
-                for ( row_id = first_row; ( ( row_id - first_row ) < row_count ) && rc == 0 && !test_limit_reached( opts, *rows_so_far ); ++row_id )
-                {
-                    rc = Quitting();
-                    if ( rc == 0 )
-                    {
-                        rc = read_seq_row( opts, &stx, row_id, &row );
-                        if ( rc == 0 && !row.filtered_out )
-                        {
-                            switch( opts->output_format )
-                            {
-                                case of_sam   : rc = dump_seq_row_sam( opts, &stx, row_id, row.nreads, rows_so_far ); break;
-                                case of_fasta : /* fall through intended ! */
-                                case of_fastq : rc = dump_seq_tab_row_fastx( opts, &stx, row_id, row.nreads, rows_so_far ); break;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        VCursorRelease( stx.cursor );
-    }
-    return rc;
-}
-
-
-/* entry point from sam-dump3.c */
-rc_t print_unaligned_spots( const samdump_opts * const opts, const input_files * const ifs,
-                            const matecache * const mc, uint64_t * const rows_so_far )
-{
-    rc_t rc = 0;
-    if ( ( ifs->database_count > 0 ) && ( opts->dump_unaligned_reads || opts->dump_unaligned_only ) )
-    {
-        uint32_t db_idx;
-        for ( db_idx = 0; db_idx < ifs->database_count && rc == 0; ++db_idx )
-        {
-            const input_database * ids = VectorGet( &ifs->dbs, db_idx );
-            if ( ids != NULL )
-            {
-                input_table seq;
-
-                seq.path = ids->path;
-                rc = VDatabaseOpenTableRead( ids->db, &seq.tab, "SEQUENCE" );
-                if ( rc != 0 )
-                {
-                    (void)PLOGERR( klogInt, ( klogInt, rc, "cannot open table SEQUENCE for $(tn)", "tn=%s", ids->path ) );
-                }
-                else
-                {
-                    input_table prim;
-                    prim.path = ids->path;
-                    rc = VDatabaseOpenTableRead( ids->db, &prim.tab, "PRIMARY_ALIGNMENT" );
-                    if ( rc != 0 )
-                    {
-                        (void)PLOGERR( klogInt, ( klogInt, rc, "cannot open table PRIMARY_ALIGNMENT $(tn)", "tn=%s", ids->path ) );
-                    }
-                    else
-                    {
-                        if ( opts->region_count > 0 )
-                        {
-                            rc = print_unaligned_database_filtered( opts, &seq, &prim, mc, ids, rows_so_far );
-                        }
-                        else
-                        {
-                            rc = print_unaligned_database_full( opts, &seq, &prim, mc, ids, rows_so_far );
-                        }
-                        VTableRelease( prim.tab );
-                    }
-                    VTableRelease( seq.tab );
-                }
-            }
-        }
-    }
-
-    if ( rc == 0 && ifs->table_count > 0 )
-    {
-        uint32_t tab_idx;
-        for ( tab_idx = 0; tab_idx < ifs->table_count && rc == 0; ++tab_idx )
-        {
-            input_table * itab = VectorGet( &ifs->tabs, tab_idx );
-            if ( itab != NULL )
-                rc = print_unaligned_table( opts, itab, rows_so_far );
-        }
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sam-unaligned.h b/tools/sra-pileup/sam-unaligned.h
deleted file mode 100644
index fe66f0d..0000000
--- a/tools/sra-pileup/sam-unaligned.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_sam_unaligned_
-#define _h_sam_unaligned_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include "sam-dump-opts.h"
-#include "inputfiles.h"
-#include "matecache.h"
-
-rc_t print_unaligned_spots( const samdump_opts * const opts, const input_files * const ifs,
-                            const matecache * const mc, uint64_t * const rows_so_far );
-
-#endif
\ No newline at end of file
diff --git a/tools/sra-pileup/sra-pileup.c b/tools/sra-pileup/sra-pileup.c
deleted file mode 100644
index c0c4d70..0000000
--- a/tools/sra-pileup/sra-pileup.c
+++ /dev/null
@@ -1,2611 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "sra-pileup.vers.h"
-
-#include "cmdline_cmn.h"
-#include "reref.h"
-
-#include <kapp/main.h>
-
-#include <klib/out.h>
-#include <klib/printf.h>
-#include <klib/report.h>
-#include <klib/sort.h>
-
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <kfs/bzip.h>
-#include <kfs/gzip.h>
-
-#include <insdc/sra.h>
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/report.h> /* ReportSetVDBManager */
-
-#include <sra/sraschema.h>
-#include <align/manager.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-#include <string.h>
-
-#define COL_QUALITY "QUALITY"
-#define COL_REF_ORIENTATION "REF_ORIENTATION"
-#define COL_READ_FILTER "READ_FILTER"
-#define COL_TEMPLATE_LEN "TEMPLATE_LEN"
-
-#define OPTION_MINMAPQ "minmapq"
-#define ALIAS_MINMAPQ  "q"
-
-#define OPTION_DUPS    "duplicates"
-#define ALIAS_DUPS     "d"
-
-#define OPTION_NOQUAL  "noqual"
-#define ALIAS_NOQUAL   "n"
-
-#define OPTION_NOSKIP  "noskip"
-#define ALIAS_NOSKIP   "s"
-
-#define OPTION_SHOWID  "showid"
-#define ALIAS_SHOWID   "i"
-
-#define OPTION_SPOTGRP "spotgroups"
-#define ALIAS_SPOTGRP  "p"
-
-#define OPTION_SEQNAME "seqname"
-#define ALIAS_SEQNAME  "e"
-
-#define OPTION_FUNC    "function"
-#define ALIAS_FUNC     NULL
-
-#define FUNC_COUNTERS   "count"
-#define FUNC_STAT       "stat"
-#define FUNC_RE_REF     "ref"
-#define FUNC_RE_REF_EXT "ref-ex"
-#define FUNC_DEBUG      "debug"
-
-enum
-{
-    sra_pileup_samtools = 0,
-    sra_pileup_counters = 1,
-    sra_pileup_stat = 2,
-    sra_pileup_report_ref = 3,
-    sra_pileup_report_ref_ext = 4,
-    sra_pileup_debug = 5
-};
-
-static const char * minmapq_usage[]         = { "Minimum mapq-value, ", 
-                                                "alignments with lower mapq",
-                                                "will be ignored (default=0)", NULL };
-
-static const char * dups_usage[]            = { "process duplicates ( 0...off/1..on )", NULL };
-
-static const char * noqual_usage[]          = { "Omit qualities in output", NULL };
-
-static const char * noskip_usage[]          = { "Does not skip reference-regions without alignments", NULL };
-
-static const char * showid_usage[]          = { "Shows alignment-id for every base", NULL };
-
-static const char * spotgrp_usage[]         = { "divide by spotgroups", NULL };
-
-static const char * seqname_usage[]         = { "use original seq-name", NULL };
-
-static const char * func_ref_usage[]        = { "list references", NULL };
-static const char * func_ref_ex_usage[]     = { "list references + coverage", NULL };
-static const char * func_count_usage[]      = { "sort pileup with counters", NULL };
-static const char * func_stat_usage[]       = { "strand/tlen statistic", NULL };
-static const char * func_usage[]            = { "alternative functionality", NULL };
-
-OptDef MyOptions[] =
-{
-    /*name,           alias,         hfkt, usage-help,    maxcount, needs value, required */
-    { OPTION_MINMAPQ, ALIAS_MINMAPQ, NULL, minmapq_usage, 1,        true,        false },
-    { OPTION_DUPS,    ALIAS_DUPS,    NULL, dups_usage,    1,        true,        false },
-    { OPTION_NOQUAL,  ALIAS_NOQUAL,  NULL, noqual_usage,  1,        false,       false },
-    { OPTION_NOSKIP,  ALIAS_NOSKIP,  NULL, noskip_usage,  1,        false,       false },
-    { OPTION_SHOWID,  ALIAS_SHOWID,  NULL, showid_usage,  1,        false,       false },
-    { OPTION_SPOTGRP, ALIAS_SPOTGRP, NULL, spotgrp_usage, 1,        false,       false },
-    { OPTION_SEQNAME, ALIAS_SEQNAME, NULL, seqname_usage, 1,        false,       false },
-    { OPTION_FUNC,    ALIAS_FUNC,    NULL, func_usage,    1,        true,        false }
-};
-
-/* =========================================================================================== */
-
-typedef struct pileup_options
-{
-    common_options cmn;
-    bool process_dups;
-    bool omit_qualities;
-    bool read_tlen;
-    bool no_skip;
-    bool show_id;
-    bool div_by_spotgrp;
-    bool use_seq_name;
-    uint32_t minmapq;
-    uint32_t source_table;
-    uint32_t function;  /* sra_pileup_samtools, sra_pileup_counters, sra_pileup_stat, 
-                           sra_pileup_report_ref, sra_pileup_report_ref_ext, sra_pileup_debug */
-} pileup_options;
-
-
-typedef struct pileup_callback_data
-{
-    const AlignMgr *almgr;
-    pileup_options *options;
-} pileup_callback_data;
-
-
-typedef struct pileup_col_ids
-{
-    uint32_t idx_quality;
-    uint32_t idx_ref_orientation;
-    uint32_t idx_read_filter;
-    uint32_t idx_template_len;
-} pileup_col_ids;
-
-
-/* =========================================================================================== */
-
-static rc_t get_str_option( const Args *args, const char *name, const char ** res )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    *res = NULL;
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ArgsOptionCount() failed" );
-    }
-    else
-    {
-        if ( count > 0 )
-        {
-            rc = ArgsOptionValue( args, name, 0, res );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ArgsOptionValue() failed" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t get_uint32_option( const Args *args, const char *name,
-                        uint32_t *res, const uint32_t def )
-{
-    const char * s;
-    rc_t rc = get_str_option( args, name, &s );
-    if ( rc == 0 && s != NULL )
-        *res = atoi( s );
-    else
-        *res = def;
-    return rc;
-}
-
-
-static rc_t get_bool_option( const Args *args, const char *name, bool *res, const bool def )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( args, name, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        *res = true;
-    }
-    else
-    {
-        *res = def;
-    }
-    return rc;
-}
-
-
-static int cmp_pchar( const char * a, const char * b )
-{
-    int res = -1;
-    if ( ( a != NULL )&&( b != NULL ) )
-    {
-        size_t len_a = string_size( a );
-        size_t len_b = string_size( b );
-        res = string_cmp ( a, len_a, b, len_b, ( len_a < len_b ) ? len_b : len_a );
-    }
-    return res;
-}
-
-/* =========================================================================================== */
-
-
-static rc_t get_pileup_options( Args * args, pileup_options *opts )
-{
-    rc_t rc = get_common_options( args, &opts->cmn );
-    opts->function = sra_pileup_samtools;
-
-    if ( rc == 0 )
-        rc = get_uint32_option( args, OPTION_MINMAPQ, &opts->minmapq, 0 );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_DUPS, &opts->process_dups, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_NOQUAL, &opts->omit_qualities, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_NOSKIP, &opts->no_skip, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_SHOWID, &opts->show_id, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_SPOTGRP, &opts->div_by_spotgrp, false );
-
-    if ( rc == 0 )
-        rc = get_bool_option( args, OPTION_SEQNAME, &opts->use_seq_name, false );
-
-    if ( rc == 0 )
-    {
-        const char * fkt = NULL;
-        rc = get_str_option( args, OPTION_FUNC, &fkt );
-        if ( rc == 0 && fkt != NULL )
-        {
-            if ( cmp_pchar( fkt, FUNC_COUNTERS ) == 0 )
-                opts->function = sra_pileup_counters;
-            else if ( cmp_pchar( fkt, FUNC_STAT ) == 0 )
-                opts->function = sra_pileup_stat;
-            else if ( cmp_pchar( fkt, FUNC_RE_REF ) == 0 )
-                opts->function = sra_pileup_report_ref;
-            else if ( cmp_pchar( fkt, FUNC_RE_REF_EXT ) == 0 )
-                opts->function = sra_pileup_report_ref_ext;
-            else if ( cmp_pchar( fkt, FUNC_DEBUG ) == 0 )
-                opts->function = sra_pileup_debug;
-        }
-    }
-    return rc;
-}
-
-/* GLOBAL VARIABLES */
-struct {
-    KWrtWriter org_writer;
-    void* org_data;
-    KFile* kfile;
-    uint64_t pos;
-} g_out_writer = { NULL };
-
-const char UsageDefaultName[] = "sra-pileup";
-
-rc_t CC UsageSummary ( const char * progname )
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s <path> [options]\n"
-                    "\n", progname);
-}
-
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if ( args == NULL )
-        rc = RC ( rcApp, rcArgv, rcAccessing, rcSelf, rcNull );
-    else
-        rc = ArgsProgram ( args, &fullpath, &progname );
-
-    if ( rc )
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary ( progname );
-    KOutMsg ( "Options:\n" );
-    print_common_helplines();
-    HelpOptionLine ( ALIAS_MINMAPQ, OPTION_MINMAPQ, "min. mapq", minmapq_usage );
-    HelpOptionLine ( ALIAS_DUPS, OPTION_DUPS, "dup-mode", dups_usage );
-    HelpOptionLine ( ALIAS_SPOTGRP, OPTION_SPOTGRP, "spotgroups-modes", spotgrp_usage );
-    HelpOptionLine ( ALIAS_SEQNAME, OPTION_SEQNAME, NULL, seqname_usage );
-
-    HelpOptionLine ( NULL, "function ref",      NULL, func_ref_usage );
-    HelpOptionLine ( NULL, "function ref-ex",   NULL, func_ref_ex_usage );
-    HelpOptionLine ( NULL, "function count",    NULL, func_count_usage );
-    HelpOptionLine ( NULL, "function stat",     NULL, func_stat_usage );
-
-    HelpOptionsStandard ();
-    HelpVersion ( fullpath, KAppVersion() );
-    return rc;
-}
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return SRA_PILEUP_VERS;
-}
-
-/***************************************
-    N (0x4E)  n (0x6E)  <--> 0x0
-    A (0x41)  a (0x61)  <--> 0x1
-    C (0x43)  c (0x63)  <--> 0x2
-    M (0x4D)  m (0x6D)  <--> 0x3
-    G (0x47)  g (0x67)  <--> 0x4
-    R (0x52)  r (0x72)  <--> 0x5
-    S (0x53)  s (0x73)  <--> 0x6
-    V (0x56)  v (0x76)  <--> 0x7
-    T (0x54)  t (0x74)  <--> 0x8
-    W (0x57)  w (0x77)  <--> 0x9
-    Y (0x59)  y (0x79)  <--> 0xA
-    H (0x48)  h (0x68)  <--> 0xB
-    K (0x4B)  k (0x6B)  <--> 0xC
-    D (0x44)  d (0x64)  <--> 0xD
-    B (0x42)  b (0x62)  <--> 0xE
-    N (0x4E)  n (0x6E)  <--> 0xF
-***************************************/
-
-
-char _4na_2_ascii_tab[] =
-{
-/*  0x0  0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F */
-    'N', 'A', 'C', 'M', 'G', 'R', 'S', 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', 'N',
-    'n', 'a', 'c', 'm', 'g', 'r', 's', 'v', 't', 'w', 'y', 'h', 'k', 'd', 'b', 'n'
-};
-
-
-static char _4na_to_ascii( INSDC_4na_bin c, bool reverse )
-{
-    return _4na_2_ascii_tab[ ( c & 0x0F ) | ( reverse ? 0x10 : 0 ) ];
-}
-
-
-/* =========================================================================================== */
-
-
-typedef struct dyn_string
-{
-    char * data;
-    size_t allocated;
-    size_t data_len;
-} dyn_string;
-
-
-static rc_t allocated_dyn_string ( dyn_string *self, size_t size )
-{
-    rc_t rc = 0;
-    self->data_len = 0;
-    self->data = malloc( size );
-    if ( self->data != NULL )
-    {
-        self->allocated = size;
-    }
-    else
-    {
-        self->allocated = 0;
-        rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    }
-    return rc;
-}
-
-static void free_dyn_string ( dyn_string *self )
-{
-    free( self->data );
-    self->data = NULL;
-    self->allocated = 0;
-    self->data_len = 0;
-}
-
-static void reset_dyn_string( dyn_string *self )
-{
-    self->data_len = 0;
-}
-
-static rc_t expand_dyn_string( dyn_string *self, size_t new_size )
-{
-    rc_t rc = 0;
-    if ( new_size > self->allocated )
-    {
-        self->data = realloc ( self->data, new_size );
-        if ( self->data != NULL )
-        {
-            self->allocated = new_size;
-        }
-        else
-        {
-            self->allocated = 0;
-            self->data_len = 0;
-            rc = RC( rcApp, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t add_char_2_dyn_string( dyn_string *self, const char c )
-{
-    /* does nothing if self->data_len + 2 < self->allocated */
-    rc_t rc = expand_dyn_string( self, self->data_len + 2 );
-    if ( rc == 0 )
-    {
-        self->data[ self->data_len++ ] = c;
-        self->data[ self->data_len ] = 0;
-    }
-    return rc;
-}
-
-
-static rc_t add_string_2_dyn_string( dyn_string *self, const char * s )
-{
-    rc_t rc;
-    size_t size = string_size ( s );
-    /* does nothing if self->data_len + size + 1 < self->allocated */
-    rc = expand_dyn_string( self, self->data_len + size + 1 );
-    if ( rc == 0 )
-    {
-        string_copy ( &(self->data[ self->data_len ]), self->allocated, s, size );
-        self->data_len += size;
-        self->data[ self->data_len ] = 0;
-    }
-    return rc;
-}
-
-
-static rc_t print_2_dyn_string( dyn_string * self, const char *fmt, ... )
-{
-    rc_t rc = 0;
-    bool not_enough;
-
-    do
-    {
-        size_t num_writ;
-        va_list args;
-        va_start ( args, fmt );
-        rc = string_vprintf ( &(self->data[ self->data_len ]), 
-                              self->allocated - ( self->data_len + 1 ),
-                              &num_writ,
-                              fmt,
-                              args );
-        va_end ( args );
-
-        if ( rc == 0 )
-        {
-            self->data_len += num_writ;
-            self->data[ self->data_len ] = 0;
-        }
-        not_enough = ( GetRCState( rc ) == rcInsufficient );
-        if ( not_enough )
-        {
-            rc = expand_dyn_string( self, self->allocated + ( num_writ * 2 ) );
-        }
-    } while ( not_enough && rc == 0 );
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-static rc_t CC BufferedWriter ( void* self, const char* buffer, size_t bufsize, size_t* num_writ )
-{
-    rc_t rc = 0;
-
-    assert( buffer != NULL );
-    assert( num_writ != NULL );
-
-    do {
-        rc = KFileWrite( g_out_writer.kfile, g_out_writer.pos, buffer, bufsize, num_writ );
-        if ( rc == 0 )
-        {
-            buffer += *num_writ;
-            bufsize -= *num_writ;
-            g_out_writer.pos += *num_writ;
-        }
-    } while ( rc == 0 && bufsize > 0 );
-    return rc;
-}
-
-
-static rc_t set_stdout_to( bool gzip, bool bzip2, const char * filename, size_t bufsize )
-{
-    rc_t rc = 0;
-    if ( gzip && bzip2 )
-    {
-        rc = RC( rcApp, rcFile, rcConstructing, rcParam, rcAmbiguous );
-    }
-    else
-    {
-        KDirectory *dir;
-        rc = KDirectoryNativeDir( &dir );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-        }
-        else
-        {
-            KFile *of;
-            rc = KDirectoryCreateFile ( dir, &of, false, 0664, kcmInit, "%s", filename );
-            if ( rc == 0 )
-            {
-                KFile *buf;
-                if ( gzip )
-                {
-                    KFile *gz;
-                    rc = KFileMakeGzipForWrite( &gz, of );
-                    if ( rc == 0 )
-                    {
-                        KFileRelease( of );
-                        of = gz;
-                    }
-                }
-                if ( bzip2 )
-                {
-                    KFile *bz;
-                    rc = KFileMakeBzip2ForWrite( &bz, of );
-                    if ( rc == 0 )
-                    {
-                        KFileRelease( of );
-                        of = bz;
-                    }
-                }
-
-                rc = KBufFileMakeWrite( &buf, of, false, bufsize );
-                if ( rc == 0 )
-                {
-                    g_out_writer.kfile = buf;
-                    g_out_writer.org_writer = KOutWriterGet();
-                    g_out_writer.org_data = KOutDataGet();
-                    rc = KOutHandlerSet( BufferedWriter, &g_out_writer );
-                    if ( rc != 0 )
-                    {
-                        LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-                    }
-                }
-                KFileRelease( of );
-            }
-            KDirectoryRelease( dir );
-        }
-    }
-    return rc;
-}
-
-
-static void release_stdout_redirection( void )
-{
-    KFileRelease( g_out_writer.kfile );
-    if( g_out_writer.org_writer != NULL )
-    {
-        KOutHandlerSet( g_out_writer.org_writer, g_out_writer.org_data );
-    }
-    g_out_writer.org_writer = NULL;
-}
-
-
-static rc_t CC write_to_FILE( void *f, const char *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = fwrite ( buffer, 1, bytes, f );
-    if ( * num_writ != bytes )
-        return RC( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-
-/* =========================================================================================== */
-
-
-typedef struct tool_rec tool_rec;
-struct tool_rec
-{
-    bool reverse;   /* orientation towards reference ( false...in ref-orientation / true...reverse) */
-    int32_t tlen;   /* template-len, for statistical analysis */
-    uint8_t * quality;  /* ptr to quality... ( for sam-output ) */
-};
-
-
-static rc_t read_base_and_len( struct VCursor const *curs,
-                               uint32_t column_idx,
-                               int64_t row_id,
-                               const void ** base,
-                               uint32_t * len )
-{
-    uint32_t elem_bits, boff, len_intern;
-    const void * ptr;
-    rc_t rc = VCursorCellDataDirect ( curs, row_id, column_idx, &elem_bits, &ptr, &boff, &len_intern );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "VCursorCellDataDirect() failed" );
-    }
-    else
-    {
-        if ( len != NULL ) *len = len_intern;
-        if ( base != NULL ) *base = ptr;
-    }
-    return rc;
-}
-
-
-static rc_t CC populate_tooldata( void *obj, const PlacementRecord *placement,
-        struct VCursor const *curs, INSDC_coord_zero ref_window_start, INSDC_coord_len ref_window_len,
-        void *data, void * placement_ctx )
-{
-    tool_rec * rec = ( tool_rec * ) obj;
-    pileup_callback_data * cb_data = ( pileup_callback_data * )data;
-    pileup_col_ids * col_ids = placement_ctx;
-    rc_t rc = 0;
-
-    rec->quality = NULL;
-    if ( !cb_data->options->process_dups )
-    {
-        const uint8_t * read_filter;
-        uint32_t read_filter_len;
-        rc = read_base_and_len( curs, col_ids->idx_read_filter, placement->id,
-                                (const void **)&read_filter, &read_filter_len );
-        if ( rc == 0 )
-        {
-            if ( ( *read_filter == SRA_READ_FILTER_REJECT )||
-                 ( *read_filter == SRA_READ_FILTER_CRITERIA ) )
-            {
-                rc = RC( rcAlign, rcType, rcAccessing, rcId, rcIgnored );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        const bool * orientation;
-        rc = read_base_and_len( curs, col_ids->idx_ref_orientation, placement->id,
-                                (const void **)&orientation, NULL );
-        if ( rc == 0 )
-            rec->reverse = *orientation;
-    }
-
-    if ( rc == 0 && !cb_data->options->omit_qualities )
-    {
-        const uint8_t * quality;
-        uint32_t quality_len;
-
-        rc = read_base_and_len( curs, col_ids->idx_quality, placement->id,
-                                (const void **)&quality, &quality_len );
-        if ( rc == 0 )
-        {
-            rec->quality = ( uint8_t * )rec;
-            rec->quality += sizeof ( * rec );
-            memcpy( rec->quality, quality, quality_len );
-        }
-    }
-
-    if ( rc == 0 && cb_data->options->read_tlen )
-    {
-        const int32_t * tlen;
-        uint32_t tlen_len;
-
-        rc = read_base_and_len( curs, col_ids->idx_template_len, placement->id,
-                                (const void **)&tlen, &tlen_len );
-        if ( rc == 0 && tlen_len > 0 )
-            rec->tlen = *tlen;
-        else
-            rec->tlen = 0;
-    }
-    else
-        rec->tlen = 0;
-
-    return rc;
-}
-
-
-static rc_t CC alloc_size( struct VCursor const *curs, int64_t row_id, size_t * size, void *data, void * placement_ctx )
-{
-    rc_t rc = 0;
-    tool_rec * rec;
-    pileup_callback_data *cb_data = ( pileup_callback_data * )data;
-    pileup_col_ids * col_ids = placement_ctx;
-    *size = ( sizeof *rec );
-
-    if ( !cb_data->options->omit_qualities )
-    {
-        uint32_t q_len;
-        rc = read_base_and_len( curs, col_ids->idx_quality, row_id, NULL, &q_len );
-        if ( rc == 0 )
-            *size += q_len;
-    }
-    return rc;
-}
-
-
-static rc_t walk_ref_position( ReferenceIterator *ref_iter,
-                               const PlacementRecord *rec,
-                               dyn_string *line,
-                               char * qual,
-                               pileup_options *options )
-{
-    rc_t rc = 0;
-    INSDC_coord_zero seq_pos;
-    int32_t state = ReferenceIteratorState ( ref_iter, &seq_pos );
-    tool_rec *xrec = ( tool_rec * ) PlacementRecordCast ( rec, placementRecordExtension1 );
-    bool reverse = xrec->reverse;
-
-    if ( !options->omit_qualities )
-    {
-        *qual = xrec->quality[ seq_pos ];
-    }
-
-    if ( ( state & align_iter_invalid ) == align_iter_invalid )
-    {
-        return add_char_2_dyn_string( line, '?' );
-    }
-
-    if ( ( state & align_iter_first ) == align_iter_first )
-    {
-        char s[ 3 ];
-        int32_t c = rec->mapq + 33;
-        if ( c > '~' ) { c = '~'; }
-        if ( c < 33 ) { c = 33; }
-        s[ 0 ] = '^';
-        s[ 1 ] = c;
-        s[ 2 ] = 0;
-        rc = add_string_2_dyn_string( line, s );
-    }
-
-    if ( rc == 0 )
-    {
-        if ( ( state & align_iter_skip ) == align_iter_skip )
-        {
-            if ( reverse )
-                rc = add_char_2_dyn_string( line, '<' );
-            else
-                rc = add_char_2_dyn_string( line, '>' );
-            if ( !options->omit_qualities )
-                *qual = xrec->quality[ seq_pos + 1 ];
-        }
-        else
-        {
-            if ( ( state & align_iter_match ) == align_iter_match )
-                rc = add_char_2_dyn_string( line, ( reverse ? ',' : '.' ) );
-            else
-                rc = add_char_2_dyn_string( line, _4na_to_ascii( state, reverse ) );
-        }
-    }
-
-    if ( ( state & align_iter_insert ) == align_iter_insert )
-    {
-        const INSDC_4na_bin *bases;
-        uint32_t i;
-        uint32_t n = ReferenceIteratorBasesInserted ( ref_iter, &bases );
-        
-        rc = print_2_dyn_string( line, "+%u", n );
-        for ( i = 0; i < n && rc == 0; ++i )
-        {
-            rc = add_char_2_dyn_string( line, _4na_to_ascii( bases[ i ], reverse ) );
-        }
-    }
-
-    if ( ( state & align_iter_delete ) == align_iter_delete )
-    {
-        const INSDC_4na_bin *bases;
-        INSDC_coord_zero ref_pos;
-        uint32_t n = ReferenceIteratorBasesDeleted ( ref_iter, &ref_pos, &bases );
-        if ( bases != NULL )
-        {
-            uint32_t i;
-            rc = print_2_dyn_string( line, "-%u", n );
-            for ( i = 0; i < n && rc == 0; ++i )
-            {
-                rc = add_char_2_dyn_string( line, _4na_to_ascii( bases[ i ], reverse ) );
-            }
-            free( (void *) bases );
-        }
-    }
-
-    if ( ( ( state & align_iter_last ) == align_iter_last )&& ( rc == 0 ) )
-        rc = add_char_2_dyn_string( line, '$' );
-
-    if ( options->show_id )
-        rc = print_2_dyn_string( line, "(%lu:%u-%u/%u)",
-                                 rec->id, rec->pos + 1, rec->pos + rec->len, seq_pos );
-
-    return rc;
-}
-
-
-static rc_t walk_alignments( ReferenceIterator *ref_iter,
-                             dyn_string *line,
-                             dyn_string *qualities,
-                             pileup_options *options )
-{
-    uint32_t depth = 0;
-    rc_t rc;
-    do
-    {
-        const PlacementRecord *rec;
-        rc = ReferenceIteratorNextPlacement ( ref_iter, &rec );
-        if ( rc == 0 )
-            rc = walk_ref_position( ref_iter, rec, line, &( qualities->data[ depth++ ] ), options );
-        if ( rc == 0 )
-            rc = Quitting();
-    } while ( rc == 0 );
-
-    if ( !options->omit_qualities )
-    {
-        uint32_t i;
-        add_char_2_dyn_string( line, '\t' );
-        for ( i = 0; i < depth; ++i )
-        {
-            add_char_2_dyn_string( line, qualities->data[ i ] + 33 );
-        }
-    }
-
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk_spot_groups( ReferenceIterator *ref_iter,
-                             dyn_string *line,
-                             dyn_string *qualities,
-                             pileup_options *options )
-{
-    rc_t rc;
-    do
-    {
-        rc = ReferenceIteratorNextSpotGroup ( ref_iter, NULL, NULL );
-        if ( rc == 0 )
-            add_char_2_dyn_string( line, '\t' );
-        if ( rc == 0 )
-            rc = walk_alignments( ref_iter, line, qualities, options );
-    } while ( rc == 0 );
-
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk_position( ReferenceIterator *ref_iter,
-                           const char * refname,
-                           dyn_string *line,
-                           dyn_string *qualities,
-                           pileup_options *options )
-{
-    INSDC_coord_zero pos;
-    uint32_t depth;
-    INSDC_4na_bin base;
-
-    rc_t rc = ReferenceIteratorPosition ( ref_iter, &pos, &depth, &base );
-    if ( rc != 0 )
-    {
-        if ( GetRCState( rc ) != rcDone )
-        {
-            LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
-        }
-    }
-    else if ( ( depth > 0 )||( options->no_skip ) )
-    {
-        rc = expand_dyn_string( line, ( 5 * depth ) + 100 );
-        if ( rc == 0 )
-        {
-            rc = expand_dyn_string( qualities, depth + 100 );
-            if ( rc == 0 )
-            {
-                char c = _4na_to_ascii( base, false );
-
-                reset_dyn_string( line );
-                rc = print_2_dyn_string( line, "%s\t%u\t%c\t%u", refname, pos + 1, c, depth );
-                if ( rc == 0 )
-                {
-                    if ( depth > 0 )
-                    {
-                        rc = walk_spot_groups( ref_iter, line, qualities, options );
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        /* only one KOutMsg() per line... */
-                        KOutMsg( "%s\n", line->data );
-                    }
-
-                    if ( GetRCState( rc ) == rcDone )
-                    {
-                        rc = 0;
-                    }
-                }
-            }
-        }
-    } 
-    return rc;
-}
-
-
-static rc_t walk_reference_window( ReferenceIterator *ref_iter,
-                                   const char * refname,
-                                   dyn_string *line,
-                                   dyn_string *qualities,
-                                   pileup_options *options )
-{
-    rc_t rc = 0;
-    while ( rc == 0 )
-    {
-        rc = ReferenceIteratorNextPos ( ref_iter, !options->no_skip );
-        if ( rc != 0 )
-        {
-            if ( GetRCState( rc ) != rcDone )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
-            }
-        }
-        else
-        {
-            rc = walk_position( ref_iter, refname, line, qualities, options );
-        }
-        if ( rc == 0 )
-        {
-            rc = Quitting();
-        }
-    }
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-    return rc;
-}
-
-
-static rc_t walk_reference( ReferenceIterator *ref_iter,
-                            const char * refname,
-                            pileup_options *options )
-{
-    dyn_string line;
-    rc_t rc = allocated_dyn_string ( &line, 4096 );
-    if ( rc == 0 )
-    {
-        dyn_string qualities;
-        rc = allocated_dyn_string ( &qualities, 4096 );
-        if ( rc == 0 )
-        {
-            while ( rc == 0 )
-            {
-                rc = Quitting ();
-                if ( rc == 0 )
-                {
-                    INSDC_coord_zero first_pos;
-                    INSDC_coord_len len;
-                    rc = ReferenceIteratorNextWindow ( ref_iter, &first_pos, &len );
-                    if ( rc != 0 )
-                    {
-                        if ( GetRCState( rc ) != rcDone )
-                        {
-                            LOGERR( klogInt, rc, "ReferenceIteratorNextWindow() failed" );
-                        }
-                    }
-                    else
-                    {
-                        rc = walk_reference_window( ref_iter, refname, &line, &qualities, options );
-                    }
-                }
-            }
-            free_dyn_string ( &qualities );
-        }
-        free_dyn_string ( &line );
-    }
-    if ( GetRCState( rc ) == rcDone ) rc = 0;
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-
-static rc_t walk_ref_iter( ReferenceIterator *ref_iter, pileup_options *options )
-{
-    rc_t rc = 0;
-    while( rc == 0 )
-    {
-        /* this is the 1st level of walking the reference-iterator: 
-           visiting each (requested) reference */
-        struct ReferenceObj const * refobj;
-
-        rc = ReferenceIteratorNextReference( ref_iter, NULL, NULL, &refobj );
-        if ( rc == 0 )
-        {
-            if ( refobj != NULL )
-            {
-                const char * refname = NULL;
-                if ( options->use_seq_name )
-                    rc = ReferenceObj_Name( refobj, &refname );
-                else
-                    rc = ReferenceObj_SeqId( refobj, &refname );
-
-                if ( rc == 0 )
-                    rc = walk_reference( ref_iter, refname, options );
-                else
-                {
-                    if ( options->use_seq_name )
-                    {
-                        LOGERR( klogInt, rc, "ReferenceObj_Name() failed" );
-                    }
-                    else
-                    {
-                        LOGERR( klogInt, rc, "ReferenceObj_SeqId() failed" );
-                    }
-                }
-            }
-        }
-        else
-        {
-            if ( GetRCState( rc ) != rcDone )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextReference() failed" );
-            }
-        }
-    }
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    if ( GetRCState( rc ) == rcCanceled ) { rc = 0; }
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-typedef struct walk_data walk_data;
-struct walk_data
-{
-    void *data;                             /* opaque pointer to data passed to each function */
-    ReferenceIterator *ref_iter;            /* the global reference-iter */
-    pileup_options *options;                /* the tool-options */
-    struct ReferenceObj const * ref_obj;    /* the current reference-object */
-    const char * ref_name;                  /* the name of the current reference */
-    INSDC_coord_zero ref_start;             /* start of the current reference */
-    INSDC_coord_len ref_len;                /* length of the current reference */
-    INSDC_coord_zero ref_window_start;      /* start of the current reference-window */
-    INSDC_coord_len ref_window_len;         /* length of the current reference-window */
-    INSDC_coord_zero ref_pos;               /* current position on the reference */
-    uint32_t depth;                         /* coverage at the current position */
-    INSDC_4na_bin ref_base;                 /* reference-base at the current position */
-    const char * spotgroup;                 /* name of the current spotgroup ( can be NULL! ) */
-    size_t spotgroup_len;                   /* length of the name of the current spotgroup ( can be 0 ) */
-    const PlacementRecord *rec;             /* current placement-record */
-    tool_rec * xrec;                        /* current extended placement-record (orientation, quality...) */
-    int32_t state;                          /* state of the current placement at the current ref-pos ( bitmasked!) */
-    INSDC_coord_zero seq_pos;               /* position inside the alignment at the current ref-pos */
-};
-
-
-typedef struct walk_funcs walk_funcs;
-struct walk_funcs
-{
-    /* changing reference */
-    rc_t ( CC * on_enter_ref ) ( walk_data * data );
-    rc_t ( CC * on_exit_ref ) ( walk_data * data );
-
-    /* changing reference-window */
-    rc_t ( CC * on_enter_ref_window ) ( walk_data * data );
-    rc_t ( CC * on_exit_ref_window ) ( walk_data * data );
-
-    /* changing reference-position */
-    rc_t ( CC * on_enter_ref_pos ) ( walk_data * data );
-    rc_t ( CC * on_exit_ref_pos ) ( walk_data * data );
-
-    /* changing spot-group */
-    rc_t ( CC * on_enter_spotgroup ) ( walk_data * data );
-    rc_t ( CC * on_exit_spotgroup ) ( walk_data * data );
-
-    /* on each alignment */
-    rc_t ( CC * on_placement ) ( walk_data * data );
-};
-
-
-static rc_t walk_placements( walk_data * data, walk_funcs * funcs )
-{
-    rc_t rc;
-    do
-    {
-        rc = ReferenceIteratorNextPlacement ( data->ref_iter, &data->rec );
-        if ( GetRCState( rc ) != rcDone )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextPlacement() failed" );
-            }
-            else
-            {
-                data->state = ReferenceIteratorState ( data->ref_iter, &data->seq_pos );
-                data->xrec = ( tool_rec * ) PlacementRecordCast ( data->rec, placementRecordExtension1 );
-                if ( funcs->on_placement != NULL )
-                    rc = funcs->on_placement( data );
-            }
-        }
-    } while ( rc == 0 );
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk_spot_group( walk_data * data, walk_funcs * funcs )
-{
-    rc_t rc;
-    do
-    {
-        rc = ReferenceIteratorNextSpotGroup ( data->ref_iter, &data->spotgroup, &data->spotgroup_len );
-        if ( GetRCState( rc ) != rcDone )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
-            }
-            else
-            {
-                if ( funcs->on_enter_spotgroup != NULL )
-                    rc = funcs->on_enter_spotgroup( data );
-                if ( rc == 0 )
-                    rc = walk_placements( data, funcs );
-                if ( rc == 0 && funcs->on_exit_spotgroup != NULL )
-                    rc = funcs->on_exit_spotgroup( data );
-            }
-        }
-    } while ( rc == 0 );
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk_ref_pos( walk_data * data, walk_funcs * funcs )
-{
-    rc_t rc;
-    do
-    {
-        rc = ReferenceIteratorNextPos ( data->ref_iter, !data->options->no_skip );
-        if ( GetRCState( rc ) != rcDone )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
-            }
-            else
-            {
-                rc = ReferenceIteratorPosition ( data->ref_iter, &data->ref_pos, &data->depth, &data->ref_base );
-                if ( rc != 0 )
-                {
-                    LOGERR( klogInt, rc, "ReferenceIteratorPosition() failed" );
-                }
-                else
-                {
-                    if ( funcs->on_enter_ref_pos != NULL )
-                        rc = funcs->on_enter_ref_pos( data );
-                    if ( rc == 0 )
-                        rc = walk_spot_group( data, funcs );
-                    if ( rc == 0 && funcs->on_exit_ref_pos != NULL )
-                        rc = funcs->on_exit_ref_pos( data );
-                }
-            }
-            if ( rc == 0 ) { rc = Quitting(); }
-        }
-    } while ( rc == 0 );
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk_ref_window( walk_data * data, walk_funcs * funcs )
-{
-    rc_t rc;
-    do
-    {
-        rc = ReferenceIteratorNextWindow ( data->ref_iter, &data->ref_window_start, &data->ref_window_len );
-        if ( GetRCState( rc ) != rcDone )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextWindow() failed" );
-            }
-            else
-            {
-                if ( funcs->on_enter_ref_window != NULL )
-                    rc = funcs->on_enter_ref_window( data );
-                if ( rc == 0 )
-                    rc = walk_ref_pos( data, funcs );
-                if ( rc == 0 && funcs->on_exit_ref_window != NULL )
-                    rc = funcs->on_exit_ref_window( data );
-            }
-        }
-    } while ( rc == 0 );
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    return rc;
-}
-
-
-static rc_t walk( walk_data * data, walk_funcs * funcs )
-{
-    rc_t rc;
-
-    data->ref_start = 0;
-    data->ref_len = 0;
-    data->ref_name = NULL;
-    data->ref_obj = NULL;
-    data->ref_window_start = 0;
-    data->ref_window_len = 0;
-    data->ref_pos = 0;
-    data->depth = 0;
-    data->ref_base = 0;
-    data->spotgroup = NULL;
-    data->spotgroup_len = 0;
-    data->rec = NULL;
-    data->xrec = NULL;
-    data->state = 0;
-    data->seq_pos = 0;
-
-    do
-    {
-        rc = ReferenceIteratorNextReference( data->ref_iter, &data->ref_start, &data->ref_len, &data->ref_obj );
-        if ( GetRCState( rc ) != rcDone )
-        {
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "ReferenceIteratorNextReference() failed" );
-            }
-            else if ( data->ref_obj != NULL )
-            {
-                if ( data->options->use_seq_name )
-                    rc = ReferenceObj_Name( data->ref_obj, &data->ref_name );
-                else
-                    rc = ReferenceObj_SeqId( data->ref_obj, &data->ref_name );
-                if ( rc != 0 )
-                {
-                    if ( data->options->use_seq_name )
-                    {
-                        LOGERR( klogInt, rc, "ReferenceObj_Name() failed" );
-                    }
-                    else
-                    {
-                        LOGERR( klogInt, rc, "ReferenceObj_SeqId() failed" );
-                    }
-                }
-                else
-                {
-                    if ( funcs->on_enter_ref != NULL )
-                        rc = funcs->on_enter_ref( data );
-                    if ( rc == 0 )
-                        rc = walk_ref_window( data, funcs );
-                    if ( rc == 0 && funcs->on_exit_ref != NULL )
-                        rc = funcs->on_exit_ref( data );
-                }
-            }
-        }
-    } while ( rc == 0 );
-    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
-    if ( GetRCState( rc ) == rcCanceled ) { rc = 0; }
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-static rc_t CC walk_debug_enter_ref( walk_data * data )
-{   return KOutMsg( "ENTER REF '%s' ( %u.%u )\n", data->ref_name, data->ref_start, data->ref_len );   }
-
-static rc_t CC walk_debug_exit_ref( walk_data * data )
-{   return KOutMsg( "EXIT  REF '%s' ( %u.%u )\n", data->ref_name, data->ref_start, data->ref_len );   }
-
-static rc_t CC walk_debug_enter_ref_window( walk_data * data )
-{   return KOutMsg( "  ENTER REF-WINDOW ( %u.%u )\n", data->ref_window_start, data->ref_window_len );   }
-
-static rc_t CC walk_debug_exit_ref_window( walk_data * data )
-{   return KOutMsg( "  EXIT  REF-WINDOW ( %u.%u )\n", data->ref_window_start, data->ref_window_len );   }
-
-static rc_t CC walk_debug_enter_ref_pos( walk_data * data )
-{   return KOutMsg( "    ENTER REF-POS ( %u / d=%u / '%c' )\n", data->ref_pos, data->depth, _4na_to_ascii( data->ref_base, false ) );   }
-
-static rc_t CC walk_debug_exit_ref_pos( walk_data * data )
-{   return KOutMsg( "    EXIT  REF-POS ( %u / d=%u / '%c' )\n", data->ref_pos, data->depth, _4na_to_ascii( data->ref_base, false ) );   }
-
-static rc_t CC walk_debug_enter_sg( walk_data * data )
-{   return KOutMsg( "      ENTER SPOTGROUP '%s'\n", data->spotgroup );   }
-
-static rc_t CC walk_debug_exit_sg( walk_data * data )
-{   return KOutMsg( "      EXIT SPOTGROUP '%s'\n", data->spotgroup );   }
-
-static rc_t CC walk_debug_placement( walk_data * data )
-{
-    char c = ( data->xrec->reverse ? 'R' : 'F' );
-    return KOutMsg( "        PLACEMENT #%lu %c ( TLEN %i )\n", data->rec->id, c, data->xrec->tlen );
-}
-
-
-static rc_t walk_debug( ReferenceIterator *ref_iter, pileup_options *options )
-{
-    rc_t rc;
-    walk_data data;
-    walk_funcs funcs;
-
-    data.ref_iter = ref_iter;
-    data.options = options;
-    
-    funcs.on_enter_ref = walk_debug_enter_ref;
-    funcs.on_exit_ref = walk_debug_exit_ref;
-
-    funcs.on_enter_ref_window = walk_debug_enter_ref_window;
-    funcs.on_exit_ref_window = walk_debug_exit_ref_window;
-
-    funcs.on_enter_ref_pos = walk_debug_enter_ref_pos;
-    funcs.on_exit_ref_pos = walk_debug_exit_ref_pos;
-
-    funcs.on_enter_spotgroup = walk_debug_enter_sg;
-    funcs.on_exit_spotgroup = walk_debug_exit_sg;
-    
-    funcs.on_placement = walk_debug_placement;
-
-    rc = walk( &data, &funcs );
-    return rc;
-}
-
-
-static uint32_t percent( uint32_t v1, uint32_t v2 )
-{
-    uint32_t sum = v1 + v2;
-    uint32_t res = 0;
-    if ( sum > 0 )
-        res = ( ( v1 * 100 ) / sum );
-    return res;
-}
-
-/* =========================================================================================== */
-
-typedef struct indel_fragment
-{
-    BSTNode node;
-    const char * bases;
-    uint32_t len;
-    uint32_t count;
-} indel_fragment;
-
-
-static indel_fragment * make_indel_fragment( const char * bases, uint32_t len )
-{
-    indel_fragment * res = malloc( sizeof * res );
-    if ( res != NULL )
-    {
-        res->bases = string_dup ( bases, len );
-        if ( res->bases == NULL )
-        {
-            free( res );
-            res = NULL;
-        }
-        else
-        {
-            res->len = len;
-            res->count = 1;
-        }
-    }
-    return res;
-}
-
-
-static void CC free_indel_fragment( BSTNode * n, void * data )
-{
-    indel_fragment * fragment = ( indel_fragment * ) n;
-    if ( fragment != NULL )
-    {
-        free( ( void * ) fragment->bases );
-        free( fragment );
-    }
-}
-
-
-static void free_fragments( BSTree * fragments )
-{    
-    BSTreeWhack ( fragments, free_indel_fragment, NULL );
-}
-
-
-typedef struct find_fragment_ctx
-{
-    const char * bases;
-    uint32_t len;
-} find_fragment_ctx;
-
-
-static int CC cmp_fragment_vs_find_ctx( const void *item, const BSTNode *n )
-{
-    const indel_fragment * fragment = ( const indel_fragment * )n;
-    const find_fragment_ctx * fctx = ( const find_fragment_ctx * )item;
-    return string_cmp ( fctx->bases, fctx->len, fragment->bases, fragment->len, -1 );
-}
-
-
-static int CC cmp_fragment_vs_fragment( const BSTNode *item, const BSTNode *n )
-{
-    const indel_fragment * f1 = ( const indel_fragment * )item;
-    const indel_fragment * f2 = ( const indel_fragment * )n;
-    return string_cmp ( f1->bases, f1->len, f2->bases, f2->len, -1 );
-}
-
-
-static void count_indel_fragment( BSTree * fragments, const INSDC_4na_bin *bases, uint32_t len )
-{
-    find_fragment_ctx fctx;
-
-    fctx.bases = malloc( len );
-    if ( fctx.bases != NULL )
-    {
-        indel_fragment * fragment;
-        uint32_t i;
-
-        fctx.len = len;
-        for ( i = 0; i < len; ++i )
-            ( ( char * )fctx.bases )[ i ] = _4na_to_ascii( bases[ i ], false );
-
-        fragment = ( indel_fragment * ) BSTreeFind ( fragments, &fctx, cmp_fragment_vs_find_ctx );
-        if ( fragment == NULL )
-        {
-            fragment = make_indel_fragment( fctx.bases, len );
-            if ( fragment != NULL )
-            {
-                rc_t rc = BSTreeInsert ( fragments, ( BSTNode * )fragment, cmp_fragment_vs_fragment );
-                if ( rc != 0 )
-                    free_indel_fragment( ( BSTNode * )fragment, NULL );
-            }
-        }
-        else
-            fragment->count++;
-
-        free( ( void * ) fctx.bases );
-    }
-}
-
-
-typedef struct walk_fragment_ctx
-{
-    rc_t rc;
-    uint32_t n;
-} walk_fragment_ctx;
-
-
-static void CC on_fragment( BSTNode *n, void *data )
-{
-    walk_fragment_ctx * wctx = data;
-    const indel_fragment * fragment = ( const indel_fragment * )n;
-    if ( wctx->rc == 0 )
-    {
-        if ( wctx->n == 0 )
-            wctx->rc = KOutMsg( "%u-%.*s", fragment->count, fragment->len, fragment->bases );
-        else
-            wctx->rc = KOutMsg( "|%u-%.*s", fragment->count, fragment->len, fragment->bases );
-        wctx->n++;
-    }
-}
-
-
-static rc_t print_fragments( BSTree * fragments )
-{
-    walk_fragment_ctx wctx;
-    wctx.rc = 0;
-    wctx.n = 0;
-    BSTreeForEach ( fragments, false, on_fragment, &wctx );
-    return wctx.rc;
-}
-
-/* =========================================================================================== */
-
-typedef struct pileup_counters
-{
-    uint32_t matches;
-    uint32_t mismatches[ 4 ];
-    uint32_t inserts;
-    uint32_t deletes;
-    uint32_t forward;
-    uint32_t reverse;
-    uint32_t starting;
-    uint32_t ending;
-    BSTree insert_fragments;
-    BSTree delete_fragments;
-} pileup_counters;
-
-
-static void clear_counters( pileup_counters * counters )
-{
-    uint32_t i;
-
-    counters->matches = 0;
-    for ( i = 0; i < 4; ++i )
-        counters->mismatches[ i ] = 0;
-    counters->inserts = 0;
-    counters->deletes = 0;
-    counters->forward = 0;
-    counters->reverse = 0;
-    counters->starting = 0;
-    counters->ending = 0;
-    BSTreeInit( &(counters->insert_fragments) );
-    BSTreeInit( &(counters->delete_fragments) );
-}
-
-
-static void walk_counter_state( ReferenceIterator *ref_iter, int32_t state, bool reverse,
-                                pileup_counters * counters )
-{
-    if ( ( state & align_iter_invalid ) == align_iter_invalid )
-        return;
-
-    if ( ( state & align_iter_skip ) != align_iter_skip )
-    {
-        if ( ( state & align_iter_match ) == align_iter_match )
-            (counters->matches)++;
-        else
-        {
-            char c = _4na_to_ascii( state, false );
-            switch( c )
-            {
-                case 'A' : ( counters->mismatches[ 0 ] )++; break;
-                case 'C' : ( counters->mismatches[ 1 ] )++; break;
-                case 'G' : ( counters->mismatches[ 2 ] )++; break;
-                case 'T' : ( counters->mismatches[ 3 ] )++; break;
-            }
-        }
-    }
-
-    if ( reverse )
-        (counters->reverse)++;
-    else
-        (counters->forward)++;
-
-    if ( ( state & align_iter_insert ) == align_iter_insert )
-    {
-        const INSDC_4na_bin *bases;
-        uint32_t n = ReferenceIteratorBasesInserted ( ref_iter, &bases );
-        (counters->inserts) += n;
-        count_indel_fragment( &(counters->insert_fragments), bases, n );
-    }
-
-    if ( ( state & align_iter_delete ) == align_iter_delete )
-    {
-        const INSDC_4na_bin *bases;
-        INSDC_coord_zero ref_pos;
-        uint32_t n = ReferenceIteratorBasesDeleted ( ref_iter, &ref_pos, &bases );
-        if ( bases != NULL )
-        {
-            (counters->deletes) += n;
-            count_indel_fragment( &(counters->delete_fragments), bases, n );
-            free( (void *) bases );
-        }
-    }
-
-    if ( ( state & align_iter_first ) == align_iter_first )
-        ( counters->starting)++;
-
-    if ( ( state & align_iter_last ) == align_iter_last )
-        ( counters->ending)++;
-}
-
-
-static rc_t print_counter_line( const char * ref_name,
-                                INSDC_coord_zero ref_pos,
-                                INSDC_4na_bin ref_base,
-                                uint32_t depth,
-                                pileup_counters * counters )
-{
-    char c = _4na_to_ascii( ref_base, false );
-
-    rc_t rc = KOutMsg( "%s\t%u\t%c\t%u\t", ref_name, ref_pos + 1, c, depth );
-
-    if ( rc == 0 && counters->matches > 0 )
-        rc = KOutMsg( "%u", counters->matches );
-
-    if ( rc == 0 /* && counters->mismatches[ 0 ] > 0 */ )
-        rc = KOutMsg( "\t%u-A", counters->mismatches[ 0 ] );
-
-    if ( rc == 0 /* && counters->mismatches[ 1 ] > 0 */ )
-        rc = KOutMsg( "\t%u-C", counters->mismatches[ 1 ] );
-
-    if ( rc == 0 /* && counters->mismatches[ 2 ] > 0 */ )
-        rc = KOutMsg( "\t%u-G", counters->mismatches[ 2 ] );
-
-    if ( rc == 0 /* && counters->mismatches[ 3 ] > 0 */ )
-        rc = KOutMsg( "\t%u-T", counters->mismatches[ 3 ] );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\tI:" );
-    if ( rc == 0 )
-        rc = print_fragments( &(counters->insert_fragments) );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\tD:" );
-    if ( rc == 0 )
-        rc = print_fragments( &(counters->delete_fragments) );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\t%u%%", percent( counters->forward, counters->reverse ) );
-
-    if ( rc == 0 && counters->starting > 0 )
-        rc = KOutMsg( "\tS%u", counters->starting );
-
-    if ( rc == 0 && counters->ending > 0 )
-        rc = KOutMsg( "\tE%u", counters->ending );
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-
-    free_fragments( &(counters->insert_fragments) );
-    free_fragments( &(counters->delete_fragments) );
-
-    return rc;
-}
-
-
-/* ........................................................................................... */
-
-
-static rc_t CC walk_counters_enter_ref_pos( walk_data * data )
-{
-    clear_counters( data->data );
-    return 0;
-}
-
-static rc_t CC walk_counters_exit_ref_pos( walk_data * data )
-{
-    rc_t rc = print_counter_line( data->ref_name, data->ref_pos, data->ref_base, data->depth, data->data );
-    return rc;
-}
-
-static rc_t CC walk_counters_placement( walk_data * data )
-{
-    walk_counter_state( data->ref_iter, data->state, data->xrec->reverse, data->data );
-    return 0;
-}
-
-static rc_t walk_counters( ReferenceIterator *ref_iter, pileup_options *options )
-{
-    walk_data data;
-    walk_funcs funcs;
-    pileup_counters counters;
-
-    data.ref_iter = ref_iter;
-    data.options = options;
-    data.data = &counters;
-
-    funcs.on_enter_ref = NULL;
-    funcs.on_exit_ref = NULL;
-
-    funcs.on_enter_ref_window = NULL;
-    funcs.on_exit_ref_window = NULL;
-
-    funcs.on_enter_ref_pos = walk_counters_enter_ref_pos;
-    funcs.on_exit_ref_pos = walk_counters_exit_ref_pos;
-
-    funcs.on_enter_spotgroup = NULL;
-    funcs.on_exit_spotgroup = NULL;
-
-    funcs.on_placement = walk_counters_placement;
-
-    return walk( &data, &funcs );
-}
-
-
-/* =========================================================================================== */
-
-
-typedef struct tlen_array
-{
-    uint32_t * values;
-    uint32_t capacity;
-    uint32_t members;
-    uint32_t zeros;
-} tlen_array;
-
-
-static rc_t init_tlen_array( tlen_array * a, uint32_t init_capacity )
-{
-    rc_t rc = 0;
-    a->values = malloc( sizeof ( a->values[ 0 ] ) * init_capacity );
-    if ( a->values == NULL )
-        rc = RC ( rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted );
-    else
-    {
-        a->capacity = init_capacity;
-        a->members = 0;
-        a->zeros = 0;
-    }
-    return rc;
-}
-
-
-static void finish_tlen_array( tlen_array * a )
-{
-    if ( a->values != NULL )
-    {
-        free( a->values );
-        a->values = NULL;
-    }
-}
-
-
-static rc_t realloc_tlen_array( tlen_array * a, uint32_t new_depth )
-{
-    rc_t rc = 0;
-    if ( new_depth > a->capacity )
-    {
-        void * p = realloc( a->values, ( sizeof ( a->values[ 0 ] ) ) * new_depth );
-        if ( a->values == NULL )
-            rc = RC ( rcApp, rcArgv, rcAccessing, rcMemory, rcExhausted );
-        else
-        {
-            a->values = p;
-            a->capacity = new_depth;
-        }
-    }
-    return rc;
-}
-
-
-static void remove_from_tlen_array( tlen_array * a, uint32_t count )
-{
-    if ( count > 0 )
-    {
-        if ( a->members < count )
-            a->members = 0;
-        else
-        {
-            a->members -= count;
-            memmove( &(a->values[ 0 ]), &(a->values[ count ]), a->members * ( sizeof a->values[ 0 ] ) );
-        }
-    }
-}
-
-
-static bool add_tlen_to_array( tlen_array * a, uint32_t value )
-{
-    bool res = ( value != 0 );
-    if ( !res )
-        a->zeros++;
-    else
-        a->values[ a->members++ ] = value;
-    return res;
-}
-
-
-#define INIT_WINDOW_SIZE 50
-#define MAX_SEQLEN_COUNT 500000
-
-typedef struct strand
-{
-    uint32_t alignment_count, window_size, window_max, seq_len_accu_count;
-    uint64_t seq_len_accu;
-    tlen_array tlen_w;          /* tlen accumulater for all alignmnts starting/ending in window ending at current position */
-    tlen_array tlen_l;          /* array holding the length of all position-slices in the window */
-    tlen_array zeros;
-} strand;
-
-
-typedef struct stat_counters
-{
-    strand pos;
-    strand neg;
-} stat_counters;
-
-
-static rc_t prepare_strand( strand * strand, uint32_t initial_size )
-{
-    rc_t rc = init_tlen_array( &strand->tlen_w, initial_size );
-    if ( rc == 0 )
-        rc = init_tlen_array( &strand->tlen_l, initial_size );
-    if ( rc == 0 )
-        rc = init_tlen_array( &strand->zeros, initial_size );
-    if ( rc == 0 )
-    {
-        strand->window_size = 0;
-        strand->window_max = INIT_WINDOW_SIZE;
-        strand->seq_len_accu_count = 0;
-        strand->seq_len_accu = 0;
-    }
-    return rc;
-}
-
-
-static rc_t prepare_stat_counters( stat_counters * counters, uint32_t initial_size )
-{
-    rc_t rc = prepare_strand( &counters->pos, initial_size );
-    if ( rc == 0 )
-        rc = prepare_strand( &counters->neg, initial_size );
-    return rc;
-}
-
-
-static void finish_strand( strand * strand )
-{
-    finish_tlen_array( &strand->tlen_w );
-    finish_tlen_array( &strand->tlen_l );
-    finish_tlen_array( &strand->zeros );
-}
-
-
-static void finish_stat_counters( stat_counters * counters )
-{
-    finish_strand( &counters->pos );
-    finish_strand( &counters->neg );
-}
-
-
-static rc_t realloc_strand( strand * strand, uint32_t new_depth )
-{
-    rc_t rc = realloc_tlen_array( &strand->tlen_w, strand->tlen_w.members + new_depth );
-    if ( rc == 0 )
-        rc = realloc_tlen_array( &strand->tlen_l, strand->tlen_l.members + new_depth );
-    if ( rc == 0 )
-        rc = realloc_tlen_array( &strand->zeros, strand->zeros.members + new_depth );
-    strand->alignment_count = 0;
-    return rc;
-}
-
-
-static void on_new_ref_position_strand( strand * strand )
-{
-    if ( ( strand->seq_len_accu_count < MAX_SEQLEN_COUNT ) && ( strand->seq_len_accu_count > 0 ) )
-    {
-        uint64_t w = ( strand->seq_len_accu / strand->seq_len_accu_count );
-        if ( w > strand->window_max )
-            strand->window_max = w;
-    }
-
-    if ( strand->window_size >= strand->window_max )
-    {
-        uint32_t to_remove = strand->tlen_l.values[ 0 ];
-        remove_from_tlen_array( &strand->tlen_w, to_remove );
-        remove_from_tlen_array( &strand->tlen_l, 1 );
-
-        to_remove = strand->zeros.values[ 0 ];
-        strand->tlen_w.zeros -= to_remove;
-        remove_from_tlen_array( &strand->zeros, 1 );
-    }
-    else
-        strand->window_size++;
-    strand->tlen_l.values[ strand->tlen_l.members++ ] = 0;
-    strand->zeros.values[ strand->zeros.members++ ] = 0;
-}
-
-
-/*
-static int32_t avg( tlen_array * a )
-{
-    int64_t sum = 0;
-    int32_t i;
-    for ( i = 0; i < a->members; ++i )
-        sum += a->values[ i ];
-    if ( a->members > 1 )
-        sum /= a->members;
-    return (int32_t) sum;
-}
-*/
-
-
-static uint32_t medium( tlen_array * a )
-{
-    if ( a->members == 0 )
-        return 0;
-    else
-        return a->values[ a->members >> 1 ];
-}
-
-
-static uint32_t percentil( tlen_array * a, uint32_t p )
-{
-    if ( a->members == 0 )
-        return 0;
-    else
-        return a->values[ ( a->members * p ) / 100 ];
-}
-
-
-static rc_t print_header_line( void )
-{
-    return KOutMsg( "\nREFNAME----\tREFPOS\tREFBASE\tDEPTH\tSTRAND%%\tTL+#0\tTL+10%%\tTL+MED\tTL+90%%\tTL-#0\tTL-10%%\tTL-MED\tTL-90%%\n\n" );
-}
-
-
-/* ........................................................................................... */
-
-
-static rc_t CC walk_stat_enter_ref_window( walk_data * data )
-{
-    stat_counters * counters = data->data;
-    counters->pos.tlen_w.members = 0;
-    counters->pos.tlen_l.members = 0;
-    counters->neg.tlen_w.members = 0;
-    counters->neg.tlen_l.members = 0;
-    return 0;
-}
-
-
-static rc_t CC walk_stat_enter_ref_pos( walk_data * data )
-{
-    rc_t rc;
-    stat_counters * counters = data->data;
-
-    on_new_ref_position_strand( &counters->pos );
-    on_new_ref_position_strand( &counters->neg );
-
-    rc = realloc_strand( &counters->pos, data->depth );
-    if ( rc == 0 )
-        rc = realloc_strand( &counters->neg, data->depth );
-
-    return rc;
-}
-
-
-static rc_t CC walk_stat_exit_ref_pos( walk_data * data )
-{
-    char c = _4na_to_ascii( data->ref_base, false );
-    stat_counters * counters = data->data;
-
-    /* REF-NAME, REF-POS, REF-BASE, DEPTH */
-    rc_t rc = KOutMsg( "%s\t%u\t%c\t%u\t", data->ref_name, data->ref_pos + 1, c, data->depth );
-
-    /* STRAND-ness */
-    if ( rc == 0 )
-        rc = KOutMsg( "%u%%\t", percent( counters->pos.alignment_count, counters->neg.alignment_count ) );
-
-    /* TLEN-Statistic for sliding window, only starting/ending placements */
-    if ( rc == 0 )
-    {
-        tlen_array * a = &counters->pos.tlen_w;
-        if ( a->members > 1 )
-            ksort_uint32_t ( a->values, a->members );
-
-        rc = KOutMsg( "%u\t%u\t%u\t%u\t", a->zeros, percentil( a, 10 ), medium( a ), percentil( a, 90 ) );
-        if ( rc == 0 )
-        {
-            a = &counters->neg.tlen_w;
-            if ( a->members > 1 )
-                ksort_uint32_t ( a->values, a->members );
-            rc = KOutMsg( "%u\t%u\t%u\t%u\t", a->zeros, percentil( a, 10 ), medium( a ), percentil( a, 90 ) );
-        }
-    }
-
-/*
-    KOutMsg( "( %u,%u )\t", counters->pos.window_max, counters->neg.window_max );
-    KOutMsg( "< %u.%u, %u.%u ( %u.%u, %u.%u ) >",
-            counters->pos.tlen_w.members, counters->pos.tlen_w.capacity, counters->neg.tlen_w.members, counters->neg.tlen_w.capacity,
-            counters->pos.tlen_l.members, counters->pos.tlen_l.capacity, counters->neg.tlen_l.members, counters->neg.tlen_l.capacity );
-*/
-
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-
-    return rc;
-}
-
-
-static void walk_strand_placement( strand * strand, int32_t tlen, INSDC_coord_len seq_len )
-{
-    tlen_array * a;
-    uint32_t value =  ( tlen < 0 ) ? -tlen : tlen;
-    if ( add_tlen_to_array( &strand->tlen_w, value ) )
-        a = &strand->tlen_l;
-    else
-        a = &strand->zeros;
-    a->values[ a->members - 1 ]++;
-
-    if ( strand->seq_len_accu_count < MAX_SEQLEN_COUNT )
-    {
-        strand->seq_len_accu += seq_len;
-        strand->seq_len_accu_count++;
-    }
-}
-
-
-static rc_t CC walk_stat_placement( walk_data * data )
-{
-    int32_t state = data->state;
-    if ( ( state & align_iter_invalid ) != align_iter_invalid )
-    {
-        bool reverse = data->xrec->reverse;
-        stat_counters * counters = data->data;
-        strand * strand = ( reverse ) ? &counters->neg : &counters->pos;
-
-        strand->alignment_count++;
-
-        /* for TLEN-statistic on starting/ending placements at this pos */
-        if ( ( ( state & align_iter_last ) == align_iter_last )&&( reverse ) )
-            walk_strand_placement( strand, data->xrec->tlen, data->rec->len );
-        else if ( ( ( state & align_iter_first ) == align_iter_first )&&( !reverse ) )
-            walk_strand_placement( strand, data->xrec->tlen, data->rec->len );
-    }
-    return 0;
-}
-
-
-static rc_t walk_stat( ReferenceIterator *ref_iter, pileup_options *options )
-{
-    walk_data data;
-    walk_funcs funcs;
-    stat_counters counters;
-
-    rc_t rc = print_header_line();
-    if ( rc == 0 )
-        rc = prepare_stat_counters( &counters, 1024 );
-    if ( rc == 0 )
-    {
-        data.ref_iter = ref_iter;
-        data.options = options;
-        data.data = &counters;
-
-        funcs.on_enter_ref = NULL;
-        funcs.on_exit_ref = NULL;
-
-        funcs.on_enter_ref_window = walk_stat_enter_ref_window;
-        funcs.on_exit_ref_window = NULL;
-
-        funcs.on_enter_ref_pos = walk_stat_enter_ref_pos;
-        funcs.on_exit_ref_pos = walk_stat_exit_ref_pos;
-
-        funcs.on_enter_spotgroup = NULL;
-        funcs.on_exit_spotgroup = NULL;
-
-        funcs.on_placement = walk_stat_placement;
-
-        rc = walk( &data, &funcs );
-
-        finish_stat_counters( &counters );
-    }
-    return rc;
-}
-
-/* =========================================================================================== */
-
-static rc_t add_quality_and_orientation( const VTable *tbl, const VCursor ** cursor,
-                                         bool omit_qualities, bool read_tlen, pileup_col_ids * cursor_ids )
-{
-    rc_t rc = VTableCreateCursorRead ( tbl, cursor );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "VTableCreateCursorRead() failed" );
-    }
-
-    if ( rc == 0 && !omit_qualities )
-    {
-        rc = VCursorAddColumn ( *cursor, &cursor_ids->idx_quality, COL_QUALITY );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VCursorAddColumn(QUALITY) failed" );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = VCursorAddColumn ( *cursor, &cursor_ids->idx_ref_orientation, COL_REF_ORIENTATION );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VCursorAddColumn(REF_ORIENTATION) failed" );
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        rc = VCursorAddColumn ( *cursor, &cursor_ids->idx_read_filter, COL_READ_FILTER );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VCursorAddColumn(READ_FILTER) failed" );
-        }
-    }
-
-    if ( rc == 0 && read_tlen )
-    {
-        rc = VCursorAddColumn ( *cursor, &cursor_ids->idx_template_len, COL_TEMPLATE_LEN );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VCursorAddColumn(TEMPLATE_LEN) failed" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t prepare_prim_cursor( const VDatabase *db, const VCursor ** cursor,
-                                 bool omit_qualities, bool read_tlen, pileup_col_ids * cursor_ids )
-{
-    const VTable *tbl;
-    rc_t rc = VDatabaseOpenTableRead ( db, &tbl, "PRIMARY_ALIGNMENT" );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "VDatabaseOpenTableRead(PRIMARY_ALIGNMENT) failed" );
-    }
-    else
-    {
-        rc = add_quality_and_orientation( tbl, cursor, omit_qualities, read_tlen, cursor_ids );
-        VTableRelease ( tbl );
-    }
-    return rc;
-}
-
-
-static rc_t prepare_sec_cursor( const VDatabase *db, const VCursor ** cursor,
-                                bool omit_qualities, bool read_tlen, pileup_col_ids * cursor_ids )
-{
-    const VTable *tbl;
-    rc_t rc = VDatabaseOpenTableRead ( db, &tbl, "SECONDARY_ALIGNMENT" );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "VDatabaseOpenTableRead(SECONDARY_ALIGNMENT) failed" );
-    }
-    else
-    {
-        rc = add_quality_and_orientation( tbl, cursor, omit_qualities, read_tlen, cursor_ids );
-        VTableRelease ( tbl );
-    }
-    return rc;
-}
-
-
-static rc_t prepare_evidence_cursor( const VDatabase *db, const VCursor ** cursor,
-                                     bool omit_qualities, bool read_tlen, pileup_col_ids * cursor_ids )
-{
-    const VTable *tbl;
-    rc_t rc = VDatabaseOpenTableRead ( db, &tbl, "EVIDENCE_ALIGNMENT" );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "VDatabaseOpenTableRead(EVIDENCE) failed" );
-    }
-    else
-    {
-        rc = add_quality_and_orientation( tbl, cursor, omit_qualities, read_tlen, cursor_ids );
-        VTableRelease ( tbl );
-    }
-    return rc;
-}
-
-#if 0
-static void show_placement_params( const char * prefix, const ReferenceObj *refobj,
-                                   uint32_t start, uint32_t end )
-{
-    const char * name;
-    rc_t rc = ReferenceObj_SeqId( refobj, &name );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "ReferenceObj_SeqId() failed" );
-    }
-    else
-    {
-        KOutMsg( "prepare %s: <%s> %u..%u\n", prefix, name, start, end ) ;
-    }
-}
-#endif
-
-
-static rc_t make_cursor_ids( Vector *cursor_id_vector, pileup_col_ids ** cursor_ids )
-{
-    rc_t rc;
-    pileup_col_ids * ids = malloc( sizeof * ids );
-    if ( ids == NULL )
-        rc = RC ( rcApp, rcNoTarg, rcOpening, rcMemory, rcExhausted );
-    else
-    {
-        rc = VectorAppend ( cursor_id_vector, NULL, ids );
-        if ( rc != 0 )
-            free( ids );
-        else
-            *cursor_ids = ids;
-    }
-    return rc;
-}
-
-
-static rc_t CC prepare_section_cb( prepare_ctx * ctx, uint32_t start, uint32_t end )
-{
-    rc_t rc = 0;
-    INSDC_coord_len len;
-    if ( ctx->db == NULL || ctx->refobj == NULL )
-    {
-        rc = SILENT_RC ( rcApp, rcNoTarg, rcOpening, rcSelf, rcInvalid );
-        /* it is opened in prepare_db_table even if ctx->db == NULL */
-        PLOGERR(klogInt, (klogInt, rc, "failed to process $(path)",
-            "path=%s", ctx->path == NULL ? "input argument" : ctx->path));
-        ReportSilence();
-    }
-    else
-    {
-        rc = ReferenceObj_SeqLength( ctx->refobj, &len );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "ReferenceObj_SeqLength() failed" );
-        }
-        else
-        {
-            rc_t rc1 = 0, rc2 = 0, rc3 = 0;
-            pileup_col_ids * cursor_ids;
-
-            if ( start == 0 ) start = 1;
-            if ( ( end == 0 )||( end > len + 1 ) )
-            {
-                end = ( len - start ) + 1;
-            }
-
-            /* depending on ctx->select prepare primary, secondary or both... */
-            if ( ctx->use_primary_alignments )
-            {
-                const VCursor * prim_align_cursor = NULL;
-                rc1 = make_cursor_ids( ctx->data, &cursor_ids );
-                if ( rc1 != 0 )
-                {
-                    LOGERR( klogInt, rc1, "cannot create cursor-ids for prim. alignment cursor" );
-                }
-                else
-                {
-                    rc1 = prepare_prim_cursor( ctx->db, &prim_align_cursor, ctx->omit_qualities, ctx->read_tlen, cursor_ids );
-                    if ( rc1 == 0 )
-                    {
-        /*                show_placement_params( "primary", ctx->refobj, start, end ); */
-                        rc1 = ReferenceIteratorAddPlacements ( ctx->ref_iter,       /* the outer ref-iter */
-                                                              ctx->refobj,          /* the ref-obj for this chromosome */
-                                                              start - 1,            /* start ( zero-based ) */
-                                                              end - start + 1,      /* length */
-                                                              NULL,                 /* ref-cursor */
-                                                              prim_align_cursor,    /* align-cursor */
-                                                              primary_align_ids,    /* which id's */
-                                                              ctx->spot_group,      /* what read-group */
-                                                              cursor_ids            /* placement-context */
-                                                             );
-                        if ( rc1 != 0 )
-                        {
-                            LOGERR( klogInt, rc1, "ReferenceIteratorAddPlacements(prim) failed" );
-                        }
-                        VCursorRelease( prim_align_cursor );
-                    }
-                }
-            }
-
-            if ( ctx->use_secondary_alignments )
-            {
-                const VCursor * sec_align_cursor = NULL;
-                rc2 = make_cursor_ids( ctx->data, &cursor_ids );
-                if ( rc2 != 0 )
-                {
-                    LOGERR( klogInt, rc2, "cannot create cursor-ids for sec. alignment cursor" );
-                }
-                else
-                {
-                    rc2 = prepare_sec_cursor( ctx->db, &sec_align_cursor, ctx->omit_qualities, ctx->read_tlen, cursor_ids );
-                    if ( rc2 == 0 )
-                    {
-        /*                show_placement_params( "secondary", ctx->refobj, start, end ); */
-                        rc2 = ReferenceIteratorAddPlacements ( ctx->ref_iter,       /* the outer ref-iter */
-                                                              ctx->refobj,          /* the ref-obj for this chromosome */
-                                                              start - 1,            /* start ( zero-based ) */
-                                                              end - start + 1,      /* length */
-                                                              NULL,                 /* ref-cursor */
-                                                              sec_align_cursor,     /* align-cursor */
-                                                              secondary_align_ids,  /* which id's */
-                                                              ctx->spot_group,      /* what read-group */
-                                                              cursor_ids            /* placement-context */
-                                                             );
-                        if ( rc2 != 0 )
-                        {
-                            LOGERR( klogInt, rc2, "ReferenceIteratorAddPlacements(sec) failed" );
-                        }
-                        VCursorRelease( sec_align_cursor );
-                    }
-                }
-            }
-
-            if ( ctx->use_evidence_alignments )
-            {
-                const VCursor * ev_align_cursor = NULL;
-                rc3 = make_cursor_ids( ctx->data, &cursor_ids );
-                if ( rc3 != 0 )
-                {
-                    LOGERR( klogInt, rc3, "cannot create cursor-ids for ev. alignment cursor" );
-                }
-                else
-                {
-                    rc3 = prepare_evidence_cursor( ctx->db, &ev_align_cursor, ctx->omit_qualities, ctx->read_tlen, cursor_ids );
-                    if ( rc3 == 0 )
-                    {
-        /*                show_placement_params( "evidende", ctx->refobj, start, end ); */
-                        rc3 = ReferenceIteratorAddPlacements ( ctx->ref_iter,       /* the outer ref-iter */
-                                                              ctx->refobj,          /* the ref-obj for this chromosome */
-                                                              start - 1,            /* start ( zero-based ) */
-                                                              end - start + 1,      /* length */
-                                                              NULL,                 /* ref-cursor */
-                                                              ev_align_cursor,      /* align-cursor */
-                                                              evidence_align_ids,   /* which id's */
-                                                              ctx->spot_group,      /* what read-group */
-                                                              cursor_ids            /* placement-context */
-                                                             );
-                        if ( rc3 != 0 )
-                        {
-                            LOGERR( klogInt, rc3, "ReferenceIteratorAddPlacements(evidence) failed" );
-                        }
-                        VCursorRelease( ev_align_cursor );
-                    }
-                }
-            }
-
-            if ( rc1 == SILENT_RC( rcAlign, rcType, rcAccessing, rcRow, rcNotFound ) )
-            { /* from allocate_populate_rec */
-                rc = rc1;
-            }
-            else if ( rc1 == 0 )
-                rc = 0;
-            else if ( rc2 == 0 )
-                rc = 0;
-            else if ( rc3 == 0 )
-                rc = 0;
-            else
-                rc = rc1;
-        }
-    }
-    return rc;
-}
-
-
-typedef struct foreach_arg_ctx
-{
-    pileup_options *options;
-    const VDBManager *vdb_mgr;
-    VSchema *vdb_schema;
-    ReferenceIterator *ref_iter;
-    BSTree *ranges;
-    Vector *cursor_ids;
-} foreach_arg_ctx;
-
-
-/* called for each source-file/accession */
-static rc_t CC on_argument( const char * path, const char * spot_group, void * data )
-{
-    rc_t rc = 0;
-    foreach_arg_ctx * ctx = ( foreach_arg_ctx * )data;
-    prepare_ctx prep;   /* from cmdline_cmn.h */
-
-    prep.omit_qualities = ctx->options->omit_qualities;
-    prep.read_tlen = ctx->options->read_tlen;
-    prep.use_primary_alignments = ( ( ctx->options->cmn.tab_select & primary_ats ) == primary_ats );
-    prep.use_secondary_alignments = ( ( ctx->options->cmn.tab_select & secondary_ats ) == secondary_ats );
-    prep.use_evidence_alignments = ( ( ctx->options->cmn.tab_select & evidence_ats ) == evidence_ats );
-    prep.ref_iter = ctx->ref_iter;
-    prep.spot_group = spot_group;
-    prep.on_section = prepare_section_cb;
-    prep.data = ctx->cursor_ids;
-    prep.path = path;
-
-    rc = prepare_ref_iter( &prep, ctx->vdb_mgr, ctx->vdb_schema, path, ctx->ranges ); /* cmdline_cmn.c */
-    if ( rc == 0 && prep.db == NULL )
-    {
-        rc = RC ( rcApp, rcNoTarg, rcOpening, rcSelf, rcInvalid );
-        LOGERR( klogInt, rc, "unsupported source" );
-    }
-    return rc;
-}
-
-
-/* free all cursor-ids-blocks created in parallel with the alignment-cursor */
-void CC cur_id_vector_entry_whack( void *item, void *data )
-{
-    pileup_col_ids * ids = item;
-    free( ids );
-}
-
-
-static rc_t pileup_main( Args * args, pileup_options *options )
-{
-    foreach_arg_ctx arg_ctx;
-    pileup_callback_data cb_data;
-    KDirectory *dir;
-    Vector cur_ids_vector;
-
-    /* (1) make the align-manager ( necessary to make a ReferenceIterator... ) */
-    rc_t rc = AlignMgrMakeRead ( &cb_data.almgr );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "AlignMgrMake() failed" );
-    }
-
-    VectorInit ( &cur_ids_vector, 0, 20 );
-    cb_data.options = options;
-    arg_ctx.options = options;
-    arg_ctx.vdb_schema = NULL;
-    arg_ctx.cursor_ids = &cur_ids_vector;
-
-    /* (2) make the reference-iterator */
-    if ( rc == 0 )
-    {
-        PlacementRecordExtendFuncs cb_block;
-
-        cb_block.data = &cb_data;
-        cb_block.destroy = NULL;
-        cb_block.populate = populate_tooldata;
-        cb_block.alloc_size = alloc_size;
-        cb_block.fixed_size = 0;
-
-        rc = AlignMgrMakeReferenceIterator ( cb_data.almgr, &arg_ctx.ref_iter, &cb_block, options->minmapq );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "AlignMgrMakeReferenceIterator() failed" );
-        }
-    }
-
-    /* (3) make a KDirectory ( necessary to make a vdb-manager ) */
-    if ( rc == 0 )
-    {
-        rc = KDirectoryNativeDir( &dir );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "KDirectoryNativeDir() failed" );
-        }
-    }
-
-    /* (4) make a vdb-manager */
-    if ( rc == 0 )
-    {
-        rc = VDBManagerMakeRead ( &arg_ctx.vdb_mgr, dir );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VDBManagerMakeRead() failed" );
-        }
-        else {
-            ReportSetVDBManager(arg_ctx.vdb_mgr);
-        }
-    }
-
-
-    /* (5) make a vdb-schema */
-    if ( rc == 0 )
-    {
-        rc = VDBManagerMakeSRASchema( arg_ctx.vdb_mgr, &arg_ctx.vdb_schema );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VDBManagerMakeSRASchema() failed" );
-        }
-        else if ( options->cmn.schema_file != NULL )
-        {
-            rc = VSchemaParseFile( arg_ctx.vdb_schema, options->cmn.schema_file );
-            if ( rc != 0 )
-            {
-                LOGERR( klogInt, rc, "VSchemaParseFile() failed" );
-            }
-        }
-    }
-
-    if ( rc == 0 )
-    {
-        switch( options->function )
-        {
-            case sra_pileup_counters    : options->omit_qualities = true;
-                                          options->read_tlen = false;
-                                          break;
-
-            case sra_pileup_stat        : options->omit_qualities = true;
-                                          options->read_tlen = true;
-                                          break;
-
-            case sra_pileup_debug       : options->omit_qualities = true;
-                                          options->read_tlen = true;
-                                          break;
-
-            case sra_pileup_samtools    : options->read_tlen = false;
-                                          break;
-        }
-    }
-
-    /* (5) loop through the given input-filenames and load the ref-iter with it's input */
-    if ( rc == 0 )
-    {
-        BSTree regions;
-        rc = init_ref_regions( &regions, args ); /* cmdline_cmn.c */
-        if ( rc == 0 )
-        {
-            bool empty = false;
-            check_ref_regions( &regions ); /* sanitize input... */
-            arg_ctx.ranges = ®ions;
-            rc = foreach_argument( args, dir, options->div_by_spotgrp, &empty, on_argument, &arg_ctx ); /* cmdline_cmn.c */
-            if ( empty )
-            {
-                Usage ( args );
-            }
-            free_ref_regions( &regions );
-        }
-    }
-
-    /* (6) walk the "loaded" ref-iterator ===> perform the pileup */
-    if ( rc == 0 )
-    {
-        /* ============================================== */
-        switch( options->function )
-        {
-            case sra_pileup_stat        : rc = walk_stat( arg_ctx.ref_iter, options ); break;
-            case sra_pileup_counters    : rc = walk_counters( arg_ctx.ref_iter, options ); break;
-            case sra_pileup_debug       : rc = walk_debug( arg_ctx.ref_iter, options ); break;
-            default :  rc = walk_ref_iter( arg_ctx.ref_iter, options ); break;
-        }
-        /* ============================================== */
-    }
-
-    if ( arg_ctx.vdb_mgr != NULL ) VDBManagerRelease( arg_ctx.vdb_mgr );
-    if ( arg_ctx.vdb_schema != NULL ) VSchemaRelease( arg_ctx.vdb_schema );
-    if ( dir != NULL ) KDirectoryRelease( dir );
-    if ( arg_ctx.ref_iter != NULL ) ReferenceIteratorRelease( arg_ctx.ref_iter );
-    if ( cb_data.almgr != NULL ) AlignMgrRelease ( cb_data.almgr );
-    VectorWhack ( &cur_ids_vector, cur_id_vector_entry_whack, NULL );
-
-    return rc;
-}
-
-
-/* =========================================================================================== */
-
-rc_t CC KMain( int argc, char *argv [] )
-{
-    rc_t rc = KOutHandlerSet( write_to_FILE, stdout );
-    ReportBuildDate( __DATE__ );
-    if ( rc != 0 )
-    {
-        LOGERR( klogInt, rc, "KOutHandlerSet() failed" );
-    }
-    else
-    {
-        Args * args;
-
-        KLogHandlerSetStdErr();
-        rc = ArgsMakeAndHandle( &args, argc, argv, 2,
-            MyOptions, sizeof MyOptions / sizeof MyOptions [ 0 ],
-            CommonOptions_ptr(), CommonOptions_count() );
-        if ( rc == 0 )
-        {
-            rc = parse_inf_file( args ); /* cmdline_cmn.h */
-            if ( rc == 0 )
-            {
-                pileup_options options;
-                rc = get_pileup_options( args, &options );
-                if ( rc == 0 )
-                {
-                    if ( options.cmn.output_file != NULL )
-                    {
-                        rc = set_stdout_to( options.cmn.gzip_output,
-                                            options.cmn.bzip_output,
-                                            options.cmn.output_file,
-                                            32 * 1024 );
-                    }
-
-                    if ( rc == 0 )
-                    {
-                        if ( options.function == sra_pileup_report_ref ||
-                             options.function == sra_pileup_report_ref_ext )
-                        {
-                            rc = report_on_reference( args, options.function == sra_pileup_report_ref_ext ); /* reref.c */
-                        }
-                        else
-                        {
-                            /* ============================== */
-                            rc = pileup_main( args, &options );
-                            /* ============================== */
-                        }
-                    }
-
-                    if ( options.cmn.output_file != NULL )
-                        release_stdout_redirection();
-                }
-            }
-            ArgsWhack( args );
-        }
-    }
-
-    {
-        /* Report execution environment if necessary */
-        rc_t rc2 = ReportFinalize( rc );
-        if ( rc == 0 )
-            rc = rc2;
-    }
-    return rc;
-}
diff --git a/tools/sra-pileup/sra-pileup.vers b/tools/sra-pileup/sra-pileup.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-pileup/sra-pileup.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-sort/Makefile b/tools/sra-sort/Makefile
deleted file mode 100644
index 457e53d..0000000
--- a/tools/sra-sort/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-sort
-
-include $(TOP)/build/Makefile.env
-include $(SRCDIR)/Makefile.$(COMP)
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-
-ifneq (win,$(OS))
-EXT_TOOLS += sra-sort
-endif	
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sra-sort
-#
-SRA_SORT_SRC = \
-	caps \
-	mem \
-	membank \
-	paged-membank \
-	paged-mmapbank \
-	except \
-	idx-mapping \
-	map-file \
-	col-pair \
-	row-set \
-	simple-row-set \
-	mapping-row-set \
-	sorting-row-set \
-	meta-pair \
-	dir-pair \
-	tbl-pair \
-	db-pair \
-	glob-poslen \
-	poslen-col-pair \
-	ref-alignid-col \
-	buff-writer \
-	id-mapper-col \
-	capture-first-half-aligned \
-	csra-tbl \
-	csra-pair \
-	run \
-	sra-sort \
-	xcheck-ref-align
-
-SRA_SORT_OBJ = \
-	$(addsuffix .$(OBJX),$(SRA_SORT_SRC))
-
-SRA_SORT_LIB = \
-	-lkapp \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/sra-sort: $(SRA_SORT_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SRA_SORT_LIB)
diff --git a/tools/sra-sort/Makefile.cc b/tools/sra-sort/Makefile.cc
deleted file mode 100644
index ca33e13..0000000
--- a/tools/sra-sort/Makefile.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
diff --git a/tools/sra-sort/Makefile.clang b/tools/sra-sort/Makefile.clang
deleted file mode 100644
index bad5e3a..0000000
--- a/tools/sra-sort/Makefile.clang
+++ /dev/null
@@ -1,27 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-PED = -std=gnu99 -fgnu89-inline
-
diff --git a/tools/sra-sort/Makefile.gcc b/tools/sra-sort/Makefile.gcc
deleted file mode 100644
index 02182c4..0000000
--- a/tools/sra-sort/Makefile.gcc
+++ /dev/null
@@ -1,27 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-PED = $(shell $(SRCDIR)/gcc-ped.sh -std=gnu99 -fgnu89-inline)
-
diff --git a/tools/sra-sort/Makefile.vc++ b/tools/sra-sort/Makefile.vc++
deleted file mode 100644
index ca33e13..0000000
--- a/tools/sra-sort/Makefile.vc++
+++ /dev/null
@@ -1,24 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
diff --git a/tools/sra-sort/buff-writer.c b/tools/sra-sort/buff-writer.c
deleted file mode 100644
index 22af68a..0000000
--- a/tools/sra-sort/buff-writer.c
+++ /dev/null
@@ -1,785 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct BufferedPairColWriter BufferedPairColWriter;
-#define COLWRITER_IMPL BufferedPairColWriter
-
-#include "buff-writer.h"
-#include "row-set.h"
-#include "idx-mapping.h"
-#include "map-file.h"
-#include "csra-tbl.h"
-#include "col-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <klib/sort.h>
-#include <klib/rc.h>
-#include <kdb/btree.h>
-
-#include <string.h>
-#include <bitstr.h>
-
-FILE_ENTRY ( buff-writer );
-
-
-/*--------------------------------------------------------------------------
- * BufferedPairColWriter
- */
-struct BufferedPairColWriter
-{
-    ColumnWriter dad;
-
-    cSRATblPair *tbl;   /* borrowed reference to table        */
-
-    ColumnWriter *cw;   /* where to write data                */
-
-    MemBank *mbank;     /* paged memory bank                  */
-#define MAX_VOCAB_SIZE 32*1024
-    /*** introducing VOCABULARY value->id->vocab_value ***/
-    KBTree	*vocab_key2id;
-    const void	*vocab_id2val[MAX_VOCAB_SIZE];
-    uint32_t	vocab_cnt;
-    /******************************************************/
-    MapFile *idx;       /* optional row-id mapping index      */
-
-    union
-    {
-        /* for mapping writers */
-        struct
-        {
-            union
-            {
-                /* "immediate" data - size <= 64 bits and row_len == 1 */
-                uint64_t imm;
-
-                /* "indirect" data - stored in "mbank" */
-                void *ptr;
-
-            } val;
-            int64_t new_id;
-        } *data;
-
-        /* standard ( old_id, new_id ) mapping pair */
-        IdxMapping *map;
-
-        /* for non-mapping writers */
-        int64_t *ids;
-
-    } u;
-
-    /* for non-mapping writers - new=>old ord */
-    uint32_t *ord;
-
-    size_t num_items;   /* total number of items              */
-    size_t cur_item;    /* index of currently available item  */
-    size_t num_immed;   /* number of immediate items written  */
-
-    uint32_t elem_bits; /* number of bits of each element     */
-    uint32_t min_row_len;
-    uint32_t max_row_len;
-};
-
-static
-void BufferedPairColWriterWhack ( BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    MapFileRelease ( self -> idx, ctx );
-    MemBankRelease ( self -> mbank, ctx );
-    if(self -> vocab_key2id) KBTreeRelease  ( self -> vocab_key2id );
-    ColumnWriterRelease ( self -> cw, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-const char *BufferedPairColWriterFullSpec ( const BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return ColumnWriterFullSpec ( self -> cw, ctx );
-}
-
-static
-void BufferedPairColWriterPreCopy ( BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterPreCopy ( self -> cw, ctx );
-}
-
-static
-void BufferedPairColWriterPostCopy ( BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> mbank != NULL )
-    {
-        MemBankRelease ( self -> mbank, ctx );
-        self -> mbank = NULL;
-    }
-    if ( self -> vocab_key2id != NULL )
-    {
-	KBTreeRelease  ( self -> vocab_key2id );
-	self -> vocab_key2id = 0;
-	self -> vocab_cnt = 0;
-    }
-
-    ColumnWriterPostCopy ( self -> cw, ctx );
-}
-
-static
-void BufferedPairColWriterMapValues ( BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t i;
-    int64_t id;
-    bool assign_ids = ( bool ) self -> dad . align [ 0 ];
-
-    if ( self -> elem_bits != 64 )
-    {
-        rc = RC ( rcExe, rcColumn, rcWriting, rcType, rcIncorrect );
-        INTERNAL_ERROR ( rc, "column '%s' does not have 64-bit elements and cannot be mapped",
-            ColumnWriterFullSpec ( self -> cw, ctx ) );
-        return;
-    }
-
-    if ( self -> num_immed != self -> num_items )
-    {
-#if DISALLOW_VARIABLE_ROW_LENGTH_MAPPING
-        rc = RC ( rcExe, rcColumn, rcWriting, rcType, rcIncorrect );
-        INTERNAL_ERROR ( rc, "column '%s' does not have fixed row-length of 1 and cannot be mapped",
-            ColumnWriterFullSpec ( self -> cw, ctx ) );
-#else
-        const uint32_t *base;
-        /* detect case when we have ids that were written
-           sparsely ( as NULLs ) rather than densely ( zeros for NULL ). */
-        if ( self -> min_row_len == 0 && self -> max_row_len == 1 )
-        {
-            for ( i = 0; i < self -> num_items; ++ i )
-            {
-                base = self -> u . data [ i ] . val . ptr;
-                if ( base != NULL )
-                    memcpy ( & self -> u . data [ i ] . val . imm, & base [ 1 ], 8 );
-            }
-
-            MemBankRelease ( self -> mbank, ctx );
-            self -> mbank = NULL;
-            self -> num_immed = self -> num_items;
-            self -> min_row_len = 1;
-	    
-        }
-        else
-        {
-            STATUS ( 3, "randomly mapping old=>new values" );
-            for ( i = 0; i < self -> num_immed; ++ i )
-            {
-                id = self -> u . data [ i ] . val . imm;
-                if ( id != 0 )
-                {
-                    uint32_t *base;
-                    ON_FAIL ( base = MemBankAlloc ( self -> mbank, ctx, sizeof id + sizeof * base, false ) )
-                        return;
-                    ON_FAIL ( id = MapFileMapSingleOldToNew ( self -> idx, ctx, id, assign_ids ) )
-                        return;
-                    memcpy ( & base [ 1 ], & id, sizeof id );
-                    base [ 0 ] = 1;
-                    self -> u . data [ i ] . val . ptr = base;
-                }
-            }
-            for ( self -> num_immed = 0; i < self -> num_items; ++ i )
-            {
-                base = self -> u . data [ i ] . val . ptr;
-                if ( base != NULL )
-                {
-                    uint32_t j, row_len = base [ 0 ];
-                    int64_t *ids = ( int64_t* ) & base [ 1 ];
-                    for ( j = 0; j < row_len; ++ j )
-                    {
-                        id = ids [ j ];
-                        if ( id != 0 )
-                        {
-                            ON_FAIL ( ids [ j ] = MapFileMapSingleOldToNew ( self -> idx, ctx, id, assign_ids ) )
-                                return;
-                        }
-                    }
-                }
-            }
-            return;
-        }
-#endif
-    }
-
-    STATUS ( 3, "sorting %,u ( data, new_id ) map entries on immediate value", self -> num_items );
-#if USE_OLD_KSORT
-    ksort ( self -> u . map, self -> num_items, sizeof self -> u . map [ 0 ], IdxMappingCmpOld, ( void* ) ctx );
-#else
-    IdxMappingSortOld ( self -> u . map, ctx, self -> num_items );
-#endif
-
-    STATUS ( 3, "mapping old=>new values" );
-    for ( i = 0; i < self -> num_items; ++ i )
-    {
-        id = self -> u . map [ i ] . old_id;
-        if ( id != 0 )
-        {
-            ON_FAIL ( self -> u . map [ i ] . old_id = MapFileMapSingleOldToNew ( self -> idx, ctx, id, assign_ids ) )
-                break;
-        }
-    }
-}
-
-static
-void BufferedPairColWriterWriteMapped ( BufferedPairColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint32_t *base;
-    size_t i, row_bytes;
-    const size_t pg_size = 256 * 1024;
-
-    /* detect first write */
-    if ( self -> u . data == NULL )
-    {
-        /* get map and content length from table */
-        assert ( self -> idx != NULL );
-        ON_FAIL ( self -> u . map = RowSetIteratorGetIdxMapping ( self -> tbl -> rsi, ctx, & self -> num_items ) )
-        {
-            ANNOTATE ( "failed to get ( old_id, new_id ) map for column '%s'", ColumnWriterFullSpec ( self -> cw, ctx ) );
-            return;
-        }
-
-        /* require elem_bits to be constant for column */
-        self -> elem_bits = elem_bits;
-
-        /* OPTIMIZATION:
-           IFF elem_bits <= 64 and row_len == 1, store in union
-           otherwise, use membank. This requires that if row_len
-           ever changes, we have to recover. */
-        if ( elem_bits > 64 || row_len != 1 )
-        {
-            /* create a memory bank */
-            /* TBD - used configured page size rather than 256K */
-            ON_FAIL ( self -> mbank = MemBankMakePaged ( ctx, -1L, pg_size ) )
-                return;
-        }
-
-        /* initialize min/max */
-        self -> min_row_len = self -> max_row_len = row_len;
-    }
-
-    /* elem_bits should be constant */
-    assert ( self -> elem_bits == elem_bits );
-
-    /* handle optimized case */
-    if ( self -> mbank == NULL )
-    {
-        /* first, detect a change */
-        if ( row_len == 1 )
-        {
-            /* continue on optimized case */
-            row_bytes = ( ( size_t ) elem_bits + 7 ) >> 3;
-            if ( boff != 0 )
-            {
-                bitcpy ( & self -> u . data [ self -> cur_item ] . val . imm,
-                    0, data, boff, ( bitsz_t ) elem_bits * row_len );
-            }
-            else
-            {
-                memcpy ( & self -> u . data [ self -> cur_item ] . val . imm, data, row_bytes );
-            }
-
-            /* record another immediate row */
-            ++ self -> num_immed;
-
-            /* detect last row */
-            if ( ++ self -> cur_item < self -> num_items )
-                return;
-
-            /* map values */
-            TRY ( BufferedPairColWriterMapValues ( self, ctx ) )
-            {
-                /* need to resort map on new_id */
-                STATUS ( 3, "sorting %,u ( data, new_id ) map entries on new_id", self -> num_items );
-#if USE_OLD_KSORT
-                ksort ( self -> u . map, self -> num_items, sizeof self -> u . map [ 0 ], IdxMappingCmpNew, ( void* ) ctx );
-#else
-                IdxMappingSortNew ( self -> u . map, ctx, self -> num_items );
-#endif
-
-                /* write all rows to column writer */
-                STATUS ( 3, "writing cell data to '%s'", ColumnWriterFullSpec ( self -> cw, ctx ) );
-                for ( i = 0; i < self -> num_items; ++ i )
-                {
-                    /* write out row */
-                    ON_FAIL ( ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, & self -> u . data [ i ] . val . imm, 0, 1 ) )
-                        break;
-                }
-            }
-
-            /* forget about map */
-            self -> u . map = NULL;
-            self -> cur_item = self -> num_items = self -> num_immed = 0;
-            self -> elem_bits = 0;
-
-            return;
-        }
-
-        /* need to recover */
-        ON_FAIL ( self -> mbank = MemBankMakePaged ( ctx, -1L, pg_size ) )
-            return;
-    }
-
-    /* update min/max row-len */
-    if ( row_len < self -> min_row_len )
-        self -> min_row_len = row_len;
-    else if ( row_len > self -> max_row_len )
-        self -> max_row_len = row_len;
-
-    /* handle zero-length rows specially */
-    if ( row_len == 0 )
-        self -> u . data [ self -> cur_item ] . val . ptr = NULL;
-    else
-    {
-        /* allocate space for the row */
-        row_bytes = ( ( size_t ) elem_bits * row_len + 7 ) >> 3;
-        TRY ( base = MemBankAlloc ( self -> mbank, ctx, row_bytes + sizeof row_len, false ) )
-        {
-            /* copy it in */
-            memcpy ( base, & row_len, sizeof row_len );
-            if ( boff != 0 )
-                bitcpy ( & base [ 1 ], 0, data, boff, ( bitsz_t ) elem_bits * row_len );
-            else
-                memcpy ( & base [ 1 ], data, row_bytes );
-
-            /* remember its location in the map */
-            self -> u . data [ self -> cur_item ] . val . ptr = base;
-
-            /* remember the last input pointer */
-        }
-    }
-
-    if ( ! FAILED () )
-    {
-        /* detect last row */
-        if ( ++ self -> cur_item == self -> num_items )
-        {
-            /* map values */
-            TRY ( BufferedPairColWriterMapValues ( self, ctx ) )
-            {
-                /* need to resort map on new_id */
-                STATUS ( 3, "sorting %,u ( data, new_id ) map entries on new_id", self -> num_items );
-#if USE_OLD_KSORT
-                ksort ( self -> u . map, self -> num_items, sizeof self -> u . map [ 0 ], IdxMappingCmpNew, ( void* ) ctx );
-#else
-                IdxMappingSortNew ( self -> u . map, ctx, self -> num_items );
-#endif
-
-                /* write all rows to column writer */
-                STATUS ( 3, "writing cell data to '%s'", ColumnWriterFullSpec ( self -> cw, ctx ) );
-                for ( i = 0; i < self -> num_immed; ++ i )
-                {
-                    /* write out row */
-                    ON_FAIL ( ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, & self -> u . data [ i ] . val . imm, 0, 1 ) )
-                        break;
-                }
-                for ( ; ! FAILED () && i < self -> num_items; ++ i )
-                {
-                    /* write out row */
-                    base = self -> u . data [ i ] . val . ptr;
-                    if ( base == NULL )
-                        ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, "", 0, 0 );
-                    else
-                        ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, & base [ 1 ], 0, base [ 0 ] );
-                }
-            }
-
-            /* drop the mem-bank */
-            MemBankRelease ( self -> mbank, ctx );
-            self -> mbank = NULL;
-
-            /* forget about map */
-            self -> u . data = NULL;
-            self -> cur_item = self -> num_items = self -> num_immed = 0;
-            self -> elem_bits = 0;
-        }
-    }
-}
-
-static
-void BufferedPairColWriterWriteUnmapped ( BufferedPairColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    size_t i, j, row_bytes;
-    const size_t pg_size = 256 * 1024;
-
-    /* detect first write */
-    if ( self -> u . data == NULL )
-    {
-        /* get ids, ord and content length from table */
-        assert ( self -> idx == NULL );
-        ON_FAIL ( self -> u . ids = RowSetIteratorGetSourceIds ( self -> tbl -> rsi, ctx, & self -> ord, & self -> num_items ) )
-        {
-            ANNOTATE ( "failed to get old_id, ord maps for column '%s'", ColumnWriterFullSpec ( self -> cw, ctx ) );
-            return;
-        }
-
-        /* require elem_bits to be constant for column */
-        self -> elem_bits = elem_bits;
-
-        /* OPTIMIZATION:
-           IFF elem_bits <= 64 and row_len == 1, store in union
-           otherwise, use membank. This requires that if row_len
-           ever changes, we have to recover. */
-        if ( elem_bits > 64 || row_len != 1 )
-        {
-	    rc_t rc=KBTreeMakeUpdate(&self->vocab_key2id, NULL, 100*1024*1024,
-                              false, kbtOpaqueKey,
-                              1, 1024, sizeof ( uint32_t ),
-                              NULL
-                              );
-	    if(rc != 0) self->vocab_key2id = NULL;
-	    self->vocab_cnt=0;
-            /* create a memory bank */
-            /* TBD - used configured page size rather than 256K */
-            ON_FAIL ( self -> mbank = MemBankMakePaged ( ctx, -1L, pg_size ) )
-               return;
-        }
-        /* initialize min/max */
-        self -> min_row_len = self -> max_row_len = row_len;
-    }
-
-    /* elem_bits should be constant */
-    assert ( self -> elem_bits == elem_bits );
-
-    /* handle optimized case */
-    if ( self -> mbank == NULL )
-    {
-        /* first, detect a change */
-        if ( row_len == 1 )
-        {
-            /* continue on optimized case */
-            row_bytes = ( ( size_t ) elem_bits + 7 ) >> 3;
-            if ( boff != 0 )
-            {
-                bitcpy ( & self -> u . ids [ self -> cur_item ],
-                    0, data, boff, ( bitsz_t ) elem_bits * row_len );
-            }
-            else
-            {
-                memcpy ( & self -> u . ids [ self -> cur_item ], data, row_bytes );
-            }
-
-            /* record another immediate row */
-            ++ self -> num_immed;
-
-            /* detect last row */
-            if ( ++ self -> cur_item < self -> num_items )
-                return;
-
-            /* write all rows to column writer */
-            STATUS ( 3, "writing cell data to '%s'", ColumnWriterFullSpec ( self -> cw, ctx ) );
-            for ( i = 0; i < self -> num_items; ++ i )
-            {
-                /* map to new order */
-                j = self -> ord [ i ];
-
-                /* write out row */
-                ON_FAIL ( ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, & self -> u . ids [ j ], 0, 1 ) )
-                    break;
-            }
-
-            /* forget about map */
-            self -> u . ids = NULL;
-            self -> ord = NULL;
-            self -> cur_item = self -> num_items = self -> num_immed = 0;
-            self -> elem_bits = 0;
-
-            return;
-        }
-
-        /* need to recover */
-	{
-	    rc_t rc=KBTreeMakeUpdate(&self->vocab_key2id, NULL, 100*1024*1024,
-                              false, kbtOpaqueKey,
-                              1, 1024, sizeof ( uint32_t ),
-                              NULL
-                              );
-	    if(rc != 0) self->vocab_key2id = NULL;
-	    self->vocab_cnt=0;
-            /* create a memory bank */
-            /* create a memory bank */
-            /* TBD - used configured page size rather than 256K */
-            ON_FAIL ( self -> mbank = MemBankMakePaged ( ctx, -1L, pg_size ) )
-               return;
-	}
-    }
-
-    /* update min/max row-len */
-    if ( row_len < self -> min_row_len )
-        self -> min_row_len = row_len;
-    else if ( row_len > self -> max_row_len )
-        self -> max_row_len = row_len;
-
-    /* handle zero-length rows specially */
-    if ( row_len == 0 ){
-        self -> u . ids [ self -> cur_item ] = 0;
-    } else {
-    	uint32_t *base = NULL; 
-        row_bytes = ( ( size_t ) elem_bits * row_len + 7 ) >> 3;
-	if(self -> vocab_key2id){
-		rc_t rc;
-		bool wasInserted;
-		uint64_t tmp_id=self -> vocab_cnt;
-		if( self -> vocab_cnt < sizeof(self -> vocab_id2val)/sizeof(self -> vocab_id2val[0])){
-			rc = KBTreeEntry(self -> vocab_key2id, &tmp_id, &wasInserted, data, row_bytes);
-		} else {
-			rc = KBTreeFind (self -> vocab_key2id, &tmp_id, data, row_bytes);
-			if(rc == 0) wasInserted=false;
-		}
-		if(rc == 0){ /*** either entered or found **/
-			if(wasInserted){/** allocate and remember in vocabulary ***/
-				/* allocate space for the row */
-				TRY ( base = MemBankAlloc ( self -> mbank, ctx, row_bytes + sizeof row_len, false ) )
-				{
-				    /* copy it in */
-				    base[0] = row_len;
-				    if ( boff != 0 ) bitcpy ( & base [ 1 ], 0, data, boff, ( bitsz_t ) elem_bits * row_len );
-				    else memcpy ( & base [ 1 ], data, row_bytes );
-				    self -> vocab_id2val[self -> vocab_cnt++] = base; 
-				}
-			} else { /** get from vocabulary **/
-				assert(tmp_id < self -> vocab_cnt);
-				base = (uint32_t*)self -> vocab_id2val[tmp_id];
-			}
-		}
-		rc = 0;
-	}
-	if(base == NULL){
-		TRY ( base = MemBankAlloc ( self -> mbank, ctx, row_bytes + sizeof row_len, false ) )
-		{
-		    /* copy it in */
-		    base[0] = row_len;
-		    if ( boff != 0 )
-			bitcpy ( & base [ 1 ], 0, data, boff, ( bitsz_t ) elem_bits * row_len );
-		    else
-			memcpy ( & base [ 1 ], data, row_bytes );
-		}
-
-	}
-	/* remember base location in the map */
-	self -> u . ids [ self -> cur_item ] = ( int64_t ) ( size_t ) base;
-	/* remember the last input pointer */
-    }
-
-    if ( ! FAILED () )
-    {
-        /* detect last row */
-        if ( ++ self -> cur_item == self -> num_items )
-        {
-            /* write all rows to column writer */
-	    uint32_t *last_base=NULL;
-	    uint32_t   cnt=0;
-            STATUS ( 3, "writing cell data to '%s' num_items=%ld vocab_size=%d num_immed=%d", ColumnWriterFullSpec ( self -> cw, ctx ), self -> num_items, self ->vocab_cnt, self -> num_immed );
-            for ( i = 0; ! FAILED () && i < self -> num_items; ++ i )
-            {
-                /* map to new order */
-                j = self -> ord [ i ];
-                if ( j < self -> num_immed ){
-		    if(cnt > 0){ /*** flush accumulated count ***/
-			if(last_base==NULL) ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,           "",0,           0,cnt);
-			else		    ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,&last_base[1],0,last_base[0],cnt);
-			last_base=NULL;
-			cnt=0;
-		    }
-                    ColumnWriterWrite ( self -> cw, ctx, self -> elem_bits, & self -> u . ids [ j ], 0, 1 );
-                } else {
-                    /* accumulate repeated rows */
-                    void* ptr = (void*)(size_t)self->u.ids [ j ];
-		    if (cnt == 0){
-			cnt=1;
-			last_base = ptr;
-		    } else if (ptr == last_base){
-			cnt++;
-		    } else {
-			if(last_base==NULL) ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,           "",0,           0,cnt);
-			else		    ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,&last_base[1],0,last_base[0],cnt);
-			last_base = ptr;
-			cnt=1;
-		    }
-                }
-	   }
-	   if(cnt > 0){ /*** flush accumulated count ***/
-		if(last_base==NULL) ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,           "",0,           0,cnt);
-		else		    ColumnWriterWriteStatic(self->cw,ctx,self->elem_bits,&last_base[1],0,last_base[0],cnt);
-            }
-            /* drop the mem-bank */
-            MemBankRelease ( self -> mbank, ctx );
-            self -> mbank = NULL;
-
-            /* forget about map */
-            self -> u . ids = NULL;
-            self -> ord = NULL;
-            self -> cur_item = self -> num_items = self -> num_immed = 0;
-            self -> elem_bits = 0;
-
-            /* cleanup vocabulary */
-            if(self -> vocab_key2id ) {
-                KBTreeRelease  ( self -> vocab_key2id );
-                self -> vocab_key2id = 0;
-            }
-            self -> vocab_cnt = 0;
-
-        }
-    }
-}
-
-static
-void BufferedPairColWriterWriteStatic ( BufferedPairColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-    rc_t rc = RC ( rcExe, rcColumn, rcWriting, rcType, rcIncorrect );
-    INTERNAL_ERROR ( rc, "writing to a non-static column" );
-}
-
-
-static
-void BufferedPairColWriterCommit ( BufferedPairColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterCommit ( self -> cw, ctx );
-}
-
-
-struct ColumnWriter_vt UnmappedBufferedPairColWriter_vt =
-{
-    BufferedPairColWriterWhack,
-    BufferedPairColWriterFullSpec,
-    BufferedPairColWriterPreCopy,
-    BufferedPairColWriterPostCopy,
-    BufferedPairColWriterWriteUnmapped,
-    BufferedPairColWriterWriteStatic,
-    BufferedPairColWriterCommit
-};
-
-
-struct ColumnWriter_vt MappedBufferedPairColWriter_vt =
-{
-    BufferedPairColWriterWhack,
-    BufferedPairColWriterFullSpec,
-    BufferedPairColWriterPreCopy,
-    BufferedPairColWriterPostCopy,
-    BufferedPairColWriterWriteMapped,
-    BufferedPairColWriterWriteStatic,
-    BufferedPairColWriterCommit
-};
-
-
-/*--------------------------------------------------------------------------
- * cSRATblPair
- *  interface to pairing of source and destination tables
- */
-
-/* MakeBufferedColumnWriter
- *  make a wrapper that buffers all rows written
- *  then sorts on flush
- */
-ColumnWriter *cSRATblPairMakeBufferedColumnWriter ( cSRATblPair *self,
-    const ctx_t *ctx, ColumnWriter *writer )
-{
-    FUNC_ENTRY ( ctx );
-
-    BufferedPairColWriter *buff;
-
-    TRY ( buff = MemAlloc ( ctx, sizeof * buff, true ) )
-    {
-        TRY ( ColumnWriterInit ( & buff -> dad, ctx, & UnmappedBufferedPairColWriter_vt, false ) )
-        {
-            /* duplicate our friend */
-            TRY ( buff -> cw = ColumnWriterDuplicate ( writer, ctx ) )
-            {
-                /* borrowed ( weak ) reference
-                   cannot duplicate without creating cycle */
-                buff -> tbl = self;
-
-                return & buff -> dad;
-            }
-        }
-
-        MemFree ( ctx, buff, sizeof * buff );
-    }
-
-    return NULL;
-}
-
-/* MakeBufferedIdRemapColumnWriter
- *  make a wrapper that buffers all rows written
- *  maps all ids through index MapFile
- *  then sorts on flush
- */
-ColumnWriter *cSRATblPairMakeBufferedIdRemapColumnWriter ( cSRATblPair *self,
-    const ctx_t *ctx, ColumnWriter *writer, MapFile *idx, bool assign_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    BufferedPairColWriter *buff;
-
-    TRY ( buff = MemAlloc ( ctx, sizeof * buff, true ) )
-    {
-        TRY ( ColumnWriterInit ( & buff -> dad, ctx, & MappedBufferedPairColWriter_vt, idx != NULL ) )
-        {
-            /* duplicate our friend */
-            TRY ( buff -> cw = ColumnWriterDuplicate ( writer, ctx ) )
-            {
-                TRY ( buff -> idx = MapFileDuplicate ( idx, ctx ) )
-                {
-                    /* borrowed ( weak ) reference
-                       cannot duplicate without creating cycle */
-                    buff -> tbl = self;
-
-                    /* preserve boolean in one of Dad's align bytes */
-                    buff -> dad . align [ 0 ] = assign_ids;
-
-                    return & buff -> dad;
-                }
-
-                ColumnWriterRelease ( writer, ctx );
-            }
-        }
-
-        MemFree ( ctx, buff, sizeof * buff );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/buff-writer.h b/tools/sra-sort/buff-writer.h
deleted file mode 100644
index 261788a..0000000
--- a/tools/sra-sort/buff-writer.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_buff_writer_
-#define _h_sra_sort_buff_writer_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct MapFile;
-struct cSRATblPair;
-struct ColumnWriter;
-
-
-/*--------------------------------------------------------------------------
- * cSRATblPair
- *  interface to pairing of source and destination tables
- */
-
-/* MakeBufferedColumnWriter
- *  make a wrapper that buffers all rows written
- *  then sorts on flush
- */
-struct ColumnWriter *cSRATblPairMakeBufferedColumnWriter ( struct cSRATblPair *self,
-    const ctx_t *ctx, struct ColumnWriter *writer );
-
-/* MakeBufferedIdRemapColumnWriter
- *  make a wrapper that buffers all rows written
- *  maps all ids through index MapFile
- *  then sorts on flush
- */
-struct ColumnWriter *cSRATblPairMakeBufferedIdRemapColumnWriter ( struct cSRATblPair *self,
-    const ctx_t *ctx, struct ColumnWriter *writer, struct MapFile *idx, bool assign_ids );
-
-
-#endif /* _h_sra_sort_buff_writer_ */
diff --git a/tools/sra-sort/caps.c b/tools/sra-sort/caps.c
deleted file mode 100644
index 9becbb1..0000000
--- a/tools/sra-sort/caps.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-
-#include <vdb/manager.h>
-#include <kdb/manager.h>
-#include <kfg/config.h>
-
-#include <string.h>
-
-FILE_ENTRY ( caps );
-
-/*--------------------------------------------------------------------------
- * Caps
- *  a very watered down version of vdb-3 capabilities
- */
-
-
-/* Init
- *  initialize a local block from another
- */
-void CapsInit ( Caps *caps, const ctx_t *ctx )
-{
-    if ( caps != NULL )
-    {
-        memset ( caps, 0, sizeof * caps );
-        if ( ctx != NULL && ctx -> caps != NULL )
-        {
-            const Caps *orig = ctx -> caps;
-            FUNC_ENTRY ( ctx );
-            TRY ( caps -> mem = MemBankDuplicate ( orig -> mem, ctx ) )
-            {
-                rc_t rc = KConfigAddRef ( caps -> cfg = orig -> cfg );
-                if ( rc != 0 )
-                {
-                    caps -> cfg = NULL;
-                    ERROR ( rc, "failed to duplicate reference to KConfig" );
-                }
-                else
-                {
-                    rc = KDBManagerAddRef ( caps -> kdb = orig -> kdb );
-                    if ( rc != 0 )
-                    {
-                        caps -> kdb = NULL;
-                        ERROR ( rc, "failed to duplicate reference to KDBManager" );
-                    }
-                    else
-                    {
-                        rc = VDBManagerAddRef ( caps -> vdb = orig -> vdb );
-                        if ( rc != 0 )
-                        {
-                            caps -> vdb = NULL;
-                            ERROR ( rc, "failed to duplicate reference to VDBManager" );
-                        }
-                        else
-                        {
-                            caps -> tool = orig -> tool;
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-
-/* Whack
- *  release references
- */
-void CapsWhack ( Caps *self, const ctx_t *ctx )
-{
-    if ( self != NULL )
-    {
-        rc_t rc;
-        MemBank *mem;
-
-        self -> tool = NULL;
-
-        rc = VDBManagerRelease ( self -> vdb );
-        if ( rc != 0 )
-            ABORT ( rc, "failed to release reference to VDBManager" );
-        self -> vdb = NULL;
-
-        rc = KDBManagerRelease ( self -> kdb );
-        if ( rc != 0 )
-            ABORT ( rc, "failed to release reference to KDBManager" );
-        self -> kdb = NULL;
-
-        rc = KConfigRelease ( self -> cfg );
-        if ( rc != 0 )
-            ABORT ( rc, "failed to release reference to KConfig" );
-        self -> cfg = NULL;
-
-        mem = self -> mem;
-        MemBankRelease ( mem, ctx );
-        self -> mem = NULL;
-    }
-}
diff --git a/tools/sra-sort/caps.h b/tools/sra-sort/caps.h
deleted file mode 100644
index 7368556..0000000
--- a/tools/sra-sort/caps.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_caps_
-#define _h_sra_sort_caps_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct MemBank;
-struct KConfig;
-struct KDBManager;
-struct VDBManager;
-struct Tool;
-
-
-/*--------------------------------------------------------------------------
- * Caps
- *  a very watered-down version of vdb-3 capabilities
- */
-typedef struct Caps Caps;
-struct Caps
-{
-    struct MemBank *mem;
-    struct KConfig const *cfg;
-    struct KDBManager *kdb;
-    struct VDBManager *vdb;
-    struct Tool const *tool;
-};
-
-
-/* Init
- *  initialize a local block from another
- */
-void CapsInit ( Caps *caps, const ctx_t *ctx );
-
-
-/* Whack
- *  release references
- */
-void CapsWhack ( Caps *self, const ctx_t *ctx );
-
-#endif
diff --git a/tools/sra-sort/capture-first-half-aligned.c b/tools/sra-sort/capture-first-half-aligned.c
deleted file mode 100644
index 73cd829..0000000
--- a/tools/sra-sort/capture-first-half-aligned.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct CaptureFirstHalfAlignedColWriter CaptureFirstHalfAlignedColWriter;
-#define COLWRITER_IMPL CaptureFirstHalfAlignedColWriter
-
-#include "csra-pair.h"
-#include "col-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <klib/rc.h>
-
-FILE_ENTRY ( capture-first-half-aligned );
-
-
-/*--------------------------------------------------------------------------
- * CaptureFirstHalfAlignedColWriter
- */
-struct CaptureFirstHalfAlignedColWriter
-{
-    ColumnWriter dad;
-
-    int64_t row_id;
-    cSRAPair *csra;
-    ColumnWriter *writer;
-};
-
-static
-void CaptureFirstHalfAlignedColWriterWhack ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterRelease ( self -> writer, ctx );
-    self -> csra = NULL;
-    self -> writer = NULL;
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-const char *CaptureFirstHalfAlignedColWriterFullSpec ( const CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return ColumnWriterFullSpec ( self -> writer, ctx );
-}
-
-static
-void CaptureFirstHalfAlignedColWriterPreCopy ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterPreCopy ( self -> writer, ctx );
-}
-
-static
-void CaptureFirstHalfAlignedColWriterPostCopy ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterPostCopy ( self -> writer, ctx );
-}
-
-static
-void CaptureFirstHalfAlignedColWriterWrite ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *csra = self -> csra;
-    if ( csra -> first_half_aligned_spot == 0 )
-    {
-        uint32_t i;
-        const int64_t *row = data;
-
-        for ( i = 0; i < row_len; ++ i )
-        {
-            if ( row [ i ] == 0 )
-            {
-                csra -> first_half_aligned_spot = self -> row_id;
-                break;
-            }
-        }
-    }
-
-    TRY ( ColumnWriterWrite ( self -> writer, ctx, elem_bits, data, boff, row_len ) )
-    {
-        ++ self -> row_id;
-    }
-}
-
-static
-void CaptureFirstHalfAlignedColWriterWriteStatic ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *csra = self -> csra;
-    if ( csra -> first_half_aligned_spot == 0 )
-    {
-        uint32_t i;
-        const int64_t *row = data;
-
-        for ( i = 0; i < row_len; ++ i )
-        {
-            if ( row [ i ] == 0 )
-            {
-                csra -> first_half_aligned_spot = self -> row_id;
-                break;
-            }
-        }
-    }
-
-    TRY ( ColumnWriterWriteStatic ( self -> writer, ctx, elem_bits, data, boff, row_len, count ) )
-    {
-        self -> row_id += count;
-    }
-}
-
-static
-void CaptureFirstHalfAlignedColWriterCommit ( CaptureFirstHalfAlignedColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterCommit ( self -> writer, ctx );
-}
-
-static ColumnWriter_vt CaptureFirstHalfAlignedColWriter_vt =
-{
-    CaptureFirstHalfAlignedColWriterWhack,
-    CaptureFirstHalfAlignedColWriterFullSpec,
-    CaptureFirstHalfAlignedColWriterPreCopy,
-    CaptureFirstHalfAlignedColWriterPostCopy,
-    CaptureFirstHalfAlignedColWriterWrite,
-    CaptureFirstHalfAlignedColWriterWriteStatic,
-    CaptureFirstHalfAlignedColWriterCommit
-};
-
-/*--------------------------------------------------------------------------
- * cSRAPair
- */
-
-/* MakeFirstHalfAlignedRowIdCaptureWriter
- *  a simple monitor on SEQUENCE.PRIMARY_ALIGNMENT_ID looking for
- *  half-aligned spots and capturing the first occurrence.
- */
-ColumnWriter *cSRAPairMakeFirstHalfAlignedRowIdCaptureWriter ( cSRAPair *self,
-    const ctx_t *ctx, ColumnWriter *writer )
-{
-    FUNC_ENTRY ( ctx );
-
-    CaptureFirstHalfAlignedColWriter *mon;
-
-    TRY ( mon = MemAlloc ( ctx, sizeof * mon, false ) )
-    {
-        TRY ( ColumnWriterInit ( & mon -> dad, ctx, & CaptureFirstHalfAlignedColWriter_vt, false ) )
-        {
-            mon -> row_id = 1;
-            mon -> csra = self;
-            TRY ( mon -> writer = ColumnWriterDuplicate ( writer, ctx ) )
-            {
-                return & mon -> dad;
-            }
-        }
-
-        MemFree ( ctx, mon, sizeof * mon );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/col-pair.c b/tools/sra-sort/col-pair.c
deleted file mode 100644
index 11e7779..0000000
--- a/tools/sra-sort/col-pair.c
+++ /dev/null
@@ -1,816 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct SimpleColumnReader SimpleColumnReader;
-#define COLREADER_IMPL SimpleColumnReader
-
-typedef struct SimpleColumnWriter SimpleColumnWriter;
-#define COLWRITER_IMPL SimpleColumnWriter
-
-#include "col-pair.h"
-#include "tbl-pair.h"
-#include "row-set.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kapp/main.h>
-#include <kfs/defs.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-FILE_ENTRY ( col-pair );
-
-
-/*--------------------------------------------------------------------------
- * SimpleColumnReader
- *  implementation of ColumnReader based upon VCursor direct read
- */
-struct SimpleColumnReader
-{
-    ColumnReader dad;
-
-    const VCursor *curs;
-    uint32_t idx;
-
-    uint32_t full_spec_size;
-    char full_spec [ 1 ];
-};
-
-
-/* Whack
- */
-static
-void SimpleColumnReaderWhack ( SimpleColumnReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t bytes = sizeof * self + self -> full_spec_size;
-
-    rc = VCursorRelease ( self -> curs );
-    if ( rc != 0 )
-        WARN ( "VCursorRelease failed on '%s'", self -> full_spec );
-
-    self -> curs = NULL;
-    MemFree ( ctx, self, bytes );
-}
-
-/* FullSpec
- */
-static
-const char *SimpleColumnReaderFullSpec ( const SimpleColumnReader *self, const ctx_t *ctx )
-{
-    return self -> full_spec;
-}
-
-
-/* IdRange
- *  returns the number of ids available
- *  and optionally the first id
- */
-static
-uint64_t SimpleColumnReaderIdRange ( const SimpleColumnReader *self,
-    const ctx_t *ctx, int64_t *opt_first )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    uint64_t count;
-
-    rc = VCursorIdRange ( self -> curs, self -> idx, opt_first, & count );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorIdRange failed for column '%s'", self -> full_spec );
-
-    return count;
-}
-
-
-/* DummyStub
- *  useful for pre/post-copy
- */
-static
-void SimpleColumnReaderDummyStub ( SimpleColumnReader *self, const ctx_t *ctx )
-{
-}
-
-
-/* Read
- *  read next row of data
- *  returns NULL if no rows are available
- */
-static
-const void *SimpleColumnReaderRead ( SimpleColumnReader *self, const ctx_t *ctx,
-    int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const void *base;
-
-    rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx, elem_bits, & base, boff, row_len );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorCellDataDirect ( %ld ) failed for column '%s'", row_id, self -> full_spec );
-
-    return base;
-}
-
-static ColumnReader_vt SimpleColumnReader_vt =
-{
-    SimpleColumnReaderWhack,
-    SimpleColumnReaderFullSpec,
-    SimpleColumnReaderIdRange,
-    SimpleColumnReaderDummyStub,
-    SimpleColumnReaderDummyStub,
-    SimpleColumnReaderRead
-};
-
-
-/*--------------------------------------------------------------------------
- * ColumnReader
- *  interface to read column in serial order
- */
-
-
-/* MakeColumnReader
- *  make simple column reader
- */
-ColumnReader *TablePairMakeColumnReader ( TablePair *self, const ctx_t *ctx,
-    const VCursor *opt_curs, const char *colspec, bool required )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const VCursor *curs;
-
-    if ( opt_curs != NULL )
-        rc = VCursorAddRef ( curs = opt_curs );
-    else
-        rc = VTableCreateCursorRead ( self -> stbl, & curs );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to create cursor on column 'src.%s.%s'", self -> full_spec, colspec );
-    else
-    {
-        uint32_t idx;
-        rc = VCursorAddColumn ( curs, & idx, colspec );
-        if ( rc != 0 && GetRCState ( rc ) != rcExists )
-        {
-            if ( required )
-                ERROR ( rc, "failed to add column 'src.%s.%s' to cursor", self -> full_spec, colspec );
-        }
-        else
-        {
-            rc = VCursorOpen ( curs );
-            if ( rc != 0 )
-            {
-                if ( required )
-                    ERROR ( rc, "failed to open cursor on column 'src.%s.%s'", self -> full_spec, colspec );
-            }
-            else
-            {
-                SimpleColumnReader *col;
-                size_t full_spec_size = self -> full_spec_size + string_size ( colspec ) + sizeof "src.." - 1;
-
-                TRY ( col = MemAlloc ( ctx, sizeof * col + full_spec_size, false ) )
-                {
-                    ColumnReaderInit ( & col -> dad, ctx, & SimpleColumnReader_vt );
-                    col -> curs = curs;
-                    col -> idx = idx;
-                    col -> full_spec_size = ( uint32_t ) full_spec_size;
-
-                    rc = string_printf ( col -> full_spec, full_spec_size + 1, NULL,
-                        "src.%s.%s", self -> full_spec, colspec );
-                    if ( rc == 0 )
-                        return & col -> dad;
-
-                    ABORT ( rc, "miscalculated string size" );
-                }
-                CATCH_ALL ()
-                {
-                    ANNOTATE ( "failed to allocate %zu bytes for SimpleColumnReader", sizeof * col + full_spec_size );
-                }
-            }
-        }
-
-        VCursorRelease ( curs );
-    }
-
-    return NULL;
-}
-
-
-/* Release
- *  releases reference
- */
-void ColumnReaderRelease ( const ColumnReader *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "ColumnReader" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release ColumnReader" );
-        }
-    }
-}
-
-/* Duplicate
- */
-ColumnReader *ColumnReaderDuplicate ( const ColumnReader *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "ColumnReader" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate ColumnReader" );
-            return NULL;
-        }
-    }
-
-    return ( ColumnReader* ) self;
-}
-
-
-/* Init
- */
-void ColumnReaderInit ( ColumnReader *self, const ctx_t *ctx, const ColumnReader_vt *vt )
-{
-    if ( self == NULL )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcConstructing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad ColumnReader" );
-    }
-    else
-    {
-        self -> vt = vt;
-        KRefcountInit ( & self -> refcount, 1, "ColumnReader", "init", "" );
-        self -> presorted = false;
-        memset ( self -> align, 0, sizeof self -> align );
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * SimpleColumnWriter
- *  implementation of ColumnWriter based upon VCursor
- */
-struct SimpleColumnWriter
-{
-    ColumnWriter dad;
-
-    VCursor *curs;
-    uint32_t idx;
-
-    uint32_t full_spec_size;
-    char full_spec [ 1 ];
-};
-
-static
-void SimpleColumnWriterWhack ( SimpleColumnWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VCursorRelease ( self -> curs );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorRelease failed on column '%s'", self -> full_spec );
-
-    MemFree ( ctx, self, sizeof * self + self -> full_spec_size );
-}
-
-
-static
-const char *SimpleColumnWriterFullSpec ( const SimpleColumnWriter *self, const ctx_t *ctx )
-{
-    return self -> full_spec;
-}
-
-static
-void SimpleColumnWriterDummyStub ( SimpleColumnWriter *self, const ctx_t *ctx )
-{
-}
-
-static
-void SimpleColumnWriterWrite ( SimpleColumnWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VCursorOpenRow ( self -> curs );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorOpenRow failed on column '%s'", self -> full_spec );
-    else
-    {
-        rc = VCursorWrite ( self -> curs, self -> idx, elem_bits, data, boff, row_len );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "VCursorWrite failed for column '%s'", self -> full_spec );
-        else
-        {
-            rc = VCursorCommitRow ( self -> curs );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "VCursorCommit failed for column '%s'", self -> full_spec );
-        }
-
-        rc = VCursorCloseRow ( self -> curs );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorCloseRow failed on column '%s'", self -> full_spec );
-    }
-}
-
-static
-void SimpleColumnWriterWriteStatic ( SimpleColumnWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-
-    for ( ; ! FAILED () && count > 0; -- count )
-    {
-        rc_t rc = VCursorOpenRow ( self -> curs );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorOpenRow failed on column '%s'", self -> full_spec );
-        else
-        {
-            rc = VCursorWrite ( self -> curs, self -> idx, elem_bits, data, boff, row_len );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "VCursorWrite failed for column '%s'", self -> full_spec );
-            else
-            {
-                rc = VCursorCommitRow ( self -> curs );
-                if ( rc != 0 )
-                    SYSTEM_ERROR ( rc, "VCursorCommitRow failed for column '%s'", self -> full_spec );
-                else if ( count > 1 )
-                {
-                    /* setting it small since threshold is detected in CommitRow, but execused on CloseRow */
-                    uint64_t cnt = ( count < 0x20000000U ) ? count : 0x20000000U; 
-                    rc = VCursorRepeatRow ( self -> curs, cnt - 1 );
-                    if ( rc != 0 )
-                        SYSTEM_ERROR ( rc, "VCursorRepeatRow failed for column '%s'", self -> full_spec );
-                    else
-                        count -= cnt - 1;
-                }
-            }
-
-            rc = VCursorCloseRow ( self -> curs );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "VCursorCloseRow failed on column '%s'", self -> full_spec );
-        }
-    }
-}
-
-static
-void SimpleColumnWriterCommit ( SimpleColumnWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VCursorCommit ( self -> curs );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorCommit failed on column '%s'", self -> full_spec );
-    else
-    {
-        rc = VCursorRelease ( self -> curs );
-        if ( rc != 0 )
-            ERROR ( rc, "VCursorRelease failed on column '%s'", self -> full_spec );
-        else
-        {
-            self -> curs = NULL;
-        }
-    }
-}
-
-
-static ColumnWriter_vt SimpleColumnWriter_vt =
-{
-    SimpleColumnWriterWhack,
-    SimpleColumnWriterFullSpec,
-    SimpleColumnWriterDummyStub,
-    SimpleColumnWriterDummyStub,
-    SimpleColumnWriterWrite,
-    SimpleColumnWriterWriteStatic,
-    SimpleColumnWriterCommit
-};
-
-
-
-/*--------------------------------------------------------------------------
- * ColumnWriter
- *  interface to write column in serial order
- */
-
-
-/* MakeColumnWriter
- *  make simple column writer
- */
-ColumnWriter *TablePairMakeColumnWriter ( TablePair *self, const ctx_t *ctx,
-   VCursor *opt_curs, const char *colspec )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    VCursor *curs;
-
-    if ( opt_curs != NULL )
-        rc = VCursorAddRef ( curs = opt_curs );
-    else
-        rc = VTableCreateCursorWrite ( self -> dtbl, & curs, kcmInsert );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to create cursor on column 'dst.%s.%s'", self -> full_spec, colspec );
-    else
-    {
-        uint32_t idx;
-        rc = VCursorAddColumn ( curs, & idx, colspec );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to add column 'dst.%s.%s' to cursor", self -> full_spec, colspec );
-        else
-        {
-	    VCursorSuspendTriggers ( curs );
-            rc = VCursorOpen ( curs );
-            if ( rc != 0 )
-                ERROR ( rc, "failed to open cursor on column 'dst.%s.%s'", self -> full_spec, colspec );
-            {
-                SimpleColumnWriter *col;
-                size_t full_spec_size = self -> full_spec_size + string_size ( colspec ) + sizeof "dst.." - 1;
-
-                TRY ( col = MemAlloc ( ctx, sizeof * col + full_spec_size, false ) )
-                {
-                    ColumnWriterInit ( & col -> dad, ctx, & SimpleColumnWriter_vt, false );
-                    col -> curs = curs;
-                    col -> idx = idx;
-
-                    col -> full_spec_size = ( uint32_t ) full_spec_size;
-                    rc = string_printf ( col -> full_spec, full_spec_size + 1, NULL,
-                        "dst.%s.%s", self -> full_spec, colspec );
-                    if ( rc == 0 )
-                        return & col -> dad;
-
-                    ABORT ( rc, "miscalculated string size" );
-                }
-                CATCH_ALL ()
-                {
-                    ANNOTATE ( "failed to allocate %zu bytes for SimpleColumnWriter", sizeof * col + full_spec_size );
-                }
-            }
-        }
-
-        VCursorRelease ( curs );
-    }
-
-    return NULL;
-}
-
-
-/* Release
- *  releases reference
- */
-void ColumnWriterRelease ( ColumnWriter *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "ColumnWriter" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release ColumnWriter" );
-        }
-    }
-}
-
-/* Duplicate
- */
-ColumnWriter *ColumnWriterDuplicate ( const ColumnWriter *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "ColumnWriter" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate ColumnWriter" );
-            return NULL;
-        }
-    }
-
-    return ( ColumnWriter* ) self;
-}
-
-
-/* Init
- */
-void ColumnWriterInit ( ColumnWriter *self, const ctx_t *ctx, const ColumnWriter_vt *vt, bool mapped )
-{
-    if ( self == NULL )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcConstructing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad ColumnWriter" );
-    }
-    else
-    {
-        self -> vt = vt;
-        KRefcountInit ( & self -> refcount, 1, "ColumnWriter", "init", "" );
-        self -> mapped = mapped;
-        memset ( self -> align, 0, sizeof self -> align );
-    }
-}
-
-
-
-/*--------------------------------------------------------------------------
- * ColumnPair
- *  interface to pairing of source and destination columns
- */
-
-/* Whack
- */
-static
-void ColumnPairWhack ( ColumnPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnReaderRelease ( self -> reader, ctx );
-    ColumnWriterRelease ( self -> writer, ctx );
-    MemFree ( ctx, self, sizeof * self + self -> full_spec_size );
-}
-
-/* MakeColumnPair
- *  make a simple ColumnPair
- *  takes an optional source VCursor
- *  and a colspec
- */
-ColumnPair *TablePairMakeColumnPair ( TablePair *self, const ctx_t *ctx,
-    ColumnReader *reader, ColumnWriter *writer, const char *colspec, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col;
-    size_t full_spec_size = self -> full_spec_size + string_size ( colspec ) + 1;
-
-    TRY ( col = MemAlloc ( ctx, sizeof * col + full_spec_size, false ) )
-    {
-        TRY ( col -> reader = ColumnReaderDuplicate ( reader, ctx ) )
-        {
-            TRY ( col -> writer = ColumnWriterDuplicate ( writer, ctx ) )
-            {
-                rc_t rc;
-
-                col -> full_spec_size = full_spec_size;
-                KRefcountInit ( & col -> refcount, 1, "ColumnPair", "make", colspec );
-                col -> is_static = false;
-                col -> is_mapped = writer -> mapped;
-                col -> presorted = reader -> presorted;
-                col -> large = large;
-
-                rc = string_printf ( col -> full_spec, full_spec_size + 1, NULL,
-                    "%s.%s", self -> full_spec, colspec );
-                if ( rc == 0 )
-                {
-                    col -> colspec = & col -> full_spec [ self -> full_spec_size + 1 ];
-                    return col;
-                }
-
-                ABORT ( rc, "miscalculated string size" );
-            }
-
-            ColumnReaderRelease ( col -> reader, ctx );
-        }
-
-        MemFree ( ctx, col, sizeof * col + full_spec_size );
-    }
-
-    return NULL;
-}
-
-ColumnPair *TablePairMakeStaticColumnPair ( TablePair *self, const ctx_t *ctx,
-    ColumnReader *reader, ColumnWriter *writer, const char *colspec )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col;
-
-    TRY ( col = TablePairMakeColumnPair ( self, ctx, reader, writer, colspec, false ) )
-    {
-        if ( col != NULL )
-            col -> is_static = true;
-    }
-
-    return col;
-}
-
-
-/* Release
- *  called by table at end of copy
- */
-void ColumnPairRelease ( ColumnPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "ColumnPair" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ColumnPairWhack ( self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcColumn, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release ColumnPair" );
-        }
-    }
-}
-
-/* Duplicate
- */
-ColumnPair *ColumnPairDuplicate ( const ColumnPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "ColumnPair" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcColumn, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate ColumnPair" );
-            return NULL;
-        }
-    }
-
-    return ( ColumnPair* ) self;
-}
-
-
-/* PreCopy
- * PostCopy
- */
-void ColumnPairPreCopy ( const ColumnPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnReaderPreCopy ( self -> reader, ctx );
-    ColumnWriterPreCopy ( self -> writer, ctx );
-}
-
-void ColumnPairPostCopy ( const ColumnPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnReaderPostCopy ( self -> reader, ctx );
-    ColumnWriterPostCopy ( self -> writer, ctx );
-}
-
-
-/* Copy
- *  copy from source to destination column
- */
-void ColumnPairCopy ( ColumnPair *self, const ctx_t *ctx, RowSet *rs )
-{
-    FUNC_ENTRY ( ctx );
-
-    STATUS ( 3, "copying column '%s'", self -> full_spec );
-
-    TRY ( RowSetReset ( rs, ctx, self -> is_static ) )
-    {
-        TRY ( ColumnPairPreCopy ( self, ctx ) )
-        {
-            while ( ! FAILED () )
-            {
-                rc_t rc;
-                size_t i, count;
-                int64_t row_ids [ 8 * 1024 ];
-
-                ON_FAIL ( count = RowSetNext ( rs, ctx, row_ids, sizeof row_ids / sizeof row_ids [ 0 ] ) )
-                    break;
-                if ( count == 0 )
-                    break;
-
-                rc = Quitting ();
-                if ( rc != 0 )
-                {
-                    INFO_ERROR ( rc, "quitting" );
-                    break;
-                }
-
-                for ( i = 0; ! FAILED () && i < count; ++ i )
-                {
-                    const void *base;
-                    uint32_t elem_bits, boff, row_len;
-                    
-                    TRY ( base = ColumnReaderRead ( self -> reader, ctx, row_ids [ i ], & elem_bits, & boff, & row_len ) )
-                    {
-                        ColumnWriterWrite ( self -> writer, ctx, elem_bits, base, boff, row_len );
-                    }
-                }
-            }
-
-            ColumnPairPostCopy ( self, ctx );
-        }
-    }
-}
-
-
-/* CopyStatic
- *  copy static column from source to destination
- */
-void ColumnPairCopyStatic ( ColumnPair *self, const ctx_t *ctx, int64_t first_id, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const void *base;
-    uint32_t elem_bits, boff, row_len;
-
-    if ( ! self -> is_static )
-    {
-        rc = RC ( rcExe, rcColumn, rcCopying, rcType, rcIncorrect );
-        INTERNAL_ERROR ( rc, "'%s' IS NOT A STATIC COLUMN", self -> full_spec );
-        return;
-    }
-
-    STATUS ( 3, "copying static column '%s'", self -> full_spec );
-                    
-    TRY ( base = ColumnReaderRead ( self -> reader, ctx, first_id, & elem_bits, & boff, & row_len ) )
-    {
-        ColumnWriterWriteStatic ( self -> writer, ctx, elem_bits, base, boff, row_len, count );
-    }
-}
diff --git a/tools/sra-sort/col-pair.h b/tools/sra-sort/col-pair.h
deleted file mode 100644
index b14df08..0000000
--- a/tools/sra-sort/col-pair.h
+++ /dev/null
@@ -1,323 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_col_pair_
-#define _h_sra_sort_col_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VCursor;
-struct TablePair;
-struct RowSet;
-
-
-/*--------------------------------------------------------------------------
- * ColumnReader
- *  interface to read column in random order
- */
-typedef struct ColumnReader_vt ColumnReader_vt;
-
-typedef struct ColumnReader ColumnReader;
-struct ColumnReader
-{
-    const ColumnReader_vt *vt;
-    KRefcount refcount;
-    bool presorted;
-    uint8_t align [ 3 ];
-};
-
-#ifndef COLREADER_IMPL
-#define COLREADER_IMPL ColumnReader
-#endif
-
-struct ColumnReader_vt
-{
-    /* called by Release */
-    void ( * whack ) ( COLREADER_IMPL *self, const ctx_t *ctx );
-
-    /* full spec */
-    const char* ( * full_spec ) ( const COLREADER_IMPL *self, const ctx_t *ctx );
-
-    /* id-range */
-    uint64_t ( * id_range ) ( const COLREADER_IMPL *self, const ctx_t *ctx, int64_t *opt_first );
-
-    /* pre-post copy handlers */
-    void ( * pre_copy ) ( COLREADER_IMPL *self, const ctx_t *ctx );
-    void ( * post_copy ) ( COLREADER_IMPL *self, const ctx_t *ctx );
-
-    /* retrieve next source row */
-    const void* ( * read ) ( COLREADER_IMPL *self, const ctx_t *ctx,
-        int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len );
-};
-
-
-/* MakeColumnReader
- *  make simple column reader
- */
-ColumnReader *TablePairMakeColumnReader ( struct TablePair *self, const ctx_t *ctx,
-    struct VCursor const *opt_curs, const char *colspec, bool required );
-
-
-/* Release
- *  releases reference
- */
-void ColumnReaderRelease ( const ColumnReader *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-ColumnReader *ColumnReaderDuplicate ( const ColumnReader *self, const ctx_t *ctx );
-
-
-/* FullSpec
- *  returns 'src.<tbl>.<colspec>'
- */
-#define ColumnReaderFullSpec( self, ctx ) \
-    POLY_DISPATCH_PTR ( full_spec, self, const COLREADER_IMPL, ctx )
-
-
-/* IdRange
- *  returns the number of ids available
- *  and optionally the first id
- */
-#define ColumnReaderIdRange( self, ctx, opt_first ) \
-    POLY_DISPATCH_INT ( id_range, self, const COLREADER_IMPL, ctx, opt_first )
-
-
-/* PreCopy
- * PostCopy
- *  handlers for any operations
- */
-#define ColumnReaderPreCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( pre_copy, self, COLREADER_IMPL, ctx )
-#define ColumnReaderPostCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( post_copy, self, COLREADER_IMPL, ctx )
-
-
-/* Read
- *  read next row of data
- *  returns NULL if no rows are available
- */
-#define ColumnReaderRead( self, ctx, row_id, elem_bits, boff, row_len )  \
-    POLY_DISPATCH_PTR ( read, self, COLREADER_IMPL, ctx, row_id, elem_bits, boff, row_len )
-
-
-/* Init
- */
-void ColumnReaderInit ( ColumnReader *self, const ctx_t *ctx, const ColumnReader_vt *vt );
-
-/* Destroy
- */
-#define ColumnReaderDestroy( self, ctx ) \
-    ( ( void ) 0 )
-
-
-/*--------------------------------------------------------------------------
- * ColumnWriter
- *  interface to write column in serial order
- */
-typedef struct ColumnWriter_vt ColumnWriter_vt;
-
-typedef struct ColumnWriter ColumnWriter;
-struct ColumnWriter
-{
-    const ColumnWriter_vt *vt;
-    KRefcount refcount;
-    bool mapped;
-    uint8_t align [ 3 ];
-};
-
-#ifndef COLWRITER_IMPL
-#define COLWRITER_IMPL ColumnWriter
-#endif
-
-struct ColumnWriter_vt
-{
-    /* called by Release */
-    void ( * whack ) ( COLWRITER_IMPL *self, const ctx_t *ctx );
-
-    /* full spec */
-    const char* ( * full_spec ) ( const COLWRITER_IMPL *self, const ctx_t *ctx );
-
-    /* pre-post copy handlers */
-    void ( * pre_copy ) ( COLWRITER_IMPL *self, const ctx_t *ctx );
-    void ( * post_copy ) ( COLWRITER_IMPL *self, const ctx_t *ctx );
-
-    /* write row to destination */
-    void ( * write ) ( COLWRITER_IMPL *self, const ctx_t *ctx,
-        uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len );
-    void ( * write_static ) ( COLWRITER_IMPL *self, const ctx_t *ctx,
-        uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count );
-
-    /* commit all writes */
-    void ( * commit ) ( COLWRITER_IMPL *self, const ctx_t *ctx );
-};
-
-
-/* MakeColumnWriter
- *  make simple column writer
- */
-ColumnWriter *TablePairMakeColumnWriter ( struct TablePair *self, const ctx_t *ctx,
-    struct VCursor *opt_curs, const char *colspec );
-
-
-/* Release
- *  releases reference
- */
-void ColumnWriterRelease ( ColumnWriter *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-ColumnWriter *ColumnWriterDuplicate ( const ColumnWriter *self, const ctx_t *ctx );
-
-
-/* FullSpec
- *  returns 'dst.<tbl>.<colspec>'
- */
-#define ColumnWriterFullSpec( self, ctx ) \
-    POLY_DISPATCH_PTR ( full_spec, self, const COLWRITER_IMPL, ctx )
-
-
-/* PreCopy
- * PostCopy
- *  handlers for any operations
- */
-#define ColumnWriterPreCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( pre_copy, self, COLWRITER_IMPL, ctx )
-#define ColumnWriterPostCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( post_copy, self, COLWRITER_IMPL, ctx )
-
-
-/* Write
- *  write a row of data
- */
-#define ColumnWriterWrite( self, ctx, elem_bits, data, boff, row_len ) \
-    POLY_DISPATCH_VOID ( write, self, COLWRITER_IMPL, ctx, elem_bits, data, boff, row_len )
-
-/* WriteStatic
- *  writes a repeated row
- */
-#define ColumnWriterWriteStatic( self, ctx, elem_bits, data, boff, row_len, count ) \
-    POLY_DISPATCH_VOID ( write_static, self, COLWRITER_IMPL, ctx, elem_bits, data, boff, row_len, count )
-
-
-/* Commit
- *  commits all writes
- */
-#define ColumnWriterCommit( self, ctx ) \
-    POLY_DISPATCH_VOID ( commit, self, COLWRITER_IMPL, ctx )
-
-
-/* Init
- */
-void ColumnWriterInit ( ColumnWriter *self, const ctx_t *ctx,
-    const ColumnWriter_vt *vt, bool mapped );
-
-/* Destroy
- */
-#define ColumnWriterDestroy( self, ctx ) \
-    ( ( void ) 0 )
-
-
-/*--------------------------------------------------------------------------
- * ColumnPair
- *  interface to pairing of source and destination columns
- */
-typedef struct ColumnPair ColumnPair;
-struct ColumnPair
-{
-    ColumnReader *reader;
-    ColumnWriter *writer;
-
-    const char *colspec;
-
-    size_t full_spec_size;
-
-    KRefcount refcount;
-
-    bool is_static;
-
-    bool is_mapped;
-
-    bool presorted;
-
-    bool large;
-
-    char full_spec [ 1 ];
-};
-
-
-/* MakeColumnPair
- *  make a simple ColumnPair
- *  takes an optional source VCursor
- *  and a colspec
- */
-ColumnPair *TablePairMakeColumnPair ( struct TablePair *self, const ctx_t *ctx,
-    ColumnReader *reader, ColumnWriter *writer, const char *colspec, bool large );
-
-ColumnPair *TablePairMakeStaticColumnPair ( struct TablePair *self, const ctx_t *ctx,
-    ColumnReader *reader, ColumnWriter *writer, const char *colspec );
-
-
-/* Release
- *  called by table at end of copy
- */
-void ColumnPairRelease ( ColumnPair *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-ColumnPair *ColumnPairDuplicate ( const ColumnPair *self, const ctx_t *ctx );
-
-
-/* PreCopy
- * PostCopy
- */
-void ColumnPairPreCopy ( const ColumnPair *self, const ctx_t *ctx );
-void ColumnPairPostCopy ( const ColumnPair *self, const ctx_t *ctx );
-
-
-/* Copy
- *  copy from source to destination column
- */
-void ColumnPairCopy ( ColumnPair *self, const ctx_t *ctx, struct RowSet *rs );
-
-
-/* CopyStatic
- *  copy static column from source to destination
- */
-void ColumnPairCopyStatic ( ColumnPair *self, const ctx_t *ctx, int64_t first_id, uint64_t count );
-
-
-#endif /* _h_sra_sort_col_pair_ */
diff --git a/tools/sra-sort/csra-pair.c b/tools/sra-sort/csra-pair.c
deleted file mode 100644
index 579863c..0000000
--- a/tools/sra-sort/csra-pair.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-struct cSRAPair;
-#define DBPAIR_IMPL struct cSRAPair
-
-#include "csra-pair.h"
-#include "csra-tbl.h"
-#include "meta-pair.h"
-#include "dir-pair.h"
-#include "sra-sort.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "map-file.h"
-
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( csra-pair );
-
-
-/*--------------------------------------------------------------------------
- * cSRAPair
- */
-
-static
-void cSRAPairWhack ( cSRAPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* destroy me */
-    MapFileRelease ( self -> seq_idx, ctx );
-    MapFileRelease ( self -> sa_idx, ctx );
-    MapFileRelease ( self -> pa_idx, ctx );
-
-    DbPairDestroy ( & self -> dad, ctx );
-
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-TablePair *cSRAPairMakeTablePair ( cSRAPair *self, const ctx_t *ctx,
-     const char *member, const char *name, uint32_t align_idx, bool required, bool reorder,
-     TablePair* ( * make ) ( DbPair *self, const ctx_t *ctx, const VTable *src, VTable *dst, const char *name, bool reorder ) )
-{
-    FUNC_ENTRY ( ctx );
-
-    TablePair *tbl;
-
-    if ( name == NULL )
-        name = member;
-
-    TRY ( tbl = DbPairMakeTablePair ( & self -> dad, ctx, member, name, required, reorder, make ) )
-    {
-        if ( tbl != NULL )
-        {
-            TRY ( DbPairAddTablePair ( & self -> dad, ctx, tbl ) )
-            {
-                ( ( cSRATblPair* ) tbl ) -> align_idx = align_idx;
-                return tbl;
-            }
-
-            TablePairRelease ( tbl, ctx );
-        }
-    }
-
-    return NULL;
-}
-
-static
-void cSRAPairExplode ( cSRAPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    TablePair *tbl;
-
-    TRY ( tbl = cSRAPairMakeTablePair ( self, ctx, "REFERENCE", NULL, 0, true, false, cSRATblPairMakeRef ) )
-    {
-        self -> reference = tbl;
-
-        TRY ( tbl = cSRAPairMakeTablePair ( self, ctx, "PRIMARY_ALIGNMENT", NULL, 1, true, true, cSRATblPairMakeAlign ) )
-        {
-            self -> prim_align = tbl;
-
-            TRY ( tbl = cSRAPairMakeTablePair ( self, ctx, "SECONDARY_ALIGNMENT", NULL, 2, false, true, cSRATblPairMakeAlign ) )
-            {
-                self -> sec_align = tbl;
-
-                TRY ( tbl = cSRAPairMakeTablePair ( self, ctx, NULL, "EVIDENCE_ALIGNMENT", 3, false, false, cSRATblPairMakeAlign ) )
-                {
-                    self -> evidence_align = tbl;
-
-                    TRY ( tbl = cSRAPairMakeTablePair ( self, ctx, NULL, "SEQUENCE", 0, false, true, cSRATblPairMakeSeq ) )
-                    {
-                        DirPair *dir;
-
-                        self -> sequence = tbl;
-
-                        TRY ( dir = DbPairMakeDirPair ( & self -> dad, ctx, "extra", false, DbPairMakeStdDirPair ) )
-                        {
-                            ON_FAIL ( DbPairAddDirPair ( & self -> dad, ctx, dir ) )
-                                DirPairRelease ( dir, ctx );
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-static
-const char *cSRAPairGetTblMember ( const cSRAPair *self, const ctx_t *ctx, const VTable *src, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* special kludge for "SEQUENCE" table */
-    if ( strcmp ( name, "SEQUENCE" ) == 0 )
-    {
-        /* determine whether table has CMP_CSREAD */
-        rc_t rc;
-        const VCursor *curs;
-
-        STATUS ( 4, "determining member name of SEQUENCE table" );
-
-        rc = VTableCreateCursorRead ( src, & curs );
-        if ( rc != 0 )
-            ERROR ( rc, "VTableOpenCursorRead failed on '%s.%s'", self -> dad . full_spec, name );
-        else
-        {
-            uint32_t idx;
-            rc = VCursorAddColumn ( curs, & idx, "CMP_CSREAD" );
-            if ( rc == 0 )
-            {
-                rc = VCursorOpen ( curs );
-                if ( rc == 0 )
-                    name = "CS_SEQUENCE";
-            }
-
-            VCursorRelease ( curs );
-        }
-
-        STATUS ( 4, "SEQUENCE table member name determined to be '%s'", name );
-    }
-
-    return name;
-}
-
-static DbPair_vt cSRAPair_vt =
-{
-    cSRAPairWhack,
-    cSRAPairExplode,
-    cSRAPairGetTblMember
-};
-
-DbPair *cSRAPairMake ( const ctx_t *ctx,
-    const VDatabase *src, VDatabase *dst, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *db;
-
-    TRY ( db = MemAlloc ( ctx, sizeof * db, true ) )
-    {
-        TRY ( DbPairInit ( & db -> dad, ctx, & cSRAPair_vt, src, dst, name, NULL ) )
-        {
-            static const char *exclude_tbls [] =
-            {
-                "EVIDENCE_ALIGNMENT",
-                "PRIMARY_ALIGNMENT",
-                "REFERENCE",
-                "SECONDARY_ALIGNMENT",
-                "SEQUENCE"
-            };
-            db -> dad . exclude_tbls = exclude_tbls;
-
-            return & db -> dad;
-        }
-
-        MemFree ( ctx, db, sizeof * db );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/csra-pair.h b/tools/sra-sort/csra-pair.h
deleted file mode 100644
index a9de62e..0000000
--- a/tools/sra-sort/csra-pair.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_csra_pair_
-#define _h_sra_sort_csra_pair_
-
-#ifndef _h_sra_sort_db_pair_
-#include "db-pair.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct TablePair;
-struct ColumnWriter;
-
-
-/*--------------------------------------------------------------------------
- * cSRAPair
- *  interface to pairing of source and destination tables
- */
-typedef struct cSRAPair cSRAPair;
-struct cSRAPair
-{
-    DbPair dad;
-
-    /* for ultimate metadata */
-    int64_t first_half_aligned_spot;
-    int64_t first_unaligned_spot;
-
-    /* the reference table */
-    struct TablePair *reference;
-
-    /* the alignment tables */
-    struct TablePair *prim_align, *sec_align, *evidence_align;
-
-    /* the sequence table */
-    struct TablePair *sequence;
-
-    /* mapping indices */
-    struct MapFile *pa_idx, *sa_idx, *seq_idx;
-};
-
-
-/* Make
- *  makes an object based upon open source and destination VDatabase objects
- */
-DbPair *cSRAPairMake ( const ctx_t *ctx,
-    struct VDatabase const *src, struct VDatabase *dst, const char *name );
-
-
-/* MakeFirstHalfAlignedRowIdCaptureWriter
- *  a simple monitor on SEQUENCE.PRIMARY_ALIGNMENT_ID looking for
- *  half-aligned spots and capturing the first occurrence.
- */
-struct ColumnWriter *cSRAPairMakeFirstHalfAlignedRowIdCaptureWriter ( cSRAPair *self,
-    const ctx_t *ctx, struct ColumnWriter *writer );
-
-
-#endif /* _h_sra_sort_csra_pair_ */
diff --git a/tools/sra-sort/csra-tbl.c b/tools/sra-sort/csra-tbl.c
deleted file mode 100644
index 3365163..0000000
--- a/tools/sra-sort/csra-tbl.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-struct cSRATblPair;
-#define TBLPAIR_IMPL struct cSRATblPair
-
-#include "csra-tbl.h"
-#include "csra-pair.h"
-#include "ref-alignid-col.h"
-#include "row-set.h"
-#include "id-mapper-col.h"
-#include "buff-writer.h"
-#include "poslen-col-pair.h"
-#include "meta-pair.h"
-#include "map-file.h"
-#include "xcheck.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <vdb/table.h>
-#include <kdb/meta.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( csra-tbl );
-
-
-/*--------------------------------------------------------------------------
- * RefTblPair
- *  generic database object pair
- */
-
-static
-void cSRATblPairWhack ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    RowSetIteratorRelease ( self -> rsi, ctx );
-    TablePairDestroy ( & self -> dad, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-void cSRATblPairDummyStub ( cSRATblPair *self, const ctx_t *ctx )
-{
-}
-
-
-/* REFERENCE table
- */
-static
-ColumnPair *cSRATblPairMakePrimAlignIdColPair ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    cSRAPair *csra = self -> csra;
-
-    ColumnReader *reader;
-    const char *colspec = "(I64)PRIMARY_ALIGNMENT_IDS";
-
-    TRY ( reader = TablePairMakeAlignIdReader ( & self -> dad, ctx,
-              csra -> prim_align, csra -> pa_idx, colspec ) )
-    {
-        ColumnWriter *writer;
-        TRY ( writer = TablePairMakeColumnWriter ( & self -> dad, ctx, NULL, colspec ) )
-        {
-            col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, writer, colspec, false );
-                
-            ColumnWriterRelease ( writer, ctx );
-        }
-
-        ColumnReaderRelease ( reader, ctx );
-    }
-
-    return col;
-}
-
-static
-ColumnPair *cSRATblPairMakeSecAlignIdColPair ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    cSRAPair *csra = self -> csra;
-
-    if ( csra -> sec_align != NULL )
-    {
-        ColumnReader *reader;
-        const char *colspec = "(I64)SECONDARY_ALIGNMENT_IDS";
-
-        TRY ( reader = TablePairMakeAlignIdReader ( & self -> dad, ctx,
-                  csra -> sec_align, csra -> sa_idx, colspec ) )
-        {
-            ColumnWriter *writer;
-            TRY ( writer = TablePairMakeColumnWriter ( & self -> dad, ctx, NULL, colspec ) )
-            {
-                col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, writer, colspec, false );
-                
-                ColumnWriterRelease ( writer, ctx );
-            }
-            
-            ColumnReaderRelease ( reader, ctx );
-        }
-    }
-
-    return col;
-}
-
-static
-void cSRATblPairExplodeRef ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col;
-
-    TRY ( col = cSRATblPairMakePrimAlignIdColPair ( self, ctx ) )
-    {
-        TRY ( TablePairAddColumnPair ( & self -> dad, ctx, col ) )
-        {
-            TRY ( col = cSRATblPairMakeSecAlignIdColPair ( self, ctx ) )
-            {
-                TRY ( TablePairAddColumnPair ( & self -> dad, ctx, col ) )
-                {
-                }
-                CATCH_ALL ()
-                {
-                    ColumnPairRelease ( col, ctx );
-                }
-            }
-        }
-        CATCH_ALL ()
-        {
-            ColumnPairRelease ( col, ctx );
-        }
-    }
-}
-
-static
-ColumnPair *cSRATblPairMakeColumnPairRef ( cSRATblPair *self, const ctx_t *ctx,
-    struct ColumnReader *reader, struct ColumnWriter *writer, const char *colspec, bool large )
-{
-    FUNC_ENTRY ( ctx );
-    return TablePairMakeColumnPair ( & self -> dad, ctx, reader, writer, colspec, large );
-}
-
-static
-RowSetIterator *cSRATblPairGetRowSetIteratorRef ( cSRATblPair *self, const ctx_t *ctx, bool mapping, bool large )
-{
-    FUNC_ENTRY ( ctx );
-    const bool is_paired = false;
-    assert ( mapping == false );
-    return TablePairMakeRowSetIterator ( & self -> dad, ctx, NULL, is_paired, large );
-}
-
-static TablePair_vt cSRATblPair_Ref_vt =
-{
-    cSRATblPairWhack,
-    cSRATblPairDummyStub,
-    cSRATblPairExplodeRef,
-    cSRATblPairMakeColumnPairRef,
-    cSRATblPairDummyStub,
-    cSRATblPairDummyStub,
-    cSRATblPairGetRowSetIteratorRef
-};
-
-
-
-/* *_ALIGNMENT tables
- */
-
-static
-ColumnPair *cSRATblPairMakeSeqSpotIdColPairPrim ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    cSRAPair *csra = self -> csra;
-
-    ColumnReader *reader;
-    const char *colspec = "(I64)SEQ_SPOT_ID";
-
-    /* we expect this column to be present */
-    TRY ( reader = TablePairMakeColumnReader ( & self -> dad, ctx, NULL, colspec, true ) )
-    {
-        ColumnWriter *writer;
-        TRY ( writer = TablePairMakeColumnWriter ( & self -> dad, ctx, NULL, colspec ) )
-        {
-            ColumnWriter *mapped;
-            const bool can_assign_ids = true;
-            TRY ( mapped = TablePairMakeMapRowIdWriter ( & self -> dad, ctx, writer, csra -> seq_idx, can_assign_ids ) )
-            {
-                ColumnWriter *buffered;
-                TRY ( buffered = cSRATblPairMakeBufferedColumnWriter ( self, ctx, mapped ) )
-                {
-                    col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, buffered, colspec, false );
-
-                    ColumnWriterRelease ( buffered, ctx );
-                }
-
-                ColumnWriterRelease ( mapped, ctx );
-            }
-                
-            ColumnWriterRelease ( writer, ctx );
-        }
-
-        ColumnReaderRelease ( reader, ctx );
-    }
-
-    return col;
-}
-
-static
-ColumnPair *cSRATblPairMakeSeqSpotIdColPair ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    cSRAPair *csra = self -> csra;
-
-    ColumnReader *reader;
-    const char *colspec = "(I64)SEQ_SPOT_ID";
-
-    /* we expect this column to be present */
-    TRY ( reader = TablePairMakeColumnReader ( & self -> dad, ctx, NULL, colspec, true ) )
-    {
-        ColumnWriter *writer;
-        TRY ( writer = TablePairMakeColumnWriter ( & self -> dad, ctx, NULL, colspec ) )
-        {
-            ColumnWriter *buffered;
-            /* create a buffered writer with NO id-assignment capabilities. */
-            TRY ( buffered = cSRATblPairMakeBufferedIdRemapColumnWriter ( self, ctx,
-                      writer, csra -> seq_idx, false ) )
-            {
-                col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, buffered, colspec, false );
-
-                ColumnWriterRelease ( buffered, ctx );
-            }
-                
-            ColumnWriterRelease ( writer, ctx );
-        }
-
-        ColumnReaderRelease ( reader, ctx );
-    }
-
-    return col;
-}
-
-static
-ColumnPair *cSRATblPairMakePoslenColPair ( cSRATblPair *self, const ctx_t *ctx, const MapFile *idx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-
-    ColumnReader *reader;
-    const char *colspec = "(U64)GLOBAL_POSLEN";
-
-    /* we expect this column to be present */
-    TRY ( reader = TablePairMakePoslenColReader ( & self -> dad, ctx, idx, colspec ) )
-    {
-        ColumnWriter *writer;
-        TRY ( writer = TablePairMakePoslenColWriter ( & self -> dad, ctx, NULL, colspec ) )
-        {
-            col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, writer, colspec, false );
-                
-            ColumnWriterRelease ( writer, ctx );
-        }
-
-        ColumnReaderRelease ( reader, ctx );
-    }
-
-    return col;
-}
-
-static
-void cSRATblPairPreExplodeAlign ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    cSRAPair *csra = self -> csra;
-
-    switch ( self -> align_idx )
-    {
-    case 1:
-        csra -> pa_idx = MapFileMakeForPoslen ( ctx, csra -> prim_align -> name );
-        break;
-    case 2:
-        csra -> sa_idx = MapFileMakeForPoslen ( ctx, csra -> sec_align -> name );
-        break;
-    }
-}
-
-static
-void cSRATblPairExplodeAlign ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col;
-
-    /* create special case for SEQ_SPOT_ID */
-    switch ( self -> align_idx )
-    {
-    case 1:
-        col = cSRATblPairMakeSeqSpotIdColPairPrim ( self, ctx );
-        break;
-    case 0:
-    case 2:
-    case 3:
-        col = cSRATblPairMakeSeqSpotIdColPair ( self, ctx );
-        break;
-    default:
-        ANNOTATE ( "not going to dignify with an rc - bad align_idx" );
-        return;
-    }
-
-    if ( ! FAILED () )
-    {
-        TRY ( TablePairAddColumnPair ( & self -> dad, ctx, col ) )
-        {
-            cSRAPair *csra = self -> csra;
-
-            switch ( self -> align_idx )
-            {
-            case 1:
-                col = cSRATblPairMakePoslenColPair ( self, ctx, csra -> pa_idx );
-                break;
-            case 2:
-                col = cSRATblPairMakePoslenColPair ( self, ctx, csra -> sa_idx );
-                break;
-            default:
-                return;
-            }
-
-            if ( ! FAILED () )
-            {
-                TRY ( TablePairAddColumnPair ( & self -> dad, ctx, col ) )
-                {
-                    return;
-                }
-            }
-        }
-
-        ColumnPairRelease ( col, ctx );
-    }
-}
-
-static
-ColumnPair *cSRATblPairMakeColumnPairAlign ( cSRATblPair *self, const ctx_t *ctx,
-    struct ColumnReader *reader, struct ColumnWriter *writer, const char *colspec, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    MapFile *idx = NULL;
-    ColumnPair *col = NULL;
-    ColumnWriter *buffered;
-
-    switch ( self -> align_idx )
-    {
-    case 0:
-    case 3:
-        return TablePairMakeColumnPair ( & self -> dad, ctx, reader, writer, colspec, large );
-    case 1:
-    case 2:
-    {
-        /* look for special MATE_ALIGN_ID column */
-        const char *colname = strrchr ( colspec, ')' );
-        if ( colname ++ == NULL )
-            colname = colspec;
-        if ( strcmp ( colname, "MATE_ALIGN_ID" ) == 0 )
-        {
-            cSRAPair *csra = self -> csra;
-            idx = self -> align_idx == 1 ? csra -> pa_idx : csra -> sa_idx;
-        }
-        break;
-    }
-
-    default:
-        ANNOTATE ( "not going to dignify with an rc - bad align_idx" );
-        return NULL;
-    }
-
-    /* create a buffer on writer, possibly with mapping */
-    buffered = ( idx != NULL ) ?
-        /* create a buffered mapping writer but WITHOUT id assignment capabilities */
-        cSRATblPairMakeBufferedIdRemapColumnWriter ( self, ctx, writer, idx, false ):
-        /* create a normal buffered writer */
-        cSRATblPairMakeBufferedColumnWriter ( self, ctx, writer );
-
-    if ( ! FAILED () )
-    {
-        col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, buffered, colspec, large );
-        ColumnWriterRelease ( buffered, ctx );
-    }
-
-    return col;
-}
-
-static
-void cSRATblPairPostCopyAlign ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *csra = self -> csra;
-
-    RowSetIteratorRelease ( self -> rsi, ctx );
-    self -> rsi = NULL;
-
-    if ( self -> align_idx == 2 )
-    {
-        MapFileRelease ( self -> csra -> sa_idx, ctx );
-        self -> csra -> sa_idx = NULL;
-    }
-
-    switch ( self -> align_idx )
-    {
-    case 1:
-        CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> prim_align -> dtbl, "PRIMARY_ALIGNMENT" );
-        break;
-    case 2:
-        CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> sec_align -> dtbl, "SECONDARY_ALIGNMENT" );
-        break;
-    }
-}
-
-static
-RowSetIterator *cSRATblPairGetRowSetIteratorAlign ( cSRATblPair *self, const ctx_t *ctx, bool mapping, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    TRY ( RowSetIteratorRelease ( self -> rsi, ctx ) )
-    {
-        cSRAPair *csra = self -> csra;
-        MapFile *idx = self -> align_idx == 1 ? csra -> pa_idx : csra -> sa_idx;
-        TRY ( self -> rsi = TablePairMakeRowSetIterator ( & self -> dad, ctx, idx, mapping, large ) )
-        {
-            return RowSetIteratorDuplicate ( self -> rsi, ctx );
-        }
-    }
-
-    return NULL;
-}
-
-
-static TablePair_vt cSRATblPair_Align_vt =
-{
-    cSRATblPairWhack,
-    cSRATblPairPreExplodeAlign,
-    cSRATblPairExplodeAlign,
-    cSRATblPairMakeColumnPairAlign,
-    cSRATblPairDummyStub,
-    cSRATblPairPostCopyAlign,
-    cSRATblPairGetRowSetIteratorAlign
-};
-
-
-
-/* SEQUENCE table
- */
-
-static
-ColumnPair *cSRATblPairMakeSeqPrimAlignIdColPair ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    cSRAPair *csra = self -> csra;
-
-
-    ColumnReader *reader;
-    const char *colspec = "(I64)PRIMARY_ALIGNMENT_ID";
-
-    /* this column may not be present if there are no alignments */
-    TRY ( reader = TablePairMakeColumnReader ( & self -> dad, ctx, NULL, colspec, false ) )
-    {
-        if ( reader != NULL )
-        {
-            ColumnWriter *writer;
-            TRY ( writer = TablePairMakeColumnWriter ( & self -> dad, ctx, NULL, colspec ) )
-            {
-                ColumnWriter *capture;
-                TRY ( capture = cSRAPairMakeFirstHalfAlignedRowIdCaptureWriter ( csra, ctx, writer ) )
-                {
-                    ColumnWriter *buffered;
-
-                    /* create a buffered writer WITHOUT id-assignment capabilities. */
-                    TRY ( buffered = cSRATblPairMakeBufferedIdRemapColumnWriter ( self, ctx,
-                              capture, csra -> pa_idx, false ) )
-                    {
-                        col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, buffered, colspec, true );
-
-                        ColumnWriterRelease ( buffered, ctx );
-                    }
-
-                    ColumnWriterRelease ( capture, ctx );
-                }
-                
-                ColumnWriterRelease ( writer, ctx );
-            }
-            
-            ColumnReaderRelease ( reader, ctx );
-        }
-    }
-
-    return col;
-}
-
-static
-void cSRATblPairPreExplodeSeq ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    TRY ( TablePairExplode ( & self -> dad, ctx ) )
-    {
-        cSRAPair *csra = self -> csra;
-        TRY ( csra -> seq_idx = MapFileMake ( ctx, self -> dad . name, true ) )
-        {
-            TRY ( MapFileSetIdRange ( csra -> seq_idx, ctx, self -> dad . first_id,
-                      self -> dad . last_excl - self -> dad . first_id ) )
-            {
-                ColumnPair *col;
-
-                /* create special case for PRIMARY_ALIGNMENT_ID */
-                TRY ( col = cSRATblPairMakeSeqPrimAlignIdColPair ( self, ctx ) )
-                {
-                    TablePairAddColumnPair ( & self -> dad, ctx, col );
-                }
-            }
-        }
-    }
-}
-
-static
-ColumnPair *cSRATblPairMakeColumnPairSeq ( cSRATblPair *self, const ctx_t *ctx,
-    struct ColumnReader *reader, struct ColumnWriter *writer, const char *colspec, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnPair *col = NULL;
-    ColumnWriter *buffered;
-
-    TRY ( buffered = cSRATblPairMakeBufferedColumnWriter ( self, ctx, writer ) )
-    {
-        col = TablePairMakeColumnPair ( & self -> dad, ctx, reader, buffered, colspec, large );
-        ColumnWriterRelease ( buffered, ctx );
-    }
-
-    return col;
-}
-
-static
-void cSRATblPairPreCopySeq ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *csra = self -> csra;
-
-    STATUS ( 3, "assigning new row-ids to unaligned sequences" );
-    csra -> first_unaligned_spot = MapFileAllocMissingNewIds ( self -> csra -> seq_idx, ctx );
-}
-
-static
-void cSRATblPairPostCopySeq ( cSRATblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRAPair *csra = self -> csra;
-
-    RowSetIteratorRelease ( self -> rsi, ctx );
-    self -> rsi = NULL;
-
-    MapFileRelease ( csra -> pa_idx, ctx );
-    csra -> pa_idx = NULL;
-
-    MapFileRelease ( csra -> seq_idx, ctx );
-    csra -> seq_idx = NULL;
-
-    /* record markers in metadata */
-    if ( ! FAILED () && ( csra -> first_half_aligned_spot != 0 || csra -> first_unaligned_spot != 0 ) )
-    {
-        MetaPair *meta = self -> dad . meta;
-        KMDataNode *unaligned_node;
-        const char *node_path = "unaligned";
-        rc_t rc = KMetadataOpenNodeUpdate ( meta -> dmeta, & unaligned_node, node_path );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "KMetadataOpenNodeUpdate failed to open '%s'", node_path );
-        else
-        {
-            KMDataNode *node;
-            if ( csra -> first_half_aligned_spot != 0 )
-            {
-                node_path = "first-half-aligned";
-                rc = KMDataNodeOpenNodeUpdate ( unaligned_node, & node, node_path );
-                if ( rc != 0 )
-                    INTERNAL_ERROR ( rc, "KMDataNodeOpenNodeUpdate failed to open 'unaligned/%s'", node_path );
-                else
-                {
-                    rc = KMDataNodeWriteB64 ( node, & csra -> first_half_aligned_spot );
-                    if ( rc != 0 )
-                        INTERNAL_ERROR ( rc, "KMDataNodeWriteB64 failed to write 'unaligned/%s'", node_path );
-
-                    KMDataNodeRelease ( node );
-                }
-            }
-
-            if ( ! FAILED () && csra -> first_unaligned_spot != 0 )
-            {
-                node_path = "first-unaligned";
-                rc = KMDataNodeOpenNodeUpdate ( unaligned_node, & node, node_path );
-                if ( rc != 0 )
-                    INTERNAL_ERROR ( rc, "KMDataNodeOpenNodeUpdate failed to open 'unaligned/%s'", node_path );
-                else
-                {
-                    rc = KMDataNodeWriteB64 ( node, & csra -> first_unaligned_spot );
-                    if ( rc != 0 )
-                        INTERNAL_ERROR ( rc, "KMDataNodeWriteB64 failed to write 'unaligned/%s'", node_path );
-
-                    KMDataNodeRelease ( node );
-                }
-            }
-
-            KMDataNodeRelease ( unaligned_node );
-        }
-    }
-}
-
-static
-RowSetIterator *cSRATblPairGetRowSetIteratorSeq ( cSRATblPair *self, const ctx_t *ctx, bool mapping, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    TRY ( RowSetIteratorRelease ( self -> rsi, ctx ) )
-    {
-        cSRAPair *csra = self -> csra;
-        TRY ( self -> rsi = TablePairMakeRowSetIterator ( & self -> dad, ctx, csra -> seq_idx, mapping, large ) )
-        {
-            return RowSetIteratorDuplicate ( self -> rsi, ctx );
-        }
-    }
-
-    return NULL;
-}
-
-static TablePair_vt cSRATblPair_Seq_vt =
-{
-    cSRATblPairWhack,
-    cSRATblPairPreExplodeSeq,
-    cSRATblPairDummyStub,
-    cSRATblPairMakeColumnPairSeq,
-    cSRATblPairPreCopySeq,
-    cSRATblPairPostCopySeq,
-    cSRATblPairGetRowSetIteratorSeq
-};
-
-
-
-/* Init
- *  common initialization code
- */
-static
-void cSRATblPairInit ( void *self, cSRATblPair *tbl )
-{
-    tbl -> csra = self;
-    tbl -> rsi = NULL;
-    tbl -> align_idx = 0;
-}
-
-
-/* MakeRef
- *  special cased for REFERENCE table
- */
-TablePair *cSRATblPairMakeRef ( DbPair *self, const ctx_t *ctx,
-    const VTable *src, VTable *dst, const char *name, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRATblPair *tbl;
-
-    TRY ( tbl = MemAlloc ( ctx, sizeof * tbl, false ) )
-    {
-        TRY ( TablePairInit ( & tbl -> dad, ctx, & cSRATblPair_Ref_vt, src, dst, name, self -> full_spec, reorder ) )
-        {
-            static const char *exclude_cols [] = { "PRIMARY_ALIGNMENT_IDS", "SECONDARY_ALIGNMENT_IDS", "READ", "SPOT_GROUP", NULL };
-            static const char *nonstatic_cols [] = { "NAME", NULL };
-            tbl -> dad . exclude_col_names = exclude_cols;
-            tbl -> dad . nonstatic_col_names = nonstatic_cols;
-            cSRATblPairInit ( self, tbl );
-            return & tbl -> dad;
-        }
-
-        MemFree ( ctx, tbl, sizeof * tbl );
-    }
-
-    return NULL;
-}
-
-
-/* MakeAlign
- *  special cased for *_ALIGNMENT tables
- */
-TablePair *cSRATblPairMakeAlign ( DbPair *self, const ctx_t *ctx,
-    const VTable *src, VTable *dst, const char *name, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRATblPair *tbl;
-
-    TRY ( tbl = MemAlloc ( ctx, sizeof * tbl, false ) )
-    {
-        TRY ( TablePairInit ( & tbl -> dad, ctx, & cSRATblPair_Align_vt, src, dst, name, self -> full_spec, reorder ) )
-        {
-            static const char *exclude_cols [] = { "GLOBAL_REF_START", "READ_LEN", "REF_ID", "REF_START", "REF_LEN", "SEQ_SPOT_ID", NULL };
-            static const char *unsorted_exclude_cols [] = { "READ_LEN", "SEQ_SPOT_ID", NULL };
-            tbl -> dad . exclude_col_names = reorder ? exclude_cols : unsorted_exclude_cols;
-            cSRATblPairInit ( self, tbl );
-            return & tbl -> dad;
-        }
-
-        MemFree ( ctx, tbl, sizeof * tbl );
-    }
-
-    return NULL;
-}
-
-
-/* MakeSeq
- *  special cased for SEQUENCE table
- */
-TablePair *cSRATblPairMakeSeq ( DbPair *self, const ctx_t *ctx,
-    const VTable *src, VTable *dst, const char *name, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-
-    cSRATblPair *tbl;
-
-    TRY ( tbl = MemAlloc ( ctx, sizeof * tbl, false ) )
-    {
-        TRY ( TablePairInit ( & tbl -> dad, ctx, & cSRATblPair_Seq_vt, src, dst, name, self -> full_spec, reorder ) )
-        {
-            static const char *exclude_cols [] = { "PRIMARY_ALIGNMENT_ID", NULL };
-            static const char *nonstatic_cols [] = { "NAME_FMT", NULL };
-            static const char *large_cols [] = { "CMP_READ", "QUALITY", NULL };
-            static const char *exclude_meta [] = { "unaligned", NULL };
-            tbl -> dad . exclude_col_names = exclude_cols;
-            tbl -> dad . nonstatic_col_names = nonstatic_cols;
-            tbl -> dad . large_col_names = large_cols;
-            tbl -> dad . exclude_meta = exclude_meta;
-            cSRATblPairInit ( self, tbl );
-            return & tbl -> dad;
-        }
-
-        MemFree ( ctx, tbl, sizeof * tbl );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/csra-tbl.h b/tools/sra-sort/csra-tbl.h
deleted file mode 100644
index 7eae0b2..0000000
--- a/tools/sra-sort/csra-tbl.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_csra_tbl_
-#define _h_sra_sort_csra_tbl_
-
-#ifndef _h_sra_sort_tbl_pair_
-#include "tbl-pair.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct cSRAPair;
-struct RowSetIterator;
-
-
-/*--------------------------------------------------------------------------
- * cSRATblPair
- *  interface to pairing of source and destination tables
- */
-typedef struct cSRATblPair cSRATblPair;
-struct cSRATblPair
-{
-    TablePair dad;
-
-    /* database */
-    struct cSRAPair *csra;
-
-    /* special rowset iterator */
-    struct RowSetIterator *rsi;
-
-    /* if an alignment table, which one? */
-    uint32_t align_idx;
-};
-
-
-/* MakeRef
- *  special cased for REFERENCE table
- */
-TablePair *cSRATblPairMakeRef ( struct DbPair *self, const ctx_t *ctx,
-    struct VTable const *src, struct VTable *dst, const char *name, bool reorder );
-
-
-/* MakeAlign
- *  special cased for *_ALIGNMENT tables
- */
-TablePair *cSRATblPairMakeAlign ( struct DbPair *self, const ctx_t *ctx,
-    struct VTable const *src, struct VTable *dst, const char *name, bool reorder );
-
-
-/* MakeSeq
- *  special cased for SEQUENCE table
- */
-TablePair *cSRATblPairMakeSeq ( struct DbPair *self, const ctx_t *ctx,
-    struct VTable const *src, struct VTable *dst, const char *name, bool reorder );
-
-
-#endif /* _h_sra_sort_csra_tbl_ */
diff --git a/tools/sra-sort/ctx.h b/tools/sra-sort/ctx.h
deleted file mode 100644
index cfd4275..0000000
--- a/tools/sra-sort/ctx.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_ctx_
-#define _h_sra_sort_ctx_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct Caps;
-
-
-/*--------------------------------------------------------------------------
- * file entry
- *  modified from vdb-3 to not place requirements on Makefile
- */
-#if ! defined __mod__ && ! defined __file__
-#define FILE_ENTRY( __file_name__ )                                     \
-    static const char __mod__ [] = "tools/sra-sort";                    \
-    static const char __file__ [] = STRINGIZE_DEFINE ( __file_name__ )
-#else
-#define FILE_ENTRY( __file_name__ ) /* already defined */
-#endif
-
-
-/*--------------------------------------------------------------------------
- * ctx_info_t
- */
-typedef struct ctx_info_t ctx_info_t;
-struct ctx_info_t
-{
-    const char *mod;
-    const char *file;
-    const char *func;
-};
-
-#define DECLARE_CTX_INFO() \
-    static ctx_info_t ctx_info = { __mod__, __file__, __func__ }
-
-
-/*--------------------------------------------------------------------------
- * ctx_t
- *  modified from vdb-3
- */
-struct ctx_t
-{
-    struct Caps const *caps;
-    const ctx_t *caller;
-    const ctx_info_t *info;
-    volatile rc_t rc;
-};
-
-
-/* INIT
- *  initialize local context block
- */
-static __inline__
-const ctx_t ctx_init ( ctx_t *new_ctx, const ctx_t **ctxp, const ctx_info_t *info )
-{
-    const ctx_t *ctx = * ctxp;
-    ctx_t local_ctx = { ctx -> caps, ctx, info };
-    * ctxp = new_ctx;
-    return local_ctx;
-}
-
-
-/* FUNC_ENTRY
- */
-#define FUNC_ENTRY( ctx )                                               \
-    DECLARE_CTX_INFO ();                                                \
-    ctx_t local_ctx = ctx_init ( & local_ctx, & ( ctx ), & ctx_info )
-
-
-/* POP_CTX
- *  intended to have VERY specific usage
- */
-#define POP_CTX( ctx ) \
-    ctx = ctx -> caller
-
-
-#endif
diff --git a/tools/sra-sort/db-pair.c b/tools/sra-sort/db-pair.c
deleted file mode 100644
index b350da1..0000000
--- a/tools/sra-sort/db-pair.c
+++ /dev/null
@@ -1,883 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct DbPair StdDbPair;
-#define DBPAIR_IMPL StdDbPair
-
-#include "db-pair.h"
-#include "csra-pair.h"
-#include "tbl-pair.h"
-#include "dir-pair.h"
-#include "meta-pair.h"
-#include "sra-sort.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/database.h>
-#include <kdb/meta.h>
-#include <kdb/kdb-priv.h>
-#include <kfs/directory.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( db-pair );
-
-
-/*--------------------------------------------------------------------------
- * StdDbPair
- *  generic database object pair
- */
-
-static
-void StdDbPairWhack ( StdDbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    DbPairDestroy ( self, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-void StdDbPairExplode ( StdDbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-}
-
-static
-const char *StdDbPairGetTblMember ( const StdDbPair *self, const ctx_t *ctx, const VTable *src, const char *name )
-{
-    return name;
-}
-
-static DbPair_vt StdDbPair_vt =
-{
-    StdDbPairWhack,
-    StdDbPairExplode,
-    StdDbPairGetTblMember
-};
-
-static
-DbPair *StdDbPairMake ( const ctx_t *ctx,
-    const VDatabase *src, VDatabase *dst, const char *name, const char *opt_full_spec )
-{
-    FUNC_ENTRY ( ctx );
-
-    StdDbPair *db;
-
-    TRY ( db = MemAlloc ( ctx, sizeof * db, false ) )
-    {
-        TRY ( DbPairInit ( db, ctx, & StdDbPair_vt, src, dst, name, opt_full_spec ) )
-        {
-            return db;
-        }
-
-        MemFree ( ctx, db, sizeof * db );
-    }
-
-    return NULL;
-}
-
-/*--------------------------------------------------------------------------
- * DbPair
- *  interface code
- */
-
-
-/* Make
- *  makes an object based upon open source and destination VDatabase objects
- */
-static
-bool is_csra_db ( const VDatabase *src, const ctx_t *ctx )
-{
-    /* TBD - hack'o-matic */
-    return true;
-}
-
-DbPair *DbPairMake ( const ctx_t *ctx,
-    const VDatabase *src, VDatabase *dst, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* intercept certain types of databases - right now cSRA */
-    if ( is_csra_db ( src, ctx ) )
-        return cSRAPairMake ( ctx, src, dst, name );
-
-    return StdDbPairMake ( ctx, src, dst, name, NULL );
-}
-
-DbPair *DbPairMakeStdDbPair ( DbPair *self, const ctx_t *ctx,
-    const VDatabase *src, VDatabase *dst, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-    return StdDbPairMake ( ctx, src, dst, name, self -> full_spec );
-}
-
-
-/* Release
- */
-void DbPairRelease ( DbPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "DbPair" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcDatabase, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release DbPair" );
-        }
-    }
-}
-
-/* Duplicate
- */
-DbPair *DbPairDuplicate ( DbPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "DbPair" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcDatabase, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate DbPair" );
-            return NULL;
-        }
-    }
-
-    return ( DbPair* ) self;
-}
-
-
-/* Copy
- */
-static
-bool CC DbPairCopyDbPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TRY ( DbPairCopy ( item, ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-static
-bool CC DbPairCopyTablePair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TRY ( TablePairCopy ( item, ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-static
-bool CC DbPairCopyDirPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TRY ( DirPairCopy ( item, ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-void DbPairCopy ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    STATUS ( 2, "copying database '%s'", self -> full_spec );
-
-    /* copy metadata */
-    MetaPairCopy ( self -> meta, ctx, self -> full_spec, self -> exclude_meta );
-
-    /* copy all child databases */
-    if ( ! FAILED () && VectorLength ( & self -> dbs ) != 0 )
-    {
-        STATUS ( 2, "copying '%s' sub-databases", self -> full_spec );
-        VectorDoUntil ( & self -> dbs, false, DbPairCopyDbPair, ( void* ) ctx );
-    }
-
-    /* now we should be able to copy each table */
-    if ( ! FAILED () && VectorLength ( & self -> tbls ) != 0 )
-    {
-        STATUS ( 2, "copying '%s' tables", self -> full_spec );
-        VectorDoUntil ( & self -> tbls, false, DbPairCopyTablePair, ( void* ) ctx );
-    }
-
-    /* copy any directories - extra */
-    if ( ! FAILED () && VectorLength ( & self -> dirs ) != 0 )
-    {
-        STATUS ( 2, "copying '%s' directories", self -> full_spec );
-        VectorDoUntil ( & self -> dirs, false, DbPairCopyDirPair, ( void* ) ctx );
-    }
-}
-
-
-/* Explode
- *  probably a bad name, but it is intended to mean
- *  register all enclosed tables and databases
- *  and create a proper pair of KMetadata
- */
-static
-MetaPair *DbPairExplodeMetaPair ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    MetaPair *meta = NULL;
-    const KMetadata *smeta;
-
-    rc = VDatabaseOpenMetadataRead ( self -> sdb, & smeta );
-    if ( rc != 0 )
-        ERROR ( rc, "VDatabaseOpenMetadataRead failed on 'src.%s'", self -> full_spec );
-    else
-    {
-        KMetadata *dmeta;
-        rc = VDatabaseOpenMetadataUpdate ( self -> ddb, & dmeta );
-        if ( rc != 0 )
-            ERROR ( rc, "VDatabaseOpenMetadataUpdate failed on 'dst.%s'", self -> full_spec );
-        else
-        {
-            meta = MetaPairMake ( ctx, smeta, dmeta, self -> full_spec );
-
-            KMetadataRelease ( dmeta );
-        }
-        
-        KMetadataRelease ( smeta );
-    }
-
-    return meta;
-}
-
-static
-void DbPairExplode ( DbPair *self, const ctx_t *ctx );
-
-static
-bool CC DbPairExplodeDbPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TRY ( DbPairExplode ( item, ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-static
-bool CC DbPairPreExplodeTablePair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TRY ( TablePairPreExplode ( ( ( TablePair* ) item ), ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-static
-void DbPairDefaultExplodeDB ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    KNamelist *names;
-
-    rc = VDatabaseListDB ( self -> sdb, & names );
-    if ( rc != 0 )
-        ERROR ( rc, "VDatabaseListDB failed listing '%s' databases", self -> full_spec );
-    else
-    {
-        uint32_t count;
-        rc = KNamelistCount ( names, & count );
-        if ( rc != 0 )
-            ERROR ( rc, "KNamelistCount failed listing '%s' databases", self -> full_spec );
-        else if ( count > 0 )
-        {
-            uint32_t i;
-            for ( i = 0; ! FAILED () && i < count; ++ i )
-            {
-                DbPair *db;
-
-                const char *name;
-                rc = KNamelistGet ( names, i, & name );
-                if ( rc != 0 )
-                {
-                    ERROR ( rc, "KNamelistGet ( %u ) failed listing '%s' databases", i, self -> full_spec );
-                    break;
-                }
-
-                if ( self -> exclude_dbs != NULL )
-                {
-                    uint32_t j;
-                    for ( j = 0; self -> exclude_dbs [ j ] != NULL; ++ j )
-                    {
-                        if ( strcmp ( name, self -> exclude_dbs [ j ] ) == 0 )
-                        {
-                            name = NULL;
-                            break;
-                        }
-                    }
-                    if ( name == NULL )
-                        continue;
-                }
-
-                TRY ( db = DbPairMakeDbPair ( self, ctx, name, name, true, DbPairMakeStdDbPair ) )
-                {
-                    ON_FAIL ( DbPairAddDbPair ( self, ctx, db ) )
-                    {
-                        DbPairRelease ( db, ctx );
-                    }
-                }
-            }
-        }
-
-        KNamelistRelease ( names );
-    }
-}
-
-static
-void DbPairDefaultExplodeTbl ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    KNamelist *names;
-
-    rc = VDatabaseListTbl ( self -> sdb, & names );
-    if ( rc != 0 )
-        ERROR ( rc, "VDatabaseListTbl failed listing '%s' tables", self -> full_spec );
-    else
-    {
-        uint32_t count;
-        rc = KNamelistCount ( names, & count );
-        if ( rc != 0 )
-            ERROR ( rc, "KNamelistCount failed listing '%s' tables", self -> full_spec );
-        else if ( count > 0 )
-        {
-            uint32_t i;
-            for ( i = 0; ! FAILED () && i < count; ++ i )
-            {
-                TablePair *tbl;
-
-                const char *name;
-                rc = KNamelistGet ( names, i, & name );
-                if ( rc != 0 )
-                {
-                    ERROR ( rc, "KNamelistGet ( %u ) failed listing '%s' tables", i, self -> full_spec );
-                    break;
-                }
-
-                if ( self -> exclude_tbls != NULL )
-                {
-                    uint32_t j;
-                    for ( j = 0; self -> exclude_tbls [ j ] != NULL; ++ j )
-                    {
-                        if ( strcmp ( name, self -> exclude_tbls [ j ] ) == 0 )
-                        {
-                            name = NULL;
-                            break;
-                        }
-                    }
-                    if ( name == NULL )
-                        continue;
-                }
-
-                TRY ( tbl = DbPairMakeTablePair ( self, ctx, name, name, true, false, DbPairMakeStdTblPair ) )
-                {
-                    ON_FAIL ( DbPairAddTablePair ( self, ctx, tbl ) )
-                    {
-                        TablePairRelease ( tbl, ctx );
-                    }
-                }
-            }
-        }
-
-        KNamelistRelease ( names );
-    }
-}
-
-static
-void DbPairDefaultExplode ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-#if 0
-    TRY ( DbPairDefaultExplodeDB ( self, ctx ) )
-#endif
-    {
-        DbPairDefaultExplodeTbl ( self, ctx );
-    }
-}
-
-static
-void DbPairExplode ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    STATUS ( 2, "exploding database '%s'", self -> full_spec );
-
-    /* first, ask subclass to perform explicit explode */
-    if ( self == NULL )
-    {
-        rc_t rc = RC ( rcExe, rcDatabase, rcAccessing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad DbPair" );
-    }
-    else
-    {
-        TRY ( ( * self -> vt -> explode ) ( self, ctx ) )
-        {
-            /* next, perform default self-explode for all dbs, tbls not excluded */
-            TRY ( DbPairDefaultExplode ( self, ctx ) )
-            {
-                /* now create metadata pair */
-                if ( self -> meta == NULL )
-                    self -> meta = DbPairExplodeMetaPair ( self, ctx );
-                if ( ! FAILED () )
-                {
-                    /* now explode all child dbs, tbls */
-                    TRY ( VectorDoUntil ( & self -> dbs, false, DbPairExplodeDbPair, ( void* ) ctx ) )
-                    {
-                        VectorDoUntil ( & self -> tbls, false, DbPairPreExplodeTablePair, ( void* ) ctx );
-                    }
-                }
-            }
-        }
-    }
-}
-
-
-/* Run
- */
-void DbPairRun ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    const Tool *tp = ctx -> caps -> tool;
-
-    STATUS ( 1, "input database is '%s'", tp -> src_path );
-    STATUS ( 1, "output database is '%s'", tp -> dst_path );
-
-    /* the first thing to do is to explode the database
-       to create sub-dbs, sub-tables, and metadata */
-    TRY ( DbPairExplode ( self, ctx ) )
-    {
-        /* now copy */
-        DbPairCopy ( self, ctx );
-    }
-
-    if ( FAILED () )
-        STATUS ( 1, "failed processing database '%s'", self -> full_spec );
-    else
-        STATUS ( 1, "finished processing database '%s'", self -> full_spec );
-}
-
-
-/* MakeDbPair
- */
-DbPair *DbPairMakeDbPair ( DbPair *self, const ctx_t *ctx, const char *member, const char *name, bool required,
-    DbPair* ( * make ) ( DbPair *self, const ctx_t *ctx, const VDatabase *src, VDatabase *dst, const char *name ) )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const VDatabase *src;
-    DbPair *db = NULL;
-                
-    STATUS ( 4, "creating db pair '%s.%s'", self -> full_spec, name );
-    rc = VDatabaseOpenDBRead ( self -> sdb, & src, name );
-    if ( rc != 0 )
-    {
-        if ( required )
-            ERROR ( rc, "VDatabaseOpenDBRead: failed to open db '%s.%s'", self -> full_spec, name );
-        else
-            STATUS ( 4, "optional db '%s.%s' was not opened", self -> full_spec, name );
-    }
-    else
-    {
-#if 0
-        if ( member == NULL )
-            member = DbPairGetTblMember ( self, ctx, src, name );
-#endif
-
-        if ( ! FAILED () )
-        {
-            VDatabase *dst;
-            const Tool *tp = ctx -> caps -> tool;
-            rc = VDatabaseCreateDB ( self -> ddb, & dst, member, kcmOpen | ( tp -> db . cmode & kcmMD5 ), name );
-            if ( rc != 0 )
-                ERROR ( rc, "VDatabaseCreateDB: failed to create %s db '%s.%s'", member, self -> full_spec, name );
-            else
-            {
-                db = ( * make ) ( self, ctx, src, dst, name );
-
-                VDatabaseRelease ( dst );
-            }
-        }
-
-        VDatabaseRelease ( src );
-    }
-
-    return db;
-}
-
-
-/* MakeTablePair
- */
-TablePair *DbPairMakeTablePair ( DbPair *self, const ctx_t *ctx, const char *member, const char *name, bool required, bool reorder,
-    TablePair* ( * make ) ( DbPair *self, const ctx_t *ctx, const VTable *src, VTable *dst, const char *name, bool reorder ) )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const VTable *src;
-    TablePair *tbl = NULL;
-                
-    STATUS ( 4, "creating table pair '%s.%s'", self -> full_spec, name );
-    rc = VDatabaseOpenTableRead ( self -> sdb, & src, name );
-    if ( rc != 0 )
-    {
-        if ( required )
-            ERROR ( rc, "VDatabaseOpenTableRead: failed to open table '%s.%s'", self -> full_spec, name );
-        else
-            STATUS ( 4, "optional table '%s.%s' was not opened", self -> full_spec, name );
-    }
-    else
-    {
-        if ( member == NULL )
-            member = DbPairGetTblMember ( self, ctx, src, name );
-
-        if ( ! FAILED () )
-        {
-            VTable *dst;
-            const Tool *tp = ctx -> caps -> tool;
-            rc = VDatabaseCreateTable ( self -> ddb, & dst, member, kcmOpen | ( tp -> db . cmode & kcmMD5 ), name );
-            if ( rc != 0 )
-                ERROR ( rc, "VDatabaseCreateTable: failed to create %s table '%s.%s'", member, self -> full_spec, name );
-            else
-            {
-                tbl = ( * make ) ( self, ctx, src, dst, name, reorder );
-
-                VTableRelease ( dst );
-            }
-        }
-
-        VTableRelease ( src );
-    }
-
-    return tbl;
-}
-
-
-/* AddDbPair
- *  called from implementations
- */
-void DbPairAddDbPair ( DbPair *self, const ctx_t *ctx, DbPair *db )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    STATUS ( 4, "adding db pair '%s'", db -> full_spec );
-    rc = VectorAppend ( & self -> dbs, NULL, ( const void* ) db );
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "failed to add db pair '%s'", db -> full_spec );
-}
-
-
-/* AddTablePair
- *  called from implementations
- */
-void DbPairAddTablePair ( DbPair *self, const ctx_t *ctx, TablePair *tbl )
-{
-    if ( tbl != NULL )
-    {
-        FUNC_ENTRY ( ctx );
-
-        rc_t rc;
-
-        STATUS ( 4, "adding table pair '%s'", tbl -> full_spec );
-        rc = VectorAppend ( & self -> tbls, NULL, ( const void* ) tbl );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "failed to add table pair '%s'", tbl -> full_spec );
-    }
-}
-
-
-/* MakeDirPair
- */
-DirPair *DbPairMakeDirPair ( DbPair *self, const ctx_t *ctx, const char *name, bool required,
-    DirPair* ( * make ) ( DbPair *self, const ctx_t *ctx, const KDirectory *src, KDirectory *dst, const char *name ) )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    DirPair *dir = NULL;
-    const KDatabase *sdb;
-                
-    STATUS ( 4, "creating directory pair '%s./%s'", self -> full_spec, name );
-
-    rc = VDatabaseOpenKDatabaseRead ( self -> sdb, & sdb );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VDatabaseOpenKDatabaseRead: failed to access KDatabase 'src.%s'", self -> full_spec );
-    else
-    {
-        KDatabase *ddb;
-        rc = VDatabaseOpenKDatabaseUpdate ( self -> ddb, & ddb );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VDatabaseOpenKDatabaseUpdate: failed to access KDatabase 'dst.%s'", self -> full_spec );
-        else
-        {
-            const KDirectory *sdir;
-            rc = KDatabaseOpenDirectoryRead ( sdb, & sdir );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "KDatabaseOpenDirectoryRead: failed to access KDirectory 'src.%s'", self -> full_spec );
-            else
-            {
-                KDirectory *ddir;
-                rc = KDatabaseOpenDirectoryUpdate ( ddb, & ddir );
-                if ( rc != 0 )
-                    INTERNAL_ERROR ( rc, "KDatabaseOpenDirectoryUpdate: failed to access KDirectory 'dst.%s'", self -> full_spec );
-                else
-                {
-                    switch ( KDirectoryPathType ( sdir, name ) )
-                    {
-                    case kptNotFound:
-                        if ( required )
-                        {
-                            rc = RC ( rcExe, rcDirectory, rcOpening, rcPath, rcNotFound );
-                            ERROR ( rc, "required directory 'src.%s./%s' does not exist", self -> full_spec, name );
-                        }
-                        break;
-
-                    case kptBadPath:
-                        rc = RC ( rcExe, rcDirectory, rcOpening, rcPath, rcInvalid );
-                        INTERNAL_ERROR ( rc, "directory path 'src.%s./%s' is invalid", self -> full_spec, name );
-                        break;
-
-                    case kptDir:
-                    case kptDir | kptAlias:
-                    {
-                        dir = ( * make ) ( self, ctx, sdir, ddir, name );
-                        break;
-                    }
-
-                    default:
-                        rc = RC ( rcExe, rcDirectory, rcOpening, rcPath, rcIncorrect );
-                        INTERNAL_ERROR ( rc, "directory path 'src.%s./%s' is not a directory", self -> full_spec, name );
-                    }
-
-                    KDirectoryRelease ( ddir );
-                }
-
-                KDirectoryRelease ( sdir );
-            }
-
-            KDatabaseRelease ( ddb );
-        }
-
-        KDatabaseRelease ( sdb );
-    }
-
-    return dir;
-}
-
-
-/* AddDirPair
- *  called from implementations
- */
-void DbPairAddDirPair ( DbPair *self, const ctx_t *ctx, struct DirPair *dir )
-{
-    if ( dir != NULL )
-    {
-        FUNC_ENTRY ( ctx );
-
-        rc_t rc;
-
-        STATUS ( 4, "adding directory pair '%s'", dir -> full_spec );
-        rc = VectorAppend ( & self -> dirs, NULL, ( const void* ) dir );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "failed to add directory pair '%s'", dir -> full_spec );
-    }
-}
-
-
-/* Init
- */
-void DbPairInit ( DbPair *self, const ctx_t *ctx, const DbPair_vt *vt,
-    const VDatabase *src, VDatabase *dst, const char *name, const char *opt_full_spec )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcDatabase, rcConstructing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad DbPair" );
-        return;
-    }
-
-    memset ( self, 0, sizeof * self );
-    self -> vt = vt;
-    VectorInit ( & self -> dbs, 0, 4 );
-    VectorInit ( & self -> tbls, 0, 8 );
-    VectorInit ( & self -> dirs, 0, 8 );
-
-    if ( opt_full_spec == NULL )
-        opt_full_spec = "";
-
-    rc = VDatabaseAddRef ( self -> sdb = src );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to duplicate db 'src.%s%s%s'", opt_full_spec, opt_full_spec [ 0 ] ? "." : "", name );
-    else
-    {
-        rc = VDatabaseAddRef ( self -> ddb = dst );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to duplicate db 'dst.%s%s%s'", opt_full_spec, opt_full_spec [ 0 ] ? "." : "", name );
-        else
-        {
-            char *full_spec;
-
-            self -> full_spec_size = string_size ( opt_full_spec ) + string_size ( name );
-            if ( opt_full_spec [ 0 ] != 0  )
-                ++ self -> full_spec_size;
-
-            TRY ( full_spec = MemAlloc ( ctx, self -> full_spec_size + 1, false ) )
-            {
-                if ( opt_full_spec [ 0 ] != 0 )
-                    rc = string_printf ( full_spec, self -> full_spec_size + 1, NULL, "%s.%s", opt_full_spec, name );
-                else
-                    strcpy ( full_spec, name );
-                if ( rc != 0 )
-                    ABORT ( rc, "miscalculated string size" );
-                else
-                {
-                    static const char *no_exclude [] = { NULL };
-
-                    self -> full_spec = full_spec;
-                    self -> name = full_spec;
-                    if ( opt_full_spec [ 0 ] != 0 )
-                        self -> name += string_size ( opt_full_spec ) + 1;
-
-                    self -> exclude_dbs = no_exclude;
-                    self -> exclude_tbls = no_exclude;
-                    self -> exclude_meta = no_exclude;
-
-                    KRefcountInit ( & self -> refcount, 1, "DbPair", "init", name );
-                    return;
-                }
-            }
-
-            VDatabaseRelease ( self -> ddb );
-            self -> ddb = NULL;
-        }
-
-        VDatabaseRelease ( self -> sdb );
-        self -> sdb = NULL;
-    }
-}
-
-/* Destroy
- *  destroys superclass items
- */
-static
-void CC DbPairReleaseDbPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    DbPairRelease ( item, ctx );
-}
-
-static
-void CC DbPairReleaseTablePair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    TablePairRelease ( item, ctx );
-}
-
-static
-void CC DbPairReleaseDirPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    DirPairRelease ( item, ctx );
-}
-
-void DbPairDestroy ( DbPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    VectorWhack ( & self -> dbs, DbPairReleaseDbPair, ( void* ) ctx );
-    VectorWhack ( & self -> tbls, DbPairReleaseTablePair, ( void* ) ctx );
-    VectorWhack ( & self -> dirs, DbPairReleaseDirPair, ( void* ) ctx );
-
-    MetaPairRelease ( self -> meta, ctx );
-
-    rc = VDatabaseRelease ( self -> ddb );
-    if ( rc != 0 )
-        WARN ( "VDatabaseRelease failed on 'dst.%s'", self -> full_spec );
-    VDatabaseRelease ( self -> sdb );
-
-    MemFree ( ctx, ( void* ) self -> full_spec, self -> full_spec_size + 1 );
-
-    memset ( self, 0, sizeof * self );
-}
diff --git a/tools/sra-sort/db-pair.h b/tools/sra-sort/db-pair.h
deleted file mode 100644
index 94bf817..0000000
--- a/tools/sra-sort/db-pair.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_db_pair_
-#define _h_sra_sort_db_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KDirectory;
-struct VTable;
-struct VDatabase;
-struct TablePair;
-struct MetaPair;
-struct DirPair;
-
-
-/*--------------------------------------------------------------------------
- * DbPair
- *  interface to pairing of source and destination tables
- */
-typedef struct DbPair_vt DbPair_vt;
-
-typedef struct DbPair DbPair;
-struct DbPair
-{
-    /* polymorphic */
-    const DbPair_vt *vt;
-
-    /* the pair of VDatabases */
-    struct VDatabase const *sdb;
-    struct VDatabase *ddb;
-
-    /* the set of enclosed DbPairs */
-    Vector dbs;
-
-    /* the set of TablePairs */
-    Vector tbls;
-
-    /* the set of DirPairs */
-    Vector dirs;
-
-    /* the pair of KMetadata */
-    struct MetaPair *meta;
-
-    /* exclusions */
-    const char **exclude_dbs;
-    const char **exclude_tbls;
-    const char **exclude_meta;
-
-    /* simple db name */
-    const char *name;
-
-    /* full db spec */
-    size_t full_spec_size;
-    const char *full_spec;
-
-    /* reference counting */
-    KRefcount refcount;
-    uint32_t align;
-};
-
-#ifndef DBPAIR_IMPL
-#define DBPAIR_IMPL DbPair
-#endif
-
-struct DbPair_vt
-{
-    void ( * whack ) ( DBPAIR_IMPL *self, const ctx_t *ctx );
-    void ( * explode ) ( DBPAIR_IMPL *self, const ctx_t *ctx );
-    const char* ( * get_tbl_mbr ) ( const DBPAIR_IMPL *self, const ctx_t *ctx,
-        struct VTable const *src, const char *name );
-};
-
-
-/* Make
- *  makes an object based upon open source and destination VDatabase objects
- */
-DbPair *DbPairMake ( const ctx_t *ctx,
-    struct VDatabase const *src, struct VDatabase *dst, const char *name );
-
-
-/* Release
- */
-void DbPairRelease ( DbPair *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-DbPair *DbPairDuplicate ( DbPair *self, const ctx_t *ctx );
-
-
-/* Copy
- *  copy from source to destination
- */
-void DbPairCopy ( DbPair *self, const ctx_t *ctx );
-
-
-/* Run
- */
-void DbPairRun ( DbPair *self, const ctx_t *ctx );
-
-
-/* MakeDbPair
- */
-DbPair *DbPairMakeDbPair ( DbPair *self, const ctx_t *ctx, const char *member, const char *name, bool required,
-    DbPair* ( * make ) ( DbPair *self, const ctx_t *ctx,
-        struct VDatabase const *src, struct VDatabase *dst, const char *name )
-     );
-
-DbPair *DbPairMakeStdDbPair ( struct DbPair *self, const ctx_t *ctx,
-    struct VDatabase const *src, struct VDatabase *dst, const char *name );
-
-
-/* MakeTablePair
- */
-struct TablePair *DbPairMakeTablePair ( DbPair *self, const ctx_t *ctx,
-    const char *member, const char *name, bool required, bool reorder,
-    struct TablePair* ( * make ) ( DbPair *self, const ctx_t *ctx,
-        struct VTable const *src, struct VTable *dst, const char *name, bool reorder )
-     );
-
-
-/* GetTblMember
- *  v1 schema does not preserve member name with an object
- *  some schemas confuse types with the same name
- */
-#define DbPairGetTblMember( self, ctx, src, name ) \
-    POLY_DISPATCH_PTR ( get_tbl_mbr, self, const DBPAIR_IMPL, ctx, src, name )
-
-
-/* AddDbPair
- *  called from implementations
- */
-void DbPairAddDbPair ( DbPair *self, const ctx_t *ctx, DbPair *db );
-
-
-/* AddTablePair
- *  called from implementations
- */
-void DbPairAddTablePair ( DbPair *self, const ctx_t *ctx, struct TablePair *tbl );
-
-
-/* MakeDirPair
- */
-struct DirPair *DbPairMakeDirPair ( DbPair *self, const ctx_t *ctx, const char *name, bool required,
-    struct DirPair* ( * make ) ( DbPair *self, const ctx_t *ctx,
-        struct KDirectory const *src, struct KDirectory *dst, const char *name )
-     );
-
-
-/* AddDirPair
- *  called from implementations
- */
-void DbPairAddDirPair ( DbPair *self, const ctx_t *ctx, struct DirPair *dir );
-
-
-/* Init
- *  initialize superclass with vt
- *  also db pair and name
- *  plus optional full-spec
- */
-void DbPairInit ( DbPair *self, const ctx_t *ctx, const DbPair_vt *vt,
-    struct VDatabase const *src, struct VDatabase *dst,
-    const char *name, const char *opt_full_spec );
-
-/* Destroy
- *  destroys superclass items
- */
-void DbPairDestroy ( DbPair *self, const ctx_t *ctx );
-
-
-#endif /* _h_sra_sort_db_pair_ */
diff --git a/tools/sra-sort/dir-pair.c b/tools/sra-sort/dir-pair.c
deleted file mode 100644
index 5f7f63a..0000000
--- a/tools/sra-sort/dir-pair.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct DirPair StdDirPair;
-#define DIRPAIR_IMPL StdDirPair
-
-#include "dir-pair.h"
-#include "db-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( dir-pair );
-
-
-static
-void StdDirPairWhack ( StdDirPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    DirPairDestroy ( self, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static DirPair_vt StdDirPair_vt =
-{
-    StdDirPairWhack
-};
-
-
-/* Make
- *  make a standard directory pair from existing KDirectory objects
- */
-DirPair *DirPairMake ( const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst,
-    const char *name, const char *opt_full_spec )
-{
-    FUNC_ENTRY ( ctx );
-
-    StdDirPair *dir;
-
-    TRY ( dir = MemAlloc ( ctx, sizeof * dir, false ) )
-    {
-        TRY ( DirPairInit ( dir, ctx, & StdDirPair_vt, src, dst, name, opt_full_spec ) )
-        {
-            return dir;
-        }
-
-        MemFree ( ctx, dir, sizeof * dir );
-    }
-
-    return NULL;
-}
-
-
-DirPair *DbPairMakeStdDirPair ( DbPair *self, const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-    return DirPairMake ( ctx, src, dst, name, self -> full_spec );
-}
-
-
-/* Release
- *  called by db at end of copy
- */
-void DirPairRelease ( DirPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "DirPair" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcDirectory, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release DirPair" );
-        }
-    }
-}
-
-/* Duplicate
- */
-DirPair *DirPairDuplicate ( DirPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "DirPair" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcDirectory, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate DirPair" );
-            return NULL;
-        }
-    }
-
-    return ( DirPair* ) self;
-}
-
-
-/* Copy
- *  copy from source to destination directory
- */
-typedef struct DirPairCopyParams DirPairCopyParams;
-struct DirPairCopyParams
-{
-    const DirPair *self;
-    const ctx_t *ctx;
-    char *relpath;
-    size_t psize;
-    const KDirectory *src;
-    KDirectory *dst;
-};
-
-static
-rc_t DirPairCopyDir ( const DirPair *self, const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst, char *relpath, size_t psize );
-
-static
-rc_t DirPairCopyFile ( const DirPair *self, const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst, char *relpath )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* get source access mode */
-    uint32_t access;
-    rc_t rc = KDirectoryAccess ( src, & access, relpath );
-    if ( rc != 0 )
-    {
-        ERROR ( rc, "failed to determine access mode of file 'dst.%.*s%s'",
-                self -> owner_spec_size, self -> full_spec, relpath );
-    }
-    else
-    {
-        KFile *d;
-        rc = KDirectoryCreateFile ( dst, & d, false, access, kcmInit | kcmParents, relpath );
-        if ( rc != 0 )
-        {
-            ERROR ( rc, "failed to create file 'dst.%.*s%s'",
-                    self -> owner_spec_size, self -> full_spec, relpath );
-        }
-        else
-        {
-            const KFile *s;
-            /* open source */
-            rc = KDirectoryOpenFileRead ( src, & s, relpath );
-            if ( rc != 0 )
-            {
-                ERROR ( rc, "failed to open file 'src.%.*s%s'",
-                        self -> owner_spec_size, self -> full_spec, relpath );
-            }
-            else
-            {
-                const KMMap *mm;
-                rc = KMMapMakeMaxRead ( & mm, s );
-                if ( rc != 0 )
-                {
-                    ERROR ( rc, "failed to map file 'src.%.*s%s'",
-                            self -> owner_spec_size, self -> full_spec, relpath );
-                }
-                else
-                {
-                    uint64_t mm_pos;
-
-                    /* get initial position and size */
-                    rc = KMMapPosition ( mm, & mm_pos );
-                    if ( rc != 0 )
-                    {
-                        ERROR ( rc, "failed to determine position of map file 'src.%.*s%s'",
-                                self -> owner_spec_size, self -> full_spec, relpath );
-                    }
-                    else
-                    {
-                        size_t mm_size;
-                        rc = KMMapSize ( mm, & mm_size );
-                        if ( rc != 0 )
-                        {
-                            ERROR ( rc, "failed to determine size of map file 'src.%.*s%s'",
-                                    self -> owner_spec_size, self -> full_spec, relpath );
-                        }
-                        else while ( mm_size != 0 )
-                        {
-                            size_t num_writ;
-                            const void *mm_addr;
-
-                            /* access address */
-                            rc = KMMapAddrRead ( mm, & mm_addr );
-                            if ( rc != 0 )
-                            {
-                                ERROR ( rc, "failed to access address of map file 'src.%.*s%s'",
-                                        self -> owner_spec_size, self -> full_spec, relpath );
-                                break;
-                            }
-
-                            /* write region to output */
-                            rc = KFileWriteAll ( d, mm_pos, mm_addr, mm_size, & num_writ );
-                            if ( rc != 0 )
-                            {
-                                ERROR ( rc, "failed to write to file 'dst.%.*s%s'",
-                                        self -> owner_spec_size, self -> full_spec, relpath );
-                                break;
-                            }
-                            if ( num_writ != mm_size )
-                            {
-                                rc = RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                                ERROR ( rc, "failed to write to file 'dst.%.*s%s'",
-                                        self -> owner_spec_size, self -> full_spec, relpath );
-                                break;
-                            }
-
-                            /* now try to shift region */
-                            mm_pos += mm_size;
-                            rc = KMMapReposition ( mm, mm_pos, & mm_size );
-                            if ( rc != 0 )
-                            {
-                                if ( GetRCState ( rc ) == rcInvalid )
-                                    rc = 0;
-                                else
-                                {
-                                    ERROR ( rc, "failed to remap file 'src.%.*s%s'",
-                                            self -> owner_spec_size, self -> full_spec, relpath );
-                                }
-                                break;
-                            }
-                        }
-                    }
-
-                    KMMapRelease ( mm );
-                }
-
-                KFileRelease ( s );
-            }
-
-            KFileRelease ( d );
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t DirPairCopyAlias ( const DirPair *self, const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst, char *relpath )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-#if WINDOWS
-    rc = RC ( rcExe, rcAlias, rcCopying, rcFunction, rcUnsupported );
-    ERROR ( rc, "Windows... failed to create alias 'dst.%.*s%s'",
-            self -> owner_spec_size, self -> full_spec, relpath );
-#else
-    char apath [ 4096 ];
-
-    /* resolve the alias */
-    rc = KDirectoryResolveAlias ( src, false, apath, sizeof apath, relpath );    
-    if ( rc != 0 )
-    {
-        ERROR ( rc, "failed to resolve alias 'src.%.*s%s'",
-                self -> owner_spec_size, self -> full_spec, relpath );
-    }
-    else
-    {
-        rc = KDirectoryCreateAlias ( dst, 0777, kcmInit, apath, relpath );
-        if ( rc != 0 )
-        {
-            ERROR ( rc, "failed to create alias 'dst.%.*s%s'",
-                    self -> owner_spec_size, self -> full_spec, relpath );
-        }
-    }
-#endif
-
-    return rc;
-}
-
-static
-rc_t CC DirPairCopyEntry ( const KDirectory *local, uint32_t type, const char *name, void *data )
-{
-    DirPairCopyParams *pb = data;
-    const ctx_t *ctx = pb -> ctx;
-
-    FUNC_ENTRY ( ctx );
-
-    const DirPair *self = pb -> self;
-    char *relpath = pb -> relpath;
-    size_t num_writ, psize = pb -> psize;
-
-    /* since we are walking two directories in parallel,
-       build a path relative to each base directory and go */
-    rc_t rc = string_printf ( & relpath [ psize ], 4096 - psize, & num_writ, "/%s", name );
-    if ( rc != 0 )
-    {
-        ERROR ( rc, "failed to build path for entry '%.*s%.*s/%s'",
-                self -> owner_spec_size, self -> full_spec,
-                ( uint32_t ) psize, relpath, name );
-        return rc;
-    }
-
-    /* see what type of entry we have */
-    switch ( type )
-    {
-    case kptFile:
-        return DirPairCopyFile ( pb -> self, ctx, pb -> src, pb -> dst, relpath );
-    case kptDir:
-        return DirPairCopyDir ( pb -> self, ctx, pb -> src, pb -> dst, relpath, psize + num_writ );
-    case kptFile | kptAlias:
-    case kptDir | kptAlias:
-        return DirPairCopyAlias ( pb -> self, ctx, pb -> src, pb -> dst, relpath );
-    }
-
-    rc = RC ( rcExe, rcDirectory, rcVisiting, rcType, rcUnsupported );
-    ERROR ( rc, "cannot copy entry '%.*s%s' - not a supported file system type",
-            self -> owner_spec_size, self -> full_spec, relpath );
-    return rc;
-}
-
-static
-rc_t DirPairCopyDir ( const DirPair *self, const ctx_t *ctx,
-    const KDirectory *src, KDirectory *dst, char *relpath, size_t psize )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* get source access mode */
-    uint32_t access;
-    rc_t rc = KDirectoryAccess ( src, & access, relpath );
-    if ( rc != 0 )
-    {
-        ERROR ( rc, "failed to determine access mode of directory 'src.%.*s%s'",
-                self -> owner_spec_size, self -> full_spec, relpath );
-    }
-    else
-    {
-        /* create the destination directory */
-        rc = KDirectoryCreateDir ( dst, access, kcmOpen | kcmParents, relpath );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to create directory 'dst.%.*s%s'",
-                    self -> owner_spec_size, self -> full_spec, relpath );
-        else
-        {
-            DirPairCopyParams pb;
-
-            pb . self = self;
-            pb . ctx = ctx;
-            pb . relpath = relpath;
-            pb . psize = psize;
-            pb . src = src;
-            pb . dst = dst;
-
-            /* going to perform shallow copy */
-            rc = KDirectoryVisit ( src, false, DirPairCopyEntry, & pb, relpath );
-        }
-    }
-
-    return rc;
-}
-
-
-void DirPairCopy ( DirPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t psize;
-    char relpath [ 4096 ];
-
-    STATUS ( 2, "copying directory '%s'", self -> full_spec );
-
-    rc = string_printf ( relpath, sizeof relpath, & psize, "./%s", self -> name );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "failed to build initial path string for '%s'", self -> full_spec );
-    else
-    {
-        DirPairCopyDir ( self, ctx, self -> sdir, self -> ddir, relpath, psize );
-    }
-}
-
-
-/* Init
- */
-void DirPairInit ( DirPair *self, const ctx_t *ctx, const DirPair_vt *vt,
-    const KDirectory *src, KDirectory *dst,
-    const char *name, const char *full_spec )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcDirectory, rcConstructing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad DirPair" );
-        return;
-    }
-
-    memset ( self, 0, sizeof * self );
-    self -> vt = vt;
-
-    rc = KDirectoryAddRef ( self -> sdir = src );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to duplicate dir 'src.%s./%s'", full_spec, name );
-    else
-    {
-        rc = KDirectoryAddRef ( self -> ddir = dst );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to duplicate dir 'dst.%s./%s'", full_spec, name );
-        else
-        {
-            char *new_full_spec;
-
-            self -> owner_spec_size = ( uint32_t ) string_size ( full_spec );
-            self -> full_spec_size = self -> owner_spec_size + string_size ( name ) + 2;
-
-            TRY ( new_full_spec = MemAlloc ( ctx, self -> full_spec_size + 1, false ) )
-            {
-                rc = string_printf ( new_full_spec, self -> full_spec_size + 1, NULL, "%s./%s", full_spec, name );
-                if ( rc != 0 )
-                    ABORT ( rc, "miscalculated string size" );
-                else
-                {
-                    self -> full_spec = new_full_spec;
-                    self -> name = new_full_spec + self -> owner_spec_size + 2;
-
-                    KRefcountInit ( & self -> refcount, 1, "DirPair", "init", name );
-                    return;
-                }
-            }
-
-            KDirectoryRelease ( self -> ddir );
-            self -> ddir = NULL;
-        }
-
-        KDirectoryRelease ( self -> sdir );
-        self -> sdir = NULL;
-    }
-}
-
-/* Destroy
- */
-void DirPairDestroy ( DirPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = KDirectoryRelease ( self -> ddir );
-    if ( rc != 0 )
-        WARN ( "KDirectoryRelease failed on 'dst.%s'", self -> full_spec );
-    KDirectoryRelease ( self -> sdir );
-
-    MemFree ( ctx, ( void* ) self -> full_spec, self -> full_spec_size + 1 );
-
-    memset ( self, 0, sizeof * self );
-}
diff --git a/tools/sra-sort/dir-pair.h b/tools/sra-sort/dir-pair.h
deleted file mode 100644
index 7bccb93..0000000
--- a/tools/sra-sort/dir-pair.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_dir_pair_
-#define _h_sra_sort_dir_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct DbPair;
-struct KDirectory;
-
-
-/*--------------------------------------------------------------------------
- * DirPair
- *  interface to pairing of source and destination directories
- */
-typedef struct DirPair_vt DirPair_vt;
-
-typedef struct DirPair DirPair;
-struct DirPair
-{
-    /* polymorphic */
-    const DirPair_vt *vt;
-
-    /* the pair of KDirectories */
-    struct KDirectory const *sdir;
-    struct KDirectory *ddir;
-
-    /* simple directory name */
-    const char *name;
-
-    /* full directory spec */
-    size_t full_spec_size;
-    const char *full_spec;
-
-    /* reference counting */
-    KRefcount refcount;
-
-    /* owner spec size */
-    uint32_t owner_spec_size;
-};
-
-#ifndef DIRPAIR_IMPL
-#define DIRPAIR_IMPL DirPair
-#endif
-
-struct DirPair_vt
-{
-    void ( * whack ) ( DIRPAIR_IMPL *self, const ctx_t *ctx );
-};
-
-
-/* Make
- *  make a standard directory pair from existing KDirectory objects
- */
-DirPair *DirPairMake ( const ctx_t *ctx,
-    struct KDirectory const *src, struct KDirectory *dst,
-    const char *name, const char *full_spec );
-
-DirPair *DbPairMakeStdDirPair ( struct DbPair *self, const ctx_t *ctx,
-    struct KDirectory const *src, struct KDirectory *dst, const char *name );
-
-
-/* Release
- *  called by db at end of copy
- */
-void DirPairRelease ( DirPair *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-DirPair *DirPairDuplicate ( DirPair *self, const ctx_t *ctx );
-
-
-/* Copy
- *  copy from source to destination directory
- */
-void DirPairCopy ( DirPair *self, const ctx_t *ctx );
-
-
-/* Init
- */
-void DirPairInit ( DirPair *self, const ctx_t *ctx, const DirPair_vt *vt,
-    struct KDirectory const *src, struct KDirectory *dst,
-    const char *name, const char *opt_full_spec );
-
-/* Destroy
- */
-void DirPairDestroy ( DirPair *self, const ctx_t *ctx );
-
-
-#endif /* _h_sra_sort_dir_pair_ */
diff --git a/tools/sra-sort/dump-blob-boundaries.c b/tools/sra-sort/dump-blob-boundaries.c
deleted file mode 100644
index 6639d8a..0000000
--- a/tools/sra-sort/dump-blob-boundaries.c
+++ /dev/null
@@ -1,203 +0,0 @@
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/column.h>
-#include <kdb/namelist.h>
-#include <klib/namelist.h>
-#include <klib/rc.h>
-
-#include <stdio.h>
-
-static int64_t blob_limit = 10;
-
-static
-uint32_t dump_col ( const KColumn *col, const char *dbname, const char *tblname, const char *colname )
-{
-    rc_t rc = 0;
-    int64_t row, first;
-    const KColumnBlob *blob;
-    uint32_t count, num_blobs;
-
-    for ( num_blobs = 0, row = 1; rc == 0 && num_blobs < blob_limit; ++ num_blobs, row = first + count )
-    {
-        rc = KColumnOpenBlobRead ( col, & blob, row );
-        if ( rc == 0 )
-        {
-            rc = KColumnBlobIdRange ( blob, & first, & count );
-            if ( rc != 0 )
-                fprintf ( stderr, "failed to get row-range for blob containing row '%s.%s.%s.%ld'\n", dbname, tblname, colname, row );
-            else
-            {
-                size_t num_read, remaining;
-                rc = KColumnBlobRead ( blob, 0, & first, 0, & num_read, & remaining );
-                if ( rc != 0 )
-                    fprintf ( stderr, "failed to get size of blob containing row '%s.%s.%s.%ld'\n", dbname, tblname, colname, row );
-                else
-                {
-                    printf ( "  %ld .. %ld ( %u rows ), %zu bytes\n", first, first + count - 1, count, remaining );
-                }
-            }
-
-            KColumnBlobRelease ( blob );
-        }
-        else if ( GetRCState ( rc ) == rcNotFound )
-            return num_blobs;
-        else
-        {
-            fprintf ( stderr, "failed to open blob for row '%s.%s.%s.%ld'\n", dbname, tblname, colname, row );
-        }
-    }
-
-    for ( ; rc == 0; ++ num_blobs, row = first + count )
-    {
-        rc = KColumnOpenBlobRead ( col, & blob, row );
-        if ( rc == 0 )
-        {
-            rc = KColumnBlobIdRange ( blob, & first, & count );
-            KColumnBlobRelease ( blob );
-        }
-    }
-
-    return num_blobs;
-}
-
-static
-void dump_col_name ( const KTable *tbl, const char *dbname, const char *tblname, const char *colname )
-{
-    const KColumn *col;
-    rc_t rc = KTableOpenColumnRead ( tbl, & col, colname );
-    if ( rc != 0 )
-        fprintf ( stderr, "failed to open column '%s.%s.%s'\n", dbname, tblname, colname );
-    else
-    {
-        uint32_t num_blobs;
-        printf ( "COLUMN '%s.%s.%s'\n", dbname, tblname, colname );
-        num_blobs = dump_col ( col, dbname, tblname, colname );
-        KColumnRelease ( col );
-        if ( num_blobs > blob_limit )
-            printf ( "  %u blobs in column\n", num_blobs );
-    }
-}
-
-static
-void dump_tbl ( const KTable *tbl, const char *tblname, int argc, char *argv [] )
-{
-    if ( argc >= 4 )
-    {
-        int i;
-        for ( i = 3; i < argc; ++ i )
-        {
-            dump_col_name ( tbl, argv [ 1 ], tblname, argv [ i ] );
-        }
-    }
-    else
-    {
-        KNamelist *names;
-        rc_t rc = KTableListCol ( tbl, & names );
-        if ( rc != 0 )
-            fprintf ( stderr, "failed to list columns for tbl '%s.%s'\n", argv [ 1 ], tblname );
-        else
-        {
-            uint32_t count;
-            rc = KNamelistCount ( names, & count );
-            if ( rc != 0 )
-                fprintf ( stderr, "failed to count columns for tbl '%s.%s'\n", argv [ 1 ], tblname );
-            else
-            {
-                uint32_t i;
-                for ( i = 0; i < count; ++ i )
-                {
-                    const char *name;
-                    rc = KNamelistGet ( names, i, & name );
-                    if ( rc != 0 )
-                        fprintf ( stderr, "failed to access column name [ %u ] for tbl '%s.%s'\n", i, argv [ 1 ], tblname );
-                    else
-                    {
-                        dump_col_name ( tbl, argv [ 1 ], tblname, name );
-                    }
-                }
-            }
-
-            KNamelistRelease ( names );
-        }
-    }
-}
-
-static
-void dump_tbl_name ( const KDatabase *db, const char *tblname, int argc, char *argv [] )
-{
-    const KTable *tbl;
-    rc_t rc = KDatabaseOpenTableRead ( db, & tbl, tblname );
-    if ( rc != 0 )
-        fprintf ( stderr, "failed to open table '%s.%s'\n", argv [ 1 ], tblname );
-    else
-    {
-        dump_tbl ( tbl, tblname, argc, argv );
-        KTableRelease ( tbl );
-    }
-}
-
-static
-void dump_db ( const KDatabase *db, int argc, char *argv [] )
-{
-    if ( argc >= 3 )
-        dump_tbl_name ( db, argv [ 2 ], argc, argv );
-    else
-    {
-        KNamelist *names;
-        rc_t rc = KDatabaseListTbl ( db, & names );
-        if ( rc != 0 )
-            fprintf ( stderr, "failed to list tables for db '%s'\n", argv [ 1 ] );
-        else
-        {
-            uint32_t count;
-            rc = KNamelistCount ( names, & count );
-            if ( rc != 0 )
-                fprintf ( stderr, "failed to count tables for db '%s'\n", argv [ 1 ] );
-            else
-            {
-                uint32_t i;
-                for ( i = 0; i < count; ++ i )
-                {
-                    const char *name;
-                    rc = KNamelistGet ( names, i, & name );
-                    if ( rc != 0 )
-                        fprintf ( stderr, "failed to access table name [ %u ] for db '%s'\n", i, argv [ 1 ] );
-                    else
-                    {
-                        dump_tbl_name ( db, name, argc, argv );
-                    }
-                }
-            }
-
-            KNamelistRelease ( names );
-        }
-    }
-}
-
-int main ( int argc, char *argv [] )
-{
-    if ( argc < 2 )
-        printf ( "Usage: %s database [ table [ col ... ] ]\n", argv [ 0 ] );
-    else
-    {
-        const KDBManager *mgr;
-        rc_t rc = KDBManagerMakeRead ( & mgr, NULL );
-        if ( rc == 0 )
-        {
-            const KDatabase *db;
-            rc = KDBManagerOpenDBRead ( mgr, & db, argv [ 1 ] );
-            if ( rc != 0 )
-                fprintf ( stderr, "failed to open database '%s'\n", argv [ 1 ] );
-            else
-            {
-                dump_db ( db, argc, argv );
-                KDatabaseRelease ( db );
-            }
-
-            KDBManagerRelease ( mgr );
-        }
-    }
-
-    return 0;
-}
diff --git a/tools/sra-sort/except.c b/tools/sra-sort/except.c
deleted file mode 100644
index c95d7e0..0000000
--- a/tools/sra-sort/except.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "caps.h"
-#include "ctx.h"
-#include "except.h"
-#include "status.h"
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/printf.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-FILE_ENTRY ( except );
-
-
-/*--------------------------------------------------------------------------
- * exception-related activities
- */
-
-static
-rc_t log_msg ( const ctx_t *ctx, uint32_t lineno, KLogLevel lvl, const char *msg )
-{
-#if _DEBUGGING
-    const ctx_info_t *ctx_info = ctx -> info;
-    return pLogMsg ( lvl, "$(mod)/$(file).c:$(line): $(func): $(msg)",
-                     "mod=%s,file=%s,line=%u,func=%s,msg=%s",
-                     ctx_info -> mod,
-                     ctx_info -> file,
-                     lineno,
-                     ctx_info -> func,
-                     msg );
-#else
-    return LogMsg ( lvl, msg );
-#endif
-}
-
-static
-rc_t log_err ( const ctx_t *ctx, uint32_t lineno, KLogLevel lvl, rc_t rc, const char *msg )
-{
-#if _DEBUGGING
-    const ctx_info_t *ctx_info = ctx -> info;
-    return pLogErr ( lvl, rc, "$(mod)/$(file).c:$(line): $(func): $(msg)",
-                     "mod=%s,file=%s,line=%u,func=%s,msg=%s",
-                     ctx_info -> mod,
-                     ctx_info -> file,
-                     lineno,
-                     ctx_info -> func,
-                     msg );
-#else
-    return LogErr ( lvl, rc, msg );
-#endif
-}
-
-static
-rc_t status_msg ( const ctx_t *ctx, uint32_t lineno, uint32_t level, const char *msg )
-{
-#if _DEBUGGING
-    const ctx_info_t *ctx_info = ctx -> info;
-    return KStsMsg ( "%s/%s.c:%u: %s: [ %u ] %s",
-                     ctx_info -> mod,
-                     ctx_info -> file,
-                     lineno,
-                     ctx_info -> func,
-                     level,
-                     msg );
-#else
-    return KStsMsg ( "%s", msg );
-#endif
-}
-
-
-/* Annotate
- *  make some annotation
- *  but not an error
- */
-void Annotate ( const ctx_t *ctx, uint32_t lineno, KLogLevel level, const char *msg, ... )
-{
-    rc_t rc2;
-    size_t num_writ;
-    char buff [ 8 * 1024 ];
-
-    va_list args;
-    va_start ( args, msg );
-
-    rc2 = string_vprintf ( buff, sizeof buff, & num_writ, msg, args );
-    if ( rc2 != 0 )
-        log_err ( ctx, lineno, klogInt, rc2, "Annotate failure" );
-    else
-        log_msg ( ctx, lineno, level, buff );
-
-    va_end ( args );
-}
-
-
-/* Error
- *  make an annotation
- *  record an error as an rc_t
- */
-void Error ( const ctx_t *ctx, uint32_t lineno, KLogLevel level, rc_t rc, const char *msg, ... )
-{
-    rc_t rc2;
-    ctx_t *mctx;
-    size_t num_writ;
-    char buff [ 8 * 1024 ];
-
-    va_list args;
-    va_start ( args, msg );
-
-    rc2 = string_vprintf ( buff, sizeof buff, & num_writ, msg, args );
-    if ( rc2 != 0 )
-        log_err ( ctx, lineno, klogInt, rc2, "Error annotation failure" );
-    else
-        log_err ( ctx, lineno, level, rc, buff );
-
-    va_end ( args );
-
-    for ( mctx = ( ctx_t* ) ctx; mctx != NULL && mctx -> rc == 0; mctx = ( ctx_t* ) mctx -> caller )
-        mctx -> rc = rc;
-}
-
-
-/* Abort
- *  make an annotation
- *  record an error as an rc_t
- *  exit process
- */
-void Abort ( const ctx_t *ctx, uint32_t lineno, rc_t rc, const char *msg, ... )
-{
-    rc_t rc2;
-    ctx_t *mctx;
-    size_t num_writ;
-    char buff [ 8 * 1024 ];
-
-    va_list args;
-    va_start ( args, msg );
-
-    rc2 = string_vprintf ( buff, sizeof buff, & num_writ, msg, args );
-    if ( rc2 != 0 )
-        log_err ( ctx, lineno, klogFatal, rc2, "Abort annotation failure" );
-    else
-        log_err ( ctx, lineno, klogFatal, rc, buff );
-
-    va_end ( args );
-
-    for ( mctx = ( ctx_t* ) ctx; mctx != NULL && mctx -> rc == 0; mctx = ( ctx_t* ) mctx -> caller )
-        mctx -> rc = rc;
-
-    exit ( -1 );
-}
-
-
-/* Clear
- *  clears annotation and error
- */
-void ClearAnnotation ( const ctx_t *ctx )
-{
-    ClearError ( ctx );
-}
-
-
-/* ClearError
- *  clears error, leaving any annotation
- */
-void ClearError ( const ctx_t *ctx )
-{
-    ctx_t *mctx;
-    for ( mctx = ( ctx_t* ) ctx; mctx != NULL && mctx -> rc != 0; mctx = ( ctx_t* ) mctx -> caller )
-        mctx -> rc = 0;
-}
-
-
-/* Status
- *  report status
- */
-void Status ( const ctx_t *ctx, uint32_t lineno, uint32_t level, const char *msg, ... )
-{
-    if ( KStsLevelGet () >= level )
-    {
-        rc_t rc2;
-        size_t num_writ;
-        char buff [ 8 * 1024 ];
-
-        va_list args;
-        va_start ( args, msg );
-
-        rc2 = string_vprintf ( buff, sizeof buff, & num_writ, msg, args );
-        if ( rc2 != 0 )
-            log_err ( ctx, lineno, klogInt, rc2, "Status failure" );
-        else
-            status_msg ( ctx, lineno, level, buff );
-
-        va_end ( args );
-    }
-}
-
-/* POLY_DISPATCH
- *  dispatch a polymorphic message
- */
-void null_self_error ( const ctx_t *ctx, uint32_t lineno, const char *msg )
-{
-    rc_t rc = RC ( rcExe, rcFunction, rcResolving, rcSelf, rcNull );
-    Error ( ctx, lineno, klogInt, rc, "cannot dispatch message '%s'", msg );
-}
diff --git a/tools/sra-sort/except.h b/tools/sra-sort/except.h
deleted file mode 100644
index 911149b..0000000
--- a/tools/sra-sort/except.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_except_
-#define _h_sra_sort_except_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * exception-related macros
- */
-
-
-/* ANNOTATE
- *  make some annotation
- *  but not an error
- */
-void Annotate ( const ctx_t *ctx, uint32_t lineno, KLogLevel level, const char *msg, ... );
-#define ANNOTATE( msg, ... ) \
-    Annotate ( ctx, __LINE__, klogInfo, msg, ## __VA_ARGS__ )
-
-
-/* WARN
- *  make some annotation
- *  but not an error
- */
-#define WARN( msg, ... ) \
-    Annotate ( ctx, __LINE__, klogWarn, msg, ## __VA_ARGS__ )
-
-
-/* INFO_ERROR
- *  make an annotation
- *  record an informational error as an rc_t
- */
-void Error ( const ctx_t *ctx, uint32_t lineno, KLogLevel level, rc_t rc, const char *msg, ... );
-#define INFO_ERROR( rc, msg, ... ) \
-    Error ( ctx, __LINE__, klogInfo, rc, msg, ## __VA_ARGS__ )
-
-
-/* ERROR
- *  make an annotation
- *  record an error as an rc_t
- */
-#ifdef ERROR
-#undef ERROR
-#endif
-#define ERROR( rc, msg, ... ) \
-    Error ( ctx, __LINE__, klogErr, rc, msg, ## __VA_ARGS__ )
-
-
-/* INTERNAL_ERROR
- *  make an annotation
- *  record an internal error as an rc_t
- */
-#define INTERNAL_ERROR( rc, msg, ... ) \
-    Error ( ctx, __LINE__, klogInt, rc, msg, ## __VA_ARGS__ )
-
-
-/* SYSTEM_ERROR
- *  make an annotation
- *  record a system error as an rc_t
- */
-#define SYSTEM_ERROR( rc, msg, ... ) \
-    Error ( ctx, __LINE__, klogSys, rc, msg, ## __VA_ARGS__ )
-
-
-/* ABORT
- *  make an annotation
- *  record an error as an rc_t
- *  exit process
- */
-void Abort ( const ctx_t *ctx, uint32_t lineno, rc_t rc, const char *msg, ... );
-#define ABORT( rc, msg, ... )                        \
-    Abort ( ctx, __LINE__, rc, msg, ## __VA_ARGS__ )
-
-
-/* FAILED
- *  a test of rc within ctx_t
- */
-#ifdef FAILED
-#undef FAILED
-#endif
-#define FAILED() \
-    ( ctx -> rc != 0 )
-
-
-/* TRY
- *  another C language "try" macro
- */
-#define TRY( expr ) \
-    expr; \
-    if ( ! FAILED () )
-
-
-/* CATCH
- *  attempts to catch rc on certain types
- */
-#define CATCH( obj_code, state_code ) \
-    else if ( GetRCObject ( ctx -> rc ) == obj_code && GetRCState ( ctx -> rc ) == state_code )
-#define CATCH_STATE( state_code ) \
-    else if ( GetRCState ( ctx -> rc ) == state_code )
-#define CATCH_OBJ( obj_code ) \
-    else if ( GetRCObject ( ctx -> rc ) == obj_code )
-#define CATCH_ALL() \
-    else
-
-/* ON_FAIL
- */
-#define ON_FAIL( expr ) \
-    expr; \
-    if ( FAILED () )
-
-
-/* CLEAR
- *  clears annotation and error
- */
-void ClearAnnotation ( const ctx_t *ctx );
-#define CLEAR() \
-    ClearAnnotation ( ctx )
-
-
-/* CLEAR_ERR
- *  clears error, leaving any annotation
- */
-void ClearError ( const ctx_t *ctx );
-#define CLEAR_ERR() \
-    ClearError ( ctx )
-
-
-#endif
diff --git a/tools/sra-sort/gcc-ped.sh b/tools/sra-sort/gcc-ped.sh
deleted file mode 100755
index 7db5891..0000000
--- a/tools/sra-sort/gcc-ped.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# test gcc for support of supplied parameters
-
-if test $# -ge 4
-then
-    if ( echo "typedef int x;" | gcc -c -xc - -o /dev/null $1 $2 $3 $4 > /dev/null 2>&1 )
-    then
-	echo $1 $2 $3 $4
-	exit 0
-    fi
-fi
-
-if test $# -ge 3
-then
-    if ( echo "typedef int x;" | gcc -c -xc - -o /dev/null $1 $2 $3 > /dev/null 2>&1 )
-    then
-	echo $1 $2 $3
-	exit 0
-    fi
-fi
-
-if test $# -ge 2
-then
-    if ( echo "typedef int x;" | gcc -c -xc - -o /dev/null $1 $2 > /dev/null 2>&1 )
-    then
-	echo $1 $2
-	exit 0
-    fi
-fi
-
-if test $# -ge 1
-then
-    if ( echo "typedef int x;" | gcc -c -xc - -o /dev/null $1 > /dev/null 2>&1 )
-    then
-	echo $1
-	exit 0
-    fi
-fi
diff --git a/tools/sra-sort/glob-poslen.c b/tools/sra-sort/glob-poslen.c
deleted file mode 100644
index 4f028a4..0000000
--- a/tools/sra-sort/glob-poslen.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-struct GlobalPosLenReader;
-#define COLREADER_IMPL struct GlobalPosLenReader
-
-#include "glob-poslen.h"
-#include "tbl-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "map-file.h"
-#include "sra-sort.h"
-
-#include <insdc/insdc.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <klib/printf.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-
-#include <string.h>
-#include <assert.h>
-
-FILE_ENTRY ( glob-poslen );
-
-
-/*--------------------------------------------------------------------------
- * GlobalPosLenReader
- */
-struct GlobalPosLenReader
-{
-    ColumnReader dad;
-
-    uint64_t poslen;
-
-    const VCursor *curs;
-    uint32_t idx [ 3 ];
-
-    uint32_t chunk_size;
-
-    size_t full_spec_size;
-    char full_spec [ 1 ];
-};
-
-static
-void GlobalPosLenReaderWhack ( GlobalPosLenReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    VCursorRelease ( self -> curs );
-    MemFree ( ctx, self, sizeof * self + self -> full_spec_size );
-}
-
-static
-const char *GlobalPosLenReaderFullSpec ( const GlobalPosLenReader *self, const ctx_t *ctx )
-{
-    return self -> full_spec;
-}
-
-static
-uint64_t GlobalPosLenReaderIdRange ( const GlobalPosLenReader *self, const ctx_t *ctx, int64_t *opt_first )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    uint64_t count;
-
-    rc = VCursorIdRange ( self -> curs, 0, opt_first, & count );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorIdRange failed on '%s'", self -> full_spec );
-
-    return count;
-}
-
-static
-void GlobalPosLenReaderPreCopy ( GlobalPosLenReader *self, const ctx_t *ctx )
-{
-}
-
-static
-void GlobalPosLenReaderPostCopy ( GlobalPosLenReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    /* called after a single copy
-       assumes that entire row-range of table has been copied */
-
-    rc = VCursorRelease ( self -> curs );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorRelease failed on '%s'", self -> full_spec );
-    else
-        self -> curs = NULL;
-}
-
-static
-const void *GlobalPosLenReaderReadGlobal ( GlobalPosLenReader *self, const ctx_t *ctx,
-    int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const void *base;
-
-    assert ( elem_bits != NULL );
-    assert ( boff != NULL );
-    assert ( row_len != NULL );
-
-    rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx [ 0 ],
-        elem_bits, & base, boff, row_len );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to read REF_LEN for row %ld", row_id );
-    else
-    {
-        INSDC_coord_len ref_len;
-        assert ( * boff == 0 );
-        assert ( * row_len == 1 );
-        assert ( * elem_bits == sizeof ref_len * 8 );
-        ref_len = ( ( const INSDC_coord_len* ) base ) [ 0 ];
-
-        rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx [ 1 ],
-            elem_bits, & base, boff, row_len );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to read GLOBAL_REF_START for row %ld", row_id );
-        else
-        {
-            uint64_t pos;
-            assert ( * boff == 0 );
-            assert ( * row_len == 1 );
-            assert ( * elem_bits == sizeof ( uint64_t ) * 8 );
-            pos = ( ( const uint64_t* ) base ) [ 0 ];
-
-            self -> poslen = encode_pos_len ( pos, ref_len );
-#if 1
-            assert ( decode_pos_len ( self -> poslen ) == pos );
-            assert ( poslen_to_len ( self -> poslen ) == ref_len );
-#endif
-            return & self -> poslen;
-        }
-    }
-
-    return NULL;
-
-}
-
-static
-const void *GlobalPosLenReaderReadLocal ( GlobalPosLenReader *self, const ctx_t *ctx,
-    int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const void *base;
-
-    assert ( elem_bits != NULL );
-    assert ( boff != NULL );
-    assert ( row_len != NULL );
-
-    rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx [ 0 ],
-        elem_bits, & base, boff, row_len );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to read REF_LEN for row %ld", row_id );
-    else
-    {
-        INSDC_coord_len ref_len;
-        assert ( * boff == 0 );
-        assert ( * row_len == 1 );
-        assert ( * elem_bits == sizeof ref_len * 8 );
-        ref_len = ( ( const INSDC_coord_len* ) base ) [ 0 ];
-
-        rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx [ 1 ],
-            elem_bits, & base, boff, row_len );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to read REF_START for row %ld", row_id );
-        else
-        {
-            INSDC_coord_zero ref_start;
-            assert ( * boff == 0 );
-            assert ( * row_len == 1 );
-            assert ( * elem_bits == sizeof ref_start * 8 );
-            ref_start = ( ( const INSDC_coord_zero* ) base ) [ 0 ];
-
-            rc = VCursorCellDataDirect ( self -> curs, row_id, self -> idx [ 2 ],
-                elem_bits, & base, boff, row_len );
-            if ( rc != 0 )
-                ERROR ( rc, "failed to read REF_ID for row %ld", row_id );
-            else
-            {
-                int64_t ref_id;
-                assert ( * boff == 0 );
-                assert ( * row_len == 1 );
-                assert ( * elem_bits == sizeof ref_id * 8 );
-                ref_id = ( ( const int64_t* ) base ) [ 0 ];
-
-                if ( ref_id <= 0 )
-                    self -> poslen = 0;
-                else
-                {
-                    uint64_t pos = local_to_global ( ref_id, self -> chunk_size, ref_start );
-                    self -> poslen = encode_pos_len ( pos, ref_len );
-#if 1
-                    assert ( global_to_row_id ( pos, self -> chunk_size ) == ref_id );
-                    assert ( decode_pos_len ( self -> poslen ) == pos );
-                    assert ( poslen_to_len ( self -> poslen ) == ref_len );
-#endif
-                }
-
-                return & self -> poslen;
-            }
-        }
-    }
-
-    return NULL;
-}
-
-static  ColumnReader_vt GlobalPosLenReader_vt =
-{
-    GlobalPosLenReaderWhack,
-    GlobalPosLenReaderFullSpec,
-    GlobalPosLenReaderIdRange,
-    GlobalPosLenReaderPreCopy,
-    GlobalPosLenReaderPostCopy,
-    GlobalPosLenReaderReadGlobal
-};
-
-static  ColumnReader_vt LocalPosLenReader_vt =
-{
-    GlobalPosLenReaderWhack,
-    GlobalPosLenReaderFullSpec,
-    GlobalPosLenReaderIdRange,
-    GlobalPosLenReaderPreCopy,
-    GlobalPosLenReaderPostCopy,
-    GlobalPosLenReaderReadLocal
-};
-
-
-
-/* MakeGlobalPosLenReader
- */
-ColumnReader *TablePairMakeGlobalPosLenReader ( TablePair *self, const ctx_t *ctx, uint32_t chunk_size )
-{
-    FUNC_ENTRY ( ctx );
-
-    GlobalPosLenReader *reader;
-    size_t full_spec_size = self -> full_spec_size + sizeof "src..GLOBAL_POSLEN" - 1;
-
-    TRY ( reader = MemAlloc ( ctx, sizeof * reader + full_spec_size, false ) )
-    {
-        /* we don't yet know whether the reader will have GLOBAL_REF_START */
-        TRY ( ColumnReaderInit ( & reader -> dad, ctx, & GlobalPosLenReader_vt ) )
-        {
-            rc_t rc = string_printf ( reader -> full_spec, full_spec_size + 1, NULL, "src.%s.GLOBAL_POSLEN", self -> full_spec );
-            if ( rc != 0 )
-                ABORT ( rc, "cannot seem to calculate string sizes" );
-            else
-            {
-                rc = VTableCreateCursorRead ( self -> stbl, & reader -> curs );
-                if ( rc != 0 )
-                    ERROR ( rc, "failed to create cursor on 'src.%s'", self -> full_spec );
-                else
-                {
-                    /* we need length as a 2nd sorting key */
-                    rc = VCursorAddColumn ( reader -> curs, & reader -> idx [ 0 ], "REF_LEN" );
-                    if ( rc != 0 )
-                        ERROR ( rc, "VCursorAddColumn failed on '%s' cursor", self -> full_spec );
-                    else
-                    {
-                        /* add columns AFTER open */
-                        rc = VCursorPermitPostOpenAdd ( reader -> curs );
-                        if ( rc != 0 )
-                            ERROR ( rc, "VCursorPermitPostOpenAdd failed on '%s' cursor", self -> full_spec );
-                        else
-                        {
-                            /* open single-column cursor - errors adding further columns
-                               help determine what type of positioning we have */
-                            rc = VCursorOpen ( reader -> curs );
-                            if ( rc != 0 )
-                                ERROR ( rc, "VCursorOpen failed on '%s' cursor", self -> full_spec );
-                            else
-                            {
-                                /* finish initialization */
-                                reader -> chunk_size = chunk_size;
-                                reader -> full_spec_size = ( uint32_t ) full_spec_size;
-
-                                /* now try to get GLOBAL_REF_START */
-                                rc = VCursorAddColumn ( reader -> curs, & reader -> idx [ 1 ], "GLOBAL_REF_START" );
-                                if ( rc == 0 )
-                                {
-                                    STATUS ( 3, "'%s' table has GLOBAL_REF_START", self -> full_spec );
-                                    
-                                    /* retrieval function returns this position directly */
-                                    return & reader -> dad;
-                                }
-
-                                /* try for local refpos */
-                                rc = VCursorAddColumn ( reader -> curs, & reader -> idx [ 1 ], "REF_START" );
-                                if ( rc == 0 )
-                                    rc = VCursorAddColumn ( reader -> curs, & reader -> idx [ 2 ], "REF_ID" );
-                                if ( rc == 0 )
-                                {
-                                    STATUS ( 3, "'%s' table has local REF_START", self -> full_spec );
-
-                                    /* retrieval function synthesizes local to global */
-                                    reader -> dad . vt = & LocalPosLenReader_vt;
-                                    return & reader -> dad;
-                                }
-
-                                ERROR ( rc, "failed to populate '%s' cursor", reader -> full_spec );
-                            }
-                        }
-                    }
-
-                    VCursorRelease ( reader -> curs );
-                }
-            }
-        }
-
-        MemFree ( ctx, reader, sizeof * reader + full_spec_size );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/glob-poslen.h b/tools/sra-sort/glob-poslen.h
deleted file mode 100644
index 0a39102..0000000
--- a/tools/sra-sort/glob-poslen.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_glob_poslen_
-#define _h_sra_sort_glob_poslen_
-
-#ifndef _h_sra_sort_col_pair_
-#include "col-pair.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct TablePair;
-
-
-/*--------------------------------------------------------------------------
- * inline functions
- */
-#define MAX_POS_BITS 34
-#define MAX_LEN_BITS ( 64 - MAX_POS_BITS )
-
-
-static __inline__
-uint64_t encode_pos_len ( uint64_t pos, uint32_t len )
-{
-    assert ( pos < ( ( ~ ( uint64_t ) 0 ) >> MAX_LEN_BITS ) );
-    assert ( 0 < len && len <= ( ( ~ ( uint32_t ) 0 ) >> ( 32 - MAX_LEN_BITS ) ) );
-
-    /* position ascending, length descending */
-    return ( ( pos + 1 ) << MAX_LEN_BITS ) - len;
-}
-
-static __inline__
-uint64_t decode_pos_len ( uint64_t pos_len )
-{
-    return pos_len >> MAX_LEN_BITS;
-}
-
-static __inline__
-uint32_t poslen_to_len ( uint64_t pos_len )
-{
-    return ( 1U << MAX_LEN_BITS ) - ( ( uint32_t ) pos_len & ( ( ~ ( uint32_t ) 0 ) >> ( 32 - MAX_LEN_BITS ) ) );
-}
-
-static __inline__
-uint64_t local_to_global ( int64_t row_id, uint32_t chunk_size, uint32_t offset )
-{
-    assert ( row_id > 0 );
-    return ( row_id - 1 ) * chunk_size + offset;
-}
-
-static __inline__
-int64_t global_to_row_id ( uint64_t pos, uint32_t chunk_size )
-{
-    return ( pos / chunk_size ) + 1;
-}
-
-
-/*--------------------------------------------------------------------------
- * GlobalPosLenReader
- */
-typedef struct GlobalPosLenReader GlobalPosLenReader;
-
-
-/* MakeGlobalPosLenReader
- */
-ColumnReader *TablePairMakeGlobalPosLenReader ( struct TablePair *self, const ctx_t *ctx, uint32_t chunk_size );
-
-
-#endif /* _h_sra_sort_glob_poslen_ */
diff --git a/tools/sra-sort/id-mapper-col.c b/tools/sra-sort/id-mapper-col.c
deleted file mode 100644
index 0bfea9b..0000000
--- a/tools/sra-sort/id-mapper-col.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct MapRowIdColWriter MapRowIdColWriter;
-#define COLWRITER_IMPL MapRowIdColWriter
-
-#include "id-mapper-col.h"
-#include "map-file.h"
-#include "csra-tbl.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <klib/rc.h>
-
-#include <string.h>
-
-FILE_ENTRY ( id-mapper-col );
-
-
-/*--------------------------------------------------------------------------
- * MapRowIdColWriter
- */
-
-struct MapRowIdColWriter
-{
-    ColumnWriter dad;
-
-    ColumnWriter *cw;
-
-    MapFile *idx;
-
-    int64_t *row;
-    uint32_t max_row_len;
-
-    bool assign_ids;
-};
-
-/* called by Release */
-static
-void MapRowIdColWriterDestroy ( MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnWriterRelease ( self -> cw, ctx );
-    self -> cw = NULL;
-
-    MapFileRelease ( self -> idx, ctx );
-    self -> idx = NULL;
-
-    if ( self -> row != NULL )
-    {
-        MemFree ( ctx, self -> row, sizeof * self -> row * self -> max_row_len );
-        self -> row = NULL;
-        self -> max_row_len = 0;
-    }
-}
-
-static
-void MapRowIdColWriterWhack ( MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    MapRowIdColWriterDestroy ( self, ctx );
-    ColumnWriterDestroy ( & self -> dad, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-/* full spec */
-static
-const char* MapRowIdColWriterFullSpec ( const MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return ColumnWriterFullSpec ( self -> cw, ctx );
-}
-
-static
-void MapRowIdColWriterPreCopy ( MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    ColumnWriterPreCopy ( self -> cw, ctx );
-}
-
-static
-void MapRowIdColWriterPostCopy ( MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> max_row_len > 16 )
-    {
-        void *row;
-        TRY ( row = MemAlloc ( ctx, sizeof * self -> row * 16, false ) )
-        {
-            MemFree ( ctx, self -> row, sizeof * self -> row * self -> max_row_len );
-            self -> row = row;
-            self -> max_row_len = 16;
-        }
-        CATCH_ALL ()
-        {
-            CLEAR ();
-        }
-    }
-
-    ColumnWriterPostCopy ( self -> cw, ctx );
-}
-
-/* write row to destination */
-static
-void MapRowIdColWriterWrite ( MapRowIdColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint32_t i;
-
-    /* here is where the VALUE coming in, which is a row-id,
-       gets mapped to its new value before being written out */
-    assert ( elem_bits == sizeof * self -> row * 8 );
-    assert ( boff == 0 );
-
-    /* resize row if needed */
-    if ( self -> max_row_len < row_len )
-    {
-        MemFree ( ctx, self -> row, sizeof * self -> row * self -> max_row_len );
-
-        self -> max_row_len = ( row_len + 15 ) & ~ 15U;
-        ON_FAIL ( self -> row = MemAlloc ( ctx, sizeof * self -> row * self -> max_row_len, false ) )
-        {
-            ANNOTATE ( "failed to allocate memory for %u row-ids", self -> max_row_len );
-            return;
-        }
-    }
-
-    /* copy row */
-    memcpy ( self -> row, data, row_len * sizeof * self -> row );
-
-    /* map ids */
-    for ( i = 0; i < row_len; ++ i )
-    {
-        if ( self -> row [ i ] != 0 )
-        {
-            int64_t new_id;
-
-            /* map old row-id to new row-id */
-            ON_FAIL ( new_id = MapFileMapSingleOldToNew ( self -> idx, ctx, self -> row [ i ], self -> assign_ids ) )
-            {
-                ANNOTATE ( "failed to map source row-id %ld", self -> row [ i ] );
-                return;
-            }
-            if ( new_id == 0 )
-            {
-                rc_t rc = RC ( rcExe, rcColumn, rcWriting, rcId, rcNotFound );
-                ERROR ( rc, "failed to map source row-id %ld", self -> row [ i ] );
-                return;
-            }
-
-            self -> row [ i ] = new_id;
-        }
-    }
-
-    /* now write the translated ids */
-    ColumnWriterWrite ( self -> cw, ctx, sizeof * self -> row * 8, self -> row, 0, row_len );
-}
-
-static
-void MapRowIdColWriterWriteStatic ( MapRowIdColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-    rc_t rc = RC ( rcExe, rcColumn, rcWriting, rcType, rcIncorrect );
-    INTERNAL_ERROR ( rc, "writing to a non-static column" );
-}
-
-/* commit all writes */
-static
-void MapRowIdColWriterCommit ( MapRowIdColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    ColumnWriterCommit ( self -> cw, ctx );
-    MapRowIdColWriterDestroy ( self, ctx );
-}
-
-static ColumnWriter_vt MapRowIdColWriter_vt =
-{
-    MapRowIdColWriterWhack,
-    MapRowIdColWriterFullSpec,
-    MapRowIdColWriterPreCopy,
-    MapRowIdColWriterPostCopy,
-    MapRowIdColWriterWrite,
-    MapRowIdColWriterWriteStatic,
-    MapRowIdColWriterCommit
-};
-
-
-/* MakeMapRowIdWriter
- *  if "assign_ids" is true, the MapFile will be asked to
- *  map an old=>new id or assign (and record) a new id.
- */
-ColumnWriter *TablePairMakeMapRowIdWriter ( TablePair *self,
-    const ctx_t *ctx, ColumnWriter *cw, MapFile *idx, bool assign_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    MapRowIdColWriter *writer;
-
-    TRY ( writer = MemAlloc ( ctx, sizeof * writer, false ) )
-    {
-        TRY ( ColumnWriterInit ( & writer -> dad, ctx, & MapRowIdColWriter_vt, true ) )
-        {
-            writer -> max_row_len = 16;
-            TRY ( writer -> row = MemAlloc ( ctx, sizeof * writer -> row * writer -> max_row_len, false ) )
-            {
-                TRY ( writer -> idx = MapFileDuplicate ( idx, ctx ) )
-                {
-                    TRY ( writer -> cw = ColumnWriterDuplicate ( cw, ctx ) )
-                    {
-                        writer -> assign_ids = assign_ids;
-                        return & writer -> dad;
-                    }
-
-                    MapFileRelease ( writer -> idx, ctx );
-                }
-
-                ColumnWriterDestroy ( & writer -> dad, ctx );
-            }
-
-            MemFree ( ctx, writer -> row, sizeof * writer -> row * writer -> max_row_len );
-        }
-
-        MemFree ( ctx, writer, sizeof * writer );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/id-mapper-col.h b/tools/sra-sort/id-mapper-col.h
deleted file mode 100644
index ae5770f..0000000
--- a/tools/sra-sort/id-mapper-col.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_id_mapper_col_
-#define _h_sra_sort_id_mapper_col_
-
-#ifndef _h_sra_sort_col_pair_
-#include "col-pair.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct MapFile;
-struct TablePair;
-
-
-/*--------------------------------------------------------------------------
- * MapRowIdColWriter
- */
-
-
-/* MakeMapRowIdWriter
- *  if "assign_ids" is true, the MapFile will be asked to
- *  map an old=>new id or assign (and record) a new id.
- */
-ColumnWriter *TablePairMakeMapRowIdWriter ( struct TablePair *self,
-    const ctx_t *ctx, ColumnWriter *cw, struct MapFile *idx, bool assign_ids );
-
-
-#endif /* _h_sra_sort_id_mapper_col_ */
diff --git a/tools/sra-sort/idx-mapping.c b/tools/sra-sort/idx-mapping.c
deleted file mode 100644
index d1434aa..0000000
--- a/tools/sra-sort/idx-mapping.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "idx-mapping.h"
-#include "ctx.h"
-
-#include <klib/sort.h>
-
-FILE_ENTRY ( idx-mapping );
-
-
-/*--------------------------------------------------------------------------
- * IdxMapping
- *  
- */
-
-#if USE_OLD_KSORT
-
-int CC IdxMappingCmpOld ( const void *a, const void *b, void *data )
-{
-    const IdxMapping *ap = a;
-    const IdxMapping *bp = b;
-
-    if ( ap -> old_id < bp -> old_id )
-        return -1;
-    return ap -> old_id > bp -> old_id;
-}
-
-int CC IdxMappingCmpNew ( const void *a, const void *b, void *data )
-{
-    const IdxMapping *ap = a;
-    const IdxMapping *bp = b;
-
-    if ( ap -> new_id < bp -> new_id )
-        return -1;
-    return ap -> new_id > bp -> new_id;
-}
-
-#else /* USE_OLD_KSORT */
-
-#define T( x ) ( ( const IdxMapping* ) ( x ) )
-
-#define SWAP( a, b, off, size ) KSORT_TSWAP ( IdxMapping, a, b )
-
-
-void IdxMappingSortOld ( IdxMapping *self, const ctx_t *ctx, size_t count )
-{
-#define CMP( a, b ) \
-    ( ( T ( a ) -> old_id < T ( b ) -> old_id ) ? -1 : ( T ( a ) -> old_id > T ( b ) -> old_id ) )
-
-    KSORT ( self, count, sizeof * self, 0, sizeof * self );
-
-#undef CMP
-}
-
-void IdxMappingSortNew ( IdxMapping *self, const ctx_t *ctx, size_t count )
-{
-#define CMP( a, b ) \
-    ( ( T ( a ) -> new_id < T ( b ) -> new_id ) ? -1 : ( T ( a ) -> new_id > T ( b ) -> new_id ) )
-
-    KSORT ( self, count, sizeof * self, 0, sizeof * self );
-
-#undef CMP
-}
-
-#undef T
-#undef SWAP
-
-#endif /* USE_OLD_KSORT */
diff --git a/tools/sra-sort/idx-mapping.h b/tools/sra-sort/idx-mapping.h
deleted file mode 100644
index 7691526..0000000
--- a/tools/sra-sort/idx-mapping.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_idx_mapping_
-#define _h_sra_sort_idx_mapping_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * IdxMapping
- *  
- */
-typedef struct IdxMapping IdxMapping;
-struct IdxMapping
-{
-    int64_t old_id, new_id;
-};
-
-#if USE_OLD_KSORT
-
-/* ksort callbacks */
-int CC IdxMappingCmpOld ( const void *a, const void *b, void *data );
-int CC IdxMappingCmpNew ( const void *a, const void *b, void *data );
-
-#else
-
-/* ksort_inlines */
-void IdxMappingSortOld ( IdxMapping *self, const ctx_t *ctx, size_t count );
-void IdxMappingSortNew ( IdxMapping *self, const ctx_t *ctx, size_t count );
-
-#endif
-
-#endif /* _h_sra_sort_idx_mapping_ */
diff --git a/tools/sra-sort/map-file.c b/tools/sra-sort/map-file.c
deleted file mode 100644
index 209876f..0000000
--- a/tools/sra-sort/map-file.c
+++ /dev/null
@@ -1,1192 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "map-file.h"
-#include "idx-mapping.h"
-#include "ctx.h"
-#include "caps.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/buffile.h>
-#include <klib/refcount.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#include "except.h"
-
-FILE_ENTRY ( map-file );
-
-
-/*--------------------------------------------------------------------------
- * MapFile
- *  a file for storing id mappings
- */
-struct MapFile
-{
-    int64_t first_id;
-    uint64_t num_ids;
-    uint64_t num_mapped_ids;
-    int64_t max_new_id;
-    KFile *f_old, *f_new, *f_pos;
-    size_t id_size;
-    KRefcount refcount;
-};
-
-
-/* Whack
- */
-static
-void MapFileWhack ( MapFile *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    rc_t rc = KFileRelease ( self -> f_old );
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "KFileRelease failed on old=>new" );
-    else
-    {
-        rc = KFileRelease ( self -> f_new );
-        if ( rc != 0 )
-            ABORT ( rc, "KFileRelease failed on new=>old" );
-        else if ( self -> f_pos != NULL )
-        {
-            rc = KFileRelease ( self -> f_pos );
-            if ( rc != 0 )
-                ABORT ( rc, "KFileRelease failed on global poslen temp column" );
-        }
-        
-        MemFree ( ctx, self, sizeof * self );
-    }
-}
-
-
-/* Make
- *  creates an id map
- */
-static
-void MapFileMakeFork ( KFile **fp, const ctx_t *ctx, const char *name,
-    KDirectory *wd, const char *tmpdir, int pid, size_t bsize, const char *fork )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* create temporary KFile */
-    rc_t rc;
-    KFile *backing;
-
-    rc = KDirectoryCreateFile ( wd, & backing, true,
-        0600, kcmInit | kcmParents, "%s/sra-sort-%s.%s.%d", tmpdir, name, fork, pid );
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "failed to create %s id map file '%s'", fork, name );
-    else
-    {
-#if ! WINDOWS
-        /* never try to remove files on Windows */
-        if ( ctx -> caps -> tool -> unlink_idx_files )
-        {
-            /* unlink KFile */
-            rc = KDirectoryRemove ( wd, false, "%s/sra-sort-%s.%s.%d", tmpdir, name, fork, pid );
-            if ( rc != 0 )
-                WARN ( "failed to unlink %s id map file '%s'", fork, name );
-        }
-#endif
-
-        /* create a read/write buffer file */
-        rc = KBufFileMakeWrite ( fp, backing, true, bsize );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "failed to create buffer for %s id map file '%s'", fork, name );
-
-        KFileRelease ( backing );
-    }
-}
-
-static
-MapFile *MapFileMakeInt ( const ctx_t *ctx, const char *name, bool random, bool for_poslen )
-{
-    MapFile *mf;
-    TRY ( mf = MemAlloc ( ctx, sizeof * mf, true ) )
-    {
-        /* create KDirectory */
-        KDirectory *wd;
-        rc_t rc = KDirectoryNativeDir ( & wd );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "failed to create native directory" );
-        else
-        {
-            const Tool *tp = ctx -> caps -> tool;
-            size_t bsize = random ? tp -> map_file_random_bsize : tp -> map_file_bsize;
-
-            /* create old=>new id file */
-            TRY ( MapFileMakeFork ( & mf -> f_old, ctx, name, wd, tp -> tmpdir, tp -> pid, bsize, "old" ) )
-            {
-                TRY ( MapFileMakeFork ( & mf -> f_new, ctx, name, wd, tp -> tmpdir, tp -> pid, 32 * 1024, "new" ) )
-                {
-                    if ( for_poslen )
-                        MapFileMakeFork ( & mf -> f_pos, ctx, name, wd, tp -> tmpdir, tp -> pid, 32 * 1024, "pos" );
-
-                    KDirectoryRelease ( wd );
-
-                    if ( ! FAILED () )
-                    {
-                        /* this is our guy */
-                        KRefcountInit ( & mf -> refcount, 1, "MapFile", "make", name );
-                        
-                        return mf;
-                    }
-
-                    KFileRelease ( mf -> f_new );
-                }
-
-                KFileRelease ( mf -> f_old );
-            }
-
-            KDirectoryRelease ( wd );
-        }
-
-        MemFree ( ctx, mf, sizeof * mf );
-    }
-
-    return NULL;
-}
-
-MapFile *MapFileMake ( const ctx_t *ctx, const char *name, bool random )
-{
-    FUNC_ENTRY ( ctx );
-    return MapFileMakeInt ( ctx, name, random, false );
-}
-
-/* MakeForPoslen
- *  creates an id map with an additional poslen file
- *  this is specially for PRIMARY_ALIGNMENT_IDS and SECONDARY_ALIGNMENT_IDS
- *  that use *_ALIGNMENT global position and length as a sorting key
- *  we drop it to a file after its generation so that it can be
- *  picked up later when copying the corresponding alignment table.
- */
-MapFile *MapFileMakeForPoslen ( const ctx_t *ctx, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-    return MapFileMakeInt ( ctx, name, false, true );
-}
-
-
-/* Release
- */
-void MapFileRelease ( const MapFile *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "MapFile" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            MapFileWhack ( ( MapFile* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcFile, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release MapFile" );
-        }
-    }
-}
-
-/* Duplicate
- */
-MapFile *MapFileDuplicate ( const MapFile *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "MapFile" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcFile, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate MapFile" );
-            return NULL;
-        }
-    }
-
-    return ( MapFile* ) self;
-}
-
-
-/* SsetIdRange
- *  required second-stage initialization
- *  must be called before any writes occur
- */
-void MapFileSetIdRange ( MapFile *self, const ctx_t *ctx,
-    int64_t first_id, uint64_t num_ids )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcUpdating, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self" );
-    }
-    else if ( self -> max_new_id != 0 )
-    {
-        rc = RC ( rcExe, rcFile, rcUpdating, rcConstraint, rcViolated );
-        INTERNAL_ERROR ( rc, "cannot change id range after writing has begun" );
-    }
-    else
-    {
-        /* record new first id and count */
-        self -> first_id = first_id;
-        self -> num_ids = num_ids;
-
-        /* determine id size for all ids PLUS 0 for NULL */
-        for ( ++ num_ids, self -> id_size = 1; self -> id_size < 8; ++ self -> id_size )
-        {
-            if ( num_ids <= ( ( uint64_t ) 1 ) << ( self -> id_size * 8 ) )
-                break;
-        }
-    }
-}
-
-
-/* First
- *  return first mapped id
- */
-int64_t MapFileFirst ( const MapFile *self, const ctx_t *ctx )
-{
-    return self -> first_id;
-}
-
-
-/* Count
- *  return num_ids
- */
-uint64_t MapFileCount ( const MapFile *self, const ctx_t *ctx )
-{
-    return self -> num_ids;
-}
-
-
-/* SetOldToNew
- *  write old=>new id mappings
- */
-void MapFileSetOldToNew ( MapFile *self, const ctx_t *ctx, const IdxMapping *ids, size_t count )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( self -> num_ids == 0 )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcRange, rcUndefined );
-        INTERNAL_ERROR ( rc, "SetIdRange must be called with a non-empty range" );
-    }
-    else
-    {
-        size_t i;
-        for ( i = 0; i < count; ++ i )
-        {
-            size_t num_writ;
-            /* zero-based index */
-            int64_t old_id = ids [ i ] . old_id - self -> first_id;
-            /* position in bytes */
-            uint64_t pos = old_id * self -> id_size;
-            /* 1-based translated new-id */
-            int64_t new_id = ids [ i ] . new_id - self -> first_id + 1;
-            assert ( old_id >= 0 );
-            assert ( new_id >= 0 );
-#if __BYTE_ORDER == __BIG_ENDIAN
-            new_id = bswap_64 ( new_id );
-#endif
-            rc = KFileWriteAll ( self -> f_old, pos, & new_id, self -> id_size, & num_writ );
-            if ( rc != 0 )
-            {
-                SYSTEM_ERROR ( rc, "failed to write old=>new id mapping" );
-                break;
-            }
-
-            if ( num_writ != self -> id_size )
-            {
-                rc = RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                SYSTEM_ERROR ( rc, "failed to write old=>new id mapping" );
-                break;
-            }
-        }
-    }
-}
-
-
-/* SetNewToOld
- *  write new=>old id mappings
- */
-void MapFileSetNewToOld ( MapFile *self, const ctx_t *ctx, const IdxMapping *ids, size_t count )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( self -> num_ids == 0 )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcRange, rcUndefined );
-        INTERNAL_ERROR ( rc, "SetIdRange must be called with a non-empty range" );
-    }
-    else
-    {
-        if ( ! ctx -> caps -> tool -> write_new_to_old )
-            self -> max_new_id = self -> first_id + count - 1;
-        else
-        {
-            size_t i;
-            for ( i = 0; i < count; ++ i )
-            {
-                size_t num_writ;
-                /* zero based index */
-                int64_t new_id = ids [ i ] . new_id - self -> first_id;
-                /* zero based byte offset */
-                uint64_t pos = new_id * self -> id_size;
-                /* 1-based translated old-id */
-                int64_t old_id = ids [ i ] . old_id - self -> first_id + 1;
-                assert ( new_id >= 0 );
-                assert ( old_id >= 0 );
-#if __BYTE_ORDER == __BIG_ENDIAN
-                old_id = bswap_64 ( old_id );
-#endif
-                rc = KFileWriteAll ( self -> f_new, pos, & old_id, self -> id_size, & num_writ );
-                if ( rc != 0 )
-                {
-                    SYSTEM_ERROR ( rc, "failed to write new=>old id mapping" );
-                    break;
-                }
-                
-                if ( num_writ != self -> id_size )
-                {
-                    rc = RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                    SYSTEM_ERROR ( rc, "failed to write new=>old id mapping" );
-                    break;
-                }
-                
-                self -> max_new_id = new_id + self -> first_id;
-            }
-        }
-    }
-}
-
-
-/* SetPoslen
- *  write global position/length in new-id order
- */
-void MapFileSetPoslen ( MapFile *self, const ctx_t *ctx, const IdxMapping *ids, size_t count )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( self -> f_pos == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcFile, rcIncorrect );
-        INTERNAL_ERROR ( rc, "MapFile must be created with MapFileMakeForPoslen" );
-    }
-    else if ( self -> num_ids == 0 )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcRange, rcUndefined );
-        INTERNAL_ERROR ( rc, "SetIdRange must be called with a non-empty range" );
-    }
-    else
-    {
-        /* start writing after the last new id recorded */
-        uint64_t pos = ( self -> max_new_id - self -> first_id + 1 ) * sizeof ids -> new_id;
-
-        size_t i;
-        for ( i = 0; i < count; pos += sizeof ids -> new_id, ++ i )
-        {
-            size_t num_writ;
-            int64_t poslen = ids [ i ] . new_id;
-#if __BYTE_ORDER == __BIG_ENDIAN
-            poslen = bswap_64 ( poslen );
-#endif
-            rc = KFileWriteAll ( self -> f_pos, pos, & poslen, sizeof ids -> new_id, & num_writ );
-            if ( rc != 0 )
-            {
-                SYSTEM_ERROR ( rc, "failed to write poslen temporary column" );
-                break;
-            }
-
-            if ( num_writ != sizeof ids -> new_id )
-            {
-                rc = RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-                SYSTEM_ERROR ( rc, "failed to write poslen temporary column" );
-                break;
-            }
-        }
-    }
-}
-
-
-/* ReadPoslen
- *  read global position/length in new-id order
- *  starts reading at the indicated row
- *  returns the number read
- */
-size_t MapFileReadPoslen ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, uint64_t *poslen, size_t max_count )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t total = 0;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( self -> f_pos == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcFile, rcIncorrect );
-        INTERNAL_ERROR ( rc, "MapFile must be created with MapFileMakeForPoslen" );
-    }
-    /* the column is read until end, but
-       this is not an error. just return no-more-data */
-    else if ( start_id == self -> first_id + self -> num_ids )
-        return 0;
-    else if ( start_id < self -> first_id || start_id > self -> first_id + self -> num_ids )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcParam, rcInvalid );
-        INTERNAL_ERROR ( rc, "start_id ( %ld ) is not within column range ( %ld .. %ld )",
-            start_id, self -> first_id, self -> first_id + self -> num_ids - 1 );
-    }
-    else if ( max_count != 0 )
-    {
-        /* limit read to number of ids in index */
-        if ( start_id + max_count > self -> first_id + self -> num_ids )
-            max_count = ( size_t ) ( self -> first_id + self -> num_ids - start_id );
-
-        if ( poslen == NULL )
-        {
-            rc = RC ( rcExe, rcFile, rcReading, rcBuffer, rcNull );
-            INTERNAL_ERROR ( rc, "bad buffer parameter" );
-        }
-        else
-        {
-            /* read as many bytes of id as possible */
-            size_t num_read, to_read = max_count * sizeof * poslen;
-            uint64_t pos = ( start_id - self -> first_id ) * sizeof * poslen;
-            rc = KFileReadAll ( self -> f_pos, pos, poslen, to_read, & num_read );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "failed to read new=>old map" );
-            else
-            {
-                total = ( size_t ) ( num_read / sizeof * poslen );
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-                {
-                    /* revert byte-order */
-                    size_t i;
-                    for ( i = 0; i < total; ++ i )
-                        poslen [ i ] = bswap_64 ( poslen [ i ] );
-                }
-#endif
-            }
-        }
-    }
-
-    return total;
-}
-
-
-/* AllocMissingNewIds
- *  it is possible to have written fewer new=>old mappings
- *  than are supposed to be there, e.g. SEQUENCE that gets
- *  initially written by align tables. unaligned sequences
- *  need to fill in the remainder.
- */
-static
-size_t make_missing_entry ( MapFile *self, const ctx_t *ctx,
-    IdxMapping *missing, size_t i, size_t max_missing_ids,
-    int64_t old_id, int64_t new_id )
-{
-    if ( i == max_missing_ids )
-    {
-        ON_FAIL ( MapFileSetNewToOld ( self, ctx, missing, i ) )
-            return i;
-
-        i = 0;
-    }
-
-    /* insert into missing id map */
-    missing [ i ] . old_id = old_id;
-    missing [ i ] . new_id = new_id;
-
-    /* update old=>new mapping */
-    MapFileSetOldToNew ( self, ctx, & missing [ i ], 1 );
-
-    return i + 1;
-}
-
-int64_t MapFileAllocMissingNewIds ( MapFile *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    int64_t first_allocated = 0;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcUpdating, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( self -> num_ids == 0 )
-    {
-        rc = RC ( rcExe, rcFile, rcWriting, rcRange, rcUndefined );
-        INTERNAL_ERROR ( rc, "SetIdRange must be called with a non-empty range" );
-    }
-    else
-    {
-        uint64_t num_missing_ids = self -> num_ids - ( self -> max_new_id - self -> first_id + 1 );
-        if ( num_missing_ids != 0 )
-        {
-            IdxMapping *missing;
-
-            /* determine maximum missing id mappings */
-            size_t max_missing_ids = ctx -> caps -> tool -> max_missing_ids;
-            if ( ( uint64_t ) max_missing_ids > num_missing_ids )
-                max_missing_ids = ( size_t ) num_missing_ids;
-
-            /* allocate a buffer of IdxMapping */
-            TRY ( missing = MemAlloc ( ctx, sizeof * missing * max_missing_ids, false ) )
-            {
-                /* use a scan buffer somewhere around 32K,
-                   to keep page-file cache focused on a few pages */
-                void *scan_buffer;
-                const size_t scan_buffer_size = 32 * 1024;
-                TRY ( scan_buffer = MemAlloc ( ctx, scan_buffer_size, false ) )
-                {
-                    size_t i, num_read;
-                    int64_t new_id, old_id = self -> first_id;
-                    uint64_t eof = self -> num_ids * self -> id_size;
-
-                    /* this guy will be used to assign new ids */
-                    int64_t max_new_id = self -> max_new_id;
-                    int64_t entry_max_new_id = self -> max_new_id;
-
-
-                    /* in a loop, read as many ids as possible into scan buffer
-                       the number is dependent upon self->id_size */
-                    for ( i = 0; ; old_id += num_read )
-                    {
-                        size_t j, to_read;
-
-                        /* determine position from old_id */
-                        uint64_t pos = ( old_id - self -> first_id ) * self -> id_size;
-                        if ( pos == eof )
-                            break;
-
-                        /* determine bytes to read - this must be limited
-                           or we risk tricking page-buffer into resizing */
-                        to_read = scan_buffer_size;
-                        if ( pos + to_read > eof )
-                            to_read = ( size_t ) ( eof - pos );
-
-                        /* read as many bytes as we can */
-                        rc = KFileReadAll ( self -> f_old, pos, scan_buffer, to_read, & num_read );
-                        if ( rc != 0 )
-                        {
-                            SYSTEM_ERROR ( rc, "failed to read old=>new map" );
-                            break;
-                        }
-
-                        /* convert to count */                        
-                        num_read /= self -> id_size;
-                        if ( num_read == 0 )
-                        {
-                            rc = RC ( rcExe, rcFile, rcReading, rcTransfer, rcIncomplete );
-                            SYSTEM_ERROR ( rc, "failed to read old=>new map" );
-                            break;
-                        }
-
-                        /* scan for zeros, and for every zero found,
-                           make entry into IdxMapping table, writing
-                           new-id back to old=>new map */
-                        switch ( self -> id_size )
-                        {
-                        case 1:
-                            for ( j = 0; j < num_read; ++ j )
-                            {
-                                if ( ( ( const uint8_t* ) scan_buffer ) [ j ] == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            break;
-                        case 2:
-                            for ( j = 0; j < num_read; ++ j )
-                            {
-                                if ( ( ( const uint16_t* ) scan_buffer ) [ j ] == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            break;
-                        case 3:
-                            for ( num_read *= 3, j = 0; j < num_read; j += 3 )
-                            {
-                                if ( ( ( const uint8_t* ) scan_buffer ) [ j + 0 ] == 0 &&
-                                     ( ( const uint8_t* ) scan_buffer ) [ j + 1 ] == 0 &&
-                                     ( ( const uint8_t* ) scan_buffer ) [ j + 2 ] == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j / 3, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            num_read /= 3;
-                            break;
-                        case 4:
-                            for ( j = 0; j < num_read; ++ j )
-                            {
-                                if ( ( ( const uint32_t* ) scan_buffer ) [ j ] == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            break;
-                        case 8:
-                            for ( j = 0; j < num_read; ++ j )
-                            {
-                                if ( ( ( const uint64_t* ) scan_buffer ) [ j ] == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            break;
-                        default:
-                            for ( num_read *= self -> id_size, j = 0; j < num_read; j += self -> id_size )
-                            {
-                                new_id = 0;
-                                memcpy ( & new_id, & ( ( const uint8_t* ) scan_buffer ) [ j ], self -> id_size );
-                                if ( new_id == 0 )
-                                {
-                                    ON_FAIL ( i = make_missing_entry ( self, ctx, missing,
-                                              i, max_missing_ids, old_id + j / self -> id_size, ++ max_new_id ) )
-                                        break;
-                                }
-                            }
-                            num_read /= self -> id_size;
-                        }
-                    }
-
-                    if ( ! FAILED () && i != 0 )
-                        MapFileSetNewToOld ( self, ctx, missing, i );
-
-                    assert ( FAILED () || self -> max_new_id == max_new_id );
-
-                    if ( max_new_id != entry_max_new_id )
-                        first_allocated = entry_max_new_id + 1;
-
-                    MemFree ( ctx, scan_buffer, scan_buffer_size );
-                }
-
-                MemFree ( ctx, missing, sizeof * missing * max_missing_ids );
-            }
-        }
-    }
-
-    return first_allocated;
-}
-
-
-/* ReadNewToOld
- *  reads a bunch of new=>old mappings
- */
-static
-size_t MapFileReadNewToOld ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, IdxMapping *ids, size_t max_count )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t total = 0;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    /* the new=>old mapping is read until end, but
-       this is not an error. just return no-more-data */
-    else if ( start_id == self -> first_id + self -> num_ids )
-        return 0;
-    else if ( start_id < self -> first_id || start_id > self -> first_id + self -> num_ids )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcParam, rcInvalid );
-        INTERNAL_ERROR ( rc, "start_id ( %ld ) is not within map range ( %ld .. %ld )",
-            start_id, self -> first_id, self -> first_id + self -> num_ids - 1 );
-    }
-    else if ( max_count != 0 )
-    {
-        /* limit read to number of ids in index */
-        if ( start_id + max_count > self -> first_id + self -> num_ids )
-            max_count = ( size_t ) ( self -> first_id + self -> num_ids - start_id );
-
-        if ( ids == NULL )
-        {
-            rc = RC ( rcExe, rcFile, rcReading, rcBuffer, rcNull );
-            INTERNAL_ERROR ( rc, "bad buffer parameter" );
-        }
-        else
-        {
-            /* read as many bytes of id as possible */
-            size_t num_read, to_read = max_count * self -> id_size;
-            uint64_t pos = ( start_id - self -> first_id ) * self -> id_size;
-            rc = KFileReadAll ( self -> f_new, pos, ids, to_read, & num_read );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "failed to read new=>old map" );
-            else
-            {
-                size_t i;
-                const char *packed = ( const char* ) ids;
-                total = ( size_t ) ( num_read /self -> id_size );
-
-                /* read each packed id as little-endian integer onto
-                   pre-zeroed 64-bit integer, swap if needed */
-                for ( num_read = total * self -> id_size, i = total; i > 0; )
-                {
-                    int64_t unpacked = 0;
-
-                    num_read -= self -> id_size;
-                    -- i;
-
-                    memcpy ( & unpacked, & packed [ num_read ], self -> id_size );
-#if __BYTE_ORDER == __BIG_ENDIAN
-                    unpacked = bswap_64 ( unpacked );
-#endif
-                    if ( unpacked != 0 )
-                        unpacked += self -> first_id - 1;
-
-                    ids [ i ] . old_id = unpacked;
-                    ids [ i ] . new_id = start_id + i;
-                }
-            }
-        }
-    }
-
-    return total;
-}
-
-
-/* SelectOldToNewPairs
- *  specify the range of new ids to select from
- *  read them in old=>new order
- */
-size_t MapFileSelectOldToNewPairs ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, IdxMapping *ids, size_t max_count )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint64_t eof;
-    int64_t end_excl;
-    size_t i, j, total;
-
-    /* limit read to number of ids in index */
-    if ( start_id + max_count > self -> first_id + self -> num_ids )
-        max_count = ( size_t ) ( self -> first_id + self -> num_ids - start_id );
-
-    /* range is start_id to end_excl */
-    end_excl = start_id + max_count;
-
-    /* eof for f_old */
-    eof = self -> num_ids * self -> id_size;
-
-    for ( total = i = 0; i < max_count; total += j )
-    {
-        rc_t rc;
-        size_t off, num_read;
-        char buff [ 32 * 1024 ];
-
-        /* read some data from file */
-        uint64_t pos = total * self -> id_size;
-        size_t to_read = sizeof buff;
-	if ( pos == eof )
-	    break;
-        if ( pos + to_read > eof )
-            to_read = ( size_t ) ( eof - pos );
-        rc = KFileReadAll ( self -> f_old, pos, buff, to_read, & num_read );
-        if ( rc != 0 )
-        {
-            SYSTEM_ERROR ( rc, "failed to read old=>new map" );
-            break;
-        }
-
-        /* reached end - requested more ids than we have */
-        if ( num_read == 0 )
-            break;
-
-        /* the number of whole ids actually read */
-        if ( ( num_read /= self -> id_size ) == 0 )
-        {
-            rc = RC ( rcExe, rcFile, rcReading, rcTransfer, rcIncomplete );
-            SYSTEM_ERROR ( rc, "failed to read old=>new map - file incomplete" );
-            break;
-        }
-
-        /* select new-ids from ids read */
-        for ( off = j = 0; j < num_read; off += self -> id_size, ++ j )
-        {
-            int64_t unpacked = 0;
-            memcpy ( & unpacked, & buff [ off ], self -> id_size );
-#if __BYTE_ORDER == __BIG_ENDIAN
-            unpacked = bswap_64 ( unpacked );
-#endif
-            /* only offset non-zero (NULL) ids */
-            if ( unpacked != 0 )
-                unpacked += self -> first_id - 1;
-
-            /* if id meets criteria */
-            if ( unpacked >= start_id && unpacked < end_excl )
-            {
-                ids [ i ] . old_id = self -> first_id + total + j;
-                ids [ i ] . new_id = unpacked;
-                if ( ++ i == max_count )
-                    break;
-            }
-        }
-    }
-
-    return i;
-}
-
-
-/* SelectOldToNewSingle
- *  specify the range of new ids to select from
- *  read them in old=>new order
- */
-size_t MapFileSelectOldToNewSingle ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, int64_t *ids, uint32_t *opt_ord, size_t max_count )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint64_t eof;
-    int64_t end_excl;
-    size_t i, j, total;
-
-    /* limit read to number of ids in index */
-    if ( start_id + max_count > self -> first_id + self -> num_ids )
-        max_count = ( size_t ) ( self -> first_id + self -> num_ids - start_id );
-
-    /* range is start_id to end_excl */
-    end_excl = start_id + max_count;
-
-    /* eof for f_old */
-    eof = self -> num_ids * self -> id_size;
-
-    for ( total = i = 0; i < max_count; total += j )
-    {
-        rc_t rc;
-        size_t off, num_read;
-        char buff [ 32 * 1024 ];
-
-        /* read some data from file */
-        uint64_t pos = total * self -> id_size;
-        size_t to_read = sizeof buff;
-	if ( pos == eof )
-            break;
-        if ( pos + to_read > eof )
-            to_read = ( size_t ) ( eof - pos );
-        rc = KFileReadAll ( self -> f_old, pos, buff, to_read, & num_read );
-        if ( rc != 0 )
-        {
-            SYSTEM_ERROR ( rc, "failed to read old=>new map" );
-            break;
-        }
-
-        /* reached end - requested more ids than we have */
-        if ( num_read == 0 )
-            break;
-
-        /* the number of whole ids actually read */
-        if ( ( num_read /= self -> id_size ) == 0 )
-        {
-            rc = RC ( rcExe, rcFile, rcReading, rcTransfer, rcIncomplete );
-            SYSTEM_ERROR ( rc, "failed to read old=>new map - file incomplete" );
-            break;
-        }
-
-        /* select new-ids from ids read */
-        for ( off = j = 0; j < num_read; off += self -> id_size, ++ j )
-        {
-            int64_t unpacked = 0;
-            memcpy ( & unpacked, & buff [ off ], self -> id_size );
-#if __BYTE_ORDER == __BIG_ENDIAN
-            unpacked = bswap_64 ( unpacked );
-#endif
-            /* only offset non-zero (NULL) ids */
-            if ( unpacked != 0 )
-                unpacked += self -> first_id - 1;
-
-            /* if id meets criteria */
-            if ( unpacked >= start_id && unpacked < end_excl )
-            {
-                ids [ i ] = self -> first_id + total + j;
-                assert ( i <= 0xFFFFFFFF );
-                if ( opt_ord != NULL )
-                    opt_ord [ unpacked - start_id ] = ( uint32_t ) i;
-                if ( ++ i == max_count )
-                    break;
-            }
-        }
-    }
-
-    return i;
-}
-
-
-/* MapSingleOldToNew
- *  reads a single old=>new mapping
- *  returns new id or 0 if not found
- *  optionally allocates a new id if "insert" is true
- */
-int64_t MapFileMapSingleOldToNew ( MapFile *self, const ctx_t *ctx,
-    int64_t old_id, bool insert )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    int64_t new_id = 0;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad self reference" );
-    }
-    else if ( old_id < self -> first_id || old_id >= self -> first_id + self -> num_ids )
-    {
-        rc = RC ( rcExe, rcFile, rcReading, rcParam, rcInvalid );
-        INTERNAL_ERROR ( rc, "old_id ( %ld ) is not within map range ( %ld .. %ld )",
-            old_id, self -> first_id, self -> first_id + self -> num_ids - 1 );
-    }
-    else
-    {
-        size_t num_read, to_read = self -> id_size;
-        uint64_t pos = ( old_id - self -> first_id ) * self -> id_size;
-        rc = KFileReadAll ( self -> f_old, pos, & new_id, to_read, & num_read );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "failed to read old=>new map" );
-        else
-        {
-#if __BYTE_ORDER == __BIG_ENDIAN
-            new_id = bswap_64 ( new_id );
-#endif
-            if ( new_id != 0 )
-                new_id += self -> first_id - 1;
-            else if ( insert )
-            {
-                /* create a mapping using the last known
-                   new id plus one as the id to assign on insert */
-                IdxMapping mapping;
-                mapping . old_id = old_id;
-                mapping . new_id = self -> max_new_id + 1;
-
-                TRY ( MapFileSetOldToNew ( self, ctx, & mapping, 1 ) )
-                {
-                    TRY ( MapFileSetNewToOld ( self, ctx, & mapping, 1 ) )
-                    {
-                        new_id = mapping . new_id;
-
-                        if ( self -> num_ids >= 100000 )
-                        {
-                            uint64_t scaled = ++ self -> num_mapped_ids * 100;
-                            uint64_t prior = scaled - 100;
-                            if ( ( prior / self -> num_ids ) != ( scaled /= self -> num_ids ) )
-                                STATUS ( 2, "have mapped %lu%% ids", scaled );
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return new_id;
-}
-
-
-/* ConsistencyCheck
- */
-static
-void MapFileCrossCheck ( const MapFile *self, const ctx_t *ctx, IdxMapping *ids, size_t max_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    uint64_t total;
-    size_t num_read;
-    int64_t last_old, last_new;
-
-    for ( last_old = last_new = -1, total = 0; total < self -> num_ids; total += num_read )
-    {
-        int64_t id;
-        size_t i;
-
-        STATUS ( 2, "reading new=>old ids" );
-
-        ON_FAIL ( num_read = MapFileReadNewToOld ( self, ctx, self -> first_id + total, ids, max_ids ) )
-        {
-            ANNOTATE ( "failed to read new=>old ids" );
-            return;
-        }
-
-        STATUS ( 2, "read %,u pairs", num_read );
-
-        STATUS ( 2, "checking for repeats in new-id space" );
-        for ( i = 0; i < num_read; last_new = id, ++ i )
-        {
-            id = ids [ i ] . new_id;
-            if ( id == last_new )
-            {
-                rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcDuplicate );
-                ERROR ( rc, "new id %,ld repeats", id );
-                return;
-            }
-        }
-
-        STATUS ( 2, "sorting on old id" );
-
-#if USE_OLD_KSORT
-        ksort ( ids, num_read, sizeof ids [ 0 ], IdxMappingCmpOld, ( void* ) ctx );
-#else
-        IdxMappingSortOld ( ids, ctx, num_read );
-#endif
-
-        STATUS ( 2, "checking for repeats in old-id space" );
-        for ( i = 0; i < num_read; last_old = id, ++ i )
-        {
-            id = ids [ i ] . old_id;
-            if ( id == last_old )
-            {
-                rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcDuplicate );
-                ERROR ( rc, "old id %,ld repeats", id );
-                return;
-            }
-        }
-
-        STATUS ( 2, "cross-checking against old=>new index" );
-
-        for ( i = 0; i < num_read; ++ i )
-        {
-            int64_t new_id;
-
-            /* cast away const on "self" for prototype,
-               but function is only non-const if "insert"
-               were true - we use "false" */
-            ON_FAIL ( new_id = MapFileMapSingleOldToNew ( ( MapFile* ) self, ctx, ids [ i ] . old_id, false ) )
-                return;
-
-            if ( new_id != ids [ i ] . new_id )
-            {
-                rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcUnequal );
-                ERROR ( rc, "mismatch of new ids %,ld != %,ld", new_id, ids [ i ] . new_id );
-                return;
-            }
-        }
-    }
-}
-
-void MapFileConsistencyCheck ( const MapFile *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    IdxMapping *ids;
-    const size_t max_ids = 1024 * 1024;
-
-    STATUS ( 2, "running consistency check on index files" );
-
-    /* "self" is valid */
-    if ( self == NULL )
-    {
-        ANNOTATE ( "checking the validity of a NULL MapFile" );
-        return;
-    }
-
-    STATUS ( 2, "checking id_size" );
-
-    /* number of ids requires some number of bits */
-    if ( ( ( uint64_t ) 1 << ( self -> id_size * 8 ) ) < self -> num_ids )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcSize, rcIncorrect );
-        ERROR ( rc, "calculated id size ( %zu bytes ) is insufficient to represent count of %,lu ids",
-                self -> id_size, self -> num_ids );
-        return;
-    }
-
-    STATUS ( 2, "allocating id buffer" );
-
-    TRY ( ids = MemAlloc ( ctx, sizeof * ids * max_ids, false ) )
-    {
-        MapFileCrossCheck ( self, ctx, ids, max_ids );
-        MemFree ( ctx, ids, sizeof * ids * max_ids );
-    }
-    CATCH_ALL ()
-    {
-        ANNOTATE ( "failed to allocate memory ( %zu pairs ) for consistency check", max_ids );
-        return;
-    }
-
-    STATUS ( 2, "finished idx consistency check" );
-}
diff --git a/tools/sra-sort/map-file.h b/tools/sra-sort/map-file.h
deleted file mode 100644
index 992d765..0000000
--- a/tools/sra-sort/map-file.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_map_file_
-#define _h_sra_sort_map_file_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct IdxMapping;
-
-
-/*--------------------------------------------------------------------------
- * MapFile
- *  a file for storing id mappings
- */
-typedef struct MapFile MapFile;
-
-
-/* Make
- *  creates an id map
- */
-MapFile *MapFileMake ( const ctx_t *ctx, const char *name, bool random_access );
-
-
-/* MakeForPoslen
- *  creates an id map with an additional poslen file
- *  this is specially for PRIMARY_ALIGNMENT_IDS and SECONDARY_ALIGNMENT_IDS
- *  that use *_ALIGNMENT global position and length as a sorting key
- *  we drop it to a file after its generation so that it can be
- *  picked up later when copying the corresponding alignment table.
- */
-MapFile *MapFileMakeForPoslen ( const ctx_t *ctx, const char *name );
-
-
-/* Release
- */
-void MapFileRelease ( const MapFile *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-MapFile *MapFileDuplicate ( const MapFile *self, const ctx_t *ctx );
-
-
-/* SetIdRange
- *  required second-stage initialization
- *  must be called before any writes occur
- */
-void MapFileSetIdRange ( MapFile *self, const ctx_t *ctx,
-    int64_t first_id, uint64_t num_ids );
-
-
-/* First
- *  return first mapped id
- * Count
- *  return number of ids
- */
-int64_t MapFileFirst ( const MapFile *self, const ctx_t *ctx );
-uint64_t MapFileCount ( const MapFile *self, const ctx_t *ctx );
-
-
-/* SetOldToNew
- *  write new=>old id mappings
- */
-void MapFileSetOldToNew ( MapFile *self, const ctx_t *ctx,
-    struct IdxMapping const *ids, size_t count );
-
-
-/* SetNewToOld
- *  write new=>old id mappings
- */
-void MapFileSetNewToOld ( MapFile *self, const ctx_t *ctx,
-    struct IdxMapping const *ids, size_t count );
-
-
-/* SetPoslen
- *  write global position/length in new-id order
- */
-void MapFileSetPoslen ( MapFile *self, const ctx_t *ctx,
-    struct IdxMapping const *ids, size_t count );
-
-
-/* ReadPoslen
- *  read global position/length in new-id order
- *  starts reading at the indicated row
- *  returns the number read
- */
-size_t MapFileReadPoslen ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, uint64_t *poslen, size_t max_count );
-
-
-/* AllocMissingNewIds
- *  it is possible to have written fewer new=>old mappings
- *  than are supposed to be there, e.g. SEQUENCE that gets
- *  initially written by align tables. unaligned sequences
- *  need to fill in the remainder.
- *
- *  returns the first newly allocated id
- */
-int64_t MapFileAllocMissingNewIds ( MapFile *self, const ctx_t *ctx );
-
-
-/* SelectOldToNewPairs
- *  specify the range of new ids to select from
- *  read them in old=>new order
- */
-size_t MapFileSelectOldToNewPairs ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, struct IdxMapping *ids, size_t max_count );
-
-
-/* SelectOldToNewSingle
- *  specify the range of new ids to select from
- *  read them in old=>new order
- */
-size_t MapFileSelectOldToNewSingle ( const MapFile *self, const ctx_t *ctx,
-    int64_t start_id, int64_t *ids, uint32_t *opt_ord, size_t max_count );
-
-
-/* MapSingleOldToNew
- *  reads a single old=>new mapping
- *  returns new id or 0 if not found
- *  optionally allocates a new id if "insert" is true
- */
-int64_t MapFileMapSingleOldToNew ( MapFile *self, const ctx_t *ctx,
-    int64_t old_id, bool insert );
-
-
-/* MapMultipleOldToNew
- *  reads a single old=>new mapping
- *  returns new id or 0 if not found
- *  optionally allocates a new id if "insert" is true
- */
-void MapFileMapMultipleOldToNew ( MapFile *self, const ctx_t *ctx,
-    int64_t *ids, size_t count, bool insert );
-
-
-/* ConsistencyCheck
- *  should be const, but MapFileOldToNew claims to be non-const
- *  and is used within. only non-const if "insert" is true.
- */
-void MapFileConsistencyCheck ( const MapFile *self, const ctx_t *ctx );
-
-
-#endif
diff --git a/tools/sra-sort/mapping-row-set.c b/tools/sra-sort/mapping-row-set.c
deleted file mode 100644
index 6e69549..0000000
--- a/tools/sra-sort/mapping-row-set.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct MappingRowSet MappingRowSet;
-#define ROWSET_IMPL MappingRowSet
-
-typedef struct MappingRowSetIterator MappingRowSetIterator;
-#define ROWSET_ITER_IMPL MappingRowSetIterator
-
-#include "row-set-priv.h"
-#include "tbl-pair.h"
-#include "idx-mapping.h"
-#include "map-file.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <klib/rc.h>
-
-FILE_ENTRY ( mapping-row-set );
-
-
-/*--------------------------------------------------------------------------
- * MappingRowSetIterator
- *  interface to iterate RowSets
- */
-struct MappingRowSetIterator
-{
-    RowSetIterator dad;
-
-    /* base row-id */
-    int64_t row_id;
-
-    /* last row-id + 1 */
-    int64_t last_excl;
-
-    /* takes its input from new=>old index */
-    const MapFile *idx;
-
-    /* working data within map */
-    IdxMapping *map;
-    size_t max_elems;
-    size_t num_elems;
-
-    bool large;
-};
-
-/*--------------------------------------------------------------------------
- * MappingRowSet
- *  implementation of RowSet based upon auto-generated id pairs
- */
-struct MappingRowSet
-{
-    RowSet dad;
-
-    /* keep-alive reference */
-    MappingRowSetIterator *iter;
-
-    /* working data within map */
-    IdxMapping *map;
-    size_t num_elems;
-    size_t cur_elem;
-};
-
-static
-void MappingRowSetWhack ( MappingRowSet *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    RowSetIteratorRelease ( & self -> iter -> dad, ctx );
-    MemFree ( ctx, self, sizeof *self );
-}
-
-static
-size_t MappingRowSetNextStat ( MappingRowSet *self, const ctx_t *ctx,
-    int64_t *ids, size_t max_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* the starting row-id is taken from row-set-iterator
-       and offset by our current element counter */
-    int64_t row_id = self -> iter -> row_id + self -> cur_elem;
-
-    /* limit id generation to request */
-    size_t i, to_set = self -> num_elems - self -> cur_elem;
-    if ( to_set > max_ids )
-        to_set = max_ids;
-
-    /* fill request with serial numbers
-       could just as easily be the same number
-       the important thing is to limit the count
-       and produce the correct range */
-    for ( i = 0; i < to_set; ++ i )
-        ids [ i ] = row_id + i;
-
-    /* advance counter */
-    self -> cur_elem += to_set;
-    return to_set;
-}
-
-static
-size_t MappingRowSetNextPhys ( MappingRowSet *self, const ctx_t *ctx,
-    int64_t *ids, size_t max_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* limit copy to request */
-    size_t i, to_copy = self -> num_elems - self -> cur_elem;
-    if ( to_copy > max_ids )
-        to_copy = max_ids;
-
-    /* copy out old-ids */
-    for ( i = 0; i < to_copy; ++ i )
-        ids [ i ] = self -> map [ self -> cur_elem + i ] . old_id;
-
-    /* advance counter */
-    self -> cur_elem += to_copy;
-    return to_copy;
-}
-
-static
-void MappingRowSetReset ( MappingRowSet *self, const ctx_t *ctx, bool for_static );
-
-static RowSet_vt MappingRowSetPhys_vt =
-{
-    MappingRowSetWhack,
-    MappingRowSetNextPhys,
-    MappingRowSetReset
-};
-
-static RowSet_vt MappingRowSetStat_vt =
-{
-    MappingRowSetWhack,
-    MappingRowSetNextStat,
-    MappingRowSetReset
-};
-
-static
-void MappingRowSetReset ( MappingRowSet *self, const ctx_t *ctx, bool for_static )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( for_static )
-    {
-        /* go static */
-        self -> dad . vt = & MappingRowSetStat_vt;
-    }
-    else
-    {
-        size_t i, max_elems;
-        MappingRowSetIterator *iter = self -> iter;
-
-        /* go physical */
-        self -> dad . vt = & MappingRowSetPhys_vt;
-
-        /* limit id generation */
-        max_elems = iter -> max_elems;
-        if ( iter -> row_id + max_elems >= iter -> last_excl )
-            max_elems = ( size_t ) ( iter -> last_excl - iter -> row_id );
-
-        STATUS ( 4, "auto-generating %,zu ( old_id, new_id ) pairs where new_id >= %ld",
-                 max_elems, iter -> row_id );
-        for ( i = 0; i < max_elems; ++ i )
-            iter -> map [ i ] . old_id = iter -> map [ i ] . new_id = iter -> row_id + i;
-
-        self -> num_elems = iter -> num_elems = max_elems;
-    }
-
-    /* ready */
-    self -> cur_elem = 0;
-}
-
-static
-void MapFileMappingRowSetReset ( MappingRowSet *self, const ctx_t *ctx, bool for_static );
-
-static RowSet_vt MapFileMappingRowSetPhys_vt =
-{
-    MappingRowSetWhack,
-    MappingRowSetNextPhys,
-    MapFileMappingRowSetReset
-};
-
-static RowSet_vt MapFileMappingRowSetStat_vt =
-{
-    MappingRowSetWhack,
-    MappingRowSetNextStat,
-    MapFileMappingRowSetReset
-};
-
-static
-void MapFileMappingRowSetReset ( MappingRowSet *self, const ctx_t *ctx, bool for_static )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( for_static )
-    {
-        /* go static */
-        self -> dad . vt = & MapFileMappingRowSetStat_vt;
-    }
-    else
-    {
-        MappingRowSetIterator *iter = self -> iter;
-
-        /* go physical */
-        self -> dad . vt = & MapFileMappingRowSetPhys_vt;
-
-        /* read new-ids from file, selecting only those within range */
-        STATUS ( 3, "selecting first %,zu ( old_id, new_id ) pairs from old=>new where new_id >= %,ld",
-                 iter -> max_elems, iter -> row_id );
-        ON_FAIL ( iter -> num_elems = MapFileSelectOldToNewPairs ( iter -> idx, ctx,
-                      iter -> row_id, iter -> map, iter -> max_elems ) )
-            return;
-
-        self -> num_elems = iter -> num_elems;
-        STATUS ( 3, "selected %,zu ( old_id, new_id ) pairs", self -> num_elems );
-    }
-
-    /* ready */
-    self -> cur_elem = 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * MappingRowSetIterator
- *  interface to iterate RowSets
- */
-
-static
-void MappingRowSetIteratorWhack ( MappingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> map != NULL )
-        MemFree ( ctx, self -> map, sizeof self -> map [ 0 ] * self -> max_elems );
-
-    RowSetIteratorDestroy ( & self -> dad, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-void MapFileMappingRowSetIteratorWhack ( MappingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> map != NULL )
-        MemFree ( ctx, self -> map, sizeof self -> map [ 0 ] * self -> max_elems );
-
-    MapFileRelease ( self -> idx, ctx );
-
-    RowSetIteratorDestroy ( & self -> dad, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-RowSet *MappingRowSetIteratorMakeTheRowSet ( MappingRowSetIterator *self, const ctx_t *ctx, const RowSet_vt *vt )
-{
-    FUNC_ENTRY ( ctx );
-
-    MappingRowSet *rs;
-    TRY ( rs = MemAlloc ( ctx, sizeof * rs, false ) )
-    {
-        TRY ( RowSetInit ( & rs -> dad, ctx, vt ) )
-        {
-            /* initialize the row-set with map and self reference */
-            rs -> map = self -> map;
-            rs -> iter = ( MappingRowSetIterator* ) RowSetIteratorDuplicate ( & self -> dad, ctx );
-            rs -> num_elems = self -> num_elems;
-            rs -> cur_elem = 0;
-            return & rs -> dad;
-        }
-
-        MemFree ( ctx, rs, sizeof * rs );
-    }
-
-    return NULL;
- }
-
-static
-struct IdxMapping *MappingRowSetIteratorGetIdxMapping ( MappingRowSetIterator *self, const ctx_t *ctx, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> map == NULL )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcAccessing, rcSelf, rcInconsistent );
-        ERROR ( rc, "IdxMapping array is NULL" );
-        if ( num_items != NULL )
-            * num_items = 0;
-        return NULL;
-    }
-
-    if ( num_items != NULL )
-        * num_items = self -> num_elems;
-    return self -> map;
-}
-
-static
-int64_t *MappingRowSetIteratorGetSourceIds ( MappingRowSetIterator *self, const ctx_t *ctx, uint32_t **opt_ord, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    ANNOTATE ( "CALLING GetSourceIds ON MAPPING ROWSET ITERATOR" );
-
-    if ( opt_ord != NULL )
-        * opt_ord = NULL;
-
-    if ( num_items != NULL )
-        * num_items = 0;
-
-    return NULL;
-}
-
-static
-void MappingRowSetIteratorAllocMap ( MappingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* determine the maximum number of elements */
-    const Tool *tp = ctx -> caps -> tool;
-    uint64_t count = self -> last_excl - self -> row_id;
-    self -> max_elems = self -> large ? tp -> max_large_idx_ids : tp -> max_idx_ids;
-    if ( ( uint64_t ) self -> max_elems > count )
-        self -> max_elems = ( size_t ) count;
-
-    /* try to allocate the memory
-       this may be limited by the MemBank */
-    do
-    {
-        CLEAR ();
-
-        TRY ( self -> map = MemAlloc ( ctx, sizeof self -> map [ 0 ] * self -> max_elems, false ) )
-        {
-            STATUS ( 4, "allocated mapping array of %,u elements", self -> max_elems );
-            return;
-        }
-
-        self -> max_elems >>= 1;
-    }
-    while ( self -> max_elems >= ctx -> caps -> tool -> min_idx_ids );
-
-    ANNOTATE ( "failed to allocate map for row-set" );
-}
-
-static
-RowSet *MappingRowSetIteratorNextInt ( MappingRowSetIterator *self, const ctx_t *ctx, const RowSet_vt *vt )
-{
-    /* no FUNC_ENTRY */
-
-    RowSet *rs = NULL;
-
-    /* on first invocation, allocate the map */
-    if ( self -> map == NULL )
-    {
-        ON_FAIL ( MappingRowSetIteratorAllocMap ( self, ctx ) )
-            return NULL;
-    }
-
-    /* advance row_id */
-    self -> row_id += self -> num_elems;
-    self -> num_elems = 0;
-
-    /* create the empty row-set */
-    if ( self -> row_id < self -> last_excl )
-        rs = MappingRowSetIteratorMakeTheRowSet ( self, ctx, vt );
-
-    return rs;
-}
-
-static
-RowSet *MappingRowSetIteratorNext ( MappingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return MappingRowSetIteratorNextInt ( self, ctx, & MappingRowSetPhys_vt );
-}
-
-static
-RowSet *MapFileMappingRowSetIteratorNext ( MappingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return MappingRowSetIteratorNextInt ( self, ctx, & MapFileMappingRowSetPhys_vt );
-}
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- */
-
-static RowSetIterator_vt MappingRowSetIterator_vt =
-{
-    MappingRowSetIteratorWhack,
-    MappingRowSetIteratorGetIdxMapping,
-    MappingRowSetIteratorGetSourceIds,
-    MappingRowSetIteratorNext
-};
-
-/* MakeMappingRowSetIterator
- *  runs from first to last id in cursor
- */
-RowSetIterator *TablePairMakeMappingRowSetIterator ( TablePair *self, const ctx_t *ctx, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> first_id > self -> last_excl )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcConstructing, rcRange, rcInvalid );
-        INTERNAL_ERROR ( rc, "union of all column ranges improperly set" );
-    }
-    else
-    {
-        MappingRowSetIterator *rsi;
-
-        TRY ( rsi = MemAlloc ( ctx, sizeof * rsi, true ) )
-        {
-            TRY ( RowSetIteratorInit ( & rsi -> dad, ctx, & MappingRowSetIterator_vt ) )
-            {
-                rsi -> row_id = self -> first_id;
-                rsi -> last_excl = self -> last_excl;
-                rsi -> large = large;
-                return & rsi -> dad;
-            }
-
-            MemFree ( ctx, rsi, sizeof * rsi );
-        }
-    }
-
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * MapFile
- */
-
-static RowSetIterator_vt MapFileMappingRowSetIterator_vt =
-{
-    MapFileMappingRowSetIteratorWhack,
-    MappingRowSetIteratorGetIdxMapping,
-    MappingRowSetIteratorGetSourceIds,
-    MapFileMappingRowSetIteratorNext
-};
-
-RowSetIterator * MapFileMakeMappingRowSetIterator ( const MapFile *self, const ctx_t *ctx, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    MappingRowSetIterator *rsi;
-
-    /* create the iterator */
-    TRY ( rsi = MemAlloc ( ctx, sizeof * rsi, true ) )
-    {
-        TRY ( RowSetIteratorInit ( & rsi -> dad, ctx, & MapFileMappingRowSetIterator_vt ) )
-        {
-            /* initialize the row-set with map and self reference */
-            TRY ( rsi -> row_id = MapFileFirst ( self, ctx ) )
-            {
-                TRY ( rsi -> last_excl = rsi -> row_id + MapFileCount ( self, ctx ) )
-                {
-                    TRY ( rsi -> idx = MapFileDuplicate ( self, ctx ) )
-                    {
-                        rsi -> large = large;
-                        return & rsi -> dad;
-                    }
-                }
-            }
-        }
-
-        MemFree ( ctx, rsi, sizeof * rsi );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/mem.c b/tools/sra-sort/mem.c
deleted file mode 100644
index 313a90f..0000000
--- a/tools/sra-sort/mem.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-
-FILE_ENTRY ( mem );
-
-
-/*--------------------------------------------------------------------------
- * Mem
- *  memory allocation via MemBank in Caps
- */
-void *MemAlloc ( const ctx_t *ctx, size_t bytes, bool clear )
-{
-    assert ( ctx != NULL );
-    assert ( ctx -> caps != NULL );
-    assert ( ctx -> caps -> mem != NULL );
-
-    return MemBankAlloc ( ctx -> caps -> mem, ctx, bytes, clear );
-}
-
-void MemFree ( const ctx_t *ctx, void *mem, size_t bytes )
-{
-    if ( mem != NULL )
-    {
-        assert ( ctx != NULL );
-        assert ( ctx -> caps != NULL );
-        assert ( ctx -> caps -> mem != NULL );
-
-        MemBankFree ( ctx -> caps -> mem, ctx, mem, bytes );
-    }
-}
-
-size_t MemInUse ( const ctx_t *ctx, size_t *opt_quota )
-{
-    assert ( ctx != NULL );
-    assert ( ctx -> caps != NULL );
-    assert ( ctx -> caps -> mem != NULL );
-
-    return MemBankInUse ( ctx -> caps -> mem, ctx, opt_quota );
-}
diff --git a/tools/sra-sort/mem.h b/tools/sra-sort/mem.h
deleted file mode 100644
index fc3db7e..0000000
--- a/tools/sra-sort/mem.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_mem_
-#define _h_sra_sort_mem_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * Mem
- *  memory allocation via MemBank in Caps
- */
-void *MemAlloc ( const ctx_t *ctx, size_t bytes, bool clear );
-void MemFree ( const ctx_t *ctx, void *mem, size_t bytes );
-size_t MemInUse ( const ctx_t *ctx, size_t *opt_quota );
-
-
-
-/*--------------------------------------------------------------------------
- * MemBank
- *  very, very, very watered down memory bank
- */
-typedef struct MemBank_vt MemBank_vt;
-
-typedef struct MemBank MemBank;
-struct MemBank
-{
-    const MemBank_vt *vt;
-    KRefcount refcount;
-    uint32_t align;
-};
-
-#ifndef MEMBANK_IMPL
-#define MEMBANK_IMPL MemBank
-#endif
-
-struct MemBank_vt
-{
-    void ( * whack ) ( MEMBANK_IMPL *self, const ctx_t *ctx );
-    size_t ( * in_use ) ( const MEMBANK_IMPL *self, const ctx_t *ctx, size_t *opt_quota );
-    void* ( * alloc ) ( MEMBANK_IMPL *self, const ctx_t *ctx, size_t bytes, bool clear );
-    void ( * free ) ( MEMBANK_IMPL *self, const ctx_t *ctx, void *mem, size_t bytes );
-};
-
-
-/* Make
- *  make a new memory bank
- */
-MemBank *MemBankMake ( const ctx_t *ctx, size_t quota );
-
-
-/* MakePaged
- *  make a new paged memory bank
- */
-MemBank *MemBankMakePaged ( const ctx_t *ctx, size_t quota, size_t pgsize );
-
-
-/* Duplicate
- * Release
- */
-MemBank *MemBankDuplicate ( const MemBank *self, const ctx_t *ctx );
-void MemBankRelease ( const MemBank *self, const ctx_t *ctx );
-
-
-/* InUse
- *  report the number of bytes in use
- *  optionally returns quota
- */
-#define MemBankInUse( self, ctx, opt_quota ) \
-    POLY_DISPATCH_INT ( in_use, self, const MEMBANK_IMPL, ctx, opt_quota )
-
-
-/* Alloc
- *  allocates some memory from bank
- */
-#define MemBankAlloc( self, ctx, bytes, clear ) \
-    POLY_DISPATCH_PTR ( alloc, self, MEMBANK_IMPL, ctx, bytes, clear )
-
-
-/* Free
- *  returns memory to bank
- *  ignored by paged bank
- *  burden on caller to remember allocation size
- */
-#define MemBankFree( self, ctx, mem, bytes ) \
-    POLY_DISPATCH_VOID ( free, self, MEMBANK_IMPL, ctx, mem, bytes )
-
-
-/* Init
- */
-void MemBankInit ( MemBank *self, const ctx_t *ctx, const MemBank_vt *vt, const char *name );
-
-/* Destroy
- */
-#define MemBankDestroy( self, ctx ) \
-    ( ( void ) 0 )
-
-#endif
diff --git a/tools/sra-sort/membank-priv.h b/tools/sra-sort/membank-priv.h
deleted file mode 100644
index 69301d4..0000000
--- a/tools/sra-sort/membank-priv.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_membank_priv_
-#define _h_sra_sort_membank_priv_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * MemBank
- */
-
-/* MakePagedMMap
- *  make a new paged memory bank backed by memory map
- */
-MemBank *MemBankMakePagedMMap ( const ctx_t *ctx, size_t quota, size_t pgsize );
-
-#endif
diff --git a/tools/sra-sort/membank.c b/tools/sra-sort/membank.c
deleted file mode 100644
index 6f29b75..0000000
--- a/tools/sra-sort/membank.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct MemBankImpl MemBankImpl;
-#define MEMBANK_IMPL MemBankImpl
-
-#include <sysalloc.h>
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/mmap.h>
-#include <klib/refcount.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-#include <atomic.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-FILE_ENTRY ( membank );
-
-
-/*--------------------------------------------------------------------------
- * MemBankImpl
- *  maintains a quota
- */
-struct MemBankImpl
-{
-    MemBank dad;
-    size_t quota;
-    atomic_t avail;
-};
-
-static
-void MemBankImplWhack ( MemBankImpl *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    Caps *caps;
-
-    MemBankDestroy ( & self -> dad, ctx );
-
-    caps = ( Caps* ) ctx -> caps;
-    if ( & self -> dad != caps -> mem )
-        MemBankFree ( caps -> mem, ctx, self, sizeof * self );
-    else
-    {
-        free ( self );
-        caps -> mem = NULL;
-    }
-}
-
-
-/* InUse
- *  report the number of bytes in use
- *  optionally returns quota
- */
-static
-size_t MemBankImplInUse ( const MemBankImpl *self, const ctx_t *ctx, size_t *quota )
-{
-    size_t dummy;
-
-    if ( quota == NULL )
-        quota = & dummy;
-
-    if ( self != NULL )
-    {
-        * quota = self -> quota;
-        return self -> quota - atomic_read ( & self -> avail );
-    }
-
-    * quota = 0;
-    return 0;
-}
-
-
-/* Alloc
- *  allocates some memory from bank
- */
-static
-void *MemBankImplAlloc ( MemBankImpl *self, const ctx_t *ctx, size_t bytes, bool clear )
-{
-    if ( self != NULL )
-    {
-        /* allocation from the raw bank */
-        rc_t rc;
-        FUNC_ENTRY ( ctx );
-
-        /* update "avail" atomicially */
-        size_t remaining, avail;
-        for ( avail = atomic_read ( & self -> avail ); avail >= bytes; avail = remaining )
-        {
-            /* subtract the bytes */
-            remaining = atomic_test_and_set ( & self -> avail,
-                ( atomic_int ) ( avail - bytes ), ( atomic_int ) avail );
-            if ( remaining == avail )
-            {
-                /* try to allocate the memory directly */
-                void *mem = clear ? calloc ( 1, bytes ) : malloc ( bytes );
-                if ( mem == NULL )
-                {
-                    /* failed to get memory */
-                    atomic_add ( & self -> avail, ( atomic_int ) bytes );
-                    rc = RC ( rcExe, rcMemory, rcAllocating, rcMemory, rcExhausted );
-                    ERROR ( rc, "failed to allocate %zu bytes of memory", bytes );
-                }
-                else if ( bytes > 256 * 1024 )
-                {
-                    if ( bytes > 1024 * 1024 )
-                        STATUS ( 3, "allocated %,zu bytes of memory", bytes );
-                    else
-                        STATUS ( 4, "allocated %,zu bytes of memory", bytes );
-                }
-
-                return mem;
-            }
-        }
-
-        /* at this point we could be using a timeout */
-        rc = RC ( rcExe, rcMemory, rcAllocating, rcRange, rcExcessive );
-        ERROR ( rc, "quota exceeded allocating %zu bytes of memory", bytes );
-    }
-
-    return NULL;
-}
-
-
-/* Free
- *  returns memory to bank
- *  ignored by paged bank
- *  burden on caller to remember allocation size
- */
-static
-void MemBankImplFree ( MemBankImpl *self, const ctx_t *ctx, void *mem, size_t bytes )
-{
-    if ( mem != NULL )
-    {
-        FUNC_ENTRY ( ctx );
-
-        if ( self == NULL )
-        {
-            rc_t rc = RC ( rcExe, rcMemory, rcReleasing, rcSelf, rcNull );
-            ERROR ( rc, "attempt to return memory to NULL MemBank" );
-        }
-        else
-        {
-            /* release the memory */
-            free ( mem );
-
-            /* update the counters */
-            if ( bytes == 0 )
-                ANNOTATE ( "freed memory with size of 0 bytes" );
-            else
-            {
-                atomic_add ( & self -> avail, ( atomic_int ) bytes );
-
-                if ( bytes > 256 * 1024 )
-                {
-                    if ( bytes > 1024 * 1024 )
-                        STATUS ( 3, "freed %,zu bytes of memory", bytes );
-                    else
-                        STATUS ( 4, "freed %,zu bytes of memory", bytes );
-                }
-            }
-        }
-    }
-}
-
-static MemBank_vt MemBankImpl_vt =
-{
-    MemBankImplWhack,
-    MemBankImplInUse,
-    MemBankImplAlloc,
-    MemBankImplFree
-};
-
-
-/*--------------------------------------------------------------------------
- * MemBank
- *  very, very, very watered down memory bank
- */
-
-
-/* Make
- *  make a new memory bank
- *  in a real system, this could make a bank linked to
- *  the primordial one. in this system, there is only
- *  a single bank, so this function is overloaded to
- *  create both the primordial and to reset quota on it.
- */
-MemBank *MemBankMake ( const ctx_t *ctx, size_t quota )
-{
-    FUNC_ENTRY ( ctx );
-
-    MemBankImpl *mem = malloc ( sizeof * mem );
-    if ( mem == NULL )
-        exit ( -1 );
-
-    MemBankInit ( & mem -> dad, ctx, & MemBankImpl_vt, "Process MemBank" );
-
-    if ( quota < 4096 )
-        quota = 4096;
-
-    mem -> quota = quota;
-    atomic_set ( & mem -> avail, ( atomic_int ) ( quota - sizeof * mem ) );
-
-    return & mem -> dad;
-}
-
-
-/* Init
- */
-void MemBankInit ( MemBank *self, const ctx_t *ctx, const MemBank_vt *vt, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, "MemBank", "Make", name );
-    self -> align = 0;
-}
-
-
-/* Duplicate
- * Release
- */
-MemBank *MemBankDuplicate ( const MemBank *self, const ctx_t *ctx )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "MemBank" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative: {
-            FUNC_ENTRY ( ctx );
-            rc_t rc = RC ( rcExe, rcMemory, rcAttaching, rcRange, rcExcessive );
-            ERROR ( rc, "excessive references on MemBank" );
-            return NULL;
-        }}
-    }
-    return ( MemBank* ) self;
-}
-
-void MemBankRelease ( const MemBank *self, const ctx_t *ctx )
-{
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "MemBank" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( MEMBANK_IMPL* ) self, ctx );
-            break;
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative: {
-            FUNC_ENTRY ( ctx );
-            rc_t rc = RC ( rcExe, rcMemory, rcReleasing, rcRange, rcExcessive );
-            ERROR ( rc, "excessive releases on MemBank" );
-        }}
-    }
-}
diff --git a/tools/sra-sort/meta-pair.c b/tools/sra-sort/meta-pair.c
deleted file mode 100644
index b4ca027..0000000
--- a/tools/sra-sort/meta-pair.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct MetaPair StdMetaPair;
-#define METAPAIR_IMPL StdMetaPair
-
-#include "meta-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <klib/namelist.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( meta-pair );
-
-
-/*--------------------------------------------------------------------------
- * StdMetaPair
- */
-
-static
-void StdMetaPairWhack ( StdMetaPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    MetaPairDestroy ( self, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static MetaPair_vt StdMetaPair_vt =
-{
-    StdMetaPairWhack
-};
-
-
-/*--------------------------------------------------------------------------
- * MetaPair
- *  interface to pairing of source and destination tables
- */
-
-
-/* Make
- *  make a standard metadata pair from existing KMetadata objects
- */
-MetaPair *MetaPairMake ( const ctx_t *ctx,
-    const KMetadata *src, KMetadata *dst, const char *full_path )
-{
-    FUNC_ENTRY ( ctx );
-
-    StdMetaPair *meta;
-
-    TRY ( meta = MemAlloc ( ctx, sizeof * meta, false ) )
-    {
-        TRY ( MetaPairInit ( meta, ctx, & StdMetaPair_vt, src, dst, full_path ) )
-        {
-            return meta;
-        }
-
-        MemFree ( ctx, meta, sizeof * meta );
-    }
-
-    return NULL;
-}
-
-
-/* Release
- *  called by table at end of copy
- */
-void MetaPairRelease ( MetaPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "MetaPair" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcMetadata, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release MetaPair" );
-        }
-    }
-}
-
-/* Duplicate
- */
-MetaPair *MetaPairDuplicate ( MetaPair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "MetaPair" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcMetadata, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate MetaPair" );
-            return NULL;
-        }
-    }
-
-    return ( MetaPair* ) self;
-}
-
-
-/* Init
- */
-void MetaPairInit ( MetaPair *self, const ctx_t *ctx, const MetaPair_vt *vt,
-    const KMetadata *src, KMetadata *dst, const char *full_spec )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    if ( self == NULL )
-    {
-        rc = RC ( rcExe, rcMetadata, rcConstructing, rcSelf, rcNull );
-        INTERNAL_ERROR ( rc, "bad MetaPair" );
-        return;
-    }
-
-    memset ( self, 0, sizeof * self );
-    self -> vt = vt;
-
-    rc = KMetadataAddRef ( self -> smeta = src );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to duplicate metadata 'src.%s'", full_spec );
-    else
-    {
-        rc = KMetadataAddRef ( self -> dmeta = dst );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to duplicate metadata 'dst.%s'", full_spec );
-        else
-        {
-            KRefcountInit ( & self -> refcount, 1, "MetaPair", "init", full_spec );
-            return;
-        }
-
-        KMetadataRelease ( self -> smeta );
-        self -> smeta = NULL;
-    }
-}
-
-/* Destroy
- */
-void MetaPairDestroy ( MetaPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = KMetadataRelease ( self -> dmeta );
-    if ( rc != 0 )
-        WARN ( "KMetadataRelease failed" );
-    KMetadataRelease ( self -> smeta );
-
-    memset ( self, 0, sizeof * self );
-}
-
-
-static
-void copy_meta_node_value ( const KMDataNode *src, const ctx_t *ctx, KMDataNode *dst )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    char buff [ 4096 ];
-    size_t num_read, remaining;
-
-    rc = KMDataNodeRead ( src, 0, buff, sizeof buff, & num_read, & remaining );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "KMDataNodeRead failed" );
-    else if ( num_read != 0 )
-    {
-        rc = KMDataNodeWrite ( dst, buff, num_read );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "KMDataNodeWrite failed" );
-        else
-        {
-            size_t offset;
-            for ( offset = num_read; remaining != 0; offset += num_read )
-            {
-                rc = KMDataNodeRead ( src, offset, buff, sizeof buff, & num_read, & remaining );
-                if ( rc != 0 )
-                {
-                    INTERNAL_ERROR ( rc, "KMDataNodeRead failed" );
-                    break;
-                }
-                rc = KMDataNodeAppend ( dst, buff, num_read );
-                if ( rc != 0 )
-                {
-                    SYSTEM_ERROR ( rc, "KMDataNodeAppend failed" );
-                    break;
-                }
-            }
-        }
-    }
-}
-
-static
-void copy_meta_node_attr ( const KMDataNode *src, const ctx_t *ctx, KMDataNode *dst, const char *name )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    size_t num_read;
-    char buff [ 4096 ];
-
-    rc = KMDataNodeReadAttr ( src, name, buff, sizeof buff, & num_read );
-    if ( rc != 0 )
-        ERROR ( rc, "KMDataNodeReadAttr '%s' failed", name );
-    else
-    {
-        rc = KMDataNodeWriteAttr ( dst, name, buff );
-        if ( rc != 0 )
-            ERROR ( rc, "KMDataNodeWriteAttr '%s' failed", name );
-    }
-}
-
-
-static
-const char *filter_node_name ( const char *name, size_t nsize, const char **exclude )
-{
-    uint32_t i;
-    for ( i = 0; exclude [ i ] != NULL; ++ i )
-    {
-        const char *x = exclude [ i ];
-        size_t xsize = strlen ( x );
-
-        /* allow exclude to be a prefix */
-        if ( xsize > 0 && x [ xsize - 1 ] == '*' )
-        {
-            if ( nsize < -- xsize )
-                continue;
-        }
-        else if ( nsize != xsize )
-        {
-            continue;
-        }
-
-        if ( memcmp ( name, x, xsize ) == 0 )
-            return NULL;
-    }
-
-    return name;
- }
-
-
-static
-void copy_meta_node ( const KMDataNode *src, const ctx_t *ctx, KMDataNode *dst,
-    char path [ 4096 ], size_t psize, const char *owner_spec, const char **exclude )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* first, copy value */
-    TRY ( copy_meta_node_value ( src, ctx, dst ) )
-    {
-        /* next, copy attributes */
-        KNamelist *names;
-        rc_t rc = KMDataNodeListAttr ( src, & names );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "KMDataNodeListAttr failed" );
-        else
-        {
-            uint32_t count;
-            rc = KNamelistCount ( names, & count );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "KNamelistCount failed" );
-            else
-            {
-                uint32_t i;
-                const char *name;
-                for ( i = 0; i < count; ++ i )
-                {
-                    rc = KNamelistGet ( names, i, & name );
-                    if ( rc != 0 )
-                    {
-                        INTERNAL_ERROR ( rc, "KNamelistGet [ %u ] failed", i );
-                        break;
-                    }
-
-                    ON_FAIL ( copy_meta_node_attr ( src, ctx, dst, name ) )
-                        break;
-                }
-
-                if ( ! FAILED () )
-                {
-                    KNamelistRelease ( names );
-
-                    /* last, copy children */
-                    rc = KMDataNodeListChildren ( src, & names );
-                    if ( rc != 0 )
-                        INTERNAL_ERROR ( rc, "KMDataNodeListChildren failed" );
-                    else
-                    {
-                        rc = KNamelistCount ( names, & count );
-                        if ( rc != 0 )
-                            INTERNAL_ERROR ( rc, "KNamelistCount failed" );
-                        else if ( psize + 1 == 4096 )
-                        {
-                            rc = RC ( rcExe, rcNode, rcCopying, rcBuffer, rcInsufficient );
-                            ERROR ( rc, "metadata path too long" );
-                        }
-                        else
-                        {
-                            for ( i = 0; i < count; ++ i )
-                            {
-                                KMDataNode *dchild;
-                                const KMDataNode *schild;
-
-                                size_t nsize;
-                                static const char *always_exclude [] =
-                                {
-                                    ".seq", "col", "schema", 
-                                    "HUFFMAN*", "MSC454*", "NREADS", "NUMBER_P*", "NUMBER_S*",
-                                    NULL
-                                };
-
-                                rc = KNamelistGet ( names, i, & name );
-                                if ( rc != 0 )
-                                {
-                                    INTERNAL_ERROR ( rc, "KNamelistGet [ %u ] failed", i );
-                                    break;
-                                }
-
-                                nsize = string_size ( name );
-                                if ( psize + nsize + 1 >= 4096 )
-                                {
-                                    WARN ( "skipping node '%.*s/%s' - path too long", ( uint32_t ) psize, path, name );
-                                    continue;
-                                }
-
-                                if ( psize != 0 )
-                                    path [ psize ++ ] = '/';
-                                strcpy ( & path [ psize ], name );
-
-                                if ( exclude != NULL )
-                                {
-                                    name = filter_node_name ( name, nsize, exclude );
-                                    if ( name == NULL )
-                                        continue;
-                                }
-
-                                name = filter_node_name ( name, nsize, always_exclude );
-                                if ( name == NULL )
-                                    continue;
-
-                                rc = KMDataNodeOpenNodeRead ( src, & schild, name );
-                                if ( rc != 0 )
-                                    ERROR ( rc, "failed to open source metadata node '%s'", name );
-                                else
-                                {
-                                    rc = KMDataNodeOpenNodeUpdate ( dst, & dchild, name );
-                                    if ( rc != 0 )
-                                        ERROR ( rc, "failed to open destination metadata node '%s'", name );
-                                    else
-                                    {
-                                        copy_meta_node ( schild, ctx, dchild, path, psize + nsize, owner_spec, exclude );
-                                        KMDataNodeRelease ( dchild );
-                                    }
-
-                                    KMDataNodeRelease ( schild );
-                                }
-
-                                if ( FAILED () )
-                                    break;
-                            }
-                        }
-                    }
-                }
-            }
-
-            KNamelistRelease ( names );
-        }
-    }
-}
-
-
-/* Copy
- *  copy from source to destination
- */
-void MetaPairCopy ( MetaPair *self, const ctx_t *ctx, const char *owner_spec, const char **exclude )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    char path [ 4096 ];
-    const KMDataNode *src;
-
-    STATUS ( 3, "copying '%s' metadata", owner_spec );
-
-    rc = KMetadataOpenNodeRead ( self -> smeta, & src, "/" );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "KMetadataOpenNodeRead failed to obtain '%s' root node", owner_spec );
-    else
-    {
-        KMDataNode *dst;
-        rc = KMetadataOpenNodeUpdate ( self -> dmeta, & dst, "/" );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "KMetadataOpenNodeUpdate failed to obtain '%s' root node", owner_spec );
-        else
-        {
-            path [ 0 ] = 0;
-            copy_meta_node ( src, ctx, dst, path, 0, owner_spec, exclude );
-
-            KMDataNodeRelease ( dst );
-        }
-
-        KMDataNodeRelease ( src );
-    }
-
-    STATUS ( 3, "finished copying metadata" );
-}
diff --git a/tools/sra-sort/meta-pair.h b/tools/sra-sort/meta-pair.h
deleted file mode 100644
index 1aa65e5..0000000
--- a/tools/sra-sort/meta-pair.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_meta_pair_
-#define _h_sra_sort_meta_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct KMetadata;
-
-
-/*--------------------------------------------------------------------------
- * MetaPair
- *  interface to pairing of source and destination tables
- */
-typedef struct MetaPair_vt MetaPair_vt;
-
-typedef struct MetaPair MetaPair;
-struct MetaPair
-{
-    /* polymorphic */
-    const MetaPair_vt *vt;
-
-    /* the pair of KMetadata */
-    struct KMetadata const *smeta;
-    struct KMetadata *dmeta;
-
-    KRefcount refcount;
-};
-
-#ifndef METAPAIR_IMPL
-#define METAPAIR_IMPL MetaPair
-#endif
-
-struct MetaPair_vt
-{
-    void ( * whack ) ( METAPAIR_IMPL *self, const ctx_t *ctx );
-};
-
-
-/* Make
- *  make a standard metadata pair from existing KMetadata objects
- */
-MetaPair *MetaPairMake ( const ctx_t *ctx,
-    struct KMetadata const *src, struct KMetadata *dst,
-    const char *full_path );
-
-
-/* Release
- *  called by table at end of copy
- */
-void MetaPairRelease ( MetaPair *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-MetaPair *MetaPairDuplicate ( MetaPair *self, const ctx_t *ctx );
-
-
-/* Init
- */
-void MetaPairInit ( MetaPair *self, const ctx_t *ctx, const MetaPair_vt *vt,
-    struct KMetadata const *src, struct KMetadata *dst, const char *full_spec );
-
-/* Destroy
- */
-void MetaPairDestroy ( MetaPair *self, const ctx_t *ctx );
-
-
-/* Copy
- *  copy from source to destination
- */
-void MetaPairCopy ( MetaPair *self, const ctx_t *ctx,
-    const char *owner_spec, const char **exclude );
-
-
-#endif /* _h_sra_sort_meta_pair_ */
diff --git a/tools/sra-sort/paged-membank.c b/tools/sra-sort/paged-membank.c
deleted file mode 100644
index a91c4d4..0000000
--- a/tools/sra-sort/paged-membank.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct PagedMemBank PagedMemBank;
-#define MEMBANK_IMPL PagedMemBank
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-#include "sra-sort.h"
-
-#include "membank-priv.h"
-
-#include <klib/container.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-FILE_ENTRY ( paged-membank );
-
-
-/*--------------------------------------------------------------------------
- * MemPage
- */
-typedef struct MemPage MemPage;
-struct MemPage
-{
-    SLNode n;
-    size_t used;
-};
-
-/*--------------------------------------------------------------------------
- * PagedMemBank
- *  designed to allocate a lot of little bits of memory
- *  and then free them all at once
- */
-struct PagedMemBank
-{
-    MemBank dad;
-    size_t quota;
-    size_t avail;
-    size_t pgsize;
-    SLList pages;
-};
-
-
-/* Whack
- */
-static
-void PagedMemBankWhack ( PagedMemBank *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    MemPage *pg = ( MemPage* ) SLListPopHead ( & self -> pages );
-    while ( pg != NULL )
-    {
-        MemFree ( ctx, pg, self -> pgsize );
-        pg = ( MemPage* ) SLListPopHead ( & self -> pages );
-    }
-
-    MemBankDestroy ( & self -> dad, ctx );
-
-    MemFree ( ctx, self, sizeof * self );
-}
-
-
-/* InUse
- *  report the number of bytes in use
- *  optionally returns quota
- */
-static
-size_t PagedMemBankInUse ( const PagedMemBank *self, const ctx_t *ctx, size_t *quota )
-{
-    size_t dummy;
-
-    if ( quota == NULL )
-        quota = & dummy;
-
-    if ( self != NULL )
-    {
-        * quota = self -> quota;
-        return self -> quota - self -> avail;
-    }
-
-    * quota = 0;
-    return 0;
-}
-
-
-/* Alloc
- *  allocates some memory from bank
- */
-static
-void *PagedMemBankAlloc ( PagedMemBank *self, const ctx_t *ctx, size_t bytes, bool clear )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    void *mem;
-    size_t avail;
-
-    /* check current alloc page */
-    MemPage *pg = ( MemPage* ) SLListHead ( & self -> pages );
-    if ( pg != NULL )
-    {
-        /* calculate bytes available */
-        avail = self -> pgsize - pg -> used;
-        if ( avail >= bytes )
-        {
-            /* got the memory */
-            mem = & ( ( uint8_t* ) pg ) [ pg -> used ];
-            pg -> used += bytes;
-
-            /* zero it out if so requested */
-            if ( clear )
-                memset ( mem, 0, bytes );
-
-            return mem;
-        }
-    }
-
-    /* either didn't have a page or didn't have enough memory
-       test for being able to fit in ANY page */
-    if ( bytes > self -> pgsize - sizeof * pg )
-    {
-        rc = RC ( rcExe, rcMemory, rcAllocating, rcData, rcExcessive );
-        ERROR ( rc, "requested memory allocation of %zu bytes is too large to fit into a page", bytes );
-        return NULL;
-    }
-
-    /* allocate the bytes */
-    if ( self -> avail >= self -> pgsize )
-    {
-        /* going to allocate a full page */
-        self -> avail -= self -> pgsize;
-
-        /* ask process for memory block */
-        TRY ( pg = MemAlloc ( ctx, self -> pgsize, false ) )
-        {
-            /* got it - push it onto stack */
-            pg -> used = sizeof * pg + bytes;
-            SLListPushHead ( & self -> pages, & pg -> n );
-
-            /* clear memory of asked */
-            mem = pg + 1;
-            if ( clear )
-                memset ( mem, 0, bytes );
-
-            return mem;
-        }
-
-        /* return with error from main MemBank */
-        return NULL;
-    }
-
-    /* at this point we could be using a timeout */
-    rc = RC ( rcExe, rcMemory, rcAllocating, rcRange, rcExcessive );
-    ERROR ( rc, "quota exceeded allocating %zu bytes of page memory for a %zu byte block", self -> pgsize, bytes );
-
-    return NULL;
-}
-
-
-/* Free
- *  ignored by paged bank
- */
-static
-void PagedMemBankFree ( PagedMemBank *self, const ctx_t *ctx, void *mem, size_t bytes )
-{
-}
-
-
-static MemBank_vt PagedMemBank_vt =
-{
-    PagedMemBankWhack,
-    PagedMemBankInUse,
-    PagedMemBankAlloc,
-    PagedMemBankFree
-};
-
-
-/*--------------------------------------------------------------------------
- * MemBank
- *  very, very, very watered down memory bank
- */
-
-/* MakePaged
- *  make a new paged memory bank
- */
-MemBank *MemBankMakePaged ( const ctx_t *ctx, size_t quota, size_t pgsize )
-{
-    FUNC_ENTRY ( ctx );
-    PagedMemBank *mem;
-
-    /* special case for using memory mapped banks */
-    if ( ctx -> caps -> tool -> mmapdir != NULL )
-        return MemBankMakePagedMMap ( ctx, quota, pgsize );
-
-    if ( pgsize < 4096 )
-        pgsize = 4096;
-
-    if ( quota < pgsize )
-        quota = pgsize;
-
-    TRY ( mem = MemAlloc ( ctx, sizeof * mem, true ) )
-    {
-        TRY ( MemBankInit ( & mem -> dad, ctx, & PagedMemBank_vt, "Task MemBank" ) )
-        {
-            mem -> quota = mem -> avail = quota;
-            mem -> pgsize = pgsize;
-            return & mem -> dad;
-        }
-
-        MemFree ( ctx, mem, sizeof * mem );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/paged-mmapbank.c b/tools/sra-sort/paged-mmapbank.c
deleted file mode 100644
index aa6d6e5..0000000
--- a/tools/sra-sort/paged-mmapbank.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct PagedMMapBank PagedMMapBank;
-#define MEMBANK_IMPL PagedMMapBank
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-#include "sra-sort.h"
-
-#include "membank-priv.h"
-
-#include <kfs/mmap.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <klib/container.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-FILE_ENTRY ( paged-mmapbank );
-
-
-/*--------------------------------------------------------------------------
- * MMapPage
- *  a "page" which is really an entire mmap
- */
-typedef struct MMapPage MMapPage;
-struct MMapPage
-{
-    SLNode n;
-    KMMap *mmap;
-    uint8_t *addr;
-    size_t size;
-    size_t used;
-};
-
-static
-void CC MMapPageWhack ( SLNode *n, void *data )
-{
-    MMapPage *self = ( MMapPage* ) n;
-    const ctx_t *ctx = ( const void* ) data;
-
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc = KMMapRelease ( self -> mmap );
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "KMMapRelease failed" );
-
-    MemFree ( ctx, self, sizeof * self );
-}
-
-
-/*--------------------------------------------------------------------------
- * PagedMMapBank
- *  a memory bank based upon system mmap
- */
-struct PagedMMapBank
-{
-    MemBank dad;
-    size_t quota;
-    size_t used;
-    size_t pgsize;
-    KFile *backing;
-    SLList pages;
-};
-
-
-/* Whack
- */
-static
-void PagedMMapBankWhack ( PagedMMapBank *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    SLListWhack ( & self -> pages, MMapPageWhack, ( void* ) ctx );
-
-    rc = KFileRelease ( self -> backing );
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "KFileRelease failed on backing file" );
-    self -> backing = NULL;
-
-    MemBankDestroy ( & self -> dad, ctx );
-
-    MemFree ( ctx, self, sizeof * self );
-}
-
-
-/* InUse
- *  report the number of bytes in use
- *  optionally returns quota
- */
-static
-size_t PagedMMapBankInUse ( const PagedMMapBank *self, const ctx_t *ctx, size_t *quota )
-{
-    size_t dummy;
-
-    if ( quota == NULL )
-        quota = & dummy;
-
-    if ( self != NULL )
-    {
-        * quota = self -> quota;
-        return self -> used;
-    }
-
-    * quota = 0;
-    return 0;
-}
-
-
-/* CreateBacking
- */
-static
-void PagedMMapBankCreateBacking ( PagedMMapBank *self, const ctx_t *ctx, KFile **backing )
-{
-    FUNC_ENTRY ( ctx );
-
-    KDirectory *wd;
-    rc_t rc = KDirectoryNativeDir ( & wd );
-    if ( rc != 0 )
-        ABORT ( rc, "KDirectoryNativeDir failed" );
-    else
-    {
-        static uint32_t file_no;
-        const Tool *tp = ctx -> caps -> tool;
-
-        ++ file_no;
-        STATUS ( 5, "creating backing file '%s/sra-sort-buffer.%d.%u'", tp -> mmapdir, tp -> pid, file_no );
-
-        rc = KDirectoryCreateFile ( wd, backing, true,
-            0600, kcmInit | kcmParents, "%s/sra-sort-buffer.%d.%u",
-            tp -> mmapdir, tp -> pid, file_no );
-        if ( rc != 0 )
-            ABORT ( rc, "KDirectoryCreateFile failed when creating mem-mapped buffer" );
-        else
-        {
-#if ! WINDOWS
-            /* unlinking file is a wonderful thing */
-            if ( tp -> unlink_idx_files )
-            {
-                /* unlink KFile */
-                STATUS ( 5, "unlinking backing file '%s/sra-sort-buffer.%d.%u'", tp -> mmapdir, tp -> pid, file_no );
-                rc = KDirectoryRemove ( wd, false, "%s/sra-sort-buffer.%d.%u",
-                    tp -> mmapdir, tp -> pid, file_no );
-                if ( rc != 0 )
-                    WARN ( "failed to unlink mem-mapped buffer file #%u", file_no );
-            }
-#endif
-            /* set initial size to a page */
-            rc = KFileSetSize ( * backing, self -> pgsize );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "KFileSetSize failed to set file to %zu bytes", self -> pgsize );
-        }
-
-        KDirectoryRelease ( wd );
-    }
-}
-
-
-/* ExtendBacking
- *  creates a backing file if not there
- *  extends it otherwise
- */
-static
-void PagedMMapBankExtendBacking ( PagedMMapBank *self, const ctx_t *ctx )
-{
-#if USE_SINGLE_BACKING_FILE
-
-    /* this code is only useful if using a single file for all maps */
-    FUNC_ENTRY ( ctx );
-
-    /* create the file on first attempt */
-    if ( self -> backing == NULL )
-    {
-        assert ( self -> used == 0 );
-        PagedMMapBankCreateBacking ( self, ctx, & self -> backing )l
-    }
-    else
-    {
-        /* extend the file */
-        rc_t rc;
-        STATUS ( 4, "extending common buffer file to %,zu bytes", self -> used + self -> pgsize );
-        rc = KFileSetSize ( self -> backing, self -> used + self -> pgsize );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "KFileSetSize failed to extend file size to %zu bytes", self -> used + self -> pgsize );
-    }
-#endif
-}
-
-
-/* MapPage
- */
-static
-void PagedMMapBankMapPage ( PagedMMapBank *self, const ctx_t *ctx, MMapPage *pg )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-#if USE_SINGLE_BACKING_FILE
-    STATUS ( 4, "allocating new mmap of %,zu bytes onto common file at offset %,zu", self -> pgsize, self -> used );
-    rc = KMMapMakeRgnUpdate ( & pg -> mmap, self -> backing, self -> used, self -> pgsize );
-#else
-    KFile *backing;
-    ON_FAIL ( PagedMMapBankCreateBacking ( self, ctx, & backing ) )
-        return;
-
-    STATUS ( 4, "allocating new mmap of %,zu bytes onto its own file", self -> pgsize );
-    rc = KMMapMakeRgnUpdate ( & pg -> mmap, backing, 0, self -> pgsize );
-    KFileRelease ( backing );
-#endif
-
-    if ( rc != 0 )
-        SYSTEM_ERROR ( rc, "KMMapMakeRgnUpdate failed creating %zu byte region", self -> pgsize );
-    else
-    {
-        rc = KMMapAddrUpdate ( pg -> mmap, ( void** ) & pg -> addr );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "KMMapAddrUpdate failed" );
-        else
-        {
-            rc = KMMapSize ( pg -> mmap, & pg -> size );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "KMMapSize failed" );
-            else
-            {
-                pg -> used = 0;
-                self -> used += self -> pgsize;
-                STATUS ( 4, "total mem-mapped buffer space: %,zu bytes", self -> used );
-                return;
-            }
-        }
-
-        KMMapRelease ( pg -> mmap );
-        pg -> mmap = NULL;
-    }
-}
-
-
-/* Alloc
- *  allocates some memory from bank
- */
-static
-void *PagedMMapBankAlloc ( PagedMMapBank *self, const ctx_t *ctx, size_t bytes, bool clear )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    void *mem;
-    size_t avail;
-
-    /* check current alloc page */
-    MMapPage *pg = ( MMapPage* ) SLListHead ( & self -> pages );
-    if ( pg != NULL )
-    {
-        /* calculate bytes available */
-        avail = pg -> size - pg -> used;
-        if ( avail >= bytes )
-        {
-            /* got the memory */
-            mem = & pg -> addr [ pg -> used ];
-            pg -> used += bytes;
-
-            /* zero it out if so requested */
-            if ( clear )
-                memset ( mem, 0, bytes );
-
-            return mem;
-        }
-    }
-
-    /* either didn't have a page or didn't have enough memory
-       test for being able to fit in ANY page */
-    if ( bytes > self -> pgsize )
-    {
-        rc = RC ( rcExe, rcMemory, rcAllocating, rcData, rcExcessive );
-        ERROR ( rc, "requested memory allocation of %zu bytes is too large to fit into a page", bytes );
-        return NULL;
-    }
-
-    /* allocate the bytes */
-    if ( self -> used + self -> pgsize <= self -> quota )
-    {
-        /* ask process for memory block */
-        TRY ( pg = MemAlloc ( ctx, sizeof * pg, false ) )
-        {
-            /* increase size of underlying file */
-            TRY ( PagedMMapBankExtendBacking ( self, ctx ) )
-            {
-                TRY ( PagedMMapBankMapPage ( self, ctx, pg ) )
-                {
-                    /* got it - push it onto stack */
-                    SLListPushHead ( & self -> pages, & pg -> n );
-
-                    /* clear memory of asked */
-                    mem = pg  -> addr;
-                    pg -> used = bytes;
-                    if ( clear )
-                        memset ( mem, 0, bytes );
-
-                    return mem;
-                }
-            }
-
-            MemFree ( ctx, pg, sizeof * pg );
-        }
-
-        return NULL;
-    }
-
-    /* at this point we could be using a timeout */
-    rc = RC ( rcExe, rcMemory, rcAllocating, rcRange, rcExcessive );
-    ERROR ( rc, "quota exceeded allocating %zu bytes of page memory for a %zu byte block", self -> pgsize, bytes );
-
-    return NULL;
-}
-
-
-/* Free
- *  ignored by paged bank
- */
-static
-void PagedMMapBankFree ( PagedMMapBank *self, const ctx_t *ctx, void *mem, size_t bytes )
-{
-}
-
-
-static MemBank_vt PagedMMapBank_vt =
-{
-    PagedMMapBankWhack,
-    PagedMMapBankInUse,
-    PagedMMapBankAlloc,
-    PagedMMapBankFree
-};
-
-
-/*--------------------------------------------------------------------------
- * MemBank
- *  very, very, very watered down memory bank
- */
-
-/* MakePagedMMap
- *  make a new paged memory bank backed by memory map
- */
-MemBank *MemBankMakePagedMMap ( const ctx_t *ctx, size_t quota, size_t pgsize )
-{
-    FUNC_ENTRY ( ctx );
-    PagedMMapBank *mem;
-
-    if ( pgsize < 256 * 1024 * 1024 )
-        pgsize = 256 * 1024 * 1024;
-
-    if ( quota < pgsize )
-        quota = pgsize;
-
-    TRY ( mem = MemAlloc ( ctx, sizeof * mem, true ) )
-    {
-        TRY ( MemBankInit ( & mem -> dad, ctx, & PagedMMapBank_vt, "Memory Mapped Task MemBank" ) )
-        {
-            mem -> quota = quota;
-            mem -> pgsize = pgsize;
-            return & mem -> dad;
-        }
-
-        MemFree ( ctx, mem, sizeof * mem );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/poslen-col-pair.c b/tools/sra-sort/poslen-col-pair.c
deleted file mode 100644
index 452b134..0000000
--- a/tools/sra-sort/poslen-col-pair.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct PoslenColReader PoslenColReader;
-#define COLREADER_IMPL PoslenColReader
-
-typedef struct PoslenColWriter PoslenColWriter;
-#define COLWRITER_IMPL PoslenColWriter
-
-#include "col-pair.h"
-#include "tbl-pair.h"
-#include "map-file.h"
-#include "glob-poslen.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kapp/main.h>
-#include <kfs/defs.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-FILE_ENTRY ( poslen-col-pair );
-
-
-/*--------------------------------------------------------------------------
- * PoslenColReader
- *  implementation of ColumnReader based upon MapFile temp column read
- */
-struct PoslenColReader
-{
-    ColumnReader dad;
-
-    /* cached first id in column */
-    int64_t first_id;
-
-    /* buffer for reading poslen */
-    int64_t start_id, excl_stop_id;
-    uint64_t *buff;
-    size_t max_ids;
-
-    /* source of poslen */
-    const MapFile *tmp_col;
-
-    size_t full_spec_size;
-    char full_spec [ 1 ];
-};
-
-
-/* Whack
- */
-static
-void PoslenColReaderWhack ( PoslenColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* self-bytes */
-    size_t bytes = sizeof * self + self -> full_spec_size;
-
-    /* free buffer */
-    if ( self -> buff != NULL )
-    {
-        ON_FAIL ( MemFree ( ctx, self -> buff, self -> max_ids * sizeof * self -> buff ) )
-        {
-            CLEAR ();
-        }
-        self -> buff = NULL;
-    }
-
-    /* release MapFile */
-    ON_FAIL ( MapFileRelease ( self -> tmp_col, ctx ) )
-    {
-        WARN ( "MapFileRelease failed on '%s'", self -> full_spec );
-        CLEAR ();
-    }
-    self -> tmp_col = NULL;
-
-    /* free self */
-    MemFree ( ctx, self, bytes );
-}
-
-/* FullSpec
- */
-static
-const char *PoslenColReaderFullSpec ( const PoslenColReader *self, const ctx_t *ctx )
-{
-    return self -> full_spec;
-}
-
-
-/* IdRange
- *  returns the number of ids available
- *  and optionally the first id
- */
-static
-uint64_t PoslenColReaderIdRange ( const PoslenColReader *self,
-    const ctx_t *ctx, int64_t *opt_first )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( opt_first != NULL )
-    {
-        ON_FAIL ( * opt_first = self -> first_id )
-            return 0;
-    }
-
-    return MapFileCount ( self -> tmp_col, ctx );
-}
-
-
-/* PreCopy
- *  create buffer
- */
-static
-void PoslenColReaderPreCopy ( PoslenColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    const Tool *tp = ctx -> caps -> tool;
-
-    self -> max_ids = tp -> max_poslen_ids;
-    if ( tp -> max_poslen_ids < 4096 )
-        self -> max_ids = 4096;
-
-    TRY ( self -> buff = MemAlloc ( ctx, self -> max_ids * sizeof * self -> buff, false ) )
-    {
-        self -> start_id = self -> excl_stop_id = self -> first_id;
-    }
-    CATCH_ALL ()
-    {
-        ANNOTATE ( "failed to allocate buffer for PoslenColReader" );
-    }
-}
-
-
-/* PostCopy
- *  douse buffer
- */
-static
-void PoslenColReaderPostCopy ( PoslenColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> buff != NULL )
-    {
-        TRY ( MemFree ( ctx, self -> buff, self -> max_ids * sizeof * self -> buff ) )
-        {
-            self -> buff = NULL;
-        }
-    }
-}
-
-
-/* Read
- *  read next row of data
- *  returns NULL if no rows are available
- */
-static
-const void *PoslenColReaderRead ( PoslenColReader *self, const ctx_t *ctx,
-    int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint32_t dummy;
-
-    if ( elem_bits == NULL )
-        elem_bits = & dummy;
-    if ( boff == NULL )
-        boff = & dummy;
-    if ( row_len == NULL )
-        row_len = & dummy;
-
-    * elem_bits = 64;
-    * boff = 0;
-    * row_len = 0;
-
-    assert ( self -> buff != NULL );
-
-    if ( row_id < self -> start_id || row_id >= self -> excl_stop_id )
-    {
-        size_t num_read;
-
-        if ( row_id < self -> first_id )
-            return NULL;
-
-        /* generate page-aligned starting id */
-        self -> start_id = ( row_id - self -> first_id );
-        self -> start_id -= self -> start_id % self -> max_ids;
-        self -> start_id += self -> first_id;
-        assert ( self -> start_id + self -> max_ids > row_id );
-
-        /* read into buffer */
-        ON_FAIL ( num_read = MapFileReadPoslen ( self -> tmp_col, ctx, self -> start_id, self -> buff, self -> max_ids ) )
-        {
-            self -> start_id = self -> excl_stop_id = self -> first_id;
-            return NULL;
-        }
-        self -> excl_stop_id = self -> start_id + num_read;
-
-        if ( row_id >= self -> excl_stop_id )
-            return NULL;
-    }
-
-    * row_len = 1;
-    return & self -> buff [ row_id - self -> start_id ];
-}
-
-static ColumnReader_vt PoslenColReader_vt =
-{
-    PoslenColReaderWhack,
-    PoslenColReaderFullSpec,
-    PoslenColReaderIdRange,
-    PoslenColReaderPreCopy,
-    PoslenColReaderPostCopy,
-    PoslenColReaderRead
-};
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- */
-
-
-/* MakePoslenColReader
- *  make temporary column reader
- */
-ColumnReader *TablePairMakePoslenColReader ( TablePair *self, const ctx_t *ctx,
-    const MapFile *tmp_col, const char *colspec )
-{
-    FUNC_ENTRY ( ctx );
-
-    PoslenColReader *col;
-    size_t full_spec_size = self -> full_spec_size + string_size ( colspec ) + sizeof "src.." - 1;
-
-    TRY ( col = MemAlloc ( ctx, sizeof * col + full_spec_size, false ) )
-    {
-        TRY ( ColumnReaderInit ( & col -> dad, ctx, & PoslenColReader_vt ) )
-        {
-            TRY ( col -> first_id = MapFileFirst ( tmp_col, ctx ) )
-            {
-                TRY ( col -> tmp_col = MapFileDuplicate ( tmp_col, ctx ) )
-                {
-                    rc_t rc;
-
-                    col -> dad . presorted = true;
-                    col -> start_id = col -> excl_stop_id = col -> first_id;
-                    col -> buff = NULL;
-                    col -> max_ids = ctx -> caps -> tool -> max_poslen_ids;
-                    col -> full_spec_size = ( uint32_t ) full_spec_size;
-
-                    rc = string_printf ( col -> full_spec, full_spec_size + 1, NULL,
-                        "src.%s.%s", self -> full_spec, colspec );
-                    if ( rc == 0 )
-                        return & col -> dad;
-
-                    ABORT ( rc, "miscalculated string size" );
-                }
-            }
-        }
-
-        MemFree ( ctx, col, sizeof * col + full_spec_size );
-    }
-    CATCH_ALL ()
-    {
-        ANNOTATE ( "failed to allocate %zu bytes for PoslenColReader", sizeof * col + full_spec_size );
-    }
-
-    return NULL;
-
-}
-
-
-/*--------------------------------------------------------------------------
- * PoslenColWriter
- *  implementation of ColumnWriter based upon VCursor
- */
-struct PoslenColWriter
-{
-    ColumnWriter dad;
-
-    VCursor *curs;
-    uint32_t global_ref_start;
-    uint32_t ref_len;
-
-    uint32_t full_spec_size;
-    char full_spec [ 1 ];
-};
-
-static
-void PoslenColWriterWhack ( PoslenColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VCursorRelease ( self -> curs );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorRelease failed on column '%s'", self -> full_spec );
-
-    MemFree ( ctx, self, sizeof * self + self -> full_spec_size );
-}
-
-
-static
-const char *PoslenColWriterFullSpec ( const PoslenColWriter *self, const ctx_t *ctx )
-{
-    return self -> full_spec;
-}
-
-static
-void PoslenColWriterDummyStub ( PoslenColWriter *self, const ctx_t *ctx )
-{
-}
-
-static
-void PoslenColWriterWrite ( PoslenColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    uint64_t poslen;
-
-    uint32_t ref_len;
-    uint64_t global_ref_start;
-
-    assert ( elem_bits == 64 );
-    assert ( boff == 0 );
-    assert ( row_len == 1 );
-
-    memcpy ( & poslen, data, sizeof poslen );
-    global_ref_start = decode_pos_len ( poslen );
-    ref_len = poslen_to_len ( poslen );
-
-    rc = VCursorOpenRow ( self -> curs );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorOpenRow failed on column '%s'", self -> full_spec );
-    else
-    {
-        rc = VCursorWrite ( self -> curs, self -> global_ref_start, sizeof global_ref_start * 8, & global_ref_start, 0, 1 );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "VCursorWrite failed for GLOBAL_REF_START of column '%s'", self -> full_spec );
-        else
-        {
-            rc = VCursorWrite ( self -> curs, self -> ref_len, sizeof ref_len * 8, & ref_len, 0, 1 );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "VCursorWrite failed for REF_LEN of column '%s'", self -> full_spec );
-            else
-            {
-                rc = VCursorCommitRow ( self -> curs );
-                if ( rc != 0 )
-                    SYSTEM_ERROR ( rc, "VCursorCommit failed for column '%s'", self -> full_spec );
-            }
-        }
-
-        rc = VCursorCloseRow ( self -> curs );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorCloseRow failed on column '%s'", self -> full_spec );
-    }
-}
-
-static
-void PoslenColWriterWriteStatic ( PoslenColWriter *self, const ctx_t *ctx,
-    uint32_t elem_bits, const void *data, uint32_t boff, uint32_t row_len, uint64_t count )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint64_t poslen;
-
-    uint32_t ref_len;
-    uint64_t global_ref_start;
-
-    assert ( elem_bits == 64 );
-    assert ( boff == 0 );
-    assert ( row_len == 1 );
-
-    memcpy ( & poslen, data, sizeof poslen );
-    global_ref_start = decode_pos_len ( poslen );
-    ref_len = poslen_to_len ( poslen );
-
-    for ( ; ! FAILED () && count > 0; -- count )
-    {
-        rc_t rc = VCursorOpenRow ( self -> curs );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorOpenRow failed on column '%s'", self -> full_spec );
-        else
-        {
-            rc = VCursorWrite ( self -> curs, self -> global_ref_start, sizeof global_ref_start * 8, & global_ref_start, 0, 1 );
-            if ( rc != 0 )
-                SYSTEM_ERROR ( rc, "VCursorWrite failed for GLOBAL_REF_START of column '%s'", self -> full_spec );
-            else
-            {
-                rc = VCursorWrite ( self -> curs, self -> ref_len, sizeof ref_len * 8, & ref_len, 0, 1 );
-                if ( rc != 0 )
-                    SYSTEM_ERROR ( rc, "VCursorWrite failed for REF_LEN of column '%s'", self -> full_spec );
-                else
-                {
-                    rc = VCursorCommitRow ( self -> curs );
-                    if ( rc != 0 )
-                        SYSTEM_ERROR ( rc, "VCursorCommit failed for column '%s'", self -> full_spec );
-                    else if ( count > 1 )
-                    {
-                        uint64_t cnt = (count < 0x20000000U ) ? count : 0x20000000U;
-                        rc = VCursorRepeatRow ( self -> curs, cnt - 1 );
-                        if ( rc != 0 )
-                            SYSTEM_ERROR ( rc, "VCursorRepeatRow failed for column '%s'", self -> full_spec );
-                        count -= cnt - 1;
-                    }
-                }
-            }
-
-            rc = VCursorCloseRow ( self -> curs );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "VCursorCloseRow failed on column '%s'", self -> full_spec );
-        }
-    }
-}
-
-static
-void PoslenColWriterCommit ( PoslenColWriter *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VCursorCommit ( self -> curs );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorCommit failed on column '%s'", self -> full_spec );
-    else
-    {
-        rc = VCursorRelease ( self -> curs );
-        if ( rc != 0 )
-            ERROR ( rc, "VCursorRelease failed on column '%s'", self -> full_spec );
-        else
-        {
-            self -> curs = NULL;
-        }
-    }
-}
-
-
-static ColumnWriter_vt PoslenColWriter_vt =
-{
-    PoslenColWriterWhack,
-    PoslenColWriterFullSpec,
-    PoslenColWriterDummyStub,
-    PoslenColWriterDummyStub,
-    PoslenColWriterWrite,
-    PoslenColWriterWriteStatic,
-    PoslenColWriterCommit
-};
-
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- */
-
-
-/* MakePoslenColWriter
- */
-ColumnWriter *TablePairMakePoslenColWriter ( TablePair *self, const ctx_t *ctx,
-   VCursor *opt_curs, const char *colspec )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    VCursor *curs;
-
-    if ( opt_curs != NULL )
-        rc = VCursorAddRef ( curs = opt_curs );
-    else
-        rc = VTableCreateCursorWrite ( self -> dtbl, & curs, kcmInsert );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to create cursor on column 'dst.%s.%s'", self -> full_spec, colspec );
-    else
-    {
-        uint32_t global_ref_start;
-        const char *subcolspec = "(U64)GLOBAL_REF_START";
-        rc = VCursorAddColumn ( curs, & global_ref_start, subcolspec );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to add column 'dst.%s.%s' to cursor", self -> full_spec, subcolspec );
-        else
-        {
-            uint32_t ref_len;
-            subcolspec = "(INSDC:coord:len)REF_LEN";
-            rc = VCursorAddColumn ( curs, & ref_len, subcolspec );
-            if ( rc != 0 )
-                ERROR ( rc, "failed to add column 'dst.%s.%s' to cursor", self -> full_spec, subcolspec );
-            else
-            {
-                VCursorSuspendTriggers ( curs );
-                rc = VCursorOpen ( curs );
-                if ( rc != 0 )
-                    ERROR ( rc, "failed to open cursor on columns for 'dst.%s.%s'", self -> full_spec, colspec );
-                else
-                {
-                    PoslenColWriter *col;
-                    size_t full_spec_size = self -> full_spec_size + string_size ( colspec ) + sizeof "dst.." - 1;
-
-                    TRY ( col = MemAlloc ( ctx, sizeof * col + full_spec_size, false ) )
-                    {
-                        ColumnWriterInit ( & col -> dad, ctx, & PoslenColWriter_vt, false );
-                        col -> curs = curs;
-                        col -> global_ref_start = global_ref_start;
-                        col -> ref_len = ref_len;
-
-                        col -> full_spec_size = ( uint32_t ) full_spec_size;
-                        rc = string_printf ( col -> full_spec, full_spec_size + 1, NULL,
-                            "dst.%s.%s", self -> full_spec, colspec );
-                        if ( rc == 0 )
-                            return & col -> dad;
-
-                        ABORT ( rc, "miscalculated string size" );
-                    }
-                    CATCH_ALL ()
-                    {
-                        ANNOTATE ( "failed to allocate %zu bytes for PoslenColWriter", sizeof * col + full_spec_size );
-                    }
-                }
-            }
-        }
-
-        VCursorRelease ( curs );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/poslen-col-pair.h b/tools/sra-sort/poslen-col-pair.h
deleted file mode 100644
index e4f4087..0000000
--- a/tools/sra-sort/poslen-col-pair.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_poslen_col_pair_
-#define _h_sra_sort_poslen_col_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VCursor;
-struct TablePair;
-struct ColumnReader;
-struct ColumnWriter;
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- */
-
-
-/* MakePoslenColReader
- *  make temporary column reader
- */
-struct ColumnReader *TablePairMakePoslenColReader ( struct TablePair *self, const ctx_t *ctx,
-    struct MapFile const *tmp_col, const char *colspec );
-
-
-/* MakePoslenColWriter
- */
-struct ColumnWriter *TablePairMakePoslenColWriter ( struct TablePair *self,
-    const ctx_t *ctx, struct VCursor *opt_curs, const char *colspec );
-
-
-
-#endif /* _h_sra_sort_poslen_col_pair_ */
diff --git a/tools/sra-sort/ref-alignid-col.c b/tools/sra-sort/ref-alignid-col.c
deleted file mode 100644
index 59570df..0000000
--- a/tools/sra-sort/ref-alignid-col.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-struct AlignIdColReader;
-#define COLREADER_IMPL struct AlignIdColReader
-
-#include "ref-alignid-col.h"
-#include "glob-poslen.h"
-#include "csra-tbl.h"
-#include "csra-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "idx-mapping.h"
-#include "map-file.h"
-#include "sra-sort.h"
-
-#include <vdb/cursor.h>
-#include <kapp/main.h>
-#include <klib/sort.h>
-#include <klib/rc.h>
-
-#include <string.h>
-#include <assert.h>
-
-FILE_ENTRY ( ref-alignid-col );
-
-
-/*--------------------------------------------------------------------------
- * IdPosLen
- */
-typedef struct IdPosLen IdPosLen;
-struct IdPosLen
-{
-    int64_t id;
-    uint64_t poslen;
-};
-
-#if USE_OLD_KSORT
-static
-int CC IdPosLenCmpPos ( const void *a, const void *b, void *data )
-{
-    const IdPosLen *ap = a;
-    const IdPosLen *bp = b;
-
-    if ( ap -> poslen < bp -> poslen )
-        return -1;
-    if ( ap -> poslen > bp -> poslen )
-        return 1;
-    if ( ap -> id < bp -> id )
-        return -1;
-    return ap -> id > bp -> id;
-}
-
-static
-int CC cmp_int64_t ( const void *a, const void *b, void *data )
-{
-    const int64_t *ap = a;
-    const int64_t *bp = b;
-
-    if ( * ap < * bp )
-        return -1;
-    return * ap > * bp;
-}
-#else
-
-static
-void ksort_IdPosLen_pos ( IdPosLen *pbase, size_t total_elems )
-{
-#define SWAP( a, b, off, size )                               \
-    do                                                        \
-    {                                                         \
-        IdPosLen tmp = * ( const IdPosLen* ) ( a );           \
-        * ( IdPosLen* ) ( a ) = * ( const IdPosLen* ) ( b );  \
-        * ( IdPosLen* ) ( b ) = tmp;                          \
-    } while ( 0 )
-
-
-#define CMP( a, b )                                                                                   \
-     ( ( ( ( const IdPosLen* ) ( a ) ) -> poslen == ( ( const IdPosLen* ) ( b ) ) -> poslen ) ?       \
-       ( ( ( const IdPosLen* ) ( a ) ) -> id < ( ( const IdPosLen* ) ( b ) ) -> id ) ? -1 :           \
-       ( ( ( const IdPosLen* ) ( a ) ) -> id > ( ( const IdPosLen* ) ( b ) ) -> id )                  \
-       : ( ( ( const IdPosLen* ) ( a ) ) -> poslen < ( ( const IdPosLen* ) ( b ) ) -> poslen ) ? -1 : \
-       ( ( ( const IdPosLen* ) ( a ) ) -> poslen > ( ( const IdPosLen* ) ( b ) ) -> poslen ) )
-
-    KSORT ( pbase, total_elems, sizeof * pbase, 0, sizeof * pbase );
-
-#undef SWAP
-#undef CMP
-
-}
-#endif
-
-
-/*--------------------------------------------------------------------------
- * AlignIdColReader
- */
-typedef struct AlignIdColReader AlignIdColReader;
-struct AlignIdColReader
-{
-    ColumnReader dad;
-
-    /* state for id range:
-       first = slot [ 0 ] of map
-       row_id = needs to match request - we only accept serial scans
-       next_id = next id to fetch from "ids"
-       last_excl = end of "ids" */
-    int64_t first, row_id, next_id, last_excl;
-
-    /* sequence for handing out new ids */
-    int64_t new_id;
-
-    /* reader onto our join index column */
-    ColumnReader *ids;
-
-    /* reader onto alignment table
-       to retrieve GLOBAL_REF_START + REF_LEN */
-    ColumnReader *poslen;
-
-    /* bi-directional index for writing
-       new=>old and old=>new mappings */
-    MapFile *idx;
-
-    /* buffer for sorted data */
-    union
-    {
-        int64_t *ids;
-        IdPosLen *id_poslen;
-        IdxMapping *id_map;
-    } u;
-    size_t max_elems;
-    size_t num_elems;
-    size_t cur_elem;
-
-    /* buffer for id row */
-    int64_t *row;
-    size_t max_row_len;
-
-    /* chunk-size */
-    size_t chunk_size;
-
-    /* whether we have all ids or not */
-    bool entire_table;
-};
-
-static
-void AlignIdColReaderDestroy ( AlignIdColReader *self, const ctx_t *ctx )
-{
-    if ( self -> ids != NULL )
-    {
-        FUNC_ENTRY ( ctx );
-
-        STATUS ( 4, "destroying align-column reader '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-
-        /* tear everything down */
-        MapFileRelease ( self -> idx, ctx );
-        self -> idx = NULL;
-
-        ColumnReaderRelease ( self -> poslen, ctx );
-        self -> poslen = NULL;
-
-        ColumnReaderRelease ( self -> ids, ctx );
-        self -> ids = NULL;
-
-        if ( self -> u . id_poslen != NULL )
-        {
-            MemFree ( ctx, self -> u . id_poslen, sizeof * self -> u . id_poslen * self -> max_elems );
-            self -> u . id_poslen = NULL;
-        }
-        if ( self -> row != NULL )
-        {
-            MemFree ( ctx, self -> row, sizeof self -> row [ 0 ] * self -> max_row_len );
-            self -> row = NULL;
-        }
-    }
-}
-
-static
-void AlignIdColReaderWhack ( AlignIdColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* tear down self */
-    AlignIdColReaderDestroy ( self, ctx );
-
-    /* tear down super-class */
-    ColumnReaderDestroy ( & self -> dad, ctx );
-
-    /* gone */
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-const char *AlignIdColReaderFullSpec ( const AlignIdColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    return ColumnReaderFullSpec ( self -> ids, ctx );
-}
-
-static
-uint64_t AlignIdColReaderIdRange ( const AlignIdColReader *self, const ctx_t *ctx, int64_t *opt_first )
-{
-    FUNC_ENTRY ( ctx );
-    return ColumnReaderIdRange ( self -> ids, ctx, opt_first );
-}
-
-static
-void AlignIdColReaderFlushToIdx ( AlignIdColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> idx != NULL )
-    {
-        const Tool *tp = ctx -> caps -> tool;
-
-        /* write new=>old ids  */
-        STATUS ( 3, "%s new=>old id map", tp -> write_new_to_old ? "writing" : "setting" );
-        ON_FAIL ( MapFileSetNewToOld ( self -> idx, ctx, self -> u . id_map, self -> num_elems ) )
-        {
-            ANNOTATE ( "failed to record new to old id mappings for '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-            return;
-        }
-        if ( tp -> sort_before_old2new )
-        {
-            /* sort by old ids */
-            STATUS ( 3, "sorting id-map by old-id" );
-#if USE_OLD_KSORT
-            ksort ( self -> u . id_map, self -> num_elems, sizeof self -> u . id_map [ 0 ], IdxMappingCmpOld, ( void* ) ctx );
-#else
-            IdxMappingSortOld ( self -> u . id_map, ctx, self -> num_elems );
-#endif
-        }
-
-        /* write old=>new ids  */
-        STATUS ( 3, "writing old=>new id map" );
-        ON_FAIL ( MapFileSetOldToNew ( self -> idx, ctx, self -> u . id_map, self -> num_elems ) )
-        {
-            ANNOTATE ( "failed to record old to new id mappings for '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-            return;
-        }
-
-        STATUS ( 3, "done writing id maps" );
-    }
-
-    /* empty buffer */
-    self -> first = self -> next_id;
-}
-
-static
-void AlignIdColReaderPreCopy ( AlignIdColReader *self, const ctx_t *ctx )
-{
-    /* TBD - a good place to allocate memory */
-}
-
-static
-void AlignIdColReaderPostCopy ( AlignIdColReader *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* called after a single copy
-       assumes that entire row-range of table has been copied */
-
-    /* tear down self */
-    AlignIdColReaderDestroy ( self, ctx );
-}
-
-static
-const void *AlignIdColReaderRead ( AlignIdColReader *self, const ctx_t *ctx,
-    int64_t row_id, uint32_t *elem_bits, uint32_t *boff, uint32_t *row_len )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const void *base;
-    uint32_t num_read32;
-    size_t i, num_read;
-
-    /* handle bad parameters */
-    uint32_t dummy [ 3 ];
-    if ( elem_bits == NULL )
-        elem_bits = & dummy [ 0 ];
-    if ( boff == NULL )
-        boff = & dummy [ 1 ];
-    if ( row_len == NULL )
-        row_len = & dummy [ 2 ];
-
-    /* THERE ARE three stages to this method:
-       1a. detect need to allocate id map
-       1b. detect need to flush to index
-       2.  detect need to refresh id map
-       3.  respond to read request
-     */
-
-    if ( row_id != self -> row_id )
-    {
-        /* error condition */
-        rc = RC ( rcExe, rcCursor, rcReading, rcParam, rcIncorrect );
-        INTERNAL_ERROR ( rc, "AlignIdColReader only supports serial access" );
-        return NULL;
-    }
-
-    /* stage 1 - allocate or flush */
-    if ( self -> u . ids == NULL && ! self -> entire_table )
-    {
-        /* limit ids to actual count */
-        uint64_t num_ids = MapFileCount ( self -> idx, ctx );
-        self -> max_elems = ctx -> caps -> tool -> max_ref_idx_ids;
-        if ( ( uint64_t ) self -> max_elems > num_ids )
-            self -> max_elems = ( size_t ) num_ids;
-
-        /* allocate the buffer */
-        do
-        {
-            CLEAR ();
-
-            TRY ( self -> u . id_poslen = MemAlloc ( ctx, sizeof self -> u . id_poslen [ 0 ] * self -> max_elems, false ) )
-            {
-                STATUS ( 4, "allocated map buffer with %,zu elements", self -> max_elems );
-                break;
-            }
-
-            self -> max_elems >>= 1;
-        }
-        while ( self -> max_elems >= 1024 * 1024 );
-
-        if ( FAILED () )
-        {
-            ANNOTATE ( "failed to allocate id buffer" );
-            return NULL;
-        }
-
-        /* notice if we have the entire table */
-        if ( ( uint64_t ) self -> max_elems == num_ids )
-            self -> entire_table = true;
-
-        /* allocate a row buffer */
-        self -> max_row_len = 8 * 1024;
-        ON_FAIL ( self -> row = MemAlloc ( ctx, sizeof self -> row [ 8 ] * self -> max_row_len, false ) )
-        {
-            ANNOTATE ( "failed to allocate row buffer" );
-            return NULL;
-        }
-
-        assert ( self -> first == self -> next_id );
-        assert ( self -> first == row_id );
-    }
-    else if ( row_id == self -> next_id && self -> first < row_id )
-    {
-        ON_FAIL ( AlignIdColReaderFlushToIdx ( self, ctx ) )
-            return NULL;
-    }
-
-    /* stage 2 - refresh */
-    if ( self -> first == self -> next_id )
-    {
-        /* if there are no more rows, return NULL  */
-        if ( self -> next_id == self -> last_excl )
-        {
-            STATUS ( 3, "done reading '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-            return NULL;
-        }
-
-        self -> cur_elem = 0;
-
-        /* if the entire table will be read into memory,
-           there is no point in reading/sorting the ids */
-        if ( self -> entire_table )
-        {
-            STATUS ( 3, "auto-generating %,zu ids for '%s'", self -> max_elems, ColumnReaderFullSpec ( self -> ids, ctx ) );
-            for ( i = 0; i < self -> max_elems; ++ i )
-            {
-                self -> u . id_poslen [ i ] . id = self -> first + i;
-#if _DEBUGGING
-                self -> u . id_poslen [ i ] . poslen = 0;
-#endif
-            }
-
-            self -> num_elems = self -> max_elems;
-            self -> next_id = self -> last_excl;
-        }
-        else
-        {
-            /* read up to max_elems into id array */
-            STATUS ( 3, "reading ids from '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-            for ( self -> num_elems = 0; self -> next_id < self -> last_excl; self -> num_elems += num_read, ++ self -> next_id )
-            {
-                /* read a row of ids */
-                ON_FAIL ( base = ColumnReaderRead ( self -> ids, ctx, self -> next_id, elem_bits, boff, & num_read32 ) )
-                {
-                    ANNOTATE ( "failed to read id column" );
-                    return NULL;
-                }
-
-                /* we expect empty rows */
-                num_read = num_read32;
-                if ( num_read == 0 )
-                    continue;
-
-                assert ( * elem_bits == sizeof self -> u . ids [ 0 ] * 8 );
-                assert ( * boff == 0 );
-
-                /* detect when buffer is full */
-                if ( self -> num_elems + num_read > self -> max_elems )
-                {
-                    /* if we've read at least one row, then we're okay */
-                    if ( self -> first < self -> next_id )
-                        break;
-
-                    /* error condition - buffer was too small to read a single row */
-                    rc = RC ( rcExe, rcCursor, rcReading, rcBuffer, rcInsufficient );
-                    ERROR ( rc, "allocated buffer was too small ( %zu elems ) to read a single row ( id %ld, row-len %zu )",
-                            self -> max_elems, self -> next_id, num_read );
-                    return NULL;
-                }
-
-                /* bring them in */
-                memcpy ( & self -> u . ids [ self -> num_elems ], base, num_read * sizeof self -> u . ids [ 0 ] );
-            }
-
-            /* sort to produce sparse but ordered list */
-            STATUS ( 3, "sorting %,zu 64-bit ids", self -> num_elems );
-#if USE_OLD_KSORT
-            ksort ( self -> u . ids, self -> num_elems, sizeof self -> u . ids [ 0 ], cmp_int64_t, ( void* ) ctx );
-#else
-            ksort_int64_t ( self -> u . ids, self -> num_elems );
-#endif
-
-            /* transform from ids to id_poslen */
-            STATUS ( 3, "expanding ids to ( id, position, len ) tuples" );
-            for ( i = self -> num_elems; i > 1 ; )
-            {
-                -- i;
-                self -> u . id_poslen [ i ] . id = self -> u . ids [ i ];
-            }
-        }
-
-        /* read num_elems from poslen */
-        STATUS ( 3, "reading ( position, len ) pairs from '%s'", ColumnReaderFullSpec ( self -> poslen, ctx ) );
-        for ( i = 0; i < self -> num_elems; ++ i )
-        {
-            ON_FAIL ( base = ColumnReaderRead ( self -> poslen, ctx, self -> u . id_poslen [ i ] . id, elem_bits, boff, & num_read32 ) )
-            {
-                ANNOTATE ( "failed to read global ref-start from alignment table" );
-                return NULL;
-            }
-
-            num_read = num_read32;
-            assert ( * elem_bits == sizeof self -> u . id_poslen [ 0 ] . poslen * 8 );
-            assert ( * boff == 0 );
-            assert ( num_read == 1 );
-
-            self -> u . id_poslen [ i ] . poslen = * ( uint64_t* ) base;
-        }
-
-        /* sort by poslen */
-        STATUS ( 3, "sorting ( id, position, len ) tuples on position, len DESC" );
-#if USE_OLD_KSORT
-        ksort ( self -> u . id_poslen, self -> num_elems, sizeof self -> u . id_poslen [ 0 ], IdPosLenCmpPos, ( void* ) ctx );
-#else
-        ksort_IdPosLen_pos ( self -> u . id_poslen, self -> num_elems );
-#endif
-
-        /* write poslen to temp column */
-        STATUS ( 3, "writing ( position, len ) to temp column" );
-        ON_FAIL ( MapFileSetPoslen ( self -> idx, ctx, self -> u . id_map, self -> num_elems ) )
-        {
-            ANNOTATE ( "failed to write temporary poslen column for '%s'", ColumnReaderFullSpec ( self -> ids, ctx ) );
-            return NULL;
-        }
-
-        STATUS ( 3, "done writing ( position, len )" );
-    }
-
-    /* stage 3 - build a row */
-    for ( num_read = ( size_t ) ( self -> num_elems - self -> cur_elem ), i = 0; i < num_read; ++ i )
-    {
-        /* whatever the current element is, it must belong to this row */
-        uint64_t pos = decode_pos_len ( self -> u . id_poslen [ self -> cur_elem + i ] . poslen );
-        int64_t cur_row_id = global_to_row_id ( pos, self -> chunk_size );
-        if ( cur_row_id != row_id )
-        {
-            num_read = i;
-            break;
-        }
-    }
-
-    /* "num_read" now has the number of elements in this row */
-    if ( num_read > self -> max_row_len )
-    {
-        STATUS ( 4, "reallocating row buffer for row-length %,zu", num_read );
-
-        /* realloc the row buffer */
-        MemFree ( ctx, self -> row, self -> max_row_len * sizeof self -> row [ 0 ] );
-
-        self -> max_row_len = ( num_read + 4095 ) & ~ ( size_t ) 4095;
-        ON_FAIL ( self -> row = MemAlloc ( ctx, sizeof self -> row [ 0 ] * self -> max_row_len, false ) )
-        {
-            ANNOTATE ( "failed to reallocate row buffer" );
-            return NULL;
-        }
-    }
-
-    /* build the row, assigning new ids */
-    for ( i = 0; i < num_read; ++ i )
-    {
-        self -> row [ i ] = ++ self -> new_id;
-        self -> u . id_map [ self -> cur_elem + i ] . new_id = self -> new_id;
-    }
-
-    /* advance row_id */
-    self -> cur_elem += num_read;
-    if ( ++ self -> row_id == self -> last_excl )
-    {
-        /* if this was the last row, flush index  */
-        ON_FAIL ( AlignIdColReaderFlushToIdx ( self, ctx ) )
-            return NULL;
-
-        if ( ctx -> caps -> tool -> idx_consistency_check && self -> idx != NULL )
-        {
-            ON_FAIL ( MapFileConsistencyCheck ( self -> idx, ctx ) )
-                return NULL;
-        }
-    }
-
-    /* return row */
-    * elem_bits = sizeof self -> row [ 0 ] * 8;
-    * boff = 0;
-    * row_len = num_read;
-    return self -> row;
-}
-
-static ColumnReader_vt AlignIdColReader_vt =
-{
-    AlignIdColReaderWhack,
-    AlignIdColReaderFullSpec,
-    AlignIdColReaderIdRange,
-    AlignIdColReaderPreCopy,
-    AlignIdColReaderPostCopy,
-    AlignIdColReaderRead
-};
-
-
-/*--------------------------------------------------------------------------
- * RefTblPair
- */
-static
-size_t RefTblPairGetChunkSize ( TablePair *self, const ctx_t *ctx, const VCursor **cursp )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    rc = VTableCreateCursorRead ( self -> stbl, cursp );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to create cursor on '%s'", self -> full_spec );
-    else
-    {
-        uint32_t idx;
-        const VCursor *curs = * cursp;
-        rc = VCursorAddColumn ( curs, & idx, "MAX_SEQ_LEN" );
-        if ( rc != 0 )
-            rc = VCursorAddColumn ( curs, & idx, "CHUNK_SIZE" );
-        if ( rc != 0 )
-            ERROR ( rc, "VCursorAddColumn - failed to determine chunk size of '%s'", self -> full_spec );
-        else
-        {
-            rc = VCursorOpen ( curs );
-            if ( rc != 0 )
-                ERROR ( rc, "VCursorOpen - failed to determine chunk size of '%s'", self -> full_spec );
-            else
-            {
-                uint32_t row_len, chunk_size;
-                rc = VCursorReadDirect ( curs, 1, idx,
-                    sizeof chunk_size * 8, & chunk_size, 1, & row_len );
-                if ( rc != 0 )
-                    ERROR ( rc, "VCursorReadDirect - failed to determine chunk size of '%s'", self -> full_spec );
-                else if ( row_len != 1 )
-                {
-                    rc = RC ( rcExe, rcCursor, rcReading, rcData, rcInsufficient );
-                    ERROR ( rc, "VCursorReadDirect - failed to determine chunk size of '%s'", self -> full_spec );
-                }
-                else
-                {
-                    STATUS ( 3, "'%s' chunk size determined to be %u", self -> full_spec, chunk_size );
-                    return chunk_size;
-                }
-            }
-        }
-
-        VCursorRelease ( curs );
-        * cursp = NULL;
-    }
-
-    return 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * ColumnReader
- *  interface to read column in random order
- */
-
-
-/* MakeAlignIdReader
- */
-ColumnReader *TablePairMakeAlignIdReader ( TablePair *self,
-    const ctx_t *ctx, TablePair *align_tbl, MapFile *idx, const char *colspec )
-{
-    FUNC_ENTRY ( ctx );
-
-    size_t chunk_size;
-    const VCursor *curs;
-
-    /* determine chunk size and keep cursor for id reader */
-    TRY ( chunk_size = RefTblPairGetChunkSize ( self, ctx, & curs ) )
-    {
-        ColumnReader *ids;
-
-        /* need to create a traditional reader on self */
-        TRY ( ids = TablePairMakeColumnReader ( self, ctx, curs, colspec, true ) )
-        {
-            ColumnReader *poslen;
-
-            /* need to create a poslen reader on align_tbl */
-            TRY ( poslen = TablePairMakeGlobalPosLenReader ( align_tbl, ctx, ( uint32_t ) chunk_size ) )
-            {
-                int64_t first;
-                uint64_t count;
-
-                /* need to create a mapfile based on range of poslen */
-                TRY ( count = ColumnReaderIdRange ( poslen, ctx, & first ) )
-                {
-                    TRY ( MapFileSetIdRange ( idx, ctx, first, count ) )
-                    {
-                        AlignIdColReader *col;
-                        TRY ( col = MemAlloc ( ctx, sizeof * col, true ) )
-                        {
-                            TRY ( ColumnReaderInit ( & col -> dad, ctx, & AlignIdColReader_vt ) )
-                            {
-                                /* one more point of failure when obtaining the id range */
-                                TRY ( count = ColumnReaderIdRange ( ids, ctx, & first ) )
-                                {
-                                    TRY ( col -> idx = MapFileDuplicate ( idx, ctx ) )
-                                    {
-                                        col -> first = col -> row_id = col -> next_id = first;
-                                        col -> last_excl = first + count;
-                                        col -> ids = ids;
-                                        col -> poslen = poslen;
-                                        col -> chunk_size = chunk_size;
-                                        col -> entire_table = false;
-                                    
-                                        /* the actual working buffer is allocated upon demand
-                                           to avoid occupying space while waiting to execute */
-
-                                        /* douse the cursor here */
-                                        VCursorRelease ( curs );
-
-                                        return & col -> dad;
-                                    }
-                                }
-                            }
-                            
-                            MemFree ( ctx, col, sizeof * col );
-                        }
-                        
-                        MapFileRelease ( idx, ctx );
-                    }
-                }
-                
-                ColumnReaderRelease ( poslen, ctx );
-            }
-            
-            ColumnReaderRelease ( ids, ctx );
-        }
-
-        VCursorRelease ( curs );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/ref-alignid-col.h b/tools/sra-sort/ref-alignid-col.h
deleted file mode 100644
index 9b5ee84..0000000
--- a/tools/sra-sort/ref-alignid-col.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_ref_alignid_col_
-#define _h_sra_sort_ref_alignid_col_
-
-#ifndef _h_sra_sort_col_pair_
-#include "col-pair.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct MapFile;
-struct TablePair;
-
-
-/*--------------------------------------------------------------------------
- * AlignIdColReader
- */
-
-
-/* MakeAlignIdReader
- */
-ColumnReader *TablePairMakeAlignIdReader ( struct TablePair *self,
-    const ctx_t *ctx, struct TablePair *align_tbl, struct MapFile *idx, const char *colspec );
-
-
-#endif /* _h_sra_sort_ref_alignid_col_ */
diff --git a/tools/sra-sort/row-set-priv.h b/tools/sra-sort/row-set-priv.h
deleted file mode 100644
index 62c50d6..0000000
--- a/tools/sra-sort/row-set-priv.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_row_set_priv_
-#define _h_sra_sort_row_set_priv_
-
-#ifndef _h_sra_sort_row_set_
-#include "row-set.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * RowSetIterator
- *  the basic 4 types
- */
-RowSetIterator * MapFileMakeMappingRowSetIterator ( struct MapFile const *self, const ctx_t *ctx, bool large );
-RowSetIterator * MapFileMakeSortingRowSetIterator ( struct MapFile const *self, const ctx_t *ctx, bool large );
-RowSetIterator * TablePairMakeMappingRowSetIterator ( struct TablePair *self, const ctx_t *ctx, bool large );
-RowSetIterator * TablePairMakeSimpleRowSetIterator ( struct TablePair *self, const ctx_t *ctx );
-
-#endif /* _h_sra_sort_row_set_priv_ */
diff --git a/tools/sra-sort/row-set.c b/tools/sra-sort/row-set.c
deleted file mode 100644
index 59f1851..0000000
--- a/tools/sra-sort/row-set.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "row-set-priv.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <vdb/cursor.h>
-#include <klib/rc.h>
-
-FILE_ENTRY ( row-set );
-
-
-/*--------------------------------------------------------------------------
- * RowSet
- *  interface to iterate row-ids
- */
-
-
-/* Release
- *  releases reference
- */
-void RowSetRelease ( const RowSet *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "RowSet" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release RowSet" );
-        }
-    }
-}
-
-/* Duplicate
- */
-RowSet *RowSetDuplicate ( const RowSet *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "RowSet" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate RowSet" );
-            return NULL;
-        }
-    }
-
-    return ( RowSet* ) self;
-}
-
-
-/* Init
- */
-void RowSetInit ( RowSet *self, const ctx_t *ctx, const RowSet_vt *vt )
-{
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, "RowSet", "init", "" );
-    self -> align = 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * RowSetIterator
- *  interface to iterate RowSets
- */
-
-/* MakeRowSetIterator
- *  make RowSet iterator based upon parameters
- *  each RowSet will generate row-ids in src order
- *
- *  "sort_idx" [ IN ]
- *    if NULL, the RowSet objects will auto-generate row-ids
- *    otherwise, src row-ids will be selected from MapFile
- *
- *  "pairs" [ IN ]
- *    if true, the row-ids will be generated into an IdxMapping pair
- *    if false but "idx" is not NULL, the src row-ids will be generated
- *      into a single-id map, and new ordering preserved in parallel
- *    if false and "idx" is NULL, no additional structure will be generated
- */
-RowSetIterator *TablePairMakeRowSetIterator ( struct TablePair *self, const ctx_t *ctx,
-    struct MapFile const *sort_idx, bool pairs, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( sort_idx != NULL )
-    {
-        if ( pairs )
-            return MapFileMakeMappingRowSetIterator ( sort_idx, ctx, large );
-
-        return MapFileMakeSortingRowSetIterator ( sort_idx, ctx, large );
-    }
-
-    if ( pairs )
-        return TablePairMakeMappingRowSetIterator ( self, ctx, large );
-
-    return TablePairMakeSimpleRowSetIterator ( self, ctx );
-}
-
-
-/* Release
- *  releases reference
- */
-void RowSetIteratorRelease ( const RowSetIterator *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "RowSetIterator" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release RowSetIterator" );
-        }
-    }
-}
-
-/* Duplicate
- */
-RowSetIterator *RowSetIteratorDuplicate ( const RowSetIterator *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "RowSetIterator" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcCursor, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate RowSetIterator" );
-            return NULL;
-        }
-    }
-
-    return ( RowSetIterator* ) self;
-}
-
-
-/* Init
- */
-void RowSetIteratorInit ( RowSetIterator *self, const ctx_t *ctx, const RowSetIterator_vt *vt )
-{
-    self -> vt = vt;
-    KRefcountInit ( & self -> refcount, 1, "RowSetIterator", "init", "" );
-    self -> align = 0;
-}
diff --git a/tools/sra-sort/row-set.h b/tools/sra-sort/row-set.h
deleted file mode 100644
index 8ffa38a..0000000
--- a/tools/sra-sort/row-set.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_row_set_
-#define _h_sra_sort_row_set_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct MapFile;
-struct TablePair;
-struct IdxMapping;
-
-
-/*--------------------------------------------------------------------------
- * RowSet
- *  interface to iterate row-ids
- */
-typedef struct RowSet_vt RowSet_vt;
-
-typedef struct RowSet RowSet;
-struct RowSet
-{
-    const RowSet_vt *vt;
-    KRefcount refcount;
-    uint32_t align;
-};
-
-#ifndef ROWSET_IMPL
-#define ROWSET_IMPL RowSet
-#endif
-
-struct RowSet_vt
-{
-    /* called by Release */
-    void ( * whack ) ( ROWSET_IMPL *self, const ctx_t *ctx );
-
-    /* retrieve next set of row-ids */
-    size_t ( * next ) ( ROWSET_IMPL *self, const ctx_t *ctx,
-        int64_t *ids, size_t max_ids );
-
-    /* reset iterator to initial state */
-    void ( * reset ) ( ROWSET_IMPL *self, const ctx_t *ctx,
-        bool for_static );
-};
-
-
-/* Release
- *  releases reference
- */
-void RowSetRelease ( const RowSet *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-RowSet *RowSetDuplicate ( const RowSet *self, const ctx_t *ctx );
-
-
-/* Next
- *  return next set of row-ids
- *  returns 0 if no rows are available
- */
-#define RowSetNext( self, ctx, ids, max_ids ) \
-    POLY_DISPATCH_INT ( next, self, ROWSET_IMPL, ctx, ids, max_ids )
-
-
-/* Reset
- *  reset iterator to beginning
- */
-#define RowSetReset( self, ctx, for_static ) \
-    POLY_DISPATCH_VOID ( reset, self, ROWSET_IMPL, ctx, for_static )
-
-
-/* Init
- */
-void RowSetInit ( RowSet *self, const ctx_t *ctx, const RowSet_vt *vt );
-
-/* Destroy
- */
-#define RowSetDestroy( self, ctx ) \
-    ( ( void ) 0 )
-
-
-/*--------------------------------------------------------------------------
- * RowSetIterator
- *  interface to iterate RowSets
- */
-typedef struct RowSetIterator_vt RowSetIterator_vt;
-
-typedef struct RowSetIterator RowSetIterator;
-struct RowSetIterator
-{
-    const RowSetIterator_vt *vt;
-    KRefcount refcount;
-    uint32_t align;
-};
-
-#ifndef ROWSET_ITER_IMPL
-#define ROWSET_ITER_IMPL RowSetIterator
-#endif
-
-struct RowSetIterator_vt
-{
-    /* called by Release */
-    void ( * whack ) ( ROWSET_ITER_IMPL *self, const ctx_t *ctx );
-
-    /* retrieve row-id mapping pair */
-    struct IdxMapping* ( * get_idx_mapping ) ( ROWSET_ITER_IMPL *self, const ctx_t *ctx,
-        size_t *num_items );
-
-    /* retrieve src row-id array */
-    int64_t* ( * get_src_ids ) ( ROWSET_ITER_IMPL *self, const ctx_t *ctx,
-        uint32_t **opt_ord, size_t *num_items );
-
-    /* retrieve next row-set */
-    RowSet* ( * next ) ( ROWSET_ITER_IMPL *self, const ctx_t *ctx );
-};
-
-
-/* MakeRowSetIterator
- *  make RowSet iterator based upon parameters
- *  each RowSet will generate row-ids in src order
- *
- *  "sort_idx" [ IN ]
- *    if NULL, the RowSet objects will auto-generate row-ids
- *    otherwise, src row-ids will be selected from MapFile
- *
- *  "pairs" [ IN ]
- *    if true, the row-ids will be generated into an IdxMapping pair
- *    if false but "idx" is not NULL, the src row-ids will be generated
- *      into a single-id map, and new ordering preserved in parallel
- *    if false and "idx" is NULL, no additional structure will be generated
- *
- *  "large" [ IN ]
- *    if true, use a reduced id-range for the row-set
- */
-RowSetIterator *TablePairMakeRowSetIterator ( struct TablePair *self, const ctx_t *ctx,
-    struct MapFile const *sort_idx, bool pairs, bool large );
-
-
-/* Release
- *  releases reference
- */
-void RowSetIteratorRelease ( const RowSetIterator *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-RowSetIterator *RowSetIteratorDuplicate ( const RowSetIterator *self, const ctx_t *ctx );
-
-
-/* GetIdxMapping
- *  a little bit of plumbing to get the IdxMapping map
- */
-#define RowSetIteratorGetIdxMapping( self, ctx, num_items ) \
-    POLY_DISPATCH_PTR ( get_idx_mapping, self, ROWSET_ITER_IMPL, ctx, num_items )
-
-
-/* GetSourceIds
- *  a little bit of plumbing to get the individual source ids
- *  and optional new id ordering
- */
-#define RowSetIteratorGetSourceIds( self, ctx, opt_ord, num_items ) \
-    POLY_DISPATCH_PTR ( get_src_ids, self, ROWSET_ITER_IMPL, ctx, opt_ord, num_items )
-
-
-/* Next
- *  return next RowSet
- *  returns NULL if no rows are available
- */
-#define RowSetIteratorNext( self, ctx ) \
-    POLY_DISPATCH_PTR ( next, self, ROWSET_ITER_IMPL, ctx )
-
-
-/* Init
- */
-void RowSetIteratorInit ( RowSetIterator *self, const ctx_t *ctx, const RowSetIterator_vt *vt );
-
-/* Destroy
- */
-#define RowSetIteratorDestroy( self, ctx ) \
-    ( ( void ) 0 )
-
-
-#endif /* _h_sra_sort_row_set_ */
diff --git a/tools/sra-sort/run.c b/tools/sra-sort/run.c
deleted file mode 100644
index 8b55da7..0000000
--- a/tools/sra-sort/run.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "sra-sort.h"
-#include "db-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-
-#include <sra/sraschema.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <kfg/config.h>
-#include <klib/text.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( run );
-
-static
-void typename_to_config_path ( const char *in, char *out )
-{
-    bool end;
-    uint32_t i;
-
-    for ( end = false, i = 0; ! end; ++ i )
-    {
-        switch ( out [ i ] = in [ i ] )
-        {
-        case ':':
-            out [ i ] = '/';
-            break;
-        case ' ':
-        case '#':
-            out [ i ] = 0;
-        case 0:
-            end = true;
-            return;
-        }
-    }
-}
-
-static
-bool map_typename_builtin ( const ctx_t *ctx, const char *sub_node, const char *in, char *out, char *schema_src, size_t size )
-{
-    FUNC_ENTRY ( ctx );
-
-    size_t copied;
-
-#define ALIGN_EVIDENCE_MAP "NCBI:align:db:alignment_evidence_sorted"
-#define ALIGN_UNSORTED_MAP "NCBI:align:db:alignment_sorted"
-#define ALIGN_SRC          "align/align.vschema"
-
-    if ( strcmp ( out, "NCBI/align/db/alignment_evidence" ) == 0 )
-        copied = string_copy ( out, size, ALIGN_EVIDENCE_MAP, sizeof ALIGN_EVIDENCE_MAP - 1 );
-    else if ( strcmp ( out, "NCBI/align/db/alignment_unsorted" ) == 0 )
-        copied = string_copy ( out, size, ALIGN_UNSORTED_MAP, sizeof ALIGN_UNSORTED_MAP - 1 );
-    else
-    {
-        strcpy ( out, in );
-        schema_src [ 0 ] = 0;
-        return false;
-    }
-
-    if ( copied != size )
-    {
-        out [ copied ] = 0;
-        copied = string_copy ( schema_src, size, ALIGN_SRC, sizeof ALIGN_SRC - 1 );
-    }
-
-    if ( copied == size )
-    {
-        rc_t rc = RC ( rcExe, rcType, rcCopying, rcBuffer, rcInsufficient );
-        INTERNAL_ERROR ( rc, "failed to copy a built-in constant" );
-        strcpy ( out, in );
-        schema_src [ 0 ] = 0;
-        return false;
-    }
-
-#undef ALIGN_EVIDENCE_MAP
-#undef ALIGN_UNSORTED_MAP
-#undef ALIGN_SRC
-
-    schema_src [ copied ] = 0;
-    return true;
-}
-
-static
-bool map_typename ( const ctx_t *ctx, const char *sub_node, const char *in, char *out, char *schema_src, size_t size )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const KConfigNode *n;
-    size_t num_read, remaining;
-
-    typename_to_config_path ( in, out );
-
-    rc = KConfigOpenNodeRead ( ctx -> caps -> cfg, & n, "sra-sort/%s/%s", sub_node, out );
-    if ( rc != 0 )
-        return map_typename_builtin ( ctx, sub_node, in, out, schema_src, size );
-
-    rc = KConfigNodeRead ( n, 0, out, size - 1, & num_read, & remaining );
-    if ( rc != 0 )
-        ERROR ( rc, "KConfigNodeRead failed" );
-    else if ( remaining != 0 )
-    {
-        rc = RC ( rcExe, rcNode, rcReading, rcBuffer, rcInsufficient );
-        ERROR ( rc, "type map of '%s' is too long", in );
-    }
-    else
-    {
-        out [ num_read ] = 0;
-        typename_to_config_path ( out, schema_src );
-
-        KConfigNodeRelease ( n );
-        rc = KConfigOpenNodeRead ( ctx -> caps -> cfg, & n, "sra-sort/schema-src/%s", schema_src );
-        if ( rc != 0 )
-            ERROR ( rc, "KConfigOpenNodeRead - failed to find entry 'sra-sort/schema-src/%s'", schema_src );
-        else
-        {
-            rc = KConfigNodeRead ( n, 0, schema_src, size - 1, & num_read, & remaining );
-            if ( rc != 0 )
-                ERROR ( rc, "KConfigNodeRead failed" );
-            else if ( remaining != 0 )
-            {
-                rc = RC ( rcExe, rcNode, rcReading, rcBuffer, rcInsufficient );
-                ERROR ( rc, "type map of '%s' is too long", in );
-            }
-            else
-            {
-                schema_src [ num_read ] = 0;
-            }
-        }
-    }
-
-    KConfigNodeRelease ( n );
-    return true;
-}
-
-static
-VSchema *map_schema_types ( TypeParams *type, const ctx_t *ctx, const VSchema *src_schema )
-{
-    FUNC_ENTRY ( ctx );
-
-    bool mapped;
-    char schema_src [ 256 ];
-    assert ( sizeof schema_src == sizeof type -> dst_type );
-
-    TRY ( mapped = map_typename ( ctx, "out-map", type -> src_type, type -> dst_type, schema_src, sizeof schema_src ) )
-    {
-        rc_t rc;
-        VSchema *dst_schema;
-
-        if ( ! mapped )
-        {
-            type -> view_type [ 0 ] = 0;
-            rc = VSchemaAddRef ( src_schema );
-            if ( rc != 0 )
-                ERROR ( rc, "VSchemaAddRef failed" );
-            return ( VSchema* ) src_schema;
-        }
-
-        rc = VDBManagerMakeSchema ( ctx -> caps -> vdb, & dst_schema );
-        if ( rc != 0 )
-            ERROR ( rc, "VDBManagerMakeSchema failed" );
-        else
-        {
-            rc = VSchemaParseFile ( dst_schema, schema_src );
-            if ( rc != 0 )
-                ERROR ( rc, "VSchemaParseFile failed adding file '%s' for destination", src_schema );
-            else
-            {
-                TRY ( mapped = map_typename ( ctx, "view-map", type -> src_type, type -> view_type, schema_src, sizeof schema_src ) )
-                {
-                    if ( ! mapped )
-                    {
-                        type -> view_type [ 0 ] = 0;
-                        return dst_schema;
-                    }
-
-                    rc = VSchemaParseFile ( dst_schema, schema_src );
-                    if ( rc == 0 )
-                        return dst_schema;
-
-                    ERROR ( rc, "VSchemaParseFile failed adding file '%s' for view", src_schema );
-                }
-            }
-
-            VSchemaRelease ( dst_schema );
-        }
-    }
-
-    return NULL;
-}
-
-/* open_db
- *  called from run
- *  determines the type of schema
- *  opens output object
- *  dispatches to the appropriate handler
- */
-static
-void open_db ( const ctx_t *ctx, const VDatabase **srcp )
-{
-    FUNC_ENTRY ( ctx );
-
-    const VDatabase *src = *srcp;
-
-    const VSchema *src_schema;
-    rc_t rc = VDatabaseOpenSchema ( src, & src_schema );
-    if ( rc != 0 )
-        ERROR ( rc, "VDatabaseOpenSchema failed" );
-    else
-    {
-        TypeParams type;
-        rc = VDatabaseTypespec ( src, type . src_type, sizeof type . src_type );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to obtain database typespec" );
-        else
-        {
-            VSchema *dst_schema;
-
-            /* map input type to output type */
-            TRY ( dst_schema = map_schema_types ( & type, ctx, src_schema ) )
-            {
-                const Tool *tp = ctx -> caps -> tool;
-
-                /* if view was remapped, reopen the database */
-                if ( type . view_type [ 0 ] != 0 )
-                {
-                    VSchemaRelease ( src_schema );
-                    rc = VSchemaAddRef ( dst_schema );
-                    if ( rc != 0 )
-                    {
-                        ERROR ( rc, "VSchemaAddRef failed" );
-                        src_schema = NULL;
-                    }
-                    else
-                    {
-                        src_schema = dst_schema;
-                        VDatabaseRelease ( src );
-                        rc = VDBManagerOpenDBRead ( ctx -> caps -> vdb, srcp, src_schema, tp -> src_path );
-                        if ( rc != 0 )
-                            ERROR ( rc, "VDBManagerOpenDBRead failed reopening db '%s'", tp -> src_path );
-                        src = *srcp;
-                    }
-                }
-
-                if ( ! FAILED () )
-                {
-                    VDatabase *dst;
-                    rc = VDBManagerCreateDB ( ctx -> caps -> vdb, & dst, dst_schema,
-                        type . dst_type, tp -> db . cmode, tp -> dst_path );
-                    if ( rc != 0 )
-                        ERROR ( rc, "VDBManagerCreateDB failed to create '%s' with type '%s'", tp -> dst_path, type . dst_type );
-                    else
-                    {
-                        rc = VDatabaseColumnCreateParams ( dst, tp -> col . cmode, tp -> col . checksum, tp -> col . pgsize );
-                        if ( rc != 0 )
-                            ERROR ( rc, "VDatabaseColumnCreateParams: failed to set column create params on db '%s'", tp -> dst_path );
-                        else
-                        {
-                            DbPair *pb;
-
-                            /* TBD - this has to be fixed to use proper stuff */
-                            const char *name = strrchr ( tp -> src_path, '/' );
-                            if ( name ++ == NULL )
-                                name = tp -> src_path;
-
-                            TRY ( pb = DbPairMake ( ctx, src, dst, name ) )
-                            {
-                                DbPairRun ( pb, ctx );
-                                DbPairRelease ( pb, ctx );
-                            }
-                        }
-
-                        rc = VDatabaseRelease ( dst );
-                        if ( rc != 0 )
-                            ERROR ( rc, "VDatabaseRelease failed on '%s'", tp -> dst_path );
-                    }
-                }
-
-                VSchemaRelease ( dst_schema );
-            }
-        }
-
-        VSchemaRelease ( src_schema );
-    }
-}
-
-
-/* open_tbl
- *  called from run
- *  determines the type of schema
- *  opens output object
- *  dispatches to the appropriate handler
- */
-static
-void open_tbl ( const ctx_t *ctx, const VTable **tblp )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc = RC ( rcExe, rcFunction, rcExecuting, rcFunction, rcUnsupported );
-    ERROR ( rc, "unimplemented function" );
-}
-
-/* run
- *  called from KMain
- *  determines the type of object being copied/sorted
- *  opens input object
- *  dispatches to the appropriate handler
- */
-void run ( const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    VDBManager *mgr = ctx -> caps -> vdb;
-    const Tool *tp = ctx -> caps -> tool;
-
-    const VDatabase *db;
-    rc_t rc = VDBManagerOpenDBRead ( mgr, & db, NULL, tp -> src_path );
-    if ( rc == 0 )
-    {
-        open_db ( ctx, & db );
-        VDatabaseRelease ( db );
-    }
-    else
-    {
-        const VTable *tbl;
-        rc_t rc2 = VDBManagerOpenTableRead ( mgr, & tbl, NULL, tp -> src_path );
-        if ( rc2 == 0 )
-        {
-            rc = 0;
-            open_tbl ( ctx, & tbl );
-            VTableRelease ( tbl );
-        }
-        else
-        {
-            VSchema *sra_dflt;
-            rc2 = VDBManagerMakeSRASchema ( mgr, & sra_dflt );
-            if ( rc2 == 0 )
-            {
-                rc2 = VDBManagerOpenTableRead ( mgr, & tbl, sra_dflt, tp -> src_path );
-                if ( rc2 == 0 )
-                {
-                    rc = 0;
-                    open_tbl ( ctx, & tbl );
-                    VTableRelease ( tbl );
-                }
-                
-                VSchemaRelease ( sra_dflt );
-            }
-        }
-    }
-
-    if ( rc != 0 )
-        ERROR ( rc, "failed to open object '%s'", tp -> src_path );
-}
diff --git a/tools/sra-sort/simple-row-set.c b/tools/sra-sort/simple-row-set.c
deleted file mode 100644
index e4e5833..0000000
--- a/tools/sra-sort/simple-row-set.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct SimpleRowSet SimpleRowSet;
-#define ROWSET_IMPL SimpleRowSet
-
-typedef struct SimpleRowSetIterator SimpleRowSetIterator;
-#define ROWSET_ITER_IMPL SimpleRowSetIterator
-
-#include "row-set-priv.h"
-#include "tbl-pair.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-
-#include <klib/rc.h>
-
-FILE_ENTRY ( simple-row-set );
-
-
-/*--------------------------------------------------------------------------
- * SimpleRowSet
- *  implementation of RowSet based upon auto-generated serial ids
- */
-struct SimpleRowSet
-{
-    RowSet dad;
-    int64_t first, row_id, last_excl;
-};
-
-static
-void SimpleRowSetWhack ( SimpleRowSet *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    MemFree ( ctx, self, sizeof *self );
-}
-
-static
-size_t SimpleRowSetNext ( SimpleRowSet *self, const ctx_t *ctx,
-    int64_t *row_ids, size_t max_ids )
-{
-    if ( row_ids != NULL )
-    {
-        size_t i;
-
-        uint64_t max_avail = self -> last_excl - self -> row_id;
-        if ( max_avail < ( uint64_t ) max_ids )
-            max_ids = ( size_t ) max_avail;
-
-        for ( i = 0; i < max_ids; ++ i )
-            row_ids [ i ] = self -> row_id + i;
-
-        self -> row_id += max_ids;
-        return max_ids;
-    }
-    return 0;
-}
-
-static
-void SimpleRowSetReset ( SimpleRowSet *self, const ctx_t *ctx, bool for_static )
-{
-    self -> row_id = self -> first;
-}
-
-static RowSet_vt SimpleRowSet_vt =
-{
-    SimpleRowSetWhack,
-    SimpleRowSetNext,
-    SimpleRowSetReset
-};
-
-
-/* Make
- */
-static
-RowSet *SimpleRowSetMake ( const ctx_t *ctx, int64_t first, int64_t last_excl )
-{
-    FUNC_ENTRY ( ctx );
-
-    SimpleRowSet *rs;
-    TRY ( rs = MemAlloc ( ctx, sizeof * rs, false ) )
-    {
-        RowSetInit ( & rs -> dad, ctx, & SimpleRowSet_vt );
-        rs -> first = rs -> row_id = first;
-        rs -> last_excl = last_excl;
-        return & rs -> dad;
-    }
-
-    return NULL;
-}
-
-
-/*--------------------------------------------------------------------------
- * SimpleRowSetIterator
- *  interface to iterate RowSets
- */
-struct SimpleRowSetIterator
-{
-    RowSetIterator dad;
-    RowSet *rs;
-};
-
-static
-void SimpleRowSetIteratorWhack ( SimpleRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    RowSetRelease ( self -> rs, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-struct IdxMapping *SimpleRowSetIteratorGetIdxMapping ( SimpleRowSetIterator *self, const ctx_t *ctx, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    ANNOTATE ( "CALLING GetIdxMapping ON SIMPLE ROWSET ITERATOR" );
-
-    if ( num_items != NULL )
-        * num_items = 0;
-
-    return NULL;
-}
-
-static
-int64_t *SimpleRowSetIteratorGetSourceIds ( SimpleRowSetIterator *self, const ctx_t *ctx, uint32_t **opt_ord, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    ANNOTATE ( "CALLING GetSourceIds ON SIMPLE ROWSET ITERATOR" );
-
-    if ( opt_ord != NULL )
-        * opt_ord = NULL;
-
-    if ( num_items != NULL )
-        * num_items = 0;
-
-    return NULL;
-}
-
-static
-RowSet *SimpleRowSetIteratorNext ( SimpleRowSetIterator *self, const ctx_t *ctx )
-{
-    RowSet *rs = self -> rs;
-    self -> rs = NULL;
-    return rs;    
-}
-
-static RowSetIterator_vt SimpleRowSetIterator_vt =
-{
-    SimpleRowSetIteratorWhack,
-    SimpleRowSetIteratorGetIdxMapping,
-    SimpleRowSetIteratorGetSourceIds,
-    SimpleRowSetIteratorNext
-};
-
-
-/* MakeSimpleRowSetIterator
- *  make simple row-id iterator
- *  runs from first to last id in cursor
- */
-RowSetIterator *TablePairMakeSimpleRowSetIterator ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> first_id > self -> last_excl )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcConstructing, rcRange, rcInvalid );
-        INTERNAL_ERROR ( rc, "union of all column ranges improperly set" );
-    }
-    else
-    {
-        SimpleRowSetIterator *it;
-
-        TRY ( it = MemAlloc ( ctx, sizeof * it, false ) )
-        {
-            RowSetIteratorInit ( & it -> dad, ctx, & SimpleRowSetIterator_vt );
-            TRY ( it -> rs = SimpleRowSetMake ( ctx, self -> first_id, self -> last_excl ) )
-            {
-                return & it -> dad;
-            }
-
-            MemFree ( ctx, it, sizeof * it );
-        }
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/sort-defs.h b/tools/sra-sort/sort-defs.h
deleted file mode 100644
index f4aff84..0000000
--- a/tools/sra-sort/sort-defs.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_defs_
-#define _h_sra_sort_defs_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <assert.h>
-
-#if _DEBUGGING &&! defined SRA_SORT_CHECK_NULL_SELF
-#define SRA_SORT_CHECK_NULL_SELF 1
-#endif
-
-#define USE_OLD_KSORT 0
-
-
-/*--------------------------------------------------------------------------
- * vdb-3 items missing from klib/defs.h
- */
-typedef uint32_t caps_t;
-typedef struct ctx_t ctx_t;
-#define STRINGIZE( str ) # str
-#define STRINGIZE_DEFINE( def ) STRINGIZE ( def )
-
-
-/* POLY_DISPATCH
- *  dispatch a polymorphic message
- */
-#if  SRA_SORT_CHECK_NULL_SELF
-
-void null_self_error ( const ctx_t *ctx, uint32_t lineno, const char *msg );
-
-#define POLY_DISPATCH_VOID( msg, self, cast_expr, ctx, ... ) \
-    ( ( ( self ) == NULL ) ? null_self_error ( ctx, __LINE__, # msg ) : \
-      ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ ) )
-
-#define POLY_DISPATCH_INT( msg, self, cast_expr, ctx, ... ) \
-    ( ( ( self ) == NULL ) ? ( null_self_error ( ctx, __LINE__, # msg ), 0 ) : \
-      ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ ) )
-
-#define POLY_DISPATCH_PTR( msg, self, cast_expr, ctx, ... ) \
-    ( ( ( self ) == NULL ) ? ( null_self_error ( ctx, __LINE__, # msg ), NULL ) : \
-      ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ ) )
-
-#else
-
-#define POLY_DISPATCH_VOID( msg, self, cast_expr, ctx, ... ) \
-    ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ )
-#define POLY_DISPATCH_INT( msg, self, cast_expr, ctx, ... ) \
-    ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ )
-#define POLY_DISPATCH_PTR( msg, self, cast_expr, ctx, ... ) \
-    ( * ( self ) -> vt -> msg ) ( ( cast_expr* ) ( self ), ctx, ## __VA_ARGS__ )
-
-#endif
-
-#endif /* _h_sra_sort_defs_ */
diff --git a/tools/sra-sort/sorting-row-set.c b/tools/sra-sort/sorting-row-set.c
deleted file mode 100644
index e94336c..0000000
--- a/tools/sra-sort/sorting-row-set.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct SortingRowSet SortingRowSet;
-#define ROWSET_IMPL SortingRowSet
-
-typedef struct SortingRowSetIterator SortingRowSetIterator;
-#define ROWSET_ITER_IMPL SortingRowSetIterator
-
-#include "row-set-priv.h"
-#include "tbl-pair.h"
-#include "map-file.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <klib/rc.h>
-
-#include <string.h>
-
-FILE_ENTRY ( sorting-row-set );
-
-
-/*--------------------------------------------------------------------------
- * SortingRowSetIterator
- *  interface to iterate RowSets
- */
-struct SortingRowSetIterator
-{
-    RowSetIterator dad;
-
-    /* base row-id */
-    int64_t row_id;
-
-    /* last row-id + 1 */
-    int64_t last_excl;
-
-    /* takes its input from new=>old index */
-    const MapFile *idx;
-
-    /* working data within map */
-    int64_t *src_ids;
-    uint32_t *new_ord;
-    size_t max_elems;
-    size_t num_elems;
-
-    /* if true, use setting for large-columns */
-    bool large;
-
-    /* if true, no need to regenerate new_ord */
-    bool new_ord_valid;
-};
-
-/*--------------------------------------------------------------------------
- * SortingRowSet
- *  implementation of RowSet based upon auto-generated id pairs
- */
-struct SortingRowSet
-{
-    RowSet dad;
-
-    /* keep-alive reference */
-    SortingRowSetIterator *iter;
-
-    /* working data within map */
-    int64_t *src_ids;
-    size_t num_elems;
-    size_t cur_elem;
-};
-
-static
-void SortingRowSetWhack ( SortingRowSet *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    RowSetIteratorRelease ( & self -> iter -> dad, ctx );
-    MemFree ( ctx, self, sizeof *self );
-}
-
-static
-size_t SortingRowSetNextStat ( SortingRowSet *self, const ctx_t *ctx,
-    int64_t *ids, size_t max_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* the starting row-id is taken from row-set-iterator
-       and offset by our current element counter */
-    int64_t row_id = self -> iter -> row_id + self -> cur_elem;
-
-    /* limit id generation to request */
-    size_t i, to_set = self -> num_elems - self -> cur_elem;
-    if ( to_set > max_ids )
-        to_set = max_ids;
-
-    /* fill request with serial numbers
-       could just as easily be the same number
-       the important thing is to limit the count
-       and produce the correct range */
-    for ( i = 0; i < to_set; ++ i )
-        ids [ i ] = row_id + i;
-
-    /* advance counter */
-    self -> cur_elem += to_set;
-    return to_set;
-}
-
-static
-size_t SortingRowSetNextPhys ( SortingRowSet *self, const ctx_t *ctx,
-    int64_t *ids, size_t max_ids )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* limit copy to request */
-    size_t to_copy = self -> num_elems - self -> cur_elem;
-    if ( to_copy > max_ids )
-        to_copy = max_ids;
-
-    /* copy out old-ids */
-    memcpy ( ids, & self -> src_ids [ self -> cur_elem ], to_copy * sizeof ids [ 0 ] );
-
-    /* advance counter */
-    self -> cur_elem += to_copy;
-    return to_copy;
-}
-
-static
-void SortingRowSetReset ( SortingRowSet *self, const ctx_t *ctx, bool for_static );
-
-static RowSet_vt SortingRowSetPhys_vt =
-{
-    SortingRowSetWhack,
-    SortingRowSetNextPhys,
-    SortingRowSetReset
-};
-
-static RowSet_vt SortingRowSetStat_vt =
-{
-    SortingRowSetWhack,
-    SortingRowSetNextStat,
-    SortingRowSetReset
-};
-
-static
-void SortingRowSetReset ( SortingRowSet *self, const ctx_t *ctx, bool for_static )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( for_static )
-    {
-        /* go static */
-        self -> dad . vt = & SortingRowSetStat_vt;
-    }
-    else
-    {
-        SortingRowSetIterator *iter = self -> iter;
-
-        /* go physical */
-        self -> dad . vt = & SortingRowSetPhys_vt;
-
-        if ( iter -> new_ord_valid )
-        {
-            /* read new-ids from file, selecting old-ids within range */
-            STATUS ( 3, "selecting first %,zu ids from old=>new where new_id >= %,ld",
-                     iter -> max_elems, iter -> row_id );
-            iter -> num_elems = MapFileSelectOldToNewSingle ( iter -> idx, ctx,
-                iter -> row_id, iter -> src_ids, NULL, iter -> max_elems );
-        }
-        else
-        {
-            /* read new-ids from file, init new-ord, selecting old-ids within range */
-            STATUS ( 3, "selecting first %,zu ids, new_ord from old=>new where new_id >= %,ld",
-                     iter -> max_elems, iter -> row_id );
-            TRY ( iter -> num_elems = MapFileSelectOldToNewSingle ( iter -> idx, ctx,
-                      iter -> row_id, iter -> src_ids, iter -> new_ord, iter -> max_elems ) )
-            {
-                iter -> new_ord_valid = true;
-            }
-        }
-
-        if ( FAILED () )
-            return;
-
-        self -> num_elems = iter -> num_elems;
-        STATUS ( 3, "selected %,zu ids", self -> num_elems );
-    }
-
-    /* ready */
-    self -> cur_elem = 0;
-}
-
-
-/*--------------------------------------------------------------------------
- * SortingRowSetIterator
- *  interface to iterate RowSets
- */
-
-static
-void SortingRowSetIteratorWhack ( SortingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( self -> src_ids != NULL )
-        MemFree ( ctx, self -> src_ids, sizeof self -> src_ids [ 0 ] * self -> max_elems );
-    if ( self -> new_ord != NULL )
-        MemFree ( ctx, self -> new_ord, sizeof self -> new_ord [ 0 ] * self -> max_elems );
-
-    MapFileRelease ( self -> idx, ctx );
-
-    RowSetIteratorDestroy ( & self -> dad, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-RowSet *SortingRowSetIteratorMakeTheRowSet ( SortingRowSetIterator *self, const ctx_t *ctx, const RowSet_vt *vt )
-{
-    FUNC_ENTRY ( ctx );
-
-    SortingRowSet *rs;
-    TRY ( rs = MemAlloc ( ctx, sizeof * rs, false ) )
-    {
-        TRY ( RowSetInit ( & rs -> dad, ctx, vt ) )
-        {
-            /* initialize the row-set with map and self reference */
-            rs -> src_ids = self -> src_ids;
-            rs -> iter = ( SortingRowSetIterator* ) RowSetIteratorDuplicate ( & self -> dad, ctx );
-            rs -> num_elems = self -> num_elems;
-            rs -> cur_elem = 0;
-            return & rs -> dad;
-        }
-
-        MemFree ( ctx, rs, sizeof * rs );
-    }
-
-    return NULL;
- }
-
-static
-struct IdxMapping *SortingRowSetIteratorGetIdxMapping ( SortingRowSetIterator *self, const ctx_t *ctx, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    ANNOTATE ( "CALLING GetIdxMapping ON SORTING ROWSET ITERATOR" );
-
-    if ( num_items != NULL )
-        * num_items = 0;
-
-    return NULL;
-}
-
-static
-int64_t *SortingRowSetIteratorGetSourceIds ( SortingRowSetIterator *self, const ctx_t *ctx, uint32_t **opt_ord, size_t *num_items )
-{
-    FUNC_ENTRY ( ctx );
-
-    if ( opt_ord != NULL )
-        * opt_ord = self -> new_ord;
-
-    if ( self -> src_ids == NULL )
-    {
-        rc_t rc = RC ( rcExe, rcCursor, rcAccessing, rcSelf, rcInconsistent );
-        ERROR ( rc, "source id array is NULL" );
-        if ( num_items != NULL )
-            * num_items = 0;
-        return NULL;
-    }
-
-    if ( num_items != NULL )
-        * num_items = self -> num_elems;
-    return self -> src_ids;
-}
-
-static
-void SortingRowSetIteratorAllocMap ( SortingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* determine the maximum number of elements */
-    const Tool *tp = ctx -> caps -> tool;
-    uint64_t count = self -> last_excl - self -> row_id;
-    self -> max_elems = self -> large ? tp -> max_large_idx_ids : tp -> max_idx_ids;
-    if ( ( uint64_t ) self -> max_elems > count )
-        self -> max_elems = ( size_t ) count;
-
-    /* try to allocate the memory
-       this may be limited by the MemBank */
-    do
-    {
-        CLEAR ();
-
-        TRY ( self -> src_ids = MemAlloc ( ctx, sizeof self -> src_ids [ 0 ] * self -> max_elems, false ) )
-        {
-            TRY ( self -> new_ord = MemAlloc ( ctx, sizeof self -> new_ord [ 0 ] * self -> max_elems, false ) )
-            {
-                STATUS ( 4, "allocated mapping array of %,u elements", self -> max_elems );
-                return;
-            }
-
-            MemFree ( ctx, self -> src_ids, sizeof self -> src_ids [ 0 ] * self -> max_elems );
-            self -> src_ids = NULL;
-        }
-
-        self -> max_elems >>= 1;
-    }
-    while ( self -> max_elems >= ctx -> caps -> tool -> min_idx_ids );
-
-    ANNOTATE ( "failed to allocate map for row-set" );
-}
-
-static
-RowSet *SortingRowSetIteratorNext ( SortingRowSetIterator *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    RowSet *rs = NULL;
-
-    /* on first invocation, allocate the map */
-    if ( self -> src_ids == NULL )
-    {
-        ON_FAIL ( SortingRowSetIteratorAllocMap ( self, ctx ) )
-            return NULL;
-
-        assert ( self -> src_ids != NULL );
-        assert ( self -> new_ord != NULL );
-    }
-
-    /* advance row_id */
-    self -> row_id += self -> num_elems;
-    self -> num_elems = 0;
-    self -> new_ord_valid = false;
-
-    /* create the empty row-set */
-    if ( self -> row_id < self -> last_excl )
-        rs = SortingRowSetIteratorMakeTheRowSet ( self, ctx, & SortingRowSetPhys_vt );
-
-    return rs;
-}
-
-
-/*--------------------------------------------------------------------------
- * MapFile
- */
-
-static RowSetIterator_vt SortingRowSetIterator_vt =
-{
-    SortingRowSetIteratorWhack,
-    SortingRowSetIteratorGetIdxMapping,
-    SortingRowSetIteratorGetSourceIds,
-    SortingRowSetIteratorNext
-};
-
-RowSetIterator * MapFileMakeSortingRowSetIterator ( const MapFile *self, const ctx_t *ctx, bool large )
-{
-    FUNC_ENTRY ( ctx );
-
-    SortingRowSetIterator *rsi;
-
-    /* create the iterator */
-    TRY ( rsi = MemAlloc ( ctx, sizeof * rsi, true ) )
-    {
-        TRY ( RowSetIteratorInit ( & rsi -> dad, ctx, & SortingRowSetIterator_vt ) )
-        {
-            /* initialize the row-set with map and self reference */
-            TRY ( rsi -> row_id = MapFileFirst ( self, ctx ) )
-            {
-                TRY ( rsi -> last_excl = rsi -> row_id + MapFileCount ( self, ctx ) )
-                {
-                    TRY ( rsi -> idx = MapFileDuplicate ( self, ctx ) )
-                    {
-                        rsi -> large = large;
-                        return & rsi -> dad;
-                    }
-                }
-            }
-        }
-
-        MemFree ( ctx, rsi, sizeof * rsi );
-    }
-
-    return NULL;
-}
diff --git a/tools/sra-sort/sra-sort.c b/tools/sra-sort/sra-sort.c
deleted file mode 100644
index 0c7eb92..0000000
--- a/tools/sra-sort/sra-sort.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "ctx.h"
-#include "caps.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-#include "sra-sort.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <vdb/manager.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/manager.h>
-#include <kfg/config.h>
-#include <kfs/directory.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <strtol.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef _WIN32
-#include <process.h>
-#else
-#include <unistd.h>
-#endif
-
-#include "sra-sort.vers.h"
-
-
-FILE_ENTRY ( sra-sort );
-
-
-/* this goes away in vdb-3 */
-const char UsageDefaultName [] = "sra-sort";
-
-rc_t CC UsageSummary ( const char *prog_name )
-{
-    return KOutMsg ( "Usage: %s [options] src-object dst-object\n"
-                     "       %s [options] src-object [src-object...] dst-dir\n"
-                     "\n"
-                     , prog_name
-                     , prog_name
-        );
-}
-
-#define OPT_IGNORE_FAILURE "ignore-failure"
-#define OPT_FORCE "force"
-#define OPT_MEM_LIMIT "mem-limit"
-#define OPT_MAP_FILE_BSIZE "map-file-bsize"
-#define OPT_MAX_IDX_IDS "max-idx-ids"
-#define OPT_MAX_REF_IDX_IDS "max-ref-idx-ids"
-#define OPT_MAX_LARGE_IDX_IDS "max-large-idx-ids"
-#define OPT_TEMP_DIR "tempdir"
-#define OPT_MMAP_DIR "mmapdir"
-#define OPT_UNSORTED_OLD_NEW "unsorted-old-new"
-
-#define OPT_COLUMN_MD5 "column-md5"
-#define OPT_NO_COLUMN_CHECKSUM "no-column-checksum"
-
-#define OPT_BLOB_CRC32 "blob-crc32"
-#define OPT_BLOB_MD5 "blob-md5"
-#define OPT_NO_BLOB_CHECKSUM "no-blob-checksum"
-
-#define OPT_KEEP_IDX_FILES "keep-idx-files"
-#define OPT_IDX_CONSISTENCY_CHECK "idx-cc"
-
-static const char *hlp_ignore_failure [] = { "ignore failure when sorting multiple objects",
-                                             "i.e. continue in spite of previous errors", NULL };
-static const char *hlp_force [] = { "force overwrite of existing destination", NULL };
-static const char *hlp_mem_limit [] = { "sets limit on dynamic memory usage", NULL };
-static const char *hlp_map_file_bsize [] = { "sets id map-file cache size", NULL };
-static const char *hlp_max_idx_ids [] = { "sets number of join-index ids to process at a time", NULL };
-static const char *hlp_max_ref_idx_ids [] = { "sets number of join-index ids to process within REFERENCE table", NULL };
-static const char *hlp_max_large_idx_ids [] = { "sets number of rows to process with large columns", NULL };
-static const char *hlp_temp_dir [] = { "sets a specific directory to use for temporary files", NULL };
-static const char *hlp_mmap_dir [] = { "sets a specific directory to use for memory-mapped buffers", NULL };
-static const char *hlp_unsorted_old_new [] = { "write old=>new index in unsorted order", NULL };
-
-static const char *hlp_column_md5 [] = { "generate md5sum compatible checksum files for each column [default]", NULL };
-static const char *hlp_no_column_checksum [] = { "disable generation of column checksums", NULL };
-
-static const char *hlp_blob_crc32 [] = { "generate CRC32 checksums for each blob [default]", NULL };
-static const char *hlp_blob_md5 [] = { "generate MD5 checksums for each blob", NULL };
-static const char *hlp_no_blob_checksum [] = { "disable generation of blob checksums", NULL };
-
-#if _DEBUGGING
-static const char *hlp_keep_idx_files [] = { "keep temporary index files for debugging", NULL };
-static const char *hlp_idx_consistency_check [] = { "run consistency check on index files", NULL };
-#endif
-
-static OptDef options [] =
-{
-    /* 1. long-name
-       2. list of single character short names
-       3. help-gen function
-       4. list of help strings, NULL terminated
-       5. max count
-       6. option requires value
-       7. option is required
-    */
-    { OPT_IGNORE_FAILURE, "i", NULL, hlp_ignore_failure, 1, false, false }
-  , { OPT_FORCE, "f", NULL, hlp_force, 1, false, false }
-  , { OPT_MEM_LIMIT, NULL, NULL, hlp_mem_limit, 1, true, false }
-  , { OPT_MAP_FILE_BSIZE, NULL, NULL, hlp_map_file_bsize, 1, true, false }
-  , { OPT_MAX_IDX_IDS, NULL, NULL, hlp_max_idx_ids, 1, true, false }
-  , { OPT_MAX_REF_IDX_IDS, NULL, NULL, hlp_max_ref_idx_ids, 1, true, false }
-  , { OPT_MAX_LARGE_IDX_IDS, NULL, NULL, hlp_max_large_idx_ids, 1, true, false }
-  , { OPT_TEMP_DIR, NULL, NULL, hlp_temp_dir, 1, true, false }
-  , { OPT_MMAP_DIR, NULL, NULL, hlp_mmap_dir, 1, true, false }
-  , { OPT_UNSORTED_OLD_NEW, NULL, NULL, hlp_unsorted_old_new, 1, false, false }
-
-  , { OPT_COLUMN_MD5, NULL, NULL, hlp_column_md5, 1, false, false }
-  , { OPT_NO_COLUMN_CHECKSUM, NULL, NULL, hlp_no_column_checksum, 1, false, false }
-  , { OPT_BLOB_CRC32, NULL, NULL, hlp_blob_crc32, 1, false, false }
-  , { OPT_BLOB_MD5, NULL, NULL, hlp_blob_md5, 1, false, false }
-  , { OPT_NO_BLOB_CHECKSUM, NULL, NULL, hlp_no_blob_checksum, 1, false, false }
-#if _DEBUGGING
-  , { OPT_KEEP_IDX_FILES, NULL, NULL, hlp_keep_idx_files, 1, false, false }
-  , { OPT_IDX_CONSISTENCY_CHECK, NULL, NULL, hlp_idx_consistency_check, 1, false, false }
-#endif
-};
-
-static const char *option_params [] =
-{
-    NULL
-  , NULL
-  , "bytes"
-  , "cache-size"
-  , "num-ids"
-  , "num-ids"
-  , "num-ids"
-  , "path-to-tmp"
-  , "path-to-mmaps"
-  , NULL
-  , NULL
-  , NULL
-  , NULL
-  , NULL
-  , NULL
-#if _DEBUGGING
-  , NULL
-  , NULL
-#endif
-};
-
-rc_t CC Usage ( const Args *args )
-{
-    uint32_t i;
-    const char *progname, *fullpath;
-    rc_t rc = ArgsProgram ( args, & fullpath, & progname );
-    if ( rc != 0 )
-        progname = fullpath = UsageDefaultName;
-    
-    UsageSummary ( progname );
-    
-    KOutMsg ( "Options:\n" );
-    
-    for ( i = 0; i < sizeof options / sizeof options [ 0 ]; ++ i )
-    {
-        HelpOptionLine ( options [ i ] . aliases, options [ i ] . name,
-            option_params [ i ], options [ i ] . help );
-    }
-
-    HelpOptionsStandard ();
-    
-    HelpVersion ( fullpath, KAppVersion () );
-
-    return 0;
-}
-
-uint32_t CC KAppVersion ( void )
-{
-    return SRA_SORT_VERS;
-}
-
-static
-const char *ArgsGetOptStr ( Args *self, const ctx_t *ctx, const char *optname, uint32_t *count )
-{
-    rc_t rc;
-    const char *val = NULL;
-
-    uint32_t dummy;
-    if ( count == NULL )
-        count = & dummy;
-
-    rc = ArgsOptionCount ( self, optname, count );
-    if ( rc == 0 && * count != 0 )
-    {
-        rc = ArgsOptionValue ( self, optname, 0, & val );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "failed to retrieve '%s' parameter", optname );
-    }
-
-    return val;
-}
-
-static
-uint64_t ArgsGetOptU64 ( Args *self, const ctx_t *ctx, const char *optname, uint32_t *count )
-{
-    rc_t rc;
-    uint64_t val = 0;
-
-    uint32_t dummy;
-    if ( count == NULL )
-        count = & dummy;
-
-    rc = ArgsOptionCount ( self, optname, count );
-    if ( rc == 0 && * count != 0 )
-    {
-        const char *str;
-        rc = ArgsOptionValue ( self, optname, 0, & str );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "failed to retrieve '%s' parameter", optname );
-        else
-        {
-            char *end;
-            val = strtou64 ( str, & end, 0 );
-            if ( end [ 0 ] != 0 )
-            {
-                rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcIncorrect );
-                ERROR ( rc, "bad '%s' parameter: '%s'", optname, str );
-            }
-        }
-    }
-
-    return val;
-}
-
-static
-bool ArgsGetOptBool ( Args *self, const ctx_t *ctx, const char *optname, uint32_t *count )
-{
-    rc_t rc;
-    bool val = false;
-
-    uint32_t dummy;
-    if ( count == NULL )
-        count = & dummy;
-
-    rc = ArgsOptionCount ( self, optname, count );
-    if ( rc == 0 && * count != 0 )
-        val = true;
-
-    return val;
-}
-
-static
-uint64_t KConfigGetNodeU64 ( const ctx_t *ctx, const char *path, bool *found )
-{
-    rc_t rc;
-    uint64_t val = 0;
-    const KConfigNode *n;
-
-    bool dummy;
-    if ( found == NULL )
-        found = & dummy;
-
-    rc = KConfigOpenNodeRead ( ctx -> caps -> cfg, & n, "sra-sort/map_file_bsize" );
-    if ( rc == 0 )
-    {
-        char buff [ 256 ];
-        size_t num_read, remaining;
-
-        rc = KConfigNodeRead ( n, 0, buff, sizeof buff - 1, & num_read, & remaining );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to read KConfig node '%s'", path );
-        else if ( remaining != 0 )
-        {
-            rc = RC ( rcExe, rcNode, rcReading, rcBuffer, rcInsufficient );
-            ERROR ( rc, "failed to read KConfig node '%s'", path );
-        }
-        else
-        {
-            char *end;
-            buff [ num_read ] = 0;
-            val = strtou64 ( buff, & end, 0 );
-            if ( end [ 0 ] != 0 )
-            {
-                rc = RC ( rcExe, rcNode, rcReading, rcNumeral, rcIncorrect );
-                ERROR ( rc, "bad '%s' config value: '%s'", path, buff );
-            }
-        }
-
-        KConfigNodeRelease ( n );
-    }
-
-    return val;
-}
-
-static
-void initialize_params ( const ctx_t *ctx, Caps *caps, Tool *tp, Selection *sel, Args *args )
-{
-    bool found=false;
-    uint64_t val;
-    uint32_t count;
-    const char *str;
-
-    int col_md5 = kcmMD5;
-
-    memset ( sel, 0, sizeof * sel );
-    memset ( tp, 0, sizeof * tp );
-    tp -> sel = sel;
-
-    /* default to host tmp */
-    tp -> tmpdir = "/tmp";
-
-    /* default to mmap dir */
-    tp -> mmapdir = NULL;
-
-    /* default buffer size for map cache */
-    tp -> map_file_bsize = 64 * 1024 * 1024;
-    tp -> map_file_random_bsize = tp -> map_file_bsize;
-
-    /* default max index ids to gather at a time */
-    tp -> max_ref_idx_ids = tp -> max_large_idx_ids = tp -> max_idx_ids = 256 * 1024 * 1024;
-    tp -> max_poslen_ids = 64 * 1024 * 1024;
-    tp -> min_idx_ids =  64 * 1024 * 1024;
-    tp -> max_missing_ids = tp -> max_idx_ids;
-
-#if 0
-    /* refpos cache size */
-    tp -> refpos_cache_capacity = 100 * 1024 * 1024;
-#endif
-
-    /* for creating mapping files */
-    tp -> pid = getpid ();
-
-    /* db create defaults */
-    tp -> db . cmode = kcmCreate;
-
-    /* tbl create defaults */
-    tp -> tbl . cmode = kcmCreate;
-
-    /* column create mode defaults */
-    tp -> col . pgsize = 1;
-    tp -> col . cmode = kcmInit;
-    tp -> col . checksum = kcsCRC32;
-
-    /* normally do not ignore failures */
-    tp -> ignore = false;
-
-    /* normally do not force overwrite */
-    tp -> force = false;
-
-    /* not needed under normal circumstances */
-    tp -> write_new_to_old = false;
-tp->write_new_to_old=true;
-
-    /* default is to sort on old */
-    tp -> sort_before_old2new = true;
-
-    /* when debugging, this can be turned off */
-    tp -> unlink_idx_files = true;
-    tp -> idx_consistency_check = false;
-
-
-    /* record them as caps */
-    caps -> tool = tp;
-
-    /* look in config */
-    /* TBD - COMPLETE THIS */
-    ON_FAIL ( val = KConfigGetNodeU64 ( ctx, "sra-sort/map_file_bsize", & found ) )
-        return;
-    if ( found )
-        tp -> map_file_bsize = tp -> map_file_random_bsize = ( size_t ) val;
-
-    ON_FAIL ( val = KConfigGetNodeU64 ( ctx, "sra-sort/map_file_random_bsize", & found ) )
-        return;
-    if ( found )
-        tp -> map_file_random_bsize = ( size_t ) val;
-
-    ON_FAIL ( val = KConfigGetNodeU64 ( ctx, "sra-sort/max_idx_ids", & found ) )
-        return;
-    if ( found )
-        tp -> max_idx_ids = ( size_t ) val;
-
-    ON_FAIL ( val = KConfigGetNodeU64 ( ctx, "sra-sort/max_ref_idx_ids", & found ) )
-        return;
-    if ( found )
-        tp -> max_ref_idx_ids = ( size_t ) val;
-
-    /* finally look in args */
-    ON_FAIL ( str = ArgsGetOptStr ( args, ctx, OPT_TEMP_DIR, & count ) )
-        return;
-    if ( count != 0 && str [ 0 ] != 0 )
-        tp -> tmpdir = str;
-
-    ON_FAIL ( str = ArgsGetOptStr ( args, ctx, OPT_MMAP_DIR, & count ) )
-        return;
-    if ( count != 0 && str [ 0 ] != 0 )
-        tp -> mmapdir = str;
-
-    ON_FAIL ( val = ArgsGetOptU64 ( args, ctx, OPT_MAP_FILE_BSIZE, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> map_file_random_bsize = ( size_t ) val;
-   
-    ON_FAIL ( val = ArgsGetOptU64 ( args, ctx, OPT_MAX_IDX_IDS, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> max_idx_ids = tp -> max_ref_idx_ids = ( size_t ) val;
-   
-    ON_FAIL ( val = ArgsGetOptU64 ( args, ctx, OPT_MAX_REF_IDX_IDS, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> max_ref_idx_ids = ( size_t ) val;
-   
-    ON_FAIL ( val = ArgsGetOptU64 ( args, ctx, OPT_MAX_LARGE_IDX_IDS, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> max_large_idx_ids = ( size_t ) val;
-
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_IGNORE_FAILURE, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> ignore = true;
-
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_FORCE, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> force = true;
-   
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_UNSORTED_OLD_NEW, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> sort_before_old2new = false;
-
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_COLUMN_MD5, & count ) )
-        return;
-    if ( count != 0 )
-        col_md5 = kcmMD5;
-    else
-    {
-        ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_NO_COLUMN_CHECKSUM, & count ) )
-            return;
-        if ( count != 0 )
-            col_md5 = 0;
-    }
-
-    tp -> db . cmode |= col_md5;
-    tp -> tbl . cmode |= col_md5;
-    tp -> col . cmode |= col_md5;
-
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_BLOB_CRC32, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> col . checksum = kcsCRC32;
-    else
-    {
-        ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_BLOB_MD5, & count ) )
-            return;
-        if ( count != 0 )
-            tp -> col . checksum = kcsMD5;
-        else
-        {
-            ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_NO_BLOB_CHECKSUM, & count ) )
-                return;
-            if ( count != 0 )
-                tp -> col . checksum = kcsNone;
-        }
-    }
-
-#if _DEBUGGING
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_KEEP_IDX_FILES, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> unlink_idx_files = false;
-
-    ON_FAIL ( found = ArgsGetOptBool ( args, ctx, OPT_IDX_CONSISTENCY_CHECK, & count ) )
-        return;
-    if ( count != 0 )
-        tp -> idx_consistency_check = tp -> write_new_to_old = true;
-#endif
-}
-
-static
-void initialize_caps ( const ctx_t *ctx, Caps *caps, Args *args )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* get specified limit */
-    uint32_t count;
-    size_t mem_limit = ( size_t ) ArgsGetOptU64 ( args, ctx, OPT_MEM_LIMIT, & count );
-    if ( ! FAILED () && count != 0 )
-    {
-        MemBank *mem;
-        TRY ( mem = MemBankMake ( ctx, mem_limit ) )
-        {
-            MemBankRelease ( caps -> mem, ctx );
-            caps -> mem = mem;
-        }
-    }
-
-    if ( ! FAILED () )
-    {
-        /* here's a chance to pick up special config */
-        /* TBD */
-
-        /* open up KConfig */
-        rc_t rc = KConfigMake ( ( KConfig** ) & caps -> cfg, NULL );
-        if ( rc != 0 )
-            ERROR ( rc, "KConfigMake failed" );
-    }
-}
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    DECLARE_CTX_INFO ();
-
-    /* initialize context */
-    Caps caps;
-    ctx_t main_ctx = { & caps, NULL, & ctx_info };
-    const ctx_t *ctx = & main_ctx;
-    CapsInit ( & caps, NULL );
-
-    if ( argc <= 1 )
-        main_ctx . rc = UsageSummary ( "sra-sort" );
-    else
-    {
-        /* create MemBank with unlimited quota */
-        TRY ( caps . mem = MemBankMake (  ctx, -1 ) )
-        {
-            rc_t rc = VDBManagerMakeUpdate ( & caps . vdb, NULL );
-            if ( rc != 0 )
-                ERROR ( rc, "failed to create VDBManager" );
-            else
-            {
-                rc = VDBManagerOpenKDBManagerUpdate ( caps . vdb, & caps . kdb );
-                if ( rc != 0 )
-                    ERROR ( rc, "failed to create KDBManager" );
-                else
-                {
-                    Args * args;
-                    rc = ArgsMakeAndHandle ( & args, argc, argv, 1,
-                        options, sizeof options / sizeof options [ 0 ] );
-                    if ( rc != 0 )
-                        ERROR ( rc, "failed to parse command line" );
-                    else
-                    {
-                        TRY ( initialize_caps ( ctx, & caps, args ) )
-                        {
-                            Tool tp;
-                            Selection sel;
-                            TRY ( initialize_params ( ctx, & caps, & tp, & sel, args ) )
-                            {
-                                uint32_t count;
-                                rc = ArgsParamCount ( args, & count );
-                                if ( rc != 0 )
-                                    ERROR ( rc, "ArgsParamCount failed" );
-                                else if ( count < 2 )
-                                {
-                                    rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-                                    ERROR ( rc, "expected source and destination parameters" );
-                                }
-                                else
-                                {
-                                    /* check type of last parameter */
-                                    const char *dst;
-                                    rc = ArgsParamValue ( args, count - 1, & dst );
-                                    if ( rc != 0 )
-                                        ERROR ( rc, "ArgsParamValue [ %u ] failed", count - 1 );
-                                    else
-                                    {
-                                        enum RCTarget targ = rcNoTarg;
-
-                                        bool dst_is_dir = false;
-                                        int dst_type = KDBManagerPathType ( caps . kdb, dst ) & ~ kptAlias;
-                                        if ( dst_type == kptDir )
-                                            dst_is_dir = true;
-                                        else if ( count != 2 )
-                                        {
-                                            rc = RC ( rcExe, rcArgv, rcParsing, rcArgv, rcIncorrect );
-                                            ERROR ( rc, "multiple source objects require last parameter to be a directory" );
-                                        }
-                                        else switch ( dst_type )
-                                        {
-                                        case kptNotFound:
-                                            tp . db . cmode |= kcmParents;
-                                            tp . tbl . cmode |= kcmParents;
-                                            break;
-                                        case kptFile:
-                                        case kptFile | kptAlias:
-                                            rc = RC ( rcExe, rcArgv, rcParsing, rcArgv, rcIncorrect );
-                                            ERROR ( rc, "destination object is a file - remove first or rename before trying again" );
-                                            break;
-                                        case kptDatabase:
-                                            targ = rcDatabase;
-                                            break;
-                                        case kptTable:
-                                            targ = rcTable;
-                                            break;
-                                        case kptPrereleaseTbl:
-                                            dst_type = kptTable;
-                                            break;
-                                        default:
-                                            rc = RC ( rcExe, rcArgv, rcParsing, rcArgv, rcIncorrect );
-                                            ERROR ( rc, "destination object type cannot be overwritten" );
-                                            break;
-                                        }
-
-                                        if ( ! FAILED () )
-                                        {
-                                            if ( dst_is_dir )
-                                            {
-                                                uint32_t i;
-                                                rc_t first_rc = 0;
-                                                bool issue_divider_line;
-
-                                                if ( tp . force )
-                                                {
-                                                    tp . db . cmode = kcmInit | ( tp . db . cmode & ~ kcmValueMask );
-                                                    tp . tbl . cmode = kcmInit | ( tp . tbl . cmode & ~ kcmValueMask );
-                                                }
-                                                
-                                                for ( issue_divider_line = false, i = 0; i < count - 1; issue_divider_line = true, ++ i )
-                                                {
-                                                    rc = ArgsParamValue ( args, i, & tp . src_path );
-                                                    if ( rc != 0 )
-                                                        ERROR ( rc, "ArgParamValue [ %u ] failed", i );
-                                                    else
-                                                    {
-                                                        char dst_path [ 4096 ];
-                                                        const char *leaf = strrchr ( tp . src_path, '/' );
-                                                        if ( leaf ++ == NULL )
-                                                            leaf = tp . src_path;
-                                                        rc = string_printf ( dst_path, sizeof dst_path, NULL, "%s/%s", dst, leaf );
-                                                        if ( rc != 0 )
-                                                            ERROR ( rc, "string_printf on param [ %u ] failed", i );
-                                                        else
-                                                        {
-                                                            size_t size = string_size ( dst_path );
-                                                            char *ext = string_rchr ( dst_path, size, '.' );
-                                                            if ( ext != NULL )
-                                                            {
-                                                                size -= ext - dst_path;
-                                                                switch ( size )
-                                                                {
-                                                                case 4:
-                                                                    if ( strcase_cmp ( ext, 4, ".sra", 4, 4 ) == 0 )
-                                                                        * ext = 0;
-                                                                    break;
-                                                                case 5:
-                                                                    if ( strcase_cmp ( ext, 5, ".csra", 5, 5 ) == 0 )
-                                                                        * ext = 0;
-                                                                    break;
-                                                                }
-                                                            }
-
-                                                            if ( issue_divider_line )
-                                                                STATUS ( 1, "################################################################" );
-
-                                                            tp . dst_path = dst_path;
-                                                            ON_FAIL ( run ( ctx ) )
-                                                            {
-                                                                if ( ! tp . ignore )
-                                                                    break;
-
-                                                                if ( first_rc == 0 )
-                                                                    first_rc = ctx -> rc;
-
-                                                                CLEAR ();
-                                                            }
-                                                        }
-                                                    }
-                                                }
-
-                                                if ( first_rc != 0 )
-                                                    main_ctx . rc = first_rc;
-                                            }
-                                            else
-                                            {
-                                                tp . dst_path = dst;
-                                                rc = ArgsParamValue ( args, 0, & tp . src_path );
-                                                if ( rc != 0 )
-                                                    ERROR ( rc, "ArgParamValue [ 0 ] failed" );
-                                                else
-                                                {
-                                                    int src_type;
-
-                                                    switch ( dst_type )
-                                                    {
-                                                    case kptDatabase:
-                                                    case kptTable:
-                                                        src_type = KDBManagerPathType ( caps . kdb, tp . src_path ) & ~ kptAlias;
-                                                        if ( src_type == kptPrereleaseTbl )
-                                                            src_type = kptTable;
-                                                        if ( src_type != dst_type )
-                                                        {
-                                                            rc = RC ( rcExe, rcArgv, rcParsing, rcArgv, rcIncorrect );
-                                                            ERROR ( rc, "source and destination object types are not compatible" );
-                                                        }
-                                                        else if ( ! tp . force )
-                                                        {
-                                                            rc = RC ( rcExe, targ, rcCopying, targ, rcExists );
-                                                            ERROR ( rc, "destination object cannot be overwritten - try again with '-f'" );
-                                                        }
-                                                        else
-                                                        {
-                                                            tp . db . cmode = kcmInit | ( tp . db . cmode & ~ kcmValueMask );
-                                                            tp . tbl . cmode = kcmInit | ( tp . tbl . cmode & ~ kcmValueMask );
-                                                        }
-                                                    }
-
-                                                    if ( ! FAILED () )
-                                                        run ( ctx );
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        ArgsWhack ( args );
-                    }
-                }
-            }
-
-            CapsWhack ( & caps, ctx );
-        }
-    }
-
-    return main_ctx . rc;
-}
diff --git a/tools/sra-sort/sra-sort.h b/tools/sra-sort/sra-sort.h
deleted file mode 100644
index 027d591..0000000
--- a/tools/sra-sort/sra-sort.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_
-#define _h_sra_sort_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_kfs_defs_
-#include <kfs/defs.h>
-#endif
-
-#ifndef _h_kdb_column_
-#include <kdb/column.h>
-#endif
-
-
-#define NEW_TYPES 1
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct DbPair;
-struct TablePair;
-
-
-/*--------------------------------------------------------------------------
- * Selection
- *  input selection criteria
- */
-typedef struct Selection Selection;
-struct Selection
-{
-    int dummy;
-};
-
-/*--------------------------------------------------------------------------
- * Tool
- *  parameter block generated by KMain
- */
-typedef struct Tool Tool;
-struct Tool
-{
-    /* input selection */
-    const Selection *sel;
-
-    /* directory for temporary files */
-    const char *tmpdir;
-
-    /* directory for mmap page files */
-    const char *mmapdir;
-
-    /* source object path */
-    const char *src_path;
-
-    /* destination object path */
-    const char *dst_path;
-
-    /* buffer size for id map files */
-    size_t map_file_bsize;
-    size_t map_file_random_bsize;
-
-    /* the number of ids to gather at a time */
-    size_t max_ref_idx_ids;
-    size_t max_large_idx_ids;
-    size_t max_poslen_ids;
-    size_t max_idx_ids;
-    size_t min_idx_ids;
-
-    /* the number of missing SEQUENCE ids to gather at a time */
-    size_t max_missing_ids;
-
-    /* pid of tool */
-    int pid;
-
-    /* db create mode */
-    struct
-    {
-        KCreateMode cmode;
-    } db;
-
-    /* tbl create mode */
-    struct
-    {
-        KCreateMode cmode;
-    } tbl;
-
-    /* column blob checksum mode */
-    struct
-    {
-        size_t pgsize;
-        KCreateMode cmode;
-        KChecksum checksum;
-    } col;
-
-    /* ignore failure on multiple sorts */
-    bool ignore;
-
-    /* force overwrite */
-    bool force;
-
-    /* write new=>old mappings
-       not normally needed */
-    bool write_new_to_old;
-
-    /* whether to apply a sort on old-id
-       before writing old=>new mapping or
-       to let pagefile handle it */
-    bool sort_before_old2new;
-
-    /* normally remove idx files right away
-       but if they are being debugged... */
-    bool unlink_idx_files;
-
-    /* perform consistency check on index */
-    bool idx_consistency_check;
-};
-
-
-/*--------------------------------------------------------------------------
- * TypeParams
- *  object type params
- */
-typedef struct TypeParams TypeParams;
-struct TypeParams
-{
-    char src_type [ 256 ];
-    char dst_type [ 256 ];
-    char view_type [ 256 ];
-};
-
-
-/*--------------------------------------------------------------------------
- * sra-sort functions
- */
-
-/* run
- *  called from KMain
- *  determines the type of object being copied/sorted
- *  opens input object
- *  dispatches to the appropriate handler
- */
-void run ( const ctx_t *ctx );
-
-
-#endif
diff --git a/tools/sra-sort/sra-sort.vers b/tools/sra-sort/sra-sort.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-sort/sra-sort.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/sra-sort/status.h b/tools/sra-sort/status.h
deleted file mode 100644
index bbf15ab..0000000
--- a/tools/sra-sort/status.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_status_
-#define _h_sra_sort_status_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * status generation
- */
-
-
-/* STATUS
- *  give feedback
- */
-void Status ( const ctx_t *ctx, uint32_t lineno, uint32_t level, const char *msg, ... );
-#define STATUS( lvl, msg, ... ) \
-    Status ( ctx, __LINE__, lvl, msg, ## __VA_ARGS__ )
-
-
-#endif
diff --git a/tools/sra-sort/tbl-pair.c b/tools/sra-sort/tbl-pair.c
deleted file mode 100644
index f0c6597..0000000
--- a/tools/sra-sort/tbl-pair.c
+++ /dev/null
@@ -1,1055 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-typedef struct TablePair StdTblPair;
-#define TBLPAIR_IMPL StdTblPair
-
-#include "tbl-pair.h"
-#include "col-pair.h"
-#include "db-pair.h"
-#include "meta-pair.h"
-#include "row-set-priv.h"
-#include "ctx.h"
-#include "caps.h"
-#include "except.h"
-#include "status.h"
-#include "mem.h"
-#include "sra-sort.h"
-
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/vdb-priv.h>
-#include <kdb/meta.h>
-#include <klib/printf.h>
-#include <klib/text.h>
-#include <klib/namelist.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-
-FILE_ENTRY ( tbl-pair );
-
-
-/*--------------------------------------------------------------------------
- * StdTblPair
- *  generic database object pair
- */
-
-static
-void StdTblPairWhack ( StdTblPair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-    TablePairDestroy ( self, ctx );
-    MemFree ( ctx, self, sizeof * self );
-}
-
-static
-void StdTblPairDummyStub ( StdTblPair *self, const ctx_t *ctx )
-{
-}
-
-static
-ColumnPair *StdTblPairMakeColumnPair ( StdTblPair *self, const ctx_t *ctx,
-    struct ColumnReader *reader, struct ColumnWriter *writer, const char *colspec, bool large )
-{
-    FUNC_ENTRY ( ctx );
-    return TablePairMakeColumnPair ( self, ctx, reader, writer, colspec, large );
-}
-
-static
-RowSetIterator *StdTblPairGetRowSetIterator ( StdTblPair *self, const ctx_t *ctx, bool mapped, bool large )
-{
-    FUNC_ENTRY ( ctx );
-    return TablePairMakeRowSetIterator ( self, ctx, NULL, mapped, large );
-}
-
-static TablePair_vt StdTblPair_vt =
-{
-    StdTblPairWhack,
-    StdTblPairDummyStub,
-    StdTblPairDummyStub,
-    StdTblPairMakeColumnPair,
-    StdTblPairDummyStub,
-    StdTblPairDummyStub,
-    StdTblPairGetRowSetIterator
-};
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- *  interface code
- */
-
-
-/* Make
- *  makes an object based upon open source and destination VDatabase objects
- */
-TablePair *TablePairMake ( const ctx_t *ctx,
-    const VTable *src, VTable *dst, const char *name, const char *opt_full_spec, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-
-    StdTblPair *tbl;
-
-    TRY ( tbl = MemAlloc ( ctx, sizeof * tbl, false ) )
-    {
-        TRY ( TablePairInit ( tbl, ctx, & StdTblPair_vt, src, dst, name, opt_full_spec, reorder ) )
-        {
-            return tbl;
-        }
-
-        MemFree ( ctx, tbl, sizeof * tbl );
-    }
-
-    return NULL;
-}
-
-TablePair *DbPairMakeStdTblPair ( DbPair *self, const ctx_t *ctx,
-    const VTable *src, VTable *dst, const char *name, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-    return TablePairMake ( ctx, src, dst, name, self -> full_spec, reorder );
-}
-
-
-/* Release
- */
-void TablePairRelease ( TablePair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountDrop ( & self -> refcount, "TablePair" ) )
-        {
-        case krefOkay:
-            break;
-        case krefWhack:
-            ( * self -> vt -> whack ) ( ( void* ) self, ctx );
-            break;
-        case krefZero:
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcTable, rcDestroying, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to release TablePair" );
-        }
-    }
-}
-
-/* Duplicate
- */
-TablePair *TablePairDuplicate ( TablePair *self, const ctx_t *ctx )
-{
-    rc_t rc;
-    FUNC_ENTRY ( ctx );
-
-    if ( self != NULL )
-    {
-        switch ( KRefcountAdd ( & self -> refcount, "TablePair" ) )
-        {
-        case krefOkay:
-        case krefWhack:
-        case krefZero:
-            break;
-        case krefLimit:
-        case krefNegative:
-            rc = RC ( rcExe, rcTable, rcAttaching, rcRefcount, rcInvalid );
-            INTERNAL_ERROR ( rc, "failed to duplicate TablePair" );
-            return NULL;
-        }
-    }
-
-    return ( TablePair* ) self;
-}
-
-
-/* CommitColumnPair
- */
-static
-bool CC TablePairCommitColumnPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    ColumnPair *col = item;
-    TRY ( ColumnWriterCommit ( col -> writer, ctx ) )
-    {
-        return false;
-    }
-    return true;
-}
-
-
-/* ReleaseColumnPair
- */
-static
-void CC TablePairReleaseColumnPair ( void *item, void *data )
-{
-    const ctx_t *ctx = ( const void* ) data;
-    FUNC_ENTRY ( ctx );
-    ColumnPairRelease ( item, ctx );
-}
-
-
-/* Copy
- *  the table has to obtain a RowSetIterator
- *  which it walks vertically
- *
- *  for each RowSet, it walks its columns horizontally,
- *  resetting it between columns
- */
-static
-void TablePairCopyStaticColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy static columns */
-    uint32_t count = VectorLength ( & self -> static_cols );
-    if ( count != 0 )
-    {
-#if OLD_STATIC_WRITE
-        RowSetIterator *rsi;
-        TRY ( rsi = TablePairMakeRowSetIterator ( self, ctx, NULL, false ) )
-        {
-#endif
-            STATUS ( 2, "copying '%s' static columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-#if OLD_STATIC_WRITE
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-#endif
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> static_cols, i );
-                    assert ( col != NULL );
-#if OLD_STATIC_WRITE
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-#else
-                    ON_FAIL ( ColumnPairCopyStatic ( col, ctx, self -> first_id, self -> last_excl - self -> first_id ) )
-                        break;
-#endif
-                }
-
-#if OLD_STATIC_WRITE
-                RowSetRelease ( rs, ctx );
-#else
-                break;
-#endif
-            }
-
-#if OLD_STATIC_WRITE
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-#endif
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing static columns" );
-            VectorDoUntil ( & self -> static_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing static columns" );
-        VectorWhack ( & self -> static_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-static
-void TablePairCopyPresortColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy remaining columns */
-    uint32_t count = VectorLength ( & self -> presort_cols );
-    if ( count != 0 )
-    {
-        RowSetIterator *rsi;
-        TRY ( rsi = TablePairMakeSimpleRowSetIterator ( self, ctx ) )
-        {
-            STATUS ( 2, "copying '%s' presorted columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> presort_cols, i );
-                    assert ( col != NULL );
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-                }
-
-                RowSetRelease ( rs, ctx );
-            }
-
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing presorted columns" );
-            VectorDoUntil ( & self -> presort_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing presorted columns" );
-        VectorWhack ( & self -> presort_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-static
-void TablePairCopyMappedColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy mapped columns */
-    uint32_t count = VectorLength ( & self -> mapped_cols );
-    if ( count != 0 )
-    {
-        RowSetIterator *rsi;
-        const bool is_mapped = true;
-        const bool is_large = false;
-        TRY ( rsi = TablePairGetRowSetIterator ( self, ctx, is_mapped, is_large ) )
-        {
-            STATUS ( 2, "copying '%s' mapped columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> mapped_cols, i );
-                    assert ( col != NULL );
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-                }
-
-                RowSetRelease ( rs, ctx );
-            }
-
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing mapped columns" );
-            VectorDoUntil ( & self -> mapped_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing mapped columns" );
-        VectorWhack ( & self -> mapped_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-static
-void TablePairCopyLargeColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy large columns */
-    uint32_t count = VectorLength ( & self -> large_cols );
-    if ( count != 0 )
-    {
-        RowSetIterator *rsi;
-        const bool is_mapped = false;
-        const bool is_large = true;
-        TRY ( rsi = TablePairGetRowSetIterator ( self, ctx, is_mapped, is_large ) )
-        {
-            STATUS ( 2, "copying '%s' large columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> large_cols, i );
-                    assert ( col != NULL );
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-                }
-
-                RowSetRelease ( rs, ctx );
-            }
-
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing large columns" );
-            VectorDoUntil ( & self -> large_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing large columns" );
-        VectorWhack ( & self -> large_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-static
-void TablePairCopyLargeMappedColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy large mapped columns */
-    uint32_t count = VectorLength ( & self -> large_mapped_cols );
-    if ( count != 0 )
-    {
-        RowSetIterator *rsi;
-        const bool is_mapped = true;
-        const bool is_large = true;
-        TRY ( rsi = TablePairGetRowSetIterator ( self, ctx, is_mapped, is_large ) )
-        {
-            STATUS ( 2, "copying '%s' large mapped columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> large_mapped_cols, i );
-                    assert ( col != NULL );
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-                }
-
-                RowSetRelease ( rs, ctx );
-            }
-
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing large mapped columns" );
-            VectorDoUntil ( & self -> large_mapped_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing large mapped columns" );
-        VectorWhack ( & self -> large_mapped_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-static
-void TablePairCopyNormalColumns ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    /* copy remaining columns */
-    uint32_t count = VectorLength ( & self -> normal_cols );
-    if ( count != 0 )
-    {
-        RowSetIterator *rsi;
-        const bool is_mapped = false;
-        const bool is_large = false;
-        TRY ( rsi = TablePairGetRowSetIterator ( self, ctx, is_mapped, is_large ) )
-        {
-            STATUS ( 2, "copying '%s' columns", self -> full_spec );
-
-            while ( ! FAILED () )
-            {
-                uint32_t i;
-
-                RowSet *rs;
-                ON_FAIL ( rs = RowSetIteratorNext ( rsi, ctx ) )
-                    break;
-                if ( rs == NULL )
-                    break;
-
-                for ( i = 0; i < count; ++ i )
-                {
-                    ColumnPair *col = VectorGet ( & self -> normal_cols, i );
-                    assert ( col != NULL );
-                    ON_FAIL ( ColumnPairCopy ( col, ctx, rs ) )
-                        break;
-                }
-
-                RowSetRelease ( rs, ctx );
-            }
-
-            RowSetIteratorRelease ( rsi, ctx );
-        }
-
-        /* commit columns */
-        if ( ! FAILED () )
-        {
-            STATUS ( 3, "committing columns" );
-            VectorDoUntil ( & self -> normal_cols, false, TablePairCommitColumnPair, ( void* ) ctx );
-        }
-
-        /* douse columns */
-        STATUS ( 3, "releasing columns" );
-        VectorWhack ( & self -> normal_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    }
-}
-
-void TablePairCopy ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    size_t in_use, quota;
-
-    /* copy columns */
-    
-
-    ON_FAIL ( TablePairExplode ( self, ctx ) )
-        return;
-
-    STATUS ( 2, "copying table '%s'", self -> full_spec );
-
-    in_use = MemInUse ( ctx, & quota );
-    if ( ( quota + 1 ) != 0 )
-        STATUS ( 4, "MEMORY: %,zu bytes used out of %,zu total ( %u%% )", in_use, quota, ( uint32_t ) ( in_use * 100 ) / quota );
-    else
-        STATUS ( 4, "MEMORY: %,zu bytes used", in_use );
-
-    TRY ( TablePairPreCopy ( self, ctx ) )
-    {
-        TRY ( TablePairCopyStaticColumns ( self, ctx ) )
-        {
-            TRY ( TablePairCopyPresortColumns ( self, ctx ) )
-            {
-                TRY ( TablePairCopyMappedColumns ( self, ctx ) )
-                {
-                    TRY ( TablePairCopyLargeColumns ( self, ctx ) )
-                    {
-                        TRY ( TablePairCopyLargeMappedColumns ( self, ctx ) )
-                        {
-                            TablePairCopyNormalColumns ( self, ctx );
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /* cleanup */
-    if ( ! FAILED () )
-        TablePairPostCopy ( self, ctx );
-
-    in_use = MemInUse ( ctx, & quota );
-    if ( ( quota + 1 ) != 0 )
-        STATUS ( 4, "MEMORY: %,zu bytes used out of %,zu total ( %u%% )", in_use, quota, ( uint32_t ) ( in_use * 100 ) / quota );
-    else
-        STATUS ( 4, "MEMORY: %,zu bytes used", in_use );
-
-    STATUS ( 2, "finished with table '%s'", self -> full_spec );
-}
-
-
-/* Explode
- *  probably a bad name, but it is intended to mean
- *  register all enclosed columns
- *  and create a proper pair of KMetadata
- */
-static
-MetaPair *TablePairExplodeMetaPair ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    MetaPair *meta = NULL;
-    const KMetadata *smeta;
-
-    rc = VTableOpenMetadataRead ( self -> stbl, & smeta );
-    if ( rc != 0 )
-        ERROR ( rc, "VTableOpenMetadataRead failed on 'src.%s'", self -> full_spec );
-    else
-    {
-        KMetadata *dmeta;
-        rc = VTableOpenMetadataUpdate ( self -> dtbl, & dmeta );
-        if ( rc != 0 )
-            ERROR ( rc, "VTableOpenMetadataUpdate failed on 'dst.%s'", self -> full_spec );
-        else
-        {
-            meta = MetaPairMake ( ctx, smeta, dmeta, self -> full_spec );
-
-            KMetadataRelease ( dmeta );
-        }
-        
-        KMetadataRelease ( smeta );
-    }
-
-    return meta;
-}
-
-static
-ColumnPair *TablePairMatchColumnPair ( TablePair *self, const ctx_t *ctx, const char *name, bool required )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    KNamelist *types;
-    ColumnPair *col = NULL;
-
-    rc = VTableListWritableDatatypes ( self -> dtbl, name, & types );
-    if ( rc != 0 )
-        ERROR ( rc, "VTableListWritableDatatypes failed listing 'dst.%s.%s' datatypes", self -> full_spec, name );
-    else
-    {
-        uint32_t count;
-        rc = KNamelistCount ( types, & count );
-        if ( rc != 0 )
-            ERROR ( rc, "KNamelistCount failed listing 'dst.%s.%s' datatypes", self -> full_spec, name );
-        else
-        {
-            const VCursor *scurs;
-            rc = VTableCreateCursorRead ( self -> stbl, & scurs );
-            if ( rc != 0 )
-                ERROR ( rc, "VTableCreateCursorRead failed on 'src.%s'", self -> full_spec, name );
-            else
-            {
-                rc = VCursorPermitPostOpenAdd ( scurs );
-                if ( rc != 0 )
-                    ERROR ( rc, "VCursorPermitPostOpenAdd failed on 'src.%s'", self -> full_spec, name );
-                else
-                {
-                    rc = VCursorOpen ( scurs );
-                    if ( rc != 0 )
-                        ERROR ( rc, "VCursorOpen failed with no contents on 'src.%s'", self -> full_spec, name );
-                    else
-                    {
-                        uint32_t i;
-                        for ( i = 0; i < count; ++ i )
-                        {
-                            uint32_t idx;
-                            char colspec [ 256 ];
-
-                            const char *td;
-                            rc = KNamelistGet ( types, i, & td );
-                            if ( rc != 0 )
-                            {
-                                ERROR ( rc, "KNamelistGet ( %u ) failed listing 'dst.%s.%s' datatypes", i, self -> full_spec, name );
-                                break;
-                            }
-
-                            rc = string_printf ( colspec, sizeof colspec, NULL, "(%s)%s", td, name );
-                            if ( rc != 0 )
-                            {
-                                ABORT ( rc, "failed creating colspec for 'dst.%s.%s'", self -> full_spec, name );
-                                break;
-                            }
-
-                            rc = VCursorAddColumn ( scurs, & idx, colspec );
-                            if ( rc == 0 )
-                            {
-                                ColumnReader *reader;
-                                TRY ( reader = TablePairMakeColumnReader ( self, ctx, scurs, colspec, true ) )
-                                {
-                                    ColumnWriter *writer;
-                                    TRY ( writer = TablePairMakeColumnWriter ( self, ctx, NULL, colspec ) )
-                                    {
-                                        uint32_t j;
-                                        bool large = false;
-                                        bool is_static = VTableHasStaticColumn ( self -> stbl, name );
-                                        if ( is_static )
-                                        {
-                                            if ( self -> nonstatic_col_names != NULL )
-                                            {
-                                                for ( j = 0; self -> nonstatic_col_names [ j ] != NULL; ++ j )
-                                                {
-                                                    if ( strcmp ( name, self -> nonstatic_col_names [ j ] ) == 0 )
-                                                    {
-                                                        is_static = false;
-                                                        break;
-                                                    }
-                                                }
-                                            }
-                                        }
-                                        else if ( self -> large_col_names != NULL )
-                                        {
-                                            for ( j = 0; self -> large_col_names [ j ] != NULL; ++ j )
-                                            {
-                                                if ( strcmp ( name, self -> large_col_names [ j ] ) == 0 )
-                                                {
-                                                    large = true;
-                                                    break;
-                                                }
-                                            }
-                                        }
-
-                                        /* at this point, if the column is static, then avoid
-                                           any rigorous treatment and create an otherwise normal
-                                           column pair. may want to special case it for reporting */
-                                        col = is_static
-                                            ? TablePairMakeStaticColumnPair ( self, ctx, reader, writer, colspec )
-                                            : ( * self -> vt -> make_column_pair ) ( ( TBLPAIR_IMPL* ) self, ctx, reader, writer, colspec, large );
-
-                                        ColumnWriterRelease ( writer, ctx );
-                                    }
-
-                                    ColumnReaderRelease ( reader, ctx );
-                                }
-                                break;
-                            }
-                        }
-
-                        if ( col == NULL && ! FAILED () )
-                            ANNOTATE ( "column '%s' cannot be written", name );
-                    }
-                }
-
-
-                VCursorRelease ( scurs );
-            }
-        }
-
-        KNamelistRelease ( types );
-    }
-
-    return col;
-}
-
-static
-void TablePairDefaultExplode ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    KNamelist *pnames;
-
-    /* look at the physical columns in source */
-    rc = VTableListPhysColumns ( self -> stbl, & pnames );
-    if ( rc != 0 )
-        ERROR ( rc, "VTableListWritableColumns failed listing 'src.%s' physical columns", self -> full_spec );
-    else
-    {
-        KNamelist *dnames;
-
-        /* this gives us the columns that could potentially take input */
-        rc = VTableListSeededWritableColumns ( self -> dtbl, & dnames, pnames );
-        if ( rc != 0 )
-            ERROR ( rc, "VTableListWritableColumns failed listing 'dst.%s' columns", self -> full_spec );
-        else
-        {
-            uint32_t count;
-            rc = KNamelistCount ( dnames, & count );
-            if ( rc != 0 )
-                ERROR ( rc, "KNamelistCount failed listing 'dst.%s' columns", self -> full_spec );
-            else if ( count > 0 )
-            {
-                uint32_t i;
-                for ( i = 0; ! FAILED () && i < count; ++ i )
-                {
-                    ColumnPair *col;
-
-                    const char *name;
-                    rc = KNamelistGet ( dnames, i, & name );
-                    if ( rc != 0 )
-                    {
-                        ERROR ( rc, "KNamelistGet ( %u ) failed listing 'dst.%s' columns", i, self -> full_spec );
-                        break;
-                    }
-
-                    /* filter out the column names that are specifically excluded */
-                    if ( self -> exclude_col_names != NULL )
-                    {
-                        uint32_t j;
-                        for ( j = 0; self -> exclude_col_names [ j ] != NULL; ++ j )
-                        {
-                            if ( strcmp ( name, self -> exclude_col_names [ j ] ) == 0 )
-                            {
-                                name = NULL;
-                                break;
-                            }
-                        }
-                        if ( name == NULL )
-                            continue;
-                    }
-
-                    TRY ( col = TablePairMatchColumnPair ( self, ctx, name, true ) )
-                    {
-                        if ( col != NULL )
-                        {
-                            ON_FAIL ( TablePairAddColumnPair ( self, ctx, col ) )
-                            {
-                                ColumnPairRelease ( col, ctx );
-                            }
-                        }
-                    }
-                }
-            }
-            
-            KNamelistRelease ( dnames );
-        }
-
-        KNamelistRelease ( pnames );
-    }
-}
-
-void TablePairExplode ( TablePair *self, const ctx_t *ctx )
-{
-    if ( ! self -> exploded )
-    {
-        FUNC_ENTRY ( ctx );
-
-        STATUS ( 2, "exploding table '%s'", self -> full_spec );
-
-        /* first, ask subclass to perform explicit explode */
-        TRY ( ( * self -> vt -> explode ) ( self, ctx ) )
-        {
-            if ( self -> meta == NULL )
-            {
-                TRY ( self -> meta = TablePairExplodeMetaPair ( self, ctx ) )
-                {
-                    MetaPairCopy ( self -> meta, ctx, self -> full_spec, self -> exclude_meta );
-                    STATUS ( 3, "releasing metadata" );
-                    MetaPairRelease ( self -> meta, ctx );
-                    self -> meta = NULL;
-                }
-            }
-
-            if ( ! FAILED () )
-            {
-                /* next, perform default self-explode for all columns not excluded */
-                TRY ( TablePairDefaultExplode ( self, ctx ) )
-                {
-                    /* now create metadata pair */
-                    if ( self -> meta == NULL )
-                        self -> meta = TablePairExplodeMetaPair ( self, ctx );
-                    if ( ! FAILED () )
-                        self -> exploded = true;
-                }
-            }
-        }
-    }
-}
-
-
-/* AddColumnPair
- *  called from implementations
- */
-void TablePairAddColumnPair ( TablePair *self, const ctx_t *ctx, ColumnPair *col )
-{
-    if ( col != NULL )
-    {
-        FUNC_ENTRY ( ctx );
-
-        rc_t rc;
-        Vector *v = & self -> normal_cols;
-
-        const char *col_type = "";
-        const char *col_size = "";
-
-        if ( col -> large )
-        {
-            col_size = "large ";
-            v = & self -> large_cols;
-        }
-
-        if ( col -> is_static )
-        {
-            col_type = "static ";
-            v = & self -> static_cols;
-        }
-        else if ( col -> presorted )
-        {
-            col_type = "presorted ";
-            v = & self -> presort_cols;
-        }
-        else if ( col -> is_mapped )
-        {
-            col_type = "mapped ";
-            v = col -> large ? & self -> large_mapped_cols : & self -> mapped_cols;
-        }
-
-        STATUS ( 4, "adding %s%scolumn pair '%s'", col_size, col_type, col -> full_spec );
-        rc = VectorAppend ( v, NULL, ( const void* ) col );
-        if ( rc != 0 )
-            SYSTEM_ERROR ( rc, "failed to add column pair '%s'", col -> full_spec );
-        else
-        {
-            int64_t first;
-            uint64_t count;
-
-            TRY ( count = ColumnReaderIdRange ( col -> reader, ctx, & first ) )
-            {
-                int64_t last_excl = first + count;
-                if ( first < self -> first_id )
-                    self -> first_id = first;
-                /* Static columns may have incorrect range in legacy data */
-                if ( last_excl > self -> last_excl && !col->is_static)
-                    self -> last_excl = last_excl;
-            }
-        }
-    }
-}
-
-
-/* Init
- */
-void TablePairInit ( TablePair *self, const ctx_t *ctx, const TablePair_vt *vt,
-    const VTable *src, VTable *dst, const char *name, const char *opt_full_spec, bool reorder )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    memset ( self, 0, sizeof * self );
-    self -> vt = vt;
-
-    VectorInit ( & self -> static_cols, 0, 32 );
-    VectorInit ( & self -> presort_cols, 0, 4 );
-    VectorInit ( & self -> large_cols, 0, 32 );
-    VectorInit ( & self -> mapped_cols, 0, 32 );
-    VectorInit ( & self -> large_mapped_cols, 0, 32 );
-    VectorInit ( & self -> normal_cols, 0, 32 );
-
-    if ( opt_full_spec == NULL )
-        opt_full_spec = "";
-
-    rc = VTableAddRef ( self -> stbl = src );
-    if ( rc != 0 )
-        ERROR ( rc, "failed to duplicate tbl 'src.%s%s%s'", opt_full_spec, opt_full_spec [ 0 ] ? "." : "", name );
-    else
-    {
-        rc = VTableAddRef ( self -> dtbl = dst );
-        if ( rc != 0 )
-            ERROR ( rc, "failed to duplicate tbl 'dst.%s%s%s'", opt_full_spec, opt_full_spec [ 0 ] ? "." : "", name );
-        else
-        {
-            char *full_spec;
-
-            self -> full_spec_size = string_size ( opt_full_spec ) + string_size ( name );
-            if ( opt_full_spec [ 0 ] != 0  )
-                ++ self -> full_spec_size;
-
-            TRY ( full_spec = MemAlloc ( ctx, self -> full_spec_size + 1, false ) )
-            {
-                if ( opt_full_spec [ 0 ] != 0 )
-                    rc = string_printf ( full_spec, self -> full_spec_size + 1, NULL, "%s.%s", opt_full_spec, name );
-                else
-                    strcpy ( full_spec, name );
-                if ( rc != 0 )
-                    ABORT ( rc, "miscalculated string size" );
-                else
-                {
-                    const Tool *tp = ctx -> caps -> tool;
-
-                    self -> full_spec = full_spec;
-                    self -> name = full_spec;
-                    if ( opt_full_spec [ 0 ] != 0 )
-                        self -> name += string_size ( opt_full_spec ) + 1;
-
-                    /* start with an invalid range */
-                    self -> first_id = ( int64_t ) ( ~ ( uint64_t ) 0 >> 1 );
-                    self -> last_excl = - self -> first_id;
-
-                    /* row-set id ranges */
-                    self -> max_idx_ids = tp -> max_idx_ids;
-                    self -> min_idx_ids = tp -> min_idx_ids;
-
-                    /* record reordering */
-                    self -> reorder = reorder;
-
-                    KRefcountInit ( & self -> refcount, 1, "TablePair", "init", name );
-                    return;
-                }
-            }
-
-            VTableRelease ( self -> dtbl );
-            self -> dtbl = NULL;
-        }
-
-        VTableRelease ( self -> stbl );
-        self -> stbl = NULL;
-    }
-}
-
-/* Destroy
- *  destroys superclass items
- */
-void TablePairDestroy ( TablePair *self, const ctx_t *ctx )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-
-    VectorWhack ( & self -> static_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    VectorWhack ( & self -> presort_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    VectorWhack ( & self -> large_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    VectorWhack ( & self -> mapped_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    VectorWhack ( & self -> large_mapped_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-    VectorWhack ( & self -> normal_cols, TablePairReleaseColumnPair, ( void* ) ctx );
-
-    MetaPairRelease ( self -> meta, ctx );
-
-    rc = VTableReindex ( self -> dtbl );
-    if ( rc != 0 )
-        WARN ( "VTableReindex failed on 'dst.%s'", self -> full_spec );
-    rc = VTableRelease ( self -> dtbl );
-    if ( rc != 0 )
-        WARN ( "VTableRelease failed on 'dst.%s'", self -> full_spec );
-    VTableRelease ( self -> stbl );
-
-    MemFree ( ctx, ( void* ) self -> full_spec, self -> full_spec_size + 1 );
-
-    memset ( self, 0, sizeof * self );
-}
diff --git a/tools/sra-sort/tbl-pair.h b/tools/sra-sort/tbl-pair.h
deleted file mode 100644
index 4ee383e..0000000
--- a/tools/sra-sort/tbl-pair.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_tbl_pair_
-#define _h_sra_sort_tbl_pair_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_refcount_
-#include <klib/refcount.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VTable;
-struct DbPair;
-struct ColumnReader;
-struct ColumnWriter;
-struct ColumnPair;
-struct MetaPair;
-struct RowSetIterator;
-
-
-/*--------------------------------------------------------------------------
- * TablePair
- *  interface to pairing of source and destination tables
- */
-typedef struct TablePair_vt TablePair_vt;
-
-typedef struct TablePair TablePair;
-struct TablePair
-{
-    /* table id range */
-    int64_t first_id, last_excl;
-
-    /* polymorphic */
-    const TablePair_vt *vt;
-
-    /* the pair of VTables */
-    struct VTable const *stbl;
-    struct VTable *dtbl;
-
-    /* the pair of KMetadata */
-    struct MetaPair *meta;
-
-    /* the ColumnPairs */
-    Vector static_cols;
-    Vector presort_cols;
-    Vector large_cols;
-    Vector mapped_cols;
-    Vector large_mapped_cols;
-    Vector normal_cols;
-
-    /* filters */
-    const char **exclude_meta;
-    const char **exclude_col_names;
-    const char **mapped_col_names;
-    const char **nonstatic_col_names;
-    const char **large_col_names;
-
-    /* row-set id ranges */
-    size_t max_idx_ids;
-    size_t min_idx_ids;
-
-    /* simple table name */
-    const char *name;
-
-    /* full table spec */
-    size_t full_spec_size;
-    const char *full_spec;
-
-    /* reference counting */
-    KRefcount refcount;
-
-    /* true if table will be reordered */
-    bool reorder;
-
-    /* true if already exploded */
-    bool exploded;
-
-    uint8_t align [ 2 ];
-};
-
-#ifndef TBLPAIR_IMPL
-#define TBLPAIR_IMPL TablePair
-#endif
-
-struct TablePair_vt
-{
-    void ( * whack ) ( TBLPAIR_IMPL *self, const ctx_t *ctx );
-    void ( * pre_explode ) ( TBLPAIR_IMPL *self, const ctx_t *ctx );
-    void ( * explode ) ( TBLPAIR_IMPL *self, const ctx_t *ctx );
-    struct ColumnPair* ( *make_column_pair ) ( TBLPAIR_IMPL *self, const ctx_t *ctx,
-        struct ColumnReader *reader, struct ColumnWriter *writer, const char *colspec, bool large );
-    void ( * pre_copy ) ( TBLPAIR_IMPL *self, const ctx_t *ctx );
-    void ( * post_copy ) ( TBLPAIR_IMPL *self, const ctx_t *ctx );
-    struct RowSetIterator* ( *get_rowset_iter ) ( TBLPAIR_IMPL *self,
-        const ctx_t *ctx, bool mapped, bool large );
-};
-
-
-/* Make
- *  make a standard table pair from existing VTable objects
- */
-TablePair *TablePairMake ( const ctx_t *ctx,
-    struct VTable const *src, struct VTable *dst,
-    const char *name, const char *opt_full_spec, bool reorder );
-
-TablePair *DbPairMakeStdTblPair ( struct DbPair *self, const ctx_t *ctx,
-    struct VTable const *src, struct VTable *dst, const char *name, bool reorder );
-
-
-/* Release
- *  called by table at end of copy
- */
-void TablePairRelease ( TablePair *self, const ctx_t *ctx );
-
-/* Duplicate
- */
-TablePair *TablePairDuplicate ( TablePair *self, const ctx_t *ctx );
-
-
-/* Copy
- *  copy from source to destination table
- */
-void TablePairCopy ( TablePair *self, const ctx_t *ctx );
-
-
-/* PreExplode
- *  perform explosion before overall coopy
- */
-#define TablePairPreExplode( self, ctx ) \
-    POLY_DISPATCH_VOID ( pre_explode, self, TBLPAIR_IMPL, ctx )
-
-
-/* Explode
- *  probably a bad name, but it is intended to mean
- *  register all enclosed columns
- *  and create a proper pair of KMetadata
- */
-void TablePairExplode ( TablePair *self, const ctx_t *ctx );
-
-
-/* AddColumnPair
- *  called from implementations
- */
-void TablePairAddColumnPair ( TablePair *self, const ctx_t *ctx, struct ColumnPair *col );
-
-
-/* PreCopy
- * PostCopy
- *  give table a chance to prepare and cleanup
- */
-#define TablePairPreCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( pre_copy, self, TBLPAIR_IMPL, ctx )
-#define TablePairPostCopy( self, ctx ) \
-    POLY_DISPATCH_VOID ( post_copy, self, TBLPAIR_IMPL, ctx )
-
-
-/* GetRowSetIterator
- *  returns an iterator for copying
- */
-#define TablePairGetRowSetIterator( self, ctx, mapped, large ) \
-    POLY_DISPATCH_PTR ( get_rowset_iter, self, TBLPAIR_IMPL, ctx, mapped, large )
-
-
-/* Init
- */
-void TablePairInit ( TablePair *self, const ctx_t *ctx, const TablePair_vt *vt,
-    struct VTable const *src, struct VTable *dst,
-    const char *name, const char *opt_full_spec, bool reorder );
-
-/* Destroy
- */
-void TablePairDestroy ( TablePair *self, const ctx_t *ctx );
-
-
-#endif /* _h_sra_sort_tbl_pair_ */
diff --git a/tools/sra-sort/xcheck-ref-align.c b/tools/sra-sort/xcheck-ref-align.c
deleted file mode 100644
index 2c7a1cf..0000000
--- a/tools/sra-sort/xcheck-ref-align.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "caps.h"
-#include "ctx.h"
-#include "mem.h"
-#include "except.h"
-#include "status.h"
-
-#include <kapp/main.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <kproc/thread.h>
-#include <klib/rc.h>
-
-#include <string.h>
-
-#if ! _DEBUGGING
-#define USE_BGTHREAD 1
-#endif
-
-FILE_ENTRY ( xcheck-ref-align );
-
-
-/*--------------------------------------------------------------------------
- * TestReferenceCell
- *  properly sorted tables will allow both columns to be walked.
- *  each row of the REFERENCE table column MUST contain zero or more
- *  sequential integers, and the first integer MUST continue the sequence
- *  established by previous rows. therefore, the row will be fully specified
- *  by a start and stop id pair.
- */
-static
-int64_t TestReferenceCell ( const ctx_t *ctx,
-    const VCursor *ref_curs, uint32_t align_ids_idx,
-    const char *align_name, int64_t ref_row_id, int64_t excl_ref_last_idx )
-{
-    FUNC_ENTRY ( ctx );
-
-    const int64_t *cell;
-    uint32_t elem_bits, boff, row_len;
-
-    rc_t rc = VCursorCellDataDirect ( ref_curs, ref_row_id, align_ids_idx,
-        & elem_bits, ( const void** ) & cell, & boff, & row_len );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorCellDataDirect - failed to read row %ld from REFERENCE cursor", ref_row_id );
-    else if ( elem_bits != sizeof * cell * 8 )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcSize, rcIncorrect );
-        ERROR ( rc, "VCursorCellDataDirect - elem_bits of %u reading row %ld from REFERENCE cursor", elem_bits, ref_row_id );
-    }
-    else if ( boff != 0 )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcOffset, rcIncorrect );
-        ERROR ( rc, "VCursorCellDataDirect - bit offset of %u reading row %ld from REFERENCE cursor", boff, ref_row_id );
-    }
-    else
-    {
-        uint32_t i;
-        for ( i = 0; i < row_len; ++ i )
-        {
-            if ( cell [ i ] != excl_ref_last_idx + i )
-            {
-                rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcIncorrect );
-                ERROR ( rc, "REFERENCE.%s_IDS.%ld: expected id %ld but found %ld",
-                        align_name, ref_row_id, excl_ref_last_idx + i, cell [ i ] );
-                break;
-            }
-        }
-
-        excl_ref_last_idx += row_len;
-    }
-
-    return excl_ref_last_idx;
-}
-
-static
-void TestAlignCell ( const ctx_t *ctx,
-    const VCursor *align_curs, uint32_t ref_id_idx,
-    const char *align_name, int64_t align_row_id, int64_t ref_row_id )
-{
-    FUNC_ENTRY ( ctx );
-
-    const int64_t *cell;
-    uint32_t elem_bits, boff, row_len;
-
-
-    rc_t rc = VCursorCellDataDirect ( align_curs, align_row_id, ref_id_idx,
-        & elem_bits, ( const void** ) & cell, & boff, & row_len );
-    if ( rc != 0 )
-        ERROR ( rc, "VCursorCellDataDirect - failed to read row %ld from %s cursor", align_row_id, align_name );
-    else if ( elem_bits != sizeof * cell * 8 )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcSize, rcIncorrect );
-        ERROR ( rc, "VCursorCellDataDirect - elem_bits of %u reading row %ld from %s cursor", elem_bits, align_row_id, align_name );
-    }
-    else if ( boff != 0 )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcOffset, rcIncorrect );
-        ERROR ( rc, "VCursorCellDataDirect - bit offset of %u reading row %ld from %s cursor", boff, align_row_id, align_name );
-    }
-    else if ( row_len != 1 )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcRange, rcIncorrect );
-        ERROR ( rc, "VCursorCellDataDirect - row_len of %u reading row %ld from %s cursor", row_len, align_row_id, align_name );
-    }
-    else if ( * cell != ref_row_id )
-    {
-        rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcIncorrect );
-        ERROR ( rc, "%s.REF_ID.%ld: expected id %ld but found %ld",
-                align_name, align_row_id, ref_row_id, cell [ 0 ] );
-    }
-}
-
-/*--------------------------------------------------------------------------
- * CrossCheckRefAlignCols
- *  performs the cross-check
- */
-static
-void CrossCheckRefAlignCols ( const ctx_t *ctx,
-    const VCursor *ref_curs, uint32_t align_ids_idx,
-    const VCursor *align_curs, uint32_t ref_id_idx, const char *align_name )
-{
-    FUNC_ENTRY ( ctx );
-
-    int64_t ref_row_id, excl_ref_last_id;
-    rc_t rc = VCursorIdRange ( ref_curs, 0, & ref_row_id, ( uint64_t* ) & excl_ref_last_id );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorIdRange - failed to establish row range on REFERENCE cursor" );
-    else
-    {
-        int64_t align_row_id, excl_align_last_id;
-
-        excl_ref_last_id += ref_row_id;
-
-        rc = VCursorIdRange ( align_curs, 0, & align_row_id, ( uint64_t* ) & excl_align_last_id );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorIdRange - failed to establish row range on %s cursor", align_name );
-        else
-        {
-            int64_t excl_last_align_idx;
-
-            excl_align_last_id += align_row_id;
-
-            for ( excl_last_align_idx = 1; ref_row_id < excl_ref_last_id; ++ ref_row_id )
-            {
-                int64_t first_align_idx = excl_last_align_idx;
-
-                /* rule for bailing out */
-                rc = Quitting ();
-                if ( rc != 0 || FAILED () )
-                    break;
-
-                /* the REFERENCE id cell should be filled purely with sequential ids */
-                TRY ( excl_last_align_idx = TestReferenceCell ( ctx, ref_curs, align_ids_idx,
-                          align_name, ref_row_id, excl_last_align_idx ) )
-                {
-                    /* the ids must be within the range of the alignment table */
-                    if ( excl_last_align_idx > excl_align_last_id )
-                    {
-                        rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcExcessive );
-                        ERROR ( rc, "REFERENCE.%s_IDS.%ld: references non-existant rows ( %ld .. %ld : max %ld )",
-                                align_name, ref_row_id, first_align_idx, excl_last_align_idx, excl_align_last_id );
-                        break;
-                    }
-
-                    /* this is more of a permanent assert */
-                    if ( first_align_idx != align_row_id )
-                    {
-                        rc = RC ( rcExe, rcIndex, rcValidating, rcId, rcIncorrect );
-                        ERROR ( rc, "REFERENCE.%s_IDS.%ld: expected id %ld but found %ld",
-                                align_name, ref_row_id, first_align_idx, align_row_id );
-                        break;
-                    }
-
-                    /* each of the rows in alignment table must point back
-                       to the same row in the REFERENCE table */
-                    for ( ; align_row_id < excl_last_align_idx; ++ align_row_id )
-                    {
-                        ON_FAIL ( TestAlignCell ( ctx, align_curs, ref_id_idx,
-                                      align_name, align_row_id, ref_row_id ) )
-                            break;
-                    }
-                }
-            }
-
-            /* at this point, we must have seen every record */
-            if ( ! FAILED () )
-            {
-                if ( ref_row_id != excl_ref_last_id )
-                {
-                    rc = RC ( rcExe, rcIndex, rcValidating, rcRange, rcIncomplete );
-                    ERROR ( rc, "REFERENCE.%s_IDS: scan stopped on row %ld of %ld",
-                            align_name, ref_row_id, excl_ref_last_id );
-                }
-                if ( align_row_id != excl_align_last_id )
-                {
-                    rc = RC ( rcExe, rcIndex, rcValidating, rcRange, rcIncomplete );
-                    ERROR ( rc, "%s.REF_ID: scan stopped on row %ld of %ld",
-                            align_name, align_row_id, excl_align_last_id );
-                }
-            }
-        }
-    }
-}
-
-
-
-/*--------------------------------------------------------------------------
- * CrossCheckRefAlignCurs
- *  adds columns and opens cursors
- */
-static
-void CrossCheckRefAlignCurs ( const ctx_t *ctx,
-    const VCursor *ref_curs, const VCursor *align_curs, const char *align_name )
-{
-    FUNC_ENTRY ( ctx );
-
-    uint32_t align_ids_idx;
-    rc_t rc = VCursorAddColumn ( ref_curs, & align_ids_idx, "%s_IDS", align_name );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VCursorAddColumn - failed to add column '%s_IDS' to REFERENCE cursor", align_name );
-    else
-    {
-        uint32_t ref_id_idx;
-        rc = VCursorAddColumn ( align_curs, & ref_id_idx, "REF_ID" );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VCursorAddColumn - failed to add column 'REF_ID' to %s cursor", align_name );
-        else
-        {
-            rc = VCursorOpen ( ref_curs );
-            if ( rc != 0 )
-                INTERNAL_ERROR ( rc, "VCursorOpen - failed to open cursor on REFERENCE table" );
-            else
-            {
-                rc = VCursorOpen ( align_curs );
-                if ( rc != 0 )
-                    INTERNAL_ERROR ( rc, "VCursorOpen - failed to open cursor on %s table", align_name );
-                else
-                {
-                    rc = VCursorSetRowId ( ref_curs, 1 );
-                    if ( rc != 0 )
-                        INTERNAL_ERROR ( rc, "VCursorSetRowId - failed to set row-id on REFERENCE cursor" );
-                    else
-                    {
-                        rc = VCursorSetRowId ( align_curs, 1 );
-                        if ( rc != 0 )
-                            INTERNAL_ERROR ( rc, "VCursorSetRowId - failed to set row-id on %s cursor", align_name );
-                        else
-                        {
-                            CrossCheckRefAlignCols ( ctx, ref_curs, align_ids_idx, align_curs, ref_id_idx, align_name );
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-
-/*--------------------------------------------------------------------------
- * CrossCheckRefAlignTbl
- *  checks REFERENCE.<name>_IDS for properly sorted form
- *  runs a cross-check of REFERENCE.<name>_IDS against <name>.REF_ID
- */
-static
-void CrossCheckRefAlignTblInt ( const ctx_t *ctx,
-    const VTable *ref_tbl, const VTable *align_tbl, const char *align_name )
-{
-    FUNC_ENTRY ( ctx );
-
-    rc_t rc;
-    const VCursor *ref_curs;
-
-    rc = VTableCreateCursorRead ( ref_tbl, & ref_curs );
-    if ( rc != 0 )
-        INTERNAL_ERROR ( rc, "VTableCreateCursorRead - failed to open cursor on REFERENCE table" );
-    else
-    {
-        const VCursor *align_curs;
-        rc = VTableCreateCursorRead ( align_tbl, & align_curs );
-        if ( rc != 0 )
-            INTERNAL_ERROR ( rc, "VTableCreateCursorRead - failed to open cursor on %s table", align_name );
-        else
-        {
-            CrossCheckRefAlignCurs ( ctx, ref_curs, align_curs, align_name );
-
-            VCursorRelease ( align_curs );
-        }
-
-        VCursorRelease ( ref_curs );
-    }
-}
-
-#if USE_BGTHREAD
-
-typedef struct CrossCheckRefAlignTblData CrossCheckRefAlignTblData;
-struct CrossCheckRefAlignTblData
-{
-    Caps caps;
-    const VTable *ref_tbl, *align_tbl;
-    char align_name [ 1 ];
-};
-
-static
-rc_t CC CrossCheckRefAlignTblRun ( const KThread *self, void *data )
-{
-    CrossCheckRefAlignTblData *pb = data;
-
-    DECLARE_CTX_INFO ();
-    ctx_t thread_ctx = { & pb -> caps, NULL, & ctx_info };
-    const ctx_t *ctx = & thread_ctx;
-
-    STATUS ( 2, "running consistency-check on background thread" );
-
-    CrossCheckRefAlignTblInt ( ctx, pb -> ref_tbl, pb -> align_tbl, pb -> align_name );
-
-    STATUS ( 2, "finished consistency-check on background thread" );
-
-    VTableRelease ( pb -> align_tbl );
-    VTableRelease ( pb -> ref_tbl );
-    CapsWhack ( & pb -> caps, ctx );
-
-    return ctx -> rc;
-}
-
-#endif
-
-void CrossCheckRefAlignTbl ( const ctx_t *ctx,
-    const VTable *ref_tbl, const VTable *align_tbl, const char *align_name )
-{
-    FUNC_ENTRY ( ctx );
-
-#if USE_BGTHREAD
-    size_t name_len;
-    CrossCheckRefAlignTblData *pb;
-#endif
-
-    STATUS ( 2, "consistency-check on join indices between REFERENCE and %s tables", align_name );
-
-#if USE_BGTHREAD
-    name_len = strlen ( align_name );
-    TRY ( pb = MemAlloc ( ctx, sizeof * pb + name_len, false ) )
-    {
-        TRY ( CapsInit ( & pb -> caps, ctx ) )
-        {
-            rc_t rc = VTableAddRef ( pb -> ref_tbl = ref_tbl );
-            if ( rc != 0 )
-                ERROR ( rc, "VTableAddRef failed on REFERENCE table" );
-            else
-            {
-                rc = VTableAddRef ( pb -> align_tbl = align_tbl );
-                if ( rc != 0 )
-                    ERROR ( rc, "VTableAddRef failed on %s table", align_name );
-                else
-                {
-                    KThread *t;
-
-                    strcpy ( pb -> align_name, align_name );
-
-                    rc = KThreadMake ( & t, CrossCheckRefAlignTblRun, pb );
-                    if ( rc == 0 )
-                    {
-                        return;
-                    }
-
-                    VTableRelease ( pb -> align_tbl );
-                }
-
-                VTableRelease ( pb -> ref_tbl );
-            }
-
-            CapsWhack ( & pb -> caps, ctx );
-        }
-
-        MemFree ( ctx, pb, sizeof * pb + name_len );
-    }
-#else
-    CrossCheckRefAlignTblInt ( ctx, ref_tbl, align_tbl, align_name );
-#endif
-}
diff --git a/tools/sra-sort/xcheck.h b/tools/sra-sort/xcheck.h
deleted file mode 100644
index adf44c5..0000000
--- a/tools/sra-sort/xcheck.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _h_sra_sort_xcheck_
-#define _h_sra_sort_xcheck_
-
-#ifndef _h_sra_sort_defs_
-#include "sort-defs.h"
-#endif
-
-
-/*--------------------------------------------------------------------------
- * forwards
- */
-struct VTable;
-
-
-/*--------------------------------------------------------------------------
- * CrossCheckRefAlignTbl
- *  checks REFERENCE.<name>_IDS for properly sorted form
- *  runs a cross-check of REFERENCE.<name>_IDS against <name>.REF_ID
- */
-void CrossCheckRefAlignTbl ( const ctx_t *ctx,
-    struct VTable const *ref_tbl, struct VTable const *align_tbl, const char *align_name );
-
-#endif
diff --git a/tools/sra-stat/Makefile b/tools/sra-stat/Makefile
deleted file mode 100644
index 1f5aeb7..0000000
--- a/tools/sra-stat/Makefile
+++ /dev/null
@@ -1,92 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/sra-stat
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	sra-stat
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# sra-stat
-#  sra statistics
-#
-SRASTAT_SRC = \
-	sra-stat
-
-SRASTAT_OBJ = \
-	$(addsuffix .$(OBJX),$(SRASTAT_SRC))
-
-SRASTAT_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/sra-stat: $(SRASTAT_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SRASTAT_LIB)
diff --git a/tools/sra-stat/sra-stat.c b/tools/sra-stat/sra-stat.c
deleted file mode 100644
index 14322ce..0000000
--- a/tools/sra-stat/sra-stat.c
+++ /dev/null
@@ -1,3188 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "sra-stat.vers.h"
-
-#include <kapp/main.h>
-
-#include <sra/wsradb.h>
-#include <sra/sradb-priv.h>
-#include <sra/types.h>
-
-#include <vdb/dependencies.h> /* VDBDependencies */
-#include <vdb/database.h> /* VDatabaseRelease */
-#include <vdb/table.h> /* VTableRelease */
-#include <vdb/cursor.h> /* VCursor */
-
-#include <kdb/database.h> /* KDatabase */
-#include <kdb/table.h>
-#include <kdb/meta.h> /* KMetadata */
-#include <kdb/namelist.h> /* KMDataNodeListChild */
-#include <kdb/kdb-priv.h>
-
-#include <kfs/directory.h>
-#include <kfs/file.h>
-
-#include <klib/sort.h> /* ksort */
-#include <klib/checksum.h>
-#include <klib/container.h>
-#include <klib/namelist.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/rc.h>
-
-#include <os-native.h> /* strtok_r on Windows */
-
-#include <assert.h>
-#include <math.h> /* sqrt */
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include <stdio.h> /* stderr */
-
-#define DISP_RC(rc, msg) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, msg))
-
-#define DISP_RC2(rc, name, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt, rc, \
-        "$(name): $(msg)", "name=%s,msg=%s", name, msg)))
-
-#define DISP_RC_Read(rc, name, spot, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt, rc, "column $(name), spot $(spot): $(msg)", \
-        "name=%s,spot=%lu,msg=%s", name, spot, msg)))
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-#define MAX_NREADS 2*1024
-
-/*********** XMLLogger_Encode : copied from kapp/log-xml.c (-lload) ***********/
-
-static
-rc_t CC XMLLogger_Encode(const char* src,
-    char* aDst, size_t dst_sz, size_t *num_writ)
-{
-    rc_t rc = 0;
-    size_t bytes;
-    const char* p;
-    char* dst = aDst;
-
-    assert(src != NULL && num_writ != NULL);
-
-    *num_writ = 0;
-    if( *src == '\0' ) {
-        *dst = *src;
-    } else {
-        do {
-            switch(*src) {
-                case '\'':
-                    bytes = 6;
-                    p = "'";
-                    break;
-                case '"':
-                    bytes = 6;
-                    p = """;
-                    break;
-                case '&':
-                    bytes = 5;
-                    p = "&";
-                    break;
-                case '<':
-                    bytes = 4;
-                    p = "<";
-                    break;
-                case '>':
-                    bytes = 4;
-                    p = ">";
-                    break;
-                default:
-                    bytes = 1;
-                    p = src;
-                    break;
-            }
-            if( (*num_writ + bytes) > dst_sz ) {
-                rc = RC(rcExe, rcLog, rcEncoding, rcBuffer, rcInsufficient);
-            } else {
-                memcpy(dst, p, bytes);
-                *num_writ = *num_writ + bytes;
-                dst += bytes;
-            }
-        } while(rc == 0 && *++src != '\0');
-        if (rc == 0 && *src == '\0' && ((*num_writ + bytes) <= dst_sz)) {
-            *dst = *src;
-        }
-    }
-    return rc;
-}
-
-/*********** XMLLogger_Encode : copied from kapp/log-xml.c (-lload) ***********/
-
-typedef struct BAM_HEADER_RG { /* @RG: Read group. */
-    char* ID; /* Read group identifier. */
-    char* LB; /* Library. */
-    char* SM; /* Sample. */
-} BAM_HEADER_RG;
-static
-rc_t BAM_HEADER_RG_copy(BAM_HEADER_RG* dest, const BAM_HEADER_RG* src)
-{
-    assert(dest && !dest->ID && !dest->LB && !dest->SM
-        && src  &&  src ->ID &&  src ->LB &&  src ->SM);
-    dest->ID = strdup(src->ID);
-    dest->LB = strdup(src->LB);
-    dest->SM = strdup(src->SM);
-    if (!dest->ID || !dest->LB || !dest->SM) {
-        return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-    return 0;
-}
-static void BAM_HEADER_RG_free(BAM_HEADER_RG* rg) {
-    assert(rg);
-    free(rg->ID);
-    free(rg->LB);
-    free(rg->SM);
-    rg->ID = rg->LB = rg->SM = NULL;
-}
-static void BAM_HEADER_RG_print_xml(const BAM_HEADER_RG* rg) {
-    rc_t rc = 0;
-    char library[1024] = "";
-    char sample[1024] = "";
-    char* l = library;
-    char* s = sample;
-    size_t num_writ = 0;
-    assert(rg);
-    if (rg->LB) {
-        rc = XMLLogger_Encode(rg->LB, library, sizeof library, &num_writ);
-        if (rc) {
-            l = rg->LB;
-            PLOGMSG(klogWarn, (klogWarn, "Library value is too long: "
-                "XML-safe conversion was disabled for @RG\tID:$(ID)\tLB:$(LB)"
-                "ID=%s,LB=%s", rg->ID, rg->LB));
-        }
-        OUTMSG((" library=\"%s\"", l ? l : ""));
-    }
-    if (rg->SM) {
-        rc = XMLLogger_Encode(rg->SM, sample, sizeof sample, &num_writ);
-        if (rc) {
-            s = rg->SM;
-            PLOGMSG(klogWarn, (klogWarn, "Sample value is too long: "
-                "XML-safe conversion was disabled for @RG\tID:$(ID)\tSM:$(SM)"
-                "ID=%s,SM=%s", rg->ID, rg->SM));
-        }
-        OUTMSG((" sample=\"%s\"" , s ? s : ""));
-    }
-}
-typedef struct SraStats {
-    BSTNode n;
-    char     spot_group[1024]; /* SPOT_GROUP Column */
-    uint64_t spot_count; /*** spot count ***/
-    uint64_t spot_count_mates; /*** spots with mates ***/
-    uint64_t bio_len; /** biological len (BIO_BASE_COUNT) **/
-    uint64_t bio_len_mates; /** biological len when mates are present**/
-    uint64_t total_len; /** total len (BASE_COUNT) **/
-    uint64_t bad_spot_count; /** number of spots flagged with rd_filter=2 **/
-    uint64_t bad_bio_len;        /** biological length of bad spots ***/
-    uint64_t filtered_spot_count; /* number of spots flagged with rd_filter=2 */
-    uint64_t filtered_bio_len;   /** biological length of filtered spots **/
-    uint64_t total_cmp_len; /* CMP_READ : compressed */
-    BAM_HEADER_RG BAM_HEADER;
-} SraStats;
-typedef struct Statistics {  /* READ_LEN columnn */
-    /* average READ_LEN value */
-    /* READ_LEN standard deviation. Is calculated just when requested. */
-    /* running (continuous) standard deviation */
-
-    int64_t n; /* number of values */
-    double a; /* the mean value */
-    double q; /* Qi = Q[i-1] + (Xi - A[i-1])(Xi - Ai) */
-
-    bool variable; /* variable or fixed value */
-    double prev_val;
-} Statistics;
-typedef struct Statistics2 {
-    int n;
-    double average;
-    double diff_sq_sum;
-} Statistics2;
-static
-void Statistics2Init(Statistics2* self, double sum, spotid_t count) {
-    assert(self);
-
-    if (count) {
-        self->average = sum / count;
-    }
-}
-
-static void Statistics2Add(Statistics2* self, double value) {
-    double diff = 0;
-
-    assert(self);
-
-    ++self->n;
-
-    diff = value - self->average;
-    self->diff_sq_sum += diff * diff;
-}
-
-static
-void Statistics2Print(const Statistics2* selfs,
-    uint32_t nreads, const char* indent,
-
-     /* the same as in <Statistics: just to make <Statistics> and <Statistics2>
-        look the same */
-    uint64_t spot_count)
-{
-    int i = 0;
-
-    if (nreads) {
-        assert(selfs && indent);
-    }
-
-    OUTMSG(("%s<Statistics2 nreads=\"%u\" nspots=\"%lu\">\n",
-        indent, nreads, spot_count));
-
-    for (i = 0; i < nreads; ++i) {
-        double dev = 0;
-        const Statistics2* stats = selfs + i;
-        double avr = stats->average;
-        if (stats->n > 0) {
-            dev = sqrt(stats->diff_sq_sum / stats->n);
-        }
-
-        OUTMSG(("%s  "
-            "<Read index=\"%d\" count=\"%ld\" average=\"%f\" stdev=\"%f\"/>\n",
-            indent, i, stats->n, avr, dev));
-    }
-
-    OUTMSG(("%s</Statistics2>\n", indent));
-}
-
-typedef struct {
-    uint64_t cnt[5];
-    bool CS_NATIVE;
-    const SRAColumn *col;
-    bool finalized;
-} Bases;
-static
-void BasesInit(Bases *self, const SRATable *tbl)
-{
-    rc_t rc = 0;
-    const char name[] = "CS_NATIVE";
-    const SRAColumn *col = NULL;
-    const void *base = NULL;
-    bitsz_t boff = ~0;
-    bitsz_t row_bits = ~0;
-
-    assert(self);
-    memset(self, 0, sizeof *self);
-    self->CS_NATIVE = true;
-
-    rc = SRATableOpenColumnRead(tbl, &col, name, NULL);
-    if (rc != 0) {
-        PLOGERR(klogInt, (klogErr, rc,
-            "while SRATableOpenColumnRead($(name))", "name=%s", name));
-    }
-
-    if (rc == 0) {
-        rc = SRAColumnRead(col, 1, &base, &boff, &row_bits);
-        if (rc != 0) {
-            PLOGERR(klogInt, (klogErr, rc,
-                "while SRAColumnRead($(name))", "name=%s", name));
-        }
-        if (boff != 0 || row_bits != 8) {
-            rc = RC(rcExe, rcColumn, rcReading, rcData, rcInvalid);
-            PLOGERR(klogInt, (klogErr, rc,
-                "invalid boff or row_bits while SRAColumnRead($(name))",
-                "name=%s", name));
-        }
-    }
-
-    if (rc == 0) {
-        self->CS_NATIVE = *((bool*)base);
-    }
-
-    RELEASE(SRAColumn, col);
-
-    {
-        const char *name = self->CS_NATIVE ? "CSREAD" : "READ";
-        const char *datatype
-            = self->CS_NATIVE ? "INSDC:x2cs:bin" : "INSDC:x2na:bin";
-        rc = SRATableOpenColumnRead(tbl, &self->col, name, datatype);
-        if (rc != 0) {
-            PLOGERR(klogInt, (klogErr, rc,
-                "while SRATableOpenColumnRead($(name), $(type))",
-                "name=%s,type=%s", name, datatype));
-        }
-    }
-}
-
-static
-void BasesFinalize(Bases *self)
-{
-    assert(self);
-
-    if (self->col == NULL) {
-        LOGMSG(klogInfo, "Bases statistics will not be printed : "
-            "READ column was not opened during BasesFinalize()");
-        return;
-    }
-
-    self->finalized = true;
-}
-
-static
-rc_t BasesRelease(Bases *self)
-{
-    rc_t rc = 0;
-
-    assert(self);
-
-    RELEASE(SRAColumn, self->col);
-
-    return rc;
-}
-
-static
-void BasesAdd(Bases *self, spotid_t spotid)
-{
-    rc_t rc = 0;
-    const void *base = NULL;
-    bitsz_t boff = ~0;
-    bitsz_t row_bits = ~0;
-    bitsz_t i = ~0;
-    const unsigned char *bases = NULL;
-
-    assert(self);
-
-    if (self->col == NULL) {
-        return;
-    }
-
-    rc = SRAColumnRead(self->col, spotid, &base, &boff, &row_bits);
-    if (rc != 0) {
-        PLOGERR(klogInt, (klogErr, rc,
-            "while SRAColumnRead(READ, $(type))",
-            "type=%s", self->CS_NATIVE ? "CS_NATIVE" : "not CS_NATIVE"));
-        BasesRelease(self);
-        return;
-    }
-
-    if ((row_bits % 8) != 0) {
-        rc = RC(rcExe, rcColumn, rcReading, rcData, rcInvalid);
-        PLOGERR(klogInt, (klogErr, rc, "Invalid row_bits '$(row_bits) "
-            "while SRAColumnRead(READ, $(type), spotid=$(spotid))",
-            "row_bits=%lu,type=%s,spotid=%lu",
-            row_bits, self->CS_NATIVE ? "CS_NATIVE" : "not CS_NATIVE", spotid));
-        BasesRelease(self);
-        return;
-    }
-
-    row_bits /= 8;
-    bases = base;
-    for (i = 0; i < row_bits; ++i) {
-        unsigned char base = bases[i];
-        if (base > 4) {
-            rc = RC(rcExe, rcColumn, rcReading, rcData, rcInvalid);
-            PLOGERR(klogInt, (klogErr, rc,
-                "Invalid READ column value '$(base) "
-                "while SRAColumnRead($(type), spotid=$(spotid), index=$(i))",
-                "base=%d,type=%s,spotid=%lu,index=%lu",
-                base, self->CS_NATIVE ? "CS_NATIVE" : "not CS_NATIVE",
-                spotid, i));
-            BasesRelease(self);
-            return;
-        }
-        ++self->cnt[base];
-    }
-}
-
-static
-void BasesPrint(const Bases *self,
-    uint64_t base_count, const char* indent)
-{
-    const char tag[] = "Bases";
-    const char *name = NULL;
-    int i = ~0;
-
-    assert(self);
-
-    if (!self->finalized) {
-        LOGMSG(klogInfo, "Bases statistics will not be printed : "
-            "Bases object was not finalized during BasesPrint()");
-        return;
-    }
-
-    if (self->cnt[0] + self->cnt[1] + self->cnt[2] +
-        self->cnt[3] + self->cnt[4] != base_count)
-    {
-        rc_t rc = RC(rcExe, rcNumeral, rcComparing, rcData, rcInvalid);
-        LOGERR(klogErr, rc,
-            "BASE_COUNT MISMATCH DURING BASES COUNT CALCULATION");
-        return;
-    }
-
-    name = self->CS_NATIVE ? "0123." : "ACGTN";
-
-    OUTMSG(("%s<%s cs_native=\"%s\" count=\"%lu\">\n",
-        indent, tag, self->CS_NATIVE ? "true" : "false", base_count));
-    for (i = 0; i < 5; ++i) {
-        OUTMSG(("%s  <Base value=\"%c\" count=\"%lu\"/>\n",
-            indent, name[i], self->cnt[i]));
-    }
-    OUTMSG(("%s</%s>\n", indent, tag));
-}
-
-typedef struct {
-    uint64_t spot_count;
-    uint64_t spot_count_mates;
-    uint64_t BIO_BASE_COUNT; /* bio_len */
-    uint64_t bio_len_mates;
-    uint64_t BASE_COUNT; /* total_len */
-    uint64_t bad_spot_count;
-    uint64_t bad_bio_len;
-    uint64_t filtered_spot_count;
-    uint64_t filtered_bio_len;
-    uint64_t total_cmp_len; /* CMP_READ : compressed */
-
-    bool variable_nreads;
-    uint32_t nreads; /* if (nreads == 0) then (nreads is variable) */
-    Statistics * stats ; /* nreads elements */
-    Statistics2* stats2; /* nreads elements */
-
-    Bases bases_count;
-} SraStatsTotal;
-static
-rc_t SraStatsTotalMakeStatistics(SraStatsTotal* self, uint32_t nreads)
-{
-    assert(self);
-
-    if (nreads == 0) {
-        return 0;
-    }
-
-    assert(self->stats == NULL);
-    self->stats = calloc(nreads, sizeof *self->stats);
-    if (self->stats == NULL) {
-        return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    assert(self->stats2 == NULL);
-    self->stats2 = calloc(nreads, sizeof *self->stats2);
-    if (self->stats2 == NULL) {
-        free(self->stats);
-        self->stats = NULL;
-        return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-    }
-
-    self->nreads = nreads;
-
-    return 0;
-}
-
-static
-void SraStatsTotalStatistics2Init(SraStatsTotal* self,
-    int nreads, uint64_t* sums, uint64_t* count)
-{
-    int i = 0;
-    assert(self);
-    if (nreads) {
-        assert(sums);
-    }
-    for (i = 0; i < nreads; ++i) {
-        uint64_t sum = sums[i];
-        Statistics2* stats = self->stats2 + i;
-        assert(stats);
-        Statistics2Init(stats, sum, count[i]);
-    }
-}
-
-static rc_t SraStatsTotalFree(SraStatsTotal* self) {
-    assert(self);
-
-    free(self->stats);
-    self->stats = NULL;
-
-    free(self->stats2);
-    self->stats2 = NULL;
-
-    BasesRelease(&self->bases_count);
-
-    self->nreads = 0;
-
-    return 0;
-}
-
-static void StatisticsAdd(Statistics* self, double value) {
-    double a_1 = 0;
-
-    /* http://en.wikipedia.org/wiki/Stdev#Rapid_calculation_methods */
-
-    assert(self);
-
-    a_1 = self->a;
-
-    if (self->n++ == 0) {
-        self->prev_val = value;
-    }
-    else if (self->prev_val != value) {
-        self->variable = true;
-    }
-
-    self->a += (value - a_1) / self->n;
-    self->q += ((double)value - a_1) * ((double)value - self->a);
-}
-
-static double StatisticsAverage(const Statistics* self) {
-    assert(self);
-
-    return self->a;
-}
-
-static double StatisticsStdev(const Statistics* self) {
-    assert(self);
-
-    if (self->n == 0) {
-        return 0;
-    }
-
-    return sqrt(self->q / self->n);
-}
-
-static
-void SraStatsTotalAdd(SraStatsTotal* self,
-    uint32_t* values, uint32_t nreads)
-{
-    int i = ~0;
-
-    assert(self && values);
-
-    if (self->nreads != nreads) {
-        self->variable_nreads = true;
-    }
-
-    if (self->variable_nreads) {
-        return;
-    }
-
-    for (i = 0; i < nreads; ++i) {
-        uint32_t value = values[i];
-        if (value > 0) {
-            Statistics* stats = self->stats + i;
-            assert(stats);
-
-            StatisticsAdd(stats, value);
-        }
-    }
-}
-
-static
-void SraStatsTotalAdd2(SraStatsTotal* self, uint32_t* values) {
-    int i = 0;
-
-    assert(self && values);
-
-    for (i = 0; i < self->nreads; ++i) {
-        uint32_t value = values[i];
-        if (value > 0) {
-            Statistics2* stats = self->stats2 + i;
-            assert(stats);
-
-            Statistics2Add(stats, value);
-        }
-    }
-}
-
-static double s_Round(double X) { return floor(X + 0.5); }
-
-static
-void print_double_or_int(const char* name, double val, bool variable) {
-    double rnd = s_Round(val);
-    assert(name);
-    if (variable) {
-        OUTMSG((" %s=\"%.2f\"", name, val));
-    }
-    else {
-        OUTMSG((" %s=\"%d\"", name, (int)rnd));
-    }
-}
-
-static
-void StatisticsPrint(const Statistics* selfs,
-    uint32_t nreads, const char* indent)
-{
-    int i = ~0;
-
-    if (nreads) {
-        assert(selfs && indent);
-    }
-
-    for (i = 0; i < nreads; ++i) {
-        const Statistics* stats = selfs + i;
-        double avr = StatisticsAverage(stats);
-        double dev = StatisticsStdev(stats);
-
-        OUTMSG(("%s  <Read index=\"%d\"", indent, i));
-        OUTMSG((" count=\"%ld\"", stats->n, i));
-        print_double_or_int("average", avr, stats->variable);
-        print_double_or_int("stdev"  , dev, stats->variable);
-        OUTMSG(("/>\n"));
-    }
-}
-static rc_t StatisticsDiff(const Statistics* ss,
-    const Statistics2* ss2, uint32_t nreads)
-{
-    rc_t rc = 0;
-
-    int i = ~0;
-
-    assert(ss && ss2);
-
-    for (i = 0; i < nreads; ++i) {
-        const Statistics * s  = ss  + i;
-        const Statistics2* s2 = ss2 + i;
-
-        double d  = StatisticsStdev(s);
-        double d2 = sqrt(s2->diff_sq_sum / s2->n);
-
-        double diff = d - d2;
-        if (diff < 0) {
-            diff = -diff;
-        }
-
-        if (diff > 1e-6) {
-              /* RC(rcExe, rcTest, rcExecuting, rcTest, rcFailed); */
-            rc = RC(rcExe, rcNumeral, rcComparing, rcData, rcInvalid);
-            DISP_RC(rc, "While comparing calculated standard deviations");
-        }
-
-        if (s->n != s2->n) {
-            rc = RC(rcExe, rcNumeral, rcComparing, rcData, rcInvalid);
-            DISP_RC(rc, "While comparing read statistics counts");
-        }
-
-        diff = StatisticsAverage(s) - s2->average;
-        if (diff < 0) {
-            diff = -diff;
-        }
-        if (diff > 1e-10) {
-              /* RC(rcExe, rcTest, rcExecuting, rcTest, rcFailed); */
-            rc = RC(rcExe, rcNumeral, rcComparing, rcData, rcInvalid);
-            DISP_RC(rc, "While comparing calculated average");
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t SraStatsTotalPrintStatistics(const SraStatsTotal* self,
-    const char* indent, bool test)
-{
-    rc_t rc = 0;
-
-    assert(self && indent);
-
-    OUTMSG(("%s<Statistics nreads=\"", indent));
-
-    if (self->variable_nreads) {
-        OUTMSG(("variable\"/>\n"));
-    }
-    else {
-        OUTMSG(("%u\"", self->nreads));
-        OUTMSG((" nspots=\"%lu\">\n", self->spot_count));
-        StatisticsPrint(self->stats, self->nreads, indent);
-        OUTMSG(("%s</Statistics>\n", indent));
-
-        if (test) {
-            Statistics2Print(self->stats2, self->nreads, indent,
-                self->spot_count);
-            rc = StatisticsDiff(self->stats, self->stats2, self->nreads);
-        }
-    }
-
-    return rc;
-}
-
-typedef struct srastat_parms {
-    const char* table_path;
-
-    bool xml; /* output format (txt or xml) */
-    bool printMeta;
-    bool quick; /* quick mode: stats from meta */
-    bool skip_members; /* not to print spot_group statistics */
-    bool skip_alignment; /* not to print alignment info */
-    bool print_arcinfo;
-    bool statistics; /* calculate average and stdev */
-    bool test; /* test stdev */
-
-    spotid_t start, stop;
-
-    bool hasSPOT_GROUP;
-    bool variableReadLength;
-
-    SraStatsTotal total; /* is used in srastat_print */
-} srastat_parms;
-typedef struct SraStatsMeta {
-    bool found;
-    uint64_t BASE_COUNT;
-    uint64_t BIO_BASE_COUNT;
-    uint64_t CMP_BASE_COUNT; /* compressed base count when present */
-    uint64_t spot_count;
-    char* spot_group; /* optional */
-    BAM_HEADER_RG BAM_HEADER;
-} SraStatsMeta;
-typedef struct MetaDataStats {
-    bool found;
-    SraStatsMeta table;
-    uint32_t spotGroupN;
-    SraStatsMeta *spotGroup;
-} MetaDataStats;
-typedef struct SraSizeStats { uint64_t size; } SraSizeStats;
-typedef struct Formatter {
-    char name[256];
-    char vers[256];
-} Formatter;
-typedef struct Loader {
-    char date[256];
-    char name[256];
-    char vers[256];
-} Loader;
-typedef struct SraMeta {
-    uint32_t metaVersion;
-    int32_t tblVersion;
-    time_t loadTimestamp;
-    Formatter formatter;
-    Loader loader;
-} SraMeta;
-typedef struct ArcInfo_struct {
-    KTime_t timestamp;
-    struct {
-        const char* tag;
-        uint64_t size;
-        char md5[32 + 1];
-    } i[2];
-} ArcInfo;
-typedef struct Quality {
-    uint32_t value;
-    uint64_t count;
-} Quality;
-typedef struct QualityStats {
-    Quality* QUALITY;
-    size_t allocated;
-    size_t used;
-} QualityStats;
-typedef enum EMetaState {
-    eMSNotFound,
-    eMSFound
-} EMetaState;
-typedef struct Count {
-    EMetaState state;
-    uint64_t value;
-} Count;
-typedef struct Counts {
-    char* tableName;
-    EMetaState tableState;
-    EMetaState metaState;
-    Count BASE_COUNT;
-    Count SPOT_COUNT;
-} Counts;
-typedef struct TableCounts {
-    EMetaState state;
-    Counts* count;
-    size_t allocated;
-    size_t used;
-} TableCounts;
-typedef struct Ctx {
-    const BSTree* tr;
-    const MetaDataStats* meta;
-    const SraMeta* info;
-    const SraSizeStats* sizes;
-    const ArcInfo* arc_info;
-    srastat_parms* pb;
-    SraStatsTotal* total;
-    const VDatabase* db;
-    QualityStats quality;
-    TableCounts tables;
-} Ctx;
-
-typedef rc_t (CC * RG_callback)(const BAM_HEADER_RG* rg, const void* data);
-
-static
-rc_t CC meta_RG_callback(const BAM_HEADER_RG* rg, const void* data)
-{
-    rc_t rc = 0;
-
-    const MetaDataStats* meta = data;
-
-    int i = 0;
-    bool found = false;
-
-    assert(rg && meta && rg->ID);
-
-    for (i = 0; i < meta->spotGroupN && rc == 0; ++i) {
-        SraStatsMeta* ss = &meta->spotGroup[i];
-        const char* spot_group = ss->spot_group;
-
-        assert(spot_group);
-        if (strcmp(spot_group, rg->ID) == 0) {
-            rc = BAM_HEADER_RG_copy(&ss->BAM_HEADER, rg);
-            found = true;
-            break;
-        }
-    }
-
-    if (rc == 0 && !found) {
-        /* There could be Read groups that are present in the BAM_HEADER 
-        but missed in the csra. We was just ignore them. */
-    }
-
-    return rc;
-}
-
-static
-int CC srastats_cmp ( const void *item, const BSTNode *n )
-{
-    const char *sg = item;
-    const SraStats *ss = ( const SraStats* ) n;
-
-    return strcmp(sg,ss->spot_group);
-}
-
-static
-rc_t CC tree_RG_callback(const BAM_HEADER_RG* rg, const void* data)
-{
-    rc_t rc = 0;
-
-    const BSTree* tr = data;
-    SraStats* ss = NULL;
-
-    assert(rg && tr && rg->ID);
-
-    ss = (SraStats*) BSTreeFind(tr, rg->ID, srastats_cmp);
-    if (ss == NULL) {
-        /* There could be Read groups that are present in the BAM_HEADER 
-        but missed in the csra. We was just ignore them. */
-    }
-    else {
-        rc = BAM_HEADER_RG_copy(&ss->BAM_HEADER, rg);
-    }
-
-    return rc;
-}
-
-static
-int CC QualityCmp(const void* s1, const void* s2, void *data) {
-    const Quality* q1 = s1;
-    const Quality* q2 = s2;
-    assert(q1 && q2);
-    return q1->value < q2->value ? -1 : q1->value == q2->value ? 0 : 1;
-}
-
-static
-int CC CountsCmp(const void* v1, const void* v2, void *data) {
-    const Counts* e1 = v1;
-    const Counts* e2 = v2;
-    assert(e1 && e2 && e1->tableName && e2->tableName);
-    return strcmp(e1->tableName, e2->tableName);
-}
-
-static
-rc_t QualityParse(Quality* self, const KMDataNode* node, const char* name)
-{
-    rc_t rc = 0;
-    const char start[] = "PHRED_";
-    int i = strlen(start);
-
-    assert(self && name);
-
-    if (strlen(name) <= strlen(start)) {
-        rc = RC(rcExe, rcXmlDoc, rcParsing, rcName, rcInvalid);
-        PLOGERR(klogInt, (klogErr, rc,
-            "Bad node name: STATS/QUALITY/$(name)", "name=%s", name));
-        return rc;
-    }
-
-    self->value = 0;
-    for (; i < strlen(name); ++i) {
-        if (name[i] < '0' || name[i] > '9') {
-            rc_t rc = RC(rcExe, rcXmlDoc, rcParsing, rcName, rcInvalid);
-            PLOGERR(klogInt, (klogErr, rc,
-                "Bad node name: STATS/QUALITY/$(name)", "name=%s", name));
-            return rc;
-        }
-        self->value = self->value * 10 + name[i] - '0';
-    }
-
-    rc = KMDataNodeReadAsU64(node, &self->count);
-    if (rc != 0) {
-        PLOGERR(klogInt, (klogErr, rc,
-            "while reading the value of STATS/QUALITY/$(name)",
-            "name=%s", name));
-    }
-
-    return rc;
-}
-
-static
-rc_t QualityStatsRead1(QualityStats* self,
-    const KMDataNode* parent, const char* name)
-{
-    const KMDataNode* node = NULL;
-
-    rc_t rc = KMDataNodeOpenNodeRead(parent, &node, name);
-    DISP_RC2(rc, name, "while calling KMDataNodeOpenNodeRead");
-
-    if (rc == 0) {
-        size_t size = 64;
-        assert(self);
-        if (self->allocated == 0) {
-            assert(self->QUALITY == NULL && self->used == 0);
-            self->QUALITY = malloc(size * sizeof *self->QUALITY);
-            if (self->QUALITY == NULL) {
-                return
-                    RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            }
-            self->allocated = size;
-        }
-        else if (self->used >= self->allocated) {
-            Quality* tmp = NULL;
-            size = self->allocated * 2;
-            tmp = realloc(self->QUALITY, size * sizeof *self->QUALITY);
-            if (tmp == NULL) {
-                return
-                    RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            }
-            self->QUALITY = tmp;
-            self->allocated = size;
-        }
-    }
-
-    if (rc == 0) {
-        assert((self->used < self->allocated) && self->QUALITY);
-        rc = QualityParse(&self->QUALITY[self->used], node, name);
-        if (rc == 0)
-        {   ++self->used; }
-    }
-
-    RELEASE(KMDataNode, node);
-
-    return rc;
-}
-
-static
-rc_t QualityStatsRead(QualityStats* self, const KMetadata* meta)
-{
-    rc_t rc = 0;
-    const char name[] = "STATS/QUALITY";
-    const KMDataNode* node = NULL;
-
-    assert(self && meta);
-
-    memset(self, 0, sizeof *self);
-
-    rc = KMetadataOpenNodeRead(meta, &node, name);
-
-    if (rc != 0) {
-        if (GetRCState(rc) == rcNotFound) {
-            DBGMSG(DBG_APP,DBG_COND_1, ("%s: not found\n", name));
-            return 0;
-        }
-        DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-    }
-
-    if (rc == 0 && node) {
-        KNamelist* names = NULL;
-        rc = KMDataNodeListChild(node, &names);
-        DISP_RC2(rc, name, "while calling KMDataNodeListChild");
-        if (rc == 0) {
-            uint32_t count = 0;
-            rc = KNamelistCount(names, &count);
-            DISP_RC2(rc, name, "while calling KNamelistCount");
-            if (rc == 0) {
-                uint32_t i = ~0;
-                for (i = 0; i < count && rc == 0; ++i) {
-                    const char* child = NULL;
-                    rc = KNamelistGet(names, i, &child);
-                    if (rc != 0) {
-                       PLOGERR(klogInt, (klogInt, rc,
-                            "while calling STATS/QUALITY::KNamelistGet($(idx))",
-                            "idx=%i", i));
-                    }
-                    else
-                    {   rc = QualityStatsRead1(self, node, child); }
-                }
-            }
-        }
-        RELEASE(KNamelist, names);
-    }
-    RELEASE(KMDataNode, node);
-    return 0;
-}
-
-static
-void QualityStatsSort(QualityStats* self)
-{
-    assert(self);
-    ksort(self->QUALITY, self->used, sizeof *self->QUALITY, QualityCmp, NULL);
-}
-
-static
-void TableCountsSort(TableCounts* self)
-{
-    assert(self);
-    ksort(self->count, self->used, sizeof *self->count, CountsCmp, NULL);
-}
-static
-rc_t QualityStatsPrint(const QualityStats* self, const char* indent)
-{
-    size_t i = ~0;
-    const char tag[] = "QualityCount";
-    assert(self && indent);
-
-    if (self->allocated == 0)
-    {   return 0; }
-
-    OUTMSG(("%s<%s>\n", indent, tag));
-    for (i = 0; i < self->used; ++i) {
-        Quality* q = &self->QUALITY[i];
-        OUTMSG(("  %s<Quality value=\"%lu\" count=\"%lu\"/>\n",
-            indent, q->value, q->count));
-    }
-    OUTMSG(("%s</%s>\n", indent, tag));
-
-    return 0;
-}
-
-static
-void QualityStatsRelease(QualityStats* self)
-{
-    assert(self);
-    free(self->QUALITY);
-    memset(self, 0, sizeof *self);
-}
-
-static
-rc_t CountRead(Count* self, const char* name, const KMDataNode* parent)
-{
-    rc_t rc = 0;
-
-    const KMDataNode* node = NULL;
-
-    assert(self && parent && name);
-
-    memset(self, 0, sizeof *self);
-
-    rc = KMDataNodeOpenNodeRead(parent, &node, name);
-    if (rc != 0) {
-        if (GetRCState(rc) == rcNotFound) {
-            DBGMSG(DBG_APP,DBG_COND_1, ("%s: not found\n", name));
-            rc = 0;
-        }
-        DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-    }
-    else {
-        rc = KMDataNodeReadAsU64(node, &self->value);
-        DISP_RC2(rc, name, "while calling KMDataNodeReadAsU64");
-        if (rc == 0)
-        {   self->state = eMSFound; }
-    }
-
-    RELEASE(KMDataNode, node);
-
-    return rc;
-}
-
-static
-rc_t TableCountsRead1(TableCounts* self,
-    const VDatabase* db, const char* tableName)
-{
-    const VTable* tbl = NULL;
-    const KMetadata* meta = NULL;
-    const char name[] = "STATS/TABLE";
-    const KMDataNode* node = NULL;
-    rc_t rc = VDatabaseOpenTableRead(db, &tbl, tableName);
-    DISP_RC2(rc, tableName, "while calling VDatabaseOpenTableRead");
-
-    if (rc == 0) {
-        size_t size = 8;
-        assert(self);
-        if (self->allocated == 0) {
-            assert(self->count == NULL && self->used == 0);
-            self->count = malloc(size * sizeof *self->count);
-            if (self->count == NULL) {
-                return
-                    RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            }
-            self->allocated = size;
-        }
-        else if (self->used >= self->allocated) {
-            Counts* tmp = NULL;
-            size = self->allocated * 2;
-            tmp = realloc(self->count, size * sizeof *self->count);
-            if (tmp == NULL) {
-                return
-                    RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            }
-            self->count = tmp;
-            self->allocated = size;
-        }
-    }
-    if (rc == 0) {
-        assert(self->used < self->allocated && self->count);
-    }
-    if (rc == 0) {
-        rc = VTableOpenMetadataRead(tbl, &meta);
-        DISP_RC2(rc, name, "while calling VTableOpenMetadataRead");
-    }
-    if (rc == 0) {
-        rc = KMetadataOpenNodeRead(meta, &node, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                DBGMSG(DBG_APP,DBG_COND_1, ("%s: not found\n", name));
-                rc = 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-        else
-        {   assert(node); }
-    }
-
-    if (rc == 0 && node != NULL) {
-        Counts* c = NULL;
-        assert((self->used < self->allocated) && (self->count != NULL));
-        c = &self->count[self->used];
-        memset(c, 0, sizeof *c);
-        c->tableName = strdup(tableName);
-        if (c->tableName == NULL)
-        {   return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted); }
-        c->tableState = eMSFound;
-        c->metaState = eMSFound;
-        rc = CountRead(&c->BASE_COUNT, "BASE_COUNT", node);
-
-        {
-            rc_t rc2 = CountRead(&c->SPOT_COUNT, "SPOT_COUNT", node);
-            if (rc2 != 0 && rc == 0)
-            {   rc = rc2; }
-        }
-
-        if (rc == 0)
-        {   ++self->used; }
-    }
-
-    RELEASE(KMDataNode, node);
-    RELEASE(KMetadata, meta);
-    RELEASE(VTable, tbl);
-
-    return rc;
-}
-
-static
-rc_t TableCountsRead(TableCounts* self, const VDatabase* db)
-{
-    rc_t rc = 0;
-    KNamelist* names = NULL;
-
-    assert(self);
-
-    memset(self, 0, sizeof *self);
-
-    if (db == NULL)
-    {   return 0; }
-
-    rc = VDatabaseListTbl(db, &names);
-    DISP_RC(rc, "while calling VDatabaseListTbl");
-    if (rc == 0) {
-        uint32_t count = 0;
-        rc = KNamelistCount(names, &count);
-        DISP_RC(rc, "while calling VDatabaseListTbl::KNamelistCount");
-        if (rc == 0) {
-            uint32_t i = ~0;
-            for (i = 0; i < count && rc == 0; ++i) {
-                const char* table = NULL;
-                rc = KNamelistGet(names, i, &table);
-                if (rc != 0) {
-                   PLOGERR(klogInt, (klogInt, rc,
-                        "while calling VDatabaseListTbl::KNamelistGet($(idx))",
-                        "idx=%i", i));
-                }
-                else
-                {   rc = TableCountsRead1(self, db, table); }
-            }
-        }
-    }
-
-    RELEASE(KNamelist, names);
-
-    return rc;
-}
-
-static
-rc_t CountPrint(const Count* self, const char* indent, const char* tag)
-{
-    assert(self && indent && tag);
-    switch (self->state) {
-        case eMSNotFound:
-            OUTMSG(("  %s<%s state=\"not found\"/>\n", indent, tag));
-            break;
-        case eMSFound:
-            OUTMSG(("  %s<%s count=\"%lu\"/>\n", indent, tag, self->value));
-            break;
-        default:
-            assert(0);
-            OUTMSG(("  %s<%s state=\"UNEXPECTED\"/>\n", indent, tag));
-            break;
-    }
-    return 0;
-}
-
-static
-rc_t TableCountsPrint(const TableCounts* self, const char* indent)
-{
-    rc_t rc = 0;
-    const char tag[] = "Databases";
-
-    assert(self && indent);
-
-    if (self->allocated == 0)
-    {   return 0; }
-
-    OUTMSG(("%s<%s>\n", indent, tag));
-    {
-        size_t i = ~0;
-        const char tag[] = "Database";
-        OUTMSG(("  %s<%s>\n", indent, tag));
-        for (i = 0; i < self->used; ++i) {
-            const char tag[] = "Statistics";
-            const Counts* p = &self->count[i];
-            OUTMSG(("    %s<Table name=\"%s\">\n", indent, p->tableName));
-            switch (p->metaState) {
-            case eMSNotFound:
-                OUTMSG(("      %s<%s source=\"meta\" state=\"not found\"/>\n",
-                    indent, tag));
-                break;
-            case eMSFound: {
-                char buf[512];
-                OUTMSG(("      %s<%s source=\"meta\">\n", indent, tag));
-                rc = string_printf(buf, sizeof buf, NULL, "      %s", indent);
-                if (rc == 0) {
-                    CountPrint(&p->SPOT_COUNT, buf, "Rows");
-                    CountPrint(&p->BASE_COUNT, buf, "Elements");
-                }
-                OUTMSG(("      %s</%s>\n", indent, tag));
-                break;
-              }
-            default:
-                assert(0);
-                OUTMSG(("      %s<%s source=\"meta\" state=\"UNEXPECTED\"/>\n",
-                    indent, tag));
-                break;
-            }
-            OUTMSG(("    %s</Table>\n", indent));
-        }
-        OUTMSG(("  %s</%s>\n", indent, tag));
-    }
-    OUTMSG(("%s</%s>\n", indent, tag));
-
-    return rc;
-}
-
-static
-void TableCountsRelease(TableCounts* self)
-{
-    size_t i = ~0;
-    assert(self);
-    for (i = 0; i < self->used; ++i) {
-        assert(self->count);
-        free(self->count[i].tableName);
-        self->count[i].tableName = NULL;
-    }
-    free(self->count);
-    memset(self, 0, sizeof *self);
-}
-
-static
-rc_t parse_bam_header(const VDatabase* db,
-    const RG_callback cb, const void* data)
-{
-    rc_t rc = 0;
-    const char name[] = "BAM_HEADER";
-    const KMetadata* meta = NULL;
-    const KMDataNode* node = NULL;
-    char* buffer = NULL;
-
-    if (db == NULL) {
-        return rc;
-    }
-    assert(cb);
-
-    if (rc == 0) {
-        rc = VDatabaseOpenMetadataRead(db, &meta);
-        DISP_RC(rc, "while calling VDatabaseOpenMetadataRead");
-    }
-
-    if (rc == 0) {
-        rc = KMetadataOpenNodeRead(meta, &node, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                return 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-    }
-
-    if (rc == 0) {
-        size_t num_read = 0;
-        size_t remaining = 0;
-        rc = KMDataNodeRead(node, 0, NULL, 0, &num_read, &remaining);
-        DISP_RC2(rc, name, "while calling KMDataNodeRead");
-        assert(num_read == 0);
-        if (rc == 0 && remaining > 0) {
-            buffer = malloc(remaining + 1);
-            if (buffer == NULL) {
-                rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-            }
-            else {
-                size_t size = 0;
-                rc = KMDataNodeReadCString(node, buffer, remaining + 1, &size);
-                DISP_RC2(rc, name, "while calling KMDataNodeReadCString");
-                assert(size == remaining);
-            }
-        }
-    }
-
-    if (rc == 0 && buffer) {
-        const char* token = strtok(buffer, "\n");
-        while (token) {
-            const char RG[] = "@RG\t";
-            if (strncmp(token, RG, sizeof RG - 1) == 0) {
-                const char ID[] = "\tID:";
-                const char LB[] = "\tLB:";
-                const char SM[] = "\tSM:";
-                char* id_end = NULL;
-                char* lb_end = NULL;
-                char* sm_end = NULL;
-                BAM_HEADER_RG rg;
-                memset(&rg, 0, sizeof rg);
-                rg.ID = strstr(token, ID);
-                rg.LB = strstr(token, LB);
-                rg.SM = strstr(token, "\tSM:");
-                if (rg.ID) {
-                    rg.ID += sizeof ID - 1;
-                }
-                if (rg.ID) {
-                    id_end = strchr(rg.ID, '\t');
-                }
-                if (rg.LB) {
-                    rg.LB += sizeof LB - 1;
-                }
-                if (rg.LB) {
-                    lb_end = strchr(rg.LB, '\t');
-                }
-                if (rg.SM) {
-                    rg.SM += sizeof SM - 1;
-                }
-                if (rg.SM) {
-                    sm_end = strchr(rg.SM, '\t');
-                }
-                if (id_end) {
-                    *id_end = '\0';
-                }
-                if (lb_end) {
-                    *lb_end = '\0';
-                }
-                if (sm_end) {
-                    *sm_end = '\0';
-                }
-                if (rg.ID && rg.LB && rg.SM) {
-                    rc = cb(&rg, data);
-                }
-                if (rc) {
-                    break;
-                }
-            }
-            token = strtok(NULL, "\n");
-        }
-    }
-    free(buffer);
-    buffer = NULL;
-    RELEASE(KMDataNode, node);
-    RELEASE(KMetadata, meta);
-    return rc;
-}
-
-static
-void SraStatsMetaDestroy(SraStatsMeta* self)
-{
-    if (self == NULL)
-    {   return; }
-    BAM_HEADER_RG_free(&self->BAM_HEADER);
-    free(self->spot_group);
-    self->spot_group = NULL;
-}
-
-static
-rc_t CC fileSizeVisitor(const KDirectory* dir,
-    uint32_t type, const char* name, void* data)
-{
-    rc_t rc = 0;
-
-    SraSizeStats* sizes = (SraSizeStats*) data;
-
-    if (type & kptAlias)
-    {   return rc; }
-
-    assert(sizes);
-
-    switch (type) {
-        case kptFile: {
-            uint64_t size = 0;
-            rc = KDirectoryFileSize(dir, &size, name);
-            DISP_RC2(rc, name, "while calling KDirectoryFileSize");
-            if (rc == 0) {
-                sizes->size += size;
-                DBGMSG(DBG_APP, DBG_COND_1,
-                    ("File '%s', size %lu\n", name, size));
-            }
-            break;
-        }
-        case kptDir: 
-            DBGMSG(DBG_APP, DBG_COND_1, ("Dir '%s'\n", name));
-            rc = KDirectoryVisit(dir, false, fileSizeVisitor, sizes, name);
-            DISP_RC2(rc, name, "while calling KDirectoryVisit");
-            break;
-        default:
-            rc = RC(rcExe, rcDirectory, rcVisiting, rcType, rcUnexpected);
-            DISP_RC2(rc, name, "during KDirectoryVisit");
-            break;
-    }
-
-    return rc;
-}
-
-static
-rc_t get_arc_info(const SRAMgr* mgr, const char* path,
-    const SRATable* tbl, ArcInfo* arc_info)
-{
-    rc_t rc = 0;
-    memset(arc_info, 0, sizeof(*arc_info));
-
-    if( (rc = SRAMgrGetTableModDate(mgr, &arc_info->timestamp, "%s", path)) == 0 ) {
-        uint32_t i;
-        for(i = 0; i < sizeof(arc_info->i) / sizeof(arc_info->i[0]); i++) {
-            const KFile* kfile;
-            arc_info->i[i].tag = i == 0 ? "sra" : "lite.sra";
-            if( (rc = SRATableMakeSingleFileArchive(tbl, &kfile, i == 1, NULL)) == 0 ) {
-                MD5State md5;
-                uint64_t pos = 0;
-                uint8_t buffer[256 * 1024];
-                size_t num_read = 0, x;
-
-                MD5StateInit(&md5);
-                do {
-                    if( (rc = KFileRead(kfile, pos, buffer, sizeof(buffer), &num_read)) == 0 ) {
-                        MD5StateAppend(&md5, buffer, num_read);
-                        pos += num_read;
-                    }
-                } while(rc == 0 && num_read != 0);
-                if( rc == 0 && (rc = KFileSize(kfile, &arc_info->i[i].size)) == 0 ) {
-                    uint8_t digest[16];
-                    MD5StateFinish(&md5, digest);
-                    for(pos = 0, x = 0; rc == 0 && pos < sizeof(digest); pos++) {
-                        rc = string_printf(&arc_info->i[i].md5[x], sizeof(arc_info->i[i].md5) - x, &num_read, "%02x", digest[pos]);
-                        x += num_read;
-                    }
-                }
-                KFileRelease(kfile);
-            }
-        }
-    }
-    return rc;
-}
-
-static
-rc_t get_size(const SRATable* tbl, SraSizeStats* sizes)
-{
-    rc_t rc = 0;
-
-    const KDatabase* kDb = NULL;
-    const KTable* kTbl = NULL;
-    const KDirectory* dir = NULL;
-
-    assert(tbl && sizes);
-
-    rc = SRATableGetKTableRead(tbl, &kTbl);
-    DISP_RC(rc, "while calling SRATableGetKTableRead");
-
-    if (rc == 0) {
-        rc = KTableOpenParentRead(kTbl, &kDb);
-        DISP_RC(rc, "while calling KTableOpenParentRead");
-    }
-
-    if (rc == 0 && kDb) {
-        while (rc == 0) {
-            const KDatabase* par = NULL;
-            rc = KDatabaseOpenParentRead(kDb, &par);
-            DISP_RC(rc, "while calling KDatabaseOpenParentRead");
-            if (par == NULL)
-            {   break; }
-            else {
-                RELEASE(KDatabase, kDb);
-                kDb = par;
-            }
-        }
-        if (rc == 0) {
-            rc = KDatabaseOpenDirectoryRead(kDb, &dir);
-            DISP_RC(rc, "while calling KDatabaseOpenDirectoryRead");
-        }
-    }
-
-    if (rc == 0 && dir == NULL) {
-        rc = KTableOpenDirectoryRead(kTbl, &dir);
-        DISP_RC(rc, "while calling KTableOpenDirectoryRead");
-    }
-
-    memset(sizes, 0, sizeof *sizes);
-
-    if (rc == 0) {
-        rc = KDirectoryVisit(dir, false, fileSizeVisitor, sizes, NULL);
-        DISP_RC(rc, "while calling KDirectoryVisit");
-    }
-
-    RELEASE(KDirectory, dir);
-    RELEASE(KTable, kTbl);
-    RELEASE(KDatabase, kDb);
-
-    return rc;
-}
-
-static
-rc_t readTxtAttr(const KMDataNode* self, const char* name, const char* attrName,
-    char* buf, size_t buf_size)
-{
-    rc_t rc = 0;
-    size_t num_read = 0;
-
-    if (self == NULL) {
-        rc = RC(rcExe, rcMetadata, rcReading, rcSelf, rcNull);
-        return rc;
-    }
-
-    assert(self && name && attrName && buf && buf_size);
-
-    rc = KMDataNodeReadAttr(self, attrName, buf, buf_size, &num_read);
-    if (rc != 0) {
-        PLOGERR(klogErr, (klogErr, rc, "Cannot read '$(name)@$(attr)'",
-            "name=%s,attr=%s", name, attrName));
-    }
-    else { DBGMSG(DBG_APP, DBG_COND_1, ("%s@%s = %s\n", name, attrName, buf)); }
-
-    return rc;
-}
-
-static
-rc_t get_load_info(const KMetadata* meta, SraMeta* info)
-{
-    rc_t rc = 0;
-    const KMDataNode* node = NULL;
-    assert(meta && info);
-    memset(info, 0, sizeof *info);
-    info->metaVersion = 99;
-    info->tblVersion = -1;
-
-    if (rc == 0) {
-        rc = KMetadataVersion(meta, &info->metaVersion);
-        DISP_RC(rc, "While calling KMetadataVersion");
-        if (rc == 0) {
-            DBGMSG(DBG_APP, DBG_COND_1,
-                ("KMetadataVersion=%d\n",info->metaVersion));
-            switch (info->metaVersion) {
-                case 1:
-                    info->tblVersion = 0;
-                    break;
-                case 2: {
-                    const char name[] = "SOFTWARE/loader";
-                    rc = KMetadataOpenNodeRead(meta, &node, name);
-                    if (rc != 0) {
-                        if (GetRCState(rc) == rcNotFound) {
-                            DBGMSG(DBG_APP,DBG_COND_1,("%s: not found\n",name));
-                            rc = 0;
-                        }
-                        DISP_RC2(rc, name,
-                            "while calling KMetadataOpenNodeRead");
-                    }
-                    else {
-                        rc = readTxtAttr(node, name, "vers",
-                            info->loader.vers, sizeof info->loader.vers);
-                        if (rc == 0) {
-                            if (strncmp("2.", info->loader.vers, 2) == 0)
-                            {      info->tblVersion = 2; }
-                            else { info->tblVersion = 1; }
-                        }
-                        else if (GetRCState(rc) == rcNotFound) {
-                            DBGMSG(DBG_APP,DBG_COND_1,
-                                ("%s/@%s: not found\n", name, "vers"));
-                            rc = 0;
-                        }
-                        if (rc == 0) {
-                            rc = readTxtAttr(node, name, "date",
-                                info->loader.date, sizeof info->loader.date);
-                            if (GetRCState(rc) == rcNotFound) {
-                                DBGMSG(DBG_APP,DBG_COND_1,
-                                    ("%s/@%s: not found\n", name, "date"));
-                                rc = 0;
-                            }
-                        }
-                        if (rc == 0) {
-                            rc = readTxtAttr(node, name, "name",
-                                info->loader.name, sizeof info->loader.name);
-                            if (GetRCState(rc) == rcNotFound) {
-                                DBGMSG(DBG_APP,DBG_COND_1,
-                                    ("%s/@%s: not found\n", name, "name"));
-                                rc = 0;
-                            }
-                        }
-                    }
-                    break;
-                }
-                default:
-                    rc = RC(rcExe, rcMetadata, rcReading, rcData, rcUnexpected);
-                    PLOGERR(klogErr, (klogErr, rc,
-                        "Unexpected MetadataVersion: $(version)",
-                        "version=%d", info->metaVersion));
-                    break;
-            }
-        }
-    }
-
-    if (rc == 0) {
-        const char name[] = "SOFTWARE/formatter";
-        RELEASE(KMDataNode, node);
-        rc = KMetadataOpenNodeRead(meta, &node, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound ) {
-                DBGMSG(DBG_APP,DBG_COND_1,("%s: not found\n",name));
-                rc = 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-        else {
-            if (rc == 0) {
-                rc = readTxtAttr(node, name, "vers",
-                    info->formatter.vers, sizeof info->formatter.vers);
-                if (GetRCState(rc) == rcNotFound) {
-                    DBGMSG(DBG_APP,DBG_COND_1,
-                        ("%s/@%s: not found\n", name, "vers"));
-                    rc = 0;
-                }
-            }
-            if (rc == 0) {
-                rc = readTxtAttr(node, name, "name",
-                    info->formatter.name, sizeof info->formatter.name);
-                if (GetRCState(rc) == rcNotFound) {
-                    DBGMSG(DBG_APP,DBG_COND_1,
-                        ("%s/@%s: not found\n", name, "name"));
-                    rc = 0;
-                }
-            }
-        }
-    }
-
-    if (rc == 0) {
-        const char name[] = "LOAD/timestamp";
-        RELEASE(KMDataNode, node);
-        rc = KMetadataOpenNodeRead(meta, &node, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound ) {
-                DBGMSG(DBG_APP,DBG_COND_1,("%s: not found\n",name));
-                rc = 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-        else {
-            size_t num_read = 0;
-            size_t remaining = 0;
-            rc = KMDataNodeRead(node, 0,
-                &info->loadTimestamp, sizeof info->loadTimestamp,
-                &num_read, &remaining);
-            if (rc == 0) {
-                if (remaining || num_read != sizeof info->loadTimestamp) {
-                    rc = RC(rcExe, rcMetadata, rcReading, rcData, rcIncorrect);
-                }
-            }
-            else {
-                if (GetRCState(rc) == rcNotFound) {
-                    DBGMSG(DBG_APP, DBG_COND_1, ("%s: not found\n", name));
-                    rc = 0;
-                }
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-    }
-
-    RELEASE(KMDataNode, node);
-
-    return rc;
-}
-
-static
-rc_t readStatsMetaNode(const KMDataNode* parent, const char* parentName,
-    const char* name, uint64_t* result, bool quick, bool optional)
-{
-    rc_t rc = 0;
-
-    const KMDataNode* node = NULL;
-
-    assert(parent && parentName && name && result);
-
-    rc = KMDataNodeOpenNodeRead(parent, &node, name);
-    if (rc != 0)
-    {
-        if (GetRCState(rc) == rcNotFound && optional)
-        {
-            *result = 0;
-            rc = 0;
-        }
-        else if ( quick )
-        {
-            PLOGERR(klogInt, (klogInt, rc, "while opening $(parent)/$(child)",
-                "parent=%s,child=%s", parentName, name));
-        }
-    }
-    else {
-        rc = KMDataNodeReadAsU64(node, result);
-        if (GetRCObject(rc) == rcTransfer && GetRCState(rc) == rcIncomplete) {
-            *result = 0;
-            rc = 0;
-        }
-        if ( rc != 0 && quick )
-        {
-            PLOGERR(klogInt, (klogInt, rc, "while reading $(parent)/$(child)",
-                "parent=%s,child=%s", parentName, name));
-        }
-    }
-
-    RELEASE(KMDataNode, node);
-
-    return rc;
-}
-
-static
-rc_t readStatsMetaNodes(const KMDataNode* parent, const char* name,
-                        SraStatsMeta* stats, bool quick)
-{
-    rc_t rc = 0;
-    const char* parentName = name;
-
-    assert(parent && stats);
-
-    if (parentName == NULL)
-    {   parentName = "STATS/TABLE"; }
-
-    if (rc == 0 && name) {
-        stats->spot_group = strdup(name);
-        if (stats->spot_group == NULL)
-        {   rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted); }
-    }
-
-    if (rc == 0) {
-        rc = readStatsMetaNode(parent,
-            parentName, "BASE_COUNT", &stats->BASE_COUNT, quick, false);
-    }
-    if (rc == 0) {
-        rc = readStatsMetaNode(parent,
-            parentName, "BIO_BASE_COUNT", &stats->BIO_BASE_COUNT, quick, false);
-    }
-    if (rc == 0) {
-        rc = readStatsMetaNode(parent,
-            parentName, "SPOT_COUNT", &stats->spot_count, quick, false);
-    }
-    if (rc == 0) {
-        rc = readStatsMetaNode(parent,
-            parentName, "CMP_BASE_COUNT", &stats->CMP_BASE_COUNT, quick, true);
-    }
-
-    if (rc == 0)
-    {   stats->found = true; }
-    else { SraStatsMetaDestroy(stats); }
-
-    return rc;
-}
-
-static
-rc_t get_stats_meta(const KMetadata* meta,
-    MetaDataStats* stats, bool quick)
-{
-    rc_t rc = 0;
-    assert(meta && stats);
-    memset(stats, 0, sizeof *stats);
-
-    if (rc == 0) {
-        const char name[] = "STATS/TABLE";
-        const KMDataNode* node = NULL;
-        rc = KMetadataOpenNodeRead(meta, &node, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                DBGMSG(DBG_APP,DBG_COND_1, ("%s: not found\n", name));
-                rc = 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-        if (rc == 0 && node)
-        {   rc = readStatsMetaNodes(node, NULL, &stats->table, quick); }
-        RELEASE(KMDataNode, node);
-    }
-
-    if (rc == 0) {
-        const char name[] = "STATS/SPOT_GROUP";
-        const KMDataNode* parent = NULL;
-        rc = KMetadataOpenNodeRead(meta, &parent, name);
-        if (rc != 0) {
-            if (GetRCState(rc) == rcNotFound) {
-                DBGMSG(DBG_APP,DBG_COND_1, ("%s: not found\n", name));
-                rc = 0;
-            }
-            DISP_RC2(rc, name, "while calling KMetadataOpenNodeRead");
-        }
-
-        if (rc == 0 && parent) {
-            uint32_t count = 0, i = 0;
-            KNamelist* names = NULL;
-            rc = KMDataNodeListChild(parent, &names);
-            DISP_RC2(rc, name, "while calling KMDataNodeListChild");
-            if (rc == 0) {
-                rc = KNamelistCount(names, &count);
-                DISP_RC2(rc, name, "while calling KNamelistCount");
-                if (rc == 0) {
-                    stats->spotGroupN = count;
-                    stats->spotGroup = calloc(count, sizeof *stats->spotGroup);
-                    if (stats->spotGroup == NULL) {
-                        rc = RC(rcExe,
-                            rcStorage, rcAllocating, rcMemory, rcExhausted);
-                    }
-                }
-            }
-
-            for (i = 0; i < count && rc == 0; ++i) {
-                const KMDataNode* node = NULL;
-                const char* child = NULL;
-                rc = KNamelistGet(names, i, &child);
-                if (rc != 0) {
-                    PLOGERR(klogInt, (klogInt, rc,
-                        "while calling STATS/SPOT_GROUP::KNamelistGet($(idx))",
-                        "idx=%i", i));
-                }
-                else {
-                    rc = KMDataNodeOpenNodeRead(parent, &node, child);
-                    DISP_RC2(rc, child, "while calling KMDataNodeOpenNodeRead");
-                }
-                if (rc == 0) {
-                    rc = readStatsMetaNodes
-                        (node, child, &stats->spotGroup[i], quick);
-                }
-                RELEASE(KMDataNode, node);
-            }
-            RELEASE(KNamelist, names);
-        }
-        RELEASE(KMDataNode, parent);
-    }
-
-    if (rc == 0) {
-        uint32_t i = 0;
-        bool found = stats->table.found;
-        for (i = 0; i < stats->spotGroupN && found; ++i)
-        {   found = stats->spotGroup[i].found; }
-        stats->found = found;
-    }
-
-    return rc;
-}
-
-static
-void srastatmeta_print(const MetaDataStats* meta, srastat_parms *pb)
-{
-    uint32_t i = 0;
-    assert(pb && meta);
-
-    if (meta->spotGroupN) {
-        for (i = 0; i < meta->spotGroupN; ++i) {
-            const SraStatsMeta* ss = &meta->spotGroup[i];
-            if (!pb->skip_members) {
-                const char* spot_group = "";
-                if (strcmp("default", ss->spot_group) != 0)
-                {   spot_group = ss->spot_group; }
-                if ((spot_group == NULL || spot_group[0] == '\0')
-                    && meta->spotGroupN > 1)
-                {
-                    /* skip an empty "extra" 'default' spot_group */
-                    if (ss->BASE_COUNT == 0     && ss->BIO_BASE_COUNT == 0 &&
-                        ss->CMP_BASE_COUNT == 0 && ss->spot_count == 0)
-                    {   continue; }
-                }
-                if (pb->xml) {
-                    if (pb->hasSPOT_GROUP) {
-                       OUTMSG(("  <Member member_name=\"%s\"", ss->spot_group));
-                       OUTMSG((" spot_count=\"%ld\" base_count=\"%ld\"",
-                            ss->spot_count, ss->BASE_COUNT));
-                       OUTMSG((" base_count_bio=\"%ld\"", ss->BIO_BASE_COUNT));
-                       if (ss->CMP_BASE_COUNT > 0) {
-                           OUTMSG((" cmp_base_count=\"%ld\"",
-                               ss->CMP_BASE_COUNT));
-                       }
-                       BAM_HEADER_RG_print_xml(&ss->BAM_HEADER);
-                       OUTMSG(("/>\n"));
-                    }
-                }
-                else {
-                    OUTMSG(("%s|%s|%ld:%ld:%ld|:|:|:\n",
-                        pb->table_path, spot_group, ss->spot_count,
-                        ss->BASE_COUNT, ss->BIO_BASE_COUNT));
-                }
-            }
-            pb->total.spot_count += ss->spot_count;
-            pb->total.BASE_COUNT += ss->BASE_COUNT;
-            pb->total.BIO_BASE_COUNT += ss->BIO_BASE_COUNT;
-            pb->total.total_cmp_len += ss->CMP_BASE_COUNT;
-        }
-    }
-    else {
-        if (!pb->xml && !(pb->quick && pb->skip_members)) {
-                const char* spot_group = "";
-                OUTMSG(("%s|%s|%ld:%ld:%ld|:|:|:\n",
-                        pb->table_path, spot_group, meta->table.spot_count,
-                        meta->table.BASE_COUNT, meta->table.BIO_BASE_COUNT));
-        }
-        pb->total.spot_count = meta->table.spot_count;
-        pb->total.BASE_COUNT = meta->table.BASE_COUNT;
-        pb->total.BIO_BASE_COUNT = meta->table.BIO_BASE_COUNT;
-        pb->total.total_cmp_len = meta->table.CMP_BASE_COUNT;
-    }
-}
-
-static
-void CC srastat_print( BSTNode* n, void* data )
-{
-    srastat_parms *pb = (srastat_parms*) data;
-    const SraStats *ss = (const SraStats*) n;
-    assert(pb && ss);
-    if (!pb->skip_members) {
-        if (pb->xml) {
-            if (pb->hasSPOT_GROUP) {
-                OUTMSG(("  <Member member_name=\"%s\"", ss->spot_group));
-                OUTMSG((" spot_count=\"%ld\" base_count=\"%ld\"", ss->spot_count, ss->total_len));
-                OUTMSG((" base_count_bio=\"%ld\"", ss->bio_len));
-                OUTMSG((" spot_count_mates=\"%ld\" base_count_bio_mates=\"%ld\"", ss->spot_count_mates, ss->bio_len_mates));
-                OUTMSG((" spot_count_bad=\"%ld\" base_count_bio_bad=\"%ld\"", ss->bad_spot_count, ss->bad_bio_len));
-                OUTMSG((" spot_count_filtered=\"%ld\" base_count_bio_filtered=\"%ld\"",
-                    ss->filtered_spot_count, ss->filtered_bio_len));
-                if (ss->total_cmp_len > 0)
-                {   OUTMSG((" cmp_base_count=\"%ld\"", ss->total_cmp_len)); }
-                BAM_HEADER_RG_print_xml(&ss->BAM_HEADER);
-                OUTMSG(("/>\n"));
-            }
-        }
-        else {
-            OUTMSG(("%s|%s|%ld:%ld:%ld|%ld:%ld|%ld:%ld|%ld:%ld\n",
-                pb->table_path,ss->spot_group,ss->spot_count,ss->total_len,ss->bio_len,ss->spot_count_mates,ss->bio_len_mates,
-                ss->bad_spot_count,ss->bad_bio_len,ss->filtered_spot_count,ss->filtered_bio_len));
-        }
-    }
-    pb->total.spot_count += ss->spot_count;
-    pb->total.spot_count_mates += ss->spot_count_mates;
-    pb->total.BIO_BASE_COUNT += ss->bio_len;
-    pb->total.bio_len_mates += ss->bio_len_mates;
-    pb->total.BASE_COUNT += ss->total_len;
-    pb->total.bad_spot_count += ss->bad_spot_count;
-    pb->total.bad_bio_len += ss->bad_bio_len;
-    pb->total.filtered_spot_count += ss->filtered_spot_count;
-    pb->total.filtered_bio_len += ss->filtered_bio_len;
-    pb->total.total_cmp_len += ss->total_cmp_len;
-}
-
-static
-rc_t process_align_info(const char* indent, const Ctx* ctx)
-{
-    rc_t rc = 0;
-    uint32_t count = 0;
-    int i = 0;
-    const VDBDependencies* dep = NULL;
-
-    assert(indent && ctx);
-
-    if (ctx->db == NULL) {
-        return rc;
-    }
-
-    rc = VDatabaseListDependencies(ctx->db, &dep, false);
-    DISP_RC2(rc, ctx->pb->table_path,
-        "while calling VDatabaseListDependencies");
-
-    rc = VDBDependenciesCount(dep, &count);
-    if (rc) {
-        DISP_RC(rc, "while calling VDBDependenciesCount");
-        return rc;
-    }
-
-
-    OUTMSG(("%s<AlignInfo>\n", indent));
-
-    for (i = 0; i < count && rc == 0; ++i) {
-        bool circular = false;
-        const char* name = NULL;
-        const char* path = NULL;
-        bool local = false;
-        const char* seqId = NULL;
-
-        rc = VDBDependenciesCircular(dep, &circular, i);
-        if (rc != 0) {
-            DISP_RC(rc, "while calling VDBDependenciesCircular");
-            break;
-        }
-        rc = VDBDependenciesName(dep, &name, i);
-        if (rc != 0) {
-            DISP_RC(rc, "while calling VDBDependenciesName");
-            break;
-        }
-        rc = VDBDependenciesPath(dep, &path, i);
-        if (rc != 0) {
-            DISP_RC(rc, "while calling VDBDependenciesPath");
-            break;
-        }
-        rc = VDBDependenciesLocal(dep, &local, i);
-        if (rc != 0) {
-            DISP_RC(rc, "while calling VDBDependenciesLocal");
-            break;
-        }
-        rc = VDBDependenciesSeqId(dep, &seqId, i);
-        if (rc != 0) {
-            DISP_RC(rc, "while calling VDBDependenciesSeqId");
-            break;
-        }
-
-        OUTMSG((
-            "%s  <Ref seqId=\"%s\" name=\"%s\" circular=\"%s\" local=\"%s\"",
-            indent, seqId, name, (circular ? "true" : "false"),
-            (local ? "local" : "remote")));
-        if (path && path[0]) {
-            OUTMSG((" path=\"%s\"", path));
-        }
-        OUTMSG(("/>\n"));
-    }
-
-    OUTMSG(("%s</AlignInfo>\n", indent));
-
-    RELEASE(VDBDependencies, dep);
-
-    return rc;
-}
-
-static
-rc_t print_results(const Ctx* ctx)
-{
-    rc_t rc = 0;
-    bool mismatch = false;
-
-    assert(ctx && ctx->pb
-        && ctx->tr && ctx->sizes && ctx->info && ctx->meta && ctx->total);
-
-    if (ctx->pb->quick) {
-        if ( ! ctx->meta -> found )
-            LOGMSG(klogWarn, "Statistics metadata not found");
-        else
-        {
-            ctx->pb->hasSPOT_GROUP = ctx->meta->spotGroupN > 1 ||
-                (ctx->meta->spotGroupN == 1
-                 && strcmp("default", ctx->meta->spotGroup[0].spot_group) != 0);
-        }
-    }
-
-    if (ctx->meta->found && ! ctx->pb->quick) {
-        bool mismatch = false;
-        SraStats* ss = (SraStats*)BSTreeFind(ctx->tr, "", srastats_cmp);
-        const SraStatsMeta* m = &ctx->meta->table;
-        if (ctx->total->BASE_COUNT != m->BASE_COUNT
-            || ctx->total->BIO_BASE_COUNT != m->BIO_BASE_COUNT
-            || ctx->total->spot_count != m->spot_count
-            || ctx->total->total_cmp_len != m->CMP_BASE_COUNT)
-        { mismatch = true; }
-        if (ss != NULL) {
-            const SraStatsMeta* m = &ctx->meta->table;
-            uint32_t i = 0;
-            for (i = 0; i < ctx->meta->spotGroupN && !mismatch; ++i) {
-                const char* spot_group = "";
-                m = &ctx->meta->spotGroup[i];
-                assert(m);
-                if (strcmp("default", m->spot_group) != 0)
-                {   spot_group = m->spot_group; }
-                ss = (SraStats*)BSTreeFind(ctx->tr, spot_group, srastats_cmp);
-                if (ss == NULL) {
-                    mismatch = true;
-                    break;
-                }
-                if (ss->total_len != m->BASE_COUNT
-                    || ss->bio_len != m->BIO_BASE_COUNT
-                    || ss->spot_count != m->spot_count
-                    || ss->total_cmp_len != m->CMP_BASE_COUNT)
-                {
-                    mismatch = true;
-                    break;
-                }
-            }
-        }
-    }
-
-    if (ctx->pb->xml) {
-        OUTMSG(("<Run accession=\"%s\"", ctx->pb->table_path));
-        if (!ctx->pb->quick || ! ctx->meta->found) {
-            OUTMSG((" read_length=\"%s\"",
-                ctx->pb->variableReadLength ? "variable" : "fixed"));
-        }
-        if (ctx->pb->quick) {
-            OUTMSG((" spot_count=\"%ld\" base_count=\"%ld\"",
-                ctx->meta->table.spot_count, ctx->meta->table.BASE_COUNT));
-            OUTMSG((" base_count_bio=\"%ld\"",
-                ctx->meta->table.BIO_BASE_COUNT));
-            if (ctx->meta->table.CMP_BASE_COUNT > 0) {
-                OUTMSG((" cmp_base_count=\"%ld\"",
-                    ctx->meta->table.CMP_BASE_COUNT));
-            }
-        }
-        else {
-            OUTMSG((" spot_count=\"%ld\" base_count=\"%ld\"",
-                ctx->total->spot_count, ctx->total->BASE_COUNT));
-            OUTMSG((" base_count_bio=\"%ld\"", ctx->total->BIO_BASE_COUNT));
-            OUTMSG((" spot_count_mates=\"%ld\" base_count_bio_mates=\"%ld\"",
-                ctx->total->spot_count_mates, ctx->total->bio_len_mates));
-            OUTMSG((" spot_count_bad=\"%ld\" base_count_bio_bad=\"%ld\"",
-                ctx->total->bad_spot_count, ctx->total->bad_bio_len));
-            OUTMSG((
-                " spot_count_filtered=\"%ld\" base_count_bio_filtered=\"%ld\"",
-                ctx->total->filtered_spot_count, ctx->total->filtered_bio_len));
-            if (ctx->total->total_cmp_len > 0) {
-                OUTMSG((" cmp_base_count=\"%ld\"", ctx->total->total_cmp_len));
-            }
-        }
-        OUTMSG((">\n"));
-    }
-    else if (ctx->pb->skip_members) {
-        if (ctx->pb->quick) {
-            OUTMSG(("%s||%ld:%ld:%ld|:|:|:\n",
-                ctx->pb->table_path, ctx->meta->table.spot_count,
-                ctx->meta->table.BASE_COUNT, ctx->meta->table.BIO_BASE_COUNT));
-        }
-        else {
-            OUTMSG(("%s||%ld:%ld:%ld|%ld:%ld|%ld:%ld|%ld:%ld\n",
-                ctx->pb->table_path,
-                ctx->total->spot_count, ctx->total->BASE_COUNT,
-                ctx->total->BIO_BASE_COUNT,
-                ctx->total->spot_count_mates, ctx->total->bio_len_mates,
-                ctx->total->bad_spot_count, ctx->total->bad_bio_len,
-                ctx->total->filtered_spot_count, ctx->total->filtered_bio_len));
-        }
-    }
-
-    if (ctx->pb->quick && ctx->meta->found) {
-        memset(&ctx->pb->total, 0, sizeof ctx->pb->total);
-        rc = parse_bam_header(ctx->db, meta_RG_callback, ctx->meta);
-        srastatmeta_print(ctx->meta, ctx->pb);
-        if (ctx->pb->total.spot_count != ctx->meta->table.spot_count ||
-            ctx->pb->total.BIO_BASE_COUNT != ctx->meta->table.BIO_BASE_COUNT ||
-            ctx->pb->total.BASE_COUNT != ctx->meta->table.BASE_COUNT ||
-            ctx->pb->total.total_cmp_len != ctx->meta->table.CMP_BASE_COUNT)
-        {
-            rc = RC(rcExe, rcData, rcValidating, rcData, rcUnequal);
-        }
-        assert(rc == 0);
-    }
-    else {
-        memset(&ctx->pb->total, 0, sizeof ctx->pb->total);
-        rc = parse_bam_header(ctx->db, tree_RG_callback, ctx->tr);
-        BSTreeForEach(ctx->tr, false, srastat_print, ctx->pb);
-        if (ctx->meta->found) {
-            const SraStatsMeta* m = &ctx->meta->table;
-            if (ctx->pb->total.BASE_COUNT != m->BASE_COUNT
-                || ctx->pb->total.BIO_BASE_COUNT != m->BIO_BASE_COUNT
-                || ctx->pb->total.spot_count != m->spot_count
-                || ctx->pb->total.total_cmp_len != m->CMP_BASE_COUNT)
-            {
-                mismatch = true;
-            }
-        }
-        if (ctx->pb->total.spot_count != ctx->total->spot_count ||
-            ctx->pb->total.spot_count_mates != ctx->total->spot_count_mates ||
-            ctx->pb->total.BIO_BASE_COUNT != ctx->total->BIO_BASE_COUNT ||
-            ctx->pb->total.bio_len_mates != ctx->total->bio_len_mates ||
-            ctx->pb->total.BASE_COUNT != ctx->total->BASE_COUNT ||
-            ctx->pb->total.bad_spot_count != ctx->total->bad_spot_count ||
-            ctx->pb->total.bad_bio_len != ctx->total->bad_bio_len ||
-            ctx->pb->total.filtered_spot_count
-                != ctx->total->filtered_spot_count ||
-            ctx->pb->total.filtered_bio_len != ctx->total->filtered_bio_len ||
-            ctx->pb->total.total_cmp_len != ctx->total->total_cmp_len)
-        {
-            rc = RC(rcExe, rcData, rcValidating, rcData, rcUnequal);
-        }
-        assert(rc == 0);
-    }
-
-    if (ctx->pb->xml) {
-        if (ctx->sizes) {
-            OUTMSG(("  <Size value=\"%lu\" units=\"bytes\"/>\n",
-                ctx->sizes->size));
-        }
-        if (ctx->pb->printMeta && ctx->info->tblVersion >= 0) {
-            OUTMSG(("  <Table vers=\"%d\">\n    <Meta vers=\"%d\">\n",
-                ctx->info->tblVersion, ctx->info->metaVersion));
-            if (ctx->info->formatter.name[0] || ctx->info->formatter.vers[0] ||
-                ctx->info->loader.date[0] || ctx->info->loader.name[0] ||
-                ctx->info->loader.vers[0])
-            {
-                OUTMSG(("      <SOFTWARE>\n"));
-                if (ctx->info->formatter.name[0] ||
-                    ctx->info->formatter.vers[0])
-                {
-                    OUTMSG(("        <formatter"));
-                    if (ctx->info->formatter.name[0])
-                    {   OUTMSG((" name=\"%s\"", ctx->info->formatter.name)); }
-                    if (ctx->info->formatter.vers[0])
-                    {   OUTMSG((" vers=\"%s\"", ctx->info->formatter.vers)); }
-                    OUTMSG(("/>\n"));
-                }
-                if (ctx->info->loader.date[0] || ctx->info->loader.name[0] ||
-                    ctx->info->loader.vers[0])
-                {
-                    OUTMSG(("        <loader"));
-                    if (ctx->info->loader.date[0])
-                    {   OUTMSG((" date=\"%s\"", ctx->info->loader.date)); }
-                    if (ctx->info->loader.name[0])
-                    {   OUTMSG((" name=\"%s\"", ctx->info->loader.name)); }
-                    if (ctx->info->loader.vers[0])
-                    {   OUTMSG((" vers=\"%s\"", ctx->info->loader.vers)); }
-                    OUTMSG(("/>\n"));
-                }
-                OUTMSG(("      </SOFTWARE>\n"));
-            }
-            if (ctx->info->loadTimestamp) {
-                char       buf[80];
-                struct tm* ts = localtime(&ctx->info->loadTimestamp);
-                strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", ts);
-                OUTMSG(("      <LOAD timestamp=\"%lX\">%s</LOAD>\n",
-                    ctx->info->loadTimestamp, buf));
-            }
-            OUTMSG(("    </Meta>\n  </Table>\n"));
-        }
-        if (rc == 0 && !ctx->pb->quick) {
-            BasesPrint(&ctx->total->bases_count, ctx->total->BASE_COUNT, "  ");
-        }
-        if (rc == 0 && !ctx->pb->skip_alignment) {
-            rc = process_align_info("  ", ctx);
-        }
-        if (rc == 0 && ctx->pb->statistics) {
-            rc = SraStatsTotalPrintStatistics(ctx->total, "  ", ctx->pb->test);
-        }
-        if (rc == 0 && ctx->pb->print_arcinfo) {
-            const ArcInfo* a = ctx->arc_info;
-            uint32_t i;
-            char b[1024];
-            time_t ts = a->timestamp;
-            struct tm* tm = localtime(&ts);
-
-            if( tm == NULL ) {
-                rc = RC(rcExe, rcData, rcReading, rcParam, rcInvalid);
-            }
-            else {
-                size_t k = strftime(b, sizeof(b), "%Y-%m-%dT%H:%M:%S", tm);
-                OUTMSG(("  <Archive timestamp=\"%.*s\"", k, b));
-                for(i = 0; i < sizeof(a->i) / sizeof(a->i[0]); i++) {
-                    OUTMSG((" size.%s=\"%lu\" md5.%s=\"%s\"",
-                        a->i[i].tag, a->i[i].size, a->i[i].tag, a->i[i].md5));
-                }
-                OUTMSG((" />\n"));
-            }
-        }
-        if (rc == 0)
-        {   rc = QualityStatsPrint(&ctx->quality, "  "); }
-        if (rc == 0)
-        {   rc = TableCountsPrint(&ctx->tables, "  "); }
-        OUTMSG(("</Run>\n"));
-    }
-    if (mismatch && ctx->pb->start == 0 && ctx->pb->stop == 0) {
-        /* check mismatch just when no --start, --stop specified */
-        LOGMSG(klogWarn,
-            "Mismatch between calculated and recorded statistics");
-    }
-    return rc;
-}
-
-static
-void CC bst_whack_free ( BSTNode *n, void *ignore )
-{
-    SraStats* ss = (SraStats*)n;
-    BAM_HEADER_RG_free(&ss->BAM_HEADER);
-    free(ss);
-}
-
-static 
-int CC srastats_sort ( const BSTNode *item, const BSTNode *n )
-{
-    const SraStats *ss = ( const SraStats* ) item;
-    return srastats_cmp(ss->spot_group,n);
-}
-
-static
-rc_t sra_stat(srastat_parms* pb, const SRATable* tbl,
-    BSTree* tr, SraStatsTotal* total)
-{
-    rc_t rc = 0;
-
-/*  const char CMP_READ  [] = "CMP_READ"; */
-    const char PRIMARY_ALIGNMENT_ID[] = "PRIMARY_ALIGNMENT_ID";
-    const char RD_FILTER [] = "RD_FILTER";
-    const char READ_LEN  [] = "READ_LEN";
-    const char READ_TYPE [] = "READ_TYPE";
-    const char SPOT_GROUP[] = "SPOT_GROUP";
-
-/*  const SRAColumn* cCMP_READ = NULL; */
-    const SRAColumn* cPRIMARY_ALIGNMENT_ID = NULL;
-    const SRAColumn* cRD_FILTER = NULL;
-    const SRAColumn* cREAD_LEN = NULL;
-    const SRAColumn* cREAD_TYPE = NULL;
-    const SRAColumn* cSPOT_GROUP = NULL;
-
-    int g_nreads = 0;
-    spotid_t n_spots = 0;
-    spotid_t start = pb->start, stop = pb->stop;
-
-    /* filled with dREAD_LEN[i] for (spotid == start);
-       used to check fixedReadLength */
-    uint64_t g_totalREAD_LEN[MAX_NREADS];
-    uint64_t g_nonZeroLenReads[MAX_NREADS];
-    memset(g_totalREAD_LEN, 0, sizeof g_totalREAD_LEN);
-    memset(g_nonZeroLenReads, 0, sizeof g_nonZeroLenReads);
-
-    assert(pb && tbl && tr && total);
-
-    if (rc == 0) {
-        const char* name = READ_LEN;
-        rc = SRATableOpenColumnRead(tbl, &cREAD_LEN, name, vdb_uint32_t);
-        DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-    }
-    if (rc == 0) {
-        const char* name = READ_TYPE;
-        rc = SRATableOpenColumnRead(tbl, &cREAD_TYPE, name, sra_read_type_t);
-        DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-    }
-
-    if (rc == 0) {
-        {
-            const char* name = SPOT_GROUP;
-            rc = SRATableOpenColumnRead(tbl, &cSPOT_GROUP, name, vdb_ascii_t);
-            if (GetRCState(rc) == rcNotFound)
-            {   rc = 0; }
-            DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-        }
-        if (rc == 0) {
-            if (rc == 0) {
-                const char* name = RD_FILTER;
-                rc = SRATableOpenColumnRead
-                    (tbl, &cRD_FILTER, name, sra_read_filter_t);
-                if (GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-                DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-            }
-/*          if (rc == 0) {
-                const char* name = CMP_READ;
-                rc = SRATableOpenColumnRead
-                    (tbl, &cCMP_READ, name, "INSDC:dna:text");
-                if (GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-                DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-            } */
-            if (rc == 0) {
-                const char* name = PRIMARY_ALIGNMENT_ID;
-                rc = SRATableOpenColumnRead
-                    (tbl, &cPRIMARY_ALIGNMENT_ID, name, "I64");
-                if (GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-                DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-            }
-            if (rc == 0) {
-                spotid_t spotid;
-                pb->hasSPOT_GROUP = 0;
-                rc = SRATableMaxSpotId(tbl, &spotid);
-                DISP_RC(rc, "failed to read max spot id");
-                if (rc == 0) {
-                    BasesInit(&total->bases_count, tbl);
-                }
-                if (rc == 0) {
-                    bool bad_read_filter = false;
-                    bool fixedNReads = true;
-                    bool fixedReadLength = true;
-
-                    uint32_t g_dREAD_LEN[MAX_NREADS];
-
-                    memset(g_dREAD_LEN, 0, sizeof g_dREAD_LEN);
-
-                    if (start == 0)
-                    {   start = 1; }
-                    if (stop == 0 || pb -> stop > spotid)
-                    {   stop = spotid; }
-
-                    for (spotid = start; spotid <= stop && rc == 0;
-                        ++spotid)
-                    {
-                        SraStats* ss;
-                        uint32_t dREAD_LEN  [MAX_NREADS];
-                        uint8_t  dREAD_TYPE [MAX_NREADS];
-                        uint8_t  dRD_FILTER [MAX_NREADS];
-                        char     dSPOT_GROUP[MAX_NREADS] = "NULL";
-
-                        const void* base;
-                        bitsz_t boff, row_bits;
-                        int nreads;
-
-                        rc = Quitting();
-                        if (rc)
-                        {   LOGMSG(klogWarn, "Interrupted"); }
-
-                        if (rc == 0) {
-                            rc = SRAColumnRead(cREAD_LEN, spotid, &base, &boff, &row_bits);
-                            DISP_RC_Read(rc, READ_LEN, spotid, "while calling SRAColumnRead");
-                        }
-                        if (rc == 0) {
-                            if (boff & 7)
-                            {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                            if (row_bits & 7)
-                            {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                            if ((row_bits >> 3) > sizeof(dREAD_LEN))
-                            {   rc = RC(rcExe, rcColumn, rcReading, rcBuffer, rcInsufficient); }
-                            DISP_RC_Read(rc, READ_LEN, spotid, "after calling SRAColumnRead");
-                        }
-                        if (rc == 0) {
-                            int i, bio_len, bio_count, bad_cnt, filt_cnt;
-                            memcpy(dREAD_LEN, ((const char*)base) + (boff>>3), row_bits>>3);
-                            nreads = (row_bits >> 3) / sizeof(*dREAD_LEN);
-                            if (spotid == start) {
-                                g_nreads = nreads;
-                                if (pb->statistics) {
-                                    rc = SraStatsTotalMakeStatistics
-                                        (total, g_nreads);
-                                }
-                            }
-                            else if (g_nreads != nreads) {
-                                fixedNReads = false;
-                            }
-
-                            if (rc == 0) {
-                                rc = SRAColumnRead(cREAD_TYPE, spotid, &base, &boff, &row_bits);
-                                DISP_RC_Read(rc, READ_TYPE, spotid, "while calling SRAColumnRead");
-                                if (rc == 0) {
-                                    if (boff & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                                    if (row_bits & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                                    if ((row_bits >> 3) > sizeof(dREAD_TYPE))
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcBuffer, rcInsufficient); }
-                                    if ((row_bits >> 3) !=  nreads)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcData, rcIncorrect); }
-                                    DISP_RC_Read(rc, READ_TYPE, spotid, "after calling SRAColumnRead");
-                                }
-                            }
-                            if (rc == 0) {
-                                memcpy(dREAD_TYPE, ((const char*)base) + (boff >> 3), row_bits >> 3);
-                                if (cSPOT_GROUP) {
-                                    rc = SRAColumnRead(cSPOT_GROUP, spotid, &base, &boff, &row_bits);
-                                    DISP_RC_Read(rc, SPOT_GROUP, spotid, "while calling SRAColumnRead");
-                                    if (rc == 0) {
-                                        if (row_bits > 0) {
-                                            if (boff & 7)
-                                            {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                                            if (row_bits & 7)
-                                            {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                                            if ((row_bits >> 3) > sizeof(dSPOT_GROUP))
-                                            {   rc = RC(rcExe, rcColumn, rcReading, rcBuffer, rcInsufficient); }
-                                            DISP_RC_Read(rc, SPOT_GROUP, spotid, "after calling SRAColumnRead");
-                                            if (rc == 0) {
-                                                int n = row_bits >> 3;
-                                                memcpy(dSPOT_GROUP,((const char*)base) + (boff>>3),row_bits>>3);
-                                                dSPOT_GROUP[n]='\0';
-                                                if (n > 1 ||
-                                                    (n == 1 && dSPOT_GROUP[0]))
-                                                {   pb -> hasSPOT_GROUP = 1; }
-                                            }
-                                        }
-                                        else {  dSPOT_GROUP[0]='\0'; }
-                                    } else { break; }
-                                }
-                            }
-                            if (rc == 0) {
-                                uint64_t cmp_len = 0; /* CMP_READ */
-                                if (cRD_FILTER) {
-                                    rc = SRAColumnRead(cRD_FILTER, spotid, &base, &boff, &row_bits);
-                                    DISP_RC_Read(rc, RD_FILTER, spotid, "while calling SRAColumnRead");
-                                    if (rc == 0) {
-                                        int size = row_bits >> 3;
-                                        if (boff & 7)
-                                        {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                                        if (row_bits & 7)
-                                        {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                                        if (size > sizeof dRD_FILTER)
-                                        {   rc = RC(rcExe, rcColumn, rcReading, rcBuffer, rcInsufficient); }
-                                        DISP_RC_Read(rc, RD_FILTER, spotid, "after calling SRAColumnRead");
-                                        if (rc == 0) {
-                                            memcpy(dRD_FILTER,((const char*)base) + (boff>>3), size);
-                                            if (size < nreads) {
-                                                /* RD_FILTER is expected to have nreads elements */
-                                                if (size == 1) {
-                                                    /* fill all RD_FILTER elements with RD_FILTER[0] */
-                                                    int i = 0;
-                                                    for (i = 1; i < nreads; ++i) {
-                                                        memcpy(dRD_FILTER + i,
-                                                            ((const char*)base) + (boff>>3), 1);
-                                                    }
-                                                    if (!bad_read_filter) {
-                                                        bad_read_filter = true;
-                                                        PLOGMSG(klogWarn, (klogWarn, "RD_FILTER column"
-                                                            " size is 1 but it is expected to be $(n)",
-                                                            "n=%d", nreads));
-                                                    }
-                                                }
-                                                else { /* something really bad with RD_FILTER column:
-                                                          let's pretend it does not exist */
-                                                    cRD_FILTER = NULL;
-                                                    bad_read_filter = true;
-                                                    PLOGMSG(klogWarn, (klogWarn, "RD_FILTER column size"
-                                                        " is $(real) but it is expected to be $(exp)",
-                                                        "real=%d,exp=%d", size, nreads));
-                                                }
-                                            }
-                                        }
-                                    } else { break; }
-                                }
-
-                                if (cPRIMARY_ALIGNMENT_ID) {
-                                    rc = SRAColumnRead(cPRIMARY_ALIGNMENT_ID, spotid, &base, &boff, &row_bits);
-                                    DISP_RC_Read(rc, PRIMARY_ALIGNMENT_ID, spotid, "while calling SRAColumnRead");
-                                    if (boff & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                                    if (row_bits & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                                    DISP_RC_Read(rc, PRIMARY_ALIGNMENT_ID, spotid, "after calling calling SRAColumnRead");
-                                    if (rc == 0) {
-                                        int i = 0;
-                                        const int64_t* pii = base;
-                                        assert(nreads);
-                                        for (i = 0; i < nreads; ++i) {
-                                            if (pii[i] == 0) {
-                                                cmp_len += dREAD_LEN[i];
-                                            }
-                                        }
-                                    }
-                                }
-/*                              if (cCMP_READ) {
-                                    rc = SRAColumnRead(cCMP_READ, spotid, &base, &boff, &row_bits);
-                                    DISP_RC_Read(rc, CMP_READ, spotid, "while calling SRAColumnRead");
-                                    if (boff & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcOffset, rcInvalid); }
-                                    if (row_bits & 7)
-                                    {   rc = RC(rcExe, rcColumn, rcReading, rcSize, rcInvalid); }
-                                    DISP_RC_Read(rc, CMP_READ, spotid, "after calling calling SRAColumnRead");
-                                    if (rc == 0)
-                                    {   assert(cmp_len == row_bits >> 3); }
-                                } */
-
-                                ss = (SraStats*)BSTreeFind(tr, dSPOT_GROUP, srastats_cmp);
-                                if (ss == NULL) {
-                                    ss = calloc(1, sizeof(*ss));
-                                    if (ss == NULL) {
-                                        rc = RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                                        break;
-                                    }
-                                    else {
-                                        strcpy(ss->spot_group, dSPOT_GROUP);
-                                        BSTreeInsert(tr, (BSTNode*)ss, srastats_sort);
-                                    }
-                                }
-                                ++ss->spot_count;
-                                ++total->spot_count;
-
-                                ss->total_cmp_len += cmp_len;
-                                total->total_cmp_len += cmp_len;
-
-                                BasesAdd(&total->bases_count, spotid);
-
-                                if (pb->statistics) {
-                                    SraStatsTotalAdd(total, dREAD_LEN, nreads);
-                                }
-                                for (bio_len = bio_count = i = bad_cnt = filt_cnt = 0; (i < nreads) && (rc == 0); i++) {
-                                    if (dREAD_LEN[i] > 0) {
-                                        g_totalREAD_LEN[i] += dREAD_LEN[i];
-                                        ++g_nonZeroLenReads[i];
-                                    }
-                                    if (spotid == start) {
-                                        g_dREAD_LEN[i] = dREAD_LEN[i];
-                                    }
-                                    else if (g_dREAD_LEN[i] != dREAD_LEN[i])
-                                    {   fixedReadLength = false; }
-
-                                    if (dREAD_LEN[i] > 0) {
-                                        bool biological = false;
-                                        ss->total_len += dREAD_LEN[i];
-                                        total->BASE_COUNT += dREAD_LEN[i];
-                                        if ((dREAD_TYPE[i] & SRA_READ_TYPE_BIOLOGICAL) != 0) {
-                                            biological = true;
-                                            bio_len += dREAD_LEN[i];
-                                            bio_count++;
-                                        }
-                                        if (cRD_FILTER) {
-                                            switch (dRD_FILTER[i]) {
-                                                case SRA_READ_FILTER_PASS:
-                                                    break;
-                                                case SRA_READ_FILTER_REJECT:
-                                                case SRA_READ_FILTER_CRITERIA:
-                                                    if (biological) {
-                                                        ss->bad_bio_len += dREAD_LEN[i];
-                                                        total->bad_bio_len += dREAD_LEN[i];
-                                                    }
-                                                    bad_cnt++;
-                                                    break;
-                                                case SRA_READ_FILTER_REDACTED:
-                                                    if (biological) {
-                                                        ss->filtered_bio_len += dREAD_LEN[i];
-                                                        total->filtered_bio_len += dREAD_LEN[i];
-                                                    }
-                                                    filt_cnt++;
-                                                    break;
-                                                default:
-                                                    rc = RC(rcExe, rcColumn, rcReading, rcData, rcUnexpected);
-                                                    PLOGERR(klogInt, (klogInt, rc,
-                                                        "spot=$(spot), read=$(read), READ_FILTER=$(val)", "spot=%lu,read=%d,val=%d",
-                                                        spotid, i, dRD_FILTER[i]));
-                                                    break;
-                                            }
-                                        }
-                                    }
-                                }
-                                ss->bio_len += bio_len;
-                                total->BIO_BASE_COUNT += bio_len;
-                                if (bio_count > 1) {
-                                    ++ss->spot_count_mates;
-                                    ++total->spot_count_mates;
-                                    ss->bio_len_mates += bio_len;
-                                    total->bio_len_mates += bio_len;
-                                }
-                                if (bad_cnt) {
-                                    ss->bad_spot_count++;
-                                    total->bad_spot_count++;
-                                }
-                                if (filt_cnt) {
-                                    ss->filtered_spot_count++;
-                                    total->filtered_spot_count++;
-                                }
-                            }
-                        }
-                    } /* for (spotid = start; spotid <= stop && rc == 0; ++spotid) */
-
-                    if (rc == 0) {
-                        BasesFinalize(&total->bases_count);
-                        pb->variableReadLength = !fixedReadLength;
-
-                        /* --- g_totalREAD_LEN[i] is sum(READ_LEN[i]) for all spots --- */
-                        if (fixedNReads) {
-                            int i = 0;
-                            if (stop >= start) {
-                                n_spots = stop - start + 1;
-                            }
-                            if (n_spots > 0) {
-                                for (i = 0; i < g_nreads && rc == 0; ++i) {
-                                    if (fixedReadLength) {
-                                        assert(g_totalREAD_LEN[i] / n_spots
-                                            == g_dREAD_LEN[i]);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                RELEASE(SRAColumn, cSPOT_GROUP);
-            }
-        }
-    }
-
-    RELEASE(SRAColumn, cPRIMARY_ALIGNMENT_ID);
-    RELEASE(SRAColumn, cRD_FILTER);
-    RELEASE(SRAColumn, cREAD_TYPE);
-    RELEASE(SRAColumn, cREAD_LEN);
-
-    if (pb->test) {
-        int i = 0;
-        spotid_t spotid = 0;
-        double average[MAX_NREADS];
-        double diff_sq[MAX_NREADS];
-        SraStatsTotalStatistics2Init(total,
-            g_nreads, g_totalREAD_LEN, g_nonZeroLenReads);
-        memset(diff_sq, 0, sizeof diff_sq);
-        for (i = 0; i < g_nreads; ++i) {
-            average[i] = (double)g_totalREAD_LEN[i] / n_spots;
-        }
-        if (rc == 0) {
-            const char* name = READ_LEN;
-            rc = SRATableOpenColumnRead(tbl, &cREAD_LEN, name, vdb_uint32_t);
-            DISP_RC2(rc, name, "while calling SRATableOpenColumnRead");
-        }
-        for (spotid = start; spotid <= stop && rc == 0; ++spotid) {
-            uint32_t dREAD_LEN[MAX_NREADS];
-            const void* base;
-            bitsz_t boff, row_bits;
-            if (rc == 0) {
-                rc = SRAColumnRead(cREAD_LEN, spotid, &base, &boff, &row_bits);
-                DISP_RC_Read(rc, READ_LEN, spotid,
-                    "while calling SRAColumnRead");
-            }
-            if (rc == 0) {
-                memcpy(dREAD_LEN, ((const char*)base) + (boff>>3), row_bits>>3);
-            }
-            for (i = 0; i < g_nreads; ++i) {
-                diff_sq[i] +=
-                    (dREAD_LEN[i] - average[i]) * (dREAD_LEN[i] - average[i]);
-            }
-            SraStatsTotalAdd2(total, dREAD_LEN);
-        }
-        RELEASE(SRAColumn, cREAD_LEN);
-    }
-
-    return rc;
-}
-
-static
-void CtxRelease(Ctx* ctx)
-{
-    assert(ctx);
-
-    QualityStatsRelease(&ctx->quality);
-    TableCountsRelease(&ctx->tables);
-
-    memset(ctx, 0, sizeof *ctx);
-}
-static
-rc_t run(srastat_parms* pb)
-{
-    rc_t rc = 0;
-    const SRAMgr* mgr = NULL;
-
-    assert(pb && pb->table_path);
-
-    rc = SRAMgrMakeRead(&mgr);
-
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "failed to open SRAMgr");
-    }
-    else {
-        SraSizeStats sizes;
-        ArcInfo arc_info;
-        SraMeta info;
-        const SRATable* tbl = NULL;
-
-        rc = SRAMgrOpenTableRead(mgr, &tbl, pb->table_path);
-        if (rc != 0) {
-            PLOGERR(klogInt, (klogInt, rc,
-                "'$(spec)'", "spec=%s", pb->table_path));
-        }
-        else {
-            MetaDataStats stats;
-            SraStatsTotal total;
-            const KTable* ktbl = NULL;
-            const KMetadata* meta = NULL;
-            const VTable* vtbl = NULL;
-            const VDatabase* db = NULL;
-
-            BSTree tr;
-            Ctx ctx;
-
-            BSTreeInit(&tr);
-            memset(&ctx, 0, sizeof ctx);
-
-            memset(&total, 0, sizeof total);
-
-            rc = SRATableGetKTableRead(tbl, &ktbl);
-            DISP_RC(rc, "While calling SRATableGetKTableRead");
-            if (rc == 0) {
-                rc = KTableOpenMetadataRead(ktbl, &meta);
-                DISP_RC(rc, "While calling KTableOpenMetadataRead");
-            }
-            if (rc == 0) {
-                rc = SRATableGetVTableRead(tbl, &vtbl);
-                DISP_RC2(rc, pb->table_path,
-                    "while calling SRATableGetVTableRead");
-            }
-            if (rc == 0) {
-                rc = VTableOpenParentRead(vtbl, &db);
-                DISP_RC2(rc, pb->table_path,
-                    "while calling VTableOpenParentRead");
-            }
-            if (rc == 0) {
-                rc = get_stats_meta(meta, &stats, pb->quick);
-                if (rc == 0) {
-                    if (pb->quick && !stats.found) {
-                        LOGMSG(klogWarn, "Statistics metadata not found: "
-                            "performing full table scan");
-                        pb->quick = false;
-                    }
-                }
-                rc = 0;
-            }
-            if (rc == 0)
-            {   rc = get_size(tbl, &sizes); }
-            if (rc == 0 && pb->printMeta)
-            {   rc = get_load_info(meta, &info); }
-            if (rc == 0 && !pb->quick)
-            {   rc = sra_stat(pb, tbl, &tr, &total); }
-            if (rc == 0 && pb->print_arcinfo ) {
-                rc = get_arc_info(mgr, pb->table_path, tbl, &arc_info);
-            }
-            if (rc == 0) {
-                rc = QualityStatsRead(&ctx.quality, meta);
-                if (rc == 0)
-                {   QualityStatsSort(&ctx.quality); }
-            }
-            if (rc == 0) {
-                rc = TableCountsRead(&ctx.tables, db);
-                if (rc == 0)
-                {   TableCountsSort(&ctx.tables); }
-            }
-            if (rc == 0) {
-                ctx.db = db;
-                ctx.info = &info;
-                ctx.meta = &stats;
-                ctx.pb = pb;
-                ctx.sizes = &sizes;
-                ctx.total = &total;
-                ctx.arc_info = &arc_info;
-                ctx.tr = &tr;
-                rc = print_results(&ctx);
-            }
-            BSTreeWhack(&tr, bst_whack_free, NULL);
-            SraStatsTotalFree(&total);
-            RELEASE(VDatabase, db);
-            RELEASE(VTable, vtbl);
-            RELEASE(KTable, ktbl);
-            {
-                int i; 
-                for (i = 0; i < stats.spotGroupN; ++i) {
-                    SraStatsMetaDestroy(&stats.spotGroup[i]);
-                }
-
-                SraStatsMetaDestroy(&stats.table);
-
-                free(stats.spotGroup);
-                stats.spotGroup = NULL;
-            }
-            CtxRelease(&ctx);
-            RELEASE(KMetadata, meta);
-        }
-        RELEASE(SRATable, tbl);
-    }
-
-    RELEASE(SRAMgr, mgr);
-
-    return rc;
-}
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return SRA_STAT_VERS;
-}
-
-
-/* Usage
- */
-#define OPTION_ALIGN "alignment"
-#define OPTION_SPT_D "spot-desc"
-#define OPTION_MEMBR "member-stats"
-#define OPTION_META  "meta"
-#define OPTION_QUICK "quick"
-#define OPTION_START "start"
-#define OPTION_STATS "statistics"
-#define OPTION_STOP  "stop"
-#define OPTION_TEST  "test"
-#define OPTION_XML   "xml"
-#define OPTION_ARCINFO "archive-info"
-
-#define ALIAS_ALIGN "a"
-#define ALIAS_SPT_D "d"
-#define ALIAS_MEMBR NULL
-#define ALIAS_META  "m"
-#define ALIAS_QUICK "q"
-#define ALIAS_START "b"
-#define ALIAS_STATS "s"
-#define ALIAS_STOP  "e"
-#define ALIAS_TEST  "t"
-#define ALIAS_XML   "x"
-#define ALIAS_ARCINFO NULL
-
-static const char * align_usage[] = { "print alignment info, default is on", NULL };
-static const char * spt_d_usage[] = { "print table spot descriptor", NULL };
-static const char * membr_usage[] = { "print member stats, default is on", NULL };
-static const char * meta_usage[] = { "print load metadata", NULL };
-static const char * start_usage[] = { "starting spot id, default is 1", NULL };
-static const char * stop_usage[] = { "ending spot id, default is max", NULL };
-static const char * stats_usage[] = { "calculate READ_LEN average and standard deviation", NULL };
-static const char * quick_usage[] = { "quick mode: get statistics from metadata;", "do not scan the table", NULL };
-static const char * test_usage[] = { "test READ_LEN average and standard deviation calculation", NULL };
-static const char * xml_usage[] = { "output as XML, default is text", NULL };
-static const char * arcinfo_usage[] = { "output archive info, default is off", NULL };
-
-OptDef Options[] =
-{
-      { OPTION_ALIGN, ALIAS_ALIGN, NULL, align_usage, 1, true , false }
-    , { OPTION_SPT_D, ALIAS_SPT_D, NULL, spt_d_usage, 1, false, false }
-    , { OPTION_MEMBR, ALIAS_MEMBR, NULL, membr_usage, 1, true , false }
-    , { OPTION_ARCINFO, ALIAS_ARCINFO, NULL, arcinfo_usage, 0, false, false }
-    , { OPTION_META,  ALIAS_META,  NULL, meta_usage,  1, false, false }
-    , { OPTION_QUICK, ALIAS_QUICK, NULL, quick_usage, 1, false, false }
-    , { OPTION_START, ALIAS_START, NULL, start_usage, 1, true,  false }
-    , { OPTION_STATS, ALIAS_STATS, NULL, stats_usage, 1, false, false }
-    , { OPTION_STOP,  ALIAS_STOP,  NULL, stop_usage,  1, true,  false }
-    , { OPTION_TEST , ALIAS_TEST , NULL, test_usage,  1, false, false }
-    , { OPTION_XML,   ALIAS_XML,   NULL, xml_usage,   1, false, false }
-};
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s [options] table\n"
-        "\n"
-        "Summary:\n"
-        "  Display table statistics\n"
-        "\n", progname);
-}
-
-const char UsageDefaultName[] = "sra-stat";
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionLine (ALIAS_XML, OPTION_XML, NULL, xml_usage);
-    HelpOptionLine (ALIAS_START, OPTION_START, "row-id", start_usage);
-    HelpOptionLine (ALIAS_STOP, OPTION_STOP, "row-id", stop_usage);
-    HelpOptionLine (ALIAS_META, OPTION_META, NULL, meta_usage);
-    HelpOptionLine (ALIAS_QUICK, OPTION_QUICK, NULL, quick_usage);
-    HelpOptionLine (ALIAS_MEMBR, OPTION_MEMBR, "on | off", membr_usage);
-    HelpOptionLine (ALIAS_ARCINFO, OPTION_ARCINFO, NULL, arcinfo_usage);
-    HelpOptionLine (ALIAS_STATS, OPTION_STATS, NULL, stats_usage);
-    HelpOptionLine (ALIAS_ALIGN, OPTION_ALIGN, "on | off", align_usage);
-    KOutMsg ("\n");
-    HelpOptionsStandard ();
-    HelpVersion (fullpath, KAppVersion());
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args* args = NULL;
-    rc_t rc = 0;
-
-    srastat_parms pb;
-    memset(&pb, 0, sizeof pb);
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 1,
-        Options, sizeof Options / sizeof (OptDef));
-    if (rc == 0)
-    {
-        do
-        {
-            uint32_t pcount;
-            const char* pc;
-
-            rc = ArgsOptionCount (args, OPTION_START, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                rc = ArgsOptionValue (args, OPTION_START, 0, &pc);
-                if (rc)
-                    break;
-
-                pb.start = AsciiToU32 (pc, NULL, NULL);
-            }
-
-            rc = ArgsOptionCount (args, OPTION_STOP, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 1)
-            {
-                rc = ArgsOptionValue (args, OPTION_STOP, 0, &pc);
-                if (rc)
-                    break;
-
-                pb.stop = AsciiToU32 (pc, NULL, NULL);
-            }
-
-            rc = ArgsOptionCount (args, OPTION_XML, &pcount);
-            if (rc)
-                break;
-
-            if (pcount)
-                pb.xml = true;
-
-            rc = ArgsOptionCount (args, OPTION_QUICK, &pcount);
-            if (rc)
-                break;
-
-            if (pcount)
-                pb.quick = true;
-
-            rc = ArgsOptionCount (args, OPTION_META, &pcount);
-            if (rc)
-                break;
-
-            if (pcount)
-                pb.printMeta = true;
-
-            rc = ArgsOptionCount (args, OPTION_MEMBR, &pcount);
-            if (rc)
-                break;
-
-            if (pcount) {
-                const char* v = NULL;
-                rc = ArgsOptionValue (args, OPTION_MEMBR, 0, &v);
-                if (rc)
-                    break;
-                if (!strcmp(v, "off")) {
-                    pb.skip_members = true;
-                }
-            }
-
-            rc = ArgsOptionCount (args, OPTION_ARCINFO, &pcount);
-            if (rc)
-                break;
-
-            pb.print_arcinfo = pcount > 0;
-
-            rc = ArgsOptionCount (args, OPTION_ALIGN, &pcount);
-            if (rc)
-                break;
-
-            if (pcount) {
-                const char* v = NULL;
-                rc = ArgsOptionValue (args, OPTION_ALIGN, 0, &v);
-                if (rc)
-                    break;
-                if (!strcmp(v, "off")) {
-                    pb.skip_alignment = true;
-                }
-            }
-
-            rc = ArgsOptionCount (args, OPTION_STATS, &pcount);
-            if (rc)
-                break;
-
-            if (pcount)
-                pb.statistics = true;
-
-            rc = ArgsOptionCount (args, OPTION_TEST, &pcount);
-            if (rc)
-                break;
-
-            if (pcount)
-                pb.test = pb.statistics = true;
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 0) {
-                MiniUsage (args);
-                exit(1);
-            }
-
-            rc = ArgsParamValue (args, 0, &pb.table_path);
-            if (rc)
-                break;
-
-            if (pb.statistics && (pb.quick || ! pb.xml)) {
-                KOutMsg("\n--" OPTION_STATS
-                    " option can be used just in XML NON-QUICK mode\n");
-                MiniUsage (args);
-                exit(1);
-            }
-        } while (0);
-    }
-
-    if (rc == 0)
-    {   rc = run(&pb); }
-    else {  DISP_RC(rc, "while processing command line"); }
-
-    {
-        rc_t rc2 = ArgsWhack(args);
-        if (rc == 0)
-        {   rc = rc2; }
-    }
-
-    return rc;
-}
-
-/* EOF */
diff --git a/tools/sra-stat/sra-stat.vers b/tools/sra-stat/sra-stat.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/sra-stat/sra-stat.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/srapath/Makefile b/tools/srapath/Makefile
deleted file mode 100644
index 2e346aa..0000000
--- a/tools/srapath/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/srapath
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	srapath
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# srapath
-#  vdb table copy tool
-#
-SRAPATH_SRC = \
-	srapath
-
-SRAPATH_OBJ = \
-	$(addsuffix .$(OBJX),$(SRAPATH_SRC))
-
-SRAPATH_LIB += \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/srapath: $(SRAPATH_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(SRAPATH_LIB)
diff --git a/tools/srapath/srapath.c b/tools/srapath/srapath.c
deleted file mode 100644
index ba1e2d2..0000000
--- a/tools/srapath/srapath.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "srapath.vers.h"
-
-#include <vfs/resolver.h>
-#include <vfs/path.h>
-#include <vfs/manager.h>
-#include <kfs/directory.h>
-#include <kfs/defs.h>
-#include <kfg/config.h>
-#include <sra/impl.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/text.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h> /* STSMSG */
-#include <klib/rc.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include <limits.h> /* PATH_MAX */
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return SRAPATH_VERS;
-}
-
-const char UsageDefaultName[] = "srapath";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return OUTMSG(("\n"
-        "Usage:\n"
-        "  %s [options] <accession> ...\n\n"
-        "Summary:\n"
-        "  Tool to produce a list of full paths to files\n"
-        "  (SRA and WGS runs, refseqs: reference sequences)\n"
-        "  from list of NCBI accessions.\n"
-        "\n", progname));
-}
-
-rc_t CC Usage(const Args *args) {
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL) {
-        rc = RC (rcExe, rcArgv, rcAccessing, rcSelf, rcNull);
-    }
-    else {
-        rc = ArgsProgram(args, &fullpath, &progname);
-    }
-
-    if (rc != 0) {
-        progname = fullpath = UsageDefaultName;
-    }
-
-    UsageSummary(progname);
-
-    OUTMSG((
-        "  Output paths are ordered according to accession list.\n"
-        "\n"
-        "  The accession search path will be determined according to the\n"
-        "  configuration. It will attempt to find files in local and site\n"
-        "  repositories, and will also check remote repositories for run\n"
-        "  location.\n"));
-    OUTMSG((
-        "  This tool produces a path that is 'likely' to be a run, in that\n"
-        "  an entry exists in the file system at the location predicted.\n"
-        "  It is possible that this path will fail to produce success upon\n"
-        "  opening a run if the path does not point to a valid object.\n\n"));
-
-    OUTMSG(("Options:\n"));
-
-    HelpOptionsStandard();
-
-    HelpVersion(fullpath, KAppVersion());
-
-    return rc;
-}
-
-/* KMain
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 0);
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse arguments");
-    else do
-    {
-        uint32_t acount;
-        rc = ArgsParamCount (args, &acount);
-        if (rc)
-        {
-            LOGERR (klogInt, rc, "failed to count parameters");
-            break;
-        }
-
-        if (acount == 0)
-        {
-            rc = MiniUsage (args);
-            break;
-        }
-        else
-        {
-            VFSManager* mgr;
-            rc = VFSManagerMake(&mgr);
-            if (rc)
-                LOGERR ( klogErr, rc, "failed to create VFSManager object" );
-            else
-            {
-                VResolver * resolver;
-
-                rc = VFSManagerGetResolver (mgr, &resolver);
-                if (rc == 0)
-                {
-                    uint32_t ix;
-                    for ( ix = 0; ix < acount; ++ ix )
-                    {
-                        const char * pc;
-                        rc = ArgsParamValue (args, ix, &pc );
-                        if (rc)
-                            LOGERR (klogInt, rc,
-                                    "failed to retrieve parameter value");
-                        else
-                        {
-                            const VPath * upath;
-                            rc = VFSManagerMakePath ( mgr, (VPath**)&upath, pc);
-                            if (rc == 0)
-                            {
-                                const VPath * local;
-                                const VPath * remote;
-
-                                rc = VResolverQuery (resolver, eProtocolHttp, upath, &local, &remote, NULL);
-
-                                if (rc == 0)
-                                {
-                                    const String * s;
-
-                                    if (local != NULL)
-                                        rc = VPathMakeString (local, &s);
-                                    else 
-                                        rc = VPathMakeString (remote, &s);
-                                    if (rc == 0)
-                                    {
-                                        OUTMSG (("%S\n", s));
-                                        free ((void*)s);
-                                    }
-                                    VPathRelease (local);
-                                    VPathRelease (remote);
-                                }
-                                else
-                                {
-                                    KDirectory * cwd;
-                                    rc_t orc = VFSManagerGetCWD (mgr, &cwd);
-                                    if (orc == 0)
-                                    {
-                                        KPathType kpt
-                                            = KDirectoryPathType(cwd, "%s", pc);
-                                        switch (kpt &= ~kptAlias)
-                                        {
-                                        case kptNotFound:
-                                            STSMSG(1, ("'%s': not found while "
-                                                "searching the file system",
-                                                pc));
-                                            break;
-                                        case kptBadPath:
-                                            STSMSG(1, ("'%s': bad path while "
-                                                "searching the file system",
-                                                pc));
-                                            break;
-                                        default:
-                                            STSMSG(1, ("'%s': "
-                                                "found in the file system",
-                                                pc));
-                                            rc = 0;
-                                            break;
-                                        }
-                                    }
-                                    if (orc == 0 && rc == 0) {
-                                    if (rc != 0) {
-                                        PLOGMSG(klogErr, (klogErr,
-                                            "'$(name)': not found",
-                                            "name=%s", pc));
-                                    }
-                                    else {
-                                        char resolved[PATH_MAX] = "";
-                                        rc = KDirectoryResolvePath(cwd, true,
-                                            resolved, sizeof resolved, pc);
-                                        if (rc == 0) {
-                                            STSMSG(1, ("'%s': found in "
-                                                "the current directory at '%s'",
-                                                pc, resolved));
-                                            OUTMSG (("%s\n", resolved));
-                                        }
-                                        else {
-                                            STSMSG(1, ("'%s': cannot resolve "
-                                                "in the current directory",
-                                                pc));
-                                            OUTMSG (("./%s\n", pc));
-                                        }
-                                    }
-                                    }
-                                    KDirectoryRelease(cwd);
-                                }
-                            }
-                        }
-                    }
-                    VResolverRelease (resolver);
-                }
-                VFSManagerRelease(mgr);
-            }
-        }
-        ArgsWhack (args);
-
-    } while (0);
-
-    return rc;
-}
diff --git a/tools/srapath/srapath.vers b/tools/srapath/srapath.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/srapath/srapath.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/Makefile b/tools/util/Makefile
deleted file mode 100644
index af77fbf..0000000
--- a/tools/util/Makefile
+++ /dev/null
@@ -1,209 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/util
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	rcexplain \
-	kdbmeta \
-	vdb-lock \
-	vdb-unlock \
-	test-sra \
-	vdb-passwd
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-        $(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# rcexplain - explain a return code observed in debugger
-#
-RCEXPLAIN_SRC = \
-	rcexplain
-
-RCEXPLAIN_OBJ = \
-	$(addsuffix .$(OBJX),$(RCEXPLAIN_SRC))
-
-RCEXPLAIN_LIB = \
-	-skapp \
-	-svfs \
-	-skurl \
-	-skrypto \
-	-skfg \
-	-skfs \
-	-sksproc \
-	-sklib
-
-$(BINDIR)/rcexplain: $(RCEXPLAIN_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(RCEXPLAIN_LIB)
-
-
-#-------------------------------------------------------------------------------
-# kdbmeta - query and update metadata files
-#
-KDBMETA_SRC = \
-	kdbmeta
-
-KDBMETA_OBJ = \
-	$(addsuffix .$(OBJX),$(KDBMETA_SRC))
-
-KDBMETA_LIB = \
-	-skapp \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/kdbmeta: $(KDBMETA_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(KDBMETA_LIB)
-
-
-#-------------------------------------------------------------------------------
-# vdb-lock
-#  lock a vdb object
-#
-VDB_LOCK_SRC = \
-	vdb-lock
-
-VDB_LOCK_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_LOCK_SRC))
-
-VDB_LOCK_LIB = \
-	-skapp \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/vdb-lock: $(VDB_LOCK_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_LOCK_LIB)
-
-
-#-------------------------------------------------------------------------------
-# vdb-unlock
-#  unlock a vdb object
-#
-VDB_UNLOCK_SRC = \
-	vdb-unlock
-
-VDB_UNLOCK_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_UNLOCK_SRC))
-
-VDB_UNLOCK_LIB = \
-	-skapp \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/vdb-unlock: $(VDB_UNLOCK_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_UNLOCK_LIB)
-
-#-------------------------------------------------------------------------------
-# test-sra: print config, resolve sra, check dependencies
-#
-
-T_SRC = \
-	test-sra
-
-T_OBJ = \
-	$(addsuffix .$(OBJX),$(T_SRC))
-
-T_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/test-sra: $(T_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(T_LIB)
-
-#----------------------------------------------------------------
-# vdb-passwd
-#
-VDB_PASSWD_SRC = \
-	vdb-passwd \
-	syspass
-
-VDB_PASSWD_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_PASSWD_SRC))
-
-VDB_PASSWD_LIB = \
-	-skapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-sksproc \
-	-lklib
-
-$(BINDIR)/vdb-passwd: $(VDB_PASSWD_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_PASSWD_LIB)
diff --git a/tools/util/kdbmeta.c b/tools/util/kdbmeta.c
deleted file mode 100644
index c760d98..0000000
--- a/tools/util/kdbmeta.c
+++ /dev/null
@@ -1,1269 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-/*
- * This program has a command line sytax that isn't suited to the 
- * normally expected way of handling command line arguments.
- *
- * We'll use the normal Args processing for the standard options
- * but a simple stepping throught the argv stored arguments
- * for the "big loop"
- */
-
-
-/* The original intention of this tool was to support updating nodes.
-   This was later removed with the thought that this functionality would
-   be better implemented by another tool.
-
-   Going to temporarily add it in...
-*/
-#define ALLOW_UPDATE 1
-
-#include "kdbmeta.vers.h"
-
-#include <sra/srapath.h>
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/column.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/vector.h>
-#include <klib/namelist.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/writer.h>
-#include <klib/rc.h>
-#include <sysalloc.h>
-#include <os-native.h>
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-/* use cpp define CONST */
-#undef CONST
-#if ALLOW_UPDATE
-#define CONST
-#else
-#define CONST const
-#endif
-
-typedef struct KDBMetaParms KDBMetaParms;
-struct KDBMetaParms
-{
-    CONST KDBManager *mgr;
-    CONST KMetadata *md;
-    const char *targ;
-    const Vector *q;
-    rc_t rc;
-};
-
-/* select reporting
- */
-static bool xml_ish = true;
-static int indent_lvl;
-static int tabsz = 2;
-static const char *spaces = "                                ";
-static bool as_unsigned = false;
-static const char *table_arg = NULL;
-static bool read_only_arg = true;
-
-static
-void indent ( void )
-{
-    if ( indent_lvl > 0 )
-    {
-        int total, num_spaces = indent_lvl * tabsz;
-        for ( total = 0; total < num_spaces; total += 32 )
-        {
-            int to_write = num_spaces - total;
-            if ( to_write > 32 )
-                to_write = 32;
-            OUTMSG (( & spaces [ 32 - to_write ] ));
-        }
-    }
-}
-
-static
-void node_open ( const char *path, size_t plen )
-{
-    if ( plen && path[plen - 1] == '/' ) {
-    /* do not use trailing slash */
-        --plen;
-    }
-    if ( xml_ish )
-    {
-        int size = plen;
-        /* find leaf name of node */
-        const char *slash = string_rchr ( path, plen, '/' );
-        if ( slash ) {
-            /* make sure not to print trailing slash */
-            size = plen - (slash - path) - 1;
-            if ( size < 0 ) {
-                size = 0;
-            }
-        }
-
-        indent ();
-        OUTMSG (( "<%.*s", size, ( slash != NULL ) ? slash + 1 : path ));
-    }
-}
-
-static
-void node_close ( const char *path, size_t plen,
-    size_t vsize, uint32_t num_children, bool close_indent )
-{
-    if ( plen && path[plen - 1] == '/' ) {
-        --plen;
-    }
-    if ( xml_ish )
-    {
-        if ( vsize == 0 && num_children == 0 )
-            OUTMSG (( "/>\n" ));
-        else
-        {
-            int size = plen;
-            const char *slash = string_rchr ( path, plen, '/' );
-            if ( slash ) {
-                size = plen - (slash - path) - 1;
-                if ( size < 0 ) {
-                    size = 0;
-                }
-            }
-            if ( close_indent )
-                indent ();
-            OUTMSG (( "</%.*s>\n", size, ( slash != NULL ) ? slash + 1 : path ));
-        }
-    }
-}
-
-static
-void attr_select ( const char *name, const char *value )
-{
-    if ( xml_ish )
-        OUTMSG (( " %s=\"%s\"", name, value ));
-}
-
-static
-void value_select ( const char *value, size_t vlen, uint32_t num_children, bool *close_indent )
-{
-    if ( xml_ish )
-    {
-        size_t i;
-        bool binary = false;
-
-        /* discover if text or apparently binary */
-        for ( i = 0; i < vlen && ! binary; ++ i )
-        {
-            if ( ! isprint ( value [ i ] ) )
-            {
-                switch ( value [ i ] )
-                {
-                case '\t':
-                case '\r':
-                case '\n':
-                    break;
-                default:
-                    binary = true;
-                }
-            }
-        }
-
-        /* if there are children, create special tag */
-        if ( num_children != 0 || ( binary && vlen > 16 ) || ( vlen > 64 ) )
-        {
-            OUTMSG (( ">\n" ));
-            ++ indent_lvl;
-            indent ();
-            if ( num_children != 0 )
-                OUTMSG (( "<%%>" ));
-        }
-        else
-        {
-            OUTMSG (( ">" ));
-        }
-
-        /* if binary, print as hex */
-        if ( binary )
-        {
-            bool as_hex = !as_unsigned;
-            if( as_unsigned ) {
-                switch(vlen) {
-                    case 1:
-                        OUTMSG (( "%hu", ( ( const uint8_t* ) value ) [ 0 ] ));
-                        break;
-                    case 2:
-                        OUTMSG (( "%u", ( ( const uint16_t* ) value ) [ 0 ] ));
-                        break;
-                    case 4:
-                        OUTMSG (( "%u", ( ( const uint32_t* ) value ) [ 0 ] ));
-                        break;
-                    case 8:
-                        OUTMSG (( "%lu", ( ( const uint64_t* ) value ) [ 0 ] ));
-                        break;
-                    default:
-                        as_hex = true;
-                        break;
-                }
-            }
-            if( as_hex ) {
-                for ( i = 0; i < vlen; ++ i )
-                {
-                    if ( i != 0 && ( i & 15 ) == 0 )
-                    {
-                        OUTMSG (( "\n" ));
-                        indent ();
-                    }
-                    OUTMSG (( "\\x%02X", ( ( const uint8_t* ) value ) [ i ] ));
-                }
-            }
-        }
-
-        /* text */
-        else
-        {
-            int tab_stop;
-
-            OUTMSG (( "'" ));
-            for ( tab_stop = 0, i = 0; i < vlen; ++ i )
-            {
-                switch ( value [ i ] )
-                {
-                case '\t': /* OUTMSG (( "%.*s", 4 - ( tab_stop & 3 ), "    " )); */
-                    /* tab_stop = ( tab_stop + 4 ) & -4; */
-                    OUTMSG (( "\t" ));
-                    break;
-                case '\r': OUTMSG (( "\\r" ));
-                    break;
-                case '\n': OUTMSG (( "\n" ));
-                    indent ();
-                    if ( i + 1 < vlen )
-                        OUTMSG (( " " ));
-                    tab_stop = 0;
-                    break;
-                default:
-                    OUTMSG (( "%c", value [ i ] ));
-                }
-            }
-            OUTMSG (( "'" ));
-        }
-
-        /* if there are children, close special tag */
-        if ( num_children != 0 )
-        {
-            OUTMSG (( "</%%>\n" ));
-            -- indent_lvl;
-            * close_indent = true;
-        }
-        else if ( ( binary && vlen > 16 ) || ( vlen > 64 ) )
-        {
-            OUTMSG (( "\n" ));
-            -- indent_lvl;
-            * close_indent = true;
-        }
-    }
-}
-
-static
-void children_begin ( size_t vsize, uint32_t num_children )
-{
-    ++ indent_lvl;
-
-    if ( vsize == 0 && num_children != 0 )
-        OUTMSG (( ">\n" ));
-}
-
-static
-void children_end ( void )
-{
-    if ( indent_lvl > 0 )
-        -- indent_lvl;
-}
-
-
-/* select
- */
-static
-rc_t md_select_expr ( const KMDataNode *node, char *path, size_t psize, int plen, const char *attr, bool wildcard )
-{
-    rc_t rc;
-    const char *name;
-    uint32_t i, num_children;
-    KNamelist *children;
-    bool close_indent = false;
-
-    size_t vsize = 0;
-    char value [ 1024 ];
-
-    /* list node children */
-    rc = KMDataNodeListChild ( node, & children );
-    if ( rc == 0 )
-        rc = KNamelistCount ( children, & num_children );
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogErr,  (klogErr, rc, "failed to list child nodes of '$(path)'", "path=%s", path ));
-        return rc;
-    }
-
-    /* report on single node */
-    if ( ! wildcard )
-    {
-        if ( attr != NULL )
-        {
-            /* report only attribute */
-            rc = KMDataNodeReadAttr ( node, attr, value, sizeof value, & vsize );
-            if ( rc != 0 )
-            {
-                KNamelistRelease ( children );
-                if ( GetRCState ( rc ) == rcNotFound )
-                    return 0;
-
-                PLOGERR ( klogErr,  (klogErr, rc, "failed to read attribute '$(path)@$(attr)'", "path=%s,attr=%s", path, attr ));
-                return rc;
-            }
-
-            /* open node report */
-            node_open ( path, plen );
-
-            /* report attribute */
-            attr_select ( attr, value );
-
-            /* close it off */
-            node_close ( path, plen, 0, 0, false );
-
-            /* Exit here if an attribute was requested in query */
-            return 0;
-        }
-        else
-        {
-            uint32_t count;
-            size_t remaining;
-            char *vp = value;
-            KNamelist *attrs;
-
-            /* report entire node */
-            rc = KMDataNodeListAttr ( node, & attrs );
-            if ( rc == 0 )
-                rc = KNamelistCount ( attrs, & count );
-            if ( rc != 0 )
-            {
-                KNamelistRelease ( children );
-                PLOGERR ( klogErr,  (klogErr, rc, "failed to list attributes of '$(path)'", "path=%s", path ));
-                return rc;
-            }
-
-            /* open node report */
-            node_open ( path, plen );
-
-            /* report each attribute */
-            for ( i = 0; i < count; ++ i )
-            {
-                rc = KNamelistGet ( attrs, i, & name );
-                if ( rc != 0 )
-                    PLOGERR ( klogWarn,  (klogWarn, rc, "failed to read attribute name $(idx) of '$(path)'", "idx=%u,path=%s", i, path ));
-                else
-                {
-                    rc = KMDataNodeReadAttr ( node, name, value, sizeof value, & vsize );
-                    if ( rc != 0 )
-                    {
-                        KNamelistRelease ( children );
-                        KNamelistRelease ( attrs );
-                        PLOGERR ( klogErr,  (klogErr, rc, "failed to read attribute '$(path)@$(attr)'", "path=%s,attr=%s", path, name ));
-                        return rc;
-                    }
-
-                    /* report attribute */
-                    attr_select ( name, value );
-                }
-            }
-
-            /* done with header */
-            KNamelistRelease ( attrs );
-
-            /* read node value */
-            rc = KMDataNodeRead ( node, 0, value, sizeof value, & vsize, & remaining );
-            if ( rc != 0 )
-            {
-                KNamelistRelease ( children );
-                PLOGERR ( klogErr,  (klogErr, rc, "failed to read value of '$(path)'", "path=%s", path ));
-                return rc;
-            }
-
-            /* allocate a larger buffer if not complete */
-            if ( remaining != 0 )
-            {
-                size_t remaining_vsize;
-
-                vp = malloc ( vsize + remaining );
-                if ( vp == NULL )
-                {
-                    KNamelistRelease ( children );
-                    rc = RC ( rcExe, rcMetadata, rcAllocating, rcMemory, rcExhausted );
-                    PLOGERR ( klogInt,  (klogInt, rc, "failed to read value of '$(path)'", "path=%s", path ));
-                    return rc;
-                }
-                memcpy ( vp, value, vsize );
-                rc = KMDataNodeRead ( node, vsize, & vp [ vsize ], remaining, & remaining_vsize, & remaining );
-                if ( rc == 0 && remaining != 0 )
-                    rc = RC ( rcExe, rcMetadata, rcReading, rcTransfer, rcIncomplete );
-                if ( rc != 0 )
-                {
-                    free ( vp );
-                    KNamelistRelease ( children );
-                    PLOGERR ( klogErr,  (klogErr, rc, "failed to read value of '$(path)'", "path=%s", path ));
-                    return rc;
-                }
-
-                vsize += remaining_vsize;
-            }
-
-            /* report node value */
-            if ( vsize != 0 )
-                value_select ( vp, vsize, num_children, & close_indent );
-
-            /* whack allocation */
-            if ( vp != value )
-                free ( vp );
-        }
-    }
-
-    if ( ! wildcard )
-        children_begin ( vsize, num_children );
-
-    /* if there are children, list them now */
-    for ( i = 0; i < num_children; ++ i )
-    {
-        rc = KNamelistGet ( children, i, & name );
-        if ( rc != 0 )
-            PLOGERR ( klogWarn,  (klogWarn, rc, "failed to read child name $(idx) of '$(path)'", "idx=%u,path=%.*s", i, plen, path ));
-        else
-        {
-            size_t childlen;
-            rc = string_printf ( & path [ plen ], psize - plen, & childlen, "/%s", name );
-            if ( rc != 0 )
-                PLOGERR ( klogWarn,  (klogWarn, rc, "failed to select child $(name) of '$(path)'", "name=%s,path=%.*s", name, plen, path ));
-            else
-            {
-                const KMDataNode *child;
-                rc = KMDataNodeOpenNodeRead ( node, & child, name );
-                if ( rc != 0 )
-                {
-                    KNamelistRelease ( children );
-                    PLOGERR ( klogErr,  (klogErr, rc, "failed to open child '$(path)'", "path=%s", path ));
-                    return rc;
-                }
-
-                /* recurse on child */
-                rc = md_select_expr ( child, path, psize, plen + childlen, attr, false );
-                close_indent = true;
-
-                KMDataNodeRelease ( child );
-
-                if ( rc != 0 )
-                {
-                    KNamelistRelease ( children );
-                    return rc;
-                }
-            }
-        }
-    }
-
-    if ( ! wildcard )
-        children_end ();
-
-    KNamelistRelease ( children );
-
-    path [ plen ] = 0;
-
-    if ( ! wildcard )
-        node_close ( path, plen, vsize, num_children, close_indent );
-
-    return 0;
-}
-
-#if ALLOW_UPDATE
-static
-rc_t md_update_expr ( KMDataNode *node, const char *path, const char *attr, const char *expr )
-{
-    rc_t rc;
-
-    /* according to documentation, "expr" is allowed to be text
-       or text with escaped hex sequences. examine for escaped hex */
-    size_t len = string_size ( expr );
-    char *buff = malloc ( len + 1 );
-    if ( buff == NULL )
-        rc = RC ( rcExe, rcMetadata, rcUpdating, rcMemory, rcExhausted );
-    else
-    {
-        size_t i, j;
-        for ( i = j = 0; i < len; ++ i, ++ j )
-        {
-            if ( ( buff [ j ] = expr [ i ] ) == '\\' )
-            {
-                /* we know "expr" is NUL-terminated, so this is safe */
-                if ( tolower ( expr [ i + 1 ] ) == 'x' &&
-                     isxdigit ( expr [ i + 2 ] ) &&
-                     isxdigit ( expr [ i + 3 ] ) )
-                {
-                    int msn = toupper ( expr [ i + 2 ] ) - '0';
-                    int lsn = toupper ( expr [ i + 3 ] ) - '0';
-                    if ( msn >= 10 )
-                        msn += '0' - 'A' + 10;
-                    if ( lsn >= 10 )
-                        lsn += '0' - 'A' + 10;
-                    buff [ j ] = ( char ) ( ( msn << 4 ) | lsn );
-                    i += 3;
-                }
-            }
-        }
-
-        if ( attr != NULL )
-        {
-            /* set attribute value */
-            buff [ j ] = 0;
-            rc = KMDataNodeWriteAttr ( node, attr, buff );
-        }
-        else
-        {
-            /* now set the value of the node */
-            rc = KMDataNodeWrite ( node, buff, j );
-        }
-        free ( buff );
-    }
-
-    return rc;
-}
-#endif
-
-static
-bool CC md_select ( void *item, void *data )
-{
-    bool fail = true;
-    KDBMetaParms *pb = data;
-
-    CONST KMDataNode *node;
-#if ALLOW_UPDATE
-    bool read_only = true;
-    if ( ! read_only_arg ) {
-        pb -> rc = KMetadataOpenNodeUpdate ( pb -> md, & node, NULL );
-        if ( pb -> rc == 0 )
-            read_only = false;
-    }
-#endif
-    if ( read_only )
-        pb -> rc = KMetadataOpenNodeRead ( pb -> md, ( const KMDataNode** ) & node, NULL );
-    if ( pb -> rc != 0 )
-        PLOGERR ( klogErr,  (klogErr, pb -> rc, "failed to open root node for '$(path)'", "path=%s", pb -> targ ));
-    else
-    {
-        bool wildcard;
-        char *expr, *attr, path [ 4096 ];
-        size_t len = string_copy_measure ( path, sizeof path, item );
-
-        /* detect assignment */
-        expr = string_rchr ( path, len, '=' );
-        if ( expr != NULL )
-        {
-            len = expr - path;
-            * expr ++ = 0;
-        }
-        attr = string_rchr ( path, len, '@' );
-        if ( attr != NULL )
-        {
-            len = attr - path;
-            * attr ++ = 0;
-        }
-
-        if ( expr != NULL )
-        {
-#if ALLOW_UPDATE
-            if ( read_only )
-            {
-                PLOGMSG ( klogWarn, ( klogWarn, "node update expressions are not supported - "
-                                      "'$(path)' is read-only - "
-                                      "'$(expr)' treated as select."
-                                      , "path=%s,expr=%s", pb -> targ, item ) );
-                expr = NULL;
-            }
-#else
-            PLOGMSG ( klogWarn, ( klogWarn, "node update expressions are not supported - "
-                                  "'$(expr)' treated as select.", "expr=%s", item ) );
-            expr = NULL;
-#endif
-        }
-
-        wildcard = false;
-        if ( len >= 1 && path [ len - 1 ] == '*' )
-        {
-            if ( len == 1 )
-            {
-                path [ len = 0 ] = 0;
-                wildcard = true;
-            }
-            else if ( len >= 2 && path [ len - 2 ] == '/' )
-            {
-                path [ len -= 2 ] = 0;
-                wildcard = true;
-            }
-        }
-
-#if ALLOW_UPDATE
-        if ( expr != NULL )
-        {
-            KMDataNode *root = node;
-
-            if ( wildcard || len == 0 )
-            {
-                pb -> rc = RC ( rcExe, rcMetadata, rcUpdating, rcExpression, rcIncorrect );
-                PLOGERR ( klogErr, ( klogErr, pb -> rc, "node updates require explicit paths - "
-                                     "'$(expr)' cannot be evaluated", "expr=%s", item ) );
-                return true;
-            }
-
-            pb -> rc = KMDataNodeOpenNodeUpdate ( root, & node, path );
-            KMDataNodeRelease ( root );
-
-            if ( pb -> rc != 0 )
-            {
-                PLOGERR ( klogErr,  (klogErr, pb -> rc, "failed to open node '$(node) for '$(path)'",
-                                     "node=%s,path=%s", path, pb -> targ ));
-            }
-            else
-            {
-                pb -> rc = md_update_expr ( node, path, attr, expr );
-            }
-        }
-        else
-#endif
-
-        if ( len == 0 )
-            pb -> rc = md_select_expr ( node, path, sizeof path, len, attr, wildcard );
-        else
-        {
-            const KMDataNode *root = node;
-            pb -> rc = KMDataNodeOpenNodeRead ( root, ( const KMDataNode** ) & node, path );
-            KMDataNodeRelease ( root );
-
-            if ( pb -> rc != 0 )
-            {
-                PLOGERR ( klogErr,  (klogErr, pb -> rc, "failed to open node '$(node) for '$(path)'",
-                                     "node=%s,path=%s", path, pb -> targ ));
-            }
-            else
-            {
-                pb -> rc = md_select_expr ( node, path, sizeof path, len, attr, wildcard );
-            }
-        }
-
-        if ( pb -> rc == 0 )
-            fail = false;
-
-        KMDataNodeRelease ( node );
-    }
-
-    return fail;
-}
-
-static
-rc_t col_select ( KDBMetaParms * pb)
-{
-    CONST KColumn *col;
-    rc_t rc;
-
-    bool read_only = true;
-
-#if ALLOW_UPDATE
-    if ( ! read_only_arg ) {
-        read_only = false;
-
-        rc = KDBManagerOpenColumnUpdate ( pb -> mgr, & col, pb->targ );
-        if ( rc != 0 )
-            read_only = true;
-    }
-#endif
-    if ( read_only )
-        rc = KDBManagerOpenColumnRead ( pb -> mgr, ( const KColumn** ) & col, pb->targ );
-    if ( rc != 0 )
-        PLOGERR ( klogErr,  (klogErr, rc, "failed to open column '$(col)'", "col=%s", pb->targ ));
-    else
-    {
-#if ALLOW_UPDATE
-        if ( ! read_only_arg ) {
-            read_only = false;
-            rc = KColumnOpenMetadataUpdate ( col, & pb -> md );
-            if ( rc != 0 )
-                read_only = true;
-        }
-#endif
-        if ( read_only )
-            rc = KColumnOpenMetadataRead ( col, ( const KMetadata** ) & pb -> md );
-        if ( rc != 0 )
-            PLOGERR ( klogErr,  (klogErr, rc, "failed to open metadata for column '$(col)'", "col=%s", pb->targ ));
-        else
-        {
-            bool fail;
-
-            fail = VectorDoUntil ( pb -> q, false, md_select, pb );
-
-            if (fail)
-                rc = pb->rc;
-
-            KMetadataRelease ( pb -> md ), pb -> md = NULL;
-        }
-
-        KColumnRelease ( col );
-    }
-    return rc;
-}
-
-static
-rc_t tbl_select ( KDBMetaParms * pb)
-{
-    CONST KTable *tbl;
-    rc_t rc;
-
-    bool read_only = true;
-
-#if ALLOW_UPDATE
-    if ( ! read_only_arg ) {
-        read_only = false;
-
-        rc = KDBManagerOpenTableUpdate ( pb -> mgr, & tbl, pb->targ );
-        if ( rc != 0 )
-            read_only = true;
-    }
-#endif
-    if ( read_only )
-        rc = KDBManagerOpenTableRead ( pb -> mgr, ( const KTable** ) & tbl, pb->targ );
-    if ( rc != 0 )
-        PLOGERR ( klogErr,  (klogErr, rc, "failed to open table '$(tbl)'", "tbl=%s", pb->targ ));
-    else
-    {
-        read_only = true;
-#if ALLOW_UPDATE
-        if ( ! read_only_arg ) {
-            read_only = false;
-            rc = KTableOpenMetadataUpdate ( tbl, & pb -> md );
-            if ( rc != 0 )
-                read_only = true;
-        }
-#endif
-        if ( read_only )
-            rc = KTableOpenMetadataRead ( tbl, ( const KMetadata** ) & pb -> md );
-        if ( rc != 0 )
-            PLOGERR ( klogErr,  (klogErr, rc, "failed to open metadata for table '$(tbl)'", "tbl=%s", pb->targ ));
-        else
-        {
-            bool fail;
-
-            fail = VectorDoUntil ( pb -> q, false, md_select, pb );
-            if (fail)
-                rc = pb->rc;
-
-            KMetadataRelease ( pb -> md ), pb -> md = NULL;
-        }
-
-        KTableRelease ( tbl );
-    }
-
-    return rc;
-}
-
-static
-rc_t db_select (KDBMetaParms * pb)
-{
-    CONST KDatabase *db;
-    rc_t rc;
-
-    bool read_only = true;
-
-#if ALLOW_UPDATE
-    if ( ! read_only_arg ) {
-        read_only = false;
-
-        rc = KDBManagerOpenDBUpdate ( pb -> mgr, & db, pb->targ );
-        if ( rc != 0 )
-            read_only = true;
-    }
-#endif
-    if ( read_only )
-        rc = KDBManagerOpenDBRead ( pb -> mgr, ( const KDatabase** ) & db, pb->targ );
-    if ( rc != 0 ) {
-        PLOGERR ( klogErr,  (klogErr, rc, "failed to open db '$(db)'",
-            "db=%s", pb->targ ));
-    }
-    else {
-        CONST KTable* tbl = NULL;
-        if (table_arg) {
-            read_only = true;
-#if ALLOW_UPDATE
-            if ( ! read_only_arg ) {
-                read_only = false;
-                rc = KDatabaseOpenTableUpdate ( db, &tbl, table_arg );
-                if ( rc != 0 )
-                    read_only = true;
-            }
-#endif
-            if ( read_only )
-                rc = KDatabaseOpenTableRead ( db, ( const KTable** ) &tbl, table_arg );
-            if ( rc != 0 ) {
-                PLOGERR ( klogErr,  (klogErr, rc,
-                    "failed to open table '$(table)'", "table=%s", table_arg ));
-            }
-        }
-        if ( rc == 0) {
-            if (tbl) {
-                read_only = true;
-#if ALLOW_UPDATE
-                if ( ! read_only_arg ) {
-                    read_only = false;
-                    rc = KTableOpenMetadataUpdate ( tbl, & pb -> md );
-                    if ( rc != 0 )
-                        read_only = true;
-                }
-#endif
-                if ( read_only )
-                    rc = KTableOpenMetadataRead ( tbl, ( const KMetadata** ) & pb -> md );
-                if ( rc != 0 ) {
-                    PLOGERR ( klogErr,  (klogErr, rc,
-                        "failed to open metadata for table '$(table)'",
-                        "table=%s", table_arg ));
-                }
-            }
-            else {
-                read_only = true;
-#if ALLOW_UPDATE
-                if ( ! read_only_arg ) {
-                    read_only = false;
-                    rc = KDatabaseOpenMetadataUpdate ( db, & pb -> md );
-                    if ( rc != 0 )
-                        read_only = true;
-                }
-#endif
-                if ( read_only )
-                    rc = KDatabaseOpenMetadataRead ( db, ( const KMetadata** ) & pb -> md );
-                if ( rc != 0 ) {
-                    PLOGERR ( klogErr,  (klogErr, rc,
-                        "failed to open metadata for db '$(db)'",
-                        "db=%s", pb->targ ));
-                }
-            }
-            if ( rc == 0 ) {
-                bool fail;
-
-                fail = VectorDoUntil ( pb -> q, false, md_select, pb );
-                if(fail)
-                    rc = pb->rc;
-                KMetadataRelease ( pb -> md ), pb -> md = NULL;
-            }
-        }
-        KTableRelease ( tbl );
-        KDatabaseRelease ( db );
-    }
-
-    return rc;
-}
-
-static
-rc_t tool_select ( CONST KDBManager * mgr, uint32_t type, const char * targ, const Vector * q)
-{
-    KDBMetaParms pb;
-    rc_t rc;
-
-    pb.mgr = mgr;
-    pb.md = NULL;
-    pb.targ = targ;
-    pb.q = q;
-    pb.rc = 0;
-
-    switch (type)
-    {
-    default:
-        rc = RC (rcExe, rcNoTarg, rcAccessing, rcParam, rcInvalid);
-        break;
-
-    case kptDatabase:
-        rc = db_select (&pb);
-        break;
-
-    case kptPrereleaseTbl:
-    case kptTable:
-        rc = tbl_select (&pb);
-        break;
-
-    case kptColumn:
-        rc = col_select (&pb);
-        break;
-    }
-    return rc;
-}
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return KDBMETA_VERS;
-}
-    
-
-const char UsageDefaultName[] = "kdbmeta";
-
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [Options] <target> [<query> ...]\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Display the contents of one or more metadata stores.\n"
-#if ALLOW_UPDATE
-                    "  Update metadata.\n"
-#endif
-                  , progname);
-}
-
-static const char *const t1 [] = { "path-to-database", "access database metadata", NULL };
-static const char *const t2 [] = { "path-to-table",    "access table metadata", NULL };
-static const char *const t3 [] = { "path-to-column",   "access column metadata", NULL };
-static const char *const t4 [] = { "accession",        "sra global access id", NULL };
-
-static const char *const q1 [] = { "*","all nodes and attributes", NULL };
-static const char *const q2 [] = { "NAME","a named root node and children", NULL };
-static const char *const q3 [] = { "PATH/NAME","an internal node and children", NULL };
-static const char *const q4 [] = { "<node>@ATTR","a named attribute", NULL };
-#if ALLOW_UPDATE
-static const char *const q5 [] = { "<obj>=VALUE","a simple value assignment where",
-                                   "value string is text, and binary",
-                                   "values use hex escape codes", NULL };
-#endif
-
-/* static const char* o1[] = { "try to interpret binary values as unsigned ints", NULL }; */
-
-#define ALIAS_READ_ONLY             "r"
-#define OPTION_READ_ONLY            "read-only"
-static const char* USAGE_READ_ONLY[] = { "operate in read-only mode", NULL };
-
-#define ALIAS_TABLE             "T"
-#define OPTION_TABLE            "table"
-static const char* USAGE_TABLE[] = { "table-name", NULL };
-
-#define ALIAS_UNSIGNED             "u"
-#define OPTION_UNSIGNED            "unsigned"
-static const char* USAGE_UNSIGNED[]
-                                 = { "print numeric values as unsigned", NULL };
-
-const OptDef opt[] = {
-  { OPTION_TABLE    , ALIAS_TABLE    , NULL, USAGE_TABLE    , 1, true , false }
- ,{ OPTION_UNSIGNED , ALIAS_UNSIGNED , NULL, USAGE_UNSIGNED , 1, false, false }
-#if ALLOW_UPDATE
- ,{ OPTION_READ_ONLY, ALIAS_READ_ONLY, NULL, USAGE_READ_ONLY, 1, false, false }
-#endif
-};
-
-static const char * const * target_usage [] = { t1, t2, t3, t4 };
-static const char * const * query_usage []  =
-{
-    q1, q2, q3, q4
-#if ALLOW_UPDATE
-    , q5
-#endif
-};
-
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    unsigned idx;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("  The target metadata are described by one or more\n"
-             "  target specifications, giving the path to a database, a table\n"
-             "  or a column. the command and query are executed on each target.\n"
-             "\n"
-             "  queries name one or more objects, and '*' acts as a wildcard.\n"
-             "  query objects are nodes or attributes. nodes are named with a\n"
-             "  hierarchical path, like a file-system path. attributes are given\n"
-             "  as a node path followed by a '@' followed by the attribute name.\n"
-             "\n"
-             "target:\n");
-
-    for (idx = 0; idx < sizeof (target_usage) / sizeof target_usage[0]; ++idx)
-        HelpParamLine ( (target_usage[idx])[0], (target_usage[idx])+1 );
-
-    OUTMSG (("\n"
-             "query:\n"));
-
-    for (idx = 0; idx < sizeof (query_usage) / sizeof query_usage[0]; ++idx)
-        HelpParamLine ( (query_usage[idx])[0], (query_usage[idx])+1 );
-
-    OUTMSG (("\n"
-             "Options:\n"));
-
-    for(idx = 0; idx < sizeof(opt) / sizeof(opt[0]); ++idx) {
-        HelpOptionLine(opt[idx].aliases, opt[idx].name, NULL, opt[idx].help);
-    }
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args = NULL;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 1, opt, sizeof(opt) / sizeof(opt[0]));
-    if (rc == 0)
-    {
-        do 
-        {
-            const char * pc;
-            KDirectory *curwd;
-            uint32_t pcount;
-            int ix;
-
-#if ALLOW_UPDATE
-            read_only_arg = false;
-            rc = ArgsOptionCount (args, OPTION_READ_ONLY, &pcount);
-            if (rc) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" OPTION_READ_ONLY "' argument");
-                break;
-            }
-            read_only_arg = pcount > 0;
-#endif
-
-            rc = ArgsOptionCount (args, OPTION_UNSIGNED, &pcount);
-            if (rc) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" OPTION_UNSIGNED "' argument");
-                break;
-            }
-            as_unsigned = pcount > 0;
-
-            rc = ArgsOptionCount (args, OPTION_TABLE, &pcount);
-            if (rc) {
-                LOGERR(klogErr, rc,
-                    "Failure to get '" OPTION_TABLE "' argument");
-                break;
-            }
-            if (pcount) {
-                rc = ArgsOptionValue (args, OPTION_TABLE, 0, &table_arg);
-                if (rc) {
-                    LOGERR(klogErr, rc,
-                        "Failure to get '" OPTION_TABLE "' argument");
-                    break;
-                }
-            }
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 0)
-            {
-                OUTMSG (( "missing database target path and queries\n" ));
-                MiniUsage (args);
-                ArgsWhack(args);
-                exit(EXIT_FAILURE);
-            }
-
-            rc = KDirectoryNativeDir (&curwd);
-            if (rc)
-            {
-                LOGERR (klogInt, rc, "Unable to open the file system");
-            }
-            else
-            {
-                CONST KDBManager * mgr;
-#if ALLOW_UPDATE
-                rc = KDBManagerMakeUpdate (&mgr, curwd);
-#else
-                rc = KDBManagerMakeRead (&mgr, curwd);
-#endif
-                if (rc)
-                    LOGERR (klogInt, rc, "Unable to open the database system");
-                else
-                {
-                    /* get target */
-                    rc = ArgsParamValue (args, 0, &pc);
-                    if (rc)
-                        LOGERR (klogInt, rc, "Unable to read target parameter");
-                    else
-                    {
-                        char objpath [ 4096 ];
-                        bool found;
-                        uint32_t type;
-
-                        found = false;
-
-#if ! WINDOWS /* TOOLS_USE_SRAPATH != 0 */
-#warning fix kdbmanagerVPathType to understand accessions
-#if 0
-                        {
-                            SRAPath * sra_path = NULL;
-                            rc = SRAPathMake (&sra_path, NULL);
-                            if ( rc == 0 )
-                            {
-                                if ( ! SRAPathTest (sra_path, pc))
-                                {
-                                    rc = SRAPathFind (sra_path, pc, objpath, sizeof (objpath));
-                                    if (rc == 0)
-                                        found = true;
-                                }
-                                SRAPathRelease (sra_path);
-                            }
-                            else if ( GetRCState ( rc ) == rcNotFound && GetRCTarget ( rc ) == rcDylib )
-                            {
-                                rc = 0;
-                            }
-                        }
-#endif
-
-                        if ( ! found)
-                        {
-                            rc = KDirectoryVResolvePath (curwd, true, objpath,
-                                                         sizeof objpath, pc, NULL);
-
-                            if (rc)
-                                LOGERR (klogFatal, rc, "Unable to resolved target path");
-                        }
-#endif
-
-
-                        type = KDBManagerVPathType (mgr, objpath, NULL);
-                            
-                        switch (type)
-                        {
-                        case kptDatabase:
-                        case kptPrereleaseTbl:
-                        case kptTable:
-                        case kptColumn:
-                            break;
-
-                        case kptBadPath:
-                            rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcInvalid );
-                            PLOGERR ( klogErr, (klogErr, rc, "'$(path)' -- bad path", "path=%s", pc ));
-                            break;
-                        default:
-                            rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcIncorrect );
-                            PLOGERR ( klogErr, (klogErr, rc, "'$(path)' -- type unknown", "path=%s", pc ));
-                            break;
-
-                        case kptNotFound:
-                            rc = RC ( rcDB, rcMgr, rcAccessing, rcPath, rcNotFound );
-                            PLOGERR ( klogErr, ( klogErr, rc, "'$(path)' not found", "path=%s", pc ));
-                            break;
-                        }
-                        if (rc == 0)
-                        {
-                            Vector q;
-
-                            VectorInit (&q, 0, 8);
-
-                            if (pcount == 1)
-                            {
-                                const char *default_query = "*";
-                                rc = VectorAppend (&q, NULL, default_query);
-                            }
-                            else for (ix = 1; ix < pcount; ++ix)
-                            {
-                                rc = ArgsParamValue (args, ix, &pc);
-                                if (rc)
-                                    break;
-
-                                rc = ArgsParamValue (args, ix, &pc);
-                                if (rc)
-                                    break;
-                                    
-                                rc = VectorAppend ( &q, NULL, pc );
-                                if (rc)
-                                    break;
-                            }
-
-                            if (rc)
-                                LOGERR (klogErr, rc, "Unable to queue queries");
-                            else
-                            {
-                                rc = tool_select (mgr, type, objpath, &q);
-                                
-                                VectorWhack (&q, NULL, NULL);
-                            }
-                        }
-                    }
-                    KDBManagerRelease (mgr);
-                }
-                KDirectoryRelease (curwd);
-            }
-        } while (0);
-    }
-    
-    ArgsWhack(args);
-    args = NULL;
-
-    return rc;
-}
diff --git a/tools/util/kdbmeta.vers b/tools/util/kdbmeta.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/kdbmeta.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/mac/syspass.c b/tools/util/mac/syspass.c
deleted file mode 100644
index 2a2d9f1..0000000
--- a/tools/util/mac/syspass.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "syspass-priv.h" /* get_pass */
-
-#include <klib/rc.h>
-
-#include <readpassphrase.h>
-
-rc_t get_pass(const char *prompt, char *buf, size_t bufsiz) {
-    if (prompt == NULL || buf == NULL) {
-        return RC(rcExe, rcFunction, rcEvaluating, rcParam, rcNull);
-    }
-
-    if (bufsiz == 0)
-    {   return 0; }
-
-    buf[0] = '\0';
-
-    if (readpassphrase(prompt, buf, bufsiz, 0) == NULL) {
-        return RC(rcExe, rcFunction, rcEvaluating, rcParam, rcNull);
-    }
-
-    return 0;
-}
\ No newline at end of file
diff --git a/tools/util/rcexplain.c b/tools/util/rcexplain.c
deleted file mode 100644
index 4068ac8..0000000
--- a/tools/util/rcexplain.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "rcexplain.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-
-/*--------------------------------------------------------------------------
- * KMain
- *  invoked by platform specific "main" entrypoint
- */
-
-ver_t CC KAppVersion ( void )
-{
-    return RCEXPLAIN_VERS;
-}
-
-
-const char UsageDefaultName[] = "rcexplain";
-
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [Options] rc [rc ...]\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Prints out error string to stdout for one or more return codes.\n",
-                    progname);
-}
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionsStandard();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    rc_t rc = 0;
-    Args * args;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 0);
-    if (rc == 0)
-    {
-        do
-        {
-            uint32_t pcount;
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-            
-            if (pcount == 0)
-                rc = MiniUsage(args);
-            else
-            {
-                const char * pc;
-                rc_t exp;
-                uint32_t ix;
-
-                /* over rule any set log level */
-                rc = KLogLevelSet (klogInfo);
-
-                for (ix = 0; ix < pcount; ++ix)
-                {
-                    rc = ArgsParamValue (args, ix, &pc);
-                    if (rc)
-                        break;
-
-                    exp = AsciiToU32 (pc, NULL, NULL);
-                    rc = LOGERR (klogInfo, exp, pc);
-                }
-            }
-
-        } while (0);
-
-        ArgsWhack (args);
-    }
-    return rc;
-}
diff --git a/tools/util/rcexplain.vers b/tools/util/rcexplain.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/rcexplain.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/rowwritetest.c b/tools/util/rowwritetest.c
deleted file mode 100644
index 9d8a3e3..0000000
--- a/tools/util/rowwritetest.c
+++ /dev/null
@@ -1,435 +0,0 @@
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/rc.h>
-#include <string.h> /* memset */
-#include <stdio.h>  /* printf */
-#include <stdlib.h> /* malloc */
-#include <assert.h>
-#include <os-native.h>
-
-#define OPTION_TABLE "table-path"
-#define OPTION_ROW   "row-count"
-#define ALIAS_TABLE  "t"
-#define ALIAS_ROW    "r"
-
-static char buff [81];
-static const char * table_usage[] = { "Table path.  Defaults to", buff, NULL };
-static const char * row_usage[]   = { buff, NULL };
-OptDef MyOptions[] =
-{
-    { OPTION_TABLE, ALIAS_TABLE, NULL, table_usage, 1, true, false },
-    { OPTION_ROW,   ALIAS_ROW,   NULL, row_usage,   1, true, false }
-};
-
-#define COLUMNS 5
-#define ROWLEN 64
-#define ROWS 0x400000
-
-
-char tablePath[512];
-
-
-const char UsageDefaultName[] = "rowwritetest";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [-t|--table-path <path>] [-r|--row-count <rows>]\n"
-                    "\n", progname);
-}
-
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    OUTMSG (("Options:\n"));
-
-    rc = string_printf (buff, sizeof buff, NULL, "%s", tablePath);
-
-    HelpOptionLine (ALIAS_TABLE, OPTION_TABLE, "path", table_usage);
-
-    rc = string_printf (buff, sizeof buff, NULL, "Number of Rows.  Defaults to %u", ROWS);
-
-    HelpOptionLine (ALIAS_ROW, OPTION_ROW, "row", row_usage);
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-ver_t CC KAppVersion(void) { return 0; }
-
-#define BUFFERS 3
-
-rc_t run (const char * table_path, uint64_t N )
-{
-    static const char *colInf[] = {
-        "C1: Same value, same length",
-        "C2: Var. value, same length",
-        "C3: Var. value, var. legnth",
-        "C4: Same value except I row",
-        "C5: Same value except L row" };
-    rc_t rc;
-    uint64_t row = 0;
-    VDBManager *mgr = NULL;
-    VSchema *schema = NULL;
-    VTable *table = NULL;
-    VCursor *cursor;
-    uint32_t idx[COLUMNS];
-    uint64_t total[COLUMNS];
-    int i = 0, j = 0, prev = 0;
-    char *buffer[BUFFERS];
-    
-
-
-
-    /* Initialize arrays */
-    memset(&idx, 0, sizeof idx);
-    memset(&total, 0, sizeof total);
-    for (i = 0; i < BUFFERS; ++i) {
-        char c;
-        size_t sz = ROWLEN + 1;
-        if (i == (BUFFERS - 1))
-            sz += ROWLEN;
-        buffer[i] = malloc(sz);
-        for (j = 0, c = 0; j < sz - 1; ++j, ++c) {
-            if (c >= ROWLEN)
-                c -= ROWLEN;
-            buffer[i][j] = '0' + c;
-        }
-        buffer[i][j] = '\0';
-    }
-    /* Create manager */
-    rc = VDBManagerMakeUpdate(&mgr, NULL);
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "failed to open vdb library");
-    }
-    /* Initialize schema */
-    if (rc == 0) {
-        rc = VDBManagerMakeSchema(mgr, &schema);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to create empty schema");
-    }
-    if (rc == 0) {
-        char text[512] = "table Table #1 {\n";
-        char col [128];
-        for (i = 1; i <=  COLUMNS; ++i) {
-            sprintf(col,
-                "  column ascii C%d = .C%d; physical ascii .C%d = C%d;\n",
-                i, i, i, i);
-            strcat(text, col);
-        }
-        strcat(text, "};");
-        STSMSG(1,("Parsing schema:\n%s", text));
-        rc = VSchemaParseText(schema, "Schema", text, strlen(text));
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to parse schema");
-    }
-    /* Create table */
-    if (rc == 0) {
-        STSMSG(1,("Creating %s", tablePath));
-        rc = VDBManagerCreateTable(mgr, &table, schema, "Table", kcmInit,
-            tablePath);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to create table");
-    }
-    /* Initialize cursor */
-    if (rc == 0) {
-        rc = VTableCreateCursorWrite(table, &cursor, kcmInsert);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to create cursor");
-    }
-    for (i = 0; rc == 0 && i < COLUMNS; ++i) {
-        char col[3];
-        sprintf(col, "C%d", i + 1);
-        STSMSG(2,("Adding column %s to cursor", col));
-        rc = VCursorAddColumn(cursor, &idx[i], col);
-        if (rc != 0)
-            PLOGERR(klogInt, (klogInt, rc,
-                              "failed to add $(c) to cursor", "c=%s", col));
-    }
-    if (rc == 0) {
-        rc = VCursorOpen(cursor);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to open cursor");
-    }
-    /* Write data */
-    for (row = 0; row < N && rc == 0; ++row) {
-        int max = 2 * ROWLEN - 1;
-        int sz = 0;
-        if ((row % 2) == 0) {
-            int min = 1;
-            sz = min + (int) (max * (rand() / (RAND_MAX + 1.0)));
-            prev = sz;
-            buffer[1][0] = '1';
-        }
-        else {
-            sz = max + 1 - prev;
-            buffer[1][0] = '2';
-        }
-        rc = Quitting();
-        if (rc == 0) {
-            KStsLevel lvl = 2;
-            if (row > 0 && ((row % ROWS) == 0)) {
-                lvl = 1;
-            }
-            STSMSG (lvl, ("Writing row %ji / %ji",
-                          row + 1, N));
-            rc = VCursorOpenRow(cursor);
-            if (rc != 0)
-                LOGERR(klogInt, rc, "failed to open row");
-        }
-        for (j = 0; j < COLUMNS && rc == 0; ++j) {
-            uint32_t count = 0;
-            int buf = j;
-            switch (j) {
-                case 0:
-                case 1:
-                    count = strlen(buffer[j]);
-                    break;
-                case 2:
-                    count = sz;
-                    break;
-                case 3:
-                    buf = 0;
-                    if (row == 0)
-                        buf = 1;
-                    count = strlen(buffer[buf]);
-                    break;
-                case 4:
-                    buf = 0;
-                    if (row == (N - 1))
-                        buf = 1;
-                    count = strlen(buffer[buf]);
-                    break;
-                default:
-                    assert(0);
-                    break;
-            }
-            STSMSG (3, ("Row %ji/Col.%d: %sd %.*s\n",
-                        row + 1, j + 1, count, count, buffer[buf]));
-            rc = VCursorWrite
-                (cursor, idx[j], 8, buffer[buf], 0, count);
-            if (rc != 0)
-                PLOGERR(klogInt, (klogInt, rc, "failed to write row[$i]", "i=%d", j + 1));
-            total[j] += count;
-        }
-        if (rc == 0) {
-            rc = VCursorCommitRow(cursor);
-            if (rc != 0)
-                LOGERR(klogInt, rc, "failed to commit row");
-        }
-        if (rc == 0) {
-            rc = VCursorCloseRow(cursor);
-            if (rc != 0)
-                LOGERR(klogInt, rc, "failed to close row");
-        }
-    }
-    if (rc == 0) {
-        STSMSG (1, ("Commiting cursor\n"));
-        rc = VCursorCommit(cursor);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to commit cursor");
-    }
-    /* Cleanup */
-    VCursorRelease(cursor);
-    VTableRelease(table);
-    VSchemaRelease(schema);
-    VDBManagerRelease(mgr);
-    for (i = 0; i < BUFFERS; ++i) {
-        free(buffer[i]);
-    }
-    /* Log */
-    if (rc == 0) {
-        PLOGMSG(klogInfo, (klogInfo, "$(t)", "t=%s", tablePath));
-        PLOGMSG(klogInfo,(klogInfo, 
-            "$(n)($(N)) rows written - $(b) bytes per row",
-                          PLOG_I64(n) "," PLOG_X64(N) ",b=%d", N, N, ROWLEN));
-        for (i = 0; i < COLUMNS; ++i) {
-            PLOGMSG(klogInfo,(klogInfo, 
-                              "$(i): $(n)($(N)) bytes",
-                              "i=%s," PLOG_I64(n) "," PLOG_X64(N),
-                              colInf[i], total[i], total[i]));
-        }
-    }
-    if (rc == 0) {
-        KDirectory *dir = NULL;
-        uint64_t sizes[COLUMNS];
-        memset(&sizes, 0, sizeof sizes);
-        rc = KDirectoryNativeDir(&dir);
-        if (rc != 0)
-            LOGERR(klogInt, rc, "failed to KDirectoryNativeDir");
-        else {
-            for (i = 1; i <= COLUMNS; ++i) {
-                uint64_t size = 0;
-#define  FORMAT    "%s/col/%s/data"
-#define KFORMAT "$(d)/col/$(n)/data", "d=%s,n=%s"
-#define  STATUS(action) (action FORMAT, tablePath, name)
-                char name[3];
-
-                sprintf(name, "C%d", i);
-                STSMSG (1, STATUS("checking "));
-                rc = KDirectoryFileSize(dir, &size, FORMAT, tablePath, name);
-                if (rc != 0) {
-                    if (GetRCState(rc) == rcNotFound) {
-                        STSMSG (2, STATUS("not found "));
-                        rc = 0;
-                    }
-                    else
-                        PLOGERR(klogInt, (klogInt, rc,
-                                          "failed to check " KFORMAT, tablePath, name));
-                }
-                else {
-                    STSMSG (2, STATUS("found "));
-                }
-                PLOGMSG(klogInfo, (klogInfo, "Size of $(d)/col/$(n)/data = $(s)",
-                                   "d=%s,n=%s," PLOG_I64(s), tablePath, name, size));
-                sizes[i - 1] = size;
-            }
-        }
-        KDirectoryRelease(dir);
-        if (rc == 0) {
-            puts("");
-            KOutMsg("%ld rows, %d bytes per row:\n", N, ROWLEN);
-            for (i = 0; i < COLUMNS; ++i) {
-                puts(colInf[i]);
-            }
-            puts("");
-            for (i = 0; i < COLUMNS; ++i) {
-                int64_t over = sizes[i] - total[i];
-                KOutMsg("C%d: %9ld bytes written; "
-                    "%9ld in 'data'", i + 1, total[i], sizes[i]);
-                if (over > 0) {
-                    double p = 100.0 * over / sizes[i];
-                    printf(": %7ld extra bytes (%.4f%%)\n", over, p);
-                }
-                else {
-                    puts("");
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-
-
-
-rc_t CC KMain ( int argc, char *argv[] )
-{
-    rc_t rc = 0;
-    Args * args;
-
-    rc = ArgsMakeStandardOptions (&args);
-    if (rc == 0)
-    {
-        do
-        {
-            uint32_t pcount;
-
-            rc = ArgsAddOptionArray (args, MyOptions, sizeof MyOptions / sizeof (OptDef));
-            if (rc)
-                break;
-
-            rc = ArgsParse (args, argc, argv);
-            if (rc)
-                break;
-
-            /* quirky way default path is generated means this comes
-             * before standard argument handling */
-            rc = ArgsOptionCount (args, OPTION_TABLE, &pcount);
-            if (rc)
-                break;
-
-            if (pcount == 0)
-            {
-                static char * default_name = "RowWriteTestOutTable";
-                char * user;
-
-                user = getenv ("USER");
-
-                if (user)
-                    snprintf (tablePath, sizeof (tablePath),
-                              "/home/%s/%s", user, default_name);
-                else
-                    strncpy (tablePath, default_name, sizeof (tablePath));
-            }
-            else
-            {
-                const char * pc;
-
-                ArgsOptionValue (args, OPTION_TABLE, 0, &pc);
-                strncpy (tablePath, pc, sizeof (tablePath));
-            }
-
-            rc = ArgsHandleStandardOptions (args);
-            if (rc)
-                break;
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-            
-            if (pcount)
-            {
-                const char * pc;
-
-                rc = ArgsArgvValue (args, 0, &pc);
-                if (rc)
-                    break;
-
-                rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcExcessive);
-              
-                PLOGERR (klogFatal, (klogFatal, rc, "$(P) takes no parameters", PLOG_S(P), pc));
-                break;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_ROW, &pcount);
-            if (rc == 0)
-            {
-                uint64_t row_count;
-
-                if (pcount)
-                {
-                    const char * pc;
-
-                    rc = ArgsOptionValue (args, OPTION_ROW, 0, &pc);
-                    if (rc)
-                        break;
-
-                    row_count = AsciiToU32 (pc, NULL, NULL);
-                }
-                else
-                    row_count = ROWS;
-
-                rc = run (tablePath, row_count);
-            }
-        } while (0);
-
-        ArgsWhack (args);
-    }
-    return rc;
-}
diff --git a/tools/util/rowwritetest.vers b/tools/util/rowwritetest.vers
deleted file mode 100644
index f90b1af..0000000
--- a/tools/util/rowwritetest.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.2
diff --git a/tools/util/syspass-priv.h b/tools/util/syspass-priv.h
deleted file mode 100644
index 6f8cb80..0000000
--- a/tools/util/syspass-priv.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_util_syspass_priv_
-#define _h_util_syspass_priv_
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-rc_t get_pass(const char *prompt, char *buf, size_t bufsiz);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*  _h_util_syspass_priv_ */
diff --git a/tools/util/test-sra.c b/tools/util/test-sra.c
deleted file mode 100644
index ebdab16..0000000
--- a/tools/util/test-sra.c
+++ /dev/null
@@ -1,1595 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kapp/main.h> /* KMain */
-
-#include <kfg/config.h> /* KConfig */
-#include <kfg/kart.h> /* Kart */
-#include <kfg/repository.h> /* KRepositoryMgr */
-
-#include <vfs/manager.h> /* VFSManager */
-#include <vfs/path.h> /* VPath */
-#include <vfs/resolver.h> /* VResolver */
-
-#include <vdb/database.h> /* VDatabase */
-#include <vdb/dependencies.h> /* VDBDependencies */
-#include <vdb/manager.h> /* VDBManager */
-
-#include <kns/curl-file.h> /* KCurlFileMake */
-#include <kns/manager.h> /* KNSManager */
-
-#include <kdb/manager.h> /* kptDatabase */
-
-#include <kfs/directory.h> /* KDirectory */
-#include <kfs/file.h> /* KFile */
-
-#include <klib/log.h> /* KLogHandlerSet */
-#include <klib/out.h> /* KOutMsg */
-#include <klib/printf.h> /* string_vprintf */
-#include <klib/rc.h>
-#include <klib/text.h> /* String */
-
-#include <sysalloc.h>
-
-#include <assert.h>
-#include <ctype.h> /* isprint */
-#include <stdlib.h> /* calloc */
-#include <string.h> /* memset */
-
-VFS_EXTERN rc_t CC VResolverProtocols ( VResolver * self,
-    VRemoteProtocols protocols );
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-typedef enum {
-    eCfg = 1,
-/*  eType = 2, */
-    eResolve = 2,
-    eDependMissing = 4,
-    eDependAll = 8,
-    eCurl = 16,
-    eAll = 32
-} Type;
-typedef struct {
-    KConfig *cfg;
-    KDirectory *dir;
-    const VDBManager *mgr;
-    const KRepositoryMgr *repoMgr;
-    VResolver *resolver;
-    uint8_t tests;
-    bool recursive;
-    bool noVDBManagerPathType;
-    bool noRfs;
-
-    bool allowCaching;
-    VResolverEnableState cacheState;
-} Main;
-
-uint32_t CC KAppVersion(void) { return 0; }
-
-const char UsageDefaultName[] = "test-sra";
-
-rc_t CC UsageSummary(const char *prog_name) {
-    return KOutMsg(
-        "Usage:\n"
-        "    %s [+crdDa] [-crdDa] [-R] [-N] [-C] [options] name [ name... ]\n",
-        prog_name);
-}
-
-rc_t CC Usage(const Args *args) {
-    rc_t rc2 = 0;
-
-    const char *progname, *fullpath;
-    rc_t rc = ArgsProgram(args, &fullpath, &progname);
-    if (rc != 0) {
-        progname = fullpath = UsageDefaultName;
-    }
-
-    rc2 = UsageSummary(progname);
-    if (rc == 0 && rc2 != 0) {
-        rc = rc2;
-    }
-
-/*      "  t - test object's VDB type\n" */
-    rc2 = KOutMsg("\n"
-        "Test [SRA] object, resolve it, print dependencies, configuration\n\n"
-        "[+tests] - add tests\n"
-        "[-tests] - remove tests\n\n"
-        "Tests:\n"
-        "  c - print configuration\n"
-        "  k - print curl info\n"
-        "  r - call VResolver\n"
-        "  d - call ListDependencies(missing)\n"
-        "  D - call ListDependencies(all)\n"
-        "  a - all tests\n\n"
-        "If no tests were specified then all tests will be run\n\n"
-        "-R - check object type recursively\n"
-        "-N - do not call VDBManagerPathType\n"
-        "-C - do not disable caching (default: from configuration)\n\n"
-        "More options:\n");
-    if (rc == 0 && rc2 != 0) {
-        rc = rc2;
-    }
-
-    HelpOptionsStandard();
-
-    return rc;
-}
-
-static bool testArg(const char *arg, uint8_t *testOn, uint8_t *testOff) {
-    int j = 1;
-    uint8_t *res = NULL;
-
-/*  const char tests[] = "ctrdDa"; */
-    const char tests[] = "crdDka";
-
-    assert(arg && testOn && testOff);
-    if (arg[0] != '+' && arg[0] != '-') {
-        return false;
-    }
-
-    if (arg[0] == '-' &&
-        arg[1] != '\0' && strchr(tests, arg[1]) == NULL)
-    {
-        return false;
-    }
-
-    res = arg[0] == '-' ? testOff : testOn;
-
-    for (j = 1; arg[j] != '\0'; ++j) {
-        char *c = strchr(tests, arg[j]);
-        if (c != NULL) {
-            int offset = c - tests;
-            *res |= 1 << offset;
-        }
-    }
-
-    return true;
-}
-
-static uint8_t Turn(uint8_t in, uint8_t tests, bool on) {
-    uint8_t c = 1;
-    for (c = 1; c < eAll; c <<= 1) {
-        if (tests & c) {
-            if (on) {
-                in |= c;
-            }
-            else {
-                in &= ~c;
-            }
-        }
-    }
-    return in;
-}
-
-static uint8_t processTests(uint8_t testsOn, uint8_t testsOff) {
-    uint8_t tests = 0;
-
-    bool allOn = false;
-    bool allOff = false;
-
-    if (testsOn & eAll && testsOff & eAll) {
-        testsOn &= ~eAll;
-        testsOff &= ~eAll;
-    }
-    else if (testsOn & eAll) {
-        allOn = true;
-    }
-    else if (testsOff & eAll) {
-        allOff = true;
-    }
-
-    if (allOn) {
-        tests = ~0;
-        tests = Turn(tests, testsOff, false);
-    }
-    else if (allOff) {
-        tests = Turn(tests, testsOn, true);
-    }
-    else if (testsOn != 0 || testsOff != 0) {
-        tests = Turn(tests, testsOff, false);
-        tests = Turn(tests, testsOn, true);
-    }
-    else {
-        tests = ~0;
-    }
-
-    return tests;
-} 
-
-static bool MainHasTest(const Main *self, Type type) {
-    assert(self);
-    return self->tests & type;
-}
-
-static void MainPrint(const Main *self) {
-    return;
-
-    assert(self);
-
-    if (MainHasTest(self, eCfg)) {
-        KOutMsg("eCfg\n");
-    }
-
-/*  if (MainHasTest(self, eType)) {
-        KOutMsg("eType\n");
-    }*/
-
-    if (MainHasTest(self, eResolve)) {
-        KOutMsg("eResolve\n");
-    }
-
-    if (MainHasTest(self, eDependMissing)) {
-        KOutMsg("eDependMissing\n");
-    }
-
-    if (MainHasTest(self, eDependAll)) {
-        KOutMsg("eDependAll\n");
-    }
-}
-
-static rc_t MainInitObjects(Main *self) {
-    rc_t rc = 0;
-
-    VFSManager* mgr = NULL;
-    VResolver *resolver = NULL;
-
-    if (rc == 0) {
-        rc = KDirectoryNativeDir(&self->dir);
-    }
-
-    if (rc == 0) {
-        rc = VDBManagerMakeRead(&self->mgr, NULL);
-    }
-
-    if (rc == 0) {
-        rc = KConfigMake(&self->cfg, NULL);
-    }
-
-    if (rc == 0) {
-        rc = KConfigMakeRepositoryMgrRead(self->cfg, &self->repoMgr);
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerMake(&mgr);
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerGetResolver(mgr, &resolver);
-    }
-
-    if (rc == 0) {
-        if (!self->allowCaching) {
-            self->cacheState = VResolverCacheEnable(resolver, vrAlwaysDisable);
-        }
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerMakeResolver(mgr, &self->resolver, self->cfg);
-    }
-
-
-    RELEASE(VResolver, resolver);
-    RELEASE(VFSManager, mgr);
-
-    return rc;
-}
-
-static
-void _MainInit(Main *self, int argc, char *argv[], int *argi, char **argv2)
-{
-    int i = 0;
-
-    uint8_t testsOn = 0;
-    uint8_t testsOff = 0;
-
-    assert(self && argv && argi && argv2);
-
-    *argi = 0;
-    argv2[(*argi)++] = argv[0];
-
-    for (i = 1; i < argc; ++i) {
-        if (!testArg(argv[i], &testsOn, &testsOff)) {
-            argv2[(*argi)++] = argv[i];
-        }
-    }
-
-    self->tests = processTests(testsOn, testsOff);
-
-    MainPrint(self);
-}
-
-static char** MainInit(Main *self, int argc, char *argv[], int *argi) {
-    char **argv2 = calloc(argc, sizeof *argv2);
-
-    assert(self);
-
-    memset(self, 0, sizeof *self);
-
-    if (argv2 != NULL) {
-        _MainInit(self, argc, argv, argi, argv2);
-    }
-
-    return argv2;
-}
-
-static rc_t MainPrintConfig(const Main *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    if (rc == 0) {
-        rc = KConfigPrint(self->cfg, 0);
-        if (rc != 0) {
-            OUTMSG(("KConfigPrint() = %R", rc));
-        }
-        OUTMSG(("\n"));
-    }
-
-    return rc;
-}
-
-static
-rc_t _KDBPathTypePrint(const char *head, KPathType type, const char *tail)
-{
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-    assert(head && tail);
-    {
-        rc_t rc2 = OUTMSG(("%s", head));
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-    switch (type) {
-        case kptNotFound:
-            rc2 = OUTMSG(("NotFound"));
-            break;
-        case kptBadPath:
-            rc2 = OUTMSG(("BadPath"));
-            break;
-        case kptFile:
-            rc2 = OUTMSG(("File"));
-            break;
-        case kptDir:
-            rc2 = OUTMSG(("Dir"));
-            break;
-        case kptCharDev:
-            rc2 = OUTMSG(("CharDev"));
-            break;
-        case kptBlockDev:
-            rc2 = OUTMSG(("BlockDev"));
-            break;
-        case kptFIFO:
-            rc2 = OUTMSG(("FIFO"));
-            break;
-        case kptZombieFile:
-            rc2 = OUTMSG(("ZombieFile"));
-            break;
-        case kptDataset:
-            rc2 = OUTMSG(("Dataset"));
-            break;
-        case kptDatatype:
-            rc2 = OUTMSG(("Datatype"));
-            break;
-        case kptDatabase:
-            rc2 = OUTMSG(("Database"));
-            break;
-        case kptTable:
-            rc2 = OUTMSG(("Table"));
-            break;
-        case kptIndex:
-            rc2 = OUTMSG(("Index"));
-            break;
-        case kptColumn:
-            rc2 = OUTMSG(("Column"));
-            break;
-        case kptMetadata:
-            rc2 = OUTMSG(("Metadata"));
-            break;
-        case kptPrereleaseTbl:
-            rc2 = OUTMSG(("PrereleaseTbl"));
-            break;
-        default:
-            rc2 = OUTMSG(("unexpectedFileType(%d)", type));
-            assert(0);
-            break;
-    }
-    if (rc == 0 && rc2 != 0) {
-        rc = rc2;
-    }
-    {
-        rc_t rc2 = OUTMSG(("%s", tail));
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-    return rc;
-}
-
-static bool isprintString(const unsigned char *s) {
-    assert(s);
-
-    while (*s) {
-        int c = *(s++);
-        if (!isprint(c)) {
-            return false;
-        }
-    }
-
-    return true;
-}
-
-static rc_t printString(const char *s) {
-    rc_t rc = 0;
-
-    const unsigned char *u = (unsigned char*)s;
-
-    assert(u);
-
-    if (isprintString(u)) {
-        return OUTMSG(("%s", u));
-    }
-
-    while (*u) {
-        rc_t rc2 = 0;
-        int c = *(u++);
-        if (isprint(c)) {
-            rc2 = OUTMSG(("%c", c));
-        }
-        else {
-            rc2 = OUTMSG(("\\%03o", c));
-        }
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    return rc;
-}
-
-static rc_t _KDirectoryReport(const KDirectory *self,
-    const char *name, int64_t *size, KPathType *type, bool *alias)
-{
-    rc_t rc = 0;
-    const KFile *f = NULL;
-
-    bool dummyB = false;
-    int64_t dummy = 0;
-
-    KPathType dummyT = kptNotFound;;
-    if (type == NULL) {
-        type = &dummyT;
-    }
-
-    if (alias == NULL) {
-        alias = &dummyB;
-    }
-    if (size == NULL) {
-        size = &dummy;
-    }
-
-    *type = KDirectoryPathType(self, name);
-
-    if (*type & kptAlias) {
-        OUTMSG(("alias|"));
-        *type &= ~kptAlias;
-        *alias = true;
-    }
-
-    rc = _KDBPathTypePrint("", *type, " ");
-
-    if (*type == kptFile) {
-        rc = KDirectoryOpenFileRead(self, &f, name);
-        if (rc != 0) {
-            OUTMSG(("KDirectoryOpenFileRead("));
-            printString(name);
-            OUTMSG((")=%R ", rc));
-        }
-        else {
-            uint64_t sz = 0;
-            rc = KFileSize(f, &sz);
-            if (rc != 0) {
-                OUTMSG(("KFileSize(%s)=%R ", name, rc));
-            }
-            else {
-                OUTMSG(("%,lu ", sz));
-                *size = sz;
-            }
-        }
-    }
-    else {
-        OUTMSG(("- "));
-    }
-
-    RELEASE(KFile, f);
-
-    return rc;
-}
-
-static rc_t _VDBManagerReport(const VDBManager *self,
-    const char *name, KPathType *type)
-{
-    KPathType dummy = kptNotFound;;
-
-    if (type == NULL) {
-        type = &dummy;
-    }
-
-    *type = VDBManagerPathType(self, name);
-
-    *type &= ~kptAlias;
-
-    return _KDBPathTypePrint("", *type, " ");
-}
-
-static
-rc_t _KDirectoryFileHeaderReport(const KDirectory *self, const char *path)
-{
-    rc_t rc = 0;
-    char hdr[8] = "";
-    const KFile *f = NULL;
-    size_t num_read = 0;
-    size_t i = 0;
-
-    assert(self && path);
-
-    rc = KDirectoryOpenFileRead(self, &f, path);
-    if (rc != 0) {
-        OUTMSG(("KDirectoryOpenFileRead(%s) = %R\n", path, rc));
-        return rc;
-    }
-
-    rc = KFileReadAll(f, 0, hdr, sizeof hdr, &num_read);
-    if (rc != 0) {
-        OUTMSG(("KFileReadAll(%s, 8) = %R\n", path, rc));
-    }
-
-    for (i = 0; i < num_read && rc == 0; ++i) {
-        if (isprint(hdr[i])) {
-            OUTMSG(("%c", hdr[i]));
-        }
-        else {
-            OUTMSG(("\\X%02X", hdr[i]));
-        }
-    }
-    OUTMSG((" "));
-
-    RELEASE(KFile, f);
-    return rc;
-}
-
-static rc_t MainReport(const Main *self,
-    const char *name, int64_t *size, KPathType *type, bool *alias)
-{
-    rc_t rc = 0;
-
-    assert(self);
-
-    rc = _KDirectoryReport(self->dir, name, size, type, alias);
-
-    if (!self->noVDBManagerPathType) { /* && MainHasTest(self, eType)) { */
-        _VDBManagerReport(self->mgr, name, type);
-    }
-
-    if (type != NULL && *type == kptFile) {
-        _KDirectoryFileHeaderReport(self->dir, name);
-    }
-
-    return rc;
-}
-
-#define rcResolver   rcTree
-static bool NotFoundByResolver(rc_t rc) {
-    if (GetRCModule(rc) == rcVFS) {
-        if (GetRCTarget(rc) == rcResolver) {
-            if (GetRCContext(rc) == rcResolving) {
-                if (GetRCState(rc) == rcNotFound) {
-                    return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-typedef enum {
-      ePathLocal
-    , ePathRemote
-    , ePathCache
-} EPathType;
-static rc_t MainPathReport(const Main *self, rc_t rc, const VPath *path,
-    EPathType type, const char *name, const VPath* remote, int64_t *size,
-    bool fasp, const KFile *fRemote)
-{
-    switch (type) {
-        case ePathLocal:
-            OUTMSG(("Local: "));
-            break;
-        case ePathRemote:
-            OUTMSG(("Remote %s: ", fasp ? "fasp" : "http"));
-            break;
-        case ePathCache:
-            OUTMSG(("Cache %s: ", fasp ? "fasp" : "http"));
-            if (remote == NULL) {
-                OUTMSG(("skipped\n"));
-                return rc;
-            }
-            break;
-    }
-    if (rc != 0) {
-        if (NotFoundByResolver(rc)) {
-            OUTMSG(("not found\n"));
-            rc = 0;
-        }
-        else {
-            switch (type) {
-                case ePathLocal:
-                    OUTMSG(("VResolverLocal(%s) = %R\n", name, rc));
-                    break;
-                case ePathRemote:
-                    OUTMSG(("VResolverRemote(%s) = %R\n", name, rc));
-                    break;
-                case ePathCache:
-                    OUTMSG(("VResolverCache(%s) = %R\n", name, rc));
-                    break;
-            }
-        }
-    }
-    else {
-        const String *s = NULL;
-        rc_t rc = VPathMakeString(path, &s);
-        if (rc == 0) {
-            OUTMSG(("%S ", s));
-            switch (type) {
-                case ePathLocal:
-                case ePathCache:
-                    rc = MainReport(self, s->addr, size, NULL, NULL);
-                    break;
-                case ePathRemote: {
-                    uint64_t sz = 0;
-                    if (!fasp && fRemote != NULL) {
-                        rc = KFileSize(fRemote, &sz);
-                        if (rc != 0) {
-                            OUTMSG(("KFileSize(%s)=%R ", name, rc));
-                        }
-                        else {
-                            OUTMSG(("%,lu ", sz));
-                            *size = sz;
-                        }
-                    }
-                    break;
-                }
-            }
-            OUTMSG(("\n"));
-        }
-        else {
-            const char *s = "";
-            switch (type) {
-                case ePathLocal:
-                    s = "Local";
-                    break;
-                case ePathCache:
-                    s = "Cache";
-                    break;
-                case ePathRemote:
-                    s = "Remote";
-                    break;
-                default:
-                    assert(0);
-                    break;
-            }
-            OUTMSG(("VPathMakeUri(VResolver%s(%s)) = %R\n", s, name, rc));
-        }
-        if (type == ePathCache) {
-            char cachecache[PATH_MAX] = "";
-            if (rc == 0) {
-                rc = string_printf(cachecache,
-                    sizeof cachecache, NULL, "%s.cache", s->addr);
-                if (rc != 0) {
-                    OUTMSG(("string_printf(%s) = %R\n", s->addr, rc));
-                }
-            }
-
-            if (rc == 0) {
-                OUTMSG(("Cache.cache %s: ", fasp ? "fasp" : "http"));
-                OUTMSG(("%s ", cachecache));
-                rc = MainReport(self, cachecache, NULL, NULL, NULL);
-                OUTMSG(("\n"));
-            }
-        }
-        free((void*)s);
-    }
-    return rc;
-}
-
-static rc_t MainResolveLocal(const Main *self, const VResolver *resolver,
-    const char *name, const VPath *acc, int64_t *size)
-{
-    rc_t rc = 0;
-
-    const VPath* local = NULL;
-
-    assert(self);
-
-    if (resolver == NULL) {
-        resolver = self->resolver;
-    }
-/*
-    OUTMSG(("Local: "));*/
-
-    rc = VResolverLocal(resolver, acc, &local);
-    rc = MainPathReport(self,
-        rc, local, ePathLocal, name, NULL, NULL, false, NULL);
-
-    RELEASE(VPath, local);
-
-    return rc;
-}
-
-static rc_t MainResolveRemote(const Main *self, VResolver *resolver,
-    const char *name, const VPath* acc, const VPath **remote, int64_t *size,
-    bool fasp)
-{
-    rc_t rc = 0;
-
-    const KFile* f = NULL;
-
-    assert(self && size);
-
-    if (resolver == NULL) {
-        resolver = self->resolver;
-    }
-
-    rc = VResolverRemote(resolver,
-        fasp ? eProtocolFaspHttp : eProtocolHttp, acc, remote, &f);
-    rc = MainPathReport(self,
-        rc, *remote, ePathRemote, name, NULL, size, fasp, f);
-    RELEASE(KFile, f);
-
-    return rc;
-}
-
-static rc_t MainResolveCache(const Main *self, const VResolver *resolver,
-    const char *name, const VPath* remote, bool fasp)
-{
-    rc_t rc = 0;
-    const VPath* cache = NULL;
-
-    assert(self);
-    
-    if (remote == NULL) {
-        rc = MainPathReport(self,
-            rc, cache, ePathCache, name, remote, NULL, fasp, NULL);
-    }
-    else {
-        uint64_t file_size = 0;
-
-        if (resolver == NULL) {
-            resolver = self->resolver;
-        }
-
-        if (!self->allowCaching) {
-            VResolverCacheEnable(resolver, self->cacheState);
-        }
-        rc = VResolverCache(resolver, remote, &cache, file_size);
-        rc = MainPathReport(self,
-            rc, cache, ePathCache, name, remote, NULL, fasp, NULL);
-
-        RELEASE(VPath, cache);
-        if (!self->allowCaching) {
-            VResolverCacheEnable(resolver, vrAlwaysDisable);
-        }
-    }
-
-    return rc;
-}
-
-typedef enum {
-      eQueryAll
-    , eQueryLocal
-    , eQueryRemote
-} EQueryType ;
-static rc_t VResolverQueryByType(const Main *self, const VResolver *resolver,
-    const char *name, const VPath *query,
-    bool fasp, VRemoteProtocols protocols, EQueryType type)
-{
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-    const VPath *local = NULL;
-    const VPath *remote = NULL;
-    const VPath *cache = NULL;
-    const VPath **pLocal = NULL;
-    const VPath **pRemote = NULL;
-    const VPath **pCache = NULL;
-
-    switch (type) {
-        case eQueryLocal:
-        case eQueryAll:
-            pLocal = &local;
-        default:
-            break;
-    }
-
-    switch (type) {
-        case eQueryRemote:
-        case eQueryAll:
-            pRemote = &remote;
-            pCache = &cache;
-        default:
-            break;
-    }
-
-    if (pCache != NULL && !self->allowCaching) {
-        VResolverCacheEnable(resolver, vrAlwaysEnable);
-    }
-
-    rc = VResolverQuery(resolver, protocols, query, pLocal, pRemote, pCache);
-    OUTMSG(("\nVResolverQuery(%s, %s, local%s, remote%s, cache%s)= %R\n",
-        name, protocols == eProtocolHttp ? "Http" : "FaspHttp", 
-        pLocal == NULL ? "=NULL" : "", pRemote == NULL ? "=NULL" : "",
-        pCache == NULL ? "=NULL" : "", rc));
-    if (rc == 0) {
-        if (local != NULL) {
-            rc2 = MainPathReport(self,
-                rc, local, ePathLocal, name, NULL, NULL, false, NULL);
-        }
-        if (remote != NULL) {
-            rc2 = MainPathReport(self,
-                rc, remote, ePathRemote, name, NULL, NULL, fasp, NULL);
-        }
-        if (cache != NULL) {
-            rc2 = MainPathReport(self,
-                rc, cache, ePathCache, name, remote, NULL, fasp, NULL);
-        }
-    }
-
-    RELEASE(VPath, local);
-    RELEASE(VPath, remote);
-    RELEASE(VPath, cache);
-
-    if (pCache != NULL && !self->allowCaching) {
-        VResolverCacheEnable(resolver, self->cacheState);
-    }
-
-    return rc;
-}
-
-static rc_t MainResolveQuery(const Main *self, const VResolver *resolver,
-    const char *name, const VPath *query, bool fasp)
-{
-    rc_t rc = 0;
-    rc_t rc2 = 0;
-
-    VRemoteProtocols protocols = eProtocolHttp;
-    if (fasp) {
-        protocols = eProtocolFaspHttp;
-    }
-    else {
-        protocols = eProtocolHttp;
-    }
-
-    if (resolver == NULL) {
-        resolver = self->resolver;
-    }
-
-    rc2 = VResolverQueryByType(self, resolver, name, query, fasp, protocols,
-        eQueryAll);
-    if (rc2 != 0 && rc == 0) {
-        rc = rc2;
-    }
-
-    rc2 = VResolverQueryByType(self, resolver, name, query, fasp, protocols,
-        eQueryLocal);
-    if (rc2 != 0 && rc == 0) {
-        rc = rc2;
-    }
-
-    rc2 = VResolverQueryByType(self, resolver, name, query, fasp, protocols,
-        eQueryRemote);
-    if (rc2 != 0 && rc == 0) {
-        rc = rc2;
-    }
-
-    return rc;
-}
-
-static rc_t MainResolve(const Main *self, const KartItem *item,
-    const char *name, int64_t *localSz, int64_t *remoteSz)
-{
-    rc_t rc = 0;
-
-    VPath* acc = NULL;
-    VResolver* resolver = NULL;
-
-    assert(self);
-
-    if (rc == 0) {
-        VFSManager *mgr = NULL;
-        rc = VFSManagerMake(& mgr);
-        if (rc != 0) {
-            OUTMSG(("VFSManagerMake = %R\n", rc));
-        }
-        else {
-            if (item == NULL) {
-                rc = VFSManagerMakePath(mgr, &acc, name);
-                if (rc != 0) {
-                    OUTMSG(("VFSManagerMakePath(%s) = %R\n", name, rc));
-                }
-            }
-            else {
-                const KRepository *p_protected = NULL;
-                uint64_t oid = 0;
-                uint64_t project = 0;
-                if (rc == 0) {
-                    rc = KartItemProjIdNumber(item, &project);
-                    if (rc != 0) {
-                        OUTMSG(("KartItemProjectIdNumber = %R\n", rc));
-                    }
-                }
-                if (rc == 0) {
-                    rc = KartItemItemIdNumber(item, &oid);
-                    if (rc != 0) {
-                        OUTMSG(("KartItemItemIdNumber = %R\n", rc));
-                    }
-                }
-                if (rc == 0) {
-                    rc = VFSManagerMakeOidPath(mgr, &acc, oid);
-                    if (rc != 0) {
-                        OUTMSG(("VFSManagerMakePath(%d) = %R\n", oid, rc));
-                    }
-                }
-                if (rc == 0) {
-                    rc = KRepositoryMgrGetProtectedRepository(self->repoMgr, 
-                        project, &p_protected);
-                    if (rc != 0) {
-                        OUTMSG((
-                            "KRepositoryMgrGetProtectedRepository(%d) = %R\n",
-                            project, rc));
-                    }
-                }
-                if (rc == 0) {
-                    rc = KRepositoryMakeResolver(p_protected, &resolver,
-                        self->cfg);
-                    if (rc != 0) {
-                        OUTMSG((
-                            "KRepositoryMakeResolver(%d) = %R\n", project, rc));
-                    }
-                }
-                RELEASE(KRepository, p_protected);
-            }
-            RELEASE(VFSManager, mgr);
-        }
-    }
-
-    if (rc == 0) {
-        const VPath* remote = NULL;
-
-        rc_t rc2 = MainResolveLocal(self, resolver, name, acc, localSz);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveRemote(self, resolver, name, acc, &remote, remoteSz,
-            false);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveCache(self, resolver, name, remote, false);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveRemote(self, resolver, name, acc, &remote, remoteSz,
-            true);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveCache(self, resolver, name, remote, true);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveQuery(self, resolver, name, acc, false);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        rc2 = MainResolveQuery(self, resolver, name, acc, true);
-        if (rc2 != 0 && rc == 0) {
-            rc = rc2;
-        }
-
-        RELEASE(VPath, remote);
-    }
-
-    RELEASE(VPath, acc); 
-    RELEASE(VResolver, resolver);
-
-    return rc;
-}
-
-static
-rc_t MainDepend(const Main *self, const char *name, bool missing)
-{
-    rc_t rc = 0;
-
-    const VDatabase *db = NULL;
-    const VDBDependencies* dep = NULL;
-    uint32_t count = 0;
-
-    if (rc == 0) {
-        rc = VDBManagerOpenDBRead(self->mgr, &db, NULL, name);
-        if (rc != 0) {
-            if (rc == SILENT_RC(rcVFS,rcMgr,rcOpening,rcDirectory,rcNotFound)) {
-                return 0;
-            }
-            OUTMSG(("VDBManagerOpenDBRead(%s) = %R\n", name, rc));
-        }
-    }
-
-    if (rc == 0) {
-        if (!self->allowCaching) {
-            VResolverCacheEnable(self->resolver, self->cacheState);
-        }
-        rc = VDatabaseListDependenciesWithCaching(db,
-            &dep, missing, !self->allowCaching);
-        if (rc != 0) {
-            OUTMSG(("VDatabaseListDependencies(%s, %s) = %R\n",
-                name, missing ? "missing" : "all", rc));
-        }
-        if (!self->allowCaching) {
-            VResolverCacheEnable(self->resolver, vrAlwaysDisable);
-        }
-    }
-
-    if (rc == 0) {
-        rc = VDBDependenciesCount(dep, &count);
-        if (rc != 0) {
-            OUTMSG(("VDBDependenciesCount(%s, %s) = %R\n",
-                name, missing ? "missing" : "all", rc));
-        }
-        else {
-            OUTMSG(("VDBDependenciesCount(%s)=%d\n",
-                missing ? "missing" : "all", count));
-        }
-    }
-
-    if (rc == 0) {
-        uint32_t i = 0;
-        rc_t rc2 = 0;
-        for (i = 0; i < count; ++i) {
-            bool b = true;
-            const char *s = NULL;
-            KPathType type = kptNotFound;
-
-            OUTMSG((" %6d\t", i + 1));
-
-            rc2 = VDBDependenciesSeqId(dep, &s, i);
-            if (rc2 == 0) {
-                OUTMSG(("seqId=%s,", s));
-            }
-            else {
-                OUTMSG(("VDBDependenciesSeqId(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesName(dep, &s, i);
-            if (rc2 == 0) {
-                OUTMSG(("name=%s,", s));
-            }
-            else {
-                OUTMSG(("VDBDependenciesName(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesCircular(dep, &b, i);
-            if (rc2 == 0) {
-                OUTMSG(("circular=%s,", b ? "true" : "false"));
-            }
-            else {
-                OUTMSG(("VDBDependenciesCircular(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesType(dep, &type, i);
-            if (rc2 == 0) {
-                rc2 = _KDBPathTypePrint("type=", type, ",");
-                if (rc2 != 0 && rc == 0) {
-                    rc = rc2;
-                }
-            }
-            else {
-                OUTMSG(("VDBDependenciesType(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesLocal(dep, &b, i);
-            if (rc2 == 0) {
-                OUTMSG(("local=%s,", b ? "local" : "remote"));
-            }
-            else {
-                OUTMSG(("VDBDependenciesLocal(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesPath(dep, &s, i);
-            if (rc2 == 0) {
-                OUTMSG(("\n\tpathLocal=%s,", s == NULL ? "notFound" : s));
-            }
-            else {
-                OUTMSG(("VDBDependenciesPath(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesPathRemote(dep, &s, i);
-            if (rc2 == 0) {
-                if (s == NULL) {
-                    OUTMSG(("\n\tpathRemote: notFound "));
-                }
-                else {
-                    OUTMSG(("\n\tpathRemote: %s ", s));
-                    if (!self->noRfs) {
-                        const KFile *f = NULL;
-                        rc2 = KCurlFileMake(&f, s, false);
-                        if (rc2 != 0) {
-                            OUTMSG(("KCurlFileMake=%R", rc2));
-                            if (rc == 0) {
-                                rc = rc2;
-                            }
-                        }
-                        if (rc2 == 0) {
-                            uint64_t sz = 0;
-                            rc2 = KFileSize(f, &sz);
-                            if (rc2 != 0) {
-                                OUTMSG(("KFileSize=%R", rc2));
-                                if (rc == 0) {
-                                    rc = rc2;
-                                }
-                            }
-                            else {
-                                OUTMSG(("%,lu", sz));
-                            }
-                        }
-                        RELEASE(KFile, f);
-                    }
-                }
-            }
-            else {
-                OUTMSG(("VDBDependenciesPathRemote(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            rc2 = VDBDependenciesPathCache(dep, &s, i);
-            if (rc2 == 0) {
-                OUTMSG(("\n\tpathCache: %s ", s == NULL ? "notFound" : s));
-                if (s != NULL) {
-                    char cachecache[PATH_MAX] = "";
-                    rc2 = MainReport(self, s, NULL, NULL, NULL);
-                    OUTMSG(("\n"));
-                    if (rc == 0) {
-                        rc = rc2;
-                    }
-                    if (rc2 == 0) {
-                        rc2 = string_printf(cachecache,
-                            sizeof cachecache, NULL, "%s.cache", s);
-                        if (rc2 != 0) {
-                            if (rc == 0) {
-                                rc = rc2;
-                            }
-                            OUTMSG(("string_printf(%s) = %R\n", s, rc2));
-                        }
-                    }
-                    if (rc == 0) {
-                        OUTMSG(("\tpathCache.cache: "));
-                        OUTMSG(("%s ", cachecache));
-                        rc = MainReport(self, cachecache, NULL, NULL, NULL);
-                    }
-                }
-            }
-            else {
-                OUTMSG(("VDBDependenciesPathCache(%s, %s, %i)=%R ",
-                    name, missing ? "missing" : "all", i, rc2));
-                if (rc == 0) {
-                    rc = rc2;
-                }
-            }
-
-            OUTMSG(("\n"));
-        }
-    }
-
-    RELEASE(VDBDependencies, dep);
-    RELEASE(VDatabase, db);
-
-    return rc;
-}
-
-static rc_t PrintCurl() {
-    KNSManager *mgr = NULL;
-
-    rc_t rc = KNSManagerMake(&mgr);
-    if (rc != 0) {
-        OUTMSG(("KNSManagerMake = %R\n", rc));
-    }
-
-    if (rc == 0) {
-        rc_t rc = KNSManagerAvail(mgr);
-        OUTMSG(("KNSManagerAvail = %R", rc));
-
-        if (rc == 0) {
-            const char *version_string = NULL;
-            rc = KNSManagerCurlVersion(mgr, &version_string);
-            if (rc == 0) {
-                OUTMSG((". Curl Version = %s\n", version_string));
-            }
-            else {
-                OUTMSG((". KNSManagerCurlVersion = %R\n", rc));
-            }
-        }
-    }
-
-    RELEASE(KNSManager, mgr);
-
-    return rc;
-}
-
-#define kptKartITEM (kptAlias - 1)
-
-static
-rc_t MainExec(const Main *self, const KartItem *item, const char *aArg, ...)
-{
-    rc_t rc = 0;
-    rc_t rce = 0;
-
-    KPathType type = kptNotFound;
-    bool alias = false;
-    int64_t directSz = -1;
-    int64_t localSz = -1;
-    int64_t remoteSz = -1;
-    size_t num_writ = 0;
-    char arg[PATH_MAX] = "";
-
-    va_list args;
-    va_start(args, aArg);
-
-    assert(self);
-
-    if (item != NULL) {
-        type = kptKartITEM;
-    }
-
-    else {
-        rc = string_vprintf(arg, sizeof arg, &num_writ, aArg, args);
-        if (rc != 0) {
-            OUTMSG(("string_vprintf(%s)=%R\n", aArg, rc));
-            return rc;
-        }
-        assert(num_writ < sizeof arg);
-
-        OUTMSG(("\n"));
-        rc = printString(arg);
-        if (rc != 0) {
-            OUTMSG(("printString=%R\n", rc));
-            return rc;
-        }
-        OUTMSG((" "));
-        rc = MainReport(self, arg, &directSz, &type, &alias);
-        OUTMSG(("\n"));
-    }
-
-    if (self->recursive && type == kptDir && !alias) {
-        uint32_t i = 0;
-        uint32_t count = 0;
-        KNamelist *list = NULL;
-        rc = KDirectoryList(self->dir, &list, NULL, NULL, arg);
-        if (rc != 0) {
-            OUTMSG(("KDirectoryList(%s)=%R ", arg, rc));
-        }
-        else {
-            rc = KNamelistCount(list, &count);
-            if (rc != 0) {
-                OUTMSG(("KNamelistCount(KDirectoryList(%s))=%R ", arg, rc));
-            }
-        }
-        for (i = 0; i < count && rc == 0; ++i) {
-            const char *name = NULL;
-            rc = KNamelistGet(list, i, &name);
-            if (rc != 0) {
-                OUTMSG(("KNamelistGet(KDirectoryList(%s), %d)=%R ",
-                    arg, i, rc));
-            }
-            else {
-                rc_t rc2 = MainExec(self, NULL, "%s/%s", arg, name);
-                if (rc2 != 0 && rce == 0) {
-                    rce = rc2;
-                }
-            }
-        }
-        RELEASE(KNamelist, list);
-    }
-    else {
-        bool isKart = false;
-        Kart *kart = NULL;
-        if (type == kptFile) {
-            rc_t rc = KartMake(self->dir, arg, &kart, &isKart);
-            if (rc != 0) {
-                OUTMSG(("KartMake = %R\n", rc));
-            }
-        }
-
-        if (isKart) {
-            const KartItem *item = NULL;
-            while (true) {
-                rc_t rc2 = 0;
-                RELEASE(KartItem, item);
-                rc2 = KartMakeNextItem(kart, &item);
-                if (rc2 != 0) {
-                    OUTMSG(("KartMakeNextItem = %R\n", rc2));
-                    if (rce == 0) {
-                        rce = rc2;
-                    }
-                    break;
-                }
-                if (item == NULL) {
-                    break;
-                }
-                rc2 = MainExec(self, item, NULL);
-                if (rc2 != 0 && rce == 0) {
-                    rce = rc2;
-                }
-            }
-            KartRelease(kart);
-            kart = NULL;
-        }
-        else {
-            if (MainHasTest(self, eResolve)) {
-                rc_t rc2 = MainResolve(self, item, arg, &localSz, &remoteSz);
-                if (rc == 0 && rc2 != 0) {
-                    rc = rc2;
-                }
-            }
-
-            if (item == NULL) {
-                if (type == kptDatabase || type == kptNotFound) {
-                    if (MainHasTest(self, eDependMissing)) {
-                        rc_t rc2 = MainDepend(self, arg, true);
-                        if (rc == 0 && rc2 != 0) {
-                            rc = rc2;
-                        }
-                    }
-
-                    if (MainHasTest(self, eDependAll)) {
-                        rc_t rc2 = MainDepend(self, arg, false);
-                        if (rc == 0 && rc2 != 0) {
-                            rc = rc2;
-                        }
-                    }
-                }
-            }
-
-            if (MainHasTest(self, eResolve) && (
-                (directSz != -1 && localSz != -1 && directSz != localSz) ||
-                (remoteSz != -1 && localSz != -1 && localSz != remoteSz))
-               )
-            {
-                OUTMSG(("FILE SIZES DO NOT MATCH: "));
-                if (directSz != -1 && localSz != -1 && directSz != remoteSz)
-                {
-                    OUTMSG(("direct=%ld != remote=%ld. ", directSz, remoteSz));
-                }
-                if (remoteSz != -1 && localSz != -1 && localSz != remoteSz) {
-                    OUTMSG(("local=%ld != remote=%ld. ", localSz, remoteSz));
-                }
-                OUTMSG(("\n"));
-            }
-
-            OUTMSG(("\n"));
-        }
-    }
-
-    if (rce != 0 && rc == 0) {
-        rc = rce;
-    }
-    return rc;
-}
-
-static rc_t MainFini(Main *self) {
-    rc_t rc = 0;
-
-    assert(self);
-
-    RELEASE(VResolver, self->resolver);
-    RELEASE(KConfig, self->cfg);
-    RELEASE(KRepositoryMgr, self->repoMgr);
-    RELEASE(VDBManager, self->mgr);
-    RELEASE(KDirectory, self->dir);
-
-    return rc;
-}
-
-#define OPTION_CACHE "allow-caching"
-#define ALIAS_CACHE  "C"
-static const char* USAGE_CACHE[] = { "do not disable caching", NULL };
-
-#define OPTION_NO_RFS "no-rfs"
-static const char* USAGE_NO_RFS[]
-    = { "do not check remote file size for dependencies", NULL };
-
-#define OPTION_NO_VDB "no-vdb"
-#define ALIAS_NO_VDB  "N"
-static const char* USAGE_NO_VDB[] = { "do not call VDBManagerPathType", NULL };
-
-#define OPTION_REC "recursive"
-#define ALIAS_REC  "R"
-static const char* USAGE_REC[] = { "check object type recursively", NULL };
-
-OptDef Options[] = {                             /* needs_value, required */
-    { OPTION_CACHE , ALIAS_CACHE , NULL, USAGE_CACHE , 1, false, false },
-    { OPTION_NO_RFS, NULL        , NULL, USAGE_NO_RFS, 1, false, false },
-    { OPTION_NO_VDB, ALIAS_NO_VDB, NULL, USAGE_NO_VDB, 1, false, false },
-    { OPTION_REC   , ALIAS_REC   , NULL, USAGE_REC   , 1, false, false }
-};
-
-rc_t CC KMain(int argc, char *argv[]) {
-    rc_t rc = 0;
-    uint32_t pcount = 0;
-    uint32_t i = 0;
-    Args *args = NULL;
-    rc_t rc3 = 0;
-    int argi = 0;
-
-    Main prms;
-    char **argv2 = MainInit(&prms, argc, argv, &argi);
-
-    if (rc == 0) {
-        rc = ArgsMakeAndHandle(&args, argi, argv2, 1,
-            Options, sizeof Options / sizeof Options[0]);
-    }
-
-    if (rc == 0) {
-        rc = ArgsOptionCount(args, OPTION_CACHE, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_CACHE "' argument");
-        }
-        else {
-            if (pcount > 0) {
-                prms.allowCaching = true;
-            }
-        }
-    }
-
-    if (rc == 0) {
-        rc = MainInitObjects(&prms);
-    }
-
-    if (MainHasTest(&prms, eCfg)) {
-        rc_t rc2 = MainPrintConfig(&prms);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-
-    if (MainHasTest(&prms, eCurl)) {
-        PrintCurl();
-    }
-
-    if (rc == 0) {
-        rc = ArgsOptionCount(args, OPTION_NO_RFS, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_NO_RFS "' argument");
-        }
-        else {
-            if (pcount > 0) {
-                prms.noRfs = true;
-            }
-        }
-    }
-
-    if (rc == 0) {
-        rc = ArgsOptionCount(args, OPTION_NO_VDB, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_NO_VDB "' argument");
-        }
-        else {
-            if (pcount > 0) {
-                prms.noVDBManagerPathType = true;
-            }
-        }
-    }
-
-    if (rc == 0) {
-        rc = ArgsOptionCount(args, OPTION_REC, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_REC "' argument");
-        }
-        else {
-            if (pcount > 0) {
-                prms.recursive = true;
-            }
-        }
-    }
-
-    if (rc == 0) {
-        rc = ArgsParamCount(args, &pcount);
-    }
-
-    for (i = 0; i < pcount; ++i) {
-        const char *name = NULL;
-        rc3 = ArgsParamValue(args, i, &name);
-        if (rc3 == 0) {
-            rc_t rc2 = MainExec(&prms, NULL, name);
-            if (rc == 0 && rc2 != 0) {
-                rc = rc2;
-            }
-        }
-    }
-    if (rc == 0 && rc3 != 0) {
-        rc = rc3;
-    }
-
-    RELEASE(Args, args);
-
-    {
-        rc_t rc2 = MainFini(&prms);
-        if (rc == 0 && rc2 != 0) {
-            rc = rc2;
-        }
-    }
-    free(argv2);
-
-    OUTMSG(("\n"));
-
-    return rc;
-}
diff --git a/tools/util/test-sra.vers b/tools/util/test-sra.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/test-sra.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/testld.c b/tools/util/testld.c
deleted file mode 100644
index c89603d..0000000
--- a/tools/util/testld.c
+++ /dev/null
@@ -1,261 +0,0 @@
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-#include <klib/vector.h>
-#include <kfs/directory.h>
-#include <kfs/dyload.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-
-/* update libpath
- */
-static
-void testld_update_libpath ( KDyld *dl, const char *path )
-{
-    rc_t rc = 0;
-
-    const char *end;
-    for ( end = strchr ( path, ':' ); end != NULL; end = strchr ( path = end + 1, ':' ) )
-    {
-        if ( path < end )
-        {
-            rc = KDyldAddSearchPath ( dl, "%.*s",
-                                      ( int ) ( end - path ), path );
-            if ( rc != 0 )
-            {
-                PLOGERR ( klogWarn, ( klogWarn, rc, "failed to add library path '$(path)'",
-                                      "path=%.*s", ( int ) ( end - path ), path ));
-            }
-        }
-    }
-
-    if ( path [ 0 ] != 0 )
-    {
-        rc = KDyldAddSearchPath ( dl, path );
-        if ( rc != 0 )
-        {
-            PLOGERR ( klogWarn, ( klogWarn, rc, "failed to add library path '$(path)'", "path=s", path ));
-        }
-    }
-}
-
-
-/* load library
- */
-static
-void testld_load_library ( KDyld *dl, KDlset *libs, const char *libname )
-{
-    KDylib *lib;
-    rc_t rc = KDyldLoadLib ( dl, & lib, libname );
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogErr, ( klogErr, rc, "failed to load library '$(name)'",
-                             "name=%s", libname ));
-    }
-    else
-    {
-        printf ( "loaded library '%s'\n", libname);
-
-        rc = KDlsetAddLib ( libs, lib );
-        if ( rc != 0 )
-        {
-            PLOGERR ( klogInt, ( klogInt, rc, "failed to retain library '$(name)'",
-                                 "name=%s", libname ));
-        }
-
-        KDylibRelease ( lib );
-    }
-}
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return 0;
-}
-    
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-
-#define OPTION_LOAD "lib-path"
-#define ALIAS_LOAD  "l"
-
-static
-const char * load_usage [] = 
-	{ "Path(s) for loading dynamic libraries.", NULL };
-
-static
-OptDef MyOptions[] =
-{
-    { OPTION_LOAD, ALIAS_LOAD, NULL, load_usage, 0, true, false }
-};
-
-
-const char UsageDefaultName[] = "testld";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [Options]\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Test for dynamic loading.\n"
-                    "\n", progname);
-}
-
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    OUTMSG (("Options\n"));
-
-    HelpOptionLine (ALIAS_LOAD, OPTION_LOAD, "Path", load_usage);
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, MyOptions, sizeof MyOptions / sizeof (OptDef));
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse arguments");
-
-    else
-    {
-        do
-        {
-            KDyld *dl;
-            uint32_t num_libs;
-
-            rc = ArgsParamCount (args, &num_libs);
-            if (rc)
-            {
-                LOGERR ( klogInt, rc, "Failure to count parameters" );
-                break;
-            }
-
-            if (num_libs == 0)
-            {
-                rc = MiniUsage(args);
-                break;
-            }
-
-            /* create loader */
-            rc = KDyldMake (&dl);
-            if (rc)
-            {
-                LOGERR ( klogInt, rc, "failed to create dynamic loader" );
-                break;
-            }
-            else
-            {
-                do
-                {
-                    KDlset *libs;
-                    const char * path;
-                    uint32_t ix;
-                    uint32_t num_paths;
-
-                    rc = ArgsOptionCount (args, OPTION_LOAD, &num_paths);
-                    if (rc)
-                    {
-                        LOGERR (klogInt, rc, "failed to count paths");
-                        break;
-                    }
-
-                    for (ix = 0; ix < num_paths; ix++)
-                    {
-
-                        rc = ArgsOptionValue (args, OPTION_LOAD, ix, &path);
-                        if (rc)
-                        {
-                            LOGERR (klogInt, rc, "failed to access a path option");
-                            break;
-                        }
-                        testld_update_libpath (dl, path);
-                    }
-                    if (rc)
-                        break;
-
-                    /* append contents of LD_LIBRARY_PATH */
-                    path = getenv ( "LD_LIBRARY_PATH" );
-
-                    if (path)
-                        testld_update_libpath (dl, path);
-
-                    /* create libset */
-                    rc = KDyldMakeSet (dl, & libs);
-                    if (rc)
-                    {
-                        LOGERR (klogInt, rc, "failed to create dl library set");
-                        break;
-                    }
-                    else
-                    {
-                        /* test it */
-                        for (ix = 0; ix < num_libs; ++ ix )
-                        {
-                            rc = ArgsParamValue (args, ix, &path);
-                            if (rc)
-                                break;
-
-                            testld_load_library (dl, libs, path);
-                        }
-
-                        KDlsetRelease ( libs );
-                    }
-                } while (0);
-
-                KDyldRelease ( dl );
-            }
-
-        } while (0);
-
-        ArgsWhack (args);
-    }
-    return rc;
-}
diff --git a/tools/util/testld.vers b/tools/util/testld.vers
deleted file mode 100644
index f90b1af..0000000
--- a/tools/util/testld.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.2
diff --git a/tools/util/txt2kdb.c b/tools/util/txt2kdb.c
deleted file mode 100644
index d8daad9..0000000
--- a/tools/util/txt2kdb.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <kapp/args.h>
-
-#include <klib/defs.h>
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kdb/manager.h>
-#include <kdb/column.h>
-#include <kapp/main.h>
-
-const char UsageDefaultName[] = "txt2kdb";
-
-rc_t CC UsageSummary (const char * progname)
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s [Options] <File> <Column>\n"
-                    "\n"
-                    "Summary:\n"
-                    "  Create a physical database column from a text file.\n"
-                    "\n", progname);
-}
-
-#define OPTION_APPEND "append"
-#define OPTION_FORCE  "force"
-#define OPTION_BEGIN  "begin"
-#define OPTION_END    "end"
-#define ALIAS_APPEND  "a"
-#define ALIAS_FORCE   "f"
-#define ALIAS_BEGIN   "b"
-#define ALIAS_END     "e"
-
-static const char * append_usage[] =
-{
-    "(no parameter) this will cause to append the",
-    "text file to an existing KColumn.  If the",
-    "file does not already exist it will be",
-    "created.", 
-    NULL
-};
-static const char * force_usage [] =
-{
-    "(no parameter) this will cause to over-write",
-    "existing files.  Without this option the",
-    "program will fail if the KColumn already",
-    "exists and append mode is not selected",
-    NULL
-};
-static const char * begin_usage [] = 
-{
-    "Begin include only lines starting from this",
-    "line in the column.  The first line is line",
-    "1 (not 0).",
-    NULL
-};
-static const char * end_usage   [] =
-{
-    "Stop including lines after this line in the",
-    "column.  The first line is line 1 (not 0).",
-    NULL
-};
-
-
-OptDef Options[] = 
-{
-    { OPTION_APPEND, ALIAS_APPEND, NULL, append_usage, 0, false, false },
-    { OPTION_FORCE,  ALIAS_FORCE,  NULL, force_usage,  0, false, false },
-    { OPTION_BEGIN,  ALIAS_BEGIN,  NULL, begin_usage,  1, true,  false },
-    { OPTION_END,    ALIAS_END,    NULL, end_usage,    1, true,  false }
-};
-
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    UsageSummary (progname);
-
-    OUTMSG (("File:\n"
-             "  The text file should be ASCII or UTF-8 using LF, CR or CR-LF\n"
-             "  line termination.  Each text line will be put into the\n"
-             "  KColumn as a separate Row.  Each Row will be in its own\n"
-             "  blob.\n"
-             "\n"
-             "Column:\n"
-             "  The KColumn is either an existing KColumn or a path to one\n"
-             "  that can be created.\n"
-                 "\n"
-             "  Both paths should be relative to the current directory or full\n"
-             "  from root \n"
-             "\n"
-             "Options:\n"));
-
-    HelpOptionLine (ALIAS_BEGIN, OPTION_BEGIN, "Start", begin_usage);
-
-    HelpOptionLine (ALIAS_END, OPTION_END, "Stop", end_usage);
-
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage);
-
-    HelpOptionLine (ALIAS_APPEND, OPTION_APPEND, NULL, append_usage);
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-struct txt2kdbglobals
-{
-    uint64_t     begin;
-    uint64_t     end;
-
-    KDirectory * dir;
-    const KFile * txt;
-    KDBManager * mgr;
-    KColumn * col;
-    const char * txtpath;
-    const char * colpath;
-
-    bool force;
-    bool append;
-    bool begin_seen;
-    bool end_seen;
-} G;
-
-ver_t CC KAppVersion (void)
-{
-    return  0;
-}
-
-void txt2kdb_release (void)
-{
-    KDirectoryRelease (G.dir);
-    KFileRelease (G.txt);
-    KDBManagerRelease (G.mgr);
-    KColumnRelease (G.col);
-}
-
-rc_t txt2kdb_kfs (void)
-{
-    rc_t rc;
-
-    G.dir = NULL;
-    G.txt = NULL;
-    G.mgr = NULL;
-    G.col = NULL;
-
-    /* -----
-     * Mount the native filesystem as root
-     */
-    rc = KDirectoryNativeDir (&G.dir);
-    if (rc != 0)
-    {
-        G.dir = NULL;
-	LOGMSG (klogFatal, "Failed to open native KDirectory");
-    }
-    else
-    {
-        rc = KDirectoryOpenFileRead (G.dir, &G.txt, G.txtpath);
-        if (rc != 0)
-        {
-            G.txt = NULL;
-            PLOGERR (klogFatal, (klogFatal, rc, "Unable to open file at $(F)", PLOG_S(F), G.txtpath));
-        }
-        else
-        {
-            rc = KDBManagerMakeUpdate (&G.mgr, G.dir);
-            if (rc)
-            {
-                G.mgr = NULL;
-                LOGERR (klogFatal, rc, "Unable to create a KDBManager at the current directory");
-            }
-            else
-            {
-                KCreateMode kcm;
-                KPathType kpt;
-                const char * err = "";
-
-                kpt = KDirectoryPathType (G.dir, G.colpath) & ~ kptAlias;
-                kcm = kcmCreate;
-/* Force means replace if exists */
-/* Append means open in append mode if it exists */
-                switch (kpt)
-                {
-                case kptNotFound:
-                    kcm = kcmCreate;
-                    break;
-
-                default:
-                    err = "Unknown";
-                    rc = RC (rcExe, rcNoTarg, rcAccessing, rcPath, rcInvalid);
-                    break;
-
-                case kptBadPath:
-                    err = "Bad Path";
-                    rc = RC (rcExe, rcNoTarg, rcAccessing, rcPath, rcInvalid);
-                    break;
-
-                case kptFile:
-                case kptCharDev:
-                case kptBlockDev:
-                case kptFIFO:
-                    err = "Must be a Directory";
-                    rc = RC (rcExe, rcNoTarg, rcAccessing, rcPath, rcInvalid);
-                    break;
-
-                case kptDir:
-                    kcm = kcmCreate;
-
-                    if (G.append)
-                    {
-                        kcm = kcmOpen;
-                    }
-                    else if (G.force)
-                    {
-                        kcm = kcmInit;
-                    }
-                    break;
-                }
-                if (rc == 0)
-                {
-                    rc = KDBManagerCreateColumn (G.mgr, &G.col, kcm, kcsNone, 0, G.colpath);
-                    if (rc)
-                        err = "Manager can not open column";
-                }
-                if (rc)
-                {
-                    PLOGERR (klogFatal, (klogFatal, rc, "Cannot open KColumn $(P) because $(R)", PLOG_2(PLOG_S(P),PLOG_S(R)),
-                                         G.colpath, err));
-                }                
-            }
-        }
-    }
-    return rc;
-}
-
-/* If the begin parameter was set check if the rowid is equal or above it */
-bool rowid_lower_range (uint64_t rowid)
-{
-    if (G.begin_seen && (rowid < G.begin))
-        return false;
-    return true;
-}
-
-/* If the end parameter was set check if the rowid is equal or below it */
-bool rowid_upper_range (uint64_t rowid)
-{
-    if (G.end_seen && (rowid > G.end))
-        return false;
-    return true;
-}
-rc_t txt2kdb_io()
-{
-    rc_t rc = 0;
-    uint64_t rowid = 1;
-    uint64_t tix = 0;
-    KColumnBlob * blob;
-    bool blobopen = false;
-
-    while (rc == 0)
-    {
-        size_t num_read;
-        uint8_t buffer  [4096];
-        uint8_t * limit;
-        uint8_t * append_start = buffer;
-        uint8_t * cursor = buffer;
-        bool eol = true;
-
-        /* quit if we are already past the end of the range */
-        if ( ! rowid_upper_range(rowid))
-            break;
-
-        /* read a buffer full.  It may straddle rows. */
-        rc = KFileRead (G.txt, tix, buffer, sizeof buffer, &num_read);
-        if (rc)
-        {
-            PLOGERR (klogFatal, (klogFatal, rc, "Read failed starting $(P)", PLOG_U64(P), tix));
-            break;
-        }
-        /* break at EOF */
-        if (num_read == 0)
-            break;
-
-        /* scan across the buffer looking for lines */
-        for (limit = buffer + num_read; cursor < limit; append_start = cursor)
-        {
-            /* if we are at the beginning of a line (end of previous line or start of first */
-            if (eol)
-            {
-                /* if we are within the pass thru range create a blob */
-                if (rowid_lower_range(rowid) && rowid_upper_range(rowid))
-                {
-                    rc = KColumnCreateBlob (G.col, &blob);
-                    if (rc)
-                    {
-                        PLOGERR (klogFatal, (klogFatal, rc, "Failed to create Blob for row $(R) at $(P)",
-                                             PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-                        continue;
-                    }
-                    blobopen = true;
-                }
-                /* clear the flag */
-                eol = false;
-            }
-
-            /* this blob append will go until end of buffer or end of line */
-            for ( ; cursor < limit; ++ cursor, ++tix)
-            {
-                /* if we hit a NewLine flag it and break for append */
-                if (*cursor == '\n')
-                {
-                    eol = true;
-                    ++cursor;
-                    ++tix;
-                    break;
-                }
-            }
-
-            /* if we are within the selected range append this to the open blob 
-             * ir might be the first append, a middle append, a last append or only append */
-            if (blobopen)
-            {
-                rc = KColumnBlobAppend (blob, append_start, cursor - append_start);
-                if (rc)
-                {
-                    PLOGERR (klogFatal, (klogFatal, rc, "Failed to append Blob for row $(R) at $(P)",
-                                         PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-
-                    break;
-                }
-            }
-            /* if we hit a NewLine and are within range we will close this blob */
-            if (eol)
-            {
-                if (blobopen)
-                {
-                    /* single row blobs */
-                    rc = KColumnBlobAssignRange (blob, rowid, 1);
-                    if (rc)
-                    {
-                        PLOGERR (klogFatal, (klogFatal, rc, "Failed to range assign blob for row $(R) at $(P)",
-                                             PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-                        break;
-                    }
-                    rc = KColumnBlobCommit (blob);
-                    if (rc)
-                    {
-                        PLOGERR (klogFatal, (klogFatal, rc, "Failed to commit blob for row $(R) at $(P)",
-                                             PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-                        break;
-                    }
-                    rc = KColumnBlobRelease (blob);
-                    if (rc)
-                    {
-                        PLOGERR (klogFatal, (klogFatal, rc, "Failed to release blob for row $(R) at $(P)",
-                                             PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-                        break;
-                    }
-                    blobopen = false;
-                }
-                ++rowid;
-                if ( ! rowid_upper_range (rowid))
-                    break;
-            }
-        }       
-    }
-    
-    /* if not in an error state and the last line was unterminated close the blob */
-    if ((rc == 0) && blobopen)
-    {
-        rc = KColumnBlobAssignRange (blob, rowid, 1);
-        if (rc)
-        {
-            PLOGERR (klogFatal, (klogFatal, rc, "Failed to range assign blob for row $(R) at $(P)",
-                                 PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-        }
-        else
-        {
-            rc = KColumnBlobCommit (blob);
-            if (rc)
-            {
-                PLOGERR (klogFatal, (klogFatal, rc, "Failed to commit blob for row $(R) at $(P)",
-                                     PLOG_2(PLOG_U64(R),PLOG_U64(P)), rowid, tix));
-            }
-        }
-        KColumnBlobRelease (blob);
-    }
-    return rc;
-}
-
-void CC ascii_to_u64_error_handler ( const char * arg, void * data )
-{
-    rc_t * prc = data;
-    rc_t rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcIncorrect);
-
-
-    PLOGERR (klogFatal, (klogFatal, rc, "numeric range option unparsable $(S)", PLOG_S(S), arg));
-    *prc = rc;
-}
-
-rc_t CC NextLogLevelCommon ( const char * level_parameter );
-
-rc_t CC KMain (int argc, char *argv [])
-{
-    Args * args;
-    rc_t   rc;
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options, sizeof Options / sizeof (OptDef));
-    if (rc == 0)
-    {
-        do 
-        {
-            uint32_t pcount;
-
-            rc = ArgsParamCount (args, &pcount);
-            if (rc)
-                break;
-
-            switch (pcount)
-            {
-            case 0:
-                MiniUsage (args);
-                rc = 1;
-                break;
-
-            case 1:
-                rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcNotFound);
-                LOGERR (klogFatal, rc, "Missing KColumn path");
-                MiniUsage (args);
-                break;
-
-            default:
-                rc = RC (rcExe, rcNoTarg, rcParsing, rcParam, rcExcessive);
-                LOGERR (klogFatal, rc, "Too many parameters");
-                MiniUsage (args);
-                break;
-
-            case 2:
-                break;
-            }
-            if (rc)
-            {
-                if (rc == 1)
-                    rc = 0;
-                break;
-            }
-
-            rc = ArgsParamValue (args, 0, &G.txtpath);
-            if (rc)
-                break;
-
-            rc = ArgsParamValue (args, 1, &G.colpath);
-            if (rc)
-                break;
-
-            rc = ArgsOptionCount (args, OPTION_BEGIN, &pcount);
-            if (rc)
-                break;
-
-            if (pcount != 1)
-                G.begin_seen = false;
-            else
-            {
-                const char * pc;
-
-                rc = ArgsOptionValue (args, OPTION_BEGIN, 0, &pc);
-                if (rc)
-                    break;
-
-                G.begin = AsciiToU64 ( pc, ascii_to_u64_error_handler, &rc );
-
-                if (rc)
-                    break;
-                G.begin_seen = true;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_END, &pcount);
-            if (rc)
-                break;
-
-            if (pcount != 1)
-                G.end_seen = false;
-            else
-            {
-                const char * pc;
-
-                rc = ArgsOptionValue (args, OPTION_END, 0, &pc);
-                if (rc)
-                    break;
-
-                G.end = AsciiToU64 (pc, ascii_to_u64_error_handler, &rc);
-                if (rc)
-                    break;
-
-                G.end_seen = true;
-            }
-
-
-            if (G.begin_seen && G.end_seen && (G.end < G.begin))
-            {
-                rc = RC (rcExe, rcNoTarg, rcAccessing, rcParam, rcInvalid);
-                LOGERR (klogFatal, rc, "Conflicting options end before begin");
-                break;
-            }
-
-            rc = ArgsOptionCount (args, OPTION_FORCE, &pcount);
-            if (rc)
-                break;
-
-            G.force = (pcount != 0);
-
-            rc = ArgsOptionCount (args, OPTION_APPEND, &pcount);
-            if (rc)
-                break;
-
-            G.append = (pcount != 0);
-
-            if (G.force && G.append)
-            {
-                rc = RC (rcExe, rcNoTarg, rcAccessing, rcParam, rcInvalid);
-                LOGERR (klogFatal, rc, "Conflicting options force and append");
-                break;
-            }
-
-            /* handle the KFS interface */
-            rc = txt2kdb_kfs();
-
-            if (rc == 0)
-                rc = txt2kdb_io();
-
-            txt2kdb_release();
-
-
-        } while (0);
-        ArgsWhack (args);
-    }
-
-    STSMSG (1, ("exit txt2kdb %R\n", rc));
-    return rc;
-}
-
-
-/* end of file */
diff --git a/tools/util/txt2kdb.vers b/tools/util/txt2kdb.vers
deleted file mode 100644
index f90b1af..0000000
--- a/tools/util/txt2kdb.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.2
diff --git a/tools/util/unix/syspass.c b/tools/util/unix/syspass.c
deleted file mode 100644
index b464f39..0000000
--- a/tools/util/unix/syspass.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#define __EXTENSIONS__ 1
-
-#include "syspass-priv.h" /* get_pass */
-
-#include <klib/rc.h>
-
-#include <string.h> /* strdup */
-
-#include <stdlib.h>
-#include <unistd.h> /* getpass */
-
-rc_t get_pass(const char *prompt, char *buf, size_t bufsiz) {
-    if (prompt == NULL || buf == NULL) {
-        return RC(rcExe, rcFunction, rcEvaluating, rcParam, rcNull);
-    }
-
-    if (bufsiz == 0)
-    {   return 0; }
-
-    buf[0] = '\0';
-
-    {
-        const char *p = getpass(prompt);
-
-        if (p == NULL) {
-            return RC(rcExe, rcString, rcReading, rcFunction, rcFailed);
-        }
-        else if ((strlen(p) + 1) > bufsiz) {
-            return RC(rcExe, rcString, rcReading, rcBuffer, rcInsufficient);
-        }
-
-        strcpy(buf, p);
-
-        return 0;
-    }
-}
diff --git a/tools/util/vdb-lock.c b/tools/util/vdb-lock.c
deleted file mode 100644
index 2c82a18..0000000
--- a/tools/util/vdb-lock.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-lock.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <sra/srapath.h>
-#include <vdb/manager.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-#include <assert.h>
-
-
-ver_t CC KAppVersion ( void )
-{
-    return VDB_LOCK_VERS;
-}
-
-const char UsageDefaultName[] = "vdb-lock";
-
-rc_t CC UsageSummary ( const char *progname )
-{
-    return KOutMsg ( "\n"
-                     "Usage:\n"
-                     "  %s [Options] <target>\n"
-                     "\n"
-                     "Summary:\n"
-                     "  Lock a VDB database, table or column.\n"
-                     , progname
-        );
-}
-
-rc_t CC Usage ( const Args *args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionsStandard ();
-    HelpVersion ( fullpath, KAppVersion () );
-
-    return rc;
-}
-
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args *args;
-    rc_t rc = ArgsMakeAndHandle ( & args, argc, argv, 0 );
-    if ( rc != 0 )
-        LogErr ( klogErr, rc, "failed to parse arguments" );
-    else
-    {
-        uint32_t paramc;
-        rc = ArgsParamCount ( args, & paramc );
-        if ( rc != 0 )
-            LogErr ( klogInt, rc, "failed to obtain param count" );
-        else
-        {
-            if ( paramc == 0 )
-            {
-                rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-                LogErr ( klogErr, rc, "missing target object" );
-                MiniUsage ( args );
-            }
-            else if ( paramc > 1 )
-            {
-                rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcExcessive );
-                LogErr ( klogErr, rc, "expected single target object" );
-                MiniUsage ( args );
-            }
-            else
-            {
-                const char *target;
-                rc = ArgsParamValue ( args, 0, & target );
-                if ( rc != 0 )
-                    LogErr ( klogInt, rc, "failed to obtain param value" );
-                else
-                {
-                    VDBManager *mgr;
-
-#if TOOLS_USE_SRAPATH != 0
-                    char full [ 4096 ];
-                    SRAPath *sra_path;
-                    rc = SRAPathMake ( & sra_path, NULL );
-                    if ( rc == 0 )
-                    {
-                        if ( ! SRAPathTest ( sra_path, target ) )
-                        {
-                            rc = SRAPathFind ( sra_path, target, full, sizeof full );
-                            if ( rc == 0 )
-                                target = full;
-                        }
-                        SRAPathRelease ( sra_path );
-                    }
-#endif
-
-                    rc = VDBManagerMakeUpdate ( & mgr, NULL );
-                    if ( rc != 0 )
-                        LogErr ( klogInt, rc, "failed to open VDB manager" );
-                    else
-                    {
-                        rc = VDBManagerLock ( mgr, target );
-                        if ( rc == 0 )
-                            pLogMsg ( klogInfo, "locked '$(target)'", "target=%s", target );
-                        else switch ( GetRCState ( rc ) )
-                        {
-                        case rcLocked:
-                            pLogMsg ( klogInfo, "'$(target)' was already locked", "target=%s", target );
-                            break;
-                        default:
-                            pLogErr ( klogErr, rc, "failed to lock '$(target)'", "target=%s", target );
-                        }
-
-                        VDBManagerRelease ( mgr );
-                    }
-                }
-            }
-        }
-
-        ArgsWhack ( args );
-    }
-
-    return rc;
-}
diff --git a/tools/util/vdb-lock.vers b/tools/util/vdb-lock.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/vdb-lock.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/vdb-passwd.c b/tools/util/vdb-passwd.c
deleted file mode 100644
index cdecedb..0000000
--- a/tools/util/vdb-passwd.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-passwd.vers.h" /* VDB_PASSWD_VERS */
-
-#include "syspass-priv.h" /* get_pass */
-
-#include <kapp/main.h> /* KMain */
-
-#include <vfs/manager.h> /* VFSManager */
-#include <klib/log.h> /* LOGERR */
-#include <klib/out.h> /* OUTMSG */
-#include <klib/rc.h>
-
-#include <string.h> /* strcmp */
-#include <assert.h>
-#include <limits.h> /* PATH_MAX */
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define DISP_RC(rc, msg) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, msg))
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-/******************************************************************************/
-static
-rc_t SetPwd(const char *password, bool no_prompt)
-{
-    rc_t rc = 0;
-
-    VFSManager *mgr = NULL;
-
-    assert(password);
-
-    if (rc == 0) {
-        rc = VFSManagerMake(&mgr);
-        DISP_RC(rc, "while calling VFSManagerMake");
-    }
-
-    if (rc == 0) {
-        char pwd_dir[PATH_MAX] = "";
-        rc = VFSManagerUpdateKryptoPassword
-            (mgr, password, strlen(password), pwd_dir, sizeof pwd_dir);
-        if (rc) {
-            if (no_prompt) {
-                LOGERR(klogInt, rc, "while updating the password");
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                            rcDirectory, rcExcessive))
-            {
-                OUTMSG((
-                    "\nSecurity warning:\n"
-                    "Directory \"%s\" has excessive access permissions.\n"
-                    "Run \"chmod 700 %s\" to repair\n"
-                    "or ask your system administrator for assistance.\n",
-                    pwd_dir, pwd_dir));
-                rc = 0;
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                rcSize, rcExcessive))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Password is too long.\n"
-                    "Maximum password size is %ld.\n",
-                    VFS_KRYPTO_PASSWORD_MAX_SIZE));
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                rcEncryptionKey, rcInvalid))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Invalid character in password\n"
-                    "(CR/LF are not allowed)\n"));
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                rcPath, rcExcessive))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Cannot set the password.\n"
-                    "Path to password file is too long.\n"
-                    "Your configuration should be updated.\n"));
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                rcPath, rcIncorrect))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Cannot set the password.\n"
-                    "Existing path to password is not a file.\n"
-                    "Your configuration should be updated.\n"));
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcUpdating,
-                rcPath, rcCorrupt))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Cannot set the password.\n"
-                    "Unknown file type for configured path/file name.\n"
-                    "Your configuration should be updated.\n"));
-            }
-            else if (rc == SILENT_RC(rcVFS, rcEncryptionKey, rcWriting,
-                rcFile, rcInsufficient))
-            {
-                OUTMSG((
-                    "\nError:\n"
-                    "Incomplete writes to temporary password file.\n"
-                    "Cannot set the password.\n"));
-            }
-            else {
-                OUTMSG(("\nCannot set the password. Please run "
-                 "\"perl configuration-assistant.perl\" and try again.\n"));
-            }
-        }
-    }
-
-    RELEASE(VFSManager, mgr);
-
-    return rc;
-}
-
-#define PWD_SZ 1024
-
-static
-rc_t run(bool quiet)
-{
-    rc_t rc = 0;
-
-    char password[PWD_SZ] = "";
-
-    bool empty = false;
-
-    KWrtHandler handler;
-    handler.writer = KOutWriterGet();
-    handler.data = KOutDataGet();
-
-    KOutHandlerSetStdErr();
-    KLogLibHandlerSet(NULL, NULL);
-
-    OUTMSG(("Changing password\n"));
-
-#if 1
-    if (rc == 0) {
-        int i = 0;
-        for (i = 0; i < 3 && rc == 0; ++i) {
-            rc = get_pass("New password:", password, sizeof password);
-            DISP_RC(rc, "cannot read the password");
-            if (rc != 0) {
-                break;
-            }
-            if (password[0] == '\0') {
-                OUTMSG(("BAD PASSWORD: too short\n"));
-            }
-            else {
-                break;
-            }
-        }
-        if (rc == 0 && password[0] == '\0') {
-            rc = RC(rcExe, rcString, rcReading, rcString, rcIncorrect);
-            empty = true;
-         /* LOGERR(klogErr, rc, "failed to set password"); */
-        }
-    }
-
-    if (rc == 0) {
-        char repassword[PWD_SZ] = "";
-        rc = get_pass("Retype new password:", repassword, sizeof repassword);
-        DISP_RC(rc, "cannot read the password");
-        if (rc == 0) {
-            if (strcmp(password, repassword)) {
-                OUTMSG(("Sorry, passwords do not match.\n"));
-                rc = RC(rcExe, rcString, rcReading, rcString, rcInconsistent);
-             /* LOGERR(klogErr, rc, "failed to set password"); */
-            }
-        }
-    }
-
-#else
-    strcpy(password, "1n2");
-#endif
-
-    if (rc == 0) {
-        rc = SetPwd(password, quiet);
-    }
-
-    KOutHandlerSet(handler.writer, handler.data);
-
-    if (empty)
-    {   rc = 0; }
-
-    return rc;
-}
-
-#define SL_OPTION "noprompt"
-#define SL_ALIAS "n"
-static const char *SL_USAGE[]
-    = { "Do not suggest running configuration-assistant", NULL };
-
-OptDef Options[] = { { SL_OPTION, SL_ALIAS, NULL, SL_USAGE, 1, false, false } };
-
-const char UsageDefaultName[] = "vdb-passwd";
-
-rc_t CC UsageSummary(const char *progname) {
-    KOutMsg("Update user's NCBI VDB crypto password\n"
-            "If not run with --quiet recommendations\n"
-            "are given if errors are detected.\n"
-            "\n");
-
-    return 0;
-}
-
-rc_t CC Usage(const Args *args) {
-    UsageSummary(UsageDefaultName);
-
-    KOutMsg("Options:\n");
-    HelpOptionsStandard ();
-
-    HelpVersion(UsageDefaultName, KAppVersion());
-
-    return 0;
-}
-
-ver_t CC KAppVersion(void) { return VDB_PASSWD_VERS; }
-
-rc_t CC KMain(int argc, char *argv[]) {
-    Args *args;
-    rc_t rc; /*, orc; */
-
-    rc = ArgsMakeAndHandle(&args, argc, argv, 0);
-    if (rc == 0)
-    {
-        uint32_t pcount;
-        rc_t orc;
-
-        /* non standard use of --quiet */
-        rc = ArgsOptionCount(args, OPTION_QUIET, &pcount);
-        if (rc)
-            LOGERR(klogErr, rc, "error check " OPTION_QUIET " option");
-
-        else
-            rc = run (pcount != 0);
-
-        orc = ArgsWhack(args);
-        if (rc == 0)
-            rc = orc;
-    }
-
-    return rc;
-}
diff --git a/tools/util/vdb-passwd.vers b/tools/util/vdb-passwd.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/vdb-passwd.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/vdb-unlock.c b/tools/util/vdb-unlock.c
deleted file mode 100644
index cdcba36..0000000
--- a/tools/util/vdb-unlock.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-unlock.vers.h"
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-#include <sra/srapath.h>
-#include <vdb/manager.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/rc.h>
-
-#include <assert.h>
-
-
-ver_t CC KAppVersion ( void )
-{
-    return VDB_UNLOCK_VERS;
-}
-
-const char UsageDefaultName[] = "vdb-unlock";
-
-rc_t CC UsageSummary ( const char *progname )
-{
-    return KOutMsg ( "\n"
-                     "Usage:\n"
-                     "  %s [Options] <target>\n"
-                     "\n"
-                     "Summary:\n"
-                     "  Unlock a VDB database, table or column.\n"
-                     , progname
-        );
-}
-
-rc_t CC Usage ( const Args *args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args *args;
-    rc_t rc = ArgsMakeAndHandle ( & args, argc, argv, 0 );
-    if ( rc != 0 )
-        LogErr ( klogErr, rc, "failed to parse arguments" );
-    else
-    {
-        uint32_t paramc;
-        rc = ArgsParamCount ( args, & paramc );
-        if ( rc != 0 )
-            LogErr ( klogInt, rc, "failed to obtain param count" );
-        else
-        {
-            if ( paramc == 0 )
-            {
-                rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcInsufficient );
-                LogErr ( klogErr, rc, "missing target object" );
-                MiniUsage ( args );
-            }
-            else if ( paramc > 1 )
-            {
-                rc = RC ( rcExe, rcArgv, rcParsing, rcParam, rcExcessive );
-                LogErr ( klogErr, rc, "expected single target object" );
-                MiniUsage ( args );
-            }
-            else
-            {
-                const char *target;
-                rc = ArgsParamValue ( args, 0, & target );
-                if ( rc != 0 )
-                    LogErr ( klogInt, rc, "failed to obtain param value" );
-                else
-                {
-                    VDBManager *mgr;
-
-#if TOOLS_USE_SRAPATH != 0
-                    char full [ 4096 ];
-                    SRAPath *sra_path;
-                    rc = SRAPathMake ( & sra_path, NULL );
-                    if ( rc == 0 )
-                    {
-                        if ( ! SRAPathTest ( sra_path, target ) )
-                        {
-                            rc = SRAPathFind ( sra_path, target, full, sizeof full );
-                            if ( rc == 0 )
-                                target = full;
-                        }
-                        SRAPathRelease ( sra_path );
-                    }
-#endif
-
-                    rc = VDBManagerMakeUpdate ( & mgr, NULL );
-                    if ( rc != 0 )
-                        LogErr ( klogInt, rc, "failed to open VDB manager" );
-                    else
-                    {
-                        rc = VDBManagerUnlock ( mgr, target );
-                        if ( rc == 0 )
-                            pLogMsg ( klogInfo, "unlocked '$(target)'", "target=%s", target );
-                        else switch ( GetRCState ( rc ) )
-                        {
-                        case rcUnlocked:
-                            pLogMsg ( klogInfo, "'$(target)' was already unlocked", "target=%s", target );
-                            break;
-                        default:
-                            pLogErr ( klogErr, rc, "failed to unlock '$(target)'", "target=%s", target );
-                        }
-
-                        VDBManagerRelease ( mgr );
-                    }
-                }
-            }
-        }
-
-        ArgsWhack ( args );
-    }
-
-    return rc;
-}
diff --git a/tools/util/vdb-unlock.vers b/tools/util/vdb-unlock.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/util/vdb-unlock.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/util/win/syspass.c b/tools/util/win/syspass.c
deleted file mode 100644
index 745b0cc..0000000
--- a/tools/util/win/syspass.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "syspass-priv.h" /* get_pass */
-
-#include <klib/rc.h>
-
-#include <conio.h> /* _getch */
-#include <stdio.h>
-
-rc_t get_pass(const char *prompt, char *buf, size_t bufsiz) {
-    if (prompt == NULL || buf == NULL) {
-        return RC(rcExe, rcFunction, rcEvaluating, rcParam, rcNull);
-    }
-
-    fprintf(stderr, "%s", prompt);
-
-    {
-        size_t i = 0;
-        for (i = 0; i < bufsiz; ++i) {
-            buf[i] = _getch();
-            if (buf[i] == '\r') {
-                fprintf(stderr, "\r\n");
-                buf[i] = '\0';
-                return 0;
-            }
-        }
-        return RC(rcExe, rcString, rcReading, rcBuffer, rcInsufficient);
-    }
-}
diff --git a/tools/vdb-config/Makefile b/tools/vdb-config/Makefile
deleted file mode 100644
index 5b5a192..0000000
--- a/tools/vdb-config/Makefile
+++ /dev/null
@@ -1,102 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/vdb-config
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	vdb-config
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# tag
-#
-tag: \
-	$(addsuffix _tag,$(ALL_TOOLS))
-
-.PHONY: tag $(addsuffix _tag,$(ALL_TOOLS))
-
-#-------------------------------------------------------------------------------
-# vdb-config
-#
-VDB_CONFIG_SRC = \
-	vdb-config
-
-VDB_CONFIG_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_CONFIG_SRC))
-
-VDB_CONFIG_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/vdb-config: $(VDB_CONFIG_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_CONFIG_LIB)
-
-vdb_config_tag:
-	@ $(TOP)/build/tag-module.sh $(MODULE) vdb-config $(VDB_CONFIG_OBJ)
diff --git a/tools/vdb-config/vdb-config.c b/tools/vdb-config/vdb-config.c
deleted file mode 100644
index 7d4b8a4..0000000
--- a/tools/vdb-config/vdb-config.c
+++ /dev/null
@@ -1,1138 +0,0 @@
-/*==============================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-config.vers.h"
-
-#include <kapp/main.h>
-
-#include <vdb/vdb-priv.h> /* VDBManagerListExternalSchemaModules */
-#include <vdb/manager.h> /* VDBManager */
-
-#include <kfg/kfg-priv.h> /* KConfig */
-
-#include <vfs/path-priv.h> /* KPathGetCWD */
-#include <kfs/directory.h>
-#include <kfs/file.h>
-#include <kfs/impl.h> /* KDirectoryGetSysDir */
-#include <kfs/kfs-priv.h> /* KSysDirOSPath */
-
-#include <klib/log.h> /* LOGERR */
-#include <klib/namelist.h>
-#include <klib/out.h> /* OUTMSG */
-#include <klib/printf.h> /* string_printf */
-#include <klib/rc.h> /* RC */
-#include <klib/text.h> /* strcase_cmp */
-
-#include <sysalloc.h> /* redefine malloc etc calls */
-#include <os-native.h> /* SHLX */
-
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h> /* scanf */
-#include <stdlib.h> /* getenv */
-#include <string.h> /* memset */
-/* #include <unistd.h> access */
-
-#include <limits.h> /* PATH_MAX */
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#define DISP_RC(rc, msg) (void)((rc == 0) ? 0 : LOGERR(klogInt, rc, msg))
-#define DISP_RC2(rc, name, msg) (void)((rc == 0) ? 0 : \
-    PLOGERR(klogInt, (klogInt, rc, \
-        "$(name): $(msg)", "name=%s,msg=%s", name, msg)))
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 && !rc) { rc = rc2; } obj = NULL; } while (false)
-
-#define ALIAS_ALL    "a"
-#define OPTION_ALL   "all"
-static const char* USAGE_ALL[] = { "print all information [default]", NULL };
-
-#define ALIAS_NEW    "c"
-#define OPTION_NEW   "create"
-static const char* USAGE_NEW[] = { "create configuration file", NULL };
-
-#define ALIAS_DIR    "d"
-#define OPTION_DIR   "load-path"
-static const char* USAGE_DIR[] = { "print load path", NULL };
-
-#define ALIAS_ENV    "e"
-#define OPTION_ENV   "env"
-static const char* USAGE_ENV[] = { "print shell variables", NULL };
-
-#define ALIAS_FIL    "f"
-#define OPTION_FIL   "files"
-static const char* USAGE_FIL[] = { "print loaded files", NULL };
-
-#define ALIAS_IMP    NULL
-#define OPTION_IMP   "import"
-static const char* USAGE_IMP[] = { "import ngc file", NULL };
-
-#define ALIAS_MOD    "m"
-#define OPTION_MOD   "modules"
-static const char* USAGE_MOD[] = { "print external modules", NULL };
-
-#define ALIAS_OUT    "o"
-#define OPTION_OUT   "output"
-static const char* USAGE_OUT[] = { "output type: one of (x n), "
-    "where 'x' is xml (default), 'n' is native", NULL };
-
-#define ALIAS_CFG    "p"
-#define OPTION_CFG   "cfg"
-static const char* USAGE_CFG[] = { "print current configuration", NULL };
-
-#define ALIAS_SET    "s"
-#define OPTION_SET   "set"
-static const char* USAGE_SET[] = { "set configuration node value", NULL };
-
-OptDef Options[] =
-{                                         /* needs_value, required */
-      { OPTION_ALL, ALIAS_ALL, NULL, USAGE_ALL, 1, false, false }
-    , { OPTION_CFG, ALIAS_CFG, NULL, USAGE_CFG, 1, false, false }
-    , { OPTION_DIR, ALIAS_DIR, NULL, USAGE_DIR, 1, false, false }
-    , { OPTION_ENV, ALIAS_ENV, NULL, USAGE_ENV, 1, false, false }
-    , { OPTION_FIL, ALIAS_FIL, NULL, USAGE_FIL, 1, false, false }
-    , { OPTION_IMP, ALIAS_IMP, NULL, USAGE_IMP, 1, true , false }
-    , { OPTION_MOD, ALIAS_MOD, NULL, USAGE_MOD, 1, false, false }
-    , { OPTION_NEW, ALIAS_NEW, NULL, USAGE_NEW, 1, false, false }
-    , { OPTION_OUT, ALIAS_OUT, NULL, USAGE_OUT, 1, true , false }
-    , { OPTION_SET, ALIAS_SET, NULL, USAGE_SET, 1, true , false }
-};
-
-rc_t CC UsageSummary (const char * progname) {
-    return KOutMsg (
-        "Usage:\n"
-        "  %s [options] [<query> ...]\n"
-        "\n"
-        "Summary:\n"
-        "  Display VDB configuration information\n"
-        "\n", progname);
-}
-
-rc_t CC Usage(const Args* args) { 
-    rc_t rc = 0;
-
-    const char* progname = UsageDefaultName;
-    const char* fullpath = UsageDefaultName;
-
-    if (args == NULL)
-    {    rc = RC(rcExe, rcArgv, rcAccessing, rcSelf, rcNull); }
-    else
-    {    rc = ArgsProgram(args, &fullpath, &progname); }
-
-    UsageSummary(progname);
-
-    KOutMsg ("\nOptions:\n");
-
-    HelpOptionLine (ALIAS_ALL, OPTION_ALL, NULL, USAGE_ALL);
-    HelpOptionLine (ALIAS_CFG, OPTION_CFG, NULL, USAGE_CFG);
-/*  HelpOptionLine (ALIAS_NEW, OPTION_MOD, NULL, USAGE_NEW); */
-    HelpOptionLine (ALIAS_FIL, OPTION_FIL, NULL, USAGE_FIL);
-    HelpOptionLine (ALIAS_ENV, OPTION_ENV, NULL, USAGE_ENV);
-    HelpOptionLine (ALIAS_MOD, OPTION_MOD, NULL, USAGE_MOD);
-    KOutMsg ("\n");
-    HelpOptionLine (ALIAS_SET, OPTION_SET, "name=value", USAGE_SET);
-    KOutMsg ("\n");
-    HelpOptionLine (ALIAS_IMP, OPTION_IMP, "ngc-file", USAGE_IMP);
-    KOutMsg ("\n");
-    HelpOptionLine (ALIAS_OUT, OPTION_OUT, "x | n", USAGE_OUT);
-
-    KOutMsg ("\n");
-
-    HelpOptionsStandard ();
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-const char UsageDefaultName[] = "vdb-config";
-
-ver_t CC KAppVersion(void) { return VDB_CONFIG_VERS; }
-
-static void Indent(bool xml, int n) {
-    if (!xml)
-    {   return; }
-    while (n--)
-    {   OUTMSG(("  ")); }
-}
-
-static rc_t KConfigNodeReadData(const KConfigNode* self,
-    char* buf, size_t blen, size_t* num_read)
-{
-    rc_t rc = 0;
-    size_t remaining = 0;
-    assert(buf && blen && num_read);
-    rc = KConfigNodeRead(self, 0, buf, blen, num_read, &remaining);
-    assert(remaining == 0); /* TODO overflow check */
-    assert(*num_read <= blen);
-    return rc;
-}
-
-#define VDB_CONGIG_OUTMSG(args) do { if (xml) { OUTMSG(args); } } while (false)
-static rc_t KConfigNodePrintChildNames(bool xml, const KConfigNode* self,
-    const char* name, int indent, const char* aFullpath)
-{
-    rc_t rc = 0;
-    uint32_t count = 0;
-    int i = 0;
-    char buffer[512] = "";
-    size_t num_read = 0;
-    bool hasChildren = false;
-    bool hasData = false;
-    const KConfigNode* node = NULL;
-    KNamelist* names = NULL;
-    assert(self && name);
-
-    if (rc == 0)
-    {   rc = KConfigNodeOpenNodeRead(self, &node, name);  }
-    if (rc == 0) {
-        rc = KConfigNodeReadData(node, buffer, sizeof buffer, &num_read);
-        hasData = num_read;
-        if (hasData) {
- /* VDB_CONGIG_OUTMSG(("\n%s = \"%.*s\"\n\n", aFullpath, num_read, buffer)); */
-        }
-    }
-    if (rc == 0)
-    {   rc = KConfigNodeListChild(node, &names); }
-    if (rc == 0) {
-        rc = KNamelistCount(names, &count);
-        hasChildren = count;
-    }
-
-    Indent(xml, indent);
-    VDB_CONGIG_OUTMSG(("<%s", name));
-    if (!hasChildren && !hasData)
-    {   VDB_CONGIG_OUTMSG(("/>\n")); }
-    else
-    {   VDB_CONGIG_OUTMSG((">")); }
-    if (hasData) {
-        if (xml) {
-            VDB_CONGIG_OUTMSG(("%.*s", (int)num_read, buffer));
-        }
-        else {
-            OUTMSG(("%s = \"%.*s\"\n", aFullpath, (uint32_t)num_read, buffer));
-        }
-    }
-    if (hasChildren)
-    {   VDB_CONGIG_OUTMSG(("\n"));}
-
-    if (hasChildren) {
-        for (i = 0; i < count && rc == 0; ++i) {
-            char* fullpath = NULL;
-            const char* name = NULL;
-            rc = KNamelistGet(names, i, &name);
-            if (rc == 0) {
-                fullpath = malloc(strlen(aFullpath) + 1 + strlen(name) + 1);
-                if (fullpath == NULL) {
-                    rc = RC
-                        (rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                }
-                else {
-                    sprintf(fullpath, "%s/%s", aFullpath, name);
-                }
-            }
-            if (rc == 0) {
-                rc = KConfigNodePrintChildNames
-                    (xml, node, name, indent + 1, fullpath);
-            }
-            free(fullpath);
-        }
-    }
-
-    if (hasChildren)
-    {   Indent(xml, indent); }
-    if (hasChildren || hasData)
-    {   VDB_CONGIG_OUTMSG(("</%s>\n",name)); }
-
-    RELEASE(KNamelist, names);
-    RELEASE(KConfigNode, node);
-    return rc;
-}
-
-typedef struct Params {
-    Args* args;
-    uint32_t argsParamIdx;
-    uint32_t argsParamCnt;
-
-    bool xml;
-
-    const char* setValue;
-
-    const char* ngc;
-
-    bool modeSetNode;
-    bool modeCreate;
-    bool modeShowCfg;
-    bool modeShowEnv;
-    bool modeShowFiles;
-    bool modeShowLoadPath;
-    bool modeShowModules;
-
-    bool showMultiple;
-} Params;
-static rc_t ParamsConstruct(int argc, char* argv[], Params* prm) {
-    rc_t rc = 0;
-    Args* args = NULL;
-    int count = 0;
-    assert(argc && argv && prm);
-    memset(prm, 0, sizeof *prm);
-    args = prm->args;
-    do {
-        uint32_t pcount = 0;
-        rc = ArgsMakeAndHandle(&args, argc, argv, 1,
-            Options, sizeof Options / sizeof (OptDef));
-        if (rc) {
-            LOGERR(klogErr, rc, "While calling ArgsMakeAndHandle");
-            break;
-        }
-        prm->args = args;
-        rc = ArgsParamCount(args, &prm->argsParamCnt);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get query parameter[s]");
-            break;
-        }
-        if (prm->argsParamCnt > 0) {
-            prm->modeShowCfg = true;
-            ++count;
-        }
-
-        prm->xml = true;
-        rc = ArgsOptionCount(args, OPTION_OUT, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_OUT "' argument");
-            break;
-        }
-        if (pcount) {
-            const char* dummy = NULL;
-            rc = ArgsOptionValue(args, OPTION_OUT, 0, &dummy);
-            if (rc) {
-                LOGERR(klogErr, rc, "Failure to get '" OPTION_OUT "' argument");
-                break;
-            }
-            if (!strcmp(dummy, "n")) {
-                prm->xml = false;
-            }
-            else if (strcmp(dummy, "x")) {
-                rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-                LOGERR(klogErr, rc, "Bad " OPTION_OUT " value");
-                break;
-            }
-        }
-
-        rc = ArgsOptionCount(args, OPTION_CFG, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_CFG "' argument");
-            break;
-        }
-        if (pcount) {
-            if (!prm->modeShowCfg) {
-                prm->modeShowCfg = true;
-                ++count;
-            }
-        }
-
-        rc = ArgsOptionCount(args, OPTION_ENV, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_ENV "' argument");
-            break;
-        }
-        if (pcount) {
-            prm->modeShowEnv = true;
-            ++count;
-        }
-
-        rc = ArgsOptionCount(args, OPTION_FIL, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_FIL "' argument");
-            break;
-        }
-        if (pcount) {
-            prm->modeShowFiles = true;
-            ++count;
-        }
-
-        rc = ArgsOptionCount(args, OPTION_IMP, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_IMP "' argument");
-            break;
-        }
-        if (pcount) {
-            rc = ArgsOptionValue(args, OPTION_IMP, 0, &prm->ngc);
-            if (rc) {
-                LOGERR(klogErr, rc, "Failure to get '" OPTION_IMP "' argument");
-                break;
-            }
-        }
-
-        rc = ArgsOptionCount(args, OPTION_MOD, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_MOD "' argument");
-            break;
-        }
-        if (pcount) {
-            prm->modeShowModules = true;
-            ++count;
-        }
-
-#if 0
-        rc = ArgsOptionCount(args, OPTION_NEW, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_NEW "' argument");
-            break;
-        }
-        if (pcount) {
-            prm->modeCreate = true;
-            ++count;
-        }
-#endif
-
-        rc = ArgsOptionCount(args, OPTION_DIR, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_DIR "' argument");
-            break;
-        }
-        if (pcount) {
-            prm->modeShowLoadPath = true;
-            ++count;
-        }
-
-        rc = ArgsOptionCount(args, OPTION_SET, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_SET "' argument");
-            break;
-        }
-        if (pcount) {
-            rc = ArgsOptionValue(args, OPTION_SET, 0, &prm->setValue);
-            if (rc == 0) {
-                const char* p = strchr(prm->setValue, '=');
-                if (p == NULL || *(p + 1) == '\0') {
-                    rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-                    LOGERR(klogErr, rc, "Bad " OPTION_SET " value");
-                    break;
-                }
-                prm->modeSetNode = true;
-                prm->modeCreate = prm->modeShowCfg = prm->modeShowEnv
-                    = prm->modeShowFiles = prm->modeShowLoadPath
-                    = prm->modeShowModules = false;
-                count = 1;
-            }
-        }
-
-        rc = ArgsOptionCount(args, OPTION_ALL, &pcount);
-        if (rc) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_ALL "' argument");
-            break;
-        }
-        if (pcount
-            || ( !prm->modeShowCfg && ! prm->modeShowLoadPath
-              && !prm->modeShowEnv && !prm->modeShowFiles
-              && !prm->modeShowModules && !prm->modeCreate
-              && !prm->modeSetNode && !prm->ngc))
-            /* show all by default */
-        {
-            prm->modeShowCfg = prm->modeShowEnv = prm->modeShowFiles = true;
-#ifndef _STATIC
-            prm->modeShowModules = true;
-#endif
-            count += 2;
-        }
-
-        if (count > 1) 
-        {   prm->showMultiple = true; }
-    } while (false);
-
-    return rc;
-}
-
-static rc_t ParamsGetNextParam(Params* prm, const char** param) {
-    rc_t rc = 0;
-    assert(prm && param);
-    *param = NULL;
-    if (prm->argsParamIdx < prm->argsParamCnt) {
-        rc = ArgsParamValue(prm->args, prm->argsParamIdx++, param);
-        if (rc)
-        {   LOGERR(klogErr, rc, "Failure retrieving query"); }
-    }
-    return rc;
-}
-
-static rc_t ParamsDestruct(Params* prm) {
-    rc_t rc = 0;
-    assert(prm);
-    RELEASE(Args, prm->args);
-    return rc;
-}
-
-static
-rc_t privReadStdinLine(char* buf, size_t bsize, bool destroy)
-{
-    rc_t rc = 0;
-    static const KFile* std_in = NULL;
-    static uint64_t pos = 0;
-    size_t num_read = 0;
-    if (destroy) {
-        RELEASE(KFile, std_in);
-        pos = 0;
-        return rc;
-    }
-    if (std_in == NULL) {
-        rc = KFileMakeStdIn(&std_in);
-        if (rc != 0) {
-            DISP_RC(rc, "KFileMakeStdIn");
-            return rc;
-        }
-    }
-    rc = KFileRead(std_in, pos, buf, bsize, &num_read);
-    DISP_RC(rc, "KFileRead");
-    pos += num_read;
-    if (num_read) {
-        bool done = false;
-        buf[num_read] = '\0';
-        while (num_read > 0 && !done) {
-            switch (buf[num_read - 1]) {
-                case '\n':
-                case '\r':
-                    buf[--num_read] = '\0';
-                    break;
-                default:
-                    done = true;
-                    break;
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t ReadStdinLine(char* buf, size_t bsize) {
-    return privReadStdinLine(buf, bsize, false);
-}
-
-static rc_t DestroyStdin(void)
-{   return privReadStdinLine(NULL, 0, true); }
-
-static rc_t In(const char* prompt, const char* def, char** read) {
-    rc_t rc = 0;
-    char buf[PATH_MAX + 1];
-    assert(prompt && read);
-    *read = NULL;
-    while (rc == 0 && (*read == NULL || read[0] == '\0')) {
-        OUTMSG(("%s", prompt));
-        if (def)
-        {   OUTMSG((" [%s]", def)); }
-        OUTMSG((": "));
-        rc = ReadStdinLine(buf, sizeof buf);
-        if (rc == 0) {
-            while (strlen(buf) > 0) {
-                char c = buf[strlen(buf) - 1];
-                if (c == '\n' || c == '\r')
-                {   buf[strlen(buf) - 1] = '\0'; }
-                else
-                {   break; }
-            }
-            if (buf[0] == '\0' && def)
-            {   strcpy(buf, def); }
-            if (buf[0]) {
-                *read = strdup(buf);
-                if (*read == NULL) {
-                    rc = RC
-                        (rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t CC scan_config_dir(const KDirectory* dir,
-    uint32_t type, const char* name, void* data)
-{
-    rc_t rc = 0;
-    assert(data);
-    switch (type) {
-        case kptFile:
-        case kptFile | kptAlias: {
-            size_t sz = strlen(name);
-            if (sz >= 5 && strcase_cmp(&name[sz - 4], 4, ".kfg", 4, 4) == 0) {
-                strcpy(data, name);
-                rc = RC(rcExe, rcDirectory, rcListing, rcFile, rcExists);
-            }
-            break;
-        }
-    }
-    return rc;
-}
-
-static rc_t CreateConfig(char* argv0) {
-    const KFile* std_in = NULL;
-    KDirectory* native = NULL;
-    KDirectory* dir = NULL;
-    rc_t rc = 0;
-    char* location = NULL;
-    char* mod = NULL;
-    char* wmod = NULL;
-    char* refseq = NULL;
-    if (rc == 0) {
-        rc = KDirectoryNativeDir(&native);
-    }
-    if (rc == 0) {
-        const char* def = NULL;
-        char cwd[PATH_MAX + 1] = "";
-        const char* home = getenv("HOME");
-        if (home)
-        {   def = home; }
-        else {
-            rc = KDirectoryResolvePath ( native, true, cwd, sizeof cwd, "." );
-            if (rc == 0 && cwd[0])
-            {   def = cwd; }
-            else
-            {   def = "."; }
-        }
-        while (rc == 0) {
-            char buffer[PATH_MAX + 1];
-            rc = In("Specify configuration files directory", def, &location);
-            if (rc == 0) {
-                rc = KDirectoryOpenDirUpdate(native, &dir, false, location);
-                if (rc == 0) {
-                    rc = KDirectoryVVisit
-                        (dir, false, scan_config_dir, buffer, ".", NULL);
-                    if (rc != 0) {
-                        if (rc ==
-                             RC(rcExe, rcDirectory, rcListing, rcFile, rcExists)
-                            && buffer[0])
-                        {
-                            PLOGERR(klogErr, (klogErr, rc,
-                                "Configuration file found: $(dir)/$(name)",
-                                "dir=%s,name=%s", location, buffer));
-                            rc = 0;
-                            buffer[0] = '\0';
-                            continue;
-                        }
-                        else {
-                            PLOGERR(klogErr, (klogErr, rc, "$(dir)/$(name)",
-                                "dir=%s,name=%s", location, buffer));
-                        }
-                    }
-                    break;
-                }
-                else if (GetRCObject(rc) == rcPath &&
-                (GetRCState(rc) == rcIncorrect || GetRCState(rc) == rcNotFound))
-                {
-                    PLOGERR(klogErr,
-                        (klogErr, rc, "$(path)", "path=%s", location));
-                    rc = 0;
-                }
-                else { DISP_RC(rc, location); }
-            }
-        }
-    }
-    while (rc == 0) {
-        const KDirectory* dir = NULL;
-        rc = In("Specify refseq installation directory", NULL, &refseq);
-        if (rc != 0)
-        {   break; }
-        rc = KDirectoryOpenDirRead(native, &dir, false, refseq);
-        if (rc == 0) {
-            RELEASE(KDirectory, dir);
-            break;
-        }
-        else if (GetRCObject(rc) == rcPath
-              && GetRCState(rc) == rcIncorrect)
-        {
-            PLOGERR(klogErr,
-                (klogErr, rc, "$(path)", "path=%s", refseq));
-            rc = 0;
-        }
-        DISP_RC(rc, refseq);
-    }
-    if (rc == 0) {
-        char buffer[512];
-        const char path[] = "vdb-config.kfg";
-        uint64_t pos = 0;
-        KFile* f = NULL;
-        rc = KDirectoryCreateFile(dir, &f, false, 0664, kcmCreate, path);
-        DISP_RC(rc, path);
-        if (rc == 0) {
-            int n = snprintf(buffer, sizeof buffer,
-                "refseq/servers = \"%s\"\n", refseq);
-            if (n >= sizeof buffer) {
-                rc = RC(rcExe, rcFile, rcWriting, rcBuffer, rcInsufficient);
-            }
-            else {
-                size_t num_writ = 0;
-                rc = KFileWrite(f, pos, buffer, strlen(buffer), &num_writ);
-                pos += num_writ;
-            }
-        }
-        if (rc == 0) {
-            const char buffer[] = "refseq/volumes = \".\"\n";
-            size_t num_writ = 0;
-            rc = KFileWrite(f, pos, buffer, strlen(buffer), &num_writ);
-            pos += num_writ;
-        }
-        if (rc == 0 && mod && mod[0]) {
-            int n = snprintf(buffer, sizeof buffer,
-                "vdb/module/paths = \"%s\"\n", mod);
-            if (n >= sizeof buffer) {
-                rc = RC(rcExe, rcFile, rcWriting, rcBuffer, rcInsufficient);
-            }
-            else {
-                size_t num_writ = 0;
-                rc = KFileWrite(f, pos, buffer, strlen(buffer), &num_writ);
-                pos += num_writ;
-            }
-        }
-        if (rc == 0 && wmod && wmod[0]) {
-            int n = snprintf(buffer, sizeof buffer,
-                "vdb/wmodule/paths = \"%s\"\n", wmod);
-            if (n >= sizeof buffer) {
-                rc = RC(rcExe, rcFile, rcWriting, rcBuffer, rcInsufficient);
-            }
-            else {
-                size_t num_writ = 0;
-                rc = KFileWrite(f, pos, buffer, strlen(buffer), &num_writ);
-                pos += num_writ;
-            }
-        }
-        RELEASE(KFile, f);
-    }
-    free(mod);
-    free(wmod);
-    free(refseq);
-    free(location);
-    RELEASE(KDirectory, dir);
-    RELEASE(KDirectory, native);
-    RELEASE(KFile, std_in);
-    DestroyStdin();
-    return rc;
-}
-
-static rc_t ShowModules(const KConfig* cfg, const Params* prm) {
-    rc_t rc = 0;
-#ifdef _STATIC
-    OUTMSG(("<!-- Modules are not used in static build -->\n"));
-#else
-    const VDBManager* mgr = NULL;
-    KNamelist* list = NULL;
-    OUTMSG(("<!-- Modules -->\n"));
-    rc = VDBManagerMakeRead(&mgr, NULL);
-    DISP_RC(rc, "while calling VDBManagerMakeRead");
-    if (rc == 0) {
-        rc = VDBManagerListExternalSchemaModules(mgr, &list);
-        DISP_RC(rc, "while calling VDBManagerListExternalSchemaModules");
-    }
-    if (rc == 0) {
-        uint32_t count = 0;
-        rc = KNamelistCount(list, &count);
-        DISP_RC(rc, "while calling KNamelistCount "
-            "on VDBManagerListExternalSchemaModules result");
-        if (rc == 0) {
-            int64_t i = 0;
-            for (i = 0; i < count && rc == 0; ++i) {
-                const char* name = NULL;
-                rc = KNamelistGet(list, i, &name);
-                DISP_RC(rc, "while calling KNamelistGet "
-                    "on VDBManagerListExternalSchemaModules result");
-                if (rc == 0) {
-                    OUTMSG(("%s\n", name));
-                }
-            }
-        }
-    }
-    OUTMSG(("\n"));
-    RELEASE(KNamelist, list);
-    RELEASE(VDBManager, mgr);
-#endif
-    return rc;
-}
-
-static rc_t SetNode(KConfig* cfg, const Params* prm) {
-    rc_t rc = 0;
-
-    KConfigNode* node = NULL;
-    char* name = NULL;
-    char* val  = NULL;
-
-    assert(cfg && prm && prm->setValue);
-
-    name = strdup(prm->setValue);
-    if (name == NULL)
-    {   return RC(rcExe, rcStorage, rcAllocating, rcMemory, rcExhausted); }
-
-    val = strchr(name, '=');
-    if (val == NULL || *(val + 1) == '\0') {
-        rc_t rc = RC(rcExe, rcArgv, rcParsing, rcParam, rcInvalid);
-        LOGERR(klogErr, rc, "Bad " OPTION_SET " value");
-    }
-
-    if (rc == 0) {
-        *(val++) = '\0';
-
-        rc = KConfigOpenNodeUpdate(cfg, &node, name);
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc,
-                "Cannot open node '$(name)' for update", "name=%s", name));
-        }
-    }
-
-    if (rc == 0) {
-        assert(val);
-        rc = KConfigNodeWrite(node, val, strlen(val));
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc,
-                "Cannot write value '$(val) to node '$(name)'",
-                "val=%s,name=%s", val, name));
-        }
-    }
-
-    if (rc == 0) {
-        rc = KConfigCommit(cfg);
-        DISP_RC(rc, "while calling KConfigCommit");
-    }
-
-    free(name);
-    name = NULL;
-
-    RELEASE(KConfigNode, node);
-    return rc;
-}
-
-static rc_t ShowConfig(const KConfig* cfg, Params* prm) {
-    rc_t rc = 0;
-    bool hasAny = false;
-    bool hasQuery = false;
-    bool xml = true;
-    assert(cfg && prm);
-    xml = prm->xml;
-    while (rc == 0) {
-        KNamelist* names = NULL;
-        const KConfigNode* node = NULL;
-        uint32_t count = 0;
-        uint32_t i = 0;
-        int indent = 0;
-        const char* root = NULL;
-        const char* nodeName = NULL;
-        size_t nodeNameL = 1;
-        rc = ParamsGetNextParam(prm, &root);
-        if (rc == 0) {
-            if (root == NULL) {
-                if (hasQuery)
-                {   break; }
-                else
-                {   root = "/"; }
-            }
-            else { hasQuery = true; }
-            assert(root);
-        }
-        if (rc == 0) {
-            int64_t len = strlen(root);
-            assert(len > 0);
-            while (len > 0) {
-                if (root[len - 1] == '/')
-                {   --len; }
-                else { break; }
-            }
-            assert(len >= 0);
-            if (len == 0) {
-                root += strlen(root) - 1;
-                nodeName = root;
-            }
-            else {
-                char *c = memrchr(root, '/', len);
-                if (c != NULL) {
-                    nodeName = c + 1;
-                }
-                else {
-                    nodeName = root;
-                }
-            }
-            assert(nodeName && nodeName[0]);
-            nodeNameL = strlen(nodeName);
-            while (nodeNameL > 1 && nodeName[nodeNameL - 1] == '/')
-            {   --nodeNameL; }
-        }
-
-        if (rc == 0) {
-            rc = KConfigOpenNodeRead(cfg, &node, root);
-            DISP_RC(rc, root);
-        }
-        if (rc == 0) {
-            rc = KConfigNodeListChild(node, &names);
-        }
-        if (rc == 0) {
-            rc = KNamelistCount(names, &count);
-        }
-        if (rc == 0 && count == 0) {
-            char buf[512] = "";
-            size_t num_read = 0;
-            rc = KConfigNodeReadData(node, buf, sizeof buf, &num_read);
-            if (rc == 0 && num_read > 0) {
-                if (prm->showMultiple)
-                {   OUTMSG(("<!-- Configuration node %s -->\n", root)); }
-                if (xml) {
-                    VDB_CONGIG_OUTMSG(("<%.*s>", nodeNameL, nodeName));
-                    VDB_CONGIG_OUTMSG(("%.*s", (int)num_read, buf));
-                    VDB_CONGIG_OUTMSG(("</%.*s>\n", nodeNameL, nodeName));
-                }
-                else {
-                    OUTMSG(("%.*s = \"%.*s\"\n",
-                        nodeNameL, nodeName, (int)num_read, buf));
-                }
-                hasAny = true;
-            }
-        }
-        else {
-            if (rc == 0) {
-                if (nodeName[0] != '/') {
-                    if (prm->showMultiple)
-                    {   OUTMSG(("<!-- Configuration node %s -->\n", root)); }
-                    VDB_CONGIG_OUTMSG(("<%.*s>\n", nodeNameL, nodeName));
-                } else {
-                    if (prm->showMultiple)
-                    {   OUTMSG(("<!-- Current configuration -->\n")); }
-                    VDB_CONGIG_OUTMSG(("<Config>\n"));
-                }
-                hasAny = true;
-                ++indent;
-            }
-            for (i = 0; i < count && rc == 0; ++i) {
-                const char* name = NULL;
-                if (rc == 0)
-                {   rc = KNamelistGet(names, i, &name); }
-                if (rc == 0) {
-                    char* fullname = NULL;
-                    if (strcmp(root, "/") == 0) {
-                        fullname = malloc(strlen(name) + 2);
-                        if (fullname == NULL) {
-                            rc = RC(rcExe,
-                                rcStorage, rcAllocating, rcMemory, rcExhausted);
-                        }
-                        sprintf(fullname, "/%s", name);
-                    }
-                    else {
-                        size_t sz = strlen(root) + 2 + strlen(name);
-                        size_t num_writ = 0;
-                        fullname = malloc(sz);
-                        if (fullname == NULL) {
-                            rc = RC(rcExe,
-                                rcStorage, rcAllocating, rcMemory, rcExhausted);
-                        }
-                        rc = string_printf(fullname, sz, &num_writ,
-                            "%s/%s", root, name);
-                        assert(num_writ + 1 == sz);
-                    }
-                    if (rc == 0) {
-                        rc = KConfigNodePrintChildNames
-                            (xml, node, name, indent, fullname);
-                        hasAny = true;
-                    }
-                    free(fullname);
-                    fullname = NULL;
-                }
-            }
-            if (rc == 0) {
-                if (nodeName[0] != '/') {
-                    VDB_CONGIG_OUTMSG(("</%.*s>\n", nodeNameL, nodeName));
-                }
-                else {
-                    VDB_CONGIG_OUTMSG(("</Config>\n"));
-                }
-            }
-        }
-
-        RELEASE(KConfigNode, node);
-        RELEASE(KNamelist, names);
-
-        if (rc == 0) {
-            if (hasAny) {
-                OUTMSG(("\n"));
-            }
-            else if (nodeNameL > 0 && nodeName != NULL) {
-                VDB_CONGIG_OUTMSG(("<%.*s/>\n", nodeNameL, nodeName));
-            }
-        }
-
-        if (!hasQuery)
-        {   break; }
-    }
-
-    return rc;
-}
-
-static rc_t ShowFiles(const KConfig* cfg, const Params* prm) {
-    rc_t rc = 0;
-    bool hasAny = false;
-    uint32_t count = 0;
-    KNamelist* names = NULL;
-    rc = KConfigListIncluded(cfg, &names);
-    if (rc == 0)
-    {   rc = KNamelistCount(names, &count); }
-    if (rc == 0) {
-        uint32_t i = 0;
-
-        if (prm->showMultiple) {
-            OUTMSG(("<!-- Configuration files -->\n"));
-            hasAny = true;
-        }
-
-        for (i = 0; i < count && rc == 0; ++i) {
-            const char* name = NULL;
-            if (rc == 0)
-            {   rc = KNamelistGet(names, i, &name); }
-            if (rc == 0) {
-                OUTMSG(("%s\n", name));
-                hasAny = true;
-            }
-        }
-    }
-    if (rc == 0 && hasAny)
-    {   OUTMSG(("\n")); }
-
-    RELEASE(KNamelist, names);
-
-    return rc;
-}
-
-static void ShowEnv(const Params* prm) {
-    bool hasAny = false;
-    const char * env_list [] = {
-        "KLIB_CONFIG",
-        "VDB_CONFIG",
-        "VDBCONFIG",
-        "LD_LIBRARY_PATH"
-    };
-    int i = 0;
-
-    if (prm->showMultiple) {
-        OUTMSG(("<!-- Environment -->\n"));
-        hasAny = true;
-    }
-
-    for (i = 0; i < sizeof env_list / sizeof env_list [ 0 ]; ++ i ) {
-        const char *eval = getenv ( env_list [ i ] );
-        if (eval) {
-            OUTMSG(("%s=%s\n", env_list [ i ], eval));
-            hasAny = true;
-        }
-    }
-    if (hasAny)
-    {      OUTMSG(("\n")); }
-    else { OUTMSG(("Environment variables are not found\n")); }
-}
-
-rc_t CC KMain(int argc, char* argv[]) {
-    rc_t rc = 0;
-
-    Params prm;
-    KConfig* cfg = NULL;
-
-    if (rc == 0) {
-        rc = ParamsConstruct(argc, argv, &prm);
-    }
-
-    if (rc == 0) {
-        rc = KConfigMake(&cfg, NULL);
-        DISP_RC(rc, "while calling KConfigMake");
-    }
-
-    if (rc == 0) {
-        if (prm.ngc) {
-            const char *newRepoParentPath = NULL;
-            rc = KConfigImportNgc(cfg, prm.ngc, NULL, &newRepoParentPath);
-            if (rc == 0) {
-                rc = KConfigCommit(cfg);
-            }
-            if (rc == 0) {
-#if WINDOWS
-                KDirectory *wd = NULL;
-                char system[MAX_PATH] = "";
-                rc_t rc = KDirectoryNativeDir(&wd);
-                if (rc == 0) {
-                    rc = KDirectoryPosixStringToSystemString(wd,
-                        system, sizeof system, newRepoParentPath);
-                    if (rc == 0) {
-                        newRepoParentPath = system;
-                    }
-                }
-#endif          
-                OUTMSG((
-                    "%s was imported\nThe new protected repository is: %s\n",
-                    prm.ngc, newRepoParentPath));
-            }
-        }
-        else if (prm.modeSetNode) {
-            rc_t rc3 = SetNode(cfg, &prm);
-            if (rc3 != 0 && rc == 0) {
-                rc = rc3;
-            }
-        }
-        if (prm.modeShowCfg) {
-            rc_t rc3 = ShowConfig(cfg, &prm);
-            if (rc3 != 0 && rc == 0) {
-                rc = rc3;
-            }
-        }
-        if (prm.modeShowFiles) {
-            rc_t rc3 = ShowFiles(cfg, &prm);
-            if (rc3 != 0 && rc == 0) {
-                rc = rc3;
-            }
-        }
-        if (prm.modeShowModules) {
-            rc_t rc3 = ShowModules(cfg, &prm);
-            if (rc3 != 0 && rc == 0) {
-                rc = rc3;
-            }
-        }
-        if (prm.modeShowLoadPath) {
-            const char* path = NULL;
-            rc_t rc3 = KConfigGetLoadPath(cfg, &path);
-            if (rc3 == 0) {
-                if (path != NULL && path[0]) {
-                    OUTMSG(("%s\n", path));
-                }
-            }
-            else if (rc == 0) {
-                rc = rc3;
-            }
-        }
-    }
-
-    if (prm.modeShowEnv)
-    {   ShowEnv(&prm); }
-
-    RELEASE(KConfig, cfg);
-
-    if (rc == 0 && prm.modeCreate)
-    {   rc = CreateConfig(argv[0]); }
-
-    ParamsDestruct(&prm);
-    return rc;
-}
-
-/************************************* EOF ************************************/
diff --git a/tools/vdb-config/vdb-config.vers b/tools/vdb-config/vdb-config.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-config/vdb-config.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/vdb-copy/Makefile b/tools/vdb-copy/Makefile
deleted file mode 100644
index 56ad7a8..0000000
--- a/tools/vdb-copy/Makefile
+++ /dev/null
@@ -1,116 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/vdb-copy
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	vdb-copy
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vdb-copy
-#  vdb copy tool
-#
-$(BINDIR)/vdb-copy: $(NCBIDIR)/vdb-copy.kfg 
-
-$(NCBIDIR)/vdb-copy.kfg: $(SRCDIR)/vdb-copy.kfg
-	cp $^ $@
-
-VDB_COPY_SRC = \
-	num-gen \
-	context \
-	helper \
-	coldefs \
-	get_platform \
-	namelist_tools \
-	progressbar \
-	copy_meta \
-	type_matcher \
-	redactval \
-	config_values \
-	vdb-copy
-
-VDB_COPY_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_COPY_SRC))
-
-VDB_COPY_LIB = \
-	-lkapp \
-	-lncbi-wvdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/vdb-copy: $(VDB_COPY_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_COPY_LIB)
diff --git a/tools/vdb-copy/coldefs.c b/tools/vdb-copy/coldefs.c
deleted file mode 100644
index b89a2e8..0000000
--- a/tools/vdb-copy/coldefs.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "coldefs.h"
-#include "helper.h"
-#include "definitions.h"
-
-#include <klib/text.h>
-#include <klib/printf.h>
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-/* allocate a column-definition */
-static p_col_def col_defs_init_col( const char* name )
-{
-    p_col_def res = NULL;
-    if ( name == NULL ) return res;
-    if ( name[0] == 0 ) return res;
-    res = calloc( 1, sizeof( col_def ) );
-    /* because of calloc all members are zero! */
-    if ( res != NULL )
-        res->name = string_dup_measure ( name, NULL );
-    return res;
-}
-
-
-/*
- * helper-function for: col_defs_destroy
- * - free's everything a node owns
- * - free's the node
-*/
-static void CC col_defs_destroy_node( void* node, void* data )
-{
-    p_col_def p_node = (p_col_def)node;
-    if ( p_node != NULL )
-    {
-        if ( p_node->name != NULL )
-            free( p_node->name );
-        if ( p_node->src_cast )
-            free( p_node->src_cast );
-        if ( p_node->dst_cast )
-            free( p_node->dst_cast );
-        free( p_node );
-    }
-}
-
-
-/*
- * initializes a column-definitions-list
-*/
-rc_t col_defs_init( col_defs** defs )
-{
-    if ( defs == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
-    (*defs) = calloc( 1, sizeof( col_defs ) );
-    if ( *defs == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    VectorInit( &((*defs)->cols), 0, 5 );
-    (*defs)->filter_idx = -1;
-    return 0;
-}
-
-
-/*
- * destroys the column-definitions-list
-*/
-rc_t col_defs_destroy( col_defs* defs )
-{
-    if ( defs == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-    VectorWhack( &(defs->cols), col_defs_destroy_node, NULL );
-    free( defs );
-    return 0;
-}
-
-
-/*
- * helper-function for: col_defs_parse_string / col_defs_extract_from_table
- * - creates a column-definition by the column-name
- * - adds the definition to the column-definition-vector
-*/
-static rc_t col_defs_append_col( col_defs* defs, const char* name )
-{
-    rc_t rc;
-    p_col_def new_col = col_defs_init_col( name );
-    if ( new_col == NULL )
-        rc = RC( rcVDB, rcNoTarg, rcParsing, rcMemory, rcExhausted );
-    else
-        rc = VectorAppend( &(defs->cols), NULL, new_col );
-    return rc;
-}
-
-
-/*
- * calls VTableListReadableColumns to get a list of all column-names of the table
- * creates a temporary read-cursor to test and get the column-type
- * walks the KNamelist with the available column-names
- * tries to add every one of them to the temp. cursor
- * if the column can be added to the cursor, it is appended
- * to the column-definition list
-*/
-rc_t col_defs_extract_from_table( col_defs* defs, const VTable *table )
-{
-    KNamelist *names;
-    rc_t rc;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( table == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = VTableListReadableColumns( table, &names );
-    DISP_RC( rc, "col_defs_extract_from_table:VTableListReadableColumns() failed" );
-    if ( rc == 0 )
-    {
-        const VCursor *cursor;
-        rc = VTableCreateCursorRead( table, &cursor );
-        DISP_RC( rc, "col_defs_extract_from_table:VTableCreateCursorRead() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount( names, &count );
-            DISP_RC( rc, "col_defs_extract_from_table:KNamelistCount() failed" );
-            if ( rc == 0 )
-            {
-                uint32_t idx;
-                for ( idx = 0; idx < count && rc == 0; ++idx )
-                {
-                    const char *name;
-                    rc = KNamelistGet( names, idx, &name );
-                    DISP_RC( rc, "col_defs_extract_from_table:KNamelistGet() failed" );
-                    if ( rc == 0 )
-                    {
-                        uint32_t temp_idx;
-                        rc_t rc1 = VCursorAddColumn( cursor, &temp_idx, name );
-                        DISP_RC( rc1, "col_defs_extract_from_table:VCursorAddColumn() failed" );
-                        if ( rc1 == 0 )
-                        {
-                            rc = col_defs_append_col( defs, name );
-                            DISP_RC( rc, "col_defs_extract_from_table:col_defs_append_col() failed" );
-                        }
-                    }
-                }
-            }
-            rc = VCursorRelease( cursor );
-            DISP_RC( rc, "col_defs_extract_from_table:VCursorRelease() failed" );
-        }
-        rc = KNamelistRelease( names );
-        DISP_RC( rc, "col_defs_extract_from_table:KNamelistRelease() failed" );
-    }
-    return rc;
-}
-
-
-rc_t col_defs_clear_to_copy( col_defs* defs )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    len = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < len && rc == 0; ++idx )
-    {
-        p_col_def item = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( item != NULL )
-            item->to_copy = false;
-    }
-    return rc;
-}
-
-
-/*
- * walks the list of column-definitions and tries to add all off them
- * to the given cursor, it stops if one of them fails to be added
- * for every column it detects type_decl and type_desc
- * if both calls are successful the column-def is marked as valid
-*/
-rc_t col_defs_add_to_rd_cursor( col_defs* defs, const VCursor *cursor, bool show )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-    
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( cursor == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    len = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < len && rc == 0; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-        {
-            if ( col->src_cast != NULL )
-            {
-                rc = VCursorAddColumn( cursor, &(col->src_idx), col->src_cast );
-                DISP_RC( rc, "col_defs_add_to_cursor:VCursorAddColumn() failed" );
-                if ( rc == 0 )
-                {
-                    rc = VCursorDatatype( cursor, col->src_idx,
-                              &(col->type_decl), &(col->type_desc) );
-                    DISP_RC( rc, "col_defs_add_to_cursor:VCursorDatatype() failed" );
-                    col->src_valid = ( rc == 0 );
-                    if ( show && col->src_valid )
-                        KOutMsg( "added to rd-cursor: >%s<\n", col->name );
-                }
-
-            }
-        }
-    }
-    return rc;
-}
-
-
-/*
- * retrieves a pointer to a column-definition
- * name defines the name of the wanted column-definition
-*/
-p_col_def col_defs_find( col_defs* defs, const char * name )
-{
-    p_col_def res = NULL;
-    uint32_t idx, len;
-    if ( defs == NULL || name == NULL || name[0] == 0 )
-        return res;
-
-    len = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < len && res == NULL; ++idx )
-    {
-        p_col_def item = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( nlt_strcmp( item->name, name ) == 0 )
-            res = item;
-    }
-    return res;
-}
-
-
-/*
- * retrieves the index of a column-definition
- * name defines the name of the wanted column-definition
-*/
-int32_t col_defs_find_idx( col_defs* defs, const char * name )
-{
-    int32_t res = -1;
-    uint32_t idx, len;
-    if ( defs == NULL || name == NULL || name[0] == 0 )
-        return res;
-
-    len = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < len && res == -1; ++idx )
-    {
-        p_col_def item = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( nlt_strcmp( item->name, name ) == 0 )
-            res = (int32_t)idx;
-    }
-    return res;
-}
-
-
-/*
- * retrieves a pointer to a column-definition
- * idx defines the Vector-Index of the wanted column-definition
- * !!! not the read or write cursor index !!!
-*/
-p_col_def col_defs_get( col_defs* defs, const uint32_t idx )
-{
-    p_col_def res = NULL;
-    if ( defs != NULL )
-        res = (p_col_def) VectorGet ( &(defs->cols), idx );
-    return res;
-}
-
-
-/*
- * adds all columns marked with to_copy == true to the cursor
-*/
-rc_t col_defs_add_to_wr_cursor( col_defs* defs, const VCursor* cursor, bool show )
-{
-    uint32_t idx, len;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( cursor == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    len = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < len; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-            if ( col->to_copy && col->dst_cast != NULL )
-            {
-                rc_t rc = VCursorAddColumn( cursor, &(col->dst_idx), col->dst_cast );
-                col->to_copy = ( rc == 0 );
-                if ( show )
-                {
-                    if ( col->to_copy )
-                        KOutMsg( "added to wr-cursor: >%s<\n", col->name );
-                    else
-                        KOutMsg( "cannot add >%s<\n", col->name );
-                }
-            }
-    }
-    return 0;
-}
-
-
-/*
- * searches in the column-vector for a successful string-comparison
- * with the hardcoded name of the filter-column
- * stores it's vector-idx in defs->filter_idx
- * does not require an open cursor.
-*/
-rc_t col_defs_detect_filter_col( col_defs* defs, const char *name )
-{
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( name == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    defs->filter_idx = col_defs_find_idx( defs, name );
-    if ( defs->filter_idx < 0 )
-        return RC( rcExe, rcNoTarg, rcResolving, rcItem, rcNotFound );
-    return 0;
-}
-
-
-/*
- * walks through the column-names and marks every column thats
- * name is in "redactable_cols" as redactable
- * sets the redact-value to zero
- * if the default-type of the column is in the list of dna-types
- * (a hardcoded list) it sets the redact-value to 'N'
- * does not require an open cursor. 
-*/
-rc_t col_defs_detect_redactable_cols_by_name( col_defs* defs,
-                                const char * redactable_cols )
-{
-    const KNamelist *r_columns;
-    rc_t rc;
-    
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( defs == NULL || redactable_cols == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = nlt_make_namelist_from_string( &r_columns, redactable_cols );
-    if ( rc == 0 )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len && rc == 0; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                if ( !(col->redactable) )
-                    col->redactable = nlt_is_name_in_namelist( r_columns, col->name );
-        }
-        KNamelistRelease( r_columns );
-    }
-    return rc;
-}
-
-
-static rc_t redactable_types_2_type_id_vector( const VSchema * s,
-                                               const char * redactable_types,
-                                               Vector * id_vector )
-{
-    const KNamelist *r_types;
-    rc_t rc;
-    if ( redactable_types == NULL || s == NULL || id_vector == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = nlt_make_namelist_from_string( &r_types, redactable_types );
-    if ( rc == 0 )
-    {
-        uint32_t count, idx;
-
-        rc = KNamelistCount( r_types, &count );
-        if ( rc == 0 && count > 0 )
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *name;
-                rc = KNamelistGet( r_types, idx, &name );
-                if ( rc == 0 )
-                {
-                    VTypedecl td;
-                    rc = VSchemaResolveTypedecl ( s, &td, name );
-                    if ( rc == 0 )
-                    {
-                        uint32_t *id = malloc( sizeof *id );
-                        if ( id != NULL )
-                        {
-                            *id = td.type_id;
-                            rc = VectorAppend ( id_vector, NULL, id );
-                        }
-                        else
-                            rc = RC( rcExe, rcNoTarg, rcResolving, rcMemory, rcExhausted );
-                    }
-                }
-            }
-        KNamelistRelease( r_types );
-    }
-    return rc;
-}
-
-
-static void CC type_id_ptr_whack ( void *item, void *data )
-{
-    free( item );
-}
-
-
-/*
- * walks through the columns and checks every column against
- * a list of types, if one of the src-types of the column
- * is in the list it is marked as redactable
-*/
-rc_t col_defs_detect_redactable_cols_by_type( col_defs* defs,
-                        const VSchema * s, const matcher * m,
-                        const char * redactable_types )
-{
-    Vector id_vector;
-    rc_t rc;
-    
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( redactable_types == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-    
-    VectorInit ( &id_vector, 0, 20 );
-    rc = redactable_types_2_type_id_vector( s, redactable_types, &id_vector );
-    if ( rc == 0 )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                if ( ! col->redactable )
-                    col->redactable = matcher_src_has_type( m, s, col->name, &id_vector );
-        }
-        VectorWhack ( &id_vector, type_id_ptr_whack, NULL );
-    }
-
-/*
-    rc = nlt_make_namelist_from_string( &r_types, redactable_types );
-    if ( rc == 0 )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                if ( ! col->redactable )
-                    col->redactable = matcher_src_has_type( m, col->name, r_types );
-        }
-        KNamelistRelease( r_types );
-    }
-*/
-    return rc;
-}
-
-
-rc_t col_defs_unmark_do_not_redact_columns(  col_defs* defs,
-                    const char * do_not_redact_cols )
-{
-    const KNamelist *names;
-    rc_t rc;
-    
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( do_not_redact_cols == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = nlt_make_namelist_from_string( &names, do_not_redact_cols );
-    if ( rc == 0 )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                if ( col->redactable )
-                    if ( nlt_is_name_in_namelist( names, col->name ) )
-                        col->redactable = false;
-        }
-        KNamelistRelease( names );
-    }
-    return rc;
-}
-
-/*
- * walks through the column-definitions and counts how
- * many of them have the to-copy-flag
- * does not require an open cursor. 
-*/
-uint32_t col_defs_count_copy_cols( col_defs* defs )
-{
-    uint32_t res = 0;
-    if ( defs != NULL )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def item = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( item != NULL )
-                if ( item->to_copy )
-                    res++;
-        }
-    }
-    return res;
-}
-
-
-/*
- * walks through the column-definitions and if a column
- * has the to_copy-flag set, and it's name is in the
- * given list of column-names the to copy-flag is cleared
- * does not require an open cursor.
-*/
-rc_t col_defs_exclude_these_columns( col_defs* defs, const char * prefix, const char * column_names )
-{
-    rc_t rc = 0;
-    const KNamelist *names;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    /* it is OK if we have not column-names to exclude */
-    if ( column_names == NULL )
-        return 0;
-    if ( column_names[0] == 0 )
-        return 0;
-
-    rc = nlt_make_namelist_from_string( &names, column_names );
-    DISP_RC( rc, "col_defs_parse_string:nlt_make_namelist_from_string() failed" );
-    if ( rc == 0 )
-    {
-        uint32_t idx, len = VectorLength( &(defs->cols) );
-        size_t prefix_len = 0;
-        if ( prefix != 0 )
-            prefix_len = string_size( prefix ) + 2;
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-            {
-                if ( col->requested )
-                {
-                    if ( nlt_is_name_in_namelist( names, col->name ) )
-                        col->requested = false;
-                    else
-                    {
-                        if ( prefix != NULL )
-                        {
-                            size_t len1 = string_size ( col->name ) + prefix_len;
-                            char * s = malloc( len1 );
-                            if ( s != NULL )
-                            {
-                                size_t num_writ;
-                                rc_t rc1 = string_printf ( s, len1, &num_writ, "%s:%s", prefix, col->name );
-                                if ( rc1 == 0 )
-                                {
-                                    if ( nlt_is_name_in_namelist( names, s ) )
-                                        col->requested = false;
-                                }
-                                free( s );
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        KNamelistRelease( names );
-    }
-    return rc;
-}
-
-
-rc_t col_defs_as_string( col_defs* defs, char ** dst, bool only_requested )
-{
-    uint32_t idx, count, total = 0, dst_idx = 0;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( dst == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-    *dst = NULL;
-    count = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < count; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-        {
-            bool use_this = ( only_requested ) ? col->requested : true;
-            if ( use_this )
-                total += ( string_measure ( col->name, NULL ) + 1 );
-        }
-    }
-    *dst = malloc( total + 1 );
-    if ( *dst == NULL )
-        return RC( rcVDB, rcNoTarg, rcResolving, rcMemory, rcExhausted );
-    *dst[0] = 0;
-    for ( idx = 0;  idx < count; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-        {
-            bool use_this = ( only_requested ) ? col->requested : true;
-            if ( use_this )
-            {
-                dst_idx += string_copy_measure ( &((*dst)[dst_idx]), total-dst_idx, col->name );
-                (*dst)[dst_idx++] = ',';
-            }
-        }
-    }
-    if ( dst_idx > 0 )
-        (*dst)[dst_idx-1] = 0;
-    return 0;
-}
-
-
-rc_t col_defs_apply_casts( col_defs* defs, const matcher * m )
-{
-    rc_t rc = 0;
-    uint32_t idx, count;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-
-    count = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < count && rc == 0; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-        {
-            if ( m == NULL )
-            {
-                col->src_cast = string_dup_measure ( col->name, NULL );
-                col->dst_cast = string_dup_measure ( col->name, NULL );
-            }
-            else
-            {
-                rc = matcher_src_cast( m, col->name, &(col->src_cast) );
-                if ( rc == 0 )
-                    rc = matcher_dst_cast( m, col->name, &(col->dst_cast) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t col_defs_find_redact_vals( col_defs* defs, 
-                                const redact_vals * rvals )
-{
-    uint32_t idx, count;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( rvals == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    count = VectorLength( &(defs->cols) );
-    for ( idx = 0;  idx < count; ++idx )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-        if ( col != NULL )
-            if ( col->to_copy )
-                col->r_val = redact_vals_get_by_cast( rvals, col->dst_cast );
-    }
-    return 0;
-}
-
-
-rc_t col_defs_mark_writable_columns( col_defs* defs, VTable *tab, bool show )
-{
-    KNamelist *writables;
-    rc_t rc;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( tab == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = VTableListWritableColumns ( tab, &writables );
-    if ( rc == 0 )
-    {
-        uint32_t idx, count = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < count; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                if ( col->requested )
-                    if ( nlt_is_name_in_namelist( writables, col->name ) )
-                    {
-                        if ( show )
-                            KOutMsg( "writable column: >%s<\n", col->name );
-                        col->to_copy = true;
-                    }
-        }
-        KNamelistRelease( writables );
-    }
-    return rc;
-}
-
-
-rc_t col_defs_mark_requested_columns( col_defs* defs, const char * columns )
-{
-    const KNamelist *requested;
-    rc_t rc;
-    uint32_t idx, len;
-
-    if ( defs == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-
-    if ( columns == NULL )
-    {
-        /* no specific columns are provided --> mark all of them */
-        len = VectorLength( &(defs->cols) );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-            if ( col != NULL )
-                col->requested = true;
-        }
-        rc = 0;
-    }
-    else
-    {
-        /* specific columns are provided --> mark all of these */
-        rc = nlt_make_namelist_from_string( &requested, columns );
-        DISP_RC( rc, "col_defs_mark_requested_columns:nlt_make_namelist_from_string() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t idx, len = VectorLength( &(defs->cols) );
-            for ( idx = 0;  idx < len; ++idx )
-            {
-                p_col_def col = (p_col_def) VectorGet ( &(defs->cols), idx );
-                if ( col != NULL )
-                    col->requested = nlt_is_name_in_namelist( requested, col->name );
-            }
-            KNamelistRelease( requested );
-        }
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/coldefs.h b/tools/vdb-copy/coldefs.h
deleted file mode 100644
index 5313f18..0000000
--- a/tools/vdb-copy/coldefs.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_coldefs_
-#define _h_vdb_coldefs_
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-#ifndef _h_type_matcher_
-#include "type_matcher.h"
-#endif
-
-#ifndef _h_vdb_redactval_
-#include "redactval.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/********************************************************************
-col-def is the definition of a single column: name/index/type
-********************************************************************/
-typedef struct col_def
-{
-    char *name;
-    uint32_t src_idx;       /* index of this column relative to the
-                               read-cursor */
-
-    uint32_t dst_idx;       /* index of this column relative to the
-                               write-cursor */
-
-    bool src_valid;         /* this column was successfully addes to
-                               the read-cursor */
-
-    bool requested;         /* in case of no columns given to the commandline
-                               all existing columns are marked as requested
-                               ( even if not all of them can be copied,
-                                 they are filtered out later... )
-                               if columns are given at the commandline
-                               only these are marked as requested */
-
-    bool to_copy;           /* this column has a correspondig column 
-                               in the list of writable columns of the
-                               destination-schema with writable types */
-
-    bool redactable;        /* this column is in the list of redactable
-                               columns */
-
-    VTypedecl type_decl;    /* type-decl of this column via read-schema */
-    VTypedesc type_desc;    /* type-desc of this column via read-schema */
-
-    char * src_cast;        /* typecast to be used by the source */
-    char * dst_cast;        /* typecast to be used by the destination */
-
-    p_redact_val r_val;     /* pointer to a redact-value entry if exists*/
-} col_def;
-typedef col_def* p_col_def;
-
-/********************************************************************
-the col-defs are a vector of single column-definitions
-********************************************************************/
-typedef struct col_defs
-{
-    Vector cols;
-    int32_t filter_idx; /* index of READ_FILTER-column (-1 not in set...)*/
-} col_defs;
-typedef col_defs* p_col_defs;
-
-
-/*
- * initializes a column-definitions-list
-*/
-rc_t col_defs_init( col_defs** defs );
-
-
-/*
- * destroys the column-definitions-list
-*/
-rc_t col_defs_destroy( col_defs* defs );
-
-
-/*
- * calls VTableListCol to get a list of all column-names of the table
- * creates a temporary read-cursor to test and get the column-type
- * walks the KNamelist with the available column-names
- * tries to add every one of them to the temp. cursor
- * if the column can be added to the cursor, it is appended
- * to the column-definition list, the type of the column is detected
-*/
-rc_t col_defs_extract_from_table( col_defs* defs, const VTable *table );
-
-
-/*
- * walks the list of column-definitions and calls
- * VTableColumnDatatypes() for every column, fills the types
- * into the src-types-Vector of every column
-*/
-rc_t col_defs_read_src_types( col_defs* defs, const VTable *table,
-                              const VSchema *schema );
-
-
-/*
- * walks the list of column-definitions and calls
- * VTableListWritableColumnTypes() for every column
- * if the returned namelist is not empty, it marks the column as
- * to be copied, and fills it's types into the dst-types-Vector 
- * of every column
-*/
-rc_t col_defs_read_dst_columns( col_defs* defs, const VTable *table,
-                                const VSchema *schema );
-
-
-rc_t col_defs_clear_to_copy( col_defs* defs );
-
-
-/*
- * walks the list of column-definitions and reports on every one
-*/
-rc_t col_defs_report( const col_defs* defs, const bool only_copy_columns );
-
-
-/*
- * walks the list of column-definitions and tries to add all off them
- * to the given cursor, it stops if one of them fails to be added
- * for every column it detects type_decl and type_desc
- * if both calls are successful the column-def is marked as valid
-*/
-rc_t col_defs_add_to_rd_cursor( col_defs* defs, const VCursor *cursor, bool show );
-
-
-/*
- * retrieves a pointer to a column-definition
- * name defines the name of the wanted column-definition
-*/
-p_col_def col_defs_find( col_defs* defs, const char * name );
-
-
-/*
- * retrieves the index of a column-definition
- * name defines the name of the wanted column-definition
-*/
-int32_t col_defs_find_idx( col_defs* defs, const char * name );
-
-
-/*
- * retrieves a pointer to a column-definition
- * idx defines the Vector-Index of the wanted column-definition
- * !!! not the read or write cursor index !!!
-*/
-p_col_def col_defs_get( col_defs* defs, const uint32_t idx );
-
-
-/*
- * adds all columns marked with to_copy == true to the cursor
-*/
-rc_t col_defs_add_to_wr_cursor( col_defs* defs, const VCursor* cursor, bool show );
-
-
-/*
- * searches in the column-vector for a successful string-comparison
- * with the hardcoded name of the filter-column
- * stores it's vector-idx in defs->filter_idx
- * does not require an open cursor.
-*/
-rc_t col_defs_detect_filter_col( col_defs* defs, const char *col_name );
-
-
-/*
- * walks through the column-names and marks every column thats
- * name is in "redactable_cols"  as redactable
- * sets the redact-value to zero
- * if the default-type of the column is in the list of dna-types
- * (a hardcoded list) it sets the redact-value to 'N'
- * does not require an open cursor. 
-*/
-rc_t col_defs_detect_redactable_cols_by_name( col_defs* defs,
-                    const char * redactable_cols );
-
-rc_t col_defs_detect_redactable_cols_by_type( col_defs* defs,
-                        const VSchema * s, const matcher * m,
-                        const char * redactable_types );
-
-
-/*
- * walks through the column-names and clear the redactable-flag 
- * for every column thats name is in "do_not_redact_cols"
- * does not require an open cursor. 
-*/
-rc_t col_defs_unmark_do_not_redact_columns(  col_defs* defs,
-                    const char * do_not_redact_cols );
-
-
-/*
- * walks through the column-definitions and counts how
- * many of them have the to-copy-flag
- * does not require an open cursor. 
-*/
-uint32_t col_defs_count_copy_cols( col_defs* defs );
-
-
-/*
- * walks through the column-definitions and if a column
- * has the to_copy-flag set, and it's name is in the
- * given list of column-names the to copy-flag is cleared
- * does not require an open cursor.
-*/
-rc_t col_defs_exclude_these_columns( col_defs* defs,
-                const char * prefix, const char * column_names );
-
-rc_t col_defs_as_string( col_defs* defs, char ** dst, bool only_requested );
-
-rc_t col_defs_apply_casts( col_defs* defs, const matcher * m );
-
-rc_t col_defs_find_redact_vals( col_defs* defs, const redact_vals * rvals );
-
-rc_t col_defs_mark_writable_columns( col_defs* defs, VTable *tab, bool show );
-
-rc_t col_defs_mark_requested_columns( col_defs* defs, const char * columns );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/config_values.c b/tools/vdb-copy/config_values.c
deleted file mode 100644
index cd68a95..0000000
--- a/tools/vdb-copy/config_values.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "config_values.h"
-
-#include <sysalloc.h>
-#include <string.h>
-#include <stdlib.h>
-
-static void config_values_destroy_str( char **s )
-{
-    if ( *s != NULL )
-    {
-        free( *s );
-        *s = NULL;
-    }
-}
-
-
-void config_values_init( p_config_values cv )
-{
-    memset( cv, 0, sizeof cv[0] );
-}
-
-
-void config_values_destroy( p_config_values cv )
-{
-    config_values_destroy_str( &cv->filter_col_name );
-    config_values_destroy_str( &cv->meta_ignore_nodes );
-    config_values_destroy_str( &cv->redactable_types );
-    config_values_destroy_str( &cv->do_not_redact_columns );
-}
diff --git a/tools/vdb-copy/config_values.h b/tools/vdb-copy/config_values.h
deleted file mode 100644
index 4d7a503..0000000
--- a/tools/vdb-copy/config_values.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_config_values_
-#define _h_config_values_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct config_values
-{
-    char * filter_col_name;
-    char * meta_ignore_nodes;
-    char * redactable_types;
-    char * do_not_redact_columns;
-} config_values;
-typedef config_values* p_config_values;
-
-void config_values_init( p_config_values cv );
-void config_values_destroy( p_config_values cv );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/context.c b/tools/vdb-copy/context.c
deleted file mode 100644
index 6dfe569..0000000
--- a/tools/vdb-copy/context.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "context.h"
-#include <sysalloc.h>
-#include <stdlib.h>
-
-
-/*
- * helper-function to set a string inside the context
- * ( makes a copy ) with error detection
-*/
-static rc_t context_set_str( char **dst, const char *src )
-{
-    size_t len;
-    if ( dst == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-
-    if ( *dst != NULL )
-    {
-        free( *dst );
-        *dst = NULL;
-    }
-    if ( src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-
-    *dst = string_dup_measure ( src, &len );
- 
-    if ( len == 0 )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcItem, rcEmpty );
-    if ( *dst == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcMemory, rcExhausted );
-    return 0;
-}
-
-
-/*
- * helper-function to initialize the values of the context
-*/
-static void context_init_values( p_context ctx )
-{
-    ctx->src_path = NULL;
-    ctx->dst_path = NULL;
-    ctx->kfg_path = NULL;
-    ctx->table = NULL;
-    ctx->columns = NULL;
-    ctx->excluded_columns = NULL;
-    ctx->platform_id = 0;
-    ctx->src_schema_list = NULL;
-
-    ctx->usage_requested = false;
-    ctx->ignore_reject = false;
-    ctx->ignore_redact = false;
-    ctx->dont_check_accession = false;
-    ctx->reindex = false;
-    ctx->show_redact = false;
-    ctx->show_meta = false;
-    ctx->md5_mode = MD5_MODE_AUTO;
-    ctx->force_kcmInit = false;
-    ctx->force_unlock = false;
-
-    ctx->dont_remove_target = false;
-    config_values_init( &(ctx->config) );
-    redact_vals_init( &(ctx->rvals) );
-    ctx->dst_schema_tabname = NULL;
-    ctx->legacy_schema_file = NULL;
-    ctx->legacy_dont_copy = NULL;
-}
-
-
-/*
- * generates a new context, initializes values
-*/
-rc_t context_init( context **ctx )
-{
-    rc_t rc;
-
-    if ( ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    (*ctx) = (p_context)calloc( 1, sizeof( context ) );
-    if ( *ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-
-    context_init_values( *ctx );
-    rc = num_gen_make( &((*ctx)->row_generator) );
-    DISP_RC( rc, "num_gen_make() failed" );
-    return rc;
-}
-
-
-/*
- * destroys a context, frees all pointers the context owns
-*/
-rc_t context_destroy( p_context ctx )
-{
-    if ( ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcParam, rcNull );
-
-    if ( ctx->src_path != NULL )
-    {
-        free( (void*)ctx->src_path );
-        ctx->src_path = NULL;
-    }
-    if ( ctx->dst_path != NULL )
-    {
-        free( (void*)ctx->dst_path );
-        ctx->dst_path = NULL;
-    }
-    if ( ctx->kfg_path != NULL )
-    {
-        free( (void*)ctx->kfg_path );
-        ctx->kfg_path = NULL;
-    }
-    if ( ctx->src_schema_list != NULL )
-    {
-        KNamelistRelease( ctx->src_schema_list );
-        ctx->src_schema_list = NULL;
-    }
-    if ( ctx->table != NULL )
-    {
-        free( (void*)ctx->table );
-        ctx->table = NULL;
-    }
-    if ( ctx->columns != NULL )
-    {
-        free( (void*)ctx->columns );
-        ctx->columns = NULL;
-    }
-    if ( ctx->excluded_columns != NULL )
-    {
-        free( (void*)ctx->excluded_columns );
-        ctx->excluded_columns = NULL;
-    }
-
-    num_gen_destroy( ctx->row_generator );
-    config_values_destroy( &( ctx->config ) );
-    redact_vals_destroy( ctx->rvals );
-
-    if ( ctx->dst_schema_tabname != NULL )
-    {
-        free( (void*)ctx->dst_schema_tabname );
-        ctx->dst_schema_tabname = NULL;
-    }
-    if ( ctx->legacy_schema_file != NULL )
-    {
-        free( (void*)ctx->legacy_schema_file );
-        ctx->legacy_schema_file = NULL;
-    }
-    if ( ctx->legacy_dont_copy != NULL )
-    {
-        free( (void*)ctx->legacy_dont_copy );
-        ctx->legacy_dont_copy = NULL;
-    }
-
-    free( ctx );
-    return 0;
-}
-
-
-/*
- * clear's the number-generator and sets the given intervall
-*/
-rc_t context_set_range( p_context ctx, 
-                        const int64_t first, const uint64_t count )
-{
-    rc_t rc = num_gen_clear( ctx->row_generator );
-    if ( rc == 0 )
-        rc = num_gen_add( ctx->row_generator, first, count );
-    return rc;
-}
-
-
-/*
- * performs the range check to trim the internal number
- * generator to the given range
-*/
-rc_t context_range_check( p_context ctx, 
-                          const int64_t first, const uint64_t count )
-{
-    return num_gen_range_check( ctx->row_generator, first, count );
-}
-
-
-/*
- * helper-function to set the source-path
-*/
-static rc_t context_set_src_path( p_context ctx, const char *src )
-{
-    return context_set_str( (char**)&(ctx->src_path), src );
-}
-
-
-/*
- * helper-function to set the destination-path
-*/
-static rc_t context_set_dst_path( p_context ctx, const char *src )
-{
-    return context_set_str( (char**)&(ctx->dst_path), src );
-}
-
-
-/*
- * helper-function to set the path for additional kfg-files
-*/
-static rc_t context_set_kfg_path( p_context ctx, const char *src )
-{
-    rc_t rc = context_set_str( (char**)&(ctx->kfg_path), src );
-    if ( ctx->kfg_path == NULL )
-        context_set_kfg_path( ctx, "." );
-    return rc;
-}
-
-
-/*
- * helper-function to set the name of the source-table
-*/
-static rc_t context_set_table( p_context ctx, const char *src )
-{
-    rc_t rc;
-    if ( ctx == NULL || src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    rc = context_set_str( (char**)&(ctx->table), src );
-    DISP_RC( rc, "context_set_table:context_set_str() failed" );
-    return rc;
-}
-
-#if ALLOW_COLUMN_SPEC
-static rc_t context_set_columns( p_context ctx, const char *src )
-{
-    rc_t rc;
-    if ( ctx == NULL || src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    rc = context_set_str( (char**)&(ctx->columns), src );
-    DISP_RC( rc, "context_set_columns:dump_context_set_str() failed" );
-    return rc;
-}
-#endif
-
-static rc_t context_set_excluded_columns( p_context ctx, const char *src )
-{
-    rc_t rc;
-    if ( ctx == NULL || src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    rc = context_set_str( (char**)&(ctx->excluded_columns), src );
-    DISP_RC( rc, "context_set_excluded_columns:dump_context_set_str() failed" );
-    return rc;
-}
-
-
-static rc_t context_set_md5_mode( p_context ctx, const char *src )
-{
-    if ( ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    ctx->md5_mode = MD5_MODE_AUTO;
-    if ( src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    switch( src[ 0 ] )
-    {
-    case 'O' :
-    case '1' :
-    case 'o' : ctx->md5_mode = MD5_MODE_ON; break;
-
-    case '0' :
-    case 'x' :
-    case 'X' : ctx->md5_mode = MD5_MODE_OFF; break;
-    }
-    return 0;
-}
-
-
-static rc_t context_set_blob_checksum( p_context ctx, const char *src )
-{
-    if ( ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    ctx->blob_checksum = BLOB_CHECKSUM_AUTO;
-    if ( src == NULL )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    switch( src[ 0 ] )
-    {
-    case 'O' :
-    case '1' :
-    case 'o' : ctx->blob_checksum = BLOB_CHECKSUM_CRC32; break;
-
-    case '5' :
-    case 'M' :
-    case 'm' : ctx->blob_checksum = BLOB_CHECKSUM_MD5; break;
-
-    case '0' :
-    case 'x' :
-    case 'X' : ctx->blob_checksum = BLOB_CHECKSUM_OFF; break;
-    }
-    return 0;
-}
-
-
-static rc_t context_set_row_range( p_context ctx, const char *src )
-{
-    if ( ( ctx == NULL )||( src == NULL ) )
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    return num_gen_parse( ctx->row_generator, src );
-}
-
-
-static bool context_check_if_usage_necessary( p_context ctx )
-{
-    if ( ctx == NULL ) return false;
-    if ( ctx->src_path == NULL || ctx->dst_path == NULL )
-        ctx->usage_requested = true;
-    return ctx->usage_requested;
-}
-
-
-static rc_t context_evaluate_arguments( const Args *my_args, p_context ctx )
-{
-    uint32_t count, idx;
-    
-    rc_t rc = ArgsParamCount( my_args, &count );
-    DISP_RC( rc, "ArgsParamCount() failed" );
-    if ( rc != 0 ) return rc;
-
-    for ( idx = 0; idx < count && rc == 0; ++idx )
-    {
-        const char *value = NULL;
-        rc = ArgsParamValue( my_args, idx, &value );
-        DISP_RC( rc, "ArgsParamValue() failed" );
-        if ( rc == 0 )
-        {
-            switch( idx )
-            {
-            case 0 : rc = context_set_src_path( ctx, value );
-                     DISP_RC( rc, "context_set_src_path() failed" );
-                     break;
-
-            case 1 : rc = context_set_dst_path( ctx, value );
-                     DISP_RC( rc, "context_set_dst_path() failed" );
-                     break;
-
-            }
-        }
-    }
-    return rc;
-}
-
-
-static bool context_get_bool_option( const Args *my_args,
-                                     const char *name,
-                                     const bool def )
-{
-    bool res = def;
-    uint32_t count = 0;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    if ( rc == 0 && count > 0 )
-        res = true;
-    return res;
-}
-
-
-static const char* context_get_str_option( const Args *my_args,
-                                           const char *name )
-{
-    const char* res = NULL;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        rc = ArgsOptionValue( my_args, name, 0, &res );
-    }
-    return res;
-}
-
-
-/*
- * returns the number of schema's given on the commandline
-*/
-uint32_t context_schema_count( p_context ctx )
-{
-    uint32_t res = 0;
-    if ( ctx != NULL )
-        if ( ctx->src_schema_list != 0 )
-        {
-            uint32_t count;
-            if ( KNamelistCount( ctx->src_schema_list, &count ) == 0 )
-                res = count;
-        }
-    return res;
-}
-
-
-static void context_evaluate_options( const Args *my_args, p_context ctx )
-{
-    if ( my_args == NULL ) return;
-    if ( ctx == NULL ) return;
-
-    ctx->dont_check_accession = context_get_bool_option( my_args, OPTION_WITHOUT_ACCESSION, false );
-    ctx->ignore_reject = context_get_bool_option( my_args, OPTION_IGNORE_REJECT, true );
-    ctx->ignore_redact = context_get_bool_option( my_args, OPTION_IGNORE_REDACT, false );
-    ctx->show_matching = context_get_bool_option( my_args, OPTION_SHOW_MATCHING, false );
-    ctx->show_progress = context_get_bool_option( my_args, OPTION_SHOW_PROGRESS, false );
-    ctx->ignore_incomp = context_get_bool_option( my_args, OPTION_IGNORE_INCOMP, false );
-    ctx->reindex       = context_get_bool_option( my_args, OPTION_REINDEX, true );
-    ctx->show_redact   = context_get_bool_option( my_args, OPTION_SHOW_REDACT, false );
-    ctx->show_meta     = context_get_bool_option( my_args, OPTION_SHOW_META, false );
-    ctx->force_kcmInit = context_get_bool_option( my_args, OPTION_FORCE, false );
-    ctx->force_unlock  = context_get_bool_option( my_args, OPTION_UNLOCK, false );
-
-    context_set_md5_mode( ctx, context_get_str_option( my_args, OPTION_MD5_MODE ) );
-    context_set_blob_checksum( ctx, context_get_str_option( my_args, OPTION_BLOB_CHECKSUM ) );
-
-#if ALLOW_EXTERNAL_CONFIG
-    context_set_kfg_path( ctx, context_get_str_option( my_args, OPTION_KFG_PATH ) );
-#endif
-
-    context_set_table( ctx, context_get_str_option( my_args, OPTION_TABLE ) );
-#if ALLOW_COLUMN_SPEC
-    context_set_columns( ctx, context_get_str_option( my_args, OPTION_COLUMNS ) );
-#endif
-    context_set_excluded_columns( ctx, context_get_str_option( my_args, OPTION_EXCLUDED_COLUMNS ) );
-    context_set_row_range( ctx, context_get_str_option( my_args, OPTION_ROWS ) );
-    nlt_make_namelist_from_string( &(ctx->src_schema_list), 
-                                   context_get_str_option( my_args, OPTION_SCHEMA ) );
-}
-
-
-/*
- * reads all arguments and options, fills the context
- * with copies (if strings) of this data
-*/
-rc_t context_capture_arguments_and_options( const Args * args, p_context ctx )
-{
-    rc_t rc;
-
-    rc = context_evaluate_arguments( args, ctx );
-    DISP_RC( rc, "evaluate_arguments() failed" );
-    if ( rc == 0 )
-    {
-        context_evaluate_options( args, ctx );
-        context_check_if_usage_necessary( ctx );
-
-        rc = ArgsHandleLogLevel( args );
-        DISP_RC( rc, "ArgsHandleLogLevel() failed" );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/context.h b/tools/vdb-copy/context.h
deleted file mode 100644
index dbeb202..0000000
--- a/tools/vdb-copy/context.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_context_
-#define _h_context_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-#ifndef _h_config_values_
-#include "config_values.h"
-#endif
-
-#ifndef _h_vdb_redactval_
-#include "redactval.h"
-#endif
-
-#include <kapp/args.h>
-#include "definitions.h"
-#include "num-gen.h"
-
-#define OPTION_TABLE             "table"
-#define OPTION_ROWS              "rows"
-#define OPTION_COLUMNS           "columns"
-#define OPTION_SCHEMA            "schema"
-#define OPTION_WITHOUT_ACCESSION "without_accession"
-#define OPTION_IGNORE_REJECT     "ignore_reject"
-#define OPTION_IGNORE_REDACT     "ignore_redact"
-
-#if ALLOW_EXTERNAL_CONFIG
-#define OPTION_KFG_PATH          "kfg_path"
-#endif
-
-#define OPTION_SHOW_MATCHING     "show_matching"
-#define OPTION_SHOW_PROGRESS     "show_progress"
-#define OPTION_IGNORE_INCOMP     "ignore_incompatible_columns"
-#define OPTION_REINDEX           "reindex"
-#define OPTION_SHOW_REDACT       "show_redact"
-#define OPTION_EXCLUDED_COLUMNS  "exclude_columns"
-#define OPTION_SHOW_META         "show_meta"
-#define OPTION_MD5_MODE          "md5mode"
-#define OPTION_FORCE             "force"
-#define OPTION_UNLOCK            "unlock"
-#define OPTION_BLOB_CHECKSUM     "blob_checksum"
-
-
-#define ALIAS_TABLE             "T"
-#define ALIAS_ROWS              "R"
-#define ALIAS_COLUMNS           "C"
-#define ALIAS_SCHEMA            "S"
-#define ALIAS_WITHOUT_ACCESSION "a"
-#define ALIAS_IGNORE_REJECT     "r"
-#define ALIAS_IGNORE_REDACT     "e"
-
-#if ALLOW_EXTERNAL_CONFIG
-#define ALIAS_KFG_PATH          "k"
-#endif
-
-#define ALIAS_SHOW_MATCHING     "m"
-#define ALIAS_SHOW_PROGRESS     "p"
-#define ALIAS_IGNORE_INCOMP     "i"
-#define ALIAS_REINDEX           "n"
-#define ALIAS_SHOW_REDACT       "w"
-#define ALIAS_EXCLUDED_COLUMNS  "x"
-#define ALIAS_SHOW_META         "t"
-#define ALIAS_MD5_MODE          "d"
-#define ALIAS_FORCE             "f"
-#define ALIAS_UNLOCK            "u"
-#define ALIAS_BLOB_CHECKSUM     "b"
-
-
-/* *******************************************************************
-the dump context contains all informations needed to execute the dump
-******************************************************************* */
-typedef struct context
-{
-    /* read from commandline */
-    char *src_path;
-    char *dst_path;
-    const char *kfg_path;    
-    const KNamelist *src_schema_list;
-    const char *table;
-    const char *columns;
-    const char *excluded_columns;
-    num_gen *row_generator;
-    bool usage_requested;
-    bool dont_check_accession;
-    uint64_t platform_id;
-    bool ignore_reject;
-    bool ignore_redact;
-    bool show_matching;
-    bool show_progress;
-    bool ignore_incomp;
-    bool reindex;
-    bool show_redact;
-    bool show_meta;
-    uint8_t md5_mode;
-    uint8_t blob_checksum;
-    bool force_kcmInit;
-    bool force_unlock;
-
-    /* set by application */
-    bool dont_remove_target;
-    config_values config;
-    redact_vals * rvals;
-    /* for the destination table*/
-    char * dst_schema_tabname;
-    /* legacy related parameters */
-    char * legacy_schema_file;
-    char * legacy_dont_copy;
-} context;
-typedef context* p_context;
-
-
-/*
- * generates a new context, initializes values
-*/
-rc_t context_init( context **ctx );
-
-
-/*
- * destroys a context, frees all pointers the context owns
-*/
-rc_t context_destroy( p_context ctx );
-
-
-/*
- * performs the range check to trim the internal number
- * generator to the given range
-*/
-rc_t context_range_check( p_context ctx, 
-                          const int64_t first, const uint64_t count );
-
-
-rc_t context_set_range( p_context ctx, 
-                        const int64_t first, const uint64_t count );
-
-/*
- * returns the number of schema's given on the commandline
-*/
-uint32_t context_schema_count( p_context ctx );
-
-
-/*
- * reads all arguments and options, fills the context
- * with copies (if strings) of this data
-*/
-rc_t context_capture_arguments_and_options( const Args * args, p_context ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/copy_meta.c b/tools/vdb-copy/copy_meta.c
deleted file mode 100644
index f80feed..0000000
--- a/tools/vdb-copy/copy_meta.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-copy-includes.h"
-#include "vdb-copy.vers.h"
-#include "definitions.h"
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/time.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <sysalloc.h>
-#include <stdlib.h>
-#include <time.h>
-#include <string.h>
-#include <assert.h>
-
-static rc_t copy_metadata_data ( const KMDataNode *snode, KMDataNode *dnode )
-{
-    char buffer [ 1024 ];
-    size_t total, bytes, remaining;
-    /* copy node data unless already set */
-    rc_t rc = KMDataNodeRead ( dnode, 0, buffer, 0, & bytes, & total );
-    DISP_RC( rc, "copy_metadata_child:KMDataNodeRead(dst) failed" );
-    if ( rc == 0 && total == 0 )
-    do
-    {
-        rc = KMDataNodeRead ( snode, total, buffer, sizeof buffer, & bytes, & remaining );
-        DISP_RC( rc, "copy_metadata_child:KMDataNodeRead(src) failed" );
-        if ( rc == 0 )
-        {
-            rc = KMDataNodeAppend ( dnode, buffer, bytes );
-            DISP_RC( rc, "copy_metadata_child:KMDataNodeAppend(dst) failed" );
-            if ( rc != 0 ) break;
-        }
-        total += bytes;
-     } while ( remaining != 0 );
-    return rc;
-}
-
-
-static rc_t copy_metadata_attribs ( const KMDataNode *snode, KMDataNode *dnode,
-                                    const char *node_path, const bool show_meta )
-{
-    KNamelist *attrs;
-    uint32_t i, count;
-    rc_t rc = KMDataNodeListAttr ( snode, & attrs );
-    DISP_RC( rc, "copy_metadata_child:KMDataNodeListAttr(src) failed" );
-    if ( rc != 0 ) return rc;
-    rc = KNamelistCount ( attrs, & count );
-    for ( i = 0; rc == 0 && i < count; ++ i )
-    {
-        const char *attr;
-        rc = KNamelistGet ( attrs, i, & attr );
-        if ( rc == 0 )
-        {
-            char buffer [ 1024 ];
-            size_t bytes;
-            /* test for attr existence */
-            rc = KMDataNodeReadAttr ( dnode, attr, buffer, sizeof buffer, & bytes );
-            if ( rc != 0 )
-            {
-                rc = KMDataNodeReadAttr ( snode, attr, buffer, sizeof buffer, & bytes );
-                if ( rc == 0 )
-                {
-                    if ( show_meta )
-                        KOutMsg( "copy atr %s : %s\n", node_path, attr );
-                    rc = KMDataNodeWriteAttr ( dnode, attr, buffer );
-                }
-            }
-        }
-        DISP_RC( rc, "copy_metadata_child:failed to copy attribute" );
-    }
-    KNamelistRelease ( attrs );
-    return rc;
-}
-
-
-static rc_t copy_metadata_child ( const KMDataNode *src_root, KMDataNode *dst_root,
-                                  const char *node_path, const bool show_meta )
-{
-    const KMDataNode *snode;
-    KMDataNode *dnode;
-    KNamelist *names;
-
-    rc_t rc = KMDataNodeOpenNodeRead ( src_root, & snode, node_path );
-    DISP_RC( rc, "copy_metadata_child:KMDataNodeOpenNodeRead(src) failed" );
-    if ( rc != 0 ) return rc;
-
-    if ( show_meta )
-        KOutMsg( "copy child-node: %s\n", node_path );
-
-    rc = KMDataNodeOpenNodeUpdate ( dst_root, & dnode, node_path );
-    DISP_RC( rc, "copy_metadata_child:KMDataNodeOpenNodeUpdate(dst) failed" );
-    if ( rc == 0 )
-    {
-        rc = copy_metadata_data ( snode, dnode );
-        if ( rc == 0 )
-            rc = copy_metadata_attribs ( snode, dnode, node_path, show_meta );
-        KMDataNodeRelease ( dnode );
-    }
-    else
-    {
-        PLOGMSG( klogInfo, ( klogInfo, 
-                 "cannot open child-node(dst): $(node)", "node=%s", node_path ));
-    }
-
-    if ( rc == 0 || ( GetRCState( rc ) == rcBusy ) )
-    {
-        rc = KMDataNodeListChild ( snode, & names );
-        DISP_RC( rc, "copy_metadata_child:KMDataNodeListChild(src) failed" );
-        if ( rc == 0 )
-        {
-            uint32_t i, count;
-            char temp_path[ 1024 ];
-            size_t temp_len;
-
-            string_copy ( temp_path, ( sizeof temp_path ) - 1, node_path, string_size( node_path ) );
-            temp_len = string_size( temp_path );
-            temp_path[ temp_len++ ] = '/';
-            temp_path[ temp_len ] = 0;
-            rc = KNamelistCount ( names, & count );
-            for ( i = 0; rc == 0 && i < count; ++ i )
-            {
-                const char *child_name;
-                rc = KNamelistGet ( names, i, & child_name );
-                if ( rc == 0 )
-                {
-                    string_copy( temp_path + temp_len, ( sizeof temp_path ) - temp_len, child_name, string_size( child_name ) );
-                    rc = copy_metadata_child ( src_root, dst_root, temp_path, show_meta );
-                    temp_path[ temp_len ] = 0;
-                }
-            }
-            KNamelistRelease ( names );
-        }
-    }
-
-    KMDataNodeRelease ( snode );
-    return rc;
-}
-
-
-static rc_t copy_metadata_root ( const KMDataNode *src_root, KMDataNode *dst_root,
-                                 const char * excluded_nodes,
-                                 const bool show_meta )
-{
-    KNamelist *names;
-    const KNamelist *excluded_names = NULL;
-    uint32_t i, count;
-
-    rc_t rc = KMDataNodeListChild ( src_root, & names );
-    DISP_RC( rc, "copy_metadata_root:KMDataNodeListChild() failed" );
-    if ( rc != 0 ) return rc;
-    
-    if ( excluded_nodes != NULL )
-    {
-        rc = nlt_make_namelist_from_string( &excluded_names, excluded_nodes );
-        DISP_RC( rc, "copy_metadata_root:nlt_make_namelist_from_string() failed" );
-        if ( rc != 0 ) return rc;
-    }
-
-    rc = KNamelistCount ( names, & count );
-    for ( i = 0; rc == 0 && i < count; ++ i )
-    {
-        const char *node_path;
-        rc = KNamelistGet ( names, i, & node_path );
-        DISP_RC( rc, "copy_metadata_root:KNamelistGet() failed" );
-        if ( rc == 0 )
-        {
-            bool is_excluded = false;
-            if ( excluded_names != NULL )
-                is_excluded = nlt_is_name_in_namelist( excluded_names, node_path );
-            if ( !is_excluded )
-                rc = copy_metadata_child ( src_root, dst_root, node_path, show_meta );
-        }
-    }
-
-    if ( excluded_names != NULL )
-        KNamelistRelease( excluded_names );
-    KNamelistRelease ( names );
-    return rc;
-}
-
-
-static rc_t copy_stray_metadata ( const KMetadata *src_meta, KMetadata *dst_meta,
-                                  const char * excluded_nodes,
-                                  const bool show_meta )
-{
-    /* open root node */
-    const KMDataNode *src_root;
-    rc_t rc = KMetadataOpenNodeRead ( src_meta, & src_root, NULL );
-    DISP_RC( rc, "copy_stray_metadata:KMetadataOpenNodeRead() failed" );
-    if ( rc == 0 )
-    {
-        KMDataNode *dst_root;
-        rc = KMetadataOpenNodeUpdate ( dst_meta, & dst_root, NULL );
-        DISP_RC( rc, "copy_stray_metadata:KMetadataOpenNodeUpdate() failed" );
-        if ( rc == 0 )
-        {
-            /* treat the root node in a special way */
-            rc = copy_metadata_root ( src_root, dst_root, excluded_nodes, show_meta );
-            KMDataNodeRelease ( dst_root );
-        }
-        KMDataNodeRelease ( src_root );
-    }
-    return rc;
-}
-
-#if 0
-static rc_t drop_all( KMetadata *dst_meta )
-{
-    KMDataNode *dst_node;
-    rc_t rc = KMetadataOpenNodeUpdate ( dst_meta, & dst_node, NULL );
-    DISP_RC( rc, "drop_all:KMetadataOpenNodeUpdate() failed" );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeDropAll ( dst_node );
-        DISP_RC( rc, "drop_all:KMetadataDropAll() failed" );
-        KMDataNodeRelease ( dst_node );
-    }
-    return rc;
-}
-#endif
-
-static rc_t copy_back_revisions ( const KMetadata *src_meta, VTable *dst_table,
-                                  const bool show_meta )
-{
-    uint32_t max_revision, revision;
-
-    rc_t rc = KMetadataMaxRevision ( src_meta, &max_revision );
-    DISP_RC( rc, "copy_back_revisions:KMetadataMaxRevision() failed" );
-    if ( rc != 0 ) return rc;
-    if ( max_revision == 0 ) return rc;
-    for ( revision = 1; revision <= max_revision && rc == 0; ++revision )
-    {
-        const KMetadata *src_rev_meta;
-
-        if ( show_meta )
-            KOutMsg( "+++copy metadata rev. #%u:\n", revision );
-        rc = KMetadataOpenRevision ( src_meta, &src_rev_meta, revision );
-        DISP_RC( rc, "copy_back_revisions:KMetadataOpenRevision() failed" );
-        if ( rc == 0 )
-        {
-            KMetadata *dst_meta;
-            rc = VTableOpenMetadataUpdate ( dst_table, & dst_meta );
-            DISP_RC( rc, "copy_table_meta:VTableOpenMetadataUpdate() failed" );
-            if ( rc == 0 )
-            {
-                rc = copy_stray_metadata ( src_rev_meta, dst_meta, NULL, show_meta );
-                if ( rc == 0 )
-                {
-                    rc = KMetadataCommit ( dst_meta );
-                    DISP_RC( rc, "copy_back_revisions:KMetadataCommit() failed" );
-                    if ( rc == 0 )
-                    {
-                        rc = KMetadataFreeze ( dst_meta );
-                        DISP_RC( rc, "copy_back_revisions:KMetadataFreeze() failed" );
-                    }
-                }
-                KMetadataRelease ( dst_meta );
-            }
-
-            KMetadataRelease ( src_rev_meta );
-        }
-    }
-    return rc;
-}
-
-static rc_t fill_timestring( char * s, size_t size )
-{
-    KTime tr;
-    rc_t rc;
-    
-    KTimeLocal ( &tr, KTimeStamp() );
-/*
-    rc = string_printf ( s, size, NULL, 
-                         "%.04u-%.02u-%.02u %.02u:%.02u:%.02u",
-                         tr.year, tr.month + 1, tr.day, tr.hour, tr.minute, tr.second );
-*/
-    rc = string_printf ( s, size, NULL, "%lT", &tr );
-
-    DISP_RC( rc, "fill_timestring:string_printf( date/time ) failed" );
-    return rc;
-}
-
-static rc_t enter_time( KMDataNode *node, const char * key )
-{
-    char timestring[ 160 ];
-    rc_t rc = fill_timestring( timestring, sizeof timestring );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeWriteAttr ( node, key, timestring );
-        DISP_RC( rc, "enter_time:KMDataNodeWriteAttr( timestring ) failed" );
-    }
-    return rc;
-}
-
-
-static rc_t enter_version( KMDataNode *node, const char * key )
-{
-    char buff[ 32 ];
-    rc_t rc;
-
-    rc = string_printf ( buff, sizeof( buff ), NULL, "%.3V", VDB_COPY_VERS );
-    assert ( rc == 0 );
-    rc = KMDataNodeWriteAttr ( node, key, buff );
-    DISP_RC( rc, "enter_version:KMDataNodeWriteAttr() failed" );
-    return rc;
-}
-
-
-static rc_t enter_date_name_vers( KMDataNode *node )
-{
-    rc_t rc = enter_time( node, "run" );
-    DISP_RC( rc, "enter_date_name_vers:enter_time() failed" );
-    if ( rc == 0 )
-    {
-        rc = KMDataNodeWriteAttr ( node, "tool", "vdb-copy" );
-        DISP_RC( rc, "enter_date_name_vers:KMDataNodeWriteAttr(tool=vdb-copy) failed" );
-        if ( rc == 0 )
-        {
-            rc = enter_version ( node, "vers" );
-            DISP_RC( rc, "enter_date_name_vers:enter_version() failed" );
-            if ( rc == 0 )
-            {
-                rc = KMDataNodeWriteAttr ( node, "build", __DATE__ );
-                DISP_RC( rc, "enter_date_name_vers:KMDataNodeWriteAttr(build=_DATE_) failed" );
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t enter_schema_update( KMetadata *dst_meta, const bool show_meta )
-{
-    rc_t rc;
-    KMDataNode *sw_node;
-
-    if ( show_meta )
-        KOutMsg( "--- entering schema-update\n" );
-
-    rc = KMetadataOpenNodeUpdate ( dst_meta, &sw_node, "SOFTWARE" );
-    DISP_RC( rc, "enter_schema_update:KMetadataOpenNodeUpdate('SOFTWARE') failed" );
-    if ( rc == 0 )
-    {
-        KMDataNode *update_node;
-        rc = KMDataNodeOpenNodeUpdate ( sw_node, &update_node, "update" );
-        DISP_RC( rc, "enter_schema_update:KMDataNodeOpenNodeUpdate('update') failed" );
-        if ( rc == 0 )
-        {
-            rc = enter_date_name_vers( update_node );
-            KMDataNodeRelease ( update_node );
-        }
-        KMDataNodeRelease ( sw_node );
-    }
-    return rc;
-}
-
-
-static uint32_t get_child_count( KMDataNode *node )
-{
-    uint32_t res = 0;
-    KNamelist *names;
-    rc_t rc = KMDataNodeListChild ( node, &names );
-    DISP_RC( rc, "get_child_count:KMDataNodeListChild() failed" );
-    if ( rc == 0 )
-    {
-        rc = KNamelistCount ( names, &res );
-        DISP_RC( rc, "get_child_count:KNamelistCount() failed" );
-        KNamelistRelease ( names );
-    }
-    return res;
-}
-
-
-static rc_t enter_vdbcopy_node( KMetadata *dst_meta, const bool show_meta )
-{
-    rc_t rc;
-    KMDataNode *hist_node;
-
-    if ( show_meta )
-        KOutMsg( "--- entering Copy entry...\n" );
-
-    rc = KMetadataOpenNodeUpdate ( dst_meta, &hist_node, "HISTORY" );
-    DISP_RC( rc, "enter_vdbcopy_node:KMetadataOpenNodeUpdate('HISTORY') failed" );
-    if ( rc == 0 )
-    {
-        char event_name[ 32 ];
-        uint32_t index = get_child_count( hist_node ) + 1;
-        rc = string_printf ( event_name, sizeof( event_name ), NULL, "EVENT_%u", index );
-        DISP_RC( rc, "enter_vdbcopy_node:string_printf(EVENT_NR) failed" );
-        if ( rc == 0 )
-        {
-            KMDataNode *event_node;
-            rc = KMDataNodeOpenNodeUpdate ( hist_node, &event_node, event_name );
-            DISP_RC( rc, "enter_vdbcopy_node:KMDataNodeOpenNodeUpdate('EVENT_NR') failed" );
-            if ( rc == 0 )
-            {
-                rc = enter_date_name_vers( event_node );
-                KMDataNodeRelease ( event_node );
-            }
-        }
-        KMDataNodeRelease ( hist_node );
-    }
-    return rc;
-}
-
-
-rc_t copy_table_meta ( const VTable *src_table, VTable *dst_table,
-                       const char * excluded_nodes,
-                       const bool show_meta, const bool schema_updated )
-{
-    const KMetadata *src_meta;
-    rc_t rc;
-
-    if ( src_table == NULL || dst_table == NULL )
-        return RC( rcExe, rcNoTarg, rcCopying, rcParam, rcNull );
-    /* it is OK if excluded_nodes is NULL */
-    
-    rc = VTableOpenMetadataRead ( src_table, & src_meta );
-    DISP_RC( rc, "copy_table_meta:VTableOpenMetadataRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = copy_back_revisions ( src_meta, dst_table, show_meta );
-        if ( rc == 0 )
-        {
-            KMetadata *dst_meta;
-            rc = VTableOpenMetadataUpdate ( dst_table, & dst_meta );
-            DISP_RC( rc, "copy_table_meta:VTableOpenMetadataUpdate() failed" );
-            if ( rc == 0 )
-            {
-                if ( show_meta )
-                    KOutMsg( "+++copy current metadata\n" );
-
-                rc = copy_stray_metadata ( src_meta, dst_meta, excluded_nodes,
-                                           show_meta );
-                if ( show_meta )
-                    KOutMsg( "+++end of copy current metadata\n" );
-
-                /* enter a attribute "vdb-copy" under '/SOFTWARE/update'
-                   *if the schema was updated ! */
-                if ( rc == 0 && schema_updated )
-                    rc = enter_schema_update( dst_meta, show_meta );
-
-                /* enter a unconditional node under '/SOFTWARE/Copy'
-                    <%TIMESTAMP%>
-                        <Application date="%DATE%" name="vdb-copy" vers="%VERSION%"/>
-                    </%TIMESTAMP%>
-                */
-                if ( rc == 0 )
-                    rc = enter_vdbcopy_node( dst_meta, show_meta );
-
-                KMetadataRelease ( dst_meta );
-            }
-        }
-        KMetadataRelease ( src_meta );
-    }
-    return rc;
-}
-
-
-rc_t copy_database_meta ( const VDatabase *src_db, VDatabase *dst_db,
-                          const char * excluded_nodes,
-                          const bool show_meta )
-{
-    const KMetadata *src_meta;
-    rc_t rc;
-
-    if ( src_db == NULL || dst_db == NULL )
-        return RC( rcExe, rcNoTarg, rcCopying, rcParam, rcNull );
-    /* it is OK if excluded_nodes is NULL */
-
-    rc = VDatabaseOpenMetadataRead ( src_db, & src_meta );
-    DISP_RC( rc, "copy_database_meta:VDatabaseOpenMetadataRead() failed" );
-    if ( rc == 0 )
-    {
-        KMetadata *dst_meta;
-        rc = VDatabaseOpenMetadataUpdate ( dst_db, & dst_meta );
-        DISP_RC( rc, "copy_database_meta:VDatabaseOpenMetadataUpdate() failed" );
-        if ( rc == 0 )
-        {
-            if ( show_meta )
-                KOutMsg( "+++copy current db-metadata\n" );
-
-            rc = copy_stray_metadata ( src_meta, dst_meta, excluded_nodes,
-                                       show_meta );
-            if ( show_meta )
-                KOutMsg( "+++end of copy db-current metadata\n" );
-
-            KMetadataRelease ( dst_meta );
-        }
-       KMetadataRelease ( src_meta );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/copy_meta.h b/tools/vdb-copy/copy_meta.h
deleted file mode 100644
index 0248c20..0000000
--- a/tools/vdb-copy/copy_meta.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_copy_meta_
-#define _h_copy_meta_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-rc_t copy_table_meta ( const VTable *src_table, VTable *dst_table,
-                       const char * excluded_nodes,
-                       const bool show_meta, const bool schema_updated );
-
-rc_t copy_database_meta ( const VDatabase *src_db, VDatabase *dst_db,
-                          const char * excluded_nodes,
-                          const bool show_meta );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/definitions.h b/tools/vdb-copy/definitions.h
deleted file mode 100644
index 0628692..0000000
--- a/tools/vdb-copy/definitions.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_definitions_
-#define _h_definitions_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_out_
-#include <klib/out.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#define DISP_RC(rc,err) (void)((rc == 0) ? 0 : LogErr( klogInt, rc, err ))
-
-#define DISP_RC2(rc,err,succ) \
-    (void)((rc != 0)? 0 : (succ) ? LOGMSG( klogInfo, succ ) : LogErr( klogInt, rc, err ))
-
-#define DB_COPY_ENABLED 1
-
-#define ALLOW_EXTERNAL_CONFIG 1
-
-#define SRA_PF_UNDEF 0
-#define SRA_PF_454 1
-#define SRA_PF_ILLUMINA 2
-#define SRA_PF_ABSOLID 3
-#define SRA_PF_COMPLETE_GENOMICS 4
-#define SRA_PF_HELICOS 5
-#define SRA_PF_UNKNOWN 6
-
-#define SRA_READ_FILTER_PASS 0
-#define SRA_READ_FILTER_REJECT 1
-#define SRA_READ_FILTER_CRITERIA 2
-#define SRA_READ_FILTER_REDACTED 3
-
-#define MD5_MODE_OFF 1
-#define MD5_MODE_ON 2
-#define MD5_MODE_AUTO 3
-
-#define BLOB_CHECKSUM_OFF 1
-#define BLOB_CHECKSUM_CRC32 2
-#define BLOB_CHECKSUM_MD5 3
-#define BLOB_CHECKSUM_AUTO 4
-
-#define TYPESPEC_BUF_LEN 128
-
-#define VDB_COPY_PREFIX "/VDBCOPY/"
-
-#define READ_FILTER_COL_NAME_KEY "/VDBCOPY/READ_FILTER_COL_NAME"
-#define READ_FILTER_COL_NAME "READ_FILTER"
-
-#define REDACTABLE_LIST_KEY "/VDBCOPY/REDACTVALUE/TYPES"
-
-#define REDACTABLE_TYPES_KEY "/VDBCOPY/REDACTABLE_TYPES"
-#define REDACTABLE_TYPES "INSDC:dna:text,INSDC:4na:bin,INSDC:4na:packed,INSDC:2na:bin,INSDC:x2na:bin,INSDC:2na:packed,INSDC:color:text,INSDC:2cs:bin,INSDC:x2cs:bin,INSDC:2cs:packed,INSDC:quality:phred,INSDC:quality:log_odds,INSDC:quality:text:phred_33,INSDC:quality:text:phred_64,INSDC:quality:text:log_odds_64,INSDC:position:zero,INSDC:position:one,NCBI:isamp1,NCBI:fsamp1,NCBI:fsamp4,NCBI:SRA:pos16,NCBI:SRA:encoded_qual4"
-
-#define DO_NOT_REDACT_KEY "/VDBCOPY/DO_NOT_REDACT"
-
-#define META_IGNORE_NODES_KEY "/VDBCOPY/META/IGNORE"
-#define META_IGNROE_NODES_DFLT "col,.seq,STATS"
-
-#define TYPE_SCORE_PREFIX "/VDBCOPY/SCORE/"
-
-#define LEGACY_SCHEMA_KEY "/schema"
-#define LEGACY_TAB_KEY "/tab"
-#define LEGACY_EXCLUDE_KEY "/dont_use"
-
-#define REDACTVALUE_PREFIX "/VDBCOPY/REDACTVALUE/"
-#define REDACTVALUE_VALUE_POSTFIX "/VALUE"
-#define REDACTVALUE_LEN_POSTFIX "/LEN"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/get_platform.c b/tools/vdb-copy/get_platform.c
deleted file mode 100644
index ed8ae42..0000000
--- a/tools/vdb-copy/get_platform.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "get_platform.h"
-#include <sysalloc.h>
-#include <stdlib.h> /* for malloc */
-#include <string.h> /* for memcpy */
-
-#define PLATFORM_COL "(ascii)PLATFORM"
-
-static rc_t get_platform_from_table( const VTable *my_table, char ** dst, 
-                                     const char pre_and_postfix )
-{
-    const VCursor *my_cursor;
-    rc_t rc = VTableCreateCursorRead( my_table, &my_cursor );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpen( my_cursor );
-        if ( rc == 0 )
-        {
-            uint32_t col_idx;
-            rc = VCursorAddColumn( my_cursor, &col_idx, PLATFORM_COL );
-            if ( rc == 0 )
-            {
-                rc = VCursorSetRowId( my_cursor, 1 );
-                if ( rc == 0 )
-                {
-                    rc = VCursorOpenRow( my_cursor );
-                    if ( rc == 0 )
-                    {
-                        const void *src_buffer;
-                        uint32_t offset_in_bits;
-                        uint32_t element_count;
-                    
-                        rc = VCursorCellData( my_cursor, col_idx, NULL,
-                            &src_buffer, &offset_in_bits, &element_count );
-                        if ( rc == 0 )
-                        {
-                            char *src_ptr = (char*)src_buffer + ( offset_in_bits >> 3 );
-                            if ( pre_and_postfix != 0 )
-                                *dst = malloc( element_count + 3 );
-                            else
-                                *dst = malloc( element_count + 1 );
-                            if ( *dst != NULL )
-                            {
-                                if ( pre_and_postfix != 0 )
-                                {
-                                    (*dst)[ 0 ] = pre_and_postfix;
-                                    memcpy( &(*dst)[1], src_ptr, element_count );
-                                    (*dst)[ element_count + 1 ] = pre_and_postfix;
-                                    (*dst)[ element_count + 2 ] = 0;
-                                }
-                                else
-                                {
-                                    memcpy( *dst, src_ptr, element_count );
-                                    (*dst)[ element_count ] = 0;
-                                }
-                            }
-                            else
-                                rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-                        }
-                        VCursorCloseRow( my_cursor );
-                    }
-                }
-            }
-        }
-        VCursorRelease( my_cursor );
-    }
-    return rc;
-}
-
-rc_t get_table_platform( const char * table_path, char ** dst, 
-                         const char pre_and_postfix )
-{
-    rc_t rc;
-    KDirectory *my_directory;
-    
-    if ( table_path == NULL || dst == 0 )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-    rc = KDirectoryNativeDir( &my_directory );
-    if ( rc == 0 )
-    {
-        VDBManager *my_manager;
-        rc = VDBManagerMakeUpdate ( &my_manager, my_directory );
-        if ( rc == 0 )
-        {
-            VSchema *my_schema;
-            rc = VDBManagerMakeSRASchema( my_manager, &my_schema );
-            if ( rc == 0 )
-            {
-                const VTable *my_table;
-                rc = VDBManagerOpenTableRead( my_manager, &my_table, my_schema, table_path );
-                if ( rc == 0 )
-                {
-                    rc = get_platform_from_table( my_table, dst, pre_and_postfix );
-                    VTableRelease( my_table );
-                }
-                VSchemaRelease( my_schema );
-            }
-            VDBManagerRelease( my_manager );
-        }
-        KDirectoryRelease( my_directory );
-    }
-    return rc;
-}
-
-rc_t get_db_platform( const char * db_path, const char * tab_name, 
-                      char ** dst, const char pre_and_postfix )
-{
-    rc_t rc;
-    KDirectory *my_directory;
-    
-    if ( db_path == NULL || tab_name == 0 || dst == 0 )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-    rc = KDirectoryNativeDir( &my_directory );
-    if ( rc == 0 )
-    {
-        VDBManager *my_manager;
-        rc = VDBManagerMakeUpdate ( &my_manager, my_directory );
-        if ( rc == 0 )
-        {
-            VSchema *my_schema;
-            rc = VDBManagerMakeSRASchema( my_manager, &my_schema );
-            if ( rc == 0 )
-            {
-                const VDatabase *my_database;
-                rc = VDBManagerOpenDBRead( my_manager, &my_database, my_schema, db_path );
-                if ( rc == 0 )
-                {
-                    const VTable *my_table;
-                    rc = VDatabaseOpenTableRead( my_database, &my_table, tab_name );
-                    if ( rc == 0 )
-                    {
-                        rc = get_platform_from_table( my_table, dst, pre_and_postfix );
-                        VTableRelease( my_table );
-                    }
-                    VDatabaseRelease( my_database );
-                }
-                VSchemaRelease( my_schema );
-            }
-            VDBManagerRelease( my_manager );
-        }
-        KDirectoryRelease( my_directory );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/get_platform.h b/tools/vdb-copy/get_platform.h
deleted file mode 100644
index 2961f6d..0000000
--- a/tools/vdb-copy/get_platform.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_get_platform_
-#define _h_get_platform_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-rc_t get_table_platform( const char * table_path, char ** dst,
-                         const char pre_and_postfix );
-rc_t get_db_platform( const char * db_path, const char * tab_name, 
-                      char ** dst, const char pre_and_postfix );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/helper.c b/tools/vdb-copy/helper.c
deleted file mode 100644
index 8e40b2e..0000000
--- a/tools/vdb-copy/helper.c
+++ /dev/null
@@ -1,919 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "helper.h"
-#include "definitions.h"
-#include <os-native.h>
-
-/* this is here to detect the md5-mode of the src-table */
-#include <kdb/kdb-priv.h>
-#include <kdb/table.h>
-
-#include <sysalloc.h>
-
-#include <bitstr.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <ctype.h>
-
-int64_t strtoi64( const char* str, char** endp, uint32_t base )
-{
-    int i = 0;
-    int64_t ret_value = 0;
-
-    if ( str != NULL && base != 1 && base <= 36 )
-    {
-        bool negate = false;
-
-        for ( ; isspace( str [ i ] ); ++ i )
-            ( void ) 0;
-
-        switch ( str [ i ] )
-        {
-        case '-':
-            negate = true;
-        case '+':
-            ++ i;
-            break;
-        }
-
-        if ( base == 0 )
-        {
-            if ( str [ i ] != '0' )
-                base = 10;
-            else if ( tolower ( str [ i + 1 ] == 'x' ) )
-            {
-                base = 16;
-                i += 2;
-            }
-            else
-            {
-                base = 8;
-                i += 1;
-            }
-        }
-
-        if ( base <= 10 )
-        {
-            for ( ; isdigit ( str [ i ] ); ++ i )
-            {
-                uint32_t digit = str [ i ] - '0';
-                if ( digit >= base )
-                    break;
-                ret_value *= base;
-                ret_value += digit;
-            }
-        }
-        else
-        {
-            for ( ; ; ++ i )
-            {
-                if ( isdigit ( str [ i ] ) )
-                {
-                    ret_value *= base;
-                    ret_value += str [ i ] - '0';
-                }
-                else if ( ! isalpha ( str [ i ] ) )
-                    break;
-                else
-                {
-                    uint32_t digit = toupper ( str [ i ] ) - 'A' + 10;
-                    if ( digit >= base )
-                        break;
-                    ret_value *= base;
-                    ret_value += digit;
-                }
-            }
-        }
-
-        if ( negate )
-            ret_value = - ret_value;
-    }
-
-    if ( endp != NULL )
-        * endp = (char *)str + i;
-
-    return ret_value;
-}
-
-
-uint64_t strtou64( const char* str, char** endp, uint32_t base )
-{
-    return strtoi64( str, endp, base );
-}
-
-
-/*
- * calls the given manager to create a new SRA-schema
- * takes the list of user-supplied schema's (which can be empty)
- * and let the created schema parse all of them
-*/
-rc_t helper_parse_schema( const VDBManager *my_manager,
-                          VSchema **new_schema,
-                          const KNamelist *schema_list )
-{
-    rc_t rc;
-    if ( my_manager == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    if ( new_schema == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-
-    rc = VDBManagerMakeSRASchema( my_manager, new_schema );
-    DISP_RC( rc, "VDBManagerMakeSRASchema() failed" );
-
-    if ( ( rc == 0 )&&( schema_list != NULL ) )
-    {
-        uint32_t count;
-        if ( KNamelistCount( schema_list, &count ) == 0 )
-        {
-            uint32_t idx;
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *s;
-                if ( KNamelistGet( schema_list, idx, &s ) == 0 )
-                {
-                    rc = VSchemaParseFile( *new_schema, s );
-                    DISP_RC( rc, "VSchemaParseFile() failed" );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-#if TOOLS_USE_SRAPATH != 0
-static char *translate_accession( SRAPath *my_sra_path,
-                           const char *accession,
-                           const size_t bufsize )
-{
-    rc_t rc;
-    char * res = calloc( 1, bufsize );
-    if ( res == NULL ) return NULL;
-
-    rc = SRAPathFind( my_sra_path, accession, res, bufsize );
-    if ( GetRCState( rc ) == rcNotFound )
-    {
-        free( res );
-        return NULL;
-    }
-    else if ( GetRCState( rc ) == rcInsufficient )
-    {
-        free( res );
-        return translate_accession( my_sra_path, accession, bufsize * 2 );
-    }
-    else if ( rc != 0 )
-    {
-        free( res );
-        return NULL;
-    }
-    return res;
-}
-#endif
-
-
-#if TOOLS_USE_SRAPATH != 0
-rc_t helper_resolve_accession( const KDirectory *my_dir, char ** path )
-{
-    SRAPath *my_sra_path;
-    rc_t rc = 0;
-
-    if ( strchr ( *path, '/' ) != NULL )
-        return 0;
-
-    rc = SRAPathMake( &my_sra_path, my_dir );
-    if ( rc != 0 )
-    {
-        if ( GetRCState ( rc ) != rcNotFound || GetRCTarget ( rc ) != rcDylib )
-            DISP_RC( rc, "SRAPathMake() failed" );
-        else
-            rc = 0;
-    }
-    else
-    {
-        if ( !SRAPathTest( my_sra_path, *path ) )
-        {
-            char *buf = translate_accession( my_sra_path, *path, 64 );
-            if ( buf != NULL )
-            {
-                free( (char*)(*path) );
-                *path = buf;
-            }
-        }
-        SRAPathRelease( my_sra_path );
-    }
-    return rc;
-}
-#endif
-
-
-/*
- * calls VTableTypespec to discover the table-name out of the schema
- * the given table has to be opened!
-*/
-#define MAX_SCHEMA_TABNAME_LENGHT 80
-rc_t helper_get_schema_tab_name( const VTable *my_table, char ** name )
-{
-    rc_t rc;
-    char *s;
-    
-    if ( my_table == NULL || name == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-
-    *name = NULL;
-    s = malloc( MAX_SCHEMA_TABNAME_LENGHT + 1 );
-    if ( s == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-
-    rc = VTableTypespec ( my_table, s, MAX_SCHEMA_TABNAME_LENGHT );
-    if ( rc == 0 )
-        *name = s;
-    else
-        free( s );
-
-    return rc;
-}
-
-
-/*
- * reads a string out of a vdb-table:
- * needs a open cursor, a row-idx and the index of the column
- * it opens the row, requests a pointer via VCursorCellData()
- * malloc's the dst-pointer and copies the string into it
- * a 0-termination get's attached
- * finally it closes the row
-*/
-rc_t helper_read_vdb_string( const VCursor* src_cursor,
-                             const uint64_t row_idx,
-                             const uint32_t col_idx,
-                             char ** dst )
-{
-    rc_t rc;
-
-    if ( dst == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-
-    *dst = NULL;
-    rc = VCursorSetRowId( src_cursor, row_idx );
-    DISP_RC( rc, "helper_read_string:VCursorSetRowId() failed" );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpenRow( src_cursor );
-        DISP_RC( rc, "helper_read_string:VCursorOpenRow() failed" );
-        if ( rc == 0 )
-        {
-            const void *src_buffer;
-            uint32_t offset_in_bits;
-            uint32_t element_bits;
-            uint32_t element_count;
-
-            rc = VCursorCellData( src_cursor, col_idx, &element_bits,
-                  &src_buffer, &offset_in_bits, &element_count );
-            DISP_RC( rc, "helper_read_string:VCursorCellData() failed" );
-            if ( rc == 0 )
-            {
-                char *src_ptr = (char*)src_buffer + ( offset_in_bits >> 3 );
-                *dst = malloc( element_count + 1 );
-                if ( *dst != NULL )
-                {
-                    memcpy( *dst, src_ptr, element_count );
-                    (*dst)[ element_count ] = 0;
-                }
-                else
-                    rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            }
-            VCursorCloseRow( src_cursor );
-            DISP_RC( rc, "helper_read_string:VCursorClose() failed" );
-        }
-    }
-    return rc;
-}
-
-uint8_t BitLength2Bytes[65] =
-{
-         /* 0  1  2  3  4  5  6  7  8  9*/
-   /* 0 */  0, 1, 1, 1, 1, 1, 1, 1, 1, 2,
-   /* 1 */  2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
-   /* 2 */  3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
-   /* 3 */  4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
-   /* 4 */  5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
-   /* 5 */  7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
-   /* 6 */  8, 8, 8, 8, 8
-};
-
-/*************************************************************************************
-n_bits   [IN] ... number of bits
-
-calculates the number of bytes that have to be copied to contain the given
-number of bits
-*************************************************************************************/
-static uint16_t bitlength_2_bytes( const size_t n_bits )
-{
-    if ( n_bits > 64 )
-        return 8;
-    else
-        return BitLength2Bytes[ n_bits ];
-}
-
-
-/*
- * reads a int64 out of a vdb-table:
- * needs a open cursor, row-id already set, row opened
- * it copies the data via memmove where to the dst-pointer
- * points to / the size in the vdb-table can be smaller
-*/
-rc_t helper_read_vdb_int_row_open( const VCursor* src_cursor,
-                          const uint32_t col_idx, uint64_t * dst )
-{
-    const void *src_buffer;
-    uint32_t offset_in_bits;
-    uint32_t element_bits;
-    uint32_t element_count;
-
-    rc_t rc = VCursorCellData( src_cursor, col_idx, &element_bits,
-                  &src_buffer, &offset_in_bits, &element_count );
-    DISP_RC( rc, "helper_read_int_intern:VCursorCellData() failed" );
-    if ( rc == 0 )
-    {
-        uint64_t value = 0;
-        char *src_ptr = (char*)src_buffer + ( offset_in_bits >> 3 );
-        if ( ( offset_in_bits & 7 ) == 0 )
-            memmove( &value, src_ptr, bitlength_2_bytes( element_bits ) );
-        else
-            bitcpy ( &value, 0, src_ptr, offset_in_bits, element_bits );
-        *dst = value;
-    }
-    return rc;
-}
-
-
-/*
- * reads a int64 out of a vdb-table:
- * needs a open cursor, it opens the row,
- * calls helper_read_vdb_int_row_open()
- * finally it closes the row
-*/
-rc_t helper_read_vdb_int( const VCursor* src_cursor,
-                          const uint64_t row_idx,
-                          const uint32_t col_idx,
-                          uint64_t * dst )
-{
-    rc_t rc;
-
-    if ( src_cursor == NULL || dst == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-
-    *dst = 0;
-    rc = VCursorSetRowId( src_cursor, row_idx );
-    DISP_RC( rc, "helper_read_int:VCursorSetRowId() failed" );
-    if ( rc == 0 )
-    {
-        rc = VCursorOpenRow( src_cursor );
-        DISP_RC( rc, "helper_read_int:VCursorOpenRow() failed" );
-        if ( rc == 0 )
-        {
-            rc = helper_read_vdb_int_row_open( src_cursor, col_idx, dst );
-            VCursorCloseRow( src_cursor );
-            DISP_RC( rc, "helper_read_int:VCursorClose() failed" );
-        }
-    }
-    return rc;
-}
-
-
-/*
- * reads a string out of a KConfig-object:
- * needs a cfg-object, and the full name of the key(node)
- * it opens the node, discovers the size, malloc's the string,
- * reads the string and closes the node
-*/
-rc_t helper_read_cfg_str( const KConfig *cfg, const char * key,
-                          char ** value )
-{
-    const KConfigNode *node;
-    rc_t rc;
-    
-    if ( value == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
- 
-    *value = NULL;
-    rc = KConfigOpenNodeRead ( cfg, &node, key );
-    /* it is OK if we do not find it, so no DISP_RC here */
-    if ( rc == 0 )
-    {
-        size_t num_read, remaining;
-        /* first we ask about the size to be read */
-        rc = KConfigNodeRead ( node, 0, NULL, 0, &num_read, &remaining );
-        DISP_RC( rc, "helper_read_config_str:KConfigNodeRead(1) failed" );
-        if ( rc == 0 )
-        {
-            *value = malloc( remaining + 1 );
-            if ( *value )
-            {
-                size_t to_read = remaining;
-                rc = KConfigNodeRead ( node, 0, *value, to_read, &num_read, &remaining );
-                DISP_RC( rc, "helper_read_config_str:KConfigNodeRead(2) failed" );
-                if ( rc == 0 )
-                    (*value)[ num_read ] = 0;
-            }
-            else
-                rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        }
-        KConfigNodeRelease( node );
-    }
-    return rc;
-}
-
-
-/*
- * reads a uint64 out of a KConfig-object:
- * needs a cfg-object, and the full name of the key(node)
- * it calls helper_read_cfg_str() to read the node as string
- * and converts it via strtou64() into a uint64
-*/
-rc_t helper_read_cfg_int( const KConfig *cfg, const char * key,
-                          uint64_t * value )
-{
-    char *str_value;
-    rc_t rc;
-
-    if ( value == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-    *value = 0;
-    
-    rc = helper_read_cfg_str( cfg, key, &str_value );
-    DISP_RC( rc, "helper_read_config_int:helper_read_config_str() failed" );
-    if ( rc == 0 )
-    {
-        *value = strtou64( str_value, NULL, 0 );
-        free( str_value );
-    }
-    return rc;
-}
-
-
-/*
- * tries to detect if the given name of a schema-table is
- * a schema-legacy-table, it needs the vdb-manager to
- * open a sra-schema and request this schema to list all
- * legacy tables, then it searches in that list for the
- * given table-name
-*/
-rc_t helper_is_tablename_legacy( const VDBManager *my_manager,
-            const char * tabname, bool * flag )
-{
-    VSchema *schema;
-    rc_t rc;
-
-    if ( flag == NULL )
-        return RC( rcExe, rcNoTarg, rcConstructing, rcParam, rcNull );
-    *flag = false;
-
-    rc = VDBManagerMakeSRASchema ( my_manager, &schema );
-    DISP_RC( rc, "helper_is_tablename_legacy:VDBManagerMakeSRASchema() failed" );
-    if ( rc == 0 )
-    {
-        KNamelist *list;
-        rc = VSchemaListLegacyTables ( schema, &list );
-        DISP_RC( rc, "helper_is_tablename_legacy:VSchemaListLegacyTables() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount ( list, &count );
-            DISP_RC( rc, "helper_is_tablename_legacy:KNamelistCoun() failed" );
-            if ( rc == 0 )
-            {
-                uint32_t idx = 0;
-                size_t tabname_len = string_size ( tabname );
-                while( idx < count && rc == 0 && *flag == false )
-                {
-                    const char * name;
-                    rc = KNamelistGet ( list, idx, &name );
-                    if ( rc == 0 )
-                    {
-                        size_t len = string_size ( name );
-                        if ( string_cmp ( name, len, tabname, tabname_len,
-                             ( len < tabname_len ) ? len : tabname_len ) == 0 )
-                            *flag = true;
-                    }
-                    idx++;
-                }
-            }
-            KNamelistRelease( list );
-        }
-        VSchemaRelease( schema );
-    }
-    return rc;
-}
-
-
-/*
- * helper-function to replace all ':' and '#' chars
- * with '_' chars
-*/
-static void helper_process_c_str( char * s )
-{
-    size_t idx, len = string_measure ( s, NULL );
-    for ( idx = 0; idx < len; ++idx )
-    {
-        if ( s[ idx ] == ':' || s[ idx ] == '#' )
-            s[ idx ] = '_';
-    }
-}
-
-
-/*
- * helper-function to replace all ':' and '#' chars
- * with '_' chars
-*/
-static void helper_process_cfg_key( String *s )
-{
-    uint32_t idx;
-    for ( idx = 0; idx < s->len; ++idx )
-    {
-        if ( s->addr[ idx ] == ':' || s->addr[ idx ] == '#' )
-            ( (char *)(s->addr) )[ idx ] = '_';
-    }
-}
-
-
-/*
- * helper-function to read the value of cfg-node
- * if key_sel = xxx and s_sub = yyy
- * the node-name is formed like that "/VDBCOPY/xxx/yyy"
- * to read the value helper_read_cfg_str() is called
-*/
-static rc_t helper_get_legacy_node( KConfig *cfg,
-        String *key_sel, const char * s_sub, char ** dst )
-{
-    String key_prefix, key_sub;
-    const String *temp;
-    const String *key;
-    rc_t rc;
-
-    StringInitCString( &key_prefix, VDB_COPY_PREFIX );
-    rc = StringConcat ( &temp, &key_prefix, key_sel );
-    if ( rc != 0 ) return rc;
-    
-    StringInitCString( &key_sub, s_sub );
-    rc = StringConcat ( &key, temp, &key_sub );
-    StringWhack ( temp );
-    if ( rc != 0 ) return rc;
-    
-    rc = helper_read_cfg_str( cfg, key->addr, dst );
-    StringWhack ( key );
-    return rc;
-}
-
-
-/*
- * helper-function to read the value of a cfg-node
- * if pf = "_454_", schema = "NCBI_SRA__454__tbl_v0_1"
- * and postfix = "tab" it first tries to read:
- *      "/VDBCOPY/NCBI_SRA__454__tbl_v0_1/tab"
- * if this node is not found it tries to read:
- *      "/VDBCOPY/_454_/tab"
- * if this node is not found it is a error
-*/
-static rc_t helper_get_legacy_value( KConfig *cfg,
-        String *pf, String *schema, const char * postfix, char ** dst )
-{
-    /* first try to find the value under the src-schema-key */
-    rc_t rc = helper_get_legacy_node( cfg, schema, postfix, dst );
-    /* if this fails try to find it mapped to the platform */
-    if ( rc != 0 )
-        rc = helper_get_legacy_node( cfg, pf, postfix, dst );
-    return rc;
-}
-
-
-/*
- * this function tries to read 3 strings out of cfg-nodes
- * (1) the name of the schema-file to be used to copy to
- * (2) the name of the table to be used inside the schema
- * (3) a list of columns that should not be copied
- * if (3) cannot be found it is not a error
- * it needs as input the cfg-object, the name of the 
- * (src)legacy-platform and the name of the
- * (src)schema-table
-*/
-rc_t helper_get_legacy_write_schema_from_config( KConfig *cfg,
-    const char * platform,
-    const char * src_schema,
-    char ** legacy_schema_file, char ** legacy_schema_tab,
-    char ** legacy_dont_copy )
-{
-    rc_t rc;
-    String key_pf, key_schema;
-
-    StringInitCString( &key_pf, platform );
-    helper_process_cfg_key( &key_pf );
-    StringInitCString( &key_schema, src_schema );
-    helper_process_cfg_key( &key_pf );
-
-    rc = helper_get_legacy_value( cfg, &key_pf, &key_schema, 
-                LEGACY_SCHEMA_KEY, legacy_schema_file );
-    if ( rc != 0 ) return rc;
-    
-    rc = helper_get_legacy_value( cfg, &key_pf, &key_schema,
-                LEGACY_TAB_KEY, legacy_schema_tab );
-    if ( rc != 0 ) return rc;
-
-    /* dont_use is optional, no error if not found! */
-    helper_get_legacy_value( cfg, &key_pf, &key_schema,
-                LEGACY_EXCLUDE_KEY, legacy_dont_copy );
-    return 0;
-}
-
-
-/*
- * this function creates a config-manager, by passing in
- * a KDirectory-object representing the given path
- * this will include the the given path into the search
- * for *.kfg - files
-*/
-rc_t helper_make_config_mgr( KConfig **config_mgr, const char * path )
-{
-#if ALLOW_EXTERNAL_CONFIG
-    KDirectory *directory;
-    const KDirectory *config_sub_dir;
-
-    rc_t rc = KDirectoryNativeDir( &directory );
-    if ( rc != 0 ) return rc;
-    rc = KDirectoryOpenDirRead ( directory, &config_sub_dir, false, path );
-    if ( rc == 0 )
-    {
-        rc = KConfigMake ( config_mgr, config_sub_dir );
-        KDirectoryRelease( config_sub_dir );
-    }
-    KDirectoryRelease( directory );
-#else
-    rc_t rc = KConfigMake ( config_mgr, NULL );
-#endif
-    return rc;
-}
-
-
-/*
- * this function tries to read the lossynes-score of a vdb-type
- * out of a config-object
- * it constructs a node-name-string like this:
- *      "/VDBCOPY/SCORE/INSDC_2na_bin"
- * INSDC/2na/bin is the name of the type with ":" replaced by "_"
- * it reads the value by calling helper_read_cfg_str()
-*/
-uint32_t helper_rd_type_score( const KConfig *cfg, 
-                               const char *type_name )
-{
-    uint32_t res = 0;
-    if ( cfg != NULL && type_name != NULL && type_name[0] != 0 )
-    {
-        uint32_t prefix_len = string_measure ( TYPE_SCORE_PREFIX, NULL ) + 1;
-        uint32_t len = string_measure ( type_name, NULL ) + prefix_len;
-        char *s = malloc( len );
-        if ( s != NULL )
-        {
-            char *value;
-            size_t n = string_copy_measure ( s, len, TYPE_SCORE_PREFIX );
-            string_copy_measure( &(s[n]), len, type_name );
-            helper_process_c_str( s );
-            if ( helper_read_cfg_str( cfg, s, &value ) == 0 )
-            {
-                if ( value != NULL )
-                {
-                    res = strtol( value, NULL, 0 );
-                    free( value );
-                }
-            }
-            free( s );
-        }
-    }
-    return res;
-}
-
-
-/* remove the target-table if something went wrong */
-rc_t helper_remove_path( KDirectory * directory, const char * path )
-{
-    rc_t rc;
-
-    PLOGMSG( klogInfo, ( klogInfo, "removing '$(path)'", "path=%s", path ));
-    rc = KDirectoryRemove ( directory, true, path );
-    DISP_RC( rc, "vdb_copy_remove_table:KDirectoryRemove() failed" );
-    return rc;
-}
-
-
-bool helper_is_this_a_filesystem_path( const char * path )
-{
-    bool res = false;
-    size_t i, n = string_size ( path );
-    for ( i = 0; i < n && !res; ++i )
-    {
-        char c = path[ i ];
-        res = ( c == '.' || c == '/' || c == '\\' );
-    }
-    return res;
-}
-
-
-static void helper_read_redact_value( KConfig * config_mgr, redact_vals * rvals,
-                               const char * type_name )
-{
-    rc_t rc;
-    String key_prefix, key_type, key_postfix;
-    const String * p1;
-
-    StringInitCString( &key_prefix, REDACTVALUE_PREFIX );
-    StringInitCString( &key_type, type_name );
-    StringInitCString( &key_postfix, REDACTVALUE_VALUE_POSTFIX );
-    rc = StringConcat ( &p1, &key_prefix, &key_type );
-    if ( rc == 0 )
-    {
-        const String * key;
-        rc = StringConcat ( &key, p1, &key_postfix );
-        if ( rc == 0 )
-        {
-            char * value_str;
-            rc = helper_read_cfg_str( config_mgr, key->addr, &value_str );
-            StringWhack ( key );
-            if ( rc == 0 )
-            {
-                StringInitCString( &key_postfix, REDACTVALUE_LEN_POSTFIX );
-                rc = StringConcat ( &key, p1, &key_postfix );
-                if ( rc == 0 )
-                {
-                    uint32_t idx, l, len = 1;
-                    char * endp, * len_str, * real_type;
-
-                    rc = helper_read_cfg_str( config_mgr, key->addr, &len_str );
-                    StringWhack ( key );
-                    if ( rc == 0 )
-                    {
-                        len = strtol( len_str, &endp, 0 );
-                        free( len_str );
-                    }
-
-                    real_type = string_dup_measure ( type_name, NULL );
-                    l = string_size ( real_type );
-                        
-                    /* transform the typename back into '_' ---> ':' real typename */
-                    for ( idx = 0; idx < l; ++idx )
-                        if ( real_type[idx] == '_' )
-                            real_type[idx] = ':';
-
-                    /* finally insert the redact-value-pair into the list */
-                    redact_vals_add( rvals, real_type, len, value_str );
-                    free( real_type );
-                }
-                free( value_str );
-            }
-        }
-        StringWhack ( p1 );
-    }
-}
-
-
-void helper_read_redact_values( KConfig * config_mgr, redact_vals * rvals )
-{
-    rc_t rc;
-    char * type_list_str;
-    const KNamelist *type_list;
-
-    /* first we read the list of redactable types */
-    helper_read_cfg_str( config_mgr, 
-            REDACTABLE_LIST_KEY, &type_list_str );
-    if ( type_list_str == NULL ) return;
-    rc = nlt_make_namelist_from_string( &type_list, type_list_str );
-    if ( rc == 0 && type_list != NULL )
-    {
-        uint32_t idx, count;
-        rc = KNamelistCount( type_list, &count );
-        if ( rc == 0 && count > 0 )
-            for ( idx = 0; idx < count; ++idx )
-            {
-                const char *type_name;
-                rc = KNamelistGet( type_list, idx, &type_name );
-                if ( rc == 0 )
-                    helper_read_redact_value( config_mgr, rvals, type_name );
-            }
-        KNamelistRelease( type_list );
-    }
-    free( type_list_str );
-}
-
-
-void helper_read_config_values( KConfig * config_mgr, p_config_values config )
-{
-    /* key's and default-values in definitions.h */
-
-    /* look for the name of the filter-column */
-    helper_read_cfg_str( config_mgr, 
-            READ_FILTER_COL_NAME_KEY, &(config->filter_col_name) );
-    if ( config->filter_col_name == NULL )
-        config->filter_col_name = string_dup_measure ( READ_FILTER_COL_NAME, NULL );
-
-    /* look for the comma-separated list of meta-nodes to be ignored */
-    helper_read_cfg_str( config_mgr, 
-            META_IGNORE_NODES_KEY, &(config->meta_ignore_nodes) );
-    if ( config->meta_ignore_nodes == NULL )
-        config->meta_ignore_nodes = string_dup_measure ( META_IGNROE_NODES_DFLT, NULL );
-
-    /* look for the comma-separated list of redactable types */
-    helper_read_cfg_str( config_mgr, 
-            REDACTABLE_TYPES_KEY, &(config->redactable_types) );
-    if ( config->redactable_types == NULL )
-        config->redactable_types = string_dup_measure ( REDACTABLE_TYPES, NULL );
-
-    /* look for the comma-separated list of columns which are protected from redaction */
-    helper_read_cfg_str( config_mgr, 
-            DO_NOT_REDACT_KEY, &(config->do_not_redact_columns) );
-}
-
-
-bool helper_detect_src_md5( const VTable * src_tab )
-{
-    rc_t rc;
-    const struct KTable * ktab;
-    bool res = false;
-
-    rc = VTableOpenKTableRead ( src_tab, &ktab );
-    if ( rc == 0 )
-    {
-        const struct KDirectory *dir;
-        rc = KTableOpenDirectoryRead ( ktab, &dir );
-        if ( rc == 0 )
-        {
-            /* ask for pathtype of "md5" */
-            uint32_t pt = KDirectoryPathType ( dir, "md5" );
-            if ( ( pt == kptFile )||( pt == ( kptFile | kptAlias ) ) )
-                res = true;
-            KDirectoryRelease( dir );
-        }
-        KTableRelease( ktab );
-    }
-    return res;
-}
-
-
-KCreateMode helper_assemble_CreateMode( const VTable * src_tab, 
-                                        bool force_init, uint8_t md5_mode )
-{
-    KCreateMode res = kcmParents;
- 
-    if ( md5_mode == MD5_MODE_AUTO )
-    {
-        bool src_md5_mode = helper_detect_src_md5( src_tab );
-        md5_mode = ( src_md5_mode ? MD5_MODE_ON : MD5_MODE_OFF );
-    }
-
-    if ( force_init )
-        res |= kcmInit;
-    else
-        res |= kcmCreate;
-
-    switch( md5_mode )
-    {
-    case MD5_MODE_ON :
-    case MD5_MODE_AUTO : res |= kcmMD5; break;
-    }
-    return res;
-}
-
-
-KChecksum helper_assemble_ChecksumMode( uint8_t ctx_blob_checksum )
-{
-    KChecksum res = kcsCRC32; /* from interfaces/kdb/column.h */
-    switch( ctx_blob_checksum )
-    {
-        case BLOB_CHECKSUM_OFF   : res = kcsNone; break;
-        case BLOB_CHECKSUM_CRC32 : res = kcsCRC32; break;
-        case BLOB_CHECKSUM_MD5   : res = kcsMD5; break;
-        case BLOB_CHECKSUM_AUTO  : res = kcsCRC32; break;
-    }
-    return res;
-}
diff --git a/tools/vdb-copy/helper.h b/tools/vdb-copy/helper.h
deleted file mode 100644
index 998961e..0000000
--- a/tools/vdb-copy/helper.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_helper_
-#define _h_helper_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-#ifndef _h_vdb_redactval_
-#include "redactval.h"
-#endif
-
-#ifndef _h_config_values_
-#include "config_values.h"
-#endif
-
-int64_t strtoi64( const char* str, char** endp, uint32_t base );
-uint64_t strtou64( const char* str, char** endp, uint32_t base );
-
-/*
- * calls the given manager to create a new SRA-schema
- * takes the list of user-supplied schema's (which can be empty)
- * and let the created schema parse all of them
-*/
-rc_t helper_parse_schema( const VDBManager *my_manager,
-                          VSchema **new_schema,
-                          const KNamelist *schema_list );
-
-/*
- * tries to interpret the given string in path as a accession
- * and returns the path of the found accession back in path
- * if it is possible, if not the original value of path remains unchanged
- * rc = 0 if the given path is a file-system-path or we are not
- * (weakly) linked against the sra-path-library
-rc_t helper_resolve_accession( const KDirectory *my_dir,
-                               char ** path );
-*/
-
-/*
- * calls VTableTypespec to discover the table-name out of the schema
- * the given table has to be opened!
-*/
-rc_t helper_get_schema_tab_name( const VTable *my_table, char ** name ) ;
-
-
-/*
- * reads a string out of a vdb-table:
- * needs a open cursor, a row-idx and the index of the column
- * it opens the row, requests a pointer via VCursorCellData()
- * malloc's the dst-pointer and copies the string into it
- * a 0-termination get's attached
- * finally it closes the row
-*/
-rc_t helper_read_vdb_string( const VCursor* src_cursor,
-                             const uint64_t row_idx,
-                             const uint32_t col_idx,
-                             char ** dst );
-
-
-/*
- * reads a int64 out of a vdb-table:
- * needs a open cursor, row-id already set, row opened
- * it copies the data via memmove where to the dst-pointer
- * points to / the size in the vdb-table can be smaller
-*/
-rc_t helper_read_vdb_int_row_open( const VCursor* src_cursor,
-                          const uint32_t col_idx, uint64_t * dst );
-
-
-/*
- * reads a int64 out of a vdb-table:
- * needs a open cursor, it opens the row,
- * calls helper_read_vdb_int_row_open()
- * finally it closes the row
-*/
-rc_t helper_read_vdb_int( const VCursor* src_cursor,
-                          const uint64_t row_idx,
-                          const uint32_t col_idx,
-                          uint64_t * dst );
-
-
-/*
- * reads a string out of a KConfig-object:
- * needs a cfg-object, and the full name of the key(node)
- * it opens the node, discovers the size, malloc's the string,
- * reads the string and closes the node
-*/
-rc_t helper_read_cfg_str( const KConfig *cfg,
-                          const char * key,
-                          char ** value );
-
-
-/*
- * reads a uint64 out of a KConfig-object:
- * needs a cfg-object, and the full name of the key(node)
- * it calls helper_read_cfg_str() to read the node as string
- * and converts it via strtoll() into a uint64
-*/
-rc_t helper_read_cfg_int( const KConfig *cfg,
-                          const char * key,
-                          uint64_t * value );
-
-
-/*
- * tries to detect if the given name of a schema-table is
- * a schema-legacy-table, it needs the vdb-manager to
- * open a sra-schema and request this schema to list all
- * legacy tables, then it searches in that list for the
- * given table-name
-*/
-rc_t helper_is_tablename_legacy( const VDBManager *my_manager,
-            const char * tabname, bool * flag );
-
-
-/*
- * this function tries to read 3 strings out of cfg-nodes
- * (1) the name of the schema-file to be used to copy to
- * (2) the name of the table to be used inside the schema
- * (3) a list of columns that should not be copied
- * if (3) cannot be found it is not a error
- * it needs as input the cfg-object, the name of the 
- * (src)legacy-platform and the name of the
- * (src)schema-table
-*/
-rc_t helper_get_legacy_write_schema_from_config( KConfig *cfg,
-    const char * platform,
-    const char * src_schema,
-    char ** legacy_schema_file, char ** legacy_schema_tab,
-    char ** legacy_dont_copy );
-
-
-/*
- * this function creates a config-manager, by passing in
- * a KDirectory-object representing the given path
- * this will include the the given path into the search
- * for *.kfg - files
-*/
-rc_t helper_make_config_mgr( KConfig **config_mgr, const char * path );
-
-
-/*
- * this function tries to read the lossynes-score of a vdb-type
- * out of a config-object
- * it constructs a node-name-string like this:
- *      "/VDBCOPY/SCORE/INSDC/2na/bin"
- * INSDC/2na/bin is the name of the type with ":" replaced by "/"
- * it reads the value by calling helper_read_cfg_str()
-*/
-uint32_t helper_rd_type_score( const KConfig *cfg,
-                               const char *type_name );
-
-
-/*
- * this function tries to remove the given path
-*/
-rc_t helper_remove_path( KDirectory * directory, const char * path );
-
-
-/*
- * looks into the path for chars like '/', '\\' or '.'
- * to detect that it is rather a path and not and accession
-*/
-bool helper_is_this_a_filesystem_path( const char * path );
-
-
-/*
- * reads global config-values, from the config-manager
-*/
-void helper_read_redact_values( KConfig * config_mgr,
-                                redact_vals * rvals );
-
-/*
- * reads global config-values, if not found via config-manager
- * use the defines from definition.h
-*/
-void helper_read_config_values( KConfig * config_mgr,
-                                p_config_values config );
-
-
-/*
- * detects if the given table uses md5-checksum's
-*/
-bool helper_detect_src_md5( const VTable * src_tab );
-
-
-KCreateMode helper_assemble_CreateMode( const VTable * src_tab, 
-                                        bool force_init, uint8_t md5_mode );
-
-
-KChecksum helper_assemble_ChecksumMode( uint8_t ctx_blob_checksum );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/matcher_input.h b/tools/vdb-copy/matcher_input.h
deleted file mode 100644
index 1a5434a..0000000
--- a/tools/vdb-copy/matcher_input.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_matcher_input_
-#define _h_matcher_input_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* structure with all the matcher-inputs */
-typedef struct matcher_input
-{
-    VDBManager * manager;
-    const KNamelist * add_schemas;
-    KConfig * cfg;
-    KDirectory * dir;
-    const char * columns;
-    const char * src_path;
-    const char * dst_path;
-    const char * legacy_schema;
-    const char * dst_tabname;
-    const char * excluded_columns;
-    bool force_kcmInit;
-    bool force_unlock;
-} matcher_input;
-typedef matcher_input* p_matcher_input;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/namelist_tools.c b/tools/vdb-copy/namelist_tools.c
deleted file mode 100644
index 270449b..0000000
--- a/tools/vdb-copy/namelist_tools.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "namelist_tools.h"
-
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-
-int nlt_strcmp( const char* s1, const char* s2 )
-{
-    size_t n1 = string_size ( s1 );
-    size_t n2 = string_size ( s2 );
-    return string_cmp ( s1, n1, s2, n2, ( n1 < n2 ) ? n2 : n1 );
-}
-
-
-rc_t nlt_make_namelist_from_string( const KNamelist **list, const char * src )
-{
-    VNamelist *v_names;
-    rc_t rc = VNamelistMake ( &v_names, 5 );
-    if ( rc == 0 )
-    {
-        char * s = string_dup_measure ( src, NULL );
-        if ( s )
-        {
-            uint32_t str_begin = 0;
-            uint32_t str_end = 0;
-            char c;
-            do
-            {
-                c = s[ str_end ];
-                if ( c == ',' || c == 0 )
-                {
-                    if ( str_begin < str_end )
-                    {
-                        char c_temp = c;
-                        s[ str_end ] = 0;
-                        rc = VNamelistAppend ( v_names, &(s[str_begin]) );
-                        s[ str_end ] = c_temp;
-                    }
-                    str_begin = str_end + 1;
-                }
-                str_end++;
-            } while ( c != 0 && rc == 0 );
-            free( s );
-        }
-        rc = VNamelistToConstNamelist ( v_names, list );
-        VNamelistRelease( v_names );
-    }
-    return rc;
-}
-
-bool nlt_is_name_in_namelist( const KNamelist *list,
-                             const char *name_to_find )
-{
-    uint32_t count, idx;
-    bool res = false;
-    if ( list == NULL || name_to_find == NULL )
-        return res;
-    if ( KNamelistCount( list, &count ) == 0 )
-    {
-        for ( idx = 0; idx < count && res == false; ++idx )
-        {
-            const char *item_name;
-            if ( KNamelistGet( list, idx, &item_name ) == 0 )
-            {
-                if ( nlt_strcmp( item_name, name_to_find ) == 0 )
-                    res = true;
-            }
-        }
-    }
-    return res;
-}
-
-/*
-    - list1 and list2 containts strings
-    - if one of the strings in list2 is contained ( partial match, strstr() )
-      in one of the strings in list1 the function returns true...
-*/
-bool nlt_namelist_intersect( const KNamelist *list1, const KNamelist *list2 )
-{
-    uint32_t count1;
-    bool res = false;
-    if ( list1 == NULL || list2 == NULL )
-        return res;
-    if ( KNamelistCount( list1, &count1 ) == 0 )
-    {
-        uint32_t idx1;
-        for ( idx1 = 0; idx1 < count1 && res == false; ++idx1 )
-        {
-            const char *string1;
-            if ( KNamelistGet( list1, idx1, &string1 ) == 0 )
-            {
-                uint32_t count2;
-                if ( KNamelistCount( list2, &count2 ) == 0 )
-                {
-                    uint32_t idx2;
-                    for ( idx2 = 0; idx2 < count2 && res == false; ++idx2 )
-                    {
-                        const char *string2;
-                        if ( KNamelistGet( list2, idx2, &string2 ) == 0 )
-                        {
-                            if ( strstr( string1, string2 ) != NULL )
-                                res = true;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return res;
-}
-
-rc_t nlt_remove_names_from_namelist( const KNamelist *source,
-            const KNamelist **dest, const KNamelist *to_remove )
-{
-    rc_t rc = 0;
-    uint32_t count;
-    
-    if ( source == NULL || dest == NULL || to_remove == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    *dest = NULL;
-    rc = KNamelistCount( source, &count );
-    if ( rc == 0 && count > 0 )
-    {
-        VNamelist *cleaned;
-        rc = VNamelistMake ( &cleaned, count );
-        if ( rc == 0 )
-        {
-            uint32_t idx;
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *s;
-                rc = KNamelistGet( source, idx, &s );
-                if ( rc == 0 )
-                {
-                    if ( !nlt_is_name_in_namelist( to_remove, s ) )
-                        rc = VNamelistAppend ( cleaned, s );
-                }
-                rc = VNamelistToConstNamelist ( cleaned, dest );
-            }
-        }
-    }
-    return rc;
-}
-
-rc_t nlt_remove_strings_from_namelist( const KNamelist *source,
-            const KNamelist **dest, const char *items_to_remove )
-{
-    rc_t rc = 0;
-    const KNamelist *to_remove;
-    
-    if ( source == NULL || dest == NULL || items_to_remove == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    rc = nlt_make_namelist_from_string( &to_remove, items_to_remove );
-    if ( rc == 0 )
-    {
-        rc = nlt_remove_names_from_namelist( source, dest, to_remove );
-        KNamelistRelease( to_remove );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/namelist_tools.h b/tools/vdb-copy/namelist_tools.h
deleted file mode 100644
index 3cefbf9..0000000
--- a/tools/vdb-copy/namelist_tools.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_namelist_tools_
-#define _h_namelist_tools_
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int nlt_strcmp( const char* s1, const char* s2 );
-rc_t nlt_make_namelist_from_string( const KNamelist **list, const char * src );
-bool nlt_is_name_in_namelist( const KNamelist *list, const char *name_to_find );
-bool nlt_namelist_intersect( const KNamelist *list1, const KNamelist *list2 );
-
-rc_t nlt_remove_names_from_namelist( const KNamelist *source,
-            const KNamelist **dest, const KNamelist *to_remove );
-
-rc_t nlt_remove_strings_from_namelist( const KNamelist *source,
-            const KNamelist **dest, const char *items_to_remove );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/num-gen.c b/tools/vdb-copy/num-gen.c
deleted file mode 100644
index 93125ac..0000000
--- a/tools/vdb-copy/num-gen.c
+++ /dev/null
@@ -1,848 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "num-gen.h"
-#include <klib/printf.h>
-
-#include <sysalloc.h>
-#include <strtol.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-typedef struct num_gen_node
-{
-    uint64_t start;
-    uint64_t end;
-    uint64_t count; /* 0 ... skip, >0 ... valid */
-} num_gen_node;
-typedef struct num_gen_node * p_num_gen_node;
-
-/* **************************************************************************
-{ start:5,count: 0 } ---> [ ]
-{ start:5,count: 1 } ---> [ 5 ]
-{ start:5,count: 2 } ---> [ 5, 6 ]
- ************************************************************************** */
-
-struct num_gen
-{
-    Vector nodes;
-};
-
-
-struct num_gen_iter
-{
-    Vector nodes;
-    uint32_t curr_node;
-    uint32_t curr_node_sub_pos;
-    uint64_t total;
-    uint64_t progress;
-};
-
-/* forward decl. for fixing-function */
-static rc_t num_gen_fix_overlaps( num_gen* self, uint32_t *count );
-
-
-/* helper function to destroy a node*/
-static void CC num_gen_node_destroy( void *item, void *data )
-{
-    free( item );
-}
-
-
-/* helper function to create a node from start/count */
-static p_num_gen_node num_gen_make_node( const uint64_t start, const uint64_t count )
-{
-    p_num_gen_node p = ( p_num_gen_node )malloc( sizeof( num_gen_node ) );
-    if ( p )
-    {
-        p->start = start;
-        p->end = start + count - 1;
-        p->count = count;
-    }
-    return p;
-}
-
-
-/* helper callback to compare 2 nodes, lets VectorInsert create a sorted vector */
-static int CC num_gen_insert_helper( const void* item1, const void* item2 )
-{
-    const p_num_gen_node node1 = ( p_num_gen_node )item1;
-    const p_num_gen_node node2 = ( p_num_gen_node )item2;
-    int res = 0;
-    if ( node1->start == node2->start )
-    {
-        if ( node1->count < node2->count )
-            res = -1;
-        else if ( node1->count > node2->count )
-            res = 1;
-    }
-    else if ( node1->start < node2->start )
-        res = -1;
-    else
-        res = 1;
-    return res;
-}
-
-
-/* helper callback to create a deep and conditional copy of a node-vector */
-static void CC num_gen_copy_cb( void *item, void *data )
-{
-    p_num_gen_node node = ( p_num_gen_node )item;
-    if ( node->count > 0 )
-    {
-        Vector * dst = ( Vector *)data;
-        p_num_gen_node new_node = num_gen_make_node( node->start, node->count );
-        if ( new_node != NULL )
-            VectorInsert( dst, new_node, NULL, num_gen_insert_helper );
-    }
-}
-
-
-/* helper function that creates a deep and conditional copy of a node-vector */
-static void num_gen_copy_vector( const Vector * src, Vector * dst )
-{
-    if ( src == NULL || dst == NULL )
-        return;
-    VectorForEach ( src, false, num_gen_copy_cb, dst );    
-}
-
-
-/* helper callback to add up all count values in the vector*/
-static void CC num_gen_total_count_cb( void *item, void *data )
-{
-    p_num_gen_node node = ( p_num_gen_node )item;
-    if ( node != NULL )
-    {
-        uint64_t * total = ( uint64_t *)data;
-        if ( total != NULL )
-            *total += node->count;
-    }
-}
-
-
-/* helper function that adds up all count values in the vector*/
-static uint64_t num_gen_total_count( const Vector * src )
-{
-    uint64_t res = 0;
-    if ( src != NULL )
-        VectorForEach ( src, false, num_gen_total_count_cb, &res );
-    return res;
-}
-
-
-/* helper function for the parse-function */
-static rc_t num_gen_add_node( num_gen* self, const uint64_t from,
-                              const uint64_t to )
-{
-    p_num_gen_node node = NULL;
-    int64_t count = ( to - from );
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcSelf, rcNull );
-
-    if ( count >= 0 )
-        node = num_gen_make_node( from, count + 1 );
-    else
-        node = num_gen_make_node( to, -( count + 1 ) );
-    if ( node == NULL )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcMemory, rcExhausted );
-    return VectorInsert( &(self->nodes), node, NULL, num_gen_insert_helper );
-}
-
-
-#define MAX_NUM_STR 12
-/* helper-structure for num_gen_parse() */
-typedef struct num_gen_parse_ctx
-{
-    uint32_t num_str_idx;
-    bool this_is_the_first_number;
-    uint64_t num1;
-    uint64_t num2;
-    char num_str[ MAX_NUM_STR + 1 ];
-} num_gen_parse_ctx;
-typedef num_gen_parse_ctx* p_num_gen_parse_ctx;
-
-
-/* helper for num_gen_parse() */
-static void num_gen_convert_ctx( p_num_gen_parse_ctx ctx )
-{
-    char *endp;
-    
-    ctx->num_str[ ctx->num_str_idx ] = 0;
-    ctx->num1 = strtou64( ctx->num_str, &endp, 10 );
-    ctx->this_is_the_first_number = false;
-    ctx->num_str_idx = 0;
-}
-
-
-/* helper for num_gen_parse() */
-static rc_t num_gen_convert_and_add_ctx( num_gen* self, p_num_gen_parse_ctx ctx )
-{
-    char *endp;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcSelf, rcNull );
-    if ( ctx == NULL )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    if ( ctx->num_str_idx == 0 )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcEmpty );
-
-    /* terminate the source-string */
-    ctx->num_str[ ctx->num_str_idx ] = 0;
-    /* convert the string into a uint64_t */
-    if ( ctx->this_is_the_first_number )
-        {
-        ctx->num1 = strtou64( ctx->num_str, &endp, 10 );
-        ctx->num2 = ctx->num1;
-        }
-    else
-        ctx->num2 = strtou64( ctx->num_str, &endp, 10 );
-    /* empty the source-string to be reused */
-    ctx->num_str_idx = 0;
-    
-    ctx->this_is_the_first_number = true;
-    return num_gen_add_node( self, ctx->num1, ctx->num2 );
-}
-
-
-/* parse the given string and insert the found ranges 
-   into the number-generator, fixes eventual overlaps */
-rc_t num_gen_parse( num_gen* self, const char* src )
-{
-    size_t i, n;
-    num_gen_parse_ctx ctx;
-    rc_t rc = 0;
-
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcParsing, rcSelf, rcNull );
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcParsing, rcParam, rcNull );
-
-    n = string_measure ( src, NULL );
-    if ( n == 0 )
-        return RC( rcVDB, rcNoTarg, rcParsing, rcParam, rcEmpty );
-
-    ctx.num_str_idx = 0;
-    ctx.this_is_the_first_number = true;
-    for ( i = 0; i < n && rc == 0; ++i )
-    {
-        switch ( src[ i ] )
-        {
-        /* a dash switches from N1-mode into N2-mode */
-        case '-' :
-            num_gen_convert_ctx( &ctx );
-            break;
-
-        /* a comma ends a single number or a range */
-        case ',' :
-            rc = num_gen_convert_and_add_ctx( self, &ctx );
-            break;
-
-        /* in both mode add the char to the temp string */
-        default:
-            if ( ( src[i]>='0' )&&( src[i]<='9' )&&( ctx.num_str_idx < MAX_NUM_STR ) )
-                ctx.num_str[ ctx.num_str_idx++ ] = src[ i ];
-            break;
-        }
-    }
-    /* dont forget to add what is left in ctx.num_str ... */
-    if ( ctx.num_str_idx > 0 )
-        rc = num_gen_convert_and_add_ctx( self, &ctx );
-    if ( rc == 0 )
-        rc = num_gen_fix_overlaps( self, NULL );
-    return rc;
-}
-
-
-/* inserts the given ranges into the number-generator,
-   fixes eventual overlaps */
-rc_t num_gen_add( num_gen* self, const uint64_t first, const uint64_t count )
-{
-    rc_t rc;
-    uint64_t num_1 = first;
-    uint64_t num_2 = first;
-
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcInserting, rcSelf, rcNull );
-
-    /* this is necessary because virtual columns which have a
-       infinite row-range, get reported with first=1,count=0 */
-    if ( count > 0 )
-        num_2 = ( first + count - 1 );
-    rc = num_gen_add_node( self, num_1, num_2 );
-    if ( rc == 0 )
-        rc = num_gen_fix_overlaps( self, NULL );
-    return rc;
-}
-
-
-/* helper function for range-check */
-static bool CC num_gen_check_range_start( p_num_gen_node the_node, 
-                                          const uint64_t range_start )
-{
-    bool res = true;
-    uint64_t last_node_row = ( the_node->start + the_node->count - 1 );
-    
-    if ( the_node->start < range_start )
-    {
-        the_node->start = range_start;
-        if ( the_node->start <= last_node_row )
-        {
-            the_node->count = ( last_node_row - the_node->start ) + 1;
-        }
-        else
-        {
-            /* the node becomes invalid ... */
-            the_node->start = 0;
-            the_node->count = 0;
-            res = false;
-        }
-    }
-    return res;
-}
-
-
-/* helper function for range-check */
-static void CC num_gen_check_range_end( p_num_gen_node the_node, 
-                             const uint64_t last_tab_row )
-{
-    uint64_t last_node_row = ( the_node->start + the_node->count - 1 );
-
-    if ( last_node_row > last_tab_row )
-    {
-        last_node_row = last_tab_row;
-        if ( the_node->start <= last_node_row )
-        {
-            the_node->count = ( last_node_row - the_node->start ) + 1;
-        }
-        else
-        {
-            /* the node becomes invalid ... */
-            the_node->start = 0;
-            the_node->count = 0;
-        }
-    }
-}
-
-
-/* helper function for range-check */
-static void CC num_gen_check_range_callback( void *item, void *data )
-{
-    p_num_gen_node the_node = ( p_num_gen_node )item;
-    p_num_gen_node the_range = ( p_num_gen_node )data;
-    uint64_t last_tab_row = ( the_range->start + the_range->count - 1 );
-
-    /* ignore invalid nodes... */
-    if ( the_node->start == 0 || the_node->count == 0 )
-        return;
-        
-    /* check if the start value is not out of range... */
-    if ( num_gen_check_range_start( the_node, the_range->start ) )
-        num_gen_check_range_end( the_node, last_tab_row );
-}
-
-
-/* helper function for range-check */
-static void CC num_gen_count_invalid_nodes( void *item, void *data )
-{
-    p_num_gen_node the_node = ( p_num_gen_node )item;
-    uint32_t *invalid_count = ( uint32_t * )data;
-    
-    if ( ( the_node->start == 0 )&&( the_node->count == 0 ) )
-        ( *invalid_count )++;
-}
-
-
-/* helper function for range-check */
-static void CC num_gen_copy_valid_nodes( void *item, void *data )
-{
-    p_num_gen_node node = ( p_num_gen_node )item;
-    Vector *dest = ( Vector * )data;
-    
-    if ( ( node->start != 0 )&&( node->count != 0 ) )
-        VectorInsert ( dest, node, NULL, num_gen_insert_helper );
-    else
-        free ( node );
-}
-
-
-/* helper function for range-check */
-static void num_gen_remove_invalid_nodes( num_gen* self )
-{
-    Vector temp_nodes;
-    uint32_t count = VectorLength( &(self->nodes) );
-    
-    if ( count < 1 )
-        return;
-    /* create a temp. vector */
-    VectorInit( &temp_nodes, 0, count );
-
-    /* copy all valid nodes into the temp. vector */
-    VectorForEach ( &(self->nodes), false,
-                    num_gen_copy_valid_nodes, &temp_nodes );
-
-    /* clear all nodes so far...,
-       DO NOT PASS num_gen_node_destroy into it */
-    VectorWhack( &(self->nodes), NULL, NULL );
-
-    /* initialize and copy (shallow) the valid nodes back
-       into the generator */
-    VectorCopy ( &temp_nodes, &(self->nodes) );
-
-    /* destroy the temp-vector,
-       DO NOT PASS num_gen_node_destroy into it */
-    VectorWhack ( &temp_nodes, NULL, NULL );
-}
-
-
-/* helper function for trim */
-rc_t num_gen_trim( num_gen* self, const int64_t first, const uint64_t count )
-{
-    num_gen_node trim_range;
-    uint32_t invalid_nodes = 0;
-
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcValidating, rcSelf, rcNull );
-    if ( count == 0 )
-        return RC( rcVDB, rcNoTarg, rcValidating, rcParam, rcNull );
-
-    /* walk all nodes to check for boundaries... */
-    trim_range.start = first;
-    trim_range.count = count;
-
-    VectorForEach ( &(self->nodes), false,
-                    num_gen_check_range_callback, &trim_range );
-
-    VectorForEach ( &(self->nodes), false,
-                    num_gen_count_invalid_nodes, &invalid_nodes );
-    if ( invalid_nodes > 0 )
-        num_gen_remove_invalid_nodes( self );
- 
-    return 0;
-}
-
-
-rc_t num_gen_make( num_gen** self )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
-
-    *self = calloc( 1, sizeof( num_gen ) );
-    if ( *self == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-
-    VectorInit( &((*self)->nodes ), 0, 5 );
-    return 0;
-}
-
-
-rc_t num_gen_make_from_str( num_gen** self, const char *src )
-{
-    rc_t rc = num_gen_make( self );
-    if ( rc == 0 )
-    {
-        rc = num_gen_parse( *self, src );
-        if ( rc == 0 )
-            rc = num_gen_fix_overlaps( *self, NULL );
-     }
-     return rc;
-}
-
-
-rc_t num_gen_make_from_range( num_gen** self, 
-                              const int64_t first, const uint64_t count )
-{
-    rc_t rc = num_gen_make( self );
-    if ( rc != 0 )
-        return rc;
-    return num_gen_add( *self, first, count );
-}
-
-
-rc_t num_gen_clear( num_gen* self )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcClearing, rcSelf, rcNull );
-
-    if ( VectorLength( &(self->nodes) ) > 0 )
-    {
-        /* clear all nodes so far... */
-        VectorWhack( &(self->nodes), num_gen_node_destroy, NULL );
-
-        /* re-init the vector */
-        VectorInit( &(self->nodes ), 0, 5 );
-    }
-    return 0;
-}
-
-
-rc_t num_gen_destroy( num_gen* self )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-
-    VectorWhack( &(self->nodes), num_gen_node_destroy, NULL );
-    free( self );
-    return 0;
-}
-
-
-bool num_gen_empty( const num_gen* self )
-{
-    if ( self == NULL )
-        return true;
-    return ( VectorLength( &(self->nodes) ) < 1 );
-}
-
-
-typedef struct overlap_ctx
-{
-    p_num_gen_node prev;
-    uint32_t overlaps;
-} overlap_ctx;
-typedef overlap_ctx* p_overlap_ctx;
-
-
-/* static bool CC num_gen_overlap_fix_cb( void *item, void *data ) */
-static bool CC num_gen_overlap_fix_cb( void *item, void *data )
-{
-    p_num_gen_node node = ( p_num_gen_node )item;
-    p_overlap_ctx ctx = ( p_overlap_ctx )data;
-
-    /* skip invalid nodes */
-    if ( node->count ==0 || node->start == 0 || node->end == 0 )
-        return false;
-    /* if we do not have a previous node, take this one... */
-    if ( ctx->prev == NULL )
-        {
-        ctx->prev = node;
-        return false;
-        }
-    /* if we do not have an overlap,
-       take this node as prev-node and continue */
-    if ( ctx->prev->end < node->start )
-        {
-        ctx->prev = node;
-        return false;
-        }
-    /* we have a overlap, the end of the prev-node is inside
-       the current-node, we fix it by expanding the prev-node
-       to the end of this node, and later declaring this
-       node as invalid */
-    if ( ctx->prev->end < node->end )
-    {
-        ctx->prev->end = node->end;
-        ctx->prev->count = ( ctx->prev->end - ctx->prev->start ) + 1;
-    }
-    /* if the prev-node ends after this node, all we have to
-       do is declaring this node as invalid */
-    node->count = 0;
-    node->start = 0;
-    node->end = 0;
-    return true;
-}
-
-
-static rc_t num_gen_fix_overlaps( num_gen* self, uint32_t *count )
-{
-    overlap_ctx ctx;
-    bool fix_executed = false;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    
-    ctx.overlaps = 0;
-    do
-    {
-        ctx.prev = NULL;
-        fix_executed = VectorDoUntil ( &(self->nodes), false, 
-                                       num_gen_overlap_fix_cb, &ctx );
-    } while ( fix_executed );
-
-    if ( count )
-        *count = ctx.overlaps;
-    return 0;
-}
-
-
-typedef struct string_ctx
-{
-    char *s;
-    uint32_t len;
-} string_ctx;
-typedef string_ctx* p_string_ctx;
-
-
-static void string_ctx_add( p_string_ctx ctx, char *s )
-{
-    uint32_t len = string_measure ( s, NULL );
-    if ( len > 0 )
-    {
-        if ( ctx->len == 0 )
-            ctx->s = malloc( len + 1 );
-        else
-            ctx->s = realloc( ctx->s, ctx->len + len );
-        memcpy( &(ctx->s[ctx->len]), s, len );
-        ctx->len += len;
-    }
-}
-
-
-static void CC num_gen_as_string_cb( void *item, void *data )
-{
-    char temp[40];
-    p_num_gen_node node = ( p_num_gen_node )item;
-    long unsigned int start = node->start;
-    long unsigned int end = ( start + node->count - 1 );
-    switch( node->count )
-    {
-    case 0 : temp[ 0 ] = 0;
-             break;
-    case 1 : string_printf ( temp, sizeof temp, NULL, "%lu,", start );
-             break;
-    default: string_printf ( temp, sizeof temp, NULL, "%lu-%lu,", start, end );
-             break;
-    }
-    string_ctx_add( ( p_string_ctx )data, temp );
-}
-
-
-rc_t num_gen_as_string( const num_gen* self, char **s )
-{
-    string_ctx ctx;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( s == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-
-    ctx.s = NULL;
-    ctx.len = 0;
-    VectorForEach ( &(self->nodes), false, num_gen_as_string_cb, &ctx );
-    if ( ctx.len == 0 )
-    {
-        *s = NULL;
-        return RC( rcVDB, rcNoTarg, rcReading, rcData, rcEmpty );
-    }
-    ctx.s[ ctx.len ] = 0;
-    *s = ctx.s;
-    return 0;
-}
-
-
-static void CC num_gen_debug_cb( void *item, void *data )
-{
-    char temp[40];
-    p_num_gen_node node = ( p_num_gen_node )item;
-    long unsigned int start = node->start;
-    long unsigned int count = node->count;
-    string_printf ( temp, sizeof temp, NULL, "[s:%lu c:%lu]", start, count );
-    string_ctx_add( ( p_string_ctx )data, temp );
-}
-
-
-rc_t num_gen_debug( const num_gen* self, char **s )
-{
-    string_ctx ctx;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( s == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-
-    ctx.s = NULL;
-    ctx.len = 0;
-    VectorForEach ( &(self->nodes), false, num_gen_debug_cb, &ctx );
-    if ( ctx.len == 0 )
-    {
-        *s = NULL;
-        return RC( rcVDB, rcNoTarg, rcReading, rcData, rcEmpty );
-    }
-    ctx.s[ ctx.len ] = 0;
-    *s = ctx.s;
-    return 0;
-}
-
-
-static bool CC num_gen_contains_cb( void *item, void *data )
-{
-    bool res = false;
-    p_num_gen_node node = ( p_num_gen_node )item;
-    if ( node->count > 0 )
-    {
-        uint64_t *value = ( uint64_t * )data;
-        uint64_t end = node->start + node->count - 1;
-        res = ( node->start <= *value && *value <= end );
-    }
-    return res;
-}
-
-
-rc_t num_gen_contains_value( const num_gen* self, const uint64_t value )
-{
-    uint64_t temp = value;
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( VectorDoUntil ( &(self->nodes), false, 
-                         num_gen_contains_cb, &temp ) )
-        return 0;
-    else
-        return RC( rcVDB, rcNoTarg, rcReading, rcData, rcEmpty );
-}
-
-
-rc_t num_gen_range_check( num_gen* self, 
-                          const int64_t first, const uint64_t count )
-{
-    /* if the user did not specify a row-range, take all rows */
-    if ( num_gen_empty( self ) )
-        return num_gen_add( self, first, count );
-    /* if the user did specify a row-range, check the boundaries */
-    else
-        return num_gen_trim( self, first, count );
-}
-
-
-rc_t num_gen_iterator_make( const num_gen* self, const num_gen_iter **iter )
-{
-    uint32_t count;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( iter == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-
-    *iter = NULL;
-    count = VectorLength( &(self->nodes) );
-    if ( count < 1 )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-    else
-    {
-        num_gen_iter *temp = calloc( 1, sizeof( num_gen_iter ) );
-        if ( temp == NULL )
-            return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        VectorInit( &(temp->nodes), 0, count );
-        num_gen_copy_vector( &(self->nodes), &(temp->nodes ) );
-        temp->total = num_gen_total_count( &(temp->nodes ) );
-        *iter = temp;
-    }
-    return 0;
-}
-
-rc_t num_gen_iterator_destroy( const num_gen_iter *self )
-{
-    num_gen_iter *temp;
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-
-    temp = (num_gen_iter *)self;
-    VectorWhack( &(temp->nodes), num_gen_node_destroy, NULL );
-    free( temp );
-    return 0;
-}
-
-rc_t num_gen_iterator_next( const num_gen_iter* self, uint64_t* value )
-{
-    num_gen_iter* temp;
-    p_num_gen_node node;
-    
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( value == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-    if ( self->curr_node >= VectorLength( &(self->nodes) ) )
-        return RC( rcVDB, rcNoTarg, rcReading, rcId, rcInvalid );
-
-    temp = ( num_gen_iter *)self;
-    *value = 0;
-    node = (p_num_gen_node)VectorGet( &(temp->nodes), temp->curr_node );
-    if ( node == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcItem, rcInvalid );
-
-    *value = node->start;
-    if ( node->count < 2 )
-        /* the node is a single-number-node, next node for next time */
-        temp->curr_node++;
-    else
-    {
-        /* the node is a number range, add the sub-position */
-        *value += temp->curr_node_sub_pos++;
-        /* if the sub-positions are use up, switch to next node */
-        if ( temp->curr_node_sub_pos >= node->count )
-        {
-            temp->curr_node++;
-            temp->curr_node_sub_pos = 0;
-        }
-    }
-    (temp->progress)++;
-    return 0;
-}
-
-
-rc_t num_gen_iterator_count( const num_gen_iter* self, uint64_t* count )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( count == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-    *count = self->total;
-    return 0;
-}
-
-
-rc_t num_gen_iterator_percent( const num_gen_iter* self, 
-                               const uint8_t fract_digits,
-                               uint32_t* value )
-{
-    uint32_t factor = 100;
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcSelf, rcNull );
-    if ( value == NULL )
-        return RC( rcVDB, rcNoTarg, rcReading, rcParam, rcNull );
-    if ( fract_digits > 0 )
-    {
-        if ( fract_digits > 1 )
-            factor = 10000;
-        else
-            factor = 1000;
-    }
-        
-    if ( self->total > 0 )
-    {
-        if ( self->progress >= self->total )
-            *value = factor;
-        else
-        {
-            uint64_t temp = self->progress;
-            temp *= factor;
-            temp /= self->total;
-            *value = (uint16_t) temp;
-        }
-    }
-    else
-        *value = 0;
-    return 0;
-}
diff --git a/tools/vdb-copy/num-gen.h b/tools/vdb-copy/num-gen.h
deleted file mode 100644
index 5b0324f..0000000
--- a/tools/vdb-copy/num-gen.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_num_gen_
-#define _h_num_gen_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-
-/*--------------------------------------------------------------------------
- * A NUMBER GENERATOR
- * 
- *  input : string, for instance "3,6,8,12,44-49"
- *  ouptut: sequence of integers, for instance 3,6,8,12,44,45,46,47,48,49
- */
-
-
-/*--------------------------------------------------------------------------
- * opaque number-generator and it's iterator
- */
-typedef struct num_gen num_gen;
-typedef struct num_gen_iter num_gen_iter;
-
-
-/*--------------------------------------------------------------------------
- * num_gen_make
- *
- *  creates a empty number-generator
- *  or creates a number-generator and parses the string
- *  or creates and presets it with a range
- */
-rc_t num_gen_make( num_gen** self );
-rc_t num_gen_make_from_str( num_gen** self, const char *src );
-rc_t num_gen_make_from_range( num_gen** self, 
-                              const int64_t first, const uint64_t count );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_destroy
- *
- *  destroys a number-generator
- */
-rc_t num_gen_destroy( num_gen* self );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_clear
- *
- *  resets a number-generator, to be empty just like after num_gen_make()
- */
-rc_t num_gen_clear( num_gen* self );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_parse
- *
- *  parses a given string in this form: "3,6,8,12,44-49"
- *  does not clear the number-generator before parsing
- *  eventual overlaps with the previous content are consolidated
- */
-rc_t num_gen_parse( num_gen* self, const char* src );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_add
- *
- *  inserts the given interval into the number-generator
- *
- *  num_gen_add( *g, 10, 30 )
- *  is equivalent to:
- *  num_gen_parse( *g, "10-39" );
- *
- *  eventual overlaps with the previous content are consolidated 
- */
-rc_t num_gen_add( num_gen* self, const uint64_t first, const uint64_t count );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_trim
- *
- *  checks if the content of the number-generator is inside the given interval
- *  removes or shortens internal nodes if necessary
- */
-rc_t num_gen_trim( num_gen* self, const int64_t first, const uint64_t count );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_empty
- *
- *  checks if the generator has no ranges defined
- */
-bool num_gen_empty( const num_gen* self );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_as_string
- *
- *  allocates a string that contains the generator as text
- *  *s = "1-5,20,24-25"
- *  caller has to free the string
- */
-rc_t num_gen_as_string( const num_gen* self, char **s );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_debug
- *
- *  allocates a string that contains the internal intervals as text
- *  *s = "[s:1 c:5][s:20 c:1][s:24 c:2]"
- *  [s...start-value c:count]
- *  caller has to free the string 
- */
-rc_t num_gen_debug( const num_gen* self, char **s );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_contains_value
- *
- *  checks if the generator contains the given value
- */
-rc_t num_gen_contains_value( const num_gen* self, const uint64_t value );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_range_check
- *
- *  if the generator is empty --> set it to the given range
- *  if it is not empty ---------> trim it to the given range
- */
-rc_t num_gen_range_check( num_gen* self, 
-                          const int64_t first, const uint64_t count );
-
-/*--------------------------------------------------------------------------
- * num_gen_iterator_make
- *
- *  creates a iterator from the number-generator
- *  the iterator contains a constant copy of the number-ranges
- *  after this call it is safe to destroy or change the number-generator
- *  returns an error-code if the number-generator was empty,
- *  and *iter will be NULL
- */
-rc_t num_gen_iterator_make( const num_gen* self, const num_gen_iter **iter );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_iterator_destroy
- *
- *  destroys the iterator
- */
-rc_t num_gen_iterator_destroy( const num_gen_iter *self );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_iterator_count
- *
- *  returns how many values the iterator contains
- */
-rc_t num_gen_iterator_count( const num_gen_iter* self, uint64_t* count );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_iterator_next
- *
- *  pulls the next value out of the iterator...
- *  returns an error-code if the iterator has no more values
- */
-rc_t num_gen_iterator_next( const num_gen_iter* self, uint64_t* value );
-
-
-/*--------------------------------------------------------------------------
- * num_gen_iterator_percent
- *
- *  return in value the percentage of the iterator...
- *  depending on fract-digits the percentage will be:
- *      fract_digits = 0 ... full percent's
- *      fract_digits = 1 ... 1/10-th of a percent
- *      fract_digits = 2 ... 1/100-th of a percent
- */
-rc_t num_gen_iterator_percent( const num_gen_iter* self,
-                               const uint8_t fract_digits,
-                               uint32_t* value );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/progressbar.c b/tools/vdb-copy/progressbar.c
deleted file mode 100644
index 85a793a..0000000
--- a/tools/vdb-copy/progressbar.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-copy-includes.h"
-#include <sysalloc.h>
-#include <stdlib.h>
-
-typedef struct progressbar
-{
-    bool initialized;
-    uint16_t percent;
-} progressbar;
-
-
-rc_t make_progressbar( progressbar ** pb )
-{
-    if ( pb == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
-    (*pb) = calloc( 1, sizeof( progressbar ) );
-    if ( *pb == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    return 0;
-}
-
-
-rc_t destroy_progressbar( progressbar * pb )
-{
-    if ( pb == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-    free( pb );
-    return 0;
-}
-
-static void progess_0a( const uint16_t percent )
-{
-    KOutMsg( "| %2u%%", percent );
-}
-
-static void progess_0( const uint16_t percent )
-{
-    if ( percent & 1 )
-        KOutMsg( "\b\b\b\b- %2u%%", percent );
-    else
-        KOutMsg( "\b\b\b%2u%%", percent );
-}
-
-static void progess_1a( const uint16_t percent )
-{
-    uint16_t p1 = percent / 10;
-    uint16_t p0 = percent - ( p1 * 10 );
-    KOutMsg( "| %2u.%01u%%", p1, p0 );
-}
-
-static void progess_1( const uint16_t percent )
-{
-    uint16_t p1 = percent / 10;
-    uint16_t p0 = percent - ( p1 * 10 );
-    if ( ( p1 & 1 )&&( p0 == 0 ) )
-        KOutMsg( "\b\b\b\b\b\b- %2u.%01u%%", p1, p0 );
-    else
-        KOutMsg( "\b\b\b\b\b%2u.%01u%%", p1, p0 );
-}
-
-static void progess_2a( const uint16_t percent )
-{
-    uint16_t p1 = percent / 100;
-    uint16_t p0 = percent - ( p1 * 100 );
-    KOutMsg( "| %2u.%02u%%", p1, p0 );
-}
-
-static void progess_2( const uint16_t percent )
-{
-    uint16_t p1 = percent / 100;
-    uint16_t p0 = percent - ( p1 * 100 );
-    if ( ( p1 & 1 )&&( p0 == 0 ) )
-        KOutMsg( "\b\b\b\b\b\b\b- %2u.%02u%%", p1, p0 );
-    else
-        KOutMsg( "\b\b\b\b\b\b%2u.%02u%%", p1, p0 );
-}
-
-rc_t update_progressbar( progressbar * pb, const uint8_t fract_digits,
-                         const uint16_t percent )
-{
-    uint8_t digits = fract_digits;
-    if ( pb == NULL )
-        return RC( rcVDB, rcNoTarg, rcParsing, rcSelf, rcNull );
-    if ( digits > 2 )
-        digits = 2;
-    if ( pb->initialized )
-    {
-        if ( pb->percent != percent )
-        {
-            pb->percent = percent;
-            switch( digits )
-            {
-            case 0 : progess_0( percent ); break;
-            case 1 : progess_1( percent ); break;
-            case 2 : progess_2( percent ); break;
-            }
-        }
-    }
-    else
-    {
-        pb->percent = percent;
-        switch( digits )
-        {
-        case 0 : progess_0a( percent ); break;
-        case 1 : progess_1a( percent ); break;
-        case 2 : progess_2a( percent ); break;
-        }
-        pb->initialized = true;
-    }
-    return 0;
-}
diff --git a/tools/vdb-copy/progressbar.h b/tools/vdb-copy/progressbar.h
deleted file mode 100644
index f8bef61..0000000
--- a/tools/vdb-copy/progressbar.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_progressbar_
-#define _h_progressbar_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct progressbar progressbar;
-
-/*--------------------------------------------------------------------------
- * make_progressbar
- *
- *  creates a progressbar with zero-values inside
- *  does not output anything
- */
-rc_t make_progressbar( progressbar ** pb );
-
-
-/*--------------------------------------------------------------------------
- * destroy_progressbar
- *
- *  destroy's the progressbar
- *  does not output anything
- */
-rc_t destroy_progressbar( progressbar * pb );
-
-
-/*--------------------------------------------------------------------------
- * update_progressbar
- *
- *  sets the progressbar to a specific percentage
- *  outputs only if the percentage has changed from the last call
- *  the precentage is in 1/10-th of a percent ( 21,6% = 216 )
- *  expects the percents in increasing order ( does not jump back )
- *  writes a growing bar made from '-'-chars every 2nd percent
- */
-rc_t update_progressbar( progressbar * pb, const uint8_t fract_digits,
-                         const uint16_t percent );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/redactval.c b/tools/vdb-copy/redactval.c
deleted file mode 100644
index a8c0538..0000000
--- a/tools/vdb-copy/redactval.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "redactval.h"
-
-#include "helper.h"
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-
-void redact_buf_init( redact_buffer * rbuf )
-{
-    rbuf->buffer = NULL;
-    rbuf->buffer_len = 0;
-}
-
-
-void redact_buf_free( redact_buffer * rbuf )
-{
-    if ( rbuf->buffer != NULL )
-    {
-        
-        free( rbuf->buffer );
-        rbuf->buffer = NULL;
-        rbuf->buffer_len = 0;
-    }
-}
-
-
-rc_t redact_buf_resize( redact_buffer * rbuf, const size_t new_size )
-{
-    rc_t rc = 0;
-    if ( rbuf->buffer_len < new_size || rbuf->buffer == NULL )
-    {
-        /* allocate or re-allocate the buffer */
-        if ( rbuf->buffer_len == 0 )
-            rbuf->buffer = malloc( new_size );
-        else
-            rbuf->buffer = realloc( rbuf->buffer, new_size );
-
-        /* exit */
-        if ( rbuf->buffer == NULL )
-            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        else
-            rbuf->buffer_len = new_size;
-    }
-    return rc;
-}
-
-
-/* allocate a redact-value */
-static p_redact_val redact_val_init( const char* name, 
-                                     const uint32_t len,
-                                     const char* value )
-{
-    p_redact_val res = NULL;
-    if ( name == NULL ) return res;
-    if ( name[0] == 0 ) return res;
-    res = calloc( 1, sizeof( redact_val ) );
-    if ( res == NULL ) return res;
-    res->name = string_dup_measure ( name, NULL );
-    res->len = len;
-    res->value = NULL;
-    if ( value != NULL )
-    {
-        if ( value[0] == '\'' && value[2] == '\'' )
-        {
-            res->value = malloc( sizeof value[0] );
-            if ( res->value )
-            {
-                res->len = 1;
-                *( ( char * )res->value ) = value[1];
-            }
-        }
-        else
-        {
-            char *endptr;
-            uint64_t x = strtou64( value, &endptr, 0 );
-            if ( res->len > sizeof x )
-                res->len = sizeof x;
-            res->value = malloc( len );
-            if ( res->value )
-                memcpy( res->value, &x, res->len );
-        }
-    }
-    return res;
-}
-
-
-void redact_val_fill_buffer( const p_redact_val r_val,
-                             redact_buffer * rbuf,
-                             const size_t buffsize )
-{
-    size_t idx;
-    char * dst = rbuf->buffer;
-    for ( idx = 0; idx < buffsize; idx += r_val->len )
-    {
-        size_t l = r_val->len;
-        if ( ( idx + l ) > buffsize ) l = ( buffsize - idx );
-        memcpy( dst, r_val->value, l );
-        dst += l;
-    }
-}
-
-
-static void CC redact_val_destroy_node( void* node, void* data )
-{
-    p_redact_val r_val = (p_redact_val)node;
-    if ( r_val != NULL )
-    {
-        if ( r_val->name != NULL )
-            free( r_val->name );
-        if ( r_val->value != NULL )
-            free( r_val->value );
-        free( r_val );
-    }
-}
-
-
-/*
- * initializes a redact-val-list
-*/
-rc_t redact_vals_init( redact_vals** vals )
-{
-    if ( vals == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
-    (*vals) = calloc( 1, sizeof( redact_vals ) );
-    if ( *vals == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    VectorInit( &((*vals)->vals), 0, 5 );
-    return 0;
-}
-
-
-/*
- * destroys the redact-val-list
-*/
-rc_t redact_vals_destroy( redact_vals* vals )
-{
-    if ( vals == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-    VectorWhack( &(vals->vals), redact_val_destroy_node, NULL );
-    free( vals );
-    return 0;
-}
-
-
-/*
- * adds a entry into the redact-val-list
-*/
-rc_t redact_vals_add( redact_vals* vals, const char* name, 
-                      const uint32_t len, const char* value )
-{
-    rc_t rc;
-    p_redact_val new_val = redact_val_init( name, len, value );
-    if ( new_val == NULL )
-        rc = RC( rcVDB, rcNoTarg, rcParsing, rcMemory, rcExhausted );
-    else
-        rc = VectorAppend( &(vals->vals), NULL, new_val );
-    return rc;
-}
-
-
-/*
- * returns a pointer to a redact-value by type-name
-*/
-p_redact_val redact_vals_get_by_name( const redact_vals* vals,
-                                      const char * name )
-{
-    p_redact_val res = NULL;
-    uint32_t idx, len;
-    if ( vals == NULL || name == NULL || name[0] == 0 )
-        return res;
-
-    len = VectorLength( &(vals->vals) );
-    for ( idx = 0;  idx < len && res == NULL; ++idx )
-    {
-        p_redact_val item = (p_redact_val) VectorGet ( &(vals->vals), idx );
-        if ( nlt_strcmp( item->name, name ) == 0 )
-            res = item;
-    }
-    return res;
-}
-
-/*
- * returns a pointer to a redact-value by type-cast
-*/
-p_redact_val redact_vals_get_by_cast( const redact_vals* vals,
-                                      const char * cast )
-{
-    uint32_t idx;
-    p_redact_val res = NULL;
-    char * name;
-    if ( vals == NULL || cast == NULL || cast[0] == 0 )
-        return res;
-
-    name = string_dup_measure ( cast, NULL );
-    for ( idx = 0; name[idx] != 0; ++idx )
-        if ( name[idx] == ')' ) name[idx] = 0;
-    res = redact_vals_get_by_name( vals, &(name[1]) );
-    free( name );
-    return res;
-}
diff --git a/tools/vdb-copy/redactval.h b/tools/vdb-copy/redactval.h
deleted file mode 100644
index b3e4360..0000000
--- a/tools/vdb-copy/redactval.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_redactval_
-#define _h_vdb_redactval_
-
-#ifndef _h_vdb_copy_includes_
-#include "vdb-copy-includes.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/********************************************************************
-    redact_buffer is a pointer and a size...
-********************************************************************/
-typedef struct redact_buffer
-{
-    void *   buffer;
-    uint32_t buffer_len;
-} redact_buffer;
-typedef redact_buffer* p_redact_buffer;
-
-
-void redact_buf_init( redact_buffer * rbuf );
-void redact_buf_free( redact_buffer * rbuf );
-rc_t redact_buf_resize( redact_buffer * rbuf, const size_t new_size );
-
-/********************************************************************
-    redact_val is a mapping of typename to its redaction-value
-********************************************************************/
-typedef struct redact_val
-{
-    char *name;             /* the name of the type */
-    uint32_t len;           /* the length of the value */
-    void * value;           /* pointer to the value of length len */
-} redact_val;
-typedef redact_val* p_redact_val;
-
-
-/********************************************************************
-    vector of redact-values
-********************************************************************/
-typedef struct redact_vals
-{
-    Vector vals;
-} redact_vals;
-typedef redact_vals* p_redact_vals;
-
-
-/*
- * fills a buffer with the value found in a redact-val-struct
-*/
-void redact_val_fill_buffer( const p_redact_val r_val,
-                             redact_buffer * rbuf,
-                             const size_t buffsize );
-
-
-/*
- * initializes a redact-val-list
-*/
-rc_t redact_vals_init( redact_vals** vals );
-
-
-/*
- * destroys the redact-val-list
-*/
-rc_t redact_vals_destroy( redact_vals* vals );
-
-
-/*
- * adds a entry into the redact-val-list
-*/
-rc_t redact_vals_add( redact_vals* vals, const char* name, 
-                      const uint32_t len, const char* value );
-
-
-/*
- * returns a pointer to a redact-value by name
-*/
-p_redact_val redact_vals_get_by_name( const redact_vals* vals,
-                                      const char * name );
-
-
-/*
- * returns a pointer to a redact-value by type-cast
-*/
-p_redact_val redact_vals_get_by_cast( const redact_vals* vals,
-                                      const char * cast );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/type_matcher.c b/tools/vdb-copy/type_matcher.c
deleted file mode 100644
index 5b08bec..0000000
--- a/tools/vdb-copy/type_matcher.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#include "vdb-copy-includes.h"
-#include "matcher_input.h"
-#include "helper.h"
-
-#include <sysalloc.h>
-#include <stdlib.h>
-
-/* internal definition of a type to be matched */
-typedef struct mtype
-{
-    char *name;
-    uint32_t dflt; /* 0=yes, 1=no (this way for re-ordering) */
-    uint32_t order;
-    uint32_t lossy_score;
-    VTypedecl type_decl;
-    VTypedesc type_desc;
-} mtype;
-typedef mtype* p_mtype;
-
-
-/* internal definition of a pair of source- and dest-type */
-typedef struct mpair
-{
-    p_mtype src;
-    p_mtype dst;
-    uint32_t compatible; /* 0=yes, 1=no (this way for re-ordering) */
-    uint32_t distance;
-} mpair;
-typedef mpair* p_mpair;
-
-
-/* internal definition of a column */
-typedef struct mcol
-{
-    char *name;
-    uint32_t src_idx;       /* index of this column relative to the
-                               read-cursor */
-
-    uint32_t dst_idx;       /* index of this column relative to the
-                               write-cursor */
-
-    bool excluded;          /* for excludes via config-file */
-
-    bool to_copy;           /* this column has a correspondig column 
-                               in the list of writable columns of the
-                               destination-schema with writable types */
-
-    VTypedecl type_decl;    /* type-decl of this column via read-schema */
-    VTypedesc type_desc;    /* type-desc of this column via read-schema */
-
-    Vector src_types;       /* list of src-types */
-    Vector dst_types;       /* list of dst-types */
-    Vector pairs;           /* list of (src->dst)-pairs... */
-
-    /* the src->dst type-pair, that won the type-matching-procedure */
-    p_mpair type_cast;
-} mcol;
-typedef mcol* p_mcol;
-
-
-/* internal definition of the matcher */
-typedef struct matcher
-{
-    Vector mcols;
-} matcher;
-typedef matcher* p_matcher;
-
-
-/* allocate a type-pair */
-static p_mpair matcher_init_pair( const p_mtype src, 
-                                  const p_mtype dst )
-{
-    p_mpair res = NULL;
-    if ( src == NULL ) return res;
-    if ( dst == NULL ) return res;
-    res = calloc( 1, sizeof( mpair ) );
-    if ( res != NULL )
-    {
-        res->src = src;
-        res->dst = dst;
-    }
-    return res;
-}
-
-
-/* destroys a type-pair */
-static void CC matcher_destroy_pair( void* node, void* data )
-{
-    p_mpair pair = (p_mpair)node;
-    if ( pair != NULL )
-        free( pair );
-}
-
-
-/* allocate a m-type definition */
-static p_mtype matcher_init_type( const char* name, 
-                                  const bool dflt,
-                                  const uint32_t order )
-{
-    p_mtype res = NULL;
-    if ( name == NULL ) return res;
-    if ( name[0] == 0 ) return res;
-    res = calloc( 1, sizeof( mtype ) );
-    if ( res != NULL )
-    {
-        res->name = string_dup_measure ( name, NULL );
-        res->dflt = ( dflt ? 0 : 1 );
-        res->order = order;
-    }
-    return res;
-}
-
-
-/* destroys a m-type definition */
-static void CC matcher_destroy_type( void* node, void* data )
-{
-    p_mtype type = (p_mtype)node;
-    if ( type != NULL )
-    {
-        if ( type->name != NULL )
-            free( type->name );
-        free( type );
-    }
-}
-
-
-/* allocate a matcher-column */
-static p_mcol matcher_make_col( const char* name )
-{
-    p_mcol res = NULL;
-    if ( name == NULL ) return res;
-    if ( name[0] == 0 ) return res;
-    res = calloc( 1, sizeof( mcol ) );
-    /* because of calloc all members are zero! */
-    if ( res != NULL )
-    {
-        res->name = string_dup_measure ( name, NULL );
-        VectorInit( &(res->src_types), 0, 3 );
-        VectorInit( &(res->dst_types), 0, 3 );
-        VectorInit( &(res->pairs), 0, 6 );
-        res->type_cast = NULL;
-    }
-    return res;
-}
-
-
-/* destroys a matcher-column */
-static void CC matcher_destroy_col( void* node, void* data )
-{
-    p_mcol col = (p_mcol)node;
-    if ( col == NULL ) return;
-    if ( col->name != NULL )
-        free( col->name );
-    VectorWhack( &(col->src_types), matcher_destroy_type, NULL );
-    VectorWhack( &(col->dst_types), matcher_destroy_type, NULL );
-    VectorWhack( &(col->pairs), matcher_destroy_pair, NULL );
-    free( col );
-}
-
-
-/* initializes the matcher */
-rc_t matcher_init( matcher** self )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
-    (*self) = calloc( 1, sizeof( matcher ) );
-    if ( *self == NULL )
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    VectorInit( &((*self)->mcols), 0, 5 );
-    return 0;
-}
-
-
-/* destroys the matcher */
-rc_t matcher_destroy( matcher* self )
-{
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcSelf, rcNull );
-    VectorWhack( &(self->mcols), matcher_destroy_col, NULL );
-    free( self );
-    return 0;
-}
-
-
-static p_mcol matcher_find_col( const matcher* self, const char *name )
-{
-    p_mcol res = NULL;
-    uint32_t idx, count;
-    count =  VectorLength( &(self->mcols) );
-    for ( idx = 0; idx < count && res == NULL; ++idx )
-    {
-        p_mcol col = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( col != NULL )
-            if ( nlt_strcmp( col->name, name ) == 0 )
-                res = col;
-    }
-    return res;
-}
-
-
-static char * matcher_get_col_cast( const p_mcol col, const char *s_type )
-{
-    char * res;
-    size_t idx;
-    uint32_t len = string_measure ( col->name, NULL ) + 4;
-    len += string_measure ( s_type, NULL );
-    res = malloc( len );
-    if ( res == NULL ) return res;
-    res[ 0 ] = '(';
-    idx = string_copy_measure ( &(res[ 1 ]), len-1, s_type );
-    res[ idx + 1 ] = ')';
-    string_copy_measure ( &(res[ idx + 2 ]), len-(idx+2), col->name );
-    return res;
-}
-
-
-/* makes a typecast-string for the src/dest-table by column-name */
-static rc_t matcher_get_cast( const matcher* self, const char *name, 
-                              const bool src, char **cast )
-{
-    p_mcol col;
-    if ( self == NULL )
-        return RC( rcVDB, rcNoTarg, rcSearching, rcSelf, rcNull );
-    if ( cast == NULL || name == NULL )
-        return RC( rcVDB, rcNoTarg, rcSearching, rcParam, rcNull );
-    *cast = NULL;
-    col = matcher_find_col( self, name );
-    if ( col == NULL ) return 0;
-
-    if ( col->type_cast == NULL )
-    {
-        /* if the column has no match, just use the undecorated column-name*/
-        if ( src )
-            *cast = string_dup_measure ( col->name, NULL );
-        else
-        {
-            if ( col->to_copy && !col->excluded )
-                *cast = string_dup_measure ( col->name, NULL );
-        }
-    }
-    else
-    {
-        /* if the column has a match, construct the type-cast*/
-        if ( src )
-            *cast = matcher_get_col_cast( col, col->type_cast->src->name );
-        else
-        {
-            if ( col->to_copy && !col->excluded )
-                *cast = matcher_get_col_cast( col, col->type_cast->dst->name );
-        }
-    }
-    return 0;
-}
-
-
-/* makes a typecast-string for the source-table by column-name */
-rc_t matcher_src_cast( const matcher* self, const char *name, char **cast )
-{
-    return matcher_get_cast( self, name, true, cast );
-}
-
-
-/* makes a typecast-string for the destination-table by column-name */
-rc_t matcher_dst_cast( const matcher* self, const char *name, char **cast )
-{
-    return matcher_get_cast( self, name, false, cast );
-}
-
-
-static bool match_type_with_id_vector( const VSchema * s,
-                const VTypedecl * td, const Vector * id_vector )
-{
-    bool res = false;
-    uint32_t idx, len;
-
-    len = VectorLength( id_vector );
-    for ( idx = 0;  idx < len && !res; ++idx )
-    {
-        uint32_t *id = (uint32_t *) VectorGet ( id_vector, idx );
-        if ( id != NULL )
-        {
-            VTypedecl cast;
-            uint32_t distance;
-            res = VTypedeclToType ( td, s, *id, &cast, &distance );
-        }
-    }
-    return res;
-}
-
-/* checks if a column with the given name has at least one type
-   that is also in the given typelist... */
-bool matcher_src_has_type( const matcher* self, const VSchema * s,
-                           const char *name, const Vector *id_vector )
-{
-    bool res = false;
-    p_mcol col;
-    VTypedecl td;
-
-    if ( self == NULL || s == NULL || name == NULL || id_vector == NULL )
-        return res;
-    col = matcher_find_col( self, name );
-    if ( col == NULL ) return res; /* column not found */
-    if ( col->type_cast == NULL ) return res; /* column has no typecast */ 
-
-    /* we use the destination-type-cast */
-    if ( VSchemaResolveTypedecl ( s, &td, col->type_cast->dst->name ) == 0 )
-        res = match_type_with_id_vector( s, &td, id_vector );
-/*
-    if ( res )
-        KOutMsg( "redact-type found on (%s)%s\n", col->type_cast->dst->name, name );
-*/
-    return res;
-}
-
-static void matcher_report_types( const char * s, const Vector *v )
-{
-    uint32_t idx, len;
-    len = VectorLength( v );
-    if ( len > 0 )
-    {
-        KOutMsg( "%s: ", s );
-        for ( idx = 0;  idx < len; ++idx )
-        {
-            p_mtype item = (p_mtype) VectorGet ( v, idx );
-            if ( item != NULL )
-                KOutMsg( "[ %s ] ", item->name );
-        }
-        KOutMsg( "\n" );
-    }
-}
-
-
-static void matcher_report_pair( const p_mpair pair )
-{
-    if ( pair->src == NULL || pair->dst == NULL )
-        return;
-    if ( pair->compatible == 0 )
-        KOutMsg( "[%s](l=%u/o=%u/d=%u) --> [%s] (c) dist=%u\n", 
-                  pair->src->name, 
-                  pair->src->lossy_score, pair->src->order, pair->src->dflt,
-                  pair->dst->name, pair->distance );
-    else
-        KOutMsg( "[%s](l=%u/o=%u/d=%u) --> [%s] dist=%u\n",
-                  pair->src->name,
-                  pair->src->lossy_score, pair->src->order, pair->src->dflt,
-                  pair->dst->name, pair->distance );
-}
-
-
-static void matcher_report_pairs( const Vector *v )
-{
-    uint32_t idx, len;
-    len = VectorLength( v );
-    for ( idx = 0;  idx < len; ++idx )
-       matcher_report_pair( (p_mpair) VectorGet ( v, idx ) );
-}
-
-
-static void matcher_report_col( const p_mcol item )
-{
-    KOutMsg( "----------------------------------\n" );
-    if ( item->to_copy )
-        KOutMsg( "col: %s (c)\n", item->name );
-    else
-        KOutMsg( "col: %s\n", item->name );
-    matcher_report_types( " src", &(item->src_types ) );
-    matcher_report_types( " dst", &(item->dst_types ) );
-    matcher_report_pairs( &(item->pairs ) );
-    KOutMsg( "\n" );
-}
-
-
-rc_t matcher_report( matcher* self, const bool only_copy_columns )
-{
-    uint32_t idx, len;
-
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0; idx < len; ++idx )
-    {
-        p_mcol item = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( item != NULL )
-        {
-            if ( only_copy_columns )
-            {
-                if ( item->to_copy )
-                    matcher_report_col( item );
-            }
-            else
-                matcher_report_col( item );
-        }
-    }
-    return 0;
-}
-
-
-static rc_t matcher_append_type( const char *name, const bool dflt,
-                                 const uint32_t order,
-                                 const VSchema *schema, Vector *v )
-{
-    rc_t rc = 0;
-    p_mtype t = matcher_init_type( name, dflt, order );
-    if ( t == NULL )
-        rc = RC( rcExe, rcNoTarg, rcResolving, rcMemory, rcExhausted );
-    if ( rc == 0 )
-    {
-        rc = VectorAppend( v, NULL, t );
-        if ( rc == 0 )
-        {
-            rc = VSchemaResolveTypedecl( schema, &(t->type_decl), name );
-            if ( rc == 0 )
-            {
-                rc = VSchemaDescribeTypedecl( schema, &(t->type_desc), &(t->type_decl) );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t matcher_read_col_src_types( p_mcol col, 
-        const KNamelist *names, const uint32_t dflt_idx, const VSchema *schema )
-{
-    uint32_t count;
-    rc_t rc = KNamelistCount( names, &count );
-    if ( rc == 0 )
-    {
-        uint32_t idx;
-        for ( idx = 0; idx < count && rc == 0; ++idx )
-        {
-            const char *name;
-            rc = KNamelistGet( names, idx, &name );
-            if ( rc == 0 )
-                rc = matcher_append_type( name, ( idx == dflt_idx ), idx,
-                                          schema, &(col->src_types) );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t matcher_read_src_types( matcher* self, const VTable *table,
-                                    const VSchema *schema )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( table == NULL || schema == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0;  idx < len && rc == 0; ++idx )
-    {
-        p_mcol item = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( item != NULL )
-        {
-            uint32_t dflt_idx;
-            KNamelist *names;
-            rc = VTableListReadableDatatypes( table, item->name, &dflt_idx, &names );
-            if ( rc == 0 )
-            {
-                rc = matcher_read_col_src_types( item, names, dflt_idx, schema );
-                KNamelistRelease( names );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t matcher_read_dst_types( matcher* self, const VTable *table,
-                             const VSchema *schema )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( table == NULL || schema == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0;  idx < len && rc == 0; ++idx )
-    {
-        p_mcol item = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( item != NULL )
-        {
-            KNamelist *names;
-            rc = VTableListWritableDatatypes ( (VTable*)table, item->name, &names );
-            if ( rc == 0 )
-            {
-                uint32_t type_count;
-                rc = KNamelistCount( names, &type_count );
-                if ( rc == 0 && type_count > 0 )
-                {
-                    uint32_t type_idx;
-                    item->to_copy = true; /* !!! this column has to be copied */
-                    for ( type_idx = 0; type_idx < type_count && rc == 0; ++type_idx )
-                    {
-                        const char *name;
-                        rc = KNamelistGet( names, type_idx, &name );
-                        if ( rc == 0 )
-                            rc = matcher_append_type( name, false, idx,
-                                                      schema, &(item->dst_types) );
-                    }
-                }
-                KNamelistRelease( names );
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t matcher_make_column_matrix( p_mcol col )
-{
-    rc_t rc = 0;
-    uint32_t src_idx, src_len;
-
-    src_len = VectorLength( &(col->src_types) );
-    for ( src_idx = 0;  src_idx < src_len && rc == 0; ++src_idx )
-    {
-        p_mtype src_type = (p_mtype) VectorGet ( &(col->src_types), src_idx );
-        if ( src_type )
-        {
-            uint32_t dst_idx, dst_len;
-            dst_len = VectorLength( &(col->dst_types) );
-            for ( dst_idx = 0;  dst_idx < dst_len && rc == 0; ++dst_idx )
-            {
-                p_mtype dst_type = (p_mtype) VectorGet ( &(col->dst_types), dst_idx );
-                if ( dst_type )
-                {
-                    p_mpair pair = matcher_init_pair( src_type, dst_type );
-                    if ( pair != NULL )
-                        rc = VectorAppend( &(col->pairs), NULL, pair );
-                    else
-                        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static rc_t matcher_make_type_matrix( matcher* self )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-    
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0;  idx < len && rc == 0; ++idx )
-    {
-        p_mcol col = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( col != NULL )
-            if ( col->to_copy )
-                rc = matcher_make_column_matrix( col );
-    }
-    return rc;
-}
-
-
-static int CC matcher_match_cb( const void ** p1, const void ** p2, void *data )
-{
-    int res = 0;
-    const p_mpair pair_1 = (p_mpair)(*p1);
-    const p_mpair pair_2 = (p_mpair)(*p2);
-    if ( pair_1 == NULL || pair_2 == NULL )
-        return res;
-    /* first we order by compatibility */
-    res = ( pair_1->compatible ) - ( pair_2->compatible );
-    if ( res == 0 )
-    {
-        /* second we order by lossy-ness, lowest value first */
-        res = ( pair_1->src->lossy_score ) - ( pair_2->src->lossy_score );
-        if ( res == 0 )
-        {
-            /* if the lossy-ness is the same, we order by distance */
-            res = ( pair_1->distance ) - ( pair_2->distance );
-            if ( res == 0 )
-            {
-                /* if the distance is the same, we order by default-value */
-                res = ( pair_1->src->dflt ) - ( pair_2->src->dflt );
-                if ( res == 0 )
-                    /* if there is not default-value, we use the org. order */
-                    res = ( pair_1->src->order ) - ( pair_2->src->order );
-            }
-        }
-    }
-    return res;
-}
-
-
-static void CC matcher_enter_type_score_cb( void * item, void * data )
-{
-    p_mtype type = (p_mtype)item;
-    const KConfig *cfg = (const KConfig *)data;
-    if ( type != NULL && cfg != NULL )
-        type->lossy_score = helper_rd_type_score( cfg, type->name );
-}
-
-
-static void CC matcher_measure_dist_cb( void * item, void * data )
-{
-    p_mpair pair = (p_mpair)item;
-    const VSchema *schema = (const VSchema *)data;
-    if ( pair != NULL && schema != NULL )
-    {
-        bool compatible = VTypedeclCommonAncestor ( &(pair->src->type_decl),
-                schema, &(pair->dst->type_decl), NULL, &(pair->distance) );
-        pair->compatible = ( compatible ? 0 : 1 );
-    }
-}
-
-
-static void matcher_match_column( p_mcol col,
-        const VSchema *schema, const KConfig *cfg )
-{
-    uint32_t pair_count = VectorLength( &(col->pairs) );
-
-    col->type_cast = NULL;
-    if ( col->excluded ) return;
-
-    /* call VTypedeclCommonAncestor for every type-pair */
-    VectorForEach ( &(col->pairs), false,
-            matcher_measure_dist_cb, (void*)schema );
-    /* if we have more than one pair left... */
-    if ( pair_count > 1 )
-    {
-        /* enter the lossy-ness into the src-types... */
-        VectorForEach ( &(col->src_types), false,
-            matcher_enter_type_score_cb, (void*)cfg );
-    
-        /* reorder the remaining pair's by:
-           compatibility, lossy-ness, distance, default, order */
-        VectorReorder ( &(col->pairs), matcher_match_cb, NULL );
-    }
-    
-    /* pick the winner = first item in the vector */
-    if ( pair_count > 0 )
-    {
-        col->type_cast = (p_mpair)VectorFirst ( &(col->pairs) );
-        /* if the winner is not a compatible pair, we have no cast ! */
-        if ( col->type_cast->compatible != 0 )
-            col->type_cast = NULL;
-    }
-}
-
-
-static rc_t matcher_match_matrix( matcher* self,
-        const VSchema *schema, const KConfig *cfg )
-{
-    rc_t rc = 0;
-    uint32_t idx, len;
-    
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( schema == NULL || cfg == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0;  idx < len; ++idx )
-    {
-        p_mcol col = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( col != NULL )
-            if ( col->to_copy )
-                matcher_match_column( col, schema, cfg );
-    }
-    return rc;
-}
-
-
-static rc_t matcher_build_column_vector( matcher* self, const char * columns )
-{
-    const KNamelist *list;
-    uint32_t count, idx;
-    rc_t rc = nlt_make_namelist_from_string( &list, columns );
-    if ( rc != 0 ) return rc;
-    rc = KNamelistCount( list, &count );
-    if ( rc == 0 )
-        for ( idx = 0; idx < count && rc == 0; ++idx )
-        {
-            const char *s;
-            rc = KNamelistGet( list, idx, &s );
-            if ( rc == 0 )
-            {
-                p_mcol new_col = matcher_make_col( s );
-                if ( new_col == NULL )
-                    rc = RC( rcExe, rcNoTarg, rcResolving, rcMemory, rcExhausted );
-                if ( rc == 0 )
-                    rc = VectorAppend( &(self->mcols), NULL, new_col );
-            }
-        }
-    KNamelistRelease( list );
-    return rc;
-}
-
-
-static rc_t matcher_exclude_columns( matcher* self, const char * columns )
-{
-    const KNamelist *list;
-    uint32_t len, idx;
-    rc_t rc;
-
-    if ( columns == NULL ) return 0;
-    rc = nlt_make_namelist_from_string( &list, columns );
-    len = VectorLength( &(self->mcols) );
-    for ( idx = 0;  idx < len; ++idx )
-    {
-        p_mcol col = (p_mcol) VectorGet ( &(self->mcols), idx );
-        if ( col != NULL )
-            col->excluded = nlt_is_name_in_namelist( list, col->name );
-    }
-    KNamelistRelease( list );
-    return rc;
-}
-
-
-rc_t matcher_execute( matcher* self, const p_matcher_input in )
-{
-    VSchema * dflt_schema;
-    const VTable * src_table;
-    rc_t rc;
-
-    if ( self == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcSelf, rcNull );
-    if ( in->manager == NULL || in->add_schemas == NULL || 
-         in->cfg == NULL || in->columns == NULL || 
-         in->src_path == NULL || in->dst_path == NULL ||
-         in->dst_tabname == NULL )
-        return RC( rcExe, rcNoTarg, rcResolving, rcParam, rcNull );
-
-    rc = matcher_build_column_vector( self, in->columns );
-    if ( rc != 0 ) return rc;
-
-    rc = matcher_exclude_columns( self, in->excluded_columns );
-    if ( rc != 0 ) return rc;
-
-    rc = helper_parse_schema( in->manager, &dflt_schema, in->add_schemas );
-    if ( rc != 0 ) return rc;
-
-    rc = VDBManagerOpenTableRead( in->manager, &src_table, dflt_schema, in->src_path );
-    if ( rc == 0 )
-    {
-        const VSchema * src_schema;
-        rc = VTableOpenSchema ( src_table, &src_schema );
-        if ( rc == 0 )
-        {
-            rc = matcher_read_src_types( self, src_table, src_schema );
-            if ( rc == 0 )
-            {
-                if ( in->legacy_schema != NULL )
-                    rc = VSchemaParseFile ( dflt_schema, in->legacy_schema );
-                if ( rc == 0 )
-                {
-                    VTable * dst_table;
-                    KCreateMode cmode = kcmParents;
-                    const VSchema * dst_schema = src_schema;
-
-                    if ( in->legacy_schema != NULL )
-                        dst_schema = dflt_schema;
-
-                    if ( in->force_unlock )
-                        VDBManagerUnlock ( in->manager, in->dst_path );
-
-                    if ( in->force_kcmInit )
-                        cmode |= kcmInit;
-                    else
-                        cmode |= kcmCreate;
-
-                    rc = VDBManagerCreateTable( in->manager, &dst_table, 
-                                dst_schema, in->dst_tabname, cmode, in->dst_path );
-
-                    if ( rc == 0 )
-                    {
-                        rc = matcher_read_dst_types( self, dst_table, dst_schema );
-                        if ( rc == 0 )
-                        {
-                            rc = matcher_make_type_matrix( self );
-                            if ( rc == 0 )
-                                rc = matcher_match_matrix( self, src_schema, in->cfg );
-                        }
-                        VTableRelease( dst_table );
-                        if ( !(in->force_kcmInit) )
-                            KDirectoryRemove ( in->dir, true, in->dst_path );
-                    }
-                }
-            }
-            VSchemaRelease( src_schema );
-        }
-        VTableRelease( src_table );
-    }
-    VSchemaRelease( dflt_schema );
-    return rc;
-}
-
-
-rc_t matcher_db_execute( matcher* self, const VTable * src_tab, VTable * dst_tab,
-                         const VSchema * schema, const char * columns, 
-                         const char * kfg_path )
-{
-    KConfig * cfg;
-    rc_t rc = helper_make_config_mgr( &cfg, kfg_path );
-    if ( rc == 0 )
-    {
-        rc = matcher_build_column_vector( self, columns );
-        if ( rc != 0 ) return rc;
-
-        rc = matcher_read_src_types( self, src_tab, schema );
-        if ( rc == 0 )
-        {
-            rc = matcher_read_dst_types( self, dst_tab, schema );
-            if ( rc == 0 )
-            {
-                rc = matcher_make_type_matrix( self );
-                if ( rc == 0 )
-                    rc = matcher_match_matrix( self, schema, cfg );
-            }
-        }
-        KConfigRelease( cfg );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/type_matcher.h b/tools/vdb-copy/type_matcher.h
deleted file mode 100644
index bf64ea5..0000000
--- a/tools/vdb-copy/type_matcher.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_type_matcher_
-#define _h_type_matcher_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_matcher_input_
-#include "matcher_input.h"
-#endif
-
-typedef struct matcher matcher;
-
-/* initializes the matcher */
-rc_t matcher_init( matcher** self );
-
-/* destroys the matcher */
-rc_t matcher_destroy( matcher* self );
-
-/* shows the matching-matrix */
-rc_t matcher_report( matcher* self, const bool only_copy_columns );
-
-/* makes a typecast-string for the source-table by column-name */
-rc_t matcher_src_cast( const matcher* self, const char *name, char **cast );
-
-/* checks if a column with the given name has at least one type
-   that is also in the given typelist... */
-bool matcher_src_has_type( const matcher* self, const VSchema * s,
-                           const char *name, const Vector *id_vector );
-
-/* makes a typecast-string for the destination-table by column-name */
-rc_t matcher_dst_cast( const matcher* self, const char *name, char **cast );
-
-/* performs a type-match between src/dst with the given in_struct */
-rc_t matcher_execute( matcher* self, const p_matcher_input in );
-
-
-rc_t matcher_db_execute( matcher* self, const VTable * src_tab, VTable * dst_tab,
-                         const VSchema * schema, const char * columns, 
-                         const char * kfg_path );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/vdb-copy-includes.h b/tools/vdb-copy/vdb-copy-includes.h
deleted file mode 100644
index f274df6..0000000
--- a/tools/vdb-copy/vdb-copy-includes.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-#ifndef _h_vdb_copy_includes_
-#define _h_vdb_copy_includes_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#ifndef _h_klib_out_
-#include <klib/out.h>
-#endif
-
-#ifndef _h_klib_log_
-#include <klib/log.h>
-#endif
-
-#ifndef _h_klib_rc_
-#include <klib/rc.h>
-#endif
-
-#ifndef _h_klib_debug_
-#include <klib/debug.h>
-#endif
-
-#ifndef _h_klib_vector_
-#include <klib/vector.h>
-#endif
-
-#ifndef _h_klib_text_
-#include <klib/text.h>
-#endif
-
-#ifndef _h_klib_args_
-#include <kapp/args.h>
-#endif
-
-#ifndef _h_kfs_directory_
-#include <kfs/directory.h>
-#endif
-
-#ifndef _h_kfs_file_
-#include <kfs/file.h>
-#endif
-
-#ifndef _h_kfg_config_
-#include <kfg/config.h>
-#endif
-
-#ifndef _h_vdb_manager_
-#include <vdb/manager.h>
-#endif
-
-#ifndef _h_vdb_table_
-#include <vdb/table.h>
-#endif
-
-#ifndef _h_vdb_cursor_
-#include <vdb/cursor.h>
-#endif
-
-#ifndef _h_vdb_database_
-#include <vdb/database.h>
-#endif
-
-#ifndef _h_vdb_schema_
-#include <vdb/schema.h>
-#endif
-
-#ifndef _h_vdb_vdb_priv_
-#include <vdb/vdb-priv.h>
-#endif
-
-#ifndef _h_sra_sraschema_
-#include <sra/sraschema.h>
-#endif
-
-/*
-#ifndef _h_sra_srapath_
-#include <sra/srapath.h>
-#endif
-*/
-
-#ifndef _h_namelist_tools_
-#include "namelist_tools.h"
-#endif
-
-#include <os-native.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-copy/vdb-copy.c b/tools/vdb-copy/vdb-copy.c
deleted file mode 100644
index aea9fb7..0000000
--- a/tools/vdb-copy/vdb-copy.c
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-copy.vers.h"
-#include "vdb-copy-includes.h"
-#include "definitions.h"
-#include "context.h"
-#include "helper.h"
-#include "coldefs.h"
-#include "get_platform.h"
-#include "progressbar.h"
-#include "copy_meta.h"
-#include "type_matcher.h"
-#include "redactval.h"
-
-#include <kapp/main.h>
-#include <sysalloc.h>
-
-/*
-#if _DEBUGGING
-#define _CRTDBG_MAP_ALLOC 1
-#include <crtdbg.h>
-#endif
-*/
-
-#include <stdlib.h>
-#include <string.h>
-
-static const char * table_usage[] = { "table-name", NULL };
-static const char * rows_usage[] = { "set of rows to be copied(default = all)", NULL };
-#if ALLOW_COLUMN_SPEC
-static const char * columns_usage[] = { "set of columns to be copied(default = all)", NULL };
-#endif
-static const char * schema_usage[] = { "schema-name", NULL };
-static const char * without_accession_usage[] = { "without accession-test", NULL };
-static const char * ignore_reject_usage[] = { "ignore SRA_FILTER_REJECT values", NULL };
-static const char * ignore_redact_usage[] = { "ignore SRA_FILTER_REDACTED values", NULL };
-#if ALLOW_EXTERNAL_CONFIG
-static const char * kfg_path_usage[] = { "use this path to find the file vdb-copy.kfg", NULL };
-#endif
-static const char * show_matching_usage[] = { "show type-matching results", NULL };
-static const char * show_progress_usage[] = { "show progress in percent while copying", NULL };
-static const char * ignore_incomp_usage[] = { "ignore incompatible columns", NULL };
-static const char * reindex_usage[] = { "reindex columns after copy", NULL };
-static const char * show_redact_usage[] = { "show redaction-process", NULL };
-static const char * excluded_columns_usage[] = { "exclude these columns from copy", NULL };
-static const char * show_meta_usage[] = { "show metadata-copy-process", NULL };
-static const char * md5mode_usage[] = { "MD5-mode def.: auto, '1'...forced ON, '0'...forced OFF)", NULL };
-static const char * blcmode_usage[] = { "Blob-checksum def.: auto, '1'...CRC32, 'M'...MD5, '0'...OFF)", NULL };
-static const char * force_usage[] = { "forces an existing target to be overwritten", NULL };
-static const char * unlock_usage[] = { "forces a locked target to be unlocked", NULL };
-
-OptDef MyOptions[] =
-{
-    { OPTION_TABLE, ALIAS_TABLE, NULL, table_usage, 1, true, false },
-    { OPTION_ROWS, ALIAS_ROWS, NULL, rows_usage, 1, true, false },
-#if ALLOW_COLUMN_SPEC
-    { OPTION_COLUMNS, ALIAS_COLUMNS, NULL, columns_usage, 1, true, false },
-#endif
-    { OPTION_SCHEMA, ALIAS_SCHEMA, NULL, schema_usage, 5, true, false },
-    { OPTION_WITHOUT_ACCESSION, ALIAS_WITHOUT_ACCESSION, NULL, without_accession_usage, 1, false, false },
-    { OPTION_IGNORE_REJECT, ALIAS_IGNORE_REJECT, NULL, ignore_reject_usage, 1, false, false },
-    { OPTION_IGNORE_REDACT, ALIAS_IGNORE_REDACT, NULL, ignore_redact_usage, 1, false, false },
-#if ALLOW_EXTERNAL_CONFIG
-    { OPTION_KFG_PATH, ALIAS_KFG_PATH, NULL, kfg_path_usage, 1, true, false },
-#endif
-    { OPTION_SHOW_MATCHING, ALIAS_SHOW_MATCHING, NULL, show_matching_usage, 1, false, false },
-    { OPTION_SHOW_PROGRESS, ALIAS_SHOW_PROGRESS, NULL, show_progress_usage, 1, false, false },
-    { OPTION_IGNORE_INCOMP, ALIAS_IGNORE_INCOMP, NULL, ignore_incomp_usage, 1, false, false },
-    { OPTION_REINDEX, ALIAS_REINDEX, NULL, reindex_usage, 1, false, false },
-    { OPTION_SHOW_REDACT, ALIAS_SHOW_REDACT, NULL, show_redact_usage, 1, false, false },
-    { OPTION_EXCLUDED_COLUMNS, ALIAS_EXCLUDED_COLUMNS, NULL, excluded_columns_usage, 1, true, false },
-    { OPTION_SHOW_META, ALIAS_SHOW_META, NULL, show_meta_usage, 1, false, false },
-    { OPTION_MD5_MODE, ALIAS_MD5_MODE, NULL, md5mode_usage, 1, true, false },
-    { OPTION_BLOB_CHECKSUM, ALIAS_BLOB_CHECKSUM, NULL, blcmode_usage, 1, true, false },
-    { OPTION_FORCE, ALIAS_FORCE, NULL, force_usage, 1, false, false },
-    { OPTION_UNLOCK, ALIAS_UNLOCK, NULL, unlock_usage, 1, false, false }
-};
-
-
-const char UsageDefaultName[] = "vdb-copy";
-
-
-rc_t CC UsageSummary ( const char * progname )
-{
-    return KOutMsg (
-        "\n"
-        "Usage:\n"
-        "  %s <src_path> <dst_path> [options]\n"
-        "\n", progname );
-}
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-    if (rc)
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary (progname);
-
-    KOutMsg ("Options:\n");
-
-    HelpOptionLine ( ALIAS_TABLE, OPTION_TABLE, "table", table_usage );
-    HelpOptionLine ( ALIAS_ROWS, OPTION_ROWS, "rows", rows_usage );
-#if ALLOW_COLUMN_SPEC
-    HelpOptionLine ( ALIAS_COLUMNS, OPTION_COLUMNS, "columns", columns_usage );
-#endif
-    HelpOptionLine ( ALIAS_SCHEMA, OPTION_SCHEMA, "schema", schema_usage );
-    HelpOptionLine ( ALIAS_WITHOUT_ACCESSION, OPTION_WITHOUT_ACCESSION, NULL, without_accession_usage );
-    HelpOptionLine ( ALIAS_IGNORE_REJECT, OPTION_IGNORE_REJECT, NULL, ignore_reject_usage );
-    HelpOptionLine ( ALIAS_IGNORE_REDACT, OPTION_IGNORE_REDACT, NULL, ignore_redact_usage );
-#if ALLOW_EXTERNAL_CONFIG
-    HelpOptionLine ( ALIAS_KFG_PATH, OPTION_KFG_PATH, NULL, kfg_path_usage );
-#endif
-    HelpOptionLine ( ALIAS_SHOW_MATCHING, OPTION_SHOW_MATCHING, NULL, show_matching_usage );
-    HelpOptionLine ( ALIAS_SHOW_PROGRESS, OPTION_SHOW_PROGRESS, NULL, show_progress_usage );
-    HelpOptionLine ( ALIAS_IGNORE_INCOMP, OPTION_IGNORE_INCOMP, NULL, ignore_incomp_usage );
-    HelpOptionLine ( ALIAS_REINDEX, OPTION_REINDEX, NULL, reindex_usage );
-    HelpOptionLine ( ALIAS_SHOW_REDACT, OPTION_SHOW_REDACT, NULL, show_redact_usage );
-    HelpOptionLine ( ALIAS_EXCLUDED_COLUMNS, OPTION_EXCLUDED_COLUMNS, NULL, excluded_columns_usage );
-    HelpOptionLine ( ALIAS_SHOW_META, OPTION_SHOW_META, NULL, show_meta_usage );
-    HelpOptionLine ( ALIAS_FORCE, OPTION_FORCE, NULL, force_usage );
-    HelpOptionLine ( ALIAS_UNLOCK, OPTION_UNLOCK, NULL, unlock_usage );
-    HelpOptionLine ( ALIAS_MD5_MODE, OPTION_MD5_MODE, NULL, md5mode_usage );
-    HelpOptionLine ( ALIAS_BLOB_CHECKSUM, OPTION_BLOB_CHECKSUM, NULL, blcmode_usage );
-
-    HelpOptionsStandard ();
-
-    HelpVersion ( fullpath, KAppVersion() );
-
-    return rc;
-}
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return VDB_COPY_VERS;
-}
-
-
-/* ----------------------------------------------------------------------------------- */
-static rc_t vdb_copy_redact_cell( const VCursor * src_cursor, VCursor * dst_cursor,
-                                  const p_col_def col, uint64_t row_id,
-                                  redact_buffer * rbuf,
-                                  const bool show_redact )
-{
-    rc_t rc;
-    const void * src_buffer;
-    uint32_t offset_in_bits;
-    uint32_t n_elements;
-    uint32_t elem_bits;
-
-    /* we read the original cell-data to detect how big the data is before redacting */
-    rc = VCursorCellData( src_cursor, col->src_idx, &elem_bits,
-                          &src_buffer, &offset_in_bits, &n_elements );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogInt,
-                 (klogInt,
-                 rc,
-                 "VCursorCellData( col:$(col_name) at row #$(row_nr) ) failed",
-                 "col_name=%s,row_nr=%lu",
-                  col->name, row_id ));
-    }
-
-    DISP_RC( rc, "vdb_copy_redact_cell:VCursorCellData(src) failed" );
-    if ( rc == 0 )
-    {
-        size_t new_size = ( ( elem_bits * n_elements ) + 8 ) >> 3;
-        rc = redact_buf_resize( rbuf, new_size );
-        DISP_RC( rc, "vdb_copy_redact_cell:redact_buf_resize() failed" );
-        if ( rc == 0 )
-        {
-            if ( col->r_val != NULL )
-            {
-                if ( show_redact )
-                {
-                    char * c = ( char * )col->r_val->value;
-                    KOutMsg( "redacting #%lu %s -> 0x%.02x\n", row_id, col->dst_cast, *c );
-                }
-                redact_val_fill_buffer( col->r_val, rbuf, new_size );
-            }
-            else
-            {
-                if ( show_redact )
-                    KOutMsg( "redacting #%lu %s -> 0\n", row_id, col->dst_cast );
-                memset( rbuf->buffer, 0, new_size );
-            }
-
-            rc = VCursorWrite( dst_cursor, col->dst_idx, elem_bits,
-                               rbuf->buffer, 0, n_elements );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogInt,
-                         (klogInt,
-                         rc,
-                         "VCursorWrite( col:$(col_name) at row #$(row_nr) ) failed",
-                         "col_name=%s,row_nr=%lu",
-                          col->name, row_id ));
-            }
-        }
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------------------- */
-static rc_t vdb_copy_cell( const VCursor * src_cursor, VCursor * dst_cursor,
-                           const p_col_def col, uint64_t row_id )
-{
-    rc_t rc;
-
-    const void *buffer;
-    uint32_t offset_in_bits;
-    uint32_t number_of_elements;
-    uint32_t elem_bits;
-
-    /*
-    KOutMsg( " - copy cell %s ( src_idx=%u / dst_idx=%u )\n", 
-              col->name, col->src_idx, col->dst_idx );
-    */
-    rc = VCursorCellData( src_cursor, col->src_idx, &elem_bits,
-                          &buffer, &offset_in_bits, &number_of_elements );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogInt,
-                 (klogInt,
-                 rc,
-                 "VCursorCellData( col:$(col_name) at row #$(row_nr) ) failed",
-                 "col_name=%s,row_nr=%lu",
-                  col->name, row_id ));
-    }
-    if ( rc != 0 ) return rc;
-
-    /*
-    KOutMsg( "bit-offset = %u / elements = %u / element-bits = %u\n", 
-       offset_in_bits, number_of_elements, elem_bits );
-    */
-    rc = VCursorWrite( dst_cursor, col->dst_idx, elem_bits,
-                       buffer, offset_in_bits, number_of_elements );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogInt,
-                 (klogInt,
-                 rc,
-                 "VCursorWrite( col:$(col_name) at row #$(row_nr) ) failed",
-                 "col_name=%s,row_nr=%lu",
-                  col->name, row_id ));
-    }
-    return rc;
-}
-
-
-/* ----------------------------------------------------------------------------------- */
-static rc_t vdb_copy_row( const VCursor * src_cursor,
-                          VCursor * dst_cursor,
-                          col_defs * columns,
-                          uint64_t row_id,
-                          redact_buffer * rbuf,
-                          const bool redact,
-                          const bool show_redact )
-{
-    uint32_t len, idx = 0;
-    rc_t rc = VCursorOpenRow( dst_cursor );
-    if ( rc != 0 )
-    {
-        PLOGERR( klogInt,
-                 (klogInt,
-                 rc,
-                 "VCursorOpenRow(dst) row #$(row_nr) failed",
-                 "row_nr=%lu",
-                 row_id ));
-        return rc;
-    }
-
-    len = VectorLength( &(columns->cols) );
-    /* loop through the columns and copy them if they have to be copied */
-    while ( idx < len && rc == 0 )
-    {
-        p_col_def col = (p_col_def) VectorGet ( &(columns->cols), idx++ );
-        if ( col != NULL )
-        {
-            if ( col->to_copy )
-            {
-                if ( redact && col->redactable )
-                    rc = vdb_copy_redact_cell( src_cursor, dst_cursor,
-                                               col, row_id, rbuf, show_redact );
-                else
-                    rc = vdb_copy_cell( src_cursor, dst_cursor, col, row_id );
-            }
-        }
-    }
-    if ( rc == 0 )
-    {
-        rc = VCursorCommitRow( dst_cursor );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogInt,
-                     (klogInt,
-                     rc,
-                     "VCursorCommitRow(dst) row #$(row_nr) failed",
-                     "row_nr=%lu",
-                     row_id ));
-        }
-
-        rc = VCursorCloseRow( dst_cursor );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogInt,
-                     (klogInt,
-                     rc,
-                     "VCursorCloseRow(dst) row #$(row_nr) failed",
-                     "row_nr=%lu",
-                     row_id ));
-        }
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_read_row_flags( const p_context ctx,
-                                     const VCursor *cursor,
-                                     const uint32_t src_idx,
-                                     bool *pass,
-                                     bool *redact )
-{
-    uint64_t filter;
-    /* read the filter-value from the filter-column */
-    rc_t rc = helper_read_vdb_int_row_open( cursor, src_idx, &filter );
-    if ( rc != 0 ) return rc;
-
-    switch( filter )
-    {
-    case SRA_READ_FILTER_REJECT   : 
-        if ( ctx->ignore_reject == false ) *pass = false;
-        break;
-
-    case SRA_READ_FILTER_REDACTED : 
-        if ( ctx->ignore_redact == false ) *redact = true;
-        break;
-    }
-    return rc;
-}
-
-
-static uint8_t vdb_copy_calc_fract_digits( const num_gen_iter *iter )
-{
-    uint8_t res = 0;
-    uint64_t count;
-    if ( num_gen_iterator_count( iter, &count ) == 0 )
-    {
-        if ( count > 10000 )
-        {
-            if ( count > 100000 )
-                res = 2;
-            else
-                res = 1;
-        }
-    }
-    return res;
-}
-
-
-static rc_t vdb_copy_row_loop( const p_context ctx,
-                               const VCursor * src_cursor,
-                               VCursor * dst_cursor,
-                               col_defs * columns,
-                               redact_vals * rvals )
-{
-    rc_t rc;
-    const num_gen_iter *iter;
-    uint64_t count, row_id;
-    uint32_t percent;
-    uint8_t fract_digits;
-    p_col_def filter_col_def = NULL;
-    redact_buffer rbuf;
-    progressbar * progress;
-
-    if ( columns->filter_idx != -1 )
-        filter_col_def = col_defs_get( columns, columns->filter_idx );
-
-    rc = num_gen_iterator_make( ctx->row_generator, &iter );
-    if ( rc != 0 ) return rc;
-
-    rc = make_progressbar( &progress );
-    DISP_RC( rc, "vdb_copy_row_loop:make_progressbar() failed" );
-    if ( rc != 0 ) return rc;
-
-    redact_buf_init( &rbuf );
-    col_defs_find_redact_vals( columns, rvals );
-
-    fract_digits = vdb_copy_calc_fract_digits( iter );
-    count = 0;
-    rc = num_gen_iterator_next( iter, &row_id );
-    while ( rc == 0 )
-    {
-        rc = Quitting();    /* to be able to cancel the loop by signal */
-        if ( rc == 0 )
-        {
-            rc = VCursorSetRowId( src_cursor, row_id );
-            if ( rc != 0 )
-                PLOGERR( klogInt, (klogInt, rc,
-                         "VCursorSetRowId(src) row #$(row_nr) failed",
-                         "row_nr=%lu", row_id ));
-
-            if ( rc == 0 )
-            {
-                rc = VCursorOpenRow( src_cursor );
-                if ( rc != 0 )
-                    PLOGERR( klogInt, (klogInt, rc,
-                             "VCursorOpenRow(src) row #$(row_nr) failed",
-                             "row_nr=%lu", row_id ));
-                else
-                {
-                    bool pass_flag = true;
-                    bool redact_flag = false;
-
-                    if ( filter_col_def != NULL )
-                        vdb_copy_read_row_flags( ctx, src_cursor,
-                                    filter_col_def->src_idx, &pass_flag, &redact_flag );
-                    if ( pass_flag )
-                        rc = vdb_copy_row( src_cursor, dst_cursor,
-                                           columns, row_id,
-                                           &rbuf, redact_flag, ctx->show_redact );
-
-                    if ( rc == 0 )
-                    {
-                        count++;
-                        rc = VCursorCloseRow( src_cursor );
-                        if ( rc != 0 )
-                            PLOGERR( klogInt, ( klogInt, rc,
-                                     "VCursorCloseRow(src) row #$(row_nr) failed",
-                                     "row_nr=%lu", row_id ) );
-                    }
-                }
-                rc = num_gen_iterator_next( iter, &row_id );
-                if ( ctx->show_progress )
-                {
-                    if ( num_gen_iterator_percent( iter, fract_digits, &percent ) == 0 )
-                        update_progressbar( progress, fract_digits, percent );
-                }
-
-            }
-        }
-    }
-
-    /* set rc to zero for num_gen_iterator_next() reached last id */
-    if ( GetRCModule( rc ) == rcVDB && 
-         GetRCTarget( rc ) == rcNoTarg && 
-         GetRCContext( rc ) == rcReading &&
-         GetRCObject( rc ) == rcId &&
-         GetRCState( rc ) == rcInvalid )
-        rc = 0;
-
-    if ( ctx->show_progress )
-        KOutMsg( "\n" );
-    destroy_progressbar( progress );
-
-    PLOGMSG( klogInfo, ( klogInfo, "\n $(row_cnt) rows copied", "row_cnt=%lu", count ));
-
-    if ( rc == 0 )
-    {
-        rc = VCursorCommit( dst_cursor );
-        if ( rc != 0 )
-        {
-            LOGERR( klogInt, rc, "VCursorCommit( dst ) after processing all rows failed" );
-        }
-    }
-    num_gen_iterator_destroy( iter );
-    redact_buf_free( &rbuf );
-
-    return rc;
-}
-
-
-static rc_t vdb_copy_make_dst_table( const p_context ctx,
-                                     VDBManager * vdb_mgr, 
-                                     const VSchema * src_schema,
-                                     VSchema **dst_schema,
-                                     KCreateMode cmode,
-                                     VTable **dst_table,
-                                     bool is_legacy )
-{
-    rc_t rc = 0;
-
-    /* different ways to make the schema for the dest-table */
-    if ( is_legacy )
-    {
-        /* load it from a file */
-        /*
-        KOutMsg( "we are using '%s'\n", cctx->legacy_schema_file );
-        */
-        if ( *dst_schema == NULL )
-        {
-            rc = VDBManagerMakeSRASchema( vdb_mgr, dst_schema );
-            if ( rc != 0 )
-            {
-                PLOGERR( klogInt,
-                         (klogInt,
-                         rc, "VDBManagerMakeSRASchema(dst) failed", "" ));
-            }
-        }
-        rc = VSchemaParseFile ( *dst_schema, ctx->legacy_schema_file );
-        if ( rc != 0 )
-        {
-            PLOGERR( klogInt,
-                     (klogInt,
-                     rc, "VSchemaParseFile() failed", "" ));
-        }
-    }
-    else
-    {
-        /* in case of a non-legacy-table, do nothing,
-           keep using the src-schema-object */
-        *dst_schema = (VSchema *)src_schema;
-        VSchemaAddRef( src_schema );
-    }
-    if ( rc == 0 )
-    {
-        rc = VDBManagerCreateTable( vdb_mgr, dst_table,
-                             *dst_schema, ctx->dst_schema_tabname,
-                             cmode, ctx->dst_path );
-        DISP_RC( rc, "vdb_copy_make_dst_table:VDBManagerCreateTable() failed" );
-        if ( rc == 0 )
-        {
-            KChecksum cs_mode = helper_assemble_ChecksumMode( ctx->blob_checksum );
-            rc = VTableColumnCreateParams ( *dst_table, cmode, cs_mode, 0 );
-            DISP_RC( rc, "vdb_copy_make_dst_table:VTableColumnCreateParams() failed" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_open_dest_table( const p_context ctx,
-                                      const VTable * src_table,
-                                      VTable * dst_table,
-                                      VCursor ** dst_cursor,
-                                      col_defs * columns,
-                                      bool is_legacy )
-{
-    rc_t rc;
-
-    /* copy the metadata */
-    rc = copy_table_meta( src_table, dst_table, 
-                          ctx->config.meta_ignore_nodes, 
-                          ctx->show_meta, is_legacy );
-    if ( rc != 0 ) return rc;
-
-    /* mark all columns which are to be found writable as to_copy */
-    rc = col_defs_mark_writable_columns( columns, dst_table, false );
-    DISP_RC( rc, "vdb_copy_open_dest_table:col_defs_mark_writable_columns() failed" );
-    if ( rc != 0 ) return rc;
-
-    /* make a writable cursor */
-    rc = VTableCreateCursorWrite( dst_table, dst_cursor, kcmInsert );
-    DISP_RC( rc, "vdb_copy_open_dest_table:VTableCreateCursorWrite(dst) failed" );
-    if ( rc != 0 ) return rc;
-
-    /* add all marked ( as to copy ) columns to the writable cursor */
-    rc = col_defs_add_to_wr_cursor( columns, *dst_cursor, false );
-    DISP_RC( rc, "vdb_copy_open_dest_table:col_defs_add_to_wr_cursor(dst) failed" );
-    if ( rc != 0 ) return rc;
-
-    /* opens the dst cursor */
-    rc = VCursorOpen( *dst_cursor );
-    DISP_RC( rc, "vdb_copy_open_dest_table:VCursorOpen(dst) failed" );
-
-    return rc;
-}
-
-
-/* detect the row-range of the source-table
-   check if the requested row-range is within this range
-   otherwise correct the requested row-range
-*/
-static rc_t vdb_copy_check_range( const p_context ctx,
-                                  const VCursor * a_cursor )
-{
-    int64_t  first;
-    uint64_t count;
-    rc_t rc = VCursorIdRange( a_cursor, 0, &first, &count );
-    DISP_RC( rc, "vdb_copy_check_range:VCursorIdRange() failed" );
-    if ( rc == 0 )
-    {
-        rc = context_range_check( ctx, first, count );
-        DISP_RC( rc, "vdb_copy_check_range:context_range_check() failed" );
-    }
-    return rc;
-}
-
-
-/* detect the row-range of the source-table
-   set's the range of the number-generator to the discovered values
-*/
-static rc_t vdb_copy_set_range( const p_context ctx,
-                                const VCursor * a_cursor )
-{
-    int64_t  first;
-    uint64_t count;
-    rc_t rc = VCursorIdRange( a_cursor, 0, &first, &count );
-    DISP_RC( rc, "vdb_copy_set_range:VCursorIdRange() failed" );
-    if ( rc == 0 )
-    {
-        rc = context_set_range( ctx, first, count );
-        DISP_RC( rc, "vdb_copy_set_range:context_set_range() failed" );
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_prepare_legacy_tab( const p_context ctx,
-                                         const char * src_schema_tabname )
-{
-    KConfig * config_mgr;
-    char * src_platform;
-
-    rc_t rc = get_table_platform( ctx->src_path, &src_platform, '_' );
-    DISP_RC( rc, "vdb_copy_prepare_legacy_tab:get_table_platform() failed" );
-    if ( rc != 0 ) return rc;
-
-    rc = helper_make_config_mgr( &config_mgr, ctx->kfg_path );
-    DISP_RC( rc, "vdb_copy_prepare_legacy_tab:helper_make_config_mgr() failed" );
-    if ( rc != 0 ) return rc;
-
-    PLOGMSG( klogInfo, ( klogInfo, "legacy-platform: $(platform)", "platform=%s",
-                                   src_platform ));
-
-    rc = helper_get_legacy_write_schema_from_config( config_mgr,
-                src_platform,
-                src_schema_tabname,
-                &(ctx->legacy_schema_file),
-                &(ctx->dst_schema_tabname),
-                &(ctx->legacy_dont_copy) );
-    DISP_RC( rc, "vdb_copy_prepare_legacy_tab:helper_get_legacy_write_schema_from_config() failed" );
-    KConfigRelease( config_mgr );
-    if ( rc != 0 ) return rc;
-
-    if ( ctx->show_matching )
-    {
-        PLOGMSG( klogInfo, ( klogInfo, "-file: $(file)", "file=%s", ctx->legacy_schema_file ));
-        PLOGMSG( klogInfo, ( klogInfo, "-tab : $(tab)",  "tab=%s",  ctx->dst_schema_tabname ));
-        PLOGMSG( klogInfo, ( klogInfo, "-dont: $(dont)", "dont=%s", ctx->legacy_dont_copy ));
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_find_out_what_columns_to_use( const VTable * src_table,
-                                                   const char * tablename,
-                                                   col_defs * columns, 
-                                                   const char * requested,
-                                                   const char * excluded )
-{
-    bool cols_requested = ( ( requested != NULL ) &&
-                            ( nlt_strcmp( requested, "*" ) != 0 ) );
-    /* no matter if specific columns are requested, we first discover all of them
-       to later mark the columns which are requested */
-    rc_t rc = col_defs_extract_from_table( columns, src_table );
-    DISP_RC( rc, "vdb_copy_find_out_what_columns_to_use:col_defs_extract_from_table() failed" );
-    if ( rc == 0 )
-    {
-        if ( cols_requested )
-            /* the user requested a specific subset of columns... */
-            rc = col_defs_mark_requested_columns( columns, requested );
-        else
-            /* no specific subset of columns is requested --> copy what we can... */
-            rc = col_defs_mark_requested_columns( columns, NULL );
-        DISP_RC( rc, "vdb_copy_find_out_what_columns_to_use:col_defs_mark_requested_columns() failed" );
-        if ( rc == 0 && excluded != NULL )
-        {
-            rc = col_defs_exclude_these_columns( columns, tablename, excluded );
-            DISP_RC( rc, "vdb_copy_find_out_what_columns_to_use:col_defs_unmark_writable_columns() failed" );
-        }
-    }
-    return rc;
-}
-
-
-/* find the filter-column and redactable columns */
-static void vdb_copy_find_filter_and_redact_columns( const VSchema * src_schema,
-                                                     col_defs * columns,
-                                                     config_values * config,
-                                                     matcher * type_matcher )
-{
-    /* it is ok to not find a filter-column: no error in this case */
-    col_defs_detect_filter_col( columns, config->filter_col_name );
-
-    /* it is ok to not find redactable types: no error in this case */
-    col_defs_detect_redactable_cols_by_type( columns,
-             src_schema, type_matcher, config->redactable_types );
-
-    /* it is ok to not find columns excluded from redacting: no error in this case */
-    col_defs_unmark_do_not_redact_columns( columns,
-                    config->do_not_redact_columns );
-}
-
-
-static rc_t vdb_copy_detect_legacy( const p_context ctx,
-                                    VDBManager * vdb_mgr,
-                                    const VTable * src_table,
-                                    bool * is_legacy )
-{
-    char * src_schema_tabname;
-    /* detects the name of the schema-table used by the source-table */
-    rc_t rc = helper_get_schema_tab_name( src_table, &src_schema_tabname );
-    DISP_RC( rc, "vdb_copy_prepare_columns:helper_get_schema_tab_name() failed" );
-    if ( rc == 0 )
-    {
-        rc = helper_is_tablename_legacy( vdb_mgr, src_schema_tabname, is_legacy );
-        if ( rc == 0 )
-        {
-            if ( *is_legacy )
-            {
-                PLOGMSG( klogInfo, ( klogInfo, "used legacy schema: $(schema)", "schema=%s", 
-                                     src_schema_tabname ));
-                rc = vdb_copy_prepare_legacy_tab( ctx, src_schema_tabname );
-            }
-            else
-            {
-                PLOGMSG( klogInfo, ( klogInfo, "used schema: $(schema)", "schema=%s", 
-                                     src_schema_tabname ));
-                ctx->dst_schema_tabname = string_dup_measure ( src_schema_tabname, NULL );
-            }
-        }
-        free( src_schema_tabname );
-    }
-    return rc;
-}
-
-
-/* we have the src-columns collected (incl. there types):
-   no columns have been added to a cursor (rd and wr),
-   now we can find the columns which have to be copied
-   including the right type-casts for every one of these columns */
-static rc_t vdb_copy_match_columns( const p_context ctx,
-                                    VDBManager * vdb_mgr, 
-                                    col_defs * columns,
-                                    matcher * type_matcher )
-{
-    rc_t rc;
-    matcher_input mi;
-
-    rc = KDirectoryNativeDir( &( mi.dir ) );
-    DISP_RC( rc, "vdb_copy_match_columns:KDirectoryNativeDir() failed" );
-    if ( rc == 0 )
-    {
-        rc = helper_make_config_mgr( &(mi.cfg), ctx->kfg_path );
-        DISP_RC( rc, "vdb_copy_match_columns:helper_make_config_mgr() failed" );
-        if ( rc == 0 )
-        {
-            mi.manager = vdb_mgr;
-            mi.add_schemas = ctx->src_schema_list;
-
-            rc = col_defs_as_string( columns, (char**)&mi.columns, true );
-            if ( rc == 0 )
-            {
-                mi.src_path         = ctx->src_path;
-                mi.dst_path         = ctx->dst_path;
-                mi.legacy_schema    = ctx->legacy_schema_file;
-                mi.dst_tabname      = ctx->dst_schema_tabname;
-                mi.excluded_columns = ctx->legacy_dont_copy;
-                mi.force_kcmInit    = ctx->force_kcmInit;
-                mi.force_unlock     = ctx->force_unlock;
-
-                rc = matcher_execute( type_matcher, &mi );
-                if ( rc != 0 )
-                {
-                    if ( GetRCState( rc ) == rcExists )
-                    {
-                        LOGMSG( klogInfo, "vdb-copy cannot create the target-table, because it already exists!" );
-                        LOGMSG( klogInfo, "try to use the force-option (-f)" );
-                        ctx->dont_remove_target = true;
-                    }
-                    else
-                        DISP_RC( rc, "vdb_copy_match_columns:matcher_execute() failed" );
-                }
-                if ( rc == 0 )
-                {
-                    if ( ctx->show_matching )
-                        matcher_report( type_matcher, true );
-                    rc = col_defs_apply_casts( columns, type_matcher );
-                    DISP_RC( rc, "vdb_copy_match_columns:col_defs_apply_casts() failed" );
-                }
-
-                free( ( void * )mi.columns );
-            }
-            KConfigRelease( mi.cfg );
-        }
-        KDirectoryRelease( mi.dir );
-    }
-    return rc;
-}
-
-
-/* this is the common entry-point for the copy-operation in both cases
-   "given path is database" OR "given path is table" */
-static rc_t vdb_copy_open_source_table( const p_context ctx,
-                                        VDBManager * vdb_mgr,
-                                        const VSchema * src_schema,
-                                        VSchema **dst_schema,
-                                        const VTable * src_table,
-                                        const VCursor * src_cursor,
-                                        KCreateMode cmode,
-                                        VTable **dst_table,
-                                        col_defs * columns,
-                                        bool * is_legacy,
-                                        matcher * type_matcher ) 
-{
-    /* everything what has to be done before adding the columns
-       to the source-cursor and opening the source-cursor */
-    rc_t rc = vdb_copy_detect_legacy( ctx, vdb_mgr, src_table, is_legacy );
-    if ( rc != 0 ) return rc;
-
-    /* type-match between src <---> dst columns, find best typecast */
-    rc = vdb_copy_match_columns( ctx, vdb_mgr, columns, type_matcher );
-    if ( rc != 0 ) return rc;
-
-    /* in case of legacy table make new schema - parse matched schema
-       in case on non-legacy use the src-schema as dst-schema */
-    rc = vdb_copy_make_dst_table( ctx, vdb_mgr, src_schema, dst_schema, cmode, 
-                                  dst_table, *is_legacy );
-    if ( rc != 0 ) return rc;
-
-    /* the prepared and eventually shortened src-column-list is used */
-    rc = col_defs_add_to_rd_cursor( columns, src_cursor, false );
-    if ( rc != 0 ) return rc;
-
-    rc = VCursorOpen( src_cursor );
-    DISP_RC( rc, "vdb_copy_open_source_table:VCursorOpen() failed" );
-    if ( rc != 0 ) return rc;
-
-    /* range check requires an open cursor */
-    rc = vdb_copy_check_range( ctx, src_cursor );
-    return rc;
-}
-
-
-static rc_t vdb_copy_table2( const p_context ctx,
-                             VDBManager * vdb_mgr,
-                             const VTable * src_table,
-                             const VCursor * src_cursor,
-                             const VSchema * src_schema,
-                             col_defs * columns,
-                             matcher * type_matcher )
-{
-    VSchema * dst_schema = NULL;
-    VTable * dst_table;
-    bool is_legacy;
-
-    KCreateMode cmode = helper_assemble_CreateMode( src_table, 
-                              ctx->force_kcmInit, ctx->md5_mode );
-    rc_t rc = vdb_copy_open_source_table( ctx, vdb_mgr, src_schema, &dst_schema,
-                                     src_table, src_cursor, cmode, &dst_table, columns,
-                                     &is_legacy, type_matcher );
-    if ( rc == 0 )
-    {
-        VCursor * dst_cursor;
-        rc = vdb_copy_open_dest_table( ctx, src_table, dst_table, &dst_cursor, columns, 
-                                       is_legacy );
-        if ( rc == 0 )
-        {
-            /* this function does not fail, because it is ok to not find
-               filter-column, redactable types and excluded columns */
-            vdb_copy_find_filter_and_redact_columns( src_schema,
-                                   columns, &(ctx->config), type_matcher );
-
-            rc = vdb_copy_row_loop( ctx, src_cursor, dst_cursor,
-                                    columns, ctx->rvals );
-
-            VCursorRelease( dst_cursor );
-            if ( rc == 0 )
-            {
-                if ( ctx->reindex )
-                {
-                    /* releasing the cursor is necessary for reindex */
-                    rc = VTableReindex( dst_table );
-                    DISP_RC( rc, "vdb_copy_table2:VTableReindex() failed" );
-                }
-            }
-        }
-        VSchemaRelease( dst_schema );
-        VTableRelease( dst_table );
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_table( const p_context ctx,
-                            VDBManager * vdb_mgr,
-                            const VTable * src_table,
-                            const char * tablename )
-{
-    const VSchema * src_schema;
-    rc_t rc = VTableOpenSchema ( src_table, &src_schema );
-    DISP_RC( rc, "vdb_copy_main:VTableOpenSchema( src_schema ) failed" );
-    if ( rc == 0 )
-    {
-        col_defs * columns;
-        rc = col_defs_init( &columns );
-        DISP_RC( rc, "vdb_copy_table:col_defs_init() failed" );
-        if ( rc == 0 )
-        {
-            rc = vdb_copy_find_out_what_columns_to_use( src_table, tablename, columns,
-                                                        ctx->columns, ctx->excluded_columns );
-            if ( rc == 0 )
-            {
-                const VCursor * src_cursor;
-                rc = VTableCreateCursorRead( src_table, &src_cursor );
-                DISP_RC( rc, "vdb_copy_table:VTableCreateCursorRead() failed" );
-                if ( rc == 0 )
-                {
-                    matcher * type_matcher;
-
-                    rc = matcher_init( &type_matcher );
-                    DISP_RC( rc, "vdb_copy_table:matcher_init() failed" );
-                    if ( rc == 0 )
-                    {
-                        /*****************************************************/
-                        rc = vdb_copy_table2( ctx, vdb_mgr, src_table, src_cursor,
-                                              src_schema, columns, type_matcher );
-                        /*****************************************************/
-                        matcher_destroy( type_matcher );
-                    }
-                }
-                VCursorRelease( src_cursor );
-            }
-            col_defs_destroy( columns );
-        }
-        VSchemaRelease( src_schema );
-    }
-    return rc;
-}
-
-
-/*-----------------------------------------------------------------------------*/
-static rc_t vdb_copy_cur_2_cur( const p_context ctx,
-                                const VCursor * src_cursor,
-                                VCursor * dst_cursor,
-                                const VSchema * schema,
-                                col_defs * columns,
-                                matcher * type_matcher,
-                                const char * tab_name )
-{
-    rc_t rc = col_defs_apply_casts( columns, type_matcher );
-    DISP_RC( rc, "vdb_copy_cur_2_cur:col_defs_apply_casts() failed" );
-    if ( rc == 0 )
-    {
-        rc = col_defs_add_to_wr_cursor( columns, dst_cursor, false );
-        DISP_RC( rc, "vdb_copy_cur_2_cur:col_defs_add_to_wr_cursor(dst) failed" );
-        if ( rc == 0 )
-        {
-            rc = VCursorOpen( dst_cursor );
-            DISP_RC( rc, "vdb_copy_cur_2_cur:VCursorOpen(dst) failed" );
-            if ( rc == 0 )
-            {
-                rc = col_defs_add_to_rd_cursor( columns, src_cursor, false );
-                DISP_RC( rc, "vdb_copy_cur_2_cur:col_defs_add_to_rd_cursor() failed" );
-                if ( rc == 0 )
-                {
-                    rc = VCursorOpen( src_cursor );
-                    DISP_RC( rc, "vdb_copy_cur_2_cur:VCursorOpen(src) failed" );
-                    if ( rc == 0 )
-                    {
-                        /* set the row-range in ctx to cover the whole table */
-                        rc = vdb_copy_set_range( ctx, src_cursor );
-                        DISP_RC( rc, "vdb_copy_cur_2_cur:vdb_copy_check_range(src) failed" );
-                        if ( rc == 0 )
-                        {
-                            /* it is ok to not find a filter-column: no error in this case */
-                            col_defs_detect_filter_col( columns,
-                                                        ctx->config.filter_col_name );
-
-                            /* it is ok to not find columns excluded from redacting: no error in this case */
-                            col_defs_unmark_do_not_redact_columns( columns,
-                                            ctx->config.do_not_redact_columns );
-
-                            if ( ctx->show_progress )
-                                KOutMsg( "copy of >%s<\n", tab_name );
-
-                            vdb_copy_find_filter_and_redact_columns( schema,
-                                                   columns, &(ctx->config), type_matcher );
-
-                            /**************************************************/
-                            rc = vdb_copy_row_loop( ctx, src_cursor, dst_cursor,
-                                                    columns, ctx->rvals );
-                            /**************************************************/
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t vdb_copy_tab_2_tab( const p_context ctx,
-                                const VTable * src_tab,
-                                VTable * dst_tab,
-                                const char * tab_name )
-{
-    const VSchema * schema;
-    rc_t rc = VTableOpenSchema ( src_tab, &schema );
-    DISP_RC( rc, "vdb_copy_tab_2_tab:VTableOpenSchema( src_schema ) failed" );
-    if ( rc == 0 )
-    {
-        col_defs * columns;
-        rc = col_defs_init( &columns );
-        DISP_RC( rc, "vdb_copy_tab_2_tab:col_defs_init() failed" );
-        if ( rc == 0 )
-        {
-            rc = vdb_copy_find_out_what_columns_to_use( src_tab, tab_name, columns, 
-                                                        NULL, ctx->excluded_columns );
-            if ( rc == 0 )
-            {
-                matcher * type_matcher;
-                rc = matcher_init( &type_matcher );
-                if ( rc == 0 )
-                {
-                    char * column_names;
-                    rc = col_defs_as_string( columns, (char**)&column_names, true );
-                    if ( rc == 0 )
-                    {
-                        rc = matcher_db_execute( type_matcher, src_tab, dst_tab, schema,
-                                                 column_names, ctx->kfg_path );
-                        if ( rc == 0 )
-                        {
-                            const VCursor * src_cursor;
-                            if ( ctx->show_matching )
-                                matcher_report( type_matcher, false );
-                            rc = VTableCreateCursorRead( src_tab, &src_cursor );
-                            DISP_RC( rc, "vdb_copy_tab_2_tab:VTableCreateCursorRead(src) failed" );
-                            if ( rc == 0 )
-                            {
-                                rc = col_defs_mark_writable_columns( columns, dst_tab, false );
-                                DISP_RC( rc, "vdb_copy_tab_2_tab:col_defs_mark_writable_columns() failed" );
-                                if ( rc == 0 )
-                                {
-                                    VCursor * dst_cursor;
-                                    rc = VTableCreateCursorWrite( dst_tab, &dst_cursor, kcmInsert );
-                                    DISP_RC( rc, "vdb_copy_tab_2_tab:VTableCreateCursorWrite(dst) failed" );
-                                    if ( rc == 0 )
-                                    {
-                                        /*****************************************************/
-                                        rc = vdb_copy_cur_2_cur( ctx, src_cursor, dst_cursor,
-                                                                 schema, columns, type_matcher,
-                                                                 tab_name );
-                                        /*****************************************************/
-                                    }
-                                    VCursorRelease( dst_cursor );
-                                }
-                                VCursorRelease( src_cursor );
-                            }
-                        }
-                        free( column_names );
-                    }
-                    matcher_destroy( type_matcher );
-                }
-            }
-            col_defs_destroy( columns );
-        }
-        VSchemaRelease( schema );
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_db_tab( const p_context ctx,
-                             const VDatabase * src_db,
-                             VDatabase * dst_db,
-                             const char *tab_name )
-{
-    const VTable * src_tab;
-    rc_t rc = VDatabaseOpenTableRead( src_db, &src_tab, tab_name );
-    DISP_RC( rc, "vdb_copy_db_tab:VDatabaseOpenTableRead(src) failed" );
-    if ( rc == 0 )
-    {
-        VTable * dst_tab;
-        KCreateMode cmode = helper_assemble_CreateMode( src_tab, 
-                            ctx->force_kcmInit, ctx->md5_mode );
-
-        rc = VDatabaseCreateTable ( dst_db, &dst_tab, tab_name, 
-                                    cmode, tab_name );
-        DISP_RC( rc, "vdb_copy_db_tab:VDatabaseCreateTable(dst) failed" );
-        if ( rc == 0 )
-        {
-            KChecksum cs_mode = helper_assemble_ChecksumMode( ctx->blob_checksum );
-            rc = VTableColumnCreateParams ( dst_tab, cmode, cs_mode, 0 );
-            DISP_RC( rc, "vdb_copy_db_tab:VTableColumnCreateParams failed" );
-            if ( rc == 0 )
-            {
-                rc = copy_table_meta( src_tab, dst_tab, 
-                                      ctx->config.meta_ignore_nodes, 
-                                      ctx->show_meta, false );
-                DISP_RC( rc, "vdb_copy_db_tab:copy_table_meta failed" );
-                if ( rc == 0 )
-                {
-                    /********************************************************/
-                    rc = vdb_copy_tab_2_tab( ctx, src_tab, dst_tab, tab_name );
-                    /********************************************************/
-                }
-            }
-            VTableRelease( dst_tab );
-        }
-        VTableRelease( src_tab );
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_db_sub_tables( const p_context ctx,
-                                    const VDatabase * src_db,
-                                    VDatabase * dst_db )
-{
-    KNamelist *names;
-
-    rc_t rc = VDatabaseListTbl( src_db, &names );
-    if ( rc == 0 )
-    {
-        uint32_t idx, count;
-        rc = KNamelistCount( names, &count );
-        DISP_RC( rc, "vdb_copy_db_sub_tables:KNamelistCount failed" );
-        if ( rc == 0 )
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *a_name;
-                rc = KNamelistGet( names, idx, &a_name );
-                DISP_RC( rc, "vdb_copy_db_sub_tables:KNamelistGet() failed" );
-                if ( rc == 0 )
-                {
-                    /**************************************************/
-                    rc = vdb_copy_db_tab( ctx, src_db, dst_db, a_name );
-                    /**************************************************/
-                }
-            }
-        KNamelistRelease( names );
-    }
-    else
-        rc = 0;
-    return rc;
-}
-
-
-/* forward decl. to make recursive copy of sub-databases possible */
-static rc_t vdb_copy_db_2_db( const p_context ctx,
-                              const VDatabase * src_db,
-                              VDatabase * dst_db );
-
-static rc_t vdb_copy_sub_dbs( const p_context ctx,
-                              const VDatabase * src_db,
-                              VDatabase * dst_db )
-{
-    KNamelist *names;
-
-    rc_t rc = VDatabaseListDB( src_db, &names );
-    if ( rc == 0 )
-    {
-        uint32_t idx, count;
-        rc = KNamelistCount( names, &count );
-        DISP_RC( rc, "vdb_copy_sub_dbs:KNamelistCount failed" );
-        if ( rc == 0 )
-        {
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                const char *a_name;
-                rc = KNamelistGet( names, idx, &a_name );
-                DISP_RC( rc, "vdb_copy_sub_dbs:KNamelistGet() failed" );
-                if ( rc == 0 )
-                {
-                    const VDatabase * src_sub_db;
-                    /* try to open the sub-database */
-                    rc = VDatabaseOpenDBRead ( src_db, &src_sub_db, a_name );
-                    DISP_RC( rc, "vdb_copy_sub_dbs:VDatabaseOpenDBRead() failed" );
-                    if ( rc == 0 )
-                    {
-                        char typespec[ TYPESPEC_BUF_LEN ];
-                        rc = VDatabaseTypespec ( src_sub_db, typespec, sizeof typespec );
-                        DISP_RC( rc, "vdb_copy_sub_dbs:VDatabaseTypespec( src ) failed" );
-                        if ( rc == 0 )
-                        {
-                            VDatabase * dst_sub_db;
-                            KCreateMode cmode = kcmInit | kcmParents;
-                            if ( ctx->md5_mode == MD5_MODE_ON )
-                                cmode |= kcmMD5;
-                            rc = VDatabaseCreateDB ( dst_db, &dst_sub_db,
-                                                     typespec, cmode, a_name );
-                            DISP_RC( rc, "vdb_copy_sub_dbs:VDBManagerCreateDB( dst ) failed" );
-                            if ( rc == 0 )
-                            {
-                                KChecksum cs_mode = helper_assemble_ChecksumMode( ctx->blob_checksum );
-                                rc = VDatabaseColumnCreateParams ( dst_db, cmode, cs_mode, 0 );
-                                DISP_RC( rc, "vdb_copy_sub_dbs:VDatabaseColumnCreateParams failed" );
-                                if ( rc == 0 )
-                                {
-                                    /**************************************************/
-                                    rc = vdb_copy_db_2_db( ctx, src_sub_db, dst_sub_db );
-                                    /**************************************************/
-                                }
-                                VDatabaseRelease( dst_sub_db );
-                            }
-                        }
-                        VDatabaseRelease( src_sub_db );
-                    }
-                }
-            }
-        }
-        KNamelistRelease( names );
-    }
-    else
-        rc = 0;
-
-    return rc;
-}
-
-
-static rc_t vdb_copy_db_2_db( const p_context ctx,
-                              const VDatabase * src_db,
-                              VDatabase * dst_db )
-{
-    rc_t rc = copy_database_meta ( src_db, dst_db, NULL, ctx->show_meta );
-    if ( rc == 0 )
-    {
-        if ( ctx->table == NULL )
-        {
-            /* the user did not specify a particular table: copy all of them */
-            /*************************************************/
-            rc = vdb_copy_db_sub_tables( ctx, src_db, dst_db );
-            /*************************************************/
-            if ( rc == 0 )
-            {
-                /* if the database has sub-databases: copy them too */
-                rc = vdb_copy_sub_dbs( ctx, src_db, dst_db );
-            }
-        }
-        else
-        {
-            /* copy only this table... */
-            rc = vdb_copy_db_tab( ctx, src_db, dst_db, ctx->table );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t vdb_copy_database( const p_context ctx,
-                               VDBManager * vdb_mgr,
-                               const VDatabase * src_db )
-{
-    char typespec[ TYPESPEC_BUF_LEN ];
-    rc_t rc = VDatabaseTypespec ( src_db, typespec, sizeof typespec );
-    DISP_RC( rc, "vdb_copy_database:VDatabaseTypespec( src ) failed" );
-    if ( rc == 0 )
-    {
-        const VSchema * schema;
-        rc = VDatabaseOpenSchema ( src_db, &schema );
-        DISP_RC( rc, "vdb_copy_database:VDatabaseOpenSchema( src ) failed" );
-        if ( rc == 0 )
-        {
-            VDatabase * dst_db;
-            KCreateMode cmode = kcmInit | kcmParents;
-            if ( ctx->md5_mode == MD5_MODE_ON )
-                cmode |= kcmMD5;
-            rc = VDBManagerCreateDB ( vdb_mgr, &dst_db, schema,
-                                      typespec, cmode, ctx->dst_path );
-            DISP_RC( rc, "vdb_copy_database:VDBManagerCreateDB( dst ) failed" );
-            if ( rc == 0 )
-            {
-                KChecksum cs_mode = helper_assemble_ChecksumMode( ctx->blob_checksum );
-                rc = VDatabaseColumnCreateParams ( dst_db, cmode, cs_mode, 0 );
-                DISP_RC( rc, "vdb_copy_sub_dbs:VDatabaseColumnCreateParams failed" );
-                if ( rc == 0 )
-                {
-                    /*******************************************/
-                    rc = vdb_copy_db_2_db( ctx, src_db, dst_db );
-                    /*******************************************/
-                }
-                VDatabaseRelease( dst_db );
-            }
-            VSchemaRelease( schema );
-        }
-    }
-    return rc;
-}
-
-
-/***************************************************************************
-    vdb_copy_perform:
-    * called by "vdb_copy_main()"
-    * makes the "default-schema"
-    * tests if the given source path is a database/table/none-of-that
-
-ctx        [IN] ... contains path, tablename, columns, row-range etc.
-vdb_mgr    [IN] ... contains the vdb-manger to create src/dst-objects
-***************************************************************************/
-static rc_t vdb_copy_perform( const p_context ctx,
-                              VDBManager * vdb_mgr )
-{
-    VSchema * dflt_schema;
-    rc_t rc = helper_parse_schema( vdb_mgr, &dflt_schema, ctx->src_schema_list );
-    DISP_RC( rc, "vdb_copy_main:helper_parse_schema(dflt) failed" );
-    if ( rc == 0 )
-    {
-        const VDatabase * src_db;
-        /* try to open it as a database */
-        rc = VDBManagerOpenDBRead ( vdb_mgr, &src_db, dflt_schema, ctx->src_path );
-        if ( rc == 0 )
-        {
-            /* if it succeeds it is a database, continue to copy it */
-            if ( DB_COPY_ENABLED == 1 )
-            {
-                /*********************************************/
-                rc = vdb_copy_database( ctx, vdb_mgr, src_db );
-                /*********************************************/
-                DISP_RC( rc, "vdb_copy_perform:vdb_copy_database() failed" );
-            }
-            else
-                LOGMSG( klogInfo, "a copy of a database is not implemented yet..." );
-            VDatabaseRelease( src_db );
-        }
-        else
-        {
-            const VTable * src_table;
-            /* try to open it as a table */
-            rc = VDBManagerOpenTableRead( vdb_mgr, &src_table,
-                                          dflt_schema, ctx->src_path );
-            /* if it succeeds it is a table, continue to copy it */
-            if ( rc == 0 )
-            {
-                /*********************************************/
-                rc = vdb_copy_table( ctx, vdb_mgr, src_table, NULL );
-                /*********************************************/
-                DISP_RC( rc, "vdb_copy_perform:vdb_copy_table() failed" );
-                VTableRelease( src_table );
-            }
-            else
-            {
-                rc = RC( rcVDB, rcNoTarg, rcCopying, rcItem, rcNotFound );
-                PLOGERR( klogInt, ( klogInt, rc,
-                         "\nthe path '$(path)' cannot be opened as vdb-database or vdb-table",
-                         "path=%s", ctx->src_path ));
-            }
-        }
-        VSchemaRelease( dflt_schema );
-    }
-    return rc;
-}
-
-
-/***************************************************************************
-    vdb_copy_main:
-    * called by "KMain()"
-    * make the "native directory"
-    * make a vdb-manager for write
-      all subsequent copy-functions will use this manager...
-    * check if the given path is database-path ( by trying to open it )
-      if it is one: continue wit copy_database()
-    * check if the given path is table-path ( by trying to open it )
-      if it is one: continue wit copy_table()
-    * release manager and directory
-
-ctx        [IN] ... contains path, tablename, columns, row-range etc.
-***************************************************************************/
-static rc_t vdb_copy_main( const p_context ctx )
-{
-    KDirectory * directory;
-    rc_t rc = KDirectoryNativeDir( &directory );
-    DISP_RC( rc, "vdb_copy_main:KDirectoryNativeDir() failed" );
-    if ( rc == 0 )
-    {
-        KConfig * config_mgr;
-
-#if TOOLS_USE_SRAPATH != 0
-        if ( !ctx->dont_check_accession )
-            ctx->dont_check_accession = helper_is_this_a_filesystem_path( ctx->src_path );
-        if ( !ctx->dont_check_accession )
-        {
-            rc_t rc1 = helper_resolve_accession( directory, (char**)&( ctx->src_path ) );
-            DISP_RC( rc1, "vdb_copy_main:helper_check_accession() failed" );
-        }
-#endif
-
-        rc = helper_make_config_mgr( &config_mgr, ctx->kfg_path );
-        DISP_RC( rc, "vdb_copy_main:helper_make_config_mgr() failed" );
-        if ( rc == 0 )
-        {
-            VDBManager * vdb_mgr;
-
-            helper_read_config_values( config_mgr, &(ctx->config) );
-            helper_read_redact_values( config_mgr, ctx->rvals );
-            KConfigRelease( config_mgr );
-
-            rc = VDBManagerMakeUpdate ( &vdb_mgr, directory );
-            DISP_RC( rc, "vdb_copy_main:VDBManagerMakeRead() failed" );
-            if ( rc == 0 )
-            {
-                /************************************/
-                rc = vdb_copy_perform( ctx, vdb_mgr );
-                /************************************/
-                VDBManagerRelease( vdb_mgr );
-            }
-        }
-        /* after that we can remove the output-path if necessary */
-        if ( rc != 0 && !ctx->dont_remove_target )
-            rc = helper_remove_path( directory, ctx->dst_path );
-
-        /* now we can release the directory */
-        KDirectoryRelease( directory );
-    }
-    return rc;
-}
-
-
-/***************************************************************************
-    Main:
-    * create the copy-context
-    * parse the commandline for arguments and options
-    * react to help/usage - requests ( no dump in this case )
-      these functions are in vdb-copy-context.c
-    * call copy_main() to execute the copy-operation
-    * destroy the copy-context
-***************************************************************************/
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc = ArgsMakeAndHandle ( &args, argc, argv, 1,
-                             MyOptions, sizeof MyOptions / sizeof ( OptDef ) );
-    DISP_RC( rc, "KMain:ArgsMakeAndHandle() failed" );
-    if ( rc == 0 )
-    {
-        context *ctx;
-        KLogHandlerSetStdErr();
-        rc = context_init( &ctx );
-        DISP_RC( rc, "KMain:copy_context_init() failed" );
-        if ( rc == 0 )
-        {
-            rc = context_capture_arguments_and_options( args, ctx );
-            DISP_RC( rc, "KMain:context_capture_arguments_and_options() failed" );
-            if ( rc == 0 )
-            {
-                if ( ctx->usage_requested )
-                    MiniUsage( args );
-                else
-                    /************************/
-                    rc = vdb_copy_main( ctx );
-                    /************************/
-            }
-            context_destroy ( ctx );
-        }
-        ArgsWhack ( args );
-    }
-    return rc;
-}
diff --git a/tools/vdb-copy/vdb-copy.kfg b/tools/vdb-copy/vdb-copy.kfg
deleted file mode 100644
index f941d90..0000000
--- a/tools/vdb-copy/vdb-copy.kfg
+++ /dev/null
@@ -1,92 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-# matching legacy-tables with schema's to write to for vdb-copy
-
-# ILLUMINA
-/VDBCOPY/NCBI_SRA_Illumina_tbl_v0a_1/schema = "sra/illumina.vschema"
-/VDBCOPY/NCBI_SRA_Illumina_tbl_v0a_1/tab = "NCBI:SRA:Illumina:tbl:v2"
-/VDBCOPY/_ILLUMINA_/schema = "sra/illumina.vschema"
-/VDBCOPY/_ILLUMINA_/tab = "NCBI:SRA:Illumina:tbl:v2"
-
-
-# _454_
-/VDBCOPY/NCBI_SRA__454__tbl_v0_1/schema = "sra/454.vschema"
-/VDBCOPY/NCBI_SRA__454__tbl_v0_1/tab = "NCBI:SRA:_454_:tbl:v2"
-/VDBCOPY/_454_/schema = "sra/454.vschema"
-/VDBCOPY/_454_/tab = "NCBI:SRA:_454_:tbl:v2"
-
-
-# ABSOLID
-/VDBCOPY/NCBI_SRA_ABI_tbl_v1_1/schema = "sra/abi.vschema"
-/VDBCOPY/NCBI_SRA_ABI_tbl_v1_1/tab = "NCBI:SRA:ABI:tbl:v2"
-/VDBCOPY/_ABSOLID_/schema = "sra/abi.vschema"
-/VDBCOPY/_ABSOLID_/tab = "NCBI:SRA:ABI:tbl:v2"
-
-
-# scoring of different schema-types for lossy-ness
-/VDBCOPY/SCORE/INSDC_2na_bin = "2"
-/VDBCOPY/SCORE/INSDC_x2na_bin = "1"
-/VDBCOPY/SCORE/INSDC_2na_packed = "2"
-/VDBCOPY/SCORE/INSDC_2cs_bin = "2"
-/VDBCOPY/SCORE/INSDC_x2cs_bin = "1"
-/VDBCOPY/SCORE/INSDC_2cs_packed = "2"
-/VDBCOPY/SCORE/INSDC_quality_phred = "1"
-/VDBCOPY/SCORE/INSDC_quality_log_odds = "1"
-/VDBCOPY/SCORE/INSDC_SRA_read_type = "1"
-
-# global vdb-copy-settings for filtering and redacting
-
-/VDBCOPY/READ_FILTER_COL_NAME = "READ_FILTER"
-
-# first redactable columns are detected by their type
-/VDBCOPY/REDACTABLE_TYPES = "INSDC:color:text,INSDC:x2cs:bin,INSDC:2cs:bin,INSDC:2cs:packed,INSDC:dna:text,INSDC:4na:bin,INSDC:4na:packed,INSDC:x2na:bin,INSDC:2na:bin,INSDC:2na:packed,NCBI:SRA:pos16,INSDC:quality:phred,INSDC:quality:log_odds,NCBI:qual4,INSDC:position:one,INSDC:position:zero,NCBI:fsamp4,NCBI:isamp1"
-
-# (1) specify a list of all types with redact-values other than zero
-#     key = "/VDBCOPY/REDACTVALUE/TYPES" ( ":" replaced by "_" )
-#
-# (2) specify for each type from (1) a redact-value
-#     key = /VDBCOPY/REDACTVALUE/xxxxxx/VALUE
-#     ( replace xxxxxx with one of the types from (1) )
-#     per default the value is one byte ( len = 1 )
-#     the format can be  - "'N'" for the ASCII-value of 'N'
-#                        OR
-#                        - "1" for the binary value of 1
-#                        OR
-#                        - "0x3A" for the binary value of 0x3A (58d)
-#
-# (2) specify for each type from (1) a redact-len (if it differs from 1 byte)
-#     key = /VDBCOPY/REDACTVALUE/xxxxxx/LEN
-#     ( replace xxxxxx with one of the types from (1) )
-#
-
-/VDBCOPY/REDACTVALUE/TYPES = "INSDC_color_text,INSDC_dna_text,NCBI_qual4"
-/VDBCOPY/REDACTVALUE/INSDC_color_text/VALUE = "'.'"
-/VDBCOPY/REDACTVALUE/INSDC_dna_text/VALUE = "'N'"
-/VDBCOPY/REDACTVALUE/NCBI_qual4/VALUE = "-6"
-
-/VDBCOPY/DO_NOT_REDACT = "CS_KEY,FLOW_CHARS,KEY_SEQUENCE,LINKER_SEQUENCE"
-
-# what root-nodes not to copy while copying metadata
-/VDBCOPY/META/IGNORE = "col,.seq,STATS"
diff --git a/tools/vdb-copy/vdb-copy.vers b/tools/vdb-copy/vdb-copy.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-copy/vdb-copy.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/vdb-decrypt/Makefile b/tools/vdb-decrypt/Makefile
deleted file mode 100644
index cd0e1da..0000000
--- a/tools/vdb-decrypt/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# ==============================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-USE_GCC_IF_ICC = 1
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/vdb-decrypt
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS =
-
-EXT_TOOLS = \
-	vdb-decrypt \
-	vdb-encrypt
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-
-
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/std
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vdb-decrypt
-#  Copy files from one directory to another while cataloging the contents.
-#  XML files can be redirected as well.
-#
-VDB_DECRYPT_SRC = \
-	vdb-decrypt \
-	shared
-
-VDB_DECRYPT_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_DECRYPT_SRC))
-
-VDB_DECRYPT_LIB = \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/vdb-decrypt: $(VDB_DECRYPT_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_DECRYPT_LIB)
-
-#-------------------------------------------------------------------------------
-# vdb-encrypt
-#  Copy files from one directory to another while cataloging the contents.
-#  XML files can be redirected as well.
-#
-VDB_ENCRYPT_SRC = \
-	vdb-encrypt \
-	shared
-
-VDB_ENCRYPT_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_ENCRYPT_SRC))
-
-VDB_ENCRYPT_LIB = \
-	-lkapp \
-	-lvfs \
-	-lkurl \
-	-lkrypto \
-	-lkfg \
-	-lkfs \
-	-lkproc \
-	-lklib
-
-$(BINDIR)/vdb-encrypt: $(VDB_ENCRYPT_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_ENCRYPT_LIB)
-
diff --git a/tools/vdb-decrypt/shared.c b/tools/vdb-decrypt/shared.c
deleted file mode 100644
index de41eaf..0000000
--- a/tools/vdb-decrypt/shared.c
+++ /dev/null
@@ -1,1270 +0,0 @@
-/*==============================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include "shared.h"
-
-#include <klib/defs.h>
-#include <klib/callconv.h>
-
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <klib/status.h>
-#include <klib/log.h>
-#include <klib/debug.h> /* DBGMSG */
-#include <klib/status.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/namelist.h>
-
-#include <kfs/defs.h>
-#include <kfs/file.h>
-#include <kfs/directory.h>
-#include <kfs/sra.h>
-#include <kfs/lockfile.h>
-#include <kfs/cacheteefile.h>
-#include <kfs/buffile.h>
-#include <vfs/manager.h>
-
-#include <krypto/key.h>
-#include <krypto/encfile.h>
-#include <krypto/wgaencrypt.h>
-
-#include <kapp/args.h>
-#include <kapp/main.h>
-
-#include <assert.h>
-#include <string.h>
-#include <stdint.h>
-
-#ifndef RIGOROUS_SRA_CHECK
-#define RIGOROUS_SRA_CHECK 0
-#endif
-
-#define OPTION_FORCE   "force"
-#define OPTION_SRA     "decrypt-sra-files"
-#define ALIAS_FORCE    "f"
-#define ALIAS_SRA      NULL
-
-#define MY_MAX_PATH        4096
-
-
-bool ForceFlag = false;
-bool TmpFoundFlag = false;
-bool UseStdin = false;
-bool UseStdout = false;
-bool IsArchive = false;
-
-/* for wga decrypt */
-char Password [4096 + 2];
-size_t PasswordSize;
-
-/* for encfile encrypt/decrypt */
-KKey Key;
-
-const char * ForceUsage[] = 
-{ "Force overwrite of existing files", NULL };
-
-/*
- * option  control flags
- */
-
-const char EncExt[] = ".ncbi_enc";
-static const char TmpExt[] = ".vdb-decrypt-tmp";
-static const char TmpLockExt[] = ".vdb-decrypt-tmp.lock";
-static const char CacheExt[] = ".cache";
-static const char CacheLockExt[] = ".cache.lock";
-
-/* Usage
- */
-rc_t CC UsageSummary (const char * progname)
-{
-    rc_t rc;
-    {
-        rc = KOutMsg (
-            /*345679012345678901234567890123456789012345678901234567890123456789012345678*/
-            "\n"
-            "Usage:\n"
-            "  %s [options] <source-file>\n"
-            "  %s [options] <source-file> <destination-file>\n"
-            "  %s [options] <source-file> <destination-directory>\n"
-            "  %s [options] <directory>\n",
-            progname, progname, progname, progname);
-    }
-#if DIRECTORY_TO_DIRECTORY_SUPPORTED
-    if (rc == 0)
-        rc = KOutMsg (
-            "  %s [options] <source-directory> <destination-directory>\n",
-            progname);
-#endif
-        if (rc == 0)
-    {
-        rc = KOutMsg (
-            "\n"
-            "Summary:\n"
-            "  %scrypt a file or all the files (recursively) in a directory\n\n",
-            De);
-    }
-    return rc;
-}
-
-rc_t CC Usage (const Args * args)
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    const char * pline[] = {
-        "file to encrypt", NULL,
-        "name of resulting file", NULL,
-        "directory of resulting file", NULL,
-        "directory to encrypt", NULL
-    };
-
-    rc_t rc, orc;
-
-    /* super-fragilistic molti-hacki-docious
-       let's find a better way to reuse things. */
-    if ( de [ 0 ] == 'd' )
-    {
-        pline [ 0 ] = "file to decrypt";
-        pline [ 6 ] = "directory to decrypt";
-    }
-
-    if (args == NULL)
-        rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull);
-    else
-        rc = ArgsProgram (args, &fullpath, &progname);
-
-    orc = UsageSummary (progname);
-    if (rc == 0)
-        rc = orc;
-
-    KOutMsg ("Parameters:\n");
-    HelpParamLine ("source-file"          , pline);
-    HelpParamLine ("destination-file"     , pline + 2);
-    HelpParamLine ("destination-directory", pline + 4);
-    HelpParamLine ("directory"            , pline + 6);
-    KOutMsg ("\nOptions:\n");
-    HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, ForceUsage);
-    CryptOptionLines ();
-    HelpOptionsStandard ();
-
-    /* forcing editor alignment */
-    /*   12345678901234567890123456789012345678901234567890123456789012345678901234567890*/
-    KOutMsg (
-        "\n"
-        "Details:\n"
-        "  All %scryptions are non-destructive until successful. No files are deleted or\n"
-        "  replaced until the %scryptions are complete.\n"
-        "\n", de, de);
-
-    KOutMsg (
-        "  The extension '.ncbi_enc' will be %s when a file is %scrypted.\n"
-        "\n", Decrypting ? "removed" : "added", de);
-
-    if (Decrypting) KOutMsg (
-        "  NCBI Archive files that contain NCBI database objects will not be decrypted\n"
-        "  unless the %s option is used. As these objects can be used without\n"
-        "  decryption it is recommended they remain encrypted.\n"
-        "\n", OPTION_SRA);
-    else KOutMsg (
-        "  NCBI Archive files that contain NCBI database objects will not have the\n"
-        "  .ncbi_enc extension added.\n\n");
-
-
-    KOutMsg (
-        "  If the only parameter is a file name then it will be replaced by a file that\n"
-        "  is %scrypted with a possible changed extension.\n"
-        "  \n", de);
-
-    KOutMsg (
-        "  If the only parameter is a directory, all files in that directory including\n"
-        "  all files in subdirectories will be replaced with a possible change\n"
-        "  in the extension.\n"
-        "\n");
-
-    KOutMsg (
-        "  If there are two parameters  a copy is made but the copy will be %scrypted.\n"
-        "  If the second parameter is a directory the new file might have a different\n"
-        "  extension. If it is not a directory, the extension will be as given in the\n"
-        "  the parameter.\n"
-        "\n", de);
-
-    KOutMsg (
-        "  Missing directories in the destination path will be created.\n"
-        "\n");
-
-    KOutMsg (
-        "  Already existing destination files will cause the program to end with\n"
-        "  an error and will be left unchanged unless the --%s option is used to\n"
-        "  force the files to be overwritten.\n"
-        "\n", OPTION_FORCE);
-
-    KOutMsg (
-        "Encryption key (file password):\n"
-        "  The encryption key or file password is handled by configuration. If not yet\n"
-        "  set, this program will fail.\n\n"
-        "  You can set the encryption key by running:\n\n"
-        "    perl configuration-assistant.perl\n"
-        "\n");
-
-    HelpVersion (fullpath, KAppVersion());
-
-    return rc;
-}
-
-
-
-
-
-/*
- * determine the archive type for KFile f with pathname name
- *
- * This could be extended to handle tar files with a larger head size and
- * and some less simple checks for a tar header block at the start of
- * the file.
- */
-ArcScheme ArchiveTypeCheck (const KFile * f)
-{
-    size_t num_read;
-    rc_t rc;
-    char head [128];
-
-    IsArchive = false;
-    rc = KFileReadAll (f, 0, head, sizeof head, &num_read);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "Unable to read head of decrypted file");
-        return arcError;
-    }
-
-    rc = KFileIsSRA (head, num_read);
-    if (rc == 0)
-    {
-
-/*         OUTMSG (("+++++ ARCHIVE\n")); */
-
-
-        /* a hack... */
-
-        IsArchive = true;
-        return arcSRAFile;
-    }
-/*     OUTMSG (("----- not an archive\n")); */
-    return arcNone;
-}
-
-
-/*
- * Copy a file from a const KFile * to a KFile * with the paths for the two
- * for logging purposes
- *
- * return rc_t = 0 for success
- * return rc_t != 0 for failure
- */
-rc_t CopyFile (const KFile * src, KFile * dst, const char * source, const char * dest)
-{
-    rc_t rc;
-    uint8_t	buff	[256 * 1024];
-    size_t	num_read;
-    size_t      num_writ;
-    uint64_t	pos;
-
-    for (pos = 0; ; pos += num_read)
-    {
-        rc = Quitting ();
-        if (rc)
-        {
-            LOGMSG (klogFatal, "Received quit");
-            break;
-        }
-
-        rc = KFileReadAll (src, pos, buff, sizeof (buff), &num_read);
-        if (rc)
-        {
-            PLOGERR (klogErr,
-                     (klogErr, rc,
-                      "Failed to read from file $(F) at $(P)",
-                      "F=%s,P=%lu", source, pos));
-            break;
-        }
-        
-        if (num_read == 0)
-            break;
-
-        rc = KFileWriteAll (dst, pos, buff, num_read, &num_writ);
-        if (rc)
-        {
-            PLOGERR (klogErr,
-                     (klogErr, rc,
-                      "Failed to write to file $(F) at $(P)",
-                      "F=%s,P=%lu", dest, pos));
-            break;
-        }
-        
-        if (num_writ != num_read)
-        {
-            rc = RC (rcExe, rcFile, rcWriting, rcFile, rcInsufficient);
-            PLOGERR (klogErr,
-                     (klogErr, rc,
-                      "Failed to write all to file $(F) at $(P)",
-                      "F=%s,P=%lu", dest, pos));
-            break;
-        }
-    }
-    return rc;
-}
-
-
-/*
- * determine the encryption type for KFile f with pathname name
- */
-rc_t EncryptionTypeCheck (const KFile * f, const char * name, EncScheme * scheme)
-{
-    size_t num_read;
-    rc_t rc;
-    char head [128];
-
-    assert (f != NULL);
-    assert (name != NULL);
-
-    rc = KFileReadAll (f, 0, head, sizeof head, &num_read);
-    if (rc)
-    {
-        PLOGERR (klogErr, (klogErr, rc, "Unable to read head of "
-                           "'$(F)'", "F=%s", name));
-        *scheme = encError;
-        return rc;
-    }
-    
-    /* looks for files with NCBInenc or NCBIsenc signatures */
-    rc = KFileIsEnc (head, num_read);
-    if (rc == 0)
-    {
-            /* looks for files with just NCBIsenc signatures */
-        rc = KFileIsSraEnc (head, num_read);
-
-        *scheme = (rc == 0) ? encSraEncFile : encEncFile;
-    }
-    else
-    {
-        rc = KFileIsWGAEnc (head, num_read);
-        if (rc == 0)
-            *scheme = encWGAEncFile;
-        else
-            *scheme = encNone;
-    }
-    return 0;
-}
-
-
-/*
- * Check a file path name for ending in the extension used by this program
- *
- * return true if it ends with the extension and false if it does not
- */
-static
-bool IsTmpFile (const char * path)
-{
-    const char * pc;
-
-    pc = strrchr (path, '.');
-    if (pc == NULL)
-        return false;
-
-    if (strcmp (pc, TmpExt) == 0)
-        return true;
-
-    pc = string_chr (path, pc - path, '.');
-    if (pc == NULL)
-        return false;
-
-    return (strcmp (pc, TmpLockExt) == 0);
-}
-
-
-static
-bool IsCacheFile (const char * path)
-{
-    const char * pc;
-
-    pc = strrchr (path, '.');
-    if (pc == NULL)
-        return false;
-
-    if (strcmp (pc, CacheExt) == 0)
-        return true;
-
-    pc = string_chr (path, pc - path, '.');
-    if (pc == NULL)
-        return false;
-
-    return (strcmp (pc, CacheLockExt) == 0);
-}
-
-
-static
-rc_t FileInPlace (KDirectory * cwd, const char * leaf, bool try_rename)
-{
-    rc_t rc;
-    bool is_tmp;
-
-    STSMSG (1, ("%scrypting file in place %s",De,leaf));
-
-    rc = 0;
-    is_tmp = IsTmpFile (leaf);
-    if (is_tmp)
-    {
-        STSMSG (1, ("%s is a vdb-decrypt/vdb-encrypt temporary file and will "
-                    "be ignored", leaf));
-        TmpFoundFlag = true;
-        if (ForceFlag)
-            ; /* LOG OVERWRITE */
-        else
-            ; /* LOG TMP */
-    }
-    if (!is_tmp || ForceFlag)
-    {
-        char temp [MY_MAX_PATH];
-
-
-        rc = KDirectoryResolvePath (cwd, false, temp, sizeof temp, ".%s%s",
-                                    leaf, TmpExt);
-
-        if (rc)
-            PLOGERR (klogErr, (klogErr, rc, "unable to resolve '.$(S)$(E)'",
-                               "S=%s,E=%s",leaf,TmpExt));
-        else
-        {
-            KPathType kpt;
-            uint32_t kcm;
-
-            kcm = kcmCreate|kcmParents;
-            kpt = KDirectoryPathType (cwd, temp);
-            if (kpt != kptNotFound)
-            {
-                /* log busy */
-                if (ForceFlag)
-                {
-                    kcm = kcmInit|kcmParents;
-                    /* log force */
-                    kpt = kptNotFound;
-                }
-            }
-
-            if (kpt == kptNotFound)
-            {
-                const KFile * infile;
-
-                rc = KDirectoryOpenFileRead (cwd, &infile, "%s", leaf);
-                if (rc)
-                    PLOGERR (klogErr, (klogErr, rc, "Unable to resolve '$(F)'",
-                                       "F=%s",leaf));
-                else
-                {
-                    uint64_t fz;
-                    size_t z;
-                    rc_t irc;
-                    uint64_t ignored;
-
-                    rc = KFileSize (infile, &fz);
-                    /* ignore rc for now? yes hack */
-                    z = string_size (leaf);
-
-                    /* vdb-decrypt and vdb-encrypt both ignore repository cache files. */
-                    irc = GetCacheTruncatedSize (infile, &ignored, true);
-                    if (irc == 0)
-                        STSMSG (1, ("skipping cache download file %s", leaf));
-                    else if ((fz == 0) &&
-                             (string_cmp (leaf + (z - (sizeof (".lock")-1)), sizeof (".lock"),
-                                          ".lock", sizeof (".lock") , sizeof (".lock")) == 0))
-                        STSMSG (1, ("skipping cache lock download file %s", leaf));
-                    else
-                    {
-                        EncScheme scheme;
-
-                        rc = EncryptionTypeCheck (infile, leaf, &scheme);
-                        if (rc == 0)
-                        {
-                            ArcScheme ascheme;
-                            bool changed;
-                            bool do_this_file;
-                            char new_name [MY_MAX_PATH + sizeof EncExt];
-
-                            do_this_file = DoThisFile (infile, scheme, &ascheme);
-                            strcpy (new_name, leaf);
-                            if (try_rename && do_this_file)
-                                changed = NameFixUp (new_name);
-                            else
-                                changed = false;
-/*                         KOutMsg ("### %d \n", changed); */
-
-                            if (!do_this_file)
-                            {
-                                if (changed)
-                                {
-                                    STSMSG (1, ("renaming %s to %s", leaf, new_name));
-                                    rc = KDirectoryRename (cwd, false, leaf, new_name);
-                                }
-                                else
-                                    STSMSG (1, ("skipping %s",leaf));
-                            }
-                            else
-                            {
-                                KFile * outfile;
-
-                                rc = KDirectoryCreateExclusiveAccessFile (cwd, &outfile,
-                                                                          false, 0600, kcm,
-                                                                          temp);
-                                if (rc == 0)
-                                {
-                                    const KFile * Infile;
-                                    KFile * Outfile;
-
-                                    rc = CryptFile (infile, &Infile, outfile, &Outfile, scheme);
-
-                                    if (rc == 0)
-                                    {
-                                        STSMSG (1, ("copying %s to %s", leaf, temp));
-
-                                        rc = CopyFile (Infile, Outfile, leaf, temp);
-
-                                        if (rc == 0)
-                                        {
-                                            uint32_t access;
-                                            KTime_t date;
-
-                                            rc = KDirectoryAccess (cwd, &access, "%s", leaf);
-                                            if (rc == 0)
-                                                rc = KDirectoryDate (cwd, &date, "%s", leaf);
-
-                                            KFileRelease (infile);
-                                            KFileRelease (outfile);
-                                            KFileRelease (Infile);
-                                            KFileRelease (Outfile);
-
-                                            if (rc == 0)
-                                            {
-                                                STSMSG (1, ("renaming %s to %s", temp, new_name));
-
-                                                rc = KDirectoryRename (cwd, true, temp, new_name);
-                                                if (rc)
-                                                    LOGERR (klogErr, rc, "error renaming");
-                                                else
-                                                {
-                                                    if (changed)
-                                                        KDirectoryRemove (cwd, false, "%s", leaf);
-
-                                                    /*rc =*/
-                                                    KDirectorySetAccess (cwd, false, access,
-                                                                         0777, "%s", new_name);
-                                                    KDirectorySetDate (cwd, false, date, "%s", new_name);
-                                                    /* gonna ignore an error here I think */
-                                                    return rc;
-                                                }
-                                            }
-                                        }
-                                    }
-                                    KFileRelease (outfile);
-                                }
-                            }
-                        }
-                    }
-                    KFileRelease (infile);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t FileToFile (const KDirectory * sd, const char * source, 
-                 KDirectory *dd, const char * dest_, bool try_rename,
-                 char * base)
-{
-    const KFile * infile;
-    rc_t rc;
-    uint32_t access;
-    KTime_t date;
-    bool is_tmp;
-    char dest [MY_MAX_PATH + sizeof EncExt];
-
-    strcpy (dest, dest_);
-    if (try_rename)
-        NameFixUp (dest);
-
-    if ((sd == dd) && (strcmp (source, dest) == 0))
-        return FileInPlace (dd, dest, try_rename);
-
-    if (base == NULL)
-        STSMSG (1, ("%scrypting file %s to %s", De, source, dest));
-    else
-        STSMSG (1, ("%scrypting file %s to %s/%s", De, source, base, dest));
-
-    /*
-     * A Hack to make stdin/stout work within KFS
-     */
-    if (UseStdin)
-    {
-        const KFile * iinfile;
-        rc = KFileMakeStdIn (&iinfile);
-        if (rc == 0)
-        {
-            rc = KBufReadFileMakeRead (&infile, iinfile, 64 * 1024);
-            KFileRelease (iinfile);
-            if (rc == 0)
-            {
-                access = 0640;
-                date = 0;
-                goto stdin_shortcut;
-            }
-            LOGERR (klogErr, rc, "error wrapping stdin");
-            return rc;
-        }
-    }
-    rc = 0;
-    is_tmp = IsTmpFile (source);
-
-    if (is_tmp)
-    {
-        TmpFoundFlag = true;
-        if (ForceFlag)
-            ; /* LOG OVERWRITE */
-        else
-                ; /* LOG TMP */
-    }
-    if (!is_tmp || ForceFlag)
-    {
-        rc = KDirectoryAccess (sd, &access, "%s", source);
-        if (rc)
-            LOGERR (klogErr, rc, "Error check permission of source");
-
-        else
-        {
-            rc = KDirectoryDate (sd, &date, "%s", source);
-            if (rc)
-                LOGERR (klogErr, rc, "Error check date of source");
-
-            else
-            {
-                rc = KDirectoryOpenFileRead (sd, &infile, "%s", source);
-                if (rc)
-                    PLOGERR (klogErr, (klogErr, rc,
-                                       "Error opening source file '$(S)'",
-                                       "S=%s", source));
-                else
-                {
-                    EncScheme scheme;
-
-                stdin_shortcut:
-                    rc = EncryptionTypeCheck (infile, source, &scheme);
-                    if (rc == 0)
-                    {
-                        KFile * outfile;
-                        uint32_t kcm;
-
-                        /*
-                         * Hack to support stdout before VFS is complete enough to use here
-                         */
-                        if (UseStdout)
-                        {
-                            rc = KFileMakeStdOut (&outfile);
-                            if (rc)
-                                LOGERR (klogErr, rc, "error wrapping stdout");
-                        }
-                        else
-                        {
-                            kcm = ForceFlag ? kcmInit|kcmParents : kcmCreate|kcmParents;
-
-                            rc = KDirectoryCreateFile (dd, &outfile, false, 0600, kcm, "%s", dest);
-                            if (rc)
-                                PLOGERR (klogErr,(klogErr, rc, "error opening output '$(O)'",
-                                                  "O=%s", dest));
-                        }
-                        if (rc == 0)
-                        {
-                            const KFile * Infile;
-                            KFile * Outfile;
-
-                            rc = CryptFile (infile, &Infile, outfile, &Outfile, scheme);
-                            if (rc == 0)
-                            {
-                                rc = CopyFile (Infile, Outfile, source, dest);
-                                if (rc == 0)
-                                {
-                                    if (UseStdin || UseStdout)
-                                        ;
-                                    else
-                                    {
-                                        rc = KDirectorySetAccess (dd, false, access, 0777,
-                                                                  "%s", dest);
-
-                                        if (rc == 0 && date != 0)
-                                            rc = KDirectorySetDate (dd, false, date, "%s", dest);
-                                    }
-                                }
-                                KFileRelease (Infile);
-                                KFileRelease (Outfile);
-                            }
-                            KFileRelease (outfile);
-                        }
-                    }
-                    KFileRelease (infile);
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t DoDir (const KDirectory * sd, KDirectory * dd)
-{
-    KNamelist * names;
-    rc_t rc;
-
-    rc = KDirectoryList (sd, &names, NULL, NULL, ".");
-    if (rc)
-        ;
-    else
-    {
-        uint32_t count;
-
-        rc = KNamelistCount (names, &count);
-        if (rc)
-            ;
-        else
-        {
-            uint32_t idx;
-
-            for (idx = 0; idx < count; ++idx)
-            {
-                const char * name;
-
-                rc = KNamelistGet (names, idx, &name);
-                if (rc)
-                    ;
-                else
-                {
-                    const KDirectory * nsd;
-                    KDirectory * ndd;
-                    KPathType kpt;
-
-                    kpt = KDirectoryPathType (sd, name);
-
-                    switch (kpt)
-                    {
-                    default:
-                        break;
-
-                    case kptFile:
-                        if (sd == dd)
-                            rc = FileInPlace (dd, name, true);
-                        else
-                            rc = FileToFile (sd, name, dd, name, true, NULL);
-                        break;
-
-                    case kptDir:
-                        if (sd == dd)
-                        {
-                            rc = KDirectoryOpenDirUpdate (dd, &ndd, false, "%s", name);
-                            if (rc)
-                                ;
-                            else
-                            {
-                                /* RECURSION */
-                                STSMSG (1, ("%scrypting directory %s", De, name));
-                                rc = DoDir (ndd, ndd);
-                                STSMSG (1, ("done with directory %s", name));
-                                KDirectoryRelease (ndd);
-                            }
-                        }
-                        else
-                        {
-                            rc = KDirectoryOpenDirRead (sd, &nsd, false, name);
-                            if (rc)
-                                ;
-                            else
-                            {
-                                rc = KDirectoryCreateDir (dd, 0600, kcmOpen, "%s", name);
-                                if (rc)
-                                    ;
-                                else
-                                {                                    
-                                    rc = KDirectoryOpenDirUpdate (dd, &ndd, false, "%s", name);
-                                    if (rc)
-                                        ;
-                                    else
-                                    {
-                                        /* RECURSION */
-                                        STSMSG (1, ("%scrypting directory %s", De, name));
-                                        rc = DoDir (nsd, ndd);
-                                        STSMSG (1, ("done with directory %s", name));
-
-                                        KDirectoryRelease (ndd);
-                                    }
-                                }
-                                KDirectoryRelease (nsd);
-                            }
-                        }
-                        break;
-                    }
-                }
-            }
-        }
-        KNamelistRelease (names);
-    }
-    return rc;
-}
-
-
-static
-rc_t Start (KDirectory * cwd, const char * src, const char * dst)
-{
-    KPathType dtype;
-    KPathType stype;
-    char dpath [MY_MAX_PATH];
-    char spath [MY_MAX_PATH];
-    rc_t rc;
-    bool using_stdin, using_stdout, try_rename;
-
-    /* limited anti oops checks */
-    try_rename = (dst == NULL);
-    if (!try_rename)
-    {
-        /* try to prevent file to file clash */
-        if (strcmp (src,dst) == 0)
-            dst = NULL;
-
-        /* try to prevent file to dir clash */
-        else
-        {
-            size_t s,d;
-
-            s = string_size (src);
-            d = string_size (dst);
-
-            if (s > d)
-            {
-                if (string_cmp (src, s, dst, d, d) == 0)
-                {
-                    if ((strchr (src+d+1, '/') == NULL) &&
-                        ((src[d] == '/') ||
-                         (src[d-1] == '/')))
-                    {
-                        try_rename = true;
-                        dst = NULL;
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * This is a quick fix "hack"
-     * A fully built out VFS should replace the KFS in use and eliminate this
-     */
-    using_stdin = (strcmp (src, "/dev/stdin") == 0);
-
-    if (using_stdin)
-    {
-        if (dst == NULL)
-        {
-            rc = RC (rcExe, rcArgv, rcParsing, rcParam, rcNull);
-            LOGERR (klogErr, rc, "Unable to handle stdin in place");
-            return rc;
-        }
-        stype = kptFile;
-        strcpy (spath, src);
-        UseStdin = true;
-        STSMSG (1, ("reading console / stdin as input"));
-        goto stdin_shortcut;
-    }
-
-    rc = KDirectoryResolvePath (cwd, false, spath, sizeof spath, "%s", src);
-    if (rc)
-    {
-        LOGERR (klogErr, rc, "can't resolve source");
-        return rc;
-    }
-
-    stype = KDirectoryPathType (cwd, spath);
-
-    switch (stype)
-    {
-    case kptNotFound:
-        rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcNotFound);
-        break;
-
-    default:
-    case kptBadPath:
-        rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcInvalid);
-        break;
-
-    case kptCharDev:
-    case kptBlockDev:
-    case kptFIFO:
-    case kptZombieFile:
-    case kptDataset:
-    case kptDatatype:
-        rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcIncorrect);
-        break;
-
-    case kptFile:
-    case kptDir:
-        break;
-    }
-    if (rc)
-    {
-        PLOGERR (klogErr, (klogErr, rc, "can not use source '$(S)'", "S=%s", src));
-        return rc;
-    }
-
-    /*
-     * In Place Operation
-     */
-    if (dst == NULL)
-    {
-
-        /*
-         * Input is a file
-         */
-        if (stype == kptFile)
-        {
-            KDirectory * ndir;
-            char * pc;
-
-            pc = strrchr (spath, '/');
-            if (pc == NULL)
-            {
-                pc = spath;
-                ndir = cwd;
-                rc = KDirectoryAddRef (cwd);
-            }
-            else if (pc == spath)
-            {
-                ++pc;
-                ndir = cwd;
-                rc = KDirectoryAddRef (cwd);
-            }
-            else
-            {
-                *pc++ = '\0';
-                rc = KDirectoryOpenDirUpdate (cwd, &ndir, false, spath);
-            }
-
-            if (rc == 0)
-            {
-                rc = FileInPlace (ndir, pc, try_rename);
-                KDirectoryRelease (ndir);
-            }
-        }
-        /*
-         * Input is a directory
-         */
-        else
-        {
-            KDirectory * ndir;
-
-            rc = KDirectoryOpenDirUpdate (cwd, &ndir, false, spath);
-            if (rc)
-                ;
-            else
-            {
-                STSMSG (1, ("%scrypting directory %s", De, spath));
-                rc = DoDir (ndir, ndir);
-                STSMSG (1, ("done with directory %s", spath));
-                KDirectoryRelease (ndir);
-            }
-        }
-    }
-
-    /*
-     * 'Copy' Operation
-     */
-    else
-    {
-    stdin_shortcut:
-        using_stdout = (strcmp (dst, "/dev/stdout") == 0);
-        if (using_stdout == true)
-        {
-            dtype = kptFile;
-            strcpy (dpath, dst);
-            UseStdout = true;
-            STSMSG (1, ("writing console / stdout as output"));
-            goto do_file;
-        }
-        rc = KDirectoryResolvePath (cwd, false, dpath, sizeof dpath, "%s", dst);
-        if (rc)
-        {
-            LOGERR (klogErr, rc, "can't resolve destination");
-            return rc;
-        }
-        dtype = KDirectoryPathType (cwd, dpath);
-        switch (dtype)
-        {
-        default:
-        case kptBadPath:
-            rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcInvalid);
-            PLOGERR (klogErr, (klogErr, rc, "can not use destination  '$(S)'", "S=%s", dst));
-            break;
-
-        case kptCharDev:
-        case kptBlockDev:
-        case kptFIFO:
-        case kptZombieFile:
-        case kptDataset:
-        case kptDatatype:
-            rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcIncorrect);
-            PLOGERR (klogErr, (klogErr, rc, "can not use destination parameter '$(S)'", "S=%s", dst));
-            break;
-
-        case kptNotFound:
-        {
-            size_t z;
-
-            z = strlen (dst) - 1;
-            if ((dst[z] == '/') || (stype == kptDir))
-                goto do_dir;
-            else
-                goto do_file;
-        }
-
-        case kptFile:
-            if (!ForceFlag)
-            {
-                rc = RC (rcExe, rcArgv, rcParsing, rcFile, rcExists);
-                PLOGERR (klogErr, (klogErr, rc, "can not over-write '$(F)' without --force",
-                                   "F=%s", dpath));
-                break;
-            }
-        do_file:
-            if (stype == kptFile)
-            {
-                rc = FileToFile (cwd, spath, cwd, dpath, try_rename, NULL);
-            }
-            else
-            {
-                rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcIncorrect);
-                LOGERR (klogErr, rc, "Can't do directory to file");
-            }
-            break;
-
-        do_dir:
-        case kptDir:
-            /*
-             * Input is a directory
-             */
-            if (stype == kptDir)
-            {
-#if DIRECTORY_TO_DIRECTORY_SUPPORTED
-                const KDirectory * sdir;
-                KDirectory * ddir;
-
-                rc = KDirectoryOpenDirRead (cwd, &sdir, false, spath);
-                if (rc)
-                    ;
-                else
-                {
-                    if (dtype == kptNotFound)
-                    {
-                        STSMSG (1, ("creating output directory %s", dpath));
-                        rc = KDirectoryCreateDir (cwd, 0775, kcmCreate|kcmParents,
-                                                  "%s", dpath);
-                    }
-                    if (rc == 0)
-                    {
-                        rc = KDirectoryOpenDirUpdate (cwd, &ddir, false, dpath);
-                        if (rc)
-                            ;
-                        else
-                        {
-                            STSMSG (1, ("%scrypting directory %s to %s", De, spath, dpath));
-                            rc = DoDir (sdir, ddir);
-                            STSMSG (1, ("done with directory %s to %s", spath, dpath));
-                            KDirectoryRelease (ddir);
-                        }
-                    }
-                    KDirectoryRelease (sdir);
-                }
-#else
-                rc = RC (rcExe, rcArgv, rcResolving, rcPath, rcIncorrect);
-                LOGERR (klogErr, rc, "Can't do directory to directory");
-#endif
-            }
-            /*
-             * Input is a file
-             */
-            else
-            {
-                KDirectory * ndir;
-                const char * pc;
-
-                if (dtype == kptNotFound)
-                {
-                    STSMSG (1, ("creating output directory %s", dpath));
-                    rc = KDirectoryCreateDir (cwd, 0775, kcmCreate|kcmParents,
-                                              "%s", dpath);
-                }
-                if (rc == 0)
-                {
-
-                    STSMSG (1, ("opening output directory %s", dpath));
-                    rc = KDirectoryOpenDirUpdate (cwd, &ndir, false, dpath);
-                    if (rc)
-                        ;
-                    else
-                    {
-                        pc = strrchr (spath, '/');
-                        if (pc == NULL)
-                            pc = spath;
-                        else
-                            ++pc;
-
-                        rc = FileToFile (cwd, spath, ndir, pc, true, dpath);
-
-                        KDirectoryRelease (ndir);
-                    }
-                }
-            }
-            break;
-        }
-    }
-    return rc;
-}
-
-
-static
-rc_t StartFileSystem (const char * src, const char * dst)
-{
-    VFSManager * vmanager;
-    rc_t rc;
- 
-    rc = VFSManagerMake (&vmanager);
-    if (rc)
-        LOGERR (klogErr, rc, "Failed to open file system");
-
-    else
-    {
-        rc = VFSManagerGetKryptoPassword (vmanager, Password, sizeof Password,
-                                          &PasswordSize);
-        if (rc != 0)
-            LOGERR (klogErr, rc, "unable to obtain a password");
-
-        else
-        {
-            rc = KKeyInitRead (&Key, kkeyAES128, Password, PasswordSize);
-            if (rc)
-                LOGERR (klogErr, rc, "Unable to make encryption/decryption key");
-
-            else
-            {
-                KDirectory * cwd;
-
-                rc = VFSManagerGetCWD (vmanager, &cwd);
-                if (rc)
-                    LOGERR (klogInt, rc, "unable to access current directory");
-
-                else
-                {
-                    rc = Start (cwd, src, dst);
-
-                    KDirectoryRelease (cwd);
-                }
-            }
-        }
-        VFSManagerRelease (vmanager);
-    }
-    return rc;
-}
-
-
-rc_t CommonMain (Args * args)
-{
-    rc_t rc;
-    uint32_t ocount; /* we take the address of ocount but not pcount. */
-    uint32_t pcount; /* does that help the compiler optimize? */
-
-    rc = ArgsParamCount (args, &ocount);
-    if (rc)
-        LOGERR (klogInt, rc, "failed to count parameters");
-
-    else if ((pcount = ocount) == 0)
-        MiniUsage (args);
-
-    else if (pcount > 2)
-    {
-        LOGERR (klogErr, rc, "too many parameters");
-        MiniUsage(args);
-    }
-            
-    else
-    {
-        const char * dst; /* we only take the address of one of these */
-        const char * src;
-
-        rc = ArgsOptionCount (args, OPTION_FORCE, &ocount);
-        if (rc)
-            LOGERR (klogInt, rc, "failed to examine force option");
-
-        else
-        {
-            ForceFlag = (ocount > 0);
-
-            /* -----
-             * letting comp put src in register
-             * only if it wants
-             */
-            rc = ArgsParamValue (args, 0, &dst);
-            if (rc)
-                LOGERR (klogInt, rc, "Failure to fetch "
-                        "source parameter");
-
-            else
-            {
-                src = dst;
-
-                if (pcount == 1)
-                    dst = NULL;
-
-                else
-                {
-                    rc = ArgsParamValue (args, 1, &dst);
-                    if (rc)
-                        LOGERR (klogInt, rc, "Failure to fetch "
-                                "destination parameter");
-                }
-
-                if (rc == 0)
-                    rc = StartFileSystem (src, dst);
-            }
-        }
-    }
-    return rc;
-}
-
-/* EOF */
diff --git a/tools/vdb-decrypt/shared.h b/tools/vdb-decrypt/shared.h
deleted file mode 100644
index 37998bd..0000000
--- a/tools/vdb-decrypt/shared.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*==============================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#ifndef _tools_vdb_decrypt_shared_h_
-#define _tools_vdb_decrypt_shared_h_
-
-#define DIRECTORY_TO_DIRECTORY_SUPPORTED 0
-
-#include <klib/defs.h>
-#include <krypto/key.h>
-#include <kapp/args.h>
-
-#define OPTION_FORCE   "force"
-#define OPTION_DEC_SRA "decrypt-sra-files"
-#define ALIAS_FORCE    "f"
-#define ALIAS_DEC_SRA  NULL
-
-extern const bool Decrypting;
-
-extern char Password [];
-extern size_t PasswordSize;
-
-extern const char De [];
-extern const char de [];
-extern const char SraOption[];
-
-extern const char EncExt[];
-bool NameFixUp (char * name);
-extern const char * ForceUsage[];
-
-/* for encfile encrypt/decrypt */
-extern KKey Key;
-
-
-typedef enum ArcScheme
-{
-    arcError,
-    arcNone,
-    arcSRAFile
-} ArcScheme;
-
-extern bool IsArchive; /* this approach makes threading fail */
-
-struct KFile;
-
-ArcScheme ArchiveTypeCheck (const struct KFile * f);
-
-typedef enum EncScheme
-{
-    encError,
-    encNone,
-    encEncFile,
-    encSraEncFile,
-    encWGAEncFile
-} EncScheme;
-
-void CryptOptionLines ();
-
-bool DoThisFile (const struct KFile * infile, EncScheme enc, ArcScheme * arc);
-
-struct Args;
-rc_t CommonMain (struct Args * args);
-
-rc_t CryptFile (const struct KFile * in, const struct KFile ** new_in,
-                struct KFile * out, struct KFile ** new_out, EncScheme scheme);
-
-
-#endif
-
-/* EOF */
diff --git a/tools/vdb-decrypt/vdb-decrypt.c b/tools/vdb-decrypt/vdb-decrypt.c
deleted file mode 100644
index 8803acc..0000000
--- a/tools/vdb-decrypt/vdb-decrypt.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*==============================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-
-#include "vdb-decrypt.vers.h"
-
-#include "shared.h"
-
-#include <krypto/wgaencrypt.h>
-#include <krypto/encfile.h>
-#include <kfs/file.h>
-#include <kfs/cacheteefile.h>
-#include <klib/rc.h>
-#include <klib/defs.h>
-#include <klib/log.h>
-#include <klib/status.h>
-
-#include <string.h>
-#include <assert.h>
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return VDB_DECRYPT_VERS;
-}
-
-
-/* Usage
- */
-const char UsageDefaultName [] = "vdb-decrypt";
-const char * UsageSra []       = { "decrypt sra archives - [NOT RECOMMENDED]",
-                                   NULL };
-const char De[]             = "De";
-const char de[]             = "de";
-const char OptionSra[] = OPTION_DEC_SRA;
-
-
-static
-OptDef Options[] = 
-{
-    /* name            alias max times oparam required fmtfunc help text loc */
-    { OPTION_DEC_SRA, ALIAS_DEC_SRA, NULL, UsageSra,      0, false, false },
-    { OPTION_FORCE,   ALIAS_FORCE,   NULL, ForceUsage,   0, false, false }
-};
-
-
-static 
-bool DecryptSraFlag = false;
-
-
-const bool Decrypting = true;
-
-void CryptOptionLines ()
-{
-    HelpOptionLine (ALIAS_DEC_SRA, OPTION_DEC_SRA, NULL, UsageSra);
-}
-
-bool DoThisFile (const KFile * infile, EncScheme enc, ArcScheme * parc)
-{
-    const KFile * Infile;
-    ArcScheme arc;
-    rc_t rc;
-
-    *parc = arcNone;
-
-    switch (enc)
-    {
-    default:
-        STSMSG (1, ("not encrypted"));
-        return false;
-
-    case encEncFile:
-        /*
-         * this will apply to KEncFiles versions 1 and 2, maybe not 3
-         * but will hopefully become obsolete eventually.
-         */
-        rc = KEncFileMakeRead (&Infile, infile, &Key);
-        if (rc)
-            return false;
-        break;
-
-    case encSraEncFile:
-        /* these are NCBIsenc instead of NCBInenc */
-        goto sra_enc_file;
-
-    case encWGAEncFile:
-        rc = KFileMakeWGAEncRead (&Infile, infile, Password, PasswordSize);
-        if (rc)
-            return false;
-        break;
-    }
-    arc = ArchiveTypeCheck (Infile);
-    KFileRelease (Infile);
-    switch (arc)
-    {
-    default:
-        return false;
-    case arcNone:
-        return true;
-    case arcSRAFile:
-        break;
-    }
-sra_enc_file:
-    *parc = arcSRAFile;
-    STSMSG (1, ("encrypted sra archive\ndecryption%s requested",
-                DecryptSraFlag ? "" : " not"));
-    return DecryptSraFlag;
-}
-
-bool NameFixUp (char * name)
-{
-    char * pc = strrchr (name, '.');
-    if (pc != NULL)
-    {
-        if (strcmp (pc, EncExt) == 0)
-        {
-            pc[0] = '\0';
-            return true;
-        }
-    }
-    return false;
-}
-
-rc_t CryptFile (const KFile * in, const KFile ** new_in,
-                KFile * out, KFile ** new_out, EncScheme scheme)
-{
-    const KFile * dec;
-    rc_t rc;
-
-    assert (in);
-    assert (out);
-    assert (new_in);
-    assert (new_out);
-
-
-    rc = KFileAddRef (out);
-    if (rc)
-        return rc;
-
-    switch (scheme)
-    {
-    default:
-    case encError:
-        rc = RC (rcExe, rcFile, rcClassifying, rcFile, rcInvalid);
-        break;
-        
-    case encNone:
-    copy:
-        rc = KFileAddRef (in);
-        if (rc)
-            goto fail;
-        *new_in = in;
-        *new_out = out;
-        STSMSG (1, ("not encrypted just copying"));
-        return 0;
-
-    case encEncFile:
-        rc = KEncFileMakeRead (&dec, in, &Key);
-    made_enc:
-        if (rc)
-            goto fail;
-
-        switch (ArchiveTypeCheck (dec))
-        {
-        default:
-        case arcError:
-            rc = RC (rcExe, rcFile, rcClassifying, rcFile, rcInvalid);
-            break;
-
-        case arcSRAFile:
-            if (!DecryptSraFlag)
-            {
-                rc = KFileRelease (dec);
-                if (rc)
-                {
-                    KFileRelease (dec);
-                    KFileRelease (in);
-                    goto fail;
-                }
-                goto copy;
-            }
-            /* fall through */
-        case arcNone:
-            *new_out = out;
-            *new_in = dec;
-            return 0;
-        }
-        break;
-
-    case encWGAEncFile:
-        rc = KFileMakeWGAEncRead (&dec, in, Password, PasswordSize);
-        goto made_enc;
-        break;
-    }
-    fail:
-        KFileRelease (out);
-        *new_in = *new_out = NULL;
-        return rc;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    KStsLevelSet (1);
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options,
-                            sizeof (Options) / sizeof (Options[0]));
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse command line parameters");
-
-    else
-    {
-        uint32_t ocount;
-
-        rc = ArgsOptionCount (args, OPTION_DEC_SRA, &ocount);
-        if (rc)
-            LOGERR (klogInt, rc, "failed to examine decrypt "
-                    "sra option");
-        else
-        {
-            DecryptSraFlag = (ocount > 0);
-
-            rc = CommonMain (args);
-        }
-        ArgsWhack (args);
-    }
-
-    if (rc)
-        STSMSG (1, ("exiting: %R (%u)", rc, rc));
-    else
-        STSMSG (1, ("exiting: success"));
-    return rc;
-}
-
-
-/* EOF */
diff --git a/tools/vdb-decrypt/vdb-decrypt.vers b/tools/vdb-decrypt/vdb-decrypt.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-decrypt/vdb-decrypt.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/vdb-decrypt/vdb-encrypt.c b/tools/vdb-decrypt/vdb-encrypt.c
deleted file mode 100644
index 6405294..0000000
--- a/tools/vdb-decrypt/vdb-encrypt.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*==============================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-
-#include "vdb-encrypt.vers.h"
-
-#include "shared.h"
-
-#include <krypto/wgaencrypt.h>
-#include <krypto/encfile.h>
-#include <kfs/file.h>
-#include <klib/rc.h>
-#include <klib/defs.h>
-#include <klib/log.h>
-#include <klib/status.h>
-
-#include <assert.h>
-#include <string.h>
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return VDB_ENCRYPT_VERS;
-}
-
-
-/* Usage
- */
-const char UsageDefaultName [] = "vdb-encrypt";
-const char De[]             = "En";
-const char de[]             = "en";
-
-
-static
-OptDef Options[] = 
-{
-    /* name            alias max times oparam required fmtfunc help text loc */
-    { OPTION_FORCE,   ALIAS_FORCE,   NULL, ForceUsage,   0, false, false }
-};
-
-
-static 
-bool DecryptSraFlag = false;
-
-const bool Decrypting = false;
-
-void CryptOptionLines () {}
-
-bool DoThisFile (const KFile * infile, EncScheme enc, ArcScheme * parc)
-{
-    const KFile * Infile;
-    ArcScheme arc;
-    rc_t rc;
-    bool do_enc;
-
-    *parc = arcNone;
-
-    switch (enc)
-    {
-    default:
-        STSMSG (1, ("error checking encrypted"));
-        return false;
-
-    case encNone:
-        do_enc = true;
-        rc = KFileAddRef (infile);
-        if (rc)
-            return false;
-        Infile = infile;
-        break;
-
-    case encEncFile:
-        do_enc = false;
-        rc = KEncFileMakeRead (&Infile, infile, &Key);
-        if (rc)
-            return false;
-        break;
-
-    case encWGAEncFile:
-        do_enc = false;
-        rc = KFileMakeWGAEncRead (&Infile, infile, Password, PasswordSize);
-        if (rc)
-            return false;
-        break;
-    }
-    arc = ArchiveTypeCheck (Infile);
-    KFileRelease (Infile);
-    if (arc == arcSRAFile)
-    {
-        STSMSG (1, ("%sencrypted sra archive", do_enc ? "un" : ""));
-        *parc = arcSRAFile;
-    }
-    return do_enc;
-}
-
-bool NameFixUp (char * name)
-{
-    char * pc = strrchr (name, '.');
-
-    if (((pc != NULL) &&
-         (strcmp (pc, EncExt) == 0)) ||
-        IsArchive )
-        return false;
-
-    strcat (name, EncExt);
-
-    return true;
-}
-
-rc_t CryptFile (const KFile * in, const KFile ** new_in,
-                KFile * out, KFile ** new_out, EncScheme scheme)
-{
-    rc_t rc;
-
-    assert (in);
-    assert (out);
-    assert (new_in);
-    assert (new_out);
-
-    *new_in = *new_out = NULL;
-
-    rc = KFileAddRef (in);
-    if (rc)
-        return rc;
-
-    switch (scheme)
-    {
-    default:
-    case encError:
-        KFileRelease (in);
-        return RC (rcExe, rcEncryption, rcParsing, rcFile, rcInvalid);
-
-    case encNone:
-        rc = KEncFileMakeWrite (new_out, out, &Key);
-        if (rc)
-        {
-            KFileRelease (in);
-            return rc;
-        }
-        break;
-
-    case encEncFile:
-    case encWGAEncFile:
-        rc = KFileAddRef (out);
-        if (rc)
-        {
-            KFileRelease (in);
-            return rc;
-        }
-        *new_out = out;
-        STSMSG (1, ("already encrypted just copying"));
-        break;
-    }
-    *new_in = in;
-    return 0;
-}
-
-
-/* KMain - EXTERN
- *  executable entrypoint "main" is implemented by
- *  an OS-specific wrapper that takes care of establishing
- *  signal handlers, logging, etc.
- *
- *  in turn, OS-specific "main" will invoke "KMain" as
- *  platform independent main entrypoint.
- *
- *  "argc" [ IN ] - the number of textual parameters in "argv"
- *  should never be < 0, but has been left as a signed int
- *  for reasons of tradition.
- *
- *  "argv" [ IN ] - array of NUL terminated strings expected
- *  to be in the shell-native character set: ASCII or UTF-8
- *  element 0 is expected to be executable identity or path.
- */
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    KStsLevelSet (1);
-
-    rc = ArgsMakeAndHandle (&args, argc, argv, 1, Options,
-                            sizeof (Options) / sizeof (Options[0]));
-    if (rc)
-        LOGERR (klogInt, rc, "failed to parse command line parameters");
-
-    else
-    {
-        rc = CommonMain (args);
-
-        ArgsWhack (args);
-    }
-
-    if (rc)
-        STSMSG (1, ("exiting: %R (%u)", rc, rc));
-    else
-        STSMSG (1, ("exiting: success"));
-
-    return rc;
-}
-
-
-/* EOF */
diff --git a/tools/vdb-decrypt/vdb-encrypt.vers b/tools/vdb-decrypt/vdb-encrypt.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-decrypt/vdb-encrypt.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/vdb-dump/Makefile b/tools/vdb-dump/Makefile
deleted file mode 100644
index 2101d7e..0000000
--- a/tools/vdb-dump/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/vdb-dump
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-EXT_TOOLS = \
-	vdb-dump
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#-------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vdb-dump
-#  vdb dump tool
-#
-VDB_DUMP_SRC = \
-	vdb-dump-num-gen \
-	vdb-dump-context \
-	vdb-dump-coldefs \
-	vdb-dump-tools \
-	vdb-dump-str \
-	vdb-dump-helper \
-	vdb-dump-filter \
-	vdb-dump-formats \
-	vdb-dump
-
-VDB_DUMP_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_DUMP_SRC))
-
-VDB_DUMP_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-$(BINDIR)/vdb-dump: $(VDB_DUMP_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_DUMP_LIB)
diff --git a/tools/vdb-dump/vdb-dump-coldefs.c b/tools/vdb-dump/vdb-dump-coldefs.c
deleted file mode 100644
index fac3f38..0000000
--- a/tools/vdb-dump/vdb-dump-coldefs.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-helper.h"
-
-#include "vdb-dump-coldefs.h"
-
-#include <klib/vector.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <vdb/vdb-priv.h>
-#include <sra/sradb.h>
-#include <sra/pacbio.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-/* for platforms */
-#include <insdc/sra.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-/* once we get used to having moved the read descriptor
-   out of SRA, we should begin using those names.
-   if anyone has an investment in the old names, we may
-   want to provide a switch for using them... */
-#if USE_OLD_SRA_NAME || 1
-#define SRA_NAME( name ) \
-    "SRA_" #name
-#define SRA_NAMES( name1, name2 ) \
-    "SRA_" #name1 "|SRA_" #name2
-#else
-#define SRA_NAME( name ) \
-    # name
-#define SRA_NAMES( name1, name2 ) \
-    #name1 "|" #name2
-#endif
-
-/* implementation of the value-translation-functions */
-
-const char SRA_PB_HS_0[] = { "SRA_PACBIO_HOLE_SEQUENCING" };
-const char SRA_PB_HS_1[] = { "SRA_PACBIO_HOLE_ANTIHOLE" };
-const char SRA_PB_HS_2[] = { "SRA_PACBIO_HOLE_FIDUCIAL" };
-const char SRA_PB_HS_3[] = { "SRA_PACBIO_HOLE_SUSPECT" };
-const char SRA_PB_HS_4[] = { "SRA_PACBIO_HOLE_ANTIMIRROR" };
-const char SRA_PB_HS_5[] = { "SRA_PACBIO_HOLE_FDZMW" };
-const char SRA_PB_HS_6[] = { "SRA_PACBIO_HOLE_FBZMW" };
-const char SRA_PB_HS_7[] = { "SRA_PACBIO_HOLE_ANTIBEAMLET" };
-const char SRA_PB_HS_8[] = { "SRA_PACBIO_HOLE_OUTSIDEFOV" };
-const char SRA_PB_HS_9[] = { "unknown hole-status" };
-
-const char *vdcd_get_hole_status_txt( const uint32_t id )
-{
-    switch( id )
-    {
-        case SRA_PACBIO_HOLE_SEQUENCING     : return( SRA_PB_HS_0 ); break;
-        case SRA_PACBIO_HOLE_ANTIHOLE       : return( SRA_PB_HS_1 ); break;
-        case SRA_PACBIO_HOLE_FIDUCIAL       : return( SRA_PB_HS_2 ); break;
-        case SRA_PACBIO_HOLE_SUSPECT        : return( SRA_PB_HS_3 ); break;
-        case SRA_PACBIO_HOLE_ANTIMIRROR     : return( SRA_PB_HS_4 ); break;
-        case SRA_PACBIO_HOLE_FDZMW          : return( SRA_PB_HS_5 ); break;
-        case SRA_PACBIO_HOLE_FBZMW          : return( SRA_PB_HS_6 ); break;
-        case SRA_PACBIO_HOLE_ANTIBEAMLET    : return( SRA_PB_HS_7 ); break;
-        case SRA_PACBIO_HOLE_OUTSIDEFOV     : return( SRA_PB_HS_8 ); break;
-    }
-    return( SRA_PB_HS_9 );
-}
-
-const char *vdcd_get_platform_txt( const uint32_t id )
-{
-#define CASE( id ) \
-    case id : return # id; break
-
-    switch( id )
-    {
-        CASE ( SRA_PLATFORM_UNDEFINED );
-        CASE ( SRA_PLATFORM_454 );
-        CASE ( SRA_PLATFORM_ILLUMINA );
-        CASE ( SRA_PLATFORM_ABSOLID );
-        CASE ( SRA_PLATFORM_COMPLETE_GENOMICS );
-        CASE ( SRA_PLATFORM_HELICOS );
-        CASE ( SRA_PLATFORM_PACBIO_SMRT );
-        CASE ( SRA_PLATFORM_ION_TORRENT );
-        CASE ( SRA_PLATFORM_SANGER );
-    }
-#undef CASE
-
-    return "unknown platform";
-}
-
-const char SRA_RT_0[] = { SRA_NAME  ( READ_TYPE_TECHNICAL ) };
-const char SRA_RT_1[] = { SRA_NAME  ( READ_TYPE_BIOLOGICAL ) };
-const char SRA_RT_2[] = { SRA_NAMES ( READ_TYPE_TECHNICAL, READ_TYPE_FORWARD ) };
-const char SRA_RT_3[] = { SRA_NAMES ( READ_TYPE_BIOLOGICAL, READ_TYPE_FORWARD ) };
-const char SRA_RT_4[] = { SRA_NAMES ( READ_TYPE_TECHNICAL, READ_TYPE_REVERSE ) };
-const char SRA_RT_5[] = { SRA_NAMES ( READ_TYPE_BIOLOGICAL, READ_TYPE_REVERSE ) };
-const char SRA_RT_6[] = { "unknown read-type" };
-
-const char *vdcd_get_read_type_txt( const uint32_t id )
-{
-    switch( id )
-    {
-        case 0 : return( SRA_RT_0 ); break;
-        case 1 : return( SRA_RT_1 ); break;
-        case 2 : return( SRA_RT_2 ); break;
-        case 3 : return( SRA_RT_3 ); break;
-        case 4 : return( SRA_RT_4 ); break;
-        case 5 : return( SRA_RT_5 ); break;
-    }
-    return( SRA_RT_6 );
-}
-
-const char SRA_FT_0[] = { SRA_NAME ( READ_FILTER_PASS ) };
-const char SRA_FT_1[] = { SRA_NAME ( READ_FILTER_REJECT ) };
-const char SRA_FT_2[] = { SRA_NAME ( READ_FILTER_CRITERIA ) };
-const char SRA_FT_3[] = { SRA_NAME ( READ_FILTER_REDACTED ) };
-const char SRA_FT_4[] = { "unknown read-filter" };
-
-const char *vdcd_get_read_filter_txt( const uint32_t id )
-{
-    switch( id )
-    {
-        case 0 : return( SRA_FT_0 ); break;
-        case 1 : return( SRA_FT_1 ); break;
-        case 2 : return( SRA_FT_2 ); break;
-        case 3 : return( SRA_FT_3 ); break;
-    }
-    return( SRA_FT_4 );
-}
-
-/* hardcoded values taken from asm-trace/interface/sra/sradb.h */
-#define SRA_KEY_PLATFORM_ID "INSDC:SRA:platform_id"
-#define SRA_KEY_XREAD_TYPE "INSDC:SRA:xread_type"
-#define SRA_KEY_READ_TYPE "INSDC:SRA:read_type"
-#define SRA_KEY_READ_FILTER "INSDC:SRA:read_filter"
-#define SRA_PACBIO_HOLE_STATUS "PacBio:hole:status"
-
-
-static bool vdcd_type_cmp( const VSchema *my_schema, VTypedecl * typedecl, const char * to_check )
-{
-    VTypedecl type_to_check;
-    rc_t rc = VSchemaResolveTypedecl ( my_schema, &type_to_check, to_check );
-    if ( rc == 0 )
-    {
-        return VTypedeclToTypedecl ( typedecl, my_schema, &type_to_check, NULL, NULL );
-    }
-    return false;
-}
-
-
-static value_trans_fct_t vdcd_get_value_trans_fct( const VSchema *my_schema, VTypedecl * typedecl )
-{
-    value_trans_fct_t res = NULL;
-
-    if ( my_schema == NULL ) return res;
-    if ( typedecl == NULL ) return res;
-
-    if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_PLATFORM_ID ) )
-    {
-        res = vdcd_get_platform_txt;
-    }
-    else if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_XREAD_TYPE ) )
-    {
-        res = vdcd_get_read_type_txt;
-    }
-    else if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_READ_TYPE ) )
-    {
-        res = vdcd_get_read_type_txt;
-    }
-    else if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_READ_FILTER ) )
-    {
-        res = vdcd_get_read_filter_txt;
-    }
-    else if ( vdcd_type_cmp( my_schema, typedecl, SRA_PACBIO_HOLE_STATUS ) )
-    {
-        res = vdcd_get_hole_status_txt;
-    }
-
-    return res;
-}
-
-
-/* implementation of the dimension-translation-functions */
-static char *vdcd_get_read_desc_txt( const uint8_t * src )
-{
-    char *res = calloc( 1, 120 );
-    SRAReadDesc desc;
-    memmove( &desc, src, sizeof( desc ) );
-    string_printf ( res, 119, NULL,
-              "seg.start=%u, seg.len=%u, type=%u, cs_key=%u, label=%s",
-              desc.seg.start, desc.seg.len, desc.type,
-              desc.cs_key, desc.label );
-    return res;
-}
-
-static char *vdcd_get_spot_desc_txt( const uint8_t *src )
-{
-    char *res = calloc( 1, 120 );
-    SRASpotDesc desc;
-    memmove( &desc, src, sizeof( desc ) );
-    string_printf ( res, 119, NULL,
-              "spot_len=%u, fixed_len=%u, signal_len=%u, clip_qual_right=%u, num_reads=%u",
-              desc.spot_len, desc.fixed_len, desc.signal_len,
-              desc.clip_qual_right, desc.num_reads );
-    return res;
-}
-
-/* hardcoded values taken from asm-trace/interface/sra/sradb.h */
-#define SRA_KEY_READ_DESC "NCBI:SRA:ReadDesc"
-#define SRA_KEY_SPOT_DESC "NCBI:SRA:SpotDesc"
-
-static dim_trans_fct_t vdcd_get_dim_trans_fct( const VSchema *my_schema, VTypedecl * typedecl )
-{
-    dim_trans_fct_t res = NULL;
-
-    if ( my_schema == NULL ) return res;
-    if ( typedecl == NULL ) return res;
-
-    if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_READ_DESC ) )
-    {
-        res = vdcd_get_read_desc_txt;
-    }
-    else if ( vdcd_type_cmp( my_schema, typedecl, SRA_KEY_SPOT_DESC ) )
-    {
-        res = vdcd_get_spot_desc_txt;
-    }
-/*
-    if ( strcmp( name, SRA_KEY_READ_DESC ) == 0 )
-    {
-        res = vdcd_get_read_desc_txt;
-    }
-    else if ( strcmp( name, SRA_KEY_SPOT_DESC ) == 0 )
-    {
-        res = vdcd_get_spot_desc_txt;
-    }
-*/
-    return res;
-}
-
-
-const char * const_s_Ascii = "Ascii";
-const char * const_s_Unicode = "Unicode";
-const char * const_s_Uint = "Uint";
-const char * const_s_Int = "Int";
-const char * const_s_Float = "Float";
-const char * const_s_Bool = "Bool";
-const char * const_s_Unknown = "unknown";
-
-char *vdcd_make_domain_txt( const uint32_t domain )
-{
-    char* res= NULL;
-    switch( domain )
-    {
-        case vtdAscii   : res = string_dup_measure( const_s_Ascii, NULL ); break;
-        case vtdUnicode : res = string_dup_measure( const_s_Unicode, NULL ); break;
-        case vtdUint    : res = string_dup_measure( const_s_Uint, NULL ); break;
-        case vtdInt     : res = string_dup_measure( const_s_Int, NULL ); break;
-        case vtdFloat   : res = string_dup_measure( const_s_Float, NULL ); break;
-        case vtdBool    : res = string_dup_measure( const_s_Bool, NULL ); break;
-        default : res = string_dup_measure( const_s_Unknown, NULL ); break;
-    }
-    return res;
-}
-
-/* a single column-definition */
-p_col_def vdcd_init_col( const char* name, const size_t str_limit )
-{
-    p_col_def res = NULL;
-    if ( name == NULL ) return res;
-    if ( name[0] == 0 ) return res;
-    res = ( p_col_def )calloc( 1, sizeof( col_def ) );
-    if ( res != NULL )
-    {
-        res->name = string_dup_measure ( name, NULL );
-        vds_make( &( res->content ), str_limit, DUMP_STR_INC );
-    }
-    return res;
-}
-
-void vdcd_destroy_col( p_col_def col_def )
-{
-    if ( col_def == NULL ) return;
-    if ( col_def->name ) free( col_def->name );
-    vds_free( &( col_def->content ) );
-    free( col_def );
-}
-
-/* a vector of column-definitions */
-bool vdcd_init( col_defs** defs, const size_t str_limit )
-{
-    bool res = false;
-    if ( defs == NULL ) return res;
-    (*defs) = calloc( 1, sizeof( col_defs ) );
-    if ( *defs )
-    {
-        VectorInit( &((*defs)->cols), 0, 5 );
-        (*defs)->max_colname_chars = 0;
-        res = true;
-    }
-    ( *defs )->str_limit = str_limit;
-    return res;
-}
-
-static void CC vdcd_destroy_node( void* node, void* data )
-{
-    vdcd_destroy_col( (p_col_def)node );
-}
-
-void vdcd_destroy( col_defs* defs )
-{
-    if ( defs == NULL ) return;
-    VectorWhack( &(defs->cols), vdcd_destroy_node, NULL );
-    free( defs );
-}
-
-static p_col_def vdcd_append_col( col_defs* defs, const char* name )
-{
-    p_col_def new_col = vdcd_init_col( name, defs->str_limit );
-    if ( new_col != NULL )
-    {
-        if ( VectorAppend( &(defs->cols), NULL, new_col ) == 0 )
-        {
-            int len = string_size( name );
-            if ( len > defs->max_colname_chars )
-                defs->max_colname_chars = len;
-        }
-    }
-    return new_col;
-}
-
-
-bool vdcd_parse_string( col_defs* defs, const char* src, const VTable *my_table )
-{
-    uint32_t count = 0;
-    char colname[MAX_COL_NAME_LEN+1];
-    size_t i_dest = 0;
-    if ( defs == NULL ) return false;
-    if ( src == NULL ) return false;
-    while ( *src )
-    {
-        if ( *src == ',' )
-        {
-            if ( i_dest > 0 )
-            {
-                colname[i_dest]=0;
-                vdcd_append_col( defs, colname );
-            }
-            i_dest = 0;
-        }
-        else
-        {
-            if ( i_dest < MAX_COL_NAME_LEN ) colname[i_dest++]=*src;
-        }
-        src++;
-    }
-    if ( i_dest > 0 )
-    {
-        colname[i_dest]=0;
-        vdcd_append_col( defs, colname );
-    }
-    count = VectorLength( &(defs->cols) ) > 0;
-    if ( count > 0 && my_table != NULL )
-    {
-        const VCursor *my_cursor;
-        rc_t rc = VTableCreateCursorRead( my_table, &my_cursor );
-        DISP_RC( rc, "VTableCreateCursorRead() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t found = 0;
-            uint32_t idx;
-            for ( idx = 0; idx < count && rc == 0; ++idx )
-            {
-                col_def *col = ( col_def * )VectorGet( &(defs->cols), idx );
-                if ( col != NULL )
-                {
-                    rc = VCursorAddColumn( my_cursor, &(col->idx), col->name );
-                    DISP_RC( rc, "VCursorAddColumn() failed" );
-                    if ( rc == 0 )
-                    {
-                        rc = VCursorDatatype( my_cursor, col->idx,
-                                  &(col->type_decl), &(col->type_desc) );
-                        DISP_RC( rc, "VCursorDatatype() failed" );
-                        if ( rc == 0 )
-                            found++;
-                    }
-                }
-            }
-            count = found;
-            rc = VCursorRelease( my_cursor );
-            DISP_RC( rc, "VCursorRelease() failed" );
-        }
-    }
-    return ( count > 0 );
-}
-
-
-bool vdcd_extract_from_table( col_defs* defs, const VTable *my_table )
-{
-    bool col_defs_found = false;
-    KNamelist *names;
-    rc_t rc = VTableListCol( my_table, &names );
-    DISP_RC( rc, "VTableListCol() failed" );
-    if ( rc == 0 )
-    {
-        const VCursor *my_cursor;
-        rc = VTableCreateCursorRead( my_table, &my_cursor );
-        DISP_RC( rc, "VTableCreateCursorRead() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t n;
-            uint32_t found = 0;
-            rc = KNamelistCount( names, &n );
-            DISP_RC( rc, "KNamelistCount() failed" );
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for ( i = 0; i < n && rc ==0; ++i )
-                {
-                    const char *col_name;
-                    rc = KNamelistGet( names, i, &col_name );
-                    DISP_RC( rc, "KNamelistGet() failed" );
-                    if ( rc == 0 )
-                    {
-                        p_col_def def = vdcd_append_col( defs, col_name );
-                        rc = VCursorAddColumn( my_cursor, &(def->idx), def->name );
-                        DISP_RC( rc, "VCursorAddColumn() failed" );
-                        if ( rc == 0 )
-                        {
-                            rc = VCursorDatatype( my_cursor, def->idx,
-                                      &(def->type_decl), &(def->type_desc) );
-                            DISP_RC( rc, "VCursorDatatype() failed" );
-                            if ( rc == 0 )
-                            {
-                                found++;
-                            }
-                        }
-                    }
-                }
-                col_defs_found = ( found > 0 );
-            }
-            rc = VCursorRelease( my_cursor );
-            DISP_RC( rc, "VCursorRelease() failed" );
-        }
-        rc = KNamelistRelease( names );
-        DISP_RC( rc, "KNamelistRelease() failed" );
-    }
-    return col_defs_found;
-}
-
-
-bool vdcd_extract_from_phys_table( col_defs* defs, const VTable *my_table )
-{
-    bool col_defs_found = false;
-    KNamelist *names;
-    rc_t rc = VTableListPhysColumns( my_table, &names );
-    DISP_RC( rc, "VTableListPhysColumns() failed" );
-    if ( rc == 0 )
-    {
-        uint32_t n;
-        uint32_t found = 0;
-        rc = KNamelistCount( names, &n );
-        DISP_RC( rc, "KNamelistCount() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-            for ( i = 0; i < n && rc == 0; ++i )
-            {
-                const char *col_name;
-                rc = KNamelistGet( names, i, &col_name );
-                DISP_RC( rc, "KNamelistGet() failed" );
-                if ( rc == 0 )
-                {
-                    vdcd_append_col( defs, col_name );
-                    found++;
-                }
-            }
-            col_defs_found = ( found > 0 );
-        }
-        rc = KNamelistRelease( names );
-        DISP_RC( rc, "KNamelistRelease() failed" );
-    }
-    return col_defs_found;
-}
-
-typedef struct add_2_cur_context
-{
-    const VCursor *my_cursor;
-    uint32_t count;
-} add_2_cur_context;
-typedef add_2_cur_context* p_add_2_cur_context;
-
-static void CC vdcd_add_1_to_cursor( void *item, void *data )
-{
-    rc_t rc;
-    p_col_def my_col_def = (p_col_def)item;
-    p_add_2_cur_context ctx = (p_add_2_cur_context)data;
-
-    if ( my_col_def == NULL ) return;
-    if ( ctx == NULL ) return;
-    if ( ctx->my_cursor == NULL ) return;
-    rc = VCursorAddColumn( ctx->my_cursor, &(my_col_def->idx), my_col_def->name );
-    DISP_RC( rc, "VCursorAddColumn() failed" );
-
-    /***************************************************************************
-    !!! extract type information !!!
-    **************************************************************************/
-    if ( rc == 0 )
-    {
-        rc = VCursorDatatype( ctx->my_cursor, my_col_def->idx,
-                              &(my_col_def->type_decl), &(my_col_def->type_desc) );
-        DISP_RC( rc, "VCursorDatatype() failed" );
-        if ( rc == 0 )
-        {
-            ctx->count++;
-            my_col_def->valid = true;
-        }
-    }
-}
-
-bool vdcd_add_to_cursor( col_defs* defs, const VCursor *my_cursor )
-{
-    add_2_cur_context ctx;
-    ctx.count = 0;
-    ctx.my_cursor = my_cursor;
-    VectorForEach( &(defs->cols), false, vdcd_add_1_to_cursor, &ctx );
-    return ( ctx.count > 0 );
-}
-
-static void CC vdcd_reset_1_content( void *item, void *data )
-{
-    rc_t rc;
-    p_col_def my_col_def = (p_col_def)item;
-    if ( my_col_def == NULL ) return;
-    rc = vds_clear( &(my_col_def->content) );
-    DISP_RC( rc, "dump_str_clear() failed" );
-}
-
-void vdcd_reset_content( col_defs* defs )
-{
-    VectorForEach( &(defs->cols), false,
-                   vdcd_reset_1_content, NULL );
-}
-
-static void CC vdcd_ins_1_trans_fkt( void *item, void *data )
-{
-    p_col_def my_col_def = ( p_col_def )item;
-    const VSchema *my_schema = ( const VSchema * )data;
-
-    if ( my_col_def == NULL ) return;
-    if ( my_schema == NULL ) return;
-
-    /* resolves special sra-types and retrieves the addr of
-       a function that later can translate the values into plain-text
-       --- is defined in this file! */
-    my_col_def->value_trans_fct = vdcd_get_value_trans_fct( my_schema, &(my_col_def->type_decl) );
-    my_col_def->dim_trans_fct = vdcd_get_dim_trans_fct( my_schema, &(my_col_def->type_decl) );
-}
-
-void vdcd_ins_trans_fkt( col_defs* defs, const VSchema *my_schema )
-{
-    if ( defs == NULL ) return;
-    if ( my_schema == NULL ) return;
-    VectorForEach( &(defs->cols), false,
-                   vdcd_ins_1_trans_fkt, (void*)my_schema );
-}
-
-
-static void CC vdcd_exclude_column_cb( void *item, void *data )
-{
-    const char * s = (const char *)data;
-    p_col_def my_col_def = (p_col_def)item;
-    if ( s == NULL || my_col_def == NULL ) return;
-    if ( strcmp( my_col_def->name, s ) == 0 )
-        my_col_def->excluded = true;
-}
-
-
-void vdcd_exclude_this_column( col_defs* defs, const char* column_name )
-{
-    VectorForEach( &(defs->cols), false, vdcd_exclude_column_cb, (void*)column_name );
-}
-
-void vdcd_exclude_these_columns( col_defs* defs, const char* column_names )
-{
-    char colname[MAX_COL_NAME_LEN+1];
-    size_t i_dest = 0;
-    if ( defs == NULL || column_names == NULL ) return;
-    while ( *column_names )
-    {
-        if ( *column_names == ',' )
-        {
-            if ( i_dest > 0 )
-            {
-                colname[i_dest]=0;
-                vdcd_exclude_this_column( defs, colname );
-            }
-            i_dest = 0;
-        }
-        else
-        {
-            if ( i_dest < MAX_COL_NAME_LEN ) colname[i_dest++]=*column_names;
-        }
-        column_names++;
-    }
-    if ( i_dest > 0 )
-    {
-        colname[i_dest]=0;
-        vdcd_exclude_this_column( defs, colname );
-    }
-}
diff --git a/tools/vdb-dump/vdb-dump-coldefs.h b/tools/vdb-dump/vdb-dump-coldefs.h
deleted file mode 100644
index d45b66a..0000000
--- a/tools/vdb-dump/vdb-dump-coldefs.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_coldefs_
-#define _h_vdb_dump_coldefs_
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/database.h>
-#include <klib/vector.h>
-#include <klib/text.h>
-
-#include "vdb-dump-str.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-const char *get_platform_txt( const uint32_t id );
-const char *get_read_type_txt( const uint32_t id );
-const char *get_read_filter_txt( const uint32_t id );
-*/
-
-typedef const char* (*value_trans_fct_t)( const uint32_t id );
-typedef char* (*dim_trans_fct_t)( const uint8_t *src );
-
-/********************************************************************
-col-def is the definition of a single column: name/index/type
-********************************************************************/
-typedef struct col_def
-{
-    char *name;
-    uint32_t idx;
-    uint64_t elementsum;
-    bool valid;
-    bool excluded;
-    VTypedecl type_decl;
-    VTypedesc type_desc;
-    dump_str content;
-    value_trans_fct_t value_trans_fct;
-    dim_trans_fct_t dim_trans_fct;
-} col_def;
-typedef col_def* p_col_def;
-
-/********************************************************************
-the col-defs are a vector of single column-definitions
-********************************************************************/
-typedef struct col_defs
-{
-    Vector cols;
-    uint16_t max_colname_chars;
-    size_t str_limit;
-} col_defs;
-typedef col_defs* p_col_defs;
-
-#define MAX_COL_NAME_LEN 64
-
-char *vdcd_make_domain_txt( const uint32_t domain );
-
-bool vdcd_init( col_defs** defs, const size_t str_limit );
-void vdcd_destroy( col_defs* defs );
-
-bool vdcd_parse_string( col_defs* defs, const char* src, const VTable *my_table );
-bool vdcd_extract_from_table( col_defs* defs, const VTable *my_table );
-bool vdcd_extract_from_phys_table( col_defs* defs, const VTable *my_table );
-bool vdcd_add_to_cursor( col_defs* defs, const VCursor *my_cursor );
-void vdcd_reset_content( col_defs* defs );
-void vdcd_ins_trans_fkt( col_defs* defs, const VSchema *my_schema );
-void vdcd_exclude_these_columns( col_defs* defs, const char* column_names );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-context.c b/tools/vdb-dump/vdb-dump-context.c
deleted file mode 100644
index 6c3d4ef..0000000
--- a/tools/vdb-dump/vdb-dump-context.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-context.h"
-#include "vdb-dump-helper.h"
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <kapp/args.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-/********************************************************************
-the dump context contains all informations needed to execute the dump
-********************************************************************/
-
-static rc_t vdco_set_str( char **dst, const char *src )
-{
-    size_t len;
-    if ( dst == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( *dst != NULL )
-    {
-        free( *dst );
-        *dst = NULL;
-    }
-    if ( src == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    len = string_size( src );
-    if ( len == 0 )
-    {
-        return RC( rcVDB, rcNoTarg, rcWriting, rcItem, rcEmpty );
-    }
-    *dst = (char*)malloc( len + 1 );
-    if ( *dst == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcWriting, rcMemory, rcExhausted );
-    }
-    string_copy( *dst, len+1, src, len );
-    return 0;
-}
-
-static void vdco_init_values( p_dump_context ctx )
-{
-    ctx->path = NULL;
-    ctx->table = NULL;
-    ctx->columns = NULL;
-    ctx->excluded_columns = NULL;
-    ctx->filter = NULL;
-
-    ctx->print_row_id = true;
-    ctx->print_in_hex = false;
-    ctx->lf_after_row = 1;
-    ctx->print_column_names = true;
-    ctx->print_dna_bases = false;
-    ctx->max_line_len = 0;
-    ctx->indented_line_len = 0;
-
-    ctx->help_requested = false;
-    ctx->usage_requested = false;
-    ctx->schema_dump_requested = false;
-    ctx->table_enum_requested = false;
-    ctx->version_requested = false;
-    ctx->column_enum_requested = false;
-    ctx->column_enum_short = false;
-    ctx->id_range_requested = false;
-    ctx->without_sra_types = false;
-    ctx->dont_check_accession = false;
-    ctx->print_num_elem = false;
-    ctx->objver_requested = false;
-    ctx->objtype_requested = false;
-    ctx->check_curl = false;
-}
-
-rc_t vdco_init( dump_context **ctx )
-{
-    rc_t rc = 0;
-    if ( ctx == NULL )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        (*ctx) = (p_dump_context)calloc( 1, sizeof **ctx );
-        if ( *ctx == NULL )
-        {
-            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-        }
-        if ( rc == 0 )
-        {
-            VectorInit( &((*ctx)->schema_list), 0, 5 );
-            vdco_init_values( *ctx );
-            rc = vdn_make( &((*ctx)->row_generator) );
-            DISP_RC( rc, "num_gen_make() failed" );
-        }
-    }
-    return rc;
-}
-
-static void CC vdco_schema_list_entry_whack( void *item, void *data )
-{
-    free( item );
-}
-
-rc_t vdco_destroy( p_dump_context ctx )
-{
-    rc_t rc = 0;
-    if ( ctx == NULL )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcDestroying, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        VectorWhack( &(ctx->schema_list),
-                     vdco_schema_list_entry_whack, NULL );
-        if ( ctx->table != NULL )
-        {
-            free( (void*)ctx->table );
-            ctx->table = NULL;
-        }
-        if ( ctx->columns != NULL )
-        {
-            free( (void*)ctx->columns );
-            ctx->columns = NULL;
-        }
-        if ( ctx->excluded_columns != NULL )
-        {
-            free( (void*)ctx->excluded_columns );
-            ctx->excluded_columns = NULL;
-        }
-        vdn_destroy( ctx->row_generator );
-        free( ctx );
-    }
-    return rc;
-}
-
-
-static rc_t vdco_add_schema( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        char *s = string_dup_measure ( src, NULL );
-        if ( s != NULL )
-        {
-            rc = VectorAppend( &(ctx->schema_list), NULL, s );
-            DISP_RC( rc, "VectorAppend() failed" );
-            if ( rc != 0 )
-            {
-                free( s );
-            }
-        }
-        else
-            rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    return rc;
-}
-
-static rc_t vdco_set_filter( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        rc = vdco_set_str( (char**)&(ctx->filter), src );
-        DISP_RC( rc, "dump_context_set_str() failed" );
-    }
-    return rc;
-}
-
-/* not static because can be called directly from vdb-dump.c */
-rc_t vdco_set_table( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        rc = vdco_set_str( (char**)&(ctx->table), src );
-        DISP_RC( rc, "dump_context_set_str() failed" );
-    }
-    return rc;
-}
-
-static rc_t vdco_set_columns( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        rc = vdco_set_str( (char**)&(ctx->columns), src );
-        DISP_RC( rc, "dump_context_set_str() failed" );
-    }
-    return rc;
-}
-
-static rc_t vdco_set_excluded_columns( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        rc = vdco_set_str( (char**)&(ctx->excluded_columns), src );
-        DISP_RC( rc, "dump_context_set_str() failed" );
-    }
-    return rc;
-}
-
-static rc_t vdco_set_row_range( p_dump_context ctx, const char *src )
-{
-    rc_t rc = 0;
-    if ( ( ctx == NULL )||( src == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcWriting, rcParam, rcNull );
-    }
-    if ( rc == 0 )
-    {
-        vdn_parse( ctx->row_generator, src );
-    }
-    return rc;
-}
-
-
-static bool vdco_set_format( p_dump_context ctx, const char *src )
-{
-    if ( ctx == NULL ) return false;
-    if ( src == NULL ) return false;
-    if ( strcmp( src, "csv" ) == 0 )
-        ctx->format = df_csv;
-    else if ( strcmp( src, "xml" ) == 0 )
-        ctx->format = df_xml;
-    else if ( strcmp( src, "json" ) == 0 )
-        ctx->format = df_json;
-    else if ( strcmp( src, "piped" ) == 0 )
-        ctx->format = df_piped;
-    else if ( strcmp( src, "tab" ) == 0 )
-        ctx->format = df_tab;
-    else ctx->format = df_default;
-    return true;
-}
-
-
-static bool vdco_set_boolean_char( dump_context *ctx, const char * src )
-{
-    ctx->c_boolean = 0;
-    if ( ctx == NULL ) return false;
-    if ( src == NULL ) return false;
-    if ( strcmp( src, "T" ) == 0 )
-        ctx->c_boolean = 'T';
-    else if ( strcmp( src, "1" ) == 0 )
-        ctx->c_boolean = '1';
-    return true;
-}
-
-
-static bool vdco_get_bool_option( const Args *my_args,
-                                  const char *name,
-                                  const bool def )
-{
-    bool res = def;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    DISP_RC( rc, "ArgsOptionCount() failed" );
-    if ( rc == 0 )
-        res = ( count > 0 );
-    return res;
-}
-
-static bool vdco_get_bool_neg_option( const Args *my_args,
-                                      const char *name,
-                                      const bool def )
-{
-    bool res = def;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    DISP_RC( rc, "ArgsOptionCount() failed" );
-    if ( rc == 0 )
-        res = ( count == 0 );
-    return res;
-}
-
-static uint16_t vdco_get_uint16_option( const Args *my_args,
-                                        const char *name,
-                                        const uint16_t def )
-{
-    uint16_t res = def;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    DISP_RC( rc, "ArgsOptionCount() failed" );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        const char *s;
-        rc = ArgsOptionValue( my_args, name, 0,  &s );
-        DISP_RC( rc, "ArgsOptionValue() failed" );
-        if ( rc == 0 ) res = atoi( s );
-    }
-    return res;
-}
-
-static const char* vdco_get_str_option( const Args *my_args,
-                                        const char *name )
-{
-    const char* res = NULL;
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, name, &count );
-    DISP_RC( rc, "ArgsOptionCount() failed" );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        rc = ArgsOptionValue( my_args, name, 0, &res );
-        DISP_RC( rc, "ArgsOptionValue() failed" );
-    }
-    return res;
-}
-
-void vdco_set_schemas( const Args *my_args, p_dump_context ctx )
-{
-    uint32_t count;
-    rc_t rc = ArgsOptionCount( my_args, OPTION_SCHEMA, &count );
-    DISP_RC( rc, "ArgsOptionCount() failed" );
-    if ( ( rc == 0 )&&( count > 0 ) )
-    {
-        uint32_t i;
-        for ( i=0; i<count; ++i )
-        {
-            const char* txt = NULL;
-            rc = ArgsOptionValue( my_args, OPTION_SCHEMA, i, &txt );
-            DISP_RC( rc, "ArgsOptionValue() failed" );
-            if ( ( rc == 0 )&&( txt != NULL ) )
-            {
-                rc = vdco_add_schema( ctx, txt );
-                DISP_RC( rc, "dump_context_add_schema() failed" );
-            }
-        }
-    }
-}
-
-
-size_t vdco_schema_count( p_dump_context ctx )
-{
-    if ( ctx == NULL ) return 0;
-    return VectorLength( &(ctx->schema_list ) );
-}
-
-static void vdco_evaluate_options( const Args *my_args,
-                                   dump_context *ctx )
-{
-    if ( my_args == NULL ) return;
-    if ( ctx == NULL ) return;
-
-    ctx->help_requested = vdco_get_bool_option( my_args, OPTION_HELP, false );
-    ctx->print_row_id = vdco_get_bool_option( my_args, OPTION_ROW_ID_ON, false );
-    ctx->lf_after_row = vdco_get_uint16_option( my_args, OPTION_LINE_FEED, 1 );
-    ctx->print_column_names = vdco_get_bool_neg_option( my_args, OPTION_COLNAME_OFF, true );
-    ctx->print_in_hex = vdco_get_bool_option( my_args, OPTION_IN_HEX, false );
-    ctx->schema_dump_requested = vdco_get_bool_option( my_args, OPTION_SCHEMA_DUMP, false );
-    ctx->table_enum_requested = vdco_get_bool_option( my_args, OPTION_TABLE_ENUM, false );
-    ctx->version_requested = vdco_get_bool_option( my_args, OPTION_VERSION, false );
-    ctx->column_enum_requested = vdco_get_bool_option( my_args, OPTION_COLUMN_ENUM, false );
-    ctx->column_enum_short = vdco_get_bool_option( my_args, OPTION_COLUMN_SHORT, false );
-    ctx->print_dna_bases = vdco_get_bool_option( my_args, OPTION_DNA_BASES, false );
-    ctx->objver_requested = vdco_get_bool_option( my_args, OPTION_OBJVER, false );
-    ctx->objtype_requested = vdco_get_bool_option( my_args, OPTION_OBJTYPE, false );
-    ctx->max_line_len = vdco_get_uint16_option( my_args, OPTION_MAX_LINE_LEN, 0 );
-    ctx->indented_line_len = vdco_get_uint16_option( my_args, OPTION_LINE_INDENT, 0 );
-    ctx->id_range_requested = vdco_get_bool_option( my_args, OPTION_ID_RANGE, false );
-    vdco_set_format( ctx, vdco_get_str_option( my_args, OPTION_FORMAT ) );
-    ctx->without_sra_types = vdco_get_bool_option( my_args, OPTION_WITHOUT_SRA, false );
-    ctx->dont_check_accession = vdco_get_bool_option( my_args, OPTION_WITHOUT_ACCESSION, false );
-    ctx->print_num_elem = vdco_get_bool_option( my_args, OPTION_NUMELEM, false );
-    ctx->sum_num_elem = vdco_get_bool_option( my_args, OPTION_NUMELEMSUM, false );
-    ctx->show_blobbing = vdco_get_bool_option( my_args, OPTION_SHOW_BLOBBING, false );
-    ctx->enum_phys = vdco_get_bool_option( my_args, OPTION_ENUM_PHYS, false );
-    ctx->check_curl = vdco_get_bool_option( my_args, OPTION_CHECK_CURL, false );
-
-    vdco_set_table( ctx, vdco_get_str_option( my_args, OPTION_TABLE ) );
-    vdco_set_columns( ctx, vdco_get_str_option( my_args, OPTION_COLUMNS ) );
-    vdco_set_excluded_columns( ctx, vdco_get_str_option( my_args, OPTION_EXCLUDED_COLUMNS ) );
-    vdco_set_row_range( ctx, vdco_get_str_option( my_args, OPTION_ROWS ) );
-    vdco_set_schemas( my_args, ctx );
-    vdco_set_filter( ctx, vdco_get_str_option( my_args, OPTION_FILTER ) );
-    vdco_set_boolean_char( ctx, vdco_get_str_option( my_args, OPTION_BOOLEAN ) );
-}
-
-rc_t vdco_capture_arguments_and_options( const Args * args, dump_context *ctx)
-{
-    rc_t rc;
-
-    vdco_evaluate_options( args, ctx );
-
-    rc = ArgsHandleLogLevel( args );
-    DISP_RC( rc, "ArgsHandleLogLevel() failed" );
-    return rc;
-}
diff --git a/tools/vdb-dump/vdb-dump-context.h b/tools/vdb-dump/vdb-dump-context.h
deleted file mode 100644
index 19bcdb5..0000000
--- a/tools/vdb-dump/vdb-dump-context.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_context_
-#define _h_vdb_dump_context_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-#include <kapp/args.h>
-#include <klib/vector.h>
-#include "vdb-dump-num-gen.h"
-
-#define OPTION_ROW_ID_ON         "row_id_on"
-#define OPTION_LINE_FEED         "line_feed"
-#define OPTION_COLNAME_OFF       "colname_off"
-#define OPTION_IN_HEX            "in_hex"
-#define OPTION_TABLE             "table"
-#define OPTION_ROWS              "rows"
-#define OPTION_COLUMNS           "columns"
-#define OPTION_SCHEMA            "schema"
-#define OPTION_SCHEMA_DUMP       "schema_dump"
-#define OPTION_TABLE_ENUM        "table_enum"
-#define OPTION_COLUMN_ENUM       "column_enum"
-#define OPTION_COLUMN_SHORT      "column_enum_short"
-#define OPTION_DNA_BASES         "dna_bases"
-#define OPTION_MAX_LINE_LEN      "max_length"
-#define OPTION_LINE_INDENT       "indent_width"
-#define OPTION_FILTER            "filter"
-#define OPTION_FORMAT            "format"
-#define OPTION_ID_RANGE          "id_range"
-#define OPTION_WITHOUT_SRA       "without_sra"
-#define OPTION_WITHOUT_ACCESSION "without_accession"
-#define OPTION_EXCLUDED_COLUMNS  "exclude"
-#define OPTION_BOOLEAN           "boolean"
-#define OPTION_OBJVER            "obj_version"
-#define OPTION_OBJTYPE           "obj_type"
-#define OPTION_NUMELEM           "numelem"
-#define OPTION_NUMELEMSUM        "numelemsum"
-#define OPTION_SHOW_BLOBBING     "blobbing"
-#define OPTION_ENUM_PHYS         "phys"
-#define OPTION_CHECK_CURL        "check-curl"
-
-#define ALIAS_ROW_ID_ON         "I"
-#define ALIAS_LINE_FEED         "l"
-#define ALIAS_COLNAME_OFF       "N"
-#define ALIAS_IN_HEX            "X"
-#define ALIAS_TABLE             "T"
-#define ALIAS_ROWS              "R"
-#define ALIAS_COLUMNS           "C"
-#define ALIAS_SCHEMA            "S"
-#define ALIAS_SCHEMA_DUMP       "A"
-#define ALIAS_TABLE_ENUM        "E"
-#define ALIAS_COLUMN_ENUM       "O"
-#define ALIAS_COLUMN_SHORT      "o"
-#define ALIAS_DNA_BASES         "D"
-#define ALIAS_MAX_LINE_LEN      "M"
-#define ALIAS_LINE_INDENT       "i"
-#define ALIAS_FILTER            "F"
-#define ALIAS_FORMAT            "f"
-#define ALIAS_ID_RANGE          "r"
-#define ALIAS_WITHOUT_SRA       "n"
-#define ALIAS_WITHOUT_ACCESSION "a"
-#define ALIAS_EXCLUDED_COLUMNS  "x"
-#define ALIAS_BOOLEAN           "b"
-#define ALIAS_OBJVER            "j"
-#define ALIAS_OBJTYPE           "y"
-#define ALIAS_NUMELEM           "u"
-#define ALIAS_NUMELEMSUM        "U"
-
-typedef enum dump_format_t
-{
-    df_default,
-    df_csv,
-    df_xml,
-    df_json,
-    df_piped,
-    df_tab
-} dump_format_t;
-
-/********************************************************************
-the dump context contains all informations needed to execute the dump
-********************************************************************/
-typedef struct dump_context
-{
-    const char *path;
-    Vector schema_list;
-    const char *table;
-    const char *columns;
-    const char *excluded_columns;
-    const char *filter;
-    num_gen *row_generator;
-    bool print_row_id;
-    uint16_t lf_after_row;
-    uint16_t max_line_len;
-    uint16_t indented_line_len;
-    uint32_t generic_idx;
-    dump_format_t format;
-    char c_boolean;
-
-    bool print_column_names;
-    bool print_in_hex;
-    bool print_dna_bases;
-    bool help_requested;
-    bool usage_requested;
-    bool schema_dump_requested;
-    bool table_enum_requested;
-    bool version_requested;
-    bool column_enum_requested;
-    bool column_enum_short;
-    bool id_range_requested;
-    bool without_sra_types;
-    bool dont_check_accession;
-    bool objver_requested;
-    bool objtype_requested;
-    bool print_num_elem;
-    bool sum_num_elem;
-    bool show_blobbing;
-    bool enum_phys;
-    bool check_curl;
-} dump_context;
-typedef dump_context* p_dump_context;
-
-
-rc_t vdco_init( dump_context **ctx );
-rc_t vdco_destroy( p_dump_context ctx );
-
-size_t vdco_schema_count( p_dump_context ctx );
-
-void vdco_show_usage( p_dump_context ctx );
-void vdco_show_help( p_dump_context ctx );
-
-rc_t vdco_set_table( p_dump_context ctx, const char *src );
-
-rc_t vdco_capture_arguments_and_options( const Args * args, dump_context *ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-filter.c b/tools/vdb-dump/vdb-dump-filter.c
deleted file mode 100644
index 962f0e7..0000000
--- a/tools/vdb-dump/vdb-dump-filter.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-filter.h"
-#include <klib/text.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <os-native.h>
-#include <sysalloc.h>
-
-bool vdfi_make_filter( filter **flt, const char *expression )
-{
-    bool res = false;
-    if ( flt == NULL ) return res;
-    (*flt) = malloc( sizeof( flt ) );
-    if ( *flt )
-    {
-        (*flt)->expression = string_dup_measure( expression, NULL );
-        (*flt)->filter_type = filter_unknown;
-        res = true;
-    }
-    return res;
-}
-
-void vdfi_destroy_filter( p_filter flt )
-{
-    if ( flt == NULL ) return;
-    free( flt->expression );
-    free( flt );
-}
-
-bool vdfi_make( filters **flts )
-{
-    bool res = false;
-    if ( flts == NULL ) return res;
-    (*flts) = malloc( sizeof( filters ) );
-    if ( *flts )
-    {
-        VectorInit( &( (*flts)->filters ), 0, 5 );
-        (*flts)->match = false;
-        (*flts)->count = 0;
-        res = true;
-    }
-    return res;
-}
-
-static void CC vdfi_destroy_filter_1( void* node, void* data )
-{
-    vdfi_destroy_filter( (p_filter)node );
-}
-
-void vdfi_destroy( p_filters flts )
-{
-    if ( flts == NULL ) return;
-    VectorWhack( &(flts->filters), vdfi_destroy_filter_1, NULL );
-    free( flts );
-}
-
-bool vdfi_new_filter( p_filters flts, const char *expression )
-{
-    bool res = false;
-    filter *new_filter;
-    if ( flts == NULL ) return res;
-    if ( expression == NULL ) return res;
-    if ( expression[0] == 0 ) return res;
-    if ( vdfi_make_filter( &new_filter, expression ) )
-    {
-        res = ( VectorAppend( &(flts->filters), NULL, new_filter ) == 0 );
-        if ( res ) flts->count++;
-    }
-    return res;
-}
-
-void vdfi_reset( p_filters flts )
-{
-    if ( flts == NULL ) return;
-    flts->match = false;
-}
-
-bool vdfi_match( p_filters flts )
-{
-    if ( flts == NULL ) return false;
-    return flts->match;
-}
-
-uint16_t vdfi_count( p_filters flts )
-{
-    if ( flts == NULL ) return 0;
-    return flts->count;
-}
diff --git a/tools/vdb-dump/vdb-dump-filter.h b/tools/vdb-dump/vdb-dump-filter.h
deleted file mode 100644
index 47909fe..0000000
--- a/tools/vdb-dump/vdb-dump-filter.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_filter_
-#define _h_vdb_dump_filter_
-
-#include <klib/vector.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum filter_t
-{
-    filter_unknown,
-    filter_bool,
-    filter_integer,
-    filter_float,
-    filter_text
-} filter_t;
-
-/********************************************************************
-the dump_filter contains a filter expression for a column
-********************************************************************/
-typedef struct filter
-{
-    filter_t filter_type;
-    char *expression;
-} filter;
-typedef filter* p_filter;
-
-void filter_dosomething( p_filter flt );
-
-bool filter_make( filter **flt, const char *expression );
-void filter_destroy( p_filter flt );
-
-/********************************************************************
-the dump_filters is a vector of column_filters...
-********************************************************************/
-typedef struct filters
-{
-    Vector filters;
-    uint16_t count;
-    bool match;
-} filters;
-typedef filters* p_filters;
-
-bool vdfi_make( filters **flts );
-void vdfi_destroy( p_filters flts );
-bool vdfi_new_filter( p_filters flts, const char *expression );
-void vdfi_reset( p_filters flts );
-bool vdfi_match( p_filters flts );
-uint16_t vdfi_count( p_filters flts );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-formats.c b/tools/vdb-dump/vdb-dump-formats.c
deleted file mode 100644
index 4b66d7a..0000000
--- a/tools/vdb-dump/vdb-dump-formats.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-formats.h"
-#include <sysalloc.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#define DISP_RC(rc,err) if( rc != 0 ) LOGERR( klogInt, rc, err );
-
-/*************************************************************************************
-    default ( with line-length-limitation and pretty print )
-*************************************************************************************/
-static void CC vdfo_print_col_default( void *item, void *data )
-{
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-    rc_t rc;
-
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc != 0 ) return;
-
-    if ( r_ctx->ctx->print_column_names )
-    {
-        rc = vds_append_fmt( &(r_ctx->s_col),
-                             r_ctx->col_defs->max_colname_chars,
-                             "%*s: ",
-                             r_ctx->col_defs->max_colname_chars,
-                             my_col_def->name );
-        DISP_RC( rc, "dump_str_append_fmt() failed" )
-    }
-
-    /* append the cell-content */
-    rc = vds_append_str( &(r_ctx->s_col), my_col_def->content.buf );
-    DISP_RC( rc, "dump_str_append_str() failed" )
-    if ( rc == 0 )
-    {
-
-        /* indent the cell-line, if requested */
-        if ( r_ctx->ctx->indented_line_len > 0 )
-        {
-            rc = vds_indent( &(r_ctx->s_col),
-                             r_ctx->ctx->indented_line_len,
-                             r_ctx->col_defs->max_colname_chars + 2 );
-            DISP_RC( rc, "dump_str_indent() failed" )
-        }
-
-        /* print a truncate-hint at the end of the line if truncated */
-        if ( vds_truncated( &(r_ctx->s_col) ) )
-        {
-            rc = vds_rinsert( &(r_ctx->s_col), " ..." );
-            DISP_RC( rc, "dump_str_rinsert() failed" )
-        }
-    }
-
-    /* FINALLY we print the content of a column... */
-    KOutMsg( "%s\n", r_ctx->s_col.buf );
-}
-
-static rc_t vdfo_print_row_default( const p_row_context r_ctx )
-{
-    rc_t rc = 0;
-    if ( r_ctx->ctx->print_row_id )
-        rc = KOutMsg( "ROW-ID = %u\n", r_ctx->row_id );
-
-    if ( rc == 0 )
-        VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_default, r_ctx );
-
-    if ( rc == 0 && r_ctx->ctx->lf_after_row > 0 )
-    {
-        uint16_t i=0;
-        while ( i++ < r_ctx->ctx->lf_after_row && rc == 0 )
-            rc = KOutMsg( "\n" );
-    }
-    return 0;
-}
-
-/*************************************************************************************
-    CSV
-*************************************************************************************/
-static void CC vdfo_print_col_csv( void *item, void *data )
-{
-    rc_t rc = 0;
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    if ( r_ctx->col_nr > 0 )
-    {
-        rc = vds_append_str( &(r_ctx->s_col), "," );
-        DISP_RC( rc, "dump_str_append_str() failed" )
-    }
-    if ( rc == 0 )
-    {
-        rc = vds_2_csv( &(my_col_def->content) );
-        DISP_RC( rc, "dump_str_2_csv() failed" )
-        if ( rc == 0 )
-        {
-            rc = vds_append_str( &(r_ctx->s_col), my_col_def->content.buf );
-            DISP_RC( rc, "dump_str_append_str() failed" )
-            r_ctx->col_nr++;
-        }
-    }
-}
-
-static rc_t vdfo_print_row_csv( const p_row_context r_ctx )
-{
-    rc_t rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc == 0 )
-    {
-        r_ctx->col_nr = 0;
-        VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_csv, r_ctx );
-        rc = KOutMsg( "%s\n", r_ctx->s_col.buf );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    XML
-*************************************************************************************/
-static void CC vdfo_print_col_xml( void *item, void *data )
-{
-    p_col_def my_col_def = (p_col_def)item;
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    KOutMsg( " <%s>\n", my_col_def->name );
-    KOutMsg( "%s", my_col_def->content.buf );
-    KOutMsg( " </%s>\n", my_col_def->name );
-}
-
-static rc_t vdfo_print_row_xml( const p_row_context r_ctx )
-{
-    rc_t rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc == 0 )
-    {
-        rc = KOutMsg( "<row>\n" );
-        if ( rc  == 0 )
-        {
-            VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_xml, r_ctx );
-            rc = KOutMsg( "</row>\n");
-        }
-    }
-    return rc;
-}
-
-
-/*************************************************************************************
-    JSON
-*************************************************************************************/
-static void CC vdfo_print_col_json( void *item, void *data )
-{
-    rc_t rc = 0;
-    p_col_def my_col_def = (p_col_def)item;
-
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    if ( ( my_col_def->type_desc.domain == vtdAscii )||
-         ( my_col_def->type_desc.domain == vtdUnicode ) )
-    {
-        rc = vds_escape( &(my_col_def->content), '"', '\\' );
-        DISP_RC( rc, "dump_str_escape() failed" )
-        if ( rc == 0 )
-        {
-            rc = vds_enclose_string( &(my_col_def->content), '"', '"' );
-            DISP_RC( rc, "dump_str_enclose_string() failed" )
-        }
-    }
-    else
-    {
-        if ( my_col_def->type_desc.intrinsic_dim > 1 )
-        {
-            rc = vds_enclose_string( &(my_col_def->content), '[', ']' );
-            DISP_RC( rc, "dump_str_enclose_string() failed" )
-        }
-    }
-
-    if ( rc == 0 )
-        KOutMsg( ",\n\"%s\":%s", my_col_def->name, my_col_def->content.buf );
-}
-
-static rc_t vdfo_print_row_json( const p_row_context r_ctx )
-{
-    rc_t rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc == 0 )
-    {
-        rc = KOutMsg( "{\n" );
-        if ( rc == 0 )
-        {
-            rc = KOutMsg( "\"row_id\": %lu", r_ctx->row_id );
-            if ( rc == 0 )
-            {
-                VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_json, r_ctx );
-                rc = KOutMsg( "\n},\n\n" );
-            }
-        }
-    }
-    return rc;
-}
-
-
-/*************************************************************************************
-    PIPED
-*************************************************************************************/
-static void CC vdfo_print_col_piped( void *item, void *data )
-{
-    rc_t rc = 0;
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    /* first we print the row_id and the column-name for every column! */
-    KOutMsg( "%lu, %s: ", r_ctx->row_id, my_col_def->name );
-
-    if ( ( my_col_def->type_desc.domain == vtdAscii )||
-         ( my_col_def->type_desc.domain == vtdUnicode ) )
-    {
-        rc = vds_escape( &(my_col_def->content), '"', '\\' );
-        DISP_RC( rc, "dump_str_escape() failed" )
-        if ( rc == 0 )
-        {
-            rc = vds_enclose_string( &(my_col_def->content), '"', '"' );
-            DISP_RC( rc, "dump_str_enclose_string() failed" )
-        }
-    }
-    else
-    {
-        if ( my_col_def->type_desc.intrinsic_dim > 1 )
-        {
-            rc = vds_enclose_string( &(my_col_def->content), '[', ']' );
-            DISP_RC( rc, "dump_str_enclose_string() failed" )
-        }
-    }
-
-    if ( rc == 0 )
-        KOutMsg( "%s\n", my_col_def->content.buf );
-}
-
-
-/*************************************************************************************
-    TAB-delimited
-*************************************************************************************/
-static void CC vdfo_print_col_tab( void *item, void *data )
-{
-    rc_t rc = 0;
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    if ( r_ctx->col_nr > 0 )
-    {
-        rc = vds_append_str( &(r_ctx->s_col), "\t" );
-        DISP_RC( rc, "dump_str_append_str() failed" )
-    }
-    if ( rc == 0 )
-    {
-        rc = vds_append_str( &(r_ctx->s_col), my_col_def->content.buf );
-        DISP_RC( rc, "dump_str_append_str() failed" )
-        r_ctx->col_nr++;
-    }
-}
-
-
-static rc_t vdfo_print_row_piped( const p_row_context r_ctx )
-{
-    rc_t rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc == 0 )
-    {
-        VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_piped, r_ctx );
-        rc = KOutMsg( "\n" );
-    }
-    return rc;
-}
-
-static rc_t vdfo_print_row_tab( const p_row_context r_ctx )
-{
-    rc_t rc = vds_clear( &(r_ctx->s_col) );
-    DISP_RC( rc, "dump_str_clear() failed" )
-    if ( rc == 0 )
-    {
-        r_ctx->col_nr = 0;
-        VectorForEach( &(r_ctx->col_defs->cols), false, vdfo_print_col_tab, r_ctx );
-        rc = KOutMsg( "%s\n", r_ctx->s_col.buf );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    print-format-switch
-*************************************************************************************/
-rc_t vdfo_print_row( const p_row_context r_ctx )
-{
-    rc_t rc = 0;
-    switch( r_ctx->ctx->format )
-    {
-    case df_default : rc = vdfo_print_row_default( r_ctx ); break;
-    case df_csv     : rc = vdfo_print_row_csv( r_ctx ); break;
-    case df_xml     : rc = vdfo_print_row_xml( r_ctx ); break;
-    case df_json    : rc = vdfo_print_row_json( r_ctx ); break;
-    case df_piped   : rc = vdfo_print_row_piped( r_ctx ); break;
-    case df_tab     : rc = vdfo_print_row_tab( r_ctx ); break;
-    default         : rc = vdfo_print_row_default( r_ctx ); break;
-    }
-    return rc;
-}
diff --git a/tools/vdb-dump/vdb-dump-formats.h b/tools/vdb-dump/vdb-dump-formats.h
deleted file mode 100644
index 34e12e5..0000000
--- a/tools/vdb-dump/vdb-dump-formats.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_formats_
-#define _h_vdb_dump_formats_
-
-#include <stdio.h>
-
-#include <klib/vector.h>
-#include <klib/rc.h>
-#include <klib/out.h>
-
-#include "vdb-dump-coldefs.h"
-#include "vdb-dump-context.h"
-#include "vdb-dump-row-context.h"
-#include "vdb-dump-str.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-rc_t vdfo_print_row( const p_row_context r_ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-helper.c b/tools/vdb-dump/vdb-dump-helper.c
deleted file mode 100644
index 2ff775e..0000000
--- a/tools/vdb-dump/vdb-dump-helper.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include <kfs/directory.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <vdb/manager.h>
-#include <vdb/database.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <os-native.h>
-#include <sysalloc.h>
-#include "vdb-dump-helper.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdarg.h>
-
-/********************************************************************
-helper function to display the version of the vdb-manager
-********************************************************************/
-rc_t vdh_show_manager_version( const VDBManager *my_manager )
-{
-    uint32_t version;
-    rc_t rc = VDBManagerVersion( my_manager, &version );
-    DISP_RC( rc, "VDBManagerVersion() failed" );
-    if ( rc == 0 )
-    {
-        PLOGMSG ( klogInfo, ( klogInfo, "manager-version = $(maj).$(min).$(rel)",
-                              "vers=0x%X,maj=%u,min=%u,rel=%u",
-                              version,
-                              version >> 24,
-                              ( version >> 16 ) & 0xFF,
-                              version & 0xFFFF ));
-    }
-    return rc;
-}
-
-static void CC vdh_parse_1_schema( void *item, void *data )
-{
-    char *s = (char*)item;
-    VSchema *my_schema = (VSchema*)data;
-    if ( ( item != NULL )&&( my_schema != NULL ) )
-    {
-        rc_t rc = VSchemaParseFile( my_schema, s );
-        DISP_RC( rc, "VSchemaParseFile() failed" );
-    }
-}
-
-rc_t vdh_parse_schema( const VDBManager *my_manager,
-                       VSchema **new_schema,
-                       Vector *schema_list )
-{
-    rc_t rc;
-
-    if ( my_manager == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    }
-    if ( new_schema == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    }
-
-    rc = VDBManagerMakeSRASchema( my_manager, new_schema );
-    DISP_RC( rc, "VDBManagerMakeSRASchema() failed" );
-
-    if ( ( rc == 0 )&&( schema_list != NULL ) )
-    {
-        VectorForEach( schema_list, false, vdh_parse_1_schema, *new_schema );
-    }
-
-/*    rc = VDBManagerMakeSchema( my_manager, new_schema );
-    display_rescode( rc, "failed to make a schema", NULL ); */
-    return rc;
-}
-
-/********************************************************************
-helper function to test if a given path is a vdb-table
-********************************************************************/
-bool vdh_is_path_table( const VDBManager *my_manager, const char *path,
-                        Vector *schema_list )
-{
-    bool res = false;
-    const VTable *my_table;
-    VSchema *my_schema = NULL;
-    rc_t rc;
-
-    rc = vdh_parse_schema( my_manager, &my_schema, schema_list );
-    DISP_RC( rc, "helper_parse_schema() failed" );
-
-    rc = VDBManagerOpenTableRead( my_manager, &my_table, my_schema, path );
-    DISP_RC( rc, "VDBManagerOpenTableRead() failed" );
-    if ( rc == 0 )
-        {
-        res = true; /* yes we are able to open the table ---> path is a table */
-        VTableRelease( my_table );
-        }
-
-    if ( my_schema != NULL )
-    {
-        rc = VSchemaRelease( my_schema );
-        DISP_RC( rc, "VSchemaRelease() failed" );
-    }
-
-    return res;
-}
-
-
-const char * backback = "/../..";
-
-/********************************************************************
-helper function to test if a given path is a vdb-column
-by testing if the parent/parent dir is a vdb-table
-********************************************************************/
-bool vdh_is_path_column( const VDBManager *my_manager, const char *path,
-                         Vector *schema_list )
-{
-    bool res = false;
-    size_t path_len = string_size( path );
-    char *pp_path = malloc( path_len + 20 );
-    if ( pp_path )
-    {
-        char *resolved = malloc( 1024 );
-        if ( resolved )
-        {
-            KDirectory *my_directory;
-            rc_t rc = KDirectoryNativeDir( &my_directory );
-            DISP_RC( rc, "KDirectoryNativeDir() failed" );
-            if ( rc == 0 )
-            {
-                string_copy( pp_path, path_len + 20, path, path_len );
-                string_copy( &pp_path[ path_len ], 20, backback, string_size( backback ) );
-                rc = KDirectoryResolvePath( my_directory, true, resolved, 1023, pp_path );
-                if ( rc == 0 )
-                    res = vdh_is_path_table( my_manager, resolved, schema_list );
-            }
-            free( resolved );
-        }
-        free( pp_path );
-    }
-    return res;
-}
-
-/********************************************************************
-helper function to test if a given path is a vdb-database
-********************************************************************/
-bool vdh_is_path_database( const VDBManager *my_manager, const char *path,
-                           Vector *schema_list )
-{
-    bool res = false;
-    const VDatabase *my_database;
-    VSchema *my_schema = NULL;
-    rc_t rc;
-
-    rc = vdh_parse_schema( my_manager, &my_schema, schema_list );
-    DISP_RC( rc, "helper_parse_schema() failed" );
-
-    rc = VDBManagerOpenDBRead( my_manager, &my_database, my_schema, path );
-    if ( rc == 0 )
-        {
-        res = true; /* yes we are able to open the database ---> path is a database */
-        VDatabaseRelease( my_database );
-        }
-
-    if ( my_schema != NULL )
-        VSchemaRelease( my_schema );
-
-    return res;
-}
-
-
-/*************************************************************************************
-helper-function to extract the name of the first table of a database
-and put it into the dump-context
-*************************************************************************************/
-bool vdh_take_1st_table_from_db( dump_context *ctx, const VDatabase *my_database )
-{
-    bool we_found_a_table = false;
-    KNamelist *tbl_names;
-    rc_t rc = VDatabaseListTbl( my_database, &tbl_names );
-    DISP_RC( rc, "VDatabaseListTbl() failed" );
-    if ( rc == 0 )
-    {
-        uint32_t n;
-        rc = KNamelistCount( tbl_names, &n );
-        DISP_RC( rc, "KNamelistCount() failed" );
-        if ( ( rc == 0 )&&( n > 0 ) )
-        {
-            const char *tbl_name;
-            rc = KNamelistGet( tbl_names, 0, &tbl_name );
-            DISP_RC( rc, "KNamelistGet() failed" );
-            if ( rc == 0 )
-            {
-                vdco_set_table( ctx, tbl_name );
-                we_found_a_table = true;
-            }
-        }
-        rc = KNamelistRelease( tbl_names );
-        DISP_RC( rc, "KNamelistRelease() failed" );
-    }
-    return we_found_a_table;
-}
-
-
-static int vdh_str_cmp( const char *a, const char *b )
-{
-    size_t asize = string_size ( a );
-    size_t bsize = string_size ( b );
-    return strcase_cmp ( a, asize, b, bsize, ( asize > bsize ) ? asize : bsize );
-}
-
-
-/*************************************************************************************
-helper-function to check if a given table is in the list of tables
-if found put that name into the dump-context
-*************************************************************************************/
-bool vdh_take_this_table_from_db( dump_context *ctx, const VDatabase *my_database,
-                                  const char * table_to_find )
-{
-    bool we_found_a_table = false;
-    KNamelist *tbl_names;
-    rc_t rc = VDatabaseListTbl( my_database, &tbl_names );
-    DISP_RC( rc, "VDatabaseListTbl() failed" );
-    if ( rc == 0 )
-    {
-        uint32_t n;
-        rc = KNamelistCount( tbl_names, &n );
-        DISP_RC( rc, "KNamelistCount() failed" );
-        if ( ( rc == 0 )&&( n > 0 ) )
-        {
-            uint32_t i;
-            for ( i = 0; i < n && rc == 0 && !we_found_a_table; ++i )
-            {
-                const char *tbl_name;
-                rc = KNamelistGet( tbl_names, i, &tbl_name );
-                DISP_RC( rc, "KNamelistGet() failed" );
-                if ( rc == 0 )
-                {
-                    if ( vdh_str_cmp( tbl_name, table_to_find ) == 0 )
-                    {
-                        vdco_set_table( ctx, tbl_name );
-                        we_found_a_table = true;
-                    }
-                }
-            }
-        }
-        rc = KNamelistRelease( tbl_names );
-        DISP_RC( rc, "KNamelistRelease() failed" );
-    }
-    return we_found_a_table;
-}
-
-
-const char * s_unknown_tab = "unknown table";
-
-static rc_t vdh_print_full_col_info( dump_context *ctx,
-                                     const p_col_def col_def,
-                                     const VSchema *my_schema )
-{
-    rc_t rc = 0;
-    char * s_domain = vdcd_make_domain_txt( col_def->type_desc.domain );
-    if ( s_domain != NULL )
-    {
-        if ( ctx->table == NULL )
-        {
-            ctx->table = string_dup_measure( s_unknown_tab, NULL ); /* will be free'd when ctx get free'd */
-        }
-
-        if ( ( ctx->table != NULL )&&( col_def->name != NULL ) )
-        {
-            rc = KOutMsg( "%s.%.02d : (%.3d bits [%.02d], %8s)  %s",
-                    ctx->table,
-                    ctx->generic_idx++,
-                    col_def->type_desc.intrinsic_bits,
-                    col_def->type_desc.intrinsic_dim,
-                    s_domain,
-                    col_def->name );
-            if ( rc == 0 && my_schema )
-            {
-                char buf[64];
-                rc = VTypedeclToText( &(col_def->type_decl), my_schema,
-                                      buf, sizeof(buf) );
-                DISP_RC( rc, "VTypedeclToText() failed" );
-                if ( rc == 0 )
-                    rc = KOutMsg( "\n      (%s)", buf );
-            }
-            if ( rc == 0 )
-                rc = KOutMsg( "\n" );
-        }
-        else
-        {
-            if ( ctx->table == NULL )
-            {
-                rc = KOutMsg( "error: no table-name in print_column_info()" );
-            }
-            if ( col_def->name == NULL )
-            {
-                rc = KOutMsg( "error: no column-name in print_column_info()" );
-            }
-        }
-        free( s_domain );
-    }
-    else
-    {
-        rc = KOutMsg( "error: making domain-text in print_column_info()" );
-    }
-    return rc;
-}
-
-
-static rc_t vdh_print_short_col_info( const p_col_def col_def,
-                                      const VSchema *my_schema )
-{
-    rc_t rc = 0;
-    if ( col_def->name != NULL )
-    {
-        rc = KOutMsg( "%s", col_def->name );
-        if ( my_schema )
-        {
-            char buf[64];
-            rc = VTypedeclToText( &(col_def->type_decl), my_schema,
-                                  buf, sizeof(buf) );
-            DISP_RC( rc, "VTypedeclToText() failed" );
-            if ( rc == 0 )
-            {
-                rc = KOutMsg( " (%s)", buf );
-            }
-        }
-        if ( rc == 0 )
-            rc = KOutMsg( "\n" );
-    }
-    return rc;
-}
-
-
-rc_t vdh_print_col_info( dump_context *ctx,
-                         const p_col_def col_def,
-                         const VSchema *my_schema )
-{
-    rc_t rc = 0;
-    if ( ctx != NULL && col_def != NULL )
-    {
-        if ( ctx->column_enum_requested )
-            rc = vdh_print_full_col_info( ctx, col_def, my_schema );
-        else
-            rc = vdh_print_short_col_info( col_def, my_schema );
-    }
-    return rc;
-}
diff --git a/tools/vdb-dump/vdb-dump-helper.h b/tools/vdb-dump/vdb-dump-helper.h
deleted file mode 100644
index d8f7424..0000000
--- a/tools/vdb-dump/vdb-dump-helper.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_helper_
-#define _h_vdb_dump_helper_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <klib/out.h>
-
-#include <klib/rc.h>
-#include <vdb/manager.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/database.h>
-#include <vdb/schema.h>
-
-#include <sra/sraschema.h>
-
-#include "vdb-dump-context.h"
-#include "vdb-dump-coldefs.h"
-
-#define DISP_RC(rc,err) (void)((rc == 0) ? 0 : LOGERR( klogInt, rc, err ))
-
-#define DISP_RC2(rc,err,succ) \
-    (void)((rc != 0)? 0 : (succ) ? LOGMSG( klogInfo, succ ) : LOGERR( klogInt, rc, err ))
-
-rc_t vdh_show_manager_version( const VDBManager *my_manager );
-
-rc_t vdh_parse_schema( const VDBManager *my_manager,
-                       VSchema **new_schema,
-                       Vector *schema_list );
-
-bool vdh_is_path_table( const VDBManager *my_manager, const char *path,
-                        Vector *schema_list );
-bool vdh_is_path_column( const VDBManager *my_manager, const char *path,
-                         Vector *schema_list );
-bool vdh_is_path_database( const VDBManager *my_manager, const char *path,
-                           Vector *schema_list );
-
-bool vdh_take_1st_table_from_db( dump_context *ctx,
-                                 const VDatabase *my_database );
-
-bool vdh_take_this_table_from_db( dump_context *ctx, const VDatabase *my_database,
-                                  const char * table_to_find );
-
-rc_t vdh_print_col_info( dump_context *ctx,
-                         const p_col_def col_def,
-                         const VSchema *my_schema );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-num-gen.c b/tools/vdb-dump/vdb-dump-num-gen.c
deleted file mode 100644
index 83fc592..0000000
--- a/tools/vdb-dump/vdb-dump-num-gen.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-num-gen.h"
-
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/out.h>
-#include <klib/text.h>
-#include <strtol.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-static void CC vdn_node_destroy( void *item, void *data )
-{
-    free( item );
-}
-
-static p_num_gen_node vdn_make_node( const uint64_t start, const uint64_t count )
-{
-    p_num_gen_node p = ( p_num_gen_node )malloc( sizeof( num_gen_node ) );
-    if ( p )
-    {
-        p->start = start;
-        p->count = count;
-    }
-    return p;
-}
-
-static int CC vdn_insert_helper( const void* item1, const void* item2 )
-{
-    int res = 0;
-    p_num_gen_node node1 = (p_num_gen_node)item1;
-    p_num_gen_node node2 = (p_num_gen_node)item2;
-    if ( node1->start < node2->start )
-        res = -1;
-    else if ( node1->start > node2->start )
-        res = 1;
-    return res;
-}
-
-static bool vdn_add_node( num_gen* generator, const uint64_t num_1,
-                          const uint64_t num_2 )
-{
-    rc_t res;
-    p_num_gen_node node = NULL;
-    if ( generator == NULL ) return false;
-    if ( num_1 == num_2 )
-        {
-        node = vdn_make_node( num_1, 1 );
-        }
-    else if ( num_1 < num_2 )
-        {
-        node = vdn_make_node( num_1, ( num_2 - num_1 ) + 1 );
-        }
-    else
-        {
-        node = vdn_make_node( num_2, ( num_1 - num_2 ) + 1 );
-        }
-    if ( node == NULL ) return false;
-    res = VectorInsert( &(generator->nodes), node, NULL, vdn_insert_helper );
-    if ( res == 0 ) generator->node_count++;
-    return ( res == 0 );
-}
-
-#define MAX_NUM_STR 12
-/* helper-structure for vdn_parse() */
-typedef struct num_gen_parse_ctx
-{
-    size_t num_str_idx, num_count;
-    uint64_t num[ 2 ];
-    char num_str[ MAX_NUM_STR + 1 ];
-} num_gen_parse_ctx;
-typedef num_gen_parse_ctx* p_num_gen_parse_ctx;
-
-/* helper for vdn_parse() */
-static void vdb_convert_ctx( p_num_gen_parse_ctx ctx )
-{
-    char *endp;
-    
-    ctx->num_str[ ctx->num_str_idx ] = 0;
-    ctx->num[ 0 ] = strtou64( ctx->num_str, &endp, 10 );
-    ctx->num_count = 1;
-    ctx->num_str_idx = 0;
-}
-
-/* helper for vdn_parse() */
-static uint32_t vdb_convert_and_add_ctx( num_gen* generator, p_num_gen_parse_ctx ctx )
-{
-    uint32_t res = 0;
-    char *endp;
-    
-    if ( ctx->num_str_idx > 0 )
-    {
-        ctx->num_str[ ctx->num_str_idx ] = 0;
-        ctx->num[ ctx->num_count ] = strtou64( ctx->num_str, &endp, 10 );
-        ctx->num_str_idx = 0;
-        if ( ctx->num_count == 0 )
-        {
-            ctx->num[1] = ctx->num[0];
-        }
-        if ( vdn_add_node( generator, ctx->num[0], ctx->num[1] ) )
-        {
-            res++;
-        }
-        ctx->num_count = 0;
-    }
-    return res;
-}
-
-uint32_t vdn_parse( num_gen* generator, const char* src )
-{
-    size_t i, n;
-    num_gen_parse_ctx ctx;
-    uint32_t res = 0;
-    
-    if ( generator == NULL ) return res;
-    if ( src == NULL ) return res;
-    n = string_size( src );
-    generator->node_count = 0;
-    generator->curr_node = 0;
-    generator->curr_node_sub_pos = 0;
-    if ( n == 0 ) return res;
-
-    ctx.num_str_idx = 0;
-    ctx.num_count = 0;
-    
-    for ( i=0; i<n; ++i )
-    {
-        switch ( src[i] )
-        {
-        /* a dash switches from N1-mode into N2-mode */
-        case '-' :
-            vdb_convert_ctx( &ctx );
-            break;
-
-        /* a comma ends a single number or a range */
-        case ',' :
-            res += vdb_convert_and_add_ctx( generator, &ctx );
-            break;
-
-        /* in both mode add the char to the temp string */
-        default:
-            if ( ( src[i]>='0' )&&( src[i]<='9' )&&( ctx.num_str_idx < MAX_NUM_STR ) )
-            {
-                ctx.num_str[ ctx.num_str_idx++ ] = src[ i ];
-            }
-            break;
-        }
-    }
-    res += vdb_convert_and_add_ctx( generator, &ctx );
-    return res;
-}
-
-bool vdn_set_range( num_gen* generator,
-                    const int64_t first, const uint64_t count )
-{
-    bool res = ( generator != NULL );
-    if ( res )
-    {
-        uint64_t num_1 = first;
-        uint64_t num_2;
-
-        /* this is necessary because virtual columns which have a
-           infinite row-range, get reported with first=1,count=0 */
-        if ( count > 0 )
-        {
-            num_2 = first + count - 1;
-        }
-        else
-        {
-            num_2 = first;
-        }
-        
-        /* clear all nodes so far... */
-        VectorWhack( &(generator->nodes), vdn_node_destroy, NULL );
-        /* re-init the vector */
-        VectorInit( &(generator->nodes ), 0, 5 );
-        generator->node_count = 0;
-        generator->curr_node = 0;
-        generator->curr_node_sub_pos = 0;
-
-        res = vdn_add_node( generator, num_1, num_2 );
-    }
-    return res;
-}
-
-static bool CC vdn_check_range_start( p_num_gen_node the_node, 
-                               const uint64_t range_start )
-{
-    bool res = true;
-    uint64_t last_node_row = ( the_node->start + the_node->count - 1 );
-    
-    if ( the_node->start < range_start )
-    {
-        the_node->start = range_start;
-        if ( the_node->start <= last_node_row )
-        {
-            the_node->count = ( last_node_row - the_node->start ) + 1;
-        }
-        else
-        {
-            /* the node becomes invalid ... */
-            the_node->start = 0;
-            the_node->count = 0;
-            res = false;
-        }
-    }
-    return res;
-}
-
-static void CC vdn_check_range_end( p_num_gen_node the_node, 
-                             const uint64_t last_tab_row )
-{
-    uint64_t last_node_row = ( the_node->start + the_node->count - 1 );
-
-    if ( last_node_row > last_tab_row )
-    {
-        last_node_row = last_tab_row;
-        if ( the_node->start <= last_node_row )
-        {
-            the_node->count = ( last_node_row - the_node->start ) + 1;
-        }
-        else
-        {
-            /* the node becomes invalid ... */
-            the_node->start = 0;
-            the_node->count = 0;
-        }
-    }
-}
-
-static void CC vdn_check_range_callback( void *item, void *data )
-{
-    p_num_gen_node the_node = ( p_num_gen_node )item;
-    p_num_gen_node the_range = ( p_num_gen_node )data;
-    uint64_t last_tab_row = ( the_range->start + the_range->count - 1 );
-
-    /* check if the start value is not out of range... */
-    if ( vdn_check_range_start( the_node, the_range->start ) )
-        vdn_check_range_end( the_node, last_tab_row );
-}
-
-static void CC vdn_count_invalid_nodes( void *item, void *data )
-{
-    p_num_gen_node the_node = ( p_num_gen_node )item;
-    uint32_t *invalid_count = ( uint32_t * )data;
-    
-    if ( ( the_node->start == 0 )&&( the_node->count == 0 ) )
-        ( *invalid_count )++;
-}
-
-static void CC vdn_copy_valid_nodes( void *item, void *data )
-{
-    p_num_gen_node the_node = ( p_num_gen_node )item;
-    Vector *p_temp_nodes = ( Vector * )data;
-    
-    if ( ( the_node->start != 0 )&&( the_node->count != 0 ) )
-    {
-        p_num_gen_node new_node = vdn_make_node( the_node->start, the_node->count );
-        if ( new_node )
-        {
-            VectorInsert( p_temp_nodes, new_node, NULL, vdn_insert_helper );
-        }
-    }
-}
-
-static void vdn_remove_invalid_nodes( num_gen* generator, const uint32_t invalid_nodes )
-{
-    Vector temp_nodes;
-            
-    /* create a temp. vector */
-    VectorInit( &temp_nodes, 0, 5 );
-
-    /* copy all valid nodes into the temp. vector */
-    VectorForEach ( &(generator->nodes), false,
-                    vdn_copy_valid_nodes, &temp_nodes );
-
-    /* clear all nodes so far... */
-    VectorWhack( &(generator->nodes), vdn_node_destroy, NULL );
-
-    /* re-init the vector */
-    VectorInit( &(generator->nodes ), 0, 5 );
-
-    /* copy (swallow) the valid nodes back into the generator */
-    VectorCopy ( &temp_nodes, &(generator->nodes) );
-
-    /* correct the node count */
-    generator->node_count -= invalid_nodes;
-
-    /* destroy the temp-vector, DO NOT PASS vdn_node_destroy into it */            
-    VectorWhack ( &temp_nodes, NULL, NULL );
-}
-
-bool vdn_check_range( num_gen* generator,
-                      const int64_t first, const uint64_t count )
-{
-    bool res = ( generator != NULL );
-    if ( res )
-    {
-        num_gen_node defined_range;
-        uint32_t invalid_nodes = 0;
-
-        if ( count > 0 )
-        {
-            /* walk all nodes to check for boundaries... */
-            defined_range.start = first;
-            defined_range.count = count;
-
-            VectorForEach ( &(generator->nodes), false,
-                        vdn_check_range_callback, &defined_range );
-
-            VectorForEach ( &(generator->nodes), false,
-                        vdn_count_invalid_nodes, &invalid_nodes );
-            if ( invalid_nodes > 0 )
-            {
-                vdn_remove_invalid_nodes( generator, invalid_nodes );
-            }
-        }
-    }
-    return res;
-}
-
-rc_t vdn_make( num_gen** generator )
-{
-    if ( generator == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    }
-    (*generator) = calloc( 1, sizeof(num_gen) );
-    if ( *generator == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    }
-    VectorInit( &((*generator)->nodes ), 0, 5 );
-    return 0;
-}
-
-rc_t vdn_destroy( num_gen* generator )
-{
-    if ( generator == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcParam, rcNull );
-    }
-    VectorWhack( &(generator->nodes), vdn_node_destroy, NULL );
-    free( generator );
-    return 0;
-}
-
-bool vdn_start( num_gen* generator )
-{
-    if ( generator == NULL ) return false;
-    generator->curr_node = ( generator->node_count > 0 ? 0 : 1 );
-    generator->curr_node_sub_pos = 0;
-    return true;
-}
-
-static bool vdn_next_node( num_gen* generator, uint64_t* value )
-{
-    bool res = false;
-    if ( generator->curr_node < generator->node_count )
-    {
-        p_num_gen_node node = (p_num_gen_node)VectorGet( &(generator->nodes), 
-                                        (uint32_t)generator->curr_node );
-        if ( node != NULL )
-        {
-            uint64_t ret_value = node->start;
-            if ( node->count < 2 )
-            {
-                /* the node is a single-number-node */
-                generator->curr_node++;
-            }
-            else
-            {
-                /* the node is a number range */
-                ret_value += generator->curr_node_sub_pos++;
-                if ( generator->curr_node_sub_pos >= node->count )
-                {
-                    generator->curr_node++;
-                    generator->curr_node_sub_pos = 0;
-                }
-            }
-            if ( value ) *value = ret_value;
-            res = true;
-        }
-    }
-    return res;
-}
-
-bool vdn_range_defined( num_gen* generator )
-{
-    bool res = false;
-    if ( generator != NULL )
-    {
-        res = ( generator->node_count > 0 );
-    }
-    return res;
-}
-
-bool vdn_next( num_gen* generator, uint64_t* value )
-{
-    bool res = false;
-    if ( generator != NULL )
-    {
-        uint64_t ret_value = 0;
-        if ( vdn_range_defined( generator ) )
-        {
-            /* there are nodes (number-ranges) defined */
-            res = vdn_next_node( generator, &ret_value );
-        }
-        else
-        {
-            /* endless mode, there are NO nodes (number-ranges) defined */
-            ret_value = generator->curr_node++;
-            res = true;
-        }
-        if ( value ) *value = ret_value;
-    }
-    return res;
-}
diff --git a/tools/vdb-dump/vdb-dump-num-gen.h b/tools/vdb-dump/vdb-dump-num-gen.h
deleted file mode 100644
index 0131cba..0000000
--- a/tools/vdb-dump/vdb-dump-num-gen.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_num_gen_
-#define _h_vdb_dump_num_gen_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <klib/vector.h>
-
-/********************************************************************************
-
-                   A NUMBER GENERATOR
-
-input : string, for instance "3,6,8,12,44-49"
-ouptut: sequence of integers, for instance 3,6,8,12,44,45,46,47,48,49
-
-********************************************************************************/
-typedef struct num_gen_node
-{
-    uint64_t start;
-    uint64_t count;
-} num_gen_node;
-typedef num_gen_node* p_num_gen_node;
-
-
-typedef struct num_gen
-{
-    Vector nodes;
-    uint32_t node_count;
-    uint64_t curr_node;
-    uint64_t curr_node_sub_pos;
-} num_gen;
-
-rc_t vdn_make( num_gen** generator );
-rc_t vdn_destroy( num_gen* generator );
-
-uint32_t vdn_parse( num_gen* generator, const char* src );
-
-bool vdn_set_range( num_gen* generator,
-                    const int64_t first, const uint64_t count );
-bool vdn_check_range( num_gen* generator,
-                      const int64_t first, const uint64_t count );
-
-bool vdn_start( num_gen* generator );
-bool vdn_next( num_gen* generator, uint64_t* value );
-bool vdn_range_defined( num_gen* generator );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-row-context.h b/tools/vdb-dump/vdb-dump-row-context.h
deleted file mode 100644
index 3f2579c..0000000
--- a/tools/vdb-dump/vdb-dump-row-context.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_row_context_
-#define _h_vdb_dump_row_context_
-
-#include <vdb/cursor.h>
-#include <klib/vector.h>
-
-#include "vdb-dump-context.h"
-#include "vdb-dump-coldefs.h"
-#include "vdb-dump-str.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*************************************************************************************
-    binds together everything to dump one row:
-        - a pointer to the cursor to read the data-cells
-        - a pointer to the column-definitions (Vector of column-definition's)
-        - a pointer to the dump-context ( parameters and options for cmd-line )
-        - a dump-string (structure not pointer!) to be reused to assemble output
-        - a Vector containing p_col_data - pointers
-        - a return-type to stop if reading data failed ( neccessary to stop after
-          last row if no row-range is given at command-line )
-
-    needed as a (one and only) parameter to VectorForEach
-*************************************************************************************/
-typedef struct row_context
-{
-    const VTable* table;
-    const VCursor* cursor;
-    p_col_defs col_defs;
-    p_dump_context ctx;
-    dump_str s_col;
-    uint64_t row_id;
-    uint32_t col_nr;
-    rc_t rc;
-} row_context;
-typedef row_context* p_row_context;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-str.c b/tools/vdb-dump/vdb-dump-str.c
deleted file mode 100644
index 5031ebe..0000000
--- a/tools/vdb-dump/vdb-dump-str.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-str.h"
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdarg.h>
-
-rc_t vds_make( p_dump_str s, const size_t limit, const size_t inc )
-{
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
-    }
-    s->str_limit = limit;
-    s->buf_inc = inc;
-    s->buf_size = ( ( limit == 0 ) ? inc : limit+1 );
-    s->buf = malloc( s->buf_size );
-    if ( s->buf == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    }
-    s->str_len = 0;
-    s->buf[0] = 0;
-    s->truncated = false;
-    return 0;
-}
-
-rc_t vds_free( p_dump_str s )
-{
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcParam, rcNull );
-    }
-    free( s->buf );
-    return 0;
-}
-
-rc_t vds_clear( p_dump_str s )
-{
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcDestroying, rcParam, rcNull );
-    }
-    s->buf[0]=0;
-    s->str_len = 0;
-    s->truncated = false;
-    return 0;
-}
-
-bool vds_truncated( p_dump_str s )
-{
-    if ( s == NULL ) return false;
-    return s->truncated;
-}
-
-char *vds_ptr( p_dump_str s )
-{
-    if ( s == NULL ) return NULL;
-    return s->buf;
-}
-
-
-static rc_t vds_inc_buffer( p_dump_str s, const size_t by_len )
-{
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcAllocating, rcParam, rcNull );
-    }
-    if ( ( s->str_len + by_len ) >= s->buf_size )
-    {
-        size_t new_len = by_len + s->str_len + 1;
-        while( s->buf_size < new_len ) s->buf_size += s->buf_inc;
-        s->buf = realloc( s->buf, s->buf_size );
-        if ( s->buf == NULL )
-        {
-            return RC( rcVDB, rcNoTarg, rcAllocating, rcMemory, rcExhausted );
-        }
-    }
-    return 0;
-}
-
-
-static rc_t vds_truncate( p_dump_str s )
-{
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcResizing, rcParam, rcNull );
-    }
-    if ( s->buf == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcResizing, rcParam, rcNull );
-    }
-    s->str_len = string_size( s->buf );
-    if ( ( s->str_limit > 0 )&&( s->str_len > s->str_limit ) )
-    {
-        s->buf[ s->str_limit ] = 0;
-        s->str_len = s->str_limit;
-        s->truncated = true;
-    }
-    return 0;
-}
-
-
-rc_t vds_append_fmt( p_dump_str s, const size_t aprox_len, const char *fmt, ... )
-{
-    va_list argp;
-    rc_t rc;
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    if ( fmt == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    if ( fmt[0] == 0 )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcEmpty );
-    }
-    if ( ( s->str_limit > 0 )&&( s->str_len >= s->str_limit ) )
-    {
-        s->truncated = true;
-        return 0;
-    }
-    rc = vds_inc_buffer( s, aprox_len );
-    if ( rc == 0 )
-    {
-        va_start( argp, fmt );
-        string_vprintf( s->buf + s->str_len, s->buf_size-1, NULL, fmt, argp );
-        va_end( argp );
-        rc = vds_truncate( s ); /* adjusts str_len */
-    }
-    return rc;
-}
-
-
-rc_t vds_append_str( p_dump_str s, const char *s1 )
-{
-    rc_t rc = 0;
-
-    if ( ( s == NULL )||( s1 == NULL ) )
-    {
-        rc = RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    else
-    {
-        size_t append_len = string_size( s1 );
-        if ( append_len > 0 )
-        {
-            if ( ( s->str_limit > 0 )&&( s->str_len >= s->str_limit ) )
-            {
-                s->truncated = true;
-            }
-            else
-            {
-                rc = vds_inc_buffer( s, append_len );
-                if ( rc == 0 )
-                {
-                    size_t l = string_size( s->buf );
-                    string_copy( s->buf + l, s->buf_size - l, s1, append_len );
-                    rc = vds_truncate( s ); /* adjusts str_len */
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-
-rc_t vds_append_str_no_limit_check( p_dump_str s, const char *s1 )
-{
-    rc_t rc;
-    size_t append_len;
-    if ( ( s == NULL )||( s1 == NULL ) )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    append_len = string_size( s1 );
-    if ( append_len == 0 )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcEmpty );
-    }
-    rc = vds_inc_buffer( s, append_len );
-    if ( rc == 0 )
-    {
-        size_t l = string_size( s->buf );
-        string_copy( s->buf + l, s->buf_size - l, s1, append_len );
-        s->str_len += append_len;
-    }
-    return rc;
-}
-
-
-rc_t vds_rinsert( p_dump_str s, const char *s1 )
-{
-    size_t len;
-    if ( ( s == NULL )||( s1 == NULL ) )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    len = string_size( s1 );
-    if ( len == 0 )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcEmpty );
-    }
-    if ( s->str_len <= len ) return 0;
-    len = s->str_len - len;
-    string_copy( s->buf + len, sizeof( s->buf ) - len, s1, string_size( s1 ) );
-    /* s->str_len does not change */
-    return 0;
-}
-
-
-rc_t vds_indent( p_dump_str s, const size_t limit, const size_t indent )
-{
-    size_t remaining_chars, lines, indent_block, line_idx;
-    char *src, *dst;
-    rc_t rc;
-
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    if ( s->str_len < limit ) return 0;
-    remaining_chars = s->str_len - limit;
-    indent_block = limit - indent;
-    lines = ( remaining_chars / indent_block ) + 1;
-    /* increase the buffer by ( lines * ( indent + 1 ) ) bytes */
-    rc = vds_inc_buffer( s, lines * ( indent + 1 ) );
-    if ( rc == 0 )
-    {
-        src = s->buf + limit;
-        line_idx = 0;
-        while ( line_idx < lines )
-        {
-            dst = src + ( indent + 1 );
-            memmove( dst, src, remaining_chars );
-            *src = '\n';
-            memset( src+1, ' ', indent );
-            remaining_chars -= indent_block;
-            src += ( limit+1 );
-            line_idx++;
-        }
-        s->str_len += ( lines * ( indent + 1 ) );
-        s->buf[ s->str_len ] = 0;
-    }
-    return rc;
-}
-
-uint16_t vds_count_char( p_dump_str s, const char c )
-{
-    uint16_t res = 0;
-    char *temp = s->buf;
-    while(  *temp )
-    {
-        if ( *temp == c ) res++;
-        temp++;
-    }
-    return res;
-}
-
-void vds_escape_quotes_loop( p_dump_str s, const char to_escape,
-                             const char escape_char )
-{
-    char *temp = s->buf;
-    while(  *temp )
-    {
-        if ( *temp == to_escape )
-        {
-        size_t to_move = string_size( temp ) + 1;
-        memmove( temp+1, temp, to_move );
-        (*temp) = escape_char;
-        temp++;
-        }
-        temp++;
-    }
-    s->str_len = string_size( s->buf );
-}
-
-rc_t vds_escape( p_dump_str s, const char to_escape, const char escape_char )
-{
-    uint16_t n;
-    rc_t rc;
-
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    n = vds_count_char( s, to_escape );
-    rc = vds_inc_buffer( s, n + 1 );
-    if ( rc == 0 )
-    {
-        vds_escape_quotes_loop( s, to_escape, escape_char );
-    }
-    return rc;
-}
-
-rc_t vds_enclose_string( p_dump_str s, const char c_left, const char c_right )
-{
-    size_t to_move;
-    rc_t rc;
-
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    to_move = string_size( s->buf ) + 1;
-    rc = vds_inc_buffer( s, 2 );
-    if ( rc == 0 )
-    {
-        memmove( s->buf + 1, s->buf, to_move );
-        s->buf[0]=c_left;
-        s->buf[to_move]=c_right;
-        s->buf[to_move+1]=0;
-        s->str_len = string_size( s->buf );
-    }
-    return rc;
-}
-
-rc_t vds_2_csv( p_dump_str s )
-{
-    rc_t rc = 0;
-    bool has_comma, has_quotes;
-
-    if ( s == NULL )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    has_comma = (strchr( s->buf, ',' ) != NULL );
-    has_quotes = (strchr( s->buf, '"' ) != NULL );
-    if ( has_quotes )
-    {
-        rc = vds_escape( s, '"', '"' );
-    }
-    if ( (rc == 0 )&&( ( has_quotes )||( has_comma ) ) )
-    {
-        rc = vds_enclose_string( s, '"', '"' );
-    }
-    return rc;
-}
diff --git a/tools/vdb-dump/vdb-dump-str.h b/tools/vdb-dump/vdb-dump-str.h
deleted file mode 100644
index 71e2678..0000000
--- a/tools/vdb-dump/vdb-dump-str.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_str_
-#define _h_vdb_dump_str_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include <klib/rc.h>
-
-typedef struct dump_str
-{
-    char *buf;
-    size_t buf_size;
-	size_t str_len;
-	size_t str_limit;
-	size_t buf_inc;
-	bool truncated;
-} dump_str;
-typedef dump_str* p_dump_str;
-
-#define DUMP_STR_INC 512
-
-/* initializes the dump-string with limit and buffer-increment */
-rc_t vds_make( p_dump_str s, const size_t limit, const size_t inc );
-
-/* free's the dump-string's internal buffer */
-rc_t vds_free( p_dump_str s );
-
-/* the internal buffer stay's allocated, but the internal string-len
-   and the truncated-state is cleared */
-rc_t vds_clear( p_dump_str s );
-
-/* returns if the dump-string was trancated */
-bool vds_truncated( p_dump_str s );
-
-/* returns if assembled dump-string */
-char *vds_ptr( p_dump_str s );
-
-/* appends the formated string with parameters, truncates to the limit */
-rc_t vds_append_fmt( p_dump_str s, const size_t aprox_len, const char *fmt, ... );
-
-/* appends the string, truncates to the limit */
-rc_t vds_append_str( p_dump_str s, const char *s1 );
-
-/* appends the string, does not truncate */
-rc_t vds_append_str_no_limit_check( p_dump_str s, const char *s1 );
-
-/* right-inserts the string at the end of the ev. limited string */
-rc_t vds_rinsert( p_dump_str s, const char *s1 );
-
-/* indents the content of a dump-string */
-rc_t vds_indent( p_dump_str s, const size_t limit, const size_t indent );
-
-/* converts the dump-string into csv-style (quotes at begin and end if the
-   string contains a comma or other quotes, escapes quotes with quotes ) */
-rc_t vds_2_csv( p_dump_str s );
-
-rc_t vds_enclose_string( p_dump_str s, const char c_left, const char c_right );
-rc_t vds_escape( p_dump_str s, const char to_escape, const char escape_char );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump-tools.c b/tools/vdb-dump/vdb-dump-tools.c
deleted file mode 100644
index 197b076..0000000
--- a/tools/vdb-dump/vdb-dump-tools.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump-tools.h"
-#include "vdb-dump-str.h"
-
-#include <vdb/schema.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/pack.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <bitstr.h>
-
-#include <klib/rc.h>
-#include <klib/log.h>
-#define DISP_RC(rc,err) if( rc != 0 ) LOGERR( klogInt, rc, err );
-
-#define BYTE_OFFSET(VALUE)  ( (VALUE) >> 3 )
-#define BIT_OFFSET(VALUE)   ( (VALUE) & 0x7 )
-
-uint8_t BitLength2Bytes[65] =
-{
-         /* 0  1  2  3  4  5  6  7  8  9*/
-   /* 0 */  0, 1, 1, 1, 1, 1, 1, 1, 1, 2,
-   /* 1 */  2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
-   /* 2 */  3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
-   /* 3 */  4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
-   /* 4 */  5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
-   /* 5 */  7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
-   /* 6 */  8, 8, 8, 8, 8
-};
-
-/*************************************************************************************
-n_bits   [IN] ... number of bits
-
-calculates the number of bytes that have to be copied to contain the given
-number of bits
-*************************************************************************************/
-static uint16_t vdt_bitlength_2_bytes( const size_t n_bits )
-{
-    if ( n_bits > 64 )
-        return 8;
-    else
-        return BitLength2Bytes[ n_bits ];
-}
-
-uint64_t BitLength2Mask[33] =
-{
-   /* 0 */ 0x00,
-   /* 1 ..  4 */  0x1,                0x3,                0x7,                0xF,
-   /* 5 ..  8 */  0x1F,               0x3F,               0x7F,               0xFF,
-   /* 9 .. 12 */  0x1FF,              0x3FF,              0x7FF,              0xFFF,
-   /*13 .. 16 */  0x1FFF,             0x3FFF,             0x7FFF,             0xFFFF,
-   /*17 .. 20 */  0x1FFFF,            0x3FFFF,            0x7FFFF,            0xFFFFF,
-   /*21 .. 24 */  0x1FFFFF,           0x3FFFFF,           0x7FFFFF,           0xFFFFFF,
-   /*25 .. 28 */  0x1FFFFFF,          0x3FFFFFF,          0x7FFFFFF,          0xFFFFFFF,
-   /*29 .. 32 */  0x1FFFFFFF,         0x3FFFFFFF,         0x7FFFFFFF,         0xFFFFFFFF
- };
-
-/*************************************************************************************
-n_bits   [IN] ... number of bits
-
-creates a bitmask to mask exactly the given number of bits from a longer value
-*************************************************************************************/
-static uint64_t vdt_bitlength_2_mask( const size_t n_bits )
-{
-    uint64_t res;
-    if ( n_bits < 33 )
-        res = BitLength2Mask[ n_bits ];
-    else
-    {
-        if ( n_bits < 65 )
-            res = BitLength2Mask[ n_bits-32 ];
-        else
-            res = 0xFFFFFFFF;
-        res <<= 32;
-        res |= 0xFFFFFFFF;
-    }
-    return res;
-}
-
-
-static rc_t vdb_dump_txt_ascii( p_dump_str s, const p_dump_src src,
-                                const p_col_def def )
-{
-    char *src_ptr = (char*)src->buf + BYTE_OFFSET( src->offset_in_bits );
-    return vds_append_fmt( s, src->number_of_elements,
-                           "%.*s", src->number_of_elements, src_ptr );
-
-}
-
-
-static rc_t vdb_dump_hex_char( char * temp, uint32_t * idx, const uint8_t c )
-{
-    char s[ 8 ];
-    size_t num_writ;
-    rc_t rc = string_printf ( s, sizeof s, &num_writ, "%X ", c );
-    if ( rc == 0 )
-    {
-        size_t i;
-        for ( i = 0; i < num_writ; ++i )
-            temp[ (*idx)++ ] = s[ i ];
-    }
-    return rc;
-}
-
-
-static rc_t vdb_dump_hex_ascii( p_dump_str s, const p_dump_src src,
-                                const p_col_def def )
-{
-    rc_t rc = 0;
-    char *src_ptr = (char*)src->buf + BYTE_OFFSET( src->offset_in_bits );
-    char *tmp = malloc( src->number_of_elements * 4 );
-    if ( tmp != NULL )
-    {
-        uint32_t i, dst = 0;
-        for ( i = 0; i < src->number_of_elements && rc == 0; ++i )
-            rc = vdb_dump_hex_char( tmp, &dst, src_ptr[ i ] );
-        src_ptr[ dst ] = 0;
-        if ( rc == 0 )
-            rc = vds_append_fmt( s, dst, "%.*s", dst, tmp );
-        free( tmp );
-    }
-    else
-        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-    return rc;
-}
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-dpo         [IN] ... pointer to buffer-offset (bit-offset-part will be ignored)
-
-dumps an ascii-string
-*************************************************************************************/
-static rc_t vdt_dump_ascii( p_dump_str s, const p_dump_src src,
-                            const p_col_def def )
-{
-    rc_t rc;
-    if ( src->in_hex )
-        rc = vdb_dump_hex_ascii( s, src, def );
-    else
-        rc = vdb_dump_txt_ascii( s, src, def );
-    DISP_RC( rc, "dump_str_append_fmt() failed" )
-    if ( rc == 0 )
-    {
-        src->element_idx+=src->number_of_elements;
-        src->offset_in_bits += ( def->type_desc.intrinsic_bits * src->number_of_elements );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-dpo         [IN] ... pointer to buffer-offset (bit-offset-part will be ignored)
-
-dumps an ascii-string
-*************************************************************************************/
-static rc_t vdt_dump_unicode( p_dump_str s, const p_dump_src src,
-                              const p_col_def def )
-{
-    rc_t rc;
-    if ( src->in_hex )
-        rc = vdb_dump_hex_ascii( s, src, def );
-    else
-        rc = vdb_dump_txt_ascii( s, src, def );
-    DISP_RC( rc, "dump_str_append_fmt() failed" )
-    if ( rc == 0 )
-    {
-        src->element_idx+=src->number_of_elements;
-        src->offset_in_bits += ( def->type_desc.intrinsic_bits * src->number_of_elements );
-    }
-    return rc;
-}
-
-void vdt_move_to_value( void* dst, const p_dump_src src, const uint32_t n_bits )
-{
-    char *src_ptr = (char*)src->buf + BYTE_OFFSET(src->offset_in_bits);
-    if ( BIT_OFFSET(src->offset_in_bits) == 0 )
-    {
-        memmove( dst, src_ptr, vdt_bitlength_2_bytes( n_bits ) );
-    }
-    else
-    {
-        bitcpy ( dst, 0, src_ptr, BIT_OFFSET(src->offset_in_bits), n_bits );
-    }
-}
-
-static uint64_t vdt_move_to_uint64( const p_dump_src src, const uint32_t n_bits )
-{
-    uint64_t value = 0;
-    vdt_move_to_value( &value, src, n_bits );
-    if ( n_bits & 7 )
-    {
-        size_t unpacked = 0;
-        Unpack( n_bits, sizeof( value ), &value, 0, n_bits,
-                NULL, &value, sizeof(value), &unpacked );
-    }
-    value &= vdt_bitlength_2_mask( n_bits );
-    src->offset_in_bits += n_bits;
-    return value;
-}
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-my_col_def  [IN] ... the definition of the column to be dumped
-
-dumps boolean values (up to 64 bits)
-*************************************************************************************/
-static rc_t vdt_dump_boolean_element( p_dump_str s, const p_dump_src src,
-                                      const p_col_def def )
-{
-    rc_t rc;
-    uint64_t value = vdt_move_to_uint64( src, def->type_desc.intrinsic_bits );
-    switch( src->c_boolean )
-    {
-    case '1' :  if ( value == 0 )
-                    rc = vds_append_str( s, "0" );
-                else
-                    rc = vds_append_str( s, "1" );
-                break;
-    case 'T' :  if ( value == 0 )
-                    rc = vds_append_str( s, "F" );
-                else
-                    rc = vds_append_str( s, "T" );
-                break;
-
-    default  :  if ( value == 0 )
-                    rc = vds_append_str( s, "false" );
-                else
-                    rc = vds_append_str( s, "true" );
-                break;
-    }
-    DISP_RC( rc, "dump_str_append_str() failed" )
-    return rc;
-}
-
-#define MAX_CHARS_FOR_HEX_UINT64 20
-#define MAX_CHARS_FOR_DEC_UINT64 22
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-my_col_def  [IN] ... the definition of the column to be dumped
-
-unsigned int's up to a length of 64 bit are supported
-unused bits are masked out
-*************************************************************************************/
-static rc_t vdt_dump_uint_element( p_dump_str s, const p_dump_src src,
-                                   const p_col_def def )
-{
-    rc_t rc = 0;
-    uint64_t value = vdt_move_to_uint64( src, def->type_desc.intrinsic_bits );
-    if ( ( src->without_sra_types == false )&&( def->value_trans_fct != NULL ) )
-    {
-        const char *txt = def->value_trans_fct( (uint32_t)value );
-        rc = vds_append_str( s, txt );
-        DISP_RC( rc, "dump_str_append_str() failed" )
-    }
-    else
-    {
-        if ( src->in_hex )
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_HEX_UINT64, "0x%lX", value );
-        else
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_DEC_UINT64, "%lu", value );
-        DISP_RC( rc, "dump_str_append_fmt() failed" )
-    }
-    return rc;
-}
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-my_col_def  [IN] ... the definition of the column to be dumped
-
-signed int's up to a length of 64 bit are supported
-unused bits are masked out
-*************************************************************************************/
-static rc_t vdt_dump_int_element( p_dump_str s, const p_dump_src src,
-                                  const p_col_def def )
-{
-    rc_t rc = 0;
-    int64_t value = (int64_t)vdt_move_to_uint64( src, def->type_desc.intrinsic_bits );
-    if ( ( src->without_sra_types == false )&&( def->value_trans_fct != NULL ) )
-    {
-        const char *txt = def->value_trans_fct( (uint32_t)value );
-        rc = vds_append_str( s, txt );
-        DISP_RC( rc, "dump_str_append_str() failed" )
-    }
-    else
-    {
-        switch ( def->type_desc.intrinsic_bits )
-        {
-            case  8 : { int8_t temp = (int8_t)value;
-                        value = temp; }
-                      break;
-            case 16 : { int16_t temp = (int16_t)value;
-                        value = temp; }
-                      break;
-            case 32 : { int32_t temp = (int32_t)value;
-                        value = temp; }
-                      break;
-        }
-
-        if ( src->in_hex )
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_HEX_UINT64, "0x%lX", value );
-        else
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_DEC_UINT64, "%ld", value );
-        DISP_RC( rc, "dump_str_append_fmt() failed" )
-    }
-    return rc;
-}
-
-#define MAX_CHARS_FOR_DOUBLE 26
-#define BITSIZE_OF_FLOAT ( sizeof(float) * 8 )
-#define BITSIZE_OF_DOUBLE ( sizeof(double) * 8 )
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-my_col_def  [IN] ... the definition of the column to be dumped
-
-only 2 float-types: "float"(32 bit) and "double"(64 bit) are supported
-*************************************************************************************/
-static rc_t vdt_dump_float_element( p_dump_str s, const p_dump_src src,
-                                    const p_col_def def )
-{
-    rc_t rc;
-    if ( src->in_hex )
-        rc = vdt_dump_int_element( s, src, def );
-    else
-    {
-        if ( def->type_desc.intrinsic_bits == BITSIZE_OF_FLOAT )
-        {
-            float value;
-            vdt_move_to_value( &value, src, def->type_desc.intrinsic_bits );
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_DOUBLE, "%e", value );
-            DISP_RC( rc, "dump_str_append_fmt() failed" )
-        }
-        else if ( def->type_desc.intrinsic_bits == BITSIZE_OF_DOUBLE )
-        {
-            double value;
-            vdt_move_to_value( &value, src, def->type_desc.intrinsic_bits );
-            rc = vds_append_fmt( s, MAX_CHARS_FOR_DOUBLE, "%e", value );
-            DISP_RC( rc, "dump_str_append_fmt() failed" )
-        }
-        else
-        {
-            rc = vds_append_str( s, "unknown float-type" );
-            DISP_RC( rc, "dump_str_append_str() failed" )
-        }
-        src->offset_in_bits += def->type_desc.intrinsic_bits;
-    }
-    return rc;
-}
-
-
-char dna_chars[4] = { 'A', 'C', 'G', 'T' };
-
-/* special function to translate dim=2,bits=1 into a DNA-base */
-static rc_t vdt_dump_base_element( p_dump_str s,
-                                   const p_dump_src src,
-                                   const p_col_def def )
-{
-    /* do not replace this with value2=value1, because move_to_uint64
-       increments the src-bit-counter !*/
-    uint64_t value1 = vdt_move_to_uint64( src, def->type_desc.intrinsic_bits );
-    uint64_t value2 = vdt_move_to_uint64( src, def->type_desc.intrinsic_bits );
-    rc_t rc;
-    value1 <<= 1;
-    value1 |= value2;
-    rc = vds_append_fmt( s, 1, "%c", dna_chars[ value1 & 0x03 ] );
-    DISP_RC( rc, "dump_str_append_fmt() failed" )
-    return rc;
-}
-
-
-typedef rc_t(*vdt_dump_fkt_t)( p_dump_str s,
-                               const p_dump_src src,
-                               const p_col_def def );
-
-/* !!!!!!!! this depends on how domains are defined in "schema.h" */
-vdt_dump_fkt_t vdt_DomainDispatch[] =
-{
-    vdt_dump_boolean_element,
-    vdt_dump_uint_element,
-    vdt_dump_int_element,
-    vdt_dump_float_element,
-    vdt_dump_ascii,
-    vdt_dump_unicode
-};
-
-rc_t vdt_dump_dim_trans( const p_dump_src src, const p_col_def def,
-                         const int dimension )
-{
-    rc_t rc = 0;
-    char *s;
-    uint8_t *sbuf = (uint8_t *)src->buf;
-    sbuf+=( src->offset_in_bits >> 3 );
-    s = def->dim_trans_fct( sbuf );
-    src->offset_in_bits += ( def->type_desc.intrinsic_bits * dimension );
-    rc = vds_append_str( &(def->content), s );
-    DISP_RC( rc, "dump_str_append_str() failed" )
-    /* we have to free, because dim_trans_fct()
-       makes the string dynamically */
-    free( s );
-    return rc;
-}
-
-rc_t vdt_dump_dim( const p_dump_src src, const p_col_def def,
-                   const int dimension, const int selection )
-{
-    rc_t rc = 0;
-    int i = 0;
-    bool print_comma = true;
-
-    if ( selection == 0 ) /* cell-type == boolean */
-    {
-        /* if long form "false" or "true" separate elements by comma */
-        print_comma = ( src->c_boolean == 0 );
-    }
-
-    while ( ( i < dimension )&&( rc == 0 ) )
-    {
-        /* selection 0 ... boolean */
-        if ( print_comma && ( i > 0 ) )
-        {
-            rc = vds_append_str( &(def->content), ", " );
-            DISP_RC( rc, "dump_str_append_str() failed" )
-        }
-        if ( rc == 0 )
-        {
-            rc = vdt_DomainDispatch[ selection ]( &(def->content), src, def );
-            DISP_RC( rc, "DomainDispatch[]() failed" )
-        }
-        i++;
-    }
-    return rc;
-}
-
-/*************************************************************************************
-src         [IN] ... buffer containing the data
-my_col_def  [IN] ... the definition of the column to be dumped
-
-dumps one data-element (or a vector of it)
-*************************************************************************************/
-rc_t vdt_dump_element( const p_dump_src src, const p_col_def def )
-{
-    int dimension, selection;
-    rc_t rc = 0;
-
-    if ( ( src == NULL )||( def == NULL ) )
-    {
-        return RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
-    }
-    dimension   = def->type_desc.intrinsic_dim;
-    selection   = def->type_desc.domain - 1;
-
-    if ( dimension == 1 )
-    {
-        /* we have only 1 dimension ---> just print this value */
-        rc = vdt_DomainDispatch[ selection ]( &(def->content), src, def );
-        DISP_RC( rc, "DomainDispatch[]() failed" )
-    }
-    else
-    {
-        /* we have more than 1 dimension ---> repeat printing value's */
-        if ( src->print_dna_bases )
-        {
-            rc = vdt_dump_base_element( &(def->content), src, def );
-        }
-        else
-        {
-            bool trans = ( ( src->without_sra_types == false )&&
-                           ( def->dim_trans_fct ) );
-            bool paren = ( ( src->number_of_elements > 1 )||( !trans ) );
-
-            if ( paren )
-            {
-                rc = vds_append_str( &(def->content), "[" );
-                DISP_RC( rc, "dump_str_append_str() failed" )
-            }
-
-            if ( rc == 0 )
-            {
-                if ( trans )
-                    rc = vdt_dump_dim_trans( src, def, dimension );
-                else
-                {
-                    rc = vdt_dump_dim( src, def, dimension, selection );
-                }
-            }
-
-            if ( paren && ( rc == 0 ) )
-            {
-                rc = vds_append_str( &(def->content), "]" );
-                DISP_RC( rc, "dump_str_append_str() failed" )
-            }
-        }
-    }
-    src->element_idx++;
-    return rc;
-}
diff --git a/tools/vdb-dump/vdb-dump-tools.h b/tools/vdb-dump/vdb-dump-tools.h
deleted file mode 100644
index ac0834b..0000000
--- a/tools/vdb-dump/vdb-dump-tools.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#ifndef _h_vdb_dump_tools_
-#define _h_vdb_dump_tools_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _h_klib_defs_
-#include <klib/defs.h>
-#endif
-
-#include "vdb-dump-coldefs.h"
-#include "vdb-dump-str.h"
-
-typedef struct dump_src
-{
-    const void *buf;
-    uint32_t offset_in_bits;
-    uint32_t element_idx;
-    uint32_t number_of_elements;
-    bool in_hex;
-    bool print_dna_bases;
-    bool without_sra_types;
-    char c_boolean;
-} dump_src;
-typedef dump_src* p_dump_src;
-
-rc_t vdt_dump_element( const p_dump_src src, const p_col_def def );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tools/vdb-dump/vdb-dump.c b/tools/vdb-dump/vdb-dump.c
deleted file mode 100644
index 880b5ca..0000000
--- a/tools/vdb-dump/vdb-dump.c
+++ /dev/null
@@ -1,1527 +0,0 @@
-/*===========================================================================
-*
-*                            PUBLIC DOMAIN NOTICE
-*               National Center for Biotechnology Information
-*
-*  This software/database is a "United States Government Work" under the
-*  terms of the United States Copyright Act.  It was written as part of
-*  the author's official duties as a United States Government employee and
-*  thus cannot be copyrighted.  This software/database is freely available
-*  to the public for use. The National Library of Medicine and the U.S.
-*  Government have not placed any restriction on its use or reproduction.
-*
-*  Although all reasonable efforts have been taken to ensure the accuracy
-*  and reliability of the software and data, the NLM and the U.S.
-*  Government do not and cannot warrant the performance or results that
-*  may be obtained by using this software or data. The NLM and the U.S.
-*  Government disclaim all warranties, express or implied, including
-*  warranties of performance, merchantability or fitness for any particular
-*  purpose.
-*
-*  Please cite the author in any work or product based on this material.
-*
-* ===========================================================================
-*
-*/
-
-#include "vdb-dump.vers.h"
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/database.h>
-#include <vdb/dependencies.h>
-#include <vdb/vdb-priv.h>
-
-#include <kdb/table.h>
-#include <kdb/column.h>
-#include <kdb/manager.h>
-
-#include <kfs/directory.h>
-#include <kns/manager.h>
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include <klib/container.h>
-#include <klib/vector.h>
-#include <klib/log.h>
-#include <klib/out.h>
-#include <klib/debug.h>
-#include <klib/status.h>
-#include <klib/text.h>
-#include <klib/printf.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-
-#include <os-native.h>
-#include <sysalloc.h>
-
-#include <stdlib.h>
-#include <bitstr.h>
-
-#include "vdb-dump-num-gen.h"
-#include "vdb-dump-context.h"
-#include "vdb-dump-coldefs.h"
-#include "vdb-dump-tools.h"
-#include "vdb-dump-helper.h"
-#include "vdb-dump-row-context.h"
-#include "vdb-dump-formats.h"
-
-
-#define CURSOR_CACHE_SIZE 256*1024*1024
-
-static const char * row_id_on_usage[] = { "print row id", NULL };
-static const char * line_feed_usage[] = { "line-feed's inbetween rows", NULL };
-static const char * colname_off_usage[] = { "do not print column-names", NULL };
-static const char * in_hex_usage[] = { "print numbers in hex", NULL };
-static const char * table_usage[] = { "table-name", NULL };
-static const char * rows_usage[] = { "rows (default = all)", NULL };
-static const char * columns_usage[] = { "columns (default = all)", NULL };
-static const char * schema_usage[] = { "schema-name", NULL };
-static const char * schema_dump_usage[] = { "dumps the schema",  NULL };
-static const char * table_enum_usage[] = { "enumerates tables",  NULL };
-static const char * column_enum_usage[] = { "enumerates columns in extended form", NULL };
-static const char * column_short_usage[] = { "enumerates columns in short form", NULL };
-static const char * dna_bases_usage[] = { "print dna-bases", NULL };
-static const char * max_line_len_usage[] = { "limits line length", NULL };
-static const char * line_indent_usage[] = { "indents the line", NULL };
-static const char * filter_usage[] = { "filters lines", NULL };
-static const char * format_usage[] = { "dump format (csv,xml,json,piped,tab)", NULL };
-static const char * id_range_usage[] = { "prints id-range", NULL };
-static const char * without_sra_usage[] = { "without sra-type-translation", NULL };
-static const char * without_accession_usage[] = { "without accession-test", NULL };
-static const char * excluded_columns_usage[] = { "exclude these columns", NULL };
-static const char * boolean_usage[] = { "defines how boolean's are printed (1,T)", NULL };
-static const char * objver_usage[] = { "request vdb-version", NULL };
-static const char * numelem_usage[] = { "print only element-count", NULL };
-static const char * numelemsum_usage[] = { "sum element-count", NULL };
-static const char * show_blobbing_usage[] = { "show blobbing", NULL };
-static const char * enum_phys_usage[] = { "enumerate physical columns", NULL };
-static const char * objtype_usage[] = { "report type of object", NULL };
-
-OptDef DumpOptions[] =
-{
-    { OPTION_ROW_ID_ON, ALIAS_ROW_ID_ON, NULL, row_id_on_usage, 1, false, false },
-    { OPTION_LINE_FEED, ALIAS_LINE_FEED, NULL, line_feed_usage, 1, true, false },
-    { OPTION_COLNAME_OFF, ALIAS_COLNAME_OFF, NULL, colname_off_usage, 1, false, false },
-    { OPTION_IN_HEX, ALIAS_IN_HEX, NULL, in_hex_usage, 1, false, false },
-    { OPTION_TABLE, ALIAS_TABLE, NULL, table_usage, 1, true, false },
-    { OPTION_ROWS, ALIAS_ROWS, NULL, rows_usage, 1, true, false },
-    { OPTION_COLUMNS, ALIAS_COLUMNS, NULL, columns_usage, 1, true, false },
-/* limit of 5 schemas? */
-    { OPTION_SCHEMA, ALIAS_SCHEMA, NULL, schema_usage, 5, true, false },
-    { OPTION_SCHEMA_DUMP, ALIAS_SCHEMA_DUMP, NULL, schema_dump_usage, 1, false, false },
-    { OPTION_TABLE_ENUM, ALIAS_TABLE_ENUM, NULL, table_enum_usage, 1, false, false },
-    { OPTION_COLUMN_ENUM, ALIAS_COLUMN_ENUM, NULL, column_enum_usage, 1, false, false },
-    { OPTION_COLUMN_SHORT, ALIAS_COLUMN_SHORT, NULL, column_short_usage, 1, false, false },
-    { OPTION_DNA_BASES, ALIAS_DNA_BASES, NULL, dna_bases_usage, 1, false, false },
-    { OPTION_MAX_LINE_LEN, ALIAS_MAX_LINE_LEN, NULL, max_line_len_usage, 1, true, false },
-    { OPTION_LINE_INDENT, ALIAS_LINE_INDENT, NULL, line_indent_usage, 1, true, false },
-    { OPTION_FILTER, ALIAS_FILTER, NULL, filter_usage, 1, true, false },
-    { OPTION_FORMAT, ALIAS_FORMAT, NULL, format_usage, 1, true, false },
-    { OPTION_ID_RANGE, ALIAS_ID_RANGE, NULL, id_range_usage, 1, false, false },
-    { OPTION_WITHOUT_SRA, ALIAS_WITHOUT_SRA, NULL, without_sra_usage, 1, false, false },
-    { OPTION_WITHOUT_ACCESSION, ALIAS_WITHOUT_ACCESSION, NULL, without_accession_usage, 1, false, false },
-    { OPTION_EXCLUDED_COLUMNS, ALIAS_EXCLUDED_COLUMNS, NULL, excluded_columns_usage, 1, true, false },
-    { OPTION_BOOLEAN, ALIAS_BOOLEAN, NULL, boolean_usage, 1, true, false },
-    { OPTION_NUMELEM, ALIAS_NUMELEM, NULL, numelem_usage, 1, false, false },
-    { OPTION_NUMELEMSUM, ALIAS_NUMELEMSUM, NULL, numelemsum_usage, 1, false, false },
-    { OPTION_SHOW_BLOBBING, NULL, NULL, show_blobbing_usage, 1, false, false },
-    { OPTION_ENUM_PHYS, NULL, NULL, enum_phys_usage, 1, false, false },
-    { OPTION_CHECK_CURL, NULL, NULL, NULL, 1, false, false },
-    { OPTION_OBJVER, ALIAS_OBJVER, NULL, objver_usage, 1, false, false },
-    { OPTION_OBJTYPE, ALIAS_OBJTYPE, NULL, objtype_usage, 1, false, false }
-};
-
-const char UsageDefaultName[] = "vdb-dump";
-
-
-rc_t CC UsageSummary ( const char * progname )
-{
-    return KOutMsg ("\n"
-                    "Usage:\n"
-                    "  %s <path> [<path> ...] [options]\n"
-                    "\n", progname);
-}
-
-
-rc_t CC Usage ( const Args * args )
-{
-    const char * progname = UsageDefaultName;
-    const char * fullpath = UsageDefaultName;
-    rc_t rc;
-
-    if ( args == NULL )
-        rc = RC ( rcApp, rcArgv, rcAccessing, rcSelf, rcNull );
-    else
-        rc = ArgsProgram ( args, &fullpath, &progname );
-
-    if ( rc )
-        progname = fullpath = UsageDefaultName;
-
-    UsageSummary ( progname );
-
-    KOutMsg ( "Options:\n" );
-
-    HelpOptionLine ( ALIAS_ROW_ID_ON, OPTION_ROW_ID_ON, NULL, row_id_on_usage );
-    HelpOptionLine ( ALIAS_LINE_FEED, OPTION_LINE_FEED, "line_feed", line_feed_usage );
-    HelpOptionLine ( ALIAS_COLNAME_OFF, OPTION_COLNAME_OFF, NULL, colname_off_usage );
-    HelpOptionLine ( ALIAS_IN_HEX, OPTION_IN_HEX, NULL, in_hex_usage );
-    HelpOptionLine ( ALIAS_TABLE, OPTION_TABLE, "table", table_usage );
-    HelpOptionLine ( ALIAS_ROWS, OPTION_ROWS, "rows", rows_usage );
-    HelpOptionLine ( ALIAS_COLUMNS, OPTION_COLUMNS, "columns", columns_usage );
-    HelpOptionLine ( ALIAS_SCHEMA, OPTION_SCHEMA, "schema", schema_usage );
-    HelpOptionLine ( ALIAS_SCHEMA_DUMP, OPTION_SCHEMA_DUMP, NULL, schema_dump_usage );
-    HelpOptionLine ( ALIAS_TABLE_ENUM, OPTION_TABLE_ENUM, NULL, table_enum_usage );
-    HelpOptionLine ( ALIAS_COLUMN_ENUM, OPTION_COLUMN_ENUM, NULL, column_enum_usage );
-    HelpOptionLine ( ALIAS_COLUMN_SHORT, OPTION_COLUMN_SHORT, NULL, column_short_usage );
-    HelpOptionLine ( ALIAS_DNA_BASES, OPTION_DNA_BASES, "dna_bases", dna_bases_usage );
-    HelpOptionLine ( ALIAS_MAX_LINE_LEN, OPTION_MAX_LINE_LEN, "max_length", max_line_len_usage );
-    HelpOptionLine ( ALIAS_LINE_INDENT, OPTION_LINE_INDENT, "indent_width", line_indent_usage );
-    HelpOptionLine ( ALIAS_FORMAT, OPTION_FORMAT, "format", format_usage );
-    HelpOptionLine ( ALIAS_ID_RANGE, OPTION_ID_RANGE, NULL, id_range_usage );
-    HelpOptionLine ( ALIAS_WITHOUT_SRA, OPTION_WITHOUT_SRA, NULL, without_sra_usage );
-    HelpOptionLine ( ALIAS_WITHOUT_ACCESSION, OPTION_WITHOUT_ACCESSION, NULL, without_accession_usage );
-    HelpOptionLine ( ALIAS_EXCLUDED_COLUMNS, OPTION_EXCLUDED_COLUMNS, NULL, excluded_columns_usage );
-    HelpOptionLine ( ALIAS_BOOLEAN, OPTION_BOOLEAN, NULL, boolean_usage );
-    HelpOptionLine ( ALIAS_OBJVER, OPTION_OBJVER, NULL, objver_usage );
-    HelpOptionLine ( ALIAS_OBJTYPE, OPTION_OBJTYPE, NULL, objtype_usage );
-    HelpOptionLine ( ALIAS_NUMELEM, OPTION_NUMELEM, NULL, numelem_usage );
-    HelpOptionLine ( ALIAS_NUMELEMSUM, OPTION_NUMELEMSUM, NULL, numelemsum_usage );
-    HelpOptionLine ( NULL, OPTION_SHOW_BLOBBING, NULL, show_blobbing_usage );
-    HelpOptionLine ( NULL, OPTION_ENUM_PHYS, NULL, enum_phys_usage );
-
-    HelpOptionsStandard ();
-
-    HelpVersion ( fullpath, KAppVersion() );
-
-    return rc;
-}
-
-
-/* Version  EXTERN
- *  return 4-part version code: 0xMMmmrrrr, where
- *      MM = major release
- *      mm = minor release
- *    rrrr = bug-fix release
- */
-ver_t CC KAppVersion ( void )
-{
-    return VDB_DUMP_VERS;
-}
-
-/*************************************************************************************
-    read_cell_data_and_dump:
-    * called by "dump_rows()" via VectorForEach() for every column in a row
-    * extracts the column-definition from the item, the row-context from the data-ptr
-    * clears the column-text-buffer (part of the column-data-struct)
-    * reads the cell-data from the cursor
-    * eventually detects a unknown data-type
-    * detects if this column has a dna-format ( special treatment for printing )
-    * loops throuh the elements of a cell
-        - calls "dump_element()" for every element (from vdb-dump-tools.c)
-
-item    [IN] ... pointer to col-data ( definition and buffer )
-data    [IN] ... pointer to row-context( cursor, dump_context, col_defs ... )
-*************************************************************************************/
-static void CC vdm_read_cell_data( void *item, void *data )
-{
-    dump_src src; /* defined in vdb-dump-tools.h */
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-
-    if ( r_ctx->rc != 0 ) return; /* important to stop if the last read was not successful */
-    vds_clear( &(my_col_def->content) ); /* clear the destination-dump-string */
-    if ( my_col_def->valid == false ) return;
-    if ( my_col_def->excluded == true ) return;
-
-    /* read the data of a cursor-cell: buffer-addr, offset and element-count
-       is stored in the dump_src-struct */
-    r_ctx->rc = VCursorCellData( r_ctx->cursor, my_col_def->idx, NULL, &src.buf,
-                                 &src.offset_in_bits, &src.number_of_elements );
-    if ( r_ctx->rc != 0 )
-    {
-        if( UIError(r_ctx->rc, NULL, r_ctx->table) ) {
-            UITableLOGError(r_ctx->rc, r_ctx->table, true);
-        } else {
-            PLOGERR( klogInt,
-                     (klogInt,
-                     r_ctx->rc,
-                     "VCursorCellData( col:$(col_name) at row #$(row_nr) ) failed",
-                     "col_name=%s,row_nr=%lu",
-                      my_col_def->name, r_ctx->row_id ));
-            /* be forgiving and continue if a cell cannot be read */
-        }
-        r_ctx->rc = 0;
-    }
-
-    /* check the type-domain */
-    if ( ( my_col_def->type_desc.domain < vtdBool )||
-         ( my_col_def->type_desc.domain > vtdUnicode ) )
-    {
-        vds_append_str( &(my_col_def->content), "unknown data-type" );
-    }
-    else
-    {
-        bool print_comma = true;
-
-        /* initialize the element-idx ( for dimension > 1 ) */
-        src.element_idx = 0;
-
-        /* transfer context-flags (hex-print, no sra-types) */
-        src.in_hex = r_ctx->ctx->print_in_hex;
-        src.without_sra_types = r_ctx->ctx->without_sra_types;
-
-        /* hardcoded printing of dna-bases if the column-type fits */
-        src.print_dna_bases = ( r_ctx->ctx->print_dna_bases &
-                    ( my_col_def->type_desc.intrinsic_dim == 2 ) &
-                    ( my_col_def->type_desc.intrinsic_bits == 1 ) );
-
-        /* how a boolean is displayed */
-        src.c_boolean = r_ctx->ctx->c_boolean;
-
-        if ( my_col_def->type_desc.domain == vtdBool && src.c_boolean != 0 )
-        {
-            print_comma = false;
-        }
-
-        if ( r_ctx->ctx->print_num_elem )
-        {
-            char temp[ 16 ];
-            size_t num_writ;
-
-            r_ctx->rc = string_printf ( temp, sizeof temp, &num_writ, "%u", src.number_of_elements ); 
-            if ( r_ctx->rc == 0 )
-                vds_append_str( &(my_col_def->content), temp );
-        }
-        else if ( r_ctx->ctx->sum_num_elem )
-        {
-            my_col_def->elementsum += src.number_of_elements;
-        }
-        else
-        {
-            /* loop through the elements(dimension's) of a cell */
-            while( ( src.element_idx < src.number_of_elements )&&( r_ctx->rc == 0 ) )
-            {
-                uint32_t eidx = src.element_idx;
-                if ( ( eidx > 0 )&& ( src.print_dna_bases == false ) && print_comma )
-                {
-                    vds_append_str( &(my_col_def->content), ", " );
-                }
-
-                /* dumps the basic data-types, implementation in vdb-dump-tools.c
-                   >>> that means it appends the element-string to
-                       my_col_def->content <<<
-                   the formated output is only collected, to be printed later
-                   dump_element is also responsible for incrementing
-                   the src.element_idx by: 1...bool/int/uint/float
-                                           n...string/unicode-string */
-                r_ctx->rc = vdt_dump_element( &src, my_col_def );
-
-                /* insurance against endless loop */
-                if ( eidx == src.element_idx )
-                {
-                    src.element_idx++;
-                }
-            }
-        }
-    }
-}
-
-
-
-static void CC vdm_print_elem_sum( void *item, void *data )
-{
-    char temp[ 16 ];
-    size_t num_writ;
-    p_col_def my_col_def = (p_col_def)item;
-    p_row_context r_ctx = (p_row_context)data;
-
-    if ( r_ctx->rc != 0 ) return; /* important to stop if the last read was not successful */
-    vds_clear( &(my_col_def->content) ); /* clear the destination-dump-string */
-
-    r_ctx->rc = string_printf ( temp, sizeof temp, &num_writ, "%u", my_col_def->elementsum ); 
-    if ( r_ctx->rc == 0 )
-        vds_append_str( &(my_col_def->content), temp );
-}
-
-
-static void vdm_row_error( const char * fmt, rc_t rc, uint64_t row_id )
-{
-    PLOGERR( klogInt, ( klogInt, rc, fmt, "row_nr=%lu", row_id ) );
-
-}
-
-/*************************************************************************************
-    dump_rows:
-    * is the main loop to dump all rows or all selected rows ( -R1-10 )
-    * creates a dump-string ( parameterizes it with the wanted max. line-len )
-    * starts the number-generator
-    * as long as the number-generator has a number and the result-code is ok
-      do for every row-id:
-        - set the row-id into the cursor and open the cursor-row
-        - loop throuh the columns
-        - close the row
-        - call print_row (vdb-dump-formats.c) which actually prints the row
-    * the collection of the text's for the columns "read_cell_data_and_dump()"
-      is separated from the actual printing "print_row()" !
-
-r_ctx   [IN] ... row-context ( cursor, dump_context, col_defs ... )
-*************************************************************************************/
-static rc_t vdm_dump_rows( p_row_context r_ctx )
-{
-    /* the important row_id is a member of r_ctx ! */
-    r_ctx->rc = vds_make( &(r_ctx->s_col), r_ctx->ctx->max_line_len, 512 );
-    if ( r_ctx->rc != 0 )
-        vdm_row_error( "dump_str_make( row#$(row_nr) ) failed", 
-                        r_ctx->rc, r_ctx->row_id );
-    if ( r_ctx->rc == 0 )
-    {
-        vdn_start( r_ctx->ctx->row_generator );
-        while ( ( vdn_next( r_ctx->ctx->row_generator, &(r_ctx->row_id )) )&&
-                ( r_ctx->rc == 0 ) )
-        {
-            r_ctx-> rc = Quitting();
-            if ( r_ctx->rc != 0 )
-                break;
-            r_ctx->rc = VCursorSetRowId( r_ctx->cursor, r_ctx->row_id );
-            if ( r_ctx->rc != 0 )
-                vdm_row_error( "VCursorSetRowId( row#$(row_nr) ) failed", 
-                               r_ctx->rc, r_ctx->row_id );
-            if ( r_ctx->rc == 0 )
-            {
-                r_ctx->rc = VCursorOpenRow( r_ctx->cursor );
-                if ( r_ctx->rc != 0 )
-                    vdm_row_error( "VCursorOpenRow( row#$(row_nr) ) failed", 
-                                   r_ctx->rc, r_ctx->row_id );
-                if ( r_ctx->rc == 0 )
-                {
-                    /* first reset the string and valid-flag for every column */
-                    vdcd_reset_content( r_ctx->col_defs );
-
-                    /* read the data of every column and create a string for it */
-                    VectorForEach( &(r_ctx->col_defs->cols),
-                                   false, vdm_read_cell_data, r_ctx );
-
-                    if ( r_ctx->rc == 0 )
-                    {
-                        /* prints the collected strings, in vdb-dump-formats.c */
-                        if ( !r_ctx->ctx->sum_num_elem )
-                        {
-                            r_ctx->rc = vdfo_print_row( r_ctx );
-                            if ( r_ctx->rc != 0 )
-                                vdm_row_error( "vdfo_print_row( row#$(row_nr) ) failed", 
-                                       r_ctx->rc, r_ctx->row_id );
-                        }
-                    }
-                    r_ctx->rc = VCursorCloseRow( r_ctx->cursor );
-                    if ( r_ctx->rc != 0 )
-                        vdm_row_error( "VCursorCloseRow( row#$(row_nr) ) failed", 
-                                       r_ctx->rc, r_ctx->row_id );
-                }
-            }
-        }
-        if ( r_ctx->rc == 0 && r_ctx->ctx->sum_num_elem )
-        {
-            VectorForEach( &(r_ctx->col_defs->cols),
-                           false, vdm_print_elem_sum, r_ctx );
-            if ( r_ctx->rc == 0 )
-            {
-                r_ctx->rc = vdfo_print_row( r_ctx );
-                DISP_RC( r_ctx->rc, "VTableOpenSchema() failed" );
-            }
-        }
-        vds_free( &(r_ctx->s_col) );
-    }
-    return r_ctx->rc;
-}
-
-
-static bool vdm_extract_or_parse_columns( const p_dump_context ctx,
-                                          const VTable *my_table,
-                                          p_col_defs my_col_defs )
-{
-    bool res = false;
-    if ( ctx != NULL && my_col_defs != NULL )
-    {
-        bool cols_unknown = ( ( ctx->columns == NULL ) || ( string_cmp( ctx->columns, 1, "*", 1, 1 ) == 0 ) );
-        if ( cols_unknown )
-            /* the user does not know the column-names or wants all of them */
-            res = vdcd_extract_from_table( my_col_defs, my_table );
-        else
-            /* the user knows the names of the wanted columns... */
-            res = vdcd_parse_string( my_col_defs, ctx->columns, my_table );
-
-        if ( ctx->excluded_columns != NULL )
-            vdcd_exclude_these_columns( my_col_defs, ctx->excluded_columns );
-    }
-
-    return res;
-}
-
-
-static bool vdm_extract_or_parse_phys_columns( const p_dump_context ctx,
-                                               const VTable *my_table,
-                                               p_col_defs my_col_defs )
-{
-    bool res = false;
-    if ( ctx != NULL && my_col_defs != NULL )
-    {
-        bool cols_unknown = ( ( ctx->columns == NULL ) || ( string_cmp( ctx->columns, 1, "*", 1, 1 ) == 0 ) );
-        if ( cols_unknown )
-            /* the user does not know the column-names or wants all of them */
-            res = vdcd_extract_from_phys_table( my_col_defs, my_table );
-        else
-            /* the user knows the names of the wanted columns... */
-            res = vdcd_parse_string( my_col_defs, ctx->columns, NULL );
-
-        if ( ctx->excluded_columns != NULL )
-            vdcd_exclude_these_columns( my_col_defs, ctx->excluded_columns );
-    }
-
-    return res;
-}
-
-/*************************************************************************************
-    dump_tab_table:
-    * called by "dump_db_table()" and "dump_tab()" as a fkt-pointer
-    * opens a cursor to read
-    * checks if the user did not specify columns, or wants all columns ( "*" )
-        no columns specified ---> calls "col_defs_extract_from_table()"
-        columns specified ---> calls "col_defs_parse_string()"
-    * we end up with a list of column-definitions (name,type) in my_col_defs
-    * calls "col_defs_add_to_cursor()" to add them to the cursor
-    * opens the cursor
-    * calls "dump_rows()" to execute the dump
-    * destroys the my_col_defs - structure
-    * releases the cursor
-
-ctx       [IN] ... contains path, tablename, columns, row-range etc.
-my_table  [IN] ... open table needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_dump_opened_table( const p_dump_context ctx, const VTable *my_table )
-{
-    row_context r_ctx;
-    rc_t rc = VTableCreateCachedCursorRead( my_table, &(r_ctx.cursor), CURSOR_CACHE_SIZE );
-    DISP_RC( rc, "VTableCreateCursorRead() failed" );
-    if ( rc == 0 )
-    {
-        r_ctx.table = my_table;
-        if ( !vdcd_init( &(r_ctx.col_defs), ctx->max_line_len ) )
-        {
-            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            DISP_RC( rc, "col_defs_init() failed" );
-        }
-
-        if ( rc == 0 )
-        {
-            if ( vdm_extract_or_parse_columns( ctx, my_table, r_ctx.col_defs ) )
-            {
-                if ( vdcd_add_to_cursor( r_ctx.col_defs, r_ctx.cursor ) )
-                {
-                    const VSchema *my_schema;
-                    rc = VTableOpenSchema( my_table, &my_schema );
-                    DISP_RC( rc, "VTableOpenSchema() failed" );
-                    if ( rc == 0 )
-                    {
-                    /* translate in special columns to numeric values to strings */
-                        vdcd_ins_trans_fkt( r_ctx.col_defs, my_schema );
-                        VSchemaRelease( my_schema );
-                    }
-
-                    rc = VCursorOpen( r_ctx.cursor );
-                    DISP_RC( rc, "VCursorOpen() failed" );
-                    if ( rc == 0 )
-                    {
-                        int64_t  first;
-                        uint64_t count;
-                        rc = VCursorIdRange( r_ctx.cursor, 0, &first, &count );
-                        DISP_RC( rc, "VCursorIdRange() failed" );
-                        if ( rc == 0 )
-                        {
-                            /* if the user did not specify a row-range, take all rows */
-                            if ( vdn_range_defined( ctx->row_generator ) == false )
-                            {
-                                vdn_set_range( ctx->row_generator, first, count );
-                            }
-                            /* if the user did specify a row-range, check the boundaries */
-                            else
-                            {
-                                vdn_check_range( ctx->row_generator, first, count );
-                            }
-
-                            if ( vdn_range_defined( ctx->row_generator ) )
-                            {
-                                r_ctx.ctx = ctx;
-                                rc = vdm_dump_rows( &r_ctx ); /* <--- */
-                            }
-                            else
-                            {
-                                rc = RC( rcExe, rcDatabase, rcReading, rcRange, rcEmpty );
-                            }
-                        }
-                    }
-                }
-            }
-            vdcd_destroy( r_ctx.col_defs );
-        }
-        VCursorRelease( r_ctx.cursor );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    dump_db_table:
-    * called by "dump_database()" as a fkt-pointer
-    * opens a table to read
-    * calls "dump_tab_table()" to do the dump
-    * releases the table
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_dump_opened_database( const p_dump_context ctx,
-                                      const VDatabase *my_database )
-{
-    rc_t rc;
-    const VTable *my_table;
-
-    rc = VDatabaseOpenTableRead( my_database, &my_table, ctx->table );
-    DISP_RC( rc, "VDatabaseOpenTableRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = vdm_dump_opened_table( ctx, my_table );
-        VTableRelease( my_table );
-    }
-    return rc;
-}
-
-/********************************************************************
-helper function, needed by "VSchemaDump()"
-********************************************************************/
-static rc_t CC vdm_schema_dump_flush( void *dst, const void *buffer, size_t bsize )
-{
-    FILE *f = dst;
-    fwrite( buffer, 1, bsize, f );
-    return 0;
-}
-
-/*************************************************************************************
-    dump_the_tab_schema:
-    * called by "dump_the_db_schema()" and "dump_table()" as a function pointer
-    * opens the schema of a table
-    * calls "VSchemaDump()" to dump this schema
-    * releases the schema
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_dump_tab_schema( const p_dump_context ctx,
-                                 const VTable *my_table )
-{
-    const VSchema *my_schema;
-    rc_t rc = VTableOpenSchema( my_table, &my_schema );
-    DISP_RC( rc, "VTableOpenSchema() failed" );
-    if ( rc == 0 )
-    {
-        rc = VSchemaDump( my_schema, sdmPrint, NULL,
-                          vdm_schema_dump_flush, stdout );
-        DISP_RC( rc, "VSchemaDump() failed" );
-        VSchemaRelease( my_schema );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    dump_the_db_schema:
-    * called by "dump_database()" as a function pointer
-    * opens a table to read
-    * calls "dump_the_tab_schema()" to dump the schema of this table
-    * releases the table
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_dump_db_schema( const p_dump_context ctx,
-                                const VDatabase *my_database )
-{
-    const VTable *my_table;
-    rc_t rc = VDatabaseOpenTableRead( my_database, &my_table, ctx->table );
-    DISP_RC( rc, "VDatabaseOpenTableRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = vdm_dump_tab_schema( ctx, my_table );
-        VTableRelease( my_table );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    enum_tables:
-    * called by "dump_database()" as a function pointer
-    * calls VDatabaseListTbl() to get a list of Tables
-    * loops through this list to print the names
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_enum_tables( const p_dump_context ctx,
-                             const VDatabase *my_database )
-{
-    rc_t rc = KOutMsg( "enumerating the tables of database '%s'\n", ctx->path );
-    if ( rc == 0 )
-    {
-        KNamelist *tbl_names;
-        rc = VDatabaseListTbl( my_database, &tbl_names );
-        DISP_RC( rc, "VDatabaseListTbl() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t n;
-            rc = KNamelistCount( tbl_names, &n );
-            DISP_RC( rc, "KNamelistCount() failed" );
-            if ( rc == 0 )
-            {
-                uint32_t i;
-                for ( i = 0; i < n && rc == 0; ++i )
-                {
-                    const char *tbl_name;
-                    rc = KNamelistGet( tbl_names, i, &tbl_name );
-                    DISP_RC( rc, "KNamelistGet() failed" );
-                    if ( rc == 0 )
-                        rc = KOutMsg( "tbl #%u: %s\n", i+1, tbl_name );
-                }
-            }
-            KNamelistRelease( tbl_names );
-        }
-    }
-    return rc;
-}
-
-typedef struct col_info_context
-{
-    p_dump_context ctx;
-    const VSchema *my_schema;
-    const VTable *my_table;
-    const KTable *my_ktable;
-} col_info_context;
-typedef struct col_info_context* p_col_info_context;
-
-static rc_t vdm_print_column_datatypes( const p_col_def col_def,
-                                        const p_col_info_context ci )
-{
-    KNamelist *names;
-    uint32_t dflt_idx;
-
-    rc_t rc = VTableColumnDatatypes( ci->my_table, col_def->name, &dflt_idx, &names );
-    DISP_RC( rc, "VTableColumnDatatypes() failed" );
-    if ( rc == 0 )
-    {
-        uint32_t n;
-        rc = KNamelistCount( names, &n );
-        DISP_RC( rc, "KNamelistCount() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t i;
-            for ( i = 0; i < n && rc == 0; ++i )
-            {
-                const char *type_name;
-                rc = KNamelistGet( names, i, &type_name );
-                DISP_RC( rc, "KNamelistGet() failed" );
-                if ( rc == 0 )
-                {
-                    if ( dflt_idx == i )
-                        rc = KOutMsg( "%20s.type[%d] = %s (dflt)\n", col_def->name, i, type_name );
-                    else
-                        rc = KOutMsg( "%20s.type[%d] = %s\n", col_def->name, i, type_name );
-                }
-            }
-        }
-        rc = KNamelistRelease( names );
-        DISP_RC( rc, "KNamelistRelease() failed" );
-    }
-    if ( rc == 0 )
-        rc = KOutMsg( "\n" );
-    return rc;
-}
-
-
-static rc_t vdm_show_row_blobbing( const p_col_def col_def,
-                                   const p_col_info_context ci )
-{
-    const KColumn * kcol;
-    rc_t rc = KTableOpenColumnRead( ci->my_ktable, &kcol, "%s", col_def->name );
-    if ( rc != 0 )
-        return KOutMsg( "'%s' is not a physical column\n", col_def->name );
-    else
-        rc = KOutMsg( "\nCOLUMN '%s':\n", col_def->name );
-
-    if ( rc == 0 )
-    {
-        int64_t first;
-        uint64_t count;
-        rc = KColumnIdRange( kcol, &first, &count );
-        DISP_RC( rc, "KColumnIdRange() failed" );
-        if ( rc == 0 )
-        {
-            int64_t last = first + count;
-            rc = KOutMsg( "range: %,ld ... %,ld\n", first, last );
-            if ( rc == 0 )
-            {
-                int64_t id = first;
-                while ( id < last && rc == 0 )
-                {
-                    const KColumnBlob *blob;
-                    rc = KColumnOpenBlobRead( kcol, &blob, id );
-                    DISP_RC( rc, "KColumnOpenBlobRead() failed" );
-                    if ( rc == 0 )
-                    {
-                        int64_t first_id_in_blob;
-                        uint32_t ids_in_blob;
-                        rc = KColumnBlobIdRange( blob, &first_id_in_blob, &ids_in_blob );
-                        DISP_RC( rc, "KColumnBlobIdRange() failed" );
-                        if ( rc == 0 )
-                        {
-                            int64_t last_id_in_blob = first_id_in_blob + ids_in_blob - 1;
-                            char buffer[ 8 ];
-                            size_t num_read, remaining;
-                            rc = KColumnBlobRead ( blob, 0, &buffer, 0, &num_read, &remaining );
-                            DISP_RC( rc, "KColumnBlobRead() failed" );
-                            if ( rc == 0 )
-                            {
-                                rc = KOutMsg( "blob[ %,ld ... %,ld] size = %,zu\n", first_id_in_blob, last_id_in_blob, remaining );
-                            }
-                            id = last_id_in_blob + 1;
-                        }
-                        KColumnBlobRelease( blob );
-                    }
-                }
-            }
-        }
-        KColumnRelease( kcol );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    print_column_info:
-    * get's called from "enum_tab_columns()" via VectorForEach
-    * prints: table-name, col-idx, bits, dimension, domain and name
-      for every column
-
-item  [IN] ... pointer to a column-definition-struct ( from "vdb-dump-coldefs.h" )
-data  [IN] ... pointer to dump-context ( in this case to have a line-idx )
-*************************************************************************************/
-static rc_t vdm_print_column_info( const p_col_def col_def, p_col_info_context ci_ctx )
-{
-    rc_t rc = 0;
-
-    if ( ci_ctx->ctx->show_blobbing )
-        rc = vdm_show_row_blobbing( col_def, ci_ctx );
-    else
-    {
-        /* print_col_info is in vdb-dump-helper.c */
-        rc = vdh_print_col_info( ci_ctx->ctx , col_def, ci_ctx->my_schema );
-
-        /* to test VTableColumnDatatypes() */
-        if ( rc == 0  && ci_ctx->ctx->column_enum_requested )
-            rc = vdm_print_column_datatypes( col_def, ci_ctx );
-    }
-    return rc;
-}
-
-
-static rc_t vdm_enum_phys_columns( const VTable *my_table )
-{
-    rc_t rc = KOutMsg( "physical columns:\n" );
-    if ( rc == 0 )
-    {
-        KNamelist *phys;
-        rc = VTableListPhysColumns( my_table, &phys );
-        DISP_RC( rc, "VTableListPhysColumns() failed" );
-        if ( rc == 0 )
-        {
-            uint32_t count;
-            rc = KNamelistCount( phys, &count );
-            DISP_RC( rc, "KNamelistCount( physical columns ) failed" );
-            if ( rc == 0 )
-            {
-                if ( count > 0 )
-                {
-                    uint32_t idx;
-                    for ( idx = 0; idx < count && rc == 0; ++idx )
-                    {
-                        const char * name;
-                        rc = KNamelistGet( phys, idx, &name );
-                        DISP_RC( rc, "KNamelistGet( physical columns ) failed" );
-                        if ( rc == 0 )
-                            rc = KOutMsg( "[%.02d] = %s\n", idx, name );
-                    }
-                }
-                else
-                {
-                    rc = KOutMsg( "... list is empty!\n" );
-                }
-            }
-            KNamelistRelease( phys );
-        }
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    enum_tab_columns:
-    * called by "enum_db_columns()" and "dump_table()" as fkt-pointer
-    * initializes a column-definitions-structure
-    * calls col_defs_extract_from_table() to enumerate all columns in the table
-    ( both functions are in "vdb-dump-coldefs.h" )
-    * loops through the columns and prints it's information
-    * releases the column-definitions-structure
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_enum_tab_columns( const p_dump_context ctx, const VTable *my_table )
-{
-    rc_t rc = 0;
-    if ( ctx->enum_phys )
-    {
-        rc = vdm_enum_phys_columns( my_table );
-    }
-    else
-    {
-        col_defs *my_col_defs;
-        if ( !vdcd_init( &my_col_defs, ctx->max_line_len ) )
-        {
-            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            DISP_RC( rc, "col_defs_init() failed" );
-        }
-
-        if ( rc == 0 )
-        {
-            col_info_context ci_ctx;
-            bool extracted;
-
-            ci_ctx.ctx = ctx;
-            ci_ctx.my_table = my_table;
-            if ( ctx->show_blobbing )
-            {
-                extracted = vdm_extract_or_parse_phys_columns( ctx, my_table, my_col_defs );
-                rc = VTableOpenKTableRead( my_table, &ci_ctx.my_ktable );
-                DISP_RC( rc, "VTableOpenKTableRead() failed" );
-            }
-            else
-            {
-                extracted = vdm_extract_or_parse_columns( ctx, my_table, my_col_defs );
-                ci_ctx.my_ktable = NULL;
-            }
-
-            if ( extracted && rc == 0 )
-            {
-                rc = VTableOpenSchema( my_table, &(ci_ctx.my_schema) );
-                DISP_RC( rc, "VTableOpenSchema() failed" );
-                if ( rc == 0 )
-                {
-                    uint32_t idx, count;
-
-                    ctx->generic_idx = 1;
-                    count = VectorLength( &(my_col_defs->cols) );
-                    for ( idx = 0; idx < count && rc == 0; ++idx )
-                    {
-                        col_def *col = ( col_def * )VectorGet( &(my_col_defs->cols), idx );
-                        if ( col != 0 )
-                        {
-                            rc = vdm_print_column_info( col, &ci_ctx );
-                        }
-                    }
-                    VSchemaRelease( ci_ctx.my_schema );
-                }
-                if ( ci_ctx.my_ktable != NULL )
-                    KTableRelease( ci_ctx.my_ktable );
-            }
-            else
-            {
-                rc = KOutMsg( "error in col_defs_extract_from_table\n" );
-            }
-            vdcd_destroy( my_col_defs );
-        }
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    enum_db_columns:
-    * called by "dump_database()" as fkt-pointer
-    * opens the table
-    * calls enum_tab_columns()
-    * releases table
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_enum_db_columns( const p_dump_context ctx, const VDatabase *my_database )
-{
-    rc_t rc;
-    const VTable *my_table;
-
-    rc = VDatabaseOpenTableRead( my_database, &my_table, ctx->table );
-    DISP_RC( rc, "VDatabaseOpenTableRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = vdm_enum_tab_columns( ctx, my_table );
-        VTableRelease( my_table );
-    }
-    return rc;
-}
-
-
-static rc_t vdm_print_tab_id_range( const p_dump_context ctx, const VTable *my_table )
-{
-    const VCursor *my_cursor;
-    rc_t rc = VTableCreateCursorRead( my_table, &my_cursor );
-    DISP_RC( rc, "VTableCreateCursorRead() failed" );
-    if ( rc == 0 )
-    {
-        col_defs *my_col_defs;
-
-        if ( !vdcd_init( &my_col_defs, ctx->max_line_len ) )
-        {
-            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
-            DISP_RC( rc, "col_defs_init() failed" );
-        }
-
-        if ( rc == 0 )
-        {
-            if ( vdm_extract_or_parse_columns( ctx, my_table, my_col_defs ) )
-            {
-                if ( vdcd_add_to_cursor( my_col_defs, my_cursor ) )
-                {
-                    rc = VCursorOpen( my_cursor );
-                    DISP_RC( rc, "VCursorOpen() failed" );
-                    if ( rc == 0 )
-                    {
-                        int64_t  first;
-                        uint64_t count;
-                        rc = VCursorIdRange( my_cursor, 0, &first, &count );
-                        DISP_RC( rc, "VCursorIdRange() failed" );
-                        if ( rc == 0 )
-                            rc = KOutMsg( "id-range: first-row = %,ld, row-count = %,ld\n", first, count );
-                    }
-                }
-            }
-            vdcd_destroy( my_col_defs );
-        }
-        VCursorRelease( my_cursor );
-    }
-    return rc;
-}
-
-/*************************************************************************************
-    print_db_id_range:
-    * called by "dump_database()" as fkt-pointer
-    * opens the table
-    * calls print_tab_id_range()
-    * releases table
-
-ctx         [IN] ... contains path, tablename, columns, row-range etc.
-my_database [IN] ... open database needed for vdb-calls
-*************************************************************************************/
-static rc_t vdm_print_db_id_range( const p_dump_context ctx, const VDatabase *my_database )
-{
-    rc_t rc;
-    const VTable *my_table;
-
-    rc = VDatabaseOpenTableRead( my_database, &my_table, ctx->table );
-    DISP_RC( rc, "VDatabaseOpenTableRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = vdm_print_tab_id_range( ctx, my_table );
-        VTableRelease( my_table );
-    }
-    return rc;
-}
-
-typedef rc_t (*db_tab_t)( const p_dump_context ctx, const VTable *a_tab );
-
-/*************************************************************************************
-    dump_tab_fkt:
-    * called by "dump_table()"
-    * if the user has provided the name of a schema-file:
-        - make a schema from manager
-        - parse the schema-file
-        - use this schema to open the database
-    * if we do not have a schema-file, use NULL ( that means the internal tab-schema )
-    * open the table for read
-    * call the function-pointer, with context and table
-    * release table and schema
-
-ctx    [IN] ... contains source-path, tablename, columns and row-range as ascii-text
-db_fkt [IN] ... function to be called if directory, manager and database are open
-*************************************************************************************/
-static rc_t vdm_dump_tab_fkt( const p_dump_context ctx,
-                              const VDBManager *my_manager,
-                              const db_tab_t tab_fkt )
-{
-    const VTable *my_table;
-    VSchema *my_schema = NULL;
-    rc_t rc;
-
-    vdh_parse_schema( my_manager, &my_schema, &(ctx->schema_list) );
-
-    rc = VDBManagerOpenTableRead( my_manager, &my_table, my_schema, ctx->path );
-    DISP_RC( rc, "VDBManagerOpenTableRead() failed" );
-    if ( rc == 0 )
-    {
-        rc = tab_fkt( ctx, my_table ); /* fkt-pointer is called */
-        VTableRelease( my_table );
-    }
-
-    if ( my_schema )
-        VSchemaRelease( my_schema );
-
-    return rc;
-}
-
-
-static bool enum_col_request( const p_dump_context ctx )
-{
-    return ( ctx->column_enum_requested || ctx->column_enum_short || 
-             ctx->show_blobbing || ctx->enum_phys );
-}
-
-/***************************************************************************
-    dump_table:
-    * called by "dump_main()" to handle a table
-    * calls the dump_tab_fkt with 3 different fkt-pointers as argument
-      depending on what was selected at the commandline
-
-ctx        [IN] ... contains path, tablename, columns, row-range etc.
-my_manager [IN] ... open manager needed for vdb-calls
-***************************************************************************/
-static rc_t vdm_dump_table( const p_dump_context ctx, const VDBManager *my_manager )
-{
-    rc_t rc;
-
-    /* take ctx->path as table ( if ctx->table is empty ) */
-    if ( ctx->table == NULL )
-    {
-        ctx->table = string_dup_measure ( ctx->path, NULL );
-    }
-    if ( ctx->schema_dump_requested )
-    {
-        rc = vdm_dump_tab_fkt( ctx, my_manager, vdm_dump_tab_schema );
-    }
-    else if ( ctx->table_enum_requested )
-    {
-        KOutMsg( "cannot enum tables of a table-object\n" );
-        rc = RC ( rcApp, rcArgv, rcAccessing, rcParam, rcInvalid );
-    }
-    else if ( enum_col_request( ctx ) )
-    {
-        rc = vdm_dump_tab_fkt( ctx, my_manager, vdm_enum_tab_columns );
-    }
-    else if ( ctx->id_range_requested )
-    {
-        rc = vdm_dump_tab_fkt( ctx, my_manager, vdm_print_tab_id_range );
-    }
-    else
-    {
-        rc = vdm_dump_tab_fkt( ctx, my_manager, vdm_dump_opened_table );
-    }
-
-    return rc;
-}
-
-typedef rc_t (*db_fkt_t)( const p_dump_context ctx, const VDatabase *a_db );
-
-/*************************************************************************************
-    dump_db_fkt:
-    * called by "dump_database()" to handle a database
-    * if the user has provided the name of a schema-file:
-        - make a schema from manager
-        - parse the schema-file
-        - use this schema to open the database
-    * if we do not have a schema-file, use NULL ( that means the internal db-schema )
-    * open the database for read
-    * if the user has not given a table-name to dump:
-        - take the first table found in the database
-    * if we now have a table-name
-        - call the function-pointer, with context and database
-    * if we do not have a table-name
-        - request display of the usage-message
-    * release database and schema
-
-ctx    [IN] ... contains source-path, tablename, columns and row-range as ascii-text
-db_fkt [IN] ... function to be called if directory, manager and database are open
-*************************************************************************************/
-static rc_t vdm_dump_db_fkt( const p_dump_context ctx,
-                             const VDBManager *my_manager,
-                             const db_fkt_t db_fkt )
-{
-    const VDatabase *my_database;
-    VSchema *my_schema = NULL;
-    rc_t rc;
-
-    vdh_parse_schema( my_manager, &my_schema, &(ctx->schema_list) );
-
-    rc = VDBManagerOpenDBRead( my_manager, &my_database, my_schema, ctx->path );
-    DISP_RC( rc, "VDBManagerOpenDBRead() failed" );
-    if ( rc == 0 )
-    {
-        bool table_defined = ( ctx->table != NULL );
-        if ( !table_defined )
-        {
-            table_defined = vdh_take_this_table_from_db( ctx, my_database, "SEQUENCE" );
-            if ( !table_defined )
-                table_defined = vdh_take_1st_table_from_db( ctx, my_database );
-        }
-        if ( table_defined )
-        {
-            rc = db_fkt( ctx, my_database ); /* fkt-pointer is called */
-        }
-        else
-        {
-            LOGMSG( klogInfo, "opened as vdb-database, but no table found" );
-            ctx->usage_requested = true;
-        }
-        VDatabaseRelease( my_database );
-    }
-
-    if ( my_schema != NULL )
-    {
-        VSchemaRelease( my_schema );
-    }
-
-    return rc;
-}
-
-
-/***************************************************************************
-    dump_database:
-    * called by "dump_main()"
-    * calls the dump_db_fkt with 4 different fkt-pointers as argument
-      depending on what was selected at the commandline
-
-ctx        [IN] ... contains path, tablename, columns, row-range etc.
-my_manager [IN] ... open manager needed for vdb-calls
-***************************************************************************/
-static rc_t vdm_dump_database( const p_dump_context ctx, const VDBManager *my_manager )
-{
-    rc_t rc;
-
-    if ( ctx->schema_dump_requested )
-    {
-        rc = vdm_dump_db_fkt( ctx, my_manager, vdm_dump_db_schema );
-    }
-    else if ( ctx->table_enum_requested )
-    {
-        rc = vdm_dump_db_fkt( ctx, my_manager, vdm_enum_tables );
-    }
-    else if ( enum_col_request( ctx ) )
-    {
-        rc = vdm_dump_db_fkt( ctx, my_manager, vdm_enum_db_columns );
-    }
-    else if ( ctx->id_range_requested )
-    {
-        rc = vdm_dump_db_fkt( ctx, my_manager, vdm_print_db_id_range );
-    }
-    else
-    {
-        rc = vdm_dump_db_fkt( ctx, my_manager, vdm_dump_opened_database );
-    }
-
-    return rc;
-}
-
-
-static rc_t vdm_print_objver( const p_dump_context ctx, const VDBManager *mgr )
-{
-    ver_t version;
-    rc_t rc = VDBManagerGetObjVersion ( mgr, &version, ctx->path );
-    DISP_RC( rc, "VDBManagerGetObjVersion() failed" );
-    if ( rc == 0 )
-        rc = KOutMsg( "%V\n", version );
-    return rc;
-}
-
-
-static void vdm_print_objtype( const VDBManager *mgr, const char * acc_or_path )
-{
-    int path_type = ( VDBManagerPathType ( mgr, acc_or_path ) & ~ kptAlias );
-    /* types defined in <kdb/manager.h> */
-    switch ( path_type )
-    {
-    case kptDatabase      :   KOutMsg( "Database\n" ); break;
-    case kptTable         :   KOutMsg( "Table\n" ); break;
-    case kptPrereleaseTbl :   KOutMsg( "Prerelease Table\n" ); break;
-    case kptColumn        :   KOutMsg( "Column\n" ); break;
-    case kptIndex         :   KOutMsg( "Index\n" ); break;
-    case kptNotFound      :   KOutMsg( "not found\n" ); break;
-    case kptBadPath       :   KOutMsg( "bad path\n" ); break;
-    case kptFile          :   KOutMsg( "File\n" ); break;
-    case kptDir           :   KOutMsg( "Dir\n" ); break;
-    case kptCharDev       :   KOutMsg( "CharDev\n" ); break;
-    case kptBlockDev      :   KOutMsg( "BlockDev\n" ); break;
-    case kptFIFO          :   KOutMsg( "FIFO\n" ); break;
-    case kptZombieFile    :   KOutMsg( "ZombieFile\n" ); break;
-    case kptDataset       :   KOutMsg( "Dataset\n" ); break;
-    case kptDatatype      :   KOutMsg( "Datatype\n" ); break;
-    default               :   KOutMsg( "value = '%i'\n", path_type ); break;
-    }
-}
-
-
-#define USE_PATHTYPE_TO_DETECT_DB_OR_TAB 1
-
-static rc_t vdb_main_one_obj_by_pathtype( const p_dump_context ctx,
-                                          const VDBManager *mgr,
-                                          const char * acc_or_path )
-{
-    rc_t rc;
-    int path_type = ( VDBManagerPathType ( mgr, acc_or_path ) & ~ kptAlias );
-    /* types defined in <kdb/manager.h> */
-    switch ( path_type )
-    {
-    case kptDatabase    :   rc = vdm_dump_database( ctx, mgr );
-                            DISP_RC( rc, "dump_database() failed" );
-                            break;
-
-    case kptPrereleaseTbl:
-    case kptTable       :   rc = vdm_dump_table( ctx, mgr );
-                            DISP_RC( rc, "dump_table() failed" );
-                            break;
-
-    default             :   rc = RC( rcVDB, rcNoTarg, rcConstructing, rcItem, rcNotFound );
-                            PLOGERR( klogInt, ( klogInt, rc,
-                                "the path '$(p)' cannot be opened as vdb-database or vdb-table",
-                                "p=%s", ctx->path ) );
-                            if ( vdco_schema_count( ctx ) == 0 )
-                            {
-                            LOGERR( klogInt, rc, "Maybe it is a legacy table. If so, specify a schema with the -S option" );
-                            }
-                            break;
-    }
-    return rc;
-}
-
-
-static rc_t vdb_main_one_obj_by_probing( const p_dump_context ctx,
-                                         const VDBManager *mgr,
-                                         const char * acc_or_path )
-{
-    rc_t rc;
-    if ( vdh_is_path_database( mgr, ctx->path, &(ctx->schema_list) ) )
-    {
-        rc = vdm_dump_database( ctx, mgr );
-        DISP_RC( rc, "dump_database() failed" );
-    }
-    else if ( vdh_is_path_table( mgr, ctx->path, &(ctx->schema_list) ) )
-    {
-        rc = vdm_dump_table( ctx, mgr );
-        DISP_RC( rc, "dump_table() failed" );
-    }
-    else
-    {
-        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcItem, rcNotFound );
-        PLOGERR( klogInt, ( klogInt, rc,
-                 "the path '$(p)' cannot be opened as vdb-database or vdb-table",
-                 "p=%s", ctx->path ) );
-        if ( vdco_schema_count( ctx ) == 0 )
-        {
-            LOGERR( klogInt, rc, "Maybe it is a legacy table. If so, specify a schema with the -S option" );
-        }
-    }
-    return rc;
-}
-
-
-static rc_t vdm_main_one_obj( const p_dump_context ctx,
-                        KDirectory *dir, const VDBManager *mgr,
-                        const char * acc_or_path )
-{
-    rc_t rc = 0;
-
-    ctx->path = string_dup_measure ( acc_or_path, NULL );
-
-    if ( ctx->objver_requested )
-    {
-        rc = vdm_print_objver( ctx, mgr );
-    }
-    else if ( ctx->objtype_requested )
-    {
-        vdm_print_objtype( mgr, acc_or_path );
-    }
-    else
-    {
-        if ( USE_PATHTYPE_TO_DETECT_DB_OR_TAB )
-        {
-            rc = vdb_main_one_obj_by_pathtype( ctx, mgr, acc_or_path );
-        }
-        else
-        {
-            rc = vdb_main_one_obj_by_probing( ctx, mgr, acc_or_path );
-        }
-    }
-
-    free( (char*)ctx->path );
-    ctx->path = NULL;
-
-    return rc;
-}
-
-
-static rc_t vdm_check_curl( void )
-{
-    struct KNSManager * knsmgr;
-    rc_t rc = KNSManagerMake( &knsmgr );
-    if ( rc == 0 )
-    {
-        rc = KNSManagerAvail( knsmgr );
-        if ( rc == 0 )
-        {
-            const char *vers = NULL;
-            rc = KNSManagerCurlVersion( knsmgr, &vers );
-            if ( rc == 0 )
-                KOutMsg( "libcurl-version = %s\n", vers );
-        }
-        else
-        {
-            rc = KOutMsg( "libcurl not available... %R\n", rc );
-        }
-        KNSManagerRelease( knsmgr );
-    }
-    else
-    {
-        rc = KOutMsg( "cannot create knsmgr... %R\n", rc );
-    }
-    return rc;
-}
-
-/***************************************************************************
-    dump_main:
-    * called by "KMain()"
-    * make the "native directory"
-    * make a vdb-manager for read
-      all subsequent dump-functions will use this manager...
-    * show the manager-version, if it was requested from the command-line
-    * check if the given path is database-path ( by trying to open it )
-      if it is one: continue wit dump_database()
-    * check if the given path is table-path ( by trying to open it )
-      if it is one: continue wit dump_table()
-    * release manager and directory
-
-ctx        [IN] ... contains path, tablename, columns, row-range etc.
-***************************************************************************/
-static rc_t vdm_main( const p_dump_context ctx, Args * args )
-{
-    rc_t rc, rc1;
-    KDirectory *dir;
-
-    rc = KDirectoryNativeDir( &dir );
-    DISP_RC( rc, "KDirectoryNativeDir() failed" );
-    if ( rc == 0 )
-    {
-        const VDBManager *mgr;
-
-        rc = VDBManagerMakeRead ( &mgr, dir );
-        DISP_RC( rc, "VDBManagerMakeRead() failed" );
-        if ( rc == 0 )
-        {
-            /* show manager is independend form db or tab */
-            if ( ctx->version_requested )
-            {
-                rc = vdh_show_manager_version( mgr );
-                DISP_RC( rc, "show_manager_version() failed" );
-            }
-            else if ( ctx->check_curl )
-            {
-                rc = vdm_check_curl();
-            }
-            else
-            {
-                uint32_t count;
-                rc = ArgsParamCount( args, &count );
-                DISP_RC( rc, "ArgsParamCount() failed" );
-                if ( rc == 0 )
-                {
-                    if ( count > 0 )
-                    {
-                        uint32_t idx;
-                        for ( idx = 0; idx < count && rc == 0; ++idx )
-                        {
-                            const char *value = NULL;
-                            rc = ArgsParamValue( args, idx, &value );
-                            DISP_RC( rc, "ArgsParamValue() failed" );
-                            if ( rc == 0 )
-                            {
-                                rc = vdm_main_one_obj( ctx, dir, mgr, value );
-                            }
-                        }
-                    }
-                    else
-                    {
-                        rc = UsageSummary ( UsageDefaultName );
-                    }
-                }
-            }
-            rc1 = VDBManagerRelease( mgr );
-            DISP_RC( rc1, "VDBManagerRelease() failed" );
-        }
-        rc1 = KDirectoryRelease( dir );
-        DISP_RC( rc1, "KDirectoryRelease() failed" );
-    }
-    return rc;
-}
-
-
-/***************************************************************************
-    Main:
-    * create the dump-context
-    * parse the commandline for arguments and options
-    * react to help/usage - requests ( no dump in this case )
-      these functions are in vdb-dump-context.c
-    * call dump_main() to execute the dump
-    * destroy the dump-context
-***************************************************************************/
-static
-rc_t CC write_to_FILE ( void *f, const char *buffer, size_t bytes, size_t *num_writ )
-{
-    * num_writ = fwrite ( buffer, 1, bytes, f );
-    if ( * num_writ != bytes )
-        return RC ( rcExe, rcFile, rcWriting, rcTransfer, rcIncomplete );
-    return 0;
-}
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc;
-
-    rc = KOutHandlerSet ( write_to_FILE, stdout );
-    if ( rc == 0 )
-        rc = ArgsMakeAndHandle (&args, argc, argv, 1,
-            DumpOptions, sizeof DumpOptions / sizeof DumpOptions [ 0 ] );
-    if (rc == 0)
-    {
-        dump_context *ctx;
-
-        rc = vdco_init( &ctx );
-        DISP_RC( rc, "dump_context_init() failed" );
-
-        if ( rc == 0 )
-        {
-            rc = vdco_capture_arguments_and_options( args, ctx );
-            if ( rc == 0 )
-            {
-                KLogHandlerSetStdErr();
-                rc = vdm_main( ctx, args );
-            }
-            vdco_destroy( ctx );
-        }
-        ArgsWhack (args);
-    }
-
-    return rc;
-}
-
diff --git a/tools/vdb-dump/vdb-dump.vers b/tools/vdb-dump/vdb-dump.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-dump/vdb-dump.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3
diff --git a/tools/vdb-validate/Makefile b/tools/vdb-validate/Makefile
deleted file mode 100644
index bfdeddc..0000000
--- a/tools/vdb-validate/Makefile
+++ /dev/null
@@ -1,103 +0,0 @@
-# ===========================================================================
-#
-#                            PUBLIC DOMAIN NOTICE
-#               National Center for Biotechnology Information
-#
-#  This software/database is a "United States Government Work" under the
-#  terms of the United States Copyright Act.  It was written as part of
-#  the author's official duties as a United States Government employee and
-#  thus cannot be copyrighted.  This software/database is freely available
-#  to the public for use. The National Library of Medicine and the U.S.
-#  Government have not placed any restriction on its use or reproduction.
-#
-#  Although all reasonable efforts have been taken to ensure the accuracy
-#  and reliability of the software and data, the NLM and the U.S.
-#  Government do not and cannot warrant the performance or results that
-#  may be obtained by using this software or data. The NLM and the U.S.
-#  Government disclaim all warranties, express or implied, including
-#  warranties of performance, merchantability or fitness for any particular
-#  purpose.
-#
-#  Please cite the author in any work or product based on this material.
-#
-# ===========================================================================
-
-
-default: std
-
-TOP ?= $(shell ../../build/abspath.sh ../..)
-MODULE = tools/vdb-validate
-
-include $(TOP)/build/Makefile.env
-
-INT_TOOLS = \
-
-
-EXT_TOOLS = \
-	vdb-validate
-
-ALL_TOOLS = \
-	$(INT_TOOLS) \
-	$(EXT_TOOLS)
-
-#------------------------------------------------------------------------------
-# outer targets
-#
-all std: vers-includes
-	@ $(MAKE_CMD) $(TARGDIR)/$@
-
-$(ALL_TOOLS): vers-includes
-	@ $(MAKE_CMD) $(BINDIR)/$@
-
-.PHONY: all std $(ALL_TOOLS)
-
-#-------------------------------------------------------------------------------
-# all
-#
-$(TARGDIR)/all: \
-	$(addprefix $(BINDIR)/,$(ALL_TOOLS))
-
-.PHONY: $(TARGDIR)/all
-
-#-------------------------------------------------------------------------------
-# std
-#
-$(TARGDIR)/std: \
-	$(addprefix $(BINDIR)/,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/std
-
-#-------------------------------------------------------------------------------
-# vers-includes
-#
-$(TARGDIR)/vers-includes: $(addsuffix .vers.h,$(EXT_TOOLS))
-
-.PHONY: $(TARGDIR)/vers-includes
-
-#-------------------------------------------------------------------------------
-# clean
-#
-clean: stdclean
-
-.PHONY: clean
-
-#-------------------------------------------------------------------------------
-# vdb-validate
-#
-VDB_VALIDATE_SRC = \
-	vdb-validate
-
-VDB_VALIDATE_OBJ = \
-	$(addsuffix .$(OBJX),$(VDB_VALIDATE_SRC))
-
-VDB_VALIDATE_LIB = \
-	-lkapp \
-	-lncbi-vdb \
-	-lxml2 \
-	-lm
-
-vdb-validate.vers.h: vdb-validate.vers
-	$(TOP)/build/make-vers-inc.sh VDB_VALIDATE_VERS $^ > $@
-
-$(BINDIR)/vdb-validate: $(VDB_VALIDATE_OBJ)
-	$(LD) --exe --vers $(SRCDIR) -o $@ $^ $(VDB_VALIDATE_LIB)
diff --git a/tools/vdb-validate/vdb-validate.c b/tools/vdb-validate/vdb-validate.c
deleted file mode 100644
index 5e8960d..0000000
--- a/tools/vdb-validate/vdb-validate.c
+++ /dev/null
@@ -1,2198 +0,0 @@
-/*===========================================================================
- *
- *                            PUBLIC DOMAIN NOTICE
- *               National Center for Biotechnology Information
- *
- *  This software/database is a "United States Government Work" under the
- *  terms of the United States Copyright Act.  It was written as part of
- *  the author's official duties as a United States Government employee and
- *  thus cannot be copyrighted.  This software/database is freely available
- *  to the public for use. The National Library of Medicine and the U.S.
- *  Government have not placed any restriction on its use or reproduction.
- *
- *  Although all reasonable efforts have been taken to ensure the accuracy
- *  and reliability of the software and data, the NLM and the U.S.
- *  Government do not and cannot warrant the performance or results that
- *  may be obtained by using this software or data. The NLM and the U.S.
- *  Government disclaim all warranties, express or implied, including
- *  warranties of performance, merchantability or fitness for any particular
- *  purpose.
- *
- *  Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- */
-
-#include <vfs/manager-priv.h> /* VFSManagerOpenFileReadDecrypt */
-#include <vfs/manager.h> /* VFSManagerMake */
-#include <vfs/resolver.h> /* VResolver */
-#include <vfs/path.h> /* VPathMake */
-
-#include <kapp/main.h>
-#include <kapp/args.h>
-
-#include <kdb/manager.h>
-#include <kdb/database.h>
-#include <kdb/table.h>
-#include <kdb/meta.h>
-#include <kdb/namelist.h>
-#include <kdb/consistency-check.h>
-#include <kdb/kdb-priv.h> /* KTableOpenDirectoryRead */
-
-#include <vdb/manager.h>
-#include <vdb/schema.h>
-#include <vdb/database.h>
-#include <vdb/table.h>
-#include <vdb/cursor.h>
-#include <vdb/dependencies.h> /* UIError */
-#include <vdb/vdb-priv.h> /* VTableOpenKTableRead */
-
-#include <krypto/encfile.h> /* KEncFileValidate */
-#include <krypto/wgaencrypt.h> /* KEncFileValidate */
-
-#include <kfs/kfs-priv.h>
-#include <kfs/sra.h>
-#include <kfs/tar.h>
-#include <kfs/file.h> /* KFileRelease */
-
-#include <insdc/insdc.h>
-#include <insdc/sra.h>
-#include <sra/srapath.h>
-#include <sra/sradb.h>
-#include <sra/sraschema.h>
-
-#include <klib/out.h>
-#include <klib/log.h>
-#include <klib/rc.h>
-#include <klib/namelist.h>
-#include <klib/container.h>
-#include <klib/text.h> /* String */
-#include <klib/status.h> /* STSMSG */
-#include <klib/debug.h>
-#include <klib/data-buffer.h>
-#include <klib/sort.h>
-
-#include <sysalloc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "vdb-validate.vers.h"
-
-#define RELEASE(type, obj) do { rc_t rc2 = type##Release(obj); \
-    if (rc2 != 0 && rc == 0) { rc = rc2; } obj = NULL; } while (false)
-
-static bool exhaustive;
-static bool md5_required;
-static bool ref_int_check;
-static bool s_IndexOnly;
-
-typedef struct node_s {
-    int parent;
-    int prvSibl;
-    int nxtSibl;
-    int firstChild;
-    unsigned depth;
-    unsigned name;
-    uint32_t objType;
-} node_t;
-typedef struct cc_context_s {
-    node_t *nodes;
-    char *names;
-    rc_t rc;
-    unsigned num_columns;
-    unsigned nextNode;
-    unsigned nextName;
-} cc_context_t;
-static
-rc_t report_rtn ( rc_t rc )
-{
-    return exhaustive ? 0 : rc;
-}
-
-static rc_t report_index(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc,
-                "Index '$(index)': $(mesg)",
-                "index=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_Index:
-        return 0; /* continue with check */
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc,
-                "File '$(file)' of index '$(index)' failed MD5 check",
-                "file=%s,index=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_column(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc,
-                "Column '$(column)': $(mesg)",
-                "column=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Column '$(column)': $(mesg)",
-                "column=%s,mesg=%s", what->objName,
-                what->info.done.mesg ? what->info.done.mesg : "checked"));
-            ++ctx->num_columns;
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_Blob:
-        return 0; /* continue with check */
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc,
-                "File '$(file)' of column '$(column)' failed MD5 check",
-                "file=%s,column=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_table(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc,
-                "Table '$(table)': $(mesg)",
-                "table=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else if (what->info.done.mesg) {
-            if (strcmp(what->info.done.mesg, "missing md5 file") == 0
-                && md5_required)
-            {
-                rc_t rc = RC(0, rcTable, rcValidating, rcChecksum, rcNotFound);
-                (void)PLOGERR(klogErr, (klogErr, rc,
-                    "Table '$(table)': is missing required md5 files",
-                    "table=%s", what->objName));
-                return rc;
-            }
-            else if (strncmp("unexpected object ",
-                what->info.done.mesg, 18) == 0)
-            {
-                (void)PLOGMSG(klogWarn, (klogWarn,
-                    "Table '$(tbl)': $(mesg)", "tbl=%s,mesg=%s",
-                    what->objName, what->info.done.mesg));
-            }
-            else {
-                (void)PLOGMSG(klogInfo, (klogInfo,
-                    "Table '$(tbl)' metadata: $(mesg)",
-                    "tbl=%s,mesg=%s", what->objName, what->info.done.mesg));
-            }
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc,
-                "File '$(file)' of table '$(table)' failed MD5 check",
-                "file=%s,table=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t report_database(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    switch (what->type) {
-    case ccrpt_Done:
-        if (what->info.done.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.done.rc,
-                "Database '$(db)': $(mesg)",
-                "db=%s,mesg=%s", what->objName, what->info.done.mesg));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.done.rc;
-        }
-        else if (what->info.done.mesg) {
-            if (strcmp(what->info.done.mesg, "missing md5 file") == 0
-                && md5_required)
-            {
-                rc_t rc
-                    = RC(rcExe, rcTable, rcValidating, rcChecksum, rcNotFound);
-                (void)PLOGERR(klogErr, (klogErr, rc,
-                    "Database '$(table)': is missing required md5 files",
-                    "table=%s", what->objName));
-                return rc;
-            }
-            else {
-                (void)PLOGMSG(klogInfo, (klogInfo,
-                    "Database '$(db)' metadata: $(mesg)",
-                    "db=%s,mesg=%s", what->objName, what->info.done.mesg));
-            }
-        }
-        return report_rtn (what->info.done.rc);
-    case ccrpt_MD5:
-        if (what->info.MD5.rc) {
-            (void)PLOGERR(klogErr, (klogErr, what->info.MD5.rc,
-                "File '$(file)' of database '$(db)' failed MD5 check",
-                "file=%s,db=%s", what->info.MD5.file, what->objName));
-            if (ctx->rc == 0)
-                ctx->rc = what->info.MD5.rc;
-        }
-        return report_rtn (what->info.MD5.rc);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static rc_t visiting(CCReportInfoBlock const *what, cc_context_t *ctx)
-{
-    unsigned const nn = ctx->nextNode++;
-    node_t *const nxt = &ctx->nodes[nn];
-    node_t *const cur = nxt - 1;
-    
-    nxt->parent = nxt->prvSibl = nxt->nxtSibl = nxt->firstChild = -1;
-    nxt->depth = what->info.visit.depth;
-    nxt->objType = what->objType;
-    nxt->name = ctx->nextName;
-    ctx->nextName += strlen(what->objName) + 1;
-    strcpy(&ctx->names[nxt->name], what->objName);
-    
-    if (nn) {
-        if (cur->depth == nxt->depth) {
-            nxt->parent = cur->parent;
-            nxt->prvSibl = nn - 1;
-            cur->nxtSibl = nn;
-        }
-        else if (cur->depth < nxt->depth) {
-            nxt->parent = nn - 1;
-            cur->firstChild = nn;
-        }
-        else {
-            unsigned sibling = cur->parent;
-            
-            while (ctx->nodes[sibling].depth > nxt->depth)
-                sibling = ctx->nodes[sibling].parent;
-            nxt->parent = ctx->nodes[sibling].parent;
-            nxt->prvSibl = sibling;
-            ctx->nodes[sibling].nxtSibl = nn;
-        }
-    }
-    return 0;
-}
-
-static rc_t CC report(CCReportInfoBlock const *what, void *Ctx)
-{
-    cc_context_t *ctx = Ctx;
-    rc_t rc = Quitting();
-    
-    if (rc)
-        return rc;
-    
-    if (what->type == ccrpt_Visit)
-        return visiting(what, ctx);
-
-    switch (what->objType) {
-    case kptDatabase:
-        return report_database(what, ctx);
-    case kptTable:
-        return report_table(what, ctx);
-    case kptColumn:
-        return report_column(what, ctx);
-    case kptIndex:
-        return report_index(what, ctx);
-    default:
-        return RC(rcExe, rcTable, rcVisiting, rcParam, rcUnexpected);
-    }
-}
-
-static
-rc_t kdbcc ( const KDBManager *mgr, char const name[], uint32_t mode,
-    KPathType *pathType, bool is_file, node_t nodes[], char names[],
-    INSDC_SRA_platform_id platform )
-{
-    rc_t rc = 0;
-    cc_context_t ctx;
-    char const *objtype;
-
-    uint32_t level = ( mode & 4 ) ? 3 : ( mode & 2 ) ? 1 : 0;
-    if (s_IndexOnly)
-        level |= CC_INDEX_ONLY;
-
-
-    memset(&ctx, 0, sizeof(ctx));
-    ctx.nodes = &nodes[0];
-    ctx.names = &names[0];
-
-    if (KDBManagerExists(mgr, kptDatabase, name))
-        *pathType = kptDatabase;
-    else if (KDBManagerExists(mgr, kptTable, name))
-        *pathType = kptTable;
-    else if (*pathType == kptDatabase || *pathType == kptTable)
-        /* is known already: may be encrypted */ ( void) 0;
-    else
-    {
-        rc = RC(rcExe, rcPath, rcValidating, rcType, rcUnknown);
-        (void)PLOGERR(klogErr, (klogErr, rc, "Object '$(table)' "
-            "has unknown type", "table=%s", name));
-        return rc;
-    }
-
-    if (*pathType == kptDatabase)
-    {
-        const KDatabase *db;
-            
-        objtype = "database";
-        rc = KDBManagerOpenDBRead ( mgr, & db, name );
-        if ( rc == 0 )
-        {
-            rc = KDatabaseConsistencyCheck ( db, 0, level, report, & ctx );
-            if ( rc == 0 )
-            {
-                rc = ctx.rc;
-                if ( s_IndexOnly )
-                    (void)LOGMSG(klogInfo, "Indices: checked");
-            }
-
-            KDatabaseRelease ( db );
-        }
-    }
-    else
-    {
-        const KTable *tbl;
-
-        objtype = "table";
-        rc = KDBManagerOpenTableRead ( mgr, & tbl, name );
-        if ( rc == 0 )
-        {
-            rc = KTableConsistencyCheck ( tbl, 0, level, report, & ctx, platform );
-            if ( rc == 0 )
-                rc = ctx.rc;
-
-            if ( rc == 0 && s_IndexOnly )
-                (void)LOGMSG(klogInfo, "Index: checked");
-
-            KTableRelease ( tbl );
-        }
-    }
-
-    if (rc == 0 && ctx.num_columns == 0 && !s_IndexOnly)
-    {
-        if (is_file)
-        {
-            (void)PLOGMSG(klogWarn, (klogWarn, "Nothing to validate; "
-                                     "the file '$(file)' has no checksums or is truncated.",
-                                     "file=%s", name));
-        }
-        else
-        {
-            (void)PLOGMSG(klogWarn, (klogWarn, "Nothing to validate; "
-                                     "the $(type) '$(file)' has no checksums or is empty.",
-                                     "type=%s,file=%s", objtype, name));
-        }
-    }
-
-    return rc;
-}
-
-static
-rc_t vdbcc ( const VDBManager *mgr, char const name[], uint32_t mode,
-    KPathType *pathType, bool is_file)
-{
-#if 0
-    if ( ( mode & 8) != 0 )
-    {
-        const VTable *tbl;
-        rc_t rc = VDBManagerOpenTableRead(mgr, &tbl, NULL, name);
-        if (rc == 0)
-            rc = VTableConsistencyCheck(tbl, 2);
-        return rc;
-    }
-#endif
-    return 0;
-}
-
-typedef struct ColumnInfo_s {
-    char const *name;
-    union {
-        void     const *vp;
-        char     const *string;
-        bool     const *tf;
-        int8_t   const *i8;
-        uint8_t  const *u8;
-        int16_t  const *i16;
-        uint16_t const *u16;
-        int32_t  const *i32;
-        uint32_t const *u32;
-        int64_t  const *i64;
-        uint64_t const *u64;
-        float    const *f32;
-        double   const *f64;
-    } value;
-    uint32_t idx;
-    uint32_t elem_bits;
-    uint32_t elem_count;
-} ColumnInfo;
-
-static rc_t CC get_sizes_cb(const KDirectory *dir,
-    uint32_t type, const char *name, void *data)
-{
-    struct {
-        unsigned count;
-        size_t size;
-    } *pb = data;
-
-    ++pb->count;    
-    pb->size += strlen(name) + 1;
-    
-    return 0;
-}
-
-static rc_t get_sizes(KDirectory const *dir, unsigned *nobj, size_t *namesz)
-{
-    rc_t rc;
-    struct {
-        unsigned count;
-        size_t size;
-    } pb;
-    
-    memset(&pb, 0, sizeof(pb));
-    rc = KDirectoryVVisit(dir, true, get_sizes_cb, &pb, NULL, NULL);
-    if (rc)
-        memset(&pb, 0, sizeof(pb));
-    *nobj = pb.count;
-    *namesz = pb.size;
-    return rc;
-}
-
-static rc_t EncFileReadAll(const char *name,
-    char *buffer, size_t bsize, size_t *num_read)
-{
-    rc_t rc = 0;
-
-    VFSManager *mgr = NULL;
-    VPath *path = NULL;
-    const KFile *f = NULL;
-
-    rc = VFSManagerMake(&mgr);
-    if (rc != 0) {
-        LOGERR(klogErr, rc, "Failed to VFSManagerMake()");
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerMakePath (mgr, &path, name);
-        if (rc != 0) {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to VPathMake($(name))", "name=%s", name));
-        }
-    }
-
-    if (rc == 0) {
-        rc = VFSManagerOpenFileReadDecrypt(mgr, &f, path);
-        if (rc != 0) {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to VFSManagerOpenFileReadDecrypt($(name))",
-                "name=%s", name));
-        }
-    }
-
-    if (rc == 0) {
-        rc = KFileReadAll(f, 0, buffer, bsize, num_read);
-        if (rc != 0) {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to KFileReadAll($(name))", "name=%s", name));
-        }
-    }
-
-    KFileRelease(f);
-    VPathRelease(path);
-    VFSManagerRelease(mgr);
-
-    return rc;
-}
-
-
-#if 0
-static rc_t verify_encryption(const KDirectory *dir, const char *name,
-    bool *enc, bool *sra)
-{
-    rc_t rc = 0;
-    const KFile *f = NULL;
-    char buffer[24];
-    size_t num_read = ~0;
-
-    assert(enc && sra);
-    *enc = false;
-    *sra = true;
-
-    rc = KDirectoryOpenFileRead(dir, &f, name);
-    if (rc == 0) {
-        rc = KFileReadAll(f, 0, &buffer, sizeof buffer, &num_read);
-    }
-
-    if (rc == 0) {
-        size_t sz = num_read < 8 ? num_read : 8;
-        assert(num_read <= sizeof buffer);
-        rc = KFileIsEnc(buffer, sz);
-        if (rc == 0)
-        {
-            (void)PLOGMSG(klogInfo, (klogInfo, "File '$(f)' is encrypted",
-                "f=%s", name));
-            *enc = true;
-            rc = KEncFileValidate(f);
-            if (rc != 0) {
-                (void)PLOGERR(klogErr, (klogErr, rc, "Failure of encryption "
-                    "validation of file '$(name)'", "name=%s", name));
-            }
-            else {
-                (void)PLOGMSG(klogInfo, (klogInfo, "File '$(f)': encryption OK",
-                    "f=%s", name));
-                rc = EncFileReadAll(name, buffer, sizeof buffer, &num_read);
-            }
-        }
-        else {
-            rc = 0;
-            (void)PLOGMSG(klogInfo, (klogInfo, "File '$(f)' is not encrypted",
-                "f=%s", name));
-        }
-    }
-
-    if (rc == 0) {
-        rc = KFileIsSRA(buffer, num_read);
-        if (rc == 0) {
-            *sra = true;
-        }
-        else if (rc
-            == SILENT_RC(rcFS, rcFile, rcIdentifying, rcBuffer, rcWrongType))
-        {
-            rc = 0;
-            *sra = false;
-        }
-        else {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to KFileIsSRA($(name))", "name=%s", name));
-        }
-    }
-
-    KFileRelease(f);
-
-    return rc;
-}
-#endif
-
-static rc_t init_dbcc(KDirectory const *dir, char const name[], bool is_file,
-    node_t **nodes, char **names, KPathType *pathType)
-{
-    KDirectory const *obj;
-    unsigned nobj;
-    size_t namesz;
-    rc_t rc = 0;
-
-    assert(pathType);
-
-    if (is_file) {
-        rc = KDirectoryOpenSraArchiveRead_silent(dir, &obj, false, name);
-        if (rc != 0)
-        {   rc = KDirectoryOpenTarArchiveRead_silent(dir, &obj, false, name); }
-        if (rc != 0) {
-            const VDBManager *mgr = NULL;
-            const VTable *tbl = NULL;
-            VSchema *sra_schema = NULL;
-            rc = VDBManagerMakeRead(&mgr, dir);
-            if (rc != 0)
-            {   return rc; }
-            for ( ; rc == 0; ) {
-                rc = VDBManagerOpenTableRead(mgr, &tbl, sra_schema, name);
-                VSchemaRelease(sra_schema);
-                if (rc == 0) {
-                    const KTable *ktbl = NULL;
-                    rc = VTableOpenKTableRead(tbl, &ktbl);
-                    if (rc == 0)
-                    {   rc = KTableOpenDirectoryRead(ktbl, &obj); }
-                    KTableRelease(ktbl);
-                    *pathType = kptTable;
-                    break;
-                }
-                else if (GetRCState(rc) == rcNotFound
-                    && GetRCObject(rc) == rcSchema && sra_schema == NULL)
-                {
-                     rc = VDBManagerMakeSRASchema(mgr, &sra_schema);
-                }
-                else {
-                    const VDatabase *db = NULL;
-                    const KDatabase *kdb = NULL;
-                    rc = VDBManagerOpenDBRead(mgr, &db, NULL, name);
-                    if (rc == 0)
-                    {   rc = VDatabaseOpenKDatabaseRead(db, &kdb); }
-                    if (rc == 0)
-                    {   rc = KDatabaseOpenDirectoryRead(kdb, &obj); }
-                    if (rc == 0)
-                    {   *pathType = kptDatabase; }
-                    KDatabaseRelease(kdb);
-                    VDatabaseRelease(db);
-                    break;
-                }
-            }
-            VTableRelease(tbl);
-            VDBManagerRelease(mgr);
-        }
-    }
-    else {
-        rc = KDirectoryOpenDirRead(dir, &obj, false, name);
-    }
-    if (rc)
-        return rc;
-    rc = get_sizes(obj, &nobj, &namesz);
-    KDirectoryRelease(obj);
-    if (rc) {
-        *nodes = NULL;
-        *names = NULL;
-    }
-    else {
-        *nodes = malloc(nobj * sizeof(**nodes) + namesz);
-        if (nodes)
-            *names = (char *)&(*nodes)[nobj];
-        else
-            rc = RC(rcExe, rcSelf, rcConstructing, rcMemory, rcExhausted);
-    }
-    return rc;
-}
-
-static rc_t get_schema_info(KMetadata const *meta, char buffer[], size_t bsz,
-    char **vers)
-{
-    KMDataNode const *node;
-    rc_t rc = KMetadataOpenNodeRead(meta, &node, "schema");
-    
-    if (rc == 0) {
-        size_t sz;
-        
-        rc = KMDataNodeReadAttr(node, "name", buffer, bsz, &sz);
-        if (rc == 0) {
-            buffer[sz] = '\0';
-            *vers = &buffer[sz];
-            while (sz) {
-                --sz;
-                if (buffer[sz] == '#') {
-                    buffer[sz] = '\0';
-                    *vers = &buffer[sz + 1];
-                    break;
-                }
-            }
-        }
-    }
-    return rc;
-}
-
-static rc_t get_tbl_schema_info(VTable const *tbl, char buffer[], size_t bsz,
-    char **vers)
-{
-    KMetadata const *meta;
-    rc_t rc = VTableOpenMetadataRead(tbl, &meta);
-    
-    *(*vers = &buffer[0]) = '\0';
-    if (rc == 0) rc = get_schema_info(meta, buffer, bsz, vers);
-    return 0;
-}
-
-static rc_t get_db_schema_info(VDatabase const *db, char buffer[], size_t bsz,
-    char **vers)
-{
-    KMetadata const *meta;
-    rc_t rc = VDatabaseOpenMetadataRead(db, &meta);
-    
-    *(*vers = &buffer[0]) = '\0';
-    if (rc == 0) rc = get_schema_info(meta, buffer, bsz, vers);
-    return rc;
-}
-
-static rc_t sra_dbcc_454(VTable const *tbl, char const name[])
-{
-    /* TODO: complete this */
-    return 0;
-}
-
-static rc_t sra_dbcc_fastq(VTable const *tbl, char const name[])
-{
-    static char const *const cn_FastQ[] = {
-        "READ", "QUALITY", "SPOT_LEN", "READ_START", "READ_LEN", "READ_TYPE"
-    };
-    
-    VCursor const *curs;
-    rc_t rc = VTableCreateCursorRead(tbl, &curs);
-    
-    if (rc == 0) {
-        unsigned const n = sizeof(cn_FastQ)/sizeof(cn_FastQ[0]);
-        ColumnInfo cols[sizeof(cn_FastQ)/sizeof(cn_FastQ[0])];
-        unsigned i;
-
-        memset(cols, 0, sizeof(cols));
-        for (i = 0; i < n; ++i) {
-            cols[i].name = cn_FastQ[i];
-            VCursorAddColumn(curs, &cols[i].idx, cols[i].name);
-        }
-        rc = VCursorOpen(curs);
-        if (rc == 0) {
-            rc = VCursorOpenRow(curs);
-            for (i = 0; i < n && rc == 0; ++i) {
-                VCursorCellData(curs, cols[i].idx, &cols[i].elem_bits,
-                    &cols[i].value.vp, NULL, &cols[i].elem_count);
-            }
-            if (   cols[0].idx == 0 || cols[0].elem_bits == 0
-                                                    || cols[0].value.vp == NULL
-                || cols[1].idx == 0 || cols[1].elem_bits == 0
-                                                    || cols[1].value.vp == NULL)
-            {
-                rc = RC(rcExe, rcTable, rcValidating, rcColumn, rcNotFound);
-            }
-            else if (cols[2].idx == 0 || cols[2].elem_bits == 0
-                                                    || cols[2].value.vp == NULL)
-            {
-                (void)PLOGERR(klogWarn, (klogWarn,
-                    RC(rcExe, rcTable, rcValidating, rcColumn, rcNotFound),
-                    "Table '$(name)' is usable for fasta only; no quality data",
-                    "name=%s", name));
-            }
-        }
-        VCursorRelease(curs);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc,
-            "Table '$(name)' is damaged beyond any use", "name=%s", name));
-    }
-    return rc;
-}
-
-static rc_t VTable_get_platform(VTable const *tbl,
-    INSDC_SRA_platform_id *rslt)
-{
-    rc_t rc;
-    VCursor const *curs;
-    INSDC_SRA_platform_id platform = -1;
-    
-    rc = VTableCreateCursorRead(tbl, &curs);
-    if (rc == 0) {
-        uint32_t cid;
-        
-        rc = VCursorAddColumn(curs, &cid, "("sra_platform_id_t")PLATFORM");
-        if (rc == 0) {
-            rc = VCursorOpen(curs);
-            if (rc == 0) {
-                uint32_t ebits;
-                void const *data;
-                uint32_t boff;
-                uint32_t ecnt;
-                
-                rc = VCursorCellDataDirect(curs, 1, cid,
-                    &ebits, &data, &boff, &ecnt);
-                if (rc == 0) {
-                    if (ebits == sizeof(platform) * 8 && boff == 0 && ecnt == 1)
-                        platform = ((INSDC_SRA_platform_id *)data)[0];
-                    else
-                        rc =
-                            RC(rcExe, rcTable, rcReading, rcType, rcUnexpected);
-                }
-            }
-        }
-        else
-            rc = 0;
-        VCursorRelease(curs);
-    }
-    rslt[0] = platform;
-    return rc;
-}
-
-static rc_t verify_table(VTable const *tbl, char const name[])
-{
-    char schemaName[1024];
-    char *schemaVers = NULL;
-    rc_t rc = 0;
-    
-    get_tbl_schema_info(tbl, schemaName, sizeof(schemaName), &schemaVers);
-    
-    if (schemaName[0] == '\0' || strncmp(schemaName, "NCBI:SRA:", 9) == 0) {
-        /* SRA or legacy SRA */
-        INSDC_SRA_platform_id platform;
-        
-        rc = VTable_get_platform(tbl, &platform);
-        if (rc == 0) {
-            if (platform == (INSDC_SRA_platform_id)-1) {
-                (void)PLOGMSG(klogWarn, (klogWarn, "Couldn't determine "
-                    "SRA Platform; type of table '$(name)' is indeterminate.",
-                    "name=%s", name));
-            }
-            rc = sra_dbcc_fastq(tbl, name);
-            if (rc == 0 && platform == SRA_PLATFORM_454) {
-                rc = sra_dbcc_454(tbl, name);
-            }
-        }
-        else {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to read table '$(name)'", "name=%s", name));
-        }
-    }
-    return rc;
-}
-
-static rc_t verify_mgr_table(VDBManager const *mgr, char const name[])
-{
-    VTable const *tbl;
-    VSchema *sra_schema = NULL;
-    
-    for ( ; ; ) {
-        rc_t rc = VDBManagerOpenTableRead(mgr, &tbl, sra_schema, name);
-        VSchemaRelease(sra_schema);
-        if (rc == 0) {
-            rc = verify_table(tbl, name);
-            VTableRelease(tbl);
-            return rc;
-        }
-        else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema
-            && sra_schema == NULL)
-        {
-            rc = VDBManagerMakeSRASchema(mgr, &sra_schema);
-            if (rc) {
-                (void)PLOGERR(klogErr, (klogErr, rc,
-                    "Failed to open table '$(name)'", "name=%s", name));
-                return rc;
-            }
-        }
-        else {
-            (void)PLOGERR(klogErr, (klogErr, rc,
-                "Failed to open table '$(name)'", "name=%s", name));
-            return rc;
-        }
-    }
-}
-
-#if 0
-static rc_t verify_db_table(VDatabase const *db, char const name[])
-{
-    VTable const *tbl;
-    rc_t rc = VDatabaseOpenTableRead(db, &tbl, name);
-    
-    if (rc == 0) {
-        rc = verify_table(tbl, name);
-        VTableRelease(tbl);
-    }
-    else {
-        (void)PLOGERR(klogErr, (klogErr, rc,
-            "Failed to open table '$(name)'", "name=%s", name));
-    }
-    return rc;
-}
-
-static rc_t align_dbcc_primary_alignment(VTable const *tbl, char const name[])
-{
-    VCursor const *curs;
-    rc_t rc = VTableCreateCursorRead(tbl, &curs);
-    
-    if (rc == 0) {
-        static char const *const cn_SAM[] = {
-            "SEQ_NAME",
-            "SAM_FLAGS",
-            "REF_NAME",
-            "REF_POS",
-            "MAPQ",
-            "HAS_MISMATCH",
-            "HAS_REF_OFFSET",
-            "REF_OFFSET",
-            "MATE_REF_NAME",
-            "MATE_REF_POS",
-            "TEMPLATE_LEN",
-            "READ",
-            "QUALITY"
-        };
-        unsigned const n = sizeof(cn_SAM)/sizeof(cn_SAM[0]);
-        ColumnInfo cols[sizeof(cn_SAM)/sizeof(cn_SAM[0])];
-        unsigned i;
-        
-        memset(cols, 0, sizeof(cols));
-        for (i = 0; i < n; ++i) {
-            cols[i].name = cn_SAM[i];
-            VCursorAddColumn(curs, &cols[i].idx, cols[i].name);
-        }
-        rc = VCursorOpen(curs);
-        if (rc == 0) {
-            rc = VCursorOpenRow(curs);
-            for (i = 0; i < n && rc == 0; ++i) {
-                VCursorCellData(curs, cols[i].idx, &cols[i].elem_bits,
-                    &cols[i].value.vp, NULL, &cols[i].elem_count);
-            }
-            for (i = 0; i < n && rc == 0; ++i) {
-                if (cols[i].idx == 0 || cols[i].elem_bits == 0) {
-                    (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(name)' "
-                        "could not be used to generate SAM", "name=%s", name));
-                    break;
-                }
-            }
-        }
-        VCursorRelease(curs);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc,
-            "Database '$(name)' is damaged beyond any use", "name=%s", name));
-    }
-    return rc;
-}
-#endif
-
-typedef struct id_pair_s {
-    int64_t first;
-    int64_t second;
-} id_pair_t;
-static int CC id_pair_cmp(void const *A, void const *B, void *ignored)
-{
-    id_pair_t const *a = A;
-    id_pair_t const *b = B;
-
-    return a->first < b->first
-        ? -1
-        : a->first == b->first
-            ? a->second < b->second
-                ? -1
-                : a->second == b->second ? 0 : 1
-            : 1;
-}
-
-static rc_t ric_align_ref_and_align(char const dbname[],
-                                    VTable const *ref,
-                                    VTable const *align,
-                                    int which)
-{
-    char const *const id_col_name = which == 0 ? "PRIMARY_ALIGNMENT_IDS"
-                                  : which == 1 ? "SECONDARY_ALIGNMENT_IDS"
-                                  : which == 2 ? "EVIDENCE_ALIGNMENT_IDS"
-                                  : NULL;
-    rc_t rc;
-    VCursor const *curs = NULL;
-    ColumnInfo ci;
-    int64_t startId;
-    uint64_t count;
-    
-    rc = VTableCreateCursorRead(align, &curs);
-    if (rc == 0) {
-        rc = VCursorAddColumn(curs, &ci.idx, "REF_ID");
-        if (rc == 0)
-            rc = VCursorOpen(curs);
-        if (rc == 0)
-            rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-            "alignment table can not be read", "name=%s", dbname));
-    }
-    else {
-        id_pair_t *const id_pair = malloc(sizeof(id_pair_t) * count);
-        
-        if (id_pair) {
-            uint64_t i;
-            uint64_t j;
-            
-            for (j = i = 0; i < count && rc == 0; ++i) {
-                int64_t const row = startId + i;
-                
-                rc = VCursorCellDataDirect(curs, row, ci.idx, &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                if (rc == 0) {
-                    if (ci.elem_count != 1) {
-                        rc = RC(rcExe, rcDatabase, rcValidating, rcData, rcUnexpected);
-                        (void)PLOGERR(klogErr, (klogErr, rc,
-                            "Database '$(name)': failed referential integrity "
-                            "check", "name=%s", dbname));
-                        break;
-                    }
-                    else {
-                        id_pair[j].second = row;
-                        id_pair[j].first = ci.value.i64[0];
-                        ++j;
-                    }
-                }
-                else if (GetRCObject(rc) == rcRow
-                    && GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-            }
-            VCursorRelease(curs); curs = NULL;
-            if (rc == 0) {
-                bool ooo_warned = false;
-                bool failed = false;
-                
-                ksort(id_pair, count, sizeof(id_pair_t), id_pair_cmp, NULL);
-                
-                rc = VTableCreateCursorRead(ref, &curs);
-                if (rc == 0)
-                    rc = VCursorAddColumn(curs, &ci.idx, id_col_name);
-                if (rc == 0)
-                    rc = VCursorOpen(curs);
-                if (rc == 0)
-                    rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-                if (rc == 0) {
-                    for (i = j = 0; rc == 0 && i < count; ++i) {
-                        int64_t const row = startId + i;
-                        
-                        rc = VCursorCellDataDirect(curs, row, ci.idx,
-                            &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                        if (rc == 0) {
-                            unsigned k;
-                            int64_t prvId = ci.value.i64[0];
-                            
-                            for (k = 0; rc == 0 && k < ci.elem_count;
-                                ++k, ++j)
-                            {
-                                int64_t const alignId = ci.value.i64[k];
-                                
-                                if (!ooo_warned && prvId > alignId) {
-                                    (void)PLOGMSG(klogWarn, (klogWarn,
-                                        "Database '$(name)': "
-                                        "column '$(idcol)' is not ordered",
-                                        "name=%s,idcol=%s",
-                                        dbname, id_col_name));
-                                    ooo_warned = true;
-                                }
-                                if (id_pair[j].first != row) {
-                                    if (!failed) {
-                                        rc = RC(rcExe, rcDatabase, rcValidating,
-                                            rcData, rcInconsistent);
-                                        (void)PLOGERR(klogErr, (klogErr, rc,
- "Database '$(name)': column '$(idcol)' failed referential integrity check",
- "name=%s,idcol=%s", dbname, id_col_name));
-                                    }
-                                    failed = true;
-                                }
-                                else if (id_pair[j].second != alignId) {
-                                    if (!ooo_warned) {
-                                        (void)PLOGMSG(klogWarn, (klogWarn,
- "Database '$(name)': column '$(idcol)' might fail referential integrity check",
- "name=%s,idcol=%s", dbname, id_col_name));
-                                    }
-                                }
-                                prvId = alignId;
-                            }
-                        }
-                        else if (GetRCObject(rc) == rcRow
-                            && GetRCState(rc) == rcNotFound)
-                        {   rc = 0; }
-                    }
-                    if (!failed && i < count) {
-                        rc = RC(rcExe, rcDatabase, rcValidating,
-                            rcData, rcInconsistent);
-                        (void)PLOGERR(klogErr, (klogErr, rc,
-                            "Database '$(name)': column '$(idcol)' failed "
-                            "referential integrity check",
-                            "name=%s,idcol=%s", dbname, id_col_name));
-                    }
-                }
-                else
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-                        "reference table can not be read", "name=%s", dbname));
-            }
-            free(id_pair);
-            VCursorRelease(curs);
-        }
-        else {
-            rc = RC(rcExe, rcDatabase, rcValidating, rcMemory, rcExhausted);
-            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-                "referential integrity could not be checked",
-                "name=%s", dbname));
-        }
-    }
-    return rc;
-}
-
-static rc_t ric_align_seq_and_pri(char const dbname[],
-                                  VTable const *seq,
-                                  VTable const *pri)
-{
-    rc_t rc;
-    VCursor const *curs = NULL;
-    ColumnInfo ci;
-    int64_t startId;
-    uint64_t count;
-    
-    rc = VTableCreateCursorRead(pri, &curs);
-    if (rc == 0) {
-        rc = VCursorAddColumn(curs, &ci.idx, "SEQ_SPOT_ID");
-        if (rc == 0)
-            rc = VCursorOpen(curs);
-        if (rc == 0)
-            rc = VCursorIdRange(curs, ci.idx, &startId, &count);
-    }
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-            "alignment table can not be read", "name=%s", dbname));
-    }
-    else {
-        id_pair_t *const id_pair = malloc(sizeof(id_pair_t) * count);
-
-        if (id_pair) {
-            uint64_t i;
-            uint64_t j;
-            
-            for (j = i = 0; i < count && rc == 0; ++i) {
-                int64_t const row = startId + i;
-                
-                rc = VCursorCellDataDirect(curs, row, ci.idx,
-                    &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                if (rc == 0) {
-                    if (ci.elem_count != 1) {
-                        rc = RC(rcExe, rcDatabase, rcValidating,
-                            rcData, rcUnexpected);
-                        (void)PLOGERR(klogErr, (klogErr, rc,
-                            "Database '$(name)': failed "
-                            "referential integrity check", "name=%s", dbname));
-                        break;
-                    }
-                    else {
-                        id_pair[j].second = row;
-                        id_pair[j].first = ci.value.i64[0];
-                        ++j;
-                    }
-                }
-                else if (GetRCObject(rc) == rcRow
-                    && GetRCState(rc) == rcNotFound)
-                {   rc = 0; }
-            }
-            VCursorRelease(curs); curs = NULL;
-            if (rc == 0) {
-                ksort(id_pair, count, sizeof(id_pair_t), id_pair_cmp, NULL);
-                
-                rc = VTableCreateCursorRead(seq, &curs);
-                if (rc == 0)
-                    rc = VCursorAddColumn(curs, &ci.idx,
-                        "PRIMARY_ALIGNMENT_ID");
-                if (rc == 0)
-                    rc = VCursorOpen(curs);
-                if (rc == 0) {
-                    for (i = 0; rc == 0 && i < count; ++i) {
-                        int64_t const row = id_pair[i].first;
-                        int64_t const alignId = id_pair[i].second;
-                        
-                        rc = VCursorCellDataDirect(curs, row, ci.idx,
-                            &ci.elem_bits, &ci.value.vp, NULL, &ci.elem_count);
-                        if (rc == 0) {
-                            bool found = false;
-                            
-                            for (j = 0; j < ci.elem_count; ++j)
-                                found |= (alignId == ci.value.i64[j]);
-                            
-                            if (!found) {
-                                rc = RC(rcExe, rcDatabase, rcValidating,
-                                    rcData, rcInconsistent);
-                                (void)PLOGERR(klogErr, (klogErr, rc,
-  "Database '$(name)': column 'SEQ_SPOT_ID' failed referential integrity check",
-  "name=%s", dbname));
-                            }
-                        }
-                        else if (GetRCObject(rc) == rcRow
-                            && GetRCState(rc) == rcNotFound)
-                        {
-                            rc = RC(rcExe, rcDatabase, rcValidating,
-                                rcData, rcInconsistent);
-                            (void)PLOGERR(klogErr, (klogErr, rc,
-  "Database '$(name)': column 'SEQ_SPOT_ID' failed referential integrity check",
-  "name=%s", dbname));
-                        }
-                        else {
-                            (void)PLOGERR(klogErr, (klogErr, rc,
-  "Database '$(name)': sequence table can not be read", "name=%s", dbname));
-                        }
-                    }
-                }
-                else
-                    (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-                        "sequence table can not be read", "name=%s", dbname));
-            }
-            free(id_pair);
-        }
-        else {
-            rc = RC(rcExe, rcDatabase, rcValidating, rcMemory, rcExhausted);
-            (void)PLOGERR(klogErr, (klogErr, rc, "Database '$(name)': "
-                "referential integrity could not be checked",
-                "name=%s", dbname));
-        }
-        VCursorRelease(curs);
-    }
-    return rc;
-}
-
-/* database referential integrity check for alignment database */
-static rc_t dbric_align(char const dbname[],
-                        VTable const *pri,
-                        VTable const *seq,
-                        VTable const *ref)
-{
-    rc_t rc = 0;
-    
-    if ((rc == 0 || exhaustive) && (pri != NULL && seq != NULL)) {
-        rc_t rc2 = ric_align_seq_and_pri(dbname, seq, pri);
-        
-        if (rc2 == 0) {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(dbname)': "
-               "SEQUENCE.PRIMARY_ALIGNMENT_ID <-> PRIMARY_ALIGNMENT.SEQ_SPOT_ID"
-               " referential integrity ok", "dbname=%s", dbname));
-        }
-        if (rc == 0) {
-            rc = rc2;
-        }
-    }
-    if ((rc == 0 || exhaustive) && (pri != NULL && ref != NULL)) {
-        rc_t rc2 = ric_align_ref_and_align(dbname, ref, pri, 0);
-        
-        if (rc2 == 0) {
-            (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(dbname)': "
-                "REFERENCE.PRIMARY_ALIGNMENT_IDS <-> PRIMARY_ALIGNMENT.REF_ID "
-                "referential integrity ok", "dbname=%s", dbname));
-        }
-        if (rc == 0) {
-            rc = rc2;
-        }
-    }
-    return rc;
-}
-
-
-static rc_t verify_database_align(VDatabase const *db,
-    char const name[], node_t const nodes[], char const names[])
-{
-    rc_t rc = 0;
-    unsigned tables = 0;
-    node_t const *tbl = &nodes[nodes[0].firstChild];
-    enum table_bits {
-        tbEvidenceInterval   = ( 1u << 0 ),
-        tbEvidenceAlignment  = ( 1u << 1 ),
-        tbPrimaryAlignment   = ( 1u << 2 ),
-        tbReference          = ( 1u << 3 ),
-        tbSequence           = ( 1u << 4 ),
-        tbSecondaryAlignment = ( 1u << 5 )
-    };
-    
-    if (nodes[0].firstChild) {
-        for ( ; ; ) {
-            char const *tname = &names[tbl->name];
-            unsigned this_table = 0;
-            
-            if (tbl->objType == kptTable) {
-                switch (tname[0]) {
-                case 'E':
-                    if (strcmp(tname, "EVIDENCE_INTERVAL") == 0)
-                        this_table |= tbEvidenceInterval;
-                    else if (strcmp(tname, "EVIDENCE_ALIGNMENT") == 0)
-                        this_table |= tbEvidenceAlignment;
-                    break;
-                case 'P':
-                    if (strcmp(tname, "PRIMARY_ALIGNMENT") == 0)
-                        this_table |= tbPrimaryAlignment;
-                    break;
-                case 'R':
-                    if (strcmp(tname, "REFERENCE") == 0)
-                        this_table |= tbReference;
-                    break;
-                case 'S':
-                    if (strcmp(tname, "SEQUENCE") == 0)
-                        this_table |= tbSequence;
-                    else if (strcmp(tname, "SECONDARY_ALIGNMENT") == 0)
-                        this_table |= tbSecondaryAlignment;
-                    break;
-                }
-                if (this_table == 0) {
-                    (void)PLOGERR(klogWarn, (klogWarn, RC(
-                        rcExe, rcDatabase, rcValidating, rcTable, rcUnexpected),
-                      "Database '$(name)' contains unexpected table '$(table)'",
-                      "name=%s,table=%s", name, tname));
-                }
-                tables |= this_table;
-            }
-            else {
-                (void)PLOGERR(klogWarn, (klogWarn, RC(
-                    rcExe, rcDatabase, rcValidating, rcType, rcUnexpected),
-                    "Database '$(name)' contains unexpected object '$(obj)'",
-                    "name=%s,obj=%s", name, tname));
-            }
-            if (tbl->nxtSibl > 0)
-                tbl = &nodes[tbl->nxtSibl];
-            else
-                break;
-        }
-    }
-    if (tables == tbSequence) {
-        /* sequence data only */
-        (void)PLOGMSG(klogInfo, (klogInfo, "Database '$(name)' "
-            "contains only unaligned reads", "name=%s", name));
-    }
-    else if (   (tables & tbReference) == 0
-             || (tables & tbPrimaryAlignment) == 0)
-    {
-        /* missing reference or primary alignment */
-        rc = RC(rcExe, rcDatabase, rcValidating, rcDatabase, rcIncomplete);
-        (void)PLOGERR(klogWarn, (klogWarn, rc,
-            "Database '$(name)' does not contain all required tables",
-            "name=%s", name));
-    }
-    else if (   ((tables & tbEvidenceAlignment) != 0)
-             != ((tables & tbEvidenceInterval ) != 0))
-    {
-        /* both must be present or both must be absent */
-        rc = RC(rcExe, rcDatabase, rcValidating, rcDatabase, rcIncomplete);
-        (void)PLOGERR(klogWarn, (klogWarn, rc,
-            "Database '$(name)' does not contain all required tables",
-            "name=%s", name));
-    }
-    while (ref_int_check) {
-        VTable const *pri = NULL;
-        VTable const *seq = NULL;
-        VTable const *ref = NULL;
-        
-        if ((tables & tbPrimaryAlignment) != 0) {
-            rc = VDatabaseOpenTableRead(db, &pri, "PRIMARY_ALIGNMENT");
-            if (rc) break;
-        }
-        if ((tables & tbSequence) != 0) {
-            rc = VDatabaseOpenTableRead(db, &seq, "SEQUENCE");
-            if (rc) break;
-        }
-        if ((tables & tbReference) != 0) {
-            rc = VDatabaseOpenTableRead(db, &ref, "REFERENCE");
-            if (rc) break;
-        }
-        rc = dbric_align(name, pri, seq, ref);
-        break;
-    }
-    return rc;    
-}
-
-static rc_t verify_database(VDatabase const *db,
-    char const name[], node_t const nodes[], char const names[])
-{
-    char schemaName[1024];
-    char *schemaVers = NULL;
-    rc_t rc;
-    
-    rc = get_db_schema_info(db, schemaName, sizeof(schemaName), &schemaVers);
-    if (rc) {
-        (void)PLOGERR(klogErr, (klogErr, rc,
-            "Failed to find database schema for '$(name)'", "name=%s", name));
-    }
-    else if (strncmp(schemaName, "NCBI:var:db:", 12) == 0) {
-        /* TODO: verify NCBI:var:db:* */
-    }
-    else if (strncmp(schemaName, "NCBI:WGS:db:", 12) == 0) {
-        /* TODO: verify NCBI:WGS:db:* */
-    }
-    else if (strncmp(schemaName, "NCBI:align:db:", 14) == 0) {
-        rc = verify_database_align(db, name, nodes, names);
-    }
-    else if (strcmp(schemaName, "NCBI:SRA:PacBio:smrt:db") == 0) {
-        /* TODO: verify NCBI:SRA:PacBio:smrt:db */
-    }
-    else {
-        (void)PLOGERR(klogWarn, (klogWarn,
-            RC(rcExe, rcDatabase, rcValidating, rcType, rcUnrecognized),
-            "Database '$(name)' has unrecognized type '$(type)'",
-            "name=%s,type=%s", name, schemaName));
-    }
-    return rc;
-}
-
-static rc_t verify_mgr_database(VDBManager const *mgr,
-    char const name[], node_t const nodes[], char const names[])
-{
-    VDatabase const *child;
-    rc_t rc = VDBManagerOpenDBRead(mgr, &child, NULL, name);
-    
-    if (rc == 0) {
-        rc = verify_database(child, name, nodes, names);
-        VDatabaseRelease(child);
-    }
-
-    return rc;
-}
-
-static rc_t sra_dbcc(const VDBManager *mgr,
-    char const name[], node_t const nodes[], char const names[])
-{
-    rc_t rc;
-
-    if (nodes[0].objType == kptDatabase)
-        rc = verify_mgr_database(mgr, name, nodes, names);
-    else
-        rc = verify_mgr_table(mgr, name);
-    
-    return rc;
-}
-
-static
-rc_t get_platform(const VDBManager *mgr,
-    const VTable *aTbl, char const name[],
-    INSDC_SRA_platform_id *platform)
-{
-    rc_t rc = 0;
-    const VTable *tbl = aTbl;
-    assert(name && platform);
-    if (tbl == NULL) {
-        VSchema *sra_schema = NULL;
-        for ( ; rc == 0; ) {
-            rc = VDBManagerOpenTableRead(mgr, &tbl, sra_schema, name);
-            VSchemaRelease(sra_schema);
-            if (rc == 0) {
-                rc = VTable_get_platform(tbl, platform);
-                break;
-            }
-            else if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcSchema
-                && sra_schema == NULL)
-            {
-                rc = VDBManagerMakeSRASchema(mgr, &sra_schema);
-            }
-        }
-    }
-
-    if (aTbl == NULL)
-        VTableRelease(tbl);
-
-    return rc;
-}
-
-typedef struct vdb_validate_params vdb_validate_params;
-struct vdb_validate_params
-{
-    const KDirectory *wd;
-    const KDBManager *kmgr;
-    const VDBManager *vmgr;
-
-    bool md5_chk;
-    bool md5_chk_explicit;
-    bool blob_crc;
-    bool index_chk;
-};
-
-static
-rc_t dbcc ( const vdb_validate_params *pb, const char *path, bool is_file )
-{
-    char *names;
-    KPathType pathType = kptNotFound;
-    node_t *nodes = NULL;
-    const char *obj_type, *obj_name;
-
-    rc_t rc = init_dbcc ( pb -> wd, path, is_file, & nodes, & names, & pathType );
-    if ( rc == 0 )
-    {
-        /* construct mode */
-        uint32_t mode = ( pb -> md5_chk ? 1 : 0 )
-                      | ( pb -> blob_crc ? 2 : 0 )
-                      | ( pb -> index_chk ? 4 : 0 )
-                      ;
-
-        INSDC_SRA_platform_id platform = SRA_PLATFORM_UNDEFINED;
-        get_platform ( pb -> vmgr, NULL, path, & platform );
-
-        /* check as kdb object */
-        rc = kdbcc ( pb -> kmgr, path, mode, & pathType, is_file, nodes, names, platform );
-        if ( rc == 0 )
-            rc = vdbcc ( pb -> vmgr, path, mode, & pathType, is_file );
-        if ( rc == 0 )
-            rc = sra_dbcc ( pb -> vmgr, path, nodes, names );
-    }
-
-    obj_type = ( pathType == kptDatabase ) ? "Database" : "Table";
-    obj_name = strrchr ( path, '/' );
-    if ( obj_name ++ == NULL )
-        obj_name = path;
-
-    if ( rc != 0 )
-    {
-        PLOGERR ( klogErr, ( klogErr, rc,
-                             "$(objType) '$(objName)' check failed"
-                             , "objType=%s,objName=%s"
-                             , obj_type, obj_name ) );
-    }
-    else
-    {
-        PLOGMSG ( klogInfo, ( klogInfo,
-                              "$(objType) '$(objName)' is consistent"
-                             , "objType=%s,objName=%s"
-                             , obj_type, obj_name ) );
-    }
-
-    free ( nodes );
-    return rc;
-}
-
-static
-const char *generate_relpath ( const vdb_validate_params *pb, const KDirectory *dir,
-    char *buffer, size_t bsize, const char *path )
-{
-    if ( dir != pb -> wd )
-    {
-        char full [ 4096 ];
-        rc_t rc = KDirectoryResolvePath ( dir, true, full, sizeof full, path );
-        if ( rc == 0 )
-        {
-            rc = KDirectoryResolvePath ( pb -> wd, false, buffer, bsize, full );
-            if ( rc == 0 )
-                path = buffer;
-        }
-    }
-
-    return path;
-}
-
-static
-rc_t vdb_validate_file ( const vdb_validate_params *pb, const KDirectory *dir, const char *path )
-{
-    char buffer [ 4096 ];
-    const char *relpath = generate_relpath ( pb, dir, buffer, sizeof buffer, path );
-
-    const KFile *f;
-    rc_t rc = KDirectoryOpenFileRead ( dir, & f, path );
-    if ( rc != 0 )
-        PLOGERR ( klogErr, ( klogErr, rc, "File '$(fname)' could not be opened", "fname=%s", relpath ) );
-    else
-    {
-        bool is_sra = false;
-        enum EEncrypted {
-            eNo,
-            eEncrypted,
-            eWGA
-        } encrypted = eNo;
-
-        size_t num_read;
-        char buffer [ 4096 ];
-        rc = KFileReadAll ( f, 0, buffer, sizeof buffer, & num_read );
-        if ( rc != 0 )
-            PLOGERR ( klogErr, ( klogErr, rc, "File '$(fname)' could not be read", "fname=%s", relpath ) );
-        else {
-            /* special kludge to prevent code from looking too far at header */
-            size_t hdr_bytes = num_read;
-            if ( num_read > 8 )
-                hdr_bytes = 8;
-
-            /* check for encrypted file */
-            if ( KFileIsEnc ( buffer, hdr_bytes ) == 0 ) {
-                encrypted = eEncrypted;
-            }
-            else if ( KFileIsWGAEnc ( buffer, hdr_bytes ) == 0 ) {
-                encrypted = eWGA;
-            }
-
-            if (encrypted != eNo) {
-                PLOGMSG ( klogInfo, ( klogInfo,
-                    "Validating $(type)encrypted file '$(fname)'...",
-                    "type=%s,fname=%s",
-                    encrypted == eWGA ? "WGA " : " ", relpath ) );
-                switch (encrypted) {
-                    case eEncrypted:
-                        rc = KEncFileValidate(f);
-                        break;
-                    case eWGA: {
-                        VFSManager *mgr = NULL;
-                        rc = VFSManagerMake(&mgr);
-                        if (rc != 0) {
-                            LOGERR(klogInt, rc, "Cannot VFSManagerMake");
-                        }
-                        else {
-                            rc = VFSManagerWGAValidateHack(mgr, f, relpath);
-                        }
-                        VFSManagerRelease(mgr);
-                        break;
-                    }
-                    default:
-                        assert(0);
-                }
-                if ( rc != 0 ) {
-                    PLOGERR ( klogErr, ( klogErr, rc,
-                        "Encrypted file '$(fname)' could not be validated",
-                        "fname=%s", relpath ) );
-                }
-                else {
-                    PLOGMSG ( klogInfo, ( klogInfo,
-                        "Encrypted file '$(fname)' appears valid",
-                        "fname=%s", relpath ) );
-
-                    rc = EncFileReadAll ( relpath, buffer, sizeof buffer,
-                        & num_read );
-                    if ( rc == 0 && KFileIsSRA ( buffer, num_read ) == 0 )
-                        is_sra = true;
-                }
-            }
-            else if ( KFileIsSRA ( buffer, num_read ) == 0 ) {
-                is_sra = true;
-            }
-        }
-
-        KFileRelease ( f );
-
-        if ( rc == 0 && is_sra )
-            rc = dbcc ( pb, relpath, true );
-    }
-
-    return rc;
-}
-
-static
-rc_t vdb_validate_database ( const vdb_validate_params *pb, const KDirectory *dir, const char *path )
-{
-    char buffer [ 4096 ];
-    const char *relpath = generate_relpath ( pb, dir, buffer, sizeof buffer, path );
-    return dbcc ( pb, relpath, false );
-}
-
-static
-rc_t vdb_validate_table ( const vdb_validate_params *pb, const KDirectory *dir, const char *path )
-{
-    char buffer [ 4096 ];
-    const char *relpath = generate_relpath ( pb, dir, buffer, sizeof buffer, path );
-    return dbcc ( pb, relpath, false );
-}
-
-static
-KPathType vdb_subdir_type ( const vdb_validate_params *pb, const KDirectory *dir, const char *name )
-{
-    char full [ 4096 ];
-    rc_t rc = KDirectoryResolvePath ( dir, true, full, sizeof full, name );
-    if ( rc == 0 )
-    {
-        switch ( KDBManagerPathType ( pb -> kmgr, full ) )
-        {
-        case kptDatabase:
-            return kptDatabase;
-        case kptTable:
-            return kptTable;
-        }
-    }
-    return kptDir;
-}
-
-static
-rc_t CC vdb_validate_dir ( const KDirectory *dir, uint32_t type, const char *name, void *data )
-{
-    switch ( type & ~ kptAlias )
-    {
-    case kptFile:
-        return vdb_validate_file ( data, dir, name );
-    case kptDir:
-        switch ( vdb_subdir_type ( data, dir, name ) )
-        {
-        case kptDatabase:
-            return vdb_validate_database ( data, dir, name );
-        case kptTable:
-            return vdb_validate_table ( data, dir, name );
-        default:
-            return KDirectoryVisit ( dir, false, vdb_validate_dir, data, name );
-        }
-    }
-
-    return 0;
-}
-
-#define rcResolver   rcTree
-static bool NotFoundByResolver(rc_t rc) {
-    if (GetRCModule(rc) == rcVFS) {
-        if (GetRCTarget(rc) == rcResolver) {
-            if (GetRCContext(rc) == rcResolving) {
-                if (GetRCState(rc) == rcNotFound) {
-                    return true;
-                }
-            }
-        }
-    }
-    return false;
-}
-
-static rc_t vdb_validate(const vdb_validate_params *pb, const char *aPath) {
-    bool bad = false;
-    const String *local = NULL;
-    VFSManager *mgr = NULL;
-    VResolver *resolver = NULL;
-    const char *path = aPath;
-    KPathType pt = kptNotFound;
-
-    rc_t rc = VFSManagerMake(&mgr);
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "Cannot VFSManagerMake");
-        return rc;
-    }
-
-    rc = VFSManagerGetResolver(mgr, &resolver);
-    if (rc != 0) {
-        LOGERR(klogInt, rc, "Cannot VFSManagerGetResolver");
-    }
-    else {
-        VResolverRemoteEnable(resolver, vrAlwaysDisable);
-    }
-
-    /* what type of thing is this path? */
-    pt = KDirectoryPathType(pb->wd, path);
-
-    if ((pt & ~kptAlias) == kptNotFound) {
-        const VPath *pLocal = NULL;
-        VPath *acc = NULL;
-        bad = true;
-        rc = VFSManagerMakePath (mgr, &acc, path);
-        if (rc != 0) {
-            PLOGERR(klogErr, (klogErr, rc,
-                "VPathMake($(path)) failed", PLOG_S(path), path));
-        }
-        else {
-            rc = VResolverLocal(resolver, acc, &pLocal);
-            if (rc != 0 && NotFoundByResolver(rc)) {
-                bad = false;
-                PLOGMSG(klogInfo, (klogInfo,
-                    "'$(fname)' could not be found", "fname=%s", path));
-            }
-        }
-
-        if (rc == 0) {
-            rc = VPathMakeString(pLocal, &local);
-            if (rc != 0) {
-                PLOGERR(klogErr, (klogErr, rc,
-                    "VPathMake(local $(path)) failed", PLOG_S(path), path));
-            }
-        }
-
-        if (rc == 0) {
-            path = local->addr;
-            PLOGMSG(klogInfo, (klogInfo,
-                "Validating '$(path)'...", PLOG_S(path), path));
-            pt = KDirectoryPathType(pb -> wd, path);
-            bad = false;
-        }
-
-        RELEASE(VPath, acc);
-        RELEASE(VPath, pLocal);
-    }
-    RELEASE(VFSManager, mgr);
-    RELEASE(VResolver, resolver);
-
-    if (rc == 0) {
-        switch (pt & ~kptAlias) {
-            case kptNotFound:
-                rc = RC(rcExe, rcPath, rcValidating, rcPath, rcNotFound);
-                bad = true;
-                break;
-            case kptBadPath:
-                rc = RC(rcExe, rcPath, rcValidating, rcPath, rcInvalid);
-                bad = true;
-                break;
-            case kptFile:
-                rc = vdb_validate_file(pb, pb->wd, path);
-                break;
-            case kptDir:
-                switch(KDBManagerPathType (pb->kmgr, path)) {
-                    case kptDatabase:
-                        rc = vdb_validate_database(pb, pb->wd, path);
-                        break;
-                    case kptTable:
-                    case kptPrereleaseTbl:
-                        rc = vdb_validate_table(pb, pb->wd, path);
-                        break;
-                    case kptIndex:
-                    case kptColumn:
-                        rc = RC(rcExe, rcPath, rcValidating,
-                            rcType, rcUnsupported);
-                        bad = true;
-                        break;
-                    default:
-                        rc = KDirectoryVisit(pb -> wd, false,
-                            vdb_validate_dir, (void*)pb, path);
-                        break;
-                }
-                break;
-            default:
-                break;
-        }
-    }
-
-    free((void*)local);
-
-    if (bad) {
-        PLOGMSG ( klogWarn, ( klogWarn,
-            "Path '$(fname)' could not be validated", "fname=%s", path ) );
-    }
-
-    return rc;
-}
-
-static char const* const defaultLogLevel = 
-#if _DEBUGGING
-"debug5";
-#else
-"info";
-#endif
-
-/******************************************************************************
- * Usage
- ******************************************************************************/
-const char UsageDefaultName[] = "vdb-validate";
-
-rc_t CC UsageSummary(const char *prog_name)
-{
-    return KOutMsg ( "Usage: %s [options] path [ path... ]\n"
-                     "\n"
-                     , prog_name );
-}
-
-/*static char const *help_text[] = 
-{
-    "Check components md5s if present, "
-            "fail unless other checks are requested (default: yes)", NULL,
-    "Check blobs CRC32 (default: no)", NULL,
-    "Check 'skey' index (default: no)", NULL,
-    "Continue checking object for all possible errors (default: no)", NULL,
-    "Check data referential integrity for databases (default: no)", NULL,
-    "Check index-only with blobs CRC32 (default: no)", NULL
-};*/
-
-#define OPTION_md5 "md5"
-#define ALIAS_md5  "5"
-static const char *USAGE_MD5[] = { "Check components md5s if present, "
-    "fail unless other checks are requested (default: yes)", NULL };
-/*
-#define ALIAS_MD5  "M"
-#define OPTION_MD5 "MD5"
-*/
-#define OPTION_blob_crc "blob-crc"
-#define ALIAS_blob_crc  "b"
-static const char *USAGE_BLOB_CRC[] =
-{ "Check blobs CRC32 (default: yes)", NULL };
-
-#define ALIAS_BLOB_CRC  "B"
-#define OPTION_BLOB_CRC "BLOB-CRC"
-
-#if CHECK_INDEX
-#define ALIAS_INDEX  "i"
-#define OPTION_INDEX "index"
-static const char *USAGE_INDEX[] = { "Check 'skey' index (default: no)", NULL };
-#endif
-
-#define ALIAS_EXHAUSTIVE  "x"
-#define OPTION_EXHAUSTIVE "exhaustive"
-static const char *USAGE_EXHAUSTIVE[] =
-{ "Continue checking object for all possible errors (default: false)", NULL };
-
-#define OPTION_ref_int "referential-integrity"
-#define ALIAS_ref_int  "d"
-static const char *USAGE_REF_INT[] =
-{ "Check data referential integrity for databases (default: yes)", NULL };
-
-#define ALIAS_REF_INT  "I"
-#define OPTION_REF_INT "REFERENTIAL-INTEGRITY"
-
-static const char *USAGE_DRI[] =
-{ "Do not check data referential integrity for databases", NULL };
-
-static const char *USAGE_IND_ONLY[] =
-{ "Check index-only with blobs CRC32 (default: no)", NULL };
-
-static OptDef options [] = 
-{                                                    /* needs_value, required */
-/*  { OPTION_MD5     , ALIAS_MD5     , NULL, USAGE_MD5     , 1, true , false }*/
-    { OPTION_BLOB_CRC, ALIAS_BLOB_CRC, NULL, USAGE_BLOB_CRC, 1, true , false }
-#if CHECK_INDEX
-  , { OPTION_INDEX   , ALIAS_INDEX   , NULL, USAGE_INDEX   , 1, false, false }
-#endif
-  , { OPTION_EXHAUSTIVE,
-                   ALIAS_EXHAUSTIVE, NULL, USAGE_EXHAUSTIVE, 1, false, false }
-  , { OPTION_REF_INT , ALIAS_REF_INT , NULL, USAGE_REF_INT , 1, true , false }
-
-    /* not printed by --help */
-  , { "dri"          , NULL          , NULL, USAGE_DRI     , 1, false, false }
-  , { "index-only"   ,NULL           , NULL, USAGE_IND_ONLY, 1, false, false }
-
-    /* obsolete options for backward compatibility */
-  , { OPTION_md5     , ALIAS_md5     , NULL, USAGE_MD5     , 1, false, false }
-  , { OPTION_blob_crc, ALIAS_blob_crc, NULL, USAGE_BLOB_CRC, 1, false, false }
-  , { OPTION_ref_int , ALIAS_ref_int , NULL, USAGE_REF_INT , 1, false, false }
-};
-/*
-#define NUM_SILENT_TRAILING_OPTIONS 5
-
-static const char *option_params [] =
-{
-    NULL
-  , NULL
-#if CHECK_INDEX
-  , NULL
-#endif
-  , NULL
-  , NULL
-  , NULL
-  , NULL
-};
-*/
-rc_t CC Usage ( const Args * args )
-{
-/*  uint32_t i; */
-    const char *progname, *fullpath;
-    rc_t rc = ArgsProgram ( args, & fullpath, & progname );
-    if ( rc != 0 )
-        progname = fullpath = UsageDefaultName;
-    
-    UsageSummary ( progname );
-    
-    KOutMsg ( "  Examine directories, files and VDB objects,\n"
-              "  reporting any problems that can be detected.\n"
-              "\n"
-              "Components md5s are always checked if present.\n"
-              "\n"
-              "Options:\n"
-        );
-
-/*  HelpOptionLine(ALIAS_MD5     , OPTION_MD5     , "yes | no", USAGE_MD5); */
-    HelpOptionLine(ALIAS_BLOB_CRC, OPTION_BLOB_CRC, "yes | no", USAGE_BLOB_CRC);
-#if CHECK_INDEX
-    HelpOptionLine(ALIAS_INDEX   , OPTION_INDEX   , "yes | no", USAGE_INDEX);
-#endif
-    HelpOptionLine(ALIAS_REF_INT , OPTION_REF_INT , "yes | no", USAGE_REF_INT);
-    HelpOptionLine(ALIAS_EXHAUSTIVE, OPTION_EXHAUSTIVE, NULL, USAGE_EXHAUSTIVE);
-
-/*
-#define NUM_LISTABLE_OPTIONS \
-    ( sizeof options / sizeof options [ 0 ] - NUM_SILENT_TRAILING_OPTIONS )
-
-    for ( i = 0; i < NUM_LISTABLE_OPTIONS; ++i )
-    {
-        HelpOptionLine ( options [ i ] . aliases, options [ i ] . name,
-            option_params [ i ], options [ i ] . help );
-    }
-*/
-    HelpOptionsStandard ();
-    
-    HelpVersion ( fullpath, KAppVersion () );
-    
-    return 0;
-}
-
-uint32_t CC KAppVersion ( void )
-{
-    return VDB_VALIDATE_VERS;
-}
-
-static
-rc_t parse_args ( vdb_validate_params *pb, Args *args )
-{
-    const char *dummy = NULL;
-    rc_t rc;
-    uint32_t cnt;
-
-    pb -> md5_chk = true;
-    ref_int_check = pb -> blob_crc
-        = pb -> md5_chk_explicit = md5_required = true;
-/*
-    rc = ArgsOptionCount(args, OPTION_MD5, &cnt);
-    if (rc != 0) {
-        LOGERR(klogErr, rc, "Failure to get '" OPTION_MD5 "' argument");
-        return rc;
-    }
-    if (cnt != 0) {
-        rc = ArgsOptionValue(args, OPTION_MD5, 0, &dummy);
-        if (rc != 0) {
-            LOGERR(klogErr, rc, "Failure to get '" OPTION_MD5 "' argument");
-            return rc;
-        }
-        assert(dummy && dummy[0]);
-        if (dummy[0] == 'n') {
-            pb -> md5_chk_explicit = md5_required = false;
-        }
-    }
-*/
-    rc = ArgsOptionCount( args, OPTION_BLOB_CRC, &cnt);
-    if (rc != 0) {
-        LOGERR(klogErr, rc, "Failure to get '" OPTION_BLOB_CRC "' argument");
-        return rc;
-    }
-    if (cnt != 0) {
-        rc = ArgsOptionValue(args, OPTION_BLOB_CRC, 0, &dummy);
-        if (rc != 0) {
-            LOGERR(klogErr, rc,
-                "Failure to get '" OPTION_BLOB_CRC "' argument");
-            return rc;
-        }
-        assert(dummy && dummy[0]);
-        if (dummy[0] == 'n') {
-            pb -> blob_crc = false;
-        }
-    }
-
-    rc = ArgsOptionCount ( args, "exhaustive", & cnt );
-    if ( rc != 0 )
-        return rc;
-    exhaustive = cnt != 0;
-
-    rc = ArgsOptionCount(args, OPTION_REF_INT, &cnt);
-    if (rc != 0) {
-        LOGERR(klogErr, rc, "Failure to get '" OPTION_REF_INT "' argument");
-        return rc;
-    }
-    if (cnt != 0) {
-        rc = ArgsOptionValue(args, OPTION_REF_INT, 0, &dummy);
-        if (rc != 0) {
-            LOGERR(klogErr, rc,
-                "Failure to get '" OPTION_REF_INT "' argument");
-            return rc;
-        }
-        assert(dummy && dummy[0]);
-        if (dummy[0] == 'n') {
-            ref_int_check = false;
-        }
-    }
-
-    rc = ArgsOptionCount ( args, "dri", & cnt );
-    if ( rc != 0 )
-        return rc;
-    if (cnt != 0) {
-        ref_int_check = false;
-    }
-
-#if CHECK_INDEX
-    rc = ArgsOptionCount ( args, "index", & cnt );
-    if ( rc != 0 )
-        return rc;
-    pb -> index_chk = cnt != 0;
-#endif
-
-    rc = ArgsOptionCount ( args, "index-only", & cnt );
-    if ( rc != 0 )
-        return rc;
-    if ( cnt != 0 )
-        s_IndexOnly = pb -> blob_crc = true;
-
-    if ( pb -> blob_crc || pb -> index_chk )
-        pb -> md5_chk = pb -> md5_chk_explicit;
-
-    return 0;
-}
-
-static
-void vdb_validate_params_whack ( vdb_validate_params *pb )
-{
-    VDBManagerRelease ( pb -> vmgr );
-    KDBManagerRelease ( pb -> kmgr );
-    KDirectoryRelease ( pb -> wd );
-    memset ( pb, 0, sizeof * pb );
-}
-
-static
-rc_t vdb_validate_params_init ( vdb_validate_params *pb )
-{
-    rc_t rc;
-    KDirectory *wd;
-
-    memset ( pb, 0, sizeof * pb );
-
-    rc = KDirectoryNativeDir ( & wd );
-    if ( rc == 0 )
-    {
-        pb -> wd = wd;
-        rc = VDBManagerMakeRead ( & pb -> vmgr, wd );
-        if ( rc == 0 )
-        {
-            rc = VDBManagerOpenKDBManagerRead ( pb -> vmgr, & pb -> kmgr );
-            if ( rc == 0 )
-                return 0;
-        }
-    }
-
-    vdb_validate_params_whack ( pb );
-    return rc;
-}
-
-rc_t CC KMain ( int argc, char *argv [] )
-{
-    Args * args;
-    rc_t rc = ArgsMakeAndHandle ( & args, argc, argv, 1,
-        options, sizeof options / sizeof options [ 0 ] );
-    if ( rc != 0 )
-        LOGERR ( klogErr, rc, "Failed to parse command line" );
-    else
-    {
-        uint32_t pcount;
-        rc = ArgsParamCount ( args, & pcount );
-        if ( rc != 0 )
-            LOGERR ( klogErr, rc, "Failed to count command line parameters" );
-        else if ( argc <= 1 )
-        {
-            rc = RC ( rcExe, rcPath, rcValidating, rcParam, rcInsufficient );
-            MiniUsage ( args );
-        }
-        else if ( pcount == 0 )
-        {
-            rc = RC ( rcExe, rcPath, rcValidating, rcParam, rcInsufficient );
-            LOGERR ( klogErr, rc, "No paths to validate" );
-            MiniUsage ( args );
-        }
-        else
-        {
-            vdb_validate_params pb;
-            rc = vdb_validate_params_init ( & pb );
-            if ( rc != 0 )
-                LOGERR ( klogErr, rc, "Failed to initialize internal managers" );
-            else
-            {
-                rc = parse_args ( & pb, args );
-                if ( rc != 0 )
-                    LOGERR ( klogErr, rc, "Failed to extract command line options" );
-                else
-                {
-                    rc = KLogLevelSet ( klogInfo );
-                    if ( rc != 0 )
-                        LOGERR ( klogErr, rc, "Failed to set log level" );
-                    else
-                    {
-                        uint32_t i;
-                        STSMSG(2, ("exhaustive = %d", exhaustive));
-                        STSMSG(2, ("ref_int_check = %d", ref_int_check));
-                        STSMSG(2, ("md5_required = %d", md5_required));
-                        STSMSG(2, ("P {"));
-                        STSMSG(2, ("\tmd5_chk = %d", pb.md5_chk));
-                        STSMSG(2, ("\tmd5_chk_explicit = %d",
-                            pb.md5_chk_explicit));
-                        STSMSG(2, ("\tblob_crc = %d", pb.blob_crc));
-                        STSMSG(2, ("}"));
-                        for ( i = 0; i < pcount; ++ i )
-                        {
-                            rc_t rc2;
-                            const char *path;
-                            rc = ArgsParamValue ( args, i, & path );
-                            if ( rc != 0 )
-                            {
-                                LOGERR ( klogErr, rc, "Failed to extract command line options" );
-                                break;
-                            }
-
-                            rc2 = vdb_validate ( & pb, path );
-                            if ( rc == 0 )
-                                rc = rc2;
-                        }
-                    }
-                }
-
-                vdb_validate_params_whack ( & pb );
-            }
-        }
-
-        ArgsWhack ( args );
-    }
-
-    return rc;
-}
diff --git a/tools/vdb-validate/vdb-validate.vers b/tools/vdb-validate/vdb-validate.vers
deleted file mode 100644
index 0bee604..0000000
--- a/tools/vdb-validate/vdb-validate.vers
+++ /dev/null
@@ -1 +0,0 @@
-2.3.3

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/sra-sdk.git



More information about the debian-med-commit mailing list